From 817fc737012676a0ec80f2d118c693f2d71e25b0 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Fri, 20 Dec 2019 21:31:03 +0100 Subject: [PATCH] Import dcmtk_3.6.5.orig.tar.gz [dgit import orig dcmtk_3.6.5.orig.tar.gz] --- ANNOUNCE | 169 + CHANGES | 12 + CMake/3rdparty.cmake | 411 + CMake/CTest/CTestCustomAndroid.cmake.in | 98 + CMake/CTest/CTestCustomWine.cmake.in | 17 + CMake/CTest/dcmtkCTestMacros.cmake | 27 + CMake/CTest/dcmtkCTestRun.cmake.in | 18 + CMake/CTest/dcmtkCTestRunAndroid.cmake.in | 33 + CMake/CTest/dcmtkCTestRunExhaustive.cmake | 6 + CMake/CTest/dcmtkCTestRunWine.cmake.in | 23 + CMake/CheckCMakeCommandExists.cmake | 12 + CMake/CheckFunctionWithHeaderExists.cmake | 57 + CMake/DCMTKConfig.cmake.in | 61 + CMake/DCMTKConfig.old_cmake.in | 52 + CMake/FindCharset.cmake | 22 + CMake/FindICU.cmake | 690 + CMake/FindIconv.cmake | 33 + CMake/FindOpenJPEG.cmake | 36 + CMake/FindSndfile.cmake | 32 + CMake/FindWrap.cmake | 32 + CMake/GenerateCMakeExports.cmake | 81 + CMake/GenerateDCMTKConfigure.cmake | 1527 + CMake/dcmtkAfterModules.cmake | 27 + CMake/dcmtkMacros.cmake | 188 + CMake/dcmtkPrepare.cmake | 595 + CMake/dcmtkTestCharSignedness.cc | 6 + CMake/dcmtkTryCompile.cmake | 43 + CMake/dcmtkTryRun.cmake | 95 + CMake/dcmtkUseAndroidSDK.cmake | 647 + CMake/dcmtkUseWine.cmake | 127 + CMake/dcmtkWinePath.reg.in | 4 + CMake/osconfig.h.in | 1226 + CMakeLists.txt | 197 + COPYRIGHT | 1006 + CREDITS | 61 + FAQ | 3 + HISTORY | 65 + INSTALL | 937 + Makefile | 987 + README | 58 + README.md | 37 + VERSION | 1 + config/CMakeLists.txt | 5 + config/Makefile.def.in | 107 + config/Makefile.in | 69 + config/aclocal.m4 | 2052 ++ config/autoall | 29 + config/changext | 149 + config/config.guess | 1530 + config/config.sub | 1779 + config/configure | 18404 ++++++++++ config/configure.in | 1890 + config/confmod | 2915 ++ config/confmod.in | 36 + config/docs/CMakeLists.txt | 2 + config/docs/config.dox | 40 + config/docs/config.txt | 122 + config/docs/cxx11.dox | 139 + config/docs/dirstruc.txt | 30 + config/docs/envvars.txt | 52 + config/docs/macros.txt | 453 + config/docs/modules.txt | 65 + config/general.m4 | 7 + config/include/dcmtk/config/osconfig.h.in | 1205 + config/install-sh | 527 + config/math.cc | 129 + config/mkinstalldirs | 162 + config/modules | 1 + config/rootconf | 272 + config/stdcxx.m4 | 980 + config/templates/Makefile.lib | 51 + config/templates/Makefile.mod | 93 + config/templates/Makefile.src | 48 + config/templates/configure.mod | 52 + config/tests/algo.cc | 58 + config/tests/arith.cc | 636 + config/tests/cxx11.cc | 296 + config/tests/cxx14.cc | 146 + config/tests/cxx17.cc | 383 + config/tests/iconv.cc | 52 + config/tests/lciconv.cc | 29 + config/tests/lfs.c | 30 + config/tests/lfs64.cc | 29 + config/tests/limits.cc | 44 + config/tests/list.cc | 69 + config/tests/map.cc | 59 + config/tests/memory.cc | 55 + config/tests/stack.cc | 44 + config/tests/string.cc | 49 + config/tests/syserr.cc | 58 + config/tests/ttraits.cc | 65 + config/tests/tuple.cc | 47 + config/tests/vector.cc | 96 + dcmdata/CMakeLists.txt | 10 + dcmdata/Makefile.in | 102 + dcmdata/apps/CMakeLists.txt | 17 + dcmdata/apps/Makefile.dep | 1488 + dcmdata/apps/Makefile.in | 102 + dcmdata/apps/cda2dcm.cc | 143 + dcmdata/apps/dcm2json.cc | 277 + dcmdata/apps/dcm2pdf.cc | 354 + dcmdata/apps/dcm2xml.cc | 576 + dcmdata/apps/dcmconv.cc | 641 + dcmdata/apps/dcmcrle.cc | 326 + dcmdata/apps/dcmdrle.cc | 297 + dcmdata/apps/dcmdump.cc | 882 + dcmdata/apps/dcmftest.cc | 88 + dcmdata/apps/dcmgpdir.cc | 660 + dcmdata/apps/dcmodify.cc | 40 + dcmdata/apps/dump2dcm.cc | 1096 + dcmdata/apps/img2dcm.cc | 420 + dcmdata/apps/mdfconen.cc | 663 + dcmdata/apps/mdfconen.h | 226 + dcmdata/apps/mdfdsman.cc | 744 + dcmdata/apps/mdfdsman.h | 257 + dcmdata/apps/pdf2dcm.cc | 134 + dcmdata/apps/stl2dcm.cc | 134 + dcmdata/apps/xml2dcm.cc | 1034 + dcmdata/configure | 56 + dcmdata/data/CMakeLists.txt | 9 + dcmdata/data/Makefile.in | 30 + dcmdata/data/SC.dump | 99 + dcmdata/data/VLP.dump | 115 + dcmdata/data/acrnema.dic | 200 + dcmdata/data/dcm2xml.dtd | 40 + dcmdata/data/dicom.dic | 4905 +++ dcmdata/data/diconde.dic | 173 + dcmdata/data/dumppat.txt | 4 + dcmdata/data/private.dic | 3040 ++ dcmdata/docs/CMakeLists.txt | 2 + dcmdata/docs/Makefile.in | 29 + dcmdata/docs/cda2dcm.man | 258 + dcmdata/docs/datadict.txt | 223 + dcmdata/docs/dcm2json.man | 355 + dcmdata/docs/dcm2pdf.man | 211 + dcmdata/docs/dcm2xml.man | 396 + dcmdata/docs/dcmconv.man | 392 + dcmdata/docs/dcmcrle.man | 263 + dcmdata/docs/dcmdata.dox | 100 + dcmdata/docs/dcmdrle.man | 252 + dcmdata/docs/dcmdump.man | 428 + dcmdata/docs/dcmftest.man | 44 + dcmdata/docs/dcmgpdir.man | 301 + dcmdata/docs/dcmodify.man | 586 + dcmdata/docs/dump2dcm.man | 317 + dcmdata/docs/img2dcm.man | 501 + dcmdata/docs/pdf2dcm.man | 252 + dcmdata/docs/stl2dcm.man | 268 + dcmdata/docs/xml2dcm.man | 347 + dcmdata/etc/Makefile.in | 23 + dcmdata/include/CMakeLists.txt | 2 + dcmdata/include/Makefile.in | 32 + dcmdata/include/dcmtk/dcmdata/cmdlnarg.h | 55 + dcmdata/include/dcmtk/dcmdata/dcbytstr.h | 498 + dcmdata/include/dcmtk/dcmdata/dcchrstr.h | 175 + dcmdata/include/dcmtk/dcmdata/dccodec.h | 518 + dcmdata/include/dcmtk/dcmdata/dcdatset.h | 417 + dcmdata/include/dcmtk/dcmdata/dcdatutl.h | 86 + dcmdata/include/dcmtk/dcmdata/dcddirif.h | 1630 + dcmdata/include/dcmtk/dcmdata/dcdefine.h | 44 + dcmdata/include/dcmtk/dcmdata/dcdeftag.h | 4833 +++ dcmdata/include/dcmtk/dcmdata/dcdicdir.h | 221 + dcmdata/include/dcmtk/dcmdata/dcdicent.h | 400 + dcmdata/include/dcmtk/dcmdata/dcdict.h | 302 + dcmdata/include/dcmtk/dcmdata/dcdirrec.h | 525 + dcmdata/include/dcmtk/dcmdata/dcelem.h | 1051 + dcmdata/include/dcmtk/dcmdata/dcencdoc.h | 294 + dcmdata/include/dcmtk/dcmdata/dcerror.h | 186 + dcmdata/include/dcmtk/dcmdata/dcfcache.h | 111 + dcmdata/include/dcmtk/dcmdata/dcfilefo.h | 510 + dcmdata/include/dcmtk/dcmdata/dcfilter.h | 209 + dcmdata/include/dcmtk/dcmdata/dchashdi.h | 304 + dcmdata/include/dcmtk/dcmdata/dcistrma.h | 279 + dcmdata/include/dcmtk/dcmdata/dcistrmb.h | 201 + dcmdata/include/dcmtk/dcmdata/dcistrmf.h | 332 + dcmdata/include/dcmtk/dcmdata/dcistrmz.h | 202 + dcmdata/include/dcmtk/dcmdata/dcitem.h | 1551 + dcmdata/include/dcmtk/dcmdata/dcjson.h | 411 + dcmdata/include/dcmtk/dcmdata/dclist.h | 187 + dcmdata/include/dcmtk/dcmdata/dcmatch.h | 342 + dcmdata/include/dcmtk/dcmdata/dcmetinf.h | 261 + dcmdata/include/dcmtk/dcmdata/dcobject.h | 824 + dcmdata/include/dcmtk/dcmdata/dcofsetl.h | 33 + dcmdata/include/dcmtk/dcmdata/dcostrma.h | 205 + dcmdata/include/dcmtk/dcmdata/dcostrmb.h | 168 + dcmdata/include/dcmtk/dcmdata/dcostrmf.h | 142 + dcmdata/include/dcmtk/dcmdata/dcostrmz.h | 183 + dcmdata/include/dcmtk/dcmdata/dcovlay.h | 110 + dcmdata/include/dcmtk/dcmdata/dcpath.h | 519 + dcmdata/include/dcmtk/dcmdata/dcpcache.h | 115 + dcmdata/include/dcmtk/dcmdata/dcpixel.h | 631 + dcmdata/include/dcmtk/dcmdata/dcpixseq.h | 303 + dcmdata/include/dcmtk/dcmdata/dcpxitem.h | 172 + dcmdata/include/dcmtk/dcmdata/dcrleccd.h | 180 + dcmdata/include/dcmtk/dcmdata/dcrlecce.h | 192 + dcmdata/include/dcmtk/dcmdata/dcrlecp.h | 137 + dcmdata/include/dcmtk/dcmdata/dcrledec.h | 264 + dcmdata/include/dcmtk/dcmdata/dcrledrg.h | 80 + dcmdata/include/dcmtk/dcmdata/dcrleenc.h | 416 + dcmdata/include/dcmtk/dcmdata/dcrleerg.h | 84 + dcmdata/include/dcmtk/dcmdata/dcrlerp.h | 65 + dcmdata/include/dcmtk/dcmdata/dcsequen.h | 642 + dcmdata/include/dcmtk/dcmdata/dcspchrs.h | 311 + dcmdata/include/dcmtk/dcmdata/dcstack.h | 152 + dcmdata/include/dcmtk/dcmdata/dcswap.h | 85 + dcmdata/include/dcmtk/dcmdata/dctag.h | 220 + dcmdata/include/dcmtk/dcmdata/dctagkey.h | 419 + dcmdata/include/dcmtk/dcmdata/dctk.h | 105 + dcmdata/include/dcmtk/dcmdata/dctypes.h | 255 + dcmdata/include/dcmtk/dcmdata/dcuid.h | 844 + dcmdata/include/dcmtk/dcmdata/dcvr.h | 470 + dcmdata/include/dcmtk/dcmdata/dcvrae.h | 134 + dcmdata/include/dcmtk/dcmdata/dcvras.h | 112 + dcmdata/include/dcmtk/dcmdata/dcvrat.h | 278 + dcmdata/include/dcmtk/dcmdata/dcvrcs.h | 148 + dcmdata/include/dcmtk/dcmdata/dcvrda.h | 292 + dcmdata/include/dcmtk/dcmdata/dcvrds.h | 161 + dcmdata/include/dcmtk/dcmdata/dcvrdt.h | 305 + dcmdata/include/dcmtk/dcmdata/dcvrfd.h | 236 + dcmdata/include/dcmtk/dcmdata/dcvrfl.h | 238 + dcmdata/include/dcmtk/dcmdata/dcvris.h | 141 + dcmdata/include/dcmtk/dcmdata/dcvrlo.h | 147 + dcmdata/include/dcmtk/dcmdata/dcvrlt.h | 157 + dcmdata/include/dcmtk/dcmdata/dcvrobow.h | 382 + dcmdata/include/dcmtk/dcmdata/dcvrod.h | 134 + dcmdata/include/dcmtk/dcmdata/dcvrof.h | 136 + dcmdata/include/dcmtk/dcmdata/dcvrol.h | 152 + dcmdata/include/dcmtk/dcmdata/dcvrov.h | 153 + dcmdata/include/dcmtk/dcmdata/dcvrpn.h | 320 + dcmdata/include/dcmtk/dcmdata/dcvrpobw.h | 246 + dcmdata/include/dcmtk/dcmdata/dcvrsh.h | 147 + dcmdata/include/dcmtk/dcmdata/dcvrsl.h | 233 + dcmdata/include/dcmtk/dcmdata/dcvrss.h | 232 + dcmdata/include/dcmtk/dcmdata/dcvrst.h | 158 + dcmdata/include/dcmtk/dcmdata/dcvrsv.h | 229 + dcmdata/include/dcmtk/dcmdata/dcvrtm.h | 422 + dcmdata/include/dcmtk/dcmdata/dcvruc.h | 129 + dcmdata/include/dcmtk/dcmdata/dcvrui.h | 175 + dcmdata/include/dcmtk/dcmdata/dcvrul.h | 234 + dcmdata/include/dcmtk/dcmdata/dcvrulup.h | 137 + dcmdata/include/dcmtk/dcmdata/dcvrur.h | 167 + dcmdata/include/dcmtk/dcmdata/dcvrus.h | 233 + dcmdata/include/dcmtk/dcmdata/dcvrut.h | 160 + dcmdata/include/dcmtk/dcmdata/dcvruv.h | 230 + dcmdata/include/dcmtk/dcmdata/dcwcache.h | 136 + dcmdata/include/dcmtk/dcmdata/dcxfer.h | 356 + dcmdata/include/dcmtk/dcmdata/libi2d/i2d.h | 263 + .../include/dcmtk/dcmdata/libi2d/i2dbmps.h | 227 + .../include/dcmtk/dcmdata/libi2d/i2define.h | 38 + .../include/dcmtk/dcmdata/libi2d/i2dimgs.h | 117 + .../include/dcmtk/dcmdata/libi2d/i2djpgs.h | 353 + .../include/dcmtk/dcmdata/libi2d/i2doutpl.h | 222 + .../include/dcmtk/dcmdata/libi2d/i2dplnsc.h | 108 + .../include/dcmtk/dcmdata/libi2d/i2dplsc.h | 71 + .../include/dcmtk/dcmdata/libi2d/i2dplvlp.h | 71 + dcmdata/include/dcmtk/dcmdata/vrscan.h | 39 + dcmdata/libi2d/CMakeLists.txt | 4 + dcmdata/libi2d/Makefile.dep | 329 + dcmdata/libi2d/Makefile.in | 56 + dcmdata/libi2d/i2d.cc | 735 + dcmdata/libi2d/i2dbmps.cc | 617 + dcmdata/libi2d/i2djpgs.cc | 915 + dcmdata/libi2d/i2dplnsc.cc | 260 + dcmdata/libi2d/i2dplsc.cc | 72 + dcmdata/libi2d/i2dplvlp.cc | 85 + dcmdata/libsrc/CMakeLists.txt | 51 + dcmdata/libsrc/Makefile.dep | 4092 +++ dcmdata/libsrc/Makefile.in | 111 + dcmdata/libsrc/cmdlnarg.cc | 166 + dcmdata/libsrc/dcbytstr.cc | 979 + dcmdata/libsrc/dcchrstr.cc | 304 + dcmdata/libsrc/dccodec.cc | 655 + dcmdata/libsrc/dcdatset.cc | 899 + dcmdata/libsrc/dcdatutl.cc | 135 + dcmdata/libsrc/dcddirif.cc | 5891 +++ dcmdata/libsrc/dcdicdir.cc | 1280 + dcmdata/libsrc/dcdicent.cc | 176 + dcmdata/libsrc/dcdict.cc | 902 + dcmdata/libsrc/dcdictbi.cc | 30664 ++++++++++++++++ dcmdata/libsrc/dcdirrec.cc | 1632 + dcmdata/libsrc/dcelem.cc | 2314 ++ dcmdata/libsrc/dcencdoc.cc | 1437 + dcmdata/libsrc/dcerror.cc | 85 + dcmdata/libsrc/dcfilefo.cc | 1121 + dcmdata/libsrc/dcfilter.cc | 94 + dcmdata/libsrc/dchashdi.cc | 410 + dcmdata/libsrc/dcistrma.cc | 125 + dcmdata/libsrc/dcistrmb.cc | 326 + dcmdata/libsrc/dcistrmf.cc | 259 + dcmdata/libsrc/dcistrmz.cc | 432 + dcmdata/libsrc/dcitem.cc | 4720 +++ dcmdata/libsrc/dcjson.cc | 281 + dcmdata/libsrc/dclist.cc | 295 + dcmdata/libsrc/dcmatch.cc | 385 + dcmdata/libsrc/dcmetinf.cc | 660 + dcmdata/libsrc/dcobject.cc | 641 + dcmdata/libsrc/dcostrma.cc | 103 + dcmdata/libsrc/dcostrmb.cc | 118 + dcmdata/libsrc/dcostrmf.cc | 144 + dcmdata/libsrc/dcostrmz.cc | 359 + dcmdata/libsrc/dcpath.cc | 948 + dcmdata/libsrc/dcpcache.cc | 106 + dcmdata/libsrc/dcpixel.cc | 1272 + dcmdata/libsrc/dcpixseq.cc | 440 + dcmdata/libsrc/dcpxitem.cc | 461 + dcmdata/libsrc/dcrleccd.cc | 760 + dcmdata/libsrc/dcrlecce.cc | 436 + dcmdata/libsrc/dcrlecp.cc | 63 + dcmdata/libsrc/dcrledrg.cc | 68 + dcmdata/libsrc/dcrleerg.cc | 72 + dcmdata/libsrc/dcrlerp.cc | 59 + dcmdata/libsrc/dcsequen.cc | 1523 + dcmdata/libsrc/dcspchrs.cc | 804 + dcmdata/libsrc/dcstack.cc | 265 + dcmdata/libsrc/dcswap.cc | 136 + dcmdata/libsrc/dctag.cc | 271 + dcmdata/libsrc/dctagkey.cc | 95 + dcmdata/libsrc/dctypes.cc | 49 + dcmdata/libsrc/dcuid.cc | 1765 + dcmdata/libsrc/dcvr.cc | 527 + dcmdata/libsrc/dcvrae.cc | 149 + dcmdata/libsrc/dcvras.cc | 95 + dcmdata/libsrc/dcvrat.cc | 477 + dcmdata/libsrc/dcvrcs.cc | 178 + dcmdata/libsrc/dcvrda.cc | 387 + dcmdata/libsrc/dcvrds.cc | 280 + dcmdata/libsrc/dcvrdt.cc | 417 + dcmdata/libsrc/dcvrfd.cc | 397 + dcmdata/libsrc/dcvrfl.cc | 399 + dcmdata/libsrc/dcvris.cc | 198 + dcmdata/libsrc/dcvrlo.cc | 163 + dcmdata/libsrc/dcvrlt.cc | 166 + dcmdata/libsrc/dcvrobow.cc | 881 + dcmdata/libsrc/dcvrod.cc | 212 + dcmdata/libsrc/dcvrof.cc | 212 + dcmdata/libsrc/dcvrol.cc | 214 + dcmdata/libsrc/dcvrov.cc | 214 + dcmdata/libsrc/dcvrpn.cc | 741 + dcmdata/libsrc/dcvrpobw.cc | 406 + dcmdata/libsrc/dcvrsh.cc | 163 + dcmdata/libsrc/dcvrsl.cc | 410 + dcmdata/libsrc/dcvrss.cc | 387 + dcmdata/libsrc/dcvrst.cc | 166 + dcmdata/libsrc/dcvrsv.cc | 396 + dcmdata/libsrc/dcvrtm.cc | 515 + dcmdata/libsrc/dcvruc.cc | 117 + dcmdata/libsrc/dcvrui.cc | 248 + dcmdata/libsrc/dcvrul.cc | 409 + dcmdata/libsrc/dcvrulup.cc | 138 + dcmdata/libsrc/dcvrur.cc | 191 + dcmdata/libsrc/dcvrus.cc | 384 + dcmdata/libsrc/dcvrut.cc | 167 + dcmdata/libsrc/dcvruv.cc | 395 + dcmdata/libsrc/dcwcache.cc | 91 + dcmdata/libsrc/dcxfer.cc | 910 + dcmdata/libsrc/mkdeftag.cc | 254 + dcmdata/libsrc/mkdictbi.cc | 275 + dcmdata/libsrc/vrscan.cc | 80 + dcmdata/libsrc/vrscani.h | 51 + dcmdata/libsrc/vrscanl.c | 6445 ++++ dcmdata/libsrc/vrscanl.h | 492 + dcmdata/libsrc/vrscanl.l | 125 + dcmdata/tests/CMakeLists.txt | 8 + dcmdata/tests/Makefile.dep | 1592 + dcmdata/tests/Makefile.in | 57 + dcmdata/tests/dcmpsdmp.tcl | 187 + dcmdata/tests/dctmacro.h | 126 + dcmdata/tests/tchval.cc | 278 + dcmdata/tests/tdict.cc | 117 + dcmdata/tests/telemlen.cc | 159 + dcmdata/tests/tests.cc | 115 + dcmdata/tests/tfilter.cc | 78 + dcmdata/tests/tgenuid.cc | 56 + dcmdata/tests/ti2dbmp.cc | 320 + dcmdata/tests/tmatch.cc | 165 + dcmdata/tests/tnewdcme.cc | 101 + dcmdata/tests/tparent.cc | 185 + dcmdata/tests/tparser.cc | 490 + dcmdata/tests/tpath.cc | 350 + dcmdata/tests/tpread.cc | 414 + dcmdata/tests/tspchrs.cc | 219 + dcmdata/tests/tstrval.cc | 67 + dcmdata/tests/tvrcomp.cc | 894 + dcmdata/tests/tvrdatim.cc | 144 + dcmdata/tests/tvrds.cc | 91 + dcmdata/tests/tvrfd.cc | 63 + dcmdata/tests/tvrol.cc | 48 + dcmdata/tests/tvrov.cc | 50 + dcmdata/tests/tvrpn.cc | 86 + dcmdata/tests/tvrsv.cc | 68 + dcmdata/tests/tvrui.cc | 87 + dcmdata/tests/tvruv.cc | 64 + dcmfg/CMakeLists.txt | 10 + dcmfg/Makefile.in | 86 + dcmfg/configure | 56 + dcmfg/data/Makefile.in | 23 + dcmfg/docs/Makefile.in | 23 + dcmfg/docs/dcmfg.dox | 14 + dcmfg/etc/Makefile.in | 23 + dcmfg/include/CMakeLists.txt | 2 + dcmfg/include/Makefile.in | 27 + dcmfg/include/dcmtk/dcmfg/fg.h | 114 + dcmfg/include/dcmtk/dcmfg/fgbase.h | 269 + dcmfg/include/dcmtk/dcmfg/fgdefine.h | 36 + dcmfg/include/dcmtk/dcmfg/fgderimg.h | 414 + dcmfg/include/dcmtk/dcmfg/fgfact.h | 80 + dcmfg/include/dcmtk/dcmfg/fgfracon.h | 378 + dcmfg/include/dcmtk/dcmfg/fgframeanatomy.h | 157 + dcmfg/include/dcmtk/dcmfg/fgframevoilut.h | 209 + dcmfg/include/dcmtk/dcmfg/fgimagedatatype.h | 179 + dcmfg/include/dcmtk/dcmfg/fginterface.h | 317 + .../dcmtk/dcmfg/fgparametricmapframetype.h | 124 + dcmfg/include/dcmtk/dcmfg/fgpixeltransform.h | 187 + dcmfg/include/dcmtk/dcmfg/fgpixmsr.h | 170 + dcmfg/include/dcmtk/dcmfg/fgplanor.h | 175 + dcmfg/include/dcmtk/dcmfg/fgplanorvol.h | 159 + dcmfg/include/dcmtk/dcmfg/fgplanpo.h | 157 + dcmfg/include/dcmtk/dcmfg/fgplanposvol.h | 159 + .../dcmtk/dcmfg/fgrealworldvaluemapping.h | 420 + dcmfg/include/dcmtk/dcmfg/fgseg.h | 128 + dcmfg/include/dcmtk/dcmfg/fgtypes.h | 219 + .../dcmtk/dcmfg/fgusimagedescription.h | 183 + dcmfg/include/dcmtk/dcmfg/stack.h | 140 + dcmfg/include/dcmtk/dcmfg/stackinterface.h | 73 + dcmfg/libsrc/CMakeLists.txt | 26 + dcmfg/libsrc/Makefile.dep | 2645 ++ dcmfg/libsrc/Makefile.in | 58 + dcmfg/libsrc/fg.cc | 132 + dcmfg/libsrc/fgbase.cc | 239 + dcmfg/libsrc/fgderimg.cc | 712 + dcmfg/libsrc/fgfact.cc | 155 + dcmfg/libsrc/fgfracon.cc | 376 + dcmfg/libsrc/fgframeanatomy.cc | 205 + dcmfg/libsrc/fgframevoilut.cc | 225 + dcmfg/libsrc/fgimagedatatype.cc | 269 + dcmfg/libsrc/fginterface.cc | 718 + dcmfg/libsrc/fgparametricmapframetype.cc | 147 + dcmfg/libsrc/fgpixeltransform.cc | 239 + dcmfg/libsrc/fgpixmsr.cc | 180 + dcmfg/libsrc/fgplanor.cc | 187 + dcmfg/libsrc/fgplanorvol.cc | 162 + dcmfg/libsrc/fgplanpo.cc | 168 + dcmfg/libsrc/fgplanposvol.cc | 155 + dcmfg/libsrc/fgrealworldvaluemapping.cc | 477 + dcmfg/libsrc/fgseg.cc | 140 + dcmfg/libsrc/fgtypes.cc | 187 + dcmfg/libsrc/fgusimagedescription.cc | 211 + dcmfg/libsrc/stack.cc | 107 + dcmfg/libsrc/stackinterface.cc | 275 + dcmfg/tests/CMakeLists.txt | 8 + dcmfg/tests/Makefile.dep | 307 + dcmfg/tests/Makefile.in | 58 + dcmfg/tests/t_deriv_image.cc | 164 + dcmfg/tests/t_frame_content.cc | 137 + dcmfg/tests/tests.cc | 27 + dcmimage/CMakeLists.txt | 10 + dcmimage/Makefile.in | 97 + dcmimage/apps/CMakeLists.txt | 9 + dcmimage/apps/Makefile.dep | 553 + dcmimage/apps/Makefile.in | 63 + dcmimage/apps/dcm2pnm.cc | 1546 + dcmimage/apps/dcmicmp.cc | 441 + dcmimage/apps/dcmquant.cc | 509 + dcmimage/apps/dcmscale.cc | 650 + dcmimage/configure | 56 + dcmimage/data/Makefile.in | 23 + dcmimage/docs/Makefile.in | 23 + dcmimage/docs/dcm2pnm.man | 502 + dcmimage/docs/dcmicmp.man | 377 + dcmimage/docs/dcmimage.dox | 44 + dcmimage/docs/dcmquant.man | 289 + dcmimage/docs/dcmscale.man | 271 + dcmimage/etc/Makefile.in | 23 + dcmimage/include/CMakeLists.txt | 2 + dcmimage/include/Makefile.in | 27 + dcmimage/include/dcmtk/dcmimage/dcmicmph.h | 289 + dcmimage/include/dcmtk/dcmimage/diargimg.h | 90 + dcmimage/include/dcmtk/dcmimage/diargpxt.h | 193 + dcmimage/include/dcmtk/dcmimage/dicdefin.h | 38 + dcmimage/include/dcmtk/dcmimage/dicmyimg.h | 72 + dcmimage/include/dcmtk/dcmimage/dicmypxt.h | 146 + dcmimage/include/dcmtk/dcmimage/dicocpt.h | 91 + dcmimage/include/dcmtk/dcmimage/dicoflt.h | 107 + dcmimage/include/dcmtk/dcmimage/dicoimg.h | 448 + dcmimage/include/dcmtk/dcmimage/dicomot.h | 111 + dcmimage/include/dcmtk/dcmimage/dicoopx.h | 136 + dcmimage/include/dcmtk/dcmimage/dicoopxt.h | 417 + dcmimage/include/dcmtk/dcmimage/dicopx.h | 167 + dcmimage/include/dcmtk/dcmimage/dicopxt.h | 601 + dcmimage/include/dcmtk/dcmimage/dicorot.h | 107 + dcmimage/include/dcmtk/dcmimage/dicosct.h | 109 + dcmimage/include/dcmtk/dcmimage/dihsvimg.h | 72 + dcmimage/include/dcmtk/dcmimage/dihsvpxt.h | 210 + dcmimage/include/dcmtk/dcmimage/dilogger.h | 41 + dcmimage/include/dcmtk/dcmimage/dipalimg.h | 90 + dcmimage/include/dcmtk/dcmimage/dipalpxt.h | 115 + dcmimage/include/dcmtk/dcmimage/dipipng.h | 143 + dcmimage/include/dcmtk/dcmimage/dipitiff.h | 152 + dcmimage/include/dcmtk/dcmimage/diqtcmap.h | 131 + dcmimage/include/dcmtk/dcmimage/diqtctab.h | 232 + dcmimage/include/dcmtk/dcmimage/diqtfs.h | 220 + dcmimage/include/dcmtk/dcmimage/diqthash.h | 129 + dcmimage/include/dcmtk/dcmimage/diqthitl.h | 129 + dcmimage/include/dcmtk/dcmimage/diqthitm.h | 109 + dcmimage/include/dcmtk/dcmimage/diqtid.h | 100 + dcmimage/include/dcmtk/dcmimage/diqtpbox.h | 116 + dcmimage/include/dcmtk/dcmimage/diqtpix.h | 165 + dcmimage/include/dcmtk/dcmimage/diqtstab.h | 115 + dcmimage/include/dcmtk/dcmimage/diqttype.h | 81 + dcmimage/include/dcmtk/dcmimage/diquant.h | 85 + dcmimage/include/dcmtk/dcmimage/diregist.h | 88 + dcmimage/include/dcmtk/dcmimage/dirgbimg.h | 72 + dcmimage/include/dcmtk/dcmimage/dirgbpxt.h | 134 + dcmimage/include/dcmtk/dcmimage/diybrimg.h | 72 + dcmimage/include/dcmtk/dcmimage/diybrpxt.h | 284 + dcmimage/include/dcmtk/dcmimage/diyf2img.h | 72 + dcmimage/include/dcmtk/dcmimage/diyf2pxt.h | 156 + dcmimage/include/dcmtk/dcmimage/diyp2img.h | 72 + dcmimage/include/dcmtk/dcmimage/diyp2pxt.h | 136 + dcmimage/libsrc/CMakeLists.txt | 5 + dcmimage/libsrc/Makefile.dep | 1470 + dcmimage/libsrc/Makefile.in | 58 + dcmimage/libsrc/dcmicmph.cc | 1526 + dcmimage/libsrc/diargimg.cc | 152 + dcmimage/libsrc/dicmyimg.cc | 103 + dcmimage/libsrc/dicoimg.cc | 705 + dcmimage/libsrc/dicoopx.cc | 55 + dcmimage/libsrc/dicopx.cc | 106 + dcmimage/libsrc/dihsvimg.cc | 103 + dcmimage/libsrc/dilogger.cc | 32 + dcmimage/libsrc/dipalimg.cc | 169 + dcmimage/libsrc/dipipng.cc | 235 + dcmimage/libsrc/dipitiff.cc | 208 + dcmimage/libsrc/diqtctab.cc | 546 + dcmimage/libsrc/diqtfs.cc | 101 + dcmimage/libsrc/diqthash.cc | 114 + dcmimage/libsrc/diqthitl.cc | 53 + dcmimage/libsrc/diqtpbox.cc | 65 + dcmimage/libsrc/diquant.cc | 221 + dcmimage/libsrc/diregist.cc | 136 + dcmimage/libsrc/dirgbimg.cc | 103 + dcmimage/libsrc/diybrimg.cc | 104 + dcmimage/libsrc/diyf2img.cc | 102 + dcmimage/libsrc/diyp2img.cc | 101 + dcmimage/tests/Makefile.in | 29 + dcmimgle/CMakeLists.txt | 10 + dcmimgle/Makefile.in | 97 + dcmimgle/apps/CMakeLists.txt | 9 + dcmimgle/apps/Makefile.dep | 157 + dcmimgle/apps/Makefile.in | 56 + dcmimgle/apps/dcmdspfn.cc | 305 + dcmimgle/apps/dcod2lum.cc | 171 + dcmimgle/apps/dconvlum.cc | 106 + dcmimgle/configure | 56 + dcmimgle/data/CMakeLists.txt | 2 + dcmimgle/data/Makefile.in | 29 + dcmimgle/data/camera.lut | 26 + dcmimgle/data/monitor.lut | 270 + dcmimgle/data/printer.lut | 38 + dcmimgle/data/scanner.lut | 34 + dcmimgle/docs/Makefile.in | 23 + dcmimgle/docs/dcmdspfn.man | 201 + dcmimgle/docs/dcmimgle.dox | 48 + dcmimgle/docs/dcod2lum.man | 61 + dcmimgle/docs/dconvlum.man | 59 + dcmimgle/etc/Makefile.in | 23 + dcmimgle/include/CMakeLists.txt | 2 + dcmimgle/include/Makefile.in | 27 + dcmimgle/include/dcmtk/dcmimgle/dcmimage.h | 1912 + dcmimgle/include/dcmtk/dcmimgle/dibaslut.h | 310 + dcmimgle/include/dcmtk/dcmimgle/diciefn.h | 145 + dcmimgle/include/dcmtk/dcmimgle/dicielut.h | 108 + dcmimgle/include/dcmtk/dcmimgle/dicrvfit.h | 325 + dcmimgle/include/dcmtk/dcmimgle/didefine.h | 38 + dcmimgle/include/dcmtk/dcmimgle/didislut.h | 87 + dcmimgle/include/dcmtk/dcmimgle/didispfn.h | 487 + dcmimgle/include/dcmtk/dcmimgle/didocu.h | 424 + dcmimgle/include/dcmtk/dcmimgle/diflipt.h | 334 + dcmimgle/include/dcmtk/dcmimgle/digsdfn.h | 227 + dcmimgle/include/dcmtk/dcmimgle/digsdlut.h | 122 + dcmimgle/include/dcmtk/dcmimgle/diimage.h | 678 + dcmimgle/include/dcmtk/dcmimgle/diinpx.h | 208 + dcmimgle/include/dcmtk/dcmimgle/diinpxt.h | 674 + dcmimgle/include/dcmtk/dcmimgle/diluptab.h | 251 + dcmimgle/include/dcmtk/dcmimgle/dimo1img.h | 227 + dcmimgle/include/dcmtk/dcmimgle/dimo2img.h | 289 + dcmimgle/include/dcmtk/dcmimgle/dimocpt.h | 93 + dcmimgle/include/dcmtk/dcmimgle/dimoflt.h | 113 + dcmimgle/include/dcmtk/dcmimgle/dimoimg.h | 1157 + dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h | 270 + dcmimgle/include/dcmtk/dcmimgle/dimomod.h | 285 + dcmimgle/include/dcmtk/dcmimgle/dimoopx.h | 157 + dcmimgle/include/dcmtk/dcmimgle/dimoopxt.h | 1314 + dcmimgle/include/dcmtk/dcmimgle/dimopx.h | 242 + dcmimgle/include/dcmtk/dcmimgle/dimopxt.h | 437 + dcmimgle/include/dcmtk/dcmimgle/dimorot.h | 112 + dcmimgle/include/dcmtk/dcmimgle/dimosct.h | 127 + dcmimgle/include/dcmtk/dcmimgle/diobjcou.h | 119 + dcmimgle/include/dcmtk/dcmimgle/diovdat.h | 85 + dcmimgle/include/dcmtk/dcmimgle/diovlay.h | 477 + dcmimgle/include/dcmtk/dcmimgle/diovlimg.h | 57 + dcmimgle/include/dcmtk/dcmimgle/diovpln.h | 561 + dcmimgle/include/dcmtk/dcmimgle/dipixel.h | 122 + dcmimgle/include/dcmtk/dcmimgle/diplugin.h | 77 + dcmimgle/include/dcmtk/dcmimgle/dipxrept.h | 161 + dcmimgle/include/dcmtk/dcmimgle/diregbas.h | 96 + dcmimgle/include/dcmtk/dcmimgle/dirotat.h | 347 + dcmimgle/include/dcmtk/dcmimgle/discalet.h | 1239 + dcmimgle/include/dcmtk/dcmimgle/displint.h | 187 + dcmimgle/include/dcmtk/dcmimgle/ditranst.h | 138 + dcmimgle/include/dcmtk/dcmimgle/diutils.h | 466 + dcmimgle/libsrc/CMakeLists.txt | 4 + dcmimgle/libsrc/Makefile.dep | 1492 + dcmimgle/libsrc/Makefile.in | 57 + dcmimgle/libsrc/dcmimage.cc | 795 + dcmimgle/libsrc/dibaslut.cc | 102 + dcmimgle/libsrc/diciefn.cc | 241 + dcmimgle/libsrc/dicielut.cc | 198 + dcmimgle/libsrc/didislut.cc | 49 + dcmimgle/libsrc/didispfn.cc | 675 + dcmimgle/libsrc/didocu.cc | 444 + dcmimgle/libsrc/digsdfn.cc | 430 + dcmimgle/libsrc/digsdlut.cc | 218 + dcmimgle/libsrc/diimage.cc | 889 + dcmimgle/libsrc/diinpx.cc | 56 + dcmimgle/libsrc/diluptab.cc | 545 + dcmimgle/libsrc/dimo1img.cc | 154 + dcmimgle/libsrc/dimo2img.cc | 200 + dcmimgle/libsrc/dimoimg.cc | 2170 ++ dcmimgle/libsrc/dimoimg3.cc | 84 + dcmimgle/libsrc/dimoimg4.cc | 84 + dcmimgle/libsrc/dimoimg5.cc | 84 + dcmimgle/libsrc/dimomod.cc | 321 + dcmimgle/libsrc/dimoopx.cc | 76 + dcmimgle/libsrc/dimopx.cc | 96 + dcmimgle/libsrc/diovdat.cc | 66 + dcmimgle/libsrc/diovlay.cc | 599 + dcmimgle/libsrc/diovlimg.cc | 94 + dcmimgle/libsrc/diovpln.cc | 612 + dcmimgle/libsrc/diutils.cc | 138 + dcmimgle/tests/Makefile.in | 29 + dcmiod/CMakeLists.txt | 10 + dcmiod/Makefile.in | 85 + dcmiod/configure | 56 + dcmiod/data/Makefile.in | 23 + dcmiod/docs/Makefile.in | 23 + dcmiod/docs/dcmiod.dox | 23 + dcmiod/etc/Makefile.in | 23 + dcmiod/include/CMakeLists.txt | 2 + dcmiod/include/Makefile.in | 27 + dcmiod/include/dcmtk/dcmiod/cielabutil.h | 212 + dcmiod/include/dcmtk/dcmiod/iodcommn.h | 270 + .../dcmtk/dcmiod/iodcontentitemmacro.h | 478 + dcmiod/include/dcmtk/dcmiod/ioddef.h | 39 + dcmiod/include/dcmtk/dcmiod/iodimage.h | 312 + dcmiod/include/dcmtk/dcmiod/iodmacro.h | 1368 + dcmiod/include/dcmtk/dcmiod/iodreferences.h | 364 + dcmiod/include/dcmtk/dcmiod/iodrules.h | 257 + dcmiod/include/dcmtk/dcmiod/iodtypes.h | 143 + dcmiod/include/dcmtk/dcmiod/iodutil.h | 949 + .../dcmtk/dcmiod/modacquisitioncontext.h | 74 + dcmiod/include/dcmtk/dcmiod/modbase.h | 255 + .../dcmtk/dcmiod/modcommoninstanceref.h | 244 + dcmiod/include/dcmtk/dcmiod/modenhequipment.h | 203 + dcmiod/include/dcmtk/dcmiod/modenhusimage.h | 593 + dcmiod/include/dcmtk/dcmiod/modenhusseries.h | 134 + dcmiod/include/dcmtk/dcmiod/modequipment.h | 256 + .../dcmtk/dcmiod/modfloatingpointimagepixel.h | 246 + dcmiod/include/dcmtk/dcmiod/modfor.h | 115 + dcmiod/include/dcmtk/dcmiod/modgeneralimage.h | 361 + .../include/dcmtk/dcmiod/modgeneralseries.h | 323 + dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h | 245 + dcmiod/include/dcmtk/dcmiod/modhelp.h | 210 + dcmiod/include/dcmtk/dcmiod/modimagepixel.h | 215 + .../include/dcmtk/dcmiod/modimagepixelbase.h | 168 + .../dcmtk/dcmiod/modimagepixelvariant.h | 281 + .../dcmtk/dcmiod/modmultiframedimension.h | 386 + dcmiod/include/dcmtk/dcmiod/modmultiframefg.h | 292 + dcmiod/include/dcmtk/dcmiod/modpatient.h | 141 + dcmiod/include/dcmtk/dcmiod/modpatientstudy.h | 145 + .../dcmtk/dcmiod/modsegmentationseries.h | 141 + dcmiod/include/dcmtk/dcmiod/modsopcommon.h | 211 + .../include/dcmtk/dcmiod/modsynchronisation.h | 235 + dcmiod/include/dcmtk/dcmiod/modusfor.h | 229 + dcmiod/libsrc/CMakeLists.txt | 36 + dcmiod/libsrc/Makefile.dep | 2725 ++ dcmiod/libsrc/Makefile.in | 58 + dcmiod/libsrc/cielabutil.cc | 214 + dcmiod/libsrc/iodcommn.cc | 317 + dcmiod/libsrc/iodcontentitemmacro.cc | 815 + dcmiod/libsrc/iodmacro.cc | 1886 + dcmiod/libsrc/iodreferences.cc | 552 + dcmiod/libsrc/iodrules.cc | 364 + dcmiod/libsrc/iodtypes.cc | 46 + dcmiod/libsrc/iodutil.cc | 617 + dcmiod/libsrc/modacquisitioncontext.cc | 67 + dcmiod/libsrc/modbase.cc | 291 + dcmiod/libsrc/modcommoninstanceref.cc | 357 + dcmiod/libsrc/modenhequipment.cc | 161 + dcmiod/libsrc/modenhusimage.cc | 670 + dcmiod/libsrc/modenhusseries.cc | 120 + dcmiod/libsrc/modequipment.cc | 206 + dcmiod/libsrc/modfloatingpointimagepixel.cc | 260 + dcmiod/libsrc/modfor.cc | 119 + dcmiod/libsrc/modgeneralimage.cc | 377 + dcmiod/libsrc/modgeneralseries.cc | 351 + dcmiod/libsrc/modgeneralstudy.cc | 297 + dcmiod/libsrc/modhelp.cc | 345 + dcmiod/libsrc/modimagepixel.cc | 264 + dcmiod/libsrc/modimagepixelbase.cc | 138 + dcmiod/libsrc/modmultiframedimension.cc | 649 + dcmiod/libsrc/modmultiframefg.cc | 290 + dcmiod/libsrc/modpatient.cc | 136 + dcmiod/libsrc/modpatientstudy.cc | 134 + dcmiod/libsrc/modsegmentationseries.cc | 147 + dcmiod/libsrc/modsopcommon.cc | 246 + dcmiod/libsrc/modsynchronization.cc | 248 + dcmiod/libsrc/modusfor.cc | 274 + dcmiod/tests/CMakeLists.txt | 8 + dcmiod/tests/Makefile.dep | 251 + dcmiod/tests/Makefile.in | 57 + dcmiod/tests/tcielabutil.cc | 128 + dcmiod/tests/tests.cc | 27 + dcmiod/tests/timagepixel.cc | 34 + dcmjpeg/CMakeLists.txt | 7 + dcmjpeg/Makefile.in | 112 + dcmjpeg/apps/CMakeLists.txt | 12 + dcmjpeg/apps/Makefile.dep | 534 + dcmjpeg/apps/Makefile.in | 90 + dcmjpeg/apps/dcmcjpeg.cc | 746 + dcmjpeg/apps/dcmdjpeg.cc | 348 + dcmjpeg/apps/dcmj2pnm.cc | 27 + dcmjpeg/apps/dcmmkdir.cc | 47 + dcmjpeg/configure | 56 + dcmjpeg/data/Makefile.in | 23 + dcmjpeg/docs/Makefile.in | 23 + dcmjpeg/docs/dcmcjpeg.man | 706 + dcmjpeg/docs/dcmdjpeg.man | 349 + dcmjpeg/docs/dcmj2pnm.man | 579 + dcmjpeg/docs/dcmjpeg.dox | 73 + dcmjpeg/docs/dcmmkdir.man | 482 + dcmjpeg/docs/ijg_filelist.txt | 239 + dcmjpeg/docs/ijg_libjpeg.txt | 3011 ++ dcmjpeg/docs/ijg_readme.txt | 385 + dcmjpeg/docs/ijg_structure.txt | 1042 + dcmjpeg/etc/Makefile.in | 23 + dcmjpeg/include/CMakeLists.txt | 2 + dcmjpeg/include/Makefile.in | 27 + dcmjpeg/include/dcmtk/dcmjpeg/ddpiimpl.h | 91 + dcmjpeg/include/dcmtk/dcmjpeg/dipijpeg.h | 104 + dcmjpeg/include/dcmtk/dcmjpeg/djcodecd.h | 272 + dcmjpeg/include/dcmtk/dcmjpeg/djcodece.h | 384 + dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h | 433 + dcmjpeg/include/dcmtk/dcmjpeg/djdecabs.h | 85 + dcmjpeg/include/dcmtk/dcmjpeg/djdecbas.h | 69 + dcmjpeg/include/dcmtk/dcmjpeg/djdecext.h | 70 + dcmjpeg/include/dcmtk/dcmjpeg/djdeclol.h | 70 + dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h | 99 + dcmjpeg/include/dcmtk/dcmjpeg/djdecpro.h | 70 + dcmjpeg/include/dcmtk/dcmjpeg/djdecsps.h | 70 + dcmjpeg/include/dcmtk/dcmjpeg/djdecsv1.h | 70 + dcmjpeg/include/dcmtk/dcmjpeg/djdefine.h | 38 + dcmjpeg/include/dcmtk/dcmjpeg/djdijg12.h | 128 + dcmjpeg/include/dcmtk/dcmjpeg/djdijg16.h | 128 + dcmjpeg/include/dcmtk/dcmjpeg/djdijg8.h | 128 + dcmjpeg/include/dcmtk/dcmjpeg/djeijg12.h | 173 + dcmjpeg/include/dcmtk/dcmjpeg/djeijg16.h | 163 + dcmjpeg/include/dcmtk/dcmjpeg/djeijg8.h | 169 + dcmjpeg/include/dcmtk/dcmjpeg/djencabs.h | 99 + dcmjpeg/include/dcmtk/dcmjpeg/djencbas.h | 86 + dcmjpeg/include/dcmtk/dcmjpeg/djencext.h | 86 + dcmjpeg/include/dcmtk/dcmjpeg/djenclol.h | 86 + dcmjpeg/include/dcmtk/dcmjpeg/djencode.h | 134 + dcmjpeg/include/dcmtk/dcmjpeg/djencpro.h | 86 + dcmjpeg/include/dcmtk/dcmjpeg/djencsps.h | 86 + dcmjpeg/include/dcmtk/dcmjpeg/djencsv1.h | 86 + dcmjpeg/include/dcmtk/dcmjpeg/djrplol.h | 90 + dcmjpeg/include/dcmtk/dcmjpeg/djrploss.h | 80 + dcmjpeg/include/dcmtk/dcmjpeg/djutils.h | 235 + dcmjpeg/libijg12/CMakeLists.txt | 2 + dcmjpeg/libijg12/Makefile.dep | 227 + dcmjpeg/libijg12/Makefile.in | 59 + dcmjpeg/libijg12/jaricom.c | 15 + dcmjpeg/libijg12/jcapimin.c | 280 + dcmjpeg/libijg12/jcapistd.c | 161 + dcmjpeg/libijg12/jcarith.c | 26 + dcmjpeg/libijg12/jccoefct.c | 454 + dcmjpeg/libijg12/jccolor.c | 459 + dcmjpeg/libijg12/jcdctmgr.c | 390 + dcmjpeg/libijg12/jcdiffct.c | 406 + dcmjpeg/libijg12/jchuff.c | 274 + dcmjpeg/libijg12/jchuff12.h | 54 + dcmjpeg/libijg12/jcinit.c | 57 + dcmjpeg/libijg12/jclhuff.c | 601 + dcmjpeg/libijg12/jclossls.c | 82 + dcmjpeg/libijg12/jclossy.c | 76 + dcmjpeg/libijg12/jcmainct.c | 296 + dcmjpeg/libijg12/jcmarker.c | 680 + dcmjpeg/libijg12/jcmaster.c | 657 + dcmjpeg/libijg12/jcodec.c | 53 + dcmjpeg/libijg12/jcomapi.c | 106 + dcmjpeg/libijg12/jconfig12.h | 73 + dcmjpeg/libijg12/jcparam.c | 687 + dcmjpeg/libijg12/jcphuff.c | 848 + dcmjpeg/libijg12/jcpred.c | 314 + dcmjpeg/libijg12/jcprepct.c | 354 + dcmjpeg/libijg12/jcsample.c | 519 + dcmjpeg/libijg12/jcscale.c | 63 + dcmjpeg/libijg12/jcshuff.c | 661 + dcmjpeg/libijg12/jctrans.c | 424 + dcmjpeg/libijg12/jdapimin.c | 401 + dcmjpeg/libijg12/jdapistd.c | 275 + dcmjpeg/libijg12/jdarith.c | 26 + dcmjpeg/libijg12/jdatadst.c | 151 + dcmjpeg/libijg12/jdatasrc.c | 212 + dcmjpeg/libijg12/jdcoefct.c | 743 + dcmjpeg/libijg12/jdcolor.c | 413 + dcmjpeg/libijg12/jdct12.h | 176 + dcmjpeg/libijg12/jddctmgr.c | 270 + dcmjpeg/libijg12/jddiffct.c | 399 + dcmjpeg/libijg12/jdhuff.c | 316 + dcmjpeg/libijg12/jdhuff12.h | 229 + dcmjpeg/libijg12/jdinput.c | 347 + dcmjpeg/libijg12/jdlhuff.c | 296 + dcmjpeg/libijg12/jdlossls.c | 98 + dcmjpeg/libijg12/jdlossy.c | 232 + dcmjpeg/libijg12/jdmainct.c | 512 + dcmjpeg/libijg12/jdmarker.c | 1370 + dcmjpeg/libijg12/jdmaster.c | 460 + dcmjpeg/libijg12/jdmerge.c | 400 + dcmjpeg/libijg12/jdphuff.c | 686 + dcmjpeg/libijg12/jdpostct.c | 290 + dcmjpeg/libijg12/jdpred.c | 263 + dcmjpeg/libijg12/jdsample.c | 478 + dcmjpeg/libijg12/jdscale.c | 119 + dcmjpeg/libijg12/jdshuff.c | 365 + dcmjpeg/libijg12/jdtrans.c | 138 + dcmjpeg/libijg12/jerror.c | 253 + dcmjpeg/libijg12/jerror12.h | 310 + dcmjpeg/libijg12/jfdctflt.c | 168 + dcmjpeg/libijg12/jfdctfst.c | 224 + dcmjpeg/libijg12/jfdctint.c | 283 + dcmjpeg/libijg12/jidctflt.c | 242 + dcmjpeg/libijg12/jidctfst.c | 368 + dcmjpeg/libijg12/jidctint.c | 389 + dcmjpeg/libijg12/jidctred.c | 398 + dcmjpeg/libijg12/jinclude12.h | 91 + dcmjpeg/libijg12/jlossls12.h | 151 + dcmjpeg/libijg12/jlossy12.h | 120 + dcmjpeg/libijg12/jmemmgr.c | 1174 + dcmjpeg/libijg12/jmemnobs.c | 109 + dcmjpeg/libijg12/jmemsys12.h | 198 + dcmjpeg/libijg12/jmorecfg12.h | 407 + dcmjpeg/libijg12/jpegint12.h | 373 + dcmjpeg/libijg12/jpeglib12.h | 1211 + dcmjpeg/libijg12/jquant1.c | 856 + dcmjpeg/libijg12/jquant2.c | 1310 + dcmjpeg/libijg12/jutils.c | 179 + dcmjpeg/libijg12/jversion12.h | 14 + dcmjpeg/libijg16/CMakeLists.txt | 2 + dcmjpeg/libijg16/Makefile.dep | 227 + dcmjpeg/libijg16/Makefile.in | 59 + dcmjpeg/libijg16/jaricom.c | 15 + dcmjpeg/libijg16/jcapimin.c | 280 + dcmjpeg/libijg16/jcapistd.c | 161 + dcmjpeg/libijg16/jcarith.c | 26 + dcmjpeg/libijg16/jccoefct.c | 454 + dcmjpeg/libijg16/jccolor.c | 488 + dcmjpeg/libijg16/jcdctmgr.c | 390 + dcmjpeg/libijg16/jcdiffct.c | 406 + dcmjpeg/libijg16/jchuff.c | 274 + dcmjpeg/libijg16/jchuff16.h | 54 + dcmjpeg/libijg16/jcinit.c | 57 + dcmjpeg/libijg16/jclhuff.c | 601 + dcmjpeg/libijg16/jclossls.c | 82 + dcmjpeg/libijg16/jclossy.c | 76 + dcmjpeg/libijg16/jcmainct.c | 296 + dcmjpeg/libijg16/jcmarker.c | 680 + dcmjpeg/libijg16/jcmaster.c | 657 + dcmjpeg/libijg16/jcodec.c | 53 + dcmjpeg/libijg16/jcomapi.c | 106 + dcmjpeg/libijg16/jconfig16.h | 73 + dcmjpeg/libijg16/jcparam.c | 687 + dcmjpeg/libijg16/jcphuff.c | 848 + dcmjpeg/libijg16/jcpred.c | 314 + dcmjpeg/libijg16/jcprepct.c | 354 + dcmjpeg/libijg16/jcsample.c | 519 + dcmjpeg/libijg16/jcscale.c | 63 + dcmjpeg/libijg16/jcshuff.c | 661 + dcmjpeg/libijg16/jctrans.c | 424 + dcmjpeg/libijg16/jdapimin.c | 401 + dcmjpeg/libijg16/jdapistd.c | 275 + dcmjpeg/libijg16/jdarith.c | 26 + dcmjpeg/libijg16/jdatadst.c | 151 + dcmjpeg/libijg16/jdatasrc.c | 212 + dcmjpeg/libijg16/jdcoefct.c | 743 + dcmjpeg/libijg16/jdcolor.c | 413 + dcmjpeg/libijg16/jdct16.h | 176 + dcmjpeg/libijg16/jddctmgr.c | 270 + dcmjpeg/libijg16/jddiffct.c | 399 + dcmjpeg/libijg16/jdhuff.c | 325 + dcmjpeg/libijg16/jdhuff16.h | 229 + dcmjpeg/libijg16/jdinput.c | 347 + dcmjpeg/libijg16/jdlhuff.c | 326 + dcmjpeg/libijg16/jdlossls.c | 98 + dcmjpeg/libijg16/jdlossy.c | 232 + dcmjpeg/libijg16/jdmainct.c | 512 + dcmjpeg/libijg16/jdmarker.c | 1370 + dcmjpeg/libijg16/jdmaster.c | 460 + dcmjpeg/libijg16/jdmerge.c | 423 + dcmjpeg/libijg16/jdphuff.c | 689 + dcmjpeg/libijg16/jdpostct.c | 290 + dcmjpeg/libijg16/jdpred.c | 326 + dcmjpeg/libijg16/jdsample.c | 478 + dcmjpeg/libijg16/jdscale.c | 119 + dcmjpeg/libijg16/jdshuff.c | 366 + dcmjpeg/libijg16/jdtrans.c | 138 + dcmjpeg/libijg16/jerror.c | 253 + dcmjpeg/libijg16/jerror16.h | 310 + dcmjpeg/libijg16/jfdctflt.c | 168 + dcmjpeg/libijg16/jfdctfst.c | 224 + dcmjpeg/libijg16/jfdctint.c | 283 + dcmjpeg/libijg16/jidctflt.c | 242 + dcmjpeg/libijg16/jidctfst.c | 368 + dcmjpeg/libijg16/jidctint.c | 389 + dcmjpeg/libijg16/jidctred.c | 398 + dcmjpeg/libijg16/jinclude16.h | 91 + dcmjpeg/libijg16/jlossls16.h | 159 + dcmjpeg/libijg16/jlossy16.h | 120 + dcmjpeg/libijg16/jmemmgr.c | 1174 + dcmjpeg/libijg16/jmemnobs.c | 109 + dcmjpeg/libijg16/jmemsys16.h | 198 + dcmjpeg/libijg16/jmorecfg16.h | 407 + dcmjpeg/libijg16/jpegint16.h | 373 + dcmjpeg/libijg16/jpeglib16.h | 1214 + dcmjpeg/libijg16/jquant1.c | 856 + dcmjpeg/libijg16/jquant2.c | 1310 + dcmjpeg/libijg16/jutils.c | 179 + dcmjpeg/libijg16/jversion16.h | 14 + dcmjpeg/libijg8/CMakeLists.txt | 2 + dcmjpeg/libijg8/Makefile.dep | 220 + dcmjpeg/libijg8/Makefile.in | 59 + dcmjpeg/libijg8/jaricom.c | 15 + dcmjpeg/libijg8/jcapimin.c | 282 + dcmjpeg/libijg8/jcapistd.c | 161 + dcmjpeg/libijg8/jcarith.c | 26 + dcmjpeg/libijg8/jccoefct.c | 454 + dcmjpeg/libijg8/jccolor.c | 459 + dcmjpeg/libijg8/jcdctmgr.c | 390 + dcmjpeg/libijg8/jcdiffct.c | 406 + dcmjpeg/libijg8/jchuff.c | 274 + dcmjpeg/libijg8/jchuff8.h | 54 + dcmjpeg/libijg8/jcinit.c | 57 + dcmjpeg/libijg8/jclhuff.c | 601 + dcmjpeg/libijg8/jclossls.c | 82 + dcmjpeg/libijg8/jclossy.c | 80 + dcmjpeg/libijg8/jcmainct.c | 296 + dcmjpeg/libijg8/jcmarker.c | 680 + dcmjpeg/libijg8/jcmaster.c | 657 + dcmjpeg/libijg8/jcodec.c | 53 + dcmjpeg/libijg8/jcomapi.c | 106 + dcmjpeg/libijg8/jconfig8.h | 73 + dcmjpeg/libijg8/jcparam.c | 687 + dcmjpeg/libijg8/jcphuff.c | 848 + dcmjpeg/libijg8/jcpred.c | 314 + dcmjpeg/libijg8/jcprepct.c | 354 + dcmjpeg/libijg8/jcsample.c | 519 + dcmjpeg/libijg8/jcscale.c | 63 + dcmjpeg/libijg8/jcshuff.c | 661 + dcmjpeg/libijg8/jctrans.c | 424 + dcmjpeg/libijg8/jdapimin.c | 401 + dcmjpeg/libijg8/jdapistd.c | 275 + dcmjpeg/libijg8/jdarith.c | 26 + dcmjpeg/libijg8/jdatadst.c | 151 + dcmjpeg/libijg8/jdatasrc.c | 212 + dcmjpeg/libijg8/jdcoefct.c | 743 + dcmjpeg/libijg8/jdcolor.c | 413 + dcmjpeg/libijg8/jdct8.h | 176 + dcmjpeg/libijg8/jddctmgr.c | 270 + dcmjpeg/libijg8/jddiffct.c | 399 + dcmjpeg/libijg8/jdhuff.c | 316 + dcmjpeg/libijg8/jdhuff8.h | 229 + dcmjpeg/libijg8/jdinput.c | 347 + dcmjpeg/libijg8/jdlhuff.c | 296 + dcmjpeg/libijg8/jdlossls.c | 98 + dcmjpeg/libijg8/jdlossy.c | 232 + dcmjpeg/libijg8/jdmainct.c | 512 + dcmjpeg/libijg8/jdmarker.c | 1370 + dcmjpeg/libijg8/jdmaster.c | 460 + dcmjpeg/libijg8/jdmerge.c | 400 + dcmjpeg/libijg8/jdphuff.c | 686 + dcmjpeg/libijg8/jdpostct.c | 290 + dcmjpeg/libijg8/jdpred.c | 263 + dcmjpeg/libijg8/jdsample.c | 478 + dcmjpeg/libijg8/jdscale.c | 119 + dcmjpeg/libijg8/jdshuff.c | 365 + dcmjpeg/libijg8/jdtrans.c | 138 + dcmjpeg/libijg8/jerror.c | 253 + dcmjpeg/libijg8/jerror8.h | 310 + dcmjpeg/libijg8/jfdctflt.c | 168 + dcmjpeg/libijg8/jfdctfst.c | 224 + dcmjpeg/libijg8/jfdctint.c | 283 + dcmjpeg/libijg8/jidctflt.c | 242 + dcmjpeg/libijg8/jidctfst.c | 368 + dcmjpeg/libijg8/jidctint.c | 389 + dcmjpeg/libijg8/jidctred.c | 398 + dcmjpeg/libijg8/jinclude8.h | 91 + dcmjpeg/libijg8/jlossls8.h | 151 + dcmjpeg/libijg8/jlossy8.h | 120 + dcmjpeg/libijg8/jmemmgr.c | 1174 + dcmjpeg/libijg8/jmemnobs.c | 110 + dcmjpeg/libijg8/jmemsys8.h | 198 + dcmjpeg/libijg8/jmorecfg8.h | 407 + dcmjpeg/libijg8/jpegint8.h | 373 + dcmjpeg/libijg8/jpeglib8.h | 1211 + dcmjpeg/libijg8/jquant1.c | 856 + dcmjpeg/libijg8/jquant2.c | 1310 + dcmjpeg/libijg8/jutils.c | 179 + dcmjpeg/libijg8/jversion8.h | 14 + dcmjpeg/libsrc/CMakeLists.txt | 7 + dcmjpeg/libsrc/Makefile.dep | 1649 + dcmjpeg/libsrc/Makefile.in | 55 + dcmjpeg/libsrc/ddpiimpl.cc | 119 + dcmjpeg/libsrc/dipijpeg.cc | 247 + dcmjpeg/libsrc/djcodecd.cc | 899 + dcmjpeg/libsrc/djcodece.cc | 1541 + dcmjpeg/libsrc/djcparam.cc | 132 + dcmjpeg/libsrc/djdecbas.cc | 58 + dcmjpeg/libsrc/djdecext.cc | 59 + dcmjpeg/libsrc/djdeclol.cc | 60 + dcmjpeg/libsrc/djdecode.cc | 124 + dcmjpeg/libsrc/djdecpro.cc | 59 + dcmjpeg/libsrc/djdecsps.cc | 61 + dcmjpeg/libsrc/djdecsv1.cc | 61 + dcmjpeg/libsrc/djdijg12.cc | 480 + dcmjpeg/libsrc/djdijg16.cc | 483 + dcmjpeg/libsrc/djdijg8.cc | 480 + dcmjpeg/libsrc/djeijg12.cc | 576 + dcmjpeg/libsrc/djeijg16.cc | 412 + dcmjpeg/libsrc/djeijg8.cc | 579 + dcmjpeg/libsrc/djencbas.cc | 81 + dcmjpeg/libsrc/djencext.cc | 86 + dcmjpeg/libsrc/djenclol.cc | 94 + dcmjpeg/libsrc/djencode.cc | 161 + dcmjpeg/libsrc/djencpro.cc | 86 + dcmjpeg/libsrc/djencsps.cc | 87 + dcmjpeg/libsrc/djencsv1.cc | 92 + dcmjpeg/libsrc/djrplol.cc | 67 + dcmjpeg/libsrc/djrploss.cc | 65 + dcmjpeg/libsrc/djutils.cc | 98 + dcmjpeg/tests/Makefile.in | 29 + dcmjpls/CMakeLists.txt | 7 + dcmjpls/Makefile.in | 102 + dcmjpls/apps/CMakeLists.txt | 12 + dcmjpls/apps/Makefile.dep | 404 + dcmjpls/apps/Makefile.in | 88 + dcmjpls/apps/dcmcjpls.cc | 501 + dcmjpls/apps/dcmdjpls.cc | 338 + dcmjpls/apps/dcml2pnm.cc | 27 + dcmjpls/configure | 56 + dcmjpls/data/Makefile.in | 23 + dcmjpls/docs/License.txt | 44 + dcmjpls/docs/Makefile.in | 23 + dcmjpls/docs/dcmcjpls.man | 400 + dcmjpls/docs/dcmdjpls.man | 285 + dcmjpls/docs/dcmjpls.dox | 87 + dcmjpls/docs/dcml2pnm.man | 503 + dcmjpls/docs/readme.txt | 16 + dcmjpls/etc/Makefile.in | 23 + dcmjpls/include/CMakeLists.txt | 2 + dcmjpls/include/Makefile.in | 27 + dcmjpls/include/dcmtk/dcmjpls/djcodecd.h | 341 + dcmjpls/include/dcmtk/dcmjpls/djcodece.h | 400 + dcmjpls/include/dcmtk/dcmjpls/djcparam.h | 287 + dcmjpls/include/dcmtk/dcmjpls/djdecode.h | 85 + dcmjpls/include/dcmtk/dcmjpls/djencode.h | 98 + dcmjpls/include/dcmtk/dcmjpls/djlsutil.h | 158 + dcmjpls/include/dcmtk/dcmjpls/djrparam.h | 97 + dcmjpls/include/dcmtk/dcmjpls/dldefine.h | 38 + dcmjpls/libcharls/CMakeLists.txt | 7 + dcmjpls/libcharls/Makefile.dep | 53 + dcmjpls/libcharls/Makefile.in | 45 + dcmjpls/libcharls/clrtrans.h | 180 + dcmjpls/libcharls/config.h | 63 + dcmjpls/libcharls/context.h | 122 + dcmjpls/libcharls/ctxtrmod.h | 101 + dcmjpls/libcharls/decodstr.h | 295 + dcmjpls/libcharls/deftrait.h | 126 + dcmjpls/libcharls/encodstr.h | 201 + dcmjpls/libcharls/header.cc | 628 + dcmjpls/libcharls/header.h | 64 + dcmjpls/libcharls/intrface.cc | 240 + dcmjpls/libcharls/intrface.h | 50 + dcmjpls/libcharls/jpegls.cc | 175 + dcmjpls/libcharls/lltraits.h | 128 + dcmjpls/libcharls/lokuptbl.h | 69 + dcmjpls/libcharls/procline.h | 227 + dcmjpls/libcharls/pubtypes.h | 77 + dcmjpls/libcharls/scan.h | 859 + dcmjpls/libcharls/streams.h | 189 + dcmjpls/libcharls/util.h | 153 + dcmjpls/libsrc/CMakeLists.txt | 7 + dcmjpls/libsrc/Makefile.dep | 407 + dcmjpls/libsrc/Makefile.in | 53 + dcmjpls/libsrc/djcodecd.cc | 779 + dcmjpls/libsrc/djcodece.cc | 1234 + dcmjpls/libsrc/djcparam.cc | 113 + dcmjpls/libsrc/djdecode.cc | 77 + dcmjpls/libsrc/djencode.cc | 87 + dcmjpls/libsrc/djerror.h | 73 + dcmjpls/libsrc/djrparam.cc | 72 + dcmjpls/libsrc/djutils.cc | 45 + dcmjpls/tests/Makefile.in | 29 + dcmnet/CMakeLists.txt | 10 + dcmnet/Makefile.in | 97 + dcmnet/apps/CMakeLists.txt | 40 + dcmnet/apps/Makefile.dep | 897 + dcmnet/apps/Makefile.in | 90 + dcmnet/apps/dcmrecv.cc | 308 + dcmnet/apps/dcmsend.cc | 575 + dcmnet/apps/echoscu.cc | 510 + dcmnet/apps/findscu.cc | 465 + dcmnet/apps/getscu.cc | 593 + dcmnet/apps/movescu.cc | 1728 + dcmnet/apps/storescp.cc | 2601 ++ dcmnet/apps/storescu.cc | 1595 + dcmnet/apps/termscu.cc | 282 + dcmnet/configure | 56 + dcmnet/data/Makefile.in | 23 + dcmnet/docs/CMakeLists.txt | 2 + dcmnet/docs/Makefile.in | 29 + dcmnet/docs/asconfig.txt | 236 + dcmnet/docs/cptscp.dox | 33 + dcmnet/docs/dcmnet.dox | 96 + dcmnet/docs/dcmrecv.man | 360 + dcmnet/docs/dcmsend.man | 414 + dcmnet/docs/echoscu.man | 299 + dcmnet/docs/findscu.man | 453 + dcmnet/docs/getscu.man | 556 + dcmnet/docs/movescu.man | 770 + dcmnet/docs/storescp.man | 917 + dcmnet/docs/storescu.man | 585 + dcmnet/docs/termscu.man | 148 + dcmnet/docs/testing.txt | 58 + dcmnet/etc/CMakeLists.txt | 2 + dcmnet/etc/Makefile.in | 29 + dcmnet/etc/storescp.cfg | 459 + dcmnet/etc/storescu.cfg | 318 + dcmnet/include/CMakeLists.txt | 2 + dcmnet/include/Makefile.in | 27 + dcmnet/include/dcmtk/dcmnet/assoc.h | 765 + dcmnet/include/dcmtk/dcmnet/cond.h | 270 + dcmnet/include/dcmtk/dcmnet/dcasccff.h | 99 + dcmnet/include/dcmtk/dcmnet/dcasccfg.h | 266 + dcmnet/include/dcmtk/dcmnet/dccfenmp.h | 196 + dcmnet/include/dcmtk/dcmnet/dccfpcmp.h | 188 + dcmnet/include/dcmtk/dcmnet/dccfprmp.h | 181 + dcmnet/include/dcmtk/dcmnet/dccfrsmp.h | 185 + dcmnet/include/dcmtk/dcmnet/dccftsmp.h | 103 + dcmnet/include/dcmtk/dcmnet/dccfuidh.h | 115 + dcmnet/include/dcmtk/dcmnet/dcmlayer.h | 123 + dcmnet/include/dcmtk/dcmnet/dcmsmap.h | 201 + dcmnet/include/dcmtk/dcmnet/dcmtrans.h | 359 + dcmnet/include/dcmtk/dcmnet/dcompat.h | 360 + dcmnet/include/dcmtk/dcmnet/dcuserid.h | 388 + dcmnet/include/dcmtk/dcmnet/dfindscu.h | 381 + dcmnet/include/dcmtk/dcmnet/dicom.h | 177 + dcmnet/include/dcmtk/dcmnet/dimse.h | 1261 + dcmnet/include/dcmtk/dcmnet/diutil.h | 151 + dcmnet/include/dcmtk/dcmnet/dndefine.h | 38 + dcmnet/include/dcmtk/dcmnet/dntypes.h | 40 + dcmnet/include/dcmtk/dcmnet/dstorscp.h | 327 + dcmnet/include/dcmtk/dcmnet/dstorscu.h | 543 + dcmnet/include/dcmtk/dcmnet/dul.h | 572 + dcmnet/include/dcmtk/dcmnet/extneg.h | 56 + dcmnet/include/dcmtk/dcmnet/lst.h | 145 + dcmnet/include/dcmtk/dcmnet/scp.h | 1162 + dcmnet/include/dcmtk/dcmnet/scpcfg.h | 432 + dcmnet/include/dcmtk/dcmnet/scppool.h | 343 + dcmnet/include/dcmtk/dcmnet/scpthrd.h | 88 + dcmnet/include/dcmtk/dcmnet/scu.h | 1077 + dcmnet/libsrc/CMakeLists.txt | 5 + dcmnet/libsrc/Makefile.dep | 2557 ++ dcmnet/libsrc/Makefile.in | 56 + dcmnet/libsrc/assoc.cc | 2220 ++ dcmnet/libsrc/cond.cc | 139 + dcmnet/libsrc/dcasccff.cc | 486 + dcmnet/libsrc/dcasccfg.cc | 792 + dcmnet/libsrc/dccfenmp.cc | 270 + dcmnet/libsrc/dccfpcmp.cc | 219 + dcmnet/libsrc/dccfprmp.cc | 229 + dcmnet/libsrc/dccfrsmp.cc | 245 + dcmnet/libsrc/dccftsmp.cc | 143 + dcmnet/libsrc/dccfuidh.cc | 128 + dcmnet/libsrc/dcmlayer.cc | 55 + dcmnet/libsrc/dcmtrans.cc | 489 + dcmnet/libsrc/dcompat.cc | 352 + dcmnet/libsrc/dcuserid.cc | 639 + dcmnet/libsrc/dfindscu.cc | 731 + dcmnet/libsrc/dimcancl.cc | 141 + dcmnet/libsrc/dimcmd.cc | 2064 ++ dcmnet/libsrc/dimcmd.h | 103 + dcmnet/libsrc/dimdump.cc | 1220 + dcmnet/libsrc/dimecho.cc | 173 + dcmnet/libsrc/dimfind.cc | 458 + dcmnet/libsrc/dimget.cc | 374 + dcmnet/libsrc/dimmove.cc | 443 + dcmnet/libsrc/dimse.cc | 1712 + dcmnet/libsrc/dimstore.cc | 520 + dcmnet/libsrc/diutil.cc | 895 + dcmnet/libsrc/dstorscp.cc | 479 + dcmnet/libsrc/dstorscu.cc | 1232 + dcmnet/libsrc/dul.cc | 2846 ++ dcmnet/libsrc/dulconst.cc | 1534 + dcmnet/libsrc/dulextra.cc | 190 + dcmnet/libsrc/dulfsm.cc | 4035 ++ dcmnet/libsrc/dulfsm.h | 137 + dcmnet/libsrc/dulparse.cc | 909 + dcmnet/libsrc/dulpres.cc | 153 + dcmnet/libsrc/dulpriv.h | 114 + dcmnet/libsrc/dulstruc.h | 325 + dcmnet/libsrc/dwrap.c | 48 + dcmnet/libsrc/extneg.cc | 36 + dcmnet/libsrc/lst.cc | 148 + dcmnet/libsrc/scp.cc | 2069 ++ dcmnet/libsrc/scpcfg.cc | 491 + dcmnet/libsrc/scppool.cc | 350 + dcmnet/libsrc/scpthrd.cc | 78 + dcmnet/libsrc/scu.cc | 2502 ++ dcmnet/tests/CMakeLists.txt | 8 + dcmnet/tests/Makefile.dep | 388 + dcmnet/tests/Makefile.in | 52 + dcmnet/tests/tdump.cc | 50 + dcmnet/tests/tests.cc | 41 + dcmnet/tests/tpool.cc | 113 + dcmnet/tests/tscuscp.cc | 649 + dcmpmap/CMakeLists.txt | 10 + dcmpmap/Makefile.in | 86 + dcmpmap/configure | 53 + dcmpmap/data/Makefile.in | 23 + dcmpmap/docs/Makefile.in | 23 + dcmpmap/docs/dcmpmap.dox | 527 + dcmpmap/etc/Makefile.in | 23 + dcmpmap/include/CMakeLists.txt | 2 + dcmpmap/include/Makefile.in | 27 + dcmpmap/include/dcmtk/dcmpmap/dpmdef.h | 37 + .../dcmtk/dcmpmap/dpmmodparametricmapimage.h | 304 + .../dcmtk/dcmpmap/dpmmodparametricmapseries.h | 133 + .../dcmtk/dcmpmap/dpmparametricmapbase.h | 249 + .../dcmtk/dcmpmap/dpmparametricmapiod.h | 306 + dcmpmap/include/dcmtk/dcmpmap/dpmtypes.h | 137 + dcmpmap/libsrc/CMakeLists.txt | 4 + dcmpmap/libsrc/Makefile.dep | 670 + dcmpmap/libsrc/Makefile.in | 56 + dcmpmap/libsrc/dpmmodparametricmapimage.cc | 289 + dcmpmap/libsrc/dpmmodparametricmapseries.cc | 126 + dcmpmap/libsrc/dpmparametricmapbase.cc | 229 + dcmpmap/libsrc/dpmparametricmapiod.cc | 1065 + dcmpmap/libsrc/dpmtypes.cc | 111 + dcmpmap/tests/Makefile.in | 29 + dcmpstat/CMakeLists.txt | 10 + dcmpstat/Makefile.in | 99 + dcmpstat/apps/CMakeLists.txt | 16 + dcmpstat/apps/Makefile.dep | 1442 + dcmpstat/apps/Makefile.in | 139 + dcmpstat/apps/dcmmkcrv.cc | 399 + dcmpstat/apps/dcmmklut.cc | 1041 + dcmpstat/apps/dcmp2pgm.cc | 579 + dcmpstat/apps/dcmprscp.cc | 521 + dcmpstat/apps/dcmprscu.cc | 1133 + dcmpstat/apps/dcmpschk.cc | 976 + dcmpstat/apps/dcmpsmk.cc | 378 + dcmpstat/apps/dcmpsprt.cc | 675 + dcmpstat/apps/dcmpsrcv.cc | 1437 + dcmpstat/apps/dcmpssnd.cc | 957 + dcmpstat/configure | 56 + dcmpstat/data/CMakeLists.txt | 2 + dcmpstat/data/Makefile.in | 31 + dcmpstat/data/philips.lut | 274 + dcmpstat/docs/Makefile.in | 23 + dcmpstat/docs/dcmmkcrv.man | 183 + dcmpstat/docs/dcmmklut.man | 253 + dcmpstat/docs/dcmp2pgm.man | 175 + dcmpstat/docs/dcmprscp.man | 146 + dcmpstat/docs/dcmprscu.man | 206 + dcmpstat/docs/dcmpschk.man | 137 + dcmpstat/docs/dcmpsmk.man | 250 + dcmpstat/docs/dcmpsprt.man | 317 + dcmpstat/docs/dcmpsrcv.man | 135 + dcmpstat/docs/dcmpssnd.man | 143 + dcmpstat/docs/dcmpstat.dox | 79 + dcmpstat/etc/CMakeLists.txt | 2 + dcmpstat/etc/Makefile.in | 29 + dcmpstat/etc/dcmpstat.cfg | 1388 + dcmpstat/etc/printers.cfg | 455 + dcmpstat/include/CMakeLists.txt | 2 + dcmpstat/include/Makefile.in | 27 + dcmpstat/include/dcmtk/dcmpstat/dcmpstat.h | 980 + dcmpstat/include/dcmtk/dcmpstat/dpdefine.h | 38 + dcmpstat/include/dcmtk/dcmpstat/dvcache.h | 897 + dcmpstat/include/dcmtk/dcmpstat/dviface.h | 1836 + dcmpstat/include/dcmtk/dcmpstat/dvpsab.h | 123 + dcmpstat/include/dcmtk/dcmpstat/dvpsabl.h | 156 + dcmpstat/include/dcmtk/dcmpstat/dvpsal.h | 114 + dcmpstat/include/dcmtk/dcmpstat/dvpsall.h | 175 + dcmpstat/include/dcmtk/dcmpstat/dvpscf.h | 1085 + dcmpstat/include/dcmtk/dcmpstat/dvpscu.h | 138 + dcmpstat/include/dcmtk/dcmpstat/dvpscul.h | 113 + dcmpstat/include/dcmtk/dcmpstat/dvpsda.h | 268 + dcmpstat/include/dcmtk/dcmpstat/dvpsdal.h | 142 + dcmpstat/include/dcmtk/dcmpstat/dvpsdef.h | 186 + dcmpstat/include/dcmtk/dcmpstat/dvpsfs.h | 179 + dcmpstat/include/dcmtk/dcmpstat/dvpsga.h | 186 + dcmpstat/include/dcmtk/dcmpstat/dvpsgal.h | 266 + dcmpstat/include/dcmtk/dcmpstat/dvpsgl.h | 167 + dcmpstat/include/dcmtk/dcmpstat/dvpsgll.h | 276 + dcmpstat/include/dcmtk/dcmpstat/dvpsgr.h | 140 + dcmpstat/include/dcmtk/dcmpstat/dvpsgrl.h | 116 + dcmpstat/include/dcmtk/dcmpstat/dvpshlp.h | 120 + dcmpstat/include/dcmtk/dcmpstat/dvpsib.h | 383 + dcmpstat/include/dcmtk/dcmpstat/dvpsibl.h | 388 + dcmpstat/include/dcmtk/dcmpstat/dvpsmsg.h | 273 + dcmpstat/include/dcmtk/dcmpstat/dvpsov.h | 167 + dcmpstat/include/dcmtk/dcmpstat/dvpsovl.h | 145 + dcmpstat/include/dcmtk/dcmpstat/dvpspl.h | 248 + dcmpstat/include/dcmtk/dcmpstat/dvpspll.h | 135 + dcmpstat/include/dcmtk/dcmpstat/dvpspr.h | 291 + dcmpstat/include/dcmtk/dcmpstat/dvpsprt.h | 313 + dcmpstat/include/dcmtk/dcmpstat/dvpsri.h | 173 + dcmpstat/include/dcmtk/dcmpstat/dvpsril.h | 208 + dcmpstat/include/dcmtk/dcmpstat/dvpsrs.h | 195 + dcmpstat/include/dcmtk/dcmpstat/dvpsrsl.h | 186 + dcmpstat/include/dcmtk/dcmpstat/dvpssp.h | 1117 + dcmpstat/include/dcmtk/dcmpstat/dvpsspl.h | 216 + dcmpstat/include/dcmtk/dcmpstat/dvpssv.h | 221 + dcmpstat/include/dcmtk/dcmpstat/dvpssvl.h | 164 + dcmpstat/include/dcmtk/dcmpstat/dvpstat.h | 1330 + dcmpstat/include/dcmtk/dcmpstat/dvpstx.h | 212 + dcmpstat/include/dcmtk/dcmpstat/dvpstxl.h | 118 + dcmpstat/include/dcmtk/dcmpstat/dvpstyp.h | 523 + dcmpstat/include/dcmtk/dcmpstat/dvpsvl.h | 97 + dcmpstat/include/dcmtk/dcmpstat/dvpsvll.h | 95 + dcmpstat/include/dcmtk/dcmpstat/dvpsvw.h | 100 + dcmpstat/include/dcmtk/dcmpstat/dvpsvwl.h | 94 + dcmpstat/include/dcmtk/dcmpstat/dvsighdl.h | 230 + dcmpstat/jni/Makefile.dep | 0 dcmpstat/jni/Makefile.in | 119 + dcmpstat/jni/make_stub.sh | 9 + dcmpstat/libsrc/CMakeLists.txt | 4 + dcmpstat/libsrc/Makefile.dep | 4805 +++ dcmpstat/libsrc/Makefile.in | 64 + dcmpstat/libsrc/dcmpstat.cc | 1941 + dcmpstat/libsrc/dviface.cc | 4194 +++ dcmpstat/libsrc/dvpsab.cc | 160 + dcmpstat/libsrc/dvpsabl.cc | 211 + dcmpstat/libsrc/dvpsal.cc | 101 + dcmpstat/libsrc/dvpsall.cc | 460 + dcmpstat/libsrc/dvpscf.cc | 1473 + dcmpstat/libsrc/dvpscu.cc | 343 + dcmpstat/libsrc/dvpscul.cc | 109 + dcmpstat/libsrc/dvpsda.cc | 442 + dcmpstat/libsrc/dvpsdal.cc | 198 + dcmpstat/libsrc/dvpsfs.cc | 834 + dcmpstat/libsrc/dvpsga.cc | 194 + dcmpstat/libsrc/dvpsgal.cc | 502 + dcmpstat/libsrc/dvpsgl.cc | 253 + dcmpstat/libsrc/dvpsgll.cc | 424 + dcmpstat/libsrc/dvpsgr.cc | 259 + dcmpstat/libsrc/dvpsgrl.cc | 157 + dcmpstat/libsrc/dvpshlp.cc | 220 + dcmpstat/libsrc/dvpsib.cc | 1307 + dcmpstat/libsrc/dvpsibl.cc | 582 + dcmpstat/libsrc/dvpsmsg.cc | 413 + dcmpstat/libsrc/dvpsov.cc | 253 + dcmpstat/libsrc/dvpsovl.cc | 186 + dcmpstat/libsrc/dvpspl.cc | 455 + dcmpstat/libsrc/dvpspl2.cc | 150 + dcmpstat/libsrc/dvpspll.cc | 249 + dcmpstat/libsrc/dvpspr.cc | 599 + dcmpstat/libsrc/dvpsprt.cc | 1091 + dcmpstat/libsrc/dvpsri.cc | 258 + dcmpstat/libsrc/dvpsril.cc | 333 + dcmpstat/libsrc/dvpsrs.cc | 218 + dcmpstat/libsrc/dvpsrsl.cc | 272 + dcmpstat/libsrc/dvpssp.cc | 3194 ++ dcmpstat/libsrc/dvpsspl.cc | 354 + dcmpstat/libsrc/dvpssv.cc | 332 + dcmpstat/libsrc/dvpssvl.cc | 311 + dcmpstat/libsrc/dvpstat.cc | 2166 ++ dcmpstat/libsrc/dvpstx.cc | 415 + dcmpstat/libsrc/dvpstxl.cc | 157 + dcmpstat/libsrc/dvpsvl.cc | 93 + dcmpstat/libsrc/dvpsvll.cc | 102 + dcmpstat/libsrc/dvpsvw.cc | 89 + dcmpstat/libsrc/dvpsvwl.cc | 107 + dcmpstat/libsrc/dvsighdl.cc | 865 + dcmpstat/tests/CMakeLists.txt | 5 + dcmpstat/tests/Makefile.dep | 78 + dcmpstat/tests/Makefile.in | 65 + dcmpstat/tests/dcmpschk.tcl | 161 + dcmpstat/tests/dcmpsprt.pl | 39 + dcmpstat/tests/msgserv.cc | 364 + dcmqrdb/CMakeLists.txt | 10 + dcmqrdb/Makefile.in | 97 + dcmqrdb/apps/CMakeLists.txt | 9 + dcmqrdb/apps/Makefile.dep | 253 + dcmqrdb/apps/Makefile.in | 74 + dcmqrdb/apps/dcmqridx.cc | 179 + dcmqrdb/apps/dcmqrscp.cc | 926 + dcmqrdb/apps/dcmqrti.cc | 386 + dcmqrdb/configure | 56 + dcmqrdb/data/Makefile.in | 23 + dcmqrdb/docs/CMakeLists.txt | 2 + dcmqrdb/docs/Makefile.in | 29 + dcmqrdb/docs/dcmqrcnf.txt | 148 + dcmqrdb/docs/dcmqrdb.dox | 32 + dcmqrdb/docs/dcmqridx.man | 136 + dcmqrdb/docs/dcmqrscp.man | 1082 + dcmqrdb/docs/dcmqrset.txt | 122 + dcmqrdb/docs/dcmqrti.man | 448 + dcmqrdb/etc/CMakeLists.txt | 2 + dcmqrdb/etc/Makefile.in | 29 + dcmqrdb/etc/dcmqrprf.cfg | 1110 + dcmqrdb/etc/dcmqrscp.cfg | 87 + dcmqrdb/include/CMakeLists.txt | 2 + dcmqrdb/include/Makefile.in | 27 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbf.h | 100 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbg.h | 168 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h | 188 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbs.h | 133 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcnf.h | 531 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h | 234 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h | 459 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h | 78 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h | 426 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqropt.h | 174 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrptb.h | 96 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrsrv.h | 174 + dcmqrdb/include/dcmtk/dcmqrdb/dcmqrtis.h | 296 + dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h | 38 + dcmqrdb/libsrc/CMakeLists.txt | 4 + dcmqrdb/libsrc/Makefile.dep | 867 + dcmqrdb/libsrc/Makefile.in | 52 + dcmqrdb/libsrc/dcmqrcbf.cc | 90 + dcmqrdb/libsrc/dcmqrcbg.cc | 332 + dcmqrdb/libsrc/dcmqrcbm.cc | 706 + dcmqrdb/libsrc/dcmqrcbs.cc | 186 + dcmqrdb/libsrc/dcmqrcnf.cc | 1122 + dcmqrdb/libsrc/dcmqrdbi.cc | 3318 ++ dcmqrdb/libsrc/dcmqrdbs.cc | 73 + dcmqrdb/libsrc/dcmqropt.cc | 82 + dcmqrdb/libsrc/dcmqrptb.cc | 226 + dcmqrdb/libsrc/dcmqrsrv.cc | 1149 + dcmqrdb/libsrc/dcmqrtis.cc | 2193 ++ dcmqrdb/tests/Makefile.in | 29 + dcmrt/CHANGES | 802 + dcmrt/CMakeLists.txt | 10 + dcmrt/Makefile.in | 87 + dcmrt/apps/CMakeLists.txt | 5 + dcmrt/apps/Makefile.dep | 293 + dcmrt/apps/Makefile.in | 55 + dcmrt/apps/drtdump.cc | 517 + dcmrt/configure | 56 + dcmrt/docs/Makefile.in | 23 + dcmrt/docs/dcmrt.dox | 128 + dcmrt/docs/drtdump.man | 187 + dcmrt/include/CMakeLists.txt | 2 + dcmrt/include/Makefile.in | 31 + dcmrt/include/dcmtk/dcmrt/drmdose.h | 159 + dcmrt/include/dcmtk/dcmrt/drmimage.h | 275 + dcmrt/include/dcmtk/dcmrt/drmplan.h | 95 + dcmrt/include/dcmtk/dcmrt/drmsrch.h | 126 + dcmrt/include/dcmtk/dcmrt/drmstrct.h | 96 + dcmrt/include/dcmtk/dcmrt/drtdose.h | 4712 +++ dcmrt/include/dcmtk/dcmrt/drtimage.h | 5472 +++ dcmrt/include/dcmtk/dcmrt/drtionpl.h | 3323 ++ dcmrt/include/dcmtk/dcmrt/drtiontr.h | 3220 ++ dcmrt/include/dcmtk/dcmrt/drtplan.h | 3419 ++ dcmrt/include/dcmtk/dcmrt/drtstrct.h | 3141 ++ dcmrt/include/dcmtk/dcmrt/drttreat.h | 3036 ++ dcmrt/include/dcmtk/dcmrt/drttypes.h | 223 + dcmrt/include/dcmtk/dcmrt/seq/drtaadcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtadcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtads.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtafs.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtags.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtajcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtas1.h | 385 + dcmrt/include/dcmtk/dcmrt/seq/drtas5.h | 385 + dcmrt/include/dcmtk/dcmrt/seq/drtas6.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtas7.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtass.h | 484 + dcmrt/include/dcmtk/dcmrt/seq/drtbads.h | 444 + dcmrt/include/dcmtk/dcmrt/seq/drtbas.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtbcps.h | 419 + dcmrt/include/dcmtk/dcmrt/seq/drtbl2.h | 560 + dcmrt/include/dcmtk/dcmrt/seq/drtbl5.h | 537 + dcmrt/include/dcmtk/dcmrt/seq/drtbldls.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtbldps.h | 333 + dcmrt/include/dcmtk/dcmrt/seq/drtblds1.h | 379 + dcmrt/include/dcmtk/dcmrt/seq/drtblds5.h | 408 + dcmrt/include/dcmtk/dcmrt/seq/drtblds6.h | 408 + dcmrt/include/dcmtk/dcmrt/seq/drtbldts.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtbrcss.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtbrdrs.h | 334 + dcmrt/include/dcmtk/dcmrt/seq/drtbrs.h | 321 + dcmrt/include/dcmtk/dcmrt/seq/drtbs.h | 985 + dcmrt/include/dcmtk/dcmrt/seq/drtbss.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtbvcps.h | 382 + dcmrt/include/dcmtk/dcmrt/seq/drtcbars.h | 560 + dcmrt/include/dcmtk/dcmrt/seq/drtccs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtcctus.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtcdrs.h | 373 + dcmrt/include/dcmtk/dcmrt/seq/drtces.h | 551 + dcmrt/include/dcmtk/dcmrt/seq/drtcgis.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtchs.h | 869 + dcmrt/include/dcmtk/dcmrt/seq/drtcims.h | 555 + dcmrt/include/dcmtk/dcmrt/seq/drtcis.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtcncs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtcos.h | 669 + dcmrt/include/dcmtk/dcmrt/seq/drtcpas.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtcpis.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drtcps.h | 899 + dcmrt/include/dcmtk/dcmrt/seq/drtcs.h | 471 + dcmrt/include/dcmtk/dcmrt/seq/drtcsas.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtcshs.h | 428 + dcmrt/include/dcmtk/dcmrt/seq/drtcsis.h | 417 + dcmrt/include/dcmtk/dcmrt/seq/drtcsrs.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtcss.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtdcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtdddps.h | 368 + dcmrt/include/dcmtk/dcmrt/seq/drtddps.h | 368 + dcmrt/include/dcmtk/dcmrt/seq/drtdias.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtdimcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtdimrs.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtdirs.h | 304 + dcmrt/include/dcmtk/dcmrt/seq/drtdrs.h | 703 + dcmrt/include/dcmtk/dcmrt/seq/drtds.h | 733 + dcmrt/include/dcmtk/dcmrt/seq/drtdspcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtdss.h | 433 + dcmrt/include/dcmtk/dcmrt/seq/drtdvhs.h | 513 + dcmrt/include/dcmtk/dcmrt/seq/drtdvrrs.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drteas.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtecs.h | 528 + dcmrt/include/dcmtk/dcmrt/seq/drtes.h | 750 + dcmrt/include/dcmtk/dcmrt/seq/drtfds.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drtfes.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtfgs.h | 536 + dcmrt/include/dcmtk/dcmrt/seq/drtfgss.h | 390 + dcmrt/include/dcmtk/dcmrt/seq/drtfms.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtfsss.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtgas.h | 391 + dcmrt/include/dcmtk/dcmrt/seq/drtgmcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtgms.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drtgpis.h | 369 + dcmrt/include/dcmtk/dcmrt/seq/drthsdrs.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtiais.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtians.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtiblds.h | 372 + dcmrt/include/dcmtk/dcmrt/seq/drtibls.h | 554 + dcmrt/include/dcmtk/dcmrt/seq/drtibs.h | 1253 + dcmrt/include/dcmtk/dcmrt/seq/drticpds.h | 1076 + dcmrt/include/dcmtk/dcmrt/seq/drticps.h | 1025 + dcmrt/include/dcmtk/dcmrt/seq/drtics.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtiis.h | 631 + dcmrt/include/dcmtk/dcmrt/seq/drtipiqs.h | 383 + dcmrt/include/dcmtk/dcmrt/seq/drtircs.h | 620 + dcmrt/include/dcmtk/dcmrt/seq/drtiseis.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtitts.h | 622 + dcmrt/include/dcmtk/dcmrt/seq/drtiwps.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtiws.h | 421 + dcmrt/include/dcmtk/dcmrt/seq/drtlsds.h | 375 + dcmrt/include/dcmtk/dcmrt/seq/drtlsds6.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtlsds7.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtmacds.h | 344 + dcmrt/include/dcmtk/dcmrt/seq/drtmas.h | 284 + dcmrt/include/dcmtk/dcmrt/seq/drtmdrs.h | 405 + dcmrt/include/dcmtk/dcmrt/seq/drtmls.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtmps.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtmris.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtmss.h | 352 + dcmrt/include/dcmtk/dcmrt/seq/drtmucs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtoas.h | 369 + dcmrt/include/dcmtk/dcmrt/seq/drtois.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drtopis.h | 353 + dcmrt/include/dcmtk/dcmrt/seq/drtos.h | 408 + dcmrt/include/dcmtk/dcmrt/seq/drtpbcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtpcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtpcxs.h | 570 + dcmrt/include/dcmtk/dcmrt/seq/drtpdecs.h | 384 + dcmrt/include/dcmtk/dcmrt/seq/drtpdeds.h | 432 + dcmrt/include/dcmtk/dcmrt/seq/drtpfms.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtpics.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtporcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtporis.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drtppcs.h | 560 + dcmrt/include/dcmtk/dcmrt/seq/drtprsis.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drtpscs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtpsics.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtpss.h | 537 + dcmrt/include/dcmtk/dcmrt/seq/drtpsss.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtpvis.h | 516 + dcmrt/include/dcmtk/dcmrt/seq/drtqds.h | 555 + dcmrt/include/dcmtk/dcmrt/seq/drtras.h | 477 + dcmrt/include/dcmtk/dcmrt/seq/drtrbas2.h | 311 + dcmrt/include/dcmtk/dcmrt/seq/drtrbas8.h | 363 + dcmrt/include/dcmtk/dcmrt/seq/drtrbls.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtrbos1.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtrbos6.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtrbos7.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtrbs2.h | 328 + dcmrt/include/dcmtk/dcmrt/seq/drtrbs4.h | 473 + dcmrt/include/dcmtk/dcmrt/seq/drtrbs8.h | 473 + dcmrt/include/dcmtk/dcmrt/seq/drtrcdrs.h | 357 + dcmrt/include/dcmtk/dcmrt/seq/drtrcos.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtrcps.h | 334 + dcmrt/include/dcmtk/dcmrt/seq/drtrcs.h | 383 + dcmrt/include/dcmtk/dcmrt/seq/drtrdros.h | 350 + dcmrt/include/dcmtk/dcmrt/seq/drtrdrs1.h | 344 + dcmrt/include/dcmtk/dcmrt/seq/drtrdrs6.h | 334 + dcmrt/include/dcmtk/dcmrt/seq/drtrdrs8.h | 564 + dcmrt/include/dcmtk/dcmrt/seq/drtrds.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrecs.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrfgs.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtrfors.h | 321 + dcmrt/include/dcmtk/dcmrt/seq/drtrics.h | 560 + dcmrt/include/dcmtk/dcmrt/seq/drtrims.h | 376 + dcmrt/include/dcmtk/dcmrt/seq/drtris.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drtrlsds.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtrmdrs.h | 357 + dcmrt/include/dcmtk/dcmrt/seq/drtrms.h | 391 + dcmrt/include/dcmtk/dcmrt/seq/drtrmss6.h | 391 + dcmrt/include/dcmtk/dcmrt/seq/drtrmss7.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtrpcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtrpis.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drtrppcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtrpphs.h | 428 + dcmrt/include/dcmtk/dcmrt/seq/drtrpps.h | 344 + dcmrt/include/dcmtk/dcmrt/seq/drtrppss.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrps.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrris1.h | 389 + dcmrt/include/dcmtk/dcmrt/seq/drtrris6.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtrris9.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrrms.h | 375 + dcmrt/include/dcmtk/dcmrt/seq/drtrros.h | 491 + dcmrt/include/dcmtk/dcmrt/seq/drtrrpcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtrrros.h | 311 + dcmrt/include/dcmtk/dcmrt/seq/drtrrs.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtrrshs.h | 343 + dcmrt/include/dcmtk/dcmrt/seq/drtrrtps.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drtrrtps3.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtrrtps4.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrrtps5.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrscs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtrsers.h | 321 + dcmrt/include/dcmtk/dcmrt/seq/drtrses.h | 321 + dcmrt/include/dcmtk/dcmrt/seq/drtrshs.h | 375 + dcmrt/include/dcmtk/dcmrt/seq/drtrshs6.h | 359 + dcmrt/include/dcmtk/dcmrt/seq/drtrshs7.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtrsis.h | 375 + dcmrt/include/dcmtk/dcmrt/seq/drtrsns.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrsos.h | 375 + dcmrt/include/dcmtk/dcmrt/seq/drtrsrs.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrss.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrsss.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrsts.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drtrtrs2.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drtrtrs4.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrvis.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtrws.h | 405 + dcmrt/include/dcmtk/dcmrt/seq/drtrwvms.h | 464 + dcmrt/include/dcmtk/dcmrt/seq/drtscris.h | 321 + dcmrt/include/dcmtk/dcmrt/seq/drtscs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtsdcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtsds.h | 391 + dcmrt/include/dcmtk/dcmrt/seq/drtshds.h | 368 + dcmrt/include/dcmtk/dcmrt/seq/drtsins.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drtsis.h | 408 + dcmrt/include/dcmtk/dcmrt/seq/drtsns.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtspccs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtspcs.h | 560 + dcmrt/include/dcmtk/dcmrt/seq/drtspgis.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drtsptcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtss.h | 632 + dcmrt/include/dcmtk/dcmrt/seq/drtssrcs.h | 545 + dcmrt/include/dcmtk/dcmrt/seq/drtssrs.h | 431 + dcmrt/include/dcmtk/dcmrt/seq/drtsss.h | 337 + dcmrt/include/dcmtk/dcmrt/seq/drttms0.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drttms9.h | 400 + dcmrt/include/dcmtk/dcmrt/seq/drttscds.h | 350 + dcmrt/include/dcmtk/dcmrt/seq/drttsibs.h | 1262 + dcmrt/include/dcmtk/dcmrt/seq/drttsmds.h | 350 + dcmrt/include/dcmtk/dcmrt/seq/drttts.h | 553 + dcmrt/include/dcmtk/dcmrt/seq/drtudis.h | 320 + dcmrt/include/dcmtk/dcmrt/seq/drtvls.h | 336 + dcmrt/include/dcmtk/dcmrt/seq/drtwps.h | 327 + dcmrt/include/dcmtk/dcmrt/seq/drtwrs.h | 304 + dcmrt/include/dcmtk/dcmrt/seq/drtwrsrs.h | 304 + dcmrt/include/dcmtk/dcmrt/seq/drtws.h | 474 + dcmrt/include/dcmtk/dcmrt/seq/drtxrs.h | 320 + dcmrt/libsrc/CMakeLists.txt | 4 + dcmrt/libsrc/Makefile.dep | 27992 ++++++++++++++ dcmrt/libsrc/Makefile.in | 85 + dcmrt/libsrc/drmdose.cc | 342 + dcmrt/libsrc/drmimage.cc | 106 + dcmrt/libsrc/drmplan.cc | 90 + dcmrt/libsrc/drmstrct.cc | 122 + dcmrt/libsrc/drtaadcs.cc | 957 + dcmrt/libsrc/drtadcs.cc | 957 + dcmrt/libsrc/drtads.cc | 957 + dcmrt/libsrc/drtafs.cc | 602 + dcmrt/libsrc/drtags.cc | 619 + dcmrt/libsrc/drtajcs.cc | 957 + dcmrt/libsrc/drtas1.cc | 663 + dcmrt/libsrc/drtas5.cc | 663 + dcmrt/libsrc/drtas6.cc | 631 + dcmrt/libsrc/drtas7.cc | 631 + dcmrt/libsrc/drtass.cc | 795 + dcmrt/libsrc/drtbads.cc | 783 + dcmrt/libsrc/drtbas.cc | 957 + dcmrt/libsrc/drtbcps.cc | 708 + dcmrt/libsrc/drtbl2.cc | 984 + dcmrt/libsrc/drtbl5.cc | 946 + dcmrt/libsrc/drtbldls.cc | 582 + dcmrt/libsrc/drtbldps.cc | 591 + dcmrt/libsrc/drtblds1.cc | 667 + dcmrt/libsrc/drtblds5.cc | 714 + dcmrt/libsrc/drtblds6.cc | 714 + dcmrt/libsrc/drtbldts.cc | 582 + dcmrt/libsrc/drtbrcss.cc | 957 + dcmrt/libsrc/drtbrdrs.cc | 591 + dcmrt/libsrc/drtbrs.cc | 551 + dcmrt/libsrc/drtbs.cc | 1468 + dcmrt/libsrc/drtbss.cc | 607 + dcmrt/libsrc/drtbvcps.cc | 666 + dcmrt/libsrc/drtcbars.cc | 964 + dcmrt/libsrc/drtccs.cc | 957 + dcmrt/libsrc/drtcctus.cc | 602 + dcmrt/libsrc/drtcdrs.cc | 658 + dcmrt/libsrc/drtces.cc | 944 + dcmrt/libsrc/drtcgis.cc | 631 + dcmrt/libsrc/drtchs.cc | 1454 + dcmrt/libsrc/drtcims.cc | 897 + dcmrt/libsrc/drtcis.cc | 636 + dcmrt/libsrc/drtcncs.cc | 957 + dcmrt/libsrc/drtcos.cc | 1163 + dcmrt/libsrc/drtcpas.cc | 636 + dcmrt/libsrc/drtcpis.cc | 674 + dcmrt/libsrc/drtcps.cc | 1459 + dcmrt/libsrc/drtcs.cc | 797 + dcmrt/libsrc/drtcsas.cc | 636 + dcmrt/libsrc/drtcshs.cc | 754 + dcmrt/libsrc/drtcsis.cc | 725 + dcmrt/libsrc/drtcsrs.cc | 573 + dcmrt/libsrc/drtcss.cc | 957 + dcmrt/libsrc/drtdcs.cc | 957 + dcmrt/libsrc/drtdddps.cc | 644 + dcmrt/libsrc/drtddps.cc | 644 + dcmrt/libsrc/drtdias.cc | 569 + dcmrt/libsrc/drtdimcs.cc | 957 + dcmrt/libsrc/drtdimrs.cc | 573 + dcmrt/libsrc/drtdirs.cc | 544 + dcmrt/libsrc/drtdose.cc | 5321 +++ dcmrt/libsrc/drtdrs.cc | 1210 + dcmrt/libsrc/drtds.cc | 1283 + dcmrt/libsrc/drtdspcs.cc | 957 + dcmrt/libsrc/drtdss.cc | 768 + dcmrt/libsrc/drtdvhs.cc | 875 + dcmrt/libsrc/drtdvrrs.cc | 582 + dcmrt/libsrc/drteas.cc | 579 + dcmrt/libsrc/drtecs.cc | 950 + dcmrt/libsrc/drtes.cc | 1178 + dcmrt/libsrc/drtfds.cc | 710 + dcmrt/libsrc/drtfes.cc | 619 + dcmrt/libsrc/drtfgs.cc | 858 + dcmrt/libsrc/drtfgss.cc | 665 + dcmrt/libsrc/drtfms.cc | 582 + dcmrt/libsrc/drtfsss.cc | 640 + dcmrt/libsrc/drtgas.cc | 694 + dcmrt/libsrc/drtgmcs.cc | 957 + dcmrt/libsrc/drtgms.cc | 580 + dcmrt/libsrc/drtgpis.cc | 634 + dcmrt/libsrc/drthsdrs.cc | 631 + dcmrt/libsrc/drtiais.cc | 602 + dcmrt/libsrc/drtians.cc | 602 + dcmrt/libsrc/drtiblds.cc | 654 + dcmrt/libsrc/drtibls.cc | 949 + dcmrt/libsrc/drtibs.cc | 1878 + dcmrt/libsrc/drticpds.cc | 1699 + dcmrt/libsrc/drticps.cc | 1627 + dcmrt/libsrc/drtics.cc | 957 + dcmrt/libsrc/drtiis.cc | 1083 + dcmrt/libsrc/drtimage.cc | 6133 ++++ dcmrt/libsrc/drtionpl.cc | 3567 ++ dcmrt/libsrc/drtiontr.cc | 3403 ++ dcmrt/libsrc/drtipiqs.cc | 623 + dcmrt/libsrc/drtircs.cc | 1069 + dcmrt/libsrc/drtiseis.cc | 602 + dcmrt/libsrc/drtitts.cc | 1044 + dcmrt/libsrc/drtiwps.cc | 607 + dcmrt/libsrc/drtiws.cc | 741 + dcmrt/libsrc/drtlsds.cc | 669 + dcmrt/libsrc/drtlsds6.cc | 632 + dcmrt/libsrc/drtlsds7.cc | 582 + dcmrt/libsrc/drtmacds.cc | 589 + dcmrt/libsrc/drtmas.cc | 520 + dcmrt/libsrc/drtmdrs.cc | 716 + dcmrt/libsrc/drtmls.cc | 633 + dcmrt/libsrc/drtmps.cc | 627 + dcmrt/libsrc/drtmris.cc | 602 + dcmrt/libsrc/drtmss.cc | 631 + dcmrt/libsrc/drtmucs.cc | 957 + dcmrt/libsrc/drtoas.cc | 638 + dcmrt/libsrc/drtois.cc | 674 + dcmrt/libsrc/drtopis.cc | 609 + dcmrt/libsrc/drtos.cc | 701 + dcmrt/libsrc/drtpbcs.cc | 957 + dcmrt/libsrc/drtpcs.cc | 957 + dcmrt/libsrc/drtpcxs.cc | 904 + dcmrt/libsrc/drtpdecs.cc | 637 + dcmrt/libsrc/drtpdeds.cc | 764 + dcmrt/libsrc/drtpfms.cc | 573 + dcmrt/libsrc/drtpics.cc | 957 + dcmrt/libsrc/drtplan.cc | 3680 ++ dcmrt/libsrc/drtporcs.cc | 957 + dcmrt/libsrc/drtporis.cc | 674 + dcmrt/libsrc/drtppcs.cc | 964 + dcmrt/libsrc/drtprsis.cc | 674 + dcmrt/libsrc/drtpscs.cc | 957 + dcmrt/libsrc/drtpsics.cc | 957 + dcmrt/libsrc/drtpss.cc | 847 + dcmrt/libsrc/drtpsss.cc | 573 + dcmrt/libsrc/drtpvis.cc | 895 + dcmrt/libsrc/drtqds.cc | 897 + dcmrt/libsrc/drtras.cc | 753 + dcmrt/libsrc/drtrbas2.cc | 553 + dcmrt/libsrc/drtrbas8.cc | 638 + dcmrt/libsrc/drtrbls.cc | 640 + dcmrt/libsrc/drtrbos1.cc | 640 + dcmrt/libsrc/drtrbos6.cc | 582 + dcmrt/libsrc/drtrbos7.cc | 582 + dcmrt/libsrc/drtrbs2.cc | 560 + dcmrt/libsrc/drtrbs4.cc | 826 + dcmrt/libsrc/drtrbs8.cc | 826 + dcmrt/libsrc/drtrcdrs.cc | 629 + dcmrt/libsrc/drtrcos.cc | 611 + dcmrt/libsrc/drtrcps.cc | 591 + dcmrt/libsrc/drtrcs.cc | 648 + dcmrt/libsrc/drtrdros.cc | 620 + dcmrt/libsrc/drtrdrs1.cc | 589 + dcmrt/libsrc/drtrdrs6.cc | 591 + dcmrt/libsrc/drtrdrs8.cc | 971 + dcmrt/libsrc/drtrds.cc | 573 + dcmrt/libsrc/drtrecs.cc | 565 + dcmrt/libsrc/drtrfgs.cc | 567 + dcmrt/libsrc/drtrfors.cc | 551 + dcmrt/libsrc/drtrics.cc | 964 + dcmrt/libsrc/drtrims.cc | 643 + dcmrt/libsrc/drtris.cc | 580 + dcmrt/libsrc/drtrlsds.cc | 611 + dcmrt/libsrc/drtrmdrs.cc | 629 + dcmrt/libsrc/drtrms.cc | 698 + dcmrt/libsrc/drtrmss6.cc | 678 + dcmrt/libsrc/drtrmss7.cc | 603 + dcmrt/libsrc/drtrpcs.cc | 957 + dcmrt/libsrc/drtrpis.cc | 674 + dcmrt/libsrc/drtrppcs.cc | 957 + dcmrt/libsrc/drtrpphs.cc | 644 + dcmrt/libsrc/drtrpps.cc | 589 + dcmrt/libsrc/drtrppss.cc | 573 + dcmrt/libsrc/drtrps.cc | 573 + dcmrt/libsrc/drtrris1.cc | 687 + dcmrt/libsrc/drtrris6.cc | 611 + dcmrt/libsrc/drtrris9.cc | 573 + dcmrt/libsrc/drtrrms.cc | 669 + dcmrt/libsrc/drtrros.cc | 771 + dcmrt/libsrc/drtrrpcs.cc | 957 + dcmrt/libsrc/drtrrros.cc | 553 + dcmrt/libsrc/drtrrs.cc | 582 + dcmrt/libsrc/drtrrshs.cc | 611 + dcmrt/libsrc/drtrrtps.cc | 580 + dcmrt/libsrc/drtrrtps3.cc | 602 + dcmrt/libsrc/drtrrtps4.cc | 573 + dcmrt/libsrc/drtrrtps5.cc | 573 + dcmrt/libsrc/drtrscs.cc | 957 + dcmrt/libsrc/drtrsers.cc | 551 + dcmrt/libsrc/drtrses.cc | 551 + dcmrt/libsrc/drtrshs.cc | 669 + dcmrt/libsrc/drtrshs6.cc | 632 + dcmrt/libsrc/drtrshs7.cc | 582 + dcmrt/libsrc/drtrsis.cc | 665 + dcmrt/libsrc/drtrsns.cc | 573 + dcmrt/libsrc/drtrsos.cc | 665 + dcmrt/libsrc/drtrsrs.cc | 573 + dcmrt/libsrc/drtrss.cc | 573 + dcmrt/libsrc/drtrsss.cc | 573 + dcmrt/libsrc/drtrsts.cc | 580 + dcmrt/libsrc/drtrtrs2.cc | 580 + dcmrt/libsrc/drtrtrs4.cc | 573 + dcmrt/libsrc/drtrvis.cc | 573 + dcmrt/libsrc/drtrws.cc | 716 + dcmrt/libsrc/drtrwvms.cc | 762 + dcmrt/libsrc/drtscris.cc | 551 + dcmrt/libsrc/drtscs.cc | 957 + dcmrt/libsrc/drtsdcs.cc | 957 + dcmrt/libsrc/drtsds.cc | 698 + dcmrt/libsrc/drtshds.cc | 660 + dcmrt/libsrc/drtsins.cc | 580 + dcmrt/libsrc/drtsis.cc | 701 + dcmrt/libsrc/drtsns.cc | 573 + dcmrt/libsrc/drtspccs.cc | 957 + dcmrt/libsrc/drtspcs.cc | 964 + dcmrt/libsrc/drtspgis.cc | 580 + dcmrt/libsrc/drtsptcs.cc | 957 + dcmrt/libsrc/drtss.cc | 1109 + dcmrt/libsrc/drtssrcs.cc | 957 + dcmrt/libsrc/drtssrs.cc | 743 + dcmrt/libsrc/drtsss.cc | 580 + dcmrt/libsrc/drtstrct.cc | 3372 ++ dcmrt/libsrc/drttms0.cc | 718 + dcmrt/libsrc/drttms9.cc | 718 + dcmrt/libsrc/drttreat.cc | 3212 ++ dcmrt/libsrc/drttscds.cc | 620 + dcmrt/libsrc/drttsibs.cc | 1868 + dcmrt/libsrc/drttsmds.cc | 620 + dcmrt/libsrc/drttts.cc | 930 + dcmrt/libsrc/drttypes.cc | 242 + dcmrt/libsrc/drtudis.cc | 573 + dcmrt/libsrc/drtvls.cc | 604 + dcmrt/libsrc/drtwps.cc | 582 + dcmrt/libsrc/drtwrs.cc | 544 + dcmrt/libsrc/drtwrsrs.cc | 544 + dcmrt/libsrc/drtws.cc | 830 + dcmrt/libsrc/drtxrs.cc | 573 + dcmrt/tests/CMakeLists.txt | 10 + dcmrt/tests/Makefile.dep | 514 + dcmrt/tests/Makefile.in | 59 + dcmrt/tests/drttest.cc | 131 + dcmrt/tests/tests.cc | 27 + dcmrt/tests/tsearch.cc | 49 + dcmseg/CMakeLists.txt | 10 + dcmseg/Makefile.in | 86 + dcmseg/configure | 53 + dcmseg/data/Makefile.in | 23 + dcmseg/docs/Makefile.in | 23 + dcmseg/docs/dcmseg.dox | 16 + dcmseg/etc/Makefile.in | 23 + dcmseg/include/CMakeLists.txt | 2 + dcmseg/include/Makefile.in | 27 + dcmseg/include/dcmtk/dcmseg/segdef.h | 37 + dcmseg/include/dcmtk/dcmseg/segdoc.h | 685 + dcmseg/include/dcmtk/dcmseg/segment.h | 338 + dcmseg/include/dcmtk/dcmseg/segtypes.h | 363 + dcmseg/include/dcmtk/dcmseg/segutils.h | 135 + dcmseg/libsrc/CMakeLists.txt | 4 + dcmseg/libsrc/Makefile.dep | 570 + dcmseg/libsrc/Makefile.in | 56 + dcmseg/libsrc/segdoc.cc | 1480 + dcmseg/libsrc/segment.cc | 396 + dcmseg/libsrc/segtypes.cc | 358 + dcmseg/libsrc/segutils.cc | 206 + dcmseg/tests/CMakeLists.txt | 8 + dcmseg/tests/Makefile.dep | 177 + dcmseg/tests/Makefile.in | 59 + dcmseg/tests/tests.cc | 26 + dcmseg/tests/tutils.cc | 73 + dcmsign/CMakeLists.txt | 10 + dcmsign/Makefile.in | 97 + dcmsign/apps/CMakeLists.txt | 6 + dcmsign/apps/Makefile.dep | 128 + dcmsign/apps/Makefile.in | 52 + dcmsign/apps/dcmsign.cc | 1175 + dcmsign/configure | 56 + dcmsign/data/Makefile.in | 23 + dcmsign/docs/Makefile.in | 23 + dcmsign/docs/dcmsign.dox | 90 + dcmsign/docs/dcmsign.man | 333 + dcmsign/etc/Makefile.in | 23 + dcmsign/include/CMakeLists.txt | 2 + dcmsign/include/Makefile.in | 27 + dcmsign/include/dcmtk/dcmsign/dcsignat.h | 265 + dcmsign/include/dcmtk/dcmsign/sialgo.h | 102 + dcmsign/include/dcmtk/dcmsign/siautopr.h | 55 + dcmsign/include/dcmtk/dcmsign/sibrsapr.h | 80 + dcmsign/include/dcmtk/dcmsign/sicert.h | 146 + dcmsign/include/dcmtk/dcmsign/sicertvf.h | 105 + dcmsign/include/dcmtk/dcmsign/sicreapr.h | 55 + dcmsign/include/dcmtk/dcmsign/sidefine.h | 38 + dcmsign/include/dcmtk/dcmsign/sidsa.h | 115 + dcmsign/include/dcmtk/dcmsign/simac.h | 85 + dcmsign/include/dcmtk/dcmsign/simaccon.h | 166 + dcmsign/include/dcmtk/dcmsign/simd5.h | 98 + dcmsign/include/dcmtk/dcmsign/sinullpr.h | 82 + dcmsign/include/dcmtk/dcmsign/siprivat.h | 116 + dcmsign/include/dcmtk/dcmsign/siripemd.h | 98 + dcmsign/include/dcmtk/dcmsign/sirsa.h | 117 + dcmsign/include/dcmtk/dcmsign/sisha1.h | 98 + dcmsign/include/dcmtk/dcmsign/sisha256.h | 98 + dcmsign/include/dcmtk/dcmsign/sisha384.h | 98 + dcmsign/include/dcmtk/dcmsign/sisha512.h | 98 + dcmsign/include/dcmtk/dcmsign/sisprof.h | 132 + dcmsign/include/dcmtk/dcmsign/sitstamp.h | 68 + dcmsign/include/dcmtk/dcmsign/sitypes.h | 192 + dcmsign/libsrc/CMakeLists.txt | 5 + dcmsign/libsrc/Makefile.dep | 865 + dcmsign/libsrc/Makefile.in | 51 + dcmsign/libsrc/dcsignat.cc | 825 + dcmsign/libsrc/siautopr.cc | 79 + dcmsign/libsrc/sibrsapr.cc | 82 + dcmsign/libsrc/sicert.cc | 308 + dcmsign/libsrc/sicertvf.cc | 135 + dcmsign/libsrc/sicreapr.cc | 95 + dcmsign/libsrc/sidsa.cc | 143 + dcmsign/libsrc/simaccon.cc | 205 + dcmsign/libsrc/simd5.cc | 90 + dcmsign/libsrc/sinullpr.cc | 60 + dcmsign/libsrc/siprivat.cc | 192 + dcmsign/libsrc/siripemd.cc | 88 + dcmsign/libsrc/sirsa.cc | 143 + dcmsign/libsrc/sisha1.cc | 89 + dcmsign/libsrc/sisha256.cc | 89 + dcmsign/libsrc/sisha384.cc | 89 + dcmsign/libsrc/sisha512.cc | 89 + dcmsign/libsrc/sisprof.cc | 139 + dcmsign/libsrc/sitypes.cc | 52 + dcmsign/tests/Makefile.in | 30 + dcmsr/CMakeLists.txt | 10 + dcmsr/Makefile.in | 102 + dcmsr/apps/CMakeLists.txt | 9 + dcmsr/apps/Makefile.dep | 560 + dcmsr/apps/Makefile.in | 66 + dcmsr/apps/dsr2html.cc | 491 + dcmsr/apps/dsr2xml.cc | 411 + dcmsr/apps/dsrdump.cc | 379 + dcmsr/apps/xml2dsr.cc | 396 + dcmsr/configure | 56 + dcmsr/data/CMakeLists.txt | 2 + dcmsr/data/Makefile.in | 29 + dcmsr/data/dsr2xml.xsd | 1025 + dcmsr/data/report.css | 91 + dcmsr/data/reportx.css | 104 + dcmsr/docs/Makefile.in | 23 + dcmsr/docs/dcmsr.dox | 178 + dcmsr/docs/dsr2html.man | 361 + dcmsr/docs/dsr2xml.man | 349 + dcmsr/docs/dsrdump.man | 299 + dcmsr/docs/xml2dsr.man | 315 + dcmsr/etc/Makefile.in | 23 + dcmsr/include/CMakeLists.txt | 2 + dcmsr/include/Makefile.in | 29 + dcmsr/include/dcmtk/dcmsr/cmr/cid100.h | 190 + dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h | 168 + dcmsr/include/dcmtk/dcmsr/cmr/cid10013e.h | 103 + dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h | 160 + dcmsr/include/dcmtk/dcmsr/cmr/cid10033e.h | 107 + dcmsr/include/dcmtk/dcmsr/cmr/cid11.h | 206 + dcmsr/include/dcmtk/dcmsr/cmr/cid244.h | 164 + dcmsr/include/dcmtk/dcmsr/cmr/cid244e.h | 103 + dcmsr/include/dcmtk/dcmsr/cmr/cid29.h | 244 + dcmsr/include/dcmtk/dcmsr/cmr/cid29e.h | 94 + dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h | 228 + dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h | 410 + dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h | 370 + dcmsr/include/dcmtk/dcmsr/cmr/cid4031e.h | 107 + dcmsr/include/dcmtk/dcmsr/cmr/cid42.h | 180 + dcmsr/include/dcmtk/dcmsr/cmr/cid5000.h | 170 + dcmsr/include/dcmtk/dcmsr/cmr/cid5001.h | 159 + dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h | 164 + dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h | 164 + dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h | 286 + dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h | 162 + dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h | 208 + dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h | 190 + dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h | 182 + dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h | 530 + dcmsr/include/dcmtk/dcmsr/cmr/define.h | 28 + dcmsr/include/dcmtk/dcmsr/cmr/init.h | 76 + dcmsr/include/dcmtk/dcmsr/cmr/logger.h | 35 + dcmsr/include/dcmtk/dcmsr/cmr/srnumvl.h | 165 + dcmsr/include/dcmtk/dcmsr/cmr/srnumvlu.h | 319 + dcmsr/include/dcmtk/dcmsr/cmr/tid1001.h | 120 + dcmsr/include/dcmtk/dcmsr/cmr/tid1204.h | 66 + dcmsr/include/dcmtk/dcmsr/cmr/tid1411.h | 382 + dcmsr/include/dcmtk/dcmsr/cmr/tid1419m.h | 270 + dcmsr/include/dcmtk/dcmsr/cmr/tid1500.h | 358 + dcmsr/include/dcmtk/dcmsr/cmr/tid1501.h | 318 + dcmsr/include/dcmtk/dcmsr/cmr/tid15def.h | 50 + dcmsr/include/dcmtk/dcmsr/cmr/tid1600.h | 528 + dcmsr/include/dcmtk/dcmsr/cmr/tid300.h | 278 + dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h | 72 + dcmsr/include/dcmtk/dcmsr/codes/dcm.h | 4270 +++ dcmsr/include/dcmtk/dcmsr/codes/ncit.h | 88 + dcmsr/include/dcmtk/dcmsr/codes/sct.h | 68 + dcmsr/include/dcmtk/dcmsr/codes/srt.h | 73 + dcmsr/include/dcmtk/dcmsr/codes/ucum.h | 64 + dcmsr/include/dcmtk/dcmsr/codes/umls.h | 102 + dcmsr/include/dcmtk/dcmsr/dsdefine.h | 46 + dcmsr/include/dcmtk/dcmsr/dsracqcc.h | 95 + dcmsr/include/dcmtk/dcmsr/dsrbascc.h | 91 + dcmsr/include/dcmtk/dcmsr/dsrc3dcc.h | 91 + dcmsr/include/dcmtk/dcmsr/dsrchecc.h | 95 + dcmsr/include/dcmtk/dcmsr/dsrcitem.h | 633 + dcmsr/include/dcmtk/dcmsr/dsrcodtn.h | 174 + dcmsr/include/dcmtk/dcmsr/dsrcodvl.h | 753 + dcmsr/include/dcmtk/dcmsr/dsrcolcc.h | 93 + dcmsr/include/dcmtk/dcmsr/dsrcomcc.h | 91 + dcmsr/include/dcmtk/dcmsr/dsrcomtn.h | 172 + dcmsr/include/dcmtk/dcmsr/dsrcomvl.h | 393 + dcmsr/include/dcmtk/dcmsr/dsrcontn.h | 225 + dcmsr/include/dcmtk/dcmsr/dsrcsidl.h | 366 + dcmsr/include/dcmtk/dcmsr/dsrctpl.h | 238 + dcmsr/include/dcmtk/dcmsr/dsrctxgr.h | 287 + dcmsr/include/dcmtk/dcmsr/dsrdattn.h | 208 + dcmsr/include/dcmtk/dcmsr/dsrdncsr.h | 119 + dcmsr/include/dcmtk/dcmsr/dsrdnflt.h | 502 + dcmsr/include/dcmtk/dcmsr/dsrdoc.h | 1467 + dcmsr/include/dcmtk/dcmsr/dsrdocst.h | 817 + dcmsr/include/dcmtk/dcmsr/dsrdoctn.h | 783 + dcmsr/include/dcmtk/dcmsr/dsrdoctr.h | 265 + dcmsr/include/dcmtk/dcmsr/dsrdtitn.h | 208 + dcmsr/include/dcmtk/dcmsr/dsrenhcc.h | 91 + dcmsr/include/dcmtk/dcmsr/dsrimgfr.h | 99 + dcmsr/include/dcmtk/dcmsr/dsrimgse.h | 99 + dcmsr/include/dcmtk/dcmsr/dsrimgtn.h | 183 + dcmsr/include/dcmtk/dcmsr/dsrimgvl.h | 507 + dcmsr/include/dcmtk/dcmsr/dsrimpcc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsriodcc.h | 91 + dcmsr/include/dcmtk/dcmsr/dsritcsr.h | 111 + dcmsr/include/dcmtk/dcmsr/dsrkeycc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrmaccc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrmamcc.h | 96 + dcmsr/include/dcmtk/dcmsr/dsrnumtn.h | 174 + dcmsr/include/dcmtk/dcmsr/dsrnumvl.h | 565 + dcmsr/include/dcmtk/dcmsr/dsrpficc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrplicc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrpnmtn.h | 207 + dcmsr/include/dcmtk/dcmsr/dsrposcn.h | 169 + dcmsr/include/dcmtk/dcmsr/dsrprdcc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrprocc.h | 93 + dcmsr/include/dcmtk/dcmsr/dsrrefin.h | 266 + dcmsr/include/dcmtk/dcmsr/dsrreftn.h | 319 + dcmsr/include/dcmtk/dcmsr/dsrrrdcc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrrtpl.h | 219 + dcmsr/include/dcmtk/dcmsr/dsrsaecc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrsc3gr.h | 177 + dcmsr/include/dcmtk/dcmsr/dsrsc3tn.h | 180 + dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h | 312 + dcmsr/include/dcmtk/dcmsr/dsrscogr.h | 186 + dcmsr/include/dcmtk/dcmsr/dsrscotn.h | 180 + dcmsr/include/dcmtk/dcmsr/dsrscovl.h | 283 + dcmsr/include/dcmtk/dcmsr/dsrsoprf.h | 639 + dcmsr/include/dcmtk/dcmsr/dsrspecc.h | 94 + dcmsr/include/dcmtk/dcmsr/dsrstpl.h | 189 + dcmsr/include/dcmtk/dcmsr/dsrstrvl.h | 225 + dcmsr/include/dcmtk/dcmsr/dsrtcodt.h | 100 + dcmsr/include/dcmtk/dcmsr/dsrtcosp.h | 99 + dcmsr/include/dcmtk/dcmsr/dsrtcotn.h | 180 + dcmsr/include/dcmtk/dcmsr/dsrtcoto.h | 99 + dcmsr/include/dcmtk/dcmsr/dsrtcovl.h | 280 + dcmsr/include/dcmtk/dcmsr/dsrtextn.h | 201 + dcmsr/include/dcmtk/dcmsr/dsrtimtn.h | 208 + dcmsr/include/dcmtk/dcmsr/dsrtlist.h | 356 + dcmsr/include/dcmtk/dcmsr/dsrtnant.h | 126 + dcmsr/include/dcmtk/dcmsr/dsrtncsr.h | 858 + dcmsr/include/dcmtk/dcmsr/dsrtpltn.h | 265 + dcmsr/include/dcmtk/dcmsr/dsrtree.h | 988 + dcmsr/include/dcmtk/dcmsr/dsrtypes.h | 1600 + dcmsr/include/dcmtk/dcmsr/dsruidtn.h | 192 + dcmsr/include/dcmtk/dcmsr/dsrwavch.h | 188 + dcmsr/include/dcmtk/dcmsr/dsrwavtn.h | 180 + dcmsr/include/dcmtk/dcmsr/dsrwavvl.h | 233 + dcmsr/include/dcmtk/dcmsr/dsrxmlc.h | 157 + dcmsr/include/dcmtk/dcmsr/dsrxmld.h | 319 + dcmsr/include/dcmtk/dcmsr/dsrxrdcc.h | 97 + dcmsr/libcmr/CMakeLists.txt | 4 + dcmsr/libcmr/Makefile.dep | 2606 ++ dcmsr/libcmr/Makefile.in | 56 + dcmsr/libcmr/cid100.cc | 178 + dcmsr/libcmr/cid10013.cc | 167 + dcmsr/libcmr/cid10013e.cc | 88 + dcmsr/libcmr/cid10033.cc | 163 + dcmsr/libcmr/cid10033e.cc | 82 + dcmsr/libcmr/cid11.cc | 186 + dcmsr/libcmr/cid244.cc | 165 + dcmsr/libcmr/cid244e.cc | 86 + dcmsr/libcmr/cid29.cc | 205 + dcmsr/libcmr/cid29e.cc | 70 + dcmsr/libcmr/cid4020.cc | 197 + dcmsr/libcmr/cid4021.cc | 288 + dcmsr/libcmr/cid4031.cc | 268 + dcmsr/libcmr/cid4031e.cc | 202 + dcmsr/libcmr/cid42.cc | 173 + dcmsr/libcmr/cid5000.cc | 172 + dcmsr/libcmr/cid5001.cc | 167 + dcmsr/libcmr/cid6147.cc | 165 + dcmsr/libcmr/cid7021.cc | 165 + dcmsr/libcmr/cid7181.cc | 226 + dcmsr/libcmr/cid7445.cc | 164 + dcmsr/libcmr/cid7452.cc | 187 + dcmsr/libcmr/cid7453.cc | 178 + dcmsr/libcmr/cid7464.cc | 174 + dcmsr/libcmr/cid7469.cc | 348 + dcmsr/libcmr/init.cc | 92 + dcmsr/libcmr/logger.cc | 22 + dcmsr/libcmr/srnumvl.cc | 111 + dcmsr/libcmr/tid1001.cc | 223 + dcmsr/libcmr/tid1204.cc | 64 + dcmsr/libcmr/tid1411.cc | 742 + dcmsr/libcmr/tid1419m.cc | 482 + dcmsr/libcmr/tid1500.cc | 460 + dcmsr/libcmr/tid1501.cc | 599 + dcmsr/libcmr/tid15def.cc | 24 + dcmsr/libcmr/tid1600.cc | 1180 + dcmsr/libcmr/tid300.cc | 554 + dcmsr/libcmr/tid4019.cc | 77 + dcmsr/libsrc/CMakeLists.txt | 5 + dcmsr/libsrc/Makefile.dep | 4858 +++ dcmsr/libsrc/Makefile.in | 64 + dcmsr/libsrc/dsracqcc.cc | 109 + dcmsr/libsrc/dsrbascc.cc | 130 + dcmsr/libsrc/dsrc3dcc.cc | 144 + dcmsr/libsrc/dsrchecc.cc | 132 + dcmsr/libsrc/dsrcitem.cc | 792 + dcmsr/libsrc/dsrcodtn.cc | 206 + dcmsr/libsrc/dsrcodvl.cc | 822 + dcmsr/libsrc/dsrcolcc.cc | 130 + dcmsr/libsrc/dsrcomcc.cc | 142 + dcmsr/libsrc/dsrcomtn.cc | 172 + dcmsr/libsrc/dsrcomvl.cc | 440 + dcmsr/libsrc/dsrcontn.cc | 260 + dcmsr/libsrc/dsrcsidl.cc | 630 + dcmsr/libsrc/dsrctpl.cc | 195 + dcmsr/libsrc/dsrctxgr.cc | 215 + dcmsr/libsrc/dsrdattn.cc | 240 + dcmsr/libsrc/dsrdncsr.cc | 98 + dcmsr/libsrc/dsrdnflt.cc | 358 + dcmsr/libsrc/dsrdoc.cc | 3113 ++ dcmsr/libsrc/dsrdocst.cc | 1309 + dcmsr/libsrc/dsrdoctn.cc | 1392 + dcmsr/libsrc/dsrdoctr.cc | 455 + dcmsr/libsrc/dsrdtitn.cc | 245 + dcmsr/libsrc/dsrenhcc.cc | 145 + dcmsr/libsrc/dsrimgfr.cc | 182 + dcmsr/libsrc/dsrimgse.cc | 163 + dcmsr/libsrc/dsrimgtn.cc | 177 + dcmsr/libsrc/dsrimgvl.cc | 773 + dcmsr/libsrc/dsrimpcc.cc | 105 + dcmsr/libsrc/dsriodcc.cc | 36 + dcmsr/libsrc/dsritcsr.cc | 184 + dcmsr/libsrc/dsrkeycc.cc | 96 + dcmsr/libsrc/dsrmaccc.cc | 107 + dcmsr/libsrc/dsrmamcc.cc | 126 + dcmsr/libsrc/dsrnumtn.cc | 165 + dcmsr/libsrc/dsrnumvl.cc | 759 + dcmsr/libsrc/dsrpficc.cc | 134 + dcmsr/libsrc/dsrplicc.cc | 130 + dcmsr/libsrc/dsrpnmtn.cc | 254 + dcmsr/libsrc/dsrposcn.cc | 128 + dcmsr/libsrc/dsrprdcc.cc | 137 + dcmsr/libsrc/dsrprocc.cc | 117 + dcmsr/libsrc/dsrrefin.cc | 458 + dcmsr/libsrc/dsrreftn.cc | 345 + dcmsr/libsrc/dsrrrdcc.cc | 120 + dcmsr/libsrc/dsrrtpl.cc | 158 + dcmsr/libsrc/dsrsaecc.cc | 133 + dcmsr/libsrc/dsrsc3gr.cc | 241 + dcmsr/libsrc/dsrsc3tn.cc | 187 + dcmsr/libsrc/dsrsc3vl.cc | 425 + dcmsr/libsrc/dsrscogr.cc | 216 + dcmsr/libsrc/dsrscotn.cc | 187 + dcmsr/libsrc/dsrscovl.cc | 371 + dcmsr/libsrc/dsrsoprf.cc | 1540 + dcmsr/libsrc/dsrspecc.cc | 85 + dcmsr/libsrc/dsrstpl.cc | 137 + dcmsr/libsrc/dsrstrvl.cc | 221 + dcmsr/libsrc/dsrtcodt.cc | 165 + dcmsr/libsrc/dsrtcosp.cc | 169 + dcmsr/libsrc/dsrtcotn.cc | 187 + dcmsr/libsrc/dsrtcoto.cc | 173 + dcmsr/libsrc/dsrtcovl.cc | 378 + dcmsr/libsrc/dsrtextn.cc | 202 + dcmsr/libsrc/dsrtimtn.cc | 239 + dcmsr/libsrc/dsrtpltn.cc | 263 + dcmsr/libsrc/dsrtree.cc | 32 + dcmsr/libsrc/dsrtypes.cc | 1787 + dcmsr/libsrc/dsruidtn.cc | 191 + dcmsr/libsrc/dsrwavch.cc | 199 + dcmsr/libsrc/dsrwavtn.cc | 177 + dcmsr/libsrc/dsrwavvl.cc | 279 + dcmsr/libsrc/dsrxmlc.cc | 112 + dcmsr/libsrc/dsrxmld.cc | 755 + dcmsr/libsrc/dsrxrdcc.cc | 136 + dcmsr/tests/CMakeLists.txt | 10 + dcmsr/tests/Makefile.dep | 883 + dcmsr/tests/Makefile.in | 63 + dcmsr/tests/gmon.out | Bin 0 -> 2537788 bytes dcmsr/tests/mkreport.cc | 1258 + dcmsr/tests/tests.cc | 104 + dcmsr/tests/tsrcmr.cc | 697 + dcmsr/tests/tsrcodvl.cc | 168 + dcmsr/tests/tsrdoc.cc | 125 + dcmsr/tests/tsrdoctr.cc | 728 + dcmsr/tests/tsrlist.cc | 86 + dcmsr/tests/tsrnumvl.cc | 63 + dcmsr/tests/tsrtpl.cc | 361 + dcmsr/tests/tsrtree.cc | 606 + dcmtls/CMakeLists.txt | 10 + dcmtls/Makefile.in | 97 + dcmtls/apps/Makefile.dep | 0 dcmtls/apps/Makefile.in | 29 + dcmtls/configure | 56 + dcmtls/data/Makefile.in | 23 + dcmtls/docs/CMakeLists.txt | 2 + dcmtls/docs/Makefile.in | 29 + dcmtls/docs/certstor.txt | 67 + dcmtls/docs/ciphers.txt | 254 + dcmtls/docs/dcmtls.dox | 70 + dcmtls/docs/randseed.txt | 109 + dcmtls/etc/Makefile.in | 23 + dcmtls/include/CMakeLists.txt | 2 + dcmtls/include/Makefile.in | 27 + dcmtls/include/dcmtk/dcmtls/tlsciphr.h | 429 + dcmtls/include/dcmtk/dcmtls/tlscond.h | 143 + dcmtls/include/dcmtk/dcmtls/tlsdefin.h | 38 + dcmtls/include/dcmtk/dcmtls/tlslayer.h | 446 + dcmtls/include/dcmtk/dcmtls/tlsopt.h | 201 + dcmtls/include/dcmtk/dcmtls/tlsscu.h | 251 + dcmtls/include/dcmtk/dcmtls/tlstrans.h | 161 + dcmtls/libsrc/CMakeLists.txt | 5 + dcmtls/libsrc/Makefile.dep | 412 + dcmtls/libsrc/Makefile.in | 50 + dcmtls/libsrc/tlsciphr.cc | 606 + dcmtls/libsrc/tlscond.cc | 146 + dcmtls/libsrc/tlslayer.cc | 953 + dcmtls/libsrc/tlsopt.cc | 434 + dcmtls/libsrc/tlsscu.cc | 338 + dcmtls/libsrc/tlstrans.cc | 388 + dcmtls/tests/Makefile.in | 30 + dcmtls/tests/dcmtk_ca.pl | 461 + dcmtract/CMakeLists.txt | 10 + dcmtract/Makefile.in | 86 + dcmtract/configure | 53 + dcmtract/data/Makefile.in | 23 + dcmtract/docs/Makefile.in | 23 + dcmtract/docs/dcmtract.dox | 158 + dcmtract/etc/Makefile.in | 23 + dcmtract/include/CMakeLists.txt | 2 + dcmtract/include/Makefile.in | 27 + dcmtract/include/dcmtk/dcmtract/trcdef.h | 37 + .../include/dcmtk/dcmtract/trcmeasurement.h | 248 + .../dcmtk/dcmtract/trcmodtractresults.h | 174 + .../include/dcmtk/dcmtract/trcstatistic.h | 326 + dcmtract/include/dcmtk/dcmtract/trctrack.h | 201 + dcmtract/include/dcmtk/dcmtract/trctrackset.h | 471 + .../dcmtk/dcmtract/trctractographyresults.h | 319 + dcmtract/include/dcmtk/dcmtract/trctypes.h | 118 + dcmtract/libsrc/CMakeLists.txt | 4 + dcmtract/libsrc/Makefile.dep | 758 + dcmtract/libsrc/Makefile.in | 56 + dcmtract/libsrc/trcmeasurement.cc | 346 + dcmtract/libsrc/trcmodtractresults.cc | 297 + dcmtract/libsrc/trcstatistic.cc | 350 + dcmtract/libsrc/trctrack.cc | 325 + dcmtract/libsrc/trctrackset.cc | 676 + dcmtract/libsrc/trctractographyresults.cc | 369 + dcmtract/libsrc/trctypes.cc | 34 + dcmtract/tests/Makefile.dep | 0 dcmtract/tests/Makefile.in | 29 + dcmwlm/CMakeLists.txt | 10 + dcmwlm/Makefile.in | 97 + dcmwlm/apps/CMakeLists.txt | 8 + dcmwlm/apps/Makefile.dep | 164 + dcmwlm/apps/Makefile.in | 68 + dcmwlm/apps/wlcefs.cc | 437 + dcmwlm/apps/wlcefs.h | 132 + dcmwlm/apps/wlmscpfs.cc | 49 + dcmwlm/configure | 56 + dcmwlm/data/CMakeLists.txt | 2 + dcmwlm/data/Makefile.in | 30 + dcmwlm/data/wlistdb/OFFIS/lockfile | 0 dcmwlm/data/wlistdb/OFFIS/wklist1.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist10.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist2.dump | 30 + dcmwlm/data/wlistdb/OFFIS/wklist3.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist4.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist5.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist6.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist7.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist8.dump | 29 + dcmwlm/data/wlistdb/OFFIS/wklist9.dump | 29 + dcmwlm/data/wlistdb/README | 62 + dcmwlm/data/wlistqry/README | 16 + dcmwlm/data/wlistqry/wlistqry0.dump | 11 + dcmwlm/data/wlistqry/wlistqry1.dump | 19 + dcmwlm/data/wlistqry/wlistqry10.dump | 18 + dcmwlm/data/wlistqry/wlistqry11.dump | 31 + dcmwlm/data/wlistqry/wlistqry12.dump | 12 + dcmwlm/data/wlistqry/wlistqry2.dump | 31 + dcmwlm/data/wlistqry/wlistqry3.dump | 8 + dcmwlm/data/wlistqry/wlistqry4.dump | 9 + dcmwlm/data/wlistqry/wlistqry5.dump | 13 + dcmwlm/data/wlistqry/wlistqry6.dump | 10 + dcmwlm/data/wlistqry/wlistqry7.dump | 31 + dcmwlm/data/wlistqry/wlistqry8.dump | 11 + dcmwlm/data/wlistqry/wlistqry9.dump | 17 + dcmwlm/docs/CMakeLists.txt | 2 + dcmwlm/docs/Makefile.in | 29 + dcmwlm/docs/dcmwlm.dox | 39 + dcmwlm/docs/wlmscpfs.man | 513 + dcmwlm/docs/wlmsetup.txt | 69 + dcmwlm/etc/Makefile.in | 23 + dcmwlm/include/CMakeLists.txt | 2 + dcmwlm/include/Makefile.in | 27 + dcmwlm/include/dcmtk/dcmwlm/wldefine.h | 38 + dcmwlm/include/dcmtk/dcmwlm/wlds.h | 493 + dcmwlm/include/dcmtk/dcmwlm/wldsfs.h | 192 + dcmwlm/include/dcmtk/dcmwlm/wlfsim.h | 265 + dcmwlm/include/dcmtk/dcmwlm/wlmactmg.h | 248 + dcmwlm/include/dcmtk/dcmwlm/wltypdef.h | 128 + dcmwlm/libsrc/CMakeLists.txt | 4 + dcmwlm/libsrc/Makefile.dep | 391 + dcmwlm/libsrc/Makefile.in | 51 + dcmwlm/libsrc/wlds.cc | 1228 + dcmwlm/libsrc/wldsfs.cc | 778 + dcmwlm/libsrc/wlfsim.cc | 802 + dcmwlm/libsrc/wlmactmg.cc | 1253 + dcmwlm/tests/CMakeLists.txt | 5 + dcmwlm/tests/Makefile.dep | 80 + dcmwlm/tests/Makefile.in | 54 + dcmwlm/tests/wltest.cc | 350 + docs/ANNOUNCE.310 | 28 + docs/ANNOUNCE.311 | 28 + docs/ANNOUNCE.312 | 28 + docs/ANNOUNCE.320 | 37 + docs/ANNOUNCE.321 | 37 + docs/ANNOUNCE.330 | 39 + docs/ANNOUNCE.331 | 45 + docs/ANNOUNCE.340 | 78 + docs/ANNOUNCE.341 | 66 + docs/ANNOUNCE.342 | 60 + docs/ANNOUNCE.350 | 57 + docs/ANNOUNCE.351 | 68 + docs/ANNOUNCE.352 | 129 + docs/ANNOUNCE.353 | 131 + docs/ANNOUNCE.354 | 143 + docs/ANNOUNCE.360 | 238 + docs/ANNOUNCE.362 | 346 + docs/ANNOUNCE.363 | 118 + docs/ANNOUNCE.364 | 159 + docs/CHANGES.301 | 48 + docs/CHANGES.302 | 52 + docs/CHANGES.310 | 28 + docs/CHANGES.311 | 140 + docs/CHANGES.312 | 117 + docs/CHANGES.320 | 734 + docs/CHANGES.321 | 27 + docs/CHANGES.330 | 968 + docs/CHANGES.331 | 285 + docs/CHANGES.340 | 2932 ++ docs/CHANGES.341 | 2347 ++ docs/CHANGES.342 | 2594 ++ docs/CHANGES.350 | 505 + docs/CHANGES.351 | 2057 ++ docs/CHANGES.352 | 3812 ++ docs/CHANGES.353 | 5482 +++ docs/CHANGES.354 | 2262 ++ docs/CHANGES.360 | 12506 +++++++ docs/CHANGES.362 | 25361 +++++++++++++ docs/CHANGES.363 | 2093 ++ docs/CHANGES.364 | 3228 ++ docs/CHANGES.365 | 2221 ++ docs/DCMIMAGE.11X | 1006 + doxygen/CMakeLists.txt | 72 + doxygen/Makefile.in | 68 + doxygen/configure | 56 + doxygen/footer.html | 5 + doxygen/htmldocs.cfg | 2370 ++ doxygen/htmldocs.dox | 81 + doxygen/layout.xml | 197 + doxygen/man2text.sh | 7 + doxygen/manpages.cfg | 2354 ++ doxygen/manpages/man1/cda2dcm.1 | 216 + doxygen/manpages/man1/dcm2json.1 | 295 + doxygen/manpages/man1/dcm2pdf.1 | 160 + doxygen/manpages/man1/dcm2pnm.1 | 455 + doxygen/manpages/man1/dcm2xml.1 | 289 + doxygen/manpages/man1/dcmcjpeg.1 | 650 + doxygen/manpages/man1/dcmcjpls.1 | 348 + doxygen/manpages/man1/dcmconv.1 | 350 + doxygen/manpages/man1/dcmcrle.1 | 215 + doxygen/manpages/man1/dcmdjpeg.1 | 302 + doxygen/manpages/man1/dcmdjpls.1 | 243 + doxygen/manpages/man1/dcmdrle.1 | 209 + doxygen/manpages/man1/dcmdspfn.1 | 146 + doxygen/manpages/man1/dcmdump.1 | 367 + doxygen/manpages/man1/dcmftest.1 | 31 + doxygen/manpages/man1/dcmgpdir.1 | 231 + doxygen/manpages/man1/dcmicmp.1 | 303 + doxygen/manpages/man1/dcmj2pnm.1 | 533 + doxygen/manpages/man1/dcml2pnm.1 | 457 + doxygen/manpages/man1/dcmmkcrv.1 | 128 + doxygen/manpages/man1/dcmmkdir.1 | 430 + doxygen/manpages/man1/dcmmklut.1 | 192 + doxygen/manpages/man1/dcmodify.1 | 440 + doxygen/manpages/man1/dcmp2pgm.1 | 114 + doxygen/manpages/man1/dcmprscp.1 | 93 + doxygen/manpages/man1/dcmprscu.1 | 150 + doxygen/manpages/man1/dcmpschk.1 | 86 + doxygen/manpages/man1/dcmpsmk.1 | 200 + doxygen/manpages/man1/dcmpsprt.1 | 277 + doxygen/manpages/man1/dcmpsrcv.1 | 82 + doxygen/manpages/man1/dcmpssnd.1 | 87 + doxygen/manpages/man1/dcmqridx.1 | 88 + doxygen/manpages/man1/dcmqrscp.1 | 999 + doxygen/manpages/man1/dcmqrti.1 | 327 + doxygen/manpages/man1/dcmquant.1 | 246 + doxygen/manpages/man1/dcmrecv.1 | 286 + doxygen/manpages/man1/dcmscale.1 | 233 + doxygen/manpages/man1/dcmsend.1 | 320 + doxygen/manpages/man1/dcmsign.1 | 281 + doxygen/manpages/man1/dcod2lum.1 | 50 + doxygen/manpages/man1/dconvlum.1 | 37 + doxygen/manpages/man1/drtdump.1 | 135 + doxygen/manpages/man1/dsr2html.1 | 302 + doxygen/manpages/man1/dsr2xml.1 | 274 + doxygen/manpages/man1/dsrdump.1 | 249 + doxygen/manpages/man1/dump2dcm.1 | 266 + doxygen/manpages/man1/echoscu.1 | 257 + doxygen/manpages/man1/findscu.1 | 374 + doxygen/manpages/man1/getscu.1 | 476 + doxygen/manpages/man1/img2dcm.1 | 349 + doxygen/manpages/man1/movescu.1 | 673 + doxygen/manpages/man1/pdf2dcm.1 | 209 + doxygen/manpages/man1/stl2dcm.1 | 226 + doxygen/manpages/man1/storescp.1 | 774 + doxygen/manpages/man1/storescu.1 | 516 + doxygen/manpages/man1/termscu.1 | 102 + doxygen/manpages/man1/wlmscpfs.1 | 416 + doxygen/manpages/man1/xml2dcm.1 | 278 + doxygen/manpages/man1/xml2dsr.1 | 251 + doxygen/patchman.cmake | 21 + doxygen/patchman.sh | 11 + oflog/CMakeLists.txt | 10 + oflog/Makefile.in | 89 + oflog/configure | 56 + oflog/data/Makefile.in | 23 + oflog/docs/LICENSE | 459 + oflog/docs/Makefile.in | 23 + oflog/docs/oflog.dox | 91 + oflog/etc/CMakeLists.txt | 2 + oflog/etc/Makefile.in | 29 + oflog/etc/filelog.cfg | 42 + oflog/etc/logger.cfg | 196 + oflog/include/CMakeLists.txt | 2 + oflog/include/Makefile.in | 43 + oflog/include/dcmtk/oflog/appender.h | 260 + oflog/include/dcmtk/oflog/asyncap.h | 93 + oflog/include/dcmtk/oflog/clfsap.h | 101 + oflog/include/dcmtk/oflog/clogger.h | 85 + oflog/include/dcmtk/oflog/config.h | 172 + oflog/include/dcmtk/oflog/config/defines.h | 364 + oflog/include/dcmtk/oflog/config/macosx.h | 37 + oflog/include/dcmtk/oflog/config/win32.h | 169 + oflog/include/dcmtk/oflog/config/windowsh.h | 159 + oflog/include/dcmtk/oflog/configrt.h | 372 + oflog/include/dcmtk/oflog/consap.h | 87 + oflog/include/dcmtk/oflog/fileap.h | 285 + oflog/include/dcmtk/oflog/fstreams.h | 59 + oflog/include/dcmtk/oflog/helpers/apndimpl.h | 121 + oflog/include/dcmtk/oflog/helpers/fileinfo.h | 62 + oflog/include/dcmtk/oflog/helpers/lloguser.h | 66 + oflog/include/dcmtk/oflog/helpers/lockfile.h | 73 + oflog/include/dcmtk/oflog/helpers/loglog.h | 146 + oflog/include/dcmtk/oflog/helpers/pointer.h | 195 + oflog/include/dcmtk/oflog/helpers/property.h | 162 + oflog/include/dcmtk/oflog/helpers/queue.h | 160 + oflog/include/dcmtk/oflog/helpers/sleep.h | 45 + oflog/include/dcmtk/oflog/helpers/snprintf.h | 63 + oflog/include/dcmtk/oflog/helpers/sockbuff.h | 81 + oflog/include/dcmtk/oflog/helpers/socket.h | 138 + oflog/include/dcmtk/oflog/helpers/strhelp.h | 201 + oflog/include/dcmtk/oflog/helpers/threadcf.h | 61 + oflog/include/dcmtk/oflog/helpers/timehelp.h | 183 + oflog/include/dcmtk/oflog/hierarchy.h | 327 + oflog/include/dcmtk/oflog/hierlock.h | 83 + oflog/include/dcmtk/oflog/internal/cygwin32.h | 56 + oflog/include/dcmtk/oflog/internal/env.h | 89 + oflog/include/dcmtk/oflog/internal/internal.h | 249 + oflog/include/dcmtk/oflog/internal/socket.h | 120 + oflog/include/dcmtk/oflog/layout.h | 603 + oflog/include/dcmtk/oflog/log4judp.h | 91 + oflog/include/dcmtk/oflog/logger.h | 324 + oflog/include/dcmtk/oflog/loglevel.h | 211 + oflog/include/dcmtk/oflog/logmacro.h | 416 + oflog/include/dcmtk/oflog/mdc.h | 80 + oflog/include/dcmtk/oflog/ndc.h | 329 + oflog/include/dcmtk/oflog/ntelogap.h | 86 + oflog/include/dcmtk/oflog/nullap.h | 67 + oflog/include/dcmtk/oflog/oflog.h | 137 + oflog/include/dcmtk/oflog/socketap.h | 173 + oflog/include/dcmtk/oflog/spi/apndatch.h | 92 + oflog/include/dcmtk/oflog/spi/factory.h | 275 + oflog/include/dcmtk/oflog/spi/filter.h | 289 + oflog/include/dcmtk/oflog/spi/logevent.h | 231 + oflog/include/dcmtk/oflog/spi/logfact.h | 62 + oflog/include/dcmtk/oflog/spi/logimpl.h | 221 + oflog/include/dcmtk/oflog/spi/objreg.h | 108 + oflog/include/dcmtk/oflog/spi/rootlog.h | 77 + oflog/include/dcmtk/oflog/streams.h | 59 + oflog/include/dcmtk/oflog/syslogap.h | 121 + oflog/include/dcmtk/oflog/tchar.h | 66 + .../dcmtk/oflog/thread/impl/syncimpl.h | 241 + .../dcmtk/oflog/thread/impl/syncpmsm.h | 119 + .../dcmtk/oflog/thread/impl/syncpthr.h | 515 + .../include/dcmtk/oflog/thread/impl/syncwin.h | 331 + .../dcmtk/oflog/thread/impl/thredimp.h | 162 + oflog/include/dcmtk/oflog/thread/impl/tls.h | 209 + oflog/include/dcmtk/oflog/thread/syncprim.h | 387 + oflog/include/dcmtk/oflog/thread/syncpub.h | 301 + oflog/include/dcmtk/oflog/thread/threads.h | 96 + oflog/include/dcmtk/oflog/tracelog.h | 82 + oflog/include/dcmtk/oflog/tstring.h | 104 + oflog/include/dcmtk/oflog/version.h | 56 + oflog/include/dcmtk/oflog/winconap.h | 86 + oflog/include/dcmtk/oflog/windebap.h | 71 + oflog/libsrc/CMakeLists.txt | 12 + oflog/libsrc/Makefile.dep | 1532 + oflog/libsrc/Makefile.in | 56 + oflog/libsrc/apndimpl.cc | 179 + oflog/libsrc/appender.cc | 359 + oflog/libsrc/asyncap.cc | 205 + oflog/libsrc/clfsap.cc | 304 + oflog/libsrc/clogger.cc | 189 + oflog/libsrc/config.cc | 758 + oflog/libsrc/consap.cc | 116 + oflog/libsrc/cygwin32.cc | 52 + oflog/libsrc/env.cc | 103 + oflog/libsrc/factory.cc | 190 + oflog/libsrc/fileap.cc | 916 + oflog/libsrc/fileinfo.cc | 74 + oflog/libsrc/filter.cc | 266 + oflog/libsrc/globinit.cc | 529 + oflog/libsrc/hierarchy.cc | 379 + oflog/libsrc/hierlock.cc | 138 + oflog/libsrc/layout.cc | 158 + oflog/libsrc/lloguser.cc | 55 + oflog/libsrc/lockfile.cc | 338 + oflog/libsrc/log4judp.cc | 263 + oflog/libsrc/logevent.cc | 264 + oflog/libsrc/logger.cc | 337 + oflog/libsrc/logimpl.cc | 178 + oflog/libsrc/loglevel.cc | 211 + oflog/libsrc/loglog.cc | 190 + oflog/libsrc/logmacro.cc | 91 + oflog/libsrc/mdc.cc | 98 + oflog/libsrc/ndc.cc | 312 + oflog/libsrc/ntelogap.cc | 354 + oflog/libsrc/nullap.cc | 78 + oflog/libsrc/objreg.cc | 121 + oflog/libsrc/oflog.cc | 261 + oflog/libsrc/patlay.cc | 1117 + oflog/libsrc/pointer.cc | 115 + oflog/libsrc/property.cc | 395 + oflog/libsrc/queue.cc | 191 + oflog/libsrc/rootlog.cc | 67 + oflog/libsrc/sleep.cc | 112 + oflog/libsrc/snprintf.cc | 244 + oflog/libsrc/sockbuff.cc | 283 + oflog/libsrc/socket.cc | 243 + oflog/libsrc/socketap.cc | 343 + oflog/libsrc/strccloc.cc | 237 + oflog/libsrc/strcloc.cc | 162 + oflog/libsrc/strhelp.cc | 222 + oflog/libsrc/striconv.cc | 274 + oflog/libsrc/syncprims.cc | 53 + oflog/libsrc/syslogap.cc | 430 + oflog/libsrc/threads.cc | 445 + oflog/libsrc/timehelp.cc | 534 + oflog/libsrc/tls.cc | 46 + oflog/libsrc/unixsock.cc | 421 + oflog/libsrc/version.cc | 40 + oflog/libsrc/winconap.cc | 191 + oflog/libsrc/windebap.cc | 90 + oflog/libsrc/winsock.cc | 396 + oflog/tests/Makefile.dep | 0 oflog/tests/Makefile.in | 29 + ofstd/CMakeLists.txt | 10 + ofstd/Makefile.in | 89 + ofstd/configure | 56 + ofstd/data/Makefile.in | 23 + ofstd/docs/Makefile.in | 23 + ofstd/docs/ofstd.dox | 63 + ofstd/etc/Makefile.in | 23 + ofstd/include/CMakeLists.txt | 2 + ofstd/include/Makefile.in | 35 + ofstd/include/dcmtk/ofstd/diag/cnvrsn.def | 7 + ofstd/include/dcmtk/ofstd/diag/mmtag.def | 9 + ofstd/include/dcmtk/ofstd/diag/nsdfti.def | 5 + ofstd/include/dcmtk/ofstd/diag/overflow.def | 7 + ofstd/include/dcmtk/ofstd/diag/piof.def | 9 + ofstd/include/dcmtk/ofstd/diag/pop.def | 7 + ofstd/include/dcmtk/ofstd/diag/push.def | 7 + ofstd/include/dcmtk/ofstd/diag/shadow.def | 9 + ofstd/include/dcmtk/ofstd/diag/signcmp.def | 7 + ofstd/include/dcmtk/ofstd/diag/vsprfw.def | 5 + ofstd/include/dcmtk/ofstd/ofalgo.h | 214 + ofstd/include/dcmtk/ofstd/ofalign.h | 214 + ofstd/include/dcmtk/ofstd/ofassert.h | 81 + ofstd/include/dcmtk/ofstd/ofbmanip.h | 170 + ofstd/include/dcmtk/ofstd/ofcast.h | 70 + ofstd/include/dcmtk/ofstd/ofchrenc.h | 443 + ofstd/include/dcmtk/ofstd/ofcmdln.h | 1118 + ofstd/include/dcmtk/ofstd/ofconapp.h | 242 + ofstd/include/dcmtk/ofstd/ofcond.h | 406 + ofstd/include/dcmtk/ofstd/ofconfig.h | 551 + ofstd/include/dcmtk/ofstd/ofconsol.h | 268 + ofstd/include/dcmtk/ofstd/ofcrc32.h | 81 + ofstd/include/dcmtk/ofstd/ofdate.h | 262 + ofstd/include/dcmtk/ofstd/ofdatime.h | 286 + ofstd/include/dcmtk/ofstd/ofdefine.h | 109 + ofstd/include/dcmtk/ofstd/ofdiag.h | 165 + ofstd/include/dcmtk/ofstd/oferror.h | 249 + ofstd/include/dcmtk/ofstd/ofexbl.h | 96 + ofstd/include/dcmtk/ofstd/ofexit.h | 63 + ofstd/include/dcmtk/ofstd/ofexport.h | 60 + ofstd/include/dcmtk/ofstd/offile.h | 1080 + ofstd/include/dcmtk/ofstd/offilsys.h | 558 + ofstd/include/dcmtk/ofstd/offname.h | 76 + ofstd/include/dcmtk/ofstd/ofglobal.h | 129 + ofstd/include/dcmtk/ofstd/ofgrp.h | 107 + ofstd/include/dcmtk/ofstd/oflimits.h | 1443 + ofstd/include/dcmtk/ofstd/oflist.h | 592 + ofstd/include/dcmtk/ofstd/ofmap.h | 233 + ofstd/include/dcmtk/ofstd/ofmath.h | 89 + ofstd/include/dcmtk/ofstd/ofmem.h | 423 + ofstd/include/dcmtk/ofstd/ofoption.h | 1086 + ofstd/include/dcmtk/ofstd/ofoset.h | 499 + ofstd/include/dcmtk/ofstd/ofpwd.h | 114 + ofstd/include/dcmtk/ofstd/ofrand.h | 94 + ofstd/include/dcmtk/ofstd/ofset.h | 252 + ofstd/include/dcmtk/ofstd/ofsetit.h | 141 + ofstd/include/dcmtk/ofstd/ofsockad.h | 126 + ofstd/include/dcmtk/ofstd/ofstack.h | 296 + ofstd/include/dcmtk/ofstd/ofstd.h | 1196 + ofstd/include/dcmtk/ofstd/ofstdinc.h | 394 + ofstd/include/dcmtk/ofstd/ofstream.h | 147 + ofstd/include/dcmtk/ofstd/ofstring.h | 1109 + ofstd/include/dcmtk/ofstd/ofstrutl.h | 49 + ofstd/include/dcmtk/ofstd/oftempf.h | 122 + ofstd/include/dcmtk/ofstd/oftest.h | 515 + ofstd/include/dcmtk/ofstd/ofthread.h | 564 + ofstd/include/dcmtk/ofstd/oftime.h | 434 + ofstd/include/dcmtk/ofstd/oftimer.h | 94 + ofstd/include/dcmtk/ofstd/oftraits.h | 497 + ofstd/include/dcmtk/ofstd/oftuple.h | 747 + ofstd/include/dcmtk/ofstd/oftypes.h | 225 + ofstd/include/dcmtk/ofstd/ofuoset.h | 437 + ofstd/include/dcmtk/ofstd/ofutil.h | 937 + ofstd/include/dcmtk/ofstd/ofuuid.h | 145 + ofstd/include/dcmtk/ofstd/ofvector.h | 403 + ofstd/include/dcmtk/ofstd/ofvriant.h | 738 + ofstd/include/dcmtk/ofstd/ofxml.h | 807 + ofstd/include/dcmtk/ofstd/variadic/helpers.h | 91 + ofstd/include/dcmtk/ofstd/variadic/tuple.h | 2045 ++ ofstd/include/dcmtk/ofstd/variadic/tuplefrd.h | 29 + ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h | 69 + ofstd/include/dcmtk/ofstd/variadic/variant.h | 594 + ofstd/libsrc/CMakeLists.txt | 4 + ofstd/libsrc/Makefile.dep | 228 + ofstd/libsrc/Makefile.in | 49 + ofstd/libsrc/ofchrenc.cc | 852 + ofstd/libsrc/ofcmdln.cc | 1707 + ofstd/libsrc/ofconapp.cc | 349 + ofstd/libsrc/ofcond.cc | 52 + ofstd/libsrc/ofconfig.cc | 635 + ofstd/libsrc/ofconsol.cc | 137 + ofstd/libsrc/ofcrc32.cc | 99 + ofstd/libsrc/ofdate.cc | 306 + ofstd/libsrc/ofdatime.cc | 292 + ofstd/libsrc/oferror.cc | 209 + ofstd/libsrc/offile.cc | 220 + ofstd/libsrc/offilsys.cc | 533 + ofstd/libsrc/offname.cc | 141 + ofstd/libsrc/oflist.cc | 113 + ofstd/libsrc/ofmath.cc | 47 + ofstd/libsrc/ofrand.cc | 202 + ofstd/libsrc/ofsockad.cc | 127 + ofstd/libsrc/ofstd.cc | 3135 ++ ofstd/libsrc/ofstring.cc | 1059 + ofstd/libsrc/ofstrutl.cc | 45 + ofstd/libsrc/oftempf.cc | 138 + ofstd/libsrc/ofthread.cc | 1174 + ofstd/libsrc/oftime.cc | 676 + ofstd/libsrc/oftimer.cc | 91 + ofstd/libsrc/ofuuid.cc | 361 + ofstd/libsrc/ofxml.cc | 3082 ++ ofstd/tests/CMakeLists.txt | 13 + ofstd/tests/Makefile.dep | 368 + ofstd/tests/Makefile.in | 54 + ofstd/tests/tatof.cc | 120 + ofstd/tests/tbase64.cc | 129 + ofstd/tests/tchrenc.cc | 263 + ofstd/tests/terror.cc | 94 + ofstd/tests/tests.cc | 87 + ofstd/tests/tfilsys.cc | 130 + ofstd/tests/tftoa.cc | 152 + ofstd/tests/tlimits.cc | 114 + ofstd/tests/tlist.cc | 258 + ofstd/tests/tmap.cc | 74 + ofstd/tests/tmarkup.cc | 127 + ofstd/tests/tmem.cc | 95 + ofstd/tests/tofdatim.cc | 209 + ofstd/tests/toffile.cc | 398 + ofstd/tests/tofstd.cc | 359 + ofstd/tests/toption.cc | 125 + ofstd/tests/tstack.cc | 55 + ofstd/tests/tstlist.exp | 43 + ofstd/tests/tstring.cc | 297 + ofstd/tests/tstrutl.cc | 96 + ofstd/tests/tthread.cc | 583 + ofstd/tests/ttuple.cc | 74 + ofstd/tests/tuuid.cc | 115 + ofstd/tests/tvariant.cc | 131 + ofstd/tests/tvec.cc | 135 + ofstd/tests/txml.cc | 80 + 2825 files changed, 1195277 insertions(+) create mode 100644 ANNOUNCE create mode 100644 CHANGES create mode 100644 CMake/3rdparty.cmake create mode 100644 CMake/CTest/CTestCustomAndroid.cmake.in create mode 100644 CMake/CTest/CTestCustomWine.cmake.in create mode 100644 CMake/CTest/dcmtkCTestMacros.cmake create mode 100644 CMake/CTest/dcmtkCTestRun.cmake.in create mode 100644 CMake/CTest/dcmtkCTestRunAndroid.cmake.in create mode 100644 CMake/CTest/dcmtkCTestRunExhaustive.cmake create mode 100644 CMake/CTest/dcmtkCTestRunWine.cmake.in create mode 100644 CMake/CheckCMakeCommandExists.cmake create mode 100644 CMake/CheckFunctionWithHeaderExists.cmake create mode 100644 CMake/DCMTKConfig.cmake.in create mode 100644 CMake/DCMTKConfig.old_cmake.in create mode 100644 CMake/FindCharset.cmake create mode 100644 CMake/FindICU.cmake create mode 100644 CMake/FindIconv.cmake create mode 100644 CMake/FindOpenJPEG.cmake create mode 100644 CMake/FindSndfile.cmake create mode 100644 CMake/FindWrap.cmake create mode 100644 CMake/GenerateCMakeExports.cmake create mode 100644 CMake/GenerateDCMTKConfigure.cmake create mode 100644 CMake/dcmtkAfterModules.cmake create mode 100644 CMake/dcmtkMacros.cmake create mode 100644 CMake/dcmtkPrepare.cmake create mode 100644 CMake/dcmtkTestCharSignedness.cc create mode 100644 CMake/dcmtkTryCompile.cmake create mode 100644 CMake/dcmtkTryRun.cmake create mode 100644 CMake/dcmtkUseAndroidSDK.cmake create mode 100644 CMake/dcmtkUseWine.cmake create mode 100644 CMake/dcmtkWinePath.reg.in create mode 100644 CMake/osconfig.h.in create mode 100644 CMakeLists.txt create mode 100644 COPYRIGHT create mode 100644 CREDITS create mode 100644 FAQ create mode 100644 HISTORY create mode 100644 INSTALL create mode 100644 Makefile create mode 100644 README create mode 100644 README.md create mode 100644 VERSION create mode 100644 config/CMakeLists.txt create mode 100644 config/Makefile.def.in create mode 100644 config/Makefile.in create mode 100644 config/aclocal.m4 create mode 100755 config/autoall create mode 100755 config/changext create mode 100755 config/config.guess create mode 100755 config/config.sub create mode 100755 config/configure create mode 100644 config/configure.in create mode 100755 config/confmod create mode 100644 config/confmod.in create mode 100644 config/docs/CMakeLists.txt create mode 100644 config/docs/config.dox create mode 100644 config/docs/config.txt create mode 100644 config/docs/cxx11.dox create mode 100644 config/docs/dirstruc.txt create mode 100644 config/docs/envvars.txt create mode 100644 config/docs/macros.txt create mode 100644 config/docs/modules.txt create mode 100644 config/general.m4 create mode 100644 config/include/dcmtk/config/osconfig.h.in create mode 100755 config/install-sh create mode 100644 config/math.cc create mode 100755 config/mkinstalldirs create mode 100644 config/modules create mode 100755 config/rootconf create mode 100644 config/stdcxx.m4 create mode 100644 config/templates/Makefile.lib create mode 100644 config/templates/Makefile.mod create mode 100644 config/templates/Makefile.src create mode 100755 config/templates/configure.mod create mode 100644 config/tests/algo.cc create mode 100644 config/tests/arith.cc create mode 100644 config/tests/cxx11.cc create mode 100644 config/tests/cxx14.cc create mode 100644 config/tests/cxx17.cc create mode 100644 config/tests/iconv.cc create mode 100644 config/tests/lciconv.cc create mode 100644 config/tests/lfs.c create mode 100644 config/tests/lfs64.cc create mode 100644 config/tests/limits.cc create mode 100644 config/tests/list.cc create mode 100644 config/tests/map.cc create mode 100644 config/tests/memory.cc create mode 100644 config/tests/stack.cc create mode 100644 config/tests/string.cc create mode 100644 config/tests/syserr.cc create mode 100644 config/tests/ttraits.cc create mode 100644 config/tests/tuple.cc create mode 100644 config/tests/vector.cc create mode 100644 dcmdata/CMakeLists.txt create mode 100644 dcmdata/Makefile.in create mode 100644 dcmdata/apps/CMakeLists.txt create mode 100644 dcmdata/apps/Makefile.dep create mode 100644 dcmdata/apps/Makefile.in create mode 100755 dcmdata/apps/cda2dcm.cc create mode 100644 dcmdata/apps/dcm2json.cc create mode 100644 dcmdata/apps/dcm2pdf.cc create mode 100644 dcmdata/apps/dcm2xml.cc create mode 100644 dcmdata/apps/dcmconv.cc create mode 100644 dcmdata/apps/dcmcrle.cc create mode 100644 dcmdata/apps/dcmdrle.cc create mode 100644 dcmdata/apps/dcmdump.cc create mode 100644 dcmdata/apps/dcmftest.cc create mode 100644 dcmdata/apps/dcmgpdir.cc create mode 100644 dcmdata/apps/dcmodify.cc create mode 100644 dcmdata/apps/dump2dcm.cc create mode 100644 dcmdata/apps/img2dcm.cc create mode 100644 dcmdata/apps/mdfconen.cc create mode 100644 dcmdata/apps/mdfconen.h create mode 100644 dcmdata/apps/mdfdsman.cc create mode 100644 dcmdata/apps/mdfdsman.h create mode 100644 dcmdata/apps/pdf2dcm.cc create mode 100755 dcmdata/apps/stl2dcm.cc create mode 100644 dcmdata/apps/xml2dcm.cc create mode 100755 dcmdata/configure create mode 100644 dcmdata/data/CMakeLists.txt create mode 100644 dcmdata/data/Makefile.in create mode 100644 dcmdata/data/SC.dump create mode 100644 dcmdata/data/VLP.dump create mode 100644 dcmdata/data/acrnema.dic create mode 100644 dcmdata/data/dcm2xml.dtd create mode 100644 dcmdata/data/dicom.dic create mode 100644 dcmdata/data/diconde.dic create mode 100644 dcmdata/data/dumppat.txt create mode 100644 dcmdata/data/private.dic create mode 100644 dcmdata/docs/CMakeLists.txt create mode 100644 dcmdata/docs/Makefile.in create mode 100644 dcmdata/docs/cda2dcm.man create mode 100644 dcmdata/docs/datadict.txt create mode 100644 dcmdata/docs/dcm2json.man create mode 100644 dcmdata/docs/dcm2pdf.man create mode 100644 dcmdata/docs/dcm2xml.man create mode 100644 dcmdata/docs/dcmconv.man create mode 100644 dcmdata/docs/dcmcrle.man create mode 100644 dcmdata/docs/dcmdata.dox create mode 100644 dcmdata/docs/dcmdrle.man create mode 100644 dcmdata/docs/dcmdump.man create mode 100644 dcmdata/docs/dcmftest.man create mode 100644 dcmdata/docs/dcmgpdir.man create mode 100644 dcmdata/docs/dcmodify.man create mode 100644 dcmdata/docs/dump2dcm.man create mode 100644 dcmdata/docs/img2dcm.man create mode 100644 dcmdata/docs/pdf2dcm.man create mode 100644 dcmdata/docs/stl2dcm.man create mode 100644 dcmdata/docs/xml2dcm.man create mode 100644 dcmdata/etc/Makefile.in create mode 100644 dcmdata/include/CMakeLists.txt create mode 100644 dcmdata/include/Makefile.in create mode 100644 dcmdata/include/dcmtk/dcmdata/cmdlnarg.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcbytstr.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcchrstr.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dccodec.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdatset.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdatutl.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcddirif.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdefine.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdeftag.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdicdir.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdicent.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdict.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcdirrec.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcelem.h create mode 100755 dcmdata/include/dcmtk/dcmdata/dcencdoc.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcerror.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcfcache.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcfilefo.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcfilter.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dchashdi.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcistrma.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcistrmb.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcistrmf.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcistrmz.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcitem.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcjson.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dclist.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcmatch.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcmetinf.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcobject.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcofsetl.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcostrma.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcostrmb.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcostrmf.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcostrmz.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcovlay.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcpath.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcpcache.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcpixel.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcpixseq.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcpxitem.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrleccd.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrlecce.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrlecp.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrledec.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrledrg.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrleenc.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrleerg.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcrlerp.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcsequen.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcspchrs.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcstack.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcswap.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dctag.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dctagkey.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dctk.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dctypes.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcuid.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvr.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrae.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvras.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrat.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrcs.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrda.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrds.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrdt.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrfd.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrfl.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvris.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrlo.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrlt.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrobow.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrod.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrof.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrol.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrov.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrpn.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrpobw.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrsh.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrsl.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrss.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrst.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrsv.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrtm.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvruc.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrui.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrul.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrulup.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrur.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrus.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvrut.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcvruv.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcwcache.h create mode 100644 dcmdata/include/dcmtk/dcmdata/dcxfer.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2d.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2dbmps.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2define.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2dimgs.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2djpgs.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2doutpl.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2dplnsc.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2dplsc.h create mode 100644 dcmdata/include/dcmtk/dcmdata/libi2d/i2dplvlp.h create mode 100644 dcmdata/include/dcmtk/dcmdata/vrscan.h create mode 100644 dcmdata/libi2d/CMakeLists.txt create mode 100644 dcmdata/libi2d/Makefile.dep create mode 100644 dcmdata/libi2d/Makefile.in create mode 100644 dcmdata/libi2d/i2d.cc create mode 100644 dcmdata/libi2d/i2dbmps.cc create mode 100644 dcmdata/libi2d/i2djpgs.cc create mode 100644 dcmdata/libi2d/i2dplnsc.cc create mode 100644 dcmdata/libi2d/i2dplsc.cc create mode 100644 dcmdata/libi2d/i2dplvlp.cc create mode 100644 dcmdata/libsrc/CMakeLists.txt create mode 100644 dcmdata/libsrc/Makefile.dep create mode 100644 dcmdata/libsrc/Makefile.in create mode 100644 dcmdata/libsrc/cmdlnarg.cc create mode 100644 dcmdata/libsrc/dcbytstr.cc create mode 100644 dcmdata/libsrc/dcchrstr.cc create mode 100644 dcmdata/libsrc/dccodec.cc create mode 100644 dcmdata/libsrc/dcdatset.cc create mode 100644 dcmdata/libsrc/dcdatutl.cc create mode 100644 dcmdata/libsrc/dcddirif.cc create mode 100644 dcmdata/libsrc/dcdicdir.cc create mode 100644 dcmdata/libsrc/dcdicent.cc create mode 100644 dcmdata/libsrc/dcdict.cc create mode 100644 dcmdata/libsrc/dcdictbi.cc create mode 100644 dcmdata/libsrc/dcdirrec.cc create mode 100644 dcmdata/libsrc/dcelem.cc create mode 100644 dcmdata/libsrc/dcencdoc.cc create mode 100644 dcmdata/libsrc/dcerror.cc create mode 100644 dcmdata/libsrc/dcfilefo.cc create mode 100644 dcmdata/libsrc/dcfilter.cc create mode 100644 dcmdata/libsrc/dchashdi.cc create mode 100644 dcmdata/libsrc/dcistrma.cc create mode 100644 dcmdata/libsrc/dcistrmb.cc create mode 100644 dcmdata/libsrc/dcistrmf.cc create mode 100644 dcmdata/libsrc/dcistrmz.cc create mode 100644 dcmdata/libsrc/dcitem.cc create mode 100644 dcmdata/libsrc/dcjson.cc create mode 100644 dcmdata/libsrc/dclist.cc create mode 100644 dcmdata/libsrc/dcmatch.cc create mode 100644 dcmdata/libsrc/dcmetinf.cc create mode 100644 dcmdata/libsrc/dcobject.cc create mode 100644 dcmdata/libsrc/dcostrma.cc create mode 100644 dcmdata/libsrc/dcostrmb.cc create mode 100644 dcmdata/libsrc/dcostrmf.cc create mode 100644 dcmdata/libsrc/dcostrmz.cc create mode 100644 dcmdata/libsrc/dcpath.cc create mode 100644 dcmdata/libsrc/dcpcache.cc create mode 100644 dcmdata/libsrc/dcpixel.cc create mode 100644 dcmdata/libsrc/dcpixseq.cc create mode 100644 dcmdata/libsrc/dcpxitem.cc create mode 100644 dcmdata/libsrc/dcrleccd.cc create mode 100644 dcmdata/libsrc/dcrlecce.cc create mode 100644 dcmdata/libsrc/dcrlecp.cc create mode 100644 dcmdata/libsrc/dcrledrg.cc create mode 100644 dcmdata/libsrc/dcrleerg.cc create mode 100644 dcmdata/libsrc/dcrlerp.cc create mode 100644 dcmdata/libsrc/dcsequen.cc create mode 100644 dcmdata/libsrc/dcspchrs.cc create mode 100644 dcmdata/libsrc/dcstack.cc create mode 100644 dcmdata/libsrc/dcswap.cc create mode 100644 dcmdata/libsrc/dctag.cc create mode 100644 dcmdata/libsrc/dctagkey.cc create mode 100644 dcmdata/libsrc/dctypes.cc create mode 100644 dcmdata/libsrc/dcuid.cc create mode 100644 dcmdata/libsrc/dcvr.cc create mode 100644 dcmdata/libsrc/dcvrae.cc create mode 100644 dcmdata/libsrc/dcvras.cc create mode 100644 dcmdata/libsrc/dcvrat.cc create mode 100644 dcmdata/libsrc/dcvrcs.cc create mode 100644 dcmdata/libsrc/dcvrda.cc create mode 100644 dcmdata/libsrc/dcvrds.cc create mode 100644 dcmdata/libsrc/dcvrdt.cc create mode 100644 dcmdata/libsrc/dcvrfd.cc create mode 100644 dcmdata/libsrc/dcvrfl.cc create mode 100644 dcmdata/libsrc/dcvris.cc create mode 100644 dcmdata/libsrc/dcvrlo.cc create mode 100644 dcmdata/libsrc/dcvrlt.cc create mode 100644 dcmdata/libsrc/dcvrobow.cc create mode 100644 dcmdata/libsrc/dcvrod.cc create mode 100644 dcmdata/libsrc/dcvrof.cc create mode 100644 dcmdata/libsrc/dcvrol.cc create mode 100644 dcmdata/libsrc/dcvrov.cc create mode 100644 dcmdata/libsrc/dcvrpn.cc create mode 100644 dcmdata/libsrc/dcvrpobw.cc create mode 100644 dcmdata/libsrc/dcvrsh.cc create mode 100644 dcmdata/libsrc/dcvrsl.cc create mode 100644 dcmdata/libsrc/dcvrss.cc create mode 100644 dcmdata/libsrc/dcvrst.cc create mode 100644 dcmdata/libsrc/dcvrsv.cc create mode 100644 dcmdata/libsrc/dcvrtm.cc create mode 100644 dcmdata/libsrc/dcvruc.cc create mode 100644 dcmdata/libsrc/dcvrui.cc create mode 100644 dcmdata/libsrc/dcvrul.cc create mode 100644 dcmdata/libsrc/dcvrulup.cc create mode 100644 dcmdata/libsrc/dcvrur.cc create mode 100644 dcmdata/libsrc/dcvrus.cc create mode 100644 dcmdata/libsrc/dcvrut.cc create mode 100644 dcmdata/libsrc/dcvruv.cc create mode 100644 dcmdata/libsrc/dcwcache.cc create mode 100644 dcmdata/libsrc/dcxfer.cc create mode 100644 dcmdata/libsrc/mkdeftag.cc create mode 100644 dcmdata/libsrc/mkdictbi.cc create mode 100644 dcmdata/libsrc/vrscan.cc create mode 100644 dcmdata/libsrc/vrscani.h create mode 100644 dcmdata/libsrc/vrscanl.c create mode 100644 dcmdata/libsrc/vrscanl.h create mode 100644 dcmdata/libsrc/vrscanl.l create mode 100644 dcmdata/tests/CMakeLists.txt create mode 100644 dcmdata/tests/Makefile.dep create mode 100644 dcmdata/tests/Makefile.in create mode 100644 dcmdata/tests/dcmpsdmp.tcl create mode 100644 dcmdata/tests/dctmacro.h create mode 100644 dcmdata/tests/tchval.cc create mode 100644 dcmdata/tests/tdict.cc create mode 100644 dcmdata/tests/telemlen.cc create mode 100644 dcmdata/tests/tests.cc create mode 100644 dcmdata/tests/tfilter.cc create mode 100644 dcmdata/tests/tgenuid.cc create mode 100644 dcmdata/tests/ti2dbmp.cc create mode 100644 dcmdata/tests/tmatch.cc create mode 100644 dcmdata/tests/tnewdcme.cc create mode 100644 dcmdata/tests/tparent.cc create mode 100644 dcmdata/tests/tparser.cc create mode 100644 dcmdata/tests/tpath.cc create mode 100644 dcmdata/tests/tpread.cc create mode 100644 dcmdata/tests/tspchrs.cc create mode 100644 dcmdata/tests/tstrval.cc create mode 100644 dcmdata/tests/tvrcomp.cc create mode 100644 dcmdata/tests/tvrdatim.cc create mode 100644 dcmdata/tests/tvrds.cc create mode 100644 dcmdata/tests/tvrfd.cc create mode 100644 dcmdata/tests/tvrol.cc create mode 100644 dcmdata/tests/tvrov.cc create mode 100644 dcmdata/tests/tvrpn.cc create mode 100644 dcmdata/tests/tvrsv.cc create mode 100644 dcmdata/tests/tvrui.cc create mode 100644 dcmdata/tests/tvruv.cc create mode 100644 dcmfg/CMakeLists.txt create mode 100644 dcmfg/Makefile.in create mode 100755 dcmfg/configure create mode 100644 dcmfg/data/Makefile.in create mode 100644 dcmfg/docs/Makefile.in create mode 100644 dcmfg/docs/dcmfg.dox create mode 100644 dcmfg/etc/Makefile.in create mode 100644 dcmfg/include/CMakeLists.txt create mode 100644 dcmfg/include/Makefile.in create mode 100644 dcmfg/include/dcmtk/dcmfg/fg.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgbase.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgdefine.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgderimg.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgfact.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgfracon.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgframeanatomy.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgframevoilut.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgimagedatatype.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fginterface.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgparametricmapframetype.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgpixeltransform.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgpixmsr.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgplanor.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgplanorvol.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgplanpo.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgplanposvol.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgrealworldvaluemapping.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgseg.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgtypes.h create mode 100644 dcmfg/include/dcmtk/dcmfg/fgusimagedescription.h create mode 100644 dcmfg/include/dcmtk/dcmfg/stack.h create mode 100644 dcmfg/include/dcmtk/dcmfg/stackinterface.h create mode 100644 dcmfg/libsrc/CMakeLists.txt create mode 100644 dcmfg/libsrc/Makefile.dep create mode 100644 dcmfg/libsrc/Makefile.in create mode 100644 dcmfg/libsrc/fg.cc create mode 100644 dcmfg/libsrc/fgbase.cc create mode 100644 dcmfg/libsrc/fgderimg.cc create mode 100644 dcmfg/libsrc/fgfact.cc create mode 100644 dcmfg/libsrc/fgfracon.cc create mode 100644 dcmfg/libsrc/fgframeanatomy.cc create mode 100644 dcmfg/libsrc/fgframevoilut.cc create mode 100644 dcmfg/libsrc/fgimagedatatype.cc create mode 100644 dcmfg/libsrc/fginterface.cc create mode 100644 dcmfg/libsrc/fgparametricmapframetype.cc create mode 100644 dcmfg/libsrc/fgpixeltransform.cc create mode 100644 dcmfg/libsrc/fgpixmsr.cc create mode 100644 dcmfg/libsrc/fgplanor.cc create mode 100644 dcmfg/libsrc/fgplanorvol.cc create mode 100644 dcmfg/libsrc/fgplanpo.cc create mode 100644 dcmfg/libsrc/fgplanposvol.cc create mode 100644 dcmfg/libsrc/fgrealworldvaluemapping.cc create mode 100644 dcmfg/libsrc/fgseg.cc create mode 100644 dcmfg/libsrc/fgtypes.cc create mode 100644 dcmfg/libsrc/fgusimagedescription.cc create mode 100644 dcmfg/libsrc/stack.cc create mode 100644 dcmfg/libsrc/stackinterface.cc create mode 100644 dcmfg/tests/CMakeLists.txt create mode 100644 dcmfg/tests/Makefile.dep create mode 100644 dcmfg/tests/Makefile.in create mode 100644 dcmfg/tests/t_deriv_image.cc create mode 100644 dcmfg/tests/t_frame_content.cc create mode 100644 dcmfg/tests/tests.cc create mode 100644 dcmimage/CMakeLists.txt create mode 100644 dcmimage/Makefile.in create mode 100644 dcmimage/apps/CMakeLists.txt create mode 100644 dcmimage/apps/Makefile.dep create mode 100644 dcmimage/apps/Makefile.in create mode 100644 dcmimage/apps/dcm2pnm.cc create mode 100644 dcmimage/apps/dcmicmp.cc create mode 100644 dcmimage/apps/dcmquant.cc create mode 100644 dcmimage/apps/dcmscale.cc create mode 100755 dcmimage/configure create mode 100644 dcmimage/data/Makefile.in create mode 100644 dcmimage/docs/Makefile.in create mode 100644 dcmimage/docs/dcm2pnm.man create mode 100644 dcmimage/docs/dcmicmp.man create mode 100644 dcmimage/docs/dcmimage.dox create mode 100644 dcmimage/docs/dcmquant.man create mode 100644 dcmimage/docs/dcmscale.man create mode 100644 dcmimage/etc/Makefile.in create mode 100644 dcmimage/include/CMakeLists.txt create mode 100644 dcmimage/include/Makefile.in create mode 100644 dcmimage/include/dcmtk/dcmimage/dcmicmph.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diargimg.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diargpxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicdefin.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicmyimg.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicmypxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicocpt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicoflt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicoimg.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicomot.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicoopx.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicoopxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicopx.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicopxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicorot.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dicosct.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dihsvimg.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dihsvpxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dilogger.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dipalimg.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dipalpxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dipipng.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dipitiff.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqtcmap.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqtctab.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqtfs.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqthash.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqthitl.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqthitm.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqtid.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqtpbox.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqtpix.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqtstab.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diqttype.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diquant.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diregist.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dirgbimg.h create mode 100644 dcmimage/include/dcmtk/dcmimage/dirgbpxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diybrimg.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diybrpxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diyf2img.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diyf2pxt.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diyp2img.h create mode 100644 dcmimage/include/dcmtk/dcmimage/diyp2pxt.h create mode 100644 dcmimage/libsrc/CMakeLists.txt create mode 100644 dcmimage/libsrc/Makefile.dep create mode 100644 dcmimage/libsrc/Makefile.in create mode 100644 dcmimage/libsrc/dcmicmph.cc create mode 100644 dcmimage/libsrc/diargimg.cc create mode 100644 dcmimage/libsrc/dicmyimg.cc create mode 100644 dcmimage/libsrc/dicoimg.cc create mode 100644 dcmimage/libsrc/dicoopx.cc create mode 100644 dcmimage/libsrc/dicopx.cc create mode 100644 dcmimage/libsrc/dihsvimg.cc create mode 100644 dcmimage/libsrc/dilogger.cc create mode 100644 dcmimage/libsrc/dipalimg.cc create mode 100644 dcmimage/libsrc/dipipng.cc create mode 100644 dcmimage/libsrc/dipitiff.cc create mode 100644 dcmimage/libsrc/diqtctab.cc create mode 100644 dcmimage/libsrc/diqtfs.cc create mode 100644 dcmimage/libsrc/diqthash.cc create mode 100644 dcmimage/libsrc/diqthitl.cc create mode 100644 dcmimage/libsrc/diqtpbox.cc create mode 100644 dcmimage/libsrc/diquant.cc create mode 100644 dcmimage/libsrc/diregist.cc create mode 100644 dcmimage/libsrc/dirgbimg.cc create mode 100644 dcmimage/libsrc/diybrimg.cc create mode 100644 dcmimage/libsrc/diyf2img.cc create mode 100644 dcmimage/libsrc/diyp2img.cc create mode 100644 dcmimage/tests/Makefile.in create mode 100644 dcmimgle/CMakeLists.txt create mode 100644 dcmimgle/Makefile.in create mode 100644 dcmimgle/apps/CMakeLists.txt create mode 100644 dcmimgle/apps/Makefile.dep create mode 100644 dcmimgle/apps/Makefile.in create mode 100644 dcmimgle/apps/dcmdspfn.cc create mode 100644 dcmimgle/apps/dcod2lum.cc create mode 100644 dcmimgle/apps/dconvlum.cc create mode 100755 dcmimgle/configure create mode 100644 dcmimgle/data/CMakeLists.txt create mode 100644 dcmimgle/data/Makefile.in create mode 100644 dcmimgle/data/camera.lut create mode 100644 dcmimgle/data/monitor.lut create mode 100644 dcmimgle/data/printer.lut create mode 100644 dcmimgle/data/scanner.lut create mode 100644 dcmimgle/docs/Makefile.in create mode 100644 dcmimgle/docs/dcmdspfn.man create mode 100644 dcmimgle/docs/dcmimgle.dox create mode 100644 dcmimgle/docs/dcod2lum.man create mode 100644 dcmimgle/docs/dconvlum.man create mode 100644 dcmimgle/etc/Makefile.in create mode 100644 dcmimgle/include/CMakeLists.txt create mode 100644 dcmimgle/include/Makefile.in create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dcmimage.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dibaslut.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diciefn.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dicielut.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dicrvfit.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/didefine.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/didislut.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/didispfn.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/didocu.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diflipt.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/digsdfn.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/digsdlut.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diimage.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diinpx.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diinpxt.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diluptab.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimo1img.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimo2img.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimocpt.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimoflt.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimoimg.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimomod.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimoopx.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimoopxt.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimopx.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimopxt.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimorot.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dimosct.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diobjcou.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diovdat.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diovlay.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diovlimg.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diovpln.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dipixel.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diplugin.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dipxrept.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diregbas.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/dirotat.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/discalet.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/displint.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/ditranst.h create mode 100644 dcmimgle/include/dcmtk/dcmimgle/diutils.h create mode 100644 dcmimgle/libsrc/CMakeLists.txt create mode 100644 dcmimgle/libsrc/Makefile.dep create mode 100644 dcmimgle/libsrc/Makefile.in create mode 100644 dcmimgle/libsrc/dcmimage.cc create mode 100644 dcmimgle/libsrc/dibaslut.cc create mode 100644 dcmimgle/libsrc/diciefn.cc create mode 100644 dcmimgle/libsrc/dicielut.cc create mode 100644 dcmimgle/libsrc/didislut.cc create mode 100644 dcmimgle/libsrc/didispfn.cc create mode 100644 dcmimgle/libsrc/didocu.cc create mode 100644 dcmimgle/libsrc/digsdfn.cc create mode 100644 dcmimgle/libsrc/digsdlut.cc create mode 100644 dcmimgle/libsrc/diimage.cc create mode 100644 dcmimgle/libsrc/diinpx.cc create mode 100644 dcmimgle/libsrc/diluptab.cc create mode 100644 dcmimgle/libsrc/dimo1img.cc create mode 100644 dcmimgle/libsrc/dimo2img.cc create mode 100644 dcmimgle/libsrc/dimoimg.cc create mode 100644 dcmimgle/libsrc/dimoimg3.cc create mode 100644 dcmimgle/libsrc/dimoimg4.cc create mode 100644 dcmimgle/libsrc/dimoimg5.cc create mode 100644 dcmimgle/libsrc/dimomod.cc create mode 100644 dcmimgle/libsrc/dimoopx.cc create mode 100644 dcmimgle/libsrc/dimopx.cc create mode 100644 dcmimgle/libsrc/diovdat.cc create mode 100644 dcmimgle/libsrc/diovlay.cc create mode 100644 dcmimgle/libsrc/diovlimg.cc create mode 100644 dcmimgle/libsrc/diovpln.cc create mode 100644 dcmimgle/libsrc/diutils.cc create mode 100644 dcmimgle/tests/Makefile.in create mode 100644 dcmiod/CMakeLists.txt create mode 100644 dcmiod/Makefile.in create mode 100755 dcmiod/configure create mode 100644 dcmiod/data/Makefile.in create mode 100644 dcmiod/docs/Makefile.in create mode 100644 dcmiod/docs/dcmiod.dox create mode 100644 dcmiod/etc/Makefile.in create mode 100644 dcmiod/include/CMakeLists.txt create mode 100644 dcmiod/include/Makefile.in create mode 100644 dcmiod/include/dcmtk/dcmiod/cielabutil.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodcommn.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h create mode 100644 dcmiod/include/dcmtk/dcmiod/ioddef.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodimage.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodmacro.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodreferences.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodrules.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodtypes.h create mode 100644 dcmiod/include/dcmtk/dcmiod/iodutil.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modacquisitioncontext.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modbase.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modenhequipment.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modenhusimage.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modenhusseries.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modequipment.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modfloatingpointimagepixel.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modfor.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modgeneralimage.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modgeneralseries.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modhelp.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modimagepixel.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modmultiframefg.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modpatient.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modpatientstudy.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modsegmentationseries.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modsopcommon.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modsynchronisation.h create mode 100644 dcmiod/include/dcmtk/dcmiod/modusfor.h create mode 100644 dcmiod/libsrc/CMakeLists.txt create mode 100644 dcmiod/libsrc/Makefile.dep create mode 100644 dcmiod/libsrc/Makefile.in create mode 100644 dcmiod/libsrc/cielabutil.cc create mode 100644 dcmiod/libsrc/iodcommn.cc create mode 100644 dcmiod/libsrc/iodcontentitemmacro.cc create mode 100644 dcmiod/libsrc/iodmacro.cc create mode 100644 dcmiod/libsrc/iodreferences.cc create mode 100644 dcmiod/libsrc/iodrules.cc create mode 100644 dcmiod/libsrc/iodtypes.cc create mode 100644 dcmiod/libsrc/iodutil.cc create mode 100644 dcmiod/libsrc/modacquisitioncontext.cc create mode 100644 dcmiod/libsrc/modbase.cc create mode 100644 dcmiod/libsrc/modcommoninstanceref.cc create mode 100644 dcmiod/libsrc/modenhequipment.cc create mode 100644 dcmiod/libsrc/modenhusimage.cc create mode 100644 dcmiod/libsrc/modenhusseries.cc create mode 100644 dcmiod/libsrc/modequipment.cc create mode 100644 dcmiod/libsrc/modfloatingpointimagepixel.cc create mode 100644 dcmiod/libsrc/modfor.cc create mode 100644 dcmiod/libsrc/modgeneralimage.cc create mode 100644 dcmiod/libsrc/modgeneralseries.cc create mode 100644 dcmiod/libsrc/modgeneralstudy.cc create mode 100644 dcmiod/libsrc/modhelp.cc create mode 100644 dcmiod/libsrc/modimagepixel.cc create mode 100644 dcmiod/libsrc/modimagepixelbase.cc create mode 100644 dcmiod/libsrc/modmultiframedimension.cc create mode 100644 dcmiod/libsrc/modmultiframefg.cc create mode 100644 dcmiod/libsrc/modpatient.cc create mode 100644 dcmiod/libsrc/modpatientstudy.cc create mode 100644 dcmiod/libsrc/modsegmentationseries.cc create mode 100644 dcmiod/libsrc/modsopcommon.cc create mode 100644 dcmiod/libsrc/modsynchronization.cc create mode 100644 dcmiod/libsrc/modusfor.cc create mode 100644 dcmiod/tests/CMakeLists.txt create mode 100644 dcmiod/tests/Makefile.dep create mode 100644 dcmiod/tests/Makefile.in create mode 100644 dcmiod/tests/tcielabutil.cc create mode 100644 dcmiod/tests/tests.cc create mode 100644 dcmiod/tests/timagepixel.cc create mode 100644 dcmjpeg/CMakeLists.txt create mode 100644 dcmjpeg/Makefile.in create mode 100644 dcmjpeg/apps/CMakeLists.txt create mode 100644 dcmjpeg/apps/Makefile.dep create mode 100644 dcmjpeg/apps/Makefile.in create mode 100644 dcmjpeg/apps/dcmcjpeg.cc create mode 100644 dcmjpeg/apps/dcmdjpeg.cc create mode 100644 dcmjpeg/apps/dcmj2pnm.cc create mode 100644 dcmjpeg/apps/dcmmkdir.cc create mode 100755 dcmjpeg/configure create mode 100644 dcmjpeg/data/Makefile.in create mode 100644 dcmjpeg/docs/Makefile.in create mode 100644 dcmjpeg/docs/dcmcjpeg.man create mode 100644 dcmjpeg/docs/dcmdjpeg.man create mode 100644 dcmjpeg/docs/dcmj2pnm.man create mode 100644 dcmjpeg/docs/dcmjpeg.dox create mode 100644 dcmjpeg/docs/dcmmkdir.man create mode 100644 dcmjpeg/docs/ijg_filelist.txt create mode 100644 dcmjpeg/docs/ijg_libjpeg.txt create mode 100644 dcmjpeg/docs/ijg_readme.txt create mode 100644 dcmjpeg/docs/ijg_structure.txt create mode 100644 dcmjpeg/etc/Makefile.in create mode 100644 dcmjpeg/include/CMakeLists.txt create mode 100644 dcmjpeg/include/Makefile.in create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/ddpiimpl.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/dipijpeg.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djcodecd.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djcodece.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdecabs.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdecbas.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdecext.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdeclol.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdecpro.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdecsps.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdecsv1.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdefine.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdijg12.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdijg16.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djdijg8.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djeijg12.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djeijg16.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djeijg8.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djencabs.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djencbas.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djencext.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djenclol.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djencode.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djencpro.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djencsps.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djencsv1.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djrplol.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djrploss.h create mode 100644 dcmjpeg/include/dcmtk/dcmjpeg/djutils.h create mode 100644 dcmjpeg/libijg12/CMakeLists.txt create mode 100644 dcmjpeg/libijg12/Makefile.dep create mode 100644 dcmjpeg/libijg12/Makefile.in create mode 100644 dcmjpeg/libijg12/jaricom.c create mode 100644 dcmjpeg/libijg12/jcapimin.c create mode 100644 dcmjpeg/libijg12/jcapistd.c create mode 100644 dcmjpeg/libijg12/jcarith.c create mode 100644 dcmjpeg/libijg12/jccoefct.c create mode 100644 dcmjpeg/libijg12/jccolor.c create mode 100644 dcmjpeg/libijg12/jcdctmgr.c create mode 100644 dcmjpeg/libijg12/jcdiffct.c create mode 100644 dcmjpeg/libijg12/jchuff.c create mode 100644 dcmjpeg/libijg12/jchuff12.h create mode 100644 dcmjpeg/libijg12/jcinit.c create mode 100644 dcmjpeg/libijg12/jclhuff.c create mode 100644 dcmjpeg/libijg12/jclossls.c create mode 100644 dcmjpeg/libijg12/jclossy.c create mode 100644 dcmjpeg/libijg12/jcmainct.c create mode 100644 dcmjpeg/libijg12/jcmarker.c create mode 100644 dcmjpeg/libijg12/jcmaster.c create mode 100644 dcmjpeg/libijg12/jcodec.c create mode 100644 dcmjpeg/libijg12/jcomapi.c create mode 100644 dcmjpeg/libijg12/jconfig12.h create mode 100644 dcmjpeg/libijg12/jcparam.c create mode 100644 dcmjpeg/libijg12/jcphuff.c create mode 100644 dcmjpeg/libijg12/jcpred.c create mode 100644 dcmjpeg/libijg12/jcprepct.c create mode 100644 dcmjpeg/libijg12/jcsample.c create mode 100644 dcmjpeg/libijg12/jcscale.c create mode 100644 dcmjpeg/libijg12/jcshuff.c create mode 100644 dcmjpeg/libijg12/jctrans.c create mode 100644 dcmjpeg/libijg12/jdapimin.c create mode 100644 dcmjpeg/libijg12/jdapistd.c create mode 100644 dcmjpeg/libijg12/jdarith.c create mode 100644 dcmjpeg/libijg12/jdatadst.c create mode 100644 dcmjpeg/libijg12/jdatasrc.c create mode 100644 dcmjpeg/libijg12/jdcoefct.c create mode 100644 dcmjpeg/libijg12/jdcolor.c create mode 100644 dcmjpeg/libijg12/jdct12.h create mode 100644 dcmjpeg/libijg12/jddctmgr.c create mode 100644 dcmjpeg/libijg12/jddiffct.c create mode 100644 dcmjpeg/libijg12/jdhuff.c create mode 100644 dcmjpeg/libijg12/jdhuff12.h create mode 100644 dcmjpeg/libijg12/jdinput.c create mode 100644 dcmjpeg/libijg12/jdlhuff.c create mode 100644 dcmjpeg/libijg12/jdlossls.c create mode 100644 dcmjpeg/libijg12/jdlossy.c create mode 100644 dcmjpeg/libijg12/jdmainct.c create mode 100644 dcmjpeg/libijg12/jdmarker.c create mode 100644 dcmjpeg/libijg12/jdmaster.c create mode 100644 dcmjpeg/libijg12/jdmerge.c create mode 100644 dcmjpeg/libijg12/jdphuff.c create mode 100644 dcmjpeg/libijg12/jdpostct.c create mode 100644 dcmjpeg/libijg12/jdpred.c create mode 100644 dcmjpeg/libijg12/jdsample.c create mode 100644 dcmjpeg/libijg12/jdscale.c create mode 100644 dcmjpeg/libijg12/jdshuff.c create mode 100644 dcmjpeg/libijg12/jdtrans.c create mode 100644 dcmjpeg/libijg12/jerror.c create mode 100644 dcmjpeg/libijg12/jerror12.h create mode 100644 dcmjpeg/libijg12/jfdctflt.c create mode 100644 dcmjpeg/libijg12/jfdctfst.c create mode 100644 dcmjpeg/libijg12/jfdctint.c create mode 100644 dcmjpeg/libijg12/jidctflt.c create mode 100644 dcmjpeg/libijg12/jidctfst.c create mode 100644 dcmjpeg/libijg12/jidctint.c create mode 100644 dcmjpeg/libijg12/jidctred.c create mode 100644 dcmjpeg/libijg12/jinclude12.h create mode 100644 dcmjpeg/libijg12/jlossls12.h create mode 100644 dcmjpeg/libijg12/jlossy12.h create mode 100644 dcmjpeg/libijg12/jmemmgr.c create mode 100644 dcmjpeg/libijg12/jmemnobs.c create mode 100644 dcmjpeg/libijg12/jmemsys12.h create mode 100644 dcmjpeg/libijg12/jmorecfg12.h create mode 100644 dcmjpeg/libijg12/jpegint12.h create mode 100644 dcmjpeg/libijg12/jpeglib12.h create mode 100644 dcmjpeg/libijg12/jquant1.c create mode 100644 dcmjpeg/libijg12/jquant2.c create mode 100644 dcmjpeg/libijg12/jutils.c create mode 100644 dcmjpeg/libijg12/jversion12.h create mode 100644 dcmjpeg/libijg16/CMakeLists.txt create mode 100644 dcmjpeg/libijg16/Makefile.dep create mode 100644 dcmjpeg/libijg16/Makefile.in create mode 100644 dcmjpeg/libijg16/jaricom.c create mode 100644 dcmjpeg/libijg16/jcapimin.c create mode 100644 dcmjpeg/libijg16/jcapistd.c create mode 100644 dcmjpeg/libijg16/jcarith.c create mode 100644 dcmjpeg/libijg16/jccoefct.c create mode 100644 dcmjpeg/libijg16/jccolor.c create mode 100644 dcmjpeg/libijg16/jcdctmgr.c create mode 100644 dcmjpeg/libijg16/jcdiffct.c create mode 100644 dcmjpeg/libijg16/jchuff.c create mode 100644 dcmjpeg/libijg16/jchuff16.h create mode 100644 dcmjpeg/libijg16/jcinit.c create mode 100644 dcmjpeg/libijg16/jclhuff.c create mode 100644 dcmjpeg/libijg16/jclossls.c create mode 100644 dcmjpeg/libijg16/jclossy.c create mode 100644 dcmjpeg/libijg16/jcmainct.c create mode 100644 dcmjpeg/libijg16/jcmarker.c create mode 100644 dcmjpeg/libijg16/jcmaster.c create mode 100644 dcmjpeg/libijg16/jcodec.c create mode 100644 dcmjpeg/libijg16/jcomapi.c create mode 100644 dcmjpeg/libijg16/jconfig16.h create mode 100644 dcmjpeg/libijg16/jcparam.c create mode 100644 dcmjpeg/libijg16/jcphuff.c create mode 100644 dcmjpeg/libijg16/jcpred.c create mode 100644 dcmjpeg/libijg16/jcprepct.c create mode 100644 dcmjpeg/libijg16/jcsample.c create mode 100644 dcmjpeg/libijg16/jcscale.c create mode 100644 dcmjpeg/libijg16/jcshuff.c create mode 100644 dcmjpeg/libijg16/jctrans.c create mode 100644 dcmjpeg/libijg16/jdapimin.c create mode 100644 dcmjpeg/libijg16/jdapistd.c create mode 100644 dcmjpeg/libijg16/jdarith.c create mode 100644 dcmjpeg/libijg16/jdatadst.c create mode 100644 dcmjpeg/libijg16/jdatasrc.c create mode 100644 dcmjpeg/libijg16/jdcoefct.c create mode 100644 dcmjpeg/libijg16/jdcolor.c create mode 100644 dcmjpeg/libijg16/jdct16.h create mode 100644 dcmjpeg/libijg16/jddctmgr.c create mode 100644 dcmjpeg/libijg16/jddiffct.c create mode 100644 dcmjpeg/libijg16/jdhuff.c create mode 100644 dcmjpeg/libijg16/jdhuff16.h create mode 100644 dcmjpeg/libijg16/jdinput.c create mode 100644 dcmjpeg/libijg16/jdlhuff.c create mode 100644 dcmjpeg/libijg16/jdlossls.c create mode 100644 dcmjpeg/libijg16/jdlossy.c create mode 100644 dcmjpeg/libijg16/jdmainct.c create mode 100644 dcmjpeg/libijg16/jdmarker.c create mode 100644 dcmjpeg/libijg16/jdmaster.c create mode 100644 dcmjpeg/libijg16/jdmerge.c create mode 100644 dcmjpeg/libijg16/jdphuff.c create mode 100644 dcmjpeg/libijg16/jdpostct.c create mode 100644 dcmjpeg/libijg16/jdpred.c create mode 100644 dcmjpeg/libijg16/jdsample.c create mode 100644 dcmjpeg/libijg16/jdscale.c create mode 100644 dcmjpeg/libijg16/jdshuff.c create mode 100644 dcmjpeg/libijg16/jdtrans.c create mode 100644 dcmjpeg/libijg16/jerror.c create mode 100644 dcmjpeg/libijg16/jerror16.h create mode 100644 dcmjpeg/libijg16/jfdctflt.c create mode 100644 dcmjpeg/libijg16/jfdctfst.c create mode 100644 dcmjpeg/libijg16/jfdctint.c create mode 100644 dcmjpeg/libijg16/jidctflt.c create mode 100644 dcmjpeg/libijg16/jidctfst.c create mode 100644 dcmjpeg/libijg16/jidctint.c create mode 100644 dcmjpeg/libijg16/jidctred.c create mode 100644 dcmjpeg/libijg16/jinclude16.h create mode 100644 dcmjpeg/libijg16/jlossls16.h create mode 100644 dcmjpeg/libijg16/jlossy16.h create mode 100644 dcmjpeg/libijg16/jmemmgr.c create mode 100644 dcmjpeg/libijg16/jmemnobs.c create mode 100644 dcmjpeg/libijg16/jmemsys16.h create mode 100644 dcmjpeg/libijg16/jmorecfg16.h create mode 100644 dcmjpeg/libijg16/jpegint16.h create mode 100644 dcmjpeg/libijg16/jpeglib16.h create mode 100644 dcmjpeg/libijg16/jquant1.c create mode 100644 dcmjpeg/libijg16/jquant2.c create mode 100644 dcmjpeg/libijg16/jutils.c create mode 100644 dcmjpeg/libijg16/jversion16.h create mode 100644 dcmjpeg/libijg8/CMakeLists.txt create mode 100644 dcmjpeg/libijg8/Makefile.dep create mode 100644 dcmjpeg/libijg8/Makefile.in create mode 100644 dcmjpeg/libijg8/jaricom.c create mode 100644 dcmjpeg/libijg8/jcapimin.c create mode 100644 dcmjpeg/libijg8/jcapistd.c create mode 100644 dcmjpeg/libijg8/jcarith.c create mode 100644 dcmjpeg/libijg8/jccoefct.c create mode 100644 dcmjpeg/libijg8/jccolor.c create mode 100644 dcmjpeg/libijg8/jcdctmgr.c create mode 100644 dcmjpeg/libijg8/jcdiffct.c create mode 100644 dcmjpeg/libijg8/jchuff.c create mode 100644 dcmjpeg/libijg8/jchuff8.h create mode 100644 dcmjpeg/libijg8/jcinit.c create mode 100644 dcmjpeg/libijg8/jclhuff.c create mode 100644 dcmjpeg/libijg8/jclossls.c create mode 100644 dcmjpeg/libijg8/jclossy.c create mode 100644 dcmjpeg/libijg8/jcmainct.c create mode 100644 dcmjpeg/libijg8/jcmarker.c create mode 100644 dcmjpeg/libijg8/jcmaster.c create mode 100644 dcmjpeg/libijg8/jcodec.c create mode 100644 dcmjpeg/libijg8/jcomapi.c create mode 100644 dcmjpeg/libijg8/jconfig8.h create mode 100644 dcmjpeg/libijg8/jcparam.c create mode 100644 dcmjpeg/libijg8/jcphuff.c create mode 100644 dcmjpeg/libijg8/jcpred.c create mode 100644 dcmjpeg/libijg8/jcprepct.c create mode 100644 dcmjpeg/libijg8/jcsample.c create mode 100644 dcmjpeg/libijg8/jcscale.c create mode 100644 dcmjpeg/libijg8/jcshuff.c create mode 100644 dcmjpeg/libijg8/jctrans.c create mode 100644 dcmjpeg/libijg8/jdapimin.c create mode 100644 dcmjpeg/libijg8/jdapistd.c create mode 100644 dcmjpeg/libijg8/jdarith.c create mode 100644 dcmjpeg/libijg8/jdatadst.c create mode 100644 dcmjpeg/libijg8/jdatasrc.c create mode 100644 dcmjpeg/libijg8/jdcoefct.c create mode 100644 dcmjpeg/libijg8/jdcolor.c create mode 100644 dcmjpeg/libijg8/jdct8.h create mode 100644 dcmjpeg/libijg8/jddctmgr.c create mode 100644 dcmjpeg/libijg8/jddiffct.c create mode 100644 dcmjpeg/libijg8/jdhuff.c create mode 100644 dcmjpeg/libijg8/jdhuff8.h create mode 100644 dcmjpeg/libijg8/jdinput.c create mode 100644 dcmjpeg/libijg8/jdlhuff.c create mode 100644 dcmjpeg/libijg8/jdlossls.c create mode 100644 dcmjpeg/libijg8/jdlossy.c create mode 100644 dcmjpeg/libijg8/jdmainct.c create mode 100644 dcmjpeg/libijg8/jdmarker.c create mode 100644 dcmjpeg/libijg8/jdmaster.c create mode 100644 dcmjpeg/libijg8/jdmerge.c create mode 100644 dcmjpeg/libijg8/jdphuff.c create mode 100644 dcmjpeg/libijg8/jdpostct.c create mode 100644 dcmjpeg/libijg8/jdpred.c create mode 100644 dcmjpeg/libijg8/jdsample.c create mode 100644 dcmjpeg/libijg8/jdscale.c create mode 100644 dcmjpeg/libijg8/jdshuff.c create mode 100644 dcmjpeg/libijg8/jdtrans.c create mode 100644 dcmjpeg/libijg8/jerror.c create mode 100644 dcmjpeg/libijg8/jerror8.h create mode 100644 dcmjpeg/libijg8/jfdctflt.c create mode 100644 dcmjpeg/libijg8/jfdctfst.c create mode 100644 dcmjpeg/libijg8/jfdctint.c create mode 100644 dcmjpeg/libijg8/jidctflt.c create mode 100644 dcmjpeg/libijg8/jidctfst.c create mode 100644 dcmjpeg/libijg8/jidctint.c create mode 100644 dcmjpeg/libijg8/jidctred.c create mode 100644 dcmjpeg/libijg8/jinclude8.h create mode 100644 dcmjpeg/libijg8/jlossls8.h create mode 100644 dcmjpeg/libijg8/jlossy8.h create mode 100644 dcmjpeg/libijg8/jmemmgr.c create mode 100644 dcmjpeg/libijg8/jmemnobs.c create mode 100644 dcmjpeg/libijg8/jmemsys8.h create mode 100644 dcmjpeg/libijg8/jmorecfg8.h create mode 100644 dcmjpeg/libijg8/jpegint8.h create mode 100644 dcmjpeg/libijg8/jpeglib8.h create mode 100644 dcmjpeg/libijg8/jquant1.c create mode 100644 dcmjpeg/libijg8/jquant2.c create mode 100644 dcmjpeg/libijg8/jutils.c create mode 100644 dcmjpeg/libijg8/jversion8.h create mode 100644 dcmjpeg/libsrc/CMakeLists.txt create mode 100644 dcmjpeg/libsrc/Makefile.dep create mode 100644 dcmjpeg/libsrc/Makefile.in create mode 100644 dcmjpeg/libsrc/ddpiimpl.cc create mode 100644 dcmjpeg/libsrc/dipijpeg.cc create mode 100644 dcmjpeg/libsrc/djcodecd.cc create mode 100644 dcmjpeg/libsrc/djcodece.cc create mode 100644 dcmjpeg/libsrc/djcparam.cc create mode 100644 dcmjpeg/libsrc/djdecbas.cc create mode 100644 dcmjpeg/libsrc/djdecext.cc create mode 100644 dcmjpeg/libsrc/djdeclol.cc create mode 100644 dcmjpeg/libsrc/djdecode.cc create mode 100644 dcmjpeg/libsrc/djdecpro.cc create mode 100644 dcmjpeg/libsrc/djdecsps.cc create mode 100644 dcmjpeg/libsrc/djdecsv1.cc create mode 100644 dcmjpeg/libsrc/djdijg12.cc create mode 100644 dcmjpeg/libsrc/djdijg16.cc create mode 100644 dcmjpeg/libsrc/djdijg8.cc create mode 100644 dcmjpeg/libsrc/djeijg12.cc create mode 100644 dcmjpeg/libsrc/djeijg16.cc create mode 100644 dcmjpeg/libsrc/djeijg8.cc create mode 100644 dcmjpeg/libsrc/djencbas.cc create mode 100644 dcmjpeg/libsrc/djencext.cc create mode 100644 dcmjpeg/libsrc/djenclol.cc create mode 100644 dcmjpeg/libsrc/djencode.cc create mode 100644 dcmjpeg/libsrc/djencpro.cc create mode 100644 dcmjpeg/libsrc/djencsps.cc create mode 100644 dcmjpeg/libsrc/djencsv1.cc create mode 100644 dcmjpeg/libsrc/djrplol.cc create mode 100644 dcmjpeg/libsrc/djrploss.cc create mode 100644 dcmjpeg/libsrc/djutils.cc create mode 100644 dcmjpeg/tests/Makefile.in create mode 100644 dcmjpls/CMakeLists.txt create mode 100644 dcmjpls/Makefile.in create mode 100644 dcmjpls/apps/CMakeLists.txt create mode 100644 dcmjpls/apps/Makefile.dep create mode 100644 dcmjpls/apps/Makefile.in create mode 100644 dcmjpls/apps/dcmcjpls.cc create mode 100644 dcmjpls/apps/dcmdjpls.cc create mode 100644 dcmjpls/apps/dcml2pnm.cc create mode 100755 dcmjpls/configure create mode 100644 dcmjpls/data/Makefile.in create mode 100644 dcmjpls/docs/License.txt create mode 100644 dcmjpls/docs/Makefile.in create mode 100644 dcmjpls/docs/dcmcjpls.man create mode 100644 dcmjpls/docs/dcmdjpls.man create mode 100644 dcmjpls/docs/dcmjpls.dox create mode 100644 dcmjpls/docs/dcml2pnm.man create mode 100644 dcmjpls/docs/readme.txt create mode 100644 dcmjpls/etc/Makefile.in create mode 100644 dcmjpls/include/CMakeLists.txt create mode 100644 dcmjpls/include/Makefile.in create mode 100644 dcmjpls/include/dcmtk/dcmjpls/djcodecd.h create mode 100644 dcmjpls/include/dcmtk/dcmjpls/djcodece.h create mode 100644 dcmjpls/include/dcmtk/dcmjpls/djcparam.h create mode 100644 dcmjpls/include/dcmtk/dcmjpls/djdecode.h create mode 100644 dcmjpls/include/dcmtk/dcmjpls/djencode.h create mode 100644 dcmjpls/include/dcmtk/dcmjpls/djlsutil.h create mode 100644 dcmjpls/include/dcmtk/dcmjpls/djrparam.h create mode 100644 dcmjpls/include/dcmtk/dcmjpls/dldefine.h create mode 100644 dcmjpls/libcharls/CMakeLists.txt create mode 100644 dcmjpls/libcharls/Makefile.dep create mode 100644 dcmjpls/libcharls/Makefile.in create mode 100644 dcmjpls/libcharls/clrtrans.h create mode 100644 dcmjpls/libcharls/config.h create mode 100644 dcmjpls/libcharls/context.h create mode 100644 dcmjpls/libcharls/ctxtrmod.h create mode 100644 dcmjpls/libcharls/decodstr.h create mode 100644 dcmjpls/libcharls/deftrait.h create mode 100644 dcmjpls/libcharls/encodstr.h create mode 100644 dcmjpls/libcharls/header.cc create mode 100644 dcmjpls/libcharls/header.h create mode 100644 dcmjpls/libcharls/intrface.cc create mode 100644 dcmjpls/libcharls/intrface.h create mode 100644 dcmjpls/libcharls/jpegls.cc create mode 100644 dcmjpls/libcharls/lltraits.h create mode 100644 dcmjpls/libcharls/lokuptbl.h create mode 100644 dcmjpls/libcharls/procline.h create mode 100644 dcmjpls/libcharls/pubtypes.h create mode 100644 dcmjpls/libcharls/scan.h create mode 100644 dcmjpls/libcharls/streams.h create mode 100644 dcmjpls/libcharls/util.h create mode 100644 dcmjpls/libsrc/CMakeLists.txt create mode 100644 dcmjpls/libsrc/Makefile.dep create mode 100644 dcmjpls/libsrc/Makefile.in create mode 100644 dcmjpls/libsrc/djcodecd.cc create mode 100644 dcmjpls/libsrc/djcodece.cc create mode 100644 dcmjpls/libsrc/djcparam.cc create mode 100644 dcmjpls/libsrc/djdecode.cc create mode 100644 dcmjpls/libsrc/djencode.cc create mode 100644 dcmjpls/libsrc/djerror.h create mode 100644 dcmjpls/libsrc/djrparam.cc create mode 100644 dcmjpls/libsrc/djutils.cc create mode 100644 dcmjpls/tests/Makefile.in create mode 100644 dcmnet/CMakeLists.txt create mode 100644 dcmnet/Makefile.in create mode 100644 dcmnet/apps/CMakeLists.txt create mode 100644 dcmnet/apps/Makefile.dep create mode 100644 dcmnet/apps/Makefile.in create mode 100644 dcmnet/apps/dcmrecv.cc create mode 100644 dcmnet/apps/dcmsend.cc create mode 100644 dcmnet/apps/echoscu.cc create mode 100644 dcmnet/apps/findscu.cc create mode 100644 dcmnet/apps/getscu.cc create mode 100644 dcmnet/apps/movescu.cc create mode 100644 dcmnet/apps/storescp.cc create mode 100644 dcmnet/apps/storescu.cc create mode 100644 dcmnet/apps/termscu.cc create mode 100755 dcmnet/configure create mode 100644 dcmnet/data/Makefile.in create mode 100644 dcmnet/docs/CMakeLists.txt create mode 100644 dcmnet/docs/Makefile.in create mode 100644 dcmnet/docs/asconfig.txt create mode 100644 dcmnet/docs/cptscp.dox create mode 100644 dcmnet/docs/dcmnet.dox create mode 100644 dcmnet/docs/dcmrecv.man create mode 100644 dcmnet/docs/dcmsend.man create mode 100644 dcmnet/docs/echoscu.man create mode 100644 dcmnet/docs/findscu.man create mode 100644 dcmnet/docs/getscu.man create mode 100644 dcmnet/docs/movescu.man create mode 100644 dcmnet/docs/storescp.man create mode 100644 dcmnet/docs/storescu.man create mode 100644 dcmnet/docs/termscu.man create mode 100644 dcmnet/docs/testing.txt create mode 100644 dcmnet/etc/CMakeLists.txt create mode 100644 dcmnet/etc/Makefile.in create mode 100644 dcmnet/etc/storescp.cfg create mode 100644 dcmnet/etc/storescu.cfg create mode 100644 dcmnet/include/CMakeLists.txt create mode 100644 dcmnet/include/Makefile.in create mode 100644 dcmnet/include/dcmtk/dcmnet/assoc.h create mode 100644 dcmnet/include/dcmtk/dcmnet/cond.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dcasccff.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dcasccfg.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dccfenmp.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dccfpcmp.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dccfprmp.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dccfrsmp.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dccftsmp.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dccfuidh.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dcmlayer.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dcmsmap.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dcmtrans.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dcompat.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dcuserid.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dfindscu.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dicom.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dimse.h create mode 100644 dcmnet/include/dcmtk/dcmnet/diutil.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dndefine.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dntypes.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dstorscp.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dstorscu.h create mode 100644 dcmnet/include/dcmtk/dcmnet/dul.h create mode 100644 dcmnet/include/dcmtk/dcmnet/extneg.h create mode 100644 dcmnet/include/dcmtk/dcmnet/lst.h create mode 100644 dcmnet/include/dcmtk/dcmnet/scp.h create mode 100644 dcmnet/include/dcmtk/dcmnet/scpcfg.h create mode 100644 dcmnet/include/dcmtk/dcmnet/scppool.h create mode 100644 dcmnet/include/dcmtk/dcmnet/scpthrd.h create mode 100644 dcmnet/include/dcmtk/dcmnet/scu.h create mode 100644 dcmnet/libsrc/CMakeLists.txt create mode 100644 dcmnet/libsrc/Makefile.dep create mode 100644 dcmnet/libsrc/Makefile.in create mode 100644 dcmnet/libsrc/assoc.cc create mode 100644 dcmnet/libsrc/cond.cc create mode 100644 dcmnet/libsrc/dcasccff.cc create mode 100644 dcmnet/libsrc/dcasccfg.cc create mode 100644 dcmnet/libsrc/dccfenmp.cc create mode 100644 dcmnet/libsrc/dccfpcmp.cc create mode 100644 dcmnet/libsrc/dccfprmp.cc create mode 100644 dcmnet/libsrc/dccfrsmp.cc create mode 100644 dcmnet/libsrc/dccftsmp.cc create mode 100644 dcmnet/libsrc/dccfuidh.cc create mode 100644 dcmnet/libsrc/dcmlayer.cc create mode 100644 dcmnet/libsrc/dcmtrans.cc create mode 100644 dcmnet/libsrc/dcompat.cc create mode 100644 dcmnet/libsrc/dcuserid.cc create mode 100644 dcmnet/libsrc/dfindscu.cc create mode 100644 dcmnet/libsrc/dimcancl.cc create mode 100644 dcmnet/libsrc/dimcmd.cc create mode 100644 dcmnet/libsrc/dimcmd.h create mode 100644 dcmnet/libsrc/dimdump.cc create mode 100644 dcmnet/libsrc/dimecho.cc create mode 100644 dcmnet/libsrc/dimfind.cc create mode 100644 dcmnet/libsrc/dimget.cc create mode 100644 dcmnet/libsrc/dimmove.cc create mode 100644 dcmnet/libsrc/dimse.cc create mode 100644 dcmnet/libsrc/dimstore.cc create mode 100644 dcmnet/libsrc/diutil.cc create mode 100644 dcmnet/libsrc/dstorscp.cc create mode 100644 dcmnet/libsrc/dstorscu.cc create mode 100644 dcmnet/libsrc/dul.cc create mode 100644 dcmnet/libsrc/dulconst.cc create mode 100644 dcmnet/libsrc/dulextra.cc create mode 100644 dcmnet/libsrc/dulfsm.cc create mode 100644 dcmnet/libsrc/dulfsm.h create mode 100644 dcmnet/libsrc/dulparse.cc create mode 100644 dcmnet/libsrc/dulpres.cc create mode 100644 dcmnet/libsrc/dulpriv.h create mode 100644 dcmnet/libsrc/dulstruc.h create mode 100644 dcmnet/libsrc/dwrap.c create mode 100644 dcmnet/libsrc/extneg.cc create mode 100644 dcmnet/libsrc/lst.cc create mode 100644 dcmnet/libsrc/scp.cc create mode 100644 dcmnet/libsrc/scpcfg.cc create mode 100644 dcmnet/libsrc/scppool.cc create mode 100644 dcmnet/libsrc/scpthrd.cc create mode 100644 dcmnet/libsrc/scu.cc create mode 100644 dcmnet/tests/CMakeLists.txt create mode 100644 dcmnet/tests/Makefile.dep create mode 100644 dcmnet/tests/Makefile.in create mode 100644 dcmnet/tests/tdump.cc create mode 100644 dcmnet/tests/tests.cc create mode 100644 dcmnet/tests/tpool.cc create mode 100644 dcmnet/tests/tscuscp.cc create mode 100644 dcmpmap/CMakeLists.txt create mode 100644 dcmpmap/Makefile.in create mode 100755 dcmpmap/configure create mode 100644 dcmpmap/data/Makefile.in create mode 100644 dcmpmap/docs/Makefile.in create mode 100644 dcmpmap/docs/dcmpmap.dox create mode 100644 dcmpmap/etc/Makefile.in create mode 100644 dcmpmap/include/CMakeLists.txt create mode 100644 dcmpmap/include/Makefile.in create mode 100644 dcmpmap/include/dcmtk/dcmpmap/dpmdef.h create mode 100644 dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapimage.h create mode 100644 dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapseries.h create mode 100644 dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapbase.h create mode 100644 dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapiod.h create mode 100644 dcmpmap/include/dcmtk/dcmpmap/dpmtypes.h create mode 100644 dcmpmap/libsrc/CMakeLists.txt create mode 100644 dcmpmap/libsrc/Makefile.dep create mode 100644 dcmpmap/libsrc/Makefile.in create mode 100644 dcmpmap/libsrc/dpmmodparametricmapimage.cc create mode 100644 dcmpmap/libsrc/dpmmodparametricmapseries.cc create mode 100644 dcmpmap/libsrc/dpmparametricmapbase.cc create mode 100644 dcmpmap/libsrc/dpmparametricmapiod.cc create mode 100644 dcmpmap/libsrc/dpmtypes.cc create mode 100644 dcmpmap/tests/Makefile.in create mode 100644 dcmpstat/CMakeLists.txt create mode 100644 dcmpstat/Makefile.in create mode 100644 dcmpstat/apps/CMakeLists.txt create mode 100644 dcmpstat/apps/Makefile.dep create mode 100644 dcmpstat/apps/Makefile.in create mode 100644 dcmpstat/apps/dcmmkcrv.cc create mode 100644 dcmpstat/apps/dcmmklut.cc create mode 100644 dcmpstat/apps/dcmp2pgm.cc create mode 100644 dcmpstat/apps/dcmprscp.cc create mode 100644 dcmpstat/apps/dcmprscu.cc create mode 100644 dcmpstat/apps/dcmpschk.cc create mode 100644 dcmpstat/apps/dcmpsmk.cc create mode 100644 dcmpstat/apps/dcmpsprt.cc create mode 100644 dcmpstat/apps/dcmpsrcv.cc create mode 100644 dcmpstat/apps/dcmpssnd.cc create mode 100755 dcmpstat/configure create mode 100644 dcmpstat/data/CMakeLists.txt create mode 100644 dcmpstat/data/Makefile.in create mode 100644 dcmpstat/data/philips.lut create mode 100644 dcmpstat/docs/Makefile.in create mode 100644 dcmpstat/docs/dcmmkcrv.man create mode 100644 dcmpstat/docs/dcmmklut.man create mode 100644 dcmpstat/docs/dcmp2pgm.man create mode 100644 dcmpstat/docs/dcmprscp.man create mode 100644 dcmpstat/docs/dcmprscu.man create mode 100644 dcmpstat/docs/dcmpschk.man create mode 100644 dcmpstat/docs/dcmpsmk.man create mode 100644 dcmpstat/docs/dcmpsprt.man create mode 100644 dcmpstat/docs/dcmpsrcv.man create mode 100644 dcmpstat/docs/dcmpssnd.man create mode 100644 dcmpstat/docs/dcmpstat.dox create mode 100644 dcmpstat/etc/CMakeLists.txt create mode 100644 dcmpstat/etc/Makefile.in create mode 100644 dcmpstat/etc/dcmpstat.cfg create mode 100644 dcmpstat/etc/printers.cfg create mode 100644 dcmpstat/include/CMakeLists.txt create mode 100644 dcmpstat/include/Makefile.in create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dcmpstat.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dpdefine.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvcache.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dviface.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsab.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsabl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsal.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsall.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpscf.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpscu.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpscul.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsda.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsdal.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsdef.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsfs.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsga.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsgal.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsgl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsgll.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsgr.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsgrl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpshlp.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsib.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsibl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsmsg.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsov.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsovl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpspl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpspll.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpspr.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsprt.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsri.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsril.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsrs.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsrsl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpssp.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsspl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpssv.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpssvl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpstat.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpstx.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpstxl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpstyp.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsvl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsvll.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsvw.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvpsvwl.h create mode 100644 dcmpstat/include/dcmtk/dcmpstat/dvsighdl.h create mode 100644 dcmpstat/jni/Makefile.dep create mode 100644 dcmpstat/jni/Makefile.in create mode 100755 dcmpstat/jni/make_stub.sh create mode 100644 dcmpstat/libsrc/CMakeLists.txt create mode 100644 dcmpstat/libsrc/Makefile.dep create mode 100644 dcmpstat/libsrc/Makefile.in create mode 100644 dcmpstat/libsrc/dcmpstat.cc create mode 100644 dcmpstat/libsrc/dviface.cc create mode 100644 dcmpstat/libsrc/dvpsab.cc create mode 100644 dcmpstat/libsrc/dvpsabl.cc create mode 100644 dcmpstat/libsrc/dvpsal.cc create mode 100644 dcmpstat/libsrc/dvpsall.cc create mode 100644 dcmpstat/libsrc/dvpscf.cc create mode 100644 dcmpstat/libsrc/dvpscu.cc create mode 100644 dcmpstat/libsrc/dvpscul.cc create mode 100644 dcmpstat/libsrc/dvpsda.cc create mode 100644 dcmpstat/libsrc/dvpsdal.cc create mode 100644 dcmpstat/libsrc/dvpsfs.cc create mode 100644 dcmpstat/libsrc/dvpsga.cc create mode 100644 dcmpstat/libsrc/dvpsgal.cc create mode 100644 dcmpstat/libsrc/dvpsgl.cc create mode 100644 dcmpstat/libsrc/dvpsgll.cc create mode 100644 dcmpstat/libsrc/dvpsgr.cc create mode 100644 dcmpstat/libsrc/dvpsgrl.cc create mode 100644 dcmpstat/libsrc/dvpshlp.cc create mode 100644 dcmpstat/libsrc/dvpsib.cc create mode 100644 dcmpstat/libsrc/dvpsibl.cc create mode 100644 dcmpstat/libsrc/dvpsmsg.cc create mode 100644 dcmpstat/libsrc/dvpsov.cc create mode 100644 dcmpstat/libsrc/dvpsovl.cc create mode 100644 dcmpstat/libsrc/dvpspl.cc create mode 100644 dcmpstat/libsrc/dvpspl2.cc create mode 100644 dcmpstat/libsrc/dvpspll.cc create mode 100644 dcmpstat/libsrc/dvpspr.cc create mode 100644 dcmpstat/libsrc/dvpsprt.cc create mode 100644 dcmpstat/libsrc/dvpsri.cc create mode 100644 dcmpstat/libsrc/dvpsril.cc create mode 100644 dcmpstat/libsrc/dvpsrs.cc create mode 100644 dcmpstat/libsrc/dvpsrsl.cc create mode 100644 dcmpstat/libsrc/dvpssp.cc create mode 100644 dcmpstat/libsrc/dvpsspl.cc create mode 100644 dcmpstat/libsrc/dvpssv.cc create mode 100644 dcmpstat/libsrc/dvpssvl.cc create mode 100644 dcmpstat/libsrc/dvpstat.cc create mode 100644 dcmpstat/libsrc/dvpstx.cc create mode 100644 dcmpstat/libsrc/dvpstxl.cc create mode 100644 dcmpstat/libsrc/dvpsvl.cc create mode 100644 dcmpstat/libsrc/dvpsvll.cc create mode 100644 dcmpstat/libsrc/dvpsvw.cc create mode 100644 dcmpstat/libsrc/dvpsvwl.cc create mode 100644 dcmpstat/libsrc/dvsighdl.cc create mode 100644 dcmpstat/tests/CMakeLists.txt create mode 100644 dcmpstat/tests/Makefile.dep create mode 100644 dcmpstat/tests/Makefile.in create mode 100644 dcmpstat/tests/dcmpschk.tcl create mode 100755 dcmpstat/tests/dcmpsprt.pl create mode 100644 dcmpstat/tests/msgserv.cc create mode 100644 dcmqrdb/CMakeLists.txt create mode 100644 dcmqrdb/Makefile.in create mode 100644 dcmqrdb/apps/CMakeLists.txt create mode 100644 dcmqrdb/apps/Makefile.dep create mode 100644 dcmqrdb/apps/Makefile.in create mode 100644 dcmqrdb/apps/dcmqridx.cc create mode 100644 dcmqrdb/apps/dcmqrscp.cc create mode 100644 dcmqrdb/apps/dcmqrti.cc create mode 100755 dcmqrdb/configure create mode 100644 dcmqrdb/data/Makefile.in create mode 100644 dcmqrdb/docs/CMakeLists.txt create mode 100644 dcmqrdb/docs/Makefile.in create mode 100644 dcmqrdb/docs/dcmqrcnf.txt create mode 100644 dcmqrdb/docs/dcmqrdb.dox create mode 100644 dcmqrdb/docs/dcmqridx.man create mode 100644 dcmqrdb/docs/dcmqrscp.man create mode 100644 dcmqrdb/docs/dcmqrset.txt create mode 100644 dcmqrdb/docs/dcmqrti.man create mode 100644 dcmqrdb/etc/CMakeLists.txt create mode 100644 dcmqrdb/etc/Makefile.in create mode 100644 dcmqrdb/etc/dcmqrprf.cfg create mode 100644 dcmqrdb/etc/dcmqrscp.cfg create mode 100644 dcmqrdb/include/CMakeLists.txt create mode 100644 dcmqrdb/include/Makefile.in create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbf.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbg.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbs.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcnf.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqropt.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrptb.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrsrv.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/dcmqrtis.h create mode 100644 dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h create mode 100644 dcmqrdb/libsrc/CMakeLists.txt create mode 100644 dcmqrdb/libsrc/Makefile.dep create mode 100644 dcmqrdb/libsrc/Makefile.in create mode 100644 dcmqrdb/libsrc/dcmqrcbf.cc create mode 100644 dcmqrdb/libsrc/dcmqrcbg.cc create mode 100644 dcmqrdb/libsrc/dcmqrcbm.cc create mode 100644 dcmqrdb/libsrc/dcmqrcbs.cc create mode 100644 dcmqrdb/libsrc/dcmqrcnf.cc create mode 100644 dcmqrdb/libsrc/dcmqrdbi.cc create mode 100644 dcmqrdb/libsrc/dcmqrdbs.cc create mode 100644 dcmqrdb/libsrc/dcmqropt.cc create mode 100644 dcmqrdb/libsrc/dcmqrptb.cc create mode 100644 dcmqrdb/libsrc/dcmqrsrv.cc create mode 100644 dcmqrdb/libsrc/dcmqrtis.cc create mode 100644 dcmqrdb/tests/Makefile.in create mode 100644 dcmrt/CHANGES create mode 100644 dcmrt/CMakeLists.txt create mode 100644 dcmrt/Makefile.in create mode 100644 dcmrt/apps/CMakeLists.txt create mode 100644 dcmrt/apps/Makefile.dep create mode 100644 dcmrt/apps/Makefile.in create mode 100644 dcmrt/apps/drtdump.cc create mode 100755 dcmrt/configure create mode 100644 dcmrt/docs/Makefile.in create mode 100644 dcmrt/docs/dcmrt.dox create mode 100644 dcmrt/docs/drtdump.man create mode 100644 dcmrt/include/CMakeLists.txt create mode 100644 dcmrt/include/Makefile.in create mode 100644 dcmrt/include/dcmtk/dcmrt/drmdose.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drmimage.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drmplan.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drmsrch.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drmstrct.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drtdose.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drtimage.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drtionpl.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drtiontr.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drtplan.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drtstrct.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drttreat.h create mode 100644 dcmrt/include/dcmtk/dcmrt/drttypes.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtaadcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtadcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtads.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtafs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtags.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtajcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtas1.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtas5.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtas6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtas7.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtass.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbads.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbas.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbcps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbl2.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbl5.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbldls.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbldps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtblds1.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtblds5.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtblds6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbldts.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbrcss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbrdrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtbvcps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcbars.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtccs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcctus.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcdrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtces.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcgis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtchs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcims.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcncs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcos.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcpas.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcpis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcsas.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcshs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcsis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcsrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtcss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdddps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtddps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdias.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdimcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdimrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdirs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdspcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdvhs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtdvrrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drteas.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtecs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtes.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtfds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtfes.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtfgs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtfgss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtfms.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtfsss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtgas.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtgmcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtgms.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtgpis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drthsdrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtiais.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtians.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtiblds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtibls.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtibs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drticpds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drticps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtics.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtiis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtipiqs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtircs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtiseis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtitts.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtiwps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtiws.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtlsds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtlsds6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtlsds7.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmacds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmas.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmdrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmls.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmris.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtmucs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtoas.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtois.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtopis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtos.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpbcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpcxs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpdecs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpdeds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpfms.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpics.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtporcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtporis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtppcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtprsis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpscs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpsics.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpsss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtpvis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtqds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtras.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbas2.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbas8.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbls.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbos1.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbos6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbos7.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbs2.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbs4.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrbs8.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrcdrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrcos.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrcps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrdros.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrdrs1.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrdrs6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrdrs8.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrecs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrfgs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrfors.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrics.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrims.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtris.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrlsds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrmdrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrms.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrmss6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrmss7.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrpcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrpis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrppcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrpphs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrpps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrppss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrris1.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrris6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrris9.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrms.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrros.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrpcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrros.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrshs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrtps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrtps3.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrtps4.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrrtps5.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrscs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrsers.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrses.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrshs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrshs6.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrshs7.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrsis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrsns.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrsos.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrsrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrsss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrsts.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrtrs2.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrtrs4.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrvis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrws.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtrwvms.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtscris.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtscs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtsdcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtsds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtshds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtsins.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtsis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtsns.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtspccs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtspcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtspgis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtsptcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtssrcs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtssrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtsss.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drttms0.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drttms9.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drttscds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drttsibs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drttsmds.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drttts.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtudis.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtvls.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtwps.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtwrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtwrsrs.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtws.h create mode 100644 dcmrt/include/dcmtk/dcmrt/seq/drtxrs.h create mode 100644 dcmrt/libsrc/CMakeLists.txt create mode 100644 dcmrt/libsrc/Makefile.dep create mode 100644 dcmrt/libsrc/Makefile.in create mode 100644 dcmrt/libsrc/drmdose.cc create mode 100644 dcmrt/libsrc/drmimage.cc create mode 100644 dcmrt/libsrc/drmplan.cc create mode 100644 dcmrt/libsrc/drmstrct.cc create mode 100644 dcmrt/libsrc/drtaadcs.cc create mode 100644 dcmrt/libsrc/drtadcs.cc create mode 100644 dcmrt/libsrc/drtads.cc create mode 100644 dcmrt/libsrc/drtafs.cc create mode 100644 dcmrt/libsrc/drtags.cc create mode 100644 dcmrt/libsrc/drtajcs.cc create mode 100644 dcmrt/libsrc/drtas1.cc create mode 100644 dcmrt/libsrc/drtas5.cc create mode 100644 dcmrt/libsrc/drtas6.cc create mode 100644 dcmrt/libsrc/drtas7.cc create mode 100644 dcmrt/libsrc/drtass.cc create mode 100644 dcmrt/libsrc/drtbads.cc create mode 100644 dcmrt/libsrc/drtbas.cc create mode 100644 dcmrt/libsrc/drtbcps.cc create mode 100644 dcmrt/libsrc/drtbl2.cc create mode 100644 dcmrt/libsrc/drtbl5.cc create mode 100644 dcmrt/libsrc/drtbldls.cc create mode 100644 dcmrt/libsrc/drtbldps.cc create mode 100644 dcmrt/libsrc/drtblds1.cc create mode 100644 dcmrt/libsrc/drtblds5.cc create mode 100644 dcmrt/libsrc/drtblds6.cc create mode 100644 dcmrt/libsrc/drtbldts.cc create mode 100644 dcmrt/libsrc/drtbrcss.cc create mode 100644 dcmrt/libsrc/drtbrdrs.cc create mode 100644 dcmrt/libsrc/drtbrs.cc create mode 100644 dcmrt/libsrc/drtbs.cc create mode 100644 dcmrt/libsrc/drtbss.cc create mode 100644 dcmrt/libsrc/drtbvcps.cc create mode 100644 dcmrt/libsrc/drtcbars.cc create mode 100644 dcmrt/libsrc/drtccs.cc create mode 100644 dcmrt/libsrc/drtcctus.cc create mode 100644 dcmrt/libsrc/drtcdrs.cc create mode 100644 dcmrt/libsrc/drtces.cc create mode 100644 dcmrt/libsrc/drtcgis.cc create mode 100644 dcmrt/libsrc/drtchs.cc create mode 100644 dcmrt/libsrc/drtcims.cc create mode 100644 dcmrt/libsrc/drtcis.cc create mode 100644 dcmrt/libsrc/drtcncs.cc create mode 100644 dcmrt/libsrc/drtcos.cc create mode 100644 dcmrt/libsrc/drtcpas.cc create mode 100644 dcmrt/libsrc/drtcpis.cc create mode 100644 dcmrt/libsrc/drtcps.cc create mode 100644 dcmrt/libsrc/drtcs.cc create mode 100644 dcmrt/libsrc/drtcsas.cc create mode 100644 dcmrt/libsrc/drtcshs.cc create mode 100644 dcmrt/libsrc/drtcsis.cc create mode 100644 dcmrt/libsrc/drtcsrs.cc create mode 100644 dcmrt/libsrc/drtcss.cc create mode 100644 dcmrt/libsrc/drtdcs.cc create mode 100644 dcmrt/libsrc/drtdddps.cc create mode 100644 dcmrt/libsrc/drtddps.cc create mode 100644 dcmrt/libsrc/drtdias.cc create mode 100644 dcmrt/libsrc/drtdimcs.cc create mode 100644 dcmrt/libsrc/drtdimrs.cc create mode 100644 dcmrt/libsrc/drtdirs.cc create mode 100644 dcmrt/libsrc/drtdose.cc create mode 100644 dcmrt/libsrc/drtdrs.cc create mode 100644 dcmrt/libsrc/drtds.cc create mode 100644 dcmrt/libsrc/drtdspcs.cc create mode 100644 dcmrt/libsrc/drtdss.cc create mode 100644 dcmrt/libsrc/drtdvhs.cc create mode 100644 dcmrt/libsrc/drtdvrrs.cc create mode 100644 dcmrt/libsrc/drteas.cc create mode 100644 dcmrt/libsrc/drtecs.cc create mode 100644 dcmrt/libsrc/drtes.cc create mode 100644 dcmrt/libsrc/drtfds.cc create mode 100644 dcmrt/libsrc/drtfes.cc create mode 100644 dcmrt/libsrc/drtfgs.cc create mode 100644 dcmrt/libsrc/drtfgss.cc create mode 100644 dcmrt/libsrc/drtfms.cc create mode 100644 dcmrt/libsrc/drtfsss.cc create mode 100644 dcmrt/libsrc/drtgas.cc create mode 100644 dcmrt/libsrc/drtgmcs.cc create mode 100644 dcmrt/libsrc/drtgms.cc create mode 100644 dcmrt/libsrc/drtgpis.cc create mode 100644 dcmrt/libsrc/drthsdrs.cc create mode 100644 dcmrt/libsrc/drtiais.cc create mode 100644 dcmrt/libsrc/drtians.cc create mode 100644 dcmrt/libsrc/drtiblds.cc create mode 100644 dcmrt/libsrc/drtibls.cc create mode 100644 dcmrt/libsrc/drtibs.cc create mode 100644 dcmrt/libsrc/drticpds.cc create mode 100644 dcmrt/libsrc/drticps.cc create mode 100644 dcmrt/libsrc/drtics.cc create mode 100644 dcmrt/libsrc/drtiis.cc create mode 100644 dcmrt/libsrc/drtimage.cc create mode 100644 dcmrt/libsrc/drtionpl.cc create mode 100644 dcmrt/libsrc/drtiontr.cc create mode 100644 dcmrt/libsrc/drtipiqs.cc create mode 100644 dcmrt/libsrc/drtircs.cc create mode 100644 dcmrt/libsrc/drtiseis.cc create mode 100644 dcmrt/libsrc/drtitts.cc create mode 100644 dcmrt/libsrc/drtiwps.cc create mode 100644 dcmrt/libsrc/drtiws.cc create mode 100644 dcmrt/libsrc/drtlsds.cc create mode 100644 dcmrt/libsrc/drtlsds6.cc create mode 100644 dcmrt/libsrc/drtlsds7.cc create mode 100644 dcmrt/libsrc/drtmacds.cc create mode 100644 dcmrt/libsrc/drtmas.cc create mode 100644 dcmrt/libsrc/drtmdrs.cc create mode 100644 dcmrt/libsrc/drtmls.cc create mode 100644 dcmrt/libsrc/drtmps.cc create mode 100644 dcmrt/libsrc/drtmris.cc create mode 100644 dcmrt/libsrc/drtmss.cc create mode 100644 dcmrt/libsrc/drtmucs.cc create mode 100644 dcmrt/libsrc/drtoas.cc create mode 100644 dcmrt/libsrc/drtois.cc create mode 100644 dcmrt/libsrc/drtopis.cc create mode 100644 dcmrt/libsrc/drtos.cc create mode 100644 dcmrt/libsrc/drtpbcs.cc create mode 100644 dcmrt/libsrc/drtpcs.cc create mode 100644 dcmrt/libsrc/drtpcxs.cc create mode 100644 dcmrt/libsrc/drtpdecs.cc create mode 100644 dcmrt/libsrc/drtpdeds.cc create mode 100644 dcmrt/libsrc/drtpfms.cc create mode 100644 dcmrt/libsrc/drtpics.cc create mode 100644 dcmrt/libsrc/drtplan.cc create mode 100644 dcmrt/libsrc/drtporcs.cc create mode 100644 dcmrt/libsrc/drtporis.cc create mode 100644 dcmrt/libsrc/drtppcs.cc create mode 100644 dcmrt/libsrc/drtprsis.cc create mode 100644 dcmrt/libsrc/drtpscs.cc create mode 100644 dcmrt/libsrc/drtpsics.cc create mode 100644 dcmrt/libsrc/drtpss.cc create mode 100644 dcmrt/libsrc/drtpsss.cc create mode 100644 dcmrt/libsrc/drtpvis.cc create mode 100644 dcmrt/libsrc/drtqds.cc create mode 100644 dcmrt/libsrc/drtras.cc create mode 100644 dcmrt/libsrc/drtrbas2.cc create mode 100644 dcmrt/libsrc/drtrbas8.cc create mode 100644 dcmrt/libsrc/drtrbls.cc create mode 100644 dcmrt/libsrc/drtrbos1.cc create mode 100644 dcmrt/libsrc/drtrbos6.cc create mode 100644 dcmrt/libsrc/drtrbos7.cc create mode 100644 dcmrt/libsrc/drtrbs2.cc create mode 100644 dcmrt/libsrc/drtrbs4.cc create mode 100644 dcmrt/libsrc/drtrbs8.cc create mode 100644 dcmrt/libsrc/drtrcdrs.cc create mode 100644 dcmrt/libsrc/drtrcos.cc create mode 100644 dcmrt/libsrc/drtrcps.cc create mode 100644 dcmrt/libsrc/drtrcs.cc create mode 100644 dcmrt/libsrc/drtrdros.cc create mode 100644 dcmrt/libsrc/drtrdrs1.cc create mode 100644 dcmrt/libsrc/drtrdrs6.cc create mode 100644 dcmrt/libsrc/drtrdrs8.cc create mode 100644 dcmrt/libsrc/drtrds.cc create mode 100644 dcmrt/libsrc/drtrecs.cc create mode 100644 dcmrt/libsrc/drtrfgs.cc create mode 100644 dcmrt/libsrc/drtrfors.cc create mode 100644 dcmrt/libsrc/drtrics.cc create mode 100644 dcmrt/libsrc/drtrims.cc create mode 100644 dcmrt/libsrc/drtris.cc create mode 100644 dcmrt/libsrc/drtrlsds.cc create mode 100644 dcmrt/libsrc/drtrmdrs.cc create mode 100644 dcmrt/libsrc/drtrms.cc create mode 100644 dcmrt/libsrc/drtrmss6.cc create mode 100644 dcmrt/libsrc/drtrmss7.cc create mode 100644 dcmrt/libsrc/drtrpcs.cc create mode 100644 dcmrt/libsrc/drtrpis.cc create mode 100644 dcmrt/libsrc/drtrppcs.cc create mode 100644 dcmrt/libsrc/drtrpphs.cc create mode 100644 dcmrt/libsrc/drtrpps.cc create mode 100644 dcmrt/libsrc/drtrppss.cc create mode 100644 dcmrt/libsrc/drtrps.cc create mode 100644 dcmrt/libsrc/drtrris1.cc create mode 100644 dcmrt/libsrc/drtrris6.cc create mode 100644 dcmrt/libsrc/drtrris9.cc create mode 100644 dcmrt/libsrc/drtrrms.cc create mode 100644 dcmrt/libsrc/drtrros.cc create mode 100644 dcmrt/libsrc/drtrrpcs.cc create mode 100644 dcmrt/libsrc/drtrrros.cc create mode 100644 dcmrt/libsrc/drtrrs.cc create mode 100644 dcmrt/libsrc/drtrrshs.cc create mode 100644 dcmrt/libsrc/drtrrtps.cc create mode 100644 dcmrt/libsrc/drtrrtps3.cc create mode 100644 dcmrt/libsrc/drtrrtps4.cc create mode 100644 dcmrt/libsrc/drtrrtps5.cc create mode 100644 dcmrt/libsrc/drtrscs.cc create mode 100644 dcmrt/libsrc/drtrsers.cc create mode 100644 dcmrt/libsrc/drtrses.cc create mode 100644 dcmrt/libsrc/drtrshs.cc create mode 100644 dcmrt/libsrc/drtrshs6.cc create mode 100644 dcmrt/libsrc/drtrshs7.cc create mode 100644 dcmrt/libsrc/drtrsis.cc create mode 100644 dcmrt/libsrc/drtrsns.cc create mode 100644 dcmrt/libsrc/drtrsos.cc create mode 100644 dcmrt/libsrc/drtrsrs.cc create mode 100644 dcmrt/libsrc/drtrss.cc create mode 100644 dcmrt/libsrc/drtrsss.cc create mode 100644 dcmrt/libsrc/drtrsts.cc create mode 100644 dcmrt/libsrc/drtrtrs2.cc create mode 100644 dcmrt/libsrc/drtrtrs4.cc create mode 100644 dcmrt/libsrc/drtrvis.cc create mode 100644 dcmrt/libsrc/drtrws.cc create mode 100644 dcmrt/libsrc/drtrwvms.cc create mode 100644 dcmrt/libsrc/drtscris.cc create mode 100644 dcmrt/libsrc/drtscs.cc create mode 100644 dcmrt/libsrc/drtsdcs.cc create mode 100644 dcmrt/libsrc/drtsds.cc create mode 100644 dcmrt/libsrc/drtshds.cc create mode 100644 dcmrt/libsrc/drtsins.cc create mode 100644 dcmrt/libsrc/drtsis.cc create mode 100644 dcmrt/libsrc/drtsns.cc create mode 100644 dcmrt/libsrc/drtspccs.cc create mode 100644 dcmrt/libsrc/drtspcs.cc create mode 100644 dcmrt/libsrc/drtspgis.cc create mode 100644 dcmrt/libsrc/drtsptcs.cc create mode 100644 dcmrt/libsrc/drtss.cc create mode 100644 dcmrt/libsrc/drtssrcs.cc create mode 100644 dcmrt/libsrc/drtssrs.cc create mode 100644 dcmrt/libsrc/drtsss.cc create mode 100644 dcmrt/libsrc/drtstrct.cc create mode 100644 dcmrt/libsrc/drttms0.cc create mode 100644 dcmrt/libsrc/drttms9.cc create mode 100644 dcmrt/libsrc/drttreat.cc create mode 100644 dcmrt/libsrc/drttscds.cc create mode 100644 dcmrt/libsrc/drttsibs.cc create mode 100644 dcmrt/libsrc/drttsmds.cc create mode 100644 dcmrt/libsrc/drttts.cc create mode 100644 dcmrt/libsrc/drttypes.cc create mode 100644 dcmrt/libsrc/drtudis.cc create mode 100644 dcmrt/libsrc/drtvls.cc create mode 100644 dcmrt/libsrc/drtwps.cc create mode 100644 dcmrt/libsrc/drtwrs.cc create mode 100644 dcmrt/libsrc/drtwrsrs.cc create mode 100644 dcmrt/libsrc/drtws.cc create mode 100644 dcmrt/libsrc/drtxrs.cc create mode 100644 dcmrt/tests/CMakeLists.txt create mode 100644 dcmrt/tests/Makefile.dep create mode 100644 dcmrt/tests/Makefile.in create mode 100644 dcmrt/tests/drttest.cc create mode 100644 dcmrt/tests/tests.cc create mode 100644 dcmrt/tests/tsearch.cc create mode 100644 dcmseg/CMakeLists.txt create mode 100644 dcmseg/Makefile.in create mode 100755 dcmseg/configure create mode 100644 dcmseg/data/Makefile.in create mode 100644 dcmseg/docs/Makefile.in create mode 100644 dcmseg/docs/dcmseg.dox create mode 100644 dcmseg/etc/Makefile.in create mode 100644 dcmseg/include/CMakeLists.txt create mode 100644 dcmseg/include/Makefile.in create mode 100644 dcmseg/include/dcmtk/dcmseg/segdef.h create mode 100644 dcmseg/include/dcmtk/dcmseg/segdoc.h create mode 100644 dcmseg/include/dcmtk/dcmseg/segment.h create mode 100644 dcmseg/include/dcmtk/dcmseg/segtypes.h create mode 100644 dcmseg/include/dcmtk/dcmseg/segutils.h create mode 100644 dcmseg/libsrc/CMakeLists.txt create mode 100644 dcmseg/libsrc/Makefile.dep create mode 100644 dcmseg/libsrc/Makefile.in create mode 100644 dcmseg/libsrc/segdoc.cc create mode 100644 dcmseg/libsrc/segment.cc create mode 100644 dcmseg/libsrc/segtypes.cc create mode 100644 dcmseg/libsrc/segutils.cc create mode 100644 dcmseg/tests/CMakeLists.txt create mode 100644 dcmseg/tests/Makefile.dep create mode 100644 dcmseg/tests/Makefile.in create mode 100644 dcmseg/tests/tests.cc create mode 100644 dcmseg/tests/tutils.cc create mode 100644 dcmsign/CMakeLists.txt create mode 100644 dcmsign/Makefile.in create mode 100644 dcmsign/apps/CMakeLists.txt create mode 100644 dcmsign/apps/Makefile.dep create mode 100644 dcmsign/apps/Makefile.in create mode 100644 dcmsign/apps/dcmsign.cc create mode 100755 dcmsign/configure create mode 100644 dcmsign/data/Makefile.in create mode 100644 dcmsign/docs/Makefile.in create mode 100644 dcmsign/docs/dcmsign.dox create mode 100644 dcmsign/docs/dcmsign.man create mode 100644 dcmsign/etc/Makefile.in create mode 100644 dcmsign/include/CMakeLists.txt create mode 100644 dcmsign/include/Makefile.in create mode 100644 dcmsign/include/dcmtk/dcmsign/dcsignat.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sialgo.h create mode 100644 dcmsign/include/dcmtk/dcmsign/siautopr.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sibrsapr.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sicert.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sicertvf.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sicreapr.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sidefine.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sidsa.h create mode 100644 dcmsign/include/dcmtk/dcmsign/simac.h create mode 100644 dcmsign/include/dcmtk/dcmsign/simaccon.h create mode 100644 dcmsign/include/dcmtk/dcmsign/simd5.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sinullpr.h create mode 100644 dcmsign/include/dcmtk/dcmsign/siprivat.h create mode 100644 dcmsign/include/dcmtk/dcmsign/siripemd.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sirsa.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sisha1.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sisha256.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sisha384.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sisha512.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sisprof.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sitstamp.h create mode 100644 dcmsign/include/dcmtk/dcmsign/sitypes.h create mode 100644 dcmsign/libsrc/CMakeLists.txt create mode 100644 dcmsign/libsrc/Makefile.dep create mode 100644 dcmsign/libsrc/Makefile.in create mode 100644 dcmsign/libsrc/dcsignat.cc create mode 100644 dcmsign/libsrc/siautopr.cc create mode 100644 dcmsign/libsrc/sibrsapr.cc create mode 100644 dcmsign/libsrc/sicert.cc create mode 100644 dcmsign/libsrc/sicertvf.cc create mode 100644 dcmsign/libsrc/sicreapr.cc create mode 100644 dcmsign/libsrc/sidsa.cc create mode 100644 dcmsign/libsrc/simaccon.cc create mode 100644 dcmsign/libsrc/simd5.cc create mode 100644 dcmsign/libsrc/sinullpr.cc create mode 100644 dcmsign/libsrc/siprivat.cc create mode 100644 dcmsign/libsrc/siripemd.cc create mode 100644 dcmsign/libsrc/sirsa.cc create mode 100644 dcmsign/libsrc/sisha1.cc create mode 100644 dcmsign/libsrc/sisha256.cc create mode 100644 dcmsign/libsrc/sisha384.cc create mode 100644 dcmsign/libsrc/sisha512.cc create mode 100644 dcmsign/libsrc/sisprof.cc create mode 100644 dcmsign/libsrc/sitypes.cc create mode 100644 dcmsign/tests/Makefile.in create mode 100644 dcmsr/CMakeLists.txt create mode 100644 dcmsr/Makefile.in create mode 100644 dcmsr/apps/CMakeLists.txt create mode 100644 dcmsr/apps/Makefile.dep create mode 100644 dcmsr/apps/Makefile.in create mode 100644 dcmsr/apps/dsr2html.cc create mode 100644 dcmsr/apps/dsr2xml.cc create mode 100644 dcmsr/apps/dsrdump.cc create mode 100644 dcmsr/apps/xml2dsr.cc create mode 100755 dcmsr/configure create mode 100644 dcmsr/data/CMakeLists.txt create mode 100644 dcmsr/data/Makefile.in create mode 100644 dcmsr/data/dsr2xml.xsd create mode 100644 dcmsr/data/report.css create mode 100644 dcmsr/data/reportx.css create mode 100644 dcmsr/docs/Makefile.in create mode 100644 dcmsr/docs/dcmsr.dox create mode 100644 dcmsr/docs/dsr2html.man create mode 100644 dcmsr/docs/dsr2xml.man create mode 100644 dcmsr/docs/dsrdump.man create mode 100644 dcmsr/docs/xml2dsr.man create mode 100644 dcmsr/etc/Makefile.in create mode 100644 dcmsr/include/CMakeLists.txt create mode 100644 dcmsr/include/Makefile.in create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid100.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid10013e.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid10033e.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid11.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid244.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid244e.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid29.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid29e.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid4031e.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid42.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid5000.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid5001.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/define.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/init.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/logger.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/srnumvl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/srnumvlu.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid1001.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid1204.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid1411.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid1419m.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid1500.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid1501.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid15def.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid1600.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid300.h create mode 100644 dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h create mode 100644 dcmsr/include/dcmtk/dcmsr/codes/dcm.h create mode 100644 dcmsr/include/dcmtk/dcmsr/codes/ncit.h create mode 100644 dcmsr/include/dcmtk/dcmsr/codes/sct.h create mode 100644 dcmsr/include/dcmtk/dcmsr/codes/srt.h create mode 100644 dcmsr/include/dcmtk/dcmsr/codes/ucum.h create mode 100644 dcmsr/include/dcmtk/dcmsr/codes/umls.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsdefine.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsracqcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrbascc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrc3dcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrchecc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcitem.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcodtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcodvl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcolcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcomcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcomtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcomvl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcontn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrcsidl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrctpl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrctxgr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdattn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdncsr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdnflt.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdoc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdocst.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdoctn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdoctr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrdtitn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrenhcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrimgfr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrimgse.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrimgtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrimgvl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrimpcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsriodcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsritcsr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrkeycc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrmaccc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrmamcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrnumtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrnumvl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrpficc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrplicc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrpnmtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrposcn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrprdcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrprocc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrrefin.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrreftn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrrrdcc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrrtpl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrsaecc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrsc3gr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrsc3tn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrscogr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrscotn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrscovl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrsoprf.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrspecc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrstpl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrstrvl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtcodt.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtcosp.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtcotn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtcoto.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtcovl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtextn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtimtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtlist.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtnant.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtncsr.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtpltn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtree.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrtypes.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsruidtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrwavch.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrwavtn.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrwavvl.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrxmlc.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrxmld.h create mode 100644 dcmsr/include/dcmtk/dcmsr/dsrxrdcc.h create mode 100644 dcmsr/libcmr/CMakeLists.txt create mode 100644 dcmsr/libcmr/Makefile.dep create mode 100644 dcmsr/libcmr/Makefile.in create mode 100644 dcmsr/libcmr/cid100.cc create mode 100644 dcmsr/libcmr/cid10013.cc create mode 100644 dcmsr/libcmr/cid10013e.cc create mode 100644 dcmsr/libcmr/cid10033.cc create mode 100644 dcmsr/libcmr/cid10033e.cc create mode 100644 dcmsr/libcmr/cid11.cc create mode 100644 dcmsr/libcmr/cid244.cc create mode 100644 dcmsr/libcmr/cid244e.cc create mode 100644 dcmsr/libcmr/cid29.cc create mode 100644 dcmsr/libcmr/cid29e.cc create mode 100644 dcmsr/libcmr/cid4020.cc create mode 100644 dcmsr/libcmr/cid4021.cc create mode 100644 dcmsr/libcmr/cid4031.cc create mode 100644 dcmsr/libcmr/cid4031e.cc create mode 100644 dcmsr/libcmr/cid42.cc create mode 100644 dcmsr/libcmr/cid5000.cc create mode 100644 dcmsr/libcmr/cid5001.cc create mode 100644 dcmsr/libcmr/cid6147.cc create mode 100644 dcmsr/libcmr/cid7021.cc create mode 100644 dcmsr/libcmr/cid7181.cc create mode 100644 dcmsr/libcmr/cid7445.cc create mode 100644 dcmsr/libcmr/cid7452.cc create mode 100644 dcmsr/libcmr/cid7453.cc create mode 100644 dcmsr/libcmr/cid7464.cc create mode 100644 dcmsr/libcmr/cid7469.cc create mode 100644 dcmsr/libcmr/init.cc create mode 100644 dcmsr/libcmr/logger.cc create mode 100644 dcmsr/libcmr/srnumvl.cc create mode 100644 dcmsr/libcmr/tid1001.cc create mode 100644 dcmsr/libcmr/tid1204.cc create mode 100644 dcmsr/libcmr/tid1411.cc create mode 100644 dcmsr/libcmr/tid1419m.cc create mode 100644 dcmsr/libcmr/tid1500.cc create mode 100644 dcmsr/libcmr/tid1501.cc create mode 100644 dcmsr/libcmr/tid15def.cc create mode 100644 dcmsr/libcmr/tid1600.cc create mode 100644 dcmsr/libcmr/tid300.cc create mode 100644 dcmsr/libcmr/tid4019.cc create mode 100644 dcmsr/libsrc/CMakeLists.txt create mode 100644 dcmsr/libsrc/Makefile.dep create mode 100644 dcmsr/libsrc/Makefile.in create mode 100644 dcmsr/libsrc/dsracqcc.cc create mode 100644 dcmsr/libsrc/dsrbascc.cc create mode 100644 dcmsr/libsrc/dsrc3dcc.cc create mode 100644 dcmsr/libsrc/dsrchecc.cc create mode 100644 dcmsr/libsrc/dsrcitem.cc create mode 100644 dcmsr/libsrc/dsrcodtn.cc create mode 100644 dcmsr/libsrc/dsrcodvl.cc create mode 100644 dcmsr/libsrc/dsrcolcc.cc create mode 100644 dcmsr/libsrc/dsrcomcc.cc create mode 100644 dcmsr/libsrc/dsrcomtn.cc create mode 100644 dcmsr/libsrc/dsrcomvl.cc create mode 100644 dcmsr/libsrc/dsrcontn.cc create mode 100644 dcmsr/libsrc/dsrcsidl.cc create mode 100644 dcmsr/libsrc/dsrctpl.cc create mode 100644 dcmsr/libsrc/dsrctxgr.cc create mode 100644 dcmsr/libsrc/dsrdattn.cc create mode 100644 dcmsr/libsrc/dsrdncsr.cc create mode 100644 dcmsr/libsrc/dsrdnflt.cc create mode 100644 dcmsr/libsrc/dsrdoc.cc create mode 100644 dcmsr/libsrc/dsrdocst.cc create mode 100644 dcmsr/libsrc/dsrdoctn.cc create mode 100644 dcmsr/libsrc/dsrdoctr.cc create mode 100644 dcmsr/libsrc/dsrdtitn.cc create mode 100644 dcmsr/libsrc/dsrenhcc.cc create mode 100644 dcmsr/libsrc/dsrimgfr.cc create mode 100644 dcmsr/libsrc/dsrimgse.cc create mode 100644 dcmsr/libsrc/dsrimgtn.cc create mode 100644 dcmsr/libsrc/dsrimgvl.cc create mode 100644 dcmsr/libsrc/dsrimpcc.cc create mode 100644 dcmsr/libsrc/dsriodcc.cc create mode 100644 dcmsr/libsrc/dsritcsr.cc create mode 100644 dcmsr/libsrc/dsrkeycc.cc create mode 100644 dcmsr/libsrc/dsrmaccc.cc create mode 100644 dcmsr/libsrc/dsrmamcc.cc create mode 100644 dcmsr/libsrc/dsrnumtn.cc create mode 100644 dcmsr/libsrc/dsrnumvl.cc create mode 100644 dcmsr/libsrc/dsrpficc.cc create mode 100644 dcmsr/libsrc/dsrplicc.cc create mode 100644 dcmsr/libsrc/dsrpnmtn.cc create mode 100644 dcmsr/libsrc/dsrposcn.cc create mode 100644 dcmsr/libsrc/dsrprdcc.cc create mode 100644 dcmsr/libsrc/dsrprocc.cc create mode 100644 dcmsr/libsrc/dsrrefin.cc create mode 100644 dcmsr/libsrc/dsrreftn.cc create mode 100644 dcmsr/libsrc/dsrrrdcc.cc create mode 100644 dcmsr/libsrc/dsrrtpl.cc create mode 100644 dcmsr/libsrc/dsrsaecc.cc create mode 100644 dcmsr/libsrc/dsrsc3gr.cc create mode 100644 dcmsr/libsrc/dsrsc3tn.cc create mode 100644 dcmsr/libsrc/dsrsc3vl.cc create mode 100644 dcmsr/libsrc/dsrscogr.cc create mode 100644 dcmsr/libsrc/dsrscotn.cc create mode 100644 dcmsr/libsrc/dsrscovl.cc create mode 100644 dcmsr/libsrc/dsrsoprf.cc create mode 100644 dcmsr/libsrc/dsrspecc.cc create mode 100644 dcmsr/libsrc/dsrstpl.cc create mode 100644 dcmsr/libsrc/dsrstrvl.cc create mode 100644 dcmsr/libsrc/dsrtcodt.cc create mode 100644 dcmsr/libsrc/dsrtcosp.cc create mode 100644 dcmsr/libsrc/dsrtcotn.cc create mode 100644 dcmsr/libsrc/dsrtcoto.cc create mode 100644 dcmsr/libsrc/dsrtcovl.cc create mode 100644 dcmsr/libsrc/dsrtextn.cc create mode 100644 dcmsr/libsrc/dsrtimtn.cc create mode 100644 dcmsr/libsrc/dsrtpltn.cc create mode 100644 dcmsr/libsrc/dsrtree.cc create mode 100644 dcmsr/libsrc/dsrtypes.cc create mode 100644 dcmsr/libsrc/dsruidtn.cc create mode 100644 dcmsr/libsrc/dsrwavch.cc create mode 100644 dcmsr/libsrc/dsrwavtn.cc create mode 100644 dcmsr/libsrc/dsrwavvl.cc create mode 100644 dcmsr/libsrc/dsrxmlc.cc create mode 100644 dcmsr/libsrc/dsrxmld.cc create mode 100644 dcmsr/libsrc/dsrxrdcc.cc create mode 100644 dcmsr/tests/CMakeLists.txt create mode 100644 dcmsr/tests/Makefile.dep create mode 100644 dcmsr/tests/Makefile.in create mode 100644 dcmsr/tests/gmon.out create mode 100644 dcmsr/tests/mkreport.cc create mode 100644 dcmsr/tests/tests.cc create mode 100644 dcmsr/tests/tsrcmr.cc create mode 100644 dcmsr/tests/tsrcodvl.cc create mode 100644 dcmsr/tests/tsrdoc.cc create mode 100644 dcmsr/tests/tsrdoctr.cc create mode 100644 dcmsr/tests/tsrlist.cc create mode 100644 dcmsr/tests/tsrnumvl.cc create mode 100644 dcmsr/tests/tsrtpl.cc create mode 100644 dcmsr/tests/tsrtree.cc create mode 100644 dcmtls/CMakeLists.txt create mode 100644 dcmtls/Makefile.in create mode 100644 dcmtls/apps/Makefile.dep create mode 100644 dcmtls/apps/Makefile.in create mode 100755 dcmtls/configure create mode 100644 dcmtls/data/Makefile.in create mode 100644 dcmtls/docs/CMakeLists.txt create mode 100644 dcmtls/docs/Makefile.in create mode 100644 dcmtls/docs/certstor.txt create mode 100644 dcmtls/docs/ciphers.txt create mode 100644 dcmtls/docs/dcmtls.dox create mode 100644 dcmtls/docs/randseed.txt create mode 100644 dcmtls/etc/Makefile.in create mode 100644 dcmtls/include/CMakeLists.txt create mode 100644 dcmtls/include/Makefile.in create mode 100644 dcmtls/include/dcmtk/dcmtls/tlsciphr.h create mode 100644 dcmtls/include/dcmtk/dcmtls/tlscond.h create mode 100644 dcmtls/include/dcmtk/dcmtls/tlsdefin.h create mode 100644 dcmtls/include/dcmtk/dcmtls/tlslayer.h create mode 100644 dcmtls/include/dcmtk/dcmtls/tlsopt.h create mode 100644 dcmtls/include/dcmtk/dcmtls/tlsscu.h create mode 100644 dcmtls/include/dcmtk/dcmtls/tlstrans.h create mode 100644 dcmtls/libsrc/CMakeLists.txt create mode 100644 dcmtls/libsrc/Makefile.dep create mode 100644 dcmtls/libsrc/Makefile.in create mode 100644 dcmtls/libsrc/tlsciphr.cc create mode 100644 dcmtls/libsrc/tlscond.cc create mode 100644 dcmtls/libsrc/tlslayer.cc create mode 100644 dcmtls/libsrc/tlsopt.cc create mode 100644 dcmtls/libsrc/tlsscu.cc create mode 100644 dcmtls/libsrc/tlstrans.cc create mode 100644 dcmtls/tests/Makefile.in create mode 100755 dcmtls/tests/dcmtk_ca.pl create mode 100644 dcmtract/CMakeLists.txt create mode 100644 dcmtract/Makefile.in create mode 100755 dcmtract/configure create mode 100644 dcmtract/data/Makefile.in create mode 100644 dcmtract/docs/Makefile.in create mode 100644 dcmtract/docs/dcmtract.dox create mode 100644 dcmtract/etc/Makefile.in create mode 100644 dcmtract/include/CMakeLists.txt create mode 100644 dcmtract/include/Makefile.in create mode 100644 dcmtract/include/dcmtk/dcmtract/trcdef.h create mode 100644 dcmtract/include/dcmtk/dcmtract/trcmeasurement.h create mode 100644 dcmtract/include/dcmtk/dcmtract/trcmodtractresults.h create mode 100644 dcmtract/include/dcmtk/dcmtract/trcstatistic.h create mode 100644 dcmtract/include/dcmtk/dcmtract/trctrack.h create mode 100644 dcmtract/include/dcmtk/dcmtract/trctrackset.h create mode 100644 dcmtract/include/dcmtk/dcmtract/trctractographyresults.h create mode 100644 dcmtract/include/dcmtk/dcmtract/trctypes.h create mode 100644 dcmtract/libsrc/CMakeLists.txt create mode 100644 dcmtract/libsrc/Makefile.dep create mode 100644 dcmtract/libsrc/Makefile.in create mode 100644 dcmtract/libsrc/trcmeasurement.cc create mode 100644 dcmtract/libsrc/trcmodtractresults.cc create mode 100644 dcmtract/libsrc/trcstatistic.cc create mode 100644 dcmtract/libsrc/trctrack.cc create mode 100644 dcmtract/libsrc/trctrackset.cc create mode 100644 dcmtract/libsrc/trctractographyresults.cc create mode 100644 dcmtract/libsrc/trctypes.cc create mode 100644 dcmtract/tests/Makefile.dep create mode 100644 dcmtract/tests/Makefile.in create mode 100644 dcmwlm/CMakeLists.txt create mode 100644 dcmwlm/Makefile.in create mode 100644 dcmwlm/apps/CMakeLists.txt create mode 100644 dcmwlm/apps/Makefile.dep create mode 100644 dcmwlm/apps/Makefile.in create mode 100644 dcmwlm/apps/wlcefs.cc create mode 100644 dcmwlm/apps/wlcefs.h create mode 100644 dcmwlm/apps/wlmscpfs.cc create mode 100755 dcmwlm/configure create mode 100644 dcmwlm/data/CMakeLists.txt create mode 100644 dcmwlm/data/Makefile.in create mode 100644 dcmwlm/data/wlistdb/OFFIS/lockfile create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist1.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist10.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist2.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist3.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist4.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist5.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist6.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist7.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist8.dump create mode 100644 dcmwlm/data/wlistdb/OFFIS/wklist9.dump create mode 100644 dcmwlm/data/wlistdb/README create mode 100644 dcmwlm/data/wlistqry/README create mode 100644 dcmwlm/data/wlistqry/wlistqry0.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry1.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry10.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry11.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry12.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry2.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry3.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry4.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry5.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry6.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry7.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry8.dump create mode 100644 dcmwlm/data/wlistqry/wlistqry9.dump create mode 100644 dcmwlm/docs/CMakeLists.txt create mode 100644 dcmwlm/docs/Makefile.in create mode 100644 dcmwlm/docs/dcmwlm.dox create mode 100644 dcmwlm/docs/wlmscpfs.man create mode 100644 dcmwlm/docs/wlmsetup.txt create mode 100644 dcmwlm/etc/Makefile.in create mode 100644 dcmwlm/include/CMakeLists.txt create mode 100644 dcmwlm/include/Makefile.in create mode 100644 dcmwlm/include/dcmtk/dcmwlm/wldefine.h create mode 100644 dcmwlm/include/dcmtk/dcmwlm/wlds.h create mode 100644 dcmwlm/include/dcmtk/dcmwlm/wldsfs.h create mode 100644 dcmwlm/include/dcmtk/dcmwlm/wlfsim.h create mode 100644 dcmwlm/include/dcmtk/dcmwlm/wlmactmg.h create mode 100644 dcmwlm/include/dcmtk/dcmwlm/wltypdef.h create mode 100644 dcmwlm/libsrc/CMakeLists.txt create mode 100644 dcmwlm/libsrc/Makefile.dep create mode 100644 dcmwlm/libsrc/Makefile.in create mode 100644 dcmwlm/libsrc/wlds.cc create mode 100644 dcmwlm/libsrc/wldsfs.cc create mode 100644 dcmwlm/libsrc/wlfsim.cc create mode 100644 dcmwlm/libsrc/wlmactmg.cc create mode 100644 dcmwlm/tests/CMakeLists.txt create mode 100644 dcmwlm/tests/Makefile.dep create mode 100644 dcmwlm/tests/Makefile.in create mode 100644 dcmwlm/tests/wltest.cc create mode 100644 docs/ANNOUNCE.310 create mode 100644 docs/ANNOUNCE.311 create mode 100644 docs/ANNOUNCE.312 create mode 100644 docs/ANNOUNCE.320 create mode 100644 docs/ANNOUNCE.321 create mode 100644 docs/ANNOUNCE.330 create mode 100644 docs/ANNOUNCE.331 create mode 100644 docs/ANNOUNCE.340 create mode 100644 docs/ANNOUNCE.341 create mode 100644 docs/ANNOUNCE.342 create mode 100644 docs/ANNOUNCE.350 create mode 100644 docs/ANNOUNCE.351 create mode 100644 docs/ANNOUNCE.352 create mode 100644 docs/ANNOUNCE.353 create mode 100644 docs/ANNOUNCE.354 create mode 100644 docs/ANNOUNCE.360 create mode 100644 docs/ANNOUNCE.362 create mode 100644 docs/ANNOUNCE.363 create mode 100644 docs/ANNOUNCE.364 create mode 100644 docs/CHANGES.301 create mode 100644 docs/CHANGES.302 create mode 100644 docs/CHANGES.310 create mode 100644 docs/CHANGES.311 create mode 100644 docs/CHANGES.312 create mode 100644 docs/CHANGES.320 create mode 100644 docs/CHANGES.321 create mode 100644 docs/CHANGES.330 create mode 100644 docs/CHANGES.331 create mode 100644 docs/CHANGES.340 create mode 100644 docs/CHANGES.341 create mode 100644 docs/CHANGES.342 create mode 100644 docs/CHANGES.350 create mode 100644 docs/CHANGES.351 create mode 100644 docs/CHANGES.352 create mode 100644 docs/CHANGES.353 create mode 100644 docs/CHANGES.354 create mode 100644 docs/CHANGES.360 create mode 100644 docs/CHANGES.362 create mode 100644 docs/CHANGES.363 create mode 100644 docs/CHANGES.364 create mode 100644 docs/CHANGES.365 create mode 100644 docs/DCMIMAGE.11X create mode 100644 doxygen/CMakeLists.txt create mode 100644 doxygen/Makefile.in create mode 100755 doxygen/configure create mode 100644 doxygen/footer.html create mode 100644 doxygen/htmldocs.cfg create mode 100644 doxygen/htmldocs.dox create mode 100644 doxygen/layout.xml create mode 100755 doxygen/man2text.sh create mode 100644 doxygen/manpages.cfg create mode 100644 doxygen/manpages/man1/cda2dcm.1 create mode 100644 doxygen/manpages/man1/dcm2json.1 create mode 100644 doxygen/manpages/man1/dcm2pdf.1 create mode 100644 doxygen/manpages/man1/dcm2pnm.1 create mode 100644 doxygen/manpages/man1/dcm2xml.1 create mode 100644 doxygen/manpages/man1/dcmcjpeg.1 create mode 100644 doxygen/manpages/man1/dcmcjpls.1 create mode 100644 doxygen/manpages/man1/dcmconv.1 create mode 100644 doxygen/manpages/man1/dcmcrle.1 create mode 100644 doxygen/manpages/man1/dcmdjpeg.1 create mode 100644 doxygen/manpages/man1/dcmdjpls.1 create mode 100644 doxygen/manpages/man1/dcmdrle.1 create mode 100644 doxygen/manpages/man1/dcmdspfn.1 create mode 100644 doxygen/manpages/man1/dcmdump.1 create mode 100644 doxygen/manpages/man1/dcmftest.1 create mode 100644 doxygen/manpages/man1/dcmgpdir.1 create mode 100644 doxygen/manpages/man1/dcmicmp.1 create mode 100644 doxygen/manpages/man1/dcmj2pnm.1 create mode 100644 doxygen/manpages/man1/dcml2pnm.1 create mode 100644 doxygen/manpages/man1/dcmmkcrv.1 create mode 100644 doxygen/manpages/man1/dcmmkdir.1 create mode 100644 doxygen/manpages/man1/dcmmklut.1 create mode 100644 doxygen/manpages/man1/dcmodify.1 create mode 100644 doxygen/manpages/man1/dcmp2pgm.1 create mode 100644 doxygen/manpages/man1/dcmprscp.1 create mode 100644 doxygen/manpages/man1/dcmprscu.1 create mode 100644 doxygen/manpages/man1/dcmpschk.1 create mode 100644 doxygen/manpages/man1/dcmpsmk.1 create mode 100644 doxygen/manpages/man1/dcmpsprt.1 create mode 100644 doxygen/manpages/man1/dcmpsrcv.1 create mode 100644 doxygen/manpages/man1/dcmpssnd.1 create mode 100644 doxygen/manpages/man1/dcmqridx.1 create mode 100644 doxygen/manpages/man1/dcmqrscp.1 create mode 100644 doxygen/manpages/man1/dcmqrti.1 create mode 100644 doxygen/manpages/man1/dcmquant.1 create mode 100644 doxygen/manpages/man1/dcmrecv.1 create mode 100644 doxygen/manpages/man1/dcmscale.1 create mode 100644 doxygen/manpages/man1/dcmsend.1 create mode 100644 doxygen/manpages/man1/dcmsign.1 create mode 100644 doxygen/manpages/man1/dcod2lum.1 create mode 100644 doxygen/manpages/man1/dconvlum.1 create mode 100644 doxygen/manpages/man1/drtdump.1 create mode 100644 doxygen/manpages/man1/dsr2html.1 create mode 100644 doxygen/manpages/man1/dsr2xml.1 create mode 100644 doxygen/manpages/man1/dsrdump.1 create mode 100644 doxygen/manpages/man1/dump2dcm.1 create mode 100644 doxygen/manpages/man1/echoscu.1 create mode 100644 doxygen/manpages/man1/findscu.1 create mode 100644 doxygen/manpages/man1/getscu.1 create mode 100644 doxygen/manpages/man1/img2dcm.1 create mode 100644 doxygen/manpages/man1/movescu.1 create mode 100644 doxygen/manpages/man1/pdf2dcm.1 create mode 100644 doxygen/manpages/man1/stl2dcm.1 create mode 100644 doxygen/manpages/man1/storescp.1 create mode 100644 doxygen/manpages/man1/storescu.1 create mode 100644 doxygen/manpages/man1/termscu.1 create mode 100644 doxygen/manpages/man1/wlmscpfs.1 create mode 100644 doxygen/manpages/man1/xml2dcm.1 create mode 100644 doxygen/manpages/man1/xml2dsr.1 create mode 100644 doxygen/patchman.cmake create mode 100755 doxygen/patchman.sh create mode 100644 oflog/CMakeLists.txt create mode 100644 oflog/Makefile.in create mode 100755 oflog/configure create mode 100644 oflog/data/Makefile.in create mode 100644 oflog/docs/LICENSE create mode 100644 oflog/docs/Makefile.in create mode 100644 oflog/docs/oflog.dox create mode 100644 oflog/etc/CMakeLists.txt create mode 100644 oflog/etc/Makefile.in create mode 100644 oflog/etc/filelog.cfg create mode 100644 oflog/etc/logger.cfg create mode 100644 oflog/include/CMakeLists.txt create mode 100644 oflog/include/Makefile.in create mode 100644 oflog/include/dcmtk/oflog/appender.h create mode 100644 oflog/include/dcmtk/oflog/asyncap.h create mode 100644 oflog/include/dcmtk/oflog/clfsap.h create mode 100644 oflog/include/dcmtk/oflog/clogger.h create mode 100644 oflog/include/dcmtk/oflog/config.h create mode 100644 oflog/include/dcmtk/oflog/config/defines.h create mode 100644 oflog/include/dcmtk/oflog/config/macosx.h create mode 100644 oflog/include/dcmtk/oflog/config/win32.h create mode 100644 oflog/include/dcmtk/oflog/config/windowsh.h create mode 100644 oflog/include/dcmtk/oflog/configrt.h create mode 100644 oflog/include/dcmtk/oflog/consap.h create mode 100644 oflog/include/dcmtk/oflog/fileap.h create mode 100644 oflog/include/dcmtk/oflog/fstreams.h create mode 100644 oflog/include/dcmtk/oflog/helpers/apndimpl.h create mode 100644 oflog/include/dcmtk/oflog/helpers/fileinfo.h create mode 100644 oflog/include/dcmtk/oflog/helpers/lloguser.h create mode 100644 oflog/include/dcmtk/oflog/helpers/lockfile.h create mode 100644 oflog/include/dcmtk/oflog/helpers/loglog.h create mode 100644 oflog/include/dcmtk/oflog/helpers/pointer.h create mode 100644 oflog/include/dcmtk/oflog/helpers/property.h create mode 100644 oflog/include/dcmtk/oflog/helpers/queue.h create mode 100644 oflog/include/dcmtk/oflog/helpers/sleep.h create mode 100644 oflog/include/dcmtk/oflog/helpers/snprintf.h create mode 100644 oflog/include/dcmtk/oflog/helpers/sockbuff.h create mode 100644 oflog/include/dcmtk/oflog/helpers/socket.h create mode 100644 oflog/include/dcmtk/oflog/helpers/strhelp.h create mode 100644 oflog/include/dcmtk/oflog/helpers/threadcf.h create mode 100644 oflog/include/dcmtk/oflog/helpers/timehelp.h create mode 100644 oflog/include/dcmtk/oflog/hierarchy.h create mode 100644 oflog/include/dcmtk/oflog/hierlock.h create mode 100644 oflog/include/dcmtk/oflog/internal/cygwin32.h create mode 100644 oflog/include/dcmtk/oflog/internal/env.h create mode 100644 oflog/include/dcmtk/oflog/internal/internal.h create mode 100644 oflog/include/dcmtk/oflog/internal/socket.h create mode 100644 oflog/include/dcmtk/oflog/layout.h create mode 100644 oflog/include/dcmtk/oflog/log4judp.h create mode 100644 oflog/include/dcmtk/oflog/logger.h create mode 100644 oflog/include/dcmtk/oflog/loglevel.h create mode 100644 oflog/include/dcmtk/oflog/logmacro.h create mode 100644 oflog/include/dcmtk/oflog/mdc.h create mode 100644 oflog/include/dcmtk/oflog/ndc.h create mode 100644 oflog/include/dcmtk/oflog/ntelogap.h create mode 100644 oflog/include/dcmtk/oflog/nullap.h create mode 100644 oflog/include/dcmtk/oflog/oflog.h create mode 100644 oflog/include/dcmtk/oflog/socketap.h create mode 100644 oflog/include/dcmtk/oflog/spi/apndatch.h create mode 100644 oflog/include/dcmtk/oflog/spi/factory.h create mode 100644 oflog/include/dcmtk/oflog/spi/filter.h create mode 100644 oflog/include/dcmtk/oflog/spi/logevent.h create mode 100644 oflog/include/dcmtk/oflog/spi/logfact.h create mode 100644 oflog/include/dcmtk/oflog/spi/logimpl.h create mode 100644 oflog/include/dcmtk/oflog/spi/objreg.h create mode 100644 oflog/include/dcmtk/oflog/spi/rootlog.h create mode 100644 oflog/include/dcmtk/oflog/streams.h create mode 100644 oflog/include/dcmtk/oflog/syslogap.h create mode 100644 oflog/include/dcmtk/oflog/tchar.h create mode 100644 oflog/include/dcmtk/oflog/thread/impl/syncimpl.h create mode 100644 oflog/include/dcmtk/oflog/thread/impl/syncpmsm.h create mode 100644 oflog/include/dcmtk/oflog/thread/impl/syncpthr.h create mode 100644 oflog/include/dcmtk/oflog/thread/impl/syncwin.h create mode 100644 oflog/include/dcmtk/oflog/thread/impl/thredimp.h create mode 100644 oflog/include/dcmtk/oflog/thread/impl/tls.h create mode 100644 oflog/include/dcmtk/oflog/thread/syncprim.h create mode 100644 oflog/include/dcmtk/oflog/thread/syncpub.h create mode 100644 oflog/include/dcmtk/oflog/thread/threads.h create mode 100644 oflog/include/dcmtk/oflog/tracelog.h create mode 100644 oflog/include/dcmtk/oflog/tstring.h create mode 100644 oflog/include/dcmtk/oflog/version.h create mode 100644 oflog/include/dcmtk/oflog/winconap.h create mode 100644 oflog/include/dcmtk/oflog/windebap.h create mode 100644 oflog/libsrc/CMakeLists.txt create mode 100644 oflog/libsrc/Makefile.dep create mode 100644 oflog/libsrc/Makefile.in create mode 100644 oflog/libsrc/apndimpl.cc create mode 100644 oflog/libsrc/appender.cc create mode 100644 oflog/libsrc/asyncap.cc create mode 100644 oflog/libsrc/clfsap.cc create mode 100644 oflog/libsrc/clogger.cc create mode 100644 oflog/libsrc/config.cc create mode 100644 oflog/libsrc/consap.cc create mode 100644 oflog/libsrc/cygwin32.cc create mode 100644 oflog/libsrc/env.cc create mode 100644 oflog/libsrc/factory.cc create mode 100644 oflog/libsrc/fileap.cc create mode 100644 oflog/libsrc/fileinfo.cc create mode 100644 oflog/libsrc/filter.cc create mode 100644 oflog/libsrc/globinit.cc create mode 100644 oflog/libsrc/hierarchy.cc create mode 100644 oflog/libsrc/hierlock.cc create mode 100644 oflog/libsrc/layout.cc create mode 100644 oflog/libsrc/lloguser.cc create mode 100644 oflog/libsrc/lockfile.cc create mode 100644 oflog/libsrc/log4judp.cc create mode 100644 oflog/libsrc/logevent.cc create mode 100644 oflog/libsrc/logger.cc create mode 100644 oflog/libsrc/logimpl.cc create mode 100644 oflog/libsrc/loglevel.cc create mode 100644 oflog/libsrc/loglog.cc create mode 100644 oflog/libsrc/logmacro.cc create mode 100644 oflog/libsrc/mdc.cc create mode 100644 oflog/libsrc/ndc.cc create mode 100644 oflog/libsrc/ntelogap.cc create mode 100644 oflog/libsrc/nullap.cc create mode 100644 oflog/libsrc/objreg.cc create mode 100644 oflog/libsrc/oflog.cc create mode 100644 oflog/libsrc/patlay.cc create mode 100644 oflog/libsrc/pointer.cc create mode 100644 oflog/libsrc/property.cc create mode 100644 oflog/libsrc/queue.cc create mode 100644 oflog/libsrc/rootlog.cc create mode 100644 oflog/libsrc/sleep.cc create mode 100644 oflog/libsrc/snprintf.cc create mode 100644 oflog/libsrc/sockbuff.cc create mode 100644 oflog/libsrc/socket.cc create mode 100644 oflog/libsrc/socketap.cc create mode 100644 oflog/libsrc/strccloc.cc create mode 100644 oflog/libsrc/strcloc.cc create mode 100644 oflog/libsrc/strhelp.cc create mode 100644 oflog/libsrc/striconv.cc create mode 100644 oflog/libsrc/syncprims.cc create mode 100644 oflog/libsrc/syslogap.cc create mode 100644 oflog/libsrc/threads.cc create mode 100644 oflog/libsrc/timehelp.cc create mode 100644 oflog/libsrc/tls.cc create mode 100644 oflog/libsrc/unixsock.cc create mode 100644 oflog/libsrc/version.cc create mode 100644 oflog/libsrc/winconap.cc create mode 100644 oflog/libsrc/windebap.cc create mode 100644 oflog/libsrc/winsock.cc create mode 100644 oflog/tests/Makefile.dep create mode 100644 oflog/tests/Makefile.in create mode 100644 ofstd/CMakeLists.txt create mode 100644 ofstd/Makefile.in create mode 100755 ofstd/configure create mode 100644 ofstd/data/Makefile.in create mode 100644 ofstd/docs/Makefile.in create mode 100644 ofstd/docs/ofstd.dox create mode 100644 ofstd/etc/Makefile.in create mode 100644 ofstd/include/CMakeLists.txt create mode 100644 ofstd/include/Makefile.in create mode 100644 ofstd/include/dcmtk/ofstd/diag/cnvrsn.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/mmtag.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/nsdfti.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/overflow.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/piof.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/pop.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/push.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/shadow.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/signcmp.def create mode 100644 ofstd/include/dcmtk/ofstd/diag/vsprfw.def create mode 100644 ofstd/include/dcmtk/ofstd/ofalgo.h create mode 100644 ofstd/include/dcmtk/ofstd/ofalign.h create mode 100644 ofstd/include/dcmtk/ofstd/ofassert.h create mode 100755 ofstd/include/dcmtk/ofstd/ofbmanip.h create mode 100644 ofstd/include/dcmtk/ofstd/ofcast.h create mode 100644 ofstd/include/dcmtk/ofstd/ofchrenc.h create mode 100644 ofstd/include/dcmtk/ofstd/ofcmdln.h create mode 100644 ofstd/include/dcmtk/ofstd/ofconapp.h create mode 100644 ofstd/include/dcmtk/ofstd/ofcond.h create mode 100644 ofstd/include/dcmtk/ofstd/ofconfig.h create mode 100644 ofstd/include/dcmtk/ofstd/ofconsol.h create mode 100644 ofstd/include/dcmtk/ofstd/ofcrc32.h create mode 100644 ofstd/include/dcmtk/ofstd/ofdate.h create mode 100644 ofstd/include/dcmtk/ofstd/ofdatime.h create mode 100644 ofstd/include/dcmtk/ofstd/ofdefine.h create mode 100644 ofstd/include/dcmtk/ofstd/ofdiag.h create mode 100644 ofstd/include/dcmtk/ofstd/oferror.h create mode 100644 ofstd/include/dcmtk/ofstd/ofexbl.h create mode 100644 ofstd/include/dcmtk/ofstd/ofexit.h create mode 100644 ofstd/include/dcmtk/ofstd/ofexport.h create mode 100644 ofstd/include/dcmtk/ofstd/offile.h create mode 100644 ofstd/include/dcmtk/ofstd/offilsys.h create mode 100644 ofstd/include/dcmtk/ofstd/offname.h create mode 100644 ofstd/include/dcmtk/ofstd/ofglobal.h create mode 100644 ofstd/include/dcmtk/ofstd/ofgrp.h create mode 100644 ofstd/include/dcmtk/ofstd/oflimits.h create mode 100644 ofstd/include/dcmtk/ofstd/oflist.h create mode 100644 ofstd/include/dcmtk/ofstd/ofmap.h create mode 100644 ofstd/include/dcmtk/ofstd/ofmath.h create mode 100644 ofstd/include/dcmtk/ofstd/ofmem.h create mode 100644 ofstd/include/dcmtk/ofstd/ofoption.h create mode 100644 ofstd/include/dcmtk/ofstd/ofoset.h create mode 100644 ofstd/include/dcmtk/ofstd/ofpwd.h create mode 100644 ofstd/include/dcmtk/ofstd/ofrand.h create mode 100644 ofstd/include/dcmtk/ofstd/ofset.h create mode 100644 ofstd/include/dcmtk/ofstd/ofsetit.h create mode 100644 ofstd/include/dcmtk/ofstd/ofsockad.h create mode 100644 ofstd/include/dcmtk/ofstd/ofstack.h create mode 100644 ofstd/include/dcmtk/ofstd/ofstd.h create mode 100644 ofstd/include/dcmtk/ofstd/ofstdinc.h create mode 100644 ofstd/include/dcmtk/ofstd/ofstream.h create mode 100644 ofstd/include/dcmtk/ofstd/ofstring.h create mode 100644 ofstd/include/dcmtk/ofstd/ofstrutl.h create mode 100644 ofstd/include/dcmtk/ofstd/oftempf.h create mode 100644 ofstd/include/dcmtk/ofstd/oftest.h create mode 100644 ofstd/include/dcmtk/ofstd/ofthread.h create mode 100644 ofstd/include/dcmtk/ofstd/oftime.h create mode 100644 ofstd/include/dcmtk/ofstd/oftimer.h create mode 100644 ofstd/include/dcmtk/ofstd/oftraits.h create mode 100644 ofstd/include/dcmtk/ofstd/oftuple.h create mode 100644 ofstd/include/dcmtk/ofstd/oftypes.h create mode 100644 ofstd/include/dcmtk/ofstd/ofuoset.h create mode 100644 ofstd/include/dcmtk/ofstd/ofutil.h create mode 100644 ofstd/include/dcmtk/ofstd/ofuuid.h create mode 100644 ofstd/include/dcmtk/ofstd/ofvector.h create mode 100644 ofstd/include/dcmtk/ofstd/ofvriant.h create mode 100644 ofstd/include/dcmtk/ofstd/ofxml.h create mode 100644 ofstd/include/dcmtk/ofstd/variadic/helpers.h create mode 100644 ofstd/include/dcmtk/ofstd/variadic/tuple.h create mode 100644 ofstd/include/dcmtk/ofstd/variadic/tuplefrd.h create mode 100644 ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h create mode 100644 ofstd/include/dcmtk/ofstd/variadic/variant.h create mode 100644 ofstd/libsrc/CMakeLists.txt create mode 100644 ofstd/libsrc/Makefile.dep create mode 100644 ofstd/libsrc/Makefile.in create mode 100644 ofstd/libsrc/ofchrenc.cc create mode 100644 ofstd/libsrc/ofcmdln.cc create mode 100644 ofstd/libsrc/ofconapp.cc create mode 100644 ofstd/libsrc/ofcond.cc create mode 100644 ofstd/libsrc/ofconfig.cc create mode 100644 ofstd/libsrc/ofconsol.cc create mode 100644 ofstd/libsrc/ofcrc32.cc create mode 100644 ofstd/libsrc/ofdate.cc create mode 100644 ofstd/libsrc/ofdatime.cc create mode 100644 ofstd/libsrc/oferror.cc create mode 100644 ofstd/libsrc/offile.cc create mode 100755 ofstd/libsrc/offilsys.cc create mode 100644 ofstd/libsrc/offname.cc create mode 100644 ofstd/libsrc/oflist.cc create mode 100644 ofstd/libsrc/ofmath.cc create mode 100644 ofstd/libsrc/ofrand.cc create mode 100644 ofstd/libsrc/ofsockad.cc create mode 100644 ofstd/libsrc/ofstd.cc create mode 100644 ofstd/libsrc/ofstring.cc create mode 100644 ofstd/libsrc/ofstrutl.cc create mode 100644 ofstd/libsrc/oftempf.cc create mode 100644 ofstd/libsrc/ofthread.cc create mode 100644 ofstd/libsrc/oftime.cc create mode 100644 ofstd/libsrc/oftimer.cc create mode 100644 ofstd/libsrc/ofuuid.cc create mode 100644 ofstd/libsrc/ofxml.cc create mode 100644 ofstd/tests/CMakeLists.txt create mode 100644 ofstd/tests/Makefile.dep create mode 100644 ofstd/tests/Makefile.in create mode 100644 ofstd/tests/tatof.cc create mode 100644 ofstd/tests/tbase64.cc create mode 100644 ofstd/tests/tchrenc.cc create mode 100644 ofstd/tests/terror.cc create mode 100644 ofstd/tests/tests.cc create mode 100644 ofstd/tests/tfilsys.cc create mode 100644 ofstd/tests/tftoa.cc create mode 100644 ofstd/tests/tlimits.cc create mode 100644 ofstd/tests/tlist.cc create mode 100644 ofstd/tests/tmap.cc create mode 100644 ofstd/tests/tmarkup.cc create mode 100644 ofstd/tests/tmem.cc create mode 100644 ofstd/tests/tofdatim.cc create mode 100644 ofstd/tests/toffile.cc create mode 100644 ofstd/tests/tofstd.cc create mode 100644 ofstd/tests/toption.cc create mode 100644 ofstd/tests/tstack.cc create mode 100644 ofstd/tests/tstlist.exp create mode 100644 ofstd/tests/tstring.cc create mode 100644 ofstd/tests/tstrutl.cc create mode 100644 ofstd/tests/tthread.cc create mode 100644 ofstd/tests/ttuple.cc create mode 100644 ofstd/tests/tuuid.cc create mode 100644 ofstd/tests/tvariant.cc create mode 100644 ofstd/tests/tvec.cc create mode 100644 ofstd/tests/txml.cc diff --git a/ANNOUNCE b/ANNOUNCE new file mode 100644 index 00000000..f4d40abd --- /dev/null +++ b/ANNOUNCE @@ -0,0 +1,169 @@ +ANNOUNCEMENT + +Version 3.6.5 of the OFFIS DCMTK (DICOM ToolKit) software is now available for +public release. This is a minor release that includes the following changes +over the previous version 3.6.4: + +- DCMTK 3.6.5 builds correctly on older and up-to-date versions of GNU gcc + (4.4.7 to 9.2.0), Clang (3.4.2 to 9.0.0), AppleClang (11.0.0), Microsoft + Visual Studio (2008 to 2019), SunPro CC (5.14 and 5.15) and IBM XL C/C++ + (16.1.1.3). + +- Tested with the following operating systems/environments: + + - Android on arm64 + - Cygwin on x86_64 + - FreeBSD on x86_64 + - Linux on x86_64 and x86 + - MacOS X on x86_64 + - NetBSD on x86_64 + - OpenBSD on x86_64 + - OpenIndiana on x86 + - Solaris on x86 + - Windows (and MinGW) on x86_64 and x86 + + For a complete list of tested systems and compilers, see the INSTALL file. + +- GNU Autoconf is still deprecated, running 'configure' emits a warning by + default. Support for GNU Autoconf will be removed after this release. + +- Updated data dictionary, SOP Class, Frame of Reference and Transfer Syntax + UIDs for the recently approved changes to the DICOM standard (i.e. Supplements + and CPs), up to DICOM standard release DICOM 2019c plus Supplement 175 (Second + Generation Radiotherapy - C-Arm RT Treatment Modalities). + +- Added support for directory record "RADIOTHERAPY" that has been introduced + with Supplement 147 (Second Generation Radiotherapy - Prescription and Segment + Annotation). + +- Added support for the three new 64-bit integer VRs introduced with CP-1819: + Other 64-bit Very Long (OV), Signed 64-bit Very Long (SV) and Unsigned 64-bit + Very Long (UV). + +- Implemented support for the Extended BCP 195 TLS Profile, introduced with + Supplement 206, in the dcmtls module and the various TLS-enabled DCMTK tools. + +- Added option to "storescu" to rename files after processing them by appending + ".bad" or ".good" at the end of the filename. + +- Added new options to "wlmscpfs" that allow for dumping incoming C-FIND + requests to text files using a configurable directory and filename. + +- Updated automatically generated Context Group classes in "dcmsr" + (Structured Reporting) based on DICOM 2019c. Also updated the Code + definitions from the supported coding schemes such as DICOM, NCIt and UMLS. + +- Further enhanced DICOM Structured Reporting (SR) module "dcmsr": + + - Added support for the Performed Imaging Agent Administration SR IOD and the + Planned Imaging Agent Administration SR IOD introduced with Supplement 164. + + - Added support for the Synchronization Module, which is required for some SR + IODs, e.g. Procedure Log SR or Performed Imaging Agent Administration SR. + + - Added initial support for coding scheme "SCT" (SNOMED CT) by defining those + CODE_SCT_xxx code constants that are needed for the "cmr" submodule. + + - Updated SR Template classes from DCMR for the 2019b edition of the DICOM + standard, i.e. all SRT (SNOMED RT) codes were replaced by their associated + SCT (SNOMED CT) counterparts. This change was introduced with CP-1850. + + - Added new print flag PF_printEmptyCodes, which prints the text "empty code" + for empty codes instead of "invalid code". This new flag is e.g. used for + the output stream operator of the DSRCodedEntryValue class. + +- The list of elliptic curves to be negotiated as part of a TLS is now created + dynamically, i.e. it is tested at runtime which elliptic curves are supported + by the installed OpenSSL library. + +- Allow disabling Functional Group checks when writing Segmentations and + Parametric Map objects in order to speed up writing objects with many frames. + +- Added macro that enables the wide char (wchar_t*) support of the XML parser + that is part of the DCMTK (ofstd/ofxml). This support is limited to Windows + systems and still regarded as experimental (see documentation for details). + +- The tool "findscu" now always returns with a non-zero exit code when an error + occurred, e.g. when association negotiation failed. + +- CMake-related enhancements: + + - DCMTK now understands and makes use of the CMake variable CMAKE_CXX_STANDARD + when a CMake version that supports it is employed (CMake 3.1.3 and newer). + + - Added CMake option that controls whether DCMTK gets compiled using the + multi-threaded static or DLL runtime library when using MSVC on Windows. + +- Various fixes and extensions to the JPEG-LS implementation: + + - Added command line options controlling how odd-length bitstreams are + padded to even length (for compatibility with HP LOCO). + + - Added command line option that causes the decoder to store images even + though an error occurred during the decoding process, which may be helpful + for slightly truncated bitstreams. + + - Enable setting of individual JPEG-LS encoding parameters + T1, T2, T3 and RESET. + + - Various bugfixes in JPEG-LS encoder and decoder. + +- Fixed binary Segmentation object creation when width is not dividable by 8. + +- Fixed wrong DIMSE status codes A8xx (for C-STORE and C-FIND) and A800 (for + C-GET and C-MOVE), which were never defined in the official DICOM standard. + Now, the DCMTK uses the correct DIMSE status code 0122H for "SOP Class not + supported" for all DIMSE messages. + +- Fixed various issues that occurred after the official 3.6.4 release. + See CHANGES file for details. + + +Many people have contributed to this new release of DCMTK, appearing here in +alphabetical order. Thank you very much for your support! + + Victor Derks + Chinna Durai + Holger Franke + Sergei Gordey + Daniel Grieger + Bengt Gustafsson + Alexander Haderer + Peter Klotz + Brian Lucas + Mathieu Malaterre + Hans Meine + Maria Samoylova + Martin Wenger + Brian Wise + Grischa Zengel + + Andreas Gravgaard Andersen (GitHub user "agravgaard") + Hans Johnson (GitHub user "hjmjohnson") + Stefano Magni + + Forum user "AlexanderLysenko" + GitHub user "eborisch" + GitHub user "FreddyFunk" + +Members of the DCMTK Team who have worked on this release are +(in alphabetical order): + + Pedro Arizpe Gomez + Marco Eichelberg + Michael Onken + Joerg Riesmeier + Jan Schlamelcher + +Student associates: + + Nikolas Goldhammer + +Also see CREDITS file for projects and companies who have been generously +supporting DCMTK. + +The DCMTK software can be downloaded via: + + https://dicom.offis.de/dcmtk or https://www.dcmtk.org/ + +OFFIS e.V., Oldenburg, Germany, 2019-10-28 diff --git a/CHANGES b/CHANGES new file mode 100644 index 00000000..b7fc0655 --- /dev/null +++ b/CHANGES @@ -0,0 +1,12 @@ + +In earlier versions of DCMTK, changes between releases had been documented in a +CHANGES.XXX file inside DCMTK's main directory. + +Now, the CHANGES.XXX file has been moved to the dcmtk/doc folder with the latest +one being updated every time that a new DCMTK version is released. Thus it +always contains all DCMTK changes between the last DCMTK release and the most +recent one. + +For very recent changes, i. e. those changes to DCMTK that have been applied +after the most recent release, see the DCMTK git repository log at +http://git.dcmtk.org/ . diff --git a/CMake/3rdparty.cmake b/CMake/3rdparty.cmake new file mode 100644 index 00000000..4a388aaf --- /dev/null +++ b/CMake/3rdparty.cmake @@ -0,0 +1,411 @@ +if(WIN32 AND NOT MINGW) + + # For Windows, we don't used FIND_PACKAGE because DCMTK usually is used with its + # own set of 3rd-party support libraries that can be downloaded from DCMTK's + # website (pre-built). + + # libxml support: find out whether user has library + file(GLOB LIBXML_DIR "${DCMTK_SOURCE_DIR}/../libxml2*") + find_path(WITH_LIBXMLINC "/include/libxml/parser.h" "${LIBXML_DIR}" NO_DEFAULT_PATH) + + # libpng support: find out whether user has library + file(GLOB LIBPNG_DIR "${DCMTK_SOURCE_DIR}/../libpng*") + find_path(WITH_LIBPNGINC "include/png.h" "${LIBPNG_DIR}" NO_DEFAULT_PATH) + + # libtiff support: find out whether user has library + file(GLOB LIBTIFF_DIR "${DCMTK_SOURCE_DIR}/../libtiff*") + find_path(WITH_LIBTIFFINC "include/tiff.h" "${LIBTIFF_DIR}" NO_DEFAULT_PATH) + + # OpenSSL support: find out whether user has library + file(GLOB OPENSSL_DIR "${DCMTK_SOURCE_DIR}/../openssl*") + find_path(WITH_OPENSSLINC "include/openssl/ssl.h" "${OPENSSL_DIR}" NO_DEFAULT_PATH) + + # zlib support: find out whether user has library + file(GLOB ZLIB_DIR "${DCMTK_SOURCE_DIR}/../zlib*") + find_path(WITH_ZLIBINC "include/zlib.h" "${ZLIB_DIR}" NO_DEFAULT_PATH) + + # sndfile support: find out whether user has library. Needed for module dcmwave (not in public DCMTK yet, marked as advanced) + file(GLOB SNDFILE_DIR "${DCMTK_SOURCE_DIR}/../libsndfile*") + find_path(WITH_SNDFILEINC "sndfile.h" "${SNDFILE_DIR}" NO_DEFAULT_PATH) + mark_as_advanced(SNDFILE_DIR WITH_SNDFILEINC) + + # libiconv support: find out whether user has library + file(GLOB LIBICONV_DIR "${DCMTK_SOURCE_DIR}/../libiconv*") + find_path(WITH_LIBICONVINC "include/iconv.h" "${LIBICONV_DIR}" NO_DEFAULT_PATH) + + # OpenJPEG support: find out whether user has library + file(GLOB OPENJPEG_DIR "${DCMTK_SOURCE_DIR}/../openjpeg*") + find_path(WITH_OPENJPEGINC "lib/openjp2_o.lib" "${OPENJPEG_DIR}" NO_DEFAULT_PATH) + + # libxml support: configure compiler + if(DCMTK_WITH_XML) + if(WITH_LIBXMLINC) + set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") + set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") + set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) + # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly + add_definitions("-DLIBXML_STATIC") + else() # turn off library if library path not set + message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") + set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) + set(WITH_LIBXML "") + endif() + endif() + + # libpng support: configure compiler + if(DCMTK_WITH_PNG) + if(WITH_LIBPNGINC) + set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") + set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") + set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + else() # turn off library if library path not set + message(STATUS "Warning: PNG support will be disabled because libpng directory was not specified. Correct path and re-enable DCMTK_WITH_PNG.") + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + set(WITH_LIBPNG "") + endif() + endif() + + # libtiff support: configure compiler + if(DCMTK_WITH_TIFF) + if(WITH_LIBTIFFINC) + set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") + set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") + set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") + message(STATUS "Info: DCMTK TIFF support will be enabled") + set(WITH_LIBTIFF 1) + else() # turn off library if library path not set + message(STATUS "Warning: TIFF support will be disabled because libtiff directory was not specified. Correct path and re-enable DCMTK_WITH_TIFF.") + set(DCMTK_WITH_TIFF OFF CACHE BOOL "" FORCE) + set(WITH_LIBTIFF "") + endif() + endif() + + # OpenSSL support: configure compiler + if(DCMTK_WITH_OPENSSL) + if(WITH_OPENSSLINC) + include(CheckCXXSourceCompiles) + set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") + set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") + set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") + # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. + set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) + set(CMAKE_REQUIRED_INCLUDES "${TEMP_INCLUDES}") + if(OPENSSL_VERSION_CHECK) + message(STATUS "Info: DCMTK OPENSSL support will be enabled") + set(WITH_OPENSSL 1) + else() + message(STATUS "Info: DCMTK OPENSSL support will be disabled: DCMTK requires OpenSSL version 1.0.1 or newer") + set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE) + set(WITH_OPENSSL "") + endif() + else() # turn off library if library path not set + message(STATUS "Warning: OPENSSL support will be disabled because openssl directory was not specified. Correct path and re-enable DCMTK_WITH_OPENSSL.") + set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE) + set(WITH_OPENSSL "") + endif() + endif() + + # zlib support: configure compiler + if(DCMTK_WITH_ZLIB) + if(WITH_ZLIBINC) + set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") + set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") + set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + else() # turn off library if library path not set + message(STATUS "Warning: ZLIB support will be disabled because zlib directory was not specified. Correct path and re-enable DCMTK_WITH_ZLIB.") + set(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE) + set(WITH_ZLIB "") + endif() + endif() + + # sndfile support: configure compiler + if(DCMTK_WITH_SNDFILE) + if(WITH_SNDFILEINC) + set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") + set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") + set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) + else() # turn off library if library path not set + message(STATUS "Warning: SNDFILE support will be disabled because libsndfile directory was not specified. Correct path and re-enable DCMTK_WITH_SNDFILE.") + set(DCMTK_WITH_SNDFILE OFF CACHE BOOL "" FORCE) + set(WITH_SNDFILE "") + endif() + endif() + + # libiconv support: configure compiler + if(DCMTK_WITH_ICONV) + if(WITH_LIBICONVINC) + set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") + set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") + set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + else() # turn off library if library path not set + message(STATUS "Warning: ICONV support will be disabled because libiconv directory was not specified. Correct path and re-enable DCMTK_WITH_ICONV.") + set(DCMTK_WITH_ICONV OFF CACHE BOOL "" FORCE) + set(WITH_LIBICONV "") + endif() + endif() + + # OpenJPEG support: configure compiler + if(DCMTK_WITH_OPENJPEG) + if(WITH_OPENJPEGINC) + # Unfortunately, OpenJPEG uses a version number in the include path. This needs special handling. + file(GLOB OPENJPEG2_DIR "${WITH_OPENJPEGINC}/include/openjpeg*") + find_path(WITH_OPENJPEGINC1 "openjpeg.h" "${OPENJPEG2_DIR}" NO_DEFAULT_PATH) + if ("${WITH_OPENJPEGINC1}" STREQUAL "WITH_OPENJPEGINC1-NOTFOUND") + message(STATUS "Info: DCMTK OpenJPEG support will be disabled because the header files were not found.") + set(DCMTK_WITH_OPENJPEG OFF CACHE BOOL "" FORCE) + set(WITH_OPENJPEG "") + else() + set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") + set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") + set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) + endif() + else() # turn off library if library path not set + message(STATUS "Warning: OpenJPEG support will be disabled because openjpeg directory was not specified. Correct path and re-enable DCMTK_WITH_OPENJPEG.") + set(DCMTK_WITH_OPENJPEG OFF CACHE BOOL "" FORCE) + set(WITH_OPENJPEG "") + endif() + endif() + +else(WIN32 AND NOT MINGW) + + # Find TIFF + if(DCMTK_WITH_TIFF) + find_package(TIFF QUIET) + # turn off library if it could not be found + if(NOT TIFF_FOUND) + message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") + set(DCMTK_WITH_TIFF OFF CACHE BOOL "" FORCE) + set(WITH_LIBTIFF "") + else() + set(WITH_LIBTIFF 1) + # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path + find_package(JPEG QUIET) + if(NOT JPEG_FOUND) + message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") + include_directories(${TIFF_INCLUDE_DIR}) + else() + message(STATUS "Info: DCMTK TIFF support will be enabled") + include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) + endif() + set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY}) + endif() + endif() + + # Find PNG + if(DCMTK_WITH_PNG) + find_package(PNG QUIET) + if(NOT PNG_FOUND) + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + message(STATUS "Warning: PNG support will be disabled because libpng was not found.") + set(WITH_LIBPNG "") + else() + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + include_directories(${PNG_INCLUDE_DIR}) + set(LIBPNG_LIBS ${PNG_LIBRARY}) + endif() + endif() + + # Find OpenSSL + if(DCMTK_WITH_OPENSSL) + find_package(OpenSSL QUIET) + if(NOT OPENSSL_FOUND) + message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") + set(WITH_OPENSSL "") + set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE) + else() + include(CheckLibraryExists) + include(CheckCXXSourceCompiles) + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) + set(CMAKE_REQUIRED_INCLUDES "${TEMP_INCLUDES}") + if(OPENSSL_VERSION_CHECK) + message(STATUS "Info: DCMTK OPENSSL support will be enabled") + set(WITH_OPENSSL 1) + include_directories(${OPENSSL_INCLUDE_DIR}) + set(OPENSSL_LIBS ${OPENSSL_LIBRARIES}) + CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL) + if(HAVE_LIBDL) + set(OPENSSL_LIBS ${OPENSSL_LIBS} dl) + endif() + else() + message(STATUS "Info: DCMTK OPENSSL support will be disabled: DCMTK requires OpenSSL version 1.0.1 or newer") + set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE) + set(WITH_OPENSSL "") + endif() + endif() + endif() + + # Find libXML2 + if(DCMTK_WITH_XML) + find_package(LibXml2 QUIET) + if(NOT LIBXML2_FOUND) + message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") + set(WITH_LIBXML "") + set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) + else() + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) + include_directories(${LIBXML2_INCLUDE_DIR}) + set(LIBXML_LIBS ${LIBXML2_LIBRARIES}) + endif() + endif() + + # Find zlib + if(DCMTK_WITH_ZLIB) + find_package(ZLIB QUIET) + if(NOT ZLIB_FOUND) + message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") + set(WITH_ZLIB "") + set(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE) + else() + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + include_directories(${ZLIB_INCLUDE_DIRS}) + set(ZLIB_LIBS ${ZLIB_LIBRARIES}) + endif() + endif() + + # Find libsndfile + if(DCMTK_WITH_SNDFILE) + find_package(Sndfile QUIET) + if(NOT SNDFILE_LIBS) + message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") + set(WITH_SNDFILE "") + set(DCMTK_WITH_SNDFILE OFF CACHE BOOL "" FORCE) + else() + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) + include_directories(${SNDFILE_INCLUDE_DIRS}) + set(SNDFILE_LIBS ${SNDFILE_LIBRARIES}) + endif() + endif() + + # Find libiconv + if(DCMTK_WITH_ICONV) + find_package(Iconv QUIET) + find_package(Charset QUIET) + if(ICONV_FOUND) + if(NOT Iconv_IS_BUILT_IN) + set(LIBICONV_FOUND ${ICONV_FOUND}) + else() + message(STATUS "Info: found builtin ICONV support inside the C standard library.") + set(DCMTK_WITH_STDLIBC_ICONV ON CACHE BOOL "" FORCE) + endif() + if(DEFINED ICONV_SECOND_ARGUMENT_IS_CONST) + get_property(HELPSTRING CACHE ICONV_SECOND_ARGUMENT_IS_CONST PROPERTY HELPSTRING) + set(LIBICONV_SECOND_ARGUMENT_CONST ${ICONV_SECOND_ARGUMENT_IS_CONST} CACHE INTERNAL "${HELPSTRING}") + endif() + endif() + if(NOT LIBICONV_FOUND OR NOT LIBCHARSET_FOUND) + message(STATUS "Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.") + set(DCMTK_WITH_ICONV OFF CACHE BOOL "" FORCE) + set(WITH_LIBICONV "") + else() + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) + set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) + set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) + include_directories(${LIBICONV_INCDIR}) + endif() + endif() + + # Find libwrap + if(DCMTK_WITH_WRAP) + find_package(Wrap QUIET) + if(NOT WRAP_FOUND) + message(STATUS "Warning: WRAP support will be disabled because libwrap was not found.") + set(WITH_TCPWRAPPER "") + set(DCMTK_WITH_WRAP OFF CACHE BOOL "" FORCE) + else() + message(STATUS "Info: DCMTK WRAP support will be enabled") + set(WITH_TCPWRAPPER 1) + include_directories(${WRAP_INCLUDE_DIRS}) + set(WRAP_LIBS ${WRAP_LIBRARIES}) + endif() + endif() + + # Find OpenJPEG + if(DCMTK_WITH_OPENJPEG) + find_package(OpenJPEG QUIET) + if(NOT OPENJPEG_FOUND) + message(STATUS "Warning: OpenJPEG support will be disabled because the OpenJPEG library was not found.") + set(WITH_OPENJPEG "") + set(DCMTK_WITH_OPENJPEG OFF CACHE BOOL "" FORCE) + else() + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) + include_directories(${OPENJPEG_INCLUDE_DIRS}) + set(OPENJPEG_LIBS ${OPENJPEG_LIBRARIES}) + endif() + endif() + +endif(WIN32 AND NOT MINGW) + +if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) + include(CheckCXXSourceCompiles) + CHECK_CXX_SOURCE_COMPILES("#include \nint main(){iconv_t cd = iconv_open(\"\",\"\");iconv(cd,0,0,0,0);iconv_close(cd);return 0;}" WITH_STDLIBC_ICONV) + if(WITH_STDLIBC_ICONV) + message(STATUS "Info: found builtin ICONV support inside the C standard library.") + set(DCMTK_WITH_STDLIBC_ICONV ON CACHE BOOL "" FORCE) + else() + set(DCMTK_WITH_STDLIBC_ICONV OFF CACHE BOOL "" FORCE) + endif() +endif() + +if(DCMTK_WITH_ICU) + find_package(ICU COMPONENTS uc data QUIET) + if(NOT ICU_FOUND) + message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") + set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) + set(WITH_ICU "") + else() + message(STATUS "Info: DCMTK ICU support will be enabled") + set(WITH_ICU 1) + set(ICU_INCDIR ${ICU_INCLUDE_DIR}) + set(ICU_LIBS ${ICU_LIBRARIES}) + include_directories(${ICU_INCLUDE_DIR}) + endif() +endif() + +# Find doxygen +if(DCMTK_WITH_DOXYGEN) + find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE + if(NOT DOXYGEN_FOUND) + message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") + set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) + endif() +endif() + +if(DCMTK_WITH_ICONV OR DCMTK_WITH_STDLIBC_ICONV) + include(CheckCXXSourceCompiles) + set(CMAKE_REQUIRED_INCLUDES ${LIBICONV_INCDIR}) + set(CMAKE_REQUIRED_LIBRARIES ${LIBICONV_LIBS}) + CHECK_CXX_SOURCE_COMPILES(" + #include + int main() { + iconv_t cd = 0; + const char *in = 0; + iconv(cd, &in, 0, 0, 0); + return 0; + }" LIBICONV_SECOND_ARGUMENT_CONST) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) +endif() diff --git a/CMake/CTest/CTestCustomAndroid.cmake.in b/CMake/CTest/CTestCustomAndroid.cmake.in new file mode 100644 index 00000000..4e738fd7 --- /dev/null +++ b/CMake/CTest/CTestCustomAndroid.cmake.in @@ -0,0 +1,98 @@ +# +# This file is run prior to the unit tests for preparing the testing +# environment. Currently only required / necessary for running the +# tests on the Android device emulator. +# + +# Restore the required settings of the CMake configuration step +cmake_minimum_required(VERSION 2.6) +set(CMAKE_COMMAND "@CMAKE_COMMAND@") +set(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") +set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_BINARY_DIR@") +set(CMAKE_FILES_DIRECTORY "@CMAKE_FILES_DIRECTORY@") +set(CMAKE_MODULE_PATH "@CMAKE_ROOT@/Modules") +set(CMAKE_SHARED_LIBRARY_PREFIX "@CMAKE_SHARED_LIBRARY_PREFIX@") +set(CMAKE_SHARED_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@") +set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@") +set(DCMTK_CMAKE_INCLUDE "@CMAKE_SOURCE_DIR@/@DCMTK_CMAKE_INCLUDE@") +set(DCMTK_TEST_EXECUTABLES "@DCMTK_TEST_EXECUTABLES@") +set(DCMTK_ALL_LIBRARIES "@DCMTK_ALL_LIBRARIES@") +set(DCMTK_LIBRARY_DEPENDENCIES "@DCMTK_LIBRARY_DEPENDENCIES@") +set(DCMTK_PACKAGE_VERSION "@DCMTK_PACKAGE_VERSION@") +set(DCMTK_ABI_VERSION "@DCMTK_ABI_VERSION@") +set(BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@") +set(DCMTK_DICOM_DICTIONARIES "@DCMTK_DICOM_DICTIONARIES@") +set(ANDROID "@ANDROID@") +set(ANDROID_ADB_PROGRAM "@ANDROID_ADB_PROGRAM@") +set(ANDROID_ANDROID_PROGRAM "@ANDROID_ANDROID_PROGRAM@") +set(ANDROID_EMULATOR_PROGRAM "@ANDROID_EMULATOR_PROGRAM@") +set(ANDROID_EMULATOR_AVD "@ANDROID_EMULATOR_AVD@") +set(ANDROID_RUNTIME_LIBRARIES "@ANDROID_RUNTIME_LIBRARIES@") +set(ANDROID_TEMPORARY_FILES_LOCATION "@ANDROID_TEMPORARY_FILES_LOCATION@") +# Emulate some required CMake commands while running inside CTest +include(${DCMTK_CMAKE_INCLUDE}CMake/CTest/dcmtkCTestMacros.cmake) +# For DCMTK_UNSET_XXX +include(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkMacros.cmake) +# Load required functions for controlling the Android device emulator +include(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake) + +# Prepare the Android testing environment +# Prepare the emulator +DCMTK_ANDROID_START_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE) +DCMTK_ANDROID_WAIT_FOR_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE) + +# Get the emulator's name for emitting a shutdown command when done +DCMTK_ANDROID_GET_OBJECT_PROPERTIES(DCMTK_ANDROID_EMULATOR_INSTANCE) +DCMTK_ANDROID_STOP_EMULATOR_COMMAND(STOP_EMULATOR "${EMULATOR_NAME}") +DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE(STOP_MESSAGE) +# Note: no quotation marks around STOP_MESSAGE, since it contains the message +# and the message type (e.g. STATUS) +MESSAGE_COMMAND(STOP_MESSAGE ${STOP_MESSAGE}) +# CTEST_CUSTOM_POST_TESTS executes a sequence of 'non CMake' commands separated +# by ';' characters. Therefore the sequence a single command consists of must +# be translated appropriately first +string(REPLACE ";" " " STOP_EMULATOR "${STOP_EMULATOR}") +string(REPLACE ";" " " STOP_MESSAGE "${STOP_MESSAGE}") +# Register the cleanup hooks +set(CTEST_CUSTOM_POST_TEST "${STOP_MESSAGE}" "${STOP_EMULATOR}") + +# Set the current emulator instance handle via an environment variable +set(ENV{DCMTK_ANDROID_EMULATOR_INSTANCE} "${DCMTK_ANDROID_EMULATOR_INSTANCE}") + +# Collect the list of required libraries +if(BUILD_SHARED_LIBS) + foreach(LIBRARY ${DCMTK_ALL_LIBRARIES}) + list(APPEND DCMTK_CREATED_SHARED_LIBRARIES "${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}.${DCMTK_PACKAGE_VERSION}") + endforeach() +endif() + +# Transmit the required executables, libraries and dictionaries to the emulator +DCMTK_ANDROID_PUSH(DCMTK_ANDROID_EMULATOR_INSTANCE + ${ANDROID_RUNTIME_LIBRARIES} + ${DCMTK_LIBRARY_DEPENDENCIES} + ${DCMTK_CREATED_SHARED_LIBRARIES} + ${DCMTK_TEST_EXECUTABLES} + ${DCMTK_DICOM_DICTIONARIES} + DESTINATION ${ANDROID_TEMPORARY_FILES_LOCATION} +) + +# Set executable permissions +foreach(TEST_EXECUTABLE ${DCMTK_TEST_EXECUTABLES}) + get_filename_component(NAME "${TEST_EXECUTABLE}" NAME) + DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE + COMMAND chmod 755 "${ANDROID_TEMPORARY_FILES_LOCATION}/${NAME}" + OUTPUT_QUIET + ERROR_QUIET + ) +endforeach() + +# Create necessary softlinks +if(BUILD_SHARED_LIBS) + foreach(LIBRARY ${DCMTK_ALL_LIBRARIES}) + DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE + COMMAND ln -s "./${CMAKE_SHARED_LIBRARY_PREFIX}${LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}.${DCMTK_PACKAGE_VERSION}" "${ANDROID_TEMPORARY_FILES_LOCATION}/${CMAKE_SHARED_LIBRARY_PREFIX}${LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}.${DCMTK_ABI_VERSION}" + OUTPUT_QUIET + ERROR_QUIET + ) + endforeach() +endif() diff --git a/CMake/CTest/CTestCustomWine.cmake.in b/CMake/CTest/CTestCustomWine.cmake.in new file mode 100644 index 00000000..12b40a36 --- /dev/null +++ b/CMake/CTest/CTestCustomWine.cmake.in @@ -0,0 +1,17 @@ +# +# This file ensures that the wineserver is spawned before running the unit +# tests, such that CTest will not attach itself to it. This is an ugly hack +# workaround, but what can you do? +# + +set(ENV{WINEPREFIX} "@DCMTK_WINEPREFIX@") +set(ENV{DCMDICTPATH} "@DCMDICTPATH@") +set(WINE_WINE_PROGRAM "@WINE_WINE_PROGRAM@") + +# spawn the winserver using 'cmd /C call' -> effectively NOP +# spawn it using 'sh', such that this script does not attach itself to it. +execute_process(COMMAND + sh -c "\"${WINE_WINE_PROGRAM}\" cmd /C call" + OUTPUT_FILE "/dev/null" + ERROR_FILE "/dev/null" +) diff --git a/CMake/CTest/dcmtkCTestMacros.cmake b/CMake/CTest/dcmtkCTestMacros.cmake new file mode 100644 index 00000000..3a4f1bca --- /dev/null +++ b/CMake/CTest/dcmtkCTestMacros.cmake @@ -0,0 +1,27 @@ +# +# This file "re-implements" some of CMake's functionality +# that is missing inside CTest. +# + +macro(MESSAGE_COMMAND VAR MODE) + if(${MODE} STREQUAL "STATUS") + set(${VAR} ${CMAKE_COMMAND} -E echo -- ${ARGN}) + elseif(${MODE} STREQUAL "WARNING") + set(${VAR} ${CMAKE_COMMAND} -E echo WARNING: ${ARGN}) + elseif(${MODE} STREQUAL "AUTHOR_WARNING") + set(${VAR} ${CMAKE_COMMAND} -E echo Warning: ${ARGN}) + elseif(${MODE} STREQUAL "SEND_ERROR") + set(${VAR} ${CMAKE_COMMAND} -E echo Error: ${ARGN}) + elseif(${MODE} STREQUAL "FATAL_ERROR") + set(${VAR} ${CMAKE_COMMAND} -E echo ERROR: ${ARGN}) + elseif(${MODE} STREQUAL "DEPRECATION") + set(${VAR} ${CMAKE_COMMAND} -E echo ${ARGN}) + else() + set(${VAR} ${CMAKE_COMMAND} -E echo ${MODE} ${ARGN}) + endif() +endmacro() + +function(MESSAGE) + MESSAGE_COMMAND(COMMAND ${ARGN}) + execute_process(COMMAND ${COMMAND}) +endfunction() diff --git a/CMake/CTest/dcmtkCTestRun.cmake.in b/CMake/CTest/dcmtkCTestRun.cmake.in new file mode 100644 index 00000000..7b1a3da4 --- /dev/null +++ b/CMake/CTest/dcmtkCTestRun.cmake.in @@ -0,0 +1,18 @@ +# +# This file is used to executed given unit test commands locally, handling +# additional arguments like 'exhaustive' and setting the DCMDICTPATH +# environment variable appropriately. +# + +set(ENV{DCMDICTPATH} "@DCMDICTPATH@") + +execute_process(COMMAND + "${DCMTK_CTEST_TESTCASE_COMMAND}" $ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "${DCMTK_CTEST_TEST_NAME}" + RESULT_VARIABLE RESULT +) + +# We cannot forward the result value to CMake, so print it instead and let CMake +# return with code '1' or whatever it deems appropriate to notify about an error. +if(RESULT) + message(FATAL_ERROR "Test command returned: ${RESULT}") +endif() diff --git a/CMake/CTest/dcmtkCTestRunAndroid.cmake.in b/CMake/CTest/dcmtkCTestRunAndroid.cmake.in new file mode 100644 index 00000000..02033739 --- /dev/null +++ b/CMake/CTest/dcmtkCTestRunAndroid.cmake.in @@ -0,0 +1,33 @@ +# +# This file is used to executed given unit test commands on a previously +# initialize Android device emulator instance, handling additional arguments +# like 'exhaustive' and setting the DCMDICTPATH environment variable +# appropriately. +# + +# Restore the required settings of the CMake configuration step +set(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") +set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_BINARY_DIR@") +set(CMAKE_FILES_DIRECTORY "@CMAKE_FILES_DIRECTORY@") +set(DCMTK_CMAKE_INCLUDE "@CMAKE_SOURCE_DIR@/@DCMTK_CMAKE_INCLUDE@") +set(DCMDICTPATH "@DCMDICTPATH@") +set(ANDROID_ADB_PROGRAM "@ANDROID_ADB_PROGRAM@") +set(ANDROID_TEMPORARY_FILES_LOCATION "@ANDROID_TEMPORARY_FILES_LOCATION@") +# Load required functions for controlling the Android device emulator +include(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake) + +# Restore the Android device emulator instance handle +set(DCMTK_ANDROID_EMULATOR_INSTANCE "$ENV{DCMTK_ANDROID_EMULATOR_INSTANCE}") + +# Run the actual testcase on the remote device +DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE + COMMAND "LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${ANDROID_TEMPORARY_FILES_LOCATION}" "DCMDICTPATH=${DCMDICTPATH}" "${DCMTK_CTEST_TESTCASE_COMMAND}" $ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "${DCMTK_CTEST_TEST_NAME}" + WORKING_DIRECTORY "${ANDROID_TEMPORARY_FILES_LOCATION}" + RESULT_VARIABLE RESULT +) + +# We cannot forward the result value to CTest, so print it instead and let CMake +# return with code '1' or whatever it deems appropriate to notify about an error. +if(RESULT) + message(FATAL_ERROR "Test command returned: ${RESULT}") +endif() diff --git a/CMake/CTest/dcmtkCTestRunExhaustive.cmake b/CMake/CTest/dcmtkCTestRunExhaustive.cmake new file mode 100644 index 00000000..b33145fa --- /dev/null +++ b/CMake/CTest/dcmtkCTestRunExhaustive.cmake @@ -0,0 +1,6 @@ +# +# this file is used to execute the unit tests with the -x option injected +# + +set(ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "-x") +execute_process(COMMAND ${CMAKE_CTEST_COMMAND} -C "${CONFIG}") diff --git a/CMake/CTest/dcmtkCTestRunWine.cmake.in b/CMake/CTest/dcmtkCTestRunWine.cmake.in new file mode 100644 index 00000000..12a3489c --- /dev/null +++ b/CMake/CTest/dcmtkCTestRunWine.cmake.in @@ -0,0 +1,23 @@ +# +# This file is used to executed given unit test commands using wine, handling +# additional arguments like 'exhaustive' and setting the DCMDICTPATH +# environment variable appropriately. It uses the prepared wineprefix to +# load the MinGW C++ runtime (stdc++.dll etc.) and helps to detach the +# wineserver process from CTest such that it does not hang waiting for it to +# shutdown. +# + +set(ENV{WINEPREFIX} "@DCMTK_WINEPREFIX@") +set(ENV{DCMDICTPATH} "@DCMDICTPATH@") +set(WINE_WINE_PROGRAM "@WINE_WINE_PROGRAM@") + +execute_process(COMMAND + "${WINE_WINE_PROGRAM}" "${DCMTK_CTEST_TESTCASE_COMMAND}" $ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "${DCMTK_CTEST_TEST_NAME}" + RESULT_VARIABLE RESULT +) + +# We cannot forward the result value to CMake, so print it instead and let CMake +# return with code '1' or whatever it deems appropriate to notify about an error. +if(RESULT) + message(FATAL_ERROR "Test command returned: ${RESULT}") +endif() diff --git a/CMake/CheckCMakeCommandExists.cmake b/CMake/CheckCMakeCommandExists.cmake new file mode 100644 index 00000000..f73125b2 --- /dev/null +++ b/CMake/CheckCMakeCommandExists.cmake @@ -0,0 +1,12 @@ +# Helper macro that checks whether a given CMake command exists or not +macro(CHECK_CMAKE_COMMAND_EXISTS commandname) + message(STATUS "Looking for CMake command ${commandname}") + string(TOUPPER ${commandname} commandname_upper) + if(COMMAND ${commandname}) + set(HAVE_${commandname_upper} TRUE) + message(STATUS "Looking for CMake command ${commandname} - found") + else() + set(HAVE_${commandname_upper} FALSE) + message(STATUS "Looking for CMake command ${commandname} - not found") + endif() +endmacro() diff --git a/CMake/CheckFunctionWithHeaderExists.cmake b/CMake/CheckFunctionWithHeaderExists.cmake new file mode 100644 index 00000000..f22f56a2 --- /dev/null +++ b/CMake/CheckFunctionWithHeaderExists.cmake @@ -0,0 +1,57 @@ +# +# Check if the symbol exists in include files +# +# CHECK_FUNCTIONWITHHEADER_EXISTS - macro which checks the symbol exists in include files. +# SYMBOL - symbol +# FILES - include files to check +# VARIABLE - variable to return result +# ... - additional arguments will be interpreted as additional libraries to link during testing. +# + +macro(CHECK_FUNCTIONWITHHEADER_EXISTS SYMBOL FILES VARIABLE) + if(NOT DEFINED "${VARIABLE}") + set(CHECK_SYMBOL_EXISTS_CONTENT "/* */\n") + set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) + if(CMAKE_REQUIRED_LIBRARIES) + set(CHECK_SYMBOL_EXISTS_LIBS + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES};${ARGN}") + endif() + foreach(FILE ${FILES}) + set(CHECK_SYMBOL_EXISTS_CONTENT + "${CHECK_SYMBOL_EXISTS_CONTENT}#include <${FILE}>\n") + endforeach() + set(CHECK_SYMBOL_EXISTS_CONTENT + "${CHECK_SYMBOL_EXISTS_CONTENT}\nint main()\n{\n${SYMBOL};return 0;\n}\n") + + file(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.cxx + "${CHECK_SYMBOL_EXISTS_CONTENT}") + + message(STATUS "Looking for prototype of ${SYMBOL}") + try_compile(${VARIABLE} + "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.cxx" + CMAKE_FLAGS + -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS} + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}" + "${CHECK_SYMBOL_EXISTS_LIBS}" + ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS} + OUTPUT_VARIABLE OUTPUT) + if(${VARIABLE}) + message(STATUS "Looking for prototype of ${SYMBOL} - found") + set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}") + file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log" + "Determining if the ${SYMBOL} " + "exist passed with the following output:\n" + "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.ccc:\n" + "${CHECK_SYMBOL_EXISTS_CONTENT}\n") + else() + message(STATUS "Looking for prototype of ${SYMBOL} - not found.") + set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}") + file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" + "Determining if the ${SYMBOL} " + "exist failed with the following output:\n" + "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.cxx:\n" + "${CHECK_SYMBOL_EXISTS_CONTENT}\n") + endif() + endif() +endmacro() diff --git a/CMake/DCMTKConfig.cmake.in b/CMake/DCMTKConfig.cmake.in new file mode 100644 index 00000000..c344bf28 --- /dev/null +++ b/CMake/DCMTKConfig.cmake.in @@ -0,0 +1,61 @@ +# +# DCMTKConfig.cmake - DCMTK CMake configuration file for external projects +# + +@PACKAGE_INIT@ + +# Basic version information +set(DCMTK_MAJOR_VERSION @DCMTK_MAJOR_VERSION@) +set(DCMTK_MINOR_VERSION @DCMTK_MINOR_VERSION@) +set(DCMTK_BUILD_VERSION @DCMTK_BUILD_VERSION@) + +# DCMTK libraries and modules +set(DCMTK_MODULES "@DCMTK_MODULES@") +set(DCMTK_LIBRARIES "@DCMTK_LIBRARY_TARGETS@") + +# Optional DCMTK 3rd party libraries +set(DCMTK_WITH_TIFF @DCMTK_WITH_TIFF@) +set(DCMTK_WITH_PNG @DCMTK_WITH_PNG@) +set(DCMTK_WITH_XML @DCMTK_WITH_XML@) +set(DCMTK_WITH_ZLIB @DCMTK_WITH_ZLIB@) +set(DCMTK_WITH_OPENSSL @DCMTK_WITH_OPENSSL@) +set(DCMTK_WITH_SNDFILE @DCMTK_WITH_SNDFILE@) +set(DCMTK_WITH_ICONV @DCMTK_WITH_ICONV@) +set(DCMTK_WITH_STDLIBC_ICONV @DCMTK_WITH_STDLIBC_ICONV@) +set(DCMTK_WITH_ICU @DCMTK_WITH_ICU@) +set(DCMTK_WITH_WRAP @DCMTK_WITH_WRAP@) +set(DCMTK_WITH_OPENJPEG @DCMTK_WITH_OPENJPEG@) +set(DCMTK_WITH_DOXYGEN @DCMTK_WITH_DOXYGEN@) + +# Dictionary-related +set(DCMTK_ENABLE_BUILTIN_DICTIONARY @DCMTK_ENABLE_BUILTIN_DICTIONARY@) +set(DCMTK_ENABLE_EXTERNAL_DICTIONARY @DCMTK_ENABLE_EXTERNAL_DICTIONARY@) +set(DCMTK_ENABLE_PRIVATE_TAGS @DCMTK_ENABLE_PRIVATE_TAGS@) + +# Compiler / standard library features +set(DCMTK_ENABLE_CXX11 @DCMTK_ENABLE_CXX11@) +set(DCMTK_CXX11_FLAGS @DCMTK_CXX11_FLAGS@) +set(DCMTK_ENABLE_STL @DCMTK_ENABLE_STL@) + +# DCMTK shared libraries +set(DCMTK_SHARED_LIBRARIES @BUILD_SHARED_LIBS@) +set(DCMTK_SINGLE_SHARED_LIBRARY @BUILD_SINGLE_SHARED_LIBRARY@) + +# DCMTK additional options +set(DCMTK_WITH_THREADS @DCMTK_WITH_THREADS@) +set(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS @DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS@) +set(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS @DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS@) +set(DCMTK_WIDE_CHAR_MAIN_FUNCTION @DCMTK_WIDE_CHAR_MAIN_FUNCTION@) +set(DCMTK_ENABLE_LFS @DCMTK_ENABLE_LFS@) + +SET_AND_CHECK(DCMTK_TARGETS "@PACKAGE_DCMTK_CMKDIR_CONFIG@/DCMTKTargets.cmake") + +@DCMTK_CONFIG_CODE@ + +# Compatibility: This variable is deprecated +set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS}) + +if(NOT DCMTK_TARGETS_IMPORTED) + set(DCMTK_TARGETS_IMPORTED 1) + include(${DCMTK_TARGETS}) +endif() diff --git a/CMake/DCMTKConfig.old_cmake.in b/CMake/DCMTKConfig.old_cmake.in new file mode 100644 index 00000000..765c4ca7 --- /dev/null +++ b/CMake/DCMTKConfig.old_cmake.in @@ -0,0 +1,52 @@ +# +# DCMTKConfig.cmake - DCMTK CMake configuration file for external projects +# +# This is the old version that is used by CMake versions lower than 2.8.8 +# which introduced the more convenient CONFIGURE_PACKAGE_CONFIG_FILE command. +# As a result, this file lacks some information compared to the +# CONFIGURE_PACKAGE_CONFIG_FILE version. +# + +# Basic version information +SET(DCMTK_MAJOR_VERSION @DCMTK_MAJOR_VERSION@) +SET(DCMTK_MINOR_VERSION @DCMTK_MINOR_VERSION@) +SET(DCMTK_BUILD_VERSION @DCMTK_BUILD_VERSION@) + +# DCMTK libraries and modules +SET(DCMTK_MODULES "@DCMTK_MODULES@") +SET(DCMTK_LIBRARIES "@DCMTK_LIBRARY_TARGETS@") + +# Optional DCMTK 3rd party libraries +SET(DCMTK_WITH_TIFF @DCMTK_WITH_TIFF@) +SET(DCMTK_WITH_PNG @DCMTK_WITH_PNG@) +SET(DCMTK_WITH_XML @DCMTK_WITH_XML@) +SET(DCMTK_WITH_ZLIB @DCMTK_WITH_ZLIB@) +SET(DCMTK_WITH_OPENSSL @DCMTK_WITH_OPENSSL@) +SET(DCMTK_WITH_SNDFILE @DCMTK_WITH_SNDFILE@) +SET(DCMTK_WITH_ICONV @DCMTK_WITH_ICONV@) +SET(DCMTK_WITH_STDLIBC_ICONV @DCMTK_WITH_STDLIBC_ICONV@) +SET(DCMTK_WITH_ICU @DCMTK_WITH_ICU@) +SET(DCMTK_WITH_WRAP @DCMTK_WITH_WRAP@) +set(DCMTK_WITH_OPENJPEG @DCMTK_WITH_OPENJPEG@) +SET(DCMTK_WITH_DOXYGEN @DCMTK_WITH_DOXYGEN@) + +# Dictionary-related +SET(DCMTK_ENABLE_BUILTIN_DICTIONARY @DCMTK_ENABLE_BUILTIN_DICTIONARY@) +SET(DCMTK_ENABLE_EXTERNAL_DICTIONARY @DCMTK_ENABLE_EXTERNAL_DICTIONARY@) +SET(DCMTK_ENABLE_PRIVATE_TAGS @DCMTK_ENABLE_PRIVATE_TAGS@) + +# Compiler / standard library features +SET(DCMTK_ENABLE_CXX11 @DCMTK_ENABLE_CXX11@) +SET(DCMTK_CXX11_FLAGS @DCMTK_CXX11_FLAGS@) +SET(DCMTK_ENABLE_STL @DCMTK_ENABLE_STL@) + +# DCMTK shared libraries +SET(DCMTK_SHARED_LIBRARIES @BUILD_SHARED_LIBS@) +SET(DCMTK_SINGLE_SHARED_LIBRARY @BUILD_SINGLE_SHARED_LIBRARY@) + +# DCMTK additional options +SET(DCMTK_WITH_THREADS @DCMTK_WITH_THREADS@) +SET(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS @DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS@) +SET(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS @DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS@) +SET(DCMTK_WIDE_CHAR_MAIN_FUNCTION @DCMTK_WIDE_CHAR_MAIN_FUNCTION@) +SET(DCMTK_ENABLE_LFS @DCMTK_ENABLE_LFS@) diff --git a/CMake/FindCharset.cmake b/CMake/FindCharset.cmake new file mode 100644 index 00000000..f779d178 --- /dev/null +++ b/CMake/FindCharset.cmake @@ -0,0 +1,22 @@ +# Find charset library +# +# LIBCHARSET_INCLUDE_DIRS - where to find localcharset.h, etc +# LIBCHARSET_LIBRARIES - Lists of libraries when using charset +# LIBCHARSET_FOUND - True if charset found + +include(FindPackageHandleStandardArgs) + +# Look for the header file +find_path(LIBCHARSET_INCLUDE_DIR NAMES localcharset.h) +mark_as_advanced(LIBCHARSET_INCLUDE_DIR) + +set(LIBCHARSET_LIBS charset) +find_library(LIBCHARSET_LIBRARY NAMES ${LIBCHARSET_LIBS}) +mark_as_advanced(LIBCHARSET_LIBRARY) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBCHARSET REQUIRED_VARS LIBCHARSET_LIBRARY LIBCHARSET_INCLUDE_DIR) + +if(LIBCHARSET_FOUND) + set(LIBCHARSET_INCLUDE_DIRS ${LIBCHARSET_INCLUDE_DIR}) + set(LIBCHARSET_LIBRARIES ${LIBCHARSET_LIBRARY}) +endif() diff --git a/CMake/FindICU.cmake b/CMake/FindICU.cmake new file mode 100644 index 00000000..68045c9a --- /dev/null +++ b/CMake/FindICU.cmake @@ -0,0 +1,690 @@ +# This module can find the International Components for Unicode (ICU) libraries +# +# Requirements: +# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args) +# +# The following variables will be defined for your use: +# - ICU_FOUND : were all of your specified components found? +# - ICU_INCLUDE_DIRS : ICU include directory +# - ICU_LIBRARIES : ICU libraries +# - ICU_VERSION : complete version of ICU (x.y.z) +# - ICU_VERSION_MAJOR : major version of ICU +# - ICU_VERSION_MINOR : minor version of ICU +# - ICU_VERSION_PATCH : patch version of ICU +# - ICU__FOUND : were found? (FALSE for non specified component if it is not a dependency) +# +# For windows or non standard installation, define ICU_ROOT_DIR variable to point to the root installation of ICU. Two ways: +# - run cmake with -DICU_ROOT_DIR= +# - define an environment variable with the same name before running cmake +# With cmake-gui, before pressing "Configure": +# 1) Press "Add Entry" button +# 2) Add a new entry defined as: +# - Name: ICU_ROOT_DIR +# - Type: choose PATH in the selection list +# - Press "..." button and select the root installation of ICU +# +# Example Usage: +# +# 1. Copy this file in the root of your project source directory +# 2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt: +# set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) +# 3. Finally call find_package() once, here are some examples to pick from +# +# Require ICU 4.4 or later +# find_package(ICU 4.4 REQUIRED) +# +# if(ICU_FOUND) +# add_executable(myapp myapp.c) +# include_directories(${ICU_INCLUDE_DIRS}) +# target_link_libraries(myapp ${ICU_LIBRARIES}) +# # with CMake >= 3.0.0, the last two lines can be replaced by the following +# target_link_libraries(myapp ICU::ICU) +# endif() + +########## ########## + +find_package(PkgConfig QUIET) + +########## Private ########## +if(NOT DEFINED ICU_PUBLIC_VAR_NS) + set(ICU_PUBLIC_VAR_NS "ICU") # Prefix for all ICU relative public variables +endif() +if(NOT DEFINED ICU_PRIVATE_VAR_NS) + set(ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}") # Prefix for all ICU relative internal variables +endif() +if(NOT DEFINED PC_ICU_PRIVATE_VAR_NS) + set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables +endif() + +set(${ICU_PRIVATE_VAR_NS}_HINTS ) +# +# for future removal +if(DEFINED ENV{ICU_ROOT}) + list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT}") + message(AUTHOR_WARNING "ENV{ICU_ROOT} is deprecated in favor of ENV{ICU_ROOT_DIR}") +endif() +if (DEFINED ICU_ROOT) + list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT}") + message(AUTHOR_WARNING "ICU_ROOT is deprecated in favor of ICU_ROOT_DIR") +endif() +# +if(DEFINED ENV{ICU_ROOT_DIR}) + list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT_DIR}") +endif() +if (DEFINED ICU_ROOT_DIR) + list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT_DIR}") +endif() + +set(${ICU_PRIVATE_VAR_NS}_COMPONENTS ) +# ... +macro(_icu_declare_component _NAME) + list(APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME}) + set("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN}) +endmacro() + +_icu_declare_component(data icudata) +_icu_declare_component(uc icuuc) # Common and Data libraries +_icu_declare_component(i18n icui18n icuin) # Internationalization library +_icu_declare_component(io icuio ustdio) # Stream and I/O Library +_icu_declare_component(le icule) # Layout library +_icu_declare_component(lx iculx) # Paragraph Layout library + +########## Public ########## +set(${ICU_PUBLIC_VAR_NS}_FOUND FALSE) +set(${ICU_PUBLIC_VAR_NS}_LIBRARIES ) +set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS ) +set(${ICU_PUBLIC_VAR_NS}_C_FLAGS "") +set(${ICU_PUBLIC_VAR_NS}_CXX_FLAGS "") +set(${ICU_PUBLIC_VAR_NS}_CPP_FLAGS "") +set(${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS "") +set(${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS "") +set(${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS "") + +foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS}) + string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT) + set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the _icu_declare_component macro +endforeach() + +# Check components +if(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least + set(${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc) +else() + list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc) + list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) + foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS}) + if(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) + message(FATAL_ERROR "Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}") + endif() + endforeach() +endif() + +# if pkg-config is available check components dependencies and append `pkg-config icu- --variable=prefix` to hints +if(PKG_CONFIG_FOUND) + set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS}) + foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP}) + pkg_check_modules(${PC_ICU_PRIVATE_VAR_NS} "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET) + + if(${PC_ICU_PRIVATE_VAR_NS}_FOUND) + list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS ${${PC_ICU_PRIVATE_VAR_NS}_PREFIX}) + foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARIES}) + string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY}) + if(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data") + list(FIND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY} ${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX) + if(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1) + message(WARNING "Missing component dependency: ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY}. Add it to your find_package(ICU) line as COMPONENTS to fix this warning.") + list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY}) + endif() + endif() + endforeach() + endif() + endforeach() +endif() +# list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS ENV ICU_ROOT_DIR) +# message("${ICU_PRIVATE_VAR_NS}_HINTS = ${${ICU_PRIVATE_VAR_NS}_HINTS}") + +# Includes +find_path( + ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR + NAMES unicode/utypes.h utypes.h + HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS} + PATH_SUFFIXES "include" + DOC "Include directories for ICU" +) + +if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR) + ########## ########## + if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uvernum.h") # ICU >= 4.4 + file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uvernum.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS) + elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uversion.h") # ICU [2;4.4[ + file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uversion.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS) + elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/utypes.h") # ICU [1.4;2[ + file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS) + elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/utypes.h") # ICU 1.3 + file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS) + else() + message(FATAL_ERROR "ICU version header not found") + endif() + + if(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *ICU_VERSION *\"([0-9]+)\".*") # ICU 1.3 + # [1.3;1.4[ as #define ICU_VERSION "3" (no patch version, ie all 1.3.X versions will be detected as 1.3.0) + set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "1") + set(${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${CMAKE_MATCH_1}") + set(${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "0") + elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*") + # + # Since version 4.9.1, ICU release version numbering was totaly changed, see: + # - http://site.icu-project.org/download/49 + # - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU + # + set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "${CMAKE_MATCH_1}") + string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}") + string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}") + elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*") # ICU [1.4;1.8[ + # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.[12](?:\.\d)? have releasing error and appears as 1.4.0 + set(${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}") # copy CMAKE_MATCH_1, no longer valid on the following if + if(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$") + set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "0") + elseif(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") + set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "${CMAKE_MATCH_3}") + endif() + else() + message(FATAL_ERROR "failed to detect ICU version") + endif() + set(${ICU_PUBLIC_VAR_NS}_VERSION "${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}.${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}.${${ICU_PUBLIC_VAR_NS}_VERSION_PATCH}") + ########## ########## +endif() + +# Check libraries +if(MSVC) + include(SelectLibraryConfigurations) +endif() +foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS}) + string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT) + if(MSVC) + set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES ) + set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES ) + foreach(${ICU_PRIVATE_VAR_NS}_BASE_NAME ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}) + list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}") + list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d") + list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}") + list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}d") + endforeach() + + find_library( + ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE + NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES} + HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS} + DOC "Release library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component" + ) + find_library( + ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG + NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES} + HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS} + DOC "Debug library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component" + ) + + select_library_configurations("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}") + list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARY ${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY}) + else() + find_library( + ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY + NAMES ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}} + PATHS ${${ICU_PRIVATE_VAR_NS}_HINTS} + DOC "Library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component" + ) + + if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY) + set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE) + list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARY ${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY}) + endif() + endif() +endforeach() + +# Try to find out compiler flags +find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}) +if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE) + execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + +# Check find_package arguments +include(FindPackageHandleStandardArgs) +if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY) + find_package_handle_standard_args( + ${ICU_PUBLIC_VAR_NS} + REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARY ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR + VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION + ) +else() + find_package_handle_standard_args(${ICU_PUBLIC_VAR_NS} "Could NOT find ICU" ${ICU_PUBLIC_VAR_NS}_LIBRARY ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR) +endif() + +if(${ICU_PUBLIC_VAR_NS}_FOUND) + # + # for compatibility with previous versions, alias old ICU_(MAJOR|MINOR|PATCH)_VERSION to ICU_VERSION_$1 + set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION ${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}) + set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION ${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}) + set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION ${${ICU_PUBLIC_VAR_NS}_VERSION_PATCH}) + # + set(${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PUBLIC_VAR_NS}_LIBRARY}) + set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS ${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}) + + if(NOT CMAKE_VERSION VERSION_LESS "3.0.0") + if(NOT TARGET ICU::ICU) + add_library(ICU::ICU INTERFACE IMPORTED) + endif() + set_target_properties(ICU::ICU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}") + foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS}) + string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT) + add_library("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" UNKNOWN IMPORTED) + if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE) + set_property(TARGET "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION_RELEASE "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE}") + endif() + if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG) + set_property(TARGET "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION_DEBUG "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG}") + endif() + if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY) + set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY}") + endif() + set_property(TARGET ICU::ICU APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}") +# set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}") + endforeach() + endif() +endif() + +mark_as_advanced( + ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR + ${ICU_PUBLIC_VAR_NS}_LIBRARY +) + +########## ########## + +########## ########## + +########## Private ########## +function(_icu_extract_locale_from_rb _BUNDLE_SOURCE _RETURN_VAR_NAME) + file(READ "${_BUNDLE_SOURCE}" _BUNDLE_CONTENTS) + string(REGEX REPLACE "//[^\n]*\n" "" _BUNDLE_CONTENTS_WITHOUT_COMMENTS ${_BUNDLE_CONTENTS}) + string(REGEX REPLACE "[ \t\n]" "" _BUNDLE_CONTENTS_WITHOUT_COMMENTS_AND_SPACES ${_BUNDLE_CONTENTS_WITHOUT_COMMENTS}) + string(REGEX MATCH "^([a-zA-Z_-]+)(:table)?{" LOCALE_FOUND ${_BUNDLE_CONTENTS_WITHOUT_COMMENTS_AND_SPACES}) + set("${_RETURN_VAR_NAME}" "${CMAKE_MATCH_1}" PARENT_SCOPE) +endfunction() + +########## Public ########## + +# +# Prototype: +# icu_generate_resource_bundle([NAME ] [PACKAGE] [DESTINATION ] [FILES ]) +# +# Common arguments: +# - NAME : name of output package and to create dummy targets +# - FILES ... : list of resource bundles sources +# - DEPENDS ... : required to package as library (shared or static), a list of cmake parent targets to link to +# Note: only (PREVIOUSLY DECLARED) add_executable and add_library as dependencies +# - DESTINATION : optional, directory where to install final binary file(s) +# - FORMAT : optional, one of none (ICU4C binary format, default), java (plain java) or xliff (XML), see below +# +# Arguments depending on FORMAT: +# - none (default): +# * PACKAGE : if present, package all resource bundles together. Default is to stop after building individual *.res files +# * TYPE : one of : +# + common or archive (default) : archive all ressource bundles into a single .dat file +# + library or dll : assemble all ressource bundles into a separate and loadable library (.dll/.so) +# + static : integrate all ressource bundles to targets designed by DEPENDS parameter (as a static library) +# * NO_SHARED_FLAGS : only with TYPE in ['library', 'dll', 'static'], do not append ICU_C(XX)_SHARED_FLAGS to targets given as DEPENDS argument +# - JAVA: +# * BUNDLE : required, prefix for generated classnames +# - XLIFF: +# (none) +# + +# +# For an archive, the idea is to generate the following dependencies: +# +# root.txt => root.res \ +# | +# en.txt => en.res | +# | => pkglist.txt => application.dat +# fr.txt => fr.res | +# | +# and so on / +# +# Lengend: 'A => B' means B depends on A +# +# Steps (correspond to arrows): +# 1) genrb (from .txt to .res) +# 2) generate a file text (pkglist.txt) with all .res files to put together +# 3) build final archive (from *.res/pkglist.txt to .dat) +# + +function(icu_generate_resource_bundle) + + ##### ##### + find_program(${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE genrb HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}) + find_program(${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE pkgdata HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}) + + if(NOT ${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE) + message(FATAL_ERROR "genrb not found") + endif() + if(NOT ${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE) + message(FATAL_ERROR "pkgdata not found") + endif() + ##### ##### + + ##### ##### + set(TARGET_SEPARATOR "+") + set(__FUNCTION__ "icu_generate_resource_bundle") + set(PACKAGE_TARGET_PREFIX "ICU${TARGET_SEPARATOR}PKG") + set(RESOURCE_TARGET_PREFIX "ICU${TARGET_SEPARATOR}RB") + ##### ##### + + ##### ##### + # filename extension of built resource bundle (without dot) + set(BUNDLES__SUFFIX "res") + set(BUNDLES_JAVA_SUFFIX "java") + set(BUNDLES_XLIFF_SUFFIX "xlf") + # alias: none (default) = common = archive ; dll = library ; static + set(PKGDATA__ALIAS "") + set(PKGDATA_COMMON_ALIAS "") + set(PKGDATA_ARCHIVE_ALIAS "") + set(PKGDATA_DLL_ALIAS "LIBRARY") + set(PKGDATA_LIBRARY_ALIAS "LIBRARY") + set(PKGDATA_STATIC_ALIAS "STATIC") + # filename prefix of built package + set(PKGDATA__PREFIX "") + set(PKGDATA_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}") + set(PKGDATA_STATIC_PREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}") + # filename extension of built package (with dot) + set(PKGDATA__SUFFIX ".dat") + set(PKGDATA_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(PKGDATA_STATIC_SUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}") + # pkgdata option mode specific + set(PKGDATA__OPTIONS "-m" "common") + set(PKGDATA_STATIC_OPTIONS "-m" "static") + set(PKGDATA_LIBRARY_OPTIONS "-m" "library") + # cmake library type for output package + set(PKGDATA_LIBRARY__TYPE "") + set(PKGDATA_LIBRARY_STATIC_TYPE STATIC) + set(PKGDATA_LIBRARY_LIBRARY_TYPE SHARED) + ##### ##### + + include(CMakeParseArguments) + cmake_parse_arguments( + PARSED_ARGS # output variable name + # options (true/false) (default value: false) + "PACKAGE;NO_SHARED_FLAGS" + # univalued parameters (default value: "") + "NAME;DESTINATION;TYPE;FORMAT;BUNDLE" + # multivalued parameters (default value: "") + "FILES;DEPENDS" + ${ARGN} + ) + + # assert(${PARSED_ARGS_NAME} != "") + if(NOT PARSED_ARGS_NAME) + message(FATAL_ERROR "${__FUNCTION__}(): no name given, NAME parameter missing") + endif() + + # assert(length(PARSED_ARGS_FILES) > 0) + list(LENGTH PARSED_ARGS_FILES PARSED_ARGS_FILES_LEN) + if(PARSED_ARGS_FILES_LEN LESS 1) + message(FATAL_ERROR "${__FUNCTION__}() expects at least 1 resource bundle as FILES argument, 0 given") + endif() + + string(TOUPPER "${PARSED_ARGS_FORMAT}" UPPER_FORMAT) + # assert(${UPPER_FORMAT} in ['', 'java', 'xlif']) + if(NOT DEFINED BUNDLES_${UPPER_FORMAT}_SUFFIX) + message(FATAL_ERROR "${__FUNCTION__}(): unknown FORMAT '${PARSED_ARGS_FORMAT}'") + endif() + + if(UPPER_FORMAT STREQUAL "JAVA") + # assert(${PARSED_ARGS_BUNDLE} != "") + if(NOT PARSED_ARGS_BUNDLE) + message(FATAL_ERROR "${__FUNCTION__}(): java bundle name expected, BUNDLE parameter missing") + endif() + endif() + + if(PARSED_ARGS_PACKAGE) + # assert(${PARSED_ARGS_FORMAT} == "") + if(PARSED_ARGS_FORMAT) + message(FATAL_ERROR "${__FUNCTION__}(): packaging is only supported for binary format, not xlif neither java outputs") + endif() + + string(TOUPPER "${PARSED_ARGS_TYPE}" UPPER_MODE) + # assert(${UPPER_MODE} in ['', 'common', 'archive', 'dll', library']) + if(NOT DEFINED PKGDATA_${UPPER_MODE}_ALIAS) + message(FATAL_ERROR "${__FUNCTION__}(): unknown TYPE '${PARSED_ARGS_TYPE}'") + else() + set(TYPE "${PKGDATA_${UPPER_MODE}_ALIAS}") + endif() + + # Package name: strip file extension if present + get_filename_component(PACKAGE_NAME_WE ${PARSED_ARGS_NAME} NAME_WE) + # Target name to build package + set(PACKAGE_TARGET_NAME "${PACKAGE_TARGET_PREFIX}${TARGET_SEPARATOR}${PACKAGE_NAME_WE}") + # Target name to build intermediate list file + set(PACKAGE_LIST_TARGET_NAME "${PACKAGE_TARGET_NAME}${TARGET_SEPARATOR}PKGLIST") + # Directory (absolute) to set as "current directory" for genrb (does not include package directory, -p) + # We make our "cook" there to prevent any conflict + if(DEFINED CMAKE_PLATFORM_ROOT_BIN) # CMake < 2.8.10 + set(RESOURCE_GENRB_CHDIR_DIR "${CMAKE_PLATFORM_ROOT_BIN}/${PACKAGE_TARGET_NAME}.dir/") + else() # CMake >= 2.8.10 + set(RESOURCE_GENRB_CHDIR_DIR "${CMAKE_PLATFORM_INFO_DIR}/${PACKAGE_TARGET_NAME}.dir/") + endif() + # Directory (absolute) where resource bundles are built: concatenation of RESOURCE_GENRB_CHDIR_DIR and package name + set(RESOURCE_OUTPUT_DIR "${RESOURCE_GENRB_CHDIR_DIR}/${PACKAGE_NAME_WE}/") + # Output (relative) path for built package + if(MSVC AND TYPE STREQUAL PKGDATA_LIBRARY_ALIAS) + set(PACKAGE_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/${PACKAGE_NAME_WE}/${PKGDATA_${TYPE}_PREFIX}${PACKAGE_NAME_WE}${PKGDATA_${TYPE}_SUFFIX}") + else() + set(PACKAGE_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/${PKGDATA_${TYPE}_PREFIX}${PACKAGE_NAME_WE}${PKGDATA_${TYPE}_SUFFIX}") + endif() + # Output (absolute) path for the list file + set(PACKAGE_LIST_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/pkglist.txt") + + file(MAKE_DIRECTORY "${RESOURCE_OUTPUT_DIR}") + else() + set(RESOURCE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/") +# set(RESOURCE_GENRB_CHDIR_DIR "UNUSED") + endif() + + set(TARGET_RESOURCES ) + set(COMPILED_RESOURCES_PATH ) + set(COMPILED_RESOURCES_BASENAME ) + foreach(RESOURCE_SOURCE ${PARSED_ARGS_FILES}) + _icu_extract_locale_from_rb(${RESOURCE_SOURCE} RESOURCE_NAME_WE) + get_filename_component(SOURCE_BASENAME ${RESOURCE_SOURCE} NAME) + get_filename_component(ABSOLUTE_SOURCE ${RESOURCE_SOURCE} ABSOLUTE) + + if(UPPER_FORMAT STREQUAL "XLIFF") + if(RESOURCE_NAME_WE STREQUAL "root") + set(XLIFF_LANGUAGE "en") + else() + string(REGEX REPLACE "[^a-z].*$" "" XLIFF_LANGUAGE "${RESOURCE_NAME_WE}") + endif() + endif() + + ##### ##### + set(RESOURCE_TARGET_NAME "${RESOURCE_TARGET_PREFIX}${TARGET_SEPARATOR}${PARSED_ARGS_NAME}${TARGET_SEPARATOR}${RESOURCE_NAME_WE}") + + set(RESOURCE_OUTPUT__PATH "${RESOURCE_NAME_WE}.res") + if(RESOURCE_NAME_WE STREQUAL "root") + set(RESOURCE_OUTPUT_JAVA_PATH "${PARSED_ARGS_BUNDLE}.java") + else() + set(RESOURCE_OUTPUT_JAVA_PATH "${PARSED_ARGS_BUNDLE}_${RESOURCE_NAME_WE}.java") + endif() + set(RESOURCE_OUTPUT_XLIFF_PATH "${RESOURCE_NAME_WE}.xlf") + + set(GENRB__OPTIONS "") + set(GENRB_JAVA_OPTIONS "-j" "-b" "${PARSED_ARGS_BUNDLE}") + set(GENRB_XLIFF_OPTIONS "-x" "-l" "${XLIFF_LANGUAGE}") + ##### ##### + + # build .txt from .res + if(PARSED_ARGS_PACKAGE) + add_custom_command( + OUTPUT "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}" + COMMAND ${CMAKE_COMMAND} -E chdir ${RESOURCE_GENRB_CHDIR_DIR} ${${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE} ${GENRB_${UPPER_FORMAT}_OPTIONS} -d ${PACKAGE_NAME_WE} ${ABSOLUTE_SOURCE} + DEPENDS ${RESOURCE_SOURCE} + ) + else() + add_custom_command( + OUTPUT "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}" + COMMAND ${${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE} ${GENRB_${UPPER_FORMAT}_OPTIONS} -d ${RESOURCE_OUTPUT_DIR} ${ABSOLUTE_SOURCE} + DEPENDS ${RESOURCE_SOURCE} + ) + endif() + # dummy target (ICU+RB++) for each locale to build the .res file from its .txt by the add_custom_command above + add_custom_target( + "${RESOURCE_TARGET_NAME}" ALL + COMMENT "" + DEPENDS "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}" + SOURCES ${RESOURCE_SOURCE} + ) + + if(PARSED_ARGS_DESTINATION AND NOT PARSED_ARGS_PACKAGE) + install(FILES "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}" DESTINATION ${PARSED_ARGS_DESTINATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) + endif() + + list(APPEND TARGET_RESOURCES "${RESOURCE_TARGET_NAME}") + list(APPEND COMPILED_RESOURCES_PATH "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}") + list(APPEND COMPILED_RESOURCES_BASENAME "${RESOURCE_NAME_WE}.${BUNDLES_${UPPER_FORMAT}_SUFFIX}") + endforeach() + # convert semicolon separated list to a space separated list + # NOTE: if the pkglist.txt file starts (or ends?) with a whitespace, pkgdata add an undefined symbol (named _) for it + string(REPLACE ";" " " COMPILED_RESOURCES_BASENAME "${COMPILED_RESOURCES_BASENAME}") + + if(PARSED_ARGS_PACKAGE) + # create a text file (pkglist.txt) with the list of the *.res to package together + add_custom_command( + OUTPUT "${PACKAGE_LIST_OUTPUT_PATH}" + COMMAND ${CMAKE_COMMAND} -E echo "${COMPILED_RESOURCES_BASENAME}" > "${PACKAGE_LIST_OUTPUT_PATH}" + DEPENDS ${COMPILED_RESOURCES_PATH} + ) + # run pkgdata from pkglist.txt + add_custom_command( + OUTPUT "${PACKAGE_OUTPUT_PATH}" + COMMAND ${CMAKE_COMMAND} -E chdir ${RESOURCE_GENRB_CHDIR_DIR} ${${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE} -F ${PKGDATA_${TYPE}_OPTIONS} -s ${PACKAGE_NAME_WE} -p ${PACKAGE_NAME_WE} ${PACKAGE_LIST_OUTPUT_PATH} + DEPENDS "${PACKAGE_LIST_OUTPUT_PATH}" + VERBATIM + ) + if(PKGDATA_LIBRARY_${TYPE}_TYPE) + # assert(${PARSED_ARGS_DEPENDS} != "") + if(NOT PARSED_ARGS_DEPENDS) + message(FATAL_ERROR "${__FUNCTION__}(): static and library mode imply a list of targets to link to, DEPENDS parameter missing") + endif() + add_library(${PACKAGE_TARGET_NAME} ${PKGDATA_LIBRARY_${TYPE}_TYPE} IMPORTED) + if(MSVC) + string(REGEX REPLACE "${PKGDATA_LIBRARY_SUFFIX}\$" "${CMAKE_IMPORT_LIBRARY_SUFFIX}" PACKAGE_OUTPUT_LIB "${PACKAGE_OUTPUT_PATH}") + set_target_properties(${PACKAGE_TARGET_NAME} PROPERTIES IMPORTED_LOCATION ${PACKAGE_OUTPUT_PATH} IMPORTED_IMPLIB ${PACKAGE_OUTPUT_LIB}) + else() + set_target_properties(${PACKAGE_TARGET_NAME} PROPERTIES IMPORTED_LOCATION ${PACKAGE_OUTPUT_PATH}) + endif() + foreach(DEPENDENCY ${PARSED_ARGS_DEPENDS}) + target_link_libraries(${DEPENDENCY} ${PACKAGE_TARGET_NAME}) + if(NOT PARSED_ARGS_NO_SHARED_FLAGS) + get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) + list(LENGTH "${ENABLED_LANGUAGES}" ENABLED_LANGUAGES_LENGTH) + if(ENABLED_LANGUAGES_LENGTH GREATER 1) + message(WARNING "Project has more than one language enabled, skip automatic shared flags appending") + else() + set_property(TARGET "${DEPENDENCY}" APPEND PROPERTY COMPILE_FLAGS "${${ICU_PUBLIC_VAR_NS}_${ENABLED_LANGUAGES}_SHARED_FLAGS}") + endif() + endif() + endforeach() + # http://www.mail-archive.com/cmake-commits@cmake.org/msg01135.html + set(PACKAGE_INTERMEDIATE_TARGET_NAME "${PACKAGE_TARGET_NAME}${TARGET_SEPARATOR}DUMMY") + # dummy intermediate target (ICU+PKG++DUMMY) to link the package to the produced library by running pkgdata (see add_custom_command above) + add_custom_target( + ${PACKAGE_INTERMEDIATE_TARGET_NAME} + COMMENT "" + DEPENDS "${PACKAGE_OUTPUT_PATH}" + ) + add_dependencies("${PACKAGE_TARGET_NAME}" "${PACKAGE_INTERMEDIATE_TARGET_NAME}") + else() + # dummy target (ICU+PKG+) to run pkgdata (see add_custom_command above) + add_custom_target( + "${PACKAGE_TARGET_NAME}" ALL + COMMENT "" + DEPENDS "${PACKAGE_OUTPUT_PATH}" + ) + endif() + # dummy target (ICU+PKG++PKGLIST) to build the file pkglist.txt + add_custom_target( + "${PACKAGE_LIST_TARGET_NAME}" ALL + COMMENT "" + DEPENDS "${PACKAGE_LIST_OUTPUT_PATH}" + ) + # package => pkglist.txt + add_dependencies("${PACKAGE_TARGET_NAME}" "${PACKAGE_LIST_TARGET_NAME}") + # pkglist.txt => *.res + add_dependencies("${PACKAGE_LIST_TARGET_NAME}" ${TARGET_RESOURCES}) + + if(PARSED_ARGS_DESTINATION) + install(FILES "${PACKAGE_OUTPUT_PATH}" DESTINATION ${PARSED_ARGS_DESTINATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) + endif() + endif() + +endfunction() + +########## ########## + +########## ########## + +if(${ICU_PUBLIC_VAR_NS}_DEBUG) + + function(icudebug _VARNAME) + if(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME}) + message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}") + else() + message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ") + endif() + endfunction() + + # IN (args) + icudebug("FIND_COMPONENTS") + icudebug("FIND_REQUIRED") + icudebug("FIND_QUIETLY") + icudebug("FIND_VERSION") + + # OUT + # Found + icudebug("FOUND") + # Flags + icudebug("C_FLAGS") + icudebug("CPP_FLAGS") + icudebug("CXX_FLAGS") + icudebug("C_SHARED_FLAGS") + icudebug("CPP_SHARED_FLAGS") + icudebug("CXX_SHARED_FLAGS") + # Linking + icudebug("INCLUDE_DIRS") + icudebug("LIBRARIES") + # Version + icudebug("VERSION_MAJOR") + icudebug("VERSION_MINOR") + icudebug("VERSION_PATCH") + icudebug("VERSION") + # _(FOUND|LIBRARY) + set(${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLES "FOUND" "LIBRARY" "LIBRARY_RELEASE" "LIBRARY_DEBUG") + foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS}) + string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT) + foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE ${${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLES}) + icudebug("${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_${${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE}") + endforeach() + endforeach() + +endif() + +########## ########## diff --git a/CMake/FindIconv.cmake b/CMake/FindIconv.cmake new file mode 100644 index 00000000..379ec099 --- /dev/null +++ b/CMake/FindIconv.cmake @@ -0,0 +1,33 @@ +# Find iconv library +# +# Released under BSD license +# +# LIBICONV_INCLUDE_DIRS - where to find iconv.h, etc +# LIBICONV_LIBRARIES - Lists of libraries when using iconv +# LIBICONV_FOUND - True if iconv found + +include(FindPackageHandleStandardArgs) +include(dcmtkTryCompile) + +# Look for the header file +find_path(LIBICONV_INCLUDE_DIR NAMES iconv.h) +mark_as_advanced(LIBICONV_INCLUDE_DIR) + +# Look for the library +set(LIBICONV_LIBS iconv) +find_library(LIBICONV_LIBRARY NAMES ${LIBICONV_LIBS}) +mark_as_advanced(LIBICONV_LIBRARY) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBICONV REQUIRED_VARS LIBICONV_LIBRARY LIBICONV_INCLUDE_DIR) + +# Copy the result to output variables +if(LIBICONV_FOUND) + set(LIBICONV_LIBRARIES ${LIBICONV_LIBRARY}) + set(LIBICONV_INCLUDE_DIRS ${LIBICONV_INCLUDE_DIR}) +else() + set(LIBICONV_LIBS) + set(LIBICONV_LIBRARY) + set(LIBICONV_LIBRARIES) + set(LIBICONV_INCLUDE_DIR) + set(LIBICONV_INCLUDE_DIRS) +endif() diff --git a/CMake/FindOpenJPEG.cmake b/CMake/FindOpenJPEG.cmake new file mode 100644 index 00000000..8589edcd --- /dev/null +++ b/CMake/FindOpenJPEG.cmake @@ -0,0 +1,36 @@ +# Find OpenJPEG library +# +# Released under BSD license +# +# OPENJPEG_INCLUDE_DIRS - where to find openjpeg.h, etc. +# OPENJPEG_LIBRARIES - Lists of libraries when using OpenJPEG +# OPENJPEG_FOUND - True if OpenJPEG found + +# Use pkg_check_modules to determine the paths for OpenJPEG +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(OPENJPEG_PKGCONF libopenjp2) +endif() + +# Look for the header file +find_path(OPENJPEG_INCLUDE_DIR NAMES openjpeg.h HINTS ${OPENJPEG_PKGCONF_INCLUDE_DIRS}) +mark_as_advanced(OPENJPEG_INCLUDE_DIR) + +# Look for the library +set(OPENJPEG_LIBS openjp2) +find_library(OPENJPEG_LIBRARY NAMES ${OPENJPEG_LIBS} HINTS ${OPENJPEG_PKGCONF_LIBRARY_DIRS}) +mark_as_advanced(OPENJPEG_LIBRARY) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENJPEG REQUIRED_VARS OPENJPEG_LIBRARY OPENJPEG_INCLUDE_DIR) + +# Copy the result to output variables +if(OPENJPEG_FOUND) + set(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY}) + set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR}) +else() + set(OPENJPEG_LIBS) + set(OPENJPEG_LIBRARY) + set(OPENJPEG_LIBRARIES) + set(OPENJPEG_INCLUDE_DIR) + set(OPENJPEG_INCLUDE_DIRS) +endif() diff --git a/CMake/FindSndfile.cmake b/CMake/FindSndfile.cmake new file mode 100644 index 00000000..ca5e8c33 --- /dev/null +++ b/CMake/FindSndfile.cmake @@ -0,0 +1,32 @@ +# Find sndfile library +# +# Released under BSD license +# +# SNDFILE_INCLUDE_DIRS - where to find sndfile.h, etc +# SNDFILE_LIBRARIES - Lists of libraries when using sndfile +# SNDFILE_FOUND - True if sndfile found + +include(FindPackageHandleStandardArgs) + +# Look for the header file +find_path(SNDFILE_INCLUDE_DIR NAMES sndfile.h) +mark_as_advanced(SNDFILE_INCLUDE_DIR) + +# Look for the library +set(SNDFILE_LIBS sndfile) +find_library(SNDFILE_LIBRARY NAMES ${SNDFILE_LIBS}) +mark_as_advanced(SNDFILE_LIBRARY) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SNDFILE REQUIRED_VARS SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR) + +# Copy the result to output variables +if(SNDFILE_FOUND) + set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY}) + set(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR}) +else() + set(SNDFILE_LIBS) + set(SNDFILE_LIBRARY) + set(SNDFILE_LIBRARIES) + set(SNDFILE_INCLUDE_DIR) + set(SNDFILE_INCLUDE_DIRS) +endif() diff --git a/CMake/FindWrap.cmake b/CMake/FindWrap.cmake new file mode 100644 index 00000000..27955bf0 --- /dev/null +++ b/CMake/FindWrap.cmake @@ -0,0 +1,32 @@ +# Find wrap library +# +# Released under BSD license +# +# WRAP_INCLUDE_DIRS - where to find tcpd.h, etc +# WRAP_LIBRARIES - Lists of libraries when using libwrap +# WRAP_FOUND - True if wrap found + +include(FindPackageHandleStandardArgs) + +# Look for the header file +find_path(WRAP_INCLUDE_DIR NAMES tcpd.h) +mark_as_advanced(WRAP_INCLUDE_DIR) + +# Look for the library +set(WRAP_LIBS wrap) +find_library(WRAP_LIBRARY NAMES ${WRAP_LIBS}) +mark_as_advanced(WRAP_LIBRARY) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(WRAP REQUIRED_VARS WRAP_LIBRARY WRAP_INCLUDE_DIR) + +# Copy the result to output variables +if(WRAP_FOUND) + set(WRAP_LIBRARIES ${WRAP_LIBRARY}) + set(WRAP_INCLUDE_DIRS ${WRAP_INCLUDE_DIR}) +else() + set(WRAP_LIBS) + set(WRAP_LIBRARY) + set(WRAP_LIBRARIES) + set(WRAP_INCLUDE_DIR) + set(WRAP_INCLUDE_DIRS) +endif() diff --git a/CMake/GenerateCMakeExports.cmake b/CMake/GenerateCMakeExports.cmake new file mode 100644 index 00000000..9a9feb36 --- /dev/null +++ b/CMake/GenerateCMakeExports.cmake @@ -0,0 +1,81 @@ +# This script creates files DCMTKTargets.cmake' and 'DCMTKConfigVersion.cmake' +# and 'DCMTKConfig.cmake'. These files are created within the build tree +# but also are installed with DCMTK. +# The files can be utilized (no matter whether they are installed or just +# located within the build tree) by external projects in order to use +# the related DCMTK build. +# In order to accomplish that, the files provide hints to the external project +# which libraries and executables are available, and which build options have +# been used to build them. The external project then uses the CMake +# find_package command in "CONFIG" mode in order to import the DCMTK package +# with help of these files. +# +# DCMTKTargets.cmake will contain list of available DCMTK executables and libs +# DCMTKConfigVersion.cmake provides checking of DCMTK version compatibility +# DCMTKConfig.cmake will contain options used to build this DCMTK package + +# Get and store all executable targets to DCMTKTargets.cmake within build's main dir +get_property(DCMTK_EXECUTABLE_TARGETS GLOBAL PROPERTY DCMTK_EXECUTABLE_TARGETS) +export(TARGETS ${DCMTK_EXECUTABLE_TARGETS} FILE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake") + +# Get and store libraries to DCMTKTargets.cmake within the build's main dir +get_property(DCMTK_LIBRARY_TARGETS GLOBAL PROPERTY DCMTK_LIBRARY_TARGETS) +export(TARGETS ${DCMTK_LIBRARY_TARGETS} APPEND FILE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake") + +# Create DCMTConfigVersion.cmake with basic DCMTK version information (build tree) +set(DCMTK_CONFIG_VERSION "${DCMTK_BUILD_CMKDIR}/DCMTKConfigVersion.cmake") +WRITE_BASIC_PACKAGE_VERSION_FILE( + ${DCMTK_CONFIG_VERSION} + VERSION ${DCMTK_MAJOR_VERSION}.${DCMTK_MINOR_VERSION}.${DCMTK_BUILD_VERSION} + COMPATIBILITY SameMajorVersion) + +# Depending on whether we want to create the build tree or install tree +# version of DCMTKConfig.cmake, we need to use different paths (install +# destination but also include paths set within DCMTKConfig.cmake) since +# DCMTKConfig.cmake should only contain relative paths which differ for +# build and install tree versions of the file. + +# Case 1: Configure 'DCMTKConfig.cmake' for a build tree. +set(DCMTK_CMKDIR_CONFIG "${DCMTK_BUILD_CMKDIR}") +# Collect include paths +set(DCMTK_INCLUDE_DIR_CONFIGS + "SET_AND_CHECK(DCMTK_config_INCLUDE_DIR \"${DCMTK_BINARY_DIR}/config/include/dcmtk/config\")") +foreach(module ${DCMTK_MODULES}) + set(DCMTK_INCLUDE_DIR_CONFIGS + "${DCMTK_INCLUDE_DIR_CONFIGS}\nSET_AND_CHECK(DCMTK_${module}_INCLUDE_DIR \"${DCMTK_SOURCE_DIR}/${module}/include/dcmtk/${module}\")") +endforeach() +set(DCMTK_CONFIG_CODE "####### Expanded from \@DCMTK_CONFIG_CODE\@ #######\n") +set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"${DCMTK_BINARY_DIR}/config/include\")\n") +foreach(module ${DCMTK_MODULES}) + set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"${DCMTK_SOURCE_DIR}/${module}/include\")\n") +endforeach() +set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}##################################################") +set(dcmtk_config "${DCMTK_BUILD_CMKDIR}/DCMTKConfig.cmake") +# Actually configure file and write it to build's main directory +CONFIGURE_PACKAGE_CONFIG_FILE( + ${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.cmake.in + ${dcmtk_config} + INSTALL_DESTINATION "${CMAKE_BINARY_DIR}" + PATH_VARS DCMTK_CMKDIR_CONFIG DCMTK_INCLUDE_DIR_CONFIGS + NO_CHECK_REQUIRED_COMPONENTS_MACRO) + +# Case 2: Configure 'DCMTKConfig.cmake' for an install tree +set(DCMTK_CMKDIR_CONFIG "${DCMTK_INSTALL_CMKDIR}") +# Collect include paths +set(DCMTK_INCLUDE_DIR_CONFIGS + "SET_AND_CHECK(DCMTK_config_INCLUDE_DIR \"\${PACKAGE_PREFIX_DIR}/include/dcmtk/config\")") +foreach(module ${DCMTK_MODULES}) + set(DCMTK_INCLUDE_DIR_CONFIGS + "${DCMTK_INCLUDE_DIR_CONFIGS}\nSET_AND_CHECK(DCMTK_${module}_INCLUDE_DIR \"\${PACKAGE_PREFIX_DIR}/include/dcmtk/${module}\")") +endforeach() +set(DCMTK_CONFIG_CODE "####### Expanded from \@DCMTK_CONFIG_CODE\@ #######\n") +set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"\${PACKAGE_PREFIX_DIR}/include\")\n") +set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}##################################################") +set(DCMTK_INSTALL_CONFIG "${CMAKE_BINARY_DIR}/CMakeFiles/DCMTKConfig.cmake") +# Actually configure file and set rule to install it to installation subdir +CONFIGURE_PACKAGE_CONFIG_FILE( + ${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.cmake.in + "${DCMTK_INSTALL_CONFIG}" + INSTALL_DESTINATION "${DCMTK_INSTALL_CMKDIR}" + PATH_VARS DCMTK_CMKDIR_CONFIG DCMTK_INCLUDE_DIR_CONFIGS + NO_CHECK_REQUIRED_COMPONENTS_MACRO) diff --git a/CMake/GenerateDCMTKConfigure.cmake b/CMake/GenerateDCMTKConfigure.cmake new file mode 100644 index 00000000..b067355e --- /dev/null +++ b/CMake/GenerateDCMTKConfigure.cmake @@ -0,0 +1,1527 @@ +# Set build configuration to use for configuration tests +if(CMAKE_BUILD_TYPE) + set(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}") +else() + set(CMAKE_TRY_COMPILE_CONFIGURATION "Release") +endif() + +# Compiled-in dictionary support +if(DCMTK_ENABLE_BUILTIN_DICTIONARY) + set(ENABLE_BUILTIN_DICTIONARY 1) + message(STATUS "Info: DCMTK will compile with built-in (compiled-in) dictionary") + # No extra variable needed since its only evaluated in CMake files +else() + set(ENABLE_BUILTIN_DICTIONARY "") + message(STATUS "Info: DCMTK will compile without built-in (compiled-in) dictionary") + # No extra variable needed since its only evaluated in CMake files +endif() + +# External dictionary support +if(DCMTK_ENABLE_EXTERNAL_DICTIONARY) + set(ENABLE_EXTERNAL_DICTIONARY 1) + message(STATUS "Info: DCMTK will try to load external dictionary from default path on startup") +else() + set(ENABLE_EXTERNAL_DICTIONARY "") + message(STATUS "Info: DCMTK will not try to load external dictionary from default path on startup") +endif() + + +# Private tags +if(DCMTK_ENABLE_PRIVATE_TAGS) + set(ENABLE_PRIVATE_TAGS 1) + message(STATUS "Info: DCMTK's builtin private dictionary support will be enabled") +else() + set(ENABLE_PRIVATE_TAGS "") + message(STATUS "Info: DCMTK's builtin private dictionary support will be disabled") +endif() + +# Thread support +if(DCMTK_WITH_THREADS) + set(WITH_THREADS 1) + message(STATUS "Info: Thread support will be enabled") +else() + set(WITH_THREADS "") + message(STATUS "Info: Thread support will be disabled") +endif() + +# Wide char file I/O support +if(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS) + set(WIDE_CHAR_FILE_IO_FUNCTIONS 1) + message(STATUS "Info: Wide char file I/O functions will be enabled") +else() + set(WIDE_CHAR_FILE_IO_FUNCTIONS "") + message(STATUS "Info: Wide char file I/O functions will be disabled") +endif() + +# Wide char main function +if(DCMTK_WIDE_CHAR_MAIN_FUNCTION) + set(WIDE_CHAR_MAIN_FUNCTION 1) + message(STATUS "Info: Wide char main function for command line tools will be enabled") +else() + set(WIDE_CHAR_MAIN_FUNCTION "") + message(STATUS "Info: Wide char main function for command line tools will be disabled") +endif() + +if(NOT DCMTK_ENABLE_CHARSET_CONVERSION) + set(DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING "Select character set conversion implementation.") + if(DCMTK_WITH_ICONV) + if(DCMTK_WITH_ICU) + message(WARNING "Warning: Both ICU and the libiconv are available, using libiconv. Modify DCMTK_ENABLE_CHARSET_CONVERSION for switching to ICU") + endif() + set(DCMTK_ENABLE_CHARSET_CONVERSION "libiconv" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}") + elseif(DCMTK_WITH_ICU) + set(DCMTK_ENABLE_CHARSET_CONVERSION "ICU" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}") + elseif(DCMTK_WITH_STDLIBC_ICONV) + set(DCMTK_ENABLE_CHARSET_CONVERSION "stdlibc (iconv)" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}") + else() + set(DCMTK_ENABLE_CHARSET_CONVERSION "" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}") + endif() +endif() + +set(DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES) +if(DCMTK_WITH_ICONV) + list(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "libiconv") +endif() +if(DCMTK_WITH_ICU) + list(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "ICU") +endif() +if(DCMTK_WITH_STDLIBC_ICONV) + list(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "stdlibc (iconv)") +endif() +set_property(CACHE DCMTK_ENABLE_CHARSET_CONVERSION PROPERTY STRINGS ${DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES} "") + +if(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "libiconv" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_ICONV") + message(STATUS "Info: Building DCMTK with character set conversion support using libiconv") + set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICONV") + set(CHARSET_CONVERSION_LIBS ${LIBICONV_LIBS}) +elseif(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "ICU" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_ICU") + message(STATUS "Info: Building DCMTK with character set conversion support using the ICU") + set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICU") + set(CHARSET_CONVERSION_LIBS ${ICU_LIBS}) +elseif(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "stdlibc (iconv)" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV") + message(STATUS "Info: Building DCMTK with character set conversion support using builtin iconv functions from the C standard library") + set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV") +else() + message(STATUS "Info: Building DCMTK without character set conversion support") + set(DCMTK_ENABLE_CHARSET_CONVERSION OFF) +endif() + +# Standard C++ headers (currently hard-coded) +#if(VTK_USE_ANSI_STDLIB) + set(USE_STD_CXX_INCLUDES 1) +#else() +# set(USE_STD_CXX_INCLUDES "") +#endif() + +# Configure file + +# Windows being windows, it lies about its processor type to 32 bit binaries +set(SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}") +if(NOT SYSTEM_PROCESSOR) + set(SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}") +endif() +# CMake doesn't provide a configure-style system type string +set(CANONICAL_HOST_TYPE "${SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}") +DCMTK_UNSET(SYSTEM_PROCESSOR) + +# Configure dictionary path and install prefix +if(WIN32 AND NOT CYGWIN) + # Set DCMTK_PREFIX needed within some code. Be sure that all / are replaced by \\. + set(DCMTK_PREFIX "${CMAKE_INSTALL_PREFIX}") + string(REGEX REPLACE "/" "\\\\\\\\" DCMTK_PREFIX "${DCMTK_PREFIX}") + # Set path and multiple path separator being used in dictionary code etc. + set(PATH_SEPARATOR "\\\\") + set(ENVIRONMENT_PATH_SEPARATOR ";") + # Set dictionary path to the data dir inside install main dir (prefix) + if(DCMTK_ENABLE_EXTERNAL_DICTIONARY) + set(DCM_DICT_DEFAULT_PATH "${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\dicom.dic") + # If private dictionary should be utilized, add it to default dictionary path. + if(ENABLE_PRIVATE_TAGS) + set(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH};${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\private.dic") + endif() + # Again, for Windows strip all / from path and replace it with \\. + string(REGEX REPLACE "/" "\\\\\\\\" DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH}") + else() + set(DCM_DICT_DEFAULT_PATH "") + endif() + # Set default directory for configuration and support data. + set(DCMTK_DEFAULT_CONFIGURATION_DIR "") + set(DCMTK_DEFAULT_SUPPORT_DATA_DIR "") +else() + # Set DCMTK_PREFIX needed within some code. + set(DCMTK_PREFIX "${CMAKE_INSTALL_PREFIX}") + # Set path and multiple path separator being used in dictionary code etc. + set(PATH_SEPARATOR "/") + set(ENVIRONMENT_PATH_SEPARATOR ":") + # Set dictionary path to the data dir inside install main dir (prefix). + if(DCMTK_ENABLE_EXTERNAL_DICTIONARY) + set(DCM_DICT_DEFAULT_PATH "${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/dicom.dic") + # If private dictionary should be utilized, add it to default dictionary path. + if(ENABLE_PRIVATE_TAGS) + set(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH}:${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/private.dic") + endif() + else() + set(DCM_DICT_DEFAULT_PATH "") + endif() + # Set default directory for configuration and support data. + set(DCMTK_DEFAULT_CONFIGURATION_DIR "${DCMTK_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}/dcmtk/") + set(DCMTK_DEFAULT_SUPPORT_DATA_DIR "${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/") +endif() + +# Check the sizes of various types +include (CheckTypeSize) +CHECK_TYPE_SIZE("char" SIZEOF_CHAR) +CHECK_TYPE_SIZE("double" SIZEOF_DOUBLE) +CHECK_TYPE_SIZE("float" SIZEOF_FLOAT) +CHECK_TYPE_SIZE("int" SIZEOF_INT) +CHECK_TYPE_SIZE("long" SIZEOF_LONG) +CHECK_TYPE_SIZE("short" SIZEOF_SHORT) +CHECK_TYPE_SIZE("void*" SIZEOF_VOID_P) + +# Check for include files, libraries, and functions +include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryCompile.cmake") +include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryRun.cmake") +include("${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake") +include("${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake") +include("${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake") +include("${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake") +include("${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake") +include("${DCMTK_CMAKE_INCLUDE}CMake/CheckFunctionWithHeaderExists.cmake") +include(CheckCXXSymbolExists OPTIONAL) +if(NOT COMMAND CHECK_CXX_SYMBOL_EXISTS) + # fallback implementation for old CMake Versions + function(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VAR) + set(CODE) + foreach(FILE ${FILES}) + set(CODE "${CODE}#include <${FILE}>\n") + endforeach() + set(CODE "${CODE}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n") + DCMTK_TRY_COMPILE("${VAR}" "the compiler supports ${SYMBOL}" "${CODE}") + endfunction() +endif() + +foreach(FUNC "__FUNCTION__" "__PRETTY_FUNCTION__" "__func__") + CHECK_SYMBOL_EXISTS("${FUNC}" "" "HAVE_${FUNC}_C_MACRO") + # test if the C++ compiler also supports them (e.g. SunPro doesn't) + CHECK_CXX_SYMBOL_EXISTS("${FUNC}" "" "HAVE_${FUNC}_CXX_MACRO") + if(HAVE_${FUNC}_C_MACRO AND HAVE_${FUNC}_CXX_MACRO) + set("HAVE_${FUNC}_MACRO" 1 CACHE INTERNAL "Have symbol ${FUNC}" FORCE) + else() + set("HAVE_${FUNC}_MACRO" CACHE INTERNAL "Have symbol ${FUNC}" FORCE) + endif() +endforeach() + +# prepare include directories for 3rdparty libraries before performing +# header searches +if(ZLIB_INCDIR) + list(APPEND CMAKE_REQUIRED_INCLUDES "${ZLIB_INCDIR}") +endif() + +if(ZLIB_INCLUDE_DIRS) + list(APPEND CMAKE_REQUIRED_INCLUDES "${ZLIB_INCLUDE_DIRS}") +endif() + +if(LIBPNG_INCDIR) + list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPNG_INCDIR}") +endif() + +if(PNG_INCLUDE_DIR) + list(APPEND CMAKE_REQUIRED_INCLUDES "${PNG_INCLUDE_DIR}") +endif() + +if(OPENSSL_INCDIR) + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") +endif() + +if(OPENSSL_INCLUDE_DIR) + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") +endif() + +# For Windows, hardcode these values to avoid long search times +if(WIN32 AND NOT CYGWIN) + CHECK_INCLUDE_FILE_CXX("windows.h" HAVE_WINDOWS_H) + CHECK_INCLUDE_FILE_CXX("winsock.h" HAVE_WINSOCK_H) +endif() + + CHECK_INCLUDE_FILE_CXX("errno.h" HAVE_ERRNO_H) + CHECK_INCLUDE_FILE_CXX("dirent.h" HAVE_DIRENT_H) + CHECK_INCLUDE_FILE_CXX("fcntl.h" HAVE_FCNTL_H) + CHECK_INCLUDE_FILE_CXX("fstream" HAVE_FSTREAM) + CHECK_INCLUDE_FILE_CXX("fstream.h" HAVE_FSTREAM_H) + CHECK_INCLUDE_FILE_CXX("fnmatch.h" HAVE_FNMATCH_H) + CHECK_INCLUDE_FILE_CXX("float.h" HAVE_FLOAT_H) + CHECK_INCLUDE_FILE_CXX("grp.h" HAVE_GRP_H) + CHECK_INCLUDE_FILE_CXX("malloc.h" HAVE_MALLOC_H) + CHECK_INCLUDE_FILE_CXX("math.h" HAVE_MATH_H) + CHECK_INCLUDE_FILE_CXX("cmath" HAVE_CMATH) + CHECK_INCLUDE_FILE_CXX("ieeefp.h" HAVE_IEEEFP_H) + CHECK_INCLUDE_FILE_CXX("inttypes.h" HAVE_INTTYPES_H) + CHECK_INCLUDE_FILE_CXX("iomanip" HAVE_IOMANIP) + CHECK_INCLUDE_FILE_CXX("iomanip.h" HAVE_IOMANIP_H) + CHECK_INCLUDE_FILE_CXX("iostream" HAVE_IOSTREAM) + CHECK_INCLUDE_FILE_CXX("iostream.h" HAVE_IOSTREAM_H) + CHECK_INCLUDE_FILE_CXX("io.h" HAVE_IO_H) + CHECK_INCLUDE_FILE_CXX("iso646.h" HAVE_ISO646_H) + CHECK_INCLUDE_FILE_CXX("png.h" HAVE_PNG_H) + CHECK_INCLUDE_FILE_CXX("limits.h" HAVE_LIMITS_H) + CHECK_INCLUDE_FILE_CXX("climits" HAVE_CLIMITS) + CHECK_INCLUDE_FILE_CXX("locale.h" HAVE_LOCALE_H) + CHECK_INCLUDE_FILE_CXX("ndir.h" HAVE_NDIR_H) + CHECK_INCLUDE_FILE_CXX("netdb.h" HAVE_NETDB_H) + CHECK_INCLUDE_FILE_CXX("new.h" HAVE_NEW_H) + CHECK_INCLUDE_FILE_CXX("pwd.h" HAVE_PWD_H) + CHECK_INCLUDE_FILE_CXX("semaphore.h" HAVE_SEMAPHORE_H) + CHECK_INCLUDE_FILE_CXX("setjmp.h" HAVE_SETJMP_H) + CHECK_INCLUDE_FILE_CXX("sstream" HAVE_SSTREAM) + CHECK_INCLUDE_FILE_CXX("sstream.h" HAVE_SSTREAM_H) + CHECK_INCLUDE_FILE_CXX("stat.h" HAVE_STAT_H) + CHECK_INCLUDE_FILE_CXX("stdbool.h" HAVE_STDBOOL_H) + CHECK_INCLUDE_FILE_CXX("stddef.h" HAVE_STDDEF_H) + CHECK_INCLUDE_FILE_CXX("cstddef" HAVE_CSTDDEF) + CHECK_INCLUDE_FILE_CXX("stdint.h" HAVE_STDINT_H) + CHECK_INCLUDE_FILE_CXX("cstdint" HAVE_CSTDINT) + CHECK_INCLUDE_FILE_CXX("stdio.h" HAVE_STDIO_H) + CHECK_INCLUDE_FILE_CXX("cstdio" HAVE_CSTDIO) + CHECK_INCLUDE_FILE_CXX("streambuf.h" HAVE_STREAMBUF_H) + CHECK_INCLUDE_FILE_CXX("strings.h" HAVE_STRINGS_H) + CHECK_INCLUDE_FILE_CXX("string.h" HAVE_STRING_H) + CHECK_INCLUDE_FILE_CXX("strstream.h" HAVE_STRSTREAM_H) + CHECK_INCLUDE_FILE_CXX("strstream" HAVE_STRSTREAM) + CHECK_INCLUDE_FILE_CXX("strstrea.h" HAVE_STRSTREA_H) + CHECK_INCLUDE_FILE_CXX("synch.h" HAVE_SYNCH_H) + CHECK_INCLUDE_FILE_CXX("syslog.h" HAVE_SYSLOG_H) + CHECK_INCLUDE_FILE_CXX("sys/errno.h" HAVE_SYS_ERRNO_H) + CHECK_INCLUDE_FILE_CXX("sys/dir.h" HAVE_SYS_DIR_H) + CHECK_INCLUDE_FILE_CXX("sys/file.h" HAVE_SYS_FILE_H) + CHECK_INCLUDE_FILE_CXX("sys/ndir.h" HAVE_SYS_NDIR_H) + CHECK_INCLUDE_FILE_CXX("sys/param.h" HAVE_SYS_PARAM_H) + CHECK_INCLUDE_FILE_CXX("sys/resource.h" HAVE_SYS_RESOURCE_H) + CHECK_INCLUDE_FILE_CXX("sys/select.h" HAVE_SYS_SELECT_H) + CHECK_INCLUDE_FILE_CXX("sys/syscall.h" HAVE_SYS_SYSCALL_H) + CHECK_INCLUDE_FILE_CXX("sys/systeminfo.h" HAVE_SYS_SYSTEMINFO_H) + CHECK_INCLUDE_FILE_CXX("sys/time.h" HAVE_SYS_TIME_H) + CHECK_INCLUDE_FILE_CXX("sys/timeb.h" HAVE_SYS_TIMEB_H) + CHECK_INCLUDE_FILE_CXX("sys/types.h" HAVE_SYS_TYPES_H) + CHECK_INCLUDE_FILE_CXX("sys/utime.h" HAVE_SYS_UTIME_H) + CHECK_INCLUDE_FILE_CXX("sys/utsname.h" HAVE_SYS_UTSNAME_H) + CHECK_INCLUDE_FILE_CXX("sys/wait.h" HAVE_SYS_WAIT_H) + CHECK_INCLUDE_FILE_CXX("sys/socket.h" HAVE_SYS_SOCKET_H) + CHECK_INCLUDE_FILE_CXX("thread.h" HAVE_THREAD_H) + CHECK_INCLUDE_FILE_CXX("process.h" HAVE_PROCESS_H) + CHECK_INCLUDE_FILE_CXX("sys/stat.h" HAVE_SYS_STAT_H) + CHECK_INCLUDE_FILE_CXX("time.h" HAVE_TIME_H) + CHECK_INCLUDE_FILE_CXX("unistd.h" HAVE_UNISTD_H) + CHECK_INCLUDE_FILE_CXX("unix.h" HAVE_UNIX_H) + CHECK_INCLUDE_FILE_CXX("utime.h" HAVE_UTIME_H) + CHECK_INCLUDE_FILE_CXX("wchar.h" HAVE_WCHAR_H) + CHECK_INCLUDE_FILE_CXX("wctype.h" HAVE_WCTYPE_H) + CHECK_INCLUDE_FILE_CXX("alloca.h" HAVE_ALLOCA_H) + CHECK_INCLUDE_FILE_CXX("arpa/inet.h" HAVE_ARPA_INET_H) + CHECK_INCLUDE_FILE_CXX("ctype.h" HAVE_CTYPE_H) + CHECK_INCLUDE_FILE_CXX("memory.h" HAVE_MEMORY_H) + CHECK_INCLUDE_FILE_CXX("pthread.h" HAVE_PTHREAD_H) + CHECK_INCLUDE_FILE_CXX("libc.h" HAVE_LIBC_H) + CHECK_INCLUDE_FILE_CXX("stdlib.h" HAVE_STDLIB_H) + CHECK_INCLUDE_FILE_CXX("stdarg.h" HAVE_STDARG_H) + CHECK_INCLUDE_FILE_CXX("cstdarg" HAVE_CSTDARG) + CHECK_INCLUDE_FILE_CXX("signal.h" HAVE_SIGNAL_H) + CHECK_INCLUDE_FILE_CXX("fenv.h" HAVE_FENV_H) + CHECK_INCLUDE_FILE_CXX("iterator" HAVE_ITERATOR_HEADER) + +if(NOT APPLE) + # poll on macOS is unreliable, it first did not exist, then was broken until + # fixed in 10.9 only to break again in 10.12. + CHECK_INCLUDE_FILE_CXX("poll.h" DCMTK_HAVE_POLL) + if(DCMTK_HAVE_POLL) + add_definitions(-DDCMTK_HAVE_POLL=1) + endif() +endif() + + # This mimics the autoconf test. There are systems out there + # (e.g. FreeBSD and NeXT) where tcp.h can't be compiled on its own. + set(TCP_H_DEPS "") + if(HAVE_SYS_TYPES_H) + # This one is needed to make FreeBSD happy + set(TCP_H_DEPS "sys/types.h") + endif() + CHECK_INCLUDE_FILES("${TCP_H_DEPS};netinet/in_systm.h" HAVE_NETINET_IN_SYSTM_H) + if(HAVE_NETINET_IN_SYSTM_H) + set(TCP_H_DEPS "${TCP_H_DEPS};netinet/in_systm.h") + endif() + CHECK_INCLUDE_FILES("${TCP_H_DEPS};netinet/in.h" HAVE_NETINET_IN_H) + if(HAVE_NETINET_IN_H) + set(TCP_H_DEPS "${TCP_H_DEPS};netinet/in.h") + endif() + CHECK_INCLUDE_FILES("${TCP_H_DEPS};netinet/tcp.h" HAVE_NETINET_TCP_H) + + if(NOT HAVE_PNG_H) + # is unavailable, so test if we need to include it as + CHECK_INCLUDE_FILE_CXX("libpng/png.h" HAVE_LIBPNG_PNG_H) + else() + # ensure including is preferred + DCMTK_UNSET_CACHE(HAVE_LIBPNG_PNG_H) + endif() + + # There is no CMake macro to take care of these yet + + if(WIN32 AND NOT CYGWIN AND NOT MINGW) + set(HAVE_NO_TYPEDEF_SSIZE_T TRUE) + set(HAVE_NO_TYPEDEF_PID_T TRUE) + else() + set(HAVE_NO_TYPEDEF_PID_T FALSE) + set(HAVE_NO_TYPEDEF_SIZE_T FALSE) + if(NOT ${HAVE_SYS_TYPES_H}) + set(HAVE_NO_TYPEDEF_SSIZE_T TRUE) + endif() + endif() + + set(HEADERS) + + if(HAVE_IO_H) + set(HEADERS ${HEADERS} io.h) + endif() + + if(HAVE_IOSTREAM_H) + set(HEADERS ${HEADERS} iostream.h) + endif() + + if(HAVE_MATH_H) + set(HEADERS ${HEADERS} math.h) + endif() + + if(HAVE_LIBC_H) + set(HEADERS ${HEADERS} libc.h) + endif() + + if(HAVE_THREAD_H) + set(HEADERS ${HEADERS} thread.h) + endif() + + if(HAVE_PROCESS_H) + set(HEADERS ${HEADERS} process.h) + endif() + + if(HAVE_PTHREAD_H) + set(HEADERS ${HEADERS} pthread.h) + endif() + + if(HAVE_UNISTD_H) + set(HEADERS ${HEADERS} unistd.h) + endif() + + if(HAVE_STDLIB_H) + set(HEADERS ${HEADERS} stdlib.h) + endif() + + if(HAVE_STDINT_H) + set(HEADERS ${HEADERS} stdint.h) + endif() + + if(HAVE_STDDEF_H) + set(HEADERS ${HEADERS} stddef.h) + endif() + + if(HAVE_NETDB_H) + set(HEADERS ${HEADERS} netdb.h) + endif() + + if(HAVE_SYS_FILE_H) + set(HEADERS ${HEADERS} sys/file.h) + endif() + + if(HAVE_STRING_H) + set(HEADERS ${HEADERS} string.h) + endif() + + if(HAVE_STRINGS_H) + set(HEADERS ${HEADERS} strings.h) + endif() + + if(HAVE_SYS_WAIT_H) + set(HEADERS ${HEADERS} sys/wait.h) + endif() + + if(HAVE_SYS_TIME_H) + set(HEADERS ${HEADERS} sys/time.h) + endif() + + if(HAVE_SYS_RESOURCE_H) + set(HEADERS ${HEADERS} sys/resource.h) + endif() + + if(HAVE_SYS_TYPES_H) + set(HEADERS ${HEADERS} sys/types.h) + endif() + + if(HAVE_SYS_SOCKET_H) + set(HEADERS ${HEADERS} sys/socket.h) + endif() + + if(HAVE_SYS_STAT_H) + set(HEADERS ${HEADERS} sys/stat.h) + endif() + + if(HAVE_SYS_TIMEB_H) + set(HEADERS ${HEADERS} sys/timeb.h) + endif() + + if(HAVE_STDARG_H) + set(HEADERS ${HEADERS} stdarg.h) + endif() + + if(HAVE_STDIO_H) + set(HEADERS ${HEADERS} stdio.h) + endif() + + if(HAVE_SYS_SELECT_H) + set(HEADERS ${HEADERS} sys/select.h) + endif() + + if(HAVE_WINDOWS_H) + # also add winsock2.h and ws2tcpip.h that are available since Windows NT 4.0 + set(HEADERS ${HEADERS} winsock2.h ws2tcpip.h windows.h) + endif() + + if(HAVE_GRP_H) + set(HEADERS ${HEADERS} grp.h) + endif() + + if(HAVE_PWD_H) + set(HEADERS ${HEADERS} pwd.h) + endif() + + if(HAVE_DIRENT_H) + set(HEADERS ${HEADERS} dirent.h) + endif() + + if(HAVE_SYS_SYSCALL_H) + set(HEADERS ${HEADERS} sys/syscall.h) + endif() + + if(HAVE_WINSOCK_H) + set(HEADERS ${HEADERS} winsock.h) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} iphlpapi ws2_32 netapi32 wsock32) + endif() + + if(HAVE_FENV_H) + set(HEADERS ${HEADERS} fenv.h) + endif() + + # std::vsnprintf and std::vsnprintf need the C++ version of the headers. + # We just assume they exist when the C version was found + set(CXXHEADERS) + + if(HAVE_CMATH) + set(CXXHEADERS ${CXXHEADERS} cmath) + endif() + + if(HAVE_CSTDIO) + set(CXXHEADERS ${CXXHEADERS} cstdio) + endif() + + if(HAVE_CSTDARG) + set(CXXHEADERS ${CXXHEADERS} cstdarg) + endif() + + if(HAVE_CSTDINT) + set(CXXHEADERS ${CXXHEADERS} cstdint) + endif() + + if(HAVE_CSTDDEF) + set(CXXHEADERS ${CXXHEADERS} cstddef) + endif() + + if(WIN32) + # CHECK_FUNCTION_EXISTS does not work correctly on Windows (due to symbol name mangling) + # use CHECK_SYMBOL_EXISTS instead + macro(CHECK_FUNCTION_EXISTS FUNCTION VAR) + check_symbol_exists("${FUNCTION}" "${HEADERS}" "${VAR}") + endmacro() + endif() + + CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT) + CHECK_FUNCTION_EXISTS(accept HAVE_ACCEPT) + CHECK_FUNCTION_EXISTS(access HAVE_ACCESS) + CHECK_FUNCTION_EXISTS(atoll HAVE_ATOLL) + CHECK_FUNCTION_EXISTS(bcmp HAVE_BCMP) + CHECK_FUNCTION_EXISTS(bcopy HAVE_BCOPY) + CHECK_FUNCTION_EXISTS(bind HAVE_BIND) + CHECK_FUNCTION_EXISTS(bzero HAVE_BZERO) + CHECK_FUNCTION_EXISTS(cuserid HAVE_CUSERID) + CHECK_FUNCTION_EXISTS(_doprnt HAVE_DOPRNT) + CHECK_FUNCTION_EXISTS(finite HAVE_FINITE) + CHECK_FUNCTION_EXISTS(flock HAVE_FLOCK) + CHECK_FUNCTION_EXISTS(fork HAVE_FORK) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) + CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO) + CHECK_FUNCTION_EXISTS(getenv HAVE_GETENV) + CHECK_FUNCTION_EXISTS(geteuid HAVE_GETEUID) + CHECK_FUNCTION_EXISTS(getgrnam HAVE_GETGRNAM) + CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME) + CHECK_FUNCTION_EXISTS(gethostbyname_r HAVE_GETHOSTBYNAME_R) + CHECK_FUNCTION_EXISTS(gethostbyaddr_r HAVE_GETHOSTBYADDR_R) + CHECK_FUNCTION_EXISTS(gethostname HAVE_GETHOSTNAME) + CHECK_FUNCTION_EXISTS(gethostid HAVE_GETHOSTID) + CHECK_FUNCTION_EXISTS(getlogin HAVE_GETLOGIN) + CHECK_FUNCTION_EXISTS(getlogin_r HAVE_GETLOGIN_R) + CHECK_FUNCTION_EXISTS(getpid HAVE_GETPID) + CHECK_FUNCTION_EXISTS(getpwnam HAVE_GETPWNAM) + CHECK_FUNCTION_EXISTS(getrusage HAVE_GETRUSAGE) + CHECK_FUNCTION_EXISTS(getsockname HAVE_GETSOCKNAME) + CHECK_FUNCTION_EXISTS(getsockopt HAVE_GETSOCKOPT) + CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) + CHECK_FUNCTION_EXISTS(getuid HAVE_GETUID) + CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R) + CHECK_FUNCTION_EXISTS(index HAVE_INDEX) + CHECK_FUNCTION_EXISTS(isinf HAVE_ISINF) + CHECK_FUNCTION_EXISTS(isnan HAVE_ISNAN) + CHECK_FUNCTION_EXISTS(itoa HAVE_ITOA) + CHECK_FUNCTION_EXISTS(listen HAVE_LISTEN) + CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS(lockf HAVE_LOCKF) + CHECK_FUNCTION_EXISTS(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS(malloc_debug HAVE_MALLOC_DEBUG) + CHECK_FUNCTION_EXISTS(mbstowcs HAVE_MBSTOWCS) + CHECK_FUNCTION_EXISTS(wcstombs HAVE_WCSTOMBS) + CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE) + CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP) + CHECK_FUNCTION_EXISTS(mktemp HAVE_MKTEMP) + CHECK_FUNCTION_EXISTS(rindex HAVE_RINDEX) + CHECK_FUNCTION_EXISTS(select HAVE_SELECT) + CHECK_FUNCTION_EXISTS(setsockopt HAVE_SETSOCKOPT) + CHECK_FUNCTION_EXISTS(setuid HAVE_SETUID) + CHECK_FUNCTION_EXISTS(sleep HAVE_SLEEP) + CHECK_FUNCTION_EXISTS(socket HAVE_SOCKET) + CHECK_FUNCTION_EXISTS(stat HAVE_STAT) + CHECK_FUNCTION_EXISTS(strchr HAVE_STRCHR) + CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP) + CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR) + CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT) + CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY) + CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR) + CHECK_FUNCTION_EXISTS(strtoul HAVE_STRTOUL) + CHECK_FUNCTION_EXISTS(sysinfo HAVE_SYSINFO) + CHECK_FUNCTION_EXISTS(tempnam HAVE_TEMPNAM) + CHECK_FUNCTION_EXISTS(tmpnam HAVE_TMPNAM) + CHECK_FUNCTION_EXISTS(uname HAVE_UNAME) + CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP) + CHECK_FUNCTION_EXISTS(wait3 HAVE_WAIT3) + CHECK_FUNCTION_EXISTS(waitpid HAVE_WAITPID) + CHECK_FUNCTION_EXISTS(_findfirst HAVE__FINDFIRST) + CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP) + + CHECK_FUNCTIONWITHHEADER_EXISTS(feenableexcept "${HEADERS}" HAVE_PROTOTYPE_FEENABLEEXCEPT) + CHECK_FUNCTIONWITHHEADER_EXISTS("isinf(0.)" "${HEADERS}" HAVE_PROTOTYPE_ISINF) + CHECK_FUNCTIONWITHHEADER_EXISTS("isnan(0.)" "${HEADERS}" HAVE_PROTOTYPE_ISNAN) + CHECK_FUNCTIONWITHHEADER_EXISTS(finite "${HEADERS}" HAVE_PROTOTYPE_FINITE) + CHECK_FUNCTIONWITHHEADER_EXISTS("std::isinf(0.)" "${CXXHEADERS}" HAVE_PROTOTYPE_STD__ISINF) + CHECK_FUNCTIONWITHHEADER_EXISTS("std::isnan(0.)" "${CXXHEADERS}" HAVE_PROTOTYPE_STD__ISNAN) + CHECK_FUNCTIONWITHHEADER_EXISTS(std::finite "${HEADERS}" HAVE_PROTOTYPE_STD__FINITE) + CHECK_FUNCTIONWITHHEADER_EXISTS(flock "${HEADERS}" HAVE_PROTOTYPE_FLOCK) + CHECK_FUNCTIONWITHHEADER_EXISTS(gethostbyname "${HEADERS}" HAVE_PROTOTYPE_GETHOSTBYNAME) + CHECK_FUNCTIONWITHHEADER_EXISTS(gethostbyname_r "${HEADERS}" HAVE_PROTOTYPE_GETHOSTBYNAME_R) + CHECK_FUNCTIONWITHHEADER_EXISTS(gethostbyaddr_r "${HEADERS}" HAVE_PROTOTYPE_GETHOSTBYADDR_R) + CHECK_FUNCTIONWITHHEADER_EXISTS(gethostid "${HEADERS}" HAVE_PROTOTYPE_GETHOSTID) + CHECK_FUNCTIONWITHHEADER_EXISTS(bzero "${HEADERS}" HAVE_PROTOTYPE_BZERO) + CHECK_FUNCTIONWITHHEADER_EXISTS(gethostname "${HEADERS}" HAVE_PROTOTYPE_GETHOSTNAME) + CHECK_FUNCTIONWITHHEADER_EXISTS(waitpid "${HEADERS}" HAVE_PROTOTYPE_WAITPID) + CHECK_FUNCTIONWITHHEADER_EXISTS(wait3 "${HEADERS}" HAVE_PROTOTYPE_WAIT3) + CHECK_FUNCTIONWITHHEADER_EXISTS(usleep "${HEADERS}" HAVE_PROTOTYPE_USLEEP) + CHECK_FUNCTIONWITHHEADER_EXISTS(accept "${HEADERS}" HAVE_PROTOTYPE_ACCEPT) + CHECK_FUNCTIONWITHHEADER_EXISTS(bind "${HEADERS}" HAVE_PROTOTYPE_BIND) + CHECK_FUNCTIONWITHHEADER_EXISTS(getsockname "${HEADERS}" HAVE_PROTOTYPE_GETSOCKNAME) + CHECK_FUNCTIONWITHHEADER_EXISTS(getsockopt "${HEADERS}" HAVE_PROTOTYPE_GETSOCKOPT) + CHECK_FUNCTIONWITHHEADER_EXISTS(getsockname "${HEADERS}" HAVE_PROTOTYPE_GETSOCKNAME) + CHECK_FUNCTIONWITHHEADER_EXISTS(setsockopt "${HEADERS}" HAVE_PROTOTYPE_SETSOCKOPT) + CHECK_FUNCTIONWITHHEADER_EXISTS(socket "${HEADERS}" HAVE_PROTOTYPE_SOCKET) + CHECK_FUNCTIONWITHHEADER_EXISTS(listen "${HEADERS}" HAVE_PROTOTYPE_LISTEN) + CHECK_FUNCTIONWITHHEADER_EXISTS(_vsnprintf_s "${HEADERS}" HAVE__VSNPRINTF_S) + CHECK_FUNCTIONWITHHEADER_EXISTS(vfprintf_s "${HEADERS}" HAVE_VFPRINTF_S) + CHECK_FUNCTIONWITHHEADER_EXISTS(vprintf "${HEADERS}" HAVE_VPRINTF) + CHECK_FUNCTIONWITHHEADER_EXISTS(vsnprintf "${HEADERS}" HAVE_VSNPRINTF) + CHECK_FUNCTIONWITHHEADER_EXISTS(vsprintf_s "${HEADERS}" HAVE_VSPRINTF_S) + CHECK_FUNCTIONWITHHEADER_EXISTS(std::vfprintf "${CXXHEADERS}" HAVE_PROTOTYPE_STD__VFPRINTF) + CHECK_FUNCTIONWITHHEADER_EXISTS(std::vsnprintf "${CXXHEADERS}" HAVE_PROTOTYPE_STD__VSNPRINTF) + CHECK_FUNCTIONWITHHEADER_EXISTS(_stricmp "${HEADERS}" HAVE_PROTOTYPE__STRICMP) + # "definition" is an (exchangeable) identifier that is needed for successful compile test + CHECK_FUNCTIONWITHHEADER_EXISTS("socklen_t definition" "${HEADERS}" HAVE_DECLARATION_SOCKLEN_T) + CHECK_FUNCTIONWITHHEADER_EXISTS(gettimeofday "${HEADERS}" HAVE_PROTOTYPE_GETTIMEOFDAY) + CHECK_FUNCTIONWITHHEADER_EXISTS(connect "${HEADERS}" HAVE_PROTOTYPE_CONNECT) + CHECK_FUNCTIONWITHHEADER_EXISTS(mkstemp "${HEADERS}" HAVE_PROTOTYPE_MKSTEMP) + CHECK_FUNCTIONWITHHEADER_EXISTS(mktemp "${HEADERS}" HAVE_PROTOTYPE_MKTEMP) + CHECK_FUNCTIONWITHHEADER_EXISTS(memcmp "${HEADERS}" HAVE_MEMCMP) + CHECK_FUNCTIONWITHHEADER_EXISTS(memcpy "${HEADERS}" HAVE_MEMCPY) + CHECK_FUNCTIONWITHHEADER_EXISTS(memset "${HEADERS}" HAVE_MEMSET) + CHECK_FUNCTIONWITHHEADER_EXISTS(select "${HEADERS}" HAVE_PROTOTYPE_SELECT) + CHECK_FUNCTIONWITHHEADER_EXISTS(strcasecmp "${HEADERS}" HAVE_PROTOTYPE_STRCASECMP) + CHECK_FUNCTIONWITHHEADER_EXISTS(strncasecmp "${HEADERS}" HAVE_PROTOTYPE_STRNCASECMP) + CHECK_FUNCTIONWITHHEADER_EXISTS(strerror_r "${HEADERS}" HAVE_PROTOTYPE_STRERROR_R) + CHECK_FUNCTIONWITHHEADER_EXISTS(SYS_gettid "${HEADERS}" HAVE_SYS_GETTID) + # "definition" is an (exchangeable) identifier that is needed for successful compile test + CHECK_FUNCTIONWITHHEADER_EXISTS("std::ios_base::openmode definition" "${CXXHEADERS}" HAVE_DECLARATION_STD__IOS_BASE__OPENMODE) + CHECK_FUNCTIONWITHHEADER_EXISTS(pthread_rwlock_init "${HEADERS}" HAVE_PTHREAD_RWLOCK) + CHECK_FUNCTIONWITHHEADER_EXISTS("__sync_add_and_fetch((int*)0,0)" "${HEADERS}" HAVE_SYNC_ADD_AND_FETCH) + CHECK_FUNCTIONWITHHEADER_EXISTS("__sync_sub_and_fetch((int*)0,0)" "${HEADERS}" HAVE_SYNC_SUB_AND_FETCH) + CHECK_FUNCTIONWITHHEADER_EXISTS("InterlockedIncrement((long*)0)" "${HEADERS}" HAVE_INTERLOCKED_INCREMENT) + CHECK_FUNCTIONWITHHEADER_EXISTS("InterlockedDecrement((long*)0)" "${HEADERS}" HAVE_INTERLOCKED_DECREMENT) + CHECK_FUNCTIONWITHHEADER_EXISTS("_fpclassf(0.0f)" "${HEADERS}" HAVE_PROTOTYPE__FPCLASSF) + CHECK_FUNCTIONWITHHEADER_EXISTS("getgrnam_r((char*)0,(group*)0,(char*)0,0,(group**)0)" "${HEADERS}" HAVE_GETGRNAM_R) + CHECK_FUNCTIONWITHHEADER_EXISTS("getpwnam_r((char*)0,(passwd*)0,(char*)0,0,(passwd**)0)" "${HEADERS}" HAVE_GETPWNAM_R) + CHECK_FUNCTIONWITHHEADER_EXISTS("readdir_r((DIR*)0,(dirent*)0,(dirent**)0)" "${HEADERS}" HAVE_READDIR_R) + CHECK_FUNCTIONWITHHEADER_EXISTS("readdir_r((DIR*)0,(dirent*)0)" "${HEADERS}" HAVE_OLD_READDIR_R) + CHECK_FUNCTIONWITHHEADER_EXISTS(nanosleep "${HEADERS}" HAVE_PROTOTYPE_NANOSLEEP) + CHECK_FUNCTIONWITHHEADER_EXISTS("&passwd::pw_gecos" "${HEADERS}" HAVE_PASSWD_GECOS) + CHECK_FUNCTIONWITHHEADER_EXISTS("TryAcquireSRWLockShared((PSRWLOCK)0)" "${HEADERS}" HAVE_PROTOTYPE_TRYACQUIRESRWLOCKSHARED) + + # Check for some type definitions needed by JasPer and defines them if necessary + # Even if not functions but types are looked for, the script works fine. + # "definition" is an (exchangeable) identifier that is needed for successful compile test + CHECK_FUNCTIONWITHHEADER_EXISTS("uchar definition" "${HEADERS}" HAVE_UCHAR_TYPEDEF) + CHECK_FUNCTIONWITHHEADER_EXISTS("ushort definition" "${HEADERS}" HAVE_USHORT_TYPEDEF) + CHECK_FUNCTIONWITHHEADER_EXISTS("uint definition" "${HEADERS}" HAVE_UINT_TYPEDEF) + CHECK_FUNCTIONWITHHEADER_EXISTS("ulong definition" "${HEADERS}" HAVE_ULONG_TYPEDEF) + CHECK_FUNCTIONWITHHEADER_EXISTS("longlong definition" "${HEADERS}" HAVE_LONGLONG) + CHECK_FUNCTIONWITHHEADER_EXISTS("ulonglong definition" "${HEADERS}" HAVE_ULONGLONG) + CHECK_FUNCTIONWITHHEADER_EXISTS("long long definition" "${HEADERS}" HAVE_LONG_LONG) + CHECK_FUNCTIONWITHHEADER_EXISTS("unsigned long long definition" "${HEADERS}" HAVE_UNSIGNED_LONG_LONG) + CHECK_FUNCTIONWITHHEADER_EXISTS("int64_t definition" "${HEADERS}" HAVE_INT64_T) + CHECK_FUNCTIONWITHHEADER_EXISTS("uint64_t definition" "${HEADERS}" HAVE_UINT64_T) + + # ICU prefers to use char16_t, but it is only supported since C++11 + CHECK_FUNCTIONWITHHEADER_EXISTS("char16_t definition" "${HEADERS}" HAVE_CHAR16_T) + + # File access stuff + CHECK_FUNCTIONWITHHEADER_EXISTS("fpos64_t definition" "${HEADERS}" HAVE_FPOS64_T) + CHECK_FUNCTIONWITHHEADER_EXISTS("off64_t definition" "${HEADERS}" HAVE_OFF64_T) + # Check if the POSIX functions are available (even on Windows). They are preferred + # to the Microsoft specific functions on compilers like MinGW. + CHECK_FUNCTIONWITHHEADER_EXISTS("popen" "${HEADERS}" HAVE_POPEN) + CHECK_FUNCTIONWITHHEADER_EXISTS("pclose" "${HEADERS}" HAVE_PCLOSE) + + # Signal handling functions + CHECK_FUNCTIONWITHHEADER_EXISTS("sigjmp_buf definition" "setjmp.h" HAVE_SIGJMP_BUF) + +if(DCMTK_WITH_OPENSSL) + # Check if OpenSSL provides the SSL_CTX_get0_param function + CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get0_param" "openssl/ssl.h" HAVE_SSL_CTX_GET0_PARAM ${OPENSSL_LIBS}) + CHECK_FUNCTIONWITHHEADER_EXISTS("RAND_egd" "openssl/rand.h" HAVE_RAND_EGD ${OPENSSL_LIBS}) +endif() + +if(HAVE_LOCKF AND ANDROID) + # When Android introduced lockf, they forgot to put the constants like F_LOCK in the + # appropriate headers, this tests if they are defined and disables lockf if they are not + CHECK_FUNCTIONWITHHEADER_EXISTS("lockf(0, F_LOCK, 0)" "${HEADERS}" HAVE_LOCKF_CONSTANTS) + if(NOT HAVE_LOCKF_CONSTANTS) + set(HAVE_LOCKF FALSE CACHE INTERNAL "lockf implementation is broken") + endif() +endif() + +# Tests that require a try-compile + +if(HAVE_MATH_H) + if(HAVE_LIBC_H) + # checks if and cause a problem if libc.h is included extern "C" + # and math.h is not. This is the case on QNX 6.2.x and 6.5.x. + DCMTK_TRY_COMPILE(INCLUDE_LIBC_H_AS_EXTERN_C " can be included as extern \"C\"" + "extern \"C\" { +#include +} +#include +int main() +{ + int i = 0; + return 0; +}") + if(INCLUDE_LIBC_H_AS_EXTERN_C) + set(INCLUDE_LIBC_H_AS_CXX 0 CACHE INTERNAL "libc.h should be treated as a C++ header") + else() + set(INCLUDE_LIBC_H_AS_CXX 1 CACHE INTERNAL "libc.h should be treated as a C++ header") + endif() + endif() + + # checks if must be included as a C++ include file (i.e. without extern "C"). + # Some sytems (Win32, HP/UX 10) use C++ language features in . + DCMTK_TRY_COMPILE(INCLUDE_MATH_H_AS_EXTERN_C " can be included as extern \"C\"" + "extern \"C\" { +#include +} +int main() +{ + int i = 0; + return 0; +}") + if(INCLUDE_MATH_H_AS_EXTERN_C) + set(INCLUDE_MATH_H_AS_CXX 0 CACHE INTERNAL "math.h should be treated as a C++ header") + else() + set(INCLUDE_MATH_H_AS_CXX 1 CACHE INTERNAL "math.h should be treated as a C++ header") + endif() +endif() + + +if(NOT DEFINED C_CHAR_UNSIGNED) + message(STATUS "Checking signedness of char") + DCMTK_TRY_RUN(C_CHAR_SIGNED C_CHAR_SIGNED_COMPILED "${CMAKE_BINARY_DIR}/CMakeTmp/Char" + "${DCMTK_SOURCE_DIR}/CMake/dcmtkTestCharSignedness.cc" + COMPILE_OUTPUT_VARIABLE C_CHAR_SIGNED_COMPILE_OUTPUT) + if(C_CHAR_SIGNED_COMPILED) + if(C_CHAR_SIGNED) + message(STATUS "Checking signedness of char -- signed") + set(C_CHAR_UNSIGNED 0 CACHE INTERNAL "Whether char is unsigned.") + else() + message(STATUS "Checking signedness of char -- unsigned") + set(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") + endif() + else() + message(STATUS "Checking signedness of char -- failed") + endif() +endif() + +DCMTK_TRY_COMPILE(HAVE_CXX_BOOL "C++ type bool exists" + "// Minimal test for existence of 'bool' type. +void TestBool(bool) {} + +int main() +{ + TestBool(false); + TestBool(true); + return 0; +}") + +# Check for thread type +if(HAVE_WINDOWS_H) + set(HAVE_INT_TYPE_PTHREAD_T 1) +else() + DCMTK_TRY_COMPILE(HAVE_INT_TYPE_PTHREAD_T "pthread_t is an integer type" + "// test to see if pthread_t is a pointer type or not + +#include + +int main () +{ + pthread_t p; + unsigned long l = p; + return 0; +}") + if(NOT HAVE_INT_TYPE_PTHREAD_T) + set(HAVE_POINTER_TYPE_PTHREAD_T 1 CACHE INTERNAL "Set if pthread_t is a pointer type") + else() + set(HAVE_POINTER_TYPE_PTHREAD_T 0 CACHE INTERNAL "Set if pthread_t is a pointer type") + endif() +endif() + +# Check if typename works properly. Only MSC6 really fails here. +DCMTK_TRY_COMPILE(HAVE_TYPENAME "typename works correctly" + " +template +type identical(type arg) +{ + return arg; +} + +template +typename type::a foo(typename type::a arg) +{ + // This one is the usage of \"typename\" that we are checking for. + // MSC6 refuses this one incorrectly. + return identical(arg); +} + +class test { +public: + typedef int a; +}; + +int main() +{ + return foo(0); +}") + +# Check if ENAMETOOLONG is defined. +DCMTK_TRY_COMPILE(HAVE_ENAMETOOLONG "ENAMETOOLONG is defined" + "#include + +int main() +{ + int value = ENAMETOOLONG; + return 0; +}") + +# Check if strerror_r returns a char* is defined. +DCMTK_TRY_COMPILE(HAVE_INT_STRERROR_R "strerror_r returns an int" + "#include + +int main() +{ + char *buf = 0; + int i = strerror_r(0, buf, 100); + return i; +}") +if(HAVE_INT_STRERROR_R) + set(HAVE_CHARP_STRERROR_R 0 CACHE INTERNAL "Set if strerror_r() returns a char*") +else() + set(HAVE_CHARP_STRERROR_R 1 CACHE INTERNAL "Set if strerror_r() returns a char*") +endif() + +# Check if variable length arrays are supported. +DCMTK_TRY_COMPILE(HAVE_VLA "variable length arrays are supported" + "int main() +{ + int n = 42; + int foo[n]; + return 0; +}") + +# Check if std::ios::nocreate exists +DCMTK_TRY_COMPILE(HAVE_IOS_NOCREATE "std::ios::nocreate exists" + "#include + +using namespace std; + +int main() +{ + std::ifstream file(\"name\", std::ios::nocreate); + return 0; +}") + +# do try compile to detect lfs and flags +function(DCMTK_LFS_TRY_COMPILE VAR FILE FLAGS DEFINITIONS) + if(FLAGS OR DEFINITIONS) + set(OPTIONS " with arguments: \"") + else() + set(OPTIONS) + endif() + if(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS OR FLAGS) + set(CMAKE_FLAGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS}) + if(FLAGS) + list(APPEND CMAKE_FLAGS "-DCMAKE_C_FLAGS:STRING=${FLAGS}") + set(OPTIONS "${OPTIONS}${FLAGS}") + endif() + else() + set(CMAKE_FLAGS) + endif() + if(DEFINITIONS) + set(COMPILE_DEFINITIONS COMPILE_DEFINITIONS ${DEFINITIONS}) + if(FLAGS) + set(OPTIONS "${OPTIONS} ") + endif() + set(OPTIONS "${OPTIONS}${DEFINITIONS}") + else() + set(COMPILE_DEFINITIONS) + endif() + if(FLAGS OR DEFINITIONS) + set(OPTIONS "${OPTIONS}\"") + endif() + set(SOURCEFILE "${DCMTK_SOURCE_DIR}/config/tests/${FILE}") + try_compile(RESULT + "${CMAKE_BINARY_DIR}" + "${SOURCEFILE}" + ${CMAKE_FLAGS} + ${COMPILE_DEFINITIONS} + OUTPUT_VARIABLE OUTPUT + ) + set("${VAR}" "${RESULT}" PARENT_SCOPE) + if(RESULT) + set(LOGFILE "CMakeOutput.log") + set(LOG "succeded") + else() + set(LOGFILE "CMakeError.log") + set(LOG "failed") + endif() + file(TO_NATIVE_PATH "${SOURCEFILE}" SOURCEFILE) + file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${LOGFILE}" + "compiling \"${SOURCEFILE}\"${OPTIONS} ${LOG} with the following output:\n" + "${OUTPUT}\n" + ) +endfunction() + +function(DCMTK_CHECK_ENABLE_LFS) + # normalize arguments + if(DCMTK_ENABLE_LFS) + # for cases insensitive comparison + string(TOLOWER "${DCMTK_ENABLE_LFS}" DCMTK_ENABLE_LFS) + endif() + if(NOT DCMTK_ENABLE_LFS OR DCMTK_ENABLE_LFS MATCHES "^(on|true|yes|1)$") + set(DCMTK_ENABLE_LFS "auto") + elseif(DCMTK_ENABLE_LFS MATCHES "^(no|false|0)$") + set(DCMTK_ENABLE_LFS "off") + endif() + # determin whether lfs64 is available in case it wasn't detected yet it may be used + if(NOT DEFINED DCMTK_LFS64_AVAILABLE AND DCMTK_ENABLE_LFS MATCHES "^(lfs64|auto)$") + set(DCMTK_LFS64_DEFINITIONS) + set(MESSAGE_RESULT "no") + set(MESSAGE "Checking whether explicit large file support (LFS64) is available") + message(STATUS "${MESSAGE}") + DCMTK_LFS_TRY_COMPILE(RESULT "lfs64.cc" "" "") + if(NOT RESULT) + DCMTK_LFS_TRY_COMPILE(RESULT "lfs64.cc" "" "-D_LARGEFILE64_SOURCE") + if(RESULT) + set(DCMTK_LFS64_DEFINITIONS "-D_LARGEFILE64_SOURCE") + set(MESSAGE_RESULT "yes, with ${DCMTK_LFS64_DEFINITIONS}") + endif() + else() + set(MESSAGE_RESULT "yes") + endif() + if(RESULT) + set(DCMTK_ENABLE_LFS "lfs64") + set(DCMTK_LFS64_DEFINITIONS "${DCMTK_LFS64_DEFINITIONS}" CACHE INTERNAL "which compiler definitions to set for enabling LFS64 support") + endif() + set(DCMTK_LFS64_AVAILABLE "${RESULT}" CACHE INTERNAL "whether LFS64 is available or not" FORCE) + message(STATUS "${MESSAGE} -- ${MESSAGE_RESULT}") + endif() + # determin whether lfs is available in case it wasn't detected yet it may be used + if(NOT DEFINED DCMTK_LFS_AVAILABLE AND DCMTK_ENABLE_LFS MATCHES "^(lfs|auto)$") + set(DCMTK_LFS_FLAGS) + set(DCMTK_LFS_DEFINITIONS) + set(MESSAGE_RESULT "no") + set(MESSAGE "Checking whether large file support (LFS) is available") + message(STATUS "${MESSAGE}") + # determine size of fpos_t (for the strange LFS implementation on Windows) + set(CMAKE_EXTRA_INCLUDE_FILES) + if(HAVE_STDIO_H) + # prefer stdio.h so that is not in namespace std + set(CMAKE_EXTRA_INCLUDE_FILES "stdio.h") + elseif(HAVE_CSTDIO) + # use cstdio as the fallback + set(CMAKE_EXTRA_INCLUDE_FILES "cstdio") + endif() + CHECK_TYPE_SIZE("fpos_t" SIZEOF_FPOS_T) + # assume sizeof off_t to be correct, will be removed if below tests fail + set(SIZEOF_OFF_T 8) + # try compile different combinations of compiler flags and definitions + DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "" "") + if(NOT RESULT) + set(DCMTK_LFS_FLAGS "-n32") + DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "-n32" "") + endif() + if(NOT RESULT) + set(DCMTK_LFS_FLAGS "") + set(DCMTK_LFS_DEFINITIONS "-D_FILE_OFFSET_BITS=64") + DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "" "-D_FILE_OFFSET_BITS=64") + endif() + if(NOT RESULT) + set(DCMTK_LFS_FLAGS "-n32") + set(DCMTK_LFS_DEFINITIONS "-D_FILE_OFFSET_BITS=64") + DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "-n32" "-D_FILE_OFFSET_BITS=64") + endif() + if(NOT RESULT) + set(DCMTK_LFS_FLAGS "") + set(DCMTK_LFS_DEFINITIONS "-D_LARGE_FILES=1") + DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "" "-D_LARGE_FILES=1") + endif() + if(NOT RESULT) + set(DCMTK_LFS_FLAGS "-n32") + set(DCMTK_LFS_DEFINITIONS "-D_LARGE_FILES=1") + DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "-n32" "-D_LARGE_FILES=1") + endif() + if(NOT RESULT) + # remove flags and reset SIZEOF_OFF_T to indeterminate + set(DCMTK_LFS_FLAGS) + set(DCMTK_LFS_DEFINITIONS) + set(SIZEOF_OFF_T) + # detect strange LFS implementation that (at least) Windows provides + # strange since sizeof(fpos_t) == 8 but sizeof(off_t) == 4! + if(SIZEOF_FPOS_T EQUAL 8) + set(RESULT TRUE) + endif() + endif() + # format a nice result message + if(RESULT) + set(DCMTK_ENABLE_LFS "lfs") + set(DCMTK_LFS_FLAGS "${DCMTK_LFS_FLAGS}" CACHE INTERNAL "which compiler flags to set for enabling LFS support") + set(DCMTK_LFS_DEFINITIONS "${DCMTK_LFS_DEFINITIONS}" CACHE INTERNAL "which compiler definitions to set for enabling LFS support") + set(MESSAGE_RESULT "yes") + if(NOT DCMTK_LFS_FLAGS STREQUAL "" OR NOT DCMTK_LFS_DEFINITIONS STREQUAL "") + set(MESSAGE_RESULT "${MESSAGE_RESULT}, with") + if(NOT DCMTK_LFS_FLAGS STREQUAL "") + set(MESSAGE_RESULT "${MESSAGE_RESULT} ${DCMTK_LFS_FLAGS}") + endif() + if(NOT DCMTK_LFS_DEFINITIONS STREQUAL "") + set(MESSAGE_RESULT "${MESSAGE_RESULT} ${DCMTK_LFS_DEFINITIONS}") + endif() + endif() + endif() + set(DCMTK_LFS_AVAILABLE "${RESULT}" CACHE INTERNAL "whether LFS is available or not" FORCE) + if(DEFINED SIZEOF_OFF_T) + set(SIZEOF_OFF_T "${SIZEOF_OFF_T}" CACHE INTERNAL "") + endif() + message(STATUS "${MESSAGE} -- ${MESSAGE_RESULT}") + endif() + # auto-select LFS implementation in case this is not the first run and the above tests did not select it + if(DCMTK_ENABLE_LFS STREQUAL "auto") + if(DCMTK_LFS64_AVAILABLE) + set(DCMTK_ENABLE_LFS "lfs64") + elseif(DCMTK_LFS_AVAILABLE) + set(DCMTK_ENABLE_LFS "lfs") + else() + set(DCMTK_ENABLE_LFS "off") + endif() + elseif(NOT DCMTK_ENABLE_LFS MATCHES "^(lfs|lfs64|off)$") + # print a warning in case the given argument was not understood + message(WARNING "unknown argument \"${DCMTK_ENABLE_LFS}\" for DCMTK_ENABLE_LFS, setting it to \"off\"") + set(DCMTK_ENABLE_LFS "off") + elseif(DCMTK_ENABLE_LFS STREQUAL "lfs64" AND NOT DCMTK_LFS64_AVAILABLE) + # test if the explicitly chosen implementation is really available + message(WARNING "LFS64 was enabled but LFS64 support is not available, focing DCMTK_ENABLE_LFS to \"off\"") + set(DCMTK_ENABLE_LFS "off") + elseif(DCMTK_ENABLE_LFS STREQUAL "lfs" AND NOT DCMTK_LFS_AVAILABLE) + # test if the explicitly chosen implementation is really available + message(WARNING "LFS was enabled but LFS support is not available, focing DCMTK_ENABLE_LFS to \"off\"") + set(DCMTK_ENABLE_LFS "off") + endif() + # create a list of available LFS types for the CMake GUI + set(AVAILABLE_LFS_TYPES) + if(NOT DEFINED DCMTK_LFS64_AVAILABLE OR DCMTK_LFS64_AVAILABLE) + list(APPEND AVAILABLE_LFS_TYPES "lfs64") + endif() + if(NOT DEFINED DCMTK_LFS_AVAILABLE OR DCMTK_LFS_AVAILABLE) + list(APPEND AVAILABLE_LFS_TYPES "lfs") + endif() + # store the chosen value to the cache (potentially normalizing the given argument) + set(DCMTK_ENABLE_LFS "${DCMTK_ENABLE_LFS}" CACHE STRING "whether to use lfs/lfs64 or not" FORCE) + set_property(CACHE DCMTK_ENABLE_LFS PROPERTY STRINGS "auto" ${AVAILABLE_LFS_TYPES} "off") + # set values for osconfig.h and add compiler flags and definitions (if necessary) + if(DCMTK_ENABLE_LFS STREQUAL "lfs64") + # set the value for generating osconfig.h + set(DCMTK_LFS_MODE "DCMTK_LFS64" CACHE INTERNAL "" FORCE) + if(NOT DCMTK_LFS64_DEFINITIONS STREQUAL "") + add_definitions(${DCMTK_LFS64_DEFINITIONS}) + endif() + message(STATUS "Info: Building DCMTK with explicit large file support (LFS64)") + elseif(DCMTK_ENABLE_LFS STREQUAL "lfs") + # set the value for generating osconfig.h + set(DCMTK_LFS_MODE "DCMTK_LFS" CACHE INTERNAL "" FORCE) + if(NOT DCMTK_LFS_FLAGS STREQUAL "") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DCMTK_LFS_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DCMTK_LFS_FLAGS}") + endif() + if(NOT DCMTK_LFS_DEFINITIONS STREQUAL "") + add_definitions(${DCMTK_LFS_DEFINITIONS}) + endif() + message(STATUS "Info: Building DCMTK with large file support (LFS)") + else() + set(DCMTK_ENABLE_LFS) + message(STATUS "Info: Building DCMTK without large file support, files >4GB may be inaccesible!") + endif() +endfunction() + +DCMTK_CHECK_ENABLE_LFS() + +if(WIN32) + # If someone can tell me how to convince TRY_COMPILE to link against winsock, + # we could use tests for these. Until then, here is what would be the result: + set(HAVE_INTP_ACCEPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument") + set(HAVE_INTP_GETSOCKOPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument") + set(HAVE_INTP_SELECT 0 CACHE INTERNAL "Set if select() accepts an int* argument") +else() + # Check if socket functions accept an int* + DCMTK_TRY_COMPILE(HAVE_INTP_SOCKET, "socket functions accept an int* argument" + " +#ifdef __cplusplus +extern \"C\" { +#endif +#ifdef _WIN32 +/* Windows is pure evil */ +#include +#else +#include +#endif +#ifdef __cplusplus +} +#endif + +int main() +{ + int i; + struct sockaddr *addr = 0; + int addrlen = 0; + int optlen = 0; + + i = accept(1, addr, &addrlen); + i = getsockopt(0, 0, 0, 0, &optlen); + + return 0; +}") + if(HAVE_INTP_SOCKET) + set(HAVE_INTP_ACCEPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument") + set(HAVE_INTP_GETSOCKOPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument") + else() + set(HAVE_INTP_ACCEPT 0 CACHE INTERNAL "Set if socket functions accept an int* argument") + set(HAVE_INTP_GETSOCKOPT 0 CACHE INTERNAL "Set if socket functions accept an int* argument") + endif() + + # Check if select() accepts an int* + DCMTK_TRY_COMPILE(HAVE_INTP_SELECT "select() accepts an int* argument" + " +#ifdef __cplusplus +extern \"C\" { +#endif +#ifdef _WIN32 +/* Windows is pure evil */ +#include +#else +#include +#endif +#ifdef __cplusplus +} +#endif + +int main() +{ + int i; + int fds = 0; + + i = select(1, &fds, &fds, &fds, 0); + + return 0; +} +") +endif() + +# Check for alignment query / specifier support +DCMTK_TRY_COMPILE(HAVE_GNU_ALIGNOF "__alignof__ is supported" + "int main() +{ + char c[__alignof__(int)]; + return 0; +}") + +DCMTK_TRY_COMPILE(HAVE_MS_ALIGNOF "__alignof is supported" + "int main() +{ + char c[__alignof(int)]; + return 0; +}") + +DCMTK_TRY_COMPILE(HAVE_ATTRIBUTE_ALIGNED "__attribute__((aligned)) is supported" + "int main() +{ + __attribute__((aligned(4))) char c[16]; + return 0; +}") + +DCMTK_TRY_COMPILE(ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES "__attribute__((aligned)) supports templates" + "template +struct test { typedef T type __attribute__((aligned(4))); }; +int main() +{ + test::type i; + return 0; +}") + +DCMTK_TRY_COMPILE(HAVE_DECLSPEC_ALIGN "__declspec(align) is supported" + "int main() +{ + __declspec(align(4)) char c[16]; + return 0; +}") + +DCMTK_TRY_COMPILE(HAVE_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE "the compiler supports default constructor detection via SFINAE" + "struct no_type {}; +struct yes_type {double d;}; +template +struct consume{}; +template +static yes_type sfinae(consume*); +template +static no_type sfinae(...); +struct test { test( int ); }; +template +struct enable {}; +template<> +struct enable<0> { enum { result = 0 }; }; +int main() +{ + return enable(0)) == sizeof(yes_type)>::result; +}") + +DCMTK_TRY_COMPILE(HAVE_STD_NAMESPACE "ANSI standard C++ includes use std namespace" + "#include +int main() +{ + using namespace std; + std::cout << endl; + return 0; +}") + +DCMTK_TRY_COMPILE(HAVE_STD__NOTHROW "the compiler supports std::nothrow" + "#include +int main() +{ + int* i = new (std::nothrow) int; + return 0; +}") + +DCMTK_TRY_COMPILE(HAVE_NOTHROW_DELETE "the compiler supports operator delete (std::nothrow)" + "#include +int main() +{ + int* i = 0; + operator delete (i,std::nothrow); + return 0; +}") + +DCMTK_TRY_COMPILE(HAVE_STATIC_ASSERT "the compiler supports static_assert" + "#include +int main() +{ + static_assert(true, \"good\"); + return 0; +}") + +function(DCMTK_CHECK_ITERATOR_CATEGORY CATEGORY) + if(HAVE_ITERATOR_HEADER) + string(TOUPPER "${CATEGORY}" CAT) + DCMTK_TRY_COMPILE(HAVE_${CAT}_ITERATOR_CATEGORY "the iterator category ${CATEGORY} is declared" + "#include +int main() +{ + typedef std::${CATEGORY}_iterator_tag category; + return 0; +}") + endif() +endfunction() + +DCMTK_CHECK_ITERATOR_CATEGORY(input) +DCMTK_CHECK_ITERATOR_CATEGORY(output) +DCMTK_CHECK_ITERATOR_CATEGORY(forward) +DCMTK_CHECK_ITERATOR_CATEGORY(bidirectional) +DCMTK_CHECK_ITERATOR_CATEGORY(random_access) +DCMTK_CHECK_ITERATOR_CATEGORY(contiguous) + +function(ANALYZE_ICONV_FLAGS) + if(DCMTK_WITH_ICONV OR DCMTK_WITH_STDLIBC_ICONV) + set(TEXT "Detecting fixed iconv conversion flags") + message(STATUS "${TEXT}") + set(EXTRA_ARGS) + if(NOT DCMTK_WITH_STDLIBC_ICONV) + list(APPEND EXTRA_ARGS + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${LIBICONV_INCDIR}" + LINK_LIBRARIES ${LIBICONV_LIBS} + ) + endif() + if(LIBICONV_SECOND_ARGUMENT_CONST) + list(APPEND EXTRA_ARGS + COMPILE_DEFINITIONS "-DLIBICONV_SECOND_ARGUMENT_CONST=${LIBICONV_SECOND_ARGUMENT_CONST}" + ) + endif() + DCMTK_TRY_RUN(RUN_RESULT COMPILE_RESULT + "${CMAKE_BINARY_DIR}/CMakeTmp/Iconv" + "${DCMTK_SOURCE_DIR}/config/tests/iconv.cc" + ${EXTRA_ARGS} + COMPILE_OUTPUT_VARIABLE CERR + RUN_OUTPUT_VARIABLE OUTPUT + ) + if(COMPILE_RESULT) + set(DCMTK_ICONV_FLAGS_ANALYZED TRUE CACHE INTERNAL "") + if(RUN_RESULT EQUAL 0) + message(STATUS "${TEXT} - ${OUTPUT}") + set(DCMTK_FIXED_ICONV_CONVERSION_FLAGS "${OUTPUT}" CACHE INTERNAL "") + else() + message(STATUS "${TEXT} - unknown") + endif() + else() + message(FATAL_ERROR "${CERR}") + endif() + endif() +endfunction() + +if(NOT DCMTK_ICONV_FLAGS_ANALYZED) + analyze_iconv_flags() +endif() + +function(ANALYZE_STDLIBC_ICONV_DEFAULT_ENCODING) + if(DCMTK_WITH_STDLIBC_ICONV) + set(TEXT "Checking whether iconv_open() accepts \"\" as an argument") + message(STATUS "${TEXT}") + set(EXTRA_ARGS) + DCMTK_TRY_RUN(RUN_RESULT COMPILE_RESULT + "${CMAKE_BINARY_DIR}/CMakeTmp/lciconv" + "${DCMTK_SOURCE_DIR}/config/tests/lciconv.cc" + COMPILE_OUTPUT_VARIABLE CERR + ) + if(COMPILE_RESULT) + if(RUN_RESULT EQUAL 0) + message(STATUS "${TEXT} - yes") + set(DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING 1 CACHE INTERNAL "") + else() + message(STATUS "${TEXT} - no") + set(DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING CACHE INTERNAL "") + endif() + else() + message(FATAL_ERROR "${CERR}") + endif() + endif() +endfunction() + +if(NOT DEFINED DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING) + analyze_stdlibc_iconv_default_encoding() +endif() + +if(HAVE_PASSWD_GECOS AND NOT DEFINED PASSWD_GECOS_IS_DEFINE_TO_PASSWD) + DCMTK_TRY_COMPILE(PASSWD_GECOS_IS_DEFINE_TO_PASSWD "pw_gecos is #defined to pw_passwd" + "#include +int main() +{ + struct S { int pw_passwd; }; + &S::pw_gecos; + return 0; +}") + if(PASSWD_GECOS_IS_DEFINE_TO_PASSWD) + set(HAVE_PASSWD_GECOS 0 CACHE INTERNAL "Have symbol &passwd::pw_gecos") + endif() +endif() + +# Compile config/tests/arith.cc and generate config/arith.h +function(INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES) + set(ARITH_H_FILE "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/arith.h") + if("${DCMTK_SOURCE_DIR}/config/tests/arith.cc" IS_NEWER_THAN "${ARITH_H_FILE}") + if(CMAKE_CROSSCOMPILING) + if(WIN32) + UNIX_TO_WINE_PATH(ARITH_H_FILE "${ARITH_H_FILE}") + string(REPLACE "\\" "\\\\" ARITH_H_FILE "${ARITH_H_FILE}") + elseif(ANDROID) + set(ARITH_H_DESTINATION "${ARITH_H_FILE}") + set(ARITH_H_FILE "${ANDROID_TEMPORARY_FILES_LOCATION}/arith.h") + endif() + endif() + DCMTK_TRY_RUN( + RESULT COMPILED + "${DCMTK_BINARY_DIR}/CMakeTmp/Arith" + "${DCMTK_SOURCE_DIR}/config/tests/arith.cc" + COMPILE_DEFINITIONS -I"${DCMTK_BINARY_DIR}/config/include" -I"${DCMTK_SOURCE_DIR}/ofstd/include" -I"${DCMTK_SOURCE_DIR}/ofstd/libsrc" + RUN_OUTPUT_VARIABLE OUTPUT + COMPILE_OUTPUT_VARIABLE CERR + ARGS "\\\"${ARITH_H_FILE}\\\"" + ) + if(COMPILED) + if(NOT RESULT) + message(STATUS "${OUTPUT}") + if(CMAKE_CROSSCOMPILING) + if(ANDROID) + DCMTK_ANDROID_PULL(DCMTK_ANDROID_EMULATOR_INSTANCE "${ARITH_H_FILE}" DESTINATION "${ARITH_H_DESTINATION}") + endif() + endif() + else() + message(FATAL_ERROR "${OUTPUT}") + endif() + else() + message(FATAL_ERROR "${CERR}") + endif() + endif() # file needs update +endfunction() + +function(DCMTK_CHECK_CXX_STANDARD STANDARD) + set(RESULT 0) + if(DEFINED HAVE_CXX${STANDARD}_TEST_RESULT) + if(HAVE_CXX${STANDARD}_TEST_RESULT) + set(RESULT 1) + endif() + else() + set(MESSAGE "Checking whether the compiler supports C++${STANDARD}") + message(STATUS "${MESSAGE}") + try_compile(COMPILE_RESULT "${CMAKE_BINARY_DIR}" "${DCMTK_SOURCE_DIR}/config/tests/cxx${STANDARD}.cc") + set(HAVE_CXX${STANDARD}_TEST_RESULT "${COMPILE_RESULT}" CACHE INTERNAL "Caches the configuration test result for C++${STANDARD} support.") + if(COMPILE_RESULT) + set(RESULT 1) + message(STATUS "${MESSAGE} -- yes") + else() + message(STATUS "${MESSAGE} -- no") + endif() + endif() + set("ENABLE_CXX${STANDARD}" "${RESULT}" PARENT_SCOPE) +endfunction() + +function(DCMTK_TEST_ENABLE_CXX11) + get_property(MODERN_CXX_STANDARDS GLOBAL PROPERTY DCMTK_MODERN_CXX_STANDARDS) + foreach(STANDARD ${MODERN_CXX_STANDARDS}) + set(ENABLE_CXX${STANDARD} 0) + endforeach() + get_property(DCMTK_CMAKE_HAS_CXX_STANDARD GLOBAL PROPERTY DCMTK_CMAKE_HAS_CXX_STANDARD) + if(DCMTK_CMAKE_HAS_CXX_STANDARD) + get_property(MODERN_CXX_STANDARD GLOBAL PROPERTY DCMTK_MODERN_CXX_STANDARD) + if(MODERN_CXX_STANDARD AND DCMTK_ENABLE_CXX11) + dcmtk_upper_bound(MODERN_CXX_STANDARDS "${CMAKE_CXX_STANDARD}" N) + math(EXPR N "${N}-1") + foreach(I RANGE ${N}) + list(GET MODERN_CXX_STANDARDS ${I} STANDARD) + dcmtk_check_cxx_standard("${STANDARD}") + if(NOT ENABLE_CXX${STANDARD}) + break() + endif() + endforeach() + endif() + elseif(DCMTK_ENABLE_CXX11 AND NOT DCMTK_ENABLE_CXX11 STREQUAL "INFERRED") + # set C++11 compiler flags for the test, will automatically be removed by the function scope + string(FIND "${CMAKE_CXX_FLAGS}" "${DCMTK_CXX11_FLAGS}" INDEX) + if(INDEX EQUAL -1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DCMTK_CXX11_FLAGS}" PARENT_SCOPE) + endif() + dcmtk_check_cxx_standard(11) + if(ENABLE_CXX11) + # push C++11 CXX-flags to the parent scope + set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE) + endif() + endif() + foreach(STANDARD ${MODERN_CXX_STANDARDS}) + set(HAVE_CXX${STANDARD} "${ENABLE_CXX${STANDARD}}" CACHE INTERNAL "Set to 1 if the compiler supports C++${STANDARD} and it should be enabled.") + if(HAVE_CXX${STANDARD}) + message(STATUS "Info: C++${STANDARD} features enabled") + else() + message(STATUS "Info: C++${STANDARD} features disabled") + endif() + endforeach() +endfunction() + +function(DCMTK_TEST_ENABLE_STL_FEATURE NAME) + string(TOUPPER "${NAME}" FEATURE) + if(ARGN) + set(SOURCEFILE "${ARGN}") + else() + set(SOURCEFILE "${NAME}") + endif() + if(DCMTK_ENABLE_STL_${FEATURE} STREQUAL "INFERRED") + set(DCMTK_ENABLE_STL_${FEATURE} ${DCMTK_ENABLE_STL}) + endif() + set(RESULT 0) + set(TEXT_RESULT "disabled") + if(DCMTK_ENABLE_STL_${FEATURE} STREQUAL "ON") + if(DEFINED HAVE_STL_${FEATURE}_TEST_RESULT) + if(HAVE_STL_${FEATURE}_TEST_RESULT) + set(RESULT 1) + set(TEXT_RESULT "enabled") + endif() + else() + set(MESSAGE "Checking whether STL ${NAME} works correctly") + message(STATUS "${MESSAGE}") + DCMTK_TRY_RUN(RUN_RESULT COMPILE_RESULT "${CMAKE_BINARY_DIR}" "${DCMTK_SOURCE_DIR}/config/tests/${SOURCEFILE}.cc") + if(COMPILE_RESULT AND RUN_RESULT EQUAL 0) + set(RESULT 1) + set(TEXT_RESULT "enabled") + message(STATUS "${MESSAGE} -- yes") + else() + message(STATUS "${MESSAGE} -- no") + endif() + set(HAVE_STL_${FEATURE}_TEST_RESULT ${RESULT} CACHE INTERNAL "Caches the configuration test result for STL ${NAME}") + endif() + endif() + set(HAVE_STL_${FEATURE} ${RESULT} CACHE INTERNAL "Set to 1 if the compiler/OS provides a working STL ${NAME} implementation.") + message(STATUS "Info: STL ${NAME} support ${TEXT_RESULT}") +endfunction() + +DCMTK_TEST_ENABLE_CXX11() +DCMTK_TEST_ENABLE_STL_FEATURE("vector") +DCMTK_TEST_ENABLE_STL_FEATURE("algorithm" "algo") +DCMTK_TEST_ENABLE_STL_FEATURE("limits") +DCMTK_TEST_ENABLE_STL_FEATURE("list") +DCMTK_TEST_ENABLE_STL_FEATURE("map") +DCMTK_TEST_ENABLE_STL_FEATURE("memory") +DCMTK_TEST_ENABLE_STL_FEATURE("stack") +DCMTK_TEST_ENABLE_STL_FEATURE("string") +DCMTK_TEST_ENABLE_STL_FEATURE("type_traits" "ttraits") +DCMTK_TEST_ENABLE_STL_FEATURE("tuple") +DCMTK_TEST_ENABLE_STL_FEATURE("system_error" "syserr") + +if(CMAKE_CROSSCOMPILING) + set(DCMTK_CROSS_COMPILING ${CMAKE_CROSSCOMPILING}) +endif() diff --git a/CMake/dcmtkAfterModules.cmake b/CMake/dcmtkAfterModules.cmake new file mode 100644 index 00000000..480ce4f5 --- /dev/null +++ b/CMake/dcmtkAfterModules.cmake @@ -0,0 +1,27 @@ +# Finish the setup. This should be run after all modules. + +if(BUILD_SINGLE_SHARED_LIBRARY) + # Collect the object files of all libraries in all modules. + # The variable ${DCMTK_ALL_LIBRARIES} is set by DCMTK_ADD_LIBRARY(). + set(LIBS) + foreach(LIB ${DCMTK_ALL_LIBRARIES}) + set(LIBS ${LIBS} $) + endforeach() + + # Build a single "everything-library". + # The library dependencies are collected by DCMTK_TARGET_LINK_LIBRARIES(). + add_library(dcmtk SHARED ${LIBS}) + target_link_libraries(dcmtk ${DCMTK_LIBRARY_DEPENDENCIES}) + set_target_properties(dcmtk PROPERTIES ${DCMTK_LIBRARY_PROPERTIES}) + + # Export target for build tree + set_property(GLOBAL APPEND PROPERTY DCMTK_LIBRARY_TARGETS dcmtk) + + # Declare installation files. Also export libs and executables to DCMTKTargets.cmake. + install(TARGETS dcmtk + EXPORT DCMTKTargets + COMPONENT lib + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") +endif() diff --git a/CMake/dcmtkMacros.cmake b/CMake/dcmtkMacros.cmake new file mode 100644 index 00000000..cdf17d78 --- /dev/null +++ b/CMake/dcmtkMacros.cmake @@ -0,0 +1,188 @@ +# +# Register all tests for the current module +# +# DCMTK_ADD_TESTS - function which registers all tests for a module +# MODULE - name of the module that we are called for +# +function(DCMTK_ADD_TESTS MODULE) + if(BUILD_APPS AND DCMTK_RUN_CTEST_SCRIPT) + set(TEST_EXECUTABLE "$") + if(CMAKE_CROSSCOMPILING) + if(WIN32) + WINE_COMMAND(TEST_COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MODULE}_tests${CMAKE_EXECUTABLE_SUFFIX}") + string(REPLACE "\\" "\\\\" TEST_COMMAND "${TEST_COMMAND}") + elseif(ANDROID) + set(TEST_COMMAND "${ANDROID_TEMPORARY_FILES_LOCATION}/${MODULE}_tests") + else() + # not reachable, handled by not defining DCMTK_RUN_CTEST_SCRIPT + endif() + else() + set(TEST_COMMAND "${TEST_EXECUTABLE}") + endif() + list(APPEND DCMTK_TEST_EXECUTABLES "${TEST_EXECUTABLE}") + list(REMOVE_DUPLICATES DCMTK_TEST_EXECUTABLES) + set(DCMTK_TEST_EXECUTABLES ${DCMTK_TEST_EXECUTABLES} CACHE INTERNAL "List of executables needed to run the unit tests") + file(STRINGS tests.cc AVAIL_TESTS REGEX "OFTEST_REGISTER\\([^)]*\\)") + foreach(TEST_LINE ${AVAIL_TESTS}) + # TODO: How can we parse tests.cc in a saner way? + string(REGEX MATCH "OFTEST_REGISTER\\([^)]*" TEST "${TEST_LINE}") + string(REPLACE "OFTEST_REGISTER(" "" TEST ${TEST}) + # This assumes that test names are globally unique + add_test(NAME "${TEST}" COMMAND "${CMAKE_COMMAND}" "-DDCMTK_CTEST_TESTCASE_COMMAND=${TEST_COMMAND}" "-DDCMTK_CTEST_TEST_NAME=${TEST}" "-P" "${DCMTK_RUN_CTEST_SCRIPT}") + set_property(TEST "${TEST}" PROPERTY LABELS "${MODULE}") + if(CMAKE_VERSION VERSION_LESS 3.0.0) + # CMake versions prior 3 seemingly don't understand $ within a test's REQUIRED_FILES property + set_property(TEST "${TEST}" PROPERTY REQUIRED_FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MODULE}_tests${CMAKE_EXECUTABLE_SUFFIX}") + else() + set_property(TEST "${TEST}" PROPERTY REQUIRED_FILES "${TEST_EXECUTABLE}") + endif() + endforeach() + add_custom_target("${MODULE}-test-exhaustive" + COMMAND "${CMAKE_COMMAND}" "-DCONFIG=${DCMTK_CONFIG_GENERATOR_EXPRESSION}" "-P" "${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunExhaustive.cmake" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + ) + endif() +endfunction() + +# +# Setup an executable +# +# DCMTK_ADD_EXECUTABLE - macro which adds the needed setup for an executable +# PROGRAM - name of the executable that we are called for +# +macro(DCMTK_ADD_EXECUTABLE PROGRAM) + if(BUILD_APPS) + add_executable(${PROGRAM} ${ARGN}) + + # Make wildcard arguments work + if(WIN32 AND NOT MINGW) + set_target_properties(${PROGRAM} PROPERTIES LINK_FLAGS ${WIN32_STD_OBJECTS}) + endif() + + # Collect executable as part of global DCMTK_EXECUTABLE_TARGETS property + set_property(GLOBAL APPEND PROPERTY DCMTK_EXECUTABLE_TARGETS ${PROGRAM}) + + # declare installation files, also export DCMTKTargets.cmake + install(TARGETS ${PROGRAM} + EXPORT DCMTKTargets + COMPONENT bin + DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() +endmacro() + +# +# Setup a library +# +# DCMTK_ADD_LIBRARY - macro which adds the needed setup for a library +# LIBRARY - name of the library that we are called for +# extra arguments - names of the library's source files +# +macro(DCMTK_ADD_LIBRARY LIBRARY) + # Actually add the library first + add_library(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} ${DCMTK_LIBRARY_TYPE} ${ARGN}) + set(DCMTK_ALL_LIBRARIES ${DCMTK_ALL_LIBRARIES} ${LIBRARY}${DCMTK_LIBRARY_SUFFIX} CACHE INTERNAL "List of all libraries in the DCMTK.") + + # set proper version information for shared library + if(BUILD_SHARED_LIBS AND NOT BUILD_SINGLE_SHARED_LIBRARY) + set_target_properties(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} PROPERTIES ${DCMTK_LIBRARY_PROPERTIES}) + else() + # define the foo_EXPORTS-macro even when we are not building ("normal") shared libs + set_target_properties(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} PROPERTIES COMPILE_DEFINITIONS "${LIBRARY}_EXPORTS") + endif() + + if(NOT BUILD_SINGLE_SHARED_LIBRARY) + # Remember export target for writing it to build tree later + set_property(GLOBAL APPEND PROPERTY DCMTK_LIBRARY_TARGETS ${LIBRARY}${DCMTK_LIBRARY_SUFFIX}) + + # Declare installation files + install(TARGETS ${LIBRARY}${DCMTK_LIBRARY_SUFFIX} + EXPORT DCMTKTargets + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib) + endif() +endmacro() + +# +# Specify a library's dependencies +# +# DCMTK_TARGET_LINK_LIBRARIES - macro for specifying a library's dependencies +# LIBRARY - name of the library that we are called for +# extra arguments - names of the library's dependencies +# +macro(DCMTK_TARGET_LINK_LIBRARIES LIBRARY) + set(DCMTK_LIBRARY_DEPENDENCIES ${DCMTK_LIBRARY_DEPENDENCIES} ${ARGN} CACHE INTERNAL "Dependencies of the DCMTK libraries.") + # The name of this macro doesn't match, but it does just what we need here + DCMTK_TARGET_LINK_MODULES(${LIBRARY} ${ARGN}) +endmacro() + +# +# Link a target against other DCMTK modules +# +# DCMTK_TARGET_LINK_MODULES - macro which adds DCMTK modules to a target's dependencies +# TARGET - name of the target that we are called for +# extra arguments - names of the modules that should be added +# +macro(DCMTK_TARGET_LINK_MODULES TARGET) + # This macro is called for libraries and apps. Thus, we need some magic. + # 1. During "normal builds", always call target_link_libraries() + # 2. When BUILD_SINGLE_SHARED_LIBRARY, never call it, because neither the + # libraries nor the apps really exist in this mode + # 3. When "just" BUILD_APPS is disabled, only call it for libs, not for apps + # These rules boil down to: If CMake knows the target (this handles all + # cases for apps) and we aren't building a single library (case 2) + if(TARGET ${TARGET} AND NOT BUILD_SINGLE_SHARED_LIBRARY) + target_link_libraries(${TARGET} ${ARGN}) + endif() +endmacro() + +# This is an ugly hack to simulate global variables +set(DCMTK_ALL_LIBRARIES CACHE INTERNAL "List of all libraries in the DCMTK.") +set(DCMTK_LIBRARY_DEPENDENCIES CACHE INTERNAL "Dependencies of the DCMTK libraries.") + +# Failsafe implementation of UNSET for old CMake versions +if(CMAKE_VERSION VERSION_LESS 2.6.3) + macro(DCMTK_UNSET VAR) + set(${VAR}) + endmacro() +else() + macro(DCMTK_UNSET VAR) + unset(${VAR}) + endmacro() +endif() + +# Failsafe implementation of unset(... CACHE) for old CMake versions +if(CMAKE_VERSION VERSION_LESS 2.6.3) + macro(DCMTK_UNSET_CACHE VAR) + set(${VAR} CACHE INTERNAL "") + endmacro() +else() + macro(DCMTK_UNSET_CACHE VAR) + unset(${VAR} CACHE) + endmacro() +endif() + +# Failsafe implementation of unset(... PARENT_SCOPE) for old CMake versions +if(CMAKE_VERSION VERSION_LESS 3.0) + macro(DCMTK_UNSET_PARENT_SCOPE VAR) + set(${VAR} PARENT_SCOPE) + endmacro() +else() + macro(DCMTK_UNSET_PARENT_SCOPE VAR) + unset(${VAR} PARENT_SCOPE) + endmacro() +endif() + +# A C++ STL style upper_bound function for CMake ';' lists +function(DCMTK_UPPER_BOUND LIST COMP VAR) + list(LENGTH "${LIST}" N) + math(EXPR LAST "${N}-1") + foreach(INDEX RANGE ${LAST}) + list(GET "${LIST}" ${INDEX} E) + if(COMP LESS E) + set("${VAR}" ${INDEX} PARENT_SCOPE) + return() + endif() + endforeach() + set("${VAR}" ${N} PARENT_SCOPE) +endfunction() diff --git a/CMake/dcmtkPrepare.cmake b/CMake/dcmtkPrepare.cmake new file mode 100644 index 00000000..514803a4 --- /dev/null +++ b/CMake/dcmtkPrepare.cmake @@ -0,0 +1,595 @@ +# Set up the build environment. +# This should be run before the individual modules are created. + +# This file should only run once +if(DEFINED DCMTK_CONFIGURATION_DONE) + return() +endif() +set(DCMTK_CONFIGURATION_DONE true) + +# Latest CMake version tested +if(CMAKE_BACKWARDS_COMPATIBILITY GREATER 3.15.3) + set(CMAKE_BACKWARDS_COMPATIBILITY 3.15.3 CACHE STRING "Latest version of CMake when this project was released." FORCE) +endif() + +# CMAKE_BUILD_TYPE is set to value "Release" if none is specified by the +# selected build file generator. For those generators that support multiple +# configuration types (e.g. Debug, Release), CMAKE_CONFIGURATION_TYPES holds +# possible values. For other generators this value is empty, and for those +# generators the build type is controlled at CMake time by CMAKE_BUILD_TYPE. +# See http://www.cmake.org/pipermail/cmake/2006-January/008065.html for +# details. +# +# To disable the CMAKE_BUILD_TYPE default value, set CMAKE_BUILD_TYPE to value +# "None" during CMake configuration, e.g. use "-DCMAKE_BUILD_TYPE:STRING=None" +# on the command line. This may be useful if the compiler flags should be +# controlled manually (e.g. as defined in environment variables like CXXFLAGS) +# and no CMake defaults related to the selected configuration type kick in. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + + +# Basic version information +# (Starting with version 3.5.5, an odd number at the last position indicates +# a development snapshot and an even number indicates an official release.) +set(DCMTK_MAJOR_VERSION 3) +set(DCMTK_MINOR_VERSION 6) +set(DCMTK_BUILD_VERSION 5) +# The ABI is not guaranteed to be stable between different snapshots/releases, +# so this particular version number is increased for each snapshot or release. +set(DCMTK_ABI_VERSION 15) + +# Package "release" settings (some are currently unused and, therefore, disabled) +set(DCMTK_PACKAGE_NAME "dcmtk") +set(DCMTK_PACKAGE_DATE "2019-10-28") +set(DCMTK_PACKAGE_VERSION "${DCMTK_MAJOR_VERSION}.${DCMTK_MINOR_VERSION}.${DCMTK_BUILD_VERSION}") +set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_MAJOR_VERSION}${DCMTK_MINOR_VERSION}${DCMTK_BUILD_VERSION}) +set(DCMTK_PACKAGE_VERSION_SUFFIX "") +#set(DCMTK_PACKAGE_TARNAME "dcmtk-${DCMTK_PACKAGE_VERSION}") +#set(DCMTK_PACKAGE_STRING "dcmtk ${DCMTK_PACKAGE_VERSION}") +#set(DCMTK_PACKAGE_BUGREPORT "bugs@dcmtk.org") +#set(DCMTK_PACKAGE_URL "http://www.dcmtk.org/") + +# Shared library version information +SET(DCMTK_LIBRARY_PROPERTIES VERSION "${DCMTK_ABI_VERSION}.${DCMTK_PACKAGE_VERSION}" SOVERSION "${DCMTK_ABI_VERSION}") + +# Gather information about the employed CMake version's behavior +set(DCMTK_CMAKE_HAS_CXX_STANDARD FALSE) +if(NOT CMAKE_MAJOR_VERSION LESS 3) # CMake versions prior to 3 don't understand VERSION_LESS etc. + if(NOT CMAKE_VERSION VERSION_LESS "3.1.3") + set(DCMTK_CMAKE_HAS_CXX_STANDARD TRUE) + endif() +endif() +define_property(GLOBAL PROPERTY DCMTK_CMAKE_HAS_CXX_STANDARD + BRIEF_DOCS "TRUE iff the CXX_STANDARD property exists." + FULL_DOCS "TRUE for CMake versions since 3.1.3 that evaluate the CXX_STANDARD property and CMAKE_CXX_STANDARD variable." +) +set_property(GLOBAL PROPERTY DCMTK_CMAKE_HAS_CXX_STANDARD ${DCMTK_CMAKE_HAS_CXX_STANDARD}) + +# General build options and settings +option(BUILD_APPS "Build command line applications and test programs." ON) +option(BUILD_SHARED_LIBS "Build with shared libraries." OFF) +option(BUILD_SINGLE_SHARED_LIBRARY "Build a single DCMTK library." OFF) +mark_as_advanced(BUILD_SINGLE_SHARED_LIBRARY) +set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library postfix for debug builds. Usually left blank.") +# add our CMake modules to the module path, but prefer the ones from CMake. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/${DCMTK_CMAKE_INCLUDE}/CMake/") +if(BUILD_SINGLE_SHARED_LIBRARY) + # When we are building a single shared lib, we are building shared libs :-) + set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE) +endif() + +# DCMTK build options +option(DCMTK_WITH_TIFF "Configure DCMTK with support for TIFF." ON) +option(DCMTK_WITH_PNG "Configure DCMTK with support for PNG." ON) +option(DCMTK_WITH_XML "Configure DCMTK with support for XML." ON) +option(DCMTK_WITH_ZLIB "Configure DCMTK with support for ZLIB." ON) +option(DCMTK_WITH_OPENSSL "Configure DCMTK with support for OPENSSL." ON) +option(DCMTK_WITH_SNDFILE "Configure DCMTK with support for SNDFILE." ON) +option(DCMTK_WITH_ICONV "Configure DCMTK with support for ICONV." ON) +option(DCMTK_WITH_ICU "Configure DCMTK with support for ICU." ON) +if(NOT WIN32) + option(DCMTK_WITH_WRAP "Configure DCMTK with support for WRAP." ON) +endif() +option(DCMTK_WITH_OPENJPEG "Configure DCMTK with support for OPENJPEG." ON) +option(DCMTK_ENABLE_PRIVATE_TAGS "Configure DCMTK with support for DICOM private tags coming with DCMTK." OFF) +option(DCMTK_WITH_THREADS "Configure DCMTK with support for multi-threading." ON) +option(DCMTK_WITH_DOXYGEN "Build API documentation with DOXYGEN." ON) +option(DCMTK_GENERATE_DOXYGEN_TAGFILE "Generate a tag file with DOXYGEN." OFF) +option(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS "Build with wide char file I/O functions." OFF) +option(DCMTK_WIDE_CHAR_MAIN_FUNCTION "Build command line tools with wide char main function." OFF) +option(DCMTK_ENABLE_STL "Enable use of native STL classes and algorithms instead of DCMTK's own implementations." OFF) + +macro(DCMTK_INFERABLE_OPTION OPTION DESCRIPTION) + set("${OPTION}" INFERRED CACHE STRING "${DESCRIPTION}") + set_property(CACHE "${OPTION}" PROPERTY STRINGS "INFERRED" "ON" "OFF") + # currently, all inferable options are advanced options + mark_as_advanced("${OPTION}") +endmacro() + +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_VECTOR "Enable use of STL vector.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_ALGORITHM "Enable use of STL algorithm.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_LIMITS "Enable use of STL limit.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_LIST "Enable use of STL list.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_MAP "Enable use of STL map.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_MEMORY "Enable use of STL memory.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_STACK "Enable use of STL stack.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_STRING "Enable use of STL string.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_TYPE_TRAITS "Enable use of STL type traits.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_TUPLE "Enable use of STL tuple.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_SYSTEM_ERROR "Enable use of STL system_error.") +DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_CXX11 "Enable use of native C++11 features (eg. move semantics).") + +# Built-in (compiled-in) dictionary enabled on Windows per default, otherwise +# disabled. Loading of external dictionary via run-time is, per default, +# configured the the opposite way since most users won't be interested in using +# the external default dictionary if it is already compiled in. +if(WIN32 OR MINGW) + option(DCMTK_ENABLE_BUILTIN_DICTIONARY "Configure DCMTK with compiled-in data dictionary." ON) + option(DCMTK_ENABLE_EXTERNAL_DICTIONARY "Configure DCMTK to load external dictionary from default path on startup." ON) +else() # built-in dictionary turned off on Unix per default + option(DCMTK_ENABLE_BUILTIN_DICTIONARY "Configure DCMTK with compiled-in data dictionary." OFF) + option(DCMTK_ENABLE_EXTERNAL_DICTIONARY "Configure DCMTK to load external dictionary from default path on startup." ON) +endif() +if (NOT DCMTK_ENABLE_EXTERNAL_DICTIONARY AND NOT DCMTK_ENABLE_BUILTIN_DICTIONARY) + message(WARNING "Either external or built-in dictionary should be enabled, otherwise dictionary must be loaded manually on startup!") +endif() + +# Mark various settings as "advanced" +mark_as_advanced(CMAKE_DEBUG_POSTFIX) +mark_as_advanced(FORCE EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH) +mark_as_advanced(SNDFILE_DIR DCMTK_WITH_SNDFILE) # not yet needed in public DCMTK +mark_as_advanced(DCMTK_GENERATE_DOXYGEN_TAGFILE) +mark_as_advanced(DCMTK_WITH_OPENJPEG) # only needed by DCMJP2K module + +if(NOT WIN32) + # support for wide char file I/O functions is currently Windows-specific + mark_as_advanced(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS) + # support for wide char main function is Windows-specific + mark_as_advanced(DCMTK_WIDE_CHAR_MAIN_FUNCTION) +endif() + +# Enable manpages only for non-Windows systems by default +set(DCMTK_ENABLE_MANPAGES_DOCSTRING "Enable building/installing of manpages.") +if(WIN32) + option(DCMTK_ENABLE_MANPAGES "${DCMTK_ENABLE_MANPAGES_DOCSTRING}" OFF) +else() + option(DCMTK_ENABLE_MANPAGES "${DCMTK_ENABLE_MANPAGES_DOCSTRING}" ON) +endif() +mark_as_advanced(DCMTK_ENABLE_MANPAGES) + +enable_testing() + +#----------------------------------------------------------------------------- +# Include appropriate modules and set required variables for cross compiling +#----------------------------------------------------------------------------- + +if(CMAKE_CROSSCOMPILING) + if(WIN32) + include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseWine.cmake") + DCMTK_SETUP_WINE() + elseif(ANDROID) + include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake") + # Ensure the configuration variables for the Android device emulator exist in the cache. + DCMTK_SETUP_ANDROID_EMULATOR() + endif() +endif() + +#----------------------------------------------------------------------------- +# Generic utilities used for configuring DCMTK +#----------------------------------------------------------------------------- + +include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkMacros.cmake") + +#----------------------------------------------------------------------------- +# Prepare external dependencies for cross compiling +# (i.e. start the emulator if required) +#----------------------------------------------------------------------------- + +if(CMAKE_CROSSCOMPILING) + unset(DCMTK_UNIT_TESTS_UNSUPPORTED_WARN_ONCE CACHE) + if(ANDROID) + unset(DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED CACHE) + DCMTK_ANDROID_START_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE) + endif() +endif() + +#----------------------------------------------------------------------------- +# Installation sub-directories +#----------------------------------------------------------------------------- + +# Set project name variable to package name for GnuInstallDirs +set(PROJECT_NAME "${DCMTK_PACKAGE_NAME}") +# Provides CMake cache variables with reasonable defaults to create a GNU style installation +# directory structure +include(GNUInstallDirs) +# CMake's files (DCMTKTarget.cmake, DCMTKConfigVersion.cmake and DCMTKConfig.cmake) are installed +# to different installation paths under Unix- and Windows-based systems +if(UNIX) + set(DCMTK_INSTALL_CMKDIR "${CMAKE_INSTALL_LIBDIR}/cmake/dcmtk") +elseif(WIN32) + set(DCMTK_INSTALL_CMKDIR "cmake") +endif() + +#----------------------------------------------------------------------------- +# Build directories +#----------------------------------------------------------------------------- +set(DCMTK_BUILD_CMKDIR "${CMAKE_BINARY_DIR}") + +#----------------------------------------------------------------------------- +# Start with clean DCMTKTargets.cmake, filled in GenerateCMakeExports.cmake +#----------------------------------------------------------------------------- +file(WRITE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake" "") + +#----------------------------------------------------------------------------- +# Platform-independent settings +#----------------------------------------------------------------------------- + +# pass optional build date to compiler +#set(DCMTK_BUILD_DATE "\\\"YYYY-MM-DD\\\"") +if(DCMTK_BUILD_DATE) + + if(COMMAND CMAKE_POLICY) + # Works around warnings about escaped quotes in ADD_DEFINITIONS statements + cmake_policy(SET CMP0005 OLD) + endif() + + # Xcode needs one escaping layer more than (as far as we know) everyone else - we gotta go deeper! + if(CMAKE_GENERATOR MATCHES Xcode) + string(REPLACE "\\" "\\\\" DCMTK_BUILD_DATE "${DCMTK_BUILD_DATE}") + endif() + add_definitions(-DDCMTK_BUILD_DATE=${DCMTK_BUILD_DATE}) +endif() + +# make OFString(NULL) safe by default +add_definitions(-DUSE_NULL_SAFE_OFSTRING) + +# tell the DCMTK that we are building the DCMTK +add_definitions(-DDCMTK_BUILD_IN_PROGRESS) + +# build output files in these directories +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + +#----------------------------------------------------------------------------- +# Platform-specific settings +#----------------------------------------------------------------------------- + +# set project wide flags for compiler and linker + +if(WIN32) + option(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS "Overwrite compiler flags with DCMTK's WIN32 package default values." ON) + option(DCMTK_COMPILE_WIN32_MULTITHREADED_DLL "Compile DCMTK using the Multithreaded DLL runtime library." OFF) + if (BUILD_SHARED_LIBS) + set(DCMTK_COMPILE_WIN32_MULTITHREADED_DLL ON) + endif() +else() + set(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS OFF) + set(DCMTK_COMPILE_WIN32_MULTITHREADED_DLL OFF) +endif() + +if(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS AND NOT BUILD_SHARED_LIBS) + + # settings for Microsoft Visual Studio + if(CMAKE_GENERATOR MATCHES "Visual Studio .*") + # get Visual Studio Version + string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" VS_VERSION "${CMAKE_GENERATOR}") + # these settings never change even for C or C++ + set(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od") + set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /MT /O2") + set(CMAKE_C_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od") + set(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") + set(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /MT /O2") + set(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od") + # specific settings for the various Visual Studio versions + if(VS_VERSION EQUAL 6) + set(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX") + set(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /YX /Zm500") # /Zm500 increments heap size which is needed on some system to compile templates in dcmimgle + endif() + if(VS_VERSION EQUAL 7) + set(CMAKE_C_FLAGS "/nologo /W3 /Gy") + set(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") + endif() + if(VS_VERSION GREATER 7) + set(CMAKE_C_FLAGS "/nologo /W3 /Gy /EHsc") + set(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /EHsc") + endif() + endif() + + # settings for Borland C++ + if(CMAKE_GENERATOR MATCHES "Borland Makefiles") + # further settings required? not tested for a very long time! + set(CMAKE_STANDARD_LIBRARIES "import32.lib cw32mt.lib") + endif() + +endif() + +if(WIN32 AND CMAKE_GENERATOR MATCHES "Visual Studio .*") + # Evaluate the DCMTK_COMPILE_WIN32_MULTITHREADED_DLL option and adjust + # the runtime library setting (/MT or /MD) accordingly + set(CompilerFlags + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO + ) + + if(DCMTK_COMPILE_WIN32_MULTITHREADED_DLL OR BUILD_SHARED_LIBS) + # Convert any /MT or /MTd option to /MD or /MDd + foreach(CompilerFlag ${CompilerFlags}) + string(REPLACE "/MT" "/MD" ${CompilerFlag} "${${CompilerFlag}}") + set(${CompilerFlag} "${${CompilerFlag}}" CACHE STRING "msvc compiler flags" FORCE) + endforeach() + else() + # Convert any /MD or /MDd option to /MT or /MTd + foreach(CompilerFlag ${CompilerFlags}) + string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") + set(${CompilerFlag} "${${CompilerFlag}}" CACHE STRING "msvc compiler flags" FORCE) + endforeach() + endif() +endif() + +if(BUILD_SHARED_LIBS) + set(DCMTK_SHARED ON) + if(BUILD_SINGLE_SHARED_LIBRARY) + # We can't build apps, because there is no way to tell CMake to link apps + # against the library. + set(BUILD_APPS OFF CACHE BOOL "" FORCE) + # We are building static code that can be used in a shared lib + set(DCMTK_BUILD_SINGLE_SHARED_LIBRARY ON) + # Make CMake build object libraries. They are just a list of object files + # which aren't linked together yet. + set(DCMTK_LIBRARY_TYPE OBJECT) + # Static and shared libraries can have dependencies in CMake. Object + # libraries cannot. Since CMake saves dependencies in its cache, we have to + # make sure that it doesn't get confused when a "normal" library turns into + # an object library. Do this via a suffix. + set(DCMTK_LIBRARY_SUFFIX _obj) + # This uses object libraries which are new in CMake 2.8.8 + cmake_minimum_required(VERSION 2.8.8) + endif() + + option(USE_COMPILER_HIDDEN_VISIBILITY + "Use hidden visibility support if available" ON) + mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY) + + include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" GXX_SUPPORTS_VISIBILITY) + # This "NOT WIN32" is needed due to a CMake bug that was fixed in + # CMake 2.8.x. CHECK_CXX_COMPILER_FLAG() always says "ok" with MSC. + if(GXX_SUPPORTS_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY AND NOT WIN32) + set(HAVE_HIDDEN_VISIBILITY ON) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") + else() + set(HAVE_HIDDEN_VISIBILITY) + endif() +endif() + +if(WIN32) # special handling for Windows systems + + if(MINGW) + # Avoid auto-importing warnings on MinGW + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-auto-import") + else() + if(NOT BORLAND) + if(NOT CYGWIN) + # Disable min() and max() macros pre-defined by Microsoft. We define our own + # version in oflimits.h and on Windows that could result in name clashes in + # Visual Studio. + add_definitions(-DNOMINMAX) + # On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security warnings. + if(NOT DCMTK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) + add_definitions( + -D_CRT_FAR_MAPPINGS_NO_DEPRECATE + -D_CRT_IS_WCTYPE_NO_DEPRECATE + -D_CRT_MANAGED_FP_NO_DEPRECATE + -D_CRT_NONSTDC_NO_DEPRECATE + -D_CRT_SECURE_NO_DEPRECATE + -D_CRT_SECURE_NO_DEPRECATE_GLOBALS + -D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE + -D_CRT_TIME_FUNCTIONS_NO_DEPRECATE + -D_CRT_VCCLRIT_NO_DEPRECATE + -D_SCL_SECURE_NO_DEPRECATE + ) + endif() + endif() + endif() + endif() + +else() # ... for non-Windows systems + + # Compiler flags for Mac OS X + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE") + # Compiler flags for NetBSD + elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_NETBSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_NETBSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L") + # Solaris, FreeBSD and newer versions of OpenBSD fail with these flags + elseif(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND (NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD" OR CMAKE_SYSTEM_VERSION VERSION_LESS 4)) + # Compiler flags for all other non-Windows systems + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L") + endif() + + option(DCMTK_FORCE_FPIC_ON_UNIX "Add -fPIC compiler flag on unix 64 bit machines to allow linking from dynamic libraries even if DCMTK is built statically" OFF) + mark_as_advanced(DCMTK_FORCE_FPIC_ON_UNIX) + + # Setting for IA64 / x86_64 which needs -fPIC compiler flag required for shared library build on these platforms + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND DCMTK_FORCE_FPIC_ON_UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + endif() + + # When compiling with IBM xlC, add flags to suppress some noisy C++ warnings + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qsuppress=1500-029:1500-030") + endif() + +endif() + +# define libraries and object files that must be linked to most Windows applications +if(WIN32) + set(WIN32_STD_LIBRARIES iphlpapi ws2_32 netapi32 wsock32) + if(NOT DEFINED MINGW) + # additional object file needed for wildcard expansion; for wchar_t* support, use 'wsetargv' + set(WIN32_STD_OBJECTS setargv) + endif() + # settings for Borland C++ + if(CMAKE_CXX_COMPILER MATCHES bcc32) + # to be checked: further settings required? + set(CMAKE_STANDARD_LIBRARIES "import32.lib cw32mt.lib") + endif() +endif() + +# add definition of "DEBUG" to debug mode (since CMake does not do this automatically) +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") + +# handle CMAKE_CXX_STANDARD and related variables +if(DCMTK_CMAKE_HAS_CXX_STANDARD) + if(NOT DEFINED CMAKE_CXX_STANDARD) + if(DCMTK_ENABLE_CXX11 AND NOT DCMTK_ENABLE_CXX11 STREQUAL "INFERRED") + set(CMAKE_CXX_STANDARD 11) + endif() + endif() + if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD MATCHES "^9[0-9]?$") + set(DCMTK_MODERN_CXX_STANDARD FALSE) + else() + set(DCMTK_MODERN_CXX_STANDARD TRUE) + endif() + define_property(GLOBAL PROPERTY DCMTK_MODERN_CXX_STANDARD + BRIEF_DOCS "TRUE when compiling C++11 (or newer) code." + FULL_DOCS "TRUE when the compiler does support and is configured for C++11 or a later C++ standard." + ) + set_property(GLOBAL PROPERTY DCMTK_MODERN_CXX_STANDARD ${DCMTK_MODERN_CXX_STANDARD}) + if(DEFINED DCMTK_CXX11_FLAGS) + message(WARNING "Legacy variable DCMTK_CXX11_FLAGS will be ignored since CMake now sets the flags based on the CMAKE_CXX_STANDARD variable automatically.") + endif() +elseif(NOT DEFINED DCMTK_CXX11_FLAGS) + # determine which flags are required to enable C++11 features (if any) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + set(DCMTK_CXX11_FLAGS "-std=c++11") + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + if(CMAKE_HOST_WIN32) + set(DCMTK_CXX11_FLAGS "/Qstd=c++11") + else() + set(DCMTK_CXX11_FLAGS "-std=c++11") + endif() + else() + set(DCMTK_CXX11_FLAGS "") + endif() + set(DCMTK_CXX11_FLAGS "${DCMTK_CXX11_FLAGS}" CACHE STRING "The flags to add to CMAKE_CXX_FLAGS for enabling C++11 (if any).") + mark_as_advanced(DCMTK_CXX11_FLAGS) +endif() +define_property(GLOBAL PROPERTY DCMTK_MODERN_CXX_STANDARDS + BRIEF_DOCS "Modern C++ standards DCMTK knows about." + FULL_DOCS "The list of C++ standards since C++11 that DCMTK currently has configuration tests for. " +) +set_property(GLOBAL PROPERTY DCMTK_MODERN_CXX_STANDARDS 11 14 17) + +#----------------------------------------------------------------------------- +# Third party libraries +#----------------------------------------------------------------------------- + +include(${DCMTK_CMAKE_INCLUDE}CMake/3rdparty.cmake) + +#----------------------------------------------------------------------------- +# DCMTK libraries +#----------------------------------------------------------------------------- + +include(${DCMTK_CMAKE_INCLUDE}CMake/GenerateDCMTKConfigure.cmake) + +#----------------------------------------------------------------------------- +# Dart configuration (disabled per default) +#----------------------------------------------------------------------------- + +# Includes build targets Experimental, Nightly and Continuous which are the standard +# groups pre-configured in Dashboard. In CTest these groups are called "Tracks". +# +# include(${CMAKE_ROOT}/Modules/Dart.cmake) +# if(BUILD_TESTING) +# enable_testing() +# endif() + +#----------------------------------------------------------------------------- +# Thread support +#----------------------------------------------------------------------------- + +# See dcmtk/config/configure.in +if(WITH_THREADS) + add_definitions(-D_REENTRANT) + if(HAVE_PTHREAD_RWLOCK) + if(APPLE) + add_definitions(-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE) + endif() + if(CMAKE_SYSTEM_NAME MATCHES "^IRIX") + add_definitions(-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT) + endif() + endif() + + if(HAVE_PTHREAD_H) + CHECK_LIBRARY_EXISTS(pthread pthread_key_create "" HAVE_LIBPTHREAD) + if(HAVE_LIBPTHREAD) + set(THREAD_LIBS pthread) + endif() + CHECK_LIBRARY_EXISTS(rt sem_init "" HAVE_LIBRT) + if(HAVE_LIBRT) + set(THREAD_LIBS ${THREAD_LIBS} rt) + endif() + endif() +endif() + +#----------------------------------------------------------------------------- +# Test for socket libraries if needed (Solaris) +#----------------------------------------------------------------------------- + +set(SOCKET_LIBS) + +function(DCMTK_TEST_SOCKET_LIBRARY NAME SYMBOL) + string(TOUPPER "${NAME}" VARNAME) + CHECK_LIBRARY_EXISTS("${NAME}" "main" "" "HAVE_LIB${VARNAME}_MAIN") + if(NOT HAVE_LIB${VARNAME}_MAIN) + CHECK_LIBRARY_EXISTS("${NAME}" "${SYMBOL}" "" "HAVE_LIB${VARNAME}") + endif() + if(HAVE_LIB${VARNAME} OR HAVE_LIB${VARNAME}_MAIN) + list(APPEND SOCKET_LIBS "${NAME}") + set(SOCKET_LIBS "${SOCKET_LIBS}" PARENT_SCOPE) + endif() +endfunction() + +DCMTK_TEST_SOCKET_LIBRARY(nsl "gethostbyname") +DCMTK_TEST_SOCKET_LIBRARY(socket "socket") + +#----------------------------------------------------------------------------- +# Test if SunPro compiler and add features +#----------------------------------------------------------------------------- + +if(CMAKE_CXX_COMPILER_ID STREQUAL SunPro) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -features=tmplrefstatic") +endif() + +#----------------------------------------------------------------------------- +# workaround for using the deprecated generator expression $ +# with old CMake versions that do not understand $ +#----------------------------------------------------------------------------- +if(CMAKE_VERSION VERSION_LESS 3.0.0) + set(DCMTK_CONFIG_GENERATOR_EXPRESSION "$" CACHE INTERNAL "the generator expression to use for retriving the current config") +else() + set(DCMTK_CONFIG_GENERATOR_EXPRESSION "$" CACHE INTERNAL "the generator expression to use for retriving the current config") +endif() diff --git a/CMake/dcmtkTestCharSignedness.cc b/CMake/dcmtkTestCharSignedness.cc new file mode 100644 index 00000000..a25633c1 --- /dev/null +++ b/CMake/dcmtkTestCharSignedness.cc @@ -0,0 +1,6 @@ +/* Return 1 for char signed and 0 for char unsigned. */ +int main() +{ + unsigned char uc = 255; + return (*reinterpret_cast(&uc) < 0)?1:0; +} diff --git a/CMake/dcmtkTryCompile.cmake b/CMake/dcmtkTryCompile.cmake new file mode 100644 index 00000000..df5f3b85 --- /dev/null +++ b/CMake/dcmtkTryCompile.cmake @@ -0,0 +1,43 @@ +# +# Check if a given C++ source code compiles +# +# VAR - Variable to set to 1 or 0, depending on the result +# MESSAGE - Description of the thing that we are checking for +# SOURCE - Code to compile +# +# All extra arguments are passed to try_compile(). +# + +macro(DCMTK_TRY_COMPILE VAR MESSAGE SOURCE) + set(DCMTK_TRY_COMPILE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx") + + # Do nothing if the variable is already set + if(NOT DEFINED "${VAR}") + message(STATUS "Checking whether ${MESSAGE}") + file(WRITE "${DCMTK_TRY_COMPILE_FILE}" "${SOURCE}\n") + if(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS) + set(DCMTK_TRY_COMPILE_CMAKE_FLAGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS}) + else() + DCMTK_UNSET(DCMTK_TRY_COMPILE_CMAKE_FLAGS) + endif() + try_compile(${VAR} + "${CMAKE_BINARY_DIR}" + "${DCMTK_TRY_COMPILE_FILE}" + ${DCMTK_TRY_COMPILE_CMAKE_FLAGS} + OUTPUT_VARIABLE OUTPUT + ${ARGN}) + if(${VAR}) + message(STATUS "Checking whether ${MESSAGE} -- yes") + set(${VAR} 1 CACHE INTERNAL "${MESSAGE}") + file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log" + "${MESSAGE} passed with the following output:\n" + "${OUTPUT}\n") + else() + message(STATUS "Checking whether ${MESSAGE} -- no") + set(${VAR} 0 CACHE INTERNAL "${MESSAGE}") + file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" + "${MESSAGE} failed with the following output:\n" + "${OUTPUT}\n") + endif() + endif() +endmacro() diff --git a/CMake/dcmtkTryRun.cmake b/CMake/dcmtkTryRun.cmake new file mode 100644 index 00000000..86f7bd8b --- /dev/null +++ b/CMake/dcmtkTryRun.cmake @@ -0,0 +1,95 @@ +# +# Wrapper implementation of try_run(), with some support for +# cross-compiling +# +# Usage and syntax is equivalent to CMake's try_run(). +# + +# CMakeParseArguments was introduced in CMake 2.8.3. +# DCMTK_TRY_RUN will revert to CMake's internal try_run() +# for versions prior to 2.8.3, as arguments can't be parsed +# in that case. This means cross compiling support will be +# disabled for CMake versions prior to 2.8.3. +if(CMAKE_VERSION VERSION_LESS 2.8.3) + +macro(DCMTK_TRY_RUN) + try_run(${ARGN}) +endmacro() + +else() + +include(CMakeParseArguments) + +function(DCMTK_TRY_RUN_CROSS RUN_RESULT_VAR COMPILE_RESULT_VAR bindir srcfile) + set(PASSTHROUGH_ARGS COMPILE_DEFINITIONS LINK_LIBRARIES) + cmake_parse_arguments(DCMTK_TRY_RUN + "" + "COMPILE_OUTPUT_VARIABLE;RUN_OUTPUT_VARIABLE;OUTPUT_VARIABLE" + "CMAKE_FLAGS;${PASSTHROUGH_ARGS};ARGS" + ${ARGN} + ) + get_filename_component(OUTPUT_EXECUTABLE_NAME "${srcfile}" NAME) + set(OUTPUT_EXECUTABLE_NAME "${OUTPUT_EXECUTABLE_NAME}${CMAKE_EXECUTABLE_SUFFIX}") + set(OUTPUT_EXECUTABLE "${bindir}/${OUTPUT_EXECUTABLE_NAME}") + set(TRY_COMPILE_ARGS "${COMPILE_RESULT_VAR}" "${bindir}" "${srcfile}") + if(DCMTK_TRY_RUN_CMAKE_FLAGS) + list(APPEND TRY_COMPILE_ARGS CMAKE_FLAGS ${DCMTK_TRY_RUN_CMAKE_FLAGS} ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS}) + elseif(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS) + list(APPEND TRY_COMPILE_ARGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS}) + endif() + foreach(ARG ${PASSTHROUGH_ARGS}) + if(DCMTK_TRY_RUN_${ARG}) + list(APPEND TRY_COMPILE_ARGS "${ARG}" ${DCMTK_TRY_RUN_${ARG}}) + endif() + endforeach() + if(DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE) + list(APPEND TRY_COMPILE_ARGS OUTPUT_VARIABLE ${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE}) + endif() + try_compile(${TRY_COMPILE_ARGS} COPY_FILE "${OUTPUT_EXECUTABLE}") + set("${COMPILE_RESULT_VAR}" ${${COMPILE_RESULT_VAR}} PARENT_SCOPE) + if(DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE) + set("${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE}" ${${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE}} PARENT_SCOPE) + endif() + if(${COMPILE_RESULT_VAR}) + if(WIN32) + WINE_COMMAND(CMD "${OUTPUT_EXECUTABLE}" ${DCMTK_TRY_RUN_ARGS}) + WINE_DETACHED("${RUN_RESULT_VAR}" "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" "${WINE_WINE_PROGRAM}" ${CMD}) + elseif(ANDROID) + DCMTK_ANDROID_WAIT_FOR_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE) + if(NOT DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED) + DCMTK_ANDROID_FIND_RUNTIME_LIBRARIES(ANDROID_RUNTIME_LIBRARIES) + set(ANDROID_RUNTIME_LIBRARIES ${ANDROID_RUNTIME_LIBRARIES} CACHE INTERNAL "") + DCMTK_ANDROID_PUSH(DCMTK_ANDROID_EMULATOR_INSTANCE ${ANDROID_RUNTIME_LIBRARIES} DESTINATION "${ANDROID_TEMPORARY_FILES_LOCATION}") + set(DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED TRUE CACHE INTERNAL "") + endif() + DCMTK_ANDROID_PUSH(DCMTK_ANDROID_EMULATOR_INSTANCE "${OUTPUT_EXECUTABLE}" DESTINATION "${ANDROID_TEMPORARY_FILES_LOCATION}/${OUTPUT_EXECUTABLE_NAME}") + DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE + COMMAND chmod 755 "${ANDROID_TEMPORARY_FILES_LOCATION}/${OUTPUT_EXECUTABLE_NAME}" + OUTPUT_QUIET + ERROR_QUIET + ) + DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE + COMMAND "LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${ANDROID_TEMPORARY_FILES_LOCATION}" "${ANDROID_TEMPORARY_FILES_LOCATION}/${OUTPUT_EXECUTABLE_NAME}" ${DCMTK_TRY_RUN_ARGS} + RESULT_VARIABLE "${RUN_RESULT_VAR}" + OUTPUT_VARIABLE "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" + ERROR_VARIABLE "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" + ) + else() + message(WARNING "Emulation for your target platform is not available, please fill in the required configure test results manually.") + try_run("${RUN_RESULT_VAR}" "${COMPILE_RESULT_VAR}" "${bindir}" "${srcfile}" ${ARGN}) + return() + endif() + set("${RUN_RESULT_VAR}" ${${RUN_RESULT_VAR}} PARENT_SCOPE) + set("${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" ${${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}} PARENT_SCOPE) + endif() +endfunction() + +macro(DCMTK_TRY_RUN) + if(CMAKE_CROSSCOMPILING) + DCMTK_TRY_RUN_CROSS(${ARGN}) + else() + try_run(${ARGN}) + endif() +endmacro() + +endif() diff --git a/CMake/dcmtkUseAndroidSDK.cmake b/CMake/dcmtkUseAndroidSDK.cmake new file mode 100644 index 00000000..dec15b94 --- /dev/null +++ b/CMake/dcmtkUseAndroidSDK.cmake @@ -0,0 +1,647 @@ +# +# Functions for detection and usage of then Android SDK +# Used when cross compiling for Android +# +# The Android device emulator (included in the SDK) can +# be "remote" controlled by the functions and macros +# implemented in this file. +# They are employing a pseudo object-oriented approach +# to handle an emulator instance, that is an emulator +# instance is described by a so called emulator instance +# object handle which has to be passed to all functions +# operating on it as their first argument. +# Android emulator object handles consist of the +# following properties, which need to be tracked to +# describe and Android emulator instance: +# EMULATOR_STATE: the state of the emulator instance, +# can be one of the following values: +# * STARTING - the instance has been initialized +# and the emulator has been executed +# * RUNNING - the emulated device is online and +# can receive instructions +# * STOPPED - the emulated device has been +# shutdown or is currently being +# shutdown +# EMULATOR_UUID: a generated ID to identify the emulator +# instance. Meant to prevent accessing the wrong device +# in case multiple Android devices are accessible. +# EMULATOR_NAME: the name of the emulator instance. +# all running emulator instances are named by the SDK +# in a locally unique fashion. The name will only be +# available in case the state is 'RUNNING', since +# only the name of running devices can be retrieved +# by UUID matching. +# An emulator instance is accessed by the different +# tools of the NDK (e. g. 'adb') by referring to the +# instance with the value of EMULATOR_NAME. + +include(CMakeParseArguments) + +# +# 'Unpacks' an Android emulator instance handle object to +# individual components. +# VAR - the emulator instance handle object to unpack +# EMULATOR_STATE - will contain the emulators state +# EMULATOR_UUID - will contain the generated UUID that +# identifies the emulator instance +# EMULATOR_NAME - will contain the instance name, required +# to access the emulator via 'adb' etc. +# All three outputs will be unset if the object in VAR +# is not a valid emulator instance handle. +# All additional arguments will be ignored. +# +macro(DCMTK_ANDROID_GET_OBJECT_PROPERTIES VAR) + list(LENGTH ${VAR} ${VAR}_LENGTH) + if(${VAR}_LENGTH EQUAL 3) + list(GET ${VAR} 0 EMULATOR_STATE) + list(GET ${VAR} 1 EMULATOR_UUID) + list(GET ${VAR} 2 EMULATOR_NAME) + else() + unset(EMULATOR_STATE) + unset(EMULATOR_UUID) + unset(EMULATOR_NAME) + endif() +endmacro() + +# +# Stores the properties of an emulator instance inside an +# emulator instance handle object. +# VAR - the name of the variable that shall contain the +# resulting instance handle object. +# EMULATOR_STATE - the state to set +# EMULATOR_UUID - the UUID to set +# EMULATOR_NAME - the name to set +# All additional arguments will be ignored. +# +macro(DCMTK_ANDROID_SET_OBJECT_PROPERTIES VAR EMULATOR_STATE EMULATOR_UUID EMULATOR_NAME) + set(${VAR} "${EMULATOR_STATE}" "${EMULATOR_UUID}" "${EMULATOR_NAME}" CACHE INTERNAL "") +endmacro() + +# +# Destroys an instance handle object. +# VAR - the name of the variable its emulator instance handle +# shall be object destroyed +# All additional arguments will be ignored. +# +macro(DCMTK_ANDROID_DESTROY_OBJECT VAR) + unset("${VAR}" CACHE) +endmacro() + +# +# Tries to detect any required shared objects within the NDK +# VAR - the name of the variable that will receive a list +# of required shared object files (if any) +# Will set VAR to an empty list if no shared objects are +# required (e. g. when they are linked statically). +# All additional arguments will be ignored. +# +function(DCMTK_ANDROID_FIND_RUNTIME_LIBRARIES VAR) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".so") + foreach(DIR ${ANDROID_STL_INCLUDE_DIRS}) + if(CMAKE_VERSION VERSION_LESS 2.8.11) + get_filename_component(DIR "${DIR}" PATH) + else() + get_filename_component(DIR "${DIR}" DIRECTORY) + endif() + list(APPEND ANDROID_STL_LIBRARY_DIRS "${DIR}") + endforeach() + find_library(ANDROID_STL_SHARED_OBJECT ${ANDROID_STL} PATHS ${ANDROID_STL_LIBRARY_DIRS} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + if(ANDROID_STL_SHARED_OBJECT) + set("${VAR}" ${ANDROID_STL_SHARED_OBJECT} PARENT_SCOPE) + endif() +endfunction() + +# +# Tries to detect the required executables and scripts automatically, +# which should be contained in the Android SDK. Emits an error that +# will halt the configuration process if that is not possible. +# Will also detect all available AVDs after tool detection was +# successful. +# All arguments will be ignored. +# +function(DCMTK_SETUP_ANDROID_EMULATOR) + if(NOT ANDROID_TEMPORARY_FILES_LOCATION) + set(ANDROID_TEMPORARY_FILES_LOCATION "/cache" CACHE STRING "The path on the Android device that should be used for temporary files") + endif() + if(NOT ANDROID_SDK_ROOT) + if(CMAKE_HOST_SYSTEM MATCHES "Windows.*") + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_SDK_SEARCH_PATHS) + set(ANDROID_SDK_ROOT "${ANDROID_SDK_SEARCH_PATHS}/android-sdk" CACHE PATH "Location of the Android SDK") + else() + set(ANDROID_SDK_ROOT "/opt/android-sdk" CACHE PATH "Location of the Android SDK") + endif() + endif() + find_program(ANDROID_EMULATOR_PROGRAM emulator PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + if(CMAKE_HOST_SYSTEM MATCHES "Windows.*") + find_program(ANDROID_ANDROID_PROGRAM android.bat PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + else() + find_program(ANDROID_ANDROID_PROGRAM android PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + endif() + find_program(ANDROID_ADB_PROGRAM adb PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES platform-tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + if(NOT ANDROID_EMULATOR_PROGRAM OR NOT ANDROID_ANDROID_PROGRAM OR NOT ANDROID_ADB_PROGRAM) + message(FATAL_ERROR + "Failed to detect the Android SDK, please set ANDROID_SDK_ROOT to the location of your Android SDK" + "or set the missing tools manually!" + ) + else() + execute_process(COMMAND "${ANDROID_ANDROID_PROGRAM}" list avd RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_QUIET) + string(REGEX MATCHALL "Name:[ \t]*[^\r\n]*" ANDROID_AVAILABLE_AVDS ${OUTPUT}) + string(REGEX REPLACE "Name:[ \t]*([^\r\n;]*)" "\\1" ANDROID_AVAILABLE_AVDS "${ANDROID_AVAILABLE_AVDS}") + set(ANDROID_EMULATOR_AVD "${ANDROID_EMULATOR_AVD}" CACHE STRING "Android emulator Android Virtual Device (AVD) configuration" FORCE) + set_property(CACHE ANDROID_EMULATOR_AVD PROPERTY STRINGS ${ANDROID_AVAILABLE_AVDS}) + endif() +endfunction() + +# +# Enumerates all currently available Android devices +# (started emulators and connected devices) and separates +# them into two different lists. +# ONLINE - the name of the variable that will be set to a +# list of all currently online devices' names +# (devices that can receive instructions) +# OFFLINE - the name of the variable that will be set to a +# list of all currently offline device's names +# (devices that are connected but cannot receive +# instructions) +# Will ignore all additional arguments. +# +function(DCMTK_ANDROID_LIST_EMULATORS ONLINE OFFLINE) + DCMTK_SETUP_ANDROID_EMULATOR() + if(ANDROID_ADB_PROGRAM) + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" devices + RESULT_VARIABLE RESULT + OUTPUT_VARIABLE DEVICES_RAW + ERROR_QUIET + ) + string(REPLACE "\n" ";" DEVICES "${DEVICES_RAW}") + foreach(DEVICE ${DEVICES}) + string(REGEX REPLACE "(.+)\t(.+)" "\\1;\\2" DS "${DEVICE}") + list(LENGTH DS DSL) + if(DSL EQUAL 2) + list(GET DS 0 EMULATOR_NAME) + list(GET DS 1 EMULATOR_STATE) + if(EMULATOR_STATE MATCHES "^device$") + list(APPEND "${ONLINE}" ${EMULATOR_NAME}) + else() + list(APPEND "${OFFLINE}" ${EMULATOR_NAME}) + endif() + endif() + endforeach() + endif() + set("${ONLINE}" ${${ONLINE}} PARENT_SCOPE) + set("${OFFLINE}" ${${OFFLINE}} PARENT_SCOPE) +endfunction() + +# +# Generate a random ID that is hopefully unique +# enough to be used as the instance UUID. +# VAR - the name of the variable that will receive +# the generated UUID as a string value +# Will ignore all additional arguments. +# +if(CMAKE_VERSION VERSION_LESS 2.8.11) +macro(DCMTK_ANDROID_EMULATOR_GENERATE_UUID VAR) + string(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ${VAR}) +endmacro() +else() +function(DCMTK_ANDROID_EMULATOR_GENERATE_UUID VAR) + string(RANDOM LENGTH 20 RAND) + string(TIMESTAMP TM) + set(${VAR} "${TM}${RAND}") + string(MD5 ${VAR} ${${VAR}}) + set(${VAR} ${${VAR}} PARENT_SCOPE) +endfunction() +endif() + +# +# Tries to query the UUID property of an accessible Android device. +# EMULATOR_NAME - the device name, as returned by DCMTK_ANDROID_LIST_EMULATORS +# VAR - the name of the variable that will be set to the device UUID +# Will unset the variable referred to by VAR if no device with the given name +# is accessible or the device is offline. +# Will ignore all additional arguments. +# +function(DCMTK_ANDROID_GET_EMULATOR_UUID EMULATOR_NAME VAR) + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" shell getprop "ro.emu.uuid" + RESULT_VARIABLE RESULT + OUTPUT_VARIABLE OUTPUT + ERROR_QUIET + ) + DCMTK_UNSET_PARENT_SCOPE(${VAR}) + if(NOT RESULT) + string(STRIP "${OUTPUT}" UUID) + if(UUID) + set("${VAR}" ${UUID} PARENT_SCOPE) + endif() + endif() +endfunction() + +# +# Retrieves the name of the emulator instance referred to by +# the given UUID. Will wait until the device becomes online +# to query the name. +# VAR - the name of the variable that will be set +# to the device name +# EMULATOR_UUID - the emulator UUID of the device to inquired +# Will wait until all available devices are online or the right +# one has been found. +# Will ignore all additional arguments. +# +function(DCMTK_ANDROID_GET_EMULATOR_NAME VAR EMULATOR_UUID) + DCMTK_ANDROID_LIST_EMULATORS(ONLINE_EMULATORS OFFLINE_EMULATORS) + foreach(EMULATOR ${ONLINE_EMULATORS}) + DCMTK_ANDROID_GET_EMULATOR_UUID("${EMULATOR}" UUID) + if(EMULATOR_UUID STREQUAL UUID) + set("${VAR}" "${EMULATOR}" PARENT_SCOPE) + return() + endif() + endforeach() + while(OFFLINE_EMULATORS) + list(GET OFFLINE_EMULATORS 0 EMULATOR) + list(REMOVE_AT OFFLINE_EMULATORS 0) + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR}" wait-for-device + TIMEOUT 1 + RESULT_VARIABLE RESULT + OUTPUT_QUIET + ERROR_QUIET + ) + if(NOT RESULT) + DCMTK_ANDROID_GET_EMULATOR_UUID("${EMULATOR}" UUID) + if(UUID) + if(EMULATOR_UUID STREQUAL UUID) + set("${VAR}" "${EMULATOR}" PARENT_SCOPE) + return() + endif() + else() + list(APPEND OFFLINE_EMULATORS "${EMULATOR}") + endif() + else() + list(APPEND OFFLINE_EMULATORS "${EMULATOR}") + endif() + endwhile() +endfunction() + +# +# Sets up and starts a new emulator instance or reuses an +# existing one. +# VAR - the emulator instance handle object to reuse or +# initialize +# Will test if VAR refers to a valid emulator instance +# handle and, if so, ensure the device is started. +# Will initialize a new emulator instance and start it, +# if VAR does not refer to a valid emulator instance. +# Will ignore all additional arguments. +# +function(DCMTK_ANDROID_START_EMULATOR VAR) + DCMTK_SETUP_ANDROID_EMULATOR() + if(NOT ANDROID_EMULATOR_AVD) + message(FATAL_ERROR "Please select which Android emulator Android Virtual Device (AVD) configuration to use!") + else() + DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}") + if(NOT EMULATOR_STATE) + DCMTK_ANDROID_EMULATOR_GENERATE_UUID(EMULATOR_UUID) + elseif(EMULATOR_STATE STREQUAL "RUNNING") + DCMTK_ANDROID_GET_EMULATOR_UUID("${EMULATOR_NAME}" UUID) + # Do nothing if the running emulator instance is ok and can be reused. + # Otherwise restart it. + if(UUID STREQUAL EMULATOR_UUID) + message(STATUS "Reusing already running Android device emulator...") + return() + endif() + elseif(EMULATOR_STATE STREQUAL "STARTING") + # Is it really starting, or has somebody aborted it? + message(STATUS "Found previously started Android device emulator, checking if it's still present...") + DCMTK_ANDROID_GET_EMULATOR_NAME(EMULATOR_NAME "${EMULATOR_UUID}") + if(EMULATOR_NAME) + message(STATUS "Found previously started Android device emulator, checking if it's still present... yes") + DCMTK_ANDROID_SET_OBJECT_PROPERTIES(${VAR} RUNNING "${EMULATOR_UUID}" "${EMULATOR_NAME}") + return() + endif() + message(STATUS "Found previously started Android device emulator, checking if it's still present... no") + endif() + message(STATUS "Starting the Android device emulator...") + if(CMAKE_HOST_SYSTEM MATCHES "Windows.*") + set(COMMAND sh -c "${ANDROID_EMULATOR_PROGRAM} -avd ${ANDROID_EMULATOR_AVD} -no-boot-anim -prop ro.emu.uuid=${EMULATOR_UUID} >${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android-emulator.log 2>&1 < /dev/null &") + else() + set(COMMAND sh -c "${ANDROID_EMULATOR_PROGRAM} -avd ${ANDROID_EMULATOR_AVD} -no-window -no-boot-anim -prop ro.emu.uuid=${EMULATOR_UUID} >${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android-emulator.log 2>&1 < /dev/null &") + endif() + execute_process( + COMMAND ${COMMAND} + RESULT_VARIABLE RESULT + OUTPUT_QUIET + ERROR_QUIET + ) + if(NOT RESULT) + DCMTK_ANDROID_SET_OBJECT_PROPERTIES("${VAR}" STARTING "${EMULATOR_UUID}" "") + else() + DCMTK_ANDROID_DESTROY_OBJECT("${VAR}") + message(FATAL_ERROR "Error starting Android emulator.") + endif() + endif() +endfunction() + +# +# Restart adb/the emulated device in root mode so that we gain write access to +# the device. +# Newer versions of the SDK seem to require this for doing anything meaningful +# with it. +# EMULATOR_NAME - the name of the emulated device that shall be rooted. +# Will ignore all additional arguments. +# +function(DCMTK_ANDROID_ADB_ROOT EMULATOR_NAME) + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" root + OUTPUT_QUIET + ERROR_QUIET + ) + # the SDK was seemingly designed by a five year old, the device will + # become invisible while it is being rooted, therefore, wait until + # it is ready again + set(STATUS 1) + while(STATUS) + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" wait-for-device + RESULT_VARIABLE STATUS + OUTPUT_QUIET + ERROR_QUIET + ) + endwhile() +endfunction() + +# +# Waits until the given emulator instance becomes online (RUNNING). +# VAR - the emulator instance handle object referring to the emulator +# to wait for +# Will fail with a warning message if the given variable does not +# refer to a valid emulator instance handle object. +# Will set the object's state to "RUNNING" when successful. +# Will wait indefinitely if no such device exists or the device does +# not become online. +# Will ignore all additional arguments. +# +function(DCMTK_ANDROID_WAIT_FOR_EMULATOR VAR) + DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}") + if(NOT EMULATOR_STATE) + message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.") + elseif(EMULATOR_STATE STREQUAL "RUNNING") + # Emulator is running, no need to wait! + elseif(EMULATOR_STATE STREQUAL "STOPPED") + message(WARNING "The Android emulator has stopped, aborting...") + else() + message(STATUS "Waiting until the Android device emulator is ready to receive instructions...") + while(NOT EMULATOR_NAME) + DCMTK_ANDROID_GET_EMULATOR_NAME(EMULATOR_NAME "${EMULATOR_UUID}") + endwhile() + DCMTK_ANDROID_ADB_ROOT("${EMULATOR_NAME}") + DCMTK_ANDROID_SET_OBJECT_PROPERTIES("${VAR}" RUNNING "${EMULATOR_UUID}" "${EMULATOR_NAME}") + endif() +endfunction() + +# +# Prepare a command that will shutdown the given Android emulator when +# in the local shell run. +# VAR - the name of the variable that will be set to the +# generated command +# EMULATOR_NAME - the name of the emulated device that shall be shut +# down +# Will unset the variable referred to by VAR if no such command can +# be generated for the current host platform (Windows). +# Will ignore all additional arguments. +# +macro(DCMTK_ANDROID_STOP_EMULATOR_COMMAND VAR EMULATOR_NAME) + if(CMAKE_HOST_SYSTEM MATCHES "Windows.*") + unset("${VAR}") + else() + set("${VAR}" "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" emu kill) + endif() +endmacro() + +# +# Prepare an emulator shutdown message or a warning message if automated +# shutdown is not possible. +# VAR - the name of the variable that will be set to the generated message +# Will ignore all additional arguments. +# +macro(DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE VAR) + if(CMAKE_HOST_SYSTEM MATCHES "Windows.*") + set("${VAR}" WARNING "The Android device emulator can't be terminated automatically under Windows, please shutdown \"${EMULATOR_NAME}\" manually!") + else() + set("${VAR}" STATUS "Shutting down the Android device emulator...") + endif() +endmacro() + +# +# Stops the emulator and sets its state to STOPPED when successful. +# VAR - the name of the variable referring to the emulator instance +# handle object +# Will emit a warning message if the emulator can't be stopped and +# won't modify its state in that case. +# Will ignore all additional arguments. +# +function(DCMTK_ANDROID_STOP_EMULATOR VAR) + DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}") + if(NOT EMULATOR_STATE) + message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.") + elseif(EMULATOR_STATE STREQUAL "STARTING") + # Can't tell it to stop if it is not done starting + DCMTK_ANDROID_WAIT_FOR_EMULATOR("${VAR}") + elseif(EMULATOR_STATE STREQUAL "STOPPED") + # Emulator is already stopped, do nothing + return() + endif() + DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE(MESSAGE) + message(${MESSAGE}) + if(NOT CMAKE_HOST_SYSTEM MATCHES "Windows.*") + DCMTK_ANDROID_STOP_EMULATOR_COMMAND(COMMAND "${EMULATOR_NAME}") + execute_process( + COMMAND ${COMMAND} + RESULT_VARIABLE RESULT + OUTPUT_QUIET + ERROR_QUIET + ) + if(NOT RESULT) + DCMTK_ANDROID_SET_OBJECT_PROPERTIES("${VAR}" STOPPED "${EMULATOR_UUID}" "") + else() + message(WARNING "Unable to stop the android device emulator, please shutdown \"${EMULATOR_NAME}\" manually!") + endif() + endif() +endfunction() + +# +# Uploads local files to the given Android device using 'adb push'. +# VAR - the emulator instance handle object referring to the target +# device +# Requires the device to be running. +# Additional arguments will be parsed and interpreted similar to +# CMake's file(COPY ...) command. +# +function(DCMTK_ANDROID_PUSH VAR) + DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}") + if(NOT EMULATOR_STATE) + message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.") + elseif(EMULATOR_STATE STREQUAL "RUNNING") + cmake_parse_arguments(DCMTK_ANDROID_PUSH "" "" "DESTINATION" ${ARGN}) + foreach(LOCAL_FILE ${DCMTK_ANDROID_PUSH_UNPARSED_ARGUMENTS}) + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" push "${LOCAL_FILE}" "${DCMTK_ANDROID_PUSH_DESTINATION}" + RESULT_VARIABLE RESULT + OUTPUT_QUIET + ERROR_QUIET + ) + endforeach() + else() + message(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands") + endif() +endfunction() + +# +# Downloads remote files from the given Android device using 'adb pull'. +# VAR - the emulator instance handle object referring to the target +# device +# Requires the device to be running. +# Additional arguments will be parsed and interpreted similar to +# CMake's file(COPY ...) command. +# +function(DCMTK_ANDROID_PULL VAR) + DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}") + if(NOT EMULATOR_STATE) + message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.") + elseif(EMULATOR_STATE STREQUAL "RUNNING") + cmake_parse_arguments(DCMTK_ANDROID_PULL "" "" "DESTINATION" ${ARGN}) + foreach(REMOTE_FILE ${DCMTK_ANDROID_PULL_UNPARSED_ARGUMENTS}) + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" pull "${REMOTE_FILE}" "${DCMTK_ANDROID_PULL_DESTINATION}" + RESULT_VARIABLE RESULT + OUTPUT_QUIET + ERROR_QUIET + ) + endforeach() + else() + message(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands") + endif() +endfunction() + +# +# Executes a shell command on the given Android device using 'adb shell'. +# VAR - the emulator instance handle object referring to the target +# device +# Requires the device to be running. +# Additional arguments will be parsed and interpreted similar to +# CMake's execute_process(...) command. +# +function(DCMTK_ANDROID_SHELL VAR) + DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}") + if(NOT EMULATOR_STATE) + message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.") + elseif(EMULATOR_STATE STREQUAL "RUNNING") + cmake_parse_arguments(DCMTK_ANDROID_SHELL + "OUTPUT_QUIET;ERROR_QUIET" + "RESULT_VARIABLE;OUTPUT_VARIABLE;ERROR_VARIABLE;WORKING_DIRECTORY" + "COMMAND" + ${ARGN} + ) + + # Prepare commandline + set(COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" shell) + if(DCMTK_ANDROID_SHELL_WORKING_DIRECTORY) + list(APPEND COMMAND "cd" "${DCMTK_ANDROID_SHELL_WORKING_DIRECTORY}" "&&") + endif() + list(APPEND COMMAND "${DCMTK_ANDROID_SHELL_COMMAND}") + + # Inspect output variable parameters + if(DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE) + set(PUSH_OUTPUT_VAR TRUE) + if(DCMTK_ANDROID_SHELL_ERROR_VARIABLE) + if(DCMTK_ANDROID_SHELL_ERROR_VARIABLE STREQUAL DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE) + set(STREAMS_MERGED TRUE) + else() + set(PUSH_ERROR_VAR TRUE) + endif() + else() + set(DCMTK_ANDROID_SHELL_ERROR_VARIABLE DCMTK_ANDROID_SHELL_ERROR_MESSAGE_BUFFER) + endif() + else() + set(DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE DCMTK_ANDROID_SHELL_OUTPUT_MESSAGE_BUFFER) + if(DCMTK_ANDROID_SHELL_ERROR_VARIABLE) + set(PUSH_ERROR_VAR TRUE) + else() + set(STREAMS_MERGED TRUE) + endif() + endif() + + # Prefix to prevent collision of output capturing files + if(CMAKE_VERSION VERSION_LESS 2.8.7) + string(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" PREFIX) + else() + string(MD5 PREFIX "${DCMTK_ANDROID_SHELL_COMMAND}") + endif() + + # Prepare output redirection (buffering) + if(STREAMS_MERGED) + list(APPEND COMMAND > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" 2>&1) + else() + list(APPEND COMMAND > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" 2> "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_error") + endif() + + # Prepare capturing the result + list(APPEND COMMAND "\;" echo -n $? > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_result") + + # Run the command + execute_process( + COMMAND ${COMMAND} + RESULT_VARIABLE ADB_RESULT + OUTPUT_VARIABLE ADB_OUTPUT + ERROR_VARIABLE ADB_OUTPUT + ) + + # Deal with it + if(ADB_RESULT) + message(WARNING "Error sending command to the Android emulator, adb reported the error: ${ADB_OUTPUT}") + if(DCMTK_ANDROID_SHELL_RESULT_VARIABLE) + set("${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}" ${ADB_RESULT} PARENT_SCOPE) + endif() + else() + # Receive results + DCMTK_ANDROID_PULL("${VAR}" "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_error" "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_result" + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}" + ) + # Cleanup temp files + execute_process( + COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" shell rm "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" "\;" rm "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_error" "\;" rm "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_result" + RESULT_VARIABLE RESULT_QUIET + OUTPUT_QUIET + ERROR_QUIET + ) + # Analyze results + if(DCMTK_ANDROID_SHELL_RESULT_VARIABLE) + file(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_result" "${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}") + set("${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}" ${${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}} PARENT_SCOPE) + endif() + if(NOT DCMTK_ANDROID_SHELL_OUTPUT_QUIET OR (STREAMS_MERGED AND NOT DCMTK_ANDROID_SHELL_ERROR_QUIET)) + file(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output" "${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}") + if(PUSH_OUTPUT_VAR) + set("${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}" ${${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}} PARENT_SCOPE) + else() + message("${${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}}") + endif() + endif() + if(NOT DCMTK_ANDROID_SHELL_ERROR_QUIET AND NOT STREAMS_MERGED) + file(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error" "${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}") + if(PUSH_ERROR_VAR) + set("${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}" ${${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}} PARENT_SCOPE) + else() + message("${${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}}") + endif() + endif() + # Cleanup temp files + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_result") + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output") + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error") + endif() + else() + message(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands") + endif() +endfunction() diff --git a/CMake/dcmtkUseWine.cmake b/CMake/dcmtkUseWine.cmake new file mode 100644 index 00000000..5011033c --- /dev/null +++ b/CMake/dcmtkUseWine.cmake @@ -0,0 +1,127 @@ +# +# Functions for detection and usage of Wine +# Used when cross compiling +# + +# +# Tries to detect the required executables and libraries automatically and emits an +# error that will halt the configuration process if that is not possible. +# All arguments will be ignored. +# +function(DCMTK_SETUP_WINE) + find_program(WINE_WINE_PROGRAM wine) + find_program(WINE_WINEPATH_PROGRAM winepath) + if(NOT WINE_CPP_RUNTIME) + set(v 1) + unset(CMAKE_FIND_LIBRARY_SUFFIXES) + while(${v} LESS 14) + list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "-${v}.dll") + math(EXPR v "${v} + 1") + endwhile() + find_library(CPP_RUNTIME stdc++ DOC "Location of the C++ runtime library used during target emulation") + if(NOT CPP_RUNTIME) + message(FATAL_ERROR "Please set the C++ runtime location (required for running applications targeting Windows).") + else() + get_filename_component(CPP_RUNTIME_LOCATION ${CPP_RUNTIME} PATH) + UNIX_TO_WINE_PATH(RT ${CPP_RUNTIME_LOCATION}) + set(WINE_CPP_RUNTIME ${RT} CACHE INTERNAL "C++ RT in Wine path format") + endif() + endif() + if(NOT WINE_WINE_PROGRAM OR NOT WINE_WINEPATH_PROGRAM) + message(FATAL_ERROR + "Some wine related executables could not be detected automatically. " + "Please set WINE_WINE_PROGRAM and WINE_WINEPATH_PROGRAM appropriately." + ) + endif() + # prepare wine prefix for configure and unit tests + if(NOT DCMTK_WINEPREFIX) + set(DCMTK_WINEPREFIX "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix" CACHE INTERNALE "the path of the wineprefix to use for configuration and unit tests") + message(STATUS "Info: Preparing wine prefix for configuration and unit tests: ${DCMTK_WINEPREFIX}") + string(REPLACE "\\" "\\\\" WINE_CPP_RUNTIME "${WINE_CPP_RUNTIME}") + set(WINE_PATH_REG "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkWinePath.reg") + configure_file("${DCMTK_SOURCE_DIR}/CMake/dcmtkWinePath.reg.in" "${WINE_PATH_REG}" ESCAPE_QUOTES @ONLY) + set(ENV{WINEPREFIX} "${DCMTK_WINEPREFIX}") + execute_process(COMMAND "${WINE_WINE_PROGRAM}" "regedit" "${WINE_PATH_REG}" + OUTPUT_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log" + ERROR_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log" + OUTPUT_VARIABLE RESULT + ) + if(RESULT) + set(DCMTK_WINEPREFIX CACHE INTERNAL "error, see ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log") + message(FATAL_ERROR "Failed to setup the wineprefix, see \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log\"") + endif() + else() + set(ENV{WINEPREFIX} "${DCMTK_WINEPREFIX}") + endif() +endfunction() + +# +# Helper function to detach the output and error streams from a wine process, so +# that CMake doesn't wait for the wineserver to quit before continuing execution. +# VAR - the variable that will hold the exit code of the launched process. +# OUTPUT_VAR - the variable that will hold the standard output of the launched process. +# ERROR_VAR - the variable that will hold the error output of the launched process. +# ARGN - the command to execute. +# +function(WINE_DETACHED VAR OUTPUT_VAR ERROR_VAR) + # Prefix to prevent collision of output capturing files + if(CMAKE_VERSION VERSION_LESS 2.8.7) + string(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" PREFIX) + else() + string(MD5 PREFIX "${ARGN}") + endif() + set(OUTPUT_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output") + if(OUTPUT_VAR STREQUAL ERROR_VAR) + set(ERROR_FILE "${OUTPUT_FILE}") + else() + set(ERROR_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error") + endif() + execute_process( + COMMAND ${ARGN} + OUTPUT_FILE "${OUTPUT_FILE}" + ERROR_FILE "${ERROR_FILE}" + RESULT_VARIABLE RESULT + ) + file(READ "${OUTPUT_FILE}" OUTPUT) + set("${OUTPUT_VAR}" ${OUTPUT} PARENT_SCOPE) + if(OUTPUT_VAR STREQUAL ERROR_VAR) + file(REMOVE "${OUTPUT_FILE}") + else() + file(READ "${ERROR_FILE}" ERROR) + set("${ERROR_VAR}" ${ERROR} PARENT_SCOPE) + file(REMOVE "${OUTPUT_FILE}" "${ERROR_FILE}") + endif() + set("${VAR}" ${RESULT} PARENT_SCOPE) +endfunction() + +# +# Uses 'winepath' to translate a host path or filename to the location it can be +# accessed from within the emulated Windows environment (e. g. replaces '/' by '\'). +# VAR - name of the variable to store the result in +# PATH - the path to be translated +# Will unset VAR if an error occurred. +# Additional arguments will be ignored. +# +function(UNIX_TO_WINE_PATH VAR PATH) + WINE_DETACHED(ERROR RESULT STDERR "${WINE_WINEPATH_PROGRAM}" "-w" "${PATH}") + if(NOT ERROR) + string(REPLACE "\n" "" RESULT ${RESULT}) + set(${VAR} ${RESULT} PARENT_SCOPE) + else() + unset(${VAR} PARENT_SCOPE) + message(WARNING "Unable to convert path to Wine format: ${STDERR}") + endif() +endfunction() + +# +# Create a command (as string) to run a given command in the emulated Windows +# environment by using 'wine'. +# VAR - name of the variable to store the resulting command in +# COMMAND - the command to run, e. g. 'dir' +# Additional arguments will be appended to the command. +# +function(WINE_COMMAND VAR COMMAND) + UNIX_TO_WINE_PATH(CMD ${COMMAND}) + separate_arguments(ARGS WINDOWS_COMMAND "${ARGN}") + set(${VAR} "${CMD}" ${ARGS} PARENT_SCOPE) +endfunction() diff --git a/CMake/dcmtkWinePath.reg.in b/CMake/dcmtkWinePath.reg.in new file mode 100644 index 00000000..78d3dd91 --- /dev/null +++ b/CMake/dcmtkWinePath.reg.in @@ -0,0 +1,4 @@ +REGEDIT4 + +[HKEY_CURRENT_USER\Environment] +"PATH"="@WINE_CPP_RUNTIME@" diff --git a/CMake/osconfig.h.in b/CMake/osconfig.h.in new file mode 100644 index 00000000..3918adc1 --- /dev/null +++ b/CMake/osconfig.h.in @@ -0,0 +1,1226 @@ +#ifndef OSCONFIG_H +#define OSCONFIG_H + +/* +** Define enclosures for include files with C linkage (mostly system headers) +*/ +#ifdef __cplusplus +#define BEGIN_EXTERN_C extern "C" { +#define END_EXTERN_C } +#else +#define BEGIN_EXTERN_C +#define END_EXTERN_C +#endif + +/* Define when building a shared library */ +#cmakedefine DCMTK_SHARED @DCMTK_SHARED@ + +/* Define when building the whole toolkit as a single shared library */ +#cmakedefine DCMTK_BUILD_SINGLE_SHARED_LIBRARY @DCMTK_BUILD_SINGLE_SHARED_LIBRARY@ + +/* Define when the compiler supports hidden visibility */ +#cmakedefine HAVE_HIDDEN_VISIBILITY @HAVE_HIDDEN_VISIBILITY@ + +/* Define when building with wide char file I/O functions */ +#cmakedefine WIDE_CHAR_FILE_IO_FUNCTIONS @WIDE_CHAR_FILE_IO_FUNCTIONS@ + +/* Define when building command line tools with wide char main function */ +#cmakedefine WIDE_CHAR_MAIN_FUNCTION @WIDE_CHAR_MAIN_FUNCTION@ + +#ifdef _WIN32 + /* Define if you have the header file. */ +#cmakedefine HAVE_WINDOWS_H @HAVE_WINDOWS_H@ + /* Define if you have the header file. */ +#cmakedefine HAVE_WINSOCK_H @HAVE_WINSOCK_H@ +#endif + +/* Define the canonical host system type as a string constant */ +#define CANONICAL_HOST_TYPE "@CANONICAL_HOST_TYPE@" + +/* Define if char is unsigned on the C compiler */ +#cmakedefine C_CHAR_UNSIGNED @C_CHAR_UNSIGNED@ + +/* Define to the inline keyword supported by the C compiler, if any, or to the + empty string */ +#define C_INLINE __inline + +/* Define if >> is unsigned on the C compiler */ +/* #undef C_RIGHTSHIFT_UNSIGNED */ + +/* Define the DCMTK default path */ +#define DCMTK_PREFIX "@DCMTK_PREFIX@" + +/* Define the default data dictionary path for the dcmdata library package */ +#define DCM_DICT_DEFAULT_PATH "@DCM_DICT_DEFAULT_PATH@" + +/* Define if we want a populated builtin dictionary */ +#cmakedefine ENABLE_BUILTIN_DICTIONARY "@ENABLE_BUILTIN_DICTIONARY@" + +/* Define if we want load external dictionaries */ +#cmakedefine ENABLE_EXTERNAL_DICTIONARY "@ENABLE_EXTERNAL_DICTIONARY@" + +/* Define the environment variable path separator */ +#define ENVIRONMENT_PATH_SEPARATOR '@ENVIRONMENT_PATH_SEPARATOR@' + +/* Define to 1 if you have the `accept' function. */ +#cmakedefine HAVE_ACCEPT @HAVE_ACCEPT@ + +/* Define to 1 if you have the `access' function. */ +#cmakedefine HAVE_ACCESS @HAVE_ACCESS@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ALLOCA_H @HAVE_ALLOCA_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ARPA_INET_H @HAVE_ARPA_INET_H@ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `bcmp' function. */ +#cmakedefine HAVE_BCMP @HAVE_BCMP@ + +/* Define to 1 if you have the `bcopy' function. */ +#cmakedefine HAVE_BCOPY @HAVE_BCOPY@ + +/* Define to 1 if you have the `bind' function. */ +#cmakedefine HAVE_BIND @HAVE_BIND@ + +/* Define to 1 if you have the `bzero' function. */ +#cmakedefine HAVE_BZERO @HAVE_BZERO@ + +/* Define if your C++ compiler can work with class templates */ +#define HAVE_CLASS_TEMPLATE 1 + +/* Define to 1 if you have the `connect' function. */ +#cmakedefine HAVE_CONNECT @HAVE_CONNECT@ + +/* define if the compiler supports const_cast<> */ +#define HAVE_CONST_CAST 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CTYPE_H @HAVE_CTYPE_H@ + +/* Define to 1 if you have the `cuserid' function. */ +#cmakedefine HAVE_CUSERID @HAVE_CUSERID@ + +/* Define if bool is a built-in type */ +#cmakedefine HAVE_CXX_BOOL @HAVE_CXX_BOOL@ + +/* Define if volatile is a known keyword */ +#define HAVE_CXX_VOLATILE 1 + +/* Define if "const" is supported by the C compiler */ +#define HAVE_C_CONST 1 + +/* Define if your system has a declaration for socklen_t in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_DECLARATION_SOCKLEN_T @HAVE_DECLARATION_SOCKLEN_T@ + +/* Define if your system has a declaration for std::ios_base::openmode in + iostream.h */ +#cmakedefine HAVE_DECLARATION_STD__IOS_BASE__OPENMODE @HAVE_DECLARATION_STD__IOS_BASE__OPENMODE@ + +/* Define if your system has a declaration for struct utimbuf in sys/types.h + utime.h sys/utime.h */ +#define HAVE_DECLARATION_STRUCT_UTIMBUF 1 + +/* Define to 1 if you have the header file, and it defines `DIR'.*/ +#cmakedefine HAVE_DIRENT_H @HAVE_DIRENT_H@ + +/* Define to 1 if you have the `_doprnt' function. */ +#cmakedefine HAVE_DOPRNT @HAVE_DOPRNT@ + +/* define if the compiler supports dynamic_cast<> */ +#define HAVE_DYNAMIC_CAST 1 + +/* Define if your system cannot pass command line arguments into main() (e.g. Macintosh) */ +/* #undef HAVE_EMPTY_ARGC_ARGV */ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ERRNO_H @HAVE_ERRNO_H@ + +/* Define to 1 if defined ENAMETOOLONG. */ +#cmakedefine HAVE_ENAMETOOLONG @HAVE_ENAMETOOLONG@ + +/* Define if your C++ compiler supports the explicit template specialization + syntax */ +#define HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FCNTL_H @HAVE_FCNTL_H@ + +/* Define to 1 if you have the `finite' function. */ +#cmakedefine HAVE_FINITE @HAVE_FINITE@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FLOAT_H @HAVE_FLOAT_H@ + +/* Define to 1 if you have the `flock' function. */ +#cmakedefine HAVE_FLOCK @HAVE_FLOCK@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FNMATCH_H @HAVE_FNMATCH_H@ + +/* Define to 1 if you have the `fork' function. */ +#cmakedefine HAVE_FORK @HAVE_FORK@ + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#cmakedefine HAVE_FSEEKO @HAVE_FSEEKO@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FSTREAM @HAVE_FSTREAM@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FSTREAM_H @HAVE_FSTREAM_H@ + +/* Define to 1 if you have the `ftime' function. */ +#cmakedefine HAVE_FTIME @HAVE_FTIME@ + +/* Define if your C++ compiler can work with function templates */ +#define HAVE_FUNCTION_TEMPLATE 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#cmakedefine HAVE_GETADDRINFO @HAVE_GETADDRINFO@ + +/* Define to 1 if you have the `getenv' function. */ +#cmakedefine HAVE_GETENV @HAVE_GETENV@ + +/* Define to 1 if you have the `geteuid' function. */ +#cmakedefine HAVE_GETEUID @HAVE_GETEUID@ + +/* Define to 1 if you have the `getgrnam' function. */ +#cmakedefine HAVE_GETGRNAM @HAVE_GETGRNAM@ + +/* Define to 1 if you have the `gethostbyname' function. */ +#cmakedefine HAVE_GETHOSTBYNAME @HAVE_GETHOSTBYNAME@ + +/* Define to 1 if you have the `gethostbyname_r' function. */ +#cmakedefine HAVE_GETHOSTBYNAME_R @HAVE_GETHOSTBYNAME_R@ + +/* Define to 1 if you have the `gethostbyaddr_r' function. */ +#cmakedefine HAVE_GETHOSTBYADDR_R @HAVE_GETHOSTBYADDR_R@ + +/* Define to 1 if you have the `getgrnam_r' function. */ +#cmakedefine HAVE_GETGRNAM_R @HAVE_GETGRNAM_R@ + +/* Define to 1 if you have the `getpwnam_r' function. */ +#cmakedefine HAVE_GETPWNAM_R @HAVE_GETPWNAM_R@ + +/* Define to 1 if you have the `gethostid' function. */ +#cmakedefine HAVE_GETHOSTID @HAVE_GETHOSTID@ + +/* Define to 1 if you have the `gethostname' function. */ +#cmakedefine HAVE_GETHOSTNAME @HAVE_GETHOSTNAME@ + +/* Define to 1 if you have the `getlogin' function. */ +#cmakedefine HAVE_GETLOGIN @HAVE_GETLOGIN@ + +/* Define to 1 if you have the `getlogin_r' function. */ +#cmakedefine HAVE_GETLOGIN_R @HAVE_GETLOGIN_R@ + +/* Define to 1 if you have the `getpid' function. */ +#cmakedefine HAVE_GETPID @HAVE_GETPID@ + +/* Define to 1 if you have the `getpwnam' function. */ +#cmakedefine HAVE_GETPWNAM @HAVE_GETPWNAM@ + +/* Define to 1 if you have the `getrusage' function. */ +#cmakedefine HAVE_GETRUSAGE @HAVE_GETRUSAGE@ + +/* Define to 1 if you have the `getsockname' function. */ +#cmakedefine HAVE_GETSOCKNAME @HAVE_GETSOCKNAME@ + +/* Define to 1 if you have the `getsockopt' function. */ +#cmakedefine HAVE_GETSOCKOPT @HAVE_GETSOCKOPT@ + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine HAVE_GETTIMEOFDAY @HAVE_GETTIMEOFDAY@ + +/* Define to 1 if you have the `getuid' function. */ +#cmakedefine HAVE_GETUID @HAVE_GETUID@ + +/* Define to 1 if you have the `gmtime_r' function. */ +#cmakedefine HAVE_GMTIME_R @HAVE_GMTIME_R@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_GRP_H @HAVE_GRP_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IEEEFP_H @HAVE_IEEEFP_H@ + +/* Define to 1 if you have the `index' function. */ +#cmakedefine HAVE_INDEX @HAVE_INDEX@ + +/* Define if your system declares argument 3 of accept() as int * instead of + size_t * or socklen_t * */ +#cmakedefine HAVE_INTP_ACCEPT @HAVE_INTP_ACCEPT@ + +/* Define if your system declares argument 5 of getsockopt() as int * instead + of size_t * or socklen_t */ +#cmakedefine HAVE_INTP_GETSOCKOPT @HAVE_INTP_GETSOCKOPT@ + +/* Define if your system declares argument 2-4 of select() as int * instead of + struct fd_set * */ +#cmakedefine HAVE_INTP_SELECT @HAVE_INTP_SELECT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IOMANIP @HAVE_IOMANIP@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IOMANIP_H @HAVE_IOMANIP_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IOSTREAM @HAVE_IOSTREAM@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IOSTREAM_H @HAVE_IOSTREAM_H@ + +/* Define if your system defines ios::nocreate in iostream.h */ +/* defined below */ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IO_H @HAVE_IO_H@ + +/* Define to 1 if you have the `isinf' function. */ +#cmakedefine HAVE_ISINF @HAVE_ISINF@ + +/* Define to 1 if you have the `isnan' function. */ +#cmakedefine HAVE_ISNAN @HAVE_ISNAN@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ISO646_H @HAVE_ISO646_H@ + +/* Define to 1 if you have the `itoa' function. */ +#cmakedefine HAVE_ITOA @HAVE_ITOA@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIBC_H @HAVE_LIBC_H@ + +/* Define to 1 if you have the `iostream' library (-liostream). */ +#cmakedefine HAVE_LIBIOSTREAM @HAVE_LIBIOSTREAM@ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#cmakedefine HAVE_LIBNSL @HAVE_LIBNSL@ + +/* Define to 1 if the header shall be used instead of . */ +#cmakedefine HAVE_LIBPNG_PNG_H @HAVE_LIBPNG_PNG_H@ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +#cmakedefine HAVE_LIBSOCKET @HAVE_LIBSOCKET@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CLIMITS @HAVE_CLIMITS@ + +/* Define to 1 if you have the `listen' function. */ +#cmakedefine HAVE_LISTEN @HAVE_LISTEN@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LOCALE_H @HAVE_LOCALE_H@ + +/* Define to 1 if you have the `localtime_r' function. */ +#cmakedefine HAVE_LOCALTIME_R @HAVE_LOCALTIME_R@ + +/* Define to 1 if you have the `lockf' function. */ +#cmakedefine HAVE_LOCKF @HAVE_LOCKF@ + +/* Define to 1 if you have the `lstat' function. */ +#cmakedefine HAVE_LSTAT @HAVE_LSTAT@ + +/* Define to 1 if you support file names longer than 14 characters. */ +#define HAVE_LONG_FILE_NAMES 1 + +/* Define to 1 if you have the `malloc_debug' function. */ +#cmakedefine HAVE_MALLOC_DEBUG @HAVE_MALLOC_DEBUG@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MALLOC_H @HAVE_MALLOC_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MATH_H @HAVE_MATH_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CMATH @HAVE_CMATH@ + +/* Define to 1 if you have the `mbstowcs' function. */ +#cmakedefine HAVE_MBSTOWCS @HAVE_MBSTOWCS@ + +/* Define to 1 if you have the `memcmp' function. */ +#cmakedefine HAVE_MEMCMP @HAVE_MEMCMP@ + +/* Define to 1 if you have the `memcpy' function. */ +#cmakedefine HAVE_MEMCPY @HAVE_MEMCPY@ + +/* Define to 1 if you have the `memmove' function. */ +#cmakedefine HAVE_MEMMOVE @HAVE_MEMMOVE@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H @HAVE_MEMORY_H@ + +/* Define to 1 if you have the `memset' function. */ +#cmakedefine HAVE_MEMSET @HAVE_MEMSET@ + +/* Define to 1 if you have the `mkstemp' function. */ +#cmakedefine HAVE_MKSTEMP @HAVE_MKSTEMP@ + +/* Define to 1 if you have the `mktemp' function. */ +#cmakedefine HAVE_MKTEMP @HAVE_MKTEMP@ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#cmakedefine HAVE_NDIR_H @HAVE_NDIR_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETDB_H @HAVE_NETDB_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETINET_IN_H @HAVE_NETINET_IN_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETINET_IN_SYSTM_H @HAVE_NETINET_IN_SYSTM_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETINET_TCP_H @HAVE_NETINET_TCP_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NEW_H @HAVE_NEW_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FENV_H @HAVE_FENV_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SYSTEMINFO_H @HAVE_SYS_SYSTEMINFO_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ITERATOR_HEADER @HAVE_ITERATOR_HEADER@ + +/* Define to 1 if you have readdir_r */ +#cmakedefine HAVE_READDIR_R @HAVE_READDIR_R@ + +/* Define if your system supports readdir_r with the obsolete Posix 1.c draft + 6 declaration (2 arguments) instead of the Posix 1.c declaration with 3 + arguments. */ +#cmakedefine HAVE_OLD_READDIR_R @HAVE_OLD_READDIR_R@ + +/* Define if your system has a prototype for feenableexcept in fenv.h */ +#cmakedefine HAVE_PROTOTYPE_FEENABLEEXCEPT @HAVE_PROTOTYPE_FEENABLEEXCEPT@ + +/* Define if your system has a prototype for accept in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_ACCEPT @HAVE_PROTOTYPE_ACCEPT@ + +/* Define if your system has a prototype for bind in sys/types.h sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_BIND @HAVE_PROTOTYPE_BIND@ + +/* Define if your system has a prototype for bzero in string.h strings.h + libc.h unistd.h stdlib.h */ +#cmakedefine HAVE_PROTOTYPE_BZERO @HAVE_PROTOTYPE_BZERO@ + +/* Define if your system has a prototype for connect in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_CONNECT @HAVE_PROTOTYPE_CONNECT@ + +/* Define if your system has a prototype for finite in math.h */ +#cmakedefine HAVE_PROTOTYPE_FINITE @HAVE_PROTOTYPE_FINITE@ + +/* Define to 1 if your has a prototype for `TryAcquireSRWLockShared' in windows.h (Win32 only). */ +#cmakedefine HAVE_PROTOTYPE_TRYACQUIRESRWLOCKSHARED @HAVE_PROTOTYPE_TRYACQUIRESRWLOCKSHARED@ + +/* Define if your system has a prototype for std::finite in cmath */ +#cmakedefine HAVE_PROTOTYPE_STD__FINITE @HAVE_PROTOTYPE_STD__FINITE@ + +/* Define if your system has a prototype for flock in sys/file.h */ +#cmakedefine HAVE_PROTOTYPE_FLOCK @HAVE_PROTOTYPE_FLOCK@ + +/* Define if your system has a prototype for gethostbyname in libc.h unistd.h + stdlib.h netdb.h */ +#cmakedefine HAVE_PROTOTYPE_GETHOSTBYNAME @HAVE_PROTOTYPE_GETHOSTBYNAME@ + +/* Define if your system has a prototype for gethostbyname_r in libc.h unistd.h + stdlib.h netdb.h */ +#cmakedefine HAVE_PROTOTYPE_GETHOSTBYNAME_R @HAVE_PROTOTYPE_GETHOSTBYNAME_R@ + +/* Define if your system has a prototype for gethostbyaddr_r in libc.h unistd.h + stdlib.h netdb.h */ +#cmakedefine HAVE_PROTOTYPE_GETHOSTBYADDR_R @HAVE_PROTOTYPE_GETHOSTBYADDR_R@ + +/* Define if your system has a prototype for gethostid in libc.h unistd.h + stdlib.h netdb.h */ +#cmakedefine HAVE_PROTOTYPE_GETHOSTID @HAVE_PROTOTYPE_GETHOSTID@ + +/* Define if your system has a prototype for gethostname in unistd.h libc.h + stdlib.h netdb.h */ +#cmakedefine HAVE_PROTOTYPE_GETHOSTNAME @HAVE_PROTOTYPE_GETHOSTNAME@ + +/* Define if your system has a prototype for getsockname in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_GETSOCKNAME @HAVE_PROTOTYPE_GETSOCKNAME@ + +/* Define if your system has a prototype for getsockopt in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_GETSOCKOPT @HAVE_PROTOTYPE_GETSOCKOPT@ + +/* Define if your system has a prototype for gettimeofday in sys/time.h + unistd.h */ +#cmakedefine HAVE_PROTOTYPE_GETTIMEOFDAY @HAVE_PROTOTYPE_GETTIMEOFDAY@ + +/* Define if your system has a prototype for isinf in math.h */ +#cmakedefine HAVE_PROTOTYPE_ISINF @HAVE_PROTOTYPE_ISINF@ + +/* Define if your system has a prototype for isnan in math.h */ +#cmakedefine HAVE_PROTOTYPE_ISNAN @HAVE_PROTOTYPE_ISNAN@ + +/* Define if your system has a prototype for std::isinf in cmath */ +#cmakedefine HAVE_PROTOTYPE_STD__ISINF @HAVE_PROTOTYPE_STD__ISINF@ + +/* Define if your system has a prototype for std::isnan in cmath */ +#cmakedefine HAVE_PROTOTYPE_STD__ISNAN @HAVE_PROTOTYPE_STD__ISNAN@ + +/* Define if your system has a prototype for fpclassf in math.h */ +#cmakedefine HAVE_PROTOTYPE__FPCLASSF @HAVE_PROTOTYPE__FPCLASSF@ + +/* Define if your system has a prototype for listen in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_LISTEN @HAVE_PROTOTYPE_LISTEN@ + +/* Define if your system has a prototype for mkstemp in libc.h unistd.h + stdlib.h */ +#cmakedefine HAVE_PROTOTYPE_MKSTEMP @HAVE_PROTOTYPE_MKSTEMP@ + +/* Define if your system has a prototype for mktemp in libc.h unistd.h + stdlib.h */ +#cmakedefine HAVE_PROTOTYPE_MKTEMP @HAVE_PROTOTYPE_MKTEMP@ + +/* Define if your system has a prototype for select in sys/select.h + sys/types.h sys/socket.h sys/time.h */ +#cmakedefine HAVE_PROTOTYPE_SELECT @HAVE_PROTOTYPE_SELECT@ + +/* Define if your system has a prototype for setsockopt in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_SETSOCKOPT @HAVE_PROTOTYPE_SETSOCKOPT@ + +/* Define if your system has a prototype for socket in sys/types.h + sys/socket.h */ +#cmakedefine HAVE_PROTOTYPE_SOCKET @HAVE_PROTOTYPE_SOCKET@ + +/* Define if your system has a prototype for std::vfprintf in stdarg.h */ +#cmakedefine HAVE_PROTOTYPE_STD__VFPRINTF @HAVE_PROTOTYPE_STD__VFPRINTF@ + +/* Define if your system has a prototype for std::vsnprintf in stdio.h */ +#cmakedefine HAVE_PROTOTYPE_STD__VSNPRINTF @HAVE_PROTOTYPE_STD__VSNPRINTF@ + +/* Define if your system has a prototype for strcasecmp in string.h */ +#cmakedefine HAVE_PROTOTYPE_STRCASECMP @HAVE_PROTOTYPE_STRCASECMP@ + +/* Define if your system has a prototype for strncasecmp in string.h */ +#cmakedefine HAVE_PROTOTYPE_STRNCASECMP @HAVE_PROTOTYPE_STRNCASECMP@ + +/* Define if your system has a prototype for strerror_r in string.h */ +#cmakedefine HAVE_PROTOTYPE_STRERROR_R @HAVE_PROTOTYPE_STRERROR_R@ + +/* Define if your system has a prototype for gettid */ +#cmakedefine HAVE_SYS_GETTID @HAVE_SYS_GETTID@ + +/* Define if your system has a prototype for usleep in libc.h unistd.h + stdlib.h */ +#cmakedefine HAVE_PROTOTYPE_USLEEP @HAVE_PROTOTYPE_USLEEP@ + +/* Define if your system has a prototype for wait3 in libc.h sys/wait.h + sys/time.h sys/resource.h */ +#cmakedefine HAVE_PROTOTYPE_WAIT3 @HAVE_PROTOTYPE_WAIT3@ + +/* Define if your system has a prototype for waitpid in sys/wait.h sys/time.h + sys/resource.h */ +#cmakedefine HAVE_PROTOTYPE_WAITPID @HAVE_PROTOTYPE_WAITPID@ + +/* Define if your system has a prototype for _stricmp in string.h */ +#cmakedefine HAVE_PROTOTYPE__STRICMP @HAVE_PROTOTYPE__STRICMP@ + +/* Define if your system has a prototype for nanosleep in time.h */ +#cmakedefine HAVE_PROTOTYPE_NANOSLEEP @HAVE_PROTOTYPE_NANOSLEEP@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_PTHREAD_H @HAVE_PTHREAD_H@ + +/* Define if your system supports POSIX read/write locks */ +#cmakedefine HAVE_PTHREAD_RWLOCK @HAVE_PTHREAD_RWLOCK@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_PWD_H @HAVE_PWD_H@ + +/* define if the compiler supports reinterpret_cast<> */ +#define HAVE_REINTERPRET_CAST 1 + +/* Define to 1 if you have the `rindex' function. */ +#cmakedefine HAVE_RINDEX @HAVE_RINDEX@ + +/* Define to 1 if you have the `select' function. */ +#cmakedefine HAVE_SELECT @HAVE_SELECT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SEMAPHORE_H @HAVE_SEMAPHORE_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SETJMP_H @HAVE_SETJMP_H@ + +/* Define to 1 if you have the `setsockopt' function. */ +#cmakedefine HAVE_SETSOCKOPT @HAVE_SETSOCKOPT@ + +/* Define to 1 if you have the `setuid' function. */ +#cmakedefine HAVE_SETUID @HAVE_SETUID@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SIGNAL_H @HAVE_SIGNAL_H@ + +/* Define to 1 if you have the `sleep' function. */ +#cmakedefine HAVE_SLEEP @HAVE_SLEEP@ + +/* Define to 1 if you have the `socket' function. */ +#cmakedefine HAVE_SOCKET @HAVE_SOCKET@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SSTREAM @HAVE_SSTREAM@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SSTREAM_H @HAVE_SSTREAM_H@ + +/* Define to 1 if you have the `stat' function. */ +#cmakedefine HAVE_STAT @HAVE_STAT@ + +/* define if the compiler supports static_cast<> */ +#define HAVE_STATIC_CAST 1 + +/* Define if your C++ compiler can work with static methods in class templates + */ +#define HAVE_STATIC_TEMPLATE_METHOD 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STAT_H @HAVE_STAT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDARG_H @HAVE_STDARG_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDBOOL_H @HAVE_STDBOOL_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CSTDARG @HAVE_CSTDARG@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CSTDINT @HAVE_CSTDINT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDIO_H @HAVE_STDIO_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CSTDIO @HAVE_CSTDIO@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@ + +/* Define if ANSI standard C++ includes use std namespace */ +/* defined below */ + +/* Define if the compiler supports std::nothrow */ +/* defined below */ + +/* Define to 1 if you have the `strchr' function. */ +#cmakedefine HAVE_STRCHR @HAVE_STRCHR@ + +/* Define to 1 if you have the `strdup' function. */ +#cmakedefine HAVE_STRDUP @HAVE_STRDUP@ + +/* Define to 1 if you have the `strerror' function. */ +#cmakedefine HAVE_STRERROR @HAVE_STRERROR@ + +/* Define to 1 if `strerror_r' returns a char*. */ +#cmakedefine HAVE_CHARP_STRERROR_R @HAVE_CHARP_STRERROR_R@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STREAMBUF_H @HAVE_STREAMBUF_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H @HAVE_STRINGS_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H @HAVE_STRING_H@ + +/* Define to 1 if you have the `strlcat' function. */ +#cmakedefine HAVE_STRLCAT @HAVE_STRLCAT@ + +/* Define to 1 if you have the `strlcpy' function. */ +#cmakedefine HAVE_STRLCPY @HAVE_STRLCPY@ + +/* Define to 1 if you have the `strstr' function. */ +#cmakedefine HAVE_STRSTR @HAVE_STRSTR@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRSTREAM @HAVE_STRSTREAM@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRSTREAM_H @HAVE_STRSTREAM_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRSTREA_H @HAVE_STRSTREA_H@ + +/* Define to 1 if you have the `strtoul' function. */ +#cmakedefine HAVE_STRTOUL @HAVE_STRTOUL@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYNCH_H @HAVE_SYNCH_H@ + +/* Define if __sync_add_and_fetch is available */ +#cmakedefine HAVE_SYNC_ADD_AND_FETCH @HAVE_SYNC_ADD_AND_FETCH@ + +/* Define if __sync_sub_and_fetch is available */ +#cmakedefine HAVE_SYNC_SUB_AND_FETCH @HAVE_SYNC_SUB_AND_FETCH@ + +/* Define if InterlockedIncrement is available */ +#cmakedefine HAVE_INTERLOCKED_INCREMENT @HAVE_INTERLOCKED_INCREMENT@ + +/* Define if InterlockedDecrement is available */ +#cmakedefine HAVE_INTERLOCKED_DECREMENT @HAVE_INTERLOCKED_DECREMENT@ + +/* Define if passwd::pw_gecos is available */ +#cmakedefine HAVE_PASSWD_GECOS @HAVE_PASSWD_GECOS@ + +/* Define to 1 if you have the `sysinfo' function. */ +#cmakedefine HAVE_SYSINFO @HAVE_SYSINFO@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYSLOG_H @HAVE_SYSLOG_H@ + +/* Define to 1 if you have the header file, and it defines `DIR'.*/ +#cmakedefine HAVE_SYS_DIR_H @HAVE_SYS_DIR_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_ERRNO_H @HAVE_SYS_ERRNO_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_FILE_H @HAVE_SYS_FILE_H@ + +/* Define to 1 if you have the header file, and it defines `DIR'.*/ +#cmakedefine HAVE_SYS_NDIR_H @HAVE_SYS_NDIR_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_PARAM_H @HAVE_SYS_PARAM_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_RESOURCE_H @HAVE_SYS_RESOURCE_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SELECT_H @HAVE_SYS_SELECT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SOCKET_H @HAVE_SYS_SOCKET_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SYSCALL_H @HAVE_SYS_SYSCALL_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIMEB_H @HAVE_SYS_TIMEB_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIME_H @HAVE_SYS_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_UTIME_H @HAVE_SYS_UTIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_UTSNAME_H @HAVE_SYS_UTSNAME_H@ + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#cmakedefine HAVE_SYS_WAIT_H @HAVE_SYS_WAIT_H@ + +/* Define to 1 if you have the `tempnam' function. */ +#cmakedefine HAVE_TEMPNAM @HAVE_TEMPNAM@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_THREAD_H @HAVE_THREAD_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_TIME_H @HAVE_TIME_H@ + +/* Define to 1 if you have the `tmpnam' function. */ +#cmakedefine HAVE_TMPNAM @HAVE_TMPNAM@ + +/* define if the compiler recognizes typename */ +#cmakedefine HAVE_TYPENAME @HAVE_TYPENAME@ + +/* Define to 1 if you have the `uname' function. */ +#cmakedefine HAVE_UNAME @HAVE_UNAME@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNIX_H @HAVE_UNIX_H@ + +/* Define to 1 if you have the `usleep' function. */ +#cmakedefine HAVE_USLEEP @HAVE_USLEEP@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UTIME_H @HAVE_UTIME_H@ + +/* Define to 1 if you have the `vprintf' function. */ +#cmakedefine HAVE_VPRINTF @HAVE_VPRINTF@ + +/* Define to 1 if you have the `_vsnprintf_s' function. */ +#cmakedefine HAVE__VSNPRINTF_S @HAVE__VSNPRINTF_S@ + +/* Define to 1 if you have the `vfprintf_s' function. */ +#cmakedefine HAVE_VFPRINTF_S @HAVE_VFPRINTF_S@ + +/* Define to 1 if you have the `vsnprintf' function. */ +#cmakedefine HAVE_VSNPRINTF @HAVE_VSNPRINTF@ + +/* Define to 1 if you have the `vsprintf_s' function. */ +#cmakedefine HAVE_VSPRINTF_S @HAVE_VSPRINTF_S@ + +/* Define to 1 if you have the `wait3' function. */ +#cmakedefine HAVE_WAIT3 @HAVE_WAIT3@ + +/* Define to 1 if you have the `waitpid' function. */ +#cmakedefine HAVE_WAITPID @HAVE_WAITPID@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_WCHAR_H @HAVE_WCHAR_H@ + +/* Define to 1 if you have the `wcstombs' function. */ +#cmakedefine HAVE_WCSTOMBS @HAVE_WCSTOMBS@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_WCTYPE_H @HAVE_WCTYPE_H@ + +/* Define to 1 if you have the `_findfirst' function. */ +#cmakedefine HAVE__FINDFIRST @HAVE__FINDFIRST@ + +/* Define to 1 if the compiler supports __FUNCTION__. */ +#cmakedefine HAVE___FUNCTION___MACRO @HAVE___FUNCTION___MACRO@ + +/* Define to 1 if the compiler supports __PRETTY_FUNCTION__. */ +#cmakedefine HAVE___PRETTY_FUNCTION___MACRO @HAVE___PRETTY_FUNCTION___MACRO@ + +/* Define to 1 if the compiler supports __func__. */ +#cmakedefine HAVE___func___MACRO @HAVE___func___MACRO@ + +/* Define to 1 if you have the `nanosleep' function. */ +#cmakedefine HAVE_NANOSLEEP @HAVE_NANOSLEEP@ + +/* Define if libc.h should be treated as a C++ header */ +#cmakedefine INCLUDE_LIBC_H_AS_CXX @INCLUDE_LIBC_H_AS_CXX@ + +/* Define if fails if included extern "C" */ +#cmakedefine INCLUDE_MATH_H_AS_CXX @INCLUDE_MATH_H_AS_CXX@ + +/* Define to 1 if you have variable length arrays. */ +#cmakedefine HAVE_VLA @HAVE_VLA@ + +/* Define to the address where bug reports for this package should be sent. */ +/* #undef PACKAGE_BUGREPORT */ + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@DCMTK_PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@DCMTK_PACKAGE_STRING@" + +/* Define to the default configuration directory (used by some applications) */ +#define DEFAULT_CONFIGURATION_DIR "@DCMTK_DEFAULT_CONFIGURATION_DIR@" + +/* Define to the default support data directory (used by some applications) */ +#define DEFAULT_SUPPORT_DATA_DIR "@DCMTK_DEFAULT_SUPPORT_DATA_DIR@" + +/* Define to the one symbol short name of this package. */ +/* #undef PACKAGE_TARNAME */ + +/* Define to the date of this package. */ +#define PACKAGE_DATE "@DCMTK_PACKAGE_DATE@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@DCMTK_PACKAGE_VERSION@" + +/* Define to the version suffix of this package. */ +#define PACKAGE_VERSION_SUFFIX "@DCMTK_PACKAGE_VERSION_SUFFIX@" + +/* Define to the version number of this package. */ +#define PACKAGE_VERSION_NUMBER @DCMTK_PACKAGE_VERSION_NUMBER@ + +/* Define path separator */ +#define PATH_SEPARATOR '@PATH_SEPARATOR@' + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define if signal handlers need ellipse (...) parameters */ +/* #undef SIGNAL_HANDLER_WITH_ELLIPSE */ + +/* LFS mode constants. */ +#define DCMTK_LFS 1 +#define DCMTK_LFS64 2 + +/* Select LFS mode (defined above) that shall be used or don't define it */ +#cmakedefine DCMTK_ENABLE_LFS @DCMTK_LFS_MODE@ + +/* The size of a `char', as computed by sizeof. */ +#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ + +/* The size of a `double', as computed by sizeof. */ +#cmakedefine SIZEOF_DOUBLE @SIZEOF_DOUBLE@ + +/* The size of a `float', as computed by sizeof. */ +#cmakedefine SIZEOF_FLOAT @SIZEOF_FLOAT@ + +/* The size of a `int', as computed by sizeof. */ +#cmakedefine SIZEOF_INT @SIZEOF_INT@ + +/* The size of a `long', as computed by sizeof. */ +#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ + +/* The size of a `short', as computed by sizeof. */ +#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ + +/* The size of a `void *', as computed by sizeof. */ +#cmakedefine SIZEOF_VOID_P @SIZEOF_VOID_P@ + +/* The size of a `fpos_t', as computed by sizeof. */ +#cmakedefine SIZEOF_FPOS_T @SIZEOF_FPOS_T@ + +/* The size of a `off_t', as computed by sizeof. */ +#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define if ANSI standard C++ includes are used */ +#cmakedefine USE_STD_CXX_INCLUDES + +/* Define if we are compiling with libiconv support. */ +#cmakedefine WITH_LIBICONV + +/* Define if the C standard library has iconv builtin. */ +#cmakedefine WITH_STDLIBC_ICONV + +/* Define if we are compiling with ICU support. */ +#cmakedefine WITH_ICU + +/* character set conversion constants. */ +#define DCMTK_CHARSET_CONVERSION_ICU 1 +#define DCMTK_CHARSET_CONVERSION_ICONV 2 +#define DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV 3 + +/* Define to select character set conversion implementation. */ +#cmakedefine DCMTK_ENABLE_CHARSET_CONVERSION @DCMTK_ENABLE_CHARSET_CONVERSION@ + +/* Define if the second argument to iconv() is const */ +#cmakedefine LIBICONV_SECOND_ARGUMENT_CONST @LIBICONV_SECOND_ARGUMENT_CONST@ + +/* Try to define the iconv behavior as conversion flags */ +#cmakedefine DCMTK_FIXED_ICONV_CONVERSION_FLAGS @DCMTK_FIXED_ICONV_CONVERSION_FLAGS@ + +/* Define if iconv_open() accepts "" as an argument */ +#cmakedefine DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING @DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING@ + +/* Define if we are compiling with libpng support */ +#cmakedefine WITH_LIBPNG + +/* Define if we are compiling with libtiff support */ +#cmakedefine WITH_LIBTIFF + +/* Define if we are compiling with libxml support */ +#cmakedefine WITH_LIBXML + +/* Define if we are compiling with OpenJPEG support */ +#cmakedefine WITH_OPENJPEG + +/* Define if we are compiling with OpenSSL support */ +#cmakedefine WITH_OPENSSL + +/* Define if we are compiling for built-in private tag dictionary */ +#cmakedefine ENABLE_PRIVATE_TAGS + +/* Define if we are compiling with sndfile support. */ +#cmakedefine WITH_SNDFILE + +/* Define if we are compiling with libwrap (TCP wrapper) support */ +#cmakedefine WITH_TCPWRAPPER + +/* Define if we are compiling with zlib support */ +#cmakedefine WITH_ZLIB + +/* Define if we are compiling with any type of Multi-thread support */ +#cmakedefine WITH_THREADS + +/* Define if pthread_t is a pointer type on your system */ +#cmakedefine HAVE_POINTER_TYPE_PTHREAD_T @HAVE_POINTER_TYPE_PTHREAD_T@ + +/* Define to 1 if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +/* #undef _ALL_SOURCE */ +#endif + +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +/* #undef __CHAR_UNSIGNED__ */ +#endif + +/* Define `pid_t' to `int' if does not define. */ +#cmakedefine HAVE_NO_TYPEDEF_PID_T +#ifdef HAVE_NO_TYPEDEF_PID_T +#define pid_t int +#endif + +/* Define `size_t' to `unsigned' if does not define. */ +#cmakedefine HAVE_NO_TYPEDEF_SIZE_T +#ifdef HAVE_NO_TYPEDEF_SIZE_T +#define size_t unsigned +#endif + +/* Define `ssize_t' to `long' if does not define. */ +#cmakedefine HAVE_NO_TYPEDEF_SSIZE_T +#ifdef HAVE_NO_TYPEDEF_SSIZE_T +#define ssize_t long +#endif + +/* Set typedefs as needed for JasPer library */ +#cmakedefine HAVE_UCHAR_TYPEDEF +#ifndef HAVE_UCHAR_TYPEDEF +typedef unsigned char uchar; +#endif + +#cmakedefine HAVE_USHORT_TYPEDEF +#ifndef HAVE_USHORT_TYPEDEF +typedef unsigned short ushort; +#endif + +#cmakedefine HAVE_UINT_TYPEDEF +#ifndef HAVE_UINT_TYPEDEF +typedef unsigned int uint; +#endif + +#cmakedefine HAVE_ULONG_TYPEDEF +#ifndef HAVE_ULONG_TYPEDEF +typedef unsigned long ulong; +#endif + +#cmakedefine HAVE_LONG_LONG +#cmakedefine HAVE_UNSIGNED_LONG_LONG + +/* evaluated by JasPer */ +#cmakedefine HAVE_LONGLONG +#cmakedefine HAVE_ULONGLONG + +#cmakedefine HAVE_INT64_T @HAVE_INT64_T@ +#cmakedefine HAVE_UINT64_T @HAVE_UINT64_T@ + + /* Additional settings for Borland C++ Builder */ +#ifdef __BORLANDC__ +#define _stricmp stricmp /* _stricmp in MSVC is stricmp in Borland C++ */ +#define _strnicmp strnicmp /* _strnicmp in MSVC is strnicmp in Borland C++ */ + #pragma warn -8027 /* disable Warning W8027 "functions containing while are not expanded inline" */ + #pragma warn -8004 /* disable Warning W8004 "variable is assigned a value that is never used" */ + #pragma warn -8012 /* disable Warning W8012 "comparing signed and unsigned values" */ +#ifdef WITH_THREADS +#define __MT__ /* required for _beginthreadex() API in */ +#define _MT /* required for _errno on BCB6 */ +#endif +#define HAVE_PROTOTYPE_MKTEMP 1 +#undef HAVE_SYS_UTIME_H +#define _MSC_VER 1200 /* Treat Borland C++ 5.5 as MSVC6. */ +#endif /* __BORLANDC__ */ + +/* Platform specific settings for Visual C++ + * By default, enable ANSI standard C++ includes on Visual C++ 6 and newer + * _MSC_VER == 1100 on Microsoft Visual C++ 5.0 + * _MSC_VER == 1200 on Microsoft Visual C++ 6.0 + * _MSC_VER == 1300 on Microsoft Visual C++ 7.0 + * _MSC_VER == 1310 on Microsoft Visual C++ 7.1 + * _MSC_VER == 1400 on Microsoft Visual C++ 8.0 + */ + +#ifdef _MSC_VER +#if _MSC_VER <= 1200 /* Additional settings for VC6 and older */ +/* disable warning that return type for 'identifier::operator ->' is not a UDT or reference to a UDT */ + #pragma warning( disable : 4284 ) +#define HAVE_OLD_INTERLOCKEDCOMPAREEXCHANGE 1 +#else +#define HAVE_VSNPRINTF 1 +#endif /* _MSC_VER <= 1200 */ + + #pragma warning( disable : 4251 ) /* disable warnings about needed dll-interface */ + /* http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html */ + #pragma warning( disable : 4099 ) /* disable warning about mismatched class and struct keywords */ + /* http://alfps.wordpress.com/2010/06/22/cppx-is-c4099-really-a-sillywarning-disabling-msvc-sillywarnings */ + #pragma warning( disable : 4521 ) /* disable warnings about multiple copy constructors and assignment operators,*/ + #pragma warning( disable : 4522 ) /* since these are sometimes necessary for correct overload resolution*/ + +#if _MSC_VER >= 1400 /* Additional settings for Visual Studio 2005 and newer */ + #pragma warning( disable : 4996 ) /* disable warnings about "deprecated" C runtime functions */ + #pragma warning( disable : 4351 ) /* disable warnings about "new behavior" when initializing the elements of an array */ +#endif /* _MSC_VER >= 1400 */ +#endif /* _MSC_VER */ + +/* Define if your system defines ios::nocreate in iostream.h */ +#cmakedefine HAVE_IOS_NOCREATE @HAVE_IOS_NOCREATE@ + +/* Define if ANSI standard C++ includes use std namespace */ +#cmakedefine HAVE_STD_NAMESPACE @HAVE_STD_NAMESPACE@ + +/* Define if the compiler supports std::nothrow */ +#cmakedefine HAVE_STD__NOTHROW @HAVE_STD__NOTHROW@ + +/* Define if the compiler supports operator delete (std::nothrow) */ +#cmakedefine HAVE_NOTHROW_DELETE @HAVE_NOTHROW_DELETE@ + +/* Define if the compiler supports static_assert */ +#cmakedefine HAVE_STATIC_ASSERT @HAVE_STATIC_ASSERT@ + +/* Define if your system has a prototype for std::vfprintf in stdarg.h */ +#cmakedefine HAVE_PROTOTYPE_STD__VFPRINTF @HAVE_PROTOTYPE_STD__VFPRINTF@ + +/* Define if your system has off64_t */ +#cmakedefine HAVE_OFF64_T @HAVE_OFF64_T@ + +/* Define if your system has fpos64_t */ +#cmakedefine HAVE_FPOS64_T @HAVE_FPOS64_T@ + +/* Define if your system uses _popen instead of popen */ +#cmakedefine HAVE_POPEN @HAVE_POPEN@ + +/* Define if your system uses _pclose instead of pclose */ +#cmakedefine HAVE_PCLOSE @HAVE_PCLOSE@ + +/* Define if your system provides sigjmp_buf as conditional jmp_buf alternative */ +#cmakedefine HAVE_SIGJMP_BUF @HAVE_SIGJMP_BUF@ + +/* Define if your OpenSSL library provides the SSL_CTX_GET0_PARAM function */ +#cmakedefine HAVE_SSL_CTX_GET0_PARAM @HAVE_SSL_CTX_GET0_PARAM@ + +/* Define if your OpenSSL library provides the RAND_egd function */ +#cmakedefine HAVE_RAND_EGD @HAVE_RAND_EGD@ + +/* Always define STDIO_NAMESPACE to ::, because MSVC6 gets mad if you don't. */ +#define STDIO_NAMESPACE :: + +/* Define if we can use C++11 */ +#cmakedefine HAVE_CXX11 @HAVE_CXX11@ + +#if defined(HAVE_CXX11) && defined(__cplusplus) && __cplusplus < 201103L +#error\ +DCMTK was configured to use C++11 features, but your compiler does not or was not configured to provide them. +#endif + +/* Define if we can use C++14 */ +#cmakedefine HAVE_CXX14 @HAVE_CXX14@ + +#if defined(HAVE_CXX14) && defined(__cplusplus) && __cplusplus < 201402L +#error\ +DCMTK was configured to use C++14 features, but your compiler does not or was not configured to provide them. +#endif + +/* Define if we can use C++17 */ +#cmakedefine HAVE_CXX17 @HAVE_CXX17@ + +#if defined(HAVE_CXX17) && defined(__cplusplus) && __cplusplus < 201703L +#error\ +DCMTK was configured to use C++17 features, but your compiler does not or was not configured to provide them. +#endif + +/* Define if the compiler supports __alignof__ */ +#cmakedefine HAVE_GNU_ALIGNOF @HAVE_GNU_ALIGNOF@ + +/* Define if the compiler supports __alignof */ +#cmakedefine HAVE_MS_ALIGNOF @HAVE_MS_ALIGNOF@ + +/* Define if the compiler supports __attribute__((aligned)) */ +#cmakedefine HAVE_ATTRIBUTE_ALIGNED @HAVE_ATTRIBUTE_ALIGNED@ + +/* Define if __attribute__((aligned)) supports templates */ +#cmakedefine ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES @ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES@ + +/* Define if the compiler supports __declspec(align) */ +#cmakedefine HAVE_DECLSPEC_ALIGN @HAVE_DECLSPEC_ALIGN@ + +/* Define if the compiler supports default constructor detection via SFINAE */ +#cmakedefine HAVE_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE @HAVE_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE@ + +/* Define if we are cross compiling */ +#cmakedefine DCMTK_CROSS_COMPILING @DCMTK_CROSS_COMPILING@ + +/* The path on the Android device that should be used for temporary files */ +#cmakedefine ANDROID_TEMPORARY_FILES_LOCATION "@ANDROID_TEMPORARY_FILES_LOCATION@" + +/* Define if we are supposed to use STL's vector */ +#cmakedefine HAVE_STL_VECTOR @HAVE_STL_VECTOR@ + +/* Define if we are supposed to use STL's algorithms */ +#cmakedefine HAVE_STL_ALGORITHM @HAVE_STL_ALGORITHM@ + +/* Define if we are supposed to use STL's limit */ +#cmakedefine HAVE_STL_LIMITS @HAVE_STL_LIMITS@ + +/* Define if we are supposed to use STL's list */ +#cmakedefine HAVE_STL_LIST @HAVE_STL_LIST@ + +/* Define if we are supposed to use STL's list */ +#cmakedefine HAVE_STL_MAP @HAVE_STL_MAP@ + +/* Define if we are supposed to use STL's memory */ +#cmakedefine HAVE_STL_MEMORY @HAVE_STL_MEMORY@ + +/* Define if we are supposed to use STL's stack */ +#cmakedefine HAVE_STL_STACK @HAVE_STL_STACK@ + +/* Define if we are supposed to use STL's string */ +#cmakedefine HAVE_STL_STRING @HAVE_STL_STRING@ + +/* Define if we are supposed to use STL's type_traits */ +#cmakedefine HAVE_STL_TYPE_TRAITS @HAVE_STL_TYPE_TRAITS@ + +/* Define if we are supposed to use STL's tuple */ +#cmakedefine HAVE_STL_TUPLE @HAVE_STL_TUPLE@ + +/* Define if we are supposed to use STL's system_error */ +#cmakedefine HAVE_STL_SYSTEM_ERROR @HAVE_STL_SYSTEM_ERROR@ + +/* Define if the input iterator category is supported */ +#cmakedefine HAVE_INPUT_ITERATOR_CATEGORY @HAVE_INPUT_ITERATOR_CATEGORY@ + +/* Define if the input iterator category is supported */ +#cmakedefine HAVE_OUTPUT_ITERATOR_CATEGORY @HAVE_OUTPUT_ITERATOR_CATEGORY@ + +/* Define if the input iterator category is supported */ +#cmakedefine HAVE_FORWARD_ITERATOR_CATEGORY @HAVE_FORWARD_ITERATOR_CATEGORY@ + +/* Define if the input iterator category is supported */ +#cmakedefine HAVE_BIDIRECTIONAL_ITERATOR_CATEGORY @HAVE_BIDIRECTIONAL_ITERATOR_CATEGORY@ + +/* Define if the input iterator category is supported */ +#cmakedefine HAVE_RANDOM_ACCESS_ITERATOR_CATEGORY @HAVE_RANDOM_ACCESS_ITERATOR_CATEGORY@ + +/* Define if the input iterator category is supported */ +#cmakedefine HAVE_CONTIGUOUS_ITERATOR_CATEGORY @HAVE_CONTIGUOUS_ITERATOR_CATEGORY@ + +#endif /* !OSCONFIG_H*/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..a042e7a5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,197 @@ +# Minimum CMake version required +cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) + +# As of 2018-12-26 DCMTK has been validated to build with CMake 3.13.2 policies. +set(DCMTK_MAX_CMAKE_POLICY_VERSION 3.13.2) + +# Set and use the newest CMake policies that are validated to work +# (VERSION_LESS comparison is only defined for CMake 3 and newer) +if(CMAKE_MAJOR_VERSION LESS 3) + set(DCMTK_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") +elseif(CMAKE_VERSION VERSION_LESS DCMTK_MAX_CMAKE_POLICY_VERSION) + set(DCMTK_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") +else() + set(DCMTK_CMAKE_POLICY_VERSION "${DCMTK_MAX_CMAKE_POLICY_VERSION}") +endif() +cmake_policy(VERSION "${DCMTK_CMAKE_POLICY_VERSION}") + +# Declare project +project(DCMTK) + +# Check the build system +include(CMake/dcmtkPrepare.cmake NO_POLICY_SCOPE) + +#----------------------------------------------------------------------------- +# General project settings to configure DCMTK build process +#----------------------------------------------------------------------------- + +# Modules to be built + +set(DCMTK_MODULES ofstd oflog dcmdata dcmimgle + dcmimage dcmjpeg dcmjpls dcmtls dcmnet dcmsr + dcmsign dcmwlm dcmqrdb dcmpstat dcmrt dcmiod dcmfg dcmseg dcmtract dcmpmap + CACHE STRING "List of modules that should be built.") + +#----------------------------------------------------------------------------- +# Include directories +#----------------------------------------------------------------------------- + +set(DCMTK_INCLUDE_DIR "${DCMTK_BINARY_DIR}/config/include") +foreach(inc ${DCMTK_MODULES}) + list(APPEND DCMTK_INCLUDE_DIR "${DCMTK_SOURCE_DIR}/${inc}/include") +endforeach() + +include_directories(${DCMTK_INCLUDE_DIR}) + +#----------------------------------------------------------------------------- +# Prepare osconfig.h +#----------------------------------------------------------------------------- + +# add the osconfig.h.in file +configure_file("${DCMTK_SOURCE_DIR}/CMake/osconfig.h.in" + "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/osconfig.h") + +#----------------------------------------------------------------------------- +# Prepare arith.h +#----------------------------------------------------------------------------- + +INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() + +# ---------------------------------------------------------------------------- +# Unit test related configuration/setup +# ---------------------------------------------------------------------------- + +if(CMAKE_CROSSCOMPILING) + if(WIN32) + set(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRunWine.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test as a detached Wine process in the prepared wineprefix") + elseif(ANDROID) + set(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRunAndroid.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test via the android emulator") + else() + message(WARNING "Emulation for your target platform is not available, CTest will not be able to execute the unit tests!") + endif() +else() + set(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRun.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test") +endif() +# Add a target to run the unit tests in exhaustive mode +add_custom_target("test-exhaustive" + COMMAND "${CMAKE_COMMAND}" "-DCONFIG=${DCMTK_CONFIG_GENERATOR_EXPRESSION}" "-P" + "${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunExhaustive.cmake" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" +) + +#----------------------------------------------------------------------------- +# Start actual compilation tasks +#----------------------------------------------------------------------------- + +# Recurse into subdirectories +foreach(module config doxygen ${DCMTK_MODULES}) + add_subdirectory(${module}) +endforeach() +include(CMake/dcmtkAfterModules.cmake NO_POLICY_SCOPE) + +#----------------------------------------------------------------------------- +# Installation tasks +#----------------------------------------------------------------------------- + +# Install global headers +install(FILES "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/osconfig.h" + "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/arith.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk/config" + COMPONENT include) + +# Install DCMTK's general documentation files +install(FILES ANNOUNCE CHANGES COPYRIGHT CREDITS FAQ HISTORY VERSION + DESTINATION "${CMAKE_INSTALL_DOCDIR}" + COMPONENT doc) +install(DIRECTORY docs/ DESTINATION "${CMAKE_INSTALL_DOCDIR}" + COMPONENT doc FILES_MATCHING PATTERN "CHANGES.???") + +#----------------------------------------------------------------------------- +# Create an install configuration files for external projects +#----------------------------------------------------------------------------- +# +# DCMTKTargets.cmake will contain list of executables and libraries produced +# DCMTKConfigVersion.cmake will contain DCMTK version information +# DCMTKConfig.cmake will contain options used to build DCMTK +# +# All three files are created within the build tree's main directory (handled in +# CMake/GenerateCMakeExports.cmake, and are installed to locations (OS-specific +# under the main install dir (handled directly below). + +# Only create fully-fledged CMake export files if we have the related commands +include(CMake/CheckCMakeCommandExists.cmake) +include(CMakePackageConfigHelpers OPTIONAL) +CHECK_CMAKE_COMMAND_EXISTS("CONFIGURE_PACKAGE_CONFIG_FILE") +CHECK_CMAKE_COMMAND_EXISTS("WRITE_BASIC_PACKAGE_VERSION_FILE") + +if(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE) + + # Create and configure CMake export files + include(CMake/GenerateCMakeExports.cmake) + + # ${DCMTK_INSTALL_CONFIG} and ${DCMTK_CONFIG_VERSION} are + # defined within CMake/GenerateCMakeExports.cmake. + # Install DCMTKTargets.cmake to install tree + install(EXPORT DCMTKTargets FILE DCMTKTargets.cmake + DESTINATION "${DCMTK_INSTALL_CMKDIR}" COMPONENT cmake) + + # Install DCMTKConfig.cmake and DCMTKConfigVersion.cmake + install(FILES "${DCMTK_INSTALL_CONFIG}" "${DCMTK_CONFIG_VERSION}" + DESTINATION "${DCMTK_INSTALL_CMKDIR}" COMPONENT cmake) + +else() + + # Warning that we use old "configure_file" command + message(STATUS "Warning: Using old configure_file() mechanism to produce DCMTKConfig.cmake") + + # Actually configure file + configure_file("${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.old_cmake.in" + "${DCMTK_BINARY_DIR}/DCMTKConfig.cmake" @ONLY) + + # Install DCMTKConfig.cmake and DCMTKConfigVersion.cmake + install(FILES "${DCMTK_BINARY_DIR}/DCMTKConfig.cmake" "${DCMTK_BINARY_DIR}/DCMTKConfigVersion.cmake" + DESTINATION "${DCMTK_INSTALL_CMKDIR}" + COMPONENT cmake) + +endif() + +#----------------------------------------------------------------------------- +# Configure files needed for running the unit tests and cleanup +#----------------------------------------------------------------------------- + +if(CMAKE_CROSSCOMPILING) + if(WIN32) + string(REPLACE ";" "${ENVIRONMENT_PATH_SEPARATOR}" DCMDICTPATH "${DCMTK_DICOM_DICTIONARIES}") + configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/CTestCustomWine.cmake.in" + "${DCMTK_BINARY_DIR}/CTestCustom.cmake" ESCAPE_QUOTES @ONLY + ) + configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunWine.cmake.in" + "${DCMTK_RUN_CTEST_SCRIPT}" ESCAPE_QUOTES @ONLY + ) + elseif(ANDROID) + DCMTK_ANDROID_STOP_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE) + # Prepare setting environment variable DCMDICTPATH + set(DICTIONARIES ${DCMTK_DICOM_DICTIONARIES}) + list(GET DICTIONARIES 0 DCMDICTPATH) + list(REMOVE_AT DICTIONARIES 0) + get_filename_component(DCMDICTPATH "${DCMDICTPATH}" NAME) + set(DCMDICTPATH "${ANDROID_TEMPORARY_FILES_LOCATION}/${DCMDICTPATH}") + foreach(DICTIONARY ${DICTIONARIES}) + get_filename_component(FILE "${DICTIONARY}" NAME) + set(DCMDICTPATH "${DCMDICTPATH}:${ANDROID_TEMPORARY_FILES_LOCATION}/${FILE}") + endforeach() + configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/CTestCustomAndroid.cmake.in" + "${DCMTK_BINARY_DIR}/CTestCustom.cmake" ESCAPE_QUOTES @ONLY + ) + configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunAndroid.cmake.in" + "${DCMTK_RUN_CTEST_SCRIPT}" ESCAPE_QUOTES @ONLY + ) + else() + # nothing to do + endif() +else() + string(REPLACE ";" "${ENVIRONMENT_PATH_SEPARATOR}" DCMDICTPATH "${DCMTK_DICOM_DICTIONARIES}") + configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRun.cmake.in" + "${DCMTK_RUN_CTEST_SCRIPT}" ESCAPE_QUOTES @ONLY + ) +endif() diff --git a/COPYRIGHT b/COPYRIGHT new file mode 100644 index 00000000..13b996d5 --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1,1006 @@ + +COPYRIGHT + +Unless otherwise specified, the DCMTK software package has the following +copyright: + +/* + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * 26121 Oldenburg, Germany + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of OFFIS nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +Please note that some DCMTK modules, especially those that are not part +of the free toolkit, are covered by a separate license which can be found +in the COPYRIGHT file in the corresponding module directory. + +Some portions of the DCMTK software package are derived from earlier +versions of this software with the following copyright, and can be +identified by the following copyright notice located in each source file: + +/* + * Copyright (C) 1993/1994, OFFIS, Oldenburg University and CERIUM + * + * This software and supporting documentation were + * developed by + * + * Institut OFFIS + * Bereich Kommunikationssysteme + * Westerstr. 10-12 + * 26121 Oldenburg, Germany + * + * Fachbereich Informatik + * Abteilung Prozessinformatik + * Carl von Ossietzky Universitaet Oldenburg + * Ammerlaender Heerstr. 114-118 + * 26111 Oldenburg, Germany + * + * CERIUM + * Laboratoire SIM + * Faculte de Medecine + * 2 Avenue du Pr. Leon Bernard + * 35043 Rennes Cedex, France + * + * for CEN/TC251/WG4 as a contribution to the Radiological + * Society of North America (RSNA) 1993 Digital Imaging and + * Communications in Medicine (DICOM) Demonstration. + * + * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER OFFIS, + * OLDENBURG UNIVERSITY NOR CERIUM MAKE ANY WARRANTY REGARDING + * THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR + * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER + * DISEASES OR ITS CONFORMITY TO ANY SPECIFICATION. THE + * ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF THE SOFTWARE + * IS WITH THE USER. + * + * Copyright of the software and supporting documentation + * is, unless otherwise stated, jointly owned by OFFIS, + * Oldenburg University and CERIUM and free access is hereby + * granted as a license to use this software, copy this + * software and prepare derivative works based upon this + * software. However, any distribution of this software + * source code or supporting documentation or derivative + * works (source code and supporting documentation) must + * include the three paragraphs of this copyright notice. + * + */ + +Some other parts of this software within the dcmtk/dcmnet sub-package +related to the DICOM Upper Layer Protocol are derived from software +developed for the RSNA'93 DICOM demonstration and kindly made available +to us by the Mallinckrodt Institute of Radiology. Such software can be +identified by the following copyright notice located in each affected +source file: + +/* + * Copyright (C) 1993, RSNA and Washington University + * + * The software and supporting documentation for the Radiological + * Society of North America (RSNA) 1993 Digital Imaging and + * Communications in Medicine (DICOM) Demonstration were developed + * at the + * Electronic Radiology Laboratory + * Mallinckrodt Institute of Radiology + * Washington University School of Medicine + * 510 S. Kingshighway Blvd. + * St. Louis, MO 63110 + * as part of the 1993 DICOM Central Test Node project for, and + * under contract with, the Radiological Society of North America. + * + * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER RSNA NOR + * WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS + * PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR + * USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY + * SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF + * THE SOFTWARE IS WITH THE USER. + * + * Copyright of the software and supporting documentation is + * jointly owned by RSNA and Washington University, and free access + * is hereby granted as a license to use this software, copy this + * software and prepare derivative works based upon this software. + * However, any distribution of this software source code or + * supporting documentation or derivative works (source code and + * supporting documentation) must include the three paragraphs of + * the copyright notice. + */ + +The dcmjpeg sub-package includes an adapted version of the Independent +JPEG Group Toolkit Version 6b, which is contained in dcmjpeg/libijg8, +dcmjpeg/libijg12 and dcmjpeg/libijg16. This toolkit is covered by the +following copyright. The original README file for the Independent JPEG +Group Toolkit is located in dcmjpeg/docs/ijg_readme.txt. + +/* + * The authors make NO WARRANTY or representation, either express or implied, + * with respect to this software, its quality, accuracy, merchantability, or + * fitness for a particular purpose. This software is provided "AS IS", and you, + * its user, assume the entire risk as to its quality and accuracy. + * + * This software is copyright (C) 1991-1998, Thomas G. Lane. + * All Rights Reserved except as specified below. + * + * Permission is hereby granted to use, copy, modify, and distribute this + * software (or portions thereof) for any purpose, without fee, subject to these + * conditions: + * (1) If any part of the source code for this software is distributed, then this + * README file must be included, with this copyright and no-warranty notice + * unaltered; and any additions, deletions, or changes to the original files + * must be clearly indicated in accompanying documentation. + * (2) If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the work of + * the Independent JPEG Group". + * (3) Permission for use of this software is granted only if the user accepts + * full responsibility for any undesirable consequences; the authors accept + * NO LIABILITY for damages of any kind. + * + * These conditions apply to any software derived from or based on the IJG code, + * not just to the unmodified library. If you use our work, you ought to + * acknowledge us. + * + * Permission is NOT granted for the use of any IJG author's name or company name + * in advertising or publicity relating to this software or products derived from + * it. This software may be referred to only as "the Independent JPEG Group's + * software". + * + * We specifically permit and encourage the use of this software as the basis of + * commercial products, provided that all warranty or liability claims are + * assumed by the product vendor. + */ + +The code for the interpolatePixel() image scaling algorithm in module +dcmimgle has been derived from code written by Jef Poskanzer for the +"Extended Portable Bitmap Toolkit" (pbmplus10dec91) which has the +following copyright: + +/* + * Copyright (C) 1991 by Jef Poskanzer. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. This software is provided "as is" without express or + * implied warranty. + */ + +The color quantization code in module dcmimage (dcmquant and the related +classes) has been derived from code written by Jef Poskanzer for the +NetPBM toolkit which has the following copyright: + +/* + * Copyright (C) 1989, 1991 by Jef Poskanzer. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. This software is provided "as is" without express or + * implied warranty. + */ + +The code for the OFStandard::strlcpy and OFStandard::strlcat helper +functions in ofstd/libsrc/ofstd.cc has been derived from the BSD +implementation of strlcpy() and strlcat() and which carries the +following copyright notice: + +/* + * Copyright (c) 1998 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +The code for the OFStandard::atof helper function in ofstd/libsrc/ofstd.cc +has been derived from an implementation which carries the following +copyright notice: + +/* + * Copyright 1988 Regents of the University of California + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies. The + * University of California makes no representations about the + * suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * + * The code for OFStandard::ftoa has been derived + * from an implementation which carries the following copyright notice: + * + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +The "Base64" encoder/decoder in ofstd/libsrc/ofstd.cc has been derived +from an implementation which carries the following copyright notice: + +/* + * Copyright (c) 1999, Bob Withers - bwit(at)pobox.com + * + * This code may be freely used for any purpose, either personal or commercial, + * provided the authors copyright notice remains intact. + */ + +The oflog sub-package is based on the log4cplus library which is covered by +the following two copyright notices (for details see oflog/docs/LICENSE): + +/* + * Copyright (C) 1999-2009 Contributors to log4cplus project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +// Module: Log4CPLUS +// File: appender.h +// Created: 6/2001 +// Author: Tad E. Smith +// +// +// Copyright 2001-2010 Tad E. Smith +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +The dcmjpls sub-package is based on the CharLS library, which is contained +in dcmjpls/libcharls. This toolkit is covered by the following copyright: + +/* + * The CharLS library is available under the following license: + * ------------------------------------------------------------------------------- + * Copyright (c) 2007-2010, Jan de Vaan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of my employer, nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +The file ofstd/include/dcmtk/ofstd/oftest.h is heavily based on quicktest.h +from the quicktest project, which is covered by the following copyright: + +/************************************************************************ +* QuickTest * +* http://quicktest.sourceforge.net * +* Copyright (C) 2005-2008 * +* Tyler Streeter (http://www.tylerstreeter.net) * +* * +* This library is free software; you can redistribute it and/or * +* modify it under the terms of EITHER: * +* (1) The GNU Lesser General Public License as published by the Free * +* Software Foundation; either version 2.1 of the License, or (at * +* your option) any later version. The text of the GNU Lesser * +* General Public License is included with this library in the * +* file license-LGPL.txt. * +* (2) The BSD-style license that is included with this library in * +* the file license-BSD.txt. * +* * +* This library is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * +* license-LGPL.txt and license-BSD.txt for more details. * +************************************************************************/ + +The above mentioned license-BSD.txt contains this text: + +BSD Open Source license for QuickTest +------------------------------------- + +QuickTest +Copyright (c) 2005-2008, Tyler Streeter +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of QuickTest's copyright owners nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +The files ofstd/include/dcmtk/ofstd/ofxml.h and ofstd/libsrc/ofxml.cc are +derived from the XMLparser library, which is covered by the following +copyright: + +/* + * Copyright (c) 2002, Frank Vanden Berghen + * All rights reserved. + * + * The following license terms apply to projects that are in some way related to + * the "DCMTK project", including applications + * using "DCMTK project" and tools developed + * for enhancing "DCMTK project". All other projects + * (not related to "DCMTK project") have to use this + * code under the Aladdin Free Public License (AFPL) + * See the file "AFPL-license.txt" for more informations about the AFPL license. + * (see http://www.artifex.com/downloads/doc/Public.htm for detailed AFPL terms) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Frank Vanden Berghen nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Frank Vanden Berghen ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +The dcmrt sub-package is covered by the following copyright: + +--------------------------------------------------------------------------- + +Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany +Copyright (C) 2013-2019, J. Riesmeier, Oldenburg, Germany +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Parts of the dcmsr sub-package are covered by the following copyright: + +--------------------------------------------------------------------------- + +Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------------------------- + +The cielabutil source code (class IODCLabUtil) is adapted from Pascal Getreuer's +package for converting color representations + + http://www.getreuer.info/home/colorspace + +which comes with the following original copyright: + +--------------------------------------------------------------------------- + +Copyright (C) 2005-2010, Pascal Getreuer +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------------------------- + +Finally, DCMTK can be configured and compiled to make use of a number of +optional external libraries that, when available, provide added functionality +such as compression, encryption, or support for certain image formats. +For binary libraries and executables statically linked against these +external libraries, the following additional copyright notices / +licenses apply: + +When compiled with libiconv support: + +--------------------------------------------------------------------------- + +GNU LESSER GENERAL PUBLIC LICENSE + +License text available at: https://www.gnu.org/licenses/lgpl.html + +--------------------------------------------------------------------------- + +When compiled with libicu support: + +--------------------------------------------------------------------------- + +Copyright (C) 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +--------------------------------------------------------------------------- + +When compiled with libpng support: + +--------------------------------------------------------------------------- + +This copy of the libpng notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file png.h that is +included in the libpng distribution, the latter shall prevail. + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +This code is released under the libpng license. + +libpng versions 1.0.7, July 1, 2000 through 1.6.29, March 16, 2017 are +Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the list +of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. + +END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. + +TRADEMARK: + +The name "libpng" has not been registered by the Copyright owner +as a trademark in any jurisdiction. However, because libpng has +been distributed and maintained world-wide, continually since 1995, +the Copyright owner claims "common-law trademark protection" in any +jurisdiction where common-law trademark is recognized. + +OSI CERTIFICATION: + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is +a certification mark of the Open Source Initiative. OSI has not addressed +the additional disclaimers inserted at version 1.0.7. + +EXPORT CONTROL: + +The Copyright owner believes that the Export Control Classification +Number (ECCN) for libpng is EAR99, which means not subject to export +controls or International Traffic in Arms Regulations (ITAR) because +it is open source, publicly available software, that does not contain +any encryption software. See the EAR, paragraphs 734.3(b)(3) and +734.7(b). + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +March 16, 2017 + +--------------------------------------------------------------------------- + +When compiled with libsndfile support: + +--------------------------------------------------------------------------- + +GNU LESSER GENERAL PUBLIC LICENSE + +License text available at: https://www.gnu.org/licenses/lgpl.html + +--------------------------------------------------------------------------- + +When compiled with libtiff support: + +--------------------------------------------------------------------------- + +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + +--------------------------------------------------------------------------- + +When compiled with libwrap support: + +--------------------------------------------------------------------------- + +/************************************************************************ +* Copyright 1995 by Wietse Venema. All rights reserved. Some individual +* files may be covered by other copyrights. +* +* This material was originally written and compiled by Wietse Venema at +* Eindhoven University of Technology, The Netherlands, in 1990, 1991, +* 1992, 1993, 1994 and 1995. +* +* Redistribution and use in source and binary forms are permitted +* provided that this entire copyright notice is duplicated in all such +* copies. +* +* This software is provided "as is" and without any expressed or implied +* warranties, including, without limitation, the implied warranties of +* merchantibility and fitness for any particular purpose. +************************************************************************/ + +--------------------------------------------------------------------------- + +When compiled with libxml support: + +--------------------------------------------------------------------------- + +The MIT License + +License text available at: +https://opensource.org/licenses/mit-license.html + +--------------------------------------------------------------------------- + +When compiled with openssl support: + +--------------------------------------------------------------------------- + + The OpenSSL toolkit stays under a double license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +--------------------------------------------------------------------------- + +When compiled with zlib support: + +--------------------------------------------------------------------------- + + (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. + +--------------------------------------------------------------------------- diff --git a/CREDITS b/CREDITS new file mode 100644 index 00000000..851b8353 --- /dev/null +++ b/CREDITS @@ -0,0 +1,61 @@ + +CREDITS + +We would like to thank the following individuals, companies and organizations +(in alphabetical order) for supporting the development and maintenance of the +Open Source DICOM Toolkit DCMTK: + +Carl Zeiss Meditec: The preparation and publication of the DCMTK 3.6.2 release + as well as several extensions in wlmscpfs and dcmqrscp were supported by + funding from Carl Zeiss Meditec AG (Muenchen, Germany). + +DKFZ: The work on the DCMTK module "dcmrt" was supported in part by funding + from the Deutsches Krebsforschungszentrum (Heidelberg, Germany). + +Epilepsieforschung: The Gesellschaft fuer Epilepsieforschung e.V. (Bielefeld, + Germany) supported the DCMTK by sponsoring the initial development of the + tool "dcmrecv" and the underlying class "DcmStorageSCP". + +ICSMED: From 2006 to 2012, the work on the DCMTK was supported by employees of + the ICSMED AG (Oldenburg, Germany), a spin-off from the OFFIS institute. + +ITH icoserve: The ITH icoserve technology for healthcare GmbH (Innsbruck, + Austria) regularly reports issues to the DCMTK team and contributes patches. + The company is also known for testing the latest DCMTK snapshots and providing + useful feedback. + +J. Riesmeier: The work on the DCMTK is supported by Joerg Riesmeier (Oldenburg, + Germany), a former employee of both the OFFIS institute and the ICSMED company + who now works as a freelancer. + +M. Malaterre: The GDCM developer Mathieu Malaterre (Lyon, France) regularly + reports possible issues to the DCMTK team. He was also responsible for + packaging the DCMTK library and tools for the Debian operating system. + +Open Connections: The work on the DCMTK is supported by employees of the Open + Connections GmbH (Oldenburg, Germany), a spin-off from the OFFIS institute. + +QIICR: The work on various DCMTK modules was supported in part by funding from + the National Institutes of Health and the NCI Informatics Technology for + Cancer Research (ITCR) initiative to the Quantitative Image Informatics for + Cancer Research (QIICR) project, award U24 CA180918. + +SlicerDMRI: The work on DCMTK Tractography modules was supported in part by + funding from the National Institutes of Health National Institute of + Biomedical Imaging and Bioengineering (NIBIB), to project Neuroimage Analysis + Center, award P41 EB015902; and the National Institutes of Health National + Cancer Institute (NCI) Informatics Technology for Cancer Research (ITCR) + initiative, to project Open Source Diffusion MRI Technology For Brain Cancer + Research, award U01 CA199459. + +VISUS: The work on various extensions of the DCMTK was supported in part by + funding from the VISUS Technology Transfer GmbH (Bochum, Germany). + +YXLON: The work on the initial version of the DICONDE data dictionary was + supported by funding from the YXLON International GmbH (Hamburg, Germany). + + +Please note that this list does not claim to be exhaustive. Just send us an +email if you think that you or your company/organization should also be listed. + +DCMTK Team, 2017-04-20 diff --git a/FAQ b/FAQ new file mode 100644 index 00000000..3b034938 --- /dev/null +++ b/FAQ @@ -0,0 +1,3 @@ +DCMTK FAQ - Frequently Asked Questions + +The FAQ is now available online: http://forum.dcmtk.org/faq diff --git a/HISTORY b/HISTORY new file mode 100644 index 00000000..e69354da --- /dev/null +++ b/HISTORY @@ -0,0 +1,65 @@ + +The OFFIS DICOM Toolkit DCMTK + +In 1993, the OFFIS institute and Oldenburg University, Germany supported by +CERIUM, Rennes, France, developed a DICOM implementation on behalf of +CEN/TC251/WG4 as part of a DICOM demonstration at RSNA'93. The software +started with a early version of the DICOM Upper Layer Protocol facility +developed by the Mallinckrodt Institute of Radiology in St. Louis, USA. The +rest of this software was developed independently and successfully demonstrated +for the first time at RSNA'93. Interoperability was demonstrated with around +20 implementations from vendors of medical imaging equipment, with both this +software and the Mallinckrodt Institute of Radiology's own implementation. +This implementation became known as the European CTN (Central Test Node). + +The European CTN software was further extended by OFFIS in 1994 and 1995 and +used as part of DICOM demonstrations at EuroPACS'94 in Geneva, ECR'95 in Vienna +and CAR'95 in Berlin where even more vendors of imaging equipment were able to +demonstrate interoperability. + +During 1996, the software was rewritten by OFFIS to use a new C++ based DICOM +encoding/decoding library and has been supplemented with a Modality Worklist +CTN, demonstrated for the first time at CAR'96 in Paris, France. The CAR'96 +DICOM demonstration featured Modality Worklist Management and Image +Storage/Query/Retrieval. The available software includes source code and +documentation for the worklist management and image storage/query/retrieve +server applications, a number of test applications, and the necessary +libraries. A similar industry demonstration also took place at the European +Congress of Radiology (ECR '97) in Vienna and at CAR'97 in Berlin. + +Beginning with release 3.0 (1996), the software package was renamed to DCMTK +(DiCoM ToolKit). It contains a number of improvements over the "European CTN" +software previously available from OFFIS/Oldenburg University, the most +important being: + - configuration using GNU autoconf + - a modality worklist SCP and SCU + - a new C++ encoding/decoding library + - support for offline media + - support for explicit VR transfer syntaxes + - a user-extensible data dictionary + - support for all balloted image SOP classes + +In 1997, a tool allowing to create DICOMDIRs according to the "General Purpose +CD-R Image Interchange Profile" was added. This tool was used to master the +CAR' 97 and NEMA '97 DICOM Demonstration CDs. + +Beginning in 1998, new libraries for efficient rendering of DICOM grayscale +images, display calibration according to DICOM part 14 and an implementation of +the Grayscale Softcopy Presentation State (GSPS) supplement were added and +demonstrated at ECR '99 and RSNA InfoRAD '99. Together with an implementation +of DICOM basic grayscale print management (SCU and SCP, both supporting +presentation LUT) and a small GSPS checker these tools were used for testing +purposes for the "softcopy and hardcopy consistency" part of the IHE +(Integrating the Healthcare Enterprise), an initiative of RSNA and HIMSS. + +For the RSNA 2000 and the ECR 2001, DICOM's new security extensions on secure +transport connections (TLS - Transport Layer Security) and Digital Signatures +were added together with a library for DICOM Structured Reporting. Furthermore, +support for color images has been moved to the public part of the toolkit +(required separate licensing before). + +To be continued ... + +In addition to the freely available DCMTK software, OFFIS has also developed +other DICOM software which must be licensed separately. These separate packages +build on the facilities provided by DCMTK. -- See: http://dicom.offis.de/ diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..67b396ac --- /dev/null +++ b/INSTALL @@ -0,0 +1,937 @@ +================================== +DICOM TOOLKIT (DCMTK) INSTALLATION +================================== + + +PRE-REQUISITES +============== + +The DICOM toolkit (DCMTK) needs to be compiled with a C++ compiler. We +recommend using the GNU C++ compiler in versions higher than 4.2.1 (most of the +development for this release was done using GNU C++ 6.3.0 on Debian Linux). +The software is also known to compile using the SUNPro C++ compiler, Clang and +Microsoft Visual Studio. + +Compatibility with other C++ compilers is unknown, however, we have tried to +keep language demands to a minimum (newer C++ features such as Exceptions and +RTTI have been avoided and fall back implementations for all used STL classes +are provided). + +You will need several hundred Mbytes of disk space to compile all the software. + + +SUPPORTED SYSTEMS +================= + +Microsoft Windows +----------------- + +The DCMTK software can be compiled under a native Microsoft Windows environment +(see section "Microsoft Windows with CMake" below for more information). + +The current (minor) release successfully compiles on the following operating +system / hardware / compiler combinations: + + Windows 7 / Intel x86 / Microsoft Visual C++ 2008 Express (VS 9) + Windows 7 / Intel x86 / Microsoft Visual C++ 2010 Express (VS 10) + Windows 7 / Intel x86 / Microsoft Visual C++ 2012 Express (VS 11) + Windows 7 / Intel x86 / Microsoft Visual C++ 2013 Express (VS 12) + Windows 7 / Intel x86 / Microsoft Visual C++ 2015 Community (VS 14) + Windows 7 / Intel x86 / Microsoft Visual C++ 2017 Community (VS 15) + Windows 7 / Intel x86 / MinGW gcc 7.4.0 (i686-w64-mingw32) + Windows 7 / amd64|x86_64 / Microsoft Visual C++ 2010 Express (VS 10) + Windows 7 / amd64|x86_64 / Microsoft Visual C++ 2012 Express (VS 11) + Windows 7 / amd64|x86_64 / Microsoft Visual C++ 2013 Express (VS 12) + Windows 7 / amd64|x86_64 / Microsoft Visual C++ 2015 Community (VS 14) + Windows 7 / amd64|x86_64 / Microsoft Visual C++ 2017 Community (VS 15) + Windows 7 / amd64|x86_64 / Microsoft Visual C++ 2019 Community (VS 16) + Windows 7 / amd64|x86_64 / MinGW gcc 8.2.1 (x86_64-w64-mingw32) + Windows 10 / amd64|x86_64 / Microsoft Visual C++ 2019 Community (VS 16) + +Unix (or lookalikes) +-------------------- + +The current DCMTK software release successfully compiles on the following +operating system / hardware / compiler combinations using the instructions +given below: + + FreeBSD 12.0 / amd64|x86_64 / Clang 6.0.1 + Linux 3.2.0 / amd64|x86_64 / GNU gcc 4.4.7 (Debian 7.11) + Linux 3.10.0 / amd64|x86_64 / Clang 3.4.2 (CentOS 7.7) + Linux 3.10.0 / amd64|x86_64 / GNU gcc 4.8.5 (CentOS 7.7) + Linux 3.13.0 / amd64|x86_64 / Clang 3.9.1 (Linux Mint 17.3) + Linux 3.13.0 / amd64|x86_64 / GNU gcc 4.8.5 (Linux Mint 17.3) + Linux 3.13.0 / amd64|x86_64 / GNU gcc 5.5.0 (Linux Mint 17.3) + Linux 3.13.0 / amd64|x86_64 / GNU gcc 6.5.0 (Linux Mint 17.3) + Linux 3.13.0 / amd64|x86_64 / GNU gcc 8.3.0 (Linux Mint 17.3) + Linux 4.19.0 / Intel x86 / Clang 7.0.1 (Debian 10) + Linux 4.19.0 / Intel x86 / GNU gcc 8.3.0 (Debian 10) + Linux 4.19.0 / amd64|x86_64 / Clang 7.0.1 (Debian 10) + Linux 4.19.0 / amd64|x86_64 / GNU gcc 8.3.0 (Debian 10) + Linux 5.0.0 / amd64|x86_64 / gcc 8.3.0 (Ubuntu Linux) + Linux 5.3.7 / amd64|x86_64 / Clang 9.0.0 (Arch Linux) + Linux 5.3.7 / amd64|x86_64 / GNU gcc 9.2.0 (Arch Linux) + MacOS X 10.15 / amd64|x86_64 / Apple Clang 11.0.0 + MacOS X 10.15 / amd64|x86_64 / GNU gcc 9.2.0 + OpenBSD 6.5 / amd64|x86_64 / Clang 7.0.1 + OpenBSD 6.5 / amd64|x86_64 / GNU gcc 4.2.1 + OpenIndiana / Intel x86 / GNU gcc 8.3.0 (OpenIndiana 2019.04) + Solaris 11.3 / Intel x86 / GNU gcc 4.8.2 + Solaris 11.3 / Intel x86 / SunPro CC 5.14 (Oracle Developer Studio 12.5) + Solaris 11.3 / Intel x86 / SunPro CC 5.15 (Oracle Developer Studio 12.6) + +Cross Compiling +--------------- + +The current DCMTK release can be cross-compiled targeting the following +platforms: + + Android / arm64 / GNU gcc 6.3.0 (API 24, ABI arm64-v8a) + +Cross compiling support with running configuration and unit tests is currently +only provided using CMake and requires the use of the Android emulator or Wine +when targeting Android or Windows respectively. Other versions of Android will +most likely also work, but the above mentioned one is currently the only one +that is being regularly tested. + +Other Platforms +--------------- + +The previous minor release DCMTK 3.6.4 was also tested on the following +platforms that may still work, but were not tested again for this minor release: + + Linux 3.2.0 / amd64|x86_64 / GNU gcc 4.8.4 (Debian 7.11) + Linux 3.16.0 / armv7|armhf / GNU gcc 4.9.4 (Debian 8) + Linux 4.19.4 / amd64|x86_64 / Clang 7.0.0 (Arch Linux) + Linux 4.19.4 / amd64|x86_64 / GNU gcc 8.2.1 (Arch Linux) + NetBSD 8.0 / amd64|x86_64 / Clang 5.0.2 + NetBSD 8.0 / amd64|x86_64 / GNU gcc 5.5.0 + Windows 7 / Intel x86 / Microsoft Visual C++ 2005 Express (VS 8) + Windows 10 / Intel x86 / Microsoft Visual C++ 2015 Community (VS 14) + Windows 10 / amd64|x86_64 / Microsoft Visual C++ 2015 Community (VS 14) + Windows 10 / amd64|x86_64 / Microsoft Visual C++ 2017 Community (VS 15) + +The previous minor release DCMTK 3.6.3 was also tested on the following +platforms that may still work, but were not tested again for this minor release: + + Linux 3.16.0 / amd64|x86_64 / Clang 3.5.0 (Debian 8.8) + Linux 3.2.0 / amd64|x86_64 / GNU gcc 4.7.2 (Debian 7.11) + Linux 4.10.0 / amd64|x86_64 / GNU gcc 6.3.0 (Ubuntu 17.04) + Linux 4.10.0 / amd64|x86_64 / Clang 4.0.0 (Ubuntu 17.04) + MacOS X 10.10.4 / amd64|x86_64 / Apple Clang 6.0 + Windows 7 / amd64|x86_64 / CygWin 2.8.0 (gcc 6.3.0) + OpenIndiana / Intel x86 / Clang 4.0.0 (OpenIndiana 2017.04) + +The previous release DCMTK 3.6.2 was also tested on the following platforms +that may still work, but were not tested again for this minor release: + + QNX 6.5 / Intel x86 / GNU gcc 4.4.2 (see note *1) + Windows 8.1 / Intel x86 / Microsoft Visual C++ 2008 Express (VS 9) + Windows 8.1 / Intel x86 / Microsoft Visual C++ 2010 Express (VS 10) + Windows 8.1 / Intel x86 / Microsoft Visual C++ 2012 Express (VS 11) + Windows 8.1 / Intel x86 / Microsoft Visual C++ 2015 Express (VS 14) + Windows 8.1 / Intel x86 / Microsoft Visual C++ 2017 Community (VS 15) + Windows 8.1 / amd64|x86_64 / Microsoft Visual C++ 2010 Express (VS 10) + Windows 8.1 / amd64|x86_64 / Microsoft Visual C++ 2012 Express (VS 11) + Windows 8.1 / amd64|x86_64 / Microsoft Visual C++ 2015 Express (VS 14) + Windows 8.1 / amd64|x86_64 / Microsoft Visual C++ 2017 Community (VS 15) + +Cross compilers: + + Windows 7 / Intel x86 / MinGW gcc 4.9.1 (Linux host) + Windows 7 / amd64|x86_64 / MinGW gcc 4.9.1 (Linux host) + +Earlier releases of the DCMTK are known to also compile on further platforms +which are not available to us for testing purposes any more, e.g. AIX, HP-UX, +IRIX, NeXTStep, OSF/1, Solaris/SunOS, Ultrix. Also the Intel C++ Compiler and +other compilers might still work but we haven't tested them this time. + +Platform Notes +-------------- + +(*1) QNX 6.5 requires to remove or disable the define "HAVE_IEEEFP_H" in + "config/include/dcmtk/config/osconfig.h" after running the configure + process but before starting the compilation. + + +OPENSSL SUPPORT +=============== + +Starting with release 3.4.2, DCMTK supports encrypted network transmissions +using the Transport Layer Security (TLS) protocol as defined in DICOM part 15. +DCMTK relies on the OpenSSL toolkit (www.openssl.org) for the underlying +cryptographic routines and the TLS protocol implementation. + +This release of DCMTK requires OpenSSL release 1.0.1 or newer, since older +versions do not support the TLS 1.2 protocol required by the more recent +DICOM security profiles. We recommend the use of OpenSSL 1.0.2 or newer, +however, since some optional functions recommended by RFC 7525 / BCP 195 +are only available starting with this OpenSSL release. Furthermore, users +should make care that the most recent OpenSSL patch level is applied. + +When using CMake, if support for security enhancements is desired, a compiled +version of the OpenSSL libraries and include files must be available during +compilation of DCMTK. By default, DCMTK checks whether OpenSSL is installed +and enables support automatically if present. By default, DCMTK checks the +standard paths on Unix platforms. For Windows platforms, check the discussion +on CMake below. + + +ZLIB SUPPORT +============ + +Starting with release 3.5.2, DCMTK supports the "Deflated Explicit VR Little +Endian" Transfer Syntax, i.e. ZIP-compressed network transmission and media +storage. DCMTK relies on the zlib toolkit (www.zlib.org) for the underlying +compression routines. This release of DCMTK is known to compile with the zlib +releases 1.2.8 to 1.2.11, although other releases may work as well. + +When using CMake, a compiled version of the zlib libraries and include files +must be available during compilation of DCMTK. See discussion on CMake below. + + +LIBTIFF SUPPORT +=============== + +Starting with release 3.5.1, DCMTK supports the conversion of DICOM images to +TIFF. DCMTK relies on the libtiff toolkit (www.libtiff.org) for this purpose. +This release of DCMTK is known to compile with the libtiff releases 3.8.2 to +4.10.0, although other releases may work as well. However, libtiff releases +prior to version 3.7.0 will not work since the TIFFCleanup() function was not +yet available. On Windows, libtiff 3.7.4 or higher is required due to +incompatible API changes in libtiff. + +When using CMake, a compiled version of the libtiff libraries and include files +must be available during compilation of DCMTK. See discussion on CMake below. + + +LIBPNG SUPPORT +============== + +Starting with release 3.5.3, DCMTK supports the conversion of DICOM images to +PNG. DCMTK relies on the libpng toolkit (www.libpng.org) for this purpose. +This release of DCMTK is known to compile with the current libpng releases +1.2.50 to 1.6.37, although other releases may work as well. + +When using CMake, a compiled version of the libpng libraries and include +files must be available during compilation of DCMTK. See discussion on CMake +below. + + +LIBXML2 SUPPORT +=============== + +Starting with release 3.5.3, DCMTK supports the conversion of XML documents to +DICOM files. DCMTK relies on the libxml2 toolkit (www.libxml.org) for this +purpose. This release of DCMTK is known to compile with the libxml2 releases +2.9.4 to 2.9.9, although other releases may work as well. + +When using CMake, if support for XML import is desired, a compiled version of +the libxml2 (and possibly iconv) libraries and include files must be available +during compilation of DCMTK. See discussion on CMake below. + + +TCP WRAPPER (LIBWRAP) SUPPORT +============================= + +Starting with release 3.5.3, DCMTK supports Wietse Venema's TCP wrappers +library (libwrap) which is freely available for most Unix platforms and part +of the default installation of most recent Linux distributions. This library +allows to enforce host-based access control via the "/etc/hosts.deny" and +"/etc/hosts.allow" configuration files. See hosts_access(5) man page for +details. + +When using CMake, if support for TCP wrappers is desired, a compiled version of +the libwrap library and include file must be available during +compilation of DCMTK. See discussion on CMake below. + +Since DCMTK uses the TCP wrappers from C++ code, an ANSI C compatible header +file is required. The official release 7.6 of the TCP wrappers +library is not ANSI C compatible and does not work with DCMTK (i.e. will not be +recognized by DCMTK's configure script). However, many current Linux and BSD +distributions ship with an ANSI C compatible header file. + + +Character Set Conversion Support +================================ + +Starting with release 3.6.2, DCMTK supports the conversion between different +character encodings, e.g. UTF-8 and ISO Latin 1. For this purpose, DCMTK relies +on one of the following alternatives to be available for being used as the +underlying implementation: libiconv, the ICU library or the iconv functionality +included in the C standard library. + +DCMTK detects the availability of these implementations and (in case multiple +ones are available) chooses one of them automatically as follows: the libiconv +implementation is currently preferred since its integration is most mature. If +it is not available, the ICU implementation is the next best choice. Otherwise +the iconv implementation from the C standard library will be selected (if the +used C standard library provides it). This choice can be overridden via the +"--enable-charconv" argument (Autoconf) or "DCMTK_ENABLE_CHARSET_CONVERSION" +(CMake). Selecting an implementation that is not available will be ignored, +i.e. the user choice will be overridden. + +LIBICONV SUPPORT +---------------- + +The libiconv toolkit (www.gnu.org/s/libiconv/) may be used as DCMTK's underlying +character set conversion implementation. This release of DCMTK is known to +compile with the libiconv release 1.15, although other releases may work as +well. + +When using CMake, a compiled version of the libiconv and libcharset libraries +and include files must be available during compilation of DCMTK. See discussion +on CMake below. + +ICU SUPPORT +----------- + +DCMTK supports the International Components for Unicode (ICU) library as an +alternative to the above mentioned libiconv. This release of DCMTK is known to +compile with the ICU releases 59.1 to 65.1, although other releases may work as +well. + +The ICU may be easier to integrate on some more modern Linux distributions +(e.g. Arch Linux) and Windows than the libiconv but (due to the way it is +currently integrated) lacks support for converting the following character sets: + + ISO 2022 IR 87 + ISO 2022 IR 159 + +Furthermore, the ICU-based implementation currently does not support +transliteration. + +When using CMake, if support for character set conversion using ICU is desired, +a compiled version of the ICU libraries and include files must be available +during compilation of DCMTK. See discussion on CMake below. + +Support for iconv provided in the C standard library +---------------------------------------------------- + +DCMTK allows using the iconv implementation provided as part of the C standard +library on some platforms. Building DCMTK with this implementation may be +easier and reduce additional runtime dependencies, but this option should be +used with caution: the iconv implementations from different C standard libraries +may vary with regards to the supported character sets and functionalities. + +If possible, the libiconv implementation should be preferred. Most importantly +some iconv implementations provided by the C standard library do not support +conversion to whatever character set the terminal is currently using, which we +consider essential and, therefore, strongly suggest not to use those +implementations (there is a new configure test for the issue, which allows to +query support for this on API level). + +Known Issues +------------ + +If both the iconv implementation from the C standard library and the libiconv +are available in the default search paths, the wrong might be included +independently from the user choice (--enable-charconv resp. +DCMTK_ENABLE_CHARSET_CONVERSION). + +DCMTK currently has no mechanism to force including a certain instead, +so this has to be achieved by manually modifying the include paths and/or +DCMTK's code. Some platforms (e.g. Arch Linux) even rename the +provided as part of libiconv to or the like to avoid name +collisions. In this case, the user has to modify DCMTK's source code to include +the correct file, since we currently don't provide a configuration test for it. + + +Using the native STL +==================== + +DCMTK can be configured to use the STL (Standard Template Library) features +provided by the compiler / runtime environment instead of its own fallback +implementations that are used by default. + +This can be achieved with the "--enable-stl" argument (Autoconf) or by setting +"DCMTK_ENABLE_STL" to "ON" (CMake). This will, however, not forcibly enable +using the native STL features but instead trigger running several configuration +tests for detecting whether the individual features work as expected/required +by DCMTK. It is for example known that the implementations of std::list and +std::vector provided by some versions of Visual Studio 2005 have a serious bug +that might lead to segmentation fault and std::error_code is currently not +implemented correctly on any version of Visual Studio we know about. + +It is furthermore possible to enable or disable individual STL features +independently of the setting provided by "--enable-stl" or "DCMTK_ENABLE_STL" +respectively: use "--enable-stl-", "--disable-stl-" and/or +"DCMTK_ENABLE_STL_ (ON/OFF)" as appropriate, e.g. +"--disable-stl-vector" or "-DDCMTK_ENABLE_STL_STRING=ON". + + +SUPPORT FOR MODERN C++ STANDARDS +================================ + +DCMTK can be configured to use several features of modern C++ standards, eg. +(e.g. C++11 move semantics, variadic templates and the like) instead of its own +workarounds and fallback implementations. This can be achieved using CMake's +variables "CMAKE_CXX_STANDARD" and "CMAKE_CXX_STANDARD_REQUIRED". +The previous mechanism only handled C++11 and is available on old versions of +CMake (versions prior 3.1.3): set "DCMTK_ENABLE_CXX11" to "ON". For Autoconf, +use the "--enable-cxx11" argument. Both the "DCMTK_ENABLE_CXX11" variable and +Autoconf support are now deprecated and will be removed in a future release. + +Enabling e.g. C++11 will change some parts of DCMTK's API, so a C++11 build of +DCMTK is potentially incompatible with a classic build of DCMTK. This setting +is, therefore, stored in "config/include/dcmtk/config/osconfig.h" and verified +when compiling DCMTK itself or any program that includes it. + +Setting CMAKE_CXX_STANDARD to '11' or some newer C++ standard will not forcibly +enable DCMTK to use the respective features but instead trigger running some +configuration tests and only truly enable the features that are really +supported (e.g. std::error_code is still not implemented as intended on newer +versions of Visual Studio, so we keep using DCMTK's own implementation there). + +Please note that this setting does not depend on enabling the STL features but +not all combinations (e.g. enabling C++11 but disabling std::string) may work. + + +BUILDING +======== + +CMake is now the default tool for configuring a DCMTK build. CMake is a +cross-platform, open-source make system which can be used to control the +software compilation process using simple configuration files. CMake can be +obtained free of charge from https://cmake.org/. For configuring the DCMTK, +the toolkit contains corresponding "CMakeLists.txt" files in all necessary +directories. In detail, these "CMakeLists.txt" files will serve as an input to +CMake which will generate suitable build files for all of DCMTK's projects from +these files. + +DCMTK 3.6.5 requires CMake version 2.8.5 or later. We recommend using the +latest stable release of CMake (currently version 3.15.4) since newer versions +of CMake often provide better output in case of errors and are generally easier +to use (for example by providing better support for detecting the availability +of third party libraries). If possible, use the CMake version your operating +system provides with its package manager. + +More info about building the DCMTK with CMake can be found in DCMTK's wiki: + + https://support.dcmtk.org/wiki/dcmtk/howto/cmakeconfiguration + +CMake and shared libraries +-------------------------- + +The CMake build system allows for building shared libraries instead of static +libraries. On Windows systems, these are dynamic link libraries (.dll). +On Unix systems, these are shared objects (.so). To enable this, set the +"BUILD_SHARED_LIB" option to "ON". + +Additionally, it is possible to produce a single shared library for the whole +toolkit. This mode is controlled by the "BUILD_SINGLE_SHARED_LIBRARY" option. +If you don't want the whole toolkit in a single shared library, the +"DCMTK_MODULES" cache variable can be modified to select a subset of the +available modules. Please note that this option is marked as advanced and thus +is hidden by default. Also, when building a single shared library, applications +and tests cannot be built. + +Default value for CMAKE_BUILD_TYPE +---------------------------------- + +CMAKE_BUILD_TYPE is set to value "Release" if none is specified by the +selected build file generator. For those generators that support multiple +configuration types (e.g. Debug, Release), CMAKE_CONFIGURATION_TYPES holds +possible values. For other generators, this value is empty, and for those +generators the build type is fixated by CMake and cannot be changed otherwise. +Please note that Visual Studio ignores CMAKE_BUILD_TYPE and always starts off +using "Debug", so you should best change it to "Release" manually before +starting the build process. + +To disable the CMAKE_BUILD_TYPE default value, set CMAKE_BUILD_TYPE to value +"None" during CMake configuration, e.g. use "-DCMAKE_BUILD_TYPE:STRING=None" +on the command line. This may be useful if the compiler flags should be +controlled manually (e.g. as defined in environment variables like CXXFLAGS) +and no CMake defaults related to the selected configuration type kick in. + +DCMTKConfig.cmake AND DCMTKTargets.cmake +---------------------------------------- + +CMake permits to write files that describe the DCMTK build configuration +(DCMTConfig.cmake) as well as all targets (executables and libraries) that have +been produced (DCMTKTargets.cmake). Those files can be utilized by external +projects by using CMake's find_package() mechanism in "CONFIG" mode in order to +adapt their own build configuration, and directly make use of all available +target libraries and executables. + +On systems using CMake versions equal or greater than 2.8.8, these files are +written during installation to the installation directory's subfolder "/cmake" +on Windows systems, and "/lib/cmake/dcmtk" on Unix-like systems. Additionally, +these files are written to the main directory of CMake's build tree during the +build, with all content (e.g. the include paths within DCMTConfig.cmake) +pointing to the correct values for the build tree. Thus even a DCMTK build tree +can be used by external projects that process these two files. + +On systems using CMake versions lower than 2.8.8, only a simplified +DCMTKConfig.cmake is created, which is only available in the install tree. +DCMTKTargets.cmake is not created at all. + +Microsoft Windows with CMake +---------------------------- + +Using CMake is the only supported way to compile DCMTK for Windows. For being +able to do so, perform the following steps to install CMake on your machine: + +1. Go to https://cmake.org/ to download the latest release version of CMake + for Windows. +2. Execute the file which was downloaded to install CMake on your machine. + Follow all install instructions appropriately. + +In order to manually configure the support for the above mentioned external +libraries (OpenSSL, zlib, libtiff, libpng, libxml2 and libiconv or ICU) through +CMake, perform the following steps: + +1. Go Start -> Programs -> CMake -> "CMake" or "CMake (cmake-gui)" to start the + CMake utility through which the configuration can be done. +2. In the entry field "Where is the source code:" enter the directory in which + the DCMTK source code resides, e.g. "C:\dcmtk-3.6.5". +3. In the entry field "Where to build the binaries:" enter the directory in + which the libraries and binaries are to be built, e.g. "C:\dcmtk-msvc15". +4. In the combobox "Build for:" or "Specify the generator for this project:" + select the corresponding development environment which shall be used to + compile DCMTK (e.g. "Visual Studio 15 2017 Win64"). +5. Go "Configure". (CMake will look for a corresponding compiler, read in all + of DCMTK's "CMakeLists.txt" files and perform some tests. The variables in + the tabular area will be displayed in red. These variables can now be set + in order to turn the support for any of the external libraries on or off.) +6. Make the corresponding configurations in CMake's user interface. For + example, in order to turn on libxml2 support, set the value of variable + "DCMTK_WITH_XML" to "ON" and set the value of variable "WITH_LIBXMLINC" + to the path where the include files and libraries of libxml2 can be found, + e.g. "C:\libxml2-2.9.7". The support of all other external libraries can + be turned on in a similar way: + + libpng support: + set "DCMTK_WITH_PNG" to "ON" and + set "WITH_LIBPNGINC" e.g. to "C:\libpng-1.6.37" + + libtiff support: + set "DCMTK_WITH_TIFF" to "ON" and + set "WITH_LIBTIFFINC" e.g. to "C:\libtiff-4.0.10" + + OpenSSL support: + set "DCMTK_WITH_OPENSSL" to "ON" and + set "WITH_OPENSSLINC" e.g. to "C:\openssl-1.1.1d" + + zlib support: + set "DCMTK_WITH_ZLIB" to "ON" and + set "WITH_ZLIBINC" e.g. to "C:\zlib-1.2.11" + + libiconv support: + set "DCMTK_WITH_ICONV" to "ON" and + set "WITH_LIBICONVINC" e.g. to "C:\libiconv-1.15" + + In order to turn the support of a certain external library off, set the + value of the corresponding variable ("DCMTK_WITH_XML", "DCMTK_WITH_PNG", + "DCMTK_WITH_TIFF", "DCMTK_WITH_OPENSSL", "DCMTK_WITH_ZLIB" or + "DCMTK_WITH_ICONV") to "OFF". + + (Please note that the include files of all external libraries are always + expected in a directory named "include" below the directory which is + specified in "WITH_LIBXMLINC", "WITH_LIBPNGINC", "WITH_LIBTIFFINC", + "WITH_OPENSSLINC", "WITH_ZLIBINC" or "WITH_LIBICONVINC".) + + (Please note also that the library files of all external libraries are always + expected in directory named "lib" below the directory which is specified in + "WITH_LIBXMLINC", "WITH_LIBPNGINC", "WITH_LIBTIFFINC", "WITH_OPENSSLINC", + "WITH_ZLIBINC" or "WITH_LIBICONV". Moreover, note that the following + filenames must be used for the corresponding lib files: + + libxml2: + "iconv_d.lib" - debug version + "iconv_o.lib" - release version (optimized) + "libxml2_d.lib" - debug version + "libxml2_o.lib" - release version (optimized) + + libpng: + "libpng_d.lib" - debug version + "libpng_o.lib" - release version (optimized) + + libtiff: + "libtiff_d.lib" - debug version + "libtiff_o.lib" - release version (optimized) + + openssl: + "dcmtkcrypto_d.lib" - debug version + "dcmtkcrypto_o.lib" - release version (optimized) + "dcmtkssl_d.lib" - debug version + "dcmtkssl_o.lib" - release version (optimized) + + zlib: + "zlib_d.lib" - debug version + "zlib_o.lib" - release version (optimized) + + libiconv: + "libiconv_d.lib" - debug version + "libiconv_o.lib" - release version (optimized) + "libchset_d.lib" - debug version + "libchset_o.lib" - release version (optimized) + + The ICU is integrated using CMake's "find_package()" mechanism, which is + somewhat different to the handmade scripts employed for the other libraries. + If you want to use the ICU instead of libiconv, you have to include it by + setting the appropriate variables for the "FindICU" module, see + https://cmake.org/cmake/help/latest/module/FindICU.html . + + The debug versions of all libraries must be compiled for the multithread + debug version of the runtime (/MTd), the release version must be compiled + for the non-debug multithread runtime (/MT). Precompiled versions of all + libraries can be downloaded from https://www.dcmtk.org/dcmtk#lib-win. + +7. Go "Configure" a second time. (CMake will adjust the configuration + according to the displayed specifications.) +8. Go "OK" or "Generate". (CMake will generate new project files in the + corresponding directories. These files will be adjusted according to the + displayed specifications, i.e. support for the external libraries will be + turned on or off.) + +Having performed these steps, the Microsoft Visual Studio IDE can be started, +DCMTK's workspace file can be opened, and one or more of DCMTK's subprojects +can be built. In case you want to build all libraries and applications, mark +the "ALL_BUILD" subproject and build it. The "INSTALL" subproject installs +the executables, libraries, include, support and documentation files to the +directory specified by the variable "CMAKE_INSTALL_PREFIX" (very similar to +"make install-all" on Unix systems). + +Compilation and installation of the various command line applications +(including the test programs) can be disabled by setting the "BUILD_APPS" +option to "OFF" before configuring and generating the project files. By +default, all command line applications are built and installed. + +Please note that other Windows compilers, e.g. Borland C++ Builder, are +currently not actively supported. However, they may work. + +Known limitations of DCMTK on the Windows platform. + +1. The dcmqrscp tool cannot spark multiple processes. Every association must + be handled completely before a new association is possible. +2. Visual C++ contains two different implementations of I/O streams which + should never be mixed within one application because this may cause + application errors that are hard to find. The old, now deprecated + implementation uses the traditional cfront header files etc. + The new implementation uses etc. as defined in ANSI/ISO C++. + DCMTK can be configured to use either of the two interfaces. This behavior + can be changed in "config/include/dcmtk/config/osconfig.h" in the build + directory where the symbol USE_STD_CXX_INCLUDES is declared. +3. DCMTK does not compile when UNICODE or _UNICODE is defined because the + VisualStudio compiler then uses the Unicode version instead of the ANSI + version for all Windows API functions (i.e. type wchar_t instead of char + for all character string parameters and return values). + + +Unix with CMake +--------------- + +One key difference when using CMake for building on Unix like systems is that we +use the "find_package()" mechanism for all external libraries and not just the +ICU. Most Unix like systems provide a package manager or even if not at least +have a consistent approach for where the libraries and include files are +installed such that the CMake "find_package()" mechanism typically finds them +out of the box. + +If that does not work or you want to use a different version of a library than +the one in the default search paths, you should look at the documentation of the +respective "find_package()" module to find out which variables need to be +modified, e.g. "FindZLIB" to control which version of the zlib will be used: +https://cmake.org/cmake/help/latest/module/FindZLIB.html . + +The typical way to build DCMTK on Unix like systems with CMake is as follows +(if not using the GUI, in that case look at the description for Windows above): + + mkdir dcmtk-3.6.5-build + cd dcmtk-3.6.5-build + cmake ../dcmtk-3.6.5 + make -j8 + make DESTDIR=../dcmtk-3.6.5-install install + +The above commands assume that the DCMTK source code was extracted to the +current working directory into a folder named dcmtk-3.6.5. DCMTK will be +configured using CMake with the default options, detecting and including all +available support libraries and then compiled using eight CPU cores +('make -j8', adjust as needed). The result will be installed to the directory +"dcmtk-3.6.5-install" next to the source code directory. + +If you want to modify your build configuration, like enabling or disabling +some features of DCMTK (e.g. PNG support), or if you need to modify the +predefined build-variables, you can use the curses based cmake configuration +tool 'ccmake'. First, create the initial build setup (system check) and then +call ccmake: + + mkdir dcmtk-3.6.5-build + cd dcmtk-3.6.5-build + cmake ../dcmtk-3.6.5 + ccmake ../dcmtk-3.6.5 + +Now you can modify the configuration values. Please see the help on the bottom +of the screen. When finished, press 'c' to generate a new build configuration, +then quit ccmake. Now you can continue to build by calling 'make' etc. + +If you already know the variable names, types and values to set, you can skip +the 'ccmake' step above and can call 'cmake' directly with the values set. +Example for a build with TCP wrapper disabled: + + mkdir dcmtk-3.6.5-build + cd dcmtk-3.6.5-build + cmake -DDCMTK_WITH_WRAP:BOOL=FALSE ../dcmtk-3.6.5 + ... + +The format is NAME:TYPE=VALUE. Use 'ccmake' to find out the variable names and +their types (BOOL with TRUE/FALSE or STRING). Some of the more important +variables are: + + - BUILD_APPS: Build the DCMTK command line tools? Default: ON. + - BUILD_SHARED_LIBS: Build the DCMTK libraries as shared libraries? + Default: OFF. + - CMAKE_BUILD_TYPE: Debug or Release build, default: Release. + - CMAKE_INSTALL_PREFIX: Installation prefix, default: /usr/local. + - DCMTK_ENABLE_BUILTIN_DICTIONARY: Activate the built-in DICOM data + dictionary? Default: ON on Windows, OFF on Linux/Posix. + - DCMTK_ENABLE_CXX11: Assume the compiler is C++11 compliant. Default: OFF. + - DCMTK_ENABLE_STL: Replace DCMTK's OFString, OFList, OFVector etc. by + the STL classes std::string, std::list, std::vector etc. Default: OFF. + - OPENSSL_ROOT_DIR: Directory where OpenSSL is installed. + Default: search in standard directories for headers and libraries. + + +HTML DOCUMENTATION AND MAN PAGES +================================ + +Most DCMTK modules have been documented with Doxygen (www.doxygen.org), a free +source code documentation system similar to Javadoc. Unix users who have +Doxygen installed can create a hypertext documentation with "make html" in the +"dcmtk-3.6.5" or "doxygen" directory; Windows and other CMake users should +build the "DOXYGEN" subproject. A project file for Microsoft's HTML Help +Workshop can also be generated allowing to create a single CHM file (compressed +HTML) from the documentation. Other output formats (e.g. LaTeX) can be enabled +by changing the configuration file in the "doxygen" directory. + +At the current time, dcmfg, dcmiod, dcmimage, dcmimgle, dcmjpeg, dcmpmap, +dcmpstat, dcmrt, dcmseg, dcmsign, dcmsr, dcmtls, dcmtract, dcmwlm and ofstd are +completely documented; dcmdata, dcmjpls, dcmnet and oflog are almost completely +documented. See FAQ entry: "Where is rest of the documentation?" + +On Unix platforms, man pages for all command line tools are installed during +the "make install" step. In order to use them, just add the directory (e.g. +"/usr/local/share/man") to the MANPATH environment variable and try +"man dcmdump" to check whether it works. + +In order to generate plain text files from the man pages call "make text" in +the "doxygen" directory. The output files are stored in "doxygen/man2text". + + +DICOM DATA DICTIONARY +===================== + +Almost all DCMTK tools and libraries require the so-called DICOM data dictionary +(i.e. information from part 6 of the DICOM standard) to be available in order +to map the attribute tags to their associated Value Representation (VR), Value +Multiplicity (VM) and attribute name (official keyword). The data dictionary +can either be loaded from file (default on Unix systems) or be built into the +respective tool / dcmdata library (default on Windows systems). The default +behavior can be changed using appropriate configuration options. + +Details can be found in the documentation file at "dcmdata/docs/datadict.txt" +(or "/usr/local/share/doc/dcmtk/datadict.txt"). + + +COMPILE-TIME FLAGS AND ENVIRONMENT VARIABLES +============================================ + +The behavior of several DCMTK tools and libraries can be modified by a number +of compile-time flags (macros). Those macros that are not automatically +handled by the configure mechanism are documented in "config/docs/macros.txt" +(or "/usr/local/share/doc/dcmtk/macros.txt"). + +There is also a number of environment variables that affect DCMTK's behavior. +These are documented in "config/docs/envvars.txt" (or "/usr/local/share/doc/ +dcmtk/envvars.txt"). + + +RUNNING THE TEST SUITE +====================== + +DCMTK comes with a test suite that verifies that the toolkit works as expected. +The tests are contained in a module's "tests" subdirectory. Some tests are +marked as exhaustive and are only run if explicitly enabled, see below. + +When using Autoconf for building DCMTK, all tests can be run via "make check". +If a test fails, make will stop and the failure reason of the test which failed +should be visible. Additionally, you may run the exhaustive unit tests by +typing "make check-exhaustive". + +You can also run the test suite with CMake. However, the steps needed for +running the test suite depend on the generator used. The Visual Studio +generators will create a "RUN_TESTS" subproject. Building this project will +call CTest and run all tests. When using the Makefile generator, "make test" +runs the test suite. Additionally, you may run the exhaustive unit tests by +typing "make test-exhaustive". Other generators should use a similar approach. + +For closer inspection, individual tests can be run directly. The Makefiles +will build the test runner for each module as "/tests/tests". CMake +will add the module name as a prefix to this file's name, e.g. "ofstd_tests". +For more information, call this program with the --help option. + + +BUILDING (Unix with Autoconf) +============================= + +Configuring a DCMTK build with GNU Autoconf has been deprecated with DCMTK +release 3.6.5 and will be removed in future releases. In the current release, +the "configure" script in DCMTK's top-level main directory has been removed +as the final warning for users of the Autoconf toolchain. If you prefer to +build DCMTK with Autoconf, however, this is still possible. Perform the +following steps from the top-level (dcmtk-3.6.5) directory to compile and +install the software: + +Step 0: + cd config + ./rootconf + cd .. + +Step 0 creates the configure script in DCMTK's top-level directory. + +Step 1: + ./configure --ignore-deprecation + +Step 1 executes the configure scripts in each subdirectory. First, the system +capabilities are examined and then Makefiles are generated. By default, +executables and other files will be installed (in Step 3) in the directory +"/usr/local" in the corresponding subdirectories. If you wish to use another +install prefix you can use the --prefix= flag to configure. E.g., if you +wish to install underneath your home directory in "~/dicom" then you should +start configure as: + + ./configure --ignore-deprecation --prefix=$HOME/dicom + +Step 1 is also the place where support for the external libraries can be +enabled or disabled. By default, all libraries installed in the standard +path are enabled automatically. Use the --without-openssl switch to disable +OpenSSL support. The --with-opensslinc option allows to specify the directory +in which OpenSSL is installed. This is usually the directory that has been +used as --prefix when compiling and installing OpenSSL. + +For example, if you wish to enable the security enhancements, and OpenSSL is +installed in "/usr/local/apps/openssl-1.1.1d", then you should start configure +as: + + ./configure --ignore-deprecation + --with-opensslinc=/usr/local/apps/openssl-1.1.1d + +Configure will assume that the OpenSSL include files are installed in +"/usr/local/apps/openssl-1.1.1d/include" and will expect the library in +"/usr/local/apps/openssl-1.1.1d/lib". Appropriate options will be passed to +the compiler and the linker. + +Support for zlib, libtiff, libpng, libxml2, libwrap and libiconv can be enabled +in a similar way (in case these libraries are not installed in the standard +path): + + ./configure --ignore-deprecation + --with-libzlibinc=/usr/local/apps/zlib-1.2.11 + --with-libtiffinc=/usr/local/apps/libtiff-4.0.10 + --with-libpnginc=/usr/local/apps/libpng-1.6.37 + --with-libxmlinc=/usr/local/apps/libxml2-2.9.9 + --with-libwrapinc=/usr/local/apps/tcp_wrappers-7.6 + --with-libiconvinc=/usr/local/apps/libiconv-1.15 + + --with-libicuinc=/usr/local/apps/icu-65.1 + +Different configure options can be combined in any order. configure --help +will print a list of all existing configure options. configure --help=short +will display only those options specific to the DCMTK. Useful configure +options are: + + --enable-debug compile with debug code, don't optimize + --disable-debug compile without debug code (default) + --enable-threads=TYPE compile with MT support (posix/solaris/auto=default) + --disable-threads compile without MT support + --enable-lfs=TYPE compile with LFS support (lfs/lfs64/auto=default) + --disable-lfs compile without LFS support + --enable-std-includes use C++ ANSI standard includes + --disable-std-includes use old C++ includes + --enable-private-tags enable private tag dictionary + --disable-private-tags don't enable private tag dictionary (default) + --enable-external-dict enable loading of external dictionary (default) + --disable-external-dict don't load external dictionary + --enable-builtin-dict enable loading of built-in dictionary + --disable-builtin-dict don't load built-in dictionary (default) + --disable-rpath do not hardcode runtime library paths + --enable-charconv=TYPE enable character set conversion support + (libiconv/libicu/stdlibc/auto=default) + --disable-charconv disable character set conversion support + --enable-cxx11 use C++11 + --disable-cxx11 do not use C++11 (default) + --enable-stl use C++ STL + --disable-stl do not use C++ STL (default) + +Step 2: + make all + +Step 2 will build the libraries and executables. If you run into problems see +the section "Solving configuration and compilation problems" below. + +Step 3: + make install + +Step 3 will install the executables and some support files (data dictionary, +configuration and documentation files). If you also wish to install the +libraries and include files then use "make install-lib". For the HTML +documentation (see below) use "make install-html" (requires Doxygen to be +installed); "make install-all" installs all of the above. + +In case the files should be installed in a temporary directory, e.g. in order +to create a distribution package, use "make install DESTDIR=" to prepend + to the installation directories specified for configure. + +Step 4: + make distclean + +Step 4 will revert the source tree to the state prior to Step 1. If you just +want to get rid of object files and local executables use "make clean" instead. + +Note: In case you do not want to compile all modules, you can remove those +modules from the text file "config/modules" prior to Step 1 and execute the +following commands: + + cd config + ./rootconf + cd .. + +This generates a new Makefile and configure script in the top-level toolkit +directory. + +Solving configuration and compilation problems with Autoconf +------------------------------------------------------------ + +The configure script might not be able to guess the correct compiler and +compiler flags to use. For example, we have noticed that use of the -pedantic +flag to the GNU C++ compiler causes compilation errors on some systems due to +system include files with incorrect ANSI function prototypes. + +You can set environment variables to initialize configure before it is called +(before Step 1 above): + + Set environment variable CC to the name of your C compiler. + Set environment variable CFLAGS to the compile flags of your C compiler. + Set environment variable CXX to the name of your C++ compiler. + Set environment variable CXXFLAGS to the compile flags of your C++ compiler. + Set environment variable LDFLAGS to your linker flags. + Set environment variable CPPFLAGS to you preprocessor flags. + +You do not need to specify all the above environment variables since the +default settings are sensible for most Unix compilers. Further influential +environment variables are listed in the output of configure --help. + +If the configure script fails you may have to change the configuration settings +in the config directory. See the "config/docs" directory for more information. + +See also the FAQ at https://forum.dcmtk.org/faq for more hints. + +--------- + +Have fun. + +M. Eichelberg, J. Riesmeier, M. Onken, J. Schlamelcher, P. Arizpe Gomez +DCMTK Development Team, Oldenburg, Germany. + +Last revised: 2019-10-28 (Schlamelcher) diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..84ee6b0d --- /dev/null +++ b/Makefile @@ -0,0 +1,987 @@ +# +# Makefile for dcmtk (DICOM Toolkit) +# + +SHELL = /bin/sh +configdir = config + +include $(configdir)/Makefile.def + +.NOTPARALLEL: + +all: config-all ofstd-all oflog-all dcmdata-all dcmiod-all dcmfg-all dcmseg-all dcmimgle-all dcmimage-all dcmjpeg-all dcmjpls-all dcmtls-all dcmnet-all dcmsr-all dcmsign-all dcmwlm-all dcmqrdb-all dcmpstat-all dcmrt-all dcmtract-all dcmpmap-all + +libsrc-all: ofstd-libsrc-all oflog-libsrc-all dcmdata-libsrc-all dcmiod-libsrc-all dcmfg-libsrc-all dcmseg-libsrc-all dcmimgle-libsrc-all dcmimage-libsrc-all dcmjpeg-libsrc-all dcmjpls-libsrc-all dcmtls-libsrc-all dcmnet-libsrc-all dcmsr-libsrc-all dcmsign-libsrc-all dcmwlm-libsrc-all dcmqrdb-libsrc-all dcmpstat-libsrc-all dcmrt-libsrc-all dcmtract-libsrc-all dcmpmap-libsrc-all + +tests-all: config-tests-all ofstd-tests-all oflog-tests-all dcmdata-tests-all dcmiod-tests-all dcmfg-tests-all dcmseg-tests-all dcmimgle-tests-all dcmimage-tests-all dcmjpeg-tests-all dcmjpls-tests-all dcmtls-tests-all dcmnet-tests-all dcmsr-tests-all dcmsign-tests-all dcmwlm-tests-all dcmqrdb-tests-all dcmpstat-tests-all dcmrt-tests-all dcmtract-tests-all dcmpmap-tests-all + +install: config-install ofstd-install oflog-install dcmdata-install dcmiod-install dcmfg-install dcmseg-install dcmimgle-install dcmimage-install dcmjpeg-install dcmjpls-install dcmtls-install dcmnet-install dcmsr-install dcmsign-install dcmwlm-install dcmqrdb-install dcmpstat-install dcmrt-install dcmtract-install dcmpmap-install dcmtk-install-doc install-man + +install-all: install install-lib install-html + +install-bin: config-install-bin ofstd-install-bin oflog-install-bin dcmdata-install-bin dcmiod-install-bin dcmfg-install-bin dcmseg-install-bin dcmimgle-install-bin dcmimage-install-bin dcmjpeg-install-bin dcmjpls-install-bin dcmtls-install-bin dcmnet-install-bin dcmsr-install-bin dcmsign-install-bin dcmwlm-install-bin dcmqrdb-install-bin dcmpstat-install-bin dcmrt-install-bin dcmtract-install-bin dcmpmap-install-bin + +install-doc: config-install-doc ofstd-install-doc oflog-install-doc dcmdata-install-doc dcmiod-install-doc dcmfg-install-doc dcmseg-install-doc dcmimgle-install-doc dcmimage-install-doc dcmjpeg-install-doc dcmjpls-install-doc dcmtls-install-doc dcmnet-install-doc dcmsr-install-doc dcmsign-install-doc dcmwlm-install-doc dcmqrdb-install-doc dcmpstat-install-doc dcmrt-install-doc dcmtract-install-doc dcmpmap-install-doc + +install-data: config-install-data ofstd-install-data oflog-install-data dcmdata-install-data dcmiod-install-data dcmfg-install-data dcmseg-install-data dcmimgle-install-data dcmimage-install-data dcmjpeg-install-data dcmjpls-install-data dcmtls-install-data dcmnet-install-data dcmsr-install-data dcmsign-install-data dcmwlm-install-data dcmqrdb-install-data dcmpstat-install-data dcmrt-install-data dcmtract-install-data dcmpmap-install-data + +install-etc: config-install-etc ofstd-install-etc oflog-install-etc dcmdata-install-etc dcmiod-install-etc dcmfg-install-etc dcmseg-install-etc dcmimgle-install-etc dcmimage-install-etc dcmjpeg-install-etc dcmjpls-install-etc dcmtls-install-etc dcmnet-install-etc dcmsr-install-etc dcmsign-install-etc dcmwlm-install-etc dcmqrdb-install-etc dcmpstat-install-etc dcmrt-install-etc dcmtract-install-etc dcmpmap-install-etc + +install-lib: config-install-lib ofstd-install-lib oflog-install-lib dcmdata-install-lib dcmiod-install-lib dcmfg-install-lib dcmseg-install-lib dcmimgle-install-lib dcmimage-install-lib dcmjpeg-install-lib dcmjpls-install-lib dcmtls-install-lib dcmnet-install-lib dcmsr-install-lib dcmsign-install-lib dcmwlm-install-lib dcmqrdb-install-lib dcmpstat-install-lib dcmrt-install-lib dcmtract-install-lib dcmpmap-install-lib + +install-include: config-install-include ofstd-install-include oflog-install-include dcmdata-install-include dcmiod-install-include dcmfg-install-include dcmseg-install-include dcmimgle-install-include dcmimage-install-include dcmjpeg-install-include dcmjpls-install-include dcmtls-install-include dcmnet-install-include dcmsr-install-include dcmsign-install-include dcmwlm-install-include dcmqrdb-install-include dcmpstat-install-include dcmrt-install-include dcmtract-install-include dcmpmap-install-include + +install-support: config-install-support ofstd-install-support oflog-install-support dcmdata-install-support dcmiod-install-support dcmfg-install-support dcmseg-install-support dcmimgle-install-support dcmimage-install-support dcmjpeg-install-support dcmjpls-install-support dcmtls-install-support dcmnet-install-support dcmsr-install-support dcmsign-install-support dcmwlm-install-support dcmqrdb-install-support dcmpstat-install-support dcmrt-install-support dcmtract-install-support dcmpmap-install-support + +check: tests-all + $(MAKE) -s check-nosilent + +check-nosilent: config-check ofstd-check oflog-check dcmdata-check dcmiod-check dcmfg-check dcmseg-check dcmimgle-check dcmimage-check dcmjpeg-check dcmjpls-check dcmtls-check dcmnet-check dcmsr-check dcmsign-check dcmwlm-check dcmqrdb-check dcmpstat-check dcmrt-check dcmtract-check dcmpmap-check + +check-exhaustive: tests-all + $(MAKE) -s check-nosilent-exhaustive + +check-nosilent-exhaustive: config-check-exhaustive ofstd-check-exhaustive oflog-check-exhaustive dcmdata-check-exhaustive dcmiod-check-exhaustive dcmfg-check-exhaustive dcmseg-check-exhaustive dcmimgle-check-exhaustive dcmimage-check-exhaustive dcmjpeg-check-exhaustive dcmjpls-check-exhaustive dcmtls-check-exhaustive dcmnet-check-exhaustive dcmsr-check-exhaustive dcmsign-check-exhaustive dcmwlm-check-exhaustive dcmqrdb-check-exhaustive dcmpstat-check-exhaustive dcmrt-check-exhaustive dcmtract-check-exhaustive dcmpmap-check-exhaustive + +dcmtk-install-doc: + $(configdir)/mkinstalldirs $(DESTDIR)$(docdir) + for file in ANNOUNCE CHANGES COPYRIGHT CREDITS FAQ HISTORY VERSION docs/CHANGES.???; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(docdir) ;\ + done + +install-man: + (cd doxygen && $(MAKE) DESTDIR="$(DESTDIR)" install-man) + +install-html: + (cd doxygen && $(MAKE) DESTDIR="$(DESTDIR)" install-html) + +man: + (cd doxygen && $(MAKE) DESTDIR="$(DESTDIR)" man) + +html: + (cd doxygen && $(MAKE) DESTDIR="$(DESTDIR)" html) + +help: + @echo "Some available make targets:" + @echo "" + @echo "all: build all libraries, tests and applications" + @echo "libsrc-all: build all libraries" + @echo "install-all: install the toolkit with its libraries and documentation" + @echo "install: install all applications" + @echo "install-lib: install the libraries" + @echo "install-html: install the HTML documentation" + @echo "html: build the HTML documentation with doxygen" + @echo "man: build the man pages with doxygen" + @echo "check: build and run all tests, not including exhaustive tests" + @echo "check-exhaustive: build and run all tests, including exhaustive tests" + @echo "dependencies: update all Makefile.dep dependency files" + @echo "clean: remove compiler output" + @echo "distclean: remove compiler output and generated build structure" + @echo " (This removes all files generated by configure)" + @echo "" + @echo "Additionally, there are a number of module-specific targets available." + @echo "For example:" + @echo "" + @echo "-all build the complete module" + @echo "-libsrc-all build the module's libraries" + @echo "-install install the module" + @echo "-install-lib install the module's libraries" + @echo "-check build and run the module's tests, not including exhaustive tests" + @echo "-check-exhaustive build and run the module's tests, including exhaustive tests" + @echo "" + @echo "The following modules are available:" + @echo "" + @echo "ofstd oflog dcmdata dcmiod dcmfg dcmseg dcmimgle dcmimage dcmjpeg dcmjpls dcmtls dcmnet dcmsr dcmsign dcmwlm dcmqrdb dcmpstat dcmrt dcmtract dcmpmap" + +config-all: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +config-libsrc-all: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +config-tests-all: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +config-install: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +config-install-bin: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +config-install-doc: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +config-install-data: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +config-install-etc: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +config-install-lib: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +config-install-include: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +config-install-support: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +config-check: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +config-check-exhaustive: + (cd config && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +ofstd-all: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +ofstd-libsrc-all: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +ofstd-tests-all: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +ofstd-install: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +ofstd-install-bin: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +ofstd-install-doc: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +ofstd-install-data: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +ofstd-install-etc: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +ofstd-install-lib: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +ofstd-install-include: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +ofstd-install-support: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +ofstd-check: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +ofstd-check-exhaustive: + (cd ofstd && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +oflog-all: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +oflog-libsrc-all: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +oflog-tests-all: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +oflog-install: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +oflog-install-bin: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +oflog-install-doc: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +oflog-install-data: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +oflog-install-etc: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +oflog-install-lib: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +oflog-install-include: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +oflog-install-support: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +oflog-check: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +oflog-check-exhaustive: + (cd oflog && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmdata-all: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmdata-libsrc-all: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmdata-tests-all: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmdata-install: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmdata-install-bin: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmdata-install-doc: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmdata-install-data: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmdata-install-etc: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmdata-install-lib: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmdata-install-include: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmdata-install-support: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmdata-check: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmdata-check-exhaustive: + (cd dcmdata && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmiod-all: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmiod-libsrc-all: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmiod-tests-all: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmiod-install: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmiod-install-bin: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmiod-install-doc: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmiod-install-data: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmiod-install-etc: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmiod-install-lib: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmiod-install-include: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmiod-install-support: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmiod-check: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmiod-check-exhaustive: + (cd dcmiod && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmfg-all: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmfg-libsrc-all: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmfg-tests-all: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmfg-install: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmfg-install-bin: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmfg-install-doc: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmfg-install-data: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmfg-install-etc: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmfg-install-lib: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmfg-install-include: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmfg-install-support: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmfg-check: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmfg-check-exhaustive: + (cd dcmfg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmseg-all: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmseg-libsrc-all: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmseg-tests-all: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmseg-install: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmseg-install-bin: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmseg-install-doc: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmseg-install-data: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmseg-install-etc: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmseg-install-lib: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmseg-install-include: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmseg-install-support: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmseg-check: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmseg-check-exhaustive: + (cd dcmseg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmimgle-all: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmimgle-libsrc-all: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmimgle-tests-all: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmimgle-install: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmimgle-install-bin: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmimgle-install-doc: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmimgle-install-data: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmimgle-install-etc: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmimgle-install-lib: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmimgle-install-include: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmimgle-install-support: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmimgle-check: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmimgle-check-exhaustive: + (cd dcmimgle && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmimage-all: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmimage-libsrc-all: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmimage-tests-all: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmimage-install: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmimage-install-bin: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmimage-install-doc: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmimage-install-data: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmimage-install-etc: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmimage-install-lib: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmimage-install-include: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmimage-install-support: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmimage-check: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmimage-check-exhaustive: + (cd dcmimage && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmjpeg-all: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmjpeg-libsrc-all: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmjpeg-tests-all: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmjpeg-install: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmjpeg-install-bin: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmjpeg-install-doc: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmjpeg-install-data: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmjpeg-install-etc: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmjpeg-install-lib: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmjpeg-install-include: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmjpeg-install-support: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmjpeg-check: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmjpeg-check-exhaustive: + (cd dcmjpeg && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmjpls-all: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmjpls-libsrc-all: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmjpls-tests-all: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmjpls-install: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmjpls-install-bin: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmjpls-install-doc: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmjpls-install-data: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmjpls-install-etc: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmjpls-install-lib: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmjpls-install-include: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmjpls-install-support: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmjpls-check: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmjpls-check-exhaustive: + (cd dcmjpls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmtls-all: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmtls-libsrc-all: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmtls-tests-all: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmtls-install: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmtls-install-bin: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmtls-install-doc: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmtls-install-data: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmtls-install-etc: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmtls-install-lib: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmtls-install-include: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmtls-install-support: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmtls-check: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmtls-check-exhaustive: + (cd dcmtls && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmnet-all: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmnet-libsrc-all: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmnet-tests-all: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmnet-install: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmnet-install-bin: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmnet-install-doc: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmnet-install-data: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmnet-install-etc: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmnet-install-lib: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmnet-install-include: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmnet-install-support: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmnet-check: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmnet-check-exhaustive: + (cd dcmnet && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmsr-all: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmsr-libsrc-all: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmsr-tests-all: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmsr-install: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmsr-install-bin: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmsr-install-doc: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmsr-install-data: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmsr-install-etc: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmsr-install-lib: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmsr-install-include: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmsr-install-support: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmsr-check: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmsr-check-exhaustive: + (cd dcmsr && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmsign-all: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmsign-libsrc-all: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmsign-tests-all: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmsign-install: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmsign-install-bin: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmsign-install-doc: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmsign-install-data: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmsign-install-etc: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmsign-install-lib: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmsign-install-include: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmsign-install-support: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmsign-check: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmsign-check-exhaustive: + (cd dcmsign && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmwlm-all: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmwlm-libsrc-all: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmwlm-tests-all: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmwlm-install: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmwlm-install-bin: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmwlm-install-doc: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmwlm-install-data: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmwlm-install-etc: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmwlm-install-lib: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmwlm-install-include: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmwlm-install-support: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmwlm-check: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmwlm-check-exhaustive: + (cd dcmwlm && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmqrdb-all: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmqrdb-libsrc-all: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmqrdb-tests-all: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmqrdb-install: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmqrdb-install-bin: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmqrdb-install-doc: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmqrdb-install-data: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmqrdb-install-etc: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmqrdb-install-lib: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmqrdb-install-include: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmqrdb-install-support: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmqrdb-check: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmqrdb-check-exhaustive: + (cd dcmqrdb && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmpstat-all: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmpstat-libsrc-all: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmpstat-tests-all: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmpstat-install: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmpstat-install-bin: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmpstat-install-doc: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmpstat-install-data: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmpstat-install-etc: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmpstat-install-lib: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmpstat-install-include: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmpstat-install-support: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmpstat-check: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmpstat-check-exhaustive: + (cd dcmpstat && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmrt-all: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmrt-libsrc-all: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmrt-tests-all: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmrt-install: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmrt-install-bin: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmrt-install-doc: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmrt-install-data: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmrt-install-etc: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmrt-install-lib: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmrt-install-include: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmrt-install-support: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmrt-check: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmrt-check-exhaustive: + (cd dcmrt && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmtract-all: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmtract-libsrc-all: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmtract-tests-all: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmtract-install: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmtract-install-bin: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmtract-install-doc: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmtract-install-data: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmtract-install-etc: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmtract-install-lib: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmtract-install-include: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmtract-install-support: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmtract-check: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmtract-check-exhaustive: + (cd dcmtract && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dcmpmap-all: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" all) + +dcmpmap-libsrc-all: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" libsrc-all) + +dcmpmap-tests-all: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" tests-all) + +dcmpmap-install: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install) + +dcmpmap-install-bin: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-bin) + +dcmpmap-install-doc: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-doc) + +dcmpmap-install-data: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-data) + +dcmpmap-install-etc: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-etc) + +dcmpmap-install-lib: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-lib) + +dcmpmap-install-include: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-include) + +dcmpmap-install-support: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" install-support) + +dcmpmap-check: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check) + +dcmpmap-check-exhaustive: + (cd dcmpmap && $(MAKE) ARCH="$(ARCH)" DESTDIR="$(DESTDIR)" check-exhaustive) + +dependencies: + -(cd config && $(MAKE) dependencies) + (cd ofstd && $(MAKE) dependencies) + (cd oflog && $(MAKE) dependencies) + (cd dcmdata && $(MAKE) dependencies) + (cd dcmiod && $(MAKE) dependencies) + (cd dcmfg && $(MAKE) dependencies) + (cd dcmseg && $(MAKE) dependencies) + (cd dcmimgle && $(MAKE) dependencies) + (cd dcmimage && $(MAKE) dependencies) + (cd dcmjpeg && $(MAKE) dependencies) + (cd dcmjpls && $(MAKE) dependencies) + (cd dcmtls && $(MAKE) dependencies) + (cd dcmnet && $(MAKE) dependencies) + (cd dcmsr && $(MAKE) dependencies) + (cd dcmsign && $(MAKE) dependencies) + (cd dcmwlm && $(MAKE) dependencies) + (cd dcmqrdb && $(MAKE) dependencies) + (cd dcmpstat && $(MAKE) dependencies) + (cd dcmrt && $(MAKE) dependencies) + (cd dcmtract && $(MAKE) dependencies) + (cd dcmpmap && $(MAKE) dependencies) + +clean: + (cd ofstd && $(MAKE) clean) + (cd oflog && $(MAKE) clean) + (cd dcmdata && $(MAKE) clean) + (cd dcmiod && $(MAKE) clean) + (cd dcmfg && $(MAKE) clean) + (cd dcmseg && $(MAKE) clean) + (cd dcmimgle && $(MAKE) clean) + (cd dcmimage && $(MAKE) clean) + (cd dcmjpeg && $(MAKE) clean) + (cd dcmjpls && $(MAKE) clean) + (cd dcmtls && $(MAKE) clean) + (cd dcmnet && $(MAKE) clean) + (cd dcmsr && $(MAKE) clean) + (cd dcmsign && $(MAKE) clean) + (cd dcmwlm && $(MAKE) clean) + (cd dcmqrdb && $(MAKE) clean) + (cd dcmpstat && $(MAKE) clean) + (cd dcmrt && $(MAKE) clean) + (cd dcmtract && $(MAKE) clean) + (cd dcmpmap && $(MAKE) clean) + (cd doxygen && $(MAKE) clean) + -(cd config && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd ofstd && $(MAKE) distclean) + (cd oflog && $(MAKE) distclean) + (cd dcmdata && $(MAKE) distclean) + (cd dcmiod && $(MAKE) distclean) + (cd dcmfg && $(MAKE) distclean) + (cd dcmseg && $(MAKE) distclean) + (cd dcmimgle && $(MAKE) distclean) + (cd dcmimage && $(MAKE) distclean) + (cd dcmjpeg && $(MAKE) distclean) + (cd dcmjpls && $(MAKE) distclean) + (cd dcmtls && $(MAKE) distclean) + (cd dcmnet && $(MAKE) distclean) + (cd dcmsr && $(MAKE) distclean) + (cd dcmsign && $(MAKE) distclean) + (cd dcmwlm && $(MAKE) distclean) + (cd dcmqrdb && $(MAKE) distclean) + (cd dcmpstat && $(MAKE) distclean) + (cd dcmrt && $(MAKE) distclean) + (cd dcmtract && $(MAKE) distclean) + (cd dcmpmap && $(MAKE) distclean) + (cd doxygen && $(MAKE) distclean) + -(cd config && $(MAKE) distclean) + rm -f $(TRASH) + diff --git a/README b/README new file mode 100644 index 00000000..5dcb0ff6 --- /dev/null +++ b/README @@ -0,0 +1,58 @@ + +DCMTK + +This DICOM ToolKit (DCMTK) package consists of source code, documentation +and installation instructions for a set of software libraries and +applications implementing part of the DICOM/MEDICOM Standard. + +DCMTK contains the following sub-packages, each in its own sub-directory: + + config - configuration utilities for DCMTK + dcmdata - a data encoding/decoding library and utility apps + dcmfg - a library for working with functional groups + dcmimage - adds support for color images to dcmimgle + dcmimgle - an image processing library and utility apps + dcmiod - a library for working with information objects and modules + dcmjpeg - a compression/decompression library and utility apps + dcmjpls - a compression/decompression library and utility apps + dcmnet - a networking library and utility apps + dcmpmap - a library for working with parametric map objects + dcmpstat - a presentation state library and utility apps + dcmqrdb - an image database server + dcmrt - a radiation therapy library and utility apps + dcmseg - a library for working with segmentation objects + dcmsign - a digital signature library and utility apps + dcmsr - a structured reporting library and utility apps + dcmtls - security extensions for the network library + dcmtract - a library for working with tractography results + dcmwlm - a modality worklist database server + oflog - a logging library based on log4cplus + ofstd - a library of general purpose classes + +Each sub-directory (except config) contains further sub-directories for +application source code (apps), library source code (libsrc), library +include files (include), configuration data (etc), documentation (docs), +sample and support data (data) as well as test programs (tests). + +To build and install the DCMTK package see the INSTALL file. For copyright +information see the COPYRIGHT file. For information about the history of +this software see the HISTORY file. For answers to frequently asked +questions please consult the FAQ: + + http://forum.dcmtk.org/faq/ + +In addition to the API documentation, there is also a Wiki system where +further information (e.g. HOWTOs) can be found: + + http://support.dcmtk.org/wiki/ + +If you find bugs or other problems with this software, we would appreciate +hearing about them. Please send electronic mail to: + + bugs/at/dcmtk/dot/org + +Please try to describe the problem in detail and if possible give a +suggested fix. For general questions on how to compile, install or use +the toolkit we recommend the public discussion forum at: + + http://forum.dcmtk.org/ diff --git a/README.md b/README.md new file mode 100644 index 00000000..51844783 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# DCMTK + +This DICOM ToolKit (DCMTK) package consists of source code, documentation and installation instructions for a set of software libraries and applications implementing part of the DICOM/MEDICOM Standard. + +DCMTK contains the following sub-packages, each in its own sub-directory: + +- **config** - configuration utilities for DCMTK +- **dcmdata** - a data encoding/decoding library and utility apps +- **dcmfg** - a library for working with functional groups +- **dcmimage** - adds support for color images to dcmimgle +- **dcmimgle** - an image processing library and utility apps +- **dcmiod** - a library for working with information objects and modules +- **dcmjpeg** - a compression/decompression library and utility apps +- **dcmjpls** - a compression/decompression library and utility apps +- **dcmnet** - a networking library and utility apps +- **dcmpmap** - a library for working with parametric map objects +- **dcmpstat** - a presentation state library and utility apps +- **dcmqrdb** - an image database server +- **dcmrt** - a radiation therapy library and utility apps +- **dcmseg** - a library for working with segmentation objects +- **dcmsign** - a digital signature library and utility apps +- **dcmsr** - a structured reporting library and utility apps +- **dcmtls** - security extensions for the network library +- **dcmtract** - a library for working with tractography results +- **dcmwlm** - a modality worklist database server +- **oflog** - a logging library based on log4cplus +- **ofstd** - a library of general purpose classes + +Each sub-directory (except _config_) contains further sub-directories for application source code (_apps_), library source code (_libsrc_), library include files (_include_), configuration data (_etc_), documentation (_docs_), sample and support data (_data_) as well as test programs (_tests_). + +To build and install the DCMTK package see the [INSTALL](INSTALL) file. For copyright information see the [COPYRIGHT](COPYRIGHT) file. For information about the history of this software see the [HISTORY](HISTORY) file. For answers to frequently asked questions please consult the [FAQ](http://forum.dcmtk.org/faq/). + +In addition to the API documentation, which is also available [online](https://support.dcmtk.org/docs/), there is a [Wiki](http://support.dcmtk.org/wiki/) system where further information (e.g. HOWTOs) can be found. + +If you find bugs or other problems with this software, we would appreciate hearing about them. Please send electronic mail to: bugs/at/dcmtk/dot/org + +Please try to describe the problem in detail and if possible give a suggested fix. For general questions on how to compile, install or use the toolkit we recommend the [public discussion forum](http://forum.dcmtk.org/). diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..d15b8b06 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +3.6.5 diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt new file mode 100644 index 00000000..9578c354 --- /dev/null +++ b/config/CMakeLists.txt @@ -0,0 +1,5 @@ +# declare project +project(config) + +# recurse into subdirectories +add_subdirectory(docs) diff --git a/config/Makefile.def.in b/config/Makefile.def.in new file mode 100644 index 00000000..fe1b0f58 --- /dev/null +++ b/config/Makefile.def.in @@ -0,0 +1,107 @@ +# +# Makefile.def.in for all toolkit code +# The use of the following code requires: +# (a) definition of srcdir +# (b) definition of VPATH without using any Makefile variables (optional) +# (c) definition of LOCALDEFS an LOCALDEBUG (optional) +# + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ + +bindir = @bindir@ +etcdir = @sysconfdir@ +datadir = @datadir@ +docdir = @docdir@ +mandir = @mandir@ +man1dir = @mandir@/man1 +htmldir = @htmldir@ +pdfdir = @pdfdir@ +libdir = @libdir@ +includedir = @includedir@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ + +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_DATE = @PACKAGE_DATE@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_NUMBER = @PACKAGE_VERSION_NUMBER@ +PACKAGE_VERSION_SUFFIX = @PACKAGE_VERSION_SUFFIX@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ + +# +# Definition of dependencies file +# + +DEP = Makefile.dep + +# Toolkit wide definitions for DEBUGGING +# +# -DDEBUG Compile with debug code and assertions +# -DNDEBUG Compile without debug code and assertions + +DEBUG = @DEBUG@ + +# +# Global definitions +# + +# We want the old behavior of OFString(NULL) for now, no crashes. +GLOBALDEFS = @DEFS@ -DUSE_NULL_SAFE_OFSTRING -DDCMTK_BUILD_IN_PROGRESS +# -DDCMTK_BUILD_DATE=\"YYYY-MM-DD\" + +# +# ARCH defines special machine architecture compiler settings +# (e.g. -arch i386 on NeXT) +# + +# ARCH = + +CC = @CC@ +CFLAGS = @CFLAGS@ +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +RANLIB = @RANLIB@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +LIBS = @LIBS@ +MATHLIBS = @MATHLIBS@ +OPENSSLLIBS = @OPENSSLLIBS@ +TIFFLIBS = @TIFFLIBS@ +PNGLIBS = @PNGLIBS@ +ZLIBLIBS = @ZLIBLIBS@ +XMLLIBS = @XMLLIBS@ +TCPWRAPPERLIBS = @TCPWRAPPERLIBS@ +SNDFILELIBS = @SNDFILELIBS@ +CHARCONVLIBS = @CHARCONVLIBS@ +LIBEXT = @LIBEXT@ +BINEXT = @BINEXT@ +STRIP = @STRIP@ + +# +# for clean and distclean +# +TRASH = *~ "\#*\#" *.bak core +DISTTRASH = $(TRASH) Makefile *.cache *.log *.status + +includes = -I. -I$(srcdir) -I$(top_srcdir)/include -I$(configdir)/include $(LOCALINCLUDES) @CHARCONVINCLUDES@ +defines = $(GLOBALDEFS) $(LOCALDEFS) $(DEBUG) $(LOCALDEBUG) + + +.SUFFIXES: +.SUFFIXES: .o .cc .c .h + +.cc.o: + $(CXX) $(defines) -c $(includes) $(ARCH) \ + $(CPPFLAGS) $(CXXFLAGS) $< + +.c.o: + $(CC) $(defines) -c $(includes) $(ARCH) \ + $(CPPFLAGS) $(CFLAGS) $< diff --git a/config/Makefile.in b/config/Makefile.in new file mode 100644 index 00000000..ad1e5111 --- /dev/null +++ b/config/Makefile.in @@ -0,0 +1,69 @@ +# +# Makefile for config +# + +@SET_MAKE@ + +SHELL = /bin/sh + +include @common_makefile@ + + +all: include/dcmtk/config/arith.h + +install: install-doc + +install-bin: + +install-doc: docs-install + +install-data: + +install-etc: + +install-include: include-install + +install-lib: include-install + +install-support: + + +libsrc-all: + +tests-all: all + + +check: tests-all + +check-exhaustive: tests-all + + +include-install: + ./mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/config + $(INSTALL_DATA) include/dcmtk/config/osconfig.h $(DESTDIR)$(includedir)/dcmtk/config + $(INSTALL_DATA) include/dcmtk/config/arith.h $(DESTDIR)$(includedir)/dcmtk/config + +docs-install: + ./mkinstalldirs $(DESTDIR)$(docdir) + $(INSTALL_DATA) docs/config.txt $(DESTDIR)$(docdir) + $(INSTALL_DATA) docs/envvars.txt $(DESTDIR)$(docdir) + $(INSTALL_DATA) docs/modules.txt $(DESTDIR)$(docdir) + $(INSTALL_DATA) docs/dirstruc.txt $(DESTDIR)$(docdir) + $(INSTALL_DATA) docs/macros.txt $(DESTDIR)$(docdir) + + +clean: + (cd include/dcmtk/config && rm -f $(TRASH)) + rm -rf $(TRASH) + +distclean: + (cd include/dcmtk/config && rm -f $(DISTTRASH) osconfig.h arith.h) + rm -rf $(DISTTRASH) Makefile.def lzwtest.tif arith + +include/dcmtk/config/arith.h: arith + ./arith $@ + +arith: tests/arith.cc + $(CXX) $(CXXFLAGS) -Iinclude -I../ofstd/include -I../ofstd/libsrc -o$@ tests/$@.cc + +dependencies: include/dcmtk/config/arith.h diff --git a/config/aclocal.m4 b/config/aclocal.m4 new file mode 100644 index 00000000..4641a4c0 --- /dev/null +++ b/config/aclocal.m4 @@ -0,0 +1,2052 @@ +dnl +dnl Filename: aclocal.m4 +dnl +dnl Purpose: additional M4 macros for GNU autoconf +dnl +dnl Authors: Andreas Barth, Marco Eichelberg +dnl + + +dnl AC_CHECK_GXXLIB works like AC_CHECK_LIB, but for libg++. +dnl This additional macro is necessary because the /bin/sh will +dnl not allow you to define a variable "ac_cv_lib_g++" and +dnl thus AC_CHECK_LIB will fail for libg++. +dnl All symbols #defined by this macro replace G++ by GXX. + +dnl AC_CHECK_GXXLIB +AC_DEFUN(AC_CHECK_GXXLIB, +[AC_MSG_CHECKING([for -lg++]) +AC_CACHE_VAL(ac_cv_lib_gxx, +[ac_save_LIBS="$LIBS" +LIBS="-lg++ $LIBS" +AC_TRY_LINK(, [main()], eval "ac_cv_lib_gxx=yes", eval "ac_cv_lib_gxx=no") +LIBS="$ac_save_LIBS" +])dnl +if eval "test \"`echo '$ac_cv_lib_gxx'`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$3], , +[changequote(, )dnl + ac_tr_lib=HAVE_LIBGXX +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_lib) + LIBS="-lg++ $LIBS" +], [$3]) +else + AC_MSG_RESULT(no) +ifelse([$4], , , [$4 +])dnl +fi +]) + +dnl AC_CHECK_PROTOTYPE checks if there is a prototype declaration +dnl for the given function. If header file(s) are given as argument 2, they +dnl are #included in the search. Otherwise only predefined functions will +dnl be found. The header files are only included in the search if they +dnl have already been found using the AC_CHECK_HEADERS(header) macro. +dnl Note: +dnl Since GNU autoheader does not support this macro, you must create entries +dnl in your acconfig.h for each function which is tested. +dnl Examples: +dnl in configure.in: +dnl AC_CHECK_PROTOTYPE(setsockopt, sys/types.h sys/socket.h) +dnl AC_CHECK_PROTOTYPE(gethostid) +dnl in acconfig.h: +dnl #undef HAVE_PROTOTYPE_SETSOCKOPT +dnl #undef HAVE_PROTOTYPE_GETHOSTID + +dnl AC_CHECK_PROTOTYPE(FUNCTION, HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_PROTOTYPE, +[AC_MSG_CHECKING([ifelse([$2], , [predefined prototype for $1], [prototype for $1 (in $2)])]) +AH_TEMPLATE(AS_TR_CPP(HAVE_PROTOTYPE_$1), [Define if your system has a prototype for $1 in $2.]) +ifelse([$3], , :, [$3]) + +ifelse([$2], , [ac_includes="" +], +[ac_includes="" +for ac_header in $2 +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done]) +tmp_save_1=`echo $1 | tr ' :' '__'` +AC_CACHE_VAL(ac_cv_prototype_$tmp_save_1, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct $1(dummyStruct); +] +, ,eval "ac_cv_prototype_$tmp_save_1=no", eval "ac_cv_prototype_$tmp_save_1=yes")])dnl +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED([$ac_tr_prototype]) + ifelse([$3], , :, [$3]) +else + AC_MSG_RESULT(no) +ifelse([$4], , , [$4 +])dnl +fi +]) + +dnl AC_CHECK_COMPILES verifies that the given code fragment can be compiled. +dnl It is assumed that successfully compiling means that the specified +dnl function is available. If header file(s) are given as argument 2, they +dnl #included in the search. Otherwise only predefined functions will be +dnl available. The header files are only included in the search if they have +dnl already been found using the AC_CHECK_HEADERS(header) macro. + +dnl AC_CHECK_COMPILES(FUNCTION, HEADER-FILE..., CODE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_COMPILES, +[AC_MSG_CHECKING([ifelse([$2], , [for $1], [for $1 (in $2)])]) +AH_TEMPLATE(AS_TR_CPP(HAVE_PROTOTYPE_$1), [Define if your system has a prototype for $1 in $2.]) +ifelse([$2], , [ac_includes="" +], +[ac_includes="" +for ac_header in $2 +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done]) +tmp_save_1=`echo $1 | tr ' :' '__'` +AC_CACHE_VAL(ac_cv_compiles_$tmp_save_1, +[AC_TRY_COMPILE([$ac_includes], [$3], +eval "ac_cv_compiles_$tmp_save_1=yes", eval "ac_cv_compiles_$tmp_save_1=no")])dnl +if eval "test \"`echo '$''{'ac_cv_compiles_$tmp_save_1'}'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED([$ac_tr_prototype]) + ifelse([$4], , :, [$4]) +else + AC_MSG_RESULT(no) +ifelse([$5], , , [$5 +])dnl +fi +]) + +dnl AC_CHECK_DECLARATION checks if a certain type is declared in the include files given as argument 2 or 3. +dnl Files given as argument 2 are included extern "C" in C++ mode, +dnl files given as argument 3 are included "as is". +dnl Header files are only included in the search if they +dnl have already been found using the AC_CHECK_HEADERS(header) macro. + +dnl AC_CHECK_DECLARATION(FUNCTION, C-HEADER-FILE..., C++-HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_DECLARATION, +[ +AC_MSG_CHECKING([ifelse([$2 $3], , [predefined type $1], [ifelse([$2], , [declaration for $1 (in $3)], [ifelse([$3], , [declaration for $1 (in $2)], [declaration for $1 (in $2 $3)])])])]) +AH_TEMPLATE(AS_TR_CPP(HAVE_DECLARATION_$1), [Define if your system has a declaration for $1 in $2 $3.]) +ifelse([$2], , [ac_includes="" +], +[ac_includes="" +for ac_header in $2 +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +]) +ifelse([$3], , [ac_cpp_includes="" +], +[ac_cpp_includes="" +for ac_header in $3 +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_cpp_includes="$ac_cpp_includes +#include<$ac_header>" + fi +done +]) +[ac_cv_declaration=`echo 'ac_cv_declaration_$1' | tr ' :' '__'` +] +AC_CACHE_VAL($ac_cv_declaration, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +$ac_cpp_includes +$1 dummy; +] +, ,eval "$ac_cv_declaration=yes", eval "$ac_cv_declaration=no")])dnl +if eval "test \"\$$ac_cv_declaration\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_declaration=HAVE_DECLARATION_`echo $1 | tr ' :[a-z]' '__[A-Z]'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED([$ac_tr_declaration]) + ifelse([$4], , :, [$4]) +else + AC_MSG_RESULT(no) +ifelse([$5], , , [$5 +])dnl +fi +unset ac_cv_declaration +]) + + +dnl AC_CHECK_INTP_SELECT checks if the prototype for select() +dnl specifies arguments 2-4 to be int* instead of struct fd_set *. +dnl This is true for HP UX 9.x and causes C++ code to break. + +dnl AC_CHECK_INTP_SELECT(HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_INTP_SELECT, +[AC_MSG_CHECKING([ifelse([$1], , [if select() needs int* parameters], +[if select() needs int* parameters (in $1)])]) +AH_TEMPLATE([HAVE_INTP_SELECT], [Define if your system declares argument 2-4 of select() + as int * instead of struct fd_set *.]) +ifelse([$1], , [ac_includes="" +], +[ac_includes="" +for ac_header in $1 +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done]) +AC_CACHE_VAL(ac_cv_prototype_intp_select, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +] +, +[ + int i; + fd_set fds; + i = select(1, &fds, &fds, &fds, NULL); +], +eval "ac_cv_prototype_intp_select=no", +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +] +, +[ + int i; + int fds; + i = select(1, &fds, &fds, &fds, NULL); +], +eval "ac_cv_prototype_intp_select=yes", eval "ac_cv_prototype_intp_select=no")])]) +if eval "test \"`echo $ac_cv_prototype_intp_select`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_INTP_SELECT +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) +fi +]) + + + +dnl AC_TRY_COMPILE_AND_LINK compiles a Source file into an object file +dnl and links the object file. This can create a different behaviour +dnl than compiling and linking the object file directly (e.g. +dnl Sun C++ 3.0.1 with template functions) + +dnl AC_TRY_COMPILE_AND_LINK(SOURCE, MAIN_BODY +dnl [, ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_TRY_COMPILE_AND_LINK, +[ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&AC_FD_CC' +cat > conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ifelse([$4], , , [ rm -rf conftest* + $4 + ])dnl + fi +else + echo "configure: failed compile was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* + $4 +])dnl +fi +rm -f conftest*]) + +dnl AC_CHECK_STD_NAMESPACE checks if the C++-Compiler supports the +dnl standard name space. + +dnl AC_CHECK_STD_NAMESPACE +AC_DEFUN(AC_CHECK_STD_NAMESPACE, +[AC_MSG_CHECKING([for C++ standard namespace]) +AH_TEMPLATE([HAVE_STD_NAMESPACE], [Define if ANSI standard C++ includes use std namespace.]) +AC_CACHE_VAL(ac_cv_check_std_namespace, +[AC_TRY_COMPILE_AND_LINK([ +#include +using namespace std; +],[ + cout << "Hello World" << endl; +], eval "ac_cv_check_std_namespace=yes", eval "ac_cv_check_std_namespace=no")dnl +])dnl +if eval "test \"`echo '$ac_cv_check_std_namespace'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_std_namespace=HAVE_STD_NAMESPACE +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_std_namespace) +else + AC_MSG_RESULT(no) +fi +]) + + + +dnl AC_CHECK_CLASS_TEMPLATE checks if the C++-Compiler is capable of +dnl using class templates in the easiest form i. e. all methods are +dnl inline, no template methods and no typedefs in the class + +dnl AC_CHECK_CLASS_TEMPLATE +AC_DEFUN(AC_CHECK_CLASS_TEMPLATE, +[AC_MSG_CHECKING([for C++ class template]) +AH_TEMPLATE([HAVE_CLASS_TEMPLATE], [Define if your C++ compiler can work with class templates.]) +AC_CACHE_VAL(ac_cv_check_class_template, +[AC_TRY_COMPILE_AND_LINK([ +template +class x +{ +private: + T a; +public: + void set(T i) { a = i; } + x(T i) { set(i); } + T get() { return a; } +}; +],[ + int i; + x a(4); + i = a.get(); + a.set(18); + i = a.get(); + a.set(i-1); +], eval "ac_cv_check_class_template=yes", eval "ac_cv_check_class_template=no")dnl +])dnl +if eval "test \"`echo '$ac_cv_check_class_template'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_class_template=HAVE_CLASS_TEMPLATE +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_class_template) +else + AC_MSG_RESULT(no) +fi +]) + + + +dnl AC_CHECK_FUNCTION_TEMPLATE checks if the C++-Compiler is capable of +dnl using function templates. + +dnl AC_CHECK_FUNCTION_TEMPLATE +AC_DEFUN(AC_CHECK_FUNCTION_TEMPLATE, +[AC_MSG_CHECKING([for C++ function template]) +AH_TEMPLATE([HAVE_FUNCTION_TEMPLATE], [Define if your C++ compiler can work with function templates.]) +AC_CACHE_VAL(ac_cv_check_function_template, +[AC_TRY_COMPILE_AND_LINK([ +template +int f(T* a) +{ + if (a) return 1; + return 0; +} +],[ + int i, a; + i = f(&a); +], eval "ac_cv_check_function_template=yes", eval "ac_cv_check_function_template=no")dnl +])dnl +if eval "test \"`echo '$ac_cv_check_function_template'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_function_template=HAVE_FUNCTION_TEMPLATE +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_function_template) +else + AC_MSG_RESULT(no) +fi +]) + + +dnl AC_CHECK_STATIC_TEMPLATE_METHOD checks if the C++-Compiler is capable of +dnl using static methods in template classes + +dnl AC_CHECK_STATIC_TEMPLATE_METHOD +AC_DEFUN(AC_CHECK_STATIC_TEMPLATE_METHOD, +[AC_MSG_CHECKING([for C++ static methods in class templates]) +AH_TEMPLATE([HAVE_STATIC_TEMPLATE_METHOD], [Define if your C++ compiler can work with static methods in class templates.]) +AC_CACHE_VAL(ac_cv_check_static_template_method, +[AC_TRY_COMPILE_AND_LINK([ +void additive(int & i) +{ + i++; +} + +template +class x +{ +public: + x() { } + static void do1(Function f, int & a) { f(a); } + static void do2(T b) { T a = b; }; +}; +],[ + int a = 1; + x::do1(additive, a); + x::do2(a); +], eval "ac_cv_check_static_template_method=yes", eval "ac_cv_check_static_template_method=no")dnl +])dnl +if eval "test \"`echo '$ac_cv_check_static_template_method'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_static_template_method=HAVE_STATIC_TEMPLATE_METHOD +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_static_template_method) +else + AC_MSG_RESULT(no) +fi +]) + + +dnl AC_CHECK_EXPLICIT_TEMPLATE_SPECIALIZATION checks if the C++-Compiler +dnl supports the explicit template specialization syntax, i.e. +dnl template<> int classname::functionname() + +dnl AC_CHECK_EXPLICIT_TEMPLATE_SPECIALIZATION +AC_DEFUN(AC_CHECK_EXPLICIT_TEMPLATE_SPECIALIZATION, +[AC_MSG_CHECKING([for C++ explicit template specialization syntax]) +AH_TEMPLATE([HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION], [Define if your C++ compiler supports the explicit template specialization syntax.]) +AC_CACHE_VAL(ac_cv_check_explicit_template_specialization, +[AC_TRY_COMPILE([ +template +class X +{ + public: + int fn(); +}; + +template<> +int X::fn() +{ + return 0; +} +],[X x], eval "ac_cv_check_explicit_template_specialization=yes", eval "ac_cv_check_explicit_template_specialization=no")dnl +])dnl +if eval "test \"`echo '$ac_cv_check_explicit_template_specialization'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_explicit_template_specialization=HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_explicit_template_specialization) +else + AC_MSG_RESULT(no) +fi +]) + + +dnl AC_CHECK_GNU_LIBTOOL checks whether libtool is GNU libtool. +dnl This macro requires that 'libtool' exists in the current path, +dnl i.e. AC_CHECK_PROGS(LIBTOOL, libtool, :) should be executed and evaluated +dnl before performing this test. +dnl If libtool is identified as GNU libtool, the environment variable $ac_cv_check_gnu_libtool +dnl is set to the value "yes", otherwise to "no". +dnl +dnl AC_CHECK_GNU_LIBTOOL +AC_DEFUN(AC_CHECK_GNU_LIBTOOL, +[AC_MSG_CHECKING([whether libtool is GNU libtool]) +AC_CACHE_VAL(ac_cv_check_gnu_libtool, +[ ac_cv_check_gnu_libtool=`libtool --version 2>/dev/null | grep "GNU libtool" | sed -e "s/.*\(GNU libtool\).*/\1/" ` + if test "${ac_cv_check_gnu_libtool}set" = "GNU libtoolset" ; then + ac_cv_check_gnu_libtool=yes + else + ac_cv_check_gnu_libtool=no + fi +]) + if test $ac_cv_check_gnu_libtool = yes ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +]) + + + +dnl AC_CHECK_HEADER_WITH_INCLUDES works like AC_CHECK_HEADER but allows to specify +dnl additional code to be put into the test program before the #include statement +dnl generated by AC_CHECK_HEADER. +dnl Typically this additional code will be additional #include statements. +dnl For example, on Irix 6, cannot be included if is not +dnl included before (leads to parse error). +dnl +dnl AC_CHECK_HEADER_WITH_INCLUDES(HEADER-FILE, [INCLUDES, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +AC_DEFUN(AC_CHECK_HEADER_WITH_INCLUDES, +[dnl Do the transliteration at runtime so arg 1 can be a shell variable. +ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(ac_cv_header_$ac_safe, +[AC_TRY_CPP([$2 +#include <$1>], eval "ac_cv_header_$ac_safe=yes", + eval "ac_cv_header_$ac_safe=no")])dnl +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$3], , :, [$3]) +else + AC_MSG_RESULT(no) +ifelse([$4], , , [$4 +])dnl +fi +]) + +dnl AC_CHECK_HEADERS_WITH_INCLUDES works like AC_CHECK_HEADERS but allows to specify +dnl additional code to be put into the test program before the #include statement +dnl generated by AC_CHECK_HEADERS. +dnl Typically this additional code will be additional #include statements. +dnl For example, on Irix 6, cannot be included if is not +dnl included before (leads to parse error). +dnl +dnl AC_CHECK_HEADERS_WITH_INCLUDES(HEADER-FILE..., [INCLUDES, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +AC_DEFUN(AC_CHECK_HEADERS_WITH_INCLUDES, +[for ac_hdr in $1 +do +AC_CHECK_HEADER_WITH_INCLUDES($ac_hdr, $2, +[changequote(, )dnl + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_hdr) $3], $4)dnl +done +]) + + +dnl AC_CHECK_POLL_H checks if we have a usable . +dnl poll on macOS is unreliable, it first did not exist, then was broken until +dnl fixed in 10.9 only to break again in 10.12. +dnl +dnl AC_CHECK_POLL_H([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_CHECK_POLL_H, +[ +AC_MSG_CHECKING([for usable poll.h]) +AH_TEMPLATE(AS_TR_CPP(DCMTK_HAVE_POLL), [Define if your system has a usable .]) +AC_CACHE_VAL(ac_cv_header_poll_h, +[ +case "${host}" in + *-*-darwin*) + eval "ac_cv_header_poll_h=no" + ;; + *) + AC_TRY_CPP([#include ], eval "ac_cv_header_poll_h=yes", eval "ac_cv_header_poll_h=no")dnl + ;; +esac +]) +if eval "test \"`echo '$ac_cv_header_poll_h'`\" = yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(DCMTK_HAVE_POLL) + ifelse([$1], , :, [$1]) +else + AC_MSG_RESULT(no) + ifelse([$2], , , [$2]) +fi +]) + + +dnl AC_CHECK_TCP_H +dnl checks for the presence of three system include files: +dnl +dnl +dnl +dnl On certain systems like Irix or NeXT these are interdependent, i.e. +dnl tcp.h can only be included if in.h is included before. This script +dnl accounts for these dependencies. +dnl +dnl Note: GNU autoheader recognizes the includes tested by this macro. +dnl No manual intervention required. +dnl +AC_DEFUN(AC_CHECK_TCP_H, +[AC_CHECK_HEADERS(netinet/in_systm.h) + +if eval "test \"`echo '$ac_cv_header_netinet_in_systm_h'`\" = yes"; then + AC_CHECK_HEADERS_WITH_INCLUDES(netinet/in.h, +#include +) + if eval "test \"`echo '$ac_cv_header_netinet_in_h'`\" = yes"; then + AC_CHECK_HEADERS_WITH_INCLUDES(netinet/tcp.h, +#include +#include +) + else + AC_CHECK_HEADERS_WITH_INCLUDES(netinet/tcp.h, +#include +) + fi +else + AC_CHECK_HEADERS(netinet/in.h) + if eval "test \"`echo '$ac_cv_header_netinet_in_h'`\" = yes"; then + AC_CHECK_HEADERS_WITH_INCLUDES(netinet/tcp.h, +#include +) + else + AC_CHECK_HEADERS(netinet/tcp.h) + fi +fi +]) + +dnl AC_CHECK_INTP_ACCEPT checks if the prototype for accept() +dnl specifies arguments 2-4 to be int* instead of size_t *. + +dnl AC_CHECK_INTP_ACCEPT(HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_INTP_ACCEPT, +[AC_MSG_CHECKING([ifelse([$1], , [if accept() needs int* parameters], +[if accept() needs int* parameters (in $1)])]) +AH_TEMPLATE([HAVE_INTP_ACCEPT], [Define if your system declares argument 3 of accept() + as int * instead of size_t * or socklen_t *.]) +ifelse([$1], , [ac_includes="" +], +[ac_includes="" +for ac_header in $1 +do + ac_includes="$ac_includes +#include<$ac_header>" +done]) +AC_CACHE_VAL(ac_cv_prototype_intp_accept, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +] +, +[ + int i; + struct sockaddr *addr; + size_t addrlen; + + addr = 0; + addrlen = 0; + i = accept(1, addr, &addrlen); +], +eval "ac_cv_prototype_intp_accept=no", +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +] +, +[ + int i; + struct sockaddr *addr; + int addrlen; + + addr = 0; + addrlen = 0; + i = accept(1, addr, &addrlen); +], +eval "ac_cv_prototype_intp_accept=yes", eval "ac_cv_prototype_intp_accept=no")])]) +if eval "test \"`echo $ac_cv_prototype_intp_accept`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_INTP_ACCEPT +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) +fi +]) + + + + +dnl AC_CHECK_PTHREAD_OPTION checks whether the compiler requires the +dnl -pthread option to correctly link code containing posix thread calls. +dnl This is true for example on FreeBSD. +dnl This test assumes that is available. + +dnl If the test is positive, -pthread is added to CFLAGS and CXXFLAGS. + +dnl AC_CHECK_PTHREAD_OPTION +AC_DEFUN(AC_CHECK_PTHREAD_OPTION, +[AC_MSG_CHECKING(whether compiler requires -pthread option for posix threads) +REQUIRES_PTHREAD_OPTION="no" +AC_TRY_LINK( +[#ifdef __cplusplus +extern "C" { +#endif +] +#include +[#ifdef __cplusplus +} +#endif +] +, +[ + (void) pthread_create(NULL, NULL, NULL, NULL); +], , +SAVE_CXXFLAGS="$CXXFLAGS" +SAVE_CFLAGS="$CFLAGS" +CXXFLAGS="-pthread $CXXFLAGS" +CFLAGS="-pthread $CFLAGS" +AC_TRY_LINK( +[#ifdef __cplusplus +extern "C" { +#endif +] +#include +[#ifdef __cplusplus +} +#endif +] +, +[ + (void) pthread_create(NULL, NULL, NULL, NULL); +], +REQUIRES_PTHREAD_OPTION="yes" +, ) +CXXFLAGS="$SAVE_CXXFLAGS" +CFLAGS="$SAVE_CFLAGS" +) + +if test $REQUIRES_PTHREAD_OPTION = yes ; then + AC_MSG_RESULT([yes]) + CXXFLAGS="-pthread $CXXFLAGS" + CFLAGS="-pthread $CFLAGS" +else + AC_MSG_RESULT([no]) +fi +]) + + + +dnl AC_MY_C_INLINE works like the standard script AC_C_INLINE +dnl but defines C_INLINE instead of redefining "inline" directly. + +AC_DEFUN(AC_MY_C_INLINE, +[AH_TEMPLATE([C_INLINE], [Define to the inline keyword supported by the C compiler, if any, or to the empty string]) +AC_CACHE_CHECK([for inline], ac_cv_my_c_inline, +[ac_cv_my_c_inline=no +for ac_kw in inline __inline__ __inline; do + AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_my_c_inline=$ac_kw; break]) +done +]) +case "$ac_cv_my_c_inline" in + inline | yes) AC_DEFINE(C_INLINE, inline) ;; + no) AC_DEFINE(C_INLINE, ) ;; + *) AC_DEFINE_UNQUOTED(C_INLINE, $ac_cv_my_c_inline) ;; +esac +]) + + +dnl AC_MY_C_CONST works like the standard script AC_C_CONST +dnl but defines HAVE_C_CONST instead of redefining "const" directly. + +AC_DEFUN(AC_MY_C_CONST, +[AH_TEMPLATE([HAVE_C_CONST], [Define if "const" is supported by the C compiler.]) +dnl This message is consistent in form with the other checking messages, +dnl and with the result message. +AC_CACHE_CHECK([for working const], ac_cv_my_c_const, +[AC_TRY_COMPILE(, +changequote(<<, >>)dnl +<< +/* Ultrix mips cc rejects this. */ +typedef int charset[2]; const charset x; +/* SunOS 4.1.1 cc rejects this. */ +char const *const *ccp; +char **p; +/* NEC SVR4.0.2 mips cc rejects this. */ +struct point {int x, y;}; +static struct point const zero = {0,0}; +/* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in an arm + of an if-expression whose if-part is not a constant expression */ +const char *g = "string"; +ccp = &g + (g ? g-g : 0); +/* HPUX 7.0 cc rejects these. */ +++ccp; +p = (char**) ccp; +ccp = (char const *const *) p; +{ /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +} +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; +} +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; +} +{ /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} +>>, +changequote([, ])dnl +ac_cv_my_c_const=yes, ac_cv_my_c_const=no)]) +if test $ac_cv_my_c_const = yes; then + AC_DEFINE_UNQUOTED(HAVE_C_CONST) +fi +]) + + +dnl AC_MY_C_CHAR_UNSIGNED works like the standard script AC_C_CHAR_UNSIGNED +dnl but defines C_CHAR_UNSIGNED instead of __CHAR_UNSIGNED__. + +AC_DEFUN(AC_MY_C_CHAR_UNSIGNED, +[AH_TEMPLATE([C_CHAR_UNSIGNED], [Define if char is unsigned on the C compiler.]) +AC_CACHE_CHECK(whether char is unsigned, ac_cv_my_c_char_unsigned, +[if test "$GCC" = yes; then + # GCC predefines this symbol on systems where it applies. +AC_EGREP_CPP(yes, +[#ifdef __CHAR_UNSIGNED__ + yes +#endif +], ac_cv_my_c_char_unsigned=yes, ac_cv_my_c_char_unsigned=no) +else +AC_TRY_RUN( +[/* volatile prevents gcc2 from optimizing the test away on sparcs. */ +#if !defined(__STDC__) || __STDC__ != 1 +#define volatile +#endif +main() { + volatile char c = 255; exit(c < 0); +}], ac_cv_my_c_char_unsigned=yes, ac_cv_my_c_char_unsigned=no) +fi]) +if test $ac_cv_my_c_char_unsigned = yes ; then + AC_DEFINE(C_CHAR_UNSIGNED) +fi +]) + + +dnl AC_MY_C_RIGHTSHIFT_UNSIGNED checks whether the right shift operation +dnl is unsigned and, if yes, defines C_RIGHTSHIFT_UNSIGNED. + +AC_DEFUN(AC_MY_C_RIGHTSHIFT_UNSIGNED, +[AH_TEMPLATE([C_RIGHTSHIFT_UNSIGNED], [Define if >> is unsigned on the C compiler]) +AC_CACHE_CHECK(whether right shift is unsigned, ac_cv_my_c_rightshift_unsigned, +[ +AC_TRY_RUN( +[/* See whether right-shift on a long is signed or not. */ +int is_shifting_signed (long arg) +{ + long res = arg >> 4; + + if (res == -0x7F7E80CL) { /* expected result for signed shift */ + return 1; /* right shift is signed */ + } + /* see if unsigned-shift hack will fix it. */ + /* we can't just test exact value since it depends on width of long... */ + res |= (~0L) << (32-4); + if (res == -0x7F7E80CL) { /* expected result now? */ + return 0; /* right shift is unsigned */ + } + /* Right shift isn't acting as I expect it to, try it with unsigned anyway */ + return 0; +} + +int main() +{ + exit(is_shifting_signed(-0x7F7E80B1L)); +} +], ac_cv_my_c_rightshift_unsigned=yes, ac_cv_my_c_rightshift_unsigned=no) +]) +if test $ac_cv_my_c_rightshift_unsigned = yes ; then + AC_DEFINE(C_CHAR_UNSIGNED) +fi +]) + + +dnl AC_CHECK_IOS_NOCREATE checks if the flag ios::nocreate is defined. + +dnl AC_CHECK_IOS_NOCREATE(IOS-Name, header [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_CHECK_IOS_NOCREATE, +[ +AC_MSG_CHECKING([declaration of ios::nocreate (in $2)]) +AH_TEMPLATE([HAVE_IOS_NOCREATE], [Define if your system defines ios::nocreate in iostream.h]) +ac_cv_declaration=ac_cv_declaration_ios_nocreate +AC_CACHE_VAL($ac_cv_declaration, +[AC_TRY_COMPILE([ +#include <$2> +], [namespace std { } +using namespace std; +ifstream file("name", $1::nocreate)] ,eval "$ac_cv_declaration=yes", eval "$ac_cv_declaration=no")])dnl +if eval "test \"\$$ac_cv_declaration\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_declaration=HAVE_IOS_NOCREATE +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_declaration) + ifelse([$3], , :, [$3]) +else + AC_MSG_RESULT(no) +ifelse([$4], , , [$4 +])dnl +fi +unset ac_cv_declaration +]) + + + +dnl AC_CHECK_OLD_READDIR_R checks if there is a function readdir_r +dnl conforming to the Posix 1.c Draft 6 interface, i.e. +dnl struct dirent *readdir_r(DIR *dirp, struct dirent *entry); +dnl instead of the Posix 1.c interface, i.e. +dnl int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); +dnl +dnl The test macro AC_HEADER_DIRENT must be run before this test! +dnl +dnl AC_CHECK_OLD_READDIR_R([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(AC_CHECK_OLD_READDIR_R, +[ +AC_MSG_CHECKING([if declaration of readdir_r conforms to Posix 1.c draft 6]) +AH_TEMPLATE([HAVE_OLD_READDIR_R], [Define if your system supports readdir_r with the obsolete + Posix 1.c draft 6 declaration (2 arguments) instead of the + Posix 1.c declaration with 3 arguments.]) +ac_cv_result=ac_cv_old_readdir_r +AC_CACHE_VAL($ac_cv_result, +[AC_TRY_COMPILE([ +#ifdef __cplusplus +extern "C" { +#endif +#ifdef HAVE_DIRENT_H +#include +#else +#define dirent direct +#ifdef HAVE_SYS_NDIR_H +#include +#endif +#ifdef HAVE_SYS_DIR_H +#include +#endif +#ifdef HAVE_NDIR_H +#include +#endif +#endif +#ifdef __cplusplus +} +#endif +], [ + DIR *dirp; + struct dirent *dp; + dp = readdir_r(dirp, dp); +], eval "$ac_cv_result=yes", eval "$ac_cv_result=no")])dnl +if eval "test \"\$$ac_cv_result\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_cv_result=HAVE_OLD_READDIR_R +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_cv_result) + ifelse([$1], , , [$1 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$2], , , [$2 +])dnl +fi +unset ac_cv_result +]) + + +dnl AC_CHECK_INTP_GETSOCKOPT checks if the prototype for getsockopt() +dnl specifies arguments 5 to be int* instead of size_t *. + +dnl AC_CHECK_INTP_GETSOCKOPT(HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_INTP_GETSOCKOPT, +[AC_MSG_CHECKING([ifelse([$1], , [if getsockopt() needs int* parameters], +[if getsockopt() needs int* parameters (in $1)])]) +AH_TEMPLATE([HAVE_INTP_GETSOCKOPT], [Define if your system declares argument 5 of getsockopt() + as int * instead of size_t * or socklen_t.]) +ifelse([$1], , [ac_includes="" +], +[ac_includes="" +for ac_header in $1 +do + ac_includes="$ac_includes +#include<$ac_header>" +done]) +AC_CACHE_VAL(ac_cv_prototype_intp_getsockopt, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +] +, +[ + int i; + size_t optlen; + i = getsockopt(0, 0, 0, 0, &optlen); +], +eval "ac_cv_prototype_intp_getsockopt=no", +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +] +, +[ + int i; + int optlen; + i = getsockopt(0, 0, 0, 0, &optlen); +], +eval "ac_cv_prototype_intp_getsockopt=yes", eval "ac_cv_prototype_intp_getsockopt=no")])]) +if eval "test \"`echo $ac_cv_prototype_intp_getsockopt`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_INTP_GETSOCKOPT +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) +fi +]) + + +dnl AC_CHECK_ELLIPSE_SIGNAL_HANDLER checks if the prototype for the +dnl callback function passed to signal() needs an ellipse (...) +dnl as parameter. Needed for example on Irix 5. +dnl The header files for signal() have to be specified. + +dnl AC_CHECK_ELLIPSE_SIGNAL_HANDLER(HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_ELLIPSE_SIGNAL_HANDLER, +[AC_MSG_CHECKING([ifelse([$1], , [if signal() callback needs ellipse], +[if signal() callback needs ellipse (in $1)])]) +AH_TEMPLATE([SIGNAL_HANDLER_WITH_ELLIPSE], [Define if signal handlers need ellipse (...) parameters.]) +ifelse([$1], , [ac_includes="" +], +[ac_includes="" +for ac_header in $1 +do + ac_includes="$ac_includes +#include<$ac_header>" +done]) +AC_CACHE_VAL(ac_cv_signal_handler_with_ellipse, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes + + void signal_handler(int) + { + } +#ifdef __cplusplus +} +#endif +] +, +[ + (void) signal(0, signal_handler); +], +eval "ac_cv_signal_handler_with_ellipse=no", +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes + + void signal_handler(...) + { + } +#ifdef __cplusplus +} +#endif +] +, +[ + (void) signal(0, signal_handler); +], +eval "ac_cv_signal_handler_with_ellipse=yes", eval "ac_cv_signal_handler_with_ellipse=no")])]) +if eval "test \"`echo $ac_cv_signal_handler_with_ellipse`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=SIGNAL_HANDLER_WITH_ELLIPSE +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) +fi +]) + + + +dnl AC_INCLUDE_MATH_H_AS_CXX checks if must be included as a C++ +dnl include file (i.e. without extern "C"). Some sytems (Win32, HP/UX 10) +dnl use C++ language features in . + +dnl AC_INCLUDE_MATH_H_AS_CXX(HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_INCLUDE_MATH_H_AS_CXX, +[AC_MSG_CHECKING([if fails if included extern "C"]) +AH_TEMPLATE([INCLUDE_MATH_H_AS_CXX], [Define if fails if included extern "C".]) +AC_CACHE_VAL(ac_cv_include_math_h_as_cxx, +[AC_TRY_COMPILE([ +extern "C" +{ +#include +} +], +[ +], +eval "ac_cv_include_math_h_as_cxx=no", +[AC_TRY_COMPILE([ +#include +], +[ +], +eval "ac_cv_include_math_h_as_cxx=yes", eval "ac_cv_include_math_h_as_cxx=no")])]) +if eval "test \"`echo $ac_cv_include_math_h_as_cxx`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=INCLUDE_MATH_H_AS_CXX +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) +fi +]) + + +dnl AC_CHECK_CXX_BOOL checks if bool is a built-in C++ type +dnl (which is not the case on older compilers). + +dnl AC_CHECK_CXX_BOOL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_CXX_BOOL, +[AC_MSG_CHECKING([if bool is built-in type]) +AH_TEMPLATE([HAVE_CXX_BOOL], [Define if bool is a built-in type.]) +AC_CACHE_VAL(ac_cv_have_cxx_bool, +[AC_TRY_COMPILE([],[ +bool b1 = true; +bool b2 = false; +], +eval "ac_cv_have_cxx_bool=yes", +eval "ac_cv_have_cxx_bool=no")]) +if eval "test \"`echo $ac_cv_have_cxx_bool`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_CXX_BOOL +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype) + ifelse([$1], , :, [$1]) +else + AC_MSG_RESULT(no) + ifelse([$2], , , [$2]) +fi +]) + + +dnl AC_CHECK_CXX_VOLATILE checks if volatile is a built-in C++ keyword +dnl (which is not the case on older compilers). + +dnl AC_CHECK_CXX_VOLATILE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_CXX_VOLATILE, +[AC_MSG_CHECKING([if volatile is known keyword]) +AH_TEMPLATE([HAVE_CXX_VOLATILE], [Define if volatile is a known keyword]) +AC_CACHE_VAL(ac_cv_have_cxx_volatile, +[AC_TRY_COMPILE([],[ +volatile int i=0; +], +eval "ac_cv_have_cxx_volatile=yes", +eval "ac_cv_have_cxx_volatile=no")]) +if eval "test \"`echo $ac_cv_have_cxx_volatile`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_CXX_VOLATILE +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype, ,[Define if volatile is a known keyword.]) + ifelse([$1], , :, [$1]) +else + AC_MSG_RESULT(no) + ifelse([$2], , , [$2]) +fi +]) + + +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_typename.html +dnl +AC_DEFUN([AC_CXX_TYPENAME], +[AH_TEMPLATE([HAVE_TYPENAME], [Define if typename is a known keyword]) +AC_CACHE_CHECK(whether the compiler recognizes typename, +ac_cv_cxx_typename, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([templateclass X {public:X(){}};], +[X z; return 0;], + ac_cv_cxx_typename=yes, ac_cv_cxx_typename=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_typename" = yes; then + AC_DEFINE(HAVE_TYPENAME,,[Define if the compiler recognizes typename.]) +fi +]) + + +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_const_cast.html +dnl +AC_DEFUN([AC_CXX_CONST_CAST], +[AH_TEMPLATE([HAVE_CONST_CAST], [Define if the compiler supports const_cast<>]) +AC_CACHE_CHECK(whether the compiler supports const_cast<>, +ac_cv_cxx_const_cast, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE(,[int x = 0;const int& y = x;int& z = const_cast(y);return z;], + ac_cv_cxx_const_cast=yes, ac_cv_cxx_const_cast=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_const_cast" = yes; then + AC_DEFINE(HAVE_CONST_CAST,,[Define if the compiler supports const_cast<>.]) +fi +]) + + +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_dynamic_cast.html +dnl +AC_DEFUN([AC_CXX_DYNAMIC_CAST], +[AH_TEMPLATE([HAVE_DYNAMIC_CAST], [Define if the compiler supports dynamic_cast<>]) +AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>, +ac_cv_cxx_dynamic_cast, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +class Base { public : Base () {} virtual void f () = 0;}; +class Derived : public Base { public : Derived () {} virtual void f () {} };],[ +Derived d; Base& b=d; return dynamic_cast(&b) ? 0 : 1;], + ac_cv_cxx_dynamic_cast=yes, ac_cv_cxx_dynamic_cast=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_dynamic_cast" = yes; then + AC_DEFINE(HAVE_DYNAMIC_CAST,,[Define if the compiler supports dynamic_cast<>.]) +fi +]) + + +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_reinterpret_cast.html +dnl +AC_DEFUN([AC_CXX_REINTERPRET_CAST], +[AH_TEMPLATE([HAVE_REINTERPRET_CAST], [Define if the compiler supports reinterpret_cast<>]) +AC_CACHE_CHECK(whether the compiler supports reinterpret_cast<>, +ac_cv_cxx_reinterpret_cast, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +class Base { public : Base () {} virtual void f () = 0;}; +class Derived : public Base { public : Derived () {} virtual void f () {} }; +class Unrelated { public : Unrelated () {} }; +int g (Unrelated&) { return 0; }],[ +Derived d;Base& b=d;Unrelated& e=reinterpret_cast(b);return g(e);], + ac_cv_cxx_reinterpret_cast=yes, ac_cv_cxx_reinterpret_cast=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_reinterpret_cast" = yes; then + AC_DEFINE(HAVE_REINTERPRET_CAST,, + [Define if the compiler supports reinterpret_cast<>.]) +fi +]) + + +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_static_cast.html +dnl +AC_DEFUN([AC_CXX_STATIC_CAST], +[AH_TEMPLATE([HAVE_STATIC_CAST], [Define if the compiler supports static_cast<>]) +AC_CACHE_CHECK(whether the compiler supports static_cast<>, +ac_cv_cxx_static_cast, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +class Base { public : Base () {} virtual void f () = 0; }; +class Derived : public Base { public : Derived () {} virtual void f () {} }; +int g (Derived&) { return 0; }],[ +Derived d; Base& b = d; Derived& s = static_cast (b); return g (s);], + ac_cv_cxx_static_cast=yes, ac_cv_cxx_static_cast=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_static_cast" = yes; then + AC_DEFINE(HAVE_STATIC_CAST,, + [Define if the compiler supports static_cast<>.]) +fi +]) + + +dnl AC_CXX_STD_NOTHROW checks if the compiler supports non-throwing new using +dnl std::nothrow. + +AC_DEFUN([AC_CXX_STD_NOTHROW], +[AH_TEMPLATE([HAVE_STD__NOTHROW], [Define if the compiler supports std::nothrow]) +AC_CACHE_CHECK(whether the compiler supports std::nothrow, +ac_cv_cxx_std_nothrow, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include ],[int *i = new (std::nothrow) int], + ac_cv_cxx_std_nothrow=yes, ac_cv_cxx_std_nothrow=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_std_nothrow" = yes; then + AC_DEFINE(HAVE_STD__NOTHROW,, [Define if the compiler supports std::nothrow.]) +fi +]) + + +dnl AC_CXX_NOTHROW_DELETE checks if the compiler supports non-throwing delete using +dnl std::nothrow. + +AC_DEFUN([AC_CXX_NOTHROW_DELETE], +[AH_TEMPLATE([HAVE_NOTHROW_DELETE], [Define if the compiler supports operator delete (std::nothrow.)]) +AC_CACHE_CHECK(whether the compiler supports operator delete (std::nothrow), +ac_cv_cxx_nothrow_delete, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include ],[int *i = new (std::nothrow) int; operator delete (i,std::nothrow)], + ac_cv_cxx_nothrow_delete=yes, ac_cv_cxx_nothrow_delete=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_nothrow_delete" = yes; then + AC_DEFINE(HAVE_NOTHROW_DELETE,, [Define if the compiler supports operator delete (std::nothrow.)]) +fi +]) + + +dnl AC_CXX_NOTHROW_DELETE checks if the compiler supports non-throwing delete using +dnl std::nothrow. + +AC_DEFUN([AC_CXX_STATIC_ASSERT], +[AH_TEMPLATE([HAVE_STATIC_ASSERT], [Define if the compiler supports static_assert]) +AC_CACHE_CHECK(whether the compiler supports static_assert, +ac_cv_cxx_static_assert, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include ],[static_assert(true, "good")], + ac_cv_cxx_static_assert=yes, ac_cv_cxx_static_assert=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_static_assert" = yes; then + AC_DEFINE(HAVE_STATIC_ASSERT,, [Define if the compiler supports static_assert]) +fi +]) + + +dnl AC_CXX_LIBC_H_EXTERN_C checks if and cause a problem if +dnl libc.h is included extern "C" and math.h is not. This is the case on QNX +dnl 6.2.x and 6.5.x. + +AC_DEFUN([AC_CXX_LIBC_H_EXTERN_C], +[AH_TEMPLATE([INCLUDE_LIBC_H_AS_CXX], [Define if libc.h should be treated as a C++ header]) +AC_CACHE_CHECK(whether libc.h should be treated as a C++ header, +ac_cv_cxx_libc_h_is_cxx, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([extern "C" { +#include +} +#include ],[int i = 0], + ac_cv_cxx_libc_h_is_cxx=no, ac_cv_cxx_libc_h_is_cxx=yes) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_libc_h_is_cxx" = yes; then + AC_DEFINE(INCLUDE_LIBC_H_AS_CXX,, [Define if libc.h should be treated as a C++ header]) +fi +]) + + +dnl AC_CHECK_POINTER_TYPE checks if a given type is a pointer type. +dnl If header file(s) are given as argument 2, they +dnl are #included in the search. The header files are only included in the search if they +dnl have already been found using the AC_CHECK_HEADERS(header) macro. +dnl Examples: +dnl AC_CHECK_POINTER_TYPE(pthread_d, pthread.h) +dnl AC_CHECK_POINTER_TYPE(void *) + +dnl AC_CHECK_POINTER_TYPE(FUNCTION, HEADER-FILE...) +AC_DEFUN(AC_CHECK_POINTER_TYPE, +[AC_MSG_CHECKING([ifelse([$2], , [if $1 is a pointer type], [if $1 is a pointer type (in $2)])]) +AH_TEMPLATE(AS_TR_CPP(HAVE_POINTER_TYPE_$1), [Define if $1 is a pointer type on your system]) +ifelse([$2], , [ac_includes="" +], +[ac_includes="" +cpp_code="" +if eval "test \"`echo '$ac_cv_cxx_static_cast'`\" = yes"; then + cpp_code="unsigned long l = static_cast(p)" +else + cpp_code="unsigned long l = p" +fi +for ac_header in $2 +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done]) +tmp_save_1=`echo $1 | tr ' :' '__'` +AC_CACHE_VAL(ac_cv_pointer_type_$tmp_save_1, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +],[#ifdef __cplusplus +$1 p; $cpp_code +#else +$1 p; unsigned long l = p +#endif +], +eval "ac_cv_pointer_type_$tmp_save_1=no", eval "ac_cv_pointer_type_$tmp_save_1=yes")])dnl +if eval "test \"`echo '$''{'ac_cv_pointer_type_$tmp_save_1'}'`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_POINTER_TYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED([$ac_tr_prototype]) + ifelse([$3], , :, [$3]) +else + AC_MSG_RESULT(no) +fi +]) + + +dnl +dnl CHECK_VLA checks if the C Compiler supports variable-length arrays +dnl +AC_DEFUN(CHECK_VLA, +[AC_MSG_CHECKING([whether variable-length arrays are supported]) +AH_TEMPLATE([HAVE_VLA], [Define if variable-length arrays are supported in C]) +AC_LANG_SAVE +AC_LANG_C +AC_TRY_COMPILE([], [ + int n; int foo[n]; +], +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VLA)], +AC_MSG_RESULT(no)) +AC_LANG_RESTORE +]) + + +# AC_TYPEDEF_HELPER(TYPE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [INCLUDES]) + +m4_define([AC_TYPEDEF_HELPER], +[AS_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl +AC_CACHE_CHECK([for $1], ac_Type, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])], +[if (($1 *) 0) + return 0; +if (sizeof ($1)) + return 0;])], + [AS_VAR_SET(ac_Type, yes)], + [AS_VAR_SET(ac_Type, no)])]) +AS_IF([test AS_VAR_GET(ac_Type) = yes], [$2], [$3])[]dnl +AS_VAR_POPDEF([ac_Type])dnl +])# AC_TYPEDEF_HELPER + +AC_DEFUN(AC_TYPEDEF_HELPER2,[ +AH_VERBATIM([$3[_TYPEDEF]], [#ifdef ]$3[ +typedef $2 $1; +#endif])])# AC_TYPEDEF_HELPER2 + +# +# AC_TYPEDEF(type, default) +# +# This macro works similar to the old (deprecated, pre-2.13) AC_CHECK_TYPE +# macro, but instead of creating a #define for the type if absent, it +# creates a clean typedef. +# +AC_DEFUN(AC_TYPEDEF,[ +m4_define(AC_TYPEDEF_TEMP,[AS_TR_CPP(HAVE_NO_TYPEDEF_$1)]) +AC_TYPEDEF_HELPER2([$1],[$2],AC_TYPEDEF_TEMP) +AC_TYPEDEF_HELPER([$1],[],[AC_DEFINE_UNQUOTED(AC_TYPEDEF_TEMP, [1], [Define `$1' to `$2' if does not define.])]) +])# AC_TYPEDEF + + +# +# AC_LFS64 +# +# This macro checks with the C compiler whether fopen64 is declared in +# when _LARGEFILE64_SOURCE is defined +# +AC_DEFUN([AC_LFS64], +[ AH_TEMPLATE([DCMTK_ENABLE_LFS], [Select LFS mode (defined above) that shall be used or don't define it]) + AH_TEMPLATE([_LARGEFILE64_SOURCE], [Define to enable LFS64 (explicit large file support) if available]) + AC_MSG_CHECKING([for explicit large file support]) + ac_cv_lfs64_support=no + AC_LANG_SAVE + AC_LANG_C + AC_TRY_LINK([#define _LARGEFILE64_SOURCE + #include ],[FILE *f = fopen64("name", "r");], + ac_cv_lfs64_support=yes, ac_cv_lfs64_support=no) + AC_LANG_RESTORE + + if test "$ac_cv_lfs64_support" = yes; then + AC_MSG_RESULT([yes]) + AC_DEFINE(DCMTK_ENABLE_LFS, DCMTK_LFS64, [Select LFS mode (defined above) that shall be used or don't define it]) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Define to enable LFS64 (explicit large file support) if available]) + else + AC_MSG_RESULT([no]) + fi +]) + + +# MY_AC_SYS_LARGEFILE_TEST_INCLUDES +# Copied from autoconf 2.60 repository of specific tests and renamed +# ------------------------------- +m4_define([MY_AC_SYS_LARGEFILE_TEST_INCLUDES], +[@%:@include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]];[]dnl +]) + + +# MY_AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, +# CACHE-VAR, +# DESCRIPTION, +# PROLOGUE, [FUNCTION-BODY]) +# Copied from autoconf 2.60 repository of specific tests and renamed +# ---------------------------------------------------------- +m4_define([MY_AC_SYS_LARGEFILE_MACRO_VALUE], +[AC_CACHE_CHECK([for $1 value needed for large files], [$3], +[while :; do + $3=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$5], [$6])], + [ac_cv_lfs_support=yes; break]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@define $1 $2 +$5], [$6])], + [$3=$2; ac_cv_lfs_support=yes; break]) + break +done]) +if test "$$3" != no; then + AC_DEFINE_UNQUOTED([$1], [$$3], [$4]) +fi +rm -f conftest*[]dnl +])# MY_AC_SYS_LARGEFILE_MACRO_VALUE + + +# MY_AC_SYS_LARGEFILE +# ---------------- +# Copied from autoconf 2.60 repository of specific tests and modified +# +# By default, many hosts won't let programs access large files; +# one must use special compiler options to get large-file access to work. +# For more details about this brain damage please see: +# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html +AC_DEFUN([MY_AC_SYS_LARGEFILE], +[AC_CACHE_CHECK([for special C compiler options needed for large files], + ac_cv_sys_largefile_CC, + [ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + AC_LANG_SAVE + AC_LANG_C + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([MY_AC_SYS_LARGEFILE_TEST_INCLUDES])]) + AC_COMPILE_IFELSE([], [break]) + CC="$CC -n32" + AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + AC_LANG_RESTORE + fi]) + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + CXX=$CXX$ac_cv_sys_largefile_CC + fi + + ac_cv_lfs64_support=no + AH_TEMPLATE([DCMTK_ENABLE_LFS], [Select LFS mode (defined above) that shall be used or don't define it]) + MY_AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + [MY_AC_SYS_LARGEFILE_TEST_INCLUDES]) + MY_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + [MY_AC_SYS_LARGEFILE_TEST_INCLUDES]) + + if test "$ac_cv_lfs_support" = yes; then + AC_DEFINE(DCMTK_ENABLE_LFS, DCMTK_LFS, [Select LFS mode (defined above) that shall be used or don't define it]) + fi + +])# MY_AC_SYS_LARGEFILE + + +# +# AC_STDIO_NAMESPACE +# +# This macro checks with the C++ compiler whether fopen() in is +# in namespace standard or in global namespace. +# +AC_DEFUN([AC_STDIO_NAMESPACE], +[ AH_TEMPLATE([STDIO_NAMESPACE], [Namespace for ANSI C functions in standard C++ headers]) + ac_cv_stdio_namespace_is_std=no + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ +#ifdef USE_STD_CXX_INCLUDES +#include +#else +#include +#endif +],[FILE *f = ::fopen("name", "r");], + ac_cv_stdio_namespace_is_std=no, ac_cv_stdio_namespace_is_std=yes) + AC_LANG_RESTORE + + if test "$ac_cv_stdio_namespace_is_std" = yes; then + AC_DEFINE(STDIO_NAMESPACE,[std::]) + else + AC_DEFINE(STDIO_NAMESPACE,[::]) + fi +]) + + +dnl AC_CHECK_CHARP_STRERROR_R checks if the prototype for strerror_r() +dnl specifies a return type of char * instead of int. This is the case +dnl for the GNU version, whereas the XOPEN (XSI-compliant) version returns int. + +dnl AC_CHECK_CHARP_STRERROR_R(HEADER-FILE..., ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +AC_DEFUN(AC_CHECK_CHARP_STRERROR_R, +[AC_MSG_CHECKING([ifelse([$1], , [if strerror_r() returns a char *], +[if strerror_r() returns a char * (in $1)])]) +AH_TEMPLATE([HAVE_CHARP_STRERROR_R], [Define if your system declares the return type of strerror_r + as char * instead of int]) +ifelse([$1], , [ac_includes="" +], +[ac_includes="" +for ac_header in $1 +do + ac_includes="$ac_includes +#include<$ac_header>" +done]) +AC_CACHE_VAL(ac_cv_prototype_charp_strerror_r, +[AC_TRY_COMPILE( +[#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +] +, +[ + char *buf = 0; + int i = strerror_r(0, buf, 100) +], +eval "ac_cv_prototype_charp_strerror_r=no", +eval "ac_cv_prototype_charp_strerror_r=yes" +)]) +if eval "test \"`echo $ac_cv_prototype_charp_strerror_r`\" = yes"; then + AC_MSG_RESULT(yes) +changequote(, )dnl + ac_tr_prototype=HAVE_CHARP_STRERROR_R +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_prototype) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) +fi +]) + +dnl +dnl This macro adds the --disable-rpath option to configure +dnl and sets the variable $dcmtk_cv_rpath_works to "no", if needed. +dnl If that option isn't given, the availability of the rpath option is tested +AC_DEFUN([AC_MY_LIB_PATH_RPATH], +[ + AC_CACHE_CHECK([whether -Wl,-rpath is supported], [dcmtk_cv_rpath_works], + [AC_ARG_ENABLE([rpath], + [AS_HELP_STRING([--disable-rpath], [do not hardcode runtime library paths])], + [dcmtk_cv_rpath_works=$enableval], + [old_LDFLAGS="$LDFLAGS" + LDFLAGS="-Wl,-rpath,$srcdir $LDFLAGS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [dcmtk_cv_rpath_works=yes], + [dcmtk_cv_rpath_works=no]) + LDFLAGS="$old_LDFLAGS"]) + ]) +]) + +dnl +dnl This macro adds the option --with-[OPTION_NAME]inc to configure. If this option +dnl is specified, include/ and lib/ are added to CPPFLAGS / LDFLAGS. +dnl +dnl AC_MY_LIB_PATH(OPTION_NAME, LIB_NAME) +AC_DEFUN([AC_MY_LIB_PATH], +[ + AC_REQUIRE([AC_MY_LIB_PATH_RPATH])dnl + m4_pushdef([OPTION], [$1inc])dnl + m4_pushdef([LONGOPTION], [--with-$1inc])dnl + m4_pushdef([LIBNAME], [m4_default([$2], [$1])])dnl + AC_ARG_WITH([OPTION], dnl +dnl The following line is underquoted on purpose, else the help line will be +dnl discarded because it is equal to an earlier help line. +AS_HELP_STRING([LONGOPTION=DIR], [location of LIBNAME includes and libraries]), + [AS_CASE([$withval], + [yes|no], [ + AC_MSG_WARN([LONGOPTION called without argument - will use default]) + ], + [ + if test ! -d ${withval}; then + AC_MSG_ERROR([called with LONGOPTION but LIBNAME base directory ${withval} does not exist or is not a directory.]) + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ]) + ])dnl + m4_popdef([OPTION])dnl + m4_popdef([LONGOPTION])dnl + m4_popdef([LIBNAME])dnl +]) + +dnl +dnl This macro adds the option --with-openjpeginc to configure. If this option +dnl is specified, include/ and lib/ are added to CPPFLAGS / LDFLAGS. +dnl +dnl AC_MY_OPENJPEG_PATH() +AC_DEFUN([AC_MY_OPENJPEG_PATH], +[ + AC_REQUIRE([AC_MY_LIB_PATH_RPATH])dnl + m4_pushdef([OPTION], [openjpeginc])dnl + m4_pushdef([LONGOPTION], [--with-openjpeginc])dnl + m4_pushdef([LIBNAME], [m4_default([OpenJPEG], [openjpeg])])dnl + AC_ARG_WITH([OPTION], dnl +dnl The following line is underquoted on purpose, else the help line will be +dnl discarded because it is equal to an earlier help line. +AS_HELP_STRING([LONGOPTION=DIR], [location of LIBNAME includes and libraries (MUST be specified, otherwise OpenJPEG will not be found)]), + [AS_CASE([$withval], + [yes|no], [ + AC_MSG_WARN([LONGOPTION called without argument - will use default]) + ], + [ + if test ! -d ${withval}; then + AC_MSG_ERROR([called with LONGOPTION but LIBNAME base directory ${withval} does not exist or is not a directory.]) + fi + + dnl try to find openjpeg subdirectory within given include path + OPENJPEGINCLUDEPATH=`( + eval echo "${withval}/include/openjpeg*" + )` + + dnl if not found, use include path following standard conventions + if test ! -d "${OPENJPEGINCLUDEPATH}"; then + OPENJPEGINCLUDEPATH="${withval}/include" + fi + + CPPFLAGS="-I${OPENJPEGINCLUDEPATH} $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ]) + ])dnl + m4_popdef([OPTION])dnl + m4_popdef([LONGOPTION])dnl + m4_popdef([LIBNAME])dnl +]) + +AC_DEFUN([AC_CHECK_SYNC_FN], +[ + AC_MSG_CHECKING([for $1]) + AC_LINK_IFELSE( + [ + AC_LANG_SOURCE( + [ + int main(){return $1((int *)0, 0);} + ]) + ], + [dcmtk_have_sync_fn=[yes]], + [dcmtk_have_sync_fn=[no]] + ) + if test "$dcmtk_have_sync_fn" = yes; then + AC_MSG_RESULT([yes]) + AC_DEFINE($2,[1],[Define if $1 is available.]) + else + AC_MSG_RESULT([no]) + fi +]) + +AC_DEFUN([AC_CHECK_ITERATOR_CATEGORY], +[ + AC_MSG_CHECKING([whether iterator category $1 is declared]) + AC_COMPILE_IFELSE( + [ + AC_LANG_SOURCE( + [ + #include + int main(){typedef std::$1_iterator_tag category;return 0;} + ]) + ], + [dcmtk_have_iter_cat=[yes]], + [dcmtk_have_iter_cat=[no]] + ) + if test "$dcmtk_have_iter_cat" = yes; then + AC_MSG_RESULT([yes]) + AC_DEFINE($2,[1],[Define if the $1 iterator category is supported.]) + else + AC_MSG_RESULT([no]) + fi +]) + +AC_DEFUN([AC_CHECK_ALIGNOF], +[ + AC_MSG_CHECKING([for __alignof__]) + AC_LINK_IFELSE( + [ + AC_LANG_SOURCE( + [ + int main(){char c[[__alignof__(int)]];return 0;} + ]) + ], + [dcmtk_have_alignof=[yes]], + [dcmtk_have_alignof=[no]] + ) + if test "$dcmtk_have_alignof" = yes; then + AC_MSG_RESULT([yes]) + AC_DEFINE($1,[1],[Define if __alignof__ is available.]) + else + AC_MSG_RESULT([no]) + fi +]) + +AC_DEFUN([AC_CHECK_ATTRIBUTE_ALIGNED], +[ + AC_MSG_CHECKING([for __attribute__((aligned))]) + AC_LINK_IFELSE( + [ + AC_LANG_SOURCE( + [ + int main(){__attribute__((aligned(4))) char c[[16]];return 0;} + ]) + ], + [dcmtk_have_attribute_aligned=[yes]], + [dcmtk_have_attribute_aligned=[no]] + ) + if test "$dcmtk_have_attribute_aligned" = yes; then + AC_MSG_RESULT([yes]) + AC_DEFINE($1,[1],[Define if __attribute__((aligned)) is available.]) + else + AC_MSG_RESULT([no]) + fi +]) + +AC_DEFUN([AC_CHECK_ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES], +[ + AC_MSG_CHECKING([whether __attribute__((aligned)) supports templates]) + AC_LINK_IFELSE( + [ + AC_LANG_SOURCE( + [ + template + struct test { typedef T type __attribute__((aligned(4))); }; + int main() + { + test::type i; + return 0; + } + ]) + ], + [dcmtk_attribute_aligned_supports_templates=[yes]], + [dcmtk_attribute_aligned_supports_templates=[no]] + ) + if test "$dcmtk_attribute_aligned_supports_templates" = yes; then + AC_MSG_RESULT([yes]) + AC_DEFINE($1,[1],[Define if __attribute__((aligned)) supports templates.]) + else + AC_MSG_RESULT([no]) + fi +]) + +AC_DEFUN([AC_CHECK_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE], +[ + AC_MSG_CHECKING([whether the compiler supports default constructor detection via SFINAE]) + AC_LINK_IFELSE( + [ + AC_LANG_SOURCE( + [ + struct no_type {}; + struct yes_type {double d;}; + template + struct consume{}; + template + static yes_type sfinae(consume*); + template + static no_type sfinae(...); + struct test { test( int ); }; + int main() + { + return sizeof(sfinae(0)) == sizeof(yes_type); + } + ]) + ], + [dcmtk_default_constructor_detection_via_sfinae=[yes]], + [dcmtk_default_constructor_detection_via_sfinae=[no]] + ) + if test "$dcmtk_default_constructor_detection_via_sfinae" = yes; then + AC_MSG_RESULT([yes]) + AC_DEFINE($1,[1],[Define if the compiler supports default constructor detection via SFINAE.]) + else + AC_MSG_RESULT([no]) + fi +]) + + +dnl +dnl This macro checks if a given preprocessor symbol exists and is a string +dnl +dnl AC_MY_SYMBOL_EXISTS(SYMBOL) +AC_DEFUN([AC_MY_SYMBOL_EXISTS], +[ + AH_TEMPLATE([HAVE_$1_MACRO], [Define if the compiler supports $1.])dnl + AC_CACHE_CHECK([for $1 macro], [ac_cv_have_$1_macro], [dnl + AC_TRY_COMPILE([], [const char * func = $1;], [ac_cv_have_$1_macro=yes], [ac_cv_have_$1_macro=no])dnl + ]) + if test "x$ac_cv_have_$1_macro" = "xyes"; then + AC_DEFINE([HAVE_$1_MACRO]) + fi +]) + +dnl +dnl This macro checks if OpenSSL provides the SSL_CTX_get0_param function +dnl +dnl AC_CHECK_SSL_CTX_GET0_PARAM +AC_DEFUN([AC_CHECK_SSL_CTX_GET0_PARAM], +[ + AH_TEMPLATE([HAVE_SSL_CTX_GET0_PARAM], [Define if OpenSSL provides the SSL_CTX_get0_param function.])dnl + SAVELIBS=$LIBS + HAVE_SSL_CTX_GET0_PARAM=yes + LIBS="$LIBS $OPENSSLLIBS" + AC_MSG_CHECKING([whether OpenSSL provides the SSL_CTX_get0_param function]) + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM([[#include ]],[[&SSL_CTX_get0_param;]]) + ], + [ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_SSL_CTX_GET0_PARAM]) + ], + [ + AC_MSG_RESULT([no]) + ]) + LIBS=$SAVELIBS +]) + +dnl +dnl This macro checks if OpenSSL provides the RAND_egd function +dnl +dnl AC_CHECK_RAND_EGD +AC_DEFUN([AC_CHECK_RAND_EGD], +[ + AH_TEMPLATE([HAVE_RAND_EGD], [Define if OpenSSL provides the RAND_egd function.])dnl + SAVELIBS=$LIBS + HAVE_RAND_EGD=yes + LIBS="$LIBS $OPENSSLLIBS" + AC_MSG_CHECKING([whether OpenSSL provides the RAND_egd function]) + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM([[#include ]],[[&RAND_egd;]]) + ], + [ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_RAND_EGD]) + ], + [ + AC_MSG_RESULT([no]) + ]) + LIBS=$SAVELIBS +]) diff --git a/config/autoall b/config/autoall new file mode 100755 index 00000000..1c6e4b8f --- /dev/null +++ b/config/autoall @@ -0,0 +1,29 @@ +# !/bin/sh + +autoheader +autoconf +autoconf confmod.in > confmod + +sed -e 's|^datadir=.*|datadir='\''${datarootdir}/dcmtk'\''|' \ + -e 's|^sysconfdir=.*|sysconfdir='\''${prefix}/etc/dcmtk'\''|' \ + -e 's|^docdir=.*|docdir='\''${datarootdir}/doc/dcmtk'\''|' \ + -e 's|^htmldir=.*|htmldir='\''${docdir}/html'\''|' \ + -e 's|^ --datadir=DIR.*| --datadir=DIR read-only arch.-independent data [DATAROOTDIR/dcmtk]|' \ + -e 's|^ --sysconfdir=DIR.*| --sysconfdir=DIR read-only single-machine data [PREFIX/etc/dcmtk]|' \ + -e 's|^ --docdir=DIR.*| --docdir=DIR documentation root [DATAROOTDIR/doc/dcmtk]|' \ + -e 's|^ --htmldir=DIR.*| --htmldir=DIR html documentation [DOCDIR/html]|' \ + configure > configure.tmp +mv configure.tmp configure +chmod a+x configure + +sed -e 's|^datadir=.*|datadir='\''${datarootdir}/dcmtk'\''|' \ + -e 's|^sysconfdir=.*|sysconfdir='\''${prefix}/etc/dcmtk'\''|' \ + -e 's|^docdir=.*|docdir='\''${datarootdir}/doc/dcmtk'\''|' \ + -e 's|^htmldir=.*|htmldir='\''${docdir}/html'\''|' \ + -e 's|^ --datadir=DIR.*| --datadir=DIR read-only arch.-independent data [DATAROOTDIR/dcmtk]|' \ + -e 's|^ --sysconfdir=DIR.*| --sysconfdir=DIR read-only single-machine data [PREFIX/etc/dcmtk]|' \ + -e 's|^ --docdir=DIR.*| --docdir=DIR documentation root [DATAROOTDIR/doc/dcmtk]|' \ + -e 's|^ --htmldir=DIR.*| --htmldir=DIR html documentation [DOCDIR/html]|' \ + confmod > confmod.tmp +mv confmod.tmp confmod +chmod a+x confmod diff --git a/config/changext b/config/changext new file mode 100755 index 00000000..3903081c --- /dev/null +++ b/config/changext @@ -0,0 +1,149 @@ +#! /bin/sh +# +# This script changes the file name extension for all C++ files +# from .cc to a different extension. This is useful for C++ compilers +# which do note recognise ".cc" as a valid extension for C++ code. +# For instance, the IBM xlC compiler on AIX 3.x requires ".C" and +# older versions of Microsoft Visual C++ need ".cpp" or ".cxx". +# +# The script must be called from the "dcmtk/" directory, e.g. +# cd dcmtk +# config/changext cpp +# +# The first command line argument (if given) overrides the +# new extension (default: C). +# You must not specify the dot preceding the extension. +# +# The second command line argument (if given) overrides the +# old extension (default: cc). This is useful if you want +# to "rename back". +# +# Author: Marco Eichelberg, (C) 1997-2011 Kuratorium OFFIS e.V. +# + +newext=${1-C} +oldext=${2-cc} + +echo "renaming C++ files from .$oldext to .$newext" +for file in `find . -name "*.$oldext" -print` +do + newfile=`echo $file | sed -e "s/\.$oldext/\.$newext/g"` + `mv $file $newfile` +done + +if [ -f dcmjpls/apps/dcml2pnm.$newext ] ; then + echo "updating implementation include in dcml2pnm.$newext" + `cat dcmjpls/apps/dcml2pnm.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmimage\/apps\/dcm2pnm\.$oldext\"/#include \"..\/..\/dcmimage\/apps\/dcm2pnm.$newext\"/g" >dcmjpls/apps/dcml2pnm.new` + `mv dcmjpls/apps/dcml2pnm.new dcmjpls/apps/dcml2pnm.$newext` +fi + +if [ -f dcmjpeg/apps/dcmj2pnm.$newext ] ; then + echo "updating implementation include in dcmj2pnm.$newext" + `cat dcmjpeg/apps/dcmj2pnm.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmimage\/apps\/dcm2pnm\.$oldext\"/#include \"..\/..\/dcmimage\/apps\/dcm2pnm.$newext\"/g" >dcmjpeg/apps/dcmj2pnm.new` + `mv dcmjpeg/apps/dcmj2pnm.new dcmjpeg/apps/dcmj2pnm.$newext` +fi + +if [ -f dcmjpeg/apps/dcmmkdir.$newext ] ; then + echo "updating implementation include in dcmmkdir.$newext" + `cat dcmjpeg/apps/dcmmkdir.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmdata\/apps\/dcmgpdir\.$oldext\"/#include \"..\/..\/dcmdata\/apps\/dcmgpdir.$newext\"/g" >dcmjpeg/apps/dcmmkdir.new` + `mv dcmjpeg/apps/dcmmkdir.new dcmjpeg/apps/dcmmkdir.$newext` +fi + +if [ -f dcmeval/apps/tcpsrv_e.$newext ] ; then + echo "updating implementation include in tcpsrv_e.$newext" + `cat dcmeval/apps/tcpsrv_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmprscp\/apps\/tcpsrv\.$oldext\"/#include \"..\/..\/dcmprscp\/apps\/tcpsrv.$newext\"/g" >dcmeval/apps/tcpsrv_e.new` + `mv dcmeval/apps/tcpsrv_e.new dcmeval/apps/tcpsrv_e.$newext` +fi + +if [ -f dcmeval/apps/tcpprt_e.$newext ] ; then + echo "updating implementation include in tcpprt_e.$newext" + `cat dcmeval/apps/tcpprt_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmprint\/apps\/tcpprt\.$oldext\"/#include \"..\/..\/dcmprint\/apps\/tcpprt.$newext\"/g" >dcmeval/apps/tcpprt_e.new` + `mv dcmeval/apps/tcpprt_e.new dcmeval/apps/tcpprt_e.$newext` +fi + +if [ -f dcmeval/apps/dcmcjp2k_e.$newext ] ; then + echo "updating implementation include in dcmcjp2k_e.$newext" + `cat dcmeval/apps/dcmcjp2k_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmjp2k\/apps\/dcmcjp2k\.$oldext\"/#include \"..\/..\/dcmjp2k\/apps\/dcmcjp2k.$newext\"/g" >dcmeval/apps/dcmcjp2k_e.new` + `mv dcmeval/apps/dcmcjp2k_e.new dcmeval/apps/dcmcjp2k_e.$newext` +fi + +if [ -f dcmeval/apps/dcmdjp2k_e.$newext ] ; then + echo "updating implementation include in dcmdjp2k_e.$newext" + `cat dcmeval/apps/dcmdjp2k_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmjp2k\/apps\/dcmdjp2k\.$oldext\"/#include \"..\/..\/dcmjp2k\/apps\/dcmdjp2k.$newext\"/g" >dcmeval/apps/dcmdjp2k_e.new` + `mv dcmeval/apps/dcmdjp2k_e.new dcmeval/apps/dcmdjp2k_e.$newext` +fi + +if [ -f dcmqrdbx/apps/dcmqrscq.$newext ] ; then + echo "updating implementation include in dcmqrscq.$newext" + `cat dcmqrdbx/apps/dcmqrscq.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmqrdb\/apps\/dcmqrscp\.$oldext\"/#include \"..\/..\/dcmqrdb\/apps\/dcmqrscp.$newext\"/g" >dcmqrdbx/apps/dcmqrscq.new` + `mv dcmqrdbx/apps/dcmqrscq.new dcmqrdbx/apps/dcmqrscq.$newext` +fi + +if [ -f dcmeval/apps/ppsscpfs_e.$newext ] ; then + echo "updating implementation include in ppsscpfs_e.$newext" + `cat dcmeval/apps/ppsscpfs_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppsscpfs\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppsscpfs.$newext\"/g" | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppscefs\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppscefs.$newext\"/g" >dcmeval/apps/ppsscpfs_e.new` + `mv dcmeval/apps/ppsscpfs_e.new dcmeval/apps/ppsscpfs_e.$newext` +fi + +if [ -f dcmeval/apps/ppsmgr_e.$newext ] ; then + echo "updating implementation include in ppsmgr_e.$newext" + `cat dcmeval/apps/ppsmgr_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppsmgr\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppsmgr.$newext\"/g" | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppsmgrce\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppsmgrce.$newext\"/g" >dcmeval/apps/ppsmgr_e.new` + `mv dcmeval/apps/ppsmgr_e.new dcmeval/apps/ppsmgr_e.$newext` +fi + +if [ -f dcmeval/apps/pawscpfs_e.$newext ] ; then + echo "updating implementation include in pawscpfs_e.$newext" + `cat dcmeval/apps/pawscpfs_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmppswm\/apps\/pawscpfs\.$oldext\"/#include \"..\/..\/dcmppswm\/apps\/pawscpfs.$newext\"/g" | sed -e "s/#include \"\.\.\/\.\.\/dcmppswm\/apps\/pawcefs\.$oldext\"/#include \"..\/..\/dcmppswm\/apps\/pawcefs.$newext\"/g" >dcmeval/apps/pawscpfs_e.new` + `mv dcmeval/apps/pawscpfs_e.new dcmeval/apps/pawscpfs_e.$newext` +fi + +if [ -f dcmeval/apps/dcmanon_e.$newext ] ; then + echo "updating implementation include in dcmanon_e.$newext" + `cat dcmeval/apps/dcmanon_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmmisc\/apps\/dcmanon\.$oldext\"/#include \"..\/..\/dcmmisc\/apps\/dcmanon.$newext\"/g" >dcmeval/apps/dcmanon_e.new` + `mv dcmeval/apps/dcmanon_e.new dcmeval/apps/dcmanon_e.$newext` +fi + +if [ -f dcmmisc/apps/detecscp.$newext ] ; then + echo "updating implementation include in detecscp.$newext" + `cat dcmmisc/apps/detecscp.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmnet\/apps\/storescp\.$oldext\"/#include \"..\/..\/dcmnet\/apps\/storescp.$newext\"/g" >dcmmisc/apps/detecscp.new` + `mv dcmmisc/apps/detecscp.new dcmmisc/apps/detecscp.$newext` +fi + +if [ -f dcmmisc/apps/detecscu.$newext ] ; then + echo "updating implementation include in detecscu.$newext" + `cat dcmmisc/apps/detecscu.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmnet\/apps\/echoscu\.$oldext\"/#include \"..\/..\/dcmnet\/apps\/echoscu.$newext\"/g" >dcmmisc/apps/detecscu.new` + `mv dcmmisc/apps/detecscu.new dcmmisc/apps/detecscu.$newext` +fi + +if [ -f dcmeval/apps/mppsscu_e.$newext ] ; then + echo "updating implementation include in mppsscu_e.$newext" + `cat dcmeval/apps/mppsscu_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmppscu\/apps\/mppsscu\.$oldext\"/#include \"..\/..\/dcmppscu\/apps\/mppsscu.$newext\"/g" >dcmeval/apps/mppsscu_e.new` + `mv dcmeval/apps/mppsscu_e.new dcmeval/apps/mppsscu_e.$newext` +fi + +if [ -f dcmeval/apps/stcomscu_e.$newext ] ; then + echo "updating implementation include in stcomscu_e.$newext" + `cat dcmeval/apps/stcomscu_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmstcom\/apps\/stcomscu\.$oldext\"/#include \"..\/..\/dcmstcom\/apps\/stcomscu.$newext\"/g" >dcmeval/apps/stcomscu_e.new` + `mv dcmeval/apps/stcomscu_e.new dcmeval/apps/stcomscu_e.$newext` +fi + +echo "updating makefiles" +for file in `find . -name "Makefile*" -print` +do + `cat $file | sed -e "s/\.$oldext/\.$newext/g" >$file.new` + `mv $file.new $file` +done + +if [ -f CMake/GenerateDCMTKConfigure.cmake ] ; then + echo "updating CMake/GenerateDCMTKConfigure.cmake" + cat CMake/GenerateDCMTKConfigure.cmake | sed -e "s/\.$oldext/.$newext/g" > CMake/GenerateDCMTKConfigure.cmake.new + mv CMake/GenerateDCMTKConfigure.cmake.new CMake/GenerateDCMTKConfigure.cmake +fi + +if [ -f CMake/dcmtkMacros.cmake ] ; then + echo "updating CMake/dcmtkMacros.cmake" + cat CMake/dcmtkMacros.cmake | sed -e "s/\.$oldext/.$newext/g" > CMake/dcmtkMacros.cmake.new + mv CMake/dcmtkMacros.cmake.new CMake/dcmtkMacros.cmake +fi + +echo "done." diff --git a/config/config.guess b/config/config.guess new file mode 100755 index 00000000..d622a44e --- /dev/null +++ b/config/config.guess @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config/config.sub b/config/config.sub new file mode 100755 index 00000000..59bb593f --- /dev/null +++ b/config/config.sub @@ -0,0 +1,1779 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-04-18' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config/configure b/config/configure new file mode 100755 index 00000000..4c04502f --- /dev/null +++ b/config/configure @@ -0,0 +1,18404 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for dcmtk 3.6.5. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and bugs@dcmtk.org +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='dcmtk' +PACKAGE_TARNAME='dcmtk-3.6.5' +PACKAGE_VERSION='3.6.5' +PACKAGE_STRING='dcmtk 3.6.5' +PACKAGE_BUGREPORT='bugs@dcmtk.org' +PACKAGE_URL='http://www.dcmtk.org/' + +ac_unique_file="Makefile.in" +ac_default_prefix=/usr/local +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +DEBUG +OPENJPEGLIBS +ICONVLIBS +SNDFILELIBS +TCPWRAPPERLIBS +XMLLIBS +ZLIBLIBS +MATHLIBS +PNGLIBS +TIFFLIBS +OPENSSLLIBS +HAVE_CXX11 +CHARCONVLIBS +CHARCONVINCLUDES +ICU_CONFIG +LIBOBJS +EGREP +GREP +STRIP +BINEXT +LIBEXT +ARFLAGS +LIBTOOL +AR +RANLIB +CXXCPP +ac_ct_CXX +CXXFLAGS +CXX +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +common_makefile +SET_MAKE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +PACKAGE_DATE +PACKAGE_VERSION_SUFFIX +PACKAGE_VERSION_NUMBER +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_debug +enable_threads +enable_lfs +enable_std_includes +enable_private_tags +enable_external_dict +enable_builtin_dict +enable_rpath +with_opensslinc +with_openssl +with_zlibinc +with_zlib +with_libtiffinc +with_libtiff +with_libpnginc +with_libpng +with_libxmlinc +with_libxml +with_libwrapinc +with_libwrap +with_openjpeginc +with_libsndfileinc +with_libsndfile +with_libiconvinc +with_libiconv +with_libicuinc +with_libicu +enable_charconv +enable_cxx11 +enable_stl +enable_stl_vector +enable_stl_algorithm +enable_stl_limits +enable_stl_list +enable_stl_map +enable_stl_memory +enable_stl_stack +enable_stl_string +enable_stl_type_traits +enable_stl_tuple +enable_stl_system_error +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}/dcmtk' +sysconfdir='${prefix}/etc/dcmtk' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/dcmtk' +infodir='${datarootdir}/info' +htmldir='${docdir}/html' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures dcmtk 3.6.5 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc/dcmtk] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only arch.-independent data [DATAROOTDIR/dcmtk] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/dcmtk] + --htmldir=DIR html documentation [DOCDIR/html] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of dcmtk 3.6.5:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-debug compile with debug code, don't optimize + --disable-debug compile without debug code (default) + --enable-threads=TYPE compile with MT support (posix/solaris/auto=default) + --disable-threads compile without MT support + --enable-lfs=TYPE compile with LFS support (lfs/lfs64/auto=default) + --disable-lfs compile without LFS support + --enable-std-includes use C++ ANSI standard includes (default: auto) + --disable-std-includes use old C++ includes + --enable-private-tags enable private tag dictionary + --disable-private-tags don't enable private tag dictionary (default) + --enable-external-dict enable loading of external dictionary (default) + --disable-external-dict don't load external dictionary + --enable-builtin-dict enable loading of built-in dictionary + --disable-builtin-dict don't load built-in dictionary (default) + --disable-rpath do not hardcode runtime library paths + --enable-charconv=TYPE enable character set conversion support + (libiconv/libicu/stdlibc/auto=default) + --disable-charconv disable character set conversion support + --enable-cxx11 use C++11 + --disable-cxx11 do not use C++11 (default) + --enable-stl use C++ STL + --disable-stl do not use C++ STL (default) + --enable-stl-vector use C++ STL vector + --disable-stl-vector do not use C++ STL vector + --enable-stl-algorithm use C++ STL algorithm + --disable-stl-algorithm do not use C++ STL algorithm + --enable-stl-limits use C++ STL limits + --disable-stl-limits do not use C++ STL limits + --enable-stl-list use C++ STL list + --disable-stl-list do not use C++ STL list + --enable-stl-map use C++ STL map + --disable-stl-map do not use C++ STL map + --enable-stl-memory use C++ STL memory + --disable-stl-memory do not use C++ STL memory + --enable-stl-stack use C++ STL stack + --disable-stl-stack do not use C++ STL stack + --enable-stl-string use C++ STL string + --disable-stl-string do not use C++ STL string + --enable-stl-type-traits + use C++ STL type-traits + --disable-stl-type-traits + do not use C++ STL type-traits + --enable-stl-tuple use C++ STL tuple + --disable-stl-tuple do not use C++ STL tuple + --enable-stl-system-error + use C++ STL system_error + --disable-stl-system_error + do not use C++ STL system_error + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-opensslinc=DIR location of OpenSSL includes and libraries + --with-openssl include OpenSSL support (default: auto) + --without-openssl don't include OpenSSL support + --with-zlibinc=DIR location of zlib includes and libraries + --with-zlib include zlib support (default: auto) + --without-zlib don't include zlib support + --with-libtiffinc=DIR location of libtiff includes and libraries + --with-libtiff include libtiff support (default: auto) + --without-libtiff don't include libtiff support + --with-libpnginc=DIR location of libpng includes and libraries + --with-libpng include libpng support (default: auto) + --without-libpng don't include libpng support + --with-libxmlinc=DIR location of libxml includes and libraries + --with-libxml include libxml support (default: auto) + --without-libxml don't include libxml support + --with-libwrapinc=DIR location of libwrap includes and libraries + --with-libwrap include libwrap support (default: auto) + --without-libwrap don't include libwrap support + --with-openjpeginc=DIR location of OpenJPEG includes and libraries (MUST be + specified, otherwise OpenJPEG will not be found) + --with-openjpeg include OpenJPEG support (default: auto) + --without-openjpeg don't include OpenJPEG support + --with-libsndfileinc=DIR + location of libsndfile includes and libraries + --with-libsndfile include libsndfile support (default: auto) + --without-libsndfile don't include libsndfile support + --with-libiconvinc=DIR location of libiconv includes and libraries + --with-libiconv include libiconv support (default: auto) + --without-libiconv don't include libiconv support + --with-libicuinc=DIR location of libicu includes and libraries + --with-libicu include libicu support (default: auto) + --without-libicu don't include libicu support + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +dcmtk home page: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +dcmtk configure 3.6.5 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ----------------------------- ## +## Report this to bugs@dcmtk.org ## +## ----------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ----------------------------- ## +## Report this to bugs@dcmtk.org ## +## ----------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_mongrel + +# ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES +# ---------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_cxx_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + echo >>conftest.val; read $3 config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by dcmtk $as_me 3.6.5, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_config_headers="$ac_config_headers include/dcmtk/config/osconfig.h" + + +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016 Krzesimir Nowak +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + + + + + + + + + + + + + + + + + + + + + + + + + + +PACKAGE_VERSION_NUMBER=365 +PACKAGE_VERSION_SUFFIX="" +PACKAGE_DATE="2019-10-28" + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION_NUMBER ${PACKAGE_VERSION_NUMBER} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION_SUFFIX "${PACKAGE_VERSION_SUFFIX}" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_DATE "${PACKAGE_DATE}" +_ACEOF + + + + + + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +cat >>confdefs.h <<_ACEOF +#define CANONICAL_HOST_TYPE "${host}" +_ACEOF + + +case "${host}" in + *-*-cygwin) + BINEXT=".exe" + ;; + *-*-mingw32) + BINEXT=".exe" + ;; + *) + BINEXT="" + ;; +esac + + +if test "x$prefix" = xNONE ; then + +cat >>confdefs.h <<_ACEOF +#define DCMTK_PREFIX "${ac_default_prefix}" +_ACEOF + +else + +cat >>confdefs.h <<_ACEOF +#define DCMTK_PREFIX "${prefix}" +_ACEOF + +fi + +DATA_DIR="${datadir}" +DATA_DIR=`( + test "$prefix" = NONE && prefix=${ac_default_prefix} + test "$exec_prefix" = NONE && exec_prefix=${prefix} + eval eval echo "$DATA_DIR" +)` + +cat >>confdefs.h <<_ACEOF +#define DCM_DICT_DEFAULT_PATH "${DATA_DIR}/dicom.dic" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_SUPPORT_DATA_DIR "${DATA_DIR}/" +_ACEOF + + +CONF_DIR="${sysconfdir}" +CONF_DIR=`( + test "$prefix" = NONE && prefix=${ac_default_prefix} + test "$exec_prefix" = NONE && exec_prefix=${prefix} + eval echo "$CONF_DIR" +)` + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_CONFIGURATION_DIR "${CONF_DIR}/" +_ACEOF + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +common_makefile=Makefile.def + + +ac_aux_dir= +for ac_dir in . "$srcdir"/.; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +for ac_prog in $CCC c++ cc++ g++ gcc CC cxx +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break +done +test -n "$CXX" || CXX="gcc" + + +pedantic="" +if test -f /bin/uname ; then + os=`uname -s` + rev=`uname -r` + if test \( "$os" = SunOS \) ; then + case "$rev" in + # only use the -pedantic compiler option on + # Solaris 2 machines. + 5.*) pedantic="-pedantic" ;; + esac + fi +fi +if test "${CXXFLAGS}set" = set ; then + case "$CXX" in + c++|g++|gcc) + CXXFLAGS="-Wall $pedantic" + CFLAGS="-Wall $pedantic" + ;; + cc++) + CXXFLAGS="-Wall" + CFLAGS="-Wall" + ;; + *) + CXXFLAGS="" + CFLAGS="" + ;; + esac +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +for ac_prog in ranlib +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$RANLIB" && break +done +test -n "$RANLIB" || RANLIB=":" + + +for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break +done +test -n "$AR" || AR=":" + +for ac_prog in libtool +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIBTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIBTOOL"; then + ac_cv_prog_LIBTOOL="$LIBTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIBTOOL="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIBTOOL=$ac_cv_prog_LIBTOOL +if test -n "$LIBTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBTOOL" >&5 +$as_echo "$LIBTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LIBTOOL" && break +done +test -n "$LIBTOOL" || LIBTOOL=":" + +if test "${LIBTOOL}set" = libtoolset ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool is GNU libtool" >&5 +$as_echo_n "checking whether libtool is GNU libtool... " >&6; } +if ${ac_cv_check_gnu_libtool+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_check_gnu_libtool=`libtool --version 2>/dev/null | grep "GNU libtool" | sed -e "s/.*\(GNU libtool\).*/\1/" ` + if test "${ac_cv_check_gnu_libtool}set" = "GNU libtoolset" ; then + ac_cv_check_gnu_libtool=yes + else + ac_cv_check_gnu_libtool=no + fi + +fi + + if test $ac_cv_check_gnu_libtool = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + if test $ac_cv_check_gnu_libtool = yes ; then + : + else + AR=$LIBTOOL + fi +fi + +case "$AR" in +libtool) ARFLAGS=-o ;; +ar) ARFLAGS=cruv ;; +esac + +if test "${LIBEXT}set" = set ; then + LIBEXT="a" +fi + + + + + +# Try to find a strip utility +for ac_prog in strip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$STRIP" && break +done +test -n "$STRIP" || STRIP=":" + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 +$as_echo_n "checking for library containing strerror... " >&6; } +if ${ac_cv_search_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} +_ACEOF +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_strerror=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_strerror+:} false; then : + break +fi +done +if ${ac_cv_search_strerror+:} false; then : + +else + ac_cv_search_strerror=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 +$as_echo "$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long file names" >&5 +$as_echo_n "checking for long file names... " >&6; } +if ${ac_cv_sys_long_file_names+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_long_file_names=yes +# Test for long file names in all the places we know might matter: +# . the current directory, where building will happen +# $prefix/lib where we will be installing things +# $exec_prefix/lib likewise +# $TMPDIR if set, where it might want to write temporary files +# /tmp where it might want to write temporary files +# /var/tmp likewise +# /usr/tmp likewise +for ac_dir in . "$TMPDIR" /tmp /var/tmp /usr/tmp "$prefix/lib" "$exec_prefix/lib"; do + # Skip $TMPDIR if it is empty or bogus, and skip $exec_prefix/lib + # in the usual case where exec_prefix is '${prefix}'. + case $ac_dir in #( + . | /* | ?:[\\/]*) ;; #( + *) continue;; + esac + test -w "$ac_dir/." || continue # It is less confusing to not echo anything here. + ac_xdir=$ac_dir/cf$$ + (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue + ac_tf1=$ac_xdir/conftest9012345 + ac_tf2=$ac_xdir/conftest9012346 + touch "$ac_tf1" 2>/dev/null && test -f "$ac_tf1" && test ! -f "$ac_tf2" || + ac_cv_sys_long_file_names=no + rm -f -r "$ac_xdir" 2>/dev/null + test $ac_cv_sys_long_file_names = no && break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_long_file_names" >&5 +$as_echo "$ac_cv_sys_long_file_names" >&6; } +if test $ac_cv_sys_long_file_names = yes; then + +$as_echo "#define HAVE_LONG_FILE_NAMES 1" >>confdefs.h + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_my_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_my_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +} $ac_kw foo() { + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_my_c_inline=$ac_kw; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_my_c_inline" >&5 +$as_echo "$ac_cv_my_c_inline" >&6; } +case "$ac_cv_my_c_inline" in + inline | yes) $as_echo "#define C_INLINE inline" >>confdefs.h + ;; + no) $as_echo "#define C_INLINE /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define C_INLINE $ac_cv_my_c_inline +_ACEOF + ;; +esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working const" >&5 +$as_echo_n "checking for working const... " >&6; } +if ${ac_cv_my_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +/* Ultrix mips cc rejects this. */ +typedef int charset[2]; const charset x; +/* SunOS 4.1.1 cc rejects this. */ +char const *const *ccp; +char **p; +/* NEC SVR4.0.2 mips cc rejects this. */ +struct point {int x, y;}; +static struct point const zero = {0,0}; +/* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in an arm + of an if-expression whose if-part is not a constant expression */ +const char *g = "string"; +ccp = &g + (g ? g-g : 0); +/* HPUX 7.0 cc rejects these. */ +++ccp; +p = (char**) ccp; +ccp = (char const *const *) p; +{ /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +} +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; +} +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; +} +{ /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_my_c_const=yes +else + ac_cv_my_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_my_c_const" >&5 +$as_echo "$ac_cv_my_c_const" >&6; } +if test $ac_cv_my_c_const = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_C_CONST 1 +_ACEOF + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_my_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$GCC" = yes; then + # GCC predefines this symbol on systems where it applies. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __CHAR_UNSIGNED__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + ac_cv_my_c_char_unsigned=yes +else + ac_cv_my_c_char_unsigned=no +fi +rm -f conftest* + +else +if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* volatile prevents gcc2 from optimizing the test away on sparcs. */ +#if !defined(__STDC__) || __STDC__ != 1 +#define volatile +#endif +main() { + volatile char c = 255; exit(c < 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_my_c_char_unsigned=yes +else + ac_cv_my_c_char_unsigned=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_my_c_char_unsigned" >&5 +$as_echo "$ac_cv_my_c_char_unsigned" >&6; } +if test $ac_cv_my_c_char_unsigned = yes ; then + $as_echo "#define C_CHAR_UNSIGNED 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift is unsigned" >&5 +$as_echo_n "checking whether right shift is unsigned... " >&6; } +if ${ac_cv_my_c_rightshift_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* See whether right-shift on a long is signed or not. */ +int is_shifting_signed (long arg) +{ + long res = arg >> 4; + + if (res == -0x7F7E80CL) { /* expected result for signed shift */ + return 1; /* right shift is signed */ + } + /* see if unsigned-shift hack will fix it. */ + /* we can't just test exact value since it depends on width of long... */ + res |= (~0L) << (32-4); + if (res == -0x7F7E80CL) { /* expected result now? */ + return 0; /* right shift is unsigned */ + } + /* Right shift isn't acting as I expect it to, try it with unsigned anyway */ + return 0; +} + +int main() +{ + exit(is_shifting_signed(-0x7F7E80B1L)); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_my_c_rightshift_unsigned=yes +else + ac_cv_my_c_rightshift_unsigned=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_my_c_rightshift_unsigned" >&5 +$as_echo "$ac_cv_my_c_rightshift_unsigned" >&6; } +if test $ac_cv_my_c_rightshift_unsigned = yes ; then + $as_echo "#define C_CHAR_UNSIGNED 1" >>confdefs.h + +fi + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uchar" >&5 +$as_echo_n "checking for uchar... " >&6; } +if ${ac_cv_type_uchar+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((uchar *) 0) + return 0; +if (sizeof (uchar)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_uchar=yes +else + ac_cv_type_uchar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uchar" >&5 +$as_echo "$ac_cv_type_uchar" >&6; } +if test $ac_cv_type_uchar = yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define HAVE_NO_TYPEDEF_UCHAR 1 +_ACEOF + +fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ushort" >&5 +$as_echo_n "checking for ushort... " >&6; } +if ${ac_cv_type_ushort+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((ushort *) 0) + return 0; +if (sizeof (ushort)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_ushort=yes +else + ac_cv_type_ushort=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_ushort" >&5 +$as_echo "$ac_cv_type_ushort" >&6; } +if test $ac_cv_type_ushort = yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define HAVE_NO_TYPEDEF_USHORT 1 +_ACEOF + +fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint" >&5 +$as_echo_n "checking for uint... " >&6; } +if ${ac_cv_type_uint+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((uint *) 0) + return 0; +if (sizeof (uint)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_uint=yes +else + ac_cv_type_uint=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint" >&5 +$as_echo "$ac_cv_type_uint" >&6; } +if test $ac_cv_type_uint = yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define HAVE_NO_TYPEDEF_UINT 1 +_ACEOF + +fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ulong" >&5 +$as_echo_n "checking for ulong... " >&6; } +if ${ac_cv_type_ulong+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((ulong *) 0) + return 0; +if (sizeof (ulong)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_ulong=yes +else + ac_cv_type_ulong=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_ulong" >&5 +$as_echo "$ac_cv_type_ulong" >&6; } +if test $ac_cv_type_ulong = yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define HAVE_NO_TYPEDEF_ULONG 1 +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "longlong" "ac_cv_type_longlong" "$ac_includes_default" +if test "x$ac_cv_type_longlong" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONGLONG 1 +_ACEOF + + +fi + +ac_fn_c_check_type "$LINENO" "ulonglong" "ac_cv_type_ulonglong" "$ac_includes_default" +if test "x$ac_cv_type_ulonglong" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_ULONGLONG 1 +_ACEOF + + +fi + +ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + + +fi + +ac_fn_c_check_type "$LINENO" "unsigned long long" "ac_cv_type_unsigned_long_long" "$ac_includes_default" +if test "x$ac_cv_type_unsigned_long_long" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UNSIGNED_LONG_LONG 1 +_ACEOF + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether variable-length arrays are supported" >&5 +$as_echo_n "checking whether variable-length arrays are supported... " >&6; } + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + int n; int foo[n]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_VLA 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_fn_c_check_type "$LINENO" "fpos64_t" "ac_cv_type_fpos64_t" "$ac_includes_default" +if test "x$ac_cv_type_fpos64_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_FPOS64_T 1 +_ACEOF + + +fi + +ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default" +if test "x$ac_cv_type_off64_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_OFF64_T 1 +_ACEOF + + +fi + + +for ac_header in stdbool.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" +if test "x$ac_cv_header_stdbool_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + +done + +for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + +for ac_header in cstdint +do : + ac_fn_c_check_header_mongrel "$LINENO" "cstdint" "ac_cv_header_cstdint" "$ac_includes_default" +if test "x$ac_cv_header_cstdint" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CSTDINT 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" +if test "x$ac_cv_type_int64_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT64_T 1 +_ACEOF + + +fi + +ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" +if test "x$ac_cv_type_uint64_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT64_T 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "char16_t" "ac_cv_type_char16_t" "$ac_includes_default" +if test "x$ac_cv_type_char16_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_CHAR16_T 1 +_ACEOF + + +fi + + +ac_fn_c_check_type "$LINENO" "sigjmp_buf" "ac_cv_type_sigjmp_buf" "#include +" +if test "x$ac_cv_type_sigjmp_buf" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGJMP_BUF 1 +_ACEOF + + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if ${ac_cv_func_memcmp_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_memcmp_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + +for ac_func in vprintf +do : + ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF + +ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes; then : + +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if ${ac_cv_type_signal+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wait3 that fills in rusage" >&5 +$as_echo_n "checking for wait3 that fills in rusage... " >&6; } +if ${ac_cv_func_wait3_rusage+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_wait3_rusage=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#include +#include +#include +/* HP-UX has wait3 but does not fill in rusage at all. */ +int +main () +{ + struct rusage r; + int i; + /* Use a field that we can force nonzero -- + voluntary context switches. + For systems like NeXT and OSF/1 that don't set it, + also use the system CPU time. And page faults (I/O) for Linux. */ + r.ru_nvcsw = 0; + r.ru_stime.tv_sec = 0; + r.ru_stime.tv_usec = 0; + r.ru_majflt = r.ru_minflt = 0; + switch (fork ()) + { + case 0: /* Child. */ + sleep(1); /* Give up the CPU. */ + _exit(0); + break; + case -1: /* What can we do? */ + _exit(0); + break; + default: /* Parent. */ + wait3(&i, 0, &r); + /* Avoid "text file busy" from rm on fast HP-UX machines. */ + sleep(2); + return (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 + && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_wait3_rusage=yes +else + ac_cv_func_wait3_rusage=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_wait3_rusage" >&5 +$as_echo "$ac_cv_func_wait3_rusage" >&6; } +if test $ac_cv_func_wait3_rusage = yes; then + +$as_echo "#define HAVE_WAIT3 1" >>confdefs.h + +fi + +for ac_func in gethostname gethostid socket sysinfo +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in strchr strstr strtoul itoa atoll +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in memcpy memset memmove memcmp bcopy bcmp +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in getpid mktemp tempnam tmpnam getenv mkstemp +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in stat +do : + ac_fn_c_check_func "$LINENO" "stat" "ac_cv_func_stat" +if test "x$ac_cv_func_stat" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STAT 1 +_ACEOF + +fi +done + +for ac_func in malloc_debug +do : + ac_fn_c_check_func "$LINENO" "malloc_debug" "ac_cv_func_malloc_debug" +if test "x$ac_cv_func_malloc_debug" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MALLOC_DEBUG 1 +_ACEOF + +fi +done + +for ac_func in strerror strdup bzero index rindex access +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in uname cuserid getlogin getlogin_r +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in usleep +do : + ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" +if test "x$ac_cv_func_usleep" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_USLEEP 1 +_ACEOF + +fi +done + +for ac_func in flock lockf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in listen connect setsockopt getsockopt select +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in gethostbyname gethostbyname_r +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in gethostbyaddr_r getgrnam_r getpwnam_r +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in bind accept getsockname getaddrinfo +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in getrusage +do : + ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage" +if test "x$ac_cv_func_getrusage" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETRUSAGE 1 +_ACEOF + +fi +done + +for ac_func in gettimeofday +do : + ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETTIMEOFDAY 1 +_ACEOF + +fi +done + +for ac_func in waitpid +do : + ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" +if test "x$ac_cv_func_waitpid" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WAITPID 1 +_ACEOF + +fi +done + +for ac_func in getuid geteuid setuid getpwnam getgrnam +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in sleep fork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in _findfirst +do : + ac_fn_c_check_func "$LINENO" "_findfirst" "ac_cv_func__findfirst" +if test "x$ac_cv_func__findfirst" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE__FINDFIRST 1 +_ACEOF + +fi +done + +for ac_func in strlcpy strlcat +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in vsnprintf +do : + ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VSNPRINTF 1 +_ACEOF + +fi +done + +for ac_func in mbstowcs wcstombs +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in popen pclose +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in readdir_r +do : + ac_fn_c_check_func "$LINENO" "readdir_r" "ac_cv_func_readdir_r" +if test "x$ac_cv_func_readdir_r" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_READDIR_R 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if ${ac_cv_sys_largefile_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=no; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=1; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -rf conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h + +fi + + + + + + +for ac_func in ftime gmtime_r localtime_r lstat nanosleep fcntl +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in htons htonl ntohs ntohl +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_header in netinet/in.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETINET_IN_H 1 +_ACEOF + +fi + +done + +for ac_header in syslog.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" +if test "x$ac_cv_header_syslog_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYSLOG_H 1 +_ACEOF + +fi + +done + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } +if ${ac_cv_type_socklen_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ +socklen_t len = 42; return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_socklen_t=yes +else + ac_cv_type_socklen_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } + if test $ac_cv_type_socklen_t != yes; then + $as_echo "#define socklen_t int" >>confdefs.h + + fi + + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int value = ENAMETOOLONG; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_ENAMETOOLONG /**/" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +SAVELIBS="$LIBS" +LIBS="$LIBS -lm" +for ac_func in finite isinf isnan +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +LIBS="$SAVELIBS" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports const_cast<>" >&5 +$as_echo_n "checking whether the compiler supports const_cast<>... " >&6; } +if ${ac_cv_cxx_const_cast+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int x = 0;const int& y = x;int& z = const_cast(y);return z; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_const_cast=yes +else + ac_cv_cxx_const_cast=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_const_cast" >&5 +$as_echo "$ac_cv_cxx_const_cast" >&6; } +if test "$ac_cv_cxx_const_cast" = yes; then + +$as_echo "#define HAVE_CONST_CAST /**/" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports dynamic_cast<>" >&5 +$as_echo_n "checking whether the compiler supports dynamic_cast<>... " >&6; } +if ${ac_cv_cxx_dynamic_cast+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +class Base { public : Base () {} virtual void f () = 0;}; +class Derived : public Base { public : Derived () {} virtual void f () {} }; +int +main () +{ + +Derived d; Base& b=d; return dynamic_cast(&b) ? 0 : 1; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_dynamic_cast=yes +else + ac_cv_cxx_dynamic_cast=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_dynamic_cast" >&5 +$as_echo "$ac_cv_cxx_dynamic_cast" >&6; } +if test "$ac_cv_cxx_dynamic_cast" = yes; then + +$as_echo "#define HAVE_DYNAMIC_CAST /**/" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports reinterpret_cast<>" >&5 +$as_echo_n "checking whether the compiler supports reinterpret_cast<>... " >&6; } +if ${ac_cv_cxx_reinterpret_cast+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +class Base { public : Base () {} virtual void f () = 0;}; +class Derived : public Base { public : Derived () {} virtual void f () {} }; +class Unrelated { public : Unrelated () {} }; +int g (Unrelated&) { return 0; } +int +main () +{ + +Derived d;Base& b=d;Unrelated& e=reinterpret_cast(b);return g(e); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_reinterpret_cast=yes +else + ac_cv_cxx_reinterpret_cast=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_reinterpret_cast" >&5 +$as_echo "$ac_cv_cxx_reinterpret_cast" >&6; } +if test "$ac_cv_cxx_reinterpret_cast" = yes; then + +$as_echo "#define HAVE_REINTERPRET_CAST /**/" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports static_cast<>" >&5 +$as_echo_n "checking whether the compiler supports static_cast<>... " >&6; } +if ${ac_cv_cxx_static_cast+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +class Base { public : Base () {} virtual void f () = 0; }; +class Derived : public Base { public : Derived () {} virtual void f () {} }; +int g (Derived&) { return 0; } +int +main () +{ + +Derived d; Base& b = d; Derived& s = static_cast (b); return g (s); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_static_cast=yes +else + ac_cv_cxx_static_cast=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_static_cast" >&5 +$as_echo "$ac_cv_cxx_static_cast" >&6; } +if test "$ac_cv_cxx_static_cast" = yes; then + +$as_echo "#define HAVE_STATIC_CAST /**/" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports std::nothrow" >&5 +$as_echo_n "checking whether the compiler supports std::nothrow... " >&6; } +if ${ac_cv_cxx_std_nothrow+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int *i = new (std::nothrow) int + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_std_nothrow=yes +else + ac_cv_cxx_std_nothrow=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_std_nothrow" >&5 +$as_echo "$ac_cv_cxx_std_nothrow" >&6; } +if test "$ac_cv_cxx_std_nothrow" = yes; then + +$as_echo "#define HAVE_STD__NOTHROW /**/" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports operator delete (std::nothrow)" >&5 +$as_echo_n "checking whether the compiler supports operator delete (std::nothrow)... " >&6; } +if ${ac_cv_cxx_nothrow_delete+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int *i = new (std::nothrow) int; operator delete (i,std::nothrow) + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_nothrow_delete=yes +else + ac_cv_cxx_nothrow_delete=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_nothrow_delete" >&5 +$as_echo "$ac_cv_cxx_nothrow_delete" >&6; } +if test "$ac_cv_cxx_nothrow_delete" = yes; then + +$as_echo "#define HAVE_NOTHROW_DELETE /**/" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports static_assert" >&5 +$as_echo_n "checking whether the compiler supports static_assert... " >&6; } +if ${ac_cv_cxx_static_assert+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +static_assert(true, "good") + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_static_assert=yes +else + ac_cv_cxx_static_assert=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_static_assert" >&5 +$as_echo "$ac_cv_cxx_static_assert" >&6; } +if test "$ac_cv_cxx_static_assert" = yes; then + +$as_echo "#define HAVE_STATIC_ASSERT /**/" >>confdefs.h + +fi + + + +DEBUG="-DNDEBUG" +DEBUGCXXFLAGS= +DEBUGCFLAGS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compile in debug mode" >&5 +$as_echo_n "checking whether to compile in debug mode... " >&6; } +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; case "$enableval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + DEBUGCXXFLAGS="-g" + DEBUGCFLAGS="-g" + DEBUG="-DDEBUG" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + DEBUGCXXFLAGS="-O" + DEBUGCFLAGS="-O" + ;; + esac +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + DEBUGCXXFLAGS="-O" + DEBUGCFLAGS="-O" + +fi + + + +THREADSUPPORT="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable thread support" >&5 +$as_echo_n "checking whether to enable thread support... " >&6; } +# Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; case "$enableval" in + yes|auto) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: automatic detection" >&5 +$as_echo "automatic detection" >&6; } + ;; + posix) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=posix" >&5 +$as_echo "yes, type=posix" >&6; } + THREADSUPPORT="posix" + ;; + solaris) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=solaris" >&5 +$as_echo "yes, type=solaris" >&6; } + THREADSUPPORT="solaris" + ;; + no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + THREADSUPPORT="no" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - type $enableval is unknown - using automatic detection" >&5 +$as_echo "yes - type $enableval is unknown - using automatic detection" >&6; } + ;; + esac +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: automatic detection" >&5 +$as_echo "automatic detection" >&6; } + +fi + + + +LFSSUPPORT="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5 +$as_echo_n "checking whether to enable large file support... " >&6; } +# Check whether --enable-lfs was given. +if test "${enable_lfs+set}" = set; then : + enableval=$enable_lfs; case "$enableval" in + yes|auto) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: automatic detection" >&5 +$as_echo "automatic detection" >&6; } + ;; + lfs) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=LFS" >&5 +$as_echo "yes, type=LFS" >&6; } + LFSSUPPORT="lfs" + ;; + lfs64) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=LFS64" >&5 +$as_echo "yes, type=LFS64" >&6; } + LFSSUPPORT="lfs64" + ;; + no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + LFSSUPPORT="no" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - type $enableval is unknown - using automatic detection" >&5 +$as_echo "yes - type $enableval is unknown - using automatic detection" >&6; } + ;; + esac +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: automatic detection" >&5 +$as_echo "automatic detection" >&6; } + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lg++" >&5 +$as_echo_n "checking for -lg++... " >&6; } +if ${ac_cv_lib_gxx+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lg++ $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +main() + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + eval "ac_cv_lib_gxx=yes" +else + eval "ac_cv_lib_gxx=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_gxx'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_lib=HAVE_LIBGXX + cat >>confdefs.h <<_ACEOF +#define $ac_tr_lib 1 +_ACEOF + + LIBS="-lg++ $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -liostream" >&5 +$as_echo_n "checking for main in -liostream... " >&6; } +if ${ac_cv_lib_iostream_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-liostream $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_iostream_main=yes +else + ac_cv_lib_iostream_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iostream_main" >&5 +$as_echo "$ac_cv_lib_iostream_main" >&6; } +if test "x$ac_cv_lib_iostream_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBIOSTREAM 1 +_ACEOF + + LIBS="-liostream $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 +$as_echo_n "checking for main in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_nsl_main=yes +else + ac_cv_lib_nsl_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 +$as_echo "$ac_cv_lib_nsl_main" >&6; } +if test "x$ac_cv_lib_nsl_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + +if test $ac_cv_lib_nsl_main = no ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsocket" >&5 +$as_echo_n "checking for main in -lsocket... " >&6; } +if ${ac_cv_lib_socket_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_socket_main=yes +else + ac_cv_lib_socket_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_main" >&5 +$as_echo "$ac_cv_lib_socket_main" >&6; } +if test "x$ac_cv_lib_socket_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +if test $ac_cv_lib_socket_main = no ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } +if ${ac_cv_lib_socket_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_socket_socket=yes +else + ac_cv_lib_socket_socket=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi + +OPENSSLLIBS="" +OPENJPEGLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldl" >&5 +$as_echo_n "checking for main in -ldl... " >&6; } +if ${ac_cv_lib_dl_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_dl_main=yes +else + ac_cv_lib_dl_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_main" >&5 +$as_echo "$ac_cv_lib_dl_main" >&6; } +if test "x$ac_cv_lib_dl_main" = xyes; then : + +OPENSSLLIBS="-ldl" +OPENJPEGLIBS="-ldl" + +fi + +if test $ac_cv_lib_dl_main = no ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + +OPENSSLLIBS="-ldl" +OPENJPEGLIBS="-ldl" + +fi + +fi + +MATHLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 +$as_echo_n "checking for main in -lm... " >&6; } +if ${ac_cv_lib_m_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_m_main=yes +else + ac_cv_lib_m_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 +$as_echo "$ac_cv_lib_m_main" >&6; } +if test "x$ac_cv_lib_m_main" = xyes; then : + +MATHLIBS="-lm" + +fi + +if test $ac_cv_lib_m_main = no ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 +$as_echo_n "checking for sin in -lm... " >&6; } +if ${ac_cv_lib_m_sin+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sin (); +int +main () +{ +return sin (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_m_sin=yes +else + ac_cv_lib_m_sin=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 +$as_echo "$ac_cv_lib_m_sin" >&6; } +if test "x$ac_cv_lib_m_sin" = xyes; then : + +MATHLIBS="-lm" + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5 +$as_echo_n "checking for main in -lwsock32... " >&6; } +if ${ac_cv_lib_wsock32_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lwsock32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_wsock32_main=yes +else + ac_cv_lib_wsock32_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_main" >&5 +$as_echo "$ac_cv_lib_wsock32_main" >&6; } +if test "x$ac_cv_lib_wsock32_main" = xyes; then : + +LIBS="$LIBS -lwsock32" + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnetapi32" >&5 +$as_echo_n "checking for main in -lnetapi32... " >&6; } +if ${ac_cv_lib_netapi32_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnetapi32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_netapi32_main=yes +else + ac_cv_lib_netapi32_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netapi32_main" >&5 +$as_echo "$ac_cv_lib_netapi32_main" >&6; } +if test "x$ac_cv_lib_netapi32_main" = xyes; then : + +LIBS="$LIBS -lnetapi32" + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if ${ac_cv_header_sys_wait_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main () +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_sys_wait_h=yes +else + ac_cv_header_sys_wait_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +for ac_header in netinet/in_systm.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "netinet/in_systm.h" "ac_cv_header_netinet_in_systm_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_systm_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETINET_IN_SYSTM_H 1 +_ACEOF + +fi + +done + + +if eval "test \"`echo '$ac_cv_header_netinet_in_systm_h'`\" = yes"; then + for ac_hdr in netinet/in.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr" >&5 +$as_echo_n "checking for $ac_hdr... " >&6; } +if eval \${ac_cv_header_$ac_safe+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +#include <$ac_hdr> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + eval "ac_cv_header_$ac_safe=yes" +else + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_hdr 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +done + + if eval "test \"`echo '$ac_cv_header_netinet_in_h'`\" = yes"; then + for ac_hdr in netinet/tcp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr" >&5 +$as_echo_n "checking for $ac_hdr... " >&6; } +if eval \${ac_cv_header_$ac_safe+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +#include <$ac_hdr> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + eval "ac_cv_header_$ac_safe=yes" +else + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_hdr 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +done + + else + for ac_hdr in netinet/tcp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr" >&5 +$as_echo_n "checking for $ac_hdr... " >&6; } +if eval \${ac_cv_header_$ac_safe+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +#include <$ac_hdr> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + eval "ac_cv_header_$ac_safe=yes" +else + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_hdr 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +done + + fi +else + for ac_header in netinet/in.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETINET_IN_H 1 +_ACEOF + +fi + +done + + if eval "test \"`echo '$ac_cv_header_netinet_in_h'`\" = yes"; then + for ac_hdr in netinet/tcp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr" >&5 +$as_echo_n "checking for $ac_hdr... " >&6; } +if eval \${ac_cv_header_$ac_safe+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +#include <$ac_hdr> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + eval "ac_cv_header_$ac_safe=yes" +else + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_hdr 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +done + + else + for ac_header in netinet/tcp.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_tcp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETINET_TCP_H 1 +_ACEOF + +fi + +done + + fi +fi + +for ac_header in alloca.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" +if test "x$ac_cv_header_alloca_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ALLOCA_H 1 +_ACEOF + +fi + +done + +for ac_header in arpa/inet.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ARPA_INET_H 1 +_ACEOF + +fi + +done + +for ac_header in assert.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default" +if test "x$ac_cv_header_assert_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ASSERT_H 1 +_ACEOF + +fi + +done + +for ac_header in ctype.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" +if test "x$ac_cv_header_ctype_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CTYPE_H 1 +_ACEOF + +fi + +done + +for ac_header in errno.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ERRNO_H 1 +_ACEOF + +fi + +done + +for ac_header in fcntl.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FCNTL_H 1 +_ACEOF + +fi + +done + +for ac_header in float.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" +if test "x$ac_cv_header_float_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FLOAT_H 1 +_ACEOF + +fi + +done + +for ac_header in fnmatch.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "fnmatch.h" "ac_cv_header_fnmatch_h" "$ac_includes_default" +if test "x$ac_cv_header_fnmatch_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FNMATCH_H 1 +_ACEOF + +fi + +done + +for ac_header in fstream +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "fstream" "ac_cv_header_fstream" "$ac_includes_default" +if test "x$ac_cv_header_fstream" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FSTREAM 1 +_ACEOF + +fi + +done + +for ac_header in fstream.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "fstream.h" "ac_cv_header_fstream_h" "$ac_includes_default" +if test "x$ac_cv_header_fstream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FSTREAM_H 1 +_ACEOF + +fi + +done + +for ac_header in grp.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" +if test "x$ac_cv_header_grp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GRP_H 1 +_ACEOF + +fi + +done + +for ac_header in ieeefp.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" +if test "x$ac_cv_header_ieeefp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IEEEFP_H 1 +_ACEOF + +fi + +done + +for ac_header in io.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "io.h" "ac_cv_header_io_h" "$ac_includes_default" +if test "x$ac_cv_header_io_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IO_H 1 +_ACEOF + +fi + +done + +for ac_header in iomanip +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "iomanip" "ac_cv_header_iomanip" "$ac_includes_default" +if test "x$ac_cv_header_iomanip" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IOMANIP 1 +_ACEOF + +fi + +done + +for ac_header in iomanip.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "iomanip.h" "ac_cv_header_iomanip_h" "$ac_includes_default" +if test "x$ac_cv_header_iomanip_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IOMANIP_H 1 +_ACEOF + +fi + +done + +for ac_header in iostream +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "iostream" "ac_cv_header_iostream" "$ac_includes_default" +if test "x$ac_cv_header_iostream" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IOSTREAM 1 +_ACEOF + +fi + +done + +for ac_header in iostream.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "iostream.h" "ac_cv_header_iostream_h" "$ac_includes_default" +if test "x$ac_cv_header_iostream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IOSTREAM_H 1 +_ACEOF + +fi + +done + +for ac_header in iso646.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "iso646.h" "ac_cv_header_iso646_h" "$ac_includes_default" +if test "x$ac_cv_header_iso646_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ISO646_H 1 +_ACEOF + +fi + +done + +for ac_header in libc.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "libc.h" "ac_cv_header_libc_h" "$ac_includes_default" +if test "x$ac_cv_header_libc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBC_H 1 +_ACEOF + +fi + +done + +for ac_header in limits.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF + +fi + +done + +for ac_header in climits +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "climits" "ac_cv_header_climits" "$ac_includes_default" +if test "x$ac_cv_header_climits" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CLIMITS 1 +_ACEOF + +fi + +done + +for ac_header in locale.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_H 1 +_ACEOF + +fi + +done + +for ac_header in malloc.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" +if test "x$ac_cv_header_malloc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MALLOC_H 1 +_ACEOF + +fi + +done + +for ac_header in math.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" +if test "x$ac_cv_header_math_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MATH_H 1 +_ACEOF + +fi + +done + +for ac_header in cmath +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "cmath" "ac_cv_header_cmath" "$ac_includes_default" +if test "x$ac_cv_header_cmath" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CMATH 1 +_ACEOF + +fi + +done + +for ac_header in new +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "new" "ac_cv_header_new" "$ac_includes_default" +if test "x$ac_cv_header_new" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NEW 1 +_ACEOF + +fi + +done + +for ac_header in new.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "new.h" "ac_cv_header_new_h" "$ac_includes_default" +if test "x$ac_cv_header_new_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NEW_H 1 +_ACEOF + +fi + +done + +for ac_header in netdb.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETDB_H 1 +_ACEOF + +fi + +done + +for ac_header in pthread.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_H 1 +_ACEOF + +fi + +done + +for ac_header in pwd.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" +if test "x$ac_cv_header_pwd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PWD_H 1 +_ACEOF + +fi + +done + +for ac_header in semaphore.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" +if test "x$ac_cv_header_semaphore_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SEMAPHORE_H 1 +_ACEOF + +fi + +done + +for ac_header in setjmp.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default" +if test "x$ac_cv_header_setjmp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETJMP_H 1 +_ACEOF + +fi + +done + +for ac_header in signal.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_signal_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNAL_H 1 +_ACEOF + +fi + +done + +for ac_header in sstream +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sstream" "ac_cv_header_sstream" "$ac_includes_default" +if test "x$ac_cv_header_sstream" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SSTREAM 1 +_ACEOF + +fi + +done + +for ac_header in sstream.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sstream.h" "ac_cv_header_sstream_h" "$ac_includes_default" +if test "x$ac_cv_header_sstream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SSTREAM_H 1 +_ACEOF + +fi + +done + +for ac_header in stat.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stat.h" "ac_cv_header_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_stat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_H 1 +_ACEOF + +fi + +done + +for ac_header in cstdarg +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "cstdarg" "ac_cv_header_cstdarg" "$ac_includes_default" +if test "x$ac_cv_header_cstdarg" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CSTDARG 1 +_ACEOF + +fi + +done + +for ac_header in stdarg.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" +if test "x$ac_cv_header_stdarg_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDARG_H 1 +_ACEOF + +fi + +done + +for ac_header in stddef.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" +if test "x$ac_cv_header_stddef_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDDEF_H 1 +_ACEOF + +fi + +done + +for ac_header in cstddef +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "cstddef" "ac_cv_header_cstddef" "$ac_includes_default" +if test "x$ac_cv_header_cstddef" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CSTDDEF 1 +_ACEOF + +fi + +done + +for ac_header in cstdio +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "cstdio" "ac_cv_header_cstdio" "$ac_includes_default" +if test "x$ac_cv_header_cstdio" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CSTDIO 1 +_ACEOF + +fi + +done + +for ac_header in stdio.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" +if test "x$ac_cv_header_stdio_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDIO_H 1 +_ACEOF + +fi + +done + +for ac_header in stdint.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + +for ac_header in stdlib.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +for ac_header in streambuf.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "streambuf.h" "ac_cv_header_streambuf_h" "$ac_includes_default" +if test "x$ac_cv_header_streambuf_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STREAMBUF_H 1 +_ACEOF + +fi + +done + +for ac_header in string.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRING_H 1 +_ACEOF + +fi + +done + +for ac_header in strings.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" +if test "x$ac_cv_header_strings_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRINGS_H 1 +_ACEOF + +fi + +done + +for ac_header in strstrea.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "strstrea.h" "ac_cv_header_strstrea_h" "$ac_includes_default" +if test "x$ac_cv_header_strstrea_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRSTREA_H 1 +_ACEOF + +fi + +done + +for ac_header in strstream +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "strstream" "ac_cv_header_strstream" "$ac_includes_default" +if test "x$ac_cv_header_strstream" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRSTREAM 1 +_ACEOF + +fi + +done + +for ac_header in strstream.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "strstream.h" "ac_cv_header_strstream_h" "$ac_includes_default" +if test "x$ac_cv_header_strstream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRSTREAM_H 1 +_ACEOF + +fi + +done + +for ac_header in synch.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "synch.h" "ac_cv_header_synch_h" "$ac_includes_default" +if test "x$ac_cv_header_synch_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYNCH_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/errno.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/errno.h" "ac_cv_header_sys_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_errno_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_ERRNO_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/file.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_FILE_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/param.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_PARAM_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/resource.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_resource_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_RESOURCE_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/select.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SELECT_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/socket.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SOCKET_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/stat.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_STAT_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/syscall.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_syscall_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SYSCALL_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/systeminfo.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/systeminfo.h" "ac_cv_header_sys_systeminfo_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_systeminfo_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SYSTEMINFO_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/time.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIME_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/timeb.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIMEB_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/types.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TYPES_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/utime.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/utime.h" "ac_cv_header_sys_utime_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_utime_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_UTIME_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/utsname.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_utsname_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_UTSNAME_H 1 +_ACEOF + +fi + +done + +for ac_header in thread.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "thread.h" "ac_cv_header_thread_h" "$ac_includes_default" +if test "x$ac_cv_header_thread_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_THREAD_H 1 +_ACEOF + +fi + +done + +for ac_header in time.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" +if test "x$ac_cv_header_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TIME_H 1 +_ACEOF + +fi + +done + +for ac_header in unistd.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNISTD_H 1 +_ACEOF + +fi + +done + +for ac_header in unix.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "unix.h" "ac_cv_header_unix_h" "$ac_includes_default" +if test "x$ac_cv_header_unix_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNIX_H 1 +_ACEOF + +fi + +done + +for ac_header in utime.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" +if test "x$ac_cv_header_utime_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UTIME_H 1 +_ACEOF + +fi + +done + +for ac_header in wchar.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" +if test "x$ac_cv_header_wchar_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WCHAR_H 1 +_ACEOF + +fi + +done + +for ac_header in wctype.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" +if test "x$ac_cv_header_wctype_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WCTYPE_H 1 +_ACEOF + +fi + +done + +for ac_header in fenv.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "fenv.h" "ac_cv_header_fenv_h" "$ac_includes_default" +if test "x$ac_cv_header_fenv_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FENV_H 1 +_ACEOF + +fi + +done + +ac_fn_cxx_check_header_mongrel "$LINENO" "iterator" "ac_cv_header_iterator" "$ac_includes_default" +if test "x$ac_cv_header_iterator" = xyes; then : + +$as_echo "#define HAVE_ITERATOR_HEADER 1" >>confdefs.h + + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable poll.h" >&5 +$as_echo_n "checking for usable poll.h... " >&6; } + +if ${ac_cv_header_poll_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + +case "${host}" in + *-*-darwin*) + eval "ac_cv_header_poll_h=no" + ;; + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + eval "ac_cv_header_poll_h=yes" +else + eval "ac_cv_header_poll_h=no" +fi +rm -f conftest.err conftest.i conftest.$ac_ext ;; +esac + +fi + +if eval "test \"`echo '$ac_cv_header_poll_h'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + cat >>confdefs.h <<_ACEOF +#define DCMTK_HAVE_POLL 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + +if test $ac_cv_header_libc_h = yes ; then + if test $ac_cv_header_math_h = yes ; then + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libc.h should be treated as a C++ header" >&5 +$as_echo_n "checking whether libc.h should be treated as a C++ header... " >&6; } +if ${ac_cv_cxx_libc_h_is_cxx+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern "C" { +#include +} +#include +int +main () +{ +int i = 0 + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_libc_h_is_cxx=no +else + ac_cv_cxx_libc_h_is_cxx=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_libc_h_is_cxx" >&5 +$as_echo "$ac_cv_cxx_libc_h_is_cxx" >&6; } +if test "$ac_cv_cxx_libc_h_is_cxx" = yes; then + +$as_echo "#define INCLUDE_LIBC_H_AS_CXX /**/" >>confdefs.h + +fi + + fi +fi + + +if test $ac_cv_header_pthread_h = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_t is a pointer type (in pthread.h)" >&5 +$as_echo_n "checking if pthread_t is a pointer type (in pthread.h)... " >&6; } + +ac_includes="" +cpp_code="" +if eval "test \"`echo '$ac_cv_cxx_static_cast'`\" = yes"; then + cpp_code="unsigned long l = static_cast(p)" +else + cpp_code="unsigned long l = p" +fi +for ac_header in pthread.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo pthread_t | tr ' :' '__'` +if eval \${ac_cv_pointer_type_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + +int +main () +{ +#ifdef __cplusplus +pthread_t p; $cpp_code +#else +pthread_t p; unsigned long l = p +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_pointer_type_$tmp_save_1=no" +else + eval "ac_cv_pointer_type_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_pointer_type_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_POINTER_TYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +fi + + +if test $THREADSUPPORT = auto ; then + if test $ac_cv_header_synch_h = yes ; then + THREADSUPPORT="solaris" + fi +fi +if test $THREADSUPPORT = auto ; then + if test $ac_cv_header_pthread_h = yes ; then + THREADSUPPORT="posix" + fi +fi +if test $THREADSUPPORT = auto ; then + THREADSUPPORT="no" +fi + + +if test $THREADSUPPORT = solaris ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sema_init in -lthread" >&5 +$as_echo_n "checking for sema_init in -lthread... " >&6; } +if ${ac_cv_lib_thread_sema_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sema_init (); +int +main () +{ +return sema_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_thread_sema_init=yes +else + ac_cv_lib_thread_sema_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_sema_init" >&5 +$as_echo "$ac_cv_lib_thread_sema_init" >&6; } +if test "x$ac_cv_lib_thread_sema_init" = xyes; then : + + ac_tr_lib=HAVE_LIBTHREAD + cat >>confdefs.h <<_ACEOF +#define $ac_tr_lib 1 +_ACEOF + + LIBS="-lthread $LIBS" + +fi + +fi + +if test $THREADSUPPORT = posix ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_key_create in -lpthread" >&5 +$as_echo_n "checking for pthread_key_create in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_key_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_key_create (); +int +main () +{ +return pthread_key_create (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_key_create=yes +else + ac_cv_lib_pthread_pthread_key_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_key_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_key_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_key_create" = xyes; then : + + ac_tr_lib=HAVE_LIBPTHREAD + cat >>confdefs.h <<_ACEOF +#define $ac_tr_lib 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_init in -lrt" >&5 +$as_echo_n "checking for sem_init in -lrt... " >&6; } +if ${ac_cv_lib_rt_sem_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sem_init (); +int +main () +{ +return sem_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_rt_sem_init=yes +else + ac_cv_lib_rt_sem_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sem_init" >&5 +$as_echo "$ac_cv_lib_rt_sem_init" >&6; } +if test "x$ac_cv_lib_rt_sem_init" = xyes; then : + + ac_tr_lib=HAVE_LIBRT + cat >>confdefs.h <<_ACEOF +#define $ac_tr_lib 1 +_ACEOF + + LIBS="-lrt $LIBS" + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler requires -pthread option for posix threads" >&5 +$as_echo_n "checking whether compiler requires -pthread option for posix threads... " >&6; } +REQUIRES_PTHREAD_OPTION="no" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif + +#include +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + (void) pthread_create(NULL, NULL, NULL, NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + +else + SAVE_CXXFLAGS="$CXXFLAGS" +SAVE_CFLAGS="$CFLAGS" +CXXFLAGS="-pthread $CXXFLAGS" +CFLAGS="-pthread $CFLAGS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif + +#include +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + (void) pthread_create(NULL, NULL, NULL, NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + REQUIRES_PTHREAD_OPTION="yes" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CXXFLAGS="$SAVE_CXXFLAGS" +CFLAGS="$SAVE_CFLAGS" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +if test $REQUIRES_PTHREAD_OPTION = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CXXFLAGS="-pthread $CXXFLAGS" + CFLAGS="-pthread $CFLAGS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + POSIXRWLOCKSAVAILABLE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_init in -lpthread" >&5 +$as_echo_n "checking for pthread_rwlock_init in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_rwlock_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_rwlock_init (); +int +main () +{ +return pthread_rwlock_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_rwlock_init=yes +else + ac_cv_lib_pthread_pthread_rwlock_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_init" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_rwlock_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_rwlock_init" = xyes; then : + + +$as_echo "#define HAVE_PTHREAD_RWLOCK /**/" >>confdefs.h + + POSIXRWLOCKSAVAILABLE="yes" + case "${host}" in + mips-sgi-irix6*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-openbsd3*) + CXXFLAGS="-D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + *-*-openbsd4*) + ;; + *-*-openbsd5*) + ;; + *-*-freebsd*) + ;; + *-*-netbsdelf2*) + ;; + *-*-netbsd*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-darwin*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + ;; + *) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + esac + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_init in default libraries" >&5 +$as_echo_n "checking for pthread_rwlock_init in default libraries... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern "C" int pthread_rwlock_init(void *rwlock, void *attr); + +int +main () +{ +(void) pthread_rwlock_init(NULL, NULL); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PTHREAD_RWLOCK /**/" >>confdefs.h + + POSIXRWLOCKSAVAILABLE="yes" + case "${host}" in + mips-sgi-irix6*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-openbsd3*) + CXXFLAGS="-D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + *-*-openbsd4*) + ;; + *-*-openbsd5*) + ;; + *-*-freebsd*) + ;; + *-*-netbsdelf2*) + ;; + *-*-netbsd*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-darwin*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + ;; + *) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + esac + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking multi-thread support" >&5 +$as_echo_n "checking multi-thread support... " >&6; } +case "$THREADSUPPORT" in + solaris) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, solaris threads" >&5 +$as_echo "yes, solaris threads" >&6; } + CXXFLAGS="-D_REENTRANT $CXXFLAGS" + CFLAGS="-D_REENTRANT $CFLAGS" + +$as_echo "#define WITH_THREADS /**/" >>confdefs.h + + ;; + posix) + if test $POSIXRWLOCKSAVAILABLE = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, posix threads with rwlock" >&5 +$as_echo "yes, posix threads with rwlock" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, posix threads without rwlock" >&5 +$as_echo "yes, posix threads without rwlock" >&6; } + fi + CXXFLAGS="-D_REENTRANT $CXXFLAGS" + CFLAGS="-D_REENTRANT $CFLAGS" + +$as_echo "#define WITH_THREADS /**/" >>confdefs.h + + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + ;; +esac + + +if test $LFSSUPPORT = auto -o $LFSSUPPORT = lfs64; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit large file support" >&5 +$as_echo_n "checking for explicit large file support... " >&6; } + ac_cv_lfs64_support=no + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE + #include +int +main () +{ +FILE *f = fopen64("name", "r"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lfs64_support=yes +else + ac_cv_lfs64_support=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + if test "$ac_cv_lfs64_support" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define DCMTK_ENABLE_LFS DCMTK_LFS64" >>confdefs.h + + +$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + if test $ac_cv_lfs64_support = yes ; then + LFSSUPPORT="lfs64" + fi +fi + +if test $LFSSUPPORT = auto -o $LFSSUPPORT = lfs; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + CXX=$CXX$ac_cv_sys_largefile_CC + fi + + ac_cv_lfs64_support=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + ac_cv_sys_file_offset_bits=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_lfs_support=yes; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; ac_cv_lfs_support=yes; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +if test "$ac_cv_sys_file_offset_bits" != no; then + +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF + +fi +rm -f conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + ac_cv_sys_large_files=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_lfs_support=yes; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; ac_cv_lfs_support=yes; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +if test "$ac_cv_sys_large_files" != no; then + +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF + +fi +rm -f conftest* + + if test "$ac_cv_lfs_support" = yes; then + +$as_echo "#define DCMTK_ENABLE_LFS DCMTK_LFS" >>confdefs.h + + fi + + +fi + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } +if ${ac_cv_type_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_type_size_t=yes +else + ac_cv_type_size_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define HAVE_NO_TYPEDEF_SIZE_T 1 +_ACEOF + +fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } +if ${ac_cv_type_ssize_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((ssize_t *) 0) + return 0; +if (sizeof (ssize_t)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_type_ssize_t=yes +else + ac_cv_type_ssize_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_ssize_t" >&5 +$as_echo "$ac_cv_type_ssize_t" >&6; } +if test $ac_cv_type_ssize_t = yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define HAVE_NO_TYPEDEF_SSIZE_T 1 +_ACEOF + +fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } +if ${ac_cv_type_pid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_type_pid_t=yes +else + ac_cv_type_pid_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test $ac_cv_type_pid_t = yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define HAVE_NO_TYPEDEF_PID_T 1 +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((char) -1) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_c_char_unsigned=no +else + ac_cv_c_char_unsigned=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 +$as_echo_n "checking size of char... " >&6; } +if ${ac_cv_sizeof_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_char=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 +$as_echo "$ac_cv_sizeof_char" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } +if ${ac_cv_sizeof_float+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_float" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_float=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } +if ${ac_cv_sizeof_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_double=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__ macro" >&5 +$as_echo_n "checking for __FUNCTION__ macro... " >&6; } +if ${ac_cv_have___FUNCTION___macro+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +const char * func = __FUNCTION__; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_have___FUNCTION___macro=yes +else + ac_cv_have___FUNCTION___macro=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___FUNCTION___macro" >&5 +$as_echo "$ac_cv_have___FUNCTION___macro" >&6; } + if test "x$ac_cv_have___FUNCTION___macro" = "xyes"; then + $as_echo "#define HAVE___FUNCTION___MACRO 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __PRETTY_FUNCTION__ macro" >&5 +$as_echo_n "checking for __PRETTY_FUNCTION__ macro... " >&6; } +if ${ac_cv_have___PRETTY_FUNCTION___macro+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +const char * func = __PRETTY_FUNCTION__; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_have___PRETTY_FUNCTION___macro=yes +else + ac_cv_have___PRETTY_FUNCTION___macro=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___PRETTY_FUNCTION___macro" >&5 +$as_echo "$ac_cv_have___PRETTY_FUNCTION___macro" >&6; } + if test "x$ac_cv_have___PRETTY_FUNCTION___macro" = "xyes"; then + $as_echo "#define HAVE___PRETTY_FUNCTION___MACRO 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__ macro" >&5 +$as_echo_n "checking for __func__ macro... " >&6; } +if ${ac_cv_have___func___macro+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +const char * func = __func__; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_have___func___macro=yes +else + ac_cv_have___func___macro=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___func___macro" >&5 +$as_echo "$ac_cv_have___func___macro" >&6; } + if test "x$ac_cv_have___func___macro" = "xyes"; then + $as_echo "#define HAVE___func___MACRO 1" >>confdefs.h + + fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for feenableexcept (in fenv.h)" >&5 +$as_echo_n "checking prototype for feenableexcept (in fenv.h)... " >&6; } + +: + +ac_includes="" +for ac_header in fenv.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo feenableexcept | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct feenableexcept(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for _stricmp (in string.h)" >&5 +$as_echo_n "checking prototype for _stricmp (in string.h)... " >&6; } + +: + +ac_includes="" +for ac_header in string.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo _stricmp | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct _stricmp(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for accept (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for accept (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo accept | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct accept(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +if test $ac_cv_prototype_accept = yes ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if accept() needs int* parameters (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking if accept() needs int* parameters (in sys/types.h sys/socket.h)... " >&6; } + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_includes="$ac_includes +#include<$ac_header>" +done +if ${ac_cv_prototype_intp_accept+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + int i; + struct sockaddr *addr; + size_t addrlen; + + addr = 0; + addrlen = 0; + i = accept(1, addr, &addrlen); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_intp_accept=no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + int i; + struct sockaddr *addr; + int addrlen; + + addr = 0; + addrlen = 0; + i = accept(1, addr, &addrlen); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_intp_accept=yes" +else + eval "ac_cv_prototype_intp_accept=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_prototype_intp_accept`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_INTP_ACCEPT + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for bind (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for bind (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo bind | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct bind(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for bzero (in string.h strings.h libc.h unistd.h stdlib.h)" >&5 +$as_echo_n "checking prototype for bzero (in string.h strings.h libc.h unistd.h stdlib.h)... " >&6; } + +: + +ac_includes="" +for ac_header in string.h strings.h libc.h unistd.h stdlib.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo bzero | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct bzero(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for connect (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for connect (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo connect | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct connect(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for finite (in math.h)" >&5 +$as_echo_n "checking prototype for finite (in math.h)... " >&6; } + +: + +ac_includes="" +for ac_header in math.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo finite | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct finite(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for isinf (in math.h)" >&5 +$as_echo_n "checking prototype for isinf (in math.h)... " >&6; } + +: + +ac_includes="" +for ac_header in math.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo isinf | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct isinf(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for isnan (in math.h)" >&5 +$as_echo_n "checking prototype for isnan (in math.h)... " >&6; } + +: + +ac_includes="" +for ac_header in math.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo isnan | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct isnan(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for std::finite (in cmath)" >&5 +$as_echo_n "checking prototype for std::finite (in cmath)... " >&6; } + +: + +ac_includes="" +for ac_header in cmath +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo std::finite | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct std::finite(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for std::isinf (in cmath)" >&5 +$as_echo_n "checking prototype for std::isinf (in cmath)... " >&6; } + +: + +ac_includes="" +for ac_header in cmath +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo std::isinf | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct std::isinf(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for std::isnan (in cmath)" >&5 +$as_echo_n "checking prototype for std::isnan (in cmath)... " >&6; } + +: + +ac_includes="" +for ac_header in cmath +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo std::isnan | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct std::isnan(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for flock (in sys/file.h)" >&5 +$as_echo_n "checking prototype for flock (in sys/file.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/file.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo flock | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct flock(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for gethostbyname (in libc.h unistd.h stdlib.h netdb.h)" >&5 +$as_echo_n "checking prototype for gethostbyname (in libc.h unistd.h stdlib.h netdb.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h unistd.h stdlib.h netdb.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo gethostbyname | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct gethostbyname(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for gethostbyname_r (in libc.h unistd.h stdlib.h netdb.h)" >&5 +$as_echo_n "checking prototype for gethostbyname_r (in libc.h unistd.h stdlib.h netdb.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h unistd.h stdlib.h netdb.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo gethostbyname_r | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct gethostbyname_r(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for gethostbyaddr_r (in libc.h unistd.h stdlib.h netdb.h)" >&5 +$as_echo_n "checking prototype for gethostbyaddr_r (in libc.h unistd.h stdlib.h netdb.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h unistd.h stdlib.h netdb.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo gethostbyaddr_r | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct gethostbyaddr_r(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for gethostid (in libc.h unistd.h stdlib.h netdb.h)" >&5 +$as_echo_n "checking prototype for gethostid (in libc.h unistd.h stdlib.h netdb.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h unistd.h stdlib.h netdb.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo gethostid | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct gethostid(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for gethostname (in unistd.h libc.h stdlib.h netdb.h)" >&5 +$as_echo_n "checking prototype for gethostname (in unistd.h libc.h stdlib.h netdb.h)... " >&6; } + +: + +ac_includes="" +for ac_header in unistd.h libc.h stdlib.h netdb.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo gethostname | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct gethostname(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for getsockname (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for getsockname (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo getsockname | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct getsockname(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for getsockopt (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for getsockopt (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo getsockopt | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct getsockopt(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for strerror_r (in string.h)" >&5 +$as_echo_n "checking prototype for strerror_r (in string.h)... " >&6; } + +: + +ac_includes="" +for ac_header in string.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo strerror_r | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct strerror_r(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +if test $ac_cv_prototype_strerror_r = yes ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r() returns a char * (in string.h)" >&5 +$as_echo_n "checking if strerror_r() returns a char * (in string.h)... " >&6; } + +ac_includes="" +for ac_header in string.h +do + ac_includes="$ac_includes +#include<$ac_header>" +done +if ${ac_cv_prototype_charp_strerror_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + char *buf = 0; + int i = strerror_r(0, buf, 100) + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_charp_strerror_r=no" +else + eval "ac_cv_prototype_charp_strerror_r=yes" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_prototype_charp_strerror_r`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_CHARP_STRERROR_R + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +fi +if test $ac_cv_prototype_getsockopt = yes ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if getsockopt() needs int* parameters (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking if getsockopt() needs int* parameters (in sys/types.h sys/socket.h)... " >&6; } + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_includes="$ac_includes +#include<$ac_header>" +done +if ${ac_cv_prototype_intp_getsockopt+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + int i; + size_t optlen; + i = getsockopt(0, 0, 0, 0, &optlen); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_intp_getsockopt=no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + int i; + int optlen; + i = getsockopt(0, 0, 0, 0, &optlen); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_intp_getsockopt=yes" +else + eval "ac_cv_prototype_intp_getsockopt=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_prototype_intp_getsockopt`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_INTP_GETSOCKOPT + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for gettimeofday (in sys/time.h unistd.h)" >&5 +$as_echo_n "checking prototype for gettimeofday (in sys/time.h unistd.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/time.h unistd.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo gettimeofday | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct gettimeofday(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for listen (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for listen (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo listen | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct listen(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for mktemp (in libc.h unistd.h stdlib.h)" >&5 +$as_echo_n "checking prototype for mktemp (in libc.h unistd.h stdlib.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h unistd.h stdlib.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo mktemp | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct mktemp(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for mkstemp (in libc.h unistd.h stdlib.h)" >&5 +$as_echo_n "checking prototype for mkstemp (in libc.h unistd.h stdlib.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h unistd.h stdlib.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo mkstemp | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct mkstemp(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for select (in sys/select.h sys/types.h sys/socket.h sys/time.h)" >&5 +$as_echo_n "checking prototype for select (in sys/select.h sys/types.h sys/socket.h sys/time.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/select.h sys/types.h sys/socket.h sys/time.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo select | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct select(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +if test $ac_cv_prototype_select = yes ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select() needs int* parameters (in sys/select.h sys/types.h sys/socket.h sys/time.h)" >&5 +$as_echo_n "checking if select() needs int* parameters (in sys/select.h sys/types.h sys/socket.h sys/time.h)... " >&6; } + +ac_includes="" +for ac_header in sys/select.h sys/types.h sys/socket.h sys/time.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +if ${ac_cv_prototype_intp_select+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + int i; + fd_set fds; + i = select(1, &fds, &fds, &fds, NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_intp_select=no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + int i; + int fds; + i = select(1, &fds, &fds, &fds, NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_intp_select=yes" +else + eval "ac_cv_prototype_intp_select=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_prototype_intp_select`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_INTP_SELECT + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for setsockopt (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for setsockopt (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo setsockopt | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct setsockopt(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for socket (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking prototype for socket (in sys/types.h sys/socket.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo socket | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct socket(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for strcasecmp (in string.h)" >&5 +$as_echo_n "checking prototype for strcasecmp (in string.h)... " >&6; } + +: + +ac_includes="" +for ac_header in string.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo strcasecmp | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct strcasecmp(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for strncasecmp (in string.h)" >&5 +$as_echo_n "checking prototype for strncasecmp (in string.h)... " >&6; } + +: + +ac_includes="" +for ac_header in string.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo strncasecmp | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct strncasecmp(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for usleep (in libc.h unistd.h stdlib.h)" >&5 +$as_echo_n "checking prototype for usleep (in libc.h unistd.h stdlib.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h unistd.h stdlib.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo usleep | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct usleep(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for vsnprintf (in stdio.h stdarg.h)" >&5 +$as_echo_n "checking prototype for vsnprintf (in stdio.h stdarg.h)... " >&6; } + +: + +ac_includes="" +for ac_header in stdio.h stdarg.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo vsnprintf | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct vsnprintf(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for wait3 (in libc.h sys/wait.h sys/time.h sys/resource.h)" >&5 +$as_echo_n "checking prototype for wait3 (in libc.h sys/wait.h sys/time.h sys/resource.h)... " >&6; } + +: + +ac_includes="" +for ac_header in libc.h sys/wait.h sys/time.h sys/resource.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo wait3 | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct wait3(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototype for waitpid (in sys/wait.h sys/time.h sys/resource.h)" >&5 +$as_echo_n "checking prototype for waitpid (in sys/wait.h sys/time.h sys/resource.h)... " >&6; } + +: + +ac_includes="" +for ac_header in sys/wait.h sys/time.h sys/resource.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo waitpid | tr ' :' '__'` +if eval \${ac_cv_prototype_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +typedef union { int member; } dummyStruct; +#ifdef __cplusplus +extern "C" +#endif +dummyStruct waitpid(dummyStruct); + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_prototype_$tmp_save_1=no" +else + eval "ac_cv_prototype_$tmp_save_1=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_prototype_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking declaration for struct utimbuf (in sys/types.h utime.h sys/utime.h)" >&5 +$as_echo_n "checking declaration for struct utimbuf (in sys/types.h utime.h sys/utime.h)... " >&6; } + +ac_includes="" +for ac_header in sys/types.h utime.h sys/utime.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done + +ac_cpp_includes="" + +ac_cv_declaration=`echo 'ac_cv_declaration_struct utimbuf' | tr ' :' '__'` + +if eval \${$ac_cv_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +$ac_cpp_includes +struct utimbuf dummy; + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$ac_cv_declaration=yes" +else + eval "$ac_cv_declaration=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"\$$ac_cv_declaration\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_declaration=HAVE_DECLARATION_`echo struct utimbuf | tr ' :[a-z]' '__[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_declaration 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +unset ac_cv_declaration + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking declaration for socklen_t (in sys/types.h sys/socket.h)" >&5 +$as_echo_n "checking declaration for socklen_t (in sys/types.h sys/socket.h)... " >&6; } + +ac_includes="" +for ac_header in sys/types.h sys/socket.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done + +ac_cpp_includes="" + +ac_cv_declaration=`echo 'ac_cv_declaration_socklen_t' | tr ' :' '__'` + +if eval \${$ac_cv_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +$ac_cpp_includes +socklen_t dummy; + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$ac_cv_declaration=yes" +else + eval "$ac_cv_declaration=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"\$$ac_cv_declaration\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_declaration=HAVE_DECLARATION_`echo socklen_t | tr ' :[a-z]' '__[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_declaration 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +unset ac_cv_declaration + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if declaration of readdir_r conforms to Posix 1.c draft 6" >&5 +$as_echo_n "checking if declaration of readdir_r conforms to Posix 1.c draft 6... " >&6; } + +ac_cv_result=ac_cv_old_readdir_r +if eval \${$ac_cv_result+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __cplusplus +extern "C" { +#endif +#ifdef HAVE_DIRENT_H +#include +#else +#define dirent direct +#ifdef HAVE_SYS_NDIR_H +#include +#endif +#ifdef HAVE_SYS_DIR_H +#include +#endif +#ifdef HAVE_NDIR_H +#include +#endif +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ + + DIR *dirp; + struct dirent *dp; + dp = readdir_r(dirp, dp); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$ac_cv_result=yes" +else + eval "$ac_cv_result=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"\$$ac_cv_result\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_cv_result=HAVE_OLD_READDIR_R + cat >>confdefs.h <<_ACEOF +#define $ac_cv_result 1 +_ACEOF + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +unset ac_cv_result + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal() callback needs ellipse (in signal.h)" >&5 +$as_echo_n "checking if signal() callback needs ellipse (in signal.h)... " >&6; } + +ac_includes="" +for ac_header in signal.h +do + ac_includes="$ac_includes +#include<$ac_header>" +done +if ${ac_cv_signal_handler_with_ellipse+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes + + void signal_handler(int) + { + } +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + (void) signal(0, signal_handler); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_signal_handler_with_ellipse=no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes + + void signal_handler(...) + { + } +#ifdef __cplusplus +} +#endif + + +int +main () +{ + + (void) signal(0, signal_handler); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_signal_handler_with_ellipse=yes" +else + eval "ac_cv_signal_handler_with_ellipse=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_signal_handler_with_ellipse`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=SIGNAL_HANDLER_WITH_ELLIPSE + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +if test $ac_cv_header_math_h = yes ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if fails if included extern \"C\"" >&5 +$as_echo_n "checking if fails if included extern \"C\"... " >&6; } + +if ${ac_cv_include_math_h_as_cxx+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +extern "C" +{ +#include +} + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_include_math_h_as_cxx=no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_include_math_h_as_cxx=yes" +else + eval "ac_cv_include_math_h_as_cxx=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_include_math_h_as_cxx`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=INCLUDE_MATH_H_AS_CXX + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use C++ standard includes" >&5 +$as_echo_n "checking whether to use C++ standard includes... " >&6; } +ac_use_std_includes="auto" +# Check whether --enable-std-includes was given. +if test "${enable_std_includes+set}" = set; then : + enableval=$enable_std_includes; case "$enableval" in + yes) + ac_use_std_includes="yes" + ;; + + *) + ac_use_std_includes="no" + ;; + esac + +fi + + +if test "$ac_cv_header_fstream" = "yes" -a "$ac_cv_header_iostream" = "yes" -a "$ac_cv_header_iomanip" = "yes"; then + ac_have_std_includes="yes" +else + ac_have_std_includes="no" +fi + +if test "$ac_cv_header_fstream_h" = "yes" -a "$ac_cv_header_iostream_h" = "yes" -a "$ac_cv_header_iomanip_h" = "yes"; then + ac_have_old_includes="yes" +else + ac_have_old_includes="no" +fi + +if test "$ac_use_std_includes" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define USE_STD_CXX_INCLUDES /**/" >>confdefs.h + +elif test "$ac_use_std_includes" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +elif test "$ac_have_std_includes" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define USE_STD_CXX_INCLUDES /**/" >>confdefs.h + + ac_use_std_includes="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_use_std_includes="no" +fi + +if test "$ac_use_std_includes" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ standard namespace" >&5 +$as_echo_n "checking for C++ standard namespace... " >&6; } + +if ${ac_cv_check_std_namespace+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5' +cat > conftest.$ac_ext < +using namespace std; + +int main() { + + cout << "Hello World" << endl; + +; return 0; } +EOF +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link_o\""; } >&5 + (eval $ac_link_o) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + rm -rf conftest* + eval "ac_cv_check_std_namespace=yes" + else + echo "configure: failed link was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_std_namespace=no" + fi +else + echo "configure: failed compile was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_std_namespace=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_check_std_namespace'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_std_namespace=HAVE_STD_NAMESPACE + cat >>confdefs.h <<_ACEOF +#define $ac_tr_std_namespace 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking declaration for std::ios_base::openmode (in iostream)" >&5 +$as_echo_n "checking declaration for std::ios_base::openmode (in iostream)... " >&6; } + +ac_includes="" + +ac_cpp_includes="" +for ac_header in iostream +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_cpp_includes="$ac_cpp_includes +#include<$ac_header>" + fi +done + +ac_cv_declaration=`echo 'ac_cv_declaration_std::ios_base::openmode' | tr ' :' '__'` + +if eval \${$ac_cv_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +$ac_cpp_includes +std::ios_base::openmode dummy; + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$ac_cv_declaration=yes" +else + eval "$ac_cv_declaration=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"\$$ac_cv_declaration\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_declaration=HAVE_DECLARATION_`echo std::ios_base::openmode | tr ' :[a-z]' '__[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_declaration 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +unset ac_cv_declaration + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking declaration of ios::nocreate (in fstream)" >&5 +$as_echo_n "checking declaration of ios::nocreate (in fstream)... " >&6; } + +ac_cv_declaration=ac_cv_declaration_ios_nocreate +if eval \${$ac_cv_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ +namespace std { } +using namespace std; +ifstream file("name", std::ios::nocreate) + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$ac_cv_declaration=yes" +else + eval "$ac_cv_declaration=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"\$$ac_cv_declaration\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_declaration=HAVE_IOS_NOCREATE + cat >>confdefs.h <<_ACEOF +#define $ac_tr_declaration 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +unset ac_cv_declaration + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::vfprintf (in cstdarg cstdio)" >&5 +$as_echo_n "checking for std::vfprintf (in cstdarg cstdio)... " >&6; } + +ac_includes="" +for ac_header in cstdarg cstdio +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo std::vfprintf | tr ' :' '__'` +if eval \${ac_cv_compiles_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes +int +main () +{ +FILE *stream; va_list ap; std::vfprintf(stream, "", ap); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_compiles_$tmp_save_1=yes" +else + eval "ac_cv_compiles_$tmp_save_1=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_compiles_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::vsnprintf (in cstdarg cstdio)" >&5 +$as_echo_n "checking for std::vsnprintf (in cstdarg cstdio)... " >&6; } + +ac_includes="" +for ac_header in cstdarg cstdio +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo std::vsnprintf | tr ' :' '__'` +if eval \${ac_cv_compiles_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes +int +main () +{ +char buf[256]; va_list ap; std::vsnprintf(buf, 0, "", ap); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_compiles_$tmp_save_1=yes" +else + eval "ac_cv_compiles_$tmp_save_1=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_compiles_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +else + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking declaration for std::ios_base::openmode (in iostream.h)" >&5 +$as_echo_n "checking declaration for std::ios_base::openmode (in iostream.h)... " >&6; } + +ac_includes="" + +ac_cpp_includes="" +for ac_header in iostream.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_cpp_includes="$ac_cpp_includes +#include<$ac_header>" + fi +done + +ac_cv_declaration=`echo 'ac_cv_declaration_std::ios_base::openmode' | tr ' :' '__'` + +if eval \${$ac_cv_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif +$ac_includes +#ifdef __cplusplus +} +#endif +$ac_cpp_includes +std::ios_base::openmode dummy; + + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$ac_cv_declaration=yes" +else + eval "$ac_cv_declaration=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"\$$ac_cv_declaration\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_declaration=HAVE_DECLARATION_`echo std::ios_base::openmode | tr ' :[a-z]' '__[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_declaration 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +unset ac_cv_declaration + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking declaration of ios::nocreate (in fstream.h)" >&5 +$as_echo_n "checking declaration of ios::nocreate (in fstream.h)... " >&6; } + +ac_cv_declaration=ac_cv_declaration_ios_nocreate +if eval \${$ac_cv_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ +namespace std { } +using namespace std; +ifstream file("name", ios::nocreate) + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$ac_cv_declaration=yes" +else + eval "$ac_cv_declaration=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"\$$ac_cv_declaration\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_declaration=HAVE_IOS_NOCREATE + cat >>confdefs.h <<_ACEOF +#define $ac_tr_declaration 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +unset ac_cv_declaration + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::vfprintf (in stdarg.h stdio.h)" >&5 +$as_echo_n "checking for std::vfprintf (in stdarg.h stdio.h)... " >&6; } + +ac_includes="" +for ac_header in stdarg.h stdio.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo std::vfprintf | tr ' :' '__'` +if eval \${ac_cv_compiles_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes +int +main () +{ +FILE *stream; va_list ap; std::vfprintf(stream, "", ap); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_compiles_$tmp_save_1=yes" +else + eval "ac_cv_compiles_$tmp_save_1=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_compiles_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::vsnprintf (in stdarg.h stdio.h)" >&5 +$as_echo_n "checking for std::vsnprintf (in stdarg.h stdio.h)... " >&6; } + +ac_includes="" +for ac_header in stdarg.h stdio.h +do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'}'`\" = yes"; then + ac_includes="$ac_includes +#include<$ac_header>" + fi +done +tmp_save_1=`echo std::vsnprintf | tr ' :' '__'` +if eval \${ac_cv_compiles_$tmp_save_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes +int +main () +{ +char buf[256]; va_list ap; std::vsnprintf(buf, 0, "", ap); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_compiles_$tmp_save_1=yes" +else + eval "ac_cv_compiles_$tmp_save_1=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$''{'ac_cv_compiles_$tmp_save_1'}'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_PROTOTYPE_`echo $tmp_save_1 | tr '[a-z]' '[A-Z]'` + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ class template" >&5 +$as_echo_n "checking for C++ class template... " >&6; } + +if ${ac_cv_check_class_template+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5' +cat > conftest.$ac_ext < +class x +{ +private: + T a; +public: + void set(T i) { a = i; } + x(T i) { set(i); } + T get() { return a; } +}; + +int main() { + + int i; + x a(4); + i = a.get(); + a.set(18); + i = a.get(); + a.set(i-1); + +; return 0; } +EOF +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link_o\""; } >&5 + (eval $ac_link_o) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + rm -rf conftest* + eval "ac_cv_check_class_template=yes" + else + echo "configure: failed link was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_class_template=no" + fi +else + echo "configure: failed compile was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_class_template=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_check_class_template'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_class_template=HAVE_CLASS_TEMPLATE + cat >>confdefs.h <<_ACEOF +#define $ac_tr_class_template 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ static methods in class templates" >&5 +$as_echo_n "checking for C++ static methods in class templates... " >&6; } + +if ${ac_cv_check_static_template_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5' +cat > conftest.$ac_ext < +class x +{ +public: + x() { } + static void do1(Function f, int & a) { f(a); } + static void do2(T b) { T a = b; }; +}; + +int main() { + + int a = 1; + x::do1(additive, a); + x::do2(a); + +; return 0; } +EOF +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link_o\""; } >&5 + (eval $ac_link_o) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + rm -rf conftest* + eval "ac_cv_check_static_template_method=yes" + else + echo "configure: failed link was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_static_template_method=no" + fi +else + echo "configure: failed compile was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_static_template_method=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_check_static_template_method'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_static_template_method=HAVE_STATIC_TEMPLATE_METHOD + cat >>confdefs.h <<_ACEOF +#define $ac_tr_static_template_method 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ function template" >&5 +$as_echo_n "checking for C++ function template... " >&6; } + +if ${ac_cv_check_function_template+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5' +cat > conftest.$ac_ext < +int f(T* a) +{ + if (a) return 1; + return 0; +} + +int main() { + + int i, a; + i = f(&a); + +; return 0; } +EOF +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link_o\""; } >&5 + (eval $ac_link_o) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + rm -rf conftest* + eval "ac_cv_check_function_template=yes" + else + echo "configure: failed link was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_function_template=no" + fi +else + echo "configure: failed compile was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_check_function_template=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_check_function_template'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_function_template=HAVE_FUNCTION_TEMPLATE + cat >>confdefs.h <<_ACEOF +#define $ac_tr_function_template 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ explicit template specialization syntax" >&5 +$as_echo_n "checking for C++ explicit template specialization syntax... " >&6; } + +if ${ac_cv_check_explicit_template_specialization+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +template +class X +{ + public: + int fn(); +}; + +template<> +int X::fn() +{ + return 0; +} + +int +main () +{ +X x + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_check_explicit_template_specialization=yes" +else + eval "ac_cv_check_explicit_template_specialization=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if eval "test \"`echo '$ac_cv_check_explicit_template_specialization'`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_explicit_template_specialization=HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION + cat >>confdefs.h <<_ACEOF +#define $ac_tr_explicit_template_specialization 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if bool is built-in type" >&5 +$as_echo_n "checking if bool is built-in type... " >&6; } + +if ${ac_cv_have_cxx_bool+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +bool b1 = true; +bool b2 = false; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_have_cxx_bool=yes" +else + eval "ac_cv_have_cxx_bool=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_have_cxx_bool`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_CXX_BOOL + cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype 1 +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if volatile is known keyword" >&5 +$as_echo_n "checking if volatile is known keyword... " >&6; } + +if ${ac_cv_have_cxx_volatile+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +volatile int i=0; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "ac_cv_have_cxx_volatile=yes" +else + eval "ac_cv_have_cxx_volatile=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo $ac_cv_have_cxx_volatile`\" = yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_tr_prototype=HAVE_CXX_VOLATILE + +cat >>confdefs.h <<_ACEOF +#define $ac_tr_prototype /**/ +_ACEOF + + : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler recognizes typename" >&5 +$as_echo_n "checking whether the compiler recognizes typename... " >&6; } +if ${ac_cv_cxx_typename+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +templateclass X {public:X(){}}; +int +main () +{ +X z; return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_typename=yes +else + ac_cv_cxx_typename=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_typename" >&5 +$as_echo "$ac_cv_cxx_typename" >&6; } +if test "$ac_cv_cxx_typename" = yes; then + +$as_echo "#define HAVE_TYPENAME /**/" >>confdefs.h + +fi + + + ac_cv_stdio_namespace_is_std=no + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef USE_STD_CXX_INCLUDES +#include +#else +#include +#endif + +int +main () +{ +FILE *f = ::fopen("name", "r"); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_stdio_namespace_is_std=no +else + ac_cv_stdio_namespace_is_std=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + if test "$ac_cv_stdio_namespace_is_std" = yes; then + $as_echo "#define STDIO_NAMESPACE std::" >>confdefs.h + + else + $as_echo "#define STDIO_NAMESPACE ::" >>confdefs.h + + fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable private tag dictionary" >&5 +$as_echo_n "checking whether to enable private tag dictionary... " >&6; } +# Check whether --enable-private-tags was given. +if test "${enable_private_tags+set}" = set; then : + enableval=$enable_private_tags; case "$enableval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define ENABLE_PRIVATE_TAGS /**/" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define DCM_DICT_DEFAULT_PATH "${DATA_DIR}/dicom.dic:${DATA_DIR}/private.dic" +_ACEOF + + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable loading external dictionary from default path" >&5 +$as_echo_n "checking whether to enable loading external dictionary from default path... " >&6; } +# Check whether --enable-external-dict was given. +if test "${enable_external_dict+set}" = set; then : + enableval=$enable_external_dict; case "$enableval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define ENABLE_EXTERNAL_DICTIONARY /**/" >>confdefs.h + + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +cat >>confdefs.h <<_ACEOF +#define DCM_DICT_DEFAULT_PATH "" +_ACEOF + + ;; + esac +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define ENABLE_EXTERNAL_DICTIONARY /**/" >>confdefs.h + + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable built-in dictionary loading" >&5 +$as_echo_n "checking whether to enable built-in dictionary loading... " >&6; } +# Check whether --enable-builtin-dict was given. +if test "${enable_builtin_dict+set}" = set; then : + enableval=$enable_builtin_dict; case "$enableval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define ENABLE_BUILTIN_DICTIONARY /**/" >>confdefs.h + + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wl,-rpath is supported" >&5 +$as_echo_n "checking whether -Wl,-rpath is supported... " >&6; } +if ${dcmtk_cv_rpath_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; dcmtk_cv_rpath_works=$enableval +else + old_LDFLAGS="$LDFLAGS" + LDFLAGS="-Wl,-rpath,$srcdir $LDFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + dcmtk_cv_rpath_works=yes +else + dcmtk_cv_rpath_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$old_LDFLAGS" +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dcmtk_cv_rpath_works" >&5 +$as_echo "$dcmtk_cv_rpath_works" >&6; } + + + +# Check whether --with-opensslinc was given. +if test "${with_opensslinc+set}" = set; then : + withval=$with_opensslinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-opensslinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-opensslinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-opensslinc but OpenSSL base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include OpenSSL support" >&5 +$as_echo_n "checking whether to include OpenSSL support... " >&6; } + +# Check whether --with-openssl was given. +if test "${with_openssl+set}" = set; then : + withval=$with_openssl; case "$withval" in + yes) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#if OPENSSL_VERSION_NUMBER < 0x10001000L +#error OpenSSL too old +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_OPENSSL /**/" >>confdefs.h + + OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - DCMTK requires OpenSSL version 1.0.1 or newer" >&5 +$as_echo "no - DCMTK requires OpenSSL version 1.0.1 or newer" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="$LIBS $OPENSSLLIBS -lssl -lcrypto" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +(void) TLSv1_method() + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#if OPENSSL_VERSION_NUMBER < 0x10001000L +#error OpenSSL too old +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_OPENSSL /**/" >>confdefs.h + + OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - DCMTK requires OpenSSL version 1.0.1 or newer" >&5 +$as_echo "no - DCMTK requires OpenSSL version 1.0.1 or newer" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" +fi + + + + SAVELIBS=$LIBS + HAVE_SSL_CTX_GET0_PARAM=yes + LIBS="$LIBS $OPENSSLLIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL provides the SSL_CTX_get0_param function" >&5 +$as_echo_n "checking whether OpenSSL provides the SSL_CTX_get0_param function... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main () +{ +&SSL_CTX_get0_param; + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + $as_echo "#define HAVE_SSL_CTX_GET0_PARAM 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + LIBS=$SAVELIBS + + + SAVELIBS=$LIBS + HAVE_RAND_EGD=yes + LIBS="$LIBS $OPENSSLLIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL provides the RAND_egd function" >&5 +$as_echo_n "checking whether OpenSSL provides the RAND_egd function... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main () +{ +&RAND_egd; + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + $as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + LIBS=$SAVELIBS + + + +JPEGLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_set_defaults in -ljpeg" >&5 +$as_echo_n "checking for jpeg_set_defaults in -ljpeg... " >&6; } +if ${ac_cv_lib_jpeg_jpeg_set_defaults+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_set_defaults (); +int +main () +{ +return jpeg_set_defaults (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_jpeg_jpeg_set_defaults=yes +else + ac_cv_lib_jpeg_jpeg_set_defaults=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_set_defaults" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_set_defaults" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_set_defaults" = xyes; then : + +JPEGLIBS="-ljpeg" + +fi + +if test $ac_cv_lib_jpeg_jpeg_set_defaults = no ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jSetDefaults in -ljpeg" >&5 +$as_echo_n "checking for jSetDefaults in -ljpeg... " >&6; } +if ${ac_cv_lib_jpeg_jSetDefaults+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jSetDefaults (); +int +main () +{ +return jSetDefaults (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_jpeg_jSetDefaults=yes +else + ac_cv_lib_jpeg_jSetDefaults=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jSetDefaults" >&5 +$as_echo "$ac_cv_lib_jpeg_jSetDefaults" >&6; } +if test "x$ac_cv_lib_jpeg_jSetDefaults" = xyes; then : + +JPEGLIBS="-ljpeg" + +fi + +fi + + + + +# Check whether --with-zlibinc was given. +if test "${with_zlibinc+set}" = set; then : + withval=$with_zlibinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-zlibinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-zlibinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-zlibinc but zlib base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +ZLIBLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include zlib support" >&5 +$as_echo_n "checking whether to include zlib support... " >&6; } + +# Check whether --with-zlib was given. +if test "${with_zlib+set}" = set; then : + withval=$with_zlib; case "$withval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_ZLIB /**/" >>confdefs.h + + ZLIBLIBS="-lz" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="$LIBS -lz" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +(void) zlibVersion() + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_ZLIB /**/" >>confdefs.h + + ZLIBLIBS="-lz" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" +fi + + + + + +# Check whether --with-libtiffinc was given. +if test "${with_libtiffinc+set}" = set; then : + withval=$with_libtiffinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libtiffinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-libtiffinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-libtiffinc but libtiff base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +TIFFLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include libtiff support" >&5 +$as_echo_n "checking whether to include libtiff support... " >&6; } + +# Check whether --with-libtiff was given. +if test "${with_libtiff+set}" = set; then : + withval=$with_libtiff; case "$withval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_LIBTIFF /**/" >>confdefs.h + + TIFFLIBS="-ltiff $JPEGLIBS $ZLIBLIBS" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="$LIBS -ltiff $JPEGLIBS $ZLIBLIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +(void) TIFFGetVersion() + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_LIBTIFF /**/" >>confdefs.h + + TIFFLIBS="-ltiff $JPEGLIBS $ZLIBLIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" +fi + + + + + + +# Check whether --with-libpnginc was given. +if test "${with_libpnginc+set}" = set; then : + withval=$with_libpnginc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libpnginc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-libpnginc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-libpnginc but libpng base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +for ac_header in libpng/png.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "libpng/png.h" "ac_cv_header_libpng_png_h" "$ac_includes_default" +if test "x$ac_cv_header_libpng_png_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPNG_PNG_H 1 +_ACEOF + +fi + +done + + +PNGLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include libpng support" >&5 +$as_echo_n "checking whether to include libpng support... " >&6; } + +# Check whether --with-libpng was given. +if test "${with_libpng+set}" = set; then : + withval=$with_libpng; case "$withval" in + yes) + if test "x$ZLIBLIBS" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_LIBPNG /**/" >>confdefs.h + + PNGLIBS="-lpng" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no because libpng requires zlib" >&5 +$as_echo "no because libpng requires zlib" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + if test "x$ZLIBLIBS" != x; then + SAVELIBS="$LIBS" + LIBS="$LIBS -lpng $ZLIBLIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef HAVE_LIBPNG_PNG_H +#include +#else +#include +#endif +int +main () +{ +(void) png_access_version_number() + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_LIBPNG /**/" >>confdefs.h + + PNGLIBS="-lpng" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$SAVELIBS" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no because libpng requires zlib" >&5 +$as_echo "no because libpng requires zlib" >&6; } + fi + +fi + + + + + +# Check whether --with-libxmlinc was given. +if test "${with_libxmlinc+set}" = set; then : + withval=$with_libxmlinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libxmlinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-libxmlinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-libxmlinc but libxml base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +LIBXMLCFLAGS=`xml2-config --cflags 2>/dev/null` +if test "${LIBXMLCFLAGS+set}" = set; then + CXXFLAGS="$LIBXMLCFLAGS $CXXFLAGS" + CFLAGS="$LIBXMLCFLAGS $CFLAGS" +fi +LIBXMLLIBS=`xml2-config --libs 2>/dev/null` + +XMLLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include libxml support" >&5 +$as_echo_n "checking whether to include libxml support... " >&6; } + +# Check whether --with-libxml was given. +if test "${with_libxml+set}" = set; then : + withval=$with_libxml; case "$withval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_LIBXML /**/" >>confdefs.h + + XMLLIBS=$LIBXMLLIBS + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="$LIBS $LIBXMLLIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +(void) xmlInitParser() + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_LIBXML /**/" >>confdefs.h + + XMLLIBS=$LIBXMLLIBS +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" +fi + + + + + +# Check whether --with-libwrapinc was given. +if test "${with_libwrapinc+set}" = set; then : + withval=$with_libwrapinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libwrapinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-libwrapinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-libwrapinc but libwrap base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +TCPWRAPPERLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include libwrap support" >&5 +$as_echo_n "checking whether to include libwrap support... " >&6; } + +# Check whether --with-libwrap was given. +if test "${with_libwrap+set}" = set; then : + withval=$with_libwrap; case "$withval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_TCPWRAPPER /**/" >>confdefs.h + + TCPWRAPPERLIBS="-lwrap" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="-lwrap $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __cplusplus + extern "C" { + #endif + #ifdef HAVE_STDIO_H + /* on some platforms, tcpd.h needs stdio.h */ + #include + #endif + #ifdef HAVE_SYS_TYPES_H + /* on some platforms, tcpd.h needs sys/types.h */ + #include + #endif + #include + #ifdef __cplusplus + } + #endif + int deny_severity = 0; + int allow_severity = 0; +int +main () +{ +struct request_info r; (void) hosts_access(&r) + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_TCPWRAPPER /**/" >>confdefs.h + + TCPWRAPPERLIBS="-lwrap" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" +fi + + + + + + +# Check whether --with-openjpeginc was given. +if test "${with_openjpeginc+set}" = set; then : + withval=$with_openjpeginc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-openjpeginc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-openjpeginc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-openjpeginc but OpenJPEG base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + OPENJPEGINCLUDEPATH=`( + eval echo "${withval}/include/openjpeg*" + )` + + if test ! -d "${OPENJPEGINCLUDEPATH}"; then + OPENJPEGINCLUDEPATH="${withval}/include" + fi + + CPPFLAGS="-I${OPENJPEGINCLUDEPATH} $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include OpenJPEG support" >&5 +$as_echo_n "checking whether to include OpenJPEG support... " >&6; } + +# Check whether --with-libwrap was given. +if test "${with_libwrap+set}" = set; then : + withval=$with_libwrap; case "$withval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_OPENJPEG /**/" >>confdefs.h + + OPENJPEGLIBS="-lopenjp2 $OPENJPEGLIBS" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="-lopenjp2 $OPENJPEGLIBS $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +(void) opj_version() + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_OPENJPEG /**/" >>confdefs.h + + OPENJPEGLIBS="-lopenjp2 $OPENJPEGLIBS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" +fi + + + + + + +# Check whether --with-libsndfileinc was given. +if test "${with_libsndfileinc+set}" = set; then : + withval=$with_libsndfileinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libsndfileinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-libsndfileinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-libsndfileinc but libsndfile base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +SNDFILELIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include libsndfile support" >&5 +$as_echo_n "checking whether to include libsndfile support... " >&6; } + +# Check whether --with-libsndfile was given. +if test "${with_libsndfile+set}" = set; then : + withval=$with_libsndfile; case "$withval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_SNDFILE /**/" >>confdefs.h + + SNDFILELIBS="-lsndfile" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="$LIBS -lsndfile" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char buffer [128]; sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_SNDFILE /**/" >>confdefs.h + + SNDFILELIBS="-lsndfile" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" + +fi + + + + + +# Check whether --with-libiconvinc was given. +if test "${with_libiconvinc+set}" = set; then : + withval=$with_libiconvinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libiconvinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-libiconvinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-libiconvinc but libiconv base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +WITH_LIBICONV=no +ICONVLIBS="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include libiconv support" >&5 +$as_echo_n "checking whether to include libiconv support... " >&6; } + +# Check whether --with-libiconv was given. +if test "${with_libiconv+set}" = set; then : + withval=$with_libiconv; case "$withval" in + yes) + WITH_LIBICONV=yes + $as_echo "#define WITH_LIBICONV 1" >>confdefs.h + + ICONVLIBS="-liconv -lcharset" + ;; + *) + ;; + esac +else + SAVELIBS="$LIBS" + LIBS="$LIBS -liconv -lcharset" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +iconv_t cd = iconv_open("", ""); iconv(cd, 0, 0, 0, 0); iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + WITH_LIBICONV=yes + $as_echo "#define WITH_LIBICONV 1" >>confdefs.h + + ICONVLIBS="-liconv -lcharset" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$SAVELIBS" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_LIBICONV" >&5 +$as_echo "$WITH_LIBICONV" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the second argument to iconv() is const" >&5 +$as_echo_n "checking whether the second argument to iconv() is const... " >&6; } +SAVELIBS="$LIBS" +LIBS="$LIBS $ICONVLIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +iconv_t cd = iconv_open("", ""); const char *in = 0; iconv(cd, &in, 0, 0, 0); iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define LIBICONV_SECOND_ARGUMENT_CONST /**/" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +LIBS="$SAVELIBS" + + +WITH_STDLIBC_ICONV=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C standard library provides iconv functionality" >&5 +$as_echo_n "checking whether the C standard library provides iconv functionality... " >&6; } +SAVELIBS="$LIBS" +LIBS="" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +iconv_t cd=iconv_open("","");iconv(cd,0,0,0,0);iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + WITH_STDLIBC_ICONV=yes + $as_echo "#define WITH_STDLIBC_ICONV 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_STDLIBC_ICONV" >&5 +$as_echo "$WITH_STDLIBC_ICONV" >&6; } +LIBS="$SAVELIBS" + + + + +# Check whether --with-libicuinc was given. +if test "${with_libicuinc+set}" = set; then : + withval=$with_libicuinc; case $withval in #( + yes|no) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libicuinc called without argument - will use default" >&5 +$as_echo "$as_me: WARNING: --with-libicuinc called without argument - will use default" >&2;} + ;; #( + *) : + + if test ! -d ${withval}; then + as_fn_error $? "called with --with-libicuinc but libicu base directory ${withval} does not exist or is not a directory." "$LINENO" 5 + fi + + CPPFLAGS="-I${withval}/include $CPPFLAGS" + LDFLAGS="-L${withval}/lib $LDFLAGS" + if test "x$dcmtk_cv_rpath_works" = "xyes"; then + LDFLAGS="-Wl,-rpath,${withval}/lib $LDFLAGS" + fi + ;; +esac + +fi + + +WITH_LIBICU=no + +# Check whether --with-libicu was given. +if test "${with_libicu+set}" = set; then : + withval=$with_libicu; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include ICU support" >&5 +$as_echo_n "checking whether to include ICU support... " >&6; } + case "$withval" in + yes) + WITH_LIBICU=yes + $as_echo "#define WITH_LIBICU 1" >>confdefs.h + + ICULIBS="-licui18n -licuuc -licudata" + ;; + *) + ;; + esac +else + + if test -z "$ICU_CONFIG"; then + # Extract the first word of "icu-config", so it can be a program name with args. +set dummy icu-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ICU_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ICU_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ICU_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_ICU_CONFIG" && ac_cv_path_ICU_CONFIG="no" + ;; +esac +fi +ICU_CONFIG=$ac_cv_path_ICU_CONFIG +if test -n "$ICU_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_CONFIG" >&5 +$as_echo "$ICU_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include ICU support" >&5 +$as_echo_n "checking whether to include ICU support... " >&6; } + fi + if [ ! "$ICU_CONFIG" = "no" ]; then + ICU_VERSION=`$ICU_CONFIG --version` + VERSION_CHECK=`expr $ICU_VERSION \>\= 3.4.1` + if test VERSION_CHECK=1; then + WITH_LIBICU=yes + $as_echo "#define WITH_LIBICU 1" >>confdefs.h + + ICUINCLUDES=`$ICU_CONFIG --cppflags` + ICULIBS=`$ICU_CONFIG --ldflags` + fi + fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_LIBICU" >&5 +$as_echo "$WITH_LIBICU" >&6; } + + + + +CHARCONVINCLUDES="" +CHARCONVLIBS="" + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fixed iconv conversion flags" >&5 +$as_echo_n "checking fixed iconv conversion flags... " >&6; } +if test "$WITH_STDLIBC_ICONV" != "yes"; then + SAVELIBS="$LIBS" + LIBS="$LIBS $ICONVLIBS" +fi +if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/iconv.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + + +cat >>confdefs.h <<_ACEOF +#define DCMTK_FIXED_ICONV_CONVERSION_FLAGS `./conftest$EXEEXT` +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +$as_echo "unknown" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +if test "$WITH_STDLIBC_ICONV" != "yes"; then + LIBS="$SAVELIBS" +fi + +if test "$WITH_STDLIBC_ICONV" == "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iconv_open() accepts \"\" as an argument" >&5 +$as_echo_n "checking whether iconv_open() accepts \"\" as an argument... " >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/lciconv.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + + +$as_echo "#define DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable character set conversion support" >&5 +$as_echo_n "checking whether to enable character set conversion support... " >&6; } +# Check whether --enable-charconv was given. +if test "${enable_charconv+set}" = set; then : + enableval=$enable_charconv; case "$enableval" in + yes|auto) + +if test "$WITH_LIBICONV" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libiconv" >&5 +$as_echo "yes, type=libiconv" >&6; } + CHARCONVLIBS="$ICONVLIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICONV" + +elif test "$WITH_LIBICU" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libicu" >&5 +$as_echo "yes, type=libicu" >&6; } + CHARCONVINCLUDES="$ICUINCLUDES" + CHARCONVLIBS="$ICULIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICU" + +elif test "$WITH_STDLIBC_ICONV" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=stdlibc" >&5 +$as_echo "yes, type=stdlibc" >&6; } + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + ;; + libiconv) + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libiconv" >&5 +$as_echo "yes, type=libiconv" >&6; } + CHARCONVLIBS="$ICONVLIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICONV" + + ;; + libicu) + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libicu" >&5 +$as_echo "yes, type=libicu" >&6; } + CHARCONVINCLUDES="$ICUINCLUDES" + CHARCONVLIBS="$ICULIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICU" + + ;; + stdlibc) + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=stdlibc" >&5 +$as_echo "yes, type=stdlibc" >&6; } + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV" + + ;; + no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + *) + +if test "$WITH_LIBICONV" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libiconv" >&5 +$as_echo "yes, type=libiconv" >&6; } + CHARCONVLIBS="$ICONVLIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICONV" + +elif test "$WITH_LIBICU" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libicu" >&5 +$as_echo "yes, type=libicu" >&6; } + CHARCONVINCLUDES="$ICUINCLUDES" + CHARCONVLIBS="$ICULIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICU" + +elif test "$WITH_STDLIBC_ICONV" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=stdlibc" >&5 +$as_echo "yes, type=stdlibc" >&6; } + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + ;; + esac +else + +if test "$WITH_LIBICONV" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libiconv" >&5 +$as_echo "yes, type=libiconv" >&6; } + CHARCONVLIBS="$ICONVLIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICONV" + +elif test "$WITH_LIBICU" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=libicu" >&5 +$as_echo "yes, type=libicu" >&6; } + CHARCONVINCLUDES="$ICUINCLUDES" + CHARCONVLIBS="$ICULIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICU" + +elif test "$WITH_STDLIBC_ICONV" = "yes"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, type=stdlibc" >&5 +$as_echo "yes, type=stdlibc" >&6; } + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + + + + + +if [ ! -z "$DCMTK_ENABLE_CHARSET_CONVERSION" ]; then + +cat >>confdefs.h <<_ACEOF +#define DCMTK_ENABLE_CHARSET_CONVERSION $DCMTK_ENABLE_CHARSET_CONVERSION +_ACEOF + +fi + + + +ac_enable_cxx11="no" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable C++11 support" >&5 +$as_echo_n "checking whether to enable C++11 support... " >&6; } +# Check whether --enable-cxx11 was given. +if test "${enable_cxx11+set}" = set; then : + enableval=$enable_cxx11; case "$enableval" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 +$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } +if ${ax_cv_cxx_compile_cxx11+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_cxx_compile_cxx11=yes +else + ax_cv_cxx_compile_cxx11=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 +$as_echo "$ax_cv_cxx_compile_cxx11" >&6; } + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval \${$cachevar+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval $cachevar=yes +else + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX11=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +$as_echo "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 + +$as_echo "#define HAVE_CXX11 1" >>confdefs.h + + fi + + + if test "$HAVE_CXX11 == 1"; then + ac_enable_cxx11="yes" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable C++11 support" >&5 +$as_echo_n "checking whether to enable C++11 support... " >&6; } + ;; + + *) + ac_enable_cxx11="no" + ;; + esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_cxx11" >&5 +$as_echo "$ac_enable_cxx11" >&6; } + + + +ac_enable_stl="no" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL support" >&5 +$as_echo_n "checking whether to enable STL support... " >&6; } +# Check whether --enable-stl was given. +if test "${enable_stl+set}" = set; then : + enableval=$enable_stl; case "$enableval" in + yes) + ac_enable_stl="yes" + ;; + + *) + ac_enable_stl="no" + ;; + esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl" >&5 +$as_echo "$ac_enable_stl" >&6; } + + +ac_enable_stl_vector="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL vector support" >&5 +$as_echo_n "checking whether to enable STL vector support... " >&6; } +# Check whether --enable-stl-vector was given. +if test "${enable_stl_vector+set}" = set; then : + enableval=$enable_stl_vector; case "$enableval" in + yes) + ac_enable_stl_vector="yes" + ;; + + *) + ac_enable_stl_vector="no" + ;; + esac + +fi + +if test "$ac_enable_stl_vector" = "auto"; then + ac_enable_stl_vector="$ac_enable_stl" +fi +if test "$ac_enable_stl_vector" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/vector.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_VECTOR /**/" >>confdefs.h + +else + ac_enable_stl_vector="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_vector" >&5 +$as_echo "$ac_enable_stl_vector" >&6; } + +ac_enable_stl_algorithm="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL algorithm support" >&5 +$as_echo_n "checking whether to enable STL algorithm support... " >&6; } +# Check whether --enable-stl-algorithm was given. +if test "${enable_stl_algorithm+set}" = set; then : + enableval=$enable_stl_algorithm; case "$enableval" in + yes) + ac_enable_stl_algorithm="yes" + ;; + + *) + ac_enable_stl_algorithm="no" + ;; + esac + +fi + +if test "$ac_enable_stl_algorithm" = "auto"; then + ac_enable_stl_algorithm="$ac_enable_stl" +fi +if test "$ac_enable_stl_algorithm" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/algo.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_ALGORITHM /**/" >>confdefs.h + +else + ac_enable_stl_algorithm="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_algorithm" >&5 +$as_echo "$ac_enable_stl_algorithm" >&6; } + +ac_enable_stl_limits="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL limits support" >&5 +$as_echo_n "checking whether to enable STL limits support... " >&6; } +# Check whether --enable-stl-limits was given. +if test "${enable_stl_limits+set}" = set; then : + enableval=$enable_stl_limits; case "$enableval" in + yes) + ac_enable_stl_limits="yes" + ;; + + *) + ac_enable_stl_limits="no" + ;; + esac + +fi + +if test "$ac_enable_stl_limits" = "auto"; then + ac_enable_stl_limits="$ac_enable_stl" +fi +if test "$ac_enable_stl_limits" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/limits.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_LIMITS /**/" >>confdefs.h + +else + ac_enable_stl_limits="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_limits" >&5 +$as_echo "$ac_enable_stl_limits" >&6; } + +ac_enable_stl_list="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL list support" >&5 +$as_echo_n "checking whether to enable STL list support... " >&6; } +# Check whether --enable-stl-list was given. +if test "${enable_stl_list+set}" = set; then : + enableval=$enable_stl_list; case "$enableval" in + yes) + ac_enable_stl_list="yes" + ;; + + *) + ac_enable_stl_list="no" + ;; + esac + +fi + +if test "$ac_enable_stl_list" = "auto"; then + ac_enable_stl_list="$ac_enable_stl" +fi +if test "$ac_enable_stl_list" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/list.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_LIST /**/" >>confdefs.h + +else + ac_enable_stl_list="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_list" >&5 +$as_echo "$ac_enable_stl_list" >&6; } + +ac_enable_stl_map="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL map support" >&5 +$as_echo_n "checking whether to enable STL map support... " >&6; } +# Check whether --enable-stl-map was given. +if test "${enable_stl_map+set}" = set; then : + enableval=$enable_stl_map; case "$enableval" in + yes) + ac_enable_stl_map="yes" + ;; + + *) + ac_enable_stl_map="no" + ;; + esac + +fi + +if test "$ac_enable_stl_map" = "auto"; then + ac_enable_stl_map="$ac_enable_stl" +fi +if test "$ac_enable_stl_map" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/map.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_MAP /**/" >>confdefs.h + +else + ac_enable_stl_map="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_map" >&5 +$as_echo "$ac_enable_stl_map" >&6; } + +ac_enable_stl_memory="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL memory support" >&5 +$as_echo_n "checking whether to enable STL memory support... " >&6; } +# Check whether --enable-stl-memory was given. +if test "${enable_stl_memory+set}" = set; then : + enableval=$enable_stl_memory; case "$enableval" in + yes) + ac_enable_stl_memory="yes" + ;; + + *) + ac_enable_stl_memory="no" + ;; + esac + +fi + +if test "$ac_enable_stl_memory" = "auto"; then + ac_enable_stl_memory="$ac_enable_stl" +fi +if test "$ac_enable_stl_memory" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/memory.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_MEMORY /**/" >>confdefs.h + +else + ac_enable_stl_memory="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_memory" >&5 +$as_echo "$ac_enable_stl_memory" >&6; } + +ac_enable_stl_stack="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL stack support" >&5 +$as_echo_n "checking whether to enable STL stack support... " >&6; } +# Check whether --enable-stl-stack was given. +if test "${enable_stl_stack+set}" = set; then : + enableval=$enable_stl_stack; case "$enableval" in + yes) + ac_enable_stl_stack="yes" + ;; + + *) + ac_enable_stl_stack="no" + ;; + esac + +fi + +if test "$ac_enable_stl_stack" = "auto"; then + ac_enable_stl_stack="$ac_enable_stl" +fi +if test "$ac_enable_stl_stack" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/stack.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_STACK /**/" >>confdefs.h + +else + ac_enable_stl_stack="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_stack" >&5 +$as_echo "$ac_enable_stl_stack" >&6; } + +ac_enable_stl_string="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL string support" >&5 +$as_echo_n "checking whether to enable STL string support... " >&6; } +# Check whether --enable-stl-string was given. +if test "${enable_stl_string+set}" = set; then : + enableval=$enable_stl_string; case "$enableval" in + yes) + ac_enable_stl_string="yes" + ;; + + *) + ac_enable_stl_string="no" + ;; + esac + +fi + +if test "$ac_enable_stl_string" = "auto"; then + ac_enable_stl_string="$ac_enable_stl" +fi +if test "$ac_enable_stl_string" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/string.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_STRING /**/" >>confdefs.h + +else + ac_enable_stl_string="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_string" >&5 +$as_echo "$ac_enable_stl_string" >&6; } + +ac_enable_stl_type_traits="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL type-traits support" >&5 +$as_echo_n "checking whether to enable STL type-traits support... " >&6; } +# Check whether --enable-stl-type-traits was given. +if test "${enable_stl_type_traits+set}" = set; then : + enableval=$enable_stl_type_traits; case "$enableval" in + yes) + ac_enable_stl_type_traits="yes" + ;; + + *) + ac_enable_stl_type_traits="no" + ;; + esac + +fi + +if test "$ac_enable_stl_type_traits" = "auto"; then + ac_enable_stl_type_traits="$ac_enable_stl" +fi +if test "$ac_enable_stl_type_traits" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/ttraits.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_TYPE_TRAITS /**/" >>confdefs.h + +else + ac_enable_stl_type_traits="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_type_traits" >&5 +$as_echo "$ac_enable_stl_type_traits" >&6; } + +ac_enable_stl_tuple="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL tuple support" >&5 +$as_echo_n "checking whether to enable STL tuple support... " >&6; } +# Check whether --enable-stl-tuple was given. +if test "${enable_stl_tuple+set}" = set; then : + enableval=$enable_stl_tuple; case "$enableval" in + yes) + ac_enable_stl_tuple="yes" + ;; + + *) + ac_enable_stl_tuple="no" + ;; + esac + +fi + +if test "$ac_enable_stl_tuple" = "auto"; then + ac_enable_stl_tuple="$ac_enable_stl" +fi +if test "$ac_enable_stl_tuple" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/tuple.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_TUPLE /**/" >>confdefs.h + +else + ac_enable_stl_tuple="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_tuple" >&5 +$as_echo "$ac_enable_stl_tuple" >&6; } + +ac_enable_stl_system_error="auto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable STL system_error support" >&5 +$as_echo_n "checking whether to enable STL system_error support... " >&6; } +# Check whether --enable-stl-system-error was given. +if test "${enable_stl_system_error+set}" = set; then : + enableval=$enable_stl_system_error; case "$enableval" in + yes) + ac_enable_stl_system_error="yes" + ;; + + *) + ac_enable_stl_system_error="no" + ;; + esac + +fi + +if test "$ac_enable_stl_system_error" = "auto"; then + ac_enable_stl_system_error="$ac_enable_stl" +fi +if test "$ac_enable_stl_system_error" = "yes"; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "tests/syserr.cc" +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +$as_echo "#define HAVE_STL_SYSTEM_ERROR /**/" >>confdefs.h + +else + ac_enable_stl_system_error="unsupported -> no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_stl_system_error" >&5 +$as_echo "$ac_enable_stl_system_error" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __sync_add_and_fetch" >&5 +$as_echo_n "checking for __sync_add_and_fetch... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + int main(){return __sync_add_and_fetch((int *)0, 0);} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + dcmtk_have_sync_fn=yes +else + dcmtk_have_sync_fn=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$dcmtk_have_sync_fn" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_SYNC_ADD_AND_FETCH 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __sync_sub_and_fetch" >&5 +$as_echo_n "checking for __sync_sub_and_fetch... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + int main(){return __sync_sub_and_fetch((int *)0, 0);} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + dcmtk_have_sync_fn=yes +else + dcmtk_have_sync_fn=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$dcmtk_have_sync_fn" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_SYNC_SUB_AND_FETCH 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __alignof__" >&5 +$as_echo_n "checking for __alignof__... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + int main(){char c[__alignof__(int)];return 0;} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + dcmtk_have_alignof=yes +else + dcmtk_have_alignof=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$dcmtk_have_alignof" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_GNU_ALIGNOF 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((aligned))" >&5 +$as_echo_n "checking for __attribute__((aligned))... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + int main(){__attribute__((aligned(4))) char c[16];return 0;} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + dcmtk_have_attribute_aligned=yes +else + dcmtk_have_attribute_aligned=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$dcmtk_have_attribute_aligned" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_ATTRIBUTE_ALIGNED 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((aligned)) supports templates" >&5 +$as_echo_n "checking whether __attribute__((aligned)) supports templates... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + template + struct test { typedef T type __attribute__((aligned(4))); }; + int main() + { + test::type i; + return 0; + } + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + dcmtk_attribute_aligned_supports_templates=yes +else + dcmtk_attribute_aligned_supports_templates=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$dcmtk_attribute_aligned_supports_templates" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports default constructor detection via SFINAE" >&5 +$as_echo_n "checking whether the compiler supports default constructor detection via SFINAE... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + struct no_type {}; + struct yes_type {double d;}; + template + struct consume{}; + template + static yes_type sfinae(consume*); + template + static no_type sfinae(...); + struct test { test( int ); }; + int main() + { + return sizeof(sfinae(0)) == sizeof(yes_type); + } + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + dcmtk_default_constructor_detection_via_sfinae=yes +else + dcmtk_default_constructor_detection_via_sfinae=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$dcmtk_default_constructor_detection_via_sfinae" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct pwd contains the field pw_gecos" >&5 +$as_echo_n "checking whether struct pwd contains the field pw_gecos... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +&passwd::pw_gecos; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PASSWD_GECOS /**/" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYS_gettid in sys/syscall.h" >&5 +$as_echo_n "checking for SYS_gettid in sys/syscall.h... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +SYS_gettid; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_SYS_GETTID /**/" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iterator category input is declared" >&5 +$as_echo_n "checking whether iterator category input is declared... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + int main(){typedef std::input_iterator_tag category;return 0;} + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + dcmtk_have_iter_cat=yes +else + dcmtk_have_iter_cat=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$dcmtk_have_iter_cat" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_INPUT_ITERATOR_CATEGORY 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iterator category output is declared" >&5 +$as_echo_n "checking whether iterator category output is declared... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + int main(){typedef std::output_iterator_tag category;return 0;} + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + dcmtk_have_iter_cat=yes +else + dcmtk_have_iter_cat=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$dcmtk_have_iter_cat" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_OUTPUT_ITERATOR_CATEGORY 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iterator category forward is declared" >&5 +$as_echo_n "checking whether iterator category forward is declared... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + int main(){typedef std::forward_iterator_tag category;return 0;} + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + dcmtk_have_iter_cat=yes +else + dcmtk_have_iter_cat=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$dcmtk_have_iter_cat" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_FORWARD_ITERATOR_CATEGORY 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iterator category bidirectional is declared" >&5 +$as_echo_n "checking whether iterator category bidirectional is declared... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + int main(){typedef std::bidirectional_iterator_tag category;return 0;} + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + dcmtk_have_iter_cat=yes +else + dcmtk_have_iter_cat=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$dcmtk_have_iter_cat" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_BIDIRECTIONAL_ITERATOR_CATEGORY 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iterator category random_access is declared" >&5 +$as_echo_n "checking whether iterator category random_access is declared... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + int main(){typedef std::random_access_iterator_tag category;return 0;} + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + dcmtk_have_iter_cat=yes +else + dcmtk_have_iter_cat=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$dcmtk_have_iter_cat" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_RANDOM_ACCESS_ITERATOR_CATEGORY 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iterator category contiguous is declared" >&5 +$as_echo_n "checking whether iterator category contiguous is declared... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + int main(){typedef std::contiguous_iterator_tag category;return 0;} + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + dcmtk_have_iter_cat=yes +else + dcmtk_have_iter_cat=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$dcmtk_have_iter_cat" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_CONTIGUOUS_ITERATOR_CATEGORY 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + +CFLAGS="$DEBUGCFLAGS $CFLAGS" +CXXFLAGS="$DEBUGCXXFLAGS $CXXFLAGS" + + + + + + + + + + + + + + +ac_config_files="$ac_config_files Makefile.def Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by dcmtk $as_me 3.6.5, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to . +dcmtk home page: ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +dcmtk config.status 3.6.5 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "include/dcmtk/config/osconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/dcmtk/config/osconfig.h" ;; + "Makefile.def") CONFIG_FILES="$CONFIG_FILES Makefile.def" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/config/configure.in b/config/configure.in new file mode 100644 index 00000000..3c84bc53 --- /dev/null +++ b/config/configure.in @@ -0,0 +1,1890 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(dcmtk, 3.6.5, [bugs@dcmtk.org], [dcmtk-3.6.5], [http://www.dcmtk.org/]) +AC_PREREQ(2.60) +AC_CONFIG_SRCDIR(Makefile.in) +AC_CONFIG_HEADERS(include/dcmtk/config/osconfig.h) + +m4_include([stdcxx.m4]) + +dnl ------------------------------------------------------- +dnl Additional Package Information +dnl ------------------------------------------------------- + +PACKAGE_VERSION_NUMBER=365 +PACKAGE_VERSION_SUFFIX="" +PACKAGE_DATE="2019-10-28" +AC_DEFINE_UNQUOTED(PACKAGE_VERSION_NUMBER,${PACKAGE_VERSION_NUMBER},[Define to the version number of this package.]) +AC_DEFINE_UNQUOTED(PACKAGE_VERSION_SUFFIX,"${PACKAGE_VERSION_SUFFIX}",[Define to the version suffix of this package.]) +AC_DEFINE_UNQUOTED(PACKAGE_DATE,"${PACKAGE_DATE}",[Define to the release date of this package.]) + +AC_SUBST(PACKAGE_VERSION_NUMBER) +AC_SUBST(PACKAGE_VERSION_SUFFIX) +AC_SUBST(PACKAGE_DATE) + +dnl ------------------------------------------------------- +dnl Identify the host platform we're compiling for, +dnl using config.guess and config.sub. +dnl ------------------------------------------------------- + +AC_CANONICAL_HOST +AC_DEFINE_UNQUOTED(CANONICAL_HOST_TYPE, "${host}", [Define the canonical host system type as a string constant.]) + +case "${host}" in + *-*-cygwin) + BINEXT=".exe" + ;; + *-*-mingw32) + BINEXT=".exe" + ;; + *) + BINEXT="" + ;; +esac + +dnl ------------------------------------------------------- +dnl Configuration Utilities +dnl ------------------------------------------------------- + +if test "x$prefix" = xNONE ; then +AC_DEFINE_UNQUOTED(DCMTK_PREFIX, "${ac_default_prefix}", [Define the DCMTK default path.]) +else +AC_DEFINE_UNQUOTED(DCMTK_PREFIX, "${prefix}", [Define the DCMTK default path.]) +fi + +DATA_DIR="${datadir}" +DATA_DIR=`( + test "$prefix" = NONE && prefix=${ac_default_prefix} + test "$exec_prefix" = NONE && exec_prefix=${prefix} + eval eval echo "$DATA_DIR" +)` +AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, "${DATA_DIR}/dicom.dic", [Define the default data dictionary path for the dcmdata library package.]) +AC_DEFINE_UNQUOTED(DEFAULT_SUPPORT_DATA_DIR, "${DATA_DIR}/", [Define the default directory where support data files reside.]) + +CONF_DIR="${sysconfdir}" +CONF_DIR=`( + test "$prefix" = NONE && prefix=${ac_default_prefix} + test "$exec_prefix" = NONE && exec_prefix=${prefix} + eval echo "$CONF_DIR" +)` +AC_DEFINE_UNQUOTED(DEFAULT_CONFIGURATION_DIR, "${CONF_DIR}/", [Define the default directory where configuration files reside.]) + +AH_VERBATIM([PATH_SEPARATOR], [/* Define path separator. */ +#define PATH_SEPARATOR '/']) + +AH_VERBATIM([ENVIRONMENT_PATH_SEPARATOR], [/* Define the environment variable path separator. */ +#ifndef ENVIRONMENT_PATH_SEPARATOR +#define ENVIRONMENT_PATH_SEPARATOR ':' +#endif]) + +AH_VERBATIM([HAVE_EMPTY_ARGC_ARGV], [/* Define if your system cannot pass command line arguments into main() (e.g. Macintosh). */ +/* #undef HAVE_EMPTY_ARGC_ARGV */]) + +AH_TOP([#ifndef OSCONFIG_H +#define OSCONFIG_H + +/* +** Define enclosures for include files with C linkage (mostly system headers) +*/ +#ifdef __cplusplus +#define BEGIN_EXTERN_C extern "C" { +#define END_EXTERN_C } +#else +#define BEGIN_EXTERN_C +#define END_EXTERN_C +#endif + +/* MinGW needs some special handling because it is a mixture of WIN32 and Posix. + * The following settings are not tested by configure but need to be set for MinGW. + */ +#ifdef __MINGW32__ +#define HAVE_WINDOWS_H 1 +#define HAVE_WINSOCK_H 1 +#define ENVIRONMENT_PATH_SEPARATOR ';' +#endif]) + +AH_BOTTOM([#if defined(HAVE_CXX11) && defined(__cplusplus) && __cplusplus < 201103L +#error\ +DCMTK was configured to use C++11 features, but your compiler does not or was not configured to provide them. +#endif + +#endif /* OSCONFIG_H */]) + + +dnl Include general file +sinclude(general.m4)dnl + +AC_CONFIG_AUX_DIR([.]) + +dnl Checks for programs. + +AC_PROG_INSTALL +AC_PROG_CC +AC_PROG_CPP +AC_CHECK_PROGS(CXX, $CCC c++ cc++ g++ gcc CC cxx, gcc) + +pedantic="" +if test -f /bin/uname ; then + os=`uname -s` + rev=`uname -r` + if test \( "$os" = SunOS \) ; then + case "$rev" in + # only use the -pedantic compiler option on + # Solaris 2 machines. + 5.*) pedantic="-pedantic" ;; + esac + fi +fi +if test "${CXXFLAGS}set" = set ; then + case "$CXX" in + c++|g++|gcc) + CXXFLAGS="-Wall $pedantic" + CFLAGS="-Wall $pedantic" + ;; + cc++) + CXXFLAGS="-Wall" + CFLAGS="-Wall" + ;; + *) + CXXFLAGS="" + CFLAGS="" + ;; + esac +fi + +AC_PROG_CXXCPP +dnl The next test is equivalent to AC_PROG_RANLIB +dnl Do not use AC_PROG_RANLIB because this produces +dnl an error on LINUX-systems in the configure script +AC_CHECK_PROGS(RANLIB, ranlib, :) + +dnl Check for "ar" and "libtool". On certain systems, e.g. NeXTStep, we must +dnl prefer "libtool" over "ar" if both are present. However, we don't use +dnl GNU libtool at the moment which is something completely different +dnl (not an "ar" replacement). +AC_CHECK_PROGS(AR, ar, :) +AC_CHECK_PROGS(LIBTOOL, libtool, :) +if test "${LIBTOOL}set" = libtoolset ; then + AC_CHECK_GNU_LIBTOOL + if test $ac_cv_check_gnu_libtool = yes ; then + : + else + AR=$LIBTOOL + fi +fi + +case "$AR" in +libtool) ARFLAGS=-o ;; +ar) ARFLAGS=cruv ;; +esac + +if test "${LIBEXT}set" = set ; then + LIBEXT="a" +fi + +AC_SUBST(ARFLAGS) +AC_SUBST(LIBEXT) +AC_SUBST(BINEXT) + +# Try to find a strip utility +AC_CHECK_PROGS(STRIP, strip, :) + +dnl ------------------------------------------------------- +dnl Check special systems +dnl ------------------------------------------------------- + +AC_AIX +AC_ISC_POSIX +AC_SYS_LONG_FILE_NAMES + +dnl ------------------------------------------------------- +dnl Perform some tests with the C compiler, needed for dcmjpeg +dnl ------------------------------------------------------- + +AC_MY_C_INLINE +AC_MY_C_CONST +AC_MY_C_CHAR_UNSIGNED +AC_MY_C_RIGHTSHIFT_UNSIGNED + +dnl ------------------------------------------------------- +dnl Check some typedefs versus definitions in , +dnl needed for JasPer support +dnl ------------------------------------------------------- + +AC_TYPEDEF(uchar, unsigned char) +AC_TYPEDEF(ushort, unsigned short) +AC_TYPEDEF(uint, unsigned int) +AC_TYPEDEF(ulong, unsigned long) +AC_CHECK_TYPES(longlong) +AC_CHECK_TYPES(ulonglong) +AC_CHECK_TYPES(long long) +AC_CHECK_TYPES(unsigned long long) +CHECK_VLA + +dnl File access stuff +AC_CHECK_TYPES(fpos64_t) +AC_CHECK_TYPES(off64_t) + +dnl stdbool.h and stdint.h are only defined in ANSI C, not in C++ +AC_CHECK_HEADERS(stdbool.h) +AC_CHECK_HEADERS(stdint.h) +AC_CHECK_HEADERS(cstdint) + +AC_CHECK_TYPES(int64_t) +AC_CHECK_TYPES(uint64_t) + +AC_CHECK_TYPES(char16_t) + +AC_CHECK_TYPES([sigjmp_buf], [], [], [[#include ]]) + +dnl ------------------------------------------------------- +dnl Checks for libc library functions. +dnl ------------------------------------------------------- + +AC_FUNC_MEMCMP +AC_FUNC_VPRINTF +AC_TYPE_SIGNAL +AC_FUNC_WAIT3 +AC_CHECK_FUNCS(gethostname gethostid socket sysinfo) +AC_CHECK_FUNCS(strchr strstr strtoul itoa atoll) +AC_CHECK_FUNCS(memcpy memset memmove memcmp bcopy bcmp) +AC_CHECK_FUNCS(getpid mktemp tempnam tmpnam getenv mkstemp) +AC_CHECK_FUNCS(stat) +AC_CHECK_FUNCS(malloc_debug) +AC_CHECK_FUNCS(strerror strdup bzero index rindex access) +AC_CHECK_FUNCS(uname cuserid getlogin getlogin_r) +AC_CHECK_FUNCS(usleep) +AC_CHECK_FUNCS(flock lockf) +AC_CHECK_FUNCS(listen connect setsockopt getsockopt select) +AC_CHECK_FUNCS(gethostbyname gethostbyname_r) +AC_CHECK_FUNCS(gethostbyaddr_r getgrnam_r getpwnam_r) +AC_CHECK_FUNCS(bind accept getsockname getaddrinfo) +AC_CHECK_FUNCS(getrusage) +AC_CHECK_FUNCS(gettimeofday) +AC_CHECK_FUNCS(waitpid) +AC_CHECK_FUNCS(getuid geteuid setuid getpwnam getgrnam) +AC_CHECK_FUNCS(sleep fork) +AC_CHECK_FUNCS(_findfirst) +AC_CHECK_FUNCS(strlcpy strlcat) +AC_CHECK_FUNCS(vsnprintf) +AC_CHECK_FUNCS(mbstowcs wcstombs) +AC_CHECK_FUNCS(popen pclose) +AC_CHECK_FUNCS(readdir_r) +AC_FUNC_FSEEKO + + +dnl ------------------------------------------------------- +dnl Checks for libcs library functions needed by oflog +dnl ------------------------------------------------------- + +AC_DEFUN([TYPE_SOCKLEN_T], +[ +AH_TEMPLATE([socklen_t], [Define to int if undefined.]) +AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, +[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include ]], [[socklen_t len = 42; return 0;]])],[ac_cv_type_socklen_t=yes],[ac_cv_type_socklen_t=no]) +]) + if test $ac_cv_type_socklen_t != yes; then + AC_DEFINE(socklen_t, int) + fi +]) + +AC_CHECK_FUNCS(ftime gmtime_r localtime_r lstat nanosleep fcntl) +AC_CHECK_FUNCS(htons htonl ntohs ntohl) +AC_CHECK_HEADERS(netinet/in.h) +AC_CHECK_HEADERS(syslog.h) +TYPE_SOCKLEN_T + +AH_TEMPLATE([HAVE_ENAMETOOLONG]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([#include ], [int value = ENAMETOOLONG;])], + [AC_DEFINE([HAVE_ENAMETOOLONG], , [Define if your system provides ENAMETOOLONG errno value.])]) + +dnl ------------------------------------------------------- +dnl Checks for libm library functions. +dnl ------------------------------------------------------- + +SAVELIBS="$LIBS" +LIBS="$LIBS -lm" +AC_CHECK_FUNCS(finite isinf isnan) +LIBS="$SAVELIBS" + +dnl ------------------------------------------------------- +dnl Perform remaining tests with C++ compiler +dnl ------------------------------------------------------- +AC_LANG(C++) + +AC_CXX_CONST_CAST +AC_CXX_DYNAMIC_CAST +AC_CXX_REINTERPRET_CAST +AC_CXX_STATIC_CAST +AC_CXX_STD_NOTHROW +AC_CXX_NOTHROW_DELETE +AC_CXX_STATIC_ASSERT + +dnl ------------------------------------------------------- +dnl Check for Debug Mode +dnl ------------------------------------------------------- + +DEBUG="-DNDEBUG" +DEBUGCXXFLAGS= +DEBUGCFLAGS= +AC_MSG_CHECKING(whether to compile in debug mode) +AC_ARG_ENABLE(debug, +[ --enable-debug compile with debug code, don't optimize + --disable-debug compile without debug code (default)], +[ case "$enableval" in + yes) + AC_MSG_RESULT(yes) + DEBUGCXXFLAGS="-g" + DEBUGCFLAGS="-g" + DEBUG="-DDEBUG" + ;; + *) + AC_MSG_RESULT(no) + DEBUGCXXFLAGS="-O" + DEBUGCFLAGS="-O" + ;; + esac ], + AC_MSG_RESULT(no) + DEBUGCXXFLAGS="-O" + DEBUGCFLAGS="-O" +) + +dnl ------------------------------------------------------- +dnl Check for thread support +dnl ------------------------------------------------------- + +THREADSUPPORT="auto" +AC_MSG_CHECKING(whether to enable thread support) +AC_ARG_ENABLE(threads, +[ --enable-threads=TYPE compile with MT support (posix/solaris/auto=default) + --disable-threads compile without MT support], +[ case "$enableval" in + yes|auto) + AC_MSG_RESULT(automatic detection) + ;; + posix) + AC_MSG_RESULT([yes, type=posix]) + THREADSUPPORT="posix" + ;; + solaris) + AC_MSG_RESULT([yes, type=solaris]) + THREADSUPPORT="solaris" + ;; + no) + AC_MSG_RESULT(no) + THREADSUPPORT="no" + ;; + *) + AC_MSG_RESULT([yes - type $enableval is unknown - using automatic detection]) + ;; + esac ], + AC_MSG_RESULT(automatic detection) +) + +dnl ------------------------------------------------------- +dnl Check for large file support +dnl ------------------------------------------------------- + +LFSSUPPORT="auto" +AC_MSG_CHECKING(whether to enable large file support) +AC_ARG_ENABLE(lfs, +[ --enable-lfs=TYPE compile with LFS support (lfs/lfs64/auto=default) + --disable-lfs compile without LFS support], +[ case "$enableval" in + yes|auto) + AC_MSG_RESULT(automatic detection) + ;; + lfs) + AC_MSG_RESULT([yes, type=LFS]) + LFSSUPPORT="lfs" + ;; + lfs64) + AC_MSG_RESULT([yes, type=LFS64]) + LFSSUPPORT="lfs64" + ;; + no) + AC_MSG_RESULT(no) + LFSSUPPORT="no" + ;; + *) + AC_MSG_RESULT([yes - type $enableval is unknown - using automatic detection]) + ;; + esac ], + AC_MSG_RESULT(automatic detection) +) + +dnl ------------------------------------------------------- +dnl Checks for libraries. +dnl ------------------------------------------------------- + +AC_CHECK_GXXLIB +AC_CHECK_LIB(iostream, main) +dnl Some C++ compilers have problems with recursive main calls +dnl (e.g. Sun C++ 4.2). In this case we must test another function +dnl to link. +AC_CHECK_LIB(nsl, main) +if test $ac_cv_lib_nsl_main = no ; then +AC_CHECK_LIB(nsl, gethostbyname) +fi +AC_CHECK_LIB(socket, main) +if test $ac_cv_lib_socket_main = no ; then +AC_CHECK_LIB(socket, socket) +fi + +dnl Some newer versions of OpenSSL must be linked against libdl. +dnl We just check whether libdl exists and in this case always +dnl add -ldl to OPENSSLLIBS. The same applies for OPENJPEG. +OPENSSLLIBS="" +OPENJPEGLIBS="" +AC_CHECK_LIB(dl, main,[ +OPENSSLLIBS="-ldl" +OPENJPEGLIBS="-ldl" +]) +if test $ac_cv_lib_dl_main = no ; then +AC_CHECK_LIB(dl, dlopen,[ +OPENSSLLIBS="-ldl" +OPENJPEGLIBS="-ldl" +]) +fi + +MATHLIBS="" +AC_CHECK_LIB(m, main,[ +MATHLIBS="-lm" +]) +if test $ac_cv_lib_m_main = no ; then +AC_CHECK_LIB(m, sin,[ +MATHLIBS="-lm" +]) +fi + +dnl On MinGW we have to link against the winsock32 library +dnl +AC_CHECK_LIB(wsock32, main,[ +LIBS="$LIBS -lwsock32" +]) + +dnl On MinGW we have to link against the netapi32 library +dnl +AC_CHECK_LIB(netapi32, main,[ +LIBS="$LIBS -lnetapi32" +]) + +dnl ------------------------------------------------------- +dnl Checks for header files. +dnl ------------------------------------------------------- + +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_HEADER_DIRENT +AC_CHECK_TCP_H +AC_CHECK_HEADERS(alloca.h) +AC_CHECK_HEADERS(arpa/inet.h) +AC_CHECK_HEADERS(assert.h) +AC_CHECK_HEADERS(ctype.h) +AC_CHECK_HEADERS(errno.h) +AC_CHECK_HEADERS(fcntl.h) +AC_CHECK_HEADERS(float.h) +AC_CHECK_HEADERS(fnmatch.h) +AC_CHECK_HEADERS(fstream) +AC_CHECK_HEADERS(fstream.h) +AC_CHECK_HEADERS(grp.h) +AC_CHECK_HEADERS(ieeefp.h) +AC_CHECK_HEADERS(io.h) +AC_CHECK_HEADERS(iomanip) +AC_CHECK_HEADERS(iomanip.h) +AC_CHECK_HEADERS(iostream) +AC_CHECK_HEADERS(iostream.h) +AC_CHECK_HEADERS(iso646.h) +AC_CHECK_HEADERS(libc.h) +AC_CHECK_HEADERS(limits.h) +AC_CHECK_HEADERS(climits) +AC_CHECK_HEADERS(locale.h) +AC_CHECK_HEADERS(malloc.h) +AC_CHECK_HEADERS(math.h) +AC_CHECK_HEADERS(cmath) +AC_CHECK_HEADERS(new) +AC_CHECK_HEADERS(new.h) +AC_CHECK_HEADERS(netdb.h) +AC_CHECK_HEADERS(pthread.h) +AC_CHECK_HEADERS(pwd.h) +AC_CHECK_HEADERS(semaphore.h) +AC_CHECK_HEADERS(setjmp.h) +AC_CHECK_HEADERS(signal.h) +AC_CHECK_HEADERS(sstream) +AC_CHECK_HEADERS(sstream.h) +AC_CHECK_HEADERS(stat.h) +AC_CHECK_HEADERS(cstdarg) +AC_CHECK_HEADERS(stdarg.h) +AC_CHECK_HEADERS(stddef.h) +AC_CHECK_HEADERS(cstddef) +AC_CHECK_HEADERS(cstdio) +AC_CHECK_HEADERS(stdio.h) +AC_CHECK_HEADERS(stdint.h) +AC_CHECK_HEADERS(stdlib.h) +AC_CHECK_HEADERS(streambuf.h) +AC_CHECK_HEADERS(string.h) +AC_CHECK_HEADERS(strings.h) +AC_CHECK_HEADERS(strstrea.h) +AC_CHECK_HEADERS(strstream) +AC_CHECK_HEADERS(strstream.h) +AC_CHECK_HEADERS(synch.h) +AC_CHECK_HEADERS(sys/errno.h) +AC_CHECK_HEADERS(sys/file.h) +AC_CHECK_HEADERS(sys/param.h) +AC_CHECK_HEADERS(sys/resource.h) +AC_CHECK_HEADERS(sys/select.h) +AC_CHECK_HEADERS(sys/socket.h) +AC_CHECK_HEADERS(sys/stat.h) +AC_CHECK_HEADERS(sys/syscall.h) +AC_CHECK_HEADERS(sys/systeminfo.h) +AC_CHECK_HEADERS(sys/time.h) +AC_CHECK_HEADERS(sys/timeb.h) +AC_CHECK_HEADERS(sys/types.h) +AC_CHECK_HEADERS(sys/utime.h) +AC_CHECK_HEADERS(sys/utsname.h) +AC_CHECK_HEADERS(thread.h) +AC_CHECK_HEADERS(time.h) +AC_CHECK_HEADERS(unistd.h) +AC_CHECK_HEADERS(unix.h) +AC_CHECK_HEADERS(utime.h) +AC_CHECK_HEADERS(wchar.h) +AC_CHECK_HEADERS(wctype.h) +AC_CHECK_HEADERS(fenv.h) +AC_CHECK_HEADER(iterator, + [AC_DEFINE([HAVE_ITERATOR_HEADER], 1, [Define to 1 if you have the header file.])] +) + +AC_CHECK_POLL_H + +if test $ac_cv_header_libc_h = yes ; then + if test $ac_cv_header_math_h = yes ; then + AC_CXX_LIBC_H_EXTERN_C + fi +fi + +dnl ------------------------------------------------------- +dnl Tests for pointer vs. integer types +dnl These tests REQUIRE as a prerequisite AC_CXX_STATIC_CAST +dnl ------------------------------------------------------- + +if test $ac_cv_header_pthread_h = yes ; then + AC_CHECK_POINTER_TYPE(pthread_t, pthread.h) +fi + +dnl ------------------------------------------------------- +dnl Check for thread support +dnl ------------------------------------------------------- + +dnl +dnl in auto mode, check whether we use solaris or posix threads +dnl +if test $THREADSUPPORT = auto ; then + if test $ac_cv_header_synch_h = yes ; then + THREADSUPPORT="solaris" + fi +fi +if test $THREADSUPPORT = auto ; then + if test $ac_cv_header_pthread_h = yes ; then + THREADSUPPORT="posix" + fi +fi +if test $THREADSUPPORT = auto ; then + THREADSUPPORT="no" +fi + +dnl +dnl in solaris mode, check for -lthread +dnl + +if test $THREADSUPPORT = solaris ; then + AC_CHECK_LIB(thread, sema_init, [ + ac_tr_lib=HAVE_LIBTHREAD + AC_DEFINE_UNQUOTED($ac_tr_lib) + LIBS="-lthread $LIBS" + ]) +fi + +if test $THREADSUPPORT = posix ; then + dnl + dnl check Posix MT libraries -lrt and -lpthread + dnl OSF/1 re-#defines most of the pthread function names. + dnl This is why we use pthread_key_create for the test. + dnl + AC_CHECK_LIB(pthread, pthread_key_create, [ + ac_tr_lib=HAVE_LIBPTHREAD + AC_DEFINE_UNQUOTED($ac_tr_lib) + LIBS="-lpthread $LIBS" + ]) + + AC_CHECK_LIB(rt, sem_init, [ + ac_tr_lib=HAVE_LIBRT + AC_DEFINE_UNQUOTED($ac_tr_lib) + LIBS="-lrt $LIBS" + ], , $LIBS ) + + dnl + dnl check whether the compiler required the -pthread option + dnl to correctly link code containing posix thread calls. + dnl This is true on FreeBSD. + dnl + AC_CHECK_PTHREAD_OPTION + + dnl + dnl check whether Posix read/write locks are available + dnl + POSIXRWLOCKSAVAILABLE="no" + AC_CHECK_LIB(pthread, pthread_rwlock_init, [ + AC_DEFINE(HAVE_PTHREAD_RWLOCK, , [Define if your system supports POSIX read/write locks.]) + dnl + dnl we're going to use POSIX threads with read/write locks. + dnl Linux 2.2.x only declares all prototypes if _XOPEN_SOURCE=500 and _BSD_SOURCE + dnl OSF/1 requires _XOPEN_SOURCE=500, _XOPEN_SOURCE_EXTENDED, _OSF_SOURCE and _POSIX_C_SOURCE=199506L + dnl Irix 6.x does not like _XOPEN_SOURCE=500 and _POSIX_C_SOURCE=199506L + dnl + POSIXRWLOCKSAVAILABLE="yes" + case "${host}" in + mips-sgi-irix6*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-openbsd3*) + CXXFLAGS="-D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + *-*-openbsd4*) + ;; + *-*-openbsd5*) + ;; + *-*-freebsd*) + ;; + *-*-netbsdelf2*) + ;; + *-*-netbsd*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-darwin*) + dnl On Mac OS X we need to have _DARWIN_C_SOURCE defined to enable UNIX standard API for system headers + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + ;; + *) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + esac + ], + [ + dnl + dnl We did not find pthread_rwlock_init in libpthread. Maybe it is somewhere else, e.g. in libc_r on FreeBSD. + dnl We give it another try by just linking against the default libraries. + dnl + AC_MSG_CHECKING(for pthread_rwlock_init in default libraries) + AC_TRY_LINK([extern "C" int pthread_rwlock_init(void *rwlock, void *attr); + ] , [(void) pthread_rwlock_init(NULL, NULL);], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PTHREAD_RWLOCK, , [Define if your system supports POSIX read/write locks.]) + dnl + dnl we're going to use POSIX threads with read/write locks. + dnl Linux 2.2.x only declares all prototypes if _XOPEN_SOURCE=500 and _BSD_SOURCE + dnl OSF/1 requires _XOPEN_SOURCE=500, _XOPEN_SOURCE_EXTENDED, _OSF_SOURCE and _POSIX_C_SOURCE=199506L + dnl Irix 6.x does not like _XOPEN_SOURCE=500 and _POSIX_C_SOURCE=199506L + dnl + POSIXRWLOCKSAVAILABLE="yes" + case "${host}" in + mips-sgi-irix6*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-openbsd3*) + CXXFLAGS="-D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + *-*-openbsd4*) + ;; + *-*-openbsd5*) + ;; + *-*-freebsd*) + ;; + *-*-netbsdelf2*) + ;; + *-*-netbsd*) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CFLAGS" + ;; + *-*-darwin*) + dnl On Mac OS X we need to have _DARWIN_C_SOURCE source defined to enable UNIX standard API for system headers + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" + ;; + *) + CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CXXFLAGS" + CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CFLAGS" + ;; + esac + ], AC_MSG_RESULT(no)) + ] + ) +fi + +AC_MSG_CHECKING(multi-thread support) +case "$THREADSUPPORT" in + solaris) + AC_MSG_RESULT([yes, solaris threads]) + CXXFLAGS="-D_REENTRANT $CXXFLAGS" + CFLAGS="-D_REENTRANT $CFLAGS" + AC_DEFINE(WITH_THREADS, , [Define if we are compiling with any type of multi-thread support.]) + ;; + posix) + if test $POSIXRWLOCKSAVAILABLE = yes ; then + AC_MSG_RESULT([yes, posix threads with rwlock]) + else + AC_MSG_RESULT([yes, posix threads without rwlock]) + fi + CXXFLAGS="-D_REENTRANT $CXXFLAGS" + CFLAGS="-D_REENTRANT $CFLAGS" + AC_DEFINE(WITH_THREADS, , [Define if we are compiling with any type of multi-thread support.]) + ;; + *) + AC_MSG_RESULT(none) + ;; +esac + +dnl ------------------------------------------------------- +dnl Check for LFS support +dnl ------------------------------------------------------- + +if test $LFSSUPPORT = auto -o $LFSSUPPORT = lfs64; then + AC_LFS64 + if test $ac_cv_lfs64_support = yes ; then + LFSSUPPORT="lfs64" + fi +fi + +if test $LFSSUPPORT = auto -o $LFSSUPPORT = lfs; then + MY_AC_SYS_LARGEFILE +fi + +dnl ------------------------------------------------------- +dnl Checks for typedefs, structures, and compiler characteristics. +dnl ------------------------------------------------------- + +AC_TYPEDEF(size_t, unsigned) +AC_TYPEDEF(ssize_t, long) +AC_TYPEDEF(pid_t, int) +AC_C_CHAR_UNSIGNED +AC_CHECK_SIZEOF(char) +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(float) +AC_CHECK_SIZEOF(double) +AC_CHECK_SIZEOF(void *) +AC_STRUCT_TM +AC_MY_SYMBOL_EXISTS([__FUNCTION__]) +AC_MY_SYMBOL_EXISTS([__PRETTY_FUNCTION__]) +AC_MY_SYMBOL_EXISTS([__func__]) + +dnl ------------------------------------------------------- +dnl Checks for prototypes +dnl ------------------------------------------------------- +dnl +dnl The following AC_CHECK_* macros _must_ have corresponding entries in +dnl the acconfig.h file. This is because the macros are specific to the +dnl DCMTK project and are not supported by GNU autoheader. + +AC_CHECK_PROTOTYPE(feenableexcept, fenv.h) +AC_CHECK_PROTOTYPE(_stricmp, string.h) +AC_CHECK_PROTOTYPE(accept, sys/types.h sys/socket.h) +if test $ac_cv_prototype_accept = yes ; then +AC_CHECK_INTP_ACCEPT(sys/types.h sys/socket.h) +fi +AC_CHECK_PROTOTYPE(bind, sys/types.h sys/socket.h) +AC_CHECK_PROTOTYPE(bzero, string.h strings.h libc.h unistd.h stdlib.h) +AC_CHECK_PROTOTYPE(connect, sys/types.h sys/socket.h) +AC_CHECK_PROTOTYPE(finite, math.h) +AC_CHECK_PROTOTYPE(isinf, math.h) +AC_CHECK_PROTOTYPE(isnan, math.h) +AC_CHECK_PROTOTYPE(std::finite, cmath) +AC_CHECK_PROTOTYPE(std::isinf, cmath) +AC_CHECK_PROTOTYPE(std::isnan, cmath) +AC_CHECK_PROTOTYPE(flock, sys/file.h) +AC_CHECK_PROTOTYPE(gethostbyname, libc.h unistd.h stdlib.h netdb.h) +AC_CHECK_PROTOTYPE(gethostbyname_r, libc.h unistd.h stdlib.h netdb.h) +AC_CHECK_PROTOTYPE(gethostbyaddr_r, libc.h unistd.h stdlib.h netdb.h) +AC_CHECK_PROTOTYPE(gethostid, libc.h unistd.h stdlib.h netdb.h) +AC_CHECK_PROTOTYPE(gethostname, unistd.h libc.h stdlib.h netdb.h) +AC_CHECK_PROTOTYPE(getsockname, sys/types.h sys/socket.h) +AC_CHECK_PROTOTYPE(getsockopt, sys/types.h sys/socket.h) +AC_CHECK_PROTOTYPE(strerror_r, string.h) +if test $ac_cv_prototype_strerror_r = yes ; then +AC_CHECK_CHARP_STRERROR_R(string.h) +fi +if test $ac_cv_prototype_getsockopt = yes ; then +AC_CHECK_INTP_GETSOCKOPT(sys/types.h sys/socket.h) +fi +AC_CHECK_PROTOTYPE(gettimeofday, sys/time.h unistd.h) +AC_CHECK_PROTOTYPE(listen, sys/types.h sys/socket.h) +AC_CHECK_PROTOTYPE(mktemp, libc.h unistd.h stdlib.h) +AC_CHECK_PROTOTYPE(mkstemp, libc.h unistd.h stdlib.h) +AC_CHECK_PROTOTYPE(select, sys/select.h sys/types.h sys/socket.h sys/time.h) +if test $ac_cv_prototype_select = yes ; then +AC_CHECK_INTP_SELECT(sys/select.h sys/types.h sys/socket.h sys/time.h) +fi +AC_CHECK_PROTOTYPE(setsockopt, sys/types.h sys/socket.h) +AC_CHECK_PROTOTYPE(socket, sys/types.h sys/socket.h) +AC_CHECK_PROTOTYPE(strcasecmp, string.h) +AC_CHECK_PROTOTYPE(strncasecmp, string.h) +AC_CHECK_PROTOTYPE(usleep, libc.h unistd.h stdlib.h) +AC_CHECK_PROTOTYPE(vsnprintf, stdio.h stdarg.h) +AC_CHECK_PROTOTYPE(wait3, libc.h sys/wait.h sys/time.h sys/resource.h) +AC_CHECK_PROTOTYPE(waitpid, sys/wait.h sys/time.h sys/resource.h) +AC_CHECK_DECLARATION(struct utimbuf, sys/types.h utime.h sys/utime.h) +AC_CHECK_DECLARATION(socklen_t, sys/types.h sys/socket.h) +AC_CHECK_OLD_READDIR_R +AC_CHECK_ELLIPSE_SIGNAL_HANDLER(signal.h) +if test $ac_cv_header_math_h = yes ; then +AC_INCLUDE_MATH_H_AS_CXX +fi + + +dnl ------------------------------------------------------- +dnl Checks for the usage of standard C++ headers. +dnl ------------------------------------------------------- + +AC_MSG_CHECKING(whether to use C++ standard includes) +ac_use_std_includes="auto" +AC_ARG_ENABLE(std-includes, +[ --enable-std-includes use C++ ANSI standard includes (default: auto) + --disable-std-includes use old C++ includes ], +[ case "$enableval" in + yes) + ac_use_std_includes="yes" + ;; + + *) + ac_use_std_includes="no" + ;; + esac ] +) + +if test "$ac_cv_header_fstream" = "yes" -a "$ac_cv_header_iostream" = "yes" -a "$ac_cv_header_iomanip" = "yes"; then + ac_have_std_includes="yes" +else + ac_have_std_includes="no" +fi + +if test "$ac_cv_header_fstream_h" = "yes" -a "$ac_cv_header_iostream_h" = "yes" -a "$ac_cv_header_iomanip_h" = "yes"; then + ac_have_old_includes="yes" +else + ac_have_old_includes="no" +fi + +if test "$ac_use_std_includes" = "yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE(USE_STD_CXX_INCLUDES, , [Define if ANSI standard C++ includes are used.]) +elif test "$ac_use_std_includes" = "no"; then + AC_MSG_RESULT(no) +elif test "$ac_have_std_includes" = "yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE(USE_STD_CXX_INCLUDES, , [Define if ANSI standard C++ includes are used.]) + ac_use_std_includes="yes" +else + AC_MSG_RESULT(no) + ac_use_std_includes="no" +fi + +if test "$ac_use_std_includes" = "yes"; then + AC_CHECK_STD_NAMESPACE + AC_CHECK_DECLARATION(std::ios_base::openmode, , iostream) + AC_CHECK_IOS_NOCREATE(std::ios, fstream) + AC_CHECK_COMPILES(std::vfprintf, cstdarg cstdio, + [FILE *stream; va_list ap; std::vfprintf(stream, "", ap);]) + AC_CHECK_COMPILES(std::vsnprintf, cstdarg cstdio, + [char buf[256]; va_list ap; std::vsnprintf(buf, 0, "", ap);]) +else + AC_CHECK_DECLARATION(std::ios_base::openmode, , iostream.h) + AC_CHECK_IOS_NOCREATE(ios, fstream.h) + AC_CHECK_COMPILES(std::vfprintf, stdarg.h stdio.h, + [FILE *stream; va_list ap; std::vfprintf(stream, "", ap);]) + AC_CHECK_COMPILES(std::vsnprintf, stdarg.h stdio.h, + [char buf[256]; va_list ap; std::vsnprintf(buf, 0, "", ap);]) +fi + +AC_CHECK_CLASS_TEMPLATE +AC_CHECK_STATIC_TEMPLATE_METHOD +AC_CHECK_FUNCTION_TEMPLATE +AC_CHECK_EXPLICIT_TEMPLATE_SPECIALIZATION +AC_CHECK_CXX_BOOL +AC_CHECK_CXX_VOLATILE +AC_CXX_TYPENAME +AC_STDIO_NAMESPACE + +dnl ------------------------------------------------------- +dnl Check for Private Tag support +dnl ------------------------------------------------------- + +AC_MSG_CHECKING(whether to enable private tag dictionary) +AC_ARG_ENABLE(private-tags, +[ --enable-private-tags enable private tag dictionary + --disable-private-tags don't enable private tag dictionary (default)], +[ case "$enableval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_PRIVATE_TAGS, , [Define if we are compiling for enabling external private tag dictionary.]) + AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, "${DATA_DIR}/dicom.dic:${DATA_DIR}/private.dic", [Define the default data dictionary path for the dcmdata library package.]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +dnl ------------------------------------------------------- +dnl Check for External Dictionary support +dnl ------------------------------------------------------- + +AC_MSG_CHECKING(whether to enable loading external dictionary from default path) +AC_ARG_ENABLE(external-dict, +[ --enable-external-dict enable loading of external dictionary (default) + --disable-external-dict don't load external dictionary], +[ case "$enableval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_EXTERNAL_DICTIONARY, , [Define if we are compiling for loading external dictionary from default path.]) + ;; + *) + AC_MSG_RESULT(no) + dnl Reset default path so the dictionary is not loaded automatically on startup + AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, "", [Define the default data dictionary path for the dcmdata library package.]) + ;; + esac ], + AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_EXTERNAL_DICTIONARY, , [Define if we are compiling for loading external dictionary from default path.]) +) + +dnl ------------------------------------------------------- +dnl Check for Built-in (compiled-in) Dictionary support +dnl ------------------------------------------------------- + +AC_MSG_CHECKING(whether to enable built-in dictionary loading) +AC_ARG_ENABLE(builtin-dict, +[ --enable-builtin-dict enable loading of built-in dictionary + --disable-builtin-dict don't load built-in dictionary (default)], +[ case "$enableval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_BUILTIN_DICTIONARY, , [Define if we are compiling with built-in (compiled-in) dictionary enabled.]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +dnl ------------------------------------------------------- +dnl Check for OpenSSL support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([openssl], [OpenSSL]) + +AC_MSG_CHECKING([whether to include OpenSSL support]) +AC_ARG_WITH(openssl, +[AS_HELP_STRING([--with-openssl], [include OpenSSL support (default: auto)]) +AS_HELP_STRING([--without-openssl], [don't include OpenSSL support])], +[ case "$withval" in + yes) + AC_TRY_COMPILE([#include ], [ +#if OPENSSL_VERSION_NUMBER < 0x10001000L +#error OpenSSL too old +#endif +], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_OPENSSL, , [Define if we are compiling with OpenSSL support.]) + OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" ], + [AC_MSG_RESULT(no - DCMTK requires OpenSSL version 1.0.1 or newer)] ) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], +[ SAVELIBS="$LIBS" + LIBS="$LIBS $OPENSSLLIBS -lssl -lcrypto" + AC_TRY_LINK([#include ], [(void) TLSv1_method()], + [ + AC_TRY_COMPILE([#include ], [ +#if OPENSSL_VERSION_NUMBER < 0x10001000L +#error OpenSSL too old +#endif +], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_OPENSSL, , [Define if we are compiling with OpenSSL support.]) + OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" ], + [AC_MSG_RESULT(no - DCMTK requires OpenSSL version 1.0.1 or newer)] )], + [AC_MSG_RESULT(no)]) + LIBS="$SAVELIBS"] ) + +AC_CHECK_SSL_CTX_GET0_PARAM +AC_CHECK_RAND_EGD + +dnl ------------------------------------------------------- +dnl Check for libjpeg, which is needed by libtiff on some platforms +dnl ------------------------------------------------------- + +JPEGLIBS="" +AC_CHECK_LIB(jpeg, jpeg_set_defaults,[ +JPEGLIBS="-ljpeg" +]) +if test $ac_cv_lib_jpeg_jpeg_set_defaults = no ; then +AC_CHECK_LIB(jpeg, jSetDefaults,[ +JPEGLIBS="-ljpeg" +]) +fi + +dnl ------------------------------------------------------- +dnl Check for zlib support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([zlib]) + +ZLIBLIBS="" +AC_MSG_CHECKING(whether to include zlib support) +AC_ARG_WITH(zlib, +[AS_HELP_STRING([--with-zlib], [include zlib support (default: auto)]) +AS_HELP_STRING([--without-zlib], [don't include zlib support])], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_ZLIB, , [Define if we are compiling with zlib support.]) + ZLIBLIBS="-lz" + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], +[ SAVELIBS="$LIBS" + LIBS="$LIBS -lz" + AC_TRY_LINK([#include ], [(void) zlibVersion()], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_ZLIB, , [Define if we are compiling with zlib support.]) + ZLIBLIBS="-lz" ], + [AC_MSG_RESULT(no)]) + LIBS="$SAVELIBS"] ) + +dnl ------------------------------------------------------- +dnl Check for libtiff support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([libtiff]) + +TIFFLIBS="" +AC_MSG_CHECKING(whether to include libtiff support) +AC_ARG_WITH(libtiff, +[AS_HELP_STRING([--with-libtiff], [include libtiff support (default: auto)]) +AS_HELP_STRING([--without-libtiff], [don't include libtiff support])], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_LIBTIFF, , [Define if we are compiling with libtiff support.]) + TIFFLIBS="-ltiff $JPEGLIBS $ZLIBLIBS" + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], +[ SAVELIBS="$LIBS" + LIBS="$LIBS -ltiff $JPEGLIBS $ZLIBLIBS" + AC_TRY_LINK([#include ], [(void) TIFFGetVersion()], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_LIBTIFF, , [Define if we are compiling with libtiff support.]) + TIFFLIBS="-ltiff $JPEGLIBS $ZLIBLIBS" + ], + [AC_MSG_RESULT(no)]) + LIBS="$SAVELIBS"] ) + + +dnl ------------------------------------------------------- +dnl Check for libpng support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([libpng]) + +dnl perform check for only after we have evaluated --with-libpnginc +AC_CHECK_HEADERS(libpng/png.h) + +PNGLIBS="" +AC_MSG_CHECKING(whether to include libpng support) +AC_ARG_WITH(libpng, +[AS_HELP_STRING([--with-libpng], [include libpng support (default: auto)]) +AS_HELP_STRING([--without-libpng], [don't include libpng support])], +[ case "$withval" in + yes) + if test "x$ZLIBLIBS" != x; then + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_LIBPNG, , [Define if we are compiling with libpng support.]) + PNGLIBS="-lpng" + else + AC_MSG_RESULT(no because libpng requires zlib) + fi + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], +[ if test "x$ZLIBLIBS" != x; then + SAVELIBS="$LIBS" + LIBS="$LIBS -lpng $ZLIBLIBS" + + AC_TRY_LINK([#ifdef HAVE_LIBPNG_PNG_H +#include +#else +#include +#endif], [(void) png_access_version_number()], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_LIBPNG, , [Define if we are compiling with libpng support.]) + PNGLIBS="-lpng" ], + [AC_MSG_RESULT(no)]) + + LIBS="$SAVELIBS" + else + AC_MSG_RESULT(no because libpng requires zlib) + fi +] ) + +dnl ------------------------------------------------------- +dnl Check for libxml support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([libxml]) + +LIBXMLCFLAGS=`xml2-config --cflags 2>/dev/null` +if test "${LIBXMLCFLAGS+set}" = set; then + CXXFLAGS="$LIBXMLCFLAGS $CXXFLAGS" + CFLAGS="$LIBXMLCFLAGS $CFLAGS" +fi +LIBXMLLIBS=`xml2-config --libs 2>/dev/null` + +XMLLIBS="" +AC_MSG_CHECKING(whether to include libxml support) +AC_ARG_WITH(libxml, +[AS_HELP_STRING([--with-libxml], [include libxml support (default: auto)]) +AS_HELP_STRING([--without-libxml], [don't include libxml support])], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_LIBXML, , [Define if we are compiling with libxml support.]) + XMLLIBS=$LIBXMLLIBS + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], +[ SAVELIBS="$LIBS" + LIBS="$LIBS $LIBXMLLIBS" + AC_TRY_LINK([#include ], [(void) xmlInitParser()], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_LIBXML, , [Define if we are compiling with libxml support.]) + XMLLIBS=$LIBXMLLIBS ], + [AC_MSG_RESULT(no)]) + LIBS="$SAVELIBS"] ) + +dnl ------------------------------------------------------- +dnl Check for libwrap (TCP wrapper) support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([libwrap]) + +TCPWRAPPERLIBS="" +AC_MSG_CHECKING(whether to include libwrap support) +AC_ARG_WITH(libwrap, +[AS_HELP_STRING([--with-libwrap], [include libwrap support (default: auto)]) +AS_HELP_STRING([--without-libwrap], [don't include libwrap support])], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_TCPWRAPPER, , [Define if we are compiling with libwrap (TCP wrapper) support.]) + TCPWRAPPERLIBS="-lwrap" + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], +[ SAVELIBS="$LIBS" + LIBS="-lwrap $LIBS" + AC_TRY_LINK( + [#ifdef __cplusplus + extern "C" { + #endif + #ifdef HAVE_STDIO_H + /* on some platforms, tcpd.h needs stdio.h */ + #include + #endif + #ifdef HAVE_SYS_TYPES_H + /* on some platforms, tcpd.h needs sys/types.h */ + #include + #endif + #include + #ifdef __cplusplus + } + #endif + int deny_severity = 0; + int allow_severity = 0;], [struct request_info r; (void) hosts_access(&r)], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_TCPWRAPPER, , [Define if we are compiling with libwrap (TCP wrapper) support.]) + TCPWRAPPERLIBS="-lwrap" ], + [AC_MSG_RESULT(no)]) + LIBS="$SAVELIBS"] ) + + +dnl ------------------------------------------------------- +dnl Check for OpenJPEG support +dnl ------------------------------------------------------- + +AC_MY_OPENJPEG_PATH() + +AC_MSG_CHECKING(whether to include OpenJPEG support) +AC_ARG_WITH(libwrap, +[AS_HELP_STRING([--with-openjpeg], [include OpenJPEG support (default: auto)]) +AS_HELP_STRING([--without-openjpeg], [don't include OpenJPEG support])], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_OPENJPEG, , [Define if we are compiling with OpenJPEG support.]) + OPENJPEGLIBS="-lopenjp2 $OPENJPEGLIBS" + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], +[ SAVELIBS="$LIBS" + LIBS="-lopenjp2 $OPENJPEGLIBS $LIBS" + AC_TRY_LINK([#include ], [(void) opj_version()], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_OPENJPEG, , [Define if we are compiling with OpenJPEG support.]) + OPENJPEGLIBS="-lopenjp2 $OPENJPEGLIBS" ], + [AC_MSG_RESULT(no)]) + LIBS="$SAVELIBS"] ) + + +dnl ------------------------------------------------------- +dnl Check for libsndfile support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([libsndfile]) + +SNDFILELIBS="" +AC_MSG_CHECKING(whether to include libsndfile support) +AC_ARG_WITH(libsndfile, + [AS_HELP_STRING([--with-libsndfile], [include libsndfile support (default: auto)]) +AS_HELP_STRING([--without-libsndfile], [don't include libsndfile support])], + [ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_SNDFILE, , [Define if we are compiling with libsndfile support.]) + SNDFILELIBS="-lsndfile" + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + [ SAVELIBS="$LIBS" + LIBS="$LIBS -lsndfile" + AC_TRY_LINK([#include ], [char buffer [128]; sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer));], + [ AC_MSG_RESULT(yes) + AC_DEFINE(WITH_SNDFILE, , [Define if we are compiling with libsndfile support.]) + SNDFILELIBS="-lsndfile" ], + [AC_MSG_RESULT(no)]) + LIBS="$SAVELIBS"] +) + +dnl ------------------------------------------------------- +dnl Check for libiconv support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([libiconv]) +AH_TEMPLATE(WITH_LIBICONV, [Define if we are compiling with libiconv support.]) +WITH_LIBICONV=no +ICONVLIBS="" +AC_MSG_CHECKING(whether to include libiconv support) +AC_ARG_WITH(libiconv, +[AS_HELP_STRING([--with-libiconv], [include libiconv support (default: auto)]) +AS_HELP_STRING([--without-libiconv], [don't include libiconv support])], +[ case "$withval" in + yes) + WITH_LIBICONV=yes + AC_DEFINE(WITH_LIBICONV) + ICONVLIBS="-liconv -lcharset" + ;; + *) + ;; + esac ], +[ SAVELIBS="$LIBS" + LIBS="$LIBS -liconv -lcharset" + AC_TRY_LINK([#include ], [iconv_t cd = iconv_open("", ""); iconv(cd, 0, 0, 0, 0); iconv_close(cd);], + [ WITH_LIBICONV=yes + AC_DEFINE(WITH_LIBICONV) + ICONVLIBS="-liconv -lcharset" ]) + LIBS="$SAVELIBS"] ) +AC_MSG_RESULT($WITH_LIBICONV) + +AC_MSG_CHECKING(whether the second argument to iconv() is const) +SAVELIBS="$LIBS" +LIBS="$LIBS $ICONVLIBS" +AC_TRY_COMPILE([#include ], [iconv_t cd = iconv_open("", ""); const char *in = 0; iconv(cd, &in, 0, 0, 0); iconv_close(cd);], + [ AC_MSG_RESULT(yes) + AC_DEFINE(LIBICONV_SECOND_ARGUMENT_CONST, , [Define if the second argument to iconv() is const.]) ], + [AC_MSG_RESULT(no)]) +LIBS="$SAVELIBS" + +dnl ------------------------------------------------------- +dnl Check for iconv inside C standard library +dnl ------------------------------------------------------- + +AH_TEMPLATE([WITH_STDLIBC_ICONV], [Define if the C standard library has iconv builtin.])dnl +WITH_STDLIBC_ICONV=no +AC_MSG_CHECKING([whether the C standard library provides iconv functionality]) +SAVELIBS="$LIBS" +LIBS="" +AC_TRY_LINK([#include ], [iconv_t cd=iconv_open("","");iconv(cd,0,0,0,0);iconv_close(cd);], + [WITH_STDLIBC_ICONV=yes + AC_DEFINE(WITH_STDLIBC_ICONV)]) +AC_MSG_RESULT($WITH_STDLIBC_ICONV) +LIBS="$SAVELIBS" + +dnl ------------------------------------------------------- +dnl Check for libicu support +dnl ------------------------------------------------------- + +AC_MY_LIB_PATH([libicu]) +AH_TEMPLATE([WITH_LIBICU], [Define if we are compiling with ICU support.]) +WITH_LIBICU=no +AC_ARG_WITH(libicu, +[AS_HELP_STRING([--with-libicu], [include libicu support (default: auto)]) +AS_HELP_STRING([--without-libicu], [don't include libicu support])], +[ AC_MSG_CHECKING(whether to include ICU support) + case "$withval" in + yes) + WITH_LIBICU=yes + AC_DEFINE(WITH_LIBICU) + ICULIBS="-licui18n -licuuc -licudata" + ;; + *) + ;; + esac ], +[ + if test -z "$ICU_CONFIG"; then + AC_PATH_PROG(ICU_CONFIG, icu-config, no) + AC_MSG_CHECKING(whether to include ICU support) + fi + if [[ ! "$ICU_CONFIG" = "no" ]]; then + ICU_VERSION=`$ICU_CONFIG --version` + VERSION_CHECK=`expr $ICU_VERSION \>\= 3.4.1` + if test VERSION_CHECK=1; then + WITH_LIBICU=yes + AC_DEFINE(WITH_LIBICU) + ICUINCLUDES=`$ICU_CONFIG --cppflags` + ICULIBS=`$ICU_CONFIG --ldflags` + fi + fi +]) +AC_MSG_RESULT($WITH_LIBICU) + +dnl ------------------------------------------------------- +dnl character set conversion support +dnl ------------------------------------------------------- + +AH_VERBATIM([DCMTK_CHARSET_CONVERSION_CONSTANTS], [/* character set conversion constants. */ +#define DCMTK_CHARSET_CONVERSION_ICU 1 +#define DCMTK_CHARSET_CONVERSION_ICONV 2 +#define DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV 3 + +/* LFS mode constants. */ +#define DCMTK_LFS 1 +#define DCMTK_LFS64 2]) + +CHARCONVINCLUDES="" +CHARCONVLIBS="" + +AC_DEFUN([AC_CHOOSE_CHARSET_LIBICONV], +[ + AC_MSG_RESULT([yes, type=libiconv]) + CHARCONVLIBS="$ICONVLIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICONV" +]) + +AC_DEFUN([AC_CHOOSE_CHARSET_LIBICU], +[ + AC_MSG_RESULT([yes, type=libicu]) + CHARCONVINCLUDES="$ICUINCLUDES" + CHARCONVLIBS="$ICULIBS" + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICU" +]) + +AC_DEFUN([AC_CHOOSE_CHARSET_STDLIBC_ICONV], +[ + AC_MSG_RESULT([yes, type=stdlibc]) + DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV" +]) + +AC_DEFUN([AC_CHOOSE_CHARSET_IMPL], +[ +if test "$WITH_LIBICONV" = "yes"; then + AC_CHOOSE_CHARSET_LIBICONV() +elif test "$WITH_LIBICU" = "yes"; then + AC_CHOOSE_CHARSET_LIBICU() +elif test "$WITH_STDLIBC_ICONV" = "yes"; then + AC_CHOOSE_CHARSET_STDLIBC_ICONV() +else + AC_MSG_RESULT(no) +fi +]) + +AC_MSG_CHECKING(fixed iconv conversion flags) +if test "$WITH_STDLIBC_ICONV" != "yes"; then + SAVELIBS="$LIBS" + LIBS="$LIBS $ICONVLIBS" +fi +AC_RUN_IFELSE( + [AC_LANG_SOURCE([[#include "tests/iconv.cc"]])], + [ + AC_DEFINE_UNQUOTED(DCMTK_FIXED_ICONV_CONVERSION_FLAGS, [`./conftest$EXEEXT`], [Try to define the iconv behavior as conversion flags]) + AC_MSG_RESULT() + ], + [AC_MSG_RESULT([unknown])] +) +if test "$WITH_STDLIBC_ICONV" != "yes"; then + LIBS="$SAVELIBS" +fi + +if test "$WITH_STDLIBC_ICONV" == "yes"; then + AC_MSG_CHECKING([whether iconv_open() accepts "" as an argument]) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[#include "tests/lciconv.cc"]])], + [ + AC_DEFINE(DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING, 1, [Define if iconv_open() accepts "" as an argument]) + AC_MSG_RESULT(yes) + ], + [AC_MSG_RESULT(no)] + ) +fi + +AC_MSG_CHECKING(whether to enable character set conversion support) +AC_ARG_ENABLE(charconv, +[ --enable-charconv=TYPE enable character set conversion support + (libiconv/libicu/stdlibc/auto=default) + --disable-charconv disable character set conversion support], +[ case "$enableval" in + yes|auto) + AC_CHOOSE_CHARSET_IMPL() + ;; + libiconv) + AC_CHOOSE_CHARSET_LIBICONV() + ;; + libicu) + AC_CHOOSE_CHARSET_LIBICU() + ;; + stdlibc) + AC_CHOOSE_CHARSET_STDLIBC_ICONV() + ;; + no) + AC_MSG_RESULT(no) + ;; + *) + AC_CHOOSE_CHARSET_IMPL() + ;; + esac ], + [AC_CHOOSE_CHARSET_IMPL()] +) + +AC_SUBST(CHARCONVINCLUDES) +AC_SUBST(CHARCONVLIBS) + +if [[ ! -z "$DCMTK_ENABLE_CHARSET_CONVERSION" ]]; then + AC_DEFINE_UNQUOTED(DCMTK_ENABLE_CHARSET_CONVERSION, + [$DCMTK_ENABLE_CHARSET_CONVERSION], + [Define to select character set conversion implementation.]) +fi + + +dnl ------------------------------------------------------- +dnl include config test code from config/tests +dnl ------------------------------------------------------- + +ac_enable_cxx11="no" +AC_MSG_CHECKING(whether to enable C++11 support) +AC_ARG_ENABLE(cxx11, +[ --enable-cxx11 use C++11 + --disable-cxx11 do not use C++11 (default)], +[ case "$enableval" in + yes) + AC_MSG_RESULT() + AX_CXX_COMPILE_STDCXX([11], [noext], [optional]) + if test "$HAVE_CXX11 == 1"; then + ac_enable_cxx11="yes" + fi + AC_MSG_CHECKING(whether to enable C++11 support) + ;; + + *) + ac_enable_cxx11="no" + ;; + esac ] +) +AC_MSG_RESULT($ac_enable_cxx11) + + +dnl ------------------------------------------------------- +dnl Enable/disable STL support. +dnl ------------------------------------------------------- + +ac_enable_stl="no" +AC_MSG_CHECKING(whether to enable STL support) +AC_ARG_ENABLE(stl, +[ --enable-stl use C++ STL + --disable-stl do not use C++ STL (default)], +[ case "$enableval" in + yes) + ac_enable_stl="yes" + ;; + + *) + ac_enable_stl="no" + ;; + esac ] +) +AC_MSG_RESULT($ac_enable_stl) + + +ac_enable_stl_vector="auto" +AC_MSG_CHECKING(whether to enable STL vector support) +AC_ARG_ENABLE(stl-vector, +[ --enable-stl-vector use C++ STL vector + --disable-stl-vector do not use C++ STL vector], +[ case "$enableval" in + yes) + ac_enable_stl_vector="yes" + ;; + + *) + ac_enable_stl_vector="no" + ;; + esac] +) +if test "$ac_enable_stl_vector" = "auto"; then + ac_enable_stl_vector="$ac_enable_stl" +fi +if test "$ac_enable_stl_vector" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/vector.cc"]])], [AC_DEFINE(HAVE_STL_VECTOR, , [Define if STL's vector should be used.])], [ac_enable_stl_vector="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_vector) + +ac_enable_stl_algorithm="auto" +AC_MSG_CHECKING(whether to enable STL algorithm support) +AC_ARG_ENABLE(stl-algorithm, +[ --enable-stl-algorithm use C++ STL algorithm + --disable-stl-algorithm do not use C++ STL algorithm], +[ case "$enableval" in + yes) + ac_enable_stl_algorithm="yes" + ;; + + *) + ac_enable_stl_algorithm="no" + ;; + esac ] +) +if test "$ac_enable_stl_algorithm" = "auto"; then + ac_enable_stl_algorithm="$ac_enable_stl" +fi +if test "$ac_enable_stl_algorithm" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/algo.cc"]])], [AC_DEFINE(HAVE_STL_ALGORITHM, , [Define if STL's algorithm should be used.])], [ac_enable_stl_algorithm="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_algorithm) + +ac_enable_stl_limits="auto" +AC_MSG_CHECKING(whether to enable STL limits support) +AC_ARG_ENABLE(stl-limits, +[ --enable-stl-limits use C++ STL limits + --disable-stl-limits do not use C++ STL limits], +[ case "$enableval" in + yes) + ac_enable_stl_limits="yes" + ;; + + *) + ac_enable_stl_limits="no" + ;; + esac ] +) +if test "$ac_enable_stl_limits" = "auto"; then + ac_enable_stl_limits="$ac_enable_stl" +fi +if test "$ac_enable_stl_limits" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/limits.cc"]])], [AC_DEFINE(HAVE_STL_LIMITS, , [Define if STL's limits should be used.])], [ac_enable_stl_limits="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_limits) + +ac_enable_stl_list="auto" +AC_MSG_CHECKING(whether to enable STL list support) +AC_ARG_ENABLE(stl-list, +[ --enable-stl-list use C++ STL list + --disable-stl-list do not use C++ STL list], +[ case "$enableval" in + yes) + ac_enable_stl_list="yes" + ;; + + *) + ac_enable_stl_list="no" + ;; + esac ] +) +if test "$ac_enable_stl_list" = "auto"; then + ac_enable_stl_list="$ac_enable_stl" +fi +if test "$ac_enable_stl_list" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/list.cc"]])], [AC_DEFINE(HAVE_STL_LIST, , [Define if STL's list should be used.])], [ac_enable_stl_list="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_list) + +ac_enable_stl_map="auto" +AC_MSG_CHECKING(whether to enable STL map support) +AC_ARG_ENABLE(stl-map, +[ --enable-stl-map use C++ STL map + --disable-stl-map do not use C++ STL map], +[ case "$enableval" in + yes) + ac_enable_stl_map="yes" + ;; + + *) + ac_enable_stl_map="no" + ;; + esac ] +) +if test "$ac_enable_stl_map" = "auto"; then + ac_enable_stl_map="$ac_enable_stl" +fi +if test "$ac_enable_stl_map" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/map.cc"]])], [AC_DEFINE(HAVE_STL_MAP, , [Define if STL's map should be used.])], [ac_enable_stl_map="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_map) + +ac_enable_stl_memory="auto" +AC_MSG_CHECKING(whether to enable STL memory support) +AC_ARG_ENABLE(stl-memory, +[ --enable-stl-memory use C++ STL memory + --disable-stl-memory do not use C++ STL memory], +[ case "$enableval" in + yes) + ac_enable_stl_memory="yes" + ;; + + *) + ac_enable_stl_memory="no" + ;; + esac ] +) +if test "$ac_enable_stl_memory" = "auto"; then + ac_enable_stl_memory="$ac_enable_stl" +fi +if test "$ac_enable_stl_memory" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/memory.cc"]])], [AC_DEFINE(HAVE_STL_MEMORY, , [Define if STL's memory should be used.])], [ac_enable_stl_memory="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_memory) + +ac_enable_stl_stack="auto" +AC_MSG_CHECKING(whether to enable STL stack support) +AC_ARG_ENABLE(stl-stack, +[ --enable-stl-stack use C++ STL stack + --disable-stl-stack do not use C++ STL stack], +[ case "$enableval" in + yes) + ac_enable_stl_stack="yes" + ;; + + *) + ac_enable_stl_stack="no" + ;; + esac ] +) +if test "$ac_enable_stl_stack" = "auto"; then + ac_enable_stl_stack="$ac_enable_stl" +fi +if test "$ac_enable_stl_stack" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/stack.cc"]])], [AC_DEFINE(HAVE_STL_STACK, , [Define if STL's stack should be used.])], []ac_enable_stl_stack="unsupported -> no") +fi +AC_MSG_RESULT($ac_enable_stl_stack) + +ac_enable_stl_string="auto" +AC_MSG_CHECKING(whether to enable STL string support) +AC_ARG_ENABLE(stl-string, +[ --enable-stl-string use C++ STL string + --disable-stl-string do not use C++ STL string], +[ case "$enableval" in + yes) + ac_enable_stl_string="yes" + ;; + + *) + ac_enable_stl_string="no" + ;; + esac ] +) +if test "$ac_enable_stl_string" = "auto"; then + ac_enable_stl_string="$ac_enable_stl" +fi +if test "$ac_enable_stl_string" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/string.cc"]])], [AC_DEFINE(HAVE_STL_STRING, , [Define if STL's string should be used.])], [ac_enable_stl_string="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_string) + +ac_enable_stl_type_traits="auto" +AC_MSG_CHECKING(whether to enable STL type-traits support) +AC_ARG_ENABLE(stl-type-traits, +[ --enable-stl-type-traits + use C++ STL type-traits + --disable-stl-type-traits + do not use C++ STL type-traits], +[ case "$enableval" in + yes) + ac_enable_stl_type_traits="yes" + ;; + + *) + ac_enable_stl_type_traits="no" + ;; + esac ] +) +if test "$ac_enable_stl_type_traits" = "auto"; then + ac_enable_stl_type_traits="$ac_enable_stl" +fi +if test "$ac_enable_stl_type_traits" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/ttraits.cc"]])], [AC_DEFINE(HAVE_STL_TYPE_TRAITS, , [Define if STL's type traits should be used.])], [ac_enable_stl_type_traits="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_type_traits) + +ac_enable_stl_tuple="auto" +AC_MSG_CHECKING(whether to enable STL tuple support) +AC_ARG_ENABLE(stl-tuple, +[ --enable-stl-tuple use C++ STL tuple + --disable-stl-tuple do not use C++ STL tuple], +[ case "$enableval" in + yes) + ac_enable_stl_tuple="yes" + ;; + + *) + ac_enable_stl_tuple="no" + ;; + esac ] +) +if test "$ac_enable_stl_tuple" = "auto"; then + ac_enable_stl_tuple="$ac_enable_stl" +fi +if test "$ac_enable_stl_tuple" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/tuple.cc"]])], [AC_DEFINE(HAVE_STL_TUPLE, , [Define if STL's tuple should be used.])], [ac_enable_stl_tuple="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_tuple) + +ac_enable_stl_system_error="auto" +AC_MSG_CHECKING(whether to enable STL system_error support) +AC_ARG_ENABLE(stl-system-error, +[ --enable-stl-system-error + use C++ STL system_error + --disable-stl-system_error + do not use C++ STL system_error], +[ case "$enableval" in + yes) + ac_enable_stl_system_error="yes" + ;; + + *) + ac_enable_stl_system_error="no" + ;; + esac ] +) +if test "$ac_enable_stl_system_error" = "auto"; then + ac_enable_stl_system_error="$ac_enable_stl" +fi +if test "$ac_enable_stl_system_error" = "yes"; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/syserr.cc"]])], [AC_DEFINE(HAVE_STL_SYSTEM_ERROR, , [Define if STL's system_error should be used.])], [ac_enable_stl_system_error="unsupported -> no"]) +fi +AC_MSG_RESULT($ac_enable_stl_system_error) + + +dnl ------------------------------------------------------- +dnl Test for some additional functions and keywords +dnl ------------------------------------------------------- + +AC_CHECK_SYNC_FN([__sync_add_and_fetch],[HAVE_SYNC_ADD_AND_FETCH]) +AC_CHECK_SYNC_FN([__sync_sub_and_fetch],[HAVE_SYNC_SUB_AND_FETCH]) +AC_CHECK_ALIGNOF([HAVE_GNU_ALIGNOF]) +AC_CHECK_ATTRIBUTE_ALIGNED([HAVE_ATTRIBUTE_ALIGNED]) +AC_CHECK_ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES([ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES]) +AC_CHECK_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE([HAVE_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE]) + +dnl ------------------------------------------------------- +dnl Test if passwd has the pw_gecos field +dnl ------------------------------------------------------- + +AC_MSG_CHECKING(whether struct pwd contains the field pw_gecos) +AC_TRY_COMPILE([#include ], + [&passwd::pw_gecos;], + [ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PASSWD_GECOS, , [Define if passwd::pw_gecos is available.]) ], + [AC_MSG_RESULT(no)]) + +dnl ------------------------------------------------------- +dnl Test if SYS_gettid is available +dnl ------------------------------------------------------- + +AC_MSG_CHECKING(for SYS_gettid in sys/syscall.h) +AC_TRY_COMPILE([#include ], + [SYS_gettid;], + [ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SYS_GETTID, , [Define if your system has a prototype for gettid.]) ], + [AC_MSG_RESULT(no)]) + + +dnl ------------------------------------------------------- +dnl Test for defined iterator categories +dnl ------------------------------------------------------- + +AC_CHECK_ITERATOR_CATEGORY([input],[HAVE_INPUT_ITERATOR_CATEGORY]) +AC_CHECK_ITERATOR_CATEGORY([output],[HAVE_OUTPUT_ITERATOR_CATEGORY]) +AC_CHECK_ITERATOR_CATEGORY([forward],[HAVE_FORWARD_ITERATOR_CATEGORY]) +AC_CHECK_ITERATOR_CATEGORY([bidirectional],[HAVE_BIDIRECTIONAL_ITERATOR_CATEGORY]) +AC_CHECK_ITERATOR_CATEGORY([random_access],[HAVE_RANDOM_ACCESS_ITERATOR_CATEGORY]) +AC_CHECK_ITERATOR_CATEGORY([contiguous],[HAVE_CONTIGUOUS_ITERATOR_CATEGORY]) + + +dnl ------------------------------------------------------- +dnl Set optimizer and debug compiler flags +dnl ------------------------------------------------------- +CFLAGS="$DEBUGCFLAGS $CFLAGS" +CXXFLAGS="$DEBUGCXXFLAGS $CXXFLAGS" + +dnl ------------------------------------------------------- +dnl Special Definitions for output +dnl ------------------------------------------------------- +AC_SUBST(CXXFLAGS) +AC_SUBST(OPENSSLLIBS) +AC_SUBST(TIFFLIBS) +AC_SUBST(PNGLIBS) +AC_SUBST(MATHLIBS) +AC_SUBST(ZLIBLIBS) +AC_SUBST(XMLLIBS) +AC_SUBST(TCPWRAPPERLIBS) +AC_SUBST(SNDFILELIBS) +AC_SUBST(ICONVLIBS) +AC_SUBST(OPENJPEGLIBS) +AC_SUBST(DEBUG) + +AC_OUTPUT(Makefile.def Makefile) + +dnl disabled: AC_ARG_PROGRAM diff --git a/config/confmod b/config/confmod new file mode 100755 index 00000000..b7fff7da --- /dev/null +++ b/config/confmod @@ -0,0 +1,2915 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="Makefile.in" +enable_option_checking=no +ac_default_prefix=/usr/local +ac_subst_vars='LTLIBOBJS +LIBOBJS +configdir +common_makefile +SET_MAKE +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}/dcmtk' +sysconfdir='${prefix}/etc/dcmtk' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/dcmtk' +infodir='${datarootdir}/info' +htmldir='${docdir}/html' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc/dcmtk] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only arch.-independent data [DATAROOTDIR/dcmtk] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/dcmtk] + --htmldir=DIR html documentation [DOCDIR/html] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + +parentdir=`pwd` +relparentdir=. +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=`echo $relparentdir | sed 's/^\.\///'`/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + relparentdir=$relparentdir/.. + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +ac_aux_dir= +for ac_dir in $configdir "$srcdir"/$configdir; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in $configdir \"$srcdir\"/$configdir" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +common_makefile=Makefile.def + + + + +files=`find . -name "*.in" -print | grep -v "/config" | sed -e 's/.in$/ /g'` + +ac_config_files="$ac_config_files $files" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "$files") CONFIG_FILES="$CONFIG_FILES $files" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/config/confmod.in b/config/confmod.in new file mode 100644 index 00000000..1257f14b --- /dev/null +++ b/config/confmod.in @@ -0,0 +1,36 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(Makefile.in) +AC_DISABLE_OPTION_CHECKING + +parentdir=`pwd` +relparentdir=. +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=`echo $relparentdir | sed 's/^\.\///'`/config + else +changequote(, )dnl + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` +changequote([, ])dnl + relparentdir=$relparentdir/.. + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +dnl Configuration Utilities +AC_CONFIG_AUX_DIR($configdir) + +dnl Include general file +sinclude(general.m4)dnl + +AC_SUBST(configdir) + +files=`find . -name "*.in" -print | grep -v "/config" | sed -e 's/.in$/ /g'` + +AC_OUTPUT($files) diff --git a/config/docs/CMakeLists.txt b/config/docs/CMakeLists.txt new file mode 100644 index 00000000..c1b2ecd6 --- /dev/null +++ b/config/docs/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES config.txt dirstruc.txt envvars.txt macros.txt modules.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc) diff --git a/config/docs/config.dox b/config/docs/config.dox new file mode 100644 index 00000000..56102313 --- /dev/null +++ b/config/docs/config.dox @@ -0,0 +1,40 @@ +/*! + +\page mod_config config: configuration utilities for dcmtk + +This module contains configuration files for the OFFIS "dcmtk" (DICOM Toolkit). +The configuration mechanism uses GNU autoconf / configure facilities. + +\section Files + +The following files provide further documentation: +\li \ref file_config +\li \ref file_dirstruc +\li \ref file_envvars +\li \ref file_macros +\li \ref file_modules + +\section sec_cxx11_support C++11 Support +DCMTK supports some C++11 features. See \ref cxx11_support for details. +*/ + +/*! + \page file_config config.txt file + \verbinclude config.txt +*/ +/*! + \page file_dirstruc dirstruc.txt file + \verbinclude dirstruc.txt +*/ +/*! + \page file_envvars envvars.txt file + \verbinclude envvars.txt +*/ +/*! + \page file_macros macros.txt file + \verbinclude macros.txt +*/ +/*! + \page file_modules modules.txt file + \verbinclude modules.txt +*/ diff --git a/config/docs/config.txt b/config/docs/config.txt new file mode 100644 index 00000000..ca0fed59 --- /dev/null +++ b/config/docs/config.txt @@ -0,0 +1,122 @@ +The config directory +==================== + +The "config" directory contains configuration files for the OFFIS DCMTK +(DICOM ToolKit) to be used with GNU autoconf / configure. See INSTALL file +in the root directory for details. + + +templates directory: +==================== + +The "templates" directory contains templates for Makefiles and configure +scripts used for the DCMTK modules. For more information see "dirstruc.txt". + + +include directory: +================== + +The "config/include" directory contains OS-specific configuration files. The +file "osconfig.h.in" is created by "configure.in" using "autoheader" from the +GNU autoconf system. + +All your source files (*.h, *.c, *.cc) must contain the following #include- +statement at the beginning (before everything else is defined): + + #include "dcmtk/config/osconfig.h" + +The file "osconfig.h" is created during the configuration step using GNU +autoconf. + + +Programs in config/: +==================== + +The configuration directory contains the following programs: + +autoall creates "configure" and "confmod" +mkinstalldirs creates recursive directories, used for "make install" +install-sh BSD-compatible install script, used in Makefiles +rootconf creates "Makefile" and "configure" script for the root + directory. If the "modules" file in the "config" directory + is available, the modules are extracted from this file. It + contains a whitespace separated list of module names. +configure main configure script created by "autoall" or "autoconf". + "configure" must be started from the "config" directory. +confmod configure script for the modules created by "autoall" or + "autoconf confmod.in > confmod". "confmod" cannot be started + from the "config" directory. See "modules.txt" for more + information. + +In every module's main directory the "configure.mod" script from the +"templates" directory must be present. + +To create the "configure" script in the "config" directory you must call +"autoconf" or "autoall". + + +Configuration files in config/: +=============================== + +configure.in to specify configurations for "osconfig.h" and "Makefile.def" +aclocal.m4 to define new tests for "configure" +general.m4 common configurations for "configure" und "confmod" +confmod.in to specify tests for "confmod" (the modules) + +For "confmod.in" see "modules.txt". + +Do not edit these files unless you really know what you do. Consult the +autoconf manual (in emacs and on paper). + + +configure.in aclocal.m4 +======================= + +"configure.in" contains configuration tests mainly for the main configuration +header file "osconfig.h" and the default Makefile configuration "Makefile.def". +"Makefile.def" defines the compiler, linker, default flags, and the library +manager. "configure.in" does not specify special configurations for the +Makefiles of the various modules. These configurations can be found in +"confmod.in" (see "modules.txt"). + +You can change configurations for different operating systems or compilers in +these files. Please consider the autoconf manual. This part describes changes +to the normal autoconf tests: + +Additional tests are defined in "aclocal.m4": + +AC_CHECK_GXXLIB: + +Works like AC_CHECK_LIB, but for libg++. This additional macro is necessary +because "/bin/sh" will not allow you to define a variable "ac_cv_lib_g++" +and AC_CHECK_LIB will fail for libg++. All symbols #defined by this macro +replace G++ by GXX. + +AC_CHECK_PROTOTYPE: + +Checks if there is a prototype declaration for the given function. If header +file(s) are given as argument 2, they are #included in the search. Otherwise +only predefined functions will be found. +Examples: + in configure.in: + AC_CHECK_PROTOTYPE(setsockopt, sys/types.h sys/socket.h) + AC_CHECK_PROTOTYPE(gethostid) + +AC_CHECK_DECLARATION: + +Checks if a certain type is declared in the #include files given as argument 2. +Example: + in configure.in: + AC_CHECK_DECLARATION(struct sembuf, sys/types.h sys/ipc.h sys/sem.h) + + +general.m4 +========== + +Contains configuration tests commonly used in the "configure" and the "modconf" +script. "configure.in" and "confmod.in" use a special include command to get +these configuration. You can change or add configuration tests for the +"config" directory and the modules' Makefiles in/to "general.m4". + + +Have Fun! diff --git a/config/docs/cxx11.dox b/config/docs/cxx11.dox new file mode 100644 index 00000000..ad477397 --- /dev/null +++ b/config/docs/cxx11.dox @@ -0,0 +1,139 @@ +/*! + +\page cxx11_support C++11 support in DCMTK + +You may compile DCMTK with C++11 support enabled. This may increase performance +since some operations can be performed in a more efficient manner, e.g. +utilizing +move semantics. +To create a C++11 build of DCMTK, you simply need to set the appropriate +compiler-flags while building it (e.g. -std=c++11). This will however not +enable DCMTK to use available C++11 features that aren't implicitly used by +legacy code. This is especially important regarding some C++11 classes DCMTK +directly supports, for example: + +\li OFunique_ptr (std::unique_ptr) +\li OFshared_ptr (std::shared_ptr) +\li OFnumeric_limits (std::numeric_limits) +\li OFtuple (std::tuple) +\li OFerror_code (std::error_code) + +Since not every compiler supports C++11, legacy implementations for the +respective functionality have been created, which are enabled by default. + +If you use C++11 in your project, you may want to use the native C++11 classes +and features instead, so you don't need to convert your objects to use them +with DCMTK. To do so, you need to configure DCMTK to use the C++11 STL, which +is described below. + +

Enabling DCMTK to use C++11

+ +By enabling DCMTK to use C++11, you gain the following advantages: + +\li DCMTK will use available C++11 features instead of its only legacy + implementations. These are probably more efficient and complete. +\li The enabling of C++11 becomes part of DCMTK's configuration, which allows + DCMTK to assist you when checking for API/ABI (in-)compatibility between + C++11 and non C++11 builds. + +Trying to include a DCMTK build with C++11 enabled from a non C++11 +environment will give you the following error message: + +@verbatim +DCMTK was configured to use C++11 features, but your compiler does not or was not configured to provide them. +@endverbatim + +To reduce DCMTK's implementation complexity, C++11 shall only be used if your +compiler conforms closely to the C++11 Standard. As far as we know, +this is currently true for the following compilers: + +\li GNU C++ Compiler (g++) Version 4.8.1 or later. +\li Clang (clang++) Version 3.3 or later. + +To enable the C++11 STL, different steps are necessary on CMake and GNU +Autoconf, see the appropriate section below: + +

CMake

+ +Request building with C++11 features by setting the option +DCMTK_ENABLE_CXX11 to On, for example via: + +@verbatim +cmake ... -DDCMTK_ENABLE_CXX11:BOOL=ON ... +@endverbatim + +CMake detects the C++11 compilers and knows how to enable C++11 features on +Clang, GCC and Intel compilers. You can override the assumed compiler flags +(for example to enable C++14 instead) by modifying +DCMTK_CXX11_FLAGS, for example: + +@verbatim +cmake ... -DDCMTK_ENABLE_CXX11:BOOL=ON -DDCMTK_CXX11_FLAGS=-std=c++14 ... +@endverbatim + +CMake will then perform basic checks to ensure the compiler is configured +correctly and conforms closely enough to C++11 standard. If everything +works CMake will print something like this: + +@verbatim +-- Checking whether the compiler supports C++11 +-- Checking whether the compiler supports C++11 -- yes +-- Info: C++11 features enabled +@endverbatim + +

Unsupported Compilers

+ +If our CMake setup does not know how to enable C++11 on your compiler, it will +simply assume that no configuration is required (e.g. for Visual Studio). If +this is not appropriate you have to set DCMTK_CXX11_FLAGS manually +as mentioned above. +If you enable C++11 via DCMTK_ENABLE_CXX11 for an unsupported +compiler, CMake will simply set the flags provided via +DCMTK_CXX11_FLAGS (if any) and still run the C++11 compatibility +test to the compiler conforms closely enough to the C++11 standard for being +able to compile DCMTK. If it doesn't, CMake will give an output similar to +this one: + +@verbatim +-- Checking whether the compiler supports C++11 +-- Checking whether the compiler supports C++11 -- no +-- Info: C++11 features disabled +@endverbatim + +At this point you will not be able to enable C++11 features for the given +compiler, since building DCMTK would fail if you did. If you are sure that +your compiler supports C++11, you should try setting different flags as +DCMTK_CXX11_FLAGS. + +

GNU Autoconf

+ +Our GNU Autoconf setup understands the switches \--enable-cxx11, +and \--disable-cxx11 that may be used to configure DCMTK to use +C++11 features. If you run + +@verbatim +configure --enable-cxx11 +@endverbatim + +our Autoconf script will try to determine the required compiler flags for +enabling C++11 features (if any) and perform configuration tests to ensure +the compiler conforms closely enough to the C++11 standard. If everything +works it will give you an output similar to this one: + +@verbatim +checking whether to enable C++11 support... +checking whether c++ supports C++11 features by default... no +checking whether c++ supports C++11 features with -std=c++11... yes +checking whether to enable C++11 support... yes +@endverbatim + +Otherwise, it will still disable C++11 features with an output like this: + +@verbatim +checking whether to enable C++11 support... +checking whether c++ supports C++11 features by default... no +checking whether c++ supports C++11 features with -std=c++11... no +checking whether to enable C++11 support... no +@endverbatim + +*/ diff --git a/config/docs/dirstruc.txt b/config/docs/dirstruc.txt new file mode 100644 index 00000000..fa41580c --- /dev/null +++ b/config/docs/dirstruc.txt @@ -0,0 +1,30 @@ +Recommended project directory structure for the DCMTK project +============================================================= + +dcmtk + config + docs + include + templates + module1 + apps # application programs + data # support files + docs # documentation + etc # configuration files + include # include directory + libsrc # library sources + tests # test programs + module2 + ... + +If you use this structure, copy from the config/templates directory + Makefile.mod -> dcmtk/moduleX/Makefile.in + configure.mod -> dcmtk/moduleX/configure + +They can be used without any changes if you are using the structure above. + +There are more files in the template directory: + Makefile.lib: Sample Makefile.in for libraries in libsrc + Makefile.src: Sample Makefile.in for applications in apps, tests + +More information about configure.mod can be found in modules.txt diff --git a/config/docs/envvars.txt b/config/docs/envvars.txt new file mode 100644 index 00000000..5486b0a7 --- /dev/null +++ b/config/docs/envvars.txt @@ -0,0 +1,52 @@ + +=========================== +DCMTK ENVIRONMENT VARIABLES +=========================== + +The behavior of the DCMTK tools and libraries can be modified by a +number of runtime environment variables which are explained below. + + +DCMDICTPATH + Affected: dcmdata + Explanation: On Unix platforms, all DCMTK applications load a DICOM + data dictionary from file upon startup. By default, the file + /usr/local/share/dcmtk/dicom.dic will be loaded. If the DCMDICTPATH + environment variable is set, the applications will attempt to load + DICOM data dictionaries specified in the DCMDICTPATH environment + variable instead. The DCMDICTPATH environment variable has the same + format as the shell PATH variable in that a colon (":") separates + entries. The data dictionary code will attempt to load each file + specified in the DCMDICTPATH environment variable. It is an error + if no data dictionary can be loaded. + On Win32 platforms, a built-in dictionary is used by default. If + the DCMDICTPATH environment variable is set, the applications will + attempt to load _additional_ DICOM data dictionaries specified in + the DCMDICTPATH environment variable instead. The DCMDICTPATH + environment variable has the same format as the shell PATH variable + in that a semicolon (";") separates entries. The data dictionary + code will attempt to load each file specified in the DCMDICTPATH + environment variable. + + See also: documentation in dcmdata/docs/datadict.txt or + /usr/local/share/doc/dcmtk/datadict.txt. + +TCP_BUFFER_LENGTH + Affected: dcmnet + Explanation: By default, DCMTK does not modify the TCP send and receive + buffer length, i.e. the operating system is responsible for selecting + appropriate values. If the environment variable TCP_BUFFER_LENGTH is + set, it specifies an override for the TCP buffer length. The value is + specified in bytes, not in Kbytes. If set to 0, a buffer length of 64K, + which was the default value for previous versions of the DCMTK, is used. + +TCP_NODELAY + Affected: dcmnet + Explanation: If this environment variable is set and contains a non-zero + number (e.g. "1"), the Nagle algorithm will be disabled for TCP transport + connections, which might result in better network performance on some + systems/environments, especially when many small network packets are to + be sent. If it is set and contains the number "0", the Nagle algorithm + will not be disabled. If the environment variable TCP_NODELAY is not set, + the default behavior applies (see compiler macro DISABLE_NAGLE_ALGORITHM + in config/docs/macros.txt or /usr/local/share/doc/dcmtk/macros.txt). diff --git a/config/docs/macros.txt b/config/docs/macros.txt new file mode 100644 index 00000000..86c49193 --- /dev/null +++ b/config/docs/macros.txt @@ -0,0 +1,453 @@ +=================================== +DCMTK COMPILE TIME FLAGS AND MACROS +=================================== + +The behavior of several DCMTK tools and libraries can be modified by +a number of compile time flags (macros), which are explained below. +Most of these macros enable experimental or rarely needed features +in DCMTK, others disable certain functions. So please, use with care! + +ALLOW_ILLUMINATION_OVERRIDE + Affected: dcmprscu + Type of modification: Activates experimental or rarely used feature + Explanation: Allows the settings for Illumination and Reflected + Ambient Light, which are stored in a Stored Print object, to be + overridden from the print job command file. + +BUGGY_IMPLEMENTATION_CLASS_UID_PREFIX + Affected: storescp + Type of modification: Activates workaround for known bug in other product + Explanation: The dcmnet module contains a workaround that allows to + communicate with some buggy Storage SCUs. If the global flag + dcmPeerRequiresExactUIDCopy is enabled, an illegal space padding in + the Affected SOP Instance UID field of the C-STORE-RQ message is + retained in the corresponding C-STORE-RSP message. When this + preprocessor macro is defined, it should contain the prefix of an + implementation class UID of an implementation known to exhibit the + buggy behavior. The workaround is then activated in storescp + whenever a Storage SCU with the given implementation class UID root + connects. + +DCMTK_BUILD_DATE + Affected: dcmdata + Type of modification: Toolkit customization + Explanation: When this macro is defined (typically in config/Makefile.def), + the given date is used instead of the official DCMTK release data. This + allows for example to specify the date of a current development snapshot. + +DCMTK_BUILD_IN_PROGRESS + Affected: all modules + Type of modification: Toolkit customization + Explanation: When building DLLs, exported symbols must be marked differently + if the DLL itself is built or when the DLL shall be used. This macro is + defined when the DCMTK gets built and should not be defined when user code + that just uses the DCMTK is built. Based on this, the correct annotation + gets selected and is used in the code. There should be no valid reasons to + define this macro yourself since this is done automatically by the build + system. + +DCMTK_ENABLE_UNSAFE_VSNPRINTF + Affected: ofstd + Type of modification: Activates feature + Explanation: DCMTK requires the snprintf(3)/vsnprintf(3) function, which + was introduced with C99 and may not be supported by very old compilers. + As a "last resort", an implementation interally using sprintf/vsprintf + can be enabled with this macro, which allows the user to compile DCMTK + on platforms that do not have the new functions. + The implementation allocates a buffer that is 1 kByte larger than + the "size" parameter, formats the string into that buffer, and then + uses strlcpy() to copy the formatted string into the output buffer, + truncating if necessary. + This will work in most cases, since few snprintf calls should overrun + their buffer by more than 1K, but it can be easily abused by + a malicious attacker to cause a buffer overrun. + Therefore, this implementation should only be used as a "last resort" + and we strongly advise against using it in production code. + +DCMTK_GUI + Affected: all modules + Type of modification: Activates experimental or rarely used feature + Explanation: When this macro is defined, DCMTK re-assigns the standard + output and error streams maintained by ofConsole to string streams. + This will allow a GUI based application to extract the messages and + either present them to the user or store them in a log file. See + comments in ofstd/include/dcmtk/ofstd/ofconsol.h. + +DCMTK_LOG4CPLUS_AVOID_WIN32_FLS + Affected: oflog + Type of modification: Disables feature + Explanation: Starting with release 3.6.5, DCMTK uses fiber local storage + instead of thread local storage in the oflog module on Windows to store + thread-specific information. This has the advantage that a callback can + be (and is) registered that automatically cleans up the memory when a + thread ends. The old behaviour can be re-activated with this macro. + This may be necessary when an application wants to use multiple fibers + within a single thread. In that case, before ending a thread, + dcmtk::log4cplus::threadCleanup() should be called by the user code in + order to clean-up oflog's thread local storage. + +DICOMDIR_WITHOUT_BACKUP + Affected: dcmdata + Type of modification: Disables feature + Explanation: By default, DCMTK creates a backup of an existing DICOMDIR + (using the name DICOMDIR.$$$) when a DcmDicomDir object is written + to file. The creation of the backup can be disabled with this macro. + +DISABLE_COMPRESSION_EXTENSION + Affected: dcmqrdb + Type of modification: Disables feature + Explanation: Disables the support of compression (various transfer + syntaxes) in dcmqrdb, a feature which is still experimental. + +DISABLE_FF_JPEG_BITSTREAM_PADDING + Affected: dcmjpeg, dcmjpls (dcmjpls only up to DCMTK 3.6.4) + Type of modification: Disables feature + Explanation: Starting with release 3.6.2, DCMTK pads JPEG and JPEG-LS + bitstreams that have odd length with an "extended" end of image (EOI) + marker, writing ff/ff/d9 instead of adding a zero byte after the + EOI marker, i.e. writing ff/d9/00. The old behaviour can be restored + by defining this macro. + In the dcmjpls module, the macro has been replaced by a codec + parameter that can be set at runtime starting with DCMTK 3.6.5. + +DISABLE_NAGLE_ALGORITHM + Affected: dcmnet + Type of modification: Disables feature + Explanation: By default, DCMTK does not disable the so-called Nagle + algorithm, which allows for improving the efficiency of TCP/IP networks + by reducing the number of packets that need to be sent over the network. + When compiled with this macro, the Nagle algorithm is disabled for each + DICOM transport connection. This was the default in earlier versions of + the DCMTK but does not seem to be appropriate anymore for most modern + operating systems. The default behavior can be changed by setting the + environment variable TCP_NODELAY accordingly (see config/docs/envvars.txt + or /usr/local/share/doc/dcmtk/envvars.txt). + +DISABLE_OFSTD_ATOF + Affected: all modules + Type of modification: Disables feature + Explanation: By default, DCMTK uses its own implementation of atof() + to convert strings to double numbers in a locale-independent manner. + This flag forces DCMTK to use the standard sscanf() function + instead, which is normally much faster and gives a higher precision + than DCMTK's built in code, but is locale dependent, i.e. cannot be + used with locales such as German since DICOM decimal strings always + use the Posix locale. + +DISABLE_OFSTD_FTOA + Affected: all modules + Type of modification: Disables feature + Explanation: By default, DCMTK uses its own implementation to convert + double numbers to strings to in a locale-independent manner. + This flag forces DCMTK to use the standard sprintf() function + instead, which is locale dependent, i.e. cannot be used with locales + such as German since DICOM decimal strings always use the Posix + locale. + +DISABLE_PORT_PERMISSION_CHECK + Affected: most/all network server tools + Type of modification: Disables feature + Explanation: By default, most network server tools (e.g. storescp) check + for sufficient privileges to listen on the specified port (if geteuid() + is available on the particular system). For examples, on Unix systems + listening on port < 1024 usually requires root privileges. However, + the port permission check might prevent the tool from being run on such + ports on systems with fine-grained permission control (e.g. Linux). + Therefore, this check can be disabled using this flag. + +DISABLE_RECV_TIMEOUT + This macro is not supported anymore since the timeout for the recv() function + is now configurable at runtime. See global variable dcmSocketReceiveTimeout. + +DISABLE_SEND_TIMEOUT + This macro is not supported anymore since the timeout for the send() function + is now configurable at runtime. See global variable dcmSocketSendTimeout. + +DONT_DISABLE_NAGLE_ALGORITHM + This macro is not supported anymore since the Nagle algorithm is no longer + disabled by default. See DISABLE_NAGLE_ALGORITHM for details. + +DONT_LOAD_EXTERNAL_DICTIONARIES + This macro is not supported anymore since it has been superseded by macro + ENABLE_EXTERNAL_DICTIONARY. See ENABLE_EXTERNAL_DICTIONARY for details. + +DOXYGEN + Affected: everything + Type of modification: Hides complexity from Doxygen + Explanation: Doxygen is unable to parse some complex statements correctly + and it is sometimes sufficient to provide documentation for the basic + functionality instead of documenting every detail. + This macro is defined when creating the documentation with Doxygen and + should NEVER be defined when compiling DCMTK with a C/C++ compiler. + NOTE: Doxygen is still unable to expand some macros correctly + (e.g. HAVE_WINDOWS_H). Using this macro at the appropriate locations + could be a solution for this problem. + +ENABLE_BUILTIN_DICTIONARY + Affected: dcmdata + Type of modification: Activates feature + Explanation: If enabled, DCMTK's global builtin dictionary, that is always + loaded on startup, is populated with known DICOM tags. Otherwise, the + builtin dictionary stays empty. For further information about dictionary + configuration read dcmdata/docs/datadict.txt. + +ENABLE_EXTERNAL_DICTIONARY + Affected: dcmdata + Type of modification: Enables feature + Explanation: DCMTK is able to load DICOM data dictionaries from files at + application start (before the main function is called). These files + are either specified by the DCMDICTPATH environment variable or the + default files are used. This flag enables the loading of external + dictionaries from file at application start. Disabling it might be useful + when only the builtin dictionary should be used. However, if no + dictionary gets loaded, this is likely to cause unexpected behavior. + Even if this flag is disabled, the reloadDictionaries() method can be + used to load the external dictionaries after application start. + However, the environment variable DCMDICTPATH has to point to one or more + related dictionary files in that case, since if ENABLE_EXTERNAL_DICTIONARY + is disabled, no default dictionary path is set within the DCMTK code. + On Unix-like systems this flag is enabled by default while on Windows it is + disabled. For more information about dictionary configuration read + dcmdata/docs/datadict.txt. + Note that in former versions of DCMTK a macro called + DONT_LOAD_EXTERNAL_DICTIONARIES has been specified which now has been + replaced with ENABLE_EXTERNAL_DICTIONARY in order to be consistent with + the existing Autoconf and CMake configuration switches. See also entry for + DONT_LOAD_EXTERNAL_DICTIONARIES. + +EXPERIMENTAL_READ_FROM_FILE + Affected: dump2dcm + Type of modification: Activates experimental or rarely used feature + Explanation: When this macro is defined, the relatively new function + createValueFromTempFile() is used for reading large binary data files. + +LOCK_IMAGE_FILES + Affected: dcmpstat, dcmqrdb + Type of modification: Activates experimental or rarely used feature + Explanation: When this macro is defined, the DICOM image file to be + send or received/created is locked exclusively. + +LOG4CPLUS_DISABLE_xxx +(where xxx is one of TRACE, DEBUG, INFO, WARN, ERROR and FATAL) + Affected: oflog + Type of modification: Disables feature + Explanation: When one of these macros is defined all log message of + this type and lower are disabled and optimized away. + +NO_GET_SUPPORT + Affected: dcmqrdb + Type of modification: Disables feature + Explanation: Disables the experimental C-GET support in dcmqrdb. + +NO_PATIENTSTUDYONLY_SUPPORT + Affected: dcmqrdb + Type of modification: Disables feature + Explanation: Disables support for the Patient/Study Only Query/Retrieve + Model in dcmqrdb. + +OFCONDITION_IMPLICIT_BOOL_CONVERSION + Affected: ofstd + Type of modification: Activates experimental or rarely used feature + Explanation: Activates an implicit conversion from OFCondition to + OFBool, i.e. operator OFBool(). Implicit conversion might not always + be a good idea since it can hide unwanted constructs. Therefore, + this operator is disabled by default. + +ON_THE_FLY_COMPRESSION + Affected: storescu + Type of modification: Activates experimental or rarely used feature + Explanation: When this macro is defined, the storescu tries to compress + or decompress the DICOM image to be sent (if required) depending on + the negotiated transfer syntax. + +OLD_USER_INFO_SUB_ITEM_ORDER + Affected: dcmnet + Type of modification: Activates experimental or rarely used feature + Explanation: Prior DCMTK releases did not encode A-ASSOCIATE user + information sub-items in ascending order, i.e. they sent 55H + followed by 54H and 56H. This behavior has been "legalized" by + DICOM CP 280 but is known to create problems with some other + toolkits. The current DCMTK release always sends the user + information sub-items in ascending order, but can be "forced" with + this macro to revert to the old behavior. It should be re-activated + for testing purposes only. + +PASTEL_COLOR_OUTPUT + Affected: dcmimgle, dcmimage + Type of modification: Activates experimental or rarely used feature + Explanation: Activates experimental code in dcmimgle/dcmimage that + renders monochrome images with pastel colors. + +PDV_TEST + Affected: dcmnet + Type of modification: Activates experimental or rarely used feature + Explanation: Causes the network module to insert a false, zero-length + PDV (2 byte header) into each P-DATA-PDU. + +PIXELSTACK_MEMORY_LEAK_WORKAROUND + Affected: dcmdata + Type of modification: Activates experimental or rarely used feature + Explanation: On certain platforms there seems to be a memory leak in + DcmDataset::chooseRepresentation(). The work-around activated by + this macro should solve this issue. + +PRINT_REPLACED_DICTIONARY_ENTRIES + Affected: dcmdata + Type of modification: Activates experimental or rarely used feature + Explanation: When reading the data dictionary, duplicate entries (i.e. + entries replacing an older entry in the dictionary) are reported on + console if compiled with this macro. Useful for testing a new + dictionary version. + +REJECT_FILE_IF_META_GROUP_LENGTH_ABSENT + Affected: dcmdata + Type of modification: Disables feature + Explanation: When reading the a file that contains an incorrect meta + header where meta header group length (0002,0000) is absent, DCMTK + since release 3.5.4 nevertheless tries to parse the file, unless this + macro is enabled, in which case the behavior up to DCMTK 3.5.3 is + retained. + +RETAIN_ASSOCIATION + Affected: dcmqrti + Type of modification: Activates experimental or rarely used feature + Explanation: Keeps association to remote Query SCP open after + study/series/image listing. Default behavior is to open new + association for each query. + +REVERSE_OVERLAY_ORIGIN_ORDER + Affected: dcmimgle + Type of modification: Activates experimental or rarely used feature + Explanation: When compiled with this macro, dcmimgle assumes that the + values in DCM_ImageFrameOrigin are in reverse order, i.e. X\Y + instead of Y\X. + +SITE_UID_ROOT + Affected: dcmdata + Type of modification: Site customization + Explanation: dcmdata contains a routine that generates DICOM unique + identifiers (UIDs). By default, these are constructed from the OFFIS + UID namespace, i.e. using the OFFIS UID Root "1.2.276.0.7230010.3". + Users who prefer to let the toolkit generate UIDs from their own UID + namespace should compile DCMTK with SITE_UID_ROOT defined to their own + UID root. Please make sure that the resulting UIDs do not exceed the + 64 characters limit! + +STARVIEW + Affected: dcmimgle, dcmimage + Type of modification: Activates experimental or rarely used feature + Explanation: Enables support for old StarView 2 GUI class library from + Star Division. + +SUPPRESS_CREATE_STAMP + Affected: dcmdata + Type of modification: Activates experimental or rarely used feature + Explanation: When defined, suppresses the creation of a time stamp + comment when re-generating dcdeftag.h and dcdictbi.cc. + +USE__LOCKING + Affected: dcmnet + Type of modification: Activates alternative implementation + Explanation: Activates an alternative emulation of flock() on Win32 + platforms using _locking(). This version should only be used on + compilers where _get_osfhandle() is not available since it does not + implement shared locks. + +USE_BINARY_MODE_FOR_STDOUT_ON_WINDOWS + Affected: dcmdata + Type of modification: Activates experimental or rarely used feature + Explanation: On Windows systems, the standard output (stdout) is opened in + text mode by default. Therefore, the binary output of tools like dcm2pnm + to stdout does not work correctly (in contrast to Unix systems). When + this preprocessor macro is defined, the binary mode is enabled for stdout. + However, this causes newlines in the textual output to be converted to LF + only (instead of CR LF which would be the usual translation for Windows). + +USE_NULL_SAFE_OFSTRING + Affected: ofstd + Type of modification: Activates feature + Explanation: When this macro is defined, OFString(NULL) results in an + empty string. If this macro is not defined, OFString(NULL) causes a + NULL pointer dereference. This macro has no effect when HAVE_STL_STRING + is also defined. Currently, this macro is always defined by DCMTK's + Makefiles. This will change in future releases. + +USE_WIN32_CREATE_MUTEX + Affected: ofstd + Type of modification: Activates alternative implementation + Explanation: Starting with DCMTK 3.6.2, the Win32 version of the + OFMutex class uses critical sections instead of Win32 mutexes, because + critical sections are much faster. Their only drawback is that they + cannot be shared across processes. Users who want to revert to the + behavior of older DCMTK releases can define this macro. + +USE_WIN32_READ_WRITE_LOCK_HELPER + Affected: ofstd + Type of modification: Re-activated behavior of earlier DCMTK releases + Explanation: Starting with DCMTK 3.6.4, the Win32 version of the + OFReadWriteLock class uses Slim Reader/Writer (SRW) Locks, + which are available since Windows Vista, instead of the older + implementation based on a Mutex, a Semaphore and a counter, because + SRW locks are much faster. Users who want to revert to the + behavior of older DCMTK releases can define this macro. + +USING_STD_NAMESPACE + Affected: all modules + Type of modification: Re-activated behavior of earlier DCMTK releases + Explanation: DCMTK by default does not anymore pollute the default namespace + by importing namespace std. Earlier releases did this to simplify + compatibility with older compilers where STL classes were not consistently + defined in namespace std. We now have configure macros which should care + for this. If user code still relies on namespace std to be included, + compile with this macro defined. + +WIDE_CHAR_FILE_IO_FUNCTIONS + Affected: ofstd + Type of modification: Activates feature + Explanation: In addition to the standard file I/O functions, the OFFile class + also defines the corresponding wide character functions from C99 standard. + Since these functions are not yet supported by all compilers and the + current implementation is Windows-specific, this feature is disabled by + default. When using CMake, you can enable this macro by setting the CMake + option DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS to "on". + +WIDE_CHAR_MAIN_FUNCTION + Affected: currently not used + Type of modification: Activates experimental or rarely used feature + Explanation: On Windows (at least for MSVC), a different main function has + to be used in order to get the command line arguments with wide character + encoding (UTF-16). By defining this flag, the macro DCMTK_MAIN_FUNCTION + expands to wmain() instead of main(). When using CMake, you can enable + this macro by setting the CMake option DCMTK_WIDE_CHAR_MAIN_FUNCTION to + "on". Usually, WIDE_CHAR_FILE_IO_FUNCTIONS should also be enabled. + +WIDE_CHAR_XML_PARSER + Affected: ofstd + Type of modification: Activates experimental or rarely used feature + Explanation: The XML parser that is part of the DCMTK also supports a wide + character API, at least on Windows systems. By defining this macro, the + type "wchar_t" is used for character strings instead of "char". Please + note, however, that some DCMTK tools and classes have not yet been adapted + for the wide character API of the parser, e.g. cda2dcm and the underlying + class DcmEncapsulatedDocument. This is also the reason why there is no + CMake option yet. + +WRITE_VERY_LARGE_CHUNKS + Affected: dcmdata + Type of modification: Re-activated behavior of earlier DCMTK releases + Explanation: On Windows (at least for some versions of MSVC), calls to + fwrite() for more than 67,076,095 bytes (a bit less than 64 MByte) fail if + we're writing to a network share. See MSDN KB899149. As a workaround, we + always write in chunks of 32M which should hardly negatively affect + performance. This macro enables the behavior of earlier DCMTK releases, + i.e. to always call fwrite with as much data as possible, which is known + not to work correctly on Win32 but might offer very minor performance + benefits on other platforms. + +ZLIB_ENCODE_RFC1950_HEADER + Affected: dcmdata + Type of modification: Activates experimental or rarely used feature + Explanation: When this macro is defined, the deflated ZLIB format is created + instead of the deflated bitstream format (i.e. RFC 1950 instead of RFC + 1951). Please note that the resulting bitstream is not DICOM compliant. + So, use only for testing, and use with care! diff --git a/config/docs/modules.txt b/config/docs/modules.txt new file mode 100644 index 00000000..3b2b8678 --- /dev/null +++ b/config/docs/modules.txt @@ -0,0 +1,65 @@ +Configuration of the different Modules +====================================== + +The following files in the "config" directory are used for the configuration +of the DCMTK modules: + +confmod.in definition of configuration tests for modules +confmod creates "configure" for modules +general.m4 general configuration tests (see "config.txt") +Makefile.def general default Makefile definitions for all modules, generated + by "configure" +templates/configure.mod + "configure" for the modules' directories, must be copied to the + main module directory (see "dirstruc.txt") +include/dcmtk/config/osconfig.h + definition that must be included into the modules' source + files, generated by "configure" + +"confmod" must be copied to the module's main directory and renamed to +"configure". + + +Modules configure +================= + +This configure script runs the modules' and the main configure script in the +"config" directory (using special options): + +Syntax: + configure [-a|-c] + +Purpose: + Without options, this script calls "confmod" in the "config" directory + to create the configuration for the Makefiles in the module. + Using -a mean that first the "configure" in the "config" directory is + called and then "confmod". With -c only the "configure" in the + "config" directory is started. The "configure" options are passed to + the called scripts. + To determine the "config" directory the script searches from the local + directory to the root to find a directory named "config". The output + of the "confmod" script (*.cache, *.status, *.log) is stored in the + module's directory. It is not possible to call "confmod" from the + "config" directory. + +"confmod.in" stores the configurations that must be used in the modules and not +in the "config" directory. This is mainly used to define variables that +specify the "config" directory and the default Makefile template. + + +Modules Makefiles +================= + +All Makefiles in the modules' directories must include the following lines: + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +See the Makefile.* in the config/templates directory. diff --git a/config/general.m4 b/config/general.m4 new file mode 100644 index 00000000..1d3d6f6e --- /dev/null +++ b/config/general.m4 @@ -0,0 +1,7 @@ +dnl This file is includes into configure.in + +dnl Get configuration directory +AC_PROG_MAKE_SET +AC_PREFIX_DEFAULT(/usr/local) +common_makefile=Makefile.def +AC_SUBST(common_makefile) diff --git a/config/include/dcmtk/config/osconfig.h.in b/config/include/dcmtk/config/osconfig.h.in new file mode 100644 index 00000000..006750e1 --- /dev/null +++ b/config/include/dcmtk/config/osconfig.h.in @@ -0,0 +1,1205 @@ +/* include/dcmtk/config/osconfig.h.in. Generated from configure.in by autoheader. */ + +#ifndef OSCONFIG_H +#define OSCONFIG_H + +/* +** Define enclosures for include files with C linkage (mostly system headers) +*/ +#ifdef __cplusplus +#define BEGIN_EXTERN_C extern "C" { +#define END_EXTERN_C } +#else +#define BEGIN_EXTERN_C +#define END_EXTERN_C +#endif + +/* MinGW needs some special handling because it is a mixture of WIN32 and Posix. + * The following settings are not tested by configure but need to be set for MinGW. + */ +#ifdef __MINGW32__ +#define HAVE_WINDOWS_H 1 +#define HAVE_WINSOCK_H 1 +#define ENVIRONMENT_PATH_SEPARATOR ';' +#endif + +/* Define if __attribute__((aligned)) supports templates. */ +#undef ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES + +/* Define the canonical host system type as a string constant. */ +#undef CANONICAL_HOST_TYPE + +/* Define if char is unsigned on the C compiler. */ +#undef C_CHAR_UNSIGNED + +/* Define to the inline keyword supported by the C compiler, if any, or to the + empty string */ +#undef C_INLINE + +/* Define if >> is unsigned on the C compiler */ +#undef C_RIGHTSHIFT_UNSIGNED + +/* character set conversion constants. */ +#define DCMTK_CHARSET_CONVERSION_ICU 1 +#define DCMTK_CHARSET_CONVERSION_ICONV 2 +#define DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV 3 + +/* LFS mode constants. */ +#define DCMTK_LFS 1 +#define DCMTK_LFS64 2 + +/* Define to select character set conversion implementation. */ +#undef DCMTK_ENABLE_CHARSET_CONVERSION + +/* Select LFS mode (defined above) that shall be used or don't define it */ +#undef DCMTK_ENABLE_LFS + +/* Try to define the iconv behavior as conversion flags */ +#undef DCMTK_FIXED_ICONV_CONVERSION_FLAGS + +/* Define if your system has a usable . */ +#undef DCMTK_HAVE_POLL + +/* Define the DCMTK default path. */ +#undef DCMTK_PREFIX + +/* Define if iconv_open() accepts "" as an argument */ +#undef DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING + +/* Define the default data dictionary path for the dcmdata library package. */ +#undef DCM_DICT_DEFAULT_PATH + +/* Define the default directory where configuration files reside. */ +#undef DEFAULT_CONFIGURATION_DIR + +/* Define the default directory where support data files reside. */ +#undef DEFAULT_SUPPORT_DATA_DIR + +/* Define if we are compiling with built-in (compiled-in) dictionary enabled. + */ +#undef ENABLE_BUILTIN_DICTIONARY + +/* Define if we are compiling for loading external dictionary from default + path. */ +#undef ENABLE_EXTERNAL_DICTIONARY + +/* Define if we are compiling for enabling external private tag dictionary. */ +#undef ENABLE_PRIVATE_TAGS + +/* Define the environment variable path separator. */ +#ifndef ENVIRONMENT_PATH_SEPARATOR +#define ENVIRONMENT_PATH_SEPARATOR ':' +#endif + +/* Define to 1 if you have the `accept' function. */ +#undef HAVE_ACCEPT + +/* Define to 1 if you have the `access' function. */ +#undef HAVE_ACCESS + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the `atoll' function. */ +#undef HAVE_ATOLL + +/* Define if __attribute__((aligned)) is available. */ +#undef HAVE_ATTRIBUTE_ALIGNED + +/* Define to 1 if you have the `bcmp' function. */ +#undef HAVE_BCMP + +/* Define to 1 if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define if the bidirectional iterator category is supported. */ +#undef HAVE_BIDIRECTIONAL_ITERATOR_CATEGORY + +/* Define to 1 if you have the `bind' function. */ +#undef HAVE_BIND + +/* Define to 1 if you have the `bzero' function. */ +#undef HAVE_BZERO + +/* Define to 1 if the system has the type `char16_t'. */ +#undef HAVE_CHAR16_T + +/* Define if your system declares the return type of strerror_r as char * + instead of int */ +#undef HAVE_CHARP_STRERROR_R + +/* Define if your C++ compiler can work with class templates. */ +#undef HAVE_CLASS_TEMPLATE + +/* Define to 1 if you have the header file. */ +#undef HAVE_CLIMITS + +/* Define to 1 if you have the header file. */ +#undef HAVE_CMATH + +/* Define to 1 if you have the `connect' function. */ +#undef HAVE_CONNECT + +/* Define if the compiler supports const_cast<>. */ +#undef HAVE_CONST_CAST + +/* Define if the contiguous iterator category is supported. */ +#undef HAVE_CONTIGUOUS_ITERATOR_CATEGORY + +/* Define to 1 if you have the header file. */ +#undef HAVE_CSTDARG + +/* Define to 1 if you have the header file. */ +#undef HAVE_CSTDDEF + +/* Define to 1 if you have the header file. */ +#undef HAVE_CSTDINT + +/* Define to 1 if you have the header file. */ +#undef HAVE_CSTDIO + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the `cuserid' function. */ +#undef HAVE_CUSERID + +/* define if the compiler supports basic C++11 syntax */ +#undef HAVE_CXX11 + +/* Define if bool is a built-in type. */ +#undef HAVE_CXX_BOOL + +/* Define if volatile is a known keyword */ +#undef HAVE_CXX_VOLATILE + +/* Define if "const" is supported by the C compiler. */ +#undef HAVE_C_CONST + +/* Define if your system has a declaration for socklen_t in sys/types.h + sys/socket.h . */ +#undef HAVE_DECLARATION_SOCKLEN_T + +/* Define if your system has a declaration for std::ios_base::openmode in + iostream.h. */ +#undef HAVE_DECLARATION_STD__IOS_BASE__OPENMODE + +/* Define if your system has a declaration for struct utimbuf in sys/types.h + utime.h sys/utime.h . */ +#undef HAVE_DECLARATION_STRUCT_UTIMBUF + +/* Define if the compiler supports default constructor detection via SFINAE. + */ +#undef HAVE_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define if the compiler supports dynamic_cast<>. */ +#undef HAVE_DYNAMIC_CAST + +/* Define if your system cannot pass command line arguments into main() (e.g. Macintosh). */ +/* #undef HAVE_EMPTY_ARGC_ARGV */ + +/* Define if your system provides ENAMETOOLONG errno value. */ +#undef HAVE_ENAMETOOLONG + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define if your C++ compiler supports the explicit template specialization + syntax. */ +#undef HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION + +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FENV_H + +/* Define to 1 if you have the `finite' function. */ +#undef HAVE_FINITE + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the `flock' function. */ +#undef HAVE_FLOCK + +/* Define to 1 if you have the header file. */ +#undef HAVE_FNMATCH_H + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + +/* Define if the forward iterator category is supported. */ +#undef HAVE_FORWARD_ITERATOR_CATEGORY + +/* Define to 1 if the system has the type `fpos64_t'. */ +#undef HAVE_FPOS64_T + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#undef HAVE_FSEEKO + +/* Define to 1 if you have the header file. */ +#undef HAVE_FSTREAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_FSTREAM_H + +/* Define to 1 if you have the `ftime' function. */ +#undef HAVE_FTIME + +/* Define if your C++ compiler can work with function templates. */ +#undef HAVE_FUNCTION_TEMPLATE + +/* Define to 1 if you have the `getaddrinfo' function. */ +#undef HAVE_GETADDRINFO + +/* Define to 1 if you have the `getenv' function. */ +#undef HAVE_GETENV + +/* Define to 1 if you have the `geteuid' function. */ +#undef HAVE_GETEUID + +/* Define to 1 if you have the `getgrnam' function. */ +#undef HAVE_GETGRNAM + +/* Define to 1 if you have the `getgrnam_r' function. */ +#undef HAVE_GETGRNAM_R + +/* Define to 1 if you have the `gethostbyaddr_r' function. */ +#undef HAVE_GETHOSTBYADDR_R + +/* Define to 1 if you have the `gethostbyname' function. */ +#undef HAVE_GETHOSTBYNAME + +/* Define to 1 if you have the `gethostbyname_r' function. */ +#undef HAVE_GETHOSTBYNAME_R + +/* Define to 1 if you have the `gethostid' function. */ +#undef HAVE_GETHOSTID + +/* Define to 1 if you have the `gethostname' function. */ +#undef HAVE_GETHOSTNAME + +/* Define to 1 if you have the `getlogin' function. */ +#undef HAVE_GETLOGIN + +/* Define to 1 if you have the `getlogin_r' function. */ +#undef HAVE_GETLOGIN_R + +/* Define to 1 if you have the `getpid' function. */ +#undef HAVE_GETPID + +/* Define to 1 if you have the `getpwnam' function. */ +#undef HAVE_GETPWNAM + +/* Define to 1 if you have the `getpwnam_r' function. */ +#undef HAVE_GETPWNAM_R + +/* Define to 1 if you have the `getrusage' function. */ +#undef HAVE_GETRUSAGE + +/* Define to 1 if you have the `getsockname' function. */ +#undef HAVE_GETSOCKNAME + +/* Define to 1 if you have the `getsockopt' function. */ +#undef HAVE_GETSOCKOPT + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `getuid' function. */ +#undef HAVE_GETUID + +/* Define to 1 if you have the `gmtime_r' function. */ +#undef HAVE_GMTIME_R + +/* Define if __alignof__ is available. */ +#undef HAVE_GNU_ALIGNOF + +/* Define to 1 if you have the header file. */ +#undef HAVE_GRP_H + +/* Define to 1 if you have the `htonl' function. */ +#undef HAVE_HTONL + +/* Define to 1 if you have the `htons' function. */ +#undef HAVE_HTONS + +/* Define to 1 if you have the header file. */ +#undef HAVE_IEEEFP_H + +/* Define to 1 if you have the `index' function. */ +#undef HAVE_INDEX + +/* Define if the input iterator category is supported. */ +#undef HAVE_INPUT_ITERATOR_CATEGORY + +/* Define to 1 if the system has the type `int64_t'. */ +#undef HAVE_INT64_T + +/* Define if your system declares argument 3 of accept() as int * instead of + size_t * or socklen_t *. */ +#undef HAVE_INTP_ACCEPT + +/* Define if your system declares argument 5 of getsockopt() as int * instead + of size_t * or socklen_t. */ +#undef HAVE_INTP_GETSOCKOPT + +/* Define if your system declares argument 2-4 of select() as int * instead of + struct fd_set *. */ +#undef HAVE_INTP_SELECT + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOMANIP + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOMANIP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOSTREAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOSTREAM_H + +/* Define if your system defines ios::nocreate in iostream.h */ +#undef HAVE_IOS_NOCREATE + +/* Define to 1 if you have the header file. */ +#undef HAVE_IO_H + +/* Define to 1 if you have the `isinf' function. */ +#undef HAVE_ISINF + +/* Define to 1 if you have the `isnan' function. */ +#undef HAVE_ISNAN + +/* Define to 1 if you have the header file. */ +#undef HAVE_ISO646_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ITERATOR_HEADER + +/* Define to 1 if you have the `itoa' function. */ +#undef HAVE_ITOA + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBC_H + +/* Define to 1 if you have the `iostream' library (-liostream). */ +#undef HAVE_LIBIOSTREAM + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBPNG_PNG_H + +/* Define to 1 if you have the `socket' library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `listen' function. */ +#undef HAVE_LISTEN + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the `localtime_r' function. */ +#undef HAVE_LOCALTIME_R + +/* Define to 1 if you have the `lockf' function. */ +#undef HAVE_LOCKF + +/* Define to 1 if the system has the type `longlong'. */ +#undef HAVE_LONGLONG + +/* Define to 1 if you support file names longer than 14 characters. */ +#undef HAVE_LONG_FILE_NAMES + +/* Define to 1 if the system has the type `long long'. */ +#undef HAVE_LONG_LONG + +/* Define to 1 if you have the `lstat' function. */ +#undef HAVE_LSTAT + +/* Define to 1 if you have the `malloc_debug' function. */ +#undef HAVE_MALLOC_DEBUG + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MATH_H + +/* Define to 1 if you have the `mbstowcs' function. */ +#undef HAVE_MBSTOWCS + +/* Define to 1 if you have the `memcmp' function. */ +#undef HAVE_MEMCMP + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have the `mktemp' function. */ +#undef HAVE_MKTEMP + +/* Define to 1 if you have the `nanosleep' function. */ +#undef HAVE_NANOSLEEP + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_SYSTM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NEW + +/* Define to 1 if you have the header file. */ +#undef HAVE_NEW_H + +/* Define if the compiler supports operator delete (std::nothrow.) */ +#undef HAVE_NOTHROW_DELETE + +/* Define `pid_t' to `int' if does not define. */ +#undef HAVE_NO_TYPEDEF_PID_T + +#ifdef HAVE_NO_TYPEDEF_PID_T +typedef int pid_t; +#endif + +/* Define `size_t' to `unsigned' if does not define. */ +#undef HAVE_NO_TYPEDEF_SIZE_T + +#ifdef HAVE_NO_TYPEDEF_SIZE_T +typedef unsigned size_t; +#endif + +/* Define `ssize_t' to `long' if does not define. */ +#undef HAVE_NO_TYPEDEF_SSIZE_T + +#ifdef HAVE_NO_TYPEDEF_SSIZE_T +typedef long ssize_t; +#endif + +/* Define `uchar' to `unsigned char' if does not define. */ +#undef HAVE_NO_TYPEDEF_UCHAR + +#ifdef HAVE_NO_TYPEDEF_UCHAR +typedef unsigned char uchar; +#endif + +/* Define `uint' to `unsigned int' if does not define. */ +#undef HAVE_NO_TYPEDEF_UINT + +#ifdef HAVE_NO_TYPEDEF_UINT +typedef unsigned int uint; +#endif + +/* Define `ulong' to `unsigned long' if does not define. */ +#undef HAVE_NO_TYPEDEF_ULONG + +#ifdef HAVE_NO_TYPEDEF_ULONG +typedef unsigned long ulong; +#endif + +/* Define `ushort' to `unsigned short' if does not define. */ +#undef HAVE_NO_TYPEDEF_USHORT + +#ifdef HAVE_NO_TYPEDEF_USHORT +typedef unsigned short ushort; +#endif + +/* Define to 1 if you have the `ntohl' function. */ +#undef HAVE_NTOHL + +/* Define to 1 if you have the `ntohs' function. */ +#undef HAVE_NTOHS + +/* Define to 1 if the system has the type `off64_t'. */ +#undef HAVE_OFF64_T + +/* Define if your system supports readdir_r with the obsolete Posix 1.c draft + 6 declaration (2 arguments) instead of the Posix 1.c declaration with 3 + arguments. */ +#undef HAVE_OLD_READDIR_R + +/* Define if the output iterator category is supported. */ +#undef HAVE_OUTPUT_ITERATOR_CATEGORY + +/* Define if passwd::pw_gecos is available. */ +#undef HAVE_PASSWD_GECOS + +/* Define to 1 if you have the `pclose' function. */ +#undef HAVE_PCLOSE + +/* Define if pthread_t is a pointer type on your system */ +#undef HAVE_POINTER_TYPE_PTHREAD_T + +/* Define to 1 if you have the `popen' function. */ +#undef HAVE_POPEN + +/* Define if your system has a prototype for accept in sys/types.h + sys/socket.h. */ +#undef HAVE_PROTOTYPE_ACCEPT + +/* Define if your system has a prototype for bind in sys/types.h sys/socket.h. + */ +#undef HAVE_PROTOTYPE_BIND + +/* Define if your system has a prototype for bzero in string.h strings.h + libc.h unistd.h stdlib.h. */ +#undef HAVE_PROTOTYPE_BZERO + +/* Define if your system has a prototype for connect in sys/types.h + sys/socket.h. */ +#undef HAVE_PROTOTYPE_CONNECT + +/* Define if your system has a prototype for feenableexcept in fenv.h. */ +#undef HAVE_PROTOTYPE_FEENABLEEXCEPT + +/* Define if your system has a prototype for finite in math.h. */ +#undef HAVE_PROTOTYPE_FINITE + +/* Define if your system has a prototype for flock in sys/file.h. */ +#undef HAVE_PROTOTYPE_FLOCK + +/* Define if your system has a prototype for gethostbyaddr_r in libc.h + unistd.h stdlib.h netdb.h. */ +#undef HAVE_PROTOTYPE_GETHOSTBYADDR_R + +/* Define if your system has a prototype for gethostbyname in libc.h unistd.h + stdlib.h netdb.h. */ +#undef HAVE_PROTOTYPE_GETHOSTBYNAME + +/* Define if your system has a prototype for gethostbyname_r in libc.h + unistd.h stdlib.h netdb.h. */ +#undef HAVE_PROTOTYPE_GETHOSTBYNAME_R + +/* Define if your system has a prototype for gethostid in libc.h unistd.h + stdlib.h netdb.h. */ +#undef HAVE_PROTOTYPE_GETHOSTID + +/* Define if your system has a prototype for gethostname in unistd.h libc.h + stdlib.h netdb.h. */ +#undef HAVE_PROTOTYPE_GETHOSTNAME + +/* Define if your system has a prototype for getsockname in sys/types.h + sys/socket.h. */ +#undef HAVE_PROTOTYPE_GETSOCKNAME + +/* Define if your system has a prototype for getsockopt in sys/types.h + sys/socket.h. */ +#undef HAVE_PROTOTYPE_GETSOCKOPT + +/* Define if your system has a prototype for gettimeofday in sys/time.h + unistd.h. */ +#undef HAVE_PROTOTYPE_GETTIMEOFDAY + +/* Define if your system has a prototype for isinf in math.h. */ +#undef HAVE_PROTOTYPE_ISINF + +/* Define if your system has a prototype for isnan in math.h. */ +#undef HAVE_PROTOTYPE_ISNAN + +/* Define if your system has a prototype for listen in sys/types.h + sys/socket.h. */ +#undef HAVE_PROTOTYPE_LISTEN + +/* Define if your system has a prototype for mkstemp in libc.h unistd.h + stdlib.h. */ +#undef HAVE_PROTOTYPE_MKSTEMP + +/* Define if your system has a prototype for mktemp in libc.h unistd.h + stdlib.h. */ +#undef HAVE_PROTOTYPE_MKTEMP + +/* Define if your system has a prototype for select in sys/select.h + sys/types.h sys/socket.h sys/time.h. */ +#undef HAVE_PROTOTYPE_SELECT + +/* Define if your system has a prototype for setsockopt in sys/types.h + sys/socket.h. */ +#undef HAVE_PROTOTYPE_SETSOCKOPT + +/* Define if your system has a prototype for socket in sys/types.h + sys/socket.h. */ +#undef HAVE_PROTOTYPE_SOCKET + +/* Define if your system has a prototype for std::finite in cmath. */ +#undef HAVE_PROTOTYPE_STD__FINITE + +/* Define if your system has a prototype for std::isinf in cmath. */ +#undef HAVE_PROTOTYPE_STD__ISINF + +/* Define if your system has a prototype for std::isnan in cmath. */ +#undef HAVE_PROTOTYPE_STD__ISNAN + +/* Define if your system has a prototype for std::vfprintf in stdarg.h + stdio.h. */ +#undef HAVE_PROTOTYPE_STD__VFPRINTF + +/* Define if your system has a prototype for std::vsnprintf in stdarg.h + stdio.h. */ +#undef HAVE_PROTOTYPE_STD__VSNPRINTF + +/* Define if your system has a prototype for strcasecmp in string.h. */ +#undef HAVE_PROTOTYPE_STRCASECMP + +/* Define if your system has a prototype for strerror_r in string.h. */ +#undef HAVE_PROTOTYPE_STRERROR_R + +/* Define if your system has a prototype for strncasecmp in string.h. */ +#undef HAVE_PROTOTYPE_STRNCASECMP + +/* Define if your system has a prototype for usleep in libc.h unistd.h + stdlib.h. */ +#undef HAVE_PROTOTYPE_USLEEP + +/* Define if your system has a prototype for vsnprintf in stdio.h stdarg.h. */ +#undef HAVE_PROTOTYPE_VSNPRINTF + +/* Define if your system has a prototype for wait3 in libc.h sys/wait.h + sys/time.h sys/resource.h. */ +#undef HAVE_PROTOTYPE_WAIT3 + +/* Define if your system has a prototype for waitpid in sys/wait.h sys/time.h + sys/resource.h. */ +#undef HAVE_PROTOTYPE_WAITPID + +/* Define if your system has a prototype for _stricmp in string.h. */ +#undef HAVE_PROTOTYPE__STRICMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define if your system supports POSIX read/write locks. */ +#undef HAVE_PTHREAD_RWLOCK + +/* Define to 1 if you have the header file. */ +#undef HAVE_PWD_H + +/* Define if the random_access iterator category is supported. */ +#undef HAVE_RANDOM_ACCESS_ITERATOR_CATEGORY + +/* Define if OpenSSL provides the RAND_egd function. */ +#undef HAVE_RAND_EGD + +/* Define to 1 if you have the `readdir_r' function. */ +#undef HAVE_READDIR_R + +/* Define if the compiler supports reinterpret_cast<>. */ +#undef HAVE_REINTERPRET_CAST + +/* Define to 1 if you have the `rindex' function. */ +#undef HAVE_RINDEX + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the header file. */ +#undef HAVE_SEMAPHORE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SETJMP_H + +/* Define to 1 if you have the `setsockopt' function. */ +#undef HAVE_SETSOCKOPT + +/* Define to 1 if you have the `setuid' function. */ +#undef HAVE_SETUID + +/* Define to 1 if the system has the type `sigjmp_buf'. */ +#undef HAVE_SIGJMP_BUF + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the `sleep' function. */ +#undef HAVE_SLEEP + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define if OpenSSL provides the SSL_CTX_get0_param function. */ +#undef HAVE_SSL_CTX_GET0_PARAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_SSTREAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_SSTREAM_H + +/* Define to 1 if you have the `stat' function. */ +#undef HAVE_STAT + +/* Define if the compiler supports static_assert */ +#undef HAVE_STATIC_ASSERT + +/* Define if the compiler supports static_cast<>. */ +#undef HAVE_STATIC_CAST + +/* Define if your C++ compiler can work with static methods in class + templates. */ +#undef HAVE_STATIC_TEMPLATE_METHOD + +/* Define to 1 if you have the header file. */ +#undef HAVE_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if ANSI standard C++ includes use std namespace. */ +#undef HAVE_STD_NAMESPACE + +/* Define if the compiler supports std::nothrow. */ +#undef HAVE_STD__NOTHROW + +/* Define if STL's algorithm should be used. */ +#undef HAVE_STL_ALGORITHM + +/* Define if STL's limits should be used. */ +#undef HAVE_STL_LIMITS + +/* Define if STL's list should be used. */ +#undef HAVE_STL_LIST + +/* Define if STL's map should be used. */ +#undef HAVE_STL_MAP + +/* Define if STL's memory should be used. */ +#undef HAVE_STL_MEMORY + +/* Define if STL's stack should be used. */ +#undef HAVE_STL_STACK + +/* Define if STL's string should be used. */ +#undef HAVE_STL_STRING + +/* Define if STL's system_error should be used. */ +#undef HAVE_STL_SYSTEM_ERROR + +/* Define if STL's tuple should be used. */ +#undef HAVE_STL_TUPLE + +/* Define if STL's type traits should be used. */ +#undef HAVE_STL_TYPE_TRAITS + +/* Define if STL's vector should be used. */ +#undef HAVE_STL_VECTOR + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STREAMBUF_H + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strlcat' function. */ +#undef HAVE_STRLCAT + +/* Define to 1 if you have the `strlcpy' function. */ +#undef HAVE_STRLCPY + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRSTREAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRSTREAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRSTREA_H + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYNCH_H + +/* Define if __sync_add_and_fetch is available. */ +#undef HAVE_SYNC_ADD_AND_FETCH + +/* Define if __sync_sub_and_fetch is available. */ +#undef HAVE_SYNC_SUB_AND_FETCH + +/* Define to 1 if you have the `sysinfo' function. */ +#undef HAVE_SYSINFO + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define if your system has a prototype for gettid. */ +#undef HAVE_SYS_GETTID + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCALL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSTEMINFO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIMEB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UTIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UTSNAME_H + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the `tempnam' function. */ +#undef HAVE_TEMPNAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_THREAD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the `tmpnam' function. */ +#undef HAVE_TMPNAM + +/* Define if the compiler recognizes typename. */ +#undef HAVE_TYPENAME + +/* Define to 1 if the system has the type `uint64_t'. */ +#undef HAVE_UINT64_T + +/* Define to 1 if the system has the type `ulonglong'. */ +#undef HAVE_ULONGLONG + +/* Define to 1 if you have the `uname' function. */ +#undef HAVE_UNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNIX_H + +/* Define to 1 if the system has the type `unsigned long long'. */ +#undef HAVE_UNSIGNED_LONG_LONG + +/* Define to 1 if you have the `usleep' function. */ +#undef HAVE_USLEEP + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTIME_H + +/* Define if variable-length arrays are supported in C */ +#undef HAVE_VLA + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to 1 if you have the `wait3' system call. Deprecated, you should no + longer depend upon `wait3'. */ +#undef HAVE_WAIT3 + +/* Define to 1 if you have the `waitpid' function. */ +#undef HAVE_WAITPID + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define to 1 if you have the `wcstombs' function. */ +#undef HAVE_WCSTOMBS + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if you have the `_findfirst' function. */ +#undef HAVE__FINDFIRST + +/* Define if the compiler supports __FUNCTION__. */ +#undef HAVE___FUNCTION___MACRO + +/* Define if the compiler supports __PRETTY_FUNCTION__. */ +#undef HAVE___PRETTY_FUNCTION___MACRO + +/* Define if the compiler supports __func__. */ +#undef HAVE___func___MACRO + +/* Define if libc.h should be treated as a C++ header */ +#undef INCLUDE_LIBC_H_AS_CXX + +/* Define if fails if included extern "C". */ +#undef INCLUDE_MATH_H_AS_CXX + +/* Define if the second argument to iconv() is const. */ +#undef LIBICONV_SECOND_ARGUMENT_CONST + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the release date of this package. */ +#undef PACKAGE_DATE + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to the version number of this package. */ +#undef PACKAGE_VERSION_NUMBER + +/* Define to the version suffix of this package. */ +#undef PACKAGE_VERSION_SUFFIX + +/* Define path separator. */ +#define PATH_SEPARATOR '/' + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define if signal handlers need ellipse (...) parameters. */ +#undef SIGNAL_HANDLER_WITH_ELLIPSE + +/* The size of `char', as computed by sizeof. */ +#undef SIZEOF_CHAR + +/* The size of `double', as computed by sizeof. */ +#undef SIZEOF_DOUBLE + +/* The size of `float', as computed by sizeof. */ +#undef SIZEOF_FLOAT + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Namespace for ANSI C functions in standard C++ headers */ +#undef STDIO_NAMESPACE + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Define if ANSI standard C++ includes are used. */ +#undef USE_STD_CXX_INCLUDES + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define if we are compiling with libiconv support. */ +#undef WITH_LIBICONV + +/* Define if we are compiling with ICU support. */ +#undef WITH_LIBICU + +/* Define if we are compiling with libpng support. */ +#undef WITH_LIBPNG + +/* Define if we are compiling with libtiff support. */ +#undef WITH_LIBTIFF + +/* Define if we are compiling with libxml support. */ +#undef WITH_LIBXML + +/* Define if we are compiling with OpenJPEG support. */ +#undef WITH_OPENJPEG + +/* Define if we are compiling with OpenSSL support. */ +#undef WITH_OPENSSL + +/* Define if we are compiling with libsndfile support. */ +#undef WITH_SNDFILE + +/* Define if the C standard library has iconv builtin. */ +#undef WITH_STDLIBC_ICONV + +/* Define if we are compiling with libwrap (TCP wrapper) support. */ +#undef WITH_TCPWRAPPER + +/* Define if we are compiling with any type of multi-thread support. */ +#undef WITH_THREADS + +/* Define if we are compiling with zlib support. */ +#undef WITH_ZLIB + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define to enable LFS64 (explicit large file support) if available */ +#undef _LARGEFILE64_SOURCE + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +#undef _LARGEFILE_SOURCE + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +# undef __CHAR_UNSIGNED__ +#endif + +/* Define to int if undefined. */ +#undef socklen_t + +#if defined(HAVE_CXX11) && defined(__cplusplus) && __cplusplus < 201103L +#error\ +DCMTK was configured to use C++11 features, but your compiler does not or was not configured to provide them. +#endif + +#endif /* OSCONFIG_H */ diff --git a/config/install-sh b/config/install-sh new file mode 100755 index 00000000..377bb868 --- /dev/null +++ b/config/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config/math.cc b/config/math.cc new file mode 100644 index 00000000..bdfca251 --- /dev/null +++ b/config/math.cc @@ -0,0 +1,129 @@ +/* + * + * Copyright (C) 2015-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: ofstd + * + * Author: Jan Schlamelcher + * + * Purpose: Platform independent definition of basic functions declared + * in resp. . + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CMATH +#define INCLUDE_CFLOAT +#define INCLUDE_IOSTREAM +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/ofstd/oftypes.h" + +#ifdef HAVE_WINDOWS_H +#define WIN32_LEAN_AND_MEAN +#include +#endif + +/* Some MacOS X versions define isinf() and isnan() in but not in */ +#if defined(__APPLE__) && defined(__MACH__) && !defined (__INTEL_COMPILER) +#undef HAVE_PROTOTYPE_ISINF +#undef HAVE_PROTOTYPE_ISNAN +#endif + + +// some systems don't properly define isnan() +#ifdef HAVE_ISNAN +#ifndef HAVE_PROTOTYPE_ISNAN +extern "C" +{ + int isnan(double value); +} +#endif +#endif + + +// some systems don't properly define finite() +#ifdef HAVE_FINITE +#ifndef HAVE_PROTOTYPE_FINITE +extern "C" +{ + int finite(double value); +} +#endif +#endif + +#if !defined(HAVE_ISINF) && defined(HAVE_PROTOTYPE_ISINF) +# define HAVE_ISINF 1 +#endif + +// some systems don't properly define isinf() +#ifdef HAVE_ISINF +#ifndef HAVE_PROTOTYPE_ISINF +extern "C" +{ + int isinf(double value); +} +#endif +#endif /* HAVE_ISINF */ + +struct dcmtk_config_math +{ + static inline OFBool isnan( float f ) + { +#ifdef HAVE_WINDOWS_H + return _isnan(f) != 0; +#elif defined(HAVE_PROTOTYPE_STD__ISNAN) + return STD_NAMESPACE isnan(f); +#else + return ::isnan(f); +#endif + } + + static inline OFBool isnan( double d ) + { +#ifdef HAVE_WINDOWS_H + return _isnan(d) != 0; +#elif defined(HAVE_PROTOTYPE_STD__ISNAN) + return STD_NAMESPACE isnan(d); +#else + return ::isnan(d); +#endif + } + + static inline OFBool isinf( float f ) + { +#ifdef HAVE_PROTOTYPE_STD__ISINF + return STD_NAMESPACE isinf( f ); +#elif defined(HAVE_ISINF) + return ::isinf( f ); +#else + return dcmtk_config_math::isinf( OFstatic_cast( double, f ) ); +#endif + } + + static inline OFBool isinf( double d ) + { +#ifdef HAVE_PROTOTYPE_STD__ISINF + return STD_NAMESPACE isinf( d ); +#elif defined(HAVE_ISINF) + return ::isinf( d ); +#else +#ifdef HAVE_WINDOWS_H + return (! _finite(d)) && (! _isnan(d)); +#else + // Solaris 2.5.1 has finite() and isnan() but not isinf(). + return (! finite(d)) && (! isnan(d)); +#endif +#endif + } +}; diff --git a/config/mkinstalldirs b/config/mkinstalldirs new file mode 100755 index 00000000..55d537f8 --- /dev/null +++ b/config/mkinstalldirs @@ -0,0 +1,162 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2009-04-28.21; # UTC + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the 'mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because '.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config/modules b/config/modules new file mode 100644 index 00000000..16768209 --- /dev/null +++ b/config/modules @@ -0,0 +1 @@ +ofstd oflog dcmdata dcmiod dcmfg dcmseg dcmimgle dcmimage dcmjpeg dcmjpls dcmtls dcmnet dcmsr dcmsign dcmwlm dcmqrdb dcmpstat dcmrt dcmtract dcmpmap diff --git a/config/rootconf b/config/rootconf new file mode 100755 index 00000000..f3c69db3 --- /dev/null +++ b/config/rootconf @@ -0,0 +1,272 @@ +#! /bin/sh + +modulesfile=modules +topdir=.. +output=$topdir/Makefile + +cat > $output <> $output <-all build the complete module" + @echo "-libsrc-all build the module's libraries" + @echo "-install install the module" + @echo "-install-lib install the module's libraries" + @echo "-check build and run the module's tests, not including exhaustive tests" + @echo "-check-exhaustive build and run the module's tests, including exhaustive tests" + @echo "" + @echo "The following modules are available:" + @echo "" + @echo "$modules" + +EOF + +for module in config $modules; do + cat >> $output <> $output + if test $tag = dependencies ; then + echo " -(cd config && \$(MAKE) ${tag})" >> $output + fi + for module in $modules; do + echo " (cd ${module} && \$(MAKE) ${tag})" >> $output + done + if test $tag != dependencies ; then + echo " (cd doxygen && \$(MAKE) ${tag})" >> $output + echo " -(cd config && \$(MAKE) ${tag})" >> $output + fi + if test $tag = clean ; then + echo " rm -f \$(TRASH)" >> $output + elif test $tag = distclean ; then + echo " rm -f \$(TRASH)" >> $output + fi + echo >> $output +done + +output=$topdir/configure +cat > $output <" + echo "" + echo "and use" + echo "" + echo " ./configure --ignore-deprecation" + echo "" + echo "to run the old configure script anyway." + echo "" + exit 1 + fi + for module in \$modules ; do + echo "Running configure for module \$module." + if test ! -x "\$module/configure" ; then + echo "Module \$module does not contain a configure script!" >&2 + exit 1 + fi + (cd \$module && ./configure \$args ) || exit 1 + done +fi +EOF +chmod 755 $output diff --git a/config/stdcxx.m4 b/config/stdcxx.m4 new file mode 100644 index 00000000..f99ce541 --- /dev/null +++ b/config/stdcxx.m4 @@ -0,0 +1,980 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016 Krzesimir Nowak +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus <= 201402L + +#error "This is not a C++17 compiler" + +#else + +#if defined(__clang__) + #define REALLY_CLANG +#else + #if defined(__GNUC__) + #define REALLY_GCC + #endif +#endif + +#include +#include +#include + +namespace cxx17 +{ + +#if !defined(REALLY_CLANG) + namespace test_constexpr_lambdas + { + + // TODO: test it with clang++ from git + + constexpr int foo = [](){return 42;}(); + + } +#endif // !defined(REALLY_CLANG) + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + +#if !defined(REALLY_CLANG) + namespace test_template_argument_deduction_for_class_templates + { + + // TODO: test it with clang++ from git + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } +#endif // !defined(REALLY_CLANG) + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + +#if !defined(REALLY_CLANG) + namespace test_structured_bindings + { + + // TODO: test it with clang++ from git + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } +#endif // !defined(REALLY_CLANG) + +#if !defined(REALLY_CLANG) + namespace test_exception_spec_type_system + { + + // TODO: test it with clang++ from git + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } +#endif // !defined(REALLY_CLANG) + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus <= 201402L + +]]) \ No newline at end of file diff --git a/config/templates/Makefile.lib b/config/templates/Makefile.lib new file mode 100644 index 00000000..27dfd7fa --- /dev/null +++ b/config/templates/Makefile.lib @@ -0,0 +1,51 @@ +# +# Makefile for module/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +LOCALINCLUDES = +LIBDIRS = +LOCALLIBS = +LOCALDEFS = + +objs = # all objects in library +library = libname.$(LIBEXT) + + +all: $(library) + + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + +# Clean-up + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: clean + rm -f $(DISTTRASH) + + +# Dependencies + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/config/templates/Makefile.mod b/config/templates/Makefile.mod new file mode 100644 index 00000000..f1577879 --- /dev/null +++ b/config/templates/Makefile.mod @@ -0,0 +1,93 @@ +# +# Makefile for module +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) + +check: + (cd tests && $(MAKE) check) diff --git a/config/templates/Makefile.src b/config/templates/Makefile.src new file mode 100644 index 00000000..55a913ae --- /dev/null +++ b/config/templates/Makefile.src @@ -0,0 +1,48 @@ +# +# Makefile for module/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +LOCALINCLUDES = +LIBDIRS = -L$(top_srcdir)/libsrc -L$(libdir) +LOCALLIBS = # every non-system library you need to compile + +objs = # all objects to compile +progs = # all programs to make + + +all: $(progs) + +prog: prog.o # additionally a not install library + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + + +install: install-bin + +install-bin: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/config/templates/configure.mod b/config/templates/configure.mod new file mode 100755 index 00000000..30dd11a6 --- /dev/null +++ b/config/templates/configure.mod @@ -0,0 +1,52 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi diff --git a/config/tests/algo.cc b/config/tests/algo.cc new file mode 100644 index 00000000..395c1027 --- /dev/null +++ b/config/tests/algo.cc @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation + */ + +#include +#include + +struct X { + int *n; + + void operator()(int x) + { + ++*n; + } +}; + +int main() +{ + std::vector vec; + vec.push_back(1); + vec.push_back(2); + + int n = 0; + + X x; + x.n = &n; + + std::for_each(vec.begin(), vec.end(), x); + + if (n != 2) { + return -1; + } + + if (std::find(vec.begin(), vec.end(), 44) != vec.end()) { + return -1; + } + + if (std::adjacent_find(vec.begin(), vec.end()) != vec.end()) { + return -1; + } + + return 0; +} diff --git a/config/tests/arith.cc b/config/tests/arith.cc new file mode 100644 index 00000000..c2cdd9db --- /dev/null +++ b/config/tests/arith.cc @@ -0,0 +1,636 @@ +/* + * + * Copyright (C) 2014-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Jan Schlamelcher + * + * Purpose: Query properties of fundamental arithmetic types + * for being used within oflimits.h. + */ + +// Note: This depends on some files of ofstd and osconfig.h, +// although it is part of configure testing itself. +// Therefore, ensure osconfig.h has already been generated +// before this program is used. +#define INCLUDE_CLIMITS +#define INCLUDE_CMATH +#define INCLUDE_CSETJMP +#define INCLUDE_CSIGNAL +#include "../math.cc" + +#ifdef HAVE_FENV_H +// For controlling floating point exceptions on Unix like systems. +#include +#endif + +#ifdef HAVE_IEEEFP_H +// For controlling floating point exceptions on Unix like systems +// that don't have feenableexcept and fedisableexcept. +#include +#endif + +#ifdef __APPLE__ +// For controlling floating point exceptions on OS X. +#include +#endif + +#ifdef HAVE_SETJMP_H +// For setjmp for the SunPro compiler +#include +#endif + +#ifdef HAVE_SIGNAL_H +// For signal for the SunPro compiler +#include +#endif + +// hackish definition of cout, as we can't depend on +// OFConsole. +#define COUT STD_NAMESPACE cout + +// define sigjmp_buf if it isn't already +#ifndef HAVE_SIGJMP_BUF +typedef jmp_buf sigjmp_buf; +#endif + +// longjmp env (jump destination), ugly global var we +// need to recover from traps. +sigjmp_buf jbuf; + +// signal handler that "jumps back in time" to before +// the error occurred and fixes what has gone wrong +// in 1985. +static void capture( int sig ) +{ +#ifndef _WIN32 + // Unix like systems support this natively + siglongjmp( jbuf, sig ); +#else + // On Windows, we need to employ a workaround that + // only works for floating point exceptions! + _fpreset(); + longjmp( jbuf, sig ); +#endif +} + +static void register_signals() +{ + signal(SIGABRT, &capture); + signal(SIGFPE, &capture); + signal(SIGILL, &capture); + signal(SIGINT, &capture); + signal(SIGSEGV, &capture); + signal(SIGTERM, &capture); +} + +// print to "arith.h" +static void print_define( STD_NAMESPACE ostream& out, + const char* fname, const char* name ) +{ + out << "#define DCMTK_"; + // convert type name to uppercase and replace ' ' by underscore. + for( const char* pch = name; *pch; ++pch ) + out.put( *pch <= 'z' && *pch >= 'a' ? *pch - 'a' + 'A' : *pch == ' ' ? '_' : *pch ); + out << '_' << fname; +} + +// handles output to configure log and to "arith.h" +static int print_flag( STD_NAMESPACE ostream& out, int flag, + const char* fname, const char* name, + int width ) +{ + COUT << STD_NAMESPACE setw(width) << STD_NAMESPACE internal << ( flag ? "yes" : "no" ); + print_define( out, fname, name ); + out << " OF" << ( flag ? "True" : "False" ) << '\n'; + return flag; +} + +static const char all_one[8] = { '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377' }; + +template +static int test_modulo() +{ + // test if signed, otherwise it is modulo anyway + if( *OFreinterpret_cast( const T*, all_one ) > 0 ) + return 1; + const T max = *OFreinterpret_cast( const T*, all_one ) & ~(T(1) << (sizeof(T) * 8 - 1)); + const T min = T( max + 1 ); + return min < max && min < 0 && max > 0; +} + +template +static int test_trap( const FN& fn ) +{ + register_signals(); +#ifndef _WIN32 + // On Unix like systems, we use the + // longjmp-module specifically designed for + // signals. + if( sigsetjmp( jbuf, 1 ) ) +#else + // On Windows, we use the normal longjmp + // that destroys everything and try to fix + // what is left. + if( setjmp( jbuf ) ) +#endif + { + // if a jump occurred, this means fn() + // caused a trap. + return 1; + } +#ifdef _MSC_VER + // On Visual Studio, we use their built-in + // SEH things, they consider to be C++. + __try +#else + // The rest of the world hopefully only + // has normal exceptions. + try +#endif + { + // Call the function. Did it trap? + fn(); + } +#ifdef _MSC_VER + // On Windows, we return 3 if any SEH exception + // occurred. Shall we consider this a trap, + // although it was really an exception? + // I don't know, for now it's yes. + __except(1){return 3;} +#else + // The rest of the world returns 2, which + // means "normal exception". + catch(...){return 2;} +#endif + // Nothing happened, so we return 0, for + // "nothing happened". Note: since MinGW's + // crazy SEH things are crazy, MinGW will always + // execute what is written in the brackets following + // __except1, and NEVER see this return statement. + return 0; +} + +template +static void divide_by_zero() +{ + // Note: we can't just do 1 / 0, since + // some compilers might optimize that + // away or emit compile-time errors. + volatile T t0 = 1; + volatile T t1 = 0; + t0 /= t1; +} + +// gathers and prints information for integer types +template +static void inspect( STD_NAMESPACE ostream& out, const char* name ) +{ + COUT << "-- " << STD_NAMESPACE left << STD_NAMESPACE setw(14) << name; + print_flag( out, test_trap( ÷_by_zero ), "TRAPS", name, 7 ); + print_flag( out, test_modulo(), "MODULO", name, 7 ); + COUT << OFendl; +} + +// print a constant's binary representation as a string, so it can be loaded +// instead of being calculated when needed +template +static void print_binary( STD_NAMESPACE ostream& out, const char* pname, const char* name, const T& t ) +{ + print_define( out, pname, name ); + out << " *OFreinterpret_cast( const " << name << "*, \""; + for( unsigned ui = 0; ui < sizeof(T); ++ui ) + out << '\\' << STD_NAMESPACE oct << STD_NAMESPACE setw(3) << STD_NAMESPACE right << STD_NAMESPACE setfill( '0' ) + << unsigned(((unsigned char*)&t)[ui]) << STD_NAMESPACE dec; + out << "\" )\n"; +} + +// try to create an infinite value and use whatever means +// to detect if it really is infinite +template +static int test_inf( STD_NAMESPACE ostream& out, const char* name ) +{ + const T t( HUGE_VAL ); + const int has_inf = print_flag + ( + out, + dcmtk_config_math::isinf(t), + "HAS_INFINITY", + name, + 7 + ); + print_binary( out, "INFINITY", name, t ); + return has_inf; +} + +template +static T guess_qnan() +{ +#ifdef NAN + // use NAN if available + return T( NAN ); +#else + // else do a barrel roll + T t( 0.0 ); + return t / t; +#endif +} + +template +static int test_qnan( STD_NAMESPACE ostream& out, const char* name ) +{ + const T t = guess_qnan(); + const int has_qnan = print_flag + ( + out, + dcmtk_config_math::isnan( t ), + "HAS_QUIET_NAN", + name, + 7 + ); + print_binary( out, "QUIET_NAN", name, t ); + return has_qnan; +} + +template +struct guess; + +template<> +struct guess +{ + // There is no way to create a signaling NaN employing only arithmetic + // operations. So we assume we have IEC-559 floating point types + // and convert the quiet NaNs we created to signaling NaNs by flipping + // the bits that would need to be flipped if it really were IEC-559 floats. + static const float& snan() + { + static float f = guess_qnan(); + ((unsigned char*)&f)[2] &= 0xbf; + ((unsigned char*)&f)[0] |= 0x01; + return f; + } + + static float denorm_min() + { + return float( ldexp( 1.0f, FLT_MIN_EXP - FLT_MANT_DIG ) ); + } + + static float denorm_max() + { + return FLT_MIN / 2; + } + + static float epsilon() + { + return FLT_EPSILON; + } +}; + +template<> +struct guess +{ + // There is no way to create a signaling NaN employing only arithmetic + // operations. So we assume we have IEC-559 floating point types + // and convert the quiet NaNs we created to signaling NaNs by flipping + // the bits that would need to be flipped if it really were IEC-559 floats. + static const double& snan() + { + static double d = guess_qnan(); + ((unsigned char*)&d)[6] &= 0xf7; + ((unsigned char*)&d)[0] |= 0x01; + return d; + } + + static double denorm_min() + { + return double( ldexp( 1.0, DBL_MIN_EXP - DBL_MANT_DIG ) ); + } + + static double denorm_max() + { + return DBL_MIN / 2; + } + + static double epsilon() + { + return DBL_EPSILON; + } +}; + +template +static void provoke_snan() +{ + // Enable floating point exceptions, Windows and Unix version. +#ifdef HAVE_WINDOWS_H + _clearfp(); + _controlfp( _controlfp(0,0) & ~_EM_INVALID, _MCW_EM ); +#elif defined(__APPLE__) + _MM_SET_EXCEPTION_MASK( _MM_GET_EXCEPTION_MASK() & ~_MM_MASK_INVALID ); +#elif defined(HAVE_FENV_H) && defined(HAVE_PROTOTYPE_FEENABLEEXCEPT) + feenableexcept( FE_INVALID ); +#elif defined(HAVE_IEEEFP_H) && !defined(__CYGWIN__) + // Cygwin unfortunately seems to have but no implementation of fgetmask/fpsetmask + fp_except cw = fpgetmask(); + +#ifdef FP_X_DX + // on some systems, the devide-by-zero flag is called FP_X_DX + fpsetmask(cw | FP_X_INV | FP_X_DX | FP_X_OFL); +#else + fpsetmask(cw | FP_X_INV | FP_X_DZ | FP_X_OFL); +#endif +#endif + // Visual Studio will emit an exception the moment + // we assign a signaling NaN to another float variable + // and convert it to a quiet NaN. + volatile T t = guess::snan(); + // Other compilers will trigger only if we use + // arithmetics. + ++t; +} + +template +static int test_snan( STD_NAMESPACE ostream& out, const char* name ) +{ + // Create signaling NaNs and test if they really are signaling NaNs + const T& t = guess::snan(); + int flag = dcmtk_config_math::isnan( t ) && test_trap( &provoke_snan ); + // Disable floating point exceptions that have been enabled for the test, + // Windows and Unix version. +#ifdef HAVE_WINDOWS_H + _clearfp(); + _controlfp( _controlfp(0,0) | _EM_INVALID, _MCW_EM ); +#elif defined(HAVE_FENV_H) + feclearexcept( FE_INVALID ); +#ifdef __APPLE__ + _MM_SET_EXCEPTION_MASK( _MM_GET_EXCEPTION_MASK() | _MM_MASK_INVALID ); +#elif defined(HAVE_FENV_H) && defined(HAVE_PROTOTYPE_FEENABLEEXCEPT) + fedisableexcept( FE_INVALID ); +#elif defined(HAVE_IEEEFP_H) && !defined(__CYGWIN__) + // Cygwin unfortunately seems to have but no implementation of fgetmask/fpsetmask + fp_except cw = fpgetmask(); + +#ifdef FP_X_DX + // on some systems, the devide-by-zero flag is called FP_X_DX + fpsetmask(cw & ~(FP_X_INV | FP_X_DX | FP_X_OFL)); +#else + fpsetmask(cw & ~(FP_X_INV | FP_X_DZ | FP_X_OFL)); +#endif + +#endif +#endif + // Print and return the result + print_flag + ( + out, + flag, + "HAS_SIGNALING_NAN", + name, + 7 + ); + print_binary( out, "SIGNALING_NAN", name, t ); + return flag; +} + +template +static void test_iec559( STD_NAMESPACE ostream& out, const char* name, int reqs ) +{ + // Assume we have IEC-559 floats if the appropriate macro was defined, + // or if infinity and both kinds of NaNs are supported and the characteristics + // of double are what we expect them to be. + print_flag + ( + out, +#if defined(__STDC_IEC_559__) || (DBL_DIG == 15 && DBL_MANT_DIG == 53 && DBL_MAX_10_EXP == 308 && DBL_MAX_EXP == 1024 && DBL_MIN_10_EXP == -307 && DBL_MIN_EXP == -1021) + reqs, +#else + 0, +#endif + "IS_IEC559", + name, + 7 + ); +} + +static int is_subnormal( float f ) +{ +// Wine does not implement _fpclassf, so don't use it when cross compiling for Windows +// (Wine would emit an exception at runtime, so it's hard to test for _fpclassf availability) +#if defined(HAVE_PROTOTYPE__FPCLASSF) && !( defined(DCMTK_CROSS_COMPILING) && defined(_WIN32) ) + return ( _fpclassf( f ) & ( _FPCLASS_ND | _FPCLASS_PD ) ) != 0; +#else + return f != 0.0f && ( f < 0.0f ? -f < FLT_MIN : f < FLT_MIN ); +#endif +} + +static int is_subnormal( double d ) +{ +#ifdef _WIN32 + return ( _fpclass( d ) & ( _FPCLASS_ND | _FPCLASS_PD ) ) != 0; +#else + return d != 0.0 && ( d < 0.0 ? -d < DBL_MIN : d < DBL_MIN ); +#endif +} + +template +static void test_subnormal( STD_NAMESPACE ostream& out, const char* name ) +{ +#ifdef HAVE_WINDOWS_H + _clearfp(); + _controlfp( _EM_DENORMAL | _EM_UNDERFLOW | _EM_INEXACT, _MCW_EM ); +#endif + const T denorm = guess::denorm_min(); + const int flag = is_subnormal( denorm ); + COUT << STD_NAMESPACE setw(7) << STD_NAMESPACE internal << ( flag ? "yes" : "no" ); + print_define( out, "HAS_DENORM", name ); + out << " OFdenorm_" << ( flag ? "pre" : "ab" ) << "sent\n"; + print_binary( out, "DENORM_MIN", name, denorm ); +} + +template +static void test_tinyness_before( STD_NAMESPACE ostream& out, const char* name ) +{ + volatile const T denorm_max = guess::denorm_max(); + volatile const T mult = T( 1.0 ) + guess::epsilon(); + +#ifdef HAVE_WINDOWS_H + _clearfp(); +#elif defined(HAVE_FENV_H) + feclearexcept( FE_ALL_EXCEPT ); +#endif + + volatile T result = denorm_max * mult; + (void)result; + + print_flag + ( + out, +#ifdef HAVE_WINDOWS_H + _statusfp() & _EM_UNDERFLOW, +#elif defined(HAVE_FENV_H) + fetestexcept( FE_UNDERFLOW ), +#else + 0, +#endif + "TINYNESS_BEFORE", + name, + 7 + ); +} + +template +static void test_denorm_loss( STD_NAMESPACE ostream& out, const char* name ) +{ + volatile T t = guess::denorm_min() * 3; + +#ifdef HAVE_WINDOWS_H + _clearfp(); +#elif defined(HAVE_FENV_H) + feclearexcept( FE_ALL_EXCEPT ); +#endif + + t /= 2; + + print_flag + ( + out, +#ifdef HAVE_WINDOWS_H + _statusfp() & _EM_UNDERFLOW, +#elif defined(HAVE_FENV_H) + fetestexcept( FE_UNDERFLOW ), +#else + 0, +#endif + "HAS_DENORM_LOSS", + name, + 7 + ); +} + +#ifdef HAVE_WINDOWS_H +// MinGW's crazy SEH stuff doesn't work on all MinGW "distributions" +// This is an even more ugly fallback implementation that seems to +// work for now +LONG WINAPI consume_seh_problems( struct _EXCEPTION_POINTERS* ) +{ + _fpreset(); + _clearfp(); + longjmp( jbuf, 0 ); + return EXCEPTION_CONTINUE_SEARCH; +} +#endif + +int main( int argc, char** argv ) +{ +#ifdef HAVE_WINDOWS_H + // Activate the fallback workaround, it will only be used + // if the SEH exceptions can't be caught "the right way" + SetErrorMode( SEM_FAILCRITICALERRORS ); + SetUnhandledExceptionFilter( consume_seh_problems ); +#endif + + COUT << "Inspecting fundamental arithmetic types... " << OFendl; + if( argc != 2 ) + { + STD_NAMESPACE cerr << "-- " << "Error: missing destination file " + << "to store collected information." << OFendl; + return 1; + } + + STD_NAMESPACE ofstream out( argv[1] ); + + out << "#ifndef CONFIG_ARITH_H" << '\n'; + out << "#define CONFIG_ARITH_H" << '\n'; + out << '\n'; + + // workaround to let digits10 be a compile time constant + out << "#define DCMTK_SIGNED_CHAR_DIGITS10 " << OFstatic_cast( int, ( CHAR_BIT - 1 ) * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_UNSIGNED_CHAR_DIGITS10 " << OFstatic_cast( int, CHAR_BIT * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_SIGNED_SHORT_DIGITS10 " << OFstatic_cast( int, ( CHAR_BIT * sizeof( signed short ) - 1 ) * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_UNSIGNED_SHORT_DIGITS10 " << OFstatic_cast( int, CHAR_BIT * sizeof( unsigned short ) * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_SIGNED_INT_DIGITS10 " << OFstatic_cast( int, ( CHAR_BIT * sizeof( signed int ) - 1 ) * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_UNSIGNED_INT_DIGITS10 " << OFstatic_cast( int, CHAR_BIT * sizeof( unsigned int ) * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_SIGNED_LONG_DIGITS10 " << OFstatic_cast( int, ( CHAR_BIT * sizeof( signed long ) - 1 ) * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_UNSIGNED_LONG_DIGITS10 " << OFstatic_cast( int, CHAR_BIT * sizeof( unsigned long ) * .30102999566398119521373889472449 ) << OFendl; + out << "#define DCMTK_FLOAT_MAX_DIGITS10 " << OFstatic_cast( int, FLT_MANT_DIG * .30102999566398119521373889472449 + 2 ) << OFendl; + out << "#define DCMTK_DOUBLE_MAX_DIGITS10 " << OFstatic_cast( int, DBL_MANT_DIG * .30102999566398119521373889472449 + 2 ) << OFendl; + + COUT << "--" << OFendl; + + COUT << "-- " << STD_NAMESPACE setfill( ' ' ) << STD_NAMESPACE setw(17) << ' ' + << STD_NAMESPACE setw(7) << STD_NAMESPACE internal << "TRAPS" + << STD_NAMESPACE setw(7) << STD_NAMESPACE internal << "MODULO" << OFendl; + + inspect( out, "char" ); + inspect( out, "signed char" ); + inspect( out, "unsigned char" ); + inspect( out, "signed short" ); + inspect( out, "unsigned short" ); + inspect( out, "signed int" ); + inspect( out, "unsigned int" ); + inspect( out, "signed long" ); + inspect( out, "unsigned long" ); + + COUT << "--" << OFendl; + + COUT << "-- " << STD_NAMESPACE setfill( ' ' ) << STD_NAMESPACE setw(18) << ' ' + << STD_NAMESPACE setw(7) << STD_NAMESPACE internal << "float" + << STD_NAMESPACE setw(7) << STD_NAMESPACE internal << "double" << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- TRAPS"; + print_flag( out, test_trap( ÷_by_zero ), "TRAPS", "float", 7 ); + print_flag( out, test_trap( ÷_by_zero ), "TRAPS", "double", 7 ); + COUT << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- HAS INFINITY"; + const int finf = test_inf( out, "float" ); + const int dinf = test_inf( out, "double" ); + COUT << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- QUIET NAN"; + const int fqnan = test_qnan( out, "float" ); + const int dqnan = test_qnan( out, "double" ); + COUT << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- SIGNALING NAN"; + const int fsnan = test_snan( out, "float" ); + const int dsnan = test_snan( out, "double" ); + COUT << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- IEC-559"; + test_iec559( out, "float", finf && fqnan && fsnan ); + test_iec559( out, "double", dinf && dqnan && dsnan ); + COUT << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- HAS DENORM"; + test_subnormal( out, "float" ); + test_subnormal( out, "double" ); + COUT << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- TINYNESS BEFORE"; + test_tinyness_before( out, "float" ); + test_tinyness_before( out, "double" ); + COUT << OFendl; + + COUT << STD_NAMESPACE setw(20) << STD_NAMESPACE left << "-- DENORM LOSS"; + test_denorm_loss( out, "float" ); + test_denorm_loss( out, "double" ); + COUT << OFendl; + + COUT << "--"; + + out << "#define DCMTK_ROUND_STYLE " << FLT_ROUNDS << '\n'; + out << '\n'; + out << "#endif // CONFIG_ARITH_H" << '\n'; + + return 0; +} diff --git a/config/tests/cxx11.cc b/config/tests/cxx11.cc new file mode 100644 index 00000000..05c5e8b3 --- /dev/null +++ b/config/tests/cxx11.cc @@ -0,0 +1,296 @@ +/* + * Copyright (C) 2017-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Presents constructs that every C++11 compliant + * compiler should be able to compile. + * + * + * This file is based on ax_cxx_compile_stdcxx from the GNU Autoconf project. + * The original license is as follows: + * + * LICENSE + * + * Copyright (c) 2008 Benjamin Kosnik + * Copyright (c) 2012 Zack Weinberg + * Copyright (c) 2013 Roy Stogner + * Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov + * Copyright (c) 2015 Paul Norman + * Copyright (c) 2015 Moritz Klammler + * Copyright (c) 2016 Krzesimir Nowak + * + * Copying and distribution of this file, with or without modification, are + * permitted in any medium without royalty provided the copyright notice + * and this notice are preserved. This file is offered as-is, without any + * warranty. + */ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +int main() +{ + return 0; +} + +namespace cxx11 +{ + namespace test_static_assert + { + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + } + + namespace test_final_override + { + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + } + + namespace test_double_right_angle_brackets + { + template + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + } + + namespace test_decltype + { + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + } + + namespace test_type_deduction + { + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + } + + namespace test_noexcept + { + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + } + + namespace test_constexpr + { + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + } + + namespace test_rvalue_references + { + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + } + + namespace test_uniform_initialization + { + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + } + + namespace test_lambdas + { + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + } + + namespace test_variadic_templates + { + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + } +} // namespace cxx11 + +#endif // __cplusplus >= 201103L diff --git a/config/tests/cxx14.cc b/config/tests/cxx14.cc new file mode 100644 index 00000000..801803b0 --- /dev/null +++ b/config/tests/cxx14.cc @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Jan Schlamelcher + * + * Purpose: Presents constructs that every C++14 compliant + * compiler should be able to compile. + * + * + * This file is based on ax_cxx_compile_stdcxx from the GNU Autoconf project. + * The original license is as follows: + * + * LICENSE + * + * Copyright (c) 2008 Benjamin Kosnik + * Copyright (c) 2012 Zack Weinberg + * Copyright (c) 2013 Roy Stogner + * Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov + * Copyright (c) 2015 Paul Norman + * Copyright (c) 2015 Moritz Klammler + * Copyright (c) 2016 Krzesimir Nowak + * + * Copying and distribution of this file, with or without modification, are + * permitted in any medium without royalty provided the copyright notice + * and this notice are preserved. This file is offered as-is, without any + * warranty. + */ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +int main() +{ + return 0; +} + +namespace cxx14 +{ + namespace test_polymorphic_lambdas + { + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + } + + namespace test_binary_literals + { + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + } + + namespace test_generalized_constexpr + { + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + } + + namespace test_lambda_init_capture + { + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + } + + namespace test_digit_separators + { + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + } + + namespace test_return_type_deduction + { + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + } +} // namespace cxx14 + +#endif // __cplusplus >= 201402L diff --git a/config/tests/cxx17.cc b/config/tests/cxx17.cc new file mode 100644 index 00000000..93d2e82d --- /dev/null +++ b/config/tests/cxx17.cc @@ -0,0 +1,383 @@ +/* + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Jan Schlamelcher + * + * Purpose: Presents constructs that every C++17 compliant + * compiler should be able to compile. + * + * + * This file is based on ax_cxx_compile_stdcxx from the GNU Autoconf project. + * The original license is as follows: + * + * LICENSE + * + * Copyright (c) 2008 Benjamin Kosnik + * Copyright (c) 2012 Zack Weinberg + * Copyright (c) 2013 Roy Stogner + * Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov + * Copyright (c) 2015 Paul Norman + * Copyright (c) 2015 Moritz Klammler + * Copyright (c) 2016 Krzesimir Nowak + * + * Copying and distribution of this file, with or without modification, are + * permitted in any medium without royalty provided the copyright notice + * and this notice are preserved. This file is offered as-is, without any + * warranty. + */ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L + +#error "This is not a C++17 compiler" + +#else + +int main() +{ + return 0; +} + +#include +#include +#include + +namespace cxx17 +{ + namespace test_constexpr_lambdas + { + constexpr int foo = [](){return 42;}(); + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + } + + namespace test_extended_static_assert + { + static_assert (true); + } + + namespace test_auto_brace_init_list + { + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + template typename X> struct D; + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + } + + namespace test_extended_aggregate_initialization + { + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + } + + namespace test_general_range_based_for_loop + { + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + } + + namespace test_lambda_capture_asterisk_this_by_value + { + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + } + + namespace test_enum_class_construction + { + enum class byte : unsigned char + {}; + + byte foo {42}; + } + + namespace test_constexpr_if + { + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + } + + namespace test_selection_statement_with_initializer + { + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + } + + namespace test_template_argument_deduction_for_class_templates + { + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + } + + namespace test_non_type_auto_template_parameters + { + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + } + + namespace test_structured_bindings + { + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + } + + namespace test_exception_spec_type_system + { + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + } + + namespace test_inline_variables + { + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + } +} // namespace cxx17 + +#endif // __cplusplus <= 201703L diff --git a/config/tests/iconv.cc b/config/tests/iconv.cc new file mode 100644 index 00000000..80754a66 --- /dev/null +++ b/config/tests/iconv.cc @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Jan Schlamelcher + * + * Purpose: Analyze behavior of an iconv implementation. + */ + +#include +#include + +int main() +{ + char input[2] = { '\366', '\0' }; + char output[8]; + iconv_t i = iconv_open( "ASCII", "ISO-8859-1" ); + if( (iconv_t)-1 != i ) + { + iconv( i, 0, 0, 0, 0 ); +#ifdef LIBICONV_SECOND_ARGUMENT_CONST + const +#endif + char* in = input; + char* out = output; + size_t ins = 1; + size_t outs = 8; + const size_t result = iconv( i, &in, &ins, &out, &outs ); + iconv_close( i ); + if( ~(size_t)0 == result ) + { + printf( "AbortTranscodingOnIllegalSequence" ); + return 0; + } + if( 8 == outs ) // output buffer not touched + { + printf( "DiscardIllegalSequences" ); + return 0; + } + } + return 1; +} diff --git a/config/tests/lciconv.cc b/config/tests/lciconv.cc new file mode 100644 index 00000000..31ad6fe2 --- /dev/null +++ b/config/tests/lciconv.cc @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Jan Schlamelcher + * + * Purpose: Test whether an STDLIBC iconv defines a default encoding. + */ + +#include + +int main() +{ + if ((iconv_t)-1 == iconv_open( "ASCII", "" )) + return 1; + if ((iconv_t)-1 == iconv_open( "", "ASCII" )) + return 1; + return 0; +} diff --git a/config/tests/lfs.c b/config/tests/lfs.c new file mode 100644 index 00000000..b7441c0e --- /dev/null +++ b/config/tests/lfs.c @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Jan Schlamelcher + * + * Purpose: Testing for large file support (LFS) + */ + +#include +/* Check that off_t can represent 2**63 - 1 correctly. */ +/* We can't simply define LARGE_OFF_T to be 9223372036854775807, */ +/* since some C++ compilers masquerading as C compilers */ +/* incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +int main() +{ + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; + return 0; +} diff --git a/config/tests/lfs64.cc b/config/tests/lfs64.cc new file mode 100644 index 00000000..f6cd3299 --- /dev/null +++ b/config/tests/lfs64.cc @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Jan Schlamelcher + * + * Purpose: Testing for explicit large file support (LFS64) + */ + +#define _LARGEFILE64_SOURCE +#include + +using namespace std; + +int main() +{ + FILE *f = fopen64("name", "r"); + return 0; +} diff --git a/config/tests/limits.cc b/config/tests/limits.cc new file mode 100644 index 00000000..b3aa762f --- /dev/null +++ b/config/tests/limits.cc @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include +#include + +int main() +{ + if (!std::numeric_limits::is_signed) { + return -1; + } + + if (std::numeric_limits::is_iec559) { + if (!std::numeric_limits::has_infinity) { + return -1; + } + } + + if (std::numeric_limits::max() != INT_MAX) { + return -1; + } + + if (std::numeric_limits::digits != CHAR_BIT * sizeof(int) - 1) { + return -1; + } + + return 0; +} diff --git a/config/tests/list.cc b/config/tests/list.cc new file mode 100644 index 00000000..110d5935 --- /dev/null +++ b/config/tests/list.cc @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +int main() +{ + std::list l; + + if (!l.empty()) { + return -1; + } + + l.push_back(18); + l.push_back(22); + l.push_front(2); + + if (*l.begin() != 2) { + return -1; + } + + l.reverse(); + + if (*l.begin() != 22) { + return -1; + } + + int sum = 0; + for (std::list::iterator it = l.begin(); it != l.end(); ++it) { + sum += *it; + } + + if (sum != 42) { + return -1; + } + + // ensure iterators are NOT invalidated by swap() + std::list::iterator it = l.begin(); + std::list m; + m.push_back(23); + l.swap(m); + if (it != m.begin()) { + return -1; + } + + // test whether we can compare const and mutable iterators + std::list::const_iterator cit = m.begin(); + if (it != cit) { + return -1; + } + + return 0; +} diff --git a/config/tests/map.cc b/config/tests/map.cc new file mode 100644 index 00000000..408df652 --- /dev/null +++ b/config/tests/map.cc @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +int main() +{ + std::map m; + + if (!m.empty()) { + return -1; + } + + m[3] = 555; + m[66] = 2; + m[42] = 42; + + if (m.size() != 3) { + return -1; + } + + if (m[3] != 555) { + return -1; + } + + if (m[42] != 42) { + return -1; + } + + m.erase(m.find(3)); + + if (m.find(3) != m.end()) { + return -1; + } + + m.clear(); + + if (!m.empty()) { + return -1; + } + + return 0; +} diff --git a/config/tests/memory.cc b/config/tests/memory.cc new file mode 100644 index 00000000..d7656fef --- /dev/null +++ b/config/tests/memory.cc @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +int main() +{ + int *p = new int(55); + + std::unique_ptr pp(p); + + if (*p != *pp) { + return -1; + } + + if (p != pp.get()) { + return -1; + } + + pp.release(); + + std::shared_ptr s_p(p); + std::shared_ptr s_p2(s_p); + std::shared_ptr s_p3(s_p2); + + if (s_p.get() != s_p3.get()) { + return -1; + } + + if (s_p.use_count() != 3) { + return -1; + } + + if (*s_p != *s_p3) { + return -1; + } + + return 0; +} diff --git a/config/tests/stack.cc b/config/tests/stack.cc new file mode 100644 index 00000000..bbb8e752 --- /dev/null +++ b/config/tests/stack.cc @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +int main() +{ + std::stack s; + + if (!s.empty()) { + return -1; + } + + s.push(1); + s.push(2); + s.push(3); + + s.pop(); + s.pop(); + + s.push(42); + + if (s.top() != 42) { + return -1; + } + + return 0; +} diff --git a/config/tests/string.cc b/config/tests/string.cc new file mode 100644 index 00000000..4dd40fe2 --- /dev/null +++ b/config/tests/string.cc @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +int main() +{ + std::string s = "TEST"; + + if (s[1] != 'E') { + return -1; + } + + s += "HAHA"; + + if (s[5] != 'A') { + return -1; + } + + std::string sub = s.substr(4); + + if ("HAHA" != sub) { + return -1; + } + + s.replace(0, 4, "HAHA"); + + if (s != "HAHAHAHA") { + return -1; + } + + return 0; +} diff --git a/config/tests/syserr.cc b/config/tests/syserr.cc new file mode 100644 index 00000000..1a5e848f --- /dev/null +++ b/config/tests/syserr.cc @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +#include + +#ifdef _WIN32 +#include +#endif + +int main() +{ + // Not much to test, really. + + if (strcmp(std::generic_category().name(), "generic") != 0) { + return -1; + } + + if (strcmp(std::system_category().name(), "system") != 0) { + return -1; + } + +#ifdef _WIN32 + // Visual Studio might be using strerror for both categories. + + // Test with the highest numbered WINAPI error code; highly unlikely that there exists an equal-numbered errno. + std::system_error system_err(ERROR_API_UNAVAILABLE, std::system_category()); + std::system_error generic_err(ERROR_API_UNAVAILABLE, std::generic_category()); + + // The system error message should be retrieved using FormatMessage(), + // while the generic error message should be retrieved with strerror and be something like "unknown error", + // since it isn't a valid errno. + // The point is, these two should result in different messages. + + if (strcmp(system_err.what(), generic_err.what()) == 0) { + // Visual Studio messed up, what a surprise... + return -1; + } +#endif + return 0; +} diff --git a/config/tests/ttraits.cc b/config/tests/ttraits.cc new file mode 100644 index 00000000..3be4e0fb --- /dev/null +++ b/config/tests/ttraits.cc @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +class A{}; + +class B{ virtual ~B(); }; + +int main() +{ + if (!std::is_void::value) { + return -1; + } + + if (!std::is_pointer::value) { + return -1; + } + + if (!std::is_class::value) { + return -1; + } + + if (!std::is_volatile::value) { + return -1; + } + + if (!std::is_empty::value) { + return -1; + } + + if (!std::has_virtual_destructor::value) { + return -1; + } + + if (std::is_empty::value) { + return -1; + } + + if (std::is_const>::value) { + return -1; + } + + if (!std::is_same::value, int>::type, int>::value) { + return -1; + } + + return 0; +} diff --git a/config/tests/tuple.cc b/config/tests/tuple.cc new file mode 100644 index 00000000..b7516e00 --- /dev/null +++ b/config/tests/tuple.cc @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +int main() +{ + auto tuple = std::make_tuple(1, "TEST"); + + if (std::get<0>(tuple) != 1) { + return -1; + } + + if (std::tuple_size::value != 2) { + return -1; + } + + int n; + const char *p; + std::tie(n, p) = tuple; + + if (n != 1) { + return -1; + } + + // ensure std::tuple can take at least 50 template arguments, otherwise + // our own implementation is superior + std::tuple t; + + return 0; +} diff --git a/config/tests/vector.cc b/config/tests/vector.cc new file mode 100644 index 00000000..3d676a98 --- /dev/null +++ b/config/tests/vector.cc @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: config + * + * Author: Thorben Hasenpusch + * + * Purpose: Rudimentary tests for a working implementation. + */ + +#include + +struct Recursive : std::vector +{ + int i; +}; + +int main() +{ + std::vector v; + + v.push_back(1); + v.push_back(2); + v.push_back(3); + + if (v.size() != 3) { + return -1; + } + + if (v[2] != 3) { + return -1; + } + + v.erase(v.begin()); + + if (v[0] != 2) { + return -1; + } + + v.pop_back(); + + if (v.size() != 1) { + return -1; + } + + v.clear(); + + v.push_back(42); + v.push_back(13); + + v.resize(1); + + if (v.size() != 1 || v[0] != 42) { + return -1; + } + + if (v.front() != v[0]) { + return -1; + } + + if (v.back() != v[v.size() - 1]) { + return -1; + } + + // ensure iterators are NOT invalidated by swap() + std::vector::iterator it = v.begin(); + std::vector w; + w.push_back(23); + v.swap(w); + if (it != w.begin()) { + return -1; + } + + // test if recursive vector structures can be constructed without causing + // a stack overflow + if (std::vector().size() != 0) { + return -1; + } + + // test whether we can compare const and mutable iterators + std::vector::const_iterator cit = w.begin(); + if (it != cit) { + return -1; + } + + return 0; +} diff --git a/dcmdata/CMakeLists.txt b/dcmdata/CMakeLists.txt new file mode 100644 index 00000000..a526bebe --- /dev/null +++ b/dcmdata/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmdata) + +# declare include directories which hold for all subdirectories +include_directories("${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc libi2d apps include docs data tests) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmdata/Makefile.in b/dcmdata/Makefile.in new file mode 100644 index 00000000..350f3f9e --- /dev/null +++ b/dcmdata/Makefile.in @@ -0,0 +1,102 @@ +# +# Makefile for dcmdata +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + (cd libi2d && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install-lib) + (cd libi2d && $(MAKE) ARCH="$(ARCH)" install-lib) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd libi2d && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd libi2d && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd libi2d && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmdata/apps/CMakeLists.txt b/dcmdata/apps/CMakeLists.txt new file mode 100644 index 00000000..4d896d4e --- /dev/null +++ b/dcmdata/apps/CMakeLists.txt @@ -0,0 +1,17 @@ +# declare additional include directories +include_directories(${LIBXML_INCDIR}) + +# declare executables +foreach(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmftest dcmgpdir dump2dcm xml2dcm stl2dcm pdf2dcm dcm2pdf img2dcm dcm2json cda2dcm) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() +DCMTK_ADD_EXECUTABLE(dcmodify dcmodify mdfconen mdfdsman) + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmgpdir dcmodify dump2dcm xml2dcm stl2dcm pdf2dcm dcm2pdf img2dcm dcm2json cda2dcm) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmdata oflog ofstd) +endforeach() + +DCMTK_TARGET_LINK_MODULES(dcmftest ofstd) +DCMTK_TARGET_LINK_LIBRARIES(xml2dcm ${LIBXML_LIBS}) +DCMTK_TARGET_LINK_MODULES(img2dcm i2d dcmdata) diff --git a/dcmdata/apps/Makefile.dep b/dcmdata/apps/Makefile.dep new file mode 100644 index 00000000..5ea5d2d3 --- /dev/null +++ b/dcmdata/apps/Makefile.dep @@ -0,0 +1,1488 @@ +cda2dcm.o: cda2dcm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcencdoc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +dcm2json.o: dcm2json.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcjson.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +dcm2pdf.o: dcm2pdf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcistrmz.h +dcm2xml.o: dcm2xml.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +dcmconv.o: dcmconv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcostrmz.h ../include/dcmtk/dcmdata/dcistrmz.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +dcmcrle.o: dcmcrle.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcrleerg.h +dcmdrle.o: dcmdrle.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcrledrg.h +dcmdump.o: dcmdump.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcistrmz.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +dcmftest.o: dcmftest.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h +dcmgpdir.o: dcmgpdir.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcddirif.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +dcmodify.o: dcmodify.cc ../../config/include/dcmtk/config/osconfig.h \ + mdfconen.h ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcpath.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h +dump2dcm.o: dump2dcm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dctk.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcdicent.h \ + ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdict.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcobject.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcmetinf.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcostrmz.h +img2dcm.o: img2dcm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/libi2d/i2d.h \ + ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h \ + ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \ + ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcvrpobw.h \ + ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/libi2d/i2djpgs.h \ + ../include/dcmtk/dcmdata/libi2d/i2dbmps.h \ + ../include/dcmtk/dcmdata/libi2d/i2dplsc.h \ + ../include/dcmtk/dcmdata/libi2d/i2dplvlp.h \ + ../include/dcmtk/dcmdata/libi2d/i2dplnsc.h +mdfconen.o: mdfconen.cc ../../config/include/dcmtk/config/osconfig.h \ + mdfconen.h ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h mdfdsman.h \ + ../include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dctk.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcistrmz.h +mdfdsman.o: mdfdsman.cc ../../config/include/dcmtk/config/osconfig.h \ + mdfdsman.h ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcdicent.h \ + ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdict.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcobject.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcmetinf.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcpath.h \ + ../include/dcmtk/dcmdata/dcistrmf.h +pdf2dcm.o: pdf2dcm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcencdoc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +stl2dcm.o: stl2dcm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcencdoc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +xml2dcm.o: xml2dcm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcostrmz.h diff --git a/dcmdata/apps/Makefile.in b/dcmdata/apps/Makefile.in new file mode 100644 index 00000000..2a4b50b4 --- /dev/null +++ b/dcmdata/apps/Makefile.in @@ -0,0 +1,102 @@ +# +# Makefile for dcmdata/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include +LIBDIRS = -L$(top_srcdir)/libi2d -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc \ + -L$(oflogdir)/libsrc +LOCALLIBS = -ldcmdata -loflog -lofstd $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) +LIBI2D = -li2d + +objs = dcmftest.o dcmconv.o dcmdump.o dump2dcm.o dcmgpdir.o dcm2xml.o \ + xml2dcm.o dcmcrle.o dcmdrle.o dcmodify.o mdfdsman.o mdfconen.o \ + cda2dcm.o stl2dcm.o pdf2dcm.o dcm2pdf.o img2dcm.o dcm2json.o + +progs = dcmftest dcmconv dcmdump dump2dcm dcmgpdir dcm2xml xml2dcm dcmcrle \ + dcmdrle dcmodify pdf2dcm stl2dcm cda2dcm dcm2pdf img2dcm dcm2json + + +all: $(progs) + +# Note: dcmftest does not need LOCALLIBS on most platforms, but on OSF1 it is required. +dcmftest: dcmftest.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmconv: dcmconv.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmdump: dcmdump.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dump2dcm: dump2dcm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmgpdir: dcmgpdir.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmcrle: dcmcrle.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmdrle: dcmdrle.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcm2xml: dcm2xml.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +xml2dcm: xml2dcm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(XMLLIBS) $(LOCALLIBS) $(LIBS) + +dcmodify: dcmodify.o mdfconen.o mdfdsman.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o mdfconen.o mdfdsman.o $(LOCALLIBS) $(LIBS) + +stl2dcm: stl2dcm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +pdf2dcm: pdf2dcm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +cda2dcm: cda2dcm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcm2pdf: dcm2pdf.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +img2dcm: img2dcm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LIBI2D) $(LOCALLIBS) $(LIBS) + +dcm2json: dcm2json.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +install: install-bin + +install-bin: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmdata/apps/cda2dcm.cc b/dcmdata/apps/cda2dcm.cc new file mode 100755 index 00000000..e44ba7ad --- /dev/null +++ b/dcmdata/apps/cda2dcm.cc @@ -0,0 +1,143 @@ +/* + * + * Copyright (C) 2018-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Pedro Arizpe + * + * Purpose: Encapsulate CDA file into a DICOM file + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first*/ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcencdoc.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "cda2dcm" + +static OFLogger cda2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" +OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encapsulate CDA file into DICOM format", rcsid); + OFCommandLine cmd; + int errorCode = EXITCODE_NO_ERROR; + OFCondition result = EC_Normal; + DcmFileFormat fileformat; + DcmEncapsulatedDocument encapsulator; + OFLOG_TRACE(cda2dcmLogger, "Including necessary options"); + encapsulator.addCDACommandlineOptions(cmd); + OFLOG_TRACE(cda2dcmLogger, "Evaluating command line"); + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + + if (app.parseCommandLine(cmd, argc, argv)) { + OFLOG_TRACE (cda2dcmLogger, "Checking exclusive options first"); + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used: "; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return EXITCODE_NO_ERROR; + } + } + encapsulator.parseArguments(app, cmd); + } + //print resource identifier + OFLOG_DEBUG(cda2dcmLogger, rcsid << OFendl); + + OFLOG_DEBUG(cda2dcmLogger, "making sure data dictionary is loaded"); + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(cda2dcmLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + OFLOG_TRACE(cda2dcmLogger, "Creating identifiers (and reading series data)"); + result = encapsulator.createIdentifiers(cda2dcmLogger); + if (result.bad()) + { + OFLOG_FATAL(cda2dcmLogger, "There was an error while reading the series data"); + return EXITCODE_INVALID_INPUT_FILE; + } + OFLOG_DEBUG(cda2dcmLogger, "Fetching CDA Data"); + errorCode = encapsulator.getCDAData(encapsulator.getInputFileName().c_str(), cda2dcmLogger); + if (errorCode != EXITCODE_NO_ERROR) + { + OFLOG_ERROR(cda2dcmLogger, "There was a problem with the CDA File"); + return errorCode; + } + else + { + OFLOG_INFO(cda2dcmLogger, "creating encapsulated CDA object"); + errorCode = encapsulator.insertEncapsulatedDocument(fileformat.getDataset(), cda2dcmLogger); + } + if (errorCode != EXITCODE_NO_ERROR) + { + OFLOG_ERROR(cda2dcmLogger, "unable to create CDA encapsulation to DICOM format"); + return errorCode; + } + OFLOG_INFO(cda2dcmLogger, "Generating an instance number that is guaranteed to be unique within a series."); + result = encapsulator.createHeader(fileformat.getDataset(), cda2dcmLogger); + if (result.bad()) + { + OFLOG_ERROR(cda2dcmLogger, "unable to create DICOM header: " << result.text()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + OFLOG_INFO(cda2dcmLogger, "writing encapsulated CDA object as file " << encapsulator.getOutputFileName()); + + OFLOG_INFO(cda2dcmLogger, "Check if new output transfer syntax is possible"); + + DcmXfer opt_oxferSyn(encapsulator.getTransferSyntax()); + + fileformat.getDataset()->chooseRepresentation(encapsulator.getTransferSyntax(), NULL); + if (fileformat.getDataset()->canWriteXfer(encapsulator.getTransferSyntax())) + { + OFLOG_INFO(cda2dcmLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written"); + } + else { + OFLOG_ERROR(cda2dcmLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + OFLOG_INFO(cda2dcmLogger, "Checking for DICOM key overriding"); + result = encapsulator.applyOverrideKeys(fileformat.getDataset()); + if (result.bad()) + { + OFLOG_ERROR(cda2dcmLogger, "There was a problem while overriding a key:" << OFendl + << result.text()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + OFLOG_INFO(cda2dcmLogger, "write converted DICOM file with metaheader"); + result = encapsulator.saveFile(fileformat); + if (result.bad()) + { + OFLOG_ERROR(cda2dcmLogger, result.text() << ": writing file: " << encapsulator.getOutputFileName()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + + OFLOG_INFO(cda2dcmLogger, "CDA encapsulation successful"); + + return EXITCODE_NO_ERROR; +} diff --git a/dcmdata/apps/dcm2json.cc b/dcmdata/apps/dcm2json.cc new file mode 100644 index 00000000..14d4321d --- /dev/null +++ b/dcmdata/apps/dcm2json.cc @@ -0,0 +1,277 @@ +/* +* +* Copyright (C) 2016-2017, OFFIS e.V. +* All rights reserved. See COPYRIGHT file for details. +* +* This software and supporting documentation were developed by +* +* OFFIS e.V. +* R&D Division Health +* Escherweg 2 +* D-26121 Oldenburg, Germany +* +* +* Module: dcmdata +* +* Author: Sebastian Grallert +* +* Purpose: Convert the contents of a DICOM file to JSON format +* +*/ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" + +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcm2json" +#define OFFIS_CONSOLE_DESCRIPTION "Convert DICOM file and data set to JSON" + +static OFLogger dcm2jsonLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" +OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + +/* Function to call all writeJson() functions in DCMTK */ +static OFCondition writeFile(STD_NAMESPACE ostream &out, + const char *ifname, + DcmFileFormat *dfile, + const E_FileReadMode readMode, + const OFBool format, + const OFBool printMetaInfo) +{ + OFCondition result = EC_IllegalParameter; + if ((ifname != NULL) && (dfile != NULL)) + { + DcmDataset *dset = dfile->getDataset(); + + /* write JSON document content */ + + if (readMode == ERM_dataset) + { + result = format + ? + dset->writeJson(out, DcmJsonFormatPretty(printMetaInfo)) + : + dset->writeJson(out, DcmJsonFormatCompact(printMetaInfo)) + ; + } + else + { + result = format + ? + dfile->writeJson(out, DcmJsonFormatPretty(printMetaInfo)) + : + dfile->writeJson(out, DcmJsonFormatCompact(printMetaInfo)) + ; + } + } + return result; +} + +#define SHORTCOL 3 +#define LONGCOL 20 + +int main(int argc, char *argv[]) +{ + OFBool opt_format = OFTrue; + OFBool opt_addMetaInformation = OFFalse; + + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + OFString optStr; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, OFFIS_CONSOLE_DESCRIPTION, rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted", OFCmdParam::PM_Mandatory); + cmd.addParam("jsonfile-out", "JSON output filename (default: stdout)", OFCmdParam::PM_Optional); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output format:"); + cmd.addOption("--formatted-code", "+fc", "enable whitespace formatting (default)"); + cmd.addOption("--compact-code", "-fc", "print only required characters"); + cmd.addOption("--write-meta", "+m", "write data set with meta information\n(warning: not conforming to the DICOM standard)"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + /* format options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--formatted-code")) + opt_format = OFTrue; + if (cmd.findOption("--compact-code")) + opt_format = OFFalse; + cmd.endOptionBlock(); + + /* meta option */ + if (cmd.findOption("--write-meta")) + { + app.checkConflict("--write-meta", "--read-dataset", opt_readMode == ERM_dataset); + opt_addMetaInformation = OFTrue; + } + } + + /* print resource identifier */ + OFLOG_DEBUG(dcm2jsonLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcm2jsonLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + int result = 0; + /* first parameter is treated as the input filename */ + const char *ifname = NULL; + cmd.getParam(1, ifname); + /* check input file */ + if ((ifname != NULL) && (strlen(ifname) > 0)) + { + /* read DICOM file or data set */ + DcmFileFormat dfile; + OFCondition status = dfile.loadFile(ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (status.good()) + { + DcmDataset *dset = dfile.getDataset(); + OFString csetString; + if (dset->findAndGetOFStringArray(DCM_SpecificCharacterSet, csetString).good()) + { + if (csetString.compare("ISO_IR 192") != 0 && csetString.compare("ISO_IR 6") != 0) + { +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + /* convert all DICOM strings to UTF-8 */ + OFLOG_INFO(dcm2jsonLogger, "converting all element values that are affected by SpecificCharacterSet (0008,0005) to UTF-8"); + status = dset->convertToUTF8(); + if (status.bad()) + { + OFLOG_FATAL(dcm2jsonLogger, status.text() << ": converting file to UTF-8: " << ifname); + result = 4; + } +#else + OFLOG_FATAL(dcm2jsonLogger, "character set conversion not available"); + return 4; +#endif + } + } + if (result == 0) + { + /* if second parameter is present, it is treated as the output filename ("stdout" otherwise) */ + if (cmd.getParamCount() == 2) + { + const char *ofname = NULL; + cmd.getParam(2, ofname); + STD_NAMESPACE ofstream stream(ofname); + if (stream.good()) + { + /* write content in JSON format to file */ + if (writeFile(stream, ifname, &dfile, opt_readMode, opt_format, opt_addMetaInformation).bad()) + result = 2; + } + else + result = 1; + } + else + { + /* write content in JSON format to standard output */ + if (writeFile(COUT, ifname, &dfile, opt_readMode, opt_format, opt_addMetaInformation).bad()) + result = 3; + } + } + } + else + OFLOG_ERROR(dcm2jsonLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << status.text() << ") reading file: " << ifname); + } + else + OFLOG_ERROR(dcm2jsonLogger, OFFIS_CONSOLE_APPLICATION << ": invalid filename: "); + + return result; +} diff --git a/dcmdata/apps/dcm2pdf.cc b/dcmdata/apps/dcm2pdf.cc new file mode 100644 index 00000000..67453aa5 --- /dev/null +++ b/dcmdata/apps/dcm2pdf.cc @@ -0,0 +1,354 @@ +/* + * + * Copyright (C) 2007-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: Exctract PDF file from DICOM encapsulated PDF storage object + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* for O_RDONLY */ +#endif +#ifdef HAVE_SYS_TYPES_H +#include /* required for sys/stat.h */ +#endif +#ifdef HAVE_SYS_STAT_H +#include /* for stat, fstat */ +#endif +END_EXTERN_C + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcistrmz.h" /* for dcmZlibExpectRFC1950Encoding */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcm2pdf" + +static OFLogger dcm2pdfLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define FILENAME_PLACEHOLDER "#f" + +static OFString replaceChars(const OFString &srcstr, const OFString &pattern, const OFString &substitute) + /* + * This function replaces all occurrences of pattern in srcstr with substitute and returns + * the result as a new OFString variable. Note that srcstr itself will not be changed. + * + * Parameters: + * srcstr - [in] The source string. + * pattern - [in] The pattern string which shall be substituted. + * substitute - [in] The substitute for pattern in srcstr. + */ +{ + OFString result = srcstr; + size_t pos = 0; + + while (pos != OFString_npos) + { + pos = result.find(pattern, pos); + + if (pos != OFString_npos) + { + result.replace(pos, pattern.size(), substitute); + pos += substitute.size(); + } + } + + return result; +} + + +#define SHORTCOL 3 +#define LONGCOL 20 + +int main(int argc, char *argv[]) +{ + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + const char *opt_execString = NULL; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Extract PDF file from DICOM encapsulated PDF", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename"); + cmd.addParam("pdffile-out", "PDF output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:", LONGCOL, SHORTCOL); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + cmd.addSubGroup("parsing of odd-length attributes:"); + cmd.addOption("--accept-odd-length", "+ao", "accept odd length attributes (default)"); + cmd.addOption("--assume-even-length", "+ae", "assume real length is one byte larger"); + cmd.addSubGroup("handling of undefined length UN elements:"); + cmd.addOption("--enable-cp246", "+ui", "read undefined len UN as implicit VR (default)"); + cmd.addOption("--disable-cp246", "-ui", "read undefined len UN as explicit VR"); + cmd.addSubGroup("handling of defined length UN elements:"); + cmd.addOption("--retain-un", "-uc", "retain elements as UN (default)"); + cmd.addOption("--convert-un", "+uc", "convert to real VR if known"); + cmd.addSubGroup("automatic data correction:"); + cmd.addOption("--enable-correction", "+dc", "enable automatic data correction (default)"); + cmd.addOption("--disable-correction", "-dc", "disable automatic data correction"); +#ifdef WITH_ZLIB + cmd.addSubGroup("bitstream format of deflated input:"); + cmd.addOption("--bitstream-deflated", "+bd", "expect deflated bitstream (default)"); + cmd.addOption("--bitstream-zlib", "+bz", "expect deflated zlib bitstream"); +#endif + + cmd.addGroup("execution options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--exec", "-x", 1, "[c]ommand: string", + "execute command c after PDF extraction"); + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* command line parameters and options */ + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--accept-odd-length")) + { + dcmAcceptOddAttributeLength.set(OFTrue); + } + if (cmd.findOption("--assume-even-length")) + { + dcmAcceptOddAttributeLength.set(OFFalse); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-cp246")) + { + dcmEnableCP246Support.set(OFTrue); + } + if (cmd.findOption("--disable-cp246")) + { + dcmEnableCP246Support.set(OFFalse); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--retain-un")) + { + dcmEnableUnknownVRConversion.set(OFFalse); + } + if (cmd.findOption("--convert-un")) + { + dcmEnableUnknownVRConversion.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-correction")) + { + dcmEnableAutomaticInputDataCorrection.set(OFTrue); + } + if (cmd.findOption("--disable-correction")) + { + dcmEnableAutomaticInputDataCorrection.set(OFFalse); + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + cmd.beginOptionBlock(); + if (cmd.findOption("--bitstream-deflated")) + { + dcmZlibExpectRFC1950Encoding.set(OFFalse); + } + if (cmd.findOption("--bitstream-zlib")) + { + dcmZlibExpectRFC1950Encoding.set(OFTrue); + } + cmd.endOptionBlock(); +#endif + + if (cmd.findOption("--exec")) app.checkValue(cmd.getValue(opt_execString)); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcm2pdfLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcm2pdfLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open inputfile + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcm2pdfLogger, "invalid filename: "); + return 1; + } + + DcmFileFormat fileformat; + DcmDataset * dataset = fileformat.getDataset(); + + OFLOG_INFO(dcm2pdfLogger, "open input file " << opt_ifname); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + + if (error.bad()) + { + OFLOG_FATAL(dcm2pdfLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + OFString sopClass; + error = dataset->findAndGetOFString(DCM_SOPClassUID, sopClass); + if (error.bad() || sopClass != UID_EncapsulatedPDFStorage) + { + OFLOG_FATAL(dcm2pdfLogger, "not an Encapsulated PDF Storage object: " << opt_ifname); + return 1; + } + + DcmElement *delem = NULL; + error = dataset->findAndGetElement(DCM_EncapsulatedDocument, delem); + if (error.bad() || delem == NULL) + { + OFLOG_FATAL(dcm2pdfLogger, "attribute (0042,0011) Encapsulated Document missing."); + return 1; + } + + Uint32 len = delem->getLength(); + Uint8 *pdfDocument = NULL; + error = delem->getUint8Array(pdfDocument); + if (error.bad() || pdfDocument == NULL || len == 0) + { + OFLOG_FATAL(dcm2pdfLogger, "attribute (0042,0011) Encapsulated Document empty or wrong VR."); + return 1; + } + + /* strip pad byte at end of file, if there is one. The PDF format expects + * files to end with %%EOF followed by CR/LF (although in some cases the + * CR/LF may be missing or you might only find CR or LF). + * If the last character of the file is not a CR or LF, and not the + * letter 'F', we assume it is either trailing garbage or a pad byte, and remove it. + */ + if (pdfDocument[len-1] != 10 && pdfDocument[len-1] != 13 && pdfDocument[len-1] != 'F') + { + --len; + } + + FILE *pdffile = fopen(opt_ofname, "wb"); + if (pdffile == NULL) + { + OFLOG_FATAL(dcm2pdfLogger, "unable to create file " << opt_ofname); + return 1; + } + + if (len != fwrite(pdfDocument, 1, len, pdffile)) + { + OFLOG_FATAL(dcm2pdfLogger, "write error in file " << opt_ofname); + fclose(pdffile); + return 1; + } + + fclose(pdffile); + + OFLOG_INFO(dcm2pdfLogger, "conversion successful"); + + if (opt_execString) + { + OFString cmdStr = opt_execString; + cmdStr = replaceChars(cmdStr, OFString(FILENAME_PLACEHOLDER), opt_ofname); + + // Execute command and return result + return system(cmdStr.c_str()); + } + + return 0; +} diff --git a/dcmdata/apps/dcm2xml.cc b/dcmdata/apps/dcm2xml.cc new file mode 100644 index 00000000..825abc60 --- /dev/null +++ b/dcmdata/apps/dcm2xml.cc @@ -0,0 +1,576 @@ +/* + * + * Copyright (C) 2002-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Convert the contents of a DICOM file to XML format + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcm2xml" +#define OFFIS_CONSOLE_DESCRIPTION "Convert DICOM file and data set to XML" + +#define DOCUMENT_TYPE_DEFINITION_FILE "dcm2xml.dtd" + +static OFLogger dcm2xmlLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + +static OFCondition writeFile(STD_NAMESPACE ostream &out, + const char *ifname, + DcmFileFormat *dfile, + const E_FileReadMode readMode, + const OFBool loadIntoMemory, + const char *dtdFilename, + const char *defaultCharset, + /*const*/ size_t writeFlags, + const OFBool checkAllStrings) +{ + OFCondition result = EC_IllegalParameter; + if ((ifname != NULL) && (dfile != NULL)) + { + DcmDataset *dset = dfile->getDataset(); + if (loadIntoMemory) + dset->loadAllDataIntoMemory(); + /* determine dataset character encoding */ + OFString encString; + OFString csetString; + if (dset->findAndGetOFStringArray(DCM_SpecificCharacterSet, csetString).good()) + { + if (csetString == "ISO_IR 6") // should never be present in a dataset, but ... + encString = "UTF-8"; + else if (csetString == "ISO_IR 192") + encString = "UTF-8"; + else if (csetString == "ISO_IR 100") + encString = "ISO-8859-1"; + else if (csetString == "ISO_IR 101") + encString = "ISO-8859-2"; + else if (csetString == "ISO_IR 109") + encString = "ISO-8859-3"; + else if (csetString == "ISO_IR 110") + encString = "ISO-8859-4"; + else if (csetString == "ISO_IR 148") + encString = "ISO-8859-9"; + else if (csetString == "ISO_IR 144") + encString = "ISO-8859-5"; + else if (csetString == "ISO_IR 127") + encString = "ISO-8859-6"; + else if (csetString == "ISO_IR 126") + encString = "ISO-8859-7"; + else if (csetString == "ISO_IR 138") + encString = "ISO-8859-8"; + else { + if (!csetString.empty()) + { + OFLOG_WARN(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": SpecificCharacterSet (0008,0005) " + << "value '" << csetString << "' not supported ... quoting non-ASCII characters"); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + OFLOG_DEBUG(dcm2xmlLogger, "using option --convert-to-utf8 to convert the DICOM file to " + "UTF-8 encoding might also help to solve this problem more appropriately"); +#endif + } + /* make sure that non-ASCII characters are quoted appropriately */ + writeFlags |= DCMTypes::XF_convertNonASCII; + } + } else { + /* SpecificCharacterSet is not present in the dataset */ + if (dset->containsExtendedCharacters(checkAllStrings)) + { + if (defaultCharset == NULL) + { + /* the dataset contains non-ASCII characters that really should not be there */ + OFLOG_ERROR(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": SpecificCharacterSet (0008,0005) " + << "element absent (on the main data set level) but extended characters used in file: " << ifname); + OFLOG_DEBUG(dcm2xmlLogger, "use option --charset-assume to manually specify an appropriate character set"); + return makeOFCondition(OFM_dcmdata, EC_CODE_CannotSelectCharacterSet, OF_error, "Missing Specific Character Set");; + } else { + OFString sopClass; + csetString = defaultCharset; + /* use the default character set specified by the user */ + if (csetString == "ISO_IR 192") + encString = "UTF-8"; + else if (csetString == "ISO_IR 100") + encString = "ISO-8859-1"; + else if (csetString == "ISO_IR 101") + encString = "ISO-8859-2"; + else if (csetString == "ISO_IR 109") + encString = "ISO-8859-3"; + else if (csetString == "ISO_IR 110") + encString = "ISO-8859-4"; + else if (csetString == "ISO_IR 148") + encString = "ISO-8859-9"; + else if (csetString == "ISO_IR 144") + encString = "ISO-8859-5"; + else if (csetString == "ISO_IR 127") + encString = "ISO-8859-6"; + else if (csetString == "ISO_IR 126") + encString = "ISO-8859-7"; + else if (csetString == "ISO_IR 138") + encString = "ISO-8859-8"; + else { + OFLOG_FATAL(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": Character set '" + << defaultCharset << "' specified with option --charset-assume not supported"); + return makeOFCondition(OFM_dcmdata, EC_CODE_CannotSelectCharacterSet, OF_error, "Cannot select character set"); + } + /* check whether this file is a DICOMDIR */ + if (dfile->getMetaInfo()->findAndGetOFString(DCM_MediaStorageSOPClassUID, sopClass).bad() || + (sopClass != UID_MediaStorageDirectoryStorage)) + { + OFLOG_INFO(dcm2xmlLogger, "inserting SpecificCharacterSet (0008,0005) element with value '" + << defaultCharset << "'"); + /* insert the SpecificCharacterSet (0008,0005) element */ + dset->putAndInsertString(DCM_SpecificCharacterSet, defaultCharset); + } + } + } else { + if (defaultCharset != NULL) + { + /* use "debug" instead of "warn" in order to avoid too much output in default mode */ + OFLOG_DEBUG(dcm2xmlLogger, "ignoring character set '" << defaultCharset + << "' specified with option --charset-assume since it is not needed for this data set"); + } + /* by default, we use UTF-8 encoding */ + encString = "UTF-8"; + } + } + + /* write XML document header */ + out << "" << OFendl; + /* add document type definition (DTD) */ + if (writeFlags & DCMTypes::XF_addDocumentType) + { + out << "" << OFendl; + } + /* write XML document content */ + if (readMode == ERM_dataset) + result = dset->writeXML(out, writeFlags); + else + result = dfile->writeXML(out, writeFlags); + } + return result; +} + + +#define SHORTCOL 4 +#define LONGCOL 20 + + +int main(int argc, char *argv[]) +{ + size_t opt_writeFlags = 0; + OFBool opt_loadIntoMemory = OFFalse; + OFBool opt_checkAllStrings = OFFalse; +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + OFBool opt_convertToUTF8 = OFFalse; +#endif + const char *opt_defaultCharset = NULL; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + OFCmdUnsignedInt opt_maxReadLength = 4096; // default is 4 KB + const char *opt_dtdFilename = DEFAULT_SUPPORT_DATA_DIR DOCUMENT_TYPE_DEFINITION_FILE; + OFString optStr; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, OFFIS_CONSOLE_DESCRIPTION, rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted", OFCmdParam::PM_Mandatory); + cmd.addParam("xmlfile-out", "XML output filename (default: stdout)", OFCmdParam::PM_Optional); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + cmd.addSubGroup("long tag values:"); + cmd.addOption("--load-all", "+M", "load very long tag values (e.g. pixel data)"); + cmd.addOption("--load-short", "-M", "do not load very long values (default)"); + cmd.addOption("--max-read-length", "+R", 1, "[k]bytes: integer (4..4194302, default: 4)", + "set threshold for long values to k kbytes"); + cmd.addGroup("processing options:"); + cmd.addSubGroup("specific character set:"); + cmd.addOption("--charset-require", "+Cr", "require declaration of extended charset (def.)"); + cmd.addOption("--charset-assume", "+Ca", 1, "[c]harset: string", + "assume charset c if no extended charset declared"); + cmd.addOption("--charset-check-all", "+Cc", "check all data elements with string values\n(default: only PN, LO, LT, SH, ST, UC and UT)"); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.addOption("--convert-to-utf8", "+U8", "convert all element values that are affected\nby Specific Character Set (0008,0005) to UTF-8"); +#endif + cmd.addGroup("output options:"); + cmd.addSubGroup("general XML format:"); + cmd.addOption("--dcmtk-format", "-dtk", "output in DCMTK-specific format (default)"); + cmd.addOption("--native-format", "-nat", "output in Native DICOM Model format (part 19)"); + cmd.addOption("--use-xml-namespace", "+Xn", "add XML namespace declaration to root element"); + cmd.addSubGroup("DCMTK-specific format (not with --native-format):"); + cmd.addOption("--add-dtd-reference", "+Xd", "add reference to document type definition (DTD)"); + cmd.addOption("--embed-dtd-content", "+Xe", "embed document type definition into XML document"); + optStr = "use specified DTD file (only with +Xe)\n(default: "; + optStr += opt_dtdFilename; + optStr += ")"; + cmd.addOption("--use-dtd-file", "+Xf", 1, "[f]ilename: string", + optStr.c_str()); + cmd.addOption("--write-element-name", "+Wn", "write name of the DICOM data elements (default)"); + cmd.addOption("--no-element-name", "-Wn", "do not write name of the DICOM data elements"); + cmd.addOption("--write-binary-data", "+Wb", "write binary data of OB and OW elements\n(default: off, be careful with --load-all)"); + cmd.addSubGroup("encoding of binary data:"); + cmd.addOption("--encode-hex", "+Eh", "encode binary data as hex numbers\n(default for DCMTK-specific format)"); + cmd.addOption("--encode-uuid", "+Eu", "encode binary data as a UUID reference\n(default for Native DICOM Model)"); + cmd.addOption("--encode-base64", "+Eb", "encode binary data as Base64 (RFC 2045, MIME)"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--max-read-length")) + { + app.checkValue(cmd.getValueAndCheckMinMax(opt_maxReadLength, 4, 4194302)); + opt_maxReadLength *= 1024; // convert kbytes to bytes + } + cmd.beginOptionBlock(); + if (cmd.findOption("--load-all")) + opt_loadIntoMemory = OFTrue; + if (cmd.findOption("--load-short")) + opt_loadIntoMemory = OFFalse; + cmd.endOptionBlock(); + + /* processing options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--charset-require")) + opt_defaultCharset = NULL; + if (cmd.findOption("--charset-assume")) + app.checkValue(cmd.getValue(opt_defaultCharset)); + cmd.endOptionBlock(); + if (cmd.findOption("--charset-check-all")) + opt_checkAllStrings = OFTrue; +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (cmd.findOption("--convert-to-utf8")) + opt_convertToUTF8 = OFTrue; +#endif + + /* output options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--native-format")) + opt_writeFlags |= DCMTypes::XF_useNativeModel; + if (cmd.findOption("--dcmtk-format")) + opt_writeFlags &= ~DCMTypes::XF_useNativeModel; + cmd.endOptionBlock(); + + if (cmd.findOption("--use-xml-namespace")) + opt_writeFlags |= DCMTypes::XF_useXMLNamespace; + + cmd.beginOptionBlock(); + if (cmd.findOption("--add-dtd-reference")) + { + app.checkConflict("--add-dtd-reference", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + opt_writeFlags |= DCMTypes::XF_addDocumentType; + } + if (cmd.findOption("--embed-dtd-content")) + { + app.checkConflict("--embed-dtd-content", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + opt_writeFlags |= DCMTypes::XF_addDocumentType | DCMTypes::XF_embedDocumentType; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--use-dtd-file")) + { + app.checkConflict("--use-dtd-file", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + app.checkDependence("--use-dtd-file", "--embed-dtd-content", (opt_writeFlags & DCMTypes::XF_embedDocumentType) > 0); + app.checkValue(cmd.getValue(opt_dtdFilename)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-element-name")) + { + app.checkConflict("--write-element-name", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + opt_writeFlags &= ~DCMTypes::XF_omitDataElementName; + } + if (cmd.findOption("--no-element-name")) + { + app.checkConflict("--no-element-name", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + opt_writeFlags |= DCMTypes::XF_omitDataElementName; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--write-binary-data")) + { + app.checkConflict("--write-binary-data", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + opt_writeFlags |= DCMTypes::XF_writeBinaryData; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--encode-hex")) + { + app.checkConflict("--encode-hex", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + app.checkDependence("--encode-hex", "--write-binary-data", (opt_writeFlags & DCMTypes::XF_writeBinaryData) > 0); + opt_writeFlags &= ~DCMTypes::XF_encodeBase64; + } + if (cmd.findOption("--encode-uuid")) + { + app.checkDependence("--encode-uuid", "--native-format", (opt_writeFlags & DCMTypes::XF_useNativeModel) > 0); + opt_writeFlags &= ~DCMTypes::XF_encodeBase64; + } + if (cmd.findOption("--encode-base64")) + { + if (!(opt_writeFlags & DCMTypes::XF_useNativeModel)) + app.checkDependence("--encode-base64", "--write-binary-data", (opt_writeFlags & DCMTypes::XF_writeBinaryData) > 0); + opt_writeFlags |= DCMTypes::XF_encodeBase64; + } + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcm2xmlLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcm2xmlLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* make sure document type definition file exists */ + if ((opt_writeFlags & DCMTypes::XF_embedDocumentType) && !OFStandard::fileExists(opt_dtdFilename)) + { + OFLOG_WARN(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": DTD file \"" << opt_dtdFilename + << "\" does not exist ... adding reference instead"); + opt_writeFlags &= ~DCMTypes::XF_embedDocumentType; + } + + int result = 0; + /* first parameter is treated as the input filename */ + const char *ifname = NULL; + cmd.getParam(1, ifname); + /* check input file */ + if ((ifname != NULL) && (strlen(ifname) > 0)) + { + /* read DICOM file or data set */ + DcmFileFormat dfile; + OFCondition status = dfile.loadFile(ifname, opt_ixfer, EGL_noChange, OFstatic_cast(Uint32, opt_maxReadLength), opt_readMode); + if (status.good()) + { + // map "old" charset names to DICOM defined terms + if (opt_defaultCharset != NULL) + { + OFString charset(opt_defaultCharset); + if (charset == "latin-1") + opt_defaultCharset = "ISO_IR 100"; + else if (charset == "latin-2") + opt_defaultCharset = "ISO_IR 101"; + else if (charset == "latin-3") + opt_defaultCharset = "ISO_IR 109"; + else if (charset == "latin-4") + opt_defaultCharset = "ISO_IR 110"; + else if (charset == "latin-5") + opt_defaultCharset = "ISO_IR 148"; + else if (charset == "cyrillic") + opt_defaultCharset = "ISO_IR 144"; + else if (charset == "arabic") + opt_defaultCharset = "ISO_IR 127"; + else if (charset == "greek") + opt_defaultCharset = "ISO_IR 126"; + else if (charset == "hebrew") + opt_defaultCharset = "ISO_IR 138"; + } +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + DcmDataset *dset = dfile.getDataset(); + /* convert all DICOM strings to UTF-8 (if requested) */ + if (opt_convertToUTF8) + { + OFLOG_INFO(dcm2xmlLogger, "converting all element values that are affected by SpecificCharacterSet (0008,0005) to UTF-8"); + // check whether SpecificCharacterSet is absent but needed + if ((opt_defaultCharset != NULL) && !dset->tagExistsWithValue(DCM_SpecificCharacterSet) && + dset->containsExtendedCharacters(OFFalse /*checkAllStrings*/)) + { + // use the manually specified source character set + status = dset->convertCharacterSet(opt_defaultCharset, OFString("ISO_IR 192")); + } else { + // expect that SpecificCharacterSet contains the correct value + status = dset->convertToUTF8(); + } + if (status.bad()) + { + OFLOG_FATAL(dcm2xmlLogger, status.text() << ": converting file to UTF-8: " << ifname); + result = 4; + } + } else { + OFString sopClass; + /* check whether the file is a DICOMDIR ... */ + if (dfile.getMetaInfo()->findAndGetOFString(DCM_MediaStorageSOPClassUID, sopClass).good() && + (sopClass == UID_MediaStorageDirectoryStorage)) + { + /* ... with one or more SpecificCharacterSet elements */ + if (dset->tagExistsWithValue(DCM_SpecificCharacterSet, OFTrue /*searchIntoSub*/)) + { + OFLOG_WARN(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": this is a DICOMDIR file, which can contain more than one " + << "SpecificCharacterSet (0008,0005) element ... using option --convert-to-utf8 is strongly recommended"); + } + } + } +#endif + if (result == 0) + { + /* if second parameter is present, it is treated as the output filename ("stdout" otherwise) */ + if (cmd.getParamCount() == 2) + { + const char *ofname = NULL; + cmd.getParam(2, ofname); + STD_NAMESPACE ofstream stream(ofname); + if (stream.good()) + { + /* write content in XML format to file */ + status = writeFile(stream, ifname, &dfile, opt_readMode, opt_loadIntoMemory, opt_dtdFilename, + opt_defaultCharset, opt_writeFlags, opt_checkAllStrings); + if (status.bad()) + { + OFLOG_ERROR(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << status.text() << ") writing file: "<< ofname); + result = 2; + } + } else + result = 1; + } else { + /* write content in XML format to standard output */ + status = writeFile(COUT, ifname, &dfile, opt_readMode, opt_loadIntoMemory, opt_dtdFilename, + opt_defaultCharset, opt_writeFlags, opt_checkAllStrings); + if (status.bad()) + { + OFLOG_ERROR(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << status.text() << ") writing to standard output"); + result = 3; + } + } + } + } else { + OFLOG_ERROR(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << status.text() << ") reading file: "<< ifname); + result = 5; + } + } else { + OFLOG_ERROR(dcm2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": invalid filename: "); + result = 6; + } + + return result; +} diff --git a/dcmdata/apps/dcmconv.cc b/dcmdata/apps/dcmconv.cc new file mode 100644 index 00000000..8acab661 --- /dev/null +++ b/dcmdata/apps/dcmconv.cc @@ -0,0 +1,641 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Convert dicom file encoding + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/dcmdata/dcistrmz.h" /* for dcmZlibExpectRFC1950Encoding */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmconv" + +static OFLogger dcmconvLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +#define SHORTCOL 3 +#define LONGCOL 21 + +static DcmTagKey parseTagKey(const char *tagName) +{ + unsigned int group = 0xffff; + unsigned int elem = 0xffff; + if (sscanf(tagName, "%x,%x", &group, &elem) != 2) + { + DcmTagKey tagKey; + /* it is a name */ + const DcmDataDictionary &globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(tagName); + if (dicent == NULL) + { + OFLOG_ERROR(dcmconvLogger, "unrecognized tag name: '" << tagName << "'"); + tagKey = DCM_UndefinedTagKey; + } else { + tagKey = dicent->getKey(); + } + dcmDataDict.rdunlock(); + return tagKey; + } else /* tag name has format "gggg,eeee" */ + { + return DcmTagKey(OFstatic_cast(Uint16, group),OFstatic_cast(Uint16, elem)); + } +} + +int main(int argc, char *argv[]) +{ + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + E_FileReadMode opt_readMode = ERM_autoDetect; + E_FileWriteMode opt_writeMode = EWM_fileformat; + E_TransferSyntax opt_ixfer = EXS_Unknown; + E_TransferSyntax opt_oxfer = EXS_Unknown; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; +#ifdef WITH_ZLIB + OFCmdUnsignedInt opt_compressionLevel = 0; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + const char *opt_convertToCharset = NULL; + size_t opt_conversionFlags = 0; +#endif + OFBool opt_noInvalidGroups = OFFalse; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Convert DICOM file encoding", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:", LONGCOL, SHORTCOL); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + cmd.addSubGroup("parsing of file meta information:"); + cmd.addOption("--use-meta-length", "+ml", "use file meta information group length (default)"); + cmd.addOption("--ignore-meta-length", "-ml", "ignore file meta information group length"); + cmd.addSubGroup("parsing of odd-length attributes:"); + cmd.addOption("--accept-odd-length", "+ao", "accept odd length attributes (default)"); + cmd.addOption("--assume-even-length", "+ae", "assume real length is one byte larger"); + cmd.addSubGroup("handling of explicit VR:"); + cmd.addOption("--use-explicit-vr", "+ev", "use explicit VR from dataset (default)"); + cmd.addOption("--ignore-explicit-vr", "-ev", "ignore explicit VR (prefer data dictionary)"); + cmd.addSubGroup("handling of non-standard VR:"); + cmd.addOption("--treat-as-unknown", "+vr", "treat non-standard VR as unknown (default)"); + cmd.addOption("--assume-implicit", "-vr", "try to read with implicit VR little endian TS"); + cmd.addSubGroup("handling of undefined length UN elements:"); + cmd.addOption("--enable-cp246", "+ui", "read undefined len UN as implicit VR (default)"); + cmd.addOption("--disable-cp246", "-ui", "read undefined len UN as explicit VR"); + cmd.addSubGroup("handling of defined length UN elements:"); + cmd.addOption("--retain-un", "-uc", "retain elements as UN (default)"); + cmd.addOption("--convert-un", "+uc", "convert to real VR if known"); + cmd.addSubGroup("handling of private max-length elements (implicit VR):"); + cmd.addOption("--maxlength-dict", "-sq", "read as defined in dictionary (default)"); + cmd.addOption("--maxlength-seq", "+sq", "read as sequence with undefined length"); + cmd.addSubGroup("handling of wrong delimitation items:"); + cmd.addOption("--use-delim-items", "-rd", "use delimitation items from dataset (default)"); + cmd.addOption("--replace-wrong-delim", "+rd", "replace wrong sequence/item delimitation items"); + cmd.addSubGroup("handling of illegal undefined length OB/OW elements:"); + cmd.addOption("--illegal-obow-rej", "-oi", "reject dataset with illegal element (default)"); + cmd.addOption("--illegal-obow-conv", "+oi", "convert undefined length OB/OW element to SQ"); + cmd.addSubGroup("handling of VOI LUT Sequence with OW VR and explicit length:"); + cmd.addOption("--illegal-voi-rej", "-vi", "reject dataset with illegal VOI LUT (default)"); + cmd.addOption("--illegal-voi-conv", "+vi", "convert illegal VOI LUT to SQ"); + cmd.addSubGroup("handling of explicit length pixel data for encaps. transfer syntaxes:"); + cmd.addOption("--abort-expl-pixdata", "-pe", "abort on explicit length pixel data (default)"); + cmd.addOption("--use-expl-pixdata", "+pe", "use explicit length pixel data"); + cmd.addSubGroup("general handling of parser errors: "); + cmd.addOption("--ignore-parse-errors", "+Ep", "try to recover from parse errors"); + cmd.addOption("--handle-parse-errors", "-Ep", "handle parse errors and stop parsing (default)"); + cmd.addSubGroup("other parsing options:"); + cmd.addOption("--stop-after-elem", "+st", 1, "[t]ag: \"gggg,eeee\" or dictionary name", + "stop parsing after element specified by t"); + cmd.addSubGroup("automatic data correction:"); + cmd.addOption("--enable-correction", "+dc", "enable automatic data correction (default)"); + cmd.addOption("--disable-correction", "-dc", "disable automatic data correction"); +#ifdef WITH_ZLIB + cmd.addSubGroup("bitstream format of deflated input:"); + cmd.addOption("--bitstream-deflated", "+bd", "expect deflated bitstream (default)"); + cmd.addOption("--bitstream-zlib", "+bz", "expect deflated zlib bitstream"); +#endif + + cmd.addGroup("processing options:"); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.addSubGroup("specific character set:"); + cmd.addOption("--convert-to-utf8", "+U8", "convert all element values that are affected\nby Specific Character Set (0008,0005) to UTF-8"); + cmd.addOption("--convert-to-latin1", "+L1", "convert affected element values to ISO 8859-1"); + cmd.addOption("--convert-to-ascii", "+A7", "convert affected element values to 7-bit ASCII"); + cmd.addOption("--convert-to-charset", "+C", 1, "[c]harset: string", + "convert affected element values to the character\nset specified by the DICOM defined term c"); + cmd.addOption("--transliterate", "-Ct", "try to approximate characters that cannot be\nrepresented through similar looking characters"); + cmd.addOption("--discard-illegal", "-Cd", "discard characters that cannot be represented\nin destination character set"); +#endif + cmd.addSubGroup("other processing options:"); + cmd.addOption("--no-invalid-groups", "-ig", "remove elements with invalid group number"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-new-meta-info", "+Fm", "write file format with new meta information"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); +#ifdef WITH_ZLIB + cmd.addOption("--write-xfer-deflated", "+td", "write with deflated explicit VR little endian TS"); +#endif + cmd.addOption("--write-xfer-ge", "+tg", "write private GE LEI with big endian pixel TS\n(non-standard)"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addOption("--write-oversized", "+eo", "write oversized explicit length sequences\nand items with undefined length (default)"); + cmd.addOption("--abort-oversized", "-eo", "abort on oversized explicit sequences/items"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with --write-xfer-deflated):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--use-meta-length")) + { + dcmIgnoreFileMetaInformationGroupLength.set(OFFalse); + } + if (cmd.findOption("--ignore-meta-length")) + { + dcmIgnoreFileMetaInformationGroupLength.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--accept-odd-length")) + { + dcmAcceptOddAttributeLength.set(OFTrue); + } + if (cmd.findOption("--assume-even-length")) + { + dcmAcceptOddAttributeLength.set(OFFalse); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--use-explicit-vr")) + { + dcmPreferVRFromDataDictionary.set(OFFalse); + } + if (cmd.findOption("--ignore-explicit-vr")) + { + dcmPreferVRFromDataDictionary.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--treat-as-unknown")) + { + dcmAcceptUnexpectedImplicitEncoding.set(OFFalse); + } + if (cmd.findOption("--assume-implicit")) + { + dcmAcceptUnexpectedImplicitEncoding.set(OFTrue); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-cp246")) + { + dcmEnableCP246Support.set(OFTrue); + } + if (cmd.findOption("--disable-cp246")) + { + dcmEnableCP246Support.set(OFFalse); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--retain-un")) + { + dcmEnableUnknownVRConversion.set(OFFalse); + } + if (cmd.findOption("--convert-un")) + { + dcmEnableUnknownVRConversion.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--maxlength-dict")) + { + dcmReadImplPrivAttribMaxLengthAsSQ.set(OFFalse); + } + if (cmd.findOption("--maxlength-seq")) + { + dcmReadImplPrivAttribMaxLengthAsSQ.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--use-delim-items")) + { + dcmReplaceWrongDelimitationItem.set(OFFalse); + } + if (cmd.findOption("--replace-wrong-delim")) + { + dcmReplaceWrongDelimitationItem.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--illegal-obow-rej")) + { + dcmConvertUndefinedLengthOBOWtoSQ.set(OFFalse); + } + if (cmd.findOption("--illegal-obow-conv")) + { + dcmConvertUndefinedLengthOBOWtoSQ.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--illegal-voi-rej")) + { + dcmConvertVOILUTSequenceOWtoSQ.set(OFFalse); + } + if (cmd.findOption("--illegal-voi-conv")) + { + dcmConvertVOILUTSequenceOWtoSQ.set(OFTrue); + } + cmd.endOptionBlock(); + cmd.beginOptionBlock(); + if (cmd.findOption("--abort-expl-pixdata")) + { + dcmUseExplLengthPixDataForEncTS.set(OFFalse); + } + if (cmd.findOption("--use-expl-pixdata")) + { + dcmUseExplLengthPixDataForEncTS.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--ignore-parse-errors")) + { + dcmIgnoreParsingErrors.set(OFTrue); + } + if (cmd.findOption("--handle-parse-errors")) + { + dcmIgnoreParsingErrors.set(OFFalse); + } + cmd.endOptionBlock(); + + if (cmd.findOption("--stop-after-elem")) + { + const char *tagName = NULL; + app.checkValue(cmd.getValue(tagName)); + DcmTagKey key = parseTagKey(tagName); + if (key != DCM_UndefinedTagKey) + dcmStopParsingAfterElement.set(key); + else + app.printError("no valid key given for option --stop-after-elem"); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-correction")) + { + dcmEnableAutomaticInputDataCorrection.set(OFTrue); + } + if (cmd.findOption("--disable-correction")) + { + dcmEnableAutomaticInputDataCorrection.set(OFFalse); + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + cmd.beginOptionBlock(); + if (cmd.findOption("--bitstream-deflated")) + { + dcmZlibExpectRFC1950Encoding.set(OFFalse); + } + if (cmd.findOption("--bitstream-zlib")) + { + dcmZlibExpectRFC1950Encoding.set(OFTrue); + } + cmd.endOptionBlock(); +#endif + + /* processing options */ +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.beginOptionBlock(); + if (cmd.findOption("--convert-to-utf8")) opt_convertToCharset = "ISO_IR 192"; + if (cmd.findOption("--convert-to-latin1")) opt_convertToCharset = "ISO_IR 100"; + if (cmd.findOption("--convert-to-ascii")) opt_convertToCharset = ""; + if (cmd.findOption("--convert-to-charset")) app.checkValue(cmd.getValue(opt_convertToCharset)); + cmd.endOptionBlock(); + if (cmd.findOption("--transliterate")) + { + app.checkDependence("--transliterate", "one of the --convert-to-xxx options", opt_convertToCharset != NULL); + opt_conversionFlags |= DCMTypes::CF_transliterate; + } + if (cmd.findOption("--discard-illegal")) + { + app.checkDependence("--discard-illegal", "one of the --convert-to-xxx options", opt_convertToCharset != NULL); + opt_conversionFlags |= DCMTypes::CF_discardIllegal; + } +#endif + if (cmd.findOption("--no-invalid-groups")) opt_noInvalidGroups = OFTrue; + + /* output options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-new-meta-info")) opt_writeMode = EWM_createNewMeta; + if (cmd.findOption("--write-dataset")) opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_oxfer = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; +#ifdef WITH_ZLIB + if (cmd.findOption("--write-xfer-deflated")) opt_oxfer = EXS_DeflatedLittleEndianExplicit; +#endif + if (cmd.findOption("--write-xfer-ge")) opt_oxfer = EXS_PrivateGE_LEI_WithBigEndianPixelData; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) + { + dcmEnableGenerationOfNewVRs(); + } + if (cmd.findOption("--disable-new-vr")) + { + dcmDisableGenerationOfNewVRs(); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-oversized")) dcmWriteOversizedSeqsAndItemsUndefined.set(OFTrue); + if (cmd.findOption("--abort-oversized")) dcmWriteOversizedSeqsAndItemsUndefined.set(OFFalse); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_opadenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + app.checkDependence("--compression-level", "--write-xfer-deflated", opt_oxfer == EXS_DeflatedLittleEndianExplicit); + app.checkValue(cmd.getValueAndCheckMinMax(opt_compressionLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, opt_compressionLevel)); + } +#endif + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmconvLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmconvLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* open input file */ + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmconvLogger, "invalid filename: "); + return 1; + } + + DcmFileFormat fileformat; + DcmDataset *dataset = fileformat.getDataset(); + + OFLOG_INFO(dcmconvLogger, "open input file " << opt_ifname); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + + if (error.bad()) + { + OFLOG_FATAL(dcmconvLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + OFLOG_INFO(dcmconvLogger, "load all data into memory"); + /* make sure that pixel data is loaded before output file is created */ + dataset->loadAllDataIntoMemory(); + + if (opt_noInvalidGroups) + { + OFLOG_INFO(dcmconvLogger, "remove all elements with an invalid group number"); + fileformat.removeInvalidGroups(); + } +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (opt_convertToCharset != NULL) + { + OFString toCharset(opt_convertToCharset); + /* convert the complete dataset to a new character encoding */ + OFLOG_INFO(dcmconvLogger, "converting all element values that are affected by " + << "Specific Character Set (0008,0005) to '" << opt_convertToCharset << "'" + << (toCharset.empty() ? " (ASCII)" : "")); + error = fileformat.convertCharacterSet(toCharset, opt_conversionFlags); + if (error.bad()) + { + OFLOG_FATAL(dcmconvLogger, error.text() << ": processing file: " << opt_ifname); + return 1; + } + } +#endif + + if (opt_oxfer == EXS_Unknown) + { + OFLOG_INFO(dcmconvLogger, "set output transfer syntax to input transfer syntax"); + opt_oxfer = dataset->getOriginalXfer(); + } + + OFLOG_INFO(dcmconvLogger, "check if new output transfer syntax is possible"); + + DcmXfer opt_oxferSyn(opt_oxfer); + + error = dataset->chooseRepresentation(opt_oxfer, NULL); + if (error.bad()) + { + OFLOG_ERROR(dcmconvLogger, error.text()); + /* reporting a fatal error and returning with an error code follows next */ + } + + if (error.good() && dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_INFO(dcmconvLogger, "output transfer syntax " << opt_oxferSyn.getXferName() << " can be written"); + } else { + OFLOG_FATAL(dcmconvLogger, "no conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return 1; + } + + OFLOG_INFO(dcmconvLogger, "create output file " << opt_ofname); + + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + + if (error.bad()) + { + OFLOG_FATAL(dcmconvLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmconvLogger, "conversion successful"); + + return 0; +} diff --git a/dcmdata/apps/dcmcrle.cc b/dcmdata/apps/dcmcrle.cc new file mode 100644 index 00000000..0d773dbd --- /dev/null +++ b/dcmdata/apps/dcmcrle.cc @@ -0,0 +1,326 @@ +/* + * + * Copyright (C) 2002-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: Compress DICOM file with RLE Transfer Syntax + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcrleerg.h" /* for DcmRLEEncoderRegistration */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmcrle" + +static OFLogger dcmcrleLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +#define SHORTCOL 3 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + + // RLE options + E_TransferSyntax opt_oxfer = EXS_RLELossless; + OFCmdUnsignedInt opt_fragmentSize = 0; // 0=unlimited + OFBool opt_createOffsetTable = OFTrue; + OFBool opt_uidcreation = OFFalse; + OFBool opt_secondarycapture = OFFalse; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encode DICOM file to RLE transfer syntax", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:", LONGCOL, SHORTCOL); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("encapsulated pixel data encoding options:"); + cmd.addSubGroup("pixel data fragmentation:"); + cmd.addOption("--fragment-per-frame", "+ff", "encode each frame as one fragment (default)"); + cmd.addOption("--fragment-size", "+fs", 1, "[s]ize: integer", + "limit fragment size to s kbytes (non-standard)"); + cmd.addSubGroup("basic offset table encoding:"); + cmd.addOption("--offset-table-create", "+ot", "create offset table (default)"); + cmd.addOption("--offset-table-empty", "-ot", "leave offset table empty"); + + cmd.addSubGroup("SOP Class UID:"); + cmd.addOption("--class-default", "+cd", "keep SOP Class UID (default)"); + cmd.addOption("--class-sc", "+cs", "convert to Secondary Capture Image\n(implies --uid-always)"); + + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-never", "+un", "never assign new UID (default)"); + cmd.addOption("--uid-always", "+ua", "always assign new UID"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding:"); + cmd.addOption("--padding-retain", "-p=", "do not change padding (default)"); + cmd.addOption("--padding-off", "-p", "no padding"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + // RLE options + + cmd.beginOptionBlock(); + if (cmd.findOption("--fragment-per-frame")) opt_fragmentSize = 0; + if (cmd.findOption("--fragment-size")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_fragmentSize, OFstatic_cast(OFCmdUnsignedInt, 1))); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--offset-table-create")) opt_createOffsetTable = OFTrue; + if (cmd.findOption("--offset-table-empty")) opt_createOffsetTable = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--class-default")) opt_secondarycapture = OFFalse; + if (cmd.findOption("--class-sc")) opt_secondarycapture = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-always")) opt_uidcreation = OFTrue; + if (cmd.findOption("--uid-never")) opt_uidcreation = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) opt_opadenc = EPD_noChange; + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmcrleLogger, rcsid << OFendl); + + // register RLE compression codec + DcmRLEEncoderRegistration::registerCodecs(opt_uidcreation, + OFstatic_cast(Uint32, opt_fragmentSize), opt_createOffsetTable, opt_secondarycapture); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmcrleLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open inputfile + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmcrleLogger, "invalid filename: "); + return 1; + } + + DcmFileFormat fileformat; + DcmDataset * dataset = fileformat.getDataset(); + + OFLOG_INFO(dcmcrleLogger, "open input file " << opt_ifname); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + + if (error.bad()) + { + OFLOG_FATAL(dcmcrleLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + DcmXfer original_xfer(dataset->getOriginalXfer()); + if (original_xfer.isEncapsulated()) + { + OFLOG_INFO(dcmcrleLogger, "DICOM file is already compressed, converting to uncompressed transfer syntax first"); + if (EC_Normal != dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL)) + { + OFLOG_FATAL(dcmcrleLogger, "No conversion from compressed original to uncompressed transfer syntax possible!"); + return 1; + } + } + + OFString sopClass; + if (fileformat.getMetaInfo()->findAndGetOFString(DCM_MediaStorageSOPClassUID, sopClass).good()) + { + /* check for DICOMDIR files */ + if (sopClass == UID_MediaStorageDirectoryStorage) + { + OFLOG_FATAL(dcmcrleLogger, "DICOMDIR files (Media Storage Directory Storage SOP Class) cannot be compressed!"); + return 1; + } + } + + OFLOG_INFO(dcmcrleLogger, "Convert DICOM file to compressed transfer syntax"); + + DcmXfer opt_oxferSyn(opt_oxfer); + + if (dataset->chooseRepresentation(opt_oxfer, NULL).good() && dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_INFO(dcmcrleLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written"); + } else { + OFLOG_FATAL(dcmcrleLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return 1; + } + + OFLOG_INFO(dcmcrleLogger, "create output file " << opt_ofname); + + fileformat.loadAllDataIntoMemory(); + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), EWM_updateMeta); + + if (error.bad()) + { + OFLOG_FATAL(dcmcrleLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmcrleLogger, "conversion successful"); + + // deregister RLE codec + DcmRLEEncoderRegistration::cleanup(); + + return 0; +} diff --git a/dcmdata/apps/dcmdrle.cc b/dcmdata/apps/dcmdrle.cc new file mode 100644 index 00000000..52086ff1 --- /dev/null +++ b/dcmdata/apps/dcmdrle.cc @@ -0,0 +1,297 @@ +/* + * + * Copyright (C) 2002-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: Decompress RLE-compressed DICOM file + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcrledrg.h" /* for DcmRLEDecoderRegistration */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmdrle" + +static OFLogger dcmdrleLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +#define SHORTCOL 3 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + E_TransferSyntax opt_oxfer = EXS_LittleEndianExplicit; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_FileWriteMode opt_writeMode = EWM_fileformat; + E_TransferSyntax opt_ixfer = EXS_Unknown; + + // RLE parameters + OFBool opt_uidcreation = OFFalse; + OFBool opt_reversebyteorder = OFFalse; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Decode RLE-compressed DICOM file", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-default", "+ud", "keep same SOP Instance UID (default)"); + cmd.addOption("--uid-always", "+ua", "always assign new UID"); + cmd.addSubGroup("RLE byte segment order:"); + cmd.addOption("--byte-order-default", "+bd", "most significant byte first (default)"); + cmd.addOption("--byte-order-reverse", "+br", "least significant byte first"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian (default)"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-default")) opt_uidcreation = OFFalse; + if (cmd.findOption("--uid-always")) opt_uidcreation = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--byte-order-default")) opt_reversebyteorder = OFFalse; + if (cmd.findOption("--byte-order-reverse")) opt_reversebyteorder = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) + { + opt_readMode = ERM_autoDetect; + opt_ixfer = EXS_Unknown; + } + if (cmd.findOption("--read-file-only")) + { + opt_readMode = ERM_fileOnly; + opt_ixfer = EXS_Unknown; + } + if (cmd.findOption("--read-dataset")) + { + opt_readMode = ERM_dataset; + opt_ixfer = EXS_RLELossless; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_opadenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmdrleLogger, rcsid << OFendl); + + // register global decompression codecs + DcmRLEDecoderRegistration::registerCodecs(opt_uidcreation, opt_reversebyteorder); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmdrleLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open inputfile + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmdrleLogger, "invalid filename: "); + return 1; + } + + DcmFileFormat fileformat; + DcmDataset * dataset = fileformat.getDataset(); + + OFLOG_INFO(dcmdrleLogger, "open input file " << opt_ifname); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + + if (error.bad()) + { + OFLOG_FATAL(dcmdrleLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + OFLOG_INFO(dcmdrleLogger, "decompressing file"); + + DcmXfer opt_oxferSyn(opt_oxfer); + DcmXfer original_xfer(dataset->getOriginalXfer()); + + error = dataset->chooseRepresentation(opt_oxfer, NULL); + if (error.bad()) + { + OFLOG_FATAL(dcmdrleLogger, error.text() << ": decompressing file: " << opt_ifname); + if (error == EC_CannotChangeRepresentation) + OFLOG_FATAL(dcmdrleLogger, "input transfer syntax " << original_xfer.getXferName() << " not supported"); + return 1; + } + + if (! dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_FATAL(dcmdrleLogger, "no conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible"); + return 1; + } + + OFLOG_INFO(dcmdrleLogger, "create output file " << opt_ofname); + + // update file meta information with new SOP Instance UID + if (opt_uidcreation && (opt_writeMode == EWM_fileformat)) + opt_writeMode = EWM_updateMeta; + + fileformat.loadAllDataIntoMemory(); + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + + if (error.bad()) + { + OFLOG_FATAL(dcmdrleLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmdrleLogger, "conversion successful"); + + // deregister RLE codec + DcmRLEDecoderRegistration::cleanup(); + + return 0; +} diff --git a/dcmdata/apps/dcmdump.cc b/dcmdata/apps/dcmdump.cc new file mode 100644 index 00000000..cf751eb7 --- /dev/null +++ b/dcmdata/apps/dcmdump.cc @@ -0,0 +1,882 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: List the contents of a dicom file + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcistrmz.h" /* for dcmZlibExpectRFC1950Encoding */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#if defined (HAVE_WINDOWS_H) || defined(HAVE_FNMATCH_H) +#define PATTERN_MATCHING_AVAILABLE +#endif + +#ifndef HAVE_WINDOWS_H +#define ANSI_ESCAPE_CODES_AVAILABLE +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmdump" + +static OFLogger dcmdumpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +static int dumpFile(STD_NAMESPACE ostream &out, + const OFFilename &ifname, + const E_FileReadMode readMode, + const E_TransferSyntax xfer, + const size_t printFlags, + const OFBool loadIntoMemory, + const OFBool stopOnErrors, + const OFBool convertToUTF8, + const DcmTagKey &stopParsingAtElement, + const char *pixelDirectory); + +// ******************************************** + +static OFBool printFilename = OFFalse; +static OFBool printFileSearch = OFFalse; +static OFBool printAllInstances = OFTrue; +static OFBool prependSequenceHierarchy = OFFalse; +static int printTagCount = 0; +static const int MAX_PRINT_TAG_NAMES = 1024; +static const char *printTagNames[MAX_PRINT_TAG_NAMES]; +static const DcmTagKey *printTagKeys[MAX_PRINT_TAG_NAMES]; +static OFCmdUnsignedInt maxReadLength = 4096; // default is 4 KB +static size_t fileCounter = 0; + + +static DcmTagKey parseTagKey(const char *tagName) +{ + unsigned int group = 0xffff; + unsigned int elem = 0xffff; + if (sscanf(tagName, "%x,%x", &group, &elem) != 2) + { + DcmTagKey tagKey; + /* it is a name */ + const DcmDataDictionary &globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(tagName); + if (dicent == NULL) { + OFLOG_WARN(dcmdumpLogger, "unrecognized tag name: '" << tagName << "'"); + tagKey = DCM_UndefinedTagKey; + } else { + tagKey = dicent->getKey(); + } + dcmDataDict.rdunlock(); + return tagKey; + } else /* tag name has format "gggg,eeee" */ + { + return DcmTagKey(OFstatic_cast(Uint16, group),OFstatic_cast(Uint16, elem)); + } +} + +static OFBool addPrintTagName(const char *tagName) +{ + if (printTagCount >= MAX_PRINT_TAG_NAMES) { + OFLOG_WARN(dcmdumpLogger, "too many print tag options (max: " << MAX_PRINT_TAG_NAMES << ")"); + return OFFalse; + } + + unsigned int group = 0xffff; + unsigned int elem = 0xffff; + if (sscanf(tagName, "%x,%x", &group, &elem) != 2) + { + /* it is a name */ + const DcmDataDictionary &globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(tagName); + if (dicent == NULL) { + OFLOG_WARN(dcmdumpLogger, "unrecognized tag name: '" << tagName << "'"); + dcmDataDict.rdunlock(); + return OFFalse; + } else { + /* note for later */ + printTagKeys[printTagCount] = new DcmTagKey(dicent->getKey()); + } + dcmDataDict.rdunlock(); + } else { + /* tag name has format xxxx,xxxx */ + /* do not lookup in dictionary, tag could be private */ + printTagKeys[printTagCount] = NULL; + } + + size_t buflen = strlen(tagName)+1; + char *buf = OFstatic_cast(char*, malloc(buflen)); + OFStandard::strlcpy(buf, tagName, buflen); + printTagNames[printTagCount] = buf; + printTagCount++; + return OFTrue; +} + + +/* main program */ + +#define SHORTCOL 3 +#define LONGCOL 21 + +// this macro either expands to main() or wmain() +DCMTK_MAIN_FUNCTION +{ + OFBool loadIntoMemory = OFTrue; + size_t printFlags = DCMTypes::PF_shortenLongTagValues; + E_FileReadMode readMode = ERM_autoDetect; + E_TransferSyntax xfer = EXS_Unknown; + OFBool stopOnErrors = OFTrue; + OFBool scanDir = OFFalse; + OFBool recurse = OFFalse; + const char *scanPattern = ""; + const char *pixelDirectory = NULL; + OFBool convertToUTF8 = OFFalse; + DcmTagKey stopParsingBeforeElement = DCM_UndefinedTagKey; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Dump DICOM file and data set", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input file or directory to be dumped", OFCmdParam::PM_MultiMandatory); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + cmd.addSubGroup("input files:"); + cmd.addOption("--scan-directories", "+sd", "scan directories for input files (dcmfile-in)"); +#ifdef PATTERN_MATCHING_AVAILABLE + cmd.addOption("--scan-pattern", "+sp", 1, "[p]attern: string (only with --scan-directories)", + "pattern for filename matching (wildcards)"); +#endif + cmd.addOption("--no-recurse", "-r", "do not recurse within directories (default)"); + cmd.addOption("--recurse", "+r", "recurse within specified directories"); + cmd.addSubGroup("long tag values:"); + cmd.addOption("--load-all", "+M", "load very long tag values (default)"); + cmd.addOption("--load-short", "-M", "do not load very long values (e.g. pixel data)"); + cmd.addOption("--max-read-length", "+R", 1, "[k]bytes: integer (4..4194302, default: 4)", + "set threshold for long values to k kbytes"); + cmd.addSubGroup("parsing of file meta information:"); + cmd.addOption("--use-meta-length", "+ml", "use file meta information group length (default)"); + cmd.addOption("--ignore-meta-length", "-ml", "ignore file meta information group length"); + cmd.addSubGroup("parsing of odd-length attributes:"); + cmd.addOption("--accept-odd-length", "+ao", "accept odd length attributes (default)"); + cmd.addOption("--assume-even-length", "+ae", "assume real length is one byte larger"); + cmd.addSubGroup("handling of explicit VR:"); + cmd.addOption("--use-explicit-vr", "+ev", "use explicit VR from dataset (default)"); + cmd.addOption("--ignore-explicit-vr", "-ev", "ignore explicit VR (prefer data dictionary)"); + cmd.addSubGroup("handling of non-standard VR:"); + cmd.addOption("--treat-as-unknown", "+vr", "treat non-standard VR as unknown (default)"); + cmd.addOption("--assume-implicit", "-vr", "try to read with implicit VR little endian TS"); + cmd.addSubGroup("handling of undefined length UN elements:"); + cmd.addOption("--enable-cp246", "+ui", "read undefined len UN as implicit VR (default)"); + cmd.addOption("--disable-cp246", "-ui", "read undefined len UN as explicit VR"); + cmd.addSubGroup("handling of defined length UN elements:"); + cmd.addOption("--retain-un", "-uc", "retain elements as UN (default)"); + cmd.addOption("--convert-un", "+uc", "convert to real VR if known"); + cmd.addSubGroup("handling of private max-length elements (implicit VR):"); + cmd.addOption("--maxlength-dict", "-sq", "read as defined in dictionary (default)"); + cmd.addOption("--maxlength-seq", "+sq", "read as sequence with undefined length"); + cmd.addSubGroup("handling of wrong delimitation items:"); + cmd.addOption("--use-delim-items", "-rd", "use delimitation items from dataset (default)"); + cmd.addOption("--replace-wrong-delim", "+rd", "replace wrong sequence/item delimitation items"); + cmd.addSubGroup("handling of illegal undefined length OB/OW elements:"); + cmd.addOption("--illegal-obow-rej", "-oi", "reject dataset with illegal element (default)"); + cmd.addOption("--illegal-obow-conv", "+oi", "convert undefined length OB/OW element to SQ"); + cmd.addSubGroup("handling of VOI LUT Sequence with OW VR and explicit length:"); + cmd.addOption("--illegal-voi-rej", "-vi", "reject dataset with illegal VOI LUT (default)"); + cmd.addOption("--illegal-voi-conv", "+vi", "convert illegal VOI LUT to SQ"); + cmd.addSubGroup("handling of explicit length pixel data for encaps. transfer syntaxes:"); + cmd.addOption("--abort-expl-pixdata", "-pe", "abort on explicit length pixel data (default)"); + cmd.addOption("--use-expl-pixdata", "+pe", "use explicit length pixel data"); + cmd.addSubGroup("general handling of parser errors: "); + cmd.addOption("--ignore-parse-errors", "+Ep", "try to recover from parse errors"); + cmd.addOption("--handle-parse-errors", "-Ep", "handle parse errors and stop parsing (default)"); + cmd.addSubGroup("other parsing options:"); + cmd.addOption("--stop-after-elem", "+st", 1, "[t]ag: \"gggg,eeee\" or dictionary name", + "stop parsing after element specified by t"); + cmd.addOption("--stop-before-elem", "+sb", 1, "[t]ag: \"gggg,eeee\" or dictionary name", + "stop parsing before element specified by t"); + cmd.addSubGroup("automatic data correction:"); + cmd.addOption("--enable-correction", "+dc", "enable automatic data correction (default)"); + cmd.addOption("--disable-correction", "-dc", "disable automatic data correction"); +#ifdef WITH_ZLIB + cmd.addSubGroup("bitstream format of deflated input:"); + cmd.addOption("--bitstream-deflated", "+bd", "expect deflated bitstream (default)"); + cmd.addOption("--bitstream-zlib", "+bz", "expect deflated zlib bitstream"); +#endif + +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.addGroup("processing options:"); + cmd.addSubGroup("specific character set:"); + cmd.addOption("--convert-to-utf8", "+U8", "convert all element values that are affected\nby Specific Character Set (0008,0005) to UTF-8"); +#endif + + cmd.addGroup("output options:"); + cmd.addSubGroup("printing:"); + cmd.addOption("--print-all", "+L", "print long tag values completely"); + cmd.addOption("--print-short", "-L", "print long tag values shortened (default)"); + cmd.addOption("--print-tree", "+T", "print hierarchical structure as a simple tree"); + cmd.addOption("--print-indented", "-T", "print hierarchical structure indented (default)"); + cmd.addOption("--print-filename", "+F", "print header with filename for each input file"); + cmd.addOption("--print-file-search", "+Fs", "print header with filename only for those input\nfiles that contain one of the searched tags"); + cmd.addSubGroup("mapping:"); + cmd.addOption("--map-uid-names", "+Un", "map well-known UID numbers to names (default)"); + cmd.addOption("--no-uid-names", "-Un", "do not map well-known UID numbers to names"); + cmd.addSubGroup("quoting:"); + cmd.addOption("--quote-nonascii", "+Qn", "quote non-ASCII and control chars as XML markup"); + cmd.addOption("--quote-as-octal", "+Qo", "quote non-ASCII and control ch. as octal numbers"); + cmd.addOption("--print-nonascii", "-Qn", "print non-ASCII and control chars (default)"); +#ifdef ANSI_ESCAPE_CODES_AVAILABLE + cmd.addSubGroup("color:"); + cmd.addOption("--print-color", "+C", "use ANSI escape codes for colored output"); + cmd.addOption("--no-color", "-C", "do not use any ANSI escape codes (default)"); +#endif + + cmd.addSubGroup("error handling:"); + cmd.addOption("--stop-on-error", "-E", "do not print if file is damaged (default)"); + cmd.addOption("--ignore-errors", "+E", "attempt to print even if file is damaged"); + + cmd.addSubGroup("searching:"); + cmd.addOption("--search", "+P", 1, "[t]ag: \"gggg,eeee\" or dictionary name", + "print the textual dump of tag t\nthis option can be specified multiple times\n(default: the complete file is printed)"); + cmd.addOption("--search-all", "+s", "print all instances of searched tags (default)"); + cmd.addOption("--search-first", "-s", "only print first instance of searched tags"); + cmd.addOption("--prepend", "+p", "prepend sequence hierarchy to printed tag,\ndenoted by: (gggg,eeee).(gggg,eeee).*\n(only when used with --search)"); + cmd.addOption("--no-prepend", "-p", "do not prepend hierarchy to tag (default)"); + + cmd.addSubGroup("writing:"); + cmd.addOption("--write-pixel", "+W", 1, "[d]irectory: string", + "write pixel data to a .raw file stored in d\n(little endian, filename created automatically)"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + xfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", readMode == ERM_dataset); + xfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", readMode == ERM_dataset); + xfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", readMode == ERM_dataset); + xfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--scan-directories")) scanDir = OFTrue; +#ifdef PATTERN_MATCHING_AVAILABLE + if (cmd.findOption("--scan-pattern")) + { + app.checkDependence("--scan-pattern", "--scan-directories", scanDir); + app.checkValue(cmd.getValue(scanPattern)); + } +#endif + cmd.beginOptionBlock(); + if (cmd.findOption("--no-recurse")) recurse = OFFalse; + if (cmd.findOption("--recurse")) + { + app.checkDependence("--recurse", "--scan-directories", scanDir); + recurse = OFTrue; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--max-read-length")) + { + app.checkValue(cmd.getValueAndCheckMinMax(maxReadLength, 4, 4194302)); + maxReadLength *= 1024; // convert kbytes to bytes + } + cmd.beginOptionBlock(); + if (cmd.findOption("--load-all")) loadIntoMemory = OFTrue; + if (cmd.findOption("--load-short")) loadIntoMemory = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--use-meta-length")) + { + dcmIgnoreFileMetaInformationGroupLength.set(OFFalse); + } + if (cmd.findOption("--ignore-meta-length")) + { + dcmIgnoreFileMetaInformationGroupLength.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--accept-odd-length")) + { + dcmAcceptOddAttributeLength.set(OFTrue); + } + if (cmd.findOption("--assume-even-length")) + { + dcmAcceptOddAttributeLength.set(OFFalse); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--use-explicit-vr")) + { + dcmPreferVRFromDataDictionary.set(OFFalse); + } + if (cmd.findOption("--ignore-explicit-vr")) + { + dcmPreferVRFromDataDictionary.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--treat-as-unknown")) + { + dcmAcceptUnexpectedImplicitEncoding.set(OFFalse); + } + if (cmd.findOption("--assume-implicit")) + { + dcmAcceptUnexpectedImplicitEncoding.set(OFTrue); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-cp246")) + { + dcmEnableCP246Support.set(OFTrue); + } + if (cmd.findOption("--disable-cp246")) + { + dcmEnableCP246Support.set(OFFalse); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--retain-un")) + { + dcmEnableUnknownVRConversion.set(OFFalse); + } + if (cmd.findOption("--convert-un")) + { + dcmEnableUnknownVRConversion.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--maxlength-dict")) + { + dcmReadImplPrivAttribMaxLengthAsSQ.set(OFFalse); + } + if (cmd.findOption("--maxlength-seq")) + { + dcmReadImplPrivAttribMaxLengthAsSQ.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--use-delim-items")) + { + dcmReplaceWrongDelimitationItem.set(OFFalse); + } + if (cmd.findOption("--replace-wrong-delim")) + { + dcmReplaceWrongDelimitationItem.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--illegal-obow-rej")) + { + dcmConvertUndefinedLengthOBOWtoSQ.set(OFFalse); + } + if (cmd.findOption("--illegal-obow-conv")) + { + dcmConvertUndefinedLengthOBOWtoSQ.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--illegal-voi-rej")) + { + dcmConvertVOILUTSequenceOWtoSQ.set(OFFalse); + } + if (cmd.findOption("--illegal-voi-conv")) + { + dcmConvertVOILUTSequenceOWtoSQ.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--abort-expl-pixdata")) + { + dcmUseExplLengthPixDataForEncTS.set(OFFalse); + } + if (cmd.findOption("--use-expl-pixdata")) + { + dcmUseExplLengthPixDataForEncTS.set(OFTrue); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--ignore-parse-errors")) + { + dcmIgnoreParsingErrors.set(OFTrue); + } + if (cmd.findOption("--handle-parse-errors")) + { + dcmIgnoreParsingErrors.set(OFFalse); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-correction")) + { + dcmEnableAutomaticInputDataCorrection.set(OFTrue); + } + if (cmd.findOption("--disable-correction")) + { + dcmEnableAutomaticInputDataCorrection.set(OFFalse); + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + cmd.beginOptionBlock(); + if (cmd.findOption("--bitstream-deflated")) + { + dcmZlibExpectRFC1950Encoding.set(OFFalse); + } + if (cmd.findOption("--bitstream-zlib")) + { + dcmZlibExpectRFC1950Encoding.set(OFTrue); + } + cmd.endOptionBlock(); +#endif + + /* processing options */ +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (cmd.findOption("--convert-to-utf8")) convertToUTF8 = OFTrue; +#endif + + /* output options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--print-all")) printFlags &= ~DCMTypes::PF_shortenLongTagValues; + if (cmd.findOption("--print-short")) printFlags |= DCMTypes::PF_shortenLongTagValues; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-tree")) printFlags |= DCMTypes::PF_showTreeStructure; + if (cmd.findOption("--print-indented")) printFlags &= ~DCMTypes::PF_showTreeStructure; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-filename")) + { + printFilename = OFTrue; + printFileSearch = OFFalse; + } + if (cmd.findOption("--print-file-search")) + { + printFileSearch = OFTrue; + printFilename = OFFalse; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--map-uid-names")) printFlags &= ~DCMTypes::PF_doNotMapUIDsToNames; + if (cmd.findOption("--no-uid-names")) printFlags |= DCMTypes::PF_doNotMapUIDsToNames; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--quote-nonascii")) + printFlags = (printFlags & ~DCMTypes::PF_convertToOctalNumbers) | DCMTypes::PF_convertToMarkup; + if (cmd.findOption("--quote-as-octal")) + printFlags = (printFlags & ~DCMTypes::PF_convertToMarkup) | DCMTypes::PF_convertToOctalNumbers; + if (cmd.findOption("--print-nonascii")) + printFlags = printFlags & ~(DCMTypes::PF_convertToMarkup | DCMTypes::PF_convertToOctalNumbers); + cmd.endOptionBlock(); + +#ifdef ANSI_ESCAPE_CODES_AVAILABLE + cmd.beginOptionBlock(); + if (cmd.findOption("--print-color")) printFlags |= DCMTypes::PF_useANSIEscapeCodes; + if (cmd.findOption("--no-color")) printFlags &= ~DCMTypes::PF_useANSIEscapeCodes; + cmd.endOptionBlock(); +#endif + + cmd.beginOptionBlock(); + if (cmd.findOption("--stop-on-error")) stopOnErrors = OFTrue; + if (cmd.findOption("--ignore-errors")) stopOnErrors = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--stop-after-elem")) + { + const char *tagName = NULL; + app.checkValue(cmd.getValue(tagName)); + DcmTagKey key = parseTagKey(tagName); + if (key != DCM_UndefinedTagKey) + dcmStopParsingAfterElement.set(key); + else + app.printError("no valid key given for option --stop-after-elem"); + } + if (cmd.findOption("--stop-before-elem")) + { + const char *tagName = NULL; + app.checkValue(cmd.getValue(tagName)); + DcmTagKey key = parseTagKey(tagName); + if (key != DCM_UndefinedTagKey) + stopParsingBeforeElement = key; + else + app.printError("no valid key given for option --stop-before-elem"); + } + cmd.endOptionBlock(); + + if (cmd.findOption("--search", 0, OFCommandLine::FOM_FirstFromLeft)) + { + const char *tagName = NULL; + do + { + app.checkValue(cmd.getValue(tagName)); + if (!addPrintTagName(tagName)) return 1; + } while (cmd.findOption("--search", 0, OFCommandLine::FOM_NextFromLeft)); + } + + if (printFileSearch) + app.checkDependence("--print-file-search", "--search", printTagCount > 0); + + cmd.beginOptionBlock(); + if (cmd.findOption("--search-all")) + { + app.checkDependence("--search-all", "--search", printTagCount > 0); + printAllInstances = OFTrue; + } + if (cmd.findOption("--search-first")) + { + app.checkDependence("--search-first", "--search", printTagCount > 0); + printAllInstances = OFFalse; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--prepend")) + { + app.checkDependence("--prepend", "--search", printTagCount > 0); + prependSequenceHierarchy = OFTrue; + } + if (cmd.findOption("--no-prepend")) + { + app.checkDependence("--no-prepend", "--search", printTagCount > 0); + prependSequenceHierarchy = OFFalse; + } + cmd.endOptionBlock(); + app.checkConflict("--prepend", "--print-tree", prependSequenceHierarchy && (printFlags & DCMTypes::PF_showTreeStructure) > 0); + + if (cmd.findOption("--write-pixel")) + app.checkValue(cmd.getValue(pixelDirectory)); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmdumpLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmdumpLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* make sure the pixel data directory exists and is writable */ + if (pixelDirectory != NULL) + { + if (!OFStandard::dirExists(pixelDirectory)) + { + OFLOG_WARN(dcmdumpLogger, "directory specified for --write-pixel does not exist, ignoring this option"); + pixelDirectory = NULL; + } + else if (!OFStandard::isWriteable(pixelDirectory)) + { + OFLOG_WARN(dcmdumpLogger, "directory specified for --write-pixel is not writeable, ignoring this option"); + pixelDirectory = NULL; + } + } + + int errorCount = 0; + + /* create list of input files */ + OFFilename paramValue; + OFList inputFiles; + const int paramCount = cmd.getParamCount(); + /* iterate over all input filenames */ + for (int i = 1; i <= paramCount; i++) + { + cmd.getParam(i, paramValue); + /* search directory recursively (if required) */ + if (OFStandard::dirExists(paramValue)) + { + if (scanDir) + OFStandard::searchDirectoryRecursively(paramValue, inputFiles, scanPattern, "" /*dirPrefix*/, recurse); + else + OFLOG_WARN(dcmdumpLogger, "ignoring directory because option --scan-directories is not set: " << paramValue); + } else + inputFiles.push_back(paramValue); + } + /* check whether there are any input files at all */ + if (inputFiles.empty()) + { + OFLOG_FATAL(dcmdumpLogger, "no input files to be dumped"); + return 1; + } + + const size_t count = inputFiles.size(); + OFFilename current; + OFListIterator(OFFilename) if_iter = inputFiles.begin(); + OFListIterator(OFFilename) if_last = inputFiles.end(); + /* iterate over all input filenames */ + while (if_iter != if_last) + { + current = (*if_iter++); + if (printFilename) + { + /* a newline separates two consecutive "dumps" */ + if (++fileCounter > 1) + COUT << OFendl; + /* print header with filename */ + COUT << "# " << OFFIS_CONSOLE_APPLICATION << " (" << fileCounter << "/" << count << "): " << current << OFendl; + } + errorCount += dumpFile(COUT, current, readMode, xfer, printFlags, loadIntoMemory, stopOnErrors, convertToUTF8, stopParsingBeforeElement, pixelDirectory); + } + + return errorCount; +} + +static void printResult(STD_NAMESPACE ostream &out, + DcmStack &stack, + size_t printFlags, + const char*pixelFileName = NULL, + size_t *pixelCounter = NULL) +{ + unsigned long n = stack.card(); + if (n == 0) { + return; + } + + if (prependSequenceHierarchy) { + if (printFlags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_TAG; + /* print the path leading up to the top stack elem */ + for (unsigned long i = n - 1; i >= 1; i--) { + DcmObject *dobj = stack.elem(i); + /* do not print if a DCM_Item as this is not + * very helpful to distinguish instances. + */ + if (dobj != NULL && dobj->getTag().getXTag() != DCM_Item) { + out << dobj->getTag() << "."; + } + } + } + + /* print the tag and its value */ + DcmObject *dobj = stack.top(); + dobj->print(out, printFlags, 1 /*level*/, pixelFileName, pixelCounter); +} + +static int dumpFile(STD_NAMESPACE ostream &out, + const OFFilename &ifname, + const E_FileReadMode readMode, + const E_TransferSyntax xfer, + const size_t printFlags, + const OFBool loadIntoMemory, + const OFBool stopOnErrors, + const OFBool convertToUTF8, + const DcmTagKey &stopParsingAtElement, + const char *pixelDirectory) +{ + int result = 0; + + if (ifname.isEmpty()) + { + OFLOG_ERROR(dcmdumpLogger, OFFIS_CONSOLE_APPLICATION << ": invalid filename: "); + return 1; + } + + DcmFileFormat dfile; + DcmObject *dset = &dfile; + if (readMode == ERM_dataset) dset = dfile.getDataset(); + OFCondition cond; + + if (stopParsingAtElement == DCM_UndefinedTagKey) + { + cond = dfile.loadFile(ifname, xfer, EGL_noChange, OFstatic_cast(Uint32, maxReadLength), readMode); + } + else + { + // instead of using loadFile(), we call loadFileUntilTag(). + cond = dfile.loadFileUntilTag(ifname, xfer, EGL_noChange, OFstatic_cast(Uint32, maxReadLength), readMode, stopParsingAtElement); + } + if (cond.bad()) + { + OFLOG_ERROR(dcmdumpLogger, OFFIS_CONSOLE_APPLICATION << ": " << cond.text() + << ": reading file: "<< ifname); + result = 1; + if (stopOnErrors) return result; + } + + if (loadIntoMemory) dfile.loadAllDataIntoMemory(); + +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (convertToUTF8) + { + OFLOG_INFO(dcmdumpLogger, "converting all element values that are affected by Specific Character Set (0008,0005) to UTF-8"); + cond = dfile.convertToUTF8(); + if (cond.bad()) + { + OFLOG_FATAL(dcmdumpLogger, cond.text() << ": converting file to UTF-8: " << ifname); + result = 1; + if (stopOnErrors) return result; + } + } +#else + // avoid compiler warning on unused variable + (void)convertToUTF8; +#endif + + size_t pixelCounter = 0; + const char *pixelFileName = NULL; + OFFilename pixelFilenameStr; + if (pixelDirectory != NULL) + { + /* create filename for pixel data */ + OFFilename fileName; + OFStandard::getFilenameFromPath(fileName, ifname); + OFStandard::combineDirAndFilename(pixelFilenameStr, pixelDirectory, fileName); + pixelFileName = pixelFilenameStr.getCharPointer(); + } + + /* dump complete file content */ + if (printTagCount == 0) + { + dset->print(out, printFlags, 0 /*level*/, pixelFileName, &pixelCounter); + } else { + OFBool firstTag = OFTrue; + /* only print specified tags */ + for (int i = 0; i < printTagCount; i++) + { + unsigned int group = 0xffff; + unsigned int elem = 0xffff; + DcmTagKey searchKey; + const char *tagName = printTagNames[i]; + if (printTagKeys[i]) + searchKey = *printTagKeys[i]; + else if (sscanf(tagName, "%x,%x", &group, &elem) == 2) + searchKey.set(OFstatic_cast(Uint16, group), OFstatic_cast(Uint16, elem)); + else { + OFLOG_FATAL(dcmdumpLogger, "Internal ERROR in File " << __FILE__ << ", Line " + << __LINE__ << OFendl << " -- Named tag inconsistency"); + abort(); + } + + DcmStack stack; + if (dset->search(searchKey, stack, ESM_fromHere, OFTrue) == EC_Normal) + { + if (firstTag) + { + if (!printFilename) + { + /* a newline separates two consecutive "dumps" */ + if (++fileCounter > 1) + COUT << OFendl; + } + /* print header with filename */ + if (printFileSearch) + COUT << "# " << OFFIS_CONSOLE_APPLICATION << " (" << fileCounter << "): " << ifname << OFendl; + firstTag = OFFalse; + } + printResult(out, stack, printFlags, pixelFileName, &pixelCounter); + if (printAllInstances) + { + while (dset->search(searchKey, stack, ESM_afterStackTop, OFTrue) == EC_Normal) + printResult(out, stack, printFlags, pixelFileName, &pixelCounter); + } + } + } + } + return result; +} diff --git a/dcmdata/apps/dcmftest.cc b/dcmdata/apps/dcmftest.cc new file mode 100644 index 00000000..b4771226 --- /dev/null +++ b/dcmdata/apps/dcmftest.cc @@ -0,0 +1,88 @@ +/* + * + * Copyright (C) 1994-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Test if a file uses DICOM Part 10 format. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_LIBC +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ + +#define OFFIS_CONSOLE_APPLICATION "dcmftest" + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Test if file uses DICOM part 10 format", rcsid); + OFCommandLine cmd; + + /* evaluate command line */ + cmd.addParam("file", OFCmdParam::PM_MultiMandatory); + app.parseCommandLine(cmd, argc, argv); + + int badCount = 0; + int count = cmd.getParamCount(); + const char *fname = NULL; + for (int i=1; i<=count; i++) { + cmd.getParam(i, fname); + OFBool ok = OFFalse; + FILE* f = NULL; + + if (fname && (strlen(fname) > 0)) f = fopen(fname, "rb"); + if (f == 0) { + ok = OFFalse; + } else { + char signature[4]; + if ((fseek(f, DCM_PreambleLen, SEEK_SET) < 0) || + (fread(signature, 1, DCM_MagicLen, f) != DCM_MagicLen)) { + ok = OFFalse; + } else if (strncmp(signature, DCM_Magic, DCM_MagicLen) != 0) { + ok = OFFalse; + } else { + /* looks ok */ + ok = OFTrue; + } + fclose(f); + } + if (ok) { + COUT << "yes: " << fname << OFendl; + } else { + COUT << "no: " << fname << OFendl; + badCount++; + } + } + + /* + ** if all files are ok then return zero, otherwise the + ** number of non-dicom files. + */ + return badCount; +} diff --git a/dcmdata/apps/dcmgpdir.cc b/dcmdata/apps/dcmgpdir.cc new file mode 100644 index 00000000..86aae1d9 --- /dev/null +++ b/dcmdata/apps/dcmgpdir.cc @@ -0,0 +1,660 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett, Joerg Riesmeier + * + * Purpose: + * Make a DICOMDIR according to the DICOM Part 11 Media Storage Application + * Profiles. Supports the following profiles: + * - General Purpose CD-R Interchange (STD-GEN-CD) + * - General Purpose Interchange on DVD-RAM Media (STD-GEN-DVD-RAM) + * If build with 'BUILD_DCMGPDIR_AS_DCMMKDIR' it also supports: + * - General Purpose DVD Interchange with JPEG (STD-GEN-DVD-JPEG) + * - General Purpose DVD Interchange with JPEG 2000 (STD-GEN-DVD-J2K) + * - General Purpose BD Interchange with JPEG (STD-GEN-BD-JPEG) + * - General Purpose BD Interchange with JPEG 2000 (STD-GEN-BD-J2K) + * - General Purpose BD Interchange with MPEG2 MP@ML (STD-GEN-BD-MPEG2-MPML) + * - General Purpose BD Interchange with MPEG2 MP@HL (STD-GEN-BD-MPEG2-MPHL) + * - General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP@Level4.1 (STD-GEN-BD-MPEG4-HPLV41) + * - General Purpose BD Interchange with MPEG-4 AVC/H.264 BD-Compatible HiP@Level4.1 (STD-GEN-BD-MPEG4-HPLV41BD) + * - General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.2 for 2D video (STD-GEN-BD-MPEG4-HPLV42-2D) + * - General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.2 for 3D video (STD-GEN-BD-MPEG4-HPLV42-3D) + * - General Purpose BD Interchange with MPEG-4 AVC/H.264 Stereo HiP\@Level4.2 (STD-GEN-BD-MPEG4-SHPLV42) + * - General Purpose USB and Flash Memory Interchange with JPEG (STD-GEN-USB/MMC/CF/SD-JPEG) + * - General Purpose USB and Flash Memory Interchange with JPEG 2000 (STD-GEN-USB/MMC/CF/SD-J2K) + * - General Purpose MIME Interchange (STD-GEN-MIME) + * - DVD Interchange with MPEG2 MP@ML (STD-DVD-MPEG2-MPML) + * - Basic Cardiac X-Ray Angiographic Studies on CD-R Media (STD-XABC-CD) + * - 1024 X-Ray Angiographic Studies on CD-R Media (STD-XA1K-CD) + * - 1024 X-Ray Angiographic Studies on DVD Media (STD-XA1K-DVD) + * - Dental Radiograph Interchange (STD-DEN-CD) + * - CT/MR Studies on various Media (STD-CTMR-xxxx) + * - Ultrasound Single Frame for Image Display (STD-US-ID-SF-xxxx) + * - Ultrasound Single Frame with Spatial Calibration (STD-US-SC-SF-xxxx) + * - Ultrasound Single Frame with Combined Calibration (STD-US-CC-SF-xxxx) + * - Ultrasound Single & Multi-Frame for Image Display (STD-US-ID-MF-xxxx) + * - Ultrasound Single & Multi-Frame with Spatial Calibration (STD-US-SC-MF-xxxx) + * - Ultrasound Single & Multi-Frame with Combined Calibration (STD-US-CC-MF-xxxx) + * - 12-lead ECG Interchange on Diskette (STD-WVFM-ECG-FD) + * - Hemodynamic Waveform Interchange on Diskette (STD-WVFM-HD-FD) + * There should be no need to set this compiler flag manually, just compile + * dcmjpeg/apps/dcmmkdir.cc. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcddirif.h" /* for class DicomDirInterface */ +#include "dcmtk/ofstd/ofstd.h" /* for class OFStandard */ +#include "dcmtk/ofstd/ofconapp.h" /* for class OFConsoleApplication */ +#include "dcmtk/ofstd/ofcond.h" /* for class OFCondition */ + +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ +#include "dcmtk/dcmdata/dcrledrg.h" /* for DcmRLEDecoderRegistration */ +#include "dcmtk/dcmjpeg/djdecode.h" /* for dcmjpeg decoders */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ +#include "dcmtk/dcmjpeg/ddpiimpl.h" /* for class DicomDirImageImplementation */ +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR +#define OFFIS_CONSOLE_APPLICATION "dcmmkdir" +#define OFFIS_CONSOLE_DESCRIPTION "Create a DICOMDIR file" +#else +#define OFFIS_CONSOLE_APPLICATION "dcmgpdir" +#define OFFIS_CONSOLE_DESCRIPTION "Create a general purpose DICOMDIR" +#endif + +#if defined (HAVE_WINDOWS_H) || defined(HAVE_FNMATCH_H) +#define PATTERN_MATCHING_AVAILABLE +#endif + + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +static OFLogger dcmgpdirLogger = OFLog::getLogger("dcmtk.dcmdata." OFFIS_CONSOLE_APPLICATION); + +#define SHORTCOL 4 +#define LONGCOL 23 + +// ******************************************** + +// this macro either expands to main() or wmain() +DCMTK_MAIN_FUNCTION +{ + OFBool opt_write = OFTrue; + OFBool opt_append = OFFalse; + OFBool opt_update = OFFalse; + OFBool opt_recurse = OFFalse; + E_EncodingType opt_enctype = EET_ExplicitLength; + E_GrpLenEncoding opt_glenc = EGL_withoutGL; + OFFilename opt_output(DEFAULT_DICOMDIR_NAME); + const char *opt_fileset = DEFAULT_FILESETID; + const char *opt_descriptor = NULL; + const char *opt_charset = DEFAULT_DESCRIPTOR_CHARSET; + OFFilename opt_directory; + OFFilename opt_pattern; + DicomDirInterface::E_ApplicationProfile opt_profile = DicomDirInterface::AP_GeneralPurpose; + +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + // register global decompression codecs (no verbose/debug mode set) + DcmRLEDecoderRegistration::registerCodecs(); + DJDecoderRegistration::registerCodecs(); + // enable the following lines for JPEG 2000 decompression support +/* + D2JPEG2000Library::initialize(); + D2DecoderRegistration::registerCodecs(); +*/ +#endif + + /* DICOMDIR interface (checks for JPEG/RLE availability) */ + DicomDirInterface ddir; + + /* set-up command line parameters and options */ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, OFFIS_CONSOLE_DESCRIPTION, rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "ref. DICOM file (or directory to be scanned)", OFCmdParam::PM_MultiOptional); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("DICOMDIR identifiers:"); + cmd.addOption("--fileset-id", "+F", 1, "[i]d: string", + "use specific file-set ID\n(default: " DEFAULT_FILESETID ", \"\" for none)"); + cmd.addOption("--descriptor", "+R", 1, "[f]ilename: string", + "add a file-set descriptor file ID\n(e.g. README, default: no descriptor)"); + cmd.addOption("--char-set", "+C", 1, "[c]harset: string", + "add a specific character set for descriptor\n(default: \"" DEFAULT_DESCRIPTOR_CHARSET "\" if descriptor present)"); + cmd.addSubGroup("reading:"); + cmd.addOption("--input-directory", "+id", 1, "[d]irectory: string", + "read referenced DICOM files from directory d\n(default for --recurse: current directory)"); + cmd.addOption("--keep-filenames", "-m", "expect filenames to be in DICOM format (def.)"); + cmd.addOption("--map-filenames", "+m", "map to DICOM filenames (lowercase->uppercase,\nand remove trailing period)"); + cmd.addOption("--no-recurse", "-r", "do not recurse within directories (default)"); + cmd.addOption("--recurse", "+r", "recurse within filesystem directories"); +#ifdef PATTERN_MATCHING_AVAILABLE + cmd.addOption("--pattern", "+p", 1, "[p]attern: string (only with --recurse)", + "pattern for filename matching (wildcards)"); +#endif + cmd.addGroup("processing options:"); + cmd.addSubGroup("consistency check:"); + cmd.addOption("--no-consistency-check", "-W", "do not check files for consistency"); + cmd.addOption("--warn-inconsist-files", "+W", "warn about inconsistent files (default)"); + cmd.addOption("--abort-inconsist-file", "-a", "abort on first inconsistent file"); + cmd.addSubGroup("type 1 attributes:"); + cmd.addOption("--strict", "-I", "exit with error if DICOMDIR type 1 attributes\nare missing in DICOM file (default)"); + cmd.addOption("--invent", "+I", "invent DICOMDIR type 1 attributes\nif missing in DICOM file"); + cmd.addOption("--invent-patient-id", "+Ipi", "invent new PatientID in case of inconsistent\nPatientName attributes"); + cmd.addSubGroup("other checks:"); + cmd.addOption("--allow-retired-sop", "+Nrs", "allow retired SOP classes defined in previous\neditions of the DICOM standard"); + cmd.addOption("--no-xfer-check", "-Nxc", "do not reject images with non-standard\ntransfer syntax (just warn)"); +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + cmd.addOption("--no-encoding-check", "-Nec", "do not reject images with non-standard\npixel encoding (just warn)"); + cmd.addOption("--no-resolution-check", "-Nrc", "do not reject images with non-standard\nspatial resolution (just warn)"); + cmd.addSubGroup("icon images:"); + cmd.addOption("--add-icon-image", "+X", "add monochrome icon image on IMAGE level\n(default for cardiac profiles)"); + cmd.addOption("--icon-image-size", "-Xs", 1, "[s]ize: integer (1..128)", + "width and height of the icon image (in pixel)\n(fixed: 128 for XA, 64 for CT/MR profile)"); + cmd.addOption("--icon-file-prefix", "-Xi", 1, "[p]refix: string", + "use PGM image 'prefix'+'dcmfile-in' as icon\n(default: create icon from DICOM image)"); + cmd.addOption("--default-icon", "-Xd", 1, "[f]ilename: string", + "use specified PGM image if icon cannot be\ncreated automatically (default: black image)"); +#endif + cmd.addGroup("output options:"); + cmd.addSubGroup("DICOMDIR file:"); + cmd.addOption("--output-file", "+D", 1, "[f]ilename: string", + "generate specific DICOMDIR file\n(default: " DEFAULT_DICOMDIR_NAME " in current directory)"); +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + cmd.addSubGroup("profiles:"); + cmd.addOption("--general-purpose", "-Pgp", "General Purpose Interchange on CD-R or\nDVD-RAM Media (STD-GEN-CD/DVD-RAM, default)"); + cmd.addOption("--general-dvd-jpeg", "-Pdv", "General Purpose DVD Interchange with JPEG\n(STD-GEN-DVD-JPEG)"); + cmd.addOption("--general-dvd-j2k", "-Pd2", "General Purpose DVD Interchange with JPEG\n2000 (STD-GEN-DVD-J2K)"); + cmd.addOption("--general-bd-jpeg", "-Pbd", "General Purpose BD Interchange with JPEG\n(STD-GEN-BD-JPEG)"); + cmd.addOption("--general-bd-j2k", "-Pb2", "General Purpose BD Interchange with JPEG\n2000 (STD-GEN-BD-J2K)"); + cmd.addOption("--general-bd-mpeg2-mpml", "-Pbm", "General Purpose BD Interchange with MPEG2\nMP@ML (STD-GEN-BD-MPEG2-MPML)"); + cmd.addOption("--general-bd-mpeg2-mphl", "-Pbh", "General Purpose BD Interchange with MPEG2\nMP@HL (STD-GEN-BD-MPEG2-MPHL)"); + cmd.addOption("--general-bd-mpeg4-hp", "-Pba", "General Purpose BD Interchange with MPEG-4\nAVC/H.264 HiP@Level4.1\n(STD-GEN-BD-MPEG4-HPLV41)"); + cmd.addOption("--general-bd-mpeg4-hpbd", "-Pbb", "General Purpose BD Interchange with MPEG-4\nAVC/H.264 BD-Compatible HiP@Level4.1\n(STD-GEN-BD-MPEG4-HPLV41BD)"); + cmd.addOption("--general-bd-mpeg4-hp2d", "General Purpose BD Interchange with MPEG-4\nAVC/H.264 HiP@Level4.2 for 2D video\n(STD-GEN-BD-MPEG4-HPLV42-2D)"); + cmd.addOption("--general-bd-mpeg4-hp3d", "General Purpose BD Interchange with MPEG-4\nAVC/H.264 HiP@Level4.2 for 3D video\n(STD-GEN-BD-MPEG4-HPLV42-3D)"); + cmd.addOption("--general-bd-mpeg4-hpst", "General Purpose BD Interchange with MPEG-4\nAVC/H.264 Stereo HiP@Level4.2\n(STD-GEN-BD-MPEG4-SHPLV42)"); + cmd.addOption("--usb-and-flash-jpeg", "-Pfl", "General Purpose USB/Flash Memory Interchange\nwith JPEG (STD-GEN-USB/MMC/CF/SD-JPEG)"); + cmd.addOption("--usb-and-flash-j2k", "-Pf2", "General Purpose USB/Flash Memory Interchange\nwith JPEG 2000 (STD-GEN-USB/MMC/CF/SD-J2K)"); + cmd.addOption("--general-mime", "-Pmi", "General Purpose MIME Interchange\n(STD-GEN-MIME)"); + cmd.addOption("--mpeg2-mpml-dvd", "-Pmp", "DVD Interchange with MPEG2 Main Profile @\nMain Level (STD-DVD-MPEG2-MPML)"); + cmd.addOption("--basic-cardiac", "-Pbc", "Basic Cardiac X-Ray Angiographic Studies on\nCD-R Media (STD-XABC-CD)"); + cmd.addOption("--xray-angiographic", "-Pxa", "1024 X-Ray Angiographic Studies on CD-R Media\n(STD-XA1K-CD)"); + cmd.addOption("--xray-angiographic-dvd", "-Pxd", "1024 X-Ray Angiographic Studies on DVD Media\n(STD-XA1K-DVD)"); + cmd.addOption("--dental-radiograph", "-Pde", "Dental Radiograph Interchange (STD-DEN-CD)"); + cmd.addOption("--ct-and-mr", "-Pcm", "CT/MR Studies (STD-CTMR-xxxx)"); + cmd.addOption("--ultrasound-id-sf", "-Pus", "Ultrasound Single Frame for Image Display\n(STD-US-ID-SF-xxxx)"); + cmd.addOption("--ultrasound-sc-sf", "Ultrasound Single Frame with Spatial\nCalibration (STD-US-SC-SF-xxxx)"); + cmd.addOption("--ultrasound-cc-sf", "Ultrasound Single Frame with Combined\nCalibration (STD-US-CC-SF-xxxx)"); + cmd.addOption("--ultrasound-id-mf", "-Pum", "Ultrasound Single & Multi-Frame for Image\nDisplay (STD-US-ID-MF-xxxx)"); + cmd.addOption("--ultrasound-sc-mf", "Ultrasound Single & Multi-Frame with Spatial\nCalibration (STD-UD-SC-MF-xxxx)"); + cmd.addOption("--ultrasound-cc-mf", "Ultrasound Single & Multi-Frame with Combined\nCalibration (STD-UD-CC-MF-xxxx)"); + cmd.addOption("--12-lead-ecg", "-Pec", "12-lead ECG Interchange on Diskette\n(STD-WVFM-ECG-FD)"); + cmd.addOption("--hemodynamic-waveform", "-Phd", "Hemodynamic Waveform Interchange on Diskette\n(STD-WVFM-HD-FD)"); +#endif + cmd.addSubGroup("writing:"); + cmd.addOption("--replace", "-A", "replace existing DICOMDIR (default)"); + cmd.addOption("--append", "+A", "append to existing DICOMDIR"); + cmd.addOption("--update", "+U", "update existing DICOMDIR"); + cmd.addOption("--discard", "-w", "do not write out DICOMDIR"); + cmd.addSubGroup("backup:"); + cmd.addOption("--create-backup", "create a backup of existing DICOMDIR (def.)"); + cmd.addOption("--no-backup", "-nb", "do not create a backup of existing DICOMDIR"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-remove", "-g", "write without group length elements (default)"); + cmd.addOption("--group-length-create", "+g", "write with group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* print help text and exit */ + if (cmd.getArgCount() == 0) + app.printUsage(); + + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(BUILD_DCMGPDIR_AS_DCMMKDIR) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + if (cmd.findOption("--fileset-id")) + app.checkValue(cmd.getValue(opt_fileset)); + if (cmd.findOption("--descriptor")) + app.checkValue(cmd.getValue(opt_descriptor)); + if (cmd.findOption("--char-set")) + app.checkValue(cmd.getValue(opt_charset)); + + if (cmd.findOption("--input-directory")) + app.checkValue(cmd.getValue(opt_directory)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--keep-filenames")) + ddir.enableMapFilenamesMode(OFFalse); + if (cmd.findOption("--map-filenames")) + ddir.enableMapFilenamesMode(OFTrue); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-recurse")) + opt_recurse = OFFalse; + if (cmd.findOption("--recurse")) + { + opt_recurse = OFTrue; + if (opt_directory.isEmpty()) + opt_directory.set(".", OFTrue /*convert*/); + } + cmd.endOptionBlock(); + +#ifdef PATTERN_MATCHING_AVAILABLE + if (cmd.findOption("--pattern")) + { + app.checkDependence("--pattern", "--recurse", opt_recurse); + app.checkValue(cmd.getValue(opt_pattern)); + } +#endif + + /* processing options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--no-consistency-check")) + ddir.disableConsistencyCheck(); + if (cmd.findOption("--warn-inconsist-files")) + ddir.enableAbortMode(OFFalse); + if (cmd.findOption("--abort-inconsist-file")) + ddir.enableAbortMode(OFTrue); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--strict")) + ddir.enableInventMode(OFFalse); + if (cmd.findOption("--invent")) + ddir.enableInventMode(OFTrue); + cmd.endOptionBlock(); + + if (cmd.findOption("--invent-patient-id")) + ddir.enableInventPatientIDMode(); + + if (cmd.findOption("--allow-retired-sop")) + ddir.enableRetiredSOPClassSupport(); + if (cmd.findOption("--no-xfer-check")) + ddir.disableTransferSyntaxCheck(); + +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + if (cmd.findOption("--no-encoding-check")) + ddir.disableEncodingCheck(); + if (cmd.findOption("--no-resolution-check")) + ddir.disableResolutionCheck(); + if (cmd.findOption("--add-icon-image")) + ddir.enableIconImageMode(); + if (cmd.findOption("--icon-image-size")) + { + OFCmdUnsignedInt iconSize = 0; + app.checkValue(cmd.getValueAndCheckMinMax(iconSize, 1, 128)); + ddir.setIconSize(OFstatic_cast(unsigned int, iconSize)); + } + if (cmd.findOption("--icon-file-prefix")) + { + OFFilename iconPrefix; + app.checkValue(cmd.getValue(iconPrefix)); + ddir.setIconPrefix(iconPrefix); + } + if (cmd.findOption("--default-icon")) + { + OFFilename defaultIcon; + app.checkValue(cmd.getValue(defaultIcon)); + ddir.setDefaultIcon(defaultIcon); + } +#endif + + /* output options */ + if (cmd.findOption("--output-file")) + app.checkValue(cmd.getValue(opt_output)); + +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + cmd.beginOptionBlock(); + if (cmd.findOption("--general-purpose")) + opt_profile = DicomDirInterface::AP_GeneralPurpose; + if (cmd.findOption("--general-dvd-jpeg")) + opt_profile = DicomDirInterface::AP_GeneralPurposeDVDJPEG; + if (cmd.findOption("--general-dvd-j2k")) + opt_profile = DicomDirInterface::AP_GeneralPurposeDVDJPEG2000; + if (cmd.findOption("--general-bd-jpeg")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDJPEG; + if (cmd.findOption("--general-bd-j2k")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDJPEG2000; + if (cmd.findOption("--general-bd-mpeg2-mpml")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDMPEG2MPatML; + if (cmd.findOption("--general-bd-mpeg2-mphl")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDMPEG2MPatHL; + if (cmd.findOption("--general-bd-mpeg4-hp")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDMPEG4HPatLV41; + if (cmd.findOption("--general-bd-mpeg4-hpbd")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDMPEG4HPatLV41BD; + if (cmd.findOption("--general-bd-mpeg4-hp2d")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDMPEG4HPatLV42_2D; + if (cmd.findOption("--general-bd-mpeg4-hp3d")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDMPEG4HPatLV42_3D; + if (cmd.findOption("--general-bd-mpeg4-hpst")) + opt_profile = DicomDirInterface::AP_GeneralPurposeBDMPEG4StereoHPatLV42; + if (cmd.findOption("--usb-and-flash-jpeg")) + opt_profile = DicomDirInterface::AP_USBandFlashJPEG; + if (cmd.findOption("--usb-and-flash-j2k")) + opt_profile = DicomDirInterface::AP_USBandFlashJPEG2000; + if (cmd.findOption("--general-mime")) + opt_profile = DicomDirInterface::AP_GeneralPurposeMIME; + if (cmd.findOption("--mpeg2-mpml-dvd")) + opt_profile = DicomDirInterface::AP_MPEG2MPatMLDVD; + if (cmd.findOption("--basic-cardiac")) + opt_profile = DicomDirInterface::AP_BasicCardiac; + if (cmd.findOption("--xray-angiographic")) + opt_profile = DicomDirInterface::AP_XrayAngiographic; + if (cmd.findOption("--xray-angiographic-dvd")) + opt_profile = DicomDirInterface::AP_XrayAngiographicDVD; + if (cmd.findOption("--dental-radiograph")) + opt_profile = DicomDirInterface::AP_DentalRadiograph; + if (cmd.findOption("--ct-and-mr")) + opt_profile = DicomDirInterface::AP_CTandMR; + if (cmd.findOption("--ultrasound-id-sf")) + opt_profile = DicomDirInterface::AP_UltrasoundIDSF; + if (cmd.findOption("--ultrasound-sc-sf")) + opt_profile = DicomDirInterface::AP_UltrasoundSCSF; + if (cmd.findOption("--ultrasound-cc-sf")) + opt_profile = DicomDirInterface::AP_UltrasoundCCSF; + if (cmd.findOption("--ultrasound-id-mf")) + opt_profile = DicomDirInterface::AP_UltrasoundIDMF; + if (cmd.findOption("--ultrasound-sc-mf")) + opt_profile = DicomDirInterface::AP_UltrasoundSCMF; + if (cmd.findOption("--ultrasound-cc-mf")) + opt_profile = DicomDirInterface::AP_UltrasoundCCMF; + if (cmd.findOption("--12-lead-ecg")) + opt_profile = DicomDirInterface::AP_TwelveLeadECG; + if (cmd.findOption("--hemodynamic-waveform")) + opt_profile = DicomDirInterface::AP_HemodynamicWaveform; + cmd.endOptionBlock(); +#endif + + cmd.beginOptionBlock(); + if (cmd.findOption("--replace")) + { + opt_write = OFTrue; + opt_append = OFFalse; + opt_update = OFFalse; + } + if (cmd.findOption("--append")) + { + opt_write = OFTrue; + opt_append = OFTrue; + opt_update = OFFalse; + } + if (cmd.findOption("--update")) + { + opt_write = OFTrue; + opt_append = OFFalse; + opt_update = OFTrue; + } + if (cmd.findOption("--discard")) + { + opt_write = OFFalse; + opt_append = OFFalse; + opt_update = OFFalse; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--create-backup")) + ddir.disableBackupMode(OFTrue); + if (cmd.findOption("--no-backup")) + ddir.disableBackupMode(OFFalse); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) + dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) + dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-create")) + opt_glenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) + opt_glenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) + opt_enctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) + opt_enctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + /* post check */ + if ((opt_profile == DicomDirInterface::AP_BasicCardiac) || + (opt_profile == DicomDirInterface::AP_XrayAngiographic) || + (opt_profile == DicomDirInterface::AP_CTandMR)) + { + app.checkConflict("--icon-image-size", "--basic-cardiac, --xray-angiographic or --ct-and-mr", cmd.findOption("--icon-image-size")); + } + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmgpdirLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_FATAL(dcmgpdirLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + return 1; /* DcmDicomDir class dumps core when no data dictionary present */ + } + + /* make sure input directory exists (if specified) */ + if (!opt_directory.isEmpty()) + { + if (!OFStandard::dirExists(opt_directory)) + { + OFLOG_FATAL(dcmgpdirLogger, OFFIS_CONSOLE_APPLICATION << ": specified input directory does not exist"); + return 1; + } + } + + /* create list of input files */ + OFFilename paramValue; + OFFilename pathName; + OFList fileNames; + const int count = cmd.getParamCount(); + if (opt_recurse) + OFLOG_INFO(dcmgpdirLogger, "determining input files ..."); + /* no parameters? */ + if (count == 0) + { + if (opt_recurse) + OFStandard::searchDirectoryRecursively(OFFilename(), fileNames, opt_pattern, opt_directory); + else + app.printError("Missing parameter dcmfile-in"); + } else { + /* iterate over all input filenames */ + for (int i = 1; i <= count; i++) + { + cmd.getParam(i, paramValue); + /* add input directory */ + OFStandard::combineDirAndFilename(pathName, opt_directory, paramValue, OFTrue /*allowEmptyDirName*/); + /* search directory recursively (if required) */ + if (OFStandard::dirExists(pathName)) + { + if (opt_recurse) + OFStandard::searchDirectoryRecursively(paramValue, fileNames, opt_pattern, opt_directory); + else + OFLOG_WARN(dcmgpdirLogger, "ignoring directory because option --recurse is not set: " << paramValue); + } else + fileNames.push_back(paramValue); + } + } + /* check whether there are any input files */ + if (fileNames.empty()) + { + OFLOG_FATAL(dcmgpdirLogger, "no input files: DICOMDIR not created"); + return 1; + } + +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + // add image support to DICOMDIR class + DicomDirImageImplementation imagePlugin; + ddir.addImageSupport(&imagePlugin); +#endif + + OFCondition result; + const char *action = ""; + /* create new general purpose DICOMDIR, append to or update existing one */ + if (opt_append) + { + action = "appending"; + result = ddir.appendToDicomDir(opt_profile, opt_output); + } + else if (opt_update) + { + action = "updating"; + result = ddir.updateDicomDir(opt_profile, opt_output); + } else { + action = "creating"; + result = ddir.createNewDicomDir(opt_profile, opt_output, opt_fileset); + } + if (result.good()) + { + /* set fileset descriptor and character set */ + result = ddir.setFilesetDescriptor(opt_descriptor, opt_charset); + if (result.good()) + { + /* collect 'bad' files */ + OFList badFiles; + unsigned int goodFiles = 0; + OFListIterator(OFFilename) iter = fileNames.begin(); + OFListIterator(OFFilename) last = fileNames.end(); + /* iterate over all input filenames */ + while ((iter != last) && result.good()) + { + /* add files to the DICOMDIR */ + result = ddir.addDicomFile((*iter), opt_directory); + if (result.bad()) + { + badFiles.push_back(*iter); + if (!ddir.abortMode()) + { + /* ignore inconsistent file, just warn (already done inside "ddir") */ + result = EC_Normal; + } + } else + ++goodFiles; + ++iter; + } + /* evaluate result of file checking/adding procedure */ + if (goodFiles == 0) + { + OFLOG_ERROR(dcmgpdirLogger, "no good files: DICOMDIR not created"); + result = EC_IllegalCall; + } + else if (!badFiles.empty()) + { + OFOStringStream oss; + oss << badFiles.size() << " file(s) cannot be added to DICOMDIR: "; + iter = badFiles.begin(); + last = badFiles.end(); + while (iter != last) + { + oss << OFendl << " " << (*iter); + ++iter; + } + oss << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + OFLOG_WARN(dcmgpdirLogger, tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + /* write DICOMDIR file */ + if (result.good() && opt_write) + { + action = "writing"; + result = ddir.writeDicomDir(opt_enctype, opt_glenc); + } + } + } + + /* some final error reporting */ + if (result.bad() && (result != EC_IllegalCall)) + { + OFLOG_FATAL(dcmgpdirLogger, OFFIS_CONSOLE_APPLICATION << ": error (" + << result.text() << ") " << action << " file: " << opt_output); + } + +#ifdef BUILD_DCMGPDIR_AS_DCMMKDIR + // deregister global decompression codecs + DcmRLEDecoderRegistration::cleanup(); + DJDecoderRegistration::cleanup(); + // enable the following lines for JPEG 2000 decompression support +/* + D2DecoderRegistration::cleanup(); + D2JPEG2000Library::cleanup(); +*/ +#endif + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + + return result.status(); +} diff --git a/dcmdata/apps/dcmodify.cc b/dcmdata/apps/dcmodify.cc new file mode 100644 index 00000000..c3cad29e --- /dev/null +++ b/dcmdata/apps/dcmodify.cc @@ -0,0 +1,40 @@ +/* + * + * Copyright (C) 2003-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Commandline-Application to modify tags in DICOM-Files + * + */ + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first +#include "mdfconen.h" +#include "dcmtk/dcmdata/dcpath.h" + +#define OFFIS_CONSOLE_APPLICATION "dcmodify" + +static OFLogger dcmodifyLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +int main(int argc, char *argv[]) +{ + int error_count = 0; + MdfConsoleEngine engine(argc, argv, OFFIS_CONSOLE_APPLICATION); + error_count = engine.startProvidingService(); + if (error_count == 1) + OFLOG_ERROR(dcmodifyLogger, "There was 1 error"); + else if (error_count > 1) + OFLOG_ERROR(dcmodifyLogger, "There were " << error_count << " errors"); + return(error_count); +} diff --git a/dcmdata/apps/dump2dcm.cc b/dcmdata/apps/dump2dcm.cc new file mode 100644 index 00000000..a863df79 --- /dev/null +++ b/dcmdata/apps/dump2dcm.cc @@ -0,0 +1,1096 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: create a Dicom FileFormat or DataSet from an ASCII-dump + * + */ + +/* + * Input File Description: + * The input file can be an output of dcmdump. One element (tag, VR, value) + * must be written into one line separated by arbitrary spaces or tab characters. + * A '#' begins a comment that ends at the line end. Empty lines are allowed. + * The individual parts of a line have the following syntax: + * Tag: (gggg,eeee) + * with gggg and eeee are 4 character hexadecimal values representing + * group and element tag. Spaces and tabs can be anywhere in a tag + * specification. + * VR: Value Representation must be written as 2 characters as in Part 6 + * of the DICOM standard. No spaces or tabs are allowed between the + * two characters. If the VR can determined from the tag, this part + * of a line is optional. + * Value: There are several rules for writing values: + * 1. US, SS, SL, UL, FD, FL, OD, OF and OL are written as decimal + * strings that can be read by scanf(). + * 2. AT is written as '(gggg,eeee)' with additional spaces stripped + * off automatically and gggg and eeee being decimal strings that + * can be read by scanf(). + * 3. OB and OW values are written as byte or word hexadecimal values + * separated by '\' character. Alternatively, OB or OW values can + * be read from a separate file by writing the filename prefixed + * by a '=' character (e.g. '=largepix.dat'). The contents of the + * file will be read as is. By default, OW data is expected to be + * little endian ordered and will be swapped if necessary. No + * checks will be made to ensure that the amount of data is + * reasonable in terms of other attributes such as Rows or Columns. + * In case of compressed pixel data, the line should start with + * '(7fe0,0010) OB (PixelSequence' in order to distinguish from + * uncompressed pixel data. + * 4. UI is written as '=Name' in data dictionary or as unique + * identifier string (see 6.) , e.g. '[1.2.840.....]' + * 5. Strings without () <> [] spaces, tabs and # can be written + * directly. + * 6. Other strings must be surrounded by '[' and ']'. No bracket + * structure is passed. The value ends at the last ']' in the + * line. Anything after the ']' is interpreted as comment. + * 7. '(' and '<' are interpreted special and may not be used when + * writing an input file by hand as beginning characters of a + * string. Multiple Value are separated by '\'. The sequence of + * lines must not be ordered but they can. References in DICOM + * Directories are not supported. Semantic errors are not detected. + * + * Examples: + * (0008,0020) DA [19921012] # 8, 1 StudyDate + * (0008,0016) UI =MRImageStorage # 26, 1 SOPClassUID + * (0002,0012) UI [1.2.276.0.7230010.100.1.1] + * (0020,0032) DS [0.0\0.0] # 8, 2 ImagePositionPatient + * (0028,0009) AT (3004,000c) # 4, 1 FrameIncrementPointer + * (0028,0010) US 256 # 4, 1 Rows + * (0002,0001) OB 01\00 + * + */ + +#include "dcmtk/config/osconfig.h" + +// if defined, use createValueFromTempFile() for large binary data files +//#define EXPERIMENTAL_READ_FROM_FILE + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ + +#ifdef EXPERIMENTAL_READ_FROM_FILE +#include "dcmtk/dcmdata/dcistrmf.h" /* for class DcmInputFileStream */ +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dump2dcm" + +static OFLogger dump2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define SHORTCOL 3 +#define LONGCOL 21 + +// Maximum Line Size (default) + +const unsigned int DCM_DumpMaxLineSize = 4096; + +// Global variables + +static E_ByteOrder opt_fileContentsByteOrdering = EBO_LittleEndian; + +// Field definition separators + +#define DCM_DumpCommentChar '#' +#define DCM_DumpTagDelim ')' +#define DCM_DumpOpenString '[' +#define DCM_DumpCloseString ']' +#define DCM_DumpOpenDescription '(' +#define DCM_DumpOpenFile '<' +#define DCM_DumpCloseFile '>' + +#define TO_UCHAR(s) OFstatic_cast(unsigned char, (s)) +static void +stripWhitespace(char *s) +{ + char *p; + + if (s == NULL) return; + + p = s; + while (*s != '\0') { + if (isspace(TO_UCHAR(*s)) == OFFalse) { + *p++ = *s; + } + s++; + } + *p = '\0'; +} + +static char * +stripTrailingWhitespace(char *s) +{ + if (s == NULL) return s; + for (size_t i = strlen(s); i > 0 && isspace(TO_UCHAR(s[--i])); s[i] = '\0'); + return s; +} + + +static char * +stripPrecedingWhitespace(char *s) +{ + char *p; + if (s == NULL) return s; + + for(p = s; *p && isspace(TO_UCHAR(*p)); p++) + ; + + return p; +} + +static OFBool +onlyWhitespace(const char *s) +{ + while(*s) if (!isspace(TO_UCHAR(*s++))) + return OFFalse; + return OFTrue; +} + +static char * +getLine(char *line, int maxLineLen, FILE *f, const unsigned long lineNumber) +{ + char *s; + + s = fgets(line, maxLineLen, f); + + // if line is too long, throw rest of it away + if (s && strlen(s) == size_t(maxLineLen - 1) && s[maxLineLen - 2] != '\n') + { + int c = fgetc(f); + while(c != '\n' && c != EOF) + c = fgetc(f); + OFLOG_ERROR(dump2dcmLogger, "line " << lineNumber << " too long"); + } + + /* strip any trailing white space */ + stripTrailingWhitespace(s); + + return s; +} + +static OFBool +isaCommentLine(const char *s) +{ + // skip leading spaces + while(isspace(TO_UCHAR(*s))) ++s; + return *s == DCM_DumpCommentChar; +} + +static OFBool +parseTag(char *&s, DcmTagKey &key) +{ + OFBool ok = OFTrue; + char *p; + unsigned int g, e; + + // find tag begin + p = strchr(s, DCM_DumpTagDelim); + if (p) + { + // string all white spaces and read tag + size_t len = p - s + 1; + p = new char[len + 1]; + OFStandard::strlcpy(p, s, len + 1); + stripWhitespace(p); + s += len; + + if (sscanf(p, "(%x,%x)", &g, &e) == 2) + key.set(OFstatic_cast(Uint16, g), OFstatic_cast(Uint16, e)); + else + ok = OFFalse; + delete[] p; + } + else ok = OFFalse; + + return ok; +} + + +static OFBool +parseVR(char *&s, DcmEVR &vr) +{ + OFBool ok = OFTrue; + + s = stripPrecedingWhitespace(s); + + // Are there two upper characters? + if (isupper(TO_UCHAR(*s)) && isupper(TO_UCHAR(*(s + 1)))) + { + char c_vr[3]; + OFStandard::strlcpy(c_vr, s, 3); + // Convert to VR + DcmVR dcmVR(c_vr); + vr = dcmVR.getEVR(); + s += 2; + } + else if ((*s == 'p') && (*(s + 1) == 'i')) + { + vr = EVR_pixelItem; + s += 2; + } + else if (((*s == 'o') && (*(s + 1) == 'x')) || + ((*s == 'x') && (*(s + 1) == 's')) || + ((*s == 'n') && (*(s + 1) == 'a')) || + ((*s == 'u') && (*(s + 1) == 'p'))) + { + // swallow internal VRs + vr = EVR_UNKNOWN; + s += 2; + } + // dcmdump uses "??" in case of "Unknown Tag & Data" and implicit VR + else if ((*s == '?') && (*(s + 1) == '?')) + { + vr = EVR_UNKNOWN; + s += 2; + } + else ok = OFFalse; + + return ok; +} +#undef TO_UCHAR + + +static size_t +searchLastClose(char *s, const char closeChar) +{ + // search last close bracket in a line + // no bracket structure will be considered + + char *found = NULL; + char *p = s; + + while(p && *p) + { + p = strchr(p, closeChar); + if (p) + { + found = p; + p++; + } + } + + if (found) + return (found - s) + 1; + else + return 0; +} + + +static size_t +searchCommentOrEol(char *s) +{ + char *comment = strchr(s, DCM_DumpCommentChar); + if (comment) + return comment - s; + else if (s) + return strlen(s); + else + return 0; +} + + +static void +convertNewlineCharacters(char *s) +{ + // convert the string "\n" into the \r\n combination required by DICOM + if (s) for (; *s; ++s) if (*s == '\\' && *(s+1) == 'n') + { + *s = '\r'; + *++s = '\n'; + } +} + +static OFBool +parseValue(char *&s, char *&value, DcmEVR &vr, const DcmTagKey &tagkey) +{ + OFBool ok = OFTrue; + size_t len; + value = NULL; + + s = stripPrecedingWhitespace(s); + + switch (*s) + { + case DCM_DumpOpenString: + len = searchLastClose(s, DCM_DumpCloseString); + if (len == 0) + ok = OFFalse; + else if (len > 2) + { + value = new char[len - 1]; + OFStandard::strlcpy(value, s + 1, len - 1); + convertNewlineCharacters(value); + } + else + value = NULL; + break; + + case DCM_DumpOpenDescription: + /* need to distinguish VR=AT from description field */ + /* NB: if the VR is unknown this workaround will not succeed */ + if (vr == EVR_AT) + { + len = searchLastClose(s, DCM_DumpTagDelim); + if (len >= 11) // (gggg,eeee) allow non-significant spaces + { + char *pv = s; + DcmTagKey tag; + if (parseTag(pv, tag)) // check for valid tag format + { + value = new char[len + 1]; + OFStandard::strlcpy(value, s, len + 1); + stripWhitespace(value); + } else + ok = OFFalse; // skip description + } + else + ok = OFFalse; // skip description + } + /* need to distinguish pixel sequence */ + else if ((tagkey == DCM_PixelData) && (vr == EVR_OB)) + { + if (strncmp(s + 1, "PixelSequence", 13) == 0) + vr = EVR_pixelSQ; + } + break; + + case DCM_DumpOpenFile: + ok = OFFalse; // currently not supported + break; + + case DCM_DumpCommentChar: + break; + + default: + len = searchCommentOrEol(s); + if (len) + { + value = new char[len + 1]; + OFStandard::strlcpy(value, s, len + 1); + stripTrailingWhitespace(value); + } + break; + } + return ok; +} + +static OFCondition +putFileContentsIntoElement(DcmElement *elem, const char *filename) +{ + OFCondition ec = EC_Normal; +#ifdef EXPERIMENTAL_READ_FROM_FILE + /* create stream object for binary file */ + DcmInputFileStream fileStream(filename); + ec = fileStream.status(); + if (ec.good()) + { + /* NB: if size is odd file will be rejected */ + const size_t fileLen = OFStandard::getFileSize(filename); + /* read element value from binary file (requires even length) */ + ec = elem->createValueFromTempFile(fileStream.newFactory(), fileLen, EBO_LittleEndian); + if (ec.bad()) + OFLOG_ERROR(dump2dcmLogger, "cannot process binary data file: " << filename); + } else { + OFLOG_ERROR(dump2dcmLogger, "cannot open binary data file: " << filename); + ec = EC_InvalidTag; + } +#else + FILE *f = NULL; + if ((f = fopen(filename, "rb")) == NULL) + { + OFLOG_ERROR(dump2dcmLogger, "cannot open binary data file: " << filename); + return EC_InvalidTag; + } + + const size_t len = OFStandard::getFileSize(filename); + size_t buflen = len; + if (buflen & 1) + buflen++; /* if odd then make even (DICOM requires even length values) */ + + Uint8 *buf = NULL; + const DcmEVR evr = elem->getVR(); + /* create buffer of OB or OW data */ + if (evr == EVR_OB || evr == EVR_pixelItem) + ec = elem->createUint8Array(OFstatic_cast(Uint32, buflen), buf); + else if (evr == EVR_OW) + { + Uint16 *buf16 = NULL; + ec = elem->createUint16Array(OFstatic_cast(Uint32, buflen / 2), buf16); + buf = OFreinterpret_cast(Uint8 *, buf16); + } else + ec = EC_IllegalCall; + if (ec.good()) + { + /* read binary file into the buffer */ + if (fread(buf, 1, len, f) != len) + { + OFLOG_ERROR(dump2dcmLogger, "error reading binary data file: " << filename + << ": " << OFStandard::getLastSystemErrorCode().message()); + ec = EC_CorruptedData; + } + else if (evr == EVR_OW) + { + /* swap 16 bit OW data (if necessary) */ + swapIfNecessary(gLocalByteOrder, opt_fileContentsByteOrdering, buf, OFstatic_cast(Uint32, buflen), sizeof(Uint16)); + } + } + else if (ec == EC_MemoryExhausted) + OFLOG_ERROR(dump2dcmLogger, "out of memory reading binary data file: " << filename); + else + OFLOG_ERROR(dump2dcmLogger, "illegal call processing binary data file: " << filename); + + fclose(f); +#endif + return ec; +} + +static OFCondition +insertIntoSet(DcmStack &stack, const E_TransferSyntax xfer, const DcmTagKey &tagkey, + const DcmEVR &vr, const char *value) +{ + // insert new element into dataset or metaheader + + OFCondition l_error = EC_Normal; + OFCondition newElementError = EC_Normal; + + if (stack.empty()) + l_error = EC_CorruptedData; + + if (l_error == EC_Normal) + { + DcmElement *newElement = NULL; + DcmObject *topOfStack = stack.top(); + + // convert tagkey to tag including VR + DcmTag tag(tagkey); + DcmVR dcmvr(vr); + + const DcmEVR tagvr = tag.getEVR(); + /* check VR and consider various special cases */ + if (tagvr != vr && vr != EVR_UNKNOWN && tagvr != EVR_UNKNOWN && + (tagkey != DCM_LUTData || (vr != EVR_US && vr != EVR_SS && vr != EVR_OW)) && + (tagkey != DCM_PixelData || (vr != EVR_OB && vr != EVR_OW && vr != EVR_pixelSQ)) && + (tagvr != EVR_xs || (vr != EVR_US && vr != EVR_SS)) && + (tagvr != EVR_ox || (vr != EVR_OB && vr != EVR_OW)) && + (tagvr != EVR_na || vr != EVR_pixelItem)) + { + OFLOG_WARN(dump2dcmLogger, "Tag " << tag << " with wrong VR '" + << dcmvr.getVRName() << "' found, correct is '" + << tag.getVR().getVRName() << "'"); + } + else if ((tagvr == EVR_UNKNOWN) && (vr == EVR_UNKNOWN)) + { + OFLOG_WARN(dump2dcmLogger, "VR of Tag " << tag << " is unknown, " + << "using 'UN' for this data element"); + } + + if (vr != EVR_UNKNOWN) + tag.setVR(dcmvr); + const DcmEVR newTagVR = tag.getEVR(); + + // create new element (special handling for pixel sequence and item) + if (newTagVR == EVR_pixelSQ) + newElement = new DcmPixelData(tag); + else if (newTagVR == EVR_pixelItem) + newElement = new DcmPixelItem(DCM_PixelItemTag); + else + newElementError = DcmItem::newDicomElementWithVR(newElement, tag); + + if (newElementError == EC_Normal) + { + // tag describes an element + if (!newElement) + { + // Tag was ambiguous - should never happen according to the current implementation of newDicomElement() + l_error = EC_InvalidVR; + } + else + { + // check for uncompressed pixel data (i.e. no pixel sequence present) + if (tagkey == DCM_PixelData && (newTagVR == EVR_OB || newTagVR == EVR_OW)) + OFstatic_cast(DcmPixelData *, newElement)->setNonEncapsulationFlag(OFTrue /*alwaysUnencapsulated*/); + // fill value + if (value) + { + if (value[0] == '=' && (newTagVR == EVR_OB || newTagVR == EVR_OW || newTagVR == EVR_pixelItem)) + { + /* + * Special case handling for OB, OW and pixel item data. + * Allow a value beginning with a '=' character to represent + * a file containing data to be used as the attribute value. + * A '=' character is not a normal value since OB and OW values + * must be written as multivalued hexadecimal (e.g. "00\ff\0d\8f"); + */ + l_error = putFileContentsIntoElement(newElement, value + 1); + } else { + l_error = newElement->putString(value); + } + } + + // insert element into hierarchy + if (l_error == EC_Normal) + { + switch(topOfStack->ident()) + { + case EVR_item: + case EVR_dirRecord: + case EVR_dataset: + case EVR_metainfo: + { + DcmItem *item = OFstatic_cast(DcmItem *, topOfStack); + item->insert(newElement); + // special handling for pixel sequence + if (newTagVR == EVR_pixelSQ) + { + DcmPixelSequence *pixelSeq = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSeq != NULL) + { + OFstatic_cast(DcmPixelData *, newElement)->putOriginalRepresentation(xfer, NULL, pixelSeq); + stack.push(pixelSeq); + } + } + else if (newElement->ident() == EVR_SQ) + stack.push(newElement); + } + break; + case EVR_pixelSQ: + if (newTagVR == EVR_pixelItem) + { + DcmPixelSequence *pixelSeq = OFstatic_cast(DcmPixelSequence *, topOfStack); + pixelSeq->insert(OFstatic_cast(DcmPixelItem *, newElement)); + } else + l_error = EC_InvalidTag; + break; + default: + l_error = EC_InvalidTag; + break; + } + } + } + } + else if (newElementError == EC_SequEnd) + { + // pop stack if stack object was a sequence + if (topOfStack->ident() == EVR_SQ || topOfStack->ident() == EVR_pixelSQ) + stack.pop(); + else + l_error = EC_InvalidTag; + } + else if (newElementError == EC_ItemEnd) + { + // pop stack if stack object was an item + switch (topOfStack->ident()) + { + case EVR_item: + case EVR_dirRecord: + case EVR_dataset: + case EVR_metainfo: + stack.pop(); + break; + + default: + l_error = EC_InvalidTag; + break; + } + } + else if (newElementError == EC_InvalidTag) + { + if (tag.getXTag() == DCM_Item) + { + DcmItem *item = NULL; + if (topOfStack->getTag().getXTag() == DCM_DirectoryRecordSequence) + { + // an Item must be pushed to the stack + item = new DcmDirectoryRecord(tag, 0); + OFstatic_cast(DcmSequenceOfItems *, topOfStack)->insert(item); + stack.push(item); + } + else if (topOfStack->ident() == EVR_SQ) + { + // an item must be pushed to the stack + item = new DcmItem(tag); + OFstatic_cast(DcmSequenceOfItems *, topOfStack)->insert(item); + stack.push(item); + } + else + l_error = EC_InvalidTag; + } + else + l_error = EC_InvalidTag; + } + else + l_error = EC_InvalidTag; + } + + return l_error; +} + +static OFBool +readDumpFile(DcmMetaInfo *metaheader, DcmDataset *dataset, + FILE *infile, const char *ifname, E_TransferSyntax &xfer, + const OFBool stopOnErrors, const unsigned long maxLineLength) +{ + char *lineBuf = new char[maxLineLength]; + int lineNumber = 0; + OFBool errorOnThisLine = OFFalse; + char *parse = NULL; + char *value = NULL; + DcmEVR vr = EVR_UNKNOWN; + int errorsEncountered = 0; + DcmTagKey tagkey; + DcmStack metaheaderStack; + DcmStack datasetStack; + xfer = EXS_Unknown; + + if (metaheader) + metaheaderStack.push(metaheader); + + datasetStack.push(dataset); + + while (getLine(lineBuf, OFstatic_cast(int, maxLineLength), infile, lineNumber + 1)) + { + lineNumber++; + + OFLOG_TRACE(dump2dcmLogger, "processing line " << lineNumber << " of the input file"); + + // ignore empty lines and comment lines + if (onlyWhitespace(lineBuf)) + continue; + if (isaCommentLine(lineBuf)) + continue; + + errorOnThisLine = OFFalse; + + parse = &lineBuf[0]; + + // parse tag an the line + if (!parseTag(parse, tagkey)) + { + OFLOG_ERROR(dump2dcmLogger, OFFIS_CONSOLE_APPLICATION ": "<< ifname << ": " + << "no Tag found (line " << lineNumber << ")"); + errorOnThisLine = OFTrue; + } + + // parse optional VR + if (!errorOnThisLine && !parseVR(parse, vr)) + vr = EVR_UNKNOWN; + + // parse optional value + if (!errorOnThisLine && !parseValue(parse, value, vr, tagkey)) + { + OFLOG_ERROR(dump2dcmLogger, OFFIS_CONSOLE_APPLICATION ": "<< ifname << ": " + << "incorrect value specification (line " << lineNumber << ")"); + errorOnThisLine = OFTrue; + } + + + // insert new element that consists of tag, VR, and value + if (!errorOnThisLine) + { + OFCondition l_error = EC_Normal; + if (tagkey.getGroup() == 0x0002) + { + if (metaheader) + { + l_error = insertIntoSet(metaheaderStack, xfer, tagkey, vr, value); + // check for transfer syntax in meta-header + if ((tagkey == DCM_TransferSyntaxUID) && (xfer == EXS_Unknown)) + { + const char *xferUID; + // use resolved value (UID) + if (metaheader->findAndGetString(DCM_TransferSyntaxUID, xferUID).good()) + xfer = DcmXfer(xferUID).getXfer(); + } + } + } + else + l_error = insertIntoSet(datasetStack, xfer, tagkey, vr, value); + + if (value) + { + delete[] value; + value = NULL; + } + if (l_error != EC_Normal) + { + errorOnThisLine = OFTrue; + OFLOG_ERROR(dump2dcmLogger, OFFIS_CONSOLE_APPLICATION ": " << ifname << ": Error in creating Element: " + << l_error.text() << " (line " << lineNumber << ")"); + } + + } + + if (errorOnThisLine) + errorsEncountered++; + } + + + // test blocking structure + if (metaheader && metaheaderStack.card() != 1) + { + OFLOG_ERROR(dump2dcmLogger, OFFIS_CONSOLE_APPLICATION ": " << ifname << ": Block Error in metaheader"); + errorsEncountered++; + } + + if (datasetStack.card() != 1) + { + OFLOG_ERROR(dump2dcmLogger, OFFIS_CONSOLE_APPLICATION ": " << ifname << ": Block Error in dataset"); + errorsEncountered++; + } + + delete[] lineBuf; + + if (errorsEncountered) + { + OFLOG_ERROR(dump2dcmLogger, errorsEncountered << " Errors found in " << ifname); + return !stopOnErrors; + } + else + return OFTrue; +} + +// ******************************************** + +int main(int argc, char *argv[]) +{ + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Convert ASCII dump to DICOM file", rcsid); + OFCommandLine cmd; + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dumpfile-in", "dump input filename"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:", LONGCOL, SHORTCOL + 2); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-meta-info", "+f", "read meta information if present (default)"); + cmd.addOption("--ignore-meta-info", "-f", "ignore file meta information"); + cmd.addSubGroup("file contents byte ordering:"); + cmd.addOption("--read-file-little", "+rl", "read OW data with little endian (default)"); + cmd.addOption("--read-file-big", "+rb", "read OW data from file with big endian"); + cmd.addSubGroup("other input options:"); + cmd.addOption("--line", "+l", 1, "[m]ax-length: integer", + "maximum line length m (default: 4096)"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("unique identifiers:"); + cmd.addOption("--generate-new-uids", "+Ug", "generate new Study/Series/SOP Instance UID"); + cmd.addOption("--dont-overwrite-uids", "-Uo", "do not overwrite existing UIDs (default)"); + cmd.addOption("--overwrite-uids", "+Uo", "overwrite existing UIDs"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addOption("--update-meta-info", "+Fu", "update particular file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); +#ifdef WITH_ZLIB + cmd.addOption("--write-xfer-deflated", "+td", "write with deflated expl. VR little endian TS"); +#endif + cmd.addSubGroup("error handling:"); + cmd.addOption("--stop-on-error", "-E", "do not write if dump is damaged (default)"); + cmd.addOption("--ignore-errors", "+E", "attempt to write even if dump is damaged"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding (default)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with --write-xfer-deflated):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + E_TransferSyntax opt_xfer = EXS_Unknown; + E_EncodingType opt_enctype = EET_ExplicitLength; + E_GrpLenEncoding opt_glenc = EGL_recalcGL; + E_PaddingEncoding opt_padenc = EPD_withoutPadding; + E_FileWriteMode opt_writeMode = EWM_fileformat; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + OFCmdUnsignedInt opt_linelength = DCM_DumpMaxLineSize; + OFBool opt_stopOnErrors = OFTrue; + OFBool opt_metaInfo = OFTrue; + OFBool opt_generateUIDs = OFFalse; + OFBool opt_overwriteUIDs = OFFalse; + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-meta-info")) opt_metaInfo = OFTrue; + if (cmd.findOption("--ignore-meta-info")) opt_metaInfo = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file-little")) opt_fileContentsByteOrdering = EBO_LittleEndian; + if (cmd.findOption("--read-file-big")) opt_fileContentsByteOrdering = EBO_BigEndian; + cmd.endOptionBlock(); + + if (cmd.findOption("--line")) + app.checkValue(cmd.getValueAndCheckMin(opt_linelength, 80)); + + /* processing options */ + + if (cmd.findOption("--generate-new-uids")) opt_generateUIDs = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--dont-overwrite-uids")) opt_overwriteUIDs = OFFalse; + if (cmd.findOption("--overwrite-uids")) opt_overwriteUIDs = OFTrue; + cmd.endOptionBlock(); + + /* output options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + if (cmd.findOption("--update-meta-info")) + { + app.checkConflict("--update-meta-info", "--write-dataset", opt_writeMode == EWM_dataset); + opt_writeMode = EWM_updateMeta; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_xfer = EXS_Unknown;; + if (cmd.findOption("--write-xfer-little")) opt_xfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_xfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_xfer = EXS_LittleEndianImplicit; +#ifdef WITH_ZLIB + if (cmd.findOption("--write-xfer-deflated")) opt_xfer = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--stop-on-error")) opt_stopOnErrors = OFTrue; + if (cmd.findOption("--ignore-errors")) opt_stopOnErrors = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_glenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_glenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_glenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_enctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_enctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_padenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_padenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_padenc = EPD_withPadding; + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + OFCmdUnsignedInt comprLevel = 0; + app.checkDependence("--compression-level", "--write-xfer-deflated", opt_xfer == EXS_DeflatedLittleEndianExplicit); + app.checkValue(cmd.getValueAndCheckMinMax(comprLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, comprLevel)); + } +#endif + } + + /* print resource identifier */ + OFLOG_DEBUG(dump2dcmLogger, rcsid << OFendl); + + DcmFileFormat fileformat; + DcmMetaInfo *metaheader = (opt_metaInfo) ? fileformat.getMetaInfo() : NULL; + DcmDataset *dataset = fileformat.getDataset(); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dump2dcmLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open input dump file + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dump2dcmLogger, "invalid input filename: "); + return 1; + } + OFLOG_INFO(dump2dcmLogger, "reading dump file: " << opt_ifname); + + FILE *dumpfile = fopen(opt_ifname, "r"); + if (!dumpfile) + { + OFLOG_FATAL(dump2dcmLogger, "input file does not exist: " << opt_ifname); + return 1; + } + + int status = 0; + E_TransferSyntax xfer; + // read dump file into metaheader and dataset + if (readDumpFile(metaheader, dataset, dumpfile, opt_ifname, xfer, opt_stopOnErrors, + OFstatic_cast(unsigned long, opt_linelength))) + { + /* generate new UIDs (if required) */ + if (opt_generateUIDs) + { + char uid[100]; + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_StudyInstanceUID)) + { + OFLOG_INFO(dump2dcmLogger, "generating new Study Instance UID"); + dataset->putAndInsertString(DCM_StudyInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT)); + } + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_SeriesInstanceUID)) + { + OFLOG_INFO(dump2dcmLogger, "generating new Series Instance UID"); + dataset->putAndInsertString(DCM_SeriesInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT)); + } + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_SOPInstanceUID)) + { + OFLOG_INFO(dump2dcmLogger, "generating new SOP Instance UID"); + dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT)); + /* make sure that the file meta information is updated correspondingly */ + if (opt_writeMode == EWM_fileformat) + opt_writeMode = EWM_updateMeta; + } + } + + // write into file format or dataset + OFLOG_INFO(dump2dcmLogger, "writing DICOM file"); + + /* determine transfer syntax to write the file */ + if (opt_xfer == EXS_Unknown) + { + opt_xfer = xfer; + /* check whether output xfer is still unknown */ + if (opt_xfer == EXS_Unknown) + { + OFLOG_WARN(dump2dcmLogger, "output transfer syntax unknown, assuming --write-xfer-little"); + opt_xfer = EXS_LittleEndianExplicit; + } + } + /* check whether it is possible to write the file */ + if (fileformat.canWriteXfer(opt_xfer)) + { + /* check whether pixel data is compressed */ + if ((opt_writeMode == EWM_dataset) && DcmXfer(xfer).isEncapsulated()) + { + OFLOG_WARN(dump2dcmLogger, "encapsulated pixel data require file format, ignoring --write-dataset"); + opt_writeMode = EWM_fileformat; + } + OFCondition l_error = fileformat.saveFile(opt_ofname, opt_xfer, opt_enctype, opt_glenc, opt_padenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + + if (l_error == EC_Normal) + { + OFLOG_INFO(dump2dcmLogger, "dump successfully converted"); + } else { + OFLOG_ERROR(dump2dcmLogger, l_error.text() << ": writing file: " << opt_ofname); + status = 1; + } + } else { + OFLOG_ERROR(dump2dcmLogger, "no conversion to transfer syntax " << DcmXfer(opt_xfer).getXferName() << " possible!"); + status = 2; + } + } + fclose(dumpfile); + + return status; +} diff --git a/dcmdata/apps/img2dcm.cc b/dcmdata/apps/img2dcm.cc new file mode 100644 index 00000000..e547b5ea --- /dev/null +++ b/dcmdata/apps/img2dcm.cc @@ -0,0 +1,420 @@ +/* + * + * Copyright (C) 2007-2013, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Implements utility for converting standard image formats to DICOM + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/libi2d/i2d.h" +#include "dcmtk/dcmdata/libi2d/i2djpgs.h" +#include "dcmtk/dcmdata/libi2d/i2dbmps.h" +#include "dcmtk/dcmdata/libi2d/i2dplsc.h" +#include "dcmtk/dcmdata/libi2d/i2dplvlp.h" +#include "dcmtk/dcmdata/libi2d/i2dplnsc.h" + +#define OFFIS_CONSOLE_APPLICATION "img2dcm" +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define SHORTCOL 4 +#define LONGCOL 21 + +static OFLogger img2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static OFCondition evaluateFromFileOptions(OFCommandLine& cmd, + Image2Dcm& converter) +{ + OFCondition cond; + // Parse command line options dealing with DICOM file import + if ( cmd.findOption("--dataset-from") ) + { + OFString tempStr; + OFCommandLine::E_ValueStatus valStatus; + valStatus = cmd.getValue(tempStr); + if (valStatus != OFCommandLine::VS_Normal) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to read value of --dataset-from option"); + converter.setTemplateFile(tempStr); + } + + if (cmd.findOption("--study-from")) + { + OFString tempStr; + OFCommandLine::E_ValueStatus valStatus; + valStatus = cmd.getValue(tempStr); + if (valStatus != OFCommandLine::VS_Normal) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to read value of --study-from option"); + converter.setStudyFrom(tempStr); + } + + if (cmd.findOption("--series-from")) + { + OFString tempStr; + OFCommandLine::E_ValueStatus valStatus; + valStatus = cmd.getValue(tempStr); + if (valStatus != OFCommandLine::VS_Normal) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to read value of --series-from option"); + converter.setSeriesFrom(tempStr); + } + + if (cmd.findOption("--instance-inc")) + converter.setIncrementInstanceNumber(OFTrue); + + // Return success + return EC_Normal; +} + + +static void addCmdLineOptions(OFCommandLine& cmd) +{ + cmd.addParam("imgfile-in", "image input filename"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:", LONGCOL, SHORTCOL + 2); + cmd.addSubGroup("general:"); + cmd.addOption("--input-format", "-i", 1, "[i]nput file format: string", "supported formats: JPEG (default), BMP"); + cmd.addOption("--dataset-from", "-df", 1, "[f]ilename: string", + "use dataset from DICOM file f"); + + cmd.addOption("--study-from", "-stf", 1, "[f]ilename: string", + "read patient/study from DICOM file f"); + cmd.addOption("--series-from", "-sef", 1, "[f]ilename: string", + "read patient/study/series from DICOM file f"); + cmd.addOption("--instance-inc", "-ii", "increase instance number read from DICOM file"); + cmd.addSubGroup("JPEG format:"); + cmd.addOption("--disable-progr", "-dp", "disable support for progressive JPEG"); + cmd.addOption("--disable-ext", "-de", "disable support for extended sequential JPEG"); + cmd.addOption("--insist-on-jfif", "-jf", "insist on JFIF header"); + cmd.addOption("--keep-appn", "-ka", "keep APPn sections (except JFIF)"); + + cmd.addGroup("processing options:", LONGCOL, SHORTCOL + 2); + cmd.addSubGroup("attribute checking:"); + cmd.addOption("--do-checks", "enable attribute validity checking (default)"); + cmd.addOption("--no-checks", "disable attribute validity checking"); + cmd.addOption("--insert-type2", "+i2", "insert missing type 2 attributes (default)\n(only with --do-checks)"); + cmd.addOption("--no-type2-insert", "-i2", "do not insert missing type 2 attributes \n(only with --do-checks)"); + cmd.addOption("--invent-type1", "+i1", "invent missing type 1 attributes (default)\n(only with --do-checks)"); + cmd.addOption("--no-type1-invent", "-i1", "do not invent missing type 1 attributes\n(only with --do-checks)"); + cmd.addSubGroup("character set:"); + cmd.addOption("--latin1", "+l1", "set latin-1 as standard character set (default)"); + cmd.addOption("--no-latin1", "-l1", "keep 7-bit ASCII as standard character set"); + cmd.addSubGroup("other processing options:"); + cmd.addOption("--key", "-k", 1, "[k]ey: gggg,eeee=\"str\", path or dict. name=\"str\"", + "add further attribute"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("target SOP class:"); + cmd.addOption("--sec-capture", "-sc", "write Secondary Capture SOP class (default)"); + cmd.addOption("--new-sc", "-nsc", "write new Secondary Capture SOP classes"); + cmd.addOption("--vl-photo", "-vlp", "write Visible Light Photographic SOP class"); + + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +} + + +static OFCondition startConversion(OFCommandLine& cmd, + int argc, + char *argv[]) +{ + // Parse command line and exclusive options + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Convert standard image formats into DICOM format", rcsid); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + exit(0); + } + } + } + + /* print resource identifier */ + OFLOG_DEBUG(img2dcmLogger, rcsid << OFendl); + + // Main class for controlling conversion + Image2Dcm i2d; + // Output plugin to use (i.e. SOP class to write) + I2DOutputPlug *outPlug = NULL; + // Input plugin to use (i.e. file format to read) + I2DImgSource *inputPlug = NULL; + // Group length encoding mode for output DICOM file + E_GrpLenEncoding grpLengthEnc = EGL_recalcGL; + // Item and Sequence encoding mode for output DICOM file + E_EncodingType lengthEnc = EET_ExplicitLength; + // Padding mode for output DICOM file + E_PaddingEncoding padEnc = EPD_noChange; + // File pad length for output DICOM file + OFCmdUnsignedInt filepad = 0; + // Item pad length for output DICOM file + OFCmdUnsignedInt itempad = 0; + // Write only pure dataset, i.e. without meta header + E_FileWriteMode writeMode = EWM_fileformat; + // Override keys are applied at the very end of the conversion "pipeline" + OFList overrideKeys; + // The transfer syntax proposed to be written by output plugin + E_TransferSyntax writeXfer; + + // Parse rest of command line options + OFLog::configureFromCommandLine(cmd, app); + + OFString pixDataFile, outputFile, tempStr; + cmd.getParam(1, tempStr); + + if (tempStr.empty()) + { + OFLOG_ERROR(img2dcmLogger, "No image input filename specified"); + return EC_IllegalCall; + } + else + pixDataFile = tempStr; + + cmd.getParam(2, tempStr); + if (tempStr.empty()) + { + OFLOG_ERROR(img2dcmLogger, "No DICOM output filename specified"); + return EC_IllegalCall; + } + else + outputFile = tempStr; + + if (cmd.findOption("--input-format")) + { + app.checkValue(cmd.getValue(tempStr)); + if (tempStr == "JPEG") + { + inputPlug = new I2DJpegSource(); + } + else if (tempStr == "BMP") + { + inputPlug = new I2DBmpSource(); + } + else + { + return makeOFCondition(OFM_dcmdata, 18, OF_error, "No plugin for selected input format available"); + } + if (!inputPlug) + { + return EC_MemoryExhausted; + } + } + else // default is JPEG + { + inputPlug = new I2DJpegSource(); + } + OFLOG_INFO(img2dcmLogger, OFFIS_CONSOLE_APPLICATION ": Instantiated input plugin: " << inputPlug->inputFormat()); + + // Find out which plugin to use + cmd.beginOptionBlock(); + if (cmd.findOption("--sec-capture")) + outPlug = new I2DOutputPlugSC(); + if (cmd.findOption("--vl-photo")) + { + outPlug = new I2DOutputPlugVLP(); + } + if (cmd.findOption("--new-sc")) + outPlug = new I2DOutputPlugNewSC(); + cmd.endOptionBlock(); + if (!outPlug) // default is the old Secondary Capture object + outPlug = new I2DOutputPlugSC(); + if (outPlug == NULL) return EC_MemoryExhausted; + OFLOG_INFO(img2dcmLogger, OFFIS_CONSOLE_APPLICATION ": Instantiated output plugin: " << outPlug->ident()); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) grpLengthEnc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) grpLengthEnc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) grpLengthEnc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) lengthEnc = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) lengthEnc = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-off")) + { + filepad = 0; + itempad = 0; + } + else if (cmd.findOption("--padding-create")) + { + OFCmdUnsignedInt opt_filepad; OFCmdUnsignedInt opt_itempad; + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + itempad = opt_itempad; + filepad = opt_filepad; + } + cmd.endOptionBlock(); + + // create override attribute dataset (copied from findscu code) + if (cmd.findOption("--key", 0, OFCommandLine::FOM_FirstFromLeft)) + { + const char *ovKey = NULL; + do { + app.checkValue(cmd.getValue(ovKey)); + overrideKeys.push_back(ovKey); + } while (cmd.findOption("--key", 0, OFCommandLine::FOM_NextFromLeft)); + } + i2d.setOverrideKeys(overrideKeys); + + // Test for ISO Latin 1 option + OFBool insertLatin1 = OFTrue; + cmd.beginOptionBlock(); + if (cmd.findOption("--latin1")) + insertLatin1 = OFTrue; + if (cmd.findOption("--no-latin1")) + insertLatin1 = OFFalse; + cmd.endOptionBlock(); + i2d.setISOLatin1(insertLatin1); + + // evaluate validity checking options + OFBool insertType2 = OFTrue; + OFBool inventType1 = OFTrue; + OFBool doChecks = OFTrue; + cmd.beginOptionBlock(); + if (cmd.findOption("--no-checks")) + doChecks = OFFalse; + if (cmd.findOption("--do-checks")) + doChecks = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--insert-type2")) + insertType2 = OFTrue; + if (cmd.findOption("--no-type2-insert")) + insertType2 = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--invent-type1")) + inventType1 = OFTrue; + if (cmd.findOption("--no-type1-invent")) + inventType1 = OFFalse; + cmd.endOptionBlock(); + i2d.setValidityChecking(doChecks, insertType2, inventType1); + outPlug->setValidityChecking(doChecks, insertType2, inventType1); + + // evaluate --xxx-from options and transfer syntax options + OFCondition cond; + cond = evaluateFromFileOptions(cmd, i2d); + if (cond.bad()) + { + delete outPlug; outPlug = NULL; + delete inputPlug; inputPlug = NULL; + return cond; + } + + if (inputPlug->inputFormat() == "JPEG") + { + I2DJpegSource *jpgSource = OFstatic_cast(I2DJpegSource*, inputPlug); + if (!jpgSource) + { + delete outPlug; outPlug = NULL; + delete inputPlug; inputPlug = NULL; + return EC_MemoryExhausted; + } + if ( cmd.findOption("--disable-progr") ) + jpgSource->setProgrSupport(OFFalse); + if ( cmd.findOption("--disable-ext") ) + jpgSource->setExtSeqSupport(OFFalse); + if ( cmd.findOption("--insist-on-jfif") ) + jpgSource->setInsistOnJFIF(OFTrue); + if ( cmd.findOption("--keep-appn") ) + jpgSource->setKeepAPPn(OFTrue); + } + inputPlug->setImageFile(pixDataFile); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(img2dcmLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + DcmDataset *resultObject = NULL; + OFLOG_INFO(img2dcmLogger, OFFIS_CONSOLE_APPLICATION ": Starting image conversion"); + cond = i2d.convert(inputPlug, outPlug, resultObject, writeXfer); + + // Save + if (cond.good()) + { + OFLOG_INFO(img2dcmLogger, OFFIS_CONSOLE_APPLICATION ": Saving output DICOM to file " << outputFile); + DcmFileFormat dcmff(resultObject); + cond = dcmff.saveFile(outputFile.c_str(), writeXfer, lengthEnc, grpLengthEnc, padEnc, OFstatic_cast(Uint32, filepad), OFstatic_cast(Uint32, itempad), writeMode); + } + + // Cleanup and return + delete outPlug; outPlug = NULL; + delete inputPlug; inputPlug = NULL; + delete resultObject; resultObject = NULL; + + return cond; +} + + +int main(int argc, char *argv[]) +{ + + // variables for command line + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Convert image file to DICOM", rcsid); + OFCommandLine cmd; + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + addCmdLineOptions(cmd); + + OFCondition cond = startConversion(cmd, argc, argv); + if (cond.bad()) + { + OFLOG_FATAL(img2dcmLogger, "Error converting file: " << cond.text()); + return 1; + } + + return 0; +} diff --git a/dcmdata/apps/mdfconen.cc b/dcmdata/apps/mdfconen.cc new file mode 100644 index 00000000..9c089eb5 --- /dev/null +++ b/dcmdata/apps/mdfconen.cc @@ -0,0 +1,663 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class for modifying DICOM files from commandline + * + */ + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "mdfconen.h" +#include "mdfdsman.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcistrmz.h" /* for dcmZlibExpectRFC1950Encoding */ + +#define SHORTCOL 4 +#define LONGCOL 21 + +#ifdef WITH_ZLIB +BEGIN_EXTERN_C +#include +END_EXTERN_C +#endif + +static OFLogger dcmodifyLogger = OFLog::getLogger("dcmtk.apps.dcmodify"); + +MdfJob::MdfJob(const MdfJob& other) +: option(other.option), path(other.path), value(other.value) +{ +} + +OFBool MdfJob::operator==(const MdfJob &j) const +{ + return (option == j.option) && (path == j.path) && (value == j.value); +} + +MdfJob &MdfJob::operator=(const MdfJob &j) +{ + option = j.option; + path = j.path; + value = j.value; + return *this; +} + + +MdfConsoleEngine::MdfConsoleEngine(int argc, char *argv[], + const char *application_name) + : app(NULL), cmd(NULL), ds_man(NULL), ignore_errors_option(OFFalse), + update_metaheader_uids_option(OFTrue), no_backup_option(OFFalse), + read_mode_option(ERM_autoDetect), input_xfer_option(EXS_Unknown), + output_dataset_option(OFFalse), output_xfer_option(EXS_Unknown), + glenc_option(EGL_recalcGL), enctype_option(EET_ExplicitLength), + padenc_option(EPD_withoutPadding), filepad_option(0), + itempad_option(0), ignore_missing_tags_option(OFFalse), + no_reservation_checks(OFFalse), ignore_un_modifies(OFFalse), + create_if_necessary(OFFalse), was_created(OFFalse), jobs(NULL), files(NULL) +{ + char rcsid[200]; + // print application header + sprintf(rcsid, "$dcmtk: %s v%s %s $", application_name, OFFIS_DCMTK_VERSION, OFFIS_DCMTK_RELEASEDATE); + + // the next lines describe commandline arguments/options + app = new OFConsoleApplication(application_name, "Modify DICOM files", rcsid); + cmd = new OFCommandLine(); + + cmd->setOptionColumns(LONGCOL, SHORTCOL); + cmd->setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd->addParam("dcmfile-in", "DICOM input filename to be modified", OFCmdParam::PM_MultiMandatory); + + // add options to commandline application + cmd->addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd->addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd->addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(*cmd); + cmd->addGroup("input options:"); + cmd->addSubGroup("input file format:"); + cmd->addOption("--read-file", "+f", "read file format or data set (default)"); + cmd->addOption("--read-file-only", "+fo", "read file format only"); + cmd->addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd->addOption("--create-file", "+fc", "create file format if file does not exist"); + cmd->addSubGroup("input transfer syntax:"); + cmd->addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd->addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd->addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd->addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd->addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + cmd->addSubGroup("parsing of odd-length attributes:"); + cmd->addOption("--accept-odd-length", "+ao", "accept odd length attributes (default)"); + cmd->addOption("--assume-even-length", "+ae", "assume real length is one byte larger"); + cmd->addSubGroup("automatic data correction:"); + cmd->addOption("--enable-correction", "+dc", "enable automatic data correction (default)"); + cmd->addOption("--disable-correction", "-dc", "disable automatic data correction"); +#ifdef WITH_ZLIB + cmd->addSubGroup("bitstream format of deflated input:"); + cmd->addOption("--bitstream-deflated", "+bd", "expect deflated bitstream (default)"); + cmd->addOption("--bitstream-zlib", "+bz", "expect deflated zlib bitstream"); +#endif + + cmd->addGroup("processing options:"); + cmd->addSubGroup("backup input files:"); + cmd->addOption("--backup", "backup files before modifying (default)"); + cmd->addOption("--no-backup", "-nb", "don't backup files (DANGEROUS)"); + cmd->addSubGroup("insert mode:"); + cmd->addOption("--insert", "-i", 1, "\"[t]ag-path=[v]alue\"", + "insert (or overwrite) path at position t\nwith value v", OFCommandLine::AF_NoWarning); + cmd->addOption("--insert-from-file", "-if", 1, "\"[t]ag-path=[f]ilename\"", + "insert (or overwrite) path at position t\nwith value from file f", OFCommandLine::AF_NoWarning); + cmd->addOption("--no-reserv-check", "-nrc", "do not check private reservations\nwhen inserting private tags"); + cmd->addSubGroup("modify mode:"); + cmd->addOption("--modify", "-m", 1, "\"[t]ag-path=[v]alue\"", + "modify tag at position t to value v", OFCommandLine::AF_NoWarning); + cmd->addOption("--modify-from-file", "-mf", 1, "\"[t]ag-path=[f]ilename\"", + "modify tag at position t to value from file f", OFCommandLine::AF_NoWarning); + cmd->addOption("--modify-all", "-ma", 1, "\"[t]ag=[v]alue\"", + "modify ALL matching tags t in file to value v", OFCommandLine::AF_NoWarning); + cmd->addSubGroup("erase mode:"); + cmd->addOption("--erase", "-e", 1, "\"[t]ag-path\"", + "erase tag/item at position t", OFCommandLine::AF_NoWarning); + cmd->addOption("--erase-all", "-ea", 1, "\"[t]ag\"", + "erase ALL matching tags t in file", OFCommandLine::AF_NoWarning); + cmd->addOption("--erase-private", "-ep", "erase ALL private data from file", OFCommandLine::AF_NoWarning); + cmd->addSubGroup("unique identifier:"); + cmd->addOption("--gen-stud-uid", "-gst", "generate new Study Instance UID", OFCommandLine::AF_NoWarning); + cmd->addOption("--gen-ser-uid", "-gse", "generate new Series Instance UID", OFCommandLine::AF_NoWarning); + cmd->addOption("--gen-inst-uid", "-gin", "generate new SOP Instance UID", OFCommandLine::AF_NoWarning); + cmd->addOption("--no-meta-uid", "-nmu", "do not update metaheader UIDs if related\nUIDs in the dataset are modified"); + cmd->addSubGroup("error handling:"); + cmd->addOption("--ignore-errors", "-ie", "continue with file, if modify error occurs"); + cmd->addOption("--ignore-missing-tags", "-imt", "treat 'tag not found' as success\nwhen modifying or erasing in datasets"); + cmd->addOption("--ignore-un-values", "-iun", "do not try writing any values to elements\nhaving a VR of UN"); + cmd->addGroup("output options:"); + cmd->addSubGroup("output file format:"); + cmd->addOption("--write-file", "+F", "write file format (default)"); + cmd->addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd->addSubGroup("output transfer syntax:"); + cmd->addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd->addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd->addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd->addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + cmd->addSubGroup("post-1993 value representations:"); + cmd->addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd->addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd->addSubGroup("group length encoding:"); + cmd->addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd->addOption("--group-length-create", "+g", "always write with group length elements"); + cmd->addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd->addSubGroup("length encoding in sequences and items:"); + cmd->addOption("--length-explicit", "+le", "write with explicit lengths (default)"); + cmd->addOption("--length-undefined", "-le", "write with undefined lengths"); + cmd->addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd->addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd->addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd->addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + // evaluate commandline + prepareCmdLineArgs(argc, argv, application_name); + if (app->parseCommandLine(*cmd, argc, argv)) + { + /* print help text and exit */ + if (cmd->getArgCount() == 0) + app->printUsage(); + + /* check exclusive options first */ + if (cmd->hasExclusiveOption()) + { + if (cmd->findOption("--version")) + { + app->printHeader(OFTrue /*print host identifier*/); + ofConsole.lockCout() << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + ofConsole.getCout() << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + ofConsole.getCout() << " none" << OFendl; +#endif + ofConsole.unlockCout(); + delete app; + delete cmd; + exit(0); + } + } + + // iterate the files (parameters) and save them in list + files = new OFList; + OFString current_file; + for (int i = 1; i <= cmd->getParamCount(); i++) + { + cmd->getParam(i,current_file); + files->push_back(current_file); + } + // if no files are given: return with error message + if (files->empty()) + { + OFLOG_ERROR(dcmodifyLogger, "no dicom files given!"); + delete app; + delete cmd; + exit(1); + } + + // make sure data dictionary is loaded + if (!dcmDataDict.isDictionaryLoaded()) + OFLOG_WARN(dcmodifyLogger, "no data dictionary loaded, " + << "check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmodifyLogger, rcsid << OFendl); +} + + +void MdfConsoleEngine::parseNonJobOptions() +{ + // catch "general" options + OFLog::configureFromCommandLine(*cmd, *app); + + // input options + cmd->beginOptionBlock(); + if (cmd->findOption("--read-file")) + read_mode_option = ERM_autoDetect; + if (cmd->findOption("--read-file-only")) + read_mode_option = ERM_fileOnly; + if (cmd->findOption("--read-dataset")) + read_mode_option = ERM_dataset; + cmd->endOptionBlock(); + + if (cmd->findOption("--create-file")) + create_if_necessary = OFTrue; + + cmd->beginOptionBlock(); + if (cmd->findOption("--read-xfer-auto")) + input_xfer_option = EXS_Unknown; + if (cmd->findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd->findOption("--read-xfer-little")) + { + app->checkDependence("--read-xfer-little", "--read-dataset", read_mode_option == ERM_dataset); + input_xfer_option = EXS_LittleEndianExplicit; + } + if (cmd->findOption("--read-xfer-big")) + { + app->checkDependence("--read-xfer-big", "--read-dataset", read_mode_option == ERM_dataset); + input_xfer_option = EXS_BigEndianExplicit; + } + if (cmd->findOption("--read-xfer-implicit")) + { + app->checkDependence("--read-xfer-implicit", "--read-dataset", read_mode_option == ERM_dataset); + input_xfer_option = EXS_LittleEndianImplicit; + } + cmd->endOptionBlock(); + + cmd->beginOptionBlock(); + if (cmd->findOption("--accept-odd-length")) + dcmAcceptOddAttributeLength.set(OFTrue); + if (cmd->findOption("--assume-even-length")) + dcmAcceptOddAttributeLength.set(OFFalse); + cmd->endOptionBlock(); + + cmd->beginOptionBlock(); + if (cmd->findOption("--enable-correction")) + dcmEnableAutomaticInputDataCorrection.set(OFTrue); + if (cmd->findOption("--disable-correction")) + dcmEnableAutomaticInputDataCorrection.set(OFFalse); + cmd->endOptionBlock(); + +#ifdef WITH_ZLIB + cmd->beginOptionBlock(); + if (cmd->findOption("--bitstream-deflated")) + dcmZlibExpectRFC1950Encoding.set(OFFalse); + if (cmd->findOption("--bitstream-zlib")) + dcmZlibExpectRFC1950Encoding.set(OFTrue); + cmd->endOptionBlock(); +#endif + + // processing options + cmd->beginOptionBlock(); + if (cmd->findOption("--backup")) + no_backup_option = OFFalse; + if (cmd->findOption("--no-backup")) + no_backup_option = OFTrue; + cmd->endOptionBlock(); + + if (cmd->findOption("--no-reserv-check")) + no_reservation_checks = OFTrue; + + if (cmd->findOption("--no-meta-uid")) + update_metaheader_uids_option = OFFalse; + + if (cmd->findOption("--ignore-errors")) + ignore_errors_option = OFTrue; + if (cmd->findOption("--ignore-missing-tags")) + ignore_missing_tags_option = OFTrue; + if (cmd->findOption("--ignore-un-values")) + ignore_un_modifies = OFTrue; + + // output options + cmd->beginOptionBlock(); + if (cmd->findOption("--write-file")) + output_dataset_option = OFFalse; + if (cmd->findOption("--write-dataset")) + { + output_dataset_option = OFTrue; + app->checkConflict("--write-dataset", "--create-file", create_if_necessary); + } + cmd->endOptionBlock(); + + cmd->beginOptionBlock(); + if (cmd->findOption("--write-xfer-same")) + output_xfer_option = EXS_Unknown; + if (cmd->findOption("--write-xfer-little")) + output_xfer_option = EXS_LittleEndianExplicit; + if (cmd->findOption("--write-xfer-big")) + output_xfer_option = EXS_BigEndianExplicit; + if (cmd->findOption("--write-xfer-implicit")) + output_xfer_option = EXS_LittleEndianImplicit; + cmd->endOptionBlock(); + + cmd->beginOptionBlock(); + if (cmd->findOption("--enable-new-vr")) + dcmEnableGenerationOfNewVRs(); + if (cmd->findOption("--disable-new-vr")) + dcmDisableGenerationOfNewVRs(); + cmd->endOptionBlock(); + + cmd->beginOptionBlock(); + if (cmd->findOption("--group-length-recalc")) + glenc_option = EGL_recalcGL; + if (cmd->findOption("--group-length-create")) + glenc_option = EGL_withGL; + if (cmd->findOption("--group-length-remove")) + glenc_option = EGL_withoutGL; + cmd->endOptionBlock(); + + cmd->beginOptionBlock(); + if (cmd->findOption("--length-explicit")) + enctype_option = EET_ExplicitLength; + if (cmd->findOption("--length-undefined")) + enctype_option = EET_UndefinedLength; + cmd->endOptionBlock(); + + cmd->beginOptionBlock(); + if (cmd->findOption("--padding-retain")) + { + app->checkConflict("--padding-retain", "--write-dataset", output_dataset_option); + padenc_option = EPD_noChange; + } + if (cmd->findOption("--padding-off")) + padenc_option = EPD_withoutPadding; + if (cmd->findOption("--padding-create")) + { + app->checkConflict("--padding-create", "--write-dataset", output_dataset_option); + app->checkValue(cmd->getValueAndCheckMin(filepad_option, 0)); + app->checkValue(cmd->getValueAndCheckMin(itempad_option, 0)); + padenc_option = EPD_withPadding; + } + cmd->endOptionBlock(); +} + + +void MdfConsoleEngine::parseCommandLine() +{ + jobs = new OFList; + OFString option_string; + // check all options, that don't belong to a specific job + parseNonJobOptions(); + + cmd->gotoFirstOption(); + // iterate over commandline arguments from first to last + do { + if (cmd->getCurrentOption(option_string)) + { + MdfJob aJob; + OFString option_value, tag_path, tag_value; + if (option_string == "--insert") + aJob.option = "i"; + else if (option_string == "--insert-from-file") + aJob.option = "if"; + else if (option_string == "--modify") + aJob.option = "m"; + else if (option_string == "--modify-from-file") + aJob.option = "mf"; + else if (option_string == "--modify-all") + aJob.option = "ma"; + else if (option_string == "--erase") + aJob.option = "e"; + else if (option_string == "--erase-all") + aJob.option = "ea"; + else if (option_string == "--erase-private") + aJob.option = "ep"; + else if (option_string == "--gen-stud-uid") + aJob.option = "gst"; + else if (option_string == "--gen-ser-uid") + aJob.option = "gse"; + else if (option_string == "--gen-inst-uid") + aJob.option = "gin"; + // else this is a non job option, e.g. -v, -d, -f, ... + else + continue; + // get any parameters if job expects some + if (jobOptionExpectsParameters(aJob.option)) + { + cmd->getValue(option_value); + splitPathAndValue(option_value, tag_path, tag_value); + aJob.path = tag_path; + aJob.value = tag_value; + } + // finally, and schedule job + jobs->push_back(aJob); + } + } while (cmd->gotoNextOption()); +} + + +OFBool MdfConsoleEngine::jobOptionExpectsParameters(const OFString &job) +{ + return (job != "ep") && (job != "gst") && (job != "gse") && (job != "gin"); +} + + +void MdfConsoleEngine::splitPathAndValue(const OFString &whole, + OFString &path, + OFString &value) +{ + size_t pos = whole.find("="); + if (pos != OFString_npos) + { + path = whole.substr(0, pos); + value = whole.substr(pos + 1, value.length() - 1); + } + else path = whole; +} + + +int MdfConsoleEngine::executeJob(const MdfJob &job, + const char *filename) +{ + OFCondition result; + int count = 0; + int error_count = 0; + OFLOG_INFO(dcmodifyLogger, "Executing (option|path|value): " + << job.option << "|" << job.path << "|" << job.value); + // start modify operation based on job option + if (job.option=="i") + result = ds_man->modifyOrInsertPath(job.path, job.value, OFFalse, update_metaheader_uids_option, ignore_missing_tags_option, no_reservation_checks); + else if (job.option == "if") + result = ds_man->modifyOrInsertFromFile(job.path, job.value /*filename*/, OFFalse, update_metaheader_uids_option, ignore_missing_tags_option, no_reservation_checks); + else if (job.option == "m") + result = ds_man->modifyOrInsertPath(job.path, job.value, OFTrue, update_metaheader_uids_option, ignore_missing_tags_option, no_reservation_checks); + else if (job.option == "mf") + result = ds_man->modifyOrInsertFromFile(job.path, job.value /*filename*/, OFTrue, update_metaheader_uids_option, ignore_missing_tags_option, no_reservation_checks); + else if (job.option == "ma") + result = ds_man->modifyAllTags(job.path, job.value, update_metaheader_uids_option, count, ignore_missing_tags_option); + else if (job.option == "e") + result = ds_man->deleteTag(job.path, OFFalse, ignore_missing_tags_option); + else if (job.option == "ea") + result = ds_man->deleteTag(job.path, OFTrue, ignore_missing_tags_option); + else if (job.option == "ep") + result = ds_man->deletePrivateData(); + else if (job.option == "gst") + result = ds_man->generateAndInsertUID(DCM_StudyInstanceUID); + else if (job.option == "gse") + result = ds_man->generateAndInsertUID(DCM_SeriesInstanceUID); + else if (job.option == "gin") + result = ds_man->generateAndInsertUID(DCM_SOPInstanceUID); + // no valid job option found: + else + { + error_count++; + OFLOG_ERROR(dcmodifyLogger, "no valid option: " << job.option); + } + // if modify operation failed + if (result.bad() && error_count == 0) + { + if (filename != NULL) + OFLOG_ERROR(dcmodifyLogger, "modifying tag in file " << OFString(filename) << ": " << result.text()); + else + OFLOG_ERROR(dcmodifyLogger, "modifying tag: " << result.text()); + error_count++; + } + return error_count; +} + + +int MdfConsoleEngine::startProvidingService() +{ + OFCondition result; + const char *filename; + // return value of this function + int errors = 0; + // parse command line into file and job list + parseCommandLine(); + // iterators for job and file loops + OFListIterator(MdfJob) job_it; + OFListIterator(MdfJob) job_last = jobs->end();; + OFListIterator(OFString) file_it = files->begin(); + OFListIterator(OFString) file_last = files->end();; + // outer loop: iterate over all files + while (file_it != file_last) + { + filename = (*file_it).c_str(); + result = loadFile(filename); + + // if file could be loaded: + if (result.good()) + { + // for each file, set job iterator back to first entry + job_it = jobs->begin(); + // inner loop: iterate over jobs, execute all jobs for current file + while (job_it != job_last) + { + errors += executeJob(*job_it, filename); + job_it++; + } + // if there were no errors or user wants to override them, save: + if (errors == 0 || ignore_errors_option) + { + if (was_created && (output_xfer_option == EXS_Unknown)) + { + output_xfer_option = EXS_LittleEndianExplicit; + } + result = ds_man->saveFile(filename, output_xfer_option, + enctype_option, glenc_option, + padenc_option, filepad_option, + itempad_option, output_dataset_option); + if (result.bad()) + { + OFLOG_ERROR(dcmodifyLogger, "couldn't save file: " << result.text()); + errors++; + if (!no_backup_option && !was_created) + { + result = restoreFile(filename); + if (result.bad()) + { + OFLOG_ERROR(dcmodifyLogger, "couldn't restore file: " << result.text()); + errors++; + } + } + } + } + // errors occurred and user doesn't want to ignore them: + else if (!no_backup_option && !was_created) + { + result = restoreFile(filename); + if (result.bad()) + { + OFLOG_ERROR(dcmodifyLogger, "couldn't restore file!"); + errors++; + } + } + } + // if loading fails: + else + { + errors++; + OFLOG_ERROR(dcmodifyLogger, "unable to load file " << filename <<": " << result.text()); + } + file_it++; + // output separator line if required + if ((file_it != file_last) || (errors > 0)) + OFLOG_INFO(dcmodifyLogger, "------------------------------------"); + } + return errors; +} + + +OFCondition MdfConsoleEngine::loadFile(const char *filename) +{ + OFCondition result; + // free memory + delete ds_man; + ds_man = new MdfDatasetManager(); + ds_man->setModifyUNValues(!ignore_un_modifies); + OFLOG_INFO(dcmodifyLogger, "Processing file: " << filename); + // load file into dataset manager + was_created = !OFStandard::fileExists(filename); + result = ds_man->loadFile(filename, read_mode_option, input_xfer_option, create_if_necessary); + if (result.good() && !no_backup_option && !was_created) + result = backupFile(filename); + return result; +} + + +OFCondition MdfConsoleEngine::backupFile(const char *filename) +{ + int result; + OFString backup = filename; + backup += ".bak"; + OFLOG_INFO(dcmodifyLogger, "Creating backup of input file: " << backup); + // delete backup file, if it already exists + if (OFStandard::fileExists(backup.c_str())) + { + result = remove(backup.c_str()); + if (result != 0) + { + OFLOG_ERROR(dcmodifyLogger, "couldn't delete previous backup file, unable to backup!"); + return EC_IllegalCall; + } + } + // if backup file could be removed, backup original file + result = rename(filename, backup.c_str()); + // set return value + if (result != 0) + { + OFLOG_ERROR(dcmodifyLogger, "unable to backup, no write permission?"); + return EC_IllegalCall; + } + + return EC_Normal; +} + + +OFCondition MdfConsoleEngine::restoreFile(const char *filename) +{ + int result; + OFString backup = filename; + backup += ".bak"; + OFLOG_INFO(dcmodifyLogger, "Restoring original file from backup"); + // delete the (original) file that dcmodify couldn't modify + if (OFStandard::fileExists(filename)) + { + result = remove(filename); + if (result != 0) + { + OFLOG_ERROR(dcmodifyLogger, "unable to delete original file for restoring backup!"); + return EC_IllegalCall; + } + } + // and rename backup file back to original filename + result = rename(backup.c_str(), filename); + // error renaming backup file + if (result != 0) + { + OFLOG_ERROR(dcmodifyLogger, "unable to rename backup file to original filename!"); + return EC_IllegalCall; + } + // you only get to this point, if restoring was completely successful + return EC_Normal; +} + + +MdfConsoleEngine::~MdfConsoleEngine() +{ + delete app; + delete cmd; + delete files; + delete jobs; + delete ds_man; +} diff --git a/dcmdata/apps/mdfconen.h b/dcmdata/apps/mdfconen.h new file mode 100644 index 00000000..4a757419 --- /dev/null +++ b/dcmdata/apps/mdfconen.h @@ -0,0 +1,226 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class for modifying DICOM files from commandline + * + */ + +#ifndef MDFCONEN_H +#define MDFCONEN_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/ofstd/ofcmdln.h" + + +// forward declarations +class MdfDatasetManager; +class OFConsoleApplication; +class OFCommandLine; + + +/** class reflecting a modify operation (called Job in this context) + */ +class MdfJob { + +public : + + OFString option; + OFString path; + OFString value; + + MdfJob() : option(), path(), value() { } + + MdfJob(const MdfJob& other); + + /** Comparison operator between Jobs + */ + OFBool operator==(const MdfJob &j) const; + + /** Assignment operator + */ + MdfJob &operator=(const MdfJob &j); +}; + + +/** This class encapsulates data structures and operations for modifying + * DICOM files from the commandline + */ +class MdfConsoleEngine +{ +public: + + /** Constructor + * @param argc Number of commandline arguments + * @param argv Array holding the commandline arguments + * @param appl_name Name of calling application, that instantiates + * this class + */ + MdfConsoleEngine(int argc, + char *argv[], + const char *appl_name); + + /** Destructor + */ + ~MdfConsoleEngine(); + + /** This function looks at commandline options and decides what to do. + * It evaluates option values from commandline and prepares them for + * starting the corresponding private functions. + * @return Returns 0 if successful, another value if errors occurred + */ + int startProvidingService(); + +protected: + + /** Checks for non-job commandline options like --debug etc. and + * sets corresponding internal flags + */ + void parseNonJobOptions(); + + /** Parses commandline options into corresponding file- and job lists and + * enables debug/verbose mode. The joblist is built in order of modify + * options on commandline + */ + void parseCommandLine(); + + /** Checks whether given job expects more values on commandline, e. g. a + * a tag path or any kind of value. + * @param job [in] The job option to check (e. g. "i", "m", "ma"...) + * @return OFTrue, if a value is expected. + */ + static OFBool jobOptionExpectsParameters(const OFString &job); + + /** This function splits a modify option (inclusive value) as + * found on commandline into to parts (path and value) + * e.g. "(0010,0010)=value" into path "(0010,0010)" and "value" + * @param whole string to be split + * @param path returns part containing the path + * @param value returns part containing the value(if theres one) + */ + static void splitPathAndValue(const OFString &whole, + OFString &path, + OFString &value); + + /** Executes given modify job + * @param job job to be executed + * @param filename name of the file to be processed (optional) + * @return returns 0 if no error occurred, else the number of errors + */ + int executeJob(const MdfJob &job, + const char *filename = NULL); + + /** Backup and load file into internal MdfDatasetManager + * @param filename name of file to load + * @return OFCondition, whether loading/backuping was successful including + * error description + */ + OFCondition loadFile(const char *filename); + + /** Backup given file from file to file.bak + * @param file_name filename of file, that should be backuped + * @return OFCondition, whether backup was successful or not + */ + OFCondition backupFile(const char *file_name); + + /** Restore given file from file.bak to original (without .bak) + * @param filename restore "filename".bak to original without .bak + * @return OFCondition, whether restoring was successful + */ + OFCondition restoreFile(const char *filename); + +private: + + /// helper class for console applications + OFConsoleApplication *app; + + /// helper class for commandline parsing + OFCommandLine *cmd; + + /// dataset manager that is used for modify operations + MdfDatasetManager *ds_man; + + /// ignore errors option + OFBool ignore_errors_option; + + /// if false, metaheader UIDs are not updated when related dataset UIDs change + OFBool update_metaheader_uids_option; + + /// if true, no backup is made before modifying a file + OFBool no_backup_option; + + /// read file with or without metaheader + E_FileReadMode read_mode_option; + + /// denotes the expected transfer syntax + E_TransferSyntax input_xfer_option; + + /// decides whether to with/without metaheader + OFBool output_dataset_option; + + /// denotes the transfer syntax that should be written + E_TransferSyntax output_xfer_option; + + /// option for group length recalculation + E_GrpLenEncoding glenc_option; + + /// write explicit or implicit length encoding + E_EncodingType enctype_option; + + /// padding output + E_PaddingEncoding padenc_option; + + /// internal padding variables + OFCmdUnsignedInt filepad_option; + OFCmdUnsignedInt itempad_option; + + /// if true, 'tag not found' errors are treated as being successful for + /// modify and erase operations + OFBool ignore_missing_tags_option; + + /// If true, it is not checked whether there is a corresponding private + /// reservation during insertion of private tags + OFBool no_reservation_checks; + + /// If enabled, any value modifications of UN leaf elements are not + /// executed + OFBool ignore_un_modifies; + + /// If enabled, a new dataset is created in memory if a file is not existing. + OFBool create_if_necessary; + + /// Used to remember, whether a file was newly created. + OFBool was_created; + + /// list of jobs to be executed + OFList *jobs; + + /// list of files to be modified + OFList *files; + + /** private undefined assignment operator + */ + MdfConsoleEngine &operator=(const MdfConsoleEngine &); + + /** private undefined copy constructor + */ + MdfConsoleEngine(const MdfConsoleEngine &); +}; + +#endif // MDFCONEN_H diff --git a/dcmdata/apps/mdfdsman.cc b/dcmdata/apps/mdfdsman.cc new file mode 100644 index 00000000..61187c9a --- /dev/null +++ b/dcmdata/apps/mdfdsman.cc @@ -0,0 +1,744 @@ +/* + * + * Copyright (C) 2003-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class for modifying DICOM files + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "mdfdsman.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcpath.h" +#include "dcmtk/dcmdata/dcistrmf.h" /* for class DcmInputFileStream */ + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + + +static OFLogger mdfdsmanLogger = OFLog::getLogger("dcmtk.dcmdata.mdfdsman"); + +MdfDatasetManager::MdfDatasetManager() +: current_file(""), + dfile(NULL), + dset(NULL), + ignore_un_modifies(OFFalse) +{ +} + + +OFCondition MdfDatasetManager::loadFile(const char *file_name, + const E_FileReadMode readMode, + const E_TransferSyntax xfer, + const OFBool createIfNecessary) +{ + OFCondition cond; + // delete old dfile and free memory and reset current_file + delete dfile; + current_file = ""; + dfile = new DcmFileFormat(); + dset = dfile->getDataset(); + + // load file into dfile if it exists + OFLOG_INFO(mdfdsmanLogger, "Loading file into dataset manager: " << file_name); + if (OFStandard::fileExists(file_name)) + { + cond = dfile->loadFile(file_name, xfer, EGL_noChange, DCM_MaxReadLength, readMode); + } + // if it does not already exist, check whether it should be created + else if (createIfNecessary) + { + OFLOG_DEBUG(mdfdsmanLogger, "File " << file_name << "does not exist, creating it as desired"); + cond = dfile->saveFile(file_name, EXS_LittleEndianExplicit /* might change later */); + } + // no file, we have an error + else + cond = makeOFCondition(OFM_dcmdata, 22, OF_error,"No such file or directory"); + + // if there are errors: + if (cond.bad()) + { + dset = NULL; + } + // file successfully loaded into dfile + else + { + // get dataset from file + OFLOG_INFO(mdfdsmanLogger, "Getting dataset from loaded file: " << file_name); + dset=dfile->getDataset(); + /* load also pixeldata into memory: + * Without this command pixeldata wouldn't be included into the file, + * that's saved after modifying, because original filename was renamed + * meanwhile + */ + dset->loadAllDataIntoMemory(); + // save filename to member variable + current_file = file_name; + } + return cond; +} + + +static DcmTagKey getTagKeyFromDictionary(OFString tag) +{ + DcmTagKey key(0xffff,0xffff); + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(tag.c_str()); + // successful lookup in dictionary -> translate to tag and return + if (dicent) + { + key = dicent->getKey(); + } + dcmDataDict.rdunlock(); + return key; +} + + +static int readNextToken(const char *c, int& pos, DcmTagKey& key, Uint32& idx) +{ + OFString aString; + int lpos = pos; + int spos = 0; + if (c[lpos]=='\0') return -1; // EOF + if (c[lpos]=='.') + { + ++pos; + return 3; // period + } + // look for item index between [] + if (c[lpos]=='[') + { + spos = ++lpos; + while ((c[lpos] >= '0')&&(c[lpos] <= '9')) ++lpos; + if (c[lpos] != ']') return 0; // parse error + unsigned long newindex = 0; + if (1 != sscanf(c+spos,"%lu", &newindex)) return 0; // parse error + idx = OFstatic_cast(Uint32, newindex); + pos = ++lpos; + return 2; // index + } + // look for tag between () + if (c[lpos]=='(') + { + spos = ++lpos; + while ((c[lpos] != ')')&&(c[lpos] != '\0')) ++lpos; + if (c[lpos] != ')') return 0; // parse error + unsigned int group=0; + unsigned int elem=0; + if (2 != sscanf(c+spos,"%x,%x", &group, &elem)) return 0; // parse error + key = DcmTagKey(OFstatic_cast(Uint16, group),OFstatic_cast(Uint16, elem)); + pos = ++lpos; + return 1; // tag key + } + // so far no tag and no item index found. So check if it's a dictionary name + spos = lpos; + while ( ((c[lpos] >= 'a')&&(c[lpos] <= 'z')) || + ((c[lpos] >= 'A')&&(c[lpos] <= 'Z')) || + ((c[lpos] >= '0')&&(c[lpos] <= '9'))) ++lpos; + aString.append(c + spos, (lpos-spos)); + key=getTagKeyFromDictionary(aString); + // if key was found in dictionary, return 1 for tag key + if ( (key.getGroup()!=0xffff) && (key.getElement()!=0xffff) ) + { + pos=lpos; + return 1; // tag key + } + // if no return command was processed this far, the token could not be parsed + return 0; // parse error +} + + +static DcmItem* getItemFromPath(DcmItem &dataset, + const char *location, + OFString &message) +{ + DcmTagKey key; + Uint32 idx = 0; + int pos = 0; + int token = 0; + int expected = 1; // first expected is a tagkey + OFBool finished = OFFalse; + DcmItem *result = &dataset; + DcmSequenceOfItems *sq = NULL; + DcmStack stack; + message.clear(); + do + { + token = readNextToken(location, pos, key, idx); + if ((token != expected)&&(token != -1)) + { + message=message + "parse error in path '" + location + "'"; + return NULL; + } + if (token == -1) + { + if (!finished) + { + message=message + "Error: path '" + location + "' incomplete"; + return NULL; + } + return result; + } + if (token == 1) + { + // we have read a tag key + stack.clear(); + if (EC_Normal != result->search(key, stack, ESM_fromHere, OFFalse)) + { + message=message + "Error: attribute not found in dataset (path is '" + + location + "')"; + return NULL; + } + if (stack.top()->ident() == EVR_SQ) + { + sq = OFstatic_cast(DcmSequenceOfItems *, stack.top()); + } else { + message=message + "Error: attribute is not a sequence (path is '" + location + "')"; + return NULL; + } + expected = 2; + finished = OFFalse; + } + else if (token == 2) + { + // we have read an index + if (sq == NULL) + { + message=message + "Error: sequence not found in path '" + location +"'"; + return NULL; + } + if (idx >= sq->card()) + { + message=message + "Error: cannot allocate item in sequence (path is '" + location + "')"; + return NULL; + } + result = sq->getItem(idx); + if (result == NULL) + { + message=message + "Error: item not found in path '" + location + "'"; + return NULL; + } + expected = 3; + finished = OFTrue; + } + else if (token == 3) + { + // we have read a period + expected = 1; + finished = OFFalse; + } + } while (token > 0); + return NULL; +} + + +static OFCondition splitTagPath(OFString &tag_path, + DcmTagKey &key) +{ + OFString target_tag; + unsigned int group,elem; + size_t lpos,rpos; + rpos=tag_path.size()-1; + lpos=rpos; + if (tag_path[rpos]==')') + { + // get opening '(' of target tag; if its not found -> return error + while ( (tag_path[lpos]!='(') && (lpos>0) ) --lpos; + if (tag_path[lpos]!='(') + return makeOFCondition(OFM_dcmdata,22,OF_error,"Invalid tag path!"); + // now lpos and rpos "point" to braces of target tag + // copy target tag from tag path + target_tag=tag_path.substr(lpos,rpos-lpos+1); + // delete target tag from path (inclusive trailing '.') + tag_path.erase(lpos,tag_path.length()-lpos); + // if there's a tag path left, remove the '.', too + if ( !tag_path.empty() && (tag_path[tag_path.length()-1]=='.')) + tag_path.erase(tag_path.length()-1,1); + // parse target_tag into DcmTagKey + if (2 != sscanf(target_tag.c_str(),"(%x,%x)", &group, &elem)) + return makeOFCondition(OFM_dcmdata,22,OF_error,"Invalid target tag!"); + key = DcmTagKey(OFstatic_cast(Uint16, group),OFstatic_cast(Uint16, elem)); + } + else + // otherwise we could have a dictionary name + { + while ( (lpos>0) && (((tag_path[lpos] >= 'a')&&(tag_path[lpos] <= 'z')) || + ((tag_path[lpos] >= 'A')&&(tag_path[lpos] <= 'Z')) || + ((tag_path[lpos] >= '0')&&(tag_path[lpos] <= '9'))) + ) lpos--; + target_tag=tag_path.substr(lpos,rpos-lpos+1); + if (target_tag[0]=='.') target_tag.erase(0,1); + tag_path.erase(lpos,tag_path.length()-lpos); + key=getTagKeyFromDictionary(target_tag); + if ( (key.getGroup()==0xffff) && (key.getElement()==0xffff) ) + { + OFString message=target_tag; + message.append(" not found in dictionary!"); + return makeOFCondition(OFM_dcmdata,22,OF_error,message.c_str()); + } + } + return EC_Normal; +} + + +OFCondition MdfDatasetManager::modifyOrInsertPath(OFString tag_path, + const OFString &value, + const OFBool only_modify, + const OFBool update_metaheader, + const OFBool ignore_missing_tags, + const OFBool no_reservation_checks) +{ + // if no file loaded: return an error + if (dfile == NULL) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "No file loaded yet!"); + + // find or create specified path + DcmPathProcessor proc; + proc.checkPrivateReservations(!no_reservation_checks); + OFCondition result = proc.findOrCreatePath(dset, tag_path, !only_modify /*create if desired*/); + // if desired, handle tag not found as being not an error + if ( (result == EC_TagNotFound) && only_modify && ignore_missing_tags ) + return EC_Normal; + if (result.bad()) return result; + OFList resultPaths; + Uint32 numResultPaths = proc.getResults(resultPaths); + if (numResultPaths == 0) return EC_IllegalCall; + + // general validity checking; must only be done for one result + OFListIterator(DcmPath*) resultPath = resultPaths.begin(); + // verify that groups 0 (invalid) and 2 (meta header) were not used + if ( (*resultPath)->containsGroup(0) || (*resultPath)->containsGroup(2) ) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "Cannot insert/modify tags with group 0000 or 0002!"); + // also - according to the standard - groups 1,3,5,7,FF are illegal + if ( (*resultPath)->containsGroup(1) || (*resultPath)->containsGroup(3) || + (*resultPath)->containsGroup(5) || (*resultPath)->containsGroup(7) || + (*resultPath)->containsGroup(0xffff) ) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "Groups 0001,0003,0005,0007,FFFF are illegal!"); + + DcmPathNode *lastElement = (*resultPath)->back(); + if (lastElement == NULL) return EC_IllegalCall; + DcmObject *obj = lastElement->m_obj; + if (obj == NULL) return EC_IllegalCall; + // if object at the end is not a leaf, the insertion is completed (or must fail) + if (!obj->isLeaf()) + { + // if user specified a value to be inserted into non-leaf element, return error + if (!value.empty()) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "Cannot put value into non-leaf elements!"); + // non-leaf elements (items/sequences) cannot just be modified + if (only_modify) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "Cannot modify non-leaf elements!"); + // we have inserted an item/sequence at the end -> job completed + return EC_Normal; + } + + // start modifying element value as desired + resultPath = resultPaths.begin(); + while (resultPath != resultPaths.end()) + { + lastElement = (*resultPath)->back(); + if (lastElement == NULL) return EC_IllegalCall; + // if tag is already present, start modify operation + DcmElement *elem = OFstatic_cast(DcmElement*, lastElement->m_obj); + if (elem == NULL) return EC_IllegalCall; + result = startModify(elem, value); + if (result.bad()) return result; + if (update_metaheader) + deleteRelatedMetaheaderTag(elem->getTag()); + resultPath++; + } + return EC_Normal; +} + + +OFCondition MdfDatasetManager::modifyOrInsertFromFile(OFString tag_path, + const OFString &filename, + const OFBool only_modify, + const OFBool update_metaheader, + const OFBool ignore_missing_tags, + const OFBool no_reservation_checks) +{ + // if no file loaded: return an error + if (dfile == NULL) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "No file loaded yet!"); + + // first, perform some basic checks on the specified file(name) + if (filename.empty()) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "No filename specified to read value from!"); + if (!OFStandard::fileExists(filename)) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "File to read value from does not exist!"); + if (!OFStandard::isReadable(filename)) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "File to read value from is not readable!"); + + // find or create specified path + DcmPathProcessor proc; + proc.checkPrivateReservations(!no_reservation_checks); + OFCondition result = proc.findOrCreatePath(dset, tag_path, !only_modify /*create if desired*/); + // if desired, handle tag not found as being not an error + if ((result == EC_TagNotFound) && only_modify && ignore_missing_tags) + return EC_Normal; + if (result.bad()) return result; + OFList resultPaths; + Uint32 numResultPaths = proc.getResults(resultPaths); + if (numResultPaths == 0) return EC_IllegalCall; + + // general validity checking; must only be done for one result + OFListIterator(DcmPath*) resultPath = resultPaths.begin(); + // verify that groups 0 (invalid) and 2 (meta header) were not used + if ((*resultPath)->containsGroup(0) || (*resultPath)->containsGroup(2)) + return makeOFCondition(OFM_dcmdata,22,OF_error, "Cannot insert/modify tags with group 0000 or 0002!"); + // also - according to the standard - groups 1,3,5,7,FF are illegal + if ((*resultPath)->containsGroup(1) || (*resultPath)->containsGroup(3) || + (*resultPath)->containsGroup(5) || (*resultPath)->containsGroup(7) || + (*resultPath)->containsGroup(0xffff)) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "Groups 0001,0003,0005,0007,FFFF are illegal!"); + + DcmPathNode *lastElement = (*resultPath)->back(); + if (lastElement == NULL) return EC_IllegalCall; + DcmObject *obj = lastElement->m_obj; + if (obj == NULL) return EC_IllegalCall; + // if object at the end is not a leaf, the insertion/modification fails + if (!obj->isLeaf()) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "Cannot put value into non-leaf elements!"); + + // start modifying element value as desired + resultPath = resultPaths.begin(); + while (resultPath != resultPaths.end()) + { + lastElement = (*resultPath)->back(); + if (lastElement == NULL) return EC_IllegalCall; + // if tag is already present, start modify operation + DcmElement *elem = OFstatic_cast(DcmElement*, lastElement->m_obj); + if (elem == NULL) return EC_IllegalCall; + // check whether VR is "unknown" + DcmEVR vr = elem->getTag().getEVR(); + if (ignore_un_modifies && ((vr == EVR_UN) || (vr == EVR_UNKNOWN) || (vr == EVR_UNKNOWN2B))) + { + OFLOG_WARN(mdfdsmanLogger, "will not write value to attribute having VR=UN: " << elem->getTag()); + return EC_Normal; + } + // create stream object for binary file + DcmInputFileStream fileStream(filename.c_str()); + result = fileStream.status(); + if (result.good()) + { + const size_t fileLen = OFStandard::getFileSize(filename); + if (fileLen & 1) + return makeOFCondition(OFM_dcmdata, 22, OF_error, "Cannot insert/modify value with odd length from file!"); + // read element value from binary file (requires even length) + result = elem->createValueFromTempFile(fileStream.newFactory(), OFstatic_cast(Uint32, fileLen), EBO_LittleEndian); + } + if (result.bad()) return result; + if (update_metaheader) + deleteRelatedMetaheaderTag(elem->getTag()); + resultPath++; + } + return EC_Normal; +} + + +OFCondition MdfDatasetManager::modifyAllTags(OFString tag_path, + const OFString &value, + const OFBool update_metaheader, + int &count, + const OFBool ignore_missing_tags) +{ + // if no file loaded: return an error + if (dfile == NULL) + return makeOFCondition(OFM_dcmdata,22,OF_error,"No file loaded yet!"); + DcmTagKey key; + OFCondition result; + + // split tag_path into the path itself and the target tag + result=splitTagPath(tag_path, key); + if ( result.bad() ) + return result; + + // check whether tag with this group can be modified + if (!key.hasValidGroup()) + return makeOFCondition(OFM_dcmdata,22,OF_error,"Invalid group number!"); + + // modify metaheader if necessary; not necessary if not a main level tag + if ( update_metaheader && tag_path.empty() ) + deleteRelatedMetaheaderTag(key); + // this stack will hold result of element search + DcmStack result_stack; + DcmObject *elem; + // get references to all matching tags in dataset and store them in stack + OFLOG_DEBUG(mdfdsmanLogger, "looking for occurences of: " << key.toString()); + result=dset->findAndGetElements(key, result_stack); + // if there are elements found, modify metaheader if necessary + OFLOG_DEBUG(mdfdsmanLogger, "found " << result_stack.card() << " occurences"); + // as long there are matching elements left on the stack + while( result_stack.card() > 0 && result.good() ) + { + // get the top element + elem=result_stack.pop(); + // if user gives e.g. a sequence delimiter,don't try to change it! + if (elem->isLeaf()) + { + // and put new value to element + OFLOG_DEBUG(mdfdsmanLogger, "accessing existing tag for modify operation"); + result=startModify(OFstatic_cast(DcmElement*,elem),value); + if (result.good()) count++; + } + // if user gave "unchangeable" tag: + else result = makeOFCondition(OFM_dcmdata,22,OF_error,"Unable to modify tag!"); + } + // if desired, handle "tag not found" as being OK + if (ignore_missing_tags && (result == EC_TagNotFound)) + return EC_Normal; + return result; +} + + +OFCondition MdfDatasetManager::deleteTag(OFString tag_path, + const OFBool all_tags, + const OFBool ignore_missing_tags) +{ + + // if no file loaded: return an error + if (dfile == NULL) + return makeOFCondition(OFM_dcmdata,22,OF_error,"No file loaded yet!"); + + OFCondition result; + if (all_tags) + { + // split tag path into item path and target tag + DcmTagKey key; + result = splitTagPath(tag_path, key); + if (result.bad()) + return result; // error parsing tag path + + // if group is 0 or 2: abort; deletion of tags with 1,3,5,7 should be allowed + if ( (key.getGroup() == 0) || (key.getGroup() == 2) ) + return makeOFCondition(OFM_dcmdata,22,OF_error, "Cannot delete tags with group 0000 or 0002!"); + + // if tag path still contains characters, user wants to modify item tag + if (!tag_path.empty()) + { + OFString error; + DcmItem *item=NULL; + item = getItemFromPath(*dset, tag_path.c_str(), error); + if (item != NULL) + result = item->findAndDeleteElement(key, all_tags, all_tags); + else + return makeOFCondition(OFM_dcmdata,22,OF_error,error.c_str()); + } + // other user specified single tag without path + else + { + result = dset->findAndDeleteElement(key, all_tags, all_tags); + } + if (ignore_missing_tags && (result == EC_TagNotFound)) + return EC_Normal; + return result; + } + + // do not delete all tags -> use path functions + DcmPathProcessor pathProc; + + Uint32 numDeletions = 0; + result = pathProc.findOrDeletePath(dset, tag_path, numDeletions); + if (ignore_missing_tags && (result == EC_TagNotFound)) + return EC_Normal; + return result; +} + + +OFCondition MdfDatasetManager::deletePrivateData() +{ + // if no file loaded : return an error + if (dfile == NULL) + return makeOFCondition(OFM_dcmdata,22,OF_error,"No file loaded yet!"); + + DcmStack stack; + DcmObject *dobj = NULL; + DcmTagKey tag; + OFCondition status = dset->nextObject(stack, OFTrue); + while (status.good()) + { + dobj = stack.top(); + tag = dobj->getTag(); + if (tag.getGroup() & 1) // private tag ? + { + stack.pop(); + delete OFstatic_cast(DcmItem *, (stack.top()))->remove(dobj); + } + status = dset->nextObject(stack, OFTrue); + } + return EC_Normal; +} + + +OFCondition MdfDatasetManager::generateAndInsertUID(const DcmTagKey& uidKey) +{ + // if no file loaded : return an error + if (dfile==NULL) + return makeOFCondition(OFM_dcmdata,22,OF_error,"No file loaded yet!"); + + OFCondition result; + char uid[100]; + if (uidKey == DCM_StudyInstanceUID) + dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT); + else if (uidKey == DCM_SeriesInstanceUID) + dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT); + else if (uidKey == DCM_SOPInstanceUID) + { + dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT); + // force meta-header to refresh SOP Class/Instance UIDs. + DcmItem *meta_info = dfile->getMetaInfo(); + if (meta_info) + { + delete meta_info->remove(DCM_MediaStorageSOPInstanceUID); + } + } + else return EC_IllegalCall; + result = dset->putAndInsertString(uidKey, uid); + return result; +} + + +OFCondition MdfDatasetManager::saveFile(const char *file_name, + E_TransferSyntax opt_xfer, + E_EncodingType opt_enctype, + E_GrpLenEncoding opt_glenc, + E_PaddingEncoding opt_padenc, + OFCmdUnsignedInt opt_filepad, + OFCmdUnsignedInt opt_itempad, + OFBool opt_dataset) +{ + // if no file loaded: return an error + if (dfile==NULL) + return makeOFCondition(OFM_dcmdata,22,OF_error,"No file loaded yet!"); + + OFCondition result; + /* check whether transfer syntax is possible */ + if ( (opt_xfer==EXS_Unknown) || (dfile->canWriteXfer(opt_xfer)) ) + { + /* check whether pixel data is compressed */ + if (opt_dataset && DcmXfer(opt_xfer).isEncapsulated()) + { + OFLOG_WARN(mdfdsmanLogger, "encapsulated pixel data requires file format, ignoring --write-dataset"); + opt_dataset = OFFalse; + } + /* be sure that we have a known transfer syntax. The original xfer can + * be unknown if the dataset was created in memory, or if the originally + * loaded file does not contain attributes which could make sense if + * it is a template file that should be processed with dcmodify. + */ + if ((dfile->getDataset()->getOriginalXfer() == EXS_Unknown) && (opt_xfer == EXS_Unknown)) + { + opt_xfer = EXS_LittleEndianExplicit; + } + /* write DICOM file */ + result = dfile->saveFile(file_name, opt_xfer, opt_enctype, opt_glenc, + opt_padenc, + OFstatic_cast(Uint32, opt_filepad), + OFstatic_cast(Uint32, opt_itempad), + (opt_dataset) ? EWM_dataset : EWM_fileformat); + + } else { + OFLOG_DEBUG(mdfdsmanLogger, "no conversion to transfer syntax " << DcmXfer(opt_xfer).getXferName() << " possible!"); + result = EC_CannotChangeRepresentation; + } + // save file + OFLOG_INFO(mdfdsmanLogger, "Saving current dataset to file: " << file_name); + return result; +} + + +OFCondition MdfDatasetManager::saveFile() +{ + // save file without changing any parameters + return saveFile(current_file.c_str(), EXS_Unknown, EET_UndefinedLength, + EGL_recalcGL, EPD_noChange, 0, 0, OFFalse); +} + + +OFCondition MdfDatasetManager::startModify(DcmElement *elem, + const OFString &value) +{ + OFCondition result; + DcmEVR vr = elem->getTag().getEVR(); + if ( ignore_un_modifies && ((vr == EVR_UN) || (vr == EVR_UNKNOWN) || (vr == EVR_UNKNOWN2B))) + { + OFLOG_WARN(mdfdsmanLogger, "will not write value to attribute having VR=UN: " << elem->getTag().toString()); + return EC_Normal; + } + // start putString function being defined on all VRs + result = elem->putString(value.c_str()); + return result; +} + + +void MdfDatasetManager::deleteRelatedMetaheaderTag(const DcmTagKey &key) +{ + DcmItem *meta_info=dfile->getMetaInfo(); + if (meta_info) + { + if (key==DCM_SOPInstanceUID) + delete meta_info->remove(DCM_MediaStorageSOPInstanceUID); + else if (key==DCM_SOPClassUID) + delete meta_info->remove(DCM_MediaStorageSOPClassUID); + } +} + + +DcmDataset* MdfDatasetManager::getDataset() +{ + return dset; +} + + +DcmFileFormat* MdfDatasetManager::getFileFormat() +{ + return dfile; +} + + +OFString MdfDatasetManager::getFilename() const +{ + return current_file; +} + + +OFBool MdfDatasetManager::isTagInDictionary(const DcmTagKey &search_key) +{ + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(search_key,NULL); + // successful lookup in dictionary -> translate to tag and return + dcmDataDict.rdunlock(); + if (dicent) + return OFTrue; + else return OFFalse; +} + + +void MdfDatasetManager::setModifyUNValues(OFBool modifyUNValues) +{ + ignore_un_modifies = !modifyUNValues; +} + + +MdfDatasetManager::~MdfDatasetManager() +{ + // cleanup + delete dfile; +} diff --git a/dcmdata/apps/mdfdsman.h b/dcmdata/apps/mdfdsman.h new file mode 100644 index 00000000..f2b227a2 --- /dev/null +++ b/dcmdata/apps/mdfdsman.h @@ -0,0 +1,257 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class for modifying DICOM files + * + */ + +#ifndef MDFDSMAN_H +#define MDFDSMAN_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/ofstd/ofcmdln.h" + + +// forward declarations +class DcmDataset; +class DcmFileFormat; +class DcmElement; + + +/** This class encapsulates data structures and operations for modifying + * DICOM files. Therefore it allows the process of load->modify->save to + * provide this service. + */ +class MdfDatasetManager +{ +public: + + /** Constructor, initializes member-variables + */ + MdfDatasetManager(); + + /** Destructor + */ + ~MdfDatasetManager(); + + /** Loads a file into dataset manager + * @param file_name file to be loaded + @param readMode read file with or without metaheader. Default=autodetect + @param xfer try to read with this transfer syntax. Default=autodetect + @param createIfNecessary If true, the file is created if it does not exist + * @return returns EC_Normal if everything is OK, else an error + */ + OFCondition loadFile(const char *file_name, + const E_FileReadMode readMode = ERM_autoDetect, + const E_TransferSyntax xfer = EXS_Unknown, + const OFBool createIfNecessary = OFFalse); + + /** Modifies/Inserts a path (with a specific value if desired). + * @param tag_path path to item/element + * @param value denotes new value of tag + * @param only_modify if true, only existing tags are processed. If false, + * any not existing tag is inserted + * @param update_metaheader updates metaheader UIDs, if related UIDs in + * dataset are changed (default=true) + * @param ignore_missing_tags if true, tags that could not be found + * while modifying (only_modify must be true) + * are handled as non-errors + * @param no_reservation_checks if true, any missing private reservation + * tags are ignored when inserting private + * tags. Only makes sense w/o only_modify + * @return returns EC_Normal if everything is OK, else an error + */ + OFCondition modifyOrInsertPath(OFString tag_path, + const OFString &value, + const OFBool only_modify, + const OFBool update_metaheader = OFTrue, + const OFBool ignore_missing_tags = OFFalse, + const OFBool no_reservation_checks = OFFalse); + + /** Modifies/Inserts a path with a specific value read from file + * @param tag_path path to item/element + * @param filename name of the file from which the value should be read + * @param only_modify if true, only existing tags are processed. If false, + * any not existing tag is inserted + * @param update_metaheader updates metaheader UIDs, if related UIDs in + * dataset are changed (default=true) + * @param ignore_missing_tags if true, tags that could not be found + * while modifying (only_modify must be true) + * are handled as non-errors + * @param no_reservation_checks if true, any missing private reservation + * tags are ignored when inserting private + * tags. Only makes sense w/o only_modify + * @return returns EC_Normal if everything is OK, else an error + */ + OFCondition modifyOrInsertFromFile(OFString tag_path, + const OFString &filename, + const OFBool only_modify, + const OFBool update_metaheader = OFTrue, + const OFBool ignore_missing_tags = OFFalse, + const OFBool no_reservation_checks = OFFalse); + + /** Modifies all matching tags in dataset to a new value + * @param tag_path denotes, which tag to modify + * @param value denotes new value of tag + * @param update_metaheader if true, metaheader UIDs are updated, + * if related dataset UIDs are changed, (default=true) + * @param count returns the number of tags that were affected + * @param ignore_missing_tags if true, tags that could not be found + * while modifying are handled as non-errors + * @return returns EC_Normal if everything is OK, else an error + */ + OFCondition modifyAllTags(OFString tag_path, + const OFString &value, + const OFBool update_metaheader, + int &count, + const OFBool ignore_missing_tags = OFFalse); + + /** Deletes tag in dataset + * @param tag_path holds complete path to tag + * @param all_tags if true, tag is deleted at all levels of dataset, + * else only 1st level is accessed + * @param ignore_missing_tags if true, tags that could not be found + * while modifying are handled as non-errors + * @return returns EC_Normal if everything is OK, else an error + */ + OFCondition deleteTag(OFString tag_path, + const OFBool all_tags, + const OFBool ignore_missing_tags); + + /** Deletes all private data from file,\ i.e. all tags having + * odd group numbers. + * @return EC_Normal, if deletion was successful; error code otherwise + */ + OFCondition deletePrivateData(); + + /** Inserts new Study, Series or SOP Instance UID. If SOP Instance + * UID is generated, the related tag in the metaheader is deleted, too + * so that the new UID is also applied there when saving to disk later. + * @param uidKey [in] The Instance UID to insert (study, series or sop + * instance UID key permitted). + * @return EC_Normal, if insertion was successful, error otherwise + */ + OFCondition generateAndInsertUID(const DcmTagKey &uidKey); + + /** Saves current dataset back to a file. Caution: After saving + * MdfDatasetManager keeps working on old filename. + * @param file_name filename to save to + * @param opt_xfer transfer syntax to save to (EXS_Unknown: don't change) + * @param opt_enctype write with explicit or implicit length encoding + * @param opt_glenc option to set group length calculation mode + * @param opt_padenc sets padding option + * @param opt_filepad pad file to a multiple of this options value + * @param opt_itempad pad item to a multiple of this options value + * @param opt_dataset if true, write only dataset, else write fileformat + * @return returns EC_Normal if everything is OK, else an error + */ + OFCondition saveFile(const char *file_name, + E_TransferSyntax opt_xfer = EXS_Unknown, + E_EncodingType opt_enctype = EET_UndefinedLength, + E_GrpLenEncoding opt_glenc = EGL_recalcGL, + E_PaddingEncoding opt_padenc = EPD_noChange, + OFCmdUnsignedInt opt_filepad = 0, + OFCmdUnsignedInt opt_itempad = 0, + OFBool opt_dataset = OFFalse); + + /** Saves current dataset back to file using original filename and original + * parameters like transfer syntax, padding etc. + * @return returns EC_Normal if everything is OK, else an error + */ + OFCondition saveFile(); + + /** Returns the dataset that this MdfDatasetManager handles. + * You should use the returned object with care to avoid side effects with + * other class methods that modify this object, too. + * @return returns the dataset, this MdfDatasetManager manages and NULL, if + * no dataset is loaded + */ + DcmDataset* getDataset(); + + + /** Returns the DcmFileFormat that this MdfDatasetManager handles. + * You should use the returned object with care to avoid side-effects with + * other class methods that modify this object, too. + * @return returns the DcmFileFormat, this MdfDatasetManager manages and + * NULL, if no file is loaded + */ + DcmFileFormat* getFileFormat(); + + /** Returns filename of the file that is currently loaded. + * @return returns filename and "" if no file is loaded. + */ + OFString getFilename() const; + + /** Sets whether attributes with VR of UN should be modified or + * left alone. + * @param modifyUNValues [in] If set, UN values will be modified (default) + */ + void setModifyUNValues(OFBool modifyUNValues); + +protected: + + /** modifies element to a specific value + * @param elem element that should be changed + * @param value the value, the element should be changed to + * @return OFCondition, which returns an error code if an error occurs + */ + OFCondition startModify(DcmElement *elem, + const OFString &value); + + /** If key is the tag for SOPInstanceUID or SOPClassUID, then this function + * removes the related MediaStorage UIDs from the metaheader. The + * metaheader is then updated "automagically" when the file is saved back to + * disk. + * @param key tag to examine + */ + void deleteRelatedMetaheaderTag(const DcmTagKey &key); + + /** Returns true, if given tag key can be found in dictionary + * @param search_key tag to lookup + * @return OFTrue if tag could be found, else OFFalse + */ + OFBool isTagInDictionary(const DcmTagKey &search_key); + +private: + + /// name of file that is currently loaded + OFString current_file; + + /// will hold file to modify + DcmFileFormat *dfile; + + /// will hold the dataset that should be modified + DcmDataset *dset; + + /// if enabled, no value modifications on attributes having VR of UN + /// are not executed + OFBool ignore_un_modifies; + + /** private undefined assignment operator + */ + MdfDatasetManager &operator=(const MdfDatasetManager &); + + /** private undefined copy constructor + */ + MdfDatasetManager(const MdfDatasetManager &); +}; + +#endif // MDFDSMAN_H diff --git a/dcmdata/apps/pdf2dcm.cc b/dcmdata/apps/pdf2dcm.cc new file mode 100644 index 00000000..95839753 --- /dev/null +++ b/dcmdata/apps/pdf2dcm.cc @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 2005-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg, Pedro Arizpe + * + * Purpose: Encapsulate PDF file into a DICOM file + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcencdoc.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "pdf2dcm" + +static OFLogger pdf2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" +OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encapsulate PDF file into DICOM format", rcsid); + OFCommandLine cmd; + int errorCode = EXITCODE_NO_ERROR; + OFCondition result = EC_Normal; + DcmFileFormat fileformat; + DcmEncapsulatedDocument encapsulator; + + OFLOG_TRACE(pdf2dcmLogger, "Including necessary options"); + encapsulator.addPDFCommandlineOptions(cmd); + OFLOG_TRACE(pdf2dcmLogger, "Evaluating command line"); + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + + if (app.parseCommandLine(cmd, argc, argv)) { + OFLOG_TRACE(pdf2dcmLogger, "Checking exclusive options first"); + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used: "; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return EXITCODE_NO_ERROR; + } + } + encapsulator.parseArguments(app, cmd); + } + //print resource identifier + OFLOG_DEBUG(pdf2dcmLogger, rcsid << OFendl); + + OFLOG_DEBUG(pdf2dcmLogger, "making sure data dictionary is loaded"); + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(pdf2dcmLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + OFLOG_DEBUG(pdf2dcmLogger, "Creating identifiers (and reading series data)"); + result = encapsulator.createIdentifiers(pdf2dcmLogger); + if (result.bad()) + { + OFLOG_FATAL(pdf2dcmLogger, "There was an error while reading the series data"); + return EXITCODE_INVALID_INPUT_FILE; + } + OFLOG_INFO(pdf2dcmLogger, "creating encapsulated PDF object"); + errorCode = encapsulator.insertEncapsulatedDocument(fileformat.getDataset(), pdf2dcmLogger); + if (errorCode != EXITCODE_NO_ERROR) + { + OFLOG_ERROR(pdf2dcmLogger, "unable to create PDF encapsulation to DICOM format"); + return errorCode; + } + OFLOG_INFO(pdf2dcmLogger, "Generating an instance number that is guaranteed to be unique within a series."); + result = encapsulator.createHeader(fileformat.getDataset(), pdf2dcmLogger); + if (result.bad()) + { + OFLOG_ERROR(pdf2dcmLogger, "unable to create DICOM header: " << result.text()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + OFLOG_INFO(pdf2dcmLogger, "writing encapsulated PDF object as file " << encapsulator.getOutputFileName()); + + OFLOG_INFO(pdf2dcmLogger, "Check if new output transfer syntax is possible"); + + DcmXfer opt_oxferSyn(encapsulator.getTransferSyntax()); + + fileformat.getDataset()->chooseRepresentation(encapsulator.getTransferSyntax(), NULL); + if (fileformat.getDataset()->canWriteXfer(encapsulator.getTransferSyntax())) + { + OFLOG_INFO(pdf2dcmLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written"); + } + else { + OFLOG_ERROR(pdf2dcmLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + OFLOG_INFO(pdf2dcmLogger, "Checking for DICOM key overriding"); + result = encapsulator.applyOverrideKeys(fileformat.getDataset()); + if (result.bad()) + { + OFLOG_ERROR(pdf2dcmLogger, "There was a problem while overriding a key:" << OFendl + << result.text()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + OFLOG_INFO(pdf2dcmLogger, "write converted DICOM file with metaheader"); + result = encapsulator.saveFile(fileformat); + if (result.bad()) + { + OFLOG_ERROR(pdf2dcmLogger, result.text() << ": writing file: " << encapsulator.getOutputFileName()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + + OFLOG_INFO(pdf2dcmLogger, "PDF encapsulation successful"); + + return EXITCODE_NO_ERROR; +} diff --git a/dcmdata/apps/stl2dcm.cc b/dcmdata/apps/stl2dcm.cc new file mode 100755 index 00000000..d684679d --- /dev/null +++ b/dcmdata/apps/stl2dcm.cc @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 2018-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Pedro Arizpe + * + * Purpose: Encapsulate STL file into a DICOM file + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first*/ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcencdoc.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "stl2dcm" + +static OFLogger stl2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" +OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encapsulate STL file into DICOM format", rcsid); + OFCommandLine cmd; + int errorCode = EXITCODE_NO_ERROR; + OFCondition result = EC_Normal; + DcmFileFormat fileformat; + DcmEncapsulatedDocument encapsulator; + + OFLOG_TRACE(stl2dcmLogger, "Including necessary options"); + encapsulator.addSTLCommandlineOptions(cmd); + OFLOG_TRACE(stl2dcmLogger, "Evaluating command line"); + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + + if (app.parseCommandLine(cmd, argc, argv)) { + OFLOG_TRACE(stl2dcmLogger, "Checking exclusive options first"); + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used: "; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return EXITCODE_NO_ERROR; + } + } + encapsulator.parseArguments(app, cmd); + } + //print resource identifier + OFLOG_DEBUG(stl2dcmLogger, rcsid << OFendl); + + OFLOG_DEBUG(stl2dcmLogger, "making sure data dictionary is loaded"); + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(stl2dcmLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + OFLOG_DEBUG(stl2dcmLogger, "Creating identifiers (and reading series data)"); + result = encapsulator.createIdentifiers(stl2dcmLogger); + if (result.bad()) + { + OFLOG_FATAL(stl2dcmLogger, "There was an error while reading the series data"); + return EXITCODE_INVALID_INPUT_FILE; + } + OFLOG_INFO(stl2dcmLogger, "creating encapsulated STL object"); + errorCode = encapsulator.insertEncapsulatedDocument(fileformat.getDataset(), stl2dcmLogger); + if (errorCode != EXITCODE_NO_ERROR) + { + OFLOG_ERROR(stl2dcmLogger, "unable to create STL encapsulation to DICOM format"); + return errorCode; + } + OFLOG_INFO(stl2dcmLogger, "Generating an instance number that is guaranteed to be unique within a series."); + result = encapsulator.createHeader(fileformat.getDataset(), stl2dcmLogger); + if (result.bad()) + { + OFLOG_ERROR(stl2dcmLogger, "unable to create DICOM header: " << result.text()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + OFLOG_INFO(stl2dcmLogger, "writing encapsulated STL object as file " << encapsulator.getOutputFileName()); + + OFLOG_INFO(stl2dcmLogger, "Check if new output transfer syntax is possible"); + + DcmXfer opt_oxferSyn(encapsulator.getTransferSyntax()); + + fileformat.getDataset()->chooseRepresentation(encapsulator.getTransferSyntax(), NULL); + if (fileformat.getDataset()->canWriteXfer(encapsulator.getTransferSyntax())) + { + OFLOG_INFO(stl2dcmLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written"); + } + else { + OFLOG_ERROR(stl2dcmLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + OFLOG_INFO(stl2dcmLogger, "Checking for DICOM key overriding"); + result = encapsulator.applyOverrideKeys(fileformat.getDataset()); + if (result.bad()) + { + OFLOG_ERROR(stl2dcmLogger, "There was a problem while overriding a key:" << OFendl + << result.text()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + OFLOG_INFO(stl2dcmLogger, "write converted DICOM file with metaheader"); + result = encapsulator.saveFile(fileformat); + if (result.bad()) + { + OFLOG_ERROR(stl2dcmLogger, result.text() << ": writing file: " << encapsulator.getOutputFileName()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + + OFLOG_INFO(stl2dcmLogger, "STL encapsulation successful"); + + return EXITCODE_NO_ERROR; +} diff --git a/dcmdata/apps/xml2dcm.cc b/dcmdata/apps/xml2dcm.cc new file mode 100644 index 00000000..6392fb9d --- /dev/null +++ b/dcmdata/apps/xml2dcm.cc @@ -0,0 +1,1034 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Convert XML document to DICOM file or data set + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ + +#define INCLUDE_CSTDARG +#include "dcmtk/ofstd/ofstdinc.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "xml2dcm" +#define OFFIS_CONSOLE_DESCRIPTION "Convert XML document to DICOM file or data set" + +// currently not used since DTD is always retrieved from XML document +//#define DOCUMENT_TYPE_DEFINITION_FILE "dcm2xml.dtd" + +static OFLogger xml2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); +static OFLogger xmlLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION ".libxml"); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + +#ifdef WITH_LIBXML + +#ifdef __ibmxl__ +// IBM xlC defines __GNUC__ but does not support the GNUC extension +// __attribute__ ((format (printf, 2, 3))). +// This avoids a compiler warning in . +#define LIBXML_ATTR_FORMAT(fmt,args) +#endif + +// The libxml library also uses unicode. So we have to reuse some +// workarounds for the ICU library here as well. +// The type char16_t is only supported since C++11. +#ifndef HAVE_CHAR16_T +#define UCHAR_TYPE uint16_t +#endif + +//If U_NOEXCEPT is not defined, ICU falls back to NOEXCEPT. +#ifndef HAVE_CXX11 +#define U_NOEXCEPT +#endif + +#include + + +// stores pointer to character encoding handler +static xmlCharEncodingHandlerPtr EncodingHandler = NULL; + +// This function is also used in dcmsr, try to stay in sync! +extern "C" void errorFunction(void * ctx, const char *msg, ...) +{ +#if defined(HAVE_VSNPRINTF) && defined(HAVE_PROTOTYPE_VSNPRINTF) + // Classic C requires us to declare variables at the beginning of the function. + OFString &buffer = *OFstatic_cast(OFString*, ctx); +#endif + + if (!xmlLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + return; + +#if defined(HAVE_VSNPRINTF) && defined(HAVE_PROTOTYPE_VSNPRINTF) + // libxml calls us multiple times for one line of log output which would + // result in garbled output. To avoid this, we buffer the output in a local + // string in the caller which we get through our 'ctx' parameter. Then, we + // output this string on one go when we receive a newline. + va_list ap; + char buf[1024]; + + va_start(ap, msg); +#ifdef HAVE_PROTOTYPE_STD__VSNPRINTF + std::vsnprintf(buf, 1024, msg, ap); +#else + vsnprintf(buf, 1024, msg, ap); +#endif + va_end(ap); + + // Since we can't do anything about a too small buffer for vsnprintf(), we + // ignore it. But we do make sure the buffer is null-terminated! + buf[1023] = '\0'; + buffer += buf; + + // If there is a full line in the buffer... + size_t pos = buffer.find('\n'); + while (pos != OFString_npos) + { + // ..output it and remove it from the buffer + OFLOG_DEBUG(xmlLogger, buffer.substr(0, pos)); + buffer.erase(0, pos + 1); + + pos = buffer.find('\n'); + } +#elif defined(HAVE_VPRINTF) + // No vsnprint, but at least vfprintf. Output the messages directly to stderr. + va_list ap; + va_start(ap, msg); +#ifdef HAVE_PROTOTYPE_STD__VFPRINTF + std::vfprintf(stderr, msg, ap); +#else + vfprintf(stderr, msg, ap); +#endif + va_end(ap); +#else + // We can only show the most basic part of the message, this will look bad :( + printf("%s", msg); +#endif +} + + +static OFBool convertUtf8ToCharset(const xmlChar *fromString, + OFString &toString) +{ + OFBool result = OFFalse; + if (EncodingHandler != NULL) + { + /* prepare input/output buffers */ + xmlBufferPtr fromBuffer = xmlBufferCreate(); + xmlBufferPtr toBuffer = xmlBufferCreate(); + xmlBufferCat(fromBuffer, fromString); + /* convert character encoding of given string */ + result = (xmlCharEncOutFunc(EncodingHandler, toBuffer, fromBuffer) >= 0); + if (result) + toString = OFreinterpret_cast(const char *, xmlBufferContent(toBuffer)); + /* free allocated memory */ + xmlBufferFree(toBuffer); + xmlBufferFree(fromBuffer); + } + return result; +} + + +static OFCondition checkNode(xmlNodePtr current, + const char *name) +{ + OFCondition result = EC_Normal; + /* check whether node is valid at all */ + if (current != NULL) + { + /* check whether node has expected name */ + if (xmlStrcmp(current->name, OFreinterpret_cast(const xmlChar *, name)) != 0) + { + OFLOG_ERROR(xml2dcmLogger, "document of the wrong type, was '" << current->name << "', '" << name << "' expected"); + result = EC_IllegalCall; + } + } else { + OFLOG_ERROR(xml2dcmLogger, "document of the wrong type, '" << name << "' expected"); + result = EC_IllegalCall; + } + return result; +} + + +static OFCondition createNewElement(xmlNodePtr current, + DcmElement *&newElem) +{ + OFCondition result = EC_IllegalCall; + /* check whether node is valid */ + if (current != NULL) + { + /* get required information from XML element */ + xmlChar *elemTag = xmlGetProp(current, OFreinterpret_cast(const xmlChar *, "tag")); + xmlChar *elemVR = xmlGetProp(current, OFreinterpret_cast(const xmlChar *, "vr")); + /* convert tag string */ + DcmTagKey dcmTagKey; + unsigned int group = 0xffff; + unsigned int elem = 0xffff; + /* make sure that "tag" attribute exists */ + if (elemTag == NULL) + { + OFLOG_WARN(xml2dcmLogger, "missing 'tag' attribute, ignoring node"); + result = EC_InvalidTag; + } + /* determine group and element number from "tag" */ + else if (sscanf(OFreinterpret_cast(char *, elemTag), "%x,%x", &group, &elem ) == 2) + { + dcmTagKey.set(OFstatic_cast(Uint16, group), OFstatic_cast(Uint16, elem)); + DcmTag dcmTag(dcmTagKey); + /* convert vr string */ + DcmVR dcmVR(OFreinterpret_cast(char *, elemVR)); + DcmEVR dcmEVR = dcmVR.getEVR(); + if (dcmEVR == EVR_UNKNOWN) + { + /* check whether "vr" attribute exists */ + if (elemVR == NULL) + { + OFLOG_WARN(xml2dcmLogger, "missing 'vr' attribute for " << dcmTag + << ", using unknown VR"); + } else { + OFLOG_WARN(xml2dcmLogger, "invalid 'vr' attribute (" << elemVR + << ") for " << dcmTag << ", using unknown VR"); + } + } + /* check for correct vr */ + const DcmEVR tagEVR = dcmTag.getEVR(); + if ((tagEVR != dcmEVR) && (dcmEVR != EVR_UNKNOWN) && (tagEVR != EVR_UNKNOWN) && + ((dcmTagKey != DCM_LUTData) || ((dcmEVR != EVR_US) && (dcmEVR != EVR_SS) && (dcmEVR != EVR_OW))) && + ((tagEVR != EVR_xs) || ((dcmEVR != EVR_US) && (dcmEVR != EVR_SS))) && + ((tagEVR != EVR_ox) || ((dcmEVR != EVR_OB) && (dcmEVR != EVR_OW)))) + { + OFLOG_WARN(xml2dcmLogger, "tag " << dcmTag << " has wrong VR (" << dcmVR.getVRName() + << "), correct is " << dcmTag.getVR().getVRName()); + } + if (dcmEVR != EVR_UNKNOWN) + dcmTag.setVR(dcmVR); + /* create DICOM element */ + result = DcmItem::newDicomElementWithVR(newElem, dcmTag); + } else { + OFLOG_WARN(xml2dcmLogger, "invalid 'tag' attribute (" << elemTag << "), ignoring node"); + result = EC_InvalidTag; + } + if (result.bad()) + { + /* delete new element if an error occurred */ + delete newElem; + newElem = NULL; + } + /* free allocated memory */ + xmlFree(elemTag); + xmlFree(elemVR); + } + return result; +} + + +static OFCondition putElementContent(xmlNodePtr current, + DcmElement *element) +{ + OFCondition result = EC_IllegalCall; + /* check whether node and element are valid */ + if ((current != NULL) && (element != NULL)) + { + DcmEVR dcmEVR = element->getVR(); + /* get the XML node content */ + xmlChar *elemVal = xmlNodeGetContent(current); + xmlChar *attrVal = xmlGetProp(current, OFreinterpret_cast(const xmlChar *, "binary")); + /* check whether node content is present */ + if (xmlStrcmp(attrVal, OFreinterpret_cast(const xmlChar *, "hidden")) == 0) + OFLOG_WARN(xml2dcmLogger, "content of node " << element->getTag() << " is 'hidden', empty element inserted"); + /* check whether node content is base64 encoded */ + else if (xmlStrcmp(attrVal, OFreinterpret_cast(const xmlChar *, "base64")) == 0) + { + Uint8 *data = NULL; + const size_t length = OFStandard::decodeBase64(OFreinterpret_cast(char *, elemVal), data); + if (length > 0) + { + if (dcmEVR == EVR_OW) + { + /* Base64 decoder produces big endian output data, convert to local byte order */ + swapIfNecessary(gLocalByteOrder, EBO_BigEndian, data, OFstatic_cast(Uint32, length), sizeof(Uint16)); + } + result = element->putUint8Array(data, OFstatic_cast(Uint32, length)); + /* delete buffer since data is copied into the element */ + delete[] data; + } + } + /* check whether node content is stored in a file */ + else if (xmlStrcmp(attrVal, OFreinterpret_cast(const xmlChar *, "file")) == 0) + { + if (xmlStrlen(elemVal) > 0) + { + const char *filename = OFreinterpret_cast(char *, elemVal); + /* try to open binary file */ + FILE *f = fopen(filename, "rb"); + if (f != NULL) + { + /* determine filesize */ + const size_t fileSize = OFStandard::getFileSize(filename); + size_t buflen = fileSize; + /* if odd then make even (DICOM requires even length values) */ + if (buflen & 1) + buflen++; + Uint8 *buf = NULL; + /* create buffer of OB or OW data */ + if (dcmEVR == EVR_OW) + { + Uint16 *buf16 = NULL; + result = element->createUint16Array(OFstatic_cast(Uint32, buflen / 2), buf16); + buf = OFreinterpret_cast(Uint8 *, buf16); + } else + result = element->createUint8Array(OFstatic_cast(Uint32, buflen), buf); + if (result.good()) + { + /* read binary file into the buffer */ + if (fread(buf, 1, OFstatic_cast(size_t, fileSize), f) != fileSize) + { + OFLOG_ERROR(xml2dcmLogger, "error reading binary data file: " << filename << ": " << OFStandard::getLastSystemErrorCode().message()); + result = EC_CorruptedData; + } + else if (dcmEVR == EVR_OW) + { + /* swap 16 bit OW data (if necessary) */ + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, buf, OFstatic_cast(Uint32, buflen), sizeof(Uint16)); + } + } + fclose(f); + } else { + OFLOG_ERROR(xml2dcmLogger, "cannot open binary data file: " << filename); + result = EC_InvalidTag; + } + } else + OFLOG_ERROR(xml2dcmLogger, "filename for element " << element->getTag() << " is missing, empty element inserted"); + } else { + OFString dicomVal; + /* convert character set from UTF-8 (for specific VRs only) */ + if (element->isAffectedBySpecificCharacterSet() && + (xmlStrlen(elemVal) > 0) && convertUtf8ToCharset(elemVal, dicomVal)) + { + result = element->putOFStringArray(dicomVal); + } else { + /* set the value of the newly created element */ + result = element->putString(OFreinterpret_cast(char *, elemVal)); + } + } + /* free allocated memory */ + xmlFree(elemVal); + xmlFree(attrVal); + } + return result; +} + + +static OFCondition parseElement(DcmItem *dataset, + xmlNodePtr current) +{ + DcmElement *newElem = NULL; + /* create new DICOM element from XML element */ + OFCondition result = createNewElement(current, newElem); + if (result.good()) + { + /* retrieve specific character set (only on main dataset level) */ + if ((EncodingHandler == NULL) && (dataset->ident() == EVR_dataset) && + (newElem->getTag() == DCM_SpecificCharacterSet)) + { + const char *encString = NULL; + xmlChar *elemVal = xmlNodeGetContent(current); + /* check for known character set */ + if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 6")) == 0) + encString = "UTF-8"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 192")) == 0) + encString = "UTF-8"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 100")) == 0) + encString = "ISO-8859-1"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 101")) == 0) + encString = "ISO-8859-2"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 109")) == 0) + encString = "ISO-8859-3"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 110")) == 0) + encString = "ISO-8859-4"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 148")) == 0) + encString = "ISO-8859-9"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 144")) == 0) + encString = "ISO-8859-5"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 127")) == 0) + encString = "ISO-8859-6"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 126")) == 0) + encString = "ISO-8859-7"; + else if (xmlStrcmp(elemVal, OFreinterpret_cast(const xmlChar *, "ISO_IR 138")) == 0) + encString = "ISO-8859-8"; + else if (xmlStrlen(elemVal) > 0) + OFLOG_ERROR(xml2dcmLogger, "character set '" << elemVal << "' not supported"); + if (encString != NULL) + { + /* find appropriate encoding handler */ + EncodingHandler = xmlFindCharEncodingHandler(encString); + } + xmlFree(elemVal); + } + /* set the element value */ + result = putElementContent(current, newElem); + /* insert the new element into the dataset */ + if (result.good()) + result = dataset->insert(newElem, OFTrue /*replaceOld*/); + if (result.bad()) + { + /* delete element if insertion or putting the value failed */ + delete newElem; + } + } + return result; +} + + +// forward declaration +static OFCondition parseDataSet(DcmItem *dataset, + xmlNodePtr current, + E_TransferSyntax xfer); + + +static OFCondition parseSequence(DcmSequenceOfItems *sequence, + xmlNodePtr current, + E_TransferSyntax xfer) +{ + OFCondition result = EC_IllegalCall; + if (sequence != NULL) + { + /* ignore blank (empty or whitespace only) nodes */ + while ((current != NULL) && xmlIsBlankNode(current)) + current = current->next; + while (current != NULL) + { + /* ignore non-item nodes */ + if (xmlStrcmp(current->name, OFreinterpret_cast(const xmlChar *, "item")) == 0) + { + /* create new sequence item */ + DcmItem *newItem = new DcmItem(); + if (newItem != NULL) + { + sequence->insert(newItem); + /* proceed parsing the item content */ + parseDataSet(newItem, current->xmlChildrenNode, xfer); + } + } else if (!xmlIsBlankNode(current)) + OFLOG_WARN(xml2dcmLogger, "unexpected node '" << current->name << "', 'item' expected, skipping"); + /* proceed with next node */ + current = current->next; + } + result = EC_Normal; + } + return result; +} + + +static OFCondition parsePixelSequence(DcmPixelSequence *sequence, + xmlNodePtr current) +{ + OFCondition result = EC_IllegalCall; + if (sequence != NULL) + { + /* ignore blank (empty or whitespace only) nodes */ + while ((current != NULL) && xmlIsBlankNode(current)) + current = current->next; + while (current != NULL) + { + /* ignore non-pixel-item nodes */ + if (xmlStrcmp(current->name, OFreinterpret_cast(const xmlChar *, "pixel-item")) == 0) + { + /* create new pixel item */ + DcmPixelItem *newItem = new DcmPixelItem(DCM_PixelItemTag); + if (newItem != NULL) + { + sequence->insert(newItem); + /* put pixel data into the item */ + putElementContent(current, newItem); + } + } else if (!xmlIsBlankNode(current)) + OFLOG_WARN(xml2dcmLogger, "unexpected node '" << current->name << "', 'pixel-item' expected, skipping"); + /* proceed with next node */ + current = current->next; + } + result = EC_Normal; + } + return result; +} + + +static OFCondition parseMetaHeader(DcmMetaInfo *metainfo, + xmlNodePtr current, + const OFBool parse) +{ + /* check for valid node and correct name */ + OFCondition result = checkNode(current, "meta-header"); + if (result.good() && parse) + { + /* get child nodes */ + current = current->xmlChildrenNode; + while (current != NULL) + { + /* ignore non-element nodes */ + if (xmlStrcmp(current->name, OFreinterpret_cast(const xmlChar *, "element")) == 0) + parseElement(metainfo, current); + else if (!xmlIsBlankNode(current)) + OFLOG_WARN(xml2dcmLogger, "unexpected node '" << current->name << "', 'element' expected, skipping"); + /* proceed with next node */ + current = current->next; + } + } + return result; +} + + +static OFCondition parseDataSet(DcmItem *dataset, + xmlNodePtr current, + E_TransferSyntax xfer) +{ + OFCondition result = EC_Normal; + /* ignore blank (empty or whitespace only) nodes */ + while ((current != NULL) && xmlIsBlankNode(current)) + current = current->next; + while (current != NULL) + { + /* ignore non-element/sequence nodes */ + if (xmlStrcmp(current->name, OFreinterpret_cast(const xmlChar *, "element")) == 0) + parseElement(dataset, current); + else if (xmlStrcmp(current->name, OFreinterpret_cast(const xmlChar *, "sequence")) == 0) + { + DcmElement *newElem = NULL; + /* create new sequence element */ + if (createNewElement(current, newElem).good()) + { + /* insert new sequence element into the dataset */ + result = dataset->insert(newElem, OFTrue /*replaceOld*/); + if (result.good()) + { + /* special handling for compressed pixel data */ + if (newElem->getTag() == DCM_PixelData) + { + /* create new pixel sequence */ + DcmPixelSequence *sequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (sequence != NULL) + { + if (newElem->ident() == EVR_PixelData) + { + /* ... insert it into the dataset and proceed with the pixel items */ + OFstatic_cast(DcmPixelData *, newElem)->putOriginalRepresentation(xfer, NULL, sequence); + parsePixelSequence(sequence, current->xmlChildrenNode); + } else + OFLOG_WARN(xml2dcmLogger, "wrong VR for 'sequence' element with pixel data, ignoring child nodes"); + } + } else { + /* proceed parsing the items of the sequence */ + if (newElem->ident() == EVR_SQ) + parseSequence(OFstatic_cast(DcmSequenceOfItems *, newElem), current->xmlChildrenNode, xfer); + else + OFLOG_WARN(xml2dcmLogger, "wrong VR for 'sequence' element, ignoring child nodes"); + } + } else { + /* delete element if insertion failed */ + delete newElem; + } + } + } else if (!xmlIsBlankNode(current)) + OFLOG_WARN(xml2dcmLogger, "unexpected node '" << current->name << "', skipping"); + /* proceed with next node */ + current = current->next; + } + return result; +} + + +static OFCondition validateXmlDocument(xmlDocPtr doc) +{ + OFCondition result = EC_Normal; + OFLOG_INFO(xml2dcmLogger, "validating XML document ..."); + xmlGenericError(xmlGenericErrorContext, "--- libxml validating ---\n"); + /* temporary buffer needed for errorFunction - more detailed explanation there */ + OFString tmpErrorString; + /* create context for document validation */ + xmlValidCtxt cvp; + cvp.userData = &tmpErrorString; + cvp.error = errorFunction; + cvp.warning = errorFunction; + /* validate the document */ + const int valid = xmlValidateDocument(&cvp, doc); + xmlGenericError(xmlGenericErrorContext, "-------------------------\n"); + if (!valid) + { + OFLOG_ERROR(xml2dcmLogger, "document does not validate"); + result = EC_IllegalCall; + } + return result; +} + + +static OFCondition readXmlFile(const char *ifname, + DcmFileFormat &fileformat, + E_TransferSyntax &xfer, + const OFBool metaInfo, + const OFBool checkNamespace, + const OFBool validateDocument) +{ + OFCondition result = EC_Normal; + xfer = EXS_Unknown; + xmlGenericError(xmlGenericErrorContext, "--- libxml parsing ------\n"); + /* build an XML tree from the file */ +#if LIBXML_VERSION >= 20703 + /* + * Starting with libxml version 2.7.3, the maximum length of XML element values + * is limited to 10 MB. The following code disables this default limitation. + */ + xmlDocPtr doc = xmlReadFile(ifname, NULL /*encoding*/, XML_PARSE_HUGE); +#else + xmlDocPtr doc = xmlParseFile(ifname); +#endif + xmlGenericError(xmlGenericErrorContext, "-------------------------\n"); + if (doc != NULL) + { + /* validate document */ + if (validateDocument) + result = validateXmlDocument(doc); + if (result.good()) + { + /* check whether the document is of the right kind */ + xmlNodePtr current = xmlDocGetRootElement(doc); + if (current != NULL) + { + /* check namespace declaration (if required) */ + if (!checkNamespace || (xmlSearchNsByHref(doc, current, OFreinterpret_cast(const xmlChar *, DCMTK_XML_NAMESPACE_URI)) != NULL)) + { + /* check whether to parse a "file-format" or "data-set" */ + if (xmlStrcmp(current->name, OFreinterpret_cast(const xmlChar *, "file-format")) == 0) + { + OFLOG_INFO(xml2dcmLogger, "parsing file-format ..."); + if (metaInfo) + OFLOG_INFO(xml2dcmLogger, "parsing meta-header ..."); + else + OFLOG_INFO(xml2dcmLogger, "skipping meta-header ..."); + + current = current->xmlChildrenNode; + /* ignore blank (empty or whitespace only) nodes */ + while ((current != NULL) && xmlIsBlankNode(current)) + current = current->next; + /* parse/skip "meta-header" */ + result = parseMetaHeader(fileformat.getMetaInfo(), current, metaInfo /*parse*/); + if (result.good()) + { + current = current->next; + /* ignore blank (empty or whitespace only) nodes */ + while ((current != NULL) && xmlIsBlankNode(current)) + current = current->next; + } + } + /* there should always be a "data-set" node */ + if (result.good()) + { + OFLOG_INFO(xml2dcmLogger, "parsing data-set ..."); + /* parse "data-set" */ + result = checkNode(current, "data-set"); + if (result.good()) + { + DcmDataset *dataset = fileformat.getDataset(); + /* determine stored transfer syntax */ + xmlChar *xferUID = xmlGetProp(current, OFreinterpret_cast(const xmlChar *, "xfer")); + if (xferUID != NULL) + xfer = DcmXfer(OFreinterpret_cast(char *, xferUID)).getXfer(); + result = parseDataSet(dataset, current->xmlChildrenNode, xfer); + /* free allocated memory */ + xmlFree(xferUID); + } + } + if (result.bad() && xmlLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + /* dump XML document for debugging purposes */ + xmlChar *str; + int size; + xmlDocDumpFormatMemory(doc, &str, &size, 1); + OFLOG_DEBUG(xmlLogger, str); + xmlFree(str); + } + } else { + OFLOG_ERROR(xml2dcmLogger, "document has wrong type, dcmtk namespace not found"); + result = EC_IllegalCall; + } + } else { + OFLOG_ERROR(xml2dcmLogger, "document is empty: " << ifname); + result = EC_IllegalCall; + } + } + } else { + OFLOG_ERROR(xml2dcmLogger, "could not parse document: " << ifname); + result = EC_IllegalCall; + } + /* free allocated memory */ + xmlFreeDoc(doc); + return result; +} + + +#define SHORTCOL 3 +#define LONGCOL 21 + + +int main(int argc, char *argv[]) +{ + OFBool opt_metaInfo = OFTrue; + OFBool opt_namespace = OFFalse; + OFBool opt_validate = OFFalse; + OFBool opt_generateUIDs = OFFalse; + OFBool opt_overwriteUIDs = OFFalse; + E_TransferSyntax opt_xfer = EXS_Unknown; + E_EncodingType opt_enctype = EET_ExplicitLength; + E_GrpLenEncoding opt_glenc = EGL_recalcGL; + E_PaddingEncoding opt_padenc = EPD_withoutPadding; + E_FileWriteMode opt_writeMode = EWM_fileformat; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + + /* set-up command line parameters and options */ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, OFFIS_CONSOLE_DESCRIPTION, rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("xmlfile-in", "XML input filename to be converted (stdin: \"-\")", OFCmdParam::PM_Mandatory); + cmd.addParam("dcmfile-out", "DICOM output filename", OFCmdParam::PM_Mandatory); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-meta-info", "+f", "read meta information if present (default)"); + cmd.addOption("--ignore-meta-info", "-f", "ignore file meta information"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("validation:"); + cmd.addOption("--validate-document", "+Vd", "validate XML document against DTD"); + cmd.addOption("--check-namespace", "+Vn", "check XML namespace in document root"); + cmd.addSubGroup("unique identifiers:"); + cmd.addOption("--generate-new-uids", "+Ug", "generate new Study/Series/SOP Instance UID"); + cmd.addOption("--dont-overwrite-uids", "-Uo", "do not overwrite existing UIDs (default)"); + cmd.addOption("--overwrite-uids", "+Uo", "overwrite existing UIDs"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addOption("--update-meta-info", "+Fu", "update particular file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); +#ifdef WITH_ZLIB + cmd.addOption("--write-xfer-deflated", "+td", "write with deflated expl. VR little endian TS"); +#endif + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with --write-xfer-deflated):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + COUT << "- LIBXML, Version " << LIBXML_DOTTED_VERSION << OFendl; +#if defined(LIBXML_ICONV_ENABLED) && defined(LIBXML_ZLIB_ENABLED) + COUT << " with built-in LIBICONV and ZLIB support" << OFendl; +#elif defined(LIBXML_ICONV_ENABLED) + COUT << " with built-in LIBICONV support" << OFendl; +#elif defined(LIBXML_ZLIB_ENABLED) + COUT << " with built-in ZLIB support" << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-meta-info")) + opt_metaInfo = OFTrue; + if (cmd.findOption("--ignore-meta-info")) + opt_metaInfo = OFFalse; + cmd.endOptionBlock(); + + /* processing options */ + + if (cmd.findOption("--validate-document")) + opt_validate = OFTrue; + if (cmd.findOption("--check-namespace")) + opt_namespace = OFTrue; + + if (cmd.findOption("--generate-new-uids")) + opt_generateUIDs = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--dont-overwrite-uids")) + { + app.checkDependence("--dont-overwrite-uids", "--generate-new-uids", opt_generateUIDs); + opt_overwriteUIDs = OFFalse; + } + if (cmd.findOption("--overwrite-uids")) + { + app.checkDependence("--overwrite-uids", "--generate-new-uids", opt_generateUIDs); + opt_overwriteUIDs = OFTrue; + } + cmd.endOptionBlock(); + + /* output options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) + opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) + opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + if (cmd.findOption("--update-meta-info")) + { + app.checkConflict("--update-meta-info", "--write-dataset", opt_writeMode == EWM_dataset); + opt_writeMode = EWM_updateMeta; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) + opt_xfer = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) + opt_xfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) + opt_xfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) + opt_xfer = EXS_LittleEndianImplicit; +#ifdef WITH_ZLIB + if (cmd.findOption("--write-xfer-deflated")) + opt_xfer = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) + dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) + dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) + opt_glenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) + opt_glenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) + opt_glenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) + opt_enctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) + opt_enctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_padenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) + opt_padenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_padenc = EPD_withPadding; + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + OFCmdUnsignedInt comprLevel = 0; + app.checkDependence("--compression-level", "--write-xfer-deflated", opt_xfer == EXS_DeflatedLittleEndianExplicit); + app.checkValue(cmd.getValueAndCheckMinMax(comprLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, comprLevel)); + } +#endif + } + + /* print resource identifier */ + OFLOG_DEBUG(xml2dcmLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(xml2dcmLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* check for compatible libxml version */ + LIBXML_TEST_VERSION + /* temporary buffer needed for errorFunction - more detailed explanation there */ + OFString tmpErrorString; + /* initialize the XML library (only required for MT-safety) */ + xmlInitParser(); + /* do not substitute entities (other than the standard ones) */ + xmlSubstituteEntitiesDefault(0); + /* add line number to debug messages */ + xmlLineNumbersDefault(1); + /* enable libxml warnings and error messages */ + xmlGetWarningsDefaultValue = 1; + xmlSetGenericErrorFunc(&tmpErrorString, errorFunction); + + OFCondition result = EC_Normal; + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* check filenames */ + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_ERROR(xml2dcmLogger, OFFIS_CONSOLE_APPLICATION << ": invalid input filename: "); + result = EC_IllegalParameter; + } + if ((opt_ofname == NULL) || (strlen(opt_ofname) == 0)) + { + OFLOG_ERROR(xml2dcmLogger, OFFIS_CONSOLE_APPLICATION << ": invalid output filename: "); + result = EC_IllegalParameter; + } + + if (result.good()) + { + DcmFileFormat fileformat; + E_TransferSyntax xfer; + OFLOG_INFO(xml2dcmLogger, "reading XML input file: " << opt_ifname); + /* read XML file and feed data into DICOM fileformat */ + result = readXmlFile(opt_ifname, fileformat, xfer, opt_metaInfo, opt_namespace, opt_validate); + if (result.good()) + { + DcmDataset *dataset = fileformat.getDataset(); + /* generate new UIDs (if required) */ + if (opt_generateUIDs) + { + char uid[100]; + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_StudyInstanceUID)) + { + OFLOG_INFO(xml2dcmLogger, "generating new Study Instance UID"); + dataset->putAndInsertString(DCM_StudyInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT)); + } + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_SeriesInstanceUID)) + { + OFLOG_INFO(xml2dcmLogger, "generating new Series Instance UID"); + dataset->putAndInsertString(DCM_SeriesInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT)); + } + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_SOPInstanceUID)) + { + OFLOG_INFO(xml2dcmLogger, "generating new SOP Instance UID"); + dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT)); + } + } + OFLOG_INFO(xml2dcmLogger, "writing DICOM output file: " << opt_ofname); + /* determine transfer syntax to write the file */ + if ((opt_xfer == EXS_Unknown) && (xfer != EXS_Unknown)) + opt_xfer = xfer; + /* check whether this is possible */ + if (fileformat.canWriteXfer(opt_xfer)) + { + /* check whether pixel data is compressed */ + if ((opt_writeMode == EWM_dataset) && DcmXfer(xfer).isEncapsulated()) + { + OFLOG_ERROR(xml2dcmLogger, "encapsulated pixel data require file format, ignoring --write-dataset"); + opt_writeMode = EWM_fileformat; + } + /* write DICOM file */ + result = fileformat.saveFile(opt_ofname, opt_xfer, opt_enctype, opt_glenc, opt_padenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + if (result.bad()) + OFLOG_ERROR(xml2dcmLogger, result.text() << ": writing file: " << opt_ofname); + } else { + OFLOG_ERROR(xml2dcmLogger, "no conversion to transfer syntax " << DcmXfer(opt_xfer).getXferName() << " possible!"); + result = EC_CannotChangeRepresentation; + } + } + } + + /* clean up XML library before quitting */ + xmlCleanupParser(); + + return result.status(); +} + +#else /* WITH_LIBXML */ + +int main(int, char *[]) +{ + CERR << rcsid << OFendl << OFFIS_CONSOLE_DESCRIPTION << OFendl << OFendl + << OFFIS_CONSOLE_APPLICATION " requires the libxml library." << OFendl + << "This " OFFIS_CONSOLE_APPLICATION " has been configured and compiled without libxml." << OFendl + << "Please reconfigure your system and recompile if appropriate." << OFendl; + return 0; +} + +#endif /* WITH_LIBXML */ diff --git a/dcmdata/configure b/dcmdata/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmdata/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmdata/data/CMakeLists.txt b/dcmdata/data/CMakeLists.txt new file mode 100644 index 00000000..64ffba1f --- /dev/null +++ b/dcmdata/data/CMakeLists.txt @@ -0,0 +1,9 @@ +# declare installation files +install(FILES dicom.dic acrnema.dic private.dic diconde.dic dcm2xml.dtd dumppat.txt SC.dump VLP.dump DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data) + +# add paths to the dictionaries to a CMake variable for being used by the unit tests +set(DCMTK_DICOM_DICTIONARIES + "${CMAKE_CURRENT_SOURCE_DIR}/dicom.dic" + "${CMAKE_CURRENT_SOURCE_DIR}/private.dic" + CACHE INTERNAL "paths to the DICOM data dictionaries" +) diff --git a/dcmdata/data/Makefile.in b/dcmdata/data/Makefile.in new file mode 100644 index 00000000..80afba45 --- /dev/null +++ b/dcmdata/data/Makefile.in @@ -0,0 +1,30 @@ +# +# Makefile for dcmdata/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = dicom.dic acrnema.dic private.dic diconde.dic dcm2xml.dtd dumppat.txt \ + SC.dump VLP.dump + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(datadir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(datadir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmdata/data/SC.dump b/dcmdata/data/SC.dump new file mode 100644 index 00000000..66ec3ab8 --- /dev/null +++ b/dcmdata/data/SC.dump @@ -0,0 +1,99 @@ + +################################################################################ +# IMG2DCM TEMPLATE FOR WRITING SECONDARY CAPTURE OBJECTS # +# SOP Class: 1.2.840.10008.5.1.4.1.1.7 (SC) # +################################################################################ +# Type 1: Value MUST be filled in # +# Type 1C: Value MUST be filled in if known, if certain condition (see # +# standard) is fullfilled, otherwise DO NOT insert # +# Type 2: Value MUST be filled in if known, MUST be left empty otherwise # +# Type 2C: Same as 2, if a certain condition (see standard) is met. If the # +# condition is not met, DO NOT insert # +# Type 3: User optional, CAN be written (if it should not, delete line). # +# The value written can be chosen freely, but has to conform to # +# element's VR (see standard) # +################################################################################ + +########################### Patient Module ##################################### + +# Patient's Name, Type 2 +(0010,0010) PN [] + +# Patient ID, Type 2 +(0010,0020) LO [] + +# Patient's Birth Date, Type 2 +(0010,0030) DA [] + +# Patient's Sex, Type 2 +(0010,0040) CS [] + +# Responsible Organization, Type 2C (only included if patient is animal...) +# (0010,2299) LO [] + +########################### General Study Module ############################## +# All attributes from the General Study Module are overwritten by the # +# --study-from and series-from options # +############################################################################### + +# Study Date, Type 2 +(0008,0020) DA [] + +# Study Time, Type 2 +(0008,0030) TM [] + +# Accession Number, Type 2 +(0008,0050) SH [] + +# Referring Physician's Name, Type 2 +(0008,0090) PN [] + +# Study ID, Type 2 +(0020,0010) SH [] + +# Study Instance UID, Type 1, usually provided automatically (newly created) +#(0020,000d) UI [] + +########################### General Series Module ############################## +# All attributes from the General Series Module are overwritten by the # +# --series-from option # +################################################################################ + +# Patient Position, Type 2C +(0018,5100) CS (no value available) + +# Series Instance UID, Type 1, usually provided automatically (newly created) +# (0020,000e) UI [] + +# Series Number, Type 2 +(0020,0011) IS [] + +# Laterality, Type 2C +# (0020,0060) CS (no value available) + +###################### SC Equipment Module ##################################### + +# Conversion Type, Type 1, Defined Terms, see Standard (SI=Scanned Image) +(0008,0064) CS [SI] + +###################### General Image Module #################################### + +# Content Date, Type 2C +#(0008,0023) DA [] + +# Instance Number, Type 2 +(0020,0013) IS [] + +# Patient Orientation, Type 2C +(0020,0020) CS (no value available) + +###################### Image Pixel Module ###################################### +# The Image Pixel Module is written by the img2dcm application # +################################################################################ + +########################### SOP Common Module ################################## + +# Specific Character Set, Type 1C. +# "ISO_IR 100" should be used if ISO Latin 1 characters could/are used in file +# If only plain ASCII is used, this line could (but does not have to) be deleted +(0008,0005) CS [ISO_IR 100] diff --git a/dcmdata/data/VLP.dump b/dcmdata/data/VLP.dump new file mode 100644 index 00000000..271ca536 --- /dev/null +++ b/dcmdata/data/VLP.dump @@ -0,0 +1,115 @@ + +################################################################################ +# IMG2DCM TEMPLATE FOR WRITING VISIBLE LIGHT PHOTOGRAPHY OBJECTS # +# SOP Class: 1.2.840.10008.5.1.4.1.1.77.1.4 (XC) # +################################################################################ +# Type 1: Value MUST be filled in # +# Type 1C: Value MUST be filled in if known, if certain condition (see # +# standard) is fullfilled, otherwise LEAVE OUT line # +# Type 2: Value MUST be filled in if known, MUST be left empty otherwise # +# Type 2C: Same as 2, if a certain condition (see standard) is met. If the # +# condition is not met, LEAVE OUT line # +# Type 3: User optional, CAN be written (if it should not, delete line). # +# The value written can be chosen freely, but has to conform to # +# element's VR (see standard) # +################################################################################ + +########################### Patient Module ##################################### + +# Patient's Name, Type 2 +(0010,0010) PN [] + +# Patient ID, Type 2 +(0010,0020) LO [] + +# Patient's Birth Date, Type 2 +(0010,0030) DA [] + +# Patient's Sex, Type 2 +(0010,0040) CS [] + +# Responsible Organization, Type 2C (only included if patient is animal...) +# (0010,2299) LO [] + +########################### General Study Module ############################## +# All attributes from the General Study Module are overwritten by the # +# --study-from and series-from options # +############################################################################### + +# Study Date, Type 2 +(0008,0020) DA [] + +# Study Time, Type 2 +(0008,0030) TM [] + +# Accession Number, Type 2 +(0008,0050) SH [] + +# Referring Physician's Name, Type 2 +(0008,0090) PN [] + +# Study ID, Type 2 +(0020,0010) SH [] + +# Study Instance UID, Type 1, usually provided automatically (newly created) +#(0020,000d) UI [] + +########################### General Series Module ############################## +# All attributes from the General Series Module are overwritten by the # +# --study-from option # +################################################################################ + +# Patient Position, Type 2C +(0018,5100) CS (no value available) + +# Series Instance UID, Type 1, usually provided automatically (newly created) +# (0020,000e) UI [] + +# Series Number, Type 2 +(0020,0011) IS [] + +# Laterality, Type 2C +# (0020,0060) CS (no value available) + +###################### General Equipment Module ############################### + +# Manufacturer, Type 2 +(0008,0070) LO [] + +###################### General Image Module ############################### + +# Content Date, Type 2C +#(0008,0023) DA [] + +# Instance Number, Type 2 +(0020,0013) IS [] + +# Patient Orientation, Type 2C +(0020,0020) CS (no value available) + +###################### Image Pixel Module ##################################### +# The Image Pixel Module is written by the img2dcm application # +############################################################################### + +#################### Acquisition Context Module ################################ + +# Acquisition Context Sequence, Type 2 +(0040,0555) SQ (Sequence with explicit length #=0) +(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) + +########################### VL Image Module ################################### + +# Image Type, Type 1 (Defined Terms) +(0008,0008) CS [DERIVED\SECONDARY] + +# Content Time, Type 1C +#(0008,0033) TM [] + +# Lossy Image Compression, Type 2, Enumerated Values ("00" and "01") +(0028,2110) CS [01] + +########################### SOP Common Module ################################## + +# Specific Character Set, Type 1C. +# "ISO_IR 100" should be used if ISO Latin 1 characters could/are used in file +(0008,0005) CS [ISO_IR 100] diff --git a/dcmdata/data/acrnema.dic b/dcmdata/data/acrnema.dic new file mode 100644 index 00000000..d4e86ff1 --- /dev/null +++ b/dcmdata/data/acrnema.dic @@ -0,0 +1,200 @@ +# +# Copyright (C) 1994-2014, OFFIS e.V. +# All rights reserved. See COPYRIGHT file for details. +# +# This software and supporting documentation were developed by +# +# OFFIS e.V. +# R&D Division Health +# Escherweg 2 +# D-26121 Oldenburg, Germany +# +# +# Module: dcmdata +# +# Author: Andrew Hewett, Marco Eichelberg, Joerg Riesmeier +# +# Purpose: ACR/NEMA data dictionary for the DICOM toolkit DCMTK +# +# This file contains the complete data dictionary from the DICOM predecessor +# ACR/NEMA. Please note that the file "dicom.dic" contains more or less the +# same tag definitions since they are now officially part of the DICOM standard +# (introduced with CP-607), so there is usually no need to use this file. It +# is mainly provided for backward compatibility with previous versions of the +# DCMTK. +# +# Each line represents an entry in the data dictionary. Each line has 5 fields +# (Tag, VR, Name, VM, Version). Entries need not be in ascending tag order. +# +# Entries may override existing entries. +# +# Each field must be separated by a single tab. The tag values (gggg,eeee) +# must be in hexadecimal and must be surrounded by parentheses. Repeating +# groups are represented by indicating the range (gggg-gggg,eeee). By default +# the repeating notation only represents even numbers. A range where only +# odd numbers are valid is represented using the notation (gggg-o-gggg,eeee). +# A range can represent both even and odd numbers using the notation +# (gggg-u-gggg,eeee). The element part of the tag can also be a range. +# +# Comments have a '#' at the beginning of the line. +# +# Tag VR Name VM Version +# +#--------------------------------------------------------------------------- +# +# Retired data elements from ACR/NEMA 2 (1988) +# +(0000,0001) UL ACR_NEMA_CommandGroupLengthToEnd 1 ACR/NEMA2 +(0000,0010) CS ACR_NEMA_CommandRecognitionCode 1 ACR/NEMA2 +(0000,0200) LO ACR_NEMA_Initiator 1 ACR/NEMA2 +(0000,0300) LO ACR_NEMA_Receiver 1 ACR/NEMA2 +(0000,0400) LO ACR_NEMA_FindLocation 1 ACR/NEMA2 +(0000,0850) US ACR_NEMA_NumberOfMatches 1 ACR/NEMA2 +(0000,0860) US ACR_NEMA_ResponseSequenceNumber 1 ACR/NEMA2 +(0000,4000) LO ACR_NEMA_DialogReceiver 1 ACR/NEMA2 +(0000,4010) LO ACR_NEMA_TerminalType 1 ACR/NEMA2 +(0000,5010) LO ACR_NEMA_MessageSetID 1 ACR/NEMA2 +(0000,5020) LO ACR_NEMA_EndMessageSet 1 ACR/NEMA2 +(0000,5110) LO ACR_NEMA_DisplayFormat 1 ACR/NEMA2 +(0000,5120) LO ACR_NEMA_PagePositionID 1 ACR/NEMA2 +(0000,5130) LO ACR_NEMA_TextFormatID 1 ACR/NEMA2 +(0000,5140) CS ACR_NEMA_NormalReverse 1 ACR/NEMA2 +(0000,5150) CS ACR_NEMA_AddGrayScale 1 ACR/NEMA2 +(0000,5160) CS ACR_NEMA_Borders 1 ACR/NEMA2 +(0000,5170) IS ACR_NEMA_Copies 1 ACR/NEMA2 +(0000,5180) LO ACR_NEMA_MagnificationType 1 ACR/NEMA2 +(0000,5190) LO ACR_NEMA_Erase 1-n ACR/NEMA2 +(0000,51A0) CS ACR_NEMA_Print 1 ACR/NEMA2 +(0000,51B0) US ACR_NEMA_Overlays 1-n ACR/NEMA2 +(0008,0001) UL ACR_NEMA_IdentifyingGroupLengthToEnd 1 ACR/NEMA2 +(0008,0010) LO ACR_NEMA_RecognitionCode 1 ACR/NEMA2 +(0008,0040) US ACR_NEMA_OldDataSetType 1 ACR/NEMA2 +(0008,0041) LO ACR_NEMA_DataSetSubtype 1 ACR/NEMA2 +(0008,1000) LO ACR_NEMA_NetworkID 1 ACR/NEMA2 +(0008,4000) LT ACR_NEMA_IdentifyingComments 1-n ACR/NEMA2 +(0010,1050) LT ACR_NEMA_InsurancePlanIdentification 1-n ACR/NEMA2 +(0018,1240) IS ACR_NEMA_UpperLowerPixelValues 1-n ACR/NEMA2 +(0018,4000) LT ACR_NEMA_AcquisitionComments 1-n ACR/NEMA2 +(0018,5030) DS ACR_NEMA_DynamicRange 1 ACR/NEMA2 +(0018,5040) DS ACR_NEMA_TotalGain 1 ACR/NEMA2 +(0020,0030) DS ACR_NEMA_ImagePosition 3 ACR/NEMA2 +(0020,0035) DS ACR_NEMA_ImageOrientation 6 ACR/NEMA2 +(0020,0050) DS ACR_NEMA_Location 1 ACR/NEMA2 +(0020,0070) LO ACR_NEMA_ImageGeometryType 1 ACR/NEMA2 +(0020,0080) LO ACR_NEMA_MaskingImage 1-n ACR/NEMA2 +(0020,1001) IS ACR_NEMA_AcquisitionsInSeries 1 ACR/NEMA2 +(0020,1003) IS ACR_NEMA_ImagesInSeries 1 ACR/NEMA2 +(0020,1005) IS ACR_NEMA_ImagesInStudy 1 ACR/NEMA2 +(0020,1020) LO ACR_NEMA_Reference 1-n ACR/NEMA2 +(0020,3100-31FF) LO ACR_NEMA_SourceImageID 1-n ACR/NEMA2 +(0020,3401) LO ACR_NEMA_ModifyingDeviceID 1 ACR/NEMA2 +(0020,3402) LO ACR_NEMA_ModifiedImageID 1 ACR/NEMA2 +(0020,3403) DA ACR_NEMA_ModifiedImageDate 1 ACR/NEMA2 +(0020,3404) LO ACR_NEMA_ModifyingDeviceManufacturer 1 ACR/NEMA2 +(0020,3405) TM ACR_NEMA_ModifiedImageTime 1 ACR/NEMA2 +(0020,3406) LO ACR_NEMA_ModifiedImageDescription 1 ACR/NEMA2 +(0020,5000) AT ACR_NEMA_OriginalImageIdentification 1-n ACR/NEMA2 +(0020,5002) LO ACR_NEMA_OriginalImageIdentificationNomenclature 1-n ACR/NEMA2 +(0028,0005) US ACR_NEMA_ImageDimensions 1 ACR/NEMA2 +(0028,0040) CS ACR_NEMA_ImageFormat 1 ACR/NEMA2 +(0028,0050) LO ACR_NEMA_ManipulatedImage 1-n ACR/NEMA2 +(0028,0060) CS ACR_NEMA_CompressionCode 1 ACR/NEMA2 +(0028,0104) xs ACR_NEMA_SmallestValidPixelValue 1 ACR/NEMA2 +(0028,0105) xs ACR_NEMA_LargestValidPixelValue 1 ACR/NEMA2 +(0028,0200) US ACR_NEMA_ImageLocation 1 ACR/NEMA2 +(0028,1080) CS ACR_NEMA_GrayScale 1 ACR/NEMA2 +(0028,1100) xs ACR_NEMA_GrayLookupTableDescriptor 3 ACR/NEMA2 +(0028,1200) xs ACR_NEMA_GrayLookupTableData 1-n ACR/NEMA2 +(0028,4000) LT ACR_NEMA_ImagePresentationComments 1-n ACR/NEMA2 +(4000,0000) UL ACR_NEMA_TextGroupLength 1 ACR/NEMA2 +(4000,0010) LT ACR_NEMA_TextArbitrary 1-n ACR/NEMA2 +(4000,4000) LT ACR_NEMA_TextComments 1-n ACR/NEMA2 +(6000-60FF,0110) CS ACR_NEMA_OverlayFormat 1 ACR/NEMA2 +(6000-60FF,0200) US ACR_NEMA_OverlayLocation 1 ACR/NEMA2 +(6000-60FF,4000) LT ACR_NEMA_OverlayComments 1-n ACR/NEMA2 +# +#--------------------------------------------------------------------------- +# +# Retired data elements from the ACR/NEMA 2 compression enhancements +# +(0028,005F) CS ACR_NEMA_2C_CompressionRecognitionCode 1 ACR/NEMA2C +(0028,0061) SH ACR_NEMA_2C_CompressionOriginator 1 ACR/NEMA2C +(0028,0062) SH ACR_NEMA_2C_CompressionLabel 1 ACR/NEMA2C +(0028,0063) SH ACR_NEMA_2C_CompressionDescription 1 ACR/NEMA2C +(0028,0065) CS ACR_NEMA_2C_CompressionSequence 1-n ACR/NEMA2C +(0028,0066) AT ACR_NEMA_2C_CompressionStepPointers 1-n ACR/NEMA2C +(0028,0068) US ACR_NEMA_2C_RepeatInterval 1 ACR/NEMA2C +(0028,0069) US ACR_NEMA_2C_BitsGrouped 1 ACR/NEMA2C +(0028,0070) US ACR_NEMA_2C_PerimeterTable 1-n ACR/NEMA2C +(0028,0071) xs ACR_NEMA_2C_PerimeterValue 1 ACR/NEMA2C +(0028,0080) US ACR_NEMA_2C_PredictorRows 1 ACR/NEMA2C +(0028,0081) US ACR_NEMA_2C_PredictorColumns 1 ACR/NEMA2C +(0028,0082) US ACR_NEMA_2C_PredictorConstants 1-n ACR/NEMA2C +(0028,0090) CS ACR_NEMA_2C_BlockedPixels 1 ACR/NEMA2C +(0028,0091) US ACR_NEMA_2C_BlockRows 1 ACR/NEMA2C +(0028,0092) US ACR_NEMA_2C_BlockColumns 1 ACR/NEMA2C +(0028,0093) US ACR_NEMA_2C_RowOverlap 1 ACR/NEMA2C +(0028,0094) US ACR_NEMA_2C_ColumnOverlap 1 ACR/NEMA2C +(0028,0400) CS ACR_NEMA_2C_TransformLabel 1 ACR/NEMA2C +(0028,0401) CS ACR_NEMA_2C_TransformVersionNumber 1 ACR/NEMA2C +(0028,0402) US ACR_NEMA_2C_NumberOfTransformSteps 1 ACR/NEMA2C +(0028,0403) CS ACR_NEMA_2C_SequenceOfCompressedData 1-n ACR/NEMA2C +(0028,0404) AT ACR_NEMA_2C_DetailsOfCoefficients 1-n ACR/NEMA2C +# according to the DICOM standard, the following 4 attributes +# should have a tag in the range of (0028,04x1) to (0028,04x3) +(0028,0410) US ACR_NEMA_2C_RowsForNthOrderCoefficients 1 ACR/NEMA2C +(0028,0411) US ACR_NEMA_2C_ColumnsForNthOrderCoefficients 1 ACR/NEMA2C +(0028,0412) CS ACR_NEMA_2C_CoefficientCoding 1-n ACR/NEMA2C +(0028,0413) AT ACR_NEMA_2C_CoefficientCodingPointers 1-n ACR/NEMA2C +(0028,0700) CS ACR_NEMA_2C_DCTLabel 1 ACR/NEMA2C +(0028,0701) CS ACR_NEMA_2C_DataBlockDescription 1-n ACR/NEMA2C +(0028,0702) AT ACR_NEMA_2C_DataBlock 1-n ACR/NEMA2C +(0028,0710) US ACR_NEMA_2C_NormalizationFactorFormat 1 ACR/NEMA2C +(0028,0720) US ACR_NEMA_2C_ZonalMapNumberFormat 1 ACR/NEMA2C +(0028,0721) AT ACR_NEMA_2C_ZonalMapLocation 1-n ACR/NEMA2C +(0028,0722) US ACR_NEMA_2C_ZonalMapFormat 1 ACR/NEMA2C +(0028,0730) US ACR_NEMA_2C_AdaptiveMapFormat 1 ACR/NEMA2C +(0028,0740) US ACR_NEMA_2C_CodeNumberFormat 1 ACR/NEMA2C +# according to the DICOM standard, the following 5 attributes +# should have a tag in the range of (0028,08x0) to (0028,08x8) +(0028,0800) CS ACR_NEMA_2C_CodeLabel 1-n ACR/NEMA2C +(0028,0802) US ACR_NEMA_2C_NumberOfTables 1 ACR/NEMA2C +(0028,0803) AT ACR_NEMA_2C_CodeTableLocation 1-n ACR/NEMA2C +(0028,0804) US ACR_NEMA_2C_BitsForCodeWord 1 ACR/NEMA2C +(0028,0808) AT ACR_NEMA_2C_ImageDataLocation 1-n ACR/NEMA2C +(1000,0000) UL ACR_NEMA_2C_CodeTableGroupLength 1 ACR/NEMA2C +# according to the DICOM standard, the following 6 attributes +# should have a tag in the range of (1000,xxx0) to (1000,xxx5) +(1000,0010) US ACR_NEMA_2C_EscapeTriplet 3 ACR/NEMA2C +(1000,0011) US ACR_NEMA_2C_RunLengthTriplet 3 ACR/NEMA2C +(1000,0012) US ACR_NEMA_2C_HuffmanTableSize 1 ACR/NEMA2C +(1000,0013) US ACR_NEMA_2C_HuffmanTableTriplet 3 ACR/NEMA2C +(1000,0014) US ACR_NEMA_2C_ShiftTableSize 1 ACR/NEMA2C +(1000,0015) US ACR_NEMA_2C_ShiftTableTriplet 3 ACR/NEMA2C +(1010,0000) UL ACR_NEMA_2C_ZonalMapGroupLength 1 ACR/NEMA2C +# according to the DICOM standard, the following attribute +# should have the tag (1010,xxxx) where "x" is "0" to "F" +(1010,0004) US ACR_NEMA_2C_ZonalMap 1-n ACR/NEMA2C +(6000-60FF,0060) CS ACR_NEMA_2C_OverlayCompressionCode 1 ACR/NEMA2C +(6000-60FF,0061) SH ACR_NEMA_2C_OverlayCompressionOriginator 1 ACR/NEMA2C +(6000-60FF,0062) SH ACR_NEMA_2C_OverlayCompressionLabel 1 ACR/NEMA2C +(6000-60FF,0063) SH ACR_NEMA_2C_OverlayCompressionDescription 1 ACR/NEMA2C +(6000-60FF,0066) AT ACR_NEMA_2C_OverlayCompressionStepPointers 1-n ACR/NEMA2C +(6000-60FF,0068) US ACR_NEMA_2C_OverlayRepeatInterval 1 ACR/NEMA2C +(6000-60FF,0069) US ACR_NEMA_2C_OverlayBitsGrouped 1 ACR/NEMA2C +(6000-60FF,0800) CS ACR_NEMA_2C_OverlayCodeLabel 1-n ACR/NEMA2C +(6000-60FF,0802) US ACR_NEMA_2C_OverlayNumberOfTables 1 ACR/NEMA2C +(6000-60FF,0803) AT ACR_NEMA_2C_OverlayCodeTableLocation 1-n ACR/NEMA2C +(6000-60FF,0804) US ACR_NEMA_2C_OverlayBitsForCodeWord 1 ACR/NEMA2C +(7F00-7FFF,0000) UL ACR_NEMA_2C_VariablePixelDataGroupLength 1 ACR/NEMA2C +(7F00-7FFF,0010) ox ACR_NEMA_2C_VariablePixelData 1 ACR/NEMA2C +(7F00-7FFF,0011) AT ACR_NEMA_2C_VariableNextDataGroup 1 ACR/NEMA2C +(7F00-7FFF,0020) OW ACR_NEMA_2C_VariableCoefficientsSDVN 1-n ACR/NEMA2C +(7F00-7FFF,0030) OW ACR_NEMA_2C_VariableCoefficientsSDHN 1-n ACR/NEMA2C +(7F00-7FFF,0040) OW ACR_NEMA_2C_VariableCoefficientsSDDN 1-n ACR/NEMA2C +(7FE0,0020) OW ACR_NEMA_2C_CoefficientsSDVN 1-n ACR/NEMA2C +(7FE0,0030) OW ACR_NEMA_2C_CoefficientsSDHN 1-n ACR/NEMA2C +(7FE0,0040) OW ACR_NEMA_2C_CoefficientsSDDN 1-n ACR/NEMA2C +# +# end of acrnema.dic +# diff --git a/dcmdata/data/dcm2xml.dtd b/dcmdata/data/dcm2xml.dtd new file mode 100644 index 00000000..fa8b8699 --- /dev/null +++ b/dcmdata/data/dcm2xml.dtd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dcmdata/data/dicom.dic b/dcmdata/data/dicom.dic new file mode 100644 index 00000000..cb5c19bc --- /dev/null +++ b/dcmdata/data/dicom.dic @@ -0,0 +1,4905 @@ +# +# Copyright (C) 1994-2019, OFFIS e.V. +# All rights reserved. See COPYRIGHT file for details. +# +# This software and supporting documentation were developed by +# +# OFFIS e.V. +# R&D Division Health +# Escherweg 2 +# D-26121 Oldenburg, Germany +# +# +# Module: dcmdata +# +# Author: Andrew Hewett, Marco Eichelberg, Joerg Riesmeier +# +# Purpose: This is the global standard DICOM data dictionary for the DCMTK. +# +# This file contains the complete data dictionary from the latest edition of +# the DICOM standard. This also includes the non-private definitions from the +# DICONDE (Digital Imaging and Communication in Nondestructive Evaluation) and +# DICOS (Digital Imaging and Communications in Security) standard. +# +# Generated automatically from DICOM PS 3.6-2019b and PS 3.7-2019b +# File created on 2019-04-26 14:51:35 by J. Riesmeier on thinkpad. +# File updated manually on 2019-08-07 by J. Riesmeier +# +# In addition, the data dictionary entries from the following final text +# supplements and correction items (CP) have been incorporated: +# - Supplement 175 (FT2) +# +# Each line represents an entry in the data dictionary. Each line has 5 fields +# (Tag, VR, Name, VM, Version). Entries need not be in ascending tag order. +# +# Entries may override existing entries. +# +# Each field must be separated by a single tab. The tag values (gggg,eeee) +# must be in hexadecimal and must be surrounded by parentheses. Repeating +# groups are represented by indicating the range (gggg-gggg,eeee). By default +# the repeating notation only represents even numbers. A range where only +# odd numbers are valid is represented using the notation (gggg-o-gggg,eeee). +# A range can represent both even and odd numbers using the notation +# (gggg-u-gggg,eeee). The element part of the tag can also be a range. +# +# Comments have a '#' at the beginning of the line. +# +# Tag VR Name VM Version +# +(0000,0000) UL CommandGroupLength 1 DICOM +(0000,0002) UI AffectedSOPClassUID 1 DICOM +(0000,0003) UI RequestedSOPClassUID 1 DICOM +(0000,0100) US CommandField 1 DICOM +(0000,0110) US MessageID 1 DICOM +(0000,0120) US MessageIDBeingRespondedTo 1 DICOM +(0000,0600) AE MoveDestination 1 DICOM +(0000,0700) US Priority 1 DICOM +(0000,0800) US CommandDataSetType 1 DICOM +(0000,0900) US Status 1 DICOM +(0000,0901) AT OffendingElement 1-n DICOM +(0000,0902) LO ErrorComment 1 DICOM +(0000,0903) US ErrorID 1 DICOM +(0000,1000) UI AffectedSOPInstanceUID 1 DICOM +(0000,1001) UI RequestedSOPInstanceUID 1 DICOM +(0000,1002) US EventTypeID 1 DICOM +(0000,1005) AT AttributeIdentifierList 1-n DICOM +(0000,1008) US ActionTypeID 1 DICOM +(0000,1020) US NumberOfRemainingSuboperations 1 DICOM +(0000,1021) US NumberOfCompletedSuboperations 1 DICOM +(0000,1022) US NumberOfFailedSuboperations 1 DICOM +(0000,1023) US NumberOfWarningSuboperations 1 DICOM +(0000,1030) AE MoveOriginatorApplicationEntityTitle 1 DICOM +(0000,1031) US MoveOriginatorMessageID 1 DICOM +(0002,0000) UL FileMetaInformationGroupLength 1 DICOM +(0002,0001) OB FileMetaInformationVersion 1 DICOM +(0002,0002) UI MediaStorageSOPClassUID 1 DICOM +(0002,0003) UI MediaStorageSOPInstanceUID 1 DICOM +(0002,0010) UI TransferSyntaxUID 1 DICOM +(0002,0012) UI ImplementationClassUID 1 DICOM +(0002,0013) SH ImplementationVersionName 1 DICOM +(0002,0016) AE SourceApplicationEntityTitle 1 DICOM +(0002,0017) AE SendingApplicationEntityTitle 1 DICOM +(0002,0018) AE ReceivingApplicationEntityTitle 1 DICOM +(0002,0100) UI PrivateInformationCreatorUID 1 DICOM +(0002,0102) OB PrivateInformation 1 DICOM +(0004,1130) CS FileSetID 1 DICOM +(0004,1141) CS FileSetDescriptorFileID 1-8 DICOM +(0004,1142) CS SpecificCharacterSetOfFileSetDescriptorFile 1 DICOM +(0004,1200) up OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity 1 DICOM +(0004,1202) up OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity 1 DICOM +(0004,1212) US FileSetConsistencyFlag 1 DICOM +(0004,1220) SQ DirectoryRecordSequence 1 DICOM +(0004,1400) up OffsetOfTheNextDirectoryRecord 1 DICOM +(0004,1410) US RecordInUseFlag 1 DICOM +(0004,1420) up OffsetOfReferencedLowerLevelDirectoryEntity 1 DICOM +(0004,1430) CS DirectoryRecordType 1 DICOM +(0004,1432) UI PrivateRecordUID 1 DICOM +(0004,1500) CS ReferencedFileID 1-8 DICOM +(0004,1510) UI ReferencedSOPClassUIDInFile 1 DICOM +(0004,1511) UI ReferencedSOPInstanceUIDInFile 1 DICOM +(0004,1512) UI ReferencedTransferSyntaxUIDInFile 1 DICOM +(0004,151A) UI ReferencedRelatedGeneralSOPClassUIDInFile 1-n DICOM +(0008,0005) CS SpecificCharacterSet 1-n DICOM +(0008,0006) SQ LanguageCodeSequence 1 DICOM +(0008,0008) CS ImageType 2-n DICOM +(0008,0012) DA InstanceCreationDate 1 DICOM +(0008,0013) TM InstanceCreationTime 1 DICOM +(0008,0014) UI InstanceCreatorUID 1 DICOM +(0008,0015) DT InstanceCoercionDateTime 1 DICOM +(0008,0016) UI SOPClassUID 1 DICOM +(0008,0018) UI SOPInstanceUID 1 DICOM +(0008,001A) UI RelatedGeneralSOPClassUID 1-n DICOM +(0008,001B) UI OriginalSpecializedSOPClassUID 1 DICOM +(0008,0020) DA StudyDate 1 DICOM +(0008,0021) DA SeriesDate 1 DICOM +(0008,0022) DA AcquisitionDate 1 DICOM +(0008,0023) DA ContentDate 1 DICOM +(0008,002A) DT AcquisitionDateTime 1 DICOM +(0008,0030) TM StudyTime 1 DICOM +(0008,0031) TM SeriesTime 1 DICOM +(0008,0032) TM AcquisitionTime 1 DICOM +(0008,0033) TM ContentTime 1 DICOM +(0008,0050) SH AccessionNumber 1 DICOM +(0008,0051) SQ IssuerOfAccessionNumberSequence 1 DICOM +(0008,0052) CS QueryRetrieveLevel 1 DICOM +(0008,0053) CS QueryRetrieveView 1 DICOM +(0008,0054) AE RetrieveAETitle 1-n DICOM +(0008,0055) AE StationAETitle 1 DICOM +(0008,0056) CS InstanceAvailability 1 DICOM +(0008,0058) UI FailedSOPInstanceUIDList 1-n DICOM +(0008,0060) CS Modality 1 DICOM +(0008,0061) CS ModalitiesInStudy 1-n DICOM +(0008,0062) UI SOPClassesInStudy 1-n DICOM +(0008,0063) SQ AnatomicRegionsInStudyCodeSequence 1 DICOM +(0008,0064) CS ConversionType 1 DICOM +(0008,0068) CS PresentationIntentType 1 DICOM +(0008,0070) LO Manufacturer 1 DICOM +(0008,0080) LO InstitutionName 1 DICOM +(0008,0081) ST InstitutionAddress 1 DICOM +(0008,0082) SQ InstitutionCodeSequence 1 DICOM +(0008,0090) PN ReferringPhysicianName 1 DICOM +(0008,0092) ST ReferringPhysicianAddress 1 DICOM +(0008,0094) SH ReferringPhysicianTelephoneNumbers 1-n DICOM +(0008,0096) SQ ReferringPhysicianIdentificationSequence 1 DICOM +(0008,009C) PN ConsultingPhysicianName 1-n DICOM +(0008,009D) SQ ConsultingPhysicianIdentificationSequence 1 DICOM +(0008,0100) SH CodeValue 1 DICOM +(0008,0101) LO ExtendedCodeValue 1 DICOM/DICOS +(0008,0102) SH CodingSchemeDesignator 1 DICOM +(0008,0103) SH CodingSchemeVersion 1 DICOM +(0008,0104) LO CodeMeaning 1 DICOM +(0008,0105) CS MappingResource 1 DICOM +(0008,0106) DT ContextGroupVersion 1 DICOM +(0008,0107) DT ContextGroupLocalVersion 1 DICOM +(0008,0108) LT ExtendedCodeMeaning 1 DICOM/DICOS +(0008,0109) SQ CodingSchemeResourcesSequence 1 DICOM +(0008,010A) CS CodingSchemeURLType 1 DICOM +(0008,010B) CS ContextGroupExtensionFlag 1 DICOM +(0008,010C) UI CodingSchemeUID 1 DICOM +(0008,010D) UI ContextGroupExtensionCreatorUID 1 DICOM +(0008,010E) UR CodingSchemeURL 1 DICOM +(0008,010F) CS ContextIdentifier 1 DICOM +(0008,0110) SQ CodingSchemeIdentificationSequence 1 DICOM +(0008,0112) LO CodingSchemeRegistry 1 DICOM +(0008,0114) ST CodingSchemeExternalID 1 DICOM +(0008,0115) ST CodingSchemeName 1 DICOM +(0008,0116) ST CodingSchemeResponsibleOrganization 1 DICOM +(0008,0117) UI ContextUID 1 DICOM +(0008,0118) UI MappingResourceUID 1 DICOM +(0008,0119) UC LongCodeValue 1 DICOM +(0008,0120) UR URNCodeValue 1 DICOM +(0008,0121) SQ EquivalentCodeSequence 1 DICOM +(0008,0122) LO MappingResourceName 1 DICOM +(0008,0123) SQ ContextGroupIdentificationSequence 1 DICOM +(0008,0124) SQ MappingResourceIdentificationSequence 1 DICOM +(0008,0201) SH TimezoneOffsetFromUTC 1 DICOM +(0008,0220) SQ ResponsibleGroupCodeSequence 1 DICOM +(0008,0221) CS EquipmentModality 1 DICOM +(0008,0222) LO ManufacturerRelatedModelGroup 1 DICOM +(0008,0300) SQ PrivateDataElementCharacteristicsSequence 1 DICOM +(0008,0301) US PrivateGroupReference 1 DICOM +(0008,0302) LO PrivateCreatorReference 1 DICOM +(0008,0303) CS BlockIdentifyingInformationStatus 1 DICOM +(0008,0304) US NonidentifyingPrivateElements 1-n DICOM +(0008,0305) SQ DeidentificationActionSequence 1 DICOM +(0008,0306) US IdentifyingPrivateElements 1-n DICOM +(0008,0307) CS DeidentificationAction 1 DICOM +(0008,0308) US PrivateDataElement 1 DICOM +(0008,0309) UL PrivateDataElementValueMultiplicity 1-3 DICOM +(0008,030A) CS PrivateDataElementValueRepresentation 1 DICOM +(0008,030B) UL PrivateDataElementNumberOfItems 1-2 DICOM +(0008,030C) UC PrivateDataElementName 1 DICOM +(0008,030D) UC PrivateDataElementKeyword 1 DICOM +(0008,030E) UT PrivateDataElementDescription 1 DICOM +(0008,030F) UT PrivateDataElementEncoding 1 DICOM +(0008,0310) SQ PrivateDataElementDefinitionSequence 1 DICOM +(0008,1010) SH StationName 1 DICOM +(0008,1030) LO StudyDescription 1 DICOM +(0008,1032) SQ ProcedureCodeSequence 1 DICOM +(0008,103E) LO SeriesDescription 1 DICOM +(0008,103F) SQ SeriesDescriptionCodeSequence 1 DICOM +(0008,1040) LO InstitutionalDepartmentName 1 DICOM +(0008,1041) SQ InstitutionalDepartmentTypeCodeSequence 1 DICOM +(0008,1048) PN PhysiciansOfRecord 1-n DICOM +(0008,1049) SQ PhysiciansOfRecordIdentificationSequence 1 DICOM +(0008,1050) PN PerformingPhysicianName 1-n DICOM +(0008,1052) SQ PerformingPhysicianIdentificationSequence 1 DICOM +(0008,1060) PN NameOfPhysiciansReadingStudy 1-n DICOM +(0008,1062) SQ PhysiciansReadingStudyIdentificationSequence 1 DICOM +(0008,1070) PN OperatorsName 1-n DICOM +(0008,1072) SQ OperatorIdentificationSequence 1 DICOM +(0008,1080) LO AdmittingDiagnosesDescription 1-n DICOM +(0008,1084) SQ AdmittingDiagnosesCodeSequence 1 DICOM +(0008,1090) LO ManufacturerModelName 1 DICOM +(0008,1110) SQ ReferencedStudySequence 1 DICOM +(0008,1111) SQ ReferencedPerformedProcedureStepSequence 1 DICOM +(0008,1115) SQ ReferencedSeriesSequence 1 DICOM +(0008,1120) SQ ReferencedPatientSequence 1 DICOM +(0008,1125) SQ ReferencedVisitSequence 1 DICOM +(0008,1134) SQ ReferencedStereometricInstanceSequence 1 DICOM +(0008,113A) SQ ReferencedWaveformSequence 1 DICOM +(0008,1140) SQ ReferencedImageSequence 1 DICOM +(0008,114A) SQ ReferencedInstanceSequence 1 DICOM +(0008,114B) SQ ReferencedRealWorldValueMappingInstanceSequence 1 DICOM +(0008,1150) UI ReferencedSOPClassUID 1 DICOM +(0008,1155) UI ReferencedSOPInstanceUID 1 DICOM +(0008,1156) SQ DefinitionSourceSequence 1 DICOM +(0008,115A) UI SOPClassesSupported 1-n DICOM +(0008,1160) IS ReferencedFrameNumber 1-n DICOM +(0008,1161) UL SimpleFrameList 1-n DICOM +(0008,1162) UL CalculatedFrameList 3-3n DICOM +(0008,1163) FD TimeRange 2 DICOM +(0008,1164) SQ FrameExtractionSequence 1 DICOM +(0008,1167) UI MultiFrameSourceSOPInstanceUID 1 DICOM +(0008,1190) UR RetrieveURL 1 DICOM +(0008,1195) UI TransactionUID 1 DICOM +(0008,1196) US WarningReason 1 DICOM +(0008,1197) US FailureReason 1 DICOM +(0008,1198) SQ FailedSOPSequence 1 DICOM +(0008,1199) SQ ReferencedSOPSequence 1 DICOM +(0008,119A) SQ OtherFailuresSequence 1 DICOM +(0008,1200) SQ StudiesContainingOtherReferencedInstancesSequence 1 DICOM +(0008,1250) SQ RelatedSeriesSequence 1 DICOM +(0008,2111) ST DerivationDescription 1 DICOM +(0008,2112) SQ SourceImageSequence 1 DICOM +(0008,2120) SH StageName 1 DICOM +(0008,2122) IS StageNumber 1 DICOM +(0008,2124) IS NumberOfStages 1 DICOM +(0008,2127) SH ViewName 1 DICOM +(0008,2128) IS ViewNumber 1 DICOM +(0008,2129) IS NumberOfEventTimers 1 DICOM +(0008,212A) IS NumberOfViewsInStage 1 DICOM +(0008,2130) DS EventElapsedTimes 1-n DICOM +(0008,2132) LO EventTimerNames 1-n DICOM +(0008,2133) SQ EventTimerSequence 1 DICOM +(0008,2134) FD EventTimeOffset 1 DICOM +(0008,2135) SQ EventCodeSequence 1 DICOM +(0008,2142) IS StartTrim 1 DICOM +(0008,2143) IS StopTrim 1 DICOM +(0008,2144) IS RecommendedDisplayFrameRate 1 DICOM +(0008,2218) SQ AnatomicRegionSequence 1 DICOM +(0008,2220) SQ AnatomicRegionModifierSequence 1 DICOM +(0008,2228) SQ PrimaryAnatomicStructureSequence 1 DICOM +(0008,2230) SQ PrimaryAnatomicStructureModifierSequence 1 DICOM +(0008,3001) SQ AlternateRepresentationSequence 1 DICOM +(0008,3010) UI IrradiationEventUID 1-n DICOM +(0008,3011) SQ SourceIrradiationEventSequence 1 DICOM +(0008,3012) UI RadiopharmaceuticalAdministrationEventUID 1 DICOM +(0008,9007) CS FrameType 4 DICOM +(0008,9092) SQ ReferencedImageEvidenceSequence 1 DICOM +(0008,9121) SQ ReferencedRawDataSequence 1 DICOM +(0008,9123) UI CreatorVersionUID 1 DICOM +(0008,9124) SQ DerivationImageSequence 1 DICOM +(0008,9154) SQ SourceImageEvidenceSequence 1 DICOM +(0008,9205) CS PixelPresentation 1 DICOM +(0008,9206) CS VolumetricProperties 1 DICOM +(0008,9207) CS VolumeBasedCalculationTechnique 1 DICOM +(0008,9208) CS ComplexImageComponent 1 DICOM +(0008,9209) CS AcquisitionContrast 1 DICOM +(0008,9215) SQ DerivationCodeSequence 1 DICOM +(0008,9237) SQ ReferencedPresentationStateSequence 1 DICOM +(0008,9410) SQ ReferencedOtherPlaneSequence 1 DICOM +(0008,9458) SQ FrameDisplaySequence 1 DICOM +(0008,9459) FL RecommendedDisplayFrameRateInFloat 1 DICOM +(0008,9460) CS SkipFrameRangeFlag 1 DICOM +(0010,0010) PN PatientName 1 DICOM +(0010,0020) LO PatientID 1 DICOM +(0010,0021) LO IssuerOfPatientID 1 DICOM +(0010,0022) CS TypeOfPatientID 1 DICOM +(0010,0024) SQ IssuerOfPatientIDQualifiersSequence 1 DICOM +(0010,0026) SQ SourcePatientGroupIdentificationSequence 1 DICOM +(0010,0027) SQ GroupOfPatientsIdentificationSequence 1 DICOM +(0010,0028) US SubjectRelativePositionInImage 3 DICOM +(0010,0030) DA PatientBirthDate 1 DICOM +(0010,0032) TM PatientBirthTime 1 DICOM +(0010,0033) LO PatientBirthDateInAlternativeCalendar 1 DICOM +(0010,0034) LO PatientDeathDateInAlternativeCalendar 1 DICOM +(0010,0035) CS PatientAlternativeCalendar 1 DICOM +(0010,0040) CS PatientSex 1 DICOM +(0010,0050) SQ PatientInsurancePlanCodeSequence 1 DICOM +(0010,0101) SQ PatientPrimaryLanguageCodeSequence 1 DICOM +(0010,0102) SQ PatientPrimaryLanguageModifierCodeSequence 1 DICOM +(0010,0200) CS QualityControlSubject 1 DICOM +(0010,0201) SQ QualityControlSubjectTypeCodeSequence 1 DICOM +(0010,0212) UC StrainDescription 1 DICOM +(0010,0213) LO StrainNomenclature 1 DICOM +(0010,0214) LO StrainStockNumber 1 DICOM +(0010,0215) SQ StrainSourceRegistryCodeSequence 1 DICOM +(0010,0216) SQ StrainStockSequence 1 DICOM +(0010,0217) LO StrainSource 1 DICOM +(0010,0218) UT StrainAdditionalInformation 1 DICOM +(0010,0219) SQ StrainCodeSequence 1 DICOM +(0010,0221) SQ GeneticModificationsSequence 1 DICOM +(0010,0222) UC GeneticModificationsDescription 1 DICOM +(0010,0223) LO GeneticModificationsNomenclature 1 DICOM +(0010,0229) SQ GeneticModificationsCodeSequence 1 DICOM +(0010,1001) PN OtherPatientNames 1-n DICOM +(0010,1002) SQ OtherPatientIDsSequence 1 DICOM +(0010,1005) PN PatientBirthName 1 DICOM +(0010,1010) AS PatientAge 1 DICOM +(0010,1020) DS PatientSize 1 DICOM +(0010,1021) SQ PatientSizeCodeSequence 1 DICOM +(0010,1022) DS PatientBodyMassIndex 1 DICOM +(0010,1023) DS MeasuredAPDimension 1 DICOM +(0010,1024) DS MeasuredLateralDimension 1 DICOM +(0010,1030) DS PatientWeight 1 DICOM +(0010,1040) LO PatientAddress 1 DICOM +(0010,1060) PN PatientMotherBirthName 1 DICOM +(0010,1080) LO MilitaryRank 1 DICOM +(0010,1081) LO BranchOfService 1 DICOM +(0010,1100) SQ ReferencedPatientPhotoSequence 1 DICOM +(0010,2000) LO MedicalAlerts 1-n DICOM +(0010,2110) LO Allergies 1-n DICOM +(0010,2150) LO CountryOfResidence 1 DICOM +(0010,2152) LO RegionOfResidence 1 DICOM +(0010,2154) SH PatientTelephoneNumbers 1-n DICOM +(0010,2155) LT PatientTelecomInformation 1 DICOM +(0010,2160) SH EthnicGroup 1 DICOM +(0010,2180) SH Occupation 1 DICOM +(0010,21A0) CS SmokingStatus 1 DICOM +(0010,21B0) LT AdditionalPatientHistory 1 DICOM +(0010,21C0) US PregnancyStatus 1 DICOM +(0010,21D0) DA LastMenstrualDate 1 DICOM +(0010,21F0) LO PatientReligiousPreference 1 DICOM +(0010,2201) LO PatientSpeciesDescription 1 DICOM +(0010,2202) SQ PatientSpeciesCodeSequence 1 DICOM +(0010,2203) CS PatientSexNeutered 1 DICOM +(0010,2210) CS AnatomicalOrientationType 1 DICOM +(0010,2292) LO PatientBreedDescription 1 DICOM +(0010,2293) SQ PatientBreedCodeSequence 1 DICOM +(0010,2294) SQ BreedRegistrationSequence 1 DICOM +(0010,2295) LO BreedRegistrationNumber 1 DICOM +(0010,2296) SQ BreedRegistryCodeSequence 1 DICOM +(0010,2297) PN ResponsiblePerson 1 DICOM +(0010,2298) CS ResponsiblePersonRole 1 DICOM +(0010,2299) LO ResponsibleOrganization 1 DICOM +(0010,4000) LT PatientComments 1 DICOM +(0010,9431) FL ExaminedBodyThickness 1 DICOM +(0012,0010) LO ClinicalTrialSponsorName 1 DICOM +(0012,0020) LO ClinicalTrialProtocolID 1 DICOM +(0012,0021) LO ClinicalTrialProtocolName 1 DICOM +(0012,0030) LO ClinicalTrialSiteID 1 DICOM +(0012,0031) LO ClinicalTrialSiteName 1 DICOM +(0012,0040) LO ClinicalTrialSubjectID 1 DICOM +(0012,0042) LO ClinicalTrialSubjectReadingID 1 DICOM +(0012,0050) LO ClinicalTrialTimePointID 1 DICOM +(0012,0051) ST ClinicalTrialTimePointDescription 1 DICOM +(0012,0052) FD LongitudinalTemporalOffsetFromEvent 1 DICOM +(0012,0053) CS LongitudinalTemporalEventType 1 DICOM +(0012,0060) LO ClinicalTrialCoordinatingCenterName 1 DICOM +(0012,0062) CS PatientIdentityRemoved 1 DICOM +(0012,0063) LO DeidentificationMethod 1-n DICOM +(0012,0064) SQ DeidentificationMethodCodeSequence 1 DICOM +(0012,0071) LO ClinicalTrialSeriesID 1 DICOM +(0012,0072) LO ClinicalTrialSeriesDescription 1 DICOM +(0012,0081) LO ClinicalTrialProtocolEthicsCommitteeName 1 DICOM +(0012,0082) LO ClinicalTrialProtocolEthicsCommitteeApprovalNumber 1 DICOM +(0012,0083) SQ ConsentForClinicalTrialUseSequence 1 DICOM +(0012,0084) CS DistributionType 1 DICOM +(0012,0085) CS ConsentForDistributionFlag 1 DICOM +(0012,0086) DA EthicsCommitteeApprovalEffectivenessStartDate 1 DICOM +(0012,0087) DA EthicsCommitteeApprovalEffectivenessEndDate 1 DICOM +(0014,0025) ST ComponentManufacturingProcedure 1 DICOM/DICONDE +(0014,0028) ST ComponentManufacturer 1 DICOM/DICONDE +(0014,0030) DS MaterialThickness 1-n DICOM/DICONDE +(0014,0032) DS MaterialPipeDiameter 1-n DICOM/DICONDE +(0014,0034) DS MaterialIsolationDiameter 1-n DICOM/DICONDE +(0014,0042) ST MaterialGrade 1 DICOM/DICONDE +(0014,0044) ST MaterialPropertiesDescription 1 DICOM/DICONDE +(0014,0046) LT MaterialNotes 1 DICOM/DICONDE +(0014,0050) CS ComponentShape 1 DICOM/DICONDE +(0014,0052) CS CurvatureType 1 DICOM/DICONDE +(0014,0054) DS OuterDiameter 1 DICOM/DICONDE +(0014,0056) DS InnerDiameter 1 DICOM/DICONDE +(0014,0100) LO ComponentWelderIDs 1-n DICOM/DICONDE +(0014,0101) CS SecondaryApprovalStatus 1 DICOM/DICONDE +(0014,0102) DA SecondaryReviewDate 1 DICOM/DICONDE +(0014,0103) TM SecondaryReviewTime 1 DICOM/DICONDE +(0014,0104) PN SecondaryReviewerName 1 DICOM/DICONDE +(0014,0105) ST RepairID 1 DICOM/DICONDE +(0014,0106) SQ MultipleComponentApprovalSequence 1 DICOM/DICONDE +(0014,0107) CS OtherApprovalStatus 1-n DICOM/DICONDE +(0014,0108) CS OtherSecondaryApprovalStatus 1-n DICOM/DICONDE +(0014,1010) ST ActualEnvironmentalConditions 1 DICOM/DICONDE +(0014,1020) DA ExpiryDate 1 DICOM/DICONDE +(0014,1040) ST EnvironmentalConditions 1 DICOM/DICONDE +(0014,2002) SQ EvaluatorSequence 1 DICOM/DICONDE +(0014,2004) IS EvaluatorNumber 1 DICOM/DICONDE +(0014,2006) PN EvaluatorName 1 DICOM/DICONDE +(0014,2008) IS EvaluationAttempt 1 DICOM/DICONDE +(0014,2012) SQ IndicationSequence 1 DICOM/DICONDE +(0014,2014) IS IndicationNumber 1 DICOM/DICONDE +(0014,2016) SH IndicationLabel 1 DICOM/DICONDE +(0014,2018) ST IndicationDescription 1 DICOM/DICONDE +(0014,201A) CS IndicationType 1-n DICOM/DICONDE +(0014,201C) CS IndicationDisposition 1 DICOM/DICONDE +(0014,201E) SQ IndicationROISequence 1 DICOM/DICONDE +(0014,2030) SQ IndicationPhysicalPropertySequence 1 DICOM/DICONDE +(0014,2032) SH PropertyLabel 1 DICOM/DICONDE +(0014,2202) IS CoordinateSystemNumberOfAxes 1 DICOM/DICONDE +(0014,2204) SQ CoordinateSystemAxesSequence 1 DICOM/DICONDE +(0014,2206) ST CoordinateSystemAxisDescription 1 DICOM/DICONDE +(0014,2208) CS CoordinateSystemDataSetMapping 1 DICOM/DICONDE +(0014,220A) IS CoordinateSystemAxisNumber 1 DICOM/DICONDE +(0014,220C) CS CoordinateSystemAxisType 1 DICOM/DICONDE +(0014,220E) CS CoordinateSystemAxisUnits 1 DICOM/DICONDE +(0014,2210) OB CoordinateSystemAxisValues 1 DICOM/DICONDE +(0014,2220) SQ CoordinateSystemTransformSequence 1 DICOM/DICONDE +(0014,2222) ST TransformDescription 1 DICOM/DICONDE +(0014,2224) IS TransformNumberOfAxes 1 DICOM/DICONDE +(0014,2226) IS TransformOrderOfAxes 1-n DICOM/DICONDE +(0014,2228) CS TransformedAxisUnits 1 DICOM/DICONDE +(0014,222A) DS CoordinateSystemTransformRotationAndScaleMatrix 1-n DICOM/DICONDE +(0014,222C) DS CoordinateSystemTransformTranslationMatrix 1-n DICOM/DICONDE +(0014,3011) DS InternalDetectorFrameTime 1 DICOM/DICONDE +(0014,3012) DS NumberOfFramesIntegrated 1 DICOM/DICONDE +(0014,3020) SQ DetectorTemperatureSequence 1 DICOM/DICONDE +(0014,3022) ST SensorName 1 DICOM/DICONDE +(0014,3024) DS HorizontalOffsetOfSensor 1 DICOM/DICONDE +(0014,3026) DS VerticalOffsetOfSensor 1 DICOM/DICONDE +(0014,3028) DS SensorTemperature 1 DICOM/DICONDE +(0014,3040) SQ DarkCurrentSequence 1 DICOM/DICONDE +(0014,3050) ox DarkCurrentCounts 1 DICOM/DICONDE +(0014,3060) SQ GainCorrectionReferenceSequence 1 DICOM/DICONDE +(0014,3070) ox AirCounts 1 DICOM/DICONDE +(0014,3071) DS KVUsedInGainCalibration 1 DICOM/DICONDE +(0014,3072) DS MAUsedInGainCalibration 1 DICOM/DICONDE +(0014,3073) DS NumberOfFramesUsedForIntegration 1 DICOM/DICONDE +(0014,3074) LO FilterMaterialUsedInGainCalibration 1 DICOM/DICONDE +(0014,3075) DS FilterThicknessUsedInGainCalibration 1 DICOM/DICONDE +(0014,3076) DA DateOfGainCalibration 1 DICOM/DICONDE +(0014,3077) TM TimeOfGainCalibration 1 DICOM/DICONDE +(0014,3080) OB BadPixelImage 1 DICOM/DICONDE +(0014,3099) LT CalibrationNotes 1 DICOM/DICONDE +(0014,4002) SQ PulserEquipmentSequence 1 DICOM/DICONDE +(0014,4004) CS PulserType 1 DICOM/DICONDE +(0014,4006) LT PulserNotes 1 DICOM/DICONDE +(0014,4008) SQ ReceiverEquipmentSequence 1 DICOM/DICONDE +(0014,400A) CS AmplifierType 1 DICOM/DICONDE +(0014,400C) LT ReceiverNotes 1 DICOM/DICONDE +(0014,400E) SQ PreAmplifierEquipmentSequence 1 DICOM/DICONDE +(0014,400F) LT PreAmplifierNotes 1 DICOM/DICONDE +(0014,4010) SQ TransmitTransducerSequence 1 DICOM/DICONDE +(0014,4011) SQ ReceiveTransducerSequence 1 DICOM/DICONDE +(0014,4012) US NumberOfElements 1 DICOM/DICONDE +(0014,4013) CS ElementShape 1 DICOM/DICONDE +(0014,4014) DS ElementDimensionA 1 DICOM/DICONDE +(0014,4015) DS ElementDimensionB 1 DICOM/DICONDE +(0014,4016) DS ElementPitchA 1 DICOM/DICONDE +(0014,4017) DS MeasuredBeamDimensionA 1 DICOM/DICONDE +(0014,4018) DS MeasuredBeamDimensionB 1 DICOM/DICONDE +(0014,4019) DS LocationOfMeasuredBeamDiameter 1 DICOM/DICONDE +(0014,401A) DS NominalFrequency 1 DICOM/DICONDE +(0014,401B) DS MeasuredCenterFrequency 1 DICOM/DICONDE +(0014,401C) DS MeasuredBandwidth 1 DICOM/DICONDE +(0014,401D) DS ElementPitchB 1 DICOM/DICONDE +(0014,4020) SQ PulserSettingsSequence 1 DICOM/DICONDE +(0014,4022) DS PulseWidth 1 DICOM/DICONDE +(0014,4024) DS ExcitationFrequency 1 DICOM/DICONDE +(0014,4026) CS ModulationType 1 DICOM/DICONDE +(0014,4028) DS Damping 1 DICOM/DICONDE +(0014,4030) SQ ReceiverSettingsSequence 1 DICOM/DICONDE +(0014,4031) DS AcquiredSoundpathLength 1 DICOM/DICONDE +(0014,4032) CS AcquisitionCompressionType 1 DICOM/DICONDE +(0014,4033) IS AcquisitionSampleSize 1 DICOM/DICONDE +(0014,4034) DS RectifierSmoothing 1 DICOM/DICONDE +(0014,4035) SQ DACSequence 1 DICOM/DICONDE +(0014,4036) CS DACType 1 DICOM/DICONDE +(0014,4038) DS DACGainPoints 1-n DICOM/DICONDE +(0014,403A) DS DACTimePoints 1-n DICOM/DICONDE +(0014,403C) DS DACAmplitude 1-n DICOM/DICONDE +(0014,4040) SQ PreAmplifierSettingsSequence 1 DICOM/DICONDE +(0014,4050) SQ TransmitTransducerSettingsSequence 1 DICOM/DICONDE +(0014,4051) SQ ReceiveTransducerSettingsSequence 1 DICOM/DICONDE +(0014,4052) DS IncidentAngle 1 DICOM/DICONDE +(0014,4054) ST CouplingTechnique 1 DICOM/DICONDE +(0014,4056) ST CouplingMedium 1 DICOM/DICONDE +(0014,4057) DS CouplingVelocity 1 DICOM/DICONDE +(0014,4058) DS ProbeCenterLocationX 1 DICOM/DICONDE +(0014,4059) DS ProbeCenterLocationZ 1 DICOM/DICONDE +(0014,405A) DS SoundPathLength 1 DICOM/DICONDE +(0014,405C) ST DelayLawIdentifier 1 DICOM/DICONDE +(0014,4060) SQ GateSettingsSequence 1 DICOM/DICONDE +(0014,4062) DS GateThreshold 1 DICOM/DICONDE +(0014,4064) DS VelocityOfSound 1 DICOM/DICONDE +(0014,4070) SQ CalibrationSettingsSequence 1 DICOM/DICONDE +(0014,4072) ST CalibrationProcedure 1 DICOM/DICONDE +(0014,4074) SH ProcedureVersion 1 DICOM/DICONDE +(0014,4076) DA ProcedureCreationDate 1 DICOM/DICONDE +(0014,4078) DA ProcedureExpirationDate 1 DICOM/DICONDE +(0014,407A) DA ProcedureLastModifiedDate 1 DICOM/DICONDE +(0014,407C) TM CalibrationTime 1-n DICOM/DICONDE +(0014,407E) DA CalibrationDate 1-n DICOM/DICONDE +(0014,4080) SQ ProbeDriveEquipmentSequence 1 DICOM/DICONDE +(0014,4081) CS DriveType 1 DICOM/DICONDE +(0014,4082) LT ProbeDriveNotes 1 DICOM/DICONDE +(0014,4083) SQ DriveProbeSequence 1 DICOM/DICONDE +(0014,4084) DS ProbeInductance 1 DICOM/DICONDE +(0014,4085) DS ProbeResistance 1 DICOM/DICONDE +(0014,4086) SQ ReceiveProbeSequence 1 DICOM/DICONDE +(0014,4087) SQ ProbeDriveSettingsSequence 1 DICOM/DICONDE +(0014,4088) DS BridgeResistors 1 DICOM/DICONDE +(0014,4089) DS ProbeOrientationAngle 1 DICOM/DICONDE +(0014,408B) DS UserSelectedGainY 1 DICOM/DICONDE +(0014,408C) DS UserSelectedPhase 1 DICOM/DICONDE +(0014,408D) DS UserSelectedOffsetX 1 DICOM/DICONDE +(0014,408E) DS UserSelectedOffsetY 1 DICOM/DICONDE +(0014,4091) SQ ChannelSettingsSequence 1 DICOM/DICONDE +(0014,4092) DS ChannelThreshold 1 DICOM/DICONDE +(0014,409A) SQ ScannerSettingsSequence 1 DICOM/DICONDE +(0014,409B) ST ScanProcedure 1 DICOM/DICONDE +(0014,409C) DS TranslationRateX 1 DICOM/DICONDE +(0014,409D) DS TranslationRateY 1 DICOM/DICONDE +(0014,409F) DS ChannelOverlap 1 DICOM/DICONDE +(0014,40A0) LO ImageQualityIndicatorType 1 DICOM/DICONDE +(0014,40A1) LO ImageQualityIndicatorMaterial 1 DICOM/DICONDE +(0014,40A2) LO ImageQualityIndicatorSize 1 DICOM/DICONDE +(0014,5002) IS LINACEnergy 1 DICOM/DICONDE +(0014,5004) IS LINACOutput 1 DICOM/DICONDE +(0014,5100) US ActiveAperture 1 DICOM/DICONDE +(0014,5101) DS TotalAperture 1 DICOM/DICONDE +(0014,5102) DS ApertureElevation 1 DICOM/DICONDE +(0014,5103) DS MainLobeAngle 1 DICOM/DICONDE +(0014,5104) DS MainRoofAngle 1 DICOM/DICONDE +(0014,5105) CS ConnectorType 1 DICOM/DICONDE +(0014,5106) SH WedgeModelNumber 1 DICOM/DICONDE +(0014,5107) DS WedgeAngleFloat 1 DICOM/DICONDE +(0014,5108) DS WedgeRoofAngle 1 DICOM/DICONDE +(0014,5109) CS WedgeElement1Position 1 DICOM/DICONDE +(0014,510A) DS WedgeMaterialVelocity 1 DICOM/DICONDE +(0014,510B) SH WedgeMaterial 1 DICOM/DICONDE +(0014,510C) DS WedgeOffsetZ 1 DICOM/DICONDE +(0014,510D) DS WedgeOriginOffsetX 1 DICOM/DICONDE +(0014,510E) DS WedgeTimeDelay 1 DICOM/DICONDE +(0014,510F) SH WedgeName 1 DICOM/DICONDE +(0014,5110) SH WedgeManufacturerName 1 DICOM/DICONDE +(0014,5111) LO WedgeDescription 1 DICOM/DICONDE +(0014,5112) DS NominalBeamAngle 1 DICOM/DICONDE +(0014,5113) DS WedgeOffsetX 1 DICOM/DICONDE +(0014,5114) DS WedgeOffsetY 1 DICOM/DICONDE +(0014,5115) DS WedgeTotalLength 1 DICOM/DICONDE +(0014,5116) DS WedgeInContactLength 1 DICOM/DICONDE +(0014,5117) DS WedgeFrontGap 1 DICOM/DICONDE +(0014,5118) DS WedgeTotalHeight 1 DICOM/DICONDE +(0014,5119) DS WedgeFrontHeight 1 DICOM/DICONDE +(0014,511A) DS WedgeRearHeight 1 DICOM/DICONDE +(0014,511B) DS WedgeTotalWidth 1 DICOM/DICONDE +(0014,511C) DS WedgeInContactWidth 1 DICOM/DICONDE +(0014,511D) DS WedgeChamferHeight 1 DICOM/DICONDE +(0014,511E) CS WedgeCurve 1 DICOM/DICONDE +(0014,511F) DS RadiusAlongWedge 1 DICOM/DICONDE +(0016,0001) DS WhitePoint 1 DICOM +(0016,0002) DS PrimaryChromaticities 3 DICOM +(0016,0003) UT BatteryLevel 1 DICOM +(0016,0004) DS ExposureTimeInSeconds 1 DICOM +(0016,0005) DS FNumber 1 DICOM +(0016,0006) IS OECFRows 1 DICOM +(0016,0007) IS OECFColumns 1 DICOM +(0016,0008) UC OECFColumnNames 1-n DICOM +(0016,0009) DS OECFValues 1-n DICOM +(0016,000A) IS SpatialFrequencyResponseRows 1 DICOM +(0016,000B) IS SpatialFrequencyResponseColumns 1 DICOM +(0016,000C) UC SpatialFrequencyResponseColumnNames 1-n DICOM +(0016,000D) DS SpatialFrequencyResponseValues 1-n DICOM +(0016,000E) IS ColorFilterArrayPatternRows 1 DICOM +(0016,000F) IS ColorFilterArrayPatternColumns 1 DICOM +(0016,0010) DS ColorFilterArrayPatternValues 1-n DICOM +(0016,0011) US FlashFiringStatus 1 DICOM +(0016,0012) US FlashReturnStatus 1 DICOM +(0016,0013) US FlashMode 1 DICOM +(0016,0014) US FlashFunctionPresent 1 DICOM +(0016,0015) US FlashRedEyeMode 1 DICOM +(0016,0016) US ExposureProgram 1 DICOM +(0016,0017) UT SpectralSensitivity 1 DICOM +(0016,0018) IS PhotographicSensitivity 1 DICOM +(0016,0019) IS SelfTimerMode 1 DICOM +(0016,001A) US SensitivityType 1 DICOM +(0016,001B) IS StandardOutputSensitivity 1 DICOM +(0016,001C) IS RecommendedExposureIndex 1 DICOM +(0016,001D) IS ISOSpeed 1 DICOM +(0016,001E) IS ISOSpeedLatitudeyyy 1 DICOM +(0016,001F) IS ISOSpeedLatitudezzz 1 DICOM +(0016,0020) UT EXIFVersion 1 DICOM +(0016,0021) DS ShutterSpeedValue 1 DICOM +(0016,0022) DS ApertureValue 1 DICOM +(0016,0023) DS BrightnessValue 1 DICOM +(0016,0024) DS ExposureBiasValue 1 DICOM +(0016,0025) DS MaxApertureValue 1 DICOM +(0016,0026) DS SubjectDistance 1 DICOM +(0016,0027) US MeteringMode 1 DICOM +(0016,0028) US LightSource 1 DICOM +(0016,0029) DS FocalLength 1 DICOM +(0016,002A) IS SubjectArea 2-4 DICOM +(0016,002B) OB MakerNote 1 DICOM +(0016,0030) DS Temperature 1 DICOM +(0016,0031) DS Humidity 1 DICOM +(0016,0032) DS Pressure 1 DICOM +(0016,0033) DS WaterDepth 1 DICOM +(0016,0034) DS Acceleration 1 DICOM +(0016,0035) DS CameraElevationAngle 1 DICOM +(0016,0036) DS FlashEnergy 1-2 DICOM +(0016,0037) IS SubjectLocation 2 DICOM +(0016,0038) DS PhotographicExposureIndex 1 DICOM +(0016,0039) US SensingMethod 1 DICOM +(0016,003A) US FileSource 1 DICOM +(0016,003B) US SceneType 1 DICOM +(0016,0041) US CustomRendered 1 DICOM +(0016,0042) US ExposureMode 1 DICOM +(0016,0043) US WhiteBalance 1 DICOM +(0016,0044) DS DigitalZoomRatio 1 DICOM +(0016,0045) IS FocalLengthIn35mmFilm 1 DICOM +(0016,0046) US SceneCaptureType 1 DICOM +(0016,0047) US GainControl 1 DICOM +(0016,0048) US Contrast 1 DICOM +(0016,0049) US Saturation 1 DICOM +(0016,004A) US Sharpness 1 DICOM +(0016,004B) OB DeviceSettingDescription 1 DICOM +(0016,004C) US SubjectDistanceRange 1 DICOM +(0016,004D) UT CameraOwnerName 1 DICOM +(0016,004E) DS LensSpecification 4 DICOM +(0016,004F) UT LensMake 1 DICOM +(0016,0050) UT LensModel 1 DICOM +(0016,0051) UT LensSerialNumber 1 DICOM +(0016,0061) CS InteroperabilityIndex 1 DICOM +(0016,0062) OB InteroperabilityVersion 1 DICOM +(0016,0070) OB GPSVersionID 1 DICOM +(0016,0071) CS GPSLatitudeRef 1 DICOM +(0016,0072) DS GPSLatitude 3 DICOM +(0016,0073) CS GPSLongitudeRef 1 DICOM +(0016,0074) DS GPSLongitude 3 DICOM +(0016,0075) US GPSAltitudeRef 1 DICOM +(0016,0076) DS GPSAltitude 1 DICOM +(0016,0077) DT GPSTimeStamp 1 DICOM +(0016,0078) UT GPSSatellites 1 DICOM +(0016,0079) CS GPSStatus 1 DICOM +(0016,007A) CS GPSMeasureMode 1 DICOM +(0016,007B) DS GPSDOP 1 DICOM +(0016,007C) CS GPSSpeedRef 1 DICOM +(0016,007D) DS GPSSpeed 1 DICOM +(0016,007E) CS GPSTrackRef 1 DICOM +(0016,007F) DS GPSTrack 1 DICOM +(0016,0080) CS GPSImgDirectionRef 1 DICOM +(0016,0081) DS GPSImgDirection 1 DICOM +(0016,0082) UT GPSMapDatum 1 DICOM +(0016,0083) CS GPSDestLatitudeRef 1 DICOM +(0016,0084) DS GPSDestLatitude 3 DICOM +(0016,0085) CS GPSDestLongitudeRef 1 DICOM +(0016,0086) DS GPSDestLongitude 3 DICOM +(0016,0087) CS GPSDestBearingRef 1 DICOM +(0016,0088) DS GPSDestBearing 1 DICOM +(0016,0089) CS GPSDestDistanceRef 1 DICOM +(0016,008A) DS GPSDestDistance 1 DICOM +(0016,008B) OB GPSProcessingMethod 1 DICOM +(0016,008C) OB GPSAreaInformation 1 DICOM +(0016,008D) DT GPSDateStamp 1 DICOM +(0016,008E) IS GPSDifferential 1 DICOM +(0018,0010) LO ContrastBolusAgent 1 DICOM +(0018,0012) SQ ContrastBolusAgentSequence 1 DICOM +(0018,0013) FL ContrastBolusT1Relaxivity 1 DICOM +(0018,0014) SQ ContrastBolusAdministrationRouteSequence 1 DICOM +(0018,0015) CS BodyPartExamined 1 DICOM +(0018,0020) CS ScanningSequence 1-n DICOM +(0018,0021) CS SequenceVariant 1-n DICOM +(0018,0022) CS ScanOptions 1-n DICOM +(0018,0023) CS MRAcquisitionType 1 DICOM +(0018,0024) SH SequenceName 1 DICOM +(0018,0025) CS AngioFlag 1 DICOM +(0018,0026) SQ InterventionDrugInformationSequence 1 DICOM +(0018,0027) TM InterventionDrugStopTime 1 DICOM +(0018,0028) DS InterventionDrugDose 1 DICOM +(0018,0029) SQ InterventionDrugCodeSequence 1 DICOM +(0018,002A) SQ AdditionalDrugSequence 1 DICOM +(0018,0031) LO Radiopharmaceutical 1 DICOM +(0018,0034) LO InterventionDrugName 1 DICOM +(0018,0035) TM InterventionDrugStartTime 1 DICOM +(0018,0036) SQ InterventionSequence 1 DICOM +(0018,0038) CS InterventionStatus 1 DICOM +(0018,003A) ST InterventionDescription 1 DICOM +(0018,0040) IS CineRate 1 DICOM +(0018,0042) CS InitialCineRunState 1 DICOM +(0018,0050) DS SliceThickness 1 DICOM +(0018,0060) DS KVP 1 DICOM +(0018,0070) IS CountsAccumulated 1 DICOM +(0018,0071) CS AcquisitionTerminationCondition 1 DICOM +(0018,0072) DS EffectiveDuration 1 DICOM +(0018,0073) CS AcquisitionStartCondition 1 DICOM +(0018,0074) IS AcquisitionStartConditionData 1 DICOM +(0018,0075) IS AcquisitionTerminationConditionData 1 DICOM +(0018,0080) DS RepetitionTime 1 DICOM +(0018,0081) DS EchoTime 1 DICOM +(0018,0082) DS InversionTime 1 DICOM +(0018,0083) DS NumberOfAverages 1 DICOM +(0018,0084) DS ImagingFrequency 1 DICOM +(0018,0085) SH ImagedNucleus 1 DICOM +(0018,0086) IS EchoNumbers 1-n DICOM +(0018,0087) DS MagneticFieldStrength 1 DICOM +(0018,0088) DS SpacingBetweenSlices 1 DICOM +(0018,0089) IS NumberOfPhaseEncodingSteps 1 DICOM +(0018,0090) DS DataCollectionDiameter 1 DICOM +(0018,0091) IS EchoTrainLength 1 DICOM +(0018,0093) DS PercentSampling 1 DICOM +(0018,0094) DS PercentPhaseFieldOfView 1 DICOM +(0018,0095) DS PixelBandwidth 1 DICOM +(0018,1000) LO DeviceSerialNumber 1 DICOM +(0018,1002) UI DeviceUID 1 DICOM +(0018,1003) LO DeviceID 1 DICOM +(0018,1004) LO PlateID 1 DICOM +(0018,1005) LO GeneratorID 1 DICOM +(0018,1006) LO GridID 1 DICOM +(0018,1007) LO CassetteID 1 DICOM +(0018,1008) LO GantryID 1 DICOM +(0018,1009) UT UniqueDeviceIdentifier 1 DICOM +(0018,100A) SQ UDISequence 1 DICOM +(0018,1010) LO SecondaryCaptureDeviceID 1 DICOM +(0018,1012) DA DateOfSecondaryCapture 1 DICOM +(0018,1014) TM TimeOfSecondaryCapture 1 DICOM +(0018,1016) LO SecondaryCaptureDeviceManufacturer 1 DICOM +(0018,1018) LO SecondaryCaptureDeviceManufacturerModelName 1 DICOM +(0018,1019) LO SecondaryCaptureDeviceSoftwareVersions 1-n DICOM +(0018,1020) LO SoftwareVersions 1-n DICOM +(0018,1022) SH VideoImageFormatAcquired 1 DICOM +(0018,1023) LO DigitalImageFormatAcquired 1 DICOM +(0018,1030) LO ProtocolName 1 DICOM +(0018,1040) LO ContrastBolusRoute 1 DICOM +(0018,1041) DS ContrastBolusVolume 1 DICOM +(0018,1042) TM ContrastBolusStartTime 1 DICOM +(0018,1043) TM ContrastBolusStopTime 1 DICOM +(0018,1044) DS ContrastBolusTotalDose 1 DICOM +(0018,1045) IS SyringeCounts 1 DICOM +(0018,1046) DS ContrastFlowRate 1-n DICOM +(0018,1047) DS ContrastFlowDuration 1-n DICOM +(0018,1048) CS ContrastBolusIngredient 1 DICOM +(0018,1049) DS ContrastBolusIngredientConcentration 1 DICOM +(0018,1050) DS SpatialResolution 1 DICOM +(0018,1060) DS TriggerTime 1 DICOM +(0018,1061) LO TriggerSourceOrType 1 DICOM +(0018,1062) IS NominalInterval 1 DICOM +(0018,1063) DS FrameTime 1 DICOM +(0018,1064) LO CardiacFramingType 1 DICOM +(0018,1065) DS FrameTimeVector 1-n DICOM +(0018,1066) DS FrameDelay 1 DICOM +(0018,1067) DS ImageTriggerDelay 1 DICOM +(0018,1068) DS MultiplexGroupTimeOffset 1 DICOM +(0018,1069) DS TriggerTimeOffset 1 DICOM +(0018,106A) CS SynchronizationTrigger 1 DICOM +(0018,106C) US SynchronizationChannel 2 DICOM +(0018,106E) UL TriggerSamplePosition 1 DICOM +(0018,1070) LO RadiopharmaceuticalRoute 1 DICOM +(0018,1071) DS RadiopharmaceuticalVolume 1 DICOM +(0018,1072) TM RadiopharmaceuticalStartTime 1 DICOM +(0018,1073) TM RadiopharmaceuticalStopTime 1 DICOM +(0018,1074) DS RadionuclideTotalDose 1 DICOM +(0018,1075) DS RadionuclideHalfLife 1 DICOM +(0018,1076) DS RadionuclidePositronFraction 1 DICOM +(0018,1077) DS RadiopharmaceuticalSpecificActivity 1 DICOM +(0018,1078) DT RadiopharmaceuticalStartDateTime 1 DICOM +(0018,1079) DT RadiopharmaceuticalStopDateTime 1 DICOM +(0018,1080) CS BeatRejectionFlag 1 DICOM +(0018,1081) IS LowRRValue 1 DICOM +(0018,1082) IS HighRRValue 1 DICOM +(0018,1083) IS IntervalsAcquired 1 DICOM +(0018,1084) IS IntervalsRejected 1 DICOM +(0018,1085) LO PVCRejection 1 DICOM +(0018,1086) IS SkipBeats 1 DICOM +(0018,1088) IS HeartRate 1 DICOM +(0018,1090) IS CardiacNumberOfImages 1 DICOM +(0018,1094) IS TriggerWindow 1 DICOM +(0018,1100) DS ReconstructionDiameter 1 DICOM +(0018,1110) DS DistanceSourceToDetector 1 DICOM +(0018,1111) DS DistanceSourceToPatient 1 DICOM +(0018,1114) DS EstimatedRadiographicMagnificationFactor 1 DICOM +(0018,1120) DS GantryDetectorTilt 1 DICOM +(0018,1121) DS GantryDetectorSlew 1 DICOM +(0018,1130) DS TableHeight 1 DICOM +(0018,1131) DS TableTraverse 1 DICOM +(0018,1134) CS TableMotion 1 DICOM +(0018,1135) DS TableVerticalIncrement 1-n DICOM +(0018,1136) DS TableLateralIncrement 1-n DICOM +(0018,1137) DS TableLongitudinalIncrement 1-n DICOM +(0018,1138) DS TableAngle 1 DICOM +(0018,113A) CS TableType 1 DICOM +(0018,1140) CS RotationDirection 1 DICOM +(0018,1142) DS RadialPosition 1-n DICOM +(0018,1143) DS ScanArc 1 DICOM +(0018,1144) DS AngularStep 1 DICOM +(0018,1145) DS CenterOfRotationOffset 1 DICOM +(0018,1147) CS FieldOfViewShape 1 DICOM +(0018,1149) IS FieldOfViewDimensions 1-2 DICOM +(0018,1150) IS ExposureTime 1 DICOM +(0018,1151) IS XRayTubeCurrent 1 DICOM +(0018,1152) IS Exposure 1 DICOM +(0018,1153) IS ExposureInuAs 1 DICOM +(0018,1154) DS AveragePulseWidth 1 DICOM +(0018,1155) CS RadiationSetting 1 DICOM +(0018,1156) CS RectificationType 1 DICOM +(0018,115A) CS RadiationMode 1 DICOM +(0018,115E) DS ImageAndFluoroscopyAreaDoseProduct 1 DICOM +(0018,1160) SH FilterType 1 DICOM +(0018,1161) LO TypeOfFilters 1-n DICOM +(0018,1162) DS IntensifierSize 1 DICOM +(0018,1164) DS ImagerPixelSpacing 2 DICOM +(0018,1166) CS Grid 1-n DICOM +(0018,1170) IS GeneratorPower 1 DICOM +(0018,1180) SH CollimatorGridName 1 DICOM +(0018,1181) CS CollimatorType 1 DICOM +(0018,1182) IS FocalDistance 1-2 DICOM +(0018,1183) DS XFocusCenter 1-2 DICOM +(0018,1184) DS YFocusCenter 1-2 DICOM +(0018,1190) DS FocalSpots 1-n DICOM +(0018,1191) CS AnodeTargetMaterial 1 DICOM +(0018,11A0) DS BodyPartThickness 1 DICOM +(0018,11A2) DS CompressionForce 1 DICOM +(0018,11A3) DS CompressionPressure 1 DICOM +(0018,11A4) LO PaddleDescription 1 DICOM +(0018,11A5) DS CompressionContactArea 1 DICOM +(0018,1200) DA DateOfLastCalibration 1-n DICOM +(0018,1201) TM TimeOfLastCalibration 1-n DICOM +(0018,1202) DT DateTimeOfLastCalibration 1 DICOM +(0018,1210) SH ConvolutionKernel 1-n DICOM +(0018,1242) IS ActualFrameDuration 1 DICOM +(0018,1243) IS CountRate 1 DICOM +(0018,1244) US PreferredPlaybackSequencing 1 DICOM +(0018,1250) SH ReceiveCoilName 1 DICOM +(0018,1251) SH TransmitCoilName 1 DICOM +(0018,1260) SH PlateType 1 DICOM +(0018,1261) LO PhosphorType 1 DICOM +(0018,1271) FD WaterEquivalentDiameter 1 DICOM +(0018,1272) SQ WaterEquivalentDiameterCalculationMethodCodeSequence 1 DICOM +(0018,1300) DS ScanVelocity 1 DICOM +(0018,1301) CS WholeBodyTechnique 1-n DICOM +(0018,1302) IS ScanLength 1 DICOM +(0018,1310) US AcquisitionMatrix 4 DICOM +(0018,1312) CS InPlanePhaseEncodingDirection 1 DICOM +(0018,1314) DS FlipAngle 1 DICOM +(0018,1315) CS VariableFlipAngleFlag 1 DICOM +(0018,1316) DS SAR 1 DICOM +(0018,1318) DS dBdt 1 DICOM +(0018,1320) FL B1rms 1 DICOM +(0018,1400) LO AcquisitionDeviceProcessingDescription 1 DICOM +(0018,1401) LO AcquisitionDeviceProcessingCode 1 DICOM +(0018,1402) CS CassetteOrientation 1 DICOM +(0018,1403) CS CassetteSize 1 DICOM +(0018,1404) US ExposuresOnPlate 1 DICOM +(0018,1405) IS RelativeXRayExposure 1 DICOM +(0018,1411) DS ExposureIndex 1 DICOM +(0018,1412) DS TargetExposureIndex 1 DICOM +(0018,1413) DS DeviationIndex 1 DICOM +(0018,1450) DS ColumnAngulation 1 DICOM +(0018,1460) DS TomoLayerHeight 1 DICOM +(0018,1470) DS TomoAngle 1 DICOM +(0018,1480) DS TomoTime 1 DICOM +(0018,1490) CS TomoType 1 DICOM +(0018,1491) CS TomoClass 1 DICOM +(0018,1495) IS NumberOfTomosynthesisSourceImages 1 DICOM +(0018,1500) CS PositionerMotion 1 DICOM +(0018,1508) CS PositionerType 1 DICOM +(0018,1510) DS PositionerPrimaryAngle 1 DICOM +(0018,1511) DS PositionerSecondaryAngle 1 DICOM +(0018,1520) DS PositionerPrimaryAngleIncrement 1-n DICOM +(0018,1521) DS PositionerSecondaryAngleIncrement 1-n DICOM +(0018,1530) DS DetectorPrimaryAngle 1 DICOM +(0018,1531) DS DetectorSecondaryAngle 1 DICOM +(0018,1600) CS ShutterShape 1-3 DICOM +(0018,1602) IS ShutterLeftVerticalEdge 1 DICOM +(0018,1604) IS ShutterRightVerticalEdge 1 DICOM +(0018,1606) IS ShutterUpperHorizontalEdge 1 DICOM +(0018,1608) IS ShutterLowerHorizontalEdge 1 DICOM +(0018,1610) IS CenterOfCircularShutter 2 DICOM +(0018,1612) IS RadiusOfCircularShutter 1 DICOM +(0018,1620) IS VerticesOfThePolygonalShutter 2-2n DICOM +(0018,1622) US ShutterPresentationValue 1 DICOM +(0018,1623) US ShutterOverlayGroup 1 DICOM +(0018,1624) US ShutterPresentationColorCIELabValue 3 DICOM +(0018,1700) CS CollimatorShape 1-3 DICOM +(0018,1702) IS CollimatorLeftVerticalEdge 1 DICOM +(0018,1704) IS CollimatorRightVerticalEdge 1 DICOM +(0018,1706) IS CollimatorUpperHorizontalEdge 1 DICOM +(0018,1708) IS CollimatorLowerHorizontalEdge 1 DICOM +(0018,1710) IS CenterOfCircularCollimator 2 DICOM +(0018,1712) IS RadiusOfCircularCollimator 1 DICOM +(0018,1720) IS VerticesOfThePolygonalCollimator 2-2n DICOM +(0018,1800) CS AcquisitionTimeSynchronized 1 DICOM +(0018,1801) SH TimeSource 1 DICOM +(0018,1802) CS TimeDistributionProtocol 1 DICOM +(0018,1803) LO NTPSourceAddress 1 DICOM +(0018,2001) IS PageNumberVector 1-n DICOM +(0018,2002) SH FrameLabelVector 1-n DICOM +(0018,2003) DS FramePrimaryAngleVector 1-n DICOM +(0018,2004) DS FrameSecondaryAngleVector 1-n DICOM +(0018,2005) DS SliceLocationVector 1-n DICOM +(0018,2006) SH DisplayWindowLabelVector 1-n DICOM +(0018,2010) DS NominalScannedPixelSpacing 2 DICOM +(0018,2020) CS DigitizingDeviceTransportDirection 1 DICOM +(0018,2030) DS RotationOfScannedFilm 1 DICOM +(0018,2041) SQ BiopsyTargetSequence 1 DICOM +(0018,2042) UI TargetUID 1 DICOM +(0018,2043) FL LocalizingCursorPosition 2 DICOM +(0018,2044) FL CalculatedTargetPosition 3 DICOM +(0018,2045) SH TargetLabel 1 DICOM +(0018,2046) FL DisplayedZValue 1 DICOM +(0018,3100) CS IVUSAcquisition 1 DICOM +(0018,3101) DS IVUSPullbackRate 1 DICOM +(0018,3102) DS IVUSGatedRate 1 DICOM +(0018,3103) IS IVUSPullbackStartFrameNumber 1 DICOM +(0018,3104) IS IVUSPullbackStopFrameNumber 1 DICOM +(0018,3105) IS LesionNumber 1-n DICOM +(0018,5000) SH OutputPower 1-n DICOM +(0018,5010) LO TransducerData 1-n DICOM +(0018,5012) DS FocusDepth 1 DICOM +(0018,5020) LO ProcessingFunction 1 DICOM +(0018,5022) DS MechanicalIndex 1 DICOM +(0018,5024) DS BoneThermalIndex 1 DICOM +(0018,5026) DS CranialThermalIndex 1 DICOM +(0018,5027) DS SoftTissueThermalIndex 1 DICOM +(0018,5028) DS SoftTissueFocusThermalIndex 1 DICOM +(0018,5029) DS SoftTissueSurfaceThermalIndex 1 DICOM +(0018,5050) IS DepthOfScanField 1 DICOM +(0018,5100) CS PatientPosition 1 DICOM +(0018,5101) CS ViewPosition 1 DICOM +(0018,5104) SQ ProjectionEponymousNameCodeSequence 1 DICOM +(0018,6000) DS Sensitivity 1 DICOM +(0018,6011) SQ SequenceOfUltrasoundRegions 1 DICOM +(0018,6012) US RegionSpatialFormat 1 DICOM +(0018,6014) US RegionDataType 1 DICOM +(0018,6016) UL RegionFlags 1 DICOM +(0018,6018) UL RegionLocationMinX0 1 DICOM +(0018,601A) UL RegionLocationMinY0 1 DICOM +(0018,601C) UL RegionLocationMaxX1 1 DICOM +(0018,601E) UL RegionLocationMaxY1 1 DICOM +(0018,6020) SL ReferencePixelX0 1 DICOM +(0018,6022) SL ReferencePixelY0 1 DICOM +(0018,6024) US PhysicalUnitsXDirection 1 DICOM +(0018,6026) US PhysicalUnitsYDirection 1 DICOM +(0018,6028) FD ReferencePixelPhysicalValueX 1 DICOM +(0018,602A) FD ReferencePixelPhysicalValueY 1 DICOM +(0018,602C) FD PhysicalDeltaX 1 DICOM +(0018,602E) FD PhysicalDeltaY 1 DICOM +(0018,6030) UL TransducerFrequency 1 DICOM +(0018,6031) CS TransducerType 1 DICOM +(0018,6032) UL PulseRepetitionFrequency 1 DICOM +(0018,6034) FD DopplerCorrectionAngle 1 DICOM +(0018,6036) FD SteeringAngle 1 DICOM +(0018,6039) SL DopplerSampleVolumeXPosition 1 DICOM +(0018,603B) SL DopplerSampleVolumeYPosition 1 DICOM +(0018,603D) SL TMLinePositionX0 1 DICOM +(0018,603F) SL TMLinePositionY0 1 DICOM +(0018,6041) SL TMLinePositionX1 1 DICOM +(0018,6043) SL TMLinePositionY1 1 DICOM +(0018,6044) US PixelComponentOrganization 1 DICOM +(0018,6046) UL PixelComponentMask 1 DICOM +(0018,6048) UL PixelComponentRangeStart 1 DICOM +(0018,604A) UL PixelComponentRangeStop 1 DICOM +(0018,604C) US PixelComponentPhysicalUnits 1 DICOM +(0018,604E) US PixelComponentDataType 1 DICOM +(0018,6050) UL NumberOfTableBreakPoints 1 DICOM +(0018,6052) UL TableOfXBreakPoints 1-n DICOM +(0018,6054) FD TableOfYBreakPoints 1-n DICOM +(0018,6056) UL NumberOfTableEntries 1 DICOM +(0018,6058) UL TableOfPixelValues 1-n DICOM +(0018,605A) FL TableOfParameterValues 1-n DICOM +(0018,6060) FL RWaveTimeVector 1-n DICOM +(0018,7000) CS DetectorConditionsNominalFlag 1 DICOM +(0018,7001) DS DetectorTemperature 1 DICOM +(0018,7004) CS DetectorType 1 DICOM +(0018,7005) CS DetectorConfiguration 1 DICOM +(0018,7006) LT DetectorDescription 1 DICOM +(0018,7008) LT DetectorMode 1 DICOM +(0018,700A) SH DetectorID 1 DICOM +(0018,700C) DA DateOfLastDetectorCalibration 1 DICOM +(0018,700E) TM TimeOfLastDetectorCalibration 1 DICOM +(0018,7010) IS ExposuresOnDetectorSinceLastCalibration 1 DICOM +(0018,7011) IS ExposuresOnDetectorSinceManufactured 1 DICOM +(0018,7012) DS DetectorTimeSinceLastExposure 1 DICOM +(0018,7014) DS DetectorActiveTime 1 DICOM +(0018,7016) DS DetectorActivationOffsetFromExposure 1 DICOM +(0018,701A) DS DetectorBinning 2 DICOM +(0018,7020) DS DetectorElementPhysicalSize 2 DICOM +(0018,7022) DS DetectorElementSpacing 2 DICOM +(0018,7024) CS DetectorActiveShape 1 DICOM +(0018,7026) DS DetectorActiveDimensions 1-2 DICOM +(0018,7028) DS DetectorActiveOrigin 2 DICOM +(0018,702A) LO DetectorManufacturerName 1 DICOM +(0018,702B) LO DetectorManufacturerModelName 1 DICOM +(0018,7030) DS FieldOfViewOrigin 2 DICOM +(0018,7032) DS FieldOfViewRotation 1 DICOM +(0018,7034) CS FieldOfViewHorizontalFlip 1 DICOM +(0018,7036) FL PixelDataAreaOriginRelativeToFOV 2 DICOM +(0018,7038) FL PixelDataAreaRotationAngleRelativeToFOV 1 DICOM +(0018,7040) LT GridAbsorbingMaterial 1 DICOM +(0018,7041) LT GridSpacingMaterial 1 DICOM +(0018,7042) DS GridThickness 1 DICOM +(0018,7044) DS GridPitch 1 DICOM +(0018,7046) IS GridAspectRatio 2 DICOM +(0018,7048) DS GridPeriod 1 DICOM +(0018,704C) DS GridFocalDistance 1 DICOM +(0018,7050) CS FilterMaterial 1-n DICOM +(0018,7052) DS FilterThicknessMinimum 1-n DICOM +(0018,7054) DS FilterThicknessMaximum 1-n DICOM +(0018,7056) FL FilterBeamPathLengthMinimum 1-n DICOM +(0018,7058) FL FilterBeamPathLengthMaximum 1-n DICOM +(0018,7060) CS ExposureControlMode 1 DICOM +(0018,7062) LT ExposureControlModeDescription 1 DICOM +(0018,7064) CS ExposureStatus 1 DICOM +(0018,7065) DS PhototimerSetting 1 DICOM +(0018,8150) DS ExposureTimeInuS 1 DICOM +(0018,8151) DS XRayTubeCurrentInuA 1 DICOM +(0018,9004) CS ContentQualification 1 DICOM +(0018,9005) SH PulseSequenceName 1 DICOM +(0018,9006) SQ MRImagingModifierSequence 1 DICOM +(0018,9008) CS EchoPulseSequence 1 DICOM +(0018,9009) CS InversionRecovery 1 DICOM +(0018,9010) CS FlowCompensation 1 DICOM +(0018,9011) CS MultipleSpinEcho 1 DICOM +(0018,9012) CS MultiPlanarExcitation 1 DICOM +(0018,9014) CS PhaseContrast 1 DICOM +(0018,9015) CS TimeOfFlightContrast 1 DICOM +(0018,9016) CS Spoiling 1 DICOM +(0018,9017) CS SteadyStatePulseSequence 1 DICOM +(0018,9018) CS EchoPlanarPulseSequence 1 DICOM +(0018,9019) FD TagAngleFirstAxis 1 DICOM +(0018,9020) CS MagnetizationTransfer 1 DICOM +(0018,9021) CS T2Preparation 1 DICOM +(0018,9022) CS BloodSignalNulling 1 DICOM +(0018,9024) CS SaturationRecovery 1 DICOM +(0018,9025) CS SpectrallySelectedSuppression 1 DICOM +(0018,9026) CS SpectrallySelectedExcitation 1 DICOM +(0018,9027) CS SpatialPresaturation 1 DICOM +(0018,9028) CS Tagging 1 DICOM +(0018,9029) CS OversamplingPhase 1 DICOM +(0018,9030) FD TagSpacingFirstDimension 1 DICOM +(0018,9032) CS GeometryOfKSpaceTraversal 1 DICOM +(0018,9033) CS SegmentedKSpaceTraversal 1 DICOM +(0018,9034) CS RectilinearPhaseEncodeReordering 1 DICOM +(0018,9035) FD TagThickness 1 DICOM +(0018,9036) CS PartialFourierDirection 1 DICOM +(0018,9037) CS CardiacSynchronizationTechnique 1 DICOM +(0018,9041) LO ReceiveCoilManufacturerName 1 DICOM +(0018,9042) SQ MRReceiveCoilSequence 1 DICOM +(0018,9043) CS ReceiveCoilType 1 DICOM +(0018,9044) CS QuadratureReceiveCoil 1 DICOM +(0018,9045) SQ MultiCoilDefinitionSequence 1 DICOM +(0018,9046) LO MultiCoilConfiguration 1 DICOM +(0018,9047) SH MultiCoilElementName 1 DICOM +(0018,9048) CS MultiCoilElementUsed 1 DICOM +(0018,9049) SQ MRTransmitCoilSequence 1 DICOM +(0018,9050) LO TransmitCoilManufacturerName 1 DICOM +(0018,9051) CS TransmitCoilType 1 DICOM +(0018,9052) FD SpectralWidth 1-2 DICOM +(0018,9053) FD ChemicalShiftReference 1-2 DICOM +(0018,9054) CS VolumeLocalizationTechnique 1 DICOM +(0018,9058) US MRAcquisitionFrequencyEncodingSteps 1 DICOM +(0018,9059) CS Decoupling 1 DICOM +(0018,9060) CS DecoupledNucleus 1-2 DICOM +(0018,9061) FD DecouplingFrequency 1-2 DICOM +(0018,9062) CS DecouplingMethod 1 DICOM +(0018,9063) FD DecouplingChemicalShiftReference 1-2 DICOM +(0018,9064) CS KSpaceFiltering 1 DICOM +(0018,9065) CS TimeDomainFiltering 1-2 DICOM +(0018,9066) US NumberOfZeroFills 1-2 DICOM +(0018,9067) CS BaselineCorrection 1 DICOM +(0018,9069) FD ParallelReductionFactorInPlane 1 DICOM +(0018,9070) FD CardiacRRIntervalSpecified 1 DICOM +(0018,9073) FD AcquisitionDuration 1 DICOM +(0018,9074) DT FrameAcquisitionDateTime 1 DICOM +(0018,9075) CS DiffusionDirectionality 1 DICOM +(0018,9076) SQ DiffusionGradientDirectionSequence 1 DICOM +(0018,9077) CS ParallelAcquisition 1 DICOM +(0018,9078) CS ParallelAcquisitionTechnique 1 DICOM +(0018,9079) FD InversionTimes 1-n DICOM +(0018,9080) ST MetaboliteMapDescription 1 DICOM +(0018,9081) CS PartialFourier 1 DICOM +(0018,9082) FD EffectiveEchoTime 1 DICOM +(0018,9083) SQ MetaboliteMapCodeSequence 1 DICOM +(0018,9084) SQ ChemicalShiftSequence 1 DICOM +(0018,9085) CS CardiacSignalSource 1 DICOM +(0018,9087) FD DiffusionBValue 1 DICOM +(0018,9089) FD DiffusionGradientOrientation 3 DICOM +(0018,9090) FD VelocityEncodingDirection 3 DICOM +(0018,9091) FD VelocityEncodingMinimumValue 1 DICOM +(0018,9092) SQ VelocityEncodingAcquisitionSequence 1 DICOM +(0018,9093) US NumberOfKSpaceTrajectories 1 DICOM +(0018,9094) CS CoverageOfKSpace 1 DICOM +(0018,9095) UL SpectroscopyAcquisitionPhaseRows 1 DICOM +(0018,9098) FD TransmitterFrequency 1-2 DICOM +(0018,9100) CS ResonantNucleus 1-2 DICOM +(0018,9101) CS FrequencyCorrection 1 DICOM +(0018,9103) SQ MRSpectroscopyFOVGeometrySequence 1 DICOM +(0018,9104) FD SlabThickness 1 DICOM +(0018,9105) FD SlabOrientation 3 DICOM +(0018,9106) FD MidSlabPosition 3 DICOM +(0018,9107) SQ MRSpatialSaturationSequence 1 DICOM +(0018,9112) SQ MRTimingAndRelatedParametersSequence 1 DICOM +(0018,9114) SQ MREchoSequence 1 DICOM +(0018,9115) SQ MRModifierSequence 1 DICOM +(0018,9117) SQ MRDiffusionSequence 1 DICOM +(0018,9118) SQ CardiacSynchronizationSequence 1 DICOM +(0018,9119) SQ MRAveragesSequence 1 DICOM +(0018,9125) SQ MRFOVGeometrySequence 1 DICOM +(0018,9126) SQ VolumeLocalizationSequence 1 DICOM +(0018,9127) UL SpectroscopyAcquisitionDataColumns 1 DICOM +(0018,9147) CS DiffusionAnisotropyType 1 DICOM +(0018,9151) DT FrameReferenceDateTime 1 DICOM +(0018,9152) SQ MRMetaboliteMapSequence 1 DICOM +(0018,9155) FD ParallelReductionFactorOutOfPlane 1 DICOM +(0018,9159) UL SpectroscopyAcquisitionOutOfPlanePhaseSteps 1 DICOM +(0018,9168) FD ParallelReductionFactorSecondInPlane 1 DICOM +(0018,9169) CS CardiacBeatRejectionTechnique 1 DICOM +(0018,9170) CS RespiratoryMotionCompensationTechnique 1 DICOM +(0018,9171) CS RespiratorySignalSource 1 DICOM +(0018,9172) CS BulkMotionCompensationTechnique 1 DICOM +(0018,9173) CS BulkMotionSignalSource 1 DICOM +(0018,9174) CS ApplicableSafetyStandardAgency 1 DICOM +(0018,9175) LO ApplicableSafetyStandardDescription 1 DICOM +(0018,9176) SQ OperatingModeSequence 1 DICOM +(0018,9177) CS OperatingModeType 1 DICOM +(0018,9178) CS OperatingMode 1 DICOM +(0018,9179) CS SpecificAbsorptionRateDefinition 1 DICOM +(0018,9180) CS GradientOutputType 1 DICOM +(0018,9181) FD SpecificAbsorptionRateValue 1 DICOM +(0018,9182) FD GradientOutput 1 DICOM +(0018,9183) CS FlowCompensationDirection 1 DICOM +(0018,9184) FD TaggingDelay 1 DICOM +(0018,9185) ST RespiratoryMotionCompensationTechniqueDescription 1 DICOM +(0018,9186) SH RespiratorySignalSourceID 1 DICOM +(0018,9197) SQ MRVelocityEncodingSequence 1 DICOM +(0018,9198) CS FirstOrderPhaseCorrection 1 DICOM +(0018,9199) CS WaterReferencedPhaseCorrection 1 DICOM +(0018,9200) CS MRSpectroscopyAcquisitionType 1 DICOM +(0018,9214) CS RespiratoryCyclePosition 1 DICOM +(0018,9217) FD VelocityEncodingMaximumValue 1 DICOM +(0018,9218) FD TagSpacingSecondDimension 1 DICOM +(0018,9219) SS TagAngleSecondAxis 1 DICOM +(0018,9220) FD FrameAcquisitionDuration 1 DICOM +(0018,9226) SQ MRImageFrameTypeSequence 1 DICOM +(0018,9227) SQ MRSpectroscopyFrameTypeSequence 1 DICOM +(0018,9231) US MRAcquisitionPhaseEncodingStepsInPlane 1 DICOM +(0018,9232) US MRAcquisitionPhaseEncodingStepsOutOfPlane 1 DICOM +(0018,9234) UL SpectroscopyAcquisitionPhaseColumns 1 DICOM +(0018,9236) CS CardiacCyclePosition 1 DICOM +(0018,9239) SQ SpecificAbsorptionRateSequence 1 DICOM +(0018,9240) US RFEchoTrainLength 1 DICOM +(0018,9241) US GradientEchoTrainLength 1 DICOM +(0018,9250) CS ArterialSpinLabelingContrast 1 DICOM +(0018,9251) SQ MRArterialSpinLabelingSequence 1 DICOM +(0018,9252) LO ASLTechniqueDescription 1 DICOM +(0018,9253) US ASLSlabNumber 1 DICOM +(0018,9254) FD ASLSlabThickness 1 DICOM +(0018,9255) FD ASLSlabOrientation 3 DICOM +(0018,9256) FD ASLMidSlabPosition 3 DICOM +(0018,9257) CS ASLContext 1 DICOM +(0018,9258) UL ASLPulseTrainDuration 1 DICOM +(0018,9259) CS ASLCrusherFlag 1 DICOM +(0018,925A) FD ASLCrusherFlowLimit 1 DICOM +(0018,925B) LO ASLCrusherDescription 1 DICOM +(0018,925C) CS ASLBolusCutoffFlag 1 DICOM +(0018,925D) SQ ASLBolusCutoffTimingSequence 1 DICOM +(0018,925E) LO ASLBolusCutoffTechnique 1 DICOM +(0018,925F) UL ASLBolusCutoffDelayTime 1 DICOM +(0018,9260) SQ ASLSlabSequence 1 DICOM +(0018,9295) FD ChemicalShiftMinimumIntegrationLimitInppm 1 DICOM +(0018,9296) FD ChemicalShiftMaximumIntegrationLimitInppm 1 DICOM +(0018,9297) CS WaterReferenceAcquisition 1 DICOM +(0018,9298) IS EchoPeakPosition 1 DICOM +(0018,9301) SQ CTAcquisitionTypeSequence 1 DICOM +(0018,9302) CS AcquisitionType 1 DICOM +(0018,9303) FD TubeAngle 1 DICOM +(0018,9304) SQ CTAcquisitionDetailsSequence 1 DICOM +(0018,9305) FD RevolutionTime 1 DICOM +(0018,9306) FD SingleCollimationWidth 1 DICOM +(0018,9307) FD TotalCollimationWidth 1 DICOM +(0018,9308) SQ CTTableDynamicsSequence 1 DICOM +(0018,9309) FD TableSpeed 1 DICOM +(0018,9310) FD TableFeedPerRotation 1 DICOM +(0018,9311) FD SpiralPitchFactor 1 DICOM +(0018,9312) SQ CTGeometrySequence 1 DICOM +(0018,9313) FD DataCollectionCenterPatient 3 DICOM +(0018,9314) SQ CTReconstructionSequence 1 DICOM +(0018,9315) CS ReconstructionAlgorithm 1 DICOM +(0018,9316) CS ConvolutionKernelGroup 1 DICOM +(0018,9317) FD ReconstructionFieldOfView 2 DICOM +(0018,9318) FD ReconstructionTargetCenterPatient 3 DICOM +(0018,9319) FD ReconstructionAngle 1 DICOM +(0018,9320) SH ImageFilter 1 DICOM +(0018,9321) SQ CTExposureSequence 1 DICOM +(0018,9322) FD ReconstructionPixelSpacing 2 DICOM +(0018,9323) CS ExposureModulationType 1-n DICOM +(0018,9324) FD EstimatedDoseSaving 1 DICOM +(0018,9325) SQ CTXRayDetailsSequence 1 DICOM +(0018,9326) SQ CTPositionSequence 1 DICOM +(0018,9327) FD TablePosition 1 DICOM +(0018,9328) FD ExposureTimeInms 1 DICOM +(0018,9329) SQ CTImageFrameTypeSequence 1 DICOM +(0018,9330) FD XRayTubeCurrentInmA 1 DICOM +(0018,9332) FD ExposureInmAs 1 DICOM +(0018,9333) CS ConstantVolumeFlag 1 DICOM +(0018,9334) CS FluoroscopyFlag 1 DICOM +(0018,9335) FD DistanceSourceToDataCollectionCenter 1 DICOM +(0018,9337) US ContrastBolusAgentNumber 1 DICOM +(0018,9338) SQ ContrastBolusIngredientCodeSequence 1 DICOM +(0018,9340) SQ ContrastAdministrationProfileSequence 1 DICOM +(0018,9341) SQ ContrastBolusUsageSequence 1 DICOM +(0018,9342) CS ContrastBolusAgentAdministered 1 DICOM +(0018,9343) CS ContrastBolusAgentDetected 1 DICOM +(0018,9344) CS ContrastBolusAgentPhase 1 DICOM +(0018,9345) FD CTDIvol 1 DICOM +(0018,9346) SQ CTDIPhantomTypeCodeSequence 1 DICOM +(0018,9351) FL CalciumScoringMassFactorPatient 1 DICOM +(0018,9352) FL CalciumScoringMassFactorDevice 3 DICOM +(0018,9353) FL EnergyWeightingFactor 1 DICOM +(0018,9360) SQ CTAdditionalXRaySourceSequence 1 DICOM +(0018,9361) CS MultienergyCTAcquisition 1 DICOM +(0018,9362) SQ MultienergyCTAcquisitionSequence 1 DICOM +(0018,9363) SQ MultienergyCTProcessingSequence 1 DICOM +(0018,9364) SQ MultienergyCTCharacteristicsSequence 1 DICOM +(0018,9365) SQ MultienergyCTXRaySourceSequence 1 DICOM +(0018,9366) US XRaySourceIndex 1 DICOM +(0018,9367) UC XRaySourceID 1 DICOM +(0018,9368) CS MultienergySourceTechnique 1 DICOM +(0018,9369) DT SourceStartDateTime 1 DICOM +(0018,936A) DT SourceEndDateTime 1 DICOM +(0018,936B) US SwitchingPhaseNumber 1 DICOM +(0018,936C) DS SwitchingPhaseNominalDuration 1 DICOM +(0018,936D) DS SwitchingPhaseTransitionDuration 1 DICOM +(0018,936E) DS EffectiveBinEnergy 1 DICOM +(0018,936F) SQ MultienergyCTXRayDetectorSequence 1 DICOM +(0018,9370) US XRayDetectorIndex 1 DICOM +(0018,9371) UC XRayDetectorID 1 DICOM +(0018,9372) CS MultienergyDetectorType 1 DICOM +(0018,9373) ST XRayDetectorLabel 1 DICOM +(0018,9374) DS NominalMaxEnergy 1 DICOM +(0018,9375) DS NominalMinEnergy 1 DICOM +(0018,9376) US ReferencedXRayDetectorIndex 1-n DICOM +(0018,9377) US ReferencedXRaySourceIndex 1-n DICOM +(0018,9378) US ReferencedPathIndex 1-n DICOM +(0018,9379) SQ MultienergyCTPathSequence 1 DICOM +(0018,937A) US MultienergyCTPathIndex 1 DICOM +(0018,937B) UT MultienergyAcquisitionDescription 1 DICOM +(0018,937C) FD MonoenergeticEnergyEquivalent 1 DICOM +(0018,937D) SQ MaterialCodeSequence 1 DICOM +(0018,937E) CS DecompositionMethod 1 DICOM +(0018,937F) UT DecompositionDescription 1 DICOM +(0018,9380) SQ DecompositionAlgorithmIdentificationSequence 1 DICOM +(0018,9381) SQ DecompositionMaterialSequence 1 DICOM +(0018,9382) SQ MaterialAttenuationSequence 1 DICOM +(0018,9383) DS PhotonEnergy 1 DICOM +(0018,9384) DS XRayMassAttenuationCoefficient 1 DICOM +(0018,9401) SQ ProjectionPixelCalibrationSequence 1 DICOM +(0018,9402) FL DistanceSourceToIsocenter 1 DICOM +(0018,9403) FL DistanceObjectToTableTop 1 DICOM +(0018,9404) FL ObjectPixelSpacingInCenterOfBeam 2 DICOM +(0018,9405) SQ PositionerPositionSequence 1 DICOM +(0018,9406) SQ TablePositionSequence 1 DICOM +(0018,9407) SQ CollimatorShapeSequence 1 DICOM +(0018,9410) CS PlanesInAcquisition 1 DICOM +(0018,9412) SQ XAXRFFrameCharacteristicsSequence 1 DICOM +(0018,9417) SQ FrameAcquisitionSequence 1 DICOM +(0018,9420) CS XRayReceptorType 1 DICOM +(0018,9423) LO AcquisitionProtocolName 1 DICOM +(0018,9424) LT AcquisitionProtocolDescription 1 DICOM +(0018,9425) CS ContrastBolusIngredientOpaque 1 DICOM +(0018,9426) FL DistanceReceptorPlaneToDetectorHousing 1 DICOM +(0018,9427) CS IntensifierActiveShape 1 DICOM +(0018,9428) FL IntensifierActiveDimensions 1-2 DICOM +(0018,9429) FL PhysicalDetectorSize 2 DICOM +(0018,9430) FL PositionOfIsocenterProjection 2 DICOM +(0018,9432) SQ FieldOfViewSequence 1 DICOM +(0018,9433) LO FieldOfViewDescription 1 DICOM +(0018,9434) SQ ExposureControlSensingRegionsSequence 1 DICOM +(0018,9435) CS ExposureControlSensingRegionShape 1 DICOM +(0018,9436) SS ExposureControlSensingRegionLeftVerticalEdge 1 DICOM +(0018,9437) SS ExposureControlSensingRegionRightVerticalEdge 1 DICOM +(0018,9438) SS ExposureControlSensingRegionUpperHorizontalEdge 1 DICOM +(0018,9439) SS ExposureControlSensingRegionLowerHorizontalEdge 1 DICOM +(0018,9440) SS CenterOfCircularExposureControlSensingRegion 2 DICOM +(0018,9441) US RadiusOfCircularExposureControlSensingRegion 1 DICOM +(0018,9442) SS VerticesOfThePolygonalExposureControlSensingRegion 2-n DICOM +(0018,9447) FL ColumnAngulationPatient 1 DICOM +(0018,9449) FL BeamAngle 1 DICOM +(0018,9451) SQ FrameDetectorParametersSequence 1 DICOM +(0018,9452) FL CalculatedAnatomyThickness 1 DICOM +(0018,9455) SQ CalibrationSequence 1 DICOM +(0018,9456) SQ ObjectThicknessSequence 1 DICOM +(0018,9457) CS PlaneIdentification 1 DICOM +(0018,9461) FL FieldOfViewDimensionsInFloat 1-2 DICOM +(0018,9462) SQ IsocenterReferenceSystemSequence 1 DICOM +(0018,9463) FL PositionerIsocenterPrimaryAngle 1 DICOM +(0018,9464) FL PositionerIsocenterSecondaryAngle 1 DICOM +(0018,9465) FL PositionerIsocenterDetectorRotationAngle 1 DICOM +(0018,9466) FL TableXPositionToIsocenter 1 DICOM +(0018,9467) FL TableYPositionToIsocenter 1 DICOM +(0018,9468) FL TableZPositionToIsocenter 1 DICOM +(0018,9469) FL TableHorizontalRotationAngle 1 DICOM +(0018,9470) FL TableHeadTiltAngle 1 DICOM +(0018,9471) FL TableCradleTiltAngle 1 DICOM +(0018,9472) SQ FrameDisplayShutterSequence 1 DICOM +(0018,9473) FL AcquiredImageAreaDoseProduct 1 DICOM +(0018,9474) CS CArmPositionerTabletopRelationship 1 DICOM +(0018,9476) SQ XRayGeometrySequence 1 DICOM +(0018,9477) SQ IrradiationEventIdentificationSequence 1 DICOM +(0018,9504) SQ XRay3DFrameTypeSequence 1 DICOM +(0018,9506) SQ ContributingSourcesSequence 1 DICOM +(0018,9507) SQ XRay3DAcquisitionSequence 1 DICOM +(0018,9508) FL PrimaryPositionerScanArc 1 DICOM +(0018,9509) FL SecondaryPositionerScanArc 1 DICOM +(0018,9510) FL PrimaryPositionerScanStartAngle 1 DICOM +(0018,9511) FL SecondaryPositionerScanStartAngle 1 DICOM +(0018,9514) FL PrimaryPositionerIncrement 1 DICOM +(0018,9515) FL SecondaryPositionerIncrement 1 DICOM +(0018,9516) DT StartAcquisitionDateTime 1 DICOM +(0018,9517) DT EndAcquisitionDateTime 1 DICOM +(0018,9518) SS PrimaryPositionerIncrementSign 1 DICOM +(0018,9519) SS SecondaryPositionerIncrementSign 1 DICOM +(0018,9524) LO ApplicationName 1 DICOM +(0018,9525) LO ApplicationVersion 1 DICOM +(0018,9526) LO ApplicationManufacturer 1 DICOM +(0018,9527) CS AlgorithmType 1 DICOM +(0018,9528) LO AlgorithmDescription 1 DICOM +(0018,9530) SQ XRay3DReconstructionSequence 1 DICOM +(0018,9531) LO ReconstructionDescription 1 DICOM +(0018,9538) SQ PerProjectionAcquisitionSequence 1 DICOM +(0018,9541) SQ DetectorPositionSequence 1 DICOM +(0018,9542) SQ XRayAcquisitionDoseSequence 1 DICOM +(0018,9543) FD XRaySourceIsocenterPrimaryAngle 1 DICOM +(0018,9544) FD XRaySourceIsocenterSecondaryAngle 1 DICOM +(0018,9545) FD BreastSupportIsocenterPrimaryAngle 1 DICOM +(0018,9546) FD BreastSupportIsocenterSecondaryAngle 1 DICOM +(0018,9547) FD BreastSupportXPositionToIsocenter 1 DICOM +(0018,9548) FD BreastSupportYPositionToIsocenter 1 DICOM +(0018,9549) FD BreastSupportZPositionToIsocenter 1 DICOM +(0018,9550) FD DetectorIsocenterPrimaryAngle 1 DICOM +(0018,9551) FD DetectorIsocenterSecondaryAngle 1 DICOM +(0018,9552) FD DetectorXPositionToIsocenter 1 DICOM +(0018,9553) FD DetectorYPositionToIsocenter 1 DICOM +(0018,9554) FD DetectorZPositionToIsocenter 1 DICOM +(0018,9555) SQ XRayGridSequence 1 DICOM +(0018,9556) SQ XRayFilterSequence 1 DICOM +(0018,9557) FD DetectorActiveAreaTLHCPosition 3 DICOM +(0018,9558) FD DetectorActiveAreaOrientation 6 DICOM +(0018,9559) CS PositionerPrimaryAngleDirection 1 DICOM +(0018,9601) SQ DiffusionBMatrixSequence 1 DICOM +(0018,9602) FD DiffusionBValueXX 1 DICOM +(0018,9603) FD DiffusionBValueXY 1 DICOM +(0018,9604) FD DiffusionBValueXZ 1 DICOM +(0018,9605) FD DiffusionBValueYY 1 DICOM +(0018,9606) FD DiffusionBValueYZ 1 DICOM +(0018,9607) FD DiffusionBValueZZ 1 DICOM +(0018,9621) SQ FunctionalMRSequence 1 DICOM +(0018,9622) CS FunctionalSettlingPhaseFramesPresent 1 DICOM +(0018,9623) DT FunctionalSyncPulse 1 DICOM +(0018,9624) CS SettlingPhaseFrame 1 DICOM +(0018,9701) DT DecayCorrectionDateTime 1 DICOM +(0018,9715) FD StartDensityThreshold 1 DICOM +(0018,9716) FD StartRelativeDensityDifferenceThreshold 1 DICOM +(0018,9717) FD StartCardiacTriggerCountThreshold 1 DICOM +(0018,9718) FD StartRespiratoryTriggerCountThreshold 1 DICOM +(0018,9719) FD TerminationCountsThreshold 1 DICOM +(0018,9720) FD TerminationDensityThreshold 1 DICOM +(0018,9721) FD TerminationRelativeDensityThreshold 1 DICOM +(0018,9722) FD TerminationTimeThreshold 1 DICOM +(0018,9723) FD TerminationCardiacTriggerCountThreshold 1 DICOM +(0018,9724) FD TerminationRespiratoryTriggerCountThreshold 1 DICOM +(0018,9725) CS DetectorGeometry 1 DICOM +(0018,9726) FD TransverseDetectorSeparation 1 DICOM +(0018,9727) FD AxialDetectorDimension 1 DICOM +(0018,9729) US RadiopharmaceuticalAgentNumber 1 DICOM +(0018,9732) SQ PETFrameAcquisitionSequence 1 DICOM +(0018,9733) SQ PETDetectorMotionDetailsSequence 1 DICOM +(0018,9734) SQ PETTableDynamicsSequence 1 DICOM +(0018,9735) SQ PETPositionSequence 1 DICOM +(0018,9736) SQ PETFrameCorrectionFactorsSequence 1 DICOM +(0018,9737) SQ RadiopharmaceuticalUsageSequence 1 DICOM +(0018,9738) CS AttenuationCorrectionSource 1 DICOM +(0018,9739) US NumberOfIterations 1 DICOM +(0018,9740) US NumberOfSubsets 1 DICOM +(0018,9749) SQ PETReconstructionSequence 1 DICOM +(0018,9751) SQ PETFrameTypeSequence 1 DICOM +(0018,9755) CS TimeOfFlightInformationUsed 1 DICOM +(0018,9756) CS ReconstructionType 1 DICOM +(0018,9758) CS DecayCorrected 1 DICOM +(0018,9759) CS AttenuationCorrected 1 DICOM +(0018,9760) CS ScatterCorrected 1 DICOM +(0018,9761) CS DeadTimeCorrected 1 DICOM +(0018,9762) CS GantryMotionCorrected 1 DICOM +(0018,9763) CS PatientMotionCorrected 1 DICOM +(0018,9764) CS CountLossNormalizationCorrected 1 DICOM +(0018,9765) CS RandomsCorrected 1 DICOM +(0018,9766) CS NonUniformRadialSamplingCorrected 1 DICOM +(0018,9767) CS SensitivityCalibrated 1 DICOM +(0018,9768) CS DetectorNormalizationCorrection 1 DICOM +(0018,9769) CS IterativeReconstructionMethod 1 DICOM +(0018,9770) CS AttenuationCorrectionTemporalRelationship 1 DICOM +(0018,9771) SQ PatientPhysiologicalStateSequence 1 DICOM +(0018,9772) SQ PatientPhysiologicalStateCodeSequence 1 DICOM +(0018,9801) FD DepthsOfFocus 1-n DICOM +(0018,9803) SQ ExcludedIntervalsSequence 1 DICOM +(0018,9804) DT ExclusionStartDateTime 1 DICOM +(0018,9805) FD ExclusionDuration 1 DICOM +(0018,9806) SQ USImageDescriptionSequence 1 DICOM +(0018,9807) SQ ImageDataTypeSequence 1 DICOM +(0018,9808) CS DataType 1 DICOM +(0018,9809) SQ TransducerScanPatternCodeSequence 1 DICOM +(0018,980B) CS AliasedDataType 1 DICOM +(0018,980C) CS PositionMeasuringDeviceUsed 1 DICOM +(0018,980D) SQ TransducerGeometryCodeSequence 1 DICOM +(0018,980E) SQ TransducerBeamSteeringCodeSequence 1 DICOM +(0018,980F) SQ TransducerApplicationCodeSequence 1 DICOM +(0018,9810) xs ZeroVelocityPixelValue 1 DICOM +(0018,9900) LO ReferenceLocationLabel 1 DICOM +(0018,9901) UT ReferenceLocationDescription 1 DICOM +(0018,9902) SQ ReferenceBasisCodeSequence 1 DICOM +(0018,9903) SQ ReferenceGeometryCodeSequence 1 DICOM +(0018,9904) DS OffsetDistance 1 DICOM +(0018,9905) CS OffsetDirection 1 DICOM +(0018,9906) SQ PotentialScheduledProtocolCodeSequence 1 DICOM +(0018,9907) SQ PotentialRequestedProcedureCodeSequence 1 DICOM +(0018,9908) UC PotentialReasonsForProcedure 1-n DICOM +(0018,9909) SQ PotentialReasonsForProcedureCodeSequence 1 DICOM +(0018,990A) UC PotentialDiagnosticTasks 1-n DICOM +(0018,990B) SQ ContraindicationsCodeSequence 1 DICOM +(0018,990C) SQ ReferencedDefinedProtocolSequence 1 DICOM +(0018,990D) SQ ReferencedPerformedProtocolSequence 1 DICOM +(0018,990E) SQ PredecessorProtocolSequence 1 DICOM +(0018,990F) UT ProtocolPlanningInformation 1 DICOM +(0018,9910) UT ProtocolDesignRationale 1 DICOM +(0018,9911) SQ PatientSpecificationSequence 1 DICOM +(0018,9912) SQ ModelSpecificationSequence 1 DICOM +(0018,9913) SQ ParametersSpecificationSequence 1 DICOM +(0018,9914) SQ InstructionSequence 1 DICOM +(0018,9915) US InstructionIndex 1 DICOM +(0018,9916) LO InstructionText 1 DICOM +(0018,9917) UT InstructionDescription 1 DICOM +(0018,9918) CS InstructionPerformedFlag 1 DICOM +(0018,9919) DT InstructionPerformedDateTime 1 DICOM +(0018,991A) UT InstructionPerformanceComment 1 DICOM +(0018,991B) SQ PatientPositioningInstructionSequence 1 DICOM +(0018,991C) SQ PositioningMethodCodeSequence 1 DICOM +(0018,991D) SQ PositioningLandmarkSequence 1 DICOM +(0018,991E) UI TargetFrameOfReferenceUID 1 DICOM +(0018,991F) SQ AcquisitionProtocolElementSpecificationSequence 1 DICOM +(0018,9920) SQ AcquisitionProtocolElementSequence 1 DICOM +(0018,9921) US ProtocolElementNumber 1 DICOM +(0018,9922) LO ProtocolElementName 1 DICOM +(0018,9923) UT ProtocolElementCharacteristicsSummary 1 DICOM +(0018,9924) UT ProtocolElementPurpose 1 DICOM +(0018,9930) CS AcquisitionMotion 1 DICOM +(0018,9931) SQ AcquisitionStartLocationSequence 1 DICOM +(0018,9932) SQ AcquisitionEndLocationSequence 1 DICOM +(0018,9933) SQ ReconstructionProtocolElementSpecificationSequence 1 DICOM +(0018,9934) SQ ReconstructionProtocolElementSequence 1 DICOM +(0018,9935) SQ StorageProtocolElementSpecificationSequence 1 DICOM +(0018,9936) SQ StorageProtocolElementSequence 1 DICOM +(0018,9937) LO RequestedSeriesDescription 1 DICOM +(0018,9938) US SourceAcquisitionProtocolElementNumber 1-n DICOM +(0018,9939) US SourceAcquisitionBeamNumber 1-n DICOM +(0018,993A) US SourceReconstructionProtocolElementNumber 1-n DICOM +(0018,993B) SQ ReconstructionStartLocationSequence 1 DICOM +(0018,993C) SQ ReconstructionEndLocationSequence 1 DICOM +(0018,993D) SQ ReconstructionAlgorithmSequence 1 DICOM +(0018,993E) SQ ReconstructionTargetCenterLocationSequence 1 DICOM +(0018,9941) UT ImageFilterDescription 1 DICOM +(0018,9942) FD CTDIvolNotificationTrigger 1 DICOM +(0018,9943) FD DLPNotificationTrigger 1 DICOM +(0018,9944) CS AutoKVPSelectionType 1 DICOM +(0018,9945) FD AutoKVPUpperBound 1 DICOM +(0018,9946) FD AutoKVPLowerBound 1 DICOM +(0018,9947) CS ProtocolDefinedPatientPosition 1 DICOM +(0018,A001) SQ ContributingEquipmentSequence 1 DICOM +(0018,A002) DT ContributionDateTime 1 DICOM +(0018,A003) ST ContributionDescription 1 DICOM +(0020,000D) UI StudyInstanceUID 1 DICOM +(0020,000E) UI SeriesInstanceUID 1 DICOM +(0020,0010) SH StudyID 1 DICOM +(0020,0011) IS SeriesNumber 1 DICOM +(0020,0012) IS AcquisitionNumber 1 DICOM +(0020,0013) IS InstanceNumber 1 DICOM +(0020,0019) IS ItemNumber 1 DICOM +(0020,0020) CS PatientOrientation 2 DICOM +(0020,0032) DS ImagePositionPatient 3 DICOM +(0020,0037) DS ImageOrientationPatient 6 DICOM +(0020,0052) UI FrameOfReferenceUID 1 DICOM +(0020,0060) CS Laterality 1 DICOM +(0020,0062) CS ImageLaterality 1 DICOM +(0020,0100) IS TemporalPositionIdentifier 1 DICOM +(0020,0105) IS NumberOfTemporalPositions 1 DICOM +(0020,0110) DS TemporalResolution 1 DICOM +(0020,0200) UI SynchronizationFrameOfReferenceUID 1 DICOM +(0020,0242) UI SOPInstanceUIDOfConcatenationSource 1 DICOM +(0020,1002) IS ImagesInAcquisition 1 DICOM +(0020,103F) LO TargetPositionReferenceIndicator 1 DICOM +(0020,1040) LO PositionReferenceIndicator 1 DICOM +(0020,1041) DS SliceLocation 1 DICOM +(0020,1200) IS NumberOfPatientRelatedStudies 1 DICOM +(0020,1202) IS NumberOfPatientRelatedSeries 1 DICOM +(0020,1204) IS NumberOfPatientRelatedInstances 1 DICOM +(0020,1206) IS NumberOfStudyRelatedSeries 1 DICOM +(0020,1208) IS NumberOfStudyRelatedInstances 1 DICOM +(0020,1209) IS NumberOfSeriesRelatedInstances 1 DICOM +(0020,4000) LT ImageComments 1 DICOM +(0020,9056) SH StackID 1 DICOM +(0020,9057) UL InStackPositionNumber 1 DICOM +(0020,9071) SQ FrameAnatomySequence 1 DICOM +(0020,9072) CS FrameLaterality 1 DICOM +(0020,9111) SQ FrameContentSequence 1 DICOM +(0020,9113) SQ PlanePositionSequence 1 DICOM +(0020,9116) SQ PlaneOrientationSequence 1 DICOM +(0020,9128) UL TemporalPositionIndex 1 DICOM +(0020,9153) FD NominalCardiacTriggerDelayTime 1 DICOM +(0020,9154) FL NominalCardiacTriggerTimePriorToRPeak 1 DICOM +(0020,9155) FL ActualCardiacTriggerTimePriorToRPeak 1 DICOM +(0020,9156) US FrameAcquisitionNumber 1 DICOM +(0020,9157) UL DimensionIndexValues 1-n DICOM +(0020,9158) LT FrameComments 1 DICOM +(0020,9161) UI ConcatenationUID 1 DICOM +(0020,9162) US InConcatenationNumber 1 DICOM +(0020,9163) US InConcatenationTotalNumber 1 DICOM +(0020,9164) UI DimensionOrganizationUID 1 DICOM +(0020,9165) AT DimensionIndexPointer 1 DICOM +(0020,9167) AT FunctionalGroupPointer 1 DICOM +(0020,9170) SQ UnassignedSharedConvertedAttributesSequence 1 DICOM +(0020,9171) SQ UnassignedPerFrameConvertedAttributesSequence 1 DICOM +(0020,9172) SQ ConversionSourceAttributesSequence 1 DICOM +(0020,9213) LO DimensionIndexPrivateCreator 1 DICOM +(0020,9221) SQ DimensionOrganizationSequence 1 DICOM +(0020,9222) SQ DimensionIndexSequence 1 DICOM +(0020,9228) UL ConcatenationFrameOffsetNumber 1 DICOM +(0020,9238) LO FunctionalGroupPrivateCreator 1 DICOM +(0020,9241) FL NominalPercentageOfCardiacPhase 1 DICOM +(0020,9245) FL NominalPercentageOfRespiratoryPhase 1 DICOM +(0020,9246) FL StartingRespiratoryAmplitude 1 DICOM +(0020,9247) CS StartingRespiratoryPhase 1 DICOM +(0020,9248) FL EndingRespiratoryAmplitude 1 DICOM +(0020,9249) CS EndingRespiratoryPhase 1 DICOM +(0020,9250) CS RespiratoryTriggerType 1 DICOM +(0020,9251) FD RRIntervalTimeNominal 1 DICOM +(0020,9252) FD ActualCardiacTriggerDelayTime 1 DICOM +(0020,9253) SQ RespiratorySynchronizationSequence 1 DICOM +(0020,9254) FD RespiratoryIntervalTime 1 DICOM +(0020,9255) FD NominalRespiratoryTriggerDelayTime 1 DICOM +(0020,9256) FD RespiratoryTriggerDelayThreshold 1 DICOM +(0020,9257) FD ActualRespiratoryTriggerDelayTime 1 DICOM +(0020,9301) FD ImagePositionVolume 3 DICOM +(0020,9302) FD ImageOrientationVolume 6 DICOM +(0020,9307) CS UltrasoundAcquisitionGeometry 1 DICOM +(0020,9308) FD ApexPosition 3 DICOM +(0020,9309) FD VolumeToTransducerMappingMatrix 16 DICOM +(0020,930A) FD VolumeToTableMappingMatrix 16 DICOM +(0020,930B) CS VolumeToTransducerRelationship 1 DICOM +(0020,930C) CS PatientFrameOfReferenceSource 1 DICOM +(0020,930D) FD TemporalPositionTimeOffset 1 DICOM +(0020,930E) SQ PlanePositionVolumeSequence 1 DICOM +(0020,930F) SQ PlaneOrientationVolumeSequence 1 DICOM +(0020,9310) SQ TemporalPositionSequence 1 DICOM +(0020,9311) CS DimensionOrganizationType 1 DICOM +(0020,9312) UI VolumeFrameOfReferenceUID 1 DICOM +(0020,9313) UI TableFrameOfReferenceUID 1 DICOM +(0020,9421) LO DimensionDescriptionLabel 1 DICOM +(0020,9450) SQ PatientOrientationInFrameSequence 1 DICOM +(0020,9453) LO FrameLabel 1 DICOM +(0020,9518) US AcquisitionIndex 1-n DICOM +(0020,9529) SQ ContributingSOPInstancesReferenceSequence 1 DICOM +(0020,9536) US ReconstructionIndex 1 DICOM +(0022,0001) US LightPathFilterPassThroughWavelength 1 DICOM +(0022,0002) US LightPathFilterPassBand 2 DICOM +(0022,0003) US ImagePathFilterPassThroughWavelength 1 DICOM +(0022,0004) US ImagePathFilterPassBand 2 DICOM +(0022,0005) CS PatientEyeMovementCommanded 1 DICOM +(0022,0006) SQ PatientEyeMovementCommandCodeSequence 1 DICOM +(0022,0007) FL SphericalLensPower 1 DICOM +(0022,0008) FL CylinderLensPower 1 DICOM +(0022,0009) FL CylinderAxis 1 DICOM +(0022,000A) FL EmmetropicMagnification 1 DICOM +(0022,000B) FL IntraOcularPressure 1 DICOM +(0022,000C) FL HorizontalFieldOfView 1 DICOM +(0022,000D) CS PupilDilated 1 DICOM +(0022,000E) FL DegreeOfDilation 1 DICOM +(0022,0010) FL StereoBaselineAngle 1 DICOM +(0022,0011) FL StereoBaselineDisplacement 1 DICOM +(0022,0012) FL StereoHorizontalPixelOffset 1 DICOM +(0022,0013) FL StereoVerticalPixelOffset 1 DICOM +(0022,0014) FL StereoRotation 1 DICOM +(0022,0015) SQ AcquisitionDeviceTypeCodeSequence 1 DICOM +(0022,0016) SQ IlluminationTypeCodeSequence 1 DICOM +(0022,0017) SQ LightPathFilterTypeStackCodeSequence 1 DICOM +(0022,0018) SQ ImagePathFilterTypeStackCodeSequence 1 DICOM +(0022,0019) SQ LensesCodeSequence 1 DICOM +(0022,001A) SQ ChannelDescriptionCodeSequence 1 DICOM +(0022,001B) SQ RefractiveStateSequence 1 DICOM +(0022,001C) SQ MydriaticAgentCodeSequence 1 DICOM +(0022,001D) SQ RelativeImagePositionCodeSequence 1 DICOM +(0022,001E) FL CameraAngleOfView 1 DICOM +(0022,0020) SQ StereoPairsSequence 1 DICOM +(0022,0021) SQ LeftImageSequence 1 DICOM +(0022,0022) SQ RightImageSequence 1 DICOM +(0022,0028) CS StereoPairsPresent 1 DICOM +(0022,0030) FL AxialLengthOfTheEye 1 DICOM +(0022,0031) SQ OphthalmicFrameLocationSequence 1 DICOM +(0022,0032) FL ReferenceCoordinates 2-2n DICOM +(0022,0035) FL DepthSpatialResolution 1 DICOM +(0022,0036) FL MaximumDepthDistortion 1 DICOM +(0022,0037) FL AlongScanSpatialResolution 1 DICOM +(0022,0038) FL MaximumAlongScanDistortion 1 DICOM +(0022,0039) CS OphthalmicImageOrientation 1 DICOM +(0022,0041) FL DepthOfTransverseImage 1 DICOM +(0022,0042) SQ MydriaticAgentConcentrationUnitsSequence 1 DICOM +(0022,0048) FL AcrossScanSpatialResolution 1 DICOM +(0022,0049) FL MaximumAcrossScanDistortion 1 DICOM +(0022,004E) DS MydriaticAgentConcentration 1 DICOM +(0022,0055) FL IlluminationWaveLength 1 DICOM +(0022,0056) FL IlluminationPower 1 DICOM +(0022,0057) FL IlluminationBandwidth 1 DICOM +(0022,0058) SQ MydriaticAgentSequence 1 DICOM +(0022,1007) SQ OphthalmicAxialMeasurementsRightEyeSequence 1 DICOM +(0022,1008) SQ OphthalmicAxialMeasurementsLeftEyeSequence 1 DICOM +(0022,1009) CS OphthalmicAxialMeasurementsDeviceType 1 DICOM +(0022,1010) CS OphthalmicAxialLengthMeasurementsType 1 DICOM +(0022,1012) SQ OphthalmicAxialLengthSequence 1 DICOM +(0022,1019) FL OphthalmicAxialLength 1 DICOM +(0022,1024) SQ LensStatusCodeSequence 1 DICOM +(0022,1025) SQ VitreousStatusCodeSequence 1 DICOM +(0022,1028) SQ IOLFormulaCodeSequence 1 DICOM +(0022,1029) LO IOLFormulaDetail 1 DICOM +(0022,1033) FL KeratometerIndex 1 DICOM +(0022,1035) SQ SourceOfOphthalmicAxialLengthCodeSequence 1 DICOM +(0022,1036) SQ SourceOfCornealSizeDataCodeSequence 1 DICOM +(0022,1037) FL TargetRefraction 1 DICOM +(0022,1039) CS RefractiveProcedureOccurred 1 DICOM +(0022,1040) SQ RefractiveSurgeryTypeCodeSequence 1 DICOM +(0022,1044) SQ OphthalmicUltrasoundMethodCodeSequence 1 DICOM +(0022,1045) SQ SurgicallyInducedAstigmatismSequence 1 DICOM +(0022,1046) CS TypeOfOpticalCorrection 1 DICOM +(0022,1047) SQ ToricIOLPowerSequence 1 DICOM +(0022,1048) SQ PredictedToricErrorSequence 1 DICOM +(0022,1049) CS PreSelectedForImplantation 1 DICOM +(0022,104A) SQ ToricIOLPowerForExactEmmetropiaSequence 1 DICOM +(0022,104B) SQ ToricIOLPowerForExactTargetRefractionSequence 1 DICOM +(0022,1050) SQ OphthalmicAxialLengthMeasurementsSequence 1 DICOM +(0022,1053) FL IOLPower 1 DICOM +(0022,1054) FL PredictedRefractiveError 1 DICOM +(0022,1059) FL OphthalmicAxialLengthVelocity 1 DICOM +(0022,1065) LO LensStatusDescription 1 DICOM +(0022,1066) LO VitreousStatusDescription 1 DICOM +(0022,1090) SQ IOLPowerSequence 1 DICOM +(0022,1092) SQ LensConstantSequence 1 DICOM +(0022,1093) LO IOLManufacturer 1 DICOM +(0022,1095) LO ImplantName 1 DICOM +(0022,1096) SQ KeratometryMeasurementTypeCodeSequence 1 DICOM +(0022,1097) LO ImplantPartNumber 1 DICOM +(0022,1100) SQ ReferencedOphthalmicAxialMeasurementsSequence 1 DICOM +(0022,1101) SQ OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence 1 DICOM +(0022,1103) SQ RefractiveErrorBeforeRefractiveSurgeryCodeSequence 1 DICOM +(0022,1121) FL IOLPowerForExactEmmetropia 1 DICOM +(0022,1122) FL IOLPowerForExactTargetRefraction 1 DICOM +(0022,1125) SQ AnteriorChamberDepthDefinitionCodeSequence 1 DICOM +(0022,1127) SQ LensThicknessSequence 1 DICOM +(0022,1128) SQ AnteriorChamberDepthSequence 1 DICOM +(0022,112A) SQ CalculationCommentSequence 1 DICOM +(0022,112B) CS CalculationCommentType 1 DICOM +(0022,112C) LT CalculationComment 1 DICOM +(0022,1130) FL LensThickness 1 DICOM +(0022,1131) FL AnteriorChamberDepth 1 DICOM +(0022,1132) SQ SourceOfLensThicknessDataCodeSequence 1 DICOM +(0022,1133) SQ SourceOfAnteriorChamberDepthDataCodeSequence 1 DICOM +(0022,1134) SQ SourceOfRefractiveMeasurementsSequence 1 DICOM +(0022,1135) SQ SourceOfRefractiveMeasurementsCodeSequence 1 DICOM +(0022,1140) CS OphthalmicAxialLengthMeasurementModified 1 DICOM +(0022,1150) SQ OphthalmicAxialLengthDataSourceCodeSequence 1 DICOM +(0022,1155) FL SignalToNoiseRatio 1 DICOM +(0022,1159) LO OphthalmicAxialLengthDataSourceDescription 1 DICOM +(0022,1210) SQ OphthalmicAxialLengthMeasurementsTotalLengthSequence 1 DICOM +(0022,1211) SQ OphthalmicAxialLengthMeasurementsSegmentalLengthSequence 1 DICOM +(0022,1212) SQ OphthalmicAxialLengthMeasurementsLengthSummationSequence 1 DICOM +(0022,1220) SQ UltrasoundOphthalmicAxialLengthMeasurementsSequence 1 DICOM +(0022,1225) SQ OpticalOphthalmicAxialLengthMeasurementsSequence 1 DICOM +(0022,1230) SQ UltrasoundSelectedOphthalmicAxialLengthSequence 1 DICOM +(0022,1250) SQ OphthalmicAxialLengthSelectionMethodCodeSequence 1 DICOM +(0022,1255) SQ OpticalSelectedOphthalmicAxialLengthSequence 1 DICOM +(0022,1257) SQ SelectedSegmentalOphthalmicAxialLengthSequence 1 DICOM +(0022,1260) SQ SelectedTotalOphthalmicAxialLengthSequence 1 DICOM +(0022,1262) SQ OphthalmicAxialLengthQualityMetricSequence 1 DICOM +(0022,1300) SQ IntraocularLensCalculationsRightEyeSequence 1 DICOM +(0022,1310) SQ IntraocularLensCalculationsLeftEyeSequence 1 DICOM +(0022,1330) SQ ReferencedOphthalmicAxialLengthMeasurementQCImageSequence 1 DICOM +(0022,1415) CS OphthalmicMappingDeviceType 1 DICOM +(0022,1420) SQ AcquisitionMethodCodeSequence 1 DICOM +(0022,1423) SQ AcquisitionMethodAlgorithmSequence 1 DICOM +(0022,1436) SQ OphthalmicThicknessMapTypeCodeSequence 1 DICOM +(0022,1443) SQ OphthalmicThicknessMappingNormalsSequence 1 DICOM +(0022,1445) SQ RetinalThicknessDefinitionCodeSequence 1 DICOM +(0022,1450) SQ PixelValueMappingToCodedConceptSequence 1 DICOM +(0022,1452) xs MappedPixelValue 1 DICOM +(0022,1454) LO PixelValueMappingExplanation 1 DICOM +(0022,1458) SQ OphthalmicThicknessMapQualityThresholdSequence 1 DICOM +(0022,1460) FL OphthalmicThicknessMapThresholdQualityRating 1 DICOM +(0022,1463) FL AnatomicStructureReferencePoint 2 DICOM +(0022,1465) SQ RegistrationToLocalizerSequence 1 DICOM +(0022,1466) CS RegisteredLocalizerUnits 1 DICOM +(0022,1467) FL RegisteredLocalizerTopLeftHandCorner 2 DICOM +(0022,1468) FL RegisteredLocalizerBottomRightHandCorner 2 DICOM +(0022,1470) SQ OphthalmicThicknessMapQualityRatingSequence 1 DICOM +(0022,1472) SQ RelevantOPTAttributesSequence 1 DICOM +(0022,1512) SQ TransformationMethodCodeSequence 1 DICOM +(0022,1513) SQ TransformationAlgorithmSequence 1 DICOM +(0022,1515) CS OphthalmicAxialLengthMethod 1 DICOM +(0022,1517) FL OphthalmicFOV 1 DICOM +(0022,1518) SQ TwoDimensionalToThreeDimensionalMapSequence 1 DICOM +(0022,1525) SQ WideFieldOphthalmicPhotographyQualityRatingSequence 1 DICOM +(0022,1526) SQ WideFieldOphthalmicPhotographyQualityThresholdSequence 1 DICOM +(0022,1527) FL WideFieldOphthalmicPhotographyThresholdQualityRating 1 DICOM +(0022,1528) FL XCoordinatesCenterPixelViewAngle 1 DICOM +(0022,1529) FL YCoordinatesCenterPixelViewAngle 1 DICOM +(0022,1530) UL NumberOfMapPoints 1 DICOM +(0022,1531) OF TwoDimensionalToThreeDimensionalMapData 1 DICOM +(0022,1612) SQ DerivationAlgorithmSequence 1 DICOM +(0022,1615) SQ OphthalmicImageTypeCodeSequence 1 DICOM +(0022,1616) LO OphthalmicImageTypeDescription 1 DICOM +(0022,1618) SQ ScanPatternTypeCodeSequence 1 DICOM +(0022,1620) SQ ReferencedSurfaceMeshIdentificationSequence 1 DICOM +(0022,1622) CS OphthalmicVolumetricPropertiesFlag 1 DICOM +(0022,1624) FL OphthalmicAnatomicReferencePointXCoordinate 1 DICOM +(0022,1626) FL OphthalmicAnatomicReferencePointYCoordinate 1 DICOM +(0022,1628) SQ OphthalmicEnFaceImageQualityRatingSequence 1 DICOM +(0022,1630) DS QualityThreshold 1 DICOM +(0022,1640) SQ OCTBscanAnalysisAcquisitionParametersSequence 1 DICOM +(0022,1642) UL NumberofBscansPerFrame 1 DICOM +(0022,1643) FL BscanSlabThickness 1 DICOM +(0022,1644) FL DistanceBetweenBscanSlabs 1 DICOM +(0022,1645) FL BscanCycleTime 1 DICOM +(0022,1646) FL BscanCycleTimeVector 1-n DICOM +(0022,1649) FL AscanRate 1 DICOM +(0022,1650) FL BscanRate 1 DICOM +(0022,1658) UL SurfaceMeshZPixelOffset 1 DICOM +(0024,0010) FL VisualFieldHorizontalExtent 1 DICOM +(0024,0011) FL VisualFieldVerticalExtent 1 DICOM +(0024,0012) CS VisualFieldShape 1 DICOM +(0024,0016) SQ ScreeningTestModeCodeSequence 1 DICOM +(0024,0018) FL MaximumStimulusLuminance 1 DICOM +(0024,0020) FL BackgroundLuminance 1 DICOM +(0024,0021) SQ StimulusColorCodeSequence 1 DICOM +(0024,0024) SQ BackgroundIlluminationColorCodeSequence 1 DICOM +(0024,0025) FL StimulusArea 1 DICOM +(0024,0028) FL StimulusPresentationTime 1 DICOM +(0024,0032) SQ FixationSequence 1 DICOM +(0024,0033) SQ FixationMonitoringCodeSequence 1 DICOM +(0024,0034) SQ VisualFieldCatchTrialSequence 1 DICOM +(0024,0035) US FixationCheckedQuantity 1 DICOM +(0024,0036) US PatientNotProperlyFixatedQuantity 1 DICOM +(0024,0037) CS PresentedVisualStimuliDataFlag 1 DICOM +(0024,0038) US NumberOfVisualStimuli 1 DICOM +(0024,0039) CS ExcessiveFixationLossesDataFlag 1 DICOM +(0024,0040) CS ExcessiveFixationLosses 1 DICOM +(0024,0042) US StimuliRetestingQuantity 1 DICOM +(0024,0044) LT CommentsOnPatientPerformanceOfVisualField 1 DICOM +(0024,0045) CS FalseNegativesEstimateFlag 1 DICOM +(0024,0046) FL FalseNegativesEstimate 1 DICOM +(0024,0048) US NegativeCatchTrialsQuantity 1 DICOM +(0024,0050) US FalseNegativesQuantity 1 DICOM +(0024,0051) CS ExcessiveFalseNegativesDataFlag 1 DICOM +(0024,0052) CS ExcessiveFalseNegatives 1 DICOM +(0024,0053) CS FalsePositivesEstimateFlag 1 DICOM +(0024,0054) FL FalsePositivesEstimate 1 DICOM +(0024,0055) CS CatchTrialsDataFlag 1 DICOM +(0024,0056) US PositiveCatchTrialsQuantity 1 DICOM +(0024,0057) CS TestPointNormalsDataFlag 1 DICOM +(0024,0058) SQ TestPointNormalsSequence 1 DICOM +(0024,0059) CS GlobalDeviationProbabilityNormalsFlag 1 DICOM +(0024,0060) US FalsePositivesQuantity 1 DICOM +(0024,0061) CS ExcessiveFalsePositivesDataFlag 1 DICOM +(0024,0062) CS ExcessiveFalsePositives 1 DICOM +(0024,0063) CS VisualFieldTestNormalsFlag 1 DICOM +(0024,0064) SQ ResultsNormalsSequence 1 DICOM +(0024,0065) SQ AgeCorrectedSensitivityDeviationAlgorithmSequence 1 DICOM +(0024,0066) FL GlobalDeviationFromNormal 1 DICOM +(0024,0067) SQ GeneralizedDefectSensitivityDeviationAlgorithmSequence 1 DICOM +(0024,0068) FL LocalizedDeviationFromNormal 1 DICOM +(0024,0069) LO PatientReliabilityIndicator 1 DICOM +(0024,0070) FL VisualFieldMeanSensitivity 1 DICOM +(0024,0071) FL GlobalDeviationProbability 1 DICOM +(0024,0072) CS LocalDeviationProbabilityNormalsFlag 1 DICOM +(0024,0073) FL LocalizedDeviationProbability 1 DICOM +(0024,0074) CS ShortTermFluctuationCalculated 1 DICOM +(0024,0075) FL ShortTermFluctuation 1 DICOM +(0024,0076) CS ShortTermFluctuationProbabilityCalculated 1 DICOM +(0024,0077) FL ShortTermFluctuationProbability 1 DICOM +(0024,0078) CS CorrectedLocalizedDeviationFromNormalCalculated 1 DICOM +(0024,0079) FL CorrectedLocalizedDeviationFromNormal 1 DICOM +(0024,0080) CS CorrectedLocalizedDeviationFromNormalProbabilityCalculated 1 DICOM +(0024,0081) FL CorrectedLocalizedDeviationFromNormalProbability 1 DICOM +(0024,0083) SQ GlobalDeviationProbabilitySequence 1 DICOM +(0024,0085) SQ LocalizedDeviationProbabilitySequence 1 DICOM +(0024,0086) CS FovealSensitivityMeasured 1 DICOM +(0024,0087) FL FovealSensitivity 1 DICOM +(0024,0088) FL VisualFieldTestDuration 1 DICOM +(0024,0089) SQ VisualFieldTestPointSequence 1 DICOM +(0024,0090) FL VisualFieldTestPointXCoordinate 1 DICOM +(0024,0091) FL VisualFieldTestPointYCoordinate 1 DICOM +(0024,0092) FL AgeCorrectedSensitivityDeviationValue 1 DICOM +(0024,0093) CS StimulusResults 1 DICOM +(0024,0094) FL SensitivityValue 1 DICOM +(0024,0095) CS RetestStimulusSeen 1 DICOM +(0024,0096) FL RetestSensitivityValue 1 DICOM +(0024,0097) SQ VisualFieldTestPointNormalsSequence 1 DICOM +(0024,0098) FL QuantifiedDefect 1 DICOM +(0024,0100) FL AgeCorrectedSensitivityDeviationProbabilityValue 1 DICOM +(0024,0102) CS GeneralizedDefectCorrectedSensitivityDeviationFlag 1 DICOM +(0024,0103) FL GeneralizedDefectCorrectedSensitivityDeviationValue 1 DICOM +(0024,0104) FL GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue 1 DICOM +(0024,0105) FL MinimumSensitivityValue 1 DICOM +(0024,0106) CS BlindSpotLocalized 1 DICOM +(0024,0107) FL BlindSpotXCoordinate 1 DICOM +(0024,0108) FL BlindSpotYCoordinate 1 DICOM +(0024,0110) SQ VisualAcuityMeasurementSequence 1 DICOM +(0024,0112) SQ RefractiveParametersUsedOnPatientSequence 1 DICOM +(0024,0113) CS MeasurementLaterality 1 DICOM +(0024,0114) SQ OphthalmicPatientClinicalInformationLeftEyeSequence 1 DICOM +(0024,0115) SQ OphthalmicPatientClinicalInformationRightEyeSequence 1 DICOM +(0024,0117) CS FovealPointNormativeDataFlag 1 DICOM +(0024,0118) FL FovealPointProbabilityValue 1 DICOM +(0024,0120) CS ScreeningBaselineMeasured 1 DICOM +(0024,0122) SQ ScreeningBaselineMeasuredSequence 1 DICOM +(0024,0124) CS ScreeningBaselineType 1 DICOM +(0024,0126) FL ScreeningBaselineValue 1 DICOM +(0024,0202) LO AlgorithmSource 1 DICOM +(0024,0306) LO DataSetName 1 DICOM +(0024,0307) LO DataSetVersion 1 DICOM +(0024,0308) LO DataSetSource 1 DICOM +(0024,0309) LO DataSetDescription 1 DICOM +(0024,0317) SQ VisualFieldTestReliabilityGlobalIndexSequence 1 DICOM +(0024,0320) SQ VisualFieldGlobalResultsIndexSequence 1 DICOM +(0024,0325) SQ DataObservationSequence 1 DICOM +(0024,0338) CS IndexNormalsFlag 1 DICOM +(0024,0341) FL IndexProbability 1 DICOM +(0024,0344) SQ IndexProbabilitySequence 1 DICOM +(0028,0002) US SamplesPerPixel 1 DICOM +(0028,0003) US SamplesPerPixelUsed 1 DICOM +(0028,0004) CS PhotometricInterpretation 1 DICOM +(0028,0006) US PlanarConfiguration 1 DICOM +(0028,0008) IS NumberOfFrames 1 DICOM +(0028,0009) AT FrameIncrementPointer 1-n DICOM +(0028,000A) AT FrameDimensionPointer 1-n DICOM +(0028,0010) US Rows 1 DICOM +(0028,0011) US Columns 1 DICOM +(0028,0014) US UltrasoundColorDataPresent 1 DICOM +(0028,0030) DS PixelSpacing 2 DICOM +(0028,0031) DS ZoomFactor 2 DICOM +(0028,0032) DS ZoomCenter 2 DICOM +(0028,0034) IS PixelAspectRatio 2 DICOM +(0028,0051) CS CorrectedImage 1-n DICOM +(0028,0100) US BitsAllocated 1 DICOM +(0028,0101) US BitsStored 1 DICOM +(0028,0102) US HighBit 1 DICOM +(0028,0103) US PixelRepresentation 1 DICOM +(0028,0106) xs SmallestImagePixelValue 1 DICOM +(0028,0107) xs LargestImagePixelValue 1 DICOM +(0028,0108) xs SmallestPixelValueInSeries 1 DICOM +(0028,0109) xs LargestPixelValueInSeries 1 DICOM +(0028,0120) xs PixelPaddingValue 1 DICOM +(0028,0121) xs PixelPaddingRangeLimit 1 DICOM +(0028,0122) FL FloatPixelPaddingValue 1 DICOM +(0028,0123) FD DoubleFloatPixelPaddingValue 1 DICOM +(0028,0124) FL FloatPixelPaddingRangeLimit 1 DICOM +(0028,0125) FD DoubleFloatPixelPaddingRangeLimit 1 DICOM +(0028,0300) CS QualityControlImage 1 DICOM +(0028,0301) CS BurnedInAnnotation 1 DICOM +(0028,0302) CS RecognizableVisualFeatures 1 DICOM +(0028,0303) CS LongitudinalTemporalInformationModified 1 DICOM +(0028,0304) UI ReferencedColorPaletteInstanceUID 1 DICOM +(0028,0A02) CS PixelSpacingCalibrationType 1 DICOM +(0028,0A04) LO PixelSpacingCalibrationDescription 1 DICOM +(0028,1040) CS PixelIntensityRelationship 1 DICOM +(0028,1041) SS PixelIntensityRelationshipSign 1 DICOM +(0028,1050) DS WindowCenter 1-n DICOM +(0028,1051) DS WindowWidth 1-n DICOM +(0028,1052) DS RescaleIntercept 1 DICOM +(0028,1053) DS RescaleSlope 1 DICOM +(0028,1054) LO RescaleType 1 DICOM +(0028,1055) LO WindowCenterWidthExplanation 1-n DICOM +(0028,1056) CS VOILUTFunction 1 DICOM +(0028,1090) CS RecommendedViewingMode 1 DICOM +(0028,1101) xs RedPaletteColorLookupTableDescriptor 3 DICOM +(0028,1102) xs GreenPaletteColorLookupTableDescriptor 3 DICOM +(0028,1103) xs BluePaletteColorLookupTableDescriptor 3 DICOM +(0028,1104) US AlphaPaletteColorLookupTableDescriptor 3 DICOM +(0028,1199) UI PaletteColorLookupTableUID 1 DICOM +(0028,1201) OW RedPaletteColorLookupTableData 1 DICOM +(0028,1202) OW GreenPaletteColorLookupTableData 1 DICOM +(0028,1203) OW BluePaletteColorLookupTableData 1 DICOM +(0028,1204) OW AlphaPaletteColorLookupTableData 1 DICOM +(0028,1221) OW SegmentedRedPaletteColorLookupTableData 1 DICOM +(0028,1222) OW SegmentedGreenPaletteColorLookupTableData 1 DICOM +(0028,1223) OW SegmentedBluePaletteColorLookupTableData 1 DICOM +(0028,1224) OW SegmentedAlphaPaletteColorLookupTableData 1 DICOM +(0028,1230) SQ StoredValueColorRangeSequence 1 DICOM +(0028,1231) FD MinimumStoredValueMapped 1 DICOM +(0028,1232) FD MaximumStoredValueMapped 1 DICOM +(0028,1300) CS BreastImplantPresent 1 DICOM +(0028,1350) CS PartialView 1 DICOM +(0028,1351) ST PartialViewDescription 1 DICOM +(0028,1352) SQ PartialViewCodeSequence 1 DICOM +(0028,135A) CS SpatialLocationsPreserved 1 DICOM +(0028,1401) SQ DataFrameAssignmentSequence 1 DICOM +(0028,1402) CS DataPathAssignment 1 DICOM +(0028,1403) US BitsMappedToColorLookupTable 1 DICOM +(0028,1404) SQ BlendingLUT1Sequence 1 DICOM +(0028,1405) CS BlendingLUT1TransferFunction 1 DICOM +(0028,1406) FD BlendingWeightConstant 1 DICOM +(0028,1407) US BlendingLookupTableDescriptor 3 DICOM +(0028,1408) OW BlendingLookupTableData 1 DICOM +(0028,140B) SQ EnhancedPaletteColorLookupTableSequence 1 DICOM +(0028,140C) SQ BlendingLUT2Sequence 1 DICOM +(0028,140D) CS BlendingLUT2TransferFunction 1 DICOM +(0028,140E) CS DataPathID 1 DICOM +(0028,140F) CS RGBLUTTransferFunction 1 DICOM +(0028,1410) CS AlphaLUTTransferFunction 1 DICOM +(0028,2000) OB ICCProfile 1 DICOM +(0028,2002) CS ColorSpace 1 DICOM +(0028,2110) CS LossyImageCompression 1 DICOM +(0028,2112) DS LossyImageCompressionRatio 1-n DICOM +(0028,2114) CS LossyImageCompressionMethod 1-n DICOM +(0028,3000) SQ ModalityLUTSequence 1 DICOM +(0028,3002) xs LUTDescriptor 3 DICOM +(0028,3003) LO LUTExplanation 1 DICOM +(0028,3004) LO ModalityLUTType 1 DICOM +(0028,3006) lt LUTData 1-n DICOM +(0028,3010) SQ VOILUTSequence 1 DICOM +(0028,3110) SQ SoftcopyVOILUTSequence 1 DICOM +(0028,6010) US RepresentativeFrameNumber 1 DICOM +(0028,6020) US FrameNumbersOfInterest 1-n DICOM +(0028,6022) LO FrameOfInterestDescription 1-n DICOM +(0028,6023) CS FrameOfInterestType 1-n DICOM +(0028,6040) US RWavePointer 1-n DICOM +(0028,6100) SQ MaskSubtractionSequence 1 DICOM +(0028,6101) CS MaskOperation 1 DICOM +(0028,6102) US ApplicableFrameRange 2-2n DICOM +(0028,6110) US MaskFrameNumbers 1-n DICOM +(0028,6112) US ContrastFrameAveraging 1 DICOM +(0028,6114) FL MaskSubPixelShift 2 DICOM +(0028,6120) SS TIDOffset 1 DICOM +(0028,6190) ST MaskOperationExplanation 1 DICOM +(0028,7000) SQ EquipmentAdministratorSequence 1 DICOM +(0028,7001) US NumberOfDisplaySubsystems 1 DICOM +(0028,7002) US CurrentConfigurationID 1 DICOM +(0028,7003) US DisplaySubsystemID 1 DICOM +(0028,7004) SH DisplaySubsystemName 1 DICOM +(0028,7005) LO DisplaySubsystemDescription 1 DICOM +(0028,7006) CS SystemStatus 1 DICOM +(0028,7007) LO SystemStatusComment 1 DICOM +(0028,7008) SQ TargetLuminanceCharacteristicsSequence 1 DICOM +(0028,7009) US LuminanceCharacteristicsID 1 DICOM +(0028,700A) SQ DisplaySubsystemConfigurationSequence 1 DICOM +(0028,700B) US ConfigurationID 1 DICOM +(0028,700C) SH ConfigurationName 1 DICOM +(0028,700D) LO ConfigurationDescription 1 DICOM +(0028,700E) US ReferencedTargetLuminanceCharacteristicsID 1 DICOM +(0028,700F) SQ QAResultsSequence 1 DICOM +(0028,7010) SQ DisplaySubsystemQAResultsSequence 1 DICOM +(0028,7011) SQ ConfigurationQAResultsSequence 1 DICOM +(0028,7012) SQ MeasurementEquipmentSequence 1 DICOM +(0028,7013) CS MeasurementFunctions 1-n DICOM +(0028,7014) CS MeasurementEquipmentType 1 DICOM +(0028,7015) SQ VisualEvaluationResultSequence 1 DICOM +(0028,7016) SQ DisplayCalibrationResultSequence 1 DICOM +(0028,7017) US DDLValue 1 DICOM +(0028,7018) FL CIExyWhitePoint 2 DICOM +(0028,7019) CS DisplayFunctionType 1 DICOM +(0028,701A) FL GammaValue 1 DICOM +(0028,701B) US NumberOfLuminancePoints 1 DICOM +(0028,701C) SQ LuminanceResponseSequence 1 DICOM +(0028,701D) FL TargetMinimumLuminance 1 DICOM +(0028,701E) FL TargetMaximumLuminance 1 DICOM +(0028,701F) FL LuminanceValue 1 DICOM +(0028,7020) LO LuminanceResponseDescription 1 DICOM +(0028,7021) CS WhitePointFlag 1 DICOM +(0028,7022) SQ DisplayDeviceTypeCodeSequence 1 DICOM +(0028,7023) SQ DisplaySubsystemSequence 1 DICOM +(0028,7024) SQ LuminanceResultSequence 1 DICOM +(0028,7025) CS AmbientLightValueSource 1 DICOM +(0028,7026) CS MeasuredCharacteristics 1-n DICOM +(0028,7027) SQ LuminanceUniformityResultSequence 1 DICOM +(0028,7028) SQ VisualEvaluationTestSequence 1 DICOM +(0028,7029) CS TestResult 1 DICOM +(0028,702A) LO TestResultComment 1 DICOM +(0028,702B) CS TestImageValidation 1 DICOM +(0028,702C) SQ TestPatternCodeSequence 1 DICOM +(0028,702D) SQ MeasurementPatternCodeSequence 1 DICOM +(0028,702E) SQ VisualEvaluationMethodCodeSequence 1 DICOM +(0028,7FE0) UR PixelDataProviderURL 1 DICOM +(0028,9001) UL DataPointRows 1 DICOM +(0028,9002) UL DataPointColumns 1 DICOM +(0028,9003) CS SignalDomainColumns 1 DICOM +(0028,9108) CS DataRepresentation 1 DICOM +(0028,9110) SQ PixelMeasuresSequence 1 DICOM +(0028,9132) SQ FrameVOILUTSequence 1 DICOM +(0028,9145) SQ PixelValueTransformationSequence 1 DICOM +(0028,9235) CS SignalDomainRows 1 DICOM +(0028,9411) FL DisplayFilterPercentage 1 DICOM +(0028,9415) SQ FramePixelShiftSequence 1 DICOM +(0028,9416) US SubtractionItemID 1 DICOM +(0028,9422) SQ PixelIntensityRelationshipLUTSequence 1 DICOM +(0028,9443) SQ FramePixelDataPropertiesSequence 1 DICOM +(0028,9444) CS GeometricalProperties 1 DICOM +(0028,9445) FL GeometricMaximumDistortion 1 DICOM +(0028,9446) CS ImageProcessingApplied 1-n DICOM +(0028,9454) CS MaskSelectionMode 1 DICOM +(0028,9474) CS LUTFunction 1 DICOM +(0028,9478) FL MaskVisibilityPercentage 1 DICOM +(0028,9501) SQ PixelShiftSequence 1 DICOM +(0028,9502) SQ RegionPixelShiftSequence 1 DICOM +(0028,9503) SS VerticesOfTheRegion 2-2n DICOM +(0028,9505) SQ MultiFramePresentationSequence 1 DICOM +(0028,9506) US PixelShiftFrameRange 2-2n DICOM +(0028,9507) US LUTFrameRange 2-2n DICOM +(0028,9520) DS ImageToEquipmentMappingMatrix 16 DICOM +(0028,9537) CS EquipmentCoordinateSystemIdentification 1 DICOM +(0032,1031) SQ RequestingPhysicianIdentificationSequence 1 DICOM +(0032,1032) PN RequestingPhysician 1 DICOM +(0032,1033) LO RequestingService 1 DICOM +(0032,1034) SQ RequestingServiceCodeSequence 1 DICOM +(0032,1060) LO RequestedProcedureDescription 1 DICOM +(0032,1064) SQ RequestedProcedureCodeSequence 1 DICOM +(0032,1066) UT ReasonForVisit 1 DICOM +(0032,1067) SQ ReasonForVisitCodeSequence 1 DICOM +(0032,1070) LO RequestedContrastAgent 1 DICOM +(0038,0004) SQ ReferencedPatientAliasSequence 1 DICOM +(0038,0008) CS VisitStatusID 1 DICOM +(0038,0010) LO AdmissionID 1 DICOM +(0038,0014) SQ IssuerOfAdmissionIDSequence 1 DICOM +(0038,0016) LO RouteOfAdmissions 1 DICOM +(0038,0020) DA AdmittingDate 1 DICOM +(0038,0021) TM AdmittingTime 1 DICOM +(0038,0050) LO SpecialNeeds 1 DICOM +(0038,0060) LO ServiceEpisodeID 1 DICOM +(0038,0062) LO ServiceEpisodeDescription 1 DICOM +(0038,0064) SQ IssuerOfServiceEpisodeIDSequence 1 DICOM +(0038,0100) SQ PertinentDocumentsSequence 1 DICOM +(0038,0101) SQ PertinentResourcesSequence 1 DICOM +(0038,0102) LO ResourceDescription 1 DICOM +(0038,0300) LO CurrentPatientLocation 1 DICOM +(0038,0400) LO PatientInstitutionResidence 1 DICOM +(0038,0500) LO PatientState 1 DICOM +(0038,0502) SQ PatientClinicalTrialParticipationSequence 1 DICOM +(0038,4000) LT VisitComments 1 DICOM +(003A,0004) CS WaveformOriginality 1 DICOM +(003A,0005) US NumberOfWaveformChannels 1 DICOM +(003A,0010) UL NumberOfWaveformSamples 1 DICOM +(003A,001A) DS SamplingFrequency 1 DICOM +(003A,0020) SH MultiplexGroupLabel 1 DICOM +(003A,0200) SQ ChannelDefinitionSequence 1 DICOM +(003A,0202) IS WaveformChannelNumber 1 DICOM +(003A,0203) SH ChannelLabel 1 DICOM +(003A,0205) CS ChannelStatus 1-n DICOM +(003A,0208) SQ ChannelSourceSequence 1 DICOM +(003A,0209) SQ ChannelSourceModifiersSequence 1 DICOM +(003A,020A) SQ SourceWaveformSequence 1 DICOM +(003A,020C) LO ChannelDerivationDescription 1 DICOM +(003A,0210) DS ChannelSensitivity 1 DICOM +(003A,0211) SQ ChannelSensitivityUnitsSequence 1 DICOM +(003A,0212) DS ChannelSensitivityCorrectionFactor 1 DICOM +(003A,0213) DS ChannelBaseline 1 DICOM +(003A,0214) DS ChannelTimeSkew 1 DICOM +(003A,0215) DS ChannelSampleSkew 1 DICOM +(003A,0218) DS ChannelOffset 1 DICOM +(003A,021A) US WaveformBitsStored 1 DICOM +(003A,0220) DS FilterLowFrequency 1 DICOM +(003A,0221) DS FilterHighFrequency 1 DICOM +(003A,0222) DS NotchFilterFrequency 1 DICOM +(003A,0223) DS NotchFilterBandwidth 1 DICOM +(003A,0230) FL WaveformDataDisplayScale 1 DICOM +(003A,0231) US WaveformDisplayBackgroundCIELabValue 3 DICOM +(003A,0240) SQ WaveformPresentationGroupSequence 1 DICOM +(003A,0241) US PresentationGroupNumber 1 DICOM +(003A,0242) SQ ChannelDisplaySequence 1 DICOM +(003A,0244) US ChannelRecommendedDisplayCIELabValue 3 DICOM +(003A,0245) FL ChannelPosition 1 DICOM +(003A,0246) CS DisplayShadingFlag 1 DICOM +(003A,0247) FL FractionalChannelDisplayScale 1 DICOM +(003A,0248) FL AbsoluteChannelDisplayScale 1 DICOM +(003A,0300) SQ MultiplexedAudioChannelsDescriptionCodeSequence 1 DICOM +(003A,0301) IS ChannelIdentificationCode 1 DICOM +(003A,0302) CS ChannelMode 1 DICOM +(0040,0001) AE ScheduledStationAETitle 1-n DICOM +(0040,0002) DA ScheduledProcedureStepStartDate 1 DICOM +(0040,0003) TM ScheduledProcedureStepStartTime 1 DICOM +(0040,0004) DA ScheduledProcedureStepEndDate 1 DICOM +(0040,0005) TM ScheduledProcedureStepEndTime 1 DICOM +(0040,0006) PN ScheduledPerformingPhysicianName 1 DICOM +(0040,0007) LO ScheduledProcedureStepDescription 1 DICOM +(0040,0008) SQ ScheduledProtocolCodeSequence 1 DICOM +(0040,0009) SH ScheduledProcedureStepID 1 DICOM +(0040,000A) SQ StageCodeSequence 1 DICOM +(0040,000B) SQ ScheduledPerformingPhysicianIdentificationSequence 1 DICOM +(0040,0010) SH ScheduledStationName 1-n DICOM +(0040,0011) SH ScheduledProcedureStepLocation 1 DICOM +(0040,0012) LO PreMedication 1 DICOM +(0040,0020) CS ScheduledProcedureStepStatus 1 DICOM +(0040,0026) SQ OrderPlacerIdentifierSequence 1 DICOM +(0040,0027) SQ OrderFillerIdentifierSequence 1 DICOM +(0040,0031) UT LocalNamespaceEntityID 1 DICOM +(0040,0032) UT UniversalEntityID 1 DICOM +(0040,0033) CS UniversalEntityIDType 1 DICOM +(0040,0035) CS IdentifierTypeCode 1 DICOM +(0040,0036) SQ AssigningFacilitySequence 1 DICOM +(0040,0039) SQ AssigningJurisdictionCodeSequence 1 DICOM +(0040,003A) SQ AssigningAgencyOrDepartmentCodeSequence 1 DICOM +(0040,0100) SQ ScheduledProcedureStepSequence 1 DICOM +(0040,0220) SQ ReferencedNonImageCompositeSOPInstanceSequence 1 DICOM +(0040,0241) AE PerformedStationAETitle 1 DICOM +(0040,0242) SH PerformedStationName 1 DICOM +(0040,0243) SH PerformedLocation 1 DICOM +(0040,0244) DA PerformedProcedureStepStartDate 1 DICOM +(0040,0245) TM PerformedProcedureStepStartTime 1 DICOM +(0040,0250) DA PerformedProcedureStepEndDate 1 DICOM +(0040,0251) TM PerformedProcedureStepEndTime 1 DICOM +(0040,0252) CS PerformedProcedureStepStatus 1 DICOM +(0040,0253) SH PerformedProcedureStepID 1 DICOM +(0040,0254) LO PerformedProcedureStepDescription 1 DICOM +(0040,0255) LO PerformedProcedureTypeDescription 1 DICOM +(0040,0260) SQ PerformedProtocolCodeSequence 1 DICOM +(0040,0261) CS PerformedProtocolType 1 DICOM +(0040,0270) SQ ScheduledStepAttributesSequence 1 DICOM +(0040,0275) SQ RequestAttributesSequence 1 DICOM +(0040,0280) ST CommentsOnThePerformedProcedureStep 1 DICOM +(0040,0281) SQ PerformedProcedureStepDiscontinuationReasonCodeSequence 1 DICOM +(0040,0293) SQ QuantitySequence 1 DICOM +(0040,0294) DS Quantity 1 DICOM +(0040,0295) SQ MeasuringUnitsSequence 1 DICOM +(0040,0296) SQ BillingItemSequence 1 DICOM +(0040,0302) US EntranceDose 1 DICOM +(0040,0303) US ExposedArea 1-2 DICOM +(0040,0306) DS DistanceSourceToEntrance 1 DICOM +(0040,0310) ST CommentsOnRadiationDose 1 DICOM +(0040,0312) DS XRayOutput 1 DICOM +(0040,0314) DS HalfValueLayer 1 DICOM +(0040,0316) DS OrganDose 1 DICOM +(0040,0318) CS OrganExposed 1 DICOM +(0040,0320) SQ BillingProcedureStepSequence 1 DICOM +(0040,0321) SQ FilmConsumptionSequence 1 DICOM +(0040,0324) SQ BillingSuppliesAndDevicesSequence 1 DICOM +(0040,0340) SQ PerformedSeriesSequence 1 DICOM +(0040,0400) LT CommentsOnTheScheduledProcedureStep 1 DICOM +(0040,0440) SQ ProtocolContextSequence 1 DICOM +(0040,0441) SQ ContentItemModifierSequence 1 DICOM +(0040,0500) SQ ScheduledSpecimenSequence 1 DICOM +(0040,0512) LO ContainerIdentifier 1 DICOM +(0040,0513) SQ IssuerOfTheContainerIdentifierSequence 1 DICOM +(0040,0515) SQ AlternateContainerIdentifierSequence 1 DICOM +(0040,0518) SQ ContainerTypeCodeSequence 1 DICOM +(0040,051A) LO ContainerDescription 1 DICOM +(0040,0520) SQ ContainerComponentSequence 1 DICOM +(0040,0551) LO SpecimenIdentifier 1 DICOM +(0040,0554) UI SpecimenUID 1 DICOM +(0040,0555) SQ AcquisitionContextSequence 1 DICOM +(0040,0556) ST AcquisitionContextDescription 1 DICOM +(0040,0560) SQ SpecimenDescriptionSequence 1 DICOM +(0040,0562) SQ IssuerOfTheSpecimenIdentifierSequence 1 DICOM +(0040,059A) SQ SpecimenTypeCodeSequence 1 DICOM +(0040,0600) LO SpecimenShortDescription 1 DICOM +(0040,0602) UT SpecimenDetailedDescription 1 DICOM +(0040,0610) SQ SpecimenPreparationSequence 1 DICOM +(0040,0612) SQ SpecimenPreparationStepContentItemSequence 1 DICOM +(0040,0620) SQ SpecimenLocalizationContentItemSequence 1 DICOM +(0040,0710) SQ WholeSlideMicroscopyImageFrameTypeSequence 1 DICOM +(0040,071A) SQ ImageCenterPointCoordinatesSequence 1 DICOM +(0040,072A) DS XOffsetInSlideCoordinateSystem 1 DICOM +(0040,073A) DS YOffsetInSlideCoordinateSystem 1 DICOM +(0040,074A) DS ZOffsetInSlideCoordinateSystem 1 DICOM +(0040,08EA) SQ MeasurementUnitsCodeSequence 1 DICOM +(0040,1001) SH RequestedProcedureID 1 DICOM +(0040,1002) LO ReasonForTheRequestedProcedure 1 DICOM +(0040,1003) SH RequestedProcedurePriority 1 DICOM +(0040,1004) LO PatientTransportArrangements 1 DICOM +(0040,1005) LO RequestedProcedureLocation 1 DICOM +(0040,1008) LO ConfidentialityCode 1 DICOM +(0040,1009) SH ReportingPriority 1 DICOM +(0040,100A) SQ ReasonForRequestedProcedureCodeSequence 1 DICOM +(0040,1010) PN NamesOfIntendedRecipientsOfResults 1-n DICOM +(0040,1011) SQ IntendedRecipientsOfResultsIdentificationSequence 1 DICOM +(0040,1012) SQ ReasonForPerformedProcedureCodeSequence 1 DICOM +(0040,1101) SQ PersonIdentificationCodeSequence 1 DICOM +(0040,1102) ST PersonAddress 1 DICOM +(0040,1103) LO PersonTelephoneNumbers 1-n DICOM +(0040,1104) LT PersonTelecomInformation 1 DICOM +(0040,1400) LT RequestedProcedureComments 1 DICOM +(0040,2004) DA IssueDateOfImagingServiceRequest 1 DICOM +(0040,2005) TM IssueTimeOfImagingServiceRequest 1 DICOM +(0040,2008) PN OrderEnteredBy 1 DICOM +(0040,2009) SH OrderEntererLocation 1 DICOM +(0040,2010) SH OrderCallbackPhoneNumber 1 DICOM +(0040,2011) LT OrderCallbackTelecomInformation 1 DICOM +(0040,2016) LO PlacerOrderNumberImagingServiceRequest 1 DICOM +(0040,2017) LO FillerOrderNumberImagingServiceRequest 1 DICOM +(0040,2400) LT ImagingServiceRequestComments 1 DICOM +(0040,3001) LO ConfidentialityConstraintOnPatientDataDescription 1 DICOM +(0040,4005) DT ScheduledProcedureStepStartDateTime 1 DICOM +(0040,4008) DT ScheduledProcedureStepExpirationDateTime 1 DICOM +(0040,4009) SQ HumanPerformerCodeSequence 1 DICOM +(0040,4010) DT ScheduledProcedureStepModificationDateTime 1 DICOM +(0040,4011) DT ExpectedCompletionDateTime 1 DICOM +(0040,4018) SQ ScheduledWorkitemCodeSequence 1 DICOM +(0040,4019) SQ PerformedWorkitemCodeSequence 1 DICOM +(0040,4021) SQ InputInformationSequence 1 DICOM +(0040,4025) SQ ScheduledStationNameCodeSequence 1 DICOM +(0040,4026) SQ ScheduledStationClassCodeSequence 1 DICOM +(0040,4027) SQ ScheduledStationGeographicLocationCodeSequence 1 DICOM +(0040,4028) SQ PerformedStationNameCodeSequence 1 DICOM +(0040,4029) SQ PerformedStationClassCodeSequence 1 DICOM +(0040,4030) SQ PerformedStationGeographicLocationCodeSequence 1 DICOM +(0040,4033) SQ OutputInformationSequence 1 DICOM +(0040,4034) SQ ScheduledHumanPerformersSequence 1 DICOM +(0040,4035) SQ ActualHumanPerformersSequence 1 DICOM +(0040,4036) LO HumanPerformerOrganization 1 DICOM +(0040,4037) PN HumanPerformerName 1 DICOM +(0040,4040) CS RawDataHandling 1 DICOM +(0040,4041) CS InputReadinessState 1 DICOM +(0040,4050) DT PerformedProcedureStepStartDateTime 1 DICOM +(0040,4051) DT PerformedProcedureStepEndDateTime 1 DICOM +(0040,4052) DT ProcedureStepCancellationDateTime 1 DICOM +(0040,4070) SQ OutputDestinationSequence 1 DICOM +(0040,4071) SQ DICOMStorageSequence 1 DICOM +(0040,4072) SQ STOWRSStorageSequence 1 DICOM +(0040,4073) UR StorageURL 1 DICOM +(0040,4074) SQ XDSStorageSequence 1 DICOM +(0040,8302) DS EntranceDoseInmGy 1 DICOM +(0040,8303) CS EntranceDoseDerivation 1 DICOM +(0040,9092) SQ ParametricMapFrameTypeSequence 1 DICOM +(0040,9094) SQ ReferencedImageRealWorldValueMappingSequence 1 DICOM +(0040,9096) SQ RealWorldValueMappingSequence 1 DICOM +(0040,9098) SQ PixelValueMappingCodeSequence 1 DICOM +(0040,9210) SH LUTLabel 1 DICOM +(0040,9211) xs RealWorldValueLastValueMapped 1 DICOM +(0040,9212) FD RealWorldValueLUTData 1-n DICOM +(0040,9213) FD DoubleFloatRealWorldValueLastValueMapped 1 DICOM +(0040,9214) FD DoubleFloatRealWorldValueFirstValueMapped 1 DICOM +(0040,9216) xs RealWorldValueFirstValueMapped 1 DICOM +(0040,9220) SQ QuantityDefinitionSequence 1 DICOM +(0040,9224) FD RealWorldValueIntercept 1 DICOM +(0040,9225) FD RealWorldValueSlope 1 DICOM +(0040,A010) CS RelationshipType 1 DICOM +(0040,A027) LO VerifyingOrganization 1 DICOM +(0040,A030) DT VerificationDateTime 1 DICOM +(0040,A032) DT ObservationDateTime 1 DICOM +(0040,A040) CS ValueType 1 DICOM +(0040,A043) SQ ConceptNameCodeSequence 1 DICOM +(0040,A050) CS ContinuityOfContent 1 DICOM +(0040,A073) SQ VerifyingObserverSequence 1 DICOM +(0040,A075) PN VerifyingObserverName 1 DICOM +(0040,A078) SQ AuthorObserverSequence 1 DICOM +(0040,A07A) SQ ParticipantSequence 1 DICOM +(0040,A07C) SQ CustodialOrganizationSequence 1 DICOM +(0040,A080) CS ParticipationType 1 DICOM +(0040,A082) DT ParticipationDateTime 1 DICOM +(0040,A084) CS ObserverType 1 DICOM +(0040,A088) SQ VerifyingObserverIdentificationCodeSequence 1 DICOM +(0040,A0B0) US ReferencedWaveformChannels 2-2n DICOM +(0040,A120) DT DateTime 1 DICOM +(0040,A121) DA Date 1 DICOM +(0040,A122) TM Time 1 DICOM +(0040,A123) PN PersonName 1 DICOM +(0040,A124) UI UID 1 DICOM +(0040,A130) CS TemporalRangeType 1 DICOM +(0040,A132) UL ReferencedSamplePositions 1-n DICOM +(0040,A138) DS ReferencedTimeOffsets 1-n DICOM +(0040,A13A) DT ReferencedDateTime 1-n DICOM +(0040,A160) UT TextValue 1 DICOM +(0040,A161) FD FloatingPointValue 1-n DICOM +(0040,A162) SL RationalNumeratorValue 1-n DICOM +(0040,A163) UL RationalDenominatorValue 1-n DICOM +(0040,A168) SQ ConceptCodeSequence 1 DICOM +(0040,A170) SQ PurposeOfReferenceCodeSequence 1 DICOM +(0040,A171) UI ObservationUID 1 DICOM +(0040,A180) US AnnotationGroupNumber 1 DICOM +(0040,A195) SQ ModifierCodeSequence 1 DICOM +(0040,A300) SQ MeasuredValueSequence 1 DICOM +(0040,A301) SQ NumericValueQualifierCodeSequence 1 DICOM +(0040,A30A) DS NumericValue 1-n DICOM +(0040,A360) SQ PredecessorDocumentsSequence 1 DICOM +(0040,A370) SQ ReferencedRequestSequence 1 DICOM +(0040,A372) SQ PerformedProcedureCodeSequence 1 DICOM +(0040,A375) SQ CurrentRequestedProcedureEvidenceSequence 1 DICOM +(0040,A385) SQ PertinentOtherEvidenceSequence 1 DICOM +(0040,A390) SQ HL7StructuredDocumentReferenceSequence 1 DICOM +(0040,A491) CS CompletionFlag 1 DICOM +(0040,A492) LO CompletionFlagDescription 1 DICOM +(0040,A493) CS VerificationFlag 1 DICOM +(0040,A494) CS ArchiveRequested 1 DICOM +(0040,A496) CS PreliminaryFlag 1 DICOM +(0040,A504) SQ ContentTemplateSequence 1 DICOM +(0040,A525) SQ IdenticalDocumentsSequence 1 DICOM +(0040,A730) SQ ContentSequence 1 DICOM +(0040,B020) SQ WaveformAnnotationSequence 1 DICOM +(0040,DB00) CS TemplateIdentifier 1 DICOM +(0040,DB73) UL ReferencedContentItemIdentifier 1-n DICOM +(0040,E001) ST HL7InstanceIdentifier 1 DICOM +(0040,E004) DT HL7DocumentEffectiveTime 1 DICOM +(0040,E006) SQ HL7DocumentTypeCodeSequence 1 DICOM +(0040,E008) SQ DocumentClassCodeSequence 1 DICOM +(0040,E010) UR RetrieveURI 1 DICOM +(0040,E011) UI RetrieveLocationUID 1 DICOM +(0040,E020) CS TypeOfInstances 1 DICOM +(0040,E021) SQ DICOMRetrievalSequence 1 DICOM +(0040,E022) SQ DICOMMediaRetrievalSequence 1 DICOM +(0040,E023) SQ WADORetrievalSequence 1 DICOM +(0040,E024) SQ XDSRetrievalSequence 1 DICOM +(0040,E025) SQ WADORSRetrievalSequence 1 DICOM +(0040,E030) UI RepositoryUniqueID 1 DICOM +(0040,E031) UI HomeCommunityID 1 DICOM +(0042,0010) ST DocumentTitle 1 DICOM +(0042,0011) OB EncapsulatedDocument 1 DICOM +(0042,0012) LO MIMETypeOfEncapsulatedDocument 1 DICOM +(0042,0013) SQ SourceInstanceSequence 1 DICOM +(0042,0014) LO ListOfMIMETypes 1-n DICOM +(0042,0015) UL EncapsulatedDocumentLength 1 DICOM +(0044,0001) ST ProductPackageIdentifier 1 DICOM +(0044,0002) CS SubstanceAdministrationApproval 1 DICOM +(0044,0003) LT ApprovalStatusFurtherDescription 1 DICOM +(0044,0004) DT ApprovalStatusDateTime 1 DICOM +(0044,0007) SQ ProductTypeCodeSequence 1 DICOM +(0044,0008) LO ProductName 1-n DICOM +(0044,0009) LT ProductDescription 1 DICOM +(0044,000A) LO ProductLotIdentifier 1 DICOM +(0044,000B) DT ProductExpirationDateTime 1 DICOM +(0044,0010) DT SubstanceAdministrationDateTime 1 DICOM +(0044,0011) LO SubstanceAdministrationNotes 1 DICOM +(0044,0012) LO SubstanceAdministrationDeviceID 1 DICOM +(0044,0013) SQ ProductParameterSequence 1 DICOM +(0044,0019) SQ SubstanceAdministrationParameterSequence 1 DICOM +(0044,0100) SQ ApprovalSequence 1 DICOM +(0044,0101) SQ AssertionCodeSequence 1 DICOM +(0044,0102) UI AssertionUID 1 DICOM +(0044,0103) SQ AsserterIdentificationSequence 1 DICOM +(0044,0104) DT AssertionDateTime 1 DICOM +(0044,0105) DT AssertionExpirationDateTime 1 DICOM +(0044,0106) UT AssertionComments 1 DICOM +(0044,0107) SQ RelatedAssertionSequence 1 DICOM +(0044,0108) UI ReferencedAssertionUID 1 DICOM +(0044,0109) SQ ApprovalSubjectSequence 1 DICOM +(0044,010A) SQ OrganizationalRoleCodeSequence 1 DICOM +(0046,0012) LO LensDescription 1 DICOM +(0046,0014) SQ RightLensSequence 1 DICOM +(0046,0015) SQ LeftLensSequence 1 DICOM +(0046,0016) SQ UnspecifiedLateralityLensSequence 1 DICOM +(0046,0018) SQ CylinderSequence 1 DICOM +(0046,0028) SQ PrismSequence 1 DICOM +(0046,0030) FD HorizontalPrismPower 1 DICOM +(0046,0032) CS HorizontalPrismBase 1 DICOM +(0046,0034) FD VerticalPrismPower 1 DICOM +(0046,0036) CS VerticalPrismBase 1 DICOM +(0046,0038) CS LensSegmentType 1 DICOM +(0046,0040) FD OpticalTransmittance 1 DICOM +(0046,0042) FD ChannelWidth 1 DICOM +(0046,0044) FD PupilSize 1 DICOM +(0046,0046) FD CornealSize 1 DICOM +(0046,0047) SQ CornealSizeSequence 1 DICOM +(0046,0050) SQ AutorefractionRightEyeSequence 1 DICOM +(0046,0052) SQ AutorefractionLeftEyeSequence 1 DICOM +(0046,0060) FD DistancePupillaryDistance 1 DICOM +(0046,0062) FD NearPupillaryDistance 1 DICOM +(0046,0063) FD IntermediatePupillaryDistance 1 DICOM +(0046,0064) FD OtherPupillaryDistance 1 DICOM +(0046,0070) SQ KeratometryRightEyeSequence 1 DICOM +(0046,0071) SQ KeratometryLeftEyeSequence 1 DICOM +(0046,0074) SQ SteepKeratometricAxisSequence 1 DICOM +(0046,0075) FD RadiusOfCurvature 1 DICOM +(0046,0076) FD KeratometricPower 1 DICOM +(0046,0077) FD KeratometricAxis 1 DICOM +(0046,0080) SQ FlatKeratometricAxisSequence 1 DICOM +(0046,0092) CS BackgroundColor 1 DICOM +(0046,0094) CS Optotype 1 DICOM +(0046,0095) CS OptotypePresentation 1 DICOM +(0046,0097) SQ SubjectiveRefractionRightEyeSequence 1 DICOM +(0046,0098) SQ SubjectiveRefractionLeftEyeSequence 1 DICOM +(0046,0100) SQ AddNearSequence 1 DICOM +(0046,0101) SQ AddIntermediateSequence 1 DICOM +(0046,0102) SQ AddOtherSequence 1 DICOM +(0046,0104) FD AddPower 1 DICOM +(0046,0106) FD ViewingDistance 1 DICOM +(0046,0110) SQ CorneaMeasurementsSequence 1 DICOM +(0046,0111) SQ SourceOfCorneaMeasurementDataCodeSequence 1 DICOM +(0046,0112) SQ SteepCornealAxisSequence 1 DICOM +(0046,0113) SQ FlatCornealAxisSequence 1 DICOM +(0046,0114) FD CornealPower 1 DICOM +(0046,0115) FD CornealAxis 1 DICOM +(0046,0116) SQ CorneaMeasurementMethodCodeSequence 1 DICOM +(0046,0117) FL RefractiveIndexOfCornea 1 DICOM +(0046,0118) FL RefractiveIndexOfAqueousHumor 1 DICOM +(0046,0121) SQ VisualAcuityTypeCodeSequence 1 DICOM +(0046,0122) SQ VisualAcuityRightEyeSequence 1 DICOM +(0046,0123) SQ VisualAcuityLeftEyeSequence 1 DICOM +(0046,0124) SQ VisualAcuityBothEyesOpenSequence 1 DICOM +(0046,0125) CS ViewingDistanceType 1 DICOM +(0046,0135) SS VisualAcuityModifiers 2 DICOM +(0046,0137) FD DecimalVisualAcuity 1 DICOM +(0046,0139) LO OptotypeDetailedDefinition 1 DICOM +(0046,0145) SQ ReferencedRefractiveMeasurementsSequence 1 DICOM +(0046,0146) FD SpherePower 1 DICOM +(0046,0147) FD CylinderPower 1 DICOM +(0046,0201) CS CornealTopographySurface 1 DICOM +(0046,0202) FL CornealVertexLocation 2 DICOM +(0046,0203) FL PupilCentroidXCoordinate 1 DICOM +(0046,0204) FL PupilCentroidYCoordinate 1 DICOM +(0046,0205) FL EquivalentPupilRadius 1 DICOM +(0046,0207) SQ CornealTopographyMapTypeCodeSequence 1 DICOM +(0046,0208) IS VerticesOfTheOutlineOfPupil 2-2n DICOM +(0046,0210) SQ CornealTopographyMappingNormalsSequence 1 DICOM +(0046,0211) SQ MaximumCornealCurvatureSequence 1 DICOM +(0046,0212) FL MaximumCornealCurvature 1 DICOM +(0046,0213) FL MaximumCornealCurvatureLocation 2 DICOM +(0046,0215) SQ MinimumKeratometricSequence 1 DICOM +(0046,0218) SQ SimulatedKeratometricCylinderSequence 1 DICOM +(0046,0220) FL AverageCornealPower 1 DICOM +(0046,0224) FL CornealISValue 1 DICOM +(0046,0227) FL AnalyzedArea 1 DICOM +(0046,0230) FL SurfaceRegularityIndex 1 DICOM +(0046,0232) FL SurfaceAsymmetryIndex 1 DICOM +(0046,0234) FL CornealEccentricityIndex 1 DICOM +(0046,0236) FL KeratoconusPredictionIndex 1 DICOM +(0046,0238) FL DecimalPotentialVisualAcuity 1 DICOM +(0046,0242) CS CornealTopographyMapQualityEvaluation 1 DICOM +(0046,0244) SQ SourceImageCornealProcessedDataSequence 1 DICOM +(0046,0247) FL CornealPointLocation 3 DICOM +(0046,0248) CS CornealPointEstimated 1 DICOM +(0046,0249) FL AxialPower 1 DICOM +(0046,0250) FL TangentialPower 1 DICOM +(0046,0251) FL RefractivePower 1 DICOM +(0046,0252) FL RelativeElevation 1 DICOM +(0046,0253) FL CornealWavefront 1 DICOM +(0048,0001) FL ImagedVolumeWidth 1 DICOM +(0048,0002) FL ImagedVolumeHeight 1 DICOM +(0048,0003) FL ImagedVolumeDepth 1 DICOM +(0048,0006) UL TotalPixelMatrixColumns 1 DICOM +(0048,0007) UL TotalPixelMatrixRows 1 DICOM +(0048,0008) SQ TotalPixelMatrixOriginSequence 1 DICOM +(0048,0010) CS SpecimenLabelInImage 1 DICOM +(0048,0011) CS FocusMethod 1 DICOM +(0048,0012) CS ExtendedDepthOfField 1 DICOM +(0048,0013) US NumberOfFocalPlanes 1 DICOM +(0048,0014) FL DistanceBetweenFocalPlanes 1 DICOM +(0048,0015) US RecommendedAbsentPixelCIELabValue 3 DICOM +(0048,0100) SQ IlluminatorTypeCodeSequence 1 DICOM +(0048,0102) DS ImageOrientationSlide 6 DICOM +(0048,0105) SQ OpticalPathSequence 1 DICOM +(0048,0106) SH OpticalPathIdentifier 1 DICOM +(0048,0107) ST OpticalPathDescription 1 DICOM +(0048,0108) SQ IlluminationColorCodeSequence 1 DICOM +(0048,0110) SQ SpecimenReferenceSequence 1 DICOM +(0048,0111) DS CondenserLensPower 1 DICOM +(0048,0112) DS ObjectiveLensPower 1 DICOM +(0048,0113) DS ObjectiveLensNumericalAperture 1 DICOM +(0048,0120) SQ PaletteColorLookupTableSequence 1 DICOM +(0048,0200) SQ ReferencedImageNavigationSequence 1 DICOM +(0048,0201) US TopLeftHandCornerOfLocalizerArea 2 DICOM +(0048,0202) US BottomRightHandCornerOfLocalizerArea 2 DICOM +(0048,0207) SQ OpticalPathIdentificationSequence 1 DICOM +(0048,021A) SQ PlanePositionSlideSequence 1 DICOM +(0048,021E) SL ColumnPositionInTotalImagePixelMatrix 1 DICOM +(0048,021F) SL RowPositionInTotalImagePixelMatrix 1 DICOM +(0048,0301) CS PixelOriginInterpretation 1 DICOM +(0048,0302) UL NumberOfOpticalPaths 1 DICOM +(0048,0303) UL TotalPixelMatrixFocalPlanes 1 DICOM +(0050,0004) CS CalibrationImage 1 DICOM +(0050,0010) SQ DeviceSequence 1 DICOM +(0050,0012) SQ ContainerComponentTypeCodeSequence 1 DICOM +(0050,0013) FD ContainerComponentThickness 1 DICOM +(0050,0014) DS DeviceLength 1 DICOM +(0050,0015) FD ContainerComponentWidth 1 DICOM +(0050,0016) DS DeviceDiameter 1 DICOM +(0050,0017) CS DeviceDiameterUnits 1 DICOM +(0050,0018) DS DeviceVolume 1 DICOM +(0050,0019) DS InterMarkerDistance 1 DICOM +(0050,001A) CS ContainerComponentMaterial 1 DICOM +(0050,001B) LO ContainerComponentID 1 DICOM +(0050,001C) FD ContainerComponentLength 1 DICOM +(0050,001D) FD ContainerComponentDiameter 1 DICOM +(0050,001E) LO ContainerComponentDescription 1 DICOM +(0050,0020) LO DeviceDescription 1 DICOM +(0050,0021) ST LongDeviceDescription 1 DICOM +(0052,0001) FL ContrastBolusIngredientPercentByVolume 1 DICOM +(0052,0002) FD OCTFocalDistance 1 DICOM +(0052,0003) FD BeamSpotSize 1 DICOM +(0052,0004) FD EffectiveRefractiveIndex 1 DICOM +(0052,0006) CS OCTAcquisitionDomain 1 DICOM +(0052,0007) FD OCTOpticalCenterWavelength 1 DICOM +(0052,0008) FD AxialResolution 1 DICOM +(0052,0009) FD RangingDepth 1 DICOM +(0052,0011) FD ALineRate 1 DICOM +(0052,0012) US ALinesPerFrame 1 DICOM +(0052,0013) FD CatheterRotationalRate 1 DICOM +(0052,0014) FD ALinePixelSpacing 1 DICOM +(0052,0016) SQ ModeOfPercutaneousAccessSequence 1 DICOM +(0052,0025) SQ IntravascularOCTFrameTypeSequence 1 DICOM +(0052,0026) CS OCTZOffsetApplied 1 DICOM +(0052,0027) SQ IntravascularFrameContentSequence 1 DICOM +(0052,0028) FD IntravascularLongitudinalDistance 1 DICOM +(0052,0029) SQ IntravascularOCTFrameContentSequence 1 DICOM +(0052,0030) SS OCTZOffsetCorrection 1 DICOM +(0052,0031) CS CatheterDirectionOfRotation 1 DICOM +(0052,0033) FD SeamLineLocation 1 DICOM +(0052,0034) FD FirstALineLocation 1 DICOM +(0052,0036) US SeamLineIndex 1 DICOM +(0052,0038) US NumberOfPaddedALines 1 DICOM +(0052,0039) CS InterpolationType 1 DICOM +(0052,003A) CS RefractiveIndexApplied 1 DICOM +(0054,0010) US EnergyWindowVector 1-n DICOM +(0054,0011) US NumberOfEnergyWindows 1 DICOM +(0054,0012) SQ EnergyWindowInformationSequence 1 DICOM +(0054,0013) SQ EnergyWindowRangeSequence 1 DICOM +(0054,0014) DS EnergyWindowLowerLimit 1 DICOM +(0054,0015) DS EnergyWindowUpperLimit 1 DICOM +(0054,0016) SQ RadiopharmaceuticalInformationSequence 1 DICOM +(0054,0017) IS ResidualSyringeCounts 1 DICOM +(0054,0018) SH EnergyWindowName 1 DICOM +(0054,0020) US DetectorVector 1-n DICOM +(0054,0021) US NumberOfDetectors 1 DICOM +(0054,0022) SQ DetectorInformationSequence 1 DICOM +(0054,0030) US PhaseVector 1-n DICOM +(0054,0031) US NumberOfPhases 1 DICOM +(0054,0032) SQ PhaseInformationSequence 1 DICOM +(0054,0033) US NumberOfFramesInPhase 1 DICOM +(0054,0036) IS PhaseDelay 1 DICOM +(0054,0038) IS PauseBetweenFrames 1 DICOM +(0054,0039) CS PhaseDescription 1 DICOM +(0054,0050) US RotationVector 1-n DICOM +(0054,0051) US NumberOfRotations 1 DICOM +(0054,0052) SQ RotationInformationSequence 1 DICOM +(0054,0053) US NumberOfFramesInRotation 1 DICOM +(0054,0060) US RRIntervalVector 1-n DICOM +(0054,0061) US NumberOfRRIntervals 1 DICOM +(0054,0062) SQ GatedInformationSequence 1 DICOM +(0054,0063) SQ DataInformationSequence 1 DICOM +(0054,0070) US TimeSlotVector 1-n DICOM +(0054,0071) US NumberOfTimeSlots 1 DICOM +(0054,0072) SQ TimeSlotInformationSequence 1 DICOM +(0054,0073) DS TimeSlotTime 1 DICOM +(0054,0080) US SliceVector 1-n DICOM +(0054,0081) US NumberOfSlices 1 DICOM +(0054,0090) US AngularViewVector 1-n DICOM +(0054,0100) US TimeSliceVector 1-n DICOM +(0054,0101) US NumberOfTimeSlices 1 DICOM +(0054,0200) DS StartAngle 1 DICOM +(0054,0202) CS TypeOfDetectorMotion 1 DICOM +(0054,0210) IS TriggerVector 1-n DICOM +(0054,0211) US NumberOfTriggersInPhase 1 DICOM +(0054,0220) SQ ViewCodeSequence 1 DICOM +(0054,0222) SQ ViewModifierCodeSequence 1 DICOM +(0054,0300) SQ RadionuclideCodeSequence 1 DICOM +(0054,0302) SQ AdministrationRouteCodeSequence 1 DICOM +(0054,0304) SQ RadiopharmaceuticalCodeSequence 1 DICOM +(0054,0306) SQ CalibrationDataSequence 1 DICOM +(0054,0308) US EnergyWindowNumber 1 DICOM +(0054,0400) SH ImageID 1 DICOM +(0054,0410) SQ PatientOrientationCodeSequence 1 DICOM +(0054,0412) SQ PatientOrientationModifierCodeSequence 1 DICOM +(0054,0414) SQ PatientGantryRelationshipCodeSequence 1 DICOM +(0054,0500) CS SliceProgressionDirection 1 DICOM +(0054,0501) CS ScanProgressionDirection 1 DICOM +(0054,1000) CS SeriesType 2 DICOM +(0054,1001) CS Units 1 DICOM +(0054,1002) CS CountsSource 1 DICOM +(0054,1004) CS ReprojectionMethod 1 DICOM +(0054,1006) CS SUVType 1 DICOM +(0054,1100) CS RandomsCorrectionMethod 1 DICOM +(0054,1101) LO AttenuationCorrectionMethod 1 DICOM +(0054,1102) CS DecayCorrection 1 DICOM +(0054,1103) LO ReconstructionMethod 1 DICOM +(0054,1104) LO DetectorLinesOfResponseUsed 1 DICOM +(0054,1105) LO ScatterCorrectionMethod 1 DICOM +(0054,1200) DS AxialAcceptance 1 DICOM +(0054,1201) IS AxialMash 2 DICOM +(0054,1202) IS TransverseMash 1 DICOM +(0054,1203) DS DetectorElementSize 2 DICOM +(0054,1210) DS CoincidenceWindowWidth 1 DICOM +(0054,1220) CS SecondaryCountsType 1-n DICOM +(0054,1300) DS FrameReferenceTime 1 DICOM +(0054,1310) IS PrimaryPromptsCountsAccumulated 1 DICOM +(0054,1311) IS SecondaryCountsAccumulated 1-n DICOM +(0054,1320) DS SliceSensitivityFactor 1 DICOM +(0054,1321) DS DecayFactor 1 DICOM +(0054,1322) DS DoseCalibrationFactor 1 DICOM +(0054,1323) DS ScatterFractionFactor 1 DICOM +(0054,1324) DS DeadTimeFactor 1 DICOM +(0054,1330) US ImageIndex 1 DICOM +(0060,3000) SQ HistogramSequence 1 DICOM +(0060,3002) US HistogramNumberOfBins 1 DICOM +(0060,3004) xs HistogramFirstBinValue 1 DICOM +(0060,3006) xs HistogramLastBinValue 1 DICOM +(0060,3008) US HistogramBinWidth 1 DICOM +(0060,3010) LO HistogramExplanation 1 DICOM +(0060,3020) UL HistogramData 1-n DICOM +(0062,0001) CS SegmentationType 1 DICOM +(0062,0002) SQ SegmentSequence 1 DICOM +(0062,0003) SQ SegmentedPropertyCategoryCodeSequence 1 DICOM +(0062,0004) US SegmentNumber 1 DICOM +(0062,0005) LO SegmentLabel 1 DICOM +(0062,0006) ST SegmentDescription 1 DICOM +(0062,0007) SQ SegmentationAlgorithmIdentificationSequence 1 DICOM +(0062,0008) CS SegmentAlgorithmType 1 DICOM +(0062,0009) LO SegmentAlgorithmName 1 DICOM +(0062,000A) SQ SegmentIdentificationSequence 1 DICOM +(0062,000B) US ReferencedSegmentNumber 1-n DICOM +(0062,000C) US RecommendedDisplayGrayscaleValue 1 DICOM +(0062,000D) US RecommendedDisplayCIELabValue 3 DICOM +(0062,000E) US MaximumFractionalValue 1 DICOM +(0062,000F) SQ SegmentedPropertyTypeCodeSequence 1 DICOM +(0062,0010) CS SegmentationFractionalType 1 DICOM +(0062,0011) SQ SegmentedPropertyTypeModifierCodeSequence 1 DICOM +(0062,0012) SQ UsedSegmentsSequence 1 DICOM +(0062,0013) CS SegmentsOverlap 1 DICOM +(0062,0020) UT TrackingID 1 DICOM +(0062,0021) UI TrackingUID 1 DICOM +(0064,0002) SQ DeformableRegistrationSequence 1 DICOM +(0064,0003) UI SourceFrameOfReferenceUID 1 DICOM +(0064,0005) SQ DeformableRegistrationGridSequence 1 DICOM +(0064,0007) UL GridDimensions 3 DICOM +(0064,0008) FD GridResolution 3 DICOM +(0064,0009) OF VectorGridData 1 DICOM +(0064,000F) SQ PreDeformationMatrixRegistrationSequence 1 DICOM +(0064,0010) SQ PostDeformationMatrixRegistrationSequence 1 DICOM +(0066,0001) UL NumberOfSurfaces 1 DICOM +(0066,0002) SQ SurfaceSequence 1 DICOM +(0066,0003) UL SurfaceNumber 1 DICOM +(0066,0004) LT SurfaceComments 1 DICOM +(0066,0009) CS SurfaceProcessing 1 DICOM +(0066,000A) FL SurfaceProcessingRatio 1 DICOM +(0066,000B) LO SurfaceProcessingDescription 1 DICOM +(0066,000C) FL RecommendedPresentationOpacity 1 DICOM +(0066,000D) CS RecommendedPresentationType 1 DICOM +(0066,000E) CS FiniteVolume 1 DICOM +(0066,0010) CS Manifold 1 DICOM +(0066,0011) SQ SurfacePointsSequence 1 DICOM +(0066,0012) SQ SurfacePointsNormalsSequence 1 DICOM +(0066,0013) SQ SurfaceMeshPrimitivesSequence 1 DICOM +(0066,0015) UL NumberOfSurfacePoints 1 DICOM +(0066,0016) OF PointCoordinatesData 1 DICOM +(0066,0017) FL PointPositionAccuracy 3 DICOM +(0066,0018) FL MeanPointDistance 1 DICOM +(0066,0019) FL MaximumPointDistance 1 DICOM +(0066,001A) FL PointsBoundingBoxCoordinates 6 DICOM +(0066,001B) FL AxisOfRotation 3 DICOM +(0066,001C) FL CenterOfRotation 3 DICOM +(0066,001E) UL NumberOfVectors 1 DICOM +(0066,001F) US VectorDimensionality 1 DICOM +(0066,0020) FL VectorAccuracy 1-n DICOM +(0066,0021) OF VectorCoordinateData 1 DICOM +(0066,0026) SQ TriangleStripSequence 1 DICOM +(0066,0027) SQ TriangleFanSequence 1 DICOM +(0066,0028) SQ LineSequence 1 DICOM +(0066,002A) UL SurfaceCount 1 DICOM +(0066,002B) SQ ReferencedSurfaceSequence 1 DICOM +(0066,002C) UL ReferencedSurfaceNumber 1 DICOM +(0066,002D) SQ SegmentSurfaceGenerationAlgorithmIdentificationSequence 1 DICOM +(0066,002E) SQ SegmentSurfaceSourceInstanceSequence 1 DICOM +(0066,002F) SQ AlgorithmFamilyCodeSequence 1 DICOM +(0066,0030) SQ AlgorithmNameCodeSequence 1 DICOM +(0066,0031) LO AlgorithmVersion 1 DICOM +(0066,0032) LT AlgorithmParameters 1 DICOM +(0066,0034) SQ FacetSequence 1 DICOM +(0066,0035) SQ SurfaceProcessingAlgorithmIdentificationSequence 1 DICOM +(0066,0036) LO AlgorithmName 1 DICOM +(0066,0037) FL RecommendedPointRadius 1 DICOM +(0066,0038) FL RecommendedLineThickness 1 DICOM +(0066,0040) OL LongPrimitivePointIndexList 1 DICOM +(0066,0041) OL LongTrianglePointIndexList 1 DICOM +(0066,0042) OL LongEdgePointIndexList 1 DICOM +(0066,0043) OL LongVertexPointIndexList 1 DICOM +(0066,0101) SQ TrackSetSequence 1 DICOM +(0066,0102) SQ TrackSequence 1 DICOM +(0066,0103) OW RecommendedDisplayCIELabValueList 1 DICOM +(0066,0104) SQ TrackingAlgorithmIdentificationSequence 1 DICOM +(0066,0105) UL TrackSetNumber 1 DICOM +(0066,0106) LO TrackSetLabel 1 DICOM +(0066,0107) UT TrackSetDescription 1 DICOM +(0066,0108) SQ TrackSetAnatomicalTypeCodeSequence 1 DICOM +(0066,0121) SQ MeasurementsSequence 1 DICOM +(0066,0124) SQ TrackSetStatisticsSequence 1 DICOM +(0066,0125) OF FloatingPointValues 1 DICOM +(0066,0129) OL TrackPointIndexList 1 DICOM +(0066,0130) SQ TrackStatisticsSequence 1 DICOM +(0066,0132) SQ MeasurementValuesSequence 1 DICOM +(0066,0133) SQ DiffusionAcquisitionCodeSequence 1 DICOM +(0066,0134) SQ DiffusionModelCodeSequence 1 DICOM +(0068,6210) LO ImplantSize 1 DICOM +(0068,6221) LO ImplantTemplateVersion 1 DICOM +(0068,6222) SQ ReplacedImplantTemplateSequence 1 DICOM +(0068,6223) CS ImplantType 1 DICOM +(0068,6224) SQ DerivationImplantTemplateSequence 1 DICOM +(0068,6225) SQ OriginalImplantTemplateSequence 1 DICOM +(0068,6226) DT EffectiveDateTime 1 DICOM +(0068,6230) SQ ImplantTargetAnatomySequence 1 DICOM +(0068,6260) SQ InformationFromManufacturerSequence 1 DICOM +(0068,6265) SQ NotificationFromManufacturerSequence 1 DICOM +(0068,6270) DT InformationIssueDateTime 1 DICOM +(0068,6280) ST InformationSummary 1 DICOM +(0068,62A0) SQ ImplantRegulatoryDisapprovalCodeSequence 1 DICOM +(0068,62A5) FD OverallTemplateSpatialTolerance 1 DICOM +(0068,62C0) SQ HPGLDocumentSequence 1 DICOM +(0068,62D0) US HPGLDocumentID 1 DICOM +(0068,62D5) LO HPGLDocumentLabel 1 DICOM +(0068,62E0) SQ ViewOrientationCodeSequence 1 DICOM +(0068,62F0) SQ ViewOrientationModifierCodeSequence 1 DICOM +(0068,62F2) FD HPGLDocumentScaling 1 DICOM +(0068,6300) OB HPGLDocument 1 DICOM +(0068,6310) US HPGLContourPenNumber 1 DICOM +(0068,6320) SQ HPGLPenSequence 1 DICOM +(0068,6330) US HPGLPenNumber 1 DICOM +(0068,6340) LO HPGLPenLabel 1 DICOM +(0068,6345) ST HPGLPenDescription 1 DICOM +(0068,6346) FD RecommendedRotationPoint 2 DICOM +(0068,6347) FD BoundingRectangle 4 DICOM +(0068,6350) US ImplantTemplate3DModelSurfaceNumber 1-n DICOM +(0068,6360) SQ SurfaceModelDescriptionSequence 1 DICOM +(0068,6380) LO SurfaceModelLabel 1 DICOM +(0068,6390) FD SurfaceModelScalingFactor 1 DICOM +(0068,63A0) SQ MaterialsCodeSequence 1 DICOM +(0068,63A4) SQ CoatingMaterialsCodeSequence 1 DICOM +(0068,63A8) SQ ImplantTypeCodeSequence 1 DICOM +(0068,63AC) SQ FixationMethodCodeSequence 1 DICOM +(0068,63B0) SQ MatingFeatureSetsSequence 1 DICOM +(0068,63C0) US MatingFeatureSetID 1 DICOM +(0068,63D0) LO MatingFeatureSetLabel 1 DICOM +(0068,63E0) SQ MatingFeatureSequence 1 DICOM +(0068,63F0) US MatingFeatureID 1 DICOM +(0068,6400) SQ MatingFeatureDegreeOfFreedomSequence 1 DICOM +(0068,6410) US DegreeOfFreedomID 1 DICOM +(0068,6420) CS DegreeOfFreedomType 1 DICOM +(0068,6430) SQ TwoDMatingFeatureCoordinatesSequence 1 DICOM +(0068,6440) US ReferencedHPGLDocumentID 1 DICOM +(0068,6450) FD TwoDMatingPoint 2 DICOM +(0068,6460) FD TwoDMatingAxes 4 DICOM +(0068,6470) SQ TwoDDegreeOfFreedomSequence 1 DICOM +(0068,6490) FD ThreeDDegreeOfFreedomAxis 3 DICOM +(0068,64A0) FD RangeOfFreedom 2 DICOM +(0068,64C0) FD ThreeDMatingPoint 3 DICOM +(0068,64D0) FD ThreeDMatingAxes 9 DICOM +(0068,64F0) FD TwoDDegreeOfFreedomAxis 3 DICOM +(0068,6500) SQ PlanningLandmarkPointSequence 1 DICOM +(0068,6510) SQ PlanningLandmarkLineSequence 1 DICOM +(0068,6520) SQ PlanningLandmarkPlaneSequence 1 DICOM +(0068,6530) US PlanningLandmarkID 1 DICOM +(0068,6540) LO PlanningLandmarkDescription 1 DICOM +(0068,6545) SQ PlanningLandmarkIdentificationCodeSequence 1 DICOM +(0068,6550) SQ TwoDPointCoordinatesSequence 1 DICOM +(0068,6560) FD TwoDPointCoordinates 2 DICOM +(0068,6590) FD ThreeDPointCoordinates 3 DICOM +(0068,65A0) SQ TwoDLineCoordinatesSequence 1 DICOM +(0068,65B0) FD TwoDLineCoordinates 4 DICOM +(0068,65D0) FD ThreeDLineCoordinates 6 DICOM +(0068,65E0) SQ TwoDPlaneCoordinatesSequence 1 DICOM +(0068,65F0) FD TwoDPlaneIntersection 4 DICOM +(0068,6610) FD ThreeDPlaneOrigin 3 DICOM +(0068,6620) FD ThreeDPlaneNormal 3 DICOM +(0068,7001) CS ModelModification 1 DICOM +(0068,7002) CS ModelMirroring 1 DICOM +(0068,7003) SQ ModelUsageCodeSequence 1 DICOM +(0070,0001) SQ GraphicAnnotationSequence 1 DICOM +(0070,0002) CS GraphicLayer 1 DICOM +(0070,0003) CS BoundingBoxAnnotationUnits 1 DICOM +(0070,0004) CS AnchorPointAnnotationUnits 1 DICOM +(0070,0005) CS GraphicAnnotationUnits 1 DICOM +(0070,0006) ST UnformattedTextValue 1 DICOM +(0070,0008) SQ TextObjectSequence 1 DICOM +(0070,0009) SQ GraphicObjectSequence 1 DICOM +(0070,0010) FL BoundingBoxTopLeftHandCorner 2 DICOM +(0070,0011) FL BoundingBoxBottomRightHandCorner 2 DICOM +(0070,0012) CS BoundingBoxTextHorizontalJustification 1 DICOM +(0070,0014) FL AnchorPoint 2 DICOM +(0070,0015) CS AnchorPointVisibility 1 DICOM +(0070,0020) US GraphicDimensions 1 DICOM +(0070,0021) US NumberOfGraphicPoints 1 DICOM +(0070,0022) FL GraphicData 2-n DICOM +(0070,0023) CS GraphicType 1 DICOM +(0070,0024) CS GraphicFilled 1 DICOM +(0070,0041) CS ImageHorizontalFlip 1 DICOM +(0070,0042) US ImageRotation 1 DICOM +(0070,0052) SL DisplayedAreaTopLeftHandCorner 2 DICOM +(0070,0053) SL DisplayedAreaBottomRightHandCorner 2 DICOM +(0070,005A) SQ DisplayedAreaSelectionSequence 1 DICOM +(0070,0060) SQ GraphicLayerSequence 1 DICOM +(0070,0062) IS GraphicLayerOrder 1 DICOM +(0070,0066) US GraphicLayerRecommendedDisplayGrayscaleValue 1 DICOM +(0070,0068) LO GraphicLayerDescription 1 DICOM +(0070,0080) CS ContentLabel 1 DICOM +(0070,0081) LO ContentDescription 1 DICOM +(0070,0082) DA PresentationCreationDate 1 DICOM +(0070,0083) TM PresentationCreationTime 1 DICOM +(0070,0084) PN ContentCreatorName 1 DICOM +(0070,0086) SQ ContentCreatorIdentificationCodeSequence 1 DICOM +(0070,0087) SQ AlternateContentDescriptionSequence 1 DICOM +(0070,0100) CS PresentationSizeMode 1 DICOM +(0070,0101) DS PresentationPixelSpacing 2 DICOM +(0070,0102) IS PresentationPixelAspectRatio 2 DICOM +(0070,0103) FL PresentationPixelMagnificationRatio 1 DICOM +(0070,0207) LO GraphicGroupLabel 1 DICOM +(0070,0208) ST GraphicGroupDescription 1 DICOM +(0070,0209) SQ CompoundGraphicSequence 1 DICOM +(0070,0226) UL CompoundGraphicInstanceID 1 DICOM +(0070,0227) LO FontName 1 DICOM +(0070,0228) CS FontNameType 1 DICOM +(0070,0229) LO CSSFontName 1 DICOM +(0070,0230) FD RotationAngle 1 DICOM +(0070,0231) SQ TextStyleSequence 1 DICOM +(0070,0232) SQ LineStyleSequence 1 DICOM +(0070,0233) SQ FillStyleSequence 1 DICOM +(0070,0234) SQ GraphicGroupSequence 1 DICOM +(0070,0241) US TextColorCIELabValue 3 DICOM +(0070,0242) CS HorizontalAlignment 1 DICOM +(0070,0243) CS VerticalAlignment 1 DICOM +(0070,0244) CS ShadowStyle 1 DICOM +(0070,0245) FL ShadowOffsetX 1 DICOM +(0070,0246) FL ShadowOffsetY 1 DICOM +(0070,0247) US ShadowColorCIELabValue 3 DICOM +(0070,0248) CS Underlined 1 DICOM +(0070,0249) CS Bold 1 DICOM +(0070,0250) CS Italic 1 DICOM +(0070,0251) US PatternOnColorCIELabValue 3 DICOM +(0070,0252) US PatternOffColorCIELabValue 3 DICOM +(0070,0253) FL LineThickness 1 DICOM +(0070,0254) CS LineDashingStyle 1 DICOM +(0070,0255) UL LinePattern 1 DICOM +(0070,0256) OB FillPattern 1 DICOM +(0070,0257) CS FillMode 1 DICOM +(0070,0258) FL ShadowOpacity 1 DICOM +(0070,0261) FL GapLength 1 DICOM +(0070,0262) FL DiameterOfVisibility 1 DICOM +(0070,0273) FL RotationPoint 2 DICOM +(0070,0274) CS TickAlignment 1 DICOM +(0070,0278) CS ShowTickLabel 1 DICOM +(0070,0279) CS TickLabelAlignment 1 DICOM +(0070,0282) CS CompoundGraphicUnits 1 DICOM +(0070,0284) FL PatternOnOpacity 1 DICOM +(0070,0285) FL PatternOffOpacity 1 DICOM +(0070,0287) SQ MajorTicksSequence 1 DICOM +(0070,0288) FL TickPosition 1 DICOM +(0070,0289) SH TickLabel 1 DICOM +(0070,0294) CS CompoundGraphicType 1 DICOM +(0070,0295) UL GraphicGroupID 1 DICOM +(0070,0306) CS ShapeType 1 DICOM +(0070,0308) SQ RegistrationSequence 1 DICOM +(0070,0309) SQ MatrixRegistrationSequence 1 DICOM +(0070,030A) SQ MatrixSequence 1 DICOM +(0070,030B) FD FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix 16 DICOM +(0070,030C) CS FrameOfReferenceTransformationMatrixType 1 DICOM +(0070,030D) SQ RegistrationTypeCodeSequence 1 DICOM +(0070,030F) ST FiducialDescription 1 DICOM +(0070,0310) SH FiducialIdentifier 1 DICOM +(0070,0311) SQ FiducialIdentifierCodeSequence 1 DICOM +(0070,0312) FD ContourUncertaintyRadius 1 DICOM +(0070,0314) SQ UsedFiducialsSequence 1 DICOM +(0070,0318) SQ GraphicCoordinatesDataSequence 1 DICOM +(0070,031A) UI FiducialUID 1 DICOM +(0070,031B) UI ReferencedFiducialUID 1 DICOM +(0070,031C) SQ FiducialSetSequence 1 DICOM +(0070,031E) SQ FiducialSequence 1 DICOM +(0070,031F) SQ FiducialsPropertyCategoryCodeSequence 1 DICOM +(0070,0401) US GraphicLayerRecommendedDisplayCIELabValue 3 DICOM +(0070,0402) SQ BlendingSequence 1 DICOM +(0070,0403) FL RelativeOpacity 1 DICOM +(0070,0404) SQ ReferencedSpatialRegistrationSequence 1 DICOM +(0070,0405) CS BlendingPosition 1 DICOM +(0070,1101) UI PresentationDisplayCollectionUID 1 DICOM +(0070,1102) UI PresentationSequenceCollectionUID 1 DICOM +(0070,1103) US PresentationSequencePositionIndex 1 DICOM +(0070,1104) SQ RenderedImageReferenceSequence 1 DICOM +(0070,1201) SQ VolumetricPresentationStateInputSequence 1 DICOM +(0070,1202) CS PresentationInputType 1 DICOM +(0070,1203) US InputSequencePositionIndex 1 DICOM +(0070,1204) CS Crop 1 DICOM +(0070,1205) US CroppingSpecificationIndex 1-n DICOM +(0070,1207) US VolumetricPresentationInputNumber 1 DICOM +(0070,1208) CS ImageVolumeGeometry 1 DICOM +(0070,1209) UI VolumetricPresentationInputSetUID 1 DICOM +(0070,120A) SQ VolumetricPresentationInputSetSequence 1 DICOM +(0070,120B) CS GlobalCrop 1 DICOM +(0070,120C) US GlobalCroppingSpecificationIndex 1-n DICOM +(0070,120D) CS RenderingMethod 1 DICOM +(0070,1301) SQ VolumeCroppingSequence 1 DICOM +(0070,1302) CS VolumeCroppingMethod 1 DICOM +(0070,1303) FD BoundingBoxCrop 6 DICOM +(0070,1304) SQ ObliqueCroppingPlaneSequence 1 DICOM +(0070,1305) FD Plane 4 DICOM +(0070,1306) FD PlaneNormal 3 DICOM +(0070,1309) US CroppingSpecificationNumber 1 DICOM +(0070,1501) CS MultiPlanarReconstructionStyle 1 DICOM +(0070,1502) CS MPRThicknessType 1 DICOM +(0070,1503) FD MPRSlabThickness 1 DICOM +(0070,1505) FD MPRTopLeftHandCorner 3 DICOM +(0070,1507) FD MPRViewWidthDirection 3 DICOM +(0070,1508) FD MPRViewWidth 1 DICOM +(0070,150C) UL NumberOfVolumetricCurvePoints 1 DICOM +(0070,150D) OD VolumetricCurvePoints 1 DICOM +(0070,1511) FD MPRViewHeightDirection 3 DICOM +(0070,1512) FD MPRViewHeight 1 DICOM +(0070,1602) CS RenderProjection 1 DICOM +(0070,1603) FD ViewpointPosition 3 DICOM +(0070,1604) FD ViewpointLookAtPoint 3 DICOM +(0070,1605) FD ViewpointUpDirection 3 DICOM +(0070,1606) FD RenderFieldOfView 6 DICOM +(0070,1607) FD SamplingStepSize 1 DICOM +(0070,1701) CS ShadingStyle 1 DICOM +(0070,1702) FD AmbientReflectionIntensity 1 DICOM +(0070,1703) FD LightDirection 3 DICOM +(0070,1704) FD DiffuseReflectionIntensity 1 DICOM +(0070,1705) FD SpecularReflectionIntensity 1 DICOM +(0070,1706) FD Shininess 1 DICOM +(0070,1801) SQ PresentationStateClassificationComponentSequence 1 DICOM +(0070,1802) CS ComponentType 1 DICOM +(0070,1803) SQ ComponentInputSequence 1 DICOM +(0070,1804) US VolumetricPresentationInputIndex 1 DICOM +(0070,1805) SQ PresentationStateCompositorComponentSequence 1 DICOM +(0070,1806) SQ WeightingTransferFunctionSequence 1 DICOM +(0070,1807) US WeightingLookupTableDescriptor 3 DICOM +(0070,1808) OB WeightingLookupTableData 1 DICOM +(0070,1901) SQ VolumetricAnnotationSequence 1 DICOM +(0070,1903) SQ ReferencedStructuredContextSequence 1 DICOM +(0070,1904) UI ReferencedContentItem 1 DICOM +(0070,1905) SQ VolumetricPresentationInputAnnotationSequence 1 DICOM +(0070,1907) CS AnnotationClipping 1 DICOM +(0070,1A01) CS PresentationAnimationStyle 1 DICOM +(0070,1A03) FD RecommendedAnimationRate 1 DICOM +(0070,1A04) SQ AnimationCurveSequence 1 DICOM +(0070,1A05) FD AnimationStepSize 1 DICOM +(0070,1A06) FD SwivelRange 1 DICOM +(0070,1A07) OD VolumetricCurveUpDirections 1 DICOM +(0070,1A08) SQ VolumeStreamSequence 1 DICOM +(0070,1A09) LO RGBATransferFunctionDescription 1 DICOM +(0070,1B01) SQ AdvancedBlendingSequence 1 DICOM +(0070,1B02) US BlendingInputNumber 1 DICOM +(0070,1B03) SQ BlendingDisplayInputSequence 1 DICOM +(0070,1B04) SQ BlendingDisplaySequence 1 DICOM +(0070,1B06) CS BlendingMode 1 DICOM +(0070,1B07) CS TimeSeriesBlending 1 DICOM +(0070,1B08) CS GeometryForDisplay 1 DICOM +(0070,1B11) SQ ThresholdSequence 1 DICOM +(0070,1B12) SQ ThresholdValueSequence 1 DICOM +(0070,1B13) CS ThresholdType 1 DICOM +(0070,1B14) FD ThresholdValue 1 DICOM +(0072,0002) SH HangingProtocolName 1 DICOM +(0072,0004) LO HangingProtocolDescription 1 DICOM +(0072,0006) CS HangingProtocolLevel 1 DICOM +(0072,0008) LO HangingProtocolCreator 1 DICOM +(0072,000A) DT HangingProtocolCreationDateTime 1 DICOM +(0072,000C) SQ HangingProtocolDefinitionSequence 1 DICOM +(0072,000E) SQ HangingProtocolUserIdentificationCodeSequence 1 DICOM +(0072,0010) LO HangingProtocolUserGroupName 1 DICOM +(0072,0012) SQ SourceHangingProtocolSequence 1 DICOM +(0072,0014) US NumberOfPriorsReferenced 1 DICOM +(0072,0020) SQ ImageSetsSequence 1 DICOM +(0072,0022) SQ ImageSetSelectorSequence 1 DICOM +(0072,0024) CS ImageSetSelectorUsageFlag 1 DICOM +(0072,0026) AT SelectorAttribute 1 DICOM +(0072,0028) US SelectorValueNumber 1 DICOM +(0072,0030) SQ TimeBasedImageSetsSequence 1 DICOM +(0072,0032) US ImageSetNumber 1 DICOM +(0072,0034) CS ImageSetSelectorCategory 1 DICOM +(0072,0038) US RelativeTime 2 DICOM +(0072,003A) CS RelativeTimeUnits 1 DICOM +(0072,003C) SS AbstractPriorValue 2 DICOM +(0072,003E) SQ AbstractPriorCodeSequence 1 DICOM +(0072,0040) LO ImageSetLabel 1 DICOM +(0072,0050) CS SelectorAttributeVR 1 DICOM +(0072,0052) AT SelectorSequencePointer 1-n DICOM +(0072,0054) LO SelectorSequencePointerPrivateCreator 1-n DICOM +(0072,0056) LO SelectorAttributePrivateCreator 1 DICOM +(0072,005E) AE SelectorAEValue 1-n DICOM +(0072,005F) AS SelectorASValue 1-n DICOM +(0072,0060) AT SelectorATValue 1-n DICOM +(0072,0061) DA SelectorDAValue 1-n DICOM +(0072,0062) CS SelectorCSValue 1-n DICOM +(0072,0063) DT SelectorDTValue 1-n DICOM +(0072,0064) IS SelectorISValue 1-n DICOM +(0072,0065) OB SelectorOBValue 1 DICOM +(0072,0066) LO SelectorLOValue 1-n DICOM +(0072,0067) OF SelectorOFValue 1 DICOM +(0072,0068) LT SelectorLTValue 1 DICOM +(0072,0069) OW SelectorOWValue 1 DICOM +(0072,006A) PN SelectorPNValue 1-n DICOM +(0072,006B) TM SelectorTMValue 1-n DICOM +(0072,006C) SH SelectorSHValue 1-n DICOM +(0072,006D) UN SelectorUNValue 1 DICOM +(0072,006E) ST SelectorSTValue 1 DICOM +(0072,006F) UC SelectorUCValue 1-n DICOM +(0072,0070) UT SelectorUTValue 1 DICOM +(0072,0071) UR SelectorURValue 1 DICOM +(0072,0072) DS SelectorDSValue 1-n DICOM +(0072,0073) OD SelectorODValue 1 DICOM +(0072,0074) FD SelectorFDValue 1-n DICOM +(0072,0075) OL SelectorOLValue 1 DICOM +(0072,0076) FL SelectorFLValue 1-n DICOM +(0072,0078) UL SelectorULValue 1-n DICOM +(0072,007A) US SelectorUSValue 1-n DICOM +(0072,007C) SL SelectorSLValue 1-n DICOM +(0072,007E) SS SelectorSSValue 1-n DICOM +(0072,007F) UI SelectorUIValue 1-n DICOM +(0072,0080) SQ SelectorCodeSequenceValue 1 DICOM +(0072,0100) US NumberOfScreens 1 DICOM +(0072,0102) SQ NominalScreenDefinitionSequence 1 DICOM +(0072,0104) US NumberOfVerticalPixels 1 DICOM +(0072,0106) US NumberOfHorizontalPixels 1 DICOM +(0072,0108) FD DisplayEnvironmentSpatialPosition 4 DICOM +(0072,010A) US ScreenMinimumGrayscaleBitDepth 1 DICOM +(0072,010C) US ScreenMinimumColorBitDepth 1 DICOM +(0072,010E) US ApplicationMaximumRepaintTime 1 DICOM +(0072,0200) SQ DisplaySetsSequence 1 DICOM +(0072,0202) US DisplaySetNumber 1 DICOM +(0072,0203) LO DisplaySetLabel 1 DICOM +(0072,0204) US DisplaySetPresentationGroup 1 DICOM +(0072,0206) LO DisplaySetPresentationGroupDescription 1 DICOM +(0072,0208) CS PartialDataDisplayHandling 1 DICOM +(0072,0210) SQ SynchronizedScrollingSequence 1 DICOM +(0072,0212) US DisplaySetScrollingGroup 2-n DICOM +(0072,0214) SQ NavigationIndicatorSequence 1 DICOM +(0072,0216) US NavigationDisplaySet 1 DICOM +(0072,0218) US ReferenceDisplaySets 1-n DICOM +(0072,0300) SQ ImageBoxesSequence 1 DICOM +(0072,0302) US ImageBoxNumber 1 DICOM +(0072,0304) CS ImageBoxLayoutType 1 DICOM +(0072,0306) US ImageBoxTileHorizontalDimension 1 DICOM +(0072,0308) US ImageBoxTileVerticalDimension 1 DICOM +(0072,0310) CS ImageBoxScrollDirection 1 DICOM +(0072,0312) CS ImageBoxSmallScrollType 1 DICOM +(0072,0314) US ImageBoxSmallScrollAmount 1 DICOM +(0072,0316) CS ImageBoxLargeScrollType 1 DICOM +(0072,0318) US ImageBoxLargeScrollAmount 1 DICOM +(0072,0320) US ImageBoxOverlapPriority 1 DICOM +(0072,0330) FD CineRelativeToRealTime 1 DICOM +(0072,0400) SQ FilterOperationsSequence 1 DICOM +(0072,0402) CS FilterByCategory 1 DICOM +(0072,0404) CS FilterByAttributePresence 1 DICOM +(0072,0406) CS FilterByOperator 1 DICOM +(0072,0420) US StructuredDisplayBackgroundCIELabValue 3 DICOM +(0072,0421) US EmptyImageBoxCIELabValue 3 DICOM +(0072,0422) SQ StructuredDisplayImageBoxSequence 1 DICOM +(0072,0424) SQ StructuredDisplayTextBoxSequence 1 DICOM +(0072,0427) SQ ReferencedFirstFrameSequence 1 DICOM +(0072,0430) SQ ImageBoxSynchronizationSequence 1 DICOM +(0072,0432) US SynchronizedImageBoxList 2-n DICOM +(0072,0434) CS TypeOfSynchronization 1 DICOM +(0072,0500) CS BlendingOperationType 1 DICOM +(0072,0510) CS ReformattingOperationType 1 DICOM +(0072,0512) FD ReformattingThickness 1 DICOM +(0072,0514) FD ReformattingInterval 1 DICOM +(0072,0516) CS ReformattingOperationInitialViewDirection 1 DICOM +(0072,0520) CS ThreeDRenderingType 1-n DICOM +(0072,0600) SQ SortingOperationsSequence 1 DICOM +(0072,0602) CS SortByCategory 1 DICOM +(0072,0604) CS SortingDirection 1 DICOM +(0072,0700) CS DisplaySetPatientOrientation 2 DICOM +(0072,0702) CS VOIType 1 DICOM +(0072,0704) CS PseudoColorType 1 DICOM +(0072,0705) SQ PseudoColorPaletteInstanceReferenceSequence 1 DICOM +(0072,0706) CS ShowGrayscaleInverted 1 DICOM +(0072,0710) CS ShowImageTrueSizeFlag 1 DICOM +(0072,0712) CS ShowGraphicAnnotationFlag 1 DICOM +(0072,0714) CS ShowPatientDemographicsFlag 1 DICOM +(0072,0716) CS ShowAcquisitionTechniquesFlag 1 DICOM +(0072,0717) CS DisplaySetHorizontalJustification 1 DICOM +(0072,0718) CS DisplaySetVerticalJustification 1 DICOM +(0074,0120) FD ContinuationStartMeterset 1 DICOM +(0074,0121) FD ContinuationEndMeterset 1 DICOM +(0074,1000) CS ProcedureStepState 1 DICOM +(0074,1002) SQ ProcedureStepProgressInformationSequence 1 DICOM +(0074,1004) DS ProcedureStepProgress 1 DICOM +(0074,1006) ST ProcedureStepProgressDescription 1 DICOM +(0074,1007) SQ ProcedureStepProgressParametersSequence 1 DICOM +(0074,1008) SQ ProcedureStepCommunicationsURISequence 1 DICOM +(0074,100A) UR ContactURI 1 DICOM +(0074,100C) LO ContactDisplayName 1 DICOM +(0074,100E) SQ ProcedureStepDiscontinuationReasonCodeSequence 1 DICOM +(0074,1020) SQ BeamTaskSequence 1 DICOM +(0074,1022) CS BeamTaskType 1 DICOM +(0074,1025) CS AutosequenceFlag 1 DICOM +(0074,1026) FD TableTopVerticalAdjustedPosition 1 DICOM +(0074,1027) FD TableTopLongitudinalAdjustedPosition 1 DICOM +(0074,1028) FD TableTopLateralAdjustedPosition 1 DICOM +(0074,102A) FD PatientSupportAdjustedAngle 1 DICOM +(0074,102B) FD TableTopEccentricAdjustedAngle 1 DICOM +(0074,102C) FD TableTopPitchAdjustedAngle 1 DICOM +(0074,102D) FD TableTopRollAdjustedAngle 1 DICOM +(0074,1030) SQ DeliveryVerificationImageSequence 1 DICOM +(0074,1032) CS VerificationImageTiming 1 DICOM +(0074,1034) CS DoubleExposureFlag 1 DICOM +(0074,1036) CS DoubleExposureOrdering 1 DICOM +(0074,1040) SQ RelatedReferenceRTImageSequence 1 DICOM +(0074,1042) SQ GeneralMachineVerificationSequence 1 DICOM +(0074,1044) SQ ConventionalMachineVerificationSequence 1 DICOM +(0074,1046) SQ IonMachineVerificationSequence 1 DICOM +(0074,1048) SQ FailedAttributesSequence 1 DICOM +(0074,104A) SQ OverriddenAttributesSequence 1 DICOM +(0074,104C) SQ ConventionalControlPointVerificationSequence 1 DICOM +(0074,104E) SQ IonControlPointVerificationSequence 1 DICOM +(0074,1050) SQ AttributeOccurrenceSequence 1 DICOM +(0074,1052) AT AttributeOccurrencePointer 1 DICOM +(0074,1054) UL AttributeItemSelector 1 DICOM +(0074,1056) LO AttributeOccurrencePrivateCreator 1 DICOM +(0074,1057) IS SelectorSequencePointerItems 1-n DICOM +(0074,1200) CS ScheduledProcedureStepPriority 1 DICOM +(0074,1202) LO WorklistLabel 1 DICOM +(0074,1204) LO ProcedureStepLabel 1 DICOM +(0074,1210) SQ ScheduledProcessingParametersSequence 1 DICOM +(0074,1212) SQ PerformedProcessingParametersSequence 1 DICOM +(0074,1216) SQ UnifiedProcedureStepPerformedProcedureSequence 1 DICOM +(0074,1224) SQ ReplacedProcedureStepSequence 1 DICOM +(0074,1230) LO DeletionLock 1 DICOM +(0074,1234) AE ReceivingAE 1 DICOM +(0074,1236) AE RequestingAE 1 DICOM +(0074,1238) LT ReasonForCancellation 1 DICOM +(0074,1242) CS SCPStatus 1 DICOM +(0074,1244) CS SubscriptionListStatus 1 DICOM +(0074,1246) CS UnifiedProcedureStepListStatus 1 DICOM +(0074,1324) UL BeamOrderIndex 1 DICOM +(0074,1338) FD DoubleExposureMeterset 1 DICOM +(0074,133A) FD DoubleExposureFieldDelta 4 DICOM +(0074,1401) SQ BrachyTaskSequence 1 DICOM +(0074,1402) DS ContinuationStartTotalReferenceAirKerma 1 DICOM +(0074,1403) DS ContinuationEndTotalReferenceAirKerma 1 DICOM +(0074,1404) IS ContinuationPulseNumber 1 DICOM +(0074,1405) SQ ChannelDeliveryOrderSequence 1 DICOM +(0074,1406) IS ReferencedChannelNumber 1 DICOM +(0074,1407) DS StartCumulativeTimeWeight 1 DICOM +(0074,1408) DS EndCumulativeTimeWeight 1 DICOM +(0074,1409) SQ OmittedChannelSequence 1 DICOM +(0074,140A) CS ReasonForChannelOmission 1 DICOM +(0074,140B) LO ReasonForChannelOmissionDescription 1 DICOM +(0074,140C) IS ChannelDeliveryOrderIndex 1 DICOM +(0074,140D) SQ ChannelDeliveryContinuationSequence 1 DICOM +(0074,140E) SQ OmittedApplicationSetupSequence 1 DICOM +(0076,0001) LO ImplantAssemblyTemplateName 1 DICOM +(0076,0003) LO ImplantAssemblyTemplateIssuer 1 DICOM +(0076,0006) LO ImplantAssemblyTemplateVersion 1 DICOM +(0076,0008) SQ ReplacedImplantAssemblyTemplateSequence 1 DICOM +(0076,000A) CS ImplantAssemblyTemplateType 1 DICOM +(0076,000C) SQ OriginalImplantAssemblyTemplateSequence 1 DICOM +(0076,000E) SQ DerivationImplantAssemblyTemplateSequence 1 DICOM +(0076,0010) SQ ImplantAssemblyTemplateTargetAnatomySequence 1 DICOM +(0076,0020) SQ ProcedureTypeCodeSequence 1 DICOM +(0076,0030) LO SurgicalTechnique 1 DICOM +(0076,0032) SQ ComponentTypesSequence 1 DICOM +(0076,0034) SQ ComponentTypeCodeSequence 1 DICOM +(0076,0036) CS ExclusiveComponentType 1 DICOM +(0076,0038) CS MandatoryComponentType 1 DICOM +(0076,0040) SQ ComponentSequence 1 DICOM +(0076,0055) US ComponentID 1 DICOM +(0076,0060) SQ ComponentAssemblySequence 1 DICOM +(0076,0070) US Component1ReferencedID 1 DICOM +(0076,0080) US Component1ReferencedMatingFeatureSetID 1 DICOM +(0076,0090) US Component1ReferencedMatingFeatureID 1 DICOM +(0076,00A0) US Component2ReferencedID 1 DICOM +(0076,00B0) US Component2ReferencedMatingFeatureSetID 1 DICOM +(0076,00C0) US Component2ReferencedMatingFeatureID 1 DICOM +(0078,0001) LO ImplantTemplateGroupName 1 DICOM +(0078,0010) ST ImplantTemplateGroupDescription 1 DICOM +(0078,0020) LO ImplantTemplateGroupIssuer 1 DICOM +(0078,0024) LO ImplantTemplateGroupVersion 1 DICOM +(0078,0026) SQ ReplacedImplantTemplateGroupSequence 1 DICOM +(0078,0028) SQ ImplantTemplateGroupTargetAnatomySequence 1 DICOM +(0078,002A) SQ ImplantTemplateGroupMembersSequence 1 DICOM +(0078,002E) US ImplantTemplateGroupMemberID 1 DICOM +(0078,0050) FD ThreeDImplantTemplateGroupMemberMatchingPoint 3 DICOM +(0078,0060) FD ThreeDImplantTemplateGroupMemberMatchingAxes 9 DICOM +(0078,0070) SQ ImplantTemplateGroupMemberMatching2DCoordinatesSequence 1 DICOM +(0078,0090) FD TwoDImplantTemplateGroupMemberMatchingPoint 2 DICOM +(0078,00A0) FD TwoDImplantTemplateGroupMemberMatchingAxes 4 DICOM +(0078,00B0) SQ ImplantTemplateGroupVariationDimensionSequence 1 DICOM +(0078,00B2) LO ImplantTemplateGroupVariationDimensionName 1 DICOM +(0078,00B4) SQ ImplantTemplateGroupVariationDimensionRankSequence 1 DICOM +(0078,00B6) US ReferencedImplantTemplateGroupMemberID 1 DICOM +(0078,00B8) US ImplantTemplateGroupVariationDimensionRank 1 DICOM +(0080,0001) SQ SurfaceScanAcquisitionTypeCodeSequence 1 DICOM +(0080,0002) SQ SurfaceScanModeCodeSequence 1 DICOM +(0080,0003) SQ RegistrationMethodCodeSequence 1 DICOM +(0080,0004) FD ShotDurationTime 1 DICOM +(0080,0005) FD ShotOffsetTime 1 DICOM +(0080,0006) US SurfacePointPresentationValueData 1-n DICOM +(0080,0007) US SurfacePointColorCIELabValueData 3-3n DICOM +(0080,0008) SQ UVMappingSequence 1 DICOM +(0080,0009) SH TextureLabel 1 DICOM +(0080,0010) OF UValueData 1 DICOM +(0080,0011) OF VValueData 1 DICOM +(0080,0012) SQ ReferencedTextureSequence 1 DICOM +(0080,0013) SQ ReferencedSurfaceDataSequence 1 DICOM +(0082,0001) CS AssessmentSummary 1 DICOM +(0082,0003) UT AssessmentSummaryDescription 1 DICOM +(0082,0004) SQ AssessedSOPInstanceSequence 1 DICOM +(0082,0005) SQ ReferencedComparisonSOPInstanceSequence 1 DICOM +(0082,0006) UL NumberOfAssessmentObservations 1 DICOM +(0082,0007) SQ AssessmentObservationsSequence 1 DICOM +(0082,0008) CS ObservationSignificance 1 DICOM +(0082,000A) UT ObservationDescription 1 DICOM +(0082,000C) SQ StructuredConstraintObservationSequence 1 DICOM +(0082,0010) SQ AssessedAttributeValueSequence 1 DICOM +(0082,0016) LO AssessmentSetID 1 DICOM +(0082,0017) SQ AssessmentRequesterSequence 1 DICOM +(0082,0018) LO SelectorAttributeName 1 DICOM +(0082,0019) LO SelectorAttributeKeyword 1 DICOM +(0082,0021) SQ AssessmentTypeCodeSequence 1 DICOM +(0082,0022) SQ ObservationBasisCodeSequence 1 DICOM +(0082,0023) LO AssessmentLabel 1 DICOM +(0082,0032) CS ConstraintType 1 DICOM +(0082,0033) UT SpecificationSelectionGuidance 1 DICOM +(0082,0034) SQ ConstraintValueSequence 1 DICOM +(0082,0035) SQ RecommendedDefaultValueSequence 1 DICOM +(0082,0036) CS ConstraintViolationSignificance 1 DICOM +(0082,0037) UT ConstraintViolationCondition 1 DICOM +(0082,0038) CS ModifiableConstraintFlag 1 DICOM +(0088,0130) SH StorageMediaFileSetID 1 DICOM +(0088,0140) UI StorageMediaFileSetUID 1 DICOM +(0088,0200) SQ IconImageSequence 1 DICOM +(0100,0410) CS SOPInstanceStatus 1 DICOM +(0100,0420) DT SOPAuthorizationDateTime 1 DICOM +(0100,0424) LT SOPAuthorizationComment 1 DICOM +(0100,0426) LO AuthorizationEquipmentCertificationNumber 1 DICOM +(0400,0005) US MACIDNumber 1 DICOM +(0400,0010) UI MACCalculationTransferSyntaxUID 1 DICOM +(0400,0015) CS MACAlgorithm 1 DICOM +(0400,0020) AT DataElementsSigned 1-n DICOM +(0400,0100) UI DigitalSignatureUID 1 DICOM +(0400,0105) DT DigitalSignatureDateTime 1 DICOM +(0400,0110) CS CertificateType 1 DICOM +(0400,0115) OB CertificateOfSigner 1 DICOM +(0400,0120) OB Signature 1 DICOM +(0400,0305) CS CertifiedTimestampType 1 DICOM +(0400,0310) OB CertifiedTimestamp 1 DICOM +(0400,0401) SQ DigitalSignaturePurposeCodeSequence 1 DICOM +(0400,0402) SQ ReferencedDigitalSignatureSequence 1 DICOM +(0400,0403) SQ ReferencedSOPInstanceMACSequence 1 DICOM +(0400,0404) OB MAC 1 DICOM +(0400,0500) SQ EncryptedAttributesSequence 1 DICOM +(0400,0510) UI EncryptedContentTransferSyntaxUID 1 DICOM +(0400,0520) OB EncryptedContent 1 DICOM +(0400,0550) SQ ModifiedAttributesSequence 1 DICOM +(0400,0551) SQ NonconformingModifiedAttributesSequence 1 DICOM +(0400,0552) OB NonconformingDataElementValue 1 DICOM +(0400,0561) SQ OriginalAttributesSequence 1 DICOM +(0400,0562) DT AttributeModificationDateTime 1 DICOM +(0400,0563) LO ModifyingSystem 1 DICOM +(0400,0564) LO SourceOfPreviousValues 1 DICOM +(0400,0565) CS ReasonForTheAttributeModification 1 DICOM +(0400,0600) CS InstanceOriginStatus 1 DICOM +(2000,0010) IS NumberOfCopies 1 DICOM +(2000,001E) SQ PrinterConfigurationSequence 1 DICOM +(2000,0020) CS PrintPriority 1 DICOM +(2000,0030) CS MediumType 1 DICOM +(2000,0040) CS FilmDestination 1 DICOM +(2000,0050) LO FilmSessionLabel 1 DICOM +(2000,0060) IS MemoryAllocation 1 DICOM +(2000,0061) IS MaximumMemoryAllocation 1 DICOM +(2000,00A0) US MemoryBitDepth 1 DICOM +(2000,00A1) US PrintingBitDepth 1 DICOM +(2000,00A2) SQ MediaInstalledSequence 1 DICOM +(2000,00A4) SQ OtherMediaAvailableSequence 1 DICOM +(2000,00A8) SQ SupportedImageDisplayFormatsSequence 1 DICOM +(2000,0500) SQ ReferencedFilmBoxSequence 1 DICOM +(2010,0010) ST ImageDisplayFormat 1 DICOM +(2010,0030) CS AnnotationDisplayFormatID 1 DICOM +(2010,0040) CS FilmOrientation 1 DICOM +(2010,0050) CS FilmSizeID 1 DICOM +(2010,0052) CS PrinterResolutionID 1 DICOM +(2010,0054) CS DefaultPrinterResolutionID 1 DICOM +(2010,0060) CS MagnificationType 1 DICOM +(2010,0080) CS SmoothingType 1 DICOM +(2010,00A6) CS DefaultMagnificationType 1 DICOM +(2010,00A7) CS OtherMagnificationTypesAvailable 1-n DICOM +(2010,00A8) CS DefaultSmoothingType 1 DICOM +(2010,00A9) CS OtherSmoothingTypesAvailable 1-n DICOM +(2010,0100) CS BorderDensity 1 DICOM +(2010,0110) CS EmptyImageDensity 1 DICOM +(2010,0120) US MinDensity 1 DICOM +(2010,0130) US MaxDensity 1 DICOM +(2010,0140) CS Trim 1 DICOM +(2010,0150) ST ConfigurationInformation 1 DICOM +(2010,0152) LT ConfigurationInformationDescription 1 DICOM +(2010,0154) IS MaximumCollatedFilms 1 DICOM +(2010,015E) US Illumination 1 DICOM +(2010,0160) US ReflectedAmbientLight 1 DICOM +(2010,0376) DS PrinterPixelSpacing 2 DICOM +(2010,0500) SQ ReferencedFilmSessionSequence 1 DICOM +(2010,0510) SQ ReferencedImageBoxSequence 1 DICOM +(2010,0520) SQ ReferencedBasicAnnotationBoxSequence 1 DICOM +(2020,0010) US ImageBoxPosition 1 DICOM +(2020,0020) CS Polarity 1 DICOM +(2020,0030) DS RequestedImageSize 1 DICOM +(2020,0040) CS RequestedDecimateCropBehavior 1 DICOM +(2020,0050) CS RequestedResolutionID 1 DICOM +(2020,00A0) CS RequestedImageSizeFlag 1 DICOM +(2020,00A2) CS DecimateCropResult 1 DICOM +(2020,0110) SQ BasicGrayscaleImageSequence 1 DICOM +(2020,0111) SQ BasicColorImageSequence 1 DICOM +(2030,0010) US AnnotationPosition 1 DICOM +(2030,0020) LO TextString 1 DICOM +(2050,0010) SQ PresentationLUTSequence 1 DICOM +(2050,0020) CS PresentationLUTShape 1 DICOM +(2050,0500) SQ ReferencedPresentationLUTSequence 1 DICOM +(2100,0020) CS ExecutionStatus 1 DICOM +(2100,0030) CS ExecutionStatusInfo 1 DICOM +(2100,0040) DA CreationDate 1 DICOM +(2100,0050) TM CreationTime 1 DICOM +(2100,0070) AE Originator 1 DICOM +(2100,0140) AE DestinationAE 1 DICOM +(2100,0160) SH OwnerID 1 DICOM +(2100,0170) IS NumberOfFilms 1 DICOM +(2110,0010) CS PrinterStatus 1 DICOM +(2110,0020) CS PrinterStatusInfo 1 DICOM +(2110,0030) LO PrinterName 1 DICOM +(2200,0001) CS LabelUsingInformationExtractedFromInstances 1 DICOM +(2200,0002) UT LabelText 1 DICOM +(2200,0003) CS LabelStyleSelection 1 DICOM +(2200,0004) LT MediaDisposition 1 DICOM +(2200,0005) LT BarcodeValue 1 DICOM +(2200,0006) CS BarcodeSymbology 1 DICOM +(2200,0007) CS AllowMediaSplitting 1 DICOM +(2200,0008) CS IncludeNonDICOMObjects 1 DICOM +(2200,0009) CS IncludeDisplayApplication 1 DICOM +(2200,000A) CS PreserveCompositeInstancesAfterMediaCreation 1 DICOM +(2200,000B) US TotalNumberOfPiecesOfMediaCreated 1 DICOM +(2200,000C) LO RequestedMediaApplicationProfile 1 DICOM +(2200,000D) SQ ReferencedStorageMediaSequence 1 DICOM +(2200,000E) AT FailureAttributes 1-n DICOM +(2200,000F) CS AllowLossyCompression 1 DICOM +(2200,0020) CS RequestPriority 1 DICOM +(3002,0002) SH RTImageLabel 1 DICOM +(3002,0003) LO RTImageName 1 DICOM +(3002,0004) ST RTImageDescription 1 DICOM +(3002,000A) CS ReportedValuesOrigin 1 DICOM +(3002,000C) CS RTImagePlane 1 DICOM +(3002,000D) DS XRayImageReceptorTranslation 3 DICOM +(3002,000E) DS XRayImageReceptorAngle 1 DICOM +(3002,0010) DS RTImageOrientation 6 DICOM +(3002,0011) DS ImagePlanePixelSpacing 2 DICOM +(3002,0012) DS RTImagePosition 2 DICOM +(3002,0020) SH RadiationMachineName 1 DICOM +(3002,0022) DS RadiationMachineSAD 1 DICOM +(3002,0024) DS RadiationMachineSSD 1 DICOM +(3002,0026) DS RTImageSID 1 DICOM +(3002,0028) DS SourceToReferenceObjectDistance 1 DICOM +(3002,0029) IS FractionNumber 1 DICOM +(3002,0030) SQ ExposureSequence 1 DICOM +(3002,0032) DS MetersetExposure 1 DICOM +(3002,0034) DS DiaphragmPosition 4 DICOM +(3002,0040) SQ FluenceMapSequence 1 DICOM +(3002,0041) CS FluenceDataSource 1 DICOM +(3002,0042) DS FluenceDataScale 1 DICOM +(3002,0050) SQ PrimaryFluenceModeSequence 1 DICOM +(3002,0051) CS FluenceMode 1 DICOM +(3002,0052) SH FluenceModeID 1 DICOM +(3004,0001) CS DVHType 1 DICOM +(3004,0002) CS DoseUnits 1 DICOM +(3004,0004) CS DoseType 1 DICOM +(3004,0005) CS SpatialTransformOfDose 1 DICOM +(3004,0006) LO DoseComment 1 DICOM +(3004,0008) DS NormalizationPoint 3 DICOM +(3004,000A) CS DoseSummationType 1 DICOM +(3004,000C) DS GridFrameOffsetVector 2-n DICOM +(3004,000E) DS DoseGridScaling 1 DICOM +(3004,0010) SQ RTDoseROISequence 1 DICOM +(3004,0012) DS DoseValue 1 DICOM +(3004,0014) CS TissueHeterogeneityCorrection 1-3 DICOM +(3004,0040) DS DVHNormalizationPoint 3 DICOM +(3004,0042) DS DVHNormalizationDoseValue 1 DICOM +(3004,0050) SQ DVHSequence 1 DICOM +(3004,0052) DS DVHDoseScaling 1 DICOM +(3004,0054) CS DVHVolumeUnits 1 DICOM +(3004,0056) IS DVHNumberOfBins 1 DICOM +(3004,0058) DS DVHData 2-2n DICOM +(3004,0060) SQ DVHReferencedROISequence 1 DICOM +(3004,0062) CS DVHROIContributionType 1 DICOM +(3004,0070) DS DVHMinimumDose 1 DICOM +(3004,0072) DS DVHMaximumDose 1 DICOM +(3004,0074) DS DVHMeanDose 1 DICOM +(3006,0002) SH StructureSetLabel 1 DICOM +(3006,0004) LO StructureSetName 1 DICOM +(3006,0006) ST StructureSetDescription 1 DICOM +(3006,0008) DA StructureSetDate 1 DICOM +(3006,0009) TM StructureSetTime 1 DICOM +(3006,0010) SQ ReferencedFrameOfReferenceSequence 1 DICOM +(3006,0012) SQ RTReferencedStudySequence 1 DICOM +(3006,0014) SQ RTReferencedSeriesSequence 1 DICOM +(3006,0016) SQ ContourImageSequence 1 DICOM +(3006,0018) SQ PredecessorStructureSetSequence 1 DICOM +(3006,0020) SQ StructureSetROISequence 1 DICOM +(3006,0022) IS ROINumber 1 DICOM +(3006,0024) UI ReferencedFrameOfReferenceUID 1 DICOM +(3006,0026) LO ROIName 1 DICOM +(3006,0028) ST ROIDescription 1 DICOM +(3006,002A) IS ROIDisplayColor 3 DICOM +(3006,002C) DS ROIVolume 1 DICOM +(3006,0030) SQ RTRelatedROISequence 1 DICOM +(3006,0033) CS RTROIRelationship 1 DICOM +(3006,0036) CS ROIGenerationAlgorithm 1 DICOM +(3006,0037) SQ ROIDerivationAlgorithmIdentificationSequence 1 DICOM +(3006,0038) LO ROIGenerationDescription 1 DICOM +(3006,0039) SQ ROIContourSequence 1 DICOM +(3006,0040) SQ ContourSequence 1 DICOM +(3006,0042) CS ContourGeometricType 1 DICOM +(3006,0044) DS ContourSlabThickness 1 DICOM +(3006,0045) DS ContourOffsetVector 3 DICOM +(3006,0046) IS NumberOfContourPoints 1 DICOM +(3006,0048) IS ContourNumber 1 DICOM +(3006,0049) IS AttachedContours 1-n DICOM +(3006,0050) DS ContourData 3-3n DICOM +(3006,0080) SQ RTROIObservationsSequence 1 DICOM +(3006,0082) IS ObservationNumber 1 DICOM +(3006,0084) IS ReferencedROINumber 1 DICOM +(3006,0085) SH ROIObservationLabel 1 DICOM +(3006,0086) SQ RTROIIdentificationCodeSequence 1 DICOM +(3006,0088) ST ROIObservationDescription 1 DICOM +(3006,00A0) SQ RelatedRTROIObservationsSequence 1 DICOM +(3006,00A4) CS RTROIInterpretedType 1 DICOM +(3006,00A6) PN ROIInterpreter 1 DICOM +(3006,00B0) SQ ROIPhysicalPropertiesSequence 1 DICOM +(3006,00B2) CS ROIPhysicalProperty 1 DICOM +(3006,00B4) DS ROIPhysicalPropertyValue 1 DICOM +(3006,00B6) SQ ROIElementalCompositionSequence 1 DICOM +(3006,00B7) US ROIElementalCompositionAtomicNumber 1 DICOM +(3006,00B8) FL ROIElementalCompositionAtomicMassFraction 1 DICOM +(3006,00C6) DS FrameOfReferenceTransformationMatrix 16 DICOM +(3006,00C8) LO FrameOfReferenceTransformationComment 1 DICOM +(3008,0010) SQ MeasuredDoseReferenceSequence 1 DICOM +(3008,0012) ST MeasuredDoseDescription 1 DICOM +(3008,0014) CS MeasuredDoseType 1 DICOM +(3008,0016) DS MeasuredDoseValue 1 DICOM +(3008,0020) SQ TreatmentSessionBeamSequence 1 DICOM +(3008,0021) SQ TreatmentSessionIonBeamSequence 1 DICOM +(3008,0022) IS CurrentFractionNumber 1 DICOM +(3008,0024) DA TreatmentControlPointDate 1 DICOM +(3008,0025) TM TreatmentControlPointTime 1 DICOM +(3008,002A) CS TreatmentTerminationStatus 1 DICOM +(3008,002B) SH TreatmentTerminationCode 1 DICOM +(3008,002C) CS TreatmentVerificationStatus 1 DICOM +(3008,0030) SQ ReferencedTreatmentRecordSequence 1 DICOM +(3008,0032) DS SpecifiedPrimaryMeterset 1 DICOM +(3008,0033) DS SpecifiedSecondaryMeterset 1 DICOM +(3008,0036) DS DeliveredPrimaryMeterset 1 DICOM +(3008,0037) DS DeliveredSecondaryMeterset 1 DICOM +(3008,003A) DS SpecifiedTreatmentTime 1 DICOM +(3008,003B) DS DeliveredTreatmentTime 1 DICOM +(3008,0040) SQ ControlPointDeliverySequence 1 DICOM +(3008,0041) SQ IonControlPointDeliverySequence 1 DICOM +(3008,0042) DS SpecifiedMeterset 1 DICOM +(3008,0044) DS DeliveredMeterset 1 DICOM +(3008,0045) FL MetersetRateSet 1 DICOM +(3008,0046) FL MetersetRateDelivered 1 DICOM +(3008,0047) FL ScanSpotMetersetsDelivered 1-n DICOM +(3008,0048) DS DoseRateDelivered 1 DICOM +(3008,0050) SQ TreatmentSummaryCalculatedDoseReferenceSequence 1 DICOM +(3008,0052) DS CumulativeDoseToDoseReference 1 DICOM +(3008,0054) DA FirstTreatmentDate 1 DICOM +(3008,0056) DA MostRecentTreatmentDate 1 DICOM +(3008,005A) IS NumberOfFractionsDelivered 1 DICOM +(3008,0060) SQ OverrideSequence 1 DICOM +(3008,0061) AT ParameterSequencePointer 1 DICOM +(3008,0062) AT OverrideParameterPointer 1 DICOM +(3008,0063) IS ParameterItemIndex 1 DICOM +(3008,0064) IS MeasuredDoseReferenceNumber 1 DICOM +(3008,0065) AT ParameterPointer 1 DICOM +(3008,0066) ST OverrideReason 1 DICOM +(3008,0067) US ParameterValueNumber 1 DICOM +(3008,0068) SQ CorrectedParameterSequence 1 DICOM +(3008,006A) FL CorrectionValue 1 DICOM +(3008,0070) SQ CalculatedDoseReferenceSequence 1 DICOM +(3008,0072) IS CalculatedDoseReferenceNumber 1 DICOM +(3008,0074) ST CalculatedDoseReferenceDescription 1 DICOM +(3008,0076) DS CalculatedDoseReferenceDoseValue 1 DICOM +(3008,0078) DS StartMeterset 1 DICOM +(3008,007A) DS EndMeterset 1 DICOM +(3008,0080) SQ ReferencedMeasuredDoseReferenceSequence 1 DICOM +(3008,0082) IS ReferencedMeasuredDoseReferenceNumber 1 DICOM +(3008,0090) SQ ReferencedCalculatedDoseReferenceSequence 1 DICOM +(3008,0092) IS ReferencedCalculatedDoseReferenceNumber 1 DICOM +(3008,00A0) SQ BeamLimitingDeviceLeafPairsSequence 1 DICOM +(3008,00B0) SQ RecordedWedgeSequence 1 DICOM +(3008,00C0) SQ RecordedCompensatorSequence 1 DICOM +(3008,00D0) SQ RecordedBlockSequence 1 DICOM +(3008,00E0) SQ TreatmentSummaryMeasuredDoseReferenceSequence 1 DICOM +(3008,00F0) SQ RecordedSnoutSequence 1 DICOM +(3008,00F2) SQ RecordedRangeShifterSequence 1 DICOM +(3008,00F4) SQ RecordedLateralSpreadingDeviceSequence 1 DICOM +(3008,00F6) SQ RecordedRangeModulatorSequence 1 DICOM +(3008,0100) SQ RecordedSourceSequence 1 DICOM +(3008,0105) LO SourceSerialNumber 1 DICOM +(3008,0110) SQ TreatmentSessionApplicationSetupSequence 1 DICOM +(3008,0116) CS ApplicationSetupCheck 1 DICOM +(3008,0120) SQ RecordedBrachyAccessoryDeviceSequence 1 DICOM +(3008,0122) IS ReferencedBrachyAccessoryDeviceNumber 1 DICOM +(3008,0130) SQ RecordedChannelSequence 1 DICOM +(3008,0132) DS SpecifiedChannelTotalTime 1 DICOM +(3008,0134) DS DeliveredChannelTotalTime 1 DICOM +(3008,0136) IS SpecifiedNumberOfPulses 1 DICOM +(3008,0138) IS DeliveredNumberOfPulses 1 DICOM +(3008,013A) DS SpecifiedPulseRepetitionInterval 1 DICOM +(3008,013C) DS DeliveredPulseRepetitionInterval 1 DICOM +(3008,0140) SQ RecordedSourceApplicatorSequence 1 DICOM +(3008,0142) IS ReferencedSourceApplicatorNumber 1 DICOM +(3008,0150) SQ RecordedChannelShieldSequence 1 DICOM +(3008,0152) IS ReferencedChannelShieldNumber 1 DICOM +(3008,0160) SQ BrachyControlPointDeliveredSequence 1 DICOM +(3008,0162) DA SafePositionExitDate 1 DICOM +(3008,0164) TM SafePositionExitTime 1 DICOM +(3008,0166) DA SafePositionReturnDate 1 DICOM +(3008,0168) TM SafePositionReturnTime 1 DICOM +(3008,0171) SQ PulseSpecificBrachyControlPointDeliveredSequence 1 DICOM +(3008,0172) US PulseNumber 1 DICOM +(3008,0173) SQ BrachyPulseControlPointDeliveredSequence 1 DICOM +(3008,0200) CS CurrentTreatmentStatus 1 DICOM +(3008,0202) ST TreatmentStatusComment 1 DICOM +(3008,0220) SQ FractionGroupSummarySequence 1 DICOM +(3008,0223) IS ReferencedFractionNumber 1 DICOM +(3008,0224) CS FractionGroupType 1 DICOM +(3008,0230) CS BeamStopperPosition 1 DICOM +(3008,0240) SQ FractionStatusSummarySequence 1 DICOM +(3008,0250) DA TreatmentDate 1 DICOM +(3008,0251) TM TreatmentTime 1 DICOM +(300A,0002) SH RTPlanLabel 1 DICOM +(300A,0003) LO RTPlanName 1 DICOM +(300A,0004) ST RTPlanDescription 1 DICOM +(300A,0006) DA RTPlanDate 1 DICOM +(300A,0007) TM RTPlanTime 1 DICOM +(300A,0009) LO TreatmentProtocols 1-n DICOM +(300A,000A) CS PlanIntent 1 DICOM +(300A,000B) LO TreatmentSites 1-n DICOM +(300A,000C) CS RTPlanGeometry 1 DICOM +(300A,000E) ST PrescriptionDescription 1 DICOM +(300A,0010) SQ DoseReferenceSequence 1 DICOM +(300A,0012) IS DoseReferenceNumber 1 DICOM +(300A,0013) UI DoseReferenceUID 1 DICOM +(300A,0014) CS DoseReferenceStructureType 1 DICOM +(300A,0015) CS NominalBeamEnergyUnit 1 DICOM +(300A,0016) LO DoseReferenceDescription 1 DICOM +(300A,0018) DS DoseReferencePointCoordinates 3 DICOM +(300A,001A) DS NominalPriorDose 1 DICOM +(300A,0020) CS DoseReferenceType 1 DICOM +(300A,0021) DS ConstraintWeight 1 DICOM +(300A,0022) DS DeliveryWarningDose 1 DICOM +(300A,0023) DS DeliveryMaximumDose 1 DICOM +(300A,0025) DS TargetMinimumDose 1 DICOM +(300A,0026) DS TargetPrescriptionDose 1 DICOM +(300A,0027) DS TargetMaximumDose 1 DICOM +(300A,0028) DS TargetUnderdoseVolumeFraction 1 DICOM +(300A,002A) DS OrganAtRiskFullVolumeDose 1 DICOM +(300A,002B) DS OrganAtRiskLimitDose 1 DICOM +(300A,002C) DS OrganAtRiskMaximumDose 1 DICOM +(300A,002D) DS OrganAtRiskOverdoseVolumeFraction 1 DICOM +(300A,0040) SQ ToleranceTableSequence 1 DICOM +(300A,0042) IS ToleranceTableNumber 1 DICOM +(300A,0043) SH ToleranceTableLabel 1 DICOM +(300A,0044) DS GantryAngleTolerance 1 DICOM +(300A,0046) DS BeamLimitingDeviceAngleTolerance 1 DICOM +(300A,0048) SQ BeamLimitingDeviceToleranceSequence 1 DICOM +(300A,004A) DS BeamLimitingDevicePositionTolerance 1 DICOM +(300A,004B) FL SnoutPositionTolerance 1 DICOM +(300A,004C) DS PatientSupportAngleTolerance 1 DICOM +(300A,004E) DS TableTopEccentricAngleTolerance 1 DICOM +(300A,004F) FL TableTopPitchAngleTolerance 1 DICOM +(300A,0050) FL TableTopRollAngleTolerance 1 DICOM +(300A,0051) DS TableTopVerticalPositionTolerance 1 DICOM +(300A,0052) DS TableTopLongitudinalPositionTolerance 1 DICOM +(300A,0053) DS TableTopLateralPositionTolerance 1 DICOM +(300A,0055) CS RTPlanRelationship 1 DICOM +(300A,0070) SQ FractionGroupSequence 1 DICOM +(300A,0071) IS FractionGroupNumber 1 DICOM +(300A,0072) LO FractionGroupDescription 1 DICOM +(300A,0078) IS NumberOfFractionsPlanned 1 DICOM +(300A,0079) IS NumberOfFractionPatternDigitsPerDay 1 DICOM +(300A,007A) IS RepeatFractionCycleLength 1 DICOM +(300A,007B) LT FractionPattern 1 DICOM +(300A,0080) IS NumberOfBeams 1 DICOM +(300A,0082) DS BeamDoseSpecificationPoint 3 DICOM +(300A,0083) UI ReferencedDoseReferenceUID 1 DICOM +(300A,0084) DS BeamDose 1 DICOM +(300A,0086) DS BeamMeterset 1 DICOM +(300A,0088) FL BeamDosePointDepth 1 DICOM +(300A,0089) FL BeamDosePointEquivalentDepth 1 DICOM +(300A,008A) FL BeamDosePointSSD 1 DICOM +(300A,008B) CS BeamDoseMeaning 1 DICOM +(300A,008C) SQ BeamDoseVerificationControlPointSequence 1 DICOM +(300A,0090) CS BeamDoseType 1 DICOM +(300A,0091) DS AlternateBeamDose 1 DICOM +(300A,0092) CS AlternateBeamDoseType 1 DICOM +(300A,0093) CS DepthValueAveragingFlag 1 DICOM +(300A,0094) DS BeamDosePointSourceToExternalContourDistance 1 DICOM +(300A,00A0) IS NumberOfBrachyApplicationSetups 1 DICOM +(300A,00A2) DS BrachyApplicationSetupDoseSpecificationPoint 3 DICOM +(300A,00A4) DS BrachyApplicationSetupDose 1 DICOM +(300A,00B0) SQ BeamSequence 1 DICOM +(300A,00B2) SH TreatmentMachineName 1 DICOM +(300A,00B3) CS PrimaryDosimeterUnit 1 DICOM +(300A,00B4) DS SourceAxisDistance 1 DICOM +(300A,00B6) SQ BeamLimitingDeviceSequence 1 DICOM +(300A,00B8) CS RTBeamLimitingDeviceType 1 DICOM +(300A,00BA) DS SourceToBeamLimitingDeviceDistance 1 DICOM +(300A,00BB) FL IsocenterToBeamLimitingDeviceDistance 1 DICOM +(300A,00BC) IS NumberOfLeafJawPairs 1 DICOM +(300A,00BE) DS LeafPositionBoundaries 3-n DICOM +(300A,00C0) IS BeamNumber 1 DICOM +(300A,00C2) LO BeamName 1 DICOM +(300A,00C3) ST BeamDescription 1 DICOM +(300A,00C4) CS BeamType 1 DICOM +(300A,00C5) FD BeamDeliveryDurationLimit 1 DICOM +(300A,00C6) CS RadiationType 1 DICOM +(300A,00C7) CS HighDoseTechniqueType 1 DICOM +(300A,00C8) IS ReferenceImageNumber 1 DICOM +(300A,00CA) SQ PlannedVerificationImageSequence 1 DICOM +(300A,00CC) LO ImagingDeviceSpecificAcquisitionParameters 1-n DICOM +(300A,00CE) CS TreatmentDeliveryType 1 DICOM +(300A,00D0) IS NumberOfWedges 1 DICOM +(300A,00D1) SQ WedgeSequence 1 DICOM +(300A,00D2) IS WedgeNumber 1 DICOM +(300A,00D3) CS WedgeType 1 DICOM +(300A,00D4) SH WedgeID 1 DICOM +(300A,00D5) IS WedgeAngle 1 DICOM +(300A,00D6) DS WedgeFactor 1 DICOM +(300A,00D7) FL TotalWedgeTrayWaterEquivalentThickness 1 DICOM +(300A,00D8) DS WedgeOrientation 1 DICOM +(300A,00D9) FL IsocenterToWedgeTrayDistance 1 DICOM +(300A,00DA) DS SourceToWedgeTrayDistance 1 DICOM +(300A,00DB) FL WedgeThinEdgePosition 1 DICOM +(300A,00DC) SH BolusID 1 DICOM +(300A,00DD) ST BolusDescription 1 DICOM +(300A,00DE) DS EffectiveWedgeAngle 1 DICOM +(300A,00E0) IS NumberOfCompensators 1 DICOM +(300A,00E1) SH MaterialID 1 DICOM +(300A,00E2) DS TotalCompensatorTrayFactor 1 DICOM +(300A,00E3) SQ CompensatorSequence 1 DICOM +(300A,00E4) IS CompensatorNumber 1 DICOM +(300A,00E5) SH CompensatorID 1 DICOM +(300A,00E6) DS SourceToCompensatorTrayDistance 1 DICOM +(300A,00E7) IS CompensatorRows 1 DICOM +(300A,00E8) IS CompensatorColumns 1 DICOM +(300A,00E9) DS CompensatorPixelSpacing 2 DICOM +(300A,00EA) DS CompensatorPosition 2 DICOM +(300A,00EB) DS CompensatorTransmissionData 1-n DICOM +(300A,00EC) DS CompensatorThicknessData 1-n DICOM +(300A,00ED) IS NumberOfBoli 1 DICOM +(300A,00EE) CS CompensatorType 1 DICOM +(300A,00EF) SH CompensatorTrayID 1 DICOM +(300A,00F0) IS NumberOfBlocks 1 DICOM +(300A,00F2) DS TotalBlockTrayFactor 1 DICOM +(300A,00F3) FL TotalBlockTrayWaterEquivalentThickness 1 DICOM +(300A,00F4) SQ BlockSequence 1 DICOM +(300A,00F5) SH BlockTrayID 1 DICOM +(300A,00F6) DS SourceToBlockTrayDistance 1 DICOM +(300A,00F7) FL IsocenterToBlockTrayDistance 1 DICOM +(300A,00F8) CS BlockType 1 DICOM +(300A,00F9) LO AccessoryCode 1 DICOM +(300A,00FA) CS BlockDivergence 1 DICOM +(300A,00FB) CS BlockMountingPosition 1 DICOM +(300A,00FC) IS BlockNumber 1 DICOM +(300A,00FE) LO BlockName 1 DICOM +(300A,0100) DS BlockThickness 1 DICOM +(300A,0102) DS BlockTransmission 1 DICOM +(300A,0104) IS BlockNumberOfPoints 1 DICOM +(300A,0106) DS BlockData 2-2n DICOM +(300A,0107) SQ ApplicatorSequence 1 DICOM +(300A,0108) SH ApplicatorID 1 DICOM +(300A,0109) CS ApplicatorType 1 DICOM +(300A,010A) LO ApplicatorDescription 1 DICOM +(300A,010C) DS CumulativeDoseReferenceCoefficient 1 DICOM +(300A,010E) DS FinalCumulativeMetersetWeight 1 DICOM +(300A,0110) IS NumberOfControlPoints 1 DICOM +(300A,0111) SQ ControlPointSequence 1 DICOM +(300A,0112) IS ControlPointIndex 1 DICOM +(300A,0114) DS NominalBeamEnergy 1 DICOM +(300A,0115) DS DoseRateSet 1 DICOM +(300A,0116) SQ WedgePositionSequence 1 DICOM +(300A,0118) CS WedgePosition 1 DICOM +(300A,011A) SQ BeamLimitingDevicePositionSequence 1 DICOM +(300A,011C) DS LeafJawPositions 2-2n DICOM +(300A,011E) DS GantryAngle 1 DICOM +(300A,011F) CS GantryRotationDirection 1 DICOM +(300A,0120) DS BeamLimitingDeviceAngle 1 DICOM +(300A,0121) CS BeamLimitingDeviceRotationDirection 1 DICOM +(300A,0122) DS PatientSupportAngle 1 DICOM +(300A,0123) CS PatientSupportRotationDirection 1 DICOM +(300A,0124) DS TableTopEccentricAxisDistance 1 DICOM +(300A,0125) DS TableTopEccentricAngle 1 DICOM +(300A,0126) CS TableTopEccentricRotationDirection 1 DICOM +(300A,0128) DS TableTopVerticalPosition 1 DICOM +(300A,0129) DS TableTopLongitudinalPosition 1 DICOM +(300A,012A) DS TableTopLateralPosition 1 DICOM +(300A,012C) DS IsocenterPosition 3 DICOM +(300A,012E) DS SurfaceEntryPoint 3 DICOM +(300A,0130) DS SourceToSurfaceDistance 1 DICOM +(300A,0131) FL AverageBeamDosePointSourceToExternalContourDistance 1 DICOM +(300A,0132) FL SourceToExternalContourDistance 1 DICOM +(300A,0133) FL ExternalContourEntryPoint 3 DICOM +(300A,0134) DS CumulativeMetersetWeight 1 DICOM +(300A,0140) FL TableTopPitchAngle 1 DICOM +(300A,0142) CS TableTopPitchRotationDirection 1 DICOM +(300A,0144) FL TableTopRollAngle 1 DICOM +(300A,0146) CS TableTopRollRotationDirection 1 DICOM +(300A,0148) FL HeadFixationAngle 1 DICOM +(300A,014A) FL GantryPitchAngle 1 DICOM +(300A,014C) CS GantryPitchRotationDirection 1 DICOM +(300A,014E) FL GantryPitchAngleTolerance 1 DICOM +(300A,0150) CS FixationEye 1 DICOM +(300A,0151) DS ChairHeadFramePosition 1 DICOM +(300A,0152) DS HeadFixationAngleTolerance 1 DICOM +(300A,0153) DS ChairHeadFramePositionTolerance 1 DICOM +(300A,0154) DS FixationLightAzimuthalAngleTolerance 1 DICOM +(300A,0155) DS FixationLightPolarAngleTolerance 1 DICOM +(300A,0180) SQ PatientSetupSequence 1 DICOM +(300A,0182) IS PatientSetupNumber 1 DICOM +(300A,0183) LO PatientSetupLabel 1 DICOM +(300A,0184) LO PatientAdditionalPosition 1 DICOM +(300A,0190) SQ FixationDeviceSequence 1 DICOM +(300A,0192) CS FixationDeviceType 1 DICOM +(300A,0194) SH FixationDeviceLabel 1 DICOM +(300A,0196) ST FixationDeviceDescription 1 DICOM +(300A,0198) SH FixationDevicePosition 1 DICOM +(300A,0199) FL FixationDevicePitchAngle 1 DICOM +(300A,019A) FL FixationDeviceRollAngle 1 DICOM +(300A,01A0) SQ ShieldingDeviceSequence 1 DICOM +(300A,01A2) CS ShieldingDeviceType 1 DICOM +(300A,01A4) SH ShieldingDeviceLabel 1 DICOM +(300A,01A6) ST ShieldingDeviceDescription 1 DICOM +(300A,01A8) SH ShieldingDevicePosition 1 DICOM +(300A,01B0) CS SetupTechnique 1 DICOM +(300A,01B2) ST SetupTechniqueDescription 1 DICOM +(300A,01B4) SQ SetupDeviceSequence 1 DICOM +(300A,01B6) CS SetupDeviceType 1 DICOM +(300A,01B8) SH SetupDeviceLabel 1 DICOM +(300A,01BA) ST SetupDeviceDescription 1 DICOM +(300A,01BC) DS SetupDeviceParameter 1 DICOM +(300A,01D0) ST SetupReferenceDescription 1 DICOM +(300A,01D2) DS TableTopVerticalSetupDisplacement 1 DICOM +(300A,01D4) DS TableTopLongitudinalSetupDisplacement 1 DICOM +(300A,01D6) DS TableTopLateralSetupDisplacement 1 DICOM +(300A,0200) CS BrachyTreatmentTechnique 1 DICOM +(300A,0202) CS BrachyTreatmentType 1 DICOM +(300A,0206) SQ TreatmentMachineSequence 1 DICOM +(300A,0210) SQ SourceSequence 1 DICOM +(300A,0212) IS SourceNumber 1 DICOM +(300A,0214) CS SourceType 1 DICOM +(300A,0216) LO SourceManufacturer 1 DICOM +(300A,0218) DS ActiveSourceDiameter 1 DICOM +(300A,021A) DS ActiveSourceLength 1 DICOM +(300A,021B) SH SourceModelID 1 DICOM +(300A,021C) LO SourceDescription 1 DICOM +(300A,0222) DS SourceEncapsulationNominalThickness 1 DICOM +(300A,0224) DS SourceEncapsulationNominalTransmission 1 DICOM +(300A,0226) LO SourceIsotopeName 1 DICOM +(300A,0228) DS SourceIsotopeHalfLife 1 DICOM +(300A,0229) CS SourceStrengthUnits 1 DICOM +(300A,022A) DS ReferenceAirKermaRate 1 DICOM +(300A,022B) DS SourceStrength 1 DICOM +(300A,022C) DA SourceStrengthReferenceDate 1 DICOM +(300A,022E) TM SourceStrengthReferenceTime 1 DICOM +(300A,0230) SQ ApplicationSetupSequence 1 DICOM +(300A,0232) CS ApplicationSetupType 1 DICOM +(300A,0234) IS ApplicationSetupNumber 1 DICOM +(300A,0236) LO ApplicationSetupName 1 DICOM +(300A,0238) LO ApplicationSetupManufacturer 1 DICOM +(300A,0240) IS TemplateNumber 1 DICOM +(300A,0242) SH TemplateType 1 DICOM +(300A,0244) LO TemplateName 1 DICOM +(300A,0250) DS TotalReferenceAirKerma 1 DICOM +(300A,0260) SQ BrachyAccessoryDeviceSequence 1 DICOM +(300A,0262) IS BrachyAccessoryDeviceNumber 1 DICOM +(300A,0263) SH BrachyAccessoryDeviceID 1 DICOM +(300A,0264) CS BrachyAccessoryDeviceType 1 DICOM +(300A,0266) LO BrachyAccessoryDeviceName 1 DICOM +(300A,026A) DS BrachyAccessoryDeviceNominalThickness 1 DICOM +(300A,026C) DS BrachyAccessoryDeviceNominalTransmission 1 DICOM +(300A,0271) DS ChannelEffectiveLength 1 DICOM +(300A,0272) DS ChannelInnerLength 1 DICOM +(300A,0273) SH AfterloaderChannelID 1 DICOM +(300A,0274) DS SourceApplicatorTipLength 1 DICOM +(300A,0280) SQ ChannelSequence 1 DICOM +(300A,0282) IS ChannelNumber 1 DICOM +(300A,0284) DS ChannelLength 1 DICOM +(300A,0286) DS ChannelTotalTime 1 DICOM +(300A,0288) CS SourceMovementType 1 DICOM +(300A,028A) IS NumberOfPulses 1 DICOM +(300A,028C) DS PulseRepetitionInterval 1 DICOM +(300A,0290) IS SourceApplicatorNumber 1 DICOM +(300A,0291) SH SourceApplicatorID 1 DICOM +(300A,0292) CS SourceApplicatorType 1 DICOM +(300A,0294) LO SourceApplicatorName 1 DICOM +(300A,0296) DS SourceApplicatorLength 1 DICOM +(300A,0298) LO SourceApplicatorManufacturer 1 DICOM +(300A,029C) DS SourceApplicatorWallNominalThickness 1 DICOM +(300A,029E) DS SourceApplicatorWallNominalTransmission 1 DICOM +(300A,02A0) DS SourceApplicatorStepSize 1 DICOM +(300A,02A2) IS TransferTubeNumber 1 DICOM +(300A,02A4) DS TransferTubeLength 1 DICOM +(300A,02B0) SQ ChannelShieldSequence 1 DICOM +(300A,02B2) IS ChannelShieldNumber 1 DICOM +(300A,02B3) SH ChannelShieldID 1 DICOM +(300A,02B4) LO ChannelShieldName 1 DICOM +(300A,02B8) DS ChannelShieldNominalThickness 1 DICOM +(300A,02BA) DS ChannelShieldNominalTransmission 1 DICOM +(300A,02C8) DS FinalCumulativeTimeWeight 1 DICOM +(300A,02D0) SQ BrachyControlPointSequence 1 DICOM +(300A,02D2) DS ControlPointRelativePosition 1 DICOM +(300A,02D4) DS ControlPoint3DPosition 3 DICOM +(300A,02D6) DS CumulativeTimeWeight 1 DICOM +(300A,02E0) CS CompensatorDivergence 1 DICOM +(300A,02E1) CS CompensatorMountingPosition 1 DICOM +(300A,02E2) DS SourceToCompensatorDistance 1-n DICOM +(300A,02E3) FL TotalCompensatorTrayWaterEquivalentThickness 1 DICOM +(300A,02E4) FL IsocenterToCompensatorTrayDistance 1 DICOM +(300A,02E5) FL CompensatorColumnOffset 1 DICOM +(300A,02E6) FL IsocenterToCompensatorDistances 1-n DICOM +(300A,02E7) FL CompensatorRelativeStoppingPowerRatio 1 DICOM +(300A,02E8) FL CompensatorMillingToolDiameter 1 DICOM +(300A,02EA) SQ IonRangeCompensatorSequence 1 DICOM +(300A,02EB) LT CompensatorDescription 1 DICOM +(300A,0302) IS RadiationMassNumber 1 DICOM +(300A,0304) IS RadiationAtomicNumber 1 DICOM +(300A,0306) SS RadiationChargeState 1 DICOM +(300A,0308) CS ScanMode 1 DICOM +(300A,0309) CS ModulatedScanModeType 1 DICOM +(300A,030A) FL VirtualSourceAxisDistances 2 DICOM +(300A,030C) SQ SnoutSequence 1 DICOM +(300A,030D) FL SnoutPosition 1 DICOM +(300A,030F) SH SnoutID 1 DICOM +(300A,0312) IS NumberOfRangeShifters 1 DICOM +(300A,0314) SQ RangeShifterSequence 1 DICOM +(300A,0316) IS RangeShifterNumber 1 DICOM +(300A,0318) SH RangeShifterID 1 DICOM +(300A,0320) CS RangeShifterType 1 DICOM +(300A,0322) LO RangeShifterDescription 1 DICOM +(300A,0330) IS NumberOfLateralSpreadingDevices 1 DICOM +(300A,0332) SQ LateralSpreadingDeviceSequence 1 DICOM +(300A,0334) IS LateralSpreadingDeviceNumber 1 DICOM +(300A,0336) SH LateralSpreadingDeviceID 1 DICOM +(300A,0338) CS LateralSpreadingDeviceType 1 DICOM +(300A,033A) LO LateralSpreadingDeviceDescription 1 DICOM +(300A,033C) FL LateralSpreadingDeviceWaterEquivalentThickness 1 DICOM +(300A,0340) IS NumberOfRangeModulators 1 DICOM +(300A,0342) SQ RangeModulatorSequence 1 DICOM +(300A,0344) IS RangeModulatorNumber 1 DICOM +(300A,0346) SH RangeModulatorID 1 DICOM +(300A,0348) CS RangeModulatorType 1 DICOM +(300A,034A) LO RangeModulatorDescription 1 DICOM +(300A,034C) SH BeamCurrentModulationID 1 DICOM +(300A,0350) CS PatientSupportType 1 DICOM +(300A,0352) SH PatientSupportID 1 DICOM +(300A,0354) LO PatientSupportAccessoryCode 1 DICOM +(300A,0355) LO TrayAccessoryCode 1 DICOM +(300A,0356) FL FixationLightAzimuthalAngle 1 DICOM +(300A,0358) FL FixationLightPolarAngle 1 DICOM +(300A,035A) FL MetersetRate 1 DICOM +(300A,0360) SQ RangeShifterSettingsSequence 1 DICOM +(300A,0362) LO RangeShifterSetting 1 DICOM +(300A,0364) FL IsocenterToRangeShifterDistance 1 DICOM +(300A,0366) FL RangeShifterWaterEquivalentThickness 1 DICOM +(300A,0370) SQ LateralSpreadingDeviceSettingsSequence 1 DICOM +(300A,0372) LO LateralSpreadingDeviceSetting 1 DICOM +(300A,0374) FL IsocenterToLateralSpreadingDeviceDistance 1 DICOM +(300A,0380) SQ RangeModulatorSettingsSequence 1 DICOM +(300A,0382) FL RangeModulatorGatingStartValue 1 DICOM +(300A,0384) FL RangeModulatorGatingStopValue 1 DICOM +(300A,0386) FL RangeModulatorGatingStartWaterEquivalentThickness 1 DICOM +(300A,0388) FL RangeModulatorGatingStopWaterEquivalentThickness 1 DICOM +(300A,038A) FL IsocenterToRangeModulatorDistance 1 DICOM +(300A,038F) FL ScanSpotTimeOffset 1-n DICOM +(300A,0390) SH ScanSpotTuneID 1 DICOM +(300A,0391) IS ScanSpotPrescribedIndices 1-n DICOM +(300A,0392) IS NumberOfScanSpotPositions 1 DICOM +(300A,0393) CS ScanSpotReordered 1 DICOM +(300A,0394) FL ScanSpotPositionMap 1-n DICOM +(300A,0395) CS ScanSpotReorderingAllowed 1 DICOM +(300A,0396) FL ScanSpotMetersetWeights 1-n DICOM +(300A,0398) FL ScanningSpotSize 2 DICOM +(300A,039A) IS NumberOfPaintings 1 DICOM +(300A,03A0) SQ IonToleranceTableSequence 1 DICOM +(300A,03A2) SQ IonBeamSequence 1 DICOM +(300A,03A4) SQ IonBeamLimitingDeviceSequence 1 DICOM +(300A,03A6) SQ IonBlockSequence 1 DICOM +(300A,03A8) SQ IonControlPointSequence 1 DICOM +(300A,03AA) SQ IonWedgeSequence 1 DICOM +(300A,03AC) SQ IonWedgePositionSequence 1 DICOM +(300A,0401) SQ ReferencedSetupImageSequence 1 DICOM +(300A,0402) ST SetupImageComment 1 DICOM +(300A,0410) SQ MotionSynchronizationSequence 1 DICOM +(300A,0412) FL ControlPointOrientation 3 DICOM +(300A,0420) SQ GeneralAccessorySequence 1 DICOM +(300A,0421) SH GeneralAccessoryID 1 DICOM +(300A,0422) ST GeneralAccessoryDescription 1 DICOM +(300A,0423) CS GeneralAccessoryType 1 DICOM +(300A,0424) IS GeneralAccessoryNumber 1 DICOM +(300A,0425) FL SourceToGeneralAccessoryDistance 1 DICOM +(300A,0431) SQ ApplicatorGeometrySequence 1 DICOM +(300A,0432) CS ApplicatorApertureShape 1 DICOM +(300A,0433) FL ApplicatorOpening 1 DICOM +(300A,0434) FL ApplicatorOpeningX 1 DICOM +(300A,0435) FL ApplicatorOpeningY 1 DICOM +(300A,0436) FL SourceToApplicatorMountingPositionDistance 1 DICOM +(300A,0440) IS NumberOfBlockSlabItems 1 DICOM +(300A,0441) SQ BlockSlabSequence 1 DICOM +(300A,0442) DS BlockSlabThickness 1 DICOM +(300A,0443) US BlockSlabNumber 1 DICOM +(300A,0450) SQ DeviceMotionControlSequence 1 DICOM +(300A,0451) CS DeviceMotionExecutionMode 1 DICOM +(300A,0452) CS DeviceMotionObservationMode 1 DICOM +(300A,0453) SQ DeviceMotionParameterCodeSequence 1 DICOM +(300A,0501) FL DistalDepthFraction 1 DICOM +(300A,0502) FL DistalDepth 1 DICOM +(300A,0503) FL NominalRangeModulationFractions 2 DICOM +(300A,0504) FL NominalRangeModulatedRegionDepths 2 DICOM +(300A,0505) SQ DepthDoseParametersSequence 1 DICOM +(300A,0506) SQ DeliveredDepthDoseParametersSequence 1 DICOM +(300A,0507) FL DeliveredDistalDepthFraction 1 DICOM +(300A,0508) FL DeliveredDistalDepth 1 DICOM +(300A,0509) FL DeliveredNominalRangeModulationFractions 2 DICOM +(300A,0510) FL DeliveredNominalRangeModulatedRegionDepths 2 DICOM +(300A,0511) CS DeliveredReferenceDoseDefinition 1 DICOM +(300A,0512) CS ReferenceDoseDefinition 1 DICOM +(300C,0002) SQ ReferencedRTPlanSequence 1 DICOM +(300C,0004) SQ ReferencedBeamSequence 1 DICOM +(300C,0006) IS ReferencedBeamNumber 1 DICOM +(300C,0007) IS ReferencedReferenceImageNumber 1 DICOM +(300C,0008) DS StartCumulativeMetersetWeight 1 DICOM +(300C,0009) DS EndCumulativeMetersetWeight 1 DICOM +(300C,000A) SQ ReferencedBrachyApplicationSetupSequence 1 DICOM +(300C,000C) IS ReferencedBrachyApplicationSetupNumber 1 DICOM +(300C,000E) IS ReferencedSourceNumber 1 DICOM +(300C,0020) SQ ReferencedFractionGroupSequence 1 DICOM +(300C,0022) IS ReferencedFractionGroupNumber 1 DICOM +(300C,0040) SQ ReferencedVerificationImageSequence 1 DICOM +(300C,0042) SQ ReferencedReferenceImageSequence 1 DICOM +(300C,0050) SQ ReferencedDoseReferenceSequence 1 DICOM +(300C,0051) IS ReferencedDoseReferenceNumber 1 DICOM +(300C,0055) SQ BrachyReferencedDoseReferenceSequence 1 DICOM +(300C,0060) SQ ReferencedStructureSetSequence 1 DICOM +(300C,006A) IS ReferencedPatientSetupNumber 1 DICOM +(300C,0080) SQ ReferencedDoseSequence 1 DICOM +(300C,00A0) IS ReferencedToleranceTableNumber 1 DICOM +(300C,00B0) SQ ReferencedBolusSequence 1 DICOM +(300C,00C0) IS ReferencedWedgeNumber 1 DICOM +(300C,00D0) IS ReferencedCompensatorNumber 1 DICOM +(300C,00E0) IS ReferencedBlockNumber 1 DICOM +(300C,00F0) IS ReferencedControlPointIndex 1 DICOM +(300C,00F2) SQ ReferencedControlPointSequence 1 DICOM +(300C,00F4) IS ReferencedStartControlPointIndex 1 DICOM +(300C,00F6) IS ReferencedStopControlPointIndex 1 DICOM +(300C,0100) IS ReferencedRangeShifterNumber 1 DICOM +(300C,0102) IS ReferencedLateralSpreadingDeviceNumber 1 DICOM +(300C,0104) IS ReferencedRangeModulatorNumber 1 DICOM +(300C,0111) SQ OmittedBeamTaskSequence 1 DICOM +(300C,0112) CS ReasonForOmission 1 DICOM +(300C,0113) LO ReasonForOmissionDescription 1 DICOM +(300E,0002) CS ApprovalStatus 1 DICOM +(300E,0004) DA ReviewDate 1 DICOM +(300E,0005) TM ReviewTime 1 DICOM +(300E,0008) PN ReviewerName 1 DICOM +(3010,0001) SQ RadiobiologicalDoseEffectSequence 1 DICOM +(3010,0002) CS RadiobiologicalDoseEffectFlag 1 DICOM +(3010,0003) SQ EffectiveDoseCalculationMethodCategoryCodeSequence 1 DICOM +(3010,0004) SQ EffectiveDoseCalculationMethodCodeSequence 1 DICOM +(3010,0005) LO EffectiveDoseCalculationMethodDescription 1 DICOM +(3010,0006) UI ConceptualVolumeUID 1 DICOM +(3010,0007) SQ OriginatingSOPInstanceReferenceSequence 1 DICOM +(3010,0008) SQ ConceptualVolumeConstituentSequence 1 DICOM +(3010,0009) SQ EquivalentConceptualVolumeInstanceReferenceSequence 1 DICOM +(3010,000A) SQ EquivalentConceptualVolumesSequence 1 DICOM +(3010,000B) UI ReferencedConceptualVolumeUID 1 DICOM +(3010,000C) UT ConceptualVolumeCombinationExpression 1 DICOM +(3010,000D) US ConceptualVolumeConstituentIndex 1 DICOM +(3010,000E) CS ConceptualVolumeCombinationFlag 1 DICOM +(3010,000F) ST ConceptualVolumeCombinationDescription 1 DICOM +(3010,0010) CS ConceptualVolumeSegmentationDefinedFlag 1 DICOM +(3010,0011) SQ ConceptualVolumeSegmentationReferenceSequence 1 DICOM +(3010,0012) SQ ConceptualVolumeConstituentSegmentationReferenceSequence 1 DICOM +(3010,0013) UI ConstituentConceptualVolumeUID 1 DICOM +(3010,0014) SQ DerivationConceptualVolumeSequence 1 DICOM +(3010,0015) UI SourceConceptualVolumeUID 1 DICOM +(3010,0016) SQ ConceptualVolumeDerivationAlgorithmSequence 1 DICOM +(3010,0017) ST ConceptualVolumeDescription 1 DICOM +(3010,0018) SQ SourceConceptualVolumeSequence 1 DICOM +(3010,0019) SQ AuthorIdentificationSequence 1 DICOM +(3010,001A) LO ManufacturerModelVersion 1 DICOM +(3010,001B) UC DeviceAlternateIdentifier 1 DICOM +(3010,001C) CS DeviceAlternateIdentifierType 1 DICOM +(3010,001D) LT DeviceAlternateIdentifierFormat 1 DICOM +(3010,001E) LO SegmentationCreationTemplateLabel 1 DICOM +(3010,001F) UI SegmentationTemplateUID 1 DICOM +(3010,0020) US ReferencedSegmentReferenceIndex 1 DICOM +(3010,0021) SQ SegmentReferenceSequence 1 DICOM +(3010,0022) US SegmentReferenceIndex 1 DICOM +(3010,0023) SQ DirectSegmentReferenceSequence 1 DICOM +(3010,0024) SQ CombinationSegmentReferenceSequence 1 DICOM +(3010,0025) SQ ConceptualVolumeSequence 1 DICOM +(3010,0026) SQ SegmentedRTAccessoryDeviceSequence 1 DICOM +(3010,0027) SQ SegmentCharacteristicsSequence 1 DICOM +(3010,0028) SQ RelatedSegmentCharacteristicsSequence 1 DICOM +(3010,0029) US SegmentCharacteristicsPrecedence 1 DICOM +(3010,002A) SQ RTSegmentAnnotationSequence 1 DICOM +(3010,002B) SQ SegmentAnnotationCategoryCodeSequence 1 DICOM +(3010,002C) SQ SegmentAnnotationTypeCodeSequence 1 DICOM +(3010,002D) LO DeviceLabel 1 DICOM +(3010,002E) SQ DeviceTypeCodeSequence 1 DICOM +(3010,0030) SQ PatientEquipmentRelationshipCodeSequence 1 DICOM +(3010,0031) UI ReferencedFiducialsUID 1 DICOM +(3010,0032) SQ PatientTreatmentOrientationSequence 1 DICOM +(3010,0033) SH UserContentLabel 1 DICOM +(3010,0034) LO UserContentLongLabel 1 DICOM +(3010,0035) SH EntityLabel 1 DICOM +(3010,0036) LO EntityName 1 DICOM +(3010,0037) ST EntityDescription 1 DICOM +(3010,0038) LO EntityLongLabel 1 DICOM +(3010,0039) US DeviceIndex 1 DICOM +(3010,003A) US RTTreatmentPhaseIndex 1 DICOM +(3010,003B) UI RTTreatmentPhaseUID 1 DICOM +(3010,003C) US RTPrescriptionIndex 1 DICOM +(3010,003D) US RTSegmentAnnotationIndex 1 DICOM +(3010,003E) US BasisRTTreatmentPhaseIndex 1 DICOM +(3010,003F) US RelatedRTTreatmentPhaseIndex 1 DICOM +(3010,0040) US ReferencedRTTreatmentPhaseIndex 1 DICOM +(3010,0041) US ReferencedRTPrescriptionIndex 1 DICOM +(3010,0042) US ReferencedParentRTPrescriptionIndex 1 DICOM +(3010,0043) ST ManufacturerDeviceIdentifier 1 DICOM +(3010,0044) SQ InstanceLevelReferencedPerformedProcedureStepSequence 1 DICOM +(3010,0045) CS RTTreatmentPhaseIntentPresenceFlag 1 DICOM +(3010,0046) CS RadiotherapyTreatmentType 1 DICOM +(3010,0047) CS TeletherapyRadiationType 1-n DICOM +(3010,0048) CS BrachytherapySourceType 1-n DICOM +(3010,0049) SQ ReferencedRTTreatmentPhaseSequence 1 DICOM +(3010,004A) SQ ReferencedDirectSegmentInstanceSequence 1 DICOM +(3010,004B) SQ IntendedRTTreatmentPhaseSequence 1 DICOM +(3010,004C) DA IntendedPhaseStartDate 1 DICOM +(3010,004D) DA IntendedPhaseEndDate 1 DICOM +(3010,004E) SQ RTTreatmentPhaseIntervalSequence 1 DICOM +(3010,004F) CS TemporalRelationshipIntervalAnchor 1 DICOM +(3010,0050) FD MinimumNumberOfIntervalDays 1 DICOM +(3010,0051) FD MaximumNumberOfIntervalDays 1 DICOM +(3010,0052) UI PertinentSOPClassesInStudy 1-n DICOM +(3010,0053) UI PertinentSOPClassesInSeries 1-n DICOM +(3010,0054) LO RTPrescriptionLabel 1 DICOM +(3010,0055) SQ RTPhysicianIntentPredecessorSequence 1 DICOM +(3010,0056) LO RTTreatmentApproachLabel 1 DICOM +(3010,0057) SQ RTPhysicianIntentSequence 1 DICOM +(3010,0058) US RTPhysicianIntentIndex 1 DICOM +(3010,0059) CS RTTreatmentIntentType 1 DICOM +(3010,005A) UT RTPhysicianIntentNarrative 1 DICOM +(3010,005B) SQ RTProtocolCodeSequence 1 DICOM +(3010,005C) ST ReasonForSuperseding 1 DICOM +(3010,005D) SQ RTDiagnosisCodeSequence 1 DICOM +(3010,005E) US ReferencedRTPhysicianIntentIndex 1 DICOM +(3010,005F) SQ RTPhysicianIntentInputInstanceSequence 1 DICOM +(3010,0060) SQ RTAnatomicPrescriptionSequence 1 DICOM +(3010,0061) UT PriorTreatmentDoseDescription 1 DICOM +(3010,0062) SQ PriorTreatmentReferenceSequence 1 DICOM +(3010,0063) CS DosimetricObjectiveEvaluationScope 1 DICOM +(3010,0064) SQ TherapeuticRoleCategoryCodeSequence 1 DICOM +(3010,0065) SQ TherapeuticRoleTypeCodeSequence 1 DICOM +(3010,0066) US ConceptualVolumeOptimizationPrecedence 1 DICOM +(3010,0067) SQ ConceptualVolumeCategoryCodeSequence 1 DICOM +(3010,0068) CS ConceptualVolumeBlockingConstraint 1 DICOM +(3010,0069) SQ ConceptualVolumeTypeCodeSequence 1 DICOM +(3010,006A) SQ ConceptualVolumeTypeModifierCodeSequence 1 DICOM +(3010,006B) SQ RTPrescriptionSequence 1 DICOM +(3010,006C) SQ DosimetricObjectiveSequence 1 DICOM +(3010,006D) SQ DosimetricObjectiveTypeCodeSequence 1 DICOM +(3010,006E) UI DosimetricObjectiveUID 1 DICOM +(3010,006F) UI ReferencedDosimetricObjectiveUID 1 DICOM +(3010,0070) SQ DosimetricObjectiveParameterSequence 1 DICOM +(3010,0071) SQ ReferencedDosimetricObjectivesSequence 1 DICOM +(3010,0073) CS AbsoluteDosimetricObjectiveFlag 1 DICOM +(3010,0074) FD DosimetricObjectiveWeight 1 DICOM +(3010,0075) CS DosimetricObjectivePurpose 1 DICOM +(3010,0076) SQ PlanningInputInformationSequence 1 DICOM +(3010,0077) LO TreatmentSite 1 DICOM +(3010,0078) SQ TreatmentSiteCodeSequence 1 DICOM +(3010,0079) SQ FractionPatternSequence 1 DICOM +(3010,007A) UT TreatmentTechniqueNotes 1 DICOM +(3010,007B) UT PrescriptionNotes 1 DICOM +(3010,007C) IS NumberOfIntervalFractions 1 DICOM +(3010,007D) US NumberOfFractions 1 DICOM +(3010,007E) US IntendedDeliveryDuration 1 DICOM +(3010,007F) UT FractionationNotes 1 DICOM +(3010,0080) SQ RTTreatmentTechniqueCodeSequence 1 DICOM +(3010,0081) SQ PrescriptionNotesSequence 1 DICOM +(3010,0082) SQ FractionBasedRelationshipSequence 1 DICOM +(3010,0083) CS FractionBasedRelationshipIntervalAnchor 1 DICOM +(3010,0084) FD MinimumHoursBetweenFractions 1 DICOM +(3010,0085) TM IntendedFractionStartTime 1-n DICOM +(3010,0086) LT IntendedStartDayOfWeek 1 DICOM +(3010,0087) SQ WeekdayFractionPatternSequence 1 DICOM +(3010,0088) SQ DeliveryTimeStructureCodeSequence 1 DICOM +(4010,0001) CS LowEnergyDetectors 1 DICOM/DICOS +(4010,0002) CS HighEnergyDetectors 1 DICOM/DICOS +(4010,0004) SQ DetectorGeometrySequence 1 DICOM/DICOS +(4010,1001) SQ ThreatROIVoxelSequence 1 DICOM/DICOS +(4010,1004) FL ThreatROIBase 3 DICOM/DICOS +(4010,1005) FL ThreatROIExtents 3 DICOM/DICOS +(4010,1006) OB ThreatROIBitmap 1 DICOM/DICOS +(4010,1007) SH RouteSegmentID 1 DICOM/DICOS +(4010,1008) CS GantryType 1 DICOM/DICOS +(4010,1009) CS OOIOwnerType 1 DICOM/DICOS +(4010,100A) SQ RouteSegmentSequence 1 DICOM/DICOS +(4010,1010) US PotentialThreatObjectID 1 DICOM/DICOS +(4010,1011) SQ ThreatSequence 1 DICOM/DICOS +(4010,1012) CS ThreatCategory 1 DICOM/DICOS +(4010,1013) LT ThreatCategoryDescription 1 DICOM/DICOS +(4010,1014) CS ATDAbilityAssessment 1 DICOM/DICOS +(4010,1015) CS ATDAssessmentFlag 1 DICOM/DICOS +(4010,1016) FL ATDAssessmentProbability 1 DICOM/DICOS +(4010,1017) FL Mass 1 DICOM/DICOS +(4010,1018) FL Density 1 DICOM/DICOS +(4010,1019) FL ZEffective 1 DICOM/DICOS +(4010,101A) SH BoardingPassID 1 DICOM/DICOS +(4010,101B) FL CenterOfMass 3 DICOM/DICOS +(4010,101C) FL CenterOfPTO 3 DICOM/DICOS +(4010,101D) FL BoundingPolygon 6-n DICOM/DICOS +(4010,101E) SH RouteSegmentStartLocationID 1 DICOM/DICOS +(4010,101F) SH RouteSegmentEndLocationID 1 DICOM/DICOS +(4010,1020) CS RouteSegmentLocationIDType 1 DICOM/DICOS +(4010,1021) CS AbortReason 1-n DICOM/DICOS +(4010,1023) FL VolumeOfPTO 1 DICOM/DICOS +(4010,1024) CS AbortFlag 1 DICOM/DICOS +(4010,1025) DT RouteSegmentStartTime 1 DICOM/DICOS +(4010,1026) DT RouteSegmentEndTime 1 DICOM/DICOS +(4010,1027) CS TDRType 1 DICOM/DICOS +(4010,1028) CS InternationalRouteSegment 1 DICOM/DICOS +(4010,1029) LO ThreatDetectionAlgorithmandVersion 1-n DICOM/DICOS +(4010,102A) SH AssignedLocation 1 DICOM/DICOS +(4010,102B) DT AlarmDecisionTime 1 DICOM/DICOS +(4010,1031) CS AlarmDecision 1 DICOM/DICOS +(4010,1033) US NumberOfTotalObjects 1 DICOM/DICOS +(4010,1034) US NumberOfAlarmObjects 1 DICOM/DICOS +(4010,1037) SQ PTORepresentationSequence 1 DICOM/DICOS +(4010,1038) SQ ATDAssessmentSequence 1 DICOM/DICOS +(4010,1039) CS TIPType 1 DICOM/DICOS +(4010,103A) CS DICOSVersion 1 DICOM/DICOS +(4010,1041) DT OOIOwnerCreationTime 1 DICOM/DICOS +(4010,1042) CS OOIType 1 DICOM/DICOS +(4010,1043) FL OOISize 3 DICOM/DICOS +(4010,1044) CS AcquisitionStatus 1 DICOM/DICOS +(4010,1045) SQ BasisMaterialsCodeSequence 1 DICOM/DICOS +(4010,1046) CS PhantomType 1 DICOM/DICOS +(4010,1047) SQ OOIOwnerSequence 1 DICOM/DICOS +(4010,1048) CS ScanType 1 DICOM/DICOS +(4010,1051) LO ItineraryID 1 DICOM/DICOS +(4010,1052) SH ItineraryIDType 1 DICOM/DICOS +(4010,1053) LO ItineraryIDAssigningAuthority 1 DICOM/DICOS +(4010,1054) SH RouteID 1 DICOM/DICOS +(4010,1055) SH RouteIDAssigningAuthority 1 DICOM/DICOS +(4010,1056) CS InboundArrivalType 1 DICOM/DICOS +(4010,1058) SH CarrierID 1 DICOM/DICOS +(4010,1059) CS CarrierIDAssigningAuthority 1 DICOM/DICOS +(4010,1060) FL SourceOrientation 3 DICOM/DICOS +(4010,1061) FL SourcePosition 3 DICOM/DICOS +(4010,1062) FL BeltHeight 1 DICOM/DICOS +(4010,1064) SQ AlgorithmRoutingCodeSequence 1 DICOM/DICOS +(4010,1067) CS TransportClassification 1 DICOM/DICOS +(4010,1068) LT OOITypeDescriptor 1 DICOM/DICOS +(4010,1069) FL TotalProcessingTime 1 DICOM/DICOS +(4010,106C) OB DetectorCalibrationData 1 DICOM/DICOS +(4010,106D) CS AdditionalScreeningPerformed 1 DICOM/DICOS +(4010,106E) CS AdditionalInspectionSelectionCriteria 1 DICOM/DICOS +(4010,106F) SQ AdditionalInspectionMethodSequence 1 DICOM/DICOS +(4010,1070) CS AITDeviceType 1 DICOM/DICOS +(4010,1071) SQ QRMeasurementsSequence 1 DICOM/DICOS +(4010,1072) SQ TargetMaterialSequence 1 DICOM/DICOS +(4010,1073) FD SNRThreshold 1 DICOM/DICOS +(4010,1075) DS ImageScaleRepresentation 1 DICOM/DICOS +(4010,1076) SQ ReferencedPTOSequence 1 DICOM/DICOS +(4010,1077) SQ ReferencedTDRInstanceSequence 1 DICOM/DICOS +(4010,1078) ST PTOLocationDescription 1 DICOM/DICOS +(4010,1079) SQ AnomalyLocatorIndicatorSequence 1 DICOM/DICOS +(4010,107A) FL AnomalyLocatorIndicator 3 DICOM/DICOS +(4010,107B) SQ PTORegionSequence 1 DICOM/DICOS +(4010,107C) CS InspectionSelectionCriteria 1 DICOM/DICOS +(4010,107D) SQ SecondaryInspectionMethodSequence 1 DICOM/DICOS +(4010,107E) DS PRCSToRCSOrientation 6 DICOM/DICOS +(4FFE,0001) SQ MACParametersSequence 1 DICOM +(5200,9229) SQ SharedFunctionalGroupsSequence 1 DICOM +(5200,9230) SQ PerFrameFunctionalGroupsSequence 1 DICOM +(5400,0100) SQ WaveformSequence 1 DICOM +(5400,0110) ox ChannelMinimumValue 1 DICOM +(5400,0112) ox ChannelMaximumValue 1 DICOM +(5400,1004) US WaveformBitsAllocated 1 DICOM +(5400,1006) CS WaveformSampleInterpretation 1 DICOM +(5400,100A) ox WaveformPaddingValue 1 DICOM +(5400,1010) ox WaveformData 1 DICOM +(5600,0010) OF FirstOrderPhaseCorrectionAngle 1 DICOM +(5600,0020) OF SpectroscopyData 1 DICOM +(6000-60FF,0010) US OverlayRows 1 DICOM +(6000-60FF,0011) US OverlayColumns 1 DICOM +(6000-60FF,0015) IS NumberOfFramesInOverlay 1 DICOM +(6000-60FF,0022) LO OverlayDescription 1 DICOM +(6000-60FF,0040) CS OverlayType 1 DICOM +(6000-60FF,0045) LO OverlaySubtype 1 DICOM +(6000-60FF,0050) SS OverlayOrigin 2 DICOM +(6000-60FF,0051) US ImageFrameOrigin 1 DICOM +(6000-60FF,0100) US OverlayBitsAllocated 1 DICOM +(6000-60FF,0102) US OverlayBitPosition 1 DICOM +(6000-60FF,1001) CS OverlayActivationLayer 1 DICOM +(6000-60FF,1301) IS ROIArea 1 DICOM +(6000-60FF,1302) DS ROIMean 1 DICOM +(6000-60FF,1303) DS ROIStandardDeviation 1 DICOM +(6000-60FF,1500) LO OverlayLabel 1 DICOM +(6000-60FF,3000) ox OverlayData 1 DICOM +(7FE0,0001) OV ExtendedOffsetTable 1 DICOM +(7FE0,0002) OV ExtendedOffsetTableLengths 1 DICOM +(7FE0,0008) OF FloatPixelData 1 DICOM +(7FE0,0009) OD DoubleFloatPixelData 1 DICOM +(7FE0,0010) ox PixelData 1 DICOM +(FFFA,FFFA) SQ DigitalSignaturesSequence 1 DICOM +(FFFC,FFFC) OB DataSetTrailingPadding 1 DICOM +(FFFE,E000) na Item 1 DICOM +(FFFE,E00D) na ItemDelimitationItem 1 DICOM +(FFFE,E0DD) na SequenceDelimitationItem 1 DICOM +# +# Retired (generated automatically) +# +(0000,0001) UL RETIRED_CommandLengthToEnd 1 DICOM/retired +(0000,0010) SH RETIRED_CommandRecognitionCode 1 DICOM/retired +(0000,0200) AE RETIRED_Initiator 1 DICOM/retired +(0000,0300) AE RETIRED_Receiver 1 DICOM/retired +(0000,0400) AE RETIRED_FindLocation 1 DICOM/retired +(0000,0850) US RETIRED_NumberOfMatches 1 DICOM/retired +(0000,0860) US RETIRED_ResponseSequenceNumber 1 DICOM/retired +(0000,4000) LT RETIRED_DialogReceiver 1 DICOM/retired +(0000,4010) LT RETIRED_TerminalType 1 DICOM/retired +(0000,5010) SH RETIRED_MessageSetID 1 DICOM/retired +(0000,5020) SH RETIRED_EndMessageID 1 DICOM/retired +(0000,5110) LT RETIRED_DisplayFormat 1 DICOM/retired +(0000,5120) LT RETIRED_PagePositionID 1 DICOM/retired +(0000,5130) CS RETIRED_TextFormatID 1 DICOM/retired +(0000,5140) CS RETIRED_NormalReverse 1 DICOM/retired +(0000,5150) CS RETIRED_AddGrayScale 1 DICOM/retired +(0000,5160) CS RETIRED_Borders 1 DICOM/retired +(0000,5170) IS RETIRED_Copies 1 DICOM/retired +(0000,5180) CS RETIRED_CommandMagnificationType 1 DICOM/retired +(0000,5190) CS RETIRED_Erase 1 DICOM/retired +(0000,51A0) CS RETIRED_Print 1 DICOM/retired +(0000,51B0) US RETIRED_Overlays 1-n DICOM/retired +(0004,1504) up RETIRED_MRDRDirectoryRecordOffset 1 DICOM/retired +(0004,1600) UL RETIRED_NumberOfReferences 1 DICOM/retired +(0008,0001) UL RETIRED_LengthToEnd 1 DICOM/retired +(0008,0010) SH RETIRED_RecognitionCode 1 DICOM/retired +(0008,0024) DA RETIRED_OverlayDate 1 DICOM/retired +(0008,0025) DA RETIRED_CurveDate 1 DICOM/retired +(0008,0034) TM RETIRED_OverlayTime 1 DICOM/retired +(0008,0035) TM RETIRED_CurveTime 1 DICOM/retired +(0008,0040) US RETIRED_DataSetType 1 DICOM/retired +(0008,0041) LO RETIRED_DataSetSubtype 1 DICOM/retired +(0008,0042) CS RETIRED_NuclearMedicineSeriesType 1 DICOM/retired +(0008,1000) AE RETIRED_NetworkID 1 DICOM/retired +(0008,1100) SQ RETIRED_ReferencedResultsSequence 1 DICOM/retired +(0008,1130) SQ RETIRED_ReferencedOverlaySequence 1 DICOM/retired +(0008,1145) SQ RETIRED_ReferencedCurveSequence 1 DICOM/retired +(0008,2110) CS RETIRED_LossyImageCompressionRetired 1 DICOM/retired +(0008,2200) CS RETIRED_TransducerPosition 1 DICOM/retired +(0008,2204) CS RETIRED_TransducerOrientation 1 DICOM/retired +(0008,2208) CS RETIRED_AnatomicStructure 1 DICOM/retired +(0008,2229) SQ RETIRED_AnatomicStructureSpaceOrRegionSequence 1 DICOM/retired +(0008,2240) SQ RETIRED_TransducerPositionSequence 1 DICOM/retired +(0008,2242) SQ RETIRED_TransducerPositionModifierSequence 1 DICOM/retired +(0008,2244) SQ RETIRED_TransducerOrientationSequence 1 DICOM/retired +(0008,2246) SQ RETIRED_TransducerOrientationModifierSequence 1 DICOM/retired +(0008,2251) SQ RETIRED_AnatomicStructureSpaceOrRegionCodeSequenceTrial 1 DICOM/retired +(0008,2253) SQ RETIRED_AnatomicPortalOfEntranceCodeSequenceTrial 1 DICOM/retired +(0008,2255) SQ RETIRED_AnatomicApproachDirectionCodeSequenceTrial 1 DICOM/retired +(0008,2256) ST RETIRED_AnatomicPerspectiveDescriptionTrial 1 DICOM/retired +(0008,2257) SQ RETIRED_AnatomicPerspectiveCodeSequenceTrial 1 DICOM/retired +(0008,2258) ST RETIRED_AnatomicLocationOfExaminingInstrumentDescriptionTrial 1 DICOM/retired +(0008,2259) SQ RETIRED_AnatomicLocationOfExaminingInstrumentCodeSequenceTrial 1 DICOM/retired +(0008,225A) SQ RETIRED_AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial 1 DICOM/retired +(0008,225C) SQ RETIRED_OnAxisBackgroundAnatomicStructureCodeSequenceTrial 1 DICOM/retired +(0008,4000) LT RETIRED_IdentifyingComments 1 DICOM/retired +(0010,1000) LO RETIRED_OtherPatientIDs 1-n DICOM/retired +(0010,1050) LO RETIRED_InsurancePlanIdentification 1-n DICOM/retired +(0010,1090) LO RETIRED_MedicalRecordLocator 1 DICOM/retired +(0014,0023) ST RETIRED_CADFileFormat 1 DICOM/retired +(0014,0024) ST RETIRED_ComponentReferenceSystem 1 DICOM/retired +(0014,0045) ST RETIRED_MaterialPropertiesFileFormatRetired 1 DICOM/retired +(0018,0030) LO RETIRED_Radionuclide 1-n DICOM/retired +(0018,0032) DS RETIRED_EnergyWindowCenterline 1 DICOM/retired +(0018,0033) DS RETIRED_EnergyWindowTotalWidth 1-n DICOM/retired +(0018,0037) CS RETIRED_TherapyType 1 DICOM/retired +(0018,0039) CS RETIRED_TherapyDescription 1 DICOM/retired +(0018,1011) LO RETIRED_HardcopyCreationDeviceID 1 DICOM/retired +(0018,1017) LO RETIRED_HardcopyDeviceManufacturer 1 DICOM/retired +(0018,101A) LO RETIRED_HardcopyDeviceSoftwareVersion 1-n DICOM/retired +(0018,101B) LO RETIRED_HardcopyDeviceManufacturerModelName 1 DICOM/retired +(0018,1141) DS RETIRED_AngularPosition 1 DICOM/retired +(0018,1146) DS RETIRED_RotationOffset 1-n DICOM/retired +(0018,1240) IS RETIRED_UpperLowerPixelValues 1-n DICOM/retired +(0018,4000) LT RETIRED_AcquisitionComments 1 DICOM/retired +(0018,5021) LO RETIRED_PostprocessingFunction 1 DICOM/retired +(0018,5030) DS RETIRED_DynamicRange 1 DICOM/retired +(0018,5040) DS RETIRED_TotalGain 1 DICOM/retired +(0018,5210) DS RETIRED_ImageTransformationMatrix 6 DICOM/retired +(0018,5212) DS RETIRED_ImageTranslationVector 3 DICOM/retired +(0018,6038) UL RETIRED_DopplerSampleVolumeXPositionRetired 1 DICOM/retired +(0018,603A) UL RETIRED_DopplerSampleVolumeYPositionRetired 1 DICOM/retired +(0018,603C) UL RETIRED_TMLinePositionX0Retired 1 DICOM/retired +(0018,603E) UL RETIRED_TMLinePositionY0Retired 1 DICOM/retired +(0018,6040) UL RETIRED_TMLinePositionX1Retired 1 DICOM/retired +(0018,6042) UL RETIRED_TMLinePositionY1Retired 1 DICOM/retired +(0018,9096) FD RETIRED_ParallelReductionFactorInPlaneRetired 1 DICOM/retired +(0018,9166) CS RETIRED_BulkMotionStatus 1 DICOM/retired +(0018,9195) FD RETIRED_ChemicalShiftMinimumIntegrationLimitInHz 1 DICOM/retired +(0018,9196) FD RETIRED_ChemicalShiftMaximumIntegrationLimitInHz 1 DICOM/retired +(0020,0014) IS RETIRED_IsotopeNumber 1 DICOM/retired +(0020,0015) IS RETIRED_PhaseNumber 1 DICOM/retired +(0020,0016) IS RETIRED_IntervalNumber 1 DICOM/retired +(0020,0017) IS RETIRED_TimeSlotNumber 1 DICOM/retired +(0020,0018) IS RETIRED_AngleNumber 1 DICOM/retired +(0020,0022) IS RETIRED_OverlayNumber 1 DICOM/retired +(0020,0024) IS RETIRED_CurveNumber 1 DICOM/retired +(0020,0026) IS RETIRED_LUTNumber 1 DICOM/retired +(0020,0030) DS RETIRED_ImagePosition 3 DICOM/retired +(0020,0035) DS RETIRED_ImageOrientation 6 DICOM/retired +(0020,0050) DS RETIRED_Location 1 DICOM/retired +(0020,0070) LO RETIRED_ImageGeometryType 1 DICOM/retired +(0020,0080) CS RETIRED_MaskingImage 1-n DICOM/retired +(0020,00AA) IS RETIRED_ReportNumber 1 DICOM/retired +(0020,1000) IS RETIRED_SeriesInStudy 1 DICOM/retired +(0020,1001) IS RETIRED_AcquisitionsInSeries 1 DICOM/retired +(0020,1003) IS RETIRED_ImagesInSeries 1 DICOM/retired +(0020,1004) IS RETIRED_AcquisitionsInStudy 1 DICOM/retired +(0020,1005) IS RETIRED_ImagesInStudy 1 DICOM/retired +(0020,1020) LO RETIRED_Reference 1-n DICOM/retired +(0020,1070) IS RETIRED_OtherStudyNumbers 1-n DICOM/retired +(0020,3100-31FF) CS RETIRED_SourceImageIDs 1-n DICOM/retired +(0020,3401) CS RETIRED_ModifyingDeviceID 1 DICOM/retired +(0020,3402) CS RETIRED_ModifiedImageID 1 DICOM/retired +(0020,3403) DA RETIRED_ModifiedImageDate 1 DICOM/retired +(0020,3404) LO RETIRED_ModifyingDeviceManufacturer 1 DICOM/retired +(0020,3405) TM RETIRED_ModifiedImageTime 1 DICOM/retired +(0020,3406) LO RETIRED_ModifiedImageDescription 1 DICOM/retired +(0020,5000) AT RETIRED_OriginalImageIdentification 1-n DICOM/retired +(0020,5002) LO RETIRED_OriginalImageIdentificationNomenclature 1-n DICOM/retired +(0022,1094) LO RETIRED_LensConstantDescription 1 DICOM/retired +(0022,1153) SQ RETIRED_OphthalmicAxialLengthAcquisitionMethodCodeSequence 1 DICOM/retired +(0022,1265) SQ RETIRED_OphthalmicAxialLengthQualityMetricTypeCodeSequence 1 DICOM/retired +(0022,1273) LO RETIRED_OphthalmicAxialLengthQualityMetricTypeDescription 1 DICOM/retired +(0028,0005) US RETIRED_ImageDimensions 1 DICOM/retired +(0028,0012) US RETIRED_Planes 1 DICOM/retired +(0028,0040) CS RETIRED_ImageFormat 1 DICOM/retired +(0028,0050) LO RETIRED_ManipulatedImage 1-n DICOM/retired +(0028,005F) LO RETIRED_CompressionRecognitionCode 1 DICOM/retired +(0028,0060) CS RETIRED_CompressionCode 1 DICOM/retired +(0028,0061) SH RETIRED_CompressionOriginator 1 DICOM/retired +(0028,0062) LO RETIRED_CompressionLabel 1 DICOM/retired +(0028,0063) SH RETIRED_CompressionDescription 1 DICOM/retired +(0028,0065) CS RETIRED_CompressionSequence 1-n DICOM/retired +(0028,0066) AT RETIRED_CompressionStepPointers 1-n DICOM/retired +(0028,0068) US RETIRED_RepeatInterval 1 DICOM/retired +(0028,0069) US RETIRED_BitsGrouped 1 DICOM/retired +(0028,0070) US RETIRED_PerimeterTable 1-n DICOM/retired +(0028,0071) xs RETIRED_PerimeterValue 1 DICOM/retired +(0028,0080) US RETIRED_PredictorRows 1 DICOM/retired +(0028,0081) US RETIRED_PredictorColumns 1 DICOM/retired +(0028,0082) US RETIRED_PredictorConstants 1-n DICOM/retired +(0028,0090) CS RETIRED_BlockedPixels 1 DICOM/retired +(0028,0091) US RETIRED_BlockRows 1 DICOM/retired +(0028,0092) US RETIRED_BlockColumns 1 DICOM/retired +(0028,0093) US RETIRED_RowOverlap 1 DICOM/retired +(0028,0094) US RETIRED_ColumnOverlap 1 DICOM/retired +(0028,0104) xs RETIRED_SmallestValidPixelValue 1 DICOM/retired +(0028,0105) xs RETIRED_LargestValidPixelValue 1 DICOM/retired +(0028,0110) xs RETIRED_SmallestImagePixelValueInPlane 1 DICOM/retired +(0028,0111) xs RETIRED_LargestImagePixelValueInPlane 1 DICOM/retired +(0028,0200) US RETIRED_ImageLocation 1 DICOM/retired +(0028,0400) LO RETIRED_TransformLabel 1 DICOM/retired +(0028,0401) LO RETIRED_TransformVersionNumber 1 DICOM/retired +(0028,0402) US RETIRED_NumberOfTransformSteps 1 DICOM/retired +(0028,0403) LO RETIRED_SequenceOfCompressedData 1-n DICOM/retired +(0028,0404) AT RETIRED_DetailsOfCoefficients 1-n DICOM/retired +#(0028,04X0) US RETIRED_RowsForNthOrderCoefficients 1 DICOM/retired +#(0028,04X1) US RETIRED_ColumnsForNthOrderCoefficients 1 DICOM/retired +#(0028,04X2) LO RETIRED_CoefficientCoding 1-n DICOM/retired +#(0028,04X3) AT RETIRED_CoefficientCodingPointers 1-n DICOM/retired +(0028,0700) LO RETIRED_DCTLabel 1 DICOM/retired +(0028,0701) CS RETIRED_DataBlockDescription 1-n DICOM/retired +(0028,0702) AT RETIRED_DataBlock 1-n DICOM/retired +(0028,0710) US RETIRED_NormalizationFactorFormat 1 DICOM/retired +(0028,0720) US RETIRED_ZonalMapNumberFormat 1 DICOM/retired +(0028,0721) AT RETIRED_ZonalMapLocation 1-n DICOM/retired +(0028,0722) US RETIRED_ZonalMapFormat 1 DICOM/retired +(0028,0730) US RETIRED_AdaptiveMapFormat 1 DICOM/retired +(0028,0740) US RETIRED_CodeNumberFormat 1 DICOM/retired +#(0028,08X0) CS RETIRED_CodeLabel 1-n DICOM/retired +#(0028,08X2) US RETIRED_NumberOfTables 1 DICOM/retired +#(0028,08X3) AT RETIRED_CodeTableLocation 1-n DICOM/retired +#(0028,08X4) US RETIRED_BitsForCodeWord 1 DICOM/retired +#(0028,08X8) AT RETIRED_ImageDataLocation 1-n DICOM/retired +(0028,1080) CS RETIRED_GrayScale 1 DICOM/retired +(0028,1100) xs RETIRED_GrayLookupTableDescriptor 3 DICOM/retired +(0028,1111) xs RETIRED_LargeRedPaletteColorLookupTableDescriptor 4 DICOM/retired +(0028,1112) xs RETIRED_LargeGreenPaletteColorLookupTableDescriptor 4 DICOM/retired +(0028,1113) xs RETIRED_LargeBluePaletteColorLookupTableDescriptor 4 DICOM/retired +(0028,1200) lt RETIRED_GrayLookupTableData 1-n DICOM/retired +(0028,1211) OW RETIRED_LargeRedPaletteColorLookupTableData 1 DICOM/retired +(0028,1212) OW RETIRED_LargeGreenPaletteColorLookupTableData 1 DICOM/retired +(0028,1213) OW RETIRED_LargeBluePaletteColorLookupTableData 1 DICOM/retired +(0028,1214) UI RETIRED_LargePaletteColorLookupTableUID 1 DICOM/retired +(0028,4000) LT RETIRED_ImagePresentationComments 1 DICOM/retired +(0028,5000) SQ RETIRED_BiPlaneAcquisitionSequence 1 DICOM/retired +(0028,6030) US RETIRED_MaskPointers 1-n DICOM/retired +(0028,9099) US RETIRED_LargestMonochromePixelValue 1 DICOM/retired +(0032,000A) CS RETIRED_StudyStatusID 1 DICOM/retired +(0032,000C) CS RETIRED_StudyPriorityID 1 DICOM/retired +(0032,0012) LO RETIRED_StudyIDIssuer 1 DICOM/retired +(0032,0032) DA RETIRED_StudyVerifiedDate 1 DICOM/retired +(0032,0033) TM RETIRED_StudyVerifiedTime 1 DICOM/retired +(0032,0034) DA RETIRED_StudyReadDate 1 DICOM/retired +(0032,0035) TM RETIRED_StudyReadTime 1 DICOM/retired +(0032,1000) DA RETIRED_ScheduledStudyStartDate 1 DICOM/retired +(0032,1001) TM RETIRED_ScheduledStudyStartTime 1 DICOM/retired +(0032,1010) DA RETIRED_ScheduledStudyStopDate 1 DICOM/retired +(0032,1011) TM RETIRED_ScheduledStudyStopTime 1 DICOM/retired +(0032,1020) LO RETIRED_ScheduledStudyLocation 1 DICOM/retired +(0032,1021) AE RETIRED_ScheduledStudyLocationAETitle 1-n DICOM/retired +(0032,1030) LO RETIRED_ReasonForStudy 1 DICOM/retired +(0032,1040) DA RETIRED_StudyArrivalDate 1 DICOM/retired +(0032,1041) TM RETIRED_StudyArrivalTime 1 DICOM/retired +(0032,1050) DA RETIRED_StudyCompletionDate 1 DICOM/retired +(0032,1051) TM RETIRED_StudyCompletionTime 1 DICOM/retired +(0032,1055) CS RETIRED_StudyComponentStatusID 1 DICOM/retired +(0032,4000) LT RETIRED_StudyComments 1 DICOM/retired +(0038,0011) LO RETIRED_IssuerOfAdmissionID 1 DICOM/retired +(0038,001A) DA RETIRED_ScheduledAdmissionDate 1 DICOM/retired +(0038,001B) TM RETIRED_ScheduledAdmissionTime 1 DICOM/retired +(0038,001C) DA RETIRED_ScheduledDischargeDate 1 DICOM/retired +(0038,001D) TM RETIRED_ScheduledDischargeTime 1 DICOM/retired +(0038,001E) LO RETIRED_ScheduledPatientInstitutionResidence 1 DICOM/retired +(0038,0030) DA RETIRED_DischargeDate 1 DICOM/retired +(0038,0032) TM RETIRED_DischargeTime 1 DICOM/retired +(0038,0040) LO RETIRED_DischargeDiagnosisDescription 1 DICOM/retired +(0038,0044) SQ RETIRED_DischargeDiagnosisCodeSequence 1 DICOM/retired +(0038,0061) LO RETIRED_IssuerOfServiceEpisodeID 1 DICOM/retired +(0040,0300) US RETIRED_TotalTimeOfFluoroscopy 1 DICOM/retired +(0040,0301) US RETIRED_TotalNumberOfExposures 1 DICOM/retired +(0040,0307) DS RETIRED_DistanceSourceToSupport 1 DICOM/retired +(0040,030E) SQ RETIRED_ExposureDoseSequence 1 DICOM/retired +(0040,0330) SQ RETIRED_ReferencedProcedureStepSequence 1 DICOM/retired +(0040,050A) LO RETIRED_SpecimenAccessionNumber 1 DICOM/retired +(0040,0550) SQ RETIRED_SpecimenSequence 1 DICOM/retired +(0040,0552) SQ RETIRED_SpecimenDescriptionSequenceTrial 1 DICOM/retired +(0040,0553) ST RETIRED_SpecimenDescriptionTrial 1 DICOM/retired +(0040,06FA) LO RETIRED_SlideIdentifier 1 DICOM/retired +(0040,08D8) SQ RETIRED_PixelSpacingSequence 1 DICOM/retired +(0040,08DA) SQ RETIRED_CoordinateSystemAxisCodeSequence 1 DICOM/retired +(0040,09F8) SQ RETIRED_VitalStainCodeSequenceTrial 1 DICOM/retired +(0040,1006) SH RETIRED_PlacerOrderNumberProcedure 1 DICOM/retired +(0040,1007) SH RETIRED_FillerOrderNumberProcedure 1 DICOM/retired +(0040,1060) LO RETIRED_RequestedProcedureDescriptionTrial 1 DICOM/retired +(0040,2001) LO RETIRED_ReasonForTheImagingServiceRequest 1 DICOM/retired +(0040,2006) SH RETIRED_PlacerOrderNumberImagingServiceRequestRetired 1 DICOM/retired +(0040,2007) SH RETIRED_FillerOrderNumberImagingServiceRequestRetired 1 DICOM/retired +(0040,4001) CS RETIRED_GeneralPurposeScheduledProcedureStepStatus 1 DICOM/retired +(0040,4002) CS RETIRED_GeneralPurposePerformedProcedureStepStatus 1 DICOM/retired +(0040,4003) CS RETIRED_GeneralPurposeScheduledProcedureStepPriority 1 DICOM/retired +(0040,4004) SQ RETIRED_ScheduledProcessingApplicationsCodeSequence 1 DICOM/retired +(0040,4006) CS RETIRED_MultipleCopiesFlag 1 DICOM/retired +(0040,4007) SQ RETIRED_PerformedProcessingApplicationsCodeSequence 1 DICOM/retired +(0040,4015) SQ RETIRED_ResultingGeneralPurposePerformedProcedureStepsSequence 1 DICOM/retired +(0040,4016) SQ RETIRED_ReferencedGeneralPurposeScheduledProcedureStepSequence 1 DICOM/retired +(0040,4020) CS RETIRED_InputAvailabilityFlag 1 DICOM/retired +(0040,4022) SQ RETIRED_RelevantInformationSequence 1 DICOM/retired +(0040,4023) UI RETIRED_ReferencedGeneralPurposeScheduledProcedureStepTransactionUID 1 DICOM/retired +(0040,4031) SQ RETIRED_RequestedSubsequentWorkitemCodeSequence 1 DICOM/retired +(0040,4032) SQ RETIRED_NonDICOMOutputCodeSequence 1 DICOM/retired +(0040,A007) CS RETIRED_FindingsFlagTrial 1 DICOM/retired +(0040,A020) SQ RETIRED_FindingsSequenceTrial 1 DICOM/retired +(0040,A021) UI RETIRED_FindingsGroupUIDTrial 1 DICOM/retired +(0040,A022) UI RETIRED_ReferencedFindingsGroupUIDTrial 1 DICOM/retired +(0040,A023) DA RETIRED_FindingsGroupRecordingDateTrial 1 DICOM/retired +(0040,A024) TM RETIRED_FindingsGroupRecordingTimeTrial 1 DICOM/retired +(0040,A026) SQ RETIRED_FindingsSourceCategoryCodeSequenceTrial 1 DICOM/retired +(0040,A028) SQ RETIRED_DocumentingOrganizationIdentifierCodeSequenceTrial 1 DICOM/retired +(0040,A047) LO RETIRED_MeasurementPrecisionDescriptionTrial 1 DICOM/retired +(0040,A057) CS RETIRED_UrgencyOrPriorityAlertsTrial 1-n DICOM/retired +(0040,A060) LO RETIRED_SequencingIndicatorTrial 1 DICOM/retired +(0040,A066) SQ RETIRED_DocumentIdentifierCodeSequenceTrial 1 DICOM/retired +(0040,A067) PN RETIRED_DocumentAuthorTrial 1 DICOM/retired +(0040,A068) SQ RETIRED_DocumentAuthorIdentifierCodeSequenceTrial 1 DICOM/retired +(0040,A070) SQ RETIRED_IdentifierCodeSequenceTrial 1 DICOM/retired +(0040,A074) OB RETIRED_ObjectBinaryIdentifierTrial 1 DICOM/retired +(0040,A076) SQ RETIRED_DocumentingObserverIdentifierCodeSequenceTrial 1 DICOM/retired +(0040,A085) SQ RETIRED_ProcedureIdentifierCodeSequenceTrial 1 DICOM/retired +(0040,A089) OB RETIRED_ObjectDirectoryBinaryIdentifierTrial 1 DICOM/retired +(0040,A090) SQ RETIRED_EquivalentCDADocumentSequence 1 DICOM/retired +(0040,A110) DA RETIRED_DateOfDocumentOrVerbalTransactionTrial 1 DICOM/retired +(0040,A112) TM RETIRED_TimeOfDocumentCreationOrVerbalTransactionTrial 1 DICOM/retired +(0040,A125) CS RETIRED_ReportStatusIDTrial 2 DICOM/retired +(0040,A136) US RETIRED_ReferencedFrameNumbers 1-n DICOM/retired +(0040,A167) SQ RETIRED_ObservationCategoryCodeSequenceTrial 1 DICOM/retired +(0040,A16A) ST RETIRED_BibliographicCitationTrial 1 DICOM/retired +(0040,A172) UI RETIRED_ReferencedObservationUIDTrial 1 DICOM/retired +(0040,A173) CS RETIRED_ReferencedObservationClassTrial 1 DICOM/retired +(0040,A174) CS RETIRED_ReferencedObjectObservationClassTrial 1 DICOM/retired +(0040,A192) DA RETIRED_ObservationDateTrial 1 DICOM/retired +(0040,A193) TM RETIRED_ObservationTimeTrial 1 DICOM/retired +(0040,A194) CS RETIRED_MeasurementAutomationTrial 1 DICOM/retired +(0040,A224) ST RETIRED_IdentificationDescriptionTrial 1 DICOM/retired +(0040,A290) CS RETIRED_CoordinatesSetGeometricTypeTrial 1 DICOM/retired +(0040,A296) SQ RETIRED_AlgorithmCodeSequenceTrial 1 DICOM/retired +(0040,A297) ST RETIRED_AlgorithmDescriptionTrial 1 DICOM/retired +(0040,A29A) SL RETIRED_PixelCoordinatesSetTrial 2-2n DICOM/retired +(0040,A307) PN RETIRED_CurrentObserverTrial 1 DICOM/retired +(0040,A313) SQ RETIRED_ReferencedAccessionSequenceTrial 1 DICOM/retired +(0040,A33A) ST RETIRED_ReportStatusCommentTrial 1 DICOM/retired +(0040,A340) SQ RETIRED_ProcedureContextSequenceTrial 1 DICOM/retired +(0040,A352) PN RETIRED_VerbalSourceTrial 1 DICOM/retired +(0040,A353) ST RETIRED_AddressTrial 1 DICOM/retired +(0040,A354) LO RETIRED_TelephoneNumberTrial 1 DICOM/retired +(0040,A358) SQ RETIRED_VerbalSourceIdentifierCodeSequenceTrial 1 DICOM/retired +(0040,A380) SQ RETIRED_ReportDetailSequenceTrial 1 DICOM/retired +(0040,A402) UI RETIRED_ObservationSubjectUIDTrial 1 DICOM/retired +(0040,A403) CS RETIRED_ObservationSubjectClassTrial 1 DICOM/retired +(0040,A404) SQ RETIRED_ObservationSubjectTypeCodeSequenceTrial 1 DICOM/retired +(0040,A600) CS RETIRED_ObservationSubjectContextFlagTrial 1 DICOM/retired +(0040,A601) CS RETIRED_ObserverContextFlagTrial 1 DICOM/retired +(0040,A603) CS RETIRED_ProcedureContextFlagTrial 1 DICOM/retired +(0040,A731) SQ RETIRED_RelationshipSequenceTrial 1 DICOM/retired +(0040,A732) SQ RETIRED_RelationshipTypeCodeSequenceTrial 1 DICOM/retired +(0040,A744) SQ RETIRED_LanguageCodeSequenceTrial 1 DICOM/retired +(0040,A992) ST RETIRED_UniformResourceLocatorTrial 1 DICOM/retired +(0040,DB06) DT RETIRED_TemplateVersion 1 DICOM/retired +(0040,DB07) DT RETIRED_TemplateLocalVersion 1 DICOM/retired +(0040,DB0B) CS RETIRED_TemplateExtensionFlag 1 DICOM/retired +(0040,DB0C) UI RETIRED_TemplateExtensionOrganizationUID 1 DICOM/retired +(0040,DB0D) UI RETIRED_TemplateExtensionCreatorUID 1 DICOM/retired +(0054,1400) CS RETIRED_CountsIncluded 1-n DICOM/retired +(0054,1401) CS RETIRED_DeadTimeCorrectionFlag 1 DICOM/retired +(0066,0023) OW RETIRED_TrianglePointIndexList 1 DICOM/retired +(0066,0024) OW RETIRED_EdgePointIndexList 1 DICOM/retired +(0066,0025) OW RETIRED_VertexPointIndexList 1 DICOM/retired +(0066,0029) OW RETIRED_PrimitivePointIndexList 1 DICOM/retired +(0070,0040) IS RETIRED_ImageRotationRetired 1 DICOM/retired +(0070,0050) US RETIRED_DisplayedAreaTopLeftHandCornerTrial 2 DICOM/retired +(0070,0051) US RETIRED_DisplayedAreaBottomRightHandCornerTrial 2 DICOM/retired +(0070,0067) US RETIRED_GraphicLayerRecommendedDisplayRGBValue 3 DICOM/retired +(0070,1206) CS RETIRED_CompositingMethod 1 DICOM/retired +(0074,1024) IS RETIRED_BeamOrderIndexTrial 1 DICOM/retired +(0074,1038) DS RETIRED_DoubleExposureMetersetTrial 1 DICOM/retired +(0074,103A) DS RETIRED_DoubleExposureFieldDeltaTrial 4 DICOM/retired +(0074,1220) SQ RETIRED_RelatedProcedureStepSequence 1 DICOM/retired +(0074,1222) LO RETIRED_ProcedureStepRelationshipType 1 DICOM/retired +(0088,0904) LO RETIRED_TopicTitle 1 DICOM/retired +(0088,0906) ST RETIRED_TopicSubject 1 DICOM/retired +(0088,0910) LO RETIRED_TopicAuthor 1 DICOM/retired +(0088,0912) LO RETIRED_TopicKeywords 1-32 DICOM/retired +#(1000,XX00-XXFF) US RETIRED_EscapeTriplet 3 DICOM/retired +#(1000,XX00-XXFF) US RETIRED_RunLengthTriplet 3 DICOM/retired +#(1000,XX00-XXFF) US RETIRED_HuffmanTableSize 1 DICOM/retired +#(1000,XX00-XXFF) US RETIRED_HuffmanTableTriplet 3 DICOM/retired +#(1000,XX00-XXFF) US RETIRED_ShiftTableSize 1 DICOM/retired +#(1000,XX00-XXFF) US RETIRED_ShiftTableTriplet 3 DICOM/retired +#(1010,XX00-XXFF) US RETIRED_ZonalMap 1-n DICOM/retired +(2000,0062) CS RETIRED_ColorImagePrintingFlag 1 DICOM/retired +(2000,0063) CS RETIRED_CollationFlag 1 DICOM/retired +(2000,0065) CS RETIRED_AnnotationFlag 1 DICOM/retired +(2000,0067) CS RETIRED_ImageOverlayFlag 1 DICOM/retired +(2000,0069) CS RETIRED_PresentationLUTFlag 1 DICOM/retired +(2000,006A) CS RETIRED_ImageBoxPresentationLUTFlag 1 DICOM/retired +(2000,0510) SQ RETIRED_ReferencedStoredPrintSequence 1 DICOM/retired +(2020,0130) SQ RETIRED_ReferencedImageOverlayBoxSequence 1 DICOM/retired +(2020,0140) SQ RETIRED_ReferencedVOILUTBoxSequence 1 DICOM/retired +(2040,0010) SQ RETIRED_ReferencedOverlayPlaneSequence 1 DICOM/retired +(2040,0011) US RETIRED_ReferencedOverlayPlaneGroups 1-99 DICOM/retired +(2040,0020) SQ RETIRED_OverlayPixelDataSequence 1 DICOM/retired +(2040,0060) CS RETIRED_OverlayMagnificationType 1 DICOM/retired +(2040,0070) CS RETIRED_OverlaySmoothingType 1 DICOM/retired +(2040,0072) CS RETIRED_OverlayOrImageMagnification 1 DICOM/retired +(2040,0074) US RETIRED_MagnifyToNumberOfColumns 1 DICOM/retired +(2040,0080) CS RETIRED_OverlayForegroundDensity 1 DICOM/retired +(2040,0082) CS RETIRED_OverlayBackgroundDensity 1 DICOM/retired +(2040,0090) CS RETIRED_OverlayMode 1 DICOM/retired +(2040,0100) CS RETIRED_ThresholdDensity 1 DICOM/retired +(2040,0500) SQ RETIRED_ReferencedImageBoxSequenceRetired 1 DICOM/retired +(2100,0010) SH RETIRED_PrintJobID 1 DICOM/retired +(2100,0500) SQ RETIRED_ReferencedPrintJobSequencePullStoredPrint 1 DICOM/retired +(2110,0099) SH RETIRED_PrintQueueID 1 DICOM/retired +(2120,0010) CS RETIRED_QueueStatus 1 DICOM/retired +(2120,0050) SQ RETIRED_PrintJobDescriptionSequence 1 DICOM/retired +(2120,0070) SQ RETIRED_ReferencedPrintJobSequence 1 DICOM/retired +(2130,0010) SQ RETIRED_PrintManagementCapabilitiesSequence 1 DICOM/retired +(2130,0015) SQ RETIRED_PrinterCharacteristicsSequence 1 DICOM/retired +(2130,0030) SQ RETIRED_FilmBoxContentSequence 1 DICOM/retired +(2130,0040) SQ RETIRED_ImageBoxContentSequence 1 DICOM/retired +(2130,0050) SQ RETIRED_AnnotationContentSequence 1 DICOM/retired +(2130,0060) SQ RETIRED_ImageOverlayBoxContentSequence 1 DICOM/retired +(2130,0080) SQ RETIRED_PresentationLUTContentSequence 1 DICOM/retired +(2130,00A0) SQ RETIRED_ProposedStudySequence 1 DICOM/retired +(2130,00C0) SQ RETIRED_OriginalImageSequence 1 DICOM/retired +(3006,00B9) SQ RETIRED_AdditionalRTROIIdentificationCodeSequence 1 DICOM/retired +(3006,00C0) SQ RETIRED_FrameOfReferenceRelationshipSequence 1 DICOM/retired +(3006,00C2) UI RETIRED_RelatedFrameOfReferenceUID 1 DICOM/retired +(3006,00C4) CS RETIRED_FrameOfReferenceTransformationType 1 DICOM/retired +(300A,008D) FL RETIRED_AverageBeamDosePointDepth 1 DICOM/retired +(300A,008E) FL RETIRED_AverageBeamDosePointEquivalentDepth 1 DICOM/retired +(300A,008F) FL RETIRED_AverageBeamDosePointSSD 1 DICOM/retired +(4000,0010) LT RETIRED_Arbitrary 1 DICOM/retired +(4000,4000) LT RETIRED_TextComments 1 DICOM/retired +(4008,0040) SH RETIRED_ResultsID 1 DICOM/retired +(4008,0042) LO RETIRED_ResultsIDIssuer 1 DICOM/retired +(4008,0050) SQ RETIRED_ReferencedInterpretationSequence 1 DICOM/retired +(4008,00FF) CS RETIRED_ReportProductionStatusTrial 1 DICOM/retired +(4008,0100) DA RETIRED_InterpretationRecordedDate 1 DICOM/retired +(4008,0101) TM RETIRED_InterpretationRecordedTime 1 DICOM/retired +(4008,0102) PN RETIRED_InterpretationRecorder 1 DICOM/retired +(4008,0103) LO RETIRED_ReferenceToRecordedSound 1 DICOM/retired +(4008,0108) DA RETIRED_InterpretationTranscriptionDate 1 DICOM/retired +(4008,0109) TM RETIRED_InterpretationTranscriptionTime 1 DICOM/retired +(4008,010A) PN RETIRED_InterpretationTranscriber 1 DICOM/retired +(4008,010B) ST RETIRED_InterpretationText 1 DICOM/retired +(4008,010C) PN RETIRED_InterpretationAuthor 1 DICOM/retired +(4008,0111) SQ RETIRED_InterpretationApproverSequence 1 DICOM/retired +(4008,0112) DA RETIRED_InterpretationApprovalDate 1 DICOM/retired +(4008,0113) TM RETIRED_InterpretationApprovalTime 1 DICOM/retired +(4008,0114) PN RETIRED_PhysicianApprovingInterpretation 1 DICOM/retired +(4008,0115) LT RETIRED_InterpretationDiagnosisDescription 1 DICOM/retired +(4008,0117) SQ RETIRED_InterpretationDiagnosisCodeSequence 1 DICOM/retired +(4008,0118) SQ RETIRED_ResultsDistributionListSequence 1 DICOM/retired +(4008,0119) PN RETIRED_DistributionName 1 DICOM/retired +(4008,011A) LO RETIRED_DistributionAddress 1 DICOM/retired +(4008,0200) SH RETIRED_InterpretationID 1 DICOM/retired +(4008,0202) LO RETIRED_InterpretationIDIssuer 1 DICOM/retired +(4008,0210) CS RETIRED_InterpretationTypeID 1 DICOM/retired +(4008,0212) CS RETIRED_InterpretationStatusID 1 DICOM/retired +(4008,0300) ST RETIRED_Impressions 1 DICOM/retired +(4008,4000) ST RETIRED_ResultsComments 1 DICOM/retired +(5000-50FF,0005) US RETIRED_CurveDimensions 1 DICOM/retired +(5000-50FF,0010) US RETIRED_NumberOfPoints 1 DICOM/retired +(5000-50FF,0020) CS RETIRED_TypeOfData 1 DICOM/retired +(5000-50FF,0022) LO RETIRED_CurveDescription 1 DICOM/retired +(5000-50FF,0030) SH RETIRED_AxisUnits 1-n DICOM/retired +(5000-50FF,0040) SH RETIRED_AxisLabels 1-n DICOM/retired +(5000-50FF,0103) US RETIRED_DataValueRepresentation 1 DICOM/retired +(5000-50FF,0104) US RETIRED_MinimumCoordinateValue 1-n DICOM/retired +(5000-50FF,0105) US RETIRED_MaximumCoordinateValue 1-n DICOM/retired +(5000-50FF,0106) SH RETIRED_CurveRange 1-n DICOM/retired +(5000-50FF,0110) US RETIRED_CurveDataDescriptor 1-n DICOM/retired +(5000-50FF,0112) US RETIRED_CoordinateStartValue 1-n DICOM/retired +(5000-50FF,0114) US RETIRED_CoordinateStepValue 1-n DICOM/retired +(5000-50FF,1001) CS RETIRED_CurveActivationLayer 1 DICOM/retired +(5000-50FF,2000) US RETIRED_AudioType 1 DICOM/retired +(5000-50FF,2002) US RETIRED_AudioSampleFormat 1 DICOM/retired +(5000-50FF,2004) US RETIRED_NumberOfChannels 1 DICOM/retired +(5000-50FF,2006) UL RETIRED_NumberOfSamples 1 DICOM/retired +(5000-50FF,2008) UL RETIRED_SampleRate 1 DICOM/retired +(5000-50FF,200A) UL RETIRED_TotalTime 1 DICOM/retired +(5000-50FF,200C) ox RETIRED_AudioSampleData 1 DICOM/retired +(5000-50FF,200E) LT RETIRED_AudioComments 1 DICOM/retired +(5000-50FF,2500) LO RETIRED_CurveLabel 1 DICOM/retired +(5000-50FF,2600) SQ RETIRED_CurveReferencedOverlaySequence 1 DICOM/retired +(5000-50FF,2610) US RETIRED_CurveReferencedOverlayGroup 1 DICOM/retired +(5000-50FF,3000) ox RETIRED_CurveData 1 DICOM/retired +(6000-60FF,0012) US RETIRED_OverlayPlanes 1 DICOM/retired +(6000-60FF,0052) US RETIRED_OverlayPlaneOrigin 1 DICOM/retired +(6000-60FF,0060) CS RETIRED_OverlayCompressionCode 1 DICOM/retired +(6000-60FF,0061) SH RETIRED_OverlayCompressionOriginator 1 DICOM/retired +(6000-60FF,0062) SH RETIRED_OverlayCompressionLabel 1 DICOM/retired +(6000-60FF,0063) CS RETIRED_OverlayCompressionDescription 1 DICOM/retired +(6000-60FF,0066) AT RETIRED_OverlayCompressionStepPointers 1-n DICOM/retired +(6000-60FF,0068) US RETIRED_OverlayRepeatInterval 1 DICOM/retired +(6000-60FF,0069) US RETIRED_OverlayBitsGrouped 1 DICOM/retired +(6000-60FF,0110) CS RETIRED_OverlayFormat 1 DICOM/retired +(6000-60FF,0200) US RETIRED_OverlayLocation 1 DICOM/retired +(6000-60FF,0800) CS RETIRED_OverlayCodeLabel 1-n DICOM/retired +(6000-60FF,0802) US RETIRED_OverlayNumberOfTables 1 DICOM/retired +(6000-60FF,0803) AT RETIRED_OverlayCodeTableLocation 1-n DICOM/retired +(6000-60FF,0804) US RETIRED_OverlayBitsForCodeWord 1 DICOM/retired +(6000-60FF,1100) US RETIRED_OverlayDescriptorGray 1 DICOM/retired +(6000-60FF,1101) US RETIRED_OverlayDescriptorRed 1 DICOM/retired +(6000-60FF,1102) US RETIRED_OverlayDescriptorGreen 1 DICOM/retired +(6000-60FF,1103) US RETIRED_OverlayDescriptorBlue 1 DICOM/retired +(6000-60FF,1200) US RETIRED_OverlaysGray 1-n DICOM/retired +(6000-60FF,1201) US RETIRED_OverlaysRed 1-n DICOM/retired +(6000-60FF,1202) US RETIRED_OverlaysGreen 1-n DICOM/retired +(6000-60FF,1203) US RETIRED_OverlaysBlue 1-n DICOM/retired +(6000-60FF,4000) LT RETIRED_OverlayComments 1 DICOM/retired +(7FE0,0020) OW RETIRED_CoefficientsSDVN 1 DICOM/retired +(7FE0,0030) OW RETIRED_CoefficientsSDHN 1 DICOM/retired +(7FE0,0040) OW RETIRED_CoefficientsSDDN 1 DICOM/retired +(7F00-7FFF,0010) ox RETIRED_VariablePixelData 1 DICOM/retired +(7F00-7FFF,0011) US RETIRED_VariableNextDataGroup 1 DICOM/retired +(7F00-7FFF,0020) OW RETIRED_VariableCoefficientsSDVN 1 DICOM/retired +(7F00-7FFF,0030) OW RETIRED_VariableCoefficientsSDHN 1 DICOM/retired +(7F00-7FFF,0040) OW RETIRED_VariableCoefficientsSDDN 1 DICOM/retired +# +#--------------------------------------------------------------------------- +# +# Supplement 175 (Second Generation Radiotherapy - C-Arm RT Treatment Modalities) +# +(0018,100B) UI ManufacturerDeviceClassUID 1-n DICOM/Supplement_175 +(0018,1630) CS OutlineShapeType 1 DICOM/Supplement_175 +(0018,1631) FD OutlineLeftVerticalEdge 1 DICOM/Supplement_175 +(0018,1632) FD OutlineRightVerticalEdge 1 DICOM/Supplement_175 +(0018,1633) FD OutlineUpperHorizontalEdge 1 DICOM/Supplement_175 +(0018,1634) FD OutlineLowerHorizontalEdge 1 DICOM/Supplement_175 +(0018,1635) FD CenterOfCircularOutline 2 DICOM/Supplement_175 +(0018,1636) FD DiameterOfCircularOutline 1 DICOM/Supplement_175 +(0018,1637) UL NumberOfPolygonalVertices 1 DICOM/Supplement_175 +(0018,1638) OF VerticesOfThePolygonalOutline 1 DICOM/Supplement_175 +(3006,00C9) SQ PatientLocationCoordinatesSequence 1 DICOM/Supplement_175 +(3006,00CA) SQ PatientLocationCoordinatesCodeSequence 1 DICOM/Supplement_175 +(3006,00CB) SQ PatientSupportPositionSequence 1 DICOM/Supplement_175 +(300A,0600) US RTControlPointIndex 1 DICOM/Supplement_175 +(300A,0601) US RadiationGenerationModeIndex 1 DICOM/Supplement_175 +(300A,0602) US ReferencedDefinedDeviceIndex 1 DICOM/Supplement_175 +(300A,0603) US RadiationDoseIdentificationIndex 1 DICOM/Supplement_175 +(300A,0604) US NumberOfRTControlPoints 1 DICOM/Supplement_175 +(300A,0605) US ReferencedRadiationGenerationModeIndex 1 DICOM/Supplement_175 +(300A,0606) US TreatmentPositionIndex 1 DICOM/Supplement_175 +(300A,0607) US ReferencedDeviceIndex 1 DICOM/Supplement_175 +(300A,0608) LO TreatmentPositionGroupLabel 1 DICOM/Supplement_175 +(300A,0609) UI TreatmentPositionGroupUID 1 DICOM/Supplement_175 +(300A,060A) SQ TreatmentPositionGroupSequence 1 DICOM/Supplement_175 +(300A,060B) US ReferencedTreatmentPositionIndex 1 DICOM/Supplement_175 +(300A,060C) US ReferencedRadiationDoseIdentificationIndex 1 DICOM/Supplement_175 +(300A,060D) FD RTAccessoryHolderWaterEquivalentThickness 1 DICOM/Supplement_175 +(300A,060E) US ReferencedRTAccessoryHolderDeviceIndex 1 DICOM/Supplement_175 +(300A,060F) CS RTAccessoryHolderSlotExistenceFlag 1 DICOM/Supplement_175 +(300A,0610) SQ RTAccessoryHolderSlotSequence 1 DICOM/Supplement_175 +(300A,0611) LO RTAccessoryHolderSlotID 1 DICOM/Supplement_175 +(300A,0612) FD RTAccessoryHolderSlotDistance 1 DICOM/Supplement_175 +(300A,0613) FD RTAccessorySlotDistance 1 DICOM/Supplement_175 +(300A,0614) SQ RTAccessoryHolderDefinitionSequence 1 DICOM/Supplement_175 +(300A,0615) LO RTAccessoryDeviceSlotID 1 DICOM/Supplement_175 +(300A,0616) SQ RTRadiationSequence 1 DICOM/Supplement_175 +(300A,0617) SQ RadiationDoseSequence 1 DICOM/Supplement_175 +(300A,0618) SQ RadiationDoseIdentificationSequence 1 DICOM/Supplement_175 +(300A,0619) LO RadiationDoseIdentificationLabel 1 DICOM/Supplement_175 +(300A,061A) CS ReferenceDoseType 1 DICOM/Supplement_175 +(300A,061B) CS PrimaryDoseValueIndicator 1 DICOM/Supplement_175 +(300A,061C) SQ DoseValuesSequence 1 DICOM/Supplement_175 +(300A,061D) CS DoseValuePurpose 1-n DICOM/Supplement_175 +(300A,061E) FD ReferenceDosePointCoordinates 3 DICOM/Supplement_175 +(300A,061F) SQ RadiationDoseValuesParametersSequence 1 DICOM/Supplement_175 +(300A,0620) SQ MetersetToDoseMappingSequence 1 DICOM/Supplement_175 +(300A,0621) SQ ExpectedInVivoMeasurementValuesSequence 1 DICOM/Supplement_175 +(300A,0622) US ExpectedInVivoMeasurementValueIndex 1 DICOM/Supplement_175 +(300A,0623) LO RadiationDoseInVivoMeasurementLabel 1 DICOM/Supplement_175 +(300A,0624) FD RadiationDoseCentralAxisDisplacement 2 DICOM/Supplement_175 +(300A,0625) FD RadiationDoseValue 1 DICOM/Supplement_175 +(300A,0626) FD RadiationDoseSourceToSkinDistance 1 DICOM/Supplement_175 +(300A,0627) FD RadiationDoseMeasurementPointCoordinates 3 DICOM/Supplement_175 +(300A,0628) FD RadiationDoseSourceToExternalContourDistance 1 DICOM/Supplement_175 +(300A,0629) SQ RTToleranceSetSequence 1 DICOM/Supplement_175 +(300A,062A) LO RTToleranceSetLabel 1 DICOM/Supplement_175 +(300A,062B) SQ AttributeToleranceValuesSequence 1 DICOM/Supplement_175 +(300A,062C) FD ToleranceValue 1 DICOM/Supplement_175 +(300A,062D) SQ PatientSupportPositionToleranceSequence 1 DICOM/Supplement_175 +(300A,062E) FD TreatmentTimeLimit 1 DICOM/Supplement_175 +(300A,062F) SQ CArmPhotonElectronControlPointSequence 1 DICOM/Supplement_175 +(300A,0630) SQ ReferencedRTRadiationSequence 1 DICOM/Supplement_175 +(300A,0631) SQ ReferencedRTInstanceSequence 1 DICOM/Supplement_175 +(300A,0632) SQ ReferencedRTPatientSetupSequence 1 DICOM/Supplement_175 +(300A,0634) FD SourceToPatientSurfaceDistance 1 DICOM/Supplement_175 +(300A,0635) SQ TreatmentMachineSpecialModeCodeSequence 1 DICOM/Supplement_175 +(300A,0636) US IntendedNumberOfFractions 1 DICOM/Supplement_175 +(300A,0637) CS RTRadiationSetIntent 1 DICOM/Supplement_175 +(300A,0638) CS RTRadiationPhysicalAndGeometricContentDetailFlag 1 DICOM/Supplement_175 +(300A,0639) CS RTRecordFlag 1 DICOM/Supplement_175 +(300A,063A) SQ TreatmentDeviceIdentificationSequence 1 DICOM/Supplement_175 +(300A,063B) SQ ReferencedRTPhysicianIntentSequence 1 DICOM/Supplement_175 +(300A,063C) FD CumulativeMeterset 1 DICOM/Supplement_175 +(300A,063D) FD DeliveryRate 1 DICOM/Supplement_175 +(300A,063E) SQ DeliveryRateUnitSequence 1 DICOM/Supplement_175 +(300A,063F) SQ TreatmentPositionSequence 1 DICOM/Supplement_175 +(300A,0640) FD RadiationSourceAxisDistance 1 DICOM/Supplement_175 +(300A,0641) US NumberOfRTBeamLimitingDevices 1 DICOM/Supplement_175 +(300A,0642) FD RTBeamLimitingDeviceProximalDistance 1 DICOM/Supplement_175 +(300A,0643) FD RTBeamLimitingDeviceDistalDistance 1 DICOM/Supplement_175 +(300A,0644) SQ ParallelRTBeamDelimiterDeviceOrientationLabelCodeSequence 1 DICOM/Supplement_175 +(300A,0645) FD BeamsModifierOrientationAngle 1 DICOM/Supplement_175 +(300A,0646) SQ FixedRTBeamDelimiterDeviceSequence 1 DICOM/Supplement_175 +(300A,0647) SQ ParallelRTBeamDelimiterDeviceSequence 1 DICOM/Supplement_175 +(300A,0648) US NumberOfParallelRTBeamDelimiters 1 DICOM/Supplement_175 +(300A,0649) FD ParallelRTBeamDelimiterBoundaries 2-n DICOM/Supplement_175 +(300A,064A) FD ParallelRTBeamDelimiterPositions 2-n DICOM/Supplement_175 +(300A,064B) FD RTBeamLimitingDeviceOffset 2 DICOM/Supplement_175 +(300A,064C) SQ RTBeamDelimiterGeometrySequence 1 DICOM/Supplement_175 +(300A,064D) SQ RTBeamLimitingDeviceDefinitionSequence 1 DICOM/Supplement_175 +(300A,064E) CS ParallelRTBeamDelimiterOpeningMode 1 DICOM/Supplement_175 +(300A,064F) CS ParallelRTBeamDelimiterLeafMountingSide 1-n DICOM/Supplement_175 +(300A,0650) UI PatientSetupUID 1 DICOM/Supplement_175 +(300A,0651) SQ WedgeDefinitionSequence 1 DICOM/Supplement_175 +(300A,0652) FD RadiationBeamWedgeAngle 1 DICOM/Supplement_175 +(300A,0653) FD RadiationBeamWedgeThinEdgeDistance 1 DICOM/Supplement_175 +(300A,0654) FD RadiationBeamEffectiveWedgeAngle 1 DICOM/Supplement_175 +(300A,0655) US NumberOfWedgePositions 1 DICOM/Supplement_175 +(300A,0656) SQ RTBeamLimitingDeviceOpeningSequence 1 DICOM/Supplement_175 +(300A,0657) US NumberOfRTBeamLimitingDeviceOpenings 1 DICOM/Supplement_175 +(300A,0658) SQ RadiationDosimeterUnitSequence 1 DICOM/Supplement_175 +(300A,0659) SQ RTDeviceDistanceReferenceLocationCodeSequence 1 DICOM/Supplement_175 +(300A,065A) SQ RadiationDeviceConfigurationAndCommissioningKeySequence 1 DICOM/Supplement_175 +(300A,065B) SQ PatientSupportPositionParameterSequence 1 DICOM/Supplement_175 +(300A,065C) CS PatientSupportPositionSpecificationMethod 1 DICOM/Supplement_175 +(300A,065D) SQ PatientSupportPositionDeviceParameterSequence 1 DICOM/Supplement_175 +(300A,065E) US DeviceOrderIndex 1 DICOM/Supplement_175 +(300A,065F) US PatientSupportPositionParameterOrderIndex 1 DICOM/Supplement_175 +(300A,0660) SQ PatientSupportPositionDeviceToleranceSequence 1 DICOM/Supplement_175 +(300A,0661) US PatientSupportPositionToleranceOrderIndex 1 DICOM/Supplement_175 +(300A,0662) SQ CompensatorDefinitionSequence 1 DICOM/Supplement_175 +(300A,0663) CS CompensatorMapOrientation 1 DICOM/Supplement_175 +(300A,0664) OF CompensatorProximalThicknessMap 1 DICOM/Supplement_175 +(300A,0665) OF CompensatorDistalThicknessMap 1 DICOM/Supplement_175 +(300A,0666) FD CompensatorBasePlaneOffset 1 DICOM/Supplement_175 +(300A,0667) SQ CompensatorShapeFabricationCodeSequence 1 DICOM/Supplement_175 +(300A,0668) SQ CompensatorShapeSequence 1 DICOM/Supplement_175 +(300A,0669) FD RadiationBeamCompensatorMillingToolDiameter 1 DICOM/Supplement_175 +(300A,066A) SQ BlockDefinitionSequence 1 DICOM/Supplement_175 +(300A,066B) OF BlockEdgeData 1 DICOM/Supplement_175 +(300A,066C) CS BlockOrientation 1 DICOM/Supplement_175 +(300A,066D) FD RadiationBeamBlockThickness 1 DICOM/Supplement_175 +(300A,066E) FD RadiationBeamBlockSlabThickness 1 DICOM/Supplement_175 +(300A,066F) SQ BlockEdgeDataSequence 1 DICOM/Supplement_175 +(300A,0670) US NumberOfRTAccessoryHolders 1 DICOM/Supplement_175 +(300A,0671) SQ GeneralAccessoryDefinitionSequence 1 DICOM/Supplement_175 +(300A,0672) US NumberOfGeneralAccessories 1 DICOM/Supplement_175 +(300A,0673) SQ BolusDefinitionSequence 1 DICOM/Supplement_175 +(300A,0674) US NumberOfBoluses 1 DICOM/Supplement_175 +(300A,0675) UI EquipmentFrameOfReferenceUID 1 DICOM/Supplement_175 +(300A,0676) ST EquipmentFrameOfReferenceDescription 1 DICOM/Supplement_175 +(300A,0677) SQ EquipmentReferencePointCoordinatesSequence 1 DICOM/Supplement_175 +(300A,0678) SQ EquipmentReferencePointCodeSequence 1 DICOM/Supplement_175 +(300A,0679) FD RTBeamLimitingDeviceAngle 1 DICOM/Supplement_175 +(300A,067A) FD SourceRollAngle 1 DICOM/Supplement_175 +(300A,067B) SQ RadiationGenerationModeSequence 1 DICOM/Supplement_175 +(300A,067C) SH RadiationGenerationModeLabel 1 DICOM/Supplement_175 +(300A,067D) ST RadiationGenerationModeDescription 1 DICOM/Supplement_175 +(300A,067E) SQ RadiationGenerationModeMachineCodeSequence 1 DICOM/Supplement_175 +(300A,067F) SQ RadiationTypeCodeSequence 1 DICOM/Supplement_175 +(300A,0680) DS NominalEnergy 1 DICOM/Supplement_175 +(300A,0681) DS MinimumNominalEnergy 1 DICOM/Supplement_175 +(300A,0682) DS MaximumNominalEnergy 1 DICOM/Supplement_175 +(300A,0683) SQ RadiationFluenceModifierCodeSequence 1 DICOM/Supplement_175 +(300A,0684) SQ EnergyUnitCodeSequence 1 DICOM/Supplement_175 +(300A,0685) US NumberOfRadiationGenerationModes 1 DICOM/Supplement_175 +(300A,0686) SQ PatientSupportDevicesSequence 1 DICOM/Supplement_175 +(300A,0687) US NumberOfPatientSupportDevices 1 DICOM/Supplement_175 +(300A,0688) FD RTBeamModifierDefinitionDistance 1 DICOM/Supplement_175 +(300A,0689) SQ BeamAreaLimitSequence 1 DICOM/Supplement_175 +# +#--------------------------------------------------------------------------- +# +# Private Creator Data Elements +# +(0009-o-FFFF,0000) UL PrivateGroupLength 1 PRIVATE +(0009-o-FFFF,0010-u-00FF) LO PrivateCreator 1 PRIVATE +(0001-o-0007,0000) UL IllegalGroupLength 1 ILLEGAL +(0001-o-0007,0010-u-00FF) LO IllegalPrivateCreator 1 ILLEGAL +# +#--------------------------------------------------------------------------- +# +# A "catch all" for group length elements +# +(0000-u-FFFF,0000) UL GenericGroupLength 1 GENERIC +# +#--------------------------------------------------------------------------- +# +# Retired data elements from previous editions of the DICOM standard. +# (This section is not generated automatically but added manually.) +# +# according to the DICOM standard, the following 4 attributes +# should have a tag in the range of (0028,04x1) to (0028,04x3) +(0028,0410) US RETIRED_RowsForNthOrderCoefficients 1 DICOM/retired +(0028,0411) US RETIRED_ColumnsForNthOrderCoefficients 1 DICOM/retired +(0028,0412) LO RETIRED_CoefficientCoding 1-n DICOM/retired +(0028,0413) AT RETIRED_CoefficientCodingPointers 1-n DICOM/retired +# +# according to the DICOM standard, the following 5 attributes +# should have a tag in the range of (0028,08x0) to (0028,08x8) +(0028,0800) CS RETIRED_CodeLabel 1-n DICOM/retired +(0028,0802) US RETIRED_NumberOfTables 1 DICOM/retired +(0028,0803) AT RETIRED_CodeTableLocation 1-n DICOM/retired +(0028,0804) US RETIRED_BitsForCodeWord 1 DICOM/retired +(0028,0808) AT RETIRED_ImageDataLocation 1-n DICOM/retired +# +# the following attribute is defined as SQ in the DICOM standard, +# it was defined as CS in Supplement 23 (frozen draft) from 1997. +#(0040,A170) CS RETIRED_ObservationClassTrial 1 DICOM/retired +# +# according to the DICOM standard, the following 6 attributes +# should have a tag in the range of (1000,xxx0) to (1000,xxx5) +(1000,0010) US RETIRED_EscapeTriplet 3 DICOM/retired +(1000,0011) US RETIRED_RunLengthTriplet 3 DICOM/retired +(1000,0012) US RETIRED_HuffmanTableSize 1 DICOM/retired +(1000,0013) US RETIRED_HuffmanTableTriplet 3 DICOM/retired +(1000,0014) US RETIRED_ShiftTableSize 1 DICOM/retired +(1000,0015) US RETIRED_ShiftTableTriplet 3 DICOM/retired +# +# according to the DICOM standard, the following attribute +# should have the tag (1010,xxxx) where "x" is "0" to "F" +(1010,0004) US RETIRED_ZonalMap 1-n DICOM/retired +# +# end of dicom.dic +# diff --git a/dcmdata/data/diconde.dic b/dcmdata/data/diconde.dic new file mode 100644 index 00000000..0af79562 --- /dev/null +++ b/dcmdata/data/diconde.dic @@ -0,0 +1,173 @@ +# +# Copyright (C) 2010-2014, OFFIS e.V. +# All rights reserved. See COPYRIGHT file for details. +# +# This software and supporting documentation were developed by +# +# OFFIS e.V. +# R&D Division Health +# Escherweg 2 +# D-26121 Oldenburg, Germany +# +# +# Module: dcmdata +# +# Author: Joerg Riesmeier +# +# Purpose: DICONDE data dictionary for the DICOM toolkit DCMTK +# +# +# Dictionary of Digital Imaging and Communication in Nondestructive +# Evaluation (DICONDE) tags. Please note that the file "dicom.dic" +# contains the non-private DICONDE tag definitions since they are now +# official part of the DICOM standard (beginning with 2011 edition). +# +# Each line represents an entry in the data dictionary. Each line +# has 5 fields (Tag, VR, Name, VM, Version). Entries need not be +# in ascending tag order. +# +# Entries may override existing entries. +# +# Each field must be separated by a single tab. +# The tag value may take one of three forms: +# (gggg,eeee) +# (gggg,"CREATOR",ee) +# (gggg,"CREATOR",eeee) [eeee >= 1000] +# The first form represents a standard tag with group and element number. +# The second form describes a private tag that may be used with different +# element numbers as reserved by the private creator element. The third +# form describes a private tag that may only occur with a certain fixed +# element number. In all cases, the tag values must be in hexadecimal. +# +# Comments have a '#' at the beginning of the line. +# +# Tag VR Name VM Version +# +(0008,0080) LO CompanyName 1 DICONDE10 +(0008,0081) ST CompanyAddress 1 DICONDE10 +(0008,0090) PN ComponentOwnerName 1 DICONDE10 +(0008,1040) LO DepartmentName 1 DICONDE10 +(0008,1048) PN InspectingCompanyName 1-n DICONDE10 +(0008,1050) PN InspectorName 1-n DICONDE10 +(0008,1060) PN CertifyingInspectorName 1-n DICONDE10 +(0010,0010) PN ComponentName 1 DICONDE10 +(0010,0020) LO ComponentIDNumber 1 DICONDE10 +(0010,0030) DA ComponentManufacturingDate 1 DICONDE10 +(0010,1000) LO OtherComponentIDs 1-n DICONDE10 +(0010,1001) PN OtherComponentNames 1-n DICONDE10 +(0010,2160) SH MaterialName 1 DICONDE10 +(0010,4000) LT ComponentNotes 1 DICONDE10 +(0018,1008) LO ScannerID 1 DICONDE10 +(0032,4000) LT ExaminationNotes 1 DICONDE10 + +(0009,"astm.org/diconde/iod/ComponentStudy",20) DA ExpiryDate 1 DICONDE10 + +(0009,"astm.org/diconde/iod/ComponentSeries",10) ST ActualEnvironmentalConditions 1 DICONDE10 +(0009,"astm.org/diconde/iod/ComponentSeries",40) ST EnvironmentalConditions 1 DICONDE10 + +(0011,"astm.org/diconde/iod/Component",23) ST CADFileFormat 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",24) ST ComponentRefSystem 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",25) ST ComponentManufacturingProcedure 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",28) ST ComponentManufacturer 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",30) DS Thickness 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",32) DS MaterialPipeDiameter 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",34) DS MaterialIsolationDiameter 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",42) ST MaterialGrade 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",44) ST MaterialPropertiesFileID 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",45) ST MaterialPropertiesFileFormat 1-n DICONDE10 +(0011,"astm.org/diconde/iod/Component",46) LT MaterialNotes 1 DICONDE10 +(0011,"astm.org/diconde/iod/Component",50) CS Shape 1 DICONDE10 +(0011,"astm.org/diconde/iod/Component",52) CS CurvatureType 1 DICONDE10 +(0011,"astm.org/diconde/iod/Component",54) DS OuterDiameter 1 DICONDE10 +(0011,"astm.org/diconde/iod/Component",56) DS InnerDiameter 1 DICONDE10 + +(0021,"astm.org/diconde/iod/NdeIndication",02) SQ EvaluatorSequence 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",04) IS EvaluatorNumber 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",06) PN EvaluatorName 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",08) IS EvaluationAttempt 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",12) SQ IndicationSequence 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",14) IS IndicationNumber 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",16) SH IndicationLabel 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",18) ST IndicationDesription 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",1A) CS IndicationType 1-n DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",1C) CS IndicationDisposition 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",1E) SQ IndicationROISequence 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",20) CS IndicationROIGeometricType 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",22) IS NumberOfROIContourPoints 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",24) DS IndicationROIContourData 3-3n DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",26) CS IndicationROIContourPointUnits 3 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",28) IS IndicationROIDimensionality 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",30) SQ IndicationPhysicalPropertySequence 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",32) SH PropertyLabel 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",34) DS PropertyValue 1 DICONDE10 +(0021,"astm.org/diconde/iod/NdeIndication",36) CS PropertyUnits 1 DICONDE10 + +(0021,"astm.org/diconde/iod/NDEGeometry",02) IS NumberOfAxes 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",04) SQ AxesSequence 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",06) ST AxisDescription 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",08) CS DataSetMapping 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",0A) IS AxisNumber 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",0C) CS AxisType 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",0E) CS AxisUnits 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",10) OB AxisValues 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",20) SQ TransformSequence 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",22) ST TransformDescription 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",24) IS NumberOfAxes 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",26) IS OrderOfAxes 1-n DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",28) CS TransformedAxisUnits 1 DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",2A) DS RotationAndScaleMatrix 1-n DICONDE10 +(0021,"astm.org/diconde/iod/NDEGeometry",2C) DS TranslationMatrix 11 DICONDE10 + +# X-ray Computed Tomography (CT) + +(0009,"astm.org/diconde/iod/NdeCTImage",02) IS LINACEnergy 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCTImage",04) IS LINACOutput 1 DICONDE10_CT + +(0009,"astm.org/diconde/iod/NdeCtDetector",11) DS InternalDetectorFrameTime 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtDetector",12) DS NumberOfFramesIntegrated 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtDetector",20) SQ DetectorTemperatureSequence 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtDetector",22) DS SensorName 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtDetector",24) DS HorizontalOffset 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtDetector",26) DS VerticalOffset 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtDetector",28) DS Temperature 1 DICONDE10_CT + +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",40) SQ DarkCurrentSequence 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",50) ox DarkCurrentCounts 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",60) SQ GainCorrectionReferenceSequence 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",70) ox AirCounts 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",71) DS KVUsedinGainCalibration 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",72) DS MAsUsedInGainCalibration 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",73) DS NumberOfFrames 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",74) LO FilterMaterialUsedInGainCalibration 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",75) DS FilterThicknessUsedInGainCalibration 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",76) DA DateOfGainCalibration 1-n DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",77) TM TimeOfGainCalibration 1-n DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",80) OB BadPixelImage 1 DICONDE10_CT +(0009,"astm.org/diconde/iod/NdeCtCalibrationData",99) LT CalibrationNotes 1 DICONDE10_CT + +# Digital Radiographic (DR) + +(0009,"astm.org/diconde/iod/NdeDxDetector",11) DS InternalDetectorFrameTime 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxDetector",12) DS NumberOfFramesIntegrated 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxDetector",20) SQ DetectorTemperatureSequence 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxDetector",22) DS SensorName 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxDetector",24) DS HorizontalOffset 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxDetector",26) DS VerticalOffset 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxDetector",28) DS Temperature 1 DICONDE10_DR + +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",40) SQ DarkCurrentSequence 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",50) ox DarkCurrentCounts 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",60) SQ GainCorrectionReferenceSequence 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",70) ox AirCounts 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",71) DS KVUsedinGainCalibration 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",72) DS MAsUsedInGainCalibration 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",73) DS NumberOfFrames 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",74) LO FilterMaterialUsedInGainCalibration 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",75) DS FilterThicknessUsedInGainCalibration 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",76) DA DateOfGainCalibration 1-n DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",77) TM TimeOfGainCalibration 1-n DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",80) OB BadPixelImage 1 DICONDE10_DR +(0009,"astm.org/diconde/iod/NdeDxCalibrationData",99) LT CalibrationNotes 1 DICONDE10_DR +# +# end of diconde.dic +# diff --git a/dcmdata/data/dumppat.txt b/dcmdata/data/dumppat.txt new file mode 100644 index 00000000..1f375d46 --- /dev/null +++ b/dcmdata/data/dumppat.txt @@ -0,0 +1,4 @@ +--search PatientName +--search PatientID +--search PatientBirthDate +--search PatientSex \ No newline at end of file diff --git a/dcmdata/data/private.dic b/dcmdata/data/private.dic new file mode 100644 index 00000000..b754dc78 --- /dev/null +++ b/dcmdata/data/private.dic @@ -0,0 +1,3040 @@ +# +# Copyright (C) 1994-2013, OFFIS e.V. +# All rights reserved. See COPYRIGHT file for details. +# +# This software and supporting documentation were developed by +# +# OFFIS e.V. +# R&D Division Health +# Escherweg 2 +# D-26121 Oldenburg, Germany +# +# +# Module: dcmdata +# +# Author: Andrew Hewett, Marco Eichelberg, Joerg Riesmeier +# +# Purpose: +# This is the private tag DICOM data dictionary for the dcmtk class library. +# +# +# Dictionary of Private Tags +# +# This dictionary contains the private tags defined in the following +# reference documents (in alphabetical order): +# - AGFA IMPAX 6.5.x Solution conformance statement +# - Circle Cardiovascular Imaging cmr42 3.0 conformance statement +# - David Clunie's dicom3tools package, 2002-04-20 snapshot +# - Fuji CR console, 3rd release +# - Intelerad Medical Systems Inc., Image Server +# - OCULUS Pentacam 1.17 conformance statement +# - Philips Digital Diagnost 1.3 conformance statement +# - Philips Integris H, catheterization laboratory, RIS-interface +# - Philips Intera Achieva conformance statement +# - Philips MR Achieva conformance statement +# - Siemens Somatom syngo VA40B conformance statement +# - Siemens AXIOM Artis VB30 conformance statement +# - SonoWand Invite 2.1.1 conformance statement +# - Swissvision TR4000 conformance statement +# - private tags for DCMTK anonymizer tool +# +# Each line represents an entry in the data dictionary. Each line +# has 5 fields (Tag, VR, Name, VM, Version). Entries need not be +# in ascending tag order. +# +# Entries may override existing entries. +# +# Each field must be separated by a single tab. +# The tag value may take one of two forms: +# (gggg,"CREATOR",ee) +# (gggg,"CREATOR",eeee) [eeee >= 1000] +# The first form describes a private tag that may be used with different +# element numbers as reserved by the private creator element. +# The second form describes a private tag that may only occur with a +# certain fixed element number. +# In both cases, the tag values must be in hexadecimal. +# Repeating groups are represented by indicating the range +# (gggg-o-gggg,"CREATOR",ee) or (gggg-o-gggg,"CREATOR",eeee) +# where "-o-" indicates that only odd group numbers match the definition. +# The element part of the tag can also be a range. +# +# Comments have a '#' at the beginning of the line. +# +# Tag VR Name VM Version / Description +# +(0019,"1.2.840.113681",10) ST CRImageParamsCommon 1 PrivateTag +(0019,"1.2.840.113681",11) ST CRImageIPParamsSingle 1 PrivateTag +(0019,"1.2.840.113681",12) ST CRImageIPParamsLeft 1 PrivateTag +(0019,"1.2.840.113681",13) ST CRImageIPParamsRight 1 PrivateTag + +(0087,"1.2.840.113708.794.1.1.2.0",10) CS MediaType 1 PrivateTag +(0087,"1.2.840.113708.794.1.1.2.0",20) CS MediaLocation 1 PrivateTag +(0087,"1.2.840.113708.794.1.1.2.0",50) IS EstimatedRetrieveTime 1 PrivateTag + +(0009,"ACUSON",00) IS Unknown 1 PrivateTag +(0009,"ACUSON",01) IS Unknown 1 PrivateTag +(0009,"ACUSON",02) UN Unknown 1 PrivateTag +(0009,"ACUSON",03) UN Unknown 1 PrivateTag +(0009,"ACUSON",04) UN Unknown 1 PrivateTag +(0009,"ACUSON",05) UN Unknown 1 PrivateTag +(0009,"ACUSON",06) UN Unknown 1 PrivateTag +(0009,"ACUSON",07) UN Unknown 1 PrivateTag +(0009,"ACUSON",08) LT Unknown 1 PrivateTag +(0009,"ACUSON",09) LT Unknown 1 PrivateTag +(0009,"ACUSON",0a) IS Unknown 1 PrivateTag +(0009,"ACUSON",0b) IS Unknown 1 PrivateTag +(0009,"ACUSON",0c) IS Unknown 1 PrivateTag +(0009,"ACUSON",0d) IS Unknown 1 PrivateTag +(0009,"ACUSON",0e) IS Unknown 1 PrivateTag +(0009,"ACUSON",0f) UN Unknown 1 PrivateTag +(0009,"ACUSON",10) IS Unknown 1 PrivateTag +(0009,"ACUSON",11) UN Unknown 1 PrivateTag +(0009,"ACUSON",12) IS Unknown 1 PrivateTag +(0009,"ACUSON",13) IS Unknown 1 PrivateTag +(0009,"ACUSON",14) LT Unknown 1 PrivateTag +(0009,"ACUSON",15) UN Unknown 1 PrivateTag + +(0003,"AEGIS_DICOM_2.00",00) US Unknown 1-n PrivateTag +(0005,"AEGIS_DICOM_2.00",00) US Unknown 1-n PrivateTag +(0009,"AEGIS_DICOM_2.00",00) US Unknown 1-n PrivateTag +(0019,"AEGIS_DICOM_2.00",00) US Unknown 1-n PrivateTag +(0029,"AEGIS_DICOM_2.00",00) US Unknown 1-n PrivateTag +(1369,"AEGIS_DICOM_2.00",00) US Unknown 1-n PrivateTag + +(0009,"AGFA",10) LO Unknown 1 PrivateTag +(0009,"AGFA",11) LO Unknown 1 PrivateTag +(0009,"AGFA",13) LO Unknown 1 PrivateTag +(0009,"AGFA",14) LO Unknown 1 PrivateTag +(0009,"AGFA",15) LO Unknown 1 PrivateTag + +(0031,"AGFA PACS Archive Mirroring 1.0",00) CS StudyStatus 1 PrivateTag +(0031,"AGFA PACS Archive Mirroring 1.0",01) UL DateTimeVerified 1 PrivateTag + +(0029,"CAMTRONICS IP",10) LT Unknown 1 PrivateTag +(0029,"CAMTRONICS IP",20) UN Unknown 1 PrivateTag +(0029,"CAMTRONICS IP",30) UN Unknown 1 PrivateTag +(0029,"CAMTRONICS IP",40) UN Unknown 1 PrivateTag + +(0029,"CAMTRONICS",10) LT Commentline 1 PrivateTag +(0029,"CAMTRONICS",20) DS EdgeEnhancementCoefficient 1 PrivateTag +(0029,"CAMTRONICS",50) LT SceneText 1 PrivateTag +(0029,"CAMTRONICS",60) LT ImageText 1 PrivateTag +(0029,"CAMTRONICS",70) IS PixelShiftHorizontal 1 PrivateTag +(0029,"CAMTRONICS",80) IS PixelShiftVertical 1 PrivateTag +(0029,"CAMTRONICS",90) IS Unknown 1 PrivateTag + +(0009,"CARDIO-D.R. 1.0",00) UL FileLocation 1 PrivateTag +(0009,"CARDIO-D.R. 1.0",01) UL FileSize 1 PrivateTag +(0009,"CARDIO-D.R. 1.0",40) SQ AlternateImageSequence 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",00) CS ImageBlankingShape 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",02) IS ImageBlankingLeftVerticalEdge 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",04) IS ImageBlankingRightVerticalEdge 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",06) IS ImageBlankingUpperHorizontalEdge 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",08) IS ImageBlankingLowerHorizontalEdge 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",10) IS CenterOfCircularImageBlanking 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",12) IS RadiusOfCircularImageBlanking 1 PrivateTag +(0019,"CARDIO-D.R. 1.0",30) UL MaximumImageFrameSize 1 PrivateTag +(0021,"CARDIO-D.R. 1.0",13) IS ImageSequenceNumber 1 PrivateTag +(0029,"CARDIO-D.R. 1.0",00) SQ EdgeEnhancementSequence 1 PrivateTag +(0029,"CARDIO-D.R. 1.0",01) US ConvolutionKernelSize 2 PrivateTag +(0029,"CARDIO-D.R. 1.0",02) DS ConvolutionKernelCoefficients 1-n PrivateTag +(0029,"CARDIO-D.R. 1.0",03) DS EdgeEnhancementGain 1 PrivateTag + +(0025,"CMR42 CIRCLECVI",1010) LO WorkspaceID 1 PrivateTag +(0025,"CMR42 CIRCLECVI",1020) LO WorkspaceTimeString 1 PrivateTag +(0025,"CMR42 CIRCLECVI",1030) OB WorkspaceStream 1 PrivateTag + +(0009,"DCMTK_ANONYMIZER",00) SQ AnonymizerUIDMap 1 PrivateTag +(0009,"DCMTK_ANONYMIZER",10) UI AnonymizerUIDKey 1 PrivateTag +(0009,"DCMTK_ANONYMIZER",20) UI AnonymizerUIDValue 1 PrivateTag +(0009,"DCMTK_ANONYMIZER",30) SQ AnonymizerPatientIDMap 1 PrivateTag +(0009,"DCMTK_ANONYMIZER",40) LO AnonymizerPatientIDKey 1 PrivateTag +(0009,"DCMTK_ANONYMIZER",50) LO AnonymizerPatientIDValue 1 PrivateTag + +(0019,"DIDI TO PCR 1.1",22) UN RouteAET 1 PrivateTag +(0019,"DIDI TO PCR 1.1",23) DS PCRPrintScale 1 PrivateTag +(0019,"DIDI TO PCR 1.1",24) UN PCRPrintJobEnd 1 PrivateTag +(0019,"DIDI TO PCR 1.1",25) IS PCRNoFilmCopies 1 PrivateTag +(0019,"DIDI TO PCR 1.1",26) IS PCRFilmLayoutPosition 1 PrivateTag +(0019,"DIDI TO PCR 1.1",27) UN PCRPrintReportName 1 PrivateTag +(0019,"DIDI TO PCR 1.1",70) UN RADProtocolPrinter 1 PrivateTag +(0019,"DIDI TO PCR 1.1",71) UN RADProtocolMedium 1 PrivateTag +(0019,"DIDI TO PCR 1.1",90) LO UnprocessedFlag 1 PrivateTag +(0019,"DIDI TO PCR 1.1",91) UN KeyValues 1 PrivateTag +(0019,"DIDI TO PCR 1.1",92) UN DestinationPostprocessingFunction 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A0) UN Version 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A1) UN RangingMode 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A2) UN AbdomenBrightness 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A3) UN FixedBrightness 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A4) UN DetailContrast 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A5) UN ContrastBalance 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A6) UN StructureBoost 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A7) UN StructurePreference 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A8) UN NoiseRobustness 1 PrivateTag +(0019,"DIDI TO PCR 1.1",A9) UN NoiseDoseLimit 1 PrivateTag +(0019,"DIDI TO PCR 1.1",AA) UN NoiseDoseStep 1 PrivateTag +(0019,"DIDI TO PCR 1.1",AB) UN NoiseFrequencyLimit 1 PrivateTag +(0019,"DIDI TO PCR 1.1",AC) UN WeakContrastLimit 1 PrivateTag +(0019,"DIDI TO PCR 1.1",AD) UN StrongContrastLimit 1 PrivateTag +(0019,"DIDI TO PCR 1.1",AE) UN StructureBoostOffset 1 PrivateTag +(0019,"DIDI TO PCR 1.1",AF) UN SmoothGain 1 PrivateTag +(0019,"DIDI TO PCR 1.1",B0) UN MeasureField1 1 PrivateTag +(0019,"DIDI TO PCR 1.1",B1) UN MeasureField2 1 PrivateTag +(0019,"DIDI TO PCR 1.1",B2) UN KeyPercentile1 1 PrivateTag +(0019,"DIDI TO PCR 1.1",B3) UN KeyPercentile2 1 PrivateTag +(0019,"DIDI TO PCR 1.1",B4) UN DensityLUT 1 PrivateTag +(0019,"DIDI TO PCR 1.1",B5) UN Brightness 1 PrivateTag +(0019,"DIDI TO PCR 1.1",B6) UN Gamma 1 PrivateTag +(0089,"DIDI TO PCR 1.1",10) SQ Unknown 1 PrivateTag + +(0029,"DIGISCAN IMAGE",31) US Unknown 1-n PrivateTag +(0029,"DIGISCAN IMAGE",32) US Unknown 1-n PrivateTag +(0029,"DIGISCAN IMAGE",33) LT Unknown 1 PrivateTag +(0029,"DIGISCAN IMAGE",34) LT Unknown 1 PrivateTag + +(7001-o-70ff,"DLX_ANNOT_01",04) ST TextAnnotation 1 PrivateTag +(7001-o-70ff,"DLX_ANNOT_01",05) IS Box 2 PrivateTag +(7001-o-70ff,"DLX_ANNOT_01",07) IS ArrowEnd 2 PrivateTag + +(0015,"DLX_EXAMS_01",01) DS StenosisCalibrationRatio 1 PrivateTag +(0015,"DLX_EXAMS_01",02) DS StenosisMagnification 1 PrivateTag +(0015,"DLX_EXAMS_01",03) DS CardiacCalibrationRatio 1 PrivateTag + +(6001-o-60ff,"DLX_LKUP_01",01) US GrayPaletteColorLookupTableDescriptor 3 PrivateTag +(6001-o-60ff,"DLX_LKUP_01",02) US GrayPaletteColorLookupTableData 1 PrivateTag + +(0011,"DLX_PATNT_01",01) LT PatientDOB 1 PrivateTag + +(0019,"DLX_SERIE_01",01) DS AngleValueLArm 1 PrivateTag +(0019,"DLX_SERIE_01",02) DS AngleValuePArm 1 PrivateTag +(0019,"DLX_SERIE_01",03) DS AngleValueCArm 1 PrivateTag +(0019,"DLX_SERIE_01",04) CS AngleLabelLArm 1 PrivateTag +(0019,"DLX_SERIE_01",05) CS AngleLabelPArm 1 PrivateTag +(0019,"DLX_SERIE_01",06) CS AngleLabelCArm 1 PrivateTag +(0019,"DLX_SERIE_01",07) ST ProcedureName 1 PrivateTag +(0019,"DLX_SERIE_01",08) ST ExamName 1 PrivateTag +(0019,"DLX_SERIE_01",09) SH PatientSize 1 PrivateTag +(0019,"DLX_SERIE_01",0a) IS RecordView 1 PrivateTag +(0019,"DLX_SERIE_01",10) DS InjectorDelay 1 PrivateTag +(0019,"DLX_SERIE_01",11) CS AutoInject 1 PrivateTag +(0019,"DLX_SERIE_01",14) IS AcquisitionMode 1 PrivateTag +(0019,"DLX_SERIE_01",15) CS CameraRotationEnabled 1 PrivateTag +(0019,"DLX_SERIE_01",16) CS ReverseSweep 1 PrivateTag +(0019,"DLX_SERIE_01",17) IS SpatialFilterStrength 1 PrivateTag +(0019,"DLX_SERIE_01",18) IS ZoomFactor 1 PrivateTag +(0019,"DLX_SERIE_01",19) IS XZoomCenter 1 PrivateTag +(0019,"DLX_SERIE_01",1a) IS YZoomCenter 1 PrivateTag +(0019,"DLX_SERIE_01",1b) DS Focus 1 PrivateTag +(0019,"DLX_SERIE_01",1c) CS Dose 1 PrivateTag +(0019,"DLX_SERIE_01",1d) IS SideMark 1 PrivateTag +(0019,"DLX_SERIE_01",1e) IS PercentageLandscape 1 PrivateTag +(0019,"DLX_SERIE_01",1f) DS ExposureDuration 1 PrivateTag + +(00E1,"ELSCINT1",01) US DataDictionaryVersion 1 PrivateTag +(00E1,"ELSCINT1",14) LT Unknown 1 PrivateTag +(00E1,"ELSCINT1",22) DS Unknown 2 PrivateTag +(00E1,"ELSCINT1",23) DS Unknown 2 PrivateTag +(00E1,"ELSCINT1",24) LT Unknown 1 PrivateTag +(00E1,"ELSCINT1",25) LT Unknown 1 PrivateTag +(00E1,"ELSCINT1",40) SH OffsetFromCTMRImages 1 PrivateTag +(0601,"ELSCINT1",00) SH ImplementationVersion 1 PrivateTag +(0601,"ELSCINT1",20) DS RelativeTablePosition 1 PrivateTag +(0601,"ELSCINT1",21) DS RelativeTableHeight 1 PrivateTag +(0601,"ELSCINT1",30) SH SurviewDirection 1 PrivateTag +(0601,"ELSCINT1",31) DS SurviewLength 1 PrivateTag +(0601,"ELSCINT1",50) SH ImageViewType 1 PrivateTag +(0601,"ELSCINT1",70) DS BatchNumber 1 PrivateTag +(0601,"ELSCINT1",71) DS BatchSize 1 PrivateTag +(0601,"ELSCINT1",72) DS BatchSliceNumber 1 PrivateTag + +(0009,"FDMS 1.0",04) SH ImageControlUnit 1 PrivateTag +(0009,"FDMS 1.0",05) OW ImageUID 1 PrivateTag +(0009,"FDMS 1.0",06) OW RouteImageUID 1 PrivateTag +(0009,"FDMS 1.0",08) UL ImageDisplayInformationVersionNo 1 PrivateTag +(0009,"FDMS 1.0",09) UL PatientInformationVersionNo 1 PrivateTag +(0009,"FDMS 1.0",0C) OW FilmUID 1 PrivateTag +(0009,"FDMS 1.0",10) CS ExposureUnitTypeCode 1 PrivateTag +(0009,"FDMS 1.0",80) LO KanjiHospitalName 1 PrivateTag +(0009,"FDMS 1.0",90) ST DistributionCode 1 PrivateTag +(0009,"FDMS 1.0",92) SH KanjiDepartmentName 1 PrivateTag +(0009,"FDMS 1.0",F0) CS BlackeningProcessFlag 1 PrivateTag +(0019,"FDMS 1.0",15) LO KanjiBodyPartForExposure 1 PrivateTag +(0019,"FDMS 1.0",32) LO KanjiMenuName 1 PrivateTag +(0019,"FDMS 1.0",40) CS ImageProcessingType 1 PrivateTag +(0019,"FDMS 1.0",50) CS EDRMode 1 PrivateTag +(0019,"FDMS 1.0",60) SH RadiographersCode 1 PrivateTag +(0019,"FDMS 1.0",70) IS SplitExposureFormat 1 PrivateTag +(0019,"FDMS 1.0",71) IS NoOfSplitExposureFrames 1 PrivateTag +(0019,"FDMS 1.0",80) IS ReadingPositionSpecification 1 PrivateTag +(0019,"FDMS 1.0",81) IS ReadingSensitivityCenter 1 PrivateTag +(0019,"FDMS 1.0",90) SH FilmAnnotationCharacterString1 1 PrivateTag +(0019,"FDMS 1.0",91) SH FilmAnnotationCharacterString2 1 PrivateTag +(0021,"FDMS 1.0",10) CS FCRImageID 1 PrivateTag +(0021,"FDMS 1.0",30) CS SetNo 1 PrivateTag +(0021,"FDMS 1.0",40) IS ImageNoInTheSet 1 PrivateTag +(0021,"FDMS 1.0",50) CS PairProcessingInformation 1 PrivateTag +(0021,"FDMS 1.0",80) OB EquipmentTypeSpecificInformation 1 PrivateTag +(0023,"FDMS 1.0",10) SQ Unknown 1 PrivateTag +(0023,"FDMS 1.0",20) SQ Unknown 1 PrivateTag +(0023,"FDMS 1.0",30) SQ Unknown 1 PrivateTag +(0025,"FDMS 1.0",10) US RelativeLightEmissionAmountSk 1 PrivateTag +(0025,"FDMS 1.0",11) US TermOfCorrectionForEachIPTypeSt 1 PrivateTag +(0025,"FDMS 1.0",12) US ReadingGainGp 1 PrivateTag +(0025,"FDMS 1.0",13) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",15) CS Unknown 1 PrivateTag +(0025,"FDMS 1.0",20) US Unknown 2 PrivateTag +(0025,"FDMS 1.0",21) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",30) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",31) SS Unknown 1 PrivateTag +(0025,"FDMS 1.0",32) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",33) SS Unknown 1 PrivateTag +(0025,"FDMS 1.0",34) SS Unknown 1 PrivateTag +(0025,"FDMS 1.0",40) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",41) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",42) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",43) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",50) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",51) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",52) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",53) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",60) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",61) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",62) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",63) CS Unknown 1 PrivateTag +(0025,"FDMS 1.0",70) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",71) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",72) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",73) US Unknown 1-n PrivateTag +(0025,"FDMS 1.0",74) US Unknown 1-n PrivateTag +(0025,"FDMS 1.0",80) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",81) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",82) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",83) US Unknown 1-n PrivateTag +(0025,"FDMS 1.0",84) US Unknown 1-n PrivateTag +(0025,"FDMS 1.0",90) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",91) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",92) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",93) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",94) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",95) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",96) CS Unknown 1 PrivateTag +(0025,"FDMS 1.0",a0) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",a1) SS Unknown 1 PrivateTag +(0025,"FDMS 1.0",a2) US Unknown 1 PrivateTag +(0025,"FDMS 1.0",a3) SS Unknown 1 PrivateTag +(0027,"FDMS 1.0",10) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",20) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",30) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",40) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",50) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",60) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",70) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",80) SQ Unknown 1 PrivateTag +(0027,"FDMS 1.0",a0) IS Unknown 1 PrivateTag +(0027,"FDMS 1.0",a1) CS Unknown 2 PrivateTag +(0027,"FDMS 1.0",a2) CS Unknown 2 PrivateTag +(0027,"FDMS 1.0",a3) SS Unknown 1-n PrivateTag +(0029,"FDMS 1.0",20) CS ImageScanningDirection 1 PrivateTag +(0029,"FDMS 1.0",30) CS ExtendedReadingSizeValue 1 PrivateTag +(0029,"FDMS 1.0",34) US MagnificationReductionRatio 1 PrivateTag +(0029,"FDMS 1.0",44) CS LineDensityCode 1 PrivateTag +(0029,"FDMS 1.0",50) CS DataCompressionCode 1 PrivateTag +(2011,"FDMS 1.0",11) CS ImagePosition SpecifyingFlag 1 PrivateTag +(50F1,"FDMS 1.0",06) CS EnergySubtractionParam 1 PrivateTag +(50F1,"FDMS 1.0",07) CS SubtractionRegistrationResult 1 PrivateTag +(50F1,"FDMS 1.0",08) CS EnergySubtractionParam2 1 PrivateTag +(50F1,"FDMS 1.0",09) SL AfinConversionCoefficient 1 PrivateTag +(50F1,"FDMS 1.0",10) CS FilmOutputFormat 1 PrivateTag +(50F1,"FDMS 1.0",20) CS ImageProcessingModificationFlag 1 PrivateTag + +(0009,"FFP DATA",01) UN CRHeaderInformation 1 PrivateTag + +(0019,"GE ??? From Adantage Review CS",30) LO CREDRMode 1 PrivateTag +(0019,"GE ??? From Adantage Review CS",40) LO CRLatitude 1 PrivateTag +(0019,"GE ??? From Adantage Review CS",50) LO CRGroupNumber 1 PrivateTag +(0019,"GE ??? From Adantage Review CS",70) LO CRImageSerialNumber 1 PrivateTag +(0019,"GE ??? From Adantage Review CS",80) LO CRBarCodeNumber 1 PrivateTag +(0019,"GE ??? From Adantage Review CS",90) LO CRFilmOutputExposures 1 PrivateTag + +(0009,"GEMS_ACQU_01",24) DS Unknown 1 PrivateTag +(0009,"GEMS_ACQU_01",25) US Unknown 1 PrivateTag +(0009,"GEMS_ACQU_01",3e) US Unknown 1 PrivateTag +(0009,"GEMS_ACQU_01",3f) US Unknown 1 PrivateTag +(0009,"GEMS_ACQU_01",42) US Unknown 1 PrivateTag +(0009,"GEMS_ACQU_01",43) US Unknown 1 PrivateTag +(0009,"GEMS_ACQU_01",f8) US Unknown 1 PrivateTag +(0009,"GEMS_ACQU_01",fb) IS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",01) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",02) SL NumberOfCellsInDetector 1 PrivateTag +(0019,"GEMS_ACQU_01",03) DS CellNumberAtTheta 1 PrivateTag +(0019,"GEMS_ACQU_01",04) DS CellSpacing 1 PrivateTag +(0019,"GEMS_ACQU_01",05) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",06) UN Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",0e) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",0f) DS HorizontalFrameOfReference 1 PrivateTag +(0019,"GEMS_ACQU_01",11) SS SeriesContrast 1 PrivateTag +(0019,"GEMS_ACQU_01",12) SS LastPseq 1 PrivateTag +(0019,"GEMS_ACQU_01",13) SS StartNumberForBaseline 1 PrivateTag +(0019,"GEMS_ACQU_01",14) SS End NumberForBaseline 1 PrivateTag +(0019,"GEMS_ACQU_01",15) SS StartNumberForEnhancedScans 1 PrivateTag +(0019,"GEMS_ACQU_01",16) SS EndNumberForEnhancedScans 1 PrivateTag +(0019,"GEMS_ACQU_01",17) SS SeriesPlane 1 PrivateTag +(0019,"GEMS_ACQU_01",18) LO FirstScanRAS 1 PrivateTag +(0019,"GEMS_ACQU_01",19) DS FirstScanLocation 1 PrivateTag +(0019,"GEMS_ACQU_01",1a) LO LastScanRAS 1 PrivateTag +(0019,"GEMS_ACQU_01",1b) DS LastScanLocation 1 PrivateTag +(0019,"GEMS_ACQU_01",1e) DS DisplayFieldOfView 1 PrivateTag +(0019,"GEMS_ACQU_01",20) DS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",22) DS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",23) DS TableSpeed 1 PrivateTag +(0019,"GEMS_ACQU_01",24) DS MidScanTime 1 PrivateTag +(0019,"GEMS_ACQU_01",25) SS MidScanFlag 1 PrivateTag +(0019,"GEMS_ACQU_01",26) SL DegreesOfAzimuth 1 PrivateTag +(0019,"GEMS_ACQU_01",27) DS GantryPeriod 1 PrivateTag +(0019,"GEMS_ACQU_01",2a) DS XrayOnPosition 1 PrivateTag +(0019,"GEMS_ACQU_01",2b) DS XrayOffPosition 1 PrivateTag +(0019,"GEMS_ACQU_01",2c) SL NumberOfTriggers 1 PrivateTag +(0019,"GEMS_ACQU_01",2d) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",2e) DS AngleOfFirstView 1 PrivateTag +(0019,"GEMS_ACQU_01",2f) DS TriggerFrequency 1 PrivateTag +(0019,"GEMS_ACQU_01",39) SS ScanFOVType 1 PrivateTag +(0019,"GEMS_ACQU_01",3a) IS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",3b) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",3c) UN Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",3e) UN Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",3f) UN Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",40) SS StatReconFlag 1 PrivateTag +(0019,"GEMS_ACQU_01",41) SS ComputeType 1 PrivateTag +(0019,"GEMS_ACQU_01",42) SS SegmentNumber 1 PrivateTag +(0019,"GEMS_ACQU_01",43) SS TotalSegmentsRequested 1 PrivateTag +(0019,"GEMS_ACQU_01",44) DS InterscanDelay 1 PrivateTag +(0019,"GEMS_ACQU_01",47) SS ViewCompressionFactor 1 PrivateTag +(0019,"GEMS_ACQU_01",48) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",49) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",4a) SS TotalNumberOfRefChannels 1 PrivateTag +(0019,"GEMS_ACQU_01",4b) SL DataSizeForScanData 1 PrivateTag +(0019,"GEMS_ACQU_01",52) SS ReconPostProcessingFlag 1 PrivateTag +(0019,"GEMS_ACQU_01",54) UN Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",57) SS CTWaterNumber 1 PrivateTag +(0019,"GEMS_ACQU_01",58) SS CTBoneNumber 1 PrivateTag +(0019,"GEMS_ACQU_01",5a) FL AcquisitionDuration 1 PrivateTag +(0019,"GEMS_ACQU_01",5d) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",5e) SL NumberOfChannels1To512 1 PrivateTag +(0019,"GEMS_ACQU_01",5f) SL IncrementBetweenChannels 1 PrivateTag +(0019,"GEMS_ACQU_01",60) SL StartingView 1 PrivateTag +(0019,"GEMS_ACQU_01",61) SL NumberOfViews 1 PrivateTag +(0019,"GEMS_ACQU_01",62) SL IncrementBetweenViews 1 PrivateTag +(0019,"GEMS_ACQU_01",6a) SS DependantOnNumberOfViewsProcessed 1 PrivateTag +(0019,"GEMS_ACQU_01",6b) SS FieldOfViewInDetectorCells 1 PrivateTag +(0019,"GEMS_ACQU_01",70) SS ValueOfBackProjectionButton 1 PrivateTag +(0019,"GEMS_ACQU_01",71) SS SetIfFatqEstimatesWereUsed 1 PrivateTag +(0019,"GEMS_ACQU_01",72) DS ZChannelAvgOverViews 1 PrivateTag +(0019,"GEMS_ACQU_01",73) DS AvgOfLeftRefChannelsOverViews 1 PrivateTag +(0019,"GEMS_ACQU_01",74) DS MaxLeftChannelOverViews 1 PrivateTag +(0019,"GEMS_ACQU_01",75) DS AvgOfRightRefChannelsOverViews 1 PrivateTag +(0019,"GEMS_ACQU_01",76) DS MaxRightChannelOverViews 1 PrivateTag +(0019,"GEMS_ACQU_01",7d) DS SecondEcho 1 PrivateTag +(0019,"GEMS_ACQU_01",7e) SS NumberOfEchos 1 PrivateTag +(0019,"GEMS_ACQU_01",7f) DS TableDelta 1 PrivateTag +(0019,"GEMS_ACQU_01",81) SS Contiguous 1 PrivateTag +(0019,"GEMS_ACQU_01",82) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",83) DS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",84) DS PeakSAR 1 PrivateTag +(0019,"GEMS_ACQU_01",85) SS MonitorSAR 1 PrivateTag +(0019,"GEMS_ACQU_01",86) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",87) DS CardiacRepetition Time 1 PrivateTag +(0019,"GEMS_ACQU_01",88) SS ImagesPerCardiacCycle 1 PrivateTag +(0019,"GEMS_ACQU_01",8a) SS ActualReceiveGainAnalog 1 PrivateTag +(0019,"GEMS_ACQU_01",8b) SS ActualReceiveGainDigital 1 PrivateTag +(0019,"GEMS_ACQU_01",8d) DS DelayAfterTrigger 1 PrivateTag +(0019,"GEMS_ACQU_01",8f) SS SwapPhaseFrequency 1 PrivateTag +(0019,"GEMS_ACQU_01",90) SS PauseInterval 1 PrivateTag +(0019,"GEMS_ACQU_01",91) DS PulseTime 1 PrivateTag +(0019,"GEMS_ACQU_01",92) SL SliceOffsetOnFrequencyAxis 1 PrivateTag +(0019,"GEMS_ACQU_01",93) DS CenterFrequency 1 PrivateTag +(0019,"GEMS_ACQU_01",94) SS TransmitGain 1 PrivateTag +(0019,"GEMS_ACQU_01",95) SS AnalogReceiverGain 1 PrivateTag +(0019,"GEMS_ACQU_01",96) SS DigitalReceiverGain 1 PrivateTag +(0019,"GEMS_ACQU_01",97) SL BitmapDefiningCVs 1 PrivateTag +(0019,"GEMS_ACQU_01",98) SS CenterFrequencyMethod 1 PrivateTag +(0019,"GEMS_ACQU_01",99) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",9b) SS PulseSequenceMode 1 PrivateTag +(0019,"GEMS_ACQU_01",9c) LO PulseSequenceName 1 PrivateTag +(0019,"GEMS_ACQU_01",9d) DT PulseSequenceDate 1 PrivateTag +(0019,"GEMS_ACQU_01",9e) LO InternalPulseSequenceName 1 PrivateTag +(0019,"GEMS_ACQU_01",9f) SS TransmittingCoil 1 PrivateTag +(0019,"GEMS_ACQU_01",a0) SS SurfaceCoilType 1 PrivateTag +(0019,"GEMS_ACQU_01",a1) SS ExtremityCoilFlag 1 PrivateTag +(0019,"GEMS_ACQU_01",a2) SL RawDataRunNumber 1 PrivateTag +(0019,"GEMS_ACQU_01",a3) UL CalibratedFieldStrength 1 PrivateTag +(0019,"GEMS_ACQU_01",a4) SS SATFatWaterBone 1 PrivateTag +(0019,"GEMS_ACQU_01",a5) DS ReceiveBandwidth 1 PrivateTag +(0019,"GEMS_ACQU_01",a7) DS UserData0 1 PrivateTag +(0019,"GEMS_ACQU_01",a8) DS UserData1 1 PrivateTag +(0019,"GEMS_ACQU_01",a9) DS UserData2 1 PrivateTag +(0019,"GEMS_ACQU_01",aa) DS UserData3 1 PrivateTag +(0019,"GEMS_ACQU_01",ab) DS UserData4 1 PrivateTag +(0019,"GEMS_ACQU_01",ac) DS UserData5 1 PrivateTag +(0019,"GEMS_ACQU_01",ad) DS UserData6 1 PrivateTag +(0019,"GEMS_ACQU_01",ae) DS UserData7 1 PrivateTag +(0019,"GEMS_ACQU_01",af) DS UserData8 1 PrivateTag +(0019,"GEMS_ACQU_01",b0) DS UserData9 1 PrivateTag +(0019,"GEMS_ACQU_01",b1) DS UserData10 1 PrivateTag +(0019,"GEMS_ACQU_01",b2) DS UserData11 1 PrivateTag +(0019,"GEMS_ACQU_01",b3) DS UserData12 1 PrivateTag +(0019,"GEMS_ACQU_01",b4) DS UserData13 1 PrivateTag +(0019,"GEMS_ACQU_01",b5) DS UserData14 1 PrivateTag +(0019,"GEMS_ACQU_01",b6) DS UserData15 1 PrivateTag +(0019,"GEMS_ACQU_01",b7) DS UserData16 1 PrivateTag +(0019,"GEMS_ACQU_01",b8) DS UserData17 1 PrivateTag +(0019,"GEMS_ACQU_01",b9) DS UserData18 1 PrivateTag +(0019,"GEMS_ACQU_01",ba) DS UserData19 1 PrivateTag +(0019,"GEMS_ACQU_01",bb) DS UserData20 1 PrivateTag +(0019,"GEMS_ACQU_01",bc) DS UserData21 1 PrivateTag +(0019,"GEMS_ACQU_01",bd) DS UserData22 1 PrivateTag +(0019,"GEMS_ACQU_01",be) DS ProjectionAngle 1 PrivateTag +(0019,"GEMS_ACQU_01",c0) SS SaturationPlanes 1 PrivateTag +(0019,"GEMS_ACQU_01",c1) SS SurfaceCoilIntensityCorrectionFlag 1 PrivateTag +(0019,"GEMS_ACQU_01",c2) SS SATLocationR 1 PrivateTag +(0019,"GEMS_ACQU_01",c3) SS SATLocationL 1 PrivateTag +(0019,"GEMS_ACQU_01",c4) SS SATLocationA 1 PrivateTag +(0019,"GEMS_ACQU_01",c5) SS SATLocationP 1 PrivateTag +(0019,"GEMS_ACQU_01",c6) SS SATLocationH 1 PrivateTag +(0019,"GEMS_ACQU_01",c7) SS SATLocationF 1 PrivateTag +(0019,"GEMS_ACQU_01",c8) SS SATThicknessRL 1 PrivateTag +(0019,"GEMS_ACQU_01",c9) SS SATThicknessAP 1 PrivateTag +(0019,"GEMS_ACQU_01",ca) SS SATThicknessHF 1 PrivateTag +(0019,"GEMS_ACQU_01",cb) SS PrescribedFlowAxis 1 PrivateTag +(0019,"GEMS_ACQU_01",cc) SS VelocityEncoding 1 PrivateTag +(0019,"GEMS_ACQU_01",cd) SS ThicknessDisclaimer 1 PrivateTag +(0019,"GEMS_ACQU_01",ce) SS PrescanType 1 PrivateTag +(0019,"GEMS_ACQU_01",cf) SS PrescanStatus 1 PrivateTag +(0019,"GEMS_ACQU_01",d0) SH RawDataType 1 PrivateTag +(0019,"GEMS_ACQU_01",d2) SS ProjectionAlgorithm 1 PrivateTag +(0019,"GEMS_ACQU_01",d3) SH ProjectionAlgorithm 1 PrivateTag +(0019,"GEMS_ACQU_01",d4) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",d5) SS FractionalEcho 1 PrivateTag +(0019,"GEMS_ACQU_01",d6) SS PrepPulse 1 PrivateTag +(0019,"GEMS_ACQU_01",d7) SS CardiacPhases 1 PrivateTag +(0019,"GEMS_ACQU_01",d8) SS VariableEchoFlag 1 PrivateTag +(0019,"GEMS_ACQU_01",d9) DS ConcatenatedSAT 1 PrivateTag +(0019,"GEMS_ACQU_01",da) SS ReferenceChannelUsed 1 PrivateTag +(0019,"GEMS_ACQU_01",db) DS BackProjectorCoefficient 1 PrivateTag +(0019,"GEMS_ACQU_01",dc) SS PrimarySpeedCorrectionUsed 1 PrivateTag +(0019,"GEMS_ACQU_01",dd) SS OverrangeCorrectionUsed 1 PrivateTag +(0019,"GEMS_ACQU_01",de) DS DynamicZAlphaValue 1 PrivateTag +(0019,"GEMS_ACQU_01",df) DS UserData23 1 PrivateTag +(0019,"GEMS_ACQU_01",e0) DS UserData24 1 PrivateTag +(0019,"GEMS_ACQU_01",e1) DS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",e2) DS VelocityEncodeScale 1 PrivateTag +(0019,"GEMS_ACQU_01",e3) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",e4) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",e5) IS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",e6) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",e8) DS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",e9) DS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",eb) DS Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",ec) US Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",f0) UN Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",f1) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",f2) SS FastPhases 1 PrivateTag +(0019,"GEMS_ACQU_01",f3) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",f4) LT Unknown 1 PrivateTag +(0019,"GEMS_ACQU_01",f9) DS TransmitGain 1 PrivateTag + +(0023,"GEMS_ACRQA_1.0 BLOCK1",00) LO CRExposureMenuCode 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",10) LO CRExposureMenuString 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",20) LO CREDRMode 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",30) LO CRLatitude 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",40) LO CRGroupNumber 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",50) US CRImageSerialNumber 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",60) LO CRBarCodeNumber 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",70) LO CRFilmOutputExposure 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",80) LO CRFilmFormat 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK1",90) LO CRSShiftString 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",00) US CRSShift 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",10) DS CRCShift 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",20) DS CRGT 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",30) DS CRGA 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",40) DS CRGC 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",50) DS CRGS 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",60) DS CRRT 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",70) DS CRRE 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",80) US CRRN 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK2",90) DS CRDRT 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",00) DS CRDRE 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",10) US CRDRN 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",20) DS CRORE 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",30) US CRORN 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",40) US CRORD 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",50) LO CRCassetteSize 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",60) LO CRMachineID 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",70) LO CRMachineType 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",80) LO CRTechnicianCode 1 PrivateTag +(0023,"GEMS_ACRQA_1.0 BLOCK3",90) LO CREnergySubtractionParameters 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",00) LO CRExposureMenuCode 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",10) LO CRExposureMenuString 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",20) LO CREDRMode 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",30) LO CRLatitude 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",40) LO CRGroupNumber 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",50) US CRImageSerialNumber 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",60) LO CRBarCodeNumber 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",70) LO CRFilmOutputExposure 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",80) LO CRFilmFormat 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK1",90) LO CRSShiftString 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",00) US CRSShift 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",10) LO CRCShift 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",20) LO CRGT 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",30) DS CRGA 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",40) DS CRGC 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",50) DS CRGS 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",60) LO CRRT 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",70) DS CRRE 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",80) US CRRN 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK2",90) DS CRDRT 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",00) DS CRDRE 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",10) US CRDRN 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",20) DS CRORE 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",30) US CRORN 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",40) US CRORD 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",50) LO CRCassetteSize 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",60) LO CRMachineID 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",70) LO CRMachineType 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",80) LO CRTechnicianCode 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",90) LO CREnergySubtractionParameters 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",f0) LO CRDistributionCode 1 PrivateTag +(0023,"GEMS_ACRQA_2.0 BLOCK3",ff) US CRShuttersApplied 1 PrivateTag + +(0047,"GEMS_ADWSoft_3D1",01) SQ Reconstruction Parameters Sequence 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",50) UL VolumeVoxelCount 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",51) UL VolumeSegmentCount 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",53) US VolumeSliceSize 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",54) US VolumeSliceCount 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",55) SL VolumeThresholdValue 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",57) DS VolumeVoxelRatio 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",58) DS VolumeVoxelSize 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",59) US VolumeZPositionSize 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",60) DS VolumeBaseLine 9 PrivateTag +(0047,"GEMS_ADWSoft_3D1",61) DS VolumeCenterPoint 3 PrivateTag +(0047,"GEMS_ADWSoft_3D1",63) SL VolumeSkewBase 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",64) DS VolumeRegistrationTransformRotationMatrix 9 PrivateTag +(0047,"GEMS_ADWSoft_3D1",65) DS VolumeRegistrationTransformTranslationVector 3 PrivateTag +(0047,"GEMS_ADWSoft_3D1",70) DS KVPList 1-n PrivateTag +(0047,"GEMS_ADWSoft_3D1",71) IS XRayTubeCurrentList 1-n PrivateTag +(0047,"GEMS_ADWSoft_3D1",72) IS ExposureList 1-n PrivateTag +(0047,"GEMS_ADWSoft_3D1",80) LO AcquisitionDLXIdentifier 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",85) SQ AcquisitionDLX2DSeriesSequence 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",89) DS ContrastAgentVolumeList 1-n PrivateTag +(0047,"GEMS_ADWSoft_3D1",8A) US NumberOfInjections 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",8B) US FrameCount 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",91) LO XA3DReconstructionAlgorithmName 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",92) CS XA3DReconstructionAlgorithmVersion 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",93) DA DLXCalibrationDate 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",94) TM DLXCalibrationTime 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",95) CS DLXCalibrationStatus 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",96) IS UsedFrames 1-n PrivateTag +(0047,"GEMS_ADWSoft_3D1",98) US TransformCount 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",99) SQ TransformSequence 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",9A) DS TransformRotationMatrix 9 PrivateTag +(0047,"GEMS_ADWSoft_3D1",9B) DS TransformTranslationVector 3 PrivateTag +(0047,"GEMS_ADWSoft_3D1",9C) LO TransformLabel 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B0) SQ WireframeList 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B1) US WireframeCount 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B2) US LocationSystem 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B5) LO WireframeName 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B6) LO WireframeGroupName 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B7) LO WireframeColor 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B8) SL WireframeAttributes 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",B9) SL WireframePointCount 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",BA) SL WireframeTimestamp 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",BB) SQ WireframePointList 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",BC) DS WireframePointsCoordinates 3 PrivateTag +(0047,"GEMS_ADWSoft_3D1",C0) DS VolumeUpperLeftHighCornerRAS 3 PrivateTag +(0047,"GEMS_ADWSoft_3D1",C1) DS VolumeSliceToRASRotationMatrix 9 PrivateTag +(0047,"GEMS_ADWSoft_3D1",C2) DS VolumeUpperLeftHighCornerTLOC 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",D1) OB VolumeSegmentList 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",D2) OB VolumeGradientList 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",D3) OB VolumeDensityList 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",D4) OB VolumeZPositionList 1 PrivateTag +(0047,"GEMS_ADWSoft_3D1",D5) OB VolumeOriginalIndexList 1 PrivateTag +(0039,"GEMS_ADWSoft_DPO",80) IS PrivateEntityNumber 1 PrivateTag +(0039,"GEMS_ADWSoft_DPO",85) DA PrivateEntityDate 1 PrivateTag +(0039,"GEMS_ADWSoft_DPO",90) TM PrivateEntityTime 1 PrivateTag +(0039,"GEMS_ADWSoft_DPO",95) LO PrivateEntityLaunchCommand 1 PrivateTag +(0039,"GEMS_ADWSoft_DPO",AA) CS PrivateEntityType 1 PrivateTag + +(0033,"GEMS_CTHD_01",02) UN Unknown 1 PrivateTag + +(0037,"GEMS_DRS_1",10) LO ReferringDepartment 1 PrivateTag +(0037,"GEMS_DRS_1",20) US ScreenNumber 1 PrivateTag +(0037,"GEMS_DRS_1",40) SH LeftOrientation 1 PrivateTag +(0037,"GEMS_DRS_1",42) SH RightOrientation 1 PrivateTag +(0037,"GEMS_DRS_1",50) CS Inversion 1 PrivateTag +(0037,"GEMS_DRS_1",60) US DSA 1 PrivateTag + +(0009,"GEMS_GENIE_1",10) LO Unknown 1 PrivateTag +(0009,"GEMS_GENIE_1",11) SL StudyFlags 1 PrivateTag +(0009,"GEMS_GENIE_1",12) SL StudyType 1 PrivateTag +(0009,"GEMS_GENIE_1",1e) UI Unknown 1 PrivateTag +(0009,"GEMS_GENIE_1",20) LO Unknown 1 PrivateTag +(0009,"GEMS_GENIE_1",21) SL SeriesFlags 1 PrivateTag +(0009,"GEMS_GENIE_1",22) SH UserOrientation 1 PrivateTag +(0009,"GEMS_GENIE_1",23) SL InitiationType 1 PrivateTag +(0009,"GEMS_GENIE_1",24) SL InitiationDelay 1 PrivateTag +(0009,"GEMS_GENIE_1",25) SL InitiationCountRate 1 PrivateTag +(0009,"GEMS_GENIE_1",26) SL NumberEnergySets 1 PrivateTag +(0009,"GEMS_GENIE_1",27) SL NumberDetectors 1 PrivateTag +(0009,"GEMS_GENIE_1",29) SL Unknown 1 PrivateTag +(0009,"GEMS_GENIE_1",2a) SL Unknown 1 PrivateTag +(0009,"GEMS_GENIE_1",2c) LO SeriesComments 1 PrivateTag +(0009,"GEMS_GENIE_1",2d) SL TrackBeatAverage 1 PrivateTag +(0009,"GEMS_GENIE_1",2e) FD DistancePrescribed 1 PrivateTag +(0009,"GEMS_GENIE_1",30) LO Unknown 1 PrivateTag +(0009,"GEMS_GENIE_1",35) SL GantryLocusType 1 PrivateTag +(0009,"GEMS_GENIE_1",37) SL StartingHeartRate 1 PrivateTag +(0009,"GEMS_GENIE_1",38) SL RRWindowWidth 1 PrivateTag +(0009,"GEMS_GENIE_1",39) SL RRWindowOffset 1 PrivateTag +(0009,"GEMS_GENIE_1",3a) SL PercentCycleImaged 1 PrivateTag +(0009,"GEMS_GENIE_1",40) LO Unknown 1 PrivateTag +(0009,"GEMS_GENIE_1",41) SL PatientFlags 1 PrivateTag +(0009,"GEMS_GENIE_1",42) DA PatientCreationDate 1 PrivateTag +(0009,"GEMS_GENIE_1",43) TM PatientCreationTime 1 PrivateTag +(0011,"GEMS_GENIE_1",0a) SL SeriesType 1 PrivateTag +(0011,"GEMS_GENIE_1",0b) SL EffectiveSeriesDuration 1 PrivateTag +(0011,"GEMS_GENIE_1",0c) SL NumBeats 1 PrivateTag +(0011,"GEMS_GENIE_1",0d) LO RadioNuclideName 1 PrivateTag +(0011,"GEMS_GENIE_1",10) LO Unknown 1 PrivateTag +(0011,"GEMS_GENIE_1",12) LO DatasetName 1 PrivateTag +(0011,"GEMS_GENIE_1",13) SL DatasetType 1 PrivateTag +(0011,"GEMS_GENIE_1",15) SL DetectorNumber 1 PrivateTag +(0011,"GEMS_GENIE_1",16) SL EnergyNumber 1 PrivateTag +(0011,"GEMS_GENIE_1",17) SL RRIntervalWindowNumber 1 PrivateTag +(0011,"GEMS_GENIE_1",18) SL MGBinNumber 1 PrivateTag +(0011,"GEMS_GENIE_1",19) FD RadiusOfRotation 1 PrivateTag +(0011,"GEMS_GENIE_1",1a) SL DetectorCountZone 1 PrivateTag +(0011,"GEMS_GENIE_1",1b) SL NumEnergyWindows 1 PrivateTag +(0011,"GEMS_GENIE_1",1c) SL EnergyOffset 4 PrivateTag +(0011,"GEMS_GENIE_1",1d) SL EnergyRange 1 PrivateTag +(0011,"GEMS_GENIE_1",1f) SL ImageOrientation 1 PrivateTag +(0011,"GEMS_GENIE_1",23) SL UseFOVMask 1 PrivateTag +(0011,"GEMS_GENIE_1",24) SL FOVMaskYCutoffAngle 1 PrivateTag +(0011,"GEMS_GENIE_1",25) SL FOVMaskCutoffAngle 1 PrivateTag +(0011,"GEMS_GENIE_1",26) SL TableOrientation 1 PrivateTag +(0011,"GEMS_GENIE_1",27) SL ROITopLeft 2 PrivateTag +(0011,"GEMS_GENIE_1",28) SL ROIBottomRight 2 PrivateTag +(0011,"GEMS_GENIE_1",30) LO Unknown 1 PrivateTag +(0011,"GEMS_GENIE_1",33) LO EnergyCorrectName 1 PrivateTag +(0011,"GEMS_GENIE_1",34) LO SpatialCorrectName 1 PrivateTag +(0011,"GEMS_GENIE_1",35) LO TuningCalibName 1 PrivateTag +(0011,"GEMS_GENIE_1",36) LO UniformityCorrectName 1 PrivateTag +(0011,"GEMS_GENIE_1",37) LO AcquisitionSpecificCorrectName 1 PrivateTag +(0011,"GEMS_GENIE_1",38) SL ByteOrder 1 PrivateTag +(0011,"GEMS_GENIE_1",3a) SL PictureFormat 1 PrivateTag +(0011,"GEMS_GENIE_1",3b) FD PixelScale 1 PrivateTag +(0011,"GEMS_GENIE_1",3c) FD PixelOffset 1 PrivateTag +(0011,"GEMS_GENIE_1",3e) SL FOVShape 1 PrivateTag +(0011,"GEMS_GENIE_1",3f) SL DatasetFlags 1 PrivateTag +(0011,"GEMS_GENIE_1",44) FD ThresholdCenter 1 PrivateTag +(0011,"GEMS_GENIE_1",45) FD ThresholdWidth 1 PrivateTag +(0011,"GEMS_GENIE_1",46) SL InterpolationType 1 PrivateTag +(0011,"GEMS_GENIE_1",55) FD Period 1 PrivateTag +(0011,"GEMS_GENIE_1",56) FD ElapsedTime 1 PrivateTag +(0013,"GEMS_GENIE_1",10) FD DigitalFOV 2 PrivateTag +(0013,"GEMS_GENIE_1",11) SL Unknown 1 PrivateTag +(0013,"GEMS_GENIE_1",12) SL Unknown 1 PrivateTag +(0013,"GEMS_GENIE_1",16) SL AutoTrackPeak 1 PrivateTag +(0013,"GEMS_GENIE_1",17) SL AutoTrackWidth 1 PrivateTag +(0013,"GEMS_GENIE_1",18) FD TransmissionScanTime 1 PrivateTag +(0013,"GEMS_GENIE_1",19) FD TransmissionMaskWidth 1 PrivateTag +(0013,"GEMS_GENIE_1",1a) FD CopperAttenuatorThickness 1 PrivateTag +(0013,"GEMS_GENIE_1",1c) FD Unknown 1 PrivateTag +(0013,"GEMS_GENIE_1",1d) FD Unknown 1 PrivateTag +(0013,"GEMS_GENIE_1",1e) FD TomoViewOffset 1-n PrivateTag +(0013,"GEMS_GENIE_1",26) LT StudyComments 1 PrivateTag + +(0033,"GEMS_GNHD_01",01) UN Unknown 1 PrivateTag +(0033,"GEMS_GNHD_01",02) UN Unknown 1 PrivateTag + +(0009,"GEMS_IDEN_01",01) LO FullFidelity 1 PrivateTag +(0009,"GEMS_IDEN_01",02) SH SuiteId 1 PrivateTag +(0009,"GEMS_IDEN_01",04) SH ProductId 1 PrivateTag +(0009,"GEMS_IDEN_01",17) LT Unknown 1 PrivateTag +(0009,"GEMS_IDEN_01",1a) US Unknown 1 PrivateTag +(0009,"GEMS_IDEN_01",20) US Unknown 1 PrivateTag +(0009,"GEMS_IDEN_01",27) SL ImageActualDate 1 PrivateTag +(0009,"GEMS_IDEN_01",2f) LT Unknown 1 PrivateTag +(0009,"GEMS_IDEN_01",30) SH ServiceId 1 PrivateTag +(0009,"GEMS_IDEN_01",31) SH MobileLocationNumber 1 PrivateTag +(0009,"GEMS_IDEN_01",e2) LT Unknown 1 PrivateTag +(0009,"GEMS_IDEN_01",e3) UI EquipmentUID 1 PrivateTag +(0009,"GEMS_IDEN_01",e6) SH GenesisVersionNow 1 PrivateTag +(0009,"GEMS_IDEN_01",e7) UL ExamRecordChecksum 1 PrivateTag +(0009,"GEMS_IDEN_01",e8) UL Unknown 1 PrivateTag +(0009,"GEMS_IDEN_01",e9) SL ActualSeriesDataTimeStamp 1 PrivateTag + +(0027,"GEMS_IMAG_01",06) SL ImageArchiveFlag 1 PrivateTag +(0027,"GEMS_IMAG_01",10) SS ScoutType 1 PrivateTag +(0027,"GEMS_IMAG_01",1c) SL VmaMamp 1 PrivateTag +(0027,"GEMS_IMAG_01",1d) SS VmaPhase 1 PrivateTag +(0027,"GEMS_IMAG_01",1e) SL VmaMod 1 PrivateTag +(0027,"GEMS_IMAG_01",1f) SL VmaClip 1 PrivateTag +(0027,"GEMS_IMAG_01",20) SS SmartScanOnOffFlag 1 PrivateTag +(0027,"GEMS_IMAG_01",30) SH ForeignImageRevision 1 PrivateTag +(0027,"GEMS_IMAG_01",31) SS ImagingMode 1 PrivateTag +(0027,"GEMS_IMAG_01",32) SS PulseSequence 1 PrivateTag +(0027,"GEMS_IMAG_01",33) SL ImagingOptions 1 PrivateTag +(0027,"GEMS_IMAG_01",35) SS PlaneType 1 PrivateTag +(0027,"GEMS_IMAG_01",36) SL ObliquePlane 1 PrivateTag +(0027,"GEMS_IMAG_01",40) SH RASLetterOfImageLocation 1 PrivateTag +(0027,"GEMS_IMAG_01",41) FL ImageLocation 1 PrivateTag +(0027,"GEMS_IMAG_01",42) FL CenterRCoordOfPlaneImage 1 PrivateTag +(0027,"GEMS_IMAG_01",43) FL CenterACoordOfPlaneImage 1 PrivateTag +(0027,"GEMS_IMAG_01",44) FL CenterSCoordOfPlaneImage 1 PrivateTag +(0027,"GEMS_IMAG_01",45) FL NormalRCoord 1 PrivateTag +(0027,"GEMS_IMAG_01",46) FL NormalACoord 1 PrivateTag +(0027,"GEMS_IMAG_01",47) FL NormalSCoord 1 PrivateTag +(0027,"GEMS_IMAG_01",48) FL RCoordOfTopRightCorner 1 PrivateTag +(0027,"GEMS_IMAG_01",49) FL ACoordOfTopRightCorner 1 PrivateTag +(0027,"GEMS_IMAG_01",4a) FL SCoordOfTopRightCorner 1 PrivateTag +(0027,"GEMS_IMAG_01",4b) FL RCoordOfBottomRightCorner 1 PrivateTag +(0027,"GEMS_IMAG_01",4c) FL ACoordOfBottomRightCorner 1 PrivateTag +(0027,"GEMS_IMAG_01",4d) FL SCoordOfBottomRightCorner 1 PrivateTag +(0027,"GEMS_IMAG_01",50) FL TableStartLocation 1 PrivateTag +(0027,"GEMS_IMAG_01",51) FL TableEndLocation 1 PrivateTag +(0027,"GEMS_IMAG_01",52) SH RASLetterForSideOfImage 1 PrivateTag +(0027,"GEMS_IMAG_01",53) SH RASLetterForAnteriorPosterior 1 PrivateTag +(0027,"GEMS_IMAG_01",54) SH RASLetterForScoutStartLoc 1 PrivateTag +(0027,"GEMS_IMAG_01",55) SH RASLetterForScoutEndLoc 1 PrivateTag +(0027,"GEMS_IMAG_01",60) FL ImageDimensionX 1 PrivateTag +(0027,"GEMS_IMAG_01",61) FL ImageDimensionY 1 PrivateTag +(0027,"GEMS_IMAG_01",62) FL NumberOfExcitations 1 PrivateTag + +(0029,"GEMS_IMPS_01",04) SL LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",05) DS LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",06) DS LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",07) SL LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",08) SH LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",09) SH LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",0a) SS LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",15) SL LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",16) SL LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",17) SL LowerRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",18) SL UpperRangeOfPixels 1 PrivateTag +(0029,"GEMS_IMPS_01",1a) SL LengthOfTotalHeaderInBytes 1 PrivateTag +(0029,"GEMS_IMPS_01",26) SS VersionOfHeaderStructure 1 PrivateTag +(0029,"GEMS_IMPS_01",34) SL AdvantageCompOverflow 1 PrivateTag +(0029,"GEMS_IMPS_01",35) SL AdvantageCompUnderflow 1 PrivateTag + +(0043,"GEMS_PARM_01",01) SS BitmapOfPrescanOptions 1 PrivateTag +(0043,"GEMS_PARM_01",02) SS GradientOffsetInX 1 PrivateTag +(0043,"GEMS_PARM_01",03) SS GradientOffsetInY 1 PrivateTag +(0043,"GEMS_PARM_01",04) SS GradientOffsetInZ 1 PrivateTag +(0043,"GEMS_PARM_01",05) SS ImageIsOriginalOrUnoriginal 1 PrivateTag +(0043,"GEMS_PARM_01",06) SS NumberOfEPIShots 1 PrivateTag +(0043,"GEMS_PARM_01",07) SS ViewsPerSegment 1 PrivateTag +(0043,"GEMS_PARM_01",08) SS RespiratoryRateInBPM 1 PrivateTag +(0043,"GEMS_PARM_01",09) SS RespiratoryTriggerPoint 1 PrivateTag +(0043,"GEMS_PARM_01",0a) SS TypeOfReceiverUsed 1 PrivateTag +(0043,"GEMS_PARM_01",0b) DS PeakRateOfChangeOfGradientField 1 PrivateTag +(0043,"GEMS_PARM_01",0c) DS LimitsInUnitsOfPercent 1 PrivateTag +(0043,"GEMS_PARM_01",0d) DS PSDEstimatedLimit 1 PrivateTag +(0043,"GEMS_PARM_01",0e) DS PSDEstimatedLimitInTeslaPerSecond 1 PrivateTag +(0043,"GEMS_PARM_01",0f) DS SARAvgHead 1 PrivateTag +(0043,"GEMS_PARM_01",10) US WindowValue 1 PrivateTag +(0043,"GEMS_PARM_01",11) US TotalInputViews 1 PrivateTag +(0043,"GEMS_PARM_01",12) SS XrayChain 3 PrivateTag +(0043,"GEMS_PARM_01",13) SS ReconKernelParameters 5 PrivateTag +(0043,"GEMS_PARM_01",14) SS CalibrationParameters 3 PrivateTag +(0043,"GEMS_PARM_01",15) SS TotalOutputViews 3 PrivateTag +(0043,"GEMS_PARM_01",16) SS NumberOfOverranges 5 PrivateTag +(0043,"GEMS_PARM_01",17) DS IBHImageScaleFactors 1 PrivateTag +(0043,"GEMS_PARM_01",18) DS BBHCoefficients 3 PrivateTag +(0043,"GEMS_PARM_01",19) SS NumberOfBBHChainsToBlend 1 PrivateTag +(0043,"GEMS_PARM_01",1a) SL StartingChannelNumber 1 PrivateTag +(0043,"GEMS_PARM_01",1b) SS PPScanParameters 1 PrivateTag +(0043,"GEMS_PARM_01",1c) SS GEImageIntegrity 1 PrivateTag +(0043,"GEMS_PARM_01",1d) SS LevelValue 1 PrivateTag +(0043,"GEMS_PARM_01",1e) DS DeltaStartTime 1 PrivateTag +(0043,"GEMS_PARM_01",1f) SL MaxOverrangesInAView 1 PrivateTag +(0043,"GEMS_PARM_01",20) DS AvgOverrangesAllViews 1 PrivateTag +(0043,"GEMS_PARM_01",21) SS CorrectedAfterglowTerms 1 PrivateTag +(0043,"GEMS_PARM_01",25) SS ReferenceChannels 6 PrivateTag +(0043,"GEMS_PARM_01",26) US NoViewsRefChannelsBlocked 6 PrivateTag +(0043,"GEMS_PARM_01",27) SH ScanPitchRatio 1 PrivateTag +(0043,"GEMS_PARM_01",28) OB UniqueImageIdentifier 1 PrivateTag +(0043,"GEMS_PARM_01",29) OB HistogramTables 1 PrivateTag +(0043,"GEMS_PARM_01",2a) OB UserDefinedData 1 PrivateTag +(0043,"GEMS_PARM_01",2b) SS PrivateScanOptions 4 PrivateTag +(0043,"GEMS_PARM_01",2c) SS EffectiveEchoSpacing 1 PrivateTag +(0043,"GEMS_PARM_01",2d) SH StringSlopField1 1 PrivateTag +(0043,"GEMS_PARM_01",2e) SH StringSlopField2 1 PrivateTag +(0043,"GEMS_PARM_01",2f) SS RawDataType 1 PrivateTag +(0043,"GEMS_PARM_01",30) SS RawDataType 1 PrivateTag +(0043,"GEMS_PARM_01",31) DS RACoordOfTargetReconCentre 2 PrivateTag +(0043,"GEMS_PARM_01",32) SS RawDataType 1 PrivateTag +(0043,"GEMS_PARM_01",33) FL NegScanSpacing 1 PrivateTag +(0043,"GEMS_PARM_01",34) IS OffsetFrequency 1 PrivateTag +(0043,"GEMS_PARM_01",35) UL UserUsageTag 1 PrivateTag +(0043,"GEMS_PARM_01",36) UL UserFillMapMSW 1 PrivateTag +(0043,"GEMS_PARM_01",37) UL UserFillMapLSW 1 PrivateTag +(0043,"GEMS_PARM_01",38) FL User25ToUser48 24 PrivateTag +(0043,"GEMS_PARM_01",39) IS SlopInteger6ToSlopInteger9 4 PrivateTag +(0043,"GEMS_PARM_01",40) FL TriggerOnPosition 4 PrivateTag +(0043,"GEMS_PARM_01",41) FL DegreeOfRotation 4 PrivateTag +(0043,"GEMS_PARM_01",42) SL DASTriggerSource 4 PrivateTag +(0043,"GEMS_PARM_01",43) SL DASFpaGain 4 PrivateTag +(0043,"GEMS_PARM_01",44) SL DASOutputSource 4 PrivateTag +(0043,"GEMS_PARM_01",45) SL DASAdInput 4 PrivateTag +(0043,"GEMS_PARM_01",46) SL DASCalMode 4 PrivateTag +(0043,"GEMS_PARM_01",47) SL DASCalFrequency 4 PrivateTag +(0043,"GEMS_PARM_01",48) SL DASRegXm 4 PrivateTag +(0043,"GEMS_PARM_01",49) SL DASAutoZero 4 PrivateTag +(0043,"GEMS_PARM_01",4a) SS StartingChannelOfView 4 PrivateTag +(0043,"GEMS_PARM_01",4b) SL DASXmPattern 4 PrivateTag +(0043,"GEMS_PARM_01",4c) SS TGGCTriggerMode 4 PrivateTag +(0043,"GEMS_PARM_01",4d) FL StartScanToXrayOnDelay 4 PrivateTag +(0043,"GEMS_PARM_01",4e) FL DurationOfXrayOn 4 PrivateTag +(0043,"GEMS_PARM_01",60) IS SlopInteger10ToSlopInteger17 8 PrivateTag +(0043,"GEMS_PARM_01",61) UI ScannerStudyEntityUID 1 PrivateTag +(0043,"GEMS_PARM_01",62) SH ScannerStudyID 1 PrivateTag +(0043,"GEMS_PARM_01",6f) DS ScannerTableEntry 3 PrivateTag +(0043,"GEMS_PARM_01",70) LO ParadigmName 1 PrivateTag +(0043,"GEMS_PARM_01",71) ST ParadigmDescription 1 PrivateTag +(0043,"GEMS_PARM_01",72) UI ParadigmUID 1 PrivateTag +(0043,"GEMS_PARM_01",73) US ExperimentType 1 PrivateTag +(0043,"GEMS_PARM_01",74) US NumberOfRestVolumes 1 PrivateTag +(0043,"GEMS_PARM_01",75) US NumberOfActiveVolumes 1 PrivateTag +(0043,"GEMS_PARM_01",76) US NumberOfDummyScans 1 PrivateTag +(0043,"GEMS_PARM_01",77) SH ApplicationName 1 PrivateTag +(0043,"GEMS_PARM_01",78) SH ApplicationVersion 1 PrivateTag +(0043,"GEMS_PARM_01",79) US SlicesPerVolume 1 PrivateTag +(0043,"GEMS_PARM_01",7a) US ExpectedTimePoints 1 PrivateTag +(0043,"GEMS_PARM_01",7b) FL RegressorValues 1-n PrivateTag +(0043,"GEMS_PARM_01",7c) FL DelayAfterSliceGroup 1 PrivateTag +(0043,"GEMS_PARM_01",7d) US ReconModeFlagWord 1 PrivateTag +(0043,"GEMS_PARM_01",7e) LO PACCSpecificInformation 1-n PrivateTag +(0043,"GEMS_PARM_01",7f) DS EDWIScaleFactor 1-n PrivateTag +(0043,"GEMS_PARM_01",80) LO CoilIDData 1-n PrivateTag +(0043,"GEMS_PARM_01",81) LO GECoilName 1 PrivateTag +(0043,"GEMS_PARM_01",82) LO SystemConfigurationInformation 1-n PrivateTag +(0043,"GEMS_PARM_01",83) DS AssetRFactors 1-2 PrivateTag +(0043,"GEMS_PARM_01",84) LO AdditionalAssetData 5-n PrivateTag +(0043,"GEMS_PARM_01",85) UT DebugDataTextFormat 1 PrivateTag +(0043,"GEMS_PARM_01",86) OB DebugDataBinaryFormat 1 PrivateTag +(0043,"GEMS_PARM_01",87) UT ScannerSoftwareVersionLongForm 1 PrivateTag +(0043,"GEMS_PARM_01",88) UI PUREAcquisitionCalibrationSeriesUID 1 PrivateTag +(0043,"GEMS_PARM_01",89) LO GoverningBodydBdtAndSARDefinition 3 PrivateTag +(0043,"GEMS_PARM_01",8a) CS PrivateInPlanePhaseEncodingDirection 1 PrivateTag +(0043,"GEMS_PARM_01",8b) OB FMRIBinaryDataBlock 1 PrivateTag +(0043,"GEMS_PARM_01",8c) DS VoxelLocation 6 PrivateTag +(0043,"GEMS_PARM_01",8d) DS SATBandLocations 7-7n PrivateTag +(0043,"GEMS_PARM_01",8e) DS SpectroPrescanValues 3 PrivateTag +(0043,"GEMS_PARM_01",8f) DS SpectroParameters 3 PrivateTag +(0043,"GEMS_PARM_01",90) LO SARDefinition 1-n PrivateTag +(0043,"GEMS_PARM_01",91) DS SARValue 1-n PrivateTag +(0043,"GEMS_PARM_01",92) LO ImageErrorText 1 PrivateTag +(0043,"GEMS_PARM_01",93) DS SpectroQuantitationValues 1-n PrivateTag +(0043,"GEMS_PARM_01",94) DS SpectroRatioValues 1-n PrivateTag +(0043,"GEMS_PARM_01",95) LO PrescanReuseString 1 PrivateTag +(0043,"GEMS_PARM_01",96) CS ContentQualification 1 PrivateTag +(0043,"GEMS_PARM_01",97) LO ImageFilteringParameters 9 PrivateTag +(0043,"GEMS_PARM_01",98) UI ASSETAcquisitionCalibrationSeriesUID 1 PrivateTag +(0043,"GEMS_PARM_01",99) LO ExtendedOptions 1-n PrivateTag +(0043,"GEMS_PARM_01",9a) IS RxStackIdentification 1 PrivateTag +(0043,"GEMS_PARM_01",9b) DS NPWFactor 1 PrivateTag +(0043,"GEMS_PARM_01",9c) OB ResearchTag1 1 PrivateTag +(0043,"GEMS_PARM_01",9d) OB ResearchTag2 1 PrivateTag +(0043,"GEMS_PARM_01",9e) OB ResearchTag3 1 PrivateTag +(0043,"GEMS_PARM_01",9f) OB ResearchTag4 1 PrivateTag + +(0011,"GEMS_PATI_01",10) SS PatientStatus 1 PrivateTag + +(0021,"GEMS_RELA_01",03) SS SeriesFromWhichPrescribed 1 PrivateTag +(0021,"GEMS_RELA_01",05) SH GenesisVersionNow 1 PrivateTag +(0021,"GEMS_RELA_01",07) UL SeriesRecordChecksum 1 PrivateTag +(0021,"GEMS_RELA_01",15) US Unknown 1 PrivateTag +(0021,"GEMS_RELA_01",16) SS Unknown 1 PrivateTag +(0021,"GEMS_RELA_01",18) SH GenesisVersionNow 1 PrivateTag +(0021,"GEMS_RELA_01",19) UL AcqReconRecordChecksum 1 PrivateTag +(0021,"GEMS_RELA_01",20) DS TableStartLocation 1 PrivateTag +(0021,"GEMS_RELA_01",35) SS SeriesFromWhichPrescribed 1 PrivateTag +(0021,"GEMS_RELA_01",36) SS ImageFromWhichPrescribed 1 PrivateTag +(0021,"GEMS_RELA_01",37) SS ScreenFormat 1 PrivateTag +(0021,"GEMS_RELA_01",4a) LO AnatomicalReferenceForScout 1 PrivateTag +(0021,"GEMS_RELA_01",4e) US Unknown 1 PrivateTag +(0021,"GEMS_RELA_01",4f) SS LocationsInAcquisition 1 PrivateTag +(0021,"GEMS_RELA_01",50) SS GraphicallyPrescribed 1 PrivateTag +(0021,"GEMS_RELA_01",51) DS RotationFromSourceXRot 1 PrivateTag +(0021,"GEMS_RELA_01",52) DS RotationFromSourceYRot 1 PrivateTag +(0021,"GEMS_RELA_01",53) DS RotationFromSourceZRot 1 PrivateTag +(0021,"GEMS_RELA_01",54) SH ImagePosition 3 PrivateTag +(0021,"GEMS_RELA_01",55) SH ImageOrientation 6 PrivateTag +(0021,"GEMS_RELA_01",56) SL IntegerSlop 1 PrivateTag +(0021,"GEMS_RELA_01",57) SL IntegerSlop 1 PrivateTag +(0021,"GEMS_RELA_01",58) SL IntegerSlop 1 PrivateTag +(0021,"GEMS_RELA_01",59) SL IntegerSlop 1 PrivateTag +(0021,"GEMS_RELA_01",5a) SL IntegerSlop 1 PrivateTag +(0021,"GEMS_RELA_01",5b) DS FloatSlop 1 PrivateTag +(0021,"GEMS_RELA_01",5c) DS FloatSlop 1 PrivateTag +(0021,"GEMS_RELA_01",5d) DS FloatSlop 1 PrivateTag +(0021,"GEMS_RELA_01",5e) DS FloatSlop 1 PrivateTag +(0021,"GEMS_RELA_01",5f) DS FloatSlop 1 PrivateTag +(0021,"GEMS_RELA_01",70) LT Unknown 1 PrivateTag +(0021,"GEMS_RELA_01",71) LT Unknown 1 PrivateTag +(0021,"GEMS_RELA_01",81) DS AutoWindowLevelAlpha 1 PrivateTag +(0021,"GEMS_RELA_01",82) DS AutoWindowLevelBeta 1 PrivateTag +(0021,"GEMS_RELA_01",83) DS AutoWindowLevelWindow 1 PrivateTag +(0021,"GEMS_RELA_01",84) DS AutoWindowLevelLevel 1 PrivateTag +(0021,"GEMS_RELA_01",90) SS TubeFocalSpotPosition 1 PrivateTag +(0021,"GEMS_RELA_01",91) SS BiopsyPosition 1 PrivateTag +(0021,"GEMS_RELA_01",92) FL BiopsyTLocation 1 PrivateTag +(0021,"GEMS_RELA_01",93) FL BiopsyRefLocation 1 PrivateTag + +(0045,"GEMS_SENO_02",04) CS AES 1 PrivateTag +(0045,"GEMS_SENO_02",06) DS Angulation 1 PrivateTag +(0045,"GEMS_SENO_02",09) DS RealMagnificationFactor 1 PrivateTag +(0045,"GEMS_SENO_02",0b) CS SenographType 1 PrivateTag +(0045,"GEMS_SENO_02",0c) DS IntegrationTime 1 PrivateTag +(0045,"GEMS_SENO_02",0d) DS ROIOriginXY 1 PrivateTag +(0045,"GEMS_SENO_02",11) DS ReceptorSizeCmXY 2 PrivateTag +(0045,"GEMS_SENO_02",12) IS ReceptorSizePixelsXY 2 PrivateTag +(0045,"GEMS_SENO_02",13) ST Screen 1 PrivateTag +(0045,"GEMS_SENO_02",14) DS PixelPitchMicrons 1 PrivateTag +(0045,"GEMS_SENO_02",15) IS PixelDepthBits 1 PrivateTag +(0045,"GEMS_SENO_02",16) IS BinningFactorXY 2 PrivateTag +(0045,"GEMS_SENO_02",1B) CS ClinicalView 1 PrivateTag +(0045,"GEMS_SENO_02",1D) DS MeanOfRawGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",1E) DS MeanOfOffsetGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",1F) DS MeanOfCorrectedGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",20) DS MeanOfRegionGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",21) DS MeanOfLogRegionGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",22) DS StandardDeviationOfRawGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",23) DS StandardDeviationOfCorrectedGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",24) DS StandardDeviationOfRegionGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",25) DS StandardDeviationOfLogRegionGrayLevels 1 PrivateTag +(0045,"GEMS_SENO_02",26) OB MAOBuffer 1 PrivateTag +(0045,"GEMS_SENO_02",27) IS SetNumber 1 PrivateTag +(0045,"GEMS_SENO_02",28) CS WindowingType 1 PrivateTag +(0045,"GEMS_SENO_02",29) DS WindowingParameters 1-n PrivateTag +(0045,"GEMS_SENO_02",2a) IS CrosshairCursorXCoordinates 1 PrivateTag +(0045,"GEMS_SENO_02",2b) IS CrosshairCursorYCoordinates 1 PrivateTag +(0045,"GEMS_SENO_02",39) US VignetteRows 1 PrivateTag +(0045,"GEMS_SENO_02",3a) US VignetteColumns 1 PrivateTag +(0045,"GEMS_SENO_02",3b) US VignetteBitsAllocated 1 PrivateTag +(0045,"GEMS_SENO_02",3c) US VignetteBitsStored 1 PrivateTag +(0045,"GEMS_SENO_02",3d) US VignetteHighBit 1 PrivateTag +(0045,"GEMS_SENO_02",3e) US VignettePixelRepresentation 1 PrivateTag +(0045,"GEMS_SENO_02",3f) OB VignettePixelData 1 PrivateTag + +(0025,"GEMS_SERS_01",06) SS LastPulseSequenceUsed 1 PrivateTag +(0025,"GEMS_SERS_01",07) SL ImagesInSeries 1 PrivateTag +(0025,"GEMS_SERS_01",10) SL LandmarkCounter 1 PrivateTag +(0025,"GEMS_SERS_01",11) SS NumberOfAcquisitions 1 PrivateTag +(0025,"GEMS_SERS_01",14) SL IndicatesNumberOfUpdatesToHeader 1 PrivateTag +(0025,"GEMS_SERS_01",17) SL SeriesCompleteFlag 1 PrivateTag +(0025,"GEMS_SERS_01",18) SL NumberOfImagesArchived 1 PrivateTag +(0025,"GEMS_SERS_01",19) SL LastImageNumberUsed 1 PrivateTag +(0025,"GEMS_SERS_01",1a) SH PrimaryReceiverSuiteAndHost 1 PrivateTag + +(0023,"GEMS_STDY_01",01) SL NumberOfSeriesInStudy 1 PrivateTag +(0023,"GEMS_STDY_01",02) SL NumberOfUnarchivedSeries 1 PrivateTag +(0023,"GEMS_STDY_01",10) SS ReferenceImageField 1 PrivateTag +(0023,"GEMS_STDY_01",50) SS SummaryImage 1 PrivateTag +(0023,"GEMS_STDY_01",70) FD StartTimeSecsInFirstAxial 1 PrivateTag +(0023,"GEMS_STDY_01",74) SL NumberOfUpdatesToHeader 1 PrivateTag +(0023,"GEMS_STDY_01",7d) SS IndicatesIfStudyHasCompleteInfo 1 PrivateTag + +(0033,"GEMS_YMHD_01",05) UN Unknown 1 PrivateTag +(0033,"GEMS_YMHD_01",06) UN Unknown 1 PrivateTag + +(0019,"GE_GENESIS_REV3.0",39) SS AxialType 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",8f) SS SwapPhaseFrequency 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",9c) SS PulseSequenceName 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",9f) SS CoilType 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",a4) SS SATFatWaterBone 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",c0) SS BitmapOfSATSelections 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",c1) SS SurfaceCoilIntensityCorrectionFlag 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",cb) SS PhaseContrastFlowAxis 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",cc) SS PhaseContrastVelocityEncoding 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",d5) SS FractionalEcho 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",d8) SS VariableEchoFlag 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",d9) DS ConcatenatedSat 1 PrivateTag +(0019,"GE_GENESIS_REV3.0",f2) SS NumberOfPhases 1 PrivateTag +(0043,"GE_GENESIS_REV3.0",1e) DS DeltaStartTime 1 PrivateTag +(0043,"GE_GENESIS_REV3.0",27) SH ScanPitchRatio 1 PrivateTag + +(0029,"INTELERAD MEDICAL SYSTEMS",01) FD ImageCompressionFraction 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",02) FD ImageQuality 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",03) FD ImageBytesTransferred 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",10) SH J2cParameterType 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",11) US J2cPixelRepresentation 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",12) US J2cBitsAllocated 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",13) US J2cPixelShiftValue 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",14) US J2cPlanarConfiguration 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",15) DS J2cRescaleIntercept 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",20) LO PixelDataMD5SumPerFrame 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",21) US HistogramPercentileLabels 1 PrivateTag +(0029,"INTELERAD MEDICAL SYSTEMS",22) FD HistogramPercentileValues 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",01) LO InstitutionCode 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",02) LO RoutedTransferAE 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",03) LO SourceAE 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",04) SH DeferredValidation 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",05) LO SeriesOwner 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",06) LO OrderGroupNumber 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",07) SH StrippedPixelData 1 PrivateTag +(3f01,"INTELERAD MEDICAL SYSTEMS",08) SH PendingMoveRequest 1 PrivateTag + +(0041,"INTEGRIS 1.0",20) FL AccumulatedFluoroscopyDose 1 PrivateTag +(0041,"INTEGRIS 1.0",30) FL AccumulatedExposureDose 1 PrivateTag +(0041,"INTEGRIS 1.0",40) FL TotalDose 1 PrivateTag +(0041,"INTEGRIS 1.0",41) FL TotalNumberOfFrames 1 PrivateTag +(0041,"INTEGRIS 1.0",50) SQ ExposureInformationSequence 1 PrivateTag +(0009,"INTEGRIS 1.0",08) CS ExposureChannel 1-n PrivateTag +(0009,"INTEGRIS 1.0",32) TM ExposureStartTime 1 PrivateTag +(0019,"INTEGRIS 1.0",00) LO APRName 1 PrivateTag +(0019,"INTEGRIS 1.0",40) DS FrameRate 1 PrivateTag +(0021,"INTEGRIS 1.0",12) IS ExposureNumber 1 PrivateTag +(0029,"INTEGRIS 1.0",08) IS NumberOfExposureResults 1 PrivateTag + +(0029,"ISG shadow",70) IS Unknown 1 PrivateTag +(0029,"ISG shadow",80) IS Unknown 1 PrivateTag +(0029,"ISG shadow",90) IS Unknown 1 PrivateTag + +(0009,"ISI",01) UN SIENETGeneralPurposeIMGEF 1 PrivateTag + +(0009,"MERGE TECHNOLOGIES, INC.",00) OB Unknown 1 PrivateTag + +(0029,"OCULUS Optikgeraete GmbH",1010) OB OriginalMeasuringData 1 PrivateTag +(0029,"OCULUS Optikgeraete GmbH",1012) UL OriginalMeasuringDataLength 1 PrivateTag +(0029,"OCULUS Optikgeraete GmbH",1020) OB OriginalMeasuringRawData 1 PrivateTag +(0029,"OCULUS Optikgeraete GmbH",1022) UL OriginalMeasuringRawDataLength 1 PrivateTag + +(0041,"PAPYRUS 3.0",00) LT PapyrusComments 1 PrivateTag +(0041,"PAPYRUS 3.0",10) SQ PointerSequence 1 PrivateTag +(0041,"PAPYRUS 3.0",11) UL ImagePointer 1 PrivateTag +(0041,"PAPYRUS 3.0",12) UL PixelOffset 1 PrivateTag +(0041,"PAPYRUS 3.0",13) SQ ImageIdentifierSequence 1 PrivateTag +(0041,"PAPYRUS 3.0",14) SQ ExternalFileReferenceSequence 1 PrivateTag +(0041,"PAPYRUS 3.0",15) US NumberOfImages 1 PrivateTag +(0041,"PAPYRUS 3.0",21) UI ReferencedSOPClassUID 1 PrivateTag +(0041,"PAPYRUS 3.0",22) UI ReferencedSOPInstanceUID 1 PrivateTag +(0041,"PAPYRUS 3.0",31) LT ReferencedFileName 1 PrivateTag +(0041,"PAPYRUS 3.0",32) LT ReferencedFilePath 1-n PrivateTag +(0041,"PAPYRUS 3.0",41) UI ReferencedImageSOPClassUID 1 PrivateTag +(0041,"PAPYRUS 3.0",42) UI ReferencedImageSOPInstanceUID 1 PrivateTag +(0041,"PAPYRUS 3.0",50) SQ ImageSequence 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",00) IS OverlayID 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",01) LT LinkedOverlays 1-n PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",10) US OverlayRows 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",11) US OverlayColumns 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",40) LO OverlayType 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",50) US OverlayOrigin 1-n PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",60) LO Editable 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",70) LO OverlayFont 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",72) LO OverlayStyle 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",74) US OverlayFontSize 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",76) LO OverlayColor 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",78) US ShadowSize 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",80) LO FillPattern 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",82) US OverlayPenSize 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",a0) LO Label 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",a2) LT PostItText 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",a4) US AnchorPoint 2 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",b0) LO ROIType 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",b2) LT AttachedAnnotation 1 PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",ba) US ContourPoints 1-n PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",bc) US MaskData 1-n PrivateTag +(6001-o-60ff,"PAPYRUS 3.0",c0) SQ UINOverlaySequence 1 PrivateTag + +(0009,"PAPYRUS",00) LT OriginalFileName 1 PrivateTag +(0009,"PAPYRUS",10) LT OriginalFileLocation 1 PrivateTag +(0009,"PAPYRUS",18) LT DataSetIdentifier 1 PrivateTag +(0041,"PAPYRUS",00) LT PapyrusComments 1-n PrivateTag +(0041,"PAPYRUS",10) US FolderType 1 PrivateTag +(0041,"PAPYRUS",11) LT PatientFolderDataSetID 1 PrivateTag +(0041,"PAPYRUS",20) LT FolderName 1 PrivateTag +(0041,"PAPYRUS",30) DA CreationDate 1 PrivateTag +(0041,"PAPYRUS",32) TM CreationTime 1 PrivateTag +(0041,"PAPYRUS",34) DA ModifiedDate 1 PrivateTag +(0041,"PAPYRUS",36) TM ModifiedTime 1 PrivateTag +(0041,"PAPYRUS",40) LT OwnerName 1-n PrivateTag +(0041,"PAPYRUS",50) LT FolderStatus 1 PrivateTag +(0041,"PAPYRUS",60) UL NumberOfImages 1 PrivateTag +(0041,"PAPYRUS",62) UL NumberOfOther 1 PrivateTag +(0041,"PAPYRUS",a0) LT ExternalFolderElementDSID 1-n PrivateTag +(0041,"PAPYRUS",a1) US ExternalFolderElementDataSetType 1-n PrivateTag +(0041,"PAPYRUS",a2) LT ExternalFolderElementFileLocation 1-n PrivateTag +(0041,"PAPYRUS",a3) UL ExternalFolderElementLength 1-n PrivateTag +(0041,"PAPYRUS",b0) LT InternalFolderElementDSID 1-n PrivateTag +(0041,"PAPYRUS",b1) US InternalFolderElementDataSetType 1-n PrivateTag +(0041,"PAPYRUS",b2) UL InternalOffsetToDataSet 1-n PrivateTag +(0041,"PAPYRUS",b3) UL InternalOffsetToImage 1-n + +# Note: Some Philips devices use these private tags with reservation value +# "Philips Imaging DD 001", others use "PHILIPS IMAGING DD 001". All attributes +# should thus be present twice in this dictionary, once for each spelling variant. +# +(2001,"Philips Imaging DD 001",01) FL ChemicalShift 1 PrivateTag +(2001,"Philips Imaging DD 001",02) IS ChemicalShiftNumberMR 1 PrivateTag +(2001,"Philips Imaging DD 001",03) FL DiffusionBFactor 1 PrivateTag +(2001,"Philips Imaging DD 001",04) CS DiffusionDirection 1 PrivateTag +(2001,"Philips Imaging DD 001",06) CS ImageEnhanced 1 PrivateTag +(2001,"Philips Imaging DD 001",07) CS ImageTypeEDES 1 PrivateTag +(2001,"Philips Imaging DD 001",08) IS PhaseNumber 1 PrivateTag +(2001,"Philips Imaging DD 001",09) FL ImagePrepulseDelay 1 PrivateTag +(2001,"Philips Imaging DD 001",0a) IS SliceNumberMR 1 PrivateTag +(2001,"Philips Imaging DD 001",0b) CS SliceOrientation 1 PrivateTag +(2001,"Philips Imaging DD 001",0c) CS ArrhythmiaRejection 1 PrivateTag +(2001,"Philips Imaging DD 001",0e) CS CardiacCycled 1 PrivateTag +(2001,"Philips Imaging DD 001",0f) SS CardiacGateWidth 1 PrivateTag +(2001,"Philips Imaging DD 001",10) CS CardiacSync 1 PrivateTag +(2001,"Philips Imaging DD 001",11) FL DiffusionEchoTime 1 PrivateTag +(2001,"Philips Imaging DD 001",12) CS DynamicSeries 1 PrivateTag +(2001,"Philips Imaging DD 001",13) SL EPIFactor 1 PrivateTag +(2001,"Philips Imaging DD 001",14) SL NumberOfEchoes 1 PrivateTag +(2001,"Philips Imaging DD 001",15) SS NumberOfLocations 1 PrivateTag +(2001,"Philips Imaging DD 001",16) SS NumberOfPCDirections 1 PrivateTag +(2001,"Philips Imaging DD 001",17) SL NumberOfPhasesMR 1 PrivateTag +(2001,"Philips Imaging DD 001",18) SL NumberOfSlicesMR 1 PrivateTag +(2001,"Philips Imaging DD 001",19) CS PartialMatrixScanned 1 PrivateTag +(2001,"Philips Imaging DD 001",1a) FL PCVelocity 1-n PrivateTag +(2001,"Philips Imaging DD 001",1b) FL PrepulseDelay 1 PrivateTag +(2001,"Philips Imaging DD 001",1c) CS PrepulseType 1 PrivateTag +(2001,"Philips Imaging DD 001",1d) IS ReconstructionNumberMR 1 PrivateTag +(2001,"Philips Imaging DD 001",1f) CS RespirationSync 1 PrivateTag +(2001,"Philips Imaging DD 001",20) LO ScanningTechnique 1 PrivateTag +(2001,"Philips Imaging DD 001",21) CS SPIR 1 PrivateTag +(2001,"Philips Imaging DD 001",22) FL WaterFatShift 1 PrivateTag +(2001,"Philips Imaging DD 001",23) DS FlipAnglePhilips 1 PrivateTag +(2001,"Philips Imaging DD 001",24) CS SeriesIsInteractive 1 PrivateTag +(2001,"Philips Imaging DD 001",25) SH EchoTimeDisplayMR 1 PrivateTag +(2001,"Philips Imaging DD 001",26) CS PresentationStateSubtractionActive 1 PrivateTag +(2001,"Philips Imaging DD 001",2d) SS StackNumberOfSlices 1 PrivateTag +(2001,"Philips Imaging DD 001",32) FL StackRadialAngle 1 PrivateTag +(2001,"Philips Imaging DD 001",33) CS StackRadialAxis 1 PrivateTag +(2001,"Philips Imaging DD 001",35) SS StackSliceNumber 1 PrivateTag +(2001,"Philips Imaging DD 001",36) CS StackType 1 PrivateTag +(2001,"Philips Imaging DD 001",3f) CS ZoomMode 1 PrivateTag +(2001,"Philips Imaging DD 001",58) UL ContrastTransferTaste 1 PrivateTag +(2001,"Philips Imaging DD 001",5f) SQ StackSequence 1 PrivateTag +(2001,"Philips Imaging DD 001",60) SL NumberOfStacks 1 PrivateTag +(2001,"Philips Imaging DD 001",61) CS SeriesTransmitted 1 PrivateTag +(2001,"Philips Imaging DD 001",62) CS SeriesCommitted 1 PrivateTag +(2001,"Philips Imaging DD 001",63) CS ExaminationSource 1 PrivateTag +(2001,"Philips Imaging DD 001",67) CS LinearPresentationGLTrafoShapeSub 1 PrivateTag +(2001,"Philips Imaging DD 001",77) CS GLTrafoType 1 PrivateTag +(2001,"Philips Imaging DD 001",7b) IS AcquisitionNumber 1 PrivateTag +(2001,"Philips Imaging DD 001",81) IS NumberOfDynamicScans 1 PrivateTag +(2001,"Philips Imaging DD 001",9f) US PixelProcessingKernelSize 1 PrivateTag +(2001,"Philips Imaging DD 001",a1) CS IsRawImage 1 PrivateTag +(2001,"Philips Imaging DD 001",f1) FL ProspectiveMotionCorrection 1 PrivateTag +(2001,"Philips Imaging DD 001",f2) FL RetrospectiveMotionCorrection 1 PrivateTag + +# Note: Some Philips devices use these private tags with reservation value +# "Philips Imaging DD 001", others use "PHILIPS IMAGING DD 001". All attributes +# should thus be present twice in this dictionary, once for each spelling variant. +# +(2001,"PHILIPS IMAGING DD 001",01) FL ChemicalShift 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",02) IS ChemicalShiftNumberMR 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",03) FL DiffusionBFactor 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",04) CS DiffusionDirection 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",06) CS ImageEnhanced 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",07) CS ImageTypeEDES 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",08) IS PhaseNumber 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",09) FL ImagePrepulseDelay 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",0a) IS SliceNumberMR 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",0b) CS SliceOrientation 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",0c) CS ArrhythmiaRejection 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",0e) CS CardiacCycled 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",0f) SS CardiacGateWidth 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",10) CS CardiacSync 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",11) FL DiffusionEchoTime 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",12) CS DynamicSeries 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",13) SL EPIFactor 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",14) SL NumberOfEchoes 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",15) SS NumberOfLocations 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",16) SS NumberOfPCDirections 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",17) SL NumberOfPhasesMR 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",18) SL NumberOfSlicesMR 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",19) CS PartialMatrixScanned 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",1a) FL PCVelocity 1-n PrivateTag +(2001,"PHILIPS IMAGING DD 001",1b) FL PrepulseDelay 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",1c) CS PrepulseType 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",1d) IS ReconstructionNumberMR 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",1f) CS RespirationSync 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",20) LO ScanningTechnique 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",21) CS SPIR 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",22) FL WaterFatShift 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",23) DS FlipAnglePhilips 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",24) CS SeriesIsInteractive 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",25) SH EchoTimeDisplayMR 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",26) CS PresentationStateSubtractionActive 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",2d) SS StackNumberOfSlices 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",32) FL StackRadialAngle 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",33) CS StackRadialAxis 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",35) SS StackSliceNumber 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",36) CS StackType 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",3f) CS ZoomMode 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",58) UL ContrastTransferTaste 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",5f) SQ StackSequence 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",60) SL NumberOfStacks 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",61) CS SeriesTransmitted 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",62) CS SeriesCommitted 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",63) CS ExaminationSource 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",67) CS LinearPresentationGLTrafoShapeSub 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",77) CS GLTrafoType 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",7b) IS AcquisitionNumber 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",81) IS NumberOfDynamicScans 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",9f) US PixelProcessingKernelSize 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",a1) CS IsRawImage 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",f1) FL ProspectiveMotionCorrection 1 PrivateTag +(2001,"PHILIPS IMAGING DD 001",f2) FL RetrospectiveMotionCorrection 1 PrivateTag + +# Note: Some Philips devices use these private tags with reservation value +# "Philips MR Imaging DD 001", others use "PHILIPS MR IMAGING DD 001". All attributes +# should thus be present twice in this dictionary, once for each spelling variant. +# +(2005,"Philips MR Imaging DD 001",05) CS SynergyReconstructionType 1 PrivateTag +(2005,"Philips MR Imaging DD 001",1e) SH MIPProtocol 1 PrivateTag +(2005,"Philips MR Imaging DD 001",1f) SH MPRProtocol 1 PrivateTag +(2005,"Philips MR Imaging DD 001",20) SL NumberOfChemicalShifts 1 PrivateTag +(2005,"Philips MR Imaging DD 001",2d) SS NumberOfStackSlices 1 PrivateTag +(2005,"Philips MR Imaging DD 001",83) SQ Unknown 1 PrivateTag +(2005,"Philips MR Imaging DD 001",a1) CS SyncraScanType 1 PrivateTag +(2005,"Philips MR Imaging DD 001",b0) FL DiffusionDirectionRL 1 PrivateTag +(2005,"Philips MR Imaging DD 001",b1) FL DiffusionDirectionAP 1 PrivateTag +(2005,"Philips MR Imaging DD 001",b2) FL DiffusionDirectionFH 1 PrivateTag + +(2005,"Philips MR Imaging DD 005",02) SQ Unknown 1 PrivateTag + +# Note: Some Philips devices use these private tags with reservation value +# "Philips MR Imaging DD 001", others use "PHILIPS MR IMAGING DD 001". All attributes +# should thus be present twice in this dictionary, once for each spelling variant. +# +(2005,"PHILIPS MR IMAGING DD 001",05) CS SynergyReconstructionType 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",1e) SH MIPProtocol 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",1f) SH MPRProtocol 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",20) SL NumberOfChemicalShifts 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",2d) SS NumberOfStackSlices 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",83) SQ Unknown 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",a1) CS SyncraScanType 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",b0) FL DiffusionDirectionRL 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",b1) FL DiffusionDirectionAP 1 PrivateTag +(2005,"PHILIPS MR IMAGING DD 001",b2) FL DiffusionDirectionFH 1 PrivateTag + +(0019,"PHILIPS MR R5.5/PART",1000) DS FieldOfView 1 PrivateTag +(0019,"PHILIPS MR R5.6/PART",1000) DS FieldOfView 1 PrivateTag + +(0019,"PHILIPS MR SPECTRO;1",01) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",02) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",03) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",04) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",05) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",06) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",07) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",08) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",09) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",10) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",12) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",13) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",14) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",15) US Unknown 1-n PrivateTag +(0019,"PHILIPS MR SPECTRO;1",16) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",17) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",18) UN Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",20) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",21) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",22) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",23) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",24) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",25) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",26) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",27) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",28) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",29) IS Unknown 1-n PrivateTag +(0019,"PHILIPS MR SPECTRO;1",31) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",32) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",41) LT Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",42) IS Unknown 2 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",43) IS Unknown 2 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",45) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",46) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",47) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",48) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",49) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",50) UN Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",60) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",61) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",70) UN Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",71) IS Unknown 1-n PrivateTag +(0019,"PHILIPS MR SPECTRO;1",72) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",73) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",74) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",76) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",77) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",78) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",79) US Unknown 1 PrivateTag +(0019,"PHILIPS MR SPECTRO;1",80) IS Unknown 1 PrivateTag + +(0009,"PHILIPS MR",10) LO SPIRelease 1 PrivateTag +(0009,"PHILIPS MR",12) LO Unknown 1 PrivateTag + +(0019,"PHILIPS MR/LAST",09) DS MainMagneticField 1 PrivateTag +(0019,"PHILIPS MR/LAST",0e) IS FlowCompensation 1 PrivateTag +(0019,"PHILIPS MR/LAST",b1) IS MinimumRRInterval 1 PrivateTag +(0019,"PHILIPS MR/LAST",b2) IS MaximumRRInterval 1 PrivateTag +(0019,"PHILIPS MR/LAST",b3) IS NumberOfRejections 1 PrivateTag +(0019,"PHILIPS MR/LAST",b4) IS NumberOfRRIntervals 1-n PrivateTag +(0019,"PHILIPS MR/LAST",b5) IS ArrhythmiaRejection 1 PrivateTag +(0019,"PHILIPS MR/LAST",c0) DS Unknown 1-n PrivateTag +(0019,"PHILIPS MR/LAST",c6) IS CycledMultipleSlice 1 PrivateTag +(0019,"PHILIPS MR/LAST",ce) IS REST 1 PrivateTag +(0019,"PHILIPS MR/LAST",d5) DS Unknown 1 PrivateTag +(0019,"PHILIPS MR/LAST",d6) IS FourierInterpolation 1 PrivateTag +(0019,"PHILIPS MR/LAST",d9) IS Unknown 1-n PrivateTag +(0019,"PHILIPS MR/LAST",e0) IS Prepulse 1 PrivateTag +(0019,"PHILIPS MR/LAST",e1) DS PrepulseDelay 1 PrivateTag +(0019,"PHILIPS MR/LAST",e2) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/LAST",e3) DS Unknown 1 PrivateTag +(0019,"PHILIPS MR/LAST",f0) LT WSProtocolString1 1 PrivateTag +(0019,"PHILIPS MR/LAST",f1) LT WSProtocolString2 1 PrivateTag +(0019,"PHILIPS MR/LAST",f2) LT WSProtocolString3 1 PrivateTag +(0019,"PHILIPS MR/LAST",f3) LT WSProtocolString4 1 PrivateTag +(0021,"PHILIPS MR/LAST",00) IS Unknown 1 PrivateTag +(0021,"PHILIPS MR/LAST",10) IS Unknown 1 PrivateTag +(0021,"PHILIPS MR/LAST",20) IS Unknown 1 PrivateTag +(0021,"PHILIPS MR/LAST",21) DS SliceGap 1 PrivateTag +(0021,"PHILIPS MR/LAST",22) DS StackRadialAngle 1 PrivateTag +(0027,"PHILIPS MR/LAST",00) US Unknown 1 PrivateTag +(0027,"PHILIPS MR/LAST",11) US Unknown 1-n PrivateTag +(0027,"PHILIPS MR/LAST",12) DS Unknown 1-n PrivateTag +(0027,"PHILIPS MR/LAST",13) DS Unknown 1-n PrivateTag +(0027,"PHILIPS MR/LAST",14) DS Unknown 1-n PrivateTag +(0027,"PHILIPS MR/LAST",15) DS Unknown 1-n PrivateTag +(0027,"PHILIPS MR/LAST",16) LO Unknown 1 PrivateTag +(0029,"PHILIPS MR/LAST",10) DS FPMin 1 PrivateTag +(0029,"PHILIPS MR/LAST",20) DS FPMax 1 PrivateTag +(0029,"PHILIPS MR/LAST",30) DS ScaledMinimum 1 PrivateTag +(0029,"PHILIPS MR/LAST",40) DS ScaledMaximum 1 PrivateTag +(0029,"PHILIPS MR/LAST",50) DS WindowMinimum 1 PrivateTag +(0029,"PHILIPS MR/LAST",60) DS WindowMaximum 1 PrivateTag +(0029,"PHILIPS MR/LAST",61) IS Unknown 1 PrivateTag +(0029,"PHILIPS MR/LAST",70) DS Unknown 1 PrivateTag +(0029,"PHILIPS MR/LAST",71) DS Unknown 1 PrivateTag +(0029,"PHILIPS MR/LAST",72) IS Unknown 1 PrivateTag +(0029,"PHILIPS MR/LAST",80) IS ViewCenter 1 PrivateTag +(0029,"PHILIPS MR/LAST",81) IS ViewSize 1 PrivateTag +(0029,"PHILIPS MR/LAST",82) IS ViewZoom 1 PrivateTag +(0029,"PHILIPS MR/LAST",83) IS ViewTransform 1 PrivateTag +(6001,"PHILIPS MR/LAST",00) LT Unknown 1 PrivateTag + +(0019,"PHILIPS MR/PART",1000) DS FieldOfView 1 PrivateTag +(0019,"PHILIPS MR/PART",1005) DS CCAngulation 1 PrivateTag +(0019,"PHILIPS MR/PART",1006) DS APAngulation 1 PrivateTag +(0019,"PHILIPS MR/PART",1007) DS LRAngulation 1 PrivateTag +(0019,"PHILIPS MR/PART",1008) IS PatientPosition 1 PrivateTag +(0019,"PHILIPS MR/PART",1009) IS PatientOrientation 1 PrivateTag +(0019,"PHILIPS MR/PART",100a) IS SliceOrientation 1 PrivateTag +(0019,"PHILIPS MR/PART",100b) DS LROffcenter 1 PrivateTag +(0019,"PHILIPS MR/PART",100c) DS CCOffcenter 1 PrivateTag +(0019,"PHILIPS MR/PART",100d) DS APOffcenter 1 PrivateTag +(0019,"PHILIPS MR/PART",100e) DS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",100f) IS NumberOfSlices 1 PrivateTag +(0019,"PHILIPS MR/PART",1010) DS SliceFactor 1 PrivateTag +(0019,"PHILIPS MR/PART",1011) DS EchoTimes 1-n PrivateTag +(0019,"PHILIPS MR/PART",1015) IS DynamicStudy 1 PrivateTag +(0019,"PHILIPS MR/PART",1018) DS HeartbeatInterval 1 PrivateTag +(0019,"PHILIPS MR/PART",1019) DS RepetitionTimeFFE 1 PrivateTag +(0019,"PHILIPS MR/PART",101a) DS FFEFlipAngle 1 PrivateTag +(0019,"PHILIPS MR/PART",101b) IS NumberOfScans 1 PrivateTag +(0019,"PHILIPS MR/PART",1021) DS Unknown 1-n PrivateTag +(0019,"PHILIPS MR/PART",1022) DS DynamicScanTimeBegin 1 PrivateTag +(0019,"PHILIPS MR/PART",1024) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",1064) DS RepetitionTimeSE 1 PrivateTag +(0019,"PHILIPS MR/PART",1065) DS RepetitionTimeIR 1 PrivateTag +(0019,"PHILIPS MR/PART",1069) IS NumberOfPhases 1 PrivateTag +(0019,"PHILIPS MR/PART",106a) IS CardiacFrequency 1 PrivateTag +(0019,"PHILIPS MR/PART",106b) DS InversionDelay 1 PrivateTag +(0019,"PHILIPS MR/PART",106c) DS GateDelay 1 PrivateTag +(0019,"PHILIPS MR/PART",106d) DS GateWidth 1 PrivateTag +(0019,"PHILIPS MR/PART",106e) DS TriggerDelayTime 1 PrivateTag +(0019,"PHILIPS MR/PART",1080) IS NumberOfChemicalShifts 1 PrivateTag +(0019,"PHILIPS MR/PART",1081) DS ChemicalShift 1 PrivateTag +(0019,"PHILIPS MR/PART",1084) IS NumberOfRows 1 PrivateTag +(0019,"PHILIPS MR/PART",1085) IS NumberOfSamples 1 PrivateTag +(0019,"PHILIPS MR/PART",1094) LO MagnetizationTransferContrast 1 PrivateTag +(0019,"PHILIPS MR/PART",1095) LO SpectralPresaturationWithInversionRecovery 1 PrivateTag +(0019,"PHILIPS MR/PART",1096) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",1097) LO Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10a0) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10a1) DS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10a3) DS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10a4) CS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10c8) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10c9) IS FoldoverDirectionTransverse 1 PrivateTag +(0019,"PHILIPS MR/PART",10ca) IS FoldoverDirectionSagittal 1 PrivateTag +(0019,"PHILIPS MR/PART",10cb) IS FoldoverDirectionCoronal 1 PrivateTag +(0019,"PHILIPS MR/PART",10cc) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10cd) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10ce) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10cf) IS NumberOfEchoes 1 PrivateTag +(0019,"PHILIPS MR/PART",10d0) IS ScanResolution 1 PrivateTag +(0019,"PHILIPS MR/PART",10d2) LO WaterFatShift 2 PrivateTag +(0019,"PHILIPS MR/PART",10d4) IS ArtifactReduction 1 PrivateTag +(0019,"PHILIPS MR/PART",10d5) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10d6) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10d7) DS ScanPercentage 1 PrivateTag +(0019,"PHILIPS MR/PART",10d8) IS Halfscan 1 PrivateTag +(0019,"PHILIPS MR/PART",10d9) IS EPIFactor 1 PrivateTag +(0019,"PHILIPS MR/PART",10da) IS TurboFactor 1 PrivateTag +(0019,"PHILIPS MR/PART",10db) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",10e0) IS PercentageOfScanCompleted 1 PrivateTag +(0019,"PHILIPS MR/PART",10e1) IS Unknown 1 PrivateTag +(0019,"PHILIPS MR/PART",1100) IS NumberOfStacks 1 PrivateTag +(0019,"PHILIPS MR/PART",1101) IS StackType 1-n PrivateTag +(0019,"PHILIPS MR/PART",1102) IS Unknown 1-n PrivateTag +(0019,"PHILIPS MR/PART",110b) DS LROffcenter 1 PrivateTag +(0019,"PHILIPS MR/PART",110c) DS CCOffcenter 1 PrivateTag +(0019,"PHILIPS MR/PART",110d) DS APOffcenter 1 PrivateTag +(0019,"PHILIPS MR/PART",1145) IS ReconstructionResolution 1 PrivateTag +(0019,"PHILIPS MR/PART",11fc) IS ResonanceFrequency 1 PrivateTag +(0019,"PHILIPS MR/PART",12c0) DS TriggerDelayTimes 1 PrivateTag +(0019,"PHILIPS MR/PART",12e0) IS PrepulseType 1 PrivateTag +(0019,"PHILIPS MR/PART",12e1) DS PrepulseDelay 1 PrivateTag +(0019,"PHILIPS MR/PART",12e3) DS PhaseContrastVelocity 1 PrivateTag +(0021,"PHILIPS MR/PART",1000) IS ReconstructionNumber 1 PrivateTag +(0021,"PHILIPS MR/PART",1010) IS ImageType 1 PrivateTag +(0021,"PHILIPS MR/PART",1020) IS SliceNumber 1 PrivateTag +(0021,"PHILIPS MR/PART",1030) IS EchoNumber 1 PrivateTag +(0021,"PHILIPS MR/PART",1031) DS PatientReferenceID 1 PrivateTag +(0021,"PHILIPS MR/PART",1035) IS ChemicalShiftNumber 1 PrivateTag +(0021,"PHILIPS MR/PART",1040) IS PhaseNumber 1 PrivateTag +(0021,"PHILIPS MR/PART",1050) IS DynamicScanNumber 1 PrivateTag +(0021,"PHILIPS MR/PART",1060) IS NumberOfRowsInObject 1 PrivateTag +(0021,"PHILIPS MR/PART",1061) IS RowNumber 1-n PrivateTag +(0021,"PHILIPS MR/PART",1062) IS Unknown 1-n PrivateTag +(0021,"PHILIPS MR/PART",1100) DA ScanDate 1 PrivateTag +(0021,"PHILIPS MR/PART",1110) TM ScanTime 1 PrivateTag +(0021,"PHILIPS MR/PART",1221) IS SliceGap 1 PrivateTag +(0029,"PHILIPS MR/PART",00) DS Unknown 2 PrivateTag +(0029,"PHILIPS MR/PART",04) US Unknown 1 PrivateTag +(0029,"PHILIPS MR/PART",10) DS Unknown 1 PrivateTag +(0029,"PHILIPS MR/PART",11) DS Unknown 1 PrivateTag +(0029,"PHILIPS MR/PART",20) LO Unknown 1 PrivateTag +(0029,"PHILIPS MR/PART",31) DS Unknown 2 PrivateTag +(0029,"PHILIPS MR/PART",32) DS Unknown 2 PrivateTag +(0029,"PHILIPS MR/PART",c3) IS ScanResolution 1 PrivateTag +(0029,"PHILIPS MR/PART",c4) IS FieldOfView 1 PrivateTag +(0029,"PHILIPS MR/PART",d5) LT SliceThickness 1 PrivateTag + +(0019,"PHILIPS-MR-1",11) IS ChemicalShiftNumber 1 PrivateTag +(0019,"PHILIPS-MR-1",12) IS PhaseNumber 1 PrivateTag +(0021,"PHILIPS-MR-1",01) IS ReconstructionNumber 1 PrivateTag +(0021,"PHILIPS-MR-1",02) IS SliceNumber 1 PrivateTag + +(7001,"Picker NM Private Group",01) UI Unknown 1 PrivateTag +(7001,"Picker NM Private Group",02) OB Unknown 1 PrivateTag + +(0019,"SIEMENS CM VA0 ACQU",10) LT ParameterFileName 1 PrivateTag +(0019,"SIEMENS CM VA0 ACQU",11) LO SequenceFileName 1 PrivateTag +(0019,"SIEMENS CM VA0 ACQU",12) LT SequenceFileOwner 1 PrivateTag +(0019,"SIEMENS CM VA0 ACQU",13) LT SequenceDescription 1 PrivateTag +(0019,"SIEMENS CM VA0 ACQU",14) LT EPIFileName 1 PrivateTag + +(0009,"SIEMENS CM VA0 CMS",00) DS NumberOfMeasurements 1 PrivateTag +(0009,"SIEMENS CM VA0 CMS",10) LT StorageMode 1 PrivateTag +(0009,"SIEMENS CM VA0 CMS",12) UL EvaluationMaskImage 1 PrivateTag +(0009,"SIEMENS CM VA0 CMS",26) DA LastMoveDate 1 PrivateTag +(0009,"SIEMENS CM VA0 CMS",27) TM LastMoveTime 1 PrivateTag +(0011,"SIEMENS CM VA0 CMS",0a) LT Unknown 1 PrivateTag +(0011,"SIEMENS CM VA0 CMS",10) DA RegistrationDate 1 PrivateTag +(0011,"SIEMENS CM VA0 CMS",11) TM RegistrationTime 1 PrivateTag +(0011,"SIEMENS CM VA0 CMS",22) LT Unknown 1 PrivateTag +(0011,"SIEMENS CM VA0 CMS",23) DS UsedPatientWeight 1 PrivateTag +(0011,"SIEMENS CM VA0 CMS",40) IS OrganCode 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",00) LT ModifyingPhysician 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",10) DA ModificationDate 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",12) TM ModificationTime 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",20) LO PatientName 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",22) LO PatientId 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",30) DA PatientBirthdate 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",31) DS PatientWeight 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",32) LT PatientsMaidenName 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",33) LT ReferringPhysician 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",34) LT AdmittingDiagnosis 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",35) LO PatientSex 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",40) LO ProcedureDescription 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",42) LO RestDirection 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",44) LO PatientPosition 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",46) LT ViewDirection 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",50) LT Unknown 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",51) LT Unknown 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",52) LT Unknown 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",53) LT Unknown 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",54) LT Unknown 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",55) LT Unknown 1 PrivateTag +(0013,"SIEMENS CM VA0 CMS",56) LT Unknown 1 PrivateTag +(0019,"SIEMENS CM VA0 CMS",10) DS NetFrequency 1 PrivateTag +(0019,"SIEMENS CM VA0 CMS",20) LT MeasurementMode 1 PrivateTag +(0019,"SIEMENS CM VA0 CMS",30) LT CalculationMode 1 PrivateTag +(0019,"SIEMENS CM VA0 CMS",50) IS NoiseLevel 1 PrivateTag +(0019,"SIEMENS CM VA0 CMS",60) IS NumberOfDataBytes 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",20) DS FoV 2 PrivateTag +(0021,"SIEMENS CM VA0 CMS",22) DS ImageMagnificationFactor 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",24) DS ImageScrollOffset 2 PrivateTag +(0021,"SIEMENS CM VA0 CMS",26) IS ImagePixelOffset 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",30) LT ViewDirection 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",32) CS PatientRestDirection 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",60) DS ImagePosition 3 PrivateTag +(0021,"SIEMENS CM VA0 CMS",61) DS ImageNormal 3 PrivateTag +(0021,"SIEMENS CM VA0 CMS",63) DS ImageDistance 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",65) US ImagePositioningHistoryMask 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",6a) DS ImageRow 3 PrivateTag +(0021,"SIEMENS CM VA0 CMS",6b) DS ImageColumn 3 PrivateTag +(0021,"SIEMENS CM VA0 CMS",70) LT PatientOrientationSet1 3 PrivateTag +(0021,"SIEMENS CM VA0 CMS",71) LT PatientOrientationSet2 3 PrivateTag +(0021,"SIEMENS CM VA0 CMS",80) LT StudyName 1 PrivateTag +(0021,"SIEMENS CM VA0 CMS",82) LT StudyType 3 PrivateTag +(0029,"SIEMENS CM VA0 CMS",10) LT WindowStyle 1 PrivateTag +(0029,"SIEMENS CM VA0 CMS",11) LT Unknown 1 PrivateTag +(0029,"SIEMENS CM VA0 CMS",13) LT Unknown 1 PrivateTag +(0029,"SIEMENS CM VA0 CMS",20) LT PixelQualityCode 3 PrivateTag +(0029,"SIEMENS CM VA0 CMS",22) IS PixelQualityValue 3 PrivateTag +(0029,"SIEMENS CM VA0 CMS",50) LT ArchiveCode 1 PrivateTag +(0029,"SIEMENS CM VA0 CMS",51) LT ExposureCode 1 PrivateTag +(0029,"SIEMENS CM VA0 CMS",52) LT SortCode 1 PrivateTag +(0029,"SIEMENS CM VA0 CMS",53) LT Unknown 1 PrivateTag +(0029,"SIEMENS CM VA0 CMS",60) LT Splash 1 PrivateTag +(0051,"SIEMENS CM VA0 CMS",10) LT ImageText 1-n PrivateTag +(6021,"SIEMENS CM VA0 CMS",00) LT ImageGraphicsFormatCode 1 PrivateTag +(6021,"SIEMENS CM VA0 CMS",10) LT ImageGraphics 1 PrivateTag +(7fe1,"SIEMENS CM VA0 CMS",00) OB BinaryData 1-n PrivateTag + +(0009,"SIEMENS CM VA0 LAB",10) LT GeneratorIdentificationLabel 1 PrivateTag +(0009,"SIEMENS CM VA0 LAB",11) LT GantryIdentificationLabel 1 PrivateTag +(0009,"SIEMENS CM VA0 LAB",12) LT X-RayTubeIdentificationLabel 1 PrivateTag +(0009,"SIEMENS CM VA0 LAB",13) LT DetectorIdentificationLabel 1 PrivateTag +(0009,"SIEMENS CM VA0 LAB",14) LT DASIdentificationLabel 1 PrivateTag +(0009,"SIEMENS CM VA0 LAB",15) LT SMIIdentificationLabel 1 PrivateTag +(0009,"SIEMENS CM VA0 LAB",16) LT CPUIdentificationLabel 1 PrivateTag +(0009,"SIEMENS CM VA0 LAB",20) LT HeaderVersion 1 PrivateTag + +(0029,"SIEMENS CSA HEADER",08) CS CSAImageHeaderType 1 PrivateTag +(0029,"SIEMENS CSA HEADER",09) LO CSAImageHeaderVersion 1 PrivateTag +(0029,"SIEMENS CSA HEADER",10) OB CSAImageHeaderInfo 1 PrivateTag +(0029,"SIEMENS CSA HEADER",18) CS CSASeriesHeaderType 1 PrivateTag +(0029,"SIEMENS CSA HEADER",19) LO CSASeriesHeaderVersion 1 PrivateTag +(0029,"SIEMENS CSA HEADER",20) OB CSASeriesHeaderInfo 1 PrivateTag + +(0029,"SIEMENS CSA NON-IMAGE",08) CS CSADataType 1 PrivateTag +(0029,"SIEMENS CSA NON-IMAGE",09) LO CSADataVersion 1 PrivateTag +(0029,"SIEMENS CSA NON-IMAGE",10) OB CSADataInfo 1 PrivateTag +(7FE1,"SIEMENS CSA NON-IMAGE",10) OB CSAData 1 PrivateTag + +(0019,"SIEMENS CT VA0 COAD",10) DS DistanceSourceToSourceSideCollimator 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",11) DS DistanceSourceToDetectorSideCollimator 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",20) IS NumberOfPossibleChannels 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",21) IS MeanChannelNumber 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",22) DS DetectorSpacing 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",23) DS DetectorCenter 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",24) DS ReadingIntegrationTime 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",50) DS DetectorAlignment 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",52) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",54) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",60) DS FocusAlignment 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",65) UL FocalSpotDeflectionAmplitude 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",66) UL FocalSpotDeflectionPhase 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",67) UL FocalSpotDeflectionOffset 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",70) DS WaterScalingFactor 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",71) DS InterpolationFactor 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",80) LT PatientRegion 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",82) LT PatientPhaseOfLife 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",90) DS OsteoOffset 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",92) DS OsteoRegressionLineSlope 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",93) DS OsteoRegressionLineIntercept 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",94) DS OsteoStandardizationCode 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",96) IS OsteoPhantomNumber 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",A3) US Unknown 1-n PrivateTag +(0019,"SIEMENS CT VA0 COAD",A4) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",A5) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",A6) US Unknown 1-n PrivateTag +(0019,"SIEMENS CT VA0 COAD",A7) US Unknown 1-n PrivateTag +(0019,"SIEMENS CT VA0 COAD",A8) US Unknown 1-n PrivateTag +(0019,"SIEMENS CT VA0 COAD",A9) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",AA) LT Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",AB) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",AC) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",AD) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",AE) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",AF) DS Unknown 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",B0) DS FeedPerRotation 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",BD) IS PulmoTriggerLevel 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",BE) DS ExpiratoricReserveVolume 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",BF) DS VitalCapacity 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",C0) DS PulmoWater 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",C1) DS PulmoAir 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",C2) DA PulmoDate 1 PrivateTag +(0019,"SIEMENS CT VA0 COAD",C3) TM PulmoTime 1 PrivateTag + +(0019,"SIEMENS CT VA0 GEN",10) DS SourceSideCollimatorAperture 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",11) DS DetectorSideCollimatorAperture 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",20) DS ExposureTime 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",21) DS ExposureCurrent 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",25) DS KVPGeneratorPowerCurrent 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",26) DS GeneratorVoltage 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",40) UL MasterControlMask 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",42) US ProcessingMask 5 PrivateTag +(0019,"SIEMENS CT VA0 GEN",44) US Unknown 1-n PrivateTag +(0019,"SIEMENS CT VA0 GEN",45) US Unknown 1-n PrivateTag +(0019,"SIEMENS CT VA0 GEN",62) IS NumberOfVirtuellChannels 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",70) IS NumberOfReadings 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",71) LT Unknown 1-n PrivateTag +(0019,"SIEMENS CT VA0 GEN",74) IS NumberOfProjections 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",75) IS NumberOfBytes 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",80) LT ReconstructionAlgorithmSet 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",81) LT ReconstructionAlgorithmIndex 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",82) LT RegenerationSoftwareVersion 1 PrivateTag +(0019,"SIEMENS CT VA0 GEN",88) DS Unknown 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",10) IS RotationAngle 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",11) IS StartAngle 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",20) US Unknown 1-n PrivateTag +(0021,"SIEMENS CT VA0 GEN",30) IS TopogramTubePosition 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",32) DS LengthOfTopogram 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",34) DS TopogramCorrectionFactor 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",36) DS MaximumTablePosition 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",40) IS TableMoveDirectionCode 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",45) IS VOIStartRow 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",46) IS VOIStopRow 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",47) IS VOIStartColumn 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",48) IS VOIStopColumn 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",49) IS VOIStartSlice 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",4a) IS VOIStopSlice 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",50) IS VectorStartRow 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",51) IS VectorRowStep 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",52) IS VectorStartColumn 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",53) IS VectorColumnStep 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",60) IS RangeTypeCode 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",62) IS ReferenceTypeCode 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",70) DS ObjectOrientation 3 PrivateTag +(0021,"SIEMENS CT VA0 GEN",72) DS LightOrientation 3 PrivateTag +(0021,"SIEMENS CT VA0 GEN",75) DS LightBrightness 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",76) DS LightContrast 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",7a) IS OverlayThreshold 2 PrivateTag +(0021,"SIEMENS CT VA0 GEN",7b) IS SurfaceThreshold 2 PrivateTag +(0021,"SIEMENS CT VA0 GEN",7c) IS GreyScaleThreshold 2 PrivateTag +(0021,"SIEMENS CT VA0 GEN",a0) DS Unknown 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",a2) LT Unknown 1 PrivateTag +(0021,"SIEMENS CT VA0 GEN",a7) LT Unknown 1 PrivateTag + +(0009,"SIEMENS CT VA0 IDE",10) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",30) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",31) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",32) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",34) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",40) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",42) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",50) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 IDE",51) LT Unknown 1 PrivateTag + +(0009,"SIEMENS CT VA0 ORI",20) LT Unknown 1 PrivateTag +(0009,"SIEMENS CT VA0 ORI",30) LT Unknown 1 PrivateTag + +(6021,"SIEMENS CT VA0 OST",00) LT OsteoContourComment 1 PrivateTag +(6021,"SIEMENS CT VA0 OST",10) US OsteoContourBuffer 256 PrivateTag + +(0021,"SIEMENS CT VA0 RAW",10) UL CreationMask 2 PrivateTag +(0021,"SIEMENS CT VA0 RAW",20) UL EvaluationMask 2 PrivateTag +(0021,"SIEMENS CT VA0 RAW",30) US ExtendedProcessingMask 7 PrivateTag +(0021,"SIEMENS CT VA0 RAW",40) US Unknown 1-n PrivateTag +(0021,"SIEMENS CT VA0 RAW",41) US Unknown 1-n PrivateTag +(0021,"SIEMENS CT VA0 RAW",42) US Unknown 1-n PrivateTag +(0021,"SIEMENS CT VA0 RAW",43) US Unknown 1-n PrivateTag +(0021,"SIEMENS CT VA0 RAW",44) US Unknown 1-n PrivateTag +(0021,"SIEMENS CT VA0 RAW",50) LT Unknown 1 PrivateTag + +(0009,"SIEMENS DICOM",10) UN Unknown 1 PrivateTag +(0009,"SIEMENS DICOM",12) LT Unknown 1 PrivateTag + +(0019,"SIEMENS DLR.01",10) LT MeasurementMode 1 PrivateTag +(0019,"SIEMENS DLR.01",11) LT ImageType 1 PrivateTag +(0019,"SIEMENS DLR.01",15) LT SoftwareVersion 1 PrivateTag +(0019,"SIEMENS DLR.01",20) LT MPMCode 1 PrivateTag +(0019,"SIEMENS DLR.01",21) LT Latitude 1 PrivateTag +(0019,"SIEMENS DLR.01",22) LT Sensitivity 1 PrivateTag +(0019,"SIEMENS DLR.01",23) LT EDR 1 PrivateTag +(0019,"SIEMENS DLR.01",24) LT LFix 1 PrivateTag +(0019,"SIEMENS DLR.01",25) LT SFix 1 PrivateTag +(0019,"SIEMENS DLR.01",26) LT PresetMode 1 PrivateTag +(0019,"SIEMENS DLR.01",27) LT Region 1 PrivateTag +(0019,"SIEMENS DLR.01",28) LT Subregion 1 PrivateTag +(0019,"SIEMENS DLR.01",30) LT Orientation 1 PrivateTag +(0019,"SIEMENS DLR.01",31) LT MarkOnFilm 1 PrivateTag +(0019,"SIEMENS DLR.01",32) LT RotationOnDRC 1 PrivateTag +(0019,"SIEMENS DLR.01",40) LT ReaderType 1 PrivateTag +(0019,"SIEMENS DLR.01",41) LT SubModality 1 PrivateTag +(0019,"SIEMENS DLR.01",42) LT ReaderSerialNumber 1 PrivateTag +(0019,"SIEMENS DLR.01",50) LT CassetteScale 1 PrivateTag +(0019,"SIEMENS DLR.01",51) LT CassetteMatrix 1 PrivateTag +(0019,"SIEMENS DLR.01",52) LT CassetteSubmatrix 1 PrivateTag +(0019,"SIEMENS DLR.01",53) LT Barcode 1 PrivateTag +(0019,"SIEMENS DLR.01",60) LT ContrastType 1 PrivateTag +(0019,"SIEMENS DLR.01",61) LT RotationAmount 1 PrivateTag +(0019,"SIEMENS DLR.01",62) LT RotationCenter 1 PrivateTag +(0019,"SIEMENS DLR.01",63) LT DensityShift 1 PrivateTag +(0019,"SIEMENS DLR.01",64) US FrequencyRank 1 PrivateTag +(0019,"SIEMENS DLR.01",65) LT FrequencyEnhancement 1 PrivateTag +(0019,"SIEMENS DLR.01",66) LT FrequencyType 1 PrivateTag +(0019,"SIEMENS DLR.01",67) LT KernelLength 1 PrivateTag +(0019,"SIEMENS DLR.01",68) UL KernelMode 1 PrivateTag +(0019,"SIEMENS DLR.01",69) UL ConvolutionMode 1 PrivateTag +(0019,"SIEMENS DLR.01",70) LT PLASource 1 PrivateTag +(0019,"SIEMENS DLR.01",71) LT PLADestination 1 PrivateTag +(0019,"SIEMENS DLR.01",75) LT UIDOriginalImage 1 PrivateTag +(0019,"SIEMENS DLR.01",76) LT Unknown 1 PrivateTag +(0019,"SIEMENS DLR.01",80) LT ReaderHeader 1 PrivateTag +(0019,"SIEMENS DLR.01",90) LT PLAOfSecondaryDestination 1 PrivateTag +(0019,"SIEMENS DLR.01",a0) DS Unknown 1 PrivateTag +(0019,"SIEMENS DLR.01",a1) DS Unknown 1 PrivateTag +(0041,"SIEMENS DLR.01",10) US NumberOfHardcopies 1 PrivateTag +(0041,"SIEMENS DLR.01",20) LT FilmFormat 1 PrivateTag +(0041,"SIEMENS DLR.01",30) LT FilmSize 1 PrivateTag +(0041,"SIEMENS DLR.01",31) LT FullFilmFormat 1 PrivateTag + +(0003,"SIEMENS ISI",08) US ISICommandField 1 PrivateTag +(0003,"SIEMENS ISI",11) US AttachIDApplicationCode 1 PrivateTag +(0003,"SIEMENS ISI",12) UL AttachIDMessageCount 1 PrivateTag +(0003,"SIEMENS ISI",13) DA AttachIDDate 1 PrivateTag +(0003,"SIEMENS ISI",14) TM AttachIDTime 1 PrivateTag +(0003,"SIEMENS ISI",20) US MessageType 1 PrivateTag +(0003,"SIEMENS ISI",30) DA MaxWaitingDate 1 PrivateTag +(0003,"SIEMENS ISI",31) TM MaxWaitingTime 1 PrivateTag +(0009,"SIEMENS ISI",01) UN RISPatientInfoIMGEF 1 PrivateTag +(0011,"SIEMENS ISI",03) LT PatientUID 1 PrivateTag +(0011,"SIEMENS ISI",04) LT PatientID 1 PrivateTag +(0011,"SIEMENS ISI",0a) LT CaseID 1 PrivateTag +(0011,"SIEMENS ISI",22) LT RequestID 1 PrivateTag +(0011,"SIEMENS ISI",23) LT ExaminationUID 1 PrivateTag +(0011,"SIEMENS ISI",a1) DA PatientRegistrationDate 1 PrivateTag +(0011,"SIEMENS ISI",a2) TM PatientRegistrationTime 1 PrivateTag +(0011,"SIEMENS ISI",b0) LT PatientLastName 1 PrivateTag +(0011,"SIEMENS ISI",b2) LT PatientFirstName 1 PrivateTag +(0011,"SIEMENS ISI",b4) LT PatientHospitalStatus 1 PrivateTag +(0011,"SIEMENS ISI",bc) TM CurrentLocationTime 1 PrivateTag +(0011,"SIEMENS ISI",c0) LT PatientInsuranceStatus 1 PrivateTag +(0011,"SIEMENS ISI",d0) LT PatientBillingType 1 PrivateTag +(0011,"SIEMENS ISI",d2) LT PatientBillingAddress 1 PrivateTag +(0031,"SIEMENS ISI",12) LT ExaminationReason 1 PrivateTag +(0031,"SIEMENS ISI",30) DA RequestedDate 1 PrivateTag +(0031,"SIEMENS ISI",32) TM WorklistRequestStartTime 1 PrivateTag +(0031,"SIEMENS ISI",33) TM WorklistRequestEndTime 1 PrivateTag +(0031,"SIEMENS ISI",4a) TM RequestedTime 1 PrivateTag +(0031,"SIEMENS ISI",80) LT RequestedLocation 1 PrivateTag +(0055,"SIEMENS ISI",46) LT CurrentWard 1 PrivateTag +(0193,"SIEMENS ISI",02) DS RISKey 1 PrivateTag +(0307,"SIEMENS ISI",01) UN RISWorklistIMGEF 1 PrivateTag +(0309,"SIEMENS ISI",01) UN RISReportIMGEF 1 PrivateTag +(4009,"SIEMENS ISI",01) LT ReportID 1 PrivateTag +(4009,"SIEMENS ISI",20) LT ReportStatus 1 PrivateTag +(4009,"SIEMENS ISI",30) DA ReportCreationDate 1 PrivateTag +(4009,"SIEMENS ISI",70) LT ReportApprovingPhysician 1 PrivateTag +(4009,"SIEMENS ISI",e0) LT ReportText 1 PrivateTag +(4009,"SIEMENS ISI",e1) LT ReportAuthor 1 PrivateTag +(4009,"SIEMENS ISI",e3) LT ReportingRadiologist 1 PrivateTag + +(0029,"SIEMENS MED DISPLAY",04) LT PhotometricInterpretation 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",10) US RowsOfSubmatrix 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",11) US ColumnsOfSubmatrix 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",20) US Unknown 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",21) US Unknown 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",50) US OriginOfSubmatrix 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",99) LT ShutterType 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",a0) US RowsOfRectangularShutter 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",a1) US ColumnsOfRectangularShutter 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",a2) US OriginOfRectangularShutter 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",b0) US RadiusOfCircularShutter 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",b2) US OriginOfCircularShutter 1 PrivateTag +(0029,"SIEMENS MED DISPLAY",c1) US ContourOfIrregularShutter 1 PrivateTag + +(0029,"SIEMENS MED HG",10) US ListOfGroupNumbers 1 PrivateTag +(0029,"SIEMENS MED HG",15) LT ListOfShadowOwnerCodes 1 PrivateTag +(0029,"SIEMENS MED HG",20) US ListOfElementNumbers 1 PrivateTag +(0029,"SIEMENS MED HG",30) US ListOfTotalDisplayLength 1 PrivateTag +(0029,"SIEMENS MED HG",40) LT ListOfDisplayPrefix 1 PrivateTag +(0029,"SIEMENS MED HG",50) LT ListOfDisplayPostfix 1 PrivateTag +(0029,"SIEMENS MED HG",60) US ListOfTextPosition 1 PrivateTag +(0029,"SIEMENS MED HG",70) LT ListOfTextConcatenation 1 PrivateTag +(0029,"SIEMENS MED MG",10) US ListOfGroupNumbers 1 PrivateTag +(0029,"SIEMENS MED MG",15) LT ListOfShadowOwnerCodes 1 PrivateTag +(0029,"SIEMENS MED MG",20) US ListOfElementNumbers 1 PrivateTag +(0029,"SIEMENS MED MG",30) US ListOfTotalDisplayLength 1 PrivateTag +(0029,"SIEMENS MED MG",40) LT ListOfDisplayPrefix 1 PrivateTag +(0029,"SIEMENS MED MG",50) LT ListOfDisplayPostfix 1 PrivateTag +(0029,"SIEMENS MED MG",60) US ListOfTextPosition 1 PrivateTag +(0029,"SIEMENS MED MG",70) LT ListOfTextConcatenation 1 PrivateTag + +(0009,"SIEMENS MED",10) LO RecognitionCode 1 PrivateTag +(0009,"SIEMENS MED",30) UL ByteOffsetOfOriginalHeader 1 PrivateTag +(0009,"SIEMENS MED",31) UL LengthOfOriginalHeader 1 PrivateTag +(0009,"SIEMENS MED",40) UL ByteOffsetOfPixelmatrix 1 PrivateTag +(0009,"SIEMENS MED",41) UL LengthOfPixelmatrixInBytes 1 PrivateTag +(0009,"SIEMENS MED",50) LT Unknown 1 PrivateTag +(0009,"SIEMENS MED",51) LT Unknown 1 PrivateTag +(0009,"SIEMENS MED",f5) LT PDMEFIDPlaceholder 1 PrivateTag +(0009,"SIEMENS MED",f6) LT PDMDataObjectTypeExtension 1 PrivateTag +(0021,"SIEMENS MED",10) DS Zoom 1 PrivateTag +(0021,"SIEMENS MED",11) DS Target 2 PrivateTag +(0021,"SIEMENS MED",12) IS TubeAngle 1 PrivateTag +(0021,"SIEMENS MED",20) US ROIMask 1 PrivateTag +(7001,"SIEMENS MED",10) LT Dummy 1 PrivateTag +(7003,"SIEMENS MED",10) LT Header 1 PrivateTag +(7005,"SIEMENS MED",10) LT Dummy 1 PrivateTag + +(0029,"SIEMENS MEDCOM HEADER",08) CS MedComHeaderType 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",09) LO MedComHeaderVersion 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",10) OB MedComHeaderInfo 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",20) OB MedComHistoryInformation 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",31) LO PMTFInformation1 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",32) UL PMTFInformation2 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",33) UL PMTFInformation3 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",34) CS PMTFInformation4 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",35) UL PMTFInformation5 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",40) SQ ApplicationHeaderSequence 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",41) CS ApplicationHeaderType 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",42) LO ApplicationHeaderID 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",43) LO ApplicationHeaderVersion 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",44) OB ApplicationHeaderInfo 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",50) LO WorkflowControlFlags 8 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",51) CS ArchiveManagementFlagKeepOnline 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",52) CS ArchiveManagementFlagDoNotArchive 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",53) CS ImageLocationStatus 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",54) DS EstimatedRetrieveTime 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",55) DS DataSizeOfRetrievedImages 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",70) SQ SiemensLinkSequence 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",71) AT ReferencedTag 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",72) CS ReferencedTagType 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",73) UL ReferencedValueLength 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",74) CS ReferencedObjectDeviceType 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",75) OB ReferencedObjectDeviceLocation 1 PrivateTag +(0029,"SIEMENS MEDCOM HEADER",76) OB ReferencedObjectDeviceID 1 PrivateTag + +(0029,"SIEMENS MEDCOM HEADER2",60) LO SeriesWorkflowStatus 1 PrivateTag + +(0029,"SIEMENS MEDCOM OOG",08) CS MEDCOMOOGType 1 PrivateTag +(0029,"SIEMENS MEDCOM OOG",09) LO MEDCOMOOGVersion 1 PrivateTag +(0029,"SIEMENS MEDCOM OOG",10) OB MEDCOMOOGInfo 1 PrivateTag + +(0019,"SIEMENS MR VA0 COAD",12) DS MagneticFieldStrength 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",14) DS ADCVoltage 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",16) DS ADCOffset 2 PrivateTag +(0019,"SIEMENS MR VA0 COAD",20) DS TransmitterAmplitude 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",21) IS NumberOfTransmitterAmplitudes 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",22) DS TransmitterAttenuator 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",24) DS TransmitterCalibration 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",26) DS TransmitterReference 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",50) DS ReceiverTotalGain 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",51) DS ReceiverAmplifierGain 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",52) DS ReceiverPreamplifierGain 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",54) DS ReceiverCableAttenuation 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",55) DS ReceiverReferenceGain 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",56) DS ReceiverFilterFrequency 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",60) DS ReconstructionScaleFactor 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",62) DS ReferenceScaleFactor 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",70) DS PhaseGradientAmplitude 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",71) DS ReadoutGradientAmplitude 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",72) DS SelectionGradientAmplitude 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",80) DS GradientDelayTime 3 PrivateTag +(0019,"SIEMENS MR VA0 COAD",82) DS TotalGradientDelayTime 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",90) LT SensitivityCorrectionLabel 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",91) DS SaturationPhaseEncodingVectorCoronalComponent 6 PrivateTag +(0019,"SIEMENS MR VA0 COAD",92) DS SaturationReadoutVectorCoronalComponent 6 PrivateTag +(0019,"SIEMENS MR VA0 COAD",a0) US RFWatchdogMask 3 PrivateTag +(0019,"SIEMENS MR VA0 COAD",a1) DS EPIReconstructionSlope 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",a2) DS RFPowerErrorIndicator 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",a5) DS SpecificAbsorptionRateWholeBody 3 PrivateTag +(0019,"SIEMENS MR VA0 COAD",a6) DS SpecificEnergyDose 3 PrivateTag +(0019,"SIEMENS MR VA0 COAD",b0) UL AdjustmentStatusMask 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",c1) DS EPICapacity 6 PrivateTag +(0019,"SIEMENS MR VA0 COAD",c2) DS EPIInductance 3 PrivateTag +(0019,"SIEMENS MR VA0 COAD",c3) IS EPISwitchConfigurationCode 1-n PrivateTag +(0019,"SIEMENS MR VA0 COAD",c4) IS EPISwitchHardwareCode 1-n PrivateTag +(0019,"SIEMENS MR VA0 COAD",c5) DS EPISwitchDelayTime 1-n PrivateTag +(0019,"SIEMENS MR VA0 COAD",d1) DS FlowSensitivity 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d2) LT CalculationSubmode 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d3) DS FieldOfViewRatio 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d4) IS BaseRawMatrixSize 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d5) IS 2DOversamplingLines 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d6) IS 3DPhaseOversamplingPartitions 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d7) IS EchoLinePosition 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d8) IS EchoColumnPosition 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",d9) IS LinesPerSegment 1 PrivateTag +(0019,"SIEMENS MR VA0 COAD",da) LT PhaseCodingDirection 1 PrivateTag + +(0019,"SIEMENS MR VA0 GEN",10) DS TotalMeasurementTimeNominal 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",11) DS TotalMeasurementTimeCurrent 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",12) DS StartDelayTime 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",13) DS DwellTime 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",14) IS NumberOfPhases 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",16) UL SequenceControlMask 2 PrivateTag +(0019,"SIEMENS MR VA0 GEN",18) UL MeasurementStatusMask 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",20) IS NumberOfFourierLinesNominal 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",21) IS NumberOfFourierLinesCurrent 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",26) IS NumberOfFourierLinesAfterZero 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",28) IS FirstMeasuredFourierLine 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",30) IS AcquisitionColumns 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",31) IS ReconstructionColumns 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",40) IS ArrayCoilElementNumber 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",41) UL ArrayCoilElementSelectMask 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",42) UL ArrayCoilElementDataMask 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",43) IS ArrayCoilElementToADCConnect 1-n PrivateTag +(0019,"SIEMENS MR VA0 GEN",44) DS ArrayCoilElementNoiseLevel 1-n PrivateTag +(0019,"SIEMENS MR VA0 GEN",45) IS ArrayCoilADCPairNumber 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",46) UL ArrayCoilCombinationMask 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",50) IS NumberOfAverages 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",60) DS FlipAngle 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",70) IS NumberOfPrescans 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",81) LT FilterTypeForRawData 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",82) DS FilterParameterForRawData 1-n PrivateTag +(0019,"SIEMENS MR VA0 GEN",83) LT FilterTypeForImageData 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",84) DS FilterParameterForImageData 1-n PrivateTag +(0019,"SIEMENS MR VA0 GEN",85) LT FilterTypeForPhaseCorrection 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",86) DS FilterParameterForPhaseCorrection 1-n PrivateTag +(0019,"SIEMENS MR VA0 GEN",87) LT NormalizationFilterTypeForImageData 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",88) DS NormalizationFilterParameterForImageData 1-n PrivateTag +(0019,"SIEMENS MR VA0 GEN",90) IS NumberOfSaturationRegions 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",91) DS SaturationPhaseEncodingVectorSagittalComponent 6 PrivateTag +(0019,"SIEMENS MR VA0 GEN",92) DS SaturationReadoutVectorSagittalComponent 6 PrivateTag +(0019,"SIEMENS MR VA0 GEN",93) DS EPIStimulationMonitorMode 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",94) DS ImageRotationAngle 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",96) UL CoilIDMask 3 PrivateTag +(0019,"SIEMENS MR VA0 GEN",97) UL CoilClassMask 2 PrivateTag +(0019,"SIEMENS MR VA0 GEN",98) DS CoilPosition 3 PrivateTag +(0019,"SIEMENS MR VA0 GEN",a0) DS EPIReconstructionPhase 1 PrivateTag +(0019,"SIEMENS MR VA0 GEN",a1) DS EPIReconstructionSlope 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",20) IS PhaseCorrectionRowsSequence 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",21) IS PhaseCorrectionColumnsSequence 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",22) IS PhaseCorrectionRowsReconstruction 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",24) IS PhaseCorrectionColumnsReconstruction 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",30) IS NumberOf3DRawPartitionsNominal 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",31) IS NumberOf3DRawPartitionsCurrent 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",34) IS NumberOf3DImagePartitions 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",36) IS Actual3DImagePartitionNumber 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",39) DS SlabThickness 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",40) IS NumberOfSlicesNominal 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",41) IS NumberOfSlicesCurrent 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",42) IS CurrentSliceNumber 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",43) IS CurrentGroupNumber 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",44) DS CurrentSliceDistanceFactor 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",45) IS MIPStartRow 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",46) IS MIPStopRow 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",47) IS MIPStartColumn 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",48) IS MIPStartColumn 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",49) IS MIPStartSlice Name= 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",4a) IS MIPStartSlice 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",4f) LT OrderofSlices 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",50) US SignalMask 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",52) DS DelayAfterTrigger 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",53) IS RRInterval 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",54) DS NumberOfTriggerPulses 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",56) DS RepetitionTimeEffective 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",57) LT GatePhase 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",58) DS GateThreshold 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",59) DS GatedRatio 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",60) IS NumberOfInterpolatedImages 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",70) IS NumberOfEchoes 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",72) DS SecondEchoTime 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",73) DS SecondRepetitionTime 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",80) IS CardiacCode 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",91) DS SaturationPhaseEncodingVectorTransverseComponent 6 PrivateTag +(0021,"SIEMENS MR VA0 GEN",92) DS SaturationReadoutVectorTransverseComponent 6 PrivateTag +(0021,"SIEMENS MR VA0 GEN",93) DS EPIChangeValueOfMagnitude 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",94) DS EPIChangeValueOfXComponent 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",95) DS EPIChangeValueOfYComponent 1 PrivateTag +(0021,"SIEMENS MR VA0 GEN",96) DS EPIChangeValueOfZComponent 1 PrivateTag + +(0021,"SIEMENS MR VA0 RAW",00) LT SequenceType 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",01) IS VectorSizeOriginal 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",02) IS VectorSizeExtended 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",03) DS AcquiredSpectralRange 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",04) DS VOIPosition 3 PrivateTag +(0021,"SIEMENS MR VA0 RAW",05) DS VOISize 3 PrivateTag +(0021,"SIEMENS MR VA0 RAW",06) IS CSIMatrixSizeOriginal 3 PrivateTag +(0021,"SIEMENS MR VA0 RAW",07) IS CSIMatrixSizeExtended 3 PrivateTag +(0021,"SIEMENS MR VA0 RAW",08) DS SpatialGridShift 3 PrivateTag +(0021,"SIEMENS MR VA0 RAW",09) DS SignalLimitsMinimum 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",10) DS SignalLimitsMaximum 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",11) DS SpecInfoMask 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",12) DS EPITimeRateOfChangeOfMagnitude 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",13) DS EPITimeRateOfChangeOfXComponent 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",14) DS EPITimeRateOfChangeOfYComponent 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",15) DS EPITimeRateOfChangeOfZComponent 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",16) DS EPITimeRateOfChangeLegalLimit1 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",17) DS EPIOperationModeFlag 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",18) DS EPIFieldCalculationSafetyFactor 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",19) DS EPILegalLimit1OfChangeValue 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",20) DS EPILegalLimit2OfChangeValue 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",21) DS EPIRiseTime 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",30) DS ArrayCoilADCOffset 16 PrivateTag +(0021,"SIEMENS MR VA0 RAW",31) DS ArrayCoilPreamplifierGain 16 PrivateTag +(0021,"SIEMENS MR VA0 RAW",50) LT SaturationType 1 PrivateTag +(0021,"SIEMENS MR VA0 RAW",51) DS SaturationNormalVector 3 PrivateTag +(0021,"SIEMENS MR VA0 RAW",52) DS SaturationPositionVector 3 PrivateTag +(0021,"SIEMENS MR VA0 RAW",53) DS SaturationThickness 6 PrivateTag +(0021,"SIEMENS MR VA0 RAW",54) DS SaturationWidth 6 PrivateTag +(0021,"SIEMENS MR VA0 RAW",55) DS SaturationDistance 6 PrivateTag + +(7fe3,"SIEMENS NUMARIS II",00) LT ImageGraphicsFormatCode 1 PrivateTag +(7fe3,"SIEMENS NUMARIS II",10) OB ImageGraphics 1 PrivateTag +(7fe3,"SIEMENS NUMARIS II",20) OB ImageGraphicsDummy 1 PrivateTag + +(0011,"SIEMENS RA GEN",20) SL FluoroTimer 1 PrivateTag +(0011,"SIEMENS RA GEN",25) SL PtopDoseAreaProduct 1 PrivateTag +(0011,"SIEMENS RA GEN",26) SL PtopTotalSkinDose 1 PrivateTag +(0011,"SIEMENS RA GEN",30) LT Unknown 1 PrivateTag +(0011,"SIEMENS RA GEN",35) LO PatientInitialPuckCounter 1 PrivateTag +(0011,"SIEMENS RA GEN",40) SS SPIDataObjectType 1 PrivateTag +(0019,"SIEMENS RA GEN",15) LO AcquiredPlane 1 PrivateTag +(0019,"SIEMENS RA GEN",1f) SS DefaultTableIsoCenterHeight 1 PrivateTag +(0019,"SIEMENS RA GEN",20) SL SceneFlag 1 PrivateTag +(0019,"SIEMENS RA GEN",22) SL RefPhotofileFlag 1 PrivateTag +(0019,"SIEMENS RA GEN",24) LO SceneName 1 PrivateTag +(0019,"SIEMENS RA GEN",26) SS AcquisitionIndex 1 PrivateTag +(0019,"SIEMENS RA GEN",28) SS MixedPulseMode 1 PrivateTag +(0019,"SIEMENS RA GEN",2a) SS NoOfPositions 1 PrivateTag +(0019,"SIEMENS RA GEN",2c) SS NoOfPhases 1 PrivateTag +(0019,"SIEMENS RA GEN",2e) SS FrameRateForPositions 1-n PrivateTag +(0019,"SIEMENS RA GEN",30) SS NoOfFramesForPositions 1-n PrivateTag +(0019,"SIEMENS RA GEN",32) SS SteppingDirection 1 PrivateTag +(0019,"SIEMENS RA GEN",34) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",36) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",38) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",3a) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",3c) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",3e) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",40) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",42) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",44) SS ImageTransferDelay 1 PrivateTag +(0019,"SIEMENS RA GEN",46) SL InversFlag 1 PrivateTag +(0019,"SIEMENS RA GEN",48) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",4a) US Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",4c) SS BlankingCircleDiameter 1 PrivateTag +(0019,"SIEMENS RA GEN",50) SL StandDataValid 1 PrivateTag +(0019,"SIEMENS RA GEN",52) SS TableTilt 1 PrivateTag +(0019,"SIEMENS RA GEN",54) SS TableAxisRotation 1 PrivateTag +(0019,"SIEMENS RA GEN",56) SS TableLongitudalPosition 1 PrivateTag +(0019,"SIEMENS RA GEN",58) SS TableSideOffset 1 PrivateTag +(0019,"SIEMENS RA GEN",5a) SS TableIsoCenterHeight 1 PrivateTag +(0019,"SIEMENS RA GEN",5c) UN Unknown 1 PrivateTag +(0019,"SIEMENS RA GEN",5e) SL CollimationDataValid 1 PrivateTag +(0019,"SIEMENS RA GEN",60) SL PeriSequenceNo 1 PrivateTag +(0019,"SIEMENS RA GEN",62) SL PeriTotalScenes 1 PrivateTag +(0019,"SIEMENS RA GEN",64) SL PeriOverlapTop 1 PrivateTag +(0019,"SIEMENS RA GEN",66) SL PeriOverlapBottom 1 PrivateTag +(0019,"SIEMENS RA GEN",68) SL RawImageNumber 1 PrivateTag +(0019,"SIEMENS RA GEN",6a) SL XRayDataValid 1 PrivateTag +(0019,"SIEMENS RA GEN",70) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",72) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",74) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",76) SL FillingAverageFactor 1 PrivateTag +(0019,"SIEMENS RA GEN",78) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",7a) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",7c) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",7e) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",80) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",82) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",84) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",86) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",88) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",8a) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",8c) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",8e) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",92) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",94) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",96) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",98) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",9a) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA GEN",9c) SL IntensifierLevelCalibrationFactor 1 PrivateTag +(0019,"SIEMENS RA GEN",9e) SL NativeReviewFlag 1 PrivateTag +(0019,"SIEMENS RA GEN",a2) SL SceneNumber 1 PrivateTag +(0019,"SIEMENS RA GEN",a4) SS AcquisitionMode 1 PrivateTag +(0019,"SIEMENS RA GEN",a5) SS AcquisitonFrameRate 1 PrivateTag +(0019,"SIEMENS RA GEN",a6) SL ECGFlag 1 PrivateTag +(0019,"SIEMENS RA GEN",a7) SL AdditionalSceneData 1 PrivateTag +(0019,"SIEMENS RA GEN",a8) SL FileCopyFlag 1 PrivateTag +(0019,"SIEMENS RA GEN",a9) SL PhlebovisionFlag 1 PrivateTag +(0019,"SIEMENS RA GEN",aa) SL Co2Flag 1 PrivateTag +(0019,"SIEMENS RA GEN",ab) SS MaxSpeed 1 PrivateTag +(0019,"SIEMENS RA GEN",ac) SS StepWidth 1 PrivateTag +(0019,"SIEMENS RA GEN",ad) SL DigitalAcquisitionZoom 1 PrivateTag +(0019,"SIEMENS RA GEN",ff) SS Internal 1-n PrivateTag +(0021,"SIEMENS RA GEN",15) SS ImagesInStudy 1 PrivateTag +(0021,"SIEMENS RA GEN",20) SS ScenesInStudy 1 PrivateTag +(0021,"SIEMENS RA GEN",25) SS ImagesInPhotofile 1 PrivateTag +(0021,"SIEMENS RA GEN",27) SS PlaneBImagesExist 1 PrivateTag +(0021,"SIEMENS RA GEN",28) SS NoOf2MBChunks 1 PrivateTag +(0021,"SIEMENS RA GEN",30) SS ImagesInAllScenes 1 PrivateTag +(0021,"SIEMENS RA GEN",40) SS ArchiveSWInternalVersion 1 PrivateTag + +(0011,"SIEMENS RA PLANE A",28) SL FluoroTimerA 1 PrivateTag +(0011,"SIEMENS RA PLANE A",29) SL FluoroSkinDoseA 1 PrivateTag +(0011,"SIEMENS RA PLANE A",2a) SL TotalSkinDoseA 1 PrivateTag +(0011,"SIEMENS RA PLANE A",2b) SL FluoroDoseAreaProductA 1 PrivateTag +(0011,"SIEMENS RA PLANE A",2c) SL TotalDoseAreaProductA 1 PrivateTag +(0019,"SIEMENS RA PLANE A",15) LT OfflineUID 1 PrivateTag +(0019,"SIEMENS RA PLANE A",18) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",19) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",1a) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",1b) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",1c) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",1d) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",1e) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",1f) SS Internal 1-n PrivateTag +(0019,"SIEMENS RA PLANE A",20) SS SystemCalibFactorPlaneA 1 PrivateTag +(0019,"SIEMENS RA PLANE A",22) SS XRayParameterSetNo 1 PrivateTag +(0019,"SIEMENS RA PLANE A",24) SS XRaySystem 1 PrivateTag +(0019,"SIEMENS RA PLANE A",26) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE A",28) SS AcquiredDisplayMode 1 PrivateTag +(0019,"SIEMENS RA PLANE A",2a) SS AcquisitionDelay 1 PrivateTag +(0019,"SIEMENS RA PLANE A",2c) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE A",2e) SS MaxFramesLimit 1 PrivateTag +(0019,"SIEMENS RA PLANE A",30) US MaximumFrameSizeNIU 1 PrivateTag +(0019,"SIEMENS RA PLANE A",32) SS SubtractedFilterType 1 PrivateTag +(0019,"SIEMENS RA PLANE A",34) SS FilterFactorNative 1 PrivateTag +(0019,"SIEMENS RA PLANE A",36) SS AnatomicBackgroundFactor 1 PrivateTag +(0019,"SIEMENS RA PLANE A",38) SS WindowUpperLimitNative 1 PrivateTag +(0019,"SIEMENS RA PLANE A",3a) SS WindowLowerLimitNative 1 PrivateTag +(0019,"SIEMENS RA PLANE A",3c) SS WindowBrightnessPhase1 1 PrivateTag +(0019,"SIEMENS RA PLANE A",3e) SS WindowBrightnessPhase2 1 PrivateTag +(0019,"SIEMENS RA PLANE A",40) SS WindowContrastPhase1 1 PrivateTag +(0019,"SIEMENS RA PLANE A",42) SS WindowContrastPhase2 1 PrivateTag +(0019,"SIEMENS RA PLANE A",44) SS FilterFactorSub 1 PrivateTag +(0019,"SIEMENS RA PLANE A",46) SS PeakOpacified 1 PrivateTag +(0019,"SIEMENS RA PLANE A",48) SL MaskFrame 1 PrivateTag +(0019,"SIEMENS RA PLANE A",4a) SL BIHFrame 1 PrivateTag +(0019,"SIEMENS RA PLANE A",4c) SS CentBeamAngulationCaudCran 1 PrivateTag +(0019,"SIEMENS RA PLANE A",4e) SS CentBeamAngulationLRAnterior 1 PrivateTag +(0019,"SIEMENS RA PLANE A",50) SS LongitudinalPosition 1 PrivateTag +(0019,"SIEMENS RA PLANE A",52) SS SideOffset 1 PrivateTag +(0019,"SIEMENS RA PLANE A",54) SS IsoCenterHeight 1 PrivateTag +(0019,"SIEMENS RA PLANE A",56) SS ImageTwist 1 PrivateTag +(0019,"SIEMENS RA PLANE A",58) SS SourceImageDistance 1 PrivateTag +(0019,"SIEMENS RA PLANE A",5a) SS MechanicalMagnificationFactor 1 PrivateTag +(0019,"SIEMENS RA PLANE A",5c) SL CalibrationFlag 1 PrivateTag +(0019,"SIEMENS RA PLANE A",5e) SL CalibrationAngleCranCaud 1 PrivateTag +(0019,"SIEMENS RA PLANE A",60) SL CalibrationAngleRAOLAO 1 PrivateTag +(0019,"SIEMENS RA PLANE A",62) SL CalibrationTableToFloorDist 1 PrivateTag +(0019,"SIEMENS RA PLANE A",64) SL CalibrationIsocenterToFloorDist 1 PrivateTag +(0019,"SIEMENS RA PLANE A",66) SL CalibrationIsocenterToSourceDist 1 PrivateTag +(0019,"SIEMENS RA PLANE A",68) SL CalibrationSourceToII 1 PrivateTag +(0019,"SIEMENS RA PLANE A",6a) SL CalibrationIIZoom 1 PrivateTag +(0019,"SIEMENS RA PLANE A",6c) SL CalibrationIIField 1 PrivateTag +(0019,"SIEMENS RA PLANE A",6e) SL CalibrationFactor 1 PrivateTag +(0019,"SIEMENS RA PLANE A",70) SL CalibrationObjectToImageDistance 1 PrivateTag +(0019,"SIEMENS RA PLANE A",72) SL CalibrationSystemFactor 1-n PrivateTag +(0019,"SIEMENS RA PLANE A",74) SL CalibrationSystemCorrection 1-n PrivateTag +(0019,"SIEMENS RA PLANE A",76) SL CalibrationSystemIIFormats 1-n PrivateTag +(0019,"SIEMENS RA PLANE A",78) SL CalibrationGantryDataValid 1 PrivateTag +(0019,"SIEMENS RA PLANE A",7a) SS CollimatorSquareBreadth 1 PrivateTag +(0019,"SIEMENS RA PLANE A",7c) SS CollimatorSquareHeight 1 PrivateTag +(0019,"SIEMENS RA PLANE A",7e) SS CollimatorSquareDiameter 1 PrivateTag +(0019,"SIEMENS RA PLANE A",80) SS CollimaterFingerTurnAngle 1 PrivateTag +(0019,"SIEMENS RA PLANE A",82) SS CollimaterFingerPosition 1 PrivateTag +(0019,"SIEMENS RA PLANE A",84) SS CollimaterDiaphragmTurnAngle 1 PrivateTag +(0019,"SIEMENS RA PLANE A",86) SS CollimaterDiaphragmPosition1 1 PrivateTag +(0019,"SIEMENS RA PLANE A",88) SS CollimaterDiaphragmPosition2 1 PrivateTag +(0019,"SIEMENS RA PLANE A",8a) SS CollimaterDiaphragmMode 1 PrivateTag +(0019,"SIEMENS RA PLANE A",8c) SS CollimaterBeamLimitBreadth 1 PrivateTag +(0019,"SIEMENS RA PLANE A",8e) SS CollimaterBeamLimitHeight 1 PrivateTag +(0019,"SIEMENS RA PLANE A",90) SS CollimaterBeamLimitDiameter 1 PrivateTag +(0019,"SIEMENS RA PLANE A",92) SS X-RayControlMOde 1 PrivateTag +(0019,"SIEMENS RA PLANE A",94) SS X-RaySystem 1 PrivateTag +(0019,"SIEMENS RA PLANE A",96) SS FocalSpot 1 PrivateTag +(0019,"SIEMENS RA PLANE A",98) SS ExposureControl 1 PrivateTag +(0019,"SIEMENS RA PLANE A",9a) SL XRayVoltage 1 PrivateTag +(0019,"SIEMENS RA PLANE A",9c) SL XRayCurrent 1 PrivateTag +(0019,"SIEMENS RA PLANE A",9e) SL XRayCurrentTimeProduct 1 PrivateTag +(0019,"SIEMENS RA PLANE A",a0) SL XRayPulseTime 1 PrivateTag +(0019,"SIEMENS RA PLANE A",a2) SL XRaySceneTimeFluoroClock 1 PrivateTag +(0019,"SIEMENS RA PLANE A",a4) SS MaximumPulseRate 1 PrivateTag +(0019,"SIEMENS RA PLANE A",a6) SS PulsesPerScene 1 PrivateTag +(0019,"SIEMENS RA PLANE A",a8) SL DoseAreaProductOfScene 1 PrivateTag +(0019,"SIEMENS RA PLANE A",aa) SS Dose 1 PrivateTag +(0019,"SIEMENS RA PLANE A",ac) SS DoseRate 1 PrivateTag +(0019,"SIEMENS RA PLANE A",ae) SL IIToCoverDistance 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b0) SS LastFramePhase1 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b1) SS FrameRatePhase1 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b2) SS LastFramePhase2 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b3) SS FrameRatePhase2 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b4) SS LastFramePhase3 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b5) SS FrameRatePhase3 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b6) SS LastFramePhase4 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b7) SS FrameRatePhase4 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b8) SS GammaOfNativeImage 1 PrivateTag +(0019,"SIEMENS RA PLANE A",b9) SS GammaOfTVSystem 1 PrivateTag +(0019,"SIEMENS RA PLANE A",bb) SL PixelshiftX 1 PrivateTag +(0019,"SIEMENS RA PLANE A",bc) SL PixelshiftY 1 PrivateTag +(0019,"SIEMENS RA PLANE A",bd) SL MaskAverageFactor 1 PrivateTag +(0019,"SIEMENS RA PLANE A",be) SL BlankingCircleFlag 1 PrivateTag +(0019,"SIEMENS RA PLANE A",bf) SL CircleRowStart 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c0) SL CircleRowEnd 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c1) SL CircleColumnStart 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c2) SL CircleColumnEnd 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c3) SL CircleDiameter 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c4) SL RectangularCollimaterFlag 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c5) SL RectangleRowStart 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c6) SL RectangleRowEnd 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c7) SL RectangleColumnStart 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c8) SL RectangleColumnEnd 1 PrivateTag +(0019,"SIEMENS RA PLANE A",c9) SL RectangleAngulation 1 PrivateTag +(0019,"SIEMENS RA PLANE A",ca) SL IrisCollimatorFlag 1 PrivateTag +(0019,"SIEMENS RA PLANE A",cb) SL IrisRowStart 1 PrivateTag +(0019,"SIEMENS RA PLANE A",cc) SL IrisRowEnd 1 PrivateTag +(0019,"SIEMENS RA PLANE A",cd) SL IrisColumnStart 1 PrivateTag +(0019,"SIEMENS RA PLANE A",ce) SL IrisColumnEnd 1 PrivateTag +(0019,"SIEMENS RA PLANE A",cf) SL IrisAngulation 1 PrivateTag +(0019,"SIEMENS RA PLANE A",d1) SS NumberOfFramesPlane 1 PrivateTag +(0019,"SIEMENS RA PLANE A",d2) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",d3) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",d4) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",d5) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",d6) SS Internal 1-n PrivateTag +(0019,"SIEMENS RA PLANE A",d7) SS Internal 1-n PrivateTag +(0019,"SIEMENS RA PLANE A",d8) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",d9) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",da) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",db) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",dc) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",dd) SL AnatomicBackground 1 PrivateTag +(0019,"SIEMENS RA PLANE A",de) SL AutoWindowBase 1-n PrivateTag +(0019,"SIEMENS RA PLANE A",df) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE A",e0) SL Internal 1 PrivateTag + +(0011,"SIEMENS RA PLANE B",28) SL FluoroTimerB 1 PrivateTag +(0011,"SIEMENS RA PLANE B",29) SL FluoroSkinDoseB 1 PrivateTag +(0011,"SIEMENS RA PLANE B",2a) SL TotalSkinDoseB 1 PrivateTag +(0011,"SIEMENS RA PLANE B",2b) SL FluoroDoseAreaProductB 1 PrivateTag +(0011,"SIEMENS RA PLANE B",2c) SL TotalDoseAreaProductB 1 PrivateTag +(0019,"SIEMENS RA PLANE B",18) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",19) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",1a) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",1b) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",1c) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",1d) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",1e) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",1f) SS Internal 1 PrivateTag +(0019,"SIEMENS RA PLANE B",20) SL SystemCalibFactorPlaneB 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",22) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",24) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",26) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",28) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",2a) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",2c) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",2e) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",30) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",32) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",34) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",36) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",38) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",3a) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",3c) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",3e) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",40) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",42) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",44) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",46) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",48) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",4a) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",4c) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",4e) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",50) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",52) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",54) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",56) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",58) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",5a) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",5c) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",5e) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",60) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",62) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",64) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",66) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",68) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",6a) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",6c) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",6e) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",70) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",72) UN Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",74) UN Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",76) UN Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",78) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",7a) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",7c) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",7e) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",80) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",82) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",84) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",86) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",88) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",8a) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",8c) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",8e) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",90) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",92) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",94) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",96) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",98) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",9a) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",9c) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",9e) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",a0) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",a2) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",a4) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",a6) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",a8) US Unknown 1-n PrivateTag +(0019,"SIEMENS RA PLANE B",aa) US Unknown 1 PrivateTag +(0019,"SIEMENS RA PLANE B",ac) US Unknown 1 PrivateTag + +(0011,"SIEMENS RIS",10) LT PatientUID 1 PrivateTag +(0011,"SIEMENS RIS",11) LT PatientID 1 PrivateTag +(0011,"SIEMENS RIS",20) DA PatientRegistrationDate 1 PrivateTag +(0011,"SIEMENS RIS",21) TM PatientRegistrationTime 1 PrivateTag +(0011,"SIEMENS RIS",30) LT PatientnameRIS 1 PrivateTag +(0011,"SIEMENS RIS",31) LT PatientprenameRIS 1 PrivateTag +(0011,"SIEMENS RIS",40) LT PatientHospitalStatus 1 PrivateTag +(0011,"SIEMENS RIS",41) LT MedicalAlerts 1 PrivateTag +(0011,"SIEMENS RIS",42) LT ContrastAllergies 1 PrivateTag +(0031,"SIEMENS RIS",10) LT RequestUID 1 PrivateTag +(0031,"SIEMENS RIS",45) LT RequestingPhysician 1 PrivateTag +(0031,"SIEMENS RIS",50) LT RequestedPhysician 1 PrivateTag +(0033,"SIEMENS RIS",10) LT PatientStudyUID 1 PrivateTag + +(0021,"SIEMENS SMS-AX ACQ 1.0",00) US AcquisitionType 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",01) US AcquisitionMode 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",02) US FootswitchIndex 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",03) US AcquisitionRoom 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",04) SL CurrentTimeProduct 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",05) SL Dose 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",06) SL SkinDosePercent 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",07) SL SkinDoseAccumulation 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",08) SL SkinDoseRate 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",0A) UL CopperFilter 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",0B) US MeasuringField 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",0C) SS PostBlankingCircle 3 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",0D) SS DynaAngles 2-2n PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",0E) SS TotalSteps 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",0F) SL DynaXRayInfo 3-3n PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",10) US ModalityLUTInputGamma 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",11) US ModalityLUTOutputGamma 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",12) OB SH_STPAR 1-n PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",13) US AcquisitionZoom 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",14) SS DynaAngulationStepWidth 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",15) US Harmonization 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",16) US DRSingleFlag 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",17) SL SourceToIsocenter 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",18) US PressureData 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",19) SL ECGIndexArray 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",1A) US FDFlag 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",1B) OB SH_ZOOM 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",1C) OB SH_COLPAR 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",1D) US K_Factor 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",1E) US EVE 8 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",1F) SL TotalSceneTime 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",20) US RestoreFlag 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",21) US StandMovementFlag 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",22) US FDRows 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",23) US FDColumns 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",24) US TableMovementFlag 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",25) LO OriginalOrganProgramName 1 PrivateTag +(0021,"SIEMENS SMS-AX ACQ 1.0",26) DS CrispyXPIFilter 1 PrivateTag + +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",00) US ViewNative 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",01) US OriginalSeriesNumber 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",02) US OriginalImageNumber 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",03) US WinCenter 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",04) US WinWidth 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",05) US WinBrightness 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",06) US WinContrast 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",07) US OriginalFrameNumber 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",08) US OriginalMaskFrameNumber 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",09) US Opac 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",0A) US OriginalNumberOfFrames 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",0B) DS OriginalSceneDuration 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",0C) LO IdentifierLOID 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",0D) SS OriginalSceneVFRInfo 1-n PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",0E) SS OriginalFrameECGPosition 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",0F) SS OriginalECG1stFrameOffset_retired 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",10) SS ZoomFlag 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",11) US Flex 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",12) US NumberOfMaskFrames 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",13) US NumberOfFillFrames 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",14) US SeriesNumber 1 PrivateTag +(0025,"SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0",15) IS ImageNumber 1 PrivateTag + +(0023,"SIEMENS SMS-AX QUANT 1.0",00) DS HorizontalCalibrationPixelSize 2 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",01) DS VerticalCalibrationPixelSize 2 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",02) LO CalibrationObject 1 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",03) DS CalibrationObjectSize 1 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",04) LO CalibrationMethod 1 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",05) ST Filename 1 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",06) IS FrameNumber 1 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",07) IS CalibrationFactorMultiplicity 2 PrivateTag +(0023,"SIEMENS SMS-AX QUANT 1.0",08) IS CalibrationTODValue 1 PrivateTag + +(0019,"SIEMENS SMS-AX VIEW 1.0",00) US ReviewMode 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",01) US AnatomicalBackgroundPercent 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",02) US NumberOfPhases 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",03) US ApplyAnatomicalBackground 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",04) SS PixelShiftArray 4-4n PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",05) US Brightness 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",06) US Contrast 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",07) US Enabled 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",08) US NativeEdgeEnhancementPercentGain 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",09) SS NativeEdgeEnhancementLUTIndex 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",0A) SS NativeEdgeEnhancementKernelSize 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",0B) US SubtrEdgeEnhancementPercentGain 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",0C) SS SubtrEdgeEnhancementLUTIndex 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",0D) SS SubtrEdgeEnhancementKernelSize 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",0E) US FadePercent 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",0F) US FlippedBeforeLateralityApplied 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",10) US ApplyFade 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",12) US Zoom 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",13) SS PanX 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",14) SS PanY 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",15) SS NativeEdgeEnhancementAdvPercGain 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",16) SS SubtrEdgeEnhancementAdvPercGain 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",17) US InvertFlag 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",1A) OB Quant1KOverlay 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",1B) US OriginalResolution 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",1C) DS AutoWindowCenter 1 PrivateTag +(0019,"SIEMENS SMS-AX VIEW 1.0",1D) DS AutoWindowWidth 1 PrivateTag + +(0009,"SIENET",01) US SIENETCommandField 1 PrivateTag +(0009,"SIENET",14) LT ReceiverPLA 1 PrivateTag +(0009,"SIENET",16) US TransferPriority 1 PrivateTag +(0009,"SIENET",29) LT ActualUser 1 PrivateTag +(0095,"SIENET",01) LT ExaminationFolderID 1 PrivateTag +(0095,"SIENET",04) UL FolderReportedStatus 1 PrivateTag +(0095,"SIENET",05) LT FolderReportingRadiologist 1 PrivateTag +(0095,"SIENET",07) LT SIENETISAPLA 1 PrivateTag +(0099,"SIENET",02) UL DataObjectAttributes 1 PrivateTag + +(0009,"SPI RELEASE 1",10) LT Comments 1 PrivateTag +(0009,"SPI RELEASE 1",15) LO SPIImageUID 1 PrivateTag +(0009,"SPI RELEASE 1",40) US DataObjectType 1 PrivateTag +(0009,"SPI RELEASE 1",41) LO DataObjectSubtype 1 PrivateTag +(0011,"SPI RELEASE 1",10) LO Organ 1 PrivateTag +(0011,"SPI RELEASE 1",15) LO AllergyIndication 1 PrivateTag +(0011,"SPI RELEASE 1",20) LO Pregnancy 1 PrivateTag +(0029,"SPI RELEASE 1",60) LT CompressionAlgorithm 1 PrivateTag + +(0009,"SPI Release 1",10) LT Comments 1 PrivateTag +(0009,"SPI Release 1",15) LO SPIImageUID 1 PrivateTag +(0009,"SPI Release 1",40) US DataObjectType 1 PrivateTag +(0009,"SPI Release 1",41) LO DataObjectSubtype 1 PrivateTag +(0011,"SPI Release 1",10) LO Organ 1 PrivateTag +(0011,"SPI Release 1",15) LO AllergyIndication 1 PrivateTag +(0011,"SPI Release 1",20) LO Pregnancy 1 PrivateTag +(0029,"SPI Release 1",60) LT CompressionAlgorithm 1 PrivateTag + +(0009,"SPI",10) LO Comments 1 PrivateTag +(0009,"SPI",15) LO SPIImageUID 1 PrivateTag +(0009,"SPI",40) US DataObjectType 1 PrivateTag +(0009,"SPI",41) LT DataObjectSubtype 1 PrivateTag +(0011,"SPI",10) LT Organ 1 PrivateTag +(0011,"SPI",15) LT AllergyIndication 1 PrivateTag +(0011,"SPI",20) LT Pregnancy 1 PrivateTag +(0029,"SPI",60) LT CompressionAlgorithm 1 PrivateTag + +(0011,"SPI RELEASE 1",10) LO Organ 1 PrivateTag +(0011,"SPI RELEASE 1",15) LO AllergyIndication 1 PrivateTag +(0011,"SPI RELEASE 1",20) LO Pregnancy 1 PrivateTag + +(0009,"SPI-P Release 1",00) LT DataObjectRecognitionCode 1 PrivateTag +(0009,"SPI-P Release 1",04) LO ImageDataConsistence 1 PrivateTag +(0009,"SPI-P Release 1",08) US Unknown 1 PrivateTag +(0009,"SPI-P Release 1",12) LO Unknown 1 PrivateTag +(0009,"SPI-P Release 1",15) LO UniqueIdentifier 1 PrivateTag +(0009,"SPI-P Release 1",16) LO Unknown 1 PrivateTag +(0009,"SPI-P Release 1",18) LO Unknown 1 PrivateTag +(0009,"SPI-P Release 1",21) LT Unknown 1 PrivateTag +(0009,"SPI-P Release 1",31) LT PACSUniqueIdentifier 1 PrivateTag +(0009,"SPI-P Release 1",34) LT ClusterUniqueIdentifier 1 PrivateTag +(0009,"SPI-P Release 1",38) LT SystemUniqueIdentifier 1 PrivateTag +(0009,"SPI-P Release 1",39) LT Unknown 1 PrivateTag +(0009,"SPI-P Release 1",51) LT StudyUniqueIdentifier 1 PrivateTag +(0009,"SPI-P Release 1",61) LT SeriesUniqueIdentifier 1 PrivateTag +(0009,"SPI-P Release 1",91) LT Unknown 1 PrivateTag +(0009,"SPI-P Release 1",f2) LT Unknown 1 PrivateTag +(0009,"SPI-P Release 1",f3) UN Unknown 1 PrivateTag +(0009,"SPI-P Release 1",f4) LT Unknown 1 PrivateTag +(0009,"SPI-P Release 1",f5) UN Unknown 1 PrivateTag +(0009,"SPI-P Release 1",f7) LT Unknown 1 PrivateTag +(0011,"SPI-P Release 1",10) LT PatientEntryID 1 PrivateTag +(0011,"SPI-P Release 1",21) UN Unknown 1 PrivateTag +(0011,"SPI-P Release 1",22) UN Unknown 1 PrivateTag +(0011,"SPI-P Release 1",31) UN Unknown 1 PrivateTag +(0011,"SPI-P Release 1",32) UN Unknown 1 PrivateTag +(0019,"SPI-P Release 1",00) UN Unknown 1 PrivateTag +(0019,"SPI-P Release 1",01) UN Unknown 1 PrivateTag +(0019,"SPI-P Release 1",02) UN Unknown 1 PrivateTag +(0019,"SPI-P Release 1",10) US MainsFrequency 1 PrivateTag +(0019,"SPI-P Release 1",25) LT OriginalPixelDataQuality 1-n PrivateTag +(0019,"SPI-P Release 1",30) US ECGTriggering 1 PrivateTag +(0019,"SPI-P Release 1",31) UN ECG1Offset 1 PrivateTag +(0019,"SPI-P Release 1",32) UN ECG2Offset1 1 PrivateTag +(0019,"SPI-P Release 1",33) UN ECG2Offset2 1 PrivateTag +(0019,"SPI-P Release 1",50) US VideoScanMode 1 PrivateTag +(0019,"SPI-P Release 1",51) US VideoLineRate 1 PrivateTag +(0019,"SPI-P Release 1",60) US XrayTechnique 1 PrivateTag +(0019,"SPI-P Release 1",61) DS ImageIdentifierFromat 1 PrivateTag +(0019,"SPI-P Release 1",62) US IrisDiaphragm 1 PrivateTag +(0019,"SPI-P Release 1",63) CS Filter 1 PrivateTag +(0019,"SPI-P Release 1",64) CS CineParallel 1 PrivateTag +(0019,"SPI-P Release 1",65) CS CineMaster 1 PrivateTag +(0019,"SPI-P Release 1",70) US ExposureChannel 1 PrivateTag +(0019,"SPI-P Release 1",71) UN ExposureChannelFirstImage 1 PrivateTag +(0019,"SPI-P Release 1",72) US ProcessingChannel 1 PrivateTag +(0019,"SPI-P Release 1",80) DS AcquisitionDelay 1 PrivateTag +(0019,"SPI-P Release 1",81) UN RelativeImageTime 1 PrivateTag +(0019,"SPI-P Release 1",90) CS VideoWhiteCompression 1 PrivateTag +(0019,"SPI-P Release 1",a0) US Angulation 1 PrivateTag +(0019,"SPI-P Release 1",a1) US Rotation 1 PrivateTag +(0021,"SPI-P Release 1",12) LT SeriesUniqueIdentifier 1 PrivateTag +(0021,"SPI-P Release 1",14) LT Unknown 1 PrivateTag +(0029,"SPI-P Release 1",00) DS Unknown 4 PrivateTag +(0029,"SPI-P Release 1",20) DS PixelAspectRatio 1 PrivateTag +(0029,"SPI-P Release 1",25) LO ProcessedPixelDataQuality 1-n PrivateTag +(0029,"SPI-P Release 1",30) LT Unknown 1 PrivateTag +(0029,"SPI-P Release 1",38) US Unknown 1 PrivateTag +(0029,"SPI-P Release 1",60) LT Unknown 1 PrivateTag +(0029,"SPI-P Release 1",61) LT Unknown 1 PrivateTag +(0029,"SPI-P Release 1",67) LT Unknown 1 PrivateTag +(0029,"SPI-P Release 1",70) LT WindowID 1 PrivateTag +(0029,"SPI-P Release 1",71) CS VideoInvertSubtracted 1 PrivateTag +(0029,"SPI-P Release 1",72) CS VideoInvertNonsubtracted 1 PrivateTag +(0029,"SPI-P Release 1",77) CS WindowSelectStatus 1 PrivateTag +(0029,"SPI-P Release 1",78) LT ECGDisplayPrintingID 1 PrivateTag +(0029,"SPI-P Release 1",79) CS ECGDisplayPrinting 1 PrivateTag +(0029,"SPI-P Release 1",7e) CS ECGDisplayPrintingEnableStatus 1 PrivateTag +(0029,"SPI-P Release 1",7f) CS ECGDisplayPrintingSelectStatus 1 PrivateTag +(0029,"SPI-P Release 1",80) LT PhysiologicalDisplayID 1 PrivateTag +(0029,"SPI-P Release 1",81) US PreferredPhysiologicalChannelDisplay 1 PrivateTag +(0029,"SPI-P Release 1",8e) CS PhysiologicalDisplayEnableStatus 1 PrivateTag +(0029,"SPI-P Release 1",8f) CS PhysiologicalDisplaySelectStatus 1 PrivateTag +(0029,"SPI-P Release 1",c0) LT FunctionalShutterID 1 PrivateTag +(0029,"SPI-P Release 1",c1) US FieldOfShutter 1 PrivateTag +(0029,"SPI-P Release 1",c5) LT FieldOfShutterRectangle 1 PrivateTag +(0029,"SPI-P Release 1",ce) CS ShutterEnableStatus 1 PrivateTag +(0029,"SPI-P Release 1",cf) CS ShutterSelectStatus 1 PrivateTag +(7FE1,"SPI-P Release 1",10) ox PixelData 1 PrivateTag + +(0009,"SPI-P Release 1;1",c0) LT Unknown 1 PrivateTag +(0009,"SPI-P Release 1;1",c1) LT Unknown 1 PrivateTag +(0019,"SPI-P Release 1;1",00) UN PhysiologicalDataType 1 PrivateTag +(0019,"SPI-P Release 1;1",01) UN PhysiologicalDataChannelAndKind 1 PrivateTag +(0019,"SPI-P Release 1;1",02) US SampleBitsAllocated 1 PrivateTag +(0019,"SPI-P Release 1;1",03) US SampleBitsStored 1 PrivateTag +(0019,"SPI-P Release 1;1",04) US SampleHighBit 1 PrivateTag +(0019,"SPI-P Release 1;1",05) US SampleRepresentation 1 PrivateTag +(0019,"SPI-P Release 1;1",06) UN SmallestSampleValue 1 PrivateTag +(0019,"SPI-P Release 1;1",07) UN LargestSampleValue 1 PrivateTag +(0019,"SPI-P Release 1;1",08) UN NumberOfSamples 1 PrivateTag +(0019,"SPI-P Release 1;1",09) UN SampleData 1 PrivateTag +(0019,"SPI-P Release 1;1",0a) UN SampleRate 1 PrivateTag +(0019,"SPI-P Release 1;1",10) UN PhysiologicalDataType2 1 PrivateTag +(0019,"SPI-P Release 1;1",11) UN PhysiologicalDataChannelAndKind2 1 PrivateTag +(0019,"SPI-P Release 1;1",12) US SampleBitsAllocated2 1 PrivateTag +(0019,"SPI-P Release 1;1",13) US SampleBitsStored2 1 PrivateTag +(0019,"SPI-P Release 1;1",14) US SampleHighBit2 1 PrivateTag +(0019,"SPI-P Release 1;1",15) US SampleRepresentation2 1 PrivateTag +(0019,"SPI-P Release 1;1",16) UN SmallestSampleValue2 1 PrivateTag +(0019,"SPI-P Release 1;1",17) UN LargestSampleValue2 1 PrivateTag +(0019,"SPI-P Release 1;1",18) UN NumberOfSamples2 1 PrivateTag +(0019,"SPI-P Release 1;1",19) UN SampleData2 1 PrivateTag +(0019,"SPI-P Release 1;1",1a) UN SampleRate2 1 PrivateTag +(0029,"SPI-P Release 1;1",00) LT ZoomID 1 PrivateTag +(0029,"SPI-P Release 1;1",01) DS ZoomRectangle 1-n PrivateTag +(0029,"SPI-P Release 1;1",03) DS ZoomFactor 1 PrivateTag +(0029,"SPI-P Release 1;1",04) US ZoomFunction 1 PrivateTag +(0029,"SPI-P Release 1;1",0e) CS ZoomEnableStatus 1 PrivateTag +(0029,"SPI-P Release 1;1",0f) CS ZoomSelectStatus 1 PrivateTag +(0029,"SPI-P Release 1;1",40) LT MagnifyingGlassID 1 PrivateTag +(0029,"SPI-P Release 1;1",41) DS MagnifyingGlassRectangle 1-n PrivateTag +(0029,"SPI-P Release 1;1",43) DS MagnifyingGlassFactor 1 PrivateTag +(0029,"SPI-P Release 1;1",44) US MagnifyingGlassFunction 1 PrivateTag +(0029,"SPI-P Release 1;1",4e) CS MagnifyingGlassEnableStatus 1 PrivateTag +(0029,"SPI-P Release 1;1",4f) CS MagnifyingGlassSelectStatus 1 PrivateTag + +(0029,"SPI-P Release 1;2",00) LT SubtractionMaskID 1 PrivateTag +(0029,"SPI-P Release 1;2",04) UN MaskingFunction 1 PrivateTag +(0029,"SPI-P Release 1;2",0c) UN ProprietaryMaskingParameters 1 PrivateTag +(0029,"SPI-P Release 1;2",1e) CS SubtractionMaskEnableStatus 1 PrivateTag +(0029,"SPI-P Release 1;2",1f) CS SubtractionMaskSelectStatus 1 PrivateTag +(0029,"SPI-P Release 1;3",00) LT ImageEnhancementID 1 PrivateTag +(0029,"SPI-P Release 1;3",01) LT ImageEnhancement 1 PrivateTag +(0029,"SPI-P Release 1;3",02) LT ConvolutionID 1 PrivateTag +(0029,"SPI-P Release 1;3",03) LT ConvolutionType 1 PrivateTag +(0029,"SPI-P Release 1;3",04) LT ConvolutionKernelSizeID 1 PrivateTag +(0029,"SPI-P Release 1;3",05) US ConvolutionKernelSize 2 PrivateTag +(0029,"SPI-P Release 1;3",06) US ConvolutionKernel 1-n PrivateTag +(0029,"SPI-P Release 1;3",0c) DS EnhancementGain 1 PrivateTag +(0029,"SPI-P Release 1;3",1e) CS ImageEnhancementEnableStatus 1 PrivateTag +(0029,"SPI-P Release 1;3",1f) CS ImageEnhancementSelectStatus 1 PrivateTag + +(0011,"SPI-P Release 2;1",18) LT Unknown 1 PrivateTag +(0023,"SPI-P Release 2;1",0d) UI Unknown 1 PrivateTag +(0023,"SPI-P Release 2;1",0e) UI Unknown 1 PrivateTag + +(0009,"SPI-P-GV-CT Release 1",00) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",10) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",20) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",30) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",40) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",50) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",60) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",70) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",75) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",80) LO Unknown 1 PrivateTag +(0009,"SPI-P-GV-CT Release 1",90) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",08) IS Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",09) IS Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",0a) IS Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",10) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",20) TM Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",50) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",60) DS Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",61) US Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",63) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",64) US Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",65) IS Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",70) LT Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",80) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",81) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",90) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",a0) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",a1) US Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",a2) US Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",a3) US Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",b0) LO Unknown 1 PrivateTag +(0019,"SPI-P-GV-CT Release 1",b1) LO Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",20) LO Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",30) DS Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",40) LO Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",50) LO Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",60) DS Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",70) DS Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",80) DS Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",90) DS Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",a0) US Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",a1) DS Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",a2) DS Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",a3) LT Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",a4) LT Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",b0) LO Unknown 1 PrivateTag +(0021,"SPI-P-GV-CT Release 1",c0) LO Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",10) LO Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",30) UL Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",31) UL Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",32) UL Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",33) UL Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",80) LO Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",90) LO Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",d0) IS Unknown 1 PrivateTag +(0029,"SPI-P-GV-CT Release 1",d1) IS Unknown 1 PrivateTag + +(0019,"SPI-P-PCR Release 2",30) US Unknown 1 PrivateTag + +(0021,"SPI-P-Private-CWS Release 1",00) LT WindowOfImagesID 1 PrivateTag +(0021,"SPI-P-Private-CWS Release 1",01) CS WindowOfImagesType 1 PrivateTag +(0021,"SPI-P-Private-CWS Release 1",02) IS WindowOfImagesScope 1-n PrivateTag + +(0019,"SPI-P-Private-DCI Release 1",10) UN ECGTimeMapDataBitsAllocated 1 PrivateTag +(0019,"SPI-P-Private-DCI Release 1",11) UN ECGTimeMapDataBitsStored 1 PrivateTag +(0019,"SPI-P-Private-DCI Release 1",12) UN ECGTimeMapDataHighBit 1 PrivateTag +(0019,"SPI-P-Private-DCI Release 1",13) UN ECGTimeMapDataRepresentation 1 PrivateTag +(0019,"SPI-P-Private-DCI Release 1",14) UN ECGTimeMapDataSmallestDataValue 1 PrivateTag +(0019,"SPI-P-Private-DCI Release 1",15) UN ECGTimeMapDataLargestDataValue 1 PrivateTag +(0019,"SPI-P-Private-DCI Release 1",16) UN ECGTimeMapDataNumberOfDataValues 1 PrivateTag +(0019,"SPI-P-Private-DCI Release 1",17) UN ECGTimeMapData 1 PrivateTag + +(0021,"SPI-P-Private_CDS Release 1",40) IS Unknown 1 PrivateTag +(0029,"SPI-P-Private_CDS Release 1",00) UN Unknown 1 PrivateTag + +(0019,"SPI-P-Private_ICS Release 1",30) DS Unknown 1 PrivateTag +(0019,"SPI-P-Private_ICS Release 1",31) LO Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",08) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",0f) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",10) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",1b) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",1c) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",21) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",43) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",44) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",4C) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",67) LO Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",68) US Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",6A) LO Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1",6B) US Unknown 1 PrivateTag + +(0029,"SPI-P-Private_ICS Release 1;1",00) SL Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;1",05) FL Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;1",06) FL Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;1",20) FL Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;1",21) FL Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;1",CD) SQ Unknown 1 PrivateTag + +(0029,"SPI-P-Private_ICS Release 1;2",00) FD Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;2",01) FD Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;2",02) FD Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;2",03) SL Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;2",04) SL Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;2",05) SL Unknown 1 PrivateTag + +(0029,"SPI-P-Private_ICS Release 1;3",C0) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;3",C1) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;3",C2) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;3",C3) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;3",C4) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;3",C5) SQ Unknown 1 PrivateTag + +(0029,"SPI-P-Private_ICS Release 1;4",02) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;4",9A) SQ Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;4",E0) SQ Unknown 1 PrivateTag + +(0029,"SPI-P-Private_ICS Release 1;5",50) CS Unknown 1 PrivateTag +(0029,"SPI-P-Private_ICS Release 1;5",55) CS Unknown 1 PrivateTag + +(0019,"SPI-P-XSB-DCI Release 1",10) LT VideoBeamBoost 1 PrivateTag +(0019,"SPI-P-XSB-DCI Release 1",11) US ChannelGeneratingVideoSync 1 PrivateTag +(0019,"SPI-P-XSB-DCI Release 1",12) US VideoGain 1 PrivateTag +(0019,"SPI-P-XSB-DCI Release 1",13) US VideoOffset 1 PrivateTag +(0019,"SPI-P-XSB-DCI Release 1",20) DS RTDDataCompressionFactor 1 PrivateTag + +(0029,"Silhouette Annot V1.0",11) IS AnnotationName 1 PrivateTag +(0029,"Silhouette Annot V1.0",12) LT AnnotationFont 1 PrivateTag +(0029,"Silhouette Annot V1.0",13) LT AnnotationTextForegroundColor 1 PrivateTag +(0029,"Silhouette Annot V1.0",14) LT AnnotationTextBackgroundColor 1 PrivateTag +(0029,"Silhouette Annot V1.0",15) UL AnnotationTextBackingMode 1 PrivateTag +(0029,"Silhouette Annot V1.0",16) UL AnnotationTextJustification 1 PrivateTag +(0029,"Silhouette Annot V1.0",17) UL AnnotationTextLocation 1 PrivateTag +(0029,"Silhouette Annot V1.0",18) LT AnnotationTextString 1 PrivateTag +(0029,"Silhouette Annot V1.0",19) UL AnnotationTextAttachMode 1 PrivateTag +(0029,"Silhouette Annot V1.0",20) UL AnnotationTextCursorMode 1 PrivateTag +(0029,"Silhouette Annot V1.0",21) UL AnnotationTextShadowOffsetX 1 PrivateTag +(0029,"Silhouette Annot V1.0",22) UL AnnotationTextShadowOffsetY 1 PrivateTag +(0029,"Silhouette Annot V1.0",23) LT AnnotationLineColor 1 PrivateTag +(0029,"Silhouette Annot V1.0",24) UL AnnotationLineThickness 1 PrivateTag +(0029,"Silhouette Annot V1.0",25) UL AnnotationLineType 1 PrivateTag +(0029,"Silhouette Annot V1.0",26) UL AnnotationLineStyle 1 PrivateTag +(0029,"Silhouette Annot V1.0",27) UL AnnotationLineDashLength 1 PrivateTag +(0029,"Silhouette Annot V1.0",28) UL AnnotationLineAttachMode 1 PrivateTag +(0029,"Silhouette Annot V1.0",29) UL AnnotationLinePointCount 1 PrivateTag +(0029,"Silhouette Annot V1.0",30) FD AnnotationLinePoints 1 PrivateTag +(0029,"Silhouette Annot V1.0",31) UL AnnotationLineControlSize 1 PrivateTag +(0029,"Silhouette Annot V1.0",32) LT AnnotationMarkerColor 1 PrivateTag +(0029,"Silhouette Annot V1.0",33) UL AnnotationMarkerType 1 PrivateTag +(0029,"Silhouette Annot V1.0",34) UL AnnotationMarkerSize 1 PrivateTag +(0029,"Silhouette Annot V1.0",35) FD AnnotationMarkerLocation 1 PrivateTag +(0029,"Silhouette Annot V1.0",36) UL AnnotationMarkerAttachMode 1 PrivateTag +(0029,"Silhouette Annot V1.0",37) LT AnnotationGeomColor 1 PrivateTag +(0029,"Silhouette Annot V1.0",38) UL AnnotationGeomThickness 1 PrivateTag +(0029,"Silhouette Annot V1.0",39) UL AnnotationGeomLineStyle 1 PrivateTag +(0029,"Silhouette Annot V1.0",40) UL AnnotationGeomDashLength 1 PrivateTag +(0029,"Silhouette Annot V1.0",41) UL AnnotationGeomFillPattern 1 PrivateTag +(0029,"Silhouette Annot V1.0",42) UL AnnotationInteractivity 1 PrivateTag +(0029,"Silhouette Annot V1.0",43) FD AnnotationArrowLength 1 PrivateTag +(0029,"Silhouette Annot V1.0",44) FD AnnotationArrowAngle 1 PrivateTag +(0029,"Silhouette Annot V1.0",45) UL AnnotationDontSave 1 PrivateTag + +(0029,"Silhouette Graphics Export V1.0",00) UI Unknown 1 PrivateTag + +(0029,"Silhouette Line V1.0",11) IS LineName 1 PrivateTag +(0029,"Silhouette Line V1.0",12) LT LineNameFont 1 PrivateTag +(0029,"Silhouette Line V1.0",13) UL LineNameDisplay 1 PrivateTag +(0029,"Silhouette Line V1.0",14) LT LineNormalColor 1 PrivateTag +(0029,"Silhouette Line V1.0",15) UL LineType 1 PrivateTag +(0029,"Silhouette Line V1.0",16) UL LineThickness 1 PrivateTag +(0029,"Silhouette Line V1.0",17) UL LineStyle 1 PrivateTag +(0029,"Silhouette Line V1.0",18) UL LineDashLength 1 PrivateTag +(0029,"Silhouette Line V1.0",19) UL LineInteractivity 1 PrivateTag +(0029,"Silhouette Line V1.0",20) LT LineMeasurementColor 1 PrivateTag +(0029,"Silhouette Line V1.0",21) LT LineMeasurementFont 1 PrivateTag +(0029,"Silhouette Line V1.0",22) UL LineMeasurementDashLength 1 PrivateTag +(0029,"Silhouette Line V1.0",23) UL LinePointSpace 1 PrivateTag +(0029,"Silhouette Line V1.0",24) FD LinePoints 1 PrivateTag +(0029,"Silhouette Line V1.0",25) UL LineControlPointSize 1 PrivateTag +(0029,"Silhouette Line V1.0",26) UL LineControlPointSpace 1 PrivateTag +(0029,"Silhouette Line V1.0",27) FD LineControlPoints 1 PrivateTag +(0029,"Silhouette Line V1.0",28) LT LineLabel 1 PrivateTag +(0029,"Silhouette Line V1.0",29) UL LineDontSave 1 PrivateTag + +(0029,"Silhouette ROI V1.0",11) IS ROIName 1 PrivateTag +(0029,"Silhouette ROI V1.0",12) LT ROINameFont 1 PrivateTag +(0029,"Silhouette ROI V1.0",13) LT ROINormalColor 1 PrivateTag +(0029,"Silhouette ROI V1.0",14) UL ROIFillPattern 1 PrivateTag +(0029,"Silhouette ROI V1.0",15) UL ROIBpSeg 1 PrivateTag +(0029,"Silhouette ROI V1.0",16) UN ROIBpSegPairs 1 PrivateTag +(0029,"Silhouette ROI V1.0",17) UL ROISeedSpace 1 PrivateTag +(0029,"Silhouette ROI V1.0",18) UN ROISeeds 1 PrivateTag +(0029,"Silhouette ROI V1.0",19) UL ROILineThickness 1 PrivateTag +(0029,"Silhouette ROI V1.0",20) UL ROILineStyle 1 PrivateTag +(0029,"Silhouette ROI V1.0",21) UL ROILineDashLength 1 PrivateTag +(0029,"Silhouette ROI V1.0",22) UL ROIInteractivity 1 PrivateTag +(0029,"Silhouette ROI V1.0",23) UL ROINamePosition 1 PrivateTag +(0029,"Silhouette ROI V1.0",24) UL ROINameDisplay 1 PrivateTag +(0029,"Silhouette ROI V1.0",25) LT ROILabel 1 PrivateTag +(0029,"Silhouette ROI V1.0",26) UL ROIShape 1 PrivateTag +(0029,"Silhouette ROI V1.0",27) FD ROIShapeTilt 1 PrivateTag +(0029,"Silhouette ROI V1.0",28) UL ROIShapePointsCount 1 PrivateTag +(0029,"Silhouette ROI V1.0",29) UL ROIShapePointsSpace 1 PrivateTag +(0029,"Silhouette ROI V1.0",30) FD ROIShapePoints 1 PrivateTag +(0029,"Silhouette ROI V1.0",31) UL ROIShapeControlPointsCount 1 PrivateTag +(0029,"Silhouette ROI V1.0",32) UL ROIShapeControlPointsSpace 1 PrivateTag +(0029,"Silhouette ROI V1.0",33) FD ROIShapeControlPoints 1 PrivateTag +(0029,"Silhouette ROI V1.0",34) UL ROIDontSave 1 PrivateTag + +(0029,"Silhouette Sequence Ids V1.0",41) SQ Unknown 1 PrivateTag +(0029,"Silhouette Sequence Ids V1.0",42) SQ Unknown 1 PrivateTag +(0029,"Silhouette Sequence Ids V1.0",43) SQ Unknown 1 PrivateTag + +(0029,"Silhouette V1.0",13) UL Unknown 1 PrivateTag +(0029,"Silhouette V1.0",14) UL Unknown 1 PrivateTag +(0029,"Silhouette V1.0",17) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",18) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",19) UL Unknown 1 PrivateTag +(0029,"Silhouette V1.0",1a) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",1b) UL Unknown 1 PrivateTag +(0029,"Silhouette V1.0",1c) UL Unknown 1 PrivateTag +(0029,"Silhouette V1.0",1d) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",1e) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",21) US Unknown 1 PrivateTag +(0029,"Silhouette V1.0",22) US Unknown 1 PrivateTag +(0029,"Silhouette V1.0",23) US Unknown 1 PrivateTag +(0029,"Silhouette V1.0",24) US Unknown 1 PrivateTag +(0029,"Silhouette V1.0",25) US Unknown 1 PrivateTag +(0029,"Silhouette V1.0",27) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",28) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",29) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",30) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",52) US Unknown 1 PrivateTag +(0029,"Silhouette V1.0",53) LT Unknown 1 PrivateTag +(0029,"Silhouette V1.0",54) UN Unknown 1 PrivateTag +(0029,"Silhouette V1.0",55) LT Unknown 1 PrivateTag +(0029,"Silhouette V1.0",56) LT Unknown 1 PrivateTag +(0029,"Silhouette V1.0",57) UN Unknown 1 PrivateTag + +(0135,"SONOWAND AS",10) LO UltrasoundScannerName 1 PrivateTag +(0135,"SONOWAND AS",11) LO TransducerSerial 1 PrivateTag +(0135,"SONOWAND AS",12) LO ProbeApplication 1 PrivateTag + +(0017,"SVISION",00) LO ExtendedBodyPart 1 PrivateTag +(0017,"SVISION",10) LO ExtendedViewPosition 1 PrivateTag +(0017,"SVISION",F0) IS ImagesSOPClass 1 PrivateTag +(0019,"SVISION",00) IS AECField 1 PrivateTag +(0019,"SVISION",01) IS AECFilmScreen 1 PrivateTag +(0019,"SVISION",02) IS AECDensity 1 PrivateTag +(0019,"SVISION",10) IS PatientThickness 1 PrivateTag +(0019,"SVISION",18) IS BeamDistance 1 PrivateTag +(0019,"SVISION",20) IS WorkstationNumber 1 PrivateTag +(0019,"SVISION",28) IS TubeNumber 1 PrivateTag +(0019,"SVISION",30) IS BuckyGrid 1 PrivateTag +(0019,"SVISION",34) IS Focus 1 PrivateTag +(0019,"SVISION",38) IS Child 1 PrivateTag +(0019,"SVISION",40) IS CollimatorDistanceX 1 PrivateTag +(0019,"SVISION",41) IS CollimatorDistanceY 1 PrivateTag +(0019,"SVISION",50) IS CentralBeamHeight 1 PrivateTag +(0019,"SVISION",60) IS BuckyAngle 1 PrivateTag +(0019,"SVISION",68) IS CArmAngle 1 PrivateTag +(0019,"SVISION",69) IS CollimatorAngle 1 PrivateTag +(0019,"SVISION",70) IS FilterNumber 1 PrivateTag +(0019,"SVISION",74) LO FilterMaterial1 1 PrivateTag +(0019,"SVISION",75) LO FilterMaterial2 1 PrivateTag +(0019,"SVISION",78) DS FilterThickness1 1 PrivateTag +(0019,"SVISION",79) DS FilterThickness2 1 PrivateTag +(0019,"SVISION",80) IS BuckyFormat 1 PrivateTag +(0019,"SVISION",81) IS ObjectPosition 1 PrivateTag +(0019,"SVISION",90) LO DeskCommand 1 PrivateTag +(0019,"SVISION",A0) DS ExtendedExposureTime 1 PrivateTag +(0019,"SVISION",A1) DS ActualExposureTime 1 PrivateTag +(0019,"SVISION",A8) DS ExtendedXRayTubeCurrent 1 PrivateTag +(0021,"SVISION",00) DS NoiseReduction 1 PrivateTag +(0021,"SVISION",01) DS ContrastAmplification 1 PrivateTag +(0021,"SVISION",02) DS EdgeContrastBoosting 1 PrivateTag +(0021,"SVISION",03) DS LatitudeReduction 1 PrivateTag +(0021,"SVISION",10) LO FindRangeAlgorithm 1 PrivateTag +(0021,"SVISION",11) DS ThresholdCAlgorithm 1 PrivateTag +(0021,"SVISION",20) LO SensometricCurve 1 PrivateTag +(0021,"SVISION",30) DS LowerWindowOffset 1 PrivateTag +(0021,"SVISION",31) DS UpperWindowOffset 1 PrivateTag +(0021,"SVISION",40) DS MinPrintableDensity 1 PrivateTag +(0021,"SVISION",41) DS MaxPrintableDensity 1 PrivateTag +(0021,"SVISION",90) DS Brightness 1 PrivateTag +(0021,"SVISION",91) DS Contrast 1 PrivateTag +(0021,"SVISION",92) DS ShapeFactor 1 PrivateTag +(0023,"SVISION",00) LO ImageLaterality 1 PrivateTag +(0023,"SVISION",01) IS LetterPosition 1 PrivateTag +(0023,"SVISION",02) IS BurnedInAnnotation 1 PrivateTag +(0023,"SVISION",03) LO Unknown 1 PrivateTag +(0023,"SVISION",F0) IS ImageSOPClass 1 PrivateTag +(0025,"SVISION",00) IS OriginalImage 1 PrivateTag +(0025,"SVISION",01) IS NotProcessedImage 1 PrivateTag +(0025,"SVISION",02) IS CutOutImage 1 PrivateTag +(0025,"SVISION",03) IS DuplicatedImage 1 PrivateTag +(0025,"SVISION",04) IS StoredImage 1 PrivateTag +(0025,"SVISION",05) IS RetrievedImage 1 PrivateTag +(0025,"SVISION",06) IS RemoteImage 1 PrivateTag +(0025,"SVISION",07) IS MediaStoredImage 1 PrivateTag +(0025,"SVISION",08) IS ImageState 1 PrivateTag +(0025,"SVISION",20) LO SourceImageFile 1 PrivateTag +(0025,"SVISION",21) UI Unknown 1 PrivateTag +(0027,"SVISION",00) IS NumberOfSeries 1 PrivateTag +(0027,"SVISION",01) IS NumberOfStudies 1 PrivateTag +(0027,"SVISION",10) DT OldestSeries 1 PrivateTag +(0027,"SVISION",11) DT NewestSeries 1 PrivateTag +(0027,"SVISION",12) DT OldestStudy 1 PrivateTag +(0027,"SVISION",13) DT NewestStudy 1 PrivateTag + +(0009,"TOSHIBA_MEC_1.0",01) LT Unknown 1 PrivateTag +(0009,"TOSHIBA_MEC_1.0",02) US Unknown 1-n PrivateTag +(0009,"TOSHIBA_MEC_1.0",03) US Unknown 1-n PrivateTag +(0009,"TOSHIBA_MEC_1.0",04) US Unknown 1-n PrivateTag +(0011,"TOSHIBA_MEC_1.0",01) LT Unknown 1 PrivateTag +(0011,"TOSHIBA_MEC_1.0",02) US Unknown 1-n PrivateTag +(0019,"TOSHIBA_MEC_1.0",01) US Unknown 1-n PrivateTag +(0019,"TOSHIBA_MEC_1.0",02) US Unknown 1-n PrivateTag +(0021,"TOSHIBA_MEC_1.0",01) US Unknown 1-n PrivateTag +(0021,"TOSHIBA_MEC_1.0",02) US Unknown 1-n PrivateTag +(0021,"TOSHIBA_MEC_1.0",03) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_1.0",01) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_1.0",02) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_1.0",03) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_1.0",10) US Unknown 1-n PrivateTag + +(0019,"TOSHIBA_MEC_CT_1.0",01) IS Unknown 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",02) IS Unknown 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",03) US Unknown 1-n PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",04) LT Unknown 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",05) LT Unknown 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",06) US Unknown 1-n PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",07) US Unknown 1-n PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",08) LT OrientationHeadFeet 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",09) LT ViewDirection 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",0a) LT OrientationSupineProne 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",0b) DS Unknown 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",0c) US Unknown 1-n PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",0d) TM Time 1 PrivateTag +(0019,"TOSHIBA_MEC_CT_1.0",0e) DS Unknown 1 PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",01) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",02) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",03) IS Unknown 1 PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",04) IS Unknown 1 PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",05) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",07) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",08) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",09) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",0a) LT Unknown 1 PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",0b) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",0c) US Unknown 1-n PrivateTag +(7ff1,"TOSHIBA_MEC_CT_1.0",0d) US Unknown 1-n PrivateTag +# +# end of private.dic +# diff --git a/dcmdata/docs/CMakeLists.txt b/dcmdata/docs/CMakeLists.txt new file mode 100644 index 00000000..26d0ac5f --- /dev/null +++ b/dcmdata/docs/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES datadict.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc) diff --git a/dcmdata/docs/Makefile.in b/dcmdata/docs/Makefile.in new file mode 100644 index 00000000..db2b71f6 --- /dev/null +++ b/dcmdata/docs/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmdata/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = datadict.txt + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(docdir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(docdir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmdata/docs/cda2dcm.man b/dcmdata/docs/cda2dcm.man new file mode 100644 index 00000000..3cc31a45 --- /dev/null +++ b/dcmdata/docs/cda2dcm.man @@ -0,0 +1,258 @@ +/*! + +\if MANPAGES +\page cda2dcm Encapsulate CDA file into DICOM file format +\else +\page cda2dcm cda2dcm: Encapsulate CDA file into DICOM file format +\endif + +\section cda2dcm_synopsis SYNOPSIS + +\verbatim +cda2dcm [options] cdafile-in dcmfile-out +\endverbatim + +\section cda2dcm_description DESCRIPTION + +The \b cda2dcm utility reads a CDA file (\e cdafile-in), converts it to a +DICOM Encapsulated CDA Storage SOP instance and stores the converted data +to an output file (\e dcmfile-out). + +\section cda2dcm_parameters PARAMETERS + +\verbatim +cdafile-in CDA input filename to be encapsulated + +dcmfile-out DICOM output filename +\endverbatim + +\section cda2dcm_options OPTIONS + +\subsection cda2dcm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection cda2dcm_dicom_document_options DICOM document options +\verbatim +document title: + + +t --title [t]itle: string (default: empty) + document title + + +cn --concept-name [CSD] [CV] [CM]: string (default: empty) + coded representation of document title defined by coding + scheme designator CSD, code value CV and code meaning CM + +patient data: + + +pn --patient-name [n]ame: string + patient's name in DICOM PN syntax + + +pi --patient-id [i]d: string + patient identifier + + +pb --patient-birthdate [d]ate: string (YYYYMMDD) + patient's birth date + + +ps --patient-sex [s]ex: string (M, F or O) + patient's sex + +study and series: + + +sg --generate + generate new study and series UIDs (default) + + +st --study-from [f]ilename: string + read patient/study data from DICOM file + + +se --series-from [f]ilename: string + read patient/study/series data from DICOM file + +instance number: + + +i1 --instance-one + use instance number 1 (default, not with +se) + + +ii --instance-inc + increment instance number (only with +se) + + +is --instance-set [i]nstance number: integer + use instance number i + +burned-in annotation: + + +an --annotation-yes + document contains patient identifying data (default) + + -an --annotation-no + document does not contain patient identifying data + +override CDA file data: + + -ov --no-override + CDA patient and document data must match study, + series or manually entered information (default) + + +ov --override + data obtained from the CDA file will be overwritten + by study, series, or manually entered information +\endverbatim + +\subsection cda2dcm_processing_options processing options +\verbatim +other processing options: + + -k --key [k]ey: gggg,eeee="str", path or dictionary name="str" + add further attribute +\endverbatim + +\subsection cda2dcm_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section cda2dcm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section cda2dcm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section cda2dcm_exit_codes EXIT CODES + +The \b cda2dcm utility uses the following exit codes when terminating. This +enables the user to check for the reason why the application terminated. + +\subsection cda2dcm_exit_codes_general general +\verbatim +EXITCODE_NO_ERROR 0 +EXITCODE_COMMANDLINE_SYNTAX_ERROR 1 +EXITCODE_MEMORY_EXHAUSTED 4 +\endverbatim + +\subsection cda2dcm_exit_codes_input_file_errors input file errors +\verbatim +EXITCODE_CANNOT_READ_INPUT_FILE 20 +EXITCODE_NO_INPUT_FILES 21 +EXITCODE_INVALID_INPUT_FILE 22 +\endverbatim + +\subsection cda2dcm_exit_codes_output_file_errors output file errors +\verbatim +EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40 +\endverbatim + +\section cda2dcm_environment ENVIRONMENT + +The \b cda2dcm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment +variable. +It is an error if no data dictionary can be loaded. + +\section cda2dcm_copyright COPYRIGHT + +Copyright (C) 2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/datadict.txt b/dcmdata/docs/datadict.txt new file mode 100644 index 00000000..bde9db1d --- /dev/null +++ b/dcmdata/docs/datadict.txt @@ -0,0 +1,223 @@ +----------------------------------------------------------------------------- +DICOM DATA DICTIONARY IN DCMTK +----------------------------------------------------------------------------- + +In DICOM, the Data Dictionary (part 6 of the DICOM standard) stores for all +tags their respective VR, VM, attribute name and other information. This +information must also be made available in DCMTK. This is accomplished +through a global data dictionary class. + +The global data dictionary is loaded within a C++ constructor into the global +DcmDataDictionary class instance called dcmDataDict once it is accessed for +the first time from the code. The dictionary content is populated by three +different approaches: Either the content (tags, VR, ...) can be compiled +into the dictionary code, or the dictionary is filled by loading a text file +on startup from a pre-defined file path (also called an "external" data +dictionary). Lastly, DCMTK will load one or more additional external +dictionaries from the path set in the environment variable DCMDICTPATH, if set. + +The built-in approach offers the advantage that a binary will not have to +load any information from a separate file, which may get lost or used in an +outdated version. Loading the dictionary content from a separate file, +however, has the advantage that application programs need not be recompiled +if additions or corrections are made to the data dictionary. + +By default, DCMTK uses an external data dictionary on Posix systems (Linux, +Mac OS X, etc.) while a built-in dictionary is used on Windows systems. How +these defaults can be changed or how both approaches can even be combined is +further explained below. + +----------------------------------------------------------------------------- +DICTIONARY DEFAULT: AUTOCONF ON POSIX SYSTEMS +----------------------------------------------------------------------------- + +By default on a Posix system the global data dictionary will attempt to load +the data dictionary from an external file. The location is pre-configured +to $DCMTK_DAT_DIR/dicom.dic where $DCMTK_DAT_DIR is DCMTK's data installation +directory chosen using configure's --datadir option (default value: /dcmtk). +See also --datarootdir and --prefix options. The resulting path is stored as +DCM_DICT_DEFAULT_PATH in the file config/include/dcmtk/config/osconfig.h, +which is created by Autoconf during the execution of the configure script and +thus is available to the dictionary code that includes osconfig.h. + +----------------------------------------------------------------------------- +DICTIONARY DEFAULT: CMAKE ON WINDOWS AND POSIX SYSTEMS +----------------------------------------------------------------------------- + +On Windows, the default behavior is to compile a fully-populated DICOM +dictionary as global data dictionary into the dcmdata library. Thus, it is +not required to load an external data dictionary from a file. However, +usage of external dictionaries is still possible on Windows by setting the +environment variable DCMDICTPATH accordingly (see further details below). + +On Posix systems, the default setting is to load the data dictionary from an +external file (as described in the above section on Autoconf). + +----------------------------------------------------------------------------- +CHANGING DICTIONARY DEFAULTS +----------------------------------------------------------------------------- + +Autoconf as well as CMake provide options to change their default dictionary +behavior. For Autoconf, configure offers the options: + + --enable-external-dict enable loading of external dictionary (default) + --disable-external-dict don't load external dictionary + --enable-builtin-dict enable loading of built-in dictionary (default) + --disable-builtin-dict don't load built-in dictionary + +They can be used to toggle both dictionaries on and off: If the external +dictionary is turned off, it is not tried to load it from any default +location. + +When building with CMake, the related options are called + + - DCMTK_ENABLE_EXTERNAL_DICTIONARY + - DCMTK_ENABLE_BUILTIN_DICTIONARY + +----------------------------------------------------------------------------- +DICTIONARY LOAD ORDER AND USING MULTIPLE DICTIONARIES +----------------------------------------------------------------------------- + +The built-in dictionary, if enabled, is always loaded first on startup, +followed by any external dictionary. Data dictionary entries loaded later in +the load sequence override entries loaded earlier. + +Note that most of the time (no matter whether using Autoconf or CMake) it +makes sense to enable only the built-in dictionary or only the external +dictionary. If both external and built-in version are enabled, the global +data dictionary is populated first with the compiled-in data, and afterwards +the external dictionary is loaded. If the latter is the one shipped with +DCMTK (dicom.dic) then the external dictionary provides no extra information +since it contains exactly the same data as the built-in one but only takes +time for loading. Thus it only makes sense to enable both options if the +external dictionary is modified to include (only) additional information not +available in the built-in dictionary. + +If the user disables both options, no dictionary will be loaded by default +on startup. However, a dictionary can be defined using the DCMDICTPATH +environment variable (see below). If DCMDICTPATH is used, the default +external dictionary will not be loaded at all. + +Application programs should check that a data dictionary has been loaded +before using the functionality of the dcmdata library. The absence of +a data dictionary is likely to cause unexpected behavior (e.g. unknown +attributes will be encoded using VR=UN). + +----------------------------------------------------------------------------- +CUSTOM EXTERNAL DICTIONARIES THROUGH ENVIRONMENT VARIABLE "DCMDICTPATH" +----------------------------------------------------------------------------- + +Sometimes it makes sense to change the dictionary that should be loaded +without recompiling the source code. This can be done either by modifying +the dicom.dic that is already loaded, or, by specifying a different location +in an environment variable that is evaluated on DCMTK startup. That +environment variable is called "DCMDICTPATH" and is considered on Windows +and Posix platforms. If DCMDICTPATH is not set, the behavior described in +the sections above takes place (built-in and/or external dictionary from +default path is loaded). + +Otherwise, the file provided in the environment variable DCMDICTPATH is loaded +and any default external dictionary is ignored (!). However, note that the +built-in dictionary (if configured) will be always loaded. + +In order to set DCMDICTPATH on Unix, the csh shell command + + setenv DCMDICTPATH $HOME/dicom.dic + +would cause all applications using the dcmdata library to load the data +dictionary dicom.dic from the users home directory. + +For Windows, the call + + set DCMDICTPATH=c:\dicom.dic + +will cause all applications using the dcmdata library to load the data +dictionary dicom.dic from the main directory on drive C. + +----------------------------------------------------------------------------- +USING MORE THAN ONE EXTERNAL DICTIONARY +----------------------------------------------------------------------------- + +The DCMDICTPATH environment variable can even refer to several data +dictionaries separated by colons (":") on Unix systems, or semicolons (";") +on Windows systems. Thus the Unix csh command: + + setenv DCMDICTPATH /usr/local/share/dcmtk/dicom.dic:$HOME/dicom.dic + +would cause all applications using the dcmdata library to first load the +default data dictionary and subsequently load the data dictionary dicom.dic +from the user's home directory. On Windows systems, an example would be: + + set DCMDICTPATH=c:\dcmtk-install\share\dcmtk\dicom.dic;c:\dicom.dic + +Also here, data dictionary entries loaded later in the load sequence override +entries loaded earlier. + +----------------------------------------------------------------------------- +DATA DICTIONARIES INCLUDED IN DCMTK (DICOM.DIC, PRIVATE.DIC AND BUILT-IN) +----------------------------------------------------------------------------- + +An example DICOM data dictionary can be found in dcmdata/data/dicom.dic, +which is also installed (using Autoconf or CMake) and used as the default +external dictionary (if external default dictionary is enabled). + +The example data dictionary is is meant to be complete and includes all +standard and retired tags from part 6 of the DICOM standard (see the header of +the file where the implemented version of the standard plus all supplements +and CPs are listed). Also contained, since they are included in part 6, are +the official DICONDE (Digital Imaging and Communication in Nondestructive +Evaluation) and DICOS (Digital Imaging and Communications in Security) tags. + +Another example dictionary included is the dcmdata/data/private.dic, which +includes all private tag information known to DCMTK developers and partly +taken over from other DICOM toolkits and various other sources like DICOM +Conformance Statements. There is no guarantee that the tag information +contained is valid or even complete. By default, this dictionary is not +taken into account. It can be enabled to load on startup as an extra +external dictionary using Autoconf's configure option "--enable-private-tags" +and in CMake using the option "DCMTK_ENABLE_PRIVATE_TAGS". Enabling will +result in private.dic being added to the DCM_DICT_DEFAULT_PATH, which lists +those external dictionaries to be loaded on startup (see above). Note that +the private tag option is only considered for external dictionaries if +external dictionaries are not turned off. + +DCMTK also includes two predefined built-in dictionaries, one fully populated +containing the information from DCMTK's dicom.dic file, and one that is empty. +Both are defined in dcdictbi.cc and the one to be used is selected by the +built-in dictionary build options (see above). + +The code for a useful built-in data dictionary can be regenerated at any time +by the mkdictbi program (dcmdata/libsrc/mkdictbi). The dcmdata library +Makefiles (for Autoconf dcmdata/libsrc/Makefile.in, and for CMake +dcmdata/libsrc/CMakeLists.txt) include a target (updatebuiltindict) for this +purpose. After regenerating dcdictbi.cc, rebuilding the libdcmdata.a library +and relinking all your applications will ensure that the built-in data +dictionary is used. + +----------------------------------------------------------------------------- +TAG NAME CONSTANTS FOR USE IN APPLICATIONS +----------------------------------------------------------------------------- + +The include file dcmdata/include/dcmtk/dcmdata/dcdeftag.h can be generated +from a data dictionary by the program mkdeftag. The include file defines tag +names for use in application programs. The names are generated from the names +specified in the data dictionary. Duplicate names in the data dictionary will +result in compiler warnings due to duplicate #define's when compiling code +that includes the dcdeftag.h header file. Thus, when adding new entries to +the data dictionary, care should be taken to ensure that attribute names are +not duplicated for distinct tags. + +The dcmdata library Makefiles (for Autoconf dcmdata/libsrc/Makefile.in and for +CMake dcmdata/libsrc/CMakeLists.txt) include a target (updatedeftag) that +builds the mkdeftag tool and uses it to generate the +dcmdata/include/dcmtk/dcmdata/dcdeftag.h header file. The header file should +be regenerated whenever additions or name modifications are made to the data +dictionary. Care should be taken before modifying any tag names since +existing application programs may already use the old name and might +subsequently fail to compile. + +------------ + +DCMTK Development Team, Oldenburg, Germany + +Last revised: 2018-09-04 (Onken). diff --git a/dcmdata/docs/dcm2json.man b/dcmdata/docs/dcm2json.man new file mode 100644 index 00000000..f432b05e --- /dev/null +++ b/dcmdata/docs/dcm2json.man @@ -0,0 +1,355 @@ +/*! + +\if MANPAGES +\page dcm2json Convert DICOM file and data set to JSON +\else +\page dcm2json dcm2json: Convert DICOM file and data set to JSON +\endif + +\section dcm2json_synopsis SYNOPSIS + +\verbatim +dcm2json [options] dcmfile-in [jsonfile-out] +\endverbatim + +\section dcm2json_description DESCRIPTION + +The \b dcm2json utility converts the contents of a DICOM file (file format or +raw data set) to JSON (JavaScript Object Notation). The output refers to the +"DICOM JSON Model", which is found in DICOM Part 18 Section F. + +If \b dcm2json reads a raw data set (DICOM data without a file format +meta-header) it will attempt to guess the transfer syntax by examining the +first few bytes of the file. It is not always possible to correctly guess the +transfer syntax and it is better to convert a data set to a file format +whenever possible (using the \b dcmconv utility). It is also possible to use +the \e -f and -t[ieb] options to force \b dcm2json to read a data set +with a particular transfer syntax. + +\section dcm2json_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +jsonfile-out JSON output filename (default: stdout) +\endverbatim + +\section dcm2json_options OPTIONS + +\subsection dcm2json_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcm2json_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcm2json_output_options output options +\verbatim +output format: + + +fc --formatted-code + enable whitespace formatting (default) + + # prints additional spaces and newlines for increased + # readability + + -fc --compact-code + print only required characters + + +m --write-meta + write data set with meta information + (warning: not conforming to the DICOM standard) +\endverbatim + +\section dcm2json_json_format JSON Format + +The basic structure of the JSON output created from a DICOM file looks like +the following (see DICOM Part 18 Section F for details): + +\verbatim +{ + "00080005": { + "vr": "CS", + "Value": [ + "ISO_IR 192" + ] + }, + "00080020": { + "vr": "DT", + "Value": [ + "20130409" + ] + }, + "00080030": { + "vr": "TM", + "Value": [ + "131600.0000" + ] + }, + "00080050": { + "vr": "SH", + "Value": [ + "11235813" + ] + }, + "00080056": { + "vr": "CS", + "Value": [ + "ONLINE" + ] + }, + "00080061": { + "vr": "CS", + "Value": [ + "CT", + "PET" + ] + }, + "00080090": { + "vr": "PN", + "Value": [ + { + "Alphabetic": "^Bob^^Dr." + } + ] + }, + "00081190": { + "vr": "UR", + "Value": [ + "http://wado.nema.org/studies/ + 1.2.392.200036.9116.2.2.2.1762893313.1029997326.945873" + ] + }, + "00090010": { + "vr": "LO", + "Value": [ + "Vendor A" + ] + }, + "00091002": { + "vr": "UN", + "InlineBinary": "z0x9c8v7" + }, + "00100010": { + "vr": "PN", + "Value": [ + { + "Alphabetic": "Wang^XiaoDong" + } + ] + }, + "00100020": { + "vr": "LO", + "Value": [ + "12345" + ] + }, + "00100021": { + "vr": "LO", + "Value": [ + "Hospital A" + ] + }, + "00100030": { + "vr": "DT", + "Value": [ + "19670701" + ] + }, + "00100040": { + "vr": "CS", + "Value": [ + "M" + ] + }, + "00101002": { + "vr": "SQ", + "Value": [ + { + "00100020": { + "vr": "LO", + "Value": [ + "54321" + ] + }, + "00100021": { + "vr": "LO", + "Value": [ + "Hospital B" + ] + } + }, + { + "00100020": { + "vr": "LO", + "Value": [ + "24680" + ] + }, + "00100021": { + "vr": "LO", + "Value": [ + "Hospital C" + ] + } + } + ] + }, + "0020000D": { + "vr": "UI", + "Value": [ + "1.2.392.200036.9116.2.2.2.1762893313.1029997326.945873" + ] + }, + "00200010": { + "vr": "SH", + "Value": [ + "11235813" + ] + }, + "00201206": { + "vr": "IS", + "Value": [ + 4 + ] + }, + "00201208": { + "vr": "IS", + "Value": [ + 942 + ] + } +} +\endverbatim + +\subsection dcm2json_bulk_data Bulk Data + +Binary data, i.e. DICOM element values with Value Representations (VR) of OB +or OW, as well as OD, OF and UN values are by default not written to the JSON +output because of their size. Instead, for each element, a new Universally +Unique Identifier (UUID) is being generated and written as an value of a +BulkDataURI JSON element. So far, there is no possibility to write an +additional file to hold the binary data for each of the binary data chunks. + +\section dcm2json_notes NOTES + +\subsection dcm2json_character_encoding Character Encoding + +\b dcm2json always tries to output in UTF-8 encoding. If this is not possible, +e.g. because there is no support for character set conversion, ASCII is used +instead (which is a subset of UTF-8). + +\section dcm2json_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcm2json_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcm2json_environment ENVIRONMENT + +The \b dcm2json utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcm2json_copyright COPYRIGHT + +Copyright (C) 2016-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcm2pdf.man b/dcmdata/docs/dcm2pdf.man new file mode 100644 index 00000000..d508af6b --- /dev/null +++ b/dcmdata/docs/dcm2pdf.man @@ -0,0 +1,211 @@ +/*! + +\if MANPAGES +\page dcm2pdf Extract PDF file from DICOM encapsulated PDF +\else +\page dcm2pdf dcm2pdf: Extract PDF file from DICOM encapsulated PDF +\endif + +\section dcm2pdf_synopsis SYNOPSIS + +\verbatim +dcm2pdf [options] dcmfile-in pdffile-out +\endverbatim + +\section dcm2pdf_description DESCRIPTION + +The \b dcm2pdf utility reads a DICOM file of the Encapsulated PDF Storage SOP +Class (\e dcmfile-in), extracts the embedded PDF document and writes it to an +output file (\e pdffile-out). Optionally a command can be executed after the +creation of the PDF file. + +\section dcm2pdf_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename + +pdffile-out PDF output filename +\endverbatim + +\section dcm2pdf_options OPTIONS + +\subsection dcm2pdf_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcm2pdf_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS + +parsing of odd-length attributes: + + +ao --accept-odd-length + accept odd length attributes (default) + + +ae --assume-even-length + assume real length is one byte larger + +handling of undefined length UN elements: + + +ui --enable-cp246 + read undefined len UN as implicit VR (default) + + -ui --disable-cp246 + read undefined len UN as explicit VR + +handling of defined length UN elements: + + -uc --retain-un + retain elements as UN (default) + + +uc --convert-un + convert to real VR if known + +automatic data correction: + + +dc --enable-correction + enable automatic data correction (default) + + -dc --disable-correction + disable automatic data correction + +bitstream format of deflated input: + + +bd --bitstream-deflated + expect deflated bitstream (default) + + +bz --bitstream-zlib + expect deflated zlib bitstream +\endverbatim + +\subsection dcm2pdf_execution_options execution options +\verbatim + -x --exec [c]ommand: string + execute command c after PDF extraction +\endverbatim + +\section dcm2pdf_notes NOTES + +Option \e --exec allows for the execution of a certain command line after the +creation of the PDF document. The command line to be executed is passed to +this option as a parameter. The specified command line may contain the +placeholder '\#f', which will be replaced by the PDF filename at run time. +The specified command line is executed in the foreground, i.e. \b pdf2dcm will +be blocked until the command terminates. + +\section dcm2pdf_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcm2pdf_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcm2pdf_environment ENVIRONMENT + +The \b dcm2pdf utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcm2pdf_see_also SEE ALSO + +pdf2dcm(1) + +\section dcm2pdf_copyright COPYRIGHT + +Copyright (C) 2007-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcm2xml.man b/dcmdata/docs/dcm2xml.man new file mode 100644 index 00000000..f2e58ec8 --- /dev/null +++ b/dcmdata/docs/dcm2xml.man @@ -0,0 +1,396 @@ +/*! + +\if MANPAGES +\page dcm2xml Convert DICOM file and data set to XML +\else +\page dcm2xml dcm2xml: Convert DICOM file and data set to XML +\endif + +\section dcm2xml_synopsis SYNOPSIS + +\verbatim +dcm2xml [options] dcmfile-in [xmlfile-out] +\endverbatim + +\section dcm2xml_description DESCRIPTION + +The \b dcm2xml utility converts the contents of a DICOM file (file format or +raw data set) to XML (Extensible Markup Language). There are two output +formats. The first one is specific to DCMTK with its DTD (Document Type +Definition) described in the file dcm2xml.dtd. The second one refers +to the "Native DICOM Model" which is specified for the DICOM Application +Hosting service found in DICOM part 19. + +If \b dcm2xml reads a raw data set (DICOM data without a file format +meta-header) it will attempt to guess the transfer syntax by examining the +first few bytes of the file. It is not always possible to correctly guess the +transfer syntax and it is better to convert a data set to a file format +whenever possible (using the \b dcmconv utility). It is also possible to use +the \e -f and -t[ieb] options to force \b dcm2xml to read a data set +with a particular transfer syntax. + +\section dcm2xml_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +xmlfile-out XML output filename (default: stdout) +\endverbatim + +\section dcm2xml_options OPTIONS + +\subsection dcm2xml_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcm2xml_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS + +long tag values: + + +M --load-all + load very long tag values (e.g. pixel data) + + -M --load-short + do not load very long values (default) + + +R --max-read-length [k]bytes: integer (4..4194302, default: 4) + set threshold for long values to k kbytes +\endverbatim + +\subsection dcm2xml_processing_options processing options +\verbatim +specific character set: + + +Cr --charset-require + require declaration of extended charset (default) + + +Ca --charset-assume [c]harset: string + assume charset c if no extended charset declared + + +Cc --charset-check-all + check all data elements with string values + (default: only PN, LO, LT, SH, ST, UC and UT) + + # this option is only used for the mapping to an appropriate + # XML character encoding, but not for the conversion to UTF-8 + + +U8 --convert-to-utf8 + convert all element values that are affected + by Specific Character Set (0008,0005) to UTF-8 + + # requires support from an underlying character encoding library + # (see output of --version on which one is available) +\endverbatim + +\subsection dcm2xml_output_options output options +\verbatim +general XML format: + + -dtk --dcmtk-format + output in DCMTK-specific format (default) + + -nat --native-format + output in Native DICOM Model format (part 19) + + +Xn --use-xml-namespace + add XML namespace declaration to root element + +DCMTK-specific format (not with --native-format): + + +Xd --add-dtd-reference + add reference to document type definition (DTD) + + +Xe --embed-dtd-content + embed document type definition into XML document + + +Xf --use-dtd-file [f]ilename: string + use specified DTD file (only with +Xe) + (default: /usr/local/share/dcmtk/dcm2xml.dtd) + + +Wn --write-element-name + write name of the DICOM data elements (default) + + -Wn --no-element-name + do not write name of the DICOM data elements + + +Wb --write-binary-data + write binary data of OB and OW elements + (default: off, be careful with --load-all) + +encoding of binary data: + + +Eh --encode-hex + encode binary data as hex numbers + (default for DCMTK-specific format) + + +Eu --encode-uuid + encode binary data as a UUID reference + (default for Native DICOM Model) + + +Eb --encode-base64 + encode binary data as Base64 (RFC 2045, MIME) +\endverbatim + +\section dcm2xml_dcmtk_format DCMTK Format + +The basic structure of the DCMTK-specific XML output created from a DICOM file +looks like the following: + +\verbatim + + + + + + 166 + + ... + + OFFIS_DCMTK_353 + + + + + ISO_IR 100 + + ... + + + + 256\\0\\8 + + ... + + ... + + ... + + + + +\endverbatim + +The "file-format" and "meta-header" tags are absent for DICOM data sets. + +\subsection dcm2xml_xml_encoding XML Encoding + +Attributes with very large value fields (e.g. pixel data) are not loaded by +default. They can be identified by the additional attribute "loaded" with a +value of "no" (see example above). The command line option \e --load-all +forces to load all value fields including the very long ones. + +Furthermore, binary data of OB and OW attributes are not written to the XML +output file by default. These elements can be identified by the additional +attribute "binary" with a value of "hidden" (default is "no"). The command line +option \e --write-binary-data causes also binary value fields to be printed +(attribute value is "yes" or "base64"). But, be careful when using this option +together with \e --load-all because of the large amounts of pixel data that +might be printed to the output. Please note that in this context element values +with a VR of OD, OF, OL and OV are not regarded as "binary data". + +Multiple values (i.e. where the DICOM value multiplicity is greater than 1) +are separated by a backslash "\" (except for Base64 encoded data). The "len" +attribute indicates the number of bytes for the particular value field as +stored in the DICOM data set, i.e. it might deviate from the XML encoded value +length e.g. because of non-significant padding that has been removed. If this +attribute is missing in "sequence" or "item" start tags, the corresponding +DICOM element has been stored with undefined length. + +\section dcm2xml_native_format Native DICOM Model Format + +The description of the Native DICOM Model format can be found in the DICOM +standard, part 19 ("Application Hosting"). + +\subsection dcm2xml_bulk_data Bulk Data + +Binary data, i.e. DICOM element values with Value Representations (VR) of OB +or OW, as well as OD, OF, OV and UN values are by default not written to the +XML output because of their size. Instead, for each element, a new Universally +Unique Identifier (UUID) is being generated and written as an attribute of a +\ XML element. So far, there is no possibility to write an +additional file to hold the binary data for each of the binary data chunks. +This is not required by the standard, however, it might be useful for +implementing an Application Hosting interface; thus this feature may be +available in future versions of \b dcm2xml. + +In addition, Supplement 163 (Store Over the Web by Representational State +Transfer Services) introduces a new \ XML element that allows +for encoding binary data as Base64. Currently, the command line option +\e --encode-base64 enables this encoding for the following VRs: OB, OD, OF, OV, +OW and UN. + +\subsection dcm2xml_known_issues Known Issues + +In addition to what is written in the above section on "Bulk Data", there are +further known issues with the current implementation of the Native DICOM Model +format. For example, large element values with a VR other than OB, OD, OF, OV, +OW or UN are currently never written as bulk data, although it might be useful, +e.g. for very long text elements (especially UT) or very long numeric fields +(of various VRs). + +\section dcm2xml_notes NOTES + +\subsection dcm2xml_character_encoding Character Encoding + +The XML encoding is determined automatically from the DICOM attribute +(0008,0005) "Specific Character Set" using the following mapping: + +\verbatim +ASCII (ISO_IR 6) => "UTF-8" +UTF-8 "ISO_IR 192" => "UTF-8" +ISO Latin 1 "ISO_IR 100" => "ISO-8859-1" +ISO Latin 2 "ISO_IR 101" => "ISO-8859-2" +ISO Latin 3 "ISO_IR 109" => "ISO-8859-3" +ISO Latin 4 "ISO_IR 110" => "ISO-8859-4" +ISO Latin 5 "ISO_IR 148" => "ISO-8859-9" +Cyrillic "ISO_IR 144" => "ISO-8859-5" +Arabic "ISO_IR 127" => "ISO-8859-6" +Greek "ISO_IR 126" => "ISO-8859-7" +Hebrew "ISO_IR 138" => "ISO-8859-8" +\endverbatim + +If this DICOM attribute is missing in the input file, although needed, option +\e --charset-assume can be used to specify an appropriate character set +manually (using one of the DICOM defined terms). For reasons of backward +compatibility with previous versions of this tool, the following terms are also +supported and mapped automatically to the associated DICOM defined terms: +latin-1, latin-2, latin-3, latin-4, latin-5, cyrillic, arabic, greek, hebrew. + +Multiple character sets using code extension techniques are not supported. If +needed, option \e --convert-to-utf8 can be used to convert the DICOM file or +data set to UTF-8 encoding prior to the conversion to XML format. This is also +useful for DICOMDIR files where each directory record can have a different +character set. + +If no mapping is defined and option \e --convert-to-utf8 is not used, non-ASCII +characters and those below #32 are stored as "&#nnn;" where "nnn" refers to the +numeric character code. This might lead to invalid character entity references +(such as "" for ESC) and will cause most XML parsers to reject the document. + +\section dcm2xml_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcm2xml_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcm2xml_environment ENVIRONMENT + +The \b dcm2xml utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcm2xml_files FILES + +\/dcm2xml.dtd - Document Type Definition (DTD) file + +\section dcm2xml_see_also SEE ALSO + +xml2dcm(1), dcmconv(1) + +\section dcm2xml_copyright COPYRIGHT + +Copyright (C) 2002-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcmconv.man b/dcmdata/docs/dcmconv.man new file mode 100644 index 00000000..3c947313 --- /dev/null +++ b/dcmdata/docs/dcmconv.man @@ -0,0 +1,392 @@ +/*! + +\if MANPAGES +\page dcmconv Convert DICOM file encoding +\else +\page dcmconv dcmconv: Convert DICOM file encoding +\endif + +\section dcmconv_synopsis SYNOPSIS + +\verbatim +dcmconv [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmconv_description DESCRIPTION + +The \b dcmconv utility reads a DICOM file (\e dcmfile-in), performs an encoding +conversion and writes the converted data to an output file (\e dcmfile-out). + +\section dcmconv_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename to write to +\endverbatim + +\section dcmconv_options OPTIONS + +\subsection dcmconv_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -l --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -l --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmconv_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS + +parsing of file meta information: + + +ml --use-meta-length + use file meta information group length (default) + + -ml --ignore-meta-length + ignore file meta information group length + +parsing of odd-length attributes: + + +ao --accept-odd-length + accept odd length attributes (default) + + +ae --assume-even-length + assume real length is one byte larger + +handling of explicit VR: + + +ev --use-explicit-vr + use explicit VR from dataset (default) + + -ev --ignore-explicit-vr + ignore explicit VR (prefer data dictionary) + +handling of non-standard VR: + + +vr --treat-as-unknown + treat non-standard VR as unknown (default) + + -vr --assume-implicit + try to read with implicit VR little endian TS + +handling of undefined length UN elements: + + +ui --enable-cp246 + read undefined len UN as implicit VR (default) + + -ui --disable-cp246 + read undefined len UN as explicit VR + +handling of defined length UN elements: + + -uc --retain-un + retain elements as UN (default) + + +uc --convert-un + convert to real VR if known + +handling of private max-length elements (implicit VR): + + -sq --maxlength-dict + read as defined in dictionary (default) + + +sq --maxlength-seq + read as sequence with undefined length + +handling of wrong delimitation items: + + -rd --use-delim-items + use delimitation items from dataset (default) + + +rd --replace-wrong-delim + replace wrong sequence/item delimitation items + +handling of illegal undefined length OB/OW elements: + + -oi --illegal-obow-rej + reject dataset with illegal element (default) + + +oi --illegal-obow-conv + convert undefined length OB/OW element to SQ + +handling of VOI LUT Sequence with OW VR and explicit length: + + -vi --illegal-voi-rej + reject dataset with illegal VOI LUT (default) + + +vi --illegal-voi-conv + convert illegal VOI LUT to SQ + +handling of explicit length pixel data for encaps. transfer syntaxes: + + -pe --abort-expl-pixdata + abort on explicit length pixel data (default) + + +pe --use-expl-pixdata + use explicit length pixel data + +general handling of parser errors: + + +Ep --ignore-parse-errors + try to recover from parse errors + + -Ep --handle-parse-errors + handle parse errors and stop parsing (default) + +other parsing options: + + +st --stop-after-elem [t]ag: "gggg,eeee" or dictionary name + stop parsing after element specified by t + +automatic data correction: + + +dc --enable-correction + enable automatic data correction (default) + + -dc --disable-correction + disable automatic data correction + +bitstream format of deflated input: + + +bd --bitstream-deflated + expect deflated bitstream (default) + + +bz --bitstream-zlib + expect deflated zlib bitstream +\endverbatim + +\subsection dcmconv_processing_options processing options +\verbatim +specific character set: + + # the following options require support from an underlying character + # encoding library (see output of --version on which one is available) + + +U8 --convert-to-utf8 + convert all element values that are affected + by Specific Character Set (0008,0005) to UTF-8 + + +L1 --convert-to-latin1 + convert affected element values to ISO 8859-1 + + +A7 --convert-to-ascii + convert affected element values to 7-bit ASCII + + +C --convert-to-charset [c]harset: string + convert affected element values to the character + set specified by the DICOM defined term c + + -Ct --transliterate + try to approximate characters that cannot be + represented through similar looking characters + + -Cd --discard-illegal + discard characters that cannot be represented + in destination character set + +other processing options: + + -ig --no-invalid-groups + remove elements with invalid group number +\endverbatim + +\subsection dcmconv_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + +Fm --write-new-meta-info + write file format with new meta information + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + + +td --write-xfer-deflated + write with deflated explicit VR little endian TS + + +tg --write-xfer-ge + write private GE implicit VR little endian + with big endian pixel data TS (non-standard) + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + + +eo --write-oversized + write oversized explicit length sequences + and items with undefined length (default) + + -eo --abort-oversized + abort on oversized explicit sequences/items + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes + +deflate compression level (only with --write-xfer-deflated): + + +cl --compression-level [l]evel: integer (default: 6) + 0=uncompressed, 1=fastest, 9=best compression +\endverbatim + +\section dcmconv_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmconv_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmconv_environment ENVIRONMENT + +The \b dcmconv utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmconv_see_also SEE ALSO + +dcmdump(1) + +\section dcmconv_copyright COPYRIGHT + +Copyright (C) 1994-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcmcrle.man b/dcmdata/docs/dcmcrle.man new file mode 100644 index 00000000..64ad7d5c --- /dev/null +++ b/dcmdata/docs/dcmcrle.man @@ -0,0 +1,263 @@ +/*! + +\if MANPAGES +\page dcmcrle Encode DICOM file to RLE transfer syntax +\else +\page dcmcrle dcmcrle: Encode DICOM file to RLE transfer syntax +\endif + +\section dcmcrle_synopsis SYNOPSIS + +\verbatim +dcmcrle [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmcrle_description DESCRIPTION + +The \b dcmcrle utility reads an uncompressed DICOM image (\e dcmfile-in), +performs RLE compression (i.e. conversion to an encapsulated DICOM transfer +syntax) and writes the converted image to an output file (\e dcmfile-out). + +\section dcmcrle_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmcrle_options OPTIONS + +\subsection dcmcrle_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmcrle_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmcrle_enc_pix_data_encoding_opt encapsulated pixel data encoding options +\verbatim +pixel data fragmentation: + + +ff --fragment-per-frame + encode each frame as one fragment (default) + + +fs --fragment-size [s]ize: integer + limit fragment size to s kbytes (non-standard) + +basic offset table encoding: + + +ot --offset-table-create + create offset table (default) + + -ot --offset-table-empty + leave offset table empty + +SOP Class UID: + + +cd --class-default + keep SOP Class UID (default) + + +cs --class-sc + convert to Secondary Capture Image (implies --uid-always) + +SOP Instance UID: + +un --uid-never + never assign new UID (default) + + +ua --uid-always + always assign new UID +\endverbatim + +\subsection dcmcrle_output_options output options +\verbatim +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding: + + -p= --padding-retain + do not change padding (default) + + -p --padding-off + no padding + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section dcmcrle_notes NOTES + +The \b dcmcrle utility compresses DICOM images of all SOP classes. It processes +all Pixel Data (7fe0,0010) elements in the dataset, i.e. compression is also +performed on an icon image. + +Please note that the DICOM standard does not allow for storing the pixel data +with multiple fragments per frame (when RLE compression is used). So limiting +the fragment size with option \e --fragment-size (or \e +fs) may result in a +non-standard compliant DICOM image. + +\section dcmcrle_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmcrle supports the following transfer syntaxes for input +(\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +(*) if compiled with zlib support enabled + +\b dcmcrle supports the following transfer syntaxes for output +(\e dcmfile-out): + +\verbatim +RLELosslessTransferSyntax 1.2.840.10008.1.2.5 +\endverbatim + +\section dcmcrle_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmcrle_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmcrle_environment ENVIRONMENT + +The \b dcmcrle utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmcrle_see_also SEE ALSO + +dcmdrle(1) + +\section dcmcrle_copyright COPYRIGHT + +Copyright (C) 2002-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcmdata.dox b/dcmdata/docs/dcmdata.dox new file mode 100644 index 00000000..b29b6fca --- /dev/null +++ b/dcmdata/docs/dcmdata.dox @@ -0,0 +1,100 @@ +/*! + +\page mod_dcmdata dcmdata: a data encoding/decoding library and utility apps + +This module contains classes to manage DICOM data structures and files. It +also provides support for DICOMDIR files as required for DICOM storage media. + +The main interface classes are: +\li \b DcmFileFormat +\li \b DcmDataset +\li \b DcmItem +\li \b DcmElement + +Here are some further classes that are of interest: +\li \b DcmTag +\li \b DcmTagKey +\li \b DicomDirInterface + +\section Tools + +This module contains the following command line tools: +\li \ref cda2dcm +\li \ref dcm2json +\li \ref dcm2pdf +\li \ref dcm2xml +\li \ref dcmconv +\li \ref dcmcrle +\li \ref dcmdrle +\li \ref dcmdump +\li \ref dcmftest +\li \ref dcmgpdir +\li \ref dcmodify +\li \ref dump2dcm +\li \ref img2dcm +\li \ref pdf2dcm +\li \ref stl2dcm +\li \ref xml2dcm + +\section Files + +The following file provides further documentation: +\li \ref file_datadict + +\section Examples + +The following example shows how to load a DICOM file and output the patient's name: + +\code +DcmFileFormat fileformat; +OFCondition status = fileformat.loadFile("test.dcm"); +if (status.good()) +{ + OFString patientName; + if (fileformat.getDataset()->findAndGetOFString(DCM_PatientName, patientName).good()) + { + cout << "Patient's Name: " << patientName << endl; + } else + cerr << "Error: cannot access Patient's Name!" << endl; +} else + cerr << "Error: cannot read DICOM file (" << status.text() << ")" << endl; +\endcode + +The following example shows how to create a DICOM dataset and save it to a file: + +\code +char uid[100]; +DcmFileFormat fileformat; +DcmDataset *dataset = fileformat.getDataset(); +dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage); +dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT)); +dataset->putAndInsertString(DCM_PatientName, "Doe^John"); +/* ... */ +dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength); +OFCondition status = fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit); +if (status.bad()) + cerr << "Error: cannot write DICOM file (" << status.text() << ")" << endl; +\endcode + +The following example shows how to create a general purpose DICOMDIR from multiple files: + +\code +DicomDirInterface dicomdir; +OFCondition status = dicomdir.createNewDicomDir(); +if (status.good()) +{ + while ( /* there are files */ ) + dicomdir.addDicomFile( /* current filename */ ); + status = dicomdir.writeDicomDir(); + if (status.bad()) + cerr << "Error: cannot write DICOMDIR (" << status.text() << ")" << endl; +} else + cerr << "Error: cannot create DICOMDIR (" << status.text() << ")" << endl; +\endcode + +*/ + +/*! + \page file_datadict datadict.txt file + \verbinclude datadict.txt +*/ diff --git a/dcmdata/docs/dcmdrle.man b/dcmdata/docs/dcmdrle.man new file mode 100644 index 00000000..4dea8e34 --- /dev/null +++ b/dcmdata/docs/dcmdrle.man @@ -0,0 +1,252 @@ +/*! + +\if MANPAGES +\page dcmdrle Decode RLE-compressed DICOM file +\else +\page dcmdrle dcmdrle: Decode RLE-compressed DICOM file +\endif + +\section dcmdrle_synopsis SYNOPSIS + +\verbatim +dcmdrle [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmdrle_description DESCRIPTION + +The \b dcmdrle utility reads a RLE-compressed DICOM image (\e dcmfile-in), +decompresses the image data (i.e. conversion to a native DICOM transfer syntax) +and writes the converted image to an output file (\e dcmfile-out). + +\section dcmdrle_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmdrle_options OPTIONS + +\subsection dcmdrle_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmdrle_input_options input options + +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + + # This option allows one to decompress RLE compressed DICOM objects that have + # been stored as dataset without meta-header. Such a thing should not exist + # since the transfer syntax cannot be reliably determined without meta-header, + # but unfortunately it does. +\endverbatim + +\subsection dcmdrle_processing_options processing options +\verbatim +SOP Instance UID: + + +ud --uid-default + keep same SOP Instance UID (default) + + +ua --uid-always + always assign new UID + +RLE byte segment order: + + +bd --byte-order-default + most significant byte first (default) + + +br --byte-order-reverse + least significant byte first + + # This option allows one to decompress RLE compressed DICOM files in which + # the order of byte segments is encoded in incorrect order. This only affects + # images with more than one byte per sample. +\endverbatim + +\subsection dcmdrle_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +te --write-xfer-little + write with explicit VR little endian (default) + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section dcmdrle_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmdrle supports the following transfer syntaxes for input +(\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +RLELosslessTransferSyntax 1.2.840.10008.1.2.5 +\endverbatim + +(*) if compiled with zlib support enabled + +\b dcmdrle supports the following transfer syntaxes for output +(\e dcmfile-out): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +\section dcmdrle_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmdrle_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmdrle_environment ENVIRONMENT + +The \b dcmdrle utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmdrle_see_also SEE ALSO + +dcmcrle(1) + +\section dcmdrle_copyright COPYRIGHT + +Copyright (C) 2002-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany + +*/ diff --git a/dcmdata/docs/dcmdump.man b/dcmdata/docs/dcmdump.man new file mode 100644 index 00000000..2fa40ada --- /dev/null +++ b/dcmdata/docs/dcmdump.man @@ -0,0 +1,428 @@ +/*! + +\if MANPAGES +\page dcmdump Dump DICOM file and data set +\else +\page dcmdump dcmdump: Dump DICOM file and data set +\endif + +\section dcmdump_synopsis SYNOPSIS + +\verbatim +dcmdump [options] dcmfile-in... +\endverbatim + +\section dcmdump_description DESCRIPTION + +The \b dcmdump utility dumps the contents of a DICOM file (file format or raw +data set) to stdout in textual form. Attributes with very large value fields +(e.g. pixel data) can be described as "(not loaded)". String value fields +will be delimited with square brackets ([]). Known UIDs will be displayed by +their names prefixed by an equals sign (e.g. "=MRImageStorage") unless this +mapping would be explicitly switched off. Empty value fields are described as +"(no value available)". + +If \b dcmdump reads a raw data set (DICOM data without a file format +meta-header) it will attempt to guess the transfer syntax by examining the +first few bytes of the file. It is not always possible to correctly guess the +transfer syntax and it is better to convert a data set to a file format +whenever possible (using the \b dcmconv utility). It is also possible to use +the \e -f and -t[ieb] options to force \b dcmdump to read a dataset +with a particular transfer syntax. + +\section dcmdump_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input file or directory to be dumped +\endverbatim + +\section dcmdump_options OPTIONS + +\subsection dcmdump_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmdump_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS + +input files: + + +sd --scan-directories + scan directories for input files (dcmfile-in) + + +sp --scan-pattern [p]attern: string (only with --scan-directories) + pattern for filename matching (wildcards) + + # possibly not available on all systems + + -r --no-recurse + do not recurse within directories (default) + + +r --recurse + recurse within specified directories + +long tag values: + + +M --load-all + load very long tag values (default) + + -M --load-short + do not load very long values (e.g. pixel data) + + +R --max-read-length [k]bytes: integer (4..4194302, default: 4) + set threshold for long values to k kbytes + +parsing of file meta information: + + +ml --use-meta-length + use file meta information group length (default) + + -ml --ignore-meta-length + ignore file meta information group length + +parsing of odd-length attributes: + + +ao --accept-odd-length + accept odd length attributes (default) + + +ae --assume-even-length + assume real length is one byte larger + +handling of explicit VR: + + +ev --use-explicit-vr + use explicit VR from dataset (default) + + -ev --ignore-explicit-vr + ignore explicit VR (prefer data dictionary) + +handling of non-standard VR: + + +vr --treat-as-unknown + treat non-standard VR as unknown (default) + + -vr --assume-implicit + try to read with implicit VR little endian TS + +handling of undefined length UN elements: + + +ui --enable-cp246 + read undefined len UN as implicit VR (default) + + -ui --disable-cp246 + read undefined len UN as explicit VR + +handling of defined length UN elements: + + -uc --retain-un + retain elements as UN (default) + + +uc --convert-un + convert to real VR if known + +handling of private max-length elements (implicit VR): + + -sq --maxlength-dict + read as defined in dictionary (default) + + +sq --maxlength-seq + read as sequence with undefined length + +handling of wrong delimitation items: + + -rd --use-delim-items + use delimitation items from dataset (default) + + +rd --replace-wrong-delim + replace wrong sequence/item delimitation items + +handling of illegal undefined length OB/OW elements: + + -oi --illegal-obow-rej + reject dataset with illegal element (default) + + +oi --illegal-obow-conv + convert undefined length OB/OW element to SQ + +handling of VOI LUT Sequence with OW VR and explicit length: + + -vi --illegal-voi-rej + reject dataset with illegal VOI LUT (default) + + +vi --illegal-voi-conv + convert illegal VOI LUT to SQ + +handling of explicit length pixel data for encaps. transfer syntaxes: + + -pe --abort-expl-pixdata + abort on explicit length pixel data (default) + + +pe --use-expl-pixdata + use explicit length pixel data + +general handling of parser errors: + + +Ep --ignore-parse-errors + try to recover from parse errors + + -Ep --handle-parse-errors + handle parse errors and stop parsing (default) + +other parsing options: + + +st --stop-after-elem [t]ag: "gggg,eeee" or dictionary name + stop parsing after element specified by t + + +sb --stop-before-elem [t]ag: "gggg,eeee" or dictionary name + stop parsing before element specified by t + + # only considers elements on main dataset level and also + # works if the given tag is not present in the file + +automatic data correction: + + +dc --enable-correction + enable automatic data correction (default) + + -dc --disable-correction + disable automatic data correction + +bitstream format of deflated input: + + +bd --bitstream-deflated + expect deflated bitstream (default) + + +bz --bitstream-zlib + expect deflated zlib bitstream +\endverbatim + +\subsection dcmdump_processing_options processing options +\verbatim +specific character set: + + +U8 --convert-to-utf8 + convert all element values that are affected + by Specific Character Set (0008,0005) to UTF-8 + + # requires support from an underlying character encoding library + # (see output of --version on which one is available) +\endverbatim + +\subsection dcmdump_output_options output options +\verbatim +printing: + + +L --print-all + print long tag values completely + + -L --print-short + print long tag values shortened (default) + + +T --print-tree + print hierarchical structure as a simple tree + + -T --print-indented + print hierarchical structure indented (default) + + +F --print-filename + print header with filename for each input file + + +Fs --print-file-search + print header with filename only for those input files + that contain one of the searched tags + +mapping: + + +Un --map-uid-names + map well-known UID numbers to names (default) + + -Un --no-uid-names + do not map well-known UID numbers to names + +quoting: + + +Qn --quote-nonascii + quote non-ASCII and control chars as XML markup + + +Qo --quote-as-octal + quote non-ASCII and control chars as octal numbers + + -Qn --print-nonascii + print non-ASCII and control chars (default) + +color: + + +C --print-color + use ANSI escape codes for colored output + + # not available on Windows systems + + -C --no-color + do not use any ANSI escape codes (default) + + # not available on Windows systems + +error handling: + + -E --stop-on-error + do not print if file is damaged (default) + + +E --ignore-errors + attempt to print even if file is damaged + +searching: + + +P --search [t]ag: "gggg,eeee" or dictionary name + print the textual dump of tag t + this option can be specified multiple times + (default: the complete file is printed) + + +s --search-all + print all instances of searched tags (default) + + -s --search-first + only print first instance of searched tags + + +p --prepend + prepend sequence hierarchy to printed tag, + denoted by: (gggg,eeee).(gggg,eeee).* + (only when used with --search) + + -p --no-prepend + do not prepend hierarchy to tag (default) + +writing: + + +W --write-pixel [d]irectory: string + write pixel data to a .raw file stored in d + (little endian, filename created automatically) +\endverbatim + +\section dcmdump_notes NOTES + +Adding directories as a parameter to the command line only makes sense if +option \e --scan-directories is also given. If the files in the provided +directories should be selected according to a specific name pattern (e.g. +using wildcard matching), option \e --scan-pattern has to be used. Please +note that this file pattern only applies to the files within the scanned +directories, and, if any other patterns are specified on the command line +outside the \e --scan-pattern option (e.g. in order to select further +files), these do not apply to the specified directories. + +\section dcmdump_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmdump_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmdump_environment ENVIRONMENT + +The \b dcmdump utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmdump_see_also SEE ALSO + +dump2dcm(1), dcmconv(1) + +\section dcmdump_copyright COPYRIGHT + +Copyright (C) 1994-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcmftest.man b/dcmdata/docs/dcmftest.man new file mode 100644 index 00000000..159ccaa7 --- /dev/null +++ b/dcmdata/docs/dcmftest.man @@ -0,0 +1,44 @@ +/*! + +\if MANPAGES +\page dcmftest Test if file uses DICOM part 10 format +\else +\page dcmftest dcmftest: Test if file uses DICOM part 10 format +\endif + +\section dcmftest_synopsis SYNOPSIS + +\verbatim +dcmftest file... +\endverbatim + +\section dcmftest_description DESCRIPTION + +The \b dcmftest utility checks whether the files specified on the command line +are DICOM files in part 10 format (with meta-header). + +\section dcmftest_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be dumped +\endverbatim + +\section dcmftest_notes NOTES + +All files specified on the command line are checked for the presence of the +DICOM "magic word" 'DICM' at byte position 128. No attempt is made to parse +the complete data set. For each file the test result is printed to \e stdout +in the form "yes: \n" or "no: \n". The utility terminates +with a return code corresponding to the number of files found to be non-DICOM, +i.e. if all files pass as DICOM files, the return value is 0. This behavior +is intended for use in shell script programming. + +\section dcmftest_see_also SEE ALSO + +dcmgpdir(1), dcmmkdir(1) + +\section dcmftest_copyright COPYRIGHT + +Copyright (C) 1997-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcmgpdir.man b/dcmdata/docs/dcmgpdir.man new file mode 100644 index 00000000..34993f65 --- /dev/null +++ b/dcmdata/docs/dcmgpdir.man @@ -0,0 +1,301 @@ +/*! + +\if MANPAGES +\page dcmgpdir Create a general purpose DICOMDIR +\else +\page dcmgpdir dcmgpdir: Create a general purpose DICOMDIR +\endif + +\section dcmgpdir_synopsis SYNOPSIS + +\verbatim +dcmgpdir [options] [dcmfile-in...] +\endverbatim + +\section dcmgpdir_description DESCRIPTION + +The \b dcmgpdir utility creates a \e DICOMDIR file from the specified +referenced DICOM files according to the DICOM Part 11 Media Storage +Application Profiles. + +Currently, the following profiles are supported: + +\li General Purpose CD-R Interchange (STD-GEN-CD) +\li General Purpose Interchange on DVD-RAM Media (STD-GEN-DVD-RAM) + +\b dcmmkdir is an extended version of this tool which also supports other +Media Storage Application Profiles than the general purpose one (e.g. the +cardio profiles require the use of icon images). + +\section dcmgpdir_parameters PARAMETERS + +\verbatim +dcmfile-in referenced DICOM file (or directory to be scanned) +\endverbatim + +\section dcmgpdir_options OPTIONS + +\subsection dcmgpdir_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmgpdir_input_options input options +\verbatim +DICOMDIR identifiers: + + +F --fileset-id [i]d: string + use specific file-set ID + (default: DCMTK_MEDIA_DEMO, "" for none) + + +R --descriptor [f]ilename: string + add a file-set descriptor file ID + (e.g. README, default: no descriptor) + + +C --char-set [c]harset: string + add a specific character set for descriptor + (default: "ISO_IR 100" if descriptor present) + +reading: + + +id --input-directory [d]irectory: string + read referenced DICOM files from directory d + (default for --recurse: current directory) + + -m --keep-filenames + expect filenames to be in DICOM format (default) + + +m --map-filenames + map to DICOM filenames (lowercase->uppercase, + and remove trailing period) + + -r --no-recurse + do not recurse within directories (default) + + +r --recurse + recurse within filesystem directories + + +p --pattern [p]attern: string (only with --recurse) + pattern for filename matching (wildcards) + + # possibly not available on all systems +\endverbatim + +\subsection dcmgpdir_processing_options processing options +\verbatim +consistency check: + + -W --no-consistency-check + do not check files for consistency + + +W --warn-inconsist-files + warn about inconsistent files (default) + + -a --abort-inconsist-file + abort on first inconsistent file + +type 1 attributes: + + -I --strict + exit with error if DICOMDIR type 1 attributes + are missing in DICOM file (default) + + +I --invent + invent DICOMDIR type 1 attributes if missing in DICOM file + + +Ipi --invent-patient-id + invent new PatientID in case of inconsistent + PatientName attributes + +other checks: + + +Nrs --allow-retired-sop + allow retired SOP classes defined in previous editions + of the DICOM standard + + -Nxc --no-xfer-check + do not reject images with non-standard transfer syntax + (just warn) +\endverbatim + +\subsection dcmgpdir_output_options output options +\verbatim +DICOMDIR file: + + +D --output-file [f]ilename: string + generate specific DICOMDIR file + (default: DICOMDIR in current directory) + +writing: + + -A --replace + replace existing DICOMDIR (default) + + +A --append + append to existing DICOMDIR + + +U --update + update existing DICOMDIR + + -w --discard + do not write out DICOMDIR + +backup: + + --create-backup + create a backup of existing DICOMDIR (default) + + -nb --no-backup + do not create a backup of existing DICOMDIR + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + -g --group-length-remove + write without group length elements (default) + + +g --group-length-create + write with group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths +\endverbatim + +\section dcmgpdir_notes NOTES + +All files specified on the command line (or discovered by recursively examining +the contents of directories with the \e +r option) are first evaluated for +their compatibility with the General Purpose CD-R Image Interchange Profile +(Supplement 19). Only appropriate files encoded using the Explicit VR Little +Endian Uncompressed Transfer Syntax will be accepted. Files having invalid +filenames will be rejected (the rules can be relaxed via the \e +m option). +Files missing required attributes will be rejected (the \e +I option can relax +this behavior). + +A \e DICOMDIR file will only be constructed if all files have passed initial +tests. + +The \b dcmgpdir utility also allows one to append new entries to and to update +existing entries in a \e DICOMDIR file. Using option \e +A new entries are +only appended to the DICOMDIR, i.e. existing records like the ones for PATIENT +information are not updated. Using option \e +U also existing records are +updated according to the information found in the referenced DICOM files. +Please note that this update process might be slower than just appending new +entries. However, it makes sure that additional information that is required +for the selected application profile is also added to existing records. + +\subsection dcmgpdir_scanning_directories Scanning Directories + +Adding files from directories is possible by using option \e --recurse. If no +further command line parameters are given, the directory specified by option +\e --input-directory (default: current directory) is scanned for files. If +parameters are given, they can either specify a file or directory name; the +input directory is always prepended. If the files in the provided directories +should be selected according to a specific name pattern (e.g. using wildcard +matching), option \e --pattern has to be used. Please note that this file +pattern only applies to the files within the scanned directories, and, if any +other patterns are specified on the command line outside the +\e --input-directory option (e.g. in order to select further files), these do +not apply to the specified directories. + +\section dcmgpdir_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmgpdir_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmgpdir_environment ENVIRONMENT + +The \b dcmgpdir utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmgpdir_see_also SEE ALSO + +dcmmkdir(1) + +\section dcmgpdir_copyright COPYRIGHT + +Copyright (C) 1996-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dcmodify.man b/dcmdata/docs/dcmodify.man new file mode 100644 index 00000000..f8764314 --- /dev/null +++ b/dcmdata/docs/dcmodify.man @@ -0,0 +1,586 @@ +/*! + +\if MANPAGES +\page dcmodify Modify DICOM files +\else +\page dcmodify dcmodify: Modify DICOM files +\endif + +\section dcmodify_synopsis SYNOPSIS + +\verbatim +dcmodify [options] dcmfile-in... +\endverbatim + +\section dcmodify_description DESCRIPTION + +\b dcmodify is a tool that allows one to modify, insert and delete tags and +items in DICOM files. Sequences and tags with a value multiplicity > 1 are +also supported. Metaheader information and the tag's VR can not be modified +directly by \b dcmodify at this time. In addition to tag modifications, +\b dcmodify makes available some input options - forcing \b dcmodify to +handle its input files as the user specifies - and output options to control +the output format of the resulting files. + +In case multiple modifications have to be performed, \b dcmodify does the +modifications in the same order as they appear on the command line. Please +note that \b dcmodify does not check whether a given value matches its value +representation (VR). Usually, an error message is printed but generally the +user should take care of the right VR usage. + +If \b dcmodify doesn't know the tag it should insert, then the tag's VR is set +to UN and the value provided on command line is interpreted as being a series +of hexadecimal numbers (like they are provided for VR=OB). Please insert these +tags into the dictionary to avoid this behavior. Also, specifying the \e -iun +option, it is possible to force \b dcmodify to leave UN values untouched. +Using option \e -u lets \b dcmodify saving all VR=UN attributes as OB. + +\b dcmodify is able to work with so-called tag paths to access tags in +sequences. The (pseudo-formalized) syntax is + +\verbatim +{sequence[item-no].}*element +\endverbatim + +where 'sequence' is a sequence tag like (0008,1111) or a dictionary name for a +tag. 'item-no' describes the item number to be accessed (counting from zero). +'element' defines the target tag to work on. A tag can either be specified +directly as (0010,0010) or through the corresponding dictionary name +"PatientName". The '*' denotes that you can repeat sequence statements to +access deeper levels in DICOM files (see EXAMPLES section). For 'item-no', +also a wildcard character '*' can be used selecting all items in surrounding +sequence (see section WILDCARDS below). + +When inserting tag paths consisting of multiple nodes (i.e. not a single +element) using the \e -i option, any missing path elements (items, sequences, +leaf elements) are inserted automatically when missing. That does not work +for item wildcards: When no single item exists in the surrounding sequence +\b dcmodify of course can't decide, how many items should be generated. +However, if specifying an item number like '5', all 6 items (counted from zero) +can be (and are) automatically generated in insert mode. If already 2 items +would exist, the rest (4) would be inserted. + +Please note that there are some issues concerning the modification of private +tags (see PRIVATE TAGS section) and for changing UIDs (CHANGING UIDs section). + +\section dcmodify_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename(s) to be modified +\endverbatim + +\section dcmodify_options OPTIONS + +\subsection dcmodify_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmodify_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + + +fc --create-file + create file format if file does not exist + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS + +parsing of odd-length attributes: + + +ao --accept-odd-length + accept odd length attributes (default) + + +ae --assume-even-length + assume real length is one byte larger + +automatic data correction: + + +dc --enable-correction + enable automatic data correction (default) + + -dc --disable-correction + disable automatic data correction + +bitstream format of deflated input: + + +bd --bitstream-deflated + expect deflated bitstream (default) + + +bz --bitstream-zlib + expect deflated zlib bitstream +\endverbatim + +\subsection dcmodify_processing_options processing options +\verbatim +backup input files: + + --backup + backup files before modifying (default) + + -nb --no-backup + don't backup files (DANGEROUS) + +insert mode: + + -i --insert "[t]ag-path=[v]alue" + insert (or overwrite) path at position t with value v + + -if --insert-from-file "[t]ag-path=[f]ilename" + insert (or overwrite) path at position t with value from file f + + -nrc --no-reserv-check + do not check private reservations + +modify mode: + + -m --modify "[t]ag-path=[v]alue" + modify tag at position t to value v + + -mf --modify-from-file "[t]ag-path=[f]ilename" + modify tag at position t to value from file f + + -ma --modify-all "[t]ag=[v]alue" + modify ALL matching tags t in file to value v + +erase mode: + + -e --erase "[t]ag-path" + erase tag/item at position t + + -ea --erase-all "[t]ag" + erase ALL matching tags t in file + + -ep --erase-private + erase ALL private data from file + +unique identifier: + + -gst --gen-stud-uid + generate new Study Instance UID + + -gse --gen-ser-uid + generate new Series Instance UID + + -gin --gen-inst-uid + generate new SOP Instance UID + + -nmu --no-meta-uid + do not update metaheader UIDs if related + UIDs in the dataset are modified + +error handling: + + -ie --ignore-errors + continue with file, if modify error occurs + + -imt --ignore-missing-tags + treat 'tag not found' as success + when modifying or erasing in files + + -iun --ignore-un-values + do not try writing any values to elements + having a VR of UN +\endverbatim + +\subsection dcmodify_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +le --length-explicit + write with explicit lengths (default) + + -le --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes and items on + multiple of i bytes +\endverbatim + +\section dcmodify_private_tags PRIVATE TAGS + +There are some issues you have to consider when working with private tags. +However, the insertion or modification of a reservation tag (gggg,00xx) should +always work. + +\subsection dcmodify_private_insertions Insertions + +If you wish to insert a private tag (not a reservation with gggg,00xx), be +sure, that you've listed it in your dictionary (see +\/datadict.txt for details). If it's not listed, \b dcmodify +will insert it with VR=UN. Also, for some cases insertion may even fail for +some values. + +If you've got your private tag in the dictionary, \b dcmodify acts as follows: +When it finds a reservation in the tag's enclosing dataset, whose private +creator matches, insertion is done with the VR found in the dictionary and the +value given on command line. But if the private creator doesn't match or none +is set, \b dcmodify will return with an error. If a private tag should be +inserted regardless whether a reservation does not exist, the option \e -nrc +can be used, forcing an insertion. However, the VR is set to UN then, because +the tag then cannot be found in the dictionary. + +See description above how inserting values into elements with unknown VR +are handled. + +\subsection dcmodify_private_modifications Modifications + +If you modify a private tags value, \b dcmodify won't check its VR against the +dictionary. So please be careful to enter only values that match the tag's VR. + +If you wish to change a private tags value \e and VR, because you just added +this tag to your dictionary, you can delete it with \b dcmodify and re-insert +it. Then \b dcmodify uses your dictionary entry to determine the right VR +(also see subsection insertions). + +Also, see description above how inserting values into elements with unknown VR +are handled. + +\subsection dcmodify_private_deletions Deletions + +When you use \b dcmodify to delete a private reservation tag, please note that +\b dcmodify won't touch the private tags that are under this reservation. The +user is forced to handle the consistency between reservations and their +associated private tags. + +For the deletion of private non-reservation tags there are no special issues. + +\section dcmodify_changing_uids CHANGING UIDS + +\b dcmodify will automatically correct 'Media Storage SOP Class UID' and +'Media Storage SOP Instance UID' in the metaheader, if you make changes to the +related tags in the dataset ('SOP Class UID' and 'SOP Instance UID') via +insert or modify mode options. You can disable this behavior by using the +\e -nmu option. + +If you generate new UID's with \e -gst, \e -gse or \e -gin, this will only +affect the UID you chose to generate. So if you use \e -gst to generate a +new 'Study Instance UID', then 'Series Instance UID' and 'SOP Instance UID' +will not be affected! This gives you the possibility to generate each value +separately. Normally, you would also modify the 'underlying' UIDs. As a +disadvantage of this flexibility, the user has to assure, that when creating +'new' DICOM files with new UIDs with \b dcmodify, other UIDs have to be updated +by the user as necessary. + +When choosing the \e -gin option, the related metaheader tag ('Media Storage +SOP Instance UID') is updated automatically. This behavior cannot be +disabled. + +\section dcmodify_creating_new_files CREATING NEW FILES + +Option \e --create-file lets \b dcmodify create a file if it does not already +exist on disk. This can be used in order to create files from scratch by +performing consecutive insertions with options like \e --insert. This might +especially become handy when creating query files for tools like \b findscu or +\b movescu. In case no specific output transfer syntax is defined, \b dcmodify +chooses Little Endian Explicit Uncompressed for output. Files that are newly +created are always written as DICOM file format, i.e. option \e --write-dataset +is not permitted together with \e --create. This way, at least the metaheader +is written and no file with zero byte length is created in a case where no +insertions are performed in the \b dcmodify call. + +\section dcmodify_element_values_from_file ELEMENT VALUES FROM FILE + +In order to read the element value from a file instead of specifying it on the +command line, option \e -mf and \e -if can be used. Please note that for OW +elements, the data is expected to be little endian ordered and will be swapped +if necessary. The file size should always be an even number of bytes, i.e. no +automatic padding is performed. + +\section dcmodify_wildcards WILDCARDS + +\b dcmodify also permits the usage of a wildcard character "*" for item numbers +in path expressions, e.g. "ContentSequence[*].CodeValue" selects all "Code +Value" attributes in all items of the ContentSequence. Using a wildcard is +possible for all basic operations, i.e. modifying \e -m, inserting \e -i and +\e -e options which makes it, together with the automatic creation of +intermediate path nodes a powerful tool for construction and processing complex +datasets. + +The options \e -ma and \e -ea for modifying or deleting all occurrences of a +DICOM element based on its tag do not accept any wildcards but only work on +single elements (i.e. a single dictionary name or tag key). + +\section dcmodify_examples EXAMPLES + +\verbatim +-i --insert: + dcmodify -i "(0010,0010)=A Name" file.dcm + Inserts the PatientName tag into 'file.dcm' at 1st level. + If tag already exists, -i will overwrite it! If you want to + insert an element with value multiplicity > 1 (e.g. 4) you + can do this with: dcmodify -i "(0018,1310)=1\\2\\3\\4" + + dcmodify -i "(0008,1111)[0].PatientName=Another Name" *.dcm + Inserts PatientName tag into the first item of sequence + (0008,1111). Note that the use of wildcards for files is + possible. You can specify longer tag paths, too (e.g. + "(0008,1111)[0].(0008,1111)[1].(0010,0010)=A Third One"). + If any part of the path, e.g. the sequence or the item "0" + does not exist, it is automatically inserted by dcmodify. + + dcmodify -i "(0008,1111)[*].PatientName=Another Name" *.dcm + Inserts PatientName tag into _every_ item of sequence + (0008,1111). Note that the use of wildcards for files is + possible. You can specify longer tag paths, too (e.g. + "(0008,1111)[*].(0008,1111)[*].(0010,0010)=A Third One"). + +-if --insert-from-file: + dcmodify -if "PixelData=pixel.raw" file.dcm + Inserts the content of file 'pixel.raw' into the PixelData element + of 'file.dcm'. The contents of the file will be read as is. + OW data is expected to be little endian ordered and will be + swapped if necessary. No checks will be made to ensure that the + amount of data is reasonable in terms of other attributes such as + Rows or Columns. + +-m --modify: + dcmodify -m "(0010,0010)=A Name" file.dcm + Changes tag (0010,0010) on 1st level to "A Name". + + This option also permits longer tag paths as demonstrated + above for -i. If the leaf element or any intermediate + part of the path does not exist, it is not inserted as it + would be if using the '-i' option. + + dcmodify -m "(0010,0010)=A Name" -imt file.dcm + Changes tag (0010,0010) on 1st level to "A Name". Due to the + given option '-imt', success is returned instead of "tag not found", + if the element/item (or any intermediate node in a longer path) does + not exist. + + Note that for the '-m' option the last node in the path must be + a leaf element, i.e. not a sequence or an item. + +-mf --modify-from-file: + dcmodify -mf "PixelData=pixel.raw" file.dcm + Does the same as -if in case there was already a PixelData element + in 'file.dcm'. Otherwise nothing is changed. + +-ma --modify-all: + dcmodify -ma "(0010,0010)=New Name" file.dcm + Does the same as -m but works on all matching tags found in + 'file.dcm'. Therefore, it searches the whole dataset including + sequences for tag (0010,0010) and changes them to "New Name" + +-e --erase: + dcmodify -e "(0010,0010)" *.dcm + Erases tag (0010,0010) in all *.dcm files at 1st level. + + This option also allows longer tag paths as demonstrated + above for -i. + + dcmodify -e "(0010,0010)" -imt *.dcm + Erases tag (0010,0010) in all *.dcm files at 1st level. Due to the + given option '-imt', success is returned instead of "tag not found", + if the element/item (or any intermediate node in a longer path) does + not exist. + +-ea --erase-all: + dcmodify -ea "(0010,0010)" *.dcm + Same as -e, but also searches in sequences and items. + +-ep --erase-private: + dcmodify -ep *.dcm + Deletes all private tags (i.e. tags having an odd group number) from + all files matching *.dcm in the current directory. + +-gst --gen-stud-uid: + dcmodify -gst file.dcm + This generates a new value for the StudyInstanceUID + (0020,000d). Other UIDs are not modified! + +-gse --gen-ser-uid: + dcmodify -gse file.dcm + This generates a new value for the SeriesInstanceUID + (0020,000e). Other UIDs are not modified! + +-gin --gen-inst-uid: + dcmodify -gin file.dcm + This command generates a new value for the SOPInstanceUID + (0008,0018). The corresponding MediaStorageSOPInstanceUID + (0002,0003) is adjusted to the new value automatically. + Please note that it's not possible to avoid this metaheader + update via the -nmu option. + +-nmu --no-meta-uid: + dcmodify -m "SOPInstanceUID=[UID]" -nmu *.dcm + This will modify the SOPInstanceUID to the given [UID], + but -nmu avoids, that dcmodify adjusts the + MediaStorageSOPInstanceUID in the metaheader, too. + +\endverbatim + +\section dcmodify_error_handling ERROR HANDLING + +\b dcmodify tries executing each modify operation given on command line: If +one returns an error, the others are being performed anyway. However in case +of any error, the modified file is not saved, unless the \e --ignore-errors +option is specified. If that option is selected, \b dcmodify also +continues modifying further files specified on command line; otherwise +\b dcmodify exits after the first file that had modification errors. + +If the \e --ignore-missing-tags option is enabled, any modify or erase +operations (i.e. not \e --insert) that fails because of a non-existing tag is +treated as being successful. That does make sense if someone wants to be sure +that specific tags are not present in the file or that - if they exist - that +they are set to a specific value. + +\section dcmodify_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmodify_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmodify_environment ENVIRONMENT + +The \b dcmodify utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmodify_copyright COPYRIGHT + +Copyright (C) 2003-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/dump2dcm.man b/dcmdata/docs/dump2dcm.man new file mode 100644 index 00000000..b1ad195e --- /dev/null +++ b/dcmdata/docs/dump2dcm.man @@ -0,0 +1,317 @@ +/*! + +\if MANPAGES +\page dump2dcm Convert ASCII dump to DICOM file +\else +\page dump2dcm dump2dcm: Convert ASCII dump to DICOM file +\endif + +\section dump2dcm_synopsis SYNOPSIS + +\verbatim +dump2dcm [options] dumpfile-in dcmfile-out +\endverbatim + +\section dump2dcm_description DESCRIPTION + +The \b dump2dcm utility converts an ASCII dump file to a DICOM file. The +dump file has the same format as the output of \b dcmdump. Thus it is possible +to capture the output of \b dcmdump into a file, modify some attributes and +create a new DICOM file. + +\section dump2dcm_parameters PARAMETERS + +\verbatim +dumpfile-in dump input filename + +dcmfile-out DICOM output filename +\endverbatim + +\section dump2dcm_options OPTIONS + +\subsection dump2dcm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dump2dcm_input_options input options +\verbatim +input file format: + + +f --read-meta-info + read meta information if present (default) + + -f --ignore-meta-info + ignore file meta information + +file contents byte ordering: + + +rl --read-file-little + read OW data with little endian (default) + + +rb --read-file-big + read OW data from file with big endian + +other input options: + + +l --line [m]ax-length: integer + maximum line length m (default: 4096) +\endverbatim + +\subsection dump2dcm_processing_options processing options +\verbatim +unique identifiers: + + +Ug --generate-new-uids + generate new Study/Series/SOP Instance UID + + -Uo --dont-overwrite-uids + do not overwrite existing UIDs (default) + + +Uo --overwrite-uids + overwrite existing UIDs +\endverbatim + +\subsection dump2dcm_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + + +Fu --update-meta-info + update particular file meta information + +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + + +td --write-xfer-deflated + write with deflated explicit VR little endian TS + +error handling: + + -E --stop-on-error + do not write if dump is damaged (default) + + +E --ignore-errors + attempt to write even if dump is damaged + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes + +deflate compression level (only with --write-xfer-deflated): + + +cl --compression-level [l]evel: integer (default: 6) + 0=uncompressed, 1=fastest, 9=best compression +\endverbatim + +\section dump2dcm_notes NOTES + +\subsection dump2dcm_notes_description Dump File Description + +The input file can be an output of \b dcmdump (default indented format only). +One element (tag, VR, value) must be written into one line separated by +arbitrary spaces or tab characters. A '#' begins a comment that ends at the +line end. Empty lines are allowed. + +The individual parts of a line have the following syntax: + +\verbatim +Tag: (gggg,eeee) + with gggg and eeee are 4 character hexadecimal values + representing group and element tag. Spaces and tabs can be + anywhere in a tag specification. +VR: Value Representation must be written as 2 characters as in + Part 6 of the DICOM standard. No spaces or tabs are allowed + between the two characters. If the VR can be determined from + the tag, this part of a line is optional. +Value: There are several rules for writing values: + 1. US, SS, SL, UL, FD, FL, OD, OF and OL are written as decimal + strings that can be read by scanf(). + 2. AT is written as '(gggg,eeee)' with additional spaces + stripped off automatically and gggg and eeee being decimal + strings that can be read by scanf(). + 3. OB and OW values are written as byte or word hexadecimal + values separated by '\\' character. Alternatively, OB or OW + values can be read from a separate file by writing the + filename prefixed by a '=' character (e.g. '=largepix.dat'). + The contents of the file will be read as is. By default, OW + data is expected to be little endian ordered and will be + swapped if necessary. No checks will be made to ensure that + the amount of data is reasonable in terms of other attributes + such as Rows or Columns. + In case of compressed pixel data, the line should start with + '(7fe0,0010) OB (PixelSequence' in order to distinguish from + uncompressed pixel data. + 4. UI is written as '=Name' in data dictionary or as unique + identifier string (see 6.), e.g. '[1.2.840.....]'. + 5. Strings without () <> [] spaces, tabs and # can be written + directly. + 6. Other strings must be surrounded by '[' and ']'. No bracket + structure is passed. The value ends at the last ']' in the + line. Anything after the ']' is interpreted as comment. + 7. '(' and '<' are interpreted special and may not be used when + writing an input file by hand as beginning characters of a + string. Multiple Value are separated by '\\'. The lines + need not be sorted into ascending tag order. References in + DICOM Directories are not supported. Semantic errors are + not detected. +\endverbatim + +\subsection dump2dcm_notes_example Example + +\verbatim + (0008,0020) DA [19921012] # 8, 1 StudyDate + (0008,0016) UI =MRImageStorage # 26, 1 SOPClassUID + (0002,0012) UI [1.2.276.0.7230010.100.1.1] + (0020,0032) DS [0.0\\0.0] # 8, 2 ImagePositionPatient + (0028,0009) AT (3004,000c) # 4, 1 FrameIncrementPointer + (0028,0010) US 256 # 4, 1 Rows + (0002,0001) OB 01\\00 +\endverbatim + +\subsection dump2dcm_limitations Limitations + +Please note that \b dump2dcm currently does not fully support DICOMDIR files. +Specifically, the value of the various offset data elements is not updated +automatically by this tool. + +\section dump2dcm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dump2dcm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dump2dcm_environment ENVIRONMENT + +The \b dump2dcm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dump2dcm_see_also SEE ALSO + +dcmdump(1) + +\section dump2dcm_copyright COPYRIGHT + +Copyright (C) 1996-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/img2dcm.man b/dcmdata/docs/img2dcm.man new file mode 100644 index 00000000..4c84e104 --- /dev/null +++ b/dcmdata/docs/img2dcm.man @@ -0,0 +1,501 @@ +/*! + +\if MANPAGES +\page img2dcm Convert standard image formats into DICOM format +\else +\page img2dcm img2dcm: Convert standard image formats into DICOM format +\endif + +\section img2dcm_synopsis SYNOPSIS + +\verbatim +img2dcm [options] imgfile-in dcmfile-out +\endverbatim + +\section img2dcm_description DESCRIPTION + +The \b img2dcm tool serves as a conversion tool from a standard image format +like JPEG or BMP to DICOM. Different output SOP Classes can be selected. The +additional information (regarding patients, series, etc.) stored in the DICOM +output file can be extracted from other DICOM files which serve as a "template" +for the resulting DICOM object. \b img2dcm can also be configured to invent +missing DICOM type 1 and type 2 attributes to work even without any template +dataset. + +\b img2dcm only supports single-frame output so far, i.e. it is not possible to +create multi-frame objects. Thus, also output SOP Classes that potentially +allow multiple frames within one object (such as the new Secondary Capture SOP +Classes) can only be created containing a single frame. + +\section img2dcm_parameters PARAMETERS +\verbatim +imgfile-in image file to be imported + +dcmfile-out DICOM output file +\endverbatim + +\section img2dcm_options OPTIONS +\subsection img2dcm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection img2dcm_input_options input options +\verbatim +general: + + -i --input-format [i]nput file format: string + supported formats: JPEG (default), BMP + + -df --dataset-from [f]ilename: string + use dataset from DICOM file f + + -stf --study-from [f]ilename: string + read patient/study from DICOM file f + + -sef --series-from [f]ilename: string + read patient/study/series from DICOM file f + + -ii --instance-inc + increase instance number read from DICOM file + +JPEG format: + + -dp --disable-progr + disable support for progressive JPEG + + -de --disable-ext + disable support for extended sequential JPEG + + -jf --insist-on-jfif + insist on JFIF header existence + + -ka --keep-appn + keep APPn sections (except JFIF) +\endverbatim + +\subsection img2dcm_processing_options processing options +\verbatim +attribute checking: + + --do-checks + enable attribute validity checking (default) + + --no-checks + disable attribute validity checking + + +i2 --insert-type2 + insert missing type 2 attributes (default) + (only with --do-checks) + + -i2 --no-type2-insert + do not insert missing type 2 attributes + (only with --do-checks) + + +i1 --invent-type1 + invent missing type 1 attributes + (only with --do-checks) + + -i1 --no-type1-invent + do not invent missing type 1 attributes + (only with --do-checks) + +character set: + + +l1 --latin1 + set latin-1 as standard character set (default) + + -l1 --no-latin1 + keep 7-bit ASCII as standard character set + +other processing options: + + -k --key [k]ey: gggg,eeee="str", path or dictionary name="str" + add further attribute +\endverbatim + +\subsection img2dcm_output_options output options +\verbatim +target SOP class: + + -sc --sec-capture + write Secondary Capture SOP class + + -nsc --new-sc + write new Secondary Capture SOP classes + + -vlp --vl-photo + write Visible Light Photographic SOP class (default) + +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section img2dcm_notes NOTES + +\subsection img2dcm_attribute_sources Attribute Sources + +For converting a general image format into DICOM format, the \b img2dcm +application may be fed with some additional input for filling mandatory (and +optional) attributes in the new DICOM file like patient, study and series +information. This information can be collected using different approaches, +which can be combined and are applied to the result file in the following +order: + +\li Using the \e --dataset-from option \b img2dcm is forced to import + attributes from an existing DICOM file. The given DICOM file is fully + imported and serves as the basis for all further export operations. + As an exception, the SOP Instance UID is not copied by this option. + Also image related data like Rows, Columns etc. is exchanged during + conversion. Note that \b img2dcm does not check any other attribute + values for validity, e. g. it does not look into sequences to adapt any + attributes to the new object (referenced images etc.). Therefore, it is + recommended to use the templates in the data directory for (old) SC and + VLP objects. See also section "Input Templates". + +\li The \e --study-from and \e --series-from options (mutually exclusive) can + be used to import patient, study and series information from an existing + DICOM file. If \e --series-from is specified, then the given DICOM file + is opened by \b img2dcm and all mandatory information down to the series + level is imported. Note that this includes patient, study and series + information. In case of \e --study-from, the series information is + excluded. The following attributes are taken over: + \verbatim + Patient Level: + Patient's Name + Patient ID + Patient's Sex + Patient's Birth Date + Specific Character Set + + Study Level: + Study Instance UID + Study Date + Study Time + Referring Physician's Name + Study ID + Accession Number + + Series Level (only in case of option --series-from): + Series Instance UID + Series Number + Manufacturer + \endverbatim + +\li With the \e --insert-type2 and \e --invent-type1 options (both enabled per + default), missing attributes (type 2 attributes) and/or missing attribute + values (for type 1 attributes) are automatically added and invented by + \b img2dcm. Please note that these options are only evaluated if option + \e --do-checks is enabled (default). If the \e --no-checks options is + enabled, no automatic attribute insertion will take place. + +\li The \e --key option can be used to add further attributes to the DICOM + output file. This option is applied at the very end, just before saving the + DICOM file. It is also possible to specify sequences, items and nested + attributes using the \e --key option. In these cases, a special "path" + notation has to be used. Details on this path notation can be found in the + documentation of \b dcmodify. + +\subsection img2dcm_uids UIDs + +New Study and Series Instance UIDs are generated if necessary after +applying the \e --study-from and \e --series options. If Study Instance UID or +Series Instance UID are not present after these steps, they are newly generated, +independently from each other. +A contrary behavior is chosen for the SOP Instance UID that one could expect +to be taken over when using the \e --dataset-from option. This is \b not the +case, the SOP Instance UID is \b not copied to the new object. This should +be the desirable behavior for most use cases. However, if a certain SOP +Instance UID should be inserted into the new object, the \e --key option should +be used. + +\subsection img2dcm_input_templates Input Templates + +For supporting the conversion into DICOM, \b img2dcm comes with some +pre-defined templates which can be used for the \e --dataset-from option (see +sample files \e SC.dump and \e VLP.dump). These templates should be filled with +the desired values and then must be dumped (converted) to a DICOM file before +actually being used with \b img2dcm. Use \b dump2dcm to convert the dump to +DICOM. Example: +\verbatim + dump2dcm SC.dump SC.dcm +\endverbatim + +It is possible to use any DICOM file as a template. Please note that the +complete DICOM dataset is imported; hence, it should be assured that only +attributes are present which should be part of the constructed DICOM object. +The SOP Class UID and the Pixel Data attributes (including attributes like +Rows, Columns etc.) are not copied but replaced by \b img2dcm during conversion. + +\subsection img2dcm_input_plugins Input Plugins + +The \b img2dcm application currently supports the JPEG and the BMP image format +as input. + +\subsubsection img2dcm_jpeg_input_plugin JPEG Input Plugin + +For JPEG, the original JPEG from the source file is not decoded but extracted +and slightly transformed (e. g. JFIF header is cut off) to allow fast +conversion of even big JPEG files without the need of decoding and re-encoding. +The JPEG plugin chooses the necessary output transfer syntax automatically +depending on the actual encoding of the data inside the JPEG file. Therefore, +the following Transfer Syntaxes (and their corresponding JPEG encodings) are +used by the JPEG plugin: + +\li JPEG Coding Process 1 + Baseline, Lossy, Non-Hierarchical, Sequential, DCT, Huffman, 8 Bit + SOP Class = 1.2.840.10008.1.2.4.50 + +\li JPEG Coding Process 2 (8-bit) and 4 (12-bit) + Extended, Lossy, Non-Hierarchical, Sequential, DCT, Huffman, 8/12 Bit + SOP Class = 1.2.840.10008.1.2.4.51 + +\li JPEG Coding Process 10 (8-bit) and 12 (12-bit) + Full Progression, lossy, Non-Hierarch., Progressive, DCT, Huffman, 8/12 Bit + SOP Class = 1.2.840.10008.1.2.4.55 + +Color and grayscale images are supported. + +The support for the Extended JPEG Transfer Syntax can be disabled +(\e --disable-ext option) as well as the support for the (retired) Progressive +JPEG Transfer Syntax (\e --disable-progr option). + +JPEG lossless encoding as well as any arithmetic or hierarchical JPEG encoding +modes are not supported by the plugin. + +JFIF (JPEG File Interchange Format) information facilitates optional APPn +markers in a JPEG file. Many digital cameras do not integrate such JFIF +information into the JPEG output they create. For example, JFIF contains +information about the pixel aspect ratio of the compressed image. If you want +the \b img2dcm application to insist on a JFIF header in the JPEG stream, you +can use the option \e --insist-on-jfif which will abort if no JFIF information +can be found. By default, missing JFIF information is ignored. + +For DICOM it is kind of a "gray zone", whether the integration of JFIF (or any +other APPn) data into the DICOM object's internal JPEG stream is allowed or +not. However, the most reliable approach is to cut those markers and their +information off the JPEG stream. This approach is also taken by the \b img2dcm +application. By default, all APPn markers are cut off from the original JPEG +stream. However, if you want to keep other APPn markers than JFIF (e. g. +EXIF information) inside the DICOM stream, the option \e --keep-appn +does the trick. It should also be slightly faster than cutting off APPn +information, because it is not necessary to scan the whole JPEG stream for +such data. JFIF information is \b always removed by \b img2dcm. + +\subsubsection img2dcm_bmp_input_plugin BMP Input Plugin + +\b img2dcm supports BMP as input format. However, so far only the most common +BMP images are supported. In particular, BMP images which use bit fields or +run length encoding will be rejected. Such images are uncommon. All input images +will be converted into a DICOM image with RGB color model and a bit depth of 24. +There are no specific options for fine-tuning BMP format conversion. + +\subsection img2dcm_output_plugins Output Plugins + +The desired output SOP Class can be selected on the command line. Currently, +an export plugin for the Secondary Capture Image SOP class (default, option +\e -sc), the new Secondary Capture Image SOP classes (option \e -nsc) and +Visible Light Photographic Image SOP class (option \e -vl) are available. +Please note that the first one is deprecated according to the DICOM standard +but is selected as a default because it is widely supported. Future versions +of \b img2dcm might provide further output plugins for other SOP Classes. + +For the new Secondary Capture SOP classes, it is not possible to specify which +specific SOP class should be used for output. That is because these new SOP +classes are differentiated from each other by color depth (1/8/16) and the +fact whether the image is black/white or color. That is why \b img2dcm decides +during conversion, which output SOP class is suitable for a given source image. + +\section img2dcm_examples EXAMPLES + +Here are some examples that show how the \b img2dcm application can be used. + +
    + +
  1. +img2dcm image.jpg out.dcm +
    Read JPEG file "image.jpg", convert to the old Secondary Capture SOP class +and save the result to DICOM file "out.dcm". This is the easiest way of using +\b img2dcm. Any type 1 and type 2 attributes required for writing valid objects +of this SOP class are inserted automatically. +
  2. + +
  3. +img2dcm -i BMP image.bmp out.dcm +
    Same as above but tells img2dcm to read a BMP file instead of JPEG. +
  4. + +
  5. +img2dcm image.jpg out.dcm -vlp -k "PatientName=Bond^James" +
    Same as first example, but writes Visible Light Photographic Image object +to "out.dcm" and sets PatientName to "Bond^James" which otherwise would be +left empty. +
  6. + +
  7. +img2dcm image.jpg out.dcm --series-from template.dcm -k +"PatientName=Bond^James" +
    Same as 1), but imports patient/study/series information from DICOM file +"template.dcm". Please note that attribute PatientName will contain +"Bond^James" at the end, any value from "template.dcm" will be overwritten. +That is, because the -k option is applied at the very end of the conversion +pipeline (see above). +
  8. + +
  9. +img2dcm image.jpg out.dcm --no-checks +
    Same as 1), but does not perform any attribute checking and no type 1 and +type 2 attribute insertion! So in this case, an invalid DICOM object would be +generated. This can be interesting if the output file is not meant to be +completed but will undergo further transformations, e. g. adding attributes +using \b dcmodify. Only use option \e --no-checks if you know what you are +doing! +
  10. + +
  11. +img2dcm image.jpg out.dcm --no-type1-invent +
    Same as 1), but does not insert missing type 1 attributes and/or their +values. Type 2 attributes will be inserted. Note that in this case it must be +assured that all type 1 attributes are provided by other means, i. e. by adding +them with the \e --key option. Otherwise, \b img2dcm will report an error and +will stop converting. +
  12. + +
  13. +img2dcm image.jpg out.dcm --keep-appn --insist-on-jfif +
    Same as 1), but takes over APPn information like EXIF into the DICOM +object's resulting JPEG stream. Further, \e --insist-on-jfif will force +\b img2dcm to abort if no JFIF information is existent in the source file. +
  14. + +
+ +\section img2dcm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section img2dcm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section img2dcm_environment ENVIRONMENT + +The \b img2dcm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section img2dcm_files FILES + +\/SC.dump - Sample dump file for Secondary Capture images +\n\/VLP.dump - Sample dump file for Visible Light Photographic +images + +\section img2dcm_see_also SEE ALSO + +dcm2pnm(1), dcmj2pnm(1), dump2dcm(1), dcmconv(1), +dcmodify(1) + +\section img2dcm_copyright COPYRIGHT + +Copyright (C) 2007-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/pdf2dcm.man b/dcmdata/docs/pdf2dcm.man new file mode 100644 index 00000000..282476d7 --- /dev/null +++ b/dcmdata/docs/pdf2dcm.man @@ -0,0 +1,252 @@ +/*! + +\if MANPAGES +\page pdf2dcm Encapsulate PDF file into DICOM file format +\else +\page pdf2dcm pdf2dcm: Encapsulate PDF file into DICOM file format +\endif + +\section pdf2dcm_synopsis SYNOPSIS + +\verbatim +pdf2dcm [options] pdffile-in dcmfile-out +\endverbatim + +\section pdf2dcm_description DESCRIPTION + +The \b pdf2dcm utility reads a PDF file (\e pdffile-in), converts it to a +DICOM Encapsulated PDF Storage SOP instance and stores the converted data +to an output file (\e dcmfile-out). + +\section pdf2dcm_parameters PARAMETERS + +\verbatim +pdffile-in PDF input filename to be encapsulated + +dcmfile-out DICOM output filename +\endverbatim + +\section pdf2dcm_options OPTIONS + +\subsection pdf2dcm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection pdf2dcm_dicom_document_options DICOM document options +\verbatim +document title: + + +t --title [t]itle: string (default: empty) + document title + + +cn --concept-name [CSD] [CV] [CM]: string (default: empty) + coded representation of document title defined by coding + scheme designator CSD, code value CV and code meaning CM + +patient data: + + +pn --patient-name [n]ame: string + patient's name in DICOM PN syntax + + +pi --patient-id [i]d: string + patient identifier + + +pb --patient-birthdate [d]ate: string (YYYYMMDD) + patient's birth date + + +ps --patient-sex [s]ex: string (M, F or O) + patient's sex + +study and series: + + +sg --generate + generate new study and series UIDs (default) + + +st --study-from [f]ilename: string + read patient/study data from DICOM file + + +se --series-from [f]ilename: string + read patient/study/series data from DICOM file + +instance number: + + +i1 --instance-one + use instance number 1 (default, not with +se) + + +ii --instance-inc + increment instance number (only with +se) + + +is --instance-set [i]nstance number: integer + use instance number i + +burned-in annotation: + + +an --annotation-yes + document contains patient identifying data (default) + + -an --annotation-no + document does not contain patient identifying data +\endverbatim + +\subsection pdf2dcm_processing_options processing options +\verbatim +other processing options: + + -k --key [k]ey: gggg,eeee="str", path or dictionary name="str" + add further attribute +\endverbatim + +\subsection pdf2dcm_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section pdf2dcm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section pdf2dcm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section pdf2dcm_exit_codes EXIT CODES + +The \b pdf2dcm utility uses the following exit codes when terminating. This +enables the user to check for the reason why the application terminated. + +\subsection pdf2dcm_exit_codes_general general +\verbatim +EXITCODE_NO_ERROR 0 +EXITCODE_COMMANDLINE_SYNTAX_ERROR 1 +EXITCODE_MEMORY_EXHAUSTED 4 +\endverbatim + +\subsection pdf2dcm_exit_codes_input_file_errors input file errors +\verbatim +EXITCODE_CANNOT_READ_INPUT_FILE 20 +EXITCODE_NO_INPUT_FILES 21 +EXITCODE_INVALID_INPUT_FILE 22 +\endverbatim + +\subsection pdf2dcm_exit_codes_output_file_errors output file errors +\verbatim +EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40 +\endverbatim + +\section pdf2dcm_environment ENVIRONMENT + +The \b pdf2dcm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment +variable. +It is an error if no data dictionary can be loaded. + +\section pdf2dcm_see_also SEE ALSO + +dcm2pdf(1) + +\section pdf2dcm_copyright COPYRIGHT + +Copyright (C) 2005-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/stl2dcm.man b/dcmdata/docs/stl2dcm.man new file mode 100644 index 00000000..e47a7c30 --- /dev/null +++ b/dcmdata/docs/stl2dcm.man @@ -0,0 +1,268 @@ +/*! + +\if MANPAGES +\page stl2dcm Encapsulate STL file into DICOM file format +\else +\page stl2dcm stl2dcm: Encapsulate STL file into DICOM file format +\endif + +\section stl2dcm_synopsis SYNOPSIS + +\verbatim +stl2dcm [options] stlfile-in dcmfile-out +\endverbatim + +\section stl2dcm_description DESCRIPTION + +The \b stl2dcm utility reads a STL file (\e stlfile-in), converts it to a +DICOM Encapsulated STL Storage SOP instance and stores the converted data +to an output file (\e dcmfile-out). + +\section stl2dcm_parameters PARAMETERS + +\verbatim +stlfile-in STL input filename to be encapsulated + +dcmfile-out DICOM output filename +\endverbatim + +\section stl2dcm_options OPTIONS + +\subsection stl2dcm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection stl2dcm_dicom_document_options DICOM document options +\verbatim +document title: + + +t --title [t]itle: string (default: empty) + document title + + +cn --concept-name [CSD] [CV] [CM]: string (default: empty) + coded representation of document title defined by coding + scheme designator CSD, code value CV and code meaning CM + +patient data: + + +pn --patient-name [n]ame: string + patient's name in DICOM PN syntax + + +pi --patient-id [i]d: string + patient identifier + + +pb --patient-birthdate [d]ate: string (YYYYMMDD) + patient's birth date + + +ps --patient-sex [s]ex: string (M, F or O) + patient's sex + +study and series: + + +sg --generate + generate new study and series UIDs (default) + + +st --study-from [f]ilename: string + read patient/study data from DICOM file + + +se --series-from [f]ilename: string + read patient/study/series data from DICOM file + +instance number: + + +i1 --instance-one + use instance number 1 (default, not with +se) + + +ii --instance-inc + increment instance number (only with +se) + + +is --instance-set [i]nstance number: integer + use instance number i + +burned-in annotation: + + +an --annotation-yes + document contains patient identifying data (default) + + -an --annotation-no + document does not contain patient identifying data + +enhanced general equipment: + + +mn --manufacturer [n]ame: string + manufacturer's name + + +mm --manufacturer-model [n]ame: string + manufacturer's model name + + +ds --device-serial [n]umber: string + device serial number + + +sv --software-versions [v]ersions: string + software versions + +3d model measurement units: + + +mu --measurement-units [CSD] [CV] [CM]: string + measurement units with coding scheme designator CSD, + code value CV and code meaning CM (default: UCUM, um, um) +\endverbatim + +\subsection stl2dcm_processing_options processing options +\verbatim +other processing options: + + -k --key [k]ey: gggg,eeee="str", path or dictionary name="str" + add further attribute +\endverbatim + +\subsection stl2dcm_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section stl2dcm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section stl2dcm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section stl2dcm_exit_codes EXIT CODES + +The \b stl2dcm utility uses the following exit codes when terminating. This +enables the user to check for the reason why the application terminated. + +\subsection stl2dcm_exit_codes_general general +\verbatim +EXITCODE_NO_ERROR 0 +EXITCODE_COMMANDLINE_SYNTAX_ERROR 1 +EXITCODE_MEMORY_EXHAUSTED 4 +\endverbatim + +\subsection stl2dcm_exit_codes_input_file_errors input file errors +\verbatim +EXITCODE_CANNOT_READ_INPUT_FILE 20 +EXITCODE_NO_INPUT_FILES 21 +EXITCODE_INVALID_INPUT_FILE 22 +\endverbatim + +\subsection stl2dcm_exit_codes_output_file_errors output file errors +\verbatim +EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40 +\endverbatim + +\section stl2dcm_environment ENVIRONMENT + +The \b stl2dcm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment +variable. +It is an error if no data dictionary can be loaded. + +\section stl2dcm_copyright COPYRIGHT + +Copyright (C) 2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/docs/xml2dcm.man b/dcmdata/docs/xml2dcm.man new file mode 100644 index 00000000..02fea6cd --- /dev/null +++ b/dcmdata/docs/xml2dcm.man @@ -0,0 +1,347 @@ +/*! + +\if MANPAGES +\page xml2dcm Convert XML document to DICOM file or data set +\else +\page xml2dcm xml2dcm: Convert XML document to DICOM file or data set +\endif + +\section xml2dcm_synopsis SYNOPSIS + +\verbatim +xml2dcm [options] xmlfile-in dcmfile-out +\endverbatim + +\section xml2dcm_description DESCRIPTION + +The \b xml2dcm utility converts the contents of an XML (Extensible Markup +Language) document to DICOM file or data set. The XML document is expected to +validate against the DTD (Document Type Definition) which is described in file +dcm2xml.dtd. An appropriate XML file can be created using the +\b dcm2xml tool (option \e +Wb recommended to include binary data). + +\section xml2dcm_parameters PARAMETERS + +\verbatim +xmlfile-in XML input filename to be converted (stdin: "-") + +dcmfile-out DICOM output filename +\endverbatim + +\section xml2dcm_options OPTIONS + +\subsection xml2dcm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection xml2dcm_input_options input options +\verbatim +input file format: + + +f --read-meta-info + read meta information if present (default) + + -f --ignore-meta-info + ignore file meta information +\endverbatim + +\subsection xml2dcm_processing_options processing options +\verbatim +validation: + + +Vd --validate-document + validate XML document against DTD + + +Vn --check-namespace + check XML namespace in document root + +unique identifiers: + + +Ug --generate-new-uids + generate new Study/Series/SOP Instance UID + + -Uo --dont-overwrite-uids + do not overwrite existing UIDs (default) + + +Uo --overwrite-uids + overwrite existing UIDs +\endverbatim + +\subsection xml2dcm_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + + +Fu --update-meta-info + update particular file meta information + +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + + +td --write-xfer-deflated + write with deflated explicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes and items on + multiple of i bytes + +deflate compression level (only with --write-xfer-deflated): + + +cl --compression-level [l]evel: integer (default: 6) + 0=uncompressed, 1=fastest, 9=best compression +\endverbatim + +\section xml2dcm_notes NOTES + +The basic structure of the XML input expected looks like the following: + +\verbatim + + + + + + 166 + + ... + + OFFIS_DCMTK_353 + + + + + ISO_IR 100 + + ... + + + + 256\\0\\8 + + ... + + ... + + ... + + + + +\endverbatim + +The "file-format" and "meta-header" tags may be absent for DICOM data sets. + +\subsection xml2dcm_character_encoding Character Encoding + +The DICOM character encoding is determined automatically from the element with +tag "0008,0005" (Specific Character Set) - if present. The following +character sets are currently supported (requires \b libxml to include \b iconv +support, see \e --version output): + +\verbatim +ASCII (ISO_IR 6) (UTF-8) +UTF-8 "ISO_IR 192" (UTF-8) +ISO Latin 1 "ISO_IR 100" (ISO-8859-1) +ISO Latin 2 "ISO_IR 101" (ISO-8859-2) +ISO Latin 3 "ISO_IR 109" (ISO-8859-3) +ISO Latin 4 "ISO_IR 110" (ISO-8859-4) +ISO Latin 5 "ISO_IR 148" (ISO-8859-9) +Cyrillic "ISO_IR 144" (ISO-8859-5) +Arabic "ISO_IR 127" (ISO-8859-6) +Greek "ISO_IR 126" (ISO-8859-7) +Hebrew "ISO_IR 138" (ISO-8859-8) +\endverbatim + +Multiple character sets are not supported (only the first value of the +"Specific Character Set" is used for the character encoding in case of value +multiplicity). + +See \b dcm2xml documentation for more details on the XML structure. + +\subsection xml2dcm_binary_data Binary Data + +Binary data (*) can be encoded either as a sequence of hex numbers separated by +a backslash "\" or in Base64 format (binary="base64"). In addition, binary data +can also be read from file (binary="file"). In this case, the filename has to +be specified as the element value, e.g. + +\verbatim +subdir/pixeldata.raw +\endverbatim + +Please note that the contents of the file will be read as is. OW data is +expected to be little endian ordered and will be swapped if necessary. No +checks will be made to ensure that the amount of data is reasonable in terms +of other attributes such as Rows or Columns. + +(*) Please note that currently only OB and OW data is supported, i.e. element +values with a VR of OD, OF, OL and OV are not regarded as "binary data" and +treated as all other VRs. + +\subsection xml2dcm_compression Compression + +If libxml is compiled with zlib support, the input file (\e xmlfile-in) can +also be compressed with ZIP, which usually results in much smaller files. See +output of option \e --version in order to check whether zlib support is +available. + +\subsection xml2dcm_limitations Limitations + +Different versions of libxml might have different limits for the maximum +length of an XML element value. Therefore, it should be avoided to use very +long element values (e.g. for pixel data). + +Please note that \b xml2dcm currently does not fully support DICOMDIR files. +Specifically, the value of the various offset data elements is not updated +automatically by this tool. + +\section xml2dcm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section xml2dcm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section xml2dcm_environment ENVIRONMENT + +The \b xml2dcm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section xml2dcm_files FILES + +\/dcm2xml.dtd - Document Type Definition (DTD) file + +\section xml2dcm_see_also SEE ALSO + +dcm2xml(1) + +\section xml2dcm_copyright COPYRIGHT + +Copyright (C) 2003-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmdata/etc/Makefile.in b/dcmdata/etc/Makefile.in new file mode 100644 index 00000000..5018dc7b --- /dev/null +++ b/dcmdata/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmdata/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmdata/include/CMakeLists.txt b/dcmdata/include/CMakeLists.txt new file mode 100644 index 00000000..ff2225d2 --- /dev/null +++ b/dcmdata/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmdata DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmdata/include/Makefile.in b/dcmdata/include/Makefile.in new file mode 100644 index 00000000..25103028 --- /dev/null +++ b/dcmdata/include/Makefile.in @@ -0,0 +1,32 @@ +# +# Makefile for dcmdata/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmdata + for file in dcmtk/dcmdata/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmdata ;\ + done + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmdata/libi2d + for file in dcmtk/dcmdata/libi2d/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmdata/libi2d ;\ + done + + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmdata/include/dcmtk/dcmdata/cmdlnarg.h b/dcmdata/include/dcmtk/dcmdata/cmdlnarg.h new file mode 100644 index 00000000..f292ca29 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/cmdlnarg.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Provide prototype of command line argument gathering routine + * for OS environments which cannot pass arguments on the command line. + * + */ + +#ifndef CMDLNARG_H +#define CMDLNARG_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcdefine.h" + +/** this function is used on certain operating systems (in particular, classic MacOS) + * and allows command line arguments to be input from stdin. + * MT level: Thread unsafe! + * @param argc the argc parameter of main() is passed in this parameter + * @param argv the argv parameter of main() is passed in this parameter + * @param progname program name + */ +DCMTK_DCMDATA_EXPORT void prepareCmdLineArgs(int& argc, char** argv, const char* progname = "aProgram"); + +#ifdef HAVE_WINDOWS_H + +/** this function is used on certain operating systems (in particular, classic MacOS) + * and allows command line arguments to be input from stdin. + * MT level: Thread unsafe! + * This is a Windows-specific version supporting the wide character encoding (UTF-16). + * @remark this method is only available if DCMTK is compiled on Windows + * Operating Systems (defining _WIN32) + * @param argc the argc parameter of main() is passed in this parameter (not used) + * @param argv the argv parameter of main() is passed in this parameter (not used) + * @param progname program name (not used) + */ +DCMTK_DCMDATA_EXPORT void prepareCmdLineArgs(int& argc, wchar_t** argv, const char* progname = "aProgram"); + +#endif // HAVE_WINDOWS_H + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcbytstr.h b/dcmdata/include/dcmtk/dcmdata/dcbytstr.h new file mode 100644 index 00000000..ca28195a --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcbytstr.h @@ -0,0 +1,498 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmByteString + * + */ + + +#ifndef DCBYTSTR_H +#define DCBYTSTR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/ofstd/ofstring.h" + +// forward declarations +class DcmJsonFormat; + +// include this file in doxygen documentation + +/** @file dcbytstr.h + * @brief base class for all DICOM value representations storing a character string + */ + +/** This flag defines whether the VR checker is actually used by the various + * checkStringValue() methods. Since this checker is currently limited to + * ASCII and Latin-1, and the detection of the character set might fail for + * incorrectly encoded DICOM datasets, this check can be disabled globally. + * Please note, however, that other checks (i.e. VM and max. value length) + * are still performed if the optional parameters are set accordingly. + * By default, the VR checker is enabled (value: "OFTrue"). + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableVRCheckerForStringValues; /* default: OFTrue */ + + +/** base class for all DICOM value representations storing a character string + */ +class DCMTK_DCMDATA_EXPORT DcmByteString: public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmByteString(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmByteString(const DcmByteString &old); + + /** destructor + */ + virtual ~DcmByteString(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmByteString& operator=(const DcmByteString& obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmByteString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_UNKNOWN) + */ + virtual DcmEVR ident() const; + + /** clear the currently stored value + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear(); + + /** get value multiplicity + * @return number of string components (separated by a backslash) + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element. + * The result is the same as getVM() unless overwritten in a derived class. + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** get length of the stored value. + * Trailing spaces (padding characters) are ignored for the "real" length. + * @return number of characters stored for the string value + */ + Uint32 getRealLength(); + + /** get DICOM length of the stored value. + * The string value is padded if required. Therefore, the returned length + * always has an even value. + * @param xfer not used + * @param enctype not used + * @return number of characters stored in DICOM representation + */ + virtual Uint32 getLength(const E_TransferSyntax xfer = EXS_LittleEndianImplicit, + const E_EncodingType enctype = EET_UndefinedLength); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of string + * components (if any). + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** write data element to a stream + * @param outStream output stream + * @param oxfer transfer syntax used to write the data + * @param enctype flag, specifying the encoding with undefined or explicit length + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write data element to a stream as required for the creation of digital signatures + * @param outStream output stream + * @param oxfer transfer syntax used to write the data + * @param enctype flag, specifying the encoding with undefined or explicit length + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used since string normalization depends on value representation + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get entire element value as a character string. + * In case of VM > 1 the individual values are separated by a backslash ('\'). + * @param stringVal variable in which the result value is stored + * @param normalize normalize each element value prior to concatenation + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFStringArray(OFString &stringVal, + OFBool normalize = OFTrue); + + /** get a pointer to the current string value. + * This includes all string components and separators. + * NB: This method does not copy the stored value. + * @param stringVal reference to the pointer variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getString(char *&stringVal); + + /** get a pointer to the current string value. + * This includes all string components and separators. Since the length is returned + * separately, the string value can contain more than one NULL byte. + * NB: This method does not copy the stored value. + * @param stringVal reference to the pointer variable + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getString(char *&stringVal, + Uint32 &stringLen); + + /** set element value from the given character string. + * The length of the given string is determined automatically by searching for the + * first NULL byte. + * @param stringVal input character string (possibly multi-valued) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string (possibly multi-valued) + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored string value. + * Checks every string component for the maximum length specified for the particular + * value representation. + * @param autocorrect correct value and value component length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /** check if this element contains non-ASCII characters. Please note that this check + * is pretty simple and only works for single-byte character sets that do include + * the 7-bit ASCII codes, e.g. for the ISO 8859 family. In other words: All character + * codes below 128 are considered to be ASCII codes and all others are considered to + * be non-ASCII. + * @param checkAllStrings if true, also check elements with string values not affected + * by SpecificCharacterSet (0008,0005). By default, only check PN, LO, LT, SH, ST, + * UC and UT, i.e. none of the derived VR classes. + * @return true if element contains non-ASCII characters, false otherwise + */ + virtual OFBool containsExtendedCharacters(const OFBool checkAllStrings = OFFalse); + + /** check if this element is affected by SpecificCharacterSet + * @return always returns false since none of the derived VR classes is affected by + * the SpecificCharacterSet (0008,0005) element + */ + virtual OFBool isAffectedBySpecificCharacterSet() const; + + /** check if this object is empty + * @param normalize normalize value before checking (ignore non-significant characters) + * @return true if object is empty, i.e.\ has no value, false otherwise + */ + virtual OFBool isEmpty(const OFBool normalize = OFTrue); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /// @copydoc DcmElement::matches() + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /** perform attribute matching on a single pair of string values. + * Compare two single string values using the attribute matching function appropriate for + * this element's VR (Universal Matching, Single Value Matching, Wild Card Matching or + * Range Matching). + * @note This method is called by the other overload of matches() for each combination of + * values in the key and candidate element (implementing multi value matching for + * elements with VM>1). + * @param key the key value to match against the candidate. + * @param candidate the candidate value to match the key against. + * @param enableWildCardMatching enable or disable wild card matching. Defaults to OFTrue, + * which means wild card matching is performed if the element's VR supports it. Set to + * OFFalse to force single value matching instead. + * @return OFTrue if the candidate string matches the key string, OFFalse otherwise. + */ + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmByteString(const DcmTag &tag, + const Uint32 len); + + /// internal type used to specify the current string representation + enum E_StringMode + { + /// string has internal representation (no padding) + DCM_MachineString, + /// string has DICOM representation (even length) + DCM_DicomString, + /// string has unknown representation (maybe multiple padding chars?) + DCM_UnknownString + }; + + /** create a new value field (string buffer) of the previously defined size + * (member variable 'Length'). Also handles odd value length by allocating + * extra space for the padding character. + * This method is used by derived classes only. + * @return pointer to the newly created value field + */ + virtual Uint8 *newValueField(); + + /** method is called after the element value has been loaded. + * Can be used to correct the value before it is used for the first time. + */ + virtual void postLoadValue(); + + /** get current representation of the string value + * @return current representation of the string value + */ + E_StringMode getStringMode() const { return fStringMode; } + + /** convert currently stored string value to internal representation. + * It removes any trailing space character and recomputes the string length. + * @param length number of characters of the string value (optional) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition makeMachineByteString(const Uint32 length = 0); + + /** convert currently stored string value to DICOM representation. + * It removes trailing spaces apart from a possibly required single padding + * character (in case of odd string length). + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition makeDicomByteString(); + + /** get a copy of the current string value. + * This includes all string components and separators. + * @param stringVal variable in which the result is stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStringValue(OFString &stringVal); + + /** get the maximum number of characters for each string component + * @return maximum number of characters for each string component + */ + Uint32 getMaxLength() const { return maxLength; } + + /** get the end-of-string padding character + * @return end-of-string padding character + */ + char getPaddingChar() const { return paddingChar; } + + /** set the end-of-string padding character + * @param c end-of-string padding character + */ + void setPaddingChar(char c) { paddingChar = c; } + + /** set the maximum number of characters for each string component + * @param val maximum number of characters for each string component + */ + void setMaxLength(Uint32 val) { maxLength = val; } + + /** set non-significant characters used to determine whether the value is empty + * @param characters non-significant characters used to determine whether the value is empty + */ + void setNonSignificantChars(const OFString &characters) { nonSignificantChars = characters; } + + /* --- static helper functions --- */ + + /** check if a given character string contains non-ASCII characters. + * Please note that this check is pretty simple and only works for single-byte character + * sets that do include the 7-bit ASCII codes, e.g. for the ISO 8859 family. In other + * words: All character codes below 128 are considered to be ASCII codes and all others + * are considered to be non-ASCII. + * @param stringVal character string to be checked + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return true if character string contains non-ASCII characters, false otherwise + */ + static OFBool containsExtendedCharacters(const char *stringVal, + const size_t stringLen); + + /** check whether given string value conforms to a certain VR and VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values; "" for no check.) + * @param vr two-character identifier of the VR to be checked (lower case) + * @param vrID expected numeric identifier of the VR + * @param maxLen maximum number of characters allowed for a single value (0 = no check) + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm, + const OFString &vr, + const int vrID, + const size_t maxLen = 0, + const OFString &charset = ""); + +private: + + /// padding character used to adjust odd value length (e.g. a space) + char paddingChar; + + /// maximum number of characters for each string component + Uint32 maxLength; + + /// number of characters of the internal string representation + Uint32 realLength; + + /// current representation of the string value + E_StringMode fStringMode; + + /// non-significant characters used to determine whether the value is empty + OFString nonSignificantChars; +}; + + +/** @name string normalization flags. + * These flags can be used with normalizeString() to specify the extent of normalization. + */ +//@{ + +/// delete trailing spaces +const OFBool DELETE_TRAILING = OFTrue; +/// delete leading spaces +const OFBool DELETE_LEADING = OFTrue; +/// handle string as multi-valued (components separated by a backslash) +const OFBool MULTIPART = OFTrue; + +//@} + + +/* Function to get part out of a String for VM > 1 */ + +/** normalize the given string value, i.e.\ remove leading and/or trailing padding + * @param string input and output string value to be normalized + * @param multiPart handle string as multi-valued if OFTrue + * @param leading delete leading spaces if OFTrue + * @param trailing delete trailing spaces if OFTrue + * @param paddingChar padding character to be removed (usually a space) + */ +DCMTK_DCMDATA_EXPORT void normalizeString(OFString &string, + const OFBool multiPart, + const OFBool leading, + const OFBool trailing, + const char paddingChar = ' '); + + +#endif // DCBYTSTR_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcchrstr.h b/dcmdata/include/dcmtk/dcmdata/dcchrstr.h new file mode 100644 index 00000000..8b8535ad --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcchrstr.h @@ -0,0 +1,175 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: Interface of class DcmCharString + * + */ + + +#ifndef DCCHRSTR_H +#define DCCHRSTR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +// +// This implementation does not support 16 bit character sets. Since 8 bit +// character sets are supported by the class DcmByteString the class +// DcmCharString is derived from DcmByteString without any extensions. +// +// If the extension for 16 bit character sets will be implemented, this class +// must be derived directly from DcmElement. This class is designed to support +// the value representations (LO, LT, PN, SH, ST, UC and UT). They are a problem +// because their value width (1, 2, ... bytes) is specified by the element +// SpecificCharacterSet (0008,0005) and an implementation must support +// different value widths that cannot be derived from the value representation. +// + +#include "dcmtk/dcmdata/dcbytstr.h" + +// forward declarations +class DcmJsonFormat; + +/** base class for DICOM elements with value representation LO, LT, PN, SH, ST, UC and UT + */ +class DCMTK_DCMDATA_EXPORT DcmCharString + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmCharString(const DcmTag &tag, + const Uint32 len); + + /** copy constructor + * @param old element to be copied + */ + DcmCharString(const DcmCharString &old); + + /** destructor + */ + virtual ~DcmCharString(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmCharString &operator=(const DcmCharString &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmCharString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** check the currently stored string value. + * Checks every string component for the maximum length specified for the particular + * value representation. + * @param autocorrect correct value and value component length if OFTrue. + * NB: This parameter does currently nothing since it is unknown to this class + * whether a character consists of one or more bytes. To be fixed in a future + * version when multi-byte character sets are (hopefully) supported. + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /** check if this element contains non-ASCII characters. Please note that this check + * is pretty simple and only works for single-byte character sets that do include + * the 7-bit ASCII codes, e.g. for the ISO 8859 family. In other words: All character + * codes below 128 are considered to be ASCII codes and all others are considered to + * be non-ASCII. + * @param checkAllStrings not used in this class + * @return true if element contains non-ASCII characters, false otherwise + */ + virtual OFBool containsExtendedCharacters(const OFBool checkAllStrings = OFFalse); + + /** check if this element is affected by SpecificCharacterSet + * @return always returns true since all derived VR classes are affected by the + * SpecificCharacterSet (0008,0005) element + */ + virtual OFBool isAffectedBySpecificCharacterSet() const; + + /** convert this element value from the currently selected source character set to + * the currently selected destination character set + * @param converter character set converter to be used to convert the element value + * @return always returns EC_Normal, since nothing to do in this base class + */ + virtual OFCondition convertCharacterSet(DcmSpecificCharacterSet &converter); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + // ensure inherited overloads of matches take part in overload resolution + using DcmByteString::matches; + + /// @copydoc DcmByteString::matches(OFString,OFString,OFBool) + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /// @copydoc DcmElement::isUniversalMatch() + virtual OFBool isUniversalMatch(const OFBool normalize = OFTrue, + const OFBool enableWildCardMatching = OFTrue); + + protected: + + /** get value of the SpecificCharacterSet element of the surrounding dataset/item + * @param charset reference to variable that will store the result value. The + * variable is not cleared in case of error! + * @return status, EC_Normal if successful (i.e. the element could be found), + * an error code otherwise. Typical error codes are: + * - EC_TagNotFound if the SpecificCharacterSet element could not be found + * - EC_CorruptedData if this object is not contained in a dataset/item + */ + OFCondition getSpecificCharacterSet(OFString &charset); + + /** get delimiter characters specifying when to switch back to the default character + * set (in case code extension techniques like ISO 2022 are used). + * @return the delimiter characters for this VR, if any, a reference to an empty + * OFString if no delimiter characters are defined for this VR. + */ + virtual const OFString& getDelimiterChars() const; + +}; + + +#endif // DCCHRSTR_H diff --git a/dcmdata/include/dcmtk/dcmdata/dccodec.h b/dcmdata/include/dcmtk/dcmdata/dccodec.h new file mode 100644 index 00000000..60b5de50 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dccodec.h @@ -0,0 +1,518 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: Interface of abstract class DcmCodec and the class DcmCodecStruct + * + */ + +#ifndef DCCODEC_H +#define DCCODEC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/ofstd/oflist.h" + +class DcmStack; +class DcmRepresentationParameter; +class DcmPixelSequence; +class DcmPolymorphOBOW; +class DcmItem; +class DcmTagKey; + +/** abstract base class for a codec parameter object that + * describes the settings (modes of operations) for one + * particular codec (DcmCodec) object. + */ +class DCMTK_DCMDATA_EXPORT DcmCodecParameter +{ +public: + /// default constructor + DcmCodecParameter() {} + + /// copy constructor + DcmCodecParameter(const DcmCodecParameter&) {} + + /// destructor + virtual ~DcmCodecParameter() {} + + /** this methods creates a copy of type DcmCodecParameter * + * it must be overwritten in every subclass. + * @return copy of this object + */ + virtual DcmCodecParameter *clone() const = 0; + + /** returns the class name as string. + * can be used as poor man's RTTI replacement. + */ + virtual const char *className() const = 0; + +}; + + +/** abstract base class for a codec object that can be registered + * in dcmdata and performs transfer syntax transformation (i.e. + * compressing, decompressing or transcoding between different + * compressed transfer syntaxes). + * When dcmdata is requested to write a transfer syntax that differs + * from the current one (i.e. the one in which the object was read), + * dcmdata dynamically searches for a DcmCodec object that is able + * to create the desired transfer syntax. If no suitable codec + * is found, the write operation fails. + */ +class DCMTK_DCMDATA_EXPORT DcmCodec +{ +public: + /// default constructor + DcmCodec() {} + + /// destructor + virtual ~DcmCodec() {} + + /** decompresses the given pixel sequence and + * stores the result in the given uncompressedPixelData element. + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param pixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const = 0; + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decodeFrame( + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const = 0; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const = 0; + + /** transcodes (re-compresses) the given compressed DICOM image and stores + * the result in the given toPixSeq element. + * @param fromRepType current transfer syntax of the compressed image + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * fromPixSeq, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + const DcmCodecParameter * cp, + DcmStack & objStack) const = 0; + + /** checks if this codec is able to convert from the + * given current transfer syntax to the given new + * transfer syntax + * @param oldRepType current transfer syntax + * @param newRepType desired new transfer syntax + * @return true if transformation is supported by this codec, false otherwise. + */ + virtual OFBool canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const = 0; + + /** determine color model of the decompressed image + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const = 0; + + // static helper methods that have proven useful in codec classes derived from DcmCodec + + /** helper function that inserts a string attribute with a given value into a dataset + * if missing in the dataset. + * @param dataset dataset to insert to, must not be NULL. + * @param tag tag key of attribute to check/insert + * @param val string value, may be NULL. + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition insertStringIfMissing(DcmItem *dataset, const DcmTagKey& tag, const char *val); + + /** helper function that converts a dataset containing a DICOM image + * into a valid (standard extended) Secondary Capture object + * by inserting all attributes that are type 1/2 in Secondary Capture + * and missing in the source dataset. Replaces SOP Class UID + * by Secondary Capture. It does not, however, change an existing SOP Instance UID. + * @param dataset dataset to insert to, must not be NULL. + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition convertToSecondaryCapture(DcmItem *dataset); + + /** create new SOP instance UID and Source Image Sequence + * referencing the old SOP instance (if present) + * @param dataset dataset to be modified + * @param purposeOfReferenceCodingScheme coding scheme designator for purpose of reference code sequence + * @param purposeOfReferenceCodeValue code value for purpose of reference code sequence + * @param purposeOfReferenceCodeMeaning code meaning for purpose of reference code sequence + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition newInstance( + DcmItem *dataset, + const char *purposeOfReferenceCodingScheme = NULL, + const char *purposeOfReferenceCodeValue = NULL, + const char *purposeOfReferenceCodeMeaning = NULL); + + /** set first value of Image Type to DERIVED. + * @param dataset dataset to be modified + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition updateImageType(DcmItem *dataset); + + /** insert code sequence into the given dataset + * @param dataset dataset to insert into + * @param tagKey tag of the code sequence + * @param codingSchemeDesignator coding scheme designator for the sequence item + * @param codeValue code value for the sequence item + * @param codeMeaning code meaning for the sequence item + * @return EC_Normal if successul, an error code otherwise + */ + static OFCondition insertCodeSequence( + DcmItem *dataset, + const DcmTagKey &tagKey, + const char *codingSchemeDesignator, + const char *codeValue, + const char *codeMeaning); + + /** determine the index number (starting with zero) of the compressed pixel data fragment + * corresponding to the given frame (also starting with zero) + * @param frameNo frame number + * @param numberOfFrames number of frames of this image + * @param fromPixSeq compressed pixel sequence + * @param currentItem index of compressed pixel data fragment returned in this parameter on success + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition determineStartFragment( + Uint32 frameNo, + Sint32 numberOfFrames, + DcmPixelSequence * fromPixSeq, + Uint32& currentItem); +}; + + +/** singleton that keeps list of registered codecs for dcmdata. + * All operations on the list are protected by a read/write lock + * and, therefore, are safe for multi-thread applications. + */ +class DCMTK_DCMDATA_EXPORT DcmCodecList +{ + +public: + + /// destructor + virtual ~DcmCodecList(); + + /** registers a codec object in the global list of codecs consulted by dcmdata + * whenever conversion to/from compressed transfer syntaxes is requested. + * This function must not be called before main() is started, e.g. from + * a constructor of a global object. + * This call is safe in multi-thread operations. + * @param aCodec pointer to codec object. + * Must remain unmodified and valid until the codec has been deregistered. + * @param aDefaultRepParam default representation parameter. + * Must remain unmodified and valid until the codec has been deregistered. + * @param aCodecParameter codec parameter. + * Must remain unmodified and valid until the codec has been deregistered or the + * parameter has been replaced by a call to updateCodecParameter() + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition registerCodec( + const DcmCodec *aCodec, + const DcmRepresentationParameter *aDefaultRepParam, + const DcmCodecParameter *aCodecParameter); + + /** deregisters a codec and it's parameter objects from the global list. + * This call is safe in multi-thread operations. + * @param aCodec pointer to registered codec + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition deregisterCodec(const DcmCodec *aCodec); + + /** updates the codec parameters object for a codec that has been registered before. + * This call is safe in multi-thread operations. + * @param aCodec pointer to codec object that has been registered before + * @param aCodecParameter codec parameter. + * Must remain unmodified and valid until the codec has been deregistered or the + * parameter has been replaced by another call to updateCodecParameter() + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition updateCodecParameter( + const DcmCodec *aCodec, + const DcmCodecParameter *aCodecParameter); + + /** looks for a codec that is able to decode from the given transfer syntax + * and calls the decode() method of the codec. A read lock on the list of + * codecs is acquired until this method returns. + * @param fromType transfer syntax to decode from + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param pixelStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + static OFCondition decode( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + DcmStack & pixelStack); + + /** looks for a codec that is able to decode from the given transfer syntax + * and calls the decodeFrame() method of the codec. A read lock on the list of + * codecs is acquired until this method returns. + * @param fromType transfer syntax to decode from + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + static OFCondition decodeFrame( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel); + + /** looks for a codec that is able to encode from the given transfer syntax + * and calls the encode() method of the codec. A read lock on the list of + * codecs is acquired until this method returns. + * @param fromRepType transfer syntax to encode from + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepType transfer syntax to compress to + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param pixelStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + static OFCondition encode( + const E_TransferSyntax fromRepType, + const Uint16 * pixelData, + const Uint32 length, + const E_TransferSyntax toRepType, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + DcmStack & pixelStack); + + /** looks for a codec that is able to transcode (re-compresses) + * from the given transfer syntax to the given transfer syntax + * and calls the encode() method of the codec. + * A read lock on the list of + * codecs is acquired until this method returns. + * @param fromRepType current transfer syntax of the compressed image + * @param fromParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepType transfer syntax to compress to + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param pixelStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + static OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const E_TransferSyntax toRepType, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + DcmStack & pixelStack); + + /** looks for a codec that claims to be able to convert + * between the given transfer syntaxes. + * A read lock on the list of + * codecs is acquired until this method returns. + * @param fromRepType current transfer syntax + * @param toRepType desired new transfer syntax + * @return true if transformation is supported by a codec, false otherwise. + */ + static OFBool canChangeCoding( + const E_TransferSyntax fromRepType, + const E_TransferSyntax toRepType); + + /** determine color model of the decompressed image + * @param fromType transfer syntax to decode from + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param dataset pointer to dataset in which pixel data element is contained + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition determineDecompressedColorModel( + const DcmXfer &fromType, + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + DcmItem *dataset, + OFString &decompressedColorModel); + +private: + + /** constructor + * @param aCodec pointer to codec object. + * @param aDefaultRepParam default representation parameter. + * @param aCodecParameter codec parameter. + */ + DcmCodecList( + const DcmCodec *aCodec, + const DcmRepresentationParameter *aDefaultRepParam, + const DcmCodecParameter *aCodecParameter); + + /// private undefined copy constructor + DcmCodecList(const DcmCodecList &); + + /// private undefined copy assignment operator + DcmCodecList &operator=(const DcmCodecList &); + + /// pointer to codec object + const DcmCodec * codec; + + /// pointer to default representation parameter + const DcmRepresentationParameter * defaultRepParam; + + /// pointer to codec parameter set + const DcmCodecParameter * codecParameter; + + /// singleton list of registered codecs + static OFList registeredCodecs; + +#ifdef WITH_THREADS + /// read/write lock guarding access to singleton list + /// @remark this member is only available if DCMTK is compiled with thread + /// support enabled. + static OFReadWriteLock codecLock; +#endif + + // dummy friend declaration to prevent gcc from complaining + // that this class only defines private constructors and has no friends. + friend class DcmCodecListDummyFriend; +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcdatset.h b/dcmdata/include/dcmtk/dcmdata/dcdatset.h new file mode 100644 index 00000000..63ea8be9 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdatset.h @@ -0,0 +1,417 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of the class DcmDataset + * + */ + + +#ifndef DCDATSET_H +#define DCDATSET_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcitem.h" + + +// forward declarations +class DcmJsonFormat; +class DcmInputStream; +class DcmOutputStream; +class DcmRepresentationParameter; + + +/** a class handling the DICOM dataset format (files without meta header) + */ +class DCMTK_DCMDATA_EXPORT DcmDataset + : public DcmItem +{ + + public: + + /** default constructor + */ + DcmDataset(); + + /** copy constructor + * @param old dataset to be copied + */ + DcmDataset(const DcmDataset &old); + + /** destructor + */ + virtual ~DcmDataset(); + + /** assignment operator + * @param obj the dataset to be copied + * @return reference to this object + */ + DcmDataset& operator=(const DcmDataset& obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmDataset(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get type identifier + * @return type identifier of this class (EVR_dataset) + */ + virtual DcmEVR ident() const; + + /** clear (remove) attribute value + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear(); + + /** remove all elements with an invalid group number, i.e. 0x0000 to 0x0003, + * 0x0005, 0x0007 and 0xFFFF in case of a data set. For sequence items, also + * group 0x0006 is disallowed. For command sets, only group 0x0000 is allowed, + * i.e. the elements from all other groups are removed. + * @param cmdSet specifies whether this object represents a command or data set + */ + virtual void removeInvalidGroups(const OFBool cmdSet = OFFalse); + + /** return the transfer syntax in which this dataset was originally read or created. + * See updateOriginalXfer() on how to update this value when created in memory. + * @return transfer syntax in which this dataset was originally read. Might be + * EXS_Unknown if the dataset was created in memory. + */ + E_TransferSyntax getOriginalXfer() const; + + /** return the current transfer syntax, i.e.\ the one that was last used with + * chooseRepresentation() in order to select a specific representation or with write() + * or writeSignatureFormat() in order to create a byte stream according to the DICOM + * encoding rules. The default value is the transfer syntax in which this dataset was + * originally read (see getOriginalXfer()) or, if this dataset was created from memory, + * the explicit VR with local endianness. + * Please note that the current transfer syntax might also change after calling + * updateOriginalXfer(). + * @return transfer syntax in which this dataset is currently stored (see above) + */ + E_TransferSyntax getCurrentXfer() const; + + /** update the original transfer syntax, e.g.\ in case the dataset was created in memory + * and pixel data was added with a particular representation. Icon images and other + * nested pixel data elements are not checked. If previously unknown, the original + * transfer syntax is set to the default EXS_LittleEndianExplicit. Please note that the + * current transfer syntax might also be updated if its value was not in sync with the + * internal representation of the pixel data. + */ + virtual void updateOriginalXfer(); + + /** print all elements of the dataset to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName optional filename used to write the raw pixel data file + * @param pixelCounter optional counter used for automatic pixel data filename creation + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** @copydoc DcmObject::calcElementLength() + */ + Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** check if this DICOM object can be encoded in the given transfer syntax. + * @param newXfer transfer syntax in which the DICOM object is to be encoded + * @param oldXfer transfer syntax in which the DICOM object was read or created + * (optional). If EXS_Unknown, the return value of getOriginalXfer() is used. + * @return true if object can be encoded in desired transfer syntax, false otherwise. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer = EXS_Unknown); + + /** This function reads the information of all attributes which + * are captured in the input stream and captures this information + * in this->elementList. Each attribute is represented as an + * element in this list. Having read all information for this + * particular data set or command, this function will also take + * care of group length (according to what is specified in glenc) + * and padding elements (don't change anything). + * @param inStream The stream which contains the information. + * @param xfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies what + * will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax xfer = EXS_Unknown, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** This function reads the information of all attributes which + * are captured in the input stream and captures this information + * in this->elementList, up to the attribute tag stopParsingAtElement. + * Each attribute is represented as an + * element in this list. Having read all information for this + * particular data set or command, this function will also take + * care of group length (according to what is specified in glenc) + * and padding elements (don't change anything). + * @param inStream The stream which contains the information. + * @param xfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies what + * will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @param stopParsingAtElement parsing of the input stream is stopped when + * this tag key or any higher tag is encountered. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readUntilTag(DcmInputStream &inStream, + const E_TransferSyntax xfer = EXS_Unknown, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength, + const DcmTagKey &stopParsingAtElement = DCM_UndefinedTagKey); + + /** write dataset to a stream + * @param outStream DICOM output stream + * @param oxfer output transfer syntax (EXS_Unknown means use original) + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** This function writes data values which are contained in this + * DcmDataset object to the stream which is passed as first argument. + * With regard to the writing of information, the other parameters + * which are passed are accounted for. The function will return + * EC_Normal, if the information from all elements of this data + * set has been written to the buffer, it will return EC_StreamNotifyClient, + * if there is no more space in the buffer and _not_ all elements + * have been written to it, and it will return some other (error) + * value if there was an error. + * @param outStream The stream that the information will be written to. + * @param oxfer The transfer syntax which shall be used (EXS_Unknown + * means use original). + * @param enctype Encoding type for sequences; specifies how sequences + * will be handled. + * @param wcache pointer to write cache object, may be NULL + * @param glenc Encoding type for group length; specifies what will + * be done with group length tags. + * @param padenc Encoding type for padding. Specifies what will be done + * with padding tags. + * @param padlen The length up to which the dataset shall be padded, if + * padding is desired. + * @param subPadlen For sequences (ie sub elements), the length up to which + * item shall be padded, if padding is desired. + * @param instanceLength Number of extra bytes added to the item/dataset length + * used when computing the padding; this parameter is for + * instance used to pass the length of the file meta header + * from the DcmFileFormat to the DcmDataset object. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache, + const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc = EPD_noChange, + const Uint32 padlen = 0, + const Uint32 subPadlen = 0, + Uint32 instanceLength = 0); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax (EXS_Unknown means use original) + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format. + * The XML declaration (e.g. ) is not written by this function. + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format. + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** write object in JSON format. + * @tparam Format the formatter class, e.g. DcmJsonFormatPretty. + * Will be deduced automatically. + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + template + OFCondition writeJson(STD_NAMESPACE ostream &out, + Format format) + { + return writeJson(out, OFstatic_cast(DcmJsonFormat&, format)); + } + + /** load object from a DICOM file. + * This method only supports DICOM objects stored as a dataset, i.e. without meta header. + * Use DcmFileFormat::loadFile() to load files with meta header. + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @param groupLength flag, specifying how to handle the group length tags + * @param maxReadLength maximum number of bytes to be read for an element value. + * Element values with a larger size are not loaded until their value is retrieved + * (with getXXX()) or loadAllDataIntoMemory() is called. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFile(const OFFilename &fileName, + const E_TransferSyntax readXfer = EXS_Unknown, + const E_GrpLenEncoding groupLength = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** load object from a DICOM file, up to the attribute tag stopParsingAtElement. + * This method only supports DICOM objects stored as a dataset, i.e. without meta header. + * Use DcmFileFormat::loadFile() to load files with meta header. + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @param groupLength flag, specifying how to handle the group length tags + * @param maxReadLength maximum number of bytes to be read for an element value. + * Element values with a larger size are not loaded until their value is retrieved + * (with getXXX()) or loadAllDataIntoMemory() is called. + * @param stopParsingAtElement parsing of the input stream is stopped when + * this tag key or any higher tag is encountered. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFileUntilTag(const OFFilename &fileName, + const E_TransferSyntax readXfer = EXS_Unknown, + const E_GrpLenEncoding groupLength = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength, + const DcmTagKey &stopParsingAtElement = DCM_UndefinedTagKey); + + /** save object to a DICOM file. + * This method only supports DICOM objects stored as a dataset, i.e. without meta header. + * Use DcmFileFormat::saveFile() to save files with meta header. + * @param fileName name of the file to save (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param writeXfer transfer syntax used to write the data (EXS_Unknown means use original) + * @param encodingType flag, specifying the encoding with undefined or explicit length + * @param groupLength flag, specifying how to handle the group length tags + * @param padEncoding flag, specifying how to handle the padding tags + * @param padLength number of bytes used for the dataset padding (has to be an even number) + * @param subPadLength number of bytes used for the item padding (has to be an even number) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition saveFile(const OFFilename &fileName, + const E_TransferSyntax writeXfer = EXS_Unknown, + const E_EncodingType encodingType = EET_UndefinedLength, + const E_GrpLenEncoding groupLength = EGL_recalcGL, + const E_PaddingEncoding padEncoding = EPD_noChange, + const Uint32 padLength = 0, + const Uint32 subPadLength = 0); + + // methods for different pixel representations + + /** select a specific representation (compressed or uncompressed) of the dataset + * and create the representation if needed. This may cause compression or decompression + * to be applied to the pixel data in the dataset. + * @param repType desired transfer syntax + * @param repParam desired representation parameter (e.g. quality factor for lossy compression) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition chooseRepresentation(const E_TransferSyntax repType, + const DcmRepresentationParameter *repParam); + + /** check if all PixelData elements in this dataset have a representation conforming + * to the given transfer syntax and representation parameters (see dcpixel.h for + * definition of "conforming"). + * @param repType desired transfer syntax + * @param repParam desired representation parameter (e.g. quality factor for lossy compression) + * @return true if all pixel elements have the desired representation, false otherwise + */ + OFBool hasRepresentation(const E_TransferSyntax repType, + const DcmRepresentationParameter *repParam); + + /** removes all but the original representation in all pixel data elements + */ + void removeAllButOriginalRepresentations(); + + /** removes all but the current representation and sets the original + * representation to current + */ + void removeAllButCurrentRepresentations(); + + /** mode specifying whether the SpecificCharacterSet (0008,0005) element should be + * checked by convertCharacterSet() or not, i.e.\ whether this element might be + * present on this dataset-level. + * @return always returns OFTrue, i.e.\ SpecificCharacterSet should be checked + */ + virtual OFBool checkForSpecificCharacterSet() const { return OFTrue; } + + protected: + + /** perform checks after reading of the dataset is considered complete. The + * idea is that some checks cannot be performed when reading a specific + * element, for different reasons, e.g. the values of other elements have + * to be taken into account. + * @return status, EC_Normal if no problems are found, an error code otherwise + */ + OFCondition doPostReadChecks(); + + + private: + + /// original transfer syntax of the dataset + E_TransferSyntax OriginalXfer; + /// current transfer syntax of the dataset + E_TransferSyntax CurrentXfer; +}; + + +#endif // DCDATSET_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcdatutl.h b/dcmdata/include/dcmtk/dcmdata/dcdatutl.h new file mode 100644 index 00000000..464dadf0 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdatutl.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 2011-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier, Michael Onken + * + * Purpose: Static helper functionality for dcmdata module + * + */ + +#ifndef DCDATUTL_H +#define DCDATUTL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dcdefine.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcdatset.h" + + +/** Class with helper functions used within the dcmdata module (and beyond) + */ +class DCMTK_DCMDATA_EXPORT DcmDataUtil +{ + +public: + + /** Get SOP Class UID, SOP Instance UID and Transfer Syntax UID from a DICOM + * file. The first two UID values are either copied from the meta-header + * (preferred) or from the dataset. The latter is either copied from the + * meta-header (preferred) or determined automatically (if possible). + * @param filename Name of the DICOM file from which the SOP Class UID + * and SOP Instance UID values are retrieved + * @param sopClassUID Variable to which the value of the SOP Class UID + * is stored + * @param sopInstanceUID Variable to which the value of the SOP Instance UID + * is stored + * @param transferSyntaxUID Variable to which the value of the Transfer + * Syntax UID is stored + * @param readMode Read mode passed to the DcmFileFormat::loadFile() method. + * If ERM_fileOnly, only the file meta information header is + * loaded, i.e. the behavior is identical to using + * ERM_metaOnly. + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getSOPInstanceFromFile(const OFFilename &filename, + OFString &sopClassUID, + OFString &sopInstanceUID, + OFString &transferSyntaxUID, + const E_FileReadMode readMode = ERM_fileOnly); + + /** Get SOP Class UID, SOP Instance UID and Transfer Syntax UID from a + * DICOM dataset. The first two UID values are directly copied from the + * dataset. The latter is either taken from the parameter 'datasetXfer' or, + * if it is unknown, determined automatically from the dataset (if possible). + * @param dataset DICOM dataset from which the SOP Class UID and SOP + * Instance UID values are retrieved + * @param datasetXfer Transfer syntax of the dataset (if known, otherwise + * set to set to EXS_Unknown and then it is determined automatically) + * @param sopClassUID Variable in which the value of the SOP Class UID is + * stored + * @param sopInstanceUID Variable in which the value of the SOP Instance UID + * is stored + * @param transferSyntaxUID Variable in which the value of the Transfer + * Syntax UID is stored + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getSOPInstanceFromDataset(DcmDataset *dataset, + const E_TransferSyntax datasetXfer, + OFString &sopClassUID, + OFString &sopInstanceUID, + OFString &transferSyntaxUID); +}; + +#endif // DCDATUTL_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcddirif.h b/dcmdata/include/dcmtk/dcmdata/dcddirif.h new file mode 100644 index 00000000..7db20e5d --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcddirif.h @@ -0,0 +1,1630 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface class for simplified creation of a DICOMDIR + * + */ + + +#ifndef DCDDIRIF_H +#define DCDDIRIF_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dcdicdir.h" + + +/*------------------------------------* + * constant declarations and macros * + *------------------------------------*/ + +// default file-set ID +#define DEFAULT_FILESETID "DCMTK_MEDIA_DEMO" +// default specific character set of file-set descriptor file +#define DEFAULT_DESCRIPTOR_CHARSET "ISO_IR 100" + + +/*----------------------* + * class declarations * + *----------------------*/ + +/** Abstract interface to plugable image support for the DICOMDIR class. + * This is an abstract base class used as an interface to access DICOM + * images from the DicomDirInterface. The implementation can be found + * in dcmjpeg/libsrc/ddpiimpl.cc (incl. JPEG support). + */ +class DCMTK_DCMDATA_EXPORT DicomDirImagePlugin +{ + public: + + /** destructor (virtual) + */ + virtual ~DicomDirImagePlugin() {} + + /** scale image (pixel data) to specified size + * @param srcData pointer to 8 bit source pixel data (original image) + * @param srcWidth width of the source image + * @param srcHeight height of the source image + * @param dstData pointer to 8 bit destination pixel data (scaled image). + * This array needs to be allocated prior to calling this function. + * @param dstWidth width of the destination image + * @param dstHeight height of the destination image + * @return OFTrue if successful, OFFalse otherwise + */ + virtual OFBool scaleData(const Uint8 *srcData, + const unsigned int srcWidth, + const unsigned int srcHeight, + Uint8 *dstData, + const unsigned int dstWidth, + const unsigned int dstHeight) const = 0; + + /** scale image (from DICOM dataset) to specified size + * @param dataset DICOM dataset where the pixel data is stored (original image) + * @param pixel pointer to 8 bit destination pixel data (scaled image). + * This array needs to be allocated prior to calling this function. + * @param count number of bytes allocated for the 'pixel' array + * @param frame index of the frame to be scaled (0..n-1) + * @param width width of the destination image + * @param height height of the destination image + * @param decompressAll always decompress complete pixel data if true + * @return OFTrue if successful, OFFalse otherwise + */ + virtual OFBool scaleImage(DcmItem *dataset, + Uint8 *pixel, + const unsigned long count, + const unsigned long frame, + const unsigned int width, + const unsigned int height, + const OFBool decompressAll = OFFalse) const = 0; + + protected: + + /** constructor (protected) + */ + DicomDirImagePlugin() {} +}; + + +/** An interface class for simplified creation of a DICOMDIR. + * @note Please make sure that for all OFFilename parameters, passed to the various + * methods of this class, at least the 8-bit version of the string value is present + * since in some cases only this version is (can be) used. + */ +class DCMTK_DCMDATA_EXPORT DicomDirInterface +{ + + public: + + /** list of supported media storage application profiles + */ + enum E_ApplicationProfile + { + /// General Purpose Interchange on CD-R or DVD-RAM Media (STD-GEN-CD/DVD-RAM) + AP_GeneralPurpose, + /// default application profile: General Purpose Interchange on CD-R or DVD-RAM Media + AP_Default = AP_GeneralPurpose, + /// General Purpose DVD Interchange with JPEG (STD-GEN-DVD-JPEG) + AP_GeneralPurposeDVDJPEG, + /// General Purpose DVD Interchange with JPEG 2000 (STD-GEN-DVD-J2K) + AP_GeneralPurposeDVDJPEG2000, + /// General Purpose BD Interchange with JPEG (STD-GEN-BD-JPEG) + AP_GeneralPurposeBDJPEG, + /// General Purpose BD Interchange with JPEG 2000 (STD-GEN-BD-J2K) + AP_GeneralPurposeBDJPEG2000, + /// General Purpose BD Interchange with MPEG2 MP\@ML (STD-GEN-BD-MPEG2-MPML) + AP_GeneralPurposeBDMPEG2MPatML, + /// General Purpose BD Interchange with MPEG2 MP\@HL (STD-GEN-BD-MPEG2-MPHL) + AP_GeneralPurposeBDMPEG2MPatHL, + /// General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.1 (STD-GEN-BD-MPEG4-HPLV41) + AP_GeneralPurposeBDMPEG4HPatLV41, + /// General Purpose BD Interchange with MPEG-4 AVC/H.264 BD-Compatible HiP\@Level4.1 (STD-GEN-BD-MPEG4-HPLV41BD) + AP_GeneralPurposeBDMPEG4HPatLV41BD, + /// General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.2 for 2D video (STD-GEN-BD-MPEG4-HPLV42-2D) + AP_GeneralPurposeBDMPEG4HPatLV42_2D, + /// General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.2 for 3D video (STD-GEN-BD-MPEG4-HPLV42-3D) + AP_GeneralPurposeBDMPEG4HPatLV42_3D, + /// General Purpose BD Interchange with MPEG-4 AVC/H.264 Stereo HiP\@Level4.2 (STD-GEN-BD-MPEG4-SHPLV42) + AP_GeneralPurposeBDMPEG4StereoHPatLV42, + /// General Purpose USB and Flash Memory Interchange with JPEG (STD-GEN-USB/MMC/CF/SD-JPEG) + AP_USBandFlashJPEG, + /// General Purpose USB and Flash Memory Interchange with JPEG 2000 (STD-GEN-USB/MMC/CF/SD-J2K) + AP_USBandFlashJPEG2000, + /// General Purpose MIME Interchange Profile (STD-GEN-MIME) + AP_GeneralPurposeMIME, + /// DVD Interchange with MPEG2 MP\@ML (STD-DVD-MPEG2-MPML) + AP_MPEG2MPatMLDVD, + /// Basic Cardiac X-Ray Angiographic Studies on CD-R Media (STD-XABC-CD) + AP_BasicCardiac, + /// 1024 X-Ray Angiographic Studies on CD-R Media (STD-XA1K-CD) + AP_XrayAngiographic, + /// 1024 X-Ray Angiographic Studies on DVD Media (STD-XA1K-DVD) + AP_XrayAngiographicDVD, + /// Dental Radiograph Interchange (STD-DEN-CD) + AP_DentalRadiograph, + /// CT/MR Studies (STD-CTMR-xxxx) + AP_CTandMR, + /// Ultrasound Single Frame for Image Display (STD-US-ID-SF-xxxx) + AP_UltrasoundIDSF, + /// Ultrasound Single Frame with Spatial Calibration (STD-US-SC-SF-xxxx) + AP_UltrasoundSCSF, + /// Ultrasound Single Frame with Combined Calibration (STD-US-CC-SF-xxxx) + AP_UltrasoundCCSF, + /// Ultrasound Single & Multi-Frame for Image Display (STD-US-ID-MF-xxxx) + AP_UltrasoundIDMF, + /// Ultrasound Single & Multi-Frame with Spatial Calibration (STD-UD-SC-MF-xxxx) + AP_UltrasoundSCMF, + /// Ultrasound Single & Multi-Frame with Combined Calibration (STD-UD-CC-MF-xxxx) + AP_UltrasoundCCMF, + /// 12-lead ECG Interchange on Diskette (STD-WVFM-ECG-FD) + AP_TwelveLeadECG, + /// Hemodynamic Waveform Interchange on Diskette (STD-WVFM-HD-FD) + AP_HemodynamicWaveform + }; + + /** constructor (default). + * No DICOMDIR object is created by default (see methods createNewDicomDir(), + * appendToDicomDir() and updateDicomDir()). + */ + DicomDirInterface(); + + /** destructor (virtual). + * Free all memory allocated by this class. + */ + virtual ~DicomDirInterface(); + + /** reset the object to its initial state. + * That means e.g. free memory. + */ + void cleanup(); + + /** check whether current DICOMDIR is valid. + * That means e.g. that it can be written to a file. + * @return OFTrue if DICOMDIR is valid, OFFalse otherwise + */ + OFBool isDicomDirValid() const; + + /** create a new DICOMDIR object. + * This function replaces any previously existing DICOMDIR file with the specified + * 'filename'. If the backup mode (see disableBackupMode()) is enabled, a backup + * copy ('filename' + ".BAK") is created from the existing file and automatically + * deleted after the new file has been written without any errors. + * @param profile media storage application profile to be used for the DICOMDIR + * @param filename name of the DICOMDIR file to be created (default: 'DICOMDIR'). + * The filename may include a fully qualified pathname. + * @param filesetID value of the attribute FileSetID (default: 'DCMTK_MEDIA_DEMO', + * might be empty) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition createNewDicomDir(const E_ApplicationProfile profile = AP_GeneralPurpose, + const OFFilename &filename = OFFilename(DEFAULT_DICOMDIR_NAME), + const OFString &filesetID = DEFAULT_FILESETID); + + /** create a DICOMDIR object based on an existing DICOMDIR file (append). + * This function can be used to append new entries to an existing DICOMDIR file. + * If the backup mode (see disableBackupMode()) is enabled, a backup copy ('filename' + * + ".BAK") is created from the existing file and automatically deleted after the + * new file has been written without any errors. + * @param profile media storage application profile to be used for the DICOMDIR. + * NB: The same profile should be used as for the creation of the DICOMDIR file. + * @param filename name of the DICOMDIR file to be appended. The filename may + * include a fully qualified pathname. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition appendToDicomDir(const E_ApplicationProfile profile, + const OFFilename &filename); + + /** create a DICOMDIR object based on an existing DICOMDIR file (update). + * This function can be used to append new entries to and update existing entries + * in an existing DICOMDIR file. + * If the backup mode (see disableBackupMode()) is enabled, a backup copy ('filename' + * + ".BAK") is created from the existing file and automatically deleted after the + * new file has been written without any errors. + * @param profile media storage application profile to be used for the DICOMDIR + * @param filename name of the DICOMDIR file to be updated. The filename may + * include a fully qualified pathname. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition updateDicomDir(const E_ApplicationProfile profile, + const OFFilename &filename); + + /** write the current DICOMDIR object to file. + * NB: The filename has already been specified for the object creation (see above). + * @param encodingType flag, specifying the encoding with undefined or explicit length + * @param groupLength flag, specifying how to handle the group length tags + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition writeDicomDir(const E_EncodingType encodingType = EET_UndefinedLength, + const E_GrpLenEncoding groupLength = EGL_withoutGL); + + /** check whether specified filename is valid. i.e. conforms to the DICOM standard + * requirements (length, number of components and proper characters). This function + * is called automatically for the following methods: checkDicomFile(), addDicomFile() + * and setFilesetDescriptor(). So usually there's no need to call it manually + * (especially not in addition to the above mentioned methods). + * @param filename filename to be checked for standard conformance + * @param allowEmpty empty filename (zero length) allowed if OFTrue + * @return OFTrue if filename is valid, OFFalse otherwise + */ + OFBool isFilenameValid(const OFFilename &filename, + const OFBool allowEmpty = OFFalse); + + /** check whether given charset identifier is valid. + * Valid character sets are (see DICOM PS3.3 for details): ISO_IR 100, ISO_IR 101, + * ISO_IR 109, ISO_IR 110, ISO_IR 144, ISO_IR 127, ISO_IR 126, ISO_IR 138, ISO_IR 148, + * ISO_IR 166, ISO_IR 13, ISO_IR 192. + * @param charset character set identifier to be checked + * @return OFTrue if charset is valid, OFFalse otherwise + */ + OFBool isCharsetValid(const char *charset); + + /** check whether specified DICOM file is suitable to be included into the DICOMDIR. + * This method loads the given file and checks whether it conforms to the current + * application profile. Since this check is also performed by addDicomFile() there + * is usually no need to call this method directly. + * @param filename name of the DICOM file to be checked + * @param directory directory where the DICOM file is stored (optional). + * This parameter might be useful in cases where the DICOM file is not (yet) + * stored in the final directory (i.e. "relative" to the DICOMDIR location). + * @param checkFilename flag indicating whether to check the filename with + * isFilenameValid() or not. In case where the DICOM file is copied or + * renamed after this method is called, it might be useful to disable + * this check. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkDicomFile(const OFFilename &filename, + const OFFilename &directory = OFFilename(), + const OFBool checkFilename = OFTrue); + + /** add specified DICOM file to the current DICOMDIR. + * This method loads the given file, checks whether it conforms to the current + * application profile and finally adds it to the DICOMDIR (in case of conformance). + * @param filename name of the DICOM file to be added + * @param directory directory where the DICOM file is stored (optional). + * This parameter might be useful in cases where the DICOM file is not (yet) + * stored in the final directory (i.e. "relative" to the DICOMDIR location). + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition addDicomFile(const OFFilename &filename, + const OFFilename &directory = OFFilename()); + + /** set the file-set descriptor file ID and character set. + * Prior to any internal modification both 'filename' and 'charset' are checked + * using the above checking routines. Existence of 'filename' is not checked. + * Requires a DICOMDIR object to exist (see createNewDicomDir(), appendToDicomDir() + * or updateDicomDir()). + * @param filename name of the file-set descriptor file to be set + * @param charset character set of the file-set descriptor file to be set. + * default: ISO Latin 1 ("ISO_IR 100"), use NULL or empty string to omit value. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setFilesetDescriptor(const char *filename, + const char *charset = DEFAULT_DESCRIPTOR_CHARSET); + + /** set preferred size of the icon images. + * NB: some application profiles require a particular icon size. + * In those cases this manual setting is implicitly ignored. + * @param size size of the icon images in pixels (1..256, initial: 64) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setIconSize(const unsigned int size); + + /** set filename prefix for alternative icon images. + * If non-empty the filename prefix is used to create the icon image from an + * externally stored PGM (portable gray map, 8 bit binary) file instead of the + * DICOM image file. The PGM filename is: 'prefix' + 'dicom_filename'. The + * image does not need to have the correct size as it is scaled automatically. + * @param prefix filename prefix (empty value to disable = default) + * @return always returns EC_Normal + */ + OFCondition setIconPrefix(const OFFilename &prefix); + + /** set filename of default icon image. + * For cases that the icon image cannot be created (neither from PGM nor from + * DICOM file, respectively) a default icon (8 bit binary PGM) can be specified. + * If this image also fails to load a black icon (filled with zeros) is used. + * @param filename name of the default PGM file + * @return always returns EC_Normal + */ + OFCondition setDefaultIcon(const OFFilename &filename); + + /** get current status of the "abort on first error" mode. + * See enableAbortMode() for more details. + * @return OFTrue if mode is enabled, OFFalse otherwise + */ + OFBool abortMode() const + { + return AbortMode; + } + + /** get current status of the "map filenames" mode. + * See enableMapFilenamesMode() for more details. + * @return OFTrue if mode is enabled, OFFalse otherwise + */ + OFBool mapFilenamesMode() const + { + return MapFilenamesMode; + } + + /** get current status of the "invent missing values" mode. + * See enableInventMode() for more details. + * @return OFTrue if mode is enabled, OFFalse otherwise + */ + OFBool inventMode() const + { + return InventMode; + } + + /** get current status of the "invent missing patient ID" mode. + * See enableInventPatientIDMode() for more details. + * @return OFTrue if mode is enabled, OFFalse otherwise + */ + OFBool inventPatientIDMode() const + { + return InventPatientIDMode; + } + + /** get current status of the "retired SOP class support" mode. + * See enableRetiredSOPClassSupport() for more details. + * @return OFTrue if support is enabled, OFFalse otherwise + */ + OFBool retiredSOPClassSupport() const + { + return RetiredSOPClassSupport; + } + + /** get current status of the "create icon images" mode. + * See enableIconImageMode() for more details. + * @return OFTrue if mode is enabled, OFFalse otherwise + */ + OFBool iconImageMode() const + { + return IconImageMode; + } + + /** get current status of the "create backup" mode. + * See disableBackupMode() for more details. + * @return OFTrue if mode is enabled, OFFalse otherwise + */ + OFBool backupMode() const + { + return BackupMode; + } + + /** get current status of the "pixel encoding check" mode. + * See disableEncodingCheck() for more details. + * @return OFTrue if check is enabled, OFFalse otherwise + */ + OFBool encodingCheck() const + { + return EncodingCheck; + } + + /** get current status of the "spatial resolution check" mode. + * See disableResolutionCheck() for more details. + * @return OFTrue if check is enabled, OFFalse otherwise + */ + OFBool resolutionCheck() const + { + return ResolutionCheck; + } + + /** get current status of the "transfer syntax check" mode. + * See disableTransferSyntaxCheck() for more details. + * @return OFTrue if check is enabled, OFFalse otherwise + */ + OFBool transferSyntaxCheck() const + { + return TransferSyntaxCheck; + } + + /** get current status of the "DICOM file format check" mode. + * See disableFileFormatCheck() for more details. + * @return OFTrue if check is enabled, OFFalse otherwise + */ + OFBool fileFormatCheck() const + { + return FileFormatCheck; + } + + /** get current status of the "consistency check" mode. + * See disableConsistencyCheck() for more details. + * @return OFTrue if check is enabled, OFFalse otherwise + */ + OFBool consistencyCheck() const + { + return ConsistencyCheck; + } + + /** enable/disable the "abort on first error" mode. + * If the mode is enabled, addDicomFile() reports an error message and + * returns with an error status code if something went wrong. + * Default: off, do not abort + * @param newMode enable mode if OFTrue, disable if OFFalse + * @return previously stored value + */ + OFBool enableAbortMode(const OFBool newMode = OFTrue); + + /** enable/disable the "map filenames" mode. + * If the mode is enabled, filenames are automatically mapped to DICOM format + * (convert lower case to upper case characters and remove trailing period). + * Default: off, do not map filenames + * @param newMode enable mode if OFTrue, disable if OFFalse + * @return previously stored value + */ + OFBool enableMapFilenamesMode(const OFBool newMode = OFTrue); + + /** enable/disable the "invent missing values" mode. + * If the mode is enabled, required DICOMDIR attributes (type 1) are + * invented when missing in the DICOM file. + * Default: off, do not invent attribute values + * @param newMode enable mode if OFTrue, disable if OFFalse + * @return previously stored value + */ + OFBool enableInventMode(const OFBool newMode = OFTrue); + + /** enable/disable the "invent new patient ID" mode. + * If the mode is enabled, a new PatientID is invented in case of + * inconsistent PatientName attributes, i.e. when different patients + * share the same ID. + * Default: off, do not invent new patient ID + * @param newMode enable mode if OFTrue, disable if OFFalse + * @return previously stored value + */ + OFBool enableInventPatientIDMode(const OFBool newMode = OFTrue); + + /** enable/disable the "retired SOP class support" mode. + * If the mode is enabled, retired SOP classes defined in previous editions + * of the DICOM standard are also accepted. + * Default: off, do not accept retired SOP classes + * @param newMode enable mode if OFTrue, disable if OFFalse + * @return previously stored value + */ + OFBool enableRetiredSOPClassSupport(const OFBool newMode = OFTrue); + + /** enable/disable the "create icon images" mode. + * If the mode is enabled, icon images are created for each IMAGE record. + * Please note that particular application profiles (e.g. Basic Cardiac) + * require an icon images to be present. Therefore, this mode does not + * affect the icon images creation of such profiles. + * Default: off, do not create (optional) icon images + * @param newMode enable mode if OFTrue, disable if OFFalse + * @return previously stored value + */ + OFBool enableIconImageMode(const OFBool newMode = OFTrue); + + /** disable/enable the "create backup file" mode. + * If this mode is disabled, no backup file of an existing DICOMDIR is created. + * However, when appending new files to an existing DICOMDIR a _temporary_ + * backup file ".$$$" is always created. + * Default: on, create a backup file ".BAK" + * @param newMode disable mode if OFFalse, enable if OFTrue + * @return previously stored value + */ + OFBool disableBackupMode(const OFBool newMode = OFFalse); + + /** disable/enable the "pixel encoding check". + * If this mode is disabled, the pixel encoding is not check for compliance + * with the selected application profile. + * Default: on, check pixel encoding (bits allocated/stored, high bit) + * @warning Please use this switch with care since the resulting DICOMDIR will + * probably violate the rules for the selected application profile. + * @param newMode disable check if OFFalse, enable if OFTrue + * @return previously stored value + */ + OFBool disableEncodingCheck(const OFBool newMode = OFFalse); + + /** disable/enable the "spatial resolution check". + * If this mode is disabled, the spatial resolution is not check for compliance + * with the selected application profile. + * Default: on, check spatial resolution + * @warning Please use this switch with care since the resulting DICOMDIR will + * probably violate the rules for the selected application profile. + * @param newMode disable check if OFFalse, enable if OFTrue + * @return previously stored value + */ + OFBool disableResolutionCheck(const OFBool newMode = OFFalse); + + /** disable/enable the "transfer syntax check". + * If this mode is disabled, the transfer syntax is not check for compliance + * with the selected application profile. + * Default: on, check transfer syntax + * @warning Please use this switch with care since the resulting DICOMDIR will + * probably violate the rules for the selected application profile. + * @param newMode disable check if OFFalse, enable if OFTrue + * @return previously stored value + */ + OFBool disableTransferSyntaxCheck(const OFBool newMode = OFFalse); + + /** disable/enable the "DICOM file format check". + * If this mode is disabled, it is not checked whether the file to be added + * contains file meta information (according to DICOM part 10). + * Default: on, check DICOM file format + * @warning Please use this switch with care since the resulting DICOMDIR will + * violate the rules of the DICOM standard if it references files that are + * missing the file meta information. + * @param newMode disable check if OFFalse, enable if OFTrue + * @return previously stored value + */ + OFBool disableFileFormatCheck(const OFBool newMode = OFFalse); + + /** disable/enable the "consistency check". + * If this mode is disabled, the consistency of newly added records with + * already existing ones is not checked (see warnAboutInconsistentAttributes() + * for details). + * Default: on, perform consistency check + * @param newMode disable check if OFFalse, enable if OFTrue + * @return previously stored value + */ + OFBool disableConsistencyCheck(const OFBool newMode = OFFalse); + + /** add pluggable image support. + * NB: This plugin is required to create icon images from DICOM files! + * @param plugin pointer to an instance of the plugin implementation. + * See class DicomDirImageImplementation (dcmjpeg/include/ddpiimpl.h). + * @return OFTrue if successful, OFFalse otherwise + */ + OFBool addImageSupport(DicomDirImagePlugin *plugin); + + /* -- static function -- */ + + /** get name/identifier associated with the given application profile + * @param profile media storage application profile + * @return name of the application profile (e.g. "STD-GEN-CD/DVD-RAM") + */ + static const char *getProfileName(const E_ApplicationProfile profile); + + /** get string associated with the given directory record entry type. + * @param recordType record type + * @return text string representing the record type + */ + static OFString recordTypeToName(const E_DirRecType recordType); + + protected: + + /** select given application profile + * @param profile storage media application profile to be selected + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition selectApplicationProfile(const E_ApplicationProfile profile); + + /** load and check DICOM file regarding the current application profile + * @param filename name of the DICOM file to be checked + * @param directory directory where the DICOM file is stored (optional) + * @param fileformat object in which the loaded data is stored + * @param checkFilename flag indicating whether to check the filename with + * isFilenameValid() or not + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition loadAndCheckDicomFile(const OFFilename &filename, + const OFFilename &directory, + DcmFileFormat &fileformat, + const OFBool checkFilename = OFTrue); + + /** check SOP class and transfer syntax for compliance with current profile + * @param metainfo object where the DICOM file meta information is stored + * @param dataset object where the DICOM dataset is stored + * @param filename name of the DICOM file to be checked + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkSOPClassAndXfer(DcmMetaInfo *metainfo, + DcmItem *dataset, + const OFFilename &filename); + + /** check attributes for compliance with Basic Cardiac application profile + * @param dataset object where the DICOM dataset is stored + * @param filename name of the DICOM file to be checked + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkBasicCardiacAttributes(DcmItem *dataset, + const OFFilename &filename); + + /** check attributes for compliance with X-ray Angiography application profile + * @param dataset object where the DICOM dataset is stored + * @param sopClass SOP class of the DICOM data to be checked + * @param filename name of the DICOM file to be checked + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkXrayAngiographicAttributes(DcmItem *dataset, + const OFString &sopClass, + const OFFilename &filename); + + /** check attributes for compliance with dental radiograph application profile + * @param dataset object where the DICOM dataset is stored + * @param filename name of the DICOM file to be checked + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkDentalRadiographAttributes(DcmItem *dataset, + const OFFilename &filename); + + /** check attributes for compliance with CT and MR application profile + * @param dataset object where the DICOM dataset is stored + * @param sopClass SOP class of the DICOM data to be checked + * @param filename name of the DICOM file to be checked + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkCTandMRAttributes(DcmItem *dataset, + const OFString &sopClass, + const OFFilename &filename); + + /** check attributes for compliance with Ultrasound application profiles + * @param dataset object where the DICOM dataset is stored + * @param transferSyntax transfer syntax of the DICOM data to be checked + * @param filename name of the DICOM file to be checked + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkUltrasoundAttributes(DcmItem *dataset, + const OFString &transferSyntax, + const OFFilename &filename); + + /** check attributes for compliance with current application profile + * @param metainfo object where the DICOM file meta information is stored + * @param dataset object where the DICOM dataset is stored + * @param filename name of the DICOM file to be checked + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition checkMandatoryAttributes(DcmMetaInfo *metainfo, + DcmItem *dataset, + const OFFilename &filename); + + /** check whether given directory record matches dataset. + * The check depends on the record type and is performed mainly based on + * the unique key defined for the particular record type (e.g. SOPInstanceUID + * for IMAGE records). For PATIENT records the PatientName may also be used + * if the PatientID is absent. + * @param record directory record to be checked + * @param dataset DICOM dataset of the current file + * @return OFTrue if record matches, OFFalse otherwise + */ + OFBool recordMatchesDataset(DcmDirectoryRecord *record, + DcmItem *dataset); + + /** search for a given directory record + * @param parent higher-level structure where the records are stored + * @param recordType type of directory record to be searched for + * @param dataset DICOM dataset of the current file + * @return pointer to record if found, NULL otherwise + */ + DcmDirectoryRecord *findExistingRecord(DcmDirectoryRecord *parent, + const E_DirRecType recordType, + DcmItem* dataset); + + /** create or update patient record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildPatientRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFFilename &sourceFilename); + + /** create or update study record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildStudyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFFilename &sourceFilename); + + /** create or update new series record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildSeriesRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFFilename &sourceFilename); + + /** create or update overlay record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildOverlayRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update modality LUT record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildModalityLutRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update VOI LUT record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildVoiLutRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update curve record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildCurveRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update structure reporting record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildStructReportRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update presentation state record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildPresentationRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update waveform record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildWaveformRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update RT dose record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildRTDoseRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update RT structure set record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildRTStructureSetRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update RT plan record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildRTPlanRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update RT treatment record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildRTTreatmentRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update stored print record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildStoredPrintRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update key object doc record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildKeyObjectDocRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update registration record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildRegistrationRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update fiducial record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildFiducialRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update raw data record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildRawDataRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update spectroscopy record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildSpectroscopyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update encap doc record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildEncapDocRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update value map record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildValueMapRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update hanging protocol record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildHangingProtocolRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update stereometric record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildStereometricRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update palette record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildPaletteRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update surface record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildSurfaceRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update measurement record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildMeasurementRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update implant record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildImplantRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update implant group record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildImplantGroupRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update implant assy record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildImplantAssyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update plan record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildPlanRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update surface scan record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildSurfaceScanRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update tract record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildTractRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update assessment record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildAssessmentRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update radiotherapy record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildRadiotherapyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create or update image record and copy required values from dataset + * @param record record to be updated, use NULL to create a new one + * @param fileformat DICOM dataset of the current file + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new or updated record, NULL if an error occurred + */ + DcmDirectoryRecord *buildImageRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** create icon image from given PGM (portable gray map) file. + * Please note that only grayscale images in binary format are currently + * supported (magic word "P5"). Memory has to be allocated by the caller. + * @param filename name of the PGM file to be loaded + * @param pixel pointer to memory buffer where the pixel data are to be stored + * @param count number of bytes allocated for the 'pixel' memory buffer + * @param width width of the scaled icon image (in pixels ) + * @param height height of the scaled icon image (in pixels) + * @return OFTrue if successful, OFFalse otherwise + */ + OFBool getIconFromFile(const OFFilename &filename, + Uint8 *pixel, + const unsigned long count, + const unsigned int width, + const unsigned int height); + + /** create icon image from DICOM dataset. + * Please note that the memory buffer has to be allocated by the caller. + * @param dataset DICOM dataset from which the icon image is created + * @param pixel pointer to memory buffer where the pixel data are to be stored + * @param count number of bytes allocated for the 'pixel' memory buffer + * @param width width of the scaled icon image (in pixels ) + * @param height height of the scaled icon image (in pixels) + * @return OFTrue if successful, OFFalse otherwise + */ + OFBool getIconFromDataset(DcmItem *dataset, + Uint8 *pixel, + const unsigned long count, + const unsigned int width, + const unsigned int height); + + /** add icon image sequence to directory record. + * If the icon image cannot be created from the DICOM dataset and there is no + * PGM file specified (neither for the particular image not a default one) a + * black image is used instead. + * @param record directory record where the icon image is stored + * @param dataset DICOM dataset from which the icon image is possibly created + * @param size resolution of the icon image to be created (width and height) + * @param sourceFilename name of the source DICOM file + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition addIconImage(DcmDirectoryRecord *record, + DcmItem *dataset, + const unsigned int size, + const OFFilename &sourceFilename); + + /** add child record to a given parent record. + * A new record is only added if it does not already exist. + * @param parent parent record (add new record as a child of this one) + * @param recordType type of directory record to be created + * @param fileformat DICOM dataset containing data of the new record + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return pointer to new/existing record, NULL if an error occurred + */ + DcmDirectoryRecord *addRecord(DcmDirectoryRecord *parent, + const E_DirRecType recordType, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** check referenced SOP instance for consistency with a new directory record + * @param record directory record to be checked + * @param dataset DICOM dataset containing data of the new record + * @param referencedFileID value of the Referenced File ID attribute + * @param sourceFilename name of the source DICOM file + * @return OFTrue if the data is consistent, OFFalse otherwise + */ + OFBool checkReferencedSOPInstance(DcmDirectoryRecord *record, + DcmItem *dataset, + const OFString &referencedFileID, + const OFFilename &sourceFilename); + + /** invent missing type 1 attributes for all child records (from patient level) + * @param parent invent missing attributes for all children of this record (root) + * @param recurse invent missing attributes also for lower level records if OFTrue. + * Only invent attributes for the top (patient) level if OFFalse. + */ + void inventMissingAttributes(DcmDirectoryRecord *parent, + const OFBool recurse = OFTrue); + + /** invent missing type 1 attributes for all child records (from study level) + * @param parent invent missing attributes for all children of this record + */ + void inventMissingStudyLevelAttributes(DcmDirectoryRecord *parent); + + /** invent missing type 1 attributes for all child records (from series level) + * @param parent invent missing attributes for all children of this record + */ + void inventMissingSeriesLevelAttributes(DcmDirectoryRecord *parent); + + /** invent missing type 1 attributes for all child records (from instance level) + * @param parent invent missing attributes for all children of this record + */ + void inventMissingInstanceLevelAttributes(DcmDirectoryRecord *parent); + + /** create backup of a given file + * @param filename name of the file to be backuped + */ + void createDicomDirBackup(const OFFilename &filename); + + /** delete backup file if one has been created + */ + void deleteDicomDirBackup(); + + /** print a message that the value of a given tag is unexpected. + * The output format is: "{Error|Warning}: attribute + * has other value than expected[ in file: ]" + * @param key affected tag + * @param filename name of the file (optional, might be empty) + * @param errorMsg print error message if OFTrue, a warning message otherwise + */ + void printUnexpectedValueMessage(const DcmTagKey &key, + const OFFilename &filename = OFFilename(), + const OFBool errorMsg = OFTrue); + + /** print an error message that a required attribute is missing/empty. + * The output format is: "Error: : required attribute + * {empty|missing}[ in file: ]" + * @param key affected tag + * @param filename name of the file (optional, might be empty) + * @param emptyMsg print "empty" if OFTrue, "missing" otherwise + */ + void printRequiredAttributeMessage(const DcmTagKey &key, + const OFFilename &filename = OFFilename(), + const OFBool emptyMsg = OFFalse); + + /** print an error message that something went wrong with an attribute. + * The output format is: "Error: : [cannot ] + * " + * @param key affected tag + * @param error status to be reported (only if ".bad()") + * @param operation name of the operation that failed (optional, might be NULL) + */ + void printAttributeErrorMessage(const DcmTagKey &key, + const OFCondition &error, + const char *operation); + + /** print an error message that something went wrong with a given record. + * The output format is: "Error: : [cannot ] + * directory record" + * @param error status to be reported (only if ".bad()") + * @param recordType type of directory record which caused the error + * @param operation name of the operation that failed (optional, might be NULL) + */ + void printRecordErrorMessage(const OFCondition &error, + const E_DirRecType recordType, + const char *operation); + + /** copy contents of specified file + * @param fromFilename name of the file to be copied + * @param toFilename name of the new file (copy of 'fromFilename') + * @return OFTrue if successful, OFFalse otherwise + */ + OFBool copyFile(const OFFilename &fromFilename, + const OFFilename &toFilename); + + /** check if all the attributes in record match the values in dataset and warn if not + * @param record directory record to be checked + * @param dataset DICOM dataset to be compared with the directory record + * @param sourceFilename name of the source DICOM file + * @param abortCheck flag indicating whether to abort on the first inconsistent record + * @return OFTrue in case of any inconsistency, OFFalse otherwise + */ + OFBool warnAboutInconsistentAttributes(DcmDirectoryRecord *record, + DcmItem *dataset, + const OFFilename &sourceFilename, + const OFBool abortCheck = OFFalse); + + /** check whether given file-set ID is valid + * @param filesetID file-set ID to be checked + * @return OFTrue if ID is valid, OFFalse otherwise + */ + OFBool checkFilesetID(const OFString &filesetID); + + /** check whether given tag exists in the DICOM dataset + * @param dataset DICOM dataset to be checked + * @param key tag to be searched for + * @param filename of the file (optional, report any error if non-empty) + * @return OFTrue if tag exists, OFFalse otherwise + */ + OFBool checkExists(DcmItem *dataset, + const DcmTagKey &key, + const OFFilename &filename = OFFilename()); + + /** check whether given tag exists with a value in the DICOM dataset + * @param dataset DICOM dataset to be checked + * @param key tag to be searched for + * @param filename of the file (optional, report any error if non-empty) + * @return OFTrue if tag exists with value, OFFalse otherwise + */ + OFBool checkExistsWithValue(DcmItem *dataset, + const DcmTagKey &key, + const OFFilename &filename = OFFilename()); + + /** check whether given tag exists in the DICOM dataset and has the expected string value + * @param dataset DICOM dataset to be checked + * @param key tag to be searched for + * @param value expected string value + * @param filename of the file (optional, report any error if non-empty) + * @return OFTrue if tag exists with given string value, OFFalse otherwise + */ + OFBool checkExistsWithStringValue(DcmItem *dataset, + const DcmTagKey &key, + const OFString &value, + const OFFilename &filename = OFFilename()); + + /** check whether given tag exists in the DICOM dataset and has the expected integer value + * @param dataset DICOM dataset to be checked + * @param key tag to be searched for + * @param value expected integer value + * @param filename of the file (optional, report any error if non-empty) + * @param reject report an "Error" if OFTrue, a "Warning" if OFFalse + * @return OFTrue if tag exists with given string value, OFFalse otherwise + */ + OFBool checkExistsWithIntegerValue(DcmItem *dataset, + const DcmTagKey &key, + const long value, + const OFFilename &filename = OFFilename(), + const OFBool reject = OFTrue); + + /** check whether given tag exists in the DICOM dataset and has an integer value in the + * expected range + * @param dataset DICOM dataset to be checked + * @param key tag to be searched for + * @param min minimum integer value of the expected range + * @param max maximum integer value of the expected range + * @param filename of the file (optional, report any error if non-empty) + * @param reject report an "Error" if OFTrue, a "Warning" if OFFalse + * @return OFTrue if tag exists with given string value, OFFalse otherwise + */ + OFBool checkExistsWithMinMaxValue(DcmItem *dataset, + const DcmTagKey &key, + const long min, + const long max, + const OFFilename &filename = OFFilename(), + const OFBool reject = OFTrue); + + /** get string value from dataset and report an error (if any) + * @param dataset dataset from which the string value is to be retrieved + * @param key tag of the attribute to be retrieved + * @param result string variable in which the resulting value is stored + * @param searchIntoSub flag indicating whether to do a deep search or not + * @return reference to the resulting string value (parameter 'result') + */ + OFString &getStringFromDataset(DcmItem *dataset, + const DcmTagKey &key, + OFString &result, + OFBool searchIntoSub = OFFalse); + + /** get string value component from dataset and report an error (if any) + * @param dataset dataset from which the string value is to be retrieved + * @param key tag of the attribute to be retrieved + * @param result string variable in which the resulting value is stored + * @param pos index of the component in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to do a deep search or not + * @return reference to the resulting string value (parameter 'result') + */ + OFString &getStringComponentFromDataset(DcmItem *dataset, + const DcmTagKey &key, + OFString &result, + const unsigned long pos, + OFBool searchIntoSub = OFFalse); + + /** get string value from file and report an error (if any) + * @param filename name of the file from which the string value is to be retrieved + * @param key tag of the attribute to be retrieved + * @param result string variable in which the resulting value is stored + * @param searchIntoSub flag indicating whether to do a deep search or not + * @return reference to the resulting string value (parameter 'result') + */ + OFString &getStringFromFile(const OFFilename &filename, + const DcmTagKey &key, + OFString &result, + OFBool searchIntoSub = OFFalse); + + /** copy element from given dataset to directory record + * @param dataset DICOM dataset containing the original data + * @param key tag of the element to be copied + * @param record directory record to which the element is to be copied + * @param sourceFilename name of the source DICOM file + * @param optional flag indicating whether the element is optional or required + * @param copyEmpty flag indicating whether to copy an empty element (no value) + */ + void copyElement(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename, + const OFBool optional = OFFalse, + const OFBool copyEmpty = OFTrue); + + /** copy type 1C element from given dataset or first item of the given sequence + * to directory record. Typically, the SharedFunctionalGroupsSequence is used + * with this method. + * @param dataset DICOM dataset containing the original data + * @param elementKey tag of the element to be copied + * @param sequenceKey tag of the sequence element to be used in case the element + * cannot be found on the main dataset level + * @param record directory record to which the element is to be copied + * @param sourceFilename name of the source DICOM file + */ + void copyElementType1CFromDatasetOrSequenceItem(DcmItem *dataset, + const DcmTagKey &elementKey, + const DcmTagKey &sequenceKey, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename); + + /** copy type 1 element from given dataset to directory record + * @param dataset DICOM dataset containing the original data + * @param key tag of the element to be copied + * @param record directory record to which the element is to be copied + * @param sourceFilename name of the source DICOM file + */ + void copyElementType1(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename) + { + copyElement(dataset, key, record, sourceFilename, OFFalse /*optional*/, OFFalse /*copyEmpty*/); + } + + /** copy type 1C element from given dataset to directory record + * @param dataset DICOM dataset containing the original data + * @param key tag of the element to be copied + * @param record directory record to which the element is to be copied + * @param sourceFilename name of the source DICOM file + */ + void copyElementType1C(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename) + { + copyElement(dataset, key, record, sourceFilename, OFTrue /*optional*/, OFFalse /*copyEmpty*/); + } + + /** copy type 2 element from given dataset to directory record + * @param dataset DICOM dataset containing the original data + * @param key tag of the element to be copied + * @param record directory record to which the element is to be copied + * @param sourceFilename name of the source DICOM file + */ + void copyElementType2(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename) + { + copyElement(dataset, key, record, sourceFilename, OFFalse /*optional*/, OFTrue /*copyEmpty*/); + } + + /** copy type 3 element from given dataset to directory record + * @param dataset DICOM dataset containing the original data + * @param key tag of the element to be copied + * @param record directory record to which the element is to be copied + * @param sourceFilename name of the source DICOM file + */ + void copyElementType3(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename) + { + copyElement(dataset, key, record, sourceFilename, OFTrue /*optional*/, OFTrue /*copyEmpty*/); + } + + /** copy optional string value from given dataset to directory record + * @param dataset DICOM dataset containing the original data + * @param key tag of the element value to be copied + * @param record directory record to which the element value is to be copied + * @param sourceFilename name of the source DICOM file + * @param defaultValue default string value used in case the element is missing + * @param printWarning print warning message if element does not exist (with a value) + * and no default value is given + */ + void copyStringWithDefault(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename, + const char *defaultValue = "", + const OFBool printWarning = OFFalse); + + /** compare string attribute from dataset and record and report any deviation + * @param dataset DICOM dataset where the string value is stored + * @param datKey tag of the string value to be compared (dataset) + * @param record directory record where the string value is stored + * @param recKey tag of the string value to be compared (record) + * @param sourceFilename name of the source DICOM file + * @param errorMsg report error if true, warning message otherwise (default) + * @return OFTrue if string values are identical, OFFalse otherwise + */ + OFBool compareStringAttributes(DcmItem *dataset, + const DcmTagKey &datKey, + DcmDirectoryRecord *record, + const DcmTagKey &recKey, + const OFFilename &sourceFilename, + const OFBool errorMsg = OFFalse); + + /** compare sequence attribute from dataset and record and report any deviation + * @param dataset DICOM dataset where the sequence value is stored + * @param key tag of the sequence to be compared + * @param record directory record where the sequence value is stored + * @param sourceFilename name of the source DICOM file + * @return OFTrue if sequences are identical, OFFalse otherwise + */ + OFBool compareSequenceAttributes(DcmItem *dataset, + DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename); + + /** set default value (number or prefix and number) to a given tag + * @param record directory record where the elements are stored + * @param key tag of the element to be modified + * @param number numeric value to be set as a the element value + * @param prefix optional prefix to be added to the numeric value + */ + void setDefaultValue(DcmDirectoryRecord *record, + const DcmTagKey &key, + const unsigned long number, + const char *prefix = NULL); + + + private: + + /// pointer to the current DICOMDIR object + DcmDicomDir *DicomDir; + + /// pointer to the optional image plugin (required for icon image support) + DicomDirImagePlugin *ImagePlugin; + + /// currently selected application profile + E_ApplicationProfile ApplicationProfile; + + /// create DICOMDIR backup + OFBool BackupMode; + /// abort on first inconsistent record + OFBool AbortMode; + /// automatically map filenames + OFBool MapFilenamesMode; + /// invent missing attributes mode + OFBool InventMode; + /// invent missing patient ID mode + OFBool InventPatientIDMode; + /// support retired SOP classes + OFBool RetiredSOPClassSupport; + /// check pixel encoding + OFBool EncodingCheck; + /// check image resolution + OFBool ResolutionCheck; + /// check transfer syntax + OFBool TransferSyntaxCheck; + /// check DICOM file format + OFBool FileFormatCheck; + /// check consistency of newly added record + OFBool ConsistencyCheck; + /// create icon images + OFBool IconImageMode; + /// update existing file-set + OFBool FilesetUpdateMode; + + /// name of the DICOMDIR backup file + OFFilename BackupFilename; + /// flag indicating whether a backup has been created + OFBool BackupCreated; + + /// size of the optional icon image in pixels + unsigned int IconSize; + /// filename prefix for the external icon images + OFFilename IconPrefix; + /// filename of the default icon (if any) + OFFilename DefaultIcon; + + /// flag indicating whether RLE decompression is supported + OFBool RLESupport; + /// flag indicating whether JPEG decompression is supported + OFBool JPEGSupport; + /// flag indicating whether JPEG 2000 decompression is supported + OFBool JP2KSupport; + + /// current patient number used to invent missing attribute values + unsigned long AutoPatientNumber; + /// current study number used to invent missing attribute values + unsigned long AutoStudyNumber; + /// current series number used to invent missing attribute values + unsigned long AutoSeriesNumber; + /// current instance number used to invent missing attribute values + unsigned long AutoInstanceNumber; + /// current overlay number used to invent missing attribute values + unsigned long AutoOverlayNumber; + /// current LUT number used to invent missing attribute values + unsigned long AutoLutNumber; + /// current curve number used to invent missing attribute values + unsigned long AutoCurveNumber; + + /// private undefined copy constructor + DicomDirInterface(const DicomDirInterface &obj); + + /// private undefined assignment operator + DicomDirInterface &operator=(const DicomDirInterface &obj); +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcdefine.h b/dcmdata/include/dcmtk/dcmdata/dcdefine.h new file mode 100644 index 00000000..7ec44b0a --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdefine.h @@ -0,0 +1,44 @@ +/* + * + * Copyright (C) 2011-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DCDEFINE_H +#define DCDEFINE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofdefine.h" + +// Workaround for Visual Studio to disable dll storage specifiers when linking directly into the executable. +// This is needed since the built-in dictionary code is created by the tools mkdeftag and mkdictbi and thus +// those tools statically link the few required dcmdata source files instead of linking to dcmdata as a whole. +#ifndef DCMDATA_BUILD_DICTIONARY +#ifdef dcmdata_EXPORTS +#define DCMTK_DCMDATA_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMDATA_EXPORT DCMTK_DECL_IMPORT +#endif +#else +#define DCMTK_DCMDATA_EXPORT +#endif + + +#endif // DCDEFINE_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcdeftag.h b/dcmdata/include/dcmtk/dcmdata/dcdeftag.h new file mode 100644 index 00000000..11751552 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdeftag.h @@ -0,0 +1,4833 @@ +/* +** DO NOT EDIT THIS FILE !!! +** It was generated automatically by: +** +** User: joergr +** Host: thinkpad +** Date: 2019-08-07 18:58:15 +** Prog: /home/joergr/Source/dcmtk-full/public/dcmdata/libsrc/mkdeftag +** +** From: ../data/dicom.dic +** ../data/private.dic +** +*/ + +#ifndef DCDEFTAG_H +#define DCDEFTAG_H + +#include "dcmtk/dcmdata/dctagkey.h" + +#define DCM_DICT_DEFTAG_BUILD_DATE "2019-08-07 18:58:15" + + +/* +** Fixed Tags in ascending (gggg,eeee) order. +** Number of entries: 4722 +** Tags with a repeating component (repeating tags) are listed later. +*/ +#define DCM_CommandGroupLength DcmTagKey(0x0000, 0x0000) +#define DCM_RETIRED_CommandLengthToEnd DcmTagKey(0x0000, 0x0001) +#define DCM_AffectedSOPClassUID DcmTagKey(0x0000, 0x0002) +#define DCM_RequestedSOPClassUID DcmTagKey(0x0000, 0x0003) +#define DCM_RETIRED_CommandRecognitionCode DcmTagKey(0x0000, 0x0010) +#define DCM_CommandField DcmTagKey(0x0000, 0x0100) +#define DCM_MessageID DcmTagKey(0x0000, 0x0110) +#define DCM_MessageIDBeingRespondedTo DcmTagKey(0x0000, 0x0120) +#define DCM_RETIRED_Initiator DcmTagKey(0x0000, 0x0200) +#define DCM_RETIRED_Receiver DcmTagKey(0x0000, 0x0300) +#define DCM_RETIRED_FindLocation DcmTagKey(0x0000, 0x0400) +#define DCM_MoveDestination DcmTagKey(0x0000, 0x0600) +#define DCM_Priority DcmTagKey(0x0000, 0x0700) +#define DCM_CommandDataSetType DcmTagKey(0x0000, 0x0800) +#define DCM_RETIRED_NumberOfMatches DcmTagKey(0x0000, 0x0850) +#define DCM_RETIRED_ResponseSequenceNumber DcmTagKey(0x0000, 0x0860) +#define DCM_Status DcmTagKey(0x0000, 0x0900) +#define DCM_OffendingElement DcmTagKey(0x0000, 0x0901) +#define DCM_ErrorComment DcmTagKey(0x0000, 0x0902) +#define DCM_ErrorID DcmTagKey(0x0000, 0x0903) +#define DCM_AffectedSOPInstanceUID DcmTagKey(0x0000, 0x1000) +#define DCM_RequestedSOPInstanceUID DcmTagKey(0x0000, 0x1001) +#define DCM_EventTypeID DcmTagKey(0x0000, 0x1002) +#define DCM_AttributeIdentifierList DcmTagKey(0x0000, 0x1005) +#define DCM_ActionTypeID DcmTagKey(0x0000, 0x1008) +#define DCM_NumberOfRemainingSuboperations DcmTagKey(0x0000, 0x1020) +#define DCM_NumberOfCompletedSuboperations DcmTagKey(0x0000, 0x1021) +#define DCM_NumberOfFailedSuboperations DcmTagKey(0x0000, 0x1022) +#define DCM_NumberOfWarningSuboperations DcmTagKey(0x0000, 0x1023) +#define DCM_MoveOriginatorApplicationEntityTitle DcmTagKey(0x0000, 0x1030) +#define DCM_MoveOriginatorMessageID DcmTagKey(0x0000, 0x1031) +#define DCM_RETIRED_DialogReceiver DcmTagKey(0x0000, 0x4000) +#define DCM_RETIRED_TerminalType DcmTagKey(0x0000, 0x4010) +#define DCM_RETIRED_MessageSetID DcmTagKey(0x0000, 0x5010) +#define DCM_RETIRED_EndMessageID DcmTagKey(0x0000, 0x5020) +#define DCM_RETIRED_DisplayFormat DcmTagKey(0x0000, 0x5110) +#define DCM_RETIRED_PagePositionID DcmTagKey(0x0000, 0x5120) +#define DCM_RETIRED_TextFormatID DcmTagKey(0x0000, 0x5130) +#define DCM_RETIRED_NormalReverse DcmTagKey(0x0000, 0x5140) +#define DCM_RETIRED_AddGrayScale DcmTagKey(0x0000, 0x5150) +#define DCM_RETIRED_Borders DcmTagKey(0x0000, 0x5160) +#define DCM_RETIRED_Copies DcmTagKey(0x0000, 0x5170) +#define DCM_RETIRED_CommandMagnificationType DcmTagKey(0x0000, 0x5180) +#define DCM_RETIRED_Erase DcmTagKey(0x0000, 0x5190) +#define DCM_RETIRED_Print DcmTagKey(0x0000, 0x51a0) +#define DCM_RETIRED_Overlays DcmTagKey(0x0000, 0x51b0) +#define DCM_FileMetaInformationGroupLength DcmTagKey(0x0002, 0x0000) +#define DCM_FileMetaInformationVersion DcmTagKey(0x0002, 0x0001) +#define DCM_MediaStorageSOPClassUID DcmTagKey(0x0002, 0x0002) +#define DCM_MediaStorageSOPInstanceUID DcmTagKey(0x0002, 0x0003) +#define DCM_TransferSyntaxUID DcmTagKey(0x0002, 0x0010) +#define DCM_ImplementationClassUID DcmTagKey(0x0002, 0x0012) +#define DCM_ImplementationVersionName DcmTagKey(0x0002, 0x0013) +#define DCM_SourceApplicationEntityTitle DcmTagKey(0x0002, 0x0016) +#define DCM_SendingApplicationEntityTitle DcmTagKey(0x0002, 0x0017) +#define DCM_ReceivingApplicationEntityTitle DcmTagKey(0x0002, 0x0018) +#define DCM_PrivateInformationCreatorUID DcmTagKey(0x0002, 0x0100) +#define DCM_PrivateInformation DcmTagKey(0x0002, 0x0102) +#define DCM_FileSetID DcmTagKey(0x0004, 0x1130) +#define DCM_FileSetDescriptorFileID DcmTagKey(0x0004, 0x1141) +#define DCM_SpecificCharacterSetOfFileSetDescriptorFile DcmTagKey(0x0004, 0x1142) +#define DCM_OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity DcmTagKey(0x0004, 0x1200) +#define DCM_OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity DcmTagKey(0x0004, 0x1202) +#define DCM_FileSetConsistencyFlag DcmTagKey(0x0004, 0x1212) +#define DCM_DirectoryRecordSequence DcmTagKey(0x0004, 0x1220) +#define DCM_OffsetOfTheNextDirectoryRecord DcmTagKey(0x0004, 0x1400) +#define DCM_RecordInUseFlag DcmTagKey(0x0004, 0x1410) +#define DCM_OffsetOfReferencedLowerLevelDirectoryEntity DcmTagKey(0x0004, 0x1420) +#define DCM_DirectoryRecordType DcmTagKey(0x0004, 0x1430) +#define DCM_PrivateRecordUID DcmTagKey(0x0004, 0x1432) +#define DCM_ReferencedFileID DcmTagKey(0x0004, 0x1500) +#define DCM_RETIRED_MRDRDirectoryRecordOffset DcmTagKey(0x0004, 0x1504) +#define DCM_ReferencedSOPClassUIDInFile DcmTagKey(0x0004, 0x1510) +#define DCM_ReferencedSOPInstanceUIDInFile DcmTagKey(0x0004, 0x1511) +#define DCM_ReferencedTransferSyntaxUIDInFile DcmTagKey(0x0004, 0x1512) +#define DCM_ReferencedRelatedGeneralSOPClassUIDInFile DcmTagKey(0x0004, 0x151a) +#define DCM_RETIRED_NumberOfReferences DcmTagKey(0x0004, 0x1600) +#define DCM_RETIRED_LengthToEnd DcmTagKey(0x0008, 0x0001) +#define DCM_SpecificCharacterSet DcmTagKey(0x0008, 0x0005) +#define DCM_LanguageCodeSequence DcmTagKey(0x0008, 0x0006) +#define DCM_ImageType DcmTagKey(0x0008, 0x0008) +#define DCM_RETIRED_RecognitionCode DcmTagKey(0x0008, 0x0010) +#define DCM_InstanceCreationDate DcmTagKey(0x0008, 0x0012) +#define DCM_InstanceCreationTime DcmTagKey(0x0008, 0x0013) +#define DCM_InstanceCreatorUID DcmTagKey(0x0008, 0x0014) +#define DCM_InstanceCoercionDateTime DcmTagKey(0x0008, 0x0015) +#define DCM_SOPClassUID DcmTagKey(0x0008, 0x0016) +#define DCM_SOPInstanceUID DcmTagKey(0x0008, 0x0018) +#define DCM_RelatedGeneralSOPClassUID DcmTagKey(0x0008, 0x001a) +#define DCM_OriginalSpecializedSOPClassUID DcmTagKey(0x0008, 0x001b) +#define DCM_StudyDate DcmTagKey(0x0008, 0x0020) +#define DCM_SeriesDate DcmTagKey(0x0008, 0x0021) +#define DCM_AcquisitionDate DcmTagKey(0x0008, 0x0022) +#define DCM_ContentDate DcmTagKey(0x0008, 0x0023) +#define DCM_RETIRED_OverlayDate DcmTagKey(0x0008, 0x0024) +#define DCM_RETIRED_CurveDate DcmTagKey(0x0008, 0x0025) +#define DCM_AcquisitionDateTime DcmTagKey(0x0008, 0x002a) +#define DCM_StudyTime DcmTagKey(0x0008, 0x0030) +#define DCM_SeriesTime DcmTagKey(0x0008, 0x0031) +#define DCM_AcquisitionTime DcmTagKey(0x0008, 0x0032) +#define DCM_ContentTime DcmTagKey(0x0008, 0x0033) +#define DCM_RETIRED_OverlayTime DcmTagKey(0x0008, 0x0034) +#define DCM_RETIRED_CurveTime DcmTagKey(0x0008, 0x0035) +#define DCM_RETIRED_DataSetType DcmTagKey(0x0008, 0x0040) +#define DCM_RETIRED_DataSetSubtype DcmTagKey(0x0008, 0x0041) +#define DCM_RETIRED_NuclearMedicineSeriesType DcmTagKey(0x0008, 0x0042) +#define DCM_AccessionNumber DcmTagKey(0x0008, 0x0050) +#define DCM_IssuerOfAccessionNumberSequence DcmTagKey(0x0008, 0x0051) +#define DCM_QueryRetrieveLevel DcmTagKey(0x0008, 0x0052) +#define DCM_QueryRetrieveView DcmTagKey(0x0008, 0x0053) +#define DCM_RetrieveAETitle DcmTagKey(0x0008, 0x0054) +#define DCM_StationAETitle DcmTagKey(0x0008, 0x0055) +#define DCM_InstanceAvailability DcmTagKey(0x0008, 0x0056) +#define DCM_FailedSOPInstanceUIDList DcmTagKey(0x0008, 0x0058) +#define DCM_Modality DcmTagKey(0x0008, 0x0060) +#define DCM_ModalitiesInStudy DcmTagKey(0x0008, 0x0061) +#define DCM_SOPClassesInStudy DcmTagKey(0x0008, 0x0062) +#define DCM_AnatomicRegionsInStudyCodeSequence DcmTagKey(0x0008, 0x0063) +#define DCM_ConversionType DcmTagKey(0x0008, 0x0064) +#define DCM_PresentationIntentType DcmTagKey(0x0008, 0x0068) +#define DCM_Manufacturer DcmTagKey(0x0008, 0x0070) +#define DCM_InstitutionName DcmTagKey(0x0008, 0x0080) +#define DCM_InstitutionAddress DcmTagKey(0x0008, 0x0081) +#define DCM_InstitutionCodeSequence DcmTagKey(0x0008, 0x0082) +#define DCM_ReferringPhysicianName DcmTagKey(0x0008, 0x0090) +#define DCM_ReferringPhysicianAddress DcmTagKey(0x0008, 0x0092) +#define DCM_ReferringPhysicianTelephoneNumbers DcmTagKey(0x0008, 0x0094) +#define DCM_ReferringPhysicianIdentificationSequence DcmTagKey(0x0008, 0x0096) +#define DCM_ConsultingPhysicianName DcmTagKey(0x0008, 0x009c) +#define DCM_ConsultingPhysicianIdentificationSequence DcmTagKey(0x0008, 0x009d) +#define DCM_CodeValue DcmTagKey(0x0008, 0x0100) +#define DCM_ExtendedCodeValue DcmTagKey(0x0008, 0x0101) +#define DCM_CodingSchemeDesignator DcmTagKey(0x0008, 0x0102) +#define DCM_CodingSchemeVersion DcmTagKey(0x0008, 0x0103) +#define DCM_CodeMeaning DcmTagKey(0x0008, 0x0104) +#define DCM_MappingResource DcmTagKey(0x0008, 0x0105) +#define DCM_ContextGroupVersion DcmTagKey(0x0008, 0x0106) +#define DCM_ContextGroupLocalVersion DcmTagKey(0x0008, 0x0107) +#define DCM_ExtendedCodeMeaning DcmTagKey(0x0008, 0x0108) +#define DCM_CodingSchemeResourcesSequence DcmTagKey(0x0008, 0x0109) +#define DCM_CodingSchemeURLType DcmTagKey(0x0008, 0x010a) +#define DCM_ContextGroupExtensionFlag DcmTagKey(0x0008, 0x010b) +#define DCM_CodingSchemeUID DcmTagKey(0x0008, 0x010c) +#define DCM_ContextGroupExtensionCreatorUID DcmTagKey(0x0008, 0x010d) +#define DCM_CodingSchemeURL DcmTagKey(0x0008, 0x010e) +#define DCM_ContextIdentifier DcmTagKey(0x0008, 0x010f) +#define DCM_CodingSchemeIdentificationSequence DcmTagKey(0x0008, 0x0110) +#define DCM_CodingSchemeRegistry DcmTagKey(0x0008, 0x0112) +#define DCM_CodingSchemeExternalID DcmTagKey(0x0008, 0x0114) +#define DCM_CodingSchemeName DcmTagKey(0x0008, 0x0115) +#define DCM_CodingSchemeResponsibleOrganization DcmTagKey(0x0008, 0x0116) +#define DCM_ContextUID DcmTagKey(0x0008, 0x0117) +#define DCM_MappingResourceUID DcmTagKey(0x0008, 0x0118) +#define DCM_LongCodeValue DcmTagKey(0x0008, 0x0119) +#define DCM_URNCodeValue DcmTagKey(0x0008, 0x0120) +#define DCM_EquivalentCodeSequence DcmTagKey(0x0008, 0x0121) +#define DCM_MappingResourceName DcmTagKey(0x0008, 0x0122) +#define DCM_ContextGroupIdentificationSequence DcmTagKey(0x0008, 0x0123) +#define DCM_MappingResourceIdentificationSequence DcmTagKey(0x0008, 0x0124) +#define DCM_TimezoneOffsetFromUTC DcmTagKey(0x0008, 0x0201) +#define DCM_ResponsibleGroupCodeSequence DcmTagKey(0x0008, 0x0220) +#define DCM_EquipmentModality DcmTagKey(0x0008, 0x0221) +#define DCM_ManufacturerRelatedModelGroup DcmTagKey(0x0008, 0x0222) +#define DCM_PrivateDataElementCharacteristicsSequence DcmTagKey(0x0008, 0x0300) +#define DCM_PrivateGroupReference DcmTagKey(0x0008, 0x0301) +#define DCM_PrivateCreatorReference DcmTagKey(0x0008, 0x0302) +#define DCM_BlockIdentifyingInformationStatus DcmTagKey(0x0008, 0x0303) +#define DCM_NonidentifyingPrivateElements DcmTagKey(0x0008, 0x0304) +#define DCM_DeidentificationActionSequence DcmTagKey(0x0008, 0x0305) +#define DCM_IdentifyingPrivateElements DcmTagKey(0x0008, 0x0306) +#define DCM_DeidentificationAction DcmTagKey(0x0008, 0x0307) +#define DCM_PrivateDataElement DcmTagKey(0x0008, 0x0308) +#define DCM_PrivateDataElementValueMultiplicity DcmTagKey(0x0008, 0x0309) +#define DCM_PrivateDataElementValueRepresentation DcmTagKey(0x0008, 0x030a) +#define DCM_PrivateDataElementNumberOfItems DcmTagKey(0x0008, 0x030b) +#define DCM_PrivateDataElementName DcmTagKey(0x0008, 0x030c) +#define DCM_PrivateDataElementKeyword DcmTagKey(0x0008, 0x030d) +#define DCM_PrivateDataElementDescription DcmTagKey(0x0008, 0x030e) +#define DCM_PrivateDataElementEncoding DcmTagKey(0x0008, 0x030f) +#define DCM_PrivateDataElementDefinitionSequence DcmTagKey(0x0008, 0x0310) +#define DCM_RETIRED_NetworkID DcmTagKey(0x0008, 0x1000) +#define DCM_StationName DcmTagKey(0x0008, 0x1010) +#define DCM_StudyDescription DcmTagKey(0x0008, 0x1030) +#define DCM_ProcedureCodeSequence DcmTagKey(0x0008, 0x1032) +#define DCM_SeriesDescription DcmTagKey(0x0008, 0x103e) +#define DCM_SeriesDescriptionCodeSequence DcmTagKey(0x0008, 0x103f) +#define DCM_InstitutionalDepartmentName DcmTagKey(0x0008, 0x1040) +#define DCM_InstitutionalDepartmentTypeCodeSequence DcmTagKey(0x0008, 0x1041) +#define DCM_PhysiciansOfRecord DcmTagKey(0x0008, 0x1048) +#define DCM_PhysiciansOfRecordIdentificationSequence DcmTagKey(0x0008, 0x1049) +#define DCM_PerformingPhysicianName DcmTagKey(0x0008, 0x1050) +#define DCM_PerformingPhysicianIdentificationSequence DcmTagKey(0x0008, 0x1052) +#define DCM_NameOfPhysiciansReadingStudy DcmTagKey(0x0008, 0x1060) +#define DCM_PhysiciansReadingStudyIdentificationSequence DcmTagKey(0x0008, 0x1062) +#define DCM_OperatorsName DcmTagKey(0x0008, 0x1070) +#define DCM_OperatorIdentificationSequence DcmTagKey(0x0008, 0x1072) +#define DCM_AdmittingDiagnosesDescription DcmTagKey(0x0008, 0x1080) +#define DCM_AdmittingDiagnosesCodeSequence DcmTagKey(0x0008, 0x1084) +#define DCM_ManufacturerModelName DcmTagKey(0x0008, 0x1090) +#define DCM_RETIRED_ReferencedResultsSequence DcmTagKey(0x0008, 0x1100) +#define DCM_ReferencedStudySequence DcmTagKey(0x0008, 0x1110) +#define DCM_ReferencedPerformedProcedureStepSequence DcmTagKey(0x0008, 0x1111) +#define DCM_ReferencedSeriesSequence DcmTagKey(0x0008, 0x1115) +#define DCM_ReferencedPatientSequence DcmTagKey(0x0008, 0x1120) +#define DCM_ReferencedVisitSequence DcmTagKey(0x0008, 0x1125) +#define DCM_RETIRED_ReferencedOverlaySequence DcmTagKey(0x0008, 0x1130) +#define DCM_ReferencedStereometricInstanceSequence DcmTagKey(0x0008, 0x1134) +#define DCM_ReferencedWaveformSequence DcmTagKey(0x0008, 0x113a) +#define DCM_ReferencedImageSequence DcmTagKey(0x0008, 0x1140) +#define DCM_RETIRED_ReferencedCurveSequence DcmTagKey(0x0008, 0x1145) +#define DCM_ReferencedInstanceSequence DcmTagKey(0x0008, 0x114a) +#define DCM_ReferencedRealWorldValueMappingInstanceSequence DcmTagKey(0x0008, 0x114b) +#define DCM_ReferencedSOPClassUID DcmTagKey(0x0008, 0x1150) +#define DCM_ReferencedSOPInstanceUID DcmTagKey(0x0008, 0x1155) +#define DCM_DefinitionSourceSequence DcmTagKey(0x0008, 0x1156) +#define DCM_SOPClassesSupported DcmTagKey(0x0008, 0x115a) +#define DCM_ReferencedFrameNumber DcmTagKey(0x0008, 0x1160) +#define DCM_SimpleFrameList DcmTagKey(0x0008, 0x1161) +#define DCM_CalculatedFrameList DcmTagKey(0x0008, 0x1162) +#define DCM_TimeRange DcmTagKey(0x0008, 0x1163) +#define DCM_FrameExtractionSequence DcmTagKey(0x0008, 0x1164) +#define DCM_MultiFrameSourceSOPInstanceUID DcmTagKey(0x0008, 0x1167) +#define DCM_RetrieveURL DcmTagKey(0x0008, 0x1190) +#define DCM_TransactionUID DcmTagKey(0x0008, 0x1195) +#define DCM_WarningReason DcmTagKey(0x0008, 0x1196) +#define DCM_FailureReason DcmTagKey(0x0008, 0x1197) +#define DCM_FailedSOPSequence DcmTagKey(0x0008, 0x1198) +#define DCM_ReferencedSOPSequence DcmTagKey(0x0008, 0x1199) +#define DCM_OtherFailuresSequence DcmTagKey(0x0008, 0x119a) +#define DCM_StudiesContainingOtherReferencedInstancesSequence DcmTagKey(0x0008, 0x1200) +#define DCM_RelatedSeriesSequence DcmTagKey(0x0008, 0x1250) +#define DCM_RETIRED_LossyImageCompressionRetired DcmTagKey(0x0008, 0x2110) +#define DCM_DerivationDescription DcmTagKey(0x0008, 0x2111) +#define DCM_SourceImageSequence DcmTagKey(0x0008, 0x2112) +#define DCM_StageName DcmTagKey(0x0008, 0x2120) +#define DCM_StageNumber DcmTagKey(0x0008, 0x2122) +#define DCM_NumberOfStages DcmTagKey(0x0008, 0x2124) +#define DCM_ViewName DcmTagKey(0x0008, 0x2127) +#define DCM_ViewNumber DcmTagKey(0x0008, 0x2128) +#define DCM_NumberOfEventTimers DcmTagKey(0x0008, 0x2129) +#define DCM_NumberOfViewsInStage DcmTagKey(0x0008, 0x212a) +#define DCM_EventElapsedTimes DcmTagKey(0x0008, 0x2130) +#define DCM_EventTimerNames DcmTagKey(0x0008, 0x2132) +#define DCM_EventTimerSequence DcmTagKey(0x0008, 0x2133) +#define DCM_EventTimeOffset DcmTagKey(0x0008, 0x2134) +#define DCM_EventCodeSequence DcmTagKey(0x0008, 0x2135) +#define DCM_StartTrim DcmTagKey(0x0008, 0x2142) +#define DCM_StopTrim DcmTagKey(0x0008, 0x2143) +#define DCM_RecommendedDisplayFrameRate DcmTagKey(0x0008, 0x2144) +#define DCM_RETIRED_TransducerPosition DcmTagKey(0x0008, 0x2200) +#define DCM_RETIRED_TransducerOrientation DcmTagKey(0x0008, 0x2204) +#define DCM_RETIRED_AnatomicStructure DcmTagKey(0x0008, 0x2208) +#define DCM_AnatomicRegionSequence DcmTagKey(0x0008, 0x2218) +#define DCM_AnatomicRegionModifierSequence DcmTagKey(0x0008, 0x2220) +#define DCM_PrimaryAnatomicStructureSequence DcmTagKey(0x0008, 0x2228) +#define DCM_RETIRED_AnatomicStructureSpaceOrRegionSequence DcmTagKey(0x0008, 0x2229) +#define DCM_PrimaryAnatomicStructureModifierSequence DcmTagKey(0x0008, 0x2230) +#define DCM_RETIRED_TransducerPositionSequence DcmTagKey(0x0008, 0x2240) +#define DCM_RETIRED_TransducerPositionModifierSequence DcmTagKey(0x0008, 0x2242) +#define DCM_RETIRED_TransducerOrientationSequence DcmTagKey(0x0008, 0x2244) +#define DCM_RETIRED_TransducerOrientationModifierSequence DcmTagKey(0x0008, 0x2246) +#define DCM_RETIRED_AnatomicStructureSpaceOrRegionCodeSequenceTrial DcmTagKey(0x0008, 0x2251) +#define DCM_RETIRED_AnatomicPortalOfEntranceCodeSequenceTrial DcmTagKey(0x0008, 0x2253) +#define DCM_RETIRED_AnatomicApproachDirectionCodeSequenceTrial DcmTagKey(0x0008, 0x2255) +#define DCM_RETIRED_AnatomicPerspectiveDescriptionTrial DcmTagKey(0x0008, 0x2256) +#define DCM_RETIRED_AnatomicPerspectiveCodeSequenceTrial DcmTagKey(0x0008, 0x2257) +#define DCM_RETIRED_AnatomicLocationOfExaminingInstrumentDescriptionTrial DcmTagKey(0x0008, 0x2258) +#define DCM_RETIRED_AnatomicLocationOfExaminingInstrumentCodeSequenceTrial DcmTagKey(0x0008, 0x2259) +#define DCM_RETIRED_AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial DcmTagKey(0x0008, 0x225a) +#define DCM_RETIRED_OnAxisBackgroundAnatomicStructureCodeSequenceTrial DcmTagKey(0x0008, 0x225c) +#define DCM_AlternateRepresentationSequence DcmTagKey(0x0008, 0x3001) +#define DCM_IrradiationEventUID DcmTagKey(0x0008, 0x3010) +#define DCM_SourceIrradiationEventSequence DcmTagKey(0x0008, 0x3011) +#define DCM_RadiopharmaceuticalAdministrationEventUID DcmTagKey(0x0008, 0x3012) +#define DCM_RETIRED_IdentifyingComments DcmTagKey(0x0008, 0x4000) +#define DCM_FrameType DcmTagKey(0x0008, 0x9007) +#define DCM_ReferencedImageEvidenceSequence DcmTagKey(0x0008, 0x9092) +#define DCM_ReferencedRawDataSequence DcmTagKey(0x0008, 0x9121) +#define DCM_CreatorVersionUID DcmTagKey(0x0008, 0x9123) +#define DCM_DerivationImageSequence DcmTagKey(0x0008, 0x9124) +#define DCM_SourceImageEvidenceSequence DcmTagKey(0x0008, 0x9154) +#define DCM_PixelPresentation DcmTagKey(0x0008, 0x9205) +#define DCM_VolumetricProperties DcmTagKey(0x0008, 0x9206) +#define DCM_VolumeBasedCalculationTechnique DcmTagKey(0x0008, 0x9207) +#define DCM_ComplexImageComponent DcmTagKey(0x0008, 0x9208) +#define DCM_AcquisitionContrast DcmTagKey(0x0008, 0x9209) +#define DCM_DerivationCodeSequence DcmTagKey(0x0008, 0x9215) +#define DCM_ReferencedPresentationStateSequence DcmTagKey(0x0008, 0x9237) +#define DCM_ReferencedOtherPlaneSequence DcmTagKey(0x0008, 0x9410) +#define DCM_FrameDisplaySequence DcmTagKey(0x0008, 0x9458) +#define DCM_RecommendedDisplayFrameRateInFloat DcmTagKey(0x0008, 0x9459) +#define DCM_SkipFrameRangeFlag DcmTagKey(0x0008, 0x9460) +#define DCM_PatientName DcmTagKey(0x0010, 0x0010) +#define DCM_PatientID DcmTagKey(0x0010, 0x0020) +#define DCM_IssuerOfPatientID DcmTagKey(0x0010, 0x0021) +#define DCM_TypeOfPatientID DcmTagKey(0x0010, 0x0022) +#define DCM_IssuerOfPatientIDQualifiersSequence DcmTagKey(0x0010, 0x0024) +#define DCM_SourcePatientGroupIdentificationSequence DcmTagKey(0x0010, 0x0026) +#define DCM_GroupOfPatientsIdentificationSequence DcmTagKey(0x0010, 0x0027) +#define DCM_SubjectRelativePositionInImage DcmTagKey(0x0010, 0x0028) +#define DCM_PatientBirthDate DcmTagKey(0x0010, 0x0030) +#define DCM_PatientBirthTime DcmTagKey(0x0010, 0x0032) +#define DCM_PatientBirthDateInAlternativeCalendar DcmTagKey(0x0010, 0x0033) +#define DCM_PatientDeathDateInAlternativeCalendar DcmTagKey(0x0010, 0x0034) +#define DCM_PatientAlternativeCalendar DcmTagKey(0x0010, 0x0035) +#define DCM_PatientSex DcmTagKey(0x0010, 0x0040) +#define DCM_PatientInsurancePlanCodeSequence DcmTagKey(0x0010, 0x0050) +#define DCM_PatientPrimaryLanguageCodeSequence DcmTagKey(0x0010, 0x0101) +#define DCM_PatientPrimaryLanguageModifierCodeSequence DcmTagKey(0x0010, 0x0102) +#define DCM_QualityControlSubject DcmTagKey(0x0010, 0x0200) +#define DCM_QualityControlSubjectTypeCodeSequence DcmTagKey(0x0010, 0x0201) +#define DCM_StrainDescription DcmTagKey(0x0010, 0x0212) +#define DCM_StrainNomenclature DcmTagKey(0x0010, 0x0213) +#define DCM_StrainStockNumber DcmTagKey(0x0010, 0x0214) +#define DCM_StrainSourceRegistryCodeSequence DcmTagKey(0x0010, 0x0215) +#define DCM_StrainStockSequence DcmTagKey(0x0010, 0x0216) +#define DCM_StrainSource DcmTagKey(0x0010, 0x0217) +#define DCM_StrainAdditionalInformation DcmTagKey(0x0010, 0x0218) +#define DCM_StrainCodeSequence DcmTagKey(0x0010, 0x0219) +#define DCM_GeneticModificationsSequence DcmTagKey(0x0010, 0x0221) +#define DCM_GeneticModificationsDescription DcmTagKey(0x0010, 0x0222) +#define DCM_GeneticModificationsNomenclature DcmTagKey(0x0010, 0x0223) +#define DCM_GeneticModificationsCodeSequence DcmTagKey(0x0010, 0x0229) +#define DCM_RETIRED_OtherPatientIDs DcmTagKey(0x0010, 0x1000) +#define DCM_OtherPatientNames DcmTagKey(0x0010, 0x1001) +#define DCM_OtherPatientIDsSequence DcmTagKey(0x0010, 0x1002) +#define DCM_PatientBirthName DcmTagKey(0x0010, 0x1005) +#define DCM_PatientAge DcmTagKey(0x0010, 0x1010) +#define DCM_PatientSize DcmTagKey(0x0010, 0x1020) +#define DCM_PatientSizeCodeSequence DcmTagKey(0x0010, 0x1021) +#define DCM_PatientBodyMassIndex DcmTagKey(0x0010, 0x1022) +#define DCM_MeasuredAPDimension DcmTagKey(0x0010, 0x1023) +#define DCM_MeasuredLateralDimension DcmTagKey(0x0010, 0x1024) +#define DCM_PatientWeight DcmTagKey(0x0010, 0x1030) +#define DCM_PatientAddress DcmTagKey(0x0010, 0x1040) +#define DCM_RETIRED_InsurancePlanIdentification DcmTagKey(0x0010, 0x1050) +#define DCM_PatientMotherBirthName DcmTagKey(0x0010, 0x1060) +#define DCM_MilitaryRank DcmTagKey(0x0010, 0x1080) +#define DCM_BranchOfService DcmTagKey(0x0010, 0x1081) +#define DCM_RETIRED_MedicalRecordLocator DcmTagKey(0x0010, 0x1090) +#define DCM_ReferencedPatientPhotoSequence DcmTagKey(0x0010, 0x1100) +#define DCM_MedicalAlerts DcmTagKey(0x0010, 0x2000) +#define DCM_Allergies DcmTagKey(0x0010, 0x2110) +#define DCM_CountryOfResidence DcmTagKey(0x0010, 0x2150) +#define DCM_RegionOfResidence DcmTagKey(0x0010, 0x2152) +#define DCM_PatientTelephoneNumbers DcmTagKey(0x0010, 0x2154) +#define DCM_PatientTelecomInformation DcmTagKey(0x0010, 0x2155) +#define DCM_EthnicGroup DcmTagKey(0x0010, 0x2160) +#define DCM_Occupation DcmTagKey(0x0010, 0x2180) +#define DCM_SmokingStatus DcmTagKey(0x0010, 0x21a0) +#define DCM_AdditionalPatientHistory DcmTagKey(0x0010, 0x21b0) +#define DCM_PregnancyStatus DcmTagKey(0x0010, 0x21c0) +#define DCM_LastMenstrualDate DcmTagKey(0x0010, 0x21d0) +#define DCM_PatientReligiousPreference DcmTagKey(0x0010, 0x21f0) +#define DCM_PatientSpeciesDescription DcmTagKey(0x0010, 0x2201) +#define DCM_PatientSpeciesCodeSequence DcmTagKey(0x0010, 0x2202) +#define DCM_PatientSexNeutered DcmTagKey(0x0010, 0x2203) +#define DCM_AnatomicalOrientationType DcmTagKey(0x0010, 0x2210) +#define DCM_PatientBreedDescription DcmTagKey(0x0010, 0x2292) +#define DCM_PatientBreedCodeSequence DcmTagKey(0x0010, 0x2293) +#define DCM_BreedRegistrationSequence DcmTagKey(0x0010, 0x2294) +#define DCM_BreedRegistrationNumber DcmTagKey(0x0010, 0x2295) +#define DCM_BreedRegistryCodeSequence DcmTagKey(0x0010, 0x2296) +#define DCM_ResponsiblePerson DcmTagKey(0x0010, 0x2297) +#define DCM_ResponsiblePersonRole DcmTagKey(0x0010, 0x2298) +#define DCM_ResponsibleOrganization DcmTagKey(0x0010, 0x2299) +#define DCM_PatientComments DcmTagKey(0x0010, 0x4000) +#define DCM_ExaminedBodyThickness DcmTagKey(0x0010, 0x9431) +#define DCM_ClinicalTrialSponsorName DcmTagKey(0x0012, 0x0010) +#define DCM_ClinicalTrialProtocolID DcmTagKey(0x0012, 0x0020) +#define DCM_ClinicalTrialProtocolName DcmTagKey(0x0012, 0x0021) +#define DCM_ClinicalTrialSiteID DcmTagKey(0x0012, 0x0030) +#define DCM_ClinicalTrialSiteName DcmTagKey(0x0012, 0x0031) +#define DCM_ClinicalTrialSubjectID DcmTagKey(0x0012, 0x0040) +#define DCM_ClinicalTrialSubjectReadingID DcmTagKey(0x0012, 0x0042) +#define DCM_ClinicalTrialTimePointID DcmTagKey(0x0012, 0x0050) +#define DCM_ClinicalTrialTimePointDescription DcmTagKey(0x0012, 0x0051) +#define DCM_LongitudinalTemporalOffsetFromEvent DcmTagKey(0x0012, 0x0052) +#define DCM_LongitudinalTemporalEventType DcmTagKey(0x0012, 0x0053) +#define DCM_ClinicalTrialCoordinatingCenterName DcmTagKey(0x0012, 0x0060) +#define DCM_PatientIdentityRemoved DcmTagKey(0x0012, 0x0062) +#define DCM_DeidentificationMethod DcmTagKey(0x0012, 0x0063) +#define DCM_DeidentificationMethodCodeSequence DcmTagKey(0x0012, 0x0064) +#define DCM_ClinicalTrialSeriesID DcmTagKey(0x0012, 0x0071) +#define DCM_ClinicalTrialSeriesDescription DcmTagKey(0x0012, 0x0072) +#define DCM_ClinicalTrialProtocolEthicsCommitteeName DcmTagKey(0x0012, 0x0081) +#define DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber DcmTagKey(0x0012, 0x0082) +#define DCM_ConsentForClinicalTrialUseSequence DcmTagKey(0x0012, 0x0083) +#define DCM_DistributionType DcmTagKey(0x0012, 0x0084) +#define DCM_ConsentForDistributionFlag DcmTagKey(0x0012, 0x0085) +#define DCM_EthicsCommitteeApprovalEffectivenessStartDate DcmTagKey(0x0012, 0x0086) +#define DCM_EthicsCommitteeApprovalEffectivenessEndDate DcmTagKey(0x0012, 0x0087) +#define DCM_RETIRED_CADFileFormat DcmTagKey(0x0014, 0x0023) +#define DCM_RETIRED_ComponentReferenceSystem DcmTagKey(0x0014, 0x0024) +#define DCM_ComponentManufacturingProcedure DcmTagKey(0x0014, 0x0025) +#define DCM_ComponentManufacturer DcmTagKey(0x0014, 0x0028) +#define DCM_MaterialThickness DcmTagKey(0x0014, 0x0030) +#define DCM_MaterialPipeDiameter DcmTagKey(0x0014, 0x0032) +#define DCM_MaterialIsolationDiameter DcmTagKey(0x0014, 0x0034) +#define DCM_MaterialGrade DcmTagKey(0x0014, 0x0042) +#define DCM_MaterialPropertiesDescription DcmTagKey(0x0014, 0x0044) +#define DCM_RETIRED_MaterialPropertiesFileFormatRetired DcmTagKey(0x0014, 0x0045) +#define DCM_MaterialNotes DcmTagKey(0x0014, 0x0046) +#define DCM_ComponentShape DcmTagKey(0x0014, 0x0050) +#define DCM_CurvatureType DcmTagKey(0x0014, 0x0052) +#define DCM_OuterDiameter DcmTagKey(0x0014, 0x0054) +#define DCM_InnerDiameter DcmTagKey(0x0014, 0x0056) +#define DCM_ComponentWelderIDs DcmTagKey(0x0014, 0x0100) +#define DCM_SecondaryApprovalStatus DcmTagKey(0x0014, 0x0101) +#define DCM_SecondaryReviewDate DcmTagKey(0x0014, 0x0102) +#define DCM_SecondaryReviewTime DcmTagKey(0x0014, 0x0103) +#define DCM_SecondaryReviewerName DcmTagKey(0x0014, 0x0104) +#define DCM_RepairID DcmTagKey(0x0014, 0x0105) +#define DCM_MultipleComponentApprovalSequence DcmTagKey(0x0014, 0x0106) +#define DCM_OtherApprovalStatus DcmTagKey(0x0014, 0x0107) +#define DCM_OtherSecondaryApprovalStatus DcmTagKey(0x0014, 0x0108) +#define DCM_ActualEnvironmentalConditions DcmTagKey(0x0014, 0x1010) +#define DCM_ExpiryDate DcmTagKey(0x0014, 0x1020) +#define DCM_EnvironmentalConditions DcmTagKey(0x0014, 0x1040) +#define DCM_EvaluatorSequence DcmTagKey(0x0014, 0x2002) +#define DCM_EvaluatorNumber DcmTagKey(0x0014, 0x2004) +#define DCM_EvaluatorName DcmTagKey(0x0014, 0x2006) +#define DCM_EvaluationAttempt DcmTagKey(0x0014, 0x2008) +#define DCM_IndicationSequence DcmTagKey(0x0014, 0x2012) +#define DCM_IndicationNumber DcmTagKey(0x0014, 0x2014) +#define DCM_IndicationLabel DcmTagKey(0x0014, 0x2016) +#define DCM_IndicationDescription DcmTagKey(0x0014, 0x2018) +#define DCM_IndicationType DcmTagKey(0x0014, 0x201a) +#define DCM_IndicationDisposition DcmTagKey(0x0014, 0x201c) +#define DCM_IndicationROISequence DcmTagKey(0x0014, 0x201e) +#define DCM_IndicationPhysicalPropertySequence DcmTagKey(0x0014, 0x2030) +#define DCM_PropertyLabel DcmTagKey(0x0014, 0x2032) +#define DCM_CoordinateSystemNumberOfAxes DcmTagKey(0x0014, 0x2202) +#define DCM_CoordinateSystemAxesSequence DcmTagKey(0x0014, 0x2204) +#define DCM_CoordinateSystemAxisDescription DcmTagKey(0x0014, 0x2206) +#define DCM_CoordinateSystemDataSetMapping DcmTagKey(0x0014, 0x2208) +#define DCM_CoordinateSystemAxisNumber DcmTagKey(0x0014, 0x220a) +#define DCM_CoordinateSystemAxisType DcmTagKey(0x0014, 0x220c) +#define DCM_CoordinateSystemAxisUnits DcmTagKey(0x0014, 0x220e) +#define DCM_CoordinateSystemAxisValues DcmTagKey(0x0014, 0x2210) +#define DCM_CoordinateSystemTransformSequence DcmTagKey(0x0014, 0x2220) +#define DCM_TransformDescription DcmTagKey(0x0014, 0x2222) +#define DCM_TransformNumberOfAxes DcmTagKey(0x0014, 0x2224) +#define DCM_TransformOrderOfAxes DcmTagKey(0x0014, 0x2226) +#define DCM_TransformedAxisUnits DcmTagKey(0x0014, 0x2228) +#define DCM_CoordinateSystemTransformRotationAndScaleMatrix DcmTagKey(0x0014, 0x222a) +#define DCM_CoordinateSystemTransformTranslationMatrix DcmTagKey(0x0014, 0x222c) +#define DCM_InternalDetectorFrameTime DcmTagKey(0x0014, 0x3011) +#define DCM_NumberOfFramesIntegrated DcmTagKey(0x0014, 0x3012) +#define DCM_DetectorTemperatureSequence DcmTagKey(0x0014, 0x3020) +#define DCM_SensorName DcmTagKey(0x0014, 0x3022) +#define DCM_HorizontalOffsetOfSensor DcmTagKey(0x0014, 0x3024) +#define DCM_VerticalOffsetOfSensor DcmTagKey(0x0014, 0x3026) +#define DCM_SensorTemperature DcmTagKey(0x0014, 0x3028) +#define DCM_DarkCurrentSequence DcmTagKey(0x0014, 0x3040) +#define DCM_DarkCurrentCounts DcmTagKey(0x0014, 0x3050) +#define DCM_GainCorrectionReferenceSequence DcmTagKey(0x0014, 0x3060) +#define DCM_AirCounts DcmTagKey(0x0014, 0x3070) +#define DCM_KVUsedInGainCalibration DcmTagKey(0x0014, 0x3071) +#define DCM_MAUsedInGainCalibration DcmTagKey(0x0014, 0x3072) +#define DCM_NumberOfFramesUsedForIntegration DcmTagKey(0x0014, 0x3073) +#define DCM_FilterMaterialUsedInGainCalibration DcmTagKey(0x0014, 0x3074) +#define DCM_FilterThicknessUsedInGainCalibration DcmTagKey(0x0014, 0x3075) +#define DCM_DateOfGainCalibration DcmTagKey(0x0014, 0x3076) +#define DCM_TimeOfGainCalibration DcmTagKey(0x0014, 0x3077) +#define DCM_BadPixelImage DcmTagKey(0x0014, 0x3080) +#define DCM_CalibrationNotes DcmTagKey(0x0014, 0x3099) +#define DCM_PulserEquipmentSequence DcmTagKey(0x0014, 0x4002) +#define DCM_PulserType DcmTagKey(0x0014, 0x4004) +#define DCM_PulserNotes DcmTagKey(0x0014, 0x4006) +#define DCM_ReceiverEquipmentSequence DcmTagKey(0x0014, 0x4008) +#define DCM_AmplifierType DcmTagKey(0x0014, 0x400a) +#define DCM_ReceiverNotes DcmTagKey(0x0014, 0x400c) +#define DCM_PreAmplifierEquipmentSequence DcmTagKey(0x0014, 0x400e) +#define DCM_PreAmplifierNotes DcmTagKey(0x0014, 0x400f) +#define DCM_TransmitTransducerSequence DcmTagKey(0x0014, 0x4010) +#define DCM_ReceiveTransducerSequence DcmTagKey(0x0014, 0x4011) +#define DCM_NumberOfElements DcmTagKey(0x0014, 0x4012) +#define DCM_ElementShape DcmTagKey(0x0014, 0x4013) +#define DCM_ElementDimensionA DcmTagKey(0x0014, 0x4014) +#define DCM_ElementDimensionB DcmTagKey(0x0014, 0x4015) +#define DCM_ElementPitchA DcmTagKey(0x0014, 0x4016) +#define DCM_MeasuredBeamDimensionA DcmTagKey(0x0014, 0x4017) +#define DCM_MeasuredBeamDimensionB DcmTagKey(0x0014, 0x4018) +#define DCM_LocationOfMeasuredBeamDiameter DcmTagKey(0x0014, 0x4019) +#define DCM_NominalFrequency DcmTagKey(0x0014, 0x401a) +#define DCM_MeasuredCenterFrequency DcmTagKey(0x0014, 0x401b) +#define DCM_MeasuredBandwidth DcmTagKey(0x0014, 0x401c) +#define DCM_ElementPitchB DcmTagKey(0x0014, 0x401d) +#define DCM_PulserSettingsSequence DcmTagKey(0x0014, 0x4020) +#define DCM_PulseWidth DcmTagKey(0x0014, 0x4022) +#define DCM_ExcitationFrequency DcmTagKey(0x0014, 0x4024) +#define DCM_ModulationType DcmTagKey(0x0014, 0x4026) +#define DCM_Damping DcmTagKey(0x0014, 0x4028) +#define DCM_ReceiverSettingsSequence DcmTagKey(0x0014, 0x4030) +#define DCM_AcquiredSoundpathLength DcmTagKey(0x0014, 0x4031) +#define DCM_AcquisitionCompressionType DcmTagKey(0x0014, 0x4032) +#define DCM_AcquisitionSampleSize DcmTagKey(0x0014, 0x4033) +#define DCM_RectifierSmoothing DcmTagKey(0x0014, 0x4034) +#define DCM_DACSequence DcmTagKey(0x0014, 0x4035) +#define DCM_DACType DcmTagKey(0x0014, 0x4036) +#define DCM_DACGainPoints DcmTagKey(0x0014, 0x4038) +#define DCM_DACTimePoints DcmTagKey(0x0014, 0x403a) +#define DCM_DACAmplitude DcmTagKey(0x0014, 0x403c) +#define DCM_PreAmplifierSettingsSequence DcmTagKey(0x0014, 0x4040) +#define DCM_TransmitTransducerSettingsSequence DcmTagKey(0x0014, 0x4050) +#define DCM_ReceiveTransducerSettingsSequence DcmTagKey(0x0014, 0x4051) +#define DCM_IncidentAngle DcmTagKey(0x0014, 0x4052) +#define DCM_CouplingTechnique DcmTagKey(0x0014, 0x4054) +#define DCM_CouplingMedium DcmTagKey(0x0014, 0x4056) +#define DCM_CouplingVelocity DcmTagKey(0x0014, 0x4057) +#define DCM_ProbeCenterLocationX DcmTagKey(0x0014, 0x4058) +#define DCM_ProbeCenterLocationZ DcmTagKey(0x0014, 0x4059) +#define DCM_SoundPathLength DcmTagKey(0x0014, 0x405a) +#define DCM_DelayLawIdentifier DcmTagKey(0x0014, 0x405c) +#define DCM_GateSettingsSequence DcmTagKey(0x0014, 0x4060) +#define DCM_GateThreshold DcmTagKey(0x0014, 0x4062) +#define DCM_VelocityOfSound DcmTagKey(0x0014, 0x4064) +#define DCM_CalibrationSettingsSequence DcmTagKey(0x0014, 0x4070) +#define DCM_CalibrationProcedure DcmTagKey(0x0014, 0x4072) +#define DCM_ProcedureVersion DcmTagKey(0x0014, 0x4074) +#define DCM_ProcedureCreationDate DcmTagKey(0x0014, 0x4076) +#define DCM_ProcedureExpirationDate DcmTagKey(0x0014, 0x4078) +#define DCM_ProcedureLastModifiedDate DcmTagKey(0x0014, 0x407a) +#define DCM_CalibrationTime DcmTagKey(0x0014, 0x407c) +#define DCM_CalibrationDate DcmTagKey(0x0014, 0x407e) +#define DCM_ProbeDriveEquipmentSequence DcmTagKey(0x0014, 0x4080) +#define DCM_DriveType DcmTagKey(0x0014, 0x4081) +#define DCM_ProbeDriveNotes DcmTagKey(0x0014, 0x4082) +#define DCM_DriveProbeSequence DcmTagKey(0x0014, 0x4083) +#define DCM_ProbeInductance DcmTagKey(0x0014, 0x4084) +#define DCM_ProbeResistance DcmTagKey(0x0014, 0x4085) +#define DCM_ReceiveProbeSequence DcmTagKey(0x0014, 0x4086) +#define DCM_ProbeDriveSettingsSequence DcmTagKey(0x0014, 0x4087) +#define DCM_BridgeResistors DcmTagKey(0x0014, 0x4088) +#define DCM_ProbeOrientationAngle DcmTagKey(0x0014, 0x4089) +#define DCM_UserSelectedGainY DcmTagKey(0x0014, 0x408b) +#define DCM_UserSelectedPhase DcmTagKey(0x0014, 0x408c) +#define DCM_UserSelectedOffsetX DcmTagKey(0x0014, 0x408d) +#define DCM_UserSelectedOffsetY DcmTagKey(0x0014, 0x408e) +#define DCM_ChannelSettingsSequence DcmTagKey(0x0014, 0x4091) +#define DCM_ChannelThreshold DcmTagKey(0x0014, 0x4092) +#define DCM_ScannerSettingsSequence DcmTagKey(0x0014, 0x409a) +#define DCM_ScanProcedure DcmTagKey(0x0014, 0x409b) +#define DCM_TranslationRateX DcmTagKey(0x0014, 0x409c) +#define DCM_TranslationRateY DcmTagKey(0x0014, 0x409d) +#define DCM_ChannelOverlap DcmTagKey(0x0014, 0x409f) +#define DCM_ImageQualityIndicatorType DcmTagKey(0x0014, 0x40a0) +#define DCM_ImageQualityIndicatorMaterial DcmTagKey(0x0014, 0x40a1) +#define DCM_ImageQualityIndicatorSize DcmTagKey(0x0014, 0x40a2) +#define DCM_LINACEnergy DcmTagKey(0x0014, 0x5002) +#define DCM_LINACOutput DcmTagKey(0x0014, 0x5004) +#define DCM_ActiveAperture DcmTagKey(0x0014, 0x5100) +#define DCM_TotalAperture DcmTagKey(0x0014, 0x5101) +#define DCM_ApertureElevation DcmTagKey(0x0014, 0x5102) +#define DCM_MainLobeAngle DcmTagKey(0x0014, 0x5103) +#define DCM_MainRoofAngle DcmTagKey(0x0014, 0x5104) +#define DCM_ConnectorType DcmTagKey(0x0014, 0x5105) +#define DCM_WedgeModelNumber DcmTagKey(0x0014, 0x5106) +#define DCM_WedgeAngleFloat DcmTagKey(0x0014, 0x5107) +#define DCM_WedgeRoofAngle DcmTagKey(0x0014, 0x5108) +#define DCM_WedgeElement1Position DcmTagKey(0x0014, 0x5109) +#define DCM_WedgeMaterialVelocity DcmTagKey(0x0014, 0x510a) +#define DCM_WedgeMaterial DcmTagKey(0x0014, 0x510b) +#define DCM_WedgeOffsetZ DcmTagKey(0x0014, 0x510c) +#define DCM_WedgeOriginOffsetX DcmTagKey(0x0014, 0x510d) +#define DCM_WedgeTimeDelay DcmTagKey(0x0014, 0x510e) +#define DCM_WedgeName DcmTagKey(0x0014, 0x510f) +#define DCM_WedgeManufacturerName DcmTagKey(0x0014, 0x5110) +#define DCM_WedgeDescription DcmTagKey(0x0014, 0x5111) +#define DCM_NominalBeamAngle DcmTagKey(0x0014, 0x5112) +#define DCM_WedgeOffsetX DcmTagKey(0x0014, 0x5113) +#define DCM_WedgeOffsetY DcmTagKey(0x0014, 0x5114) +#define DCM_WedgeTotalLength DcmTagKey(0x0014, 0x5115) +#define DCM_WedgeInContactLength DcmTagKey(0x0014, 0x5116) +#define DCM_WedgeFrontGap DcmTagKey(0x0014, 0x5117) +#define DCM_WedgeTotalHeight DcmTagKey(0x0014, 0x5118) +#define DCM_WedgeFrontHeight DcmTagKey(0x0014, 0x5119) +#define DCM_WedgeRearHeight DcmTagKey(0x0014, 0x511a) +#define DCM_WedgeTotalWidth DcmTagKey(0x0014, 0x511b) +#define DCM_WedgeInContactWidth DcmTagKey(0x0014, 0x511c) +#define DCM_WedgeChamferHeight DcmTagKey(0x0014, 0x511d) +#define DCM_WedgeCurve DcmTagKey(0x0014, 0x511e) +#define DCM_RadiusAlongWedge DcmTagKey(0x0014, 0x511f) +#define DCM_WhitePoint DcmTagKey(0x0016, 0x0001) +#define DCM_PrimaryChromaticities DcmTagKey(0x0016, 0x0002) +#define DCM_BatteryLevel DcmTagKey(0x0016, 0x0003) +#define DCM_ExposureTimeInSeconds DcmTagKey(0x0016, 0x0004) +#define DCM_FNumber DcmTagKey(0x0016, 0x0005) +#define DCM_OECFRows DcmTagKey(0x0016, 0x0006) +#define DCM_OECFColumns DcmTagKey(0x0016, 0x0007) +#define DCM_OECFColumnNames DcmTagKey(0x0016, 0x0008) +#define DCM_OECFValues DcmTagKey(0x0016, 0x0009) +#define DCM_SpatialFrequencyResponseRows DcmTagKey(0x0016, 0x000a) +#define DCM_SpatialFrequencyResponseColumns DcmTagKey(0x0016, 0x000b) +#define DCM_SpatialFrequencyResponseColumnNames DcmTagKey(0x0016, 0x000c) +#define DCM_SpatialFrequencyResponseValues DcmTagKey(0x0016, 0x000d) +#define DCM_ColorFilterArrayPatternRows DcmTagKey(0x0016, 0x000e) +#define DCM_ColorFilterArrayPatternColumns DcmTagKey(0x0016, 0x000f) +#define DCM_ColorFilterArrayPatternValues DcmTagKey(0x0016, 0x0010) +#define DCM_FlashFiringStatus DcmTagKey(0x0016, 0x0011) +#define DCM_FlashReturnStatus DcmTagKey(0x0016, 0x0012) +#define DCM_FlashMode DcmTagKey(0x0016, 0x0013) +#define DCM_FlashFunctionPresent DcmTagKey(0x0016, 0x0014) +#define DCM_FlashRedEyeMode DcmTagKey(0x0016, 0x0015) +#define DCM_ExposureProgram DcmTagKey(0x0016, 0x0016) +#define DCM_SpectralSensitivity DcmTagKey(0x0016, 0x0017) +#define DCM_PhotographicSensitivity DcmTagKey(0x0016, 0x0018) +#define DCM_SelfTimerMode DcmTagKey(0x0016, 0x0019) +#define DCM_SensitivityType DcmTagKey(0x0016, 0x001a) +#define DCM_StandardOutputSensitivity DcmTagKey(0x0016, 0x001b) +#define DCM_RecommendedExposureIndex DcmTagKey(0x0016, 0x001c) +#define DCM_ISOSpeed DcmTagKey(0x0016, 0x001d) +#define DCM_ISOSpeedLatitudeyyy DcmTagKey(0x0016, 0x001e) +#define DCM_ISOSpeedLatitudezzz DcmTagKey(0x0016, 0x001f) +#define DCM_EXIFVersion DcmTagKey(0x0016, 0x0020) +#define DCM_ShutterSpeedValue DcmTagKey(0x0016, 0x0021) +#define DCM_ApertureValue DcmTagKey(0x0016, 0x0022) +#define DCM_BrightnessValue DcmTagKey(0x0016, 0x0023) +#define DCM_ExposureBiasValue DcmTagKey(0x0016, 0x0024) +#define DCM_MaxApertureValue DcmTagKey(0x0016, 0x0025) +#define DCM_SubjectDistance DcmTagKey(0x0016, 0x0026) +#define DCM_MeteringMode DcmTagKey(0x0016, 0x0027) +#define DCM_LightSource DcmTagKey(0x0016, 0x0028) +#define DCM_FocalLength DcmTagKey(0x0016, 0x0029) +#define DCM_SubjectArea DcmTagKey(0x0016, 0x002a) +#define DCM_MakerNote DcmTagKey(0x0016, 0x002b) +#define DCM_Temperature DcmTagKey(0x0016, 0x0030) +#define DCM_Humidity DcmTagKey(0x0016, 0x0031) +#define DCM_Pressure DcmTagKey(0x0016, 0x0032) +#define DCM_WaterDepth DcmTagKey(0x0016, 0x0033) +#define DCM_Acceleration DcmTagKey(0x0016, 0x0034) +#define DCM_CameraElevationAngle DcmTagKey(0x0016, 0x0035) +#define DCM_FlashEnergy DcmTagKey(0x0016, 0x0036) +#define DCM_SubjectLocation DcmTagKey(0x0016, 0x0037) +#define DCM_PhotographicExposureIndex DcmTagKey(0x0016, 0x0038) +#define DCM_SensingMethod DcmTagKey(0x0016, 0x0039) +#define DCM_FileSource DcmTagKey(0x0016, 0x003a) +#define DCM_SceneType DcmTagKey(0x0016, 0x003b) +#define DCM_CustomRendered DcmTagKey(0x0016, 0x0041) +#define DCM_ExposureMode DcmTagKey(0x0016, 0x0042) +#define DCM_WhiteBalance DcmTagKey(0x0016, 0x0043) +#define DCM_DigitalZoomRatio DcmTagKey(0x0016, 0x0044) +#define DCM_FocalLengthIn35mmFilm DcmTagKey(0x0016, 0x0045) +#define DCM_SceneCaptureType DcmTagKey(0x0016, 0x0046) +#define DCM_GainControl DcmTagKey(0x0016, 0x0047) +#define DCM_Contrast DcmTagKey(0x0016, 0x0048) +#define DCM_Saturation DcmTagKey(0x0016, 0x0049) +#define DCM_Sharpness DcmTagKey(0x0016, 0x004a) +#define DCM_DeviceSettingDescription DcmTagKey(0x0016, 0x004b) +#define DCM_SubjectDistanceRange DcmTagKey(0x0016, 0x004c) +#define DCM_CameraOwnerName DcmTagKey(0x0016, 0x004d) +#define DCM_LensSpecification DcmTagKey(0x0016, 0x004e) +#define DCM_LensMake DcmTagKey(0x0016, 0x004f) +#define DCM_LensModel DcmTagKey(0x0016, 0x0050) +#define DCM_LensSerialNumber DcmTagKey(0x0016, 0x0051) +#define DCM_InteroperabilityIndex DcmTagKey(0x0016, 0x0061) +#define DCM_InteroperabilityVersion DcmTagKey(0x0016, 0x0062) +#define DCM_GPSVersionID DcmTagKey(0x0016, 0x0070) +#define DCM_GPSLatitudeRef DcmTagKey(0x0016, 0x0071) +#define DCM_GPSLatitude DcmTagKey(0x0016, 0x0072) +#define DCM_GPSLongitudeRef DcmTagKey(0x0016, 0x0073) +#define DCM_GPSLongitude DcmTagKey(0x0016, 0x0074) +#define DCM_GPSAltitudeRef DcmTagKey(0x0016, 0x0075) +#define DCM_GPSAltitude DcmTagKey(0x0016, 0x0076) +#define DCM_GPSTimeStamp DcmTagKey(0x0016, 0x0077) +#define DCM_GPSSatellites DcmTagKey(0x0016, 0x0078) +#define DCM_GPSStatus DcmTagKey(0x0016, 0x0079) +#define DCM_GPSMeasureMode DcmTagKey(0x0016, 0x007a) +#define DCM_GPSDOP DcmTagKey(0x0016, 0x007b) +#define DCM_GPSSpeedRef DcmTagKey(0x0016, 0x007c) +#define DCM_GPSSpeed DcmTagKey(0x0016, 0x007d) +#define DCM_GPSTrackRef DcmTagKey(0x0016, 0x007e) +#define DCM_GPSTrack DcmTagKey(0x0016, 0x007f) +#define DCM_GPSImgDirectionRef DcmTagKey(0x0016, 0x0080) +#define DCM_GPSImgDirection DcmTagKey(0x0016, 0x0081) +#define DCM_GPSMapDatum DcmTagKey(0x0016, 0x0082) +#define DCM_GPSDestLatitudeRef DcmTagKey(0x0016, 0x0083) +#define DCM_GPSDestLatitude DcmTagKey(0x0016, 0x0084) +#define DCM_GPSDestLongitudeRef DcmTagKey(0x0016, 0x0085) +#define DCM_GPSDestLongitude DcmTagKey(0x0016, 0x0086) +#define DCM_GPSDestBearingRef DcmTagKey(0x0016, 0x0087) +#define DCM_GPSDestBearing DcmTagKey(0x0016, 0x0088) +#define DCM_GPSDestDistanceRef DcmTagKey(0x0016, 0x0089) +#define DCM_GPSDestDistance DcmTagKey(0x0016, 0x008a) +#define DCM_GPSProcessingMethod DcmTagKey(0x0016, 0x008b) +#define DCM_GPSAreaInformation DcmTagKey(0x0016, 0x008c) +#define DCM_GPSDateStamp DcmTagKey(0x0016, 0x008d) +#define DCM_GPSDifferential DcmTagKey(0x0016, 0x008e) +#define DCM_ContrastBolusAgent DcmTagKey(0x0018, 0x0010) +#define DCM_ContrastBolusAgentSequence DcmTagKey(0x0018, 0x0012) +#define DCM_ContrastBolusT1Relaxivity DcmTagKey(0x0018, 0x0013) +#define DCM_ContrastBolusAdministrationRouteSequence DcmTagKey(0x0018, 0x0014) +#define DCM_BodyPartExamined DcmTagKey(0x0018, 0x0015) +#define DCM_ScanningSequence DcmTagKey(0x0018, 0x0020) +#define DCM_SequenceVariant DcmTagKey(0x0018, 0x0021) +#define DCM_ScanOptions DcmTagKey(0x0018, 0x0022) +#define DCM_MRAcquisitionType DcmTagKey(0x0018, 0x0023) +#define DCM_SequenceName DcmTagKey(0x0018, 0x0024) +#define DCM_AngioFlag DcmTagKey(0x0018, 0x0025) +#define DCM_InterventionDrugInformationSequence DcmTagKey(0x0018, 0x0026) +#define DCM_InterventionDrugStopTime DcmTagKey(0x0018, 0x0027) +#define DCM_InterventionDrugDose DcmTagKey(0x0018, 0x0028) +#define DCM_InterventionDrugCodeSequence DcmTagKey(0x0018, 0x0029) +#define DCM_AdditionalDrugSequence DcmTagKey(0x0018, 0x002a) +#define DCM_RETIRED_Radionuclide DcmTagKey(0x0018, 0x0030) +#define DCM_Radiopharmaceutical DcmTagKey(0x0018, 0x0031) +#define DCM_RETIRED_EnergyWindowCenterline DcmTagKey(0x0018, 0x0032) +#define DCM_RETIRED_EnergyWindowTotalWidth DcmTagKey(0x0018, 0x0033) +#define DCM_InterventionDrugName DcmTagKey(0x0018, 0x0034) +#define DCM_InterventionDrugStartTime DcmTagKey(0x0018, 0x0035) +#define DCM_InterventionSequence DcmTagKey(0x0018, 0x0036) +#define DCM_RETIRED_TherapyType DcmTagKey(0x0018, 0x0037) +#define DCM_InterventionStatus DcmTagKey(0x0018, 0x0038) +#define DCM_RETIRED_TherapyDescription DcmTagKey(0x0018, 0x0039) +#define DCM_InterventionDescription DcmTagKey(0x0018, 0x003a) +#define DCM_CineRate DcmTagKey(0x0018, 0x0040) +#define DCM_InitialCineRunState DcmTagKey(0x0018, 0x0042) +#define DCM_SliceThickness DcmTagKey(0x0018, 0x0050) +#define DCM_KVP DcmTagKey(0x0018, 0x0060) +#define DCM_CountsAccumulated DcmTagKey(0x0018, 0x0070) +#define DCM_AcquisitionTerminationCondition DcmTagKey(0x0018, 0x0071) +#define DCM_EffectiveDuration DcmTagKey(0x0018, 0x0072) +#define DCM_AcquisitionStartCondition DcmTagKey(0x0018, 0x0073) +#define DCM_AcquisitionStartConditionData DcmTagKey(0x0018, 0x0074) +#define DCM_AcquisitionTerminationConditionData DcmTagKey(0x0018, 0x0075) +#define DCM_RepetitionTime DcmTagKey(0x0018, 0x0080) +#define DCM_EchoTime DcmTagKey(0x0018, 0x0081) +#define DCM_InversionTime DcmTagKey(0x0018, 0x0082) +#define DCM_NumberOfAverages DcmTagKey(0x0018, 0x0083) +#define DCM_ImagingFrequency DcmTagKey(0x0018, 0x0084) +#define DCM_ImagedNucleus DcmTagKey(0x0018, 0x0085) +#define DCM_EchoNumbers DcmTagKey(0x0018, 0x0086) +#define DCM_MagneticFieldStrength DcmTagKey(0x0018, 0x0087) +#define DCM_SpacingBetweenSlices DcmTagKey(0x0018, 0x0088) +#define DCM_NumberOfPhaseEncodingSteps DcmTagKey(0x0018, 0x0089) +#define DCM_DataCollectionDiameter DcmTagKey(0x0018, 0x0090) +#define DCM_EchoTrainLength DcmTagKey(0x0018, 0x0091) +#define DCM_PercentSampling DcmTagKey(0x0018, 0x0093) +#define DCM_PercentPhaseFieldOfView DcmTagKey(0x0018, 0x0094) +#define DCM_PixelBandwidth DcmTagKey(0x0018, 0x0095) +#define DCM_DeviceSerialNumber DcmTagKey(0x0018, 0x1000) +#define DCM_DeviceUID DcmTagKey(0x0018, 0x1002) +#define DCM_DeviceID DcmTagKey(0x0018, 0x1003) +#define DCM_PlateID DcmTagKey(0x0018, 0x1004) +#define DCM_GeneratorID DcmTagKey(0x0018, 0x1005) +#define DCM_GridID DcmTagKey(0x0018, 0x1006) +#define DCM_CassetteID DcmTagKey(0x0018, 0x1007) +#define DCM_GantryID DcmTagKey(0x0018, 0x1008) +#define DCM_UniqueDeviceIdentifier DcmTagKey(0x0018, 0x1009) +#define DCM_UDISequence DcmTagKey(0x0018, 0x100a) +#define DCM_ManufacturerDeviceClassUID DcmTagKey(0x0018, 0x100b) +#define DCM_SecondaryCaptureDeviceID DcmTagKey(0x0018, 0x1010) +#define DCM_RETIRED_HardcopyCreationDeviceID DcmTagKey(0x0018, 0x1011) +#define DCM_DateOfSecondaryCapture DcmTagKey(0x0018, 0x1012) +#define DCM_TimeOfSecondaryCapture DcmTagKey(0x0018, 0x1014) +#define DCM_SecondaryCaptureDeviceManufacturer DcmTagKey(0x0018, 0x1016) +#define DCM_RETIRED_HardcopyDeviceManufacturer DcmTagKey(0x0018, 0x1017) +#define DCM_SecondaryCaptureDeviceManufacturerModelName DcmTagKey(0x0018, 0x1018) +#define DCM_SecondaryCaptureDeviceSoftwareVersions DcmTagKey(0x0018, 0x1019) +#define DCM_RETIRED_HardcopyDeviceSoftwareVersion DcmTagKey(0x0018, 0x101a) +#define DCM_RETIRED_HardcopyDeviceManufacturerModelName DcmTagKey(0x0018, 0x101b) +#define DCM_SoftwareVersions DcmTagKey(0x0018, 0x1020) +#define DCM_VideoImageFormatAcquired DcmTagKey(0x0018, 0x1022) +#define DCM_DigitalImageFormatAcquired DcmTagKey(0x0018, 0x1023) +#define DCM_ProtocolName DcmTagKey(0x0018, 0x1030) +#define DCM_ContrastBolusRoute DcmTagKey(0x0018, 0x1040) +#define DCM_ContrastBolusVolume DcmTagKey(0x0018, 0x1041) +#define DCM_ContrastBolusStartTime DcmTagKey(0x0018, 0x1042) +#define DCM_ContrastBolusStopTime DcmTagKey(0x0018, 0x1043) +#define DCM_ContrastBolusTotalDose DcmTagKey(0x0018, 0x1044) +#define DCM_SyringeCounts DcmTagKey(0x0018, 0x1045) +#define DCM_ContrastFlowRate DcmTagKey(0x0018, 0x1046) +#define DCM_ContrastFlowDuration DcmTagKey(0x0018, 0x1047) +#define DCM_ContrastBolusIngredient DcmTagKey(0x0018, 0x1048) +#define DCM_ContrastBolusIngredientConcentration DcmTagKey(0x0018, 0x1049) +#define DCM_SpatialResolution DcmTagKey(0x0018, 0x1050) +#define DCM_TriggerTime DcmTagKey(0x0018, 0x1060) +#define DCM_TriggerSourceOrType DcmTagKey(0x0018, 0x1061) +#define DCM_NominalInterval DcmTagKey(0x0018, 0x1062) +#define DCM_FrameTime DcmTagKey(0x0018, 0x1063) +#define DCM_CardiacFramingType DcmTagKey(0x0018, 0x1064) +#define DCM_FrameTimeVector DcmTagKey(0x0018, 0x1065) +#define DCM_FrameDelay DcmTagKey(0x0018, 0x1066) +#define DCM_ImageTriggerDelay DcmTagKey(0x0018, 0x1067) +#define DCM_MultiplexGroupTimeOffset DcmTagKey(0x0018, 0x1068) +#define DCM_TriggerTimeOffset DcmTagKey(0x0018, 0x1069) +#define DCM_SynchronizationTrigger DcmTagKey(0x0018, 0x106a) +#define DCM_SynchronizationChannel DcmTagKey(0x0018, 0x106c) +#define DCM_TriggerSamplePosition DcmTagKey(0x0018, 0x106e) +#define DCM_RadiopharmaceuticalRoute DcmTagKey(0x0018, 0x1070) +#define DCM_RadiopharmaceuticalVolume DcmTagKey(0x0018, 0x1071) +#define DCM_RadiopharmaceuticalStartTime DcmTagKey(0x0018, 0x1072) +#define DCM_RadiopharmaceuticalStopTime DcmTagKey(0x0018, 0x1073) +#define DCM_RadionuclideTotalDose DcmTagKey(0x0018, 0x1074) +#define DCM_RadionuclideHalfLife DcmTagKey(0x0018, 0x1075) +#define DCM_RadionuclidePositronFraction DcmTagKey(0x0018, 0x1076) +#define DCM_RadiopharmaceuticalSpecificActivity DcmTagKey(0x0018, 0x1077) +#define DCM_RadiopharmaceuticalStartDateTime DcmTagKey(0x0018, 0x1078) +#define DCM_RadiopharmaceuticalStopDateTime DcmTagKey(0x0018, 0x1079) +#define DCM_BeatRejectionFlag DcmTagKey(0x0018, 0x1080) +#define DCM_LowRRValue DcmTagKey(0x0018, 0x1081) +#define DCM_HighRRValue DcmTagKey(0x0018, 0x1082) +#define DCM_IntervalsAcquired DcmTagKey(0x0018, 0x1083) +#define DCM_IntervalsRejected DcmTagKey(0x0018, 0x1084) +#define DCM_PVCRejection DcmTagKey(0x0018, 0x1085) +#define DCM_SkipBeats DcmTagKey(0x0018, 0x1086) +#define DCM_HeartRate DcmTagKey(0x0018, 0x1088) +#define DCM_CardiacNumberOfImages DcmTagKey(0x0018, 0x1090) +#define DCM_TriggerWindow DcmTagKey(0x0018, 0x1094) +#define DCM_ReconstructionDiameter DcmTagKey(0x0018, 0x1100) +#define DCM_DistanceSourceToDetector DcmTagKey(0x0018, 0x1110) +#define DCM_DistanceSourceToPatient DcmTagKey(0x0018, 0x1111) +#define DCM_EstimatedRadiographicMagnificationFactor DcmTagKey(0x0018, 0x1114) +#define DCM_GantryDetectorTilt DcmTagKey(0x0018, 0x1120) +#define DCM_GantryDetectorSlew DcmTagKey(0x0018, 0x1121) +#define DCM_TableHeight DcmTagKey(0x0018, 0x1130) +#define DCM_TableTraverse DcmTagKey(0x0018, 0x1131) +#define DCM_TableMotion DcmTagKey(0x0018, 0x1134) +#define DCM_TableVerticalIncrement DcmTagKey(0x0018, 0x1135) +#define DCM_TableLateralIncrement DcmTagKey(0x0018, 0x1136) +#define DCM_TableLongitudinalIncrement DcmTagKey(0x0018, 0x1137) +#define DCM_TableAngle DcmTagKey(0x0018, 0x1138) +#define DCM_TableType DcmTagKey(0x0018, 0x113a) +#define DCM_RotationDirection DcmTagKey(0x0018, 0x1140) +#define DCM_RETIRED_AngularPosition DcmTagKey(0x0018, 0x1141) +#define DCM_RadialPosition DcmTagKey(0x0018, 0x1142) +#define DCM_ScanArc DcmTagKey(0x0018, 0x1143) +#define DCM_AngularStep DcmTagKey(0x0018, 0x1144) +#define DCM_CenterOfRotationOffset DcmTagKey(0x0018, 0x1145) +#define DCM_RETIRED_RotationOffset DcmTagKey(0x0018, 0x1146) +#define DCM_FieldOfViewShape DcmTagKey(0x0018, 0x1147) +#define DCM_FieldOfViewDimensions DcmTagKey(0x0018, 0x1149) +#define DCM_ExposureTime DcmTagKey(0x0018, 0x1150) +#define DCM_XRayTubeCurrent DcmTagKey(0x0018, 0x1151) +#define DCM_Exposure DcmTagKey(0x0018, 0x1152) +#define DCM_ExposureInuAs DcmTagKey(0x0018, 0x1153) +#define DCM_AveragePulseWidth DcmTagKey(0x0018, 0x1154) +#define DCM_RadiationSetting DcmTagKey(0x0018, 0x1155) +#define DCM_RectificationType DcmTagKey(0x0018, 0x1156) +#define DCM_RadiationMode DcmTagKey(0x0018, 0x115a) +#define DCM_ImageAndFluoroscopyAreaDoseProduct DcmTagKey(0x0018, 0x115e) +#define DCM_FilterType DcmTagKey(0x0018, 0x1160) +#define DCM_TypeOfFilters DcmTagKey(0x0018, 0x1161) +#define DCM_IntensifierSize DcmTagKey(0x0018, 0x1162) +#define DCM_ImagerPixelSpacing DcmTagKey(0x0018, 0x1164) +#define DCM_Grid DcmTagKey(0x0018, 0x1166) +#define DCM_GeneratorPower DcmTagKey(0x0018, 0x1170) +#define DCM_CollimatorGridName DcmTagKey(0x0018, 0x1180) +#define DCM_CollimatorType DcmTagKey(0x0018, 0x1181) +#define DCM_FocalDistance DcmTagKey(0x0018, 0x1182) +#define DCM_XFocusCenter DcmTagKey(0x0018, 0x1183) +#define DCM_YFocusCenter DcmTagKey(0x0018, 0x1184) +#define DCM_FocalSpots DcmTagKey(0x0018, 0x1190) +#define DCM_AnodeTargetMaterial DcmTagKey(0x0018, 0x1191) +#define DCM_BodyPartThickness DcmTagKey(0x0018, 0x11a0) +#define DCM_CompressionForce DcmTagKey(0x0018, 0x11a2) +#define DCM_CompressionPressure DcmTagKey(0x0018, 0x11a3) +#define DCM_PaddleDescription DcmTagKey(0x0018, 0x11a4) +#define DCM_CompressionContactArea DcmTagKey(0x0018, 0x11a5) +#define DCM_DateOfLastCalibration DcmTagKey(0x0018, 0x1200) +#define DCM_TimeOfLastCalibration DcmTagKey(0x0018, 0x1201) +#define DCM_DateTimeOfLastCalibration DcmTagKey(0x0018, 0x1202) +#define DCM_ConvolutionKernel DcmTagKey(0x0018, 0x1210) +#define DCM_RETIRED_UpperLowerPixelValues DcmTagKey(0x0018, 0x1240) +#define DCM_ActualFrameDuration DcmTagKey(0x0018, 0x1242) +#define DCM_CountRate DcmTagKey(0x0018, 0x1243) +#define DCM_PreferredPlaybackSequencing DcmTagKey(0x0018, 0x1244) +#define DCM_ReceiveCoilName DcmTagKey(0x0018, 0x1250) +#define DCM_TransmitCoilName DcmTagKey(0x0018, 0x1251) +#define DCM_PlateType DcmTagKey(0x0018, 0x1260) +#define DCM_PhosphorType DcmTagKey(0x0018, 0x1261) +#define DCM_WaterEquivalentDiameter DcmTagKey(0x0018, 0x1271) +#define DCM_WaterEquivalentDiameterCalculationMethodCodeSequence DcmTagKey(0x0018, 0x1272) +#define DCM_ScanVelocity DcmTagKey(0x0018, 0x1300) +#define DCM_WholeBodyTechnique DcmTagKey(0x0018, 0x1301) +#define DCM_ScanLength DcmTagKey(0x0018, 0x1302) +#define DCM_AcquisitionMatrix DcmTagKey(0x0018, 0x1310) +#define DCM_InPlanePhaseEncodingDirection DcmTagKey(0x0018, 0x1312) +#define DCM_FlipAngle DcmTagKey(0x0018, 0x1314) +#define DCM_VariableFlipAngleFlag DcmTagKey(0x0018, 0x1315) +#define DCM_SAR DcmTagKey(0x0018, 0x1316) +#define DCM_dBdt DcmTagKey(0x0018, 0x1318) +#define DCM_B1rms DcmTagKey(0x0018, 0x1320) +#define DCM_AcquisitionDeviceProcessingDescription DcmTagKey(0x0018, 0x1400) +#define DCM_AcquisitionDeviceProcessingCode DcmTagKey(0x0018, 0x1401) +#define DCM_CassetteOrientation DcmTagKey(0x0018, 0x1402) +#define DCM_CassetteSize DcmTagKey(0x0018, 0x1403) +#define DCM_ExposuresOnPlate DcmTagKey(0x0018, 0x1404) +#define DCM_RelativeXRayExposure DcmTagKey(0x0018, 0x1405) +#define DCM_ExposureIndex DcmTagKey(0x0018, 0x1411) +#define DCM_TargetExposureIndex DcmTagKey(0x0018, 0x1412) +#define DCM_DeviationIndex DcmTagKey(0x0018, 0x1413) +#define DCM_ColumnAngulation DcmTagKey(0x0018, 0x1450) +#define DCM_TomoLayerHeight DcmTagKey(0x0018, 0x1460) +#define DCM_TomoAngle DcmTagKey(0x0018, 0x1470) +#define DCM_TomoTime DcmTagKey(0x0018, 0x1480) +#define DCM_TomoType DcmTagKey(0x0018, 0x1490) +#define DCM_TomoClass DcmTagKey(0x0018, 0x1491) +#define DCM_NumberOfTomosynthesisSourceImages DcmTagKey(0x0018, 0x1495) +#define DCM_PositionerMotion DcmTagKey(0x0018, 0x1500) +#define DCM_PositionerType DcmTagKey(0x0018, 0x1508) +#define DCM_PositionerPrimaryAngle DcmTagKey(0x0018, 0x1510) +#define DCM_PositionerSecondaryAngle DcmTagKey(0x0018, 0x1511) +#define DCM_PositionerPrimaryAngleIncrement DcmTagKey(0x0018, 0x1520) +#define DCM_PositionerSecondaryAngleIncrement DcmTagKey(0x0018, 0x1521) +#define DCM_DetectorPrimaryAngle DcmTagKey(0x0018, 0x1530) +#define DCM_DetectorSecondaryAngle DcmTagKey(0x0018, 0x1531) +#define DCM_ShutterShape DcmTagKey(0x0018, 0x1600) +#define DCM_ShutterLeftVerticalEdge DcmTagKey(0x0018, 0x1602) +#define DCM_ShutterRightVerticalEdge DcmTagKey(0x0018, 0x1604) +#define DCM_ShutterUpperHorizontalEdge DcmTagKey(0x0018, 0x1606) +#define DCM_ShutterLowerHorizontalEdge DcmTagKey(0x0018, 0x1608) +#define DCM_CenterOfCircularShutter DcmTagKey(0x0018, 0x1610) +#define DCM_RadiusOfCircularShutter DcmTagKey(0x0018, 0x1612) +#define DCM_VerticesOfThePolygonalShutter DcmTagKey(0x0018, 0x1620) +#define DCM_ShutterPresentationValue DcmTagKey(0x0018, 0x1622) +#define DCM_ShutterOverlayGroup DcmTagKey(0x0018, 0x1623) +#define DCM_ShutterPresentationColorCIELabValue DcmTagKey(0x0018, 0x1624) +#define DCM_OutlineShapeType DcmTagKey(0x0018, 0x1630) +#define DCM_OutlineLeftVerticalEdge DcmTagKey(0x0018, 0x1631) +#define DCM_OutlineRightVerticalEdge DcmTagKey(0x0018, 0x1632) +#define DCM_OutlineUpperHorizontalEdge DcmTagKey(0x0018, 0x1633) +#define DCM_OutlineLowerHorizontalEdge DcmTagKey(0x0018, 0x1634) +#define DCM_CenterOfCircularOutline DcmTagKey(0x0018, 0x1635) +#define DCM_DiameterOfCircularOutline DcmTagKey(0x0018, 0x1636) +#define DCM_NumberOfPolygonalVertices DcmTagKey(0x0018, 0x1637) +#define DCM_VerticesOfThePolygonalOutline DcmTagKey(0x0018, 0x1638) +#define DCM_CollimatorShape DcmTagKey(0x0018, 0x1700) +#define DCM_CollimatorLeftVerticalEdge DcmTagKey(0x0018, 0x1702) +#define DCM_CollimatorRightVerticalEdge DcmTagKey(0x0018, 0x1704) +#define DCM_CollimatorUpperHorizontalEdge DcmTagKey(0x0018, 0x1706) +#define DCM_CollimatorLowerHorizontalEdge DcmTagKey(0x0018, 0x1708) +#define DCM_CenterOfCircularCollimator DcmTagKey(0x0018, 0x1710) +#define DCM_RadiusOfCircularCollimator DcmTagKey(0x0018, 0x1712) +#define DCM_VerticesOfThePolygonalCollimator DcmTagKey(0x0018, 0x1720) +#define DCM_AcquisitionTimeSynchronized DcmTagKey(0x0018, 0x1800) +#define DCM_TimeSource DcmTagKey(0x0018, 0x1801) +#define DCM_TimeDistributionProtocol DcmTagKey(0x0018, 0x1802) +#define DCM_NTPSourceAddress DcmTagKey(0x0018, 0x1803) +#define DCM_PageNumberVector DcmTagKey(0x0018, 0x2001) +#define DCM_FrameLabelVector DcmTagKey(0x0018, 0x2002) +#define DCM_FramePrimaryAngleVector DcmTagKey(0x0018, 0x2003) +#define DCM_FrameSecondaryAngleVector DcmTagKey(0x0018, 0x2004) +#define DCM_SliceLocationVector DcmTagKey(0x0018, 0x2005) +#define DCM_DisplayWindowLabelVector DcmTagKey(0x0018, 0x2006) +#define DCM_NominalScannedPixelSpacing DcmTagKey(0x0018, 0x2010) +#define DCM_DigitizingDeviceTransportDirection DcmTagKey(0x0018, 0x2020) +#define DCM_RotationOfScannedFilm DcmTagKey(0x0018, 0x2030) +#define DCM_BiopsyTargetSequence DcmTagKey(0x0018, 0x2041) +#define DCM_TargetUID DcmTagKey(0x0018, 0x2042) +#define DCM_LocalizingCursorPosition DcmTagKey(0x0018, 0x2043) +#define DCM_CalculatedTargetPosition DcmTagKey(0x0018, 0x2044) +#define DCM_TargetLabel DcmTagKey(0x0018, 0x2045) +#define DCM_DisplayedZValue DcmTagKey(0x0018, 0x2046) +#define DCM_IVUSAcquisition DcmTagKey(0x0018, 0x3100) +#define DCM_IVUSPullbackRate DcmTagKey(0x0018, 0x3101) +#define DCM_IVUSGatedRate DcmTagKey(0x0018, 0x3102) +#define DCM_IVUSPullbackStartFrameNumber DcmTagKey(0x0018, 0x3103) +#define DCM_IVUSPullbackStopFrameNumber DcmTagKey(0x0018, 0x3104) +#define DCM_LesionNumber DcmTagKey(0x0018, 0x3105) +#define DCM_RETIRED_AcquisitionComments DcmTagKey(0x0018, 0x4000) +#define DCM_OutputPower DcmTagKey(0x0018, 0x5000) +#define DCM_TransducerData DcmTagKey(0x0018, 0x5010) +#define DCM_FocusDepth DcmTagKey(0x0018, 0x5012) +#define DCM_ProcessingFunction DcmTagKey(0x0018, 0x5020) +#define DCM_RETIRED_PostprocessingFunction DcmTagKey(0x0018, 0x5021) +#define DCM_MechanicalIndex DcmTagKey(0x0018, 0x5022) +#define DCM_BoneThermalIndex DcmTagKey(0x0018, 0x5024) +#define DCM_CranialThermalIndex DcmTagKey(0x0018, 0x5026) +#define DCM_SoftTissueThermalIndex DcmTagKey(0x0018, 0x5027) +#define DCM_SoftTissueFocusThermalIndex DcmTagKey(0x0018, 0x5028) +#define DCM_SoftTissueSurfaceThermalIndex DcmTagKey(0x0018, 0x5029) +#define DCM_RETIRED_DynamicRange DcmTagKey(0x0018, 0x5030) +#define DCM_RETIRED_TotalGain DcmTagKey(0x0018, 0x5040) +#define DCM_DepthOfScanField DcmTagKey(0x0018, 0x5050) +#define DCM_PatientPosition DcmTagKey(0x0018, 0x5100) +#define DCM_ViewPosition DcmTagKey(0x0018, 0x5101) +#define DCM_ProjectionEponymousNameCodeSequence DcmTagKey(0x0018, 0x5104) +#define DCM_RETIRED_ImageTransformationMatrix DcmTagKey(0x0018, 0x5210) +#define DCM_RETIRED_ImageTranslationVector DcmTagKey(0x0018, 0x5212) +#define DCM_Sensitivity DcmTagKey(0x0018, 0x6000) +#define DCM_SequenceOfUltrasoundRegions DcmTagKey(0x0018, 0x6011) +#define DCM_RegionSpatialFormat DcmTagKey(0x0018, 0x6012) +#define DCM_RegionDataType DcmTagKey(0x0018, 0x6014) +#define DCM_RegionFlags DcmTagKey(0x0018, 0x6016) +#define DCM_RegionLocationMinX0 DcmTagKey(0x0018, 0x6018) +#define DCM_RegionLocationMinY0 DcmTagKey(0x0018, 0x601a) +#define DCM_RegionLocationMaxX1 DcmTagKey(0x0018, 0x601c) +#define DCM_RegionLocationMaxY1 DcmTagKey(0x0018, 0x601e) +#define DCM_ReferencePixelX0 DcmTagKey(0x0018, 0x6020) +#define DCM_ReferencePixelY0 DcmTagKey(0x0018, 0x6022) +#define DCM_PhysicalUnitsXDirection DcmTagKey(0x0018, 0x6024) +#define DCM_PhysicalUnitsYDirection DcmTagKey(0x0018, 0x6026) +#define DCM_ReferencePixelPhysicalValueX DcmTagKey(0x0018, 0x6028) +#define DCM_ReferencePixelPhysicalValueY DcmTagKey(0x0018, 0x602a) +#define DCM_PhysicalDeltaX DcmTagKey(0x0018, 0x602c) +#define DCM_PhysicalDeltaY DcmTagKey(0x0018, 0x602e) +#define DCM_TransducerFrequency DcmTagKey(0x0018, 0x6030) +#define DCM_TransducerType DcmTagKey(0x0018, 0x6031) +#define DCM_PulseRepetitionFrequency DcmTagKey(0x0018, 0x6032) +#define DCM_DopplerCorrectionAngle DcmTagKey(0x0018, 0x6034) +#define DCM_SteeringAngle DcmTagKey(0x0018, 0x6036) +#define DCM_RETIRED_DopplerSampleVolumeXPositionRetired DcmTagKey(0x0018, 0x6038) +#define DCM_DopplerSampleVolumeXPosition DcmTagKey(0x0018, 0x6039) +#define DCM_RETIRED_DopplerSampleVolumeYPositionRetired DcmTagKey(0x0018, 0x603a) +#define DCM_DopplerSampleVolumeYPosition DcmTagKey(0x0018, 0x603b) +#define DCM_RETIRED_TMLinePositionX0Retired DcmTagKey(0x0018, 0x603c) +#define DCM_TMLinePositionX0 DcmTagKey(0x0018, 0x603d) +#define DCM_RETIRED_TMLinePositionY0Retired DcmTagKey(0x0018, 0x603e) +#define DCM_TMLinePositionY0 DcmTagKey(0x0018, 0x603f) +#define DCM_RETIRED_TMLinePositionX1Retired DcmTagKey(0x0018, 0x6040) +#define DCM_TMLinePositionX1 DcmTagKey(0x0018, 0x6041) +#define DCM_RETIRED_TMLinePositionY1Retired DcmTagKey(0x0018, 0x6042) +#define DCM_TMLinePositionY1 DcmTagKey(0x0018, 0x6043) +#define DCM_PixelComponentOrganization DcmTagKey(0x0018, 0x6044) +#define DCM_PixelComponentMask DcmTagKey(0x0018, 0x6046) +#define DCM_PixelComponentRangeStart DcmTagKey(0x0018, 0x6048) +#define DCM_PixelComponentRangeStop DcmTagKey(0x0018, 0x604a) +#define DCM_PixelComponentPhysicalUnits DcmTagKey(0x0018, 0x604c) +#define DCM_PixelComponentDataType DcmTagKey(0x0018, 0x604e) +#define DCM_NumberOfTableBreakPoints DcmTagKey(0x0018, 0x6050) +#define DCM_TableOfXBreakPoints DcmTagKey(0x0018, 0x6052) +#define DCM_TableOfYBreakPoints DcmTagKey(0x0018, 0x6054) +#define DCM_NumberOfTableEntries DcmTagKey(0x0018, 0x6056) +#define DCM_TableOfPixelValues DcmTagKey(0x0018, 0x6058) +#define DCM_TableOfParameterValues DcmTagKey(0x0018, 0x605a) +#define DCM_RWaveTimeVector DcmTagKey(0x0018, 0x6060) +#define DCM_DetectorConditionsNominalFlag DcmTagKey(0x0018, 0x7000) +#define DCM_DetectorTemperature DcmTagKey(0x0018, 0x7001) +#define DCM_DetectorType DcmTagKey(0x0018, 0x7004) +#define DCM_DetectorConfiguration DcmTagKey(0x0018, 0x7005) +#define DCM_DetectorDescription DcmTagKey(0x0018, 0x7006) +#define DCM_DetectorMode DcmTagKey(0x0018, 0x7008) +#define DCM_DetectorID DcmTagKey(0x0018, 0x700a) +#define DCM_DateOfLastDetectorCalibration DcmTagKey(0x0018, 0x700c) +#define DCM_TimeOfLastDetectorCalibration DcmTagKey(0x0018, 0x700e) +#define DCM_ExposuresOnDetectorSinceLastCalibration DcmTagKey(0x0018, 0x7010) +#define DCM_ExposuresOnDetectorSinceManufactured DcmTagKey(0x0018, 0x7011) +#define DCM_DetectorTimeSinceLastExposure DcmTagKey(0x0018, 0x7012) +#define DCM_DetectorActiveTime DcmTagKey(0x0018, 0x7014) +#define DCM_DetectorActivationOffsetFromExposure DcmTagKey(0x0018, 0x7016) +#define DCM_DetectorBinning DcmTagKey(0x0018, 0x701a) +#define DCM_DetectorElementPhysicalSize DcmTagKey(0x0018, 0x7020) +#define DCM_DetectorElementSpacing DcmTagKey(0x0018, 0x7022) +#define DCM_DetectorActiveShape DcmTagKey(0x0018, 0x7024) +#define DCM_DetectorActiveDimensions DcmTagKey(0x0018, 0x7026) +#define DCM_DetectorActiveOrigin DcmTagKey(0x0018, 0x7028) +#define DCM_DetectorManufacturerName DcmTagKey(0x0018, 0x702a) +#define DCM_DetectorManufacturerModelName DcmTagKey(0x0018, 0x702b) +#define DCM_FieldOfViewOrigin DcmTagKey(0x0018, 0x7030) +#define DCM_FieldOfViewRotation DcmTagKey(0x0018, 0x7032) +#define DCM_FieldOfViewHorizontalFlip DcmTagKey(0x0018, 0x7034) +#define DCM_PixelDataAreaOriginRelativeToFOV DcmTagKey(0x0018, 0x7036) +#define DCM_PixelDataAreaRotationAngleRelativeToFOV DcmTagKey(0x0018, 0x7038) +#define DCM_GridAbsorbingMaterial DcmTagKey(0x0018, 0x7040) +#define DCM_GridSpacingMaterial DcmTagKey(0x0018, 0x7041) +#define DCM_GridThickness DcmTagKey(0x0018, 0x7042) +#define DCM_GridPitch DcmTagKey(0x0018, 0x7044) +#define DCM_GridAspectRatio DcmTagKey(0x0018, 0x7046) +#define DCM_GridPeriod DcmTagKey(0x0018, 0x7048) +#define DCM_GridFocalDistance DcmTagKey(0x0018, 0x704c) +#define DCM_FilterMaterial DcmTagKey(0x0018, 0x7050) +#define DCM_FilterThicknessMinimum DcmTagKey(0x0018, 0x7052) +#define DCM_FilterThicknessMaximum DcmTagKey(0x0018, 0x7054) +#define DCM_FilterBeamPathLengthMinimum DcmTagKey(0x0018, 0x7056) +#define DCM_FilterBeamPathLengthMaximum DcmTagKey(0x0018, 0x7058) +#define DCM_ExposureControlMode DcmTagKey(0x0018, 0x7060) +#define DCM_ExposureControlModeDescription DcmTagKey(0x0018, 0x7062) +#define DCM_ExposureStatus DcmTagKey(0x0018, 0x7064) +#define DCM_PhototimerSetting DcmTagKey(0x0018, 0x7065) +#define DCM_ExposureTimeInuS DcmTagKey(0x0018, 0x8150) +#define DCM_XRayTubeCurrentInuA DcmTagKey(0x0018, 0x8151) +#define DCM_ContentQualification DcmTagKey(0x0018, 0x9004) +#define DCM_PulseSequenceName DcmTagKey(0x0018, 0x9005) +#define DCM_MRImagingModifierSequence DcmTagKey(0x0018, 0x9006) +#define DCM_EchoPulseSequence DcmTagKey(0x0018, 0x9008) +#define DCM_InversionRecovery DcmTagKey(0x0018, 0x9009) +#define DCM_FlowCompensation DcmTagKey(0x0018, 0x9010) +#define DCM_MultipleSpinEcho DcmTagKey(0x0018, 0x9011) +#define DCM_MultiPlanarExcitation DcmTagKey(0x0018, 0x9012) +#define DCM_PhaseContrast DcmTagKey(0x0018, 0x9014) +#define DCM_TimeOfFlightContrast DcmTagKey(0x0018, 0x9015) +#define DCM_Spoiling DcmTagKey(0x0018, 0x9016) +#define DCM_SteadyStatePulseSequence DcmTagKey(0x0018, 0x9017) +#define DCM_EchoPlanarPulseSequence DcmTagKey(0x0018, 0x9018) +#define DCM_TagAngleFirstAxis DcmTagKey(0x0018, 0x9019) +#define DCM_MagnetizationTransfer DcmTagKey(0x0018, 0x9020) +#define DCM_T2Preparation DcmTagKey(0x0018, 0x9021) +#define DCM_BloodSignalNulling DcmTagKey(0x0018, 0x9022) +#define DCM_SaturationRecovery DcmTagKey(0x0018, 0x9024) +#define DCM_SpectrallySelectedSuppression DcmTagKey(0x0018, 0x9025) +#define DCM_SpectrallySelectedExcitation DcmTagKey(0x0018, 0x9026) +#define DCM_SpatialPresaturation DcmTagKey(0x0018, 0x9027) +#define DCM_Tagging DcmTagKey(0x0018, 0x9028) +#define DCM_OversamplingPhase DcmTagKey(0x0018, 0x9029) +#define DCM_TagSpacingFirstDimension DcmTagKey(0x0018, 0x9030) +#define DCM_GeometryOfKSpaceTraversal DcmTagKey(0x0018, 0x9032) +#define DCM_SegmentedKSpaceTraversal DcmTagKey(0x0018, 0x9033) +#define DCM_RectilinearPhaseEncodeReordering DcmTagKey(0x0018, 0x9034) +#define DCM_TagThickness DcmTagKey(0x0018, 0x9035) +#define DCM_PartialFourierDirection DcmTagKey(0x0018, 0x9036) +#define DCM_CardiacSynchronizationTechnique DcmTagKey(0x0018, 0x9037) +#define DCM_ReceiveCoilManufacturerName DcmTagKey(0x0018, 0x9041) +#define DCM_MRReceiveCoilSequence DcmTagKey(0x0018, 0x9042) +#define DCM_ReceiveCoilType DcmTagKey(0x0018, 0x9043) +#define DCM_QuadratureReceiveCoil DcmTagKey(0x0018, 0x9044) +#define DCM_MultiCoilDefinitionSequence DcmTagKey(0x0018, 0x9045) +#define DCM_MultiCoilConfiguration DcmTagKey(0x0018, 0x9046) +#define DCM_MultiCoilElementName DcmTagKey(0x0018, 0x9047) +#define DCM_MultiCoilElementUsed DcmTagKey(0x0018, 0x9048) +#define DCM_MRTransmitCoilSequence DcmTagKey(0x0018, 0x9049) +#define DCM_TransmitCoilManufacturerName DcmTagKey(0x0018, 0x9050) +#define DCM_TransmitCoilType DcmTagKey(0x0018, 0x9051) +#define DCM_SpectralWidth DcmTagKey(0x0018, 0x9052) +#define DCM_ChemicalShiftReference DcmTagKey(0x0018, 0x9053) +#define DCM_VolumeLocalizationTechnique DcmTagKey(0x0018, 0x9054) +#define DCM_MRAcquisitionFrequencyEncodingSteps DcmTagKey(0x0018, 0x9058) +#define DCM_Decoupling DcmTagKey(0x0018, 0x9059) +#define DCM_DecoupledNucleus DcmTagKey(0x0018, 0x9060) +#define DCM_DecouplingFrequency DcmTagKey(0x0018, 0x9061) +#define DCM_DecouplingMethod DcmTagKey(0x0018, 0x9062) +#define DCM_DecouplingChemicalShiftReference DcmTagKey(0x0018, 0x9063) +#define DCM_KSpaceFiltering DcmTagKey(0x0018, 0x9064) +#define DCM_TimeDomainFiltering DcmTagKey(0x0018, 0x9065) +#define DCM_NumberOfZeroFills DcmTagKey(0x0018, 0x9066) +#define DCM_BaselineCorrection DcmTagKey(0x0018, 0x9067) +#define DCM_ParallelReductionFactorInPlane DcmTagKey(0x0018, 0x9069) +#define DCM_CardiacRRIntervalSpecified DcmTagKey(0x0018, 0x9070) +#define DCM_AcquisitionDuration DcmTagKey(0x0018, 0x9073) +#define DCM_FrameAcquisitionDateTime DcmTagKey(0x0018, 0x9074) +#define DCM_DiffusionDirectionality DcmTagKey(0x0018, 0x9075) +#define DCM_DiffusionGradientDirectionSequence DcmTagKey(0x0018, 0x9076) +#define DCM_ParallelAcquisition DcmTagKey(0x0018, 0x9077) +#define DCM_ParallelAcquisitionTechnique DcmTagKey(0x0018, 0x9078) +#define DCM_InversionTimes DcmTagKey(0x0018, 0x9079) +#define DCM_MetaboliteMapDescription DcmTagKey(0x0018, 0x9080) +#define DCM_PartialFourier DcmTagKey(0x0018, 0x9081) +#define DCM_EffectiveEchoTime DcmTagKey(0x0018, 0x9082) +#define DCM_MetaboliteMapCodeSequence DcmTagKey(0x0018, 0x9083) +#define DCM_ChemicalShiftSequence DcmTagKey(0x0018, 0x9084) +#define DCM_CardiacSignalSource DcmTagKey(0x0018, 0x9085) +#define DCM_DiffusionBValue DcmTagKey(0x0018, 0x9087) +#define DCM_DiffusionGradientOrientation DcmTagKey(0x0018, 0x9089) +#define DCM_VelocityEncodingDirection DcmTagKey(0x0018, 0x9090) +#define DCM_VelocityEncodingMinimumValue DcmTagKey(0x0018, 0x9091) +#define DCM_VelocityEncodingAcquisitionSequence DcmTagKey(0x0018, 0x9092) +#define DCM_NumberOfKSpaceTrajectories DcmTagKey(0x0018, 0x9093) +#define DCM_CoverageOfKSpace DcmTagKey(0x0018, 0x9094) +#define DCM_SpectroscopyAcquisitionPhaseRows DcmTagKey(0x0018, 0x9095) +#define DCM_RETIRED_ParallelReductionFactorInPlaneRetired DcmTagKey(0x0018, 0x9096) +#define DCM_TransmitterFrequency DcmTagKey(0x0018, 0x9098) +#define DCM_ResonantNucleus DcmTagKey(0x0018, 0x9100) +#define DCM_FrequencyCorrection DcmTagKey(0x0018, 0x9101) +#define DCM_MRSpectroscopyFOVGeometrySequence DcmTagKey(0x0018, 0x9103) +#define DCM_SlabThickness DcmTagKey(0x0018, 0x9104) +#define DCM_SlabOrientation DcmTagKey(0x0018, 0x9105) +#define DCM_MidSlabPosition DcmTagKey(0x0018, 0x9106) +#define DCM_MRSpatialSaturationSequence DcmTagKey(0x0018, 0x9107) +#define DCM_MRTimingAndRelatedParametersSequence DcmTagKey(0x0018, 0x9112) +#define DCM_MREchoSequence DcmTagKey(0x0018, 0x9114) +#define DCM_MRModifierSequence DcmTagKey(0x0018, 0x9115) +#define DCM_MRDiffusionSequence DcmTagKey(0x0018, 0x9117) +#define DCM_CardiacSynchronizationSequence DcmTagKey(0x0018, 0x9118) +#define DCM_MRAveragesSequence DcmTagKey(0x0018, 0x9119) +#define DCM_MRFOVGeometrySequence DcmTagKey(0x0018, 0x9125) +#define DCM_VolumeLocalizationSequence DcmTagKey(0x0018, 0x9126) +#define DCM_SpectroscopyAcquisitionDataColumns DcmTagKey(0x0018, 0x9127) +#define DCM_DiffusionAnisotropyType DcmTagKey(0x0018, 0x9147) +#define DCM_FrameReferenceDateTime DcmTagKey(0x0018, 0x9151) +#define DCM_MRMetaboliteMapSequence DcmTagKey(0x0018, 0x9152) +#define DCM_ParallelReductionFactorOutOfPlane DcmTagKey(0x0018, 0x9155) +#define DCM_SpectroscopyAcquisitionOutOfPlanePhaseSteps DcmTagKey(0x0018, 0x9159) +#define DCM_RETIRED_BulkMotionStatus DcmTagKey(0x0018, 0x9166) +#define DCM_ParallelReductionFactorSecondInPlane DcmTagKey(0x0018, 0x9168) +#define DCM_CardiacBeatRejectionTechnique DcmTagKey(0x0018, 0x9169) +#define DCM_RespiratoryMotionCompensationTechnique DcmTagKey(0x0018, 0x9170) +#define DCM_RespiratorySignalSource DcmTagKey(0x0018, 0x9171) +#define DCM_BulkMotionCompensationTechnique DcmTagKey(0x0018, 0x9172) +#define DCM_BulkMotionSignalSource DcmTagKey(0x0018, 0x9173) +#define DCM_ApplicableSafetyStandardAgency DcmTagKey(0x0018, 0x9174) +#define DCM_ApplicableSafetyStandardDescription DcmTagKey(0x0018, 0x9175) +#define DCM_OperatingModeSequence DcmTagKey(0x0018, 0x9176) +#define DCM_OperatingModeType DcmTagKey(0x0018, 0x9177) +#define DCM_OperatingMode DcmTagKey(0x0018, 0x9178) +#define DCM_SpecificAbsorptionRateDefinition DcmTagKey(0x0018, 0x9179) +#define DCM_GradientOutputType DcmTagKey(0x0018, 0x9180) +#define DCM_SpecificAbsorptionRateValue DcmTagKey(0x0018, 0x9181) +#define DCM_GradientOutput DcmTagKey(0x0018, 0x9182) +#define DCM_FlowCompensationDirection DcmTagKey(0x0018, 0x9183) +#define DCM_TaggingDelay DcmTagKey(0x0018, 0x9184) +#define DCM_RespiratoryMotionCompensationTechniqueDescription DcmTagKey(0x0018, 0x9185) +#define DCM_RespiratorySignalSourceID DcmTagKey(0x0018, 0x9186) +#define DCM_RETIRED_ChemicalShiftMinimumIntegrationLimitInHz DcmTagKey(0x0018, 0x9195) +#define DCM_RETIRED_ChemicalShiftMaximumIntegrationLimitInHz DcmTagKey(0x0018, 0x9196) +#define DCM_MRVelocityEncodingSequence DcmTagKey(0x0018, 0x9197) +#define DCM_FirstOrderPhaseCorrection DcmTagKey(0x0018, 0x9198) +#define DCM_WaterReferencedPhaseCorrection DcmTagKey(0x0018, 0x9199) +#define DCM_MRSpectroscopyAcquisitionType DcmTagKey(0x0018, 0x9200) +#define DCM_RespiratoryCyclePosition DcmTagKey(0x0018, 0x9214) +#define DCM_VelocityEncodingMaximumValue DcmTagKey(0x0018, 0x9217) +#define DCM_TagSpacingSecondDimension DcmTagKey(0x0018, 0x9218) +#define DCM_TagAngleSecondAxis DcmTagKey(0x0018, 0x9219) +#define DCM_FrameAcquisitionDuration DcmTagKey(0x0018, 0x9220) +#define DCM_MRImageFrameTypeSequence DcmTagKey(0x0018, 0x9226) +#define DCM_MRSpectroscopyFrameTypeSequence DcmTagKey(0x0018, 0x9227) +#define DCM_MRAcquisitionPhaseEncodingStepsInPlane DcmTagKey(0x0018, 0x9231) +#define DCM_MRAcquisitionPhaseEncodingStepsOutOfPlane DcmTagKey(0x0018, 0x9232) +#define DCM_SpectroscopyAcquisitionPhaseColumns DcmTagKey(0x0018, 0x9234) +#define DCM_CardiacCyclePosition DcmTagKey(0x0018, 0x9236) +#define DCM_SpecificAbsorptionRateSequence DcmTagKey(0x0018, 0x9239) +#define DCM_RFEchoTrainLength DcmTagKey(0x0018, 0x9240) +#define DCM_GradientEchoTrainLength DcmTagKey(0x0018, 0x9241) +#define DCM_ArterialSpinLabelingContrast DcmTagKey(0x0018, 0x9250) +#define DCM_MRArterialSpinLabelingSequence DcmTagKey(0x0018, 0x9251) +#define DCM_ASLTechniqueDescription DcmTagKey(0x0018, 0x9252) +#define DCM_ASLSlabNumber DcmTagKey(0x0018, 0x9253) +#define DCM_ASLSlabThickness DcmTagKey(0x0018, 0x9254) +#define DCM_ASLSlabOrientation DcmTagKey(0x0018, 0x9255) +#define DCM_ASLMidSlabPosition DcmTagKey(0x0018, 0x9256) +#define DCM_ASLContext DcmTagKey(0x0018, 0x9257) +#define DCM_ASLPulseTrainDuration DcmTagKey(0x0018, 0x9258) +#define DCM_ASLCrusherFlag DcmTagKey(0x0018, 0x9259) +#define DCM_ASLCrusherFlowLimit DcmTagKey(0x0018, 0x925a) +#define DCM_ASLCrusherDescription DcmTagKey(0x0018, 0x925b) +#define DCM_ASLBolusCutoffFlag DcmTagKey(0x0018, 0x925c) +#define DCM_ASLBolusCutoffTimingSequence DcmTagKey(0x0018, 0x925d) +#define DCM_ASLBolusCutoffTechnique DcmTagKey(0x0018, 0x925e) +#define DCM_ASLBolusCutoffDelayTime DcmTagKey(0x0018, 0x925f) +#define DCM_ASLSlabSequence DcmTagKey(0x0018, 0x9260) +#define DCM_ChemicalShiftMinimumIntegrationLimitInppm DcmTagKey(0x0018, 0x9295) +#define DCM_ChemicalShiftMaximumIntegrationLimitInppm DcmTagKey(0x0018, 0x9296) +#define DCM_WaterReferenceAcquisition DcmTagKey(0x0018, 0x9297) +#define DCM_EchoPeakPosition DcmTagKey(0x0018, 0x9298) +#define DCM_CTAcquisitionTypeSequence DcmTagKey(0x0018, 0x9301) +#define DCM_AcquisitionType DcmTagKey(0x0018, 0x9302) +#define DCM_TubeAngle DcmTagKey(0x0018, 0x9303) +#define DCM_CTAcquisitionDetailsSequence DcmTagKey(0x0018, 0x9304) +#define DCM_RevolutionTime DcmTagKey(0x0018, 0x9305) +#define DCM_SingleCollimationWidth DcmTagKey(0x0018, 0x9306) +#define DCM_TotalCollimationWidth DcmTagKey(0x0018, 0x9307) +#define DCM_CTTableDynamicsSequence DcmTagKey(0x0018, 0x9308) +#define DCM_TableSpeed DcmTagKey(0x0018, 0x9309) +#define DCM_TableFeedPerRotation DcmTagKey(0x0018, 0x9310) +#define DCM_SpiralPitchFactor DcmTagKey(0x0018, 0x9311) +#define DCM_CTGeometrySequence DcmTagKey(0x0018, 0x9312) +#define DCM_DataCollectionCenterPatient DcmTagKey(0x0018, 0x9313) +#define DCM_CTReconstructionSequence DcmTagKey(0x0018, 0x9314) +#define DCM_ReconstructionAlgorithm DcmTagKey(0x0018, 0x9315) +#define DCM_ConvolutionKernelGroup DcmTagKey(0x0018, 0x9316) +#define DCM_ReconstructionFieldOfView DcmTagKey(0x0018, 0x9317) +#define DCM_ReconstructionTargetCenterPatient DcmTagKey(0x0018, 0x9318) +#define DCM_ReconstructionAngle DcmTagKey(0x0018, 0x9319) +#define DCM_ImageFilter DcmTagKey(0x0018, 0x9320) +#define DCM_CTExposureSequence DcmTagKey(0x0018, 0x9321) +#define DCM_ReconstructionPixelSpacing DcmTagKey(0x0018, 0x9322) +#define DCM_ExposureModulationType DcmTagKey(0x0018, 0x9323) +#define DCM_EstimatedDoseSaving DcmTagKey(0x0018, 0x9324) +#define DCM_CTXRayDetailsSequence DcmTagKey(0x0018, 0x9325) +#define DCM_CTPositionSequence DcmTagKey(0x0018, 0x9326) +#define DCM_TablePosition DcmTagKey(0x0018, 0x9327) +#define DCM_ExposureTimeInms DcmTagKey(0x0018, 0x9328) +#define DCM_CTImageFrameTypeSequence DcmTagKey(0x0018, 0x9329) +#define DCM_XRayTubeCurrentInmA DcmTagKey(0x0018, 0x9330) +#define DCM_ExposureInmAs DcmTagKey(0x0018, 0x9332) +#define DCM_ConstantVolumeFlag DcmTagKey(0x0018, 0x9333) +#define DCM_FluoroscopyFlag DcmTagKey(0x0018, 0x9334) +#define DCM_DistanceSourceToDataCollectionCenter DcmTagKey(0x0018, 0x9335) +#define DCM_ContrastBolusAgentNumber DcmTagKey(0x0018, 0x9337) +#define DCM_ContrastBolusIngredientCodeSequence DcmTagKey(0x0018, 0x9338) +#define DCM_ContrastAdministrationProfileSequence DcmTagKey(0x0018, 0x9340) +#define DCM_ContrastBolusUsageSequence DcmTagKey(0x0018, 0x9341) +#define DCM_ContrastBolusAgentAdministered DcmTagKey(0x0018, 0x9342) +#define DCM_ContrastBolusAgentDetected DcmTagKey(0x0018, 0x9343) +#define DCM_ContrastBolusAgentPhase DcmTagKey(0x0018, 0x9344) +#define DCM_CTDIvol DcmTagKey(0x0018, 0x9345) +#define DCM_CTDIPhantomTypeCodeSequence DcmTagKey(0x0018, 0x9346) +#define DCM_CalciumScoringMassFactorPatient DcmTagKey(0x0018, 0x9351) +#define DCM_CalciumScoringMassFactorDevice DcmTagKey(0x0018, 0x9352) +#define DCM_EnergyWeightingFactor DcmTagKey(0x0018, 0x9353) +#define DCM_CTAdditionalXRaySourceSequence DcmTagKey(0x0018, 0x9360) +#define DCM_MultienergyCTAcquisition DcmTagKey(0x0018, 0x9361) +#define DCM_MultienergyCTAcquisitionSequence DcmTagKey(0x0018, 0x9362) +#define DCM_MultienergyCTProcessingSequence DcmTagKey(0x0018, 0x9363) +#define DCM_MultienergyCTCharacteristicsSequence DcmTagKey(0x0018, 0x9364) +#define DCM_MultienergyCTXRaySourceSequence DcmTagKey(0x0018, 0x9365) +#define DCM_XRaySourceIndex DcmTagKey(0x0018, 0x9366) +#define DCM_XRaySourceID DcmTagKey(0x0018, 0x9367) +#define DCM_MultienergySourceTechnique DcmTagKey(0x0018, 0x9368) +#define DCM_SourceStartDateTime DcmTagKey(0x0018, 0x9369) +#define DCM_SourceEndDateTime DcmTagKey(0x0018, 0x936a) +#define DCM_SwitchingPhaseNumber DcmTagKey(0x0018, 0x936b) +#define DCM_SwitchingPhaseNominalDuration DcmTagKey(0x0018, 0x936c) +#define DCM_SwitchingPhaseTransitionDuration DcmTagKey(0x0018, 0x936d) +#define DCM_EffectiveBinEnergy DcmTagKey(0x0018, 0x936e) +#define DCM_MultienergyCTXRayDetectorSequence DcmTagKey(0x0018, 0x936f) +#define DCM_XRayDetectorIndex DcmTagKey(0x0018, 0x9370) +#define DCM_XRayDetectorID DcmTagKey(0x0018, 0x9371) +#define DCM_MultienergyDetectorType DcmTagKey(0x0018, 0x9372) +#define DCM_XRayDetectorLabel DcmTagKey(0x0018, 0x9373) +#define DCM_NominalMaxEnergy DcmTagKey(0x0018, 0x9374) +#define DCM_NominalMinEnergy DcmTagKey(0x0018, 0x9375) +#define DCM_ReferencedXRayDetectorIndex DcmTagKey(0x0018, 0x9376) +#define DCM_ReferencedXRaySourceIndex DcmTagKey(0x0018, 0x9377) +#define DCM_ReferencedPathIndex DcmTagKey(0x0018, 0x9378) +#define DCM_MultienergyCTPathSequence DcmTagKey(0x0018, 0x9379) +#define DCM_MultienergyCTPathIndex DcmTagKey(0x0018, 0x937a) +#define DCM_MultienergyAcquisitionDescription DcmTagKey(0x0018, 0x937b) +#define DCM_MonoenergeticEnergyEquivalent DcmTagKey(0x0018, 0x937c) +#define DCM_MaterialCodeSequence DcmTagKey(0x0018, 0x937d) +#define DCM_DecompositionMethod DcmTagKey(0x0018, 0x937e) +#define DCM_DecompositionDescription DcmTagKey(0x0018, 0x937f) +#define DCM_DecompositionAlgorithmIdentificationSequence DcmTagKey(0x0018, 0x9380) +#define DCM_DecompositionMaterialSequence DcmTagKey(0x0018, 0x9381) +#define DCM_MaterialAttenuationSequence DcmTagKey(0x0018, 0x9382) +#define DCM_PhotonEnergy DcmTagKey(0x0018, 0x9383) +#define DCM_XRayMassAttenuationCoefficient DcmTagKey(0x0018, 0x9384) +#define DCM_ProjectionPixelCalibrationSequence DcmTagKey(0x0018, 0x9401) +#define DCM_DistanceSourceToIsocenter DcmTagKey(0x0018, 0x9402) +#define DCM_DistanceObjectToTableTop DcmTagKey(0x0018, 0x9403) +#define DCM_ObjectPixelSpacingInCenterOfBeam DcmTagKey(0x0018, 0x9404) +#define DCM_PositionerPositionSequence DcmTagKey(0x0018, 0x9405) +#define DCM_TablePositionSequence DcmTagKey(0x0018, 0x9406) +#define DCM_CollimatorShapeSequence DcmTagKey(0x0018, 0x9407) +#define DCM_PlanesInAcquisition DcmTagKey(0x0018, 0x9410) +#define DCM_XAXRFFrameCharacteristicsSequence DcmTagKey(0x0018, 0x9412) +#define DCM_FrameAcquisitionSequence DcmTagKey(0x0018, 0x9417) +#define DCM_XRayReceptorType DcmTagKey(0x0018, 0x9420) +#define DCM_AcquisitionProtocolName DcmTagKey(0x0018, 0x9423) +#define DCM_AcquisitionProtocolDescription DcmTagKey(0x0018, 0x9424) +#define DCM_ContrastBolusIngredientOpaque DcmTagKey(0x0018, 0x9425) +#define DCM_DistanceReceptorPlaneToDetectorHousing DcmTagKey(0x0018, 0x9426) +#define DCM_IntensifierActiveShape DcmTagKey(0x0018, 0x9427) +#define DCM_IntensifierActiveDimensions DcmTagKey(0x0018, 0x9428) +#define DCM_PhysicalDetectorSize DcmTagKey(0x0018, 0x9429) +#define DCM_PositionOfIsocenterProjection DcmTagKey(0x0018, 0x9430) +#define DCM_FieldOfViewSequence DcmTagKey(0x0018, 0x9432) +#define DCM_FieldOfViewDescription DcmTagKey(0x0018, 0x9433) +#define DCM_ExposureControlSensingRegionsSequence DcmTagKey(0x0018, 0x9434) +#define DCM_ExposureControlSensingRegionShape DcmTagKey(0x0018, 0x9435) +#define DCM_ExposureControlSensingRegionLeftVerticalEdge DcmTagKey(0x0018, 0x9436) +#define DCM_ExposureControlSensingRegionRightVerticalEdge DcmTagKey(0x0018, 0x9437) +#define DCM_ExposureControlSensingRegionUpperHorizontalEdge DcmTagKey(0x0018, 0x9438) +#define DCM_ExposureControlSensingRegionLowerHorizontalEdge DcmTagKey(0x0018, 0x9439) +#define DCM_CenterOfCircularExposureControlSensingRegion DcmTagKey(0x0018, 0x9440) +#define DCM_RadiusOfCircularExposureControlSensingRegion DcmTagKey(0x0018, 0x9441) +#define DCM_VerticesOfThePolygonalExposureControlSensingRegion DcmTagKey(0x0018, 0x9442) +#define DCM_ColumnAngulationPatient DcmTagKey(0x0018, 0x9447) +#define DCM_BeamAngle DcmTagKey(0x0018, 0x9449) +#define DCM_FrameDetectorParametersSequence DcmTagKey(0x0018, 0x9451) +#define DCM_CalculatedAnatomyThickness DcmTagKey(0x0018, 0x9452) +#define DCM_CalibrationSequence DcmTagKey(0x0018, 0x9455) +#define DCM_ObjectThicknessSequence DcmTagKey(0x0018, 0x9456) +#define DCM_PlaneIdentification DcmTagKey(0x0018, 0x9457) +#define DCM_FieldOfViewDimensionsInFloat DcmTagKey(0x0018, 0x9461) +#define DCM_IsocenterReferenceSystemSequence DcmTagKey(0x0018, 0x9462) +#define DCM_PositionerIsocenterPrimaryAngle DcmTagKey(0x0018, 0x9463) +#define DCM_PositionerIsocenterSecondaryAngle DcmTagKey(0x0018, 0x9464) +#define DCM_PositionerIsocenterDetectorRotationAngle DcmTagKey(0x0018, 0x9465) +#define DCM_TableXPositionToIsocenter DcmTagKey(0x0018, 0x9466) +#define DCM_TableYPositionToIsocenter DcmTagKey(0x0018, 0x9467) +#define DCM_TableZPositionToIsocenter DcmTagKey(0x0018, 0x9468) +#define DCM_TableHorizontalRotationAngle DcmTagKey(0x0018, 0x9469) +#define DCM_TableHeadTiltAngle DcmTagKey(0x0018, 0x9470) +#define DCM_TableCradleTiltAngle DcmTagKey(0x0018, 0x9471) +#define DCM_FrameDisplayShutterSequence DcmTagKey(0x0018, 0x9472) +#define DCM_AcquiredImageAreaDoseProduct DcmTagKey(0x0018, 0x9473) +#define DCM_CArmPositionerTabletopRelationship DcmTagKey(0x0018, 0x9474) +#define DCM_XRayGeometrySequence DcmTagKey(0x0018, 0x9476) +#define DCM_IrradiationEventIdentificationSequence DcmTagKey(0x0018, 0x9477) +#define DCM_XRay3DFrameTypeSequence DcmTagKey(0x0018, 0x9504) +#define DCM_ContributingSourcesSequence DcmTagKey(0x0018, 0x9506) +#define DCM_XRay3DAcquisitionSequence DcmTagKey(0x0018, 0x9507) +#define DCM_PrimaryPositionerScanArc DcmTagKey(0x0018, 0x9508) +#define DCM_SecondaryPositionerScanArc DcmTagKey(0x0018, 0x9509) +#define DCM_PrimaryPositionerScanStartAngle DcmTagKey(0x0018, 0x9510) +#define DCM_SecondaryPositionerScanStartAngle DcmTagKey(0x0018, 0x9511) +#define DCM_PrimaryPositionerIncrement DcmTagKey(0x0018, 0x9514) +#define DCM_SecondaryPositionerIncrement DcmTagKey(0x0018, 0x9515) +#define DCM_StartAcquisitionDateTime DcmTagKey(0x0018, 0x9516) +#define DCM_EndAcquisitionDateTime DcmTagKey(0x0018, 0x9517) +#define DCM_PrimaryPositionerIncrementSign DcmTagKey(0x0018, 0x9518) +#define DCM_SecondaryPositionerIncrementSign DcmTagKey(0x0018, 0x9519) +#define DCM_ApplicationName DcmTagKey(0x0018, 0x9524) +#define DCM_ApplicationVersion DcmTagKey(0x0018, 0x9525) +#define DCM_ApplicationManufacturer DcmTagKey(0x0018, 0x9526) +#define DCM_AlgorithmType DcmTagKey(0x0018, 0x9527) +#define DCM_AlgorithmDescription DcmTagKey(0x0018, 0x9528) +#define DCM_XRay3DReconstructionSequence DcmTagKey(0x0018, 0x9530) +#define DCM_ReconstructionDescription DcmTagKey(0x0018, 0x9531) +#define DCM_PerProjectionAcquisitionSequence DcmTagKey(0x0018, 0x9538) +#define DCM_DetectorPositionSequence DcmTagKey(0x0018, 0x9541) +#define DCM_XRayAcquisitionDoseSequence DcmTagKey(0x0018, 0x9542) +#define DCM_XRaySourceIsocenterPrimaryAngle DcmTagKey(0x0018, 0x9543) +#define DCM_XRaySourceIsocenterSecondaryAngle DcmTagKey(0x0018, 0x9544) +#define DCM_BreastSupportIsocenterPrimaryAngle DcmTagKey(0x0018, 0x9545) +#define DCM_BreastSupportIsocenterSecondaryAngle DcmTagKey(0x0018, 0x9546) +#define DCM_BreastSupportXPositionToIsocenter DcmTagKey(0x0018, 0x9547) +#define DCM_BreastSupportYPositionToIsocenter DcmTagKey(0x0018, 0x9548) +#define DCM_BreastSupportZPositionToIsocenter DcmTagKey(0x0018, 0x9549) +#define DCM_DetectorIsocenterPrimaryAngle DcmTagKey(0x0018, 0x9550) +#define DCM_DetectorIsocenterSecondaryAngle DcmTagKey(0x0018, 0x9551) +#define DCM_DetectorXPositionToIsocenter DcmTagKey(0x0018, 0x9552) +#define DCM_DetectorYPositionToIsocenter DcmTagKey(0x0018, 0x9553) +#define DCM_DetectorZPositionToIsocenter DcmTagKey(0x0018, 0x9554) +#define DCM_XRayGridSequence DcmTagKey(0x0018, 0x9555) +#define DCM_XRayFilterSequence DcmTagKey(0x0018, 0x9556) +#define DCM_DetectorActiveAreaTLHCPosition DcmTagKey(0x0018, 0x9557) +#define DCM_DetectorActiveAreaOrientation DcmTagKey(0x0018, 0x9558) +#define DCM_PositionerPrimaryAngleDirection DcmTagKey(0x0018, 0x9559) +#define DCM_DiffusionBMatrixSequence DcmTagKey(0x0018, 0x9601) +#define DCM_DiffusionBValueXX DcmTagKey(0x0018, 0x9602) +#define DCM_DiffusionBValueXY DcmTagKey(0x0018, 0x9603) +#define DCM_DiffusionBValueXZ DcmTagKey(0x0018, 0x9604) +#define DCM_DiffusionBValueYY DcmTagKey(0x0018, 0x9605) +#define DCM_DiffusionBValueYZ DcmTagKey(0x0018, 0x9606) +#define DCM_DiffusionBValueZZ DcmTagKey(0x0018, 0x9607) +#define DCM_FunctionalMRSequence DcmTagKey(0x0018, 0x9621) +#define DCM_FunctionalSettlingPhaseFramesPresent DcmTagKey(0x0018, 0x9622) +#define DCM_FunctionalSyncPulse DcmTagKey(0x0018, 0x9623) +#define DCM_SettlingPhaseFrame DcmTagKey(0x0018, 0x9624) +#define DCM_DecayCorrectionDateTime DcmTagKey(0x0018, 0x9701) +#define DCM_StartDensityThreshold DcmTagKey(0x0018, 0x9715) +#define DCM_StartRelativeDensityDifferenceThreshold DcmTagKey(0x0018, 0x9716) +#define DCM_StartCardiacTriggerCountThreshold DcmTagKey(0x0018, 0x9717) +#define DCM_StartRespiratoryTriggerCountThreshold DcmTagKey(0x0018, 0x9718) +#define DCM_TerminationCountsThreshold DcmTagKey(0x0018, 0x9719) +#define DCM_TerminationDensityThreshold DcmTagKey(0x0018, 0x9720) +#define DCM_TerminationRelativeDensityThreshold DcmTagKey(0x0018, 0x9721) +#define DCM_TerminationTimeThreshold DcmTagKey(0x0018, 0x9722) +#define DCM_TerminationCardiacTriggerCountThreshold DcmTagKey(0x0018, 0x9723) +#define DCM_TerminationRespiratoryTriggerCountThreshold DcmTagKey(0x0018, 0x9724) +#define DCM_DetectorGeometry DcmTagKey(0x0018, 0x9725) +#define DCM_TransverseDetectorSeparation DcmTagKey(0x0018, 0x9726) +#define DCM_AxialDetectorDimension DcmTagKey(0x0018, 0x9727) +#define DCM_RadiopharmaceuticalAgentNumber DcmTagKey(0x0018, 0x9729) +#define DCM_PETFrameAcquisitionSequence DcmTagKey(0x0018, 0x9732) +#define DCM_PETDetectorMotionDetailsSequence DcmTagKey(0x0018, 0x9733) +#define DCM_PETTableDynamicsSequence DcmTagKey(0x0018, 0x9734) +#define DCM_PETPositionSequence DcmTagKey(0x0018, 0x9735) +#define DCM_PETFrameCorrectionFactorsSequence DcmTagKey(0x0018, 0x9736) +#define DCM_RadiopharmaceuticalUsageSequence DcmTagKey(0x0018, 0x9737) +#define DCM_AttenuationCorrectionSource DcmTagKey(0x0018, 0x9738) +#define DCM_NumberOfIterations DcmTagKey(0x0018, 0x9739) +#define DCM_NumberOfSubsets DcmTagKey(0x0018, 0x9740) +#define DCM_PETReconstructionSequence DcmTagKey(0x0018, 0x9749) +#define DCM_PETFrameTypeSequence DcmTagKey(0x0018, 0x9751) +#define DCM_TimeOfFlightInformationUsed DcmTagKey(0x0018, 0x9755) +#define DCM_ReconstructionType DcmTagKey(0x0018, 0x9756) +#define DCM_DecayCorrected DcmTagKey(0x0018, 0x9758) +#define DCM_AttenuationCorrected DcmTagKey(0x0018, 0x9759) +#define DCM_ScatterCorrected DcmTagKey(0x0018, 0x9760) +#define DCM_DeadTimeCorrected DcmTagKey(0x0018, 0x9761) +#define DCM_GantryMotionCorrected DcmTagKey(0x0018, 0x9762) +#define DCM_PatientMotionCorrected DcmTagKey(0x0018, 0x9763) +#define DCM_CountLossNormalizationCorrected DcmTagKey(0x0018, 0x9764) +#define DCM_RandomsCorrected DcmTagKey(0x0018, 0x9765) +#define DCM_NonUniformRadialSamplingCorrected DcmTagKey(0x0018, 0x9766) +#define DCM_SensitivityCalibrated DcmTagKey(0x0018, 0x9767) +#define DCM_DetectorNormalizationCorrection DcmTagKey(0x0018, 0x9768) +#define DCM_IterativeReconstructionMethod DcmTagKey(0x0018, 0x9769) +#define DCM_AttenuationCorrectionTemporalRelationship DcmTagKey(0x0018, 0x9770) +#define DCM_PatientPhysiologicalStateSequence DcmTagKey(0x0018, 0x9771) +#define DCM_PatientPhysiologicalStateCodeSequence DcmTagKey(0x0018, 0x9772) +#define DCM_DepthsOfFocus DcmTagKey(0x0018, 0x9801) +#define DCM_ExcludedIntervalsSequence DcmTagKey(0x0018, 0x9803) +#define DCM_ExclusionStartDateTime DcmTagKey(0x0018, 0x9804) +#define DCM_ExclusionDuration DcmTagKey(0x0018, 0x9805) +#define DCM_USImageDescriptionSequence DcmTagKey(0x0018, 0x9806) +#define DCM_ImageDataTypeSequence DcmTagKey(0x0018, 0x9807) +#define DCM_DataType DcmTagKey(0x0018, 0x9808) +#define DCM_TransducerScanPatternCodeSequence DcmTagKey(0x0018, 0x9809) +#define DCM_AliasedDataType DcmTagKey(0x0018, 0x980b) +#define DCM_PositionMeasuringDeviceUsed DcmTagKey(0x0018, 0x980c) +#define DCM_TransducerGeometryCodeSequence DcmTagKey(0x0018, 0x980d) +#define DCM_TransducerBeamSteeringCodeSequence DcmTagKey(0x0018, 0x980e) +#define DCM_TransducerApplicationCodeSequence DcmTagKey(0x0018, 0x980f) +#define DCM_ZeroVelocityPixelValue DcmTagKey(0x0018, 0x9810) +#define DCM_ReferenceLocationLabel DcmTagKey(0x0018, 0x9900) +#define DCM_ReferenceLocationDescription DcmTagKey(0x0018, 0x9901) +#define DCM_ReferenceBasisCodeSequence DcmTagKey(0x0018, 0x9902) +#define DCM_ReferenceGeometryCodeSequence DcmTagKey(0x0018, 0x9903) +#define DCM_OffsetDistance DcmTagKey(0x0018, 0x9904) +#define DCM_OffsetDirection DcmTagKey(0x0018, 0x9905) +#define DCM_PotentialScheduledProtocolCodeSequence DcmTagKey(0x0018, 0x9906) +#define DCM_PotentialRequestedProcedureCodeSequence DcmTagKey(0x0018, 0x9907) +#define DCM_PotentialReasonsForProcedure DcmTagKey(0x0018, 0x9908) +#define DCM_PotentialReasonsForProcedureCodeSequence DcmTagKey(0x0018, 0x9909) +#define DCM_PotentialDiagnosticTasks DcmTagKey(0x0018, 0x990a) +#define DCM_ContraindicationsCodeSequence DcmTagKey(0x0018, 0x990b) +#define DCM_ReferencedDefinedProtocolSequence DcmTagKey(0x0018, 0x990c) +#define DCM_ReferencedPerformedProtocolSequence DcmTagKey(0x0018, 0x990d) +#define DCM_PredecessorProtocolSequence DcmTagKey(0x0018, 0x990e) +#define DCM_ProtocolPlanningInformation DcmTagKey(0x0018, 0x990f) +#define DCM_ProtocolDesignRationale DcmTagKey(0x0018, 0x9910) +#define DCM_PatientSpecificationSequence DcmTagKey(0x0018, 0x9911) +#define DCM_ModelSpecificationSequence DcmTagKey(0x0018, 0x9912) +#define DCM_ParametersSpecificationSequence DcmTagKey(0x0018, 0x9913) +#define DCM_InstructionSequence DcmTagKey(0x0018, 0x9914) +#define DCM_InstructionIndex DcmTagKey(0x0018, 0x9915) +#define DCM_InstructionText DcmTagKey(0x0018, 0x9916) +#define DCM_InstructionDescription DcmTagKey(0x0018, 0x9917) +#define DCM_InstructionPerformedFlag DcmTagKey(0x0018, 0x9918) +#define DCM_InstructionPerformedDateTime DcmTagKey(0x0018, 0x9919) +#define DCM_InstructionPerformanceComment DcmTagKey(0x0018, 0x991a) +#define DCM_PatientPositioningInstructionSequence DcmTagKey(0x0018, 0x991b) +#define DCM_PositioningMethodCodeSequence DcmTagKey(0x0018, 0x991c) +#define DCM_PositioningLandmarkSequence DcmTagKey(0x0018, 0x991d) +#define DCM_TargetFrameOfReferenceUID DcmTagKey(0x0018, 0x991e) +#define DCM_AcquisitionProtocolElementSpecificationSequence DcmTagKey(0x0018, 0x991f) +#define DCM_AcquisitionProtocolElementSequence DcmTagKey(0x0018, 0x9920) +#define DCM_ProtocolElementNumber DcmTagKey(0x0018, 0x9921) +#define DCM_ProtocolElementName DcmTagKey(0x0018, 0x9922) +#define DCM_ProtocolElementCharacteristicsSummary DcmTagKey(0x0018, 0x9923) +#define DCM_ProtocolElementPurpose DcmTagKey(0x0018, 0x9924) +#define DCM_AcquisitionMotion DcmTagKey(0x0018, 0x9930) +#define DCM_AcquisitionStartLocationSequence DcmTagKey(0x0018, 0x9931) +#define DCM_AcquisitionEndLocationSequence DcmTagKey(0x0018, 0x9932) +#define DCM_ReconstructionProtocolElementSpecificationSequence DcmTagKey(0x0018, 0x9933) +#define DCM_ReconstructionProtocolElementSequence DcmTagKey(0x0018, 0x9934) +#define DCM_StorageProtocolElementSpecificationSequence DcmTagKey(0x0018, 0x9935) +#define DCM_StorageProtocolElementSequence DcmTagKey(0x0018, 0x9936) +#define DCM_RequestedSeriesDescription DcmTagKey(0x0018, 0x9937) +#define DCM_SourceAcquisitionProtocolElementNumber DcmTagKey(0x0018, 0x9938) +#define DCM_SourceAcquisitionBeamNumber DcmTagKey(0x0018, 0x9939) +#define DCM_SourceReconstructionProtocolElementNumber DcmTagKey(0x0018, 0x993a) +#define DCM_ReconstructionStartLocationSequence DcmTagKey(0x0018, 0x993b) +#define DCM_ReconstructionEndLocationSequence DcmTagKey(0x0018, 0x993c) +#define DCM_ReconstructionAlgorithmSequence DcmTagKey(0x0018, 0x993d) +#define DCM_ReconstructionTargetCenterLocationSequence DcmTagKey(0x0018, 0x993e) +#define DCM_ImageFilterDescription DcmTagKey(0x0018, 0x9941) +#define DCM_CTDIvolNotificationTrigger DcmTagKey(0x0018, 0x9942) +#define DCM_DLPNotificationTrigger DcmTagKey(0x0018, 0x9943) +#define DCM_AutoKVPSelectionType DcmTagKey(0x0018, 0x9944) +#define DCM_AutoKVPUpperBound DcmTagKey(0x0018, 0x9945) +#define DCM_AutoKVPLowerBound DcmTagKey(0x0018, 0x9946) +#define DCM_ProtocolDefinedPatientPosition DcmTagKey(0x0018, 0x9947) +#define DCM_ContributingEquipmentSequence DcmTagKey(0x0018, 0xa001) +#define DCM_ContributionDateTime DcmTagKey(0x0018, 0xa002) +#define DCM_ContributionDescription DcmTagKey(0x0018, 0xa003) +#define DCM_StudyInstanceUID DcmTagKey(0x0020, 0x000d) +#define DCM_SeriesInstanceUID DcmTagKey(0x0020, 0x000e) +#define DCM_StudyID DcmTagKey(0x0020, 0x0010) +#define DCM_SeriesNumber DcmTagKey(0x0020, 0x0011) +#define DCM_AcquisitionNumber DcmTagKey(0x0020, 0x0012) +#define DCM_InstanceNumber DcmTagKey(0x0020, 0x0013) +#define DCM_RETIRED_IsotopeNumber DcmTagKey(0x0020, 0x0014) +#define DCM_RETIRED_PhaseNumber DcmTagKey(0x0020, 0x0015) +#define DCM_RETIRED_IntervalNumber DcmTagKey(0x0020, 0x0016) +#define DCM_RETIRED_TimeSlotNumber DcmTagKey(0x0020, 0x0017) +#define DCM_RETIRED_AngleNumber DcmTagKey(0x0020, 0x0018) +#define DCM_ItemNumber DcmTagKey(0x0020, 0x0019) +#define DCM_PatientOrientation DcmTagKey(0x0020, 0x0020) +#define DCM_RETIRED_OverlayNumber DcmTagKey(0x0020, 0x0022) +#define DCM_RETIRED_CurveNumber DcmTagKey(0x0020, 0x0024) +#define DCM_RETIRED_LUTNumber DcmTagKey(0x0020, 0x0026) +#define DCM_RETIRED_ImagePosition DcmTagKey(0x0020, 0x0030) +#define DCM_ImagePositionPatient DcmTagKey(0x0020, 0x0032) +#define DCM_RETIRED_ImageOrientation DcmTagKey(0x0020, 0x0035) +#define DCM_ImageOrientationPatient DcmTagKey(0x0020, 0x0037) +#define DCM_RETIRED_Location DcmTagKey(0x0020, 0x0050) +#define DCM_FrameOfReferenceUID DcmTagKey(0x0020, 0x0052) +#define DCM_Laterality DcmTagKey(0x0020, 0x0060) +#define DCM_ImageLaterality DcmTagKey(0x0020, 0x0062) +#define DCM_RETIRED_ImageGeometryType DcmTagKey(0x0020, 0x0070) +#define DCM_RETIRED_MaskingImage DcmTagKey(0x0020, 0x0080) +#define DCM_RETIRED_ReportNumber DcmTagKey(0x0020, 0x00aa) +#define DCM_TemporalPositionIdentifier DcmTagKey(0x0020, 0x0100) +#define DCM_NumberOfTemporalPositions DcmTagKey(0x0020, 0x0105) +#define DCM_TemporalResolution DcmTagKey(0x0020, 0x0110) +#define DCM_SynchronizationFrameOfReferenceUID DcmTagKey(0x0020, 0x0200) +#define DCM_SOPInstanceUIDOfConcatenationSource DcmTagKey(0x0020, 0x0242) +#define DCM_RETIRED_SeriesInStudy DcmTagKey(0x0020, 0x1000) +#define DCM_RETIRED_AcquisitionsInSeries DcmTagKey(0x0020, 0x1001) +#define DCM_ImagesInAcquisition DcmTagKey(0x0020, 0x1002) +#define DCM_RETIRED_ImagesInSeries DcmTagKey(0x0020, 0x1003) +#define DCM_RETIRED_AcquisitionsInStudy DcmTagKey(0x0020, 0x1004) +#define DCM_RETIRED_ImagesInStudy DcmTagKey(0x0020, 0x1005) +#define DCM_RETIRED_Reference DcmTagKey(0x0020, 0x1020) +#define DCM_TargetPositionReferenceIndicator DcmTagKey(0x0020, 0x103f) +#define DCM_PositionReferenceIndicator DcmTagKey(0x0020, 0x1040) +#define DCM_SliceLocation DcmTagKey(0x0020, 0x1041) +#define DCM_RETIRED_OtherStudyNumbers DcmTagKey(0x0020, 0x1070) +#define DCM_NumberOfPatientRelatedStudies DcmTagKey(0x0020, 0x1200) +#define DCM_NumberOfPatientRelatedSeries DcmTagKey(0x0020, 0x1202) +#define DCM_NumberOfPatientRelatedInstances DcmTagKey(0x0020, 0x1204) +#define DCM_NumberOfStudyRelatedSeries DcmTagKey(0x0020, 0x1206) +#define DCM_NumberOfStudyRelatedInstances DcmTagKey(0x0020, 0x1208) +#define DCM_NumberOfSeriesRelatedInstances DcmTagKey(0x0020, 0x1209) +#define DCM_RETIRED_ModifyingDeviceID DcmTagKey(0x0020, 0x3401) +#define DCM_RETIRED_ModifiedImageID DcmTagKey(0x0020, 0x3402) +#define DCM_RETIRED_ModifiedImageDate DcmTagKey(0x0020, 0x3403) +#define DCM_RETIRED_ModifyingDeviceManufacturer DcmTagKey(0x0020, 0x3404) +#define DCM_RETIRED_ModifiedImageTime DcmTagKey(0x0020, 0x3405) +#define DCM_RETIRED_ModifiedImageDescription DcmTagKey(0x0020, 0x3406) +#define DCM_ImageComments DcmTagKey(0x0020, 0x4000) +#define DCM_RETIRED_OriginalImageIdentification DcmTagKey(0x0020, 0x5000) +#define DCM_RETIRED_OriginalImageIdentificationNomenclature DcmTagKey(0x0020, 0x5002) +#define DCM_StackID DcmTagKey(0x0020, 0x9056) +#define DCM_InStackPositionNumber DcmTagKey(0x0020, 0x9057) +#define DCM_FrameAnatomySequence DcmTagKey(0x0020, 0x9071) +#define DCM_FrameLaterality DcmTagKey(0x0020, 0x9072) +#define DCM_FrameContentSequence DcmTagKey(0x0020, 0x9111) +#define DCM_PlanePositionSequence DcmTagKey(0x0020, 0x9113) +#define DCM_PlaneOrientationSequence DcmTagKey(0x0020, 0x9116) +#define DCM_TemporalPositionIndex DcmTagKey(0x0020, 0x9128) +#define DCM_NominalCardiacTriggerDelayTime DcmTagKey(0x0020, 0x9153) +#define DCM_NominalCardiacTriggerTimePriorToRPeak DcmTagKey(0x0020, 0x9154) +#define DCM_ActualCardiacTriggerTimePriorToRPeak DcmTagKey(0x0020, 0x9155) +#define DCM_FrameAcquisitionNumber DcmTagKey(0x0020, 0x9156) +#define DCM_DimensionIndexValues DcmTagKey(0x0020, 0x9157) +#define DCM_FrameComments DcmTagKey(0x0020, 0x9158) +#define DCM_ConcatenationUID DcmTagKey(0x0020, 0x9161) +#define DCM_InConcatenationNumber DcmTagKey(0x0020, 0x9162) +#define DCM_InConcatenationTotalNumber DcmTagKey(0x0020, 0x9163) +#define DCM_DimensionOrganizationUID DcmTagKey(0x0020, 0x9164) +#define DCM_DimensionIndexPointer DcmTagKey(0x0020, 0x9165) +#define DCM_FunctionalGroupPointer DcmTagKey(0x0020, 0x9167) +#define DCM_UnassignedSharedConvertedAttributesSequence DcmTagKey(0x0020, 0x9170) +#define DCM_UnassignedPerFrameConvertedAttributesSequence DcmTagKey(0x0020, 0x9171) +#define DCM_ConversionSourceAttributesSequence DcmTagKey(0x0020, 0x9172) +#define DCM_DimensionIndexPrivateCreator DcmTagKey(0x0020, 0x9213) +#define DCM_DimensionOrganizationSequence DcmTagKey(0x0020, 0x9221) +#define DCM_DimensionIndexSequence DcmTagKey(0x0020, 0x9222) +#define DCM_ConcatenationFrameOffsetNumber DcmTagKey(0x0020, 0x9228) +#define DCM_FunctionalGroupPrivateCreator DcmTagKey(0x0020, 0x9238) +#define DCM_NominalPercentageOfCardiacPhase DcmTagKey(0x0020, 0x9241) +#define DCM_NominalPercentageOfRespiratoryPhase DcmTagKey(0x0020, 0x9245) +#define DCM_StartingRespiratoryAmplitude DcmTagKey(0x0020, 0x9246) +#define DCM_StartingRespiratoryPhase DcmTagKey(0x0020, 0x9247) +#define DCM_EndingRespiratoryAmplitude DcmTagKey(0x0020, 0x9248) +#define DCM_EndingRespiratoryPhase DcmTagKey(0x0020, 0x9249) +#define DCM_RespiratoryTriggerType DcmTagKey(0x0020, 0x9250) +#define DCM_RRIntervalTimeNominal DcmTagKey(0x0020, 0x9251) +#define DCM_ActualCardiacTriggerDelayTime DcmTagKey(0x0020, 0x9252) +#define DCM_RespiratorySynchronizationSequence DcmTagKey(0x0020, 0x9253) +#define DCM_RespiratoryIntervalTime DcmTagKey(0x0020, 0x9254) +#define DCM_NominalRespiratoryTriggerDelayTime DcmTagKey(0x0020, 0x9255) +#define DCM_RespiratoryTriggerDelayThreshold DcmTagKey(0x0020, 0x9256) +#define DCM_ActualRespiratoryTriggerDelayTime DcmTagKey(0x0020, 0x9257) +#define DCM_ImagePositionVolume DcmTagKey(0x0020, 0x9301) +#define DCM_ImageOrientationVolume DcmTagKey(0x0020, 0x9302) +#define DCM_UltrasoundAcquisitionGeometry DcmTagKey(0x0020, 0x9307) +#define DCM_ApexPosition DcmTagKey(0x0020, 0x9308) +#define DCM_VolumeToTransducerMappingMatrix DcmTagKey(0x0020, 0x9309) +#define DCM_VolumeToTableMappingMatrix DcmTagKey(0x0020, 0x930a) +#define DCM_VolumeToTransducerRelationship DcmTagKey(0x0020, 0x930b) +#define DCM_PatientFrameOfReferenceSource DcmTagKey(0x0020, 0x930c) +#define DCM_TemporalPositionTimeOffset DcmTagKey(0x0020, 0x930d) +#define DCM_PlanePositionVolumeSequence DcmTagKey(0x0020, 0x930e) +#define DCM_PlaneOrientationVolumeSequence DcmTagKey(0x0020, 0x930f) +#define DCM_TemporalPositionSequence DcmTagKey(0x0020, 0x9310) +#define DCM_DimensionOrganizationType DcmTagKey(0x0020, 0x9311) +#define DCM_VolumeFrameOfReferenceUID DcmTagKey(0x0020, 0x9312) +#define DCM_TableFrameOfReferenceUID DcmTagKey(0x0020, 0x9313) +#define DCM_DimensionDescriptionLabel DcmTagKey(0x0020, 0x9421) +#define DCM_PatientOrientationInFrameSequence DcmTagKey(0x0020, 0x9450) +#define DCM_FrameLabel DcmTagKey(0x0020, 0x9453) +#define DCM_AcquisitionIndex DcmTagKey(0x0020, 0x9518) +#define DCM_ContributingSOPInstancesReferenceSequence DcmTagKey(0x0020, 0x9529) +#define DCM_ReconstructionIndex DcmTagKey(0x0020, 0x9536) +#define DCM_LightPathFilterPassThroughWavelength DcmTagKey(0x0022, 0x0001) +#define DCM_LightPathFilterPassBand DcmTagKey(0x0022, 0x0002) +#define DCM_ImagePathFilterPassThroughWavelength DcmTagKey(0x0022, 0x0003) +#define DCM_ImagePathFilterPassBand DcmTagKey(0x0022, 0x0004) +#define DCM_PatientEyeMovementCommanded DcmTagKey(0x0022, 0x0005) +#define DCM_PatientEyeMovementCommandCodeSequence DcmTagKey(0x0022, 0x0006) +#define DCM_SphericalLensPower DcmTagKey(0x0022, 0x0007) +#define DCM_CylinderLensPower DcmTagKey(0x0022, 0x0008) +#define DCM_CylinderAxis DcmTagKey(0x0022, 0x0009) +#define DCM_EmmetropicMagnification DcmTagKey(0x0022, 0x000a) +#define DCM_IntraOcularPressure DcmTagKey(0x0022, 0x000b) +#define DCM_HorizontalFieldOfView DcmTagKey(0x0022, 0x000c) +#define DCM_PupilDilated DcmTagKey(0x0022, 0x000d) +#define DCM_DegreeOfDilation DcmTagKey(0x0022, 0x000e) +#define DCM_StereoBaselineAngle DcmTagKey(0x0022, 0x0010) +#define DCM_StereoBaselineDisplacement DcmTagKey(0x0022, 0x0011) +#define DCM_StereoHorizontalPixelOffset DcmTagKey(0x0022, 0x0012) +#define DCM_StereoVerticalPixelOffset DcmTagKey(0x0022, 0x0013) +#define DCM_StereoRotation DcmTagKey(0x0022, 0x0014) +#define DCM_AcquisitionDeviceTypeCodeSequence DcmTagKey(0x0022, 0x0015) +#define DCM_IlluminationTypeCodeSequence DcmTagKey(0x0022, 0x0016) +#define DCM_LightPathFilterTypeStackCodeSequence DcmTagKey(0x0022, 0x0017) +#define DCM_ImagePathFilterTypeStackCodeSequence DcmTagKey(0x0022, 0x0018) +#define DCM_LensesCodeSequence DcmTagKey(0x0022, 0x0019) +#define DCM_ChannelDescriptionCodeSequence DcmTagKey(0x0022, 0x001a) +#define DCM_RefractiveStateSequence DcmTagKey(0x0022, 0x001b) +#define DCM_MydriaticAgentCodeSequence DcmTagKey(0x0022, 0x001c) +#define DCM_RelativeImagePositionCodeSequence DcmTagKey(0x0022, 0x001d) +#define DCM_CameraAngleOfView DcmTagKey(0x0022, 0x001e) +#define DCM_StereoPairsSequence DcmTagKey(0x0022, 0x0020) +#define DCM_LeftImageSequence DcmTagKey(0x0022, 0x0021) +#define DCM_RightImageSequence DcmTagKey(0x0022, 0x0022) +#define DCM_StereoPairsPresent DcmTagKey(0x0022, 0x0028) +#define DCM_AxialLengthOfTheEye DcmTagKey(0x0022, 0x0030) +#define DCM_OphthalmicFrameLocationSequence DcmTagKey(0x0022, 0x0031) +#define DCM_ReferenceCoordinates DcmTagKey(0x0022, 0x0032) +#define DCM_DepthSpatialResolution DcmTagKey(0x0022, 0x0035) +#define DCM_MaximumDepthDistortion DcmTagKey(0x0022, 0x0036) +#define DCM_AlongScanSpatialResolution DcmTagKey(0x0022, 0x0037) +#define DCM_MaximumAlongScanDistortion DcmTagKey(0x0022, 0x0038) +#define DCM_OphthalmicImageOrientation DcmTagKey(0x0022, 0x0039) +#define DCM_DepthOfTransverseImage DcmTagKey(0x0022, 0x0041) +#define DCM_MydriaticAgentConcentrationUnitsSequence DcmTagKey(0x0022, 0x0042) +#define DCM_AcrossScanSpatialResolution DcmTagKey(0x0022, 0x0048) +#define DCM_MaximumAcrossScanDistortion DcmTagKey(0x0022, 0x0049) +#define DCM_MydriaticAgentConcentration DcmTagKey(0x0022, 0x004e) +#define DCM_IlluminationWaveLength DcmTagKey(0x0022, 0x0055) +#define DCM_IlluminationPower DcmTagKey(0x0022, 0x0056) +#define DCM_IlluminationBandwidth DcmTagKey(0x0022, 0x0057) +#define DCM_MydriaticAgentSequence DcmTagKey(0x0022, 0x0058) +#define DCM_OphthalmicAxialMeasurementsRightEyeSequence DcmTagKey(0x0022, 0x1007) +#define DCM_OphthalmicAxialMeasurementsLeftEyeSequence DcmTagKey(0x0022, 0x1008) +#define DCM_OphthalmicAxialMeasurementsDeviceType DcmTagKey(0x0022, 0x1009) +#define DCM_OphthalmicAxialLengthMeasurementsType DcmTagKey(0x0022, 0x1010) +#define DCM_OphthalmicAxialLengthSequence DcmTagKey(0x0022, 0x1012) +#define DCM_OphthalmicAxialLength DcmTagKey(0x0022, 0x1019) +#define DCM_LensStatusCodeSequence DcmTagKey(0x0022, 0x1024) +#define DCM_VitreousStatusCodeSequence DcmTagKey(0x0022, 0x1025) +#define DCM_IOLFormulaCodeSequence DcmTagKey(0x0022, 0x1028) +#define DCM_IOLFormulaDetail DcmTagKey(0x0022, 0x1029) +#define DCM_KeratometerIndex DcmTagKey(0x0022, 0x1033) +#define DCM_SourceOfOphthalmicAxialLengthCodeSequence DcmTagKey(0x0022, 0x1035) +#define DCM_SourceOfCornealSizeDataCodeSequence DcmTagKey(0x0022, 0x1036) +#define DCM_TargetRefraction DcmTagKey(0x0022, 0x1037) +#define DCM_RefractiveProcedureOccurred DcmTagKey(0x0022, 0x1039) +#define DCM_RefractiveSurgeryTypeCodeSequence DcmTagKey(0x0022, 0x1040) +#define DCM_OphthalmicUltrasoundMethodCodeSequence DcmTagKey(0x0022, 0x1044) +#define DCM_SurgicallyInducedAstigmatismSequence DcmTagKey(0x0022, 0x1045) +#define DCM_TypeOfOpticalCorrection DcmTagKey(0x0022, 0x1046) +#define DCM_ToricIOLPowerSequence DcmTagKey(0x0022, 0x1047) +#define DCM_PredictedToricErrorSequence DcmTagKey(0x0022, 0x1048) +#define DCM_PreSelectedForImplantation DcmTagKey(0x0022, 0x1049) +#define DCM_ToricIOLPowerForExactEmmetropiaSequence DcmTagKey(0x0022, 0x104a) +#define DCM_ToricIOLPowerForExactTargetRefractionSequence DcmTagKey(0x0022, 0x104b) +#define DCM_OphthalmicAxialLengthMeasurementsSequence DcmTagKey(0x0022, 0x1050) +#define DCM_IOLPower DcmTagKey(0x0022, 0x1053) +#define DCM_PredictedRefractiveError DcmTagKey(0x0022, 0x1054) +#define DCM_OphthalmicAxialLengthVelocity DcmTagKey(0x0022, 0x1059) +#define DCM_LensStatusDescription DcmTagKey(0x0022, 0x1065) +#define DCM_VitreousStatusDescription DcmTagKey(0x0022, 0x1066) +#define DCM_IOLPowerSequence DcmTagKey(0x0022, 0x1090) +#define DCM_LensConstantSequence DcmTagKey(0x0022, 0x1092) +#define DCM_IOLManufacturer DcmTagKey(0x0022, 0x1093) +#define DCM_RETIRED_LensConstantDescription DcmTagKey(0x0022, 0x1094) +#define DCM_ImplantName DcmTagKey(0x0022, 0x1095) +#define DCM_KeratometryMeasurementTypeCodeSequence DcmTagKey(0x0022, 0x1096) +#define DCM_ImplantPartNumber DcmTagKey(0x0022, 0x1097) +#define DCM_ReferencedOphthalmicAxialMeasurementsSequence DcmTagKey(0x0022, 0x1100) +#define DCM_OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence DcmTagKey(0x0022, 0x1101) +#define DCM_RefractiveErrorBeforeRefractiveSurgeryCodeSequence DcmTagKey(0x0022, 0x1103) +#define DCM_IOLPowerForExactEmmetropia DcmTagKey(0x0022, 0x1121) +#define DCM_IOLPowerForExactTargetRefraction DcmTagKey(0x0022, 0x1122) +#define DCM_AnteriorChamberDepthDefinitionCodeSequence DcmTagKey(0x0022, 0x1125) +#define DCM_LensThicknessSequence DcmTagKey(0x0022, 0x1127) +#define DCM_AnteriorChamberDepthSequence DcmTagKey(0x0022, 0x1128) +#define DCM_CalculationCommentSequence DcmTagKey(0x0022, 0x112a) +#define DCM_CalculationCommentType DcmTagKey(0x0022, 0x112b) +#define DCM_CalculationComment DcmTagKey(0x0022, 0x112c) +#define DCM_LensThickness DcmTagKey(0x0022, 0x1130) +#define DCM_AnteriorChamberDepth DcmTagKey(0x0022, 0x1131) +#define DCM_SourceOfLensThicknessDataCodeSequence DcmTagKey(0x0022, 0x1132) +#define DCM_SourceOfAnteriorChamberDepthDataCodeSequence DcmTagKey(0x0022, 0x1133) +#define DCM_SourceOfRefractiveMeasurementsSequence DcmTagKey(0x0022, 0x1134) +#define DCM_SourceOfRefractiveMeasurementsCodeSequence DcmTagKey(0x0022, 0x1135) +#define DCM_OphthalmicAxialLengthMeasurementModified DcmTagKey(0x0022, 0x1140) +#define DCM_OphthalmicAxialLengthDataSourceCodeSequence DcmTagKey(0x0022, 0x1150) +#define DCM_RETIRED_OphthalmicAxialLengthAcquisitionMethodCodeSequence DcmTagKey(0x0022, 0x1153) +#define DCM_SignalToNoiseRatio DcmTagKey(0x0022, 0x1155) +#define DCM_OphthalmicAxialLengthDataSourceDescription DcmTagKey(0x0022, 0x1159) +#define DCM_OphthalmicAxialLengthMeasurementsTotalLengthSequence DcmTagKey(0x0022, 0x1210) +#define DCM_OphthalmicAxialLengthMeasurementsSegmentalLengthSequence DcmTagKey(0x0022, 0x1211) +#define DCM_OphthalmicAxialLengthMeasurementsLengthSummationSequence DcmTagKey(0x0022, 0x1212) +#define DCM_UltrasoundOphthalmicAxialLengthMeasurementsSequence DcmTagKey(0x0022, 0x1220) +#define DCM_OpticalOphthalmicAxialLengthMeasurementsSequence DcmTagKey(0x0022, 0x1225) +#define DCM_UltrasoundSelectedOphthalmicAxialLengthSequence DcmTagKey(0x0022, 0x1230) +#define DCM_OphthalmicAxialLengthSelectionMethodCodeSequence DcmTagKey(0x0022, 0x1250) +#define DCM_OpticalSelectedOphthalmicAxialLengthSequence DcmTagKey(0x0022, 0x1255) +#define DCM_SelectedSegmentalOphthalmicAxialLengthSequence DcmTagKey(0x0022, 0x1257) +#define DCM_SelectedTotalOphthalmicAxialLengthSequence DcmTagKey(0x0022, 0x1260) +#define DCM_OphthalmicAxialLengthQualityMetricSequence DcmTagKey(0x0022, 0x1262) +#define DCM_RETIRED_OphthalmicAxialLengthQualityMetricTypeCodeSequence DcmTagKey(0x0022, 0x1265) +#define DCM_RETIRED_OphthalmicAxialLengthQualityMetricTypeDescription DcmTagKey(0x0022, 0x1273) +#define DCM_IntraocularLensCalculationsRightEyeSequence DcmTagKey(0x0022, 0x1300) +#define DCM_IntraocularLensCalculationsLeftEyeSequence DcmTagKey(0x0022, 0x1310) +#define DCM_ReferencedOphthalmicAxialLengthMeasurementQCImageSequence DcmTagKey(0x0022, 0x1330) +#define DCM_OphthalmicMappingDeviceType DcmTagKey(0x0022, 0x1415) +#define DCM_AcquisitionMethodCodeSequence DcmTagKey(0x0022, 0x1420) +#define DCM_AcquisitionMethodAlgorithmSequence DcmTagKey(0x0022, 0x1423) +#define DCM_OphthalmicThicknessMapTypeCodeSequence DcmTagKey(0x0022, 0x1436) +#define DCM_OphthalmicThicknessMappingNormalsSequence DcmTagKey(0x0022, 0x1443) +#define DCM_RetinalThicknessDefinitionCodeSequence DcmTagKey(0x0022, 0x1445) +#define DCM_PixelValueMappingToCodedConceptSequence DcmTagKey(0x0022, 0x1450) +#define DCM_MappedPixelValue DcmTagKey(0x0022, 0x1452) +#define DCM_PixelValueMappingExplanation DcmTagKey(0x0022, 0x1454) +#define DCM_OphthalmicThicknessMapQualityThresholdSequence DcmTagKey(0x0022, 0x1458) +#define DCM_OphthalmicThicknessMapThresholdQualityRating DcmTagKey(0x0022, 0x1460) +#define DCM_AnatomicStructureReferencePoint DcmTagKey(0x0022, 0x1463) +#define DCM_RegistrationToLocalizerSequence DcmTagKey(0x0022, 0x1465) +#define DCM_RegisteredLocalizerUnits DcmTagKey(0x0022, 0x1466) +#define DCM_RegisteredLocalizerTopLeftHandCorner DcmTagKey(0x0022, 0x1467) +#define DCM_RegisteredLocalizerBottomRightHandCorner DcmTagKey(0x0022, 0x1468) +#define DCM_OphthalmicThicknessMapQualityRatingSequence DcmTagKey(0x0022, 0x1470) +#define DCM_RelevantOPTAttributesSequence DcmTagKey(0x0022, 0x1472) +#define DCM_TransformationMethodCodeSequence DcmTagKey(0x0022, 0x1512) +#define DCM_TransformationAlgorithmSequence DcmTagKey(0x0022, 0x1513) +#define DCM_OphthalmicAxialLengthMethod DcmTagKey(0x0022, 0x1515) +#define DCM_OphthalmicFOV DcmTagKey(0x0022, 0x1517) +#define DCM_TwoDimensionalToThreeDimensionalMapSequence DcmTagKey(0x0022, 0x1518) +#define DCM_WideFieldOphthalmicPhotographyQualityRatingSequence DcmTagKey(0x0022, 0x1525) +#define DCM_WideFieldOphthalmicPhotographyQualityThresholdSequence DcmTagKey(0x0022, 0x1526) +#define DCM_WideFieldOphthalmicPhotographyThresholdQualityRating DcmTagKey(0x0022, 0x1527) +#define DCM_XCoordinatesCenterPixelViewAngle DcmTagKey(0x0022, 0x1528) +#define DCM_YCoordinatesCenterPixelViewAngle DcmTagKey(0x0022, 0x1529) +#define DCM_NumberOfMapPoints DcmTagKey(0x0022, 0x1530) +#define DCM_TwoDimensionalToThreeDimensionalMapData DcmTagKey(0x0022, 0x1531) +#define DCM_DerivationAlgorithmSequence DcmTagKey(0x0022, 0x1612) +#define DCM_OphthalmicImageTypeCodeSequence DcmTagKey(0x0022, 0x1615) +#define DCM_OphthalmicImageTypeDescription DcmTagKey(0x0022, 0x1616) +#define DCM_ScanPatternTypeCodeSequence DcmTagKey(0x0022, 0x1618) +#define DCM_ReferencedSurfaceMeshIdentificationSequence DcmTagKey(0x0022, 0x1620) +#define DCM_OphthalmicVolumetricPropertiesFlag DcmTagKey(0x0022, 0x1622) +#define DCM_OphthalmicAnatomicReferencePointXCoordinate DcmTagKey(0x0022, 0x1624) +#define DCM_OphthalmicAnatomicReferencePointYCoordinate DcmTagKey(0x0022, 0x1626) +#define DCM_OphthalmicEnFaceImageQualityRatingSequence DcmTagKey(0x0022, 0x1628) +#define DCM_QualityThreshold DcmTagKey(0x0022, 0x1630) +#define DCM_OCTBscanAnalysisAcquisitionParametersSequence DcmTagKey(0x0022, 0x1640) +#define DCM_NumberofBscansPerFrame DcmTagKey(0x0022, 0x1642) +#define DCM_BscanSlabThickness DcmTagKey(0x0022, 0x1643) +#define DCM_DistanceBetweenBscanSlabs DcmTagKey(0x0022, 0x1644) +#define DCM_BscanCycleTime DcmTagKey(0x0022, 0x1645) +#define DCM_BscanCycleTimeVector DcmTagKey(0x0022, 0x1646) +#define DCM_AscanRate DcmTagKey(0x0022, 0x1649) +#define DCM_BscanRate DcmTagKey(0x0022, 0x1650) +#define DCM_SurfaceMeshZPixelOffset DcmTagKey(0x0022, 0x1658) +#define DCM_VisualFieldHorizontalExtent DcmTagKey(0x0024, 0x0010) +#define DCM_VisualFieldVerticalExtent DcmTagKey(0x0024, 0x0011) +#define DCM_VisualFieldShape DcmTagKey(0x0024, 0x0012) +#define DCM_ScreeningTestModeCodeSequence DcmTagKey(0x0024, 0x0016) +#define DCM_MaximumStimulusLuminance DcmTagKey(0x0024, 0x0018) +#define DCM_BackgroundLuminance DcmTagKey(0x0024, 0x0020) +#define DCM_StimulusColorCodeSequence DcmTagKey(0x0024, 0x0021) +#define DCM_BackgroundIlluminationColorCodeSequence DcmTagKey(0x0024, 0x0024) +#define DCM_StimulusArea DcmTagKey(0x0024, 0x0025) +#define DCM_StimulusPresentationTime DcmTagKey(0x0024, 0x0028) +#define DCM_FixationSequence DcmTagKey(0x0024, 0x0032) +#define DCM_FixationMonitoringCodeSequence DcmTagKey(0x0024, 0x0033) +#define DCM_VisualFieldCatchTrialSequence DcmTagKey(0x0024, 0x0034) +#define DCM_FixationCheckedQuantity DcmTagKey(0x0024, 0x0035) +#define DCM_PatientNotProperlyFixatedQuantity DcmTagKey(0x0024, 0x0036) +#define DCM_PresentedVisualStimuliDataFlag DcmTagKey(0x0024, 0x0037) +#define DCM_NumberOfVisualStimuli DcmTagKey(0x0024, 0x0038) +#define DCM_ExcessiveFixationLossesDataFlag DcmTagKey(0x0024, 0x0039) +#define DCM_ExcessiveFixationLosses DcmTagKey(0x0024, 0x0040) +#define DCM_StimuliRetestingQuantity DcmTagKey(0x0024, 0x0042) +#define DCM_CommentsOnPatientPerformanceOfVisualField DcmTagKey(0x0024, 0x0044) +#define DCM_FalseNegativesEstimateFlag DcmTagKey(0x0024, 0x0045) +#define DCM_FalseNegativesEstimate DcmTagKey(0x0024, 0x0046) +#define DCM_NegativeCatchTrialsQuantity DcmTagKey(0x0024, 0x0048) +#define DCM_FalseNegativesQuantity DcmTagKey(0x0024, 0x0050) +#define DCM_ExcessiveFalseNegativesDataFlag DcmTagKey(0x0024, 0x0051) +#define DCM_ExcessiveFalseNegatives DcmTagKey(0x0024, 0x0052) +#define DCM_FalsePositivesEstimateFlag DcmTagKey(0x0024, 0x0053) +#define DCM_FalsePositivesEstimate DcmTagKey(0x0024, 0x0054) +#define DCM_CatchTrialsDataFlag DcmTagKey(0x0024, 0x0055) +#define DCM_PositiveCatchTrialsQuantity DcmTagKey(0x0024, 0x0056) +#define DCM_TestPointNormalsDataFlag DcmTagKey(0x0024, 0x0057) +#define DCM_TestPointNormalsSequence DcmTagKey(0x0024, 0x0058) +#define DCM_GlobalDeviationProbabilityNormalsFlag DcmTagKey(0x0024, 0x0059) +#define DCM_FalsePositivesQuantity DcmTagKey(0x0024, 0x0060) +#define DCM_ExcessiveFalsePositivesDataFlag DcmTagKey(0x0024, 0x0061) +#define DCM_ExcessiveFalsePositives DcmTagKey(0x0024, 0x0062) +#define DCM_VisualFieldTestNormalsFlag DcmTagKey(0x0024, 0x0063) +#define DCM_ResultsNormalsSequence DcmTagKey(0x0024, 0x0064) +#define DCM_AgeCorrectedSensitivityDeviationAlgorithmSequence DcmTagKey(0x0024, 0x0065) +#define DCM_GlobalDeviationFromNormal DcmTagKey(0x0024, 0x0066) +#define DCM_GeneralizedDefectSensitivityDeviationAlgorithmSequence DcmTagKey(0x0024, 0x0067) +#define DCM_LocalizedDeviationFromNormal DcmTagKey(0x0024, 0x0068) +#define DCM_PatientReliabilityIndicator DcmTagKey(0x0024, 0x0069) +#define DCM_VisualFieldMeanSensitivity DcmTagKey(0x0024, 0x0070) +#define DCM_GlobalDeviationProbability DcmTagKey(0x0024, 0x0071) +#define DCM_LocalDeviationProbabilityNormalsFlag DcmTagKey(0x0024, 0x0072) +#define DCM_LocalizedDeviationProbability DcmTagKey(0x0024, 0x0073) +#define DCM_ShortTermFluctuationCalculated DcmTagKey(0x0024, 0x0074) +#define DCM_ShortTermFluctuation DcmTagKey(0x0024, 0x0075) +#define DCM_ShortTermFluctuationProbabilityCalculated DcmTagKey(0x0024, 0x0076) +#define DCM_ShortTermFluctuationProbability DcmTagKey(0x0024, 0x0077) +#define DCM_CorrectedLocalizedDeviationFromNormalCalculated DcmTagKey(0x0024, 0x0078) +#define DCM_CorrectedLocalizedDeviationFromNormal DcmTagKey(0x0024, 0x0079) +#define DCM_CorrectedLocalizedDeviationFromNormalProbabilityCalculated DcmTagKey(0x0024, 0x0080) +#define DCM_CorrectedLocalizedDeviationFromNormalProbability DcmTagKey(0x0024, 0x0081) +#define DCM_GlobalDeviationProbabilitySequence DcmTagKey(0x0024, 0x0083) +#define DCM_LocalizedDeviationProbabilitySequence DcmTagKey(0x0024, 0x0085) +#define DCM_FovealSensitivityMeasured DcmTagKey(0x0024, 0x0086) +#define DCM_FovealSensitivity DcmTagKey(0x0024, 0x0087) +#define DCM_VisualFieldTestDuration DcmTagKey(0x0024, 0x0088) +#define DCM_VisualFieldTestPointSequence DcmTagKey(0x0024, 0x0089) +#define DCM_VisualFieldTestPointXCoordinate DcmTagKey(0x0024, 0x0090) +#define DCM_VisualFieldTestPointYCoordinate DcmTagKey(0x0024, 0x0091) +#define DCM_AgeCorrectedSensitivityDeviationValue DcmTagKey(0x0024, 0x0092) +#define DCM_StimulusResults DcmTagKey(0x0024, 0x0093) +#define DCM_SensitivityValue DcmTagKey(0x0024, 0x0094) +#define DCM_RetestStimulusSeen DcmTagKey(0x0024, 0x0095) +#define DCM_RetestSensitivityValue DcmTagKey(0x0024, 0x0096) +#define DCM_VisualFieldTestPointNormalsSequence DcmTagKey(0x0024, 0x0097) +#define DCM_QuantifiedDefect DcmTagKey(0x0024, 0x0098) +#define DCM_AgeCorrectedSensitivityDeviationProbabilityValue DcmTagKey(0x0024, 0x0100) +#define DCM_GeneralizedDefectCorrectedSensitivityDeviationFlag DcmTagKey(0x0024, 0x0102) +#define DCM_GeneralizedDefectCorrectedSensitivityDeviationValue DcmTagKey(0x0024, 0x0103) +#define DCM_GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue DcmTagKey(0x0024, 0x0104) +#define DCM_MinimumSensitivityValue DcmTagKey(0x0024, 0x0105) +#define DCM_BlindSpotLocalized DcmTagKey(0x0024, 0x0106) +#define DCM_BlindSpotXCoordinate DcmTagKey(0x0024, 0x0107) +#define DCM_BlindSpotYCoordinate DcmTagKey(0x0024, 0x0108) +#define DCM_VisualAcuityMeasurementSequence DcmTagKey(0x0024, 0x0110) +#define DCM_RefractiveParametersUsedOnPatientSequence DcmTagKey(0x0024, 0x0112) +#define DCM_MeasurementLaterality DcmTagKey(0x0024, 0x0113) +#define DCM_OphthalmicPatientClinicalInformationLeftEyeSequence DcmTagKey(0x0024, 0x0114) +#define DCM_OphthalmicPatientClinicalInformationRightEyeSequence DcmTagKey(0x0024, 0x0115) +#define DCM_FovealPointNormativeDataFlag DcmTagKey(0x0024, 0x0117) +#define DCM_FovealPointProbabilityValue DcmTagKey(0x0024, 0x0118) +#define DCM_ScreeningBaselineMeasured DcmTagKey(0x0024, 0x0120) +#define DCM_ScreeningBaselineMeasuredSequence DcmTagKey(0x0024, 0x0122) +#define DCM_ScreeningBaselineType DcmTagKey(0x0024, 0x0124) +#define DCM_ScreeningBaselineValue DcmTagKey(0x0024, 0x0126) +#define DCM_AlgorithmSource DcmTagKey(0x0024, 0x0202) +#define DCM_DataSetName DcmTagKey(0x0024, 0x0306) +#define DCM_DataSetVersion DcmTagKey(0x0024, 0x0307) +#define DCM_DataSetSource DcmTagKey(0x0024, 0x0308) +#define DCM_DataSetDescription DcmTagKey(0x0024, 0x0309) +#define DCM_VisualFieldTestReliabilityGlobalIndexSequence DcmTagKey(0x0024, 0x0317) +#define DCM_VisualFieldGlobalResultsIndexSequence DcmTagKey(0x0024, 0x0320) +#define DCM_DataObservationSequence DcmTagKey(0x0024, 0x0325) +#define DCM_IndexNormalsFlag DcmTagKey(0x0024, 0x0338) +#define DCM_IndexProbability DcmTagKey(0x0024, 0x0341) +#define DCM_IndexProbabilitySequence DcmTagKey(0x0024, 0x0344) +#define DCM_SamplesPerPixel DcmTagKey(0x0028, 0x0002) +#define DCM_SamplesPerPixelUsed DcmTagKey(0x0028, 0x0003) +#define DCM_PhotometricInterpretation DcmTagKey(0x0028, 0x0004) +#define DCM_RETIRED_ImageDimensions DcmTagKey(0x0028, 0x0005) +#define DCM_PlanarConfiguration DcmTagKey(0x0028, 0x0006) +#define DCM_NumberOfFrames DcmTagKey(0x0028, 0x0008) +#define DCM_FrameIncrementPointer DcmTagKey(0x0028, 0x0009) +#define DCM_FrameDimensionPointer DcmTagKey(0x0028, 0x000a) +#define DCM_Rows DcmTagKey(0x0028, 0x0010) +#define DCM_Columns DcmTagKey(0x0028, 0x0011) +#define DCM_RETIRED_Planes DcmTagKey(0x0028, 0x0012) +#define DCM_UltrasoundColorDataPresent DcmTagKey(0x0028, 0x0014) +#define DCM_PixelSpacing DcmTagKey(0x0028, 0x0030) +#define DCM_ZoomFactor DcmTagKey(0x0028, 0x0031) +#define DCM_ZoomCenter DcmTagKey(0x0028, 0x0032) +#define DCM_PixelAspectRatio DcmTagKey(0x0028, 0x0034) +#define DCM_RETIRED_ImageFormat DcmTagKey(0x0028, 0x0040) +#define DCM_RETIRED_ManipulatedImage DcmTagKey(0x0028, 0x0050) +#define DCM_CorrectedImage DcmTagKey(0x0028, 0x0051) +#define DCM_RETIRED_CompressionRecognitionCode DcmTagKey(0x0028, 0x005f) +#define DCM_RETIRED_CompressionCode DcmTagKey(0x0028, 0x0060) +#define DCM_RETIRED_CompressionOriginator DcmTagKey(0x0028, 0x0061) +#define DCM_RETIRED_CompressionLabel DcmTagKey(0x0028, 0x0062) +#define DCM_RETIRED_CompressionDescription DcmTagKey(0x0028, 0x0063) +#define DCM_RETIRED_CompressionSequence DcmTagKey(0x0028, 0x0065) +#define DCM_RETIRED_CompressionStepPointers DcmTagKey(0x0028, 0x0066) +#define DCM_RETIRED_RepeatInterval DcmTagKey(0x0028, 0x0068) +#define DCM_RETIRED_BitsGrouped DcmTagKey(0x0028, 0x0069) +#define DCM_RETIRED_PerimeterTable DcmTagKey(0x0028, 0x0070) +#define DCM_RETIRED_PerimeterValue DcmTagKey(0x0028, 0x0071) +#define DCM_RETIRED_PredictorRows DcmTagKey(0x0028, 0x0080) +#define DCM_RETIRED_PredictorColumns DcmTagKey(0x0028, 0x0081) +#define DCM_RETIRED_PredictorConstants DcmTagKey(0x0028, 0x0082) +#define DCM_RETIRED_BlockedPixels DcmTagKey(0x0028, 0x0090) +#define DCM_RETIRED_BlockRows DcmTagKey(0x0028, 0x0091) +#define DCM_RETIRED_BlockColumns DcmTagKey(0x0028, 0x0092) +#define DCM_RETIRED_RowOverlap DcmTagKey(0x0028, 0x0093) +#define DCM_RETIRED_ColumnOverlap DcmTagKey(0x0028, 0x0094) +#define DCM_BitsAllocated DcmTagKey(0x0028, 0x0100) +#define DCM_BitsStored DcmTagKey(0x0028, 0x0101) +#define DCM_HighBit DcmTagKey(0x0028, 0x0102) +#define DCM_PixelRepresentation DcmTagKey(0x0028, 0x0103) +#define DCM_RETIRED_SmallestValidPixelValue DcmTagKey(0x0028, 0x0104) +#define DCM_RETIRED_LargestValidPixelValue DcmTagKey(0x0028, 0x0105) +#define DCM_SmallestImagePixelValue DcmTagKey(0x0028, 0x0106) +#define DCM_LargestImagePixelValue DcmTagKey(0x0028, 0x0107) +#define DCM_SmallestPixelValueInSeries DcmTagKey(0x0028, 0x0108) +#define DCM_LargestPixelValueInSeries DcmTagKey(0x0028, 0x0109) +#define DCM_RETIRED_SmallestImagePixelValueInPlane DcmTagKey(0x0028, 0x0110) +#define DCM_RETIRED_LargestImagePixelValueInPlane DcmTagKey(0x0028, 0x0111) +#define DCM_PixelPaddingValue DcmTagKey(0x0028, 0x0120) +#define DCM_PixelPaddingRangeLimit DcmTagKey(0x0028, 0x0121) +#define DCM_FloatPixelPaddingValue DcmTagKey(0x0028, 0x0122) +#define DCM_DoubleFloatPixelPaddingValue DcmTagKey(0x0028, 0x0123) +#define DCM_FloatPixelPaddingRangeLimit DcmTagKey(0x0028, 0x0124) +#define DCM_DoubleFloatPixelPaddingRangeLimit DcmTagKey(0x0028, 0x0125) +#define DCM_RETIRED_ImageLocation DcmTagKey(0x0028, 0x0200) +#define DCM_QualityControlImage DcmTagKey(0x0028, 0x0300) +#define DCM_BurnedInAnnotation DcmTagKey(0x0028, 0x0301) +#define DCM_RecognizableVisualFeatures DcmTagKey(0x0028, 0x0302) +#define DCM_LongitudinalTemporalInformationModified DcmTagKey(0x0028, 0x0303) +#define DCM_ReferencedColorPaletteInstanceUID DcmTagKey(0x0028, 0x0304) +#define DCM_RETIRED_TransformLabel DcmTagKey(0x0028, 0x0400) +#define DCM_RETIRED_TransformVersionNumber DcmTagKey(0x0028, 0x0401) +#define DCM_RETIRED_NumberOfTransformSteps DcmTagKey(0x0028, 0x0402) +#define DCM_RETIRED_SequenceOfCompressedData DcmTagKey(0x0028, 0x0403) +#define DCM_RETIRED_DetailsOfCoefficients DcmTagKey(0x0028, 0x0404) +#define DCM_RETIRED_RowsForNthOrderCoefficients DcmTagKey(0x0028, 0x0410) +#define DCM_RETIRED_ColumnsForNthOrderCoefficients DcmTagKey(0x0028, 0x0411) +#define DCM_RETIRED_CoefficientCoding DcmTagKey(0x0028, 0x0412) +#define DCM_RETIRED_CoefficientCodingPointers DcmTagKey(0x0028, 0x0413) +#define DCM_RETIRED_DCTLabel DcmTagKey(0x0028, 0x0700) +#define DCM_RETIRED_DataBlockDescription DcmTagKey(0x0028, 0x0701) +#define DCM_RETIRED_DataBlock DcmTagKey(0x0028, 0x0702) +#define DCM_RETIRED_NormalizationFactorFormat DcmTagKey(0x0028, 0x0710) +#define DCM_RETIRED_ZonalMapNumberFormat DcmTagKey(0x0028, 0x0720) +#define DCM_RETIRED_ZonalMapLocation DcmTagKey(0x0028, 0x0721) +#define DCM_RETIRED_ZonalMapFormat DcmTagKey(0x0028, 0x0722) +#define DCM_RETIRED_AdaptiveMapFormat DcmTagKey(0x0028, 0x0730) +#define DCM_RETIRED_CodeNumberFormat DcmTagKey(0x0028, 0x0740) +#define DCM_RETIRED_CodeLabel DcmTagKey(0x0028, 0x0800) +#define DCM_RETIRED_NumberOfTables DcmTagKey(0x0028, 0x0802) +#define DCM_RETIRED_CodeTableLocation DcmTagKey(0x0028, 0x0803) +#define DCM_RETIRED_BitsForCodeWord DcmTagKey(0x0028, 0x0804) +#define DCM_RETIRED_ImageDataLocation DcmTagKey(0x0028, 0x0808) +#define DCM_PixelSpacingCalibrationType DcmTagKey(0x0028, 0x0a02) +#define DCM_PixelSpacingCalibrationDescription DcmTagKey(0x0028, 0x0a04) +#define DCM_PixelIntensityRelationship DcmTagKey(0x0028, 0x1040) +#define DCM_PixelIntensityRelationshipSign DcmTagKey(0x0028, 0x1041) +#define DCM_WindowCenter DcmTagKey(0x0028, 0x1050) +#define DCM_WindowWidth DcmTagKey(0x0028, 0x1051) +#define DCM_RescaleIntercept DcmTagKey(0x0028, 0x1052) +#define DCM_RescaleSlope DcmTagKey(0x0028, 0x1053) +#define DCM_RescaleType DcmTagKey(0x0028, 0x1054) +#define DCM_WindowCenterWidthExplanation DcmTagKey(0x0028, 0x1055) +#define DCM_VOILUTFunction DcmTagKey(0x0028, 0x1056) +#define DCM_RETIRED_GrayScale DcmTagKey(0x0028, 0x1080) +#define DCM_RecommendedViewingMode DcmTagKey(0x0028, 0x1090) +#define DCM_RETIRED_GrayLookupTableDescriptor DcmTagKey(0x0028, 0x1100) +#define DCM_RedPaletteColorLookupTableDescriptor DcmTagKey(0x0028, 0x1101) +#define DCM_GreenPaletteColorLookupTableDescriptor DcmTagKey(0x0028, 0x1102) +#define DCM_BluePaletteColorLookupTableDescriptor DcmTagKey(0x0028, 0x1103) +#define DCM_AlphaPaletteColorLookupTableDescriptor DcmTagKey(0x0028, 0x1104) +#define DCM_RETIRED_LargeRedPaletteColorLookupTableDescriptor DcmTagKey(0x0028, 0x1111) +#define DCM_RETIRED_LargeGreenPaletteColorLookupTableDescriptor DcmTagKey(0x0028, 0x1112) +#define DCM_RETIRED_LargeBluePaletteColorLookupTableDescriptor DcmTagKey(0x0028, 0x1113) +#define DCM_PaletteColorLookupTableUID DcmTagKey(0x0028, 0x1199) +#define DCM_RETIRED_GrayLookupTableData DcmTagKey(0x0028, 0x1200) +#define DCM_RedPaletteColorLookupTableData DcmTagKey(0x0028, 0x1201) +#define DCM_GreenPaletteColorLookupTableData DcmTagKey(0x0028, 0x1202) +#define DCM_BluePaletteColorLookupTableData DcmTagKey(0x0028, 0x1203) +#define DCM_AlphaPaletteColorLookupTableData DcmTagKey(0x0028, 0x1204) +#define DCM_RETIRED_LargeRedPaletteColorLookupTableData DcmTagKey(0x0028, 0x1211) +#define DCM_RETIRED_LargeGreenPaletteColorLookupTableData DcmTagKey(0x0028, 0x1212) +#define DCM_RETIRED_LargeBluePaletteColorLookupTableData DcmTagKey(0x0028, 0x1213) +#define DCM_RETIRED_LargePaletteColorLookupTableUID DcmTagKey(0x0028, 0x1214) +#define DCM_SegmentedRedPaletteColorLookupTableData DcmTagKey(0x0028, 0x1221) +#define DCM_SegmentedGreenPaletteColorLookupTableData DcmTagKey(0x0028, 0x1222) +#define DCM_SegmentedBluePaletteColorLookupTableData DcmTagKey(0x0028, 0x1223) +#define DCM_SegmentedAlphaPaletteColorLookupTableData DcmTagKey(0x0028, 0x1224) +#define DCM_StoredValueColorRangeSequence DcmTagKey(0x0028, 0x1230) +#define DCM_MinimumStoredValueMapped DcmTagKey(0x0028, 0x1231) +#define DCM_MaximumStoredValueMapped DcmTagKey(0x0028, 0x1232) +#define DCM_BreastImplantPresent DcmTagKey(0x0028, 0x1300) +#define DCM_PartialView DcmTagKey(0x0028, 0x1350) +#define DCM_PartialViewDescription DcmTagKey(0x0028, 0x1351) +#define DCM_PartialViewCodeSequence DcmTagKey(0x0028, 0x1352) +#define DCM_SpatialLocationsPreserved DcmTagKey(0x0028, 0x135a) +#define DCM_DataFrameAssignmentSequence DcmTagKey(0x0028, 0x1401) +#define DCM_DataPathAssignment DcmTagKey(0x0028, 0x1402) +#define DCM_BitsMappedToColorLookupTable DcmTagKey(0x0028, 0x1403) +#define DCM_BlendingLUT1Sequence DcmTagKey(0x0028, 0x1404) +#define DCM_BlendingLUT1TransferFunction DcmTagKey(0x0028, 0x1405) +#define DCM_BlendingWeightConstant DcmTagKey(0x0028, 0x1406) +#define DCM_BlendingLookupTableDescriptor DcmTagKey(0x0028, 0x1407) +#define DCM_BlendingLookupTableData DcmTagKey(0x0028, 0x1408) +#define DCM_EnhancedPaletteColorLookupTableSequence DcmTagKey(0x0028, 0x140b) +#define DCM_BlendingLUT2Sequence DcmTagKey(0x0028, 0x140c) +#define DCM_BlendingLUT2TransferFunction DcmTagKey(0x0028, 0x140d) +#define DCM_DataPathID DcmTagKey(0x0028, 0x140e) +#define DCM_RGBLUTTransferFunction DcmTagKey(0x0028, 0x140f) +#define DCM_AlphaLUTTransferFunction DcmTagKey(0x0028, 0x1410) +#define DCM_ICCProfile DcmTagKey(0x0028, 0x2000) +#define DCM_ColorSpace DcmTagKey(0x0028, 0x2002) +#define DCM_LossyImageCompression DcmTagKey(0x0028, 0x2110) +#define DCM_LossyImageCompressionRatio DcmTagKey(0x0028, 0x2112) +#define DCM_LossyImageCompressionMethod DcmTagKey(0x0028, 0x2114) +#define DCM_ModalityLUTSequence DcmTagKey(0x0028, 0x3000) +#define DCM_LUTDescriptor DcmTagKey(0x0028, 0x3002) +#define DCM_LUTExplanation DcmTagKey(0x0028, 0x3003) +#define DCM_ModalityLUTType DcmTagKey(0x0028, 0x3004) +#define DCM_LUTData DcmTagKey(0x0028, 0x3006) +#define DCM_VOILUTSequence DcmTagKey(0x0028, 0x3010) +#define DCM_SoftcopyVOILUTSequence DcmTagKey(0x0028, 0x3110) +#define DCM_RETIRED_ImagePresentationComments DcmTagKey(0x0028, 0x4000) +#define DCM_RETIRED_BiPlaneAcquisitionSequence DcmTagKey(0x0028, 0x5000) +#define DCM_RepresentativeFrameNumber DcmTagKey(0x0028, 0x6010) +#define DCM_FrameNumbersOfInterest DcmTagKey(0x0028, 0x6020) +#define DCM_FrameOfInterestDescription DcmTagKey(0x0028, 0x6022) +#define DCM_FrameOfInterestType DcmTagKey(0x0028, 0x6023) +#define DCM_RETIRED_MaskPointers DcmTagKey(0x0028, 0x6030) +#define DCM_RWavePointer DcmTagKey(0x0028, 0x6040) +#define DCM_MaskSubtractionSequence DcmTagKey(0x0028, 0x6100) +#define DCM_MaskOperation DcmTagKey(0x0028, 0x6101) +#define DCM_ApplicableFrameRange DcmTagKey(0x0028, 0x6102) +#define DCM_MaskFrameNumbers DcmTagKey(0x0028, 0x6110) +#define DCM_ContrastFrameAveraging DcmTagKey(0x0028, 0x6112) +#define DCM_MaskSubPixelShift DcmTagKey(0x0028, 0x6114) +#define DCM_TIDOffset DcmTagKey(0x0028, 0x6120) +#define DCM_MaskOperationExplanation DcmTagKey(0x0028, 0x6190) +#define DCM_EquipmentAdministratorSequence DcmTagKey(0x0028, 0x7000) +#define DCM_NumberOfDisplaySubsystems DcmTagKey(0x0028, 0x7001) +#define DCM_CurrentConfigurationID DcmTagKey(0x0028, 0x7002) +#define DCM_DisplaySubsystemID DcmTagKey(0x0028, 0x7003) +#define DCM_DisplaySubsystemName DcmTagKey(0x0028, 0x7004) +#define DCM_DisplaySubsystemDescription DcmTagKey(0x0028, 0x7005) +#define DCM_SystemStatus DcmTagKey(0x0028, 0x7006) +#define DCM_SystemStatusComment DcmTagKey(0x0028, 0x7007) +#define DCM_TargetLuminanceCharacteristicsSequence DcmTagKey(0x0028, 0x7008) +#define DCM_LuminanceCharacteristicsID DcmTagKey(0x0028, 0x7009) +#define DCM_DisplaySubsystemConfigurationSequence DcmTagKey(0x0028, 0x700a) +#define DCM_ConfigurationID DcmTagKey(0x0028, 0x700b) +#define DCM_ConfigurationName DcmTagKey(0x0028, 0x700c) +#define DCM_ConfigurationDescription DcmTagKey(0x0028, 0x700d) +#define DCM_ReferencedTargetLuminanceCharacteristicsID DcmTagKey(0x0028, 0x700e) +#define DCM_QAResultsSequence DcmTagKey(0x0028, 0x700f) +#define DCM_DisplaySubsystemQAResultsSequence DcmTagKey(0x0028, 0x7010) +#define DCM_ConfigurationQAResultsSequence DcmTagKey(0x0028, 0x7011) +#define DCM_MeasurementEquipmentSequence DcmTagKey(0x0028, 0x7012) +#define DCM_MeasurementFunctions DcmTagKey(0x0028, 0x7013) +#define DCM_MeasurementEquipmentType DcmTagKey(0x0028, 0x7014) +#define DCM_VisualEvaluationResultSequence DcmTagKey(0x0028, 0x7015) +#define DCM_DisplayCalibrationResultSequence DcmTagKey(0x0028, 0x7016) +#define DCM_DDLValue DcmTagKey(0x0028, 0x7017) +#define DCM_CIExyWhitePoint DcmTagKey(0x0028, 0x7018) +#define DCM_DisplayFunctionType DcmTagKey(0x0028, 0x7019) +#define DCM_GammaValue DcmTagKey(0x0028, 0x701a) +#define DCM_NumberOfLuminancePoints DcmTagKey(0x0028, 0x701b) +#define DCM_LuminanceResponseSequence DcmTagKey(0x0028, 0x701c) +#define DCM_TargetMinimumLuminance DcmTagKey(0x0028, 0x701d) +#define DCM_TargetMaximumLuminance DcmTagKey(0x0028, 0x701e) +#define DCM_LuminanceValue DcmTagKey(0x0028, 0x701f) +#define DCM_LuminanceResponseDescription DcmTagKey(0x0028, 0x7020) +#define DCM_WhitePointFlag DcmTagKey(0x0028, 0x7021) +#define DCM_DisplayDeviceTypeCodeSequence DcmTagKey(0x0028, 0x7022) +#define DCM_DisplaySubsystemSequence DcmTagKey(0x0028, 0x7023) +#define DCM_LuminanceResultSequence DcmTagKey(0x0028, 0x7024) +#define DCM_AmbientLightValueSource DcmTagKey(0x0028, 0x7025) +#define DCM_MeasuredCharacteristics DcmTagKey(0x0028, 0x7026) +#define DCM_LuminanceUniformityResultSequence DcmTagKey(0x0028, 0x7027) +#define DCM_VisualEvaluationTestSequence DcmTagKey(0x0028, 0x7028) +#define DCM_TestResult DcmTagKey(0x0028, 0x7029) +#define DCM_TestResultComment DcmTagKey(0x0028, 0x702a) +#define DCM_TestImageValidation DcmTagKey(0x0028, 0x702b) +#define DCM_TestPatternCodeSequence DcmTagKey(0x0028, 0x702c) +#define DCM_MeasurementPatternCodeSequence DcmTagKey(0x0028, 0x702d) +#define DCM_VisualEvaluationMethodCodeSequence DcmTagKey(0x0028, 0x702e) +#define DCM_PixelDataProviderURL DcmTagKey(0x0028, 0x7fe0) +#define DCM_DataPointRows DcmTagKey(0x0028, 0x9001) +#define DCM_DataPointColumns DcmTagKey(0x0028, 0x9002) +#define DCM_SignalDomainColumns DcmTagKey(0x0028, 0x9003) +#define DCM_RETIRED_LargestMonochromePixelValue DcmTagKey(0x0028, 0x9099) +#define DCM_DataRepresentation DcmTagKey(0x0028, 0x9108) +#define DCM_PixelMeasuresSequence DcmTagKey(0x0028, 0x9110) +#define DCM_FrameVOILUTSequence DcmTagKey(0x0028, 0x9132) +#define DCM_PixelValueTransformationSequence DcmTagKey(0x0028, 0x9145) +#define DCM_SignalDomainRows DcmTagKey(0x0028, 0x9235) +#define DCM_DisplayFilterPercentage DcmTagKey(0x0028, 0x9411) +#define DCM_FramePixelShiftSequence DcmTagKey(0x0028, 0x9415) +#define DCM_SubtractionItemID DcmTagKey(0x0028, 0x9416) +#define DCM_PixelIntensityRelationshipLUTSequence DcmTagKey(0x0028, 0x9422) +#define DCM_FramePixelDataPropertiesSequence DcmTagKey(0x0028, 0x9443) +#define DCM_GeometricalProperties DcmTagKey(0x0028, 0x9444) +#define DCM_GeometricMaximumDistortion DcmTagKey(0x0028, 0x9445) +#define DCM_ImageProcessingApplied DcmTagKey(0x0028, 0x9446) +#define DCM_MaskSelectionMode DcmTagKey(0x0028, 0x9454) +#define DCM_LUTFunction DcmTagKey(0x0028, 0x9474) +#define DCM_MaskVisibilityPercentage DcmTagKey(0x0028, 0x9478) +#define DCM_PixelShiftSequence DcmTagKey(0x0028, 0x9501) +#define DCM_RegionPixelShiftSequence DcmTagKey(0x0028, 0x9502) +#define DCM_VerticesOfTheRegion DcmTagKey(0x0028, 0x9503) +#define DCM_MultiFramePresentationSequence DcmTagKey(0x0028, 0x9505) +#define DCM_PixelShiftFrameRange DcmTagKey(0x0028, 0x9506) +#define DCM_LUTFrameRange DcmTagKey(0x0028, 0x9507) +#define DCM_ImageToEquipmentMappingMatrix DcmTagKey(0x0028, 0x9520) +#define DCM_EquipmentCoordinateSystemIdentification DcmTagKey(0x0028, 0x9537) +#define DCM_RETIRED_StudyStatusID DcmTagKey(0x0032, 0x000a) +#define DCM_RETIRED_StudyPriorityID DcmTagKey(0x0032, 0x000c) +#define DCM_RETIRED_StudyIDIssuer DcmTagKey(0x0032, 0x0012) +#define DCM_RETIRED_StudyVerifiedDate DcmTagKey(0x0032, 0x0032) +#define DCM_RETIRED_StudyVerifiedTime DcmTagKey(0x0032, 0x0033) +#define DCM_RETIRED_StudyReadDate DcmTagKey(0x0032, 0x0034) +#define DCM_RETIRED_StudyReadTime DcmTagKey(0x0032, 0x0035) +#define DCM_RETIRED_ScheduledStudyStartDate DcmTagKey(0x0032, 0x1000) +#define DCM_RETIRED_ScheduledStudyStartTime DcmTagKey(0x0032, 0x1001) +#define DCM_RETIRED_ScheduledStudyStopDate DcmTagKey(0x0032, 0x1010) +#define DCM_RETIRED_ScheduledStudyStopTime DcmTagKey(0x0032, 0x1011) +#define DCM_RETIRED_ScheduledStudyLocation DcmTagKey(0x0032, 0x1020) +#define DCM_RETIRED_ScheduledStudyLocationAETitle DcmTagKey(0x0032, 0x1021) +#define DCM_RETIRED_ReasonForStudy DcmTagKey(0x0032, 0x1030) +#define DCM_RequestingPhysicianIdentificationSequence DcmTagKey(0x0032, 0x1031) +#define DCM_RequestingPhysician DcmTagKey(0x0032, 0x1032) +#define DCM_RequestingService DcmTagKey(0x0032, 0x1033) +#define DCM_RequestingServiceCodeSequence DcmTagKey(0x0032, 0x1034) +#define DCM_RETIRED_StudyArrivalDate DcmTagKey(0x0032, 0x1040) +#define DCM_RETIRED_StudyArrivalTime DcmTagKey(0x0032, 0x1041) +#define DCM_RETIRED_StudyCompletionDate DcmTagKey(0x0032, 0x1050) +#define DCM_RETIRED_StudyCompletionTime DcmTagKey(0x0032, 0x1051) +#define DCM_RETIRED_StudyComponentStatusID DcmTagKey(0x0032, 0x1055) +#define DCM_RequestedProcedureDescription DcmTagKey(0x0032, 0x1060) +#define DCM_RequestedProcedureCodeSequence DcmTagKey(0x0032, 0x1064) +#define DCM_ReasonForVisit DcmTagKey(0x0032, 0x1066) +#define DCM_ReasonForVisitCodeSequence DcmTagKey(0x0032, 0x1067) +#define DCM_RequestedContrastAgent DcmTagKey(0x0032, 0x1070) +#define DCM_RETIRED_StudyComments DcmTagKey(0x0032, 0x4000) +#define DCM_ReferencedPatientAliasSequence DcmTagKey(0x0038, 0x0004) +#define DCM_VisitStatusID DcmTagKey(0x0038, 0x0008) +#define DCM_AdmissionID DcmTagKey(0x0038, 0x0010) +#define DCM_RETIRED_IssuerOfAdmissionID DcmTagKey(0x0038, 0x0011) +#define DCM_IssuerOfAdmissionIDSequence DcmTagKey(0x0038, 0x0014) +#define DCM_RouteOfAdmissions DcmTagKey(0x0038, 0x0016) +#define DCM_RETIRED_ScheduledAdmissionDate DcmTagKey(0x0038, 0x001a) +#define DCM_RETIRED_ScheduledAdmissionTime DcmTagKey(0x0038, 0x001b) +#define DCM_RETIRED_ScheduledDischargeDate DcmTagKey(0x0038, 0x001c) +#define DCM_RETIRED_ScheduledDischargeTime DcmTagKey(0x0038, 0x001d) +#define DCM_RETIRED_ScheduledPatientInstitutionResidence DcmTagKey(0x0038, 0x001e) +#define DCM_AdmittingDate DcmTagKey(0x0038, 0x0020) +#define DCM_AdmittingTime DcmTagKey(0x0038, 0x0021) +#define DCM_RETIRED_DischargeDate DcmTagKey(0x0038, 0x0030) +#define DCM_RETIRED_DischargeTime DcmTagKey(0x0038, 0x0032) +#define DCM_RETIRED_DischargeDiagnosisDescription DcmTagKey(0x0038, 0x0040) +#define DCM_RETIRED_DischargeDiagnosisCodeSequence DcmTagKey(0x0038, 0x0044) +#define DCM_SpecialNeeds DcmTagKey(0x0038, 0x0050) +#define DCM_ServiceEpisodeID DcmTagKey(0x0038, 0x0060) +#define DCM_RETIRED_IssuerOfServiceEpisodeID DcmTagKey(0x0038, 0x0061) +#define DCM_ServiceEpisodeDescription DcmTagKey(0x0038, 0x0062) +#define DCM_IssuerOfServiceEpisodeIDSequence DcmTagKey(0x0038, 0x0064) +#define DCM_PertinentDocumentsSequence DcmTagKey(0x0038, 0x0100) +#define DCM_PertinentResourcesSequence DcmTagKey(0x0038, 0x0101) +#define DCM_ResourceDescription DcmTagKey(0x0038, 0x0102) +#define DCM_CurrentPatientLocation DcmTagKey(0x0038, 0x0300) +#define DCM_PatientInstitutionResidence DcmTagKey(0x0038, 0x0400) +#define DCM_PatientState DcmTagKey(0x0038, 0x0500) +#define DCM_PatientClinicalTrialParticipationSequence DcmTagKey(0x0038, 0x0502) +#define DCM_VisitComments DcmTagKey(0x0038, 0x4000) +#define DCM_WaveformOriginality DcmTagKey(0x003a, 0x0004) +#define DCM_NumberOfWaveformChannels DcmTagKey(0x003a, 0x0005) +#define DCM_NumberOfWaveformSamples DcmTagKey(0x003a, 0x0010) +#define DCM_SamplingFrequency DcmTagKey(0x003a, 0x001a) +#define DCM_MultiplexGroupLabel DcmTagKey(0x003a, 0x0020) +#define DCM_ChannelDefinitionSequence DcmTagKey(0x003a, 0x0200) +#define DCM_WaveformChannelNumber DcmTagKey(0x003a, 0x0202) +#define DCM_ChannelLabel DcmTagKey(0x003a, 0x0203) +#define DCM_ChannelStatus DcmTagKey(0x003a, 0x0205) +#define DCM_ChannelSourceSequence DcmTagKey(0x003a, 0x0208) +#define DCM_ChannelSourceModifiersSequence DcmTagKey(0x003a, 0x0209) +#define DCM_SourceWaveformSequence DcmTagKey(0x003a, 0x020a) +#define DCM_ChannelDerivationDescription DcmTagKey(0x003a, 0x020c) +#define DCM_ChannelSensitivity DcmTagKey(0x003a, 0x0210) +#define DCM_ChannelSensitivityUnitsSequence DcmTagKey(0x003a, 0x0211) +#define DCM_ChannelSensitivityCorrectionFactor DcmTagKey(0x003a, 0x0212) +#define DCM_ChannelBaseline DcmTagKey(0x003a, 0x0213) +#define DCM_ChannelTimeSkew DcmTagKey(0x003a, 0x0214) +#define DCM_ChannelSampleSkew DcmTagKey(0x003a, 0x0215) +#define DCM_ChannelOffset DcmTagKey(0x003a, 0x0218) +#define DCM_WaveformBitsStored DcmTagKey(0x003a, 0x021a) +#define DCM_FilterLowFrequency DcmTagKey(0x003a, 0x0220) +#define DCM_FilterHighFrequency DcmTagKey(0x003a, 0x0221) +#define DCM_NotchFilterFrequency DcmTagKey(0x003a, 0x0222) +#define DCM_NotchFilterBandwidth DcmTagKey(0x003a, 0x0223) +#define DCM_WaveformDataDisplayScale DcmTagKey(0x003a, 0x0230) +#define DCM_WaveformDisplayBackgroundCIELabValue DcmTagKey(0x003a, 0x0231) +#define DCM_WaveformPresentationGroupSequence DcmTagKey(0x003a, 0x0240) +#define DCM_PresentationGroupNumber DcmTagKey(0x003a, 0x0241) +#define DCM_ChannelDisplaySequence DcmTagKey(0x003a, 0x0242) +#define DCM_ChannelRecommendedDisplayCIELabValue DcmTagKey(0x003a, 0x0244) +#define DCM_ChannelPosition DcmTagKey(0x003a, 0x0245) +#define DCM_DisplayShadingFlag DcmTagKey(0x003a, 0x0246) +#define DCM_FractionalChannelDisplayScale DcmTagKey(0x003a, 0x0247) +#define DCM_AbsoluteChannelDisplayScale DcmTagKey(0x003a, 0x0248) +#define DCM_MultiplexedAudioChannelsDescriptionCodeSequence DcmTagKey(0x003a, 0x0300) +#define DCM_ChannelIdentificationCode DcmTagKey(0x003a, 0x0301) +#define DCM_ChannelMode DcmTagKey(0x003a, 0x0302) +#define DCM_ScheduledStationAETitle DcmTagKey(0x0040, 0x0001) +#define DCM_ScheduledProcedureStepStartDate DcmTagKey(0x0040, 0x0002) +#define DCM_ScheduledProcedureStepStartTime DcmTagKey(0x0040, 0x0003) +#define DCM_ScheduledProcedureStepEndDate DcmTagKey(0x0040, 0x0004) +#define DCM_ScheduledProcedureStepEndTime DcmTagKey(0x0040, 0x0005) +#define DCM_ScheduledPerformingPhysicianName DcmTagKey(0x0040, 0x0006) +#define DCM_ScheduledProcedureStepDescription DcmTagKey(0x0040, 0x0007) +#define DCM_ScheduledProtocolCodeSequence DcmTagKey(0x0040, 0x0008) +#define DCM_ScheduledProcedureStepID DcmTagKey(0x0040, 0x0009) +#define DCM_StageCodeSequence DcmTagKey(0x0040, 0x000a) +#define DCM_ScheduledPerformingPhysicianIdentificationSequence DcmTagKey(0x0040, 0x000b) +#define DCM_ScheduledStationName DcmTagKey(0x0040, 0x0010) +#define DCM_ScheduledProcedureStepLocation DcmTagKey(0x0040, 0x0011) +#define DCM_PreMedication DcmTagKey(0x0040, 0x0012) +#define DCM_ScheduledProcedureStepStatus DcmTagKey(0x0040, 0x0020) +#define DCM_OrderPlacerIdentifierSequence DcmTagKey(0x0040, 0x0026) +#define DCM_OrderFillerIdentifierSequence DcmTagKey(0x0040, 0x0027) +#define DCM_LocalNamespaceEntityID DcmTagKey(0x0040, 0x0031) +#define DCM_UniversalEntityID DcmTagKey(0x0040, 0x0032) +#define DCM_UniversalEntityIDType DcmTagKey(0x0040, 0x0033) +#define DCM_IdentifierTypeCode DcmTagKey(0x0040, 0x0035) +#define DCM_AssigningFacilitySequence DcmTagKey(0x0040, 0x0036) +#define DCM_AssigningJurisdictionCodeSequence DcmTagKey(0x0040, 0x0039) +#define DCM_AssigningAgencyOrDepartmentCodeSequence DcmTagKey(0x0040, 0x003a) +#define DCM_ScheduledProcedureStepSequence DcmTagKey(0x0040, 0x0100) +#define DCM_ReferencedNonImageCompositeSOPInstanceSequence DcmTagKey(0x0040, 0x0220) +#define DCM_PerformedStationAETitle DcmTagKey(0x0040, 0x0241) +#define DCM_PerformedStationName DcmTagKey(0x0040, 0x0242) +#define DCM_PerformedLocation DcmTagKey(0x0040, 0x0243) +#define DCM_PerformedProcedureStepStartDate DcmTagKey(0x0040, 0x0244) +#define DCM_PerformedProcedureStepStartTime DcmTagKey(0x0040, 0x0245) +#define DCM_PerformedProcedureStepEndDate DcmTagKey(0x0040, 0x0250) +#define DCM_PerformedProcedureStepEndTime DcmTagKey(0x0040, 0x0251) +#define DCM_PerformedProcedureStepStatus DcmTagKey(0x0040, 0x0252) +#define DCM_PerformedProcedureStepID DcmTagKey(0x0040, 0x0253) +#define DCM_PerformedProcedureStepDescription DcmTagKey(0x0040, 0x0254) +#define DCM_PerformedProcedureTypeDescription DcmTagKey(0x0040, 0x0255) +#define DCM_PerformedProtocolCodeSequence DcmTagKey(0x0040, 0x0260) +#define DCM_PerformedProtocolType DcmTagKey(0x0040, 0x0261) +#define DCM_ScheduledStepAttributesSequence DcmTagKey(0x0040, 0x0270) +#define DCM_RequestAttributesSequence DcmTagKey(0x0040, 0x0275) +#define DCM_CommentsOnThePerformedProcedureStep DcmTagKey(0x0040, 0x0280) +#define DCM_PerformedProcedureStepDiscontinuationReasonCodeSequence DcmTagKey(0x0040, 0x0281) +#define DCM_QuantitySequence DcmTagKey(0x0040, 0x0293) +#define DCM_Quantity DcmTagKey(0x0040, 0x0294) +#define DCM_MeasuringUnitsSequence DcmTagKey(0x0040, 0x0295) +#define DCM_BillingItemSequence DcmTagKey(0x0040, 0x0296) +#define DCM_RETIRED_TotalTimeOfFluoroscopy DcmTagKey(0x0040, 0x0300) +#define DCM_RETIRED_TotalNumberOfExposures DcmTagKey(0x0040, 0x0301) +#define DCM_EntranceDose DcmTagKey(0x0040, 0x0302) +#define DCM_ExposedArea DcmTagKey(0x0040, 0x0303) +#define DCM_DistanceSourceToEntrance DcmTagKey(0x0040, 0x0306) +#define DCM_RETIRED_DistanceSourceToSupport DcmTagKey(0x0040, 0x0307) +#define DCM_RETIRED_ExposureDoseSequence DcmTagKey(0x0040, 0x030e) +#define DCM_CommentsOnRadiationDose DcmTagKey(0x0040, 0x0310) +#define DCM_XRayOutput DcmTagKey(0x0040, 0x0312) +#define DCM_HalfValueLayer DcmTagKey(0x0040, 0x0314) +#define DCM_OrganDose DcmTagKey(0x0040, 0x0316) +#define DCM_OrganExposed DcmTagKey(0x0040, 0x0318) +#define DCM_BillingProcedureStepSequence DcmTagKey(0x0040, 0x0320) +#define DCM_FilmConsumptionSequence DcmTagKey(0x0040, 0x0321) +#define DCM_BillingSuppliesAndDevicesSequence DcmTagKey(0x0040, 0x0324) +#define DCM_RETIRED_ReferencedProcedureStepSequence DcmTagKey(0x0040, 0x0330) +#define DCM_PerformedSeriesSequence DcmTagKey(0x0040, 0x0340) +#define DCM_CommentsOnTheScheduledProcedureStep DcmTagKey(0x0040, 0x0400) +#define DCM_ProtocolContextSequence DcmTagKey(0x0040, 0x0440) +#define DCM_ContentItemModifierSequence DcmTagKey(0x0040, 0x0441) +#define DCM_ScheduledSpecimenSequence DcmTagKey(0x0040, 0x0500) +#define DCM_RETIRED_SpecimenAccessionNumber DcmTagKey(0x0040, 0x050a) +#define DCM_ContainerIdentifier DcmTagKey(0x0040, 0x0512) +#define DCM_IssuerOfTheContainerIdentifierSequence DcmTagKey(0x0040, 0x0513) +#define DCM_AlternateContainerIdentifierSequence DcmTagKey(0x0040, 0x0515) +#define DCM_ContainerTypeCodeSequence DcmTagKey(0x0040, 0x0518) +#define DCM_ContainerDescription DcmTagKey(0x0040, 0x051a) +#define DCM_ContainerComponentSequence DcmTagKey(0x0040, 0x0520) +#define DCM_RETIRED_SpecimenSequence DcmTagKey(0x0040, 0x0550) +#define DCM_SpecimenIdentifier DcmTagKey(0x0040, 0x0551) +#define DCM_RETIRED_SpecimenDescriptionSequenceTrial DcmTagKey(0x0040, 0x0552) +#define DCM_RETIRED_SpecimenDescriptionTrial DcmTagKey(0x0040, 0x0553) +#define DCM_SpecimenUID DcmTagKey(0x0040, 0x0554) +#define DCM_AcquisitionContextSequence DcmTagKey(0x0040, 0x0555) +#define DCM_AcquisitionContextDescription DcmTagKey(0x0040, 0x0556) +#define DCM_SpecimenDescriptionSequence DcmTagKey(0x0040, 0x0560) +#define DCM_IssuerOfTheSpecimenIdentifierSequence DcmTagKey(0x0040, 0x0562) +#define DCM_SpecimenTypeCodeSequence DcmTagKey(0x0040, 0x059a) +#define DCM_SpecimenShortDescription DcmTagKey(0x0040, 0x0600) +#define DCM_SpecimenDetailedDescription DcmTagKey(0x0040, 0x0602) +#define DCM_SpecimenPreparationSequence DcmTagKey(0x0040, 0x0610) +#define DCM_SpecimenPreparationStepContentItemSequence DcmTagKey(0x0040, 0x0612) +#define DCM_SpecimenLocalizationContentItemSequence DcmTagKey(0x0040, 0x0620) +#define DCM_RETIRED_SlideIdentifier DcmTagKey(0x0040, 0x06fa) +#define DCM_WholeSlideMicroscopyImageFrameTypeSequence DcmTagKey(0x0040, 0x0710) +#define DCM_ImageCenterPointCoordinatesSequence DcmTagKey(0x0040, 0x071a) +#define DCM_XOffsetInSlideCoordinateSystem DcmTagKey(0x0040, 0x072a) +#define DCM_YOffsetInSlideCoordinateSystem DcmTagKey(0x0040, 0x073a) +#define DCM_ZOffsetInSlideCoordinateSystem DcmTagKey(0x0040, 0x074a) +#define DCM_RETIRED_PixelSpacingSequence DcmTagKey(0x0040, 0x08d8) +#define DCM_RETIRED_CoordinateSystemAxisCodeSequence DcmTagKey(0x0040, 0x08da) +#define DCM_MeasurementUnitsCodeSequence DcmTagKey(0x0040, 0x08ea) +#define DCM_RETIRED_VitalStainCodeSequenceTrial DcmTagKey(0x0040, 0x09f8) +#define DCM_RequestedProcedureID DcmTagKey(0x0040, 0x1001) +#define DCM_ReasonForTheRequestedProcedure DcmTagKey(0x0040, 0x1002) +#define DCM_RequestedProcedurePriority DcmTagKey(0x0040, 0x1003) +#define DCM_PatientTransportArrangements DcmTagKey(0x0040, 0x1004) +#define DCM_RequestedProcedureLocation DcmTagKey(0x0040, 0x1005) +#define DCM_RETIRED_PlacerOrderNumberProcedure DcmTagKey(0x0040, 0x1006) +#define DCM_RETIRED_FillerOrderNumberProcedure DcmTagKey(0x0040, 0x1007) +#define DCM_ConfidentialityCode DcmTagKey(0x0040, 0x1008) +#define DCM_ReportingPriority DcmTagKey(0x0040, 0x1009) +#define DCM_ReasonForRequestedProcedureCodeSequence DcmTagKey(0x0040, 0x100a) +#define DCM_NamesOfIntendedRecipientsOfResults DcmTagKey(0x0040, 0x1010) +#define DCM_IntendedRecipientsOfResultsIdentificationSequence DcmTagKey(0x0040, 0x1011) +#define DCM_ReasonForPerformedProcedureCodeSequence DcmTagKey(0x0040, 0x1012) +#define DCM_RETIRED_RequestedProcedureDescriptionTrial DcmTagKey(0x0040, 0x1060) +#define DCM_PersonIdentificationCodeSequence DcmTagKey(0x0040, 0x1101) +#define DCM_PersonAddress DcmTagKey(0x0040, 0x1102) +#define DCM_PersonTelephoneNumbers DcmTagKey(0x0040, 0x1103) +#define DCM_PersonTelecomInformation DcmTagKey(0x0040, 0x1104) +#define DCM_RequestedProcedureComments DcmTagKey(0x0040, 0x1400) +#define DCM_RETIRED_ReasonForTheImagingServiceRequest DcmTagKey(0x0040, 0x2001) +#define DCM_IssueDateOfImagingServiceRequest DcmTagKey(0x0040, 0x2004) +#define DCM_IssueTimeOfImagingServiceRequest DcmTagKey(0x0040, 0x2005) +#define DCM_RETIRED_PlacerOrderNumberImagingServiceRequestRetired DcmTagKey(0x0040, 0x2006) +#define DCM_RETIRED_FillerOrderNumberImagingServiceRequestRetired DcmTagKey(0x0040, 0x2007) +#define DCM_OrderEnteredBy DcmTagKey(0x0040, 0x2008) +#define DCM_OrderEntererLocation DcmTagKey(0x0040, 0x2009) +#define DCM_OrderCallbackPhoneNumber DcmTagKey(0x0040, 0x2010) +#define DCM_OrderCallbackTelecomInformation DcmTagKey(0x0040, 0x2011) +#define DCM_PlacerOrderNumberImagingServiceRequest DcmTagKey(0x0040, 0x2016) +#define DCM_FillerOrderNumberImagingServiceRequest DcmTagKey(0x0040, 0x2017) +#define DCM_ImagingServiceRequestComments DcmTagKey(0x0040, 0x2400) +#define DCM_ConfidentialityConstraintOnPatientDataDescription DcmTagKey(0x0040, 0x3001) +#define DCM_RETIRED_GeneralPurposeScheduledProcedureStepStatus DcmTagKey(0x0040, 0x4001) +#define DCM_RETIRED_GeneralPurposePerformedProcedureStepStatus DcmTagKey(0x0040, 0x4002) +#define DCM_RETIRED_GeneralPurposeScheduledProcedureStepPriority DcmTagKey(0x0040, 0x4003) +#define DCM_RETIRED_ScheduledProcessingApplicationsCodeSequence DcmTagKey(0x0040, 0x4004) +#define DCM_ScheduledProcedureStepStartDateTime DcmTagKey(0x0040, 0x4005) +#define DCM_RETIRED_MultipleCopiesFlag DcmTagKey(0x0040, 0x4006) +#define DCM_RETIRED_PerformedProcessingApplicationsCodeSequence DcmTagKey(0x0040, 0x4007) +#define DCM_ScheduledProcedureStepExpirationDateTime DcmTagKey(0x0040, 0x4008) +#define DCM_HumanPerformerCodeSequence DcmTagKey(0x0040, 0x4009) +#define DCM_ScheduledProcedureStepModificationDateTime DcmTagKey(0x0040, 0x4010) +#define DCM_ExpectedCompletionDateTime DcmTagKey(0x0040, 0x4011) +#define DCM_RETIRED_ResultingGeneralPurposePerformedProcedureStepsSequence DcmTagKey(0x0040, 0x4015) +#define DCM_RETIRED_ReferencedGeneralPurposeScheduledProcedureStepSequence DcmTagKey(0x0040, 0x4016) +#define DCM_ScheduledWorkitemCodeSequence DcmTagKey(0x0040, 0x4018) +#define DCM_PerformedWorkitemCodeSequence DcmTagKey(0x0040, 0x4019) +#define DCM_RETIRED_InputAvailabilityFlag DcmTagKey(0x0040, 0x4020) +#define DCM_InputInformationSequence DcmTagKey(0x0040, 0x4021) +#define DCM_RETIRED_RelevantInformationSequence DcmTagKey(0x0040, 0x4022) +#define DCM_RETIRED_ReferencedGeneralPurposeScheduledProcedureStepTransactionUID DcmTagKey(0x0040, 0x4023) +#define DCM_ScheduledStationNameCodeSequence DcmTagKey(0x0040, 0x4025) +#define DCM_ScheduledStationClassCodeSequence DcmTagKey(0x0040, 0x4026) +#define DCM_ScheduledStationGeographicLocationCodeSequence DcmTagKey(0x0040, 0x4027) +#define DCM_PerformedStationNameCodeSequence DcmTagKey(0x0040, 0x4028) +#define DCM_PerformedStationClassCodeSequence DcmTagKey(0x0040, 0x4029) +#define DCM_PerformedStationGeographicLocationCodeSequence DcmTagKey(0x0040, 0x4030) +#define DCM_RETIRED_RequestedSubsequentWorkitemCodeSequence DcmTagKey(0x0040, 0x4031) +#define DCM_RETIRED_NonDICOMOutputCodeSequence DcmTagKey(0x0040, 0x4032) +#define DCM_OutputInformationSequence DcmTagKey(0x0040, 0x4033) +#define DCM_ScheduledHumanPerformersSequence DcmTagKey(0x0040, 0x4034) +#define DCM_ActualHumanPerformersSequence DcmTagKey(0x0040, 0x4035) +#define DCM_HumanPerformerOrganization DcmTagKey(0x0040, 0x4036) +#define DCM_HumanPerformerName DcmTagKey(0x0040, 0x4037) +#define DCM_RawDataHandling DcmTagKey(0x0040, 0x4040) +#define DCM_InputReadinessState DcmTagKey(0x0040, 0x4041) +#define DCM_PerformedProcedureStepStartDateTime DcmTagKey(0x0040, 0x4050) +#define DCM_PerformedProcedureStepEndDateTime DcmTagKey(0x0040, 0x4051) +#define DCM_ProcedureStepCancellationDateTime DcmTagKey(0x0040, 0x4052) +#define DCM_OutputDestinationSequence DcmTagKey(0x0040, 0x4070) +#define DCM_DICOMStorageSequence DcmTagKey(0x0040, 0x4071) +#define DCM_STOWRSStorageSequence DcmTagKey(0x0040, 0x4072) +#define DCM_StorageURL DcmTagKey(0x0040, 0x4073) +#define DCM_XDSStorageSequence DcmTagKey(0x0040, 0x4074) +#define DCM_EntranceDoseInmGy DcmTagKey(0x0040, 0x8302) +#define DCM_EntranceDoseDerivation DcmTagKey(0x0040, 0x8303) +#define DCM_ParametricMapFrameTypeSequence DcmTagKey(0x0040, 0x9092) +#define DCM_ReferencedImageRealWorldValueMappingSequence DcmTagKey(0x0040, 0x9094) +#define DCM_RealWorldValueMappingSequence DcmTagKey(0x0040, 0x9096) +#define DCM_PixelValueMappingCodeSequence DcmTagKey(0x0040, 0x9098) +#define DCM_LUTLabel DcmTagKey(0x0040, 0x9210) +#define DCM_RealWorldValueLastValueMapped DcmTagKey(0x0040, 0x9211) +#define DCM_RealWorldValueLUTData DcmTagKey(0x0040, 0x9212) +#define DCM_DoubleFloatRealWorldValueLastValueMapped DcmTagKey(0x0040, 0x9213) +#define DCM_DoubleFloatRealWorldValueFirstValueMapped DcmTagKey(0x0040, 0x9214) +#define DCM_RealWorldValueFirstValueMapped DcmTagKey(0x0040, 0x9216) +#define DCM_QuantityDefinitionSequence DcmTagKey(0x0040, 0x9220) +#define DCM_RealWorldValueIntercept DcmTagKey(0x0040, 0x9224) +#define DCM_RealWorldValueSlope DcmTagKey(0x0040, 0x9225) +#define DCM_RETIRED_FindingsFlagTrial DcmTagKey(0x0040, 0xa007) +#define DCM_RelationshipType DcmTagKey(0x0040, 0xa010) +#define DCM_RETIRED_FindingsSequenceTrial DcmTagKey(0x0040, 0xa020) +#define DCM_RETIRED_FindingsGroupUIDTrial DcmTagKey(0x0040, 0xa021) +#define DCM_RETIRED_ReferencedFindingsGroupUIDTrial DcmTagKey(0x0040, 0xa022) +#define DCM_RETIRED_FindingsGroupRecordingDateTrial DcmTagKey(0x0040, 0xa023) +#define DCM_RETIRED_FindingsGroupRecordingTimeTrial DcmTagKey(0x0040, 0xa024) +#define DCM_RETIRED_FindingsSourceCategoryCodeSequenceTrial DcmTagKey(0x0040, 0xa026) +#define DCM_VerifyingOrganization DcmTagKey(0x0040, 0xa027) +#define DCM_RETIRED_DocumentingOrganizationIdentifierCodeSequenceTrial DcmTagKey(0x0040, 0xa028) +#define DCM_VerificationDateTime DcmTagKey(0x0040, 0xa030) +#define DCM_ObservationDateTime DcmTagKey(0x0040, 0xa032) +#define DCM_ValueType DcmTagKey(0x0040, 0xa040) +#define DCM_ConceptNameCodeSequence DcmTagKey(0x0040, 0xa043) +#define DCM_RETIRED_MeasurementPrecisionDescriptionTrial DcmTagKey(0x0040, 0xa047) +#define DCM_ContinuityOfContent DcmTagKey(0x0040, 0xa050) +#define DCM_RETIRED_UrgencyOrPriorityAlertsTrial DcmTagKey(0x0040, 0xa057) +#define DCM_RETIRED_SequencingIndicatorTrial DcmTagKey(0x0040, 0xa060) +#define DCM_RETIRED_DocumentIdentifierCodeSequenceTrial DcmTagKey(0x0040, 0xa066) +#define DCM_RETIRED_DocumentAuthorTrial DcmTagKey(0x0040, 0xa067) +#define DCM_RETIRED_DocumentAuthorIdentifierCodeSequenceTrial DcmTagKey(0x0040, 0xa068) +#define DCM_RETIRED_IdentifierCodeSequenceTrial DcmTagKey(0x0040, 0xa070) +#define DCM_VerifyingObserverSequence DcmTagKey(0x0040, 0xa073) +#define DCM_RETIRED_ObjectBinaryIdentifierTrial DcmTagKey(0x0040, 0xa074) +#define DCM_VerifyingObserverName DcmTagKey(0x0040, 0xa075) +#define DCM_RETIRED_DocumentingObserverIdentifierCodeSequenceTrial DcmTagKey(0x0040, 0xa076) +#define DCM_AuthorObserverSequence DcmTagKey(0x0040, 0xa078) +#define DCM_ParticipantSequence DcmTagKey(0x0040, 0xa07a) +#define DCM_CustodialOrganizationSequence DcmTagKey(0x0040, 0xa07c) +#define DCM_ParticipationType DcmTagKey(0x0040, 0xa080) +#define DCM_ParticipationDateTime DcmTagKey(0x0040, 0xa082) +#define DCM_ObserverType DcmTagKey(0x0040, 0xa084) +#define DCM_RETIRED_ProcedureIdentifierCodeSequenceTrial DcmTagKey(0x0040, 0xa085) +#define DCM_VerifyingObserverIdentificationCodeSequence DcmTagKey(0x0040, 0xa088) +#define DCM_RETIRED_ObjectDirectoryBinaryIdentifierTrial DcmTagKey(0x0040, 0xa089) +#define DCM_RETIRED_EquivalentCDADocumentSequence DcmTagKey(0x0040, 0xa090) +#define DCM_ReferencedWaveformChannels DcmTagKey(0x0040, 0xa0b0) +#define DCM_RETIRED_DateOfDocumentOrVerbalTransactionTrial DcmTagKey(0x0040, 0xa110) +#define DCM_RETIRED_TimeOfDocumentCreationOrVerbalTransactionTrial DcmTagKey(0x0040, 0xa112) +#define DCM_DateTime DcmTagKey(0x0040, 0xa120) +#define DCM_Date DcmTagKey(0x0040, 0xa121) +#define DCM_Time DcmTagKey(0x0040, 0xa122) +#define DCM_PersonName DcmTagKey(0x0040, 0xa123) +#define DCM_UID DcmTagKey(0x0040, 0xa124) +#define DCM_RETIRED_ReportStatusIDTrial DcmTagKey(0x0040, 0xa125) +#define DCM_TemporalRangeType DcmTagKey(0x0040, 0xa130) +#define DCM_ReferencedSamplePositions DcmTagKey(0x0040, 0xa132) +#define DCM_RETIRED_ReferencedFrameNumbers DcmTagKey(0x0040, 0xa136) +#define DCM_ReferencedTimeOffsets DcmTagKey(0x0040, 0xa138) +#define DCM_ReferencedDateTime DcmTagKey(0x0040, 0xa13a) +#define DCM_TextValue DcmTagKey(0x0040, 0xa160) +#define DCM_FloatingPointValue DcmTagKey(0x0040, 0xa161) +#define DCM_RationalNumeratorValue DcmTagKey(0x0040, 0xa162) +#define DCM_RationalDenominatorValue DcmTagKey(0x0040, 0xa163) +#define DCM_RETIRED_ObservationCategoryCodeSequenceTrial DcmTagKey(0x0040, 0xa167) +#define DCM_ConceptCodeSequence DcmTagKey(0x0040, 0xa168) +#define DCM_RETIRED_BibliographicCitationTrial DcmTagKey(0x0040, 0xa16a) +#define DCM_PurposeOfReferenceCodeSequence DcmTagKey(0x0040, 0xa170) +#define DCM_ObservationUID DcmTagKey(0x0040, 0xa171) +#define DCM_RETIRED_ReferencedObservationUIDTrial DcmTagKey(0x0040, 0xa172) +#define DCM_RETIRED_ReferencedObservationClassTrial DcmTagKey(0x0040, 0xa173) +#define DCM_RETIRED_ReferencedObjectObservationClassTrial DcmTagKey(0x0040, 0xa174) +#define DCM_AnnotationGroupNumber DcmTagKey(0x0040, 0xa180) +#define DCM_RETIRED_ObservationDateTrial DcmTagKey(0x0040, 0xa192) +#define DCM_RETIRED_ObservationTimeTrial DcmTagKey(0x0040, 0xa193) +#define DCM_RETIRED_MeasurementAutomationTrial DcmTagKey(0x0040, 0xa194) +#define DCM_ModifierCodeSequence DcmTagKey(0x0040, 0xa195) +#define DCM_RETIRED_IdentificationDescriptionTrial DcmTagKey(0x0040, 0xa224) +#define DCM_RETIRED_CoordinatesSetGeometricTypeTrial DcmTagKey(0x0040, 0xa290) +#define DCM_RETIRED_AlgorithmCodeSequenceTrial DcmTagKey(0x0040, 0xa296) +#define DCM_RETIRED_AlgorithmDescriptionTrial DcmTagKey(0x0040, 0xa297) +#define DCM_RETIRED_PixelCoordinatesSetTrial DcmTagKey(0x0040, 0xa29a) +#define DCM_MeasuredValueSequence DcmTagKey(0x0040, 0xa300) +#define DCM_NumericValueQualifierCodeSequence DcmTagKey(0x0040, 0xa301) +#define DCM_RETIRED_CurrentObserverTrial DcmTagKey(0x0040, 0xa307) +#define DCM_NumericValue DcmTagKey(0x0040, 0xa30a) +#define DCM_RETIRED_ReferencedAccessionSequenceTrial DcmTagKey(0x0040, 0xa313) +#define DCM_RETIRED_ReportStatusCommentTrial DcmTagKey(0x0040, 0xa33a) +#define DCM_RETIRED_ProcedureContextSequenceTrial DcmTagKey(0x0040, 0xa340) +#define DCM_RETIRED_VerbalSourceTrial DcmTagKey(0x0040, 0xa352) +#define DCM_RETIRED_AddressTrial DcmTagKey(0x0040, 0xa353) +#define DCM_RETIRED_TelephoneNumberTrial DcmTagKey(0x0040, 0xa354) +#define DCM_RETIRED_VerbalSourceIdentifierCodeSequenceTrial DcmTagKey(0x0040, 0xa358) +#define DCM_PredecessorDocumentsSequence DcmTagKey(0x0040, 0xa360) +#define DCM_ReferencedRequestSequence DcmTagKey(0x0040, 0xa370) +#define DCM_PerformedProcedureCodeSequence DcmTagKey(0x0040, 0xa372) +#define DCM_CurrentRequestedProcedureEvidenceSequence DcmTagKey(0x0040, 0xa375) +#define DCM_RETIRED_ReportDetailSequenceTrial DcmTagKey(0x0040, 0xa380) +#define DCM_PertinentOtherEvidenceSequence DcmTagKey(0x0040, 0xa385) +#define DCM_HL7StructuredDocumentReferenceSequence DcmTagKey(0x0040, 0xa390) +#define DCM_RETIRED_ObservationSubjectUIDTrial DcmTagKey(0x0040, 0xa402) +#define DCM_RETIRED_ObservationSubjectClassTrial DcmTagKey(0x0040, 0xa403) +#define DCM_RETIRED_ObservationSubjectTypeCodeSequenceTrial DcmTagKey(0x0040, 0xa404) +#define DCM_CompletionFlag DcmTagKey(0x0040, 0xa491) +#define DCM_CompletionFlagDescription DcmTagKey(0x0040, 0xa492) +#define DCM_VerificationFlag DcmTagKey(0x0040, 0xa493) +#define DCM_ArchiveRequested DcmTagKey(0x0040, 0xa494) +#define DCM_PreliminaryFlag DcmTagKey(0x0040, 0xa496) +#define DCM_ContentTemplateSequence DcmTagKey(0x0040, 0xa504) +#define DCM_IdenticalDocumentsSequence DcmTagKey(0x0040, 0xa525) +#define DCM_RETIRED_ObservationSubjectContextFlagTrial DcmTagKey(0x0040, 0xa600) +#define DCM_RETIRED_ObserverContextFlagTrial DcmTagKey(0x0040, 0xa601) +#define DCM_RETIRED_ProcedureContextFlagTrial DcmTagKey(0x0040, 0xa603) +#define DCM_ContentSequence DcmTagKey(0x0040, 0xa730) +#define DCM_RETIRED_RelationshipSequenceTrial DcmTagKey(0x0040, 0xa731) +#define DCM_RETIRED_RelationshipTypeCodeSequenceTrial DcmTagKey(0x0040, 0xa732) +#define DCM_RETIRED_LanguageCodeSequenceTrial DcmTagKey(0x0040, 0xa744) +#define DCM_RETIRED_UniformResourceLocatorTrial DcmTagKey(0x0040, 0xa992) +#define DCM_WaveformAnnotationSequence DcmTagKey(0x0040, 0xb020) +#define DCM_TemplateIdentifier DcmTagKey(0x0040, 0xdb00) +#define DCM_RETIRED_TemplateVersion DcmTagKey(0x0040, 0xdb06) +#define DCM_RETIRED_TemplateLocalVersion DcmTagKey(0x0040, 0xdb07) +#define DCM_RETIRED_TemplateExtensionFlag DcmTagKey(0x0040, 0xdb0b) +#define DCM_RETIRED_TemplateExtensionOrganizationUID DcmTagKey(0x0040, 0xdb0c) +#define DCM_RETIRED_TemplateExtensionCreatorUID DcmTagKey(0x0040, 0xdb0d) +#define DCM_ReferencedContentItemIdentifier DcmTagKey(0x0040, 0xdb73) +#define DCM_HL7InstanceIdentifier DcmTagKey(0x0040, 0xe001) +#define DCM_HL7DocumentEffectiveTime DcmTagKey(0x0040, 0xe004) +#define DCM_HL7DocumentTypeCodeSequence DcmTagKey(0x0040, 0xe006) +#define DCM_DocumentClassCodeSequence DcmTagKey(0x0040, 0xe008) +#define DCM_RetrieveURI DcmTagKey(0x0040, 0xe010) +#define DCM_RetrieveLocationUID DcmTagKey(0x0040, 0xe011) +#define DCM_TypeOfInstances DcmTagKey(0x0040, 0xe020) +#define DCM_DICOMRetrievalSequence DcmTagKey(0x0040, 0xe021) +#define DCM_DICOMMediaRetrievalSequence DcmTagKey(0x0040, 0xe022) +#define DCM_WADORetrievalSequence DcmTagKey(0x0040, 0xe023) +#define DCM_XDSRetrievalSequence DcmTagKey(0x0040, 0xe024) +#define DCM_WADORSRetrievalSequence DcmTagKey(0x0040, 0xe025) +#define DCM_RepositoryUniqueID DcmTagKey(0x0040, 0xe030) +#define DCM_HomeCommunityID DcmTagKey(0x0040, 0xe031) +#define DCM_DocumentTitle DcmTagKey(0x0042, 0x0010) +#define DCM_EncapsulatedDocument DcmTagKey(0x0042, 0x0011) +#define DCM_MIMETypeOfEncapsulatedDocument DcmTagKey(0x0042, 0x0012) +#define DCM_SourceInstanceSequence DcmTagKey(0x0042, 0x0013) +#define DCM_ListOfMIMETypes DcmTagKey(0x0042, 0x0014) +#define DCM_EncapsulatedDocumentLength DcmTagKey(0x0042, 0x0015) +#define DCM_ProductPackageIdentifier DcmTagKey(0x0044, 0x0001) +#define DCM_SubstanceAdministrationApproval DcmTagKey(0x0044, 0x0002) +#define DCM_ApprovalStatusFurtherDescription DcmTagKey(0x0044, 0x0003) +#define DCM_ApprovalStatusDateTime DcmTagKey(0x0044, 0x0004) +#define DCM_ProductTypeCodeSequence DcmTagKey(0x0044, 0x0007) +#define DCM_ProductName DcmTagKey(0x0044, 0x0008) +#define DCM_ProductDescription DcmTagKey(0x0044, 0x0009) +#define DCM_ProductLotIdentifier DcmTagKey(0x0044, 0x000a) +#define DCM_ProductExpirationDateTime DcmTagKey(0x0044, 0x000b) +#define DCM_SubstanceAdministrationDateTime DcmTagKey(0x0044, 0x0010) +#define DCM_SubstanceAdministrationNotes DcmTagKey(0x0044, 0x0011) +#define DCM_SubstanceAdministrationDeviceID DcmTagKey(0x0044, 0x0012) +#define DCM_ProductParameterSequence DcmTagKey(0x0044, 0x0013) +#define DCM_SubstanceAdministrationParameterSequence DcmTagKey(0x0044, 0x0019) +#define DCM_ApprovalSequence DcmTagKey(0x0044, 0x0100) +#define DCM_AssertionCodeSequence DcmTagKey(0x0044, 0x0101) +#define DCM_AssertionUID DcmTagKey(0x0044, 0x0102) +#define DCM_AsserterIdentificationSequence DcmTagKey(0x0044, 0x0103) +#define DCM_AssertionDateTime DcmTagKey(0x0044, 0x0104) +#define DCM_AssertionExpirationDateTime DcmTagKey(0x0044, 0x0105) +#define DCM_AssertionComments DcmTagKey(0x0044, 0x0106) +#define DCM_RelatedAssertionSequence DcmTagKey(0x0044, 0x0107) +#define DCM_ReferencedAssertionUID DcmTagKey(0x0044, 0x0108) +#define DCM_ApprovalSubjectSequence DcmTagKey(0x0044, 0x0109) +#define DCM_OrganizationalRoleCodeSequence DcmTagKey(0x0044, 0x010a) +#define DCM_LensDescription DcmTagKey(0x0046, 0x0012) +#define DCM_RightLensSequence DcmTagKey(0x0046, 0x0014) +#define DCM_LeftLensSequence DcmTagKey(0x0046, 0x0015) +#define DCM_UnspecifiedLateralityLensSequence DcmTagKey(0x0046, 0x0016) +#define DCM_CylinderSequence DcmTagKey(0x0046, 0x0018) +#define DCM_PrismSequence DcmTagKey(0x0046, 0x0028) +#define DCM_HorizontalPrismPower DcmTagKey(0x0046, 0x0030) +#define DCM_HorizontalPrismBase DcmTagKey(0x0046, 0x0032) +#define DCM_VerticalPrismPower DcmTagKey(0x0046, 0x0034) +#define DCM_VerticalPrismBase DcmTagKey(0x0046, 0x0036) +#define DCM_LensSegmentType DcmTagKey(0x0046, 0x0038) +#define DCM_OpticalTransmittance DcmTagKey(0x0046, 0x0040) +#define DCM_ChannelWidth DcmTagKey(0x0046, 0x0042) +#define DCM_PupilSize DcmTagKey(0x0046, 0x0044) +#define DCM_CornealSize DcmTagKey(0x0046, 0x0046) +#define DCM_CornealSizeSequence DcmTagKey(0x0046, 0x0047) +#define DCM_AutorefractionRightEyeSequence DcmTagKey(0x0046, 0x0050) +#define DCM_AutorefractionLeftEyeSequence DcmTagKey(0x0046, 0x0052) +#define DCM_DistancePupillaryDistance DcmTagKey(0x0046, 0x0060) +#define DCM_NearPupillaryDistance DcmTagKey(0x0046, 0x0062) +#define DCM_IntermediatePupillaryDistance DcmTagKey(0x0046, 0x0063) +#define DCM_OtherPupillaryDistance DcmTagKey(0x0046, 0x0064) +#define DCM_KeratometryRightEyeSequence DcmTagKey(0x0046, 0x0070) +#define DCM_KeratometryLeftEyeSequence DcmTagKey(0x0046, 0x0071) +#define DCM_SteepKeratometricAxisSequence DcmTagKey(0x0046, 0x0074) +#define DCM_RadiusOfCurvature DcmTagKey(0x0046, 0x0075) +#define DCM_KeratometricPower DcmTagKey(0x0046, 0x0076) +#define DCM_KeratometricAxis DcmTagKey(0x0046, 0x0077) +#define DCM_FlatKeratometricAxisSequence DcmTagKey(0x0046, 0x0080) +#define DCM_BackgroundColor DcmTagKey(0x0046, 0x0092) +#define DCM_Optotype DcmTagKey(0x0046, 0x0094) +#define DCM_OptotypePresentation DcmTagKey(0x0046, 0x0095) +#define DCM_SubjectiveRefractionRightEyeSequence DcmTagKey(0x0046, 0x0097) +#define DCM_SubjectiveRefractionLeftEyeSequence DcmTagKey(0x0046, 0x0098) +#define DCM_AddNearSequence DcmTagKey(0x0046, 0x0100) +#define DCM_AddIntermediateSequence DcmTagKey(0x0046, 0x0101) +#define DCM_AddOtherSequence DcmTagKey(0x0046, 0x0102) +#define DCM_AddPower DcmTagKey(0x0046, 0x0104) +#define DCM_ViewingDistance DcmTagKey(0x0046, 0x0106) +#define DCM_CorneaMeasurementsSequence DcmTagKey(0x0046, 0x0110) +#define DCM_SourceOfCorneaMeasurementDataCodeSequence DcmTagKey(0x0046, 0x0111) +#define DCM_SteepCornealAxisSequence DcmTagKey(0x0046, 0x0112) +#define DCM_FlatCornealAxisSequence DcmTagKey(0x0046, 0x0113) +#define DCM_CornealPower DcmTagKey(0x0046, 0x0114) +#define DCM_CornealAxis DcmTagKey(0x0046, 0x0115) +#define DCM_CorneaMeasurementMethodCodeSequence DcmTagKey(0x0046, 0x0116) +#define DCM_RefractiveIndexOfCornea DcmTagKey(0x0046, 0x0117) +#define DCM_RefractiveIndexOfAqueousHumor DcmTagKey(0x0046, 0x0118) +#define DCM_VisualAcuityTypeCodeSequence DcmTagKey(0x0046, 0x0121) +#define DCM_VisualAcuityRightEyeSequence DcmTagKey(0x0046, 0x0122) +#define DCM_VisualAcuityLeftEyeSequence DcmTagKey(0x0046, 0x0123) +#define DCM_VisualAcuityBothEyesOpenSequence DcmTagKey(0x0046, 0x0124) +#define DCM_ViewingDistanceType DcmTagKey(0x0046, 0x0125) +#define DCM_VisualAcuityModifiers DcmTagKey(0x0046, 0x0135) +#define DCM_DecimalVisualAcuity DcmTagKey(0x0046, 0x0137) +#define DCM_OptotypeDetailedDefinition DcmTagKey(0x0046, 0x0139) +#define DCM_ReferencedRefractiveMeasurementsSequence DcmTagKey(0x0046, 0x0145) +#define DCM_SpherePower DcmTagKey(0x0046, 0x0146) +#define DCM_CylinderPower DcmTagKey(0x0046, 0x0147) +#define DCM_CornealTopographySurface DcmTagKey(0x0046, 0x0201) +#define DCM_CornealVertexLocation DcmTagKey(0x0046, 0x0202) +#define DCM_PupilCentroidXCoordinate DcmTagKey(0x0046, 0x0203) +#define DCM_PupilCentroidYCoordinate DcmTagKey(0x0046, 0x0204) +#define DCM_EquivalentPupilRadius DcmTagKey(0x0046, 0x0205) +#define DCM_CornealTopographyMapTypeCodeSequence DcmTagKey(0x0046, 0x0207) +#define DCM_VerticesOfTheOutlineOfPupil DcmTagKey(0x0046, 0x0208) +#define DCM_CornealTopographyMappingNormalsSequence DcmTagKey(0x0046, 0x0210) +#define DCM_MaximumCornealCurvatureSequence DcmTagKey(0x0046, 0x0211) +#define DCM_MaximumCornealCurvature DcmTagKey(0x0046, 0x0212) +#define DCM_MaximumCornealCurvatureLocation DcmTagKey(0x0046, 0x0213) +#define DCM_MinimumKeratometricSequence DcmTagKey(0x0046, 0x0215) +#define DCM_SimulatedKeratometricCylinderSequence DcmTagKey(0x0046, 0x0218) +#define DCM_AverageCornealPower DcmTagKey(0x0046, 0x0220) +#define DCM_CornealISValue DcmTagKey(0x0046, 0x0224) +#define DCM_AnalyzedArea DcmTagKey(0x0046, 0x0227) +#define DCM_SurfaceRegularityIndex DcmTagKey(0x0046, 0x0230) +#define DCM_SurfaceAsymmetryIndex DcmTagKey(0x0046, 0x0232) +#define DCM_CornealEccentricityIndex DcmTagKey(0x0046, 0x0234) +#define DCM_KeratoconusPredictionIndex DcmTagKey(0x0046, 0x0236) +#define DCM_DecimalPotentialVisualAcuity DcmTagKey(0x0046, 0x0238) +#define DCM_CornealTopographyMapQualityEvaluation DcmTagKey(0x0046, 0x0242) +#define DCM_SourceImageCornealProcessedDataSequence DcmTagKey(0x0046, 0x0244) +#define DCM_CornealPointLocation DcmTagKey(0x0046, 0x0247) +#define DCM_CornealPointEstimated DcmTagKey(0x0046, 0x0248) +#define DCM_AxialPower DcmTagKey(0x0046, 0x0249) +#define DCM_TangentialPower DcmTagKey(0x0046, 0x0250) +#define DCM_RefractivePower DcmTagKey(0x0046, 0x0251) +#define DCM_RelativeElevation DcmTagKey(0x0046, 0x0252) +#define DCM_CornealWavefront DcmTagKey(0x0046, 0x0253) +#define DCM_ImagedVolumeWidth DcmTagKey(0x0048, 0x0001) +#define DCM_ImagedVolumeHeight DcmTagKey(0x0048, 0x0002) +#define DCM_ImagedVolumeDepth DcmTagKey(0x0048, 0x0003) +#define DCM_TotalPixelMatrixColumns DcmTagKey(0x0048, 0x0006) +#define DCM_TotalPixelMatrixRows DcmTagKey(0x0048, 0x0007) +#define DCM_TotalPixelMatrixOriginSequence DcmTagKey(0x0048, 0x0008) +#define DCM_SpecimenLabelInImage DcmTagKey(0x0048, 0x0010) +#define DCM_FocusMethod DcmTagKey(0x0048, 0x0011) +#define DCM_ExtendedDepthOfField DcmTagKey(0x0048, 0x0012) +#define DCM_NumberOfFocalPlanes DcmTagKey(0x0048, 0x0013) +#define DCM_DistanceBetweenFocalPlanes DcmTagKey(0x0048, 0x0014) +#define DCM_RecommendedAbsentPixelCIELabValue DcmTagKey(0x0048, 0x0015) +#define DCM_IlluminatorTypeCodeSequence DcmTagKey(0x0048, 0x0100) +#define DCM_ImageOrientationSlide DcmTagKey(0x0048, 0x0102) +#define DCM_OpticalPathSequence DcmTagKey(0x0048, 0x0105) +#define DCM_OpticalPathIdentifier DcmTagKey(0x0048, 0x0106) +#define DCM_OpticalPathDescription DcmTagKey(0x0048, 0x0107) +#define DCM_IlluminationColorCodeSequence DcmTagKey(0x0048, 0x0108) +#define DCM_SpecimenReferenceSequence DcmTagKey(0x0048, 0x0110) +#define DCM_CondenserLensPower DcmTagKey(0x0048, 0x0111) +#define DCM_ObjectiveLensPower DcmTagKey(0x0048, 0x0112) +#define DCM_ObjectiveLensNumericalAperture DcmTagKey(0x0048, 0x0113) +#define DCM_PaletteColorLookupTableSequence DcmTagKey(0x0048, 0x0120) +#define DCM_ReferencedImageNavigationSequence DcmTagKey(0x0048, 0x0200) +#define DCM_TopLeftHandCornerOfLocalizerArea DcmTagKey(0x0048, 0x0201) +#define DCM_BottomRightHandCornerOfLocalizerArea DcmTagKey(0x0048, 0x0202) +#define DCM_OpticalPathIdentificationSequence DcmTagKey(0x0048, 0x0207) +#define DCM_PlanePositionSlideSequence DcmTagKey(0x0048, 0x021a) +#define DCM_ColumnPositionInTotalImagePixelMatrix DcmTagKey(0x0048, 0x021e) +#define DCM_RowPositionInTotalImagePixelMatrix DcmTagKey(0x0048, 0x021f) +#define DCM_PixelOriginInterpretation DcmTagKey(0x0048, 0x0301) +#define DCM_NumberOfOpticalPaths DcmTagKey(0x0048, 0x0302) +#define DCM_TotalPixelMatrixFocalPlanes DcmTagKey(0x0048, 0x0303) +#define DCM_CalibrationImage DcmTagKey(0x0050, 0x0004) +#define DCM_DeviceSequence DcmTagKey(0x0050, 0x0010) +#define DCM_ContainerComponentTypeCodeSequence DcmTagKey(0x0050, 0x0012) +#define DCM_ContainerComponentThickness DcmTagKey(0x0050, 0x0013) +#define DCM_DeviceLength DcmTagKey(0x0050, 0x0014) +#define DCM_ContainerComponentWidth DcmTagKey(0x0050, 0x0015) +#define DCM_DeviceDiameter DcmTagKey(0x0050, 0x0016) +#define DCM_DeviceDiameterUnits DcmTagKey(0x0050, 0x0017) +#define DCM_DeviceVolume DcmTagKey(0x0050, 0x0018) +#define DCM_InterMarkerDistance DcmTagKey(0x0050, 0x0019) +#define DCM_ContainerComponentMaterial DcmTagKey(0x0050, 0x001a) +#define DCM_ContainerComponentID DcmTagKey(0x0050, 0x001b) +#define DCM_ContainerComponentLength DcmTagKey(0x0050, 0x001c) +#define DCM_ContainerComponentDiameter DcmTagKey(0x0050, 0x001d) +#define DCM_ContainerComponentDescription DcmTagKey(0x0050, 0x001e) +#define DCM_DeviceDescription DcmTagKey(0x0050, 0x0020) +#define DCM_LongDeviceDescription DcmTagKey(0x0050, 0x0021) +#define DCM_ContrastBolusIngredientPercentByVolume DcmTagKey(0x0052, 0x0001) +#define DCM_OCTFocalDistance DcmTagKey(0x0052, 0x0002) +#define DCM_BeamSpotSize DcmTagKey(0x0052, 0x0003) +#define DCM_EffectiveRefractiveIndex DcmTagKey(0x0052, 0x0004) +#define DCM_OCTAcquisitionDomain DcmTagKey(0x0052, 0x0006) +#define DCM_OCTOpticalCenterWavelength DcmTagKey(0x0052, 0x0007) +#define DCM_AxialResolution DcmTagKey(0x0052, 0x0008) +#define DCM_RangingDepth DcmTagKey(0x0052, 0x0009) +#define DCM_ALineRate DcmTagKey(0x0052, 0x0011) +#define DCM_ALinesPerFrame DcmTagKey(0x0052, 0x0012) +#define DCM_CatheterRotationalRate DcmTagKey(0x0052, 0x0013) +#define DCM_ALinePixelSpacing DcmTagKey(0x0052, 0x0014) +#define DCM_ModeOfPercutaneousAccessSequence DcmTagKey(0x0052, 0x0016) +#define DCM_IntravascularOCTFrameTypeSequence DcmTagKey(0x0052, 0x0025) +#define DCM_OCTZOffsetApplied DcmTagKey(0x0052, 0x0026) +#define DCM_IntravascularFrameContentSequence DcmTagKey(0x0052, 0x0027) +#define DCM_IntravascularLongitudinalDistance DcmTagKey(0x0052, 0x0028) +#define DCM_IntravascularOCTFrameContentSequence DcmTagKey(0x0052, 0x0029) +#define DCM_OCTZOffsetCorrection DcmTagKey(0x0052, 0x0030) +#define DCM_CatheterDirectionOfRotation DcmTagKey(0x0052, 0x0031) +#define DCM_SeamLineLocation DcmTagKey(0x0052, 0x0033) +#define DCM_FirstALineLocation DcmTagKey(0x0052, 0x0034) +#define DCM_SeamLineIndex DcmTagKey(0x0052, 0x0036) +#define DCM_NumberOfPaddedALines DcmTagKey(0x0052, 0x0038) +#define DCM_InterpolationType DcmTagKey(0x0052, 0x0039) +#define DCM_RefractiveIndexApplied DcmTagKey(0x0052, 0x003a) +#define DCM_EnergyWindowVector DcmTagKey(0x0054, 0x0010) +#define DCM_NumberOfEnergyWindows DcmTagKey(0x0054, 0x0011) +#define DCM_EnergyWindowInformationSequence DcmTagKey(0x0054, 0x0012) +#define DCM_EnergyWindowRangeSequence DcmTagKey(0x0054, 0x0013) +#define DCM_EnergyWindowLowerLimit DcmTagKey(0x0054, 0x0014) +#define DCM_EnergyWindowUpperLimit DcmTagKey(0x0054, 0x0015) +#define DCM_RadiopharmaceuticalInformationSequence DcmTagKey(0x0054, 0x0016) +#define DCM_ResidualSyringeCounts DcmTagKey(0x0054, 0x0017) +#define DCM_EnergyWindowName DcmTagKey(0x0054, 0x0018) +#define DCM_DetectorVector DcmTagKey(0x0054, 0x0020) +#define DCM_NumberOfDetectors DcmTagKey(0x0054, 0x0021) +#define DCM_DetectorInformationSequence DcmTagKey(0x0054, 0x0022) +#define DCM_PhaseVector DcmTagKey(0x0054, 0x0030) +#define DCM_NumberOfPhases DcmTagKey(0x0054, 0x0031) +#define DCM_PhaseInformationSequence DcmTagKey(0x0054, 0x0032) +#define DCM_NumberOfFramesInPhase DcmTagKey(0x0054, 0x0033) +#define DCM_PhaseDelay DcmTagKey(0x0054, 0x0036) +#define DCM_PauseBetweenFrames DcmTagKey(0x0054, 0x0038) +#define DCM_PhaseDescription DcmTagKey(0x0054, 0x0039) +#define DCM_RotationVector DcmTagKey(0x0054, 0x0050) +#define DCM_NumberOfRotations DcmTagKey(0x0054, 0x0051) +#define DCM_RotationInformationSequence DcmTagKey(0x0054, 0x0052) +#define DCM_NumberOfFramesInRotation DcmTagKey(0x0054, 0x0053) +#define DCM_RRIntervalVector DcmTagKey(0x0054, 0x0060) +#define DCM_NumberOfRRIntervals DcmTagKey(0x0054, 0x0061) +#define DCM_GatedInformationSequence DcmTagKey(0x0054, 0x0062) +#define DCM_DataInformationSequence DcmTagKey(0x0054, 0x0063) +#define DCM_TimeSlotVector DcmTagKey(0x0054, 0x0070) +#define DCM_NumberOfTimeSlots DcmTagKey(0x0054, 0x0071) +#define DCM_TimeSlotInformationSequence DcmTagKey(0x0054, 0x0072) +#define DCM_TimeSlotTime DcmTagKey(0x0054, 0x0073) +#define DCM_SliceVector DcmTagKey(0x0054, 0x0080) +#define DCM_NumberOfSlices DcmTagKey(0x0054, 0x0081) +#define DCM_AngularViewVector DcmTagKey(0x0054, 0x0090) +#define DCM_TimeSliceVector DcmTagKey(0x0054, 0x0100) +#define DCM_NumberOfTimeSlices DcmTagKey(0x0054, 0x0101) +#define DCM_StartAngle DcmTagKey(0x0054, 0x0200) +#define DCM_TypeOfDetectorMotion DcmTagKey(0x0054, 0x0202) +#define DCM_TriggerVector DcmTagKey(0x0054, 0x0210) +#define DCM_NumberOfTriggersInPhase DcmTagKey(0x0054, 0x0211) +#define DCM_ViewCodeSequence DcmTagKey(0x0054, 0x0220) +#define DCM_ViewModifierCodeSequence DcmTagKey(0x0054, 0x0222) +#define DCM_RadionuclideCodeSequence DcmTagKey(0x0054, 0x0300) +#define DCM_AdministrationRouteCodeSequence DcmTagKey(0x0054, 0x0302) +#define DCM_RadiopharmaceuticalCodeSequence DcmTagKey(0x0054, 0x0304) +#define DCM_CalibrationDataSequence DcmTagKey(0x0054, 0x0306) +#define DCM_EnergyWindowNumber DcmTagKey(0x0054, 0x0308) +#define DCM_ImageID DcmTagKey(0x0054, 0x0400) +#define DCM_PatientOrientationCodeSequence DcmTagKey(0x0054, 0x0410) +#define DCM_PatientOrientationModifierCodeSequence DcmTagKey(0x0054, 0x0412) +#define DCM_PatientGantryRelationshipCodeSequence DcmTagKey(0x0054, 0x0414) +#define DCM_SliceProgressionDirection DcmTagKey(0x0054, 0x0500) +#define DCM_ScanProgressionDirection DcmTagKey(0x0054, 0x0501) +#define DCM_SeriesType DcmTagKey(0x0054, 0x1000) +#define DCM_Units DcmTagKey(0x0054, 0x1001) +#define DCM_CountsSource DcmTagKey(0x0054, 0x1002) +#define DCM_ReprojectionMethod DcmTagKey(0x0054, 0x1004) +#define DCM_SUVType DcmTagKey(0x0054, 0x1006) +#define DCM_RandomsCorrectionMethod DcmTagKey(0x0054, 0x1100) +#define DCM_AttenuationCorrectionMethod DcmTagKey(0x0054, 0x1101) +#define DCM_DecayCorrection DcmTagKey(0x0054, 0x1102) +#define DCM_ReconstructionMethod DcmTagKey(0x0054, 0x1103) +#define DCM_DetectorLinesOfResponseUsed DcmTagKey(0x0054, 0x1104) +#define DCM_ScatterCorrectionMethod DcmTagKey(0x0054, 0x1105) +#define DCM_AxialAcceptance DcmTagKey(0x0054, 0x1200) +#define DCM_AxialMash DcmTagKey(0x0054, 0x1201) +#define DCM_TransverseMash DcmTagKey(0x0054, 0x1202) +#define DCM_DetectorElementSize DcmTagKey(0x0054, 0x1203) +#define DCM_CoincidenceWindowWidth DcmTagKey(0x0054, 0x1210) +#define DCM_SecondaryCountsType DcmTagKey(0x0054, 0x1220) +#define DCM_FrameReferenceTime DcmTagKey(0x0054, 0x1300) +#define DCM_PrimaryPromptsCountsAccumulated DcmTagKey(0x0054, 0x1310) +#define DCM_SecondaryCountsAccumulated DcmTagKey(0x0054, 0x1311) +#define DCM_SliceSensitivityFactor DcmTagKey(0x0054, 0x1320) +#define DCM_DecayFactor DcmTagKey(0x0054, 0x1321) +#define DCM_DoseCalibrationFactor DcmTagKey(0x0054, 0x1322) +#define DCM_ScatterFractionFactor DcmTagKey(0x0054, 0x1323) +#define DCM_DeadTimeFactor DcmTagKey(0x0054, 0x1324) +#define DCM_ImageIndex DcmTagKey(0x0054, 0x1330) +#define DCM_RETIRED_CountsIncluded DcmTagKey(0x0054, 0x1400) +#define DCM_RETIRED_DeadTimeCorrectionFlag DcmTagKey(0x0054, 0x1401) +#define DCM_HistogramSequence DcmTagKey(0x0060, 0x3000) +#define DCM_HistogramNumberOfBins DcmTagKey(0x0060, 0x3002) +#define DCM_HistogramFirstBinValue DcmTagKey(0x0060, 0x3004) +#define DCM_HistogramLastBinValue DcmTagKey(0x0060, 0x3006) +#define DCM_HistogramBinWidth DcmTagKey(0x0060, 0x3008) +#define DCM_HistogramExplanation DcmTagKey(0x0060, 0x3010) +#define DCM_HistogramData DcmTagKey(0x0060, 0x3020) +#define DCM_SegmentationType DcmTagKey(0x0062, 0x0001) +#define DCM_SegmentSequence DcmTagKey(0x0062, 0x0002) +#define DCM_SegmentedPropertyCategoryCodeSequence DcmTagKey(0x0062, 0x0003) +#define DCM_SegmentNumber DcmTagKey(0x0062, 0x0004) +#define DCM_SegmentLabel DcmTagKey(0x0062, 0x0005) +#define DCM_SegmentDescription DcmTagKey(0x0062, 0x0006) +#define DCM_SegmentationAlgorithmIdentificationSequence DcmTagKey(0x0062, 0x0007) +#define DCM_SegmentAlgorithmType DcmTagKey(0x0062, 0x0008) +#define DCM_SegmentAlgorithmName DcmTagKey(0x0062, 0x0009) +#define DCM_SegmentIdentificationSequence DcmTagKey(0x0062, 0x000a) +#define DCM_ReferencedSegmentNumber DcmTagKey(0x0062, 0x000b) +#define DCM_RecommendedDisplayGrayscaleValue DcmTagKey(0x0062, 0x000c) +#define DCM_RecommendedDisplayCIELabValue DcmTagKey(0x0062, 0x000d) +#define DCM_MaximumFractionalValue DcmTagKey(0x0062, 0x000e) +#define DCM_SegmentedPropertyTypeCodeSequence DcmTagKey(0x0062, 0x000f) +#define DCM_SegmentationFractionalType DcmTagKey(0x0062, 0x0010) +#define DCM_SegmentedPropertyTypeModifierCodeSequence DcmTagKey(0x0062, 0x0011) +#define DCM_UsedSegmentsSequence DcmTagKey(0x0062, 0x0012) +#define DCM_SegmentsOverlap DcmTagKey(0x0062, 0x0013) +#define DCM_TrackingID DcmTagKey(0x0062, 0x0020) +#define DCM_TrackingUID DcmTagKey(0x0062, 0x0021) +#define DCM_DeformableRegistrationSequence DcmTagKey(0x0064, 0x0002) +#define DCM_SourceFrameOfReferenceUID DcmTagKey(0x0064, 0x0003) +#define DCM_DeformableRegistrationGridSequence DcmTagKey(0x0064, 0x0005) +#define DCM_GridDimensions DcmTagKey(0x0064, 0x0007) +#define DCM_GridResolution DcmTagKey(0x0064, 0x0008) +#define DCM_VectorGridData DcmTagKey(0x0064, 0x0009) +#define DCM_PreDeformationMatrixRegistrationSequence DcmTagKey(0x0064, 0x000f) +#define DCM_PostDeformationMatrixRegistrationSequence DcmTagKey(0x0064, 0x0010) +#define DCM_NumberOfSurfaces DcmTagKey(0x0066, 0x0001) +#define DCM_SurfaceSequence DcmTagKey(0x0066, 0x0002) +#define DCM_SurfaceNumber DcmTagKey(0x0066, 0x0003) +#define DCM_SurfaceComments DcmTagKey(0x0066, 0x0004) +#define DCM_SurfaceProcessing DcmTagKey(0x0066, 0x0009) +#define DCM_SurfaceProcessingRatio DcmTagKey(0x0066, 0x000a) +#define DCM_SurfaceProcessingDescription DcmTagKey(0x0066, 0x000b) +#define DCM_RecommendedPresentationOpacity DcmTagKey(0x0066, 0x000c) +#define DCM_RecommendedPresentationType DcmTagKey(0x0066, 0x000d) +#define DCM_FiniteVolume DcmTagKey(0x0066, 0x000e) +#define DCM_Manifold DcmTagKey(0x0066, 0x0010) +#define DCM_SurfacePointsSequence DcmTagKey(0x0066, 0x0011) +#define DCM_SurfacePointsNormalsSequence DcmTagKey(0x0066, 0x0012) +#define DCM_SurfaceMeshPrimitivesSequence DcmTagKey(0x0066, 0x0013) +#define DCM_NumberOfSurfacePoints DcmTagKey(0x0066, 0x0015) +#define DCM_PointCoordinatesData DcmTagKey(0x0066, 0x0016) +#define DCM_PointPositionAccuracy DcmTagKey(0x0066, 0x0017) +#define DCM_MeanPointDistance DcmTagKey(0x0066, 0x0018) +#define DCM_MaximumPointDistance DcmTagKey(0x0066, 0x0019) +#define DCM_PointsBoundingBoxCoordinates DcmTagKey(0x0066, 0x001a) +#define DCM_AxisOfRotation DcmTagKey(0x0066, 0x001b) +#define DCM_CenterOfRotation DcmTagKey(0x0066, 0x001c) +#define DCM_NumberOfVectors DcmTagKey(0x0066, 0x001e) +#define DCM_VectorDimensionality DcmTagKey(0x0066, 0x001f) +#define DCM_VectorAccuracy DcmTagKey(0x0066, 0x0020) +#define DCM_VectorCoordinateData DcmTagKey(0x0066, 0x0021) +#define DCM_RETIRED_TrianglePointIndexList DcmTagKey(0x0066, 0x0023) +#define DCM_RETIRED_EdgePointIndexList DcmTagKey(0x0066, 0x0024) +#define DCM_RETIRED_VertexPointIndexList DcmTagKey(0x0066, 0x0025) +#define DCM_TriangleStripSequence DcmTagKey(0x0066, 0x0026) +#define DCM_TriangleFanSequence DcmTagKey(0x0066, 0x0027) +#define DCM_LineSequence DcmTagKey(0x0066, 0x0028) +#define DCM_RETIRED_PrimitivePointIndexList DcmTagKey(0x0066, 0x0029) +#define DCM_SurfaceCount DcmTagKey(0x0066, 0x002a) +#define DCM_ReferencedSurfaceSequence DcmTagKey(0x0066, 0x002b) +#define DCM_ReferencedSurfaceNumber DcmTagKey(0x0066, 0x002c) +#define DCM_SegmentSurfaceGenerationAlgorithmIdentificationSequence DcmTagKey(0x0066, 0x002d) +#define DCM_SegmentSurfaceSourceInstanceSequence DcmTagKey(0x0066, 0x002e) +#define DCM_AlgorithmFamilyCodeSequence DcmTagKey(0x0066, 0x002f) +#define DCM_AlgorithmNameCodeSequence DcmTagKey(0x0066, 0x0030) +#define DCM_AlgorithmVersion DcmTagKey(0x0066, 0x0031) +#define DCM_AlgorithmParameters DcmTagKey(0x0066, 0x0032) +#define DCM_FacetSequence DcmTagKey(0x0066, 0x0034) +#define DCM_SurfaceProcessingAlgorithmIdentificationSequence DcmTagKey(0x0066, 0x0035) +#define DCM_AlgorithmName DcmTagKey(0x0066, 0x0036) +#define DCM_RecommendedPointRadius DcmTagKey(0x0066, 0x0037) +#define DCM_RecommendedLineThickness DcmTagKey(0x0066, 0x0038) +#define DCM_LongPrimitivePointIndexList DcmTagKey(0x0066, 0x0040) +#define DCM_LongTrianglePointIndexList DcmTagKey(0x0066, 0x0041) +#define DCM_LongEdgePointIndexList DcmTagKey(0x0066, 0x0042) +#define DCM_LongVertexPointIndexList DcmTagKey(0x0066, 0x0043) +#define DCM_TrackSetSequence DcmTagKey(0x0066, 0x0101) +#define DCM_TrackSequence DcmTagKey(0x0066, 0x0102) +#define DCM_RecommendedDisplayCIELabValueList DcmTagKey(0x0066, 0x0103) +#define DCM_TrackingAlgorithmIdentificationSequence DcmTagKey(0x0066, 0x0104) +#define DCM_TrackSetNumber DcmTagKey(0x0066, 0x0105) +#define DCM_TrackSetLabel DcmTagKey(0x0066, 0x0106) +#define DCM_TrackSetDescription DcmTagKey(0x0066, 0x0107) +#define DCM_TrackSetAnatomicalTypeCodeSequence DcmTagKey(0x0066, 0x0108) +#define DCM_MeasurementsSequence DcmTagKey(0x0066, 0x0121) +#define DCM_TrackSetStatisticsSequence DcmTagKey(0x0066, 0x0124) +#define DCM_FloatingPointValues DcmTagKey(0x0066, 0x0125) +#define DCM_TrackPointIndexList DcmTagKey(0x0066, 0x0129) +#define DCM_TrackStatisticsSequence DcmTagKey(0x0066, 0x0130) +#define DCM_MeasurementValuesSequence DcmTagKey(0x0066, 0x0132) +#define DCM_DiffusionAcquisitionCodeSequence DcmTagKey(0x0066, 0x0133) +#define DCM_DiffusionModelCodeSequence DcmTagKey(0x0066, 0x0134) +#define DCM_ImplantSize DcmTagKey(0x0068, 0x6210) +#define DCM_ImplantTemplateVersion DcmTagKey(0x0068, 0x6221) +#define DCM_ReplacedImplantTemplateSequence DcmTagKey(0x0068, 0x6222) +#define DCM_ImplantType DcmTagKey(0x0068, 0x6223) +#define DCM_DerivationImplantTemplateSequence DcmTagKey(0x0068, 0x6224) +#define DCM_OriginalImplantTemplateSequence DcmTagKey(0x0068, 0x6225) +#define DCM_EffectiveDateTime DcmTagKey(0x0068, 0x6226) +#define DCM_ImplantTargetAnatomySequence DcmTagKey(0x0068, 0x6230) +#define DCM_InformationFromManufacturerSequence DcmTagKey(0x0068, 0x6260) +#define DCM_NotificationFromManufacturerSequence DcmTagKey(0x0068, 0x6265) +#define DCM_InformationIssueDateTime DcmTagKey(0x0068, 0x6270) +#define DCM_InformationSummary DcmTagKey(0x0068, 0x6280) +#define DCM_ImplantRegulatoryDisapprovalCodeSequence DcmTagKey(0x0068, 0x62a0) +#define DCM_OverallTemplateSpatialTolerance DcmTagKey(0x0068, 0x62a5) +#define DCM_HPGLDocumentSequence DcmTagKey(0x0068, 0x62c0) +#define DCM_HPGLDocumentID DcmTagKey(0x0068, 0x62d0) +#define DCM_HPGLDocumentLabel DcmTagKey(0x0068, 0x62d5) +#define DCM_ViewOrientationCodeSequence DcmTagKey(0x0068, 0x62e0) +#define DCM_ViewOrientationModifierCodeSequence DcmTagKey(0x0068, 0x62f0) +#define DCM_HPGLDocumentScaling DcmTagKey(0x0068, 0x62f2) +#define DCM_HPGLDocument DcmTagKey(0x0068, 0x6300) +#define DCM_HPGLContourPenNumber DcmTagKey(0x0068, 0x6310) +#define DCM_HPGLPenSequence DcmTagKey(0x0068, 0x6320) +#define DCM_HPGLPenNumber DcmTagKey(0x0068, 0x6330) +#define DCM_HPGLPenLabel DcmTagKey(0x0068, 0x6340) +#define DCM_HPGLPenDescription DcmTagKey(0x0068, 0x6345) +#define DCM_RecommendedRotationPoint DcmTagKey(0x0068, 0x6346) +#define DCM_BoundingRectangle DcmTagKey(0x0068, 0x6347) +#define DCM_ImplantTemplate3DModelSurfaceNumber DcmTagKey(0x0068, 0x6350) +#define DCM_SurfaceModelDescriptionSequence DcmTagKey(0x0068, 0x6360) +#define DCM_SurfaceModelLabel DcmTagKey(0x0068, 0x6380) +#define DCM_SurfaceModelScalingFactor DcmTagKey(0x0068, 0x6390) +#define DCM_MaterialsCodeSequence DcmTagKey(0x0068, 0x63a0) +#define DCM_CoatingMaterialsCodeSequence DcmTagKey(0x0068, 0x63a4) +#define DCM_ImplantTypeCodeSequence DcmTagKey(0x0068, 0x63a8) +#define DCM_FixationMethodCodeSequence DcmTagKey(0x0068, 0x63ac) +#define DCM_MatingFeatureSetsSequence DcmTagKey(0x0068, 0x63b0) +#define DCM_MatingFeatureSetID DcmTagKey(0x0068, 0x63c0) +#define DCM_MatingFeatureSetLabel DcmTagKey(0x0068, 0x63d0) +#define DCM_MatingFeatureSequence DcmTagKey(0x0068, 0x63e0) +#define DCM_MatingFeatureID DcmTagKey(0x0068, 0x63f0) +#define DCM_MatingFeatureDegreeOfFreedomSequence DcmTagKey(0x0068, 0x6400) +#define DCM_DegreeOfFreedomID DcmTagKey(0x0068, 0x6410) +#define DCM_DegreeOfFreedomType DcmTagKey(0x0068, 0x6420) +#define DCM_TwoDMatingFeatureCoordinatesSequence DcmTagKey(0x0068, 0x6430) +#define DCM_ReferencedHPGLDocumentID DcmTagKey(0x0068, 0x6440) +#define DCM_TwoDMatingPoint DcmTagKey(0x0068, 0x6450) +#define DCM_TwoDMatingAxes DcmTagKey(0x0068, 0x6460) +#define DCM_TwoDDegreeOfFreedomSequence DcmTagKey(0x0068, 0x6470) +#define DCM_ThreeDDegreeOfFreedomAxis DcmTagKey(0x0068, 0x6490) +#define DCM_RangeOfFreedom DcmTagKey(0x0068, 0x64a0) +#define DCM_ThreeDMatingPoint DcmTagKey(0x0068, 0x64c0) +#define DCM_ThreeDMatingAxes DcmTagKey(0x0068, 0x64d0) +#define DCM_TwoDDegreeOfFreedomAxis DcmTagKey(0x0068, 0x64f0) +#define DCM_PlanningLandmarkPointSequence DcmTagKey(0x0068, 0x6500) +#define DCM_PlanningLandmarkLineSequence DcmTagKey(0x0068, 0x6510) +#define DCM_PlanningLandmarkPlaneSequence DcmTagKey(0x0068, 0x6520) +#define DCM_PlanningLandmarkID DcmTagKey(0x0068, 0x6530) +#define DCM_PlanningLandmarkDescription DcmTagKey(0x0068, 0x6540) +#define DCM_PlanningLandmarkIdentificationCodeSequence DcmTagKey(0x0068, 0x6545) +#define DCM_TwoDPointCoordinatesSequence DcmTagKey(0x0068, 0x6550) +#define DCM_TwoDPointCoordinates DcmTagKey(0x0068, 0x6560) +#define DCM_ThreeDPointCoordinates DcmTagKey(0x0068, 0x6590) +#define DCM_TwoDLineCoordinatesSequence DcmTagKey(0x0068, 0x65a0) +#define DCM_TwoDLineCoordinates DcmTagKey(0x0068, 0x65b0) +#define DCM_ThreeDLineCoordinates DcmTagKey(0x0068, 0x65d0) +#define DCM_TwoDPlaneCoordinatesSequence DcmTagKey(0x0068, 0x65e0) +#define DCM_TwoDPlaneIntersection DcmTagKey(0x0068, 0x65f0) +#define DCM_ThreeDPlaneOrigin DcmTagKey(0x0068, 0x6610) +#define DCM_ThreeDPlaneNormal DcmTagKey(0x0068, 0x6620) +#define DCM_ModelModification DcmTagKey(0x0068, 0x7001) +#define DCM_ModelMirroring DcmTagKey(0x0068, 0x7002) +#define DCM_ModelUsageCodeSequence DcmTagKey(0x0068, 0x7003) +#define DCM_GraphicAnnotationSequence DcmTagKey(0x0070, 0x0001) +#define DCM_GraphicLayer DcmTagKey(0x0070, 0x0002) +#define DCM_BoundingBoxAnnotationUnits DcmTagKey(0x0070, 0x0003) +#define DCM_AnchorPointAnnotationUnits DcmTagKey(0x0070, 0x0004) +#define DCM_GraphicAnnotationUnits DcmTagKey(0x0070, 0x0005) +#define DCM_UnformattedTextValue DcmTagKey(0x0070, 0x0006) +#define DCM_TextObjectSequence DcmTagKey(0x0070, 0x0008) +#define DCM_GraphicObjectSequence DcmTagKey(0x0070, 0x0009) +#define DCM_BoundingBoxTopLeftHandCorner DcmTagKey(0x0070, 0x0010) +#define DCM_BoundingBoxBottomRightHandCorner DcmTagKey(0x0070, 0x0011) +#define DCM_BoundingBoxTextHorizontalJustification DcmTagKey(0x0070, 0x0012) +#define DCM_AnchorPoint DcmTagKey(0x0070, 0x0014) +#define DCM_AnchorPointVisibility DcmTagKey(0x0070, 0x0015) +#define DCM_GraphicDimensions DcmTagKey(0x0070, 0x0020) +#define DCM_NumberOfGraphicPoints DcmTagKey(0x0070, 0x0021) +#define DCM_GraphicData DcmTagKey(0x0070, 0x0022) +#define DCM_GraphicType DcmTagKey(0x0070, 0x0023) +#define DCM_GraphicFilled DcmTagKey(0x0070, 0x0024) +#define DCM_RETIRED_ImageRotationRetired DcmTagKey(0x0070, 0x0040) +#define DCM_ImageHorizontalFlip DcmTagKey(0x0070, 0x0041) +#define DCM_ImageRotation DcmTagKey(0x0070, 0x0042) +#define DCM_RETIRED_DisplayedAreaTopLeftHandCornerTrial DcmTagKey(0x0070, 0x0050) +#define DCM_RETIRED_DisplayedAreaBottomRightHandCornerTrial DcmTagKey(0x0070, 0x0051) +#define DCM_DisplayedAreaTopLeftHandCorner DcmTagKey(0x0070, 0x0052) +#define DCM_DisplayedAreaBottomRightHandCorner DcmTagKey(0x0070, 0x0053) +#define DCM_DisplayedAreaSelectionSequence DcmTagKey(0x0070, 0x005a) +#define DCM_GraphicLayerSequence DcmTagKey(0x0070, 0x0060) +#define DCM_GraphicLayerOrder DcmTagKey(0x0070, 0x0062) +#define DCM_GraphicLayerRecommendedDisplayGrayscaleValue DcmTagKey(0x0070, 0x0066) +#define DCM_RETIRED_GraphicLayerRecommendedDisplayRGBValue DcmTagKey(0x0070, 0x0067) +#define DCM_GraphicLayerDescription DcmTagKey(0x0070, 0x0068) +#define DCM_ContentLabel DcmTagKey(0x0070, 0x0080) +#define DCM_ContentDescription DcmTagKey(0x0070, 0x0081) +#define DCM_PresentationCreationDate DcmTagKey(0x0070, 0x0082) +#define DCM_PresentationCreationTime DcmTagKey(0x0070, 0x0083) +#define DCM_ContentCreatorName DcmTagKey(0x0070, 0x0084) +#define DCM_ContentCreatorIdentificationCodeSequence DcmTagKey(0x0070, 0x0086) +#define DCM_AlternateContentDescriptionSequence DcmTagKey(0x0070, 0x0087) +#define DCM_PresentationSizeMode DcmTagKey(0x0070, 0x0100) +#define DCM_PresentationPixelSpacing DcmTagKey(0x0070, 0x0101) +#define DCM_PresentationPixelAspectRatio DcmTagKey(0x0070, 0x0102) +#define DCM_PresentationPixelMagnificationRatio DcmTagKey(0x0070, 0x0103) +#define DCM_GraphicGroupLabel DcmTagKey(0x0070, 0x0207) +#define DCM_GraphicGroupDescription DcmTagKey(0x0070, 0x0208) +#define DCM_CompoundGraphicSequence DcmTagKey(0x0070, 0x0209) +#define DCM_CompoundGraphicInstanceID DcmTagKey(0x0070, 0x0226) +#define DCM_FontName DcmTagKey(0x0070, 0x0227) +#define DCM_FontNameType DcmTagKey(0x0070, 0x0228) +#define DCM_CSSFontName DcmTagKey(0x0070, 0x0229) +#define DCM_RotationAngle DcmTagKey(0x0070, 0x0230) +#define DCM_TextStyleSequence DcmTagKey(0x0070, 0x0231) +#define DCM_LineStyleSequence DcmTagKey(0x0070, 0x0232) +#define DCM_FillStyleSequence DcmTagKey(0x0070, 0x0233) +#define DCM_GraphicGroupSequence DcmTagKey(0x0070, 0x0234) +#define DCM_TextColorCIELabValue DcmTagKey(0x0070, 0x0241) +#define DCM_HorizontalAlignment DcmTagKey(0x0070, 0x0242) +#define DCM_VerticalAlignment DcmTagKey(0x0070, 0x0243) +#define DCM_ShadowStyle DcmTagKey(0x0070, 0x0244) +#define DCM_ShadowOffsetX DcmTagKey(0x0070, 0x0245) +#define DCM_ShadowOffsetY DcmTagKey(0x0070, 0x0246) +#define DCM_ShadowColorCIELabValue DcmTagKey(0x0070, 0x0247) +#define DCM_Underlined DcmTagKey(0x0070, 0x0248) +#define DCM_Bold DcmTagKey(0x0070, 0x0249) +#define DCM_Italic DcmTagKey(0x0070, 0x0250) +#define DCM_PatternOnColorCIELabValue DcmTagKey(0x0070, 0x0251) +#define DCM_PatternOffColorCIELabValue DcmTagKey(0x0070, 0x0252) +#define DCM_LineThickness DcmTagKey(0x0070, 0x0253) +#define DCM_LineDashingStyle DcmTagKey(0x0070, 0x0254) +#define DCM_LinePattern DcmTagKey(0x0070, 0x0255) +#define DCM_FillPattern DcmTagKey(0x0070, 0x0256) +#define DCM_FillMode DcmTagKey(0x0070, 0x0257) +#define DCM_ShadowOpacity DcmTagKey(0x0070, 0x0258) +#define DCM_GapLength DcmTagKey(0x0070, 0x0261) +#define DCM_DiameterOfVisibility DcmTagKey(0x0070, 0x0262) +#define DCM_RotationPoint DcmTagKey(0x0070, 0x0273) +#define DCM_TickAlignment DcmTagKey(0x0070, 0x0274) +#define DCM_ShowTickLabel DcmTagKey(0x0070, 0x0278) +#define DCM_TickLabelAlignment DcmTagKey(0x0070, 0x0279) +#define DCM_CompoundGraphicUnits DcmTagKey(0x0070, 0x0282) +#define DCM_PatternOnOpacity DcmTagKey(0x0070, 0x0284) +#define DCM_PatternOffOpacity DcmTagKey(0x0070, 0x0285) +#define DCM_MajorTicksSequence DcmTagKey(0x0070, 0x0287) +#define DCM_TickPosition DcmTagKey(0x0070, 0x0288) +#define DCM_TickLabel DcmTagKey(0x0070, 0x0289) +#define DCM_CompoundGraphicType DcmTagKey(0x0070, 0x0294) +#define DCM_GraphicGroupID DcmTagKey(0x0070, 0x0295) +#define DCM_ShapeType DcmTagKey(0x0070, 0x0306) +#define DCM_RegistrationSequence DcmTagKey(0x0070, 0x0308) +#define DCM_MatrixRegistrationSequence DcmTagKey(0x0070, 0x0309) +#define DCM_MatrixSequence DcmTagKey(0x0070, 0x030a) +#define DCM_FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix DcmTagKey(0x0070, 0x030b) +#define DCM_FrameOfReferenceTransformationMatrixType DcmTagKey(0x0070, 0x030c) +#define DCM_RegistrationTypeCodeSequence DcmTagKey(0x0070, 0x030d) +#define DCM_FiducialDescription DcmTagKey(0x0070, 0x030f) +#define DCM_FiducialIdentifier DcmTagKey(0x0070, 0x0310) +#define DCM_FiducialIdentifierCodeSequence DcmTagKey(0x0070, 0x0311) +#define DCM_ContourUncertaintyRadius DcmTagKey(0x0070, 0x0312) +#define DCM_UsedFiducialsSequence DcmTagKey(0x0070, 0x0314) +#define DCM_GraphicCoordinatesDataSequence DcmTagKey(0x0070, 0x0318) +#define DCM_FiducialUID DcmTagKey(0x0070, 0x031a) +#define DCM_ReferencedFiducialUID DcmTagKey(0x0070, 0x031b) +#define DCM_FiducialSetSequence DcmTagKey(0x0070, 0x031c) +#define DCM_FiducialSequence DcmTagKey(0x0070, 0x031e) +#define DCM_FiducialsPropertyCategoryCodeSequence DcmTagKey(0x0070, 0x031f) +#define DCM_GraphicLayerRecommendedDisplayCIELabValue DcmTagKey(0x0070, 0x0401) +#define DCM_BlendingSequence DcmTagKey(0x0070, 0x0402) +#define DCM_RelativeOpacity DcmTagKey(0x0070, 0x0403) +#define DCM_ReferencedSpatialRegistrationSequence DcmTagKey(0x0070, 0x0404) +#define DCM_BlendingPosition DcmTagKey(0x0070, 0x0405) +#define DCM_PresentationDisplayCollectionUID DcmTagKey(0x0070, 0x1101) +#define DCM_PresentationSequenceCollectionUID DcmTagKey(0x0070, 0x1102) +#define DCM_PresentationSequencePositionIndex DcmTagKey(0x0070, 0x1103) +#define DCM_RenderedImageReferenceSequence DcmTagKey(0x0070, 0x1104) +#define DCM_VolumetricPresentationStateInputSequence DcmTagKey(0x0070, 0x1201) +#define DCM_PresentationInputType DcmTagKey(0x0070, 0x1202) +#define DCM_InputSequencePositionIndex DcmTagKey(0x0070, 0x1203) +#define DCM_Crop DcmTagKey(0x0070, 0x1204) +#define DCM_CroppingSpecificationIndex DcmTagKey(0x0070, 0x1205) +#define DCM_RETIRED_CompositingMethod DcmTagKey(0x0070, 0x1206) +#define DCM_VolumetricPresentationInputNumber DcmTagKey(0x0070, 0x1207) +#define DCM_ImageVolumeGeometry DcmTagKey(0x0070, 0x1208) +#define DCM_VolumetricPresentationInputSetUID DcmTagKey(0x0070, 0x1209) +#define DCM_VolumetricPresentationInputSetSequence DcmTagKey(0x0070, 0x120a) +#define DCM_GlobalCrop DcmTagKey(0x0070, 0x120b) +#define DCM_GlobalCroppingSpecificationIndex DcmTagKey(0x0070, 0x120c) +#define DCM_RenderingMethod DcmTagKey(0x0070, 0x120d) +#define DCM_VolumeCroppingSequence DcmTagKey(0x0070, 0x1301) +#define DCM_VolumeCroppingMethod DcmTagKey(0x0070, 0x1302) +#define DCM_BoundingBoxCrop DcmTagKey(0x0070, 0x1303) +#define DCM_ObliqueCroppingPlaneSequence DcmTagKey(0x0070, 0x1304) +#define DCM_Plane DcmTagKey(0x0070, 0x1305) +#define DCM_PlaneNormal DcmTagKey(0x0070, 0x1306) +#define DCM_CroppingSpecificationNumber DcmTagKey(0x0070, 0x1309) +#define DCM_MultiPlanarReconstructionStyle DcmTagKey(0x0070, 0x1501) +#define DCM_MPRThicknessType DcmTagKey(0x0070, 0x1502) +#define DCM_MPRSlabThickness DcmTagKey(0x0070, 0x1503) +#define DCM_MPRTopLeftHandCorner DcmTagKey(0x0070, 0x1505) +#define DCM_MPRViewWidthDirection DcmTagKey(0x0070, 0x1507) +#define DCM_MPRViewWidth DcmTagKey(0x0070, 0x1508) +#define DCM_NumberOfVolumetricCurvePoints DcmTagKey(0x0070, 0x150c) +#define DCM_VolumetricCurvePoints DcmTagKey(0x0070, 0x150d) +#define DCM_MPRViewHeightDirection DcmTagKey(0x0070, 0x1511) +#define DCM_MPRViewHeight DcmTagKey(0x0070, 0x1512) +#define DCM_RenderProjection DcmTagKey(0x0070, 0x1602) +#define DCM_ViewpointPosition DcmTagKey(0x0070, 0x1603) +#define DCM_ViewpointLookAtPoint DcmTagKey(0x0070, 0x1604) +#define DCM_ViewpointUpDirection DcmTagKey(0x0070, 0x1605) +#define DCM_RenderFieldOfView DcmTagKey(0x0070, 0x1606) +#define DCM_SamplingStepSize DcmTagKey(0x0070, 0x1607) +#define DCM_ShadingStyle DcmTagKey(0x0070, 0x1701) +#define DCM_AmbientReflectionIntensity DcmTagKey(0x0070, 0x1702) +#define DCM_LightDirection DcmTagKey(0x0070, 0x1703) +#define DCM_DiffuseReflectionIntensity DcmTagKey(0x0070, 0x1704) +#define DCM_SpecularReflectionIntensity DcmTagKey(0x0070, 0x1705) +#define DCM_Shininess DcmTagKey(0x0070, 0x1706) +#define DCM_PresentationStateClassificationComponentSequence DcmTagKey(0x0070, 0x1801) +#define DCM_ComponentType DcmTagKey(0x0070, 0x1802) +#define DCM_ComponentInputSequence DcmTagKey(0x0070, 0x1803) +#define DCM_VolumetricPresentationInputIndex DcmTagKey(0x0070, 0x1804) +#define DCM_PresentationStateCompositorComponentSequence DcmTagKey(0x0070, 0x1805) +#define DCM_WeightingTransferFunctionSequence DcmTagKey(0x0070, 0x1806) +#define DCM_WeightingLookupTableDescriptor DcmTagKey(0x0070, 0x1807) +#define DCM_WeightingLookupTableData DcmTagKey(0x0070, 0x1808) +#define DCM_VolumetricAnnotationSequence DcmTagKey(0x0070, 0x1901) +#define DCM_ReferencedStructuredContextSequence DcmTagKey(0x0070, 0x1903) +#define DCM_ReferencedContentItem DcmTagKey(0x0070, 0x1904) +#define DCM_VolumetricPresentationInputAnnotationSequence DcmTagKey(0x0070, 0x1905) +#define DCM_AnnotationClipping DcmTagKey(0x0070, 0x1907) +#define DCM_PresentationAnimationStyle DcmTagKey(0x0070, 0x1a01) +#define DCM_RecommendedAnimationRate DcmTagKey(0x0070, 0x1a03) +#define DCM_AnimationCurveSequence DcmTagKey(0x0070, 0x1a04) +#define DCM_AnimationStepSize DcmTagKey(0x0070, 0x1a05) +#define DCM_SwivelRange DcmTagKey(0x0070, 0x1a06) +#define DCM_VolumetricCurveUpDirections DcmTagKey(0x0070, 0x1a07) +#define DCM_VolumeStreamSequence DcmTagKey(0x0070, 0x1a08) +#define DCM_RGBATransferFunctionDescription DcmTagKey(0x0070, 0x1a09) +#define DCM_AdvancedBlendingSequence DcmTagKey(0x0070, 0x1b01) +#define DCM_BlendingInputNumber DcmTagKey(0x0070, 0x1b02) +#define DCM_BlendingDisplayInputSequence DcmTagKey(0x0070, 0x1b03) +#define DCM_BlendingDisplaySequence DcmTagKey(0x0070, 0x1b04) +#define DCM_BlendingMode DcmTagKey(0x0070, 0x1b06) +#define DCM_TimeSeriesBlending DcmTagKey(0x0070, 0x1b07) +#define DCM_GeometryForDisplay DcmTagKey(0x0070, 0x1b08) +#define DCM_ThresholdSequence DcmTagKey(0x0070, 0x1b11) +#define DCM_ThresholdValueSequence DcmTagKey(0x0070, 0x1b12) +#define DCM_ThresholdType DcmTagKey(0x0070, 0x1b13) +#define DCM_ThresholdValue DcmTagKey(0x0070, 0x1b14) +#define DCM_HangingProtocolName DcmTagKey(0x0072, 0x0002) +#define DCM_HangingProtocolDescription DcmTagKey(0x0072, 0x0004) +#define DCM_HangingProtocolLevel DcmTagKey(0x0072, 0x0006) +#define DCM_HangingProtocolCreator DcmTagKey(0x0072, 0x0008) +#define DCM_HangingProtocolCreationDateTime DcmTagKey(0x0072, 0x000a) +#define DCM_HangingProtocolDefinitionSequence DcmTagKey(0x0072, 0x000c) +#define DCM_HangingProtocolUserIdentificationCodeSequence DcmTagKey(0x0072, 0x000e) +#define DCM_HangingProtocolUserGroupName DcmTagKey(0x0072, 0x0010) +#define DCM_SourceHangingProtocolSequence DcmTagKey(0x0072, 0x0012) +#define DCM_NumberOfPriorsReferenced DcmTagKey(0x0072, 0x0014) +#define DCM_ImageSetsSequence DcmTagKey(0x0072, 0x0020) +#define DCM_ImageSetSelectorSequence DcmTagKey(0x0072, 0x0022) +#define DCM_ImageSetSelectorUsageFlag DcmTagKey(0x0072, 0x0024) +#define DCM_SelectorAttribute DcmTagKey(0x0072, 0x0026) +#define DCM_SelectorValueNumber DcmTagKey(0x0072, 0x0028) +#define DCM_TimeBasedImageSetsSequence DcmTagKey(0x0072, 0x0030) +#define DCM_ImageSetNumber DcmTagKey(0x0072, 0x0032) +#define DCM_ImageSetSelectorCategory DcmTagKey(0x0072, 0x0034) +#define DCM_RelativeTime DcmTagKey(0x0072, 0x0038) +#define DCM_RelativeTimeUnits DcmTagKey(0x0072, 0x003a) +#define DCM_AbstractPriorValue DcmTagKey(0x0072, 0x003c) +#define DCM_AbstractPriorCodeSequence DcmTagKey(0x0072, 0x003e) +#define DCM_ImageSetLabel DcmTagKey(0x0072, 0x0040) +#define DCM_SelectorAttributeVR DcmTagKey(0x0072, 0x0050) +#define DCM_SelectorSequencePointer DcmTagKey(0x0072, 0x0052) +#define DCM_SelectorSequencePointerPrivateCreator DcmTagKey(0x0072, 0x0054) +#define DCM_SelectorAttributePrivateCreator DcmTagKey(0x0072, 0x0056) +#define DCM_SelectorAEValue DcmTagKey(0x0072, 0x005e) +#define DCM_SelectorASValue DcmTagKey(0x0072, 0x005f) +#define DCM_SelectorATValue DcmTagKey(0x0072, 0x0060) +#define DCM_SelectorDAValue DcmTagKey(0x0072, 0x0061) +#define DCM_SelectorCSValue DcmTagKey(0x0072, 0x0062) +#define DCM_SelectorDTValue DcmTagKey(0x0072, 0x0063) +#define DCM_SelectorISValue DcmTagKey(0x0072, 0x0064) +#define DCM_SelectorOBValue DcmTagKey(0x0072, 0x0065) +#define DCM_SelectorLOValue DcmTagKey(0x0072, 0x0066) +#define DCM_SelectorOFValue DcmTagKey(0x0072, 0x0067) +#define DCM_SelectorLTValue DcmTagKey(0x0072, 0x0068) +#define DCM_SelectorOWValue DcmTagKey(0x0072, 0x0069) +#define DCM_SelectorPNValue DcmTagKey(0x0072, 0x006a) +#define DCM_SelectorTMValue DcmTagKey(0x0072, 0x006b) +#define DCM_SelectorSHValue DcmTagKey(0x0072, 0x006c) +#define DCM_SelectorUNValue DcmTagKey(0x0072, 0x006d) +#define DCM_SelectorSTValue DcmTagKey(0x0072, 0x006e) +#define DCM_SelectorUCValue DcmTagKey(0x0072, 0x006f) +#define DCM_SelectorUTValue DcmTagKey(0x0072, 0x0070) +#define DCM_SelectorURValue DcmTagKey(0x0072, 0x0071) +#define DCM_SelectorDSValue DcmTagKey(0x0072, 0x0072) +#define DCM_SelectorODValue DcmTagKey(0x0072, 0x0073) +#define DCM_SelectorFDValue DcmTagKey(0x0072, 0x0074) +#define DCM_SelectorOLValue DcmTagKey(0x0072, 0x0075) +#define DCM_SelectorFLValue DcmTagKey(0x0072, 0x0076) +#define DCM_SelectorULValue DcmTagKey(0x0072, 0x0078) +#define DCM_SelectorUSValue DcmTagKey(0x0072, 0x007a) +#define DCM_SelectorSLValue DcmTagKey(0x0072, 0x007c) +#define DCM_SelectorSSValue DcmTagKey(0x0072, 0x007e) +#define DCM_SelectorUIValue DcmTagKey(0x0072, 0x007f) +#define DCM_SelectorCodeSequenceValue DcmTagKey(0x0072, 0x0080) +#define DCM_NumberOfScreens DcmTagKey(0x0072, 0x0100) +#define DCM_NominalScreenDefinitionSequence DcmTagKey(0x0072, 0x0102) +#define DCM_NumberOfVerticalPixels DcmTagKey(0x0072, 0x0104) +#define DCM_NumberOfHorizontalPixels DcmTagKey(0x0072, 0x0106) +#define DCM_DisplayEnvironmentSpatialPosition DcmTagKey(0x0072, 0x0108) +#define DCM_ScreenMinimumGrayscaleBitDepth DcmTagKey(0x0072, 0x010a) +#define DCM_ScreenMinimumColorBitDepth DcmTagKey(0x0072, 0x010c) +#define DCM_ApplicationMaximumRepaintTime DcmTagKey(0x0072, 0x010e) +#define DCM_DisplaySetsSequence DcmTagKey(0x0072, 0x0200) +#define DCM_DisplaySetNumber DcmTagKey(0x0072, 0x0202) +#define DCM_DisplaySetLabel DcmTagKey(0x0072, 0x0203) +#define DCM_DisplaySetPresentationGroup DcmTagKey(0x0072, 0x0204) +#define DCM_DisplaySetPresentationGroupDescription DcmTagKey(0x0072, 0x0206) +#define DCM_PartialDataDisplayHandling DcmTagKey(0x0072, 0x0208) +#define DCM_SynchronizedScrollingSequence DcmTagKey(0x0072, 0x0210) +#define DCM_DisplaySetScrollingGroup DcmTagKey(0x0072, 0x0212) +#define DCM_NavigationIndicatorSequence DcmTagKey(0x0072, 0x0214) +#define DCM_NavigationDisplaySet DcmTagKey(0x0072, 0x0216) +#define DCM_ReferenceDisplaySets DcmTagKey(0x0072, 0x0218) +#define DCM_ImageBoxesSequence DcmTagKey(0x0072, 0x0300) +#define DCM_ImageBoxNumber DcmTagKey(0x0072, 0x0302) +#define DCM_ImageBoxLayoutType DcmTagKey(0x0072, 0x0304) +#define DCM_ImageBoxTileHorizontalDimension DcmTagKey(0x0072, 0x0306) +#define DCM_ImageBoxTileVerticalDimension DcmTagKey(0x0072, 0x0308) +#define DCM_ImageBoxScrollDirection DcmTagKey(0x0072, 0x0310) +#define DCM_ImageBoxSmallScrollType DcmTagKey(0x0072, 0x0312) +#define DCM_ImageBoxSmallScrollAmount DcmTagKey(0x0072, 0x0314) +#define DCM_ImageBoxLargeScrollType DcmTagKey(0x0072, 0x0316) +#define DCM_ImageBoxLargeScrollAmount DcmTagKey(0x0072, 0x0318) +#define DCM_ImageBoxOverlapPriority DcmTagKey(0x0072, 0x0320) +#define DCM_CineRelativeToRealTime DcmTagKey(0x0072, 0x0330) +#define DCM_FilterOperationsSequence DcmTagKey(0x0072, 0x0400) +#define DCM_FilterByCategory DcmTagKey(0x0072, 0x0402) +#define DCM_FilterByAttributePresence DcmTagKey(0x0072, 0x0404) +#define DCM_FilterByOperator DcmTagKey(0x0072, 0x0406) +#define DCM_StructuredDisplayBackgroundCIELabValue DcmTagKey(0x0072, 0x0420) +#define DCM_EmptyImageBoxCIELabValue DcmTagKey(0x0072, 0x0421) +#define DCM_StructuredDisplayImageBoxSequence DcmTagKey(0x0072, 0x0422) +#define DCM_StructuredDisplayTextBoxSequence DcmTagKey(0x0072, 0x0424) +#define DCM_ReferencedFirstFrameSequence DcmTagKey(0x0072, 0x0427) +#define DCM_ImageBoxSynchronizationSequence DcmTagKey(0x0072, 0x0430) +#define DCM_SynchronizedImageBoxList DcmTagKey(0x0072, 0x0432) +#define DCM_TypeOfSynchronization DcmTagKey(0x0072, 0x0434) +#define DCM_BlendingOperationType DcmTagKey(0x0072, 0x0500) +#define DCM_ReformattingOperationType DcmTagKey(0x0072, 0x0510) +#define DCM_ReformattingThickness DcmTagKey(0x0072, 0x0512) +#define DCM_ReformattingInterval DcmTagKey(0x0072, 0x0514) +#define DCM_ReformattingOperationInitialViewDirection DcmTagKey(0x0072, 0x0516) +#define DCM_ThreeDRenderingType DcmTagKey(0x0072, 0x0520) +#define DCM_SortingOperationsSequence DcmTagKey(0x0072, 0x0600) +#define DCM_SortByCategory DcmTagKey(0x0072, 0x0602) +#define DCM_SortingDirection DcmTagKey(0x0072, 0x0604) +#define DCM_DisplaySetPatientOrientation DcmTagKey(0x0072, 0x0700) +#define DCM_VOIType DcmTagKey(0x0072, 0x0702) +#define DCM_PseudoColorType DcmTagKey(0x0072, 0x0704) +#define DCM_PseudoColorPaletteInstanceReferenceSequence DcmTagKey(0x0072, 0x0705) +#define DCM_ShowGrayscaleInverted DcmTagKey(0x0072, 0x0706) +#define DCM_ShowImageTrueSizeFlag DcmTagKey(0x0072, 0x0710) +#define DCM_ShowGraphicAnnotationFlag DcmTagKey(0x0072, 0x0712) +#define DCM_ShowPatientDemographicsFlag DcmTagKey(0x0072, 0x0714) +#define DCM_ShowAcquisitionTechniquesFlag DcmTagKey(0x0072, 0x0716) +#define DCM_DisplaySetHorizontalJustification DcmTagKey(0x0072, 0x0717) +#define DCM_DisplaySetVerticalJustification DcmTagKey(0x0072, 0x0718) +#define DCM_ContinuationStartMeterset DcmTagKey(0x0074, 0x0120) +#define DCM_ContinuationEndMeterset DcmTagKey(0x0074, 0x0121) +#define DCM_ProcedureStepState DcmTagKey(0x0074, 0x1000) +#define DCM_ProcedureStepProgressInformationSequence DcmTagKey(0x0074, 0x1002) +#define DCM_ProcedureStepProgress DcmTagKey(0x0074, 0x1004) +#define DCM_ProcedureStepProgressDescription DcmTagKey(0x0074, 0x1006) +#define DCM_ProcedureStepProgressParametersSequence DcmTagKey(0x0074, 0x1007) +#define DCM_ProcedureStepCommunicationsURISequence DcmTagKey(0x0074, 0x1008) +#define DCM_ContactURI DcmTagKey(0x0074, 0x100a) +#define DCM_ContactDisplayName DcmTagKey(0x0074, 0x100c) +#define DCM_ProcedureStepDiscontinuationReasonCodeSequence DcmTagKey(0x0074, 0x100e) +#define DCM_BeamTaskSequence DcmTagKey(0x0074, 0x1020) +#define DCM_BeamTaskType DcmTagKey(0x0074, 0x1022) +#define DCM_RETIRED_BeamOrderIndexTrial DcmTagKey(0x0074, 0x1024) +#define DCM_AutosequenceFlag DcmTagKey(0x0074, 0x1025) +#define DCM_TableTopVerticalAdjustedPosition DcmTagKey(0x0074, 0x1026) +#define DCM_TableTopLongitudinalAdjustedPosition DcmTagKey(0x0074, 0x1027) +#define DCM_TableTopLateralAdjustedPosition DcmTagKey(0x0074, 0x1028) +#define DCM_PatientSupportAdjustedAngle DcmTagKey(0x0074, 0x102a) +#define DCM_TableTopEccentricAdjustedAngle DcmTagKey(0x0074, 0x102b) +#define DCM_TableTopPitchAdjustedAngle DcmTagKey(0x0074, 0x102c) +#define DCM_TableTopRollAdjustedAngle DcmTagKey(0x0074, 0x102d) +#define DCM_DeliveryVerificationImageSequence DcmTagKey(0x0074, 0x1030) +#define DCM_VerificationImageTiming DcmTagKey(0x0074, 0x1032) +#define DCM_DoubleExposureFlag DcmTagKey(0x0074, 0x1034) +#define DCM_DoubleExposureOrdering DcmTagKey(0x0074, 0x1036) +#define DCM_RETIRED_DoubleExposureMetersetTrial DcmTagKey(0x0074, 0x1038) +#define DCM_RETIRED_DoubleExposureFieldDeltaTrial DcmTagKey(0x0074, 0x103a) +#define DCM_RelatedReferenceRTImageSequence DcmTagKey(0x0074, 0x1040) +#define DCM_GeneralMachineVerificationSequence DcmTagKey(0x0074, 0x1042) +#define DCM_ConventionalMachineVerificationSequence DcmTagKey(0x0074, 0x1044) +#define DCM_IonMachineVerificationSequence DcmTagKey(0x0074, 0x1046) +#define DCM_FailedAttributesSequence DcmTagKey(0x0074, 0x1048) +#define DCM_OverriddenAttributesSequence DcmTagKey(0x0074, 0x104a) +#define DCM_ConventionalControlPointVerificationSequence DcmTagKey(0x0074, 0x104c) +#define DCM_IonControlPointVerificationSequence DcmTagKey(0x0074, 0x104e) +#define DCM_AttributeOccurrenceSequence DcmTagKey(0x0074, 0x1050) +#define DCM_AttributeOccurrencePointer DcmTagKey(0x0074, 0x1052) +#define DCM_AttributeItemSelector DcmTagKey(0x0074, 0x1054) +#define DCM_AttributeOccurrencePrivateCreator DcmTagKey(0x0074, 0x1056) +#define DCM_SelectorSequencePointerItems DcmTagKey(0x0074, 0x1057) +#define DCM_ScheduledProcedureStepPriority DcmTagKey(0x0074, 0x1200) +#define DCM_WorklistLabel DcmTagKey(0x0074, 0x1202) +#define DCM_ProcedureStepLabel DcmTagKey(0x0074, 0x1204) +#define DCM_ScheduledProcessingParametersSequence DcmTagKey(0x0074, 0x1210) +#define DCM_PerformedProcessingParametersSequence DcmTagKey(0x0074, 0x1212) +#define DCM_UnifiedProcedureStepPerformedProcedureSequence DcmTagKey(0x0074, 0x1216) +#define DCM_RETIRED_RelatedProcedureStepSequence DcmTagKey(0x0074, 0x1220) +#define DCM_RETIRED_ProcedureStepRelationshipType DcmTagKey(0x0074, 0x1222) +#define DCM_ReplacedProcedureStepSequence DcmTagKey(0x0074, 0x1224) +#define DCM_DeletionLock DcmTagKey(0x0074, 0x1230) +#define DCM_ReceivingAE DcmTagKey(0x0074, 0x1234) +#define DCM_RequestingAE DcmTagKey(0x0074, 0x1236) +#define DCM_ReasonForCancellation DcmTagKey(0x0074, 0x1238) +#define DCM_SCPStatus DcmTagKey(0x0074, 0x1242) +#define DCM_SubscriptionListStatus DcmTagKey(0x0074, 0x1244) +#define DCM_UnifiedProcedureStepListStatus DcmTagKey(0x0074, 0x1246) +#define DCM_BeamOrderIndex DcmTagKey(0x0074, 0x1324) +#define DCM_DoubleExposureMeterset DcmTagKey(0x0074, 0x1338) +#define DCM_DoubleExposureFieldDelta DcmTagKey(0x0074, 0x133a) +#define DCM_BrachyTaskSequence DcmTagKey(0x0074, 0x1401) +#define DCM_ContinuationStartTotalReferenceAirKerma DcmTagKey(0x0074, 0x1402) +#define DCM_ContinuationEndTotalReferenceAirKerma DcmTagKey(0x0074, 0x1403) +#define DCM_ContinuationPulseNumber DcmTagKey(0x0074, 0x1404) +#define DCM_ChannelDeliveryOrderSequence DcmTagKey(0x0074, 0x1405) +#define DCM_ReferencedChannelNumber DcmTagKey(0x0074, 0x1406) +#define DCM_StartCumulativeTimeWeight DcmTagKey(0x0074, 0x1407) +#define DCM_EndCumulativeTimeWeight DcmTagKey(0x0074, 0x1408) +#define DCM_OmittedChannelSequence DcmTagKey(0x0074, 0x1409) +#define DCM_ReasonForChannelOmission DcmTagKey(0x0074, 0x140a) +#define DCM_ReasonForChannelOmissionDescription DcmTagKey(0x0074, 0x140b) +#define DCM_ChannelDeliveryOrderIndex DcmTagKey(0x0074, 0x140c) +#define DCM_ChannelDeliveryContinuationSequence DcmTagKey(0x0074, 0x140d) +#define DCM_OmittedApplicationSetupSequence DcmTagKey(0x0074, 0x140e) +#define DCM_ImplantAssemblyTemplateName DcmTagKey(0x0076, 0x0001) +#define DCM_ImplantAssemblyTemplateIssuer DcmTagKey(0x0076, 0x0003) +#define DCM_ImplantAssemblyTemplateVersion DcmTagKey(0x0076, 0x0006) +#define DCM_ReplacedImplantAssemblyTemplateSequence DcmTagKey(0x0076, 0x0008) +#define DCM_ImplantAssemblyTemplateType DcmTagKey(0x0076, 0x000a) +#define DCM_OriginalImplantAssemblyTemplateSequence DcmTagKey(0x0076, 0x000c) +#define DCM_DerivationImplantAssemblyTemplateSequence DcmTagKey(0x0076, 0x000e) +#define DCM_ImplantAssemblyTemplateTargetAnatomySequence DcmTagKey(0x0076, 0x0010) +#define DCM_ProcedureTypeCodeSequence DcmTagKey(0x0076, 0x0020) +#define DCM_SurgicalTechnique DcmTagKey(0x0076, 0x0030) +#define DCM_ComponentTypesSequence DcmTagKey(0x0076, 0x0032) +#define DCM_ComponentTypeCodeSequence DcmTagKey(0x0076, 0x0034) +#define DCM_ExclusiveComponentType DcmTagKey(0x0076, 0x0036) +#define DCM_MandatoryComponentType DcmTagKey(0x0076, 0x0038) +#define DCM_ComponentSequence DcmTagKey(0x0076, 0x0040) +#define DCM_ComponentID DcmTagKey(0x0076, 0x0055) +#define DCM_ComponentAssemblySequence DcmTagKey(0x0076, 0x0060) +#define DCM_Component1ReferencedID DcmTagKey(0x0076, 0x0070) +#define DCM_Component1ReferencedMatingFeatureSetID DcmTagKey(0x0076, 0x0080) +#define DCM_Component1ReferencedMatingFeatureID DcmTagKey(0x0076, 0x0090) +#define DCM_Component2ReferencedID DcmTagKey(0x0076, 0x00a0) +#define DCM_Component2ReferencedMatingFeatureSetID DcmTagKey(0x0076, 0x00b0) +#define DCM_Component2ReferencedMatingFeatureID DcmTagKey(0x0076, 0x00c0) +#define DCM_ImplantTemplateGroupName DcmTagKey(0x0078, 0x0001) +#define DCM_ImplantTemplateGroupDescription DcmTagKey(0x0078, 0x0010) +#define DCM_ImplantTemplateGroupIssuer DcmTagKey(0x0078, 0x0020) +#define DCM_ImplantTemplateGroupVersion DcmTagKey(0x0078, 0x0024) +#define DCM_ReplacedImplantTemplateGroupSequence DcmTagKey(0x0078, 0x0026) +#define DCM_ImplantTemplateGroupTargetAnatomySequence DcmTagKey(0x0078, 0x0028) +#define DCM_ImplantTemplateGroupMembersSequence DcmTagKey(0x0078, 0x002a) +#define DCM_ImplantTemplateGroupMemberID DcmTagKey(0x0078, 0x002e) +#define DCM_ThreeDImplantTemplateGroupMemberMatchingPoint DcmTagKey(0x0078, 0x0050) +#define DCM_ThreeDImplantTemplateGroupMemberMatchingAxes DcmTagKey(0x0078, 0x0060) +#define DCM_ImplantTemplateGroupMemberMatching2DCoordinatesSequence DcmTagKey(0x0078, 0x0070) +#define DCM_TwoDImplantTemplateGroupMemberMatchingPoint DcmTagKey(0x0078, 0x0090) +#define DCM_TwoDImplantTemplateGroupMemberMatchingAxes DcmTagKey(0x0078, 0x00a0) +#define DCM_ImplantTemplateGroupVariationDimensionSequence DcmTagKey(0x0078, 0x00b0) +#define DCM_ImplantTemplateGroupVariationDimensionName DcmTagKey(0x0078, 0x00b2) +#define DCM_ImplantTemplateGroupVariationDimensionRankSequence DcmTagKey(0x0078, 0x00b4) +#define DCM_ReferencedImplantTemplateGroupMemberID DcmTagKey(0x0078, 0x00b6) +#define DCM_ImplantTemplateGroupVariationDimensionRank DcmTagKey(0x0078, 0x00b8) +#define DCM_SurfaceScanAcquisitionTypeCodeSequence DcmTagKey(0x0080, 0x0001) +#define DCM_SurfaceScanModeCodeSequence DcmTagKey(0x0080, 0x0002) +#define DCM_RegistrationMethodCodeSequence DcmTagKey(0x0080, 0x0003) +#define DCM_ShotDurationTime DcmTagKey(0x0080, 0x0004) +#define DCM_ShotOffsetTime DcmTagKey(0x0080, 0x0005) +#define DCM_SurfacePointPresentationValueData DcmTagKey(0x0080, 0x0006) +#define DCM_SurfacePointColorCIELabValueData DcmTagKey(0x0080, 0x0007) +#define DCM_UVMappingSequence DcmTagKey(0x0080, 0x0008) +#define DCM_TextureLabel DcmTagKey(0x0080, 0x0009) +#define DCM_UValueData DcmTagKey(0x0080, 0x0010) +#define DCM_VValueData DcmTagKey(0x0080, 0x0011) +#define DCM_ReferencedTextureSequence DcmTagKey(0x0080, 0x0012) +#define DCM_ReferencedSurfaceDataSequence DcmTagKey(0x0080, 0x0013) +#define DCM_AssessmentSummary DcmTagKey(0x0082, 0x0001) +#define DCM_AssessmentSummaryDescription DcmTagKey(0x0082, 0x0003) +#define DCM_AssessedSOPInstanceSequence DcmTagKey(0x0082, 0x0004) +#define DCM_ReferencedComparisonSOPInstanceSequence DcmTagKey(0x0082, 0x0005) +#define DCM_NumberOfAssessmentObservations DcmTagKey(0x0082, 0x0006) +#define DCM_AssessmentObservationsSequence DcmTagKey(0x0082, 0x0007) +#define DCM_ObservationSignificance DcmTagKey(0x0082, 0x0008) +#define DCM_ObservationDescription DcmTagKey(0x0082, 0x000a) +#define DCM_StructuredConstraintObservationSequence DcmTagKey(0x0082, 0x000c) +#define DCM_AssessedAttributeValueSequence DcmTagKey(0x0082, 0x0010) +#define DCM_AssessmentSetID DcmTagKey(0x0082, 0x0016) +#define DCM_AssessmentRequesterSequence DcmTagKey(0x0082, 0x0017) +#define DCM_SelectorAttributeName DcmTagKey(0x0082, 0x0018) +#define DCM_SelectorAttributeKeyword DcmTagKey(0x0082, 0x0019) +#define DCM_AssessmentTypeCodeSequence DcmTagKey(0x0082, 0x0021) +#define DCM_ObservationBasisCodeSequence DcmTagKey(0x0082, 0x0022) +#define DCM_AssessmentLabel DcmTagKey(0x0082, 0x0023) +#define DCM_ConstraintType DcmTagKey(0x0082, 0x0032) +#define DCM_SpecificationSelectionGuidance DcmTagKey(0x0082, 0x0033) +#define DCM_ConstraintValueSequence DcmTagKey(0x0082, 0x0034) +#define DCM_RecommendedDefaultValueSequence DcmTagKey(0x0082, 0x0035) +#define DCM_ConstraintViolationSignificance DcmTagKey(0x0082, 0x0036) +#define DCM_ConstraintViolationCondition DcmTagKey(0x0082, 0x0037) +#define DCM_ModifiableConstraintFlag DcmTagKey(0x0082, 0x0038) +#define DCM_StorageMediaFileSetID DcmTagKey(0x0088, 0x0130) +#define DCM_StorageMediaFileSetUID DcmTagKey(0x0088, 0x0140) +#define DCM_IconImageSequence DcmTagKey(0x0088, 0x0200) +#define DCM_RETIRED_TopicTitle DcmTagKey(0x0088, 0x0904) +#define DCM_RETIRED_TopicSubject DcmTagKey(0x0088, 0x0906) +#define DCM_RETIRED_TopicAuthor DcmTagKey(0x0088, 0x0910) +#define DCM_RETIRED_TopicKeywords DcmTagKey(0x0088, 0x0912) +#define DCM_SOPInstanceStatus DcmTagKey(0x0100, 0x0410) +#define DCM_SOPAuthorizationDateTime DcmTagKey(0x0100, 0x0420) +#define DCM_SOPAuthorizationComment DcmTagKey(0x0100, 0x0424) +#define DCM_AuthorizationEquipmentCertificationNumber DcmTagKey(0x0100, 0x0426) +#define DCM_MACIDNumber DcmTagKey(0x0400, 0x0005) +#define DCM_MACCalculationTransferSyntaxUID DcmTagKey(0x0400, 0x0010) +#define DCM_MACAlgorithm DcmTagKey(0x0400, 0x0015) +#define DCM_DataElementsSigned DcmTagKey(0x0400, 0x0020) +#define DCM_DigitalSignatureUID DcmTagKey(0x0400, 0x0100) +#define DCM_DigitalSignatureDateTime DcmTagKey(0x0400, 0x0105) +#define DCM_CertificateType DcmTagKey(0x0400, 0x0110) +#define DCM_CertificateOfSigner DcmTagKey(0x0400, 0x0115) +#define DCM_Signature DcmTagKey(0x0400, 0x0120) +#define DCM_CertifiedTimestampType DcmTagKey(0x0400, 0x0305) +#define DCM_CertifiedTimestamp DcmTagKey(0x0400, 0x0310) +#define DCM_DigitalSignaturePurposeCodeSequence DcmTagKey(0x0400, 0x0401) +#define DCM_ReferencedDigitalSignatureSequence DcmTagKey(0x0400, 0x0402) +#define DCM_ReferencedSOPInstanceMACSequence DcmTagKey(0x0400, 0x0403) +#define DCM_MAC DcmTagKey(0x0400, 0x0404) +#define DCM_EncryptedAttributesSequence DcmTagKey(0x0400, 0x0500) +#define DCM_EncryptedContentTransferSyntaxUID DcmTagKey(0x0400, 0x0510) +#define DCM_EncryptedContent DcmTagKey(0x0400, 0x0520) +#define DCM_ModifiedAttributesSequence DcmTagKey(0x0400, 0x0550) +#define DCM_NonconformingModifiedAttributesSequence DcmTagKey(0x0400, 0x0551) +#define DCM_NonconformingDataElementValue DcmTagKey(0x0400, 0x0552) +#define DCM_OriginalAttributesSequence DcmTagKey(0x0400, 0x0561) +#define DCM_AttributeModificationDateTime DcmTagKey(0x0400, 0x0562) +#define DCM_ModifyingSystem DcmTagKey(0x0400, 0x0563) +#define DCM_SourceOfPreviousValues DcmTagKey(0x0400, 0x0564) +#define DCM_ReasonForTheAttributeModification DcmTagKey(0x0400, 0x0565) +#define DCM_InstanceOriginStatus DcmTagKey(0x0400, 0x0600) +#define DCM_RETIRED_EscapeTriplet DcmTagKey(0x1000, 0x0010) +#define DCM_RETIRED_RunLengthTriplet DcmTagKey(0x1000, 0x0011) +#define DCM_RETIRED_HuffmanTableSize DcmTagKey(0x1000, 0x0012) +#define DCM_RETIRED_HuffmanTableTriplet DcmTagKey(0x1000, 0x0013) +#define DCM_RETIRED_ShiftTableSize DcmTagKey(0x1000, 0x0014) +#define DCM_RETIRED_ShiftTableTriplet DcmTagKey(0x1000, 0x0015) +#define DCM_RETIRED_ZonalMap DcmTagKey(0x1010, 0x0004) +#define DCM_NumberOfCopies DcmTagKey(0x2000, 0x0010) +#define DCM_PrinterConfigurationSequence DcmTagKey(0x2000, 0x001e) +#define DCM_PrintPriority DcmTagKey(0x2000, 0x0020) +#define DCM_MediumType DcmTagKey(0x2000, 0x0030) +#define DCM_FilmDestination DcmTagKey(0x2000, 0x0040) +#define DCM_FilmSessionLabel DcmTagKey(0x2000, 0x0050) +#define DCM_MemoryAllocation DcmTagKey(0x2000, 0x0060) +#define DCM_MaximumMemoryAllocation DcmTagKey(0x2000, 0x0061) +#define DCM_RETIRED_ColorImagePrintingFlag DcmTagKey(0x2000, 0x0062) +#define DCM_RETIRED_CollationFlag DcmTagKey(0x2000, 0x0063) +#define DCM_RETIRED_AnnotationFlag DcmTagKey(0x2000, 0x0065) +#define DCM_RETIRED_ImageOverlayFlag DcmTagKey(0x2000, 0x0067) +#define DCM_RETIRED_PresentationLUTFlag DcmTagKey(0x2000, 0x0069) +#define DCM_RETIRED_ImageBoxPresentationLUTFlag DcmTagKey(0x2000, 0x006a) +#define DCM_MemoryBitDepth DcmTagKey(0x2000, 0x00a0) +#define DCM_PrintingBitDepth DcmTagKey(0x2000, 0x00a1) +#define DCM_MediaInstalledSequence DcmTagKey(0x2000, 0x00a2) +#define DCM_OtherMediaAvailableSequence DcmTagKey(0x2000, 0x00a4) +#define DCM_SupportedImageDisplayFormatsSequence DcmTagKey(0x2000, 0x00a8) +#define DCM_ReferencedFilmBoxSequence DcmTagKey(0x2000, 0x0500) +#define DCM_RETIRED_ReferencedStoredPrintSequence DcmTagKey(0x2000, 0x0510) +#define DCM_ImageDisplayFormat DcmTagKey(0x2010, 0x0010) +#define DCM_AnnotationDisplayFormatID DcmTagKey(0x2010, 0x0030) +#define DCM_FilmOrientation DcmTagKey(0x2010, 0x0040) +#define DCM_FilmSizeID DcmTagKey(0x2010, 0x0050) +#define DCM_PrinterResolutionID DcmTagKey(0x2010, 0x0052) +#define DCM_DefaultPrinterResolutionID DcmTagKey(0x2010, 0x0054) +#define DCM_MagnificationType DcmTagKey(0x2010, 0x0060) +#define DCM_SmoothingType DcmTagKey(0x2010, 0x0080) +#define DCM_DefaultMagnificationType DcmTagKey(0x2010, 0x00a6) +#define DCM_OtherMagnificationTypesAvailable DcmTagKey(0x2010, 0x00a7) +#define DCM_DefaultSmoothingType DcmTagKey(0x2010, 0x00a8) +#define DCM_OtherSmoothingTypesAvailable DcmTagKey(0x2010, 0x00a9) +#define DCM_BorderDensity DcmTagKey(0x2010, 0x0100) +#define DCM_EmptyImageDensity DcmTagKey(0x2010, 0x0110) +#define DCM_MinDensity DcmTagKey(0x2010, 0x0120) +#define DCM_MaxDensity DcmTagKey(0x2010, 0x0130) +#define DCM_Trim DcmTagKey(0x2010, 0x0140) +#define DCM_ConfigurationInformation DcmTagKey(0x2010, 0x0150) +#define DCM_ConfigurationInformationDescription DcmTagKey(0x2010, 0x0152) +#define DCM_MaximumCollatedFilms DcmTagKey(0x2010, 0x0154) +#define DCM_Illumination DcmTagKey(0x2010, 0x015e) +#define DCM_ReflectedAmbientLight DcmTagKey(0x2010, 0x0160) +#define DCM_PrinterPixelSpacing DcmTagKey(0x2010, 0x0376) +#define DCM_ReferencedFilmSessionSequence DcmTagKey(0x2010, 0x0500) +#define DCM_ReferencedImageBoxSequence DcmTagKey(0x2010, 0x0510) +#define DCM_ReferencedBasicAnnotationBoxSequence DcmTagKey(0x2010, 0x0520) +#define DCM_ImageBoxPosition DcmTagKey(0x2020, 0x0010) +#define DCM_Polarity DcmTagKey(0x2020, 0x0020) +#define DCM_RequestedImageSize DcmTagKey(0x2020, 0x0030) +#define DCM_RequestedDecimateCropBehavior DcmTagKey(0x2020, 0x0040) +#define DCM_RequestedResolutionID DcmTagKey(0x2020, 0x0050) +#define DCM_RequestedImageSizeFlag DcmTagKey(0x2020, 0x00a0) +#define DCM_DecimateCropResult DcmTagKey(0x2020, 0x00a2) +#define DCM_BasicGrayscaleImageSequence DcmTagKey(0x2020, 0x0110) +#define DCM_BasicColorImageSequence DcmTagKey(0x2020, 0x0111) +#define DCM_RETIRED_ReferencedImageOverlayBoxSequence DcmTagKey(0x2020, 0x0130) +#define DCM_RETIRED_ReferencedVOILUTBoxSequence DcmTagKey(0x2020, 0x0140) +#define DCM_AnnotationPosition DcmTagKey(0x2030, 0x0010) +#define DCM_TextString DcmTagKey(0x2030, 0x0020) +#define DCM_RETIRED_ReferencedOverlayPlaneSequence DcmTagKey(0x2040, 0x0010) +#define DCM_RETIRED_ReferencedOverlayPlaneGroups DcmTagKey(0x2040, 0x0011) +#define DCM_RETIRED_OverlayPixelDataSequence DcmTagKey(0x2040, 0x0020) +#define DCM_RETIRED_OverlayMagnificationType DcmTagKey(0x2040, 0x0060) +#define DCM_RETIRED_OverlaySmoothingType DcmTagKey(0x2040, 0x0070) +#define DCM_RETIRED_OverlayOrImageMagnification DcmTagKey(0x2040, 0x0072) +#define DCM_RETIRED_MagnifyToNumberOfColumns DcmTagKey(0x2040, 0x0074) +#define DCM_RETIRED_OverlayForegroundDensity DcmTagKey(0x2040, 0x0080) +#define DCM_RETIRED_OverlayBackgroundDensity DcmTagKey(0x2040, 0x0082) +#define DCM_RETIRED_OverlayMode DcmTagKey(0x2040, 0x0090) +#define DCM_RETIRED_ThresholdDensity DcmTagKey(0x2040, 0x0100) +#define DCM_RETIRED_ReferencedImageBoxSequenceRetired DcmTagKey(0x2040, 0x0500) +#define DCM_PresentationLUTSequence DcmTagKey(0x2050, 0x0010) +#define DCM_PresentationLUTShape DcmTagKey(0x2050, 0x0020) +#define DCM_ReferencedPresentationLUTSequence DcmTagKey(0x2050, 0x0500) +#define DCM_RETIRED_PrintJobID DcmTagKey(0x2100, 0x0010) +#define DCM_ExecutionStatus DcmTagKey(0x2100, 0x0020) +#define DCM_ExecutionStatusInfo DcmTagKey(0x2100, 0x0030) +#define DCM_CreationDate DcmTagKey(0x2100, 0x0040) +#define DCM_CreationTime DcmTagKey(0x2100, 0x0050) +#define DCM_Originator DcmTagKey(0x2100, 0x0070) +#define DCM_DestinationAE DcmTagKey(0x2100, 0x0140) +#define DCM_OwnerID DcmTagKey(0x2100, 0x0160) +#define DCM_NumberOfFilms DcmTagKey(0x2100, 0x0170) +#define DCM_RETIRED_ReferencedPrintJobSequencePullStoredPrint DcmTagKey(0x2100, 0x0500) +#define DCM_PrinterStatus DcmTagKey(0x2110, 0x0010) +#define DCM_PrinterStatusInfo DcmTagKey(0x2110, 0x0020) +#define DCM_PrinterName DcmTagKey(0x2110, 0x0030) +#define DCM_RETIRED_PrintQueueID DcmTagKey(0x2110, 0x0099) +#define DCM_RETIRED_QueueStatus DcmTagKey(0x2120, 0x0010) +#define DCM_RETIRED_PrintJobDescriptionSequence DcmTagKey(0x2120, 0x0050) +#define DCM_RETIRED_ReferencedPrintJobSequence DcmTagKey(0x2120, 0x0070) +#define DCM_RETIRED_PrintManagementCapabilitiesSequence DcmTagKey(0x2130, 0x0010) +#define DCM_RETIRED_PrinterCharacteristicsSequence DcmTagKey(0x2130, 0x0015) +#define DCM_RETIRED_FilmBoxContentSequence DcmTagKey(0x2130, 0x0030) +#define DCM_RETIRED_ImageBoxContentSequence DcmTagKey(0x2130, 0x0040) +#define DCM_RETIRED_AnnotationContentSequence DcmTagKey(0x2130, 0x0050) +#define DCM_RETIRED_ImageOverlayBoxContentSequence DcmTagKey(0x2130, 0x0060) +#define DCM_RETIRED_PresentationLUTContentSequence DcmTagKey(0x2130, 0x0080) +#define DCM_RETIRED_ProposedStudySequence DcmTagKey(0x2130, 0x00a0) +#define DCM_RETIRED_OriginalImageSequence DcmTagKey(0x2130, 0x00c0) +#define DCM_LabelUsingInformationExtractedFromInstances DcmTagKey(0x2200, 0x0001) +#define DCM_LabelText DcmTagKey(0x2200, 0x0002) +#define DCM_LabelStyleSelection DcmTagKey(0x2200, 0x0003) +#define DCM_MediaDisposition DcmTagKey(0x2200, 0x0004) +#define DCM_BarcodeValue DcmTagKey(0x2200, 0x0005) +#define DCM_BarcodeSymbology DcmTagKey(0x2200, 0x0006) +#define DCM_AllowMediaSplitting DcmTagKey(0x2200, 0x0007) +#define DCM_IncludeNonDICOMObjects DcmTagKey(0x2200, 0x0008) +#define DCM_IncludeDisplayApplication DcmTagKey(0x2200, 0x0009) +#define DCM_PreserveCompositeInstancesAfterMediaCreation DcmTagKey(0x2200, 0x000a) +#define DCM_TotalNumberOfPiecesOfMediaCreated DcmTagKey(0x2200, 0x000b) +#define DCM_RequestedMediaApplicationProfile DcmTagKey(0x2200, 0x000c) +#define DCM_ReferencedStorageMediaSequence DcmTagKey(0x2200, 0x000d) +#define DCM_FailureAttributes DcmTagKey(0x2200, 0x000e) +#define DCM_AllowLossyCompression DcmTagKey(0x2200, 0x000f) +#define DCM_RequestPriority DcmTagKey(0x2200, 0x0020) +#define DCM_RTImageLabel DcmTagKey(0x3002, 0x0002) +#define DCM_RTImageName DcmTagKey(0x3002, 0x0003) +#define DCM_RTImageDescription DcmTagKey(0x3002, 0x0004) +#define DCM_ReportedValuesOrigin DcmTagKey(0x3002, 0x000a) +#define DCM_RTImagePlane DcmTagKey(0x3002, 0x000c) +#define DCM_XRayImageReceptorTranslation DcmTagKey(0x3002, 0x000d) +#define DCM_XRayImageReceptorAngle DcmTagKey(0x3002, 0x000e) +#define DCM_RTImageOrientation DcmTagKey(0x3002, 0x0010) +#define DCM_ImagePlanePixelSpacing DcmTagKey(0x3002, 0x0011) +#define DCM_RTImagePosition DcmTagKey(0x3002, 0x0012) +#define DCM_RadiationMachineName DcmTagKey(0x3002, 0x0020) +#define DCM_RadiationMachineSAD DcmTagKey(0x3002, 0x0022) +#define DCM_RadiationMachineSSD DcmTagKey(0x3002, 0x0024) +#define DCM_RTImageSID DcmTagKey(0x3002, 0x0026) +#define DCM_SourceToReferenceObjectDistance DcmTagKey(0x3002, 0x0028) +#define DCM_FractionNumber DcmTagKey(0x3002, 0x0029) +#define DCM_ExposureSequence DcmTagKey(0x3002, 0x0030) +#define DCM_MetersetExposure DcmTagKey(0x3002, 0x0032) +#define DCM_DiaphragmPosition DcmTagKey(0x3002, 0x0034) +#define DCM_FluenceMapSequence DcmTagKey(0x3002, 0x0040) +#define DCM_FluenceDataSource DcmTagKey(0x3002, 0x0041) +#define DCM_FluenceDataScale DcmTagKey(0x3002, 0x0042) +#define DCM_PrimaryFluenceModeSequence DcmTagKey(0x3002, 0x0050) +#define DCM_FluenceMode DcmTagKey(0x3002, 0x0051) +#define DCM_FluenceModeID DcmTagKey(0x3002, 0x0052) +#define DCM_DVHType DcmTagKey(0x3004, 0x0001) +#define DCM_DoseUnits DcmTagKey(0x3004, 0x0002) +#define DCM_DoseType DcmTagKey(0x3004, 0x0004) +#define DCM_SpatialTransformOfDose DcmTagKey(0x3004, 0x0005) +#define DCM_DoseComment DcmTagKey(0x3004, 0x0006) +#define DCM_NormalizationPoint DcmTagKey(0x3004, 0x0008) +#define DCM_DoseSummationType DcmTagKey(0x3004, 0x000a) +#define DCM_GridFrameOffsetVector DcmTagKey(0x3004, 0x000c) +#define DCM_DoseGridScaling DcmTagKey(0x3004, 0x000e) +#define DCM_RTDoseROISequence DcmTagKey(0x3004, 0x0010) +#define DCM_DoseValue DcmTagKey(0x3004, 0x0012) +#define DCM_TissueHeterogeneityCorrection DcmTagKey(0x3004, 0x0014) +#define DCM_DVHNormalizationPoint DcmTagKey(0x3004, 0x0040) +#define DCM_DVHNormalizationDoseValue DcmTagKey(0x3004, 0x0042) +#define DCM_DVHSequence DcmTagKey(0x3004, 0x0050) +#define DCM_DVHDoseScaling DcmTagKey(0x3004, 0x0052) +#define DCM_DVHVolumeUnits DcmTagKey(0x3004, 0x0054) +#define DCM_DVHNumberOfBins DcmTagKey(0x3004, 0x0056) +#define DCM_DVHData DcmTagKey(0x3004, 0x0058) +#define DCM_DVHReferencedROISequence DcmTagKey(0x3004, 0x0060) +#define DCM_DVHROIContributionType DcmTagKey(0x3004, 0x0062) +#define DCM_DVHMinimumDose DcmTagKey(0x3004, 0x0070) +#define DCM_DVHMaximumDose DcmTagKey(0x3004, 0x0072) +#define DCM_DVHMeanDose DcmTagKey(0x3004, 0x0074) +#define DCM_StructureSetLabel DcmTagKey(0x3006, 0x0002) +#define DCM_StructureSetName DcmTagKey(0x3006, 0x0004) +#define DCM_StructureSetDescription DcmTagKey(0x3006, 0x0006) +#define DCM_StructureSetDate DcmTagKey(0x3006, 0x0008) +#define DCM_StructureSetTime DcmTagKey(0x3006, 0x0009) +#define DCM_ReferencedFrameOfReferenceSequence DcmTagKey(0x3006, 0x0010) +#define DCM_RTReferencedStudySequence DcmTagKey(0x3006, 0x0012) +#define DCM_RTReferencedSeriesSequence DcmTagKey(0x3006, 0x0014) +#define DCM_ContourImageSequence DcmTagKey(0x3006, 0x0016) +#define DCM_PredecessorStructureSetSequence DcmTagKey(0x3006, 0x0018) +#define DCM_StructureSetROISequence DcmTagKey(0x3006, 0x0020) +#define DCM_ROINumber DcmTagKey(0x3006, 0x0022) +#define DCM_ReferencedFrameOfReferenceUID DcmTagKey(0x3006, 0x0024) +#define DCM_ROIName DcmTagKey(0x3006, 0x0026) +#define DCM_ROIDescription DcmTagKey(0x3006, 0x0028) +#define DCM_ROIDisplayColor DcmTagKey(0x3006, 0x002a) +#define DCM_ROIVolume DcmTagKey(0x3006, 0x002c) +#define DCM_RTRelatedROISequence DcmTagKey(0x3006, 0x0030) +#define DCM_RTROIRelationship DcmTagKey(0x3006, 0x0033) +#define DCM_ROIGenerationAlgorithm DcmTagKey(0x3006, 0x0036) +#define DCM_ROIDerivationAlgorithmIdentificationSequence DcmTagKey(0x3006, 0x0037) +#define DCM_ROIGenerationDescription DcmTagKey(0x3006, 0x0038) +#define DCM_ROIContourSequence DcmTagKey(0x3006, 0x0039) +#define DCM_ContourSequence DcmTagKey(0x3006, 0x0040) +#define DCM_ContourGeometricType DcmTagKey(0x3006, 0x0042) +#define DCM_ContourSlabThickness DcmTagKey(0x3006, 0x0044) +#define DCM_ContourOffsetVector DcmTagKey(0x3006, 0x0045) +#define DCM_NumberOfContourPoints DcmTagKey(0x3006, 0x0046) +#define DCM_ContourNumber DcmTagKey(0x3006, 0x0048) +#define DCM_AttachedContours DcmTagKey(0x3006, 0x0049) +#define DCM_ContourData DcmTagKey(0x3006, 0x0050) +#define DCM_RTROIObservationsSequence DcmTagKey(0x3006, 0x0080) +#define DCM_ObservationNumber DcmTagKey(0x3006, 0x0082) +#define DCM_ReferencedROINumber DcmTagKey(0x3006, 0x0084) +#define DCM_ROIObservationLabel DcmTagKey(0x3006, 0x0085) +#define DCM_RTROIIdentificationCodeSequence DcmTagKey(0x3006, 0x0086) +#define DCM_ROIObservationDescription DcmTagKey(0x3006, 0x0088) +#define DCM_RelatedRTROIObservationsSequence DcmTagKey(0x3006, 0x00a0) +#define DCM_RTROIInterpretedType DcmTagKey(0x3006, 0x00a4) +#define DCM_ROIInterpreter DcmTagKey(0x3006, 0x00a6) +#define DCM_ROIPhysicalPropertiesSequence DcmTagKey(0x3006, 0x00b0) +#define DCM_ROIPhysicalProperty DcmTagKey(0x3006, 0x00b2) +#define DCM_ROIPhysicalPropertyValue DcmTagKey(0x3006, 0x00b4) +#define DCM_ROIElementalCompositionSequence DcmTagKey(0x3006, 0x00b6) +#define DCM_ROIElementalCompositionAtomicNumber DcmTagKey(0x3006, 0x00b7) +#define DCM_ROIElementalCompositionAtomicMassFraction DcmTagKey(0x3006, 0x00b8) +#define DCM_RETIRED_AdditionalRTROIIdentificationCodeSequence DcmTagKey(0x3006, 0x00b9) +#define DCM_RETIRED_FrameOfReferenceRelationshipSequence DcmTagKey(0x3006, 0x00c0) +#define DCM_RETIRED_RelatedFrameOfReferenceUID DcmTagKey(0x3006, 0x00c2) +#define DCM_RETIRED_FrameOfReferenceTransformationType DcmTagKey(0x3006, 0x00c4) +#define DCM_FrameOfReferenceTransformationMatrix DcmTagKey(0x3006, 0x00c6) +#define DCM_FrameOfReferenceTransformationComment DcmTagKey(0x3006, 0x00c8) +#define DCM_PatientLocationCoordinatesSequence DcmTagKey(0x3006, 0x00c9) +#define DCM_PatientLocationCoordinatesCodeSequence DcmTagKey(0x3006, 0x00ca) +#define DCM_PatientSupportPositionSequence DcmTagKey(0x3006, 0x00cb) +#define DCM_MeasuredDoseReferenceSequence DcmTagKey(0x3008, 0x0010) +#define DCM_MeasuredDoseDescription DcmTagKey(0x3008, 0x0012) +#define DCM_MeasuredDoseType DcmTagKey(0x3008, 0x0014) +#define DCM_MeasuredDoseValue DcmTagKey(0x3008, 0x0016) +#define DCM_TreatmentSessionBeamSequence DcmTagKey(0x3008, 0x0020) +#define DCM_TreatmentSessionIonBeamSequence DcmTagKey(0x3008, 0x0021) +#define DCM_CurrentFractionNumber DcmTagKey(0x3008, 0x0022) +#define DCM_TreatmentControlPointDate DcmTagKey(0x3008, 0x0024) +#define DCM_TreatmentControlPointTime DcmTagKey(0x3008, 0x0025) +#define DCM_TreatmentTerminationStatus DcmTagKey(0x3008, 0x002a) +#define DCM_TreatmentTerminationCode DcmTagKey(0x3008, 0x002b) +#define DCM_TreatmentVerificationStatus DcmTagKey(0x3008, 0x002c) +#define DCM_ReferencedTreatmentRecordSequence DcmTagKey(0x3008, 0x0030) +#define DCM_SpecifiedPrimaryMeterset DcmTagKey(0x3008, 0x0032) +#define DCM_SpecifiedSecondaryMeterset DcmTagKey(0x3008, 0x0033) +#define DCM_DeliveredPrimaryMeterset DcmTagKey(0x3008, 0x0036) +#define DCM_DeliveredSecondaryMeterset DcmTagKey(0x3008, 0x0037) +#define DCM_SpecifiedTreatmentTime DcmTagKey(0x3008, 0x003a) +#define DCM_DeliveredTreatmentTime DcmTagKey(0x3008, 0x003b) +#define DCM_ControlPointDeliverySequence DcmTagKey(0x3008, 0x0040) +#define DCM_IonControlPointDeliverySequence DcmTagKey(0x3008, 0x0041) +#define DCM_SpecifiedMeterset DcmTagKey(0x3008, 0x0042) +#define DCM_DeliveredMeterset DcmTagKey(0x3008, 0x0044) +#define DCM_MetersetRateSet DcmTagKey(0x3008, 0x0045) +#define DCM_MetersetRateDelivered DcmTagKey(0x3008, 0x0046) +#define DCM_ScanSpotMetersetsDelivered DcmTagKey(0x3008, 0x0047) +#define DCM_DoseRateDelivered DcmTagKey(0x3008, 0x0048) +#define DCM_TreatmentSummaryCalculatedDoseReferenceSequence DcmTagKey(0x3008, 0x0050) +#define DCM_CumulativeDoseToDoseReference DcmTagKey(0x3008, 0x0052) +#define DCM_FirstTreatmentDate DcmTagKey(0x3008, 0x0054) +#define DCM_MostRecentTreatmentDate DcmTagKey(0x3008, 0x0056) +#define DCM_NumberOfFractionsDelivered DcmTagKey(0x3008, 0x005a) +#define DCM_OverrideSequence DcmTagKey(0x3008, 0x0060) +#define DCM_ParameterSequencePointer DcmTagKey(0x3008, 0x0061) +#define DCM_OverrideParameterPointer DcmTagKey(0x3008, 0x0062) +#define DCM_ParameterItemIndex DcmTagKey(0x3008, 0x0063) +#define DCM_MeasuredDoseReferenceNumber DcmTagKey(0x3008, 0x0064) +#define DCM_ParameterPointer DcmTagKey(0x3008, 0x0065) +#define DCM_OverrideReason DcmTagKey(0x3008, 0x0066) +#define DCM_ParameterValueNumber DcmTagKey(0x3008, 0x0067) +#define DCM_CorrectedParameterSequence DcmTagKey(0x3008, 0x0068) +#define DCM_CorrectionValue DcmTagKey(0x3008, 0x006a) +#define DCM_CalculatedDoseReferenceSequence DcmTagKey(0x3008, 0x0070) +#define DCM_CalculatedDoseReferenceNumber DcmTagKey(0x3008, 0x0072) +#define DCM_CalculatedDoseReferenceDescription DcmTagKey(0x3008, 0x0074) +#define DCM_CalculatedDoseReferenceDoseValue DcmTagKey(0x3008, 0x0076) +#define DCM_StartMeterset DcmTagKey(0x3008, 0x0078) +#define DCM_EndMeterset DcmTagKey(0x3008, 0x007a) +#define DCM_ReferencedMeasuredDoseReferenceSequence DcmTagKey(0x3008, 0x0080) +#define DCM_ReferencedMeasuredDoseReferenceNumber DcmTagKey(0x3008, 0x0082) +#define DCM_ReferencedCalculatedDoseReferenceSequence DcmTagKey(0x3008, 0x0090) +#define DCM_ReferencedCalculatedDoseReferenceNumber DcmTagKey(0x3008, 0x0092) +#define DCM_BeamLimitingDeviceLeafPairsSequence DcmTagKey(0x3008, 0x00a0) +#define DCM_RecordedWedgeSequence DcmTagKey(0x3008, 0x00b0) +#define DCM_RecordedCompensatorSequence DcmTagKey(0x3008, 0x00c0) +#define DCM_RecordedBlockSequence DcmTagKey(0x3008, 0x00d0) +#define DCM_TreatmentSummaryMeasuredDoseReferenceSequence DcmTagKey(0x3008, 0x00e0) +#define DCM_RecordedSnoutSequence DcmTagKey(0x3008, 0x00f0) +#define DCM_RecordedRangeShifterSequence DcmTagKey(0x3008, 0x00f2) +#define DCM_RecordedLateralSpreadingDeviceSequence DcmTagKey(0x3008, 0x00f4) +#define DCM_RecordedRangeModulatorSequence DcmTagKey(0x3008, 0x00f6) +#define DCM_RecordedSourceSequence DcmTagKey(0x3008, 0x0100) +#define DCM_SourceSerialNumber DcmTagKey(0x3008, 0x0105) +#define DCM_TreatmentSessionApplicationSetupSequence DcmTagKey(0x3008, 0x0110) +#define DCM_ApplicationSetupCheck DcmTagKey(0x3008, 0x0116) +#define DCM_RecordedBrachyAccessoryDeviceSequence DcmTagKey(0x3008, 0x0120) +#define DCM_ReferencedBrachyAccessoryDeviceNumber DcmTagKey(0x3008, 0x0122) +#define DCM_RecordedChannelSequence DcmTagKey(0x3008, 0x0130) +#define DCM_SpecifiedChannelTotalTime DcmTagKey(0x3008, 0x0132) +#define DCM_DeliveredChannelTotalTime DcmTagKey(0x3008, 0x0134) +#define DCM_SpecifiedNumberOfPulses DcmTagKey(0x3008, 0x0136) +#define DCM_DeliveredNumberOfPulses DcmTagKey(0x3008, 0x0138) +#define DCM_SpecifiedPulseRepetitionInterval DcmTagKey(0x3008, 0x013a) +#define DCM_DeliveredPulseRepetitionInterval DcmTagKey(0x3008, 0x013c) +#define DCM_RecordedSourceApplicatorSequence DcmTagKey(0x3008, 0x0140) +#define DCM_ReferencedSourceApplicatorNumber DcmTagKey(0x3008, 0x0142) +#define DCM_RecordedChannelShieldSequence DcmTagKey(0x3008, 0x0150) +#define DCM_ReferencedChannelShieldNumber DcmTagKey(0x3008, 0x0152) +#define DCM_BrachyControlPointDeliveredSequence DcmTagKey(0x3008, 0x0160) +#define DCM_SafePositionExitDate DcmTagKey(0x3008, 0x0162) +#define DCM_SafePositionExitTime DcmTagKey(0x3008, 0x0164) +#define DCM_SafePositionReturnDate DcmTagKey(0x3008, 0x0166) +#define DCM_SafePositionReturnTime DcmTagKey(0x3008, 0x0168) +#define DCM_PulseSpecificBrachyControlPointDeliveredSequence DcmTagKey(0x3008, 0x0171) +#define DCM_PulseNumber DcmTagKey(0x3008, 0x0172) +#define DCM_BrachyPulseControlPointDeliveredSequence DcmTagKey(0x3008, 0x0173) +#define DCM_CurrentTreatmentStatus DcmTagKey(0x3008, 0x0200) +#define DCM_TreatmentStatusComment DcmTagKey(0x3008, 0x0202) +#define DCM_FractionGroupSummarySequence DcmTagKey(0x3008, 0x0220) +#define DCM_ReferencedFractionNumber DcmTagKey(0x3008, 0x0223) +#define DCM_FractionGroupType DcmTagKey(0x3008, 0x0224) +#define DCM_BeamStopperPosition DcmTagKey(0x3008, 0x0230) +#define DCM_FractionStatusSummarySequence DcmTagKey(0x3008, 0x0240) +#define DCM_TreatmentDate DcmTagKey(0x3008, 0x0250) +#define DCM_TreatmentTime DcmTagKey(0x3008, 0x0251) +#define DCM_RTPlanLabel DcmTagKey(0x300a, 0x0002) +#define DCM_RTPlanName DcmTagKey(0x300a, 0x0003) +#define DCM_RTPlanDescription DcmTagKey(0x300a, 0x0004) +#define DCM_RTPlanDate DcmTagKey(0x300a, 0x0006) +#define DCM_RTPlanTime DcmTagKey(0x300a, 0x0007) +#define DCM_TreatmentProtocols DcmTagKey(0x300a, 0x0009) +#define DCM_PlanIntent DcmTagKey(0x300a, 0x000a) +#define DCM_TreatmentSites DcmTagKey(0x300a, 0x000b) +#define DCM_RTPlanGeometry DcmTagKey(0x300a, 0x000c) +#define DCM_PrescriptionDescription DcmTagKey(0x300a, 0x000e) +#define DCM_DoseReferenceSequence DcmTagKey(0x300a, 0x0010) +#define DCM_DoseReferenceNumber DcmTagKey(0x300a, 0x0012) +#define DCM_DoseReferenceUID DcmTagKey(0x300a, 0x0013) +#define DCM_DoseReferenceStructureType DcmTagKey(0x300a, 0x0014) +#define DCM_NominalBeamEnergyUnit DcmTagKey(0x300a, 0x0015) +#define DCM_DoseReferenceDescription DcmTagKey(0x300a, 0x0016) +#define DCM_DoseReferencePointCoordinates DcmTagKey(0x300a, 0x0018) +#define DCM_NominalPriorDose DcmTagKey(0x300a, 0x001a) +#define DCM_DoseReferenceType DcmTagKey(0x300a, 0x0020) +#define DCM_ConstraintWeight DcmTagKey(0x300a, 0x0021) +#define DCM_DeliveryWarningDose DcmTagKey(0x300a, 0x0022) +#define DCM_DeliveryMaximumDose DcmTagKey(0x300a, 0x0023) +#define DCM_TargetMinimumDose DcmTagKey(0x300a, 0x0025) +#define DCM_TargetPrescriptionDose DcmTagKey(0x300a, 0x0026) +#define DCM_TargetMaximumDose DcmTagKey(0x300a, 0x0027) +#define DCM_TargetUnderdoseVolumeFraction DcmTagKey(0x300a, 0x0028) +#define DCM_OrganAtRiskFullVolumeDose DcmTagKey(0x300a, 0x002a) +#define DCM_OrganAtRiskLimitDose DcmTagKey(0x300a, 0x002b) +#define DCM_OrganAtRiskMaximumDose DcmTagKey(0x300a, 0x002c) +#define DCM_OrganAtRiskOverdoseVolumeFraction DcmTagKey(0x300a, 0x002d) +#define DCM_ToleranceTableSequence DcmTagKey(0x300a, 0x0040) +#define DCM_ToleranceTableNumber DcmTagKey(0x300a, 0x0042) +#define DCM_ToleranceTableLabel DcmTagKey(0x300a, 0x0043) +#define DCM_GantryAngleTolerance DcmTagKey(0x300a, 0x0044) +#define DCM_BeamLimitingDeviceAngleTolerance DcmTagKey(0x300a, 0x0046) +#define DCM_BeamLimitingDeviceToleranceSequence DcmTagKey(0x300a, 0x0048) +#define DCM_BeamLimitingDevicePositionTolerance DcmTagKey(0x300a, 0x004a) +#define DCM_SnoutPositionTolerance DcmTagKey(0x300a, 0x004b) +#define DCM_PatientSupportAngleTolerance DcmTagKey(0x300a, 0x004c) +#define DCM_TableTopEccentricAngleTolerance DcmTagKey(0x300a, 0x004e) +#define DCM_TableTopPitchAngleTolerance DcmTagKey(0x300a, 0x004f) +#define DCM_TableTopRollAngleTolerance DcmTagKey(0x300a, 0x0050) +#define DCM_TableTopVerticalPositionTolerance DcmTagKey(0x300a, 0x0051) +#define DCM_TableTopLongitudinalPositionTolerance DcmTagKey(0x300a, 0x0052) +#define DCM_TableTopLateralPositionTolerance DcmTagKey(0x300a, 0x0053) +#define DCM_RTPlanRelationship DcmTagKey(0x300a, 0x0055) +#define DCM_FractionGroupSequence DcmTagKey(0x300a, 0x0070) +#define DCM_FractionGroupNumber DcmTagKey(0x300a, 0x0071) +#define DCM_FractionGroupDescription DcmTagKey(0x300a, 0x0072) +#define DCM_NumberOfFractionsPlanned DcmTagKey(0x300a, 0x0078) +#define DCM_NumberOfFractionPatternDigitsPerDay DcmTagKey(0x300a, 0x0079) +#define DCM_RepeatFractionCycleLength DcmTagKey(0x300a, 0x007a) +#define DCM_FractionPattern DcmTagKey(0x300a, 0x007b) +#define DCM_NumberOfBeams DcmTagKey(0x300a, 0x0080) +#define DCM_BeamDoseSpecificationPoint DcmTagKey(0x300a, 0x0082) +#define DCM_ReferencedDoseReferenceUID DcmTagKey(0x300a, 0x0083) +#define DCM_BeamDose DcmTagKey(0x300a, 0x0084) +#define DCM_BeamMeterset DcmTagKey(0x300a, 0x0086) +#define DCM_BeamDosePointDepth DcmTagKey(0x300a, 0x0088) +#define DCM_BeamDosePointEquivalentDepth DcmTagKey(0x300a, 0x0089) +#define DCM_BeamDosePointSSD DcmTagKey(0x300a, 0x008a) +#define DCM_BeamDoseMeaning DcmTagKey(0x300a, 0x008b) +#define DCM_BeamDoseVerificationControlPointSequence DcmTagKey(0x300a, 0x008c) +#define DCM_RETIRED_AverageBeamDosePointDepth DcmTagKey(0x300a, 0x008d) +#define DCM_RETIRED_AverageBeamDosePointEquivalentDepth DcmTagKey(0x300a, 0x008e) +#define DCM_RETIRED_AverageBeamDosePointSSD DcmTagKey(0x300a, 0x008f) +#define DCM_BeamDoseType DcmTagKey(0x300a, 0x0090) +#define DCM_AlternateBeamDose DcmTagKey(0x300a, 0x0091) +#define DCM_AlternateBeamDoseType DcmTagKey(0x300a, 0x0092) +#define DCM_DepthValueAveragingFlag DcmTagKey(0x300a, 0x0093) +#define DCM_BeamDosePointSourceToExternalContourDistance DcmTagKey(0x300a, 0x0094) +#define DCM_NumberOfBrachyApplicationSetups DcmTagKey(0x300a, 0x00a0) +#define DCM_BrachyApplicationSetupDoseSpecificationPoint DcmTagKey(0x300a, 0x00a2) +#define DCM_BrachyApplicationSetupDose DcmTagKey(0x300a, 0x00a4) +#define DCM_BeamSequence DcmTagKey(0x300a, 0x00b0) +#define DCM_TreatmentMachineName DcmTagKey(0x300a, 0x00b2) +#define DCM_PrimaryDosimeterUnit DcmTagKey(0x300a, 0x00b3) +#define DCM_SourceAxisDistance DcmTagKey(0x300a, 0x00b4) +#define DCM_BeamLimitingDeviceSequence DcmTagKey(0x300a, 0x00b6) +#define DCM_RTBeamLimitingDeviceType DcmTagKey(0x300a, 0x00b8) +#define DCM_SourceToBeamLimitingDeviceDistance DcmTagKey(0x300a, 0x00ba) +#define DCM_IsocenterToBeamLimitingDeviceDistance DcmTagKey(0x300a, 0x00bb) +#define DCM_NumberOfLeafJawPairs DcmTagKey(0x300a, 0x00bc) +#define DCM_LeafPositionBoundaries DcmTagKey(0x300a, 0x00be) +#define DCM_BeamNumber DcmTagKey(0x300a, 0x00c0) +#define DCM_BeamName DcmTagKey(0x300a, 0x00c2) +#define DCM_BeamDescription DcmTagKey(0x300a, 0x00c3) +#define DCM_BeamType DcmTagKey(0x300a, 0x00c4) +#define DCM_BeamDeliveryDurationLimit DcmTagKey(0x300a, 0x00c5) +#define DCM_RadiationType DcmTagKey(0x300a, 0x00c6) +#define DCM_HighDoseTechniqueType DcmTagKey(0x300a, 0x00c7) +#define DCM_ReferenceImageNumber DcmTagKey(0x300a, 0x00c8) +#define DCM_PlannedVerificationImageSequence DcmTagKey(0x300a, 0x00ca) +#define DCM_ImagingDeviceSpecificAcquisitionParameters DcmTagKey(0x300a, 0x00cc) +#define DCM_TreatmentDeliveryType DcmTagKey(0x300a, 0x00ce) +#define DCM_NumberOfWedges DcmTagKey(0x300a, 0x00d0) +#define DCM_WedgeSequence DcmTagKey(0x300a, 0x00d1) +#define DCM_WedgeNumber DcmTagKey(0x300a, 0x00d2) +#define DCM_WedgeType DcmTagKey(0x300a, 0x00d3) +#define DCM_WedgeID DcmTagKey(0x300a, 0x00d4) +#define DCM_WedgeAngle DcmTagKey(0x300a, 0x00d5) +#define DCM_WedgeFactor DcmTagKey(0x300a, 0x00d6) +#define DCM_TotalWedgeTrayWaterEquivalentThickness DcmTagKey(0x300a, 0x00d7) +#define DCM_WedgeOrientation DcmTagKey(0x300a, 0x00d8) +#define DCM_IsocenterToWedgeTrayDistance DcmTagKey(0x300a, 0x00d9) +#define DCM_SourceToWedgeTrayDistance DcmTagKey(0x300a, 0x00da) +#define DCM_WedgeThinEdgePosition DcmTagKey(0x300a, 0x00db) +#define DCM_BolusID DcmTagKey(0x300a, 0x00dc) +#define DCM_BolusDescription DcmTagKey(0x300a, 0x00dd) +#define DCM_EffectiveWedgeAngle DcmTagKey(0x300a, 0x00de) +#define DCM_NumberOfCompensators DcmTagKey(0x300a, 0x00e0) +#define DCM_MaterialID DcmTagKey(0x300a, 0x00e1) +#define DCM_TotalCompensatorTrayFactor DcmTagKey(0x300a, 0x00e2) +#define DCM_CompensatorSequence DcmTagKey(0x300a, 0x00e3) +#define DCM_CompensatorNumber DcmTagKey(0x300a, 0x00e4) +#define DCM_CompensatorID DcmTagKey(0x300a, 0x00e5) +#define DCM_SourceToCompensatorTrayDistance DcmTagKey(0x300a, 0x00e6) +#define DCM_CompensatorRows DcmTagKey(0x300a, 0x00e7) +#define DCM_CompensatorColumns DcmTagKey(0x300a, 0x00e8) +#define DCM_CompensatorPixelSpacing DcmTagKey(0x300a, 0x00e9) +#define DCM_CompensatorPosition DcmTagKey(0x300a, 0x00ea) +#define DCM_CompensatorTransmissionData DcmTagKey(0x300a, 0x00eb) +#define DCM_CompensatorThicknessData DcmTagKey(0x300a, 0x00ec) +#define DCM_NumberOfBoli DcmTagKey(0x300a, 0x00ed) +#define DCM_CompensatorType DcmTagKey(0x300a, 0x00ee) +#define DCM_CompensatorTrayID DcmTagKey(0x300a, 0x00ef) +#define DCM_NumberOfBlocks DcmTagKey(0x300a, 0x00f0) +#define DCM_TotalBlockTrayFactor DcmTagKey(0x300a, 0x00f2) +#define DCM_TotalBlockTrayWaterEquivalentThickness DcmTagKey(0x300a, 0x00f3) +#define DCM_BlockSequence DcmTagKey(0x300a, 0x00f4) +#define DCM_BlockTrayID DcmTagKey(0x300a, 0x00f5) +#define DCM_SourceToBlockTrayDistance DcmTagKey(0x300a, 0x00f6) +#define DCM_IsocenterToBlockTrayDistance DcmTagKey(0x300a, 0x00f7) +#define DCM_BlockType DcmTagKey(0x300a, 0x00f8) +#define DCM_AccessoryCode DcmTagKey(0x300a, 0x00f9) +#define DCM_BlockDivergence DcmTagKey(0x300a, 0x00fa) +#define DCM_BlockMountingPosition DcmTagKey(0x300a, 0x00fb) +#define DCM_BlockNumber DcmTagKey(0x300a, 0x00fc) +#define DCM_BlockName DcmTagKey(0x300a, 0x00fe) +#define DCM_BlockThickness DcmTagKey(0x300a, 0x0100) +#define DCM_BlockTransmission DcmTagKey(0x300a, 0x0102) +#define DCM_BlockNumberOfPoints DcmTagKey(0x300a, 0x0104) +#define DCM_BlockData DcmTagKey(0x300a, 0x0106) +#define DCM_ApplicatorSequence DcmTagKey(0x300a, 0x0107) +#define DCM_ApplicatorID DcmTagKey(0x300a, 0x0108) +#define DCM_ApplicatorType DcmTagKey(0x300a, 0x0109) +#define DCM_ApplicatorDescription DcmTagKey(0x300a, 0x010a) +#define DCM_CumulativeDoseReferenceCoefficient DcmTagKey(0x300a, 0x010c) +#define DCM_FinalCumulativeMetersetWeight DcmTagKey(0x300a, 0x010e) +#define DCM_NumberOfControlPoints DcmTagKey(0x300a, 0x0110) +#define DCM_ControlPointSequence DcmTagKey(0x300a, 0x0111) +#define DCM_ControlPointIndex DcmTagKey(0x300a, 0x0112) +#define DCM_NominalBeamEnergy DcmTagKey(0x300a, 0x0114) +#define DCM_DoseRateSet DcmTagKey(0x300a, 0x0115) +#define DCM_WedgePositionSequence DcmTagKey(0x300a, 0x0116) +#define DCM_WedgePosition DcmTagKey(0x300a, 0x0118) +#define DCM_BeamLimitingDevicePositionSequence DcmTagKey(0x300a, 0x011a) +#define DCM_LeafJawPositions DcmTagKey(0x300a, 0x011c) +#define DCM_GantryAngle DcmTagKey(0x300a, 0x011e) +#define DCM_GantryRotationDirection DcmTagKey(0x300a, 0x011f) +#define DCM_BeamLimitingDeviceAngle DcmTagKey(0x300a, 0x0120) +#define DCM_BeamLimitingDeviceRotationDirection DcmTagKey(0x300a, 0x0121) +#define DCM_PatientSupportAngle DcmTagKey(0x300a, 0x0122) +#define DCM_PatientSupportRotationDirection DcmTagKey(0x300a, 0x0123) +#define DCM_TableTopEccentricAxisDistance DcmTagKey(0x300a, 0x0124) +#define DCM_TableTopEccentricAngle DcmTagKey(0x300a, 0x0125) +#define DCM_TableTopEccentricRotationDirection DcmTagKey(0x300a, 0x0126) +#define DCM_TableTopVerticalPosition DcmTagKey(0x300a, 0x0128) +#define DCM_TableTopLongitudinalPosition DcmTagKey(0x300a, 0x0129) +#define DCM_TableTopLateralPosition DcmTagKey(0x300a, 0x012a) +#define DCM_IsocenterPosition DcmTagKey(0x300a, 0x012c) +#define DCM_SurfaceEntryPoint DcmTagKey(0x300a, 0x012e) +#define DCM_SourceToSurfaceDistance DcmTagKey(0x300a, 0x0130) +#define DCM_AverageBeamDosePointSourceToExternalContourDistance DcmTagKey(0x300a, 0x0131) +#define DCM_SourceToExternalContourDistance DcmTagKey(0x300a, 0x0132) +#define DCM_ExternalContourEntryPoint DcmTagKey(0x300a, 0x0133) +#define DCM_CumulativeMetersetWeight DcmTagKey(0x300a, 0x0134) +#define DCM_TableTopPitchAngle DcmTagKey(0x300a, 0x0140) +#define DCM_TableTopPitchRotationDirection DcmTagKey(0x300a, 0x0142) +#define DCM_TableTopRollAngle DcmTagKey(0x300a, 0x0144) +#define DCM_TableTopRollRotationDirection DcmTagKey(0x300a, 0x0146) +#define DCM_HeadFixationAngle DcmTagKey(0x300a, 0x0148) +#define DCM_GantryPitchAngle DcmTagKey(0x300a, 0x014a) +#define DCM_GantryPitchRotationDirection DcmTagKey(0x300a, 0x014c) +#define DCM_GantryPitchAngleTolerance DcmTagKey(0x300a, 0x014e) +#define DCM_FixationEye DcmTagKey(0x300a, 0x0150) +#define DCM_ChairHeadFramePosition DcmTagKey(0x300a, 0x0151) +#define DCM_HeadFixationAngleTolerance DcmTagKey(0x300a, 0x0152) +#define DCM_ChairHeadFramePositionTolerance DcmTagKey(0x300a, 0x0153) +#define DCM_FixationLightAzimuthalAngleTolerance DcmTagKey(0x300a, 0x0154) +#define DCM_FixationLightPolarAngleTolerance DcmTagKey(0x300a, 0x0155) +#define DCM_PatientSetupSequence DcmTagKey(0x300a, 0x0180) +#define DCM_PatientSetupNumber DcmTagKey(0x300a, 0x0182) +#define DCM_PatientSetupLabel DcmTagKey(0x300a, 0x0183) +#define DCM_PatientAdditionalPosition DcmTagKey(0x300a, 0x0184) +#define DCM_FixationDeviceSequence DcmTagKey(0x300a, 0x0190) +#define DCM_FixationDeviceType DcmTagKey(0x300a, 0x0192) +#define DCM_FixationDeviceLabel DcmTagKey(0x300a, 0x0194) +#define DCM_FixationDeviceDescription DcmTagKey(0x300a, 0x0196) +#define DCM_FixationDevicePosition DcmTagKey(0x300a, 0x0198) +#define DCM_FixationDevicePitchAngle DcmTagKey(0x300a, 0x0199) +#define DCM_FixationDeviceRollAngle DcmTagKey(0x300a, 0x019a) +#define DCM_ShieldingDeviceSequence DcmTagKey(0x300a, 0x01a0) +#define DCM_ShieldingDeviceType DcmTagKey(0x300a, 0x01a2) +#define DCM_ShieldingDeviceLabel DcmTagKey(0x300a, 0x01a4) +#define DCM_ShieldingDeviceDescription DcmTagKey(0x300a, 0x01a6) +#define DCM_ShieldingDevicePosition DcmTagKey(0x300a, 0x01a8) +#define DCM_SetupTechnique DcmTagKey(0x300a, 0x01b0) +#define DCM_SetupTechniqueDescription DcmTagKey(0x300a, 0x01b2) +#define DCM_SetupDeviceSequence DcmTagKey(0x300a, 0x01b4) +#define DCM_SetupDeviceType DcmTagKey(0x300a, 0x01b6) +#define DCM_SetupDeviceLabel DcmTagKey(0x300a, 0x01b8) +#define DCM_SetupDeviceDescription DcmTagKey(0x300a, 0x01ba) +#define DCM_SetupDeviceParameter DcmTagKey(0x300a, 0x01bc) +#define DCM_SetupReferenceDescription DcmTagKey(0x300a, 0x01d0) +#define DCM_TableTopVerticalSetupDisplacement DcmTagKey(0x300a, 0x01d2) +#define DCM_TableTopLongitudinalSetupDisplacement DcmTagKey(0x300a, 0x01d4) +#define DCM_TableTopLateralSetupDisplacement DcmTagKey(0x300a, 0x01d6) +#define DCM_BrachyTreatmentTechnique DcmTagKey(0x300a, 0x0200) +#define DCM_BrachyTreatmentType DcmTagKey(0x300a, 0x0202) +#define DCM_TreatmentMachineSequence DcmTagKey(0x300a, 0x0206) +#define DCM_SourceSequence DcmTagKey(0x300a, 0x0210) +#define DCM_SourceNumber DcmTagKey(0x300a, 0x0212) +#define DCM_SourceType DcmTagKey(0x300a, 0x0214) +#define DCM_SourceManufacturer DcmTagKey(0x300a, 0x0216) +#define DCM_ActiveSourceDiameter DcmTagKey(0x300a, 0x0218) +#define DCM_ActiveSourceLength DcmTagKey(0x300a, 0x021a) +#define DCM_SourceModelID DcmTagKey(0x300a, 0x021b) +#define DCM_SourceDescription DcmTagKey(0x300a, 0x021c) +#define DCM_SourceEncapsulationNominalThickness DcmTagKey(0x300a, 0x0222) +#define DCM_SourceEncapsulationNominalTransmission DcmTagKey(0x300a, 0x0224) +#define DCM_SourceIsotopeName DcmTagKey(0x300a, 0x0226) +#define DCM_SourceIsotopeHalfLife DcmTagKey(0x300a, 0x0228) +#define DCM_SourceStrengthUnits DcmTagKey(0x300a, 0x0229) +#define DCM_ReferenceAirKermaRate DcmTagKey(0x300a, 0x022a) +#define DCM_SourceStrength DcmTagKey(0x300a, 0x022b) +#define DCM_SourceStrengthReferenceDate DcmTagKey(0x300a, 0x022c) +#define DCM_SourceStrengthReferenceTime DcmTagKey(0x300a, 0x022e) +#define DCM_ApplicationSetupSequence DcmTagKey(0x300a, 0x0230) +#define DCM_ApplicationSetupType DcmTagKey(0x300a, 0x0232) +#define DCM_ApplicationSetupNumber DcmTagKey(0x300a, 0x0234) +#define DCM_ApplicationSetupName DcmTagKey(0x300a, 0x0236) +#define DCM_ApplicationSetupManufacturer DcmTagKey(0x300a, 0x0238) +#define DCM_TemplateNumber DcmTagKey(0x300a, 0x0240) +#define DCM_TemplateType DcmTagKey(0x300a, 0x0242) +#define DCM_TemplateName DcmTagKey(0x300a, 0x0244) +#define DCM_TotalReferenceAirKerma DcmTagKey(0x300a, 0x0250) +#define DCM_BrachyAccessoryDeviceSequence DcmTagKey(0x300a, 0x0260) +#define DCM_BrachyAccessoryDeviceNumber DcmTagKey(0x300a, 0x0262) +#define DCM_BrachyAccessoryDeviceID DcmTagKey(0x300a, 0x0263) +#define DCM_BrachyAccessoryDeviceType DcmTagKey(0x300a, 0x0264) +#define DCM_BrachyAccessoryDeviceName DcmTagKey(0x300a, 0x0266) +#define DCM_BrachyAccessoryDeviceNominalThickness DcmTagKey(0x300a, 0x026a) +#define DCM_BrachyAccessoryDeviceNominalTransmission DcmTagKey(0x300a, 0x026c) +#define DCM_ChannelEffectiveLength DcmTagKey(0x300a, 0x0271) +#define DCM_ChannelInnerLength DcmTagKey(0x300a, 0x0272) +#define DCM_AfterloaderChannelID DcmTagKey(0x300a, 0x0273) +#define DCM_SourceApplicatorTipLength DcmTagKey(0x300a, 0x0274) +#define DCM_ChannelSequence DcmTagKey(0x300a, 0x0280) +#define DCM_ChannelNumber DcmTagKey(0x300a, 0x0282) +#define DCM_ChannelLength DcmTagKey(0x300a, 0x0284) +#define DCM_ChannelTotalTime DcmTagKey(0x300a, 0x0286) +#define DCM_SourceMovementType DcmTagKey(0x300a, 0x0288) +#define DCM_NumberOfPulses DcmTagKey(0x300a, 0x028a) +#define DCM_PulseRepetitionInterval DcmTagKey(0x300a, 0x028c) +#define DCM_SourceApplicatorNumber DcmTagKey(0x300a, 0x0290) +#define DCM_SourceApplicatorID DcmTagKey(0x300a, 0x0291) +#define DCM_SourceApplicatorType DcmTagKey(0x300a, 0x0292) +#define DCM_SourceApplicatorName DcmTagKey(0x300a, 0x0294) +#define DCM_SourceApplicatorLength DcmTagKey(0x300a, 0x0296) +#define DCM_SourceApplicatorManufacturer DcmTagKey(0x300a, 0x0298) +#define DCM_SourceApplicatorWallNominalThickness DcmTagKey(0x300a, 0x029c) +#define DCM_SourceApplicatorWallNominalTransmission DcmTagKey(0x300a, 0x029e) +#define DCM_SourceApplicatorStepSize DcmTagKey(0x300a, 0x02a0) +#define DCM_TransferTubeNumber DcmTagKey(0x300a, 0x02a2) +#define DCM_TransferTubeLength DcmTagKey(0x300a, 0x02a4) +#define DCM_ChannelShieldSequence DcmTagKey(0x300a, 0x02b0) +#define DCM_ChannelShieldNumber DcmTagKey(0x300a, 0x02b2) +#define DCM_ChannelShieldID DcmTagKey(0x300a, 0x02b3) +#define DCM_ChannelShieldName DcmTagKey(0x300a, 0x02b4) +#define DCM_ChannelShieldNominalThickness DcmTagKey(0x300a, 0x02b8) +#define DCM_ChannelShieldNominalTransmission DcmTagKey(0x300a, 0x02ba) +#define DCM_FinalCumulativeTimeWeight DcmTagKey(0x300a, 0x02c8) +#define DCM_BrachyControlPointSequence DcmTagKey(0x300a, 0x02d0) +#define DCM_ControlPointRelativePosition DcmTagKey(0x300a, 0x02d2) +#define DCM_ControlPoint3DPosition DcmTagKey(0x300a, 0x02d4) +#define DCM_CumulativeTimeWeight DcmTagKey(0x300a, 0x02d6) +#define DCM_CompensatorDivergence DcmTagKey(0x300a, 0x02e0) +#define DCM_CompensatorMountingPosition DcmTagKey(0x300a, 0x02e1) +#define DCM_SourceToCompensatorDistance DcmTagKey(0x300a, 0x02e2) +#define DCM_TotalCompensatorTrayWaterEquivalentThickness DcmTagKey(0x300a, 0x02e3) +#define DCM_IsocenterToCompensatorTrayDistance DcmTagKey(0x300a, 0x02e4) +#define DCM_CompensatorColumnOffset DcmTagKey(0x300a, 0x02e5) +#define DCM_IsocenterToCompensatorDistances DcmTagKey(0x300a, 0x02e6) +#define DCM_CompensatorRelativeStoppingPowerRatio DcmTagKey(0x300a, 0x02e7) +#define DCM_CompensatorMillingToolDiameter DcmTagKey(0x300a, 0x02e8) +#define DCM_IonRangeCompensatorSequence DcmTagKey(0x300a, 0x02ea) +#define DCM_CompensatorDescription DcmTagKey(0x300a, 0x02eb) +#define DCM_RadiationMassNumber DcmTagKey(0x300a, 0x0302) +#define DCM_RadiationAtomicNumber DcmTagKey(0x300a, 0x0304) +#define DCM_RadiationChargeState DcmTagKey(0x300a, 0x0306) +#define DCM_ScanMode DcmTagKey(0x300a, 0x0308) +#define DCM_ModulatedScanModeType DcmTagKey(0x300a, 0x0309) +#define DCM_VirtualSourceAxisDistances DcmTagKey(0x300a, 0x030a) +#define DCM_SnoutSequence DcmTagKey(0x300a, 0x030c) +#define DCM_SnoutPosition DcmTagKey(0x300a, 0x030d) +#define DCM_SnoutID DcmTagKey(0x300a, 0x030f) +#define DCM_NumberOfRangeShifters DcmTagKey(0x300a, 0x0312) +#define DCM_RangeShifterSequence DcmTagKey(0x300a, 0x0314) +#define DCM_RangeShifterNumber DcmTagKey(0x300a, 0x0316) +#define DCM_RangeShifterID DcmTagKey(0x300a, 0x0318) +#define DCM_RangeShifterType DcmTagKey(0x300a, 0x0320) +#define DCM_RangeShifterDescription DcmTagKey(0x300a, 0x0322) +#define DCM_NumberOfLateralSpreadingDevices DcmTagKey(0x300a, 0x0330) +#define DCM_LateralSpreadingDeviceSequence DcmTagKey(0x300a, 0x0332) +#define DCM_LateralSpreadingDeviceNumber DcmTagKey(0x300a, 0x0334) +#define DCM_LateralSpreadingDeviceID DcmTagKey(0x300a, 0x0336) +#define DCM_LateralSpreadingDeviceType DcmTagKey(0x300a, 0x0338) +#define DCM_LateralSpreadingDeviceDescription DcmTagKey(0x300a, 0x033a) +#define DCM_LateralSpreadingDeviceWaterEquivalentThickness DcmTagKey(0x300a, 0x033c) +#define DCM_NumberOfRangeModulators DcmTagKey(0x300a, 0x0340) +#define DCM_RangeModulatorSequence DcmTagKey(0x300a, 0x0342) +#define DCM_RangeModulatorNumber DcmTagKey(0x300a, 0x0344) +#define DCM_RangeModulatorID DcmTagKey(0x300a, 0x0346) +#define DCM_RangeModulatorType DcmTagKey(0x300a, 0x0348) +#define DCM_RangeModulatorDescription DcmTagKey(0x300a, 0x034a) +#define DCM_BeamCurrentModulationID DcmTagKey(0x300a, 0x034c) +#define DCM_PatientSupportType DcmTagKey(0x300a, 0x0350) +#define DCM_PatientSupportID DcmTagKey(0x300a, 0x0352) +#define DCM_PatientSupportAccessoryCode DcmTagKey(0x300a, 0x0354) +#define DCM_TrayAccessoryCode DcmTagKey(0x300a, 0x0355) +#define DCM_FixationLightAzimuthalAngle DcmTagKey(0x300a, 0x0356) +#define DCM_FixationLightPolarAngle DcmTagKey(0x300a, 0x0358) +#define DCM_MetersetRate DcmTagKey(0x300a, 0x035a) +#define DCM_RangeShifterSettingsSequence DcmTagKey(0x300a, 0x0360) +#define DCM_RangeShifterSetting DcmTagKey(0x300a, 0x0362) +#define DCM_IsocenterToRangeShifterDistance DcmTagKey(0x300a, 0x0364) +#define DCM_RangeShifterWaterEquivalentThickness DcmTagKey(0x300a, 0x0366) +#define DCM_LateralSpreadingDeviceSettingsSequence DcmTagKey(0x300a, 0x0370) +#define DCM_LateralSpreadingDeviceSetting DcmTagKey(0x300a, 0x0372) +#define DCM_IsocenterToLateralSpreadingDeviceDistance DcmTagKey(0x300a, 0x0374) +#define DCM_RangeModulatorSettingsSequence DcmTagKey(0x300a, 0x0380) +#define DCM_RangeModulatorGatingStartValue DcmTagKey(0x300a, 0x0382) +#define DCM_RangeModulatorGatingStopValue DcmTagKey(0x300a, 0x0384) +#define DCM_RangeModulatorGatingStartWaterEquivalentThickness DcmTagKey(0x300a, 0x0386) +#define DCM_RangeModulatorGatingStopWaterEquivalentThickness DcmTagKey(0x300a, 0x0388) +#define DCM_IsocenterToRangeModulatorDistance DcmTagKey(0x300a, 0x038a) +#define DCM_ScanSpotTimeOffset DcmTagKey(0x300a, 0x038f) +#define DCM_ScanSpotTuneID DcmTagKey(0x300a, 0x0390) +#define DCM_ScanSpotPrescribedIndices DcmTagKey(0x300a, 0x0391) +#define DCM_NumberOfScanSpotPositions DcmTagKey(0x300a, 0x0392) +#define DCM_ScanSpotReordered DcmTagKey(0x300a, 0x0393) +#define DCM_ScanSpotPositionMap DcmTagKey(0x300a, 0x0394) +#define DCM_ScanSpotReorderingAllowed DcmTagKey(0x300a, 0x0395) +#define DCM_ScanSpotMetersetWeights DcmTagKey(0x300a, 0x0396) +#define DCM_ScanningSpotSize DcmTagKey(0x300a, 0x0398) +#define DCM_NumberOfPaintings DcmTagKey(0x300a, 0x039a) +#define DCM_IonToleranceTableSequence DcmTagKey(0x300a, 0x03a0) +#define DCM_IonBeamSequence DcmTagKey(0x300a, 0x03a2) +#define DCM_IonBeamLimitingDeviceSequence DcmTagKey(0x300a, 0x03a4) +#define DCM_IonBlockSequence DcmTagKey(0x300a, 0x03a6) +#define DCM_IonControlPointSequence DcmTagKey(0x300a, 0x03a8) +#define DCM_IonWedgeSequence DcmTagKey(0x300a, 0x03aa) +#define DCM_IonWedgePositionSequence DcmTagKey(0x300a, 0x03ac) +#define DCM_ReferencedSetupImageSequence DcmTagKey(0x300a, 0x0401) +#define DCM_SetupImageComment DcmTagKey(0x300a, 0x0402) +#define DCM_MotionSynchronizationSequence DcmTagKey(0x300a, 0x0410) +#define DCM_ControlPointOrientation DcmTagKey(0x300a, 0x0412) +#define DCM_GeneralAccessorySequence DcmTagKey(0x300a, 0x0420) +#define DCM_GeneralAccessoryID DcmTagKey(0x300a, 0x0421) +#define DCM_GeneralAccessoryDescription DcmTagKey(0x300a, 0x0422) +#define DCM_GeneralAccessoryType DcmTagKey(0x300a, 0x0423) +#define DCM_GeneralAccessoryNumber DcmTagKey(0x300a, 0x0424) +#define DCM_SourceToGeneralAccessoryDistance DcmTagKey(0x300a, 0x0425) +#define DCM_ApplicatorGeometrySequence DcmTagKey(0x300a, 0x0431) +#define DCM_ApplicatorApertureShape DcmTagKey(0x300a, 0x0432) +#define DCM_ApplicatorOpening DcmTagKey(0x300a, 0x0433) +#define DCM_ApplicatorOpeningX DcmTagKey(0x300a, 0x0434) +#define DCM_ApplicatorOpeningY DcmTagKey(0x300a, 0x0435) +#define DCM_SourceToApplicatorMountingPositionDistance DcmTagKey(0x300a, 0x0436) +#define DCM_NumberOfBlockSlabItems DcmTagKey(0x300a, 0x0440) +#define DCM_BlockSlabSequence DcmTagKey(0x300a, 0x0441) +#define DCM_BlockSlabThickness DcmTagKey(0x300a, 0x0442) +#define DCM_BlockSlabNumber DcmTagKey(0x300a, 0x0443) +#define DCM_DeviceMotionControlSequence DcmTagKey(0x300a, 0x0450) +#define DCM_DeviceMotionExecutionMode DcmTagKey(0x300a, 0x0451) +#define DCM_DeviceMotionObservationMode DcmTagKey(0x300a, 0x0452) +#define DCM_DeviceMotionParameterCodeSequence DcmTagKey(0x300a, 0x0453) +#define DCM_DistalDepthFraction DcmTagKey(0x300a, 0x0501) +#define DCM_DistalDepth DcmTagKey(0x300a, 0x0502) +#define DCM_NominalRangeModulationFractions DcmTagKey(0x300a, 0x0503) +#define DCM_NominalRangeModulatedRegionDepths DcmTagKey(0x300a, 0x0504) +#define DCM_DepthDoseParametersSequence DcmTagKey(0x300a, 0x0505) +#define DCM_DeliveredDepthDoseParametersSequence DcmTagKey(0x300a, 0x0506) +#define DCM_DeliveredDistalDepthFraction DcmTagKey(0x300a, 0x0507) +#define DCM_DeliveredDistalDepth DcmTagKey(0x300a, 0x0508) +#define DCM_DeliveredNominalRangeModulationFractions DcmTagKey(0x300a, 0x0509) +#define DCM_DeliveredNominalRangeModulatedRegionDepths DcmTagKey(0x300a, 0x0510) +#define DCM_DeliveredReferenceDoseDefinition DcmTagKey(0x300a, 0x0511) +#define DCM_ReferenceDoseDefinition DcmTagKey(0x300a, 0x0512) +#define DCM_RTControlPointIndex DcmTagKey(0x300a, 0x0600) +#define DCM_RadiationGenerationModeIndex DcmTagKey(0x300a, 0x0601) +#define DCM_ReferencedDefinedDeviceIndex DcmTagKey(0x300a, 0x0602) +#define DCM_RadiationDoseIdentificationIndex DcmTagKey(0x300a, 0x0603) +#define DCM_NumberOfRTControlPoints DcmTagKey(0x300a, 0x0604) +#define DCM_ReferencedRadiationGenerationModeIndex DcmTagKey(0x300a, 0x0605) +#define DCM_TreatmentPositionIndex DcmTagKey(0x300a, 0x0606) +#define DCM_ReferencedDeviceIndex DcmTagKey(0x300a, 0x0607) +#define DCM_TreatmentPositionGroupLabel DcmTagKey(0x300a, 0x0608) +#define DCM_TreatmentPositionGroupUID DcmTagKey(0x300a, 0x0609) +#define DCM_TreatmentPositionGroupSequence DcmTagKey(0x300a, 0x060a) +#define DCM_ReferencedTreatmentPositionIndex DcmTagKey(0x300a, 0x060b) +#define DCM_ReferencedRadiationDoseIdentificationIndex DcmTagKey(0x300a, 0x060c) +#define DCM_RTAccessoryHolderWaterEquivalentThickness DcmTagKey(0x300a, 0x060d) +#define DCM_ReferencedRTAccessoryHolderDeviceIndex DcmTagKey(0x300a, 0x060e) +#define DCM_RTAccessoryHolderSlotExistenceFlag DcmTagKey(0x300a, 0x060f) +#define DCM_RTAccessoryHolderSlotSequence DcmTagKey(0x300a, 0x0610) +#define DCM_RTAccessoryHolderSlotID DcmTagKey(0x300a, 0x0611) +#define DCM_RTAccessoryHolderSlotDistance DcmTagKey(0x300a, 0x0612) +#define DCM_RTAccessorySlotDistance DcmTagKey(0x300a, 0x0613) +#define DCM_RTAccessoryHolderDefinitionSequence DcmTagKey(0x300a, 0x0614) +#define DCM_RTAccessoryDeviceSlotID DcmTagKey(0x300a, 0x0615) +#define DCM_RTRadiationSequence DcmTagKey(0x300a, 0x0616) +#define DCM_RadiationDoseSequence DcmTagKey(0x300a, 0x0617) +#define DCM_RadiationDoseIdentificationSequence DcmTagKey(0x300a, 0x0618) +#define DCM_RadiationDoseIdentificationLabel DcmTagKey(0x300a, 0x0619) +#define DCM_ReferenceDoseType DcmTagKey(0x300a, 0x061a) +#define DCM_PrimaryDoseValueIndicator DcmTagKey(0x300a, 0x061b) +#define DCM_DoseValuesSequence DcmTagKey(0x300a, 0x061c) +#define DCM_DoseValuePurpose DcmTagKey(0x300a, 0x061d) +#define DCM_ReferenceDosePointCoordinates DcmTagKey(0x300a, 0x061e) +#define DCM_RadiationDoseValuesParametersSequence DcmTagKey(0x300a, 0x061f) +#define DCM_MetersetToDoseMappingSequence DcmTagKey(0x300a, 0x0620) +#define DCM_ExpectedInVivoMeasurementValuesSequence DcmTagKey(0x300a, 0x0621) +#define DCM_ExpectedInVivoMeasurementValueIndex DcmTagKey(0x300a, 0x0622) +#define DCM_RadiationDoseInVivoMeasurementLabel DcmTagKey(0x300a, 0x0623) +#define DCM_RadiationDoseCentralAxisDisplacement DcmTagKey(0x300a, 0x0624) +#define DCM_RadiationDoseValue DcmTagKey(0x300a, 0x0625) +#define DCM_RadiationDoseSourceToSkinDistance DcmTagKey(0x300a, 0x0626) +#define DCM_RadiationDoseMeasurementPointCoordinates DcmTagKey(0x300a, 0x0627) +#define DCM_RadiationDoseSourceToExternalContourDistance DcmTagKey(0x300a, 0x0628) +#define DCM_RTToleranceSetSequence DcmTagKey(0x300a, 0x0629) +#define DCM_RTToleranceSetLabel DcmTagKey(0x300a, 0x062a) +#define DCM_AttributeToleranceValuesSequence DcmTagKey(0x300a, 0x062b) +#define DCM_ToleranceValue DcmTagKey(0x300a, 0x062c) +#define DCM_PatientSupportPositionToleranceSequence DcmTagKey(0x300a, 0x062d) +#define DCM_TreatmentTimeLimit DcmTagKey(0x300a, 0x062e) +#define DCM_CArmPhotonElectronControlPointSequence DcmTagKey(0x300a, 0x062f) +#define DCM_ReferencedRTRadiationSequence DcmTagKey(0x300a, 0x0630) +#define DCM_ReferencedRTInstanceSequence DcmTagKey(0x300a, 0x0631) +#define DCM_ReferencedRTPatientSetupSequence DcmTagKey(0x300a, 0x0632) +#define DCM_SourceToPatientSurfaceDistance DcmTagKey(0x300a, 0x0634) +#define DCM_TreatmentMachineSpecialModeCodeSequence DcmTagKey(0x300a, 0x0635) +#define DCM_IntendedNumberOfFractions DcmTagKey(0x300a, 0x0636) +#define DCM_RTRadiationSetIntent DcmTagKey(0x300a, 0x0637) +#define DCM_RTRadiationPhysicalAndGeometricContentDetailFlag DcmTagKey(0x300a, 0x0638) +#define DCM_RTRecordFlag DcmTagKey(0x300a, 0x0639) +#define DCM_TreatmentDeviceIdentificationSequence DcmTagKey(0x300a, 0x063a) +#define DCM_ReferencedRTPhysicianIntentSequence DcmTagKey(0x300a, 0x063b) +#define DCM_CumulativeMeterset DcmTagKey(0x300a, 0x063c) +#define DCM_DeliveryRate DcmTagKey(0x300a, 0x063d) +#define DCM_DeliveryRateUnitSequence DcmTagKey(0x300a, 0x063e) +#define DCM_TreatmentPositionSequence DcmTagKey(0x300a, 0x063f) +#define DCM_RadiationSourceAxisDistance DcmTagKey(0x300a, 0x0640) +#define DCM_NumberOfRTBeamLimitingDevices DcmTagKey(0x300a, 0x0641) +#define DCM_RTBeamLimitingDeviceProximalDistance DcmTagKey(0x300a, 0x0642) +#define DCM_RTBeamLimitingDeviceDistalDistance DcmTagKey(0x300a, 0x0643) +#define DCM_ParallelRTBeamDelimiterDeviceOrientationLabelCodeSequence DcmTagKey(0x300a, 0x0644) +#define DCM_BeamsModifierOrientationAngle DcmTagKey(0x300a, 0x0645) +#define DCM_FixedRTBeamDelimiterDeviceSequence DcmTagKey(0x300a, 0x0646) +#define DCM_ParallelRTBeamDelimiterDeviceSequence DcmTagKey(0x300a, 0x0647) +#define DCM_NumberOfParallelRTBeamDelimiters DcmTagKey(0x300a, 0x0648) +#define DCM_ParallelRTBeamDelimiterBoundaries DcmTagKey(0x300a, 0x0649) +#define DCM_ParallelRTBeamDelimiterPositions DcmTagKey(0x300a, 0x064a) +#define DCM_RTBeamLimitingDeviceOffset DcmTagKey(0x300a, 0x064b) +#define DCM_RTBeamDelimiterGeometrySequence DcmTagKey(0x300a, 0x064c) +#define DCM_RTBeamLimitingDeviceDefinitionSequence DcmTagKey(0x300a, 0x064d) +#define DCM_ParallelRTBeamDelimiterOpeningMode DcmTagKey(0x300a, 0x064e) +#define DCM_ParallelRTBeamDelimiterLeafMountingSide DcmTagKey(0x300a, 0x064f) +#define DCM_PatientSetupUID DcmTagKey(0x300a, 0x0650) +#define DCM_WedgeDefinitionSequence DcmTagKey(0x300a, 0x0651) +#define DCM_RadiationBeamWedgeAngle DcmTagKey(0x300a, 0x0652) +#define DCM_RadiationBeamWedgeThinEdgeDistance DcmTagKey(0x300a, 0x0653) +#define DCM_RadiationBeamEffectiveWedgeAngle DcmTagKey(0x300a, 0x0654) +#define DCM_NumberOfWedgePositions DcmTagKey(0x300a, 0x0655) +#define DCM_RTBeamLimitingDeviceOpeningSequence DcmTagKey(0x300a, 0x0656) +#define DCM_NumberOfRTBeamLimitingDeviceOpenings DcmTagKey(0x300a, 0x0657) +#define DCM_RadiationDosimeterUnitSequence DcmTagKey(0x300a, 0x0658) +#define DCM_RTDeviceDistanceReferenceLocationCodeSequence DcmTagKey(0x300a, 0x0659) +#define DCM_RadiationDeviceConfigurationAndCommissioningKeySequence DcmTagKey(0x300a, 0x065a) +#define DCM_PatientSupportPositionParameterSequence DcmTagKey(0x300a, 0x065b) +#define DCM_PatientSupportPositionSpecificationMethod DcmTagKey(0x300a, 0x065c) +#define DCM_PatientSupportPositionDeviceParameterSequence DcmTagKey(0x300a, 0x065d) +#define DCM_DeviceOrderIndex DcmTagKey(0x300a, 0x065e) +#define DCM_PatientSupportPositionParameterOrderIndex DcmTagKey(0x300a, 0x065f) +#define DCM_PatientSupportPositionDeviceToleranceSequence DcmTagKey(0x300a, 0x0660) +#define DCM_PatientSupportPositionToleranceOrderIndex DcmTagKey(0x300a, 0x0661) +#define DCM_CompensatorDefinitionSequence DcmTagKey(0x300a, 0x0662) +#define DCM_CompensatorMapOrientation DcmTagKey(0x300a, 0x0663) +#define DCM_CompensatorProximalThicknessMap DcmTagKey(0x300a, 0x0664) +#define DCM_CompensatorDistalThicknessMap DcmTagKey(0x300a, 0x0665) +#define DCM_CompensatorBasePlaneOffset DcmTagKey(0x300a, 0x0666) +#define DCM_CompensatorShapeFabricationCodeSequence DcmTagKey(0x300a, 0x0667) +#define DCM_CompensatorShapeSequence DcmTagKey(0x300a, 0x0668) +#define DCM_RadiationBeamCompensatorMillingToolDiameter DcmTagKey(0x300a, 0x0669) +#define DCM_BlockDefinitionSequence DcmTagKey(0x300a, 0x066a) +#define DCM_BlockEdgeData DcmTagKey(0x300a, 0x066b) +#define DCM_BlockOrientation DcmTagKey(0x300a, 0x066c) +#define DCM_RadiationBeamBlockThickness DcmTagKey(0x300a, 0x066d) +#define DCM_RadiationBeamBlockSlabThickness DcmTagKey(0x300a, 0x066e) +#define DCM_BlockEdgeDataSequence DcmTagKey(0x300a, 0x066f) +#define DCM_NumberOfRTAccessoryHolders DcmTagKey(0x300a, 0x0670) +#define DCM_GeneralAccessoryDefinitionSequence DcmTagKey(0x300a, 0x0671) +#define DCM_NumberOfGeneralAccessories DcmTagKey(0x300a, 0x0672) +#define DCM_BolusDefinitionSequence DcmTagKey(0x300a, 0x0673) +#define DCM_NumberOfBoluses DcmTagKey(0x300a, 0x0674) +#define DCM_EquipmentFrameOfReferenceUID DcmTagKey(0x300a, 0x0675) +#define DCM_EquipmentFrameOfReferenceDescription DcmTagKey(0x300a, 0x0676) +#define DCM_EquipmentReferencePointCoordinatesSequence DcmTagKey(0x300a, 0x0677) +#define DCM_EquipmentReferencePointCodeSequence DcmTagKey(0x300a, 0x0678) +#define DCM_RTBeamLimitingDeviceAngle DcmTagKey(0x300a, 0x0679) +#define DCM_SourceRollAngle DcmTagKey(0x300a, 0x067a) +#define DCM_RadiationGenerationModeSequence DcmTagKey(0x300a, 0x067b) +#define DCM_RadiationGenerationModeLabel DcmTagKey(0x300a, 0x067c) +#define DCM_RadiationGenerationModeDescription DcmTagKey(0x300a, 0x067d) +#define DCM_RadiationGenerationModeMachineCodeSequence DcmTagKey(0x300a, 0x067e) +#define DCM_RadiationTypeCodeSequence DcmTagKey(0x300a, 0x067f) +#define DCM_NominalEnergy DcmTagKey(0x300a, 0x0680) +#define DCM_MinimumNominalEnergy DcmTagKey(0x300a, 0x0681) +#define DCM_MaximumNominalEnergy DcmTagKey(0x300a, 0x0682) +#define DCM_RadiationFluenceModifierCodeSequence DcmTagKey(0x300a, 0x0683) +#define DCM_EnergyUnitCodeSequence DcmTagKey(0x300a, 0x0684) +#define DCM_NumberOfRadiationGenerationModes DcmTagKey(0x300a, 0x0685) +#define DCM_PatientSupportDevicesSequence DcmTagKey(0x300a, 0x0686) +#define DCM_NumberOfPatientSupportDevices DcmTagKey(0x300a, 0x0687) +#define DCM_RTBeamModifierDefinitionDistance DcmTagKey(0x300a, 0x0688) +#define DCM_BeamAreaLimitSequence DcmTagKey(0x300a, 0x0689) +#define DCM_ReferencedRTPlanSequence DcmTagKey(0x300c, 0x0002) +#define DCM_ReferencedBeamSequence DcmTagKey(0x300c, 0x0004) +#define DCM_ReferencedBeamNumber DcmTagKey(0x300c, 0x0006) +#define DCM_ReferencedReferenceImageNumber DcmTagKey(0x300c, 0x0007) +#define DCM_StartCumulativeMetersetWeight DcmTagKey(0x300c, 0x0008) +#define DCM_EndCumulativeMetersetWeight DcmTagKey(0x300c, 0x0009) +#define DCM_ReferencedBrachyApplicationSetupSequence DcmTagKey(0x300c, 0x000a) +#define DCM_ReferencedBrachyApplicationSetupNumber DcmTagKey(0x300c, 0x000c) +#define DCM_ReferencedSourceNumber DcmTagKey(0x300c, 0x000e) +#define DCM_ReferencedFractionGroupSequence DcmTagKey(0x300c, 0x0020) +#define DCM_ReferencedFractionGroupNumber DcmTagKey(0x300c, 0x0022) +#define DCM_ReferencedVerificationImageSequence DcmTagKey(0x300c, 0x0040) +#define DCM_ReferencedReferenceImageSequence DcmTagKey(0x300c, 0x0042) +#define DCM_ReferencedDoseReferenceSequence DcmTagKey(0x300c, 0x0050) +#define DCM_ReferencedDoseReferenceNumber DcmTagKey(0x300c, 0x0051) +#define DCM_BrachyReferencedDoseReferenceSequence DcmTagKey(0x300c, 0x0055) +#define DCM_ReferencedStructureSetSequence DcmTagKey(0x300c, 0x0060) +#define DCM_ReferencedPatientSetupNumber DcmTagKey(0x300c, 0x006a) +#define DCM_ReferencedDoseSequence DcmTagKey(0x300c, 0x0080) +#define DCM_ReferencedToleranceTableNumber DcmTagKey(0x300c, 0x00a0) +#define DCM_ReferencedBolusSequence DcmTagKey(0x300c, 0x00b0) +#define DCM_ReferencedWedgeNumber DcmTagKey(0x300c, 0x00c0) +#define DCM_ReferencedCompensatorNumber DcmTagKey(0x300c, 0x00d0) +#define DCM_ReferencedBlockNumber DcmTagKey(0x300c, 0x00e0) +#define DCM_ReferencedControlPointIndex DcmTagKey(0x300c, 0x00f0) +#define DCM_ReferencedControlPointSequence DcmTagKey(0x300c, 0x00f2) +#define DCM_ReferencedStartControlPointIndex DcmTagKey(0x300c, 0x00f4) +#define DCM_ReferencedStopControlPointIndex DcmTagKey(0x300c, 0x00f6) +#define DCM_ReferencedRangeShifterNumber DcmTagKey(0x300c, 0x0100) +#define DCM_ReferencedLateralSpreadingDeviceNumber DcmTagKey(0x300c, 0x0102) +#define DCM_ReferencedRangeModulatorNumber DcmTagKey(0x300c, 0x0104) +#define DCM_OmittedBeamTaskSequence DcmTagKey(0x300c, 0x0111) +#define DCM_ReasonForOmission DcmTagKey(0x300c, 0x0112) +#define DCM_ReasonForOmissionDescription DcmTagKey(0x300c, 0x0113) +#define DCM_ApprovalStatus DcmTagKey(0x300e, 0x0002) +#define DCM_ReviewDate DcmTagKey(0x300e, 0x0004) +#define DCM_ReviewTime DcmTagKey(0x300e, 0x0005) +#define DCM_ReviewerName DcmTagKey(0x300e, 0x0008) +#define DCM_RadiobiologicalDoseEffectSequence DcmTagKey(0x3010, 0x0001) +#define DCM_RadiobiologicalDoseEffectFlag DcmTagKey(0x3010, 0x0002) +#define DCM_EffectiveDoseCalculationMethodCategoryCodeSequence DcmTagKey(0x3010, 0x0003) +#define DCM_EffectiveDoseCalculationMethodCodeSequence DcmTagKey(0x3010, 0x0004) +#define DCM_EffectiveDoseCalculationMethodDescription DcmTagKey(0x3010, 0x0005) +#define DCM_ConceptualVolumeUID DcmTagKey(0x3010, 0x0006) +#define DCM_OriginatingSOPInstanceReferenceSequence DcmTagKey(0x3010, 0x0007) +#define DCM_ConceptualVolumeConstituentSequence DcmTagKey(0x3010, 0x0008) +#define DCM_EquivalentConceptualVolumeInstanceReferenceSequence DcmTagKey(0x3010, 0x0009) +#define DCM_EquivalentConceptualVolumesSequence DcmTagKey(0x3010, 0x000a) +#define DCM_ReferencedConceptualVolumeUID DcmTagKey(0x3010, 0x000b) +#define DCM_ConceptualVolumeCombinationExpression DcmTagKey(0x3010, 0x000c) +#define DCM_ConceptualVolumeConstituentIndex DcmTagKey(0x3010, 0x000d) +#define DCM_ConceptualVolumeCombinationFlag DcmTagKey(0x3010, 0x000e) +#define DCM_ConceptualVolumeCombinationDescription DcmTagKey(0x3010, 0x000f) +#define DCM_ConceptualVolumeSegmentationDefinedFlag DcmTagKey(0x3010, 0x0010) +#define DCM_ConceptualVolumeSegmentationReferenceSequence DcmTagKey(0x3010, 0x0011) +#define DCM_ConceptualVolumeConstituentSegmentationReferenceSequence DcmTagKey(0x3010, 0x0012) +#define DCM_ConstituentConceptualVolumeUID DcmTagKey(0x3010, 0x0013) +#define DCM_DerivationConceptualVolumeSequence DcmTagKey(0x3010, 0x0014) +#define DCM_SourceConceptualVolumeUID DcmTagKey(0x3010, 0x0015) +#define DCM_ConceptualVolumeDerivationAlgorithmSequence DcmTagKey(0x3010, 0x0016) +#define DCM_ConceptualVolumeDescription DcmTagKey(0x3010, 0x0017) +#define DCM_SourceConceptualVolumeSequence DcmTagKey(0x3010, 0x0018) +#define DCM_AuthorIdentificationSequence DcmTagKey(0x3010, 0x0019) +#define DCM_ManufacturerModelVersion DcmTagKey(0x3010, 0x001a) +#define DCM_DeviceAlternateIdentifier DcmTagKey(0x3010, 0x001b) +#define DCM_DeviceAlternateIdentifierType DcmTagKey(0x3010, 0x001c) +#define DCM_DeviceAlternateIdentifierFormat DcmTagKey(0x3010, 0x001d) +#define DCM_SegmentationCreationTemplateLabel DcmTagKey(0x3010, 0x001e) +#define DCM_SegmentationTemplateUID DcmTagKey(0x3010, 0x001f) +#define DCM_ReferencedSegmentReferenceIndex DcmTagKey(0x3010, 0x0020) +#define DCM_SegmentReferenceSequence DcmTagKey(0x3010, 0x0021) +#define DCM_SegmentReferenceIndex DcmTagKey(0x3010, 0x0022) +#define DCM_DirectSegmentReferenceSequence DcmTagKey(0x3010, 0x0023) +#define DCM_CombinationSegmentReferenceSequence DcmTagKey(0x3010, 0x0024) +#define DCM_ConceptualVolumeSequence DcmTagKey(0x3010, 0x0025) +#define DCM_SegmentedRTAccessoryDeviceSequence DcmTagKey(0x3010, 0x0026) +#define DCM_SegmentCharacteristicsSequence DcmTagKey(0x3010, 0x0027) +#define DCM_RelatedSegmentCharacteristicsSequence DcmTagKey(0x3010, 0x0028) +#define DCM_SegmentCharacteristicsPrecedence DcmTagKey(0x3010, 0x0029) +#define DCM_RTSegmentAnnotationSequence DcmTagKey(0x3010, 0x002a) +#define DCM_SegmentAnnotationCategoryCodeSequence DcmTagKey(0x3010, 0x002b) +#define DCM_SegmentAnnotationTypeCodeSequence DcmTagKey(0x3010, 0x002c) +#define DCM_DeviceLabel DcmTagKey(0x3010, 0x002d) +#define DCM_DeviceTypeCodeSequence DcmTagKey(0x3010, 0x002e) +#define DCM_PatientEquipmentRelationshipCodeSequence DcmTagKey(0x3010, 0x0030) +#define DCM_ReferencedFiducialsUID DcmTagKey(0x3010, 0x0031) +#define DCM_PatientTreatmentOrientationSequence DcmTagKey(0x3010, 0x0032) +#define DCM_UserContentLabel DcmTagKey(0x3010, 0x0033) +#define DCM_UserContentLongLabel DcmTagKey(0x3010, 0x0034) +#define DCM_EntityLabel DcmTagKey(0x3010, 0x0035) +#define DCM_EntityName DcmTagKey(0x3010, 0x0036) +#define DCM_EntityDescription DcmTagKey(0x3010, 0x0037) +#define DCM_EntityLongLabel DcmTagKey(0x3010, 0x0038) +#define DCM_DeviceIndex DcmTagKey(0x3010, 0x0039) +#define DCM_RTTreatmentPhaseIndex DcmTagKey(0x3010, 0x003a) +#define DCM_RTTreatmentPhaseUID DcmTagKey(0x3010, 0x003b) +#define DCM_RTPrescriptionIndex DcmTagKey(0x3010, 0x003c) +#define DCM_RTSegmentAnnotationIndex DcmTagKey(0x3010, 0x003d) +#define DCM_BasisRTTreatmentPhaseIndex DcmTagKey(0x3010, 0x003e) +#define DCM_RelatedRTTreatmentPhaseIndex DcmTagKey(0x3010, 0x003f) +#define DCM_ReferencedRTTreatmentPhaseIndex DcmTagKey(0x3010, 0x0040) +#define DCM_ReferencedRTPrescriptionIndex DcmTagKey(0x3010, 0x0041) +#define DCM_ReferencedParentRTPrescriptionIndex DcmTagKey(0x3010, 0x0042) +#define DCM_ManufacturerDeviceIdentifier DcmTagKey(0x3010, 0x0043) +#define DCM_InstanceLevelReferencedPerformedProcedureStepSequence DcmTagKey(0x3010, 0x0044) +#define DCM_RTTreatmentPhaseIntentPresenceFlag DcmTagKey(0x3010, 0x0045) +#define DCM_RadiotherapyTreatmentType DcmTagKey(0x3010, 0x0046) +#define DCM_TeletherapyRadiationType DcmTagKey(0x3010, 0x0047) +#define DCM_BrachytherapySourceType DcmTagKey(0x3010, 0x0048) +#define DCM_ReferencedRTTreatmentPhaseSequence DcmTagKey(0x3010, 0x0049) +#define DCM_ReferencedDirectSegmentInstanceSequence DcmTagKey(0x3010, 0x004a) +#define DCM_IntendedRTTreatmentPhaseSequence DcmTagKey(0x3010, 0x004b) +#define DCM_IntendedPhaseStartDate DcmTagKey(0x3010, 0x004c) +#define DCM_IntendedPhaseEndDate DcmTagKey(0x3010, 0x004d) +#define DCM_RTTreatmentPhaseIntervalSequence DcmTagKey(0x3010, 0x004e) +#define DCM_TemporalRelationshipIntervalAnchor DcmTagKey(0x3010, 0x004f) +#define DCM_MinimumNumberOfIntervalDays DcmTagKey(0x3010, 0x0050) +#define DCM_MaximumNumberOfIntervalDays DcmTagKey(0x3010, 0x0051) +#define DCM_PertinentSOPClassesInStudy DcmTagKey(0x3010, 0x0052) +#define DCM_PertinentSOPClassesInSeries DcmTagKey(0x3010, 0x0053) +#define DCM_RTPrescriptionLabel DcmTagKey(0x3010, 0x0054) +#define DCM_RTPhysicianIntentPredecessorSequence DcmTagKey(0x3010, 0x0055) +#define DCM_RTTreatmentApproachLabel DcmTagKey(0x3010, 0x0056) +#define DCM_RTPhysicianIntentSequence DcmTagKey(0x3010, 0x0057) +#define DCM_RTPhysicianIntentIndex DcmTagKey(0x3010, 0x0058) +#define DCM_RTTreatmentIntentType DcmTagKey(0x3010, 0x0059) +#define DCM_RTPhysicianIntentNarrative DcmTagKey(0x3010, 0x005a) +#define DCM_RTProtocolCodeSequence DcmTagKey(0x3010, 0x005b) +#define DCM_ReasonForSuperseding DcmTagKey(0x3010, 0x005c) +#define DCM_RTDiagnosisCodeSequence DcmTagKey(0x3010, 0x005d) +#define DCM_ReferencedRTPhysicianIntentIndex DcmTagKey(0x3010, 0x005e) +#define DCM_RTPhysicianIntentInputInstanceSequence DcmTagKey(0x3010, 0x005f) +#define DCM_RTAnatomicPrescriptionSequence DcmTagKey(0x3010, 0x0060) +#define DCM_PriorTreatmentDoseDescription DcmTagKey(0x3010, 0x0061) +#define DCM_PriorTreatmentReferenceSequence DcmTagKey(0x3010, 0x0062) +#define DCM_DosimetricObjectiveEvaluationScope DcmTagKey(0x3010, 0x0063) +#define DCM_TherapeuticRoleCategoryCodeSequence DcmTagKey(0x3010, 0x0064) +#define DCM_TherapeuticRoleTypeCodeSequence DcmTagKey(0x3010, 0x0065) +#define DCM_ConceptualVolumeOptimizationPrecedence DcmTagKey(0x3010, 0x0066) +#define DCM_ConceptualVolumeCategoryCodeSequence DcmTagKey(0x3010, 0x0067) +#define DCM_ConceptualVolumeBlockingConstraint DcmTagKey(0x3010, 0x0068) +#define DCM_ConceptualVolumeTypeCodeSequence DcmTagKey(0x3010, 0x0069) +#define DCM_ConceptualVolumeTypeModifierCodeSequence DcmTagKey(0x3010, 0x006a) +#define DCM_RTPrescriptionSequence DcmTagKey(0x3010, 0x006b) +#define DCM_DosimetricObjectiveSequence DcmTagKey(0x3010, 0x006c) +#define DCM_DosimetricObjectiveTypeCodeSequence DcmTagKey(0x3010, 0x006d) +#define DCM_DosimetricObjectiveUID DcmTagKey(0x3010, 0x006e) +#define DCM_ReferencedDosimetricObjectiveUID DcmTagKey(0x3010, 0x006f) +#define DCM_DosimetricObjectiveParameterSequence DcmTagKey(0x3010, 0x0070) +#define DCM_ReferencedDosimetricObjectivesSequence DcmTagKey(0x3010, 0x0071) +#define DCM_AbsoluteDosimetricObjectiveFlag DcmTagKey(0x3010, 0x0073) +#define DCM_DosimetricObjectiveWeight DcmTagKey(0x3010, 0x0074) +#define DCM_DosimetricObjectivePurpose DcmTagKey(0x3010, 0x0075) +#define DCM_PlanningInputInformationSequence DcmTagKey(0x3010, 0x0076) +#define DCM_TreatmentSite DcmTagKey(0x3010, 0x0077) +#define DCM_TreatmentSiteCodeSequence DcmTagKey(0x3010, 0x0078) +#define DCM_FractionPatternSequence DcmTagKey(0x3010, 0x0079) +#define DCM_TreatmentTechniqueNotes DcmTagKey(0x3010, 0x007a) +#define DCM_PrescriptionNotes DcmTagKey(0x3010, 0x007b) +#define DCM_NumberOfIntervalFractions DcmTagKey(0x3010, 0x007c) +#define DCM_NumberOfFractions DcmTagKey(0x3010, 0x007d) +#define DCM_IntendedDeliveryDuration DcmTagKey(0x3010, 0x007e) +#define DCM_FractionationNotes DcmTagKey(0x3010, 0x007f) +#define DCM_RTTreatmentTechniqueCodeSequence DcmTagKey(0x3010, 0x0080) +#define DCM_PrescriptionNotesSequence DcmTagKey(0x3010, 0x0081) +#define DCM_FractionBasedRelationshipSequence DcmTagKey(0x3010, 0x0082) +#define DCM_FractionBasedRelationshipIntervalAnchor DcmTagKey(0x3010, 0x0083) +#define DCM_MinimumHoursBetweenFractions DcmTagKey(0x3010, 0x0084) +#define DCM_IntendedFractionStartTime DcmTagKey(0x3010, 0x0085) +#define DCM_IntendedStartDayOfWeek DcmTagKey(0x3010, 0x0086) +#define DCM_WeekdayFractionPatternSequence DcmTagKey(0x3010, 0x0087) +#define DCM_DeliveryTimeStructureCodeSequence DcmTagKey(0x3010, 0x0088) +#define DCM_RETIRED_Arbitrary DcmTagKey(0x4000, 0x0010) +#define DCM_RETIRED_TextComments DcmTagKey(0x4000, 0x4000) +#define DCM_RETIRED_ResultsID DcmTagKey(0x4008, 0x0040) +#define DCM_RETIRED_ResultsIDIssuer DcmTagKey(0x4008, 0x0042) +#define DCM_RETIRED_ReferencedInterpretationSequence DcmTagKey(0x4008, 0x0050) +#define DCM_RETIRED_ReportProductionStatusTrial DcmTagKey(0x4008, 0x00ff) +#define DCM_RETIRED_InterpretationRecordedDate DcmTagKey(0x4008, 0x0100) +#define DCM_RETIRED_InterpretationRecordedTime DcmTagKey(0x4008, 0x0101) +#define DCM_RETIRED_InterpretationRecorder DcmTagKey(0x4008, 0x0102) +#define DCM_RETIRED_ReferenceToRecordedSound DcmTagKey(0x4008, 0x0103) +#define DCM_RETIRED_InterpretationTranscriptionDate DcmTagKey(0x4008, 0x0108) +#define DCM_RETIRED_InterpretationTranscriptionTime DcmTagKey(0x4008, 0x0109) +#define DCM_RETIRED_InterpretationTranscriber DcmTagKey(0x4008, 0x010a) +#define DCM_RETIRED_InterpretationText DcmTagKey(0x4008, 0x010b) +#define DCM_RETIRED_InterpretationAuthor DcmTagKey(0x4008, 0x010c) +#define DCM_RETIRED_InterpretationApproverSequence DcmTagKey(0x4008, 0x0111) +#define DCM_RETIRED_InterpretationApprovalDate DcmTagKey(0x4008, 0x0112) +#define DCM_RETIRED_InterpretationApprovalTime DcmTagKey(0x4008, 0x0113) +#define DCM_RETIRED_PhysicianApprovingInterpretation DcmTagKey(0x4008, 0x0114) +#define DCM_RETIRED_InterpretationDiagnosisDescription DcmTagKey(0x4008, 0x0115) +#define DCM_RETIRED_InterpretationDiagnosisCodeSequence DcmTagKey(0x4008, 0x0117) +#define DCM_RETIRED_ResultsDistributionListSequence DcmTagKey(0x4008, 0x0118) +#define DCM_RETIRED_DistributionName DcmTagKey(0x4008, 0x0119) +#define DCM_RETIRED_DistributionAddress DcmTagKey(0x4008, 0x011a) +#define DCM_RETIRED_InterpretationID DcmTagKey(0x4008, 0x0200) +#define DCM_RETIRED_InterpretationIDIssuer DcmTagKey(0x4008, 0x0202) +#define DCM_RETIRED_InterpretationTypeID DcmTagKey(0x4008, 0x0210) +#define DCM_RETIRED_InterpretationStatusID DcmTagKey(0x4008, 0x0212) +#define DCM_RETIRED_Impressions DcmTagKey(0x4008, 0x0300) +#define DCM_RETIRED_ResultsComments DcmTagKey(0x4008, 0x4000) +#define DCM_LowEnergyDetectors DcmTagKey(0x4010, 0x0001) +#define DCM_HighEnergyDetectors DcmTagKey(0x4010, 0x0002) +#define DCM_DetectorGeometrySequence DcmTagKey(0x4010, 0x0004) +#define DCM_ThreatROIVoxelSequence DcmTagKey(0x4010, 0x1001) +#define DCM_ThreatROIBase DcmTagKey(0x4010, 0x1004) +#define DCM_ThreatROIExtents DcmTagKey(0x4010, 0x1005) +#define DCM_ThreatROIBitmap DcmTagKey(0x4010, 0x1006) +#define DCM_RouteSegmentID DcmTagKey(0x4010, 0x1007) +#define DCM_GantryType DcmTagKey(0x4010, 0x1008) +#define DCM_OOIOwnerType DcmTagKey(0x4010, 0x1009) +#define DCM_RouteSegmentSequence DcmTagKey(0x4010, 0x100a) +#define DCM_PotentialThreatObjectID DcmTagKey(0x4010, 0x1010) +#define DCM_ThreatSequence DcmTagKey(0x4010, 0x1011) +#define DCM_ThreatCategory DcmTagKey(0x4010, 0x1012) +#define DCM_ThreatCategoryDescription DcmTagKey(0x4010, 0x1013) +#define DCM_ATDAbilityAssessment DcmTagKey(0x4010, 0x1014) +#define DCM_ATDAssessmentFlag DcmTagKey(0x4010, 0x1015) +#define DCM_ATDAssessmentProbability DcmTagKey(0x4010, 0x1016) +#define DCM_Mass DcmTagKey(0x4010, 0x1017) +#define DCM_Density DcmTagKey(0x4010, 0x1018) +#define DCM_ZEffective DcmTagKey(0x4010, 0x1019) +#define DCM_BoardingPassID DcmTagKey(0x4010, 0x101a) +#define DCM_CenterOfMass DcmTagKey(0x4010, 0x101b) +#define DCM_CenterOfPTO DcmTagKey(0x4010, 0x101c) +#define DCM_BoundingPolygon DcmTagKey(0x4010, 0x101d) +#define DCM_RouteSegmentStartLocationID DcmTagKey(0x4010, 0x101e) +#define DCM_RouteSegmentEndLocationID DcmTagKey(0x4010, 0x101f) +#define DCM_RouteSegmentLocationIDType DcmTagKey(0x4010, 0x1020) +#define DCM_AbortReason DcmTagKey(0x4010, 0x1021) +#define DCM_VolumeOfPTO DcmTagKey(0x4010, 0x1023) +#define DCM_AbortFlag DcmTagKey(0x4010, 0x1024) +#define DCM_RouteSegmentStartTime DcmTagKey(0x4010, 0x1025) +#define DCM_RouteSegmentEndTime DcmTagKey(0x4010, 0x1026) +#define DCM_TDRType DcmTagKey(0x4010, 0x1027) +#define DCM_InternationalRouteSegment DcmTagKey(0x4010, 0x1028) +#define DCM_ThreatDetectionAlgorithmandVersion DcmTagKey(0x4010, 0x1029) +#define DCM_AssignedLocation DcmTagKey(0x4010, 0x102a) +#define DCM_AlarmDecisionTime DcmTagKey(0x4010, 0x102b) +#define DCM_AlarmDecision DcmTagKey(0x4010, 0x1031) +#define DCM_NumberOfTotalObjects DcmTagKey(0x4010, 0x1033) +#define DCM_NumberOfAlarmObjects DcmTagKey(0x4010, 0x1034) +#define DCM_PTORepresentationSequence DcmTagKey(0x4010, 0x1037) +#define DCM_ATDAssessmentSequence DcmTagKey(0x4010, 0x1038) +#define DCM_TIPType DcmTagKey(0x4010, 0x1039) +#define DCM_DICOSVersion DcmTagKey(0x4010, 0x103a) +#define DCM_OOIOwnerCreationTime DcmTagKey(0x4010, 0x1041) +#define DCM_OOIType DcmTagKey(0x4010, 0x1042) +#define DCM_OOISize DcmTagKey(0x4010, 0x1043) +#define DCM_AcquisitionStatus DcmTagKey(0x4010, 0x1044) +#define DCM_BasisMaterialsCodeSequence DcmTagKey(0x4010, 0x1045) +#define DCM_PhantomType DcmTagKey(0x4010, 0x1046) +#define DCM_OOIOwnerSequence DcmTagKey(0x4010, 0x1047) +#define DCM_ScanType DcmTagKey(0x4010, 0x1048) +#define DCM_ItineraryID DcmTagKey(0x4010, 0x1051) +#define DCM_ItineraryIDType DcmTagKey(0x4010, 0x1052) +#define DCM_ItineraryIDAssigningAuthority DcmTagKey(0x4010, 0x1053) +#define DCM_RouteID DcmTagKey(0x4010, 0x1054) +#define DCM_RouteIDAssigningAuthority DcmTagKey(0x4010, 0x1055) +#define DCM_InboundArrivalType DcmTagKey(0x4010, 0x1056) +#define DCM_CarrierID DcmTagKey(0x4010, 0x1058) +#define DCM_CarrierIDAssigningAuthority DcmTagKey(0x4010, 0x1059) +#define DCM_SourceOrientation DcmTagKey(0x4010, 0x1060) +#define DCM_SourcePosition DcmTagKey(0x4010, 0x1061) +#define DCM_BeltHeight DcmTagKey(0x4010, 0x1062) +#define DCM_AlgorithmRoutingCodeSequence DcmTagKey(0x4010, 0x1064) +#define DCM_TransportClassification DcmTagKey(0x4010, 0x1067) +#define DCM_OOITypeDescriptor DcmTagKey(0x4010, 0x1068) +#define DCM_TotalProcessingTime DcmTagKey(0x4010, 0x1069) +#define DCM_DetectorCalibrationData DcmTagKey(0x4010, 0x106c) +#define DCM_AdditionalScreeningPerformed DcmTagKey(0x4010, 0x106d) +#define DCM_AdditionalInspectionSelectionCriteria DcmTagKey(0x4010, 0x106e) +#define DCM_AdditionalInspectionMethodSequence DcmTagKey(0x4010, 0x106f) +#define DCM_AITDeviceType DcmTagKey(0x4010, 0x1070) +#define DCM_QRMeasurementsSequence DcmTagKey(0x4010, 0x1071) +#define DCM_TargetMaterialSequence DcmTagKey(0x4010, 0x1072) +#define DCM_SNRThreshold DcmTagKey(0x4010, 0x1073) +#define DCM_ImageScaleRepresentation DcmTagKey(0x4010, 0x1075) +#define DCM_ReferencedPTOSequence DcmTagKey(0x4010, 0x1076) +#define DCM_ReferencedTDRInstanceSequence DcmTagKey(0x4010, 0x1077) +#define DCM_PTOLocationDescription DcmTagKey(0x4010, 0x1078) +#define DCM_AnomalyLocatorIndicatorSequence DcmTagKey(0x4010, 0x1079) +#define DCM_AnomalyLocatorIndicator DcmTagKey(0x4010, 0x107a) +#define DCM_PTORegionSequence DcmTagKey(0x4010, 0x107b) +#define DCM_InspectionSelectionCriteria DcmTagKey(0x4010, 0x107c) +#define DCM_SecondaryInspectionMethodSequence DcmTagKey(0x4010, 0x107d) +#define DCM_PRCSToRCSOrientation DcmTagKey(0x4010, 0x107e) +#define DCM_MACParametersSequence DcmTagKey(0x4ffe, 0x0001) +#define DCM_SharedFunctionalGroupsSequence DcmTagKey(0x5200, 0x9229) +#define DCM_PerFrameFunctionalGroupsSequence DcmTagKey(0x5200, 0x9230) +#define DCM_WaveformSequence DcmTagKey(0x5400, 0x0100) +#define DCM_ChannelMinimumValue DcmTagKey(0x5400, 0x0110) +#define DCM_ChannelMaximumValue DcmTagKey(0x5400, 0x0112) +#define DCM_WaveformBitsAllocated DcmTagKey(0x5400, 0x1004) +#define DCM_WaveformSampleInterpretation DcmTagKey(0x5400, 0x1006) +#define DCM_WaveformPaddingValue DcmTagKey(0x5400, 0x100a) +#define DCM_WaveformData DcmTagKey(0x5400, 0x1010) +#define DCM_FirstOrderPhaseCorrectionAngle DcmTagKey(0x5600, 0x0010) +#define DCM_SpectroscopyData DcmTagKey(0x5600, 0x0020) +#define DCM_ExtendedOffsetTable DcmTagKey(0x7fe0, 0x0001) +#define DCM_ExtendedOffsetTableLengths DcmTagKey(0x7fe0, 0x0002) +#define DCM_FloatPixelData DcmTagKey(0x7fe0, 0x0008) +#define DCM_DoubleFloatPixelData DcmTagKey(0x7fe0, 0x0009) +#define DCM_PixelData DcmTagKey(0x7fe0, 0x0010) +#define DCM_RETIRED_CoefficientsSDVN DcmTagKey(0x7fe0, 0x0020) +#define DCM_RETIRED_CoefficientsSDHN DcmTagKey(0x7fe0, 0x0030) +#define DCM_RETIRED_CoefficientsSDDN DcmTagKey(0x7fe0, 0x0040) +#define DCM_DigitalSignaturesSequence DcmTagKey(0xfffa, 0xfffa) +#define DCM_DataSetTrailingPadding DcmTagKey(0xfffc, 0xfffc) +#define DCM_Item DcmTagKey(0xfffe, 0xe000) +#define DCM_ItemDelimitationItem DcmTagKey(0xfffe, 0xe00d) +#define DCM_SequenceDelimitationItem DcmTagKey(0xfffe, 0xe0dd) + +/* +** Tags where the group/element can vary (repeating tags). +** Number of entries: 77 +*/ +#define DCM_OverlayRows DcmTagKey(0x6000, 0x0010) /* (0x6000-0x60ff,0x0010) */ +#define DCM_OverlayColumns DcmTagKey(0x6000, 0x0011) /* (0x6000-0x60ff,0x0011) */ +#define DCM_NumberOfFramesInOverlay DcmTagKey(0x6000, 0x0015) /* (0x6000-0x60ff,0x0015) */ +#define DCM_OverlayDescription DcmTagKey(0x6000, 0x0022) /* (0x6000-0x60ff,0x0022) */ +#define DCM_OverlayType DcmTagKey(0x6000, 0x0040) /* (0x6000-0x60ff,0x0040) */ +#define DCM_OverlaySubtype DcmTagKey(0x6000, 0x0045) /* (0x6000-0x60ff,0x0045) */ +#define DCM_OverlayOrigin DcmTagKey(0x6000, 0x0050) /* (0x6000-0x60ff,0x0050) */ +#define DCM_ImageFrameOrigin DcmTagKey(0x6000, 0x0051) /* (0x6000-0x60ff,0x0051) */ +#define DCM_OverlayBitsAllocated DcmTagKey(0x6000, 0x0100) /* (0x6000-0x60ff,0x0100) */ +#define DCM_OverlayBitPosition DcmTagKey(0x6000, 0x0102) /* (0x6000-0x60ff,0x0102) */ +#define DCM_OverlayActivationLayer DcmTagKey(0x6000, 0x1001) /* (0x6000-0x60ff,0x1001) */ +#define DCM_ROIArea DcmTagKey(0x6000, 0x1301) /* (0x6000-0x60ff,0x1301) */ +#define DCM_ROIMean DcmTagKey(0x6000, 0x1302) /* (0x6000-0x60ff,0x1302) */ +#define DCM_ROIStandardDeviation DcmTagKey(0x6000, 0x1303) /* (0x6000-0x60ff,0x1303) */ +#define DCM_OverlayLabel DcmTagKey(0x6000, 0x1500) /* (0x6000-0x60ff,0x1500) */ +#define DCM_OverlayData DcmTagKey(0x6000, 0x3000) /* (0x6000-0x60ff,0x3000) */ +#define DCM_RETIRED_SourceImageIDs DcmTagKey(0x0020, 0x3100) /* (0x0020,0x3100-0x31ff) */ +#define DCM_RETIRED_CurveDimensions DcmTagKey(0x5000, 0x0005) /* (0x5000-0x50ff,0x0005) */ +#define DCM_RETIRED_NumberOfPoints DcmTagKey(0x5000, 0x0010) /* (0x5000-0x50ff,0x0010) */ +#define DCM_RETIRED_TypeOfData DcmTagKey(0x5000, 0x0020) /* (0x5000-0x50ff,0x0020) */ +#define DCM_RETIRED_CurveDescription DcmTagKey(0x5000, 0x0022) /* (0x5000-0x50ff,0x0022) */ +#define DCM_RETIRED_AxisUnits DcmTagKey(0x5000, 0x0030) /* (0x5000-0x50ff,0x0030) */ +#define DCM_RETIRED_AxisLabels DcmTagKey(0x5000, 0x0040) /* (0x5000-0x50ff,0x0040) */ +#define DCM_RETIRED_DataValueRepresentation DcmTagKey(0x5000, 0x0103) /* (0x5000-0x50ff,0x0103) */ +#define DCM_RETIRED_MinimumCoordinateValue DcmTagKey(0x5000, 0x0104) /* (0x5000-0x50ff,0x0104) */ +#define DCM_RETIRED_MaximumCoordinateValue DcmTagKey(0x5000, 0x0105) /* (0x5000-0x50ff,0x0105) */ +#define DCM_RETIRED_CurveRange DcmTagKey(0x5000, 0x0106) /* (0x5000-0x50ff,0x0106) */ +#define DCM_RETIRED_CurveDataDescriptor DcmTagKey(0x5000, 0x0110) /* (0x5000-0x50ff,0x0110) */ +#define DCM_RETIRED_CoordinateStartValue DcmTagKey(0x5000, 0x0112) /* (0x5000-0x50ff,0x0112) */ +#define DCM_RETIRED_CoordinateStepValue DcmTagKey(0x5000, 0x0114) /* (0x5000-0x50ff,0x0114) */ +#define DCM_RETIRED_CurveActivationLayer DcmTagKey(0x5000, 0x1001) /* (0x5000-0x50ff,0x1001) */ +#define DCM_RETIRED_AudioType DcmTagKey(0x5000, 0x2000) /* (0x5000-0x50ff,0x2000) */ +#define DCM_RETIRED_AudioSampleFormat DcmTagKey(0x5000, 0x2002) /* (0x5000-0x50ff,0x2002) */ +#define DCM_RETIRED_NumberOfChannels DcmTagKey(0x5000, 0x2004) /* (0x5000-0x50ff,0x2004) */ +#define DCM_RETIRED_NumberOfSamples DcmTagKey(0x5000, 0x2006) /* (0x5000-0x50ff,0x2006) */ +#define DCM_RETIRED_SampleRate DcmTagKey(0x5000, 0x2008) /* (0x5000-0x50ff,0x2008) */ +#define DCM_RETIRED_TotalTime DcmTagKey(0x5000, 0x200a) /* (0x5000-0x50ff,0x200a) */ +#define DCM_RETIRED_AudioSampleData DcmTagKey(0x5000, 0x200c) /* (0x5000-0x50ff,0x200c) */ +#define DCM_RETIRED_AudioComments DcmTagKey(0x5000, 0x200e) /* (0x5000-0x50ff,0x200e) */ +#define DCM_RETIRED_CurveLabel DcmTagKey(0x5000, 0x2500) /* (0x5000-0x50ff,0x2500) */ +#define DCM_RETIRED_CurveReferencedOverlaySequence DcmTagKey(0x5000, 0x2600) /* (0x5000-0x50ff,0x2600) */ +#define DCM_RETIRED_CurveReferencedOverlayGroup DcmTagKey(0x5000, 0x2610) /* (0x5000-0x50ff,0x2610) */ +#define DCM_RETIRED_CurveData DcmTagKey(0x5000, 0x3000) /* (0x5000-0x50ff,0x3000) */ +#define DCM_RETIRED_OverlayPlanes DcmTagKey(0x6000, 0x0012) /* (0x6000-0x60ff,0x0012) */ +#define DCM_RETIRED_OverlayPlaneOrigin DcmTagKey(0x6000, 0x0052) /* (0x6000-0x60ff,0x0052) */ +#define DCM_RETIRED_OverlayCompressionCode DcmTagKey(0x6000, 0x0060) /* (0x6000-0x60ff,0x0060) */ +#define DCM_RETIRED_OverlayCompressionOriginator DcmTagKey(0x6000, 0x0061) /* (0x6000-0x60ff,0x0061) */ +#define DCM_RETIRED_OverlayCompressionLabel DcmTagKey(0x6000, 0x0062) /* (0x6000-0x60ff,0x0062) */ +#define DCM_RETIRED_OverlayCompressionDescription DcmTagKey(0x6000, 0x0063) /* (0x6000-0x60ff,0x0063) */ +#define DCM_RETIRED_OverlayCompressionStepPointers DcmTagKey(0x6000, 0x0066) /* (0x6000-0x60ff,0x0066) */ +#define DCM_RETIRED_OverlayRepeatInterval DcmTagKey(0x6000, 0x0068) /* (0x6000-0x60ff,0x0068) */ +#define DCM_RETIRED_OverlayBitsGrouped DcmTagKey(0x6000, 0x0069) /* (0x6000-0x60ff,0x0069) */ +#define DCM_RETIRED_OverlayFormat DcmTagKey(0x6000, 0x0110) /* (0x6000-0x60ff,0x0110) */ +#define DCM_RETIRED_OverlayLocation DcmTagKey(0x6000, 0x0200) /* (0x6000-0x60ff,0x0200) */ +#define DCM_RETIRED_OverlayCodeLabel DcmTagKey(0x6000, 0x0800) /* (0x6000-0x60ff,0x0800) */ +#define DCM_RETIRED_OverlayNumberOfTables DcmTagKey(0x6000, 0x0802) /* (0x6000-0x60ff,0x0802) */ +#define DCM_RETIRED_OverlayCodeTableLocation DcmTagKey(0x6000, 0x0803) /* (0x6000-0x60ff,0x0803) */ +#define DCM_RETIRED_OverlayBitsForCodeWord DcmTagKey(0x6000, 0x0804) /* (0x6000-0x60ff,0x0804) */ +#define DCM_RETIRED_OverlayDescriptorGray DcmTagKey(0x6000, 0x1100) /* (0x6000-0x60ff,0x1100) */ +#define DCM_RETIRED_OverlayDescriptorRed DcmTagKey(0x6000, 0x1101) /* (0x6000-0x60ff,0x1101) */ +#define DCM_RETIRED_OverlayDescriptorGreen DcmTagKey(0x6000, 0x1102) /* (0x6000-0x60ff,0x1102) */ +#define DCM_RETIRED_OverlayDescriptorBlue DcmTagKey(0x6000, 0x1103) /* (0x6000-0x60ff,0x1103) */ +#define DCM_RETIRED_OverlaysGray DcmTagKey(0x6000, 0x1200) /* (0x6000-0x60ff,0x1200) */ +#define DCM_RETIRED_OverlaysRed DcmTagKey(0x6000, 0x1201) /* (0x6000-0x60ff,0x1201) */ +#define DCM_RETIRED_OverlaysGreen DcmTagKey(0x6000, 0x1202) /* (0x6000-0x60ff,0x1202) */ +#define DCM_RETIRED_OverlaysBlue DcmTagKey(0x6000, 0x1203) /* (0x6000-0x60ff,0x1203) */ +#define DCM_RETIRED_OverlayComments DcmTagKey(0x6000, 0x4000) /* (0x6000-0x60ff,0x4000) */ +#define DCM_RETIRED_VariablePixelData DcmTagKey(0x7f00, 0x0010) /* (0x7f00-0x7fff,0x0010) */ +#define DCM_RETIRED_VariableNextDataGroup DcmTagKey(0x7f00, 0x0011) /* (0x7f00-0x7fff,0x0011) */ +#define DCM_RETIRED_VariableCoefficientsSDVN DcmTagKey(0x7f00, 0x0020) /* (0x7f00-0x7fff,0x0020) */ +#define DCM_RETIRED_VariableCoefficientsSDHN DcmTagKey(0x7f00, 0x0030) /* (0x7f00-0x7fff,0x0030) */ +#define DCM_RETIRED_VariableCoefficientsSDDN DcmTagKey(0x7f00, 0x0040) /* (0x7f00-0x7fff,0x0040) */ +#define DCM_PrivateGroupLength DcmTagKey(0x0009, 0x0000) /* (0x0009-o-0xffff,0x0000) */ +#define DCM_PrivateCreator DcmTagKey(0x0009, 0x0010) /* (0x0009-o-0xffff,0x0010-u-0x00ff) */ +#define DCM_IllegalGroupLength DcmTagKey(0x0001, 0x0000) /* (0x0001-o-0x0007,0x0000) */ +#define DCM_IllegalPrivateCreator DcmTagKey(0x0001, 0x0010) /* (0x0001-o-0x0007,0x0010-u-0x00ff) */ +#define DCM_GenericGroupLength DcmTagKey(0x0000, 0x0000) /* (0x0000-u-0xffff,0x0000) */ + +#endif /* !DCDEFTAG_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dcdicdir.h b/dcmdata/include/dcmtk/dcmdata/dcdicdir.h new file mode 100644 index 00000000..6e05e956 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdicdir.h @@ -0,0 +1,221 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmDicomDir + * + */ + +#ifndef DCDICDIR_H +#define DCDICDIR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/dcmdata/dcdirrec.h" +#include "dcmtk/dcmdata/dcvrulup.h" + + +#define DEFAULT_DICOMDIR_NAME "DICOMDIR" +#define DICOMDIR_BACKUP_SUFFIX ".$$$" +#define DICOMDIR_TEMP_SUFFIX ".tmp" +#define DICOMDIR_DEFAULT_TRANSFERSYNTAX EXS_LittleEndianExplicit + +/** helper structure for item offsets + */ +typedef struct +{ + /// DICOM item containing a directory record + DcmItem *item; + /// offset in file for this item + Uint32 fileOffset; +} ItemOffset; + + +/** this class implements support for DICOMDIR files, which are special DICOM files + * containing a list of directory records, with a logical tree structure being + * implemented through references between records as byte offsets in file. + */ +class DCMTK_DCMDATA_EXPORT DcmDicomDir +{ +public: + /// default constructor + DcmDicomDir(); + + /** constructor + * @param fileName filename to read a DICOMDIR from. If empty, an attempt is + * made to read file DEFAULT_DICOMDIR_NAME ("DICOMDIR"). + * @param fileSetID file set ID of this file set, used only for new DICOMDIRs + */ + DcmDicomDir( const OFFilename &fileName, + const char *fileSetID = NULL ); // only used for new DICOMDIR + + /// destructor. If DICOMDIR was modified, writes new file. + virtual ~DcmDicomDir(); + + /** print all elements of the item to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /// returns current status flag + virtual OFCondition error(); + + /** returns reference to DICOM file from which DICOMDIR was read. + * Note, this file may be obsolete if the DICOMDIR was modified + * @return reference to DICOM file + */ + virtual DcmFileFormat& getDirFileFormat(); + + /** returns file name from which DICOMDIR was read. + * @return filename of DICOMDIR + */ + virtual const OFFilename &getDirFileName(); + + /// returns root directory record + virtual DcmDirectoryRecord& getRootRecord(); + + /// returns container in which all MRDR (multi-reference directory records) are stored + virtual DcmSequenceOfItems& getMRDRSequence(); + + /** look up directory record for the given referenced file ID (not OS file path) + * @return directory record if found, NULL otherwise + */ + virtual DcmDirectoryRecord* matchFilename( const char *filename ); + + /** look up MRDR for the given referenced file ID (not OS file path). + * If there is none yet, create one. + * @return MRDR for given referenced file ID + */ + virtual DcmDirectoryRecord* matchOrCreateMRDR( const char *filename ); + + /** writes DICOMDIR to file + * @param oxfer must be DICOMDIR_DEFAULT_TRANSFERSYNTAX + * @param enctype encoding type for sequences + * @param glenc encoding type for group lengths + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition write( + const E_TransferSyntax oxfer = DICOMDIR_DEFAULT_TRANSFERSYNTAX, + const E_EncodingType enctype = EET_UndefinedLength, + const E_GrpLenEncoding glenc = EGL_withoutGL ); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify( OFBool autocorrect = OFFalse ); + + protected: + + // Manipulation of member variables + OFCondition createNewElements(const char* fileSetID); // in + DcmDataset& getDataset(void); + + // side-effect free methods for manipulation and conversion + DcmSequenceOfItems& getDirRecSeq( DcmDataset &dset ); // inout + DcmUnsignedLongOffset* lookForOffsetElem( DcmObject *obj, // in + const DcmTagKey &offsetTag ); // in + DcmDirectoryRecord* recurseMatchFile( DcmDirectoryRecord* startRec, // in + const char *filename ); // in + DcmDirectoryRecord* searchMatchFile( DcmSequenceOfItems& recSeq, // in + const char *filename ); // in + OFCondition resolveGivenOffsets( DcmObject *startPoint, // inout + const OFMap &itOffsets, // in + const DcmTagKey &offsetTag ); // in + OFCondition resolveAllOffsets( DcmDataset &dset ); // inout + OFCondition linkMRDRtoRecord( DcmDirectoryRecord *dRec ); // inout + OFCondition moveRecordToTree( DcmDirectoryRecord *startRec, // in + DcmSequenceOfItems &fromDirSQ, // inout + DcmDirectoryRecord *toRecord ); // inout + OFCondition moveMRDRbetweenSQs( DcmSequenceOfItems &fromSQ, // in + DcmSequenceOfItems &toDirSQ ); // inout + Uint32 lengthUntilSQ( DcmDataset &dset, // in + E_TransferSyntax oxfer, // in + E_EncodingType enctype ); // in + Uint32 lengthOfRecord( DcmItem *item, // in + E_TransferSyntax oxfer, // in + E_EncodingType enctype ); // in + OFCondition convertGivenPointer( DcmObject *startPoint, // inout + const DcmTagKey &offsetTag ); // in + OFCondition convertAllPointer( DcmDataset &dset, // inout + Uint32 beginOfFileSet, // in + E_TransferSyntax oxfer, // in + E_EncodingType enctype ); // in + OFCondition copyRecordPtrToSQ( DcmDirectoryRecord *record, // in + DcmSequenceOfItems &toDirSQ, // inout + DcmDirectoryRecord **firstRec, // out + DcmDirectoryRecord **lastRec ); // out + OFCondition insertMediaSOPUID( DcmMetaInfo &metaInfo ); // inout + OFCondition countMRDRRefs( DcmDirectoryRecord *startRec, // in + ItemOffset *refCounter, // inout + const unsigned long numCounters ); // in + OFCondition checkMRDRRefCounter( DcmDirectoryRecord *startRec, // in + ItemOffset *refCounter, // inout + const unsigned long numCounters ); // in + + // complete re-organization of the managed directory records (side effect) + OFCondition convertLinearToTree(); + + OFCondition convertTreeToLinear( Uint32 beginOfFileSet, // in + E_TransferSyntax oxfer, // in + E_EncodingType enctype, // in + E_GrpLenEncoding glenc, // in + DcmSequenceOfItems &unresRecs);// inout + + private: + + /// private undefined copy assignment operator + DcmDicomDir &operator=(const DcmDicomDir &); + + /// private undefined copy constructor + DcmDicomDir( const DcmDicomDir &newDir ); + + /// condition flag + OFCondition errorFlag; + + /// file name the DICOMDIR was read from, or DEFAULT_DICOMDIR_NAME + OFFilename dicomDirFileName; + + /** flag indicating whether or not this DICOMDIR has been modified after being read from file. + * If true, the destructor of this class will write the modified DICOMDIR back to file + */ + OFBool modified; + + /// flag indicating whether the DICOM file in DirFile needs to be re-created upon writing + OFBool mustCreateNewDir; + + /** DICOM file into which a DICOMDIR is read first before the logical tree + * structure is created. + */ + DcmFileFormat * DirFile; + + /// root directory record of this DICOMDIR + DcmDirectoryRecord * RootRec; + + /// container in which all MRDR (multi-reference directory records) for this DICOMDIR are kept + DcmSequenceOfItems * MRDRSeq; +}; + +#endif // DCDICDIR_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcdicent.h b/dcmdata/include/dcmtk/dcmdata/dcdicent.h new file mode 100644 index 00000000..e25815c8 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdicent.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Interface for a dictionary entry in the loadable DICOM data dictionary + * + */ + +#ifndef DCDICENT_H +#define DCDICENT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmdata/dcvr.h" + +#define INCLUDE_CSTRING /* for strcmp() */ +#include "dcmtk/ofstd/ofstdinc.h" + +/// constant describing an unlimited VM +#define DcmVariableVM -1 + +#define DCM_INRANGE(x,a,b) (((x) >= (a)) && ((x) <= (b))) +#define DCM_IS_ODD(x) (((x) % 2) == 1) +#define DCM_IS_EVEN(x) (((x) % 2) == 0) + + +/** attribute tag group/element range restrictions + */ +enum DcmDictRangeRestriction +{ + /// integer range + DcmDictRange_Unspecified, + + /// odd range + DcmDictRange_Odd, + + /// even range + DcmDictRange_Even +}; + + +/** each object of this class manages one entry of the + * global DICOM data dictionary. + */ +class DCMTK_DCMDATA_EXPORT DcmDictEntry: public DcmTagKey +{ +public: + + /** constructor + * @param g attribute tag group + * @param e attribute tag element + * @param vr value representation + * @param nam attribute name + * @param vmMin lower limit for value multiplicity + * @param vmMax upper limit for value multiplicity, DcmVariableVM for unlimited + * @param vers standard version name, may be NULL + * @param doCopyStrings true if strings should be copied, false if only referenced + * @param pcreator private creator name, may be NULL (for standard tags) + */ + DcmDictEntry(Uint16 g, Uint16 e, DcmVR vr, + const char* nam, int vmMin, int vmMax, + const char* vers, OFBool doCopyStrings, + const char* pcreator); + + /** constructor for repeating tags + * @param g attribute tag group lower limit + * @param e attribute tag element lower limit + * @param ug attribute tag group upper limit + * @param ue attribute tag element upper limit + * @param vr value representation + * @param nam attribute name + * @param vmMin lower limit for value multiplicity + * @param vmMax upper limit for value multiplicity, DcmVariableVM for unlimited + * @param vers standard version name, may be NULL + * @param doCopyStrings true if strings should be copied, false if only referenced + * @param pcreator private creator name, may be NULL (for standard tags) + */ + DcmDictEntry(Uint16 g, Uint16 e, Uint16 ug, Uint16 ue, DcmVR vr, + const char* nam, int vmMin, int vmMax, + const char* vers, OFBool doCopyStrings, + const char* pcreator); + + /// copy constructor + DcmDictEntry(const DcmDictEntry& e); + + /// destructor + ~DcmDictEntry(); + + /* access methods */ + + /// returns VR object by value + DcmVR getVR() const + { + return valueRepresentation; + } + + /// returns VR code + DcmEVR getEVR() const + { + return valueRepresentation.getEVR(); + } + + /// returns standard version string, may be NULL + const char* getStandardVersion() const + { + return standardVersion; + } + + /// returns tag name + const char* getTagName() const + { + return tagName; + } + + /// returns private creator code, may be NULL + const char* getPrivateCreator() const + { + return privateCreator; + } + + /** checks if the private creator code equals the given string + * @param c string to compare with, may be NULL + * @return true if equal, false otherwise + */ + int privateCreatorMatch(const char *c) const + { + return + ( + ((privateCreator == NULL) && (c == NULL)) || + (privateCreator && c && (0 == strcmp(privateCreator, c))) + ); + } + + /** checks if the private creator code of this object matches + * the one of the given object. + * @param arg dictionary entry to compare with + * @return true if private creators are equal, false otherwise + */ + int privateCreatorMatch(const DcmDictEntry& arg) const + { + return privateCreatorMatch(arg.privateCreator); + } + + /// returns lower limit for VM (value multiplicity) + int getVMMin() const + { + return valueMultiplicityMin; + } + + /// returns upper limit for VM (value multiplicity), DcmVariableVM for unlimited + int getVMMax() const + { + return valueMultiplicityMax; + } + + /// returns true if element has a single valid VM value + OFBool isFixedSingleVM() const + { + return ((valueMultiplicityMin != DcmVariableVM) && + (valueMultiplicityMin == valueMultiplicityMax)); + } + + /// returns true if element has a fixed VM range + OFBool isFixedRangeVM() const + { + return ((valueMultiplicityMin != DcmVariableVM) && + (valueMultiplicityMax != DcmVariableVM)); + } + + /// returns true if element has a variable VM range (no upper limit) + OFBool isVariableRangeVM() const + { + return ((valueMultiplicityMin != DcmVariableVM) && + (valueMultiplicityMax == DcmVariableVM)); + } + + /** converts entry into repeating tag entry by defining an upper limit + * for group and element, taken from the given tag key. + * @param key tag key containing upper limit for group and element + */ + void setUpper(const DcmTagKey& key) + { + upperKey = key; + } + + /** converts entry into repeating tag entry by defining an upper limit + * for tag group + * @param ug upper limit for tag group + */ + void setUpperGroup(Uint16 ug) + { + upperKey.setGroup(ug); + } + + /** converts entry into repeating tag entry by defining an upper limit + * for tag element + * @param ue upper limit for tag element + */ + void setUpperElement(Uint16 ue) + { + upperKey.setElement(ue); + } + + /// returns upper limit for tag group + Uint16 getUpperGroup() const + { + return upperKey.getGroup(); + } + + /// returns upper limit for tag element + Uint16 getUpperElement() const + { + return upperKey.getElement(); + } + + /// returns attribute tag as DcmTagKey object by value + DcmTagKey getKey() const + { + return * OFstatic_cast(const DcmTagKey *, this); + } + + /// returns upper limits for attribute tag as DcmTagKey object by value + DcmTagKey getUpperKey() const + { + return upperKey; + } + + /// returns true if entry is has a repeating group + int isRepeatingGroup() const + { + return (getGroup() != getUpperGroup()); + } + + /// returns true if entry is has a repeating element + int isRepeatingElement() const + { + return (getElement() != getUpperElement()); + } + + /// returns true if entry is repeating (group or element) + int isRepeating() const + { + return (isRepeatingGroup() || isRepeatingElement()); + } + + /// returns group range restriction + DcmDictRangeRestriction getGroupRangeRestriction() const + { + return groupRangeRestriction; + } + + /// sets group range restriction + void setGroupRangeRestriction(DcmDictRangeRestriction rr) + { + groupRangeRestriction = rr; + } + + /// returns element range restriction + DcmDictRangeRestriction getElementRangeRestriction() const + { + return elementRangeRestriction; + } + + /// sets element range restriction + void setElementRangeRestriction(DcmDictRangeRestriction rr) + { + elementRangeRestriction = rr; + } + + /* containment */ + + /** checks if the given tag key and private creator code are covered + * by this object. + * @param key tag key + * @param privCreator private creator, may be NULL + * @return true if this entry contains the given tag for the given private creator + */ + int contains(const DcmTagKey& key, const char *privCreator) const /* this contains key */ + { + if ((getGroupRangeRestriction() == DcmDictRange_Even) && + DCM_IS_ODD(key.getGroup())) + return OFFalse; + else if ((getGroupRangeRestriction() == DcmDictRange_Odd) && + DCM_IS_EVEN(key.getGroup())) + return OFFalse; + else if ((getElementRangeRestriction() == DcmDictRange_Even) && + DCM_IS_ODD(key.getElement())) + return OFFalse; + else if ((getElementRangeRestriction() == DcmDictRange_Odd) && + DCM_IS_EVEN(key.getElement())) + return OFFalse; + else if (! privateCreatorMatch(privCreator)) + return OFFalse; + else + { + const OFBool groupMatches=DCM_INRANGE(key.getGroup(), getGroup(), getUpperGroup()); + OFBool found=groupMatches && DCM_INRANGE(key.getElement(), getElement(), getUpperElement()); + if (!found && groupMatches && privCreator) + found=DCM_INRANGE(key.getElement() & 0xFF, getElement(), getUpperElement()); + return found; + } + } + + /** checks if this entry contains the given name + * @param name attribute name, must not be NULL + * @return true if tagName matches the given string + */ + int contains(const char *name) const /* this contains named key */ + { + return !strcmp( tagName, name ); + } + + /* set relations */ + + /** checks if this entry describes a true subset of tag range + * described by the given entry. + * @param e entry to compare with + * @return true if this object is subset of e + */ + int subset(const DcmDictEntry& e) const /* this is a subset of key */ + { + return ( (getGroup() >= e.getGroup()) && + (getUpperGroup() <= e.getUpperGroup()) && + (getElement() >= e.getElement()) && + (getUpperElement() <= e.getUpperElement()) && + privateCreatorMatch(e.privateCreator) + ); + } + + /** checks if this entry describes the same tag range as the given entry. + * @param e entry to compare with + * @return true if objects describe the same tag range + */ + int setEQ(const DcmDictEntry& e) const /* this is set equal to key */ + { + return ( (getGroup() == e.getGroup()) && + (getUpperGroup() == e.getUpperGroup()) && + (getElement() == e.getElement()) && + (getUpperElement() == e.getUpperElement()) && + (getGroupRangeRestriction() == e.getGroupRangeRestriction()) && + (getElementRangeRestriction() == e.getElementRangeRestriction()) && + privateCreatorMatch(e.privateCreator) + ); + } + + /// friend operator<< + friend DCMTK_DCMDATA_EXPORT STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& s, const DcmDictEntry& e); + +private: + + /// private undefined copy assignment operator + DcmDictEntry &operator=(const DcmDictEntry &); + + /** upper limit of repeating group and element (lower limit is inherited + * from DcmTagKey) + */ + DcmTagKey upperKey; + + /// value representation + DcmVR valueRepresentation; + + /// attribute name + const char *tagName; + + /// lower limit for VM + int valueMultiplicityMin; + + /// upper limit for VM + int valueMultiplicityMax; + + /// standard version name, may be NULL + const char *standardVersion; + + /// true if strings are copies (i.e. should be deleted upon destruction) + OFBool stringsAreCopies; + + /// restriction (even, odd, unrestricted) for group range + DcmDictRangeRestriction groupRangeRestriction; + + /// restriction (even, odd, unrestricted) for element range + DcmDictRangeRestriction elementRangeRestriction; + + /// private creator name, may be NULL + const char *privateCreator; +}; + +#endif /* !DCDICENT_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dcdict.h b/dcmdata/include/dcmtk/dcmdata/dcdict.h new file mode 100644 index 00000000..962ebb93 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdict.h @@ -0,0 +1,302 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Interface for loadable DICOM data dictionary + * + */ + + +#ifndef DCMDICT_H +#define DCMDICT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofthread.h" +#include "dcmtk/dcmdata/dchashdi.h" + +/// maximum length of a line in the loadable DICOM dictionary +#define DCM_MAXDICTLINESIZE 2048 + +/// maximum number of fields per entry in the loadable DICOM dictionary +#define DCM_MAXDICTFIELDS 6 + +/// environment variable pointing to the data dictionary file +#define DCM_DICT_ENVIRONMENT_VARIABLE "DCMDICTPATH" + +#ifndef DCM_DICT_DEFAULT_PATH +/* +** The default dictionary path is system dependent. It should +** be defined in a configuration file included from "osconfig.h" +*/ +#error "DCM_DICT_DEFAULT_PATH is not defined via osconfig.h" +#endif /* !DCM_DICT_DEFAULT_PATH */ + +#ifndef ENVIRONMENT_PATH_SEPARATOR +#define ENVIRONMENT_PATH_SEPARATOR '\n' /* at least define something unlikely */ +#endif + + +/** this class implements a loadable DICOM Data Dictionary + */ +class DCMTK_DCMDATA_EXPORT DcmDataDictionary +{ +public: + + /** constructor + * @param loadBuiltin flag indicating if a built-in data dictionary + * (if any) should be loaded. + * @param loadExternal flag indicating if an external data dictionary + * should be read from file. + */ + DcmDataDictionary(OFBool loadBuiltin, OFBool loadExternal); + + /// destructor + ~DcmDataDictionary(); + + /** checks if a data dictionary is loaded (excluding the skeleton dictionary) + * @return true if loaded, false if no dictionary is present + */ + OFBool isDictionaryLoaded() const { return dictionaryLoaded; } + + /// returns the number of normal (non-repeating) tag entries + int numberOfNormalTagEntries() const { return hashDict.size(); } + + /// returns the number of repeating tag entries + int numberOfRepeatingTagEntries() const { return OFstatic_cast(int, repDict.size()); } + + /** returns the number of dictionary entries that were loaded + * either from file or from a built-in dictionary or both. + */ + int numberOfEntries() const + { return numberOfNormalTagEntries() + + numberOfRepeatingTagEntries() - skeletonCount; } + + /** returns the number of skeleton entries. The skeleton is a collection + * of dictionary entries which are always present, even if neither internal + * nor external dictionary have been loaded. It contains very basic + * things like item delimitation and sequence delimitation. + */ + int numberOfSkeletonEntries() const { return skeletonCount; } + + /** reload data dictionaries. First, all dictionary entries are deleted. + * @param loadBuiltin flag indicating if a built-in data dictionary + * (if any) should be loaded. + * @param loadExternal flag indicating if an external data dictionary + * should be read from file. + * @return true if reload was successful, false if an error occurred + */ + OFBool reloadDictionaries(OFBool loadBuiltin, OFBool loadExternal); + + /** load a particular dictionary from file. + * @param fileName filename + * @param errorIfAbsent causes the method to return false + * if the file cannot be opened + * @return false if the file contains a parse error or if the file could + * not be opened and errorIfAbsent was set, true otherwise. + */ + OFBool loadDictionary(const char* fileName, OFBool errorIfAbsent = OFTrue); + + /** dictionary lookup for the given tag key and private creator name. + * First the normal tag dictionary is searched. If not found + * then the repeating tag dictionary is searched. + * @param key tag key + * @param privCreator private creator name, may be NULL + */ + const DcmDictEntry* findEntry(const DcmTagKey& key, const char *privCreator) const; + + /** dictionary lookup for the given attribute name. + * First the normal tag dictionary is searched. If not found + * then the repeating tag dictionary is searched. + * Only considers standard attributes (i. e. without private creator) + * @param name attribute name + */ + const DcmDictEntry* findEntry(const char *name) const; + + /// deletes all dictionary entries + void clear(); + + /** adds an entry to the dictionary. Must be allocated via new. + * The entry becomes the property of the dictionary and will be + * deallocated (via delete) upon clear() or dictionary destruction. + * If an equivalent entry already exists it will be replaced by + * the new entry and the old entry deallocated (via delete). + * @param entry pointer to new entry + */ + void addEntry(DcmDictEntry* entry); + + /* Iterators to access the normal and the repeating entries */ + + /// returns an iterator to the start of the normal (non-repeating) dictionary + DcmHashDictIterator normalBegin() { return hashDict.begin(); } + + /// returns an iterator to the end of the normal (non-repeating) dictionary + DcmHashDictIterator normalEnd() { return hashDict.end(); } + + /// returns an iterator to the start of the repeating tag dictionary + DcmDictEntryListIterator repeatingBegin() { return repDict.begin(); } + + /// returns an iterator to the end of the repeating tag dictionary + DcmDictEntryListIterator repeatingEnd() { return repDict.end(); } + +private: + + /** private undefined assignment operator + */ + DcmDataDictionary &operator=(const DcmDataDictionary &); + + /** private undefined copy constructor + */ + DcmDataDictionary(const DcmDataDictionary &); + + /** loads external dictionaries defined via environment variables + * @return true if successful + */ + OFBool loadExternalDictionaries(); + + /** loads a builtin (compiled) data dictionary. + * Depending on which code is in use, this function may not + * do anything. + */ + void loadBuiltinDictionary(); + + /** loads the skeleton dictionary (the bare minimum needed to run) + * @return true if successful + */ + OFBool loadSkeletonDictionary(); + + /** looks up the given directory entry in the two dictionaries. + * @return pointer to entry if found, NULL otherwise + */ + const DcmDictEntry* findEntry(const DcmDictEntry& entry) const; + + /** deletes the given entry from either dictionary + */ + void deleteEntry(const DcmDictEntry& entry); + + + /** dictionary of normal tags + */ + DcmHashDict hashDict; + + /** dictionary of repeating tags + */ + DcmDictEntryList repDict; + + /** the number of skeleton entries + */ + int skeletonCount; + + /** is a dictionary loaded (more than skeleton) + */ + OFBool dictionaryLoaded; + +}; + + +/** global singleton dicom dictionary that is used by DCMTK in order to lookup + * attribute VR, tag names and so on. The dictionary is internally populated + * on first use, if the user accesses it via rdlock() or wrlock(). The + * dictionary allows safe read (shared) and write (exclusive) access from + * multiple threads in parallel. + */ +class DCMTK_DCMDATA_EXPORT GlobalDcmDataDictionary +{ +public: + /** constructor. + */ + GlobalDcmDataDictionary(); + + /** destructor + */ + ~GlobalDcmDataDictionary(); + + /** acquires a read lock and returns a const reference to + * the dictionary. + * @return const reference to dictionary + */ + const DcmDataDictionary& rdlock(); + + /** acquires a write lock and returns a non-const reference + * to the dictionary. + * @return non-const reference to dictionary. + */ + DcmDataDictionary& wrlock(); + + /** unlocks the read lock which must have been acquired previously. + */ + void rdunlock(); + + /** unlocks the write lock which must have been acquired previously. + */ + void wrunlock(); + + /** checks if a data dictionary has been loaded. This method acquires and + * releases a read lock. It must not be called with another lock on the + * dictionary being held by the calling thread. + * @return OFTrue if dictionary has been loaded, OFFalse otherwise. + */ + OFBool isDictionaryLoaded(); + + /** erases the contents of the dictionary. This method acquires and + * releases a write lock. It must not be called with another lock on the + * dictionary being held by the calling thread. This method is intended + * as a help for debugging memory leaks. + */ + void clear(); + +private: + /** private undefined assignment operator + */ + GlobalDcmDataDictionary &operator=(const GlobalDcmDataDictionary &); + + /** private undefined copy constructor + */ + GlobalDcmDataDictionary(const GlobalDcmDataDictionary &); + + /** create the data dictionary instance for this class. Used for first + * intialization. The caller must not have dataDictLock locked. + */ + void createDataDict(); + + /** the data dictionary managed by this class + */ + DcmDataDictionary *dataDict; + +#ifdef WITH_THREADS + /** the read/write lock used to protect access from multiple threads + * @remark this member is only available if DCMTK is compiled with thread + * support enabled. + */ + OFReadWriteLock dataDictLock; +#endif +}; + + +/** The Global DICOM Data Dictionary. + * Will be created before main() starts and gets populated on its first use. + * Tries to load a builtin data dictionary (if compiled in). + * Tries to load data dictionaries from files specified by + * the DCMDICTPATH environment variable. If this environment + * variable does not exist then a default file is loaded (if + * it exists). + * It is possible that no data dictionary gets loaded. This + * is likely to cause unexpected behaviour in the dcmdata + * toolkit classes. + */ +extern DCMTK_DCMDATA_EXPORT GlobalDcmDataDictionary dcmDataDict; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcdirrec.h b/dcmdata/include/dcmtk/dcmdata/dcdirrec.h new file mode 100644 index 00000000..89adaa63 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcdirrec.h @@ -0,0 +1,525 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmDirectoryRecord + * + */ + +#ifndef DCDIRREC_H +#define DCDIRREC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcfilefo.h" + + +/// types of directory records in a DICOMDIR +typedef enum { + /// root + ERT_root = 0, + /// curve (retired) + ERT_Curve = 1, + /// film box (retired) + ERT_FilmBox = 2, + /// film session (retired) + ERT_FilmSession = 3, + /// image + ERT_Image = 4, + /// image box (retired) + ERT_ImageBox = 5, + /// interpretation (retired) + ERT_Interpretation = 6, + /// modality LUT (retired) + ERT_ModalityLut = 7, + /// MRDR (retired) + ERT_Mrdr = 8, + /// overlay (retired) + ERT_Overlay = 9, + /// patient + ERT_Patient = 10, + /// print queue (retired) + ERT_PrintQueue = 11, + /// private + ERT_Private = 12, + /// results + ERT_Results = 13, + /// series + ERT_Series = 14, + /// study + ERT_Study = 15, + /// study component (retired) + ERT_StudyComponent = 16, + /// topic (retired) + ERT_Topic = 17, + /// visit (retired) + ERT_Visit = 18, + /// VOI LUT (retired) + ERT_VoiLut = 19, + /// SR document + ERT_SRDocument = 20, + /// presentation state + ERT_Presentation = 21, + /// waveform + ERT_Waveform = 22, + /// RT dose + ERT_RTDose = 23, + /// RT structure set + ERT_RTStructureSet = 24, + /// RT plan + ERT_RTPlan = 25, + /// RT treatment record + ERT_RTTreatRecord = 26, + /// stored print (retired) + ERT_StoredPrint = 27, + /// key object selection document + ERT_KeyObjectDoc = 28, + /// registration + ERT_Registration = 29, + /// fiducial + ERT_Fiducial = 30, + /// raw data + ERT_RawData = 31, + /// spectroscopy + ERT_Spectroscopy = 32, + /// encapsulated document + ERT_EncapDoc = 33, + /// value map + ERT_ValueMap = 34, + /// hanging protocol + ERT_HangingProtocol = 35, + /// stereometric relationships + ERT_Stereometric = 36, + /// HL7 structured document (retired) + ERT_HL7StrucDoc = 37, + /// palette + ERT_Palette = 38, + /// surface + ERT_Surface = 39, + /// measurement + ERT_Measurement = 40, + /// implant + ERT_Implant = 41, + /// implant group + ERT_ImplantGroup = 42, + /// implant assembly + ERT_ImplantAssy = 43, + /// plan + ERT_Plan = 44, + /// surface scan + ERT_SurfaceScan = 45, + /// tractography + ERT_Tract = 46, + /// assessment + ERT_Assessment = 47, + /// radiotherapy + ERT_Radiotherapy = 48 +} E_DirRecType; + + +class DcmDicomDir; + +/** a class representing a directory record dataset in a DICOMDIR. + */ +class DCMTK_DCMDATA_EXPORT DcmDirectoryRecord : public DcmItem +{ + + friend class DcmDicomDir; + +public: + /// default constructor + DcmDirectoryRecord(); + + /** constructor. + * Create new element from given tag and length. + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmDirectoryRecord(const DcmTag &tag, + const Uint32 len); + + /** constructor + * @param recordType record type + * @param referencedFileID referenced file ID in DICOM format + * @param sourceFileName path to referenced file in operating system specific format + * @param fileFormat fileFormat for sourceFileName, can be NULL + */ + DcmDirectoryRecord(const E_DirRecType recordType, + const char *referencedFileID, // DICOM format with '\\' + const OFFilename &sourceFileName, // OS format + DcmFileFormat* fileFormat = NULL); + + /** constructor + * @param recordTypeName record type as string + * @param referencedFileID referenced file ID in DICOM format + * @param sourceFileName path to referenced file in operating system specific format + * @param fileFormat fileFormat for sourceFileName, can be NULL + */ + DcmDirectoryRecord(const char *recordTypeName, + const char *referencedFileID, // DICOM format with '\\' + const OFFilename &sourceFileName, // OS format + DcmFileFormat* fileFormat = NULL); + + /** copy constructor + * @param oldDirRec element to be copied + */ + DcmDirectoryRecord(const DcmDirectoryRecord &oldDirRec); + + /** assignment operator + * @param obj the directory record to be copied + */ + DcmDirectoryRecord &operator=(const DcmDirectoryRecord &obj); + + /// destructor + virtual ~DcmDirectoryRecord(); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmDirectoryRecord(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** return identifier for this class. Every class derived from this class + * returns a unique value of type enum DcmEVR for this call. This is used + * as a "poor man's RTTI" to correctly identify instances derived from + * this class even on compilers not supporting RTTI. + * @return type identifier of this class + */ + virtual DcmEVR ident() const; + + /// returns current status flag + inline OFCondition error() const { return errorFlag; } + + /** mode specifying whether the SpecificCharacterSet (0008,0005) element should be + * checked by convertCharacterSet() or not, i.e.\ whether this element might be + * present on this dataset-level. + * @return always returns OFTrue, i.e.\ SpecificCharacterSet should be checked + */ + virtual OFBool checkForSpecificCharacterSet() const { return OFTrue; } + + /** convert all element values that are contained in this record and that are + * affected by SpecificCharacterSet from the given source character set to the given + * destination character set. The defined terms for a particular character set can + * be found in the DICOM standard, e.g. "ISO_IR 100" for ISO 8859-1 (Latin 1) or + * "ISO_IR 192" for Unicode in UTF-8. An empty string denotes the default character + * repertoire, which is ASCII (7-bit). If multiple values are given for 'fromCharset' + * (separated by a backslash) code extension techniques are used and escape sequences + * may be encountered in the source string to switch between the specified character + * sets. + * @param fromCharset name of the source character set(s) used for the conversion + * @param toCharset name of the destination character set used for the conversion. + * Only a single value is permitted (i.e. no code extensions). + * @param flags optional flag used to customize the conversion (see DCMTypes::CF_xxx) + * @param updateCharset if OFTrue, the SpecificCharacterSet (0008,0005) element is + * updated, i.e.\ the current value is either replaced or a new element is inserted + * or the existing element is deleted. If OFFalse the SpecificCharacterSet element + * remains unchanged. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(const OFString &fromCharset, + const OFString &toCharset, + const size_t flags = 0, + const OFBool updateCharset = OFFalse); + + /** convert all element values that are contained in this record and that are + * affected by SpecificCharacterSet to the given destination character set. If not + * disabled, the source character set is determined automatically from the value of + * the SpecificCharacterSet (0008,0005) element. The defined terms for the + * destination character set can be found in the DICOM standard, e.g. "ISO_IR 100" + * for ISO 8859-1 (Latin 1) or "ISO_IR 192" for Unicode in UTF-8. An empty string + * denotes the default character repertoire, which is ASCII (7-bit). + * @param toCharset name of the destination character set used for the conversion. + * Only a single value is permitted (i.e. no code extensions). + * @param flags optional flag used to customize the conversion (see DCMTypes::CF_xxx) + * @param ignoreCharset if OFTrue, the value of SpecificCharacterSet is ignored. + * Also see checkForSpecificCharacterSet(). + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(const OFString &toCharset, + const size_t flags = 0, + const OFBool ignoreCharset = OFFalse); + + /** convert all element values that are contained in this record and that are + * affected by SpecificCharacterSet from the currently selected source character + * set to the currently selected destination character set. Since the Basic + * Directory IOD, which specifies the structure and content of a DICOMDIR, does not + * contain the SpecificCharacterSet (0008,0005) element in the main dataset but in + * each directory record, this method also checks for this element and creates a new + * character set converter for the contained data elements (if needed). + * @param converter character set converter to be used to convert the element values + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(DcmSpecificCharacterSet &converter); + + /** print all elements of the item to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** This function reads the information of all attributes which + * are captured in the input stream and captures this information + * in elementList. Each attribute is represented as an element + * in this list. If not all information for an attribute could be + * read from the stream, the function returns EC_StreamNotifyClient. + * @param inStream The stream which contains the information. + * @param xfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies + * what will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /** a complex, stack-based, hierarchical search method. It allows for a search + * for a DICOM object with a given attribute within a given container, + * hierarchically, from a starting position identified through a cursor stack. + * @param xtag the DICOM attribute tag we are searching for + * @param resultStack depending on the search mode (see below), this parameter + * either serves as an input and output parameter, or as an output parameter + * only (the latter being the default). When used as an input parameter, + * the cursor stack defines the start position for the search within a + * hierarchical DICOM dataset. Upon successful return, the stack contains + * the position of the element found, in the form of a pointer to each dataset, + * sequence, item and element from the main dataset down to the found element. + * @param mode search mode, controls how the search stack is handled. + * In the default mode, ESM_fromHere, the stack is ignored on input, and + * the search starts in the object for which this method is called. + * In the other modes, the stack is used both as an input and an output + * parameter and defines the starting point for the search. + * @param searchIntoSub if true, the search will be performed hierarchically descending + * into the sequences and items of the dataset. If false, only the current container + * (sequence or item) will be traversed. + * @return EC_Normal if found, EC_TagNotFound if not found, an error code is something went wrong. + */ + virtual OFCondition search(const DcmTagKey &xtag, // in + DcmStack &resultStack, // inout + E_SearchMode mode = ESM_fromHere, // in + OFBool searchIntoSub = OFTrue); // in + + /// get record type of this directory record + virtual E_DirRecType getRecordType(); + + /** if this directory record references an MRDR (multi-reference directory record), + * return pointer to the MRDR referenced by this object. + * @return pointer to MRDR referenced by this object or NULL of no MRDR referenced + */ + virtual DcmDirectoryRecord* getReferencedMRDR(); + + /** create a reference from this record to an MRDR + * @param mrdr pointer to MRDR + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition assignToMRDR(DcmDirectoryRecord *mrdr ); // in + + /** open a DICOM file and make this directory record into a directory + * record for that DICOM file. The most relevant record keys + * (SOP Class UID, SOP instance UID, Transfer Syntax UID) are inserted + * into the directory record. + * @param referencedFileID referenced file ID in DICOM format + * @param sourceFileName path to file in operating system specific format + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition assignToSOPFile(const char *referencedFileID, + const OFFilename &sourceFileName); + + /// return number of directory records that are child record of this one + virtual unsigned long cardSub() const; + + /** insert a child directory record + * @param dirRec directory record to be inserted. Must be allocated on heap, ownership is + * transferred to this object + * @param where index where to insert object + * @param before flag indicating whether to insert the record before or after the element + * identified by where + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition insertSub(DcmDirectoryRecord* dirRec, + unsigned long where = DCM_EndOfListIndex, + OFBool before = OFFalse); + + /** insert new directory child record at the current position. + * The current position is stored internally in the 'lowerLevelList' member variable. + * @param dirRec new child record to be inserted + * @param before flag indicating whether to insert the record before (OFFalse) or + * after (OFTrue) the current position + * @return status, EC_Normal upon success, an error code otherwise + */ + virtual OFCondition insertSubAtCurrentPos(DcmDirectoryRecord *dirRec, + OFBool before = OFFalse); + + /** access child directory record. Returns a pointer to the object maintained + * as a child, not a copy. + * @param num index, must be < cardSub() + * @return pointer to child directory record or NULL if not found + */ + virtual DcmDirectoryRecord* getSub(const unsigned long num); + + /** get next directory child record starting at a given record + * @param dirRec record to start from (goto first record if NULL) + * @return pointer to next record if successful, NULL otherwise + */ + virtual DcmDirectoryRecord* nextSub(const DcmDirectoryRecord *dirRec); + + /** remove child directory record. If found, the record is not deleted but + * returned to the caller who is responsible for further management of the + * DcmDirectoryRecord object. + * @param num index number of element, must be < cardSub() + * @return pointer to DcmDirectoryRecord if found, NULL otherwise + */ + virtual DcmDirectoryRecord* removeSub(const unsigned long num); + + /** remove child directory record. If found, the record is not deleted but + * returned to the caller who is responsible for further management of the + * DcmDirectoryRecord object. + * @param dirRec pointer to element to be removed from list + * @return pointer to element if found, NULL otherwise + */ + virtual DcmDirectoryRecord* removeSub(DcmDirectoryRecord *dirRec); + + /** remove child directory record and delete file referenced by that record, if any + * @param num index number of element, must be < cardSub() + * @return status, EC_Normal upon success, an error code otherwise + */ + virtual OFCondition deleteSubAndPurgeFile(const unsigned long num); + + /** remove child directory record and delete file referenced by that record, if any + * @param dirRec pointer to element to be removed from list + * @return status, EC_Normal upon success, an error code otherwise + */ + virtual OFCondition deleteSubAndPurgeFile(DcmDirectoryRecord *dirRec); + + /// revert the list of child directory records to default constructed (empty) state + virtual OFCondition clearSub(); + + /** store the filename from which this directory record was read from + * @param fname filename, must not be empty + */ + virtual void setRecordsOriginFile(const OFFilename &fname); + + /// get the filename from which this directory record was read from, empty if not set + virtual const OFFilename &getRecordsOriginFile(); + + /// get the offset in file of this directory record + Uint32 getFileOffset() const; + +protected: + + // side-effect-free conversion routines: + E_DirRecType recordNameToType(const char *recordTypeName); + char* buildFileName(const char *origName, char *destName, size_t len) const; + OFCondition checkHierarchy(const E_DirRecType upperRecord, + const E_DirRecType lowerRecord); + + // access to data elements within the Directory Records: + OFCondition setRecordType(E_DirRecType newType); + E_DirRecType lookForRecordType(); + OFCondition setReferencedFileID( const char *referencedFileID); + const char* lookForReferencedFileID(); + DcmDirectoryRecord* lookForReferencedMRDR(); + const char* getReferencedFileName(); // local or in MRDR + OFCondition setRecordInUseFlag(const Uint16 newFlag); + Uint16 lookForRecordInUseFlag(); + Uint32 setFileOffset(Uint32 position); + + // access to MRDR data element: + OFCondition setNumberOfReferences(Uint32 newRefNum); + Uint32 lookForNumberOfReferences(); + Uint32 increaseRefNum(); + Uint32 decreaseRefNum(); + + // misc: + /** Load all necessary info for this directory record. + * @param referencedFileID file ID that is being referenced, may be NULL + * @param sourceFileName filename for the DICOM file, may be empty (unspecified) + * @param fileFormat If not NULL, then this should be the result of loading + * sourceFileName. May only be non-NULL if sourceFileName isn't empty. + */ + OFCondition fillElementsAndReadSOP(const char *referencedFileID, + const OFFilename &sourceFileName, + DcmFileFormat *fileFormat = NULL); + OFCondition masterInsertSub(DcmDirectoryRecord *dirRec, + const unsigned long where = DCM_EndOfListIndex); + OFCondition purgeReferencedFile(); + +private: + + /// filename (path) of the file from which this directory record was read + OFFilename recordsOriginFile; + + /// list of child directory records, kept in a sequence of items + DcmSequenceOfItems *lowerLevelList; + + /// directory record type of this record + E_DirRecType DirRecordType; + + /// pointer to multi-referenced directory record (MRDR) if this record refers to one, NULL otherwise + DcmDirectoryRecord *referencedMRDR; + + /// number of other directory records referring to this one; used for MRDR records + Uint32 numberOfReferences; + + /// byte offset at which the start of this directory record resides in the file from which it was read + Uint32 offsetInFile; + +}; + + +#endif // DCDIRREC_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcelem.h b/dcmdata/include/dcmtk/dcmdata/dcelem.h new file mode 100644 index 00000000..87b8a5a2 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcelem.h @@ -0,0 +1,1051 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmElement + * + */ + + +#ifndef DCELEM_H +#define DCELEM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/ofstd/ofstring.h" + +// forward declarations +class DcmInputStreamFactory; +class DcmJsonFormat; +class DcmFileCache; +class DcmItem; + +/** abstract base class for all DICOM elements + */ +class DCMTK_DCMDATA_EXPORT DcmElement + : public DcmObject +{ + + public: + + // be friend with "greater than" and "less than" operators that are defined + // outside of this class + friend OFBool operator< (const DcmElement& lhs, const DcmElement& rhs); + friend OFBool operator> (const DcmElement& lhs, const DcmElement& rhs); + friend OFBool operator<=(const DcmElement& lhs, const DcmElement& rhs); + friend OFBool operator>=(const DcmElement& lhs, const DcmElement& rhs); + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmElement(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmElement(const DcmElement &old); + + /** destructor + */ + virtual ~DcmElement(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmElement &operator=(const DcmElement &obj); + + /** comparison operator that compares the normalized value of this element + * with a given element of the same type (e.g. an DcmUnsignedShort with a + * DcmUnsignedShort). The tag of the element is also considered as the first + * component that is compared, followed by the object types (VR, i.e. DCMTK'S EVR). + * DcmElement's default implementation does only compare the tag and EVR while + * the derived classes implement the value comparisons by comparing all the + * components that make up the value, preferably in the order declared in + * the object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + * If the function is overwritten by derived classes, the behaviour might + * slightly change but all methods will return 0 on equality, and 1 or -1 + * if different. + */ + virtual int compare(const DcmElement& rhs) const =0; + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** @copydoc DcmObject::calcElementLength() + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** calculate the value length (without attribute tag, VR and length field) + * of this DICOM element when encoded with the given transfer syntax and + * the given encoding type for sequences. Never returns undefined length. + * @param xfer transfer syntax for length calculation + * @param enctype sequence encoding type for length calculation + * @return value length of DICOM element + */ + virtual Uint32 getLength(const E_TransferSyntax /*xfer*/ = EXS_LittleEndianImplicit, + const E_EncodingType /*enctype*/ = EET_UndefinedLength) + { + return getLengthField(); + } + + /** check if this element is a leaf node in a dataset tree. + * All subclasses of DcmElement except for DcmSequenceOfItems + * are leaf nodes, while DcmSequenceOfItems, DcmItem, DcmDataset etc. + * are not. + * @return true if leaf node, false otherwise. + */ + virtual OFBool isLeaf() const { return OFTrue; } + + /** check if value of this element is loaded into main memory + * @return true if value is present in memory, false if value still resides in file + */ + inline OFBool valueLoaded() const { return fValue != NULL || getLengthField() == 0; } + + /** initialize the transfer state of this object. This method must be called + * before this object is written to a stream or read (parsed) from a stream. + */ + virtual void transferInit(); + + /** check if this DICOM object can be encoded in the given transfer syntax. + * @param newXfer transfer syntax in which the DICOM object is to be encoded + * @param oldXfer transfer syntax in which the DICOM object was read or created. + * @return true if object can be encoded in desired transfer syntax, false otherwise. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer); + + /** This function reads the data value of an attribute which is + * captured in the input stream and captures this information + * in this. If not all information for an attribute could be + * read from the stream, the function returns EC_StreamNotifyClient. + * Note that if certain conditions are met, this function does + * not actually load the data value but creates and stores an object + * that enables us to load this information later. + * @param inStream The stream which contains the information. + * @param ixfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies what + * will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** This function writes this element's value to the outstream which was + * passed. When writing information, the byte ordering (little or big endian) + * of the transfer syntax which was passed will be accounted for. In case the + * outstream does not provide enough space for all bytes of the current + * element's value, only a certain part of the value will be written to the + * stream. This element's transfer state indicates if the all bytes of value + * have already been written to the stream (ERW_ready), if the writing is + * still in progress and more bytes need to be written to the stream + * (ERW_inWork) or if the writing of the bytes of this element's value has not + * even begun yet (ERW_init). The member variable fTransferredBytes indicates + * how many bytes (starting from byte 0) of this element's value have already + * been written to the stream. This function will return EC_Normal, if the + * entire value of this element has been written to the stream, it will return + * EC_StreamNotifyClient, if there is no more space in the buffer and _not_ all + * bytes of this element's value have been written, and it will return some + * other (error) value if there was an error. + * @param outStream The stream the information will be written to. + * @param oxfer The transfer syntax which shall be used. + * @param enctype encoding types (undefined or explicit length) (actually unused) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** clear (remove) attribute value + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear(); + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param oldFormat support old ACR/NEMA format for certain VRs (DA, TM, PN) if OFTrue + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** this method loads all attribute values maintained by this object and + * all sub-objects (in case of a container such as DcmDataset) into memory. + * After a call to this method, the file from which a dataset was read may safely + * be deleted or replaced. For large files, this method may obviously allocate large + * amounts of memory. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadAllDataIntoMemory(); + + // GET operations + + /** retrieve a single value of type Uint8. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint8(Uint8 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Sint16. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getSint16(Sint16 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Uint16. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint16(Uint16 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Sint32. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getSint32(Sint32 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Uint32. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint32(Uint32 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Float32. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getFloat32(Float32 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Sint64. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getSint64(Sint64 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Uint64. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint64(Uint64 &val, const unsigned long pos = 0); + + /** retrieve a single value of type Float64. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getFloat64(Float64 &val, const unsigned long pos = 0); + + /** retrieve a single value of type DcmTagKey. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param val value returned in this parameter upon success + * @param pos position in multi-valued attribute, default 0 + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getTagVal(DcmTagKey &val, const unsigned long pos = 0); + + /** retrieve a single value of type string. Requires element to be of corresponding VR, + * otherwise an error is returned. + * @param str value returned in this parameter upon success + * @param pos position in multi-valued attribute + * @param normalize true if string is to be normalized (e.g. trailing space characters to be trimmed) + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getOFString(OFString &str, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get entire element value as a character string. + * In case of VM > 1 the individual values are separated by a backslash ('\'). + * This method implements a general approach by concatenating the results of + * getOFString() for each value component. Derived class may implement more + * sophisticated methods. + * @param value variable in which the result value is stored + * @param normalize normalize each element value prior to concatenation + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFStringArray(OFString &value, + OFBool normalize = OFTrue); + + /** get a pointer to the element value of the current element as type string. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getString(char *&val); // for strings + + /** get a pointer to the element value of the current element as type string. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @param len length of the returned value (number of characters) + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getString(char *&val, + Uint32 &len); + + /** get a pointer to the element value of the current element as type string. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint8Array(Uint8 *&val); // for bytes + + /** get a pointer to the element value of the current element as type Sint16. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getSint16Array(Sint16 *&val); + + /** get a pointer to the element value of the current element as type Uint16. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint16Array(Uint16 *&val); + + /** get a pointer to the element value of the current element as type Sint32. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getSint32Array(Sint32 *&val); + + /** get a pointer to the element value of the current element as type Uint32. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint32Array(Uint32 *&val); + + /** get a pointer to the element value of the current element as type Float32. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getFloat32Array(Float32 *&val); + + /** get a pointer to the element value of the current element as type Sint64. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getSint64Array(Sint64 *&val); + + /** get a pointer to the element value of the current element as type Uint64. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint64Array(Uint64 *&val); + + /** get a pointer to the element value of the current element as type Float64. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getFloat64Array(Float64 *&val); + + /** detach the value field from the DICOM element (i.e., this object). + * After detaching the calling part of the application has total control + * over the element value, especially the value must be deleted from the + * heap after use. The DICOM element remains a copy of the value if the + * copy parameter is OFTrue; otherwise the value is erased in the DICOM + * element. + * @param copy if true, copy value field before detaching; if false, do not + * retain a copy. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition detachValueField(OFBool copy = OFFalse); + + // PUT operations + + /** replace the element value by a copy of the given string (which is possibly + * multi-valued). Requires element to be of corresponding VR, otherwise an error + * is returned. + * @param val new attribute value + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putOFStringArray(const OFString &val); + + /** replace the element value by a copy of the given string (which is possibly + * multi-valued). Requires element to be of corresponding VR, otherwise an error + * is returned. + * @param val new attribute value + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putString(const char *val); + + /** replace the element value by a copy of the given string (which is possibly + * multi-valued). Requires element to be of corresponding VR, otherwise an error + * is returned. + * @param val new attribute value + * @param len length of the new attribute value (number of characters) + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putString(const char *val, + const Uint32 len); + + /** insert into the element value a copy of the given Sint16 value. If the + * attribute is multi-valued, all other values remain untouched. + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param val new value to be inserted + * @param pos position for insert operation. Value: pos <= getVM(), i.e. a value + * can be appended to the end of the current element or inserted within the + * existing value field. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putSint16(const Sint16 val, const unsigned long pos = 0); + + /** insert into the element value a copy of the given Uint16 value. If the + * attribute is multi-valued, all other values remain untouched. + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param val new value to be inserted + * @param pos position for insert operation. Value: pos <= getVM(), i.e. a value + * can be appended to the end of the current element or inserted within the + * existing value field. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putUint16(const Uint16 val, const unsigned long pos = 0); + + /** insert into the element value a copy of the given Sint32 value. If the + * attribute is multi-valued, all other values remain untouched. + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param val new value to be inserted + * @param pos position for insert operation. Value: pos <= getVM(), i.e. a value + * can be appended to the end of the current element or inserted within the + * existing value field. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putSint32(const Sint32 val, const unsigned long pos = 0); + + /** insert into the element value a copy of the given Uint32 value. If the + * attribute is multi-valued, all other values remain untouched. + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param val new value to be inserted + * @param pos position for insert operation. Value: pos <= getVM(), i.e. a value + * can be appended to the end of the current element or inserted within the + * existing value field. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putUint32(const Uint32 val, const unsigned long pos = 0); + + /** insert into the element value a copy of the given Float32 value. If the + * attribute is multi-valued, all other values remain untouched. + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param val new value to be inserted + * @param pos position for insert operation. Value: pos <= getVM(), i.e. a value + * can be appended to the end of the current element or inserted within the + * existing value field. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putFloat32(const Float32 val, const unsigned long pos = 0); + + /** insert into the element value a copy of the given Float64 value. If the + * attribute is multi-valued, all other values remain untouched. + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param val new value to be inserted + * @param pos position for insert operation. Value: pos <= getVM(), i.e. a value + * can be appended to the end of the current element or inserted within the + * existing value field. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putFloat64(const Float64 val, const unsigned long pos = 0); + + /** insert into the element value a copy of the given DcmTagKey value. If the + * attribute is multi-valued, all other values remain untouched. + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param attrTag new value to be inserted + * @param pos position for insert operation. Value: pos <= getVM(), i.e. a value + * can be appended to the end of the current element or inserted within the + * existing value field. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putTagVal(const DcmTagKey &attrTag, const unsigned long pos = 0); + + /** replace the element value by a copy of the given Uint8 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putUint8Array(const Uint8 *vals, const unsigned long num); + + /** replace the element value by a copy of the given Sint16 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putSint16Array(const Sint16 *vals, const unsigned long num); + + /** replace the element value by a copy of the given Uint16 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putUint16Array(const Uint16 *vals, const unsigned long num); + + /** replace the element value by a copy of the given Sint32 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putSint32Array(const Sint32 *vals, const unsigned long num); + + /** replace the element value by a copy of the given Uint32 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putUint32Array(const Uint32 *vals, const unsigned long num); + + /** replace the element value by a copy of the given Float32 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putFloat32Array(const Float32 *vals, const unsigned long num); + + /** replace the element value by a copy of the given Float64 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putFloat64Array(const Float64 *vals, const unsigned long num); + + /** Copy numBytes bytes of data from the attribute value in byteOrder byte order + * to targetBuffer, starting at byte offset offset of the attribute value. + * This method does not cause the complete attribute value to be read into + * main memory. Subsequent calls for the same partial value may cause repeated + * access to file if the attribute value is kept in file. + * @param targetBuffer pointer to target buffer, must not be NULL. + * Buffer size must be at least numBytes bytes. + * @param offset byte offset within the attribute value from where to start + * copying + * @param numBytes number of bytes to copy. + * @param cache file cache object that may be passed to multiple subsequent calls + * to this method for the same file; the file cache will then keep a file + * handle open, thus improving performance. Optional, may be NULL + * @param byteOrder byte order desired byte order of attribute value in memory buffer. + * Default is the local byte order of the machine. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getPartialValue(void *targetBuffer, + const Uint32 offset, + Uint32 numBytes, + DcmFileCache *cache = NULL, + E_ByteOrder byteOrder = gLocalByteOrder); + + /** create an empty Uint8 array of given number of bytes and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to certain VRs, e.g. OB. + * @param numBytes number of bytes (8 bit) to be created + * @param bytes stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint8Array(const Uint32 numBytes, Uint8 *&bytes); + + /** create an empty Uint16 array of given number of words and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to OW data. + * @param numWords number of words (16 bit) to be created + * @param words stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint16Array(const Uint32 numWords, Uint16 *&words); + + /** replace the attribute value with the content of the given temporary file. + * The temporary file is not opened/loaded until the attribute value is accessed, + * very much like large attributes that remain in file during a read operation. + * @param factory a factory object that is able to create an input stream + * to the temporary file at the right location. + * @param length attribute value length, in bytes. Must be even length. + * The length is not checked against the real length of the temporary file, + * which might be written or completed after the call to this method. + * @param byteOrder byte order in the temporary file + * @return EC_Normal upon success, an error code otherwise. + */ + virtual OFCondition createValueFromTempFile(DcmInputStreamFactory *factory, + const Uint32 length, + const E_ByteOrder byteOrder); + + /** remove the attribute value from memory if the attribute value can + * be loaded from file when needed again. Otherwise do nothing. + */ + virtual void compact(); + + /** compute uncompressed frame size of a single frame of this image. + * Note that the value returned by this method does not include the pad byte + * to even size needed for a buffer into which a frame is to be loaded. + * @param dataset dataset in which this pixel data element is contained + * @param frameSize frame size in bytes (without padding) returned in this + * parameter upon success, otherwise set to 0 + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUncompressedFrameSize(DcmItem *dataset, + Uint32 &frameSize) const; + + /** access single frame without decompressing or loading a complete + * multi-frame object. The frame is copied into the buffer passed by the caller + * which must be large enough to contain a complete frame. + * @param dataset pointer to DICOM dataset in which this pixel data object is + * located. Used to access rows, columns, samples per pixel etc. + * @param frameNo numer of frame, starting with 0 for the first frame. + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer allocated by the caller. The buffer + * must be large enough for one frame of this image. + * @param bufSize size of buffer, in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @param cache file cache object that may be passed to multiple subsequent calls + * to this method for the same file; the file cache will then keep a file + * handle open, thus improving performance. Optional, may be NULL + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUncompressedFrame(DcmItem *dataset, + Uint32 frameNo, + Uint32 &startFragment, + void *buffer, + Uint32 bufSize, + OFString &decompressedColorModel, + DcmFileCache *cache = NULL); + + /** determine color model of the decompressed image + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDecompressedColorModel(DcmItem *dataset, + OFString &decompressedColorModel); + + /** Determine if this element is universal matching. + * @param normalize normalize each element value. Defaults to OFTrue. + * @param enableWildCardMatching enable or disable wild card matching. Defaults to OFTrue, + * which means wild card matching is performed if the element's VR supports it. Set to + * OFFalse to force single value matching instead. + * @return returns OFTrue if element is empty or if enableWildCardMatching is enabled and + * the element contains only wildcard characters. Returns OFFalse otherwise. + */ + virtual OFBool isUniversalMatch(const OFBool normalize = OFTrue, + const OFBool enableWildCardMatching = OFTrue); + + /** perform attribute matching. + * Perform attribute matching on a candidate element using this element as the matching + * key. + * @note The given candidate element must refer to the same attribute kind, i.e. have the + * same tag and VR. The method will return OFFalse if it doesn't. + * @param candidate the candidate element to compare this element with. + * @param enableWildCardMatching enable or disable wild card matching. Defaults to OFTrue, + * which means wild card matching is performed if the element's VR supports it. Set to + * OFFalse to force single value matching instead. + * @return OFTrue if the candidate matches this element, OFFalse otherwise. + */ + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /** perform combined attribute matching. + * Combine the given Attributes to one pair of matching key and candidate respectively + * and perform attribute matching on the result. + * @note The DICOM standard currently defines combined attribute matching for the VR + * DA in combination with TM, such that two attributes can be combined into a single + * attribute with VR=DT before matching against another pair of attributes with VR + * DA and TM. The method will return OFFalse if this element's VR is not DA or the + * given attributes are not of VR TM, DA and TM respectively. + * @param keySecond the second part of the matching key that will be combined with this + * element. + * @param candidateFirst the first part of the candidate that will be matched against this + * this element + keySecond. + * @param candidateSecond the second part of the candidate that will be combined with + * candidateFirst for matching against this elemement + keySecond. + * @return OFTrue if the combination of this elemement and keySecond match with the + * combination of candidateFirst and candidateSecond. OFFalse otherwise. + */ + virtual OFBool combinationMatches(const DcmElement& keySecond, + const DcmElement& candidateFirst, + const DcmElement& candidateSecond) const; + + /** returns a pointer to the input stream, if available, NULL otherwise. + * In general, this pointer is available when the element is part of a dataset + * that has been read from a DICOM file, the file is not encoded in deflate + * transfer syntax, and the element value is large enough that loading the value + * has been postponed to the first read access. The DcmInputStreamFactory object + * can create an instance of a file stream seeked to the right position within + * the DICOM file from where the element value can be read. + * @return pointer to the input stream factory of the element, null if no object is available + */ + inline const DcmInputStreamFactory* getInputStream() const + { + return fLoadValue; + } + + /* --- static helper functions --- */ + + /** scan string value for conformance with given value representation (VR) + * @param value string value to be scanned + * @param vr two-character identifier of the VR to be checked (lower case) + * @param pos position of the first character to be scanned in 'value' + * @param num number of characters to be scanned in 'value' (default: all) + * @return numeric identifier of the VR found, 16 in case of unknown VR + */ + static int scanValue(const OFString &value, + const OFString &vr, + const size_t pos = 0, + const size_t num = OFString_npos); + + /** scan string value for conformance with given value representation (VR) + * @param vr two-character identifier of the VR to be checked (lower case) + * @param value string value to be scanned + * @param size number of characters to be scanned in 'value' + * @return numeric identifier of the VR found, 16 in case of unknown VR + */ + static int scanValue(const OFString &vr, + const char* const value, + const size_t size); + + /** determine the number of values stored in a string, i.e.\ the value multiplicity (VM) + * @param str character string + * @param len length of the string (number of characters without the trailing NULL byte) + * @return number of values separated by backslash characters in the given string + */ + static unsigned long determineVM(const char *str, + const size_t len); + + /** get the first value stored in the given string. The individual values are separated by + * a backslash. Successive calls of this function allow for extracting all stored values. + * @param str character string + * @param pos position of the first character in the string to search from + * @param len length of the string (number of characters without the trailing NULL byte) + * @param val variable in which the result is stored (empty string in case of error) + * @return position to be used for the next search, identical to 'pos' in case of error + */ + static size_t getValueFromString(const char *str, + const size_t pos, + const size_t len, + OFString &val); + + /** check for correct value multiplicity (VM) + * @param vmNum value multiplicity of the value to be checked. + * For empty values (vmNum=0), the status of the check is always EC_Normal (i.e. no error). + * @param vmStr value multiplicity (according to the data dictionary) to be checked for. + * (valid values: "1", "1-2", "1-3", "1-8", "1-99", "1-n", "2", "2-n", "2-2n", + * "3", "3-n", "3-3n", "4", "5", "5-n", "6", "7", "7-7n", "8", "9", + * "16", "24", "32", "256") + * @return status of the check, EC_ValueMultiplicityViolated in case of error + */ + static OFCondition checkVM(const unsigned long vmNum, + const OFString &vmStr); + + protected: + + /** This function returns this element's value. The returned value corresponds to the + * byte ordering (little or big endian) that was passed. + * @param newByteOrder The byte ordering that shall be accounted + * for (little or big endian). + */ + void *getValue(const E_ByteOrder newByteOrder = gLocalByteOrder); + + /** insert into the element value a copy of the given raw value. If the + * attribute is multi-valued, all other values remain untouched. + * Only works for fixed-size VRs, not for strings. + * @param value new value to be inserted + * @param position position for insert operation. Value: pos <= getVM(), i.e.\ a value + * can be appended to the end of the current element or inserted within the existing + * value field. + * @param num number of bytes for each value in the value field. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition changeValue(const void *value, // new Value + const Uint32 position, // position in value array + const Uint32 num); // number of new value bytes + + /** replace the element value by a copy of the given raw data block + * @param value new attribute value + * @param length length of new attribute value in bytes + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition putValue(const void *value, // new value + const Uint32 length); // number of new value bytes + + /** create a new, empty value field of given size. + * @param length size of new value field in bytes + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createEmptyValue(const Uint32 length); // number of new value bytes + + /** This function reads the data value of an attribute and stores the + * information which was read in this. The information is either read + * from the inStream or (if inStream is NULL) from a different stream + * which was created earlier and which is accessible through the fLoadValue + * member variable. Note that if not all information for an attribute + * could be read from the stream, the function returns EC_StreamNotifyClient. + * @param inStream The stream which contains the information. + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition loadValue(DcmInputStream *inStream = NULL); + + /** performs clean-up functions after loading an attribute value into main memory. + * In particular, if dcmEnableAutomaticInputDataCorrection is enabled, silently + * fixes odd length elements. + */ + virtual void postLoadValue(); + + /** This function creates a byte array of Length bytes and returns this + * array. In case Length is odd, an array of Length+1 bytes will be + * created and Length will be increased by 1. + * @return pointer to created byte array + */ + virtual Uint8 *newValueField(); + + /** swaps the content of the value field (if loaded) from big-endian to + * little-endian or back + * @param valueWidth width (in bytes) of each element value + */ + void swapValueField(size_t valueWidth); + + /** write element start tag in XML format + * @param out output stream to which the XML start tag is written + * @param flags flag used to customize the output (not yet used) + * @param attrText extra attribute text to be added to the element tag + */ + virtual void writeXMLStartTag(STD_NAMESPACE ostream &out, + const size_t flags, + const char *attrText = NULL); + + /** write element end tag in XML format + * @param out output stream to which the XML end tag is written + * @param flags flag used to customize the output (not yet used) + */ + virtual void writeXMLEndTag(STD_NAMESPACE ostream &out, + const size_t flags); + + /** write element start tag in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format the output + */ + virtual void writeJsonOpener(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** write element end tag in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format the output + */ + virtual void writeJsonCloser(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** return the current byte order of the value field + * @return current byte order of the value field + */ + E_ByteOrder getByteOrder() const { return fByteOrder; } + + /** set the current byte order of the value field + * @param val byte order of the value field + */ + void setByteOrder(E_ByteOrder val) { fByteOrder = val; } + + private: + + /// current byte order of attribute value in memory + E_ByteOrder fByteOrder; + + /// required information to load value later + DcmInputStreamFactory *fLoadValue; + + /// value of the element + Uint8 *fValue; +}; + +/** Checks whether left hand side element is smaller than right hand side + * element. Uses DcmElement's compare() method in order to perform the + * comparison. See DcmElement::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is smaller than rhs, OFFalse otherwise + */ +inline OFBool operator< (const DcmElement& lhs, const DcmElement& rhs) +{ + return ( lhs.compare(rhs) < 0 ); +} + +/** Checks whether left hand side element is greater than right hand side + * element. Uses DcmElement's compare() method in order to perform the + * comparison. See DcmElement::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is greater than rhs, OFFalse otherwise + */ +inline OFBool operator> (const DcmElement& lhs, const DcmElement& rhs) +{ + return rhs < lhs; +} + +/** Checks whether left hand side element is smaller than or equal to right hand + * side element. Uses DcmElement's compare() method in order to perform the + * comparison. See DcmElement::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is smaller than rhs or both are equal, OFFalse + * otherwise + */ +inline OFBool operator<=(const DcmElement& lhs, const DcmElement& rhs) +{ + return !(lhs > rhs); +} + +/** Checks whether left hand side element is greater than or equal to right hand + * side element. Uses DcmElement's compare() method in order to perform the + * comparison. See DcmElement::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is greater than rhs or both are equal, OFFalse + * otherwise + */ +inline OFBool operator>=(const DcmElement& lhs, const DcmElement& rhs) +{ + return !(lhs < rhs); +} + +#endif // DCELEM_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcencdoc.h b/dcmdata/include/dcmtk/dcmdata/dcencdoc.h new file mode 100755 index 00000000..4fa7fb30 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcencdoc.h @@ -0,0 +1,294 @@ +/* + * + * Copyright (C) 2018-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Pedro Arizpe + * + * Purpose: Class to control document encapsulation into DICOM files + * + */ + +#ifndef DCENCDOC_H +#define DCENCDOC_H + +//make sure OS specific configuration is included first +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/ofstd/ofcond.h" /* for class OFCondition */ +#include "dcmtk/dcmdata/dcdefine.h" /* for DCMTK_DCMDATA_EXPORT */ +#include "dcmtk/dcmdata/dcfilefo.h" /* for class DcmFileFormat */ +#include "dcmtk/ofstd/ofcmdln.h" /* for OFCmdUnsignedInt */ + +class XMLNode; +class OFCommandLine; +class OFConsoleApplication; +class OFLogger; + +/** This class handles common functions of all command line applications + * for document encapsulation. + */ +class DCMTK_DCMDATA_EXPORT DcmEncapsulatedDocument +{ +public: + ///Constructor + DcmEncapsulatedDocument(); + + ///Destructor + ~DcmEncapsulatedDocument(); + + /** This function is only used to process CDA files. + * It retrieves all entries of an attribute and returns them separated by backslashes. + * @param fileNode the root XML node. + * @param attr the attribute to search for. + * @return OFstring containing all entries found, separated by double backslashes + */ + OFString XMLgetAllAttributeValues(XMLNode fileNode, OFString attr); + + /** This function is only used to process CDA files. + * It retrieves the value from the CDA document + * corresponding to the DCM Tag. According to Standard v. 2013 part20/sect_A.8. + * @param fileNode the root XML node. + * @param attr the tag to search for in the CDA file. + * @return OFstring containing the value of the corresponding tag. + */ + OFString XMLgetAttribute(XMLNode fileNode, DcmTagKey attr); + + /** Retrieves patient, concept and document data from the CDA file and checks for data conflicts + * with series, study and user input. It also retrieves all mediatypes found in the CDA document. + * @param filename The filename of the CDA document. + * @param appLogger The logger of the application calling this method. + * @return EXITCODE_NO_ERROR (0) if successful or error code in case of failure. + */ + int getCDAData(const char *filename, OFLogger &appLogger); + + /** Recursive function used by getAttributeValues to get all occurrences of an attribute as list. + * @param currnode the current XML node to be processed. + * @param results a pointer to the list of strings where the results should be stored. + * @param attr the attribute to search for. + * @return OFTrue if the attribute value was found, OFFalse otherwise. + */ + OFBool XMLsearchAttribute(XMLNode currnode, OFList *results, OFString attr); + + /** Add CDA specific command line options to the OFCommandLine object + * passed to the constructor. + * @param cmd a reference to an OFCommandLine object used to parse + * the command line argument give to the calling application. + * @return none. + */ + void addCDACommandlineOptions(OFCommandLine& cmd); + + /** Add PDF specific command line options to the OFCommandLine object + * passed to the constructor. + * @param cmd a reference to an OFCommandLine object used to parse + * the command line argument give to the calling application. + * @return none. + */ + void addPDFCommandlineOptions(OFCommandLine& cmd); + + /** Add STL specific command line options to the OFCommandLine object + * passed to the constructor. + * @param cmd a reference to an OFCommandLine object used to parse + * the command line argument give to the calling application. + * @return none. + */ + void addSTLCommandlineOptions(OFCommandLine& cmd); + + /** Add general command line options to the OFCommandLine object + * passed to the constructor. + * @param cmd a reference to an OFCommandLine object used to parse + * the command line argument give to the calling application. + * @return none. + */ + void addGeneralOptions(OFCommandLine &cmd); + + /** Add command line options specific for documents to the OFCommandLine + * object passed to the constructor. + * @param cmd a reference to an OFCommandLine object used to parse + * the command line argument give to the calling application. + * @return none. + */ + void addDocumentOptions(OFCommandLine &cmd); + + /** Add command line options specific for output to the OFCommandLine + * object passed to the constructor. + * @param cmd a reference to an OFCommandLine object used to parse + * the command line argument give to the calling application. + * @return none. + */ + void addOutputOptions(OFCommandLine &cmd); + + /** Parse and evaluate the given command line arguments. + * @param app a reference to an OFConsoleApplication object used in the + * calling application. + * @param cmd a reference to an OFCommandLine object used to parse + * the command line argument give to the calling application. + * @return none. + */ + void parseArguments(OFConsoleApplication& app, OFCommandLine& cmd); + + /** Includes basic information into the DICOM file. + * @param dataset a reference to a DcmItem containing the information to be included. + * @param logger The logger of the application calling this method. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createHeader (DcmItem *dataset, + OFLogger& logger); + + /** Correctly inserts encapsulated document data. + * @param dataset The dataset to which we should encapsulate this document. + * @param logger The logger of the application calling this method. + * @return EXITCODE_NO_ERROR (0) if successful or error code in case of failure. + */ + int insertEncapsulatedDocument(DcmItem *dataset, + OFLogger& logger); + + /** Get study or series data from provided file. Generate UID if none present. + * @param appLogger The logger of the application calling this method. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createIdentifiers(OFLogger& appLogger); + + /** Copy override keys over existing keys in given dataset. + * @param outputDset dataset to which the override keys are copied + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition applyOverrideKeys(DcmDataset *outputDset); + + /** Specifies some attributes that should be inserted after encapsulation + * They will override any identical attributes already existing in the resulting encapsulated + * DICOM object. The override keys are applied at the very end of the conversion and do not + * undergo any validity checking. + * @param ovkeys override keys that can be tags, dictionary names and paths (see DcmPath + * for syntax). Also it is permitted to set a value if appropriate, e. g. "PatientName=Doe^John" + * would be a valid overridekey. + * @return none. + */ + void setOverrideKeys(const OFList& ovkeys); + + /** Returns the input file name. + * @return the input file name as OFString. + */ + OFString getInputFileName(); + + /** Sets the input file name to the given string. + * @param fName the file name to be set. + * @return none. + */ + void setInputFileName(OFString fName); + + /** Returns the output file name. + * @return the output file name as OFString. + */ + OFString getOutputFileName(); + + /** Sets the output file name. + * @param fName the file name to be set. + * @return none. + */ + void setOutputFileName(OFString fName); + + /** Attempt to save the output file . + * @param fileformat the DICOM Fileformat including the output file params. + * @return Error code as condition, if error occurs, EC_Normal otherwise. + */ + OFCondition saveFile(DcmFileFormat fileformat); + + /** Returns the transfer syntax. + * @return the transfer syntax as E_TransferSyntax. + */ + E_TransferSyntax getTransferSyntax(); + + /** Returns the current filetype. + * @return the current filetype as OFString. + */ + OFString getFileType(); + + /** Sets the current filetype. + * @param fType the current filetype. + * @return none. + */ + void setFileType(OFString fType); + +private: + ///input file name + OFString opt_ifname; + ///output file name + OFString opt_ofname; + + ///optional parameters + ///*patient data + OFString opt_patientBirthdate; + OFString opt_patientID; + OFString opt_patientName; + OFString opt_patientSex; + ///*concept data + OFString opt_conceptCM; + OFString opt_conceptCSD; + OFString opt_conceptCV; + ///*document specific options + OFString opt_documentTitle; + OFString opt_seriesFile; + OFString opt_seriesUID; + OFString opt_studyUID; + + ///*assign default values for file encoding and padding + E_EncodingType opt_oenctype; + E_FileWriteMode opt_writeMode; + E_GrpLenEncoding opt_oglenc; + E_PaddingEncoding opt_opadenc; + E_TransferSyntax opt_oxfer; + OFCmdUnsignedInt opt_filepad; + OFCmdUnsignedInt opt_itempad; + ///*pre-existing series + OFBool opt_readSeriesInfo; + OFBool opt_annotation; + OFBool opt_increment; + + OFCmdSignedInt opt_instance; + /** These attributes are applied to the dataset after conversion + * (They are not checked by the isValid() function). + */ + OFList opt_overrideKeys; + + ///CDA specific variables + OFString cda_mediaTypes; + OFString hl7_InstanceIdentifier; + OFBool opt_override; + + /// STL specific variables + /// Frame of Reference module + OFString opt_frameOfReferenceUID; + OFString opt_positionReferenceIndicator; + ///Enhanced general equipment module + /// Manufacturer (VM 1) + OFString opt_manufacturer; + /// Manufacturer's Model Name (VM 1) + OFString opt_manufacturerModelName; + /// Device Serial Number (VM 1) + OFString opt_deviceSerialNumber; + /// Software Version(s) (VM 1-n) + OFString opt_softwareVersions; + + /// Manufacturing 3D Model Module + /// 3d Model Measurement Units Code Meaning + OFString opt_measurementUnitsCM; + /// 3d Model Measurement Units Code Scheme Designator + OFString opt_measurementUnitsCSD; + /// 3d Model Measurement Units Code Value + OFString opt_measurementUnitsCV; + + ///Type of file currently being converted. + OFString ftype; +}; +#endif // DCENCDOC_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcerror.h b/dcmdata/include/dcmtk/dcmdata/dcerror.h new file mode 100644 index 00000000..cb71d1a0 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcerror.h @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Error handling, codes and strings + * + */ + + +#ifndef DCERROR_H +#define DCERROR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofcond.h" /* for OFCondition */ +#include "dcmtk/dcmdata/dcdefine.h" + +// include this file in doxygen documentation + +/** @file dcerror.h + * @brief error handling, codes and strings for the dcmdata module + */ + +/* + * DCMTK module numbers for modules which create their own error codes. + * Module numbers > 1023 are reserved for user code. + */ + +const unsigned short OFM_dcmdata = 1; +const unsigned short OFM_ctndisp = 2; /* retired */ +const unsigned short OFM_dcmimgle = 3; +const unsigned short OFM_dcmimage = 4; +const unsigned short OFM_dcmjpeg = 5; +const unsigned short OFM_dcmnet = 6; +const unsigned short OFM_dcmprint = 7; +const unsigned short OFM_dcmpstat = 8; +const unsigned short OFM_dcmsign = 9; +const unsigned short OFM_dcmsr = 10; +const unsigned short OFM_dcmtls = 11; +const unsigned short OFM_dcmqrdb = 12; +const unsigned short OFM_wlistctn = 13; /* retired */ +const unsigned short OFM_dcmwlm = 14; +const unsigned short OFM_dcmpps = 15; +const unsigned short OFM_dcmdbsup = 16; +const unsigned short OFM_dcmppswm = 17; +const unsigned short OFM_dcmjp2k = 18; +const unsigned short OFM_dcmjpls = 19; +const unsigned short OFM_dcmwave = 20; +const unsigned short OFM_dcmrt = 21; +const unsigned short OFM_dcmloco = 22; +const unsigned short OFM_dcmstcom = 23; +const unsigned short OFM_dcmppscu = 24; +const unsigned short OFM_dcmstscp = 25; +const unsigned short OFM_dcmqrdbx = 26; +const unsigned short OFM_dcmkosel = 27; +const unsigned short OFM_dcmenc = 28; +const unsigned short OFM_dcmiod = 29; +const unsigned short OFM_dcmseg = 30; +const unsigned short OFM_dcmfg = 31; +const unsigned short OFM_dcmtract = 32; +const unsigned short OFM_dcmpmap = 33; +const unsigned short OFM_dcmelekt = 34; + +// condition constants + +/** @name condition constants for module dcmdata. + * These constants can be used in addition to the general purpose ones + * defined in module ofstd. + */ +//@{ +/// Invalid tag +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidTag; +/// Tag not found +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_TagNotFound; +/// Invalid VR +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidVR; +/// Invalid stream +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidStream; +/// End of stream +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_EndOfStream; +/// Corrupted data +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_CorruptedData; +/// Illegal call, perhaps wrong parameters +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_IllegalCall; +/// Sequence end +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_SequEnd; +/// Doubled tag +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_DoubledTag; +/// I/O suspension or premature end of stream +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_StreamNotifyClient; +/// Stream mode (R/W, random/sequence) is wrong +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_WrongStreamMode; +/// Item end +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ItemEnd; +/// Compressed/uncompressed pixel representation not found +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_RepresentationNotFound; +/// Pixel representation cannot be changed to requested transfer syntax +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_CannotChangeRepresentation; +/// Unsupported compression or encryption +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_UnsupportedEncoding; +/// Parser failure: Putback operation failed +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_PutbackFailed; +/// Too many compression filters +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_DoubleCompressionFilters; +/// Storage media application profile violated +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ApplicationProfileViolated; +/// Invalid offset +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidOffset; +/// Too many bytes requested +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_TooManyBytesRequested; +/// Invalid basic offset table +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidBasicOffsetTable; +/// Element length is larger than (explicit) length of surrounding item +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ElemLengthLargerThanItem; +/// File meta information header missing +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_FileMetaInfoHeaderMissing; +/// Item or sequence content larger than explicit 32-bit length field permits +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_SeqOrItemContentOverflow; +/// Value Representation (VR) violated +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ValueRepresentationViolated; +/// Value Multiplicity (VM) violated +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ValueMultiplicityViolated; +/// Maximum VR length violated +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_MaximumLengthViolated; +/// Element length is larger than 16-bit length field permits +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ElemLengthExceeds16BitField; +/// Missing Sequence Delimitation Item while reading a sequence +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_SequDelimitationItemMissing; +/// Missing Item Delimitation Item while reading an item +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ItemDelimitationItemMissing; +/// Sequence delimiter occurs before explicit item length is completely read +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_PrematureSequDelimitationItem; +/// Invalid DICOMDIR, e.g. corrupted data structures +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidDICOMDIR; +/// Unknown VR, e.g. tag not found in data dictionary +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_UnknownVR; +/// Invalid value, e.g. element value has been provided that does not match the VR +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidValue; +/// An expected Item was not found +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ItemNotFound; +/// Given transfer syntax is unknown +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_UnknownTransferSyntax; +/// Cannot check +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_CannotCheck; +/// Missing value, e.g. element must contain a value but is empty +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_MissingValue; +/// Missing attribute +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_MissingAttribute; +/// Internal error +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InternalError; +/// Invalid character, e.g. non-ASCII character used but no Specific Character Set defined +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_InvalidCharacter; +/// Illegal element with OB or OW Value Representation and undefined length encountered +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_UndefinedLengthOBOW; +/// Illegal VOI LUT Sequence element with OB or OW Value Representation and explicit length encountered +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_VOI_LUT_OBOW; +/// Pixel data in top level dataset in compressed Transfer Syntax uses explicit length (undefined required) +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_PixelDataExplLengthIllegal; +/// Element length is larger than 32-bit length field permits +extern DCMTK_DCMDATA_EXPORT const OFConditionConst EC_ElemLengthExceeds32BitField; +//@} + +// status code constants + +/// error, cannot select specific character set +extern DCMTK_DCMDATA_EXPORT const unsigned short EC_CODE_CannotSelectCharacterSet; +/// error, cannot convert specific character set +extern DCMTK_DCMDATA_EXPORT const unsigned short EC_CODE_CannotConvertCharacterSet; +/// error, cannot convert to XML +extern DCMTK_DCMDATA_EXPORT const unsigned short EC_CODE_CannotConvertToXML; +/// error, cannot determine start fragment (of compressed pixel data) +extern DCMTK_DCMDATA_EXPORT const unsigned short EC_CODE_CannotDetermineStartFragment; + +#endif /* !DCERROR_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dcfcache.h b/dcmdata/include/dcmtk/dcmdata/dcfcache.h new file mode 100644 index 00000000..f8fe3d54 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcfcache.h @@ -0,0 +1,111 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: file cache facility for DcmElement::getPartialValue + * + */ + +#ifndef DCFCACHE_H +#define DCFCACHE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/offile.h" /* for offile_off_t */ +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ + +/** This class implements a simple container that stores an input stream, + * the position of that input stream corresponding to the start of a DICOM + * element value field contained in the stream and the current "owner" object. + * It is used to keep a single file handle open during multiple calls to + * DcmElement::getPartialValue(), thus speeding up the reading. + */ +class DCMTK_DCMDATA_EXPORT DcmFileCache +{ +public: + + /// default constructor + DcmFileCache() + : stream_(NULL) + , offset_(0) + , user_(NULL) + { + } + + /// destructor + ~DcmFileCache() + { + delete stream_; + } + + /** checks if the given object is the current user of this cache + * returns true if so, false otherwise + * @param object pointer to "user object" + */ + OFBool isUser(void *object) const + { + return object == user_; + } + + /// returns object to default constructed state + void clear() + { + delete stream_; + stream_ = NULL; + offset_ = 0; + user_ = NULL; + } + + /** initializes the file cache with the given stream object + * and user. + * @param stream stream object + * @param user user object + */ + void init(DcmInputStream *stream, void *user) + { + clear(); + stream_ = stream; + user_ = user; + if (stream_) offset_ = stream_->tell(); + } + + /// return input stream + DcmInputStream *getStream() + { + return stream_; + } + + /// return initial stream offset + offile_off_t getOffset() const { return offset_; } + +private: + + /// private undefined copy constructor + DcmFileCache(const DcmFileCache& arg); + + /// private undefined copy assignment operator + DcmFileCache& operator=(const DcmFileCache& arg); + + /// input stream, may be NULL + DcmInputStream *stream_; + + /// offset within stream for initial position + offile_off_t offset_; + + /// object that currently uses the file cache, i.e. has created the stream + const void *user_; +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcfilefo.h b/dcmdata/include/dcmtk/dcmdata/dcfilefo.h new file mode 100644 index 00000000..c8338364 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcfilefo.h @@ -0,0 +1,510 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmFileFormat + * + */ + + +#ifndef DCFILEFO_H +#define DCFILEFO_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcdatset.h" + + +// forward declarations +class DcmMetaInfo; +class DcmJsonFormat; +class DcmInputStream; +class DcmOutputStream; +class DcmRepresentationParameter; + + +/** a class handling the DICOM file format (with meta header) + */ +class DCMTK_DCMDATA_EXPORT DcmFileFormat + : public DcmSequenceOfItems +{ + + public: + + /** default constructor + */ + DcmFileFormat(); + + /** constructor taking an existing dataset for initialization. Depending on the + * parameters, a deep or shallow copy is performed. + * @param dataset the dataset to be inserted into the new DcmFileFormat object. If NULL, + * an empty dataset is created and inserted instead. + * @param deepCopy If OFTrue (default), a deep copy of the dataset is performed. + * Otherwise only the pointer is copied and the ownership + * of the dataset is taken over by the DcmFileFormat object. + */ + DcmFileFormat(DcmDataset *dataset, + OFBool deepCopy = OFTrue); + + /** copy constructor + * @param old element to be copied + */ + DcmFileFormat(const DcmFileFormat &old); + + /** destructor + */ + virtual ~DcmFileFormat(); + + /** assignment operator + * @param obj fileformat to be assigned/copied + * @return reference to this object + */ + DcmFileFormat &operator=(const DcmFileFormat &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmFileFormat(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get type identifier + * @return type identifier of this class (EVR_fileFormat) + */ + virtual DcmEVR ident() const; + + /** clear file meta information header and dataset + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear(); + + /** remove all elements with an invalid group number from the meta information header + * and dataset + */ + virtual void removeInvalidGroups(); + + /** print meta header and dataset to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName optional filename used to write the raw pixel data file + * @param pixelCounter optional counter used for automatic pixel data filename creation + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** make sure that all data elements of the file meta information header are existent + * in metainfo and contain correct values. + * @param oxfer the transfer syntax which shall be used + * @param writeMode flag indicating whether to update the file meta information or not + * @return EC_Normal if valid, an error code otherwise + */ + virtual OFCondition validateMetaInfo(const E_TransferSyntax oxfer, + const E_FileWriteMode writeMode = EWM_fileformat); + + /** get file meta information header part of the fileformat + * @return reference to internally stored file meta information header + */ + DcmMetaInfo *getMetaInfo(); + + /** get dataset part of the fileformat + * @return reference to internally stored dataset + */ + DcmDataset *getDataset(); + + /** get dataset part and remove it from the fileformat. + * Please note that a new, initially empty dataset is also added to the fileformat. + * @return reference to previously stored but now removed dataset + */ + DcmDataset *getAndRemoveDataset(); + + /** @copydoc DcmObject::calcElementLength() + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** check if this DICOM object can be encoded in the given transfer syntax. + * @param newXfer transfer syntax in which the DICOM object is to be encoded + * @param oldXfer transfer syntax in which the DICOM object was read or created. + * @return true if object can be encoded in desired transfer syntax, false otherwise. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer = EXS_Unknown); + + /** read object from a stream. + * @param inStream DICOM input stream + * @param xfer transfer syntax to use when parsing + * @param glenc handling of group length parameters + * @param maxReadLength attribute values larger than this value are skipped + * while parsing and read later upon first access if the stream type supports + * this. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax xfer = EXS_Unknown, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** read object from a stream, up to the attribute tag stopParsingAtElement. + * @param inStream DICOM input stream + * @param xfer transfer syntax to use when parsing + * @param glenc handling of group length parameters + * @param maxReadLength attribute values larger than this value are skipped + * while parsing and read later upon first access if the stream type supports + * this. + * @param stopParsingAtElement parsing of the input stream is stopped when + * this tag key or any higher tag is encountered. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readUntilTag(DcmInputStream &inStream, + const E_TransferSyntax xfer = EXS_Unknown, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength, + const DcmTagKey &stopParsingAtElement = DCM_UndefinedTagKey); + + /** write fileformat to a stream + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object to a stream (abstract) + * @param outStream DICOM output stream + * @param oxfer output transfer syntax (EXS_Unknown means use original) + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @param glenc group length encoding + * @param padenc dataset trailing padding encoding + * @param padlen padding structure size for complete file + * @param subPadlen padding structure set for sequence items + * @param instanceLength number of extra bytes added to the item/dataset + * length used when computing the padding. This parameter is for instance + * used to pass the length of the file meta information header from the + * DcmFileFormat to the DcmDataset object. + * @param writeMode write file with or without meta header. Also allows for + * updating the information in the file meta information header. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache, + const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc = EPD_noChange, + const Uint32 padlen = 0, + const Uint32 subPadlen = 0, + Uint32 instanceLength = 0, + const E_FileWriteMode writeMode = EWM_fileformat); + + /** write object in XML format. + * The XML declaration (e.g. ) is not written by this function. + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format. + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** write object in JSON format. + * @tparam Format the formatter class, e.g. DcmJsonFormatPretty. + * Will be deduced automatically. + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + template + OFCondition writeJson(STD_NAMESPACE ostream &out, + Format format) + { + return writeJson(out, OFstatic_cast(DcmJsonFormat&, format)); + } + + /** load object from a DICOM file. + * This method supports DICOM objects stored as a file (with meta header) or as a + * dataset (without meta header). By default, the presence of a meta header is + * detected automatically. + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @param groupLength flag, specifying how to handle the group length tags + * @param maxReadLength maximum number of bytes to be read for an element value. + * Element values with a larger size are not loaded until their value is retrieved + * (with getXXX()) or loadAllDataIntoMemory() is called. + * @param readMode read file with or without meta header, i.e. as a fileformat or a + * dataset. Use ERM_fileOnly in order to force the presence of a meta header. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFile(const OFFilename &fileName, + const E_TransferSyntax readXfer = EXS_Unknown, + const E_GrpLenEncoding groupLength = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength, + const E_FileReadMode readMode = ERM_autoDetect); + + /** load object from a DICOM file, up to the attribute tag stopParsingAtElement. + * This method supports DICOM objects stored as a file (with meta header) or as a + * dataset (without meta header). By default, the presence of a meta header is + * detected automatically. + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @param groupLength flag, specifying how to handle the group length tags + * @param maxReadLength maximum number of bytes to be read for an element value. + * Element values with a larger size are not loaded until their value is retrieved + * (with getXXX()) or loadAllDataIntoMemory() is called. + * @param readMode read file with or without meta header, i.e. as a fileformat or a + * dataset. Use ERM_fileOnly in order to force the presence of a meta header. + * @param stopParsingAtElement parsing of the input stream is stopped when + * this tag key or any higher tag is encountered. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFileUntilTag(const OFFilename &fileName, + const E_TransferSyntax readXfer = EXS_Unknown, + const E_GrpLenEncoding groupLength = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength, + const E_FileReadMode readMode = ERM_autoDetect, + const DcmTagKey &stopParsingAtElement = DCM_UndefinedTagKey); + + /** save object to a DICOM file. + * @param fileName name of the file to save (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param writeXfer transfer syntax used to write the data (EXS_Unknown means use original) + * @param encodingType flag, specifying the encoding with undefined or explicit length + * @param groupLength flag, specifying how to handle the group length tags + * @param padEncoding flag, specifying how to handle the padding tags + * @param padLength number of bytes used for the dataset padding (has to be an even number) + * @param subPadLength number of bytes used for the item padding (has to be an even number) + * @param writeMode write file with or without meta header. Also allows for updating the + * information in the file meta information header. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition saveFile(const OFFilename &fileName, + const E_TransferSyntax writeXfer = EXS_Unknown, + const E_EncodingType encodingType = EET_UndefinedLength, + const E_GrpLenEncoding groupLength = EGL_recalcGL, + const E_PaddingEncoding padEncoding = EPD_noChange, + const Uint32 padLength = 0, + const Uint32 subPadLength = 0, + const E_FileWriteMode writeMode = EWM_fileformat); + + // methods for different pixel representations + + /** select a specific representation (compressed or uncompressed) of the dataset + * and create the representation if needed. This may cause compression or decompression + * to be applied to the pixel data in the dataset. + * @param repType desired transfer syntax + * @param repParam desired representation parameter (e.g. quality factor for lossy compression) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition chooseRepresentation(const E_TransferSyntax repType, + const DcmRepresentationParameter *repParam) + { + return getDataset()->chooseRepresentation(repType, repParam); + } + + /** check if all PixelData elements in this dataset have a representation conforming + * to the given transfer syntax and representation parameters (see dcpixel.h for + * definition of "conforming"). + * @param repType desired transfer syntax + * @param repParam desired representation parameter (e.g. quality factor for lossy compression) + * @return true if all pixel elements have the desired representation, false otherwise + */ + OFBool hasRepresentation(const E_TransferSyntax repType, + const DcmRepresentationParameter *repParam) + { + return getDataset()->hasRepresentation(repType, repParam); + } + + /** removes all but the original representation in all pixel data elements + */ + void removeAllButOriginalRepresentations() + { + getDataset()->removeAllButOriginalRepresentations(); + } + + /** removes all but the current representation in all pixel data elements. + * Makes the current representation original. + */ + void removeAllButCurrentRepresentations() + { + getDataset()->removeAllButCurrentRepresentations(); + } + + /** get current file read mode. This mode specifies whether a file is read as a + * fileformat or dataset (without meta header). In addition, the reading can be + * restricted to DICOM files only. + * @return file read mode + */ + E_FileReadMode getReadMode() const + { + return FileReadMode; + } + + /** set current file read mode. This mode specifies whether a file is read as a + * fileformat or dataset (without meta header). In addition, the reading can be + * restricted to DICOM files only. + * @param readMode file read mode to be set + */ + void setReadMode(const E_FileReadMode readMode) + { + FileReadMode = readMode; + } + + /** method inherited from base class that shall not be used for instances of this class. + * Method immediately returns with error code. + * @param item item + * @param where where + * @return always returns EC_IllegalCall. + */ + virtual OFCondition insertItem(DcmItem *item, const unsigned long where = DCM_EndOfListIndex); + + /** method inherited from base class that shall not be used for instances of this class. + * Method immediately returns. + * @param num num + * @return always returns NULL. + */ + virtual DcmItem *remove(const unsigned long num); + + /** method inherited from base class that shall not be used for instances of this class. + * Method immediately returns. + * @param item item + * @return always returns NULL. + */ + virtual DcmItem *remove(DcmItem *item); + + /** convert all element values that are contained in the dataset and that are affected + * by SpecificCharacterSet from the given source character set to the given + * destination character set. The defined terms for a particular character set can + * be found in the DICOM standard, e.g. "ISO_IR 100" for ISO 8859-1 (Latin 1) or + * "ISO_IR 192" for Unicode in UTF-8. An empty string denotes the default character + * repertoire, which is ASCII (7-bit). If multiple values are given for 'fromCharset' + * (separated by a backslash) code extension techniques are used and escape sequences + * may be encountered in the source string to switch between the specified character + * sets. + * @param fromCharset name of the source character set(s) used for the conversion + * @param toCharset name of the destination character set used for the conversion. + * Only a single value is permitted (i.e. no code extensions). + * @param flags optional flag used to customize the conversion (see DCMTypes::CF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(const OFString &fromCharset, + const OFString &toCharset, + const size_t flags = 0); + + /** convert all element values that are contained in the dataset and that are affected + * by SpecificCharacterSet to the given destination character set. The source + * character set is determined automatically from the value of the + * SpecificCharacterSet (0008,0005) element. The defined terms for the destination + * character set can be found in the DICOM standard, e.g. "ISO_IR 100" for ISO 8859-1 + * (Latin 1) or "ISO_IR 192" for Unicode in UTF-8. An empty string denotes the + * default character repertoire, which is ASCII (7-bit). + * NB: In case of a DICOMDIR, the SpecificCharacterSet in the main dataset is neither + * checked nor updated, since the Basic Directory IOD has no SOP Common Module. + * @param toCharset name of the destination character set used for the conversion. + * Only a single value is permitted (i.e. no code extensions). + * @param flags optional flag used to customize the conversion (see DCMTypes::CF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(const OFString &toCharset, + const size_t flags = 0); + + /** convert all element values that are contained in the dataset and that are affected + * by SpecificCharacterSet from the currently selected source character set to the + * currently selected destination character set + * @param converter character set converter to be used to convert the element values + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(DcmSpecificCharacterSet &converter); + + /** convert all element values that are contained in the dataset and that are + * affected by SpecificCharacterSet to UTF-8 (Unicode). The value of the + * SpecificCharacterSet (0008,0005) element is updated, set or deleted automatically + * if needed. The transliteration mode is disabled, i.e. the conversion flags are + * explicitly set to 0 - see convertCharacterSet(). + * NB: In case of a DICOMDIR, the SpecificCharacterSet in the main dataset is neither + * checked nor updated, since the Basic Directory IOD has no SOP Common Module. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertToUTF8(); + + private: + + /** This function checks if a particular data element of the file meta information header is + * existent. If the element is not existent, it will be inserted. Additionally, this function + * makes sure that the corresponding data element will contain a correct value. + * @param metainfo the meta header information + * @param dataset the data set information + * @param atagkey tag of the data element which shall be checked + * @param obj data object from metainfo which represents the data element that shall be checked. + * Equals NULL if this data element is not existent in the meta header information. + * @param oxfer The transfer syntax which shall be used. + * @param writeMode flag indicating whether to update the file meta information or not + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition checkMetaHeaderValue(DcmMetaInfo *metainfo, + DcmDataset *dataset, + const DcmTagKey &atagkey, + DcmObject *obj, + const E_TransferSyntax oxfer, + const E_FileWriteMode writeMode); + + /** read DCM_TransferSyntaxUID from meta header dataset and return as E_TransferSyntax value + * @param metainfo meta-header dataset + * @return E_TransferSyntax value for DCM_TransferSyntaxUID, EXS_Unknown if not found or unknown + */ + static E_TransferSyntax lookForXfer(DcmMetaInfo *metainfo); + + /// file read mode, specifies whether to read the meta header or not + E_FileReadMode FileReadMode; +}; + + +#endif // DCFILEFO_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcfilter.h b/dcmdata/include/dcmtk/dcmdata/dcfilter.h new file mode 100644 index 00000000..07d31471 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcfilter.h @@ -0,0 +1,209 @@ +/* + * + * Copyright (C) 2012-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Jan Schlamelcher + * + * Purpose: Class for filtering DcmItem objects regarding specific attributes. + * + */ + + +#ifndef DCFILTER_H +#define DCFILTER_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofalgo.h" +#include "dcmtk/dcmdata/dcfilefo.h" + + +/** Accept or reject DcmItem objects by comparing a specific attribute to a set of values. + * DcmAttributeFilter objects can be used to compare a specific attribute with one or more + * values - or to accept any DcmItem if no attribute is specified. DcmAttributeFilter + * objects can be used like any function taking a DcmItem& or a DcmFileFormat& object as + * parameter and returning a boolean value. + */ +class DCMTK_DCMDATA_EXPORT DcmAttributeFilter +{ + /// all actual filter implementations must inherit this interface. + struct FilterInterface + { + /// enable virtual destructor. + virtual inline ~FilterInterface() {} + + /** apply the actual filter. + * @param value the value to be compared with the range of values. + * @return OFTrue if value matches one element in the range of values, + * OFFalse otherwise. + */ + virtual OFBool apply( const OFString& value ) = 0; + }; + + /** A range-based filter implementation that compares an attribute's value with a + * range of values defined by two iterators. + * @tparam Iterator a type matching the STL's ForwardIterator concept. + */ + template + class IteratorBasedFilter : public FilterInterface + { + public: + /** construct an IteratorBasedFilter object from two iterators. + * @param begin an iterator referring to the first element in the range of values. + * @param end an iterator referring to one past the end in the range of values. + */ + IteratorBasedFilter( const Iterator& begin, const Iterator& end ) + : m_Begin( begin ), m_End( end ) + { + + } + + /// @copydoc FilterInterface::apply + virtual OFBool apply( const OFString& value ) + { + return OFFind( Iterator, const OFString&, m_Begin, m_End, value ) != m_End; + } + + private: + /// disable copy constructor. + IteratorBasedFilter(const IteratorBasedFilter&); + + /// disable copy assignment. + IteratorBasedFilter& operator=(const IteratorBasedFilter&); + + /// an iterator referring to the first element in the range of values. + Iterator const m_Begin; + + /// an iterator referring to one past the end in the range of values. + Iterator const m_End; + }; + + /** helper function to deduce the Iterator type from a container's begin() and end() + * method. + * @tparam Iterator a type matching the STL's ForwardIterator concept. + * @param begin an iterator referring to the first element in the range of values. + * @param end an iterator referring to one past the end in the range of values. + * @return a pointer to a newly created IteratorBasedFilter object. + */ + template + static IteratorBasedFilter* createIteratorBasedFilter( const Iterator& begin, + const Iterator& end ) + { + return new IteratorBasedFilter( begin, end ); + } + +public: + /** construct a DcmAttributeFilter object from two iterators defining the range of + * values. + * @note each value should be comparable with an object of type OFString. + * @tparam Iterator a type matching the STL's ForwardIterator concept. + * @param tag a DcmTagKey object determining which attribute of a DcmItem should be + * compared with the range of values. + * @param begin an iterator referring to the first element in the range of values. + * @param end an iterator referring to one past the end in the range of values. + */ + template + DcmAttributeFilter( const DcmTagKey& tag, const Iterator& begin, const Iterator& end ) + : m_Tag( tag ) + , m_pFilter( createIteratorBasedFilter( begin, end ) ) + { + + } + + /** construct a DcmAttributeFilter object from a container containing the range of + * values. + * @note each value should be comparable with an object of type OFString. + * @tparam Container a class matching the STL's Container concept. + * @param tag a DcmTagKey object determining which attribute of a DcmItem should be + * compared with the range of values. + * @param container a container containing the range of values. + */ + template + DcmAttributeFilter( const DcmTagKey& tag, const Container& container ) + : m_Tag( tag ) + , m_pFilter( createIteratorBasedFilter( container.begin(), container.end() ) ) + { + + } + + /// construct a DcmAttributeFilter object that accepts any DcmItem. + DcmAttributeFilter(); + + /** construct a DcmAttributeFilter object that compares the attribute with one + * specific value. + * @param tag a DcmTagKey object determining which attribute of a DcmItem should be + * compared with the value. + * @param value an OFString that is to be compared with the actual value stored in + * the DcmItem the filter is invoked on. + * + */ + DcmAttributeFilter( const DcmTagKey& tag, const OFString& value ); + + /** construct a DcmAttributeFilter object that compares the attribute with one + * specific value. + * @param tag a DcmTagKey object determining which attribute of a DcmItem should + * be compared with the value. + * @param value a character string that is to be compared with the actual value + * stored in the DcmItem the filter is invoked on. + */ + DcmAttributeFilter( const DcmTagKey& tag, const char* const value ); + + /// free all resources used by this object. + ~DcmAttributeFilter(); + + /** apply the filter on a DcmItem. + * @param item a DcmItem the filter should accept or reject. + * @return OFTrue if the filter accepts the item, OFFalse otherwise. + */ + OFBool apply( DcmItem& item ) const; + + /** convenience function to enable using DcmAttributeFilter as a functor. + * @param item a DcmItem the filter should accept or reject. + * @return OFTrue if the filter accepts the item, OFFalse otherwise. + */ + OFBool operator()( DcmItem& item ) const; + + /** apply the filter on a DICOM file (represented by a DcmFileFormat instance). + * @param dcmfile a DcmFileFormat object the filter should accept or reject. + * @return OFTrue if the filter accepts the DICOM file, OFFalse otherwise. + */ + OFBool apply( DcmFileFormat& dcmfile ) const; + + /** convenience function to enable using DcmAttributeFilter as a functor. + * @param dcmfile a DcmFileFormat object the filter should accept or reject. + * @return OFTrue if the filter accepts the DICOM file, OFFalse otherwise. + */ + OFBool operator()( DcmFileFormat& dcmfile ) const; + +private: + /// Helper class for storing single values in a DcmAttributeFilter. + class SingleValueFilter; + + // disable copy constructor. + DcmAttributeFilter( const DcmAttributeFilter& ); + + // disable copy assignment. + DcmAttributeFilter& operator=( const DcmAttributeFilter& ); + + /** a DcmTagKey object determining which attribute of a DcmItem should be compared + * with the value. + */ + const DcmTagKey m_Tag; + + /// a pointer to the actual filter. + FilterInterface* const m_pFilter; +}; + +#endif // DCFILTER_H diff --git a/dcmdata/include/dcmtk/dcmdata/dchashdi.h b/dcmdata/include/dcmtk/dcmdata/dchashdi.h new file mode 100644 index 00000000..081feca3 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dchashdi.h @@ -0,0 +1,304 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Hash table interface for DICOM data dictionary + * + */ + +#ifndef DCHASHDI_H +#define DCHASHDI_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcdefine.h" + +class DcmDictEntry; +class DcmTagKey; +class DcmHashDict; + +typedef OFListIterator(DcmDictEntry *) DcmDictEntryListIterator; +typedef OFListConstIterator(DcmDictEntry *) DcmDictEntryListConstIterator; + +/** an ordered list of pointers to DcmDictEntry objects + */ +class DCMTK_DCMDATA_EXPORT DcmDictEntryList +{ +public: + + /// constructor + DcmDictEntryList() : list_() {} + + /// destructor + ~DcmDictEntryList(); + + /// clears list and deletes all entries + void clear(); + + /// @return the number of elements in this list + unsigned int size() const; + + /// @return True if this list is empty + OFBool empty() const; + + /// @return Iterator to the beginning of the list + DcmDictEntryListIterator begin(); + + /// @return Iterator past the end of the list + DcmDictEntryListIterator end(); + + /// @return Iterator to the beginning of the list + DcmDictEntryListConstIterator begin() const; + + /// @return Iterator past the end of the list + DcmDictEntryListConstIterator end() const; + + /** Insert a new element in the list + * @param position Position to insert after + * @param entry Entry to insert + * @return Iterator to the new entry + */ + DcmDictEntryListIterator insert(DcmDictEntryListIterator position, DcmDictEntry *entry); + + /** Remove an element from the list. + * @param entry The entry to remove + */ + void remove(DcmDictEntry *entry); + + /** Append a new entry to the list. + * @param entry The entry to append. + */ + void push_back(DcmDictEntry *entry); + + /** inserts an entry into the list and returns any replaced entry + * @param entry new list entry + * @return replaced list entry or NULL + */ + DcmDictEntry* insertAndReplace(DcmDictEntry* entry); + + /** find an entry in the set + * @param key tag key of the entry to be searched for + * @param privCreator private creator name, may be NULL + * @return pointer to entry (if found), otherwise NULL + */ + DcmDictEntry *find(const DcmTagKey& key, const char *privCreator); + +private: + + /// private undefined copy constructor + DcmDictEntryList(const DcmDictEntryList&); + + /// private undefined copy assignment operator + DcmDictEntryList& operator=(const DcmDictEntryList&); + + /// list of entries + OFList list_; +}; + + +/** iterator class for traversing a DcmHashDict + */ +class DCMTK_DCMDATA_EXPORT DcmHashDictIterator +{ +public: + + /// default constructor + DcmHashDictIterator() + : dict(NULL), hindex(0), iterating(OFFalse), iter() + { init(NULL); } + + /** constructor, creates iterator to existing hash dictionary + * @param d pointer to dictionary + * @param atEnd if true, iterator points after last element + * of hash dictionary, otherwise iterator points to first element + */ + DcmHashDictIterator(const DcmHashDict* d, OFBool atEnd = OFFalse) + : dict(NULL), hindex(0), iterating(OFFalse), iter() + { init(d, atEnd); } + + /// copy constructor + DcmHashDictIterator(const DcmHashDictIterator& i) + : dict(i.dict), hindex(i.hindex), iterating(i.iterating), iter(i.iter) + { } + + /// copy assignment operator + DcmHashDictIterator& operator=(const DcmHashDictIterator& i) + { dict = i.dict; hindex = i.hindex; + iterating = i.iterating; iter = i.iter; return *this; } + + /// comparison equality + OFBool operator==(const DcmHashDictIterator& x) const + { return iterating ? x.iterating && (hindex == x.hindex) && (iter == x.iter) : !x.iterating; } + + /// comparison non-equality + OFBool operator!=(const DcmHashDictIterator& x) const + { return !(*this == x); } + + /// dereferencing of iterator + const DcmDictEntry* operator*() const + { return (*iter); } + + /// pre-increment operator + DcmHashDictIterator& operator++() + { stepUp(); return *this; } + + /// post-increment operator + DcmHashDictIterator operator++(int) + { DcmHashDictIterator tmp(*this); stepUp(); return tmp; } + +private: + + /** initializes the iterator + * @param d pointer to hash dictionary, may be NULL + * @param atEnd if true, iterator points after last element + * of hash dictionary, otherwise iterator points to first element + */ + void init(const DcmHashDict *d, OFBool atEnd = OFFalse); + + /** implements increment operator on hash dictionary + */ + void stepUp(); + + /// pointer to the hash dictionary this iterator traverses + const DcmHashDict* dict; + + /// index of current bucket + int hindex; + + /// flag indicating if iter is currently valid + OFBool iterating; + + /// iterator for traversing a bucket in the hash table + DcmDictEntryListIterator iter; +}; + + +/** a hash table of pointers to DcmDictEntry objects + */ +class DCMTK_DCMDATA_EXPORT DcmHashDict +{ + +public: + /// default constructor + DcmHashDict() + : hashTab(NULL), lowestBucket(0), highestBucket(0), entryCount(0) + { _init(); } + + /// destructor + ~DcmHashDict(); + + /** counts total number of entries + * @return number of entries + */ + int size() const { return entryCount; } + + /// clears the hash table of all entries + void clear(); + + /** inserts an entry into hash table (deletes old entry if present) + * @param entry pointer to new entry + */ + void put(DcmDictEntry* entry); + + /** hash table lookup for the given tag key and private creator name + * @param key tag key of the entry to be searched for + * @param privCreator private creator name, may be NULL + * @return pointer to entry (if found), otherwise NULL + */ + const DcmDictEntry* get(const DcmTagKey& key, const char *privCreator) const; + + /** deletes the entry for the given tag and private creator + * @param key tag key of the entry to be deleted + * @param privCreator private creator name, may be NULL + */ + void del(const DcmTagKey& key, const char *privCreator); + + // iterator over the contents of the hash table + friend class DcmHashDictIterator; + + /// returns iterator to start of hash table + DcmHashDictIterator begin() const + { DcmHashDictIterator iter(this); return iter; } + + /// returns iterator to end of hash table + DcmHashDictIterator end() const + { DcmHashDictIterator iter(this, OFTrue); return iter; } + + /// prints some information about hash table bucket utilization + STD_NAMESPACE ostream& loadSummary(STD_NAMESPACE ostream& out); + +private: + + /// private unimplemented copy constructor + DcmHashDict(const DcmHashDict &); + + /// private unimplemented copy assignment operator + DcmHashDict &operator=(const DcmHashDict &); + + /// performs initialization for given hash table size, called from constructor + void _init(); + + /** compute hash value for given tag key + * @param key pointer to tag key + * @param privCreator private creator name, may be NULL + * @return hash value + */ + int hash(const DcmTagKey* key, const char *privCreator) const; + + /** inserts new entry into given list + * @param lst list to add to + * @param entry new element to add, will be deleted upon destruction of the hash table + * @return pointer to replaced element, if any + */ + DcmDictEntry* insertInList(DcmDictEntryList& lst, DcmDictEntry* entry); + + /** removes the entry for the given tag and private creator + * @param lst list to remove from + * @param key tag key of the entry to be removed + * @param privCreator private creator name, may be NULL + * @return pointer to removed element, if any + */ + DcmDictEntry* removeInList(DcmDictEntryList& lst, const DcmTagKey& key, const char *privCreator); + + /** searches entry for the given tag and private creator + * @param lst list to search in + * @param key tag key of the entry to be searched for + * @param privCreator private creator name, may be NULL + * @return pointer to found element, NULL if not found + */ + DcmDictEntry* findInList(DcmDictEntryList& lst, const DcmTagKey& key, const char *privCreator) const; + + /** array of (hash table size) pointers to DcmDictEntryList elements + * implementing the different buckets of the hash table + */ + DcmDictEntryList** hashTab; + + /// number of buckets in hash table + static const int hashTabLength; + + /// index of lowest bucket for which the DcmDictEntryList has been initialized + int lowestBucket; + + /// index of highest bucket for which the DcmDictEntryList has been initialized + int highestBucket; + + /// number of entries in hash table + int entryCount; + +}; + +#endif /* DCHASHDI_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dcistrma.h b/dcmdata/include/dcmtk/dcmdata/dcistrma.h new file mode 100644 index 00000000..f9ce25b9 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcistrma.h @@ -0,0 +1,279 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: base classes for input streams + * + */ + +#ifndef DCISTRMA_H +#define DCISTRMA_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/ofstd/ofcond.h" /* for OFCondition */ +#include "dcmtk/ofstd/offile.h" /* for offile_off_t */ +#include "dcmtk/dcmdata/dcxfer.h" /* for E_StreamCompression */ + +class DcmInputStream; + +/** pure virtual abstract base class for producers, i.e. the initial node + * of a filter chain in an input stream. + */ +class DCMTK_DCMDATA_EXPORT DcmProducer +{ +public: + + /// destructor + virtual ~DcmProducer() + { + } + + /** returns the status of the producer. Unless the status is good, + * the producer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const = 0; + + /** returns the status of the producer as an OFCondition object. + * Unless the status is good, the producer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const = 0; + + /** returns true if the producer is at the end of stream. + * @return true if end of stream, false otherwise + */ + virtual OFBool eos() = 0; + + /** returns the minimum number of bytes that can be read with the + * next call to read(). The DcmObject read methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only read "en bloc", i.e. all + * or nothing. + * @return minimum of data available in producer + */ + virtual offile_off_t avail() = 0; + + /** reads as many bytes as possible into the given block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually read. + */ + virtual offile_off_t read(void *buf, offile_off_t buflen) = 0; + + /** skips over the given number of bytes (or less) + * @param skiplen number of bytes to skip + * @return number of bytes actually skipped. + */ + virtual offile_off_t skip(offile_off_t skiplen) = 0; + + /** resets the stream to the position by the given number of bytes. + * @param num number of bytes to putback. If the putback operation + * fails, the producer status becomes bad. + */ + virtual void putback(offile_off_t num) = 0; + +}; + + +/** pure virtual abstract base class for input filters, i.e. + * intermediate nodes of a filter chain in an input stream. + */ +class DCMTK_DCMDATA_EXPORT DcmInputFilter: public DcmProducer +{ +public: + + /// destructor + virtual ~DcmInputFilter() + { + } + + /** determines the producer from which the filter is supposed + * to read it's input. Once a producer for the input filter has + * been defined, it cannot be changed anymore during the lifetime + * of the object. + * @param producer reference to producer, must not be circular chain + */ + virtual void append(DcmProducer& producer) = 0; +}; + +/** this enum identifies subclasses of class DcmInputStreamFactory. + */ +enum DcmInputStreamFactoryType +{ + /// class DcmInputFileStreamFactory + DFT_DcmInputFileStreamFactory, + + /// class DcmInputTempFileStreamFactory + DFT_DcmInputTempFileStreamFactory +}; + +/** pure virtual abstract base class for input stream factories, + * i.e. objects that can create a new input stream + */ +class DCMTK_DCMDATA_EXPORT DcmInputStreamFactory +{ +public: + + /// destructor + virtual ~DcmInputStreamFactory() + { + } + + /** create a new input stream object + * @return pointer to new input stream object + */ + virtual DcmInputStream *create() const = 0; + + /** returns a pointer to a copy of this object + * @return pointer to a copy of this object + */ + virtual DcmInputStreamFactory *clone() const = 0; + + /** returns an enum describing the class to which this instance belongs + * @return class to which this instance belongs + */ + virtual DcmInputStreamFactoryType ident() const = 0; +}; + + +/** abstract base class for input streams. + */ +class DCMTK_DCMDATA_EXPORT DcmInputStream +{ +public: + + /// destructor + virtual ~DcmInputStream(); + + /** returns the status of the stream. Unless the status is good, + * the stream will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the stream as an OFCondition object. + * Unless the status is good, the stream will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the producer is at the end of stream. + * @return true if end of stream, false otherwise + */ + virtual OFBool eos(); + + /** returns the minimum number of bytes that can be read with the + * next call to read(). The DcmObject read methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only read "en bloc", i.e. all + * or nothing. + * @return minimum of data available in producer + */ + virtual offile_off_t avail(); + + /** reads as many bytes as possible into the given block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually read. + */ + virtual offile_off_t read(void *buf, offile_off_t buflen); + + /** skips over the given number of bytes (or less) + * @param skiplen number of bytes to skip + * @return number of bytes actually skipped. + */ + virtual offile_off_t skip(offile_off_t skiplen); + + /** returns the total number of bytes read from the stream so far + * @return total number of bytes read from the stream + */ + virtual offile_off_t tell() const; + + /** installs a compression filter for the given stream compression type, + * which should be neither ESC_none nor ESC_unsupported. Once a compression + * filter is active, it cannot be deactivated or replaced during the + * lifetime of the stream. + * @param filterType type of compression filter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition installCompressionFilter(E_StreamCompression filterType); + + /** creates a new factory object for the current stream + * and stream position. When activated, the factory will be + * able to create new DcmInputStream delivering the same + * data as the current stream. Used to defer loading of + * value fields until accessed. + * If no factory object can be created (e.g. because the + * stream is not seekable), returns NULL. + * @return pointer to new factory object if successful, NULL otherwise. + */ + virtual DcmInputStreamFactory *newFactory() const = 0; + + /** marks the current stream position for a later putback operation, + * overwriting a possibly existing prior putback mark. + * The DcmObject read methods rely on the possibility to putback + * up to 132 bytes for transfer syntax detection, parse error recovery etc. + * Implementations of this class should guarantee a putback capability + * of at least 1 kbyte. + */ + virtual void mark(); + + /** resets the stream to the position previously marked with + * setPutbackMark(). If the putback operation fails (no putback mark + * set or putback buffer exceeded), status of the producer switches to bad. + */ + virtual void putback(); + +protected: + + /** protected constructor, to be called from derived class constructor + * @param initial initial pointer to first node in filter chain + * The pointer is not dereferenced in the constructor, so the + * object pointed to may be initialized later in the subclass + * constructor. + */ + DcmInputStream(DcmProducer *initial); + + /** returns pointer to current producer object + */ + const DcmProducer *currentProducer() const; + +private: + + /// private unimplemented copy constructor + DcmInputStream(const DcmInputStream&); + + /// private unimplemented copy assignment operator + DcmInputStream& operator=(const DcmInputStream&); + + /// pointer to first node in filter chain + DcmProducer *current_; + + /// pointer to compression filter, NULL if no compression + DcmInputFilter *compressionFilter_; + + /// counter for number of bytes read so far + offile_off_t tell_; + + /// putback marker + offile_off_t mark_; +}; + + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcistrmb.h b/dcmdata/include/dcmtk/dcmdata/dcistrmb.h new file mode 100644 index 00000000..f9cf0b5f --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcistrmb.h @@ -0,0 +1,201 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmInputBufferStream and related classes, + * implements input to blocks of memory as needed in the dcmnet module. + * + */ + +#ifndef DCISTRMB_H +#define DCISTRMB_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcistrma.h" + + +/** producer class that reads data from a buffer provided by the caller. + * Used for DICOM network communication. + */ +class DCMTK_DCMDATA_EXPORT DcmBufferProducer: public DcmProducer +{ +public: + /** constructor + */ + DcmBufferProducer(); + + /// destructor + virtual ~DcmBufferProducer(); + + /** returns the status of the producer. Unless the status is good, + * the producer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the producer as an OFCondition object. + * Unless the status is good, the producer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the producer is at the end of stream. + * @return true if end of stream, false otherwise + */ + virtual OFBool eos(); + + /** returns the minimum number of bytes that can be read with the + * next call to read(). The DcmObject read methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only read "en bloc", i.e. all + * or nothing. + * @return minimum of data available in producer + */ + virtual offile_off_t avail(); + + /** reads as many bytes as possible into the given block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually read. + */ + virtual offile_off_t read(void *buf, offile_off_t buflen); + + /** skips over the given number of bytes (or less) + * @param skiplen number of bytes to skip + * @return number of bytes actually skipped. + */ + virtual offile_off_t skip(offile_off_t skiplen); + + /** resets the stream to the position by the given number of bytes. + * @param num number of bytes to putback. If the putback operation + * fails, the producer status becomes bad. + */ + virtual void putback(offile_off_t num); + + /** adds the content of the given buffer to the input stream. + * @param buf buffer from which data is read. Must be allocated + * by caller and remain valid until releaseBuffer() is called + * @param buflen buffer length, must be even number > 0. + */ + virtual void setBuffer(const void *buf, offile_off_t buflen); + + /** releases the current buffer. Should only be called when + * the content of the buffer has been read as far as possible. + * Pending input from the buffer is copied into an internal + * backup buffer if necessary. If an overflow condition + * occurs, the producer status becomes bad. + */ + virtual void releaseBuffer(); + + /** marks the end of stream, i.e. the data provided with the last call + * to setBuffer is the last data available in the stream. + */ + virtual void setEos(); + +private: + + /// private unimplemented copy constructor + DcmBufferProducer(const DcmBufferProducer&); + + /// private unimplemented copy assignment operator + DcmBufferProducer& operator=(const DcmBufferProducer&); + + /// the user buffer we're actually reading from + unsigned char *buffer_; + + /// the backup buffer + unsigned char *backup_; + + /// size of the user buffer, in bytes + offile_off_t bufSize_; + + /// number of bytes read from the user buffer + offile_off_t bufIndex_; + + /// number of bytes read from the backup buffer + offile_off_t backupIndex_; + + /// index of first valid byte in backup buffer, for putback + offile_off_t backupStart_; + + /// status + OFCondition status_; + + /// true if setEos has been called before + OFBool eosflag_; + +}; + + +/** input stream that reads from a buffer of fixed length + * which must be provided by the caller. + */ +class DCMTK_DCMDATA_EXPORT DcmInputBufferStream: public DcmInputStream +{ +public: + /** constructor + */ + DcmInputBufferStream(); + + /// destructor + virtual ~DcmInputBufferStream(); + + /** creates a new factory object for the current stream + * and stream position. When activated, the factory will be + * able to create new DcmInputStream delivering the same + * data as the current stream. Used to defer loading of + * value fields until accessed. + * If no factory object can be created (e.g. because the + * stream is not seekable), returns NULL. + * @return pointer to new factory object if successful, NULL otherwise. + */ + virtual DcmInputStreamFactory *newFactory() const; + + /** adds the content of the given buffer to the input stream. + * @param buf buffer from which data is read. Must be allocated + * by caller and remain valid until releaseBuffer() is called + * @param buflen buffer length, must be even number > 0. + */ + virtual void setBuffer(const void *buf, offile_off_t buflen); + + /** releases the current buffer. Should only be called when + * the content of the buffer has been read as far as possible. + * Pending input from the buffer is copied into an internal + * backup buffer if necessary. If an overflow condition + * occurs, the producer status becomes bad. + */ + virtual void releaseBuffer(); + + /** marks the end of stream, i.e. the data provided with the last call + * to setBuffer is the last data available in the stream. + */ + virtual void setEos(); + +private: + + /// private unimplemented copy constructor + DcmInputBufferStream(const DcmInputBufferStream&); + + /// private unimplemented copy assignment operator + DcmInputBufferStream& operator=(const DcmInputBufferStream&); + + /// the final producer of the filter chain + DcmBufferProducer producer_; + +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcistrmf.h b/dcmdata/include/dcmtk/dcmdata/dcistrmf.h new file mode 100644 index 00000000..e900ab8f --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcistrmf.h @@ -0,0 +1,332 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmInputFileStream and related classes, + * implements streamed input from files. + * + */ + +#ifndef DCISTRMF_H +#define DCISTRMF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcistrma.h" + + +/** producer class that reads data from a plain file. + */ +class DCMTK_DCMDATA_EXPORT DcmFileProducer: public DcmProducer +{ +public: + /** constructor + * @param filename name of file to be opened (may contain wide chars + * if support enabled) + * @param offset byte offset to skip from the start of file + */ + DcmFileProducer(const OFFilename &filename, offile_off_t offset = 0); + + /// destructor + virtual ~DcmFileProducer(); + + /** returns the status of the producer. Unless the status is good, + * the producer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the producer as an OFCondition object. + * Unless the status is good, the producer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the producer is at the end of stream. + * @return true if end of stream, false otherwise + */ + virtual OFBool eos(); + + /** returns the minimum number of bytes that can be read with the + * next call to read(). The DcmObject read methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only read "en bloc", i.e. all + * or nothing. + * @return minimum of data available in producer + */ + virtual offile_off_t avail(); + + /** reads as many bytes as possible into the given block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually read. + */ + virtual offile_off_t read(void *buf, offile_off_t buflen); + + /** skips over the given number of bytes (or less) + * @param skiplen number of bytes to skip + * @return number of bytes actually skipped. + */ + virtual offile_off_t skip(offile_off_t skiplen); + + /** resets the stream to the position by the given number of bytes. + * @param num number of bytes to putback. If the putback operation + * fails, the producer status becomes bad. + */ + virtual void putback(offile_off_t num); + +private: + + /// private unimplemented copy constructor + DcmFileProducer(const DcmFileProducer&); + + /// private unimplemented copy assignment operator + DcmFileProducer& operator=(const DcmFileProducer&); + + /// the file we're actually reading from + OFFile file_; + + /// status + OFCondition status_; + + /// number of bytes in file + offile_off_t size_; +}; + + +/** input stream factory for plain files + */ +class DCMTK_DCMDATA_EXPORT DcmInputFileStreamFactory: public DcmInputStreamFactory +{ +public: + + /** constructor + * @param filename name of file to be opened (may contain wide chars + * if support enabled) + * @param offset byte offset to skip from the start of file + */ + DcmInputFileStreamFactory(const OFFilename &filename, offile_off_t offset); + + /// copy constructor + DcmInputFileStreamFactory(const DcmInputFileStreamFactory &arg); + + /// destructor + virtual ~DcmInputFileStreamFactory(); + + /** create a new input stream object + * @return pointer to new input stream object + */ + virtual DcmInputStream *create() const; + + /** returns a pointer to a copy of this object + */ + virtual DcmInputStreamFactory *clone() const + { + return new DcmInputFileStreamFactory(*this); + } + + /** returns an enum describing the class to which this instance belongs + * @return class to which this instance belongs + */ + virtual DcmInputStreamFactoryType ident() const + { + return DFT_DcmInputFileStreamFactory; + } + + /** returns name of the file + * @return name of file + */ + virtual OFFilename const & getFilename() const + { + return filename_; + } + + /** returns offset of the data in the file + * @return offset of the data in the file + */ + virtual offile_off_t getOffset() const + { + return offset_; + } + +private: + + /// private unimplemented copy assignment operator + DcmInputFileStreamFactory& operator=(const DcmInputFileStreamFactory&); + + /// filename + OFFilename filename_; + + /// offset in file + offile_off_t offset_; + +}; + + +/** input stream that reads from a plain file + */ +class DCMTK_DCMDATA_EXPORT DcmInputFileStream: public DcmInputStream +{ +public: + /** constructor + * @param filename name of file to be opened (may contain wide chars + * if support enabled) + * @param offset byte offset to skip from the start of file + */ + DcmInputFileStream(const OFFilename &filename, offile_off_t offset = 0); + + /// destructor + virtual ~DcmInputFileStream(); + + /** creates a new factory object for the current stream + * and stream position. When activated, the factory will be + * able to create new DcmInputStream delivering the same + * data as the current stream. Used to defer loading of + * value fields until accessed. + * If no factory object can be created (e.g. because the + * stream is not seekable), returns NULL. + * @return pointer to new factory object if successful, NULL otherwise. + */ + virtual DcmInputStreamFactory *newFactory() const; + +private: + + /// private unimplemented copy constructor + DcmInputFileStream(const DcmInputFileStream&); + + /// private unimplemented copy assignment operator + DcmInputFileStream& operator=(const DcmInputFileStream&); + + /// the final producer of the filter chain + DcmFileProducer producer_; + + /// filename + OFFilename filename_; +}; + +/** class that manages the life cycle of a temporary file. + * It maintains a thread-safe reference counter, and when this counter + * is decreased to zero, unlinks (deletes) the file and then the handler + * object itself. + */ +class DCMTK_DCMDATA_EXPORT DcmTempFileHandler +{ +public: + + /** static method that permits creation of instances of + * this class (only) on the heap, never on the stack. + * A newly created instance always has a reference counter of 1. + * @param filename path to temporary file (may contain wide chars + * if support enabled) + */ + static DcmTempFileHandler *newInstance(const OFFilename &filename); + + /** create an input stream that permits reading from the temporary file + * @return pointer to input stream. Note that there is no guarantee + * that the input stream actually permits reading, i.e. the presence of the + * temporary file is not checked. + */ + DcmInputStream *create() const; + + /// increase reference counter for this object + void increaseRefCount(); + + /** decreases reference counter for this object and deletes + * the temporary file and this object if the reference counter becomes zero. + */ + void decreaseRefCount(); + +private: + + /** private constructor. + * Instances of this class are always created through newInstance(). + * @param filename path to temporary file (may contain wide chars + * if support enabled) + */ + DcmTempFileHandler(const OFFilename &filename); + + /** private destructor. Instances of this class + * are always deleted through the reference counting methods + */ + virtual ~DcmTempFileHandler(); + + /// private undefined copy constructor + DcmTempFileHandler(const DcmTempFileHandler& arg); + + /// private undefined copy assignment operator + DcmTempFileHandler& operator=(const DcmTempFileHandler& arg); + + /** number of references to temporary file. + * Default initialized to 1 upon construction of this object + */ + size_t refCount_; + +#ifdef WITH_THREADS + /// mutex for MT-safe reference counting + /// @remark this member is only available if DCMTK is compiled with thread + /// support enabled. + OFMutex mutex_; +#endif + + /// path to temporary file + OFFilename filename_; +}; + +/** input stream factory for temporary file handlers + */ +class DCMTK_DCMDATA_EXPORT DcmInputTempFileStreamFactory: public DcmInputStreamFactory +{ +public: + + /** constructor + * @param handler pointer to temporary file handler. + * Reference counter of temporary file handler is increased by this operation. + */ + DcmInputTempFileStreamFactory(DcmTempFileHandler *handler); + + /// copy constructor + DcmInputTempFileStreamFactory(const DcmInputTempFileStreamFactory &arg); + + /// destructor, decreases reference counter of temporary file handler + virtual ~DcmInputTempFileStreamFactory(); + + /** create a new input stream object + * @return pointer to new input stream object + */ + virtual DcmInputStream *create() const; + + /** returns a pointer to a copy of this object + */ + virtual DcmInputStreamFactory *clone() const; + + /** returns an enum describing the class to which this instance belongs + * @return class to which this instance belongs + */ + virtual DcmInputStreamFactoryType ident() const + { + return DFT_DcmInputTempFileStreamFactory; + } + +private: + + /// private unimplemented copy assignment operator + DcmInputTempFileStreamFactory& operator=(const DcmInputTempFileStreamFactory&); + + /// handler for temporary file + DcmTempFileHandler *fileHandler_; +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcistrmz.h b/dcmdata/include/dcmtk/dcmdata/dcistrmz.h new file mode 100644 index 00000000..0cf4687b --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcistrmz.h @@ -0,0 +1,202 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: zlib compression filter for input streams + * + */ + +#ifndef DCISTRMZ_H +#define DCISTRMZ_H + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_ZLIB + +#include "dcmtk/dcmdata/dcistrma.h" /* for DcmInputFilter */ + +BEGIN_EXTERN_C +#include +END_EXTERN_C + +/** global flag defining the behaviour of the zlib decompressor. + * When true, the input stream is expected to be in deflated ZLIB format + * instead of deflated bitstream format (i.e. RFC 1950 instead of RFC 1951). + * Default is false, i.e. DICOM compliant behavior. + * @remark this flag is only available if DCMTK is compiled with + * ZLIB support enabled. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmZlibExpectRFC1950Encoding; + +/** zlib compression filter for input streams + * @remark this class is only available if DCMTK is compiled with + * ZLIB support enabled. + */ +class DCMTK_DCMDATA_EXPORT DcmZLibInputFilter: public DcmInputFilter +{ +public: + + /// default constructor + DcmZLibInputFilter(); + + /// destructor + virtual ~DcmZLibInputFilter(); + + /** returns the status of the producer. Unless the status is good, + * the producer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the producer as an OFCondition object. + * Unless the status is good, the producer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the producer is at the end of stream. + * @return true if end of stream, false otherwise + */ + virtual OFBool eos(); + + /** returns the minimum number of bytes that can be read with the + * next call to read(). The DcmObject read methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only read "en bloc", i.e. all + * or nothing. + * @return minimum of data available in producer + */ + virtual offile_off_t avail(); + + /** reads as many bytes as possible into the given block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually read. + */ + virtual offile_off_t read(void *buf, offile_off_t buflen); + + /** skips over the given number of bytes (or less) + * @param skiplen number of bytes to skip + * @return number of bytes actually skipped. + */ + virtual offile_off_t skip(offile_off_t skiplen); + + /** resets the stream to the position by the given number of bytes. + * @param num number of bytes to putback. If the putback operation + * fails, the producer status becomes bad. + */ + virtual void putback(offile_off_t num); + + /** determines the producer from which the filter is supposed + * to read it's input. Once a producer for the input filter has + * been defined, it cannot be changed anymore during the lifetime + * of the object. + * @param producer reference to producer, must not be circular chain + */ + virtual void append(DcmProducer& producer); + +private: + + /// private unimplemented copy constructor + DcmZLibInputFilter(const DcmZLibInputFilter&); + + /// private unimplemented copy assignment operator + DcmZLibInputFilter& operator=(const DcmZLibInputFilter&); + + /** reads data from the producer into the input ring buffer + * until the input ring buffer becomes full or the + * producer suspends + * @return number of bytes added to input buffer + */ + offile_off_t fillInputBuffer(); + + /** decompress data into the given output block until + * complete or no more input is available in the input ring buffer. + * does not re-fill the input ring buffer from the producer. + * @param buf pointer to input data + * @param buflen number of bytes in buf + * @return number of bytes processed + */ + offile_off_t decompress(const void *buf, offile_off_t buflen); + + /** reads and decompresses data from the producer + * until the producer suspends or the output ring buffer becomes full. + */ + void fillOutputBuffer(); + + /** writes the content of the output ring buffer + * to the next filter stage until the output ring buffer + * becomes empty or the next filter stage becomes full + */ + void flushOutputBuffer(); + + /** copies as much of the given block of data as possible + * in the input ring buffer + * @param buf pointer to input data + * @param buflen number of bytes in buf + * @return number of bytes copied to input ring buffer + */ + offile_off_t fillInputBuffer(const void *buf, offile_off_t buflen); + + /** feed data from the input ring buffer to the compression + * codec until complete or the output ring buffer becomes full. + * Does not flush the output ring buffer. + * @param finalize true if the content of the input ring buffer + * constitutes the end of the input stream, i.e. the compression codec + * should be forced to flush its internal state. + */ + void compressInputBuffer(OFBool finalize); + + + /// pointer to producer from which compressed input is read + DcmProducer *current_; + + /// pointer to struct z_stream object containing the zlib status + z_streamp zstream_; + + /// status + OFCondition status_; + + /// true if the zlib object has reported Z_STREAM_END + OFBool eos_; + + /// input ring buffer + unsigned char *inputBuf_; + + /// offset of first byte in input ring buffer + offile_off_t inputBufStart_; + + /// number of bytes in input ring buffer + offile_off_t inputBufCount_; + + /// output ring buffer + unsigned char *outputBuf_; + + /// offset of first byte in output ring buffer + offile_off_t outputBufStart_; + + /// number of bytes available for read in output ring buffer + offile_off_t outputBufCount_; + + /// number of putback bytes in output ring buffer + offile_off_t outputBufPutback_; + + /// flag indicating whether or not a pad byte has been appended to the input stream + OFBool padded_; +}; + +#endif +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcitem.h b/dcmdata/include/dcmtk/dcmdata/dcitem.h new file mode 100644 index 00000000..5a4afc4f --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcitem.h @@ -0,0 +1,1551 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: Interface of class DcmItem + * + */ + + +#ifndef DCITEM_H +#define DCITEM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/offile.h" /* for offile_off_t */ +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/dcmdata/dclist.h" +#include "dcmtk/dcmdata/dcpcache.h" + + +// forward declarations +class DcmElement; +class DcmJsonFormat; +class DcmSequenceOfItems; +class DcmSpecificCharacterSet; + + +/** a class representing a list of DICOM elements in which each + * element has a different tag and elements are maintained in + * increasing order of tags. In particular, a sequence item. + */ +class DCMTK_DCMDATA_EXPORT DcmItem + : public DcmObject +{ + public: + + // be friend with "greater than" and "less than" operators that are defined + // outside of this class + friend OFBool operator< (const DcmItem& lhs, const DcmItem& rhs); + friend OFBool operator> (const DcmItem& lhs, const DcmItem& rhs); + friend OFBool operator<=(const DcmItem& lhs, const DcmItem& rhs); + friend OFBool operator>=(const DcmItem& lhs, const DcmItem& rhs); + + /** default constructor + */ + DcmItem(); + + /** constructor. + * Create new item from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmItem(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old item to be copied + */ + DcmItem(const DcmItem &old); + + /** assignment operator. Private creator cache is not copied + * as it is also the case for clone(). + * @param obj the item to be copied + * @return Reference to this object after assignment + */ + DcmItem &operator=(const DcmItem &obj); + + /** comparison operator that compares the value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). For item values that means that all elements + * within the items are compared to each other in ascending tag order. + * This may be an expensive operation. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object than + * in rhs object. + */ + virtual int compare(const DcmItem& rhs) const; + + /** destructor + */ + virtual ~DcmItem(); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmItem(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get type identifier + * @return type identifier of this class (EVR_item) + */ + virtual DcmEVR ident() const; + + /** get value multiplicity + * @return always returns 1 (according to the DICOM standard) + */ + virtual unsigned long getVM(); + + /** get number of values (elements) stored in this item. + * The result is the same as card() unless overwritten in a derived class. + * @return number of elements in this item + */ + virtual unsigned long getNumberOfValues(); + + /** get cardinality of this item + * @return number of elements in this item + */ + virtual unsigned long card() const; + + /** check if this element is a leaf node in a dataset tree. + * All subclasses of DcmElement except for DcmSequenceOfItems + * are leaf nodes, while DcmSequenceOfItems, DcmItem, DcmDataset etc. + * are not. + * @return true if leaf node, false otherwise. + */ + virtual OFBool isLeaf() const { return OFFalse; } + + /** check if this item is nested in a sequence of items, i.e.\ not a + * top-level or stand-alone item/dataset + * @return true if this item is nested, false otherwise + */ + virtual OFBool isNested() const; + + /** print all elements of the item to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** calculate the length of this DICOM element when encoded with the + * given transfer syntax and the given encoding type for sequences. + * For elements, the length includes the length of the tag, length field, + * VR field and the value itself, for items and sequences it returns + * the length of the complete item or sequence including delimitation tags + * if applicable. + * If length encoding is set to be explicit and the total item size is + * larger than the available 32-bit length field, then undefined length + * is returned. If "dcmWriteOversizedSeqsAndItemsImplicit" is disabled, + * also the internal DcmObject errorFlag is set to EC_SeqOrItemContentOverflow + * in case the item content (excluding tag header etc.) is already too + * large. + * @param xfer transfer syntax for length calculation + * @param enctype sequence encoding type for length calculation + * @return length of DICOM element + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** calculate the value length (without attribute tag, VR and length field) + * of this DICOM element when encoded with the given transfer syntax and + * the given encoding type for sequences. + * If length encoding is set to be explicit and the item content is larger + * than the available 32-bit length field, then undefined length is + * returned. If "dcmWriteOversizedSeqsAndItemsUndefined" is disabled, + * also the internal DcmObject errorFlag is set to + * EC_SeqOrItemContentOverflow. + * @param xfer transfer syntax for length calculation + * @param enctype sequence encoding type for length calculation + * @return value length of DICOM element + */ + virtual Uint32 getLength(const E_TransferSyntax xfer = EXS_LittleEndianImplicit, + const E_EncodingType enctype = EET_UndefinedLength); + + /** initialize the transfer state of this object. This method must be called + * before this object is written to a stream or read (parsed) from a stream. + */ + virtual void transferInit(); + + /** finalize the transfer state of this object. This method must be called + * when reading/writing this object from/to a stream has been completed. + */ + virtual void transferEnd(); + + /** get parent item of this object, i.e.\ the item/dataset in which the + * surrounding sequence element is stored. + * @return pointer to the parent item of this object (might be NULL) + */ + virtual DcmItem *getParentItem(); + + /** check if this DICOM object can be encoded in the given transfer syntax. + * @param newXfer transfer syntax in which the DICOM object is to be encoded + * @param oldXfer transfer syntax in which the DICOM object was read or created. + * @return true if object can be encoded in desired transfer syntax, false otherwise. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer); + + /** This function reads the information of all attributes which + * are captured in the input stream and captures this information + * in elementList. Each attribute is represented as an element + * in this list. If not all information for an attribute could be + * read from the stream, the function returns EC_StreamNotifyClient. + * @param inStream The stream which contains the information. + * @param ixfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies + * what will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** This function reads the information of all attributes which + * are captured in the input stream and captures this information + * in elementList, up to the attribute tag stopParsingAtElement. + * Each attribute is represented as an element + * in this list. If not all information for an attribute could be + * read from the stream, the function returns EC_StreamNotifyClient. + * @param inStream The stream which contains the information. + * @param ixfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies + * what will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @param stopParsingAtElement parsing of the input stream is stopped when + * this tag key or any higher tag is encountered. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readUntilTag(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength, + const DcmTagKey &stopParsingAtElement = DCM_UndefinedTagKey); + + /** write object to a stream + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** returns true if the object contains an element with Unknown VR at any nesting level + * @return true if the object contains an element with Unknown VR, false otherwise + */ + virtual OFBool containsUnknownVR() const; + + /** check if this object contains non-ASCII characters at any nesting level. Please note + * that this check is pretty simple and only works for single-byte character sets that + * do include the 7-bit ASCII codes, e.g. for the ISO 8859 family. In other words: All + * character codes below 128 are considered to be ASCII codes and all others are + * considered to be non-ASCII. + * @param checkAllStrings if true, also check elements with string values not affected + * by SpecificCharacterSet (0008,0005). By default, only check PN, LO, LT, SH, ST, + * UC and UT. + * @return true if object contains non-ASCII characters, false otherwise + */ + virtual OFBool containsExtendedCharacters(const OFBool checkAllStrings = OFFalse); + + /** check if this object is affected by SpecificCharacterSet at any nesting level. + * In detail, it is checked whether this object contains any data elements that + * according to their VR are affected by the SpecificCharacterSet (0008,0005) + * element. This is true for the following VRs: PN, LO, LT, SH, ST, UC and UT + * @return true if object is affected by SpecificCharacterSet, false otherwise + */ + virtual OFBool isAffectedBySpecificCharacterSet() const; + + /** mode specifying whether the SpecificCharacterSet (0008,0005) element should be + * checked by convertCharacterSet() or not, i.e.\ whether this element might be + * present on this dataset-level. This method is reimplemented in derived classes. + * @return always returns OFFalse, i.e.\ SpecificCharacterSet should not be checked + */ + virtual OFBool checkForSpecificCharacterSet() const { return OFFalse; } + + /** convert all element values that are contained in this item and that are affected + * by SpecificCharacterSet from the given source character set to the given + * destination character set. The defined terms for a particular character set can + * be found in the DICOM standard, e.g. "ISO_IR 100" for ISO 8859-1 (Latin 1) or + * "ISO_IR 192" for Unicode in UTF-8. An empty string denotes the default character + * repertoire, which is ASCII (7-bit). If multiple values are given for 'fromCharset' + * (separated by a backslash) code extension techniques are used and escape sequences + * may be encountered in the source string to switch between the specified character + * sets. + * @param fromCharset name of the source character set(s) used for the conversion + * @param toCharset name of the destination character set used for the conversion. + * Only a single value is permitted (i.e. no code extensions). + * @param flags optional flag used to customize the conversion (see DCMTypes::CF_xxx) + * @param updateCharset if OFTrue, the SpecificCharacterSet (0008,0005) element is + * updated, i.e.\ the current value is either replaced or a new element is inserted + * or the existing element is deleted. If OFFalse the SpecificCharacterSet element + * remains unchanged. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(const OFString &fromCharset, + const OFString &toCharset, + const size_t flags = 0, + const OFBool updateCharset = OFFalse); + + /** convert all element values that are contained in this item and that are affected + * by SpecificCharacterSet to the given destination character set. If not disabled, + * the source character set is determined automatically from the value of the + * SpecificCharacterSet (0008,0005) element. The defined terms for the destination + * character set can be found in the DICOM standard, e.g. "ISO_IR 100" for ISO 8859-1 + * (Latin 1) or "ISO_IR 192" for Unicode in UTF-8. An empty string denotes the + * default character repertoire, which is ASCII (7-bit). + * @param toCharset name of the destination character set used for the conversion. + * Only a single value is permitted (i.e. no code extensions). + * @param flags optional flag used to customize the conversion (see DCMTypes::CF_xxx) + * @param ignoreCharset if OFTrue, the value of SpecificCharacterSet is ignored. + * Also see checkForSpecificCharacterSet(). + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(const OFString &toCharset, + const size_t flags = 0, + const OFBool ignoreCharset = OFFalse); + + /** convert all element values that are contained in this item and that are affected + * by SpecificCharacterSet from the currently selected source character set to the + * currently selected destination character set + * @param converter character set converter to be used to convert the element values + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(DcmSpecificCharacterSet &converter); + + /** convert all element values that are contained in this item and that are affected + * by SpecificCharacterSet to UTF-8 (Unicode). The value of the SpecificCharacterSet + * (0008,0005) element is updated, set or deleted automatically if needed. The + * transliteration mode is disabled, i.e. the conversion flags are explicitly set to + * 0 - see convertCharacterSet(). + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertToUTF8(); + + /** insert a new element into the list of elements maintained by this item. + * The list of elements is always kept in ascending tag order. + * @param elem element to be inserted, must not be contained in this or + * any other item. Will be deleted upon destruction of this item object. + * @param replaceOld if true, this element replaces any other element with + * the same tag which may already be contained in the item. If false, + * insert fails if another element with the same tag is already present. + * @param checkInsertOrder if true, a warning message is sent to the console + * if the element is not inserted at the end of the list. This is used + * in the read() method to detect datasets with out-of-order elements. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition insert(DcmElement *elem, + OFBool replaceOld = OFFalse, + OFBool checkInsertOrder = OFFalse); + + /** access an element from the item. This method returns a pointer to one + * of the elements in the item, and not a copy. + * @param num index number of element, must be < card() + * @return pointer to element if found, NULL if num >= card() + */ + virtual DcmElement *getElement(const unsigned long num); + + /** this method enables a stack based, depth-first traversal of a complete + * hierarchical DICOM dataset (that is, classes derived from DcmItem or + * DcmSequenceOfItems). With each call of this method, the next object + * in the tree is located and marked on the stack. + * @param stack "cursor" for current position in the dataset. The stack + * will contain a pointer to each dataset, sequence, item and element + * from the main dataset down to the current element, and is updated + * upon each call to this method. An empty stack is equivalent to a stack + * containing a pointer to this object only. + * @param intoSub if true, the nextObject method will perform a hierarchical + * search through the dataset (depth-first), if false, only the current + * container object will be traversed (e.g., all elements of an item + * or all items of a sequence). + * @return EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition nextObject(DcmStack &stack, + const OFBool intoSub); + + /** this method is only used in container classes, + * that is, DcmItem and DcmSequenceOfItems. It returns a pointer to the + * next object in the list AFTER the given object. If the caller passes NULL, + * a pointer to the first object in the list is returned. If the given object + * is not found, the given object is the last one in the list or the list is empty, + * NULL is returned. + * @param obj pointer to one object in the container; we are looking for the + * next entry after this one. NULL if looking for the first entry. + * @return pointer to next object in container or NULL if not found + */ + virtual DcmObject *nextInContainer(const DcmObject *obj); + + /** remove element from list. If found, the element is not deleted but + * returned to the caller who is responsible for further management of the + * DcmElement object. + * @param num index number of element, must be < card() + * @return pointer to DcmElement if found, NULL otherwise + */ + virtual DcmElement *remove(const unsigned long num); + + /** remove element from list. If found, the element is not deleted but + * returned to the caller who is responsible for further management of the + * DcmElement object. + * @param elem pointer to element (as type DcmObject *) to be removed from list + * @return pointer to element (as type DcmElement *) if found, NULL otherwise + */ + virtual DcmElement *remove(DcmObject *elem); + + /** remove element from list. If found, the element is not deleted but + * returned to the caller who is responsible for further management of the + * DcmElement object. + * @param tag attribute tag of element to be removed + * @return pointer to DcmElement if found, NULL otherwise + */ + virtual DcmElement *remove(const DcmTagKey &tag); + + /** check if this item is empty + * @param normalize not used for this class + * @return true if item is empty, i.e.\ has no elements, false otherwise + */ + virtual OFBool isEmpty(const OFBool normalize = OFTrue); + + /** clear (remove) all attributes from item and delete them from memory. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear(); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse ); + + /** a complex, stack-based, hierarchical search method. It allows for a search + * for a DICOM object with a given attribute within a given container, + * hierarchically, from a starting position identified through a cursor stack. + * @param xtag the DICOM attribute tag we are searching for + * @param resultStack Depending on the search mode (see below), this parameter + * either serves as an input and output parameter, or as an output parameter + * only (the latter being the default). When used as an input parameter, + * the cursor stack defines the start position for the search within a + * hierarchical DICOM dataset. Upon successful return, the stack contains + * the position of the element found, in the form of a pointer to each dataset, + * sequence, item and element from the main dataset down to the found element. + * @param mode search mode, controls how the search stack is handled. + * In the default mode, ESM_fromHere, the stack is ignored on input, and + * the search starts in the object for which this method is called. + * In the other modes, the stack is used both as an input and an output + * parameter and defines the starting point for the search. + * @param searchIntoSub if true, the search will be performed hierarchically descending + * into the sequences and items of the dataset. If false, only the current container + * (sequence or item) will be traversed. + * @return EC_Normal if found, EC_TagNotFound if not found, an error code is something + * went wrong. + */ + virtual OFCondition search(const DcmTagKey &xtag, // in + DcmStack &resultStack, // inout + E_SearchMode mode = ESM_fromHere, // in + OFBool searchIntoSub = OFTrue ); // in + + /** this method loads all attribute values maintained by this object and + * all sub-objects (in case of a container such as DcmDataset) into memory. + * After a call to this method, the file from which a dataset was read may safely + * be deleted or replaced. For large files, this method may obviously allocate large + * amounts of memory. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadAllDataIntoMemory(); + + /** iterate over all elements and remove those element values from memory which exceed + * a given length and which can be loaded from file when needed again. For all other + * elements, nothing is done. + * @param maxLength maximum length (number of bytes) allowed without removing the value + */ + virtual void compactElements(const Uint32 maxLength); + + /** This function takes care of group length and padding elements + * in the current element list according to what is specified in + * glenc and padenc. If required, this function does the following + * two things: + * a) it calculates the group length of all groups which are + * contained in this item and sets the calculated values + * in the corresponding group length elements and + * b) it inserts a corresponding padding element (or, in case + * of sequences: padding elements) with a corresponding correct + * size into the element list. + * @param glenc Encoding type for group length; specifies what shall + * be done with group length tags. + * @param padenc Encoding type for padding; specifies what shall be + * done with padding tags. + * @param xfer The transfer syntax that shall be used. + * @param enctype Encoding type for sequences; specifies how sequences + * will be handled. + * @param padlen The length up to which the dataset shall be padded, + * if padding is desired. + * @param subPadlen For sequences (ie sub elements), the length up to + * which item shall be padded, if padding is desired. + * @param instanceLength Number of extra bytes added to the item/dataset + * length used when computing the padding; this + * parameter is for instance used to pass the length + * of the file meta header from the DcmFileFormat to + * the DcmDataset object. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition computeGroupLengthAndPadding(const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc = EPD_noChange, + const E_TransferSyntax xfer = EXS_Unknown, + const E_EncodingType enctype = EET_ExplicitLength, + const Uint32 padlen = 0, + const Uint32 subPadlen = 0, + Uint32 instanceLength = 0); + + + /** check if an element with the given attribute tag exists in the dataset + * @param key tag key to be searched + * @param searchIntoSub if true, do hierarchical search within sequences, + * if false only search through this dataset + * @return true if tag found, false otherwise + */ + OFBool tagExists(const DcmTagKey &key, + OFBool searchIntoSub = OFFalse); + + /** check if an element with the given attribute tag exists in the dataset + * and has a non-empty value + * @param key tag key to be searched + * @param searchIntoSub if true, do hierarchical search within sequences, + * if false only search through this dataset + * @return true if tag found and element non-empty, false otherwise + */ + OFBool tagExistsWithValue(const DcmTagKey &key, + OFBool searchIntoSub = OFFalse); + + /* --- findAndGet functions: find an element and get it or the value, respectively --- */ + + /** find element and get a pointer to it (or copy it). + * Applicable to all DICOM value representations (VR). + * The result variable 'element' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param element variable in which the reference to (or copy of) the element is stored + * @param searchIntoSub flag indicating whether to search into sequences or not + * @param createCopy create a copy of the element if true, return a reference otherwise + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetElement(const DcmTagKey &tagKey, + DcmElement *&element, + const OFBool searchIntoSub = OFFalse, + const OFBool createCopy = OFFalse); + + /** find all elements matching a particular tag and return references to them on a stack. + * This functions always performs a deep search (i.e. searches into sequence of items). + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param resultStack stack where references to the elements are stored (added to). + * If no element is found, the stack is not modified (e.g. cleared). + * @return EC_Normal if at least one matching tag is found, an error code otherwise. + */ + OFCondition findAndGetElements(const DcmTagKey &tagKey, + DcmStack &resultStack); + + /** find element and get value as a reference to a C string. NB: The string is not copied! + * Applicable to the following VRs: AE, AS, CS, DA, DS, DT, IS, LO, LT, PN, SH, ST, TM, UC, UI, + * UR, UT + * Since the getString() routine is called internally the resulting string reference represents + * the (possibly multi-valued) value as stored in the dataset, i.e. no normalization is performed. + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored (might be NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetString(const DcmTagKey &tagKey, + const char *&value, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a reference to a C string. NB: The string is not copied! + * Applicable to the following VRs: AE, AS, CS, DA, DS, DT, IS, LO, LT, PN, SH, ST, TM, UC, UI, + * UR, UT + * Since the getString() routine is called internally the resulting string reference represents + * the (possibly multi-valued) value as stored in the dataset, i.e. no normalization is performed. + * The result variable 'value' is automatically set to NULL and 'length' is set to 0 if an error + * occurs. + * Please note that since the length is returned separately, the string value can contain more + * than one NULL byte. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored (might be NULL) + * @param length length of the string (number of characters without the trailing NULL byte) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetString(const DcmTagKey &tagKey, + const char *&value, + Uint32 &length, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a C++ string (only one component). + * Applicable to the following VRs: AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OD, OF, + * OL, OW, PN, SH, SL, SS, ST, TM, UC, UI, UL, UR, US, UT + * Since the getOFString() routine is called internally the resulting string is normalized, i.e. + * leading and/or trailing spaces are removed according to the associated value representation, + * or the element value is converted to a character string (for non-string VRs) - see documentation + * in the corresponding header file. + * In contrast to the above and below function only the specified component (see parameter 'pos') + * is returned. The result variable 'value' is automatically set to an empty string if an error + * occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetOFString(const DcmTagKey &tagKey, + OFString &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a C++ string (all components). + * Applicable to the following VRs: AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OD, OF, + * OL, OW, PN, SH, SL, SS, ST, TM, UC, UI, UL, UR, US, UT + * Since the getOFStringArray() routine is called internally the resulting string is normalized, + * i.e. leading and/or trailing spaces are removed according to the associated value representation + * or the element values are converted to character strings (for non-string VRs) - see documentation + * in the corresponding header file. + * The result variable 'value' is automatically set to an empty string if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetOFStringArray(const DcmTagKey &tagKey, + OFString &value, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an unsigned 8-bit integer. + * Applicable to the following VRs: OB + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint8(const DcmTagKey &tagKey, + Uint8 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of unsigned 8-bit integers. + * Applicable to the following VRs: OB + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint8Array(const DcmTagKey &tagKey, + const Uint8 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an unsigned 16-bit integer. + * Applicable to the following VRs: OW, US + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint16(const DcmTagKey &tagKey, + Uint16 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of unsigned 16-bit integers. + * Applicable to the following VRs: AT, OW, US + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint16Array(const DcmTagKey &tagKey, + const Uint16 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a signed 16-bit integer. + * Applicable to the following VRs: SS + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetSint16(const DcmTagKey &tagKey, + Sint16 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of signed 16-bit integers. + * Applicable to the following VRs: SS + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetSint16Array(const DcmTagKey &tagKey, + const Sint16 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an unsigned 32-bit integer. + * Applicable to the following VRs: OL, UL + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint32(const DcmTagKey &tagKey, + Uint32 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of unsigned 32-bit integers. + * Applicable to the following VRs: OL, UL + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint32Array(const DcmTagKey &tagKey, + const Uint32 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a signed 32-bit integer. + * Applicable to the following VRs: IS, SL + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetSint32(const DcmTagKey &tagKey, + Sint32 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of signed 32-bit integers. + * Applicable to the following VRs: SL + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetSint32Array(const DcmTagKey &tagKey, + const Sint32 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an unsigned 64-bit integer. + * Applicable to the following VRs: OV, UV + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint64(const DcmTagKey &tagKey, + Uint64 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of unsigned 64-bit integers. + * Applicable to the following VRs: OV, UV + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetUint64Array(const DcmTagKey &tagKey, + const Uint64 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a signed 64-bit integer. + * Applicable to the following VRs: SV + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetSint64(const DcmTagKey &tagKey, + Sint64 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of signed 64-bit integers. + * Applicable to the following VRs: SV + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetSint64Array(const DcmTagKey &tagKey, + const Sint64 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a (signed) long integer. + * Applicable to the following VRs: IS, OL, SL, SS, UL, US + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetLongInt(const DcmTagKey &tagKey, + long int &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a 32-bit floating point. + * Applicable to the following VRs: FL, OF + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetFloat32(const DcmTagKey &tagKey, + Float32 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of 32-bit floating point values. + * Applicable to the following VRs: FL, OF + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetFloat32Array(const DcmTagKey &tagKey, + const Float32 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as a 64-bit floating point. + * Applicable to the following VRs: DS, FD, OD + * The result variable 'value' is automatically set to zero if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the element value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetFloat64(const DcmTagKey &tagKey, + Float64 &value, + const unsigned long pos = 0, + const OFBool searchIntoSub = OFFalse); + + /** find element and get value as an array of 64-bit floating point values. + * Applicable to the following VRs: FD, OD + * The result variable 'value' is automatically set to NULL if an error occurs. + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param value variable in which the reference to the element value is stored + * @param count stores number of items in the result array (if not NULL) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndGetFloat64Array(const DcmTagKey &tagKey, + const Float64 *&value, + unsigned long *count = NULL, + const OFBool searchIntoSub = OFFalse); + + /** looks up and returns a given sequence. + * Applicable to the following VRs: SQ, (pixelSQ) + * The result variable 'sequence' is automatically set to NULL if an error occurs + * (e.g. if 'seqTagKey' does not refer to a sequence attribute). + * @param seqTagKey DICOM tag specifying the sequence attribute to be searched for + * @param sequence variable in which the reference to (or copy of) the sequence is stored + * @param searchIntoSub flag indicating whether to search into sub-sequences or not + * @param createCopy create a copy of the sequence if true, return a reference otherwise + * @return EC_Normal upon success, an error otherwise. + */ + OFCondition findAndGetSequence(const DcmTagKey &seqTagKey, + DcmSequenceOfItems *&sequence, + const OFBool searchIntoSub = OFFalse, + const OFBool createCopy = OFFalse); + + /** looks up and returns a given sequence item, if it exists. Otherwise sets 'item' + * to NULL and returns EC_TagNotFound (specified sequence does not exist) or + * EC_IllegalParameter (specified item does not exist). Only the top-most level of + * the dataset/item is examined (i.e. no deep-search is performed). + * Applicable to the following VRs: SQ, (pixelSQ) + * @param seqTagKey DICOM tag specifying the sequence attribute to be searched for + * @param item variable in which the reference to (or copy of) the item is stored + * @param itemNum number of the item to be searched for (0..n-1, -1 for last) + * @param createCopy create a copy of the item if true, return a reference otherwise + * @return EC_Normal upon success, an error otherwise. + */ + OFCondition findAndGetSequenceItem(const DcmTagKey &seqTagKey, + DcmItem *&item, + const signed long itemNum = 0, + const OFBool createCopy = OFFalse); + + + /* --- findOrCreate functions: find an element or create a new one --- */ + + /** looks up the given sequence in the current dataset and returns the given item. + * If either the sequence or the item do not exist, they are created. If necessary, + * multiple empty items are inserted. Only the top-most level of the dataset/item + * is examined (i.e. no deep-search is performed). + * Applicable to the following VRs: SQ, (pixelSQ) + * @param seqTag DICOM tag specifying the sequence attribute to be searched for + * (or to be created) + * @param item variable in which the reference to the sequence item is stored + * @param itemNum number of the item to be searched for (0..n-1, -1 for last, + * -2 for append new) + * @return EC_Normal upon success, an error otherwise. + */ + OFCondition findOrCreateSequenceItem(const DcmTag &seqTag, + DcmItem *&item, + const signed long itemNum = 0); + + /* --- findAndXXX functions: find an element and do something with it --- */ + + /** find element, create a copy and insert it into the given destination dataset. + * This functions never performs a deep search (i.e. does not search into sequence + * of items). Empty elements are also copied. However, if the given tag is not + * found in the current dataset, EC_TagNotFound is returned and the destination + * dataset remains unchanged. + * Applicable to all DICOM value representations (VR). + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param destItem destination dataset to which the copied element is inserted + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition findAndInsertCopyOfElement(const DcmTagKey &tagKey, + DcmItem *destItem, + const OFBool replaceOld = OFTrue); + + /** find element, remove it from the dataset and free the associated memory. + * Applicable to all DICOM value representations (VR). + * @param tagKey DICOM tag specifying the attribute to be searched for + * @param allOccurrences flag indicating whether to delete all occurrences of the + * attribute tag or the first one only (implies 'searchIntoSub' to be true) + * @param searchIntoSub flag indicating whether to search into sequences or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition findAndDeleteElement(const DcmTagKey &tagKey, + const OFBool allOccurrences = OFFalse, + const OFBool searchIntoSub = OFFalse); + + /** looks up the given sequence in the current dataset and deletes the given item. + * Applicable to the following VRs: SQ, (pixelSQ) + * @param seqTagKey DICOM tag specifying the sequence attribute to be searched for + * @param itemNum number of the item to be deleted (0..n-1, -1 for last) + * @return EC_Normal upon success, an error otherwise. + */ + OFCondition findAndDeleteSequenceItem(const DcmTagKey &seqTagKey, + const signed long itemNum); + + + /* --- putAndInsert functions: put value and insert new element --- */ + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OD, OF, + * OL, OW, PN, SH, SL, SS, ST, TM, UC, UI, UL, UR, US, UT + * @param tag DICOM tag specifying the attribute to be created + * @param value string value to be set for the new element (might be empty or NULL) + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertString(const DcmTag &tag, + const char *value, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OD, OF, + * OL, OW, PN, SH, SL, SS, ST, TM, UC, UI, UL, UR, US, UT + * Please note that since the length of the string has to be specified explicitly, the string + * can contain more than one NULL byte. + * @param tag DICOM tag specifying the attribute to be created + * @param value string value to be set for the new element (might be empty or NULL) + * @param length length of the string (number of characters without the trailing NULL byte) + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertString(const DcmTag &tag, + const char *value, + const Uint32 length, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: AE, AS, CS, DA, DS, DT, IS, LO, LT, PN, SH, ST, TM, UC, UI, + * UR, UT + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element (might be empty) + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertOFStringArray(const DcmTag &tag, + const OFString &value, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: OB, ox (polymorph OB/OW or pixel data) + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element (might be NULL) + * @param count number of values (= bytes in this case) to be copied from 'value' + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertUint8Array(const DcmTag &tag, + const Uint8 *value, + const unsigned long count, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: US, xs (US or SS) + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param pos index of the value to be set (0..vm). A value can be appended to + * the end of or inserted within the existing value field. + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertUint16(const DcmTag &tag, + const Uint16 value, + const unsigned long pos = 0, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: AT, OW, US, ox (polymorph OB/OW or pixel data), xs (US or SS) + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element (might be NULL) + * @param count number of values (not bytes!) to be copied from 'value' + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertUint16Array(const DcmTag &tag, + const Uint16 *value, + const unsigned long count, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: SS, xs (US or SS) + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param pos index of the value to be set (0..vm). A value can be appended to + * the end of or inserted within the existing value field. + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertSint16(const DcmTag &tag, + const Sint16 value, + const unsigned long pos = 0, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: SS, xs (US or SS) + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param count number of values (not bytes!) to be copied from 'value' + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertSint16Array(const DcmTag &tag, + const Sint16 *value, + const unsigned long count, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: OL, UL + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param pos index of the value to be set (0..vm). A value can be appended to + * the end of or inserted within the existing value field. + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertUint32(const DcmTag &tag, + const Uint32 value, + const unsigned long pos = 0, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: OL, UL + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param count number of values (not bytes!) to be copied from 'value' + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertUint32Array(const DcmTag &tag, + const Uint32 *value, + const unsigned long count, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: SL + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param pos index of the value to be set (0..vm). A value can be appended to + * the end of or inserted within the existing value field. + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertSint32(const DcmTag &tag, + const Sint32 value, + const unsigned long pos = 0, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: FL, OF + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param pos index of the value to be set (0..vm). A value can be appended to + * the end of or inserted within the existing value field. + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertFloat32(const DcmTag &tag, + const Float32 value, + const unsigned long pos = 0, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: FL, OF + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param count number of values (not bytes!) to be copied from 'value' + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertFloat32Array(const DcmTag &tag, + const Float32 *value, + const unsigned long count, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: FD, OD + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param pos index of the value to be set (0..vm). A value can be appended to + * the end of or inserted within the existing value field. + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertFloat64(const DcmTag &tag, + const Float64 value, + const unsigned long pos = 0, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: FD, OD + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param count number of values (not bytes!) to be copied from 'value' + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertFloat64Array(const DcmTag &tag, + const Float64 *value, + const unsigned long count, + const OFBool replaceOld = OFTrue); + + /** create a new element, put specified value to it and insert the element into the dataset/item. + * Applicable to the following VRs: AT + * @param tag DICOM tag specifying the attribute to be created + * @param value value to be set for the new element + * @param pos index of the value to be set (0..vm). A value can be appended to + * the end of or inserted within the existing value field. + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition putAndInsertTagKey(const DcmTag &tag, + const DcmTagKey &value, + const unsigned long pos = 0, + const OFBool replaceOld = OFTrue); + + /* --- insertXXX functions: insert new element --- */ + + /** create a new element (with no value) and insert it into the dataset/item. + * Applicable to the following VRs: AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OD, OF, + * OL, OW, PN, SH, SL, SQ, SS, ST, TM, UC, UI, UL, UR, US, UT + * @param tag DICOM tag specifying the attribute to be created + * @param replaceOld flag indicating whether to replace an existing element or not + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition insertEmptyElement(const DcmTag &tag, + const OFBool replaceOld = OFTrue); + + /** looks up the given sequence in the current dataset and inserts the given item. + * If the sequence does not exist, it is created. If necessary, multiple empty items + * are inserted before the specified item position. Only the top-most level of the + * dataset/item is examined (i.e. no deep-search is performed). + * Applicable to the following VRs: SQ, (pixelSQ) + * @param seqTag DICOM tag specifying the sequence attribute to be searched for + * (or to be created) + * @param item item to be inserted into the sequence, must not be contained in this + * or any other sequence. Will be deleted upon destruction of the sequence object. + * @param itemNum position of the item (0..n-1, -1 = before last, -2 = after last) + * @return EC_Normal upon success, an error otherwise (delete 'item' manually!). + */ + OFCondition insertSequenceItem(const DcmTag &seqTag, + DcmItem *item, + const signed long itemNum = -2); + + /** creates new DICOM element from given attribute tag. + * Creation of unknown attributes (e.g. private tag not being registered + * in the dictionary) will result in a DcmElement instance of derived type + * DcmOtherByteOtherWord. + * @param tag attribute tag of the element to be created + * @param privateCreator private creator of the element, if element tag + * is private (default: NULL, i.e. non-private DICOM standard tag) + * @return pointer to newly created element upon success, NULL pointer otherwise + * + */ + static DcmElement *newDicomElement(const DcmTagKey &tag, + const char *privateCreator = NULL); + + /** creates new DICOM element from given attribute tag. + * Creation of unknown attributes (e.g. private tag not being registered + * in the dictionary) will result in a DcmElement instance of derived type + * DcmOtherByteOtherWord. + * @param newElement pointer to newly created element returned in this parameter + * upon success, NULL pointer otherwise + * @param tag attribute tag of the element to be created + * @param privateCreator private creator of the element, if element tag + * is private (default: NULL, i.e. non-private DICOM standard tag) + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition newDicomElement(DcmElement *&newElement, + const DcmTagKey &tag, + const char *privateCreator = NULL); + + /** creates new DICOM element from given attribute tag and VR. + * Creation of unknown attributes (e.g. private tag not being registered + * in the dictionary) will result in a DcmElement instance of derived type + * DcmOtherByteOtherWord. + * @param newElement pointer to newly created element returned in this parameter + * upon success, NULL pointer otherwise + * @param tag attribute tag and VR of the element to be created + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition newDicomElementWithVR(DcmElement *&newElement, + const DcmTag &tag); + + protected: + + /// the list of elements maintained by this object + DcmList *elementList; + + /** flag used during suspended I/O. Indicates whether the last element + * was completely or only partially read/written during the last call + * to read/write. + */ + OFBool lastElementComplete; + + /** used during reading. Contains the position in the stream where + * the item started (needed for calculating the remaining number of + * bytes available for a fixed-length item). + */ + offile_off_t fStartPosition; + + /** This function reads tag and length information from inStream and + * returns this information to the caller. When reading information, + * the transfer syntax which was passed is accounted for. If the + * transfer syntax shows an explicit value representation, the data + * type of this object is also read from the stream. In general, this + * function follows the rules which are specified in the DICOM standard + * (see DICOM standard (year 2000) part 5, section 7) (or the corresponding + * section in a later version of the standard) concerning the encoding + * of a dataset. + * @param inStream The stream which contains the information. + * @param xfer The transfer syntax which was used to encode the + * information in inStream. + * @param tag Contains in the end the tag that was read. + * @param length Contains in the end the length value that was read. + * @param bytesRead Contains in the end the amount of bytes which were + * read from inStream. + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readTagAndLength(DcmInputStream &inStream, // inout + const E_TransferSyntax xfer, // in + DcmTag &tag, // out + Uint32 &length, // out + Uint32 &bytesRead); // out + + /** This function creates a new DcmElement object on the basis of the newTag + * and newLength information which was passed, inserts this new element into + * elementList, reads the actual data value which belongs to this element + * (attribute) from the inStream and also assigns this information to the + * object which was created at the beginning. + * @param inStream The stream which contains the information. + * @param newTag The tag of the element of which the information is + * being read. + * @param newLength The length of the information which is being read. + * @param xfer The transfer syntax which was used to encode the + * information in inStream. + * @param glenc Encoding type for group length. Specifies what will + * be done with group length tags. + * @param maxReadLength Maximum read length for reading the attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readSubElement(DcmInputStream &inStream, // inout + DcmTag &newTag, // inout + const Uint32 newLength, // in + const E_TransferSyntax xfer, // in + const E_GrpLenEncoding glenc, // in + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** This function reads the first 6 bytes from the input stream and determines + * the transfer syntax which was used to code the information in the stream. + * The decision is based on two questions: a) Did we encounter a valid tag? + * and b) Do the last 2 bytes which were read from the stream represent a valid + * VR? In certain special cases, where the transfer syntax cannot be determined + * without doubt, we want to guess the most likely transfer syntax (see code). + * @param inStream The stream which contains the coded information. + * @return The transfer syntax which was determined. + */ + E_TransferSyntax checkTransferSyntax(DcmInputStream &inStream); + + /** check whether the given tag requires some special handling regarding the VR + * (i.e.\ in case it is undefined and multiple values are possible). If required, + * the VR of the given element tag is then updated according to the DICOM + * standard, e.g. the VR of PixelPaddingValue (if undefined) is set to 'SS' or + * 'US' depending on the value of PixelRepresentation. + * @param item dataset or item that can be used to lookup other element values + * @param tag tag of the element to be checked and updated (if required) + */ + void checkAndUpdateVR(DcmItem &item, + DcmTag &tag); + + /** update the SpecificCharacterSet (0008,0005) element depending on the given + * parameters. The current value of this element is either replaced or a new + * element is inserted or the existing element is deleted. + * @param status error status of previous operations (might also be updated) + * @param converter character set converter used to convert element values + */ + void updateSpecificCharacterSet(OFCondition &status, + const DcmSpecificCharacterSet &converter); + + /** creates new DICOM element from given attribute tag. + * Helper function used by DICOM parser (friend of this class) and thus + * hidden from the public interface. DcmItem's readSubElement() uses + * this function when reading new elements from input data. This method + * internally sets the length of the new element, but does not allocate + * any memory for the element's value. Thus subsequent access to an element + * created by this method can lead to crashes. DcmItem instead initializes + * the value itself a bit later during the read process. + * @param newElement pointer to newly created element returned in this + * parameter upon success, NULL pointer otherwise + * @param tag attribute tag of the element to be created. VR of tag may be + * updated within the method. + * @param length attribute value length of the element to be created + * @param privateCreatorCache cache object for private creator strings in + * the current dataset + * @param readAsUN flag indicating whether parser is currently handling + * UN element that must be read in implicit VR little endian; updated + * upon return + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition newDicomElement(DcmElement *&newElement, + DcmTag &tag, + const Uint32 length, + DcmPrivateTagCache *privateCreatorCache, + OFBool& readAsUN); + + private: + + /** helper function for search(). May only be called if elementList is non-empty. + * Performs hierarchical search for given tag and pushes pointer of sub-element + * on result stack if found + * @param tag tag key to be searched + * @param resultStack upon successful return, pointer to element pushed onto this stack + * @param searchIntoSub flag indicating whether recursive search is desired + * @return EC_Normal if tag found and stack modified, EC_TagNotFound if tag not found + * and stack unmodified + */ + OFCondition searchSubFromHere(const DcmTagKey &tag, // in + DcmStack &resultStack, // inout + OFBool searchIntoSub ); // in + + /** helper function that interprets the given pointer as a pointer to an + * array of two characters and checks whether these two characters form + * a valid standard DICOM VR. + * @param atposition pointer to array of (at least) two bytes interpreted as VR + * @return true if standard VR, false otherwise + */ + static OFBool foundVR(const Uint8* atposition); + + /// cache for private creator tags and names + DcmPrivateTagCache privateCreatorCache; +}; + +/** Checks whether left hand side item is smaller than right hand side + * item. Uses DcmItem's compare() method in order to perform the + * comparison. See DcmItem::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is smaller than rhs, OFFalse otherwise + */ +inline OFBool operator< (const DcmItem& lhs, const DcmItem& rhs) +{ + return ( lhs.compare(rhs) < 0 ); +} + +/** Checks whether left hand side item is greater than right hand side + * item. Uses DcmItem's compare() method in order to perform the + * comparison. See DcmItem::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is greater than rhs, OFFalse otherwise + */ +inline OFBool operator> (const DcmItem& lhs, const DcmItem& rhs) +{ + return rhs < lhs; +} + +/** Checks whether left hand side item is smaller than or equal to right hand + * side item. Uses DcmItem's compare() method in order to perform the + * comparison. See DcmItem::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is smaller than rhs or both are equal, OFFalse + * otherwise + */ +inline OFBool operator<=(const DcmItem& lhs, const DcmItem& rhs) +{ + return !(lhs > rhs); +} + +/** Checks whether left hand side element is greater than or equal to right hand + * side element. Uses DcmElement's compare() method in order to perform the + * comparison. See DcmElement::compare() for details. + * @param lhs left hand side of the comparison + * @param rhs right hand side of the comparison + * @return OFTrue if lhs is greater than rhs or both are equal, OFFalse + * otherwise + */ +inline OFBool operator>=(const DcmItem& lhs, const DcmItem& rhs) +{ + return !(lhs < rhs); +} + +// +// SUPPORT FUNCTIONS +// + + +/** helper function for DcmElement::nextObject. + * hierarchically traverses all datasets/items after the position indicated by the call stack + * @param st stack + * @return EC_Normal upon success, an error code otherwise + */ +DCMTK_DCMDATA_EXPORT OFCondition nextUp(DcmStack &st); + + +#endif // DCITEM_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcjson.h b/dcmdata/include/dcmtk/dcmdata/dcjson.h new file mode 100644 index 00000000..d60b18e0 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcjson.h @@ -0,0 +1,411 @@ +/* +* +* Copyright (C) 2017-2018, OFFIS e.V. +* All rights reserved. See COPYRIGHT file for details. +* +* This software and supporting documentation were developed by +* +* OFFIS e.V. +* R&D Division Health +* Escherweg 2 +* D-26121 Oldenburg, Germany +* +* +* Module: dcmdata +* +* Author: Sebastian Grallert +* +* Purpose: Providing basic JSON formatting functionalities +* +*/ + +#ifndef DCJSON_H +#define DCJSON_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/ofdefine.h" +#include "dcmtk/ofstd/ofstring.h" + +#include "dcmtk/dcmdata/dctagkey.h" + +/** Class for handling JSON format options. + * Base class to implement custom formatting. + * Purpose: + * - individual output formatting + * - normalization of DecimalString and IntegerString e.g.\ normalization of leading zeros + * - escaping of special JSON control characters + * - outputting the correct indention and symbols for "Value", "BulkDataURI", etc. + * + *

Usage Example:

+ * @code{.cpp} + * #include "dcmtk/dcmdata/dcjson.h" + * // ... + * DcmFileFormat fileformat; + * if(fileformat.loadFile("test.dcm").good()) + * { + * // print the DICOM file in JSON format + * // using the pretty format (muti-line with indention and other whitespace) + * fileformat.writeJson(COUT, DcmJsonFormatPretty(OFTrue)); + * + * // using the compact (single line, without unneeded whitespace) format + * fileformat.writeJson(COUT, DcmJsonFormatCompact(OFTrue)); + * } + * @endcode + *

Implementing a custom formatter:

+ * @code{.cpp} + * struct CustomJsonFormat : DcmJsonFormatPretty + * { + * CustomJsonFormat(const OFBool printMetaInfo = OFTrue) + * : DcmJsonFormatPretty(printMetaInfo) + * { + * + * } + * + * OFString OFJsonFormatExample::space() + * { + * // use tabstops instead of spaces for indention + * return "\t"; + * } + * } + * @endcode + */ +class DCMTK_DCMDATA_EXPORT DcmJsonFormat +{ +public: + /** A class to create small proxy objects that ease indention handling. + * Each Indention object only contains a reference to the DcmJsonFormat object + * that created it and its only purpose is to call the respective methods + * of that object when one of its overloaded operators is used. + */ + class Indention + { + public: + /** output current indention to an output stream. + * @param out the output stream to use + * @param indention the indention to print + * @return out + */ + friend inline STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& out, const Indention& indention) + { + indention.printIndention(out); + return out; + } + + /** increases current indention. + * @return *this + */ + inline Indention& operator++() + { + m_Format.increaseIndention(); + return *this; + } + + /** decreases current indention + * @return *this + */ + inline Indention& operator--() + { + m_Format.decreaseIndention(); + return *this; + } + + private: + /// allow DcmJsonFormat to use this class' private members + friend class DcmJsonFormat; + + /// private constructor, used by DcmJsonFormat + inline Indention(DcmJsonFormat& format) : m_Format(format) + { + + } + + /// prints the current indention using the parent formatter + inline void printIndention(STD_NAMESPACE ostream& out) const + { + m_Format.printIndention(out); + } + + /// reference to the parent formatter object + DcmJsonFormat& m_Format; + }; + + /** Escapes all forbidden control characters in JSON + * @param out output stream to which the escaped String is written + * @param value String that should be escaped + */ + static void escapeControlCharacters(STD_NAMESPACE ostream &out, OFString const &value); + + /** Normalize Decimal String to specific JSON format. + * remove leading zeros, except before dot. + * @b Example: + * @code{.txt} + * 00.123 --> 0.123 + * 023.12 --> 23.12 + * -01.00 --> -1.00 + * 0200 --> 200 + * .12 --> 0.12 + * 000.1 --> 0.1 + * @endcode + * @param value String that should be normalize + */ + static void normalizeDecimalString(OFString &value); + + /** Normalize Integer String to specific JSON format. + * remove leading zeros, except before dot. + * @b Example: + * @code{.txt} + * 000 --> 0 + * 023 --> 23 + * -01 --> -1 + * 0200 --> 200 + * @endcode + * @param value String that should be normalize + */ + static void normalizeIntegerString(OFString &value); + + /** Prints either null if empty or the string value + * (with all illegal characters escaped). + * @param out output stream to which the Value prefix is written + * @param value String that should be printed + */ + static void printString(STD_NAMESPACE ostream &out, + const OFString &value); + + /** Prints either null if empty or a quoted string + * (with leading and ending quotation marks and all + * illegal characters escaped). + * @param out output stream to which the Value prefix is written + * @param value String that should be printed + */ + static void printValueString(STD_NAMESPACE ostream &out, + const OFString &value); + + /** Print either null if empty or a Number as normalized IntegerString + * @param out output stream to which the Value prefix is written + * @param value String that should be printed + */ + static void printNumberInteger(STD_NAMESPACE ostream &out, + OFString &value); + + /** Print either null if empty or a Number as normalized IntegerDecimal + * @param out output stream to which the Value prefix is written + * @param value String that should be printed + */ + static void printNumberDecimal(STD_NAMESPACE ostream &out, + OFString &value); + + /** Constructor + * @param printMetaInfo parameter that defines if meta information should be written + */ + inline DcmJsonFormat(const OFBool printMetaInfo) + : printMetaheaderInformation(printMetaInfo) + { + + } + + /** Virtual destructor, does nothing + */ + virtual ~DcmJsonFormat() {} + + /** Method to return line break(s) + * @return line break(s). + */ + virtual OFString newline() = 0; + + /** Method to return whitespace(s) + * @return whitespace(s). + */ + virtual OFString space() = 0; + + /** Method to return an indention proxy object for increasing, decreasing or printing indention + * @return an indention proxy object. + */ + inline Indention indent() + { + return Indention(*this); + } + + /** Check if an attribute should be exported as BulkDataURI. + * Override this function to implement bulk data URI output. + * @param tag the tag of the attribute being printed, for letting + * the implementation decide how to handle it. + * @param uri the resulting URI to output. + * @return OFTrue if yes, OFFalse if no. + * @details + *

Usage Example:

+ * @code{.cpp} + * struct BulkDataURIJsonFormat : DcmJsonFormatPretty + * { + * CustomJsonFormat(const OFBool printMetaInfo = OFTrue, + * ... bulkDataURIDatabase) + * : DcmJsonFormatPretty(printMetaInfo) + * , TheDatabase(bulkDataURIDatabase) + * { + * + * } + * + * virtual OFBool asBulkDataURI(const DcmTagKey& tag, OFString& uri) + * { + * ... result = TheDatabase.findBulkDataFor(tag); + * if (result.found()) + * { + * uri = result.uri(); + * return OFTrue; + * } + * return OFFalse; + * } + * + * ... TheDatabase; + * } + * @endcode + */ + virtual OFBool asBulkDataURI(const DcmTagKey& tag, OFString& uri); + + /** Print the Prefix which for JSON Values needed + * with indention and newlines as in the format Variable given. + * @b Example: + * @code{.txt} + * ,"Value":[ + * @endcode + * @param out output stream to which the Value prefix is written + */ + virtual void printValuePrefix(STD_NAMESPACE ostream &out); + + /** Print the Suffix which for JSON Values needed + * with indention and newlines as in the format Variable given. + * @b Example: + * @code{.txt} + * ]\n + * @endcode + * @param out output stream to which the Value prefix is written + */ + virtual void printValueSuffix(STD_NAMESPACE ostream &out); + + /** Print the Prefix which for JSON BulkDataURI needed + * with indention and newlines as in the format Variable given. + * @b Example: + * @code{.txt} + * ,"BulkDataURI": + * @endcode + * @param out output stream to which the Value prefix is written + */ + virtual void printBulkDataURIPrefix(STD_NAMESPACE ostream &out); + + /** Print the Prefix which for JSON InlineBinary needed + * with indention and newlines as the format specifies. + * @b Example: + * @code{.txt} + * ,"InlineBinary": + * @endcode + * @param out output stream to which the Value prefix is written + */ + virtual void printInlineBinaryPrefix(STD_NAMESPACE ostream &out); + + /** Print the prefix for array elements (except the first one), with + * indention and newlines as the format specifies. + * @b Example: + * @code{.txt} + * Example,\n + * Example... + * @endcode + * @param out output stream to which the Value prefix is written + */ + virtual void printNextArrayElementPrefix(STD_NAMESPACE ostream &out); + + /** Option that defines if metaheader information should be printed. + */ + const OFBool printMetaheaderInformation; + +protected: + /** Indent to the specific level. + * @param out output stream to which the indention is written. + */ + virtual void printIndention(STD_NAMESPACE ostream& out) = 0; + + /** Used for increasing the indention level. + */ + virtual void increaseIndention() = 0; + + /** Used for decreasing the indention level. + */ + virtual void decreaseIndention() = 0; +}; + + +/** Subclass for handling JSON formatted output. + * Standard class for formatted output. + */ +class DCMTK_DCMDATA_EXPORT DcmJsonFormatPretty : public DcmJsonFormat +{ +private: + /** Variable for the indentenlevel of DcmJsonFormat + */ + unsigned m_IndentionLevel; + +public: + /** DcmJsonFormatPretty constructor + * @param printMetaInfo Enable/Disable including Metaheader in the output + */ + explicit DcmJsonFormatPretty(const OFBool printMetaInfo = OFTrue); + + /** Indent to the specific level. + * @param out output stream to which the indention is written. + */ + void printIndention(STD_NAMESPACE ostream& out); + + /** Increase the indention level. + */ + void increaseIndention(); + + /** Decrease the indention level. + */ + void decreaseIndention(); + + /** Print a newline + * @returns a newline + */ + OFString newline(); + + /** Print a space + * @returns a space + */ + OFString space(); +}; + +/** Subclass for handling JSON formatted output. + * Standard class for non-formatted output. + */ +class DCMTK_DCMDATA_EXPORT DcmJsonFormatCompact : public DcmJsonFormat +{ +public: + /** DcmJsonFormatCompact constructor + * @param printMetaInfo Enable/Disable including Metaheader in the output + */ + explicit DcmJsonFormatCompact(const OFBool printMetaInfo = OFTrue); + + /** Does nothing. + * @param out output stream to which the indention is written. + */ + void printIndention(STD_NAMESPACE ostream& out); + + /** Does nothing. + */ + void increaseIndention(); + + /** Does nothing. + */ + void decreaseIndention(); + + /** Does nothing. + * @returns a empty String. + */ + OFString newline(); + + /** Does nothing. + * @returns a empty String. + */ + OFString space(); +}; + +#endif /* DCJSON_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dclist.h b/dcmdata/include/dcmtk/dcmdata/dclist.h new file mode 100644 index 00000000..78329af3 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dclist.h @@ -0,0 +1,187 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: generic list class + * + */ + +#ifndef DCLIST_H +#define DCLIST_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/ofstd/oftypes.h" + +#define INCLUDE_CSTDDEF +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/dcmdata/dcobject.h" + +/// index indicating "end of list" +const unsigned long DCM_EndOfListIndex = OFstatic_cast(unsigned long, -1L); + +/** helper class maintaining an entry in a DcmList double-linked list + */ +class DCMTK_DCMDATA_EXPORT DcmListNode +{ + +public: + /** constructor + * @param obj object to be maintained by this list node + */ + DcmListNode( DcmObject *obj ); + + /// destructor + ~DcmListNode(); + + /// return pointer to object maintained by this list node + inline DcmObject *value() { return objNodeValue; } + +private: + friend class DcmList; + + /// pointer to next node in double-linked list + DcmListNode *nextNode; + + /// pointer to previous node in double-linked list + DcmListNode *prevNode; + + /// pointer to DcmObject instance maintained by this list entry + DcmObject *objNodeValue; + + /// private undefined copy constructor + DcmListNode(const DcmListNode &); + + /// private undefined copy assignment operator + DcmListNode &operator=(const DcmListNode &); + +}; + +/// list position indicator +typedef enum +{ + /// at current position in list + ELP_atpos, + + /// at list start + ELP_first, + + /// at list end + ELP_last, + + /// before current list position + ELP_prev, + + /// after current list position + ELP_next +} E_ListPos; + +/** double-linked list class that maintains pointers to DcmObject instances. + * The remove operation does not delete the object pointed to, however, + * the destructor will delete all elements pointed to + */ +class DCMTK_DCMDATA_EXPORT DcmList +{ +public: + /// constructor + DcmList(); + + /// destructor + ~DcmList(); + + /** insert object at end of list + * @param obj pointer to object + * @return pointer to object + */ + DcmObject *append( DcmObject *obj ); + + /** insert object at start of list + * @param obj pointer to object + * @return pointer to object + */ + DcmObject *prepend( DcmObject *obj ); + + /** insert object relative to current position and indicator + * @param obj pointer to object + * @param pos position indicator + * @return pointer to object + */ + DcmObject *insert( DcmObject *obj, + E_ListPos pos = ELP_next ); + + /** remove current entry from list, return element + * @return pointer to removed element, which is not deleted + */ + DcmObject *remove(); + + /** get pointer to element in list at given position + * @param pos position indicator + * @return pointer to object + */ + DcmObject *get( E_ListPos pos = ELP_atpos ); + + /** seek within element in list to given position + * (i.e. set current element to given position) + * @param pos position indicator + * @return pointer to new current object + */ + DcmObject *seek( E_ListPos pos = ELP_next ); + + /** seek within element in list to given element index + * (i.e. set current element to given index) + * @param absolute_position position index < card() + * @return pointer to new current object + */ + DcmObject *seek_to(unsigned long absolute_position); + + /** Remove and delete all elements from list. Thus, the + * elements' memory is also freed by this operation. The list + * is empty after calling this function. + */ + void deleteAllElements(); + + /// return cardinality of list + inline unsigned long card() const { return cardinality; } + + /// return true if list is empty, false otherwise + inline OFBool empty(void) const { return firstNode == NULL; } + + /// return true if current node exists, false otherwise + inline OFBool valid(void) const { return currentNode != NULL; } + +private: + /// pointer to first node in list + DcmListNode *firstNode; + + /// pointer to last node in list + DcmListNode *lastNode; + + /// pointer to current node in list + DcmListNode *currentNode; + + /// number of elements in list + unsigned long cardinality; + + /// private undefined copy constructor + DcmList &operator=(const DcmList &); + + /// private undefined copy assignment operator + DcmList(const DcmList &newList); +}; + +#endif // DCLIST_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcmatch.h b/dcmdata/include/dcmtk/dcmdata/dcmatch.h new file mode 100644 index 00000000..07dd4eb7 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcmatch.h @@ -0,0 +1,342 @@ +/* + * + * Copyright (C) 2017-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Jan Schlamelcher + * + * Purpose: Implementing attribute matching for being used in dcmqrdb and dcmwlm etc. + * + */ + + +#ifndef DCMATCH_H +#define DCMATCH_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmdata/dcdefine.h" + +// forward declaration of DcmVR +class DcmVR; + +/** A class that implements the different kinds attribute matching. + * DcmAttributeMatching may either be used by directly calling the appropriate matching function, + * e.g. wildCardMatching() or by creating a DcmAttributeMatching object for a specific VR. + * In the latter case, DcmAttributeMatching will choose the appropriate matching function for + * the VR in its constructor and remember the result during its lifetime. + */ +class DCMTK_DCMDATA_EXPORT DcmAttributeMatching +{ +public: + + /** Helper class for parsing value range pairs, as in date/time ranges. + */ + struct Range + { + /** Separate the given value into two range components (if possible). + * @param data any data that might be a range of values. + * @param size the size in bytes of the value(s) passed as data. + * @param separator optional argument for using another separator than the default + * one (dash character '-'). + */ + Range( const void* const data, const size_t size, const char separator = '-' ); + + /** Return the information whether *this refers to an actual range of values or + * just a single value. + * @return OFTrue if the given argument is a range of values (i.e. contains the + * given/default range separator character), OFFalse otherwise. + */ + OFBool isRange() const; + + /** Return the information whether *this refers to an open range without a definite + * beginning. + * @return OFTrue if the given argument is an open range without a definite beginning + * OFFalse otherwise. + */ + OFBool hasOpenBeginning() const; + + /** Return the information whether *this refers to an open range without a definite + * end. + * @return OFTrue if the given argument is an open range without a definite end + * OFFalse otherwise. + */ + OFBool hasOpenEnd() const; + + /** The first value in the range, i.e. the beginning of the range. + * @note this will contain the whole value if the argument is not a range of values, + * use isRange() to retrieve that information. + */ + const char* first; + + /** The size in bytes of the first value, will be zero if the argument is an open range + * with no definite beginning. + */ + size_t firstSize; + + /** The second value in the range, e.g. the end of the range. + * @note this will also contain the whole value if the argument is not a range of values, + * use isRange() to retrieve that information. + */ + const char* second; + + /** The size in bytes of the second value, will be zero if the argument is an open range + * with no definite end. + */ + size_t secondSize; + }; + + /** Check whether the given query data conforms to the VR DA. + * @param queryData a pointer to some data. + * @param querySize the size (in bytes) of the data queryData refers to. + * @return OFTrue if the query is a valid Date or Date Range, OFFalse otherwise. + */ + static OFBool isDateQuery( const void* queryData, const size_t querySize ); + + /** Check whether the given query data conforms to the VR TM. + * @param queryData a pointer to some data. + * @param querySize the size (in bytes) of the data queryData refers to. + * @return OFTrue if the query is a valid Time or Time Range, OFFalse otherwise. + */ + static OFBool isTimeQuery( const void* queryData, const size_t querySize ); + + /** Check whether the given query data conforms to the VR DT. + * @param queryData a pointer to some data. + * @param querySize the size (in bytes) of the data queryData refers to. + * @return OFTrue if the query is a valid Date Time or Date Time Range, OFFalse otherwise. + */ + static OFBool isDateTimeQuery( const void* queryData, const size_t querySize ); + + /** Match the query data and the candidate using Single Value Matching, as defined by the DICOM standard. + * @param queryData a pointer to some data. + * @param querySize the size (in bytes) of the data queryData refers to. + * @param candidateData a pointer to some data. + * @param candidateSize the size (in bytes) of the data candidateData refers to. + * @return OFTrue if the query and the candidate match, OFFalse otherwise. + * @details + * If querySize equals zero, the result will be OFTrue, as appropriate for Universal Matching. + * Otherwise the result will only be OFTrue if both data pieces have the same size are bitwise + * equal. + */ + static OFBool singleValueMatching( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ); + + /** Match the query and the candidate string using Wild Card Matching, as defined by the DICOM standard. + * @param queryData a pointer to a character string potentially containing Wild Card characters. + * @param querySize the size (in bytes) of the string queryData refers to. + * @param candidateData a pointer to a character string. + * @param candidateSize the size (in bytes) of the string candidateData refers to. + * @return OFTrue if the query and the candidate match, OFFalse otherwise. + * @details + * If querySize equals zero, the result will be OFTrue, as appropriate for Universal Matching. + * If the query contains no Wild Card characters ('?' and '*') the result will be the same + * as if singleValueMatching() was called. + * @note It is therefore not necessary to check for Wild Card characters and manually decided whether + * to use wildCardMatching() or singleValueMatching(), simply use wildCardMatching() if the query + * may potentially contain Wild Card characters. + */ + static OFBool wildCardMatching( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ); + + /** Match the query date or date range and the candidate date. + * @param queryData a pointer to a character string that contains a DICOM Date (DA) or + * a date range. + * @param querySize the size (in bytes) of the string queryData refers to. + * @param candidateData a pointer to a character string that contains a DICOM Date (DA). + * @param candidateSize the size (in bytes) of the string candidateData refers to. + * @return OFTrue if the query and the candidate match, OFFalse otherwise. + * @details + * If querySize equals zero, the result will be OFTrue, as appropriate for Universal Matching. + * Otherwise query will be converted to an OFDate or a range defined by two OFDates and candidate + * will be converted to an OFDate. It will then be tested whether the candidate date lies within + * the range given by the query or is equal to the queried date as appropriate. If the conversion + * to OFDate is unsuccessful for any of the dates, the result will be OFFalse. + */ + static OFBool rangeMatchingDate( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ); + + /** Match the query time or time range and the candidate time. + * @param queryData a pointer to a character string that contains a DICOM Time (TM) or + * a time range. + * @param querySize the size (in bytes) of the string queryData refers to. + * @param candidateData a pointer to a character string that contains a DICOM Time (TM). + * @param candidateSize the size (in bytes) of the string candidateData refers to. + * @return OFTrue if the query and the candidate match, OFFalse otherwise. + * @details + * If querySize equals zero, the result will be OFTrue, as appropriate for Universal Matching. + * Otherwise query will be converted to an OFTime or a range defined by two OFTimes and candidate + * will be converted to an OFTime. It will then be tested whether the candidate time lies within + * the range given by the query or is equal to the queried time as appropriate. If the conversion + * to OFTime is unsuccessful for any of the times, the result will be OFFalse. + */ + static OFBool rangeMatchingTime( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ); + + /** Match the query date time or date time range and the candidate date time. + * @param queryData a pointer to a character string that contains a DICOM Date Time (DT) or + * a date time range. + * @param querySize the size (in bytes) of the string queryData refers to. + * @param candidateData a pointer to a character string that contains a DICOM Date Time (DT). + * @param candidateSize the size (in bytes) of the string candidateData refers to. + * @return OFTrue if the query and the candidate match, OFFalse otherwise. + * @details + * If querySize equals zero, the result will be OFTrue, as appropriate for Universal Matching. + * Otherwise query will be converted to an OFDateTime or a range defined by two OFDateTimes and + * candidate will be converted to an OFDateTime. It will then be tested whether the candidate date + * time lies within the range given by the query or is equal to the queried date time as appropriate. + * If the conversion to OFDateTime is unsuccessful for any of the date times, the result will be + * OFFalse. + */ + static OFBool rangeMatchingDateTime( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ); + + /** Match the query date and time or date and time range and the candidate date and time using + * combined datetime matching. + * @param dateQueryData a pointer to a character string that contains a DICOM Date (DA) or + * a date range. + * @param dateQuerySize the size (in bytes) of the string dateQueryData refers to. + * @param timeQueryData a pointer to a character string that contains a DICOM Time (TM) or + * a time range. + * @param timeQuerySize the size (in bytes) of the string timeQueryData refers to. + * @param dateCandidateData a pointer to a character string that contains a DICOM Date (DA). + * @param dateCandidateSize the size (in bytes) of the string dateCandidateData refers to. + * @param timeCandidateData a pointer to a character string that contains a DICOM Time (TM). + * @param timeCandidateSize the size (in bytes) of the string timeCandidateData refers to. + * @return OFTrue if the query and the candidate match, OFFalse otherwise. + * @details + * If dateQuerySize and timeQuerySize equal zero, the result will be OFTrue, as appropriate for + * Universal Matching. + * Otherwise the query will be converted to an OFDateTime or a range defined by two OFDateTimes and + * candidate will be converted to an OFDateTime as defined by combined datetime matching. + * It will then be tested whether the candidate date time lies within the range given by the query or is + * equal to the queried date time as appropriate. + * If the conversion to OFDateTime is unsuccessful for any of the dates or times, the result will + * be OFFalse. + */ + static OFBool rangeMatchingDateTime( const void* dateQueryData, const size_t dateQuerySize, + const void* timeQueryData, const size_t timeQuerySize, + const void* dateCandidateData, const size_t dateCandidateSize, + const void* timeCandidateData, const size_t timeCandidateSize ); + + /** Match the query list of UIDs with the candidate UID. + * @param queryData a pointer to a character string that contains a backslash separated list of UIDs. + * @param querySize the size (in bytes) of the string queryData refers to. + * @param candidateData a pointer to a character string that contains an UID. + * @param candidateSize the size (in bytes) of the string candidateData refers to. + * @return OFTrue if at least one of the UIDs from the query match the candidate, OFFalse otherwise. + * @details + * If querySize equals zero, the result will be OFTrue, as appropriate for Universal Matching. + */ + static OFBool listOfUIDMatching( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ); + + /** Default construct an empty DcmAttributeMatching object. + */ + DcmAttributeMatching(); + + /** Construct an DcmAttributeMatching object that is appropriate for the given VR. + * @param vr the DICOM Value Representation of the data that this object will be + * used on for matching. + */ + DcmAttributeMatching( const DcmVR vr ); + + /** Test whether this object may be used for matching, i.e.\ whether it is not empty. + * @return OFTrue if this object may be used for matching, OFFalse otherwise. + */ +#ifdef HAVE_CXX11 + explicit +#endif + operator OFBool() const; + + /** Test whether this object cannot be used for matching, i.e.\ whether it is empty. + * @return OFTrue if this object cannot be used for matching, OFFalse otherwise. + */ + OFBool operator!() const; + + /** Match the given query and candidate using the internally stored matching function. + * @param queryData a pointer some DICOM data that uses the same VR that was given + * during construction of this object. + * @param querySize the size (in bytes) of the data queryData refers to. + * @param candidateData a pointer to some DICOM data that used the same VR that was + * given during construction of this object. + * @param candidateSize the size (in bytes) of the data candidateData refers to. + * @return compares the query data with the candidate data using the appropriate + * matching function for the given VR, returns OFTrue if they match, OFFalse + * if not or if an error occurred. + * @details + * @pre (*this) must have been constructed for a specific VR that matches the one + * of the query and candidate data, i.e.\ !(*this) must evaluate to OFFalse. + * @details + *

Usage Example

+ * @code{.cpp} + * DcmAttributeMatching match( EVR_DA ); + * match( "20160101-20181231", 17, "20170713", 8 ); // -> OFTrue + * match = DcmAttributeMatching( EVR_TM ); + * match( "-12", 3, "11", 2 ) // -> OFTrue + * DcmAttributeMatching( EVR_PN )( "M?ller", 6, "^Martin", 7 ) // -> OFFalse + * @endcode + */ + OFBool operator()( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) const; + +private: + + /// Helper class for implementing Wild Card Matching + class WildCardMatcher; + + /** Helper function for generically implementing check functions operating on ranges. + * @param check a pointer to a function that checks a single value of the given query. + * @param queryData a pointer to some data. + * @param querySize the size (in bytes) of the data queryData refers to. + * @return logical AND of the results of the given check function applied to the + * beginning and the end of the range (as available). + */ + static OFBool checkRangeQuery( OFBool (*check)(const char*,const size_t), + const void* queryData, const size_t querySize ); + + /** Helper template function for generically implementing range matching. + * @tparam T the type to parse the data int (e.g. OFDate), deduced automatically. + * @param parse a pointer to a function that parses a string as a T. + * @param query the already separated (but not parsed) query. + * @param candidate the already parsed candidate. + * @return OFTrue if parsing of the query was successful and candidate equals + * the query value or lies within the range defined by the query. OFFalse otherwise. + */ + template + static OFBool rangeMatchingTemplate( OFCondition (*parse)(const char*,const size_t,T&), + const Range& query, const T& candidate ); + + /** Helper template function for generically implementing range matching. + * @tparam T the type to parse the data int (e.g. OFDate), deduced automatically. + * @param parse a pointer to a function that parses a string as a T. + * @param queryData a pointer to a character string that can be parsed as a T or + * a dash separated range of two Ts. + * @param querySize the size (in bytes) of the string queryData refers to. + * @param candidateData a pointer to a character string that can be parsed as a T + * for comparing it with the query. + * @param candidateSize the size (in bytes) of the string candidateData refers to. + * @return OFTrue if parsing of the query and the candidate as a T was successful + * and the T value represented by candidateData equals the one from the query or + * lies within the range defined by the query. OFFalse otherwise. + */ + template + static OFBool rangeMatchingTemplate( OFCondition (*parse)(const char*,const size_t,T&), + const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize); + + /// A pointer to one of the matching functions that is appropriate for the given VR. + OFBool (*m_pMatch)(const void*,const size_t,const void*,const size_t); +}; + +#endif // DCMATCH_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcmetinf.h b/dcmdata/include/dcmtk/dcmdata/dcmetinf.h new file mode 100644 index 00000000..7d1c7d0d --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcmetinf.h @@ -0,0 +1,261 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmMetaInfo + * + */ + + +#ifndef DCMETINF_H +#define DCMETINF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcitem.h" + +// forward declarations +class DcmJsonFormat; + + +/// magic string identifying DICOM files +#define DCM_Magic "DICM" + +/// length of magic string identifying DICOM files +#define DCM_MagicLen 4 + +/// length of DICOM file preamble, in bytes +#define DCM_PreambleLen 128 + +/// transfer syntax used for encoding DICOM meta-headers +#define META_HEADER_DEFAULT_TRANSFERSYNTAX EXS_LittleEndianExplicit + + +/** a class representing the DICOM file meta information header + */ +class DCMTK_DCMDATA_EXPORT DcmMetaInfo + : public DcmItem +{ + + public: + + /** default constructor + */ + DcmMetaInfo(); + + /** copy constructor + * @param old item to be copied + */ + DcmMetaInfo(const DcmMetaInfo &old); + + /** assignment operator. + * @param obj the metainfo to be copied + * @return reference to this object + */ + DcmMetaInfo &operator=(const DcmMetaInfo &obj); + + /** destructor + */ + virtual ~DcmMetaInfo(); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmMetaInfo(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get type identifier + * @return type identifier of this class (EVR_item) + */ + virtual DcmEVR ident() const; + + /** remove all elements with an invalid group number, i.e. everything but 0x0002 + */ + virtual void removeInvalidGroups(); + + /** return the transfer syntax in which this dataset was originally read. + * @return transfer syntax in which this dataset was originally read, EXS_Unknown + * if the dataset was created in memory + */ + E_TransferSyntax getOriginalXfer() const; + + /** print meta information header to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** initialize the transfer state of this object. This method must be called + * before this object is written to a stream or read (parsed) from a stream. + */ + virtual void transferInit(); + + /** finalize the transfer state of this object. This method must be called + * when reading/writing this object from/to a stream has been completed. + */ + virtual void transferEnd(); + + /** @copydoc DcmObject::calcElementLength() + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** read object from a stream. + * @param inStream DICOM input stream + * @param xfer transfer syntax to use when parsing. EXS_Unknown will + * lead to reading the preamble (if any) and parsing + * metaheader using detected transfer syntax, usually + * Explicit VR Little Endian. + * @param glenc handling of group length parameters + * @param maxReadLength attribute values larger than this value are skipped + * while parsing and read later upon first access if the stream type supports + * this. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax xfer = EXS_Unknown, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** write meta information header to a stream + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** load object from a DICOM file. If the file preamble is missing, an error is returned. + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @param groupLength flag, specifying how to handle the group length tags + * @param maxReadLength maximum number of bytes to be read for an element value. + * Element values with a larger size are not loaded until their value is retrieved + * (with getXXX()) or loadAllDataIntoMemory() is called. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFile(const OFFilename &fileName, + const E_TransferSyntax readXfer = EXS_Unknown, + const E_GrpLenEncoding groupLength = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + + private: + + /// initialize the preamble buffer with 128 zero bytes followed by "DICM" + void setPreamble(); + + /** check if the next 132 bytes in the input stream are a preamble + * followed by the DICOM "magic word" DICM. If so, try to determine + * the transfer syntax of the meta-header and return in parameter + * newxfer. If not, reset stream to start position. + * @param inStream input stream, should be at start position + * @param newxfer as input parameter contains the expected transfer syntax, + * as output parameter returns the real transfer syntax of the + * meta-header as determined heuristically + * @return true if meta-header found and read, false otherwise + */ + OFBool checkAndReadPreamble(DcmInputStream &inStream, + E_TransferSyntax &newxfer); // out + + /** peeks into the input stream and checks whether the next element + * is group 0002, i.e. belongs to the meta-header + * @param inStream input stream + * @return true if next element is part of meta-header, false otherwise + */ + OFBool nextTagIsMeta(DcmInputStream &inStream); + + /** read meta-header group length element which is important because + * it tells us where to switch from meta-header transfer syntax to + * dataset transfer syntax. Insert element into dataset + * @param inStream input stream + * @param xfer transfer syntax of meta-header + * @param xtag attribute tag for group length + * @param glenc handling of group length encoding element in dataset + * @param headerLen output parameter; length of meta-header as encoded in group length element + * @param bytesRead output parameter; number of bytes read when reading group length + * (for counting the remaining number of meta-header bytes) + * @param maxReadLength max read length for elements + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition readGroupLength(DcmInputStream &inStream, // inout + const E_TransferSyntax xfer, // in + const DcmTagKey &xtag, // in + const E_GrpLenEncoding glenc, // in + Uint32 &headerLen, // out + Uint32 &bytesRead, // out + const Uint32 maxReadLength = DCM_MaxReadLength); // in + + /// buffer for 132 byte DICOM file preamble + char filePreamble[DCM_PreambleLen + DCM_MagicLen]; + + /// true if the preamble was read from stream + OFBool preambleUsed; + + /// transfer state of the preamble + E_TransferState fPreambleTransferState; + + /// transfer syntax in which the meta-header was read + E_TransferSyntax Xfer; + +}; + +#endif // DCMETINF_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcobject.h b/dcmdata/include/dcmtk/dcmdata/dcobject.h new file mode 100644 index 00000000..c0d5a683 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcobject.h @@ -0,0 +1,824 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: + * This file contains the interface to routines which provide + * DICOM object encoding/decoding, search and lookup facilities. + * + */ + + +#ifndef DCOBJECT_H +#define DCOBJECT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofglobal.h" +#include "dcmtk/dcmdata/dcerror.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dctag.h" +#include "dcmtk/dcmdata/dcstack.h" + + +// forward declarations +class DcmItem; +class DcmJsonFormat; +class DcmOutputStream; +class DcmInputStream; +class DcmWriteCache; +class DcmSpecificCharacterSet; + +// include this file in doxygen documentation + +/** @file dcobject.h + * @brief interface to DICOM object/dataset handling + */ + +// Undefined Length Identifier now defined in dctypes.h + +// Maximum number of read bytes for a Value Element +const Uint32 DCM_MaxReadLength = 4096; + +// Maximum length of tag and length in a DICOM element +const Uint32 DCM_TagInfoLength = 12; + +// Optimum line length if not all data printed +const Uint32 DCM_OptPrintLineLength = 70; + +// Optimum value length if not all data printed +const Uint32 DCM_OptPrintValueLength = 40; + +// Optimum attribute name length (for tree output) +const Uint32 DCM_OptPrintAttributeNameLength = 35; + +/** This flags defines whether automatic correction should be applied to input + * data (e.g.\ stripping of padding blanks, removal of blanks in UIDs, etc). + * Default is enabled. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableAutomaticInputDataCorrection; /* default OFTrue */ + +/** This flag defines the handling of illegal odd-length attributes: If flag is + * true, odd lengths are respected (i.e.\ an odd number of bytes is read from + * the input stream.) After successful reading, padding to even number of bytes + * is enforced by adding a zero pad byte if dcmEnableAutomaticInputDataCorrection + * is true. Otherwise the odd number of bytes remains as read. + * + * If flag is false, old (pre DCMTK 3.5.2) behaviour applies: The length field + * implicitly incremented and an even number of bytes is read from the stream. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmAcceptOddAttributeLength; /* default OFTrue */ + +/** This flag defines how UN attributes with undefined length are treated + * by the parser when reading. The default is to expect the content of the + * UN element (up to and including the sequence delimitation item) + * to be encoded in Implicit VR Little Endian, as described in CP 246. + * DCMTK expects the attribute to be encoded like a DICOM sequence, i.e. + * the content of each item is parsed as a DICOM dataset. + * If the flag is disabled old (pre DCMTK 3.5.4) behaviour applies: The + * attribute is treated as if it was an Explicit VR SQ element. + * + * Note that the flag only affects the read behaviour but not the write + * behaviour - DCMTK will never write UN elements with undefined length. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableCP246Support; /* default OFTrue */ + +/** DCMTK releases up to 3.5.3 created a non-conforming byte stream + * as input to the MAC algorithm when creating or verifying digital signatures + * including compressed pixel data (i.e.\ signatures including attribute + * (7FE0,0010) in an encapsulated transfer syntax). This has been fixed + * in DCMTK 3.5.4, but this flag allows to revert to the old behavior + * in order to create or verify signatures that are compatible with older + * releases. Default is "off" (OFFalse). + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableOldSignatureFormat; /* default OFFalse */ + +/** This flag defines whether the transfer syntax for uncompressed datasets + * is detected automatically. The automatic detection has been introduced + * since there are (incorrectly encoded) DICOM dataset stored with a + * different transfer syntax than specified in the meta header. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmAutoDetectDatasetXfer; /* default OFFalse */ + +/** This flag defines how non-standard VRs are treated by the parser when + * reading. The default is to treat data element with non-standard VR as + * unknown. If this flag is enabled, the parser will try to read the data + * element with Implicit VR Little Endian transfer syntax. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmAcceptUnexpectedImplicitEncoding; /* default OFFalse */ + +/** This flag defines how the element's VR is treated by the parser when + * reading from a dataset with explicit VR encoding. By default, the + * VR from the dataset is used. If this flag is enabled and the VR of the + * tag is defined in the data dictionary, the parser will use the VR from + * the data dictionary (and ignore the one from the dataset). This flag is, + * therefore, useful for reading incorrectly encoded DICOM datasets. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmPreferVRFromDataDictionary; /* default OFFalse */ + +/** This flag defines how the element's length field is interpreted when reading + * from a dataset with explicit VR encoding and the data dictionary doesn't + * agree with the VR from the dataset. By default, the length field is assumed + * to match the size of the VR in the dataset. If this flag is enabled and the + * tag is defined in the data dictionary, the parser will use the size for the + * VR from the data dictionary (and ignore the one from the dataset). This flag + * is, therefore, useful for reading incorrectly encoded DICOM datasets. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmPreferLengthFieldSizeFromDataDictionary; /* default OFFalse */ + +/** This flag indicates, whether private attributes with implicit transfer + * syntax having a maximum length should be handled as sequences (ignoring + * any dictionary entries for that tag). This can happen, if for example + * a private creator element is illegally inserted with VR SQ + * (undefined length and implicit coding). The parser usually would then + * try to parse the element with VR=LO (private creator) with maximum + * length, which would lead to an error. The default behaviour is to + * rely on the dictionary. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmReadImplPrivAttribMaxLengthAsSQ; /* default OFFalse */ + +/** This flag indicates, whether parsing errors during reading + * should be ignored, i.e.\ whether the parser should try to recover and + * parse the rest of the stream. + * This flag does not work for all parsing errors (at this time) + * making sense but was introduced afterwards. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmIgnoreParsingErrors; /* default OFFalse */ + +/** This flag indicates, whether parsing should stop after a certain + * element in the stream was parsed. This is especially useful for + * datasets containing garbage at the end, usually after the Pixel + * Data attribute. To prevent the parser for "stumbling" over that + * garbage, it is possible to tell the parser to stop after a + * specific element. The flag is only sensitive to elements on + * dataset level, i.e. inside sequence any occurrence of the specified + * tag is ignored. Caution: Note that if Pixel Data is chosen + * as stop element, any attributes behind will not be parsed, e. g. + * any digital signature attributes coming after. + * Default is (0xffff,0xffff), which means that the feature is + * disabled. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmStopParsingAfterElement; /* default OFTrue */ + +/** This flag influences behaviour when writing a dataset with items + * and sequences set to be encoded with explicit length. It is possible + * that the content of a sequence (or item) has an encoded length greater + * than the maximum 32-bit value that can be written to the sequence (item) + * length field. If this flag is enabled (OFTrue) then the encoding of the + * very sequence (item) is switched to undefined length encoding. Any + * contained items (sequences) will be encoded explicitly if possible. + * Default is OFTrue, i.e. encoding is switched to implicit if maximum + * size of length field is exceeded. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmWriteOversizedSeqsAndItemsUndefined; /* default OFTrue */ + +/** This flag allows for ignoring the value of (0002,0000) File Meta Information + * Group Length which is useful in cases where this value is incorrect. If the + * header length is ignored, the behavior is identical to the case when no value + * is available (i.e. all elements are read as long as the group number is 0x0002). + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmIgnoreFileMetaInformationGroupLength; /* default OFFalse */ + +/** This flag enables the replacement of a wrong delimitation item at the end of + * a sequence or item. This is because there are incorrect systems that write + * a Sequence Delimitation Item (fffe,e0dd) at the end of an item or an Item + * Delimitation Item (fffe,e00d) at the end of a sequence. By default, no + * delimitation items are replaced. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmReplaceWrongDelimitationItem; /* default OFFalse */ + +/** This flag enables the "silent" conversion of illegal OB/OW elements + * with undefined length (other than PixelData) to SQ elements while reading. + * The default behaviour is to reject such elements with an error message. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmConvertUndefinedLengthOBOWtoSQ; /* default OFFalse */ + +/** This flag enables the "silent" conversion of incorrectly encoded + * VOI LUT Sequence elements with VR=OW and explicit length into a sequence. + * This incorrect encoding was detected "in the wild" in 2016. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmConvertVOILUTSequenceOWtoSQ; /* default OFFalse */ + +/** This flag influences the behaviour when reading Pixel Data elements. + * Pixel Data in those top level datasets that are using a compression-enabled + * Transfer Syntax (with few exceptions such as Deflated TS), + * is being stored in an encapsulated way. That means DICOM requires that the + * Pixel Data then element uses an undefined length and internally uses a + * pseudo sequence structure called Pixel Sequence with Pixel items inside. + * If this flag is set to OFFalse (default), an error is reported when reading + * datasets with encapsulated Transfer Syntaxes but with Pixel Data being + * stored using explicit length encoding. + * If this flag is set to OFTrue, such an invalid Pixel Data encoding is + * accepted and the element is read with the given length as if it would be the + * case for datasets in uncompressed transfer syntaxes. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmUseExplLengthPixDataForEncTS; /* default OFFalse */ + +/** Abstract base class for most classes in module dcmdata. As a rule of thumb, + * everything that is either a dataset or that can be identified with a DICOM + * attribute tag is derived from class DcmObject. + */ +class DCMTK_DCMDATA_EXPORT DcmObject +{ + public: + + /** constructor. + * Create new object from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmObject(const DcmTag &tag, const Uint32 len = 0); + + /** copy constructor + * @param obj item to be copied + */ + DcmObject(const DcmObject &obj); + + /// destructor + virtual ~DcmObject(); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const = 0; + + /** copy assignment operator + * @param obj object to be copied + * @return reference to this object + */ + DcmObject &operator=(const DcmObject &obj); + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject &rhs) = 0; + + /** return identifier for this class. Every class derived from this class + * returns a unique value of type enum DcmEVR for this call. This is used + * as a "poor man's RTTI" to correctly identify instances derived from + * this class even on compilers not supporting RTTI. + * @return type identifier of this class + */ + virtual DcmEVR ident() const = 0; + + /** return the value representation assigned to this object. + * If object was read from a stream, this method returns the VR + * that was defined in the stream for this object. It is, therefore, + * possible that the VR does not match the one defined in the data + * dictionary for the tag assigned to this object. + * @return VR of this object + */ + inline DcmEVR getVR() const { return Tag.getEVR(); } + + /** check if this element is a string type, based on the VR. + * Since the check is based on the VR and not on the class, + * the result of this method is not a guarantee that the object + * can be safely casted to one of the string-VR subclasses. + * @return true if this object is a string VR, false otherwise + */ + inline OFBool isaString() const { return Tag.getVR().isaString(); } + + /** check if this element is a leaf node in a dataset tree. + * All subclasses of DcmElement except for DcmSequenceOfItems + * are leaf nodes, while DcmSequenceOfItems, DcmItem, DcmDataset etc. + * are not. + * @return true if leaf node, false otherwise + */ + virtual OFBool isLeaf() const = 0; + + /** check if this element is nested in a sequence of items, i.e.\ not a + * top-level or stand-alone element + * @return true if this element is nested, false otherwise + */ + virtual OFBool isNested() const; + + /** print object to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used (used in certain sub-classes of this class) + * @param pixelCounter not used (used in certain sub-classes of this class) + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL) = 0; + + /** return the current transfer (read/write) state of this object. + * @return transfer state of this object + */ + inline E_TransferState transferState() const { return fTransferState; } + + /** initialize the transfer state of this object. This method must be called + * before this object is written to a stream or read (parsed) from a stream. + */ + virtual void transferInit(void); + + /** finalize the transfer state of this object. This method must be called + * when reading/writing this object from/to a stream has been completed. + */ + virtual void transferEnd(void); + + /** get root dataset/item (top-level) that contains this object. Internally, + * the list of parent pointers is followed in order to find the root. If + * this object has no parent item, a pointer to this object is returned + * instead. + * @return pointer to the root dataset/item (might be NULL) + */ + DcmItem *getRootItem(); + + /** get parent item of this object. In case of a top-level element, this is + * either the main dataset or the file meta-information. In case of a nested + * element, this is the surrounding item. + * @return pointer to the parent item of this object (might be NULL) + */ + virtual DcmItem *getParentItem(); + + /** get parent of this object. If this object is an element that has been + * inserted into a dataset/item, the parent is this particular dataset/item. + * If this object is an item that has been inserted into a sequence, the + * parent is this particular sequence. If this object has not been inserted + * into a dataset/item or sequence, NULL is returned. + * @return pointer to the parent of this object (might be NULL) + */ + inline DcmObject *getParent() { return Parent; } + + /** get parent of this object. If this object is an element that has been + * inserted into a dataset/item, the parent is this particular dataset/item. + * If this object is an item that has been inserted into a sequence, the + * parent is this particular sequence. If this object has not been inserted + * into a dataset/item or sequence, NULL is returned. + * @return pointer to the parent of this object (might be NULL) + */ + inline const DcmObject *getParent() const { return Parent; } + + /** set parent of this object. NULL means no parent. + * NB: This method is used by derived classes for internal purposes only. + * @param parent pointer to the parent of this object + */ + inline void setParent(DcmObject *parent) { Parent = parent; } + + /** return the group number of the attribute tag for this object + * @return group number of the attribute tag for this object + */ + inline Uint16 getGTag() const { return Tag.getGTag(); } + + /** return the element number of the attribute tag for this object + * @return element number of the attribute tag for this object + */ + inline Uint16 getETag() const { return Tag.getETag(); } + + /** return const reference to the attribute tag for this object + * @return const reference to the attribute tag for this object + */ + inline const DcmTag &getTag() const { return Tag; } + + /** assign group tag (but not element tag) of the attribute tag for this object. + * This is sometimes useful when creating repeating group elements. + * @param gtag new attribute group tag + */ + inline void setGTag(Uint16 gtag) { Tag.setGroup(gtag); } + + /** assign a new Value Representation (VR) to this object. This operation + * is only supported for very few subclasses derived from this class, + * in particular for classes handling pixel data which may either be + * of OB or OW value representation. + * @param vr value representation + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVR(DcmEVR /*vr*/) { return EC_IllegalCall; } + + /** get value multiplicity of this object. + * Please note that depending on the Value Representation (VR), subclasses + * derived from this class either return the number of currently stored + * values or the constant value 1 (as defined in the DICOM standard). + * See getNumberOfValues(), which always returns the number of stored values. + * @return value multiplicity of this object + */ + virtual unsigned long getVM() = 0; + + /** get number of values stored in this object + * @return number of values in this object + */ + virtual unsigned long getNumberOfValues() = 0; + + /** calculate the length of this DICOM element when encoded with the + * given transfer syntax and the given encoding type for sequences. + * For elements, the length includes the length of the tag, length field, + * VR field and the value itself, for items and sequences it returns + * the length of the complete item or sequence including delimitation tags + * if applicable. + * @warning Since calcElementLength() returns a 32 bit integer, an + * overflow during calculation is possible for some derived classes that + * actually represent a compound value (e.g. items like DcmPixelItem). + * Such overflows will be detected, in which case the maximum possible + * value will be returned instead, coinciding with DCM_UndefinedLength. + * @param xfer transfer syntax for length calculation + * @param enctype sequence encoding type for length calculation + * @return length of DICOM element + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) = 0; + + /** calculate the value length (without attribute tag, VR and length field) + * of this DICOM element when encoded with the given transfer syntax and + * the given encoding type for sequences. Never returns undefined length. + * @param xfer transfer syntax for length calculation + * @param enctype sequence encoding type for length calculation + * @return value length of DICOM element + */ + virtual Uint32 getLength(const E_TransferSyntax xfer = EXS_LittleEndianImplicit, + const E_EncodingType enctype = EET_UndefinedLength) = 0; + + /** check if this DICOM object can be encoded in the given transfer syntax. + * @param newXfer transfer syntax in which the DICOM object is to be encoded + * @param oldXfer transfer syntax in which the DICOM object was read or created. + * @return true if object can be encoded in desired transfer syntax, false otherwise. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer) = 0; + + /** read object from a stream. + * @param inStream DICOM input stream + * @param ixfer transfer syntax to use when parsing + * @param glenc handling of group length parameters + * @param maxReadLength attribute values larger than this value are skipped + * while parsing and read later upon first access if the stream type supports + * this. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength) = 0; + + /** write object to a stream (abstract) + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) = 0; + + /** write object in XML format to a stream + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, always returns EC_Illegal Call + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format to a stream + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, always returns EC_Illegal Call + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** special write method for creation of digital signatures (abstract) + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) = 0; + + /** returns true if the current object may be included in a digital signature + * @return true if signable, false otherwise + */ + virtual OFBool isSignable() const; + + /** returns true if the object contains an element with Unknown VR at any nesting level + * @return true if the object contains an element with Unknown VR, false otherwise + */ + virtual OFBool containsUnknownVR() const; + + /** check if this object contains non-ASCII characters + * @param checkAllStrings not used in this class + * @return always returns false, i.e. no extended characters used + */ + virtual OFBool containsExtendedCharacters(const OFBool checkAllStrings = OFFalse); + + /** check if this object is affected by SpecificCharacterSet + * @return always returns false, i.e. not affected by SpecificCharacterSet + */ + virtual OFBool isAffectedBySpecificCharacterSet() const; + + /** convert this object from the currently selected source character set to the + * currently selected destination character set (if affected by SpecificCharacterSet) + * @param converter character set converter to be used to convert the element values + * @return always returns EC_Normal, since there is nothing to do in this base class + */ + virtual OFCondition convertCharacterSet(DcmSpecificCharacterSet &converter); + + /** check if this object is empty + * @param normalize normalize value before checking (ignore non-significant characters) + * @return true if object is empty, i.e. has no value, false otherwise + */ + virtual OFBool isEmpty(const OFBool normalize = OFTrue); + + /** clear (remove) attribute value + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear() = 0; + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse) = 0; + + /** this method is only used in container classes derived from this class, + * that is, DcmItem and DcmSequenceOfItems. It returns a pointer to the + * next object in the list AFTER the given object. If the caller passes NULL, + * a pointer to the first object in the list is returned. If the given object + * is not found, the given object is the last one in the list or the list is empty, + * NULL is returned. + * @param obj pointer to one object in the container; we are looking for the + * next entry after this one. NULL if looking for the first entry. + * @return pointer to next object in container or NULL if not found + */ + virtual DcmObject *nextInContainer(const DcmObject *obj); + + /** this method enables a stack based, depth-first traversal of a complete + * hierarchical DICOM dataset (that is, classes derived from DcmItem or + * DcmSequenceOfItems). With each call of this method, the next object + * in the tree is located and marked on the stack. + * @param stack "cursor" for current position in the dataset. The stack + * will contain a pointer to each dataset, sequence, item and element + * from the main dataset down to the current element, and is updated + * upon each call to this method. An empty stack is equivalent to a stack + * containing a pointer to this object only. + * @param intoSub if true, the nextObject method will perform a hierarchical + * search through the dataset (depth-first), if false, only the current + * container object will be traversed (e.g., all elements of an item + * or all items of a sequence). + * @return EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition nextObject(DcmStack &stack, + const OFBool intoSub); + + /** a complex, stack-based, hierarchical search method. It allows for a search + * for a DICOM object with a given attribute within a given container, + * hierarchically, from a starting position identified through a cursor stack. + * @param xtag the DICOM attribute tag we are searching for + * @param resultStack Depending on the search mode (see below), this parameter + * either serves as an input and output parameter, or as an output parameter + * only (the latter being the default). When used as an input parameter, + * the cursor stack defines the start position for the search within a + * hierarchical DICOM dataset. Upon successful return, the stack contains + * the position of the element found, in the form of a pointer to each dataset, + * sequence, item and element from the main dataset down to the found element. + * @param mode search mode, controls how the search stack is handled. + * In the default mode, ESM_fromHere, the stack is ignored on input, and + * the search starts in the object for which this method is called. + * In the other modes, the stack is used both as an input and an output + * parameter and defines the starting point for the search. + * @param searchIntoSub if true, the search will be performed hierarchically descending + * into the sequences and items of the dataset. If false, only the current container + * (sequence or item) will be traversed. + * @return EC_Normal if found, EC_TagNotFound if not found, an error code is something went wrong. + */ + virtual OFCondition search(const DcmTagKey &xtag, + DcmStack &resultStack, + E_SearchMode mode = ESM_fromHere, + OFBool searchIntoSub = OFTrue); + + /** this method loads all attribute values maintained by this object and + * all sub-objects (in case of a container such as DcmDataset) into memory. + * After a call to this method, the file from which a dataset was read may safely + * be deleted or replaced. For large files, this method may obviously allocate large + * amounts of memory. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadAllDataIntoMemory() = 0; + + /** return the current value of the Length field (which is different from the functionality + * of the public getLength() method). Only needed for internal purposes and for checker tools + * that verify values against the length field. + * @return current value of length field + */ + Uint32 getLengthField() const { return Length; } + + protected: + + /** print line indentation, e.g.\ a couple of spaces for each nesting level. + * Depending on the value of 'flags' other visualizations are also possible. + * @param out output stream + * @param flags used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + */ + void printNestingLevel(STD_NAMESPACE ostream &out, + const size_t flags, + const int level); + + /** print beginning of the info line. + * The default output is tag and value representation, though other + * visualizations are possible depending on the value of 'flags'. + * @param out output stream + * @param flags used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param tag optional tag used to print the data element information + */ + void printInfoLineStart(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + DcmTag *tag = NULL); + + /** print end of the info line. + * The default output is length, value multiplicity and tag name, though + * other visualizations are possible depending on the value of 'flags'. + * @param out output stream + * @param flags used to customize the output (see DCMTypes::PF_xxx) + * @param printedLength number of characters printed after line start. + * Used for padding purposes. + * @param tag optional tag used to print the data element information + */ + void printInfoLineEnd(STD_NAMESPACE ostream &out, + const size_t flags, + const unsigned long printedLength = 0xffffffff /*no padding*/, + DcmTag *tag = NULL); + + /** print given text with element information. + * Calls printInfoLineStart() and printInfoLineEnd() to frame the 'info' text. + * @param out output stream + * @param flags used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param info text to be printed + * @param tag optional tag used to print the data element information + * @param isInfo optional flag indicating whether this text is really given for + * informational purposes only. Used to choose the correct output color. + */ + virtual void printInfoLine(STD_NAMESPACE ostream &out, + const size_t flags, + const int level = 0, + const char *info = NULL, + DcmTag *tag = NULL, + const OFBool isInfo = OFTrue); + + /** static helper function that writes a given attribute tag to a binary + * output stream using the byte order indicated by the transfer syntax. + * @param outStream output stream + * @param tag tag to write to the stream + * @param oxfer transfer syntax defining the byte order + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition writeTag(DcmOutputStream &outStream, + const DcmTag &tag, + const E_TransferSyntax oxfer); + + /** write tag, VR and length field to the given output stream + * @param outStream output stream + * @param oxfer transfer syntax for writing + * @param writtenBytes number of bytes written to stream returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeTagAndLength(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, // in + Uint32 &writtenBytes) const; // out + + /** return the number of bytes needed to serialize the + * tag, VR and length information of the current object using the given + * transfer syntax. + * @param oxfer The transfer syntax used for encoding + * @return number of bytes, may be 8 or 12 depending on VR and transfer syntax. + */ + virtual Uint32 getTagAndLengthSize(const E_TransferSyntax oxfer) const; + + /** return the DICOM attribute tag name for this object. If not known yet, will + * be looked up in the dictionary and cached. Therefore, method is not const. + * @return tag name for this attribute + */ + const char *getTagName() { return Tag.getTagName(); } + + /** set the VR for this attribute + * @param vr new VR for this attribute. + */ + void setTagVR(DcmEVR vr) { Tag.setVR(vr); } + + /** return the current transfer state of this object during serialization/deserialization + * @return current transfer state of this object + */ + E_TransferState getTransferState() const { return fTransferState; } + + /** set the current transfer state of this object during serialization/deserialization + * @param newState new transfer state of this object + */ + void setTransferState(E_TransferState newState) { fTransferState = newState; } + + /** return the number of transferred bytes for this object during serialization/deserialization + * @return number of transferred bytes + */ + Uint32 getTransferredBytes() const { return fTransferredBytes; } + + /** set the number of transferred bytes for this object during serialization/deserialization + * @param val number of transferred bytes + */ + void setTransferredBytes(Uint32 val) { fTransferredBytes = val; } + + /** add to the number of transferred bytes for this object during serialization/deserialization + * @param val number of additional transferred bytes to add to existing value + */ + void incTransferredBytes(Uint32 val) { fTransferredBytes += val; } + + /** set the current value of the Length field + * @param val new value of the Length field + */ + void setLengthField(Uint32 val) { Length = val; } + + public: + + /** helper class to print a DcmObject to an ostream using operator<< + */ + class DCMTK_DCMDATA_EXPORT PrintHelper + { + private: + /** Undefined assignment operator. This is needed to work around a + * compiler warning on VC2008 with the highest warning level. + */ + PrintHelper& operator=(PrintHelper &); + + public: + /** construct a PrintHelper + * @param dcmobj DcmObject you want to print + * @param flags flags to use for DcmObject::print() + * @param level level to use for DcmObject::print() + */ + explicit PrintHelper(DcmObject &dcmobj, size_t flags = 0, int level = 0) + : dcmobj_(dcmobj), flags_(flags), level_(level) + {} + + DcmObject &dcmobj_; + const size_t flags_; + const int level_; + }; + + /* member variables */ + + protected: + + /// error flag for this object. + OFCondition errorFlag; + + private: + + /// the DICOM attribute tag and VR for this object + DcmTag Tag; + + /// the length of this attribute as read from stream, may be undefined length + Uint32 Length; + + /// transfer state during read and write operations + E_TransferState fTransferState; + + /// number of bytes already read/written during transfer + Uint32 fTransferredBytes; + + /// pointer to parent object if contained in a dataset/item (might be NULL) + DcmObject *Parent; + }; // class DcmObject + +/** Print a DcmObject::PrintHelper to an ostream. + * @param stream stream to print to + * @param obj object which will be print()ed + * @return the stream argument + */ +static inline STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream &stream, DcmObject::PrintHelper obj) +{ + obj.dcmobj_.print(stream, obj.flags_, obj.level_); + return stream; +} + +#endif // DCOBJECT_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcofsetl.h b/dcmdata/include/dcmtk/dcmdata/dcofsetl.h new file mode 100644 index 00000000..aab2b1d2 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcofsetl.h @@ -0,0 +1,33 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: definition of class DcmOffsetList + * + */ + +#ifndef DCOFSETL_H +#define DCOFSETL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oflist.h" /* for class OFList */ + +/** list of Uint32 values which are interpreted as the offsets + * in a Pixel Data offset table + */ +typedef OFList DcmOffsetList; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcostrma.h b/dcmdata/include/dcmtk/dcmdata/dcostrma.h new file mode 100644 index 00000000..dab197b6 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcostrma.h @@ -0,0 +1,205 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: base classes for output streams + * + */ + +#ifndef DCOSTRMA_H +#define DCOSTRMA_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/ofstd/ofcond.h" /* for OFCondition */ +#include "dcmtk/dcmdata/dcxfer.h" /* for E_StreamCompression */ +#include "dcmtk/ofstd/offile.h" /* for offile_off_t */ + +/** pure virtual abstract base class for consumers, i.e. the final node + * of a filter chain in an output stream. + */ +class DCMTK_DCMDATA_EXPORT DcmConsumer +{ +public: + + /// destructor + virtual ~DcmConsumer() + { + } + + /** returns the status of the consumer. Unless the status is good, + * the consumer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const = 0; + + /** returns the status of the consumer as an OFCondition object. + * Unless the status is good, the consumer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const = 0; + + /** returns true if the consumer is flushed, i.e. has no more data + * pending in it's internal state that needs to be flushed before + * the stream is closed. + * @return true if consumer is flushed, false otherwise + */ + virtual OFBool isFlushed() const = 0; + + /** returns the minimum number of bytes that can be written with the + * next call to write(). The DcmObject write methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only written "en bloc", i.e. all + * or nothing. + * @return minimum of space available in consumer + */ + virtual offile_off_t avail() const = 0; + + /** processes as many bytes as possible from the given input block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually processed. + */ + virtual offile_off_t write(const void *buf, offile_off_t buflen) = 0; + + /** instructs the consumer to flush its internal content until + * either the consumer becomes "flushed" or I/O suspension occurs. + * After a call to flush(), a call to write() will produce undefined + * behaviour. + */ + virtual void flush() = 0; +}; + + +/** pure virtual abstract base class for output filters, i.e. + * intermediate nodes of a filter chain in an output stream. + */ +class DCMTK_DCMDATA_EXPORT DcmOutputFilter: public DcmConsumer +{ +public: + + /// destructor + virtual ~DcmOutputFilter() + { + } + + /** determines the consumer to which the filter is supposed + * to write it's output. Once a consumer for the output filter has + * been defined, it cannot be changed anymore during the lifetime + * of the object. + * @param consumer reference to consumer, must not be circular chain + */ + virtual void append(DcmConsumer& consumer) = 0; +}; + + +/** base class for output streams. + * This class cannot be instantiated since the constructor is protected. + */ +class DCMTK_DCMDATA_EXPORT DcmOutputStream +{ +public: + + /// destructor + virtual ~DcmOutputStream(); + + /** returns the status of the stream. Unless the status is good, + * the stream will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the consumer as an OFCondition object. + * Unless the status is good, the consumer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the stream is flushed, i.e. has no more data + * pending in it's internal state that needs to be flushed before + * the stream is closed. + * @return true if stream is flushed, false otherwise + */ + virtual OFBool isFlushed() const; + + /** returns the minimum number of bytes that can be written with the + * next call to write(). The DcmObject write methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only written "en bloc", i.e. all + * or nothing. + * @return minimum of space available in stream + */ + virtual offile_off_t avail() const; + + /** processes as many bytes as possible from the given input block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually processed. + */ + virtual offile_off_t write(const void *buf, offile_off_t buflen); + + /** instructs the stream to flush its internal content until + * either the stream becomes "flushed" or I/O suspension occurs. + * After a call to flush(), a call to write() will produce undefined + * behaviour. + */ + virtual void flush(); + + /** returns the total number of bytes written to the stream so far + * @return total number of bytes written to the stream + */ + virtual offile_off_t tell() const; + + /** installs a compression filter for the given stream compression type, + * which should be neither ESC_none nor ESC_unsupported. Once a compression + * filter is active, it cannot be deactivated or replaced during the + * lifetime of the stream. + * @param filterType type of compression filter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition installCompressionFilter(E_StreamCompression filterType); + +protected: + + /** protected constructor, to be called from derived class constructor + * @param initial initial pointer to first node in filter chain + * The pointer is not dereferenced in the constructor, so the + * object pointed to may be initialized later in the subclass + * constructor. + */ + DcmOutputStream(DcmConsumer *initial); + +private: + + /// private unimplemented copy constructor + DcmOutputStream(const DcmOutputStream&); + + /// private unimplemented copy assignment operator + DcmOutputStream& operator=(const DcmOutputStream&); + + /// pointer to first node in filter chain + DcmConsumer *current_; + + /// pointer to compression filter, NULL if no compression + DcmOutputFilter *compressionFilter_; + + /// counter for number of bytes written so far + offile_off_t tell_; +}; + + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcostrmb.h b/dcmdata/include/dcmtk/dcmdata/dcostrmb.h new file mode 100644 index 00000000..9e2409a9 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcostrmb.h @@ -0,0 +1,168 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmOutputBufferStream and related classes, + * implements output to blocks of memory as needed in the dcmnet module. + * + */ + +#ifndef DCOSTRMB_H +#define DCOSTRMB_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcostrma.h" + +/** consumer class that stores data in a buffer provided by the caller. + * Used for DICOM network communication. + */ +class DCMTK_DCMDATA_EXPORT DcmBufferConsumer: public DcmConsumer +{ +public: + + /** constructor + * @param buf buffer in which data is stored. Must be allocated + * by caller and remain valid during the lifetime of this object. + * @param bufLen buffer length, must be even number (0 permitted). + */ + DcmBufferConsumer(void *buf, offile_off_t bufLen); + + /// destructor + virtual ~DcmBufferConsumer(); + + /** returns the status of the consumer. Unless the status is good, + * the consumer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the consumer as an OFCondition object. + * Unless the status is good, the consumer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the consumer is flushed, i.e. has no more data + * pending in it's internal state that needs to be flushed before + * the stream is closed. + * @return true if consumer is flushed, false otherwise + */ + virtual OFBool isFlushed() const; + + /** returns the minimum number of bytes that can be written with the + * next call to write(). The DcmObject write methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only written "en bloc", i.e. all + * or nothing. + * @return minimum of space available in consumer + */ + virtual offile_off_t avail() const; + + /** processes as many bytes as possible from the given input block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually processed. + */ + virtual offile_off_t write(const void *buf, offile_off_t buflen); + + /** instructs the consumer to flush its internal content until + * either the consumer becomes "flushed" or I/O suspension occurs. + * After a call to flush(), a call to write() will produce undefined + * behaviour. + */ + virtual void flush(); + + /** retrieves and flushes the underlying buffer. + * After return of this method, the buffer is considered to have + * been flushed (copied, stored) by the caller and is reused + * by the next write operation. + * @param buffer pointer to user provided buffer returned in this parameter + * @param length number of bytes in buffer returned in this parameter + */ + virtual void flushBuffer(void *& buffer, offile_off_t& length); + + /** query the number of bytes in buffer without flushing it. + * @return number of bytes in buffer. + */ + virtual offile_off_t filled(); + +private: + + /// private unimplemented copy constructor + DcmBufferConsumer(const DcmBufferConsumer&); + + /// private unimplemented copy assignment operator + DcmBufferConsumer& operator=(const DcmBufferConsumer&); + + /// the buffer we're actually writing to + unsigned char *buffer_; + + /// size of the buffer, in bytes + offile_off_t bufSize_; + + /// number of bytes filled in buffer + offile_off_t filled_; + + /// status + OFCondition status_; +}; + + +/** output stream that writes into a buffer of fixed length + * which must be provided by the caller. + */ +class DCMTK_DCMDATA_EXPORT DcmOutputBufferStream: public DcmOutputStream +{ +public: + /** constructor + * @param buf buffer in which data is stored. Must be allocated + * by caller and remain valid during the lifetime of this object. + * @param bufLen buffer length, must be even number > 0. + */ + DcmOutputBufferStream(void *buf, offile_off_t bufLen); + + /// destructor + virtual ~DcmOutputBufferStream(); + + /** retrieves and flushes the underlying buffer. + * After return of this method, the buffer is considered to have + * been flushed (copied, stored) by the caller and is reused + * by the next write operation. + * @param buffer pointer to user provided buffer returned in this parameter + * @param length number of bytes in buffer returned in this parameter + */ + virtual void flushBuffer(void *& buffer, offile_off_t& length); + + /** query the number of bytes in buffer without flushing it. + * @return number of bytes in buffer. + */ + virtual offile_off_t filled(); + +private: + + /// private unimplemented copy constructor + DcmOutputBufferStream(const DcmOutputBufferStream&); + + /// private unimplemented copy assignment operator + DcmOutputBufferStream& operator=(const DcmOutputBufferStream&); + + /// the final consumer of the filter chain + DcmBufferConsumer consumer_; + +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcostrmf.h b/dcmdata/include/dcmtk/dcmdata/dcostrmf.h new file mode 100644 index 00000000..dff45220 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcostrmf.h @@ -0,0 +1,142 @@ +/* + * + * Copyright (C) 1994-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmOutputFileStream and related classes, + * implements streamed output to files. + * + */ + +#ifndef DCOSTRMF_H +#define DCOSTRMF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcostrma.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + + +/** consumer class that stores data in a plain file. + */ +class DCMTK_DCMDATA_EXPORT DcmFileConsumer: public DcmConsumer +{ +public: + /** constructor + * @param filename name of file to be created (may contain wide chars + * if support enabled) + */ + DcmFileConsumer(const OFFilename &filename); + + /** constructor + * @param file structure, file must already be open for writing + */ + DcmFileConsumer(FILE *file); + + /// destructor + virtual ~DcmFileConsumer(); + + /** returns the status of the consumer. Unless the status is good, + * the consumer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the consumer as an OFCondition object. + * Unless the status is good, the consumer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the consumer is flushed, i.e. has no more data + * pending in it's internal state that needs to be flushed before + * the stream is closed. + * @return true if consumer is flushed, false otherwise + */ + virtual OFBool isFlushed() const; + + /** returns the minimum number of bytes that can be written with the + * next call to write(). The DcmObject write methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only written "en bloc", i.e. all + * or nothing. + * @return minimum of space available in consumer + */ + virtual offile_off_t avail() const; + + /** processes as many bytes as possible from the given input block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually processed. + */ + virtual offile_off_t write(const void *buf, offile_off_t buflen); + + /** instructs the consumer to flush its internal content until + * either the consumer becomes "flushed" or I/O suspension occurs. + * After a call to flush(), a call to write() will produce undefined + * behaviour. + */ + virtual void flush(); + +private: + + /// private unimplemented copy constructor + DcmFileConsumer(const DcmFileConsumer&); + + /// private unimplemented copy assignment operator + DcmFileConsumer& operator=(const DcmFileConsumer&); + + /// the file we're actually writing to + OFFile file_; + + /// status + OFCondition status_; +}; + + +/** output stream that writes into a plain file + */ +class DCMTK_DCMDATA_EXPORT DcmOutputFileStream: public DcmOutputStream +{ +public: + /** constructor + * @param filename name of file to be created (may contain wide chars + * if support enabled) + */ + DcmOutputFileStream(const OFFilename &filename); + + /** constructor + * @param file structure, file must already be open for writing + */ + DcmOutputFileStream(FILE *file); + + /// destructor + virtual ~DcmOutputFileStream(); + +private: + + /// private unimplemented copy constructor + DcmOutputFileStream(const DcmOutputFileStream&); + + /// private unimplemented copy assignment operator + DcmOutputFileStream& operator=(const DcmOutputFileStream&); + + /// the final consumer of the filter chain + DcmFileConsumer consumer_; +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcostrmz.h b/dcmdata/include/dcmtk/dcmdata/dcostrmz.h new file mode 100644 index 00000000..302cc818 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcostrmz.h @@ -0,0 +1,183 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: zlib compression filter for output streams + * + */ + +#ifndef DCOSTRMZ_H +#define DCOSTRMZ_H + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_ZLIB + +#include "dcmtk/dcmdata/dcostrma.h" /* for DcmOutputFilter */ + +BEGIN_EXTERN_C +#include +END_EXTERN_C + +/** global flag defining the compression level for zlib (deflate) compression. + * Legal values are 0..9. Default is Z_DEFAULT_COMPRESSION which is defined + * to be 6 for the current zlib implementation. + * @remark this flag is only available if DCMTK is compiled with + * ZLIB support enabled. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmZlibCompressionLevel; + +/** zlib compression filter for output streams. + * @remark this class is only available if DCMTK is compiled with + * ZLIB support enabled. + */ +class DCMTK_DCMDATA_EXPORT DcmZLibOutputFilter: public DcmOutputFilter +{ +public: + + /// default constructor + DcmZLibOutputFilter(); + + /// destructor + virtual ~DcmZLibOutputFilter(); + + /** returns the status of the consumer. Unless the status is good, + * the consumer will not permit any operation. + * @return status, true if good + */ + virtual OFBool good() const; + + /** returns the status of the consumer as an OFCondition object. + * Unless the status is good, the consumer will not permit any operation. + * @return status, EC_Normal if good + */ + virtual OFCondition status() const; + + /** returns true if the consumer is flushed, i.e. has no more data + * pending in it's internal state that needs to be flushed before + * the stream is closed. + * @return true if consumer is flushed, false otherwise + */ + virtual OFBool isFlushed() const; + + /** returns the minimum number of bytes that can be written with the + * next call to write(). The DcmObject write methods rely on avail + * to return a value > 0 if there is no I/O suspension since certain + * data such as tag and length are only written "en bloc", i.e. all + * or nothing. + * @return minimum of space available in consumer + */ + virtual offile_off_t avail() const; + + /** processes as many bytes as possible from the given input block. + * @param buf pointer to memory block, must not be NULL + * @param buflen length of memory block + * @return number of bytes actually processed. + */ + virtual offile_off_t write(const void *buf, offile_off_t buflen); + + /** instructs the consumer to flush its internal content until + * either the consumer becomes "flushed" or I/O suspension occurs. + * After a call to flush(), a call to write() will produce undefined + * behaviour. + */ + virtual void flush(); + + /** determines the consumer to which the filter is supposed + * to write it's output. Once a consumer for the output filter has + * been defined, it cannot be changed anymore during the lifetime + * of the object. + * @param consumer reference to consumer, must not be circular chain + */ + virtual void append(DcmConsumer& consumer); + +private: + + /// private unimplemented copy constructor + DcmZLibOutputFilter(const DcmZLibOutputFilter&); + + /// private unimplemented copy assignment operator + DcmZLibOutputFilter& operator=(const DcmZLibOutputFilter&); + + /** writes the content of the output ring buffer + * to the next filter stage until the output ring buffer + * becomes empty or the next filter stage becomes full + */ + void flushOutputBuffer(); + + /** feed data from the given block of data to the compression + * codec until complete or the output ring buffer becomes full. + * Does not flush the output ring buffer. + * @param buf pointer to input data + * @param buflen number of bytes in buf + * @param finalize true if the current block of data constitutes + * the end of the input stream, i.e. the compression codec + * should be forced to flush its internal state. + * @return number of bytes processed + */ + offile_off_t compress(const void *buf, offile_off_t buflen, OFBool finalize); + + /** copies as much of the given block of data as possible + * in the input ring buffer + * @param buf pointer to input data + * @param buflen number of bytes in buf + * @return number of bytes copied to input ring buffer + */ + offile_off_t fillInputBuffer(const void *buf, offile_off_t buflen); + + /** feed data from the input ring buffer to the compression + * codec until complete or the output ring buffer becomes full. + * Does not flush the output ring buffer. + * @param finalize true if the content of the input ring buffer + * constitutes the end of the input stream, i.e. the compression codec + * should be forced to flush its internal state. + */ + void compressInputBuffer(OFBool finalize); + + /// pointer to consumer to which compressed output is written + DcmConsumer *current_; + + /// pointer to struct z_stream object containing the zlib status + z_streamp zstream_; + + /// status + OFCondition status_; + + /// true if the zlib object has reported Z_STREAM_END + OFBool flushed_; + + /// input ring buffer + unsigned char *inputBuf_; + + /// offset of first byte in input ring buffer + offile_off_t inputBufStart_; + + /// number of bytes in input ring buffer + offile_off_t inputBufCount_; + + /// output ring buffer + unsigned char *outputBuf_; + + /// offset of first byte in output ring buffer + offile_off_t outputBufStart_; + + /// number of bytes in output ring buffer + offile_off_t outputBufCount_; + +}; + +#endif +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcovlay.h b/dcmdata/include/dcmtk/dcmdata/dcovlay.h new file mode 100644 index 00000000..062f904f --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcovlay.h @@ -0,0 +1,110 @@ +/* + * + * Copyright (C) 1994-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: Interface of class DcmOverlayData + * + */ + +#ifndef DCOVLAY_H +#define DCOVLAY_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcvrpobw.h" + +/** a class used to represent overlay data (60xx,3000) + */ +class DCMTK_DCMDATA_EXPORT DcmOverlayData : public DcmPolymorphOBOW +{ +public: + + /** constructor + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmOverlayData(const DcmTag &tag, + const Uint32 len = 0) + : DcmPolymorphOBOW(tag, len) + { + } + + /** copy constructor + * @param oldObj element to be copied + */ + DcmOverlayData(const DcmOverlayData &oldObj) + : DcmPolymorphOBOW(oldObj) + { + } + + /** destructor + */ + virtual ~DcmOverlayData() + { + } + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmOverlayData &operator=(const DcmOverlayData &obj) + { + DcmPolymorphOBOW::operator=(obj); + return *this; + } + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmOverlayData(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject &rhs) + { + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmOverlayData &, rhs); + } + return EC_Normal; + } + + /** return identifier for this class. Every class derived from this class + * returns a unique value of type enum DcmEVR for this call. This is used + * as a "poor man's RTTI" to correctly identify instances derived from + * this class even on compilers not supporting RTTI. + * @return type identifier of this class + */ + virtual DcmEVR ident() const + { + return EVR_OverlayData; + } +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcpath.h b/dcmdata/include/dcmtk/dcmdata/dcpath.h new file mode 100644 index 00000000..fe229f38 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcpath.h @@ -0,0 +1,519 @@ +/* + * + * Copyright (C) 2008-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class declarations for accessing DICOM dataset structures (items, + * sequences and leaf elements via string-based path access. + * + */ + +#ifndef DCPATH_H +#define DCPATH_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcdatset.h" + + +/** Class representing a node in DcmPath. A node contains just + * a pointer to a DcmObject (e.g. a sequence or an item). Additionally + * an item number is stored which also makes sense in case that the + * object pointed to is an item. The item number is necessary because + * when having only a pointer to a DcmItem there is no way to find out + * at which position the item actually has in the surrounding sequence. + */ +class DCMTK_DCMDATA_EXPORT DcmPathNode +{ + +public: + + /** Constructor. Creates empty path node. + */ + DcmPathNode() : m_obj(NULL), m_itemNo(0) {} + + /** Constructor. Creates search node from object pointer and item number. + * @param obj [in] The object the search node points to. The memory of the + * given DICOM object is not handled by the node itself but + * must be handled (i.e. freed) from outside. + * @param itemNo [in] The item number that should be set. Only relevant + * if obj parameter contains an item + */ + DcmPathNode(DcmObject* obj, Uint32 itemNo) : m_obj(obj), m_itemNo(itemNo) {} + + /** Destructor. Nothing to do, the DICOM object is not freed automatically! + */ + ~DcmPathNode() { } + + /// Pointer to object this search node points to + DcmObject* m_obj; + + /// The item number of the item in m_obj; only useful if m_obj is an item + Uint32 m_itemNo; + +private: + + /** Private undefined copy constructor + */ + DcmPathNode(const DcmPathNode& rhs); + + /** Private undefined assignment operator + */ + DcmPathNode& operator=(const DcmPathNode& arg); +}; + + +/** Class representing a path of DICOM objects. A path is a "way" through + * a DICOM dataset, i.e. it starts e.g. with an item, followed by a sequence + * originally contained in this item. The sequence then could be followed by + * another item which is part of the sequence and so on. Thus the path + * should be well-formed, but if it is created manually (e.g. using append()) + * there is no corresponding checking. + */ +class DCMTK_DCMDATA_EXPORT DcmPath +{ + +public: + + /** Constructor, creates an empty search result + */ + DcmPath(); + + /** Constructor, creates a search result from a list of search nodes. + * @param currentPath [in] The list of search nodes representing a + * "path" through a DICOM dataset + */ + DcmPath(const OFList& currentPath); + + /** Appends a search node at the end of the search result path. It is not + * checked whether the resulting path is still valid. + * @param node [in] The node to append. + * + */ + void append(DcmPathNode* node); + + /** Removes last path node from path. Also frees memory of path node + * but does _not_ free memory of the underlying DICOM item or element. + * @return none + */ + void deleteBackNode(); + + /** Returns iterator pointing to first path component. + * @return Iterator to first path node. + */ + OFListIterator(DcmPathNode*) begin(); + + /** Returns last path component. + * @return The last path component, NULL if none exists. + */ + DcmPathNode* back(); + + /** Returns iterator pointing to last path component. + * @return Iterator to last path node. + */ + OFListIterator(DcmPathNode*) end(); + + /** Returns number of path components. + * @return The number of path components + */ + Uint32 size() const; + + /** Returns whether path is empty, ie does not contain any path nodes + * @return OFTrue, if path is empty, OFFalse otherwise + */ + OFBool empty() const; + + /** Returns a string representation of the path, + * e.g.\ "SourceImageSequence[0].ReferencedSOPInstanceUID" + * @return String representing path + */ + OFString toString() const; + + /** Returns whether the path contains tags of a given group. + * Might be useful for looking after (unwanted) meta header tags etc. + * @param groupNo [in] The group number to look for + * @return OFTrue if group number is found in path, OFFalse otherwise + */ + OFBool containsGroup(const Uint16 groupNo) const; + + /** Returns a string representation of each path node separately. + * Tags are represented as numbers surrounded by braces "(gggg,eeee)", + * not dictionary names. Items are represented by a number or wildcard + * in square brackets, eg. "[12]" or "[*]". + * @param path The path to parse into different nodes + * @param result [out] List containing the resulting strings + * @return none + */ + static OFCondition separatePathNodes(const OFString& path, OFList& result); + + /** Helper function for findOrCreatePath(). Parses an item number from + * the beginning of the path string. The item number must be positive, + * starting with 0. + * The path must start like "[itemnumber]...". + * @param path [in/out] The path starting with the item number in square + * brackets, e.g.\ "[3]". The parsed item number and a + * potentially following "." are removed from the path + * @param itemNo [out] The parsed item number. If a wildcard was parsed, + * this output parameter is not set at all. + * @param wasWildcard [out] Is set to OFTrue, if wildcard was parsed + * (instead of concrete item number). + * @return EC_Normal, if concrete item number or wildcard was parsed + */ + static OFCondition parseItemNoFromPath(OFString& path, // inout + Uint32& itemNo, // out + OFBool& wasWildcard); // out + + /** Function that parses a tag from the beginning of a path string. + * The tag has to be either in numeric format, e.g. "(0010,0010)" or + * a dictionary name, e.g. "PatientName". If successful, the + * parsed tag is removed from the path string. + * @param path [in/out] The path string, starting with the attribute + * to parse + * @param tag [out] The tag parsed + * @return EC_Normal if successful, error code otherwise + */ + static OFCondition parseTagFromPath(OFString& path, // inout + DcmTag& tag); // out + + /** Desctructor, cleans up memory of path nodes. Does not delete + * the DcmObjects the nodes point to (this is also not done + * by the desctructor of the path nodes, so the caller is responsible + * for freeing any related DICOM objects. + */ + ~DcmPath(); + +private: + + /// Internal list representing the nodes in the path. + OFList m_path; + + /** Private undefined copy constructor + */ + DcmPath(const DcmPath& rhs); + + /** Private undefined assignment operator + */ + DcmPath& operator=(const DcmPath& arg); +}; + + +class DCMTK_DCMDATA_EXPORT DcmPathProcessor +{ + +public: + + /** Constructor, creates an empty search object. + */ + DcmPathProcessor(); + + /** Sets whether searching/creating paths will support wildcard for + * items. If set to false, any path operation with item wildcard characters + * will return an error. + * @param supported [in] If true, wildcard are enabled (default) + * If false, item wildcard support is disabled. + */ + void setItemWildcardSupport(const OFBool supported); + + + /** Enables (class default: enabled) or disables checking of private + * reservations when inserting private tags. If enabled and a private + * tag is created that has no private reservation, an error is returned. + * If disabled, it is possible to insert private tags that do not have + * a reservation in the corresponding item/dataset. + * @param doChecking [in] OFTrue enables reservation checking, + * OFFalse disables it. + */ + void checkPrivateReservations(const OFBool doChecking); + + /** Checks in item, whether a private reservation for a given + * tag key exists. + * @param item [in] The item to search in + * @param tagKey [in/out] The tag to be checked. + * @param privateCreator [in] The private creator to check for (if known, + * can be left empty) + * @return Return EC_Normal if reservation checking was successful. + * Otherwise an error code is returned. + */ + static OFCondition checkPrivateTagReservation(DcmItem* item, + const DcmTagKey& tagKey, + const OFString& privateCreator = ""); + + /** Checks in item, whether a private reservation for a given + * tag key. If so, a dictionary lookup is performed and the VR and private + * creator of the tag is updated correspondingly. + * @param item [in] The item to search in + * @param tag [in/out] The tag to be checked. Will be updated with VR and + * private creator. + * @param privateCreator [in] The private creator to check for (if known, + * can be left empty) + * @return Return EC_Normal if reservation checking and updating the + * tag was successful. Otherwise an error code is returned. + */ + static OFCondition checkPrivateTagReservation(DcmItem* item, + DcmTag& tag, + const OFString& privateCreator = ""); + + /** Function that allows for finding and/or inserting a hierarchy of items + * and attributes as defined by a path string; also returns a list of + * pointers for each successfully found or inserted paths. Every list + * contains pointers pointing to all the objects along the path + * starting from the object given as parameter. The pointer to the + * starting object will not be part of the result. + * + * In principle, the path string must have the following format (in + * arbitrary depth). Note that for searching a sequence, the example + * below would start with [ITEMNO] instead: + * SEQUENCE[ITEMNO].SEQUENCE[ITEMNO].ATTRIBUTE + * . ITEMNO must be a positive integer starting with 0. + * SEQUENCE and ATTRIBUTE must be a tag, written e.g. + * "(0010,0010)" or as a dictionary name, e.g. "PatientName". If the + * path cannot be fully created (see option createIfNecessary), any + * possibly object changes are reverted. So a path is either fully created + * or no path component is created at all. The result can be obtained + * by calling the getResults() function. + * + * Example: The path + * "ContentSequence[4].(0040,a043)[0].CodeValue" selects the Content + * Sequence in the given object, therein the 5th item, therein the "Concept + * Name Code Sequence" denoted by (0040,a043), therein the first item + * and finally therein the tag "Code Value". + * The resulting object list should (if success is returned) contain + * 1 result, consisting of a list with 5 pointers to 5 objects in the order + * in their logical order as they occur in the path string + * (in total 2 sequences, 2 items, and one leaf attribute). + * @param obj [in] The object to search (or create) a path in + * @param path [in] The path either starting with an attribute (either a + * sequence or a leaf attribute as a dictionary name or tag) or + * starting with an item + * @param createIfNecessary [in] If set, all missing objects found + * in the path string are created. If not set, + * only existing paths can be accessed and + * no new attribute or item is created. + * @return EC_Normal if successful, error code otherwise. + */ + OFCondition findOrCreatePath(DcmObject* obj, + const OFString& path, + OFBool createIfNecessary = OFFalse); + + /** Function that allows for deleting elements and items from + * a DICOM object tree. + * In principle, the path string must have the following format (in + * arbitrary depth). Note that for searching in a sequence, the example + * below would start with [ITEMNO] instead: + * SEQUENCE[ITEMNO].SEQUENCE[ITEMNO].ATTRIBUTE + * . ITEMNO must be a positive integer starting with 0. + * SEQUENCE and ATTRIBUTE must be a tag, written e.g. + * "(0010,0010)" or as a dictionary name, e.g. "PatientName". + * + * Example: The path + * "ContentSequence[4].(0040,a043)[0].CodeValue" selects the Content + * Sequence in the given object, therein the 5th item, therein the "Concept + * Name Code Sequence" denoted by (0040,a043), therein the first item + * and finally therein the tag "Code Value". Only "Code Value" will be + * deleted by the function. + * @param obj [in] The object to delete attribute or item from + * @param path [in] The path either starting with an attribute (either a + * sequence or a leaf attribute as a dictionary name or tag) or + * starting with an item + * @param numDeleted [out] Number of deleted attributes/items + * @return EC_Normal if successful, error code otherwise. If the desired + * attribute/item was not found, EC_TagNotFound is returned. + */ + OFCondition findOrDeletePath(DcmObject* obj, + const OFString& path, + Uint32& numDeleted); + + /** Returns the results from the search / creation call. + * @param searchResults [out] The resulting paths that were created/searched + * Note that the memory of the search results is freed + * automatically by the destructor and must not be freed + * by the caller. + * @return Number of results returned + */ + Uint32 getResults(OFList& searchResults); + + + /** Helper function that applies a specified "override key" in path syntax + * to the given dataset. The name "override" indicates that these keys have + * higher precedence than identical keys in a request dataset that might + * possibly read from a DICOM query file. + * @param dataset [in/out] the dataset (e.g.\ query keys) the override key is + * applied to. Must be non-NULL. + * @param overrideKey [in] the override key in path syntax (see class DcmPath). + * Also the path can end with a value assignment, e.g. + * "PatientName=Doe^John". An empty (or missing value) will + * not be ignored but will be written as empty to the + * attribute (if not a sequence or item). + * @return EC_Normal if adding was successful, error code otherwise + */ + OFCondition applyPathWithValue(DcmDataset* dataset, + const OFString& overrideKey); + + /** Destructor, cleans up memory that was allocated for any search results. + */ + ~DcmPathProcessor(); + +protected: + + /** Function that allows for finding and/or inserting a hierarchy of items + * and attributes as defined by a path string; also returns a list of + * pointers for each successfully found or inserted paths. Every list + * contains pointers pointing to all the objects along the path + * starting from the object given as parameter. The pointer to the + * starting object will not be part of the result. + * + * In principle, the path string must have the following format (in + * arbitrary depth). + * SEQUENCE[ITEMNO].SEQUENCE[ITEMNO].ATTRIBUTE + * . ITEMNO must be a positive integer starting with 0. + * SEQUENCE and ATTRIBUTE must be a tag, written e.g. + * "(0010,0010)" or as a dictionary name, e.g. "PatientName". If the + * path cannot be fully created (see option createIfNecessary), any + * possibly object changes are reverted. So a path is either fully created + * or no path component is created at all. The result can be obtained + * by calling the getResults() function. + * + * Example: The path + * "ContentSequence[4].(0040,a043)[0].CodeValue" selects the Content + * Sequence in the given item, therein the 5th item, therein the "Concept + * Name Code Sequence" denoted by (0040,a043), therein the first item + * and finally therein the tag "Code Value". + * The resulting object list should (if success is returned) contain + * 1 result, consisting of a list with 5 pointers to 5 objects in the order + * in their logical order as they occur in the path string + * (in total 2 sequences, 2 items, and one leaf attribute). + * @param item [in] The object to search (or create) a path in + * @param path [in] The path starting with an attribute (either a + * sequence or a leaf attribute) as a dictionary name or tag. + * The parsed attribute is removed from the path string. + * @return EC_Normal if successful, error code otherwise. + */ + OFCondition findOrCreateItemPath(DcmItem* item, + OFString& path); + + /** Function that allows for finding and/or inserting a hierarchy of items + * and attributes as defined by a path string; also returns a list of + * pointers for each successfully found or inserted paths. Every list + * contains pointers pointing to all the objects along the path + * starting from the object given as parameter. The pointer to the + * starting object will not be part of the result. + * + * In principle, the path string must have the following format (in + * arbitrary depth). + * [ITEMNO].SEQUENCE[ITEMNO].ATTRIBUTE + * . ITEMNO must be a positive integer starting with 0. + * SEQUENCE and ATTRIBUTE must be a tag, written e.g. + * "(0010,0010)" or as a dictionary name, e.g. "PatientName". If the + * path cannot be fully created (see option createIfNecessary), any + * possibly object changes are reverted. So a path is either fully created + * or no path component is created at all. The result can be obtained + * by calling the getResults() function. + * + * Example: The path + * "[4].(0040,a043)[0].CodeValue" selects the 5th item in the given + * sequence, therein the "Concept Name Code Sequence" denoted by + * (0040,a043), therein the first item and finally therein the + * tag "Code Value". + * The resulting object list should (if success is returned) contain + * 1 result, consisting of a list with 4 pointers to 4 objects in the order + * in their logical order as they occur in the path string + * (in total 1 sequence, 2 items, and one leaf element). + * @param seq [in] The object to search (or create) a path in + * @param path [in] The path starting with an item. The parsed item number + * (e.g. "[0]") is removed from the path string. + * @return EC_Normal if successful, error code otherwise. + */ + OFCondition findOrCreateSequencePath(DcmSequenceOfItems* seq, + OFString& path); + + /** Helper function that looks at the last node in a given path and deletes + * the corresponding DICOM object. Does not delete the path node itself: + * That is done by the calling function, findOrCreateItemPath(). + * @param objSearchedIn [in/out] The object the given path starts in. + * @param path [in/out] The complete path to the DICOM object to delete + * @param toDelete [in/out] The path node to delete. This node must be + * identical to the last node in the path parameter. Also + * the node must represent a DICOM sequence or leaf element, + * not an item. However, because it is isolated already by + * the calling function, it is provided here for convenience. + */ + static OFCondition deleteLastElemFromPath(DcmObject* objSearchedIn, + DcmPath* path, + DcmPathNode* toDelete); + + /** Helper function that looks at the last node in a given path and deletes + * the corresponding DICOM object. Does not delete the path node itself: + * That is done by the calling function, findOrCreateItemPath(). + * @param objSearchedIn [in/out] The object the given path starts in. + * @param path [in/out] The complete path to the DICOM object to delete + * @param toDelete [in/out] The path node to delete. This node must be + * identical to the last node in the path parameter. Also + * the node must represent a DICOM item, not a sequence + * However, because it is isolated already by the calling + * function, it is provided here for convenience. + */ + static OFCondition deleteLastItemFromPath(DcmObject* objSearchedIn, + DcmPath* path, + DcmPathNode* toDelete); + + /** Returns the private reservation tag key for a given private tag + * @param privateKey [in] The private key to calculate reservation tag for + * @return The reservation key. If given key is not private or an error, + * return DCM_UndefinedTagKey. If the given key is a reservation + * itself, it is directly returned. + */ + static DcmTagKey calcPrivateReservationTag(const DcmTagKey& privateKey); + + /** Cleans up memory that was allocated for any search results. + * Called when a new search is started or during object destruction. + * The DICOM data all freed paths and path nodes point to, is not + * touched, i.e. all memory to the DICOM objects pointed to must be + * freed from outside. Processing options like checking for private + * reservations and so on are not reset to default values but + * keep valid. + */ + void clear(); + +private: + + /// Internal list that is during search for keeping track of current path + OFList m_currentPath; + + /// Internal list that represents the search results found + OFList m_results; + + /// Denotes whether missing items/sequences/attributes should be + /// automatically inserted when using findAndCreate routines + OFBool m_createIfNecessary; + + /// If enabled (default), any insertions of private tags will fail, if no + /// corresponding reservation exists in the underlying item + OFBool m_checkPrivateReservations; + + /// Denotes, whether a path is accepted that contains wildcards. + /// If false, then any search containing wildcards will return an error. + OFBool m_itemWildcardsEnabled; + + /** Private undefined copy constructor + */ + DcmPathProcessor(const DcmPathProcessor& rhs); + + /** Private undefined assignment operator + */ + DcmPathProcessor& operator=(const DcmPathProcessor& arg); +}; + + +#endif // DCPATH_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcpcache.h b/dcmdata/include/dcmtk/dcmdata/dcpcache.h new file mode 100644 index 00000000..c1d87cdb --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcpcache.h @@ -0,0 +1,115 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: class DcmPrivateTagCache + * + */ + +#ifndef DCPCACHE_H +#define DCPCACHE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/ofstd/oflist.h" /* for OFList */ +#include "dcmtk/ofstd/ofstring.h" /* for OFString */ +#include "dcmtk/dcmdata/dctagkey.h" /* for DcmTagKey */ + +class DcmObject; + +/** class handling one entry of the Private Tag Cache List + */ +class DCMTK_DCMDATA_EXPORT DcmPrivateTagCacheEntry +{ +public: + /** constructor + * @param tk tag key for private creator element + * @param pc private creator name, must not be NULL or empty string + */ + DcmPrivateTagCacheEntry(const DcmTagKey& tk, const char *pc); + + /// destructor + virtual ~DcmPrivateTagCacheEntry(); + + /** returns the private creator name + */ + const char *getPrivateCreator() const; + + /** checks if this element is the private creator for the element + * with the given tag key + * @param tk tag key to check + * @return OFTrue if this element contains the matching private creator, + * OFFalse otherwise. + */ + OFBool isPrivateCreatorFor(const DcmTagKey& tk) const; + +private: + + /// private undefined copy constructor + DcmPrivateTagCacheEntry(const DcmPrivateTagCacheEntry&); + + /// private undefined copy assignment operator + DcmPrivateTagCacheEntry& operator=(const DcmPrivateTagCacheEntry&); + + /// the tag key of the private creator element + DcmTagKey tagKey; + + /// the private creator name + OFString privateCreator; +}; + + +/** this class implements a cache of Private Creator elements + * and corresponding reserved tag numbers. + */ +class DCMTK_DCMDATA_EXPORT DcmPrivateTagCache +{ +public: + /// default constructor + DcmPrivateTagCache(); + + /// destructor + virtual ~DcmPrivateTagCache(); + + /// resets the cache to default-constructed state + void clear(); + + /** looks up the private creator name for the given private tag + * @param tk private tag to check + * @return private creator name if found, NULL otherwise. + */ + const char *findPrivateCreator(const DcmTagKey& tk) const; + + /** updates the private creator cache with the given object. + * If the object points to a private creator element, + * the tag key and creator code are added to the cache. + * Otherwise, the cache remains unmodified. + */ + void updateCache(DcmObject *dobj); + +private: + + /// private undefined copy constructor + DcmPrivateTagCache(const DcmPrivateTagCache&); + + /// private undefined copy assignment operator + DcmPrivateTagCache& operator=(const DcmPrivateTagCache&); + + /// the list + OFList list_; +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcpixel.h b/dcmdata/include/dcmtk/dcmdata/dcpixel.h new file mode 100644 index 00000000..3235f9d2 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcpixel.h @@ -0,0 +1,631 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: Interface of class DcmPixelData + * + */ + +#ifndef DCPIXEL_H +#define DCPIXEL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcvrpobw.h" +#include "dcmtk/ofstd/oflist.h" + +class DcmCodec; +class DcmCodecList; +class DcmItem; +class DcmPixelData; +class DcmPixelSequence; +class DcmRepresentationEntry; +class DcmStack; + +/** abstract base class for codec representation parameter sets. + * A codec parameter set subclass is implemented for each codec and passed to the codec + * by the encode() and decode() routines. It is supposed to contain data that may vary + * between compressed image representations using the same transfer syntax, + * for example the quality factor or compression factor for lossy compression. + */ +class DCMTK_DCMDATA_EXPORT DcmRepresentationParameter +{ +public: + /// default constructor + DcmRepresentationParameter() {} + + /// copy constructor + DcmRepresentationParameter(const DcmRepresentationParameter&) {} + + /// destructor + virtual ~DcmRepresentationParameter() {} + + /** this methods creates a copy of type DcmRepresentationParameter * + * it must be overwritten in every subclass. + * @return copy of this object + */ + virtual DcmRepresentationParameter *clone() const = 0; + + /** returns the class name as string. + * can be used in operator== as poor man's RTTI replacement. + */ + virtual const char *className() const = 0; + + /** compares an object to another DcmRepresentationParameter. + * Implementation must make sure that classes are comparable. + * @param arg representation parameter to compare with + * @return true if equal, false otherwise. + */ + virtual OFBool operator==(const DcmRepresentationParameter &arg) const = 0; +}; + + +/** an object of this class maintains one compression "version" + * of a PixelData element within a DICOM dataset. There can be + * multiple compressed versions in parallel, with different + * transfer syntaxes (compression algorithms) or representation + * parameters (e.g. compression factors). + */ +class DCMTK_DCMDATA_EXPORT DcmRepresentationEntry +{ + /** constructor + * @param rt transfer syntax + * @param rp pointer to representation parameter on heap, + * will be deleted when this object destructs. + * @param pixSeq pointer to pixel sequence on heap, + * will be deleted when this object destructs. + */ + DcmRepresentationEntry( + const E_TransferSyntax rt, + const DcmRepresentationParameter * rp, + DcmPixelSequence * pixSeq); + + /// copy constructor + DcmRepresentationEntry(const DcmRepresentationEntry &oldEntry); + + /// destructor + ~DcmRepresentationEntry(); + + /// comparison operator + OFBool operator==(const DcmRepresentationEntry& x) const; + + /// comparison operator + OFBool operator!=(const DcmRepresentationEntry & x) const + { + return !(*this == x); + } + +private: + /// private undefined copy assignment operator + DcmRepresentationEntry &operator=(const DcmRepresentationEntry &); + + /// transfer syntax + E_TransferSyntax repType; + + /// representation parameter for this pixel sequence + DcmRepresentationParameter * repParam; + + /// the compressed pixel sequence itself + DcmPixelSequence * pixSeq; + + friend class DcmPixelData; +}; + +/// list of DcmRepresentationEntry objects +typedef OFList DcmRepresentationList; + +/// iterator for list of DcmRepresentationEntry objects +typedef OFListIterator(DcmRepresentationEntry *) DcmRepresentationListIterator; + +/// const iterator for list of DcmRepresentationEntry objects +typedef OFListConstIterator(DcmRepresentationEntry *) DcmRepresentationListConstIterator; + +/** The class DcmPixelData stores different pixel representations identified by + * a type (the transfer syntax) and some representation parameters + * The three unencapsulated transfer syntaxes belong to the same pixel + * representation. + * A type (or transfer syntax) conforms to a representation if + * the type and the representation type are equal or both are unencapsulated. + * If this is valid for the representation read or set by chooseRepresentation + * then this representation is the conforming representation. + * else a representation with the default parameter set defined in the + * codec is the conforming representation. + */ +class DCMTK_DCMDATA_EXPORT DcmPixelData : public DcmPolymorphOBOW +{ +private: + friend class DcmRepresentationEntry; + + /// List of representations of pixel data + DcmRepresentationList repList; + + /// Iterator to the last dummy element in representation list + DcmRepresentationListIterator repListEnd; + + /// Iterator to the original representation. if an uncompressed + /// representation is used the iterator points to repList.end() + DcmRepresentationListIterator original; + + /// current list element for some operations + DcmRepresentationListIterator current; + + /// shows if an unencapsulated representation is stored + OFBool existUnencapsulated; + + /** this flag indicates that this pixel data element will be written + * in uncompressed (defined length) format even if the dataset + * itself is written in a compressed syntax where pixel data is normally + * written in encapsulated (undefined length) format. + * By default this flag is false, unless the dataset was read in an + * encapsulated transfer syntax and this pixel data element was already + * present in uncompressed format. + */ + OFBool alwaysUnencapsulated; + + /// value representation of unencapsulated data + DcmEVR unencapsulatedVR; + + /// in write function: pointer to current pixel sequence + DcmPixelSequence * pixelSeqForWrite; + + /** check if this element should be written unencapsulated, even though an + * encapsulated transfer syntax is used. In other words, this checks if + * this pixel data element is on the main level on the dataset or not. + * @param xfer the transfer syntax that should be used + */ + OFBool writeUnencapsulated(const E_TransferSyntax xfer); + + /** This function removes all pixel representations from the list + * of pixel representations except the one which was passed. Note + * that if parameter leaveInList equals repListEnd, all representations + * will be removed from the list. + * @param leaveInList Iterator to a representation which shall not + * be removed from the list of representations. + */ + void clearRepresentationList( + DcmRepresentationListIterator leaveInList); + + /** find a conforming representation in the list of + * encapsulated representations + */ + OFCondition findConformingEncapsulatedRepresentation( + const DcmXfer & repType, + const DcmRepresentationParameter * repParam, + DcmRepresentationListIterator & result); + + /** find a representation entry and return an iterator to the found entry + * or the next element in the list. The condition returned can be EC_Normal + * if such an entry is found or EC_RepresentationNotFound. The pixSeq + * attribute in findEntry can be NULL, it is not needed for the find + * operation! + */ + OFCondition findRepresentationEntry( + const DcmRepresentationEntry & findEntry, + DcmRepresentationListIterator & result); + + /** insert or replace a representation entry in the list + */ + DcmRepresentationListIterator insertRepresentationEntry( + DcmRepresentationEntry * repEntry); + + /** decode representation to unencapsulated format + */ + OFCondition decode( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + DcmStack & pixelStack); + + /** encode to encapsulated format + */ + OFCondition encode( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmXfer & toType, + const DcmRepresentationParameter *toParam, + DcmStack & pixelStack); + + /** set the current VR, which is always OB if the currently selected + * pixel representation is compressed, and may be OB or OW for uncompressed. + */ + void recalcVR() + { + if (current == repList.end()) setTagVR(unencapsulatedVR); + else setTagVR(EVR_OB); + } + +public: + + /** constructor. + * Create new element from given tag and length. + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmPixelData(const DcmTag & tag, const Uint32 len = 0); + + /** copy constructor + * @param pixelData element to be copied + */ + DcmPixelData(const DcmPixelData & pixelData); + + /// destructor + virtual ~DcmPixelData(); + + /** copy assignment operator + * @param obj element to be copied + */ + DcmPixelData &operator=(const DcmPixelData &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmPixelData(*this); + } + + /** comparison operator that compares the value of this element + * with a given element of the same type (e.g. an DcmPixelData with a + * DcmPixelData). The tag of the element is also considered as the first + * component that is compared, followed by the object types (VR, i.e. DCMTK'S EVR). + * The DcmPixelData implementation checks whether the uncompressed data of + * both objects are identical, and if not provided, if the compressed data + * of both objects is the same, by comparing the pixel items bytewise. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 is returned if rhs is considered greater than this object. + * 1 is returned if rhs is considered smaller than this object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** set/change the current value representation of the uncompressed image representation, if any + * @param vr new value representation to be set. All VRs except for OW (Other + * Word String) are treated as 8 bit data (OB). This is particularly useful + * for unknown (UN) or unsupported VRs. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVR(DcmEVR vr); + + /** return identifier for this class. Every class derived from this class + * returns a unique value of type enum DcmEVR for this call. This is used + * as a "poor man's RTTI" to correctly identify instances derived from + * this class even on compilers not supporting RTTI. + * @return type identifier of this class + */ + virtual DcmEVR ident() const { return EVR_PixelData; } + + /** print all elements of the item to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName optional filename used to write the raw pixel data file + * @param pixelCounter optional counter used for automatic pixel data filename creation + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** tests if it is possible to write a specific representation + * Only existing representations are considered, since this + * method does not create a representation. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer); + + /** returns length of representation conforming to the + * transfer syntax with tag, vr, ... It does not create a + * representation. If no conforming representation exists an + * error code is set and 0 returned. + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** returns length of representation value field conforming to + * given transfer syntax. It does not create a representation. + * If no conforming representation exists, an error code is set + * and 0 returned. + */ + virtual Uint32 getLength( + const E_TransferSyntax xfer = EXS_LittleEndianImplicit, + const E_EncodingType enctype = EET_UndefinedLength); + + /** initialize the transfer state of this object. This method must be called + * before this object is written to a stream or read (parsed) from a stream. + */ + virtual void transferInit(); + + /** This function reads the data value of a pixel data attribute + * which is captured in the input stream and captures this + * information in this. This function takes into account, if the + * pixel data is captured in native (uncompressed) or encapsulated + * (compressed) format. + * @param inStream The stream which contains the information. + * @param ixfer The transfer syntax which was used to encode the + * information in inStream. + * @param glenc Encoding type for group length; specifies what + * will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** writes a representation conforming to the transfer syntax + * It does not create a representation. If no conforming + * representation exists, an error code is returned. + * The written representation is the new current representation + */ + virtual OFCondition write( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** this method loads all attribute values maintained by this object and + * all sub-objects (in case of a container such as DcmDataset) into memory. + * After a call to this method, the file from which a dataset was read may safely + * be deleted or replaced. For large files, this method may obviously allocate large + * amounts of memory. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadAllDataIntoMemory(void); + + + /** finalize the transfer state of this object. This method must be called + * when reading/writing this object from/to a stream has been completed. + */ + virtual void transferEnd(); + + /** test if it is possible to choose the representation in the parameters + */ + OFBool canChooseRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam); + + /** choose a specific representation. if representation does not exist + * it is created (if possible). + * if repParam is zero, a representation is chosen or created that + * is equal to the default representation parameters + */ + OFCondition chooseRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam, + DcmStack & stack); + + /** Inserts an original encapsulated representation. current and original + * representations are changed, all old representations are deleted + */ + void putOriginalRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam, + DcmPixelSequence * pixSeq); + + /**insert an original unencapsulated + * representation. current and original representations are changed, + * all old representations are deleted. The array data is copied. + */ + virtual OFCondition putUint8Array( + const Uint8 * byteValue, + const unsigned long length); + + /** insert an original unencapsulated + * representation. current and original representations are changed, + * all old representations are deleted. The array data is copied. + */ + virtual OFCondition putUint16Array( + const Uint16 * wordValue, + const unsigned long length); + + /** create an empty Uint8 array of given number of bytes and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to certain VRs, e.g. OB. + * @param numBytes number of bytes (8 bit) to be created + * @param bytes stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint8Array( + const Uint32 numBytes, + Uint8 * & bytes); + + /** create an empty Uint16 array of given number of words and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to OW data. + * @param numWords number of words (16 bit) to be created + * @param words stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint16Array( + const Uint32 numWords, + Uint16 * & words); + + /** replace the attribute value with the content of the given temporary file. + * The temporary file is not opened/loaded until the attribute value is accessed, + * very much like large attributes that remain in file during a read operation. + * @param factory a factory object that is able to create an input stream + * to the temporary file at the right location. + * @param length attribute value length, in bytes. Must be even length. + * The length is not checked against the real length of the temporary file, + * which might be written or completed after the call to this method. + * @param byteOrder byte order in the temporary file + * @return EC_Normal upon success, an error code otherwise. + */ + virtual OFCondition createValueFromTempFile( + DcmInputStreamFactory *factory, + const Uint32 length, + const E_ByteOrder byteOrder); + + /** get a specific existing Representation, creates no representation + * if repParam is NULL, then the representation conforming to the default + * representationParameters (defined with the codec) is returned. + */ + OFCondition getEncapsulatedRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam, + DcmPixelSequence * & pixSeq); + + /** returns the representation identification (key) consisting of + * representation type and parameter of the original representation + */ + void getOriginalRepresentationKey( + E_TransferSyntax & repType, + const DcmRepresentationParameter * & repParam); + + /** returns the representation identification (key) consisting of + * representation type and parameter of the current representation + */ + void getCurrentRepresentationKey( + E_TransferSyntax & repType, + const DcmRepresentationParameter * & repParam); + + /** sets the representation identification parameter of the current + * representation + */ + OFCondition setCurrentRepresentationParameter( + const DcmRepresentationParameter * repParam); + + /** returns if a specific conforming representation exists. + */ + OFBool hasRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam = NULL); + + /** delete a representation. It is not possible to delete the + * original representation with this method + */ + OFCondition removeRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam); + + /** removes all but the original representation + */ + void removeAllButOriginalRepresentations(); + + /** removes all but the current representation. + * Makes the current representation original. + */ + void removeAllButCurrentRepresentations(); + + /** delete original representation and set new original representation. + * If the new representation does not exist, the original one is not + * deleted and an error code returns + */ + OFCondition removeOriginalRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam); + + /** set or clear the flag that indicates that this pixel data element will be + * written in uncompressed (defined length) format even if the dataset + * itself is written in a compressed syntax where pixel data is normally + * written in encapsulated (undefined length) format. By default this flag + * is false, unless the dataset was read in an encapsulated transfer syntax + * and this pixel data element was already present in uncompressed format. + * This flag should never be enabled for pixel data elements on the main dataset + * level, only for pixel data elements within the icon image sequence or some + * other "private" place. + * @param flag new value of flag + */ + void setNonEncapsulationFlag(OFBool flag); + + /** access single frame without decompressing or loading a complete + * multi-frame object. The frame is copied into the buffer passed by the caller + * which must be large enough to contain a complete frame. + * @param dataset pointer to DICOM dataset in which this pixel data object is + * located. Used to access rows, columns, samples per pixel etc. + * @param frameNo number of frame, starting with 0 for the first frame. + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer allocated by the caller. The buffer + * must be large enough for one frame of this image. + * @param bufSize size of buffer, in bytes. This number must be even so + * that the data can properly be converted to a different endianness. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @param cache file cache object that may be passed to multiple subsequent calls + * to this method for the same file; the file cache will then keep a file + * handle open, thus improving performance. Optional, may be NULL + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUncompressedFrame( + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel, + DcmFileCache *cache=NULL); + + /** determine color model of the decompressed image + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDecompressedColorModel( + DcmItem *dataset, + OFString &decompressedColorModel); +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcpixseq.h b/dcmdata/include/dcmtk/dcmdata/dcpixseq.h new file mode 100644 index 00000000..78c0cc69 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcpixseq.h @@ -0,0 +1,303 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmPixelSequence + * + */ + + +#ifndef DCPIXSEQ_H +#define DCPIXSEQ_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcofsetl.h" /* for class DcmOffsetList */ + + +/* +** Forward declarations +*/ + +class DcmPixelItem; + +/* +** Defines +*/ + +/// macro for the "pixel sequence" tag +#define DCM_PixelSequenceTag (DcmTag(DCM_PixelData, EVR_OB)) + + +/** this class implements a sequence of pixel items, i.e. the data structure DICOM is using + * to store compressed pixel data. The object behaves very much like a sequence, but uses + * the pixel data tag (7FE0,0010) and OB value representation with undefined length, + * and the "items" contained within the sequence are in fact pixel items (class DcmPixelItem) + * that contain no list of DICOM elements but raw compressed pixel data. + * The first item in this pixel sequence must always be the offset table. + */ +class DCMTK_DCMDATA_EXPORT DcmPixelSequence : public DcmSequenceOfItems +{ +public: + + // Make friend with DcmPixelData which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmPixelData; + + /** constructor. + * Create new element from given tag. + * @param tag attribute tag + */ + DcmPixelSequence(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmPixelSequence(const DcmPixelSequence &old); + + /// destructor + virtual ~DcmPixelSequence(); + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmPixelSequence &operator=(const DcmPixelSequence &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmPixelSequence(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get type identifier + * @return type identifier of this class (EVR_item) + */ + virtual DcmEVR ident(void) const { return EVR_pixelSQ; } + + /** print all elements of the item to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName optional filename used to write the raw pixel data file + * @param pixelCounter optional counter used for automatic pixel data filename creation + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** @copydoc DcmObject::calcElementLength() + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** insert the given pixel item at the given position within the list maintained by this object. + * Ownership of the pixel item, which must be allocated on the heap, is transferred to the pixel sequence. + * @param item pointer to DcmPixelItem instance allocated on the heap, must not be NULL. + * @param where position at which the new item is to be inserted. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition insert(DcmPixelItem *item, + unsigned long where = DCM_EndOfListIndex); + + /** access a pixel item from the pixel sequence. This method returns a pointer to one + * of the pixel items in the list, and not a copy. + * @param item upon success, a pointer to the selected pixel item is returned in this parameter + * @param num index number of pixel item, must be < card() + * @return pointer to item if found, NULL if num >= card() + */ + virtual OFCondition getItem(DcmPixelItem * &item, + const unsigned long num); + + /** remove pixel item from list. If found, the pixel item is not deleted but + * returned to the caller who is responsible for further management of the + * DcmPixelItem object. + * @param item upon success, a pointer to the removed pixel item is returned in this parameter + * @param num index number of item, must be < card() + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition remove(DcmPixelItem * &item, + const unsigned long num); + + /** remove pixel item from list. The pixel item is not deleted; + * the caller is responsible for further management of the DcmPixelItem object. + * @param item pointer to element to be removed from list + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition remove(DcmPixelItem* item); + + /** changes the transfer syntax of this object to the given one. + * This only works if no transfer syntax was defined so far, or if the new and the old one + * are identical. + * @param newXfer + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition changeXfer(const E_TransferSyntax newXfer); + + /** check if this DICOM object can be encoded in the given transfer syntax. + * @param newXfer transfer syntax in which the DICOM object is to be encoded + * @param oldXfer transfer syntax in which the DICOM object was read or created. + * @return true if object can be encoded in desired transfer syntax, false otherwise. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer); + + /** This function reads the information of all attributes which + * are captured in the input stream and captures this information + * in elementList. Each attribute is represented as an element + * in this list. If not all information for an attribute could be + * read from the stream, the function returns EC_StreamNotifyClient. + * @param inStream The stream which contains the information. + * @param ixfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies + * what will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** write object to a stream + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** appends a single compressed frame to this DICOM pixel sequence + * @param offsetList list containing offset table entries. + * Upon success, an entry is appended to the list. The offset values are always even, + * so it is expected that odd length pixel items are padded later during writing. + * The offsets are not stored internally. + * @param compressedData pointer to compressed image data (copied), must not be NULL + * @param compressedLen number of bytes of compressed image data + * @param fragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition storeCompressedFrame(DcmOffsetList &offsetList, + Uint8 *compressedData, + Uint32 compressedLen, + Uint32 fragmentSize); + +protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmPixelSequence(const DcmTag &tag, + const Uint32 len); + + /** helper function for read(). Create sub-object (pixel item) of the + * appropriate type depending on the tag. + * @param newObject upon success, a pointer to the newly created object is returned in this parameter + * @param newTag tag of the sub-object to be created + * @param newLength length of the sub-object to be created + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition makeSubObject(DcmObject * &newObject, // out + const DcmTag &newTag, + const Uint32 newLength); // in + +private: + /** the transfer syntax in which the compressed pixel data maintained by this object + * is encoded. This may very well differ from the transfer syntax of the main dataset + * if this object was created by a compression codec in memory. + */ + E_TransferSyntax Xfer; + + /// method inherited from base class that is useless in this class + virtual OFCondition insert(DcmItem* /*item*/, + unsigned long /*where*/ = DCM_EndOfListIndex, + OFBool /*before*/ = OFFalse) + { + return EC_IllegalCall; + } + + /// method inherited from base class that is useless in this class + virtual DcmItem* getItem(const unsigned long /*num*/) + { + return NULL; + } + + /// method inherited from base class that is useless in this class + virtual DcmItem* remove(const unsigned long /*num*/) + { + return NULL; + } + + /// method inherited from base class that is useless in this class + virtual DcmItem* remove(DcmItem* /*item*/) + { + return NULL; + } + +}; + +#endif // DCPIXSEQ_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcpxitem.h b/dcmdata/include/dcmtk/dcmdata/dcpxitem.h new file mode 100644 index 00000000..1b96bf9d --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcpxitem.h @@ -0,0 +1,172 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmPixelItem + * + */ + + +#ifndef DCPXITEM_H +#define DCPXITEM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcofsetl.h" /* for class DcmOffsetList */ + + +/* +** Defines +*/ + +/// macro for the "pixel item" tag +#define DCM_PixelItemTag (DcmTag(DCM_Item, EVR_OB)) + + +/** this class implements a container for a fragment of compressed pixel data. + * Instances of this class use the same attribute tags as sequence items, + * but are maintained within a pixel data element (class DcmPixelSequence) + * with undefined length and contain no DICOM structure, but raw data. + * Therefore, this class is derived from DcmOtherByteOtherWord, the class + * that is used for OB raw data which is handled very similar. + */ +class DCMTK_DCMDATA_EXPORT DcmPixelItem : public DcmOtherByteOtherWord +{ + public: + + /** constructor. + * Create new element from given tag. + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmPixelItem(const DcmTag &tag, const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmPixelItem(const DcmPixelItem &old); + + /// destructor + virtual ~DcmPixelItem(); + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmPixelItem &operator=(const DcmPixelItem &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmPixelItem(*this); + } + + /** get type identifier + * @return type identifier of this class (EVR_item) + */ + virtual DcmEVR ident(void) const { return EVR_pixelItem; } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject &rhs); + + /** check if this pixel item is nested in a pixel sequence, i.e.\ not a + * top-level or stand-alone item/dataset + * @return true if this item is nested, false otherwise + */ + virtual OFBool isNested() const; + + /** get parent item of this object, i.e.\ the item/dataset in which the + * surrounding pixel sequence is stored. + * @return pointer to the parent item of this object (might be NULL) + */ + virtual DcmItem *getParentItem(); + + /** print all elements of the item to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName optional filename used to write the raw pixel data file + * @param pixelCounter optional counter used for automatic pixel data filename creation + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** @copydoc DcmObject::calcElementLength() + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** creates in this object an offset table for a compressed pixel sequence + * @param offsetList list of size entries (i.e. number of bytes) for each + * individual frame, including item header (8 bytes) of all associated + * pixel items. All entries are expected to have an even value (i.e. the + * pixel items are padded). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createOffsetTable(const DcmOffsetList &offsetList); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + protected: + + /** write tag, VR and length field to the given output stream + * @param outStream output stream + * @param oxfer transfer syntax for writing + * @param writtenBytes number of bytes written to stream returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeTagAndLength(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + Uint32 &writtenBytes) const; + +}; + + +#endif // DCPXITEM_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcrleccd.h b/dcmdata/include/dcmtk/dcmdata/dcrleccd.h new file mode 100644 index 00000000..435c7bfb --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrleccd.h @@ -0,0 +1,180 @@ +/* + * + * Copyright (C) 2002-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: decoder codec class for RLE + * + */ + +#ifndef DCRLECCD_H +#define DCRLECCD_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */ + +/** decoder class for RLE. + * This class only supports decompression, it neither implements + * encoding nor transcoding. + */ +class DCMTK_DCMDATA_EXPORT DcmRLECodecDecoder: public DcmCodec +{ +public: + + /// default constructor + DcmRLECodecDecoder(); + + /// destructor + virtual ~DcmRLECodecDecoder(); + + /** decompresses the given pixel sequence and + * stores the result in the given uncompressedPixelData element. + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param pixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const; + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decodeFrame( + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const; + + /** transcodes (re-compresses) the given compressed DICOM image and stores + * the result in the given toPixSeq element. + * @param fromRepType current transfer syntax of the compressed image + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * fromPixSeq, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + const DcmCodecParameter * cp, + DcmStack & objStack) const; + + /** checks if this codec is able to convert from the + * given current transfer syntax to the given new + * transfer syntax + * @param oldRepType current transfer syntax + * @param newRepType desired new transfer syntax + * @return true if transformation is supported by this codec, false otherwise. + */ + virtual OFBool canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const; + + /** determine color model of the decompressed image + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const; + +private: + + /// private undefined copy constructor + DcmRLECodecDecoder(const DcmRLECodecDecoder&); + + /// private undefined copy assignment operator + DcmRLECodecDecoder& operator=(const DcmRLECodecDecoder&); +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcrlecce.h b/dcmdata/include/dcmtk/dcmdata/dcrlecce.h new file mode 100644 index 00000000..2b983240 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrlecce.h @@ -0,0 +1,192 @@ +/* + * + * Copyright (C) 2002-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: encoder codec class for RLE + * + */ + +#ifndef DCRLECCE_H +#define DCRLECCE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */ + +class DcmItem; + +/** encoder class for RLE. + * This class only supports compression, it neither implements + * decoding nor transcoding. + */ +class DCMTK_DCMDATA_EXPORT DcmRLECodecEncoder: public DcmCodec +{ +public: + + /// default constructor + DcmRLECodecEncoder(); + + /// destructor + virtual ~DcmRLECodecEncoder(); + + /** decompresses the given pixel sequence and + * stores the result in the given uncompressedPixelData element. + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param pixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const; + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decodeFrame( + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const; + + /** transcodes (re-compresses) the given compressed DICOM image and stores + * the result in the given toPixSeq element. + * @param fromRepType current transfer syntax of the compressed image + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * fromPixSeq, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + const DcmCodecParameter * cp, + DcmStack & objStack) const; + + /** checks if this codec is able to convert from the + * given current transfer syntax to the given new + * transfer syntax + * @param oldRepType current transfer syntax + * @param newRepType desired new transfer syntax + * @return true if transformation is supported by this codec, false otherwise. + */ + virtual OFBool canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const; + + /** determine color model of the decompressed image + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const; + +private: + + /// private undefined copy constructor + DcmRLECodecEncoder(const DcmRLECodecEncoder&); + + /// private undefined copy assignment operator + DcmRLECodecEncoder& operator=(const DcmRLECodecEncoder&); + + /** create Derivation Description. + * @param dataset dataset to be modified + * @param ratio image compression ratio. This is the real effective ratio + * between compressed and uncompressed image, i. e. 2.5 means a 2.5:1 compression. + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition updateDerivationDescription( + DcmItem *dataset, + double ratio); +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcrlecp.h b/dcmdata/include/dcmtk/dcmdata/dcrlecp.h new file mode 100644 index 00000000..1df1279c --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrlecp.h @@ -0,0 +1,137 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: codec parameter for RLE + * + */ + +#ifndef DCRLECP_H +#define DCRLECP_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */ + +/** codec parameter for RLE codec + */ +class DCMTK_DCMDATA_EXPORT DcmRLECodecParameter: public DcmCodecParameter +{ +public: + + /** constructor. + * @param pCreateSOPInstanceUID true if a new SOP instance UID should be assigned + * upon compression/decompression + * @param pFragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited. + * Please note that the DICOM standard does not allow for storing the pixel data with + * multiple fragments per frame (when RLE compression is used). So limiting the fragment + * size may result in non-standard conformant DICOM images. + * @param pCreateOffsetTable create offset table during image compression? + * @param pConvertToSC flag indicating whether image should be converted to + * Secondary Capture upon compression + * @param pReverseDecompressionByteOrder flag indicating whether the byte order should + * be reversed upon decompression. Needed to correctly decode some incorrectly encoded + * images with more than one byte per sample. + */ + DcmRLECodecParameter( + OFBool pCreateSOPInstanceUID = OFFalse, + Uint32 pFragmentSize = 0, + OFBool pCreateOffsetTable = OFTrue, + OFBool pConvertToSC = OFFalse, + OFBool pReverseDecompressionByteOrder = OFFalse); + + /// copy constructor + DcmRLECodecParameter(const DcmRLECodecParameter& arg); + + /// destructor + virtual ~DcmRLECodecParameter(); + + /** this methods creates a copy of type DcmCodecParameter * + * it must be overwritten in every subclass. + * @return copy of this object + */ + virtual DcmCodecParameter *clone() const; + + /** returns the class name as string. + * can be used as poor man's RTTI replacement. + */ + virtual const char *className() const; + + /** returns maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @return maximum fragment size for compression + */ + Uint32 getFragmentSize() const + { + return fragmentSize; + } + + /** returns offset table creation flag + * @return offset table creation flag + */ + OFBool getCreateOffsetTable() const + { + return createOffsetTable; + } + + /** returns secondary capture conversion flag + * @return secondary capture conversion flag + */ + OFBool getConvertToSC() const + { + return convertToSC; + } + + /** returns mode for SOP Instance UID creation + * @return mode for SOP Instance UID creation + */ + OFBool getUIDCreation() const + { + return createInstanceUID; + } + + /** returns reverse decompression byte order mode + * @return reverse decompression byte order mode + */ + OFBool getReverseDecompressionByteOrder() const + { + return reverseDecompressionByteOrder; + } + + +private: + + /// private undefined copy assignment operator + DcmRLECodecParameter& operator=(const DcmRLECodecParameter&); + + /// maximum fragment size (in kbytes) for compression, 0 for unlimited. + Uint32 fragmentSize; + + /// create offset table during image compression + OFBool createOffsetTable; + + /// flag indicating whether image should be converted to Secondary Capture upon compression + OFBool convertToSC; + + /// create new Instance UID during compression/decompression? + OFBool createInstanceUID; + + /** enable reverse byte order of RLE segments during decompression, needed to + * decompress certain incorrectly encoded RLE images + */ + OFBool reverseDecompressionByteOrder; +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcrledec.h b/dcmdata/include/dcmtk/dcmdata/dcrledec.h new file mode 100644 index 00000000..bf792e70 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrledec.h @@ -0,0 +1,264 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: RLE decompressor + * + */ + +#ifndef DCRLEDEC_H +#define DCRLEDEC_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcerror.h" + +/** this class implements an RLE decompressor conforming to the DICOM standard. + * The class is loosely based on an implementation by Phil Norman + */ +class DCMTK_DCMDATA_EXPORT DcmRLEDecoder +{ +public: + + /** constructor + * @param outputBufferSize size of the output buffer (in bytes) + * to which the RLE codec will write decompressed output. + */ + DcmRLEDecoder(size_t outputBufferSize) + : fail_(0) + , outputBufferSize_(outputBufferSize) + , outputBuffer_(NULL) + , offset_(0) + , suspendInfo_(128) + { + if (outputBufferSize_ == 0) fail_ = 1; + else + { + outputBuffer_ = new unsigned char[outputBufferSize_]; + if (outputBuffer_ == NULL) fail_ = 1; + } + } + + /// destructor + ~DcmRLEDecoder() + { + delete[] outputBuffer_; + } + + /** resets the decoder object to newly constructed state. + * The size and location of the output buffer is not changed. + */ + inline void clear() + { + offset_ = 0; + suspendInfo_ = 128; + if (outputBuffer_) fail_ = 0; + } + + + inline OFCondition decompress(void *compressedData, size_t compressedSize) + { + // we allow a call for zero bytes + if (compressedSize == 0) return EC_Normal; + + OFCondition result = EC_IllegalCall; + + // check parameters passed by caller + if (compressedData == NULL) fail_ = 1; + + if (! fail_) // if fail_ is true, just ignore input + { + result = EC_Normal; + unsigned char ch; + unsigned char nbytes; + unsigned char *cp = OFstatic_cast(unsigned char *, compressedData); + + // check if we suspended last time, clean up + if (suspendInfo_ > 128) + { + // DICOM packbit scheme uses 257 - nbytes to represent replicate runs + nbytes = OFstatic_cast(unsigned char, 257 - suspendInfo_); + + // suspended replicate run. compressedSize cannot be zero now. + suspendInfo_ = 128; + + ch = *cp++; + --compressedSize; + replicate(ch, nbytes); + } + else if (suspendInfo_ < 128) + { + // suspended literal run + nbytes = OFstatic_cast(unsigned char, (suspendInfo_ & 0x7f) + 1); + suspendInfo_ = 128; + if (compressedSize < nbytes) + { + // we're going to suspend again (oops?), prepare everything + suspendInfo_ = OFstatic_cast(unsigned char, nbytes - compressedSize - 1); + nbytes = OFstatic_cast(unsigned char, compressedSize); + result = EC_StreamNotifyClient; + } + + literal(cp, nbytes); + compressedSize -= nbytes; + cp += nbytes; + } + + // continue with ordinary RLE decompression + while (compressedSize && (! fail_)) + { + ch = *cp++; + --compressedSize; + + if (ch & 0x80) + { + // replicate run + if (compressedSize) + { + // DICOM packbit scheme uses 257 - nbytes to represent replicate runs + nbytes = OFstatic_cast(unsigned char, 257 - ch); + ch = *cp++; + --compressedSize; + replicate(ch, nbytes); + } + else + { + // suspension: replicate run but second byte is in next block + suspendInfo_ = ch; + result = EC_StreamNotifyClient; + } + } + else + { + // literal run + nbytes = OFstatic_cast(unsigned char, (ch & 0x7f) + 1); + if (compressedSize < nbytes) + { + // we're going to suspend, prepare everything + suspendInfo_ = OFstatic_cast(unsigned char, nbytes - compressedSize - 1); + nbytes = OFstatic_cast(unsigned char, compressedSize); + result = EC_StreamNotifyClient; + } + + literal(cp, nbytes); + compressedSize -= nbytes; + cp += nbytes; + } + } + + // failure status at this point means output buffer overflow + if (fail_) result = EC_CorruptedData; + } + + return result; + } + + + /** returns the number of bytes written to the output buffer + * @return size of decompressed stream, in bytes + */ + inline size_t size() const + { + return offset_; + } + + /** returns pointer to the output buffer + */ + inline void *getOutputBuffer() const + { + return outputBuffer_; + } + + /** returns true if the RLE compressor has failed (out of memory or output buffer too small). + */ + inline OFBool fail() const + { + if (fail_) return OFTrue; else return OFFalse; + } + +private: + + /// private undefined copy constructor + DcmRLEDecoder(const DcmRLEDecoder&); + + /// private undefined copy assignment operator + DcmRLEDecoder& operator=(const DcmRLEDecoder&); + + + /** this method expands a replicate run + * @param ch value to replicate + * @param nbytes number of repetitions + */ + inline void replicate(unsigned char ch, unsigned char nbytes) + { + if (offset_ + nbytes > outputBufferSize_) + { + // output buffer overflow + fail_ = 1; + nbytes = OFstatic_cast(unsigned char, outputBufferSize_ - offset_); + } + + while (nbytes--) outputBuffer_[offset_++] = ch; + } + + + /** this method expands a literal run + * @param cp pointer to buffer + * @param nbytes number of bytes in buffer + */ + inline void literal(unsigned char *cp, unsigned char nbytes) + { + if (offset_ + nbytes > outputBufferSize_) + { + // output buffer overflow + fail_ = 1; + nbytes = OFstatic_cast(unsigned char, outputBufferSize_ - offset_); + } + + while (nbytes--) outputBuffer_[offset_++] = *cp++; + } + + /* member variables */ + + /** this flag indicates a failure of the RLE codec. Once a failure is + * flagged, the codec will consume all input and not produce any more + * output. + */ + int fail_; + + /** size of output buffer, in bytes + */ + size_t outputBufferSize_; + + /** this member points to a block of size outputBufferSize_ + * (unless fail_ is true). This is the block of data to + * which the decompressed stream is written + */ + unsigned char *outputBuffer_; + + /** contains the number of bytes already written to outputBuffer_. + * Value is always less or equal to outputBufferSize_. + */ + size_t offset_; + + /** contains suspension information. + * If not suspended, contains 128. + * If suspended during a replicate run, contains control byte of repeat run (> 128). + * If suspended during a literal run, contains number of remaining bytes in literal run minus 1 (< 128). + */ + unsigned char suspendInfo_; +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcrledrg.h b/dcmdata/include/dcmtk/dcmdata/dcrledrg.h new file mode 100644 index 00000000..73de0e56 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrledrg.h @@ -0,0 +1,80 @@ +/* + * + * Copyright (C) 2002-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers RLE decoder. + * + */ + +#ifndef DCRLEDRG_H +#define DCRLEDRG_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmdata/dcdefine.h" + +class DcmRLECodecParameter; +class DcmRLECodecDecoder; + +/** singleton class that registers an RLE decoder. + */ +class DCMTK_DCMDATA_EXPORT DcmRLEDecoderRegistration +{ +public: + /** registers RLE decoder. + * If already registered, call is ignored unless cleanup() has + * been performed before. + * @param pCreateSOPInstanceUID flag indicating whether or not + * a new SOP Instance UID should be assigned upon decompression. + * @param pReverseDecompressionByteOrder flag indicating whether the byte order should + * be reversed upon decompression. Needed to correctly decode some incorrectly encoded + * images with more than one byte per sample. + */ + static void registerCodecs( + OFBool pCreateSOPInstanceUID = OFFalse, + OFBool pReverseDecompressionByteOrder = OFFalse); + + /** deregisters decoder. + * Attention: Must not be called while other threads might still use + * the registered codecs, e.g. because they are currently decoding + * DICOM data sets through dcmdata. + */ + static void cleanup(); + +private: + + /// private undefined copy constructor + DcmRLEDecoderRegistration(const DcmRLEDecoderRegistration&); + + /// private undefined copy assignment operator + DcmRLEDecoderRegistration& operator=(const DcmRLEDecoderRegistration&); + + /// flag indicating whether the decoder is already registered. + static OFBool registered; + + /// pointer to codec parameter + static DcmRLECodecParameter *cp; + + /// pointer to RLE decoder + static DcmRLECodecDecoder *codec; + + // dummy friend declaration to prevent gcc from complaining + // that this class only defines private constructors and has no friends. + friend class DcmRLEDecoderRegistrationDummyFriend; + +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcrleenc.h b/dcmdata/include/dcmtk/dcmdata/dcrleenc.h new file mode 100644 index 00000000..a569e2a1 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrleenc.h @@ -0,0 +1,416 @@ +/* + * + * Copyright (C) 2002-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: RLE compressor + * + */ + +#ifndef DCRLEENC_H +#define DCRLEENC_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oflist.h" /* for class OFList<> */ + +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dcdefine.h" + +#define DcmRLEEncoder_BLOCKSIZE 16384 + + +/** abstract class that defines an interface through which + * encoder classes (such as DcmRLEEncoder) may export their + * encoded data + */ +class DCMTK_DCMDATA_EXPORT DcmEncoderOutputStream +{ +public: + /** write the given buffer into the output stream + * @param buf pointer to buffer + * @param bufsize number of bytes in buffer + */ + virtual void write(const unsigned char *buf, size_t bufsize) =0; + + /** Virtual Desctructor + */ + virtual ~DcmEncoderOutputStream() {} + +}; + + +/** this class implements an RLE compressor conforming to the DICOM standard. + * The class is loosely based on an implementation by Phil Norman. + */ +class DCMTK_DCMDATA_EXPORT DcmRLEEncoder +{ +public: + + /** default constructor + * @param doPad if true, RLE codec will pad output data to even number of bytes + */ + DcmRLEEncoder(int doPad) + : fail_(0) + , pad_(doPad) + , currentBlock_(new unsigned char[DcmRLEEncoder_BLOCKSIZE]) + , offset_(0) + , blockList_() + , RLE_buff_(new unsigned char[132]) + , RLE_prev_(-1) + , RLE_pcount_(0) + , RLE_bindex_(1) + { + if ((! RLE_buff_)||(! currentBlock_)) fail_ = 1; + else RLE_buff_[0] = 0; + } + + /// destructor + ~DcmRLEEncoder() + { + delete[] currentBlock_; + delete[] RLE_buff_; + OFListIterator(unsigned char *) first = blockList_.begin(); + OFListIterator(unsigned char *) last = blockList_.end(); + while (first != last) + { + delete[] *first; + first = blockList_.erase(first); + } + } + + /** this method adds one byte to the byte stream to be compressed + * with the RLE compressor. + * @param ch byte to be added + */ + inline void add(unsigned char ch) + { + if (! fail_) // if fail_ is true, just ignore input + { + // if the current byte equals the last byte read + // (which is initialized with the "impossible" value -1), + // just increase the repeat counter + if (OFstatic_cast(int, ch) == RLE_prev_) RLE_pcount_++; + else + { + // byte is different from last byte read. + // flush replicate run if necessary + switch (RLE_pcount_) + { + case 0: + // happens only after construction or flush() + break; + case 2: + // two bytes in repeat buffer. Convert to literal run + RLE_buff_[RLE_bindex_++] = OFstatic_cast(unsigned char, RLE_prev_); + // no break. Fall-through into next case statement is intended. + case 1: + // one (or two) bytes in repeat buffer. Convert to literal run + RLE_buff_[RLE_bindex_++] = OFstatic_cast(unsigned char, RLE_prev_); + break; + default: + // more than two bytes in repeat buffer. Convert to replicate run + if (RLE_bindex_ > 1) + { + // there is a literal run in the buffer that must be flushed + // before the replicate run. Flush literal run now. + RLE_buff_[0] = OFstatic_cast(unsigned char, RLE_bindex_-2); + move(RLE_bindex_); + } + // this is the byte value for the repeat run + RLE_buff_[1] = OFstatic_cast(unsigned char, RLE_prev_); + // write as many repeat runs as necessary + for (; RLE_pcount_>0; RLE_pcount_-=128) + { + // different PackBit schemes exist. The original from which + // this code is derived used 0x80 | (RLE_pcount_ - 1) + // to represent replicate runs. + // DICOM instead uses 257 - RLE_pcount_ + if (RLE_pcount_ > 128) RLE_buff_[0] = 0x81; + else RLE_buff_[0] = OFstatic_cast(unsigned char, 257 - RLE_pcount_); + move(2); + } + // now the buffer is guaranteed to be empty + RLE_buff_[0] = 0; + RLE_bindex_ = 1; + break; + } + + // if we have 128 or more bytes in the literal run, flush buffer + if (RLE_bindex_ > 129) + { + RLE_buff_[0] = 127; + move(129); + RLE_bindex_ -= 128; + if (RLE_bindex_ > 1) + RLE_buff_[1] = RLE_buff_[129]; + if (RLE_bindex_ > 2) + RLE_buff_[2] = RLE_buff_[130]; + } + + // current byte is stored in RLE_prev_, RLE_pcount_ is 1. + RLE_prev_ = ch; + RLE_pcount_ = 1; + } + } + } + + /** this method adds a block of bytes to the byte stream to be + * compressed with the RLE compressor. + * @param buf buffer to be added + * @param bufcount number of bytes in buffer + */ + inline void add(const unsigned char *buf, size_t bufcount) + { + if (buf) + { + while (bufcount--) add(*buf++); + } + } + + /** this method finalizes the compressed RLE stream, i.e. flushes all + * pending literal or repeat runs. This method can be called at any + * time; however, it must be called before size() or write() + * can be used. Intermediate calls should be avoided since they + * possibly decrease the compression ratio. + */ + inline void flush() + { + if (! fail_) // if fail_ is true, do nothing + { + // if there are max 1 bytes in the repeat counter, convert to literal run + if (RLE_pcount_ < 2) + { + for (; RLE_pcount_>0; --RLE_pcount_) RLE_buff_[RLE_bindex_++] = OFstatic_cast(unsigned char, RLE_prev_); + } + + // if we have 128 or more bytes in the literal run, flush buffer + if (RLE_bindex_ > 129) + { + RLE_buff_[0] = 127; + move(129); + RLE_bindex_ -= 128; + if (RLE_bindex_ > 1) + RLE_buff_[1] = RLE_buff_[129]; + if (RLE_bindex_ > 2) + RLE_buff_[2] = RLE_buff_[130]; + } + + // if there is still a literal run in the buffer, flush literal run + if (RLE_bindex_ > 1) + { + RLE_buff_[0] = OFstatic_cast(unsigned char, RLE_bindex_-2); + move(RLE_bindex_); + } + + // if there is a remaining repeat run, flush this one as well + if (RLE_pcount_ >= 2) + { + RLE_buff_[1] = OFstatic_cast(unsigned char, RLE_prev_); + // write as many repeat runs as necessary + for (; RLE_pcount_>0; RLE_pcount_-=128) + { + // different PackBit schemes exist. The original from which + // this code is derived used 0x80 | (RLE_pcount_ - 1) + // to represent replicate runs. + // DICOM instead uses 257 - RLE_pcount_ + if (RLE_pcount_ > 128) RLE_buff_[0] = 0x81; + else RLE_buff_[0] = OFstatic_cast(unsigned char, 257 - RLE_pcount_); + move(2); + } + } + + // now the buffer is guaranteed to be empty, re-initialize + RLE_buff_[0] = 0; + RLE_prev_ = -1; + RLE_pcount_ = 0; + RLE_bindex_ = 1; + } + } + + /** returns the size of compressed RLE stream in bytes. + * The size is guaranteed to be an even number of bytes (padded + * with a trailing zero byte as required by DICOM if necessary). + * This method may only be called after flush() has been executed + * to finalize the compressed stream. + * @return size of compressed stream, in bytes + */ + inline size_t size() const + { + size_t result = blockList_.size() * DcmRLEEncoder_BLOCKSIZE + offset_; + if (pad_ && (result & 1)) result++; // enforce even number of bytes + return result; + } + + /** returns true if the RLE compressor has run out of memory. In this case, + * no output has been created. + */ + inline OFBool fail() const + { + if (fail_) return OFTrue; else return OFFalse; + } + + /** copies the compressed RLE byte stream into a target array of at least + * size() bytes. + * @param target pointer to array of at least size() bytes, must not be NULL. + */ + inline void write(void *target) const + { + if ((!fail_) && target) + { + unsigned char *current = NULL; + unsigned char *target8 = OFstatic_cast(unsigned char *, target); + OFListConstIterator(unsigned char *) first = blockList_.begin(); + OFListConstIterator(unsigned char *) last = blockList_.end(); + while (first != last) + { + current = *first; + memcpy(target8, current, DcmRLEEncoder_BLOCKSIZE); + target8 += DcmRLEEncoder_BLOCKSIZE; + ++first; + } + if (offset_ > 0) + { + memcpy(target8, currentBlock_, offset_); + } + + // pad to even number of bytes if necessary + if (pad_ && ((blockList_.size() * DcmRLEEncoder_BLOCKSIZE + offset_) & 1)) + { + target8 += offset_; + *target8 = 0; + } + } + } + + /** copies the compressed RLE byte stream into an + * output stream + * @param os output stream + */ + inline void write(DcmEncoderOutputStream& os) const + { + if (!fail_) + { + OFListConstIterator(unsigned char *) first = blockList_.begin(); + OFListConstIterator(unsigned char *) last = blockList_.end(); + while (first != last) + { + os.write(*first, DcmRLEEncoder_BLOCKSIZE); + ++first; + } + if (offset_ > 0) + { + os.write(currentBlock_, offset_); + } + + // pad to even number of bytes if necessary + if (pad_ && ((blockList_.size() * DcmRLEEncoder_BLOCKSIZE + offset_) & 1)) + { + unsigned char c = 0; + os.write(&c, 1); + } + } + } + +private: + + /// private undefined copy constructor + DcmRLEEncoder(const DcmRLEEncoder&); + + /// private undefined copy assignment operator + DcmRLEEncoder& operator=(const DcmRLEEncoder&); + + /** this method moves the given number of bytes from buff_ + * to currentBlock_ and "flushes" currentBlock_ to + * blockList_ if necessary. + * @param numberOfBytes number of bytes to copy + */ + inline void move(size_t numberOfBytes) + { + size_t i=0; + while (i < numberOfBytes) + { + if (offset_ == DcmRLEEncoder_BLOCKSIZE) + { + blockList_.push_back(currentBlock_); + currentBlock_ = new unsigned char[DcmRLEEncoder_BLOCKSIZE]; + offset_ = 0; + if (! currentBlock_) // out of memory + { + fail_ = 1; + break; // exit while loop + } + } + currentBlock_[offset_++] = RLE_buff_[i++]; + } + } + + /* member variables */ + + /** this flag indicates a failure of the RLE codec. Once a failure is + * flagged, the codec will consume all input and not produce any more + * output. A failure status can only be caused by an out-of-memory + * condition. + */ + int fail_; + + /** this flag indicates whether the RLE codec must pad encoded + * data to an even number of bytes (as required by DICOM). + * True if padding is required, false otherwise + */ + int pad_; + + /** this member points to a block of size DcmRLEEncoder_BLOCKSIZE + * (unless fail_ is true). This is the current block of data to + * which the RLE stream is written + */ + unsigned char *currentBlock_; + + /** contains the number of bytes already written the the memory + * block pointed to by currentBlock_. Value is always less than + * DcmRLEEncoder_BLOCKSIZE. + */ + size_t offset_; + + /** this member contains a list of memory blocks of size DcmRLEEncoder_BLOCKSIZE + * which already have been filled with encoded RLE data. + * The current block (pointed to by currentBlock_) is not contained in this list. + */ + OFList blockList_; + + /** this member points to a buffer of 132 bytes that is used by the RLE + * encoding algorithm. + */ + unsigned char *RLE_buff_; + + /** value of the last byte fed to the RLE compressor. This byte is not yet + * stored in the RLE_buff_ buffer. + * Type is int because this allows an "impossible" -1 as default value + */ + int RLE_prev_; + + /** repeat counter, for RLE compressor + * may temporarily become negative, guaranteed to be >= 0 between method calls. + */ + int RLE_pcount_; + + /** index of next unused byte in RLE_buff_. + */ + unsigned int RLE_bindex_; + +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcrleerg.h b/dcmdata/include/dcmtk/dcmdata/dcrleerg.h new file mode 100644 index 00000000..859f3b18 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrleerg.h @@ -0,0 +1,84 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers RLE encoder. + * + */ + +#ifndef DCRLEERG_H +#define DCRLEERG_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmdata/dcdefine.h" + +class DcmRLECodecParameter; +class DcmRLECodecEncoder; + +/** singleton class that registers an RLE encoder. + */ +class DCMTK_DCMDATA_EXPORT DcmRLEEncoderRegistration +{ +public: + + /** registers RLE encoder. + * If already registered, call is ignored unless cleanup() has + * been performed before. + * @param pCreateSOPInstanceUID flag indicating whether or not + * a new SOP Instance UID should be assigned upon compression. + * @param pFragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @param pCreateOffsetTable create offset table during image compression? + * @param pConvertToSC flag indicating whether image should be converted to + * Secondary Capture upon compression + */ + static void registerCodecs( + OFBool pCreateSOPInstanceUID = OFFalse, + Uint32 pFragmentSize = 0, + OFBool pCreateOffsetTable = OFTrue, + OFBool pConvertToSC = OFFalse); + + /** deregisters encoder. + * Attention: Must not be called while other threads might still use + * the registered codecs, e.g. because they are currently encoding + * DICOM data sets through dcmdata. + */ + static void cleanup(); + +private: + + /// private undefined copy constructor + DcmRLEEncoderRegistration(const DcmRLEEncoderRegistration&); + + /// private undefined copy assignment operator + DcmRLEEncoderRegistration& operator=(const DcmRLEEncoderRegistration&); + + /// flag indicating whether the encoder is already registered. + static OFBool registered; + + /// pointer to codec parameter + static DcmRLECodecParameter *cp; + + /// pointer to RLE encoder + static DcmRLECodecEncoder *codec; + + // dummy friend declaration to prevent gcc from complaining + // that this class only defines private constructors and has no friends. + friend class DcmRLEEncoderRegistrationDummyFriend; + +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcrlerp.h b/dcmdata/include/dcmtk/dcmdata/dcrlerp.h new file mode 100644 index 00000000..15987acd --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcrlerp.h @@ -0,0 +1,65 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: representation parameter for RLE + * + */ + +#ifndef DCRLERP_H +#define DCRLERP_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcpixel.h" /* for class DcmRepresentationParameter */ + +/** representation parameter for RLE. + * This is actually a dummy class since there are no compression + * options in the RLE algorithm. + */ +class DCMTK_DCMDATA_EXPORT DcmRLERepresentationParameter: public DcmRepresentationParameter +{ +public: + + /// constructor + DcmRLERepresentationParameter(); + + /// copy constructor + DcmRLERepresentationParameter(const DcmRLERepresentationParameter& arg); + + /// destructor + virtual ~DcmRLERepresentationParameter(); + + /** this methods creates a copy of type DcmRepresentationParameter * + * it must be overweritten in every subclass. + * @return copy of this object + */ + virtual DcmRepresentationParameter *clone() const; + + /** returns the class name as string. + * can be used in operator== as poor man's RTTI replacement. + */ + virtual const char *className() const; + + /** compares an object to another DcmRepresentationParameter. + * Implementation must make sure that classes are comparable. + * @param arg representation parameter to compare with + * @return true if equal, false otherwise. + */ + virtual OFBool operator==(const DcmRepresentationParameter &arg) const; + +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcsequen.h b/dcmdata/include/dcmtk/dcmdata/dcsequen.h new file mode 100644 index 00000000..62efe130 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcsequen.h @@ -0,0 +1,642 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmSequenceOfItems + * + */ + + +#ifndef DCSEQUEN_H +#define DCSEQUEN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/offile.h" /* for offile_off_t */ +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/dctag.h" +#include "dcmtk/dcmdata/dclist.h" +#include "dcmtk/dcmdata/dcstack.h" + +// forward declarations +class DcmJsonFormat; + +/** class representing a DICOM Sequence of Items (SQ). + * This class is derived from class DcmElement (and not from DcmObject) despite the fact + * that sequences have no value field as such, they maintain a list of items. However, + * all APIs in class DcmItem and class DcmDataset accept DcmElements. + * This is ugly and causes some DcmElement API methods to be useless with DcmSequence. + */ +class DCMTK_DCMDATA_EXPORT DcmSequenceOfItems : public DcmElement +{ +public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag attribute tag + */ + DcmSequenceOfItems(const DcmTag &tag); + + /** copy constructor + * @param oldSeq element to be copied + */ + DcmSequenceOfItems(const DcmSequenceOfItems& oldSeq); + + /// destructor + virtual ~DcmSequenceOfItems(); + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmSequenceOfItems &operator=(const DcmSequenceOfItems &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). For sequences that means that all + * contained items are compared element by element, so this may be + * an expensive operation! + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object than + * in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /// returns current status flag + inline OFCondition error() const { return errorFlag; } + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmSequenceOfItems(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** return identifier for this class. Every class derived from this class + * returns a unique value of type enum DcmEVR for this call. This is used + * as a "poor man's RTTI" to correctly identify instances derived from + * this class even on compilers not supporting RTTI. + * @return type identifier of this class + */ + virtual DcmEVR ident() const { return EVR_SQ; } + + /** check if this element is a leaf node in a dataset tree. + * All subclasses of DcmElement except for DcmSequenceOfItems + * are leaf nodes, while DcmSequenceOfItems, DcmItem, DcmDataset etc. + * are not. + * @return true if leaf node, false otherwise. + */ + virtual OFBool isLeaf() const { return OFFalse; } + + /** print object to a stream + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used (used in certain sub-classes of this class) + * @param pixelCounter not used (used in certain sub-classes of this class) + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** check whether stored value conforms to the VR and to the specified VM + * @param card cardinality (number of items) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Parameter used to specify the value multiplicity for non-sequence attributes. + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &card = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return always returns 1 (according to the DICOM standard) + */ + virtual unsigned long getVM(); + + /** get number of values (items) stored in this sequence. + * The result is the same as card() unless overwritten in a derived class. + * @return number of items in this sequence + */ + virtual unsigned long getNumberOfValues(); + + /** get cardinality of this sequence + * @return number of items in this sequence + */ + virtual unsigned long card() const; + + /** This function takes care of group length and padding elements + * in the current element list according to what is specified in + * glenc and padenc. If required, this function does the following + * two things: + * a) it calculates the group length of all groups which are + * contained in this item and sets the calculated values + * in the corresponding group length elements and + * b) it inserts a corresponding padding element (or, in case + * of sequences: padding elements) with a corresponding correct + * size into the element list. + * @param glenc Encoding type for group length; specifies what shall + * be done with group length tags. + * @param padenc Encoding type for padding; specifies what shall be + * done with padding tags. + * @param xfer The transfer syntax that shall be used. + * @param enctype Encoding type for sequences; specifies how sequences + * will be handled. + * @param padlen The length up to which the dataset shall be padded, + * if padding is desired. + * @param subPadlen For sequences (ie sub elements), the length up to + * which item shall be padded, if padding is desired. + * @param instanceLength Number of extra bytes added to the item/dataset + * length used when computing the padding; this + * parameter is for instance used to pass the length + * of the file meta header from the DcmFileFormat to + * the DcmDataset object. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition computeGroupLengthAndPadding + (const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc = EPD_noChange, + const E_TransferSyntax xfer = EXS_Unknown, + const E_EncodingType enctype = EET_ExplicitLength, + const Uint32 padlen = 0, + const Uint32 subPadlen = 0, + Uint32 instanceLength = 0); + + /** calculate the length of this DICOM element when encoded with the + * given transfer syntax and the given encoding type for sequences. + * For elements, the length includes the length of the tag, length field, + * VR field and the value itself, for items and sequences it returns + * the length of the complete item or sequence including delimitation tags + * if applicable. + * If length encoding is set to be explicit and the total sequence size is + * larger than the available 32-bit length field, then undefined length + * is returned. If "dcmWriteOversizedSeqsAndItemsUndefined" is disabled, + * also the internal DcmObject errorFlag is set to EC_SeqOrItemContentOverflow + * in case the sequence content (excluding tag header etc.) is already too + * large. + * @param xfer transfer syntax for length calculation + * @param enctype sequence encoding type for length calculation + * @return length of DICOM element + */ + virtual Uint32 calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype); + + /** calculate the value length (without attribute tag, VR and length field) + * of this DICOM element when encoded with the given transfer syntax and + * the given encoding type for sequences. + * If length encoding is set to be explicit and the total sequence size is + * larger than the available 32-bit length field, then undefined length + * is returned. If "dcmWriteOversizedSeqsAndItemsImplicit" is disabled, + * also the internal DcmObject errorFlag is set to + * EC_SeqOrItemContentOverflow. + * @param xfer transfer syntax for length calculation + * @param enctype sequence encoding type for length calculation + * @return value length of DICOM element + */ + virtual Uint32 getLength(const E_TransferSyntax xfer = EXS_LittleEndianImplicit, + const E_EncodingType enctype = EET_UndefinedLength); + + /** initialize the transfer state of this object. This method must be called + * before this object is written to a stream or read (parsed) from a stream. + */ + virtual void transferInit(); + + /** finalize the transfer state of this object. This method must be called + * when reading/writing this object from/to a stream has been completed. + */ + virtual void transferEnd(); + + /** check if this DICOM object can be encoded in the given transfer syntax. + * @param newXfer transfer syntax in which the DICOM object is to be encoded + * @param oldXfer transfer syntax in which the DICOM object was read or created. + * @return true if object can be encoded in desired transfer syntax, false otherwise. + */ + virtual OFBool canWriteXfer(const E_TransferSyntax oldXfer, + const E_TransferSyntax newXfer); + + /** This function reads the information of all attributes which + * are captured in the input stream and captures this information + * in elementList. Each attribute is represented as an element + * in this list. If not all information for an attribute could be + * read from the stream, the function returns EC_StreamNotifyClient. + * @param inStream The stream which contains the information. + * @param xfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies + * what will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc = EGL_noChange, + const Uint32 maxReadLength = DCM_MaxReadLength); + + /** write object to a stream + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** returns true if the current object may be included in a digital signature + * @return true if signable, false otherwise + */ + virtual OFBool isSignable() const; + + /** returns true if the object contains an element with Unknown VR at any nesting level + * @return true if the object contains an element with Unknown VR, false otherwise + */ + virtual OFBool containsUnknownVR() const; + + /** check if this object contains non-ASCII characters at any nesting level. Please note + * that this check is pretty simple and only works for single-byte character sets that + * do include the 7-bit ASCII codes, e.g. for the ISO 8859 family. In other words: All + * character codes below 128 are considered to be ASCII codes and all others are + * considered to be non-ASCII. + * @param checkAllStrings if true, also check elements with string values not affected + * by SpecificCharacterSet (0008,0005). By default, only check PN, LO, LT, SH, ST, + * UC and UT. + * @return true if object contains non-ASCII characters, false otherwise + */ + virtual OFBool containsExtendedCharacters(const OFBool checkAllStrings = OFFalse); + + /** check if this object is affected by SpecificCharacterSet at any nesting level. + * In detail, it is checked whether this object contains any data elements that + * according to their VR are affected by the SpecificCharacterSet (0008,0005) + * element. This is true for the following VRs: PN, LO, LT, SH, ST, UC and UT + * @return true if object is affected by SpecificCharacterSet, false otherwise + */ + virtual OFBool isAffectedBySpecificCharacterSet() const; + + /** convert all element values that are contained in this item and that are affected + * by SpecificCharacterSet from the currently selected source character set to the + * currently selected destination character set + * @param converter character set converter to be used to convert the element values + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition convertCharacterSet(DcmSpecificCharacterSet &converter); + + /** insert the given item at the start of the item list maintained by this sequence. + * Ownership of the item, which must be allocated on the heap, is transferred to the sequence. + * @param item pointer to DcmItem instance allocated on the heap, must not be NULL. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition prepend(DcmItem *item); + + /** insert the given item at the given position within the item list maintained by this sequence. + * Ownership of the item, which must be allocated on the heap, is transferred to the sequence. + * @param item pointer to DcmItem instance allocated on the heap, must not be NULL. + * @param where index of the item after or before which the new item is to be inserted. + * Value must be < card() or equal to DCM_EndOfListIndex. + * @param before indicates whether the new item should be inserted before or after the item + * identified by "where" + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition insert(DcmItem *item, + unsigned long where = DCM_EndOfListIndex, + OFBool before = OFFalse); + + /** insert the given item at the end of the item list maintained by this sequence. + * Ownership of the item, which must be allocated on the heap, is transferred to the sequence. + * @param item pointer to DcmItem instance allocated on the heap, must not be NULL. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition append(DcmItem *item); + + /** insert new item a current position. + * The current position is stored internally in the 'itemList' member variable. + * @param item new item to be inserted + * @param before flag indicating whether to insert the item before (OFFalse) or + * after (OFTrue) the current position + * @return status, EC_Normal upon success, an error code otherwise + */ + virtual OFCondition insertAtCurrentPos(DcmItem *item, + OFBool before = OFFalse); + + /** access an item from the sequence. This method returns a pointer to one + * of the items in the list, and not a copy. + * @param num index number of item, must be < card() + * @return pointer to item if found, NULL if num >= card() + */ + virtual DcmItem *getItem(const unsigned long num); + + /** this method enables a stack based, depth-first traversal of a complete + * hierarchical DICOM dataset (that is, classes derived from DcmItem or + * DcmSequenceOfItems). With each call of this method, the next object + * in the tree is located and marked on the stack. + * @param stack "cursor" for current position in the dataset. The stack + * will contain a pointer to each dataset, sequence, item and element + * from the main dataset down to the current element, and is updated + * upon each call to this method. An empty stack is equivalent to a stack + * containing a pointer to this object only. + * @param intoSub if true, the nextObject method will perform a hierarchical + * search through the dataset (depth-first), if false, only the current + * container object will be traversed (e.g., all elements of an item + * or all items of a sequence). + * @return EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition nextObject(DcmStack &stack, const OFBool intoSub); + + /** this method is only used in container classes, + * that is, DcmItem and DcmSequenceOfItems. It returns a pointer to the + * next object in the list AFTER the given object. If the caller passes NULL, + * a pointer to the first object in the list is returned. If the given object + * is not found, the given object is the last one in the list or the list is empty, + * NULL is returned. + * @param obj pointer to one object in the container; we are looking for the + * next entry after this one. NULL if looking for the first entry. + * @return pointer to next object in container or NULL if not found + */ + virtual DcmObject *nextInContainer(const DcmObject *obj); + + /** remove item from list. If found, the item is not deleted but + * returned to the caller who is responsible for further management of the + * DcmItem object. + * @param num index number of item, must be < card() + * @return pointer to DcmItem if found, NULL otherwise + */ + virtual DcmItem *remove(const unsigned long num); + + /** remove item from list. If found, the item is not deleted but + * returned to the caller who is responsible for further management of the + * DcmItem object. + * @param item pointer to item to be removed from list + * @return pointer to item if found, NULL otherwise + */ + virtual DcmItem *remove(DcmItem *item); + + /** check if this sequence is empty + * @param normalize not used for this class + * @return true if sequence is empty, i.e. has no items, false otherwise + */ + virtual OFBool isEmpty(const OFBool normalize = OFTrue); + + /** clear (remove) attribute value + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear(); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /** a complex, stack-based, hierarchical search method. It allows for a search + * for a DICOM object with a given attribute within a given container, + * hierarchically, from a starting position identified through a cursor stack. + * @param xtag the DICOM attribute tag we are searching for + * @param resultStack Depending on the search mode (see below), this parameter + * either serves as an input and output parameter, or as an output parameter + * only (the latter being the default). When used as an input parameter, + * the cursor stack defines the start position for the search within a + * hierarchical DICOM dataset. Upon successful return, the stack contains + * the position of the element found, in the form of a pointer to each dataset, + * sequence, item and element from the main dataset down to the found element. + * @param mode search mode, controls how the search stack is handled. + * In the default mode, ESM_fromHere, the stack is ignored on input, and + * the search starts in the object for which this method is called. + * In the other modes, the stack is used both as an input and an output + * parameter and defines the starting point for the search. + * @param searchIntoSub if true, the search will be performed hierarchically descending + * into the sequences and items of the dataset. If false, only the current container + * (sequence or item) will be traversed. + * @return EC_Normal if found, EC_TagNotFound if not found, an error code is something went wrong. + */ + virtual OFCondition search(const DcmTagKey &xtag, // in + DcmStack &resultStack, // inout + E_SearchMode mode = ESM_fromHere, // in + OFBool searchIntoSub = OFTrue); // in + + /** this method loads all attribute values maintained by this object and + * all sub-objects (in case of a container such as DcmDataset) into memory. + * After a call to this method, the file from which a dataset was read may safely + * be deleted or replaced. For large files, this method may obviously allocate large + * amounts of memory. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadAllDataIntoMemory(void); + + /** Copy numBytes bytes of data from the attribute value in byteOrder byte order + * to targetBuffer, starting at byte offset offset of the attribute value. + * This method does not cause the complete attribute value to be read into + * main memory. Subsequent calls for the same partial value may cause repeated + * access to file if the attribute value is kept in file. + * @param targetBuffer pointer to target buffer, must not be NULL. + * Buffer size must be at least numBytes bytes. + * @param offset byte offset within the attribute value from where to start + * copying + * @param numBytes number of bytes to copy. + * @param cache file cache object that may be passed to multiple subsequent calls + * to this method for the same file; the file cache will then keep a file + * handle open, thus improving performance. Optional, may be NULL + * @param byteOrder byte order desired byte order of attribute value in memory buffer. + * Default is the local byte order of the machine. + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getPartialValue(void *targetBuffer, + const Uint32 offset, + Uint32 numBytes, + DcmFileCache *cache = NULL, + E_ByteOrder byteOrder = gLocalByteOrder); + +protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag attribute tag + * @param len length of the attribute value + * @param readAsUN flag indicating whether the sequence should be + * read (interpreted) as a UN element with Implicit VR Little Endian encoding + */ + DcmSequenceOfItems(const DcmTag &tag, + const Uint32 len, + OFBool readAsUN = OFFalse); + + /** This function reads tag and length information from inStream and + * returns this information to the caller. When reading information, + * the transfer syntax which was passed is accounted for. If the + * transfer syntax shows an explicit value representation, the data + * type of this object is also read from the stream. In general, this + * function follows the rules which are specified in the DICOM standard + * (see DICOM standard (year 2000) part 5, section 7) (or the corresponding + * section in a later version of the standard) concerning the encoding + * of a dataset. + * @param inStream The stream which contains the information. + * @param xfer The transfer syntax which was used to encode the + * information in inStream. + * @param tag Contains in the end the tag that was read. + * @param length Contains in the end the length value that was read. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readTagAndLength(DcmInputStream &inStream, // inout + const E_TransferSyntax xfer, // in + DcmTag &tag, // out + Uint32 &length); // out + + /** helper function for read(). Create sub-object (item, item delimiter or sequence delimiter) of the + * appropriate type depending on the tag. + * @param subObject upon success, a pointer to the newly created object is returned in this parameter + * @param newTag tag of the sub-object to be created + * @param newLength length of the sub-object to be created + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition makeSubObject(DcmObject *&subObject, + const DcmTag &newTag, + const Uint32 newLength); + + /** helper function for read(). Create sub-object (item or pixel item) + * and call read() for this sub-object. + * @param inStream The stream which contains the information. + * @param newTag attribute tag for sub-object + * @param newLength length of the sub-object to be created + * @param xfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies + * what will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readSubItem(DcmInputStream &inStream, // inout + const DcmTag &newTag, // in + const Uint32 newLength, // in + const E_TransferSyntax xfer, // in + const E_GrpLenEncoding glenc, // in + const Uint32 maxReadLength = DCM_MaxReadLength); // in + + /** helper function for search(). May only be called if item list is non-empty. + * Performs hierarchical search for given tag and pushes pointer of sub-element + * on result stack if found + * @param tag tag key to be searched + * @param resultStack upon successful return, pointer to element pushed onto this stack + * @param searchIntoSub flag indicating whether recursive search is desired + * @return EC_Normal if tag found and stack modified, EC_TagNotFound if tag not found and stack unmodified + */ + virtual OFCondition searchSubFromHere(const DcmTagKey &tag, // in + DcmStack &resultStack, // inout + const OFBool searchIntoSub); // in + + /// the list of items maintained by this sequence object + DcmList *itemList; + +private: + + /** static helper method used in writeSignatureFormat(). + * This function resembles DcmObject::writeTagAndLength() + * but only writes the tag, VR and reserved field. + * @param outStream stream to write to + * @param tag attribute tag + * @param vr attribute VR as reported by getVR + * @param oxfer output transfer syntax + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition writeTagAndVR(DcmOutputStream &outStream, + const DcmTag &tag, + DcmEVR vr, + const E_TransferSyntax oxfer); + + /** flag used during suspended I/O. Indicates whether the last item + * was completely or only partially read/written during the last call + * to read/write. + */ + OFBool lastItemComplete; + + /** used during reading. Contains the position in the stream where + * the sequence started (needed for calculating the remaining number of + * bytes available for a fixed-length sequence). + */ + offile_off_t fStartPosition; + + /** true if this sequence has been instantiated while reading an UN element + * with undefined length + */ + OFBool readAsUN_; + +}; + + +#endif // DCSEQUEN_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcspchrs.h b/dcmdata/include/dcmtk/dcmdata/dcspchrs.h new file mode 100644 index 00000000..eee88e23 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcspchrs.h @@ -0,0 +1,311 @@ +/* + * + * Copyright (C) 2011-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Class for supporting the Specific Character Set attribute + * + */ + + +#ifndef DCSPCHRS_H +#define DCSPCHRS_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofchrenc.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/dcmdata/dcdefine.h" + + +// forward declaration +class DcmItem; + + +/** A class for managing and converting between different DICOM character sets. + * The conversion relies on the OFCharacterEncoding class, which again relies + * on an underlying character encoding library (e.g. libiconv or ICU). + * @note Please note that a current limitation is that only a single value is + * allowed for the destination character set (i.e. no code extensions). Of + * course, for the source character set, also multiple values are supported. + */ +class DCMTK_DCMDATA_EXPORT DcmSpecificCharacterSet +{ + + public: + + /** constructor. Initializes the member variables. + */ + DcmSpecificCharacterSet(); + + /** destructor + */ + ~DcmSpecificCharacterSet(); + + /** clear the internal state. This also forgets about the currently + * selected character sets, so selectCharacterSet() has to be called again + * before a string can be converted with convertString(). + */ + void clear(); + + /** query whether selectCharacterSet() has successfully been called for this + * object, i.e.\ whether convertString() may be called. + * @return OFTrue if selectCharacterSet() was successfully called before, + * OFFalse if not (or clear() has been called in the meantime). + */ +#ifdef HAVE_CXX11 + explicit +#endif + operator OFBool() const; + + /** query whether selectCharacterSet() has not been called before, + * i.e.\ convertString() would fail. + * @return OFTrue if selectCharacterSet() must be called before using + * convertString(), OFFalse if it has already been called. + */ + OFBool operator!() const; + + /** get currently selected source DICOM character set(s). Please note that + * the returned string can contain multiple values (defined terms separated + * by a backslash) if code extension techniques are used. Furthermore, + * the returned string is always normalized, i.e. leading and trailing + * spaces have been removed. + * @return currently selected source DICOM character set(s) or an empty + * string if none is selected (identical to ASCII, which is the default) + */ + const OFString &getSourceCharacterSet() const; + + /** get currently selected destination DICOM character set. Please note + * that the returned string, which contains a defined term, is always + * normalized, i.e. leading and trailing spaces have been removed. + * @return currently selected destination DICOM character set or an empty + * string if none is selected (identical to ASCII, which is the default) + */ + const OFString &getDestinationCharacterSet() const; + + /** get currently selected destination encoding, i.e.\ the name of the + * character set as used by the underlying character encoding library for + * the conversion. If code extension techniques are used to switch between + * different character encodings, the main/default encoding is returned. + * @return currently selected destination encoding or an empty string if + * none is selected + */ + const OFString &getDestinationEncoding() const; + + /** @copydoc OFCharacterEncoding::getConversionFlags() + */ + unsigned getConversionFlags() const; + + /** @copydoc OFCharacterEncoding::setConversionFlags() + */ + OFCondition setConversionFlags(const unsigned flags); + + /** select DICOM character sets for the input and output string, between + * which subsequent calls of convertString() convert. The defined terms + * for a particular character set can be found in the DICOM standard, e.g. + * "ISO_IR 100" for ISO 8859-1 (Latin 1) or "ISO_IR 192" for Unicode in + * UTF-8. An empty string denotes the default character repertoire, which + * is ASCII (7-bit). If multiple values are given for 'fromCharset' + * (separated by a backslash) code extension techniques are used and + * escape sequences may be encountered in the source string to switch + * between the specified character sets. + * @param fromCharset name of the source character set(s) used for the + * input string as given in the DICOM attribute + * Specific Character Set (0008,0005). Leading and + * trailing spaces are removed automatically (if + * present). + * @param toCharset name of the destination character set used for the + * output string. Only a single value is permitted + * (no code extensions). Leading and trailing spaces + * are removed automatically (if present). The + * default value is "ISO_IR 192" (Unicode in UTF-8). + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition selectCharacterSet(const OFString &fromCharset, + const OFString &toCharset = "ISO_IR 192"); + + /** select DICOM character sets for the input and output string, between + * which subsequent calls of convertString() convert. The source + * character set is determined from the DICOM element Specific Character + * Set (0008,0005) stored in the given dataset/item. The defined terms + * for the destination character set can be found in the DICOM standard, + * e.g. "ISO_IR 100" for ISO 8859-1 (Latin 1) or "ISO_IR 192" for Unicode + * in UTF-8. An empty string denotes the default character repertoire, + * which is ASCII (7-bit). If multiple values are found in the Specific + * Character Set element of the given 'dataset' (separated by a backslash) + * code extension techniques are used and escape sequences may be + * encountered in the source string to switch between the specified + * character sets. + * @param dataset DICOM dataset or item from which the source character + * set should be retrieved. If the data element + * Specific Character Set (0008,0005) is empty or + * missing, the default character set (i.e. ASCII) is + * used. + * @param toCharset name of the destination character set used for the + * the output string. Only a single value is permitted + * (no code extensions). Leading and trailing spaces + * are removed automatically (if present). The default + * value is "ISO_IR 192" (Unicode in UTF-8). + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition selectCharacterSet(DcmItem &dataset, + const OFString &toCharset = "ISO_IR 192"); + + /** convert the given string from the selected source character set(s) to + * the selected destination character set. That means selectCharacterSet() + * has to be called prior to this method. + * @param fromString input string to be converted (using the currently + * selected source character set) + * @param toString reference to variable where the converted string + * (using the currently selected destination character + * set) is stored + * @param delimiters optional string of characters that are regarded as + * delimiters, i.e.\ when found the character set is + * switched back to the default. CR, LF, FF and HT are + * always regarded as delimiters (see DICOM PS 3.5). + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition convertString(const OFString &fromString, + OFString &toString, + const OFString &delimiters = ""); + + /** convert the given string from the selected source character set(s) to + * the selected destination character set. That means selectCharacterSet() + * has to be called prior to this method. Since the length of the input + * string has to be specified explicitly, the string can contain more than + * one NULL byte. + * @param fromString input string to be converted (using the currently + * selected character set) + * @param fromLength length of the input string (number of bytes without + * the trailing NULL byte) + * @param toString reference to variable where the converted string + * (using the currently selected destination character + * set) is stored + * @param delimiters optional string of characters that are regarded as + * delimiters, i.e.\ when found the character set is + * switched back to the default. CR, LF, FF and HT are + * always regarded as delimiters (see DICOM PS 3.5). + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition convertString(const char *fromString, + const size_t fromLength, + OFString &toString, + const OFString &delimiters = ""); + + // --- static helper functions --- + + /** check whether the underlying character set conversion library is + * available. If not, no conversion between different character sets will + * be possible. + * @return OFTrue if the character set conversion is available, OFFalse + * otherwise + */ + static OFBool isConversionAvailable(); + + /** count characters in given UTF-8 string and return the resulting number + * of so-called "code points". Please note that invalid UTF-8 encodings + * are not handled properly. ASCII strings (7-bit) are also supported, + * although OFString::length() is probably much faster. + * @param utf8String valid character string with UTF-8 encoding + * @return number of characters (code points) in given UTF-8 string + */ + static size_t countCharactersInUTF8String(const OFString &utf8String); + + + protected: + + /** determine the destination character encoding (as used by the underlying + * character encoding library) from the given DICOM defined term (specific + * character set), and set the member variables accordingly. + * @param toCharset name of the destination character set used for the + * output string + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition determineDestinationEncoding(const OFString &toCharset); + + /** select a particular DICOM character set without code extensions for + * subsequent conversions. The corresponding DICOM defined term for the + * source character set is determined from the member variable + * 'SourceCharacterSet'. + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition selectCharacterSetWithoutCodeExtensions(); + + /** select a particular DICOM character set with code extensions for + * subsequent conversions. The corresponding DICOM defined terms for the + * source character set are determined from the member variable + * 'SourceCharacterSet'. + * @param sourceVM value multiplicity of the member variable + * 'SourceCharacterSet'. Usually, this value has + * already been determined by the calling method. + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition selectCharacterSetWithCodeExtensions(const unsigned long sourceVM); + + + /** check whether the given string contains at least one escape character + * (ESC), because it is used for code extension techniques like ISO 2022 + * @param strValue input string to be checked for any escape character + * @param strLength length of the input string + * @return OFTrue if an escape character has been found, OFFalse otherwise + */ + OFBool checkForEscapeCharacter(const char *strValue, + const size_t strLength) const; + + /** convert given string to octal format, i.e.\ all non-ASCII and control + * characters are converted to their octal representation. The total + * length of the string is always limited to a particular maximum (see + * implementation). If the converted string would be longer, it is + * cropped and "..." is appended to indicate this cropping. + * @param strValue input string to be converted and possibly cropped + * @param strLength length of the input string + * @return resulting string in octal format + */ + OFString convertToLengthLimitedOctalString(const char *strValue, + const size_t strLength) const; + + + private: + + /// type definition of a map storing the identifier (key) of a character + /// set and the associated character set converter + typedef OFMap T_EncodingConvertersMap; + + // private undefined copy constructor + DcmSpecificCharacterSet(const DcmSpecificCharacterSet &); + + // private undefined assignment operator + DcmSpecificCharacterSet &operator=(const DcmSpecificCharacterSet &); + + /// selected source character set(s) based on one or more DICOM defined terms + OFString SourceCharacterSet; + + /// selected destination character set based on a single DICOM defined term + OFString DestinationCharacterSet; + + /// selected destination encoding based on names supported by the underlying + /// character encoding library + OFString DestinationEncoding; + + /// character encoding converter + OFCharacterEncoding DefaultEncodingConverter; + + /// map of character set conversion descriptors + /// (only used if multiple character sets are needed) + T_EncodingConvertersMap EncodingConverters; +}; + + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcstack.h b/dcmdata/include/dcmtk/dcmdata/dcstack.h new file mode 100644 index 00000000..beb92277 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcstack.h @@ -0,0 +1,152 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: stack class + * + */ + +#ifndef DCSTACK_H +#define DCSTACK_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/dcmdata/dcdefine.h" + +class DcmObject; // forward declaration + + +/** helper class used by DcmStack. Maintains a single stack entry. + */ +class DCMTK_DCMDATA_EXPORT DcmStackNode +{ +public: + /** constructor. + * @param obj object pointer for this stack entry + */ + DcmStackNode(DcmObject *obj); + + /// destructor, non virtual. + ~DcmStackNode(); + + /** return pointer maintained by this entry + * @return object pointer + */ + DcmObject *value() const; + +private: + /// private undefined copy constructor + DcmStackNode(const DcmStackNode &); + + /// private undefined copy assignment operator + DcmStackNode &operator=(const DcmStackNode &); + + /// pointer to next stack entry, NULL if last one + DcmStackNode *link; + + /// pointer to object referenced by this stack entry + DcmObject *objNodeValue; + + /// class DcmStack directly manipulates the pointer chain + friend class DcmStack; +}; + + +/** this class manages a stack of pointers to DcmObject instances. + * The objects pointed to are never touched, e.g. deleted. + */ +class DCMTK_DCMDATA_EXPORT DcmStack +{ +public: + /// default constructor, creates empty stack + DcmStack(); + + /** copy constructor. Only pointers to objects are copied, + * the DcmObject instances are not duplicated. + * @param arg stack to copy from + */ + DcmStack(const DcmStack& arg); + + /// destructor, not virtual. Do not derive from this class. + ~DcmStack(); + + /** copy assignment operator. Only pointers to objects are copied, + * the DcmObject instances are not duplicated. + * @param arg object to assign from + * @return reference to this object + */ + DcmStack& operator=(const DcmStack &arg); + + /** comparison operator, needed for MSVC5. + * @param arg stack to compare to + * @return true if stacks are equal, false otherwise + */ + OFBool operator==(const DcmStack& arg) const; + + /** dummy comparison operator, needed for MSVC5. + * @param arg stack to compare to + * @return true if the cardinality of this stack is smaller than the + * cardinality of arg, or if the cardinality is equal and pointer + * comparison, from the top to the bottom of the stack results + * in a smaller pointer for this stack. + */ + OFBool operator<(const DcmStack& arg) const; + + /** push new pointer do DcmObject instance on stack + * @param obj object pointer to push on stack + * @return pointer passed as obj + */ + DcmObject* push( DcmObject *obj ); + + /** removes uppermost entry from stack and returns it. + * @return uppermost stack entry + */ + DcmObject* pop(); + + /** returns uppermost entry of stack without removing it. + * @returns uppermost stack entry + */ + DcmObject* top() const; + + /** returns n-th element from stack without removing it. + * @return n-th element from stack + */ + DcmObject* elem(const unsigned long number) const; + + /** checks if the stack is empty + * @return true if stack is empty, false otherwise + */ + OFBool empty() const; + + /** returns cardinality (number of entries) of the stack + * @return cardinality of stack + */ + unsigned long card() const; + + /** returns the stack to default-constructed state, i.e. empty state. + */ + void clear(); + +private: + /// pointer to the upmost stack entry, NULL if empty + DcmStackNode *topNode_; + + /// current cardinality of the stack + unsigned long cardinality_; +}; + + +#endif // DCSTACK_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcswap.h b/dcmdata/include/dcmtk/dcmdata/dcswap.h new file mode 100644 index 00000000..563780bd --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcswap.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: byte order functions + * + */ + +#ifndef DCSWAP_H +#define DCSWAP_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcerror.h" +#include "dcmtk/dcmdata/dcxfer.h" /* for E_ByteOrder */ + +/** swap block of data from big-endian to little-endian or back if neccessary + * @param newByteOrder desired byte order of data block + * @param oldByteOrder current byte order of data block + * @param value pointer to block of data + * @param byteLength size of data block in bytes + * @param valWidth size of each value in the data block, in bytes + * @return EC_Normal if successful, an error code otherwise + */ +DCMTK_DCMDATA_EXPORT OFCondition swapIfNecessary( + const E_ByteOrder newByteOrder, + const E_ByteOrder oldByteOrder, + void * value, + const Uint32 byteLength, + const size_t valWidth); + +/** swap block of data from big-endian to little-endian or back + * @param value pointer to block of data + * @param byteLength size of data block in bytes + * @param valWidth size of each value in the data block, in bytes + */ +DCMTK_DCMDATA_EXPORT void swapBytes( + void * value, + const Uint32 byteLength, + const size_t valWidth); + +/** swap an Uint16 number from big-endian to little-endian or back + * @param toSwap number to be swapped + * @return swapped number + */ +DCMTK_DCMDATA_EXPORT Uint16 swapShort(const Uint16 toSwap); + +/** swap a sequence of two bytes from big-endian to little-endian or back + * @param toSwap pointer to object to swap + */ +inline void swap2Bytes(Uint8 * toSwap) +// swaps [byte0][byte1] to [byte1][byte0] +{ + Uint8 tmp = toSwap[0]; + toSwap[0] = toSwap[1]; + toSwap[1] = tmp; +} + +/** swap a sequence of four bytes from big-endian to little-endian or back + * @param toSwap pointer to object to swap + */ +inline void swap4Bytes(Uint8 * toSwap) +// swaps [byte0][byte1][byte2][byte3] to [byte3][byte2][byte1][byte0] +{ + Uint8 tmp = toSwap[0]; + toSwap[0] = toSwap[3]; + toSwap[3] = tmp; + tmp = toSwap[1]; + toSwap[1] = toSwap[2]; + toSwap[2] = tmp; +} + +#endif // DCSWAP_H diff --git a/dcmdata/include/dcmtk/dcmdata/dctag.h b/dcmdata/include/dcmtk/dcmdata/dctag.h new file mode 100644 index 00000000..ba1368ee --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dctag.h @@ -0,0 +1,220 @@ +/* + * + * Copyright (C) 1994-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andrew Hewett + * + * Purpose: Definition of the class DcmTag + * + */ + +#ifndef DCTAG_H +#define DCTAG_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmdata/dcvr.h" + +/* +** Defines +*/ + +/// default attribute name for unknown attributes +#define DcmTag_ERROR_TagName "Unknown Tag & Data" + +/// macro for the "item" tag (avoid VR lookup) +#define DCM_ItemTag (DcmTag(DCM_Item, EVR_na)) +/// macro for the "item delimitation item" tag (avoid VR lookup) +#define DCM_ItemDelimitationItemTag (DcmTag(DCM_ItemDelimitationItem, EVR_na)) +/// macro for the "sequence delimitation item" tag (avoid VR lookup) +#define DCM_SequenceDelimitationItemTag (DcmTag(DCM_SequenceDelimitationItem, EVR_na)) +/// macro for the "internal use" tag (an attribute that is never used in DICOM) +#define DCM_InternalUseTag (DcmTag(DcmTagKey(0xfffe, 0xfffe), EVR_UNKNOWN)) + + +/** this class encapsulates an attribute tag (group, element) and a VR. + * It maintains a private creator name for private tags and caches + * the attribute name, once it is looked up in the data dictionary. + * This class maintains the interface to the DICOM data dictionary, + * i.e. performs look-ups of attribute VR and name in the background. + * Therefore, creation of DcmTag element is significantly more expensive + * than creation of simple DcmTagKey objects unless the VR is passed + * in the constructor. + */ +class DCMTK_DCMDATA_EXPORT DcmTag: public DcmTagKey +{ +public: + /// default constructor + DcmTag(); + + /** constructor. + * Initializes group/element from given tag key and performs + * a dictionary lookup for the VR. The lookup also considers + * private tags if the private creator is defined (not NULL). + * @param akey tag key + * @param privCreator private creator code (optional) + */ + DcmTag(const DcmTagKey& akey, const char *privCreator = NULL); + + /** constructor. + * Initializes group/element from given parameters and performs + * a dictionary lookup for the VR. The lookup also considers + * private tags if the private creator is defined (not NULL). + * @param g tag group + * @param e tag element + * @param privCreator private creator code (optional) + */ + DcmTag(Uint16 g, Uint16 e, const char *privCreator = NULL); + + /** constructor. + * Initializes group/element and VR from given parameters. + * No dictionary lookup needed/performed. + * @param akey tag key + * @param avr VR + */ + DcmTag(const DcmTagKey& akey, const DcmVR& avr); + + /** constructor. + * Initializes group/element and VR from given parameters. + * No dictionary lookup needed/performed. + * @param g tag group + * @param e tag element + * @param avr VR + */ + DcmTag(Uint16 g, Uint16 e, const DcmVR& avr); + + /// copy constructor + DcmTag(const DcmTag& tag); + + /// destructor + ~DcmTag(); + + /// copy assignment operator + DcmTag& operator=(const DcmTag& tag); + + /// set specific VR + DcmVR setVR(const DcmVR& avr); + + /// returns VR object by value + DcmVR getVR() const { return vr; } + + /// returns VR code + DcmEVR getEVR() const { return vr.getEVR(); } + + /// returns name of VR + const char* getVRName() const { return vr.getVRName(); } + + /** returns tag group + * @return tag group + */ + Uint16 getGTag() const { return getGroup(); } + + /** returns tag element + * @return tag element + */ + Uint16 getETag() const { return getElement(); } + + /** returns a copy of the tag key by value + * @return copy of tag key, by value + */ + DcmTagKey getXTag() const + { + return * OFstatic_cast(const DcmTagKey *, this); + } + + /** returns name of attribute tag. + * If name has not been accessed before, a dictionary lookup + * under consideration of the current private creator code + * is performed. If no attribute name is found, a default + * name is used. Never returns NULL. + * @return attribute tag name, never NULL. + */ + const char* getTagName(); + + /** returns the current private creator string for this object + * if any, NULL otherwise. + * @return creator code if present, NULL otherwise + */ + const char* getPrivateCreator() const; + + /** assigns a private creator code and deletes a possibly + * cached attribute name since the attribute name could + * change if a different private creator code is used. + * @param privCreator private creator code, may be NULL + */ + void setPrivateCreator(const char *privCreator); + + /** performs a look-up of the VR for the current tag key in the dictionary, + * under consideration of the private creator (if defined). + * If a dictionary entry is found, the VR of this object is copied + * from the dictionary entry, otherwise the VR remains unmodified. + */ + void lookupVRinDictionary(); + + /** returns true if a data element with the given tag and VR + * can be digitally signed, false otherwise + * @return true if signable, false otherwise + */ + OFBool isSignable() const; + + /** returns true if the VR used for writing is "UN" + */ + OFBool isUnknownVR() const; + + /// returns current status flag + OFCondition error() const { return errorFlag; } + + // --- static helper functions --- + + /** convert the given string to a DICOM tag value + * @param name name or tag of the attribute to be searched for. + * If the name of the attribute is given the spelling has to be consistent + * with the spelling used in the data dictionary (e.g. "PatientName"). + * If the tag values are used the format is "gggg,eeee" (i.e. two hexa- + * decimal numbers separated by a comma). + * @param value variable in which the resulting tag value is stored. + * If this functions fails to find the specified tag, this variable + * remains unchanged. + * @return status, EC_Normal upon success, an error code otherwise + */ + static OFCondition findTagFromName(const char *name, + DcmTag &value); +private: + + /** replace tagName with copy of given string + * @param c new tag name + */ + void updateTagName(const char *c); + + /** replace privateCreator with copy of given string + * @param c new private creator + */ + void updatePrivateCreator(const char *c); + + /// VR of this attribute tag + DcmVR vr; + + /// name of this attribute tag, remains NULL unless getTagName() is called + char *tagName; + + /// private creator code, remains NULL unless setPrivateCreator() is called + char *privateCreator; + + /// current error code, EC_Normal if a valid VR for the tag is known + OFCondition errorFlag; + +}; + +#endif /* !DCTAG_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dctagkey.h b/dcmdata/include/dcmtk/dcmdata/dctagkey.h new file mode 100644 index 00000000..42a301e0 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dctagkey.h @@ -0,0 +1,419 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Basis class for dicom tags. + * + */ + +#ifndef DCTAGKEY_H +#define DCTAGKEY_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dcdefine.h" + +/* +** Defines +*/ + +/// macro for an "undefined" attribute tag that is never used in DICOM +#define DCM_UndefinedTagKey DcmTagKey(0xffff, 0xffff) + +/** class maintaining a attribute tag (group and element number) + */ +class DCMTK_DCMDATA_EXPORT DcmTagKey +{ +public: + + /** default constructor + */ + inline DcmTagKey(); + + /** copy constructor + * @param key [in] The tag key to initialize from + */ + inline DcmTagKey(const DcmTagKey& key); + + /** constructor + * @param g group + * @param e element + */ + inline DcmTagKey(Uint16 g, Uint16 e); + + /** destructor + */ + virtual inline ~DcmTagKey(); + + /** set value to given tag key + * @param key attribute tag to copy + */ + inline void set(const DcmTagKey& key); + + /** set value to given group and element + * @param g group + * @param e element + */ + inline void set(Uint16 g, Uint16 e); + + /** set group to given number + * @param g group + */ + inline void setGroup(Uint16 g); + + /** set element to given number + * @param e element + */ + inline void setElement(Uint16 e); + + /** returns group number + * @return returns the group number of the tag key + */ + inline Uint16 getGroup() const; + + /** returns element number + * @return returns the element number of the tag key + */ + inline Uint16 getElement() const; + + /** returns base tag, i.e. in case of a repeating group tag always the base + * group number 0x5000 (curve) or 0x6000 (overlay) is used. For non-repeating + * group tags "this" tag key is returned. + * @return returns the base tag of the tag key + */ + DcmTagKey getBaseTag() const; + + /** checks whether the tag key is a valid group length element. + * Also calls hasValidGroup(). + * @return returns OFTrue if tag key is a valid group length element + */ + inline OFBool isGroupLength() const; + + /** returns true if the tag key is private, i.e. whether it has an odd group + * number. Also hasValidGroup() is called. + * @return returns OFTrue if group is private and valid. + */ + inline OFBool isPrivate() const; + + /** returns true, if tag is a private reservation tag of the form (gggg,00xx) + * with "gggg" being odd and "xx" in the range of 10 and FF. + * @return returns OFTrue if tag key is a private reservation key + */ + inline OFBool isPrivateReservation() const; + + /** returns true, if group is valid (permitted in DICOM command or data sets). + * Referring to the standard, groups 1, 3, 5, 7 and 0xFFFF are illegal. + * @return returns OFTrue if tag key has a valid group number. + */ + inline OFBool hasValidGroup() const; + + /** generate a simple hash code for this attribute tag. + * Used for fast look-up in the DICOM dictionary. + * @return hash code for this tag + */ + inline Uint32 hash() const; + + /** assignment operator for initializing this tag key from an existing one + * @param key [in] The key to copy from + * @return "this" initialization + */ + inline DcmTagKey& operator = (const DcmTagKey& key); + + /** Comparison operator. Returns true if both group and element number + * are the same. + * @param key key to compare with + * @return true if tag keys are the same + */ + inline OFBool operator == (const DcmTagKey& key) const; + + /** negation operator. Returns true if either group or element number + * are not the same. + * @param key key to compare with + * @return true if tag keys are not the same + */ + inline OFBool operator != (const DcmTagKey& key) const; + + /** 'less than' operator. Returns true if the given tag key is greater + * than "this". + * @param key key to compare with + * @return true if given key is greater than "this" + */ + inline OFBool operator < (const DcmTagKey& key) const; + + /** 'greater than' operator. Returns true if the given tag key is smaller + * than "this". + * @param key key to compare with + * @return true if "this" key is smaller than given one. + */ + inline OFBool operator > (const DcmTagKey& key) const; + + /** 'less or equal' operator. Returns true if the given tag key is greater + * or the same as "this". + * @param key key to compare with + * @return true if given key is greater or the same as "this" + */ + inline OFBool operator <= (const DcmTagKey& key) const; + + /** 'greater or equal' operator. Returns true if the given tag key is + * smaller or equal as "this". + * @param key key to compare with + * @return true if "this" key is smaller or equal to given one. + */ + inline OFBool operator >= (const DcmTagKey& key) const; + + friend DCMTK_DCMDATA_EXPORT STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& s, const DcmTagKey& k); + + /** convert tag key to string having the form "(gggg,eeee)". + * @return the string representation of this tag key + */ + OFString toString() const; + + /** returns true if a data element with the given tag key can + * be digitally signed, false otherwise + * @return true if signable, false otherwise + */ + OFBool isSignableTag() const; + +protected: + + /// less-than operation comparing only group numbers + int groupLT(const DcmTagKey& key) const; + + /// greater-than operation comparing only group numbers + int groupGT(const DcmTagKey& key) const; + + /// comparison operation comparing only group numbers + int groupEQ(const DcmTagKey& key) const; + + /// less-than operation comparing only element numbers + int elementLT(const DcmTagKey& key) const; + + /// greater-than operation comparing only element numbers + int elementGT(const DcmTagKey& key) const; + + /// comparison operation comparing only element numbers + int elementEQ(const DcmTagKey& key) const; + +private: + + /// tag group number + Uint16 group; + /// tag element number + Uint16 element; + +}; + +/** stream output operator for tag keys + * @param s output stream + * @param k tag key + * @return reference to output stream + */ +DCMTK_DCMDATA_EXPORT STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& s, const DcmTagKey& k); + +/* +** inline versions of functions +*/ + +/* constructors and destructor */ + +inline +DcmTagKey::DcmTagKey() + : group(0xffff), + element(0xffff) +{ +} + +inline +DcmTagKey::DcmTagKey(const DcmTagKey& key) + : group(key.group), + element(key.element) +{ +} + +inline +DcmTagKey::DcmTagKey(Uint16 g, Uint16 e) + : group(g), + element(e) +{ +} + +inline +DcmTagKey::~DcmTagKey() +{ +} + +/* access methods */ + +inline void +DcmTagKey::set(const DcmTagKey& key) +{ + group = key.group; + element = key.element; +} + +inline void +DcmTagKey::set(Uint16 g, Uint16 e) +{ + group = g; + element = e; +} + +inline void +DcmTagKey::setGroup(Uint16 g) +{ + group = g; +} + +inline void +DcmTagKey::setElement(Uint16 e) +{ + element = e; +} + +inline Uint16 +DcmTagKey::getGroup() const +{ + return group; +} + +inline Uint16 +DcmTagKey::getElement() const +{ + return element; +} + +inline OFBool +DcmTagKey::isGroupLength() const +{ + return (element == 0) && hasValidGroup(); +} + +inline OFBool +DcmTagKey::isPrivate() const +{ + return ((group & 1) != 0 ) && hasValidGroup(); +} + +inline OFBool +DcmTagKey::isPrivateReservation() const +{ + // private reservation has element number ranging from 0x0010 to 0x00FF + return isPrivate() && (element >= 0x10) && (element <= 0xFF); +} + +inline OFBool +DcmTagKey::hasValidGroup() const +{ + // group numbers 1, 3, 5, 7 and 0xFFFF are illegal in DICOM + if (((group & 1) != 0) && ((group <= 7) || (group == 0xFFFF))) + return OFFalse; + else + return OFTrue; +} + +inline DcmTagKey& +DcmTagKey::operator=(const DcmTagKey& key) +{ + set(key); + return *this; +} + +/* Simple Hash Function */ + +inline Uint32 +DcmTagKey::hash() const +{ + // generate simple hash code + return (((getGroup() << 16) & 0xffff0000) | (getElement() & 0xffff)); +} + +/* Comparisons */ + +inline int +DcmTagKey::groupLT(const DcmTagKey& key) const +{ + return (getGroup() < key.getGroup()); +} + +inline int +DcmTagKey::groupGT(const DcmTagKey& key) const +{ + return (getGroup() > key.getGroup()); +} + +inline int +DcmTagKey::groupEQ(const DcmTagKey& key) const +{ + return getGroup() == key.getGroup(); +} + +inline int +DcmTagKey::elementLT(const DcmTagKey& key) const +{ + return (getElement() < key.getElement()); +} + +inline int +DcmTagKey::elementGT(const DcmTagKey& key) const +{ + return (getElement() > key.getElement()); +} + +inline int +DcmTagKey::elementEQ(const DcmTagKey& key) const +{ + return getElement() == key.getElement(); +} + +inline OFBool +DcmTagKey::operator == (const DcmTagKey& key) const +{ + return ( groupEQ(key) && elementEQ(key) ); +} + +inline OFBool +DcmTagKey::operator != (const DcmTagKey& key) const +{ + return !(*this == key); +} + +inline OFBool +DcmTagKey::operator < (const DcmTagKey& key) const +{ + return (groupLT(key) || (groupEQ(key) && elementLT(key))); +} + +inline OFBool +DcmTagKey::operator > (const DcmTagKey& key) const +{ + return (groupGT(key) || (groupEQ(key) && elementGT(key))); +} + +inline OFBool +DcmTagKey::operator <= (const DcmTagKey& key) const +{ + return (*this < key) || (*this == key); +} + +inline OFBool +DcmTagKey::operator >= (const DcmTagKey& key) const +{ + return (*this > key) || (*this == key); +} + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dctk.h b/dcmdata/include/dcmtk/dcmdata/dctk.h new file mode 100644 index 00000000..1e8681de --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dctk.h @@ -0,0 +1,105 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: include most dcmdata files that are usually required + * + */ + +#ifndef DCTK_H +#define DCTK_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +// various headers +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcistrma.h" +#include "dcmtk/dcmdata/dcostrma.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/ofstd/ofdefine.h" + +// tags and dictionary +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmdata/dctag.h" +#include "dcmtk/dcmdata/dcdicent.h" +#include "dcmtk/dcmdata/dchashdi.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +// basis classes +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/dcmdata/dcelem.h" + +// classes for management of sequences and other lists +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcdicdir.h" +#include "dcmtk/dcmdata/dcpixseq.h" + +// element classes for string management (8-bit) +#include "dcmtk/dcmdata/dcbytstr.h" +#include "dcmtk/dcmdata/dcvrae.h" +#include "dcmtk/dcmdata/dcvras.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrur.h" + +// element classes for string management (8-bit and/or multi-byte) +#include "dcmtk/dcmdata/dcchrstr.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrlt.h" +#include "dcmtk/dcmdata/dcvrpn.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcvrst.h" +#include "dcmtk/dcmdata/dcvruc.h" +#include "dcmtk/dcmdata/dcvrut.h" + +// element class for byte and word value representations +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcpixel.h" +#include "dcmtk/dcmdata/dcovlay.h" + +// element classes for binary value fields +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcvrss.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcvrsl.h" +#include "dcmtk/dcmdata/dcvrul.h" +#include "dcmtk/dcmdata/dcvrsv.h" +#include "dcmtk/dcmdata/dcvruv.h" +#include "dcmtk/dcmdata/dcvrulup.h" +#include "dcmtk/dcmdata/dcvrfl.h" +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmdata/dcvrof.h" +#include "dcmtk/dcmdata/dcvrod.h" +#include "dcmtk/dcmdata/dcvrol.h" +#include "dcmtk/dcmdata/dcvrov.h" + +// misc supporting tools +#include "dcmtk/dcmdata/cmdlnarg.h" + +#endif /* DCTK_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dctypes.h b/dcmdata/include/dcmtk/dcmdata/dctypes.h new file mode 100644 index 00000000..2a4dd4c3 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dctypes.h @@ -0,0 +1,255 @@ +/* + * + * Copyright (C) 1994-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andrew Hewett + * + * Purpose: global type and constant definitions + * + */ + + +#ifndef DCTYPES_H +#define DCTYPES_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmdata/dcdefine.h" + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_TYPES_H +/* needed e.g. on Solaris for definition of size_t */ +#include +#endif +END_EXTERN_C + +/* +** Logging +*/ + +extern DCMTK_DCMDATA_EXPORT OFLogger DCM_dcmdataLogger; + +#define DCMDATA_TRACE(msg) OFLOG_TRACE(DCM_dcmdataLogger, msg) +#define DCMDATA_DEBUG(msg) OFLOG_DEBUG(DCM_dcmdataLogger, msg) +#define DCMDATA_INFO(msg) OFLOG_INFO(DCM_dcmdataLogger, msg) +#define DCMDATA_WARN(msg) OFLOG_WARN(DCM_dcmdataLogger, msg) +#define DCMDATA_ERROR(msg) OFLOG_ERROR(DCM_dcmdataLogger, msg) +#define DCMDATA_FATAL(msg) OFLOG_FATAL(DCM_dcmdataLogger, msg) + +/* +** Macro Definitions +*/ + +/// XML namespace URI for the dcmtk +#define DCMTK_XML_NAMESPACE_URI "http://dicom.offis.de/dcmtk" +/// XML namespace URI for Native DICOM Model (see DICOM part 19) +#define NATIVE_DICOM_MODEL_XML_NAMESPACE_URI "http://dicom.nema.org/PS3.19/models/NativeDICOM" + +// ANSI escape codes for color output of the print() method +#define DCMDATA_ANSI_ESCAPE_CODE_RESET "\033[0m" +#define DCMDATA_ANSI_ESCAPE_CODE_TAG "\033[22m\033[32m" +#define DCMDATA_ANSI_ESCAPE_CODE_VR "\033[22m\033[31m" +#define DCMDATA_ANSI_ESCAPE_CODE_VALUE "\033[1m\033[37m" +#define DCMDATA_ANSI_ESCAPE_CODE_INFO "\033[1m\033[30m" +#define DCMDATA_ANSI_ESCAPE_CODE_LENGTH "\033[22m\033[36m" +#define DCMDATA_ANSI_ESCAPE_CODE_VM "\033[22m\033[35m" +#define DCMDATA_ANSI_ESCAPE_CODE_NAME "\033[22m\033[33m" +#define DCMDATA_ANSI_ESCAPE_CODE_NAME_1 "\033[1m\033[33m" +#define DCMDATA_ANSI_ESCAPE_CODE_SEQUENCE "\033[22m\033[32m" +#define DCMDATA_ANSI_ESCAPE_CODE_SEQUENCE_1 "\033[1m\033[32m" +#define DCMDATA_ANSI_ESCAPE_CODE_ITEM "\033[1m\033[30m" +#define DCMDATA_ANSI_ESCAPE_CODE_LINE "\033[1m\033[30m" +#define DCMDATA_ANSI_ESCAPE_CODE_COMMENT "\033[1m\033[30m" + + +// include this file in doxygen documentation + +/** @file dctypes.h + * @brief type definitions for the dcmdata module + */ + + +/* +** Enumerated Types +*/ + +/// encoding type for sequences and sequence items +typedef enum { + /// defined length + EET_ExplicitLength = 0, + /// undefined length + EET_UndefinedLength = 1 +} E_EncodingType; + + +/// handling of group length elements when reading/writing a dataset +typedef enum { + /// no change of group length values, WARNING: DO NOT USE THIS VALUE FOR WRITE OPERATIONS + EGL_noChange = 0, + /// remove group length tags + EGL_withoutGL = 1, + /// add group length tags for every group + EGL_withGL = 2, + /// recalculate values for existing group length tags + EGL_recalcGL = 3 +} E_GrpLenEncoding; + +/// handling of dataset trailing padding +typedef enum { + /// no change of padding tags + EPD_noChange = 0, + /// remove all padding tags + EPD_withoutPadding = 1, + /// add padding tags + EPD_withPadding = 2 +} E_PaddingEncoding; + +/// search mode for hierarchical search operations +typedef enum { + /// start search from current object + ESM_fromHere = 0, + /// start search from object pointed to by stack top + ESM_fromStackTop = 1, + /// start search from object following the object pointed to by stack top + ESM_afterStackTop = 2 +} E_SearchMode; + +/// object state during transfer (read/write) operations +typedef enum { + /// object prepared for transfer, no data transferred yet + ERW_init = 0, + /// object transfer completed + ERW_ready = 1, + /// object transfer in progress + ERW_inWork = 2, + /// object not prepared for transfer operation + ERW_notInitialized = 3 +} E_TransferState; + +/// mode for file reading +typedef enum { + /// auto detect: fileformat or dataset + ERM_autoDetect = 0, + /// read as dataset (assume no meta header present) + ERM_dataset = 1, + /// read file format only, refuse if no meta-header + ERM_fileOnly = 2, + /// read meta-header only, do not read the dataset + ERM_metaOnly = 3 +} E_FileReadMode; + +/// mode for file writing +typedef enum { + /// write as fileformat (update only missing information, this is the old behavior) + EWM_fileformat = 0, + /// write as dataset (without meta header) + EWM_dataset = 1, + /// write as fileformat and update required information (e.g. SOP Class/Instance UID) + EWM_updateMeta = 2, + /// write as fileformat and create new meta header (do not retain existing information) + EWM_createNewMeta = 3, + /// write as fileformat but don't update the meta header (please be careful!) + EWM_dontUpdateMeta = 4 +} E_FileWriteMode; + + +/** General purpose class hiding constants from the global namespace. + */ +struct DCMTK_DCMDATA_EXPORT DCMTypes +{ + public: + + /** @name print() flags. + * These flags can be combined and passed to the print() methods. + */ + //@{ + + /// shorten long tag values (e.g. long texts, pixel data) + static const size_t PF_shortenLongTagValues; + + /// show hierarchical tree structure of the dataset + static const size_t PF_showTreeStructure; + + /// do not map well-known UID numbers to UID names (e.g. Transfer Syntax and SOP Class) + static const size_t PF_doNotMapUIDsToNames; + + /// quote non-ASCII string content as XML markup + static const size_t PF_convertToMarkup; + + /// quote non-ASCII string content as octal numbers + static const size_t PF_convertToOctalNumbers; + + /// use ANSI escape codes for output + static const size_t PF_useANSIEscapeCodes; + //@} + + /** @name writeXML() flags. + * These flags can be combined and passed to the writeXML() methods. + */ + //@{ + + /// add document type definition (DTD). DCMTK-specific format only. + static const size_t XF_addDocumentType; + + /// write binary data to XML output file. DCMTK-specific format only. + static const size_t XF_writeBinaryData; + + /// encode binary data as Base64 (MIME). + /// - For the DCMTK-specific format, the default is to use hex numbers. + /// - For the Native DICOM Model, the default is to use a UUID reference. + static const size_t XF_encodeBase64; + + /// use XML namespace URI. The value depends on the selected output format. + static const size_t XF_useXMLNamespace; + + /// embed content of document type definition. DCMTK-specific format only. + static const size_t XF_embedDocumentType; + + /// don't write name of the DICOM data elements. DCMTK-specific format only. + static const size_t XF_omitDataElementName; + + /// convert non-ASCII characters to numeric values. DCMTK-specific format only. + static const size_t XF_convertNonASCII; + + /// write data in "Native DICOM Model" format as defined for Application Hosting (DICOM part 19). + /// The default is to use the DCMTK-specific format. + static const size_t XF_useNativeModel; + + //@} + + /** @name convertCharacterSet() flags. + * These flags can be combined and passed to the convertCharacterSet() methods. + */ + //@{ + + /// try to approximate characters that cannot be represented through similar + /// looking characters. See DcmSpecificCharacterSet::getTransliterationMode(). + static const size_t CF_transliterate; + + /// discard characters that cannot be represented in destination character set. + /// See DcmSpecificCharacterSet::getDiscardIllegalSequenceMode(). + static const size_t CF_discardIllegal; + + //@} +}; + + +// Undefined Length Identifier +const Uint32 DCM_UndefinedLength = 0xffffffff; + + +#endif /* !DCTYPES_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dcuid.h b/dcmdata/include/dcmtk/dcmdata/dcuid.h new file mode 100644 index 00000000..7a6fafe5 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcuid.h @@ -0,0 +1,844 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: + * Definitions of "well known" DICOM Unique Identifiers, + * routines for finding and creating UIDs. + * + */ + +#ifndef DCUID_H +#define DCUID_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/dcmdata/dcdefine.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +// include this file in doxygen documentation + +/** @file dcuid.h + * @brief global definitions and functions for UID handling + */ + + +/// type of Storage SOP Class +typedef enum { + /// patient objects + ESSC_Patient = 0x01, + /// non-patient objects + ESSC_NonPatient = 0x02, + /// image objects (subset of patient objects) + ESSC_Image = 0x04, + /// all types (patient and non-patient objects) + ESSC_All = 0x03 +} E_StorageSOPClassType; + + +/** return the name of a UID. + * Performs a table lookup and returns a pointer to a read-only string. + * @param uid UID string for which the name is to be looked up + * @param defaultValue default to return if UID not known + * @return name string or defaultValue if UID is unknown + */ +DCMTK_DCMDATA_EXPORT const char* dcmFindNameOfUID(const char* uid, const char* defaultValue = NULL); + +/** return the UID of a name. + * Performs a table lookup and returns a pointer to a read-only string. + * @param name name string for which the corresponding UID is to be looked up + * @return UID string or NULL if name is unknown + */ +DCMTK_DCMDATA_EXPORT const char* dcmFindUIDFromName(const char* name); + +/** an array of const strings containing all known Storage SOP Classes + * that fit into the conventional PATIENT-STUDY-SERIES-INSTANCE information + * model, i.e. everything a Storage SCP might want to store in a PACS. + * Special cases such as Hanging Protocol or Color Palette Storage SOP Class + * are not included in this list. + * WARNING: This list contains more than 64 entries, i.e. it is not possible + * to use this list to configure the association negotiation behavior of + * a Storage SCU that always proposes two presentation contexts for each + * SOP class. + */ +extern DCMTK_DCMDATA_EXPORT const char* dcmAllStorageSOPClassUIDs[]; + +/// number of entries in dcmAllStorageSOPClassUIDs. +extern DCMTK_DCMDATA_EXPORT const int numberOfDcmAllStorageSOPClassUIDs; + +/** an array of const strings containing all storage SOP classes that + * are proposed by default by those Storage SCU components in DCMTK + * that always propose one presentation context for each SOP class, + * e.g. movescu or dcmqrdb. This list is guaranteed to have at most + * 120 entries (to leave room for FIND/MOVE presentation contexts). + */ +extern DCMTK_DCMDATA_EXPORT const char* dcmLongSCUStorageSOPClassUIDs[]; + +/// number of entries in dcmLongSCUStorageSOPClassUIDs. +extern DCMTK_DCMDATA_EXPORT const int numberOfDcmLongSCUStorageSOPClassUIDs; + +/** an array of const strings containing all storage SOP classes that + * are proposed by default by those Storage SCU components in DCMTK + * that always propose TWO presentation context for each SOP class, + * e.g. storescu. This list is guaranteed to have at most + * 64 entries. + */ +extern DCMTK_DCMDATA_EXPORT const char* dcmShortSCUStorageSOPClassUIDs[]; + +/// number of entries in dcmShortSCUStorageSOPClassUIDs. +extern DCMTK_DCMDATA_EXPORT const int numberOfDcmShortSCUStorageSOPClassUIDs; + +/** returns true if the uid is one of the Storage SOP Classes. + * Performs a table lookup in the dcmAllStorageSOPClassUIDs, dcmImageSOPClassUIDs + * and/or other tables depending on the requested type of Storage SOP Class. + * Please note that, by default, this function only covers those Storage SOP + * Classes that fit into the conventional PATIENT-STUDY-SERIES-INSTANCE + * information model, i.e. non-patient DICOM objects are missing. This can + * be changed by setting the optional type parameter to ESSC_NonPatient. + * @param uid UID string + * @param type type of Storage SOP Class (default: patient objects only) + * @return true if UID is a known Storage SOP Class, false otherwise + */ +DCMTK_DCMDATA_EXPORT OFBool dcmIsaStorageSOPClassUID(const char* uid, const E_StorageSOPClassType type = ESSC_Patient); + +/** a global constant array of + * string pointers containing the UIDs of all known Image SOP + * Classes. The global variable numberOfDcmImageSOPClassUIDs + * defines the size of the array. + * NOTE: this list represents a subset of the dcmAllStorageSOPClassUIDs list + */ +extern DCMTK_DCMDATA_EXPORT const char* dcmImageSOPClassUIDs[]; + +/// number of entries in dcmImageSOPClassUIDs +extern DCMTK_DCMDATA_EXPORT const int numberOfDcmImageSOPClassUIDs; + +/** returns true if the uid is one of the Image Storage SOP Classes. + * This is just a shortcut for dcmIsaStorageSOPClassUID(uid, ESSC_Image). + * @param uid UID string + * @return true if UID is a known Image Storage SOP Class, false otherwise + */ +DCMTK_DCMDATA_EXPORT OFBool dcmIsImageStorageSOPClassUID(const char* uid); + +/** creates a Unique Identifier in uid and returns uid. + * uid must be at least 65 bytes. Care is taken to make sure + * that the generated UID is 64 characters or less. + * If a prefix string is not passed as the second argument a + * default of SITE_INSTANCE_UID_ROOT (see below) will be used. + * Otherwise the supplied prefix string will appear at the beginning + * of uid. + * The UID is created by appending to the prefix the following: + * - the host ID (if obtainable, zero otherwise), + * - the process ID (if obtainable, zero otherwise), + * - the system calendar time, and + * - an accumulating counter for this process. + * @param uid pointer to buffer of 65 or more characters in which the UID is returned + * @param prefix prefix for UID creation + * @return pointer to UID, identical to uid parameter + */ +DCMTK_DCMDATA_EXPORT char *dcmGenerateUniqueIdentifier(char *uid, const char* prefix=NULL); + +/** performs a table lookup and returns a short modality identifier + * that can be used for building file names etc. + * Identifiers are defined for all storage SOP classes. + * Returns 'defaultValue' if no modality identifier found or sopClassUID==NULL. + * @param sopClassUID UID string + * @param defaultValue default to return if UID not known + * @return modality string for modality UID, or defaultValue if not found + */ +DCMTK_DCMDATA_EXPORT const char *dcmSOPClassUIDToModality(const char *sopClassUID, const char *defaultValue = NULL); + +/** performs a table lookup and returns a guessed average + * file size for the given SOP class. + * Average sizes are defined for all storage SOP classes, but may be very far off. + * @param sopClassUID UID string + * @return estimated average size for objects of this SOP class + */ +DCMTK_DCMDATA_EXPORT unsigned long dcmGuessModalityBytes(const char *sopClassUID); + +/* +** String Constants +*/ + +/* +** OFFIS UID is: 1.2.276.0.7230010 +** UID root for OFFIS DCMTK project: 1.2.276.0.7230010.3 +** for OFFIS GO-Kard project: 1.2.276.0.7230010.8 +*/ + +#ifndef PACKAGE_DATE +#error Required compiler definition PACKAGE_DATE undefined +#endif +#ifndef PACKAGE_VERSION +#error Required compiler definition PACKAGE_VERSION undefined +#endif +#ifndef PACKAGE_VERSION_NUMBER +#error Required compiler definition PACKAGE_VERSION_NUMBER undefined +#endif + +// helper macros for version number conversion + +#define PACKAGE_VERSION_NUMBER_TO_STRING_( x ) #x +#define PACKAGE_VERSION_NUMBER_TO_STRING( x ) PACKAGE_VERSION_NUMBER_TO_STRING_( x ) + +/* NOTE: Implementation version name VR=SH may not be longer than 16 chars + * The second name is used to identify files written without dcmdata + * (i.e. using the --bit-preserving switch in various tools) + */ + +/// implementation version name for this version of the toolkit +#define OFFIS_DTK_IMPLEMENTATION_VERSION_NAME "OFFIS_DCMTK_" PACKAGE_VERSION_NUMBER_TO_STRING(PACKAGE_VERSION_NUMBER) + +/// implementation version name for this version of the toolkit, used for files received in "bit preserving" mode +#define OFFIS_DTK_IMPLEMENTATION_VERSION_NAME2 "OFFIS_DCMBP_" PACKAGE_VERSION_NUMBER_TO_STRING(PACKAGE_VERSION_NUMBER) + +/// release date of current toolkit release +#ifdef DCMTK_BUILD_DATE +#define OFFIS_DCMTK_RELEASEDATE DCMTK_BUILD_DATE +#else +#define OFFIS_DCMTK_RELEASEDATE PACKAGE_DATE +#endif + +/// UID root for DCMTK, registered for OFFIS with DIN in Germany +#define OFFIS_UID_ROOT "1.2.276.0.7230010.3" + +/// DCMTK version number for this release +#define OFFIS_DCMTK_VERSION_NUMBER PACKAGE_VERSION_NUMBER + +/// DCMTK version number (as string) for this release +#define OFFIS_DCMTK_VERSION_STRING PACKAGE_VERSION + +/// DCMTK version number suffix string for this release +#define OFFIS_DCMTK_VERSION_SUFFIX PACKAGE_VERSION_SUFFIX + +/// DCMTK version number string including suffix +#define OFFIS_DCMTK_VERSION OFFIS_DCMTK_VERSION_STRING OFFIS_DCMTK_VERSION_SUFFIX + +/// Implementation class UID for this release of the toolkit +#define OFFIS_IMPLEMENTATION_CLASS_UID OFFIS_UID_ROOT ".0." OFFIS_DCMTK_VERSION_STRING + +/// Instance creator UID for this release of the toolkit +#define OFFIS_INSTANCE_CREATOR_UID OFFIS_IMPLEMENTATION_CLASS_UID + +/// private coding scheme UID root for coding schemes generated by OFFIS +#define OFFIS_CODING_SCHEME_UID_ROOT OFFIS_UID_ROOT ".0.0" + +/// private coding scheme version for coding schemes generated by OFFIS +#define OFFIS_CODING_SCHEME_VERSION "1" + +/// private coding scheme UID for coding schemes generated by OFFIS +#define OFFIS_CODING_SCHEME_UID OFFIS_CODING_SCHEME_UID_ROOT "." OFFIS_CODING_SCHEME_VERSION + +/* +** Each site should define its own SITE_UID_ROOT +*/ +#ifndef SITE_UID_ROOT +/// UID root to be used when generating UIDs. By default uses the DCMTK root, but can be replaced at compile time. +#define SITE_UID_ROOT OFFIS_UID_ROOT /* default */ +#endif + +/* +** Useful UID prefixes. These can be whatever you want. +** +** These site UIDs are arbitrary, non-standard, with no meaning +** and can be changed at any time. Do _not_ rely on these values. +** Do _not_ assume any semantics when using these suffixes. +** +*/ + +/// UID root for study instance UIDs +#define SITE_STUDY_UID_ROOT SITE_UID_ROOT ".1.2" + +/// UID root for series instance UIDs +#define SITE_SERIES_UID_ROOT SITE_UID_ROOT ".1.3" + +/// UID root for SOP instance UIDs +#define SITE_INSTANCE_UID_ROOT SITE_UID_ROOT ".1.4" + +/** A private SOP Class UID which is used in a file meta-header when no + * instance of a Storage SOP Class is stored in the file. -- NON-STANDARD + */ +#define UID_PrivateGenericFileSOPClass SITE_UID_ROOT ".1.0.1" + +/// DICOM Defined Standard Application Context UID +#define UID_StandardApplicationContext "1.2.840.10008.3.1.1.1" + +/* +** Defined Transfer Syntax UIDs +*/ + +/// Implicit VR Little Endian: Default Transfer Syntax for DICOM +#define UID_LittleEndianImplicitTransferSyntax "1.2.840.10008.1.2" +/// Explicit VR Little Endian +#define UID_LittleEndianExplicitTransferSyntax "1.2.840.10008.1.2.1" +/// Explicit VR Big Endian - RETIRED +#define UID_BigEndianExplicitTransferSyntax "1.2.840.10008.1.2.2" +/// Deflated Explicit VR Little Endian +#define UID_DeflatedExplicitVRLittleEndianTransferSyntax "1.2.840.10008.1.2.1.99" +/** JPEG Baseline (Process 1): Default Transfer Syntax + * for Lossy JPEG 8 Bit Image Compression + */ +#define UID_JPEGProcess1TransferSyntax "1.2.840.10008.1.2.4.50" +/** JPEG Extended (Process 2 & 4): Default Transfer Syntax + * for Lossy JPEG 12 Bit Image Compression (Process 4 only) + */ +#define UID_JPEGProcess2_4TransferSyntax "1.2.840.10008.1.2.4.51" +/// JPEG Extended (Process 3 & 5) - RETIRED +#define UID_JPEGProcess3_5TransferSyntax "1.2.840.10008.1.2.4.52" +/// JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8) - RETIRED +#define UID_JPEGProcess6_8TransferSyntax "1.2.840.10008.1.2.4.53" +/// JPEG Spectral Selection, Non-Hierarchical (Process 7 & 9) - RETIRED +#define UID_JPEGProcess7_9TransferSyntax "1.2.840.10008.1.2.4.54" +/// JPEG Full Progression, Non-Hierarchical (Process 10 & 12) - RETIRED +#define UID_JPEGProcess10_12TransferSyntax "1.2.840.10008.1.2.4.55" +/// JPEG Full Progression, Non-Hierarchical (Process 11 & 13) - RETIRED +#define UID_JPEGProcess11_13TransferSyntax "1.2.840.10008.1.2.4.56" +/// JPEG Lossless, Non-Hierarchical (Process 14) +#define UID_JPEGProcess14TransferSyntax "1.2.840.10008.1.2.4.57" +/// JPEG Lossless, Non-Hierarchical (Process 15) - RETIRED +#define UID_JPEGProcess15TransferSyntax "1.2.840.10008.1.2.4.58" +/// JPEG Extended, Hierarchical (Process 16 & 18) - RETIRED +#define UID_JPEGProcess16_18TransferSyntax "1.2.840.10008.1.2.4.59" +/// JPEG Extended, Hierarchical (Process 17 & 19) - RETIRED +#define UID_JPEGProcess17_19TransferSyntax "1.2.840.10008.1.2.4.60" +/// JPEG Spectral Selection, Hierarchical (Process 20 & 22) - RETIRED +#define UID_JPEGProcess20_22TransferSyntax "1.2.840.10008.1.2.4.61" +/// JPEG Spectral Selection, Hierarchical (Process 21 & 23) - RETIRED +#define UID_JPEGProcess21_23TransferSyntax "1.2.840.10008.1.2.4.62" +/// JPEG Full Progression, Hierarchical (Process 24 & 26) - RETIRED +#define UID_JPEGProcess24_26TransferSyntax "1.2.840.10008.1.2.4.63" +/// JPEG Full Progression, Hierarchical (Process 25 & 27) - RETIRED +#define UID_JPEGProcess25_27TransferSyntax "1.2.840.10008.1.2.4.64" +/// JPEG Lossless, Hierarchical (Process 28) - RETIRED +#define UID_JPEGProcess28TransferSyntax "1.2.840.10008.1.2.4.65" +/// JPEG Lossless, Hierarchical (Process 29) - RETIRED +#define UID_JPEGProcess29TransferSyntax "1.2.840.10008.1.2.4.66" +/** JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 + * [Selection Value 1]): Default Transfer Syntax for Lossless JPEG Image Compression + */ +#define UID_JPEGProcess14SV1TransferSyntax "1.2.840.10008.1.2.4.70" +/// JPEG-LS Lossless Image Compression +#define UID_JPEGLSLosslessTransferSyntax "1.2.840.10008.1.2.4.80" +/// JPEG-LS Lossy (Near-Lossless) Image Compression +#define UID_JPEGLSLossyTransferSyntax "1.2.840.10008.1.2.4.81" +/// JPEG 2000 Image Compression (Lossless Only) +#define UID_JPEG2000LosslessOnlyTransferSyntax "1.2.840.10008.1.2.4.90" +/// JPEG 2000 Image Compression (Lossless or Lossy) +#define UID_JPEG2000TransferSyntax "1.2.840.10008.1.2.4.91" +/// JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only) +#define UID_JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax "1.2.840.10008.1.2.4.92" +/// JPEG 2000 Part 2 Multi-component Image Compression (Lossless or Lossy) +#define UID_JPEG2000Part2MulticomponentImageCompressionTransferSyntax "1.2.840.10008.1.2.4.93" +/// JPIP Referenced +#define UID_JPIPReferencedTransferSyntax "1.2.840.10008.1.2.4.94" +/// JPIP Referenced Deflate +#define UID_JPIPReferencedDeflateTransferSyntax "1.2.840.10008.1.2.4.95" +/// MPEG2 Main Profile @ Main Level (changed with DICOM 2016e to: MPEG2 Main Profile / Main Level) +#define UID_MPEG2MainProfileAtMainLevelTransferSyntax "1.2.840.10008.1.2.4.100" +/// MPEG2 Main Profile @ High Level (changed with DICOM 2016e to: MPEG2 Main Profile / High Level) +#define UID_MPEG2MainProfileAtHighLevelTransferSyntax "1.2.840.10008.1.2.4.101" +/// MPEG-4 AVC/H.264 High Profile / Level 4.1 +#define UID_MPEG4HighProfileLevel4_1TransferSyntax "1.2.840.10008.1.2.4.102" +/// MPEG-4 AVC/H.264 BD-compatible High Profile / Level 4.1 +#define UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax "1.2.840.10008.1.2.4.103" +/// MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video +#define UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax "1.2.840.10008.1.2.4.104" +/// MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video +#define UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax "1.2.840.10008.1.2.4.105" +/// MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2 +#define UID_MPEG4StereoHighProfileLevel4_2TransferSyntax "1.2.840.10008.1.2.4.106" +/// HEVC/H.265 Main Profile / Level 5.1 +#define UID_HEVCMainProfileLevel5_1TransferSyntax "1.2.840.10008.1.2.4.107" +/// HEVC/H.265 Main 10 Profile / Level 5.1 +#define UID_HEVCMain10ProfileLevel5_1TransferSyntax "1.2.840.10008.1.2.4.108" +/// RLE Lossless +#define UID_RLELosslessTransferSyntax "1.2.840.10008.1.2.5" + +/** RFC 2557 MIME Encapsulation (RETIRED) was only a pseudo transfer syntax used + * to refer to MIME encapsulated HL7 CDA documents from a DICOMDIR when stored + * on a DICOM storage medium. It was never used for network communication + * or encoding of DICOM objects. + */ +#define UID_RFC2557MIMEEncapsulationTransferSyntax "1.2.840.10008.1.2.6.1" + +/** XML Encoding (RETIRED) was only a pseudo transfer syntax used to refer to + * encapsulated HL7 CDA documents from a DICOMDIR when stored on a DICOM storage + * medium. It was never used for network communication or encoding of DICOM objects. + */ +#define UID_XMLEncodingTransferSyntax "1.2.840.10008.1.2.6.2" + +/** Private transfer syntax defined by GE. This transfer syntax is identical to + * Implicit VR Little Endian, except that Pixel Data are encoded in big endian. + */ +#define UID_PrivateGE_LEI_WithBigEndianPixelDataTransferSyntax "1.2.840.113619.5.2" + +/* +** Defined SOP Class UIDs according to DICOM standard +*/ + +// Storage (DICOM) +#define UID_RETIRED_StoredPrintStorage "1.2.840.10008.5.1.1.27" +#define UID_RETIRED_HardcopyGrayscaleImageStorage "1.2.840.10008.5.1.1.29" +#define UID_RETIRED_HardcopyColorImageStorage "1.2.840.10008.5.1.1.30" +#define UID_ComputedRadiographyImageStorage "1.2.840.10008.5.1.4.1.1.1" +#define UID_DigitalXRayImageStorageForPresentation "1.2.840.10008.5.1.4.1.1.1.1" +#define UID_DigitalXRayImageStorageForProcessing "1.2.840.10008.5.1.4.1.1.1.1.1" +#define UID_DigitalMammographyXRayImageStorageForPresentation "1.2.840.10008.5.1.4.1.1.1.2" +#define UID_DigitalMammographyXRayImageStorageForProcessing "1.2.840.10008.5.1.4.1.1.1.2.1" +#define UID_DigitalIntraOralXRayImageStorageForPresentation "1.2.840.10008.5.1.4.1.1.1.3" +#define UID_DigitalIntraOralXRayImageStorageForProcessing "1.2.840.10008.5.1.4.1.1.1.3.1" +#define UID_CTImageStorage "1.2.840.10008.5.1.4.1.1.2" +#define UID_EnhancedCTImageStorage "1.2.840.10008.5.1.4.1.1.2.1" +#define UID_LegacyConvertedEnhancedCTImageStorage "1.2.840.10008.5.1.4.1.1.2.2" +#define UID_RETIRED_UltrasoundMultiframeImageStorage "1.2.840.10008.5.1.4.1.1.3" +#define UID_UltrasoundMultiframeImageStorage "1.2.840.10008.5.1.4.1.1.3.1" +#define UID_MRImageStorage "1.2.840.10008.5.1.4.1.1.4" +#define UID_EnhancedMRImageStorage "1.2.840.10008.5.1.4.1.1.4.1" +#define UID_MRSpectroscopyStorage "1.2.840.10008.5.1.4.1.1.4.2" +#define UID_EnhancedMRColorImageStorage "1.2.840.10008.5.1.4.1.1.4.3" +#define UID_LegacyConvertedEnhancedMRImageStorage "1.2.840.10008.5.1.4.1.1.4.4" +#define UID_RETIRED_NuclearMedicineImageStorage "1.2.840.10008.5.1.4.1.1.5" +#define UID_RETIRED_UltrasoundImageStorage "1.2.840.10008.5.1.4.1.1.6" +#define UID_UltrasoundImageStorage "1.2.840.10008.5.1.4.1.1.6.1" +#define UID_EnhancedUSVolumeStorage "1.2.840.10008.5.1.4.1.1.6.2" +#define UID_SecondaryCaptureImageStorage "1.2.840.10008.5.1.4.1.1.7" +#define UID_MultiframeSingleBitSecondaryCaptureImageStorage "1.2.840.10008.5.1.4.1.1.7.1" +#define UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage "1.2.840.10008.5.1.4.1.1.7.2" +#define UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage "1.2.840.10008.5.1.4.1.1.7.3" +#define UID_MultiframeTrueColorSecondaryCaptureImageStorage "1.2.840.10008.5.1.4.1.1.7.4" +#define UID_RETIRED_StandaloneOverlayStorage "1.2.840.10008.5.1.4.1.1.8" +#define UID_RETIRED_StandaloneCurveStorage "1.2.840.10008.5.1.4.1.1.9" +#define UID_TwelveLeadECGWaveformStorage "1.2.840.10008.5.1.4.1.1.9.1.1" +#define UID_GeneralECGWaveformStorage "1.2.840.10008.5.1.4.1.1.9.1.2" +#define UID_AmbulatoryECGWaveformStorage "1.2.840.10008.5.1.4.1.1.9.1.3" +#define UID_HemodynamicWaveformStorage "1.2.840.10008.5.1.4.1.1.9.2.1" +#define UID_CardiacElectrophysiologyWaveformStorage "1.2.840.10008.5.1.4.1.1.9.3.1" +#define UID_BasicVoiceAudioWaveformStorage "1.2.840.10008.5.1.4.1.1.9.4.1" +#define UID_GeneralAudioWaveformStorage "1.2.840.10008.5.1.4.1.1.9.4.2" +#define UID_ArterialPulseWaveformStorage "1.2.840.10008.5.1.4.1.1.9.5.1" +#define UID_RespiratoryWaveformStorage "1.2.840.10008.5.1.4.1.1.9.6.1" +#define UID_RETIRED_StandaloneModalityLUTStorage "1.2.840.10008.5.1.4.1.1.10" +#define UID_RETIRED_StandaloneVOILUTStorage "1.2.840.10008.5.1.4.1.1.11" +#define UID_GrayscaleSoftcopyPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.1" +#define UID_ColorSoftcopyPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.2" +#define UID_PseudoColorSoftcopyPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.3" +#define UID_BlendingSoftcopyPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.4" +#define UID_XAXRFGrayscaleSoftcopyPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.5" +#define UID_GrayscalePlanarMPRVolumetricPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.6" +#define UID_CompositingPlanarMPRVolumetricPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.7" +#define UID_AdvancedBlendingPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.8" +#define UID_VolumeRenderingVolumetricPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.9" +#define UID_SegmentedVolumeRenderingVolumetricPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.10" +#define UID_MultipleVolumeRenderingVolumetricPresentationStateStorage "1.2.840.10008.5.1.4.1.1.11.11" +#define UID_XRayAngiographicImageStorage "1.2.840.10008.5.1.4.1.1.12.1" +#define UID_EnhancedXAImageStorage "1.2.840.10008.5.1.4.1.1.12.1.1" +#define UID_XRayRadiofluoroscopicImageStorage "1.2.840.10008.5.1.4.1.1.12.2" +#define UID_EnhancedXRFImageStorage "1.2.840.10008.5.1.4.1.1.12.2.1" +#define UID_RETIRED_XRayAngiographicBiPlaneImageStorage "1.2.840.10008.5.1.4.1.1.12.3" +#define UID_XRay3DAngiographicImageStorage "1.2.840.10008.5.1.4.1.1.13.1.1" +#define UID_XRay3DCraniofacialImageStorage "1.2.840.10008.5.1.4.1.1.13.1.2" +#define UID_BreastTomosynthesisImageStorage "1.2.840.10008.5.1.4.1.1.13.1.3" +#define UID_BreastProjectionXRayImageStorageForPresentation "1.2.840.10008.5.1.4.1.1.13.1.4" +#define UID_BreastProjectionXRayImageStorageForProcessing "1.2.840.10008.5.1.4.1.1.13.1.5" +#define UID_IntravascularOpticalCoherenceTomographyImageStorageForPresentation "1.2.840.10008.5.1.4.1.1.14.1" +#define UID_IntravascularOpticalCoherenceTomographyImageStorageForProcessing "1.2.840.10008.5.1.4.1.1.14.2" +#define UID_NuclearMedicineImageStorage "1.2.840.10008.5.1.4.1.1.20" +#define UID_ParametricMapStorage "1.2.840.10008.5.1.4.1.1.30" +#define UID_RawDataStorage "1.2.840.10008.5.1.4.1.1.66" +#define UID_SpatialRegistrationStorage "1.2.840.10008.5.1.4.1.1.66.1" +#define UID_SpatialFiducialsStorage "1.2.840.10008.5.1.4.1.1.66.2" +#define UID_DeformableSpatialRegistrationStorage "1.2.840.10008.5.1.4.1.1.66.3" +#define UID_SegmentationStorage "1.2.840.10008.5.1.4.1.1.66.4" +#define UID_SurfaceSegmentationStorage "1.2.840.10008.5.1.4.1.1.66.5" +#define UID_TractographyResultsStorage "1.2.840.10008.5.1.4.1.1.66.6" +#define UID_RealWorldValueMappingStorage "1.2.840.10008.5.1.4.1.1.67" +#define UID_SurfaceScanMeshStorage "1.2.840.10008.5.1.4.1.1.68.1" +#define UID_SurfaceScanPointCloudStorage "1.2.840.10008.5.1.4.1.1.68.2" +#define UID_RETIRED_VLImageStorage "1.2.840.10008.5.1.4.1.1.77.1" +#define UID_VLEndoscopicImageStorage "1.2.840.10008.5.1.4.1.1.77.1.1" +#define UID_VideoEndoscopicImageStorage "1.2.840.10008.5.1.4.1.1.77.1.1.1" +#define UID_VLMicroscopicImageStorage "1.2.840.10008.5.1.4.1.1.77.1.2" +#define UID_VideoMicroscopicImageStorage "1.2.840.10008.5.1.4.1.1.77.1.2.1" +#define UID_VLSlideCoordinatesMicroscopicImageStorage "1.2.840.10008.5.1.4.1.1.77.1.3" +#define UID_VLPhotographicImageStorage "1.2.840.10008.5.1.4.1.1.77.1.4" +#define UID_VideoPhotographicImageStorage "1.2.840.10008.5.1.4.1.1.77.1.4.1" +#define UID_OphthalmicPhotography8BitImageStorage "1.2.840.10008.5.1.4.1.1.77.1.5.1" +#define UID_OphthalmicPhotography16BitImageStorage "1.2.840.10008.5.1.4.1.1.77.1.5.2" +#define UID_StereometricRelationshipStorage "1.2.840.10008.5.1.4.1.1.77.1.5.3" +#define UID_OphthalmicTomographyImageStorage "1.2.840.10008.5.1.4.1.1.77.1.5.4" +#define UID_WideFieldOphthalmicPhotographyStereographicProjectionImageStorage "1.2.840.10008.5.1.4.1.1.77.1.5.5" +#define UID_WideFieldOphthalmicPhotography3DCoordinatesImageStorage "1.2.840.10008.5.1.4.1.1.77.1.5.6" +#define UID_OphthalmicOpticalCoherenceTomographyEnFaceImageStorage "1.2.840.10008.5.1.4.1.1.77.1.5.7" +#define UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage "1.2.840.10008.5.1.4.1.1.77.1.5.8" +#define UID_VLWholeSlideMicroscopyImageStorage "1.2.840.10008.5.1.4.1.1.77.1.6" +#define UID_RETIRED_VLMultiframeImageStorage "1.2.840.10008.5.1.4.1.1.77.2" +#define UID_LensometryMeasurementsStorage "1.2.840.10008.5.1.4.1.1.78.1" +#define UID_AutorefractionMeasurementsStorage "1.2.840.10008.5.1.4.1.1.78.2" +#define UID_KeratometryMeasurementsStorage "1.2.840.10008.5.1.4.1.1.78.3" +#define UID_SubjectiveRefractionMeasurementsStorage "1.2.840.10008.5.1.4.1.1.78.4" +#define UID_VisualAcuityMeasurementsStorage "1.2.840.10008.5.1.4.1.1.78.5" +#define UID_SpectaclePrescriptionReportStorage "1.2.840.10008.5.1.4.1.1.78.6" +#define UID_OphthalmicAxialMeasurementsStorage "1.2.840.10008.5.1.4.1.1.78.7" +#define UID_IntraocularLensCalculationsStorage "1.2.840.10008.5.1.4.1.1.78.8" +#define UID_MacularGridThicknessAndVolumeReportStorage "1.2.840.10008.5.1.4.1.1.79.1" +#define UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage "1.2.840.10008.5.1.4.1.1.80.1" +#define UID_OphthalmicThicknessMapStorage "1.2.840.10008.5.1.4.1.1.81.1" +#define UID_CornealTopographyMapStorage "1.2.840.10008.5.1.4.1.1.82.1" +#define UID_BasicTextSRStorage "1.2.840.10008.5.1.4.1.1.88.11" +#define UID_EnhancedSRStorage "1.2.840.10008.5.1.4.1.1.88.22" +#define UID_ComprehensiveSRStorage "1.2.840.10008.5.1.4.1.1.88.33" +#define UID_Comprehensive3DSRStorage "1.2.840.10008.5.1.4.1.1.88.34" +#define UID_ExtensibleSRStorage "1.2.840.10008.5.1.4.1.1.88.35" +#define UID_ProcedureLogStorage "1.2.840.10008.5.1.4.1.1.88.40" +#define UID_MammographyCADSRStorage "1.2.840.10008.5.1.4.1.1.88.50" +#define UID_KeyObjectSelectionDocumentStorage "1.2.840.10008.5.1.4.1.1.88.59" +#define UID_ChestCADSRStorage "1.2.840.10008.5.1.4.1.1.88.65" +#define UID_XRayRadiationDoseSRStorage "1.2.840.10008.5.1.4.1.1.88.67" +#define UID_RadiopharmaceuticalRadiationDoseSRStorage "1.2.840.10008.5.1.4.1.1.88.68" +#define UID_ColonCADSRStorage "1.2.840.10008.5.1.4.1.1.88.69" +#define UID_ImplantationPlanSRDocumentStorage "1.2.840.10008.5.1.4.1.1.88.70" +#define UID_AcquisitionContextSRStorage "1.2.840.10008.5.1.4.1.1.88.71" +#define UID_SimplifiedAdultEchoSRStorage "1.2.840.10008.5.1.4.1.1.88.72" +#define UID_PatientRadiationDoseSRStorage "1.2.840.10008.5.1.4.1.1.88.73" +#define UID_PlannedImagingAgentAdministrationSRStorage "1.2.840.10008.5.1.4.1.1.88.74" +#define UID_PerformedImagingAgentAdministrationSRStorage "1.2.840.10008.5.1.4.1.1.88.75" +#define UID_ContentAssessmentResultsStorage "1.2.840.10008.5.1.4.1.1.90.1" +#define UID_EncapsulatedPDFStorage "1.2.840.10008.5.1.4.1.1.104.1" +#define UID_EncapsulatedCDAStorage "1.2.840.10008.5.1.4.1.1.104.2" +#define UID_EncapsulatedSTLStorage "1.2.840.10008.5.1.4.1.1.104.3" +#define UID_PositronEmissionTomographyImageStorage "1.2.840.10008.5.1.4.1.1.128" +#define UID_LegacyConvertedEnhancedPETImageStorage "1.2.840.10008.5.1.4.1.1.128.1" +#define UID_RETIRED_StandalonePETCurveStorage "1.2.840.10008.5.1.4.1.1.129" +#define UID_EnhancedPETImageStorage "1.2.840.10008.5.1.4.1.1.130" +#define UID_BasicStructuredDisplayStorage "1.2.840.10008.5.1.4.1.1.131" +#define UID_CTDefinedProcedureProtocolStorage "1.2.840.10008.5.1.4.1.1.200.1" +#define UID_CTPerformedProcedureProtocolStorage "1.2.840.10008.5.1.4.1.1.200.2" +#define UID_ProtocolApprovalStorage "1.2.840.10008.5.1.4.1.1.200.3" +#define UID_RTImageStorage "1.2.840.10008.5.1.4.1.1.481.1" +#define UID_RTDoseStorage "1.2.840.10008.5.1.4.1.1.481.2" +#define UID_RTStructureSetStorage "1.2.840.10008.5.1.4.1.1.481.3" +#define UID_RTBeamsTreatmentRecordStorage "1.2.840.10008.5.1.4.1.1.481.4" +#define UID_RTPlanStorage "1.2.840.10008.5.1.4.1.1.481.5" +#define UID_RTBrachyTreatmentRecordStorage "1.2.840.10008.5.1.4.1.1.481.6" +#define UID_RTTreatmentSummaryRecordStorage "1.2.840.10008.5.1.4.1.1.481.7" +#define UID_RTIonPlanStorage "1.2.840.10008.5.1.4.1.1.481.8" +#define UID_RTIonBeamsTreatmentRecordStorage "1.2.840.10008.5.1.4.1.1.481.9" +#define UID_RTPhysicianIntentStorage "1.2.840.10008.5.1.4.1.1.481.10" +#define UID_RTSegmentAnnotationStorage "1.2.840.10008.5.1.4.1.1.481.11" +#define UID_RTRadiationSetStorage "1.2.840.10008.5.1.4.1.1.481.12" +#define UID_CArmPhotonElectronRadiationStorage "1.2.840.10008.5.1.4.1.1.481.13" +#define UID_RTBeamsDeliveryInstructionStorage "1.2.840.10008.5.1.4.34.7" +#define UID_RTBrachyApplicationSetupDeliveryInstructionStorage "1.2.840.10008.5.1.4.34.10" +#define UID_HangingProtocolStorage "1.2.840.10008.5.1.4.38.1" +#define UID_GenericImplantTemplateStorage "1.2.840.10008.5.1.4.43.1" +#define UID_ImplantAssemblyTemplateStorage "1.2.840.10008.5.1.4.44.1" +#define UID_ImplantTemplateGroupStorage "1.2.840.10008.5.1.4.45.1" + +// DICOMDIR (was UID_BasicDirectoryStorageSOPClass in DCMTK versions prior to 3.5.3) +#define UID_MediaStorageDirectoryStorage "1.2.840.10008.1.3.10" + +// DICOS Storage +#define UID_DICOS_CTImageStorage "1.2.840.10008.5.1.4.1.1.501.1" +#define UID_DICOS_DigitalXRayImageStorageForPresentation "1.2.840.10008.5.1.4.1.1.501.2.1" +#define UID_DICOS_DigitalXRayImageStorageForProcessing "1.2.840.10008.5.1.4.1.1.501.2.2" +#define UID_DICOS_ThreatDetectionReportStorage "1.2.840.10008.5.1.4.1.1.501.3" +#define UID_DICOS_2DAITStorage "1.2.840.10008.5.1.4.1.1.501.4" +#define UID_DICOS_3DAITStorage "1.2.840.10008.5.1.4.1.1.501.5" +#define UID_DICOS_QuadrupoleResonanceStorage "1.2.840.10008.5.1.4.1.1.501.6" + +// DICONDE Storage +#define UID_DICONDE_EddyCurrentImageStorage "1.2.840.10008.5.1.4.1.1.601.1" +#define UID_DICONDE_EddyCurrentMultiframeImageStorage "1.2.840.10008.5.1.4.1.1.601.2" + +// Query/Retrieve +#define UID_FINDPatientRootQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.1.1" +#define UID_MOVEPatientRootQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.1.2" +#define UID_GETPatientRootQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.1.3" +#define UID_FINDStudyRootQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.2.1" +#define UID_MOVEStudyRootQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.2.2" +#define UID_GETStudyRootQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.2.3" +#define UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.3.1" +#define UID_RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.3.2" +#define UID_RETIRED_GETPatientStudyOnlyQueryRetrieveInformationModel "1.2.840.10008.5.1.4.1.2.3.3" +#define UID_MOVECompositeInstanceRootRetrieve "1.2.840.10008.5.1.4.1.2.4.2" +#define UID_GETCompositeInstanceRootRetrieve "1.2.840.10008.5.1.4.1.2.4.3" +#define UID_GETCompositeInstanceRetrieveWithoutBulkData "1.2.840.10008.5.1.4.1.2.5.3" + +// Modality Worklist +#define UID_FINDModalityWorklistInformationModel "1.2.840.10008.5.1.4.31" + +// General Purpose Worklist +#define UID_RETIRED_FINDGeneralPurposeWorklistInformationModel "1.2.840.10008.5.1.4.32.1" +#define UID_RETIRED_GeneralPurposeScheduledProcedureStepSOPClass "1.2.840.10008.5.1.4.32.2" +#define UID_RETIRED_GeneralPurposePerformedProcedureStepSOPClass "1.2.840.10008.5.1.4.32.3" +#define UID_RETIRED_GeneralPurposeWorklistManagementMetaSOPClass "1.2.840.10008.5.1.4.32" + +// MPPS +#define UID_ModalityPerformedProcedureStepSOPClass "1.2.840.10008.3.1.2.3.3" +#define UID_ModalityPerformedProcedureStepRetrieveSOPClass "1.2.840.10008.3.1.2.3.4" +#define UID_ModalityPerformedProcedureStepNotificationSOPClass "1.2.840.10008.3.1.2.3.5" + +// Radiotherapy +#define UID_RTConventionalMachineVerification "1.2.840.10008.5.1.4.34.8" +#define UID_RTIonMachineVerification "1.2.840.10008.5.1.4.34.9" + +// Unified Worklist and Procedure Step +#define UID_UnifiedWorklistAndProcedureStepServiceClass "1.2.840.10008.5.1.4.34.6" +#define UID_UnifiedProcedureStepPushSOPClass "1.2.840.10008.5.1.4.34.6.1" +#define UID_UnifiedProcedureStepWatchSOPClass "1.2.840.10008.5.1.4.34.6.2" +#define UID_UnifiedProcedureStepPullSOPClass "1.2.840.10008.5.1.4.34.6.3" +#define UID_UnifiedProcedureStepEventSOPClass "1.2.840.10008.5.1.4.34.6.4" +#define UID_UPSGlobalSubscriptionSOPInstance "1.2.840.10008.5.1.4.34.5" +#define UID_UPSFilteredGlobalSubscriptionSOPInstance "1.2.840.10008.5.1.4.34.5.1" + +// Storage Commitment +#define UID_StorageCommitmentPushModelSOPClass "1.2.840.10008.1.20.1" +#define UID_StorageCommitmentPushModelSOPInstance "1.2.840.10008.1.20.1.1" +#define UID_RETIRED_StorageCommitmentPullModelSOPClass "1.2.840.10008.1.20.2" +#define UID_RETIRED_StorageCommitmentPullModelSOPInstance "1.2.840.10008.1.20.2.1" + +// Hanging Protocols +#define UID_FINDHangingProtocolInformationModel "1.2.840.10008.5.1.4.38.2" +#define UID_MOVEHangingProtocolInformationModel "1.2.840.10008.5.1.4.38.3" + +// Relevant Patient Information Query +#define UID_GeneralRelevantPatientInformationQuery "1.2.840.10008.5.1.4.37.1" +#define UID_BreastImagingRelevantPatientInformationQuery "1.2.840.10008.5.1.4.37.2" +#define UID_CardiacRelevantPatientInformationQuery "1.2.840.10008.5.1.4.37.3" + +// Color Palette Storage and Query/Retrieve +#define UID_ColorPaletteStorage "1.2.840.10008.5.1.4.39.1" +#define UID_FINDColorPaletteInformationModel "1.2.840.10008.5.1.4.39.2" +#define UID_MOVEColorPaletteInformationModel "1.2.840.10008.5.1.4.39.3" +#define UID_GETColorPaletteInformationModel "1.2.840.10008.5.1.4.39.4" + +// Implant Template Query/Retrieve +#define UID_FINDGenericImplantTemplateInformationModel "1.2.840.10008.5.1.4.43.2" +#define UID_MOVEGenericImplantTemplateInformationModel "1.2.840.10008.5.1.4.43.3" +#define UID_GETGenericImplantTemplateInformationModel "1.2.840.10008.5.1.4.43.4" +#define UID_FINDImplantAssemblyTemplateInformationModel "1.2.840.10008.5.1.4.44.2" +#define UID_MOVEImplantAssemblyTemplateInformationModel "1.2.840.10008.5.1.4.44.3" +#define UID_GETImplantAssemblyTemplateInformationModel "1.2.840.10008.5.1.4.44.4" +#define UID_FINDImplantTemplateGroupInformationModel "1.2.840.10008.5.1.4.45.2" +#define UID_MOVEImplantTemplateGroupInformationModel "1.2.840.10008.5.1.4.45.3" +#define UID_GETImplantTemplateGroupInformationModel "1.2.840.10008.5.1.4.45.4" + +// Defined Procedure Protocol Query/Retrieve +#define UID_FINDDefinedProcedureProtocolInformationModel "1.2.840.10008.5.1.4.20.1" +#define UID_MOVEDefinedProcedureProtocolInformationModel "1.2.840.10008.5.1.4.20.2" +#define UID_GETDefinedProcedureProtocolInformationModel "1.2.840.10008.5.1.4.20.3" + +// Protocol Approval Query/Retrieve +#define UID_FINDProtocolApprovalInformationModel "1.2.840.10008.5.1.4.1.1.200.4" +#define UID_MOVEProtocolApprovalInformationModel "1.2.840.10008.5.1.4.1.1.200.5" +#define UID_GETProtocolApprovalInformationModel "1.2.840.10008.5.1.4.1.1.200.6" + +// Print Management +#define UID_BasicFilmSessionSOPClass "1.2.840.10008.5.1.1.1" +#define UID_BasicFilmBoxSOPClass "1.2.840.10008.5.1.1.2" +#define UID_BasicGrayscaleImageBoxSOPClass "1.2.840.10008.5.1.1.4" +#define UID_BasicColorImageBoxSOPClass "1.2.840.10008.5.1.1.4.1" +#define UID_RETIRED_ReferencedImageBoxSOPClass "1.2.840.10008.5.1.1.4.2" +#define UID_BasicGrayscalePrintManagementMetaSOPClass "1.2.840.10008.5.1.1.9" +#define UID_RETIRED_ReferencedGrayscalePrintManagementMetaSOPClass "1.2.840.10008.5.1.1.9.1" +#define UID_PrintJobSOPClass "1.2.840.10008.5.1.1.14" +#define UID_BasicAnnotationBoxSOPClass "1.2.840.10008.5.1.1.15" +#define UID_PrinterSOPClass "1.2.840.10008.5.1.1.16" +#define UID_PrinterConfigurationRetrievalSOPClass "1.2.840.10008.5.1.1.16.376" +#define UID_PrinterSOPInstance "1.2.840.10008.5.1.1.17" +#define UID_PrinterConfigurationRetrievalSOPInstance "1.2.840.10008.5.1.1.17.376" +#define UID_BasicColorPrintManagementMetaSOPClass "1.2.840.10008.5.1.1.18" +#define UID_RETIRED_ReferencedColorPrintManagementMetaSOPClass "1.2.840.10008.5.1.1.18.1" +#define UID_VOILUTBoxSOPClass "1.2.840.10008.5.1.1.22" +#define UID_PresentationLUTSOPClass "1.2.840.10008.5.1.1.23" +#define UID_RETIRED_ImageOverlayBoxSOPClass "1.2.840.10008.5.1.1.24" +#define UID_RETIRED_BasicPrintImageOverlayBoxSOPClass "1.2.840.10008.5.1.1.24.1" +#define UID_RETIRED_PrintQueueSOPInstance "1.2.840.10008.5.1.1.25" +#define UID_RETIRED_PrintQueueManagementSOPClass "1.2.840.10008.5.1.1.26" +#define UID_RETIRED_PullPrintRequestSOPClass "1.2.840.10008.5.1.1.31" +#define UID_RETIRED_PullStoredPrintManagementMetaSOPClass "1.2.840.10008.5.1.1.32" + +// Detached Management +#define UID_RETIRED_DetachedPatientManagementSOPClass "1.2.840.10008.3.1.2.1.1" +#define UID_RETIRED_DetachedPatientManagementMetaSOPClass "1.2.840.10008.3.1.2.1.4" +#define UID_RETIRED_DetachedVisitManagementSOPClass "1.2.840.10008.3.1.2.2.1" +#define UID_RETIRED_DetachedStudyManagementSOPClass "1.2.840.10008.3.1.2.3.1" +#define UID_RETIRED_DetachedResultsManagementSOPClass "1.2.840.10008.3.1.2.5.1" +#define UID_RETIRED_DetachedResultsManagementMetaSOPClass "1.2.840.10008.3.1.2.5.4" +#define UID_RETIRED_DetachedStudyManagementMetaSOPClass "1.2.840.10008.3.1.2.5.5" +#define UID_RETIRED_DetachedInterpretationManagementSOPClass "1.2.840.10008.3.1.2.6.1" + +// Procedure Log +#define UID_ProceduralEventLoggingSOPClass "1.2.840.10008.1.40" +#define UID_ProceduralEventLoggingSOPInstance "1.2.840.10008.1.40.1" + +// Substance Administration +#define UID_SubstanceAdministrationLoggingSOPClass "1.2.840.10008.1.42" +#define UID_SubstanceAdministrationLoggingSOPInstance "1.2.840.10008.1.42.1" +#define UID_ProductCharacteristicsQuerySOPClass "1.2.840.10008.5.1.4.41" +#define UID_SubstanceApprovalQuerySOPClass "1.2.840.10008.5.1.4.42" + +// Media Creation +#define UID_MediaCreationManagementSOPClass "1.2.840.10008.5.1.1.33" + +// SOP Class Relationship Negotiation +#define UID_StorageServiceClass "1.2.840.10008.4.2" + +// Instance Availability Notification +#define UID_InstanceAvailabilityNotificationSOPClass "1.2.840.10008.5.1.4.33" + +// Application Hosting +#define UID_NativeDICOMModel "1.2.840.10008.7.1.1" +#define UID_AbstractMultiDimensionalImageModel "1.2.840.10008.7.1.2" + +// Communication of Display Parameters +#define UID_DisplaySystemSOPClass "1.2.840.10008.5.1.1.40" +#define UID_DisplaySystemSOPInstance "1.2.840.10008.5.1.1.40.1" + +// Other +#define UID_VerificationSOPClass "1.2.840.10008.1.1" +#define UID_RETIRED_BasicStudyContentNotificationSOPClass "1.2.840.10008.1.9" +#define UID_RETIRED_StudyComponentManagementSOPClass "1.2.840.10008.3.1.2.3.2" + +/* +** All other UIDs according to DICOM standard +*/ + +// Mapping Resources +#define UID_DICOMContentMappingResource "1.2.840.10008.8.1.1" + +// Coding Schemes +#define UID_DICOMControlledTerminologyCodingScheme "1.2.840.10008.2.16.4" +#define UID_DICOMUIDRegistryCodingScheme "1.2.840.10008.2.6.1" + +// Configuration Management LDAP UIDs +#define UID_LDAP_dicomDeviceName "1.2.840.10008.15.0.3.1" +#define UID_LDAP_dicomDescription "1.2.840.10008.15.0.3.2" +#define UID_LDAP_dicomManufacturer "1.2.840.10008.15.0.3.3" +#define UID_LDAP_dicomManufacturerModelName "1.2.840.10008.15.0.3.4" +#define UID_LDAP_dicomSoftwareVersion "1.2.840.10008.15.0.3.5" +#define UID_LDAP_dicomVendorData "1.2.840.10008.15.0.3.6" +#define UID_LDAP_dicomAETitle "1.2.840.10008.15.0.3.7" +#define UID_LDAP_dicomNetworkConnectionReference "1.2.840.10008.15.0.3.8" +#define UID_LDAP_dicomApplicationCluster "1.2.840.10008.15.0.3.9" +#define UID_LDAP_dicomAssociationInitiator "1.2.840.10008.15.0.3.10" +#define UID_LDAP_dicomAssociationAcceptor "1.2.840.10008.15.0.3.11" +#define UID_LDAP_dicomHostname "1.2.840.10008.15.0.3.12" +#define UID_LDAP_dicomPort "1.2.840.10008.15.0.3.13" +#define UID_LDAP_dicomSOPClass "1.2.840.10008.15.0.3.14" +#define UID_LDAP_dicomTransferRole "1.2.840.10008.15.0.3.15" +#define UID_LDAP_dicomTransferSyntax "1.2.840.10008.15.0.3.16" +#define UID_LDAP_dicomPrimaryDeviceType "1.2.840.10008.15.0.3.17" +#define UID_LDAP_dicomRelatedDeviceReference "1.2.840.10008.15.0.3.18" +#define UID_LDAP_dicomPreferredCalledAETitle "1.2.840.10008.15.0.3.19" +#define UID_LDAP_dicomTLSCyphersuite "1.2.840.10008.15.0.3.20" +#define UID_LDAP_dicomAuthorizedNodeCertificateReference "1.2.840.10008.15.0.3.21" +#define UID_LDAP_dicomThisNodeCertificateReference "1.2.840.10008.15.0.3.22" +#define UID_LDAP_dicomInstalled "1.2.840.10008.15.0.3.23" +#define UID_LDAP_dicomStationName "1.2.840.10008.15.0.3.24" +#define UID_LDAP_dicomDeviceSerialNumber "1.2.840.10008.15.0.3.25" +#define UID_LDAP_dicomInstitutionName "1.2.840.10008.15.0.3.26" +#define UID_LDAP_dicomInstitutionAddress "1.2.840.10008.15.0.3.27" +#define UID_LDAP_dicomInstitutionDepartmentName "1.2.840.10008.15.0.3.28" +#define UID_LDAP_dicomIssuerOfPatientID "1.2.840.10008.15.0.3.29" +#define UID_LDAP_dicomPreferredCallingAETitle "1.2.840.10008.15.0.3.30" +#define UID_LDAP_dicomSupportedCharacterSet "1.2.840.10008.15.0.3.31" +#define UID_LDAP_dicomConfigurationRoot "1.2.840.10008.15.0.4.1" +#define UID_LDAP_dicomDevicesRoot "1.2.840.10008.15.0.4.2" +#define UID_LDAP_dicomUniqueAETitlesRegistryRoot "1.2.840.10008.15.0.4.3" +#define UID_LDAP_dicomDevice "1.2.840.10008.15.0.4.4" +#define UID_LDAP_dicomNetworkAE "1.2.840.10008.15.0.4.5" +#define UID_LDAP_dicomNetworkConnection "1.2.840.10008.15.0.4.6" +#define UID_LDAP_dicomUniqueAETitle "1.2.840.10008.15.0.4.7" +#define UID_LDAP_dicomTransferCapability "1.2.840.10008.15.0.4.8" + +// UTC Synchronization Frame of Reference +#define UID_UniversalCoordinatedTimeSynchronizationFrameOfReference "1.2.840.10008.15.1.1" + +// Well-known Frame of References +#define UID_TalairachBrainAtlasFrameOfReference "1.2.840.10008.1.4.1.1" +#define UID_SPM2T1FrameOfReference "1.2.840.10008.1.4.1.2" +#define UID_SPM2T2FrameOfReference "1.2.840.10008.1.4.1.3" +#define UID_SPM2PDFrameOfReference "1.2.840.10008.1.4.1.4" +#define UID_SPM2EPIFrameOfReference "1.2.840.10008.1.4.1.5" +#define UID_SPM2FILT1FrameOfReference "1.2.840.10008.1.4.1.6" +#define UID_SPM2PETFrameOfReference "1.2.840.10008.1.4.1.7" +#define UID_SPM2TRANSMFrameOfReference "1.2.840.10008.1.4.1.8" +#define UID_SPM2SPECTFrameOfReference "1.2.840.10008.1.4.1.9" +#define UID_SPM2GRAYFrameOfReference "1.2.840.10008.1.4.1.10" +#define UID_SPM2WHITEFrameOfReference "1.2.840.10008.1.4.1.11" +#define UID_SPM2CSFFrameOfReference "1.2.840.10008.1.4.1.12" +#define UID_SPM2BRAINMASKFrameOfReference "1.2.840.10008.1.4.1.13" +#define UID_SPM2AVG305T1FrameOfReference "1.2.840.10008.1.4.1.14" +#define UID_SPM2AVG152T1FrameOfReference "1.2.840.10008.1.4.1.15" +#define UID_SPM2AVG152T2FrameOfReference "1.2.840.10008.1.4.1.16" +#define UID_SPM2AVG152PDFrameOfReference "1.2.840.10008.1.4.1.17" +#define UID_SPM2SINGLESUBJT1FrameOfReference "1.2.840.10008.1.4.1.18" +#define UID_ICBM452T1FrameOfReference "1.2.840.10008.1.4.2.1" +#define UID_ICBMSingleSubjectMRIFrameOfReference "1.2.840.10008.1.4.2.2" +#define UID_IEC61217FixedCoordinateSystemFrameOfReference "1.2.840.10008.1.4.3.1" + +// Well-known SOP Instances for Color Palettes +#define UID_HotIronColorPaletteSOPInstance "1.2.840.10008.1.5.1" +#define UID_PETColorPaletteSOPInstance "1.2.840.10008.1.5.2" +#define UID_HotMetalBlueColorPaletteSOPInstance "1.2.840.10008.1.5.3" +#define UID_PET20StepColorPaletteSOPInstance "1.2.840.10008.1.5.4" +#define UID_SpringColorPaletteSOPInstance "1.2.840.10008.1.5.5" +#define UID_SummerColorPaletteSOPInstance "1.2.840.10008.1.5.6" +#define UID_FallColorPaletteSOPInstance "1.2.840.10008.1.5.7" +#define UID_WinterColorPaletteSOPInstance "1.2.840.10008.1.5.8" + +/* +** Private DCMTK UIDs +*/ + +// Private SOP Class UID used to shutdown external network applications +#define UID_PrivateShutdownSOPClass "1.2.276.0.7230010.3.4.1915765545.18030.917282194.0" + + +/* DRAFT SUPPLEMENTS - EXPERIMENTAL USE ONLY */ + +/* + * The following UIDs were defined in "frozen draft for trial implementation" versions + * of various DICOM supplements and are or will be changed before final text. + * Since it is likely that trial implementations exist, we leave the UIDs in the dictionary. + */ + +/* Supplement 23 Frozen Draft (November 1997) */ +#define UID_DRAFT_SRTextStorage "1.2.840.10008.5.1.4.1.1.88.1" +#define UID_DRAFT_SRAudioStorage "1.2.840.10008.5.1.4.1.1.88.2" +#define UID_DRAFT_SRDetailStorage "1.2.840.10008.5.1.4.1.1.88.3" +#define UID_DRAFT_SRComprehensiveStorage "1.2.840.10008.5.1.4.1.1.88.4" + +/* Supplement 30 Draft 08 for Demonstration (October 1997) */ +#define UID_DRAFT_WaveformStorage "1.2.840.10008.5.1.4.1.1.9.1" + +/* Supplement 74 Frozen Draft (October 2007) */ +#define UID_DRAFT_RTBeamsDeliveryInstructionStorage "1.2.840.10008.5.1.4.34.1" +#define UID_DRAFT_RTConventionalMachineVerification "1.2.840.10008.5.1.4.34.2" +#define UID_DRAFT_RTIonMachineVerification "1.2.840.10008.5.1.4.34.3" + +// Supplement 96 Frozen Draft (October 2007), also part of DICOM 2008 and 2009 +#define UID_DRAFT_UnifiedWorklistAndProcedureStepServiceClass "1.2.840.10008.5.1.4.34.4" +#define UID_DRAFT_UnifiedProcedureStepPushSOPClass "1.2.840.10008.5.1.4.34.4.1" +#define UID_DRAFT_UnifiedProcedureStepWatchSOPClass "1.2.840.10008.5.1.4.34.4.2" +#define UID_DRAFT_UnifiedProcedureStepPullSOPClass "1.2.840.10008.5.1.4.34.4.3" +#define UID_DRAFT_UnifiedProcedureStepEventSOPClass "1.2.840.10008.5.1.4.34.4.4" + +#endif /* DCUID_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dcvr.h b/dcmdata/include/dcmtk/dcmdata/dcvr.h new file mode 100644 index 00000000..a643392b --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvr.h @@ -0,0 +1,470 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth, Andrew Hewett + * + * Purpose: Definition of the DcmVR class for Value Representation + * + */ + +#ifndef DCMVR_H +#define DCMVR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofglobal.h" +#include "dcmtk/dcmdata/dcdefine.h" + +// include this file in doxygen documentation + +/** @file dcvr.h + * @brief definition and handling of value representations (VR) + */ + +/** Global flag to enable/disable the generation of VR=UN, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=OB is used instead. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableUnknownVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=UT, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableUnlimitedTextVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=OF, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableOtherFloatVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=OD, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableOtherDoubleVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=OL, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableOtherLongVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=UR, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UT (if enabled), VR=UN (if enabled) or alternatively + * VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableUniversalResourceIdentifierOrLocatorVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=UC, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableUnlimitedCharactersVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=OV, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableOther64bitVeryLongVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=SV, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableSigned64bitVeryLongVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the generation of VR=UV, which has been + * introduced after the first edition of the DICOM standard (1993). + * If disabled, the VR=UN (if enabled) or alternatively VR=OB is used. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableUnsigned64bitVeryLongVRGeneration; /* default OFTrue */ + +/** Global flag to enable/disable the automatic re-conversion of defined + * length UN elements read in an explicit VR transfer syntax, if the real + * VR is defined in the data dictionary. + */ +extern DCMTK_DCMDATA_EXPORT OFGlobal dcmEnableUnknownVRConversion; /* default OFFalse */ + + +/** Global function that enables the generation of "new" value representations, + * i.e. the ones that have been introduced after the first edition of the DICOM + * standard (1993). See above dcmEnableXXXVRGeneration() flags for details. + */ +DCMTK_DCMDATA_EXPORT void dcmEnableGenerationOfNewVRs(); + +/** Global function that disables the generation of "new" value representations, + * i.e. the ones that have been introduced after the first edition of the DICOM + * standard (1993). See above dcmEnableXXXVRGeneration() flags for details. + */ +DCMTK_DCMDATA_EXPORT void dcmDisableGenerationOfNewVRs(); + + +/** VR Enumerations. + * NB: The order of entries has to conform to the order in DcmVRDict (see dcmvr.cc)! + * If not an error message is reported and the program aborts (only in DEBUG mode). + */ +enum DcmEVR +{ + /// application entity title + EVR_AE, + + /// age string + EVR_AS, + + /// attribute tag + EVR_AT, + + /// code string + EVR_CS, + + /// date string + EVR_DA, + + /// decimal string + EVR_DS, + + /// date time string + EVR_DT, + + /// float single-precision + EVR_FL, + + /// float double-precision + EVR_FD, + + /// integer string + EVR_IS, + + /// long string + EVR_LO, + + /// long text + EVR_LT, + + /// other byte + EVR_OB, + + /// other double + EVR_OD, + + /// other float + EVR_OF, + + /// other long + EVR_OL, + + /// other 64-bit very long + EVR_OV, + + /// other word + EVR_OW, + + /// person name + EVR_PN, + + /// short string + EVR_SH, + + /// signed long + EVR_SL, + + /// sequence of items + EVR_SQ, + + /// signed short + EVR_SS, + + /// short text + EVR_ST, + + /// signed 64-bit very long + EVR_SV, + + /// time string + EVR_TM, + + /// unlimited characters + EVR_UC, + + /// unique identifier + EVR_UI, + + /// unsigned long + EVR_UL, + + /// universal resource identifier or universal resource locator (URI/URL) + EVR_UR, + + /// unsigned short + EVR_US, + + /// unlimited text + EVR_UT, + + /// unsigned 64-bit very long + EVR_UV, + + /// OB or OW depending on context + EVR_ox, + + /// SS or US depending on context + EVR_xs, + + /// US, SS or OW depending on context, used for LUT Data (thus the name) + EVR_lt, + + /// na="not applicable", for data which has no VR + EVR_na, + + /// up="unsigned pointer", used internally for DICOMDIR support + EVR_up, + + /// used internally for items + EVR_item, + + /// used internally for meta info datasets + EVR_metainfo, + + /// used internally for datasets + EVR_dataset, + + /// used internally for DICOM files + EVR_fileFormat, + + /// used internally for DICOMDIR objects + EVR_dicomDir, + + /// used internally for DICOMDIR records + EVR_dirRecord, + + /// used internally for pixel sequences in a compressed image + EVR_pixelSQ, + + /// used internally for pixel items in a compressed image + EVR_pixelItem, + + /// used internally for elements with unknown VR (encoded with 4-byte length field in explicit VR) + EVR_UNKNOWN, + + /// unknown value representation + EVR_UN, + + /// used internally for uncompressed pixel data + EVR_PixelData, + + /// used internally for overlay data + EVR_OverlayData, + + /// used internally for elements with unknown VR with 2-byte length field in explicit VR + EVR_UNKNOWN2B +}; + + +/** a class representing a DICOM Value Representation + */ +class DCMTK_DCMDATA_EXPORT DcmVR +{ +public: + + /// default constructor + DcmVR() + : vr(EVR_UNKNOWN) + { + } + + /** constructor + * @param evr enumerated VR value + */ + DcmVR(DcmEVR evr) + : vr(EVR_UNKNOWN) + { + // the set method is safeguarded against incorrect passing of integer values + setVR(evr); + } + + /** constructor. + * Please note that only the first two characters of the passed string are + * actually checked. Value Representations that are labeled for internal + * use only are mapped to EVR_UNKNOWN. + * @param vrName symbolic name of value representation + */ + DcmVR(const char* vrName) + : vr(EVR_UNKNOWN) + { + setVR(vrName); + } + + /** copy constructor + * @param avr VR value + */ + DcmVR(const DcmVR& avr) + : vr(avr.vr) + { + } + + /** assign new VR value + * @param evr enumerated VR value + */ + void setVR(DcmEVR evr); + + /** assign new VR value by name. + * Please note that only the first two characters of the passed string are + * actually checked. Value Representations that are labeled for internal + * use only are mapped to EVR_UNKNOWN. + * @param vrName symbolic name of value representation + */ + void setVR(const char* vrName); + + /** assign new VR value + * @param avr VR value + */ + void setVR(const DcmVR& avr) { vr = avr.vr; } + + /** copy assignment operator + * @param arg vr to assign from + * @return reference to this object + */ + DcmVR& operator=(const DcmVR& arg) + { + vr = arg.vr; + return *this; + } + + /** get enumerated VR managed by this object + * @return enumerated VR + */ + DcmEVR getEVR() const { return vr; } + + /** get enumerated standard VR managed by this object. + * If this object manages a non-standard, internal VR such as EVR_ox, + * this method returns the enumerated VR to which the internal VR will + * be mapped when writing the DICOM object. + * + * Please note that some VR, e.g. EVR_pixelItem, won't be written as + * EVR_UNKNOWN, although this method will return that value for them. + * This means that e.g. usesExtendedLengthEncoding() for the returned VR + * might not be correct. + * + * Also note that DcmItem::checkAndUpdateVR() will in some cases influence + * the VR which is written out. + * @return enumerated VR + */ + DcmEVR getValidEVR() const; + + /** get symbolic VR name for this object + * @return VR name string, never NULL + */ + const char* getVRName() const ; + + /** get symbolic standard VR name for this object. + * If this object manages a non-standard, internal VR such as EVR_ox, + * this method returns the name of the VR to which the internal VR will + * be mapped when writing the DICOM object. + * @return VR name string, never NULL + */ + const char* getValidVRName() const; + + /** compute the size for non-empty values of this VR. + * For fixed size VRs such as OW, US, SL, the method returns the size of + * each value, in bytes. For variable length VRs (strings), it returns 1. + * For internal VRs it returns 0. + * @return size of values of this VR + */ + size_t getValueWidth() const; + + /** returns true if VR is a standard DICOM VR + * @return true if VR is a standard DICOM VR, false otherwise + */ + OFBool isStandard() const; + + /** returns true if VR is for internal use only + * @return true if VR is for internal use only, false otherwise + */ + OFBool isForInternalUseOnly() const; + + /** returns true if VR represents a string + * @return true if VR represents a string, false otherwise + */ + OFBool isaString() const; + + /** returns true if VR uses an extended length encoding for explicit + * transfer syntaxes + * @return true if VR uses an extended length encoding for explicit + * transfer syntaxes, false otherwise + */ + OFBool usesExtendedLengthEncoding() const; + + /** returns true if VR supports undefined length for the value length field + * and a sequence delimitation item marks the end of the value field + * @return true if VR supports undefined length, false otherwise + */ + OFBool supportsUndefinedLength() const; + + /** check if VRs are equivalent. + * VRs are considered equivalent if equal or if one of them is an internal + * VR and the other one is a possible standard VR to which the internal one + * maps. + * @param avr VR to compare with + * @return true if VRs are equivalent, false otherwise + */ + OFBool isEquivalent(const DcmVR& avr) const; + + /* minimum and maximum length of a value with this VR + ** (in bytes assuming single byte characters) + */ + + /** return minimum length of a single value with this VR. + * Whether the returned length is in bytes or characters can be determined + * by isLengthInChar(). + * @return minimum length of a value + */ + Uint32 getMinValueLength() const; + + /** return maximum length of a single value with this VR. + * Whether the returned length is in bytes or characters can be determined + * by isLengthInChar(). + * @return maximum length of a value + */ + Uint32 getMaxValueLength() const; + + /** return whether elements of this VR are affected by SpecificCharacterSet + * @return true for the following VRs: PN, LO, LT, SH, ST, UC and UT, + * false for all others. + */ + OFBool isAffectedBySpecificCharacterSet() const; + + /** retrieve delimiter characters to be used for character set conversion + * (to switch back to the default character set in case code extension + * techniques like ISO 2022 are used). + * @return a reference to an OFString containing the delimiter characters + * for this VR or a reference to an empty OFString. + */ + const OFString& getDelimiterChars() const; + + /** check whether the maximum or minimum length of a value with this VR is + * in bytes or characters. See getMinValueLength() and getMaxValueLength(). + * @return true if length is stated in characters, false if in bytes + */ + OFBool isLengthInChar() const; + +private: + /// the enumerated VR value + DcmEVR vr; +}; + + +#endif /* !DCMVR_H */ diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrae.h b/dcmdata/include/dcmtk/dcmdata/dcvrae.h new file mode 100644 index 00000000..d13c18bd --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrae.h @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmApplicationEntity + * + */ + + +#ifndef DCVRAE_H +#define DCVRAE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcbytstr.h" + + +/** a class representing the DICOM value representation 'Application Entity' (AE) + */ +class DCMTK_DCMDATA_EXPORT DcmApplicationEntity + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmApplicationEntity(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmApplicationEntity(const DcmApplicationEntity &old); + + /** destructor + */ + virtual ~DcmApplicationEntity(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmApplicationEntity &operator=(const DcmApplicationEntity &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmApplicationEntity(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_AE) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + // ensure inherited overloads of matches take part in overload resolution + using DcmByteString::matches; + + /// @copydoc DcmByteString::matches(OFString,OFString,OFBool) + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /// @copydoc DcmElement::isUniversalMatch() + virtual OFBool isUniversalMatch(const OFBool normalize = OFTrue, + const OFBool enableWildCardMatching = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "AE" (Application Entity) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); +}; + + +#endif // DCVRAE_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvras.h b/dcmdata/include/dcmtk/dcmdata/dcvras.h new file mode 100644 index 00000000..65e96ef5 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvras.h @@ -0,0 +1,112 @@ +/* + * + * Copyright (C) 1994-2013, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmAgeString + * + */ + + +#ifndef DCVRAS_H +#define DCVRAS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcbytstr.h" + + +/** a class representing the DICOM value representation 'Age String' (AS) + */ +class DCMTK_DCMDATA_EXPORT DcmAgeString + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmAgeString(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmAgeString(const DcmAgeString &old); + + /** destructor + */ + virtual ~DcmAgeString(void); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmAgeString &operator=(const DcmAgeString &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmAgeString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_AS) + */ + virtual DcmEVR ident(void) const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "AS" (Age String) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); +}; + + +#endif // DCVRAS_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrat.h b/dcmdata/include/dcmtk/dcmdata/dcvrat.h new file mode 100644 index 00000000..17d046d8 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrat.h @@ -0,0 +1,278 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmAttributeTag + * + */ + + +#ifndef DCVRAT_H +#define DCVRAT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Attribute Tag' (AT) + */ +class DCMTK_DCMDATA_EXPORT DcmAttributeTag + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmAttributeTag(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmAttributeTag(const DcmAttributeTag &old); + + /** destructor + */ + virtual ~DcmAttributeTag(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmAttributeTag &operator=(const DcmAttributeTag &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * the first component that does not match is greater in this object than + * in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmAttributeTag(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_AT) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of tag value pairs (group,element) + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of group and + * element value pairs, e.g. "(0008,0020)\(0008,0030)" + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** get particular tag value + * @param tagVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTagVal(DcmTagKey &tagVal, + const unsigned long pos = 0); + + /** get reference to stored integer data. + * The array entries with an even-numbered index contain the group numbers + * and the odd entries contain the element numbers (see "putUint16Array()"). + * The number of entries is twice as large as the return value of "getVM()". + * @param uintVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint16Array(Uint16 *&uintVals); + + /** get specified value as a character string. + * The output format is "(gggg,eeee)" where "gggg" is the hexa-decimal group + * number and "eeee" the hexa-decimal element number of the attribute tag. + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular tag value + * @param tagVal tag value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putTagVal(const DcmTagKey &tagVal, + const unsigned long pos = 0); + + /** set element value to given integer array data. + * The array entries with an even-numbered index are expected to contain the + * group numbers and the odd entries to contain the element numbers, e.g. + * {0x0008, 0x0020, 0x0008, 0x0030}. This function uses the same format as + * "getUint16Array()". + * @param uintVals unsigned integer data to be set + * @param numUints number of integer values to be set (should be even) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint16Array(const Uint16 *uintVals, + const unsigned long numUints); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * attribute tags, e.g. "(0008,0020)\(0008,0030)". This is the same format + * as used by "print()". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * attribute tags, e.g. "(0008,0020)\(0008,0030)". This is the same format + * as used by "print()". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /// @copydoc DcmElement::isUniversalMatch() + virtual OFBool isUniversalMatch(const OFBool normalize = OFTrue, + const OFBool enableWildCardMatching = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "AT" (Attribute Tag) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); + +protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmAttributeTag(const DcmTag &tag, + const Uint32 len); + +}; + + +#endif // DCVRAT_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrcs.h b/dcmdata/include/dcmtk/dcmdata/dcvrcs.h new file mode 100644 index 00000000..23e8daea --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrcs.h @@ -0,0 +1,148 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmCodeString + * + */ + + +#ifndef DCVRCS_H +#define DCVRCS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcbytstr.h" + + +/** a class representing the DICOM value representation 'Code String' (CS) + */ +class DCMTK_DCMDATA_EXPORT DcmCodeString + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmCodeString(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmCodeString(const DcmCodeString &old); + + /** destructor + */ + virtual ~DcmCodeString(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmCodeString &operator=(const DcmCodeString &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmCodeString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_CS) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + // ensure inherited overloads of matches take part in overload resolution + using DcmByteString::matches; + + /// @copydoc DcmByteString::matches(OFString,OFString,OFBool) + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /// @copydoc DcmElement::isUniversalMatch() + virtual OFBool isUniversalMatch(const OFBool normalize = OFTrue, + const OFBool enableWildCardMatching = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given value conforms to value representation CS (Code String). + * Valid characters are: A-Z, 0-9, _ and ' ' (space). The maximum length is 16. + * NB: This method is only used by the DicomDirInterface class and might be + * replaced by the following method (checkStringValue) in the future. + * @param value string value to be checked (single value only) + * @param pos returns index of first invalid character (0..n-1) if not NULL. + * Points to trailing zero byte (eos) if value is valid. + * @param checkLength check maximum length if OFTrue, ignore length if OFFalse + * @return OFTrue if value is valid, OFFalse otherwise + */ + static OFBool checkVR(const OFString &value, + size_t *pos = NULL, + const OFBool checkLength = OFTrue); + + /** check whether given string value conforms to the VR "CS" (Code String) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); +}; + + +#endif // DCVRCS_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrda.h b/dcmdata/include/dcmtk/dcmdata/dcvrda.h new file mode 100644 index 00000000..bfda1a32 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrda.h @@ -0,0 +1,292 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth, Joerg Riesmeier + * + * Purpose: Interface of class DcmDate + * + */ + +#ifndef DCVRDA_H +#define DCVRDA_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcbytstr.h" +#include "dcmtk/ofstd/ofdate.h" + + +/** a class representing the DICOM value representation 'Date' (DA) + */ +class DCMTK_DCMDATA_EXPORT DcmDate + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmDate(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmDate(const DcmDate &old); + + /** destructor + */ + virtual ~DcmDate(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmDate &operator=(const DcmDate &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmDate(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_DA) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat support old ACR/NEMA format if OFTrue ('.' as a separator) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set the element value to the current system date. + * The DICOM DA format supported by this function is "YYYYMMDD". If the current + * system date is unavailable the date is set to "19000101" and an error code is + * returned. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setCurrentDate(); + + /** set the element value to the given date + * @param dateValue date to be set (should be a valid date) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setOFDate(const OFDate &dateValue); + + /** get the current element value in OFDate format. + * Please note that the element value is expected to be in valid DICOM DA format + * ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). + * If this function fails the result variable 'dateValue' is cleared automatically. + * @param dateValue reference to OFDate variable where the result is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @param supportOldFormat if OFTrue support old (prior V3.0) date format (see above) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getOFDate(OFDate &dateValue, + const unsigned long pos = 0, + const OFBool supportOldFormat = OFTrue); + + /** get the current element value in ISO date format. + * The ISO date format supported by this function is "YYYY-MM-DD". Please note + * that the element value is expected to be in valid DICOM DA format ("YYYYMMDD", + * "YYYY.MM.DD" is also supported for reasons of backward compatibility). + * If this function fails or the current element value is empty, the result + * variable 'formattedDate' is cleared automatically. + * @param formattedDate reference to string variable where the result is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @param supportOldFormat if OFTrue support old (prior V3.0) date format (see above) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getISOFormattedDate(OFString &formattedDate, + const unsigned long pos = 0, + const OFBool supportOldFormat = OFTrue); + + // ensure inherited overloads of matches take part in overload resolution + using DcmByteString::matches; + + /// @copydoc DcmByteString::matches(OFString,OFString,OFBool) + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /// @copydoc DcmElement::combinationMatches() + virtual OFBool combinationMatches(const DcmElement& keySecond, + const DcmElement& candidateFirst, + const DcmElement& candidateSecond) const; + + /* --- static helper functions --- */ + + /** get the current system date. + * The DICOM DA format supported by this function is "YYYYMMDD". If the current + * system date is unavailable the date is set to "19000101" and an error code is + * returned. + * @param dicomDate reference to string variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getCurrentDate(OFString &dicomDate); + + /** get the specified OFDate value in DICOM format. + * The DICOM DA format supported by this function is "YYYYMMDD". If the specified + * date is invalid the date is set to "19000101" and an error code is returned. + * @param dateValue date to be converted to DICOM format + * @param dicomDate reference to string variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getDicomDateFromOFDate(const OFDate &dateValue, + OFString &dicomDate); + + /** get the specified DICOM date value in OFDate format. + * Please note that the specified value is expected to be in valid DICOM DA format + * ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). + * If this function fails, the result variable 'dateValue' is cleared automatically. + * @param dicomDate string value in DICOM DA format to be converted to OFDate format. + * An empty string is not regarded as valid input, since the date would be unknown. + * @param dateValue reference to OFDate variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFDateFromString(const OFString &dicomDate, + OFDate &dateValue); + + /** get the specified DICOM date value in OFDate format. + * Please note that the specified value is expected to be in valid DICOM DA format + * ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). + * If this function fails, the result variable 'dateValue' is cleared automatically. + * @param dicomDate string value in DICOM DA format to be converted to OFDate format. + * An empty string is not regarded as valid input, since the date would be unknown. + * @param dateValue reference to OFDate variable where the result is stored + * @param supportOldFormat set to OFFalse to disable support for old (prior V3.0) date + * format (see above). + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFDateFromString(const OFString &dicomDate, + OFDate &dateValue, + const OFBool supportOldFormat); + + /** get the specified DICOM date value in OFDate format. + * Please note that the specified value is expected to be in valid DICOM DA format + * ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). + * If this function fails, the result variable 'dateValue' is cleared automatically. + * @param dicomDate string value in DICOM DA format to be converted to OFDate format. + * An empty string is not regarded as valid input, since the date would be unknown. + * @param dicomDateSize the size (in bytes) of the string 'dicomDate' refers to + * @param dateValue reference to OFDate variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFDateFromString(const char *dicomDate, + const size_t dicomDateSize, + OFDate &dateValue); + + /** get the specified DICOM date value in OFDate format. + * Please note that the specified value is expected to be in valid DICOM DA format + * ("YYYYMMDD", "YYYY.MM.DD" is also supported for reasons of backward compatibility). + * If this function fails, the result variable 'dateValue' is cleared automatically. + * @param dicomDate string value in DICOM DA format to be converted to OFDate format. + * An empty string is not regarded as valid input, since the date would be unknown. + * @param dicomDateSize the size (in bytes) of the string 'dicomDate' refers to + * @param dateValue reference to OFDate variable where the result is stored + * @param supportOldFormat set to OFFalse to disable support for old (prior V3.0) date + * format (see above). + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFDateFromString(const char *dicomDate, + const size_t dicomDateSize, + OFDate &dateValue, + const OFBool supportOldFormat); + + /** get the specified DICOM date value in ISO format. + * The ISO date format supported by this function is "YYYY-MM-DD". Please note + * that the specified value is expected to be in valid DICOM DA format ("YYYYMMDD", + * "YYYY.MM.DD" is also supported for reasons of backward compatibility). + * If this function fails or the specified DICOM date value is empty, the result + * variable 'formattedDate' is cleared automatically. + * @param dicomDate string value in DICOM DA format to be converted to ISO format + * @param formattedDate reference to string variable where the result is stored + * @param supportOldFormat if OFTrue support old (prior V3.0) date format (see above) + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getISOFormattedDateFromString(const OFString &dicomDate, + OFString &formattedDate, + const OFBool supportOldFormat = OFTrue); + + /** check whether the given string conforms to a single value of VR "DA" (Date). + * The old (prior V3.0) date format is considered invalid. + * @param dicomDate string value to be checked. An empty string is not regarded as valid + * input, since the date would be unknown + * @param dicomDateSize the size (in bytes) of the string 'dicomDate' refers to + * @return OFTrue if the given string conforms to the Date format, OFFalse otherwise + */ + static OFBool check(const char *dicomDate, const size_t dicomDateSize); + + /** check whether the given string conforms to a single value of VR "DA" (Date). + * @param dicomDate string value to be checked. An empty string is not regarded as valid + * input, since the date would be unknown + * @param dicomDateSize the size (in bytes) of the string 'dicomDate' refers to + * @param supportOldFormat whether to accept the old (prior V3.0) date format. + * Set to OFTrue for enabling support for "YYYY.MM.DD" in addition to "YYYYMMDD". + * @return OFTrue if the given string conforms to the Date format, OFFalse otherwise + */ + static OFBool check(const char *dicomDate, + const size_t dicomDateSize, + const OFBool supportOldFormat); + + /** check whether given string value conforms to the VR "DA" (Date) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat support old ACR/NEMA date format if OFTrue (i.e. with "." delimiters) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); +}; + + +#endif // DCVRDA_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrds.h b/dcmdata/include/dcmtk/dcmdata/dcvrds.h new file mode 100644 index 00000000..f7ea5006 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrds.h @@ -0,0 +1,161 @@ +/* + * + * Copyright (C) 1994-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmDecimalString + * + */ + + +#ifndef DCVRDS_H +#define DCVRDS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmdata/dcbytstr.h" + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Decimal String' (DS) + */ +class DCMTK_DCMDATA_EXPORT DcmDecimalString + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmDecimalString(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmDecimalString(const DcmDecimalString &old); + + /** destructor + */ + virtual ~DcmDecimalString(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmDecimalString &operator=(const DcmDecimalString &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmDecimalString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_DS) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get particular float value + * @param doubleVal reference to result variable + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloat64(Float64 &doubleVal, + const unsigned long pos = 0); + + /** get stored float values as a vector. + * Please note that only an element value consisting of zero or more spaces is considered + * as being empty and, therefore, results in an empty vector with status ".good()"; use + * isEmpty() before calling this method if you also want to check for other non-significant + * characters (e.g. the backslash). + * @param doubleVals reference to result variable + * (cleared automatically before entries are added) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloat64Vector(OFVector &doubleVals); + + /** get a particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "DS" (Decimal String) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); +}; + + +#endif // DCVRDS_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrdt.h b/dcmdata/include/dcmtk/dcmdata/dcvrdt.h new file mode 100644 index 00000000..fbfc646e --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrdt.h @@ -0,0 +1,305 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Joerg Riesmeier + * + * Purpose: Interface of class DcmDateTime + * + */ + +#ifndef DCVRDT_H +#define DCVRDT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcbytstr.h" +#include "dcmtk/ofstd/ofdatime.h" + + +/** a class representing the DICOM value representation 'Date Time' (DT) + */ +class DCMTK_DCMDATA_EXPORT DcmDateTime + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmDateTime(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmDateTime(const DcmDateTime &old); + + /** destructor + */ + virtual ~DcmDateTime(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmDateTime &operator=(const DcmDateTime &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmDateTime(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_DT) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringValue variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringValue, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set the element value to the current system date and time. + * The DICOM DT format supported by this function is "YYYYMMDDHHMM[SS[.FFFFFF]][&ZZZZ]" + * where the brackets enclose optional parts. If the current system date/time or parts + * of it are unavailable the corresponding values are set to "0" and an error code is + * returned - in fact, the date is set to "19000101" if unavailable. + * @param seconds add optional seconds ("SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @param timeZone add optional time zone ("&ZZZZ" where "&" is "+" or "-") if OFTrue. + * The time zone is given as the offset (hours and minutes) from Coordinated Universal + * Time (UTC). + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setCurrentDateTime(const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse, + const OFBool timeZone = OFFalse); + + /** set the element value to the given date and time + * @param dateTimeValue date to be set (should be a valid date and time) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setOFDateTime(const OFDateTime &dateTimeValue); + + /** get the current element value in OFDateTime format. + * Please note that the element value is expected to be in valid DICOM DT format + * ("YYYYMMDD[HH[MM[SS[.FFFFFF]]]][&ZZZZ]"). If the optional time zone ("&ZZZZ") is + * missing the local time zone is used. + * If this function fails the result variable 'dateTimeValue' is cleared automatically. + * @param dateTimeValue reference to OFDateTime variable where the result is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getOFDateTime(OFDateTime &dateTimeValue, + const unsigned long pos = 0); + + /** get the current element value in ISO date/time format. + * The ISO date/time format supported by this function is "YYYY-MM-DD[ HH:MM[:SS[.FFFFFF]]] + * [&HH:MM]" where the brackets enclose optional parts. Please note that the element value + * is expected to be in valid DICOM DT format ("YYYYMMDD[HH[MM[SS[.FFFFFF]]]][&ZZZZ]"). + * If this function fails or the current element value is empty, the result variable + * 'formattedDateTime' is cleared automatically. + * @param formattedDateTime reference to string variable where the result is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @param seconds add optional seconds (":SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @param timeZone add optional time zone ("&HH:MM" where "&" is "+" or "-") if OFTrue. + * The time zone is given as the offset (hours and minutes) from Coordinated Universal + * Time (UTC). Please note that the formatted time output is not adapted to the local + * time if the time zone is omitted. + * @param createMissingPart if OFTrue create optional parts (seconds, fractional part of + * a seconds and/or time zone) if absent in the element value + * @param dateTimeSeparator separator between ISO date and time value + * @param timeZoneSeparator separator between ISO time value and time zone + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getISOFormattedDateTime(OFString &formattedDateTime, + const unsigned long pos = 0, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse, + const OFBool timeZone = OFTrue, + const OFBool createMissingPart = OFFalse, + const OFString &dateTimeSeparator = " ", + const OFString &timeZoneSeparator = " "); + + // ensure inherited overloads of matches take part in overload resolution + using DcmByteString::matches; + + /// @copydoc DcmByteString::matches(OFString,OFString,OFBool) + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /* --- static helper functions --- */ + + /** get the current system date and time. + * The DICOM DT format supported by this function is "YYYYMMDDHHMM[SS[.FFFFFF]][&ZZZZ]" + * where the brackets enclose optional parts. If the current system date/time or parts + * of it are unavailable the corresponding values are set to "0" and an error code is + * returned - in fact, the date is set to "19000101" if unavailable. + * @param dicomDateTime reference to string variable where the result is stored + * @param seconds add optional seconds ("SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @param timeZone add optional time zone ("&ZZZZ" where "&" is "+" or "-") if OFTrue. + * The time zone is given as the offset (hours and minutes) from Coordinated Universal + * Time (UTC). + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getCurrentDateTime(OFString &dicomDateTime, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse, + const OFBool timeZone = OFFalse); + + /** get the specified OFDateTime value in DICOM format. + * The DICOM DT format supported by this function is "YYYYMMDDHHMM[SS[.FFFFFF]][&ZZZZ]" + * where the brackets enclose optional parts. If the current system date/time or parts + * of it are unavailable the corresponding values are set to "0" and an error code is + * returned - in fact, the date is set to "19000101" if unavailable. + * @param dateTimeValue date and time to be converted to DICOM format + * @param dicomDateTime reference to string variable where the result is stored + * @param seconds add optional seconds ("SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @param timeZone add optional time zone ("&ZZZZ" where "&" is "+" or "-") if OFTrue. + * The time zone is given as the offset (hours and minutes) from Coordinated Universal + * Time (UTC). + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getDicomDateTimeFromOFDateTime(const OFDateTime &dateTimeValue, + OFString &dicomDateTime, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse, + const OFBool timeZone = OFFalse); + + /** get the specified DICOM date and time value in OFDateTime format. + * Please note that the element value is expected to be in valid DICOM DT format + * ("YYYY[MM[DD[HH[MM[SS[.FFFFFF]]]]]][&ZZZZ]"). If the "MM" and/or "DD" component from + * the date part is missing, a value of "1" is used for each of them. If the "HH", "MM" + * and/or "SS" component of the time part is missing, a value of "0" is used for each of + * them. If the optional time zone ("&ZZZZ") is missing, the local time zone is used. + * If this function fails, the result variable 'dateTimeValue' is cleared automatically. + * @param dicomDateTime string value in DICOM DT format to be converted to OFDateTime. + * An empty string is not regarded as valid input, since the date/time would be unknown. + * @param dateTimeValue reference to OFDateTime variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFDateTimeFromString(const OFString &dicomDateTime, + OFDateTime &dateTimeValue); + + /** get the specified DICOM date and time value in OFDateTime format. + * Please note that the element value is expected to be in valid DICOM DT format + * ("YYYY[MM[DD[HH[MM[SS[.FFFFFF]]]]]][&ZZZZ]"). If the "MM" and/or "DD" component from + * the date part is missing, a value of "1" is used for each of them. If the "HH", "MM" + * and/or "SS" component of the time part is missing, a value of "0" is used for each of + * them. If the optional time zone ("&ZZZZ") is missing, the local time zone is used. + * If this function fails, the result variable 'dateTimeValue' is cleared automatically. + * @param dicomDateTime string value in DICOM DT format to be converted to OFDateTime. + * An empty string is not regarded as valid input, since the date/time would be unknown. + * @param dicomDateTimeSize the size (in bytes) of the string 'dicomDateTime' refers to + * @param dateTimeValue reference to OFDateTime variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFDateTimeFromString(const char *dicomDateTime, + const size_t dicomDateTimeSize, + OFDateTime &dateTimeValue); + + /** get the specified DICOM datetime value in ISO format. + * The ISO date/time format supported by this function is "YYYY-MM-DD[ HH:MM[:SS[.FFFFFF]]] + * [&HH:MM]" where the brackets enclose optional parts. Please note that the specified + * value is expected to be in valid DICOM DT format ("YYYYMMDD[HH[MM[SS[.FFFFFF]]]][&ZZZZ]"). + * If this function fails or the specified DICOM datetime value is empty, the result + * variable 'formattedDateTime' is cleared automatically. + * @param dicomDateTime string value in DICOM DT format to be converted to ISO format + * @param formattedDateTime reference to string variable where the result is stored + * @param seconds add optional seconds (":SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @param timeZone add optional time zone ("&HH:MM" where "&" is "+" or "-") if OFTrue. + * The time zone is given as the offset (hours and minutes) from the Coordinated Universal + * Time (UTC). Please note that the formatted time output is not adapted to the local time + * if the time zone is omitted. + * @param createMissingPart if OFTrue create optional parts (seconds, fractional part of + * a seconds and/or time zone) if absent in the element value + * @param dateTimeSeparator separator between ISO date and time value + * @param timeZoneSeparator separator between ISO time value and time zone + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getISOFormattedDateTimeFromString(const OFString &dicomDateTime, + OFString &formattedDateTime, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse, + const OFBool timeZone = OFTrue, + const OFBool createMissingPart = OFFalse, + const OFString &dateTimeSeparator = " ", + const OFString &timeZoneSeparator = " "); + + /** check whether the given string conforms to a single value of VR "DT" (Date Time). + * @param dicomDateTime string value to be checked + * @param dicomDateTimeSize the size (in bytes) of the string 'dicomDateTime' refers to + * @return OFTrue if the given string conforms to the Date Time format, OFFalse otherwise + */ + static OFBool check(const char *dicomDateTime, + const size_t dicomDateTimeSize); + + /** check whether given string value conforms to the VR "DT" (Date Time) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); +}; + + +#endif // DCVRDT_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrfd.h b/dcmdata/include/dcmtk/dcmdata/dcvrfd.h new file mode 100644 index 00000000..737447c0 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrfd.h @@ -0,0 +1,236 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmFloatingPointDouble + * + */ + + +#ifndef DCVRFD_H +#define DCVRFD_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Floating Point Double' (FD) + */ +class DCMTK_DCMDATA_EXPORT DcmFloatingPointDouble + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmFloatingPointDouble(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmFloatingPointDouble(const DcmFloatingPointDouble &old); + + /** destructor + */ + virtual ~DcmFloatingPointDouble(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmFloatingPointDouble &operator=(const DcmFloatingPointDouble &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in this object than in rhs, or all compared components match + * but this object has fewer components than rhs. Also returned if rhs + * cannot be casted to this object type. + * 1 if either the value of the first component that does not match + * is greater in this object than in rhs object, or all compared + * components match but the this component is longer. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmFloatingPointDouble(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_FD) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * This function uses a variable number of digits for the floating point values + * as created by the OFStandard::ftoa() function by default. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular double value + * @param doubleVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloat64(Float64 &doubleVal, + const unsigned long pos = 0); + + /** get reference to stored double data + * @param doubleVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloat64Array(Float64 *&doubleVals); + + /** get a particular value as a character string. + * The resulting string contains a variable number of digits as created by + * the OFStandard::ftoa() function by default. + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given double + * @param doubleVal double precision floating point value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putFloat64(const Float64 doubleVal, + const unsigned long pos = 0); + + /** set element value to given double array data + * @param doubleVals double precision floating point data to be set + * @param numDoubles number of double values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putFloat64Array(const Float64 *doubleVals, + const unsigned long numDoubles); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "12.3456\1\-123.456\1234.0". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "12.3456\1\-123.456\1234.0". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /// @copydoc DcmElement::matches() + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmFloatingPointDouble(const DcmTag &tag, + const Uint32 len); + +}; + + +#endif // DCVRFD_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrfl.h b/dcmdata/include/dcmtk/dcmdata/dcvrfl.h new file mode 100644 index 00000000..fc4756cb --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrfl.h @@ -0,0 +1,238 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmFloatingPointSingle + * + */ + + +#ifndef DCVRFL_H +#define DCVRFL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Floating Point Single' (FL) + */ +class DCMTK_DCMDATA_EXPORT DcmFloatingPointSingle + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmFloatingPointSingle(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmFloatingPointSingle(const DcmFloatingPointSingle &old); + + /** destructor + */ + virtual ~DcmFloatingPointSingle(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmFloatingPointSingle &operator=(const DcmFloatingPointSingle &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if either the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmFloatingPointSingle(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_FL) + */ + virtual DcmEVR ident(void) const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * This function uses a variable number of digits for the floating point values + * as created by the OFStandard::ftoa() function by default. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular float value + * @param floatVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloat32(Float32 &floatVal, + const unsigned long pos = 0); + + /** get reference to stored float data + * @param floatVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloat32Array(Float32 *&floatVals); + + /** get a particular value as a character string. + * The resulting string contains a variable number of digits as created by + * the OFStandard::ftoa() function by default. + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given float + * @param floatVal floating point value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putFloat32(const Float32 floatVal, + const unsigned long pos = 0); + + /** set element value to given float array data + * @param floatVals floating point data to be set + * @param numFloats number of floating point values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putFloat32Array(const Float32 *floatVals, + const unsigned long numFloats); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "12.3456\1\-123.456\1234.0". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "12.3456\1\-123.456\1234.0". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /// @copydoc DcmElement::matches() + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmFloatingPointSingle(const DcmTag &tag, + const Uint32 len); + +}; + + +#endif // DCVRFL_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvris.h b/dcmdata/include/dcmtk/dcmdata/dcvris.h new file mode 100644 index 00000000..3854f1d6 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvris.h @@ -0,0 +1,141 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmIntegerString + * + */ + +#ifndef DCVRIS_H +#define DCVRIS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcbytstr.h" + + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Integer String' (IS) + */ +class DCMTK_DCMDATA_EXPORT DcmIntegerString + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmIntegerString(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmIntegerString(const DcmIntegerString &old); + + /** destructor + */ + virtual ~DcmIntegerString(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmIntegerString &operator=(const DcmIntegerString &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmIntegerString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_IS) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get particular integer value + * @param sintVal reference to result variable + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSint32(Sint32 &sintVal, + const unsigned long pos = 0); + + /** get a particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "IS" (Integer String) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); +}; + + +#endif // DCVRIS_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrlo.h b/dcmdata/include/dcmtk/dcmdata/dcvrlo.h new file mode 100644 index 00000000..28b8f696 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrlo.h @@ -0,0 +1,147 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmLongString + * + */ + + +#ifndef DCVRLO_H +#define DCVRLO_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcchrstr.h" + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Long String' (LO) + */ +class DCMTK_DCMDATA_EXPORT DcmLongString + : public DcmCharString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmLongString(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmLongString(const DcmLongString &old); + + /** destructor + */ + virtual ~DcmLongString(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmLongString &operator=(const DcmLongString &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmLongString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_LO) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM. + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other specific character sets disable the check of the value representation. + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "LO" (Long String) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n", + const OFString &charset = ""); + +protected: + + /** @copydoc DcmCharString::getDelimiterChars() + */ + virtual const OFString& getDelimiterChars() const; +}; + + +#endif // DCVRLO_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrlt.h b/dcmdata/include/dcmtk/dcmdata/dcvrlt.h new file mode 100644 index 00000000..846cada8 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrlt.h @@ -0,0 +1,157 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmLongText + * + */ + +#ifndef DCVRLT_H +#define DCVRLT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcchrstr.h" + + +/** a class representing the DICOM value representation 'Long Text' (LT) + */ +class DCMTK_DCMDATA_EXPORT DcmLongText + : public DcmCharString +{ + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmLongText(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmLongText(const DcmLongText &old); + + /** destructor + */ + virtual ~DcmLongText(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmLongText &operator=(const DcmLongText &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmLongText(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_LT) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM. + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other specific character sets disable the check of the value representation. + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get the value multiplicity. + * Since the backslash "\" is not regarded as a separator the value + * multiplicity is always 1. + * @return value multiplicity of the currently stored value + */ + virtual unsigned long getVM(); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get the string value (all components) + * @param stringVal string variable in which the result value is stored + * @param normalize remove trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFStringArray(OFString &stringVal, + OFBool normalize = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "LT" (Long Text) + * @param value string value to be checked + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &charset = ""); +}; + + +#endif // DCVRLT_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrobow.h b/dcmdata/include/dcmtk/dcmdata/dcvrobow.h new file mode 100644 index 00000000..e2ab85c5 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrobow.h @@ -0,0 +1,382 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: Interface of class DcmOtherByteOtherWord + * + */ + + +#ifndef DCVROBOW_H +#define DCVROBOW_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representations 'Other Byte' (OB) + * and 'Other Word' (OW) + */ +class DCMTK_DCMDATA_EXPORT DcmOtherByteOtherWord + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmOtherByteOtherWord(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmOtherByteOtherWord(const DcmOtherByteOtherWord &old); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). The implementation for DcmOtherByteOtherWord + * does compare the values of two elements in local endianness. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** destructor + */ + virtual ~DcmOtherByteOtherWord(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmOtherByteOtherWord &operator=(const DcmOtherByteOtherWord &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmOtherByteOtherWord(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return always returns EC_Normal, i.e. currently no checks are performed + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return always returns 1 (according to the DICOM standard) + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** set/change the current value representation + * @param vr new value representation to be set. All VRs except for OW (Other + * Word String) are treated as 8 bit data (OB). This is particularly useful + * for unknown (UN) or unsupported VRs. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVR(DcmEVR vr); + + /** print the current value to a stream. + * The output format of the binary value is a backslash separated sequence of + * 2- or 4-digit hex numbers, e.g. "00\01\dd" or "0000\7777\aaaa\ffff". + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** check whether the transfer syntax can be changed as specified + * @param newXfer transfer syntax to be checked + * @param oldXfer not used + * @return OFTrue if transfer syntax can be changed to the new one, OFFalse otherwise + */ + virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer); + + /** write object to a stream + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** write object in XML format to a stream + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format to a stream + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** get particular 8 bit value. + * This method is only applicable to non-OW data, e.g. OB. + * @param byteVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint8(Uint8 &byteVal, + const unsigned long pos = 0); + + /** get particular 16 bit value. + * This method is only applicable to OW data. + * @param wordVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint16(Uint16 &wordVal, + const unsigned long pos = 0); + + /** get reference to stored 8 bit data. + * This method is only applicable to non-OW data, e.g. OB. + * @param byteVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint8Array(Uint8 *&byteVals); + + /** get reference to stored 16 bit data. + * This method is only applicable to OW data. + * @param wordVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint16Array(Uint16 *&wordVals); + + /** get a particular value as a character string. + * The numeric value is converted to hex mode, i.e. an 8 bit value is + * represented by 2 characters (00..ff) and a 16 bit value by 4 characters + * (0000..ffff). + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get element value as a character string. + * The numeric values are converted to hex mode, i.e. an 8 bit value is + * represented by 2 characters (00..ff) and a 16 bit value by 4 characters + * (0000..ffff). + * In case of VM > 1 the individual values are separated by a backslash ('\'). + * @param stringVal variable in which the result value is stored + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFStringArray(OFString &stringVal, + OFBool normalize = OFTrue); + + /** set element value to given 8 bit data. + * This method is only applicable to non-OW data, e.g. OB. + * @param byteValue 8 bit data to be set (copied) + * @param numBytes number of bytes (8 bit) to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint8Array(const Uint8 *byteValue, + const unsigned long numBytes); + + /** set element value to given 16 bit data. + * This method is only applicable to OW data. + * @param wordValue 16 bit data to be set (copied) + * @param numWords number of words (16 bit) to be set. Local byte-ordering + * expected. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint16Array(const Uint16 *wordValue, + const unsigned long numWords); + + /** create an empty Uint8 array of given number of bytes and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to non-OW data, e.g. OB. + * @param numBytes number of bytes (8 bit) to be created + * @param bytes stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint8Array(const Uint32 numBytes, + Uint8 *&bytes); + + /** create an empty Uint16 array of given number of words and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to OW data. + * @param numWords number of words (16 bit) to be created + * @param words stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint16Array(const Uint32 numWords, + Uint16 *&words); + + /** set element value from the given character string. + * The input string is expected to have the same format as described for + * 'getOFStringArray()' above, i.e. a backslash separated sequence of + * hexa-decimal numbers. + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to have the same format as described for + * 'getOFStringArray()' above, i.e. a backslash separated sequence of + * hexa-decimal numbers. + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the + * trailing NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value padding (even length) if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmOtherByteOtherWord(const DcmTag &tag, + const Uint32 len); + + /** method is called after the element value has been loaded. + * Can be used to correct the value before it is used for the first time. + */ + virtual void postLoadValue(); + + /** align the element value to an even length (padding) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition alignValue(); + + /** print pixel data and optionally write it to a binary file. + * Optional pixel data file is always written in little endian byte-ordering. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName optional filename used to write the raw pixel data file + * @param pixelCounter optional counter used for automatic pixel data filename creation + */ + void printPixel(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter); + +private: + + /** this flag is used during write operations and indicates that compact() should be + * called once the write operation finishes. + */ + OFBool compactAfterTransfer; + +}; + + +#endif // DCVROBOW_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrod.h b/dcmdata/include/dcmtk/dcmdata/dcvrod.h new file mode 100644 index 00000000..0d54c63e --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrod.h @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 2013-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmOtherDouble + * + */ + + +#ifndef DCVROD_H +#define DCVROD_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrfd.h" + + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Other Double' (OD) + */ +class DCMTK_DCMDATA_EXPORT DcmOtherDouble + : public DcmFloatingPointDouble +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmOtherDouble(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmOtherDouble(const DcmOtherDouble &old); + + /** destructor + */ + virtual ~DcmOtherDouble(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmOtherDouble &operator=(const DcmOtherDouble &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmOtherDouble(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_OD) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return always returns EC_Normal, i.e. currently no checks are performed + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return always returns 1 (according to the DICOM standard) + */ + virtual unsigned long getVM(); + + /** write object in XML format to a stream + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format to a stream + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** create an empty Float64 array of given number of double values and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * @param numDoubles number of double values (64 bit) to be created + * @param doubleVals stores the pointer to the resulting Float64 array + * (set to NULL in case of error) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createFloat64Array(const Uint32 numDoubles, + Float64 *&doubleVals); +}; + + +#endif // DCVROD_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrof.h b/dcmdata/include/dcmtk/dcmdata/dcvrof.h new file mode 100644 index 00000000..9442ca34 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrof.h @@ -0,0 +1,136 @@ +/* + * + * Copyright (C) 2002-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmOtherFloat + * + */ + + +#ifndef DCVROF_H +#define DCVROF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrfl.h" + + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Other Float' (OF) + */ +class DCMTK_DCMDATA_EXPORT DcmOtherFloat + : public DcmFloatingPointSingle +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmOtherFloat(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmOtherFloat(const DcmOtherFloat &old); + + /** destructor + */ + virtual ~DcmOtherFloat(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmOtherFloat &operator=(const DcmOtherFloat &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmOtherFloat(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_OF) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return always returns EC_Normal, i.e. currently no checks are performed + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return always returns 1 (according to the DICOM standard) + */ + virtual unsigned long getVM(); + + /** write object in XML format to a stream + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format to a stream + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** create an empty Float32 array of given number of float values and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * @param numFloats number of float values (32 bit) to be created + * @param floatVals stores the pointer to the resulting Float32 array + * (set to NULL in case of error) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createFloat32Array(const Uint32 numFloats, + Float32 *&floatVals); + + +}; + + +#endif // DCVROF_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrol.h b/dcmdata/include/dcmtk/dcmdata/dcvrol.h new file mode 100644 index 00000000..24b255cb --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrol.h @@ -0,0 +1,152 @@ +/* + * + * Copyright (C) 2016-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmOtherLong + * + */ + + +#ifndef DCVROL_H +#define DCVROL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrul.h" + + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Other Long' (OL) + */ +class DCMTK_DCMDATA_EXPORT DcmOtherLong + : public DcmUnsignedLong +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmOtherLong(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmOtherLong(const DcmOtherLong &old); + + /** destructor + */ + virtual ~DcmOtherLong(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmOtherLong &operator=(const DcmOtherLong &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmOtherLong(*this); + } + + /** virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally, + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_OL) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return always returns EC_Normal, i.e. currently no checks are performed + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return always returns 1 (according to the DICOM standard) + */ + virtual unsigned long getVM(); + + /** write object in XML format to a stream + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** create an empty Uint32 array of given number of double-words and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * @param numDoubleWords number of double-words (32 bit) to be created + * @param doubleWords stores the pointer to the resulting Uint32 array + * (set to NULL in case of error) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint32Array(const Uint32 numDoubleWords, + Uint32 *&doubleWords); + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmOtherLong(const DcmTag &tag, + const Uint32 len); + +}; + + +#endif // DCVROL_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrov.h b/dcmdata/include/dcmtk/dcmdata/dcvrov.h new file mode 100644 index 00000000..b955c17c --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrov.h @@ -0,0 +1,153 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmOther64bitVeryLong + * + */ + + +#ifndef DCVROV_H +#define DCVROV_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvruv.h" + + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Other 64-bit Very Long' (OV) + */ +class DCMTK_DCMDATA_EXPORT DcmOther64bitVeryLong + : public DcmUnsigned64bitVeryLong +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmOther64bitVeryLong(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmOther64bitVeryLong(const DcmOther64bitVeryLong &old); + + /** destructor + */ + virtual ~DcmOther64bitVeryLong(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmOther64bitVeryLong &operator=(const DcmOther64bitVeryLong &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmOther64bitVeryLong(*this); + } + + /** virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally, + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_OV) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return always returns EC_Normal, i.e. currently no checks are performed + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return always returns 1 (according to the DICOM standard) + */ + virtual unsigned long getVM(); + + /** write object in XML format to a stream + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /** create an empty Uint64 array of given number of quad-words and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * @param numQuadWords number of quad-words (64 bit) to be created + * @param quadWords stores the pointer to the resulting Uint64 array + * (set to NULL in case of error) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint64Array(const Uint32 numQuadWords, + Uint64 *&quadWords); + + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmOther64bitVeryLong(const DcmTag &tag, + const Uint32 len); + +}; + + +#endif // DCVROV_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrpn.h b/dcmdata/include/dcmtk/dcmdata/dcvrpn.h new file mode 100644 index 00000000..751f29a8 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrpn.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Joerg Riesmeier + * + * Purpose: Interface of class DcmPersonName + * + */ + + +#ifndef DCVRPN_H +#define DCVRPN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcchrstr.h" + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Person Name' (PN) + */ +class DCMTK_DCMDATA_EXPORT DcmPersonName + : public DcmCharString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmPersonName(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmPersonName(const DcmPersonName &old); + + /** destructor + */ + virtual ~DcmPersonName(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmPersonName &operator=(const DcmPersonName &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmPersonName(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_PN) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM. + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other specific character sets disable the check of the value representation. + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get name components from the element value. + * The DICOM PN consists of up to three component groups separated by a "=". The + * supported format is "[CG0[=CG1[=CG2]]]" where the brackets enclose optional + * parts and CG0 is an alphabetic representation, CG1 an ideographic representation, + * and CG2 a phonetic representation of the name. + * Each component group may consist of up to five components separated by a "^". + * The format is "[lastName[^firstName[^middleName[^namePrefix[^nameSuffix]]]]"; + * each component group and each component might be empty. + * If this function fails the result variables are cleared automatically. If the + * format is valid but does not comply with the above described scheme ("=" and "^") + * the full person name is returned in the 'lastName' variable. + * @param lastName reference to string variable where the "last name" is stored + * @param firstName reference to string variable where the "first name" is stored + * @param middleName reference to string variable where the "middle name" is stored + * @param namePrefix reference to string variable where the "name prefix" is stored + * @param nameSuffix reference to string variable where the "name suffix" is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @param componentGroup index of the component group (0..2) to be used, see above + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getNameComponents(OFString &lastName, + OFString &firstName, + OFString &middleName, + OFString &namePrefix, + OFString &nameSuffix, + const unsigned long pos = 0, + const unsigned int componentGroup = 0); + + /** get current element value as a formatted/readable name. + * The current element value is expected to be in DICOM PN format as described above. + * The output format is "[namePrefix][ firstName][ middleName][ lastName][, nameSuffix]"; + * the delimiters (" " and ", ") are only inserted if required. + * If this function fails the result variable 'formattedName' is cleared automatically. + * @param formattedName reference to string variable where the result is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @param componentGroup index of the component group (0..2) to be used, see above + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getFormattedName(OFString &formattedName, + const unsigned long pos = 0, + const unsigned int componentGroup = 0); + + + /** put element value from specified name components. + * The stored format is "[lastName[^firstName[^middleName[^namePrefix[^nameSuffix]]]]]", + * i.e. a DICOM Person Name (PN). Component groups are not (yet) supported. + * If this function fails the currently stored value is not modified. + * @param lastName reference to string variable where the "last name" is stored + * @param firstName reference to string variable where the "first name" is stored + * @param middleName reference to string variable where the "middle name" is stored + * @param namePrefix reference to string variable where the "name prefix" is stored + * @param nameSuffix reference to string variable where the "name suffix" is stored + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition putNameComponents(const OFString &lastName, + const OFString &firstName, + const OFString &middleName, + const OFString &namePrefix, + const OFString &nameSuffix); + + /** write object in XML format + * @param out output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DCMTypes::XF_xxx) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &out, + const size_t flags = 0); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /* --- static helper functions --- */ + + /** get name components from specified DICOM person name. + * The DICOM PN consists of up to three component groups separated by a "=". The + * supported format is "[CG0[=CG1[=CG2]]]" where the brackets enclose optional + * parts and CG0 is an alphabetic representation, CG1 an ideographic representation, + * and CG2 a phonetic representation of the name. + * Each component group may consist of up to five components separated by a "^". + * The format is "[lastName[^firstName[^middleName[^namePrefix[^nameSuffix]]]]"; + * each component group and each component might be empty. + * If this function fails the result variables are cleared automatically. If the + * format is valid but does not comply with the above described scheme ("=" and "^") + * the full person name is returned in the 'lastName' variable. + * @param dicomName string value in DICOM PN format to be split into components + * @param lastName reference to string variable where the "last name" is stored + * @param firstName reference to string variable where the "first name" is stored + * @param middleName reference to string variable where the "middle name" is stored + * @param namePrefix reference to string variable where the "name prefix" is stored + * @param nameSuffix reference to string variable where the "name suffix" is stored + * @param componentGroup index of the component group (0..2) to be used, see above + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getNameComponentsFromString(const OFString &dicomName, + OFString &lastName, + OFString &firstName, + OFString &middleName, + OFString &namePrefix, + OFString &nameSuffix, + const unsigned int componentGroup = 0); + + /** get single component group from specified DICOM person name. + * The DICOM PN consists of up to three component groups separated by a "=". The + * supported format is "[CG0[=CG1[=CG2]]]" where the brackets enclose optional + * parts and CG0 is an alphabetic representation, CG1 an ideographic representation, + * and CG2 a phonetic representation of the name. Each component group might be empty. + * The returned component group will contain component delimiters ("^") as they are + * stored within the very component group, i.e. superfluous component delimiters are + * not removed. + * @param allCmpGroups string value in DICOM PN format to component group from + * @param groupNo index of the component group (0..2) to be extracted + * @param cmpGroup reference to string variable where selected component group shall be + * stored + * @return EC_Normal upon success, an error code otherwise. Especially, if a component + * group exists (always for group 0, for group 1 and 2 depending on whether + * corresponding "=" is present) and is empty, EC_Normal is returned. + */ + static OFCondition getComponentGroup(const OFString &allCmpGroups, + const unsigned int groupNo, + OFString &cmpGroup); + + /** get specified DICOM person name as a formatted/readable name. + * The specified 'dicomName' is expected to be in DICOM PN format as described above. + * The output format is "[namePrefix][ firstName][ middleName][ lastName][, nameSuffix]"; + * the delimiters (" " and ", ") are only inserted if required. + * If this function fails the result variable 'formattedName' is cleared automatically. + * @param dicomName string value in DICOM PN format to be converted to readable format + * @param formattedName reference to string variable where the result is stored + * @param componentGroup index of the component group (0..2) to be used, see above + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getFormattedNameFromString(const OFString &dicomName, + OFString &formattedName, + const unsigned int componentGroup = 0); + + /** get formatted/readable name from specified name components. + * The output format is "[namePrefix][ firstName][ middleName][ lastName][, nameSuffix]"; + * the delimiters (" " and ", ") are only inserted if required. + * If this function fails the result variable 'formattedName' is cleared automatically. + * @param lastName reference to string variable where the "last name" is stored + * @param firstName reference to string variable where the "first name" is stored + * @param middleName reference to string variable where the "middle name" is stored + * @param namePrefix reference to string variable where the "name prefix" is stored + * @param nameSuffix reference to string variable where the "name suffix" is stored + * @param formattedName reference to string variable where the result is stored + * @return always returns EC_Normal + */ + static OFCondition getFormattedNameFromComponents(const OFString &lastName, + const OFString &firstName, + const OFString &middleName, + const OFString &namePrefix, + const OFString &nameSuffix, + OFString &formattedName); + + /** get DICOM Person Name (PN) from specified name components. + * The output format is "[lastName[^firstName[^middleName[^namePrefix[^nameSuffix]]]]]". + * Component groups are not (yet) supported. + * If this function fails the result variable 'dicomName' is cleared automatically. + * @param lastName reference to string variable where the "last name" is stored + * @param firstName reference to string variable where the "first name" is stored + * @param middleName reference to string variable where the "middle name" is stored + * @param namePrefix reference to string variable where the "name prefix" is stored + * @param nameSuffix reference to string variable where the "name suffix" is stored + * @param dicomName reference to string variable where the result is stored + * @return always returns EC_Normal + */ + static OFCondition getStringFromNameComponents(const OFString &lastName, + const OFString &firstName, + const OFString &middleName, + const OFString &namePrefix, + const OFString &nameSuffix, + OFString &dicomName); + + /** check whether given string value conforms to the VR "PN" (Person Name) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n", + const OFString &charset = ""); + +protected: + + /** @copydoc DcmCharString::getDelimiterChars() + */ + virtual const OFString& getDelimiterChars() const; + +private: + + /** an array containing the component group names, for XML and JSON output. + */ + static const char* const componentGroupNames[3]; +}; + + +#endif // DCVRPN_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrpobw.h b/dcmdata/include/dcmtk/dcmdata/dcvrpobw.h new file mode 100644 index 00000000..0183833e --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrpobw.h @@ -0,0 +1,246 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: + * Interface of class DcmPolymorphOBOW for Tags that can change their VR + * between OB and OW (e.g. Tag PixelData, OverlayData). This class shall + * not be used directly in applications. No identification exists. + * + */ + +#ifndef DCVRPOBW_H +#define DCVRPOBW_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcvrobow.h" + +/** a class representing DICOM elements (such as uncompressed pixel data) that can + * be interpreted either as OB or as OW, i.e. are polymorph. + */ +class DCMTK_DCMDATA_EXPORT DcmPolymorphOBOW : public DcmOtherByteOtherWord +{ +public: + + /** constructor + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmPolymorphOBOW( + const DcmTag & tag, + const Uint32 len = 0); + + /// copy constructor + DcmPolymorphOBOW( + const DcmPolymorphOBOW & old); + + /// destructor + virtual ~DcmPolymorphOBOW(); + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmPolymorphOBOW &operator=(const DcmPolymorphOBOW &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmPolymorphOBOW(*this); + } + + /** Comparison operator that compares the normalized value of this element + * with a given element of the same type (e.g. an DcmPolymorphOBOW with a + * DcmPolymorphOBOW). The tag of the element is also considered as the first + * component that is compared, followed by the object types (VR, i.e. DCMTK'S EVR). + * The DcmPolymorphOBOW implementation checks then whether the length of both + * elements are equal and if so continues comparing the values serialized to + * Little Endian using memcpy. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object than + * in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** This function reads the data value of an attribute which is + * captured in the input stream and captures this information + * in this. If not all information for an attribute could be + * read from the stream, the function returns EC_StreamNotifyClient. + * Note that if certain conditions are met, this function does + * not actually load the data value but creates and stores an object + * that enables us to load this information later. + * @param inStream The stream which contains the information. + * @param ixfer The transfer syntax which was used to encode + * the information in inStream. + * @param glenc Encoding type for group length; specifies what + * will be done with group length tags. + * @param maxReadLength Maximum read length for reading an attribute value. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read( + DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength); + + /** This function writes this element's value to the outstream which was + * passed. When writing information, the byte ordering (little or big endian) + * of the transfer syntax which was passed will be accounted for. In case the + * outstream does not provide enough space for all bytes of the current + * element's value, only a certain part of the value will be written to the + * stream. This element's transfer state indicates if the all bytes of value + * have already been written to the stream (ERW_ready), if the writing is + * still in progress and more bytes need to be written to the stream + * (ERW_inWork) or if the writing of the bytes of this element's value has not + * even begun yet (ERW_init). The member variable fTransferredBytes indicates + * how many bytes (starting from byte 0) of this element's value have already + * been written to the stream. This function will return EC_Normal, if the + * entire value of this element has been written to the stream, it will return + * EC_StreamNotifyClient, if there is no more space in the buffer and _not_ all + * bytes of this element's value have been written, and it will return some + * other (error) value if there was an error. + * @param outStream The stream the information will be written to. + * @param oxfer The transfer syntax which shall be used. + * @param enctype encoding types (undefined or explicit length) (actually unused) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** special write method for creation of digital signatures + * @param outStream DICOM output stream + * @param oxfer output transfer syntax + * @param enctype encoding types (undefined or explicit length) + * @param wcache pointer to write cache object, may be NULL + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSignatureFormat( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache); + + /** initialize the transfer state of this object. This method must be called + * before this object is written to a stream or read (parsed) from a stream. + */ + virtual void transferInit(); + + /** finalize the transfer state of this object. This method must be called + * when reading/writing this object from/to a stream has been completed. + */ + virtual void transferEnd(); + + /** get a pointer to the element value of the current element as type string. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint8Array(Uint8 *&val); // for bytes + + /** get a pointer to the element value of the current element as type Uint16. + * Requires element to be of corresponding VR, otherwise an error is returned. + * This method does not copy, but returns a pointer to the element value, + * which remains under control of this object and is valid only until the next + * read, write or put operation. + * @param val pointer to value returned in this parameter upon success + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition getUint16Array(Uint16 *&val); + + /** replace the element value by a copy of the given Uint8 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putUint8Array(const Uint8 *vals, const unsigned long num); + + /** replace the element value by a copy of the given Uint16 array (which is possibly multi-valued). + * Requires element to be of corresponding VR, otherwise an error is returned. + * @param vals new attribute value + * @param num number of values in array vals + * @return EC_Normal upon success, an error code otherwise + */ + virtual OFCondition putUint16Array(const Uint16 *vals, const unsigned long num); + + /** create an empty Uint8 array of given number of bytes and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to certain VRs, e.g. OB. + * @param numBytes number of bytes (8 bit) to be created + * @param bytes stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint8Array( + const Uint32 numBytes, + Uint8 * & bytes); + + + /** create an empty Uint16 array of given number of words and set it. + * All array elements are initialized with a value of 0 (using 'memzero'). + * This method is only applicable to OW data. + * @param numWords number of words (16 bit) to be created + * @param words stores the pointer to the resulting buffer + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createUint16Array( + const Uint32 numWords, + Uint16 * & words); + +private: + + /** this flag is used during write operations in Implicit VR Little Endian + * and notes that the VR has temporarily been changed from OB to OW + * at the beginning to the write operation and needs to be changed back once the + * operation has finished. + */ + OFBool changeVR; + + /// the current VR of value field, which can change over time + DcmEVR currentVR; + +}; +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrsh.h b/dcmdata/include/dcmtk/dcmdata/dcvrsh.h new file mode 100644 index 00000000..7e572f6c --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrsh.h @@ -0,0 +1,147 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: Interface of class DcmShortString + * + */ + + +#ifndef DCVRSH_H +#define DCVRSH_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcchrstr.h" + + +// forward declarations +class DcmJsonFormat; + + +/** a class representing the DICOM value representation 'Short String' (SH) + */ +class DCMTK_DCMDATA_EXPORT DcmShortString + : public DcmCharString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmShortString(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmShortString(const DcmShortString &old); + + /** destructor + */ + virtual ~DcmShortString(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmShortString &operator=(const DcmShortString &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmShortString(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_SH) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM. + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other specific character sets disable the check of the value representation. + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** write object in JSON format + * @param out output stream to which the JSON document is written + * @param format used to format and customize the output + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "SH" (Short String) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n", + const OFString &charset = ""); + +protected: + + /** @copydoc DcmCharString::getDelimiterChars() + */ + virtual const OFString& getDelimiterChars() const; +}; + + +#endif // DCVRSH_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrsl.h b/dcmdata/include/dcmtk/dcmdata/dcvrsl.h new file mode 100644 index 00000000..0928b5e4 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrsl.h @@ -0,0 +1,233 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmSignedLong + * + */ + + +#ifndef DCVRSL_H +#define DCVRSL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Signed Long' (SL) + */ +class DCMTK_DCMDATA_EXPORT DcmSignedLong + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmSignedLong(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmSignedLong(const DcmSignedLong &old); + + /** destructor + */ + virtual ~DcmSignedLong(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmSignedLong &operator=(const DcmSignedLong &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object than + * in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmSignedLong(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_SL) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular integer value + * @param sintVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSint32(Sint32 &sintVal, + const unsigned long pos = 0); + + /** get reference to stored integer data. + * The number of entries can be determined by "getVM()". + * @param sintVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSint32Array(Sint32 *&sintVals); + + /** get particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given integer + * @param sintVal signed integer value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putSint32(const Sint32 sintVal, + const unsigned long pos = 0); + + /** set element value to given integer array data + * @param sintVals signed integer data to be set + * @param numSints number of integer values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putSint32Array(const Sint32 *sintVals, + const unsigned long numSints); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "-333\-22\-1\0\1\22\333". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "-333\-22\-1\0\1\22\333". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /// @copydoc DcmElement::matches() + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmSignedLong(const DcmTag &tag, + const Uint32 len); +}; + + +#endif // DCVRSL_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrss.h b/dcmdata/include/dcmtk/dcmdata/dcvrss.h new file mode 100644 index 00000000..2febddfc --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrss.h @@ -0,0 +1,232 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmSignedShort + * + */ + + +#ifndef DCVRSS_H +#define DCVRSS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Signed Short' (SS) + */ +class DCMTK_DCMDATA_EXPORT DcmSignedShort + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmSignedShort(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmSignedShort(const DcmSignedShort &old); + + /** destructor + */ + virtual ~DcmSignedShort(); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmSignedShort &operator=(const DcmSignedShort &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmSignedShort(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_SS) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular integer value + * @param sintVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSint16(Sint16 &sintVal, + const unsigned long pos = 0); + + /** get reference to stored integer data + * @param sintVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSint16Array(Sint16 *&sintVals); + + /** get particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given integer + * @param sintVal signed integer value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putSint16(const Sint16 sintVal, + const unsigned long pos = 0); + + /** set element value to given integer array data + * @param sintVals signed integer data to be set + * @param numSints number of integer values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putSint16Array(const Sint16 *sintVals, + const unsigned long numSints); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "-333\-22\-1\0\1\22\333". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "-333\-22\-1\0\1\22\333". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /// @copydoc DcmElement::matches() + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmSignedShort(const DcmTag &tag, + const Uint32 len); +}; + + +#endif // DCVRSS_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrst.h b/dcmdata/include/dcmtk/dcmdata/dcvrst.h new file mode 100644 index 00000000..e012a469 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrst.h @@ -0,0 +1,158 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: Interface of class DcmShortText + * + */ + + +#ifndef DCVRST_H +#define DCVRST_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcchrstr.h" + + +/** a class representing the DICOM value representation 'Short Text' (ST) + */ +class DCMTK_DCMDATA_EXPORT DcmShortText + : public DcmCharString +{ + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmShortText(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmShortText(const DcmShortText &old ); + + /** destructor + */ + virtual ~DcmShortText(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmShortText &operator=(const DcmShortText &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmShortText(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_ST) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM. + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other specific character sets disable the check of the value representation. + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get the value multiplicity. + * Since the backslash "\" is not regarded as a separator the value + * multiplicity is always 1. + * @return value multiplicity of the currently stored value + */ + virtual unsigned long getVM(); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get the string value (all components) + * @param stringVal string variable in which the result value is stored + * @param normalize remove trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFStringArray(OFString &stringVal, + OFBool normalize = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "ST" (Short Text) + * @param value string value to be checked + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &charset = ""); +}; + + +#endif // DCVRST_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrsv.h b/dcmdata/include/dcmtk/dcmdata/dcvrsv.h new file mode 100644 index 00000000..ae81fe66 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrsv.h @@ -0,0 +1,229 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmSigned64bitVeryLong + * + */ + + +#ifndef DCVRSV_H +#define DCVRSV_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Signed 64-bit Very Long' (SV) + */ +class DCMTK_DCMDATA_EXPORT DcmSigned64bitVeryLong + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmSigned64bitVeryLong(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmSigned64bitVeryLong(const DcmSigned64bitVeryLong &old); + + /** destructor + */ + virtual ~DcmSigned64bitVeryLong(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmSigned64bitVeryLong &operator=(const DcmSigned64bitVeryLong &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object than + * in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmSigned64bitVeryLong(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_SV) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular integer value + * @param sintVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSint64(Sint64 &sintVal, + const unsigned long pos = 0); + + /** get reference to stored integer data. + * The number of entries can be determined by "getVM()". + * @param sintVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSint64Array(Sint64 *&sintVals); + + /** get particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given integer + * @param sintVal signed integer value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putSint64(const Sint64 sintVal, + const unsigned long pos = 0); + + /** set element value to given integer array data + * @param sintVals signed integer data to be set + * @param numSints number of integer values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putSint64Array(const Sint64 *sintVals, + const unsigned long numSints); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "-333\-22\-1\0\1\22\333". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "-333\-22\-1\0\1\22\333". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmSigned64bitVeryLong(const DcmTag &tag, + const Uint32 len); +}; + + +#endif // DCVRSV_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrtm.h b/dcmdata/include/dcmtk/dcmdata/dcvrtm.h new file mode 100644 index 00000000..295146be --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrtm.h @@ -0,0 +1,422 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Joerg Riesmeier + * + * Purpose: Interface of class DcmTime + * + */ + +#ifndef DCVRTM_H +#define DCVRTM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcbytstr.h" +#include "dcmtk/ofstd/oftime.h" + + +/** a class representing the DICOM value representation 'Time' (TM) + */ +class DCMTK_DCMDATA_EXPORT DcmTime + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmTime(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmTime(const DcmTime &old); + + /** destructor + */ + virtual ~DcmTime(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmTime &operator=(const DcmTime &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmTime(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_TM) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat support old ACR/NEMA format if OFTrue (':' as a separator) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringValue variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringValue, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set the element value to the current system time. + * The DICOM TM format supported by this function is "HHMM[SS[.FFFFFF]]" where + * the brackets enclose optional parts. If the current system time or parts of it + * are unavailable the corresponding values are set to "0" and an error code is + * returned. + * @param seconds add optional seconds ("SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setCurrentTime(const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse); + + /** set the element value to the given time + * @param timeValue time to be set (should be a valid time) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setOFTime(const OFTime &timeValue); + + /** get the current element value in OFTime format. + * Please note that the element value is expected to be in valid DICOM TM format + * ("[HH[MM[SS[.FFFFFF]]]]", "[HH[:MM[:SS[.FFFFFF]]]]" is also supported for reasons + * of backward compatibility). Since there is no time zone for the DICOM TM format + * local time is assumed (the time zone of 'timeValue' is set automatically). + * If this function fails the result variable 'timeValue' is cleared automatically. + * @param timeValue reference to OFTime variable where the result is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @param supportOldFormat if OFTrue support old (prior V3.0) time format (see above) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getOFTime(OFTime &timeValue, + const unsigned long pos = 0, + const OFBool supportOldFormat = OFTrue); + + /** get the current element value in ISO time format. + * The ISO time format supported by this function is "HH:MM[:SS[.FFFFFF]]" + * where the brackets enclose optional parts. Please note that the element value + * is expected to be in valid DICOM TM format ("[HH[MM[SS[.FFFFFF]]]]", + * "[HH[:MM[:SS[.FFFFFF]]]]" is also supported for reasons of backward compatibility). + * If this function fails or the current element value is empty, the result variable + * 'formattedTime' is cleared automatically. Please note that if the "Timezone Offset + * From UTC" attribute (0008,0201) is present, it applies to all TM attributes in the + * object. However, the time zone is not taken into account for the creation of the + * ISO formatted time. See also "getTimeZoneFromString()" below. + * @param formattedTime reference to string variable where the result is stored + * @param pos index of the element component in case of value multiplicity (0..vm-1) + * @param seconds add optional seconds (":SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @param createMissingPart if OFTrue create optional parts (seconds and/or fractional + * part of a seconds) if absent in the element value + * @param supportOldFormat if OFTrue support old (prior V3.0) time format (see above) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getISOFormattedTime(OFString &formattedTime, + const unsigned long pos = 0, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse, + const OFBool createMissingPart = OFFalse, + const OFBool supportOldFormat = OFTrue); + + // ensure inherited overloads of matches take part in overload resolution + using DcmByteString::matches; + + /// @copydoc DcmByteString::matches(OFString,OFString,OFBool) + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /* --- static helper functions --- */ + + /** get the current system time. + * The DICOM TM format supported by this function is "HHMM[SS[.FFFFFF]]" where + * the brackets enclose optional parts. If the current system time or parts of it + * are unavailable the corresponding values are set to "0" and an error code is + * returned. + * @param dicomTime reference to string variable where the result is stored + * @param seconds add optional seconds ("SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getCurrentTime(OFString &dicomTime, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse); + + /** get the specified OFTime value in DICOM format. + * The DICOM TM format supported by this function is "HHMM[SS[.FFFFFF]]" where + * the brackets enclose optional parts. If the current system time or parts of it + * are unavailable the corresponding values are set to "0" and an error code is + * returned. + * @param timeValue time to be converted to DICOM format + * @param dicomTime reference to string variable where the result is stored + * @param seconds add optional seconds ("SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getDicomTimeFromOFTime(const OFTime &timeValue, + OFString &dicomTime, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse); + + /** get the specified DICOM time value in OFTime format. + * Please note that the element value is expected to be in valid DICOM TM format + * ("HH[MM[SS[.FFFFFF]]]", "HH[:MM[:SS[.FFFFFF]]]" is also supported for reasons + * of backward compatibility). Since there is no time zone for the DICOM TM format + * local time is assumed (the time zone of 'timeValue' is set automatically). + * If this function fails the result variable 'timeValue' is cleared automatically. + * @param dicomTime string value in DICOM TM format to be converted to OFTime format. + * An empty string is not regarded as valid input, since the time would be unknown. + * @param timeValue reference to OFTime variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFTimeFromString(const OFString &dicomTime, + OFTime &timeValue); + + /** get the specified DICOM time value in OFTime format. + * Please note that the element value is expected to be in valid DICOM TM format + * ("HH[MM[SS[.FFFFFF]]]", "HH[:MM[:SS[.FFFFFF]]]" is also supported for reasons + * of backward compatibility). Since there is no time zone for the DICOM TM format + * local time is assumed (the time zone of 'timeValue' is set automatically). + * If this function fails the result variable 'timeValue' is cleared automatically. + * @param dicomTime string value in DICOM TM format to be converted to OFTime format. + * An empty string is not regarded as valid input, since the time would be unknown. + * @param timeValue reference to OFTime variable where the result is stored + * @param supportOldFormat set to OFFalse to disable support for old (prior V3.0) time + * format (see above). + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFTimeFromString(const OFString &dicomTime, + OFTime &timeValue, + const OFBool supportOldFormat); + + /** get the specified DICOM time value in OFTime format. + * Please note that the element value is expected to be in valid DICOM TM format + * ("HH[MM[SS[.FFFFFF]]]", "HH[:MM[:SS[.FFFFFF]]]" is also supported for reasons of + * backward compatibility). This overload of the function will set the time zone of + * 'timeValue' to the value given via the 'timeZone' parameter. + * If this function fails the result variable 'timeValue' is cleared automatically. + * @param dicomTime string value in DICOM TM format to be converted to OFTime format. + * An empty string is not regarded as valid input, since the time would be unknown. + * @param timeValue reference to OFTime variable where the result is stored + * @param supportOldFormat set to OFFalse to disable support for old (prior V3.0) time + * format (see above). + * @param timeZone the time zone to set for 'timeValue'. + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFTimeFromString(const OFString &dicomTime, + OFTime &timeValue, + const OFBool supportOldFormat, + const double timeZone); + + /** get the specified DICOM time value in OFTime format. + * Please note that the element value is expected to be in valid DICOM TM format + * ("HH[MM[SS[.FFFFFF]]]", "HH[:MM[:SS[.FFFFFF]]]" is also supported for reasons + * of backward compatibility). Since there is no time zone for the DICOM TM format + * local time is assumed (the time zone of 'timeValue' is set automatically). + * If this function fails the result variable 'timeValue' is cleared automatically. + * @param dicomTime string value in DICOM TM format to be converted to OFTime format. + * An empty string is not regarded as valid input, since the time would be unknown. + * @param dicomTimeSize the size (in bytes) of the string 'dicomTime' refers to + * @param timeValue reference to OFTime variable where the result is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFTimeFromString(const char *dicomTime, + const size_t dicomTimeSize, + OFTime &timeValue); + + /** get the specified DICOM time value in OFTime format. + * Please note that the element value is expected to be in valid DICOM TM format + * ("HH[MM[SS[.FFFFFF]]]", "HH[:MM[:SS[.FFFFFF]]]" is also supported for reasons + * of backward compatibility). Since there is no time zone for the DICOM TM format + * local time is assumed (the time zone of 'timeValue' is set automatically). + * If this function fails the result variable 'timeValue' is cleared automatically. + * @param dicomTime string value in DICOM TM format to be converted to OFTime format. + * An empty string is not regarded as valid input, since the time would be unknown. + * @param dicomTimeSize the size (in bytes) of the string 'dicomTime' refers to + * @param timeValue reference to OFTime variable where the result is stored + * @param supportOldFormat set to OFFalse to disable support for old (prior V3.0) time + * format (see above). + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFTimeFromString(const char *dicomTime, + const size_t dicomTimeSize, + OFTime &timeValue, + const OFBool supportOldFormat); + + /** get the specified DICOM time value in OFTime format. + * Please note that the element value is expected to be in valid DICOM TM format + * ("HH[MM[SS[.FFFFFF]]]", "HH[:MM[:SS[.FFFFFF]]]" is also supported for reasons of + * backward compatibility). This overload of the function will set the time zone of + * 'timeValue' to the value given via the 'timeZone' parameter. + * If this function fails the result variable 'timeValue' is cleared automatically. + * @param dicomTime string value in DICOM TM format to be converted to OFTime format. + * An empty string is not regarded as valid input, since the time would be unknown. + * @param dicomTimeSize the size (in bytes) of the string 'dicomTime' refers to + * @param timeValue reference to OFTime variable where the result is stored + * @param supportOldFormat set to OFFalse to disable support for old (prior V3.0) time + * format (see above). + * @param timeZone the time zone to set for 'timeValue'. + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getOFTimeFromString(const char *dicomTime, + const size_t dicomTimeSize, + OFTime &timeValue, + const OFBool supportOldFormat, + const double timeZone); + + /** get the specified DICOM time value in ISO format. + * The ISO time format supported by this function is "HH:MM[:SS[.FFFFFF]]" where the + * brackets enclose optional parts. Please note that the specified value is expected + * to be in valid DICOM TM format ("[HH[MM[SS[.FFFFFF]]]]", "[HH[:MM[:SS[.FFFFFF]]]]" + * is also supported for reasons of backward compatibility). If this function fails + * or the specified DICOM time value is empty, the result variable 'formattedTime' + * is cleared automatically. + * @param dicomTime string value in DICOM TM format to be converted to ISO format + * @param formattedTime reference to string variable where the result is stored + * @param seconds add optional seconds (":SS") if OFTrue + * @param fraction add optional fractional part of a second (".FFFFFF") if OFTrue + * (requires parameter 'seconds' to be also OFTrue) + * @param createMissingPart if OFTrue create optional parts (seconds and/or fractional + * part of a seconds) if absent in the DICOM TM value + * @param supportOldFormat set to OFFalse to disable support for old (prior V3.0) time + * format (see above). + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getISOFormattedTimeFromString(const OFString &dicomTime, + OFString &formattedTime, + const OFBool seconds = OFTrue, + const OFBool fraction = OFFalse, + const OFBool createMissingPart = OFFalse, + const OFBool supportOldFormat = OFTrue); + + /** get the specified DICOM time zone in number of hours format + * DICOM standard states that if the "Timezone Offset From UTC" attribute (0008,0201) is + * present it applies to all TM attributes in the object. This functions allows to convert + * the DICOM format ("&ZZZZ" where "&" is "+" or "-" and "ZZZZ" hours and minutes) to a + * floating point value, e.g. "+1.0" means plus one hour and "-2.5" minus two and a half + * hour, i.e. 2 hours and 30 minutes. + * The resulting 'timeZone' value can be used in conjuction with a OFTime object to convert + * the time to different time zones (e.g. to local time or UTC). + * @param dicomTimeZone string value in DICOM format ("&ZZZZ") to be converted + * @param timeZone reference to floating point variable where the resulting UTC offset is stored + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getTimeZoneFromString(const OFString &dicomTimeZone, + double &timeZone); + + /** get the specified DICOM time zone in number of hours format + * DICOM standard states that if the "Timezone Offset From UTC" attribute (0008,0201) is + * present it applies to all TM attributes in the object. This functions allows to convert + * the DICOM format ("&ZZZZ" where "&" is "+" or "-" and "ZZZZ" hours and minutes) to a + * floating point value, e.g. "+1.0" means plus one hour and "-2.5" minus two and a half + * hour, i.e. 2 hours and 30 minutes. + * The resulting 'timeZone' value can be used in conjuction with a OFTime object to convert + * the time to different time zones (e.g. to local time or UTC). + * @param dicomTimeZone string value in DICOM format ("&ZZZZ") to be converted + * @param timeZone reference to floating point variable where the resulting UTC offset is stored + * @param dicomTimeZoneSize the size (in bytes) of the string 'dicomTimeZone' refers to + * @return EC_Normal upon success, an error code otherwise + */ + static OFCondition getTimeZoneFromString(const char *dicomTimeZone, + const size_t dicomTimeZoneSize, + double &timeZone); + + /** check whether given string conforms to a single value of VR "TM" (Time). + * The old ACR/NEMA time format is considered invalid. + * @param dicomTime string value to be checked + * @param dicomTimeSize the size (in bytes) of the string 'dicomTime' refers to + * @return OFTrue if the given string conforms to the Time format, OFFalse otherwise + */ + static OFBool check(const char* dicomTime, const size_t dicomTimeSize); + + /** check whether given string conforms to a single value of VR "TM" (Time). + * @param dicomTime string value to be checked + * @param dicomTimeSize the size (in bytes) of the string 'dicomTime' refers to + * @param supportOldFormat whether to accept the old ACR/NEMA time format. + * Set to OFTrue for enabling support for (HH:MM:SS in addition to HHMMSS...). + * Defaults to OFFalse, disabling it by default. + * @return OFTrue if the given string conforms to the Time format, OFFalse otherwise + */ + static OFBool check(const char* dicomTime, /* STOP: DICOM time!! */ + const size_t dicomTimeSize, + const OFBool supportOldFormat); + + /** check whether given string value conforms to the VR "TM" (Time) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat support old ACR/NEMA time format if OFTrue (i.e. with ":" and "." delimiters) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + +private: + + /// give DcmDate access to our private parts, for combined date time range matching. + friend class DcmDate; + + /** parse the fragment part of a DICOM time string. + * @param string a pointer to the beginning of the fragment portion of a DICOM time string. + * @param size the size (in bytes) of the given string value. + * @param result a reference to a double value that will receive the result. + * @return OFTrue if the fragment was parsed successfully, OFFalse otherwise. + */ + static OFBool parseFragment(const char* string, const size_t size, double& result); +}; + + +#endif // DCVRTM_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvruc.h b/dcmdata/include/dcmtk/dcmdata/dcvruc.h new file mode 100644 index 00000000..f72add22 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvruc.h @@ -0,0 +1,129 @@ +/* + * + * Copyright (C) 2015-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmUnlimitedCharacters + * + */ + + +#ifndef DCVRUC_H +#define DCVRUC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcchrstr.h" + + +/** a class representing the DICOM value representation 'Unlimited Characters' (UC) + */ +class DCMTK_DCMDATA_EXPORT DcmUnlimitedCharacters + : public DcmCharString +{ + + public: + + /** constructor + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmUnlimitedCharacters(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmUnlimitedCharacters(const DcmUnlimitedCharacters &old); + + /** destructor + */ + virtual ~DcmUnlimitedCharacters(); + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmUnlimitedCharacters &operator=(const DcmUnlimitedCharacters &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUnlimitedCharacters(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_UC) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM. + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other specific character sets disable the check of the value representation. + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "UC" (Unlimited Characters) + * and to the specified VM. + * @param value string value to be checked + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n", + const OFString &charset = ""); +}; + + +#endif // DCVRUC_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrui.h b/dcmdata/include/dcmtk/dcmdata/dcvrui.h new file mode 100644 index 00000000..8bb800d4 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrui.h @@ -0,0 +1,175 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmUniqueIdentifier + * + */ + +#ifndef DCVRUI_H +#define DCVRUI_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcbytstr.h" + + +/** a class representing the DICOM value representation 'Unique Identifier' (UI) + */ +class DCMTK_DCMDATA_EXPORT DcmUniqueIdentifier + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmUniqueIdentifier(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmUniqueIdentifier(const DcmUniqueIdentifier &old); + + /** destructor + */ + virtual ~DcmUniqueIdentifier(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmUniqueIdentifier &operator=(const DcmUniqueIdentifier &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUniqueIdentifier(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_UI) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of string + * components. In case of a single component the UID number is mapped to the + * corresponding UID name (using "dcmFindNameOfUID()") if available. A "=" is + * used as a prefix to distinguish the UID name from the UID number. + * NB: This mapping of UID names only works for single-valued strings. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete trailing NULL-byte(s) if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set element value from the given character string. + * If the string starts with a "=" the subsequent characters are interpreted as a + * UID name and mapped to the corresponding UID number (using "dcmFindUIDFromName()") + * if possible. Otherwise the leading "=" is removed. + * NB: This mapping of UID names only works for single-valued input strings. + * @param stringVal input character string (possibly multi-valued) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * If the string starts with a "=" the subsequent characters are interpreted as a + * UID name and mapped to the corresponding UID number (using "dcmFindUIDFromName()") + * if possible. Otherwise the leading "=" is removed. + * NB: This mapping of UID names only works for single-valued input strings. + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string (possibly multi-valued) + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "UI" (Unique Identifier) + * and to the specified VM. + * @param value string value to be checked (possibly multi-valued) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &vm = "1-n"); + + protected: + + /** convert currently stored string value to internal representation. + * It removes any leading, embedded and trailing space character and recomputes + * the string length. This manipulation attempts to correct problems with + * incorrectly encoded UIDs which have been observed in some images. + * @param length number of characters of the string value (optional) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition makeMachineByteString(const Uint32 length = 0); +}; + + +#endif // DCVRUI_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrul.h b/dcmdata/include/dcmtk/dcmdata/dcvrul.h new file mode 100644 index 00000000..41a9a1de --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrul.h @@ -0,0 +1,234 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmUnsignedLong + * + */ + + +#ifndef DCVRUL_H +#define DCVRUL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Unsigned Long' (UL) + */ +class DCMTK_DCMDATA_EXPORT DcmUnsignedLong + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmUnsignedLong(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmUnsignedLong(const DcmUnsignedLong &old); + + /** destructor + */ + virtual ~DcmUnsignedLong(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmUnsignedLong &operator=(const DcmUnsignedLong &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUnsignedLong(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_UL) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular integer value + * @param uintVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint32(Uint32 &uintVal, + const unsigned long pos = 0); + + /** get reference to stored integer data. + * The number of entries can be determined by "getVM()". + * @param uintVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint32Array(Uint32 *&uintVals); + + /** get particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given integer + * @param uintVal unsigned integer value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint32(const Uint32 uintVal, + const unsigned long pos = 0); + + /** set element value to given integer array data + * @param uintVals unsigned integer data to be set + * @param numUints number of integer values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint32Array(const Uint32 *uintVals, + const unsigned long numUints); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "1\22\333\4444\55555\666666\7777777". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "1\22\333\4444\55555\666666\7777777". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /// @copydoc DcmElement::matches() + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmUnsignedLong(const DcmTag &tag, + const Uint32 len); + +}; + + +#endif // DCVRUL_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrulup.h b/dcmdata/include/dcmtk/dcmdata/dcvrulup.h new file mode 100644 index 00000000..3304423e --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrulup.h @@ -0,0 +1,137 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmUnsignedLongOffset + * + */ + + +#ifndef DCVRULUP_H +#define DCVRULUP_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrul.h" + +class DcmDirectoryRecord; +class DcmItem; + +/** a class used for DICOMDIR byte offsets + */ +class DCMTK_DCMDATA_EXPORT DcmUnsignedLongOffset + : public DcmUnsignedLong +{ + + public: + + // Make friend with DcmDirectoryRecord and DcmItem which require access + // to protected constructor allowing construction using an explicit + // value length. + friend class DcmDirectoryRecord; + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmUnsignedLongOffset(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmUnsignedLongOffset(const DcmUnsignedLongOffset &old); + + /** destructor + */ + virtual ~DcmUnsignedLongOffset(); + + /** assignment operator. + * @param obj the offset to be copied + * @return reference to this object + */ + DcmUnsignedLongOffset &operator=(const DcmUnsignedLongOffset &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUnsignedLongOffset(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (internal type: EVR_up) + */ + virtual DcmEVR ident() const; + + /** clear the currently stored value + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition clear(); + + /** get stored object reference + * @return pointer to the currently referenced object (might be NULL) + */ + virtual DcmObject *getNextRecord(); + + /** set stored object reference + * @param record pointer to the object to be referenced + * @return pointer to the newly referenced object (might be NULL) + */ + virtual DcmObject *setNextRecord(DcmObject *record); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + private: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmUnsignedLongOffset(const DcmTag &tag, + const Uint32 len); + + /// pointer to the referenced object. NULL means that no object is referenced. + DcmObject *nextRecord; +}; + + +#endif // DCVRULUP_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrur.h b/dcmdata/include/dcmtk/dcmdata/dcvrur.h new file mode 100644 index 00000000..50413ad2 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrur.h @@ -0,0 +1,167 @@ +/* + * + * Copyright (C) 2014-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmUniversalResourceIdentifierOrLocator + * + */ + + +#ifndef DCVRUR_H +#define DCVRUR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcbytstr.h" + + +/** a class representing the DICOM value representation 'Universal Resource Identifier or + * Universal Resource Locator (URI/URL)' (UR) + */ +class DCMTK_DCMDATA_EXPORT DcmUniversalResourceIdentifierOrLocator + : public DcmByteString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmUniversalResourceIdentifierOrLocator(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmUniversalResourceIdentifierOrLocator(const DcmUniversalResourceIdentifierOrLocator &old); + + /** destructor + */ + virtual ~DcmUniversalResourceIdentifierOrLocator(); + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmUniversalResourceIdentifierOrLocator &operator=(const DcmUniversalResourceIdentifierOrLocator &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUniversalResourceIdentifierOrLocator(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_UR) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get the value multiplicity. + * Since the backslash "\" is not regarded as a separator the value + * multiplicity is always 1. + * @return value multiplicity of the currently stored value + */ + virtual unsigned long getVM(); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get the string value (all components) + * @param stringVal string variable in which the result value is stored + * @param normalize remove trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFStringArray(OFString &stringVal, + OFBool normalize = OFTrue); + + // ensure inherited overloads of matches take part in overload resolution + using DcmByteString::matches; + + /// @copydoc DcmByteString::matches(OFString,OFString,OFBool) + virtual OFBool matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + /// @copydoc DcmElement::isUniversalMatch() + virtual OFBool isUniversalMatch(const OFBool normalize = OFTrue, + const OFBool enableWildCardMatching = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "UR" (Universal Resource Identifier + * or Universal Resource Locator, URI/URL) + * @param value string value to be checked + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value); +}; + + +#endif // DCVRUR_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrus.h b/dcmdata/include/dcmtk/dcmdata/dcvrus.h new file mode 100644 index 00000000..3f935e3a --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrus.h @@ -0,0 +1,233 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Interface of class DcmUnsignedShort + * + */ + + +#ifndef DCVRUS_H +#define DCVRUS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Unsigned Short' (US) + */ +class DCMTK_DCMDATA_EXPORT DcmUnsignedShort + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmUnsignedShort(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmUnsignedShort(const DcmUnsignedShort &old); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** destructor + */ + virtual ~DcmUnsignedShort(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmUnsignedShort &operator=(const DcmUnsignedShort &obj); + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUnsignedShort(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_US) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular integer value + * @param uintVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint16(Uint16 &uintVal, + const unsigned long pos = 0); + + /** get reference to stored integer data. + * The number of entries can be determined by "getVM()". + * @param uintVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint16Array(Uint16 *&uintVals); + + /** get particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given integer + * @param uintVal unsigned integer value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint16(const Uint16 uintVal, + const unsigned long pos = 0); + + /** set element value to given integer array data + * @param uintVals unsigned integer data to be set + * @param numUints number of integer values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint16Array(const Uint16 *uintVals, + const unsigned long numUints); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "1\22\333\4444\55555". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "1\22\333\4444\55555". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + /// @copydoc DcmElement::matches() + virtual OFBool matches(const DcmElement& candidate, + const OFBool enableWildCardMatching = OFTrue) const; + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmUnsignedShort(const DcmTag &tag, + const Uint32 len); +}; + + +#endif // DCVRUS_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvrut.h b/dcmdata/include/dcmtk/dcmdata/dcvrut.h new file mode 100644 index 00000000..3b8121b9 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvrut.h @@ -0,0 +1,160 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Interface of class DcmUnlimitedText + * + */ + + +#ifndef DCVRUT_H +#define DCVRUT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcchrstr.h" + + +/** a class representing the DICOM value representation 'Unlimited Text' (UT) + */ +class DCMTK_DCMDATA_EXPORT DcmUnlimitedText + : public DcmCharString +{ + + public: + + /** constructor. + * Create new element from given tag and length. + * @param tag attribute tag + * @param len length of the attribute value + */ + DcmUnlimitedText(const DcmTag &tag, + const Uint32 len = 0); + + /** copy constructor + * @param old element to be copied + */ + DcmUnlimitedText(const DcmUnlimitedText &old); + + /** destructor + */ + virtual ~DcmUnlimitedText(); + + /** copy assignment operator + * @param obj element to be copied + * @return reference to this object + */ + DcmUnlimitedText &operator=(const DcmUnlimitedText &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object than + * in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUnlimitedText(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_UT) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM. + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other specific character sets disable the check of the value representation. + * @param vm parameter not used for this VR + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "", + const OFBool oldFormat = OFFalse); + + /** get the value multiplicity. + * Since the backslash "\" is not regarded as a separator the value + * multiplicity is always 1. + * @return value multiplicity of the currently stored value + */ + virtual unsigned long getVM(); + + /** get a copy of a particular string component + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize delete leading and trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** get the string value (all components) + * @param stringVal string variable in which the result value is stored + * @param normalize remove trailing spaces if OFTrue + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFStringArray(OFString &stringVal, + OFBool normalize = OFTrue); + + /* --- static helper functions --- */ + + /** check whether given string value conforms to the VR "UT" (Unlimited Text) + * @param value string value to be checked + * @param charset character set (according to the value of the SpecificCharacterSet + * element) to be used for checking the string value. The default is ASCII (7-bit). + * Currently, the VR checker only supports ASCII (ISO_IR 6) and Latin-1 (ISO_IR 100). + * All other values disable the check of the value representation, e.g. "UNKNOWN". + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + static OFCondition checkStringValue(const OFString &value, + const OFString &charset = ""); +}; + + +#endif // DCVRUT_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcvruv.h b/dcmdata/include/dcmtk/dcmdata/dcvruv.h new file mode 100644 index 00000000..04db9bd8 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcvruv.h @@ -0,0 +1,230 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface of class DcmUnsigned64bitVeryLong + * + */ + + +#ifndef DCVRUV_H +#define DCVRUV_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcelem.h" + + +/** a class representing the DICOM value representation 'Unsigned 64-bit Very Long' (UV) + */ +class DCMTK_DCMDATA_EXPORT DcmUnsigned64bitVeryLong + : public DcmElement +{ + + public: + + // Make friend with DcmItem which requires access to protected + // constructor allowing construction using an explicit value length. + friend class DcmItem; + + /** constructor. + * Create new element from given tag. + * @param tag DICOM tag for the new element + */ + DcmUnsigned64bitVeryLong(const DcmTag &tag); + + /** copy constructor + * @param old element to be copied + */ + DcmUnsigned64bitVeryLong(const DcmUnsigned64bitVeryLong &old); + + /** destructor + */ + virtual ~DcmUnsigned64bitVeryLong(); + + /** assignment operator + * @param obj element to be assigned/copied + * @return reference to this object + */ + DcmUnsigned64bitVeryLong &operator=(const DcmUnsigned64bitVeryLong &obj); + + /** comparison operator that compares the normalized value of this object + * with a given object of the same type. The tag of the element is also + * considered as the first component that is compared, followed by the + * object types (VR, i.e. DCMTK'S EVR) and the comparison of all value + * components of the object, preferably in the order declared in the + * object (if applicable). + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if this element has fewer components than the rhs element. + * Also -1 if the value of the first component that does not match + * is lower in this object than in rhs. Also returned if rhs + * cannot be casted to this object type or both objects are of + * different VR (i.e. the DcmEVR returned by the element's ident() + * call are different). + * 1 if either this element has more components than the rhs element, or + * if the first component that does not match is greater in this object + * than in rhs object. + */ + virtual int compare(const DcmElement& rhs) const; + + /** clone method + * @return deep copy of this object + */ + virtual DcmObject *clone() const + { + return new DcmUnsigned64bitVeryLong(*this); + } + + /** Virtual object copying. This method can be used for DcmObject + * and derived classes to get a deep copy of an object. Internally + * the assignment operator is called if the given DcmObject parameter + * is of the same type as "this" object instance. If not, an error + * is returned. This function permits copying an object by value + * in a virtual way which therefore is different to just calling the + * assignment operator of DcmElement which could result in slicing + * the object. + * @param rhs - [in] The instance to copy from. Has to be of the same + * class type as "this" object + * @return EC_Normal if copying was successful, error otherwise + */ + virtual OFCondition copyFrom(const DcmObject& rhs); + + /** get element type identifier + * @return type identifier of this class (EVR_UV) + */ + virtual DcmEVR ident() const; + + /** check whether stored value conforms to the VR and to the specified VM + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * @param oldFormat parameter not used for this VR (only for DA, TM) + * @return status of the check, EC_Normal if value is correct, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &vm = "1-n", + const OFBool oldFormat = OFFalse); + + /** get value multiplicity + * @return number of values in this element + */ + virtual unsigned long getVM(); + + /** get number of values stored in this element + * @return number of values in this element + */ + virtual unsigned long getNumberOfValues(); + + /** print element to a stream. + * The output format of the value is a backslash separated sequence of numbers. + * @param out output stream + * @param flags optional flag used to customize the output (see DCMTypes::PF_xxx) + * @param level current level of nested items. Used for indentation. + * @param pixelFileName not used + * @param pixelCounter not used + */ + virtual void print(STD_NAMESPACE ostream &out, + const size_t flags = 0, + const int level = 0, + const char *pixelFileName = NULL, + size_t *pixelCounter = NULL); + + /** get particular integer value + * @param uintVal reference to result variable (cleared in case of error) + * @param pos index of the value to be retrieved (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint64(Uint64 &uintVal, + const unsigned long pos = 0); + + /** get reference to stored integer data. + * The number of entries can be determined by "getVM()". + * @param uintVals reference to result variable + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUint64Array(Uint64 *&uintVals); + + /** get particular value as a character string + * @param stringVal variable in which the result value is stored + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param normalize not used + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize = OFTrue); + + /** set particular element value to given integer + * @param uintVal unsigned integer value to be set + * @param pos index of the value to be set (0 = first position) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint64(const Uint64 uintVal, + const unsigned long pos = 0); + + /** set element value to given integer array data + * @param uintVals unsigned integer data to be set + * @param numUints number of integer values to be set + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putUint64Array(const Uint64 *uintVals, + const unsigned long numUints); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "1\22\333\4444\55555\666666\7777777". + * @param stringVal input character string + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal); + + /** set element value from the given character string. + * The input string is expected to be a backslash separated sequence of + * numeric characters, e.g. "1\22\333\4444\55555\666666\7777777". + * The length of the string has to be specified explicitly. The string can, therefore, + * also contain more than one NULL byte. + * @param stringVal input character string + * @param stringLen length of the string (number of characters without the trailing + * NULL byte) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition putString(const char *stringVal, + const Uint32 stringLen); + + /** check the currently stored element value + * @param autocorrect correct value length if OFTrue + * @return status, EC_Normal if value length is correct, an error code otherwise + */ + virtual OFCondition verify(const OFBool autocorrect = OFFalse); + + protected: + + /** constructor. Create new element from given tag and length. + * Only reachable from friend classes since construction with + * length different from 0 leads to a state with length being set but + * the element's value still being uninitialized. This can lead to crashes + * when the value is read or written. Thus the method calling this + * constructor with length > 0 must ensure that the element's value is + * explicitly initialized, too. + * @param tag DICOM tag for the new element + * @param len value length for the new element + */ + DcmUnsigned64bitVeryLong(const DcmTag &tag, + const Uint32 len); + +}; + + +#endif // DCVRUV_H diff --git a/dcmdata/include/dcmtk/dcmdata/dcwcache.h b/dcmdata/include/dcmtk/dcmdata/dcwcache.h new file mode 100644 index 00000000..e5ec08da --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcwcache.h @@ -0,0 +1,136 @@ +/* + * + * Copyright (C) 2007-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: file cache facility for DcmElement::getPartialValue + * + */ + + +#ifndef DCWCACHE_H +#define DCWCACHE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftypes.h" /* for Uint8 */ +#include "dcmtk/dcmdata/dcfcache.h" /* for class DcmFileCache */ + +class DcmElement; +class DcmOutputStream; + +#define DcmWriteCacheBufsize 65536 /* buffer size, in bytes */ + +/** This class implements a buffering mechanism that is used when writing large + * elements that reside in file into an output stream. DcmElement::getPartialValue + * is used to fill the buffer maintained by this class, and the buffer content + * is then copied to the output stream. The intermediate buffer is necessary + * because both DcmElement::getPartialValue and DcmOutputStream::write expect + * a buffer to write to and read from, respectively. + */ +class DCMTK_DCMDATA_EXPORT DcmWriteCache +{ +public: + + /// default constructor. Construction is cheap (no allocation of memory block). + DcmWriteCache() + : fcache_() + , buf_(NULL) + , owner_(NULL) + , offset_(0) + , numBytes_(0) + , capacity_(0) + , fieldLength_(0) + , fieldOffset_(0) + , byteOrder_(EBO_unknown) + { + } + + /// destructor + ~DcmWriteCache() + { + delete[] buf_; + } + + /** initialize the buffer maintained by this class. Can safely be called multiple times. + * @param owner current "owner" (DcmElement instance using this buffer) + * @param fieldLength number of bytes of user data in DICOM element + * @param bytesTransferred number of bytes of user data in DICOM element that have already been transferred + * @param byteOrder byteOrder desired byte order in buffer + */ + void init(void *owner, Uint32 fieldLength, Uint32 bytesTransferred, E_ByteOrder byteOrder); + + /** check whether the buffer is currently empty + * @return true if buffer is empty, false otherwise + */ + OFBool bufferIsEmpty() const { return (numBytes_ == 0); } + + /** return the number of bytes of user data currently in buffer + * @return number of bytes of user data currently in buffer + */ + Uint32 contentLength() const { return numBytes_; } + + /** fill buffer from given DICOM element if buffer is currently empty. + * This method uses DcmElement::getPartialValue to fill the buffer from the given + * DICOM element at the given offset (which is updated to reflect the number of bytes + * read into the buffer). + * @param elem DICOM element to read from + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition fillBuffer(DcmElement& elem); + + /** write buffer content to output stream + * @param outStream output stream to write to + * @return number of bytes written + */ + Uint32 writeBuffer(DcmOutputStream &outStream); + +private: + + /// private undefined copy constructor + DcmWriteCache(const DcmWriteCache& arg); + + /// private undefined copy assignment operator + DcmWriteCache& operator=(const DcmWriteCache& arg); + + /// file cache object + DcmFileCache fcache_; + + /// write buffer + Uint8 *buf_; + + /// current "owner" (DcmElement instance using this buffer) + void *owner_; + + /// offset within buffer to first byte + Uint32 offset_; + + /// number of user data bytes currently in buffer + Uint32 numBytes_; + + /// buffer size in bytes + Uint32 capacity_; + + /// length of the current DICOM element, in bytes + Uint32 fieldLength_; + + /// offset within the current DICOM element, in bytes + Uint32 fieldOffset_; + + /// current output byte order + E_ByteOrder byteOrder_; +}; + +#endif diff --git a/dcmdata/include/dcmtk/dcmdata/dcxfer.h b/dcmdata/include/dcmtk/dcmdata/dcxfer.h new file mode 100644 index 00000000..bd0d99e2 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/dcxfer.h @@ -0,0 +1,356 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: Handling of transfer syntaxes + * + */ + +#ifndef DCXFER_H +#define DCXFER_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcvr.h" + +// include this file in doxygen documentation + +/** @file dcxfer.h + * @brief definition and handling of transfer syntaxes + */ + +/** enumeration of all DICOM transfer syntaxes known to the toolkit + */ +typedef enum { + /// unknown transfer syntax or dataset created in-memory + EXS_Unknown = -1, + /// Implicit VR Little Endian + EXS_LittleEndianImplicit = 0, + /// Implicit VR Big Endian (pseudo transfer syntax that does not really exist) + EXS_BigEndianImplicit = 1, + /// Explicit VR Little Endian + EXS_LittleEndianExplicit = 2, + /// Explicit VR Big Endian + EXS_BigEndianExplicit = 3, + /// JPEG Baseline (lossy) + EXS_JPEGProcess1 = 4, + /// JPEG Extended Sequential (lossy, 8/12 bit) + EXS_JPEGProcess2_4 = 5, + /// JPEG Extended Sequential (lossy, 8/12 bit), arithmetic coding + EXS_JPEGProcess3_5 = 6, + /// JPEG Spectral Selection, Non-Hierarchical (lossy, 8/12 bit) + EXS_JPEGProcess6_8 = 7, + /// JPEG Spectral Selection, Non-Hierarchical (lossy, 8/12 bit), arithmetic coding + EXS_JPEGProcess7_9 = 8, + /// JPEG Full Progression, Non-Hierarchical (lossy, 8/12 bit) + EXS_JPEGProcess10_12 = 9, + /// JPEG Full Progression, Non-Hierarchical (lossy, 8/12 bit), arithmetic coding + EXS_JPEGProcess11_13 = 10, + /// JPEG Lossless with any selection value + EXS_JPEGProcess14 = 11, + /// JPEG Lossless with any selection value, arithmetic coding + EXS_JPEGProcess15 = 12, + /// JPEG Extended Sequential, Hierarchical (lossy, 8/12 bit) + EXS_JPEGProcess16_18 = 13, + /// JPEG Extended Sequential, Hierarchical (lossy, 8/12 bit), arithmetic coding + EXS_JPEGProcess17_19 = 14, + /// JPEG Spectral Selection, Hierarchical (lossy, 8/12 bit) + EXS_JPEGProcess20_22 = 15, + /// JPEG Spectral Selection, Hierarchical (lossy, 8/12 bit), arithmetic coding + EXS_JPEGProcess21_23 = 16, + /// JPEG Full Progression, Hierarchical (lossy, 8/12 bit) + EXS_JPEGProcess24_26 = 17, + /// JPEG Full Progression, Hierarchical (lossy, 8/12 bit), arithmetic coding + EXS_JPEGProcess25_27 = 18, + /// JPEG Lossless, Hierarchical + EXS_JPEGProcess28 = 19, + /// JPEG Lossless, Hierarchical, arithmetic coding + EXS_JPEGProcess29 = 20, + /// JPEG Lossless, Selection Value 1 + EXS_JPEGProcess14SV1 = 21, + /// Run Length Encoding (lossless) + EXS_RLELossless = 22, + /// Deflated Explicit VR Little Endian + EXS_DeflatedLittleEndianExplicit = 23, + /// JPEG-LS (lossless) + EXS_JPEGLSLossless = 24, + /// JPEG-LS (lossless or near-lossless mode) + EXS_JPEGLSLossy = 25, + /// JPEG 2000 (lossless) + EXS_JPEG2000LosslessOnly = 26, + /// JPEG 2000 (lossless or lossy) + EXS_JPEG2000 = 27, + /// JPEG 2000 part 2 multi-component extensions (lossless) + EXS_JPEG2000MulticomponentLosslessOnly = 28, + /// JPEG 2000 part 2 multi-component extensions (lossless or lossy) + EXS_JPEG2000Multicomponent = 29, + /// JPIP Referenced + EXS_JPIPReferenced = 30, + /// JPIP Referenced Deflate + EXS_JPIPReferencedDeflate = 31, + /// MPEG2 Main Profile at Main Level + EXS_MPEG2MainProfileAtMainLevel = 32, + /// MPEG2 Main Profile at High Level + EXS_MPEG2MainProfileAtHighLevel = 33, + /// MPEG4 High Profile / Level 4.1 + EXS_MPEG4HighProfileLevel4_1 = 34, + /// MPEG4 BD-compatible High Profile / Level 4.1 + EXS_MPEG4BDcompatibleHighProfileLevel4_1 = 35, + /// MPEG4 High Profile / Level 4.2 For 2D Video + EXS_MPEG4HighProfileLevel4_2_For2DVideo = 36, + /// MPEG4 High Profile / Level 4.2 For 3D Video + EXS_MPEG4HighProfileLevel4_2_For3DVideo = 37, + /// MPEG4 Stereo High Profile / Level 4.2 + EXS_MPEG4StereoHighProfileLevel4_2 = 38, + /// HEVC/H.265 Main Profile / Level 5.1 + EXS_HEVCMainProfileLevel5_1 = 39, + /// HEVC/H.265 Main 10 Profile / Level 5.1 + EXS_HEVCMain10ProfileLevel5_1 = 40, + /// Private GE Little Endian Implicit with big endian pixel data + EXS_PrivateGE_LEI_WithBigEndianPixelData = 41 +} E_TransferSyntax; + +/** enumeration of byte orders + */ +typedef enum { + /// unknown + EBO_unknown = 0, + + /// little endian + EBO_LittleEndian = 1, + + /// big endian + EBO_BigEndian = 2 +} E_ByteOrder; + +/** enumeration of VR encoding options + */ +typedef enum { + /// implicit VR encoding + EVT_Implicit = 0, + + /// explicit VR encoding + EVT_Explicit = 1 +} E_VRType; + +/** enumeration of pixel data encapsulation options + */ +typedef enum { + /// pixel data not encapsulated + EJE_NotEncapsulated = 0, + + /// pixel data encapsulated + EJE_Encapsulated = 1 +} E_JPEGEncapsulated; + +/** enumeration of stream compression techniques + */ +typedef enum +{ + /// no stream compression + ESC_none = 0 + /// unsupported stream compression + , ESC_unsupported = 1 +#ifdef WITH_ZLIB + /// zlib stream compression. + /// This enum value only available if DCMTK is compiled with ZLIB support enabled. + , ESC_zlib = 2 +#endif +} E_StreamCompression; + + +/** a class that allows for a lookup of Transfer Syntax properties and readable descriptions + */ +class DCMTK_DCMDATA_EXPORT DcmXfer +{ +public: + /** constructor + * @param xfer transfer syntax enum + */ + DcmXfer( E_TransferSyntax xfer ); + + /** constructor + * @param xferName_xferID transfer syntax name as string + */ + DcmXfer( const char *xferName_xferID ); + + /// copy constructor + DcmXfer( const DcmXfer &newXfer ); + + /// destructor + ~DcmXfer(); + + /// assignment operator for transfer syntax enum + DcmXfer & operator = ( const E_TransferSyntax xfer ); + + /// copy assignment operator + DcmXfer & operator = ( const DcmXfer &newtag ); + + /// return transfer syntax enum for this transfer syntax + inline E_TransferSyntax getXfer() const { return xferSyn; } + + /// return byte order for this transfer syntax + inline E_ByteOrder getByteOrder() const { return byteOrder; } + + /// return byte order for this transfer syntax + inline E_ByteOrder getPixelDataByteOrder() const { return pixelDataByteOrder; } + + /// return name string for this transfer syntax + inline const char* getXferName() const { return xferName; } + + /// return UID string for this transfer syntax + inline const char* getXferID() const { return xferID; } + + /// return true if transfer syntax is little endian, false otherwise + inline OFBool isLittleEndian() const + { + return byteOrder == EBO_LittleEndian; + } + + /// return true if transfer syntax is big endian, false otherwise + inline OFBool isBigEndian() const { return byteOrder == EBO_BigEndian; } + + /// return true if transfer syntax is implicit VR, false otherwise + inline OFBool isImplicitVR() const { return vrType == EVT_Implicit; } + + /// return true if transfer syntax is explicit VR, false otherwise + inline OFBool isExplicitVR() const { return vrType == EVT_Explicit; } + + /// return true if transfer syntax is encapsulated, false otherwise + inline OFBool isEncapsulated() const + { + return encapsulated == EJE_Encapsulated; + } + + /// return true if transfer syntax is native (non-encapsulated), false otherwise + inline OFBool isNotEncapsulated() const + { + return encapsulated == EJE_NotEncapsulated; + } + + /** return 8-bit JPEG process ID for this transfer syntax. + * Lossy JPEG transfer syntaxes support two alternative JPEG encoding processes - 8 and 12 bits. + * When called for a non-JPEG transfer syntax, returns 0. + * @return 8-bit JPEG process ID + */ + inline Uint32 getJPEGProcess8Bit() const { return JPEGProcess8; } + + /** return 12-bit JPEG process ID for this transfer syntax. + * Lossy JPEG transfer syntaxes support two alternative JPEG encoding processes - 8 and 12 bits. + * When called for a non-JPEG transfer syntax, returns 0. + * @return 12-bit JPEG process ID + */ + inline Uint32 getJPEGProcess12Bit() const { return JPEGProcess12;} + + /** check whether transfer syntax uses a lossy compression + * @return true if transfer syntax uses a lossy compression, false otherwise + */ + inline OFBool isLossy() const + { + return lossy; + } + + /** check whether transfer syntax uses a lossless compression or no compression + * @return true if transfer syntax uses a lossless compression or no compression, + * false otherwise + */ + inline OFBool isLossless() const + { + return !lossy; + } + + /** check whether transfer syntax is retired + * @return true if transfer syntax is retired, false otherwise + */ + inline OFBool isRetired() const + { + return retired; + } + + /** get stream compression type for this transfer syntax + * @return stream compression type for this transfer syntax + */ + inline E_StreamCompression getStreamCompression() const + { + return streamCompression; + } + + /** check whether transfer syntax uses (0028,7FE0) Pixel Data Provider URL + * to reference pixel data + * @return true if transfer syntax uses URL reference to pixel data + */ + inline OFBool isReferenced() const + { + return referenced; + } + + /** return the number of bytes needed to describe the tag, length, VR + * and any reserved fields for this transfer syntax when encoding the + * specified VR. + * @param evr value representation to be encoded in this transfer syntax + * @return number of bytes needed + */ + Uint32 sizeofTagHeader(DcmEVR evr) const; + +private: + /// transfer syntax UID + const char *xferID; + + /// transfer syntax name + const char *xferName; + + /// transfer syntax enum + E_TransferSyntax xferSyn; + + /// transfer syntax byte order + E_ByteOrder byteOrder; + + /// transfer syntax byte order for pixel data + E_ByteOrder pixelDataByteOrder; + + /// transfer syntax VR encoding (implicit/explicit) + E_VRType vrType; + + /// transfer syntax encapsulated or native + E_JPEGEncapsulated encapsulated; + + /// 8-bit lossy JPEG process ID for this transfer syntax, 0 if not applicable + Uint32 JPEGProcess8; + + /// 12-bit lossy JPEG process ID for this transfer syntax, 0 if not applicable + Uint32 JPEGProcess12; + + /// flag indicating whether this transfer syntax uses a lossy compression + OFBool lossy; + + /// flag indicating whether this transfer syntax has been retired from DICOM + OFBool retired; + + /// transfer syntax stream compression type + E_StreamCompression streamCompression; + + /// flag indicating whether this transfer syntax uses a pixel data URL reference + OFBool referenced; + +}; + +/** global constant describing the byte order on the machine the application + * is currently executing on. This is runtime and not compile time information + * because of "fat" binaries that can be executed on multiple CPU types (e.g. NeXTStep) + */ +extern DCMTK_DCMDATA_EXPORT const E_ByteOrder gLocalByteOrder; + +#endif // DCXFER_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2d.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2d.h new file mode 100644 index 00000000..cb1fb08a --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2d.h @@ -0,0 +1,263 @@ +/* + * + * Copyright (C) 2001-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class to control conversion of image format to DICOM + * + */ + +#ifndef I2D_H +#define I2D_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" +#include "dcmtk/dcmdata/libi2d/i2dimgs.h" +#include "dcmtk/dcmdata/dcpixel.h" + +class DCMTK_I2D_EXPORT Image2Dcm +{ + +public: + + /** Constructor, initializes command line options + * @return none + */ + Image2Dcm(); + + /** Start the conversion. Needs a fully configured input plugin + * and a fully configured output plugin to operate. Returns + * a dataset with the resulting DICOM object. + * @param inputPlug - [in] The input plugin to read pixel data + * @param outPlug - [in] The output plugin for specific SOP class output + * @param resultDset - [out] The DICOM object resulting from the conversion + * @param proposedTS - [out] The proposed transfer syntax (needed e. g. + * by JPEG input plugin) + * @return EC_Normal, if successfull, error otherwise + */ + OFCondition convert(I2DImgSource *inputPlug, + I2DOutputPlug *outPlug, + DcmDataset*& resultDset, + E_TransferSyntax& proposedTS); + + /** Sets a DICOM file that should serve as a template for the resulting + * DICOM object. Only the dataset of the given file is imported. + * @param file - [in] The filename of the template DICOM file + * @return none + */ + void setTemplateFile(const OFString& file); + + /** Set file from which patient/study/series data should be imported from. + * @param file - [in] The DICOM file to read from + * @return none + */ + void setSeriesFrom(const OFString& file); + + /** Set file from which patient/study/series data should be imported from. + * @param file - [in] The DICOM file to read from + * @return none + */ + void setStudyFrom(const OFString& file); + + /** Enables/Disables incrementing instance number taken over from DICOM file. + * This can either be a the study/series file or the template file + * provided. + * @param incInstNo - [in] If true, the instance number will be incremented + * @return none + */ + void setIncrementInstanceNumber(OFBool incInstNo); + + /** Enables/disables autotmatic insertion of the value "ISO_IR100" as + * a value for the Specific Character Set attribute. If disabled, + * no value is inserted for Specifific Character Set but instead + * must be provided by other means (see setTemplateFile(), setSeriesFrom(), + * setStudyFrom(), setOverrideKeys()). The insertion is applied after + * loading the (optional) template file; the value might be overwritten + * by the value copied by setStudy/Series/OverrideKeys. + * @param insertLatin1 - [in] Enable/disable insertion of Iso Latin 1 + * @return none; + */ + void setISOLatin1(OFBool insertLatin1); + + /** Specifies some attributes that should be inserted after conversion. + * They will override any identical attributes already existing in the + * converted result DICOM object. The override keys are applied at the very + * end of the conversion and do not undergoe any validity checking. + * @param ovkeys [in] override keys that can be tags, dictionary names + * and paths (see DcmPath for syntax). Also it is + * permitted to set a value if appropriate, e. g. + * "PatientName=Doe^John" would be a valid override + * key. + * @return none + */ + void setOverrideKeys(const OFList& ovkeys); + + /** Enable/Disable basic validity checks for output dataset + * @param doChecks - [in] OFTrue enables checking, OFFalse turns it off. + * @param insertMissingType2 - [in] If true (default), missing type 2 + * attributes are inserted automatically + * @param inventMissingType1 - [in] If true , missing type 1 + * attributes are inserted automatically with a predefined + * value (if possible). An existing empty type 1 attribute is + * assigned a value, too. + * @return none + */ + void setValidityChecking(OFBool doChecks, + OFBool insertMissingType2 = OFTrue, + OFBool inventMissingType1 = OFTrue); + + /** Destructor, frees plugin memory + * @return none + */ + ~Image2Dcm(); + +protected: + + /** Cleans up template for future insertion of pixel data information, ie + * generally removes attributes from image pixel module + * @param targetDset - [out] The dataset that should be cleand up + * @return none + */ + void cleanupTemplate(DcmDataset *targetDset); + + /** Parses patient/study/series level attributes from file as defined + * on command line and fills internal attributes accordingly. + * @param targetDset - [out] The dataset to write the attributes to + * @return EC_Normal, if successful, error otherwise + */ + OFCondition applyStudyOrSeriesFromFile(DcmDataset *targetDset); + + /** Increments instance number in given dataset + * @param targetDset - [in/out] Dataset to increment instance number in + * @return EC_Normal, if successful, error otherwise + */ + OFCondition incrementInstanceNumber(DcmDataset *targetDset); + + /** Generates and inserts missing UIDs, ie UIDs not taken over + * from --dataset-from --study from and --series-from options + * @param dset - [in] The dataset to write the UIDs to + * @return EC_Normal, if successful, error otherwise + */ + OFCondition generateUIDs(DcmDataset *dset); + + /** Reads pixel data and corresponding attributes like rows etc. from image + * file and inserts them into dataset. + * @param imageSource - [in] The input plugin that actually reads the pixel data + * @param dset - [out] The dataset to export the pixel data attributes to + * @param outputTS - [out] The proposed transfex syntax of the dataset + * @return EC_Normal, if successful, error otherwise + */ + OFCondition readAndInsertPixelData( I2DImgSource* imageSource, + DcmDataset* dset, + E_TransferSyntax& outputTS); + + /** Do some completeness / validity checks. Should be called when + * dataset is completed and is about to be saved. + * @param dataset - [in] The dataset to check + * @return Error string if error occurs, empty string otherwise + */ + OFString isValid(DcmDataset& dataset) const; + + /** Copy override keys over existing keys in given dataset. + * @param outputDset - [out] dataset to which the override keys are copied + * @return Error code if error occurs, EC_Normal otherwise + */ + OFCondition applyOverrideKeys(DcmDataset *outputDset); + + /** Inserts "ISO_IR100" in the attribute "Specific Character Set". + * Overwrites any existing value. + * @param outputDset - [out] The dataset to write to + * @return EC_Normal if insertion is successfull, error code otherwise + */ + OFCondition insertLatin1(DcmDataset *outputDset); + + /** Check whether given type 1 attribute is present and has a length > 0. + * @param key - [in] The attribute tag check + * @param targetDset - [out] targetDset + * @param defaultValue - [in] value to be inserted if attribute is missing + * (needs invent option for type 1 attributes enabled) + * @return A string with an error message if attribute is not present + * or has length of 0 + */ + OFString checkAndInventType1Attrib(const DcmTagKey& key, + DcmDataset* targetDset, + const OFString& defaultValue = "") const; + + + /** Inserts an empty element with the given tag into a dataset + * @param key - [in] The attribute tag to check + * @param targetDset - [out] targetDset + * @return A string with an error message if attribute is not present + * nor gets inserted automatically (see m_inventMissingType2Attribs) + */ + OFString checkAndInventType2Attrib(const DcmTagKey& key, + DcmDataset* targetDset) const; + +private: + + /** Correctly inserts encapsulated pixel data. + * @param dset [in] - The dataset to which we should add this. + * @param pixData [in] - The data to add. + * @param length [in] - The length of pixData. + * @param outputTS [in] - The output transfer syntax to be used + * @return EC_Normal, if successfull, error otherwise. + */ + OFCondition insertEncapsulatedPixelData(DcmDataset* dset, + char *pixData, + Uint32 length, + const E_TransferSyntax& outputTS) const; + + /* Attributes for writing DICOM dataset */ + + /// These attributes are applied to the dataset after conversion + /// (and are not checked by the isValid() function) + OFList m_overrideKeys; + + /// If not empty, the DICOM file specified in this variable is used + /// as a base for the DICOM image file to be created, ie. all attributes + /// are taken over from this template file + OFString m_templateFile; + + /// If true, patient and study data is read from file + OFBool m_readStudyLevel; + + /// If true, patient, study and series data is read from file + OFBool m_readSeriesLevel; + + /// File to read study and series from + OFString m_studySeriesFile; + + /// If true, Instance Number ist read from file and incremented by 1 + OFBool m_incInstNoFromFile; + + /// If true, some simple attribute checks (missing type 2 attributes or + /// missing type 1 values) are omitted + OFBool m_disableAttribChecks; + + /// If true, missing type 2 elements are inserted automatically (empty value). + /// Enabled per default. + OFBool m_inventMissingType2Attribs; + + /// If true, missing type 1 elements are inserted automatically with a + /// predefined value, if possible. Disabled per default. + OFBool m_inventMissingType1Attribs; + + /// If enabled, ISO_IR100 (ISO Latin 1) is inserted as a standard value + /// for attribute "Specific Character Set". Insertion takes place after + /// loading (optional) template file. + OFBool m_insertLatin1; +}; + +#endif // I2D_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2dbmps.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dbmps.h new file mode 100644 index 00000000..4db84793 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dbmps.h @@ -0,0 +1,227 @@ +/* + * + * Copyright (C) 2009-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: Class to extract pixel data and meta information from BMP file + * + */ + +#ifndef I2DBMPS_H +#define I2DBMPS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/libi2d/i2dimgs.h" +#include "dcmtk/ofstd/offile.h" + +/** This is a I2DImgSource implementation that can parse BMP files and convert + * them into DICOM images. + */ +class DCMTK_I2D_EXPORT I2DBmpSource : public I2DImgSource +{ + +public: + + /** Constructor, initializes member variables + * @return none + */ + I2DBmpSource(); + + /** Returns format of input image. For this class "BMP" is returned. + * @return Returns format of input image, i.e. "BMP". + */ + OFString inputFormat() const; + + /** Extracts the raw BMP pixel data stream from a BMP file and returns some + * further information about this pixel data. Raw means that any header + * information is removed from the BMP stream. + * This function allocates memory for the pixel data returned to the user. + * The caller of this function is responsible for deleting the memory buffer. + * @param rows - [out] Rows of image + * @param cols - [out] Columns of image + * @param samplesPerPixel - [out] Number of components per pixel + * @param photoMetrInt - [out] The DICOM color model used for the compressed data + * @param bitsAlloc - [out] Bits Allocated for one sample + * @param bitsStored - [out] Bits Stored, Number of bits actually stored within + * Bits Allocated + * @param highBit - [out] High Bit, Highest stored in bit within Bits Allocated + * @param pixelRepr - [out] Pixel Representation (0=unsigned, 1=signed) + * @param planConf - [out] Planar Configuration + * @param pixAspectH - [out] Horizontal value of pixel aspect ratio + * @param pixAspectV - [out] Vertical value of pixel aspect ratio + * @param pixData - [out] Pointer to the pixel data in BMP Interchange Format + * @param length - [out] Length of pixel data + * @param ts - [out] The transfer syntax imposed by the imported pixel pixel data + * @return EC_Normal, if successful, error otherwise + */ + OFCondition readPixelData( Uint16& rows, + Uint16& cols, + Uint16& samplesPerPixel, + OFString& photoMetrInt, + Uint16& bitsAlloc, + Uint16& bitsStored, + Uint16& highBit, + Uint16& pixelRepr, + Uint16& planConf, + Uint16& pixAspectH, + Uint16& pixAspectV, + char*& pixData, + Uint32& length, + E_TransferSyntax& ts); + + /** After reading of pixel data, this function can be used for getting + * information about lossy compression parameters. + * @param srcEncodingLossy - [out] Always returns OFFalse (i.e. lossless) + * @param srcLossyComprMethod - [out] Unused parameter + * @return EC_Normal if information is available, error otherwise + */ + virtual OFCondition getLossyComprInfo(OFBool& srcEncodingLossy, + OFString& /* srcLossyComprMethod */) const + { + srcEncodingLossy = OFFalse; + return EC_Normal; + } + + /** Destructor, frees some memory. + * @return none + */ + virtual ~I2DBmpSource(); + +protected: + + /** Opens the BMP file specified by the given filename. + * @param filename - [in] The file to be opened + * @return EC_Normal, if successful, error otherwise + */ + OFCondition openFile(const OFString& filename); + + /** Closes BMP file. + * @return none + */ + void closeFile(); + + /** Reads and checks the BMP file header. + * @param offset - [out] Offset to the BMP data from beginning of file + * @return EC_Normal, if successful, error otherwise + */ + OFCondition readFileHeader(Uint32 &offset); + + /** Reads and checks the BMP bitmap header. + * After this function, the current read position is just after the + * header. That is, at the beginning of the color palette. + * @param width - [out] width of the image in pixel + * @param height - [out] height of the image in pixel + * @param isTopDown - [out] OFTrue if this is a top down bitmap + * (height was read as negative value). OFFalse otherwise. + * @param bpp - [out] bits per pixel of the image. + * @param colors - [out] number of entries in color table. + * @return EC_Normal, if successful, error otherwise + */ + OFCondition readBitmapHeader(Uint16 &width /*out*/, + Uint16 &height /*out*/, + Uint16 &bpp /*out*/, + OFBool &isTopDown /*out*/, + Uint16 &colors /*out*/); + + /** Read the color palette from the file. + * @param colors - [in] number of colors to read + * @param palette - [out] the read color palette is stored here + * @return EC_Normal, if successful, error otherwise + */ + OFCondition readColorPalette(Uint16 colors, + Uint32*& palette); + + /** Read the bitmap data. + * This assumes the current read position is at the start of the image data. + * @param width - [in] width of the image in pixel + * @param height - [in] height of the image in pixel + * @param bpp - [in] Image's bits per pixel. + * @param isTopDown - [in] If true, this is a top down bitmap + * @param colors - [in] Number of color palette entries + * @param palette - [in] Color palette + * @param pixData - [out] Image data + * @param length - [out] Length of data + * @return EC_Normal, if successful, error otherwise + */ + OFCondition readBitmapData(const Uint16 width, + const Uint16 height, + const Uint16 bpp, + const OFBool isTopDown, + const Uint16 colors, + const Uint32* palette, + char*& pixData /*out*/, + Uint32& length /*out*/); + + /** Parse a single 24bpp or 32bpp row of BMP data. + * @param row - [in] The row of data to parse. + * @param width - [in] The length in pixel of the row. + * @param bpp - [in] The number of bits per pixel. + * @param pixData - [out] The buffer to write the data to (in "RGB" format). + * @return EC_Normal, if successful, error otherwise + */ + OFCondition parse24_32BppRow(const Uint8 *row, + const Uint16 width, + const int bpp, + char *pixData /*out*/) const; + + /** Parse a single 16bpp row of BMP data. + * @param row - [in] The row of data to parse. + * @param width - [in] The length in pixel of the row. + * @param pixData - [out] The buffer to write the data to (in "RGB" format). + * @return EC_Normal, if successful, error otherwise + */ + OFCondition parse16BppRow(const Uint8 *row, + const Uint16 width, + char *pixData /*out*/) const; + + /** Parse a single 1, 4 or 8bpp row of BMP data. + * @param row - [in] The row of data to parse. + * @param width - [in] The length in pixel of the row. + * @param bpp - [in] The number of bits per pixel. + * @param colors - [in] The number of entries in the color palette. + * @param palette - [in] The color palette to use. + * @param pixData - [out] The buffer to write the data to (in "RGB" format). + * @return EC_Normal, if successful, error otherwise + */ + OFCondition parseIndexedColorRow(const Uint8 *row, + const Uint16 width, + const int bpp, + const Uint16 colors, + const Uint32* palette, + char *pixData /*out*/) const; + + /** Read 4 bytes from the byte stream and interpret it as a signed integer. + * @param result - [out] The result + * @return 0, if successful, EOF if rest of stream does not contain enough bytes + */ + int readLong(Sint32& result); + + /** Read 4 bytes from the byte stream. + * @param result - [out] The result + * @return 0, if successful, EOF if rest of stream does not contain enough bytes + */ + int readDWord(Uint32& result); + + /** Read 2 bytes from the byte stream. + * @param result - [out] The result + * @return 0, if successful, EOF if rest of stream does not contain enough bytes + */ + int readWord(Uint16& result); + + /// The BMP file, if opened + OFFile bmpFile; +}; + +#endif // I2DBMPS_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2define.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2define.h new file mode 100644 index 00000000..9f485644 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2define.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef I2DEFINE_H +#define I2DEFINE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef i2d_EXPORTS +#define DCMTK_I2D_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_I2D_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif // DCDEFINE_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2dimgs.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dimgs.h new file mode 100644 index 00000000..83b3b555 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dimgs.h @@ -0,0 +1,117 @@ +/* + * + * Copyright (C) 2007-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Base Class for plugins extracting pixel data from standard + * image files + * + */ + +#ifndef I2DIMGS_H +#define I2DIMGS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/libi2d/i2define.h" + +/** Base Class for plugins extracting pixel data from standard image files + */ +class DCMTK_I2D_EXPORT I2DImgSource +{ + +public: + + /** Constructor + */ + I2DImgSource() : m_imageFile() {} + + /** Returns identifier for the image input format the plugin imports. + * @return A short identifier of the input format + */ + virtual OFString inputFormat() const = 0; + + /** Extracts the raw pixel data stream from image file and returns some further + * information about this pixel data. + * This function allocates memory for the pixel data returned to the user. + * The caller of this function is responsible for deleting the memory buffer + * @param rows - [out] Rows of image + * @param cols - [out] Columns of image + * @param samplesPerPixel - [out] Number of components per pixel + * @param photoMetrInt - [out] The DICOM color model used for the compressed data + * @param bitsAlloc - [out] Bits Allocated for one sample + * @param bitsStored - [out] Bits Stored, number of bits stored within Bits Allocated + * @param highBit - [out] High Bit, highest bit position set within Bits Allocated + * @param pixelRepr - [out] Pixel Representation (0=unsigned, 1=signed) + * @param planConf - [out] Planar Configuration + * @param pixAspectH - [out] Horizontal value of pixel aspect ratio + * @param pixAspectV - [out] Vertical value of pixel aspect ratio + * @param pixData - [out] Pointer to the pixel data + * @param length - [out] Length of pixel data + * @param ts - [out] The transfer syntax imposed by the imported pixel pixel data + * @return EC_Normal, if successful, error otherwise + */ + virtual OFCondition readPixelData( Uint16& rows, + Uint16& cols, + Uint16& samplesPerPixel, + OFString& photoMetrInt, + Uint16& bitsAlloc, + Uint16& bitsStored, + Uint16& highBit, + Uint16& pixelRepr, + Uint16& planConf, + Uint16& pixAspectH, + Uint16& pixAspectV, + char*& pixData, + Uint32& length, + E_TransferSyntax& ts) =0; + + /** After reading of pixel data, this function can be used for getting + * information about lossy compression parameters. + * @param srcEncodingLossy - [out] Denotes, whether the encoding of the pixel + * data read was lossy (OFTrue) or lossless (OFFalse) + * @param srcLossyComprMethod - [out] Denotes the lossy compression method used + * in source if there is one (srcEncodingLossy = OFTrue). + * Should use defined terms of attribute Lossy + * Compression Method. + * @return EC_Normal if information is available, error otherwise + */ + virtual OFCondition getLossyComprInfo(OFBool& srcEncodingLossy, + OFString& srcLossyComprMethod) const = 0; + + /** Sets the input image file to read. + * @param filename - [in] The filename of the image input file + * @return none + */ + void setImageFile(const OFString& filename) { m_imageFile = filename; }; + + /** Returns the input image file that currently associated with plugin + * @return The filename of the image input file + */ + OFString getImageFile() { return m_imageFile; }; + + /** Virtual Destructor + */ + virtual ~I2DImgSource() {} + +protected: + + /// The input file + OFString m_imageFile; +}; + +#endif // I2DIMGS_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2djpgs.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2djpgs.h new file mode 100644 index 00000000..4e4d4040 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2djpgs.h @@ -0,0 +1,353 @@ +/* + * + * Copyright (C) 2007-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class to extract pixel data and meta information from JPEG file + * + */ + +#ifndef I2DJPGS_H +#define I2DJPGS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/offile.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/dcmdata/libi2d/i2dimgs.h" + +/** + * JPEG markers consist of one or more 0xFF bytes, followed by a marker code byte + * (which is not an FF). This enum lists the second byte of all these markers. + * @note RESn markers are not fully listed, but only the first (RES0) and the + * last (RESN) + */ +enum E_JPGMARKER { E_JPGMARKER_SOF0 = 0xC0, E_JPGMARKER_SOF1 = 0xC1, E_JPGMARKER_SOF2 = 0xC2, + E_JPGMARKER_SOF3 = 0xC3, /*C4 and CC are not SOF markers,*/ E_JPGMARKER_SOF5 = 0xC5, + E_JPGMARKER_SOF6 = 0xC6, E_JPGMARKER_SOF7 = 0xC7, E_JPGMARKER_JPG = 0xC8, + E_JPGMARKER_SOF9 = 0xC9, E_JPGMARKER_SOF10 = 0xCA, E_JPGMARKER_SOF11 = 0xCB, + E_JPGMARKER_SOF13 = 0xCD, E_JPGMARKER_SOF14 = 0xCE, E_JPGMARKER_SOF15 = 0xCF, + E_JPGMARKER_DHT = 0xC4, E_JPGMARKER_DAC = 0xCC, E_JPGMARKER_RST0 = 0xD0, + E_JPGMARKER_RST1 = 0xD1, E_JPGMARKER_RST2 = 0xD2, E_JPGMARKER_RST3 = 0xD3, + E_JPGMARKER_RST4 = 0xD4, E_JPGMARKER_RST5 = 0xD5, E_JPGMARKER_RST6 = 0xD6, + E_JPGMARKER_RST7 = 0xD7, E_JPGMARKER_SOI = 0xD8, E_JPGMARKER_EOI = 0xD9, + E_JPGMARKER_SOS = 0xDA, E_JPGMARKER_DQT = 0xDB, E_JPGMARKER_DNL = 0xDC, + E_JPGMARKER_DRI = 0xDD, E_JPGMARKER_DHP = 0xDE, E_JPGMARKER_EXP = 0xDF, + E_JPGMARKER_APP0 = 0xE0, E_JPGMARKER_APP1 = 0xE1, E_JPGMARKER_APP2 = 0xE2, + E_JPGMARKER_APP3 = 0xE3, E_JPGMARKER_APP4 = 0xE4, E_JPGMARKER_APP5 = 0xE5, + E_JPGMARKER_APP6 = 0xE6, E_JPGMARKER_APP7 = 0xE7, E_JPGMARKER_APP8 = 0xE8, + E_JPGMARKER_APP9 = 0xE9, E_JPGMARKER_APP10 = 0xEA, E_JPGMARKER_APP11 = 0xEB, + E_JPGMARKER_APP12 = 0xEC, E_JPGMARKER_APP13 = 0xED, E_JPGMARKER_APP14 = 0xEE, + E_JPGMARKER_APP15 = 0xEF, E_JPGMARKER_JPGN0 = 0xF0, E_JPGMARKER_JPGN1 = 0xF1, + E_JPGMARKER_JPGN2 = 0xF2, E_JPGMARKER_JPGN3 = 0xF3, E_JPGMARKER_JPGN4 = 0xF4, + E_JPGMARKER_JPGN5 = 0xF5, E_JPGMARKER_JPGN6 = 0xF6, E_JPGMARKER_JPGN7 = 0xF7, + E_JPGMARKER_JPGN8 = 0xF8, E_JPGMARKER_JPGN9 = 0xF9, E_JPGMARKER_JPGN10 = 0xFA, + E_JPGMARKER_JPGN11 = 0xFB, E_JPGMARKER_JPGN12 = 0xFC, E_JPGMARKER_JPGN13 = 0xFD, + E_JPGMARKER_COM = 0xFE, E_JPGMARKER_TEM = 0x01, E_JPGMARKER_RES0 = 0x02, + E_JPGMARKER_RESN = 0xBF }; + +/** + * Struct that represents a marker in a JPEG file, i.e. it consists + * of the byte position of the marker and the marker code itself + */ +struct DCMTK_I2D_EXPORT JPEGFileMapEntry { + /// The byte position of the marker + offile_off_t bytePos; + /// The marker byte itself + E_JPGMARKER marker; +}; + + +/** This is a I2DImgSource implementation that can parse JPEG files and convert + * them into DICOM images. + */ +class DCMTK_I2D_EXPORT I2DJpegSource : public I2DImgSource +{ + +public: + + /** Constructor, initializes member variables + * @return none + */ + I2DJpegSource(); + + /** Returns format of input image. For this class "JPEG" is returned. + * @return Returns format of input image, i.e. "JPEG". + */ + OFString inputFormat() const; + + /** Extracts the raw JPEG pixel data stream from a JPEG file and returns some + * further information about this pixel data. Raw means here that all APP + * markers (e.g. JFIF information) are removed from the JPEG stream. + * The pixel data returned is a JPEG stream in JPEG interchange format. + * This function allocates memory for the pixel data returned to the user. + * The caller of this function is responsible for deleting the memory buffer. + * @param rows - [out] Rows of image + * @param cols - [out] Columns of image + * @param samplesPerPixel - [out] Number of components per pixel + * @param photoMetrInt - [out] The DICOM color model used for the compressed data + * @param bitsAlloc - [out] Bits Allocated for one sample + * @param bitsStored - [out] Bits Stored, Number of bits actually stored within + * Bits Allocated + * @param highBit - [out] High Bit, Highest stored in bit within Bits Allocated + * @param pixelRepr - [out] Pixel Representation (0=unsigned, 1=signed) + * @param planConf - [out] Planar Configuration + * @param pixAspectH - [out] Horizontal value of pixel aspect ratio + * @param pixAspectV - [out] Vertical value of pixel aspect ratio + * @param pixData - [out] Pointer to the pixel data in JPEG Interchange Format + * (but without APPx markers). + * @param length - [out] Length of pixel data + * @param ts - [out] The transfer syntax imposed by the imported pixel pixel + * data. This is necessary for the JPEG importer that needs + * to report which TS must be used for the imported JPEG data + * (ie. baseline, progressive, ...). + * @return EC_Normal, if successful, error otherwise + */ + OFCondition readPixelData( Uint16& rows, + Uint16& cols, + Uint16& samplesPerPixel, + OFString& photoMetrInt, + Uint16& bitsAlloc, + Uint16& bitsStored, + Uint16& highBit, + Uint16& pixelRepr, + Uint16& planConf, + Uint16& pixAspectH, + Uint16& pixAspectV, + char*& pixData, + Uint32& length, + E_TransferSyntax& ts); + + /** After reading of pixel data, this function can be used for getting + * information about lossy compression parameters. + * @param srcEncodingLossy - [out] Denotes, whether the encoding of the pixel + * data read was lossy (OFTrue) or lossless (OFFalse) + * @param srcLossyComprMethod - [out] Denotes the lossy compression method used + * in source if there is one (srcEncodingLossy = OFTrue). + * Should use defined terms of attribute Lossy + * Compression Method. + * @return EC_Normal if information is available, error otherwise + */ + OFCondition getLossyComprInfo(OFBool& srcEncodingLossy, + OFString& srcLossyComprMethod) const; + + /** Enable/Disable support for Extended Sequential JPEG Coding + * @param enabled - [in] OFTrue: support Extended Sequential, + * OFFalse: do not support + * @return none + */ + void setExtSeqSupport(const OFBool enabled); + + /** Enable/Disable support for Progressive JPEG Coding + * @param enabled - [in] OFTrue: support Extended Sequential, + * OFFalse: do not support + * @return none + */ + void setProgrSupport(const OFBool enabled); + + /** If enabled, conversion will only take place if JFIF data could be found + * and evaluated. Many digital cameras do not provide a JFIF header, so this + * is disabled by default. + */ + void setInsistOnJFIF(const OFBool enabled); + + /** If enabled, APPn markers (except JFIF!) are also copied to the output file. + * This can cause a huge speedup because instead of parsing the whole + * JPEG file (for finding any APPn markers) the parsing stops after finding + * the SOFn marker (which is relevant for extracting width/height and so on. + * Default: false + * @param enabled - [in] OFTrue: copy APPn, OFFalse: cut off APPn info + * @return none + */ + void setKeepAPPn(const OFBool enabled); + + /** Returns a string representation of a JPEG marker code. + * @param marker - [in] The marker to be converted + * @return A string representation of the marker + */ + static OFString jpegMarkerToString(const E_JPGMARKER& marker); + + /** Destructor, frees some memory. + * @return none + */ + ~I2DJpegSource(); + +protected: + + /** Opens the JPEG file specified by the given filename. + * @param filename - [in] The file to be opened + * @return EC_Normal, if successful, error otherwise + */ + OFCondition openFile(const OFString& filename); + + /** Closes JPEG file. + * @return A string representation of the marker + */ + void closeFile(); + + /** Function that scans a JPEG file and creates a "file map" which + * includes all JPEG markers and their byte positions in the file. + * @return EC_Normal, if successful, error otherwise + */ + OFCondition createJPEGFileMap(); + + /** Dump the internal JPEG file map to a given stream. The file map + * lists JPEG markers and their position in the bitstream found in the JPEG + * file + * @return none + */ + void debugDumpJPEGFileMap() const; + + /** Get image parameters as found at given SOF marker of the JPEG image. + * @param entry - [in] This specifies the marker and the byte position of the + * SOF marker + * @param imageWidth - [out] The width of the image + * @param imageHeight - [out] The height of the image + * @param samplesPerPixel - [out] Number of components per pixel + * @param bitsPerSample - [out] Number of bits per pixel component + * @return EC_Normal, if successful, error otherwise + */ + OFCondition getSOFImageParameters( const JPEGFileMapEntry& entry, + Uint16& imageWidth, + Uint16& imageHeight, + Uint16& samplesPerPixel, + Uint16& bitsPerSample); + + /** Get JPEG parameters as found at given JFIF marker of the JPEG image. + * @param entry - [in] This specifies the marker and the byte position of the + * JFIF marker + * @param jfifVersion - [out] The JFIF version of the JFIF data + * @param pixelAspectH - [out] The horizontal pixel aspect ratio + * @param pixelAspectV - [out] The vertical pixel aspect ratio + * @param unit - [out] The contents of the pixel aspect ratio unit field + * @return EC_Normal, if successful, error otherwise + */ + OFCondition getJFIFImageParameters( const JPEGFileMapEntry& entry, + Uint16& jfifVersion, + Uint16& pixelAspectH, + Uint16& pixelAspectV, + Uint16& unit); + + /** Check, whether a given JPEG image marker (SOFn) is supported by + * this plugin + * @param jpegEncoding - [in] Image marker that should be tested + * @return EC_Normal, marker is supported, error otherwise + */ + OFCondition isJPEGEncodingSupported(const E_JPGMARKER& jpegEncoding) const; + + + /** Returns if possible the DICOM transfer syntax matching the coding of the + * JPEG data. + * @param jpegEncoding - [in] Image marker that should be tested + * @return EC_Normal, marker is supported, error otherwise + */ + static E_TransferSyntax associatedTS(const E_JPGMARKER& jpegEncoding); + + /** Returns true if marker is one of the RST0 to RST7 markers + * @param jpegEncoding - [in] Image marker that should be tested + * @return OFTrue, if marker is RST0 to RST7, OFFalse otherwise + */ + static OFBool isRSTMarker(const E_JPGMARKER& jpegEncoding); + + /** Returns true if marker is one of the SOF0 to SOF15 markers + * @param jpegEncoding - [in] Image marker that should be tested + * @return OFTrue, if marker is SOF0 to SOF15, OFFalse otherwise + */ + static OFBool isSOFMarker(const E_JPGMARKER& jpegEncoding); + + + /** Extract raw JPEG stream (i.e. without APPn markers) from JPEG file. + * @param pixelData - [out] The resulting JPEG stream + * @param pixLength - [out] The length of the resulting stream + * @return EC_Normal, if successful, error otherwise + */ + OFCondition extractRawJPEGStream(char*& pixelData, + Uint32& pixLength); + + /** Copies JPEG stream (with APPn markers, excluding JFIF) from JPEG file. + * @param pixelData - [out] The resulting JPEG stream + * @param pixLength - [out] The length of the resulting stream + * @return EC_Normal, if successful, error otherwise + */ + OFCondition copyJPEGStream(char*& pixelData, + Uint32& pixLength); + + /** Skips one marker while scanning through the JPEG file stream. + * @return EC_Normal, if successful, error otherwise + */ + OFCondition skipVariable(); + + /** Tries to read the SOI marker. + * @param result - [out] The code of the SOI marker if successful (0xD8) + * @return EC_Normal, if successful, error otherwise + */ + OFCondition firstMarker(E_JPGMARKER& result); + + /** Tries to find the next JPEG marker in underlying file stream. + * @param lastWasSOSMarker - [in] Denotes, whether the last marker read + * before was the SOS (start of scan) marker. This is needed to + * ignore non-marker 0xFF occurrences in the compressed data. + * @param result - [out] The result marker + * @return EC_Normal, if successful, error otherwise + */ + OFCondition nextMarker(const OFBool& lastWasSOSMarker, + E_JPGMARKER& result); + + /** Read 2 bytes from the byte stream. + * @param result - [out] The result + * @return 0, if successful, EOF if rest of stream does not contain enough bytes + */ + inline int read2Bytes(Uint16& result); + + /** Read 1 byte from the byte stream. + * @param result - [out] The result + * @return 0, if successful, EOF if rest of stream does not contain enough bytes + */ + inline int read1Byte(Uint8& result); + + /** Deletes internal JPEG file map and frees memory. + * @return none + */ + void clearMap(); + + /// JPEG file map. This map includes all JPEG markers and their byte positions + /// in the JPEG file. + OFList m_jpegFileMap; + + /// The JPEG file, if opened + OFFile jpegFile; + + /// If true, JPEGs with progressive coding are not supported + OFBool m_disableProgrTs; + + /// If true, JPEGs with extended sequential coding are not supported + OFBool m_disableExtSeqTs; + + /// If true, conversion will only work if JFIF header can be found. + /// Default: false + OFBool m_insistOnJFIF; + + /// If true, APPn markers (except JFIF!) are also copied to the output file. + /// This can cause a huge speedup because instead of parsing the whole + /// JPEG file (for finding any APPn markers) the parsing stops after finding + /// the SOFn marker (which is relevant for extracting width/height and so on. + /// Default: false + OFBool m_keepAPPn; + + /// After reading pixel data, this denotes whether the source + /// data is already lossy compressed + OFBool m_lossyCompressed; +}; + +#endif // I2DJPGS_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2doutpl.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2doutpl.h new file mode 100644 index 00000000..763612ad --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2doutpl.h @@ -0,0 +1,222 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Base class for converter from image file to DICOM + * + */ + +#ifndef I2DOUTPL_H +#define I2DOUTPL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/libi2d/i2define.h" + + +extern DCMTK_I2D_EXPORT OFLogger DCM_dcmdataLibi2dLogger; + +#define DCMDATA_LIBI2D_TRACE(msg) OFLOG_TRACE(DCM_dcmdataLibi2dLogger, msg) +#define DCMDATA_LIBI2D_DEBUG(msg) OFLOG_DEBUG(DCM_dcmdataLibi2dLogger, msg) +#define DCMDATA_LIBI2D_INFO(msg) OFLOG_INFO(DCM_dcmdataLibi2dLogger, msg) +#define DCMDATA_LIBI2D_WARN(msg) OFLOG_WARN(DCM_dcmdataLibi2dLogger, msg) +#define DCMDATA_LIBI2D_ERROR(msg) OFLOG_ERROR(DCM_dcmdataLibi2dLogger, msg) +#define DCMDATA_LIBI2D_FATAL(msg) OFLOG_FATAL(DCM_dcmdataLibi2dLogger, msg) + + +class DCMTK_I2D_EXPORT I2DOutputPlug +{ + +public: + + /** Constructor, initializes member variables + * @return none + */ + I2DOutputPlug() : m_doAttribChecking(OFTrue), m_inventMissingType2Attribs(OFTrue), + m_inventMissingType1Attribs(OFTrue) + {}; + + /** Virtual function that returns a short name of the plugin. + * @return The name of the plugin + */ + virtual OFString ident() =0; + + /** Virtual function that returns the Storage SOP class UID, the plugin writes. + * @param suppSOPs - [out] List containing supported output SOP classes + * @return String containing the Storage SOP class UID + */ + virtual void supportedSOPClassUIDs(OFList& suppSOPs) =0; + + /** Outputs SOP class specific information into dataset + * @param dataset - [in/out] Dataset to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition convert(DcmDataset &dataset) const =0; + + /** Do some completeness / validity checks. Should be called when + * dataset is completed and is about to be saved. + * @param dataset - [in] The dataset to check + * @return Error string if error occurs, empty string otherwise + */ + virtual OFString isValid(DcmDataset& dataset) const = 0; + + /** Destructor + * @return none + */ + virtual ~I2DOutputPlug() {}; + + /** Enable/Disable basic validity checks for output dataset + * @param doChecks - [in] OFTrue enables checking, OFFalse turns it off. + * @param insertMissingType2 - [in] If true (default), missing type 2 + * attributes are inserted automatically + * @param inventMissingType1 - [in] If true (default), missing type 1 + * attributes are inserted automatically with a predefined + * value (if possible). An existing empty type 1 attribute is + * assigned a value, too. + * @return none + */ + virtual void setValidityChecking(OFBool doChecks, + OFBool insertMissingType2 = OFTrue, + OFBool inventMissingType1 = OFTrue) + { + m_doAttribChecking = doChecks; + m_inventMissingType2Attribs = insertMissingType2; + m_inventMissingType1Attribs = inventMissingType1; + }; + +protected: + + /** Checks whether a given tag exists in a dataset and provides a non-empty + * value. If not, the tag is inserted (if enabled) and a default value is + * inserted. + * @param key - [in] The tag to be checked/inserted + * @param targetDset - [in/out] The dataset to search (and insert) in + * @param defaultValue - [in] The default value to set + * @return Error string, which is empty if no error occurs. + */ + virtual OFString checkAndInventType1Attrib(const DcmTagKey& key, + DcmDataset* targetDset, + const OFString& defaultValue ="") const + { + OFBool exists = targetDset->tagExists(key); + if (!exists && !m_inventMissingType1Attribs) + { + OFString err = "I2DOutputPlug: Missing type 1 attribute: "; err += DcmTag(key).getTagName(); err += "\n"; + return err; + } + DcmElement *elem; + OFCondition cond = targetDset->findAndGetElement(key, elem); + if (cond.bad() || !elem || (elem->getLength() == 0)) + { + if (!m_inventMissingType1Attribs) + { + OFString err; + err += "I2DOutputPlug: Empty value for type 1 attribute: "; + err += DcmTag(key).getTagName(); + err += "\n"; + return err; + } + //holds element to insert in item + elem = NULL; + DcmTag tag(key); OFBool wasError = OFFalse; + //if dicom element could be created, insert in to item and modify to value + if ( DcmItem::newDicomElement(elem, tag).good()) + { + if (targetDset->insert(elem, OFTrue).good()) + { + if (elem->putString(defaultValue.c_str()).good()) + { + DCMDATA_LIBI2D_DEBUG("I2DOutputPlug: Inserting missing type 1 attribute: " << tag.getTagName() << " with value " << defaultValue); + } else wasError = OFTrue; + } else wasError = OFTrue; + } else wasError = OFTrue; + if (wasError) + { + OFString err = "Unable to insert type 1 attribute "; + err += tag.getTagName(); err += " with value "; err += defaultValue; err += "\n"; + return err; + } + } + return ""; + }; + + + /** Checks whether a given tag exists in a dataset (can be empty) + * If not, the tag is inserted (if enabled) with empty value. + * @param key - [in] The tag to be checked/inserted + * @param targetDset - [in/out] The dataset to search (and insert) in + * @return Error string, which is empty if no error occurs. + */ + virtual OFString checkAndInventType2Attrib(const DcmTagKey& key, + DcmDataset* targetDset, + const OFString& defaultValue ="") const + { + OFString err; + OFBool exists = targetDset->tagExists(key); + if (!exists) + { + if (m_inventMissingType2Attribs) + { + //holds element to insert in item + DcmElement *elem = NULL; + DcmTag tag(key); OFBool wasError = OFFalse; + //if dicom element could be created, insert in to item and modify to value + if ( DcmItem::newDicomElement(elem, tag).good()) + { + if (targetDset->insert(elem, OFTrue).good()) + { + OFCondition result; + if (!defaultValue.empty()) // only insert value if not empty(e. g. empty type 2 sequences) + { + result = elem->putString(defaultValue.c_str()); + } + if (result.good()) + { + DCMDATA_LIBI2D_DEBUG("I2DOutputPlug: Inserting missing type 2 attribute: " << tag.getTagName() << " with value " << (defaultValue.empty() ? "" : defaultValue)); + } else wasError = OFTrue; + } else wasError = OFTrue; + } else wasError = OFTrue; + if (wasError) + { + err += "Unable to insert type 2 attribute "; err += tag.getTagName(); err += " with value "; err += defaultValue; err += "\n"; + } + } + else + { + err = "Image2Dcm: Missing type 2 attribute: "; err += DcmTag(key).getTagName(); err += "\n"; + return err; + } + } + return err; + }; + + /// if enabled, some simple attribute checking is performed + /// default: enabled (OFTrue) + OFBool m_doAttribChecking; + + /// if enabled, missing type 2 attributes in the dataset are added automatically. + /// default: enabled (OFTrue) + OFBool m_inventMissingType2Attribs; + + /// if enbled, missing type 1 attributes are inserted and filled with a + /// predefined value. Default: disabled (OFFalse) + OFBool m_inventMissingType1Attribs; + +}; + +#endif // #ifndef I2DOUTPL_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplnsc.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplnsc.h new file mode 100644 index 00000000..7980201e --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplnsc.h @@ -0,0 +1,108 @@ +/* + * + * Copyright (C) 2001-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class for conversion of image file into new DICOM SC Image IODs + * + */ + +#ifndef I2DPLNSC_H +#define I2DPLNSC_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" + +class DCMTK_I2D_EXPORT I2DOutputPlugNewSC : public I2DOutputPlug +{ + +public: + + /** Constructor, initializes member variables with standard values + * @return none + */ + I2DOutputPlugNewSC(); + + /** Virtual function that returns a short name of the plugin. + * @return The name of the plugin + */ + virtual OFString ident(); + + /** Overwrites function from base class. Returns the Storage SOP class + * written by this plugin + * @param suppSOPs - [out] List of UIDs representing the supported SOP + * classes supported by this plugin. + * @return none + */ + virtual void supportedSOPClassUIDs(OFList& suppSOPs); + + /** Outputs SOP class specific information into dataset + * @param dataset - [in/out] Dataset to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition convert(DcmDataset &dataset) const; + + /** Do some completeness / validity checks. Should be called when + * dataset is completed and is about to be saved. + * @param dataset - [in] The dataset to check + * @return Error string if error occurs, empty string otherwise + */ + virtual OFString isValid(DcmDataset& dataset) const; + + /** Virtual Destructor, clean up memory + * @return none + */ + virtual ~I2DOutputPlugNewSC(); + +protected: + + /** Inserts attributes for Multi-frame Module + * @param targetDataset - [in/out] The dataset to write to + * @return EC_Normal if insertion was successfull, error code otherwise + */ + virtual OFCondition insertMultiFrameAttribs(DcmDataset* targetDataset) const; + + /** Inserts attributes Rescale Slope/Intercept/Type, which have to be + * written (1C) if color model is MONOCHROME2 and BitsStored > 1. + * @param targetDataset - [out] The dataset to write to + * @return EC_Normal if insertion was successfull, error code otherwise + */ + virtual OFCondition insertSCMultiFrameAttribs(DcmDataset *targetDataset) const; + + /** Checks whether Image Pixel module attributes conform to the + * specification of a a 1 bit Secondary Capture object. + * @param dataset - [in] The dataset to check + * @return EC_Normal, if everything is fine, error code otherwise + */ + virtual OFCondition handle1BitSC(DcmDataset *dataset) const; + + /** Checks whether Image Pixel module attributes conform to the + * specification of a a 8 bit Secondary Capture object. + * @param dataset - [in] The dataset to check + * @return EC_Normal, if everything is fine, error code otherwise + */ + virtual OFCondition handle8BitSC(DcmDataset *dataset) const; + + /** Checks whether Image Pixel module attributes conform to the + * specification of a a 16 bit Secondary Capture object. + * @param dataset - [in] The dataset to check + * @return EC_Normal, if everything is fine, error code otherwise + */ + virtual OFCondition handle16BitSC(DcmDataset *dataset) const; + + +}; + +#endif // I2DPLNSC_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplsc.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplsc.h new file mode 100644 index 00000000..875caaf8 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplsc.h @@ -0,0 +1,71 @@ +/* + * + * Copyright (C) 2001-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class for conversion of image file into DICOM SC Image Storage + * + */ + +#ifndef I2DPLSC_H +#define I2DPLSC_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" + +class DCMTK_I2D_EXPORT I2DOutputPlugSC : public I2DOutputPlug +{ + +public: + + /** Constructor, initializes member variables with standard values + * @return none + */ + I2DOutputPlugSC(); + + /** Virtual function that returns a short name of the plugin. + * @return The name of the plugin + */ + virtual OFString ident(); + + /** Overwrites function from base class. Returns the Storage SOP class + * written by this plugin + * @param suppSOPs - [out] List of UIDS representing SOP classes supported + * by this plugin + * @return none + */ + virtual void supportedSOPClassUIDs(OFList& suppSOPs); + + /** Outputs SOP class specific information into dataset + * @param dataset - [in/out] Dataset to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition convert(DcmDataset &dataset) const; + + /** Do some completeness / validity checks. Should be called when + * dataset is completed and is about to be saved. + * @param dataset - [in] The dataset to check + * @return Error string if error occurs, empty string otherwise + */ + virtual OFString isValid(DcmDataset& dataset) const; + + /** Virtual Destructor, clean up memory + * @return none + */ + virtual ~I2DOutputPlugSC(); + +}; + +#endif // I2DPLSC_H diff --git a/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplvlp.h b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplvlp.h new file mode 100644 index 00000000..40f96aec --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/libi2d/i2dplvlp.h @@ -0,0 +1,71 @@ +/* + * + * Copyright (C) 2001-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class for conversion of image file into DICOM SC Image Storage + * + */ + +#ifndef I2DPLVLP_H +#define I2DPLVLP_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" + +class DCMTK_I2D_EXPORT I2DOutputPlugVLP : public I2DOutputPlug +{ + +public: + + /** Constructor, initializes member variables with standard values + * @return none + */ + I2DOutputPlugVLP(); + + /** Virtual function that returns a short name of the plugin. + * @return The name of the plugin + */ + virtual OFString ident(); + + /** Overwrites function from base class. Returns the Storage SOP class + * written by this plugin + * @param suppSOPs - [out] List of UIDs representing SOP classes supported by + * this plugin + * @return A string holding the Storage SOP class written by this plugin + */ + virtual void supportedSOPClassUIDs(OFList& suppSOPs); + + /** Outputs SOP class specific information into dataset + * @param dataset - [in/out] Dataset to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition convert(DcmDataset &dataset) const; + + /** Do some completeness / validity checks. Should be called when + * dataset is completed and is about to be saved. + * @param dataset - [in] The dataset to check + * @return Error string if error occurs, empty string else + */ + virtual OFString isValid(DcmDataset& dataset) const; + + /** Virtual Destructor, clean up memory + * @return none + */ + virtual ~I2DOutputPlugVLP(); + +}; + +#endif // I2DPLVLP_H diff --git a/dcmdata/include/dcmtk/dcmdata/vrscan.h b/dcmdata/include/dcmtk/dcmdata/vrscan.h new file mode 100644 index 00000000..84d97703 --- /dev/null +++ b/dcmdata/include/dcmtk/dcmdata/vrscan.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (C) 2010-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: Interface to the VR scanner. + * + */ + + +#ifndef VRSCAN_H +#define VRSCAN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstring.h" + +#include "dcmtk/dcmdata/dcdefine.h" + +class DCMTK_DCMDATA_EXPORT vrscan +{ +public: + static int scan(const OFString& vr, const OFString& value); + static int scan(const OFString& vr, const char* const value, const size_t size); +}; + +#endif // VRSCAN_H diff --git a/dcmdata/libi2d/CMakeLists.txt b/dcmdata/libi2d/CMakeLists.txt new file mode 100644 index 00000000..4d66fc42 --- /dev/null +++ b/dcmdata/libi2d/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(i2d i2d i2dplvlp i2djpgs i2dbmps i2dplsc i2dplnsc) + +DCMTK_TARGET_LINK_MODULES(i2d dcmdata) diff --git a/dcmdata/libi2d/Makefile.dep b/dcmdata/libi2d/Makefile.dep new file mode 100644 index 00000000..2041e37f --- /dev/null +++ b/dcmdata/libi2d/Makefile.dep @@ -0,0 +1,329 @@ +i2d.o: i2d.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/libi2d/i2d.h \ + ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h \ + ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \ + ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcvrpobw.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcpath.h +i2dbmps.o: i2dbmps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/libi2d/i2dbmps.h \ + ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcelem.h +i2djpgs.o: i2djpgs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/libi2d/i2djpgs.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h \ + ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcelem.h +i2dplnsc.o: i2dplnsc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/libi2d/i2dplnsc.h \ + ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcuid.h +i2dplsc.o: i2dplsc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/libi2d/i2dplsc.h \ + ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcuid.h +i2dplvlp.o: i2dplvlp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/libi2d/i2dplvlp.h \ + ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcuid.h diff --git a/dcmdata/libi2d/Makefile.in b/dcmdata/libi2d/Makefile.in new file mode 100644 index 00000000..eaecdbdf --- /dev/null +++ b/dcmdata/libi2d/Makefile.in @@ -0,0 +1,56 @@ +# +# Makefile for dcmdata/libi2d +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata + +LOCALINCLUDES = -I$(ofstddir)/include -I$(dcmdatadir)/include -I$(oflogdir)/include +LOCALDEFS = + +objs = i2d.o i2dplvlp.o i2djpgs.o i2dbmps.o i2dplsc.o i2dplnsc.o + +library = libi2d.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +install-lib: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmdata/libi2d/i2d.cc b/dcmdata/libi2d/i2d.cc new file mode 100644 index 00000000..e3d963e4 --- /dev/null +++ b/dcmdata/libi2d/i2d.cc @@ -0,0 +1,735 @@ +/* + * + * Copyright (C) 2007-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Implements utility for converting standard image formats to DICOM + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/libi2d/i2d.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/dcfilefo.h" /* for DcmFileFormat */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for DCM_ defines */ +#include "dcmtk/dcmdata/dcuid.h" /* for SITE_SERIES_UID_ROOT */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpath.h" /* for override keys */ + +OFLogger DCM_dcmdataLibi2dLogger = OFLog::getLogger("dcmtk.dcmdata.libi2d"); + + +Image2Dcm::Image2Dcm() : m_overrideKeys(), m_templateFile(""), + m_readStudyLevel(OFFalse), m_readSeriesLevel(OFFalse), m_studySeriesFile(), + m_incInstNoFromFile(OFFalse), m_disableAttribChecks(OFFalse), + m_inventMissingType2Attribs(OFTrue), m_inventMissingType1Attribs(OFFalse), + m_insertLatin1(OFTrue) +{ + +} + + +OFCondition Image2Dcm::convert(I2DImgSource *inputPlug, + I2DOutputPlug *outPlug, + DcmDataset*& resultDset, + E_TransferSyntax& proposedTS) + +{ + if (!inputPlug || !outPlug) + return EC_IllegalParameter; + + OFCondition cond; + resultDset = NULL; + OFunique_ptr tempDataset; + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Starting conversion of file: " << inputPlug->getImageFile()); + + // If specified, copy DICOM template file to export file + if (!m_templateFile.empty()) + { + DcmFileFormat dcmff; + cond = dcmff.loadFile(m_templateFile.c_str()); + if (cond.bad()) + return cond; + // remove problematic attributes from dataset + cleanupTemplate(dcmff.getDataset()); + // copy from input file + tempDataset.reset(new DcmDataset(*(dcmff.getDataset()))); + } + else // otherwise, start with an empty DICOM file + tempDataset.reset(new DcmDataset()); + if (!tempDataset.get()) + return EC_MemoryExhausted; + + // Read patient and study or series information if desired and write to export file + if (m_readStudyLevel || m_readSeriesLevel) + { + cond = applyStudyOrSeriesFromFile(tempDataset.get()); + if (cond.bad()) + { + return cond; + } + } + + // Increment instance number + if (m_incInstNoFromFile) + { + cond = incrementInstanceNumber(tempDataset.get()); + if (cond.bad()) + { + return cond; + } + } + + // Insert Latin 1 as standard character set if desired + if (m_insertLatin1) + cond = insertLatin1(tempDataset.get()); + if (cond.bad()) + return cond; + + // Generate and insert UIDs as necessary + generateUIDs(tempDataset.get()); + + // Read and insert pixel data + cond = readAndInsertPixelData(inputPlug, tempDataset.get(), proposedTS); + if (cond.bad()) + { + return cond; + } + + // Insert Lossy Image Compression and Lossy Image Compression Method attributes if necessary + OFBool srcIsLossy = OFFalse; OFString comprMethod; + if (inputPlug->getLossyComprInfo(srcIsLossy, comprMethod).good()) //TODO) + { + if (srcIsLossy) + { + cond = tempDataset->putAndInsertOFStringArray(DCM_LossyImageCompression, "01"); + if (cond.good() && !comprMethod.empty()) + cond = tempDataset->putAndInsertOFStringArray(DCM_LossyImageCompressionMethod, comprMethod); + if (cond.bad()) return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write attribute Lossy Image Compression and/or Lossy Image Compression Method to result dataset"); + } + } + else + DCMDATA_LIBI2D_DEBUG("Image2Dcm: No information regarding lossy compression available"); + + // Insert SOP Class specific attributes (and values) + cond = outPlug->convert(*tempDataset); + if (cond.bad()) + { + return cond; + } + + // At last, apply override keys on dataset + cond = applyOverrideKeys(tempDataset.get()); + if (cond.bad()) + { + return cond; + } + + // Do some very basic attribute checking (e. g. existence (type 2) and values (type 1)) + if (!m_disableAttribChecks) + { + OFString err; + err = isValid(*tempDataset); + err += outPlug->isValid(*tempDataset); + if (!err.empty()) + { + return makeOFCondition(OFM_dcmdata, 18, OF_error, err.c_str()); + } + } + + resultDset = tempDataset.release(); + return EC_Normal; +} + + +OFCondition Image2Dcm::insertLatin1(DcmDataset *outputDset) +{ + if (outputDset == NULL) + return EC_IllegalParameter; + return outputDset->putAndInsertString(DCM_SpecificCharacterSet, "ISO_IR 100"); +} + + +void Image2Dcm::cleanupTemplate(DcmDataset *targetDset) +{ + if (!targetDset) + return; + // Remove any existing image pixel module attribute + targetDset->findAndDeleteElement(DCM_PixelDataProviderURL); + targetDset->findAndDeleteElement(DCM_PhotometricInterpretation); + targetDset->findAndDeleteElement(DCM_SamplesPerPixel); + targetDset->findAndDeleteElement(DCM_Rows); + targetDset->findAndDeleteElement(DCM_Columns); + targetDset->findAndDeleteElement(DCM_BitsAllocated); + targetDset->findAndDeleteElement(DCM_BitsStored); + targetDset->findAndDeleteElement(DCM_HighBit); + targetDset->findAndDeleteElement(DCM_PixelRepresentation); + targetDset->findAndDeleteElement(DCM_PixelData); + targetDset->findAndDeleteElement(DCM_PlanarConfiguration); + targetDset->findAndDeleteElement(DCM_PixelAspectRatio); + targetDset->findAndDeleteElement(DCM_SmallestImagePixelValue); + targetDset->findAndDeleteElement(DCM_LargestImagePixelValue); + targetDset->findAndDeleteElement(DCM_RedPaletteColorLookupTableDescriptor); + targetDset->findAndDeleteElement(DCM_GreenPaletteColorLookupTableDescriptor); + targetDset->findAndDeleteElement(DCM_BluePaletteColorLookupTableDescriptor); + targetDset->findAndDeleteElement(DCM_RedPaletteColorLookupTableData); + targetDset->findAndDeleteElement(DCM_GreenPaletteColorLookupTableData); + targetDset->findAndDeleteElement(DCM_BluePaletteColorLookupTableData); + targetDset->findAndDeleteElement(DCM_ICCProfile); + // Remove SOP Class / Instance information + targetDset->findAndDeleteElement(DCM_SOPClassUID); + targetDset->findAndDeleteElement(DCM_SOPInstanceUID); + +} + + +OFCondition Image2Dcm::applyStudyOrSeriesFromFile(DcmDataset *targetDset) +{ + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Applying study and/or series information from file"); + if ( (!m_readSeriesLevel && !m_readStudyLevel) || m_studySeriesFile.empty() ) + return EC_IllegalCall; + DcmFileFormat dcmff; + OFString errMsg; + OFCondition cond; + + // Open DICOM file to read patient/study/series information from + cond = dcmff.loadFile(m_studySeriesFile.c_str()); + if (cond.bad()) + { + errMsg = "Error: Unable to open study / series file "; errMsg += m_studySeriesFile; + return makeOFCondition(OFM_dcmdata, 18, OF_error, errMsg.c_str()); + } + + DcmDataset *srcDset = NULL; + srcDset = dcmff.getDataset(); + if (srcDset == NULL) + return EC_IllegalCall; + + // Patient level attributes (type 2 - if value cannot be read, insert empty value + OFString value; + srcDset->findAndGetOFString(DCM_PatientName, value); + cond = targetDset->putAndInsertOFStringArray(DCM_PatientName, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Patient's Name to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_PatientID, value); + cond = targetDset->putAndInsertOFStringArray(DCM_PatientID, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Patient ID to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_PatientSex, value); + cond = targetDset->putAndInsertOFStringArray(DCM_PatientSex, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Patient's Sex to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_PatientBirthDate, value); + cond = targetDset->putAndInsertOFStringArray(DCM_PatientBirthDate, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Patient's Birth Date to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_SpecificCharacterSet, value); + cond = targetDset->putAndInsertOFStringArray(DCM_SpecificCharacterSet, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Specific Character Set to file"); + value.clear(); + + // Study level attributes (type 2 except Study Instance UID) + cond = srcDset->findAndGetOFString(DCM_StudyInstanceUID, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to read Study Instance UID (type 1) from file"); + cond = targetDset->putAndInsertOFStringArray(DCM_StudyInstanceUID, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Study Instance UID to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_StudyDate, value); + cond = targetDset->putAndInsertOFStringArray(DCM_StudyDate, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Study Date to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_StudyTime, value); + cond = targetDset->putAndInsertOFStringArray(DCM_StudyTime, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Study Time to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_ReferringPhysicianName, value); + cond = targetDset->putAndInsertOFStringArray(DCM_ReferringPhysicianName, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Referring Physician's Name to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_StudyID, value); + cond = targetDset->putAndInsertOFStringArray(DCM_StudyID, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Study ID to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_AccessionNumber, value); + cond = targetDset->putAndInsertOFStringArray(DCM_AccessionNumber, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to trite Accession Number to file"); + value.clear(); + + // Series Level attributes (type 2 except Series Instance UID which is type 1) + if (m_readSeriesLevel) + { + // General Series Module attributes + cond = srcDset->findAndGetOFString(DCM_SeriesInstanceUID, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to read Series Instance UID (type 1) from file"); + cond = targetDset->putAndInsertOFStringArray(DCM_SeriesInstanceUID, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Series Instance UID to file"); + value.clear(); + + srcDset->findAndGetOFString(DCM_SeriesNumber, value); + cond = targetDset->putAndInsertOFStringArray(DCM_SeriesNumber, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Series Number to file"); + value.clear(); + + // General Equipment Module attributes + srcDset->findAndGetOFString(DCM_Manufacturer, value); + cond = targetDset->putAndInsertOFStringArray(DCM_Manufacturer, value); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Manufacturer to file"); + value.clear(); + } + + return EC_Normal; +} + + +OFCondition Image2Dcm::incrementInstanceNumber(DcmDataset *targetDset) +{ + // Read and increment Instance Number if desired + if (m_incInstNoFromFile) + { + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Trying to read and increment instance number"); + Sint32 instanceNumber; + if ( targetDset->findAndGetSint32(DCM_InstanceNumber, instanceNumber).good() ) + { + instanceNumber++; + char buf[100]; + sprintf(buf, "%ld", OFstatic_cast(long, instanceNumber)); + OFCondition cond = targetDset->putAndInsertOFStringArray(DCM_InstanceNumber, buf); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable write Instance Number to dataset"); + } + else + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to read Instance Number from dataset"); + } + return EC_Normal; +} + + +OFCondition Image2Dcm::generateUIDs(DcmDataset *dset) +{ + OFString value; + OFCondition cond; + + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Generate and insert new UIDs if necessary"); + // Generate and write Series Instance UID if not already present + if (!m_readSeriesLevel) + { + cond = dset->findAndGetOFString(DCM_SeriesInstanceUID, value); + if (cond.bad() || value.empty()) + { + char newUID[100]; + dcmGenerateUniqueIdentifier(newUID, SITE_SERIES_UID_ROOT); + cond = dset->putAndInsertOFStringArray(DCM_SeriesInstanceUID, newUID); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Series Instance UID to file"); + } + value.clear(); + } + + // Generate and write Study Instance UID if not already present + if (!m_readStudyLevel) + { + cond = dset->findAndGetOFString(DCM_StudyInstanceUID, value); + if (cond.bad() || value.empty()) + { + char newUID[100]; + dcmGenerateUniqueIdentifier(newUID, SITE_STUDY_UID_ROOT); + cond = dset->putAndInsertOFStringArray(DCM_StudyInstanceUID, newUID); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write Study Instance UID to file"); + } + value.clear(); + } + + // Generate SOP Instance UID if not already present + cond = dset->findAndGetOFString(DCM_SOPInstanceUID, value); + if (cond.bad() || value.empty()) + { + char newUID[100]; + dcmGenerateUniqueIdentifier(newUID, SITE_INSTANCE_UID_ROOT); + cond = dset->putAndInsertOFStringArray(DCM_SOPInstanceUID, newUID); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to write SOP Instance UID to file"); + } + + return EC_Normal; +} + + +void Image2Dcm::setISOLatin1(OFBool insLatin1) +{ + m_insertLatin1 = insLatin1; +} + + +OFCondition Image2Dcm::insertEncapsulatedPixelData(DcmDataset* dset, + char *pixData, + Uint32 length, + const E_TransferSyntax& outputTS) const +{ + OFCondition cond; + + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Storing imported pixel data to DICOM file"); + // create initial pixel sequence + DcmPixelSequence* pixelSequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSequence == NULL) + return EC_MemoryExhausted; + + // insert empty offset table into sequence + DcmPixelItem *offsetTable = new DcmPixelItem(DCM_PixelItemTag); + if (offsetTable == NULL) + { + delete pixelSequence; pixelSequence = NULL; + return EC_MemoryExhausted; + } + cond = pixelSequence->insert(offsetTable); + if (cond.bad()) + { + delete offsetTable; offsetTable = NULL; + delete pixelSequence; pixelSequence = NULL; + return cond; + } + + // store compressed frame into pixel sequence + DcmOffsetList dummyList; + cond = pixelSequence->storeCompressedFrame(dummyList, OFreinterpret_cast(Uint8*,pixData), length, 0); + // storeCompressedFrame(..) does a deep copy, so the pixData memory can be freed now + delete[] pixData; + if (cond.bad()) + { + delete pixelSequence; pixelSequence = NULL; + return cond; + } + + // insert pixel data attribute incorporating pixel sequence into dataset + DcmPixelData *pixelData = new DcmPixelData(DCM_PixelData); + if (pixelData == NULL) + { + delete pixelSequence; pixelSequence = NULL; + return EC_MemoryExhausted; + } + /* tell pixel data element that this is the original presentation of the pixel data + * pixel data and how it compressed + */ + pixelData->putOriginalRepresentation(outputTS, NULL, pixelSequence); + cond = dset->insert(pixelData); + if (cond.bad()) + { + delete pixelData; pixelData = NULL; // also deletes contained pixel sequence + return cond; + } + + return EC_Normal; +} + + +OFCondition Image2Dcm::readAndInsertPixelData(I2DImgSource* imgSource, + DcmDataset* dset, + E_TransferSyntax& outputTS) +{ + Uint16 samplesPerPixel, rows, cols, bitsAlloc, bitsStored, highBit, pixelRepr, planConf; + Uint16 pixAspectH =1; Uint16 pixAspectV = 1; + OFString photoMetrInt; + outputTS = EXS_Unknown; + char* pixData = NULL; + Uint32 length; + + OFCondition cond = imgSource->readPixelData(rows, cols, + samplesPerPixel, photoMetrInt, bitsAlloc, bitsStored, highBit, pixelRepr, + planConf, pixAspectH, pixAspectV, pixData, length, outputTS); + + if (cond.bad()) + return cond; + + DcmXfer transport(outputTS); + if (transport.isEncapsulated()) + insertEncapsulatedPixelData(dset, pixData, length, outputTS); + else + { + /* Not encapsulated */ + dset->putAndInsertUint8Array(DCM_PixelData, OFreinterpret_cast(Uint8*, pixData), length); + delete[] pixData; + } + + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Inserting Image Pixel module information"); + + cond = dset->putAndInsertUint16(DCM_SamplesPerPixel, samplesPerPixel); + if (cond.bad()) + return cond; + + cond = dset->putAndInsertOFStringArray(DCM_PhotometricInterpretation, photoMetrInt); + if (cond.bad()) + return cond; + + // Should only be written if Samples per Pixel > 1 + if (samplesPerPixel > 1) + { + cond = dset->putAndInsertUint16(DCM_PlanarConfiguration, planConf); + if (cond.bad()) + return cond; + } + + cond = dset->putAndInsertUint16(DCM_Rows, rows); + if (cond.bad()) + return cond; + + cond = dset->putAndInsertUint16(DCM_Columns, cols); + if (cond.bad()) + return cond; + + cond = dset->putAndInsertUint16(DCM_BitsAllocated, bitsAlloc); + if (cond.bad()) + return cond; + + cond = dset->putAndInsertUint16(DCM_BitsStored, bitsStored); + if (cond.bad()) + return cond; + + cond = dset->putAndInsertUint16(DCM_HighBit, highBit); + if (cond.bad()) + return cond; + + if ( pixAspectH != pixAspectV ) + { + char buf[200]; + int err = sprintf(buf, "%u\\%u", pixAspectV, pixAspectH); + if (err == -1) return EC_IllegalCall; + cond = dset->putAndInsertOFStringArray(DCM_PixelAspectRatio, buf); + if (cond.bad()) + return cond; + } + + return dset->putAndInsertUint16(DCM_PixelRepresentation, pixelRepr); +} + + +OFString Image2Dcm::isValid(DcmDataset& dset) const +{ + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Checking validity of DICOM output dataset"); + OFString dummy, err; OFCondition cond; + // General Patient module attributes + err += checkAndInventType2Attrib(DCM_PatientName, &dset); + err += checkAndInventType2Attrib(DCM_PatientSex, &dset); + err += checkAndInventType2Attrib(DCM_PatientBirthDate, &dset); + err += checkAndInventType2Attrib(DCM_PatientID, &dset); + + // General Study module attributes + err += checkAndInventType1Attrib(DCM_StudyInstanceUID, &dset); + err += checkAndInventType2Attrib(DCM_StudyDate, &dset); + err += checkAndInventType2Attrib(DCM_StudyTime, &dset); + err += checkAndInventType2Attrib(DCM_ReferringPhysicianName, &dset); + err += checkAndInventType2Attrib(DCM_StudyID, &dset); + err += checkAndInventType2Attrib(DCM_AccessionNumber, &dset); + + // General Series module attributes + err += checkAndInventType1Attrib(DCM_SeriesInstanceUID, &dset); + err += checkAndInventType2Attrib(DCM_SeriesNumber, &dset); + err += checkAndInventType2Attrib(DCM_InstanceNumber, &dset); + + // General Image module attributes + /* Patient Orientation is of type 2C and must be written if not + Image Orientation (Patient) (0020,0037) and Image Position (Patient) + are required for the IOD. The current output IODs (SC, new SC, VLP) + therefore need Patient Orientation. Make sure any new output plugin + takes care about this attribute + */ + err += checkAndInventType2Attrib(DCM_PatientOrientation, &dset); + + // Image Pixel Module + err += checkAndInventType1Attrib(DCM_Rows, &dset); + err += checkAndInventType1Attrib(DCM_Columns, &dset); + err += checkAndInventType1Attrib(DCM_SamplesPerPixel, &dset); + err += checkAndInventType1Attrib(DCM_PhotometricInterpretation, &dset); + err += checkAndInventType1Attrib(DCM_BitsAllocated, &dset); + err += checkAndInventType1Attrib(DCM_BitsStored, &dset); + err += checkAndInventType1Attrib(DCM_HighBit, &dset); + err += checkAndInventType1Attrib(DCM_PixelRepresentation, &dset); + err += checkAndInventType1Attrib(DCM_SOPInstanceUID, &dset); + + return err; +} + + + +void Image2Dcm::setSeriesFrom(const OFString& file) +{ + m_readSeriesLevel = OFTrue; + m_studySeriesFile = file; +} + + +void Image2Dcm::setStudyFrom(const OFString& file) +{ + m_readStudyLevel = OFTrue; + m_studySeriesFile = file; +} + + +void Image2Dcm::setValidityChecking(OFBool doChecks, + OFBool insertMissingType2, + OFBool inventMissingType1) +{ + m_disableAttribChecks = !doChecks; + m_inventMissingType2Attribs = insertMissingType2; + m_inventMissingType1Attribs = inventMissingType1; +} + + +void Image2Dcm::setTemplateFile(const OFString& file) +{ + m_templateFile = file; +} + + + +void Image2Dcm::setIncrementInstanceNumber(OFBool incInstNo) +{ + m_incInstNoFromFile = incInstNo; +} + + +void Image2Dcm::setOverrideKeys(const OFList& ovkeys) +{ + OFListConstIterator(OFString) it = ovkeys.begin(); + OFListConstIterator(OFString) end = ovkeys.end(); + while (it != end) + { + m_overrideKeys.push_back(*it); + it++; + } +} + + +OFCondition Image2Dcm::applyOverrideKeys(DcmDataset *outputDset) + +{ + /* replace specific keys by those in overrideKeys, copied from findscu */ + OFListConstIterator(OFString) path = m_overrideKeys.begin(); + OFListConstIterator(OFString) endOfList = m_overrideKeys.end(); + OFCondition cond; + DcmPathProcessor proc; + while (path != endOfList) + { + cond = proc.applyPathWithValue(outputDset, *path); + if (cond.bad()) { + OFString err; + err += "Bad override key/path: "; err += *path; err += ": "; err += cond.text(); + return makeOFCondition(OFM_dcmdata, 18, OF_error, err.c_str()); + } + path++; + } + return cond; +} + + +OFString Image2Dcm::checkAndInventType1Attrib(const DcmTagKey& key, + DcmDataset* targetDset, + const OFString& defaultValue) const +{ + OFBool exists = targetDset->tagExists(key); + if (!exists) + { + OFString err = "Image2Dcm: Missing type 1 attribute: "; err += DcmTag(key).getTagName(); err += "\n"; + return err; + } + DcmElement *elem; + OFCondition cond = targetDset->findAndGetElement(key, elem); + if (cond.bad() || !elem || (elem->getLength() == 0)) + { + if (!m_inventMissingType1Attribs) + { + OFString err = "Image2Dcm: Empty value for type 1 attribute: "; + err += DcmTag(key).getTagName(); + err += "\n"; + return err; + } + // holds element to insert in item + elem = NULL; + DcmTag tag(key); OFBool wasError = OFFalse; + // if DICOM element could be created, insert in to item and modify to value + if ( DcmItem::newDicomElement(elem, tag).good()) + { + if (targetDset->insert(elem, OFTrue).good()) + { + if (elem->putString(defaultValue.c_str()).good()) + { + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Inserting missing type 1 attribute " << tag.getTagName() + << " with value " << defaultValue); + } else wasError = OFTrue; + } else wasError = OFTrue; + } else wasError = OFTrue; + if (wasError) + { + OFString err = "Unable to insert type 1 attribute "; err += tag.getTagName(); err += " with value "; err += defaultValue; err += "\n"; + return err; + } + } + return ""; +} + + +OFString Image2Dcm::checkAndInventType2Attrib(const DcmTagKey& key, + DcmDataset* targetDset) const +{ + OFString err; + OFBool exists = targetDset->tagExists(key); + if (!exists) + { + if (m_inventMissingType2Attribs) + { + DcmTag tag(key); + DCMDATA_LIBI2D_DEBUG("Image2Dcm: Inserting missing type 2 attribute: " << tag.getTagName()); + targetDset->insertEmptyElement(tag); + } + else + { + err = "Image2Dcm: Missing type 2 attribute: "; err += DcmTag(key).getTagName(); err += "\n"; + return err; + } + } + return err; +} + + +Image2Dcm::~Image2Dcm() +{ + DCMDATA_LIBI2D_DEBUG("Freeing memory"); +} diff --git a/dcmdata/libi2d/i2dbmps.cc b/dcmdata/libi2d/i2dbmps.cc new file mode 100644 index 00000000..02566703 --- /dev/null +++ b/dcmdata/libi2d/i2dbmps.cc @@ -0,0 +1,617 @@ +/* + * + * Copyright (C) 2009-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: Class to extract pixel data and meta information from BMP file + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/libi2d/i2dbmps.h" +#include "dcmtk/dcmdata/dcerror.h" +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" + +#ifndef UINT16_MAX +/// Maximum value a Uint16 can hold +#define UINT16_MAX 65535 +#endif + +I2DBmpSource::I2DBmpSource() : bmpFile() +{ + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: Plugin instantiated"); +} + + +OFString I2DBmpSource::inputFormat() const +{ + return "BMP"; +} + + +OFCondition I2DBmpSource::openFile(const OFString &filename) +{ + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: Opening BMP file: " << filename); + OFCondition cond; + if (filename.empty()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "No BMP filename specified"); + + // Try to open BMP file + if ((bmpFile.fopen(filename.c_str(), "rb")) == OFFalse) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to open BMP file"); + + return cond; +} + + +OFCondition I2DBmpSource::readPixelData(Uint16& rows, + Uint16& cols, + Uint16& samplesPerPixel, + OFString& photoMetrInt, + Uint16& bitsAlloc, + Uint16& bitsStored, + Uint16& highBit, + Uint16& pixelRepr, + Uint16& planConf, + Uint16& pixAspectH, + Uint16& pixAspectV, + char*& pixData, + Uint32& length, + E_TransferSyntax &ts) +{ + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: Importing BMP pixel data"); + OFCondition cond = openFile(m_imageFile); + // return error if file is not open + if (cond.bad()) + { + closeFile(); + return cond; + } + + /* Read both file headers */ + Uint32 dataOffset; + cond = readFileHeader(dataOffset); + if (cond.bad()) + { + closeFile(); + return cond; + } + + Uint16 width, height; + Uint16 bpp, colors; + OFBool isTopDown = OFFalse; /* Most BMPs are stored bottom-up */ + cond = readBitmapHeader(width, height, bpp, isTopDown, colors); + if (cond.bad()) + { + closeFile(); + return cond; + } + + Uint32 *palette = NULL; + cond = readColorPalette(colors, palette); + if (cond.bad()) + { + closeFile(); + return cond; + } + + /* Now jump to the bitmap data... */ + if (bmpFile.fseek(dataOffset, SEEK_SET) != 0) + return EC_EndOfStream; + + /* ...and read the "real" image data */ + char *data; + Uint32 data_length; + cond = readBitmapData(width, height, bpp, isTopDown, colors, palette, data, data_length); + + if (palette) + delete[] palette; + + if (cond.bad()) + { + closeFile(); + return cond; + } + + /* Now we got all the info that we need, return it to caller */ + + rows = height; + cols = width; + samplesPerPixel = 3; /* 24 bpp */ + + bitsAlloc = 8; + bitsStored = 8; + highBit = 7; + photoMetrInt = "RGB"; + planConf = 0; /* For each pixel we save rgb in that order */ + pixData = data; + length = data_length; + pixAspectH = pixAspectV = 1; + pixelRepr = 0; + ts = EXS_LittleEndianExplicit; + + return cond; +} + + +OFCondition I2DBmpSource::readFileHeader(Uint32 &offset) +{ + Uint16 magic; + if (readWord(magic) != 0) + return EC_EndOfStream; + + /* ASCII "BM", decimal 19778 */ + if (magic != 19778) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Not a BMP file - invalid header"); + + /* Skip over two uninteresting entries */ + if (bmpFile.fseek(8, SEEK_CUR) != 0) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Not a BMP file - invalid header"); + + if (readDWord(offset) != 0) + return EC_EndOfStream; + + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: BMP data at file offset: " << offset); + + return EC_Normal; +} + + +OFCondition I2DBmpSource::readBitmapHeader(Uint16 &width, + Uint16 &height, + Uint16 &bpp, + OFBool &isTopDown, + Uint16 &colors) +{ + Uint16 tmp_word; + Uint32 tmp_dword; + + /* 40 is the size of the bitmap info header */ + if (readDWord(tmp_dword) != 0 || tmp_dword != 40) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Not a BMP file - invalid bitmap header"); + + Sint32 tmp_width, tmp_height; + if (readLong(tmp_width) != 0) + return EC_EndOfStream; + + if (readLong(tmp_height) != 0) + return EC_EndOfStream; + + if (tmp_height < 0) /* Is this a top down bitmap? */ + { + isTopDown = OFTrue; + tmp_height = -tmp_height; + } + else + isTopDown = OFFalse; + height = OFstatic_cast(Uint16, tmp_height); + + // Check if we got a valid value here which fits into a Uint16 + // (height < 0 can happen because -(INT_MIN) == INT_MIN). + if (tmp_height <= 0 || tmp_height > UINT16_MAX) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unsupported BMP file - height too large or zero"); + + if (tmp_width < 0) /* Width also can be signed, but no semantic */ + { + tmp_width = -tmp_width; + } + width = OFstatic_cast(Uint16, tmp_width); + if (tmp_width <= 0 || tmp_width > UINT16_MAX) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unsupported BMP file - width too large or zero"); + + /* Some older standards used this, always 1 for BMP (number of planes) */ + if (readWord(tmp_word) != 0 || tmp_word != 1) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Not a BMP file - invalid number of planes"); + + /* Color depth in bpp */ + if (readWord(tmp_word) != 0) + return EC_EndOfStream; + bpp = tmp_word; + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: BMP bpp: " << OFstatic_cast(int, bpp)); + + /* Compression info */ + if (readDWord(tmp_dword) != 0) + return EC_EndOfStream; + /* We don't support compressed BMPs */ + if (tmp_dword != 0) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unsupported BMP file - compressed"); + + /* We don't care about the next three fields of the bitmap info header: + * DWord: Size of image data or 0 (yes, that's what the standard says!). + * Long: Horizontal resolution in pixel per meter, mostly set to 0. + * Long: Vertical resolution in pixel per meter, mostly set to 0: + */ + if (bmpFile.fseek(12, SEEK_CUR) != 0) + return EC_EndOfStream; + + /* Number of entries in color table, 0 means "use default" */ + if (readDWord(tmp_dword) != 0) + return EC_EndOfStream; + + /* A BMP file can only have 256 color table entries */ + if (tmp_dword > 256) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "invalid BMP file - color table too big"); + + colors = OFstatic_cast(Uint16, tmp_dword); + if (colors == 0) { + // In this case, 1, 4 and 8 bpp get 2**bpp colors in the color table, + // others get no color table at all. + switch (bpp) { + case 1: + colors = 2; + break; + case 4: + colors = 16; + break; + case 8: + colors = 256; + break; + default: + colors = 0; + break; + } + } + + /* Skip another uninteresting entry (number of important colors) */ + if (bmpFile.fseek(4, SEEK_CUR) != 0) + return EC_EndOfStream; + + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: BMP width: " << width); + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: BMP height: " << height); + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: BMP stored as top down: " << (isTopDown ? "Yes" : "No")); + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: Colortable entries: " << colors); + + return EC_Normal; +} + + +OFCondition I2DBmpSource::readColorPalette(Uint16 colors, + Uint32*& palette) +{ + if (colors == 0) + // Nothing to do; + return EC_Normal; + + if (colors > 256) + // BMPs can not have more than 256 color table entries + return EC_IllegalCall; + + // Read the color palette + palette = new Uint32[colors]; + for (int i = 0; i < colors; i++) { + Uint32 tmp; + + // Each item is 32-bit BGRx entry, this function reads that data + if (readDWord(tmp) != 0) { + delete[] palette; + palette = NULL; + return EC_EndOfStream; + } + + // Converting this BGRx into RGB is done elsewhere + palette[i] = tmp; + } + + return EC_Normal; +} + + +OFCondition I2DBmpSource::readBitmapData(const Uint16 width, + const Uint16 height, + const Uint16 bpp, + const OFBool isTopDown, + const Uint16 colors, + const Uint32* palette, + char*& pixData, + Uint32& length) +{ + /* row_length = width * bits_per_pixel / 8 bits_per_byte. + row_length must be rounded *up* to a 4-byte boundary: + row_length = (row_length + 3) & ~3 + */ + + const Uint32 row_length = ((width * bpp + 31) / 32) * 4; + Uint8 *row_data; + Uint32 y; + OFBool positive_direction; + Uint32 max; + + // "palette" may only be NULL if colors is 0 and vice versa + if ((palette == NULL) != (colors == 0)) + return EC_IllegalCall; + + // These bit depths always need a color palette + if (colors == 0 && (bpp == 1 || bpp == 4 || bpp == 8)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "invalid BMP file - missing color palette"); + + if (isTopDown) + { + /* This is a top-down BMP, we start at the first row and work our way down */ + y = 1; + positive_direction = OFTrue; + max = height + 1; + } + else + { + /* Bottom-up BMP, we start with the last row and work our way up */ + y = height; + positive_direction = OFFalse; + max = 0; + } + + length = width * height * 3; + + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: Starting to read bitmap data"); + + row_data = new Uint8[row_length]; + pixData = new char[length]; + + if (!row_data || !pixData) + { + delete[] row_data; + delete[] pixData; + return EC_MemoryExhausted; + } + + /* Go through each row of the image */ + for (; y != max; (positive_direction ? ++y : --y)) + { + /* Calculate posData for this line, it is the index of the first byte for + * this line. ( -1 because we start at index 1, but C at index 0) + */ + Uint32 posData = (y - 1) * width * 3; + + if (bmpFile.fread(row_data, 1, row_length) < row_length) + { + delete[] row_data; + delete[] pixData; + return EC_EndOfStream; + } + + OFCondition cond; + switch (bpp) + { + case 1: + case 4: + case 8: + cond = parseIndexedColorRow(row_data, width, bpp, colors, palette, &pixData[posData]); + break; + case 16: + cond = parse16BppRow(row_data, width, &pixData[posData]); + break; + case 24: + case 32: + cond = parse24_32BppRow(row_data, width, bpp, &pixData[posData]); + break; + default: + cond = makeOFCondition(OFM_dcmdata, 18, OF_error, "unsupported BMP file - invalid bpp"); + break; + } + if (cond.bad()) + { + delete[] row_data; + delete[] pixData; + return cond; + } + } + + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: Done reading bitmap data"); + + delete[] row_data; + + return EC_Normal; +} + + +OFCondition I2DBmpSource::parse24_32BppRow(const Uint8 *row, + const Uint16 width, + const int bpp, + char *pixData) const +{ + /* We now must convert this line of the bmp file into the kind of data that + * our caller expects. Each pixel consists of three bytes: blue, green, red + * (notice the order!) pixel value. We convert this into "standard" RGB. + */ + Uint32 x; + Uint32 pos_a = 0; + Uint32 pos_b = 0; + + /* 32bpp images really are 24bpp images with a null byte prepended in front of + * each pixel. Some apps use that as an alpha channel, but that's not allowed. + */ + int offset = 0; + if (bpp == 32) + offset = 1; + + for (x = 0; x < width; x++) + { + Uint8 r = row[pos_a + 2]; + Uint8 g = row[pos_a + 1]; + Uint8 b = row[pos_a]; + + pixData[pos_b] = r; + pixData[pos_b + 1] = g; + pixData[pos_b + 2] = b; + + pos_a += 3 + offset; + pos_b += 3; + } + return EC_Normal; +} + + +OFCondition I2DBmpSource::parse16BppRow(const Uint8 *row, + const Uint16 width, + char *pixData) const +{ + /* We now must convert this line of the bmp file into the kind of data that + * our caller expects. Each pixel consists of three bytes: blue, green, red + * (notice the order!) pixel value. We convert this into "standard" RGB. + */ + Uint32 x; + Uint32 pos = 0; + + for (x = 0; x < width; x++) + { + // Assemble one pixel value from the input data + Uint16 pixel = 0; + pixel = OFstatic_cast(Uint16, pixel | (row[2*x + 1] << 8)); + pixel = OFstatic_cast(Uint16, pixel | row[2*x + 0]); + + // Each colors has 5 bit, we convert that into 8 bit + Uint8 r = OFstatic_cast(Uint8, (pixel >> 10) << 3); + Uint8 g = OFstatic_cast(Uint8, (pixel >> 5) << 3); + Uint8 b = OFstatic_cast(Uint8, (pixel >> 0) << 3); + + pixData[pos] = r; + pixData[pos + 1] = g; + pixData[pos + 2] = b; + + pos += 3; + } + return EC_Normal; +} + + +OFCondition I2DBmpSource::parseIndexedColorRow(const Uint8 *row, + const Uint16 width, + const int bpp, + const Uint16 colors, + const Uint32* palette, + char *pixData /*out*/) const +{ + // data that is still left from reading the last pixel + Uint8 data = 0; + // Number of valid bits in data + Uint8 bitsLeft = 0; + + Uint32 pos = 0; + Uint32 pos_input = 0; + for (Uint32 x = 0; x < width; x++) + { + // Check if we need to go to the next byte of input data + if (bitsLeft == 0) + { + bitsLeft = 8; + data = row[pos_input++]; + } + + // Get the left-most bpp bits from data + Uint8 index = OFstatic_cast(Uint8, data >> (bitsLeft - bpp)); + // The right-most bpp bits in "index" now contain the data we want, + // clear all the higher bits. + // (1 << bpp) gives us in binary: 00001000 (with bpp zero bits) if we + // substract 1, only the right-most bpp bits will be 1. + index = OFstatic_cast(Uint8, index & ((1 << bpp) - 1)); + bitsLeft = OFstatic_cast(Uint8, bitsLeft - bpp); + + // Check if we are still in the color palette + if (index >= colors) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "unsupported BMP file - access beyond end of color table"); + + // Get the colors + Uint32 pixel = palette[index]; + + // And save it in the resulting image, this implicitly converts the BGR we + // got from the color table into RGB. + pixData[pos] = OFstatic_cast(Uint8, pixel >> 16); + pixData[pos + 1] = OFstatic_cast(Uint8, pixel >> 8); + pixData[pos + 2] = OFstatic_cast(Uint8, pixel >> 0); + + pos += 3; + } + return EC_Normal; +} + + +/* Read 2 bytes, convert to unsigned int */ +/* All 2-byte quantities in BMP are little-endian */ +int I2DBmpSource::readWord(Uint16& result) +{ + int c1, c2; + c1 = bmpFile.fgetc(); + if (c1 == EOF) + return EOF; + c2 = bmpFile.fgetc(); + if (c2 == EOF) + return EOF; + result = OFstatic_cast(Uint16, (OFstatic_cast(Uint16, c2) << 8) + OFstatic_cast(Uint16, c1)); + return 0; +} + + +/* Read 4 bytes, convert to unsigned int */ +/* All 4-byte quantities in BMP are little-endian */ +int I2DBmpSource::readDWord(Uint32& result) +{ + int c1, c2, c3, c4; + c1 = bmpFile.fgetc(); + if (c1 == EOF) + return EOF; + c2 = bmpFile.fgetc(); + if (c2 == EOF) + return EOF; + c3 = bmpFile.fgetc(); + if (c3 == EOF) + return EOF; + c4 = bmpFile.fgetc(); + if (c4 == EOF) + return EOF; + result = (OFstatic_cast(Uint32, c4) << 24) + + (OFstatic_cast(Uint32, c3) << 16) + + (OFstatic_cast(Uint32, c2) << 8) + + OFstatic_cast(Uint32, c1); + return 0; +} + + +int I2DBmpSource::readLong(Sint32& result) +{ + Uint32 tmp; + + /* First read, it as a "normal" double word */ + if (readDWord(tmp) != 0) + return EOF; + + /* tmp is a two's complement (signed integer) and we have to convert it into that */ + if (tmp & (1UL << 31)) + { + /* If the highest bit is set, it is a negative number, convert it */ + result = -(OFstatic_cast(Sint32, ~(tmp - 1))); + } + else + { + /* It is a positive number, no conversion necessary */ + result = tmp; + } + + return 0; +} + + +// closes underlying BMP file +void I2DBmpSource::closeFile() +{ + bmpFile.fclose(); +} + + +// close file and free dynamically allocated memory +I2DBmpSource::~I2DBmpSource() +{ + DCMDATA_LIBI2D_DEBUG("I2DBmpSource: Closing BMP file and cleaning up memory"); + closeFile(); +} diff --git a/dcmdata/libi2d/i2djpgs.cc b/dcmdata/libi2d/i2djpgs.cc new file mode 100644 index 00000000..8a65fed0 --- /dev/null +++ b/dcmdata/libi2d/i2djpgs.cc @@ -0,0 +1,915 @@ +/* + * + * Copyright (C) 2007-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class to extract pixel data and meta information from JPEG file + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/libi2d/i2djpgs.h" +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" +#include "dcmtk/dcmdata/dcerror.h" + +I2DJpegSource::I2DJpegSource() : m_jpegFileMap(), jpegFile(), + m_disableProgrTs(OFFalse), m_disableExtSeqTs(OFFalse), m_insistOnJFIF(OFFalse), + m_keepAPPn(OFFalse), m_lossyCompressed(OFTrue) +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Plugin instantiated"); +} + + +OFString I2DJpegSource::inputFormat() const +{ + return "JPEG"; +} + +OFCondition I2DJpegSource::openFile(const OFString &filename) +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Opening JPEG file: " << filename); + OFCondition cond; + if (filename.empty()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "No JPEG filename specified"); + + // Try to open JPEG file + if ((jpegFile.fopen(filename.c_str(), "rb")) == OFFalse) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to open JPEG file"); + + return cond; +} + + +void I2DJpegSource::setExtSeqSupport(const OFBool enabled) +{ + m_disableExtSeqTs = !enabled; +} + + +void I2DJpegSource::setProgrSupport(const OFBool enabled) +{ + m_disableProgrTs = !enabled; +} + + +void I2DJpegSource::setInsistOnJFIF(const OFBool enabled) +{ + m_insistOnJFIF = enabled; +} + + +void I2DJpegSource::setKeepAPPn(const OFBool enabled) +{ + m_keepAPPn = enabled; +} + + +OFCondition I2DJpegSource::readPixelData(Uint16& rows, + Uint16& cols, + Uint16& samplesPerPixel, + OFString& photoMetrInt, + Uint16& bitsAlloc, + Uint16& bitsStored, + Uint16& highBit, + Uint16& pixelRepr, + Uint16& planConf, + Uint16& pixAspectH, + Uint16& pixAspectV, + char*& pixData, + Uint32& length, + E_TransferSyntax &ts) +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Importing JPEG pixel data"); + OFCondition cond = openFile(m_imageFile); + // return error if file is not open + if (cond.bad()) + { + closeFile(); + return cond; + } + // Create "map" with byte positions of all JPEG markers in JPEG file + cond = createJPEGFileMap(); + if (cond.bad()) + { + clearMap(); + closeFile(); + return cond; + } + + // Check for image data in file (look for SOF marker) + E_JPGMARKER jpegEncoding; + OFListIterator(JPEGFileMapEntry*) entry = m_jpegFileMap.begin(); + while (entry != m_jpegFileMap.end()) + { + if ( isSOFMarker((*entry)->marker) ) + { + jpegEncoding = OFstatic_cast(E_JPGMARKER, (*entry)->marker); + break; + } + entry++; + } + if (entry == m_jpegFileMap.end()) + { + closeFile(); + return makeOFCondition(OFM_dcmdata, 18, OF_error, "No image data found in JPEG file"); + } + + // Reject arithmetic and hierarchical (differential) encodings (not supported) + cond = isJPEGEncodingSupported(jpegEncoding); + if (cond.bad()) + { + closeFile(); + return cond; + } + + // Get transfer syntax associated with the given JPEG encoding + ts = associatedTS(jpegEncoding); + + // Extract width, height, samples per pixel, bits per sample + Uint16 width, height, spp, bps; + cond = getSOFImageParameters(**entry, width, height, spp, bps); + if (cond.bad()) + { + closeFile(); + return cond; + } + + // Return error if invalid image attributes were found + if (height == 0 || width == 0) + { + closeFile(); + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Invalid image size (width or height = 0)"); + } + + // Examine JFIF information (version, horizontal and vertical aspect ratio, aspect ratio units. + Uint16 jfifVersion, unit; + Uint16 aspectH = 1; + Uint16 aspectV = 1; + entry = m_jpegFileMap.begin(); + while (entry != m_jpegFileMap.end()) + { + if ( (*entry)->marker == E_JPGMARKER_APP0 ) + break; + entry++; + } + if ( entry == m_jpegFileMap.end()) + { + if (!m_insistOnJFIF) + { + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Ignoring missing JFIF header"); + } + else + { + closeFile(); + return makeOFCondition(OFM_dcmdata, 18, OF_error, "No JFIF information found in JPEG file"); + } + } + else + cond = getJFIFImageParameters(**entry, jfifVersion, aspectH, aspectV, unit); + if (cond.bad()) + { + if (!m_insistOnJFIF) + { + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Ignoring errors while evaluating JFIF data"); + } + else + { + closeFile(); + return cond; + } + } + pixAspectH = aspectH; + pixAspectV = aspectV; + + // Collect information needed for image pixel module + rows = height; + cols = width; + samplesPerPixel = spp; + bitsAlloc = bps; + // Some output formats do not allow 12 bit at all, so it is more safe to + // use 16 bit for Bits Allocated (and therefore for Bits Stored, see below) + if (bitsAlloc == 12) + { + bitsAlloc = 16; + } + bitsStored = bitsAlloc; + highBit = OFstatic_cast(Uint16, bitsStored - 1); + if (samplesPerPixel == 1) + photoMetrInt = "MONOCHROME2"; + else if (samplesPerPixel == 3) + photoMetrInt = "YBR_FULL_422"; + else + return makeOFCondition(OFM_dcmdata, 18, OF_error, "For JPEG data, Samples per Pixel must be 1 or 3"); + // Planar Configuration and Pixel Representation is always 0 for JPEG data + planConf = 0; + pixelRepr = 0; + + Uint32 tLength = 0; + char* tPixelData = NULL; + // Keep all APPx info (however, JFIF is always removed) + if (m_keepAPPn) + cond = copyJPEGStream(tPixelData, tLength); + // Cut off all APPx information from JPEG and get raw JPEG bit stream into memory + else + cond = extractRawJPEGStream(tPixelData, tLength); + if (cond.bad()) + { + closeFile(); + return cond; + } + length = tLength; + pixData = tPixelData; + return cond; +} + + +OFCondition I2DJpegSource::getLossyComprInfo(OFBool& srcEncodingLossy, + OFString& srcLossyComprMethod) const +{ + if (m_lossyCompressed) + { + srcEncodingLossy = OFTrue; + srcLossyComprMethod = "ISO_10918_1"; // Defined term for JPEG Lossy Compression + } + else + { + // (will never get here, no lossless input supported so far) + srcEncodingLossy = OFFalse; + } + return EC_Normal; +} + + +OFCondition I2DJpegSource::getSOFImageParameters( const JPEGFileMapEntry& entry, + Uint16& imageWidth, + Uint16& imageHeight, + Uint16& samplesPerPixel, + Uint16& bitsPerSample) +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Examining JPEG SOF image parameters"); + if ( (entry.marker < E_JPGMARKER_SOF0) || (entry.marker > E_JPGMARKER_SOF15) ) + return EC_IllegalCall; + Uint16 length; + Uint16 image_height, image_width; + Uint8 data_precision, num_components; + int result; + + // seek to the given SOFn marker + + jpegFile.fseek(entry.bytePos, SEEK_SET); + result = read2Bytes(length); /* usual parameter length count */ + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + + // read values + + result = read1Byte(data_precision); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + + result = read2Bytes(image_height); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + + result = read2Bytes(image_width); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + + result = read1Byte(num_components); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + + imageWidth = image_width; + imageHeight = image_height; + samplesPerPixel = num_components; + bitsPerSample = data_precision; + + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Dumping JPEG SOF image parameters:"); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Image Width: " << image_width); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Image Height: " << image_height); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Number of Components: " << OFstatic_cast(unsigned int, num_components)); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Data Precision: " << OFstatic_cast(unsigned int, data_precision)); + + if (length != OFstatic_cast(unsigned int, 8 + num_components * 3)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Bogus SOF marker length"); + + return EC_Normal; +} + + +// ignores thumbnail data +OFCondition I2DJpegSource::getJFIFImageParameters( const JPEGFileMapEntry& entry, + Uint16& jfifVersion, + Uint16& pixelAspectH, + Uint16& pixelAspectV, + Uint16& unit) +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Examining JFIF information"); + if (entry.marker != E_JPGMARKER_APP0) + return EC_IllegalCall; + Uint16 jv, pah, pav, unt; + + // go to specified byte position and read on to value field + Uint16 length; + jpegFile.fseek(entry.bytePos, SEEK_SET); + int result = read2Bytes(length); /* usual parameter length count */ + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + + // read and check the 5 byte "JFIF" marker value (X'4A', X'46', X'49', X'46', X'00') + Uint16 twoBytes; + result = read2Bytes(twoBytes); + if ( (result == EOF) || (twoBytes != 0x4a46) ) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Invalid JFIF marker or JFIF marker not found"); + result = read2Bytes(twoBytes); + if ( (result == EOF) || (twoBytes != 0x4946) ) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Invalid JFIF marker or JFIF marker not found"); + Uint8 oneByte; + result = read1Byte(oneByte); + if ( (result == EOF)|| (oneByte != 0x00) ) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Invalid JFIF marker or JFIF marker not found"); + + // read JFIF version + result = read2Bytes(twoBytes); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + jv = twoBytes; + + // read pixel aspect ratio unit + result = read1Byte(oneByte); + if ( (result == EOF) || (oneByte > 2) ) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + unt = oneByte; + + // read horizontal aspect ratio (XDensity) + result = read2Bytes(twoBytes); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + pah = twoBytes; + + // read vertical aspect ratio (YDensity) + result = read2Bytes(twoBytes); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + pav = twoBytes; + + // prepare return values and return + jfifVersion = jv; + pixelAspectH = pah; + pixelAspectV = pav; + unit = unt; + + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Dumping some JFIF image parameters:"); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: JFIF version: " << jfifVersion); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Horizontal Pixel Aspect Ratio " << pixelAspectH); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Vertical Pixel Aspect Ratio: " << pixelAspectV); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Units: " << unit); + + return EC_Normal; +} + + +OFCondition I2DJpegSource::copyJPEGStream(char*& pixelData, + Uint32& pixLength) +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Copying JPEG data from JPEG file"); + /* Calculate length of total stream as found in the file + * Therefore, look at byte positions from SOI and EOI marker */ + + offile_off_t bytePosJFIF = 0; + offile_off_t bytePosAfterJFIF = 0; + int marker = 0; + + // determine file size + offile_off_t result = jpegFile.fseek(0, SEEK_END); + if (result != 0) + return EC_IllegalParameter; + offile_off_t filesize = jpegFile.ftell(); + + // Only pixel data up to 2^32 bytes is supported (DICOM) and maximum size for "new" operator = size_t + + if ( ( OFstatic_cast(unsigned long, filesize) > OFstatic_cast(unsigned long, 4294967294UL) ) || + ( OFstatic_cast(unsigned long, filesize) > OFstatic_cast(unsigned long, -1) ) ) + { + DCMDATA_LIBI2D_ERROR("I2DJpegSource: JPEG file length longer than 2^32 bytes (or larger than size_t capacity), aborting"); + return EC_MemoryExhausted; + } + + // get position of JFIF section and SOI marker + OFListIterator(JPEGFileMapEntry*) entry = m_jpegFileMap.begin(); + while (entry != m_jpegFileMap.end()) + { + marker = (*entry)->marker; + if ( marker == E_JPGMARKER_APP0 ) + { + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Skipping application segment APP0"); + bytePosJFIF = (*entry)->bytePos - 1; // include first byte of marker (FF) + entry++; + bytePosAfterJFIF = (*entry)->bytePos - 1; // include first byte (FF) of marker after APPn + break; + } + entry++; + } + + // Go to starting position (SOI marker) of JPEG stream data + jpegFile.fseek(0, SEEK_SET); + + // Allocate buffer for raw JPEG data + pixLength = OFstatic_cast(Uint32, filesize - (bytePosAfterJFIF - bytePosJFIF)); + pixelData = new char[pixLength]; + char *currBufferPos = pixelData; + + // exclude JFIF if present + if (bytePosJFIF != 0) + { + // read from SOI to JFIF + result = jpegFile.fread (currBufferPos, 1, 2); + if (result != 2) + return EC_IllegalCall; + currBufferPos += 2; + // read from end of JFIF to end of file + jpegFile.fseek(bytePosAfterJFIF - 1, SEEK_SET); // -1 because offsets start with 0 + result = jpegFile.fread (currBufferPos, 1, OFstatic_cast(size_t, filesize - bytePosAfterJFIF + 1)); + if (result != filesize - bytePosAfterJFIF + 1) + return EC_IllegalCall; + } + else // otherwise copy everything starting with SOI marker + { + result = jpegFile.fread (currBufferPos, 1, OFstatic_cast(size_t, filesize)); + if (result != filesize) + return EC_IllegalCall; + } + return EC_Normal; +} + + +// expects valid JPEG stream (especially exactly one SOI and one EOI marker) +OFCondition I2DJpegSource::extractRawJPEGStream(char*& pixelData, + Uint32& pixLength) +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Extracting JPEG data from JPEG file"); + OFCondition cond; + int marker = 0; + Uint16 length; + + /* Calculate length of total stream as found in the file + * Therefore, look at byte positions from SOI and EOI marker and + * and exclude all APPn markers in calculation + */ + + offile_off_t bytePosSOI = 0; + offile_off_t bytePosEOI = 0; + offile_off_t totalAPPSize = 0; + OFList appPosAndLengths; + + OFListIterator(JPEGFileMapEntry*) entry = m_jpegFileMap.begin(); + while (entry != m_jpegFileMap.end()) + { + marker = (*entry)->marker; + + if (marker == E_JPGMARKER_SOI) + { + bytePosSOI = (*entry)->bytePos; + // Subtract one byte for the preceding 0xFF of the SOI-Marker + bytePosSOI -= 1; + } + else if (marker == E_JPGMARKER_EOI) + { + bytePosEOI = (*entry)->bytePos; + // No need to subtract / add bytes + break; + } + else if (marker >= E_JPGMARKER_APP0 && marker <= E_JPGMARKER_APP15) + { + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Skipping application segment APP" << (marker - E_JPGMARKER_APP0)); + jpegFile.fseek((*entry)->bytePos - jpegFile.ftell(), SEEK_CUR); + int result = read2Bytes( length); + if (result == EOF) + { + jpegFile.fclose(); + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + } + // remember pos and length of APP data so we don't need a second "scan" for that + appPosAndLengths.push_back( (*entry)->bytePos - 1 ); // -1 for FF of marker + appPosAndLengths.push_back( length ); + // add length of marker value to total APP size + totalAPPSize += length; + // add the marker length itself to total APP size + totalAPPSize += 2; + } + // Advance to next segment + entry++; + } + + if ( (entry == m_jpegFileMap.end()) || (bytePosSOI == 0) || (bytePosEOI == 0)) // at least end marker was not found + return EC_IllegalCall; + + offile_off_t rawStreamSize = bytePosEOI - bytePosSOI - totalAPPSize; + // Start position n and endpos. m results in a total amount of m-n+1 bytes + rawStreamSize++; + + // Allocate buffer for raw JPEG data + // Only pixel data up to 2^32 bytes is supported (DICOM) + if ( ( OFstatic_cast(unsigned long, rawStreamSize) > OFstatic_cast(unsigned long, 4294967294UL) ) || + ( OFstatic_cast(unsigned long, rawStreamSize) > OFstatic_cast(unsigned long, -1) ) ) + { + DCMDATA_LIBI2D_ERROR("I2DJpegSource: Raw JPEG stream length longer than 2^32 bytes (or larger than size_t capacity), aborting"); + return EC_MemoryExhausted; + } + pixelData = new char[OFstatic_cast(size_t, rawStreamSize)]; + // keep track of current write position in memory buffer + char *currBufferPos = pixelData; + + // Go to starting position (SOI marker) of JPEG stream data + jpegFile.fseek(bytePosSOI-1, SEEK_SET); + + /* Copy everything but leave out APP segments + */ + OFBool finished = OFFalse; + offile_off_t endOfBlock = 0; offile_off_t startOfNextBlock = 0; + while (!finished) + { + // determine position of the next block to be read + if ( appPosAndLengths.size() != 0) + { + // we have some APP blocks left + endOfBlock = appPosAndLengths.front() - 1; + appPosAndLengths.pop_front(); + startOfNextBlock = endOfBlock + appPosAndLengths.front() + 2; // +2 for marker + appPosAndLengths.pop_front(); + } + else // we can read to the end + { + endOfBlock = bytePosEOI; + finished = OFTrue; + } + // read block + offile_off_t blockSize = endOfBlock - jpegFile.ftell(); + if (blockSize < 0) + { + DCMDATA_LIBI2D_ERROR("Length field in JPEG data bigger than remaining file"); + cond = makeOFCondition(OFM_dcmdata, 18, OF_error, "Length field in JPEG data bigger than remaining file"); + } + if (cond.good()) + { + size_t result = jpegFile.fread (currBufferPos, 1, OFstatic_cast(size_t, blockSize)); + if (result != OFstatic_cast(size_t, blockSize)) + cond = EC_IllegalCall; + else if (!finished) + { + jpegFile.fseek(startOfNextBlock, SEEK_SET); + currBufferPos += blockSize; + } + } + } + // update result variable + pixLength = OFstatic_cast(Uint32, rawStreamSize); + if (cond.bad()) + { + delete[] pixelData; + } + return cond; +} + + +OFCondition I2DJpegSource::createJPEGFileMap() +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Examing JPEG file and creating map of JPEG markers"); + // clear any old data + clearMap(); + E_JPGMARKER marker; + JPEGFileMapEntry *entry = NULL; + OFBool lastWasSOSMarker = OFFalse; + OFCondition cond; + + /* Expect SOI at start of file */ + E_JPGMARKER first = E_JPGMARKER(); + cond = firstMarker(first); + if (cond.bad()) + return cond; + entry = new JPEGFileMapEntry(); + entry->bytePos = jpegFile.ftell(); + entry->marker = first; + m_jpegFileMap.push_back(entry); + + if (first != E_JPGMARKER_SOI) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DJpegSource: SOI marker not found at beginning of JPEG stream"); + + /* Scan miscellaneous markers until we reach EOI */ + while (cond.good()) + { + cond = nextMarker(lastWasSOSMarker, marker); + if (cond.good()) + { + entry = new JPEGFileMapEntry(); + entry->bytePos = jpegFile.ftell(); + entry->marker = marker; + m_jpegFileMap.push_back(entry); + if (marker == E_JPGMARKER_SOS) + { + // FIXME: reset this to OFFalse after the next marker? + lastWasSOSMarker = OFTrue; + } + else if (marker == E_JPGMARKER_EOI) + { + // End of file reached + cond = EC_Normal; + break; + } + else if ( isSOFMarker(marker) && m_keepAPPn ) + { + cond = EC_Normal; + break; + } + if ( !isRSTMarker(marker) ) // RST marker does not have a length that could be used for skipping + skipVariable(); + } + } /* end loop */ + debugDumpJPEGFileMap(); + return cond; +} + + +OFBool I2DJpegSource::isRSTMarker(const E_JPGMARKER& marker) +{ + return ((marker >= E_JPGMARKER_RST0) && (marker <= E_JPGMARKER_RST7)); +} + + +OFBool I2DJpegSource::isSOFMarker(const E_JPGMARKER& marker) +{ + return ( (marker >= E_JPGMARKER_SOF0) && (marker <= E_JPGMARKER_SOF15) + && (marker != E_JPGMARKER_DHT) && (marker != E_JPGMARKER_DAC)); +} + + +OFString I2DJpegSource::jpegMarkerToString(const E_JPGMARKER& marker) +{ + switch (marker) + { + case(E_JPGMARKER_SOF0) : return "SOF0: Baseline DCT"; break; + case(E_JPGMARKER_SOF1) : return "SOF1: Extended sequential DCT"; break; + case(E_JPGMARKER_SOF2) : return "SOF2: Progressive DCT"; break; + case(E_JPGMARKER_SOF3) : return "SOF3: Lossless (sequential)"; break; + case(E_JPGMARKER_SOF5) : return "SOF5: Differential sequential DCT"; break; + case(E_JPGMARKER_SOF6) : return "SOF6: Differential progressive DCT"; break; + case(E_JPGMARKER_SOF7) : return "SOF7: Differential lossless (sequential)"; break; + case(E_JPGMARKER_JPG) : return "JPG: JPEG extension"; break; + case(E_JPGMARKER_SOF9) : return "SOF9: Extended sequential DCT"; break; + case(E_JPGMARKER_SOF10) : return "SOF10: Progressive DCT"; break; + case(E_JPGMARKER_SOF11) : return "SOF11: Lossless (sequential)"; break; + case(E_JPGMARKER_SOF13) : return "SOF13: Differential sequential DCT"; break; + case(E_JPGMARKER_SOF14) : return "SOF14: Differential progressive DCT"; break; + case(E_JPGMARKER_SOF15) : return "SOF15: Differential lossless (sequential)"; break; + case(E_JPGMARKER_DHT) : return "DHT: Huffman table(s)"; break; + case(E_JPGMARKER_DAC) : return "DAC: Arithmetic coding conditioning(s)"; break; + case(E_JPGMARKER_SOI) : return "SOI: Start of image"; break; + case(E_JPGMARKER_EOI) : return "EOI: End of image"; break; + case(E_JPGMARKER_SOS) : return "SOS: Start of scan"; break; + case(E_JPGMARKER_DQT) : return "DQT: Quantization table(s)"; break; + case(E_JPGMARKER_DNL) : return "DNL: Number of lines"; break; + case(E_JPGMARKER_DRI) : return "DRI: Define restart interval"; break; + case(E_JPGMARKER_DHP) : return "DHP: Hierarchical progression"; break; + case(E_JPGMARKER_EXP) : return "EXP: Expand reference component(s)"; break; + case(E_JPGMARKER_COM) : return "COM: Comment"; break; + case(E_JPGMARKER_TEM) : return "TEM: For temporary private use in arithmetic coding"; break; + + default: + if ((marker >= E_JPGMARKER_RST0) && (marker <= E_JPGMARKER_RST7)) {return "RSTn: Restart interval termination"; break;} + if ((marker >= E_JPGMARKER_APP0) && (marker <= E_JPGMARKER_APP15)) {return "APPn: Application segment"; break;} + if ((marker >= E_JPGMARKER_JPGN0) && (marker <= E_JPGMARKER_JPGN13)) {return "JPGn: JPEG extension"; break;} + if ((marker >= E_JPGMARKER_RES0) && (marker <= E_JPGMARKER_RESN)) {return "RESn"; break;} + } + OFString msg = "UNKNOWN MARKER :"; + char hexNo[10]; + sprintf(hexNo,"%x2", marker); + msg += hexNo; + return msg; +} + + +/* Read one byte, testing for EOF */ +int I2DJpegSource::read1Byte(Uint8& result) +{ + int c; + c = jpegFile.fgetc(); + if (c == EOF) + return EOF; + result = OFstatic_cast(Uint8, c); + return 0; +} + + +/* Read 2 bytes, convert to unsigned int */ +/* All 2-byte quantities in JPEG markers are MSB first */ +int I2DJpegSource::read2Bytes(Uint16& result) +{ + int c1, c2; + c1 = jpegFile.fgetc(); + if (c1 == EOF) + return EOF; + c2 = jpegFile.fgetc(); + if (c2 == EOF) + return EOF; + result = OFstatic_cast(Uint16, ((OFstatic_cast(Uint16, c1)) << 8) + OFstatic_cast(Uint16, c2)); + return 0; +} + + + +/* + * Find the next JPEG marker and return its marker code. + * We expect at least one FF byte, possibly more if the compressor used FFs + * to pad the file. + * There could also be non-FF garbage between markers. The treatment of such + * garbage is unspecified; we choose to skip over it but emit a warning msg. + */ + +OFCondition I2DJpegSource::nextMarker(const OFBool& lastWasSOSMarker, + E_JPGMARKER& result) +{ + Uint8 c; + int discarded_bytes = 0; + int oneByte; + + do { + /* Find 0xFF byte; count and skip any non-FFs. */ + oneByte = read1Byte(c); + if (oneByte == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + + while (c != 0xFF) + { + if (!lastWasSOSMarker) + discarded_bytes++; + oneByte = read1Byte(c); + if (oneByte == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + } + /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs + * are legal as pad bytes, so don't count them in discarded_bytes. + */ + do { + oneByte = read1Byte(c); + if (oneByte == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + } while (c == 0xFF); + } while (lastWasSOSMarker && c == 0x00); + + if (discarded_bytes != 0) { + DCMDATA_LIBI2D_WARN("garbage data found in JPEG file"); + } + result = OFstatic_cast(E_JPGMARKER, c); + return EC_Normal; +} + + +/* + * Read the initial marker, which should be SOI. + * For a JFIF file, the first two bytes of the file should be literally + * 0xFF M_SOI. + */ + +OFCondition I2DJpegSource::firstMarker(E_JPGMARKER& result) +{ + Uint8 c1, c2; + + c1 = OFstatic_cast(Uint8, jpegFile.fgetc()); + c2 = OFstatic_cast(Uint8, jpegFile.fgetc()); + if (c1 != 0xFF || c2 != E_JPGMARKER_SOI) { + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Not a JPEG file"); + } + result = OFstatic_cast(E_JPGMARKER, c2); + return EC_Normal; +} + +/* + * Most types of marker are followed by a variable-length parameter segment. + * This routine skips over the parameters for any marker we don't otherwise + * want to process. + * Note that we MUST skip the parameter segment explicitly in order not to + * be fooled by 0xFF bytes that might appear within the parameter segment; + * such bytes do NOT introduce new markers. + */ + +OFCondition I2DJpegSource::skipVariable() +/* Skip over an unknown or uninteresting variable-length marker */ +{ + Uint16 length; + + /* Get the marker parameter length count */ + int result = read2Bytes(length); + if (result == EOF) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Premature EOF in JPEG file"); + /* Length includes itself, so must be at least 2 */ + if (length < 2) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Erroneous JPEG marker length"); + length = OFstatic_cast(Uint16, length - 2); + /* Skip over the remaining bytes */ + jpegFile.fseek(length, SEEK_CUR); + return EC_Normal; +} + + +OFCondition I2DJpegSource::isJPEGEncodingSupported(const E_JPGMARKER& jpegEncoding) const +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Checking whether JPEG encoding is supported"); + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Encoding: " << jpegMarkerToString(jpegEncoding)); + switch (jpegEncoding) + { + case E_JPGMARKER_SOF0: // Baseline + return EC_Normal; + case E_JPGMARKER_SOF1: // Extended sequential + if (!m_disableExtSeqTs) + return EC_Normal; + else + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to convert: Extended sequential JPEG coding found but support disabled"); + case E_JPGMARKER_SOF2: // Progressive + if (!m_disableProgrTs) + return EC_Normal; + else + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to convert: Progressive JPEG coding found but disabled"); + // SOF3: Lossless, SOF5-7: Hierarchical (differential), SOF9-15: Arithmetic coding, all other + default: + OFString errMsg("JPEG data with encoding: '"); + errMsg += jpegMarkerToString(jpegEncoding); + errMsg += "' not supported"; + return makeOFCondition(OFM_dcmdata, 18, OF_error, errMsg.c_str()); + } + return EC_Normal; +} + + +E_TransferSyntax I2DJpegSource::associatedTS(const E_JPGMARKER& jpegEncoding) +{ + switch (jpegEncoding) + { + case E_JPGMARKER_SOF0: // Baseline + return EXS_JPEGProcess1; + case E_JPGMARKER_SOF1: // Extended Sequential + return EXS_JPEGProcess2_4; + case E_JPGMARKER_SOF2: // Progressive + return EXS_JPEGProcess10_12; + default: + return EXS_Unknown; + } +} + + +void I2DJpegSource::debugDumpJPEGFileMap() const +{ + if (!DCM_dcmdataLibi2dLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + return; + + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Dumping JPEG marker file map:"); + if (m_keepAPPn) + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Keep APPn option enabled, any markers after SOFn marker will not be dumped"); + OFListConstIterator(JPEGFileMapEntry*) it= m_jpegFileMap.begin(); + while (it != m_jpegFileMap.end()) + { + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Byte Position: 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setw(8) << STD_NAMESPACE setfill('0') + /* need to cast bytePos to unsigned long to keep VC6 happy */ + << OFstatic_cast(unsigned long, (*it)->bytePos) <<" | Marker: " << jpegMarkerToString( (*it)->marker)); + it++; + } +} + +void I2DJpegSource::clearMap() +{ + // free memory of each map entry and remove them all from list + JPEGFileMapEntry *entry = NULL; + while (m_jpegFileMap.size() != 0) + { + entry = m_jpegFileMap.front(); + m_jpegFileMap.pop_front(); + delete entry; entry = NULL; + } +} + +// closes underlying JPEG file +void I2DJpegSource::closeFile() +{ + jpegFile.fclose(); +} + +// close file and free dynamically allocated memory +I2DJpegSource::~I2DJpegSource() +{ + DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Closing JPEG file and cleaning up memory"); + closeFile(); + clearMap(); +} diff --git a/dcmdata/libi2d/i2dplnsc.cc b/dcmdata/libi2d/i2dplnsc.cc new file mode 100644 index 00000000..72bb0f7e --- /dev/null +++ b/dcmdata/libi2d/i2dplnsc.cc @@ -0,0 +1,260 @@ +/* + * + * Copyright (C) 2001-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Implements conversion from image into new DICOM SC IODs + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/libi2d/i2dplnsc.h" +#include "dcmtk/dcmdata/dcdeftag.h" /* for DCM_ defines */ +#include "dcmtk/dcmdata/dcuid.h" /* for UID_ defines */ +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" + + +I2DOutputPlugNewSC::I2DOutputPlugNewSC() +{ + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugNewSC: Output plugin for new Multiframe Secondary Capture SOPs initialized"); +} + + +OFString I2DOutputPlugNewSC::ident() +{ + return "New Secondary Capture Image SOP Classes"; +} + + +void I2DOutputPlugNewSC::supportedSOPClassUIDs(OFList& suppSOPs) +{ + suppSOPs.push_back(UID_MultiframeSingleBitSecondaryCaptureImageStorage); + suppSOPs.push_back(UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage); + suppSOPs.push_back(UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage); + suppSOPs.push_back(UID_MultiframeTrueColorSecondaryCaptureImageStorage); +} + + + +OFCondition I2DOutputPlugNewSC::convert(DcmDataset &dataset) const +{ + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugNewSC: Inserting new Multiframe SC specific attributes"); + + // Find out which of the new SC SOP Class UIDs to use + OFString sopUID, photInt; Uint16 bitsAllocated; + OFCondition cond = dataset.findAndGetUint16(DCM_BitsAllocated, bitsAllocated); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Unable to determine correct SOP class due to missing Image Pixel module information"); + cond = dataset.findAndGetOFStringArray(DCM_PhotometricInterpretation, photInt); + + if (bitsAllocated == 1) + cond = handle1BitSC(&dataset); + else if (bitsAllocated == 8) + cond = handle8BitSC(&dataset); + else if (bitsAllocated == 16) + cond = handle16BitSC(&dataset); + else + cond = makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Bits Allocated needs a value of 1, 8 or 16 for conversion"); + + cond = insertMultiFrameAttribs(&dataset); + return cond; +} + +OFString I2DOutputPlugNewSC::isValid(DcmDataset& dataset) const +{ + OFString err; + // Just return if checking was disabled + if (!m_doAttribChecking) + return err; + + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugNewSC: Checking new Multiframe SC specific attributes"); + // WSD="Workstation", found in most Secondary Capture files + err += checkAndInventType1Attrib(DCM_ConversionType, &dataset, "WSD"); + // As a default we do not expect the image to have burnt in annotations + err += checkAndInventType1Attrib(DCM_BurnedInAnnotation, &dataset, "NO"); + + return err; +} + + +OFCondition I2DOutputPlugNewSC::insertMultiFrameAttribs(DcmDataset* targetDataset) const +{ + if (!targetDataset) + return EC_IllegalParameter; + + // We only support 1 image Multi-frames so far + return targetDataset->putAndInsertOFStringArray(DCM_NumberOfFrames, "1"); + // Frame Increment pointer is set later in the more specific SC Multi-frame Image context +} + + +OFCondition I2DOutputPlugNewSC::handle1BitSC(DcmDataset *dataset) const +{ + if (!dataset) + return EC_IllegalParameter; + + OFCondition cond; Uint16 u16 = 0; OFString str; + cond = dataset->findAndGetOFStringArray(DCM_PhotometricInterpretation, str); + if (cond.bad() || (str != "MONOCHROME2")) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Photometric interpretation does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_SamplesPerPixel, u16); + if (cond.bad() || (u16 != 1)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Samples Per Pixel does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_BitsStored, u16); + if (cond.bad() || (u16 != 1)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Bits Stored does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_HighBit, u16); + if (cond.bad() || (u16 != 0)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: High Bit does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_PixelRepresentation, u16); + if (cond.bad() || (u16 != 0)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Pixel Representation does not fit SOP class"); + + cond = dataset->putAndInsertOFStringArray(DCM_SOPClassUID, UID_MultiframeSingleBitSecondaryCaptureImageStorage); + return cond; +} + + +OFCondition I2DOutputPlugNewSC::handle8BitSC(DcmDataset *dataset) const +{ + if (!dataset) + return EC_IllegalParameter; + + OFCondition cond; Uint16 u16 = 0; OFString str; + cond = dataset->findAndGetOFStringArray(DCM_PhotometricInterpretation, str); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Photometric interpretation not set for Pixel Data"); + if (str == "MONOCHROME2") // Mult-Frame Grayscale Byte SC Image + { + cond = dataset->findAndGetUint16(DCM_SamplesPerPixel, u16); + if (cond.bad() || (u16 != 1)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Samples Per Pixel does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_BitsStored, u16); + if (cond.bad() || (u16 != 8)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Bits Stored does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_HighBit, u16); + if (cond.bad() || (u16 != 7)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: High Bit does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_PixelRepresentation, u16); + if (cond.bad() || (u16 != 0)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Pixel Representation does not fit SOP class"); + // For MONOCHROME2 and Bits Stored > 1, rescale slope/intercept/type have to be inserted + cond = insertSCMultiFrameAttribs(dataset); + // Insert SOP Class UID + if (cond.good()) + cond = dataset->putAndInsertOFStringArray(DCM_SOPClassUID, UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage); + } + else if ((str == "YBR_FULL_422") || (str == "RGB")) // Mult-Frame True Color Byte SC Image + { + cond = dataset->findAndGetUint16(DCM_SamplesPerPixel, u16); + if (cond.bad() || (u16 != 3)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Samples Per Pixel does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_BitsStored, u16); + if (cond.bad() || (u16 != 8)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Bits Stored does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_HighBit, u16); + if (cond.bad() || (u16 != 7)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: High Bit does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_PixelRepresentation, u16); + if (cond.bad() || (u16 != 0)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Pixel Representation does not fit SOP class"); + + if (str == "RGB") // For RGB, Planar Configuration must be present and set to 0 + { + cond = dataset->findAndGetUint16(DCM_PlanarConfiguration, u16); + if (cond.bad() || (u16 != 0)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Planar Configuration does not fit SOP class"); + } + // Insert SOP Class UID + if (cond.good()) + cond = dataset->putAndInsertOFStringArray(DCM_SOPClassUID, UID_MultiframeTrueColorSecondaryCaptureImageStorage); + } + else + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Photometric interpretation does not fit SOP class"); + + return cond; +} + + +OFCondition I2DOutputPlugNewSC::handle16BitSC(DcmDataset *dataset) const +{ + if (!dataset) + return EC_IllegalParameter; + + OFCondition cond; Uint16 u16 = 0; OFString str; + cond = dataset->findAndGetOFStringArray(DCM_PhotometricInterpretation, str); + if (cond.bad() || (str != "MONOCHROME2")) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Photometric interpretation does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_SamplesPerPixel, u16); + if (cond.bad() || (u16 != 1)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Samples Per Pixel does not fit SOP class"); + + Uint16 bitsStored; + cond = dataset->findAndGetUint16(DCM_BitsStored, bitsStored); + if (cond.bad() || (bitsStored >= 16) || (bitsStored <9) ) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Bits Stored does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_HighBit, u16); + if (cond.bad() || (u16 != bitsStored -1)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: High Bit does not fit SOP class"); + + cond = dataset->findAndGetUint16(DCM_PixelRepresentation, u16); + if (cond.bad() || (u16 != 0)) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Pixel Representation does not fit SOP class"); + + // Insert SOP Class UID + cond = dataset->putAndInsertOFStringArray(DCM_SOPClassUID, UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage); + // For MONOCHROME2 and Bits Stored > 1, rescale slope/intercept/type have to be inserted + if (cond.good()) + cond = insertSCMultiFrameAttribs(dataset); + return cond; +} + + +OFCondition I2DOutputPlugNewSC::insertSCMultiFrameAttribs(DcmDataset *targetDataset) const +{ + OFCondition cond; + // Rescale Intercept, set to 0 (constant enumerated value) + cond = targetDataset->putAndInsertOFStringArray(DCM_RescaleIntercept, "0"); + // Rescale Slope, set to 1 (constant enumerated value) + if (cond.good()) + cond = targetDataset->putAndInsertOFStringArray(DCM_RescaleSlope, "1"); + // Rescale type, set to unspecified "US" (constant enumerated value) + if (cond.good()) + cond = targetDataset->putAndInsertOFStringArray(DCM_RescaleType, "US"); + // Rescale type, set to unspecified "IDENTITY" (constant enumerated value) + if (cond.good()) + cond = targetDataset->putAndInsertOFStringArray(DCM_PresentationLUTShape, "IDENTITY"); + else + return makeOFCondition(OFM_dcmdata, 18, OF_error, "I2DOutputPlugNewSC: Unable to insert attributes for Rescale Slope/Intercept/Type"); + return EC_Normal; +} + + +I2DOutputPlugNewSC::~I2DOutputPlugNewSC() +{ +} diff --git a/dcmdata/libi2d/i2dplsc.cc b/dcmdata/libi2d/i2dplsc.cc new file mode 100644 index 00000000..203dff77 --- /dev/null +++ b/dcmdata/libi2d/i2dplsc.cc @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 2001-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Implements conversion from image into DICOM SC IOD + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/libi2d/i2dplsc.h" +#include "dcmtk/dcmdata/libi2d/i2doutpl.h" +#include "dcmtk/dcmdata/dcdeftag.h" /* for DCM_ defines */ +#include "dcmtk/dcmdata/dcuid.h" /* for UID_ defines */ + + +I2DOutputPlugSC::I2DOutputPlugSC() +{ + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugSC: Output plugin for Secondary Capture initialized"); +} + +OFString I2DOutputPlugSC::ident() +{ + return "Secondary Capture Image SOP Class"; +} + +void I2DOutputPlugSC::supportedSOPClassUIDs(OFList& suppSOPs) +{ + suppSOPs.push_back(UID_SecondaryCaptureImageStorage); +} + + +OFCondition I2DOutputPlugSC::convert(DcmDataset &dataset) const +{ + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugSC: Inserting SC specific attributes"); + OFCondition cond; + cond = dataset.putAndInsertOFStringArray(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage); + + return EC_Normal; +} + + +OFString I2DOutputPlugSC::isValid(DcmDataset& dataset) const +{ + OFString err; + // Just return if checking was disabled + if (!m_doAttribChecking) + return err; + + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugSC: Checking SC specific attributes"); + err += checkAndInventType1Attrib(DCM_ConversionType, &dataset, "WSD"); // WSD="Workstation" + + return err; +} + + +I2DOutputPlugSC::~I2DOutputPlugSC() +{ +} diff --git a/dcmdata/libi2d/i2dplvlp.cc b/dcmdata/libi2d/i2dplvlp.cc new file mode 100644 index 00000000..536acba4 --- /dev/null +++ b/dcmdata/libi2d/i2dplvlp.cc @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 2001-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Implements conversion from image into DICOM Visible Light Photography IOD + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/libi2d/i2dplvlp.h" +#include "dcmtk/dcmdata/dcdeftag.h" /* for DCM_ defines */ +#include "dcmtk/dcmdata/dcuid.h" /* for UID_ defines */ + + +I2DOutputPlugVLP::I2DOutputPlugVLP() +{ + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugVLP: Output plugin for VLP initialized"); +} + +OFString I2DOutputPlugVLP::ident() +{ + return "Visible Light Photographic Image SOP Class"; +} + +void I2DOutputPlugVLP::supportedSOPClassUIDs(OFList& suppSOPs) +{ + suppSOPs.push_back(UID_VLPhotographicImageStorage); +} + + +OFCondition I2DOutputPlugVLP::convert(DcmDataset &dataset) const +{ + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugVLP: Inserting VLP specific attributes"); + OFCondition cond; + cond = dataset.putAndInsertOFStringArray(DCM_SOPClassUID, UID_VLPhotographicImageStorage); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to insert SOP class into dataset"); + + cond = dataset.putAndInsertOFStringArray(DCM_Modality, "XC"); + if (cond.bad()) + return makeOFCondition(OFM_dcmdata, 18, OF_error, "Unable to insert Modality (XC) into dataset"); + + return EC_Normal; +} + + +OFString I2DOutputPlugVLP::isValid(DcmDataset& dataset) const +{ + OFString err; + // Just return if checking was disabled + if (!m_doAttribChecking) + return err; + + DCMDATA_LIBI2D_DEBUG("I2DOutputPlugVLP: Checking VLP specific attributes for validity"); + // Acquisition Context Module + err = checkAndInventType2Attrib(DCM_AcquisitionContextSequence, &dataset); + + // General Equipment Module + err += checkAndInventType2Attrib(DCM_Manufacturer, &dataset); + + // VL Image Module + err += checkAndInventType1Attrib(DCM_ImageType, &dataset, "DERIVED\\SECONDARY"); + err += checkAndInventType2Attrib(DCM_LossyImageCompression, &dataset); + + return err; +} + + +I2DOutputPlugVLP::~I2DOutputPlugVLP() +{ +} diff --git a/dcmdata/libsrc/CMakeLists.txt b/dcmdata/libsrc/CMakeLists.txt new file mode 100644 index 00000000..a88e6b33 --- /dev/null +++ b/dcmdata/libsrc/CMakeLists.txt @@ -0,0 +1,51 @@ +# create library from source files + +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") + +DCMTK_ADD_LIBRARY(dcmdata + cmdlnarg dcbytstr dcchrstr dccodec dcdatset dcdatutl dcddirif dcdicdir dcdicent + dcdict dcdictbi dcdirrec dcelem dcencdoc dcerror dcfilefo dcfilter dchashdi dcistrma + dcistrmb dcistrmf dcistrmz dcitem dcjson dclist dcmatch dcmetinf dcobject dcostrma + dcostrmb dcostrmf dcostrmz dcpath dcpcache dcpixel dcpixseq dcpxitem dcrleccd + dcrlecce dcrlecp dcrledrg dcrleerg dcrlerp dcsequen dcspchrs dcstack dcswap dctag + dctagkey dctypes dcuid dcvr dcvrae dcvras dcvrat dcvrcs dcvrda dcvrds dcvrdt + dcvrfd dcvrfl dcvris dcvrlo dcvrlt dcvrobow dcvrod dcvrof dcvrol dcvrov dcvrpn + dcvrpobw dcvrsh dcvrsl dcvrss dcvrst dcvrsv dcvrtm dcvruc dcvrui dcvrul dcvrulup + dcvrur dcvrus dcvrut dcvruv dcwcache dcxfer vrscan vrscanl) + +DCMTK_TARGET_LINK_MODULES(dcmdata ofstd oflog) +DCMTK_TARGET_LINK_LIBRARIES(dcmdata ${ZLIB_LIBS}) + +# Various dictionary-related commands +set(DICOMDIC "${dcmdata_SOURCE_DIR}/data/dicom.dic") +set(PRIVATEDIC "${dcmdata_SOURCE_DIR}/data/private.dic") +set(DICTIONARIES "${DICOMDIC}" "${PRIVATEDIC}") + +if(BUILD_APPS) + # don't use DCMTK_ADD_EXECUTABLE() since we don't want to install the files + add_executable(mkdictbi EXCLUDE_FROM_ALL mkdictbi dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes) + add_executable(mkdeftag EXCLUDE_FROM_ALL mkdeftag dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes) + # workaround for Visual Studio to disable dll storage specifiers when linking directly into the executable. + # this is needed since the built-in dictionary code is created by the tools below and thus those tools + # statically link the few required dcmdata source files instead of linking to dcmdata as a whole. + set_target_properties(mkdictbi mkdeftag PROPERTIES COMPILE_DEFINITIONS "DCMDATA_BUILD_DICTIONARY") +endif() +DCMTK_TARGET_LINK_MODULES(mkdictbi ofstd oflog) +DCMTK_TARGET_LINK_MODULES(mkdeftag ofstd oflog) + +add_custom_target(updatedeftag + COMMAND mkdeftag -o "${dcmdata_SOURCE_DIR}/include/dcmtk/dcmdata/dcdeftag.h" ${DICTIONARIES} + DEPENDS mkdeftag + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generate a new include file of defined tags") + +add_custom_target(updatebuiltindict + COMMAND mkdictbi -o dcdictbi.cc ${DICTIONARIES} + DEPENDS mkdictbi + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generate a builtin data dictionary") + +add_custom_target(mkvrscan + COMMAND flex -8 --header-file=vrscanl.h --outfile=vrscanl.c vrscanl.l + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generate vrscanl.c and vrscanl.h") diff --git a/dcmdata/libsrc/Makefile.dep b/dcmdata/libsrc/Makefile.dep new file mode 100644 index 00000000..15cfb072 --- /dev/null +++ b/dcmdata/libsrc/Makefile.dep @@ -0,0 +1,4092 @@ +cmdlnarg.o: cmdlnarg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dcbytstr.o: dcbytstr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcmatch.h +dcchrstr.o: dcchrstr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcjson.h \ + ../include/dcmtk/dcmdata/dcmatch.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcelem.h +dccodec.o: dccodec.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcpixseq.h ../include/dcmtk/dcmdata/dcofsetl.h \ + ../include/dcmtk/dcmdata/dcpxitem.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmdata/dcbytstr.h +dcdatset.o: dcdatset.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcvrus.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dcostrmf.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmdata/dcistrmf.h ../include/dcmtk/dcmdata/dcwcache.h \ + ../include/dcmtk/dcmdata/dcfcache.h +dcdatutl.o: dcdatutl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h +dcddirif.o: dcddirif.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dcddirif.h ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcvrulup.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dccodec.h ../include/dcmtk/dcmdata/dcmetinf.h \ + ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcvrpobw.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrtm.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h +dcdicdir.o: dcdicdir.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcvrulup.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcostrmf.h \ + ../include/dcmtk/dcmdata/dcistrmf.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcmetinf.h \ + ../include/dcmtk/dcmdata/dcwcache.h ../include/dcmtk/dcmdata/dcfcache.h \ + ../include/dcmtk/dcmdata/dcvrui.h +dcdicent.o: dcdicent.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dcdict.o: dcdict.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcdict.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h +dcdictbi.o: dcdictbi.cc ../include/dcmtk/dcmdata/dcdict.h \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dchashdi.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdefine.h +dcdirrec.o: dcdirrec.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdicent.h \ + ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdict.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcmetinf.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcvrulup.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcpixseq.h ../include/dcmtk/dcmdata/dcofsetl.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcvrae.h \ + ../include/dcmtk/dcmdata/dcvras.h ../include/dcmtk/dcmdata/dcvrcs.h \ + ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +dcelem.o: dcelem.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcfcache.h \ + ../include/dcmtk/dcmdata/dcwcache.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/vrscan.h \ + ../include/dcmtk/dcmdata/dcpath.h ../include/dcmtk/dcmdata/dcdatset.h +dcencdoc.o: dcencdoc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcencdoc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../ofstd/include/dcmtk/ofstd/ofxml.h \ + ../include/dcmtk/dcmdata/dcpath.h ../include/dcmtk/dcmdata/dccodec.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrtm.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +dcerror.o: dcerror.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcdefine.h +dcfilefo.o: dcfilefo.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrae.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dcostrmf.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmdata/dcistrmf.h ../include/dcmtk/dcmdata/dcwcache.h \ + ../include/dcmtk/dcmdata/dcfcache.h ../include/dcmtk/dcmdata/dcjson.h +dcfilter.o: dcfilter.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcfilter.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofalgo.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h +dchashdi.o: dchashdi.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dchashdi.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcdicent.h \ + ../include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +dcistrma.o: dcistrma.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcistrmz.h ../include/dcmtk/dcmdata/dcerror.h +dcistrmb.o: dcistrmb.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcistrmb.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h +dcistrmf.o: dcistrmf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcistrmf.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h +dcistrmz.o: dcistrmz.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcistrmz.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h +dcitem.o: dcitem.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvras.h ../include/dcmtk/dcmdata/dcvrat.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvrfd.h ../include/dcmtk/dcmdata/dcvrfl.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlt.h \ + ../include/dcmtk/dcmdata/dcvrod.h ../include/dcmtk/dcmdata/dcvrof.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcvrov.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrpn.h ../include/dcmtk/dcmdata/dcvrsh.h \ + ../include/dcmtk/dcmdata/dcvrsl.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrst.h ../include/dcmtk/dcmdata/dcvrsv.h \ + ../include/dcmtk/dcmdata/dcvrtm.h ../include/dcmtk/dcmdata/dcvruc.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrur.h ../include/dcmtk/dcmdata/dcvrus.h \ + ../include/dcmtk/dcmdata/dcvrut.h ../include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcjson.h +dcjson.o: dcjson.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcjson.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcdefine.h +dclist.o: dclist.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dclist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcmatch.o: dcmatch.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofdiag.h \ + ../include/dcmtk/dcmdata/dcmatch.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcvrda.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvrtm.h \ + ../../ofstd/include/dcmtk/ofstd/diag/push.def \ + ../../ofstd/include/dcmtk/ofstd/diag/shadow.def \ + ../../ofstd/include/dcmtk/ofstd/diag/pop.def \ + ../../ofstd/include/dcmtk/ofstd/diag/vsprfw.def +dcmetinf.o: dcmetinf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmdata/dcistrmf.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dcjson.h +dcobject.o: dcobject.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dcostrma.h +dcostrma.o: dcostrma.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcostrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcostrmz.h ../include/dcmtk/dcmdata/dcerror.h +dcostrmb.o: dcostrmb.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcostrmb.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcerror.h +dcostrmf.o: dcostrmf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcostrmf.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcerror.h +dcostrmz.o: dcostrmz.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcostrmz.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcerror.h +dcpath.o: dcpath.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcpath.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h +dcpcache.o: dcpcache.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcpcache.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h +dcpixel.o: dcpixel.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcvrpobw.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dccodec.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcofsetl.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcpxitem.h +dcpixseq.o: dcpixseq.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofuuid.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h \ + ../include/dcmtk/dcmdata/dcpixseq.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcofsetl.h \ + ../include/dcmtk/dcmdata/dcpxitem.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcdeftag.h +dcpxitem.o: dcpxitem.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcpxitem.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcofsetl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcswap.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcwcache.h \ + ../include/dcmtk/dcmdata/dcfcache.h +dcrleccd.o: dcrleccd.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcrleccd.h ../include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcrlecp.h ../include/dcmtk/dcmdata/dcrledec.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcvrpobw.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcuid.h +dcrlecce.o: dcrlecce.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcrlecce.h ../include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcrleenc.h ../include/dcmtk/dcmdata/dcrlecp.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcpixseq.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h +dcrlecp.o: dcrlecp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcrlecp.h ../include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h +dcrledrg.o: dcrledrg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcrledrg.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcrleccd.h ../include/dcmtk/dcmdata/dcrlecp.h +dcrleerg.o: dcrleerg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcrleerg.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcrlecce.h ../include/dcmtk/dcmdata/dcrlecp.h +dcrlerp.o: dcrlerp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcrlerp.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h +dcsequen.o: dcsequen.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcofsetl.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcmetinf.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmdata/dcostrma.h +dcspchrs.o: dcspchrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcdeftag.h +dcstack.o: dcstack.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../include/dcmtk/dcmdata/dcdefine.h +dcswap.o: dcswap.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h +dctag.o: dctag.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctag.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdict.h \ + ../include/dcmtk/dcmdata/dchashdi.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdicent.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dctagkey.o: dctagkey.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dcdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dctypes.o: dctypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h +dcuid.o: dcuid.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcuid.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofcrc32.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofsockad.h +dcvr.o: dcvr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +dcvrae.o: dcvrae.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcmatch.h +dcvras.o: dcvras.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvras.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h +dcvrat.o: dcvrat.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcjson.h +dcvrcs.o: dcvrcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcmatch.h +dcvrda.o: dcvrda.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrda.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrtm.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcmatch.h +dcvrds.o: dcvrds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrds.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcjson.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dcvrdt.o: dcvrdt.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrdt.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvrda.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcmatch.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dcvrfd.o: dcvrfd.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcvrfd.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrfl.o: dcvrfl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvris.o: dcvris.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcjson.h +dcvrlo.o: dcvrlo.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcjson.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcvrlo.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h +dcvrlt.o: dcvrlt.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h +dcvrobow.o: dcvrobow.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofuuid.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcuid.h +dcvrod.o: dcvrod.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofuuid.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcvrod.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcjson.h +dcvrof.o: dcvrof.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofuuid.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvrof.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcswap.h +dcvrol.o: dcvrol.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofuuid.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dcswap.h +dcvrov.o: dcvrov.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofuuid.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcvrov.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dcswap.h +dcvrpn.o: dcvrpn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcjson.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmdata/dcvrpn.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h +dcvrpobw.o: dcvrpobw.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrsh.o: dcvrsh.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcjson.h +dcvrsl.o: dcvrsl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcvrsl.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrss.o: dcvrss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcvrss.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrst.o: dcvrst.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrst.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h +dcvrsv.o: dcvrsv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrtm.o: dcvrtm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrtm.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcmatch.h +dcvruc.o: dcvruc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h +dcvrui.o: dcvrui.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcuid.h +dcvrul.o: dcvrul.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrulup.o: dcvrulup.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrulup.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrur.o: dcvrur.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrur.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcmatch.h +dcvrus.o: dcvrus.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcvrut.o: dcvrut.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcvrut.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h +dcvruv.o: dcvruv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcvruv.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +dcwcache.o: dcwcache.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcwcache.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcfcache.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcostrma.h +dcxfer.o: dcxfer.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmdata/dcuid.h +mkdeftag.o: mkdeftag.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcdict.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dchashdi.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h +mkdictbi.o: mkdictbi.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/dcdict.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmdata/dchashdi.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h +vrscan.o: vrscan.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmdata/vrscan.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmdata/dcdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h vrscani.h vrscanl.h diff --git a/dcmdata/libsrc/Makefile.in b/dcmdata/libsrc/Makefile.in new file mode 100644 index 00000000..eca96cab --- /dev/null +++ b/dcmdata/libsrc/Makefile.in @@ -0,0 +1,111 @@ +# +# Makefile for dcmdata/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include +LIBDIRS = -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc +LOCALLIBS = -loflog -lofstd $(CHARCONVLIBS) +LOCALDEFS = + +# clear environment variable in the scope of this makefile +DCMDICTPATH = + +# Special defines for the Library, define them in LOCALDEFS +# DICOMDIR_WITHOUT_BACKUP +# no Backup for DICOMDIR files. default: not defined +# PRINT_REPLACED_DICTIONARY_ENTRIES +# dump duplicate entries in the data dictionary to stderr + +dicomdic = $(top_srcdir)/data/dicom.dic +privatedic = $(top_srcdir)/data/private.dic + +# Dictionary objects for building the helper tools mkdeftag and mkdictbi +dict_tools_objs = dctagkey.o dcdicent.o dcdict.o dcvr.o dchashdi.o + +objs = dcpixseq.o dcpxitem.o dcuid.o dcerror.o dcencdoc.o\ + dcstack.o dclist.o dcswap.o dctag.o dcxfer.o \ + dcobject.o dcelem.o dcitem.o dcmetinf.o dcdatset.o dcdatutl.o dcspchrs.o \ + dcsequen.o dcfilefo.o dcbytstr.o dcpixel.o dcvrae.o dcvras.o dcvrcs.o \ + dccodec.o dcvrda.o dcvrds.o dcvrdt.o dcvris.o dcvrtm.o dcvrui.o \ + dcchrstr.o dcvrlo.o dcvrlt.o dcvrpn.o dcvrsh.o dcvrst.o dcvrobow.o \ + dcvrat.o dcvrss.o dcvrus.o dcvrsl.o dcvrsv.o dcvrul.o dcvruv.o dcvrulup.o \ + dcvrfl.o dcvrfd.o dcvrpobw.o dcvrof.o dcvrod.o dcvrol.o dcvrov.o dcdirrec.o \ + dcdicdir.o dcrleccd.o dcrlecce.o dcrlecp.o dcrlerp.o dcrledrg.o dcrleerg.o \ + dcdictbi.o dctagkey.o dcdicent.o dcdict.o dcvr.o dchashdi.o cmdlnarg.o \ + dcvrut.o dcvrur.o dcvruc.o dctypes.o dcpcache.o dcddirif.o dcistrma.o \ + dcistrmb.o dcistrmf.o dcistrmz.o dcostrma.o dcostrmb.o dcostrmf.o \ + dcostrmz.o dcwcache.o dcpath.o vrscan.o vrscanl.o dcfilter.o dcjson.o \ + dcmatch.o + +support_objs = mkdeftag.o mkdictbi.o +support_progs = mkdeftag mkdictbi + +# Extra objects needed by support_progs +support_progs_objs = cmdlnarg.o dctypes.o + +library = libdcmdata.$(LIBEXT) + + +all: $(library) + +install: install-lib install-support + +install-lib: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + +mkdeftag: mkdeftag.o $(dict_tools_objs) $(support_progs_objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(dict_tools_objs) $(support_progs_objs) $(LOCALLIBS) $(LIBS) + +mkdictbi: mkdictbi.o $(dict_tools_objs) $(support_progs_objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(dict_tools_objs) $(support_progs_objs) $(LOCALLIBS) $(LIBS) + +mkvrscan: + flex -8 --header-file=vrscanl.h --outfile=vrscanl.c vrscanl.l + + +# Generate a new include file of defined tags + +updatedeftag: mkdeftag $(dicomdic) $(privatedic) + `pwd`/mkdeftag -o $(top_srcdir)/include/dcmtk/dcmdata/dcdeftag.h $(dicomdic) $(privatedic) + +# Generate a builtin data dictionary from $(dicomdic) and $(privatedic) + +updatebuiltindict: mkdictbi $(dicomdic) $(privatedic) + `pwd`/mkdictbi $(dicomdic) $(privatedic) > dcdictbi.cc + + +# Clean-up + +clean: + rm -f $(support_progs) $(support_objs) $(objs) $(library) $(TRASH) + +distclean: clean + rm -f $(DISTTRASH) + + +# Dependencies + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmdata/libsrc/cmdlnarg.cc b/dcmdata/libsrc/cmdlnarg.cc new file mode 100644 index 00000000..ad5afe1b --- /dev/null +++ b/dcmdata/libsrc/cmdlnarg.cc @@ -0,0 +1,166 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Provide prototype of command line argument gathering routine + * for OS environments which cannot pass arguments on the command line. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dctypes.h" + +/* +** prepareCmdLineArgs +** +** Should do nothing on Unix OS's. +** On other OS's (e.g. MacOS with CW6) allows command line arguments +** to be input from the standard input. +*/ + +#ifdef HAVE_EMPTY_ARGC_ARGV + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" + +void prepareCmdLineArgs(int& argc, char* argv[], + const char* progname) +{ + const int bufsize = 2024; + char buf[bufsize]; + char arg[1024]; + + size_t len = strlen(progname)+1; + argv[0] = new char[len]; + OFStandard::strlcpy(argv[0], progname, len); + argc = 1; + + ofConsole.lockCout() << "CmdLineArgs-> "; + ofConsole.unlockCout(); + cin.getline(buf, bufsize); + + istringstream is(buf); + + arg[0] = '\0'; + while (is.good()) { + is >> arg; + if (strlen(arg) > 0) { + size_t len = strlen(arg)+1; + argv[argc] = new char[len]; + OFStandard::strlcpy(argv[argc], arg, len); + argc++; + } + arg[0] = '\0'; + } +} + +#else // HAVE_EMPTY_ARGC_ARGV + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#ifdef HAVE_IO_H +#include +#endif + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* for O_BINARY */ +#endif +END_EXTERN_C + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofstream.h" + +void prepareCmdLineArgs(int& /* argc */, char** /* argv */, + const char* /* progname */) +{ +#ifdef _WIN32 +#ifndef DCMTK_GUI +#ifndef __CYGWIN__ + /* Map stderr onto stdout (cannot redirect stderr under Windows). + * Remove any buffering (windows uses a 2k buffer for stdout when not + * writing to the console. since dcmtk uses mixed stdout, stderr + * cout and cerr, this results in _very_ mixed up output). + */ + + /* first of all, check whether stderr and stdout file descriptors are + * already the same, e.g. from a previous call of this function + */ + if (fileno(stderr) != fileno(stdout)) + { + /* duplicate the stderr file descriptor to be the same as stdout */ + close(fileno(stderr)); + int fderr = dup(fileno(stdout)); + if (fderr != fileno(stderr)) + { + DCMDATA_ERROR("INTERNAL ERROR: cannot map stderr to stdout: " + << OFStandard::getLastSystemErrorCode().message()); + } + } + + /* make stdout the same as stderr */ + *stdout = *stderr; + +#ifdef USE_BINARY_MODE_FOR_STDOUT_ON_WINDOWS + /* use binary mode for stdout in order to be more consistent with common Unix behavior */ + setmode(fileno(stdout), O_BINARY); +#endif + +#ifndef __BORLANDC__ /* setvbuf on stdout/stderr does not work with Borland C++ */ + /* make sure the buffering is removed */ + if (setvbuf(stdout, NULL, _IONBF, 0 ) != 0 ) + { + DCMDATA_ERROR("INTERNAL ERROR: cannot unbuffer stdout: " + << OFStandard::getLastSystemErrorCode().message()); + } + if (setvbuf(stderr, NULL, _IONBF, 0 ) != 0 ) + { + DCMDATA_ERROR("INTERNAL ERROR: cannot unbuffer stderr: " + << OFStandard::getLastSystemErrorCode().message()); + } +#endif /* __BORLANDC__ */ +#endif +#endif +#endif + + /* no need to process the arguments */ +} + + +#ifdef HAVE_WINDOWS_H + +void prepareCmdLineArgs(int& argc, wchar_t** /* argv */, + const char* progname) +{ + // value of parameters is ignored anyway + char** argv = NULL; + prepareCmdLineArgs(argc, argv, progname); +} + +#endif // HAVE_WINDOWS_H + + +#endif // HAVE_EMPTY_ARGC_ARGV diff --git a/dcmdata/libsrc/dcbytstr.cc b/dcmdata/libsrc/dcbytstr.cc new file mode 100644 index 00000000..b8fa0b1c --- /dev/null +++ b/dcmdata/libsrc/dcbytstr.cc @@ -0,0 +1,979 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmByteString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcbytstr.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcmatch.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_NEW +#include "dcmtk/ofstd/ofstdinc.h" + + +// global flags + +OFGlobal dcmEnableVRCheckerForStringValues(OFTrue); + + +// global function to get a particular component of a DICOM string +OFCondition getStringPart(OFString &result, + const char *str, + const unsigned long len, + const unsigned long pos) +{ + OFCondition l_error = EC_Normal; + /* check string parameter */ + if (str != NULL) + { + /* search for beginning of specified string component */ + unsigned long i = 0; + unsigned long curPos = 0; + while ((curPos < pos) && (i++ < len)) + { + if (*str++ == '\\') + curPos++; + } + /* if found ... */ + if (curPos == pos) + { + /* search for end of specified string component */ + const char *p = str; + while ((*p != '\\') && (i++ < len)) + p++; + /* check whether string component is non-empty */ + if (p - str > 0) + result.assign(str, p - str); + else + result.clear(); + } else { + /* specified component index not found in string */ + l_error = EC_IllegalParameter; + } + } else + l_error = EC_IllegalParameter; + return l_error; +} + + +// ******************************** + +DcmByteString::DcmByteString(const DcmTag &tag) + : DcmElement(tag, 0), + paddingChar(' '), + maxLength(DCM_UndefinedLength), + realLength(0), + fStringMode(DCM_UnknownString), + nonSignificantChars() +{ +} + + +DcmByteString::DcmByteString(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len), + paddingChar(' '), + maxLength(DCM_UndefinedLength), + realLength(len), + fStringMode(DCM_UnknownString), + nonSignificantChars() +{ +} + + +DcmByteString::DcmByteString(const DcmByteString &old) + : DcmElement(old), + paddingChar(old.paddingChar), + maxLength(old.maxLength), + realLength(old.realLength), + fStringMode(old.fStringMode), + nonSignificantChars(old.nonSignificantChars) +{ +} + + +DcmByteString::~DcmByteString() +{ +} + + +DcmByteString &DcmByteString::operator=(const DcmByteString &obj) +{ + if (this != &obj) + { + DcmElement::operator=(obj); + + /* copy member variables */ + paddingChar = obj.paddingChar; + maxLength = obj.maxLength; + realLength = obj.realLength; + fStringMode = obj.fStringMode; + nonSignificantChars = obj.nonSignificantChars; + } + return *this; +} + + +int DcmByteString::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmByteString* myThis = NULL; + DcmByteString* myRhs = NULL; + myThis = OFconst_cast(DcmByteString*, this); + myRhs = OFstatic_cast(DcmByteString*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + unsigned long thisNumValues = myThis->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + OFString val; + if (myThis->getOFString(val, count).good()) + { + OFString rhsVal; + if (myRhs->getOFString(rhsVal, count).good()) + { + result = val.compare(rhsVal); + if (result != 0) + { + return result; + } + } + } + } + /* all values equal */ + return 0; +} + + + + +OFCondition DcmByteString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmByteString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmByteString::ident() const +{ + /* valid type identifier is set by derived classes */ + return EVR_UNKNOWN; +} + + +unsigned long DcmByteString::getVM() +{ + char *str = NULL; + Uint32 len = 0; + /* get stored string value */ + getString(str, len); + /* and determine the VM */ + return DcmElement::determineVM(str, len); +} + + +unsigned long DcmByteString::getNumberOfValues() +{ + /* same as value multiplicity unless overwritten in a derived class */ + return getVM(); +} + + +OFCondition DcmByteString::clear() +{ + /* call inherited method */ + errorFlag = DcmElement::clear(); + /* set string representation to unknown */ + fStringMode = DCM_UnknownString; + realLength = 0; + return errorFlag; +} + + +Uint32 DcmByteString::getRealLength() +{ + /* convert string to internal representation (if required) */ + if (fStringMode != DCM_MachineString) + { + /* strips non-significant trailing spaces (padding) and determines 'realLength' */ + makeMachineByteString(); + } + /* string length of the internal representation */ + return realLength; +} + + +Uint32 DcmByteString::getLength(const E_TransferSyntax /*xfer*/, + const E_EncodingType /*enctype*/) +{ + /* convert string to DICOM representation, i.e. add padding if required */ + makeDicomByteString(); + /* DICOM value length is always an even number */ + return getLengthField(); +} + + +// ******************************** + +void DcmByteString::print(STD_NAMESPACE ostream& out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get string data */ + char *stringVal = NULL; + Uint32 stringLen = 0; + getString(stringVal, stringLen); + if ((stringVal != NULL) && (stringLen > 0)) + { + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + out << '['; + + OFString outString; + /* do not create more output than actually needed */ + const size_t outStrLen = (flags & DCMTypes::PF_shortenLongTagValues) ? DCM_OptPrintLineLength : 0 /* all characters */; + /* check whether string has to be converted to markup or octal representation */ + if (flags & DCMTypes::PF_convertToMarkup) + { + OFString inString(stringVal, stringLen); + OFStandard::convertToMarkupString(inString, outString, OFTrue, OFStandard::MM_XML, OFFalse, outStrLen); + } + else if (flags & DCMTypes::PF_convertToOctalNumbers) + { + OFString inString(stringVal, stringLen); + OFStandard::convertToOctalString(inString, outString, outStrLen); + } else { + /* check whether we need the full string or the prefix only */ + if ((outStrLen == 0) || (outStrLen > stringLen)) + outString.assign(stringVal, stringLen); + else + outString.assign(stringVal, outStrLen); + } + + size_t printedLength = outString.length() + 2 /* for enclosing brackets */; + + /* check whether full value text should be printed */ + if ((flags & DCMTypes::PF_shortenLongTagValues) && (printedLength > DCM_OptPrintLineLength)) + { + /* truncate value text and append "..." */ + outString.erase(DCM_OptPrintLineLength - 4); + out << outString << "..."; + printedLength = DCM_OptPrintLineLength; + } else + out << outString << ']'; + + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, OFstatic_cast(unsigned long, printedLength)); + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmByteString::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* convert string value to DICOM representation and call inherited method */ + if (getTransferState() == ERW_init) + makeDicomByteString(); + + errorFlag = DcmElement::write(outStream, oxfer, enctype, wcache); + } + return errorFlag; +} + + +OFCondition DcmByteString::writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* convert string value to DICOM representation and call inherited method */ + if (getTransferState() == ERW_init) + makeDicomByteString(); + errorFlag = DcmElement::writeSignatureFormat(outStream, oxfer, enctype, wcache); + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmByteString::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + /* check given string position index */ + if (pos >= getVM()) + { + /* treat an empty string as a special case */ + if (pos == 0) + { + errorFlag = EC_Normal; + stringVal.clear(); + } else + errorFlag = EC_IllegalParameter; + } else { + /* get string data */ + char *str = NULL; + Uint32 len = 0; + errorFlag = getString(str, len); + /* check whether string value is present */ + if ((str != NULL) && (len > 0)) + { + /* extract specified string component */ + errorFlag = getStringPart(stringVal, str, len, pos); + } else + stringVal.clear(); + } + return errorFlag; +} + + +OFCondition DcmByteString::getOFStringArray(OFString &stringVal, + OFBool normalize) +{ + /* check whether time-consuming normalization is really needed */ + if (normalize) + errorFlag = DcmElement::getOFStringArray(stringVal, normalize); + else + errorFlag = getStringValue(stringVal); + return errorFlag; +} + + +OFCondition DcmByteString::getStringValue(OFString &stringVal) +{ + char *str = NULL; + Uint32 len = 0; + errorFlag = getString(str, len); + /* check whether string value is present */ + if ((str != NULL) && (len > 0)) + stringVal.assign(str, len); + else + stringVal.clear(); + return errorFlag; +} + + +OFCondition DcmByteString::getString(char *&stringVal) +{ + errorFlag = EC_Normal; + /* get string data */ + stringVal = OFstatic_cast(char *, getValue()); + /* convert to internal string representation (without padding) if required */ + if ((stringVal != NULL) && (fStringMode != DCM_MachineString)) + makeMachineByteString(); + return errorFlag; +} + + +OFCondition DcmByteString::getString(char *&stringVal, + Uint32 &stringLen) +{ + /* get string data */ + errorFlag = getString(stringVal); + /* return the real length of the value */ + stringLen = realLength; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmByteString::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmByteString::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* check for an empty string parameter */ + if ((stringVal != NULL) && (stringLen > 0)) + putValue(stringVal, stringLen); + else + putValue(NULL, 0); + /* make sure that extra padding is removed from the string */ + fStringMode = DCM_UnknownString; + makeMachineByteString(stringLen); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmByteString::makeDicomByteString() +{ + /* get string data */ + char *value = NULL; + errorFlag = getString(value); + if (value != NULL) + { + /* check for odd length */ + if (realLength & 1) + { + /* if so add a padding character */ + setLengthField(realLength + 1); + value[realLength] = paddingChar; + } else if (realLength < getLengthField()) + setLengthField(realLength); + /* terminate string (removes additional trailing padding characters) */ + value[getLengthField()] = '\0'; + } + /* current string representation is now the DICOM one */ + fStringMode = DCM_DicomString; + return errorFlag; +} + + +OFCondition DcmByteString::makeMachineByteString(const Uint32 length) +{ + errorFlag = EC_Normal; + /* get string data */ + char *value = OFstatic_cast(char *, getValue()); + if (value != NULL) + { + /* check whether string representation is not the internal one */ + if (fStringMode != DCM_MachineString) + { + /* determine initial string length */ + realLength = (length == 0) ? getLengthField() : length; + /* remove all trailing spaces if automatic input data correction is enabled */ + if (dcmEnableAutomaticInputDataCorrection.get()) + { + /* + ** This code removes extra padding characters at the end of a ByteString. + ** Trailing padding can cause problems when comparing strings. This kind + ** of padding is non-significant for all string-based value representations. + */ + if (realLength > 0) + { + size_t i = OFstatic_cast(size_t, realLength); + while ((i > 0) && (value[i - 1] == paddingChar)) + value[--i] = '\0'; + realLength = OFstatic_cast(Uint32, i); + } + } + } + } else + realLength = 0; + /* current string representation is now the internal one */ + fStringMode = DCM_MachineString; + return errorFlag; +} + + +// ******************************** + + +Uint8 *DcmByteString::newValueField() +{ + Uint8 *value = NULL; + Uint32 lengthField = getLengthField(); + /* check for odd length (in case of a protocol error) */ + if (lengthField & 1) + { + if (lengthField == DCM_UndefinedLength) + { + /* Print an error message when private attribute states to have an odd length + * equal to the maximum length, because we are not able then to make this value even (+1) + * which would an overflow on some systems as well as being illegal in DICOM + */ + DCMDATA_WARN("DcmByteString: Element " << getTagName() << " " << getTag() + << " has odd maximum length (" << DCM_UndefinedLength << ") and therefore is not loaded"); + errorFlag = EC_CorruptedData; + return NULL; + } + /* allocate space for extra padding character (required for the DICOM representation of the string) */ +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + value = new (std::nothrow) Uint8[lengthField + 2]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + value = new Uint8[lengthField + 2]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + value = NULL; + } +#endif + + /* terminate string after real length */ + if (value != NULL) + value[lengthField] = 0; + /* enforce old (pre DCMTK 3.5.2) behaviour? */ + if (!dcmAcceptOddAttributeLength.get()) + { + /* make length even */ + lengthField++; + setLengthField(lengthField); + } + } else { + /* length is even, but we need an extra byte for the terminating 0 byte */ +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + value = new (std::nothrow) Uint8[lengthField + 1]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + value = new Uint8[lengthField + 1]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + value = NULL; + } +#endif + } + /* make sure that the string is properly terminated by a 0 byte */ + if (value != NULL) + value[lengthField] = 0; + else + errorFlag = EC_MemoryExhausted; + return value; +} + + +// ******************************** + + +void DcmByteString::postLoadValue() +{ + /* initially, after loading an attribute the string mode is unknown */ + fStringMode = DCM_UnknownString; + /* correct value length if automatic input data correction is enabled */ + if (dcmEnableAutomaticInputDataCorrection.get()) + { + /* check for odd length */ + if (getLengthField() & 1) + { + // newValueField always allocates an even number of bytes and sets + // the pad byte to zero, so we can safely increase Length here. + setLengthField(getLengthField() + 1); + } + } +} + + +// ******************************** + + +OFCondition DcmByteString::verify(const OFBool autocorrect) +{ + char *str = NULL; + Uint32 len = 0; + /* get string data */ + errorFlag = getString(str, len); + /* check for non-empty string */ + if ((str != NULL) && (len > 0)) + { + /* check whether there is anything to verify at all */ + if (maxLength != DCM_UndefinedLength) + { + const unsigned long vm = getVM(); + /* TODO: is it really a good idea to create a copy of the string? */ + OFString value(str, len); + size_t posStart = 0; + unsigned long vmNum = 0; + /* check all string components */ + while (posStart != OFString_npos) + { + ++vmNum; + /* search for next component separator */ + size_t posEnd = (vm > 1) ? value.find('\\', posStart) : OFString_npos; + const size_t fieldLen = (posEnd == OFString_npos) ? value.length() - posStart : posEnd - posStart; + /* check size limit for each string component */ + if (fieldLen > maxLength) + { + DCMDATA_DEBUG("DcmByteString::verify() Maximum length violated in element " + << getTagName() << " " << getTag() << " value " << vmNum << ": " << fieldLen + << " bytes found but only " << maxLength << " bytes allowed"); + errorFlag = EC_MaximumLengthViolated; + if (autocorrect) + { + const size_t excess = fieldLen - maxLength; + DCMDATA_DEBUG("DcmByteString::verify() Removing " << excess + << " bytes from the end of value " << vmNum); + /* erase excessive part of the string component */ + value.erase(posStart + maxLength, excess); + /* correct the position end marker */ + posEnd -= excess; + } + } + posStart = (posEnd == OFString_npos) ? posEnd : posEnd + 1; + } + /* replace current string value if auto correction is enabled */ + if (autocorrect && errorFlag.bad()) + { + putOFStringArray(value); + /* the above method also sets 'errorFlag', so we need to assign the error code again */ + errorFlag = EC_MaximumLengthViolated; + } + } + } + /* report a debug message if an error occurred */ + if (errorFlag.bad()) + { + DCMDATA_WARN("DcmByteString: One or more illegal values in element " + << getTagName() << " " << getTag() << " with VM=" << getVM()); + } + return errorFlag; +} + + +OFBool DcmByteString::containsExtendedCharacters(const OFBool checkAllStrings) +{ + OFBool result = OFFalse; + /* only check if parameter is true since derived VRs are not affected + by the attribute SpecificCharacterSet (0008,0005) */ + if (checkAllStrings) + { + char *str = NULL; + Uint32 len = 0; + /* determine length in order to support possibly embedded NULL bytes */ + if (getString(str, len).good()) + result = containsExtendedCharacters(str, len); + } + return result; +} + + +OFBool DcmByteString::isAffectedBySpecificCharacterSet() const +{ + return OFFalse; +} + + +// ******************************** + + +OFBool DcmByteString::isEmpty(const OFBool normalize) +{ + OFBool result = OFFalse; + if (normalize && !nonSignificantChars.empty()) + { + OFString value; + DcmByteString::getStringValue(value); + /* check whether string value consists of non-significant characters only */ + result = (value.find_first_not_of(nonSignificantChars) == OFString_npos); + } else + result = DcmObject::isEmpty(normalize); + return result; +} + + +// ******************************** + + +// global function for normalizing a DICOM string +void normalizeString(OFString &string, + const OFBool multiPart, + const OFBool leading, + const OFBool trailing, + const char paddingChar) +{ + /* check for non-empty string */ + if (!string.empty()) + { + size_t partindex = 0; + size_t offset = 0; + size_t len = string.length(); + while (partindex < len) + { + // remove leading spaces in every part of the string + if (leading) + { + offset = 0; + while ((partindex + offset < len) && (string[partindex + offset] == paddingChar)) + offset++; + if (offset > 0) + string.erase(partindex, offset); + } + len = string.length(); + // compute begin to the next separator index! + if (multiPart) + { + partindex = string.find('\\', partindex); + if (partindex == OFString_npos) + partindex = len; + } else + partindex = len; + // remove trailing spaces in every part of the string + if (trailing && partindex) + { + offset = partindex - 1; + while ((offset > 0) && (string[offset] == paddingChar)) + offset--; + if (offset != partindex - 1) + { + if (string[offset] == ' ') + { + string.erase(offset, partindex - offset); + partindex = offset; + } else { + string.erase(offset + 1, partindex - offset - 1); + partindex = offset + 1; + } + } + } + len = string.length(); + if (partindex != len) + ++partindex; + } + } +} + + +// ******************************** + + +OFBool DcmByteString::containsExtendedCharacters(const char *stringVal, + const size_t stringLen) +{ + if (stringVal != NULL) + { + for (size_t i = stringLen; i != 0; --i) + { + /* check for 8 bit characters */ + if (OFstatic_cast(unsigned char, *stringVal++) > 127) + return OFTrue; + } + } + return OFFalse; +} + + +// ******************************** + + +OFCondition DcmByteString::checkStringValue(const OFString &value, + const OFString &vm, + const OFString &vr, + const int vrID, + const size_t maxLen, + const OFString &charset) +{ + OFCondition result = EC_Normal; + const size_t valLen = value.length(); + if (valLen > 0) + { + /* do we need to search for value components at all? */ + if (vm.empty()) + { + /* check value length (if a maximum is specified) */ + if ((maxLen > 0) && (value.length() > maxLen)) + result = EC_MaximumLengthViolated; + else if (dcmEnableVRCheckerForStringValues.get()) + { + /* check for non-ASCII characters (if default character set used) */ + if (charset.empty() || (charset == "ISO_IR 6")) + { + if (containsExtendedCharacters(value.c_str(), value.length())) + result = EC_InvalidCharacter; + } + if (result.good()) + { + /* currently, the VR checker only supports ASCII and Latin-1 */ + if (charset.empty() || (charset == "ISO_IR 6") || (charset == "ISO_IR 100")) + { + /* check value representation (VR) */ + if (DcmElement::scanValue(value, vr) != vrID) + result = EC_ValueRepresentationViolated; + } + } + } + } else { + size_t posStart = 0; + unsigned long vmNum = 0; + /* iterate over all value components */ + while (posStart != OFString_npos) + { + ++vmNum; + /* search for next component separator */ + const size_t posEnd = value.find('\\', posStart); + const size_t length = (posEnd == OFString_npos) ? valLen - posStart : posEnd - posStart; + /* check length of current value component */ + if ((maxLen > 0) && (length > maxLen)) + { + result = EC_MaximumLengthViolated; + break; + } + else if (dcmEnableVRCheckerForStringValues.get()) + { + /* check for non-ASCII characters (if default character set used) */ + if (charset.empty() || (charset == "ISO_IR 6")) + { + if (containsExtendedCharacters(value.c_str() + posStart, length)) + { + result = EC_InvalidCharacter; + break; + } + } + /* currently, the VR checker only supports ASCII and Latin-1 */ + if (charset.empty() || (charset == "ISO_IR 6") || (charset == "ISO_IR 100")) + { + /* check value representation (VR) */ + if (DcmElement::scanValue(value, vr, posStart, length) != vrID) + { + result = EC_ValueRepresentationViolated; + break; + } + } + } + posStart = (posEnd == OFString_npos) ? posEnd : posEnd + 1; + } + if (result.good()) + { + /* check value multiplicity (VM) */ + result = DcmElement::checkVM(vmNum, vm); + } + } + } + return result; +} + + +// ******************************** + + +OFCondition DcmByteString::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + DcmElement::writeJsonOpener(out, format); + /* write element value (if non-empty) */ + if (!isEmpty()) + { + OFString value; + OFCondition status = getOFString(value, 0L); + if (status.bad()) + return status; + format.printValuePrefix(out); + DcmJsonFormat::printValueString(out, value); + const unsigned long vm = getVM(); + for (unsigned long valNo = 1; valNo < vm; ++valNo) + { + status = getOFString(value, valNo); + if (status.bad()) + return status; + format.printNextArrayElementPrefix(out); + DcmJsonFormat::printValueString(out, value); + } + format.printValueSuffix(out); + } + /* write JSON Closer */ + DcmElement::writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +OFBool DcmByteString::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + if (ident() == candidate.ident()) + { + // some const casts to call the getter functions, I do not modify the values, I promise! + DcmByteString& key = OFconst_cast(DcmByteString&,*this); + DcmElement& can = OFconst_cast(DcmElement&,candidate); + OFString a, b; + for (unsigned long ui = 0; ui < key.getVM(); ++ui) + for (unsigned long uj = 0; uj < can.getVM(); ++uj) + if( key.getOFString( a, ui, OFTrue ).good() && can.getOFString( b, uj, OFTrue ).good() && matches( a, b, enableWildCardMatching ) ) + return OFTrue; + return key.getVM() == 0; + } + return OFFalse; +} + + +OFBool DcmByteString::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + // Universal Matching || Single Value Matching + return key.empty() || key == candidate; +} diff --git a/dcmdata/libsrc/dcchrstr.cc b/dcmdata/libsrc/dcchrstr.cc new file mode 100644 index 00000000..7d595166 --- /dev/null +++ b/dcmdata/libsrc/dcchrstr.cc @@ -0,0 +1,304 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: Implementation of class DcmCharString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcspchrs.h" /* for class DcmSpecificCharacterSet */ +#include "dcmtk/dcmdata/dcitem.h" /* for class DcmItem */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag definitions */ +#include "dcmtk/dcmdata/dcjson.h" /* json helper classes */ +#include "dcmtk/dcmdata/dcmatch.h" + +// +// This implementation does not support 16 bit character sets. Since 8 bit +// character sets are supported by the class DcmByteString the class +// DcmCharString is derived from DcmByteString without any extensions. +// No special implementation is necessary. +// +// If the extension for > 8 bit character sets will be implemented this class +// must be derived directly from DcmElement. This class is designed to support +// the value representations (LO, LT, PN, SH, ST, UC and UT). They are a problem +// because their value width (1, 2, ... bytes) is specified by the element +// SpecificCharacterSet (0008, 0005) and an implementation must support +// different value widths that cannot be derived from the value representation. +// + + +#include "dcmtk/dcmdata/dcchrstr.h" + + +DcmCharString::DcmCharString(const DcmTag &tag, const Uint32 len) + : DcmByteString(tag, len) +{ +} + +DcmCharString::DcmCharString(const DcmCharString &old) + : DcmByteString(old) +{ +} + +DcmCharString::~DcmCharString(void) +{ +} + + +DcmCharString &DcmCharString::operator=(const DcmCharString &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmCharString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmCharString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmCharString::verify(const OFBool autocorrect) +{ + const Uint32 maxLen = getMaxLength(); + char *str = NULL; + Uint32 len = 0; + /* get string data */ + errorFlag = getString(str, len); + /* check for non-empty string */ + if ((str != NULL) && (len > 0)) + { + const unsigned long vm = getVM(); + /* check whether there is anything to verify at all */ + if (maxLen != DCM_UndefinedLength) + { + /* TODO: is it really a good idea to create a copy of the string? */ + OFString value(str, len); + size_t posStart = 0; + unsigned long vmNum = 0; + /* check all string components */ + while (posStart != OFString_npos) + { + ++vmNum; + /* search for next component separator */ + const size_t posEnd = (vm > 1) ? value.find('\\', posStart) : OFString_npos; + const size_t fieldLen = (posEnd == OFString_npos) ? value.length() - posStart : posEnd - posStart; + /* check size limit for each string component */ + if (fieldLen > maxLen) + { + DCMDATA_DEBUG("DcmCharString::verify() maximum length violated in element " + << getTagName() << " " << getTag() << " value " << vmNum << ": " + << fieldLen << " bytes found but only " << maxLen << " characters allowed"); + errorFlag = EC_MaximumLengthViolated; + if (autocorrect) + { + /* TODO: We are currently not removing any characters since we do not + * know whether a character consists of one or more bytes. + * This will be fixed in a future version. + */ + DCMDATA_DEBUG("DcmCharString::verify() not correcting value length since " + << "multi-byte character sets are not yet supported, so cannot decide"); + } + } + posStart = (posEnd == OFString_npos) ? posEnd : posEnd + 1; + } + } + } + /* report a debug message if an error occurred */ + if (errorFlag.bad()) + { + DCMDATA_WARN("DcmCharString: One or more illegal values in element " + << getTagName() << " " << getTag() << " with VM=" << getVM()); + /* do not return with an error since we do not know whether there really is a violation */ + errorFlag = EC_Normal; + } + return errorFlag; +} + + +OFBool DcmCharString::containsExtendedCharacters(const OFBool /*checkAllStrings*/) +{ + OFBool result = OFFalse; + char *str = NULL; + Uint32 len = 0; + /* determine length in order to support possibly embedded NULL bytes */ + if (getString(str, len).good()) + result = DcmByteString::containsExtendedCharacters(str, len); + return result; +} + + +OFBool DcmCharString::isAffectedBySpecificCharacterSet() const +{ + return OFTrue; +} + + +OFCondition DcmCharString::convertCharacterSet(DcmSpecificCharacterSet &converter) +{ + char *str = NULL; + Uint32 len = 0; + OFCondition status = getString(str, len); + // do nothing if string value is empty + if (status.good() && (str != NULL) && (len > 0)) + { + OFString resultStr; + // convert string to selected character string and replace the element value + status = converter.convertString(str, len, resultStr, getDelimiterChars()); + if (status.good()) + { + // check whether the value has changed during the conversion (slows down the process?) + if (OFString(str, len) != resultStr) + { + DCMDATA_TRACE("DcmCharString::convertCharacterSet() updating value of element " + << getTagName() << " " << getTag() << " after the conversion to " + << converter.getDestinationEncoding() << " encoding"); + // update the element value + status = putOFStringArray(resultStr); + } else { + DCMDATA_TRACE("DcmCharString::convertCharacterSet() not updating value of element " + << getTagName() << " " << getTag() << " because the value has not changed"); + } + } + } + return status; +} + + +// ******************************** + + +OFCondition DcmCharString::getSpecificCharacterSet(OFString &charset) +{ + OFCondition status = EC_CorruptedData; + // start with current dataset-level + DcmItem *item = getParentItem(); + while ((item != NULL) && status.bad()) + { + // check whether the attribute SpecificCharacterSet should be present at all + if (item->checkForSpecificCharacterSet()) + { + // by default, the string components are normalized (i.e. padding is removed) + status = item->findAndGetOFStringArray(DCM_SpecificCharacterSet, charset); + } + // if element could not be found, go one level up + if (status.bad()) + item = item->getParentItem(); + } + // output some debug information + if (status.good()) + { + DCMDATA_TRACE("DcmCharString::getSpecificCharacterSet() element " << getTagName() + << " " << getTag() << " uses character set \"" << charset << "\""); + } + return status; +} + + +// ******************************** + + +OFCondition DcmCharString::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + DcmElement::writeJsonOpener(out, format); + /* write element value (if non-empty) */ + if (!isEmpty()) + { + OFString value; + if (format.asBulkDataURI(getTag(), value)) + { + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, value); + } + else + { + OFCondition status = getOFString(value, 0L); + if (status.bad()) + return status; + format.printValuePrefix(out); + DcmJsonFormat::printValueString(out, value); + const unsigned long vm = getVM(); + for (unsigned long valNo = 1; valNo < vm; ++valNo) + { + status = getOFString(value, valNo); + if (status.bad()) + return status; + format.printNextArrayElementPrefix(out); + DcmJsonFormat::printValueString(out, value); + } + format.printValueSuffix(out); + } + } + /* write JSON Closer */ + DcmElement::writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +const OFString& DcmCharString::getDelimiterChars() const +{ + return DcmVR(EVR_UN).getDelimiterChars(); +} + + +OFBool DcmCharString::isUniversalMatch(const OFBool normalize, + const OFBool enableWildCardMatching) +{ + if(!isEmpty(normalize)) + { + if(enableWildCardMatching) + { + OFString value; + for(unsigned long valNo = 0; valNo < getVM(); ++valNo) + { + getOFString(value, valNo, normalize); + if(value.find_first_not_of( '*' ) != OFString_npos) + return OFFalse; + } + } + else + return OFFalse; + } + return OFTrue; +} + + +OFBool DcmCharString::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + if (enableWildCardMatching) + return DcmAttributeMatching::wildCardMatching(key.c_str(), key.length(), candidate.c_str(), candidate.length()); + else + return DcmByteString::matches(key, candidate, OFFalse); +} diff --git a/dcmdata/libsrc/dccodec.cc b/dcmdata/libsrc/dccodec.cc new file mode 100644 index 00000000..bb32f388 --- /dev/null +++ b/dcmdata/libsrc/dccodec.cc @@ -0,0 +1,655 @@ +/* + * + * Copyright (C) 1997-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: abstract class DcmCodec and the class DcmCodecStruct + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dccodec.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofthread.h" +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmGenerateUniqueIdentifer()*/ +#include "dcmtk/dcmdata/dcitem.h" /* for class DcmItem */ +#include "dcmtk/dcmdata/dcsequen.h" /* for DcmSequenceOfItems */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for DcmPixelItem */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary */ +#include "dcmtk/dcmdata/dcvrui.h" /* for DcmUniqueIdentifier */ + +// static member variables +OFList DcmCodecList::registeredCodecs; + +#ifdef WITH_THREADS +OFReadWriteLock DcmCodecList::codecLock; +#endif + +/* --------------------------------------------------------------- */ + +// DcmCodec static helper methods + +OFCondition DcmCodec::insertStringIfMissing(DcmItem *dataset, const DcmTagKey& tag, const char *val) +{ + DcmStack stack; + if ((dataset->search(tag, stack, ESM_fromHere, OFFalse)).bad()) + { + return dataset->putAndInsertString(tag, val, OFTrue); + } + return EC_Normal; +} + + +OFCondition DcmCodec::convertToSecondaryCapture(DcmItem *dataset) +{ + if (dataset == NULL) return EC_IllegalCall; + + OFCondition result = EC_Normal; + char buf[70]; + + // SOP Class UID - always replace + if (result.good()) result = dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage); + + // SOP Instance UID - only insert if missing. + dcmGenerateUniqueIdentifier(buf); + if (result.good()) result = insertStringIfMissing(dataset, DCM_SOPInstanceUID, buf); + + // Type 1 attributes - insert with value if missing + dcmGenerateUniqueIdentifier(buf, SITE_STUDY_UID_ROOT); + if (result.good()) result = insertStringIfMissing(dataset, DCM_StudyInstanceUID, buf); + dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT); + if (result.good()) result = insertStringIfMissing(dataset, DCM_SeriesInstanceUID, buf); + if (result.good()) result = insertStringIfMissing(dataset, DCM_ConversionType, "WSD"); + if (result.good()) result = insertStringIfMissing(dataset, DCM_Modality, "OT"); + + // Type 2 attributes - insert without value if missing + if (result.good()) result = insertStringIfMissing(dataset, DCM_PatientName, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_PatientID, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_PatientBirthDate, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_PatientSex, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_PatientOrientation, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_StudyDate, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_StudyTime, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_ReferringPhysicianName, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_StudyID, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_AccessionNumber, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_SeriesNumber, NULL); + if (result.good()) result = insertStringIfMissing(dataset, DCM_InstanceNumber, NULL); + + return result; +} + + +OFCondition DcmCodec::insertCodeSequence( + DcmItem *dataset, + const DcmTagKey &tagKey, + const char *codingSchemeDesignator, + const char *codeValue, + const char *codeMeaning) +{ + if (dataset == NULL || codingSchemeDesignator == NULL || + codeValue == NULL || codeMeaning == NULL) return EC_IllegalCall; + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(tagKey); + if (dseq) + { + DcmItem *ditem = new DcmItem(); + if (ditem) + { + dseq->insert(ditem); + result = ditem->putAndInsertString(DCM_CodingSchemeDesignator, codingSchemeDesignator); + if (result.good()) result = ditem->putAndInsertString(DCM_CodeValue, codeValue); + if (result.good()) result = ditem->putAndInsertString(DCM_CodeMeaning, codeMeaning); + } else result = EC_MemoryExhausted; + + // insert sequence into dataset if everything went well + if (result.good()) dataset->insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + + return result; +} + + +OFCondition DcmCodec::newInstance( + DcmItem *dataset, + const char *purposeOfReferenceCodingScheme, + const char *purposeOfReferenceCodeValue, + const char *purposeOfReferenceCodeMeaning) +{ + if (dataset == NULL) return EC_IllegalCall; + OFCondition result = EC_Normal; + + // look up current SOP Class UID and SOP Instance UID + const char *classUID = NULL; + const char *instanceUID = NULL; + + // search for existing SOP Class UID / SOP Instance UID + OFCondition tempResult = dataset->findAndGetString(DCM_SOPClassUID, classUID); + if (tempResult.good()) tempResult = dataset->findAndGetString(DCM_SOPInstanceUID, instanceUID); + if (tempResult.good() && classUID && instanceUID) + { + // create source image sequence + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(DCM_SourceImageSequence); + if (dseq) + { + DcmItem *ditem = new DcmItem(); + if (ditem) + { + dseq->insert(ditem); + DcmElement *elem1 = new DcmUniqueIdentifier(DCM_ReferencedSOPClassUID); + if (elem1) + { + result = elem1->putString(classUID); + ditem->insert(elem1, OFTrue /*replaceOld*/); + if (result.good()) + { + DcmElement *elem2 = new DcmUniqueIdentifier(DCM_ReferencedSOPInstanceUID); + if (elem2) + { + result = elem2->putString(instanceUID); + ditem->insert(elem2, OFTrue /*replaceOld*/); + } else result = EC_MemoryExhausted; + } + } else result = EC_MemoryExhausted; + + if (result.good() && purposeOfReferenceCodingScheme && + purposeOfReferenceCodeValue && purposeOfReferenceCodeMeaning) + { + // add purpose of reference code sequence + result = DcmCodec::insertCodeSequence(ditem, DCM_PurposeOfReferenceCodeSequence, + purposeOfReferenceCodingScheme, purposeOfReferenceCodeValue, purposeOfReferenceCodeMeaning); + } + } else result = EC_MemoryExhausted; + if (result.good()) dataset->insert(dseq, OFTrue); else delete dseq; + } else result = EC_MemoryExhausted; + } + + // create new SOP instance UID + if (result.good()) + { + char new_uid[100]; + DcmElement *elem = new DcmUniqueIdentifier(DCM_SOPInstanceUID); + if (elem) + { + if (EC_Normal == (result = elem->putString(dcmGenerateUniqueIdentifier(new_uid)))) + dataset->insert(elem, OFTrue); // replace SOP Instance UID + else delete elem; + } else result = EC_MemoryExhausted; + } + + return result; +} + + +OFCondition DcmCodec::updateImageType(DcmItem *dataset) +{ + if (dataset == NULL) return EC_IllegalCall; + + DcmStack stack; + OFString imageType("DERIVED"); + OFString a; + + /* find existing Image Type element */ + OFCondition status = dataset->search(DCM_ImageType, stack, ESM_fromHere, OFFalse); + if (status.good()) + { + DcmElement *elem = OFstatic_cast(DcmElement *, stack.top()); + unsigned long pos = 1; + + // append old image type information beginning with second entry + while ((elem->getOFString(a, pos++)).good()) + { + imageType += "\\"; + imageType += a; + } + } + + // insert new Image Type, replace old value + return dataset->putAndInsertString(DCM_ImageType, imageType.c_str(), OFTrue); +} + + +OFCondition DcmCodec::determineStartFragment( + Uint32 frameNo, + Sint32 numberOfFrames, + DcmPixelSequence * fromPixSeq, + Uint32& currentItem) +{ + Uint32 numberOfFragments = OFstatic_cast(Uint32, fromPixSeq->card()); + if (numberOfFrames < 1 || numberOfFragments <= OFstatic_cast(Uint32, numberOfFrames) || frameNo >= OFstatic_cast(Uint32, numberOfFrames)) + return EC_IllegalCall; + + if (frameNo == 0) + { + // simple case: first frame is always at second fragment + currentItem = 1; + return EC_Normal; + } + + if (numberOfFragments == OFstatic_cast(Uint32, numberOfFrames) + 1) + { + // standard case: there is one fragment per frame. + currentItem = frameNo + 1; + return EC_Normal; + } + + // non-standard case: multiple fragments per frame. + // We now try to consult the offset table. + DcmPixelItem *pixItem = NULL; + Uint8 *rawOffsetTable = NULL; + + // get first pixel item, i.e. the fragment containing the offset table + OFCondition result = fromPixSeq->getItem(pixItem, 0); + if (result.good()) + { + Uint32 tableLength = pixItem->getLength(); + result = pixItem->getUint8Array(rawOffsetTable); + if (result.good()) + { + // check if the offset table is empty + if (tableLength == 0) + result = makeOFCondition(OFM_dcmdata, EC_CODE_CannotDetermineStartFragment, OF_error, "Cannot determine start fragment: basic offset table is empty"); + // check if the offset table has the right size: 4 bytes for each frame (not fragment!) + else if (tableLength != 4 * OFstatic_cast(Uint32, numberOfFrames)) + result = makeOFCondition(OFM_dcmdata, EC_CODE_CannotDetermineStartFragment, OF_error, "Cannot determine start fragment: basic offset table has wrong size"); + else { + + // byte swap offset table into local byte order. In file, the offset table is always in little endian + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, rawOffsetTable, tableLength, sizeof(Uint32)); + + // cast offset table to Uint32. + Uint32 *offsetTable = OFreinterpret_cast(Uint32 *, rawOffsetTable); + + // now access offset of the frame we're looking for + Uint32 offset = offsetTable[frameNo]; + + // OK, now let's look if we can find a fragment that actually corresponds to that offset. + // In counter we compute the offset for each frame by adding all fragment lengths + Uint32 counter = 0; + // now iterate over all fragments except the index table. The start of the first fragment + // is defined as zero. + for (Uint32 idx = 1; idx < numberOfFragments; ++idx) + { + if (counter == offset) + { + // hooray, we are lucky. We have found the fragment we're looking for + currentItem = idx; + return EC_Normal; + } + + // access pixel item in order to determine its length + result = fromPixSeq->getItem(pixItem, idx); + if (result.bad()) + return makeOFCondition(OFM_dcmdata, EC_CODE_CannotDetermineStartFragment, OF_error, "Cannot determine start fragment: cannot access referenced pixel item"); + + // add pixel item length plus 8 bytes overhead for the item tag and length field + counter += pixItem->getLength() + 8; + } + + // bad luck. We have not found a fragment corresponding to the offset in the offset table. + // Either we cannot correctly add numbers, or they cannot :-) + result = makeOFCondition(OFM_dcmdata, EC_CODE_CannotDetermineStartFragment, OF_error, "Cannot determine start fragment: possibly wrong value in basic offset table"); + } + } else + result = makeOFCondition(OFM_dcmdata, EC_CODE_CannotDetermineStartFragment, OF_error, "Cannot determine start fragment: cannot access content of basic offset table"); + } else + result = makeOFCondition(OFM_dcmdata, EC_CODE_CannotDetermineStartFragment, OF_error, "Cannot determine start fragment: cannot access basic offset table (first item)"); + return result; +} + + +/* --------------------------------------------------------------- */ + +DcmCodecList::DcmCodecList( + const DcmCodec *aCodec, + const DcmRepresentationParameter *aDefaultRepParam, + const DcmCodecParameter *aCodecParameter) +: codec(aCodec) +, defaultRepParam(aDefaultRepParam) +, codecParameter(aCodecParameter) +{ +} + +DcmCodecList::~DcmCodecList() +{ +} + +OFCondition DcmCodecList::registerCodec( + const DcmCodec *aCodec, + const DcmRepresentationParameter *aDefaultRepParam, + const DcmCodecParameter *aCodecParameter) +{ + if ((aCodec == NULL)||(aCodecParameter == NULL)) return EC_IllegalParameter; +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + + // acquire write lock on codec list. Will block if some codec is currently active. + OFCondition result = EC_Normal; +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.wrlock()) + { +#endif + DcmCodecList *listEntry = new DcmCodecList(aCodec, aDefaultRepParam, aCodecParameter); + if (listEntry) + { + // prevent codec from being registered twice + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec == aCodec) + { + // this codec is already registered. + first = last; + result = EC_IllegalCall; + } else ++first; + } + if (result.good()) registeredCodecs.push_back(listEntry); else delete listEntry; + } else result = EC_MemoryExhausted; +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + return result; +} + +OFCondition DcmCodecList::deregisterCodec(const DcmCodec *aCodec) +{ + if (aCodec == NULL) return EC_IllegalParameter; +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + // acquire write lock on codec list. Will block if some codec is currently active. + OFCondition result = EC_Normal; + +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.wrlock()) + { +#endif + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec == aCodec) + { + delete *first; + first = registeredCodecs.erase(first); + } else ++first; + } +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + return result; +} + +OFCondition DcmCodecList::updateCodecParameter( + const DcmCodec *aCodec, + const DcmCodecParameter *aCodecParameter) +{ + if ((aCodec == NULL)||(aCodecParameter == NULL)) return EC_IllegalParameter; +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + // acquire write lock on codec list. Will block if some codec is currently active. + OFCondition result = EC_Normal; + +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.wrlock()) + { +#endif + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec == aCodec) (*first)->codecParameter = aCodecParameter; + ++first; + } +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + return result; +} + + +OFCondition DcmCodecList::decode( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + DcmStack & pixelStack) +{ +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + OFCondition result = EC_CannotChangeRepresentation; + + // acquire write lock on codec list. Will block if some write lock is currently active. +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.rdlock()) + { +#endif + E_TransferSyntax fromXfer = fromType.getXfer(); + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec->canChangeCoding(fromXfer, EXS_LittleEndianExplicit)) + { + result = (*first)->codec->decode(fromParam, fromPixSeq, uncompressedPixelData, (*first)->codecParameter, pixelStack); + first = last; + } else ++first; + } +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + return result; +} + + +OFCondition DcmCodecList::decodeFrame( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) +{ +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + OFCondition result = EC_CannotChangeRepresentation; + + // acquire write lock on codec list. Will block if some write lock is currently active. +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.rdlock()) + { +#endif + E_TransferSyntax fromXfer = fromType.getXfer(); + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec->canChangeCoding(fromXfer, EXS_LittleEndianExplicit)) + { + result = (*first)->codec->decodeFrame(fromParam, fromPixSeq, (*first)->codecParameter, + dataset, frameNo, startFragment, buffer, bufSize, decompressedColorModel); + first = last; + } else ++first; + } +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + return result; +} + + +OFCondition DcmCodecList::encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const E_TransferSyntax toRepType, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + DcmStack & pixelStack) +{ + toPixSeq = NULL; +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + OFCondition result = EC_CannotChangeRepresentation; + + // acquire write lock on codec list. Will block if some write lock is currently active. +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.rdlock()) + { +#endif + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec->canChangeCoding(fromRepType, toRepType)) + { + if (!toRepParam) toRepParam = (*first)->defaultRepParam; + result = (*first)->codec->encode(fromRepType, fromParam, fromPixSeq, + toRepParam, toPixSeq, (*first)->codecParameter, pixelStack); + first = last; + } else ++first; + } +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + + return result; +} + +OFCondition DcmCodecList::encode( + const E_TransferSyntax fromRepType, + const Uint16 * pixelData, + const Uint32 length, + const E_TransferSyntax toRepType, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + DcmStack & pixelStack) +{ + toPixSeq = NULL; +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + OFCondition result = EC_CannotChangeRepresentation; + + // acquire write lock on codec list. Will block if some write lock is currently active. +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.rdlock()) + { +#endif + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec->canChangeCoding(fromRepType, toRepType)) + { + if (!toRepParam) toRepParam = (*first)->defaultRepParam; + result = (*first)->codec->encode(pixelData, length, toRepParam, toPixSeq, + (*first)->codecParameter, pixelStack); + first = last; + } else ++first; + } +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + + return result; +} + +OFBool DcmCodecList::canChangeCoding( + const E_TransferSyntax fromRepType, + const E_TransferSyntax toRepType) +{ +#ifdef WITH_THREADS + if (! codecLock.initialized()) return OFFalse; // should never happen +#endif + OFBool result = OFFalse; + + // acquire write lock on codec list. Will block if some write lock is currently active. +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.rdlock()) + { +#endif + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec->canChangeCoding(fromRepType, toRepType)) + { + result = OFTrue; + first = last; + } else ++first; + } +#ifdef WITH_THREADS + } +#endif + + return result; +} + +OFCondition DcmCodecList::determineDecompressedColorModel( + const DcmXfer &fromType, + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + DcmItem *dataset, + OFString &decompressedColorModel) +{ +#ifdef WITH_THREADS + if (! codecLock.initialized()) return EC_IllegalCall; // should never happen +#endif + OFCondition result = EC_CannotChangeRepresentation; + + // acquire write lock on codec list. Will block if some write lock is currently active. +#ifdef WITH_THREADS + OFReadWriteLocker locker(codecLock); + if (0 == locker.rdlock()) + { +#endif + E_TransferSyntax fromXfer = fromType.getXfer(); + OFListIterator(DcmCodecList *) first = registeredCodecs.begin(); + OFListIterator(DcmCodecList *) last = registeredCodecs.end(); + while (first != last) + { + if ((*first)->codec->canChangeCoding(fromXfer, EXS_LittleEndianExplicit)) + { + result = (*first)->codec->determineDecompressedColorModel(fromParam, fromPixSeq, (*first)->codecParameter, + dataset, decompressedColorModel); + first = last; + } else ++first; + } +#ifdef WITH_THREADS + } else result = EC_IllegalCall; +#endif + return result; +} diff --git a/dcmdata/libsrc/dcdatset.cc b/dcmdata/libsrc/dcdatset.cc new file mode 100644 index 00000000..3b8a3dd1 --- /dev/null +++ b/dcmdata/libsrc/dcdatset.cc @@ -0,0 +1,899 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmDataset + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstack.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcpixel.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ +#include "dcmtk/dcmdata/dcostrmf.h" /* for class DcmOutputFileStream */ +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcistrmf.h" /* for class DcmInputFileStream */ +#include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ + + +// ******************************** + + +DcmDataset::DcmDataset() + : DcmItem(DCM_ItemTag, DCM_UndefinedLength), + OriginalXfer(EXS_Unknown), + // the default transfer syntax is explicit VR with local endianness + CurrentXfer((gLocalByteOrder == EBO_BigEndian) ? EXS_BigEndianExplicit : EXS_LittleEndianExplicit) +{ +} + + +DcmDataset& DcmDataset::operator=(const DcmDataset& obj) +{ + if (this != &obj) + { + // copy parent's member variables + DcmItem::operator=(obj); + // copy DcmDataset's member variables + OriginalXfer = obj.OriginalXfer; + CurrentXfer = obj.CurrentXfer; + } + return *this; +} + + +DcmDataset::DcmDataset(const DcmDataset &old) + : DcmItem(old), + OriginalXfer(old.OriginalXfer), + CurrentXfer(old.CurrentXfer) +{ +} + + +OFCondition DcmDataset::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmDataset &, rhs); + } + return EC_Normal; +} + + +DcmDataset::~DcmDataset() +{ +} + + +// ******************************** + + +OFCondition DcmDataset::clear() +{ + OFCondition result = DcmItem::clear(); + // TODO: should we also reset OriginalXfer and CurrentXfer? + setLengthField(DCM_UndefinedLength); + return result; +} + +DcmEVR DcmDataset::ident() const +{ + return EVR_dataset; +} + + +E_TransferSyntax DcmDataset::getOriginalXfer() const +{ + return OriginalXfer; +} + + +E_TransferSyntax DcmDataset::getCurrentXfer() const +{ + return CurrentXfer; +} + + +void DcmDataset::updateOriginalXfer() +{ + DcmStack resultStack; + /* Check for pixel data element on main dataset level only. */ + /* Icon images and other nested pixel data elements are not checked. */ + if (search(DCM_PixelData, resultStack, ESM_fromHere, OFFalse).good()) + { + if (resultStack.top()->ident() == EVR_PixelData) + { + /* determine the transfer syntax of the original and current representation */ + E_TransferSyntax repType = EXS_Unknown; + const DcmRepresentationParameter *repParam = NULL; + DcmPixelData *pixelData = OFstatic_cast(DcmPixelData *, resultStack.top()); + pixelData->getOriginalRepresentationKey(OriginalXfer, repParam); + pixelData->getCurrentRepresentationKey(repType, repParam); + /* check whether we also need to change the current transfer syntax */ + if (repType == EXS_LittleEndianExplicit /* default */) + { + /* only change the value if not already uncompressed */ + if ((CurrentXfer != EXS_LittleEndianImplicit) && + (CurrentXfer != EXS_LittleEndianExplicit) && + (CurrentXfer != EXS_BigEndianExplicit)) + { + CurrentXfer = repType; + } + } + else if (repType != EXS_Unknown) + { + CurrentXfer = repType; + } + } else { + /* something is fishy with the pixel data element (wrong class) */ + DCMDATA_WARN("DcmDataset: Wrong class for pixel data element, cannot update original transfer syntax"); + } + } + /* if no pixel data was found, update only in case of unknown representation */ + else + { + if (OriginalXfer == EXS_Unknown) + { + /* this is also the default in DcmPixelData::getOriginalRepresentationKey() */ + OriginalXfer = EXS_LittleEndianExplicit; + } + if (CurrentXfer == EXS_Unknown) + { + /* this is also the default in DcmPixelData::getCurrentRepresentationKey() */ + CurrentXfer = EXS_LittleEndianExplicit; + } + } +} + + +void DcmDataset::removeInvalidGroups(const OFBool cmdSet) +{ + DcmStack stack; + DcmObject *object = NULL; + /* check for data or command set */ + if (cmdSet) + { + /* iterate over all elements */ + while (nextObject(stack, OFTrue).good()) + { + object = stack.top(); + /* in command sets, only group 0x0000 is allowed */ + if (object->getGTag() != 0x0000) + { + DCMDATA_DEBUG("DcmDataset::removeInvalidGroups() removing element " + << object->getTag() << " from command set"); + stack.pop(); + /* remove element from command set and free memory */ + delete OFstatic_cast(DcmItem *, stack.top())->remove(object); + } + } + } else { + /* iterate over all elements */ + while (nextObject(stack, OFTrue).good()) + { + object = stack.top(); + /* in data sets, group 0x0000 to 0x0003, 0x0005, 0x0007 and 0xFFFF are not allowed */ + if ((object->getGTag() == 0x0000) || (object->getGTag() == 0x0002) || + !object->getTag().hasValidGroup()) + { + DCMDATA_DEBUG("DcmDataset::removeInvalidGroups() removing element " + << object->getTag() << " from data set"); + stack.pop(); + /* remove element from data set and free memory */ + delete OFstatic_cast(DcmItem *, stack.top())->remove(object); + } + /* in sequence items, also group 0x0006 is not allowed */ + else if ((stack.card() > 2) && (object->getGTag() == 0x0006)) + { + DCMDATA_DEBUG("DcmDataset::removeInvalidGroups() removing element " + << object->getTag() << " from sequence item"); + stack.pop(); + /* remove element from data set and free memory */ + delete OFstatic_cast(DcmItem *, stack.top())->remove(object); + } + } + } +} + + +// ******************************** + + +Uint32 DcmDataset::calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + return DcmItem::getLength(xfer, enctype); +} + + +// ******************************** + + +OFBool DcmDataset::canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer) +{ + if (newXfer == EXS_Unknown) + return OFFalse; + + /* Check stream compression for this transfer syntax */ + DcmXfer xf(newXfer); + if (xf.getStreamCompression() == ESC_unsupported) + return OFFalse; + + return DcmItem::canWriteXfer(newXfer, (OriginalXfer == EXS_Unknown) ? oldXfer : OriginalXfer); +} + + +// ******************************** + + +void DcmDataset::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + out << OFendl; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + printNestingLevel(out, flags, level); + out << "# Dicom-Data-Set" << OFendl; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + printNestingLevel(out, flags, level); + out << "# Used TransferSyntax: " << DcmXfer(CurrentXfer).getXferName(); + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_RESET; + out << OFendl; + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (elementList->seek(ELP_next)); + } +} + + +// ******************************** + + +OFCondition DcmDataset::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + OFCondition l_error = EC_Normal; + /* the Native DICOM Model as defined for Application Hosting needs special handling */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* write XML start tag */ + out << "" << OFendl; + } else { + /* DCMTK-specific output format (default) */ + OFString xmlString; + DcmXfer xfer(CurrentXfer); + /* write XML start tag */ + out << "" << OFendl; + } + /* write dataset content */ + if (!elementList->empty()) + { + /* write content of all children */ + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + l_error = dO->writeXML(out, flags & ~DCMTypes::XF_useXMLNamespace); + } while (l_error.good() && elementList->seek(ELP_next)); + } + if (l_error.good()) + { + /* write XML end tag (depending on output format) */ + if (flags & DCMTypes::XF_useNativeModel) + { + out << "" << OFendl; + } else { + out << "" << OFendl; + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmDataset::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + // write dataset content + if (!elementList->empty()) + { + elementList->seek(ELP_first); + OFCondition status = EC_Normal; + // write content of all children + status = elementList->get()->writeJson(out, format); + while (status.good() && elementList->seek(ELP_next)) + { + out << "," << format.newline(); + status = elementList->get()->writeJson(out, format); + } + return status; + } + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmDataset::read(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + return DcmDataset::readUntilTag(inStream, xfer, glenc, maxReadLength, DCM_UndefinedTagKey); +} + +OFCondition DcmDataset::readUntilTag(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength, + const DcmTagKey &stopParsingAtElement) +{ + /* check if the stream variable reported an error */ + errorFlag = inStream.status(); + /* if the stream did not report an error but the stream */ + /* is empty, set the error flag correspondingly */ + if (errorFlag.good() && inStream.eos()) + errorFlag = EC_EndOfStream; + /* else if the stream did not report an error but the transfer */ + /* state does not equal ERW_ready, go ahead and do something */ + else if (errorFlag.good() && getTransferState() != ERW_ready) + { + /* if the transfer state is ERW_init, go ahead and check the transfer syntax which was passed */ + if (getTransferState() == ERW_init) + { + if (dcmAutoDetectDatasetXfer.get()) + { + DCMDATA_DEBUG("DcmDataset::read() automatic detection of transfer syntax is enabled"); + /* To support incorrectly encoded datasets detect the transfer syntax from the stream. */ + /* This is possible for given unknown and plain big or little endian transfer syntaxes. */ + switch (xfer) + { + case EXS_Unknown: + case EXS_LittleEndianImplicit: + case EXS_LittleEndianExplicit: + case EXS_BigEndianExplicit: + case EXS_BigEndianImplicit: + DCMDATA_DEBUG("DcmDataset::read() trying to detect transfer syntax of uncompressed data set"); + OriginalXfer = checkTransferSyntax(inStream); + if ((xfer != EXS_Unknown) && (OriginalXfer != xfer)) + DCMDATA_WARN("DcmDataset: Wrong transfer syntax specified, detecting from data set"); + break; + default: + DCMDATA_DEBUG("DcmDataset::read() data set seems to be compressed, so transfer syntax is not detected"); + OriginalXfer = xfer; + break; + } + } + else /* default behavior */ + { + /* If the transfer syntax which was passed equals EXS_Unknown we want to */ + /* determine the transfer syntax from the information in the stream itself. */ + /* If the transfer syntax is given, we want to use it. */ + if (xfer == EXS_Unknown) + { + DCMDATA_DEBUG("DcmDataset::read() trying to detect transfer syntax of data set (because it is unknown)"); + OriginalXfer = checkTransferSyntax(inStream); + } else + OriginalXfer = xfer; + } + /* dump information on debug level */ + DCMDATA_DEBUG("DcmDataset::read() TransferSyntax=\"" + << DcmXfer(OriginalXfer).getXferName() << "\""); + CurrentXfer = OriginalXfer; + /* check stream compression for this transfer syntax */ + DcmXfer xf(OriginalXfer); + E_StreamCompression sc = xf.getStreamCompression(); + switch (sc) + { + case ESC_none: + // nothing to do + break; + case ESC_unsupported: + // stream compressed transfer syntax that we cannot create; bail out. + if (errorFlag.good()) + errorFlag = EC_UnsupportedEncoding; + break; + default: + // supported stream compressed transfer syntax, install filter + errorFlag = inStream.installCompressionFilter(sc); + break; + } + } + /* pass processing the task to class DcmItem */ + if (errorFlag.good()) + errorFlag = DcmItem::readUntilTag(inStream, OriginalXfer, glenc, maxReadLength, stopParsingAtElement); + + } + + /* if the error flag shows ok or that the end of the stream was encountered, */ + /* we have read information for this particular data set or command; in this */ + /* case, we need to do something for the current dataset object */ + if (errorFlag.good() || errorFlag == EC_EndOfStream) + { + /* perform some final checks on dataset level */ + errorFlag = doPostReadChecks(); + + if (errorFlag.good()) + { + /* set the error flag to ok */ + errorFlag = EC_Normal; + + /* take care of group length (according to what is specified */ + /* in glenc) and padding elements (don't change anything) */ + computeGroupLengthAndPadding(glenc, EPD_noChange, OriginalXfer); + + /* and set the transfer state to ERW_ready to indicate that the data set is complete */ + setTransferState(ERW_ready); + } + } + + /* dump information if required */ + DCMDATA_TRACE("DcmDataset::read() returns error = " << errorFlag.text()); + + /* return result flag */ + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDataset::write( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype /* = EET_UndefinedLength */, + DcmWriteCache *wcache) +{ + return write(outStream, oxfer, enctype, wcache, EGL_recalcGL); +} + + +OFCondition DcmDataset::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache, + const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc, + const Uint32 padlen, + const Uint32 subPadlen, + Uint32 instanceLength) +{ + /* if the transfer state of this is not initialized, this is an illegal call */ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* check if the stream reported an error so far; if not, we can go ahead and write some data to it */ + errorFlag = outStream.status(); + + if (errorFlag.good() && getTransferState() != ERW_ready) + { + /* Determine the transfer syntax which shall be used. Either we use the one which was passed, */ + /* or (if it's an unknown transfer syntax) we use the one which is contained in OriginalXfer. */ + E_TransferSyntax newXfer = oxfer; + if (newXfer == EXS_Unknown) + newXfer = OriginalXfer; + + /* if this function was called for the first time for the dataset object, the transferState is still */ + /* set to ERW_init. In this case, we need to take care of group length and padding elements according */ + /* to the strategies which are specified in glenc and padenc. Additionally, we need to set the element */ + /* list pointer of this data set to the fist element and we need to set the transfer state to ERW_inWork */ + /* so that this scenario will only be executed once for this data set object. */ + if (getTransferState() == ERW_init) + { + + /* Check stream compression for this transfer syntax */ + DcmXfer xf(newXfer); + E_StreamCompression sc = xf.getStreamCompression(); + switch (sc) + { + case ESC_none: + // nothing to do + break; + case ESC_unsupported: + // stream compressed transfer syntax that we cannot create; bail out. + if (errorFlag.good()) + errorFlag = EC_UnsupportedEncoding; + break; + default: + // supported stream compressed transfer syntax, install filter + errorFlag = outStream.installCompressionFilter(sc); + break; + } + + /* take care of group length and padding elements, according to what is specified in glenc and padenc */ + computeGroupLengthAndPadding(glenc, padenc, newXfer, enctype, padlen, subPadlen, instanceLength); + elementList->seek(ELP_first); + setTransferState(ERW_inWork); + } + + /* if the transfer state is set to ERW_inWork, we need to write the information which */ + /* is included in this data set's element list into the buffer which was passed. */ + if (getTransferState() == ERW_inWork) + { + // Remember that elementList->get() can be NULL if buffer was full after + // writing the last item but before writing the sequence delimitation. + if (!elementList->empty() && (elementList->get() != NULL)) + { + /* as long as everything is ok, go through all elements of this data */ + /* set and write the corresponding information to the buffer */ + DcmObject *dO; + do + { + dO = elementList->get(); + errorFlag = dO->write(outStream, newXfer, enctype, wcache); + } while (errorFlag.good() && elementList->seek(ELP_next)); + } + + /* if all the information in this has been written to the */ + /* buffer set this data set's transfer state to ERW_ready */ + if (errorFlag.good()) + { + setTransferState(ERW_ready); + CurrentXfer = newXfer; + } + } + } + } + + /* return the corresponding result value */ + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDataset::writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + E_TransferSyntax newXfer = oxfer; + if (newXfer == EXS_Unknown) + newXfer = OriginalXfer; + + errorFlag = outStream.status(); + if (errorFlag.good() && getTransferState() != ERW_ready) + { + if (getTransferState() == ERW_init) + { + computeGroupLengthAndPadding(EGL_recalcGL, EPD_noChange, newXfer, enctype, 0, 0, 0); + elementList->seek(ELP_first); + setTransferState(ERW_inWork); + } + if (getTransferState() == ERW_inWork) + { + // elementList->get() can be NULL if buffer was full after + // writing the last item but before writing the sequence delimitation. + if (!elementList->empty() && (elementList->get() != NULL)) + { + DcmObject *dO; + do { + dO = elementList->get(); + errorFlag = dO->writeSignatureFormat(outStream, newXfer, enctype, wcache); + } while (errorFlag.good() && elementList->seek(ELP_next)); + } + if (errorFlag.good()) + { + setTransferState(ERW_ready); + CurrentXfer = newXfer; + } + } + } + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDataset::loadFile(const OFFilename &fileName, + const E_TransferSyntax readXfer, + const E_GrpLenEncoding groupLength, + const Uint32 maxReadLength) +{ + return DcmDataset::loadFileUntilTag(fileName, readXfer, groupLength, maxReadLength, DCM_UndefinedTagKey); +} + +OFCondition DcmDataset::loadFileUntilTag(const OFFilename &fileName, + const E_TransferSyntax readXfer, + const E_GrpLenEncoding groupLength, + const Uint32 maxReadLength, + const DcmTagKey &stopParsingAtElement) +{ + OFCondition l_error = EC_InvalidFilename; + /* check parameters first */ + if (!fileName.isEmpty()) + { + /* open file for input */ + DcmInputFileStream fileStream(fileName); + + /* check stream status */ + l_error = fileStream.status(); + + if (l_error.good()) + { + /* clear this object */ + l_error = clear(); + if (l_error.good()) + { + /* read data from file */ + transferInit(); + l_error = readUntilTag(fileStream, readXfer, groupLength, maxReadLength, stopParsingAtElement); + transferEnd(); + } + } + } + return l_error; +} + + +OFCondition DcmDataset::saveFile(const OFFilename &fileName, + const E_TransferSyntax writeXfer, + const E_EncodingType encodingType, + const E_GrpLenEncoding groupLength, + const E_PaddingEncoding padEncoding, + const Uint32 padLength, + const Uint32 subPadLength) +{ + OFCondition l_error = EC_InvalidFilename; + /* check parameters first */ + if (!fileName.isEmpty()) + { + DcmWriteCache wcache; + /* open file for output */ + DcmOutputFileStream fileStream(fileName); + + /* check stream status */ + l_error = fileStream.status(); + if (l_error.good()) + { + /* write data to file */ + transferInit(); + l_error = write(fileStream, writeXfer, encodingType, &wcache, groupLength, padEncoding, padLength, subPadLength); + transferEnd(); + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmDataset::chooseRepresentation(const E_TransferSyntax repType, + const DcmRepresentationParameter *repParam) +{ + OFCondition l_error = EC_Normal; + OFBool pixelDataEncountered = OFFalse; + OFStack pixelStack; + DcmXfer torep(repType); + DcmXfer fromrep(CurrentXfer); + + DcmStack resultStack; + resultStack.push(this); + + // check if we are attempting to compress but the image contains + // floating point or double floating point pixel data, which our codecs don't support. + if ((tagExists(DCM_FloatPixelData, OFTrue) || tagExists(DCM_DoubleFloatPixelData, OFTrue)) && + (fromrep.isEncapsulated() || torep.isEncapsulated())) + { + DCMDATA_ERROR("DcmDataset: Unable to compress/decompress floating point pixel data, cannot change representation"); + l_error = EC_CannotChangeRepresentation; + return l_error; + } + + // check if we are attempting to convert a dataset containing + // a pixel data URL. In that case we only continue if the target + // transfer syntax also uses a pixel data URL. + if (tagExists(DCM_PixelDataProviderURL, OFTrue)) + { + if (! torep.isReferenced()) + { + DCMDATA_ERROR("DcmDataset: Unable to compress image containing a pixel data provider URL, cannot change representation"); + l_error = EC_CannotChangeRepresentation; + return l_error; + } + } + + // Now search for all PixelData elements in this dataset + while (search(DCM_PixelData, resultStack, ESM_afterStackTop, OFTrue).good() && l_error.good()) + { + pixelDataEncountered = OFTrue; + if (resultStack.top()->ident() == EVR_PixelData) + { + DcmPixelData *pixelData = OFstatic_cast(DcmPixelData *, resultStack.top()); + if (!pixelData->canChooseRepresentation(repType, repParam)) + l_error = EC_CannotChangeRepresentation; + pixelStack.push(resultStack); + } else { + /* something is fishy with the pixel data element (wrong class) */ + DCMDATA_ERROR("DcmDataset: Wrong class for pixel data element, cannot change representation"); + l_error = EC_CannotChangeRepresentation; + } + } + + // If there are no pixel data elements in the dataset, issue a warning + if (! pixelDataEncountered) + { + if (torep.isEncapsulated() && ! fromrep.isEncapsulated()) + { + DCMDATA_WARN("DcmDataset: No pixel data present, nothing to compress"); + } + if (! torep.isEncapsulated() && fromrep.isEncapsulated()) + { + DCMDATA_WARN("DcmDataset: No pixel data present, nothing to decompress"); + } + } + + // then call the method doing the real work for all pixel data elements found + while (l_error.good() && (pixelStack.size() > 0)) + { + l_error = OFstatic_cast(DcmPixelData *, pixelStack.top().top())-> + chooseRepresentation(repType, repParam, pixelStack.top()); + +#ifdef PIXELSTACK_MEMORY_LEAK_WORKAROUND + // on certain platforms there seems to be a memory leak + // at this point since for some reason pixelStack.pop does + // not completely destruct the DcmStack object taken from the stack. + // The following work-around should solve this issue. + pixelStack.top().clear(); +#endif + + pixelStack.pop(); + } + + // store current transfer syntax (if conversion was successful) + if (l_error.good()) + CurrentXfer = repType; + return l_error; +} + + +OFBool DcmDataset::hasRepresentation(const E_TransferSyntax repType, + const DcmRepresentationParameter *repParam) +{ + OFBool result = OFTrue; + DcmStack resultStack; + + while(search(DCM_PixelData, resultStack, ESM_afterStackTop, OFTrue).good() && result) + { + if (resultStack.top()->ident() == EVR_PixelData) + { + DcmPixelData *pixelData = OFstatic_cast(DcmPixelData *, resultStack.top()); + result = pixelData->hasRepresentation(repType, repParam); + } + else + result = OFFalse; + } + return result; +} + + +void DcmDataset::removeAllButCurrentRepresentations() +{ + DcmStack resultStack; + + while(search(DCM_PixelData, resultStack, ESM_afterStackTop, OFTrue).good()) + { + if (resultStack.top()->ident() == EVR_PixelData) + { + DcmPixelData *pixelData = OFstatic_cast(DcmPixelData *, resultStack.top()); + pixelData->removeAllButCurrentRepresentations(); + } + } +} + + +void DcmDataset::removeAllButOriginalRepresentations() +{ + DcmStack resultStack; + + while(search(DCM_PixelData, resultStack, ESM_afterStackTop, OFTrue).good()) + { + if (resultStack.top()->ident() == EVR_PixelData) + { + DcmPixelData *pixelData = OFstatic_cast(DcmPixelData *, resultStack.top()); + pixelData->removeAllButOriginalRepresentations(); + } + } +} + + +// ******************************** + + +OFCondition DcmDataset::doPostReadChecks() +{ + DcmElement* pixData = NULL; + DcmXfer xf(OriginalXfer); + OFCondition result = EC_Normal; + if (findAndGetElement(DCM_PixelData, pixData).good()) + { + Uint32 valueLength = pixData->getLengthField(); + if (xf.isEncapsulated()) + { + if (valueLength != DCM_UndefinedLength) + { + if (dcmUseExplLengthPixDataForEncTS.get() == OFFalse /* default case */) + { + /* length of top level dataset's Pixel Data is explicitly */ + /* defined but we have a transfer syntax requiring */ + /* encapsulated pixel data (always encoded with undefined */ + /* length). Print and return an error. */ + DCMDATA_ERROR("Found explicit length Pixel Data in top level " + << "dataset with transfer syntax " << xf.getXferName() + << ": Only undefined length permitted"); + result = EC_PixelDataExplLengthIllegal; + } + else + { + /* Only print warning if requested by related OFGlobal, */ + /* and behave like as we have the same case as for an */ + /* icon image, which is always uncompressed (see above). */ + DCMDATA_WARN("Found explicit length Pixel Data in top level " + << "dataset with transfer syntax " << xf.getXferName() + << ": Only undefined length permitted (ignored on explicit request)"); + } + } + } + } + + return result; +} diff --git a/dcmdata/libsrc/dcdatutl.cc b/dcmdata/libsrc/dcdatutl.cc new file mode 100644 index 00000000..eaabb371 --- /dev/null +++ b/dcmdata/libsrc/dcdatutl.cc @@ -0,0 +1,135 @@ +/* + * + * Copyright (C) 2011-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier, Michael Onken + * + * Purpose: Static helper functionality for dcmdata module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdatutl.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcfilefo.h" + + +// --- static helpers --- + +OFCondition DcmDataUtil::getSOPInstanceFromFile(const OFFilename &filename, + OFString &sopClassUID, + OFString &sopInstanceUID, + OFString &transferSyntaxUID, + const E_FileReadMode readMode) +{ + OFCondition status = EC_IllegalParameter; + if (!filename.isEmpty()) + { + DCMDATA_DEBUG("getting SOP Class UID, SOP Instance UID and Transfer Syntax UID from DICOM file"); + sopClassUID.clear(); + sopInstanceUID.clear(); + transferSyntaxUID.clear(); + // prefer to load file meta information header only (since this is more efficient) + if (readMode != ERM_dataset) + { + DcmMetaInfo metaInfo; + status = metaInfo.loadFile(filename); + if (status.good()) + { + // try to get the UIDs from the meta-header + DCMDATA_DEBUG("trying to get SOP Class UID, SOP Instance UID and Transfer Syntax UID from meta-header"); + metaInfo.findAndGetOFStringArray(DCM_MediaStorageSOPClassUID, sopClassUID); + metaInfo.findAndGetOFStringArray(DCM_MediaStorageSOPInstanceUID, sopInstanceUID); + metaInfo.findAndGetOFStringArray(DCM_TransferSyntaxUID, transferSyntaxUID); + } + } + // alternatively, get UIDs from the dataset (if required and desired) + if ((readMode != ERM_fileOnly) && (readMode != ERM_metaOnly)) + { + if (sopClassUID.empty() || sopInstanceUID.empty()) + DCMDATA_DEBUG("no SOP Class UID and/or SOP Instance UID found in meta-header, checking dataset instead"); + if (status.bad() || sopClassUID.empty() || sopInstanceUID.empty() || transferSyntaxUID.empty()) + { + DcmFileFormat fileformat; + status = fileformat.loadFile(filename, EXS_Unknown, EGL_noChange, 256 /* maxReadLength */, readMode); + if (status.good()) + { + DcmDataset *dataset = fileformat.getDataset(); + if (dataset != NULL) + { + if (sopClassUID.empty()) + dataset->findAndGetOFStringArray(DCM_SOPClassUID, sopClassUID); + if (sopInstanceUID.empty()) + dataset->findAndGetOFStringArray(DCM_SOPInstanceUID, sopInstanceUID); + if (transferSyntaxUID.empty()) + { + DCMDATA_DEBUG("no Transfer Syntax UID found in meta-header, trying to determine from dataset instead"); + // empty string in case of unknown/unsupported transfer syntax + transferSyntaxUID = DcmXfer(dataset->getOriginalXfer()).getXferID(); + } + } + } + } + } + } + return status; +} + + +OFCondition DcmDataUtil::getSOPInstanceFromDataset(DcmDataset *dataset, + const E_TransferSyntax datasetXfer, + OFString &sopClassUID, + OFString &sopInstanceUID, + OFString &transferSyntaxUID) +{ + OFCondition status = EC_IllegalParameter; + // check for invalid dataset pointer + if (dataset != NULL) + { + DCMDATA_DEBUG("getting SOP Class UID, SOP Instance UID and Transfer Syntax UID from DICOM dataset"); + sopClassUID.clear(); + sopInstanceUID.clear(); + transferSyntaxUID.clear(); + // check for correct class type + if (dataset->ident() == EVR_dataset) + { + // try to determine the transfer syntax of the dataset + E_TransferSyntax xfer = datasetXfer; + if (xfer == EXS_Unknown) + xfer = dataset->getOriginalXfer(); + if (xfer == EXS_Unknown) + { + // update the internally stored transfer syntax based on the pixel data (if any) + dataset->updateOriginalXfer(); + xfer = dataset->getOriginalXfer(); + } + if (xfer != EXS_Unknown) + { + status = EC_Normal; + // store UID of the transfers syntax in result variable + transferSyntaxUID = DcmXfer(xfer).getXferID(); + // get other UIDs directly from the dataset + dataset->findAndGetOFStringArray(DCM_SOPClassUID, sopClassUID); + dataset->findAndGetOFStringArray(DCM_SOPInstanceUID, sopInstanceUID); + } else { + DCMDATA_DEBUG("unable to determine transfer syntax from dataset"); + status = EC_UnknownTransferSyntax; + } + } else + status = EC_CorruptedData; + } + return status; +} diff --git a/dcmdata/libsrc/dcddirif.cc b/dcmdata/libsrc/dcddirif.cc new file mode 100644 index 00000000..da285853 --- /dev/null +++ b/dcmdata/libsrc/dcddirif.cc @@ -0,0 +1,5891 @@ +/* + * + * Copyright (C) 2002-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Interface class for simplified creation of a DICOMDIR + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dcddirif.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dccodec.h" +#include "dcmtk/dcmdata/dcmetinf.h" /* for class DcmMetaInfo */ +#include "dcmtk/dcmdata/dcpixel.h" /* for class DcmPixelData */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for class DcmPixelSequence */ +#include "dcmtk/dcmdata/dcvrcs.h" /* for class DcmCodeString */ +#include "dcmtk/dcmdata/dcvrda.h" /* for class DcmDate */ +#include "dcmtk/dcmdata/dcvrtm.h" /* for class DcmTime */ + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofbmanip.h" /* for class OFBitmanipTemplate */ +#include "dcmtk/ofstd/ofcast.h" + + +/*-------------------------* + * constant declarations * + *-------------------------*/ + +// an ISO 9660 format only allows 8 characters in file name +#define MAX_FNAME_COMPONENT_SIZE 8 +// DICOM only allows max 8 path components in a file name +#define MAX_FNAME_COMPONENTS 8 +// max. number of characters printed for string values in a warning message +#define MAX_PRINT_LENGTH 64 +// filename extension for a backup file +#define FNAME_BACKUP_EXTENSION ".BAK" +// prefix used to automatically create patient IDs (+ 6 digits) +#define AUTO_PATIENTID_PREFIX "DCMTKPAT" +// prefix used to automatically create study IDs (+ 6 digits) +#define AUTO_STUDYID_PREFIX "DCMTKSTUDY" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +static OFBool compareSQAttributes(DcmSequenceOfItems *seq1, + DcmSequenceOfItems *seq2, + OFString &reason); + + +/*--------------------------* + * local helper functions * + *--------------------------*/ + +// count number of filename components +static int componentCount(const OFString &filename, + const char separator = PATH_SEPARATOR) +{ + const size_t length = filename.length(); + int count = (length > 0) ? 1 : 0; + for (size_t i = 0; i < length; i++) + { + if (filename.at(i) == separator) + count++; + } + return count; +} + + +// check whether filename component size is within allowed range +static OFBool isComponentTooLarge(const OFString &filename, + const size_t componentLimit, + const OFBool mapFilenames, + const char separator = PATH_SEPARATOR) +{ + OFBool result = OFFalse; + const size_t length = filename.length(); + if (length > 0) + { + size_t pos1 = 0; + size_t pos2 = filename.find(separator); + while (pos2 != OFString_npos) + { + /* check whether component length is within limit */ + if (pos2 - pos1 > componentLimit) + { + result = OFTrue; + break; + } + pos1 = pos2 + 1; + pos2 = filename.find(separator, pos1); + } + if (!result) + { + /* check last component: disregard trailing point */ + if (mapFilenames && (filename.at(length - 1) == '.')) + pos1++; + if (length - pos1 > componentLimit) + result = OFTrue; + } + } + return result; +} + + +// check whether filename contains invalid characters (and locate the first one) +static OFBool locateInvalidFilenameChars(const OFString &filename, + size_t &invalidChar, + const OFBool mapFilenames, + const char separator = PATH_SEPARATOR) +{ + unsigned char c; + size_t i = 0; + size_t length = filename.length(); + /* disregard trailing point */ + if (mapFilenames && (length > 0) && (filename.at(length - 1) == '.')) + length--; + /* iterate over all characters */ + for (i = 0; i < length; i++) + { + c = filename.at(i); + if ((c == '_') || isdigit(c) || (c == separator) || + (isalpha(c) && (isupper(c) || (islower(c) && mapFilenames)))) + { + /* all ok */ + } + else if ((c != '\\') || (separator != '\\')) + { + /* invalid character */ + break; + } + } + /* return position of first invalid character (eos if all valid) */ + invalidChar = i; + /* OFTrue in case of any invalid character */ + return (i != length); +} + + +// massage filename into DICOM format (DOS conventions for path separators, uppercase characters) +static OFString &hostToDicomFilename(const OFString &hostFilename, + OFString &dicomFilename) +{ + dicomFilename.clear(); + const size_t length = hostFilename.length(); + dicomFilename.reserve(length); + for (size_t i = 0; i < length; i++) + { + const unsigned char c = hostFilename.at(i); + if (c == PATH_SEPARATOR) + { + /* the PATH_SEPARATOR depends on the OS (see ) */ + dicomFilename += '\\'; + } + else if (isalpha(c)) + { + /* filenames in DICOM must always be in uppercase */ + dicomFilename += OFstatic_cast(char, toupper(c)); + } + else if (isdigit(c) || (c == '_') || (c == '\\')) + { + /* only characters, digits, underscore and backslash (path separator) allowed */ + dicomFilename += c; + } + } + return dicomFilename; +} + + +/* Massage filename into machine format (replace DOS conventions for path separators) */ +static OFString &dicomToHostFilename(const OFString &dicomFilename, + OFString &hostFilename, + OFBool mapToLower = OFFalse) +{ + hostFilename.clear(); + const size_t length = dicomFilename.length(); + hostFilename.reserve(length); + for (size_t i = 0; i < length; i++) + { + const unsigned char c = dicomFilename.at(i); + /* the PATH_SEPARATOR depends on the OS (see ) */ + if (c == '\\') + hostFilename += PATH_SEPARATOR; + else if (mapToLower) + hostFilename += OFstatic_cast(char, tolower(c)); + else + hostFilename += c; + } + return hostFilename; +} + + +// check whether given DICOM file exists +static OFBool locateDicomFile(const OFString &dicomFilename, + OFString &hostFilename) +{ + dicomToHostFilename(dicomFilename, hostFilename); + OFBool result = OFStandard::fileExists(hostFilename); + if (!result) + { + /* trailing period */ + hostFilename += '.'; + result = OFStandard::fileExists(hostFilename); + } + if (!result) + { + /* lowercase */ + dicomToHostFilename(dicomFilename, hostFilename, OFTrue /*mapToLower*/); + result = OFStandard::fileExists(hostFilename); + if (!result) + { + /* lowercase with trailing period */ + hostFilename += '.'; + result = OFStandard::fileExists(hostFilename); + } + } + if (!result) + { + /* DICOM file not found */ + hostFilename.clear(); + } + return result; +} + + +// compare two strings (empty strings are always regarded as unequal) +static OFBool compare(const OFString &string1, + const OFString &string2) +{ + if (string1.empty() || string2.empty()) + return OFFalse; + return (string1.compare(string2) == 0) ? OFTrue : OFFalse; +} + + +// construct tag name from given object +static OFString &constructTagName(DcmObject *object, + OFString &tagName) +{ + if (object != NULL) + { + DcmTag tag = object->getTag(); + tagName = tag.getTagName(); + // use tag name only if not equal to DcmTag_ERROR_TagName + if (compare(tagName, DcmTag_ERROR_TagName)) + { + char buffer[32]; + sprintf(buffer, "(0x%04x,0x%04x)", tag.getGTag(), tag.getETag()); + tagName = buffer; + } + } else + tagName = "(NULL)"; + return tagName; +} + + +// construct tag name from given object and sequence +static OFString &constructTagNameWithSQ(DcmObject *object, + DcmSequenceOfItems *fromSequence, + const unsigned long itemNumber, + OFString &tagName) +{ + OFString tempStr; + if (fromSequence != NULL) + { + /* create text */ + OFOStringStream oss; + oss << constructTagName(fromSequence, tempStr) << "[" << itemNumber << "]" << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + tagName = tmpString; + OFSTRINGSTREAM_FREESTR(tmpString) + /* append "." for tag name */ + if (object != NULL) + tagName += '.'; + } else + tagName.clear(); + if (object != NULL) + tagName += constructTagName(object, tempStr); + else if (tagName.empty()) + tagName = "(NULL)"; + return tagName; +} + + +// construct text message of two differing numerical values +static OFString &constructDifferentNumbersText(const unsigned long number1, + const unsigned long number2, + OFString &textValue) +{ + textValue.clear(); + /* create message text */ + OFOStringStream oss; + oss << number1 << " != " << number2 << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + textValue = tmpString; + OFSTRINGSTREAM_FREESTR(tmpString) + return textValue; +} + + +// compare given element values and report any deviation +static OFBool compareAttributes(DcmElement *elem1, + DcmElement *elem2, + DcmSequenceOfItems *fromSequence, + unsigned long itemNumber, + OFString &reason) +{ + reason.clear(); + OFString tmpString; + /* check whether elements are valid */ + if (elem1 != NULL) + { + if (elem2 != NULL) + { + /* check whether tags are equal */ + if (elem1->getTag().getXTag() == elem2->getTag().getXTag()) + { + DcmVR vr1(elem1->getVR()); + DcmVR vr2(elem2->getVR()); + /* are the VRs the same? */ + if (vr1.getEVR() == vr2.getEVR()) + { + const unsigned long length1 = elem1->getLength(); + const unsigned long length2 = elem2->getLength(); + /* are the lengths the same? */ + if (length1 == length2) + { + /* are the contents the same? */ + if (length1 > 0) + { + if (vr1.getEVR() == EVR_SQ) + { + /* compare embedded sequences recursively */ + compareSQAttributes(OFstatic_cast(DcmSequenceOfItems *, elem1), + OFstatic_cast(DcmSequenceOfItems *, elem2), reason); + } else { + /* everything else is regarded as a string, might be useful to check binary data separately though */ + OFString value1, value2; + /* compare string value from dataset and record */ + if (elem1->getOFStringArray(value1).good() && elem2->getOFStringArray(value2).good()) + { + if (!compare(value1, value2)) + { + reason = "different values: "; + /* print differing values */ + if ((value1.length() < MAX_PRINT_LENGTH) && (value2.length() < MAX_PRINT_LENGTH)) + reason += "\"" + value1 + "\" != \"" + value2 + "\" "; + reason += "(" + constructTagNameWithSQ(elem1, fromSequence, itemNumber, tmpString) + ")"; + } + } + } + } + } else { + reason = "different value lengths: " + constructDifferentNumbersText(length1, length2, tmpString); + reason += " (" + constructTagNameWithSQ(elem1, fromSequence, itemNumber, tmpString) + ")"; + } + } else + reason = "different VRs: " + OFString(vr1.getVRName()) + " != " + vr2.getVRName() + + " (" + constructTagNameWithSQ(elem1, fromSequence, itemNumber, tmpString) + ")"; + } else + reason = "INTERNAL ERROR: different attributes: " + + constructTagNameWithSQ(elem1, fromSequence, itemNumber, tmpString) + " != " + + constructTagNameWithSQ(elem2, fromSequence, itemNumber, tmpString); + } else + reason = "missing attribute: " + constructTagNameWithSQ(elem2, fromSequence, itemNumber, tmpString); + } else + reason = "missing attribute: " + constructTagNameWithSQ(elem1, fromSequence, itemNumber, tmpString); + /* non-empty reason variable indicates an error */ + return reason.empty(); +} + + +// compare given items for equivalence and report any deviation +static OFBool compareItems(DcmItem *item1, + DcmItem *item2, + DcmSequenceOfItems *fromSequence, + const unsigned long itemNumber, + OFString &reason) +{ + reason.clear(); + OFString tmpString; + /* check whether items are valid */ + if ((item1 != NULL) && (item2 != NULL)) + { + const unsigned long card1 = item1->card(); + const unsigned long card2 = item2->card(); + /* check whether number of attributes is identical */ + if (card1 == card2) + { + unsigned long i = 0; + OFBool first = OFTrue; + DcmStack stack1, stack2; + /* check whether attributes are equal */ + while (item1->nextObject(stack1, first).good() && item2->nextObject(stack2, first).good()) + { + if (!compareAttributes(OFstatic_cast(DcmElement *, stack1.top()), OFstatic_cast(DcmElement *, stack2.top()), fromSequence, i++, reason)) + break; + first = OFFalse; + } + } else { + reason = "different number of attributes in item: " + constructDifferentNumbersText(card1, card2, tmpString); + reason += " (" + constructTagNameWithSQ(NULL /*object*/, fromSequence, itemNumber, tmpString) + ")"; + } + } else + reason = "missing item: " + constructTagNameWithSQ(NULL /*object*/, fromSequence, itemNumber, tmpString); + /* non-empty reason variable indicates an error */ + return reason.empty(); +} + + +// compare given sequences for equivalence and report any deviation +static OFBool compareSQAttributes(DcmSequenceOfItems *seq1, + DcmSequenceOfItems *seq2, + OFString &reason) +{ + reason.clear(); + OFString tmpString; + /* check whether sequences are valid */ + if (seq1 != NULL) + { + if (seq2 != NULL) + { + /* check whether tags are equal */ + if (seq1->getTag().getXTag() == seq2->getTag().getXTag()) + { + const unsigned long card1 = seq1->card(); + const unsigned long card2 = seq2->card(); + /* check whether number of items is identical */ + if (card1 == card2) + { + unsigned long i = 0; + OFBool first = OFTrue; + DcmStack stack1, stack2; + /* check whether items are equal */ + while (seq1->nextObject(stack1, first).good() && seq2->nextObject(stack2, first).good()) + { + if (!compareItems(OFstatic_cast(DcmItem *, stack1.top()), OFstatic_cast(DcmItem *, stack2.top()), seq1, i++, reason)) + break; + first = OFFalse; + } + } else { + reason = "different number of items in sequence: " + constructDifferentNumbersText(card1, card2, tmpString); + reason += " (" + constructTagName(seq1, tmpString) + ")"; + } + } else + reason = "INTERNAL ERROR: different sequences: " + constructTagName(seq1, tmpString) + " != " + + constructTagName(seq2, tmpString); + } else + reason = "missing sequence: " + constructTagName(seq2, tmpString); + } else + reason = "missing sequence: " + constructTagName(seq1, tmpString); + /* non-empty reason variable indicates an error */ + return reason.empty(); +} + + +// get directory record name from type (static) +OFString DicomDirInterface::recordTypeToName(const E_DirRecType recordType) +{ + const char *recordName = NULL; + switch (recordType) + { + case ERT_root: + recordName = "Root"; + break; + case ERT_Curve: + recordName = "Curve"; + break; + case ERT_FilmBox: + recordName = "FilmBox"; + break; + case ERT_FilmSession: + recordName = "FilmSession"; + break; + case ERT_Image: + recordName = "Image"; + break; + case ERT_ImageBox: + recordName = "ImageBox"; + break; + case ERT_Interpretation: + recordName = "Interpretation"; + break; + case ERT_ModalityLut: + recordName = "ModalityLUT"; + break; + case ERT_Mrdr: + recordName = "MRDR"; + break; + case ERT_Overlay: + recordName = "Overlay"; + break; + case ERT_Patient: + recordName = "Patient"; + break; + case ERT_PrintQueue: + recordName = "PrintQueue"; + break; + case ERT_Private: + recordName = "Private"; + break; + case ERT_Results: + recordName = "Results"; + break; + case ERT_Series: + recordName = "Series"; + break; + case ERT_Study: + recordName = "Study"; + break; + case ERT_StudyComponent: + recordName = "StudyComponent"; + break; + case ERT_Topic: + recordName = "Topic"; + break; + case ERT_Visit: + recordName = "Visit"; + break; + case ERT_VoiLut: + recordName = "VOILUT"; + break; + case ERT_SRDocument: + recordName = "SRDocument"; + break; + case ERT_Presentation: + recordName = "Presentation"; + break; + case ERT_Waveform: + recordName = "Waveform"; + break; + case ERT_RTDose: + recordName = "RTDose"; + break; + case ERT_RTStructureSet: + recordName = "RTStructureSet"; + break; + case ERT_RTPlan: + recordName = "RTPlan"; + break; + case ERT_RTTreatRecord: + recordName = "RTTreatRecord"; + break; + case ERT_StoredPrint: + recordName = "StoredPrint"; + break; + case ERT_KeyObjectDoc: + recordName = "KeyObjectDoc"; + break; + case ERT_Registration: + recordName = "Registration"; + break; + case ERT_Fiducial: + recordName = "Fiducial"; + break; + case ERT_RawData: + recordName = "RawData"; + break; + case ERT_Spectroscopy: + recordName = "Spectroscopy"; + break; + case ERT_EncapDoc: + recordName = "EncapDoc"; + break; + case ERT_ValueMap: + recordName = "ValueMap"; + break; + case ERT_HangingProtocol: + recordName = "HangingProtocol"; + break; + case ERT_Stereometric: + recordName = "Stereometric"; + break; + case ERT_HL7StrucDoc: + recordName = "HL7StrucDoc"; + break; + case ERT_Palette: + recordName = "Palette"; + break; + case ERT_Surface: + recordName = "Surface"; + break; + case ERT_Measurement: + recordName = "Measurement"; + break; + case ERT_Implant: + recordName = "Implant"; + break; + case ERT_ImplantGroup: + recordName = "ImplantGroup"; + break; + case ERT_ImplantAssy: + recordName = "ImplantAssy"; + break; + case ERT_Plan: + recordName = "Plan"; + break; + case ERT_SurfaceScan: + recordName = "SurfaceScan"; + break; + case ERT_Tract: + recordName = "Tract"; + break; + case ERT_Assessment: + recordName = "Assessment"; + break; + default: + recordName = "(unknown-directory-record-type)"; + break; + } + return recordName; +} + + +// get record type from SOP class +static E_DirRecType sopClassToRecordType(const OFString &sopClass) +{ + /* default: image SOP class */ + E_DirRecType result = ERT_Image; + /* check whether any non-image SOP class */ + if (compare(sopClass, UID_RETIRED_StandaloneOverlayStorage)) + result = ERT_Overlay; + else if (compare(sopClass, UID_RETIRED_StandaloneModalityLUTStorage)) + result = ERT_ModalityLut; + else if (compare(sopClass, UID_RETIRED_StandaloneVOILUTStorage)) + result = ERT_VoiLut; + else if (compare(sopClass, UID_RETIRED_StandaloneCurveStorage) || + compare(sopClass, UID_RETIRED_StandalonePETCurveStorage)) + { + result = ERT_Curve; + } + else if (compare(sopClass, UID_BasicTextSRStorage) || + compare(sopClass, UID_EnhancedSRStorage) || + compare(sopClass, UID_ComprehensiveSRStorage) || + compare(sopClass, UID_Comprehensive3DSRStorage) || + compare(sopClass, UID_ExtensibleSRStorage) || + compare(sopClass, UID_ProcedureLogStorage) || + compare(sopClass, UID_MammographyCADSRStorage) || + compare(sopClass, UID_ChestCADSRStorage) || + compare(sopClass, UID_ColonCADSRStorage) || + compare(sopClass, UID_XRayRadiationDoseSRStorage) || + compare(sopClass, UID_RadiopharmaceuticalRadiationDoseSRStorage) || + compare(sopClass, UID_SpectaclePrescriptionReportStorage) || + compare(sopClass, UID_MacularGridThicknessAndVolumeReportStorage) || + compare(sopClass, UID_ImplantationPlanSRDocumentStorage) || + compare(sopClass, UID_AcquisitionContextSRStorage) || + compare(sopClass, UID_SimplifiedAdultEchoSRStorage) || + compare(sopClass, UID_PatientRadiationDoseSRStorage) || + compare(sopClass, UID_PerformedImagingAgentAdministrationSRStorage) || + compare(sopClass, UID_PlannedImagingAgentAdministrationSRStorage)) + { + result = ERT_SRDocument; + } + else if (compare(sopClass, UID_GrayscaleSoftcopyPresentationStateStorage) || + compare(sopClass, UID_ColorSoftcopyPresentationStateStorage) || + compare(sopClass, UID_PseudoColorSoftcopyPresentationStateStorage) || + compare(sopClass, UID_BlendingSoftcopyPresentationStateStorage) || + compare(sopClass, UID_XAXRFGrayscaleSoftcopyPresentationStateStorage) || + compare(sopClass, UID_GrayscalePlanarMPRVolumetricPresentationStateStorage) || + compare(sopClass, UID_CompositingPlanarMPRVolumetricPresentationStateStorage) || + compare(sopClass, UID_AdvancedBlendingPresentationStateStorage) || + compare(sopClass, UID_VolumeRenderingVolumetricPresentationStateStorage) || + compare(sopClass, UID_SegmentedVolumeRenderingVolumetricPresentationStateStorage) || + compare(sopClass, UID_MultipleVolumeRenderingVolumetricPresentationStateStorage) || + compare(sopClass, UID_BasicStructuredDisplayStorage)) + { + result = ERT_Presentation; + } + else if (compare(sopClass, UID_TwelveLeadECGWaveformStorage) || + compare(sopClass, UID_GeneralECGWaveformStorage) || + compare(sopClass, UID_AmbulatoryECGWaveformStorage) || + compare(sopClass, UID_HemodynamicWaveformStorage) || + compare(sopClass, UID_CardiacElectrophysiologyWaveformStorage) || + compare(sopClass, UID_BasicVoiceAudioWaveformStorage) || + compare(sopClass, UID_GeneralAudioWaveformStorage) || + compare(sopClass, UID_ArterialPulseWaveformStorage) || + compare(sopClass, UID_RespiratoryWaveformStorage)) + { + result = ERT_Waveform; + } + else if (compare(sopClass, UID_RTDoseStorage)) + result = ERT_RTDose; + else if (compare(sopClass, UID_RTStructureSetStorage)) + result = ERT_RTStructureSet; + else if (compare(sopClass, UID_RTPlanStorage) || + compare(sopClass, UID_RTIonPlanStorage)) + { + result = ERT_RTPlan; + } + else if (compare(sopClass, UID_RTBeamsTreatmentRecordStorage) || + compare(sopClass, UID_RTBrachyTreatmentRecordStorage) || + compare(sopClass, UID_RTTreatmentSummaryRecordStorage) || + compare(sopClass, UID_RTIonBeamsTreatmentRecordStorage)) + { + result = ERT_RTTreatRecord; + } + else if (compare(sopClass, UID_RETIRED_StoredPrintStorage)) + result = ERT_StoredPrint; + else if (compare(sopClass, UID_KeyObjectSelectionDocumentStorage)) + result = ERT_KeyObjectDoc; + else if (compare(sopClass, UID_SpatialRegistrationStorage) || + compare(sopClass, UID_DeformableSpatialRegistrationStorage)) + { + result = ERT_Registration; + } + else if (compare(sopClass, UID_SpatialFiducialsStorage)) + result = ERT_Fiducial; + else if (compare(sopClass, UID_RawDataStorage)) + result = ERT_RawData; + else if (compare(sopClass, UID_MRSpectroscopyStorage)) + result = ERT_Spectroscopy; + else if (compare(sopClass, UID_EncapsulatedPDFStorage) || + compare(sopClass, UID_EncapsulatedCDAStorage) || + compare(sopClass, UID_EncapsulatedSTLStorage)) + { + result = ERT_EncapDoc; + } + else if (compare(sopClass, UID_RealWorldValueMappingStorage)) + result = ERT_ValueMap; + else if (compare(sopClass, UID_HangingProtocolStorage)) + result = ERT_HangingProtocol; + else if (compare(sopClass, UID_StereometricRelationshipStorage)) + result = ERT_Stereometric; + else if (compare(sopClass, UID_ColorPaletteStorage)) + result = ERT_Palette; + else if (compare(sopClass, UID_SurfaceSegmentationStorage)) + result = ERT_Surface; + else if (compare(sopClass, UID_LensometryMeasurementsStorage) || + compare(sopClass, UID_AutorefractionMeasurementsStorage) || + compare(sopClass, UID_KeratometryMeasurementsStorage) || + compare(sopClass, UID_SubjectiveRefractionMeasurementsStorage) || + compare(sopClass, UID_VisualAcuityMeasurementsStorage) || + compare(sopClass, UID_OphthalmicAxialMeasurementsStorage) || + compare(sopClass, UID_IntraocularLensCalculationsStorage) || + compare(sopClass, UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage)) + { + result = ERT_Measurement; + } + else if (compare(sopClass, UID_GenericImplantTemplateStorage)) + result = ERT_Implant; + else if (compare(sopClass, UID_ImplantTemplateGroupStorage)) + result = ERT_ImplantGroup; + else if (compare(sopClass, UID_ImplantAssemblyTemplateStorage)) + result = ERT_ImplantAssy; + else if (compare(sopClass, UID_RTBeamsDeliveryInstructionStorage) || + compare(sopClass, UID_RTBrachyApplicationSetupDeliveryInstructionStorage)) + { + result = ERT_Plan; + } + else if (compare(sopClass, UID_SurfaceScanMeshStorage) || + compare(sopClass, UID_SurfaceScanPointCloudStorage)) + { + result = ERT_SurfaceScan; + } + else if (compare(sopClass, UID_TractographyResultsStorage)) + result = ERT_Tract; + else if (compare(sopClass, UID_ContentAssessmentResultsStorage)) + result = ERT_Assessment; + else if (compare(sopClass, UID_RTPhysicianIntentStorage) || + compare(sopClass, UID_RTSegmentAnnotationStorage) || + compare(sopClass, UID_RTRadiationSetStorage) || + compare(sopClass, UID_CArmPhotonElectronRadiationStorage)) + { + result = ERT_Radiotherapy; + } + return result; +} + + +// get unique key for the given record type +static DcmTagKey getRecordUniqueKey(const E_DirRecType recordType) +{ + /* default for all other record types */ + DcmTagKey result = DCM_ReferencedSOPInstanceUIDInFile; + /* special cases: patient, study, series */ + if (recordType == ERT_Patient) + result = DCM_PatientID; + else if (recordType == ERT_Study) + result = DCM_StudyInstanceUID; + else if (recordType == ERT_Series) + result = DCM_SeriesInstanceUID; + return result; +} + + +// copy content items which modify the concept name of the document root +static void addConceptModContentItems(DcmDirectoryRecord *record, + DcmItem *dataset) +{ + /* Content Sequence, type 1C (see DICOM part 3) + "Contains the Target Content Items that modify the Concept Name + Code Sequence of the root Content Item (Document Title). + Required if the root Content Item is the Source Content Item of + HAS CONCEPT MOD relationships." + */ + if ((record != NULL) && (dataset != NULL)) + { + OFString tmpString; + signed long i = 0; + DcmItem *ditem = NULL; + /* create new ContentSequence */ + DcmSequenceOfItems *newSeq = new DcmSequenceOfItems(DCM_ContentSequence); + if (newSeq != NULL) + { + do { + /* get sequence item (not very efficient, but it works) */ + if (dataset->findAndGetSequenceItem(DCM_ContentSequence, ditem, i++).good()) + { + /* check RelationshipType */ + if (ditem->findAndGetOFString(DCM_RelationshipType, tmpString).good() && + (tmpString.compare("HAS CONCEPT MOD") == 0)) + { + /* copy content item */ + DcmItem *newItem = new DcmItem(*ditem); + if (newItem != NULL) + { + if (newSeq->append(newItem).bad()) + delete newItem; + } + } + } + } while (ditem != NULL); + /* try to insert content sequence into record (if not empty) */ + if ((newSeq->card() == 0) || (record->insert(newSeq, OFTrue /*replaceOld*/).bad())) + delete newSeq; + } + } +} + + +// copy relevant attributes from the blending sequence +static void addBlendingSequence(DcmDirectoryRecord *record, + DcmItem *dataset) +{ + if ((record != NULL) && (dataset != NULL)) + { + /* make sure that the sequence is really present in the original dataset */ + if (dataset->tagExistsWithValue(DCM_BlendingSequence)) + { + signed long i = 0; + DcmItem *ditem = NULL; + /* create new BlendingSequence */ + DcmSequenceOfItems *newSeq = new DcmSequenceOfItems(DCM_BlendingSequence); + if (newSeq != NULL) + { + do { + /* get sequence item (not very efficient, but it works) */ + if (dataset->findAndGetSequenceItem(DCM_BlendingSequence, ditem, i++).good()) + { + DcmItem *newItem = new DcmItem(); + if (newItem != NULL) + { + if (newSeq->append(newItem).good()) + { + ditem->findAndInsertCopyOfElement(DCM_StudyInstanceUID, newItem); + ditem->findAndInsertCopyOfElement(DCM_ReferencedSeriesSequence, newItem); + } else + delete newItem; + } + } + } while ((ditem != NULL) && (i <= 2)); // terminate after two items + /* try to insert blending sequence into record (if not empty) */ + if ((newSeq->card() == 0) || (record->insert(newSeq, OFTrue /*replaceOld*/).bad())) + delete newSeq; + } + } + } +} + + +// insert child record into the parent's list based on the numeric value of the criterionKey +static OFCondition insertWithISCriterion(DcmDirectoryRecord *parent, + DcmDirectoryRecord *child, + const DcmTagKey &criterionKey) +{ + OFCondition result = EC_IllegalParameter; + /* check parameters first */ + if ((parent != NULL) && (child != NULL)) + { + OFBool found = OFFalse; + Sint32 childNumber = 0; + Sint32 parentNumber = 0; + /* retrieve numeric value */ + result = child->findAndGetSint32(criterionKey, childNumber); + /* if available search for proper position */ + if (result.good()) + { + DcmDirectoryRecord *record = NULL; + /* iterate over all records in the parent list */ + while (!found && ((record = parent->nextSub(record)) != NULL)) + { + /* check for proper position */ + if (record->findAndGetSint32(criterionKey, parentNumber).good() && (parentNumber > childNumber)) + found = OFTrue; + } + } + /* insert child record at determined position */ + if (found) + result = parent->insertSubAtCurrentPos(child, OFTrue /*before*/); + else /* or append at the end of the list */ + result = parent->insertSub(child); + } + return result; +} + + +// insert child record sorted under the parent record +static OFCondition insertSortedUnder(DcmDirectoryRecord *parent, + DcmDirectoryRecord *child) +{ + OFCondition result = EC_IllegalParameter; + /* check parameters first */ + if ((parent != NULL) && (child != NULL)) + { + switch (child->getRecordType()) + { + case ERT_Image: + /* try to insert based on Image/InstanceNumber */ + result = insertWithISCriterion(parent, child, DCM_InstanceNumber); + break; + case ERT_Overlay: + /* try to insert based on OverlayNumber */ + result = insertWithISCriterion(parent, child, DCM_RETIRED_OverlayNumber); + break; + case ERT_Curve: + /* try to insert based on CurveNumber */ + result = insertWithISCriterion(parent, child, DCM_RETIRED_CurveNumber); + break; + case ERT_ModalityLut: + case ERT_VoiLut: + /* try to insert based on LUTNumber */ + result = insertWithISCriterion(parent, child, DCM_RETIRED_LUTNumber); + break; + case ERT_SRDocument: + case ERT_Presentation: + case ERT_Waveform: + case ERT_RTDose: + case ERT_RTStructureSet: + case ERT_RTPlan: + case ERT_RTTreatRecord: + case ERT_StoredPrint: + case ERT_KeyObjectDoc: + case ERT_Registration: + case ERT_Fiducial: + case ERT_RawData: + case ERT_Spectroscopy: + case ERT_EncapDoc: + case ERT_ValueMap: + case ERT_Surface: + case ERT_Measurement: + case ERT_SurfaceScan: + case ERT_Tract: + case ERT_Assessment: + case ERT_Radiotherapy: + /* try to insert based on InstanceNumber */ + result = insertWithISCriterion(parent, child, DCM_InstanceNumber); + break; + case ERT_Series: + /* try to insert based on SeriesNumber */ + result = insertWithISCriterion(parent, child, DCM_SeriesNumber); + break; + case ERT_Stereometric: + case ERT_Plan: + /* no InstanceNumber or the like */ + default: + /* append */ + result = parent->insertSub(child); + break; + } + } + return result; +} + + +// create alternative study date if absent in dataset +static OFString &alternativeStudyDate(DcmItem *dataset, + OFString &result) +{ + if (dataset != NULL) + { + /* use another date if present */ + if (dataset->findAndGetOFStringArray(DCM_SeriesDate, result).bad() || result.empty()) + { + if (dataset->findAndGetOFStringArray(DCM_AcquisitionDate, result).bad() || result.empty()) + { + if (dataset->findAndGetOFStringArray(DCM_ContentDate, result).bad() || result.empty()) + { + /* use current date, "19000101" in case of error */ + DcmDate::getCurrentDate(result); + } + } + } + } else + result.clear(); + return result; +} + + +// create alternative study time if absent in dataset +static OFString &alternativeStudyTime(DcmItem *dataset, + OFString &result) +{ + if (dataset != NULL) + { + /* use another time if present */ + if (dataset->findAndGetOFStringArray(DCM_SeriesTime, result).bad() || result.empty()) + { + if (dataset->findAndGetOFStringArray(DCM_AcquisitionTime, result).bad() || result.empty()) + { + if (dataset->findAndGetOFStringArray(DCM_ContentTime, result).bad() || result.empty()) + { + /* use current time, "0000" in case of error */ + DcmTime::getCurrentTime(result); + } + } + } + } else + result.clear(); + return result; +} + + +// check whether given SOP Class UID belongs to a multi-frame composite IOD +// (not sure whether all these IODs should really be treated as "movies"?) +static OFBool isMultiframeStorageSOPClass(const OFString &sopClassUID) +{ + return compare(sopClassUID, UID_BreastProjectionXRayImageStorageForPresentation) || + compare(sopClassUID, UID_BreastProjectionXRayImageStorageForProcessing) || + compare(sopClassUID, UID_BreastTomosynthesisImageStorage) || + compare(sopClassUID, UID_EnhancedCTImageStorage) || + compare(sopClassUID, UID_EnhancedMRColorImageStorage) || + compare(sopClassUID, UID_EnhancedMRImageStorage) || + compare(sopClassUID, UID_EnhancedPETImageStorage) || + compare(sopClassUID, UID_EnhancedUSVolumeStorage) || + compare(sopClassUID, UID_EnhancedXAImageStorage) || + compare(sopClassUID, UID_EnhancedXRFImageStorage) || + compare(sopClassUID, UID_IntravascularOpticalCoherenceTomographyImageStorageForPresentation) || + compare(sopClassUID, UID_IntravascularOpticalCoherenceTomographyImageStorageForProcessing) || + compare(sopClassUID, UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage) || + compare(sopClassUID, UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage) || + compare(sopClassUID, UID_MultiframeSingleBitSecondaryCaptureImageStorage) || + compare(sopClassUID, UID_MultiframeTrueColorSecondaryCaptureImageStorage) || + compare(sopClassUID, UID_NuclearMedicineImageStorage) || + compare(sopClassUID, UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage) || + compare(sopClassUID, UID_OphthalmicPhotography16BitImageStorage) || + compare(sopClassUID, UID_OphthalmicPhotography8BitImageStorage) || + compare(sopClassUID, UID_OphthalmicTomographyImageStorage) || + compare(sopClassUID, UID_ParametricMapStorage) || + compare(sopClassUID, UID_RTDoseStorage) || + compare(sopClassUID, UID_RTImageStorage) || + compare(sopClassUID, UID_UltrasoundMultiframeImageStorage) || + compare(sopClassUID, UID_VideoEndoscopicImageStorage) || + compare(sopClassUID, UID_VideoMicroscopicImageStorage) || + compare(sopClassUID, UID_VideoPhotographicImageStorage) || +// in fact, the following IOD is a multi-frame image but the individual frames are rather "tiles" +// compare(sopClassUID, UID_VLWholeSlideMicroscopyImageStorage) || + compare(sopClassUID, UID_WideFieldOphthalmicPhotographyStereographicProjectionImageStorage) || + compare(sopClassUID, UID_WideFieldOphthalmicPhotography3DCoordinatesImageStorage) || + compare(sopClassUID, UID_XRay3DAngiographicImageStorage) || + compare(sopClassUID, UID_XRay3DCraniofacialImageStorage) || + compare(sopClassUID, UID_XRayAngiographicImageStorage) || + compare(sopClassUID, UID_XRayRadiofluoroscopicImageStorage); +} + + +/*------------------* + * implementation * + *------------------*/ + +// constructor +DicomDirInterface::DicomDirInterface() + : DicomDir(NULL), + ImagePlugin(NULL), + ApplicationProfile(AP_Default), + BackupMode(OFTrue), + AbortMode(OFFalse), + MapFilenamesMode(OFFalse), + InventMode(OFFalse), + InventPatientIDMode(OFFalse), + RetiredSOPClassSupport(OFFalse), + EncodingCheck(OFTrue), + ResolutionCheck(OFTrue), + TransferSyntaxCheck(OFTrue), + FileFormatCheck(OFTrue), + ConsistencyCheck(OFTrue), + IconImageMode(OFFalse), + FilesetUpdateMode(OFFalse), + BackupFilename(), + BackupCreated(OFFalse), + IconSize(64), + IconPrefix(), + DefaultIcon(), + RLESupport(OFFalse), + JPEGSupport(OFFalse), + JP2KSupport(OFFalse), + AutoPatientNumber(0), + AutoStudyNumber(0), + AutoSeriesNumber(0), + AutoInstanceNumber(1), + AutoOverlayNumber(1), + AutoLutNumber(1), + AutoCurveNumber(1) +{ + /* check whether (possibly required) RLE/JPEG/JP2K decoders are registered */ + RLESupport = DcmCodecList::canChangeCoding(EXS_RLELossless, EXS_LittleEndianExplicit); + JPEGSupport = DcmCodecList::canChangeCoding(EXS_JPEGProcess1, EXS_LittleEndianExplicit) && + DcmCodecList::canChangeCoding(EXS_JPEGProcess14SV1, EXS_LittleEndianExplicit); + JP2KSupport = DcmCodecList::canChangeCoding(EXS_JPEG2000LosslessOnly, EXS_LittleEndianExplicit) && + DcmCodecList::canChangeCoding(EXS_JPEG2000, EXS_LittleEndianExplicit); +} + + +// destructor +DicomDirInterface::~DicomDirInterface() +{ + /* reset object to its initial state (free memory) */ + cleanup(); +} + + +// cleanup the object, i.e. free all memory +void DicomDirInterface::cleanup() +{ + /* free all allocated memory */ + delete DicomDir; + /* invalidate references */ + DicomDir = NULL; +} + + +// check whether the current DICOMDIR object is valid +OFBool DicomDirInterface::isDicomDirValid() const +{ + /* tbd: might add more sophisticated checks later on, e.g. some application + * profiles do not not allow for DICOMDIRs with no directory information. + */ + return (DicomDir != NULL); +} + + +// create a backup of the specified file +void DicomDirInterface::createDicomDirBackup(const OFFilename &filename) +{ + /* check whether DICOMDIR already exists */ + if (OFStandard::fileExists(filename)) + { + /* rename existing DICOMDIR */ + OFStandard::appendFilenameExtension(BackupFilename, filename, FNAME_BACKUP_EXTENSION); + /* delete old backup file (if any) */ + deleteDicomDirBackup(); + DCMDATA_INFO("creating DICOMDIR backup: " << BackupFilename); + /* create backup file */ + if (copyFile(filename, BackupFilename)) + BackupCreated = OFTrue; + else + DCMDATA_ERROR("cannot create backup of: " << filename); + } +} + + +// delete backup file if one has been created +void DicomDirInterface::deleteDicomDirBackup() +{ + /* if a backup of the DICOMDIR exists */ + if (OFStandard::fileExists(BackupFilename)) + { + if (BackupCreated) + DCMDATA_INFO("deleting DICOMDIR backup: " << BackupFilename); + else + DCMDATA_INFO("deleting old DICOMDIR backup: " << BackupFilename); + /* delete the backup file */ + OFStandard::deleteFile(BackupFilename); + } + /* reset status variable */ + BackupCreated = OFFalse; +} + + +// create a new DICOMDIR object, i.e. replace any previously existing 'filename' +OFCondition DicomDirInterface::createNewDicomDir(const E_ApplicationProfile profile, + const OFFilename &filename, + const OFString &filesetID) +{ + OFCondition result = EC_IllegalParameter; + if (!filename.isEmpty() && checkFilesetID(filesetID)) + { + FilesetUpdateMode = OFFalse; + /* first remove any existing DICOMDIR from memory */ + cleanup(); + /* then create a backup if a DICOMDIR file already exists */ + if (OFStandard::fileExists(filename)) + { + if (BackupMode) + createDicomDirBackup(filename); + /* and delete it because otherwise DcmDicomDir will parse it + and try to append to existing records */ + OFStandard::deleteFile(filename); + } + /* select new application profile */ + result = selectApplicationProfile(profile); + if (result.good()) + { + DCMDATA_INFO("creating DICOMDIR file using " << getProfileName(ApplicationProfile) + << " profile: " << filename); + /* finally, create a new DICOMDIR object */ + DicomDir = new DcmDicomDir(filename, filesetID.c_str()); + if (DicomDir != NULL) + result = DicomDir->error(); + else + result = EC_MemoryExhausted; + } + } + return result; +} + + +// create a DICOMDIR based on an existing one, i.e. append the new entries +OFCondition DicomDirInterface::appendToDicomDir(const E_ApplicationProfile profile, + const OFFilename &filename) +{ + OFCondition result = EC_IllegalParameter; + if (!filename.isEmpty()) + { + FilesetUpdateMode = OFFalse; + /* first remove any existing DICOMDIR from memory */ + cleanup(); + /* then check whether DICOMDIR file already exists */ + if (OFStandard::fileExists(filename)) + { + /* then create a backup if required */ + if (BackupMode) + createDicomDirBackup(filename); + /* select new application profile */ + result = selectApplicationProfile(profile); + if (result.good()) + { + DCMDATA_INFO("appending to DICOMDIR file using " << getProfileName(ApplicationProfile) + << " profile: " << filename); + /* finally, create a DICOMDIR object based on the existing file */ + DicomDir = new DcmDicomDir(filename); + if (DicomDir != NULL) + result = DicomDir->error(); + else + result = EC_MemoryExhausted; + } + } else { + /* create error message "No such file or directory" from error code */ + char buffer[255]; + const char *text = OFStandard::strerror(ENOENT, buffer, 255); + if ((text == NULL) || (text[0] == '\0')) + text = "(unknown error code)"; + /* error code 18 is reserved for file read error messages (see dcerror.cc) */ + result = makeOFCondition(OFM_dcmdata, 18, OF_error, text); + /* report an error */ + DCMDATA_ERROR(result.text() << ": cannot append to file: " << filename); + } + } + return result; +} + + +// create a DICOMDIR based on an existing one, i.e. append new and update existing entries +OFCondition DicomDirInterface::updateDicomDir(const E_ApplicationProfile profile, + const OFFilename &filename) +{ + OFCondition result = EC_IllegalParameter; + if (!filename.isEmpty()) + { + FilesetUpdateMode = OFTrue; + /* first remove any existing DICOMDIR from memory */ + cleanup(); + /* then check whether DICOMDIR file already exists */ + if (OFStandard::fileExists(filename)) + { + /* then create a backup if required */ + if (BackupMode) + createDicomDirBackup(filename); + /* select new application profile */ + result = selectApplicationProfile(profile); + if (result.good()) + { + DCMDATA_INFO("updating DICOMDIR file using " << getProfileName(ApplicationProfile) + << " profile: " << filename); + /* finally, create a DICOMDIR object based on the existing file */ + DicomDir = new DcmDicomDir(filename); + if (DicomDir != NULL) + result = DicomDir->error(); + else + result = EC_MemoryExhausted; + } + } else { + /* create error message "No such file or directory" from error code */ + char buffer[255]; + const char *text = OFStandard::strerror(ENOENT, buffer, 255); + if ((text == NULL) || (text[0] == '\0')) + text = "(unknown error code)"; + /* error code 18 is reserved for file read error messages (see dcerror.cc) */ + result = makeOFCondition(OFM_dcmdata, 18, OF_error, text); + /* report an error */ + DCMDATA_ERROR(result.text() << ": cannot update file: " << filename); + } + } + return result; +} + + +// write the current DICOMDIR object to file +OFCondition DicomDirInterface::writeDicomDir(const E_EncodingType encodingType, + const E_GrpLenEncoding groupLength) +{ + OFCondition result = EC_InvalidDICOMDIR; + /* check whether DICOMDIR object is valid */ + if (isDicomDirValid()) + { + DCMDATA_INFO("writing file: " << DicomDir->getDirFileName()); + /* write DICOMDIR as Little Endian Explicit as required by the standard */ + result = DicomDir->write(DICOMDIR_DEFAULT_TRANSFERSYNTAX, encodingType, groupLength); + /* delete backup copy in case the new file could be written without any errors */ + if (result.good()) + deleteDicomDirBackup(); + else { + /* report an error */ + DCMDATA_ERROR(result.text() << ": writing file: " << DicomDir->getDirFileName()); + } + } + return result; +} + + +// check whether the specified filename conforms to the DICOM standard requirements +OFBool DicomDirInterface::isFilenameValid(const OFFilename &filename, + const OFBool allowEmpty) +{ + OFBool result = OFTrue; + /* get 8-bit version of the stored string */ + const char *fname = filename.getCharPointer(); + /* check for empty filename */ + if ((fname == NULL) || (fname[0] == '\0')) + { + if (!allowEmpty) + { + DCMDATA_ERROR(" not allowed as filename"); + result = OFFalse; + } + } else { + size_t invalidChar = 0; + /* check whether the file name path is ok and in local format */ + if ((fname[0] == PATH_SEPARATOR) /* absolute path? */ || + locateInvalidFilenameChars(fname, invalidChar, MapFilenamesMode)) + { + DCMDATA_ERROR("invalid character(s) in filename: " << fname << OFendl + << OFString(34 /*message*/ + invalidChar, ' ') << "^"); + result = OFFalse; + } + /* ensure that the maximum number of components is not being exceeded */ + if (componentCount(fname) > MAX_FNAME_COMPONENTS) + { + DCMDATA_ERROR("too many path components (max " << MAX_FNAME_COMPONENTS + << ") in filename: " << fname); + result = OFFalse; + } + /* ensure that each component is not too large */ + if (isComponentTooLarge(fname, MAX_FNAME_COMPONENT_SIZE, MapFilenamesMode)) + { + /* create error message */ + DCMDATA_ERROR("component too large (max " << MAX_FNAME_COMPONENT_SIZE + << " characters) in filename: " << fname); + result = OFFalse; + } + } + return result; +} + + +// check whether the specified character set is defined in the DICOM standard +OFBool DicomDirInterface::isCharsetValid(const char *charset) +{ + OFBool result = OFTrue; + /* empty charset is also valid */ + if ((charset != NULL) && (charset[0] != '\0')) + { + /* check for valid charset */ + result = (strcmp(charset, "ISO_IR 100") == 0) || + (strcmp(charset, "ISO_IR 101") == 0) || + (strcmp(charset, "ISO_IR 109") == 0) || + (strcmp(charset, "ISO_IR 110") == 0) || + (strcmp(charset, "ISO_IR 144") == 0) || + (strcmp(charset, "ISO_IR 127") == 0) || + (strcmp(charset, "ISO_IR 126") == 0) || + (strcmp(charset, "ISO_IR 138") == 0) || + (strcmp(charset, "ISO_IR 148") == 0) || + (strcmp(charset, "ISO_IR 166") == 0) || + (strcmp(charset, "ISO_IR 13") == 0) || + (strcmp(charset, "ISO_IR 192") == 0); + if (!result) + DCMDATA_ERROR("unknown character set for file-set descriptor: " << charset); + } + return result; +} + + +// check the given file (dataset) regarding SOP class and transfer syntax +OFCondition DicomDirInterface::checkSOPClassAndXfer(DcmMetaInfo *metainfo, + DcmItem *dataset, + const OFFilename &filename) +{ + OFCondition result = EC_IllegalParameter; + if ((metainfo != NULL) && (dataset != NULL) && !filename.isEmpty()) + { + /* is sop class ok? */ + OFString mediaSOPClassUID; + if (metainfo->findAndGetOFStringArray(DCM_MediaStorageSOPClassUID, mediaSOPClassUID).bad()) + { + DCMDATA_ERROR("MediaStorageSOPClassUID missing in file meta information: " << filename); + result = EC_TagNotFound; + } else { + /* check if the SOP Class is a known storage SOP class (an image, overlay, curve, etc.) */ + OFBool found = OFFalse; + OFString expectedTransferSyntax = UID_LittleEndianExplicitTransferSyntax; + switch (ApplicationProfile) + { + case AP_MPEG2MPatMLDVD: + expectedTransferSyntax = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + /* multi-frame composite IODs only! */ + found = isMultiframeStorageSOPClass(mediaSOPClassUID); + break; + case AP_BasicCardiac: + if (compare(mediaSOPClassUID, UID_XRayAngiographicImageStorage)) + { + expectedTransferSyntax = UID_JPEGProcess14SV1TransferSyntax; + found = OFTrue; + } + else if (RetiredSOPClassSupport) + { + /* the following SOP class has been retired with DICOM 2006: */ + found = compare(mediaSOPClassUID, UID_RETIRED_DetachedPatientManagementSOPClass); + } + break; + case AP_XrayAngiographic: + case AP_XrayAngiographicDVD: + if (compare(mediaSOPClassUID, UID_XRayAngiographicImageStorage)) + { + /* JPEG lossy compression only allowed for DVD media (checked later) */ + if (ApplicationProfile == AP_XrayAngiographic) + expectedTransferSyntax = UID_JPEGProcess14SV1TransferSyntax; + found = OFTrue; + } else { + found = compare(mediaSOPClassUID, UID_SecondaryCaptureImageStorage) || + compare(mediaSOPClassUID, UID_GrayscaleSoftcopyPresentationStateStorage); + if (!found && RetiredSOPClassSupport) + { + /* the following SOP classes have been retired with DICOM 2004: */ + found = compare(mediaSOPClassUID, UID_RETIRED_StandaloneOverlayStorage) || + compare(mediaSOPClassUID, UID_RETIRED_StandaloneCurveStorage) || + compare(mediaSOPClassUID, UID_RETIRED_DetachedPatientManagementSOPClass); + } + } + break; + case AP_DentalRadiograph: + found = compare(mediaSOPClassUID, UID_DigitalIntraOralXRayImageStorageForPresentation) || + compare(mediaSOPClassUID, UID_DigitalXRayImageStorageForPresentation) || + compare(mediaSOPClassUID, UID_BasicStructuredDisplayStorage) || + compare(mediaSOPClassUID, UID_GrayscaleSoftcopyPresentationStateStorage); + break; + case AP_CTandMR: + /* transfer syntax needs to be checked later */ + found = compare(mediaSOPClassUID, UID_CTImageStorage) || + compare(mediaSOPClassUID, UID_MRImageStorage) || + compare(mediaSOPClassUID, UID_SecondaryCaptureImageStorage) || + /* the following SOP classes have been added with CP-1182 */ + compare(mediaSOPClassUID, UID_GrayscaleSoftcopyPresentationStateStorage) || + compare(mediaSOPClassUID, UID_XRayRadiationDoseSRStorage); + if (!found && RetiredSOPClassSupport) + { + /* the following SOP class has been retired with DICOM 2004: */ + found = compare(mediaSOPClassUID, UID_RETIRED_DetachedPatientManagementSOPClass); + } + break; + case AP_UltrasoundIDSF: + case AP_UltrasoundSCSF: + case AP_UltrasoundCCSF: + /* transfer syntax needs to be checked later */ + found = compare(mediaSOPClassUID, UID_UltrasoundImageStorage); + break; + case AP_UltrasoundIDMF: + case AP_UltrasoundSCMF: + case AP_UltrasoundCCMF: + /* transfer syntax needs to be checked later */ + found = compare(mediaSOPClassUID, UID_UltrasoundImageStorage) || + compare(mediaSOPClassUID, UID_UltrasoundMultiframeImageStorage); + break; + case AP_TwelveLeadECG: + found = compare(mediaSOPClassUID, UID_TwelveLeadECGWaveformStorage); + break; + case AP_HemodynamicWaveform: + found = compare(mediaSOPClassUID, UID_HemodynamicWaveformStorage); + break; + case AP_GeneralPurpose: + case AP_GeneralPurposeDVDJPEG: + case AP_GeneralPurposeDVDJPEG2000: + case AP_GeneralPurposeBDJPEG: + case AP_GeneralPurposeBDJPEG2000: + case AP_GeneralPurposeBDMPEG2MPatML: + case AP_GeneralPurposeBDMPEG2MPatHL: + case AP_GeneralPurposeBDMPEG4HPatLV41: + case AP_GeneralPurposeBDMPEG4HPatLV41BD: + case AP_GeneralPurposeBDMPEG4HPatLV42_2D: + case AP_GeneralPurposeBDMPEG4HPatLV42_3D: + case AP_GeneralPurposeBDMPEG4StereoHPatLV42: + case AP_USBandFlashJPEG: + case AP_USBandFlashJPEG2000: + case AP_GeneralPurposeMIME: + default: + { + /* specify expected transfer syntax for the BD profiles (multi-frame IODs only) */ + if (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatML) + expectedTransferSyntax = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + else if (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatHL) + expectedTransferSyntax = UID_MPEG2MainProfileAtHighLevelTransferSyntax; + else if (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41) + expectedTransferSyntax = UID_MPEG4HighProfileLevel4_1TransferSyntax; + else if (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41BD) + expectedTransferSyntax = UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax; + else if (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_2D) + expectedTransferSyntax = UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax; + else if (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_3D) + expectedTransferSyntax = UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax; + else if (ApplicationProfile == AP_GeneralPurposeBDMPEG4StereoHPatLV42) + expectedTransferSyntax = UID_MPEG4StereoHighProfileLevel4_2TransferSyntax; + /* is it an image ? */ + for (int i = 0; i < numberOfDcmImageSOPClassUIDs && !found; i++) + found = compare(mediaSOPClassUID, dcmImageSOPClassUIDs[i]); + /* is it one of the RT SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_RTDoseStorage) || + compare(mediaSOPClassUID, UID_RTStructureSetStorage) || + compare(mediaSOPClassUID, UID_RTPlanStorage) || + compare(mediaSOPClassUID, UID_RTTreatmentSummaryRecordStorage) || + compare(mediaSOPClassUID, UID_RTBeamsTreatmentRecordStorage) || + compare(mediaSOPClassUID, UID_RTBeamsDeliveryInstructionStorage) || + compare(mediaSOPClassUID, UID_RTBrachyTreatmentRecordStorage) || + compare(mediaSOPClassUID, UID_RTBrachyApplicationSetupDeliveryInstructionStorage) || + compare(mediaSOPClassUID, UID_RTIonPlanStorage) || + compare(mediaSOPClassUID, UID_RTIonBeamsTreatmentRecordStorage) || + compare(mediaSOPClassUID, UID_RTPhysicianIntentStorage) || + compare(mediaSOPClassUID, UID_RTSegmentAnnotationStorage) || + compare(mediaSOPClassUID, UID_RTRadiationSetStorage) || + compare(mediaSOPClassUID, UID_CArmPhotonElectronRadiationStorage); + } + /* is it one of the structured reporting SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_BasicTextSRStorage) || + compare(mediaSOPClassUID, UID_EnhancedSRStorage) || + compare(mediaSOPClassUID, UID_ComprehensiveSRStorage) || + compare(mediaSOPClassUID, UID_Comprehensive3DSRStorage) || + compare(mediaSOPClassUID, UID_ExtensibleSRStorage) || + compare(mediaSOPClassUID, UID_ProcedureLogStorage) || + compare(mediaSOPClassUID, UID_MammographyCADSRStorage) || + compare(mediaSOPClassUID, UID_ChestCADSRStorage) || + compare(mediaSOPClassUID, UID_ColonCADSRStorage) || + compare(mediaSOPClassUID, UID_XRayRadiationDoseSRStorage) || + compare(mediaSOPClassUID, UID_RadiopharmaceuticalRadiationDoseSRStorage) || + compare(mediaSOPClassUID, UID_SpectaclePrescriptionReportStorage) || + compare(mediaSOPClassUID, UID_MacularGridThicknessAndVolumeReportStorage) || + compare(mediaSOPClassUID, UID_ImplantationPlanSRDocumentStorage) || + compare(mediaSOPClassUID, UID_AcquisitionContextSRStorage) || + compare(mediaSOPClassUID, UID_SimplifiedAdultEchoSRStorage) || + compare(mediaSOPClassUID, UID_PatientRadiationDoseSRStorage) || + compare(mediaSOPClassUID, UID_PerformedImagingAgentAdministrationSRStorage) || + compare(mediaSOPClassUID, UID_PlannedImagingAgentAdministrationSRStorage); + } + /* is it one of the waveform SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_TwelveLeadECGWaveformStorage) || + compare(mediaSOPClassUID, UID_GeneralECGWaveformStorage) || + compare(mediaSOPClassUID, UID_AmbulatoryECGWaveformStorage) || + compare(mediaSOPClassUID, UID_HemodynamicWaveformStorage) || + compare(mediaSOPClassUID, UID_CardiacElectrophysiologyWaveformStorage) || + compare(mediaSOPClassUID, UID_BasicVoiceAudioWaveformStorage) || + compare(mediaSOPClassUID, UID_GeneralAudioWaveformStorage) || + compare(mediaSOPClassUID, UID_ArterialPulseWaveformStorage) || + compare(mediaSOPClassUID, UID_RespiratoryWaveformStorage); + } + /* is it one of the presentation state SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_GrayscaleSoftcopyPresentationStateStorage) || + compare(mediaSOPClassUID, UID_ColorSoftcopyPresentationStateStorage) || + compare(mediaSOPClassUID, UID_PseudoColorSoftcopyPresentationStateStorage) || + compare(mediaSOPClassUID, UID_BlendingSoftcopyPresentationStateStorage) || + compare(mediaSOPClassUID, UID_XAXRFGrayscaleSoftcopyPresentationStateStorage) || + compare(mediaSOPClassUID, UID_GrayscalePlanarMPRVolumetricPresentationStateStorage) || + compare(mediaSOPClassUID, UID_CompositingPlanarMPRVolumetricPresentationStateStorage) || + compare(mediaSOPClassUID, UID_AdvancedBlendingPresentationStateStorage) || + compare(mediaSOPClassUID, UID_VolumeRenderingVolumetricPresentationStateStorage) || + compare(mediaSOPClassUID, UID_SegmentedVolumeRenderingVolumetricPresentationStateStorage) || + compare(mediaSOPClassUID, UID_MultipleVolumeRenderingVolumetricPresentationStateStorage); + } + /* is it one of the encapsulated document SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_EncapsulatedPDFStorage) || + compare(mediaSOPClassUID, UID_EncapsulatedCDAStorage) || + compare(mediaSOPClassUID, UID_EncapsulatedSTLStorage); + } + /* is it one of the spatial registration SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_SpatialRegistrationStorage) || + compare(mediaSOPClassUID, UID_SpatialFiducialsStorage) || + compare(mediaSOPClassUID, UID_DeformableSpatialRegistrationStorage); + } + /* is it one of the segmentation SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_SegmentationStorage) || // will be mapped to IMAGE record + compare(mediaSOPClassUID, UID_SurfaceSegmentationStorage); + } + /* is it one of the measurement SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_LensometryMeasurementsStorage) || + compare(mediaSOPClassUID, UID_AutorefractionMeasurementsStorage) || + compare(mediaSOPClassUID, UID_KeratometryMeasurementsStorage) || + compare(mediaSOPClassUID, UID_SubjectiveRefractionMeasurementsStorage) || + compare(mediaSOPClassUID, UID_VisualAcuityMeasurementsStorage) || + compare(mediaSOPClassUID, UID_OphthalmicAxialMeasurementsStorage) || + compare(mediaSOPClassUID, UID_IntraocularLensCalculationsStorage) || + compare(mediaSOPClassUID, UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage); + } + /* is it one of the implant SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_GenericImplantTemplateStorage) || + compare(mediaSOPClassUID, UID_ImplantAssemblyTemplateStorage) || + compare(mediaSOPClassUID, UID_ImplantTemplateGroupStorage); + } + /* is it one of the surface scan SOP Classes? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_SurfaceScanMeshStorage) || + compare(mediaSOPClassUID, UID_SurfaceScanPointCloudStorage); + } + /* is it any other SOP class? */ + if (!found) + { + found = compare(mediaSOPClassUID, UID_KeyObjectSelectionDocumentStorage) || + compare(mediaSOPClassUID, UID_RawDataStorage) || + compare(mediaSOPClassUID, UID_MRSpectroscopyStorage) || + compare(mediaSOPClassUID, UID_RealWorldValueMappingStorage) || + compare(mediaSOPClassUID, UID_HangingProtocolStorage) || + compare(mediaSOPClassUID, UID_BasicStructuredDisplayStorage) || + compare(mediaSOPClassUID, UID_StereometricRelationshipStorage) || + compare(mediaSOPClassUID, UID_ColorPaletteStorage) || + compare(mediaSOPClassUID, UID_TractographyResultsStorage) || + compare(mediaSOPClassUID, UID_ContentAssessmentResultsStorage); + } + /* the following SOP classes have been retired with previous editions of the DICOM standard */ + if (!found && RetiredSOPClassSupport) + { + found = compare(mediaSOPClassUID, UID_RETIRED_StoredPrintStorage) || + compare(mediaSOPClassUID, UID_RETIRED_StandaloneOverlayStorage) || + compare(mediaSOPClassUID, UID_RETIRED_StandaloneCurveStorage) || + compare(mediaSOPClassUID, UID_RETIRED_StandaloneModalityLUTStorage) || + compare(mediaSOPClassUID, UID_RETIRED_StandaloneVOILUTStorage) || + compare(mediaSOPClassUID, UID_RETIRED_StandalonePETCurveStorage); + if (!found && (ApplicationProfile == AP_GeneralPurpose)) + { + /* a detached patient mgmt sop class is also ok */ + found = compare(mediaSOPClassUID, UID_RETIRED_DetachedPatientManagementSOPClass); + } + } + } + } + if (found) + result = EC_Normal; + else + { + OFString sopClassName = dcmFindNameOfUID(mediaSOPClassUID.c_str(), ""); + if (sopClassName.empty()) + sopClassName = mediaSOPClassUID; + DCMDATA_ERROR("invalid SOP class (" << sopClassName << ") for " << getProfileName(ApplicationProfile) + << " profile: " << filename); + result = EC_ApplicationProfileViolated; + } + if (result.good()) + { + /* is transfer syntax ok? */ + OFString transferSyntax; + if (metainfo->findAndGetOFStringArray(DCM_TransferSyntaxUID, transferSyntax).bad()) + { + DCMDATA_ERROR("TransferSyntaxUID missing in file meta information: " << filename); + result = EC_TagNotFound; + } + /* is transfer syntax supported */ + if (result.good()) + { + /* RLE compression */ + if (compare(transferSyntax, UID_RLELosslessTransferSyntax)) + { + if (!RLESupport && IconImageMode) + { + DCMDATA_ERROR("RLE compression not supported: " << filename); + result = EC_CannotChangeRepresentation; + } + } + /* JPEG compression */ + if (compare(transferSyntax, UID_JPEGProcess14SV1TransferSyntax) || + compare(transferSyntax, UID_JPEGProcess1TransferSyntax)) + { + if (!JPEGSupport && IconImageMode) + { + DCMDATA_ERROR("JPEG compression not supported: " << filename); + result = EC_CannotChangeRepresentation; + } + } + /* JPEG 2000 compression */ + if (compare(transferSyntax, UID_JPEG2000LosslessOnlyTransferSyntax) || + compare(transferSyntax, UID_JPEG2000TransferSyntax)) + { + if (!JP2KSupport && IconImageMode) + { + DCMDATA_ERROR("JPEG 2000 compression not supported: " << filename); + result = EC_CannotChangeRepresentation; + } + } + } + /* compare expected and actual transfer syntax */ + if (result.good()) + { + const OFString xferName = dcmFindNameOfUID(transferSyntax.c_str(), ""); + switch (ApplicationProfile) + { + case AP_GeneralPurposeMIME: + /* accept all transfer syntaxes */ + break; + case AP_GeneralPurposeDVDJPEG: + case AP_GeneralPurposeBDJPEG: + case AP_USBandFlashJPEG: + /* need to check multiple transfer syntaxes */ + found = compare(transferSyntax, UID_LittleEndianExplicitTransferSyntax) || + compare(transferSyntax, UID_JPEGProcess14SV1TransferSyntax) || + compare(transferSyntax, UID_JPEGProcess1TransferSyntax) || + compare(transferSyntax, UID_JPEGProcess2_4TransferSyntax); + if (!found) + { + const OFString expXferName1 = dcmFindNameOfUID(UID_LittleEndianExplicitTransferSyntax, ""); + const OFString expXferName2 = dcmFindNameOfUID(UID_JPEGProcess14SV1TransferSyntax, ""); + const OFString expXferName3 = dcmFindNameOfUID(UID_JPEGProcess1TransferSyntax, ""); + const OFString expXferName4 = dcmFindNameOfUID(UID_JPEGProcess2_4TransferSyntax, ""); + /* create error message */ + OFOStringStream oss; + oss << expXferName1 << ", " << expXferName2 << ", " << expXferName3 << " or " + << expXferName4 << " expected but " << xferName << " found: " << filename + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + break; + case AP_GeneralPurposeDVDJPEG2000: + case AP_GeneralPurposeBDJPEG2000: + case AP_USBandFlashJPEG2000: + /* need to check multiple transfer syntaxes */ + found = compare(transferSyntax, UID_LittleEndianExplicitTransferSyntax) || + compare(transferSyntax, UID_JPEG2000LosslessOnlyTransferSyntax) || + compare(transferSyntax, UID_JPEG2000TransferSyntax); + if (!found) + { + const OFString expXferName1 = dcmFindNameOfUID(UID_LittleEndianExplicitTransferSyntax, ""); + const OFString expXferName2 = dcmFindNameOfUID(UID_JPEG2000LosslessOnlyTransferSyntax, ""); + const OFString expXferName3 = dcmFindNameOfUID(UID_JPEG2000TransferSyntax, ""); + /* create error message */ + OFOStringStream oss; + oss << expXferName1 << ", " << expXferName2 << " or " << expXferName3 + << " expected but " << xferName << " found: " << filename << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + break; + case AP_GeneralPurposeBDMPEG2MPatML: + case AP_GeneralPurposeBDMPEG2MPatHL: + case AP_GeneralPurposeBDMPEG4HPatLV41: + case AP_GeneralPurposeBDMPEG4HPatLV41BD: + /* compare with expected transfer syntax */ + found = compare(transferSyntax, expectedTransferSyntax); + if (found) + { + /* check for multi-frame composite IOD */ + if (!isMultiframeStorageSOPClass(mediaSOPClassUID)) + { + /* create error message */ + OFOStringStream oss; + oss << xferName << " only for multi-frame composite IODs: " << filename + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + } else { + found = compare(transferSyntax, UID_LittleEndianExplicitTransferSyntax); + /* create error message */ + OFOStringStream oss; + /* check for multi-frame composite IOD */ + if (isMultiframeStorageSOPClass(mediaSOPClassUID)) + { + const OFString expXferName1 = dcmFindNameOfUID(UID_LittleEndianExplicitTransferSyntax, ""); + const OFString expXferName2 = dcmFindNameOfUID(expectedTransferSyntax.c_str(), ""); + oss << expXferName1 << " or " << expXferName2 << " expected but " << xferName + << " found: " << filename << OFStringStream_ends; + } else { + const OFString expXferName = dcmFindNameOfUID(UID_LittleEndianExplicitTransferSyntax, ""); + oss << expXferName << " expected but " << xferName << " found: " << filename + << OFStringStream_ends; + } + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + break; + case AP_GeneralPurposeBDMPEG4HPatLV42_2D: + case AP_GeneralPurposeBDMPEG4HPatLV42_3D: + case AP_GeneralPurposeBDMPEG4StereoHPatLV42: + /* compare with expected transfer syntax */ + found = compare(transferSyntax, expectedTransferSyntax); + if (found) + { + /* check for multi-frame composite IOD */ + if (!isMultiframeStorageSOPClass(mediaSOPClassUID)) + { + /* create error message */ + OFOStringStream oss; + oss << xferName << " only for multi-frame composite IODs: " << filename + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + } else { + const OFString expXferName = dcmFindNameOfUID(expectedTransferSyntax.c_str(), ""); + /* create error message */ + OFOStringStream oss; + oss << expXferName << " expected but " << xferName << " found: " << filename + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + break; + case AP_XrayAngiographicDVD: + if (compare(mediaSOPClassUID, UID_XRayAngiographicImageStorage)) + { + /* need to check multiple transfer syntaxes */ + found = compare(transferSyntax, UID_JPEGProcess14SV1TransferSyntax) || + compare(transferSyntax, UID_JPEGProcess1TransferSyntax) || + compare(transferSyntax, UID_JPEGProcess2_4TransferSyntax); + if (!found) + { + const OFString expXferName1 = dcmFindNameOfUID(UID_JPEGProcess14SV1TransferSyntax, ""); + const OFString expXferName2 = dcmFindNameOfUID(UID_JPEGProcess1TransferSyntax, ""); + const OFString expXferName3 = dcmFindNameOfUID(UID_JPEGProcess2_4TransferSyntax, ""); + /* create error message */ + OFOStringStream oss; + oss << expXferName1 << ", " << expXferName2 << " or " << expXferName3 + << " expected but " << xferName << " found: " << filename << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + } + break; + case AP_CTandMR: + { + const OFBool isImage = compare(mediaSOPClassUID, UID_CTImageStorage) || + compare(mediaSOPClassUID, UID_MRImageStorage) || + compare(mediaSOPClassUID, UID_SecondaryCaptureImageStorage); + /* need to check multiple transfer syntaxes (JPEG only allowed for images) */ + found = compare(transferSyntax, UID_LittleEndianExplicitTransferSyntax) || + (compare(transferSyntax, UID_JPEGProcess14SV1TransferSyntax) && isImage); + if (!found) + { + const OFString expXferName1 = dcmFindNameOfUID(UID_LittleEndianExplicitTransferSyntax, ""); + const OFString expXferName2 = dcmFindNameOfUID(UID_JPEGProcess14SV1TransferSyntax, ""); + /* create error message */ + OFOStringStream oss; + if (isImage) + { + oss << expXferName1 << " or " << expXferName2 << " expected but " << xferName + << " found: " << filename << OFStringStream_ends; + } else { + oss << expXferName1 << " expected but " << xferName << " found: " << filename + << OFStringStream_ends; + } + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + } + break; + case AP_UltrasoundIDSF: + case AP_UltrasoundSCSF: + case AP_UltrasoundCCSF: + case AP_UltrasoundIDMF: + case AP_UltrasoundSCMF: + case AP_UltrasoundCCMF: + /* need to check multiple transfer syntaxes */ + found = compare(transferSyntax, UID_LittleEndianExplicitTransferSyntax) || + compare(transferSyntax, UID_RLELosslessTransferSyntax) || + compare(transferSyntax, UID_JPEGProcess1TransferSyntax); + if (!found) + { + const OFString expXferName1 = dcmFindNameOfUID(UID_LittleEndianExplicitTransferSyntax, ""); + const OFString expXferName2 = dcmFindNameOfUID(UID_RLELosslessTransferSyntax, ""); + const OFString expXferName3 = dcmFindNameOfUID(UID_JPEGProcess1TransferSyntax, ""); + /* create error message */ + OFOStringStream oss; + oss << expXferName1 << ", " << expXferName2 << " or " << expXferName3 + << " expected but " << xferName << " found: " << filename + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + break; + case AP_GeneralPurpose: + case AP_MPEG2MPatMLDVD: + case AP_BasicCardiac: + case AP_XrayAngiographic: + case AP_DentalRadiograph: + case AP_TwelveLeadECG: + case AP_HemodynamicWaveform: + default: + { + /* compare with expected transfer syntax */ + found = compare(transferSyntax, expectedTransferSyntax); + if (!found) + { + const OFString expXferName = dcmFindNameOfUID(expectedTransferSyntax.c_str(), + expectedTransferSyntax.c_str() /*defaultValue*/); + /* create error message */ + OFOStringStream oss; + oss << expXferName << " expected but " << xferName << " found: " << filename + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (TransferSyntaxCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_ApplicationProfileViolated; + } else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + } + } + } + } + } + } + return result; +} + + +// check whether dataset conforms to basic cardiac application profile +OFCondition DicomDirInterface::checkBasicCardiacAttributes(DcmItem *dataset, + const OFFilename &filename) +{ + OFCondition result = EC_Normal; + if (!checkExistsWithStringValue(dataset, DCM_Modality, "XA", filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithMinMaxValue(dataset, DCM_Rows, 1, 512, filename, ResolutionCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithMinMaxValue(dataset, DCM_Columns, 1, 512, filename, ResolutionCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_BitsAllocated, 8, filename, EncodingCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_BitsStored, 8, filename, EncodingCheck)) + result = EC_ApplicationProfileViolated; + /* overlay data, if present, shall be encoded in OverlayData (60XX,3000) */ + for (Uint16 grp = 0x6000; grp < 0x601f; grp = OFstatic_cast(Uint16, grp + 2)) + { + /* check minimum number of attributes required for an overlay plane to be displayed */ + if (dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayRows.getElement())) && + dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayColumns.getElement())) && + dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayBitsAllocated.getElement())) && + dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayBitPosition.getElement())) && + !dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayData.getElement()))) + { + DCMDATA_ERROR("embedded overlay data present in group 0x" << STD_NAMESPACE hex << grp + << ", file: " << filename); + result = EC_ApplicationProfileViolated; + } + } + return result; +} + + +// check whether dataset conforms to xray angiographic application profile +OFCondition DicomDirInterface::checkXrayAngiographicAttributes(DcmItem *dataset, + const OFString &sopClass, + const OFFilename &filename) +{ + OFCondition result = EC_Normal; + /* requirements depend on SOP class */ + if (compare(sopClass, UID_XRayAngiographicImageStorage)) + { + /* a XA image */ + if (!checkExistsWithStringValue(dataset, DCM_Modality, "XA", filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithMinMaxValue(dataset, DCM_Rows, 1, 1024, filename, ResolutionCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithMinMaxValue(dataset, DCM_Columns, 1, 1024, filename, ResolutionCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithValue(dataset, DCM_BitsStored, filename)) + result = EC_MissingAttribute; + else + { + long bs; + dataset->findAndGetLongInt(DCM_BitsStored, bs); + if ((bs != 8) && (bs != 10) && (bs != 12)) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_BitsStored, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + } + } + else if (compare(sopClass, UID_SecondaryCaptureImageStorage)) + { + /* a SC image */ + if (!checkExistsWithMinMaxValue(dataset, DCM_Rows, 1, 1024, filename, ResolutionCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithMinMaxValue(dataset, DCM_Columns, 1, 1024, filename, ResolutionCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_SamplesPerPixel, 1, filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithStringValue(dataset, DCM_PhotometricInterpretation, "MONOCHROME2", filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_BitsAllocated, 8, filename, EncodingCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_BitsStored, 8, filename, EncodingCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_HighBit, 7, filename, EncodingCheck)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_PixelRepresentation, 0, filename)) + result = EC_ApplicationProfileViolated; + /* check whether any overlay is present */ + for (Uint16 grp = 0x6000; grp < 0x601f; grp = OFstatic_cast(Uint16, grp + 2)) + { + /* check minimum number of attributes required for an overlay plane to be displayed */ + if (dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayRows.getElement())) && + dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayColumns.getElement())) && + dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayBitsAllocated.getElement())) && + dataset->tagExistsWithValue(DcmTagKey(grp, DCM_OverlayBitPosition.getElement()))) + { + /* create error message */ + DCMDATA_ERROR("overlay group 0x" << STD_NAMESPACE hex << grp + << " present in file: " << filename); + result = EC_ApplicationProfileViolated; + } + } + } else /* wrong SOP class */ + result = EC_ApplicationProfileViolated; + return result; +} + + +// check whether dataset conforms to dental radiograph application profile +OFCondition DicomDirInterface::checkDentalRadiographAttributes(DcmItem *dataset, + const OFFilename &filename) +{ + OFCondition result = EC_Normal; + /* check presence of type 2 elements */ + if (!checkExists(dataset, DCM_InstitutionName, filename) || + !checkExists(dataset, DCM_ManufacturerModelName, filename) || + !checkExists(dataset, DCM_DetectorID, filename) || + !checkExists(dataset, DCM_DetectorManufacturerName, filename) || + !checkExists(dataset, DCM_DetectorManufacturerModelName, filename)) + { + result = EC_TagNotFound; + } + /* check for value constraints */ + else if (!checkExistsWithValue(dataset, DCM_BitsAllocated, filename) || + !checkExistsWithValue(dataset, DCM_BitsStored, filename)) + { + result = EC_MissingAttribute; + } else { + long bs; + dataset->findAndGetLongInt(DCM_BitsStored, bs); + if ((bs != 8) && (bs != 10) && (bs != 12) && (bs != 16)) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_BitsStored, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + long ba; + dataset->findAndGetLongInt(DCM_BitsAllocated, ba); + if (((bs == 8) && (ba != 8)) || ((bs != 8) && (ba != 16))) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_BitsAllocated, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + } + return result; +} + + +// check whether dataset conforms to ct and mr application profile +OFCondition DicomDirInterface::checkCTandMRAttributes(DcmItem *dataset, + const OFString &sopClass, + const OFFilename &filename) +{ + OFCondition result = EC_Normal; + /* check presence of type 1 elements */ + if (!checkExistsWithValue(dataset, DCM_Rows, filename) || + !checkExistsWithValue(dataset, DCM_Columns, filename)) + { + result = EC_MissingAttribute; + } + /* requirements depend on SOP class */ + if (compare(sopClass, UID_CTImageStorage)) + { + /* a CT image */ + if (!checkExistsWithStringValue(dataset, DCM_Modality, "CT", filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithStringValue(dataset, DCM_PhotometricInterpretation, "MONOCHROME2", filename)) + result = EC_ApplicationProfileViolated; + } + else if (compare(sopClass, UID_MRImageStorage)) + { + /* a MR image */ + if (!checkExistsWithStringValue(dataset, DCM_Modality, "MR", filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithStringValue(dataset, DCM_PhotometricInterpretation, "MONOCHROME2", filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithValue(dataset, DCM_BitsStored, filename) || + !checkExistsWithValue(dataset, DCM_HighBit, filename)) + { + result = EC_MissingAttribute; + } else { + long bs; + dataset->findAndGetLongInt(DCM_BitsStored, bs); + if ((bs != 8) && (bs != 12) && (bs != 16)) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_BitsStored, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + long hb; + dataset->findAndGetLongInt(DCM_HighBit, hb); + if (hb != bs - 1) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_HighBit, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + } + } + else if (compare(sopClass, UID_SecondaryCaptureImageStorage)) + { + /* a SC image */ + if (!checkExistsWithIntegerValue(dataset, DCM_SamplesPerPixel, 1, filename)) + result = EC_ApplicationProfileViolated; + if (!checkExists(dataset, DCM_PhotometricInterpretation, filename)) + { + OFString pi; + dataset->findAndGetOFStringArray(DCM_PhotometricInterpretation, pi); + if (compare(pi, "MONOCHROME2")) + { + if (!checkExistsWithValue(dataset, DCM_BitsAllocated, filename) || + !checkExistsWithValue(dataset, DCM_BitsStored, filename) || + !checkExistsWithValue(dataset, DCM_HighBit, filename)) + { + result = EC_MissingAttribute; + } else { + long ba; + dataset->findAndGetLongInt(DCM_BitsAllocated, ba); + if ((ba != 8) && (ba != 16)) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_BitsAllocated, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + long bs; + dataset->findAndGetLongInt(DCM_BitsStored, bs); + if (bs != ba) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_BitsStored, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + long hb; + dataset->findAndGetLongInt(DCM_HighBit, hb); + if (hb != bs - 1) + { + /* report an error or a warning */ + printUnexpectedValueMessage(DCM_HighBit, filename, EncodingCheck); + if (EncodingCheck) + result = EC_ApplicationProfileViolated; + } + } + } + else if (compare(pi, "PALETTE COLOR")) + { + if (!checkExistsWithIntegerValue(dataset, DCM_BitsAllocated, 8, filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_BitsStored, 8, filename)) + result = EC_ApplicationProfileViolated; + if (!checkExistsWithIntegerValue(dataset, DCM_HighBit, 7, filename)) + result = EC_ApplicationProfileViolated; + } else { + /* report an error */ + printUnexpectedValueMessage(DCM_PhotometricInterpretation, filename); + result = EC_ApplicationProfileViolated; + } + } + } else /* wrong SOP class */ + result = EC_ApplicationProfileViolated; + return result; +} + + +// check whether dataset conforms to one of the ultrasound application profiles +OFCondition DicomDirInterface::checkUltrasoundAttributes(DcmItem *dataset, + const OFString &transferSyntax, + const OFFilename &filename) +{ + OFCondition result = EC_Normal; + /* a US image */ + if (!checkExistsWithValue(dataset, DCM_PhotometricInterpretation, filename)) + result = EC_MissingAttribute; + else + { + OFString pi; + /* check photometric interpretation */ + getStringFromDataset(dataset, DCM_PhotometricInterpretation, pi); + const OFBool uncompressed = compare(transferSyntax, UID_LittleEndianExplicitTransferSyntax); + const OFBool rle_lossless = compare(transferSyntax, UID_RLELosslessTransferSyntax); + const OFBool jpeg_lossy = compare(transferSyntax, UID_JPEGProcess1TransferSyntax); + OFBool valid = (compare(pi, "MONOCHROME2") && (uncompressed || rle_lossless)) || + (compare(pi, "RGB") && (uncompressed || rle_lossless)) || + (compare(pi, "PALETTE COLOR") && (uncompressed || rle_lossless)) || + (compare(pi, "YBR_FULL") && rle_lossless) || + (compare(pi, "YBR_FULL_422") && (uncompressed || jpeg_lossy)) || + (compare(pi, "YBR_PARTIAL_422") && (uncompressed || jpeg_lossy)); + if (!valid) + { + /* report an error */ + printUnexpectedValueMessage(DCM_PhotometricInterpretation, filename); + result = EC_ApplicationProfileViolated; + } + } + if ((ApplicationProfile == AP_UltrasoundSCSF) || + (ApplicationProfile == AP_UltrasoundCCSF) || + (ApplicationProfile == AP_UltrasoundSCMF) || + (ApplicationProfile == AP_UltrasoundCCMF)) + { + /* check for US region calibration module (SC and CC profiles) */ + OFBool ok = OFTrue; + unsigned long i = 0; + /* iterate over all sequence items */ + DcmItem *ditem = NULL; + while (ok && dataset->findAndGetSequenceItem(DCM_SequenceOfUltrasoundRegions, ditem, i).good()) + { + ok &= checkExistsWithValue(ditem, DCM_RegionLocationMinX0, filename); + ok &= checkExistsWithValue(ditem, DCM_RegionLocationMinY0, filename); + ok &= checkExistsWithValue(ditem, DCM_RegionLocationMaxX1, filename); + ok &= checkExistsWithValue(ditem, DCM_RegionLocationMaxY1, filename); + ok &= checkExistsWithValue(ditem, DCM_PhysicalUnitsXDirection, filename); + ok &= checkExistsWithValue(ditem, DCM_PhysicalUnitsYDirection, filename); + ok &= checkExistsWithValue(ditem, DCM_PhysicalDeltaX, filename); + ok &= checkExistsWithValue(ditem, DCM_PhysicalDeltaY, filename); + ok &= checkExistsWithValue(ditem, DCM_RegionSpatialFormat, filename); + ok &= checkExistsWithValue(ditem, DCM_RegionDataType, filename); + ok &= checkExistsWithValue(ditem, DCM_RegionFlags, filename); + if ((ApplicationProfile == AP_UltrasoundCCSF) || + (ApplicationProfile == AP_UltrasoundCCMF)) + { + /* check for pixel component organization (CC profile) */ + if (checkExistsWithValue(ditem, DCM_PixelComponentOrganization, filename)) + { + ok &= checkExistsWithValue(ditem, DCM_PixelComponentPhysicalUnits, filename); + ok &= checkExistsWithValue(ditem, DCM_PixelComponentDataType, filename); + long pco; + dataset->findAndGetLongInt(DCM_PixelComponentOrganization, pco); + if (pco == 0) + { + /* pixel component organization: bit aligned positions */ + ok &= checkExistsWithValue(ditem, DCM_PixelComponentMask, filename); + ok &= checkExistsWithValue(ditem, DCM_NumberOfTableBreakPoints, filename); + ok &= checkExistsWithValue(ditem, DCM_TableOfXBreakPoints, filename); + ok &= checkExistsWithValue(ditem, DCM_TableOfYBreakPoints, filename); + } else if (pco == 1) + { + /* pixel component organization: ranges */ + ok &= checkExistsWithValue(ditem, DCM_PixelComponentRangeStart, filename); + ok &= checkExistsWithValue(ditem, DCM_PixelComponentRangeStop, filename); + ok &= checkExistsWithValue(ditem, DCM_NumberOfTableBreakPoints, filename); + ok &= checkExistsWithValue(ditem, DCM_TableOfXBreakPoints, filename); + ok &= checkExistsWithValue(ditem, DCM_TableOfYBreakPoints, filename); + } else if (pco == 2) + { + /* pixel component organization: table look up */ + ok &= checkExistsWithValue(ditem, DCM_NumberOfTableEntries, filename); + ok &= checkExistsWithValue(ditem, DCM_TableOfPixelValues, filename); + ok &= checkExistsWithValue(ditem, DCM_TableOfParameterValues, filename); + } else { + /* report an error */ + printUnexpectedValueMessage(DCM_PixelComponentOrganization, filename); + ok = OFFalse; + } + } else + ok = OFFalse; + } + i++; + } + if (ok) + { + if (i == 0) + { + /* no item found, sequence seems to be empty */ + printRequiredAttributeMessage(DCM_SequenceOfUltrasoundRegions, filename); + result = EC_ApplicationProfileViolated; + } + } else { + /* report any error within the 'while' loop as an violation of the application profile */ + result = EC_ApplicationProfileViolated; + } + } + return result; +} + + +// check the given file (dataset) for mandatory attributes +OFCondition DicomDirInterface::checkMandatoryAttributes(DcmMetaInfo *metainfo, + DcmItem *dataset, + const OFFilename &filename) +{ + OFCondition result = EC_IllegalParameter; + if ((metainfo != NULL) && (dataset != NULL)) + { + /* are mandatory attributes for DICOMDIR available and valued? */ + result = EC_Normal; + /* get the transfer syntax and SOP class + (cannot fail, after checkSOPClassAndXfer has been passed) */ + OFString transferSyntax; + OFString mediaSOPClassUID; + metainfo->findAndGetOFStringArray(DCM_TransferSyntaxUID, transferSyntax); + metainfo->findAndGetOFStringArray(DCM_MediaStorageSOPClassUID, mediaSOPClassUID); + E_DirRecType recordType = sopClassToRecordType(mediaSOPClassUID); + /* hanging protocol, palette and implant files are handled separately */ + if (recordType == ERT_HangingProtocol) + { + /* check whether all type 1 elements are really present */ + if (!checkExistsWithValue(dataset, DCM_HangingProtocolName, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_HangingProtocolDescription, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_HangingProtocolLevel, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_HangingProtocolCreator, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_HangingProtocolCreationDateTime, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_HangingProtocolDefinitionSequence, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_NumberOfPriorsReferenced, filename)) + result = EC_MissingAttribute; + } + else if (recordType == ERT_Palette) + { + /* check whether all type 1 elements are really present */ + if (!checkExistsWithValue(dataset, DCM_ContentLabel, filename)) + result = EC_MissingAttribute; + } + else if (recordType == ERT_Implant) + { + /* check whether all type 1 elements are really present */ + if (!checkExistsWithValue(dataset, DCM_Manufacturer, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ImplantName, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ImplantPartNumber, filename)) + result = EC_MissingAttribute; + } + else if (recordType == ERT_ImplantGroup) + { + /* check whether all type 1 elements are really present */ + if (!checkExistsWithValue(dataset, DCM_ImplantAssemblyTemplateName, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ImplantAssemblyTemplateIssuer, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ProcedureTypeCodeSequence, filename)) + result = EC_MissingAttribute; + } + else if (recordType == ERT_ImplantAssy) + { + /* check whether all type 1 elements are really present */ + if (!checkExistsWithValue(dataset, DCM_ImplantTemplateGroupName, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ImplantTemplateGroupIssuer, filename)) + result = EC_MissingAttribute; + } else { + /* PatientID is type 1 in DICOMDIR and type 2 in images */ + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_PatientID, filename)) + result = EC_MissingAttribute; + } + /* PatientName is type 2 in DICOMDIR and images */ + if (!checkExists(dataset, DCM_PatientName, filename)) + result = EC_TagNotFound; + /* StudyDate is type 1 in DICOMDIR and type 2 in images */ + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_StudyDate, filename)) + result = EC_MissingAttribute; + } + /* StudyTime is type 1 in DICOMDIR and type 2 in images */ + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_StudyTime, filename)) + result = EC_MissingAttribute; + } + /* StudyDescription is type 2 in DICOMDIR and type 3 in images. + We can create an empty attribute in the directory + */ + /* StudyInstanceUID is type 1 in DICOMDIR and images */ + if (!checkExistsWithValue(dataset, DCM_StudyInstanceUID, filename)) + result = EC_MissingAttribute; + /* StudyID is type 1 in DICOMDIR and type 2 in images */ + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_StudyID, filename)) + result = EC_MissingAttribute; + } + /* AccessionNumber is type 2 in DICOMDIR and type 3 in images + We can create an empty attribute in the directory + */ + /* Modality is type 1 in DICOMDIR and type 1 in images */ + if (!checkExistsWithValue(dataset, DCM_Modality, filename)) + result = EC_MissingAttribute; + /* SeriesInstanceUID is type 1 in DICOMDIR and type 1 in images */ + if (!checkExistsWithValue(dataset, DCM_SeriesInstanceUID, filename)) + result = EC_MissingAttribute; + /* SeriesNumber is type 1 in DICOMDIR and type 2 in images */ + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_SeriesNumber, filename)) + result = EC_MissingAttribute; + } + /* image and other numbers are type 1 in DICOMDIR but type 2 in images */ + /* (basically, check whether all type 1 elements are really present) */ + switch (recordType) + { + case ERT_Overlay: + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_RETIRED_OverlayNumber, filename)) + result = EC_MissingAttribute; + } + break; + case ERT_ModalityLut: + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_RETIRED_LUTNumber, filename)) + result = EC_MissingAttribute; + } + break; + case ERT_VoiLut: + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_RETIRED_LUTNumber, filename)) + result = EC_MissingAttribute; + } + break; + case ERT_Curve: + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_RETIRED_CurveNumber, filename)) + result = EC_MissingAttribute; + } + break; + case ERT_SRDocument: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_CompletionFlag, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_VerificationFlag, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentTime, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ConceptNameCodeSequence, filename)) + result = EC_MissingAttribute; + { + OFString tmpString; + if (compare(getStringFromDataset(dataset, DCM_VerificationFlag, tmpString), "VERIFIED")) + { + /* VerificationDateTime is required if verification flag is VERIFIED, + retrieve most recent (= last) entry from VerifyingObserverSequence */ + DcmItem *ditem = NULL; + OFCondition l_status = dataset->findAndGetSequenceItem(DCM_VerifyingObserverSequence, ditem, -1 /*last*/); + if (l_status.good()) + { + if (!checkExistsWithValue(ditem, DCM_VerificationDateTime, filename)) + result = EC_MissingAttribute; + } else + result = l_status; + } + } + break; + case ERT_Presentation: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentLabel, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_PresentationCreationDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_PresentationCreationTime, filename)) + result = EC_MissingAttribute; + break; + case ERT_Waveform: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentTime, filename)) + result = EC_MissingAttribute; + break; + case ERT_RTDose: + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + } + if (!checkExistsWithValue(dataset, DCM_DoseSummationType, filename)) + result = EC_MissingAttribute; + break; + case ERT_RTStructureSet: + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + } + if (!checkExistsWithValue(dataset, DCM_StructureSetLabel, filename)) + result = EC_MissingAttribute; + break; + case ERT_RTPlan: + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + } + if (!checkExistsWithValue(dataset, DCM_RTPlanLabel, filename)) + result = EC_MissingAttribute; + break; + case ERT_RTTreatRecord: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + break; + case ERT_StoredPrint: + /* (nothing to do) */ + break; + case ERT_KeyObjectDoc: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentTime, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ConceptNameCodeSequence, filename)) + result = EC_MissingAttribute; + break; + case ERT_RawData: + if (!checkExistsWithValue(dataset, DCM_ContentDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentTime, filename)) + result = EC_MissingAttribute; + /* InstanceNumber is type 2 in IOD and directory record! */ + break; + case ERT_Spectroscopy: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ImageType, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentTime, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_NumberOfFrames, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_Rows, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_Columns, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_DataPointRows, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_DataPointColumns, filename)) + result = EC_MissingAttribute; + break; + case ERT_EncapDoc: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_MIMETypeOfEncapsulatedDocument, filename)) + result = EC_MissingAttribute; + break; + case ERT_Stereometric: + case ERT_Plan: + /* nothing to check */ + break; + case ERT_Registration: + case ERT_Fiducial: + case ERT_ValueMap: + case ERT_Surface: + case ERT_Measurement: + case ERT_Tract: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentTime, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentLabel, filename)) + result = EC_MissingAttribute; + break; + case ERT_SurfaceScan: + if (!checkExistsWithValue(dataset, DCM_ContentDate, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_ContentTime, filename)) + result = EC_MissingAttribute; + break; + case ERT_Assessment: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + if (!checkExistsWithValue(dataset, DCM_InstanceCreationDate, filename)) + result = EC_MissingAttribute; + break; + case ERT_Radiotherapy: + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + break; + case ERT_Image: + default: + { + OFCondition l_status = EC_Normal; + /* it can only be an image */ + if (!InventMode) + { + if (!checkExistsWithValue(dataset, DCM_InstanceNumber, filename)) + result = EC_MissingAttribute; + } + /* check profile specific requirements */ + if ((ApplicationProfile == AP_GeneralPurposeDVDJPEG) || + (ApplicationProfile == AP_GeneralPurposeDVDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatML) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatHL) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41BD) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_2D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_3D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4StereoHPatLV42) || + (ApplicationProfile == AP_USBandFlashJPEG) || + (ApplicationProfile == AP_USBandFlashJPEG2000) || + (ApplicationProfile == AP_MPEG2MPatMLDVD)) + { + /* check presence of type 1 elements */ + if (!checkExistsWithValue(dataset, DCM_Rows, filename) || + !checkExistsWithValue(dataset, DCM_Columns, filename)) + { + result = EC_MissingAttribute; + } + } + else if (ApplicationProfile == AP_BasicCardiac) + l_status = checkBasicCardiacAttributes(dataset, filename); + else if ((ApplicationProfile == AP_XrayAngiographic) || (ApplicationProfile == AP_XrayAngiographicDVD)) + l_status = checkXrayAngiographicAttributes(dataset, mediaSOPClassUID, filename); + else if (ApplicationProfile == AP_DentalRadiograph) + l_status = checkDentalRadiographAttributes(dataset, filename); + else if (ApplicationProfile == AP_CTandMR) + l_status = checkCTandMRAttributes(dataset, mediaSOPClassUID, filename); + else if ((ApplicationProfile == AP_UltrasoundIDSF) || + (ApplicationProfile == AP_UltrasoundSCSF) || + (ApplicationProfile == AP_UltrasoundCCSF) || + (ApplicationProfile == AP_UltrasoundIDMF) || + (ApplicationProfile == AP_UltrasoundSCMF) || + (ApplicationProfile == AP_UltrasoundCCMF)) + { + l_status = checkUltrasoundAttributes(dataset, transferSyntax, filename); + } + /* set final result status (if everything else was ok) */ + if (result.good()) + result = l_status; + } + } + } + } + return result; +} + + +// select specified application profile and adapt certain settings +OFCondition DicomDirInterface::selectApplicationProfile(const E_ApplicationProfile profile) +{ + OFCondition result = EC_Normal; + /* special handling for particular profiles */ + if ((ApplicationProfile == AP_BasicCardiac) || + (ApplicationProfile == AP_XrayAngiographic) || + (ApplicationProfile == AP_XrayAngiographicDVD)) + { + /* check for JPEG image support */ + if (!JPEGSupport) + result = EC_IllegalCall; + } + /* store new profile */ + if (result.good()) + ApplicationProfile = profile; + return result; +} + + +// check whether DICOM file is suitable for a DICOMDIR of the specified application profile +OFCondition DicomDirInterface::checkDicomFile(const OFFilename &filename, + const OFFilename &directory, + const OFBool checkFilename) +{ + /* define file format object for the DICOM file to be loaded */ + DcmFileFormat fileformat; + /* call the "real" function */ + return loadAndCheckDicomFile(filename, directory, fileformat, checkFilename); +} + + +// load DICOM file and check whether it is suitable for a DICOMDIR of the specified application profile +OFCondition DicomDirInterface::loadAndCheckDicomFile(const OFFilename &filename, + const OFFilename &directory, + DcmFileFormat &fileformat, + const OFBool checkFilename) +{ + OFCondition result = EC_IllegalParameter; + /* create fully qualified pathname of the DICOM file to be added */ + OFFilename pathname; + OFStandard::combineDirAndFilename(pathname, directory, filename, OFTrue /*allowEmptyDirName*/); + DCMDATA_INFO("checking file: " << pathname); + /* check filename (if not disabled) */ + if (!checkFilename || isFilenameValid(filename)) + { + /* load DICOM file */ + result = fileformat.loadFile(pathname); + if (result.good()) + { + /* check for correct part 10 file format */ + DcmMetaInfo *metainfo = fileformat.getMetaInfo(); + DcmDataset *dataset = fileformat.getDataset(); + if ((metainfo == NULL) || (metainfo->card() == 0)) + { + /* create error message */ + OFOStringStream oss; + oss << "file not in part 10 format (no file meta information): " << filename + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + /* file meta information is required */ + if (FileFormatCheck) + { + DCMDATA_ERROR(tmpString); + result = EC_FileMetaInfoHeaderMissing; + } else { + DCMDATA_WARN(tmpString); + /* add missing file meta information */ + if (dataset != NULL) + fileformat.validateMetaInfo(dataset->getOriginalXfer()); + } + OFSTRINGSTREAM_FREESTR(tmpString) + } + /* check for empty dataset */ + if ((dataset == NULL) || (dataset->card() == 0)) + { + DCMDATA_ERROR("file contains no data (no data set): " << filename); + result = EC_CorruptedData; + } + /* only proceed if previous checks have been passed */ + if (result.good()) + { + /* check for SOP class and transfer syntax */ + result = checkSOPClassAndXfer(metainfo, dataset, filename); + if (result.good()) + { + /* check for mandatory attributes */ + if (checkMandatoryAttributes(metainfo, dataset, filename).bad()) + result = EC_ApplicationProfileViolated; + } + } + } else { + /* report an error */ + DCMDATA_ERROR(result.text() << ": reading file: " << filename); + } + } + return result; +} + + +// check whether given record matches dataset +OFBool DicomDirInterface::recordMatchesDataset(DcmDirectoryRecord *record, + DcmItem *dataset) +{ + OFBool result = OFFalse; + if ((record != NULL) && (dataset != NULL)) + { + OFString recordString, datasetString; + /* check matching depending on record type */ + switch (record->getRecordType()) + { + case ERT_Patient: + if (checkExistsWithValue(dataset, DCM_PatientID)) + { + OFString patientID; + /* PatientID is the primary key */ + result = compare(getStringFromDataset(record, DCM_PatientID, patientID), + getStringFromDataset(dataset, DCM_PatientID, datasetString)); + /* optional: check whether PatientName also matches */ + if (result && !compare(getStringFromDataset(record, DCM_PatientName, recordString), + getStringFromDataset(dataset, DCM_PatientName, datasetString))) + { + if (InventPatientIDMode) + { + DCMDATA_WARN("PatientName inconsistent for PatientID: " << patientID); + /* remove current patient ID, will be replaced later */ + dataset->putAndInsertString(DCM_PatientID, ""); + result = OFFalse; + } + } + } else { + /* if there is no value for PatientID in the dataset try using the PatientName */ + result = compare(getStringFromDataset(record, DCM_PatientName, recordString), + getStringFromDataset(dataset, DCM_PatientName, datasetString)); + } + break; + case ERT_Study: + if (checkExistsWithValue(record, DCM_StudyInstanceUID)) + { + result = compare(getStringFromDataset(record, DCM_StudyInstanceUID, recordString), + getStringFromDataset(dataset, DCM_StudyInstanceUID, datasetString)); + } else { + /* the Study Instance UID can be in the referenced file instead */ + OFString refFilename; + if (!getStringFromDataset(record, DCM_ReferencedFileID, refFilename).empty()) + { + OFString hostFilename; + if (locateDicomFile(refFilename, hostFilename)) + { + result = compare(getStringFromFile(hostFilename, DCM_StudyInstanceUID, recordString), + getStringFromDataset(dataset, DCM_StudyInstanceUID, datasetString)); + } else + DCMDATA_ERROR("cannot locate referenced file: " << refFilename); + } + } + break; + case ERT_Series: + result = compare(getStringFromDataset(record, DCM_SeriesInstanceUID, recordString), + getStringFromDataset(dataset, DCM_SeriesInstanceUID, datasetString)); + break; + case ERT_Image: + case ERT_Overlay: + case ERT_Curve: + case ERT_ModalityLut: + case ERT_VoiLut: + case ERT_SRDocument: + case ERT_Presentation: + case ERT_Waveform: + case ERT_RTDose: + case ERT_RTStructureSet: + case ERT_RTPlan: + case ERT_RTTreatRecord: + case ERT_StoredPrint: + case ERT_KeyObjectDoc: + case ERT_Registration: + case ERT_Fiducial: + case ERT_RawData: + case ERT_Spectroscopy: + case ERT_EncapDoc: + case ERT_ValueMap: + case ERT_HangingProtocol: + case ERT_Stereometric: + case ERT_Palette: + case ERT_Surface: + case ERT_Measurement: + case ERT_Implant: + case ERT_ImplantGroup: + case ERT_ImplantAssy: + case ERT_Plan: + case ERT_SurfaceScan: + case ERT_Tract: + case ERT_Assessment: + case ERT_Radiotherapy: + /* The attribute ReferencedSOPInstanceUID is automatically + * put into a Directory Record when a filename is present. + */ + result = compare(getStringFromDataset(record, DCM_ReferencedSOPInstanceUIDInFile, recordString), + getStringFromDataset(dataset, DCM_SOPInstanceUID, datasetString)); + break; + default: + DCMDATA_ERROR("record type not yet implemented"); + break; + } + } + return result; +} + + +// search for a given record +DcmDirectoryRecord *DicomDirInterface::findExistingRecord(DcmDirectoryRecord *parent, + const E_DirRecType recordType, + DcmItem* dataset) +{ + OFBool found = OFFalse; + DcmDirectoryRecord *record = NULL; + if (parent != NULL) + { + /* iterate over all records */ + while (!found && ((record = parent->nextSub(record)) != NULL)) + { + if (record->getRecordType() == recordType) + found = recordMatchesDataset(record, dataset); + } + } + return (found) ? record : NULL; +} + + +// create or update patient record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildPatientRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFFilename &sourceFilename) +{ + /* create new patient record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Patient, NULL, sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* use type 1C instead of 1 in order to avoid unwanted overwriting */ + copyElementType1C(dataset, DCM_PatientID, record, sourceFilename); + copyElementType2(dataset, DCM_PatientName, record, sourceFilename); + if ((ApplicationProfile == AP_GeneralPurposeDVDJPEG) || + (ApplicationProfile == AP_GeneralPurposeDVDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatML) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatHL) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41BD) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_2D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_3D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4StereoHPatLV42) || + (ApplicationProfile == AP_USBandFlashJPEG) || + (ApplicationProfile == AP_USBandFlashJPEG2000) || + (ApplicationProfile == AP_MPEG2MPatMLDVD)) + { + /* additional type 1C keys specified by specific profiles */ + copyElementType1C(dataset, DCM_PatientBirthDate, record, sourceFilename); + copyElementType1C(dataset, DCM_PatientSex, record, sourceFilename); + } + else if ((ApplicationProfile == AP_BasicCardiac) || + (ApplicationProfile == AP_XrayAngiographic) || + (ApplicationProfile == AP_XrayAngiographicDVD)) + { + /* additional type 2 keys specified by specific profiles */ + copyElementType2(dataset, DCM_PatientBirthDate, record, sourceFilename); + copyElementType2(dataset, DCM_PatientSex, record, sourceFilename); + } + } else { + printRecordErrorMessage(record->error(), ERT_Patient, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + DCMDATA_ERROR("out of memory (creating patient record)"); + return record; +} + + +// create or update study record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildStudyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFFilename &sourceFilename) +{ + /* create new study record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Study, NULL, sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + OFString tmpString; + /* copy attribute values from dataset to study record */ + copyStringWithDefault(dataset, DCM_StudyDate, record, sourceFilename, alternativeStudyDate(dataset, tmpString).c_str(), OFTrue /*printWarning*/); + copyStringWithDefault(dataset, DCM_StudyTime, record, sourceFilename, alternativeStudyTime(dataset, tmpString).c_str(), OFTrue /*printWarning*/); + copyElementType2(dataset, DCM_StudyDescription, record, sourceFilename); + copyElementType1(dataset, DCM_StudyInstanceUID, record, sourceFilename); + /* use type 1C instead of 1 in order to avoid unwanted overwriting */ + copyElementType1C(dataset, DCM_StudyID, record, sourceFilename); + copyElementType2(dataset, DCM_AccessionNumber, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Study, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + DCMDATA_ERROR("out of memory (creating study record)"); + return record; +} + + +// create or update series record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildSeriesRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFFilename &sourceFilename) +{ + /* create new series record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Series, NULL, sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to series record */ + copyElementType1(dataset, DCM_Modality, record, sourceFilename); + copyElementType1(dataset, DCM_SeriesInstanceUID, record, sourceFilename); + /* use type 1C instead of 1 in order to avoid unwanted overwriting */ + copyElementType1C(dataset, DCM_SeriesNumber, record, sourceFilename); + if ((ApplicationProfile == AP_GeneralPurposeDVDJPEG) || + (ApplicationProfile == AP_GeneralPurposeDVDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatML) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatHL) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41BD) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_2D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_3D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4StereoHPatLV42) || + (ApplicationProfile == AP_USBandFlashJPEG) || + (ApplicationProfile == AP_USBandFlashJPEG2000) || + (ApplicationProfile == AP_MPEG2MPatMLDVD)) + { + /* additional type 1C keys specified by specific profiles */ + copyElementType1C(dataset, DCM_InstitutionName, record, sourceFilename); + copyElementType1C(dataset, DCM_InstitutionAddress, record, sourceFilename); + copyElementType1C(dataset, DCM_PerformingPhysicianName, record, sourceFilename); + } + else if ((ApplicationProfile == AP_BasicCardiac) || + (ApplicationProfile == AP_XrayAngiographic) || + (ApplicationProfile == AP_XrayAngiographicDVD)) + { + /* additional type 2 keys specified by specific profiles (type 1C or 3 in file) */ + copyStringWithDefault(dataset, DCM_InstitutionName, record, sourceFilename); + copyStringWithDefault(dataset, DCM_InstitutionAddress, record, sourceFilename); + copyStringWithDefault(dataset, DCM_PerformingPhysicianName, record, sourceFilename); + } + } else { + printRecordErrorMessage(record->error(), ERT_Series, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + DCMDATA_ERROR("out of memory (creating series record)"); + return record; +} + + +// create or update overlay record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildOverlayRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new overlay record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Overlay, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to overlay record */ + copyElementType1(dataset, DCM_RETIRED_OverlayNumber, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Overlay, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Overlay, "create"); + return record; +} + + +// create or update modality lut record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildModalityLutRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new modality lut record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_ModalityLut, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to modality lut record */ + copyElementType1(dataset, DCM_RETIRED_LUTNumber, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_ModalityLut, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_ModalityLut, "create"); + return record; +} + + +// create or update voi lut record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildVoiLutRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new voi lut record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_VoiLut, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to voi lut record */ + copyElementType1(dataset, DCM_RETIRED_LUTNumber, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_VoiLut, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_VoiLut, "create"); + return record; +} + + +// create or update curve record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildCurveRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new curve record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Curve, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to curve record */ + copyElementType1(dataset, DCM_RETIRED_CurveNumber, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Curve, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Curve, "create"); + return record; +} + + +// create or update structure reporting record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildStructReportRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new struct report record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_SRDocument, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + OFString tmpString; + /* copy attribute values from dataset to struct report record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_CompletionFlag, record, sourceFilename); + copyElementType1(dataset, DCM_VerificationFlag, record, sourceFilename); + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + if (compare(getStringFromDataset(dataset, DCM_VerificationFlag, tmpString), "VERIFIED")) + { + /* VerificationDateTime is required if verification flag is VERIFIED, + retrieve most recent (= last) entry from VerifyingObserverSequence */ + DcmItem *ditem = NULL; + OFCondition status = dataset->findAndGetSequenceItem(DCM_VerifyingObserverSequence, ditem, -1 /*last*/); + if (status.good()) + copyElementType1(ditem, DCM_VerificationDateTime, record, sourceFilename); + else + printAttributeErrorMessage(DCM_VerifyingObserverSequence, status, "retrieve"); + } + copyElementType1(dataset, DCM_ConceptNameCodeSequence, record, sourceFilename); + addConceptModContentItems(record, dataset); + } else { + printRecordErrorMessage(record->error(), ERT_SRDocument, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_SRDocument, "create"); + return record; +} + + +// create or update presentation state record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildPresentationRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new presentation record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Presentation, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to presentation record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType1(dataset, DCM_PresentationCreationDate, record, sourceFilename); + copyElementType1(dataset, DCM_PresentationCreationTime, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + copyElementType1C(dataset, DCM_ReferencedSeriesSequence, record, sourceFilename); + addBlendingSequence(record, dataset); + } else { + printRecordErrorMessage(record->error(), ERT_Presentation, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Presentation, "create"); + return record; +} + + +// create or update waveform record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildWaveformRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new waveform record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Waveform, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to waveform record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Waveform, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Waveform, "create"); + return record; +} + + +// create or update rt dose record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildRTDoseRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new rt dose record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_RTDose, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to rt dose record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_DoseSummationType, record, sourceFilename); + copyElementType3(dataset, DCM_DoseComment, record, sourceFilename); + /* copy existing icon image (if present) */ + copyElementType3(dataset, DCM_IconImageSequence, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_RTDose, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_RTDose, "create"); + return record; +} + + +// create or update rt structure set record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildRTStructureSetRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new rt structure set record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_RTStructureSet, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to rt structure set record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_StructureSetLabel, record, sourceFilename); + copyElementType2(dataset, DCM_StructureSetDate, record, sourceFilename); + copyElementType2(dataset, DCM_StructureSetTime, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_RTStructureSet, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_RTStructureSet, "create"); + return record; +} + + +// create or update rt plan record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildRTPlanRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new rt plan record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_RTPlan, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to rt plan record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_RTPlanLabel, record, sourceFilename); + copyElementType2(dataset, DCM_RTPlanDate, record, sourceFilename); + copyElementType2(dataset, DCM_RTPlanTime, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_RTPlan, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_RTPlan, "create"); + return record; +} + + +// create or update rt treatment record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildRTTreatmentRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new rt treatment record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_RTTreatRecord, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to rt treatment record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType2(dataset, DCM_TreatmentDate, record, sourceFilename); + copyElementType2(dataset, DCM_TreatmentTime, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_RTTreatRecord, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_RTTreatRecord, "create"); + return record; +} + + +// create or update stored print record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildStoredPrintRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new stored print record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_StoredPrint, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to stored print record */ + copyElementType2(dataset, DCM_InstanceNumber, record, sourceFilename); + /* IconImageSequence (type 3) is not created for the referenced images */ + } else { + printRecordErrorMessage(record->error(), ERT_StoredPrint, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_StoredPrint, "create"); + return record; +} + + +// create or update key object doc record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildKeyObjectDocRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new key object doc record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_KeyObjectDoc, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to key object doc record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_ConceptNameCodeSequence, record, sourceFilename); + addConceptModContentItems(record, dataset); + } else { + printRecordErrorMessage(record->error(), ERT_KeyObjectDoc, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_KeyObjectDoc, "create"); + return record; +} + + +// create or update registration record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildRegistrationRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new registration record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Registration, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to registration record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Registration, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Registration, "create"); + return record; +} + + +// create or update fiducial record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildFiducialRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new fiducial record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Fiducial, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to fiducial record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Fiducial, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Fiducial, "create"); + return record; +} + + +// create or update raw data record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildRawDataRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new raw data record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_RawData, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to raw data record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType2(dataset, DCM_InstanceNumber, record, sourceFilename); + /* IconImageSequence (type 3) is not created for the raw data */ + } else { + printRecordErrorMessage(record->error(), ERT_RawData, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_RawData, "create"); + return record; +} + + +// create or update spectroscopy record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildSpectroscopyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new spectroscopy record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Spectroscopy, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to spectroscopy record */ + copyElementType1(dataset, DCM_ImageType, record, sourceFilename); + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1C(dataset, DCM_ReferencedImageEvidenceSequence, record, sourceFilename); + copyElementType1(dataset, DCM_NumberOfFrames, record, sourceFilename); + copyElementType1(dataset, DCM_Rows, record, sourceFilename); + copyElementType1(dataset, DCM_Columns, record, sourceFilename); + copyElementType1(dataset, DCM_DataPointRows, record, sourceFilename); + copyElementType1(dataset, DCM_DataPointColumns, record, sourceFilename); + /* IconImageSequence (type 3) is not created for the spectroscopy data */ + /* application profile specific attributes */ + if ((ApplicationProfile == AP_GeneralPurposeDVDJPEG) || + (ApplicationProfile == AP_GeneralPurposeDVDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG) || + (ApplicationProfile == AP_GeneralPurposeBDJPEG2000) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatML) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG2MPatHL) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV41BD) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_2D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4HPatLV42_3D) || + (ApplicationProfile == AP_GeneralPurposeBDMPEG4StereoHPatLV42) || + (ApplicationProfile == AP_USBandFlashJPEG) || + (ApplicationProfile == AP_USBandFlashJPEG2000)) + { + copyElementType1(dataset, DCM_Rows, record, sourceFilename); + copyElementType1(dataset, DCM_Columns, record, sourceFilename); + copyElementType1C(dataset, DCM_FrameOfReferenceUID, record, sourceFilename); + copyElementType1C(dataset, DCM_SynchronizationFrameOfReferenceUID, record, sourceFilename); + copyElementType1C(dataset, DCM_NumberOfFrames, record, sourceFilename); + copyElementType1C(dataset, DCM_AcquisitionTimeSynchronized, record, sourceFilename); + copyElementType1C(dataset, DCM_AcquisitionDateTime, record, sourceFilename); + // also need to examine functional groups for the following attributes + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_ReferencedImageSequence, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_ImagePositionPatient, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_ImageOrientationPatient, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_PixelSpacing, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + } + } else { + printRecordErrorMessage(record->error(), ERT_Spectroscopy, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Spectroscopy, "create"); + return record; +} + + +// create or update encap doc record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildEncapDocRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new encap doc record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_EncapDoc, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to encap doc record */ + copyElementType2(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType2(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType2(dataset, DCM_DocumentTitle, record, sourceFilename); + /* required if encapsulated document is an HL7 Structured Document */ + copyElementType1C(dataset, DCM_HL7InstanceIdentifier, record, sourceFilename); + /* baseline context group 7020 is not checked */ + copyElementType2(dataset, DCM_ConceptNameCodeSequence, record, sourceFilename); + copyElementType1(dataset, DCM_MIMETypeOfEncapsulatedDocument, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_EncapDoc, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_RawData, "create"); + return record; +} + + +// create or update value map record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildValueMapRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new value map record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_ValueMap, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to value map record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_ValueMap, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_ValueMap, "create"); + return record; +} + + +// create or update hanging protocol record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildHangingProtocolRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new hanging protocol record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_HangingProtocol, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + copyElementType1(dataset, DCM_HangingProtocolName, record, sourceFilename); + copyElementType1(dataset, DCM_HangingProtocolDescription, record, sourceFilename); + copyElementType1(dataset, DCM_HangingProtocolLevel, record, sourceFilename); + copyElementType1(dataset, DCM_HangingProtocolCreator, record, sourceFilename); + copyElementType1(dataset, DCM_HangingProtocolCreationDateTime, record, sourceFilename); + // open issue: shall we do further checks on the sequence content? + copyElementType1(dataset, DCM_HangingProtocolDefinitionSequence, record, sourceFilename); + copyElementType1(dataset, DCM_NumberOfPriorsReferenced, record, sourceFilename); + copyElementType2(dataset, DCM_HangingProtocolUserIdentificationCodeSequence, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_HangingProtocol, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + DCMDATA_ERROR("out of memory (creating patient record)"); + return record; +} + + +// create or update stereometric record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildStereometricRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new value map record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Stereometric, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + /* nothing to do */ + } else { + printRecordErrorMessage(record->error(), ERT_Stereometric, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Stereometric, "create"); + return record; +} + + +// create or update palette record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildPaletteRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new palette record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Palette, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to palette record */ + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Palette, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Palette, "create"); + return record; +} + + +// create or update surface record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildSurfaceRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new surface record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Surface, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to surface record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Surface, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Surface, "create"); + return record; +} + + +// create or update measurement record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildMeasurementRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new measurement record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Measurement, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to measurement record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Measurement, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Measurement, "create"); + return record; +} + + +// create or update implant record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildImplantRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new implant record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Implant, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to implant record */ + copyElementType1(dataset, DCM_Manufacturer, record, sourceFilename); + copyElementType1(dataset, DCM_ImplantName, record, sourceFilename); + copyElementType1C(dataset, DCM_ImplantSize, record, sourceFilename); + copyElementType1(dataset, DCM_ImplantPartNumber, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Implant, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Implant, "create"); + return record; +} + + +// create or update implant group record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildImplantGroupRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new implant group record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_ImplantGroup, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to implant group record */ + copyElementType1(dataset, DCM_ImplantAssemblyTemplateName, record, sourceFilename); + copyElementType1(dataset, DCM_ImplantAssemblyTemplateIssuer, record, sourceFilename); + copyElementType1(dataset, DCM_ProcedureTypeCodeSequence, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_ImplantGroup, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_ImplantGroup, "create"); + return record; +} + + +// create or update implant assy record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildImplantAssyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new implant assy record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_ImplantAssy, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to implant assy record */ + copyElementType1(dataset, DCM_ImplantTemplateGroupName, record, sourceFilename); + copyElementType3(dataset, DCM_ImplantTemplateGroupDescription, record, sourceFilename); + copyElementType1(dataset, DCM_ImplantTemplateGroupIssuer, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_ImplantAssy, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_ImplantAssy, "create"); + return record; +} + + +// create or update plan record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildPlanRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new plan record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Plan, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + /* nothing to do */ + } else { + printRecordErrorMessage(record->error(), ERT_Plan, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Plan, "create"); + return record; +} + + +// create or update surface scan record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildSurfaceScanRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new surface scan record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_SurfaceScan, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to surface scan record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_SurfaceScan, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_SurfaceScan, "create"); + return record; +} + + +// create or update tract record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildTractRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new surface record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Tract, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to tract record */ + copyElementType1(dataset, DCM_ContentDate, record, sourceFilename); + copyElementType1(dataset, DCM_ContentTime, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_ContentLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Tract, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Tract, "create"); + return record; +} + + +// create or update assessment record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildAssessmentRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new surface record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Assessment, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to assessment record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1(dataset, DCM_InstanceCreationDate, record, sourceFilename); + copyElementType2(dataset, DCM_InstanceCreationTime, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Assessment, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Assessment, "create"); + return record; +} + + +// create or update radiotherapy record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildRadiotherapyRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new surface record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Radiotherapy, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + /* copy attribute values from dataset to radiotherapy record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + copyElementType1C(dataset, DCM_UserContentLabel, record, sourceFilename); + copyElementType1C(dataset, DCM_UserContentLongLabel, record, sourceFilename); + copyElementType2(dataset, DCM_ContentDescription, record, sourceFilename); + copyElementType2(dataset, DCM_ContentCreatorName, record, sourceFilename); + } else { + printRecordErrorMessage(record->error(), ERT_Radiotherapy, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + printRecordErrorMessage(EC_MemoryExhausted, ERT_Radiotherapy, "create"); + return record; +} + + +// create or update image record and copy required values from dataset +DcmDirectoryRecord *DicomDirInterface::buildImageRecord(DcmDirectoryRecord *record, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + /* create new image record */ + if (record == NULL) + record = new DcmDirectoryRecord(ERT_Image, referencedFileID.c_str(), sourceFilename, fileformat); + if (record != NULL) + { + /* check whether new record is ok */ + if (record->error().good()) + { + DcmDataset *dataset = fileformat->getDataset(); + OFBool iconImage = IconImageMode; + unsigned int iconSize = (IconSize == 0) ? 64 : IconSize; + /* Icon Image Sequence required for particular profiles */ + OFBool iconRequired = OFFalse; + /* copy attribute values from dataset to image record */ + copyElementType1(dataset, DCM_InstanceNumber, record, sourceFilename); + /* application profile specific attributes */ + switch (ApplicationProfile) + { + case AP_GeneralPurpose: + copyElementType1C(dataset, DCM_ImageType, record, sourceFilename); + copyElementType1C(dataset, DCM_ReferencedImageSequence, record, sourceFilename); + break; + case AP_GeneralPurposeDVDJPEG: + case AP_GeneralPurposeDVDJPEG2000: + case AP_GeneralPurposeBDJPEG: + case AP_GeneralPurposeBDJPEG2000: + case AP_GeneralPurposeBDMPEG2MPatML: + case AP_GeneralPurposeBDMPEG2MPatHL: + case AP_GeneralPurposeBDMPEG4HPatLV41: + case AP_GeneralPurposeBDMPEG4HPatLV41BD: + case AP_GeneralPurposeBDMPEG4HPatLV42_2D: + case AP_GeneralPurposeBDMPEG4HPatLV42_3D: + case AP_GeneralPurposeBDMPEG4StereoHPatLV42: + case AP_USBandFlashJPEG: + case AP_USBandFlashJPEG2000: + copyElementType1(dataset, DCM_Rows, record, sourceFilename); + copyElementType1(dataset, DCM_Columns, record, sourceFilename); + copyElementType1C(dataset, DCM_ImageType, record, sourceFilename); + copyElementType1C(dataset, DCM_CalibrationImage, record, sourceFilename); + copyElementType1C(dataset, DCM_LossyImageCompressionRatio, record, sourceFilename); + copyElementType1C(dataset, DCM_FrameOfReferenceUID, record, sourceFilename); + copyElementType1C(dataset, DCM_SynchronizationFrameOfReferenceUID, record, sourceFilename); + copyElementType1C(dataset, DCM_NumberOfFrames, record, sourceFilename); + copyElementType1C(dataset, DCM_AcquisitionTimeSynchronized, record, sourceFilename); + copyElementType1C(dataset, DCM_AcquisitionDateTime, record, sourceFilename); + // also need to examine functional groups for the following attributes + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_ReferencedImageSequence, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_ImagePositionPatient, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_ImageOrientationPatient, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + copyElementType1CFromDatasetOrSequenceItem(dataset, DCM_PixelSpacing, DCM_SharedFunctionalGroupsSequence, record, sourceFilename); + break; + case AP_MPEG2MPatMLDVD: + copyElementType1(dataset, DCM_Rows, record, sourceFilename); + copyElementType1(dataset, DCM_Columns, record, sourceFilename); + copyElementType1C(dataset, DCM_ImageType, record, sourceFilename); + copyElementType1C(dataset, DCM_LossyImageCompressionRatio, record, sourceFilename); + break; + case AP_XrayAngiographic: + case AP_XrayAngiographicDVD: + copyElementType1C(dataset, DCM_LossyImageCompressionRatio, record, sourceFilename); + case AP_BasicCardiac: + { + OFString tmpString; + OFBool xaImage = compare(getStringFromDataset(dataset, DCM_SOPClassUID, tmpString), UID_XRayAngiographicImageStorage); + if (xaImage) + { + /* type 1C: required for XA images (type 1 for Basic Cardiac Profile) */ + copyElementType1(dataset, DCM_ImageType, record, sourceFilename); + /* type 1C: required if ImageType value 3 is "BIPLANE A" or "BIPLANE B" */ + getStringComponentFromDataset(dataset, DCM_ImageType, tmpString, 2); + if (compare(tmpString, "BIPLANE A") || compare(tmpString, "BIPLANE B")) + copyElementType1(dataset, DCM_ReferencedImageSequence, record, sourceFilename); + } + /* additional type 2 keys specified by specific profiles (type 3 in image IOD) */ + copyStringWithDefault(dataset, DCM_CalibrationImage, record, sourceFilename); + /* icon images */ + iconImage = OFTrue; + iconRequired = OFTrue; + iconSize = 128; + } + break; + case AP_CTandMR: + copyElementType1(dataset, DCM_Rows, record, sourceFilename); + copyElementType1(dataset, DCM_Columns, record, sourceFilename); + copyElementType1C(dataset, DCM_ReferencedImageSequence, record, sourceFilename); + copyElementType1C(dataset, DCM_ImagePositionPatient, record, sourceFilename); + copyElementType1C(dataset, DCM_ImageOrientationPatient, record, sourceFilename); + copyElementType1C(dataset, DCM_FrameOfReferenceUID, record, sourceFilename); + copyElementType1C(dataset, DCM_PixelSpacing, record, sourceFilename); + /* icon images */ + iconImage = OFTrue; + iconSize = 64; + break; + default: + /* no additional keys */ + break; + } + /* create icon images */ + if (iconImage) + { + OFCondition status = addIconImage(record, dataset, iconSize, sourceFilename); + if (status.bad()) + { + /* report error or warning */ + if (iconRequired) + DCMDATA_ERROR("cannot create IconImageSequence"); + else + DCMDATA_WARN("cannot create IconImageSequence"); + } + } + } else { + printRecordErrorMessage(record->error(), ERT_Series, "create"); + /* free memory */ + delete record; + record = NULL; + } + } else + DCMDATA_ERROR("out of memory (creating image record)"); + return record; +} + + +// create icon image from PGM file +OFBool DicomDirInterface::getIconFromFile(const OFFilename &filename, + Uint8 *pixel, + const unsigned long count, + const unsigned int width, + const unsigned int height) +{ + OFBool result = OFFalse; + /* check buffer and size */ + if (!filename.isEmpty() && (pixel != NULL) && (count >= width * height)) + { + /* open specified file */ + OFFile file; + if (file.fopen(filename, "rb")) + { + /* according to the pgm format no line should be longer than 70 characters */ + const int maxline = 256; + char line[maxline]; + /* read magic number */ + if ((file.fgets(line, maxline) != NULL) && (strcmp(line, "P5\n") == 0)) + { + OFBool corrupt = OFTrue; + if ((file.fgets(line, maxline) != NULL) && (line[0] != '\0')) + { + unsigned int pgmWidth, pgmHeight = 0; + /* skip optional comment line and get width and height */ + if (((*line != '#') || (file.fgets(line, maxline) != NULL)) && + (sscanf(line, "%u %u", &pgmWidth, &pgmHeight) > 0) && (pgmWidth > 0) && (pgmHeight > 0)) + { + unsigned int pgmMax = 0; + /* get maximum gray value */ + if ((file.fgets(line, maxline) != NULL) && (sscanf(line, "%u", &pgmMax) > 0) && (pgmMax == 255)) + { + const unsigned long pgmSize = pgmWidth * pgmHeight; + Uint8 *pgmData = new Uint8[pgmSize]; + if (pgmData != NULL) + { + /* get pgm image data */ + if (file.fread(pgmData, sizeof(Uint8), OFstatic_cast(size_t, pgmSize)) == pgmSize) + { + /* if already scaled, just copy the bitmap */ + if ((width == pgmWidth) && (height == pgmHeight) && (count == pgmSize)) + { + OFBitmanipTemplate::copyMem(pgmData, pixel, count); + result = OFTrue; + } + else if (ImagePlugin != NULL) + { + /* scale image to requested size */ + result = ImagePlugin->scaleData(pgmData, pgmWidth, pgmHeight, pixel, width, height); + } + if (!result) + DCMDATA_ERROR("cannot scale external icon, no image support available"); + corrupt = OFFalse; + } + /* free memory */ + delete[] pgmData; + } else { + DCMDATA_ERROR(OFCondition(EC_MemoryExhausted).text() << ": cannot allocate memory for pgm pixel data"); + /* avoid double reporting of error message */ + corrupt = OFFalse; + } + } + } + } + if (corrupt) + DCMDATA_ERROR("corrupt file format for external icon (not pgm binary)"); + } else + DCMDATA_ERROR("wrong file format for external icon (pgm required)"); + } else + DCMDATA_ERROR("cannot open file for external icon: " << filename); + } + return result; +} + + +// create icon image from DICOM dataset +OFBool DicomDirInterface::getIconFromDataset(DcmItem *dataset, + Uint8 *pixel, + const unsigned long count, + const unsigned int width, + const unsigned int height) +{ + OFBool result = OFFalse; + /* check parameters (incl. availability of image plugin) */ + if ((ImagePlugin != NULL) && (dataset != NULL) && (pixel != NULL) && (count >= width * height)) + { + /* choose representative frame */ + long fCount, frame; + dataset->findAndGetLongInt(DCM_NumberOfFrames, fCount); + dataset->findAndGetLongInt(DCM_RepresentativeFrameNumber, frame); + if (fCount <= 0) + fCount = 1; + if (frame <= 0) + { + if (fCount > 3) + frame = fCount / 3; // recommended in PS3.11 + else + frame = 1; + } else if (frame > fCount) + frame = fCount; + /* scale image (if required) and retrieve pixel data from dataset */ + result = ImagePlugin->scaleImage(dataset, pixel, count, OFstatic_cast(unsigned long, frame), + width, height, (fCount == 1) /*decompressAll*/); + } + return result; +} + + +// add icon image sequence to record +OFCondition DicomDirInterface::addIconImage(DcmDirectoryRecord *record, + DcmItem *dataset, + const unsigned int size, + const OFFilename &sourceFilename) +{ + OFCondition result = EC_IllegalParameter; + /* check parameters first */ + if ((record != NULL) && (dataset != NULL)) + { + DcmItem *ditem = NULL; + /* create icon image sequence with one item */ + result = record->findOrCreateSequenceItem(DCM_IconImageSequence, ditem); + if (result.good()) + { + const unsigned int width = size; + const unsigned int height = size; + const unsigned long count = width * height; + /* Image Pixel Module */ + ditem->putAndInsertUint16(DCM_SamplesPerPixel, 1); + ditem->putAndInsertString(DCM_PhotometricInterpretation, "MONOCHROME2"); + ditem->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, height)); + ditem->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, width)); + ditem->putAndInsertUint16(DCM_BitsAllocated, 8); + ditem->putAndInsertUint16(DCM_BitsStored, 8); + ditem->putAndInsertUint16(DCM_HighBit, 7); + ditem->putAndInsertUint16(DCM_PixelRepresentation, 0); + /* Pixel Data */ + Uint8 *pixel = new Uint8[count]; + if (pixel != NULL) + { + OFBool iconOk = OFFalse; + /* prefix for external icons specified? */ + if (!IconPrefix.isEmpty()) + { + /* try to load external pgm icon */ + OFFilename filename; + OFStandard::appendFilenameExtension(filename, IconPrefix, sourceFilename); + iconOk = getIconFromFile(filename, pixel, count, width, height); + } else { + /* try to create icon from dataset */ + iconOk = getIconFromDataset(dataset, pixel, count, width, height); + if (!iconOk) + DCMDATA_WARN("cannot create monochrome icon from image file, using default"); + } + /* could not create icon so far: use default icon (if specified) */ + if (!iconOk && !DefaultIcon.isEmpty()) + iconOk = getIconFromFile(DefaultIcon, pixel, count, width, height); + /* default not available: use black image */ + if (!iconOk) + OFBitmanipTemplate::zeroMem(pixel, count); + /* create Pixel Data element and set pixel data */ + result = ditem->putAndInsertUint8Array(DCM_PixelData, pixel, count); + /* free pixel data after it has been copied */ + delete[] pixel; + } else + result = EC_MemoryExhausted; + /* remove entire icon image sequence in case of error */ + if (result.bad()) + record->findAndDeleteElement(DCM_IconImageSequence); + } + } + return result; +} + + +// add child record to a given parent record +DcmDirectoryRecord *DicomDirInterface::addRecord(DcmDirectoryRecord *parent, + const E_DirRecType recordType, + DcmFileFormat *fileformat, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + DcmDirectoryRecord *record = NULL; + DcmDataset *dataset = fileformat->getDataset(); + if (parent != NULL) + { + /* check whether record already exists */ + DcmDirectoryRecord *oldRecord = record = findExistingRecord(parent, recordType, dataset); + if ((record == NULL) || FilesetUpdateMode) + { + /* in case an existing record is updated */ + if (record != NULL) + { + /* perform some consistency checks for instance records */ + if ((recordType != ERT_Patient) && (recordType != ERT_Study) && (recordType != ERT_Series)) + { + if (!checkReferencedSOPInstance(record, dataset, referencedFileID, sourceFilename)) + return NULL; + } + } + /* create a new one or update existing record */ + switch (recordType) + { + case ERT_Patient: + record = buildPatientRecord(record, fileformat, sourceFilename); + break; + case ERT_Study: + record = buildStudyRecord(record, fileformat, sourceFilename); + break; + case ERT_Series: + record = buildSeriesRecord(record, fileformat, sourceFilename); + break; + case ERT_Overlay: + record = buildOverlayRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_ModalityLut: + record = buildModalityLutRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_VoiLut: + record = buildVoiLutRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Curve: + record = buildCurveRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_SRDocument: + record = buildStructReportRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Presentation: + record = buildPresentationRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Waveform: + record = buildWaveformRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_RTDose: + record = buildRTDoseRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_RTStructureSet: + record = buildRTStructureSetRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_RTPlan: + record = buildRTPlanRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_RTTreatRecord: + record = buildRTTreatmentRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_StoredPrint: + record = buildStoredPrintRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_KeyObjectDoc: + record = buildKeyObjectDocRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Registration: + record = buildRegistrationRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Fiducial: + record = buildFiducialRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_RawData: + record = buildRawDataRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Spectroscopy: + record = buildSpectroscopyRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_EncapDoc: + record = buildEncapDocRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_ValueMap: + record = buildValueMapRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_HangingProtocol: + record = buildHangingProtocolRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Stereometric: + record = buildStereometricRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Palette: + record = buildPaletteRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Surface: + record = buildSurfaceRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Measurement: + record = buildMeasurementRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Implant: + record = buildImplantRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_ImplantGroup: + record = buildImplantGroupRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_ImplantAssy: + record = buildImplantAssyRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Plan: + record = buildPlanRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_SurfaceScan: + record = buildSurfaceScanRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Tract: + record = buildTractRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Assessment: + record = buildAssessmentRecord(record, fileformat, referencedFileID, sourceFilename); + break; + case ERT_Radiotherapy: + record = buildRadiotherapyRecord(record, fileformat, referencedFileID, sourceFilename); + break; + default: + /* it can only be an image */ + record = buildImageRecord(record, fileformat, referencedFileID, sourceFilename); + } + if (record != NULL) + { + /* type 1C: required if an extended character set is used in one of the record keys */ + if (record->isAffectedBySpecificCharacterSet()) + copyElementType1C(dataset, DCM_SpecificCharacterSet, record, sourceFilename); + /* in case a new record has been created */ + if (record != oldRecord) + { + /* insert it below parent record */ + OFCondition status = insertSortedUnder(parent, record); + if (status.bad()) + { + printRecordErrorMessage(status, recordType, "insert"); + /* free memory */ + delete record; + record = NULL; + } + } + } + } else { + /* instance record is already referenced by the DICOMDIR */ + if ((recordType != ERT_Patient) && (recordType != ERT_Study) && (recordType != ERT_Series)) + { + /* create warning message */ + DCMDATA_WARN("file " << sourceFilename << ": directory record for this SOP instance already exists"); + } + /* perform consistency check */ + if (ConsistencyCheck) + { + /* abort on any inconsistency */ + if (warnAboutInconsistentAttributes(record, dataset, sourceFilename, AbortMode) && AbortMode) + return NULL; + } + } + if (record != NULL) + { + /* check whether instance is already listed */ + if (record->getRecordsOriginFile().isEmpty()) + record->setRecordsOriginFile(sourceFilename); + } + } + return record; +} + + +// check referenced SOP instance for consistency with a new directory record +OFBool DicomDirInterface::checkReferencedSOPInstance(DcmDirectoryRecord *record, + DcmItem *dataset, + const OFString &referencedFileID, + const OFFilename &sourceFilename) +{ + OFBool result = OFTrue; + if ((record != NULL) && (dataset != NULL)) + { + OFString refFileID; + /* check referenced file ID */ + if (record->findAndGetOFStringArray(DCM_ReferencedFileID, refFileID).good() && + !compare(refFileID, referencedFileID)) + { + /* create error message */ + DCMDATA_ERROR("file " << sourceFilename << ": SOP instance already referenced " + << "with different file ID (" << refFileID << ")"); + result = OFFalse; + } + /* check SOP class UID */ + if (!compareStringAttributes(dataset, DCM_SOPClassUID, record, DCM_ReferencedSOPClassUIDInFile, sourceFilename, OFTrue /*errorMsg*/)) + result = OFFalse; + } + return result; +} + + +// invent missing attributes on root level (and below) +void DicomDirInterface::inventMissingAttributes(DcmDirectoryRecord *parent, + const OFBool recurse) +{ + if (parent != NULL) + { + DcmDirectoryRecord *record = NULL; + /* iterate over all child records */ + while ((record = parent->nextSub(record)) != NULL) + { + /* only check patient records */ + if (record->getRecordType() == ERT_Patient) + { + if (!record->tagExistsWithValue(DCM_PatientID)) + setDefaultValue(record, DCM_PatientID, AutoPatientNumber++, AUTO_PATIENTID_PREFIX); + if (recurse) + inventMissingStudyLevelAttributes(record); + } + } + } +} + + +// invent missing attributes on study level (and below) +void DicomDirInterface::inventMissingStudyLevelAttributes(DcmDirectoryRecord *parent) +{ + if (parent != NULL) + { + DcmDirectoryRecord *record = NULL; + /* iterate over all child records */ + while ((record = parent->nextSub(record)) != NULL) + { + if (!record->tagExistsWithValue(DCM_StudyID)) + setDefaultValue(record, DCM_StudyID, AutoStudyNumber++, AUTO_STUDYID_PREFIX); + inventMissingSeriesLevelAttributes(record); + } + } +} + + +// invent missing attributes on series level (and below) +void DicomDirInterface::inventMissingSeriesLevelAttributes(DcmDirectoryRecord *parent) +{ + if (parent != NULL) + { + DcmDirectoryRecord *record = NULL; + /* iterate over all child records */ + while ((record = parent->nextSub(record)) != NULL) + { + if (!record->tagExistsWithValue(DCM_SeriesNumber)) + setDefaultValue(record, DCM_SeriesNumber, AutoSeriesNumber++); + inventMissingInstanceLevelAttributes(record); + } + } +} + + +// invent missing attributes on instance level (and below) +void DicomDirInterface::inventMissingInstanceLevelAttributes(DcmDirectoryRecord *parent) +{ + if (parent != NULL) + { + DcmDirectoryRecord *record = NULL; + /* iterate over all child records */ + while ((record = parent->nextSub(record)) != NULL) + { + switch (record->getRecordType()) + { + case ERT_Image: + case ERT_RTDose: + case ERT_RTStructureSet: + case ERT_RTPlan: + case ERT_StoredPrint: + case ERT_Surface: + if (!record->tagExistsWithValue(DCM_InstanceNumber)) + setDefaultValue(record, DCM_InstanceNumber, AutoInstanceNumber++); + break; + case ERT_Overlay: + if (!record->tagExistsWithValue(DCM_RETIRED_OverlayNumber)) + setDefaultValue(record, DCM_RETIRED_OverlayNumber, AutoOverlayNumber++); + break; + case ERT_ModalityLut: + case ERT_VoiLut: + if (!record->tagExistsWithValue(DCM_RETIRED_LUTNumber)) + setDefaultValue(record, DCM_RETIRED_LUTNumber, AutoLutNumber++); + break; + case ERT_Curve: + if (!record->tagExistsWithValue(DCM_RETIRED_CurveNumber)) + setDefaultValue(record, DCM_RETIRED_CurveNumber, AutoCurveNumber++); + break; + case ERT_SRDocument: + case ERT_Presentation: + case ERT_Waveform: + case ERT_RTTreatRecord: + case ERT_KeyObjectDoc: + case ERT_Registration: + case ERT_Fiducial: + case ERT_RawData: + case ERT_Spectroscopy: + case ERT_EncapDoc: + case ERT_ValueMap: + case ERT_Stereometric: + case ERT_Measurement: + case ERT_Plan: + case ERT_SurfaceScan: + case ERT_Tract: + case ERT_Assessment: + /* nothing to do */ + break; + default: + /* should never happen */ + break; + } + } + } +} + + +// add DICOM file to the current DICOMDIR object +OFCondition DicomDirInterface::addDicomFile(const OFFilename &filename, + const OFFilename &directory) +{ + OFCondition result = EC_IllegalParameter; + /* first, make sure that a DICOMDIR object exists */ + if (DicomDir != NULL) + { + /* create fully qualified pathname of the DICOM file to be added */ + OFFilename pathname; + OFStandard::combineDirAndFilename(pathname, directory, filename, OFTrue /*allowEmptyDirName*/); + /* then check the file name, load the file and check the content */ + DcmFileFormat fileformat; + result = loadAndCheckDicomFile(filename, directory, fileformat, OFTrue /*checkFilename*/); + if (result.good()) + { + DCMDATA_INFO("adding file: " << pathname); + /* start creating the DICOMDIR directory structure */ + DcmDirectoryRecord *rootRecord = &(DicomDir->getRootRecord()); + DcmMetaInfo *metainfo = fileformat.getMetaInfo(); + /* massage filename into DICOM format (DOS conventions for path separators, uppercase) */ + OFString fileID; + hostToDicomFilename(OFSTRING_GUARD(filename.getCharPointer()), fileID); + /* what kind of object (SOP Class) is stored in the file */ + OFString sopClass; + metainfo->findAndGetOFString(DCM_MediaStorageSOPClassUID, sopClass); + /* if hanging protocol, palette or implant file then attach it to the root record and stop */ + if (compare(sopClass, UID_HangingProtocolStorage)) + { + /* add a hanging protocol record below the root */ + if (addRecord(rootRecord, ERT_HangingProtocol, &fileformat, fileID, pathname) == NULL) + result = EC_CorruptedData; + } + else if (compare(sopClass, UID_ColorPaletteStorage)) + { + /* add a palette record below the root */ + if (addRecord(rootRecord, ERT_Palette, &fileformat, fileID, pathname) == NULL) + result = EC_CorruptedData; + } + else if (compare(sopClass, UID_GenericImplantTemplateStorage)) + { + /* add an implant record below the root */ + if (addRecord(rootRecord, ERT_Implant, &fileformat, fileID, pathname) == NULL) + result = EC_CorruptedData; + } + else if (compare(sopClass, UID_ImplantAssemblyTemplateStorage)) + { + /* add an implant group record below the root */ + if (addRecord(rootRecord, ERT_ImplantGroup, &fileformat, fileID, pathname) == NULL) + result = EC_CorruptedData; + } + else if (compare(sopClass, UID_ImplantTemplateGroupStorage)) + { + /* add an implant assy record below the root */ + if (addRecord(rootRecord, ERT_ImplantAssy, &fileformat, fileID, pathname) == NULL) + result = EC_CorruptedData; + } else { + /* add a patient record below the root */ + DcmDirectoryRecord *patientRecord = addRecord(rootRecord, ERT_Patient, &fileformat, fileID, pathname); + if (patientRecord != NULL) + { + /* if patient management file then attach it to patient record and stop */ + if (compare(sopClass, UID_RETIRED_DetachedPatientManagementMetaSOPClass)) + { + result = patientRecord->assignToSOPFile(fileID.c_str(), pathname); + DCMDATA_ERROR(result.text() << ": cannot assign patient record to file: " << pathname); + } else { + /* add a study record below the current patient record */ + DcmDirectoryRecord *studyRecord = addRecord(patientRecord, ERT_Study, &fileformat, fileID, pathname);; + if (studyRecord != NULL) + { + /* add a series record below the current study record */ + DcmDirectoryRecord *seriesRecord = addRecord(studyRecord, ERT_Series, &fileformat, fileID, pathname);; + if (seriesRecord != NULL) + { + /* add one of the instance record below the current series record */ + if (addRecord(seriesRecord, sopClassToRecordType(sopClass), &fileformat, fileID, pathname) == NULL) + result = EC_CorruptedData; + } else + result = EC_CorruptedData; + } else + result = EC_CorruptedData; + } + } else + result = EC_CorruptedData; + /* invent missing attributes on all levels or PatientID only */ + if (InventMode) + inventMissingAttributes(rootRecord); + else if (InventPatientIDMode) + inventMissingAttributes(rootRecord, OFFalse /*recurse*/); + } + } + } + return result; +} + + +// set the file-set descriptor and character set +OFCondition DicomDirInterface::setFilesetDescriptor(const char *filename, + const char *charset) +{ + OFCondition result = EC_IllegalCall; + if (DicomDir != NULL) + { + /* check filename and character set */ + if (isFilenameValid(filename, OFTrue /*allowEmpty*/) && isCharsetValid(charset)) + { + /* get dataset of the current DICOMDIR */ + DcmDataset *dataset = DicomDir->getDirFileFormat().getDataset(); + if (dataset != NULL) + { + /* set FileSetDescriptorFileID */ + if ((filename == NULL) || (filename[0] == '\0')) + { + /* remove attribute from the dataset */ + dataset->findAndDeleteElement(DCM_FileSetDescriptorFileID); + dataset->findAndDeleteElement(DCM_SpecificCharacterSetOfFileSetDescriptorFile); + result = EC_Normal; + } else { + /* massage filename into DICOM format (DOS conventions for path separators, uppercase) */ + OFString fileID; + hostToDicomFilename(filename, fileID); + /* replace attribute value */ + result = dataset->putAndInsertString(DCM_FileSetDescriptorFileID, fileID.c_str()); + if (result.good()) + { + /* set SpecificCharacterSetOfFileSetDescriptorFile */ + if ((charset == NULL) || (charset[0] == '\0')) + { + /* remove attribute from the dataset */ + dataset->findAndDeleteElement(DCM_SpecificCharacterSetOfFileSetDescriptorFile); + result = EC_Normal; + } else { + /* replace attribute value */ + result = dataset->putAndInsertString(DCM_SpecificCharacterSetOfFileSetDescriptorFile, charset); + } + } + } + } + } else + result = EC_IllegalParameter; + // tbd: check whether file exists? + } + return result; +} + + +// set size of icon images (width and height in pixels) +OFCondition DicomDirInterface::setIconSize(const unsigned int size) +{ + OFCondition result = EC_IllegalParameter; + /* check valid range */ + if ((size > 0) && (size <= 256)) + { + IconSize = size; + result = EC_Normal; + } + return result; +} + + +// set filename prefix for icon images (if not retrieved from DICOM image) +OFCondition DicomDirInterface::setIconPrefix(const OFFilename &prefix) +{ + IconPrefix = prefix; + return EC_Normal; +} + + +// set filename for default image icon which is used in case of error +OFCondition DicomDirInterface::setDefaultIcon(const OFFilename &filename) +{ + DefaultIcon = filename; + return EC_Normal; +} + + +// enable/disable the abort mode, i.e. abort on first inconsistent file (otherwise warn) +OFBool DicomDirInterface::enableAbortMode(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = AbortMode; + /* set new mode */ + AbortMode = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable filename mapping mode, i.e. whether non-conforming filename are adjusted automatically +OFBool DicomDirInterface::enableMapFilenamesMode(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = MapFilenamesMode; + /* set new mode */ + MapFilenamesMode = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable invent mode, i.e. whether missing attribute values are invented +OFBool DicomDirInterface::enableInventMode(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = InventMode; + /* set new mode */ + InventMode = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable invent patient ID mode, i.e. whether missing patient ID is invented +OFBool DicomDirInterface::enableInventPatientIDMode(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = InventPatientIDMode; + /* set new mode */ + InventPatientIDMode = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable retired SOP class support, i.e. whether retired SOP classes are supported +OFBool DicomDirInterface::enableRetiredSOPClassSupport(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = RetiredSOPClassSupport; + /* set new mode */ + RetiredSOPClassSupport = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable icon image mode, i.e. whether to create icon images +OFBool DicomDirInterface::enableIconImageMode(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = IconImageMode; + /* set new mode */ + IconImageMode = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable the backup mode, i.e. whether to create a backup of the DICOMDIR +OFBool DicomDirInterface::disableBackupMode(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = BackupMode; + /* set new mode */ + BackupMode = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable pixel encoding check, i.e. whether the pixel encoding is checked +// for particular application profiles +OFBool DicomDirInterface::disableEncodingCheck(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = EncodingCheck; + /* set new mode */ + EncodingCheck = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable resolution check, i.e. whether the spatial resolution is checked +// for particular application profiles +OFBool DicomDirInterface::disableResolutionCheck(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = ResolutionCheck; + /* set new mode */ + ResolutionCheck = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable transfer syntax check, i.e. whether the transfer syntax is checked +// for particular application profiles +OFBool DicomDirInterface::disableTransferSyntaxCheck(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = TransferSyntaxCheck; + /* set new mode */ + TransferSyntaxCheck = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable DICOM file format check, i.e. whether the file is checked for the +// presence of the file meta information (according to DICOM part 10) +OFBool DicomDirInterface::disableFileFormatCheck(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = FileFormatCheck; + /* set new mode */ + FileFormatCheck = newMode; + /* return old mode */ + return oldMode; +} + + +// enable/disable consistency check, i.e. whether the file is checked for consistency +// with the directory record +OFBool DicomDirInterface::disableConsistencyCheck(const OFBool newMode) +{ + /* save current mode */ + OFBool oldMode = ConsistencyCheck; + /* set new mode */ + ConsistencyCheck = newMode; + /* return old mode */ + return oldMode; +} + + +// add support for DicomImage class(es) - required for icon images +OFBool DicomDirInterface::addImageSupport(DicomDirImagePlugin *plugin) +{ + // store pointer to plugin + ImagePlugin = plugin; + return (ImagePlugin != NULL); +} + + +// print an error message to the console (stderr) that the value of the given tag is unexpected +void DicomDirInterface::printUnexpectedValueMessage(const DcmTagKey &key, + const OFFilename &filename, + const OFBool errorMsg) +{ + OFString str; + if (!filename.isEmpty()) + { + str = " in file: "; + str += OFSTRING_GUARD(filename.getCharPointer()); + } + if (errorMsg) + { + DCMDATA_ERROR("attribute " << DcmTag(key).getTagName() << " " << key + << " has other value than expected" << str); + } else { + DCMDATA_WARN("attribute " << DcmTag(key).getTagName() << " " << key + << " has other value than expected" << str); + } +} + + +// print an error message to the console (stderr) that a required attribute is missing/empty +void DicomDirInterface::printRequiredAttributeMessage(const DcmTagKey &key, + const OFFilename &filename, + const OFBool emptyMsg) +{ + OFString str; + if (!filename.isEmpty()) + { + str = " in file: "; + str += OFSTRING_GUARD(filename.getCharPointer()); + } + DCMDATA_ERROR("required attribute " << DcmTag(key).getTagName() << " " << key << " " + << (emptyMsg ? "empty" : "missing") << str); +} + + +// print an error message to the console (stderr) that something went wrong with an attribute +void DicomDirInterface::printAttributeErrorMessage(const DcmTagKey &key, + const OFCondition &error, + const char *operation) +{ + if (error.bad()) + { + OFString str; + if (operation != NULL) + { + str = "cannot "; + str += operation; + str += " "; + } + DCMDATA_ERROR(error.text() << ": " << str << DcmTag(key).getTagName() << " " << key); + } +} + + +// print an error message to the console (stderr) that something went wrong with a given record +void DicomDirInterface::printRecordErrorMessage(const OFCondition &error, + const E_DirRecType recordType, + const char *operation) +{ + if (error.bad()) + { + OFString str; + if (operation != NULL) + { + str = "cannot "; + str += operation; + str += " "; + } + DCMDATA_ERROR(error.text() << ": " << str << recordTypeToName(recordType) << " directory record"); + } +} + + +// return the name of the specified application profile +const char *DicomDirInterface::getProfileName(const E_ApplicationProfile profile) +{ + const char *result = ""; + switch(profile) + { + case AP_GeneralPurpose: + result = "STD-GEN-CD/DVD-RAM"; + break; + case AP_GeneralPurposeDVDJPEG: + result = "STD-GEN-DVD-JPEG"; + break; + case AP_GeneralPurposeDVDJPEG2000: + result = "STD-GEN-DVD-J2K"; + break; + case AP_GeneralPurposeBDJPEG: + result = "STD-GEN-BD-JPEG"; + break; + case AP_GeneralPurposeBDJPEG2000: + result = "STD-GEN-BD-J2K"; + break; + case AP_GeneralPurposeBDMPEG2MPatML: + result = "STD-GEN-BD-MPEG2-MPML"; + break; + case AP_GeneralPurposeBDMPEG2MPatHL: + result = "STD-GEN-BD-MPEG2-MPHL"; + break; + case AP_GeneralPurposeBDMPEG4HPatLV41: + result = "STD-GEN-BD-MPEG4-HPLV41"; + break; + case AP_GeneralPurposeBDMPEG4HPatLV41BD: + result = "STD-GEN-BD-MPEG4-HPLV41BD"; + break; + case AP_GeneralPurposeBDMPEG4HPatLV42_2D: + result = "STD-GEN-BD-MPEG4-HPLV42-2D"; + break; + case AP_GeneralPurposeBDMPEG4HPatLV42_3D: + result = "STD-GEN-BD-MPEG4-HPLV42-3D"; + break; + case AP_GeneralPurposeBDMPEG4StereoHPatLV42: + result = "STD-GEN-BD-MPEG4-SHPLV42"; + break; + case AP_USBandFlashJPEG: + result = "STD-GEN-USB/MMC/CF/SD-JPEG"; + break; + case AP_USBandFlashJPEG2000: + result = "STD-GEN-USB/MMC/CF/SD-J2K"; + break; + case AP_GeneralPurposeMIME: + result = "STD-GEN-MIME"; + break; + case AP_MPEG2MPatMLDVD: + result = "STD-DVD-MPEG2-MPML"; + break; + case AP_BasicCardiac: + result = "STD-XABC-CD"; + break; + case AP_XrayAngiographic: + result = "STD-XA1K-CD"; + break; + case AP_XrayAngiographicDVD: + result = "STD-XA1K-DVD"; + break; + case AP_DentalRadiograph: + result = "STD-DEN-CD"; + break; + case AP_CTandMR: + result = "STD-CTMR-xxxx"; + break; + case AP_UltrasoundIDSF: + result = "STD-US-ID-SF-xxxx"; + break; + case AP_UltrasoundSCSF: + result = "STD-US-SC-SF-xxxx"; + break; + case AP_UltrasoundCCSF: + result = "STD-US-CC-SF-xxxx"; + break; + case AP_UltrasoundIDMF: + result = "STD-US-ID-MF-xxxx"; + break; + case AP_UltrasoundSCMF: + result = "STD-US-SC-MF-xxxx"; + break; + case AP_UltrasoundCCMF: + result = "STD-US-CC-MF-xxxx"; + break; + case AP_TwelveLeadECG: + result = "STD-WVFM-ECG-FD"; + break; + case AP_HemodynamicWaveform: + result = "STD-WVFM-HD-FD"; + break; + } + return result; +} + + +// copy contents of specified file +OFBool DicomDirInterface::copyFile(const OFFilename &fromFilename, + const OFFilename &toFilename) +{ + OFBool result = OFStandard::copyFile(fromFilename, toFilename); + /* check for errors */ + if (!result) + { + /* create error message from error code */ + DCMDATA_ERROR("copying files: " << fromFilename << " to " << toFilename + << ": " << OFStandard::getLastSystemErrorCode().message()); + } + return result; +} + + +// see if all the attributes in record match the values in dataset +OFBool DicomDirInterface::warnAboutInconsistentAttributes(DcmDirectoryRecord *record, + DcmItem *dataset, + const OFFilename &sourceFilename, + const OFBool abortCheck) +{ + OFBool result = OFFalse; + /* check parameters first */ + if ((record != NULL) && (dataset != NULL)) + { + result = OFTrue; // default: no inconsistency + DcmTagKey tag; + DcmStack stack; + OFBool first = OFTrue; + DcmElement *delem = NULL; + /* iterate over all record elements */ + while (record->nextObject(stack, first).good() && (result || !abortCheck)) + { + delem = OFstatic_cast(DcmElement *, stack.top()); + if ((delem != NULL) && (delem->getLength() > 0)) + { + /* record attribute has a value */ + tag = delem->getTag().getXTag(); + if (dataset->tagExistsWithValue(tag)) + { + if (delem->getTag().getEVR() == EVR_SQ) + { + /* do not check particular sequences (because they will always deviate) */ + if ((delem->getTag() != DCM_ContentSequence) && (delem->getTag() != DCM_BlendingSequence)) + result &= compareSequenceAttributes(dataset, tag, record, sourceFilename); + } else { + /* everything else can be compared as a string */ + result &= compareStringAttributes(dataset, tag, record, tag, sourceFilename); + } + } + } + first = OFFalse; + } + } + if (!result && abortCheck) + DCMDATA_ERROR("aborting on first inconsistent file: " << sourceFilename); + /* return OFTrue in case of any inconsistency */ + return !result; +} + + +// check whether given file-set ID is valid +OFBool DicomDirInterface::checkFilesetID(const OFString &filesetID) +{ + OFBool result = OFTrue; + if (!filesetID.empty()) + { + size_t invalidChar = 0; + /* are the characters ok? */ + if (!DcmCodeString::checkVR(filesetID, &invalidChar, OFFalse /*checkLength*/)) + { + /* create error message */ + DCMDATA_ERROR("invalid character(s) in file-set ID: " << filesetID << OFendl + << OFString(37 /*message*/ + invalidChar, ' ') << "^"); + result = OFFalse; + } + /* ensure that file-set ID is not too large */ + if (isComponentTooLarge(filesetID, OFstatic_cast(size_t, DcmVR(EVR_CS).getMaxValueLength()), MapFilenamesMode)) + { + DCMDATA_ERROR("file-set ID too large: " << filesetID); + result = OFFalse; + } + } + return result; +} + + +// check whether specified tag exists in the dataset +OFBool DicomDirInterface::checkExists(DcmItem *dataset, + const DcmTagKey &key, + const OFFilename &filename) +{ + /* check whether tag exists */ + OFBool result = OFFalse; + if (dataset != NULL) + { + result = dataset->tagExists(key); + if (!result && !filename.isEmpty()) + { + /* report an error */ + printRequiredAttributeMessage(key, filename); + } + } + return result; +} + + +// check whether specified tag exists with a value in the dataset +OFBool DicomDirInterface::checkExistsWithValue(DcmItem *dataset, + const DcmTagKey &key, + const OFFilename &filename) +{ + /* first, check whether tag exists, and report an error if not */ + OFBool result = checkExists(dataset, key, filename); + if (result) + { + /* then check whether tag has a value (is non-empty) */ + result = dataset->tagExistsWithValue(key); + if (!result && !filename.isEmpty()) + { + /* report an error */ + printRequiredAttributeMessage(key, filename, OFTrue /*emptyMsg*/); + } + } + return result; +} + + +// check whether specified tag exists in the dataset and has the expected string value +OFBool DicomDirInterface::checkExistsWithStringValue(DcmItem *dataset, + const DcmTagKey &key, + const OFString &value, + const OFFilename &filename) +{ + /* first, check whether tag exists, and report an error if not */ + OFBool result = checkExists(dataset, key, filename); + if (result) + { + OFString str; + /* retrieve the string value from the element */ + dataset->findAndGetOFStringArray(key, str); + /* compare with expected value */ + result = compare(str, value); + if (!result && !filename.isEmpty()) + { + /* report an error */ + printUnexpectedValueMessage(key, filename); + } + } + return result; +} + + +// check whether specified tag exists in the dataset and has the expected integer value +OFBool DicomDirInterface::checkExistsWithIntegerValue(DcmItem *dataset, + const DcmTagKey &key, + const long value, + const OFFilename &filename, + const OFBool reject) +{ + /* first, check whether tag exists, and report an error if not */ + OFBool result = checkExists(dataset, key, filename); + if (result) + { + long i; + /* retrieve the integer value from the element */ + dataset->findAndGetLongInt(key, i); + /* compare with expected value */ + result = (i == value); + if (!result) + { + if (!filename.isEmpty()) + { + /* report an error or a warning */ + printUnexpectedValueMessage(key, filename, reject /*errorMsg*/); + } + /* do not reject invalid values */ + if (!reject) + result = OFTrue; + } + } + return result; +} + + +// check whether specified tag exists in the dataset and has an integer value in the expected range +OFBool DicomDirInterface::checkExistsWithMinMaxValue(DcmItem *dataset, + const DcmTagKey &key, + const long min, + const long max, + const OFFilename &filename, + const OFBool reject) +{ + /* first, check whether tag exists, and report an error if not */ + OFBool result = checkExists(dataset, key, filename); + if (result) + { + long i; + /* retrieve the integer value from the element */ + dataset->findAndGetLongInt(key, i); + /* compare with expected value range */ + result = (i >= min) && (i <= max); + if (!result) + { + if (!filename.isEmpty()) + { + /* report an error or a warning */ + printUnexpectedValueMessage(key, filename, reject /*errorMsg*/); + } + /* do not reject invalid values */ + if (!reject) + result = OFTrue; + } + } + return result; +} + + +// get string value from dataset and report an error (if any) +OFString &DicomDirInterface::getStringFromDataset(DcmItem *dataset, + const DcmTagKey &key, + OFString &result, + OFBool searchIntoSub) +{ + result.clear(); + if (dataset != NULL) + { + /* get string value from dataset and report if tag is missing */ + OFCondition status = dataset->findAndGetOFStringArray(key, result, searchIntoSub); + printAttributeErrorMessage(key, status, "retrieve"); + } + return result; +} + + +// get string value component from dataset and report an error (if any) +OFString &DicomDirInterface::getStringComponentFromDataset(DcmItem *dataset, + const DcmTagKey &key, + OFString &result, + const unsigned long pos, + OFBool searchIntoSub) +{ + result.clear(); + if (dataset != NULL) + { + /* get string value component from dataset and report if tag or component is missing */ + OFCondition status = dataset->findAndGetOFString(key, result, pos, searchIntoSub); + if (status.bad()) + { + DCMDATA_ERROR(status.text() << ": cannot retrieve value " << (pos + 1) + << " of " << DcmTag(key).getTagName() << " " << key); + } + } + return result; +} + + +// get string value from file and report an error (if any) +OFString &DicomDirInterface::getStringFromFile(const OFFilename &filename, + const DcmTagKey &key, + OFString &result, + OFBool searchIntoSub) +{ + result.clear(); + if (!filename.isEmpty()) + { + DcmFileFormat fileformat; + DCMDATA_INFO("investigating file: " << filename); + /* load specified file */ + OFCondition status = fileformat.loadFile(filename); + /* retrieve string value from dataset */ + if (status.good()) + getStringFromDataset(fileformat.getDataset(), key, result, searchIntoSub); + else + DCMDATA_ERROR(status.text() << ": reading file: " << filename); + } + return result; +} + + +// copy element from given dataset to directory record +void DicomDirInterface::copyElement(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename, + const OFBool optional, + const OFBool copyEmpty) +{ + if ((dataset != NULL) && (record != NULL)) + { + /* check whether tag exists in source dataset (if optional) */ + if (!optional || (copyEmpty && dataset->tagExists(key)) || dataset->tagExistsWithValue(key)) + { + DcmElement *delem = NULL; + /* get copy of element from source dataset */ + OFCondition status = dataset->findAndGetElement(key, delem, OFFalse /*searchIntoSub*/, OFTrue /*createCopy*/); + if (status.good()) + { + /* ... and insert it into the destination dataset (record) */ + status = record->insert(delem, OFTrue /*replaceOld*/); + if (status.good()) + { + DcmTag tag(key); + /* check for correct VR in the dataset */ + if (delem->getVR() != tag.getEVR()) + { + /* create warning message */ + DCMDATA_WARN("file " << sourceFilename << ": possibly wrong VR: " + << tag.getTagName() << " " << key << " with " + << DcmVR(delem->getVR()).getVRName() << " found, expected " + << tag.getVRName() << " instead"); + } + } else + delete delem; + } else if (status == EC_TagNotFound) + status = record->insertEmptyElement(key); + printAttributeErrorMessage(key, status, "insert"); + } + } +} + + +// copy element from given dataset or first item of the given sequence to directory record +void DicomDirInterface::copyElementType1CFromDatasetOrSequenceItem(DcmItem *dataset, + const DcmTagKey &elementKey, + const DcmTagKey &sequenceKey, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename) +{ + if ((dataset != NULL) && (record != NULL)) + { + DcmElement *delem = NULL; + OFCondition status = EC_IllegalCall; + /* check whether tag exists in given dataset */ + if (dataset->tagExistsWithValue(elementKey)) + { + /* get copy of element from given dataset */ + status = dataset->findAndGetElement(elementKey, delem, OFFalse /*searchIntoSub*/, OFTrue /*createCopy*/); + } else { + /* alternatively, check whether tag exists in first item of the given sequence element */ + DcmItem *ditem = NULL; + if (dataset->findAndGetSequenceItem(sequenceKey, ditem, 0).good()) + { + /* get copy of element from sequence item (on arbitrary nesting level) */ + status = ditem->findAndGetElement(elementKey, delem, OFTrue /*searchIntoSub*/, OFTrue /*createCopy*/); + } + } + /* check whether element could be found */ + if (delem != NULL) + { + if (status.good() && !delem->isEmpty()) + { + /* ... and insert it into the destination dataset (record) */ + status = record->insert(delem, OFTrue /*replaceOld*/); + if (status.good()) + { + DcmTag tag(elementKey); + /* check for correct VR in the dataset */ + if (delem->getVR() != tag.getEVR()) + { + /* create warning message */ + DCMDATA_WARN("file " << sourceFilename << ": possibly wrong VR: " + << tag.getTagName() << " " << elementKey << " with " + << DcmVR(delem->getVR()).getVRName() << " found, expected " + << tag.getVRName() << " instead"); + } + } else + delete delem; + } else + delete delem; + printAttributeErrorMessage(elementKey, status, "insert"); + } + } +} + + +// copy optional string value from dataset to directory record +void DicomDirInterface::copyStringWithDefault(DcmItem *dataset, + const DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename, + const char *defaultValue, + const OFBool printWarning) +{ + if ((dataset != NULL) && (record != NULL)) + { + OFCondition status = EC_Normal; + if (dataset->tagExistsWithValue(key)) + { + OFString stringValue; + /* retrieve string value from source dataset and put it into the destination dataset */ + status = record->putAndInsertOFStringArray(key, getStringFromDataset(dataset, key, stringValue)); + } else { + if (printWarning && (defaultValue != NULL)) + { + /* create warning message */ + DCMDATA_WARN("file " << sourceFilename << ": " << DcmTag(key).getTagName() << " " + << key << " missing, using alternative: " << defaultValue); + } + /* put default value */ + status = record->putAndInsertString(key, defaultValue); + } + printAttributeErrorMessage(key, status, "insert"); + } +} + + +// compare string attributes from dataset and record and report any deviation +OFBool DicomDirInterface::compareStringAttributes(DcmItem *dataset, + const DcmTagKey &datKey, + DcmDirectoryRecord *record, + const DcmTagKey &recKey, + const OFFilename &sourceFilename, + const OFBool errorMsg) +{ + OFBool result = OFFalse; + /* check parameters first */ + if ((dataset != NULL) && (record != NULL)) + { + OFString datasetString, recordString; + /* compare string value from dataset and record */ + result = compare(getStringFromDataset(dataset, datKey, datasetString), + getStringFromDataset(record, recKey, recordString)); + if (!result) + { + OFString uniqueString; + OFFilename originFilename = record->getRecordsOriginFile(); + const DcmTagKey uniqueKey = getRecordUniqueKey(record->getRecordType()); + getStringFromDataset(record, uniqueKey, uniqueString); + if (originFilename.isEmpty()) + originFilename = ""; + /* create warning message */ + OFOStringStream oss; + oss << "file inconsistent with existing DICOMDIR record" << OFendl; + oss << " " << recordTypeToName(record->getRecordType()) << " Record [Key: " + << DcmTag(uniqueKey).getTagName() << " " << uniqueKey << "=\"" << uniqueString << "\"]" << OFendl; + oss << " Existing Record (origin: " << originFilename << ") defines: " << OFendl; + oss << " " << DcmTag(recKey).getTagName() << " " << recKey << "=\"" << recordString << "\"" << OFendl; + oss << " File (" << sourceFilename << ") defines:" << OFendl; + oss << " " << DcmTag(datKey).getTagName() << " " << datKey << "=\"" << datasetString << "\"" << OFendl; + oss << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + if (errorMsg) + DCMDATA_ERROR(tmpString); + else + DCMDATA_WARN(tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + } + } + return result; +} + + +// compare sequence attributes from dataset and record and report any deviation +OFBool DicomDirInterface::compareSequenceAttributes(DcmItem *dataset, + DcmTagKey &key, + DcmDirectoryRecord *record, + const OFFilename &sourceFilename) +{ + OFBool result = OFFalse; + /* check parameters first */ + if ((dataset != NULL) && (record != NULL)) + { + DcmSequenceOfItems *seq1, *seq2; + /* compare sequence value from dataset and record */ + if (record->findAndGetSequence(key, seq1).good() && + dataset->findAndGetSequence(key, seq2).good()) + { + OFString reason; + result = compareSQAttributes(seq1, seq2, reason); + if (!result) + { + OFString uniqueString; + OFFilename originFilename = record->getRecordsOriginFile(); + const DcmTagKey uniqueKey = getRecordUniqueKey(record->getRecordType()); + getStringFromDataset(record, uniqueKey, uniqueString); + if (originFilename.isEmpty()) + originFilename = ""; + /* create warning message */ + DCMDATA_WARN("file inconsistent with existing DICOMDIR record" << OFendl + << " " << recordTypeToName(record->getRecordType()) << " Record [Key: " + << DcmTag(uniqueKey).getTagName() << " " << uniqueKey << "=\"" << uniqueString << "\"]" << OFendl + << " Reason: " << reason << OFendl + << " Existing Record (origin: " << originFilename << ") defines: " << OFendl + << DcmObject::PrintHelper(*seq1, 0, 4 /* indent */) + << " File (" << sourceFilename << ") defines:" << OFendl + << DcmObject::PrintHelper(*seq2, 0, 4 /* indent */)); + } + } + } + return result; +} + + +// set the specified default value (number or prefix and number) to the given tag +void DicomDirInterface::setDefaultValue(DcmDirectoryRecord *record, + const DcmTagKey &key, + const unsigned long number, + const char *prefix) +{ + if (record != NULL) + { + char buffer[64]; + if (prefix != NULL) + { + /* use at most 10 chars from prefix */ + OFStandard::strlcpy(buffer, prefix, 10 + 1); + /* append a 6 digits number */ + sprintf(buffer + strlen(buffer), "%06lu", number); + } else { + /* create a number string only */ + sprintf(buffer, "%lu", number); + } + record->putAndInsertString(key, buffer); + /* create warning message */ + DCMDATA_WARN(recordTypeToName(record->getRecordType()) << " Record (origin: " + << record->getRecordsOriginFile() << ") inventing " << DcmTag(key).getTagName() + << ": " << buffer); + } +} diff --git a/dcmdata/libsrc/dcdicdir.cc b/dcmdata/libsrc/dcdicdir.cc new file mode 100644 index 00000000..2df96eed --- /dev/null +++ b/dcmdata/libsrc/dcdicdir.cc @@ -0,0 +1,1280 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: class DcmDicomDir + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_LIBC +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +#ifdef HAVE_UNIX_H +#if defined(macintosh) && defined (HAVE_WINSOCK_H) +/* unix.h defines timeval incompatible with winsock.h */ +#define timeval _UNWANTED_timeval +#endif +#include /* for unlink() under Metrowerks C++ (Macintosh) */ +#undef timeval +#endif + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofdefine.h" +#include "dcmtk/dcmdata/dcdicdir.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcdirrec.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ +#include "dcmtk/dcmdata/dcostrmf.h" /* for class DcmOutputFileStream */ +#include "dcmtk/dcmdata/dcistrmf.h" /* for class DcmInputFileStream */ +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ +#include "dcmtk/dcmdata/dcvrui.h" /* for class DcmUniqueIdentifier */ + +#ifndef O_BINARY +#define O_BINARY 0 /* only Windows has O_BINARY */ +#endif + + +// ******************************** + + +DcmDicomDir::DcmDicomDir() + : errorFlag(EC_Normal), + dicomDirFileName(), + modified(OFFalse), + mustCreateNewDir(OFFalse), + DirFile(new DcmFileFormat()), + RootRec(NULL), + MRDRSeq(NULL) +{ + dicomDirFileName.set(DEFAULT_DICOMDIR_NAME); + + OFCondition cond = DirFile->loadFile(dicomDirFileName); + if (cond.bad()) + { + delete DirFile; // clean up file format object + DirFile = new DcmFileFormat(); + mustCreateNewDir = OFTrue; + } + + createNewElements( "" ); // create missing data elements + RootRec = new DcmDirectoryRecord( ERT_root, NULL, OFFilename()); + DcmTag mrdrSeqTag( DCM_DirectoryRecordSequence ); + MRDRSeq = new DcmSequenceOfItems( mrdrSeqTag ); + + errorFlag = convertLinearToTree(); +} + + +// ******************************** + + +DcmDicomDir::DcmDicomDir(const OFFilename &fileName, const char *fileSetID) + : errorFlag(EC_Normal), + dicomDirFileName(), + modified(OFFalse), + mustCreateNewDir(OFFalse), + DirFile(new DcmFileFormat()), + RootRec(NULL), + MRDRSeq(NULL) +{ + if ( fileName.isEmpty() ) + dicomDirFileName.set(DEFAULT_DICOMDIR_NAME); + else + dicomDirFileName = fileName; + + OFCondition cond = DirFile->loadFile(dicomDirFileName); + if (cond.bad()) + { + delete DirFile; // clean up file format object + DirFile = new DcmFileFormat(); + mustCreateNewDir = OFTrue; + } + + createNewElements( fileSetID ); // create missing data elements + RootRec = new DcmDirectoryRecord( ERT_root, NULL, OFFilename()); + DcmTag mrdrSeqTag( DCM_DirectoryRecordSequence ); + MRDRSeq = new DcmSequenceOfItems( mrdrSeqTag ); + + errorFlag = convertLinearToTree(); +} + + +// ******************************** + + +/* This copy constructor implementation is untested + */ +DcmDicomDir::DcmDicomDir( const DcmDicomDir & old ) + : errorFlag(old.errorFlag), + dicomDirFileName(old.dicomDirFileName), + modified(old.modified), + mustCreateNewDir(old.mustCreateNewDir), + DirFile(new DcmFileFormat(*old.DirFile)), + RootRec(new DcmDirectoryRecord(*old.RootRec)), + MRDRSeq(new DcmSequenceOfItems(*old.MRDRSeq)) +{ +} + + +// ******************************** + + +DcmDicomDir::~DcmDicomDir() +{ + if (modified) + write(); + + delete DirFile; + delete RootRec; + delete MRDRSeq; +} + + +// ******************************** + +/* + creates required data elements. Only called by the constructors. +*/ + +OFCondition DcmDicomDir::createNewElements( const char* fileSetID ) +{ + OFCondition l_error = EC_Normal; + DcmUnsignedLongOffset *uloP; + DcmUnsignedShort *usP; + DcmCodeString *csP; + DcmDataset &dset = getDataset(); // guaranteed to exist + + DcmTag fileIDTag( DCM_FileSetID ); + csP = new DcmCodeString( fileIDTag ); // (0004,1130) + if ( fileSetID != NULL && *fileSetID != '\0' ) + csP->putString( fileSetID ); + if ( dset.insert( csP, OFFalse ) != EC_Normal ) + delete csP; + + // not created or inserted: // (0004,1141) + // (0004,1142) + + DcmTag firstRecTag( DCM_OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity ); + uloP = new DcmUnsignedLongOffset( firstRecTag ); // (0004,1200) + uloP->putUint32(Uint32(0)); + if ( dset.insert( uloP, OFFalse ) != EC_Normal ) + delete uloP; + + DcmTag lastRecTag( DCM_OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity ); + uloP = new DcmUnsignedLongOffset( lastRecTag ); // (0004,1202) + uloP->putUint32(Uint32(0)); + if ( dset.insert( uloP, OFFalse ) != EC_Normal ) + delete uloP; + + DcmTag fileConsTag( DCM_FileSetConsistencyFlag ); + usP = new DcmUnsignedShort( fileConsTag ); // (0004,1212) + usP->putUint16(Uint16(0x0000)); + dset.insert( usP, OFTrue ); + return l_error; +} + + +// ******************************** + + +DcmDataset& DcmDicomDir::getDataset() +{ + if ( DirFile == NULL ) + DirFile = new DcmFileFormat(); + DcmDataset *localDataset = DirFile->getDataset(); + + if ( localDataset == NULL ) + { + errorFlag = EC_CorruptedData; + DCMDATA_ERROR("DcmDicomDir::getDataset() Missing Dataset in DICOMDIR File. Must create new DICOMDIR file."); + if ( DirFile != NULL ) + delete DirFile; + DirFile = new DcmFileFormat(); + localDataset = DirFile->getDataset(); + } + return *localDataset; // must exist, otherwise error in DcmFileFormat +} + + +// ******************************** + + +DcmSequenceOfItems& DcmDicomDir::getDirRecSeq( DcmDataset &dset ) +{ + DcmSequenceOfItems *localDirRecSeq = NULL; + DcmStack stack; + if ( dset.search( DCM_DirectoryRecordSequence, stack, ESM_fromHere, OFFalse ) == EC_Normal ) + { + if ( stack.top()->ident() == EVR_SQ ) + localDirRecSeq = OFstatic_cast(DcmSequenceOfItems *, stack.top()); + } + + if ( localDirRecSeq == NULL ) + { + errorFlag = EC_CorruptedData; + if ( !mustCreateNewDir ) + { + DCMDATA_WARN("DcmDicomDir::getDirRecSeq() Missing Directory Record Sequence. Must create new one."); + } + DcmTag dirSeqTag( DCM_DirectoryRecordSequence ); // (0004,1220) + localDirRecSeq = new DcmSequenceOfItems( dirSeqTag ); + dset.insert( localDirRecSeq, OFTrue ); + } + return *localDirRecSeq; // must exist, otherwise memory exhausted +} + + +// ******************************** + + +DcmUnsignedLongOffset* DcmDicomDir::lookForOffsetElem( DcmObject *obj, + const DcmTagKey &offsetTag ) +{ + DcmUnsignedLongOffset *offElem = NULL; + if ( obj != NULL ) + { + DcmStack stack; + if ( obj->search( offsetTag, stack, ESM_fromHere, OFFalse ) == EC_Normal ) + { + if ( stack.top()->ident() == EVR_up ) + { + offElem = OFstatic_cast(DcmUnsignedLongOffset *, stack.top()); +#ifdef DEBUG + Uint32 l_uint = 0; + offElem->getUint32(l_uint); + DCMDATA_TRACE("DcmDicomDir::lookForOffsetElem() Offset Element " + << offElem->getTag() << " offs=0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(8) << l_uint + << " p=" << OFstatic_cast(void *, offElem) + << " l=" << offElem->getNextRecord()); +#endif + } + } + } + return offElem; +} + + +// ******************************** + + +OFCondition DcmDicomDir::resolveGivenOffsets( DcmObject *startPoint, + const OFMap &itOffsets, + const DcmTagKey &offsetTag ) +{ + OFCondition l_error = EC_Normal; + if ( startPoint != NULL ) + { + DcmStack stack; + Uint32 offset; + for (;;) + { + l_error = startPoint->nextObject(stack, OFTrue); + if (l_error.bad()) + break; + + DcmObject *cur = stack.top(); + if (cur->ident() != EVR_up || cur->getTag() != offsetTag) + continue; + + DcmUnsignedLongOffset *offElem = OFstatic_cast(DcmUnsignedLongOffset *, cur); + l_error = offElem->getUint32(offset); + + /* an offset of 0 means that no directory record is referenced */ + if (l_error.good() && (offset > 0)) + { + OFMap::const_iterator it = itOffsets.find(offset); + if (it != itOffsets.end()) + { + offElem->setNextRecord(it->second); + } else { + DCMDATA_WARN("DcmDicomDir::resolveGivenOffsets() Cannot resolve offset " << offset); + /* FIXME: obviously, this error code is never returned but always ignored!? */ + l_error = EC_InvalidOffset; + } + } + } + } + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::resolveAllOffsets( DcmDataset &dset ) // inout +{ + OFCondition l_error = EC_Normal; + DcmObject *obj = NULL; + DcmDirectoryRecord *rec = NULL; + DcmSequenceOfItems &localDirRecSeq = getDirRecSeq( dset ); + unsigned long maxitems = localDirRecSeq.card(); + OFMap itOffsets; + + for (unsigned long i = 0; i < maxitems; i++ ) + { + obj = localDirRecSeq.nextInContainer(obj); + rec = OFstatic_cast(DcmDirectoryRecord *, obj); + long filePos = rec->getFileOffset(); + itOffsets[ OFstatic_cast(Uint32, filePos) ] = rec; + DCMDATA_DEBUG("DcmDicomDir::resolveAllOffsets() Item Offset [" << i << "] = 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(8) << filePos); + } + resolveGivenOffsets( &dset, itOffsets, + DCM_OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity ); + resolveGivenOffsets( &dset, itOffsets, + DCM_OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity ); + + resolveGivenOffsets( &localDirRecSeq, itOffsets, + DCM_OffsetOfTheNextDirectoryRecord ); + resolveGivenOffsets( &localDirRecSeq, itOffsets, + DCM_OffsetOfReferencedLowerLevelDirectoryEntity ); + resolveGivenOffsets( &localDirRecSeq, itOffsets, + DCM_RETIRED_MRDRDirectoryRecordOffset ); + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::linkMRDRtoRecord( DcmDirectoryRecord *dRec ) +{ + OFCondition l_error = EC_Normal; + + if ( dRec != NULL ) + { + // enter referenced MRDR into protected attribute: + // only works since DcmDicomDir is a friend class of DcmDirectoryRecord + dRec->referencedMRDR = dRec->lookForReferencedMRDR(); + } + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::moveRecordToTree( DcmDirectoryRecord *startRec, + DcmSequenceOfItems &fromDirSQ, + DcmDirectoryRecord *toRecord ) +{ + OFCondition l_error = EC_Normal; + + if (toRecord == NULL) + l_error = EC_IllegalCall; + else + { + while ( (startRec != NULL) && l_error.good() ) + { + DcmDirectoryRecord *lowerRec = NULL; + DcmDirectoryRecord *nextRec = NULL; + + // check whether directory record is really part of the given sequence: + if (&fromDirSQ != startRec->getParent()) + { + DCMDATA_ERROR("DcmDicomDir: Record with offset=" << startRec->getFileOffset() + << " is referenced more than once, ignoring later reference"); + l_error = EC_InvalidDICOMDIR; + // exit the while loop + break; + } + + DcmUnsignedLongOffset *offElem; + offElem = lookForOffsetElem( startRec, DCM_OffsetOfReferencedLowerLevelDirectoryEntity ); + if ( offElem != NULL ) + lowerRec = OFstatic_cast(DcmDirectoryRecord *, offElem->getNextRecord()); + offElem = lookForOffsetElem( startRec, DCM_OffsetOfTheNextDirectoryRecord ); + if ( offElem != NULL ) + nextRec = OFstatic_cast(DcmDirectoryRecord *, offElem->getNextRecord()); + + DCMDATA_TRACE("DcmDicomDir::moveRecordToTree() Record with" + << " offset=" << startRec->getFileOffset() + << " p=" << OFstatic_cast(void *, startRec) + << " has lower=" << OFstatic_cast(void *, lowerRec) + << " and next=" << OFstatic_cast(void *, nextRec) << " Record"); + + linkMRDRtoRecord( startRec ); + + // use protected method for insertion without type check: + if ( toRecord->masterInsertSub( startRec ) == EC_Normal ) + { + // only works since friend class + DcmItem *dit = fromDirSQ.remove( startRec ); + if ( dit == NULL ) + { + DCMDATA_ERROR("DcmDicomDir: Record with offset=" << startRec->getFileOffset() + << " is part of unknown Sequence"); + } + } + else + { + DCMDATA_ERROR("DcmDicomDir::moveRecordToTree() Cannot insert DirRecord (=NULL?)"); + } + + // recursively call this method for next lower level: + l_error = moveRecordToTree( lowerRec, fromDirSQ, startRec ); + + // We handled this record, now move on to the next one on this level. + // The next while-loop iteration does the equivalent of the following: + // moveRecordToTree( nextRec, fromDirSQ, toRecord ); + startRec = nextRec; + } + } + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::moveMRDRbetweenSQs( DcmSequenceOfItems &fromSQ, + DcmSequenceOfItems &toSQ ) +{ + OFCondition l_error = EC_Normal; + + unsigned long num = fromSQ.card(); + for (unsigned long i = 0, j = 0; i < num; i++) + { + DcmDirectoryRecord *dRec; + dRec = OFstatic_cast(DcmDirectoryRecord *, fromSQ.getItem( j )); + if (dRec != NULL && dRec->getRecordType() == ERT_Mrdr) + { + toSQ.insert( dRec ); + fromSQ.remove( j ); + } else + j++; + } + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::convertLinearToTree() +{ + DcmDataset &dset = getDataset(); // guaranteed to exist + DcmSequenceOfItems &localDirRecSeq = getDirRecSeq( dset ); + // currently, always returns EC_Normal + OFCondition l_error = resolveAllOffsets( dset ); + + // search for first directory record: + DcmDirectoryRecord *firstRootRecord = NULL; + DcmUnsignedLongOffset *offElem = lookForOffsetElem( &dset, DCM_OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity ); + if ( offElem != NULL ) + firstRootRecord = OFstatic_cast(DcmDirectoryRecord *, offElem->getNextRecord()); + + // create tree structure from flat record list: + l_error = moveRecordToTree( firstRootRecord, localDirRecSeq, &getRootRecord() ); + + if (l_error.good()) + { + // move MRDRs from localDirRecSeq to global MRDRSeq: + moveMRDRbetweenSQs( localDirRecSeq, getMRDRSequence() ); + + // dissolve MRDR references for all remaining items + for (unsigned long i = localDirRecSeq.card(); i > 0; i-- ) + linkMRDRtoRecord( OFstatic_cast(DcmDirectoryRecord *, localDirRecSeq.getItem(i-1)) ); + } + return l_error; +} + + +// ******************************** +// ******************************** + + +Uint32 DcmDicomDir::lengthUntilSQ(DcmDataset &dset, + E_TransferSyntax oxfer, + E_EncodingType enctype ) +{ + Uint32 templen = 0L; + unsigned long num = dset.card(); + for (unsigned long i = 0; i < num; i++ ) + { + DcmObject *dO = dset.getElement( i ); + + DcmXfer xf(oxfer); + templen += xf.sizeofTagHeader(dO->getVR()); + + if ( dO->getTag().getXTag() == DCM_DirectoryRecordSequence ) + break; + + Uint32 sublength = dO->getLength( oxfer, enctype ); + templen += sublength; + if ( sublength==DCM_UndefinedLength ) + { + DcmVR subvr( dO->getVR() ); + DCMDATA_WARN("DcmDicomDir::lengthUntilSQ() Sub element \"" << subvr.getVRName() << "\" has undefined Length"); + } + + if ( dO->getVR() == EVR_SQ && enctype == EET_UndefinedLength ) + templen += 8; // for ItemDelimitationItem + + } + DCMDATA_TRACE("DcmDicomDir::lengthUntilSQ() Length of Dataset until SQ=" << templen); + + return templen; +} + + +// ******************************** + + +Uint32 DcmDicomDir::lengthOfRecord( DcmItem *item, + E_TransferSyntax oxfer, + E_EncodingType enctype ) +{ + Uint32 templen = 0; + if ( item != NULL ) + { + templen = item->getLength( oxfer, enctype ); + + templen += 8; // for Tag and Length + + if ( enctype == EET_UndefinedLength ) + templen += 8; // for ItemDelimitationItem + } + return templen; +} + + +// ******************************** + + +OFCondition DcmDicomDir::convertGivenPointer( DcmObject *startPoint, + const DcmTagKey &offsetTag ) +{ + OFCondition l_error = EC_Normal; + if ( startPoint != NULL ) + { + DcmStack stack; + for (;;) + { + l_error = startPoint->nextObject(stack, OFTrue); + if (l_error.bad()) + break; + + DcmObject *cur = stack.top(); + if (cur->ident() != EVR_up || cur->getTag() != offsetTag) + continue; + + DcmUnsignedLongOffset *offElem = OFstatic_cast(DcmUnsignedLongOffset *, cur); + DcmObject *obj = offElem->getNextRecord(); + if (obj != NULL) + offElem->putUint32(OFstatic_cast(DcmDirectoryRecord *, obj)->getFileOffset()); + else + offElem->putUint32(0); + } + } + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::convertAllPointer( DcmDataset &dset, // inout + Uint32 beginOfDataSet, // in + E_TransferSyntax oxfer, // in + E_EncodingType enctype ) // in +{ + OFCondition l_error = EC_Normal; + DcmObject *obj = NULL; + DcmDirectoryRecord *rec = NULL; + DcmSequenceOfItems &localDirRecSeq = getDirRecSeq( dset ); + Uint32 offs_Item1 = beginOfDataSet + lengthUntilSQ( dset, oxfer, enctype ); + unsigned long num = localDirRecSeq.card(); + + Uint32 item_pos = offs_Item1; + for (unsigned long i = 0; i < num; i++ ) + { + obj = localDirRecSeq.nextInContainer(obj); + rec = OFstatic_cast(DcmDirectoryRecord *, obj); + rec->setFileOffset( item_pos ); + item_pos = lengthOfRecord( rec, oxfer, enctype ) + item_pos; + } + + /* calling convertGivenPointer() requires that the above for-loop has been run through */ + OFCondition e1 = convertGivenPointer( &dset, DCM_OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity ); + OFCondition e2 = convertGivenPointer( &dset, DCM_OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity ); + + OFCondition e3 = convertGivenPointer( &localDirRecSeq, DCM_OffsetOfTheNextDirectoryRecord ); + OFCondition e4 = convertGivenPointer( &localDirRecSeq, DCM_OffsetOfReferencedLowerLevelDirectoryEntity ); + OFCondition e5 = convertGivenPointer( &localDirRecSeq, DCM_RETIRED_MRDRDirectoryRecordOffset ); + + if ( e1 == EC_InvalidVR || e2 == EC_InvalidVR || e3 == EC_InvalidVR || e4 == EC_InvalidVR || e5 == EC_InvalidVR ) + l_error = EC_InvalidVR; + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::copyRecordPtrToSQ( DcmDirectoryRecord *record, + DcmSequenceOfItems &toDirSQ, + DcmDirectoryRecord **firstRec, + DcmDirectoryRecord **lastRec ) +{ + DcmDirectoryRecord *nextRec = NULL; + DcmDirectoryRecord *lastReturnItem = NULL; + + if ( record != NULL ) + { + unsigned long lastIndex = record->cardSub(); + for (unsigned long i = lastIndex; i > 0; i-- ) + { + DCMDATA_DEBUG("DcmDicomDir::copyRecordPtrToSQ() Testing sub record no. " << i << " of " << lastIndex); + + DcmDirectoryRecord *subRecord = record->getSub( i-1 ); + + if ( subRecord != NULL ) + { + DcmUnsignedLongOffset *uloP; + if ( i == lastIndex ) + lastReturnItem = subRecord; // memorize last item + // adjust nextPointer + DcmTag nextRecTag( DCM_OffsetOfTheNextDirectoryRecord ); + uloP = new DcmUnsignedLongOffset( nextRecTag ); + uloP->putUint32(Uint32(0)); + uloP->setNextRecord( nextRec ); + subRecord->insert( uloP, OFTrue ); +#ifdef DEBUG + Uint32 l_uint = 0; + uloP->getUint32(l_uint); + DCMDATA_TRACE("DcmDicomDir::copyRecordPtrToSQ() Next Offset Element " + << uloP->getTag() << " offs=0x" << STD_NAMESPACE hex + << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(8) << l_uint + << " p=" << OFstatic_cast(void *, uloP) + << " next=" << OFstatic_cast(void *, nextRec)); +#endif + copyRecordPtrToSQ( subRecord, toDirSQ, firstRec, lastRec ); + + // adjust lowerPointer + DcmTag lowerRefTag( DCM_OffsetOfReferencedLowerLevelDirectoryEntity ); + uloP = new DcmUnsignedLongOffset( lowerRefTag ); + uloP->putUint32(Uint32(0)); + uloP->setNextRecord( *firstRec ); + subRecord->insert( uloP, OFTrue ); +#ifdef DEBUG + uloP->getUint32(l_uint); + DCMDATA_TRACE("DcmDicomDir::copyRecordPtrToSQ() Lower Offset Element " + << uloP->getTag() << " offs=0x" << STD_NAMESPACE hex + << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(8) << l_uint + << " p=" << OFstatic_cast(void *, uloP) + << " lower=" << OFstatic_cast(void *, *firstRec)); +#endif + + /* insert at beginning */ + toDirSQ.prepend( subRecord ); + + nextRec = subRecord; + } + } // for ( i ... + } + if ( lastRec != NULL ) + *lastRec = lastReturnItem; + // points to first record of subordinate level + if ( firstRec != NULL ) + *firstRec = nextRec; + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmDicomDir::convertTreeToLinear(Uint32 beginOfDataSet, + E_TransferSyntax oxfer, + E_EncodingType enctype, + E_GrpLenEncoding glenc, + DcmSequenceOfItems &unresRecs ) +{ + OFCondition l_error = EC_Normal; + DcmDataset &dset = getDataset(); // guaranteed to exist + DcmSequenceOfItems &localDirRecSeq = getDirRecSeq( dset ); + + // copy items to which no pointer exists to a temporary list + unsigned long numUnresItems = localDirRecSeq.card(); + for (unsigned long i = numUnresItems; i > 0; i-- ) + { + DCMDATA_DEBUG("DcmDicomDir::convertTreeToLinear() Copy pointer of unresolved Record no. " + << i << " of " << numUnresItems << " to unresRecsSeq:"); + unresRecs.insert( localDirRecSeq.getItem(i-1), 0 ); + } + + // convert items back into the root directory entity: + DcmDirectoryRecord *firstRootRecord[1], *lastRootRecord[1]; + copyRecordPtrToSQ( &getRootRecord(), localDirRecSeq, firstRootRecord, lastRootRecord ); + + // set pointer to first directory record: + DcmUnsignedLongOffset *offElem = lookForOffsetElem( &dset, DCM_OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity ); + if ( offElem != NULL ) + offElem->setNextRecord( *firstRootRecord ); + + // set pointer to last directory record: + offElem = lookForOffsetElem( &dset, DCM_OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity ); + if ( offElem != NULL ) + offElem->setNextRecord( *lastRootRecord ); + + // copy MRDRs in localDirRecSeq + unsigned long numMRDRItems = getMRDRSequence().card(); + for (unsigned long j = numMRDRItems; j > 0; j-- ) + { + DCMDATA_DEBUG("DcmDicomDir::convertTreeToLinear() Copy pointer of MRDR no. " << j << " of " + << numUnresItems << " to localDirRecSeq:"); + localDirRecSeq.insert( getMRDRSequence().getItem(j-1), 0 ); + } + + // compute group lengths before computing byte offsets + dset.computeGroupLengthAndPadding(glenc, EPD_noChange, oxfer, enctype); + + // convert maximum twice + if ( convertAllPointer( dset, beginOfDataSet, oxfer, enctype ) == EC_InvalidVR ) + if ( convertAllPointer( dset, beginOfDataSet, oxfer, enctype ) == EC_InvalidVR ) + { + DCMDATA_ERROR("DcmDicomDir: There are some incorrect Offsets in file " << dicomDirFileName); + l_error = EC_CorruptedData; + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::insertMediaSOPUID( DcmMetaInfo &metaInfo ) // inout +{ + OFCondition l_error = EC_Normal; + DcmTag medSOPClassTag( DCM_MediaStorageSOPClassUID ); + DcmUniqueIdentifier *mediaStorageSOPClassUID = new DcmUniqueIdentifier( medSOPClassTag ); + const char* valueUID = UID_MediaStorageDirectoryStorage; + mediaStorageSOPClassUID->putString( valueUID ); + metaInfo.insert( mediaStorageSOPClassUID, OFTrue ); + return l_error; +} + + +// ******************************** + + +void DcmDicomDir::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + int i; + for ( i=0; iprint(out, flags, 1, pixelFileName, pixelCounter); // friend class + + out << OFendl; + for ( i=0; icardSub(); + for (unsigned long i = 0; i < lastIndex; i++ ) + { + DcmDirectoryRecord *subRecord = startRec->getSub( i ); + const char* subName = subRecord->lookForReferencedFileID(); // friend + + if ( subName != NULL && !strcmp( filename, subName ) ) + { + DCMDATA_DEBUG("DcmDicomDir::recurseMatchFile() Record p=" << OFstatic_cast(void *, subRecord) + << " with matching filename [" << subName << "] found"); + retRec = subRecord; + break; + } + else + retRec = recurseMatchFile( subRecord, filename ); + } + } + return retRec; +} + + +// ******************************** + + +DcmDirectoryRecord* DcmDicomDir::searchMatchFile( DcmSequenceOfItems& recSeq, + const char *filename ) +{ + DcmDirectoryRecord* retRec = NULL; + if ( filename != NULL && *filename != '\0' ) + { + unsigned long lastIndex = recSeq.card(); + for (unsigned long i = 0; i < lastIndex; i++ ) + { + DcmDirectoryRecord *record; + record = OFstatic_cast(DcmDirectoryRecord *, recSeq.getItem( i )); + const char* subName = record->lookForReferencedFileID(); // friend + + if ( subName != NULL && !strcmp( filename, subName ) ) + { + DCMDATA_DEBUG("DcmDicomDir::searchMatchFile() Record p=" << OFstatic_cast(void *, record) + << " with matching filename [" << subName << "] found"); + retRec = record; + break; + } + } + } + + return retRec; +} + + +// ******************************** + + +DcmDirectoryRecord* DcmDicomDir::matchFilename( const char *filename ) +{ + DcmDirectoryRecord* retRec = NULL; + if ( filename != NULL && *filename != '\0' ) + { + retRec = recurseMatchFile( &getRootRecord(), filename ); + if ( retRec == NULL ) + { + retRec = searchMatchFile( getMRDRSequence(), filename ); + if ( retRec == NULL ) + { + DcmDataset &dset = getDataset(); + retRec = searchMatchFile( getDirRecSeq(dset), filename ); + } + } + } + if (retRec == NULL) + { + DCMDATA_DEBUG("DcmDicomDir::matchFilename() No Record with matching filename [" + << filename << "] found"); + } + return retRec; +} + + +// ******************************** + + +DcmDirectoryRecord* DcmDicomDir::matchOrCreateMRDR( const char *filename ) +{ + DcmDirectoryRecord* newMRDR = NULL; + DcmDirectoryRecord* matchRec = matchFilename( filename ); + if ( matchRec != NULL ) + { + if ( matchRec->getRecordType() == ERT_Mrdr ) + newMRDR = matchRec; + else if ( matchRec->getRecordType() != ERT_root ) + { + newMRDR = new DcmDirectoryRecord( ERT_Mrdr, filename, OFFilename()); + if ( matchRec->assignToMRDR( newMRDR ) != EC_IllegalCall ) + getMRDRSequence().insert( newMRDR ); + else + { + delete newMRDR; + newMRDR = NULL; + DCMDATA_ERROR("DcmDicomDir: Internal ERROR: Can't Create MRDR"); + } + if (newMRDR != NULL) + { + DCMDATA_DEBUG("DcmDicomDir::matchOrCreateMRDR() New MRDR p=" << OFstatic_cast(void *, newMRDR) + << " with matching filename [" << filename << "] created, original Record p=" + << OFstatic_cast(void *, matchRec) << " with same filename modified"); + } + modified = OFTrue; + } + } + if (newMRDR == NULL) + DCMDATA_WARN("DcmDicomDir::matchOrCreateMRDR() No MRDR with matching filename [" << filename << "] found"); + + return newMRDR; +} + + +// ******************************** +// ******************************** + + +OFCondition DcmDicomDir::write(const E_TransferSyntax oxfer, + const E_EncodingType enctype, + const E_GrpLenEncoding glenc) +{ + if (oxfer != DICOMDIR_DEFAULT_TRANSFERSYNTAX) + { + DCMDATA_ERROR("DcmDicomDir::write() Wrong TransferSyntax used, only LittleEndianExplicit allowed"); + } + errorFlag = EC_Normal; + E_TransferSyntax outxfer = DICOMDIR_DEFAULT_TRANSFERSYNTAX; + + // create a temporary file based on the DICOMDIR filename + OFFilename tempFilename; + OFStandard::appendFilenameExtension(tempFilename, dicomDirFileName, DICOMDIR_TEMP_SUFFIX); + + DcmOutputFileStream *outStream = new DcmOutputFileStream(tempFilename); + if (! outStream->good()) + { + DCMDATA_ERROR("DcmDicomDir: Cannot create DICOMDIR temporary file: " << tempFilename); + errorFlag = outStream->status(); + delete outStream; + return errorFlag; + } + + DcmDataset &dset = getDataset(); // guaranteed to exist + DcmMetaInfo &metainfo = *(getDirFileFormat().getMetaInfo()); + DcmSequenceOfItems &localDirRecSeq = getDirRecSeq(dset); + DcmTag unresSeqTag(DCM_DirectoryRecordSequence); + DcmSequenceOfItems localUnresRecs(unresSeqTag); + + // insert Media Stored SOP Class UID + insertMediaSOPUID(metainfo); + + getDirFileFormat().validateMetaInfo(outxfer); + + { + // it is important that the cache object is destroyed before the file is renamed! + // Therefore, the variable declaration is "encapsulated" in curly brackets. + DcmWriteCache wcache; + + metainfo.transferInit(); + metainfo.write(*outStream, META_HEADER_DEFAULT_TRANSFERSYNTAX, enctype, &wcache); + metainfo.transferEnd(); + + Uint32 beginOfDataset = OFstatic_cast(Uint32, outStream->tell()); + + // convert to writable format + errorFlag = convertTreeToLinear(beginOfDataset, outxfer, enctype, glenc, localUnresRecs); + + dset.transferInit(); + // do not calculate GroupLength and Padding twice! + dset.write(*outStream, outxfer, enctype, &wcache, EGL_noChange); + dset.transferEnd(); + } + + // outStream is closed here + delete outStream; + + OFFilename backupFilename; + if (!mustCreateNewDir) + { +#ifndef DICOMDIR_WITHOUT_BACKUP + // create a temporary backup of the existing DICOMDIR + OFStandard::appendFilenameExtension(backupFilename, dicomDirFileName, DICOMDIR_BACKUP_SUFFIX); + OFStandard::deleteFile(backupFilename); + if (errorFlag == EC_Normal) + { + if (!OFStandard::renameFile(dicomDirFileName, backupFilename)) + { + OFString buffer = OFStandard::getLastSystemErrorCode().message(); + errorFlag = makeOFCondition(OFM_dcmdata, 19, OF_error, buffer.c_str()); + } + } +#else + if (!OFStandard::deleteFile(dicomDirFileName)) + { + OFString buffer = OFStandard::getLastSystemErrorCode().message(); + errorFlag = makeOFCondition(OFM_dcmdata, 19, OF_error, buffer.c_str()); + } +#endif + } + + if (errorFlag == EC_Normal && !OFStandard::renameFile(tempFilename, dicomDirFileName)) + { + OFString buffer = OFStandard::getLastSystemErrorCode().message(); + errorFlag = makeOFCondition(OFM_dcmdata, 19, OF_error, buffer.c_str()); + } + + modified = OFFalse; + + if (errorFlag == EC_Normal) { + // remove temporary backup (if any) + OFStandard::deleteFile(backupFilename); + } + + // remove all records from sequence localDirRecSeq + while (localDirRecSeq.card() > 0) + localDirRecSeq.remove(OFstatic_cast(unsigned long, 0)); + + // move records to which no pointer exists back + while (localUnresRecs.card() > 0) + { + DcmItem *unresRecord = + localUnresRecs.remove(OFstatic_cast(unsigned long, 0)); + localDirRecSeq.insert(unresRecord); + } + return errorFlag; +} + + +// ******************************** +// ******************************** + + +OFCondition DcmDicomDir::countMRDRRefs( DcmDirectoryRecord *startRec, + ItemOffset *refCounter, + const unsigned long numCounters ) +{ + OFCondition l_error = EC_Normal; + if ( refCounter == NULL ) + l_error = EC_IllegalCall; + else if ( startRec != NULL ) + { + unsigned long lastIndex = startRec->cardSub(); + for (unsigned long i = 0; i < lastIndex; i++ ) + { + DcmDirectoryRecord *subRecord = startRec->getSub( i ); + DcmDirectoryRecord *refMRDR = subRecord->lookForReferencedMRDR(); + // friend class + if ( refMRDR != NULL ) + { + unsigned long j; + for ( j = 0; j < numCounters; j++ ) + { + if ( refMRDR == refCounter[ j ].item ) + { + ++refCounter[ j ].fileOffset; // Reference counter + break; + } + } + DCMDATA_DEBUG("DcmDicomDir::countMRDRRefs() MRDR p=" << OFstatic_cast(void *, refMRDR) + << " found, which is " << refMRDR->numberOfReferences << " times referenced and " + << j << " times counted"); + } + countMRDRRefs( subRecord, refCounter, numCounters ); + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmDicomDir::checkMRDRRefCounter( DcmDirectoryRecord *startRec, + ItemOffset *refCounter, + const unsigned long numCounters ) +{ + OFCondition l_error = EC_Normal; + if ( refCounter == NULL ) + l_error = EC_IllegalCall; + else if ( startRec != NULL ) + { + unsigned long lastIndex = startRec->cardSub(); + for (unsigned long i = 0; i < lastIndex; i++ ) + { + DcmDirectoryRecord *subRecord = startRec->getSub( i ); + DcmDirectoryRecord *refMRDR = subRecord->lookForReferencedMRDR(); + // friend class + if ( refMRDR != NULL ) + { + unsigned long j; + for ( j = 0; j < numCounters; j++ ) + { + if ( refMRDR == refCounter[ j ].item ) + { + ++refCounter[ j ].fileOffset; // reference counter + break; + } + } + DCMDATA_DEBUG("DcmDicomDir::checkMRDRRefCounter() MRDR p=" << OFstatic_cast(void *, refMRDR) + << " found, which is " << refMRDR->numberOfReferences << " times referenced and " + << j << " times counted"); + } + OFCondition err1 = checkMRDRRefCounter( subRecord, refCounter, numCounters ); + if ( l_error == EC_Normal && err1 != EC_Normal ) + l_error = err1; // the first error counts + } + } + return l_error; +} + + +// ******************************** + +/* GERMAN COMMENT - PLEASE IGNORE + + Strategie fuer verify (mit autocorrect==OFTrue): + - lege Tabelle an mit Zeigern auf MRDRs und Referenzzaehlern mit der Groesse + getDirRecSeq( getDataset() ).card() + getMRDRSequence().card() + - durchlaufe den Record-Baum und erhoehe bei jedem Auftreten eines + MRDR-Verweises, den entsprechenden Zaehler in obiger Tabelle + - setze in allen MRDRs, auf die laut Tabelle kein Verweis existiert, das + activation flag auf INAKTIV +PENDING: + - ueberpruefe fuer alle inaktiven MRDRs, ob deren referenzierte Dateien + von keinem anderen Record referenziert werden und loesche dann + gegebenenfalls die Dateien + - loesche alle inaktiven MRDRs aus der Sequenz getMRDRSequence() + - uebertrage alle aktiven MRDRs aus der Sequenz getDirRecSeq( getDataset() ) + in die Sequenz getMRDRSequence() + - loesche die gesamte Sequenz getDirRecSeq( getDataset() ), unter Inkaufnahme + eines Datenverlustes: es kann nicht automatisch entschieden werden, an + welche Position innerhalb der Record-Hierearchie die zu loeschenden + Records eingefuegt werden muessen +*/ + +OFCondition DcmDicomDir::verify( OFBool autocorrect ) +{ + errorFlag = EC_Normal; + DcmSequenceOfItems &localDirRecSeq = getDirRecSeq(getDataset()); + unsigned long maxMRDRs = localDirRecSeq.card() + getMRDRSequence().card(); + ItemOffset *refCounter = new ItemOffset[ maxMRDRs ]; + + // create MRDR table for MRDRs from MRDRSeq and from DirRecSeq: + unsigned long i; + for ( i = 0; i < getMRDRSequence().card(); i++ ) + { + DcmDirectoryRecord *rec; + rec = OFstatic_cast(DcmDirectoryRecord *, getMRDRSequence().getItem( i )); + refCounter[i].item = rec; + refCounter[i].fileOffset = 0L; + } + for (unsigned long j = 0; j < localDirRecSeq.card() && i < maxMRDRs; j++ ) + { + DcmDirectoryRecord *rec; + rec = OFstatic_cast(DcmDirectoryRecord *, localDirRecSeq.getItem( j )); + if ( rec->getRecordType() == ERT_Mrdr ) + { + refCounter[i].item = rec; + refCounter[i].fileOffset = 0L; + i++; + } + } +// maxMRDRs = i; // adjust table size to real value + + // count number of references for each MRDR + countMRDRRefs( &getRootRecord(), refCounter, maxMRDRs ); + + // check stored reference counters for correctness + OFCondition err3 = EC_Normal; + for (unsigned long k = 0; k < maxMRDRs; k++ ) + { + DcmDirectoryRecord *refMRDR = OFstatic_cast(DcmDirectoryRecord *, refCounter[k].item); + Uint32 refNum = refMRDR->lookForNumberOfReferences(); // friend + if ( refCounter[k].fileOffset != refNum ) + { + DCMDATA_ERROR("DcmDicomDir::verify() Reference counter of MRDR p=" << OFstatic_cast(void *, refMRDR) + << " has incorrect value=" << refNum << " (must be " << refCounter[k].fileOffset << ")"); + if (refCounter[k].fileOffset==refMRDR->numberOfReferences) + DCMDATA_ERROR("but internal record class value numberOfReferences is correct"); + + if ( autocorrect ) // correct reference counter, friend + refMRDR->setNumberOfReferences( refCounter[k].fileOffset ); + else + err3 = EC_CorruptedData; + } + // set inactivation flag for MRDRs without reference + if ( autocorrect && refCounter[k].fileOffset == 0L ) + refMRDR->setRecordInUseFlag( 0xffff ); + } + + delete[] refCounter; + OFCondition err1 = getDirFileFormat().verify( autocorrect ); + OFCondition err2 = getRootRecord().verify( OFFalse ); // no automatic correction + if ( errorFlag == EC_Normal && ( err1 != EC_Normal || err2 != EC_Normal || err3 != EC_Normal ) ) + errorFlag = EC_CorruptedData; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcdicent.cc b/dcmdata/libsrc/dcdicent.cc new file mode 100644 index 00000000..3584f761 --- /dev/null +++ b/dcmdata/libsrc/dcdicent.cc @@ -0,0 +1,176 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: a dictionary entry in the loadable DICOM data dictionary + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dcdicent.h" +#include "dcmtk/ofstd/ofstd.h" + +/* +** DcmDictEntry member functions +*/ + +static +char* strdup_new(const char* str) +{ + char* s = NULL; + if (str != NULL) { + size_t len = strlen(str)+1; + s = new char[len]; + OFStandard::strlcpy(s, str, len); + } + return s; +} + +DcmDictEntry::DcmDictEntry(Uint16 g, Uint16 e, DcmVR vr, + const char* nam, int vmMin, int vmMax, + const char* vers, OFBool doCopyStrings, + const char* pcreator) + : DcmTagKey(g,e), + upperKey(), + valueRepresentation(EVR_UNKNOWN), + tagName(nam), + valueMultiplicityMin(vmMin), + valueMultiplicityMax(vmMax), + standardVersion(vers), + stringsAreCopies(doCopyStrings), + groupRangeRestriction(DcmDictRange_Unspecified), + elementRangeRestriction(DcmDictRange_Unspecified), + privateCreator(pcreator) +{ + upperKey.set(g,e); /* default: make upper key same as normal key */ + valueRepresentation.setVR(vr); + if (doCopyStrings) { + tagName = strdup_new(nam); + standardVersion = strdup_new(vers); + privateCreator = strdup_new(pcreator); + } +} + +DcmDictEntry::DcmDictEntry(Uint16 g, Uint16 e, Uint16 ug, Uint16 ue, DcmVR vr, + const char* nam, int vmMin, int vmMax, + const char* vers, OFBool doCopyStrings, + const char* pcreator) + : DcmTagKey(g,e), + upperKey(), + valueRepresentation(EVR_UNKNOWN), + tagName(nam), + valueMultiplicityMin(vmMin), + valueMultiplicityMax(vmMax), + standardVersion(vers), + stringsAreCopies(doCopyStrings), + groupRangeRestriction(DcmDictRange_Unspecified), + elementRangeRestriction(DcmDictRange_Unspecified), + privateCreator(pcreator) +{ + upperKey.set(ug, ue); + valueRepresentation.setVR(vr); + if (doCopyStrings) { + tagName = strdup_new(nam); + standardVersion = strdup_new(vers); + privateCreator = strdup_new(pcreator); + } +} + +DcmDictEntry::DcmDictEntry(const DcmDictEntry& e) + : DcmTagKey(e), + upperKey(e.upperKey), + valueRepresentation(e.valueRepresentation), + tagName(e.tagName), + valueMultiplicityMin(e.valueMultiplicityMin), + valueMultiplicityMax(e.valueMultiplicityMax), + standardVersion(e.standardVersion), + stringsAreCopies(e.stringsAreCopies), + groupRangeRestriction(e.groupRangeRestriction), + elementRangeRestriction(e.elementRangeRestriction), + privateCreator(e.privateCreator) +{ + if (stringsAreCopies) + { + tagName = strdup_new(e.tagName); + standardVersion = strdup_new(e.standardVersion); + privateCreator = strdup_new(e.privateCreator); + } +} + + +DcmDictEntry::~DcmDictEntry() +{ + if (stringsAreCopies) { + /* we have allocated them so it is ok to deallocate them */ + delete[] OFconst_cast(char *, tagName); + delete[] OFconst_cast(char *, standardVersion); + delete[] OFconst_cast(char *, privateCreator); + } +} + +/* +** DcmDictEntry friend functions +*/ + +STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& s, const DcmDictEntry& e) { + + const DcmDictEntry* ep = &e; + if (ep == NULL) { + s << "(nil)"; + return s; + } + + char tagBuf[16]; + + sprintf(tagBuf, "(%04x", e.getGroup()); + s << tagBuf; + if (e.isRepeatingGroup()) { + sprintf(tagBuf, "-%04x", e.getUpperGroup()); + s << tagBuf; + } + sprintf(tagBuf, ",%04x", e.getElement()); + s << tagBuf; + if (e.isRepeatingElement()) { + sprintf(tagBuf, "-%04x", e.getUpperElement()); + s << tagBuf; + } + s << ")"; + + + s << " " << e.getVR().getVRName() << " \"" << e.getTagName() << "\" "; + if (e.isFixedSingleVM()) { + s << "vm=" << e.getVMMax() << " "; + } else if (e.isVariableRangeVM()) { + s << "vm=" << e.getVMMin() << "-n "; + } else if (e.isFixedRangeVM()){ + s << "vm=" << e.getVMMin() << "-" << e.getVMMax() << " "; + } else { + s << "vm=?(" << e.getVMMin() << "-" << e.getVMMax() << ")? "; + } + if (e.getStandardVersion() != NULL) { + s << " Version=\"" << e.getStandardVersion() << "\" "; + } + if (e.getPrivateCreator() != NULL) { + s << " priv=\"" << e.getPrivateCreator() << "\" "; + } + + return s; +} diff --git a/dcmdata/libsrc/dcdict.cc b/dcmdata/libsrc/dcdict.cc new file mode 100644 index 00000000..5f8357fc --- /dev/null +++ b/dcmdata/libsrc/dcdict.cc @@ -0,0 +1,902 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: loadable DICOM data dictionary + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/ofstd/ofdefine.h" +#include "dcmtk/dcmdata/dcdicent.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/offile.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +/* +** The separator character between fields in the data dictionary file(s) +*/ +#define DCM_DICT_FIELD_SEPARATOR_CHAR '\t' + +/* +** Comment character for the data dictionary file(s) +*/ +#define DCM_DICT_COMMENT_CHAR '#' + +/* +** THE Global DICOM Data Dictionary +*/ + +GlobalDcmDataDictionary dcmDataDict; + + +/* +** Member Functions +*/ + +static DcmDictEntry* +makeSkelEntry(Uint16 group, Uint16 element, + Uint16 upperGroup, Uint16 upperElement, + DcmEVR evr, const char* tagName, int vmMin, int vmMax, + const char* standardVersion, + DcmDictRangeRestriction groupRestriction, + DcmDictRangeRestriction elementRestriction, + const char* privCreator) +{ + DcmDictEntry* e = NULL; + e = new DcmDictEntry(group, element, upperGroup, upperElement, evr, + tagName, vmMin, vmMax, standardVersion, OFFalse, privCreator); + if (e != NULL) { + e->setGroupRangeRestriction(groupRestriction); + e->setElementRangeRestriction(elementRestriction); + } + return e; +} + + +OFBool DcmDataDictionary::loadSkeletonDictionary() +{ + /* + ** We need to know about Group Lengths to compute them + */ + DcmDictEntry* e = NULL; + e = makeSkelEntry(0x0000, 0x0000, 0xffff, 0x0000, + EVR_UL, "GenericGroupLength", 1, 1, "GENERIC", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, NULL); + addEntry(e); + + /* + ** We need to know about Items and Delimitation Items to parse + ** (and construct) sequences. + */ + e = makeSkelEntry(0xfffe, 0xe000, 0xfffe, 0xe000, + EVR_na, "Item", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, NULL); + addEntry(e); + e = makeSkelEntry(0xfffe, 0xe00d, 0xfffe, 0xe00d, + EVR_na, "ItemDelimitationItem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, NULL); + addEntry(e); + e = makeSkelEntry(0xfffe, 0xe0dd, 0xfffe, 0xe0dd, + EVR_na, "SequenceDelimitationItem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, NULL); + addEntry(e); + + skeletonCount = numberOfEntries(); + return OFTrue; +} + + +DcmDataDictionary::DcmDataDictionary(OFBool loadBuiltin, OFBool loadExternal) + : hashDict(), + repDict(), + skeletonCount(0), + dictionaryLoaded(OFFalse) +{ + /* Make sure any DCMDICTPATH dictionary is loaded even if loading + * of external (default) dictionary is not enabled. + */ + if (!loadExternal) + { + const char* env = getenv(DCM_DICT_ENVIRONMENT_VARIABLE); + if ((env != NULL) && (strlen(env) != 0)) + loadExternal = OFTrue; + } + reloadDictionaries(loadBuiltin, loadExternal); +} + +DcmDataDictionary::~DcmDataDictionary() +{ + clear(); +} + + +void DcmDataDictionary::clear() +{ + hashDict.clear(); + repDict.clear(); + skeletonCount = 0; + dictionaryLoaded = OFFalse; +} + + +static void +stripWhitespace(char* s) +{ + if (s) + { + unsigned char c; + unsigned char *t; + unsigned char *p; + t=p=OFreinterpret_cast(unsigned char *, s); + while ((c = *t++)) if (!isspace(c)) *p++ = c; + *p = '\0'; + } +} + +static char* +stripTrailingWhitespace(char* s) +{ + if (s == NULL) return s; + for + ( + char* it = s + strlen(s) - 1; + it >= s && isspace(OFstatic_cast(unsigned char, *it)); + *it-- = '\0' + ); + return s; +} + +static void +stripLeadingWhitespace(char* s) +{ + if (s) + { + unsigned char c; + unsigned char *t; + unsigned char *p; + t=p=OFreinterpret_cast(unsigned char *, s); + while (isspace(*t)) t++; + while ((c = *t++)) *p++ = c; + *p = '\0'; + } +} + +static OFBool +parseVMField(char* vmField, int& vmMin, int& vmMax) +{ + OFBool ok = OFTrue; + char c = 0; + int dummy = 0; + + /* strip any whitespace */ + stripWhitespace(vmField); + + if (sscanf(vmField, "%d-%d%c", &vmMin, &dummy, &c) == 3) { + /* treat "2-2n" like "2-n" for the moment */ + if ((c == 'n') || (c == 'N')) { + vmMax = DcmVariableVM; + } else { + ok = OFFalse; + } + } else if (sscanf(vmField, "%d-%d", &vmMin, &vmMax) == 2) { + /* range VM (e.g. "2-6") */ + } else if (sscanf(vmField, "%d-%c", &vmMin, &c) == 2) { + if ((c == 'n') || (c == 'N')) { + vmMax = DcmVariableVM; + } else { + ok = OFFalse; + } + } else if (sscanf(vmField, "%d%c", &vmMin, &c) == 2) { + /* treat "2n" like "2-n" for the moment */ + if ((c == 'n') || (c == 'N')) { + vmMax = DcmVariableVM; + } else { + ok = OFFalse; + } + } else if (sscanf(vmField, "%d", &vmMin) == 1) { + /* fixed VM */ + vmMax = vmMin; + } else if (sscanf(vmField, "%c", &c) == 1) { + /* treat "n" like "1-n" */ + if ((c == 'n') || (c == 'N')) { + vmMin = 1; + vmMax = DcmVariableVM; + } else { + ok = OFFalse; + } + } else { + ok = OFFalse; + } + return ok; +} + +static int +splitFields(const char* line, char* fields[], int maxFields, char splitChar) +{ + const char *p; + int foundFields = 0; + size_t len; + + do { +#ifdef __BORLANDC__ + // Borland Builder expects a non-const argument + p = strchr(OFconst_cast(char *, line), splitChar); +#else + p = strchr(line, splitChar); +#endif + if (p == NULL) { + len = strlen(line); + } else { + len = p - line; + } + fields[foundFields] = OFstatic_cast(char *, malloc(len + 1)); + OFStandard::strlcpy(fields[foundFields], line, len+1); + fields[foundFields][len] = '\0'; + foundFields++; + line = p + 1; + } while ((foundFields < maxFields) && (p != NULL)); + + return foundFields; +} + +static OFBool +parseTagPart(char *s, unsigned int& l, unsigned int& h, + DcmDictRangeRestriction& r) +{ + OFBool ok = OFTrue; + char restrictor = ' '; + + r = DcmDictRange_Unspecified; /* by default */ + + if (sscanf(s, "%x-%c-%x", &l, &restrictor, &h) == 3) { + switch (restrictor) { + case 'o': + case 'O': + r = DcmDictRange_Odd; + break; + case 'e': + case 'E': + r = DcmDictRange_Even; + break; + case 'u': + case 'U': + r = DcmDictRange_Unspecified; + break; + default: + DCMDATA_ERROR("DcmDataDictionary: Unknown range restrictor: " << restrictor); + ok = OFFalse; + break; + } + } else if (sscanf(s, "%x-%x", &l, &h) == 2) { + r = DcmDictRange_Even; /* by default */ + } else if (sscanf(s, "%x", &l) == 1) { + h = l; + } else { + ok = OFFalse; + } + return ok; +} + +static OFBool +parseWholeTagField(char* s, DcmTagKey& key, + DcmTagKey& upperKey, + DcmDictRangeRestriction& groupRestriction, + DcmDictRangeRestriction& elementRestriction, + char *&privCreator) +{ + unsigned int gl, gh, el, eh; + groupRestriction = DcmDictRange_Unspecified; + elementRestriction = DcmDictRange_Unspecified; + + stripLeadingWhitespace(s); + stripTrailingWhitespace(s); + + char gs[64]; + char es[64]; + char pc[64]; + size_t slen = strlen(s); + + if (s[0] != '(') return OFFalse; + if (s[slen - 1] != ')') return OFFalse; + if (strchr(s, ',') == NULL) return OFFalse; + + /* separate the group and element parts */ + int i = 1; /* after the '(' */ + int gi = 0; + for (; s[i] != ',' && s[i] != '\0'; i++) + { + gs[gi] = s[i]; + gi++; + } + gs[gi] = '\0'; + + if (s[i] == '\0') return OFFalse; /* element part missing */ + i++; /* after the ',' */ + + stripLeadingWhitespace(s + i); + + int pi = 0; + if (s[i] == '\"') /* private creator */ + { + i++; // skip opening quotation mark + for (; s[i] != '\"' && s[i] != '\0'; i++) pc[pi++] = s[i]; + pc[pi] = '\0'; + if (s[i] == '\0') return OFFalse; /* closing quotation mark missing */ + i++; + stripLeadingWhitespace(s + i); + if (s[i] != ',') return OFFalse; /* element part missing */ + i++; /* after the ',' */ + } + + int ei = 0; + for (; s[i] != ')' && s[i] != '\0'; i++) { + es[ei] = s[i]; + ei++; + } + es[ei] = '\0'; + + /* parse the tag parts into their components */ + stripWhitespace(gs); + if (parseTagPart(gs, gl, gh, groupRestriction) == OFFalse) + return OFFalse; + + stripWhitespace(es); + if (parseTagPart(es, el, eh, elementRestriction) == OFFalse) + return OFFalse; + + if (pi > 0) + { + // copy private creator name + size_t buflen = strlen(pc) + 1; + privCreator = new char[buflen]; // deleted by caller + if (privCreator) OFStandard::strlcpy(privCreator, pc, buflen); + } + + key.set(OFstatic_cast(unsigned short, gl), OFstatic_cast(unsigned short, el)); + upperKey.set(OFstatic_cast(unsigned short, gh), OFstatic_cast(unsigned short, eh)); + + return OFTrue; +} + +static OFBool +onlyWhitespace(const char* s) +{ + size_t len = strlen(s); + int charsFound = OFFalse; + + for (size_t i = 0; (!charsFound) && (i < len); ++i) { + charsFound = !isspace(OFstatic_cast(unsigned char, s[i])); + } + return (!charsFound)? (OFTrue) : (OFFalse); +} + +static char* +getLine(char* line, int maxLineLen, FILE* f) +{ + char* s; + + s = fgets(line, maxLineLen, f); + + /* strip any trailing white space */ + stripTrailingWhitespace(line); + + return s; +} + +static OFBool +isaCommentLine(const char* s) +{ + OFBool isComment = OFFalse; /* assumption */ + size_t len = strlen(s); + size_t i = 0; + for (i = 0; i < len && isspace(OFstatic_cast(unsigned char, s[i])); ++i) /*loop*/; + isComment = (s[i] == DCM_DICT_COMMENT_CHAR); + return isComment; +} + +OFBool +DcmDataDictionary::reloadDictionaries(OFBool loadBuiltin, OFBool loadExternal) +{ + OFBool result = OFTrue; + clear(); + loadSkeletonDictionary(); + if (loadBuiltin) { + loadBuiltinDictionary(); + dictionaryLoaded = (numberOfEntries() > skeletonCount); + if (!dictionaryLoaded) result = OFFalse; + } + if (loadExternal) { + if (loadExternalDictionaries()) + dictionaryLoaded = OFTrue; + else + result = OFFalse; + } + return result; +} + +OFBool +DcmDataDictionary::loadDictionary(const char* fileName, OFBool errorIfAbsent) +{ + + char lineBuf[DCM_MAXDICTLINESIZE + 1]; + FILE* f = NULL; + int lineNumber = 0; + char* lineFields[DCM_MAXDICTFIELDS + 1]; + int fieldsPresent; + DcmDictEntry* e; + int errorsEncountered = 0; + OFBool errorOnThisLine = OFFalse; + int i; + + DcmTagKey key, upperKey; + DcmDictRangeRestriction groupRestriction = DcmDictRange_Unspecified; + DcmDictRangeRestriction elementRestriction = DcmDictRange_Unspecified; + DcmVR vr; + char* vrName; + char* tagName; + char* privCreator; + int vmMin, vmMax = 1; + const char* standardVersion; + + /* first, check whether 'fileName' really points to a file (and not to a directory or the like) */ + if (!OFStandard::fileExists(fileName) || (f = fopen(fileName, "r")) == NULL) { + if (errorIfAbsent) { + DCMDATA_ERROR("DcmDataDictionary: Cannot open file: " << fileName); + } + return OFFalse; + } + + DCMDATA_DEBUG("DcmDataDictionary: Loading file: " << fileName); + + while (getLine(lineBuf, DCM_MAXDICTLINESIZE, f)) { + lineNumber++; + + if (onlyWhitespace(lineBuf)) { + continue; /* ignore this line */ + } + if (isaCommentLine(lineBuf)) { + continue; /* ignore this line */ + } + + errorOnThisLine = OFFalse; + + /* fields are tab separated */ + fieldsPresent = splitFields(lineBuf, lineFields, + DCM_MAXDICTFIELDS, + DCM_DICT_FIELD_SEPARATOR_CHAR); + + /* initialize dict entry fields */ + vrName = NULL; + tagName = NULL; + privCreator = NULL; + vmMin = vmMax = 1; + standardVersion = "DICOM"; + + switch (fieldsPresent) { + case 0: + case 1: + case 2: + DCMDATA_ERROR("DcmDataDictionary: "<< fileName << ": " + << "too few fields (line " << lineNumber << ")"); + errorOnThisLine = OFTrue; + break; + default: + DCMDATA_ERROR("DcmDataDictionary: " << fileName << ": " + << "too many fields (line " << lineNumber << "): "); + errorOnThisLine = OFTrue; + break; + case 5: + stripWhitespace(lineFields[4]); + standardVersion = lineFields[4]; + /* drop through to next case label */ + case 4: + /* the VM field is present */ + if (!parseVMField(lineFields[3], vmMin, vmMax)) { + DCMDATA_ERROR("DcmDataDictionary: " << fileName << ": " + << "bad VM field (line " << lineNumber << "): " << lineFields[3]); + errorOnThisLine = OFTrue; + } + /* drop through to next case label */ + case 3: + if (!parseWholeTagField(lineFields[0], key, upperKey, + groupRestriction, elementRestriction, privCreator)) + { + DCMDATA_ERROR("DcmDataDictionary: " << fileName << ": " + << "bad Tag field (line " << lineNumber << "): " << lineFields[0]); + errorOnThisLine = OFTrue; + } else { + /* all is OK */ + vrName = lineFields[1]; + stripWhitespace(vrName); + + tagName = lineFields[2]; + stripWhitespace(tagName); + } + } + + if (!errorOnThisLine) { + /* check the VR Field */ + vr.setVR(vrName); + if (vr.getEVR() == EVR_UNKNOWN) { + DCMDATA_ERROR("DcmDataDictionary: " << fileName << ": " + << "bad VR field (line " << lineNumber << "): " << vrName); + errorOnThisLine = OFTrue; + } + } + + if (!errorOnThisLine) { + e = new DcmDictEntry( + key.getGroup(), key.getElement(), + upperKey.getGroup(), upperKey.getElement(), + vr, tagName, vmMin, vmMax, standardVersion, OFTrue, + privCreator); + + e->setGroupRangeRestriction(groupRestriction); + e->setElementRangeRestriction(elementRestriction); + addEntry(e); + } + + for (i = 0; i < fieldsPresent; i++) { + free(lineFields[i]); + lineFields[i] = NULL; + } + + delete[] privCreator; + + if (errorOnThisLine) { + errorsEncountered++; + } + } + + fclose(f); + + /* return OFFalse in case of errors and set internal state accordingly */ + if (errorsEncountered == 0) { + dictionaryLoaded = OFTrue; + return OFTrue; + } + else { + dictionaryLoaded = OFFalse; + return OFFalse; + } +} + +#ifndef HAVE_GETENV + +static +char* getenv() { + return NULL; +} + +#endif /* !HAVE_GETENV */ + + + +OFBool +DcmDataDictionary::loadExternalDictionaries() +{ + const char* env = NULL; + size_t len; + int sepCnt = 0; + OFBool msgIfDictAbsent = OFTrue; + OFBool loadFailed = OFFalse; + + env = getenv(DCM_DICT_ENVIRONMENT_VARIABLE); + if ((env == NULL) || (strlen(env) == 0)) { + env = DCM_DICT_DEFAULT_PATH; + msgIfDictAbsent = OFFalse; + } + + if ((env != NULL) && (strlen(env) != 0)) { + len = strlen(env); + for (size_t i = 0; i < len; ++i) { + if (env[i] == ENVIRONMENT_PATH_SEPARATOR) { + sepCnt++; + } + } + + if (sepCnt == 0) { + if (!loadDictionary(env, msgIfDictAbsent)) { + return OFFalse; + } + } else { + char** dictArray; + + dictArray = OFstatic_cast(char **, malloc((sepCnt + 1) * sizeof(char*))); + + int ndicts = splitFields(env, dictArray, sepCnt + 1, + ENVIRONMENT_PATH_SEPARATOR); + + for (int ii = 0; ii < ndicts; ii++) { + if ((dictArray[ii] != NULL) && (strlen(dictArray[ii]) > 0)) { + if (!loadDictionary(dictArray[ii], msgIfDictAbsent)) { + loadFailed = OFTrue; + } + } + free(dictArray[ii]); + } + free(dictArray); + } + } + + return (loadFailed) ? (OFFalse) : (OFTrue); +} + + +void +DcmDataDictionary::addEntry(DcmDictEntry* e) +{ + if (e->isRepeating()) { + /* + * Find the best position in repeating tag list + * Existing entries are replaced if the ranges and repetition + * constraints are the same. + * If a range represents a subset of an existing range then it + * will be placed before it in the list. This ensures that a + * search will find the subset rather than the superset. + * Otherwise entries are appended to the end of the list. + */ + OFBool inserted = OFFalse; + + DcmDictEntryListIterator iter(repDict.begin()); + DcmDictEntryListIterator last(repDict.end()); + for (; !inserted && iter != last; ++iter) { + if (e->setEQ(**iter)) { + /* replace the old entry with the new */ + DcmDictEntry *old = *iter; + *iter = e; +#ifdef PRINT_REPLACED_DICTIONARY_ENTRIES + DCMDATA_WARN("replacing " << *old); +#endif + delete old; + inserted = OFTrue; + } else if (e->subset(**iter)) { + /* e is a subset of the current list position, insert before */ + repDict.insert(iter, e); + inserted = OFTrue; + } + } + if (!inserted) { + /* insert at end */ + repDict.push_back(e); + inserted = OFTrue; + } + } else { + hashDict.put(e); + } +} + +void +DcmDataDictionary::deleteEntry(const DcmDictEntry& entry) +{ + DcmDictEntry* e = NULL; + e = OFconst_cast(DcmDictEntry *, findEntry(entry)); + if (e != NULL) { + if (e->isRepeating()) { + repDict.remove(e); + delete e; + } else { + hashDict.del(entry.getKey(), entry.getPrivateCreator()); + } + } +} + +const DcmDictEntry* +DcmDataDictionary::findEntry(const DcmDictEntry& entry) const +{ + const DcmDictEntry* e = NULL; + + if (entry.isRepeating()) { + OFBool found = OFFalse; + DcmDictEntryListConstIterator iter(repDict.begin()); + DcmDictEntryListConstIterator last(repDict.end()); + for (; !found && iter != last; ++iter) { + if (entry.setEQ(**iter)) { + found = OFTrue; + e = *iter; + } + } + } else { + e = hashDict.get(entry, entry.getPrivateCreator()); + } + return e; +} + +const DcmDictEntry* +DcmDataDictionary::findEntry(const DcmTagKey& key, const char *privCreator) const +{ + /* search first in the normal tags dictionary and if not found + * then search in the repeating tags list. + */ + const DcmDictEntry* e = NULL; + + e = hashDict.get(key, privCreator); + if (e == NULL) { + /* search in the repeating tags dictionary */ + OFBool found = OFFalse; + DcmDictEntryListConstIterator iter(repDict.begin()); + DcmDictEntryListConstIterator last(repDict.end()); + for (; !found && iter != last; ++iter) { + if ((*iter)->contains(key, privCreator)) { + found = OFTrue; + e = *iter; + } + } + } + return e; +} + +const DcmDictEntry* +DcmDataDictionary::findEntry(const char *name) const +{ + const DcmDictEntry* e = NULL; + const DcmDictEntry* ePrivate = NULL; + + /* search first in the normal tags dictionary and if not found + * then search in the repeating tags list. + */ + DcmHashDictIterator iter; + for (iter = hashDict.begin(); (e == NULL) && (iter != hashDict.end()); ++iter) { + if ((*iter)->contains(name)) { + e = *iter; + if (e->getGroup() % 2) + { + /* tag is a private tag - continue search to be sure to find non-private keys first */ + if (!ePrivate) ePrivate = e; + e = NULL; + } + } + } + + if (e == NULL) { + /* search in the repeating tags dictionary */ + OFBool found = OFFalse; + DcmDictEntryListConstIterator iter2(repDict.begin()); + DcmDictEntryListConstIterator last(repDict.end()); + for (; !found && iter2 != last; ++iter2) { + if ((*iter2)->contains(name)) { + found = OFTrue; + e = *iter2; + } + } + } + + if (e == NULL && ePrivate != NULL) { + /* no standard key found - use the first private key found */ + e = ePrivate; + } + + return e; +} + + +/* ================================================================== */ + + +GlobalDcmDataDictionary::GlobalDcmDataDictionary() + : dataDict(NULL) +#ifdef WITH_THREADS + , dataDictLock() +#endif +{ +} + +GlobalDcmDataDictionary::~GlobalDcmDataDictionary() +{ + /* No threads may be active any more, so no locking needed */ + delete dataDict; +} + +void GlobalDcmDataDictionary::createDataDict() +{ + /* Make sure only one thread tries to initialize the dictionary */ +#ifdef WITH_THREADS + dataDictLock.wrlock(); +#endif + +#ifdef DONT_LOAD_EXTERNAL_DICTIONARIES + #error "The macro DONT_LOAD_EXTERNAL_DICTIONARIES has been defined in older versions of DCMTK. Undefine ENABLE_EXTERNAL_DICTIONARY instead." +#endif + +#ifdef ENABLE_EXTERNAL_DICTIONARY + const OFBool loadExternal = OFTrue; +#else + const OFBool loadExternal = OFFalse; +#endif + /* Make sure no other thread managed to create the dictionary + * before we got our write lock. */ + if (!dataDict) + dataDict = new DcmDataDictionary(OFTrue /*loadBuiltin*/, loadExternal); +#ifdef WITH_THREADS + dataDictLock.wrunlock(); +#endif +} + +const DcmDataDictionary& GlobalDcmDataDictionary::rdlock() +{ +#ifdef WITH_THREADS + dataDictLock.rdlock(); +#endif + if (!dataDict) + { + /* dataDictLock must not be locked during createDataDict() */ +#ifdef WITH_THREADS + dataDictLock.rdunlock(); +#endif + createDataDict(); +#ifdef WITH_THREADS + dataDictLock.rdlock(); +#endif + } + return *dataDict; +} + +DcmDataDictionary& GlobalDcmDataDictionary::wrlock() +{ +#ifdef WITH_THREADS + dataDictLock.wrlock(); +#endif + if (!dataDict) + { + /* dataDictLock must not be locked during createDataDict() */ +#ifdef WITH_THREADS + dataDictLock.wrunlock(); +#endif + createDataDict(); +#ifdef WITH_THREADS + dataDictLock.wrlock(); +#endif + } + return *dataDict; +} + +void GlobalDcmDataDictionary::rdunlock() +{ +#ifdef WITH_THREADS + dataDictLock.rdunlock(); +#endif +} + +void GlobalDcmDataDictionary::wrunlock() +{ +#ifdef WITH_THREADS + dataDictLock.wrunlock(); +#endif +} + +OFBool GlobalDcmDataDictionary::isDictionaryLoaded() +{ + OFBool result = rdlock().isDictionaryLoaded(); + rdunlock(); + return result; +} + +void GlobalDcmDataDictionary::clear() +{ + wrlock().clear(); + wrunlock(); +} diff --git a/dcmdata/libsrc/dcdictbi.cc b/dcmdata/libsrc/dcdictbi.cc new file mode 100644 index 00000000..e757906c --- /dev/null +++ b/dcmdata/libsrc/dcdictbi.cc @@ -0,0 +1,30664 @@ +/* +** DO NOT EDIT THIS FILE !!! +** It was generated automatically by: +** +** User: joergr +** Host: thinkpad +** Date: 2019-08-07 18:58:15 +** Prog: /home/joergr/Source/dcmtk-full/public/dcmdata/libsrc/mkdictbi +** +** From: ../data/dicom.dic +** ../data/private.dic +** +*/ + +#include "dcmtk/dcmdata/dcdict.h" +#ifdef ENABLE_BUILTIN_DICTIONARY +#include "dcmtk/dcmdata/dcdicent.h" + +struct DBI_SimpleEntry { + Uint16 group; + Uint16 element; + Uint16 upperGroup; + Uint16 upperElement; + DcmEVR evr; + const char* tagName; + int vmMin; + int vmMax; + const char* standardVersion; + DcmDictRangeRestriction groupRestriction; + DcmDictRangeRestriction elementRestriction; + const char* privateCreator; +}; + +static const DBI_SimpleEntry simpleBuiltinDict[] = { + { 0x0000, 0x0000, 0x0000, 0x0000, + EVR_UL, "CommandGroupLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0001, 0x0000, 0x0001, + EVR_UL, "RETIRED_CommandLengthToEnd", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0002, 0x0000, 0x0002, + EVR_UI, "AffectedSOPClassUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0003, 0x0000, 0x0003, + EVR_UI, "RequestedSOPClassUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0010, 0x0000, 0x0010, + EVR_SH, "RETIRED_CommandRecognitionCode", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0100, 0x0000, 0x0100, + EVR_US, "CommandField", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0110, 0x0000, 0x0110, + EVR_US, "MessageID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0120, 0x0000, 0x0120, + EVR_US, "MessageIDBeingRespondedTo", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0200, 0x0000, 0x0200, + EVR_AE, "RETIRED_Initiator", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0300, 0x0000, 0x0300, + EVR_AE, "RETIRED_Receiver", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0400, 0x0000, 0x0400, + EVR_AE, "RETIRED_FindLocation", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0600, 0x0000, 0x0600, + EVR_AE, "MoveDestination", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0700, 0x0000, 0x0700, + EVR_US, "Priority", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0800, 0x0000, 0x0800, + EVR_US, "CommandDataSetType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0850, 0x0000, 0x0850, + EVR_US, "RETIRED_NumberOfMatches", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0860, 0x0000, 0x0860, + EVR_US, "RETIRED_ResponseSequenceNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0900, 0x0000, 0x0900, + EVR_US, "Status", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0901, 0x0000, 0x0901, + EVR_AT, "OffendingElement", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0902, 0x0000, 0x0902, + EVR_LO, "ErrorComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0903, 0x0000, 0x0903, + EVR_US, "ErrorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1000, 0x0000, 0x1000, + EVR_UI, "AffectedSOPInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1001, 0x0000, 0x1001, + EVR_UI, "RequestedSOPInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1002, 0x0000, 0x1002, + EVR_US, "EventTypeID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1005, 0x0000, 0x1005, + EVR_AT, "AttributeIdentifierList", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1008, 0x0000, 0x1008, + EVR_US, "ActionTypeID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1020, 0x0000, 0x1020, + EVR_US, "NumberOfRemainingSuboperations", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1021, 0x0000, 0x1021, + EVR_US, "NumberOfCompletedSuboperations", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1022, 0x0000, 0x1022, + EVR_US, "NumberOfFailedSuboperations", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1023, 0x0000, 0x1023, + EVR_US, "NumberOfWarningSuboperations", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1030, 0x0000, 0x1030, + EVR_AE, "MoveOriginatorApplicationEntityTitle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x1031, 0x0000, 0x1031, + EVR_US, "MoveOriginatorMessageID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x4000, 0x0000, 0x4000, + EVR_LT, "RETIRED_DialogReceiver", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x4010, 0x0000, 0x4010, + EVR_LT, "RETIRED_TerminalType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5010, 0x0000, 0x5010, + EVR_SH, "RETIRED_MessageSetID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5020, 0x0000, 0x5020, + EVR_SH, "RETIRED_EndMessageID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5110, 0x0000, 0x5110, + EVR_LT, "RETIRED_DisplayFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5120, 0x0000, 0x5120, + EVR_LT, "RETIRED_PagePositionID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5130, 0x0000, 0x5130, + EVR_CS, "RETIRED_TextFormatID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5140, 0x0000, 0x5140, + EVR_CS, "RETIRED_NormalReverse", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5150, 0x0000, 0x5150, + EVR_CS, "RETIRED_AddGrayScale", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5160, 0x0000, 0x5160, + EVR_CS, "RETIRED_Borders", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5170, 0x0000, 0x5170, + EVR_IS, "RETIRED_Copies", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5180, 0x0000, 0x5180, + EVR_CS, "RETIRED_CommandMagnificationType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x5190, 0x0000, 0x5190, + EVR_CS, "RETIRED_Erase", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x51a0, 0x0000, 0x51a0, + EVR_CS, "RETIRED_Print", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x51b0, 0x0000, 0x51b0, + EVR_US, "RETIRED_Overlays", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0000, 0x0002, 0x0000, + EVR_UL, "FileMetaInformationGroupLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0001, 0x0002, 0x0001, + EVR_OB, "FileMetaInformationVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0002, 0x0002, 0x0002, + EVR_UI, "MediaStorageSOPClassUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0003, 0x0002, 0x0003, + EVR_UI, "MediaStorageSOPInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0010, 0x0002, 0x0010, + EVR_UI, "TransferSyntaxUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0012, 0x0002, 0x0012, + EVR_UI, "ImplementationClassUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0013, 0x0002, 0x0013, + EVR_SH, "ImplementationVersionName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0016, 0x0002, 0x0016, + EVR_AE, "SourceApplicationEntityTitle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0017, 0x0002, 0x0017, + EVR_AE, "SendingApplicationEntityTitle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0018, 0x0002, 0x0018, + EVR_AE, "ReceivingApplicationEntityTitle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0100, 0x0002, 0x0100, + EVR_UI, "PrivateInformationCreatorUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0002, 0x0102, 0x0002, 0x0102, + EVR_OB, "PrivateInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0003, 0x0000, 0x0003, 0x0000, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AEGIS_DICOM_2.00" } + , { 0x0003, 0x0008, 0x0003, 0x0008, + EVR_US, "ISICommandField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0003, 0x0011, 0x0003, 0x0011, + EVR_US, "AttachIDApplicationCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0003, 0x0012, 0x0003, 0x0012, + EVR_UL, "AttachIDMessageCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0003, 0x0013, 0x0003, 0x0013, + EVR_DA, "AttachIDDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0003, 0x0014, 0x0003, 0x0014, + EVR_TM, "AttachIDTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0003, 0x0020, 0x0003, 0x0020, + EVR_US, "MessageType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0003, 0x0030, 0x0003, 0x0030, + EVR_DA, "MaxWaitingDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0003, 0x0031, 0x0003, 0x0031, + EVR_TM, "MaxWaitingTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } +#endif + , { 0x0004, 0x1130, 0x0004, 0x1130, + EVR_CS, "FileSetID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1141, 0x0004, 0x1141, + EVR_CS, "FileSetDescriptorFileID", 1, 8, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1142, 0x0004, 0x1142, + EVR_CS, "SpecificCharacterSetOfFileSetDescriptorFile", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1200, 0x0004, 0x1200, + EVR_up, "OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1202, 0x0004, 0x1202, + EVR_up, "OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1212, 0x0004, 0x1212, + EVR_US, "FileSetConsistencyFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1220, 0x0004, 0x1220, + EVR_SQ, "DirectoryRecordSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1400, 0x0004, 0x1400, + EVR_up, "OffsetOfTheNextDirectoryRecord", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1410, 0x0004, 0x1410, + EVR_US, "RecordInUseFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1420, 0x0004, 0x1420, + EVR_up, "OffsetOfReferencedLowerLevelDirectoryEntity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1430, 0x0004, 0x1430, + EVR_CS, "DirectoryRecordType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1432, 0x0004, 0x1432, + EVR_UI, "PrivateRecordUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1500, 0x0004, 0x1500, + EVR_CS, "ReferencedFileID", 1, 8, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1504, 0x0004, 0x1504, + EVR_up, "RETIRED_MRDRDirectoryRecordOffset", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1510, 0x0004, 0x1510, + EVR_UI, "ReferencedSOPClassUIDInFile", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1511, 0x0004, 0x1511, + EVR_UI, "ReferencedSOPInstanceUIDInFile", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1512, 0x0004, 0x1512, + EVR_UI, "ReferencedTransferSyntaxUIDInFile", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x151a, 0x0004, 0x151a, + EVR_UI, "ReferencedRelatedGeneralSOPClassUIDInFile", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0004, 0x1600, 0x0004, 0x1600, + EVR_UL, "RETIRED_NumberOfReferences", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0005, 0x0000, 0x0005, 0x0000, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AEGIS_DICOM_2.00" } +#endif + , { 0x0008, 0x0001, 0x0008, 0x0001, + EVR_UL, "RETIRED_LengthToEnd", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0005, 0x0008, 0x0005, + EVR_CS, "SpecificCharacterSet", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0006, 0x0008, 0x0006, + EVR_SQ, "LanguageCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0008, 0x0008, 0x0008, + EVR_CS, "ImageType", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0010, 0x0008, 0x0010, + EVR_SH, "RETIRED_RecognitionCode", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0012, 0x0008, 0x0012, + EVR_DA, "InstanceCreationDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0013, 0x0008, 0x0013, + EVR_TM, "InstanceCreationTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0014, 0x0008, 0x0014, + EVR_UI, "InstanceCreatorUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0015, 0x0008, 0x0015, + EVR_DT, "InstanceCoercionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0016, 0x0008, 0x0016, + EVR_UI, "SOPClassUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0018, 0x0008, 0x0018, + EVR_UI, "SOPInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x001a, 0x0008, 0x001a, + EVR_UI, "RelatedGeneralSOPClassUID", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x001b, 0x0008, 0x001b, + EVR_UI, "OriginalSpecializedSOPClassUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0020, 0x0008, 0x0020, + EVR_DA, "StudyDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0021, 0x0008, 0x0021, + EVR_DA, "SeriesDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0022, 0x0008, 0x0022, + EVR_DA, "AcquisitionDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0023, 0x0008, 0x0023, + EVR_DA, "ContentDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0024, 0x0008, 0x0024, + EVR_DA, "RETIRED_OverlayDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0025, 0x0008, 0x0025, + EVR_DA, "RETIRED_CurveDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x002a, 0x0008, 0x002a, + EVR_DT, "AcquisitionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0030, 0x0008, 0x0030, + EVR_TM, "StudyTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0031, 0x0008, 0x0031, + EVR_TM, "SeriesTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0032, 0x0008, 0x0032, + EVR_TM, "AcquisitionTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0033, 0x0008, 0x0033, + EVR_TM, "ContentTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0034, 0x0008, 0x0034, + EVR_TM, "RETIRED_OverlayTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0035, 0x0008, 0x0035, + EVR_TM, "RETIRED_CurveTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0040, 0x0008, 0x0040, + EVR_US, "RETIRED_DataSetType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0041, 0x0008, 0x0041, + EVR_LO, "RETIRED_DataSetSubtype", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0042, 0x0008, 0x0042, + EVR_CS, "RETIRED_NuclearMedicineSeriesType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0050, 0x0008, 0x0050, + EVR_SH, "AccessionNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0051, 0x0008, 0x0051, + EVR_SQ, "IssuerOfAccessionNumberSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0052, 0x0008, 0x0052, + EVR_CS, "QueryRetrieveLevel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0053, 0x0008, 0x0053, + EVR_CS, "QueryRetrieveView", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0054, 0x0008, 0x0054, + EVR_AE, "RetrieveAETitle", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0055, 0x0008, 0x0055, + EVR_AE, "StationAETitle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0056, 0x0008, 0x0056, + EVR_CS, "InstanceAvailability", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0058, 0x0008, 0x0058, + EVR_UI, "FailedSOPInstanceUIDList", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0060, 0x0008, 0x0060, + EVR_CS, "Modality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0061, 0x0008, 0x0061, + EVR_CS, "ModalitiesInStudy", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0062, 0x0008, 0x0062, + EVR_UI, "SOPClassesInStudy", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0063, 0x0008, 0x0063, + EVR_SQ, "AnatomicRegionsInStudyCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0064, 0x0008, 0x0064, + EVR_CS, "ConversionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0068, 0x0008, 0x0068, + EVR_CS, "PresentationIntentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0070, 0x0008, 0x0070, + EVR_LO, "Manufacturer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0080, 0x0008, 0x0080, + EVR_LO, "InstitutionName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0081, 0x0008, 0x0081, + EVR_ST, "InstitutionAddress", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0082, 0x0008, 0x0082, + EVR_SQ, "InstitutionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0090, 0x0008, 0x0090, + EVR_PN, "ReferringPhysicianName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0092, 0x0008, 0x0092, + EVR_ST, "ReferringPhysicianAddress", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0094, 0x0008, 0x0094, + EVR_SH, "ReferringPhysicianTelephoneNumbers", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0096, 0x0008, 0x0096, + EVR_SQ, "ReferringPhysicianIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x009c, 0x0008, 0x009c, + EVR_PN, "ConsultingPhysicianName", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x009d, 0x0008, 0x009d, + EVR_SQ, "ConsultingPhysicianIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0100, 0x0008, 0x0100, + EVR_SH, "CodeValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0101, 0x0008, 0x0101, + EVR_LO, "ExtendedCodeValue", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0102, 0x0008, 0x0102, + EVR_SH, "CodingSchemeDesignator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0103, 0x0008, 0x0103, + EVR_SH, "CodingSchemeVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0104, 0x0008, 0x0104, + EVR_LO, "CodeMeaning", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0105, 0x0008, 0x0105, + EVR_CS, "MappingResource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0106, 0x0008, 0x0106, + EVR_DT, "ContextGroupVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0107, 0x0008, 0x0107, + EVR_DT, "ContextGroupLocalVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0108, 0x0008, 0x0108, + EVR_LT, "ExtendedCodeMeaning", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0109, 0x0008, 0x0109, + EVR_SQ, "CodingSchemeResourcesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x010a, 0x0008, 0x010a, + EVR_CS, "CodingSchemeURLType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x010b, 0x0008, 0x010b, + EVR_CS, "ContextGroupExtensionFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x010c, 0x0008, 0x010c, + EVR_UI, "CodingSchemeUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x010d, 0x0008, 0x010d, + EVR_UI, "ContextGroupExtensionCreatorUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x010e, 0x0008, 0x010e, + EVR_UR, "CodingSchemeURL", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x010f, 0x0008, 0x010f, + EVR_CS, "ContextIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0110, 0x0008, 0x0110, + EVR_SQ, "CodingSchemeIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0112, 0x0008, 0x0112, + EVR_LO, "CodingSchemeRegistry", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0114, 0x0008, 0x0114, + EVR_ST, "CodingSchemeExternalID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0115, 0x0008, 0x0115, + EVR_ST, "CodingSchemeName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0116, 0x0008, 0x0116, + EVR_ST, "CodingSchemeResponsibleOrganization", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0117, 0x0008, 0x0117, + EVR_UI, "ContextUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0118, 0x0008, 0x0118, + EVR_UI, "MappingResourceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0119, 0x0008, 0x0119, + EVR_UC, "LongCodeValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0120, 0x0008, 0x0120, + EVR_UR, "URNCodeValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0121, 0x0008, 0x0121, + EVR_SQ, "EquivalentCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0122, 0x0008, 0x0122, + EVR_LO, "MappingResourceName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0123, 0x0008, 0x0123, + EVR_SQ, "ContextGroupIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0124, 0x0008, 0x0124, + EVR_SQ, "MappingResourceIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0201, 0x0008, 0x0201, + EVR_SH, "TimezoneOffsetFromUTC", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0220, 0x0008, 0x0220, + EVR_SQ, "ResponsibleGroupCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0221, 0x0008, 0x0221, + EVR_CS, "EquipmentModality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0222, 0x0008, 0x0222, + EVR_LO, "ManufacturerRelatedModelGroup", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0300, 0x0008, 0x0300, + EVR_SQ, "PrivateDataElementCharacteristicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0301, 0x0008, 0x0301, + EVR_US, "PrivateGroupReference", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0302, 0x0008, 0x0302, + EVR_LO, "PrivateCreatorReference", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0303, 0x0008, 0x0303, + EVR_CS, "BlockIdentifyingInformationStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0304, 0x0008, 0x0304, + EVR_US, "NonidentifyingPrivateElements", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0305, 0x0008, 0x0305, + EVR_SQ, "DeidentificationActionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0306, 0x0008, 0x0306, + EVR_US, "IdentifyingPrivateElements", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0307, 0x0008, 0x0307, + EVR_CS, "DeidentificationAction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0308, 0x0008, 0x0308, + EVR_US, "PrivateDataElement", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0309, 0x0008, 0x0309, + EVR_UL, "PrivateDataElementValueMultiplicity", 1, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x030a, 0x0008, 0x030a, + EVR_CS, "PrivateDataElementValueRepresentation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x030b, 0x0008, 0x030b, + EVR_UL, "PrivateDataElementNumberOfItems", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x030c, 0x0008, 0x030c, + EVR_UC, "PrivateDataElementName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x030d, 0x0008, 0x030d, + EVR_UC, "PrivateDataElementKeyword", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x030e, 0x0008, 0x030e, + EVR_UT, "PrivateDataElementDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x030f, 0x0008, 0x030f, + EVR_UT, "PrivateDataElementEncoding", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x0310, 0x0008, 0x0310, + EVR_SQ, "PrivateDataElementDefinitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1000, 0x0008, 0x1000, + EVR_AE, "RETIRED_NetworkID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1010, 0x0008, 0x1010, + EVR_SH, "StationName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1030, 0x0008, 0x1030, + EVR_LO, "StudyDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1032, 0x0008, 0x1032, + EVR_SQ, "ProcedureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x103e, 0x0008, 0x103e, + EVR_LO, "SeriesDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x103f, 0x0008, 0x103f, + EVR_SQ, "SeriesDescriptionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1040, 0x0008, 0x1040, + EVR_LO, "InstitutionalDepartmentName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1041, 0x0008, 0x1041, + EVR_SQ, "InstitutionalDepartmentTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1048, 0x0008, 0x1048, + EVR_PN, "PhysiciansOfRecord", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1049, 0x0008, 0x1049, + EVR_SQ, "PhysiciansOfRecordIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1050, 0x0008, 0x1050, + EVR_PN, "PerformingPhysicianName", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1052, 0x0008, 0x1052, + EVR_SQ, "PerformingPhysicianIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1060, 0x0008, 0x1060, + EVR_PN, "NameOfPhysiciansReadingStudy", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1062, 0x0008, 0x1062, + EVR_SQ, "PhysiciansReadingStudyIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1070, 0x0008, 0x1070, + EVR_PN, "OperatorsName", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1072, 0x0008, 0x1072, + EVR_SQ, "OperatorIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1080, 0x0008, 0x1080, + EVR_LO, "AdmittingDiagnosesDescription", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1084, 0x0008, 0x1084, + EVR_SQ, "AdmittingDiagnosesCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1090, 0x0008, 0x1090, + EVR_LO, "ManufacturerModelName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1100, 0x0008, 0x1100, + EVR_SQ, "RETIRED_ReferencedResultsSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1110, 0x0008, 0x1110, + EVR_SQ, "ReferencedStudySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1111, 0x0008, 0x1111, + EVR_SQ, "ReferencedPerformedProcedureStepSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1115, 0x0008, 0x1115, + EVR_SQ, "ReferencedSeriesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1120, 0x0008, 0x1120, + EVR_SQ, "ReferencedPatientSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1125, 0x0008, 0x1125, + EVR_SQ, "ReferencedVisitSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1130, 0x0008, 0x1130, + EVR_SQ, "RETIRED_ReferencedOverlaySequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1134, 0x0008, 0x1134, + EVR_SQ, "ReferencedStereometricInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x113a, 0x0008, 0x113a, + EVR_SQ, "ReferencedWaveformSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1140, 0x0008, 0x1140, + EVR_SQ, "ReferencedImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1145, 0x0008, 0x1145, + EVR_SQ, "RETIRED_ReferencedCurveSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x114a, 0x0008, 0x114a, + EVR_SQ, "ReferencedInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x114b, 0x0008, 0x114b, + EVR_SQ, "ReferencedRealWorldValueMappingInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1150, 0x0008, 0x1150, + EVR_UI, "ReferencedSOPClassUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1155, 0x0008, 0x1155, + EVR_UI, "ReferencedSOPInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1156, 0x0008, 0x1156, + EVR_SQ, "DefinitionSourceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x115a, 0x0008, 0x115a, + EVR_UI, "SOPClassesSupported", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1160, 0x0008, 0x1160, + EVR_IS, "ReferencedFrameNumber", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1161, 0x0008, 0x1161, + EVR_UL, "SimpleFrameList", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1162, 0x0008, 0x1162, + EVR_UL, "CalculatedFrameList", 3, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1163, 0x0008, 0x1163, + EVR_FD, "TimeRange", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1164, 0x0008, 0x1164, + EVR_SQ, "FrameExtractionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1167, 0x0008, 0x1167, + EVR_UI, "MultiFrameSourceSOPInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1190, 0x0008, 0x1190, + EVR_UR, "RetrieveURL", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1195, 0x0008, 0x1195, + EVR_UI, "TransactionUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1196, 0x0008, 0x1196, + EVR_US, "WarningReason", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1197, 0x0008, 0x1197, + EVR_US, "FailureReason", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1198, 0x0008, 0x1198, + EVR_SQ, "FailedSOPSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1199, 0x0008, 0x1199, + EVR_SQ, "ReferencedSOPSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x119a, 0x0008, 0x119a, + EVR_SQ, "OtherFailuresSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1200, 0x0008, 0x1200, + EVR_SQ, "StudiesContainingOtherReferencedInstancesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x1250, 0x0008, 0x1250, + EVR_SQ, "RelatedSeriesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2110, 0x0008, 0x2110, + EVR_CS, "RETIRED_LossyImageCompressionRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2111, 0x0008, 0x2111, + EVR_ST, "DerivationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2112, 0x0008, 0x2112, + EVR_SQ, "SourceImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2120, 0x0008, 0x2120, + EVR_SH, "StageName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2122, 0x0008, 0x2122, + EVR_IS, "StageNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2124, 0x0008, 0x2124, + EVR_IS, "NumberOfStages", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2127, 0x0008, 0x2127, + EVR_SH, "ViewName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2128, 0x0008, 0x2128, + EVR_IS, "ViewNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2129, 0x0008, 0x2129, + EVR_IS, "NumberOfEventTimers", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x212a, 0x0008, 0x212a, + EVR_IS, "NumberOfViewsInStage", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2130, 0x0008, 0x2130, + EVR_DS, "EventElapsedTimes", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2132, 0x0008, 0x2132, + EVR_LO, "EventTimerNames", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2133, 0x0008, 0x2133, + EVR_SQ, "EventTimerSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2134, 0x0008, 0x2134, + EVR_FD, "EventTimeOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2135, 0x0008, 0x2135, + EVR_SQ, "EventCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2142, 0x0008, 0x2142, + EVR_IS, "StartTrim", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2143, 0x0008, 0x2143, + EVR_IS, "StopTrim", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2144, 0x0008, 0x2144, + EVR_IS, "RecommendedDisplayFrameRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2200, 0x0008, 0x2200, + EVR_CS, "RETIRED_TransducerPosition", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2204, 0x0008, 0x2204, + EVR_CS, "RETIRED_TransducerOrientation", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2208, 0x0008, 0x2208, + EVR_CS, "RETIRED_AnatomicStructure", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2218, 0x0008, 0x2218, + EVR_SQ, "AnatomicRegionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2220, 0x0008, 0x2220, + EVR_SQ, "AnatomicRegionModifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2228, 0x0008, 0x2228, + EVR_SQ, "PrimaryAnatomicStructureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2229, 0x0008, 0x2229, + EVR_SQ, "RETIRED_AnatomicStructureSpaceOrRegionSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2230, 0x0008, 0x2230, + EVR_SQ, "PrimaryAnatomicStructureModifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2240, 0x0008, 0x2240, + EVR_SQ, "RETIRED_TransducerPositionSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2242, 0x0008, 0x2242, + EVR_SQ, "RETIRED_TransducerPositionModifierSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2244, 0x0008, 0x2244, + EVR_SQ, "RETIRED_TransducerOrientationSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2246, 0x0008, 0x2246, + EVR_SQ, "RETIRED_TransducerOrientationModifierSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2251, 0x0008, 0x2251, + EVR_SQ, "RETIRED_AnatomicStructureSpaceOrRegionCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2253, 0x0008, 0x2253, + EVR_SQ, "RETIRED_AnatomicPortalOfEntranceCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2255, 0x0008, 0x2255, + EVR_SQ, "RETIRED_AnatomicApproachDirectionCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2256, 0x0008, 0x2256, + EVR_ST, "RETIRED_AnatomicPerspectiveDescriptionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2257, 0x0008, 0x2257, + EVR_SQ, "RETIRED_AnatomicPerspectiveCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2258, 0x0008, 0x2258, + EVR_ST, "RETIRED_AnatomicLocationOfExaminingInstrumentDescriptionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x2259, 0x0008, 0x2259, + EVR_SQ, "RETIRED_AnatomicLocationOfExaminingInstrumentCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x225a, 0x0008, 0x225a, + EVR_SQ, "RETIRED_AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x225c, 0x0008, 0x225c, + EVR_SQ, "RETIRED_OnAxisBackgroundAnatomicStructureCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x3001, 0x0008, 0x3001, + EVR_SQ, "AlternateRepresentationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x3010, 0x0008, 0x3010, + EVR_UI, "IrradiationEventUID", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x3011, 0x0008, 0x3011, + EVR_SQ, "SourceIrradiationEventSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x3012, 0x0008, 0x3012, + EVR_UI, "RadiopharmaceuticalAdministrationEventUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x4000, 0x0008, 0x4000, + EVR_LT, "RETIRED_IdentifyingComments", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9007, 0x0008, 0x9007, + EVR_CS, "FrameType", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9092, 0x0008, 0x9092, + EVR_SQ, "ReferencedImageEvidenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9121, 0x0008, 0x9121, + EVR_SQ, "ReferencedRawDataSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9123, 0x0008, 0x9123, + EVR_UI, "CreatorVersionUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9124, 0x0008, 0x9124, + EVR_SQ, "DerivationImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9154, 0x0008, 0x9154, + EVR_SQ, "SourceImageEvidenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9205, 0x0008, 0x9205, + EVR_CS, "PixelPresentation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9206, 0x0008, 0x9206, + EVR_CS, "VolumetricProperties", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9207, 0x0008, 0x9207, + EVR_CS, "VolumeBasedCalculationTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9208, 0x0008, 0x9208, + EVR_CS, "ComplexImageComponent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9209, 0x0008, 0x9209, + EVR_CS, "AcquisitionContrast", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9215, 0x0008, 0x9215, + EVR_SQ, "DerivationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9237, 0x0008, 0x9237, + EVR_SQ, "ReferencedPresentationStateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9410, 0x0008, 0x9410, + EVR_SQ, "ReferencedOtherPlaneSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9458, 0x0008, 0x9458, + EVR_SQ, "FrameDisplaySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9459, 0x0008, 0x9459, + EVR_FL, "RecommendedDisplayFrameRateInFloat", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0008, 0x9460, 0x0008, 0x9460, + EVR_CS, "SkipFrameRangeFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AEGIS_DICOM_2.00" } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_LT, "DataObjectRecognitionCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_LT, "OriginalFileName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_DS, "NumberOfMeasurements", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_SQ, "AnonymizerUIDMap", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DCMTK_ANONYMIZER" } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_OB, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "MERGE TECHNOLOGIES, INC." } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_UL, "FileLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0009, 0x0000, 0x0009, 0x0000, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_UN, "RISPatientInfoIMGEF", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_US, "SIENETCommandField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_UN, "CRHeaderInformation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FFP DATA" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_UL, "FileSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_LO, "FullFidelity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0001, 0x0009, 0x0001, + EVR_UN, "SIENETGeneralPurposeIMGEF", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ISI" } + , { 0x0009, 0x0002, 0x0009, 0x0002, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0009, 0x0002, 0x0009, 0x0002, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0002, 0x0009, 0x0002, + EVR_SH, "SuiteId", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0003, 0x0009, 0x0003, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0009, 0x0003, 0x0009, 0x0003, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0004, 0x0009, 0x0004, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0009, 0x0004, 0x0009, 0x0004, + EVR_LO, "ImageDataConsistence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0004, 0x0009, 0x0004, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0004, 0x0009, 0x0004, + EVR_SH, "ImageControlUnit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x0004, 0x0009, 0x0004, + EVR_SH, "ProductId", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0005, 0x0009, 0x0005, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0005, 0x0009, 0x0005, + EVR_OW, "ImageUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x0006, 0x0009, 0x0006, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0006, 0x0009, 0x0006, + EVR_OW, "RouteImageUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x0007, 0x0009, 0x0007, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0008, 0x0009, 0x0008, + EVR_CS, "ExposureChannel", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0009, 0x0008, 0x0009, 0x0008, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0008, 0x0009, 0x0008, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0008, 0x0009, 0x0008, + EVR_UL, "ImageDisplayInformationVersionNo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x0009, 0x0009, 0x0009, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0009, 0x0009, 0x0009, + EVR_UL, "PatientInformationVersionNo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x000a, 0x0009, 0x000a, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x000b, 0x0009, 0x000b, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x000c, 0x0009, 0x000c, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x000c, 0x0009, 0x000c, + EVR_OW, "FilmUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x000d, 0x0009, 0x000d, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x000e, 0x0009, 0x000e, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x000f, 0x0009, 0x000f, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AGFA" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LO, "Comments", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_CS, "ExposureUnitTypeCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LT, "OriginalFileLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LT, "StorageMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LT, "GeneratorIdentificationLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_UI, "AnonymizerUIDKey", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DCMTK_ANONYMIZER" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DICOM" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LT, "Comments", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LT, "Comments", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LO, "RecognitionCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0010, 0x0009, 0x0010, + EVR_LO, "SPIRelease", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR" } + , { 0x0009, 0x0011, 0x0009, 0x0011, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AGFA" } + , { 0x0009, 0x0011, 0x0009, 0x0011, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0011, 0x0009, 0x0011, + EVR_LT, "GantryIdentificationLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0011, 0x0009, 0x0011, + EVR_SL, "StudyFlags", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0012, 0x0009, 0x0012, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0012, 0x0009, 0x0012, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0012, 0x0009, 0x0012, + EVR_UL, "EvaluationMaskImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0009, 0x0012, 0x0009, 0x0012, + EVR_LT, "X-RayTubeIdentificationLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0012, 0x0009, 0x0012, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DICOM" } + , { 0x0009, 0x0012, 0x0009, 0x0012, + EVR_SL, "StudyType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0012, 0x0009, 0x0012, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR" } + , { 0x0009, 0x0013, 0x0009, 0x0013, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AGFA" } + , { 0x0009, 0x0013, 0x0009, 0x0013, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0013, 0x0009, 0x0013, + EVR_LT, "DetectorIdentificationLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0014, 0x0009, 0x0014, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AGFA" } + , { 0x0009, 0x0014, 0x0009, 0x0014, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0014, 0x0009, 0x0014, + EVR_LT, "ReceiverPLA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0009, 0x0014, 0x0009, 0x0014, + EVR_LT, "DASIdentificationLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0015, 0x0009, 0x0015, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AGFA" } + , { 0x0009, 0x0015, 0x0009, 0x0015, + EVR_LO, "UniqueIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0015, 0x0009, 0x0015, + EVR_LO, "SPIImageUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0009, 0x0015, 0x0009, 0x0015, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ACUSON" } + , { 0x0009, 0x0015, 0x0009, 0x0015, + EVR_LT, "SMIIdentificationLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0015, 0x0009, 0x0015, + EVR_LO, "SPIImageUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0009, 0x0015, 0x0009, 0x0015, + EVR_LO, "SPIImageUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0009, 0x0016, 0x0009, 0x0016, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0016, 0x0009, 0x0016, + EVR_US, "TransferPriority", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0009, 0x0016, 0x0009, 0x0016, + EVR_LT, "CPUIdentificationLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0017, 0x0009, 0x0017, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0018, 0x0009, 0x0018, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0018, 0x0009, 0x0018, + EVR_LT, "DataSetIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0009, 0x001a, 0x0009, 0x001a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x001e, 0x0009, 0x001e, + EVR_UI, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0020, 0x0009, 0x0020, + EVR_LT, "HeaderVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 LAB" } + , { 0x0009, 0x0020, 0x0009, 0x0020, + EVR_UI, "AnonymizerUIDValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DCMTK_ANONYMIZER" } + , { 0x0009, 0x0020, 0x0009, 0x0020, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 ORI" } + , { 0x0009, 0x0020, 0x0009, 0x0020, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0020, 0x0009, 0x0020, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0020, 0x0009, 0x0020, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0021, 0x0009, 0x0021, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0021, 0x0009, 0x0021, + EVR_SL, "SeriesFlags", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0022, 0x0009, 0x0022, + EVR_SH, "UserOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0023, 0x0009, 0x0023, + EVR_SL, "InitiationType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0024, 0x0009, 0x0024, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0009, 0x0024, 0x0009, 0x0024, + EVR_SL, "InitiationDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0025, 0x0009, 0x0025, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0009, 0x0025, 0x0009, 0x0025, + EVR_SL, "InitiationCountRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0026, 0x0009, 0x0026, + EVR_DA, "LastMoveDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0009, 0x0026, 0x0009, 0x0026, + EVR_SL, "NumberEnergySets", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0027, 0x0009, 0x0027, + EVR_TM, "LastMoveTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0009, 0x0027, 0x0009, 0x0027, + EVR_SL, "ImageActualDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0027, 0x0009, 0x0027, + EVR_SL, "NumberDetectors", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0029, 0x0009, 0x0029, + EVR_LT, "ActualUser", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0009, 0x0029, 0x0009, 0x0029, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x002a, 0x0009, 0x002a, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x002c, 0x0009, 0x002c, + EVR_LO, "SeriesComments", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x002d, 0x0009, 0x002d, + EVR_SL, "TrackBeatAverage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x002e, 0x0009, 0x002e, + EVR_FD, "DistancePrescribed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x002f, 0x0009, 0x002f, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0030, 0x0009, 0x0030, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0030, 0x0009, 0x0030, + EVR_SQ, "AnonymizerPatientIDMap", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DCMTK_ANONYMIZER" } + , { 0x0009, 0x0030, 0x0009, 0x0030, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 ORI" } + , { 0x0009, 0x0030, 0x0009, 0x0030, + EVR_SH, "ServiceId", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0030, 0x0009, 0x0030, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0030, 0x0009, 0x0030, + EVR_UL, "ByteOffsetOfOriginalHeader", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x0030, 0x0009, 0x0030, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0031, 0x0009, 0x0031, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0031, 0x0009, 0x0031, + EVR_LT, "PACSUniqueIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0031, 0x0009, 0x0031, + EVR_SH, "MobileLocationNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x0031, 0x0009, 0x0031, + EVR_UL, "LengthOfOriginalHeader", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x0032, 0x0009, 0x0032, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0032, 0x0009, 0x0032, + EVR_TM, "ExposureStartTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0009, 0x0034, 0x0009, 0x0034, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0034, 0x0009, 0x0034, + EVR_LT, "ClusterUniqueIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0035, 0x0009, 0x0035, + EVR_SL, "GantryLocusType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0037, 0x0009, 0x0037, + EVR_SL, "StartingHeartRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0038, 0x0009, 0x0038, + EVR_LT, "SystemUniqueIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0038, 0x0009, 0x0038, + EVR_SL, "RRWindowWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0039, 0x0009, 0x0039, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0039, 0x0009, 0x0039, + EVR_SL, "RRWindowOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x003a, 0x0009, 0x003a, + EVR_SL, "PercentCycleImaged", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x003e, 0x0009, 0x003e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0009, 0x003f, 0x0009, 0x003f, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_US, "DataObjectType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_LO, "AnonymizerPatientIDKey", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DCMTK_ANONYMIZER" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_SQ, "AlternateImageSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_US, "DataObjectType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_US, "DataObjectType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0040, 0x0009, 0x0040, + EVR_UL, "ByteOffsetOfPixelmatrix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x0041, 0x0009, 0x0041, + EVR_LT, "DataObjectSubtype", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0009, 0x0041, 0x0009, 0x0041, + EVR_SL, "PatientFlags", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0041, 0x0009, 0x0041, + EVR_LO, "DataObjectSubtype", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0009, 0x0041, 0x0009, 0x0041, + EVR_LO, "DataObjectSubtype", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0009, 0x0041, 0x0009, 0x0041, + EVR_UL, "LengthOfPixelmatrixInBytes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x0042, 0x0009, 0x0042, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0042, 0x0009, 0x0042, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0009, 0x0042, 0x0009, 0x0042, + EVR_DA, "PatientCreationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0043, 0x0009, 0x0043, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0009, 0x0043, 0x0009, 0x0043, + EVR_TM, "PatientCreationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0009, 0x0050, 0x0009, 0x0050, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0050, 0x0009, 0x0050, + EVR_LO, "AnonymizerPatientIDValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DCMTK_ANONYMIZER" } + , { 0x0009, 0x0050, 0x0009, 0x0050, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0050, 0x0009, 0x0050, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x0051, 0x0009, 0x0051, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 IDE" } + , { 0x0009, 0x0051, 0x0009, 0x0051, + EVR_LT, "StudyUniqueIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0051, 0x0009, 0x0051, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x0060, 0x0009, 0x0060, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0061, 0x0009, 0x0061, + EVR_LT, "SeriesUniqueIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0070, 0x0009, 0x0070, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0075, 0x0009, 0x0075, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0080, 0x0009, 0x0080, + EVR_LO, "KanjiHospitalName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x0080, 0x0009, 0x0080, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0090, 0x0009, 0x0090, + EVR_ST, "DistributionCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x0090, 0x0009, 0x0090, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0009, 0x0091, 0x0009, 0x0091, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x0092, 0x0009, 0x0092, + EVR_SH, "KanjiDepartmentName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x00c0, 0x0009, 0x00c0, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0009, 0x00c1, 0x0009, 0x00c1, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0009, 0x00e2, 0x0009, 0x00e2, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x00e3, 0x0009, 0x00e3, + EVR_UI, "EquipmentUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x00e6, 0x0009, 0x00e6, + EVR_SH, "GenesisVersionNow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x00e7, 0x0009, 0x00e7, + EVR_UL, "ExamRecordChecksum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x00e8, 0x0009, 0x00e8, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x00e9, 0x0009, 0x00e9, + EVR_SL, "ActualSeriesDataTimeStamp", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IDEN_01" } + , { 0x0009, 0x00f0, 0x0009, 0x00f0, + EVR_CS, "BlackeningProcessFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0009, 0x00f2, 0x0009, 0x00f2, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x00f3, 0x0009, 0x00f3, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x00f4, 0x0009, 0x00f4, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x00f5, 0x0009, 0x00f5, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x00f5, 0x0009, 0x00f5, + EVR_LT, "PDMEFIDPlaceholder", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x00f6, 0x0009, 0x00f6, + EVR_LT, "PDMDataObjectTypeExtension", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0009, 0x00f7, 0x0009, 0x00f7, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0009, 0x00f8, 0x0009, 0x00f8, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0009, 0x00fb, 0x0009, 0x00fb, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } +#endif + , { 0x0010, 0x0010, 0x0010, 0x0010, + EVR_PN, "PatientName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0020, 0x0010, 0x0020, + EVR_LO, "PatientID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0021, 0x0010, 0x0021, + EVR_LO, "IssuerOfPatientID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0022, 0x0010, 0x0022, + EVR_CS, "TypeOfPatientID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0024, 0x0010, 0x0024, + EVR_SQ, "IssuerOfPatientIDQualifiersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0026, 0x0010, 0x0026, + EVR_SQ, "SourcePatientGroupIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0027, 0x0010, 0x0027, + EVR_SQ, "GroupOfPatientsIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0028, 0x0010, 0x0028, + EVR_US, "SubjectRelativePositionInImage", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0030, 0x0010, 0x0030, + EVR_DA, "PatientBirthDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0032, 0x0010, 0x0032, + EVR_TM, "PatientBirthTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0033, 0x0010, 0x0033, + EVR_LO, "PatientBirthDateInAlternativeCalendar", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0034, 0x0010, 0x0034, + EVR_LO, "PatientDeathDateInAlternativeCalendar", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0035, 0x0010, 0x0035, + EVR_CS, "PatientAlternativeCalendar", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0040, 0x0010, 0x0040, + EVR_CS, "PatientSex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0050, 0x0010, 0x0050, + EVR_SQ, "PatientInsurancePlanCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0101, 0x0010, 0x0101, + EVR_SQ, "PatientPrimaryLanguageCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0102, 0x0010, 0x0102, + EVR_SQ, "PatientPrimaryLanguageModifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0200, 0x0010, 0x0200, + EVR_CS, "QualityControlSubject", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0201, 0x0010, 0x0201, + EVR_SQ, "QualityControlSubjectTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0212, 0x0010, 0x0212, + EVR_UC, "StrainDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0213, 0x0010, 0x0213, + EVR_LO, "StrainNomenclature", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0214, 0x0010, 0x0214, + EVR_LO, "StrainStockNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0215, 0x0010, 0x0215, + EVR_SQ, "StrainSourceRegistryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0216, 0x0010, 0x0216, + EVR_SQ, "StrainStockSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0217, 0x0010, 0x0217, + EVR_LO, "StrainSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0218, 0x0010, 0x0218, + EVR_UT, "StrainAdditionalInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0219, 0x0010, 0x0219, + EVR_SQ, "StrainCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0221, 0x0010, 0x0221, + EVR_SQ, "GeneticModificationsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0222, 0x0010, 0x0222, + EVR_UC, "GeneticModificationsDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0223, 0x0010, 0x0223, + EVR_LO, "GeneticModificationsNomenclature", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x0229, 0x0010, 0x0229, + EVR_SQ, "GeneticModificationsCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1000, 0x0010, 0x1000, + EVR_LO, "RETIRED_OtherPatientIDs", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1001, 0x0010, 0x1001, + EVR_PN, "OtherPatientNames", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1002, 0x0010, 0x1002, + EVR_SQ, "OtherPatientIDsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1005, 0x0010, 0x1005, + EVR_PN, "PatientBirthName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1010, 0x0010, 0x1010, + EVR_AS, "PatientAge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1020, 0x0010, 0x1020, + EVR_DS, "PatientSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1021, 0x0010, 0x1021, + EVR_SQ, "PatientSizeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1022, 0x0010, 0x1022, + EVR_DS, "PatientBodyMassIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1023, 0x0010, 0x1023, + EVR_DS, "MeasuredAPDimension", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1024, 0x0010, 0x1024, + EVR_DS, "MeasuredLateralDimension", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1030, 0x0010, 0x1030, + EVR_DS, "PatientWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1040, 0x0010, 0x1040, + EVR_LO, "PatientAddress", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1050, 0x0010, 0x1050, + EVR_LO, "RETIRED_InsurancePlanIdentification", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1060, 0x0010, 0x1060, + EVR_PN, "PatientMotherBirthName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1080, 0x0010, 0x1080, + EVR_LO, "MilitaryRank", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1081, 0x0010, 0x1081, + EVR_LO, "BranchOfService", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1090, 0x0010, 0x1090, + EVR_LO, "RETIRED_MedicalRecordLocator", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x1100, 0x0010, 0x1100, + EVR_SQ, "ReferencedPatientPhotoSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2000, 0x0010, 0x2000, + EVR_LO, "MedicalAlerts", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2110, 0x0010, 0x2110, + EVR_LO, "Allergies", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2150, 0x0010, 0x2150, + EVR_LO, "CountryOfResidence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2152, 0x0010, 0x2152, + EVR_LO, "RegionOfResidence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2154, 0x0010, 0x2154, + EVR_SH, "PatientTelephoneNumbers", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2155, 0x0010, 0x2155, + EVR_LT, "PatientTelecomInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2160, 0x0010, 0x2160, + EVR_SH, "EthnicGroup", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2180, 0x0010, 0x2180, + EVR_SH, "Occupation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x21a0, 0x0010, 0x21a0, + EVR_CS, "SmokingStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x21b0, 0x0010, 0x21b0, + EVR_LT, "AdditionalPatientHistory", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x21c0, 0x0010, 0x21c0, + EVR_US, "PregnancyStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x21d0, 0x0010, 0x21d0, + EVR_DA, "LastMenstrualDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x21f0, 0x0010, 0x21f0, + EVR_LO, "PatientReligiousPreference", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2201, 0x0010, 0x2201, + EVR_LO, "PatientSpeciesDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2202, 0x0010, 0x2202, + EVR_SQ, "PatientSpeciesCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2203, 0x0010, 0x2203, + EVR_CS, "PatientSexNeutered", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2210, 0x0010, 0x2210, + EVR_CS, "AnatomicalOrientationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2292, 0x0010, 0x2292, + EVR_LO, "PatientBreedDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2293, 0x0010, 0x2293, + EVR_SQ, "PatientBreedCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2294, 0x0010, 0x2294, + EVR_SQ, "BreedRegistrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2295, 0x0010, 0x2295, + EVR_LO, "BreedRegistrationNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2296, 0x0010, 0x2296, + EVR_SQ, "BreedRegistryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2297, 0x0010, 0x2297, + EVR_PN, "ResponsiblePerson", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2298, 0x0010, 0x2298, + EVR_CS, "ResponsiblePersonRole", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x2299, 0x0010, 0x2299, + EVR_LO, "ResponsibleOrganization", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x4000, 0x0010, 0x4000, + EVR_LT, "PatientComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0010, 0x9431, 0x0010, 0x9431, + EVR_FL, "ExaminedBodyThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0011, 0x0001, 0x0011, 0x0001, + EVR_LT, "PatientDOB", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_PATNT_01" } + , { 0x0011, 0x0001, 0x0011, 0x0001, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0011, 0x0002, 0x0011, 0x0002, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0011, 0x0003, 0x0011, 0x0003, + EVR_LT, "PatientUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x0004, 0x0011, 0x0004, + EVR_LT, "PatientID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x000a, 0x0011, 0x000a, + EVR_SL, "SeriesType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x000a, 0x0011, 0x000a, + EVR_LT, "CaseID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x000a, 0x0011, 0x000a, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0011, 0x000b, 0x0011, 0x000b, + EVR_SL, "EffectiveSeriesDuration", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x000c, 0x0011, 0x000c, + EVR_SL, "NumBeats", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x000d, 0x0011, 0x000d, + EVR_LO, "RadioNuclideName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_LO, "Organ", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_LO, "Organ", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_LT, "PatientEntryID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_LT, "Organ", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_LT, "PatientUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_DA, "RegistrationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0011, 0x0010, 0x0011, 0x0010, + EVR_SS, "PatientStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PATI_01" } + , { 0x0011, 0x0011, 0x0011, 0x0011, + EVR_LT, "PatientID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0011, 0x0011, 0x0011, + EVR_TM, "RegistrationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0011, 0x0012, 0x0011, 0x0012, + EVR_LO, "DatasetName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0013, 0x0011, 0x0013, + EVR_SL, "DatasetType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0015, 0x0011, 0x0015, + EVR_LO, "AllergyIndication", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0011, 0x0015, 0x0011, 0x0015, + EVR_SL, "DetectorNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0015, 0x0011, 0x0015, + EVR_LO, "AllergyIndication", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0011, 0x0015, 0x0011, 0x0015, + EVR_LT, "AllergyIndication", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0011, 0x0016, 0x0011, 0x0016, + EVR_SL, "EnergyNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0017, 0x0011, 0x0017, + EVR_SL, "RRIntervalWindowNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0018, 0x0011, 0x0018, + EVR_SL, "MGBinNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0018, 0x0011, 0x0018, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 2;1" } + , { 0x0011, 0x0019, 0x0011, 0x0019, + EVR_FD, "RadiusOfRotation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x001a, 0x0011, 0x001a, + EVR_SL, "DetectorCountZone", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x001b, 0x0011, 0x001b, + EVR_SL, "NumEnergyWindows", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x001c, 0x0011, 0x001c, + EVR_SL, "EnergyOffset", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x001d, 0x0011, 0x001d, + EVR_SL, "EnergyRange", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x001f, 0x0011, 0x001f, + EVR_SL, "ImageOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0020, 0x0011, 0x0020, + EVR_LO, "Pregnancy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0011, 0x0020, 0x0011, 0x0020, + EVR_SL, "FluoroTimer", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0011, 0x0020, 0x0011, 0x0020, + EVR_LO, "Pregnancy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0011, 0x0020, 0x0011, 0x0020, + EVR_LT, "Pregnancy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0011, 0x0020, 0x0011, 0x0020, + EVR_DA, "PatientRegistrationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0021, 0x0011, 0x0021, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0011, 0x0021, 0x0011, 0x0021, + EVR_TM, "PatientRegistrationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0022, 0x0011, 0x0022, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0011, 0x0022, 0x0011, 0x0022, + EVR_LT, "RequestID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x0022, 0x0011, 0x0022, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0011, 0x0023, 0x0011, 0x0023, + EVR_SL, "UseFOVMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0023, 0x0011, 0x0023, + EVR_LT, "ExaminationUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x0023, 0x0011, 0x0023, + EVR_DS, "UsedPatientWeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0011, 0x0024, 0x0011, 0x0024, + EVR_SL, "FOVMaskYCutoffAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0025, 0x0011, 0x0025, + EVR_SL, "PtopDoseAreaProduct", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0011, 0x0025, 0x0011, 0x0025, + EVR_SL, "FOVMaskCutoffAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0026, 0x0011, 0x0026, + EVR_SL, "PtopTotalSkinDose", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0011, 0x0026, 0x0011, 0x0026, + EVR_SL, "TableOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0027, 0x0011, 0x0027, + EVR_SL, "ROITopLeft", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0028, 0x0011, 0x0028, + EVR_SL, "ROIBottomRight", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0028, 0x0011, 0x0028, + EVR_SL, "FluoroTimerB", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0011, 0x0028, 0x0011, 0x0028, + EVR_SL, "FluoroTimerA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0011, 0x0029, 0x0011, 0x0029, + EVR_SL, "FluoroSkinDoseB", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0011, 0x0029, 0x0011, 0x0029, + EVR_SL, "FluoroSkinDoseA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0011, 0x002a, 0x0011, 0x002a, + EVR_SL, "TotalSkinDoseB", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0011, 0x002a, 0x0011, 0x002a, + EVR_SL, "TotalSkinDoseA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0011, 0x002b, 0x0011, 0x002b, + EVR_SL, "FluoroDoseAreaProductB", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0011, 0x002b, 0x0011, 0x002b, + EVR_SL, "FluoroDoseAreaProductA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0011, 0x002c, 0x0011, 0x002c, + EVR_SL, "TotalDoseAreaProductB", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0011, 0x002c, 0x0011, 0x002c, + EVR_SL, "TotalDoseAreaProductA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0011, 0x0030, 0x0011, 0x0030, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0011, 0x0030, 0x0011, 0x0030, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0030, 0x0011, 0x0030, + EVR_LT, "PatientnameRIS", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0031, 0x0011, 0x0031, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0011, 0x0031, 0x0011, 0x0031, + EVR_LT, "PatientprenameRIS", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0032, 0x0011, 0x0032, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0011, 0x0033, 0x0011, 0x0033, + EVR_LO, "EnergyCorrectName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0034, 0x0011, 0x0034, + EVR_LO, "SpatialCorrectName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0035, 0x0011, 0x0035, + EVR_LO, "PatientInitialPuckCounter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0011, 0x0035, 0x0011, 0x0035, + EVR_LO, "TuningCalibName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0036, 0x0011, 0x0036, + EVR_LO, "UniformityCorrectName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0037, 0x0011, 0x0037, + EVR_LO, "AcquisitionSpecificCorrectName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0038, 0x0011, 0x0038, + EVR_SL, "ByteOrder", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x003a, 0x0011, 0x003a, + EVR_SL, "PictureFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x003b, 0x0011, 0x003b, + EVR_FD, "PixelScale", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x003c, 0x0011, 0x003c, + EVR_FD, "PixelOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x003e, 0x0011, 0x003e, + EVR_SL, "FOVShape", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x003f, 0x0011, 0x003f, + EVR_SL, "DatasetFlags", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0040, 0x0011, 0x0040, + EVR_SS, "SPIDataObjectType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0011, 0x0040, 0x0011, 0x0040, + EVR_LT, "PatientHospitalStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0040, 0x0011, 0x0040, + EVR_IS, "OrganCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0011, 0x0041, 0x0011, 0x0041, + EVR_LT, "MedicalAlerts", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0042, 0x0011, 0x0042, + EVR_LT, "ContrastAllergies", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0011, 0x0044, 0x0011, 0x0044, + EVR_FD, "ThresholdCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0045, 0x0011, 0x0045, + EVR_FD, "ThresholdWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0046, 0x0011, 0x0046, + EVR_SL, "InterpolationType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0055, 0x0011, 0x0055, + EVR_FD, "Period", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x0056, 0x0011, 0x0056, + EVR_FD, "ElapsedTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0011, 0x00a1, 0x0011, 0x00a1, + EVR_DA, "PatientRegistrationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00a2, 0x0011, 0x00a2, + EVR_TM, "PatientRegistrationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00b0, 0x0011, 0x00b0, + EVR_LT, "PatientLastName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00b2, 0x0011, 0x00b2, + EVR_LT, "PatientFirstName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00b4, 0x0011, 0x00b4, + EVR_LT, "PatientHospitalStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00bc, 0x0011, 0x00bc, + EVR_TM, "CurrentLocationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00c0, 0x0011, 0x00c0, + EVR_LT, "PatientInsuranceStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00d0, 0x0011, 0x00d0, + EVR_LT, "PatientBillingType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0011, 0x00d2, 0x0011, 0x00d2, + EVR_LT, "PatientBillingAddress", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } +#endif + , { 0x0012, 0x0010, 0x0012, 0x0010, + EVR_LO, "ClinicalTrialSponsorName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0020, 0x0012, 0x0020, + EVR_LO, "ClinicalTrialProtocolID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0021, 0x0012, 0x0021, + EVR_LO, "ClinicalTrialProtocolName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0030, 0x0012, 0x0030, + EVR_LO, "ClinicalTrialSiteID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0031, 0x0012, 0x0031, + EVR_LO, "ClinicalTrialSiteName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0040, 0x0012, 0x0040, + EVR_LO, "ClinicalTrialSubjectID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0042, 0x0012, 0x0042, + EVR_LO, "ClinicalTrialSubjectReadingID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0050, 0x0012, 0x0050, + EVR_LO, "ClinicalTrialTimePointID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0051, 0x0012, 0x0051, + EVR_ST, "ClinicalTrialTimePointDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0052, 0x0012, 0x0052, + EVR_FD, "LongitudinalTemporalOffsetFromEvent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0053, 0x0012, 0x0053, + EVR_CS, "LongitudinalTemporalEventType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0060, 0x0012, 0x0060, + EVR_LO, "ClinicalTrialCoordinatingCenterName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0062, 0x0012, 0x0062, + EVR_CS, "PatientIdentityRemoved", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0063, 0x0012, 0x0063, + EVR_LO, "DeidentificationMethod", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0064, 0x0012, 0x0064, + EVR_SQ, "DeidentificationMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0071, 0x0012, 0x0071, + EVR_LO, "ClinicalTrialSeriesID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0072, 0x0012, 0x0072, + EVR_LO, "ClinicalTrialSeriesDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0081, 0x0012, 0x0081, + EVR_LO, "ClinicalTrialProtocolEthicsCommitteeName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0082, 0x0012, 0x0082, + EVR_LO, "ClinicalTrialProtocolEthicsCommitteeApprovalNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0083, 0x0012, 0x0083, + EVR_SQ, "ConsentForClinicalTrialUseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0084, 0x0012, 0x0084, + EVR_CS, "DistributionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0085, 0x0012, 0x0085, + EVR_CS, "ConsentForDistributionFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0086, 0x0012, 0x0086, + EVR_DA, "EthicsCommitteeApprovalEffectivenessStartDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0012, 0x0087, 0x0012, 0x0087, + EVR_DA, "EthicsCommitteeApprovalEffectivenessEndDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0013, 0x0000, 0x0013, 0x0000, + EVR_LT, "ModifyingPhysician", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0010, 0x0013, 0x0010, + EVR_FD, "DigitalFOV", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0010, 0x0013, 0x0010, + EVR_DA, "ModificationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0011, 0x0013, 0x0011, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0012, 0x0013, 0x0012, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0012, 0x0013, 0x0012, + EVR_TM, "ModificationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0016, 0x0013, 0x0016, + EVR_SL, "AutoTrackPeak", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0017, 0x0013, 0x0017, + EVR_SL, "AutoTrackWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0018, 0x0013, 0x0018, + EVR_FD, "TransmissionScanTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0019, 0x0013, 0x0019, + EVR_FD, "TransmissionMaskWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x001a, 0x0013, 0x001a, + EVR_FD, "CopperAttenuatorThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x001c, 0x0013, 0x001c, + EVR_FD, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x001d, 0x0013, 0x001d, + EVR_FD, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x001e, 0x0013, 0x001e, + EVR_FD, "TomoViewOffset", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0020, 0x0013, 0x0020, + EVR_LO, "PatientName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0022, 0x0013, 0x0022, + EVR_LO, "PatientId", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0026, 0x0013, 0x0026, + EVR_LT, "StudyComments", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GENIE_1" } + , { 0x0013, 0x0030, 0x0013, 0x0030, + EVR_DA, "PatientBirthdate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0031, 0x0013, 0x0031, + EVR_DS, "PatientWeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0032, 0x0013, 0x0032, + EVR_LT, "PatientsMaidenName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0033, 0x0013, 0x0033, + EVR_LT, "ReferringPhysician", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0034, 0x0013, 0x0034, + EVR_LT, "AdmittingDiagnosis", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0035, 0x0013, 0x0035, + EVR_LO, "PatientSex", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0040, 0x0013, 0x0040, + EVR_LO, "ProcedureDescription", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0042, 0x0013, 0x0042, + EVR_LO, "RestDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0044, 0x0013, 0x0044, + EVR_LO, "PatientPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0046, 0x0013, 0x0046, + EVR_LT, "ViewDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0050, 0x0013, 0x0050, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0051, 0x0013, 0x0051, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0052, 0x0013, 0x0052, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0053, 0x0013, 0x0053, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0054, 0x0013, 0x0054, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0055, 0x0013, 0x0055, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0013, 0x0056, 0x0013, 0x0056, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } +#endif + , { 0x0014, 0x0023, 0x0014, 0x0023, + EVR_ST, "RETIRED_CADFileFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0024, 0x0014, 0x0024, + EVR_ST, "RETIRED_ComponentReferenceSystem", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0025, 0x0014, 0x0025, + EVR_ST, "ComponentManufacturingProcedure", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0028, 0x0014, 0x0028, + EVR_ST, "ComponentManufacturer", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0030, 0x0014, 0x0030, + EVR_DS, "MaterialThickness", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0032, 0x0014, 0x0032, + EVR_DS, "MaterialPipeDiameter", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0034, 0x0014, 0x0034, + EVR_DS, "MaterialIsolationDiameter", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0042, 0x0014, 0x0042, + EVR_ST, "MaterialGrade", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0044, 0x0014, 0x0044, + EVR_ST, "MaterialPropertiesDescription", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0045, 0x0014, 0x0045, + EVR_ST, "RETIRED_MaterialPropertiesFileFormatRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0046, 0x0014, 0x0046, + EVR_LT, "MaterialNotes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0050, 0x0014, 0x0050, + EVR_CS, "ComponentShape", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0052, 0x0014, 0x0052, + EVR_CS, "CurvatureType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0054, 0x0014, 0x0054, + EVR_DS, "OuterDiameter", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0056, 0x0014, 0x0056, + EVR_DS, "InnerDiameter", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0100, 0x0014, 0x0100, + EVR_LO, "ComponentWelderIDs", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0101, 0x0014, 0x0101, + EVR_CS, "SecondaryApprovalStatus", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0102, 0x0014, 0x0102, + EVR_DA, "SecondaryReviewDate", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0103, 0x0014, 0x0103, + EVR_TM, "SecondaryReviewTime", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0104, 0x0014, 0x0104, + EVR_PN, "SecondaryReviewerName", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0105, 0x0014, 0x0105, + EVR_ST, "RepairID", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0106, 0x0014, 0x0106, + EVR_SQ, "MultipleComponentApprovalSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0107, 0x0014, 0x0107, + EVR_CS, "OtherApprovalStatus", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x0108, 0x0014, 0x0108, + EVR_CS, "OtherSecondaryApprovalStatus", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x1010, 0x0014, 0x1010, + EVR_ST, "ActualEnvironmentalConditions", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x1020, 0x0014, 0x1020, + EVR_DA, "ExpiryDate", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x1040, 0x0014, 0x1040, + EVR_ST, "EnvironmentalConditions", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2002, 0x0014, 0x2002, + EVR_SQ, "EvaluatorSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2004, 0x0014, 0x2004, + EVR_IS, "EvaluatorNumber", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2006, 0x0014, 0x2006, + EVR_PN, "EvaluatorName", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2008, 0x0014, 0x2008, + EVR_IS, "EvaluationAttempt", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2012, 0x0014, 0x2012, + EVR_SQ, "IndicationSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2014, 0x0014, 0x2014, + EVR_IS, "IndicationNumber", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2016, 0x0014, 0x2016, + EVR_SH, "IndicationLabel", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2018, 0x0014, 0x2018, + EVR_ST, "IndicationDescription", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x201a, 0x0014, 0x201a, + EVR_CS, "IndicationType", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x201c, 0x0014, 0x201c, + EVR_CS, "IndicationDisposition", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x201e, 0x0014, 0x201e, + EVR_SQ, "IndicationROISequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2030, 0x0014, 0x2030, + EVR_SQ, "IndicationPhysicalPropertySequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2032, 0x0014, 0x2032, + EVR_SH, "PropertyLabel", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2202, 0x0014, 0x2202, + EVR_IS, "CoordinateSystemNumberOfAxes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2204, 0x0014, 0x2204, + EVR_SQ, "CoordinateSystemAxesSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2206, 0x0014, 0x2206, + EVR_ST, "CoordinateSystemAxisDescription", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2208, 0x0014, 0x2208, + EVR_CS, "CoordinateSystemDataSetMapping", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x220a, 0x0014, 0x220a, + EVR_IS, "CoordinateSystemAxisNumber", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x220c, 0x0014, 0x220c, + EVR_CS, "CoordinateSystemAxisType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x220e, 0x0014, 0x220e, + EVR_CS, "CoordinateSystemAxisUnits", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2210, 0x0014, 0x2210, + EVR_OB, "CoordinateSystemAxisValues", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2220, 0x0014, 0x2220, + EVR_SQ, "CoordinateSystemTransformSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2222, 0x0014, 0x2222, + EVR_ST, "TransformDescription", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2224, 0x0014, 0x2224, + EVR_IS, "TransformNumberOfAxes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2226, 0x0014, 0x2226, + EVR_IS, "TransformOrderOfAxes", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x2228, 0x0014, 0x2228, + EVR_CS, "TransformedAxisUnits", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x222a, 0x0014, 0x222a, + EVR_DS, "CoordinateSystemTransformRotationAndScaleMatrix", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x222c, 0x0014, 0x222c, + EVR_DS, "CoordinateSystemTransformTranslationMatrix", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3011, 0x0014, 0x3011, + EVR_DS, "InternalDetectorFrameTime", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3012, 0x0014, 0x3012, + EVR_DS, "NumberOfFramesIntegrated", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3020, 0x0014, 0x3020, + EVR_SQ, "DetectorTemperatureSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3022, 0x0014, 0x3022, + EVR_ST, "SensorName", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3024, 0x0014, 0x3024, + EVR_DS, "HorizontalOffsetOfSensor", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3026, 0x0014, 0x3026, + EVR_DS, "VerticalOffsetOfSensor", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3028, 0x0014, 0x3028, + EVR_DS, "SensorTemperature", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3040, 0x0014, 0x3040, + EVR_SQ, "DarkCurrentSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3050, 0x0014, 0x3050, + EVR_ox, "DarkCurrentCounts", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3060, 0x0014, 0x3060, + EVR_SQ, "GainCorrectionReferenceSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3070, 0x0014, 0x3070, + EVR_ox, "AirCounts", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3071, 0x0014, 0x3071, + EVR_DS, "KVUsedInGainCalibration", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3072, 0x0014, 0x3072, + EVR_DS, "MAUsedInGainCalibration", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3073, 0x0014, 0x3073, + EVR_DS, "NumberOfFramesUsedForIntegration", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3074, 0x0014, 0x3074, + EVR_LO, "FilterMaterialUsedInGainCalibration", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3075, 0x0014, 0x3075, + EVR_DS, "FilterThicknessUsedInGainCalibration", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3076, 0x0014, 0x3076, + EVR_DA, "DateOfGainCalibration", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3077, 0x0014, 0x3077, + EVR_TM, "TimeOfGainCalibration", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3080, 0x0014, 0x3080, + EVR_OB, "BadPixelImage", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x3099, 0x0014, 0x3099, + EVR_LT, "CalibrationNotes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4002, 0x0014, 0x4002, + EVR_SQ, "PulserEquipmentSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4004, 0x0014, 0x4004, + EVR_CS, "PulserType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4006, 0x0014, 0x4006, + EVR_LT, "PulserNotes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4008, 0x0014, 0x4008, + EVR_SQ, "ReceiverEquipmentSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x400a, 0x0014, 0x400a, + EVR_CS, "AmplifierType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x400c, 0x0014, 0x400c, + EVR_LT, "ReceiverNotes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x400e, 0x0014, 0x400e, + EVR_SQ, "PreAmplifierEquipmentSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x400f, 0x0014, 0x400f, + EVR_LT, "PreAmplifierNotes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4010, 0x0014, 0x4010, + EVR_SQ, "TransmitTransducerSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4011, 0x0014, 0x4011, + EVR_SQ, "ReceiveTransducerSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4012, 0x0014, 0x4012, + EVR_US, "NumberOfElements", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4013, 0x0014, 0x4013, + EVR_CS, "ElementShape", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4014, 0x0014, 0x4014, + EVR_DS, "ElementDimensionA", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4015, 0x0014, 0x4015, + EVR_DS, "ElementDimensionB", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4016, 0x0014, 0x4016, + EVR_DS, "ElementPitchA", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4017, 0x0014, 0x4017, + EVR_DS, "MeasuredBeamDimensionA", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4018, 0x0014, 0x4018, + EVR_DS, "MeasuredBeamDimensionB", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4019, 0x0014, 0x4019, + EVR_DS, "LocationOfMeasuredBeamDiameter", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x401a, 0x0014, 0x401a, + EVR_DS, "NominalFrequency", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x401b, 0x0014, 0x401b, + EVR_DS, "MeasuredCenterFrequency", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x401c, 0x0014, 0x401c, + EVR_DS, "MeasuredBandwidth", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x401d, 0x0014, 0x401d, + EVR_DS, "ElementPitchB", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4020, 0x0014, 0x4020, + EVR_SQ, "PulserSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4022, 0x0014, 0x4022, + EVR_DS, "PulseWidth", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4024, 0x0014, 0x4024, + EVR_DS, "ExcitationFrequency", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4026, 0x0014, 0x4026, + EVR_CS, "ModulationType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4028, 0x0014, 0x4028, + EVR_DS, "Damping", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4030, 0x0014, 0x4030, + EVR_SQ, "ReceiverSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4031, 0x0014, 0x4031, + EVR_DS, "AcquiredSoundpathLength", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4032, 0x0014, 0x4032, + EVR_CS, "AcquisitionCompressionType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4033, 0x0014, 0x4033, + EVR_IS, "AcquisitionSampleSize", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4034, 0x0014, 0x4034, + EVR_DS, "RectifierSmoothing", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4035, 0x0014, 0x4035, + EVR_SQ, "DACSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4036, 0x0014, 0x4036, + EVR_CS, "DACType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4038, 0x0014, 0x4038, + EVR_DS, "DACGainPoints", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x403a, 0x0014, 0x403a, + EVR_DS, "DACTimePoints", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x403c, 0x0014, 0x403c, + EVR_DS, "DACAmplitude", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4040, 0x0014, 0x4040, + EVR_SQ, "PreAmplifierSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4050, 0x0014, 0x4050, + EVR_SQ, "TransmitTransducerSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4051, 0x0014, 0x4051, + EVR_SQ, "ReceiveTransducerSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4052, 0x0014, 0x4052, + EVR_DS, "IncidentAngle", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4054, 0x0014, 0x4054, + EVR_ST, "CouplingTechnique", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4056, 0x0014, 0x4056, + EVR_ST, "CouplingMedium", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4057, 0x0014, 0x4057, + EVR_DS, "CouplingVelocity", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4058, 0x0014, 0x4058, + EVR_DS, "ProbeCenterLocationX", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4059, 0x0014, 0x4059, + EVR_DS, "ProbeCenterLocationZ", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x405a, 0x0014, 0x405a, + EVR_DS, "SoundPathLength", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x405c, 0x0014, 0x405c, + EVR_ST, "DelayLawIdentifier", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4060, 0x0014, 0x4060, + EVR_SQ, "GateSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4062, 0x0014, 0x4062, + EVR_DS, "GateThreshold", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4064, 0x0014, 0x4064, + EVR_DS, "VelocityOfSound", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4070, 0x0014, 0x4070, + EVR_SQ, "CalibrationSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4072, 0x0014, 0x4072, + EVR_ST, "CalibrationProcedure", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4074, 0x0014, 0x4074, + EVR_SH, "ProcedureVersion", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4076, 0x0014, 0x4076, + EVR_DA, "ProcedureCreationDate", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4078, 0x0014, 0x4078, + EVR_DA, "ProcedureExpirationDate", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x407a, 0x0014, 0x407a, + EVR_DA, "ProcedureLastModifiedDate", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x407c, 0x0014, 0x407c, + EVR_TM, "CalibrationTime", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x407e, 0x0014, 0x407e, + EVR_DA, "CalibrationDate", 1, -1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4080, 0x0014, 0x4080, + EVR_SQ, "ProbeDriveEquipmentSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4081, 0x0014, 0x4081, + EVR_CS, "DriveType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4082, 0x0014, 0x4082, + EVR_LT, "ProbeDriveNotes", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4083, 0x0014, 0x4083, + EVR_SQ, "DriveProbeSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4084, 0x0014, 0x4084, + EVR_DS, "ProbeInductance", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4085, 0x0014, 0x4085, + EVR_DS, "ProbeResistance", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4086, 0x0014, 0x4086, + EVR_SQ, "ReceiveProbeSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4087, 0x0014, 0x4087, + EVR_SQ, "ProbeDriveSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4088, 0x0014, 0x4088, + EVR_DS, "BridgeResistors", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4089, 0x0014, 0x4089, + EVR_DS, "ProbeOrientationAngle", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x408b, 0x0014, 0x408b, + EVR_DS, "UserSelectedGainY", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x408c, 0x0014, 0x408c, + EVR_DS, "UserSelectedPhase", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x408d, 0x0014, 0x408d, + EVR_DS, "UserSelectedOffsetX", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x408e, 0x0014, 0x408e, + EVR_DS, "UserSelectedOffsetY", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4091, 0x0014, 0x4091, + EVR_SQ, "ChannelSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x4092, 0x0014, 0x4092, + EVR_DS, "ChannelThreshold", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x409a, 0x0014, 0x409a, + EVR_SQ, "ScannerSettingsSequence", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x409b, 0x0014, 0x409b, + EVR_ST, "ScanProcedure", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x409c, 0x0014, 0x409c, + EVR_DS, "TranslationRateX", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x409d, 0x0014, 0x409d, + EVR_DS, "TranslationRateY", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x409f, 0x0014, 0x409f, + EVR_DS, "ChannelOverlap", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x40a0, 0x0014, 0x40a0, + EVR_LO, "ImageQualityIndicatorType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x40a1, 0x0014, 0x40a1, + EVR_LO, "ImageQualityIndicatorMaterial", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x40a2, 0x0014, 0x40a2, + EVR_LO, "ImageQualityIndicatorSize", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5002, 0x0014, 0x5002, + EVR_IS, "LINACEnergy", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5004, 0x0014, 0x5004, + EVR_IS, "LINACOutput", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5100, 0x0014, 0x5100, + EVR_US, "ActiveAperture", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5101, 0x0014, 0x5101, + EVR_DS, "TotalAperture", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5102, 0x0014, 0x5102, + EVR_DS, "ApertureElevation", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5103, 0x0014, 0x5103, + EVR_DS, "MainLobeAngle", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5104, 0x0014, 0x5104, + EVR_DS, "MainRoofAngle", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5105, 0x0014, 0x5105, + EVR_CS, "ConnectorType", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5106, 0x0014, 0x5106, + EVR_SH, "WedgeModelNumber", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5107, 0x0014, 0x5107, + EVR_DS, "WedgeAngleFloat", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5108, 0x0014, 0x5108, + EVR_DS, "WedgeRoofAngle", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5109, 0x0014, 0x5109, + EVR_CS, "WedgeElement1Position", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x510a, 0x0014, 0x510a, + EVR_DS, "WedgeMaterialVelocity", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x510b, 0x0014, 0x510b, + EVR_SH, "WedgeMaterial", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x510c, 0x0014, 0x510c, + EVR_DS, "WedgeOffsetZ", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x510d, 0x0014, 0x510d, + EVR_DS, "WedgeOriginOffsetX", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x510e, 0x0014, 0x510e, + EVR_DS, "WedgeTimeDelay", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x510f, 0x0014, 0x510f, + EVR_SH, "WedgeName", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5110, 0x0014, 0x5110, + EVR_SH, "WedgeManufacturerName", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5111, 0x0014, 0x5111, + EVR_LO, "WedgeDescription", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5112, 0x0014, 0x5112, + EVR_DS, "NominalBeamAngle", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5113, 0x0014, 0x5113, + EVR_DS, "WedgeOffsetX", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5114, 0x0014, 0x5114, + EVR_DS, "WedgeOffsetY", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5115, 0x0014, 0x5115, + EVR_DS, "WedgeTotalLength", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5116, 0x0014, 0x5116, + EVR_DS, "WedgeInContactLength", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5117, 0x0014, 0x5117, + EVR_DS, "WedgeFrontGap", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5118, 0x0014, 0x5118, + EVR_DS, "WedgeTotalHeight", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x5119, 0x0014, 0x5119, + EVR_DS, "WedgeFrontHeight", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x511a, 0x0014, 0x511a, + EVR_DS, "WedgeRearHeight", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x511b, 0x0014, 0x511b, + EVR_DS, "WedgeTotalWidth", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x511c, 0x0014, 0x511c, + EVR_DS, "WedgeInContactWidth", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x511d, 0x0014, 0x511d, + EVR_DS, "WedgeChamferHeight", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x511e, 0x0014, 0x511e, + EVR_CS, "WedgeCurve", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0014, 0x511f, 0x0014, 0x511f, + EVR_DS, "RadiusAlongWedge", 1, 1, "DICOM/DICONDE", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0015, 0x0001, 0x0015, 0x0001, + EVR_DS, "StenosisCalibrationRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_EXAMS_01" } + , { 0x0015, 0x0002, 0x0015, 0x0002, + EVR_DS, "StenosisMagnification", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_EXAMS_01" } + , { 0x0015, 0x0003, 0x0015, 0x0003, + EVR_DS, "CardiacCalibrationRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_EXAMS_01" } +#endif + , { 0x0016, 0x0001, 0x0016, 0x0001, + EVR_DS, "WhitePoint", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0002, 0x0016, 0x0002, + EVR_DS, "PrimaryChromaticities", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0003, 0x0016, 0x0003, + EVR_UT, "BatteryLevel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0004, 0x0016, 0x0004, + EVR_DS, "ExposureTimeInSeconds", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0005, 0x0016, 0x0005, + EVR_DS, "FNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0006, 0x0016, 0x0006, + EVR_IS, "OECFRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0007, 0x0016, 0x0007, + EVR_IS, "OECFColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0008, 0x0016, 0x0008, + EVR_UC, "OECFColumnNames", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0009, 0x0016, 0x0009, + EVR_DS, "OECFValues", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x000a, 0x0016, 0x000a, + EVR_IS, "SpatialFrequencyResponseRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x000b, 0x0016, 0x000b, + EVR_IS, "SpatialFrequencyResponseColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x000c, 0x0016, 0x000c, + EVR_UC, "SpatialFrequencyResponseColumnNames", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x000d, 0x0016, 0x000d, + EVR_DS, "SpatialFrequencyResponseValues", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x000e, 0x0016, 0x000e, + EVR_IS, "ColorFilterArrayPatternRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x000f, 0x0016, 0x000f, + EVR_IS, "ColorFilterArrayPatternColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0010, 0x0016, 0x0010, + EVR_DS, "ColorFilterArrayPatternValues", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0011, 0x0016, 0x0011, + EVR_US, "FlashFiringStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0012, 0x0016, 0x0012, + EVR_US, "FlashReturnStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0013, 0x0016, 0x0013, + EVR_US, "FlashMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0014, 0x0016, 0x0014, + EVR_US, "FlashFunctionPresent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0015, 0x0016, 0x0015, + EVR_US, "FlashRedEyeMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0016, 0x0016, 0x0016, + EVR_US, "ExposureProgram", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0017, 0x0016, 0x0017, + EVR_UT, "SpectralSensitivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0018, 0x0016, 0x0018, + EVR_IS, "PhotographicSensitivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0019, 0x0016, 0x0019, + EVR_IS, "SelfTimerMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x001a, 0x0016, 0x001a, + EVR_US, "SensitivityType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x001b, 0x0016, 0x001b, + EVR_IS, "StandardOutputSensitivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x001c, 0x0016, 0x001c, + EVR_IS, "RecommendedExposureIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x001d, 0x0016, 0x001d, + EVR_IS, "ISOSpeed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x001e, 0x0016, 0x001e, + EVR_IS, "ISOSpeedLatitudeyyy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x001f, 0x0016, 0x001f, + EVR_IS, "ISOSpeedLatitudezzz", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0020, 0x0016, 0x0020, + EVR_UT, "EXIFVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0021, 0x0016, 0x0021, + EVR_DS, "ShutterSpeedValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0022, 0x0016, 0x0022, + EVR_DS, "ApertureValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0023, 0x0016, 0x0023, + EVR_DS, "BrightnessValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0024, 0x0016, 0x0024, + EVR_DS, "ExposureBiasValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0025, 0x0016, 0x0025, + EVR_DS, "MaxApertureValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0026, 0x0016, 0x0026, + EVR_DS, "SubjectDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0027, 0x0016, 0x0027, + EVR_US, "MeteringMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0028, 0x0016, 0x0028, + EVR_US, "LightSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0029, 0x0016, 0x0029, + EVR_DS, "FocalLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x002a, 0x0016, 0x002a, + EVR_IS, "SubjectArea", 2, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x002b, 0x0016, 0x002b, + EVR_OB, "MakerNote", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0030, 0x0016, 0x0030, + EVR_DS, "Temperature", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0031, 0x0016, 0x0031, + EVR_DS, "Humidity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0032, 0x0016, 0x0032, + EVR_DS, "Pressure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0033, 0x0016, 0x0033, + EVR_DS, "WaterDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0034, 0x0016, 0x0034, + EVR_DS, "Acceleration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0035, 0x0016, 0x0035, + EVR_DS, "CameraElevationAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0036, 0x0016, 0x0036, + EVR_DS, "FlashEnergy", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0037, 0x0016, 0x0037, + EVR_IS, "SubjectLocation", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0038, 0x0016, 0x0038, + EVR_DS, "PhotographicExposureIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0039, 0x0016, 0x0039, + EVR_US, "SensingMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x003a, 0x0016, 0x003a, + EVR_US, "FileSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x003b, 0x0016, 0x003b, + EVR_US, "SceneType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0041, 0x0016, 0x0041, + EVR_US, "CustomRendered", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0042, 0x0016, 0x0042, + EVR_US, "ExposureMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0043, 0x0016, 0x0043, + EVR_US, "WhiteBalance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0044, 0x0016, 0x0044, + EVR_DS, "DigitalZoomRatio", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0045, 0x0016, 0x0045, + EVR_IS, "FocalLengthIn35mmFilm", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0046, 0x0016, 0x0046, + EVR_US, "SceneCaptureType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0047, 0x0016, 0x0047, + EVR_US, "GainControl", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0048, 0x0016, 0x0048, + EVR_US, "Contrast", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0049, 0x0016, 0x0049, + EVR_US, "Saturation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x004a, 0x0016, 0x004a, + EVR_US, "Sharpness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x004b, 0x0016, 0x004b, + EVR_OB, "DeviceSettingDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x004c, 0x0016, 0x004c, + EVR_US, "SubjectDistanceRange", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x004d, 0x0016, 0x004d, + EVR_UT, "CameraOwnerName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x004e, 0x0016, 0x004e, + EVR_DS, "LensSpecification", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x004f, 0x0016, 0x004f, + EVR_UT, "LensMake", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0050, 0x0016, 0x0050, + EVR_UT, "LensModel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0051, 0x0016, 0x0051, + EVR_UT, "LensSerialNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0061, 0x0016, 0x0061, + EVR_CS, "InteroperabilityIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0062, 0x0016, 0x0062, + EVR_OB, "InteroperabilityVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0070, 0x0016, 0x0070, + EVR_OB, "GPSVersionID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0071, 0x0016, 0x0071, + EVR_CS, "GPSLatitudeRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0072, 0x0016, 0x0072, + EVR_DS, "GPSLatitude", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0073, 0x0016, 0x0073, + EVR_CS, "GPSLongitudeRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0074, 0x0016, 0x0074, + EVR_DS, "GPSLongitude", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0075, 0x0016, 0x0075, + EVR_US, "GPSAltitudeRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0076, 0x0016, 0x0076, + EVR_DS, "GPSAltitude", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0077, 0x0016, 0x0077, + EVR_DT, "GPSTimeStamp", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0078, 0x0016, 0x0078, + EVR_UT, "GPSSatellites", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0079, 0x0016, 0x0079, + EVR_CS, "GPSStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x007a, 0x0016, 0x007a, + EVR_CS, "GPSMeasureMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x007b, 0x0016, 0x007b, + EVR_DS, "GPSDOP", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x007c, 0x0016, 0x007c, + EVR_CS, "GPSSpeedRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x007d, 0x0016, 0x007d, + EVR_DS, "GPSSpeed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x007e, 0x0016, 0x007e, + EVR_CS, "GPSTrackRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x007f, 0x0016, 0x007f, + EVR_DS, "GPSTrack", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0080, 0x0016, 0x0080, + EVR_CS, "GPSImgDirectionRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0081, 0x0016, 0x0081, + EVR_DS, "GPSImgDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0082, 0x0016, 0x0082, + EVR_UT, "GPSMapDatum", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0083, 0x0016, 0x0083, + EVR_CS, "GPSDestLatitudeRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0084, 0x0016, 0x0084, + EVR_DS, "GPSDestLatitude", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0085, 0x0016, 0x0085, + EVR_CS, "GPSDestLongitudeRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0086, 0x0016, 0x0086, + EVR_DS, "GPSDestLongitude", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0087, 0x0016, 0x0087, + EVR_CS, "GPSDestBearingRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0088, 0x0016, 0x0088, + EVR_DS, "GPSDestBearing", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x0089, 0x0016, 0x0089, + EVR_CS, "GPSDestDistanceRef", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x008a, 0x0016, 0x008a, + EVR_DS, "GPSDestDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x008b, 0x0016, 0x008b, + EVR_OB, "GPSProcessingMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x008c, 0x0016, 0x008c, + EVR_OB, "GPSAreaInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x008d, 0x0016, 0x008d, + EVR_DT, "GPSDateStamp", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0016, 0x008e, 0x0016, 0x008e, + EVR_IS, "GPSDifferential", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0017, 0x0000, 0x0017, 0x0000, + EVR_LO, "ExtendedBodyPart", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0017, 0x0010, 0x0017, 0x0010, + EVR_LO, "ExtendedViewPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0017, 0x00f0, 0x0017, 0x00f0, + EVR_IS, "ImagesSOPClass", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } +#endif + , { 0x0018, 0x0010, 0x0018, 0x0010, + EVR_LO, "ContrastBolusAgent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0012, 0x0018, 0x0012, + EVR_SQ, "ContrastBolusAgentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0013, 0x0018, 0x0013, + EVR_FL, "ContrastBolusT1Relaxivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0014, 0x0018, 0x0014, + EVR_SQ, "ContrastBolusAdministrationRouteSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0015, 0x0018, 0x0015, + EVR_CS, "BodyPartExamined", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0020, 0x0018, 0x0020, + EVR_CS, "ScanningSequence", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0021, 0x0018, 0x0021, + EVR_CS, "SequenceVariant", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0022, 0x0018, 0x0022, + EVR_CS, "ScanOptions", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0023, 0x0018, 0x0023, + EVR_CS, "MRAcquisitionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0024, 0x0018, 0x0024, + EVR_SH, "SequenceName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0025, 0x0018, 0x0025, + EVR_CS, "AngioFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0026, 0x0018, 0x0026, + EVR_SQ, "InterventionDrugInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0027, 0x0018, 0x0027, + EVR_TM, "InterventionDrugStopTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0028, 0x0018, 0x0028, + EVR_DS, "InterventionDrugDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0029, 0x0018, 0x0029, + EVR_SQ, "InterventionDrugCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x002a, 0x0018, 0x002a, + EVR_SQ, "AdditionalDrugSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0030, 0x0018, 0x0030, + EVR_LO, "RETIRED_Radionuclide", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0031, 0x0018, 0x0031, + EVR_LO, "Radiopharmaceutical", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0032, 0x0018, 0x0032, + EVR_DS, "RETIRED_EnergyWindowCenterline", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0033, 0x0018, 0x0033, + EVR_DS, "RETIRED_EnergyWindowTotalWidth", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0034, 0x0018, 0x0034, + EVR_LO, "InterventionDrugName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0035, 0x0018, 0x0035, + EVR_TM, "InterventionDrugStartTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0036, 0x0018, 0x0036, + EVR_SQ, "InterventionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0037, 0x0018, 0x0037, + EVR_CS, "RETIRED_TherapyType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0038, 0x0018, 0x0038, + EVR_CS, "InterventionStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0039, 0x0018, 0x0039, + EVR_CS, "RETIRED_TherapyDescription", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x003a, 0x0018, 0x003a, + EVR_ST, "InterventionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0040, 0x0018, 0x0040, + EVR_IS, "CineRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0042, 0x0018, 0x0042, + EVR_CS, "InitialCineRunState", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0050, 0x0018, 0x0050, + EVR_DS, "SliceThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0060, 0x0018, 0x0060, + EVR_DS, "KVP", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0070, 0x0018, 0x0070, + EVR_IS, "CountsAccumulated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0071, 0x0018, 0x0071, + EVR_CS, "AcquisitionTerminationCondition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0072, 0x0018, 0x0072, + EVR_DS, "EffectiveDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0073, 0x0018, 0x0073, + EVR_CS, "AcquisitionStartCondition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0074, 0x0018, 0x0074, + EVR_IS, "AcquisitionStartConditionData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0075, 0x0018, 0x0075, + EVR_IS, "AcquisitionTerminationConditionData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0080, 0x0018, 0x0080, + EVR_DS, "RepetitionTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0081, 0x0018, 0x0081, + EVR_DS, "EchoTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0082, 0x0018, 0x0082, + EVR_DS, "InversionTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0083, 0x0018, 0x0083, + EVR_DS, "NumberOfAverages", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0084, 0x0018, 0x0084, + EVR_DS, "ImagingFrequency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0085, 0x0018, 0x0085, + EVR_SH, "ImagedNucleus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0086, 0x0018, 0x0086, + EVR_IS, "EchoNumbers", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0087, 0x0018, 0x0087, + EVR_DS, "MagneticFieldStrength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0088, 0x0018, 0x0088, + EVR_DS, "SpacingBetweenSlices", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0089, 0x0018, 0x0089, + EVR_IS, "NumberOfPhaseEncodingSteps", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0090, 0x0018, 0x0090, + EVR_DS, "DataCollectionDiameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0091, 0x0018, 0x0091, + EVR_IS, "EchoTrainLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0093, 0x0018, 0x0093, + EVR_DS, "PercentSampling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0094, 0x0018, 0x0094, + EVR_DS, "PercentPhaseFieldOfView", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x0095, 0x0018, 0x0095, + EVR_DS, "PixelBandwidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1000, 0x0018, 0x1000, + EVR_LO, "DeviceSerialNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1002, 0x0018, 0x1002, + EVR_UI, "DeviceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1003, 0x0018, 0x1003, + EVR_LO, "DeviceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1004, 0x0018, 0x1004, + EVR_LO, "PlateID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1005, 0x0018, 0x1005, + EVR_LO, "GeneratorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1006, 0x0018, 0x1006, + EVR_LO, "GridID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1007, 0x0018, 0x1007, + EVR_LO, "CassetteID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1008, 0x0018, 0x1008, + EVR_LO, "GantryID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1009, 0x0018, 0x1009, + EVR_UT, "UniqueDeviceIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x100a, 0x0018, 0x100a, + EVR_SQ, "UDISequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x100b, 0x0018, 0x100b, + EVR_UI, "ManufacturerDeviceClassUID", 1, -1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1010, 0x0018, 0x1010, + EVR_LO, "SecondaryCaptureDeviceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1011, 0x0018, 0x1011, + EVR_LO, "RETIRED_HardcopyCreationDeviceID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1012, 0x0018, 0x1012, + EVR_DA, "DateOfSecondaryCapture", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1014, 0x0018, 0x1014, + EVR_TM, "TimeOfSecondaryCapture", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1016, 0x0018, 0x1016, + EVR_LO, "SecondaryCaptureDeviceManufacturer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1017, 0x0018, 0x1017, + EVR_LO, "RETIRED_HardcopyDeviceManufacturer", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1018, 0x0018, 0x1018, + EVR_LO, "SecondaryCaptureDeviceManufacturerModelName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1019, 0x0018, 0x1019, + EVR_LO, "SecondaryCaptureDeviceSoftwareVersions", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x101a, 0x0018, 0x101a, + EVR_LO, "RETIRED_HardcopyDeviceSoftwareVersion", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x101b, 0x0018, 0x101b, + EVR_LO, "RETIRED_HardcopyDeviceManufacturerModelName", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1020, 0x0018, 0x1020, + EVR_LO, "SoftwareVersions", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1022, 0x0018, 0x1022, + EVR_SH, "VideoImageFormatAcquired", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1023, 0x0018, 0x1023, + EVR_LO, "DigitalImageFormatAcquired", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1030, 0x0018, 0x1030, + EVR_LO, "ProtocolName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1040, 0x0018, 0x1040, + EVR_LO, "ContrastBolusRoute", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1041, 0x0018, 0x1041, + EVR_DS, "ContrastBolusVolume", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1042, 0x0018, 0x1042, + EVR_TM, "ContrastBolusStartTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1043, 0x0018, 0x1043, + EVR_TM, "ContrastBolusStopTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1044, 0x0018, 0x1044, + EVR_DS, "ContrastBolusTotalDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1045, 0x0018, 0x1045, + EVR_IS, "SyringeCounts", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1046, 0x0018, 0x1046, + EVR_DS, "ContrastFlowRate", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1047, 0x0018, 0x1047, + EVR_DS, "ContrastFlowDuration", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1048, 0x0018, 0x1048, + EVR_CS, "ContrastBolusIngredient", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1049, 0x0018, 0x1049, + EVR_DS, "ContrastBolusIngredientConcentration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1050, 0x0018, 0x1050, + EVR_DS, "SpatialResolution", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1060, 0x0018, 0x1060, + EVR_DS, "TriggerTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1061, 0x0018, 0x1061, + EVR_LO, "TriggerSourceOrType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1062, 0x0018, 0x1062, + EVR_IS, "NominalInterval", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1063, 0x0018, 0x1063, + EVR_DS, "FrameTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1064, 0x0018, 0x1064, + EVR_LO, "CardiacFramingType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1065, 0x0018, 0x1065, + EVR_DS, "FrameTimeVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1066, 0x0018, 0x1066, + EVR_DS, "FrameDelay", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1067, 0x0018, 0x1067, + EVR_DS, "ImageTriggerDelay", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1068, 0x0018, 0x1068, + EVR_DS, "MultiplexGroupTimeOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1069, 0x0018, 0x1069, + EVR_DS, "TriggerTimeOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x106a, 0x0018, 0x106a, + EVR_CS, "SynchronizationTrigger", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x106c, 0x0018, 0x106c, + EVR_US, "SynchronizationChannel", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x106e, 0x0018, 0x106e, + EVR_UL, "TriggerSamplePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1070, 0x0018, 0x1070, + EVR_LO, "RadiopharmaceuticalRoute", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1071, 0x0018, 0x1071, + EVR_DS, "RadiopharmaceuticalVolume", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1072, 0x0018, 0x1072, + EVR_TM, "RadiopharmaceuticalStartTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1073, 0x0018, 0x1073, + EVR_TM, "RadiopharmaceuticalStopTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1074, 0x0018, 0x1074, + EVR_DS, "RadionuclideTotalDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1075, 0x0018, 0x1075, + EVR_DS, "RadionuclideHalfLife", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1076, 0x0018, 0x1076, + EVR_DS, "RadionuclidePositronFraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1077, 0x0018, 0x1077, + EVR_DS, "RadiopharmaceuticalSpecificActivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1078, 0x0018, 0x1078, + EVR_DT, "RadiopharmaceuticalStartDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1079, 0x0018, 0x1079, + EVR_DT, "RadiopharmaceuticalStopDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1080, 0x0018, 0x1080, + EVR_CS, "BeatRejectionFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1081, 0x0018, 0x1081, + EVR_IS, "LowRRValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1082, 0x0018, 0x1082, + EVR_IS, "HighRRValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1083, 0x0018, 0x1083, + EVR_IS, "IntervalsAcquired", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1084, 0x0018, 0x1084, + EVR_IS, "IntervalsRejected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1085, 0x0018, 0x1085, + EVR_LO, "PVCRejection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1086, 0x0018, 0x1086, + EVR_IS, "SkipBeats", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1088, 0x0018, 0x1088, + EVR_IS, "HeartRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1090, 0x0018, 0x1090, + EVR_IS, "CardiacNumberOfImages", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1094, 0x0018, 0x1094, + EVR_IS, "TriggerWindow", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1100, 0x0018, 0x1100, + EVR_DS, "ReconstructionDiameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1110, 0x0018, 0x1110, + EVR_DS, "DistanceSourceToDetector", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1111, 0x0018, 0x1111, + EVR_DS, "DistanceSourceToPatient", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1114, 0x0018, 0x1114, + EVR_DS, "EstimatedRadiographicMagnificationFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1120, 0x0018, 0x1120, + EVR_DS, "GantryDetectorTilt", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1121, 0x0018, 0x1121, + EVR_DS, "GantryDetectorSlew", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1130, 0x0018, 0x1130, + EVR_DS, "TableHeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1131, 0x0018, 0x1131, + EVR_DS, "TableTraverse", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1134, 0x0018, 0x1134, + EVR_CS, "TableMotion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1135, 0x0018, 0x1135, + EVR_DS, "TableVerticalIncrement", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1136, 0x0018, 0x1136, + EVR_DS, "TableLateralIncrement", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1137, 0x0018, 0x1137, + EVR_DS, "TableLongitudinalIncrement", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1138, 0x0018, 0x1138, + EVR_DS, "TableAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x113a, 0x0018, 0x113a, + EVR_CS, "TableType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1140, 0x0018, 0x1140, + EVR_CS, "RotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1141, 0x0018, 0x1141, + EVR_DS, "RETIRED_AngularPosition", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1142, 0x0018, 0x1142, + EVR_DS, "RadialPosition", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1143, 0x0018, 0x1143, + EVR_DS, "ScanArc", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1144, 0x0018, 0x1144, + EVR_DS, "AngularStep", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1145, 0x0018, 0x1145, + EVR_DS, "CenterOfRotationOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1146, 0x0018, 0x1146, + EVR_DS, "RETIRED_RotationOffset", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1147, 0x0018, 0x1147, + EVR_CS, "FieldOfViewShape", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1149, 0x0018, 0x1149, + EVR_IS, "FieldOfViewDimensions", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1150, 0x0018, 0x1150, + EVR_IS, "ExposureTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1151, 0x0018, 0x1151, + EVR_IS, "XRayTubeCurrent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1152, 0x0018, 0x1152, + EVR_IS, "Exposure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1153, 0x0018, 0x1153, + EVR_IS, "ExposureInuAs", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1154, 0x0018, 0x1154, + EVR_DS, "AveragePulseWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1155, 0x0018, 0x1155, + EVR_CS, "RadiationSetting", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1156, 0x0018, 0x1156, + EVR_CS, "RectificationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x115a, 0x0018, 0x115a, + EVR_CS, "RadiationMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x115e, 0x0018, 0x115e, + EVR_DS, "ImageAndFluoroscopyAreaDoseProduct", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1160, 0x0018, 0x1160, + EVR_SH, "FilterType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1161, 0x0018, 0x1161, + EVR_LO, "TypeOfFilters", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1162, 0x0018, 0x1162, + EVR_DS, "IntensifierSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1164, 0x0018, 0x1164, + EVR_DS, "ImagerPixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1166, 0x0018, 0x1166, + EVR_CS, "Grid", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1170, 0x0018, 0x1170, + EVR_IS, "GeneratorPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1180, 0x0018, 0x1180, + EVR_SH, "CollimatorGridName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1181, 0x0018, 0x1181, + EVR_CS, "CollimatorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1182, 0x0018, 0x1182, + EVR_IS, "FocalDistance", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1183, 0x0018, 0x1183, + EVR_DS, "XFocusCenter", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1184, 0x0018, 0x1184, + EVR_DS, "YFocusCenter", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1190, 0x0018, 0x1190, + EVR_DS, "FocalSpots", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1191, 0x0018, 0x1191, + EVR_CS, "AnodeTargetMaterial", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x11a0, 0x0018, 0x11a0, + EVR_DS, "BodyPartThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x11a2, 0x0018, 0x11a2, + EVR_DS, "CompressionForce", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x11a3, 0x0018, 0x11a3, + EVR_DS, "CompressionPressure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x11a4, 0x0018, 0x11a4, + EVR_LO, "PaddleDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x11a5, 0x0018, 0x11a5, + EVR_DS, "CompressionContactArea", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1200, 0x0018, 0x1200, + EVR_DA, "DateOfLastCalibration", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1201, 0x0018, 0x1201, + EVR_TM, "TimeOfLastCalibration", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1202, 0x0018, 0x1202, + EVR_DT, "DateTimeOfLastCalibration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1210, 0x0018, 0x1210, + EVR_SH, "ConvolutionKernel", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1240, 0x0018, 0x1240, + EVR_IS, "RETIRED_UpperLowerPixelValues", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1242, 0x0018, 0x1242, + EVR_IS, "ActualFrameDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1243, 0x0018, 0x1243, + EVR_IS, "CountRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1244, 0x0018, 0x1244, + EVR_US, "PreferredPlaybackSequencing", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1250, 0x0018, 0x1250, + EVR_SH, "ReceiveCoilName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1251, 0x0018, 0x1251, + EVR_SH, "TransmitCoilName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1260, 0x0018, 0x1260, + EVR_SH, "PlateType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1261, 0x0018, 0x1261, + EVR_LO, "PhosphorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1271, 0x0018, 0x1271, + EVR_FD, "WaterEquivalentDiameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1272, 0x0018, 0x1272, + EVR_SQ, "WaterEquivalentDiameterCalculationMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1300, 0x0018, 0x1300, + EVR_DS, "ScanVelocity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1301, 0x0018, 0x1301, + EVR_CS, "WholeBodyTechnique", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1302, 0x0018, 0x1302, + EVR_IS, "ScanLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1310, 0x0018, 0x1310, + EVR_US, "AcquisitionMatrix", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1312, 0x0018, 0x1312, + EVR_CS, "InPlanePhaseEncodingDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1314, 0x0018, 0x1314, + EVR_DS, "FlipAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1315, 0x0018, 0x1315, + EVR_CS, "VariableFlipAngleFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1316, 0x0018, 0x1316, + EVR_DS, "SAR", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1318, 0x0018, 0x1318, + EVR_DS, "dBdt", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1320, 0x0018, 0x1320, + EVR_FL, "B1rms", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1400, 0x0018, 0x1400, + EVR_LO, "AcquisitionDeviceProcessingDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1401, 0x0018, 0x1401, + EVR_LO, "AcquisitionDeviceProcessingCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1402, 0x0018, 0x1402, + EVR_CS, "CassetteOrientation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1403, 0x0018, 0x1403, + EVR_CS, "CassetteSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1404, 0x0018, 0x1404, + EVR_US, "ExposuresOnPlate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1405, 0x0018, 0x1405, + EVR_IS, "RelativeXRayExposure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1411, 0x0018, 0x1411, + EVR_DS, "ExposureIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1412, 0x0018, 0x1412, + EVR_DS, "TargetExposureIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1413, 0x0018, 0x1413, + EVR_DS, "DeviationIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1450, 0x0018, 0x1450, + EVR_DS, "ColumnAngulation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1460, 0x0018, 0x1460, + EVR_DS, "TomoLayerHeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1470, 0x0018, 0x1470, + EVR_DS, "TomoAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1480, 0x0018, 0x1480, + EVR_DS, "TomoTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1490, 0x0018, 0x1490, + EVR_CS, "TomoType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1491, 0x0018, 0x1491, + EVR_CS, "TomoClass", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1495, 0x0018, 0x1495, + EVR_IS, "NumberOfTomosynthesisSourceImages", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1500, 0x0018, 0x1500, + EVR_CS, "PositionerMotion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1508, 0x0018, 0x1508, + EVR_CS, "PositionerType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1510, 0x0018, 0x1510, + EVR_DS, "PositionerPrimaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1511, 0x0018, 0x1511, + EVR_DS, "PositionerSecondaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1520, 0x0018, 0x1520, + EVR_DS, "PositionerPrimaryAngleIncrement", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1521, 0x0018, 0x1521, + EVR_DS, "PositionerSecondaryAngleIncrement", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1530, 0x0018, 0x1530, + EVR_DS, "DetectorPrimaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1531, 0x0018, 0x1531, + EVR_DS, "DetectorSecondaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1600, 0x0018, 0x1600, + EVR_CS, "ShutterShape", 1, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1602, 0x0018, 0x1602, + EVR_IS, "ShutterLeftVerticalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1604, 0x0018, 0x1604, + EVR_IS, "ShutterRightVerticalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1606, 0x0018, 0x1606, + EVR_IS, "ShutterUpperHorizontalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1608, 0x0018, 0x1608, + EVR_IS, "ShutterLowerHorizontalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1610, 0x0018, 0x1610, + EVR_IS, "CenterOfCircularShutter", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1612, 0x0018, 0x1612, + EVR_IS, "RadiusOfCircularShutter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1620, 0x0018, 0x1620, + EVR_IS, "VerticesOfThePolygonalShutter", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1622, 0x0018, 0x1622, + EVR_US, "ShutterPresentationValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1623, 0x0018, 0x1623, + EVR_US, "ShutterOverlayGroup", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1624, 0x0018, 0x1624, + EVR_US, "ShutterPresentationColorCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1630, 0x0018, 0x1630, + EVR_CS, "OutlineShapeType", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1631, 0x0018, 0x1631, + EVR_FD, "OutlineLeftVerticalEdge", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1632, 0x0018, 0x1632, + EVR_FD, "OutlineRightVerticalEdge", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1633, 0x0018, 0x1633, + EVR_FD, "OutlineUpperHorizontalEdge", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1634, 0x0018, 0x1634, + EVR_FD, "OutlineLowerHorizontalEdge", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1635, 0x0018, 0x1635, + EVR_FD, "CenterOfCircularOutline", 2, 2, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1636, 0x0018, 0x1636, + EVR_FD, "DiameterOfCircularOutline", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1637, 0x0018, 0x1637, + EVR_UL, "NumberOfPolygonalVertices", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1638, 0x0018, 0x1638, + EVR_OF, "VerticesOfThePolygonalOutline", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1700, 0x0018, 0x1700, + EVR_CS, "CollimatorShape", 1, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1702, 0x0018, 0x1702, + EVR_IS, "CollimatorLeftVerticalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1704, 0x0018, 0x1704, + EVR_IS, "CollimatorRightVerticalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1706, 0x0018, 0x1706, + EVR_IS, "CollimatorUpperHorizontalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1708, 0x0018, 0x1708, + EVR_IS, "CollimatorLowerHorizontalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1710, 0x0018, 0x1710, + EVR_IS, "CenterOfCircularCollimator", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1712, 0x0018, 0x1712, + EVR_IS, "RadiusOfCircularCollimator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1720, 0x0018, 0x1720, + EVR_IS, "VerticesOfThePolygonalCollimator", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1800, 0x0018, 0x1800, + EVR_CS, "AcquisitionTimeSynchronized", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1801, 0x0018, 0x1801, + EVR_SH, "TimeSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1802, 0x0018, 0x1802, + EVR_CS, "TimeDistributionProtocol", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x1803, 0x0018, 0x1803, + EVR_LO, "NTPSourceAddress", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2001, 0x0018, 0x2001, + EVR_IS, "PageNumberVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2002, 0x0018, 0x2002, + EVR_SH, "FrameLabelVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2003, 0x0018, 0x2003, + EVR_DS, "FramePrimaryAngleVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2004, 0x0018, 0x2004, + EVR_DS, "FrameSecondaryAngleVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2005, 0x0018, 0x2005, + EVR_DS, "SliceLocationVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2006, 0x0018, 0x2006, + EVR_SH, "DisplayWindowLabelVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2010, 0x0018, 0x2010, + EVR_DS, "NominalScannedPixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2020, 0x0018, 0x2020, + EVR_CS, "DigitizingDeviceTransportDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2030, 0x0018, 0x2030, + EVR_DS, "RotationOfScannedFilm", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2041, 0x0018, 0x2041, + EVR_SQ, "BiopsyTargetSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2042, 0x0018, 0x2042, + EVR_UI, "TargetUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2043, 0x0018, 0x2043, + EVR_FL, "LocalizingCursorPosition", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2044, 0x0018, 0x2044, + EVR_FL, "CalculatedTargetPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2045, 0x0018, 0x2045, + EVR_SH, "TargetLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x2046, 0x0018, 0x2046, + EVR_FL, "DisplayedZValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x3100, 0x0018, 0x3100, + EVR_CS, "IVUSAcquisition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x3101, 0x0018, 0x3101, + EVR_DS, "IVUSPullbackRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x3102, 0x0018, 0x3102, + EVR_DS, "IVUSGatedRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x3103, 0x0018, 0x3103, + EVR_IS, "IVUSPullbackStartFrameNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x3104, 0x0018, 0x3104, + EVR_IS, "IVUSPullbackStopFrameNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x3105, 0x0018, 0x3105, + EVR_IS, "LesionNumber", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x4000, 0x0018, 0x4000, + EVR_LT, "RETIRED_AcquisitionComments", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5000, 0x0018, 0x5000, + EVR_SH, "OutputPower", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5010, 0x0018, 0x5010, + EVR_LO, "TransducerData", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5012, 0x0018, 0x5012, + EVR_DS, "FocusDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5020, 0x0018, 0x5020, + EVR_LO, "ProcessingFunction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5021, 0x0018, 0x5021, + EVR_LO, "RETIRED_PostprocessingFunction", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5022, 0x0018, 0x5022, + EVR_DS, "MechanicalIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5024, 0x0018, 0x5024, + EVR_DS, "BoneThermalIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5026, 0x0018, 0x5026, + EVR_DS, "CranialThermalIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5027, 0x0018, 0x5027, + EVR_DS, "SoftTissueThermalIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5028, 0x0018, 0x5028, + EVR_DS, "SoftTissueFocusThermalIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5029, 0x0018, 0x5029, + EVR_DS, "SoftTissueSurfaceThermalIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5030, 0x0018, 0x5030, + EVR_DS, "RETIRED_DynamicRange", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5040, 0x0018, 0x5040, + EVR_DS, "RETIRED_TotalGain", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5050, 0x0018, 0x5050, + EVR_IS, "DepthOfScanField", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5100, 0x0018, 0x5100, + EVR_CS, "PatientPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5101, 0x0018, 0x5101, + EVR_CS, "ViewPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5104, 0x0018, 0x5104, + EVR_SQ, "ProjectionEponymousNameCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5210, 0x0018, 0x5210, + EVR_DS, "RETIRED_ImageTransformationMatrix", 6, 6, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x5212, 0x0018, 0x5212, + EVR_DS, "RETIRED_ImageTranslationVector", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6000, 0x0018, 0x6000, + EVR_DS, "Sensitivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6011, 0x0018, 0x6011, + EVR_SQ, "SequenceOfUltrasoundRegions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6012, 0x0018, 0x6012, + EVR_US, "RegionSpatialFormat", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6014, 0x0018, 0x6014, + EVR_US, "RegionDataType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6016, 0x0018, 0x6016, + EVR_UL, "RegionFlags", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6018, 0x0018, 0x6018, + EVR_UL, "RegionLocationMinX0", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x601a, 0x0018, 0x601a, + EVR_UL, "RegionLocationMinY0", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x601c, 0x0018, 0x601c, + EVR_UL, "RegionLocationMaxX1", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x601e, 0x0018, 0x601e, + EVR_UL, "RegionLocationMaxY1", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6020, 0x0018, 0x6020, + EVR_SL, "ReferencePixelX0", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6022, 0x0018, 0x6022, + EVR_SL, "ReferencePixelY0", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6024, 0x0018, 0x6024, + EVR_US, "PhysicalUnitsXDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6026, 0x0018, 0x6026, + EVR_US, "PhysicalUnitsYDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6028, 0x0018, 0x6028, + EVR_FD, "ReferencePixelPhysicalValueX", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x602a, 0x0018, 0x602a, + EVR_FD, "ReferencePixelPhysicalValueY", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x602c, 0x0018, 0x602c, + EVR_FD, "PhysicalDeltaX", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x602e, 0x0018, 0x602e, + EVR_FD, "PhysicalDeltaY", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6030, 0x0018, 0x6030, + EVR_UL, "TransducerFrequency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6031, 0x0018, 0x6031, + EVR_CS, "TransducerType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6032, 0x0018, 0x6032, + EVR_UL, "PulseRepetitionFrequency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6034, 0x0018, 0x6034, + EVR_FD, "DopplerCorrectionAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6036, 0x0018, 0x6036, + EVR_FD, "SteeringAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6038, 0x0018, 0x6038, + EVR_UL, "RETIRED_DopplerSampleVolumeXPositionRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6039, 0x0018, 0x6039, + EVR_SL, "DopplerSampleVolumeXPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x603a, 0x0018, 0x603a, + EVR_UL, "RETIRED_DopplerSampleVolumeYPositionRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x603b, 0x0018, 0x603b, + EVR_SL, "DopplerSampleVolumeYPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x603c, 0x0018, 0x603c, + EVR_UL, "RETIRED_TMLinePositionX0Retired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x603d, 0x0018, 0x603d, + EVR_SL, "TMLinePositionX0", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x603e, 0x0018, 0x603e, + EVR_UL, "RETIRED_TMLinePositionY0Retired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x603f, 0x0018, 0x603f, + EVR_SL, "TMLinePositionY0", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6040, 0x0018, 0x6040, + EVR_UL, "RETIRED_TMLinePositionX1Retired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6041, 0x0018, 0x6041, + EVR_SL, "TMLinePositionX1", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6042, 0x0018, 0x6042, + EVR_UL, "RETIRED_TMLinePositionY1Retired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6043, 0x0018, 0x6043, + EVR_SL, "TMLinePositionY1", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6044, 0x0018, 0x6044, + EVR_US, "PixelComponentOrganization", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6046, 0x0018, 0x6046, + EVR_UL, "PixelComponentMask", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6048, 0x0018, 0x6048, + EVR_UL, "PixelComponentRangeStart", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x604a, 0x0018, 0x604a, + EVR_UL, "PixelComponentRangeStop", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x604c, 0x0018, 0x604c, + EVR_US, "PixelComponentPhysicalUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x604e, 0x0018, 0x604e, + EVR_US, "PixelComponentDataType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6050, 0x0018, 0x6050, + EVR_UL, "NumberOfTableBreakPoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6052, 0x0018, 0x6052, + EVR_UL, "TableOfXBreakPoints", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6054, 0x0018, 0x6054, + EVR_FD, "TableOfYBreakPoints", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6056, 0x0018, 0x6056, + EVR_UL, "NumberOfTableEntries", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6058, 0x0018, 0x6058, + EVR_UL, "TableOfPixelValues", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x605a, 0x0018, 0x605a, + EVR_FL, "TableOfParameterValues", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x6060, 0x0018, 0x6060, + EVR_FL, "RWaveTimeVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7000, 0x0018, 0x7000, + EVR_CS, "DetectorConditionsNominalFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7001, 0x0018, 0x7001, + EVR_DS, "DetectorTemperature", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7004, 0x0018, 0x7004, + EVR_CS, "DetectorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7005, 0x0018, 0x7005, + EVR_CS, "DetectorConfiguration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7006, 0x0018, 0x7006, + EVR_LT, "DetectorDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7008, 0x0018, 0x7008, + EVR_LT, "DetectorMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x700a, 0x0018, 0x700a, + EVR_SH, "DetectorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x700c, 0x0018, 0x700c, + EVR_DA, "DateOfLastDetectorCalibration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x700e, 0x0018, 0x700e, + EVR_TM, "TimeOfLastDetectorCalibration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7010, 0x0018, 0x7010, + EVR_IS, "ExposuresOnDetectorSinceLastCalibration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7011, 0x0018, 0x7011, + EVR_IS, "ExposuresOnDetectorSinceManufactured", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7012, 0x0018, 0x7012, + EVR_DS, "DetectorTimeSinceLastExposure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7014, 0x0018, 0x7014, + EVR_DS, "DetectorActiveTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7016, 0x0018, 0x7016, + EVR_DS, "DetectorActivationOffsetFromExposure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x701a, 0x0018, 0x701a, + EVR_DS, "DetectorBinning", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7020, 0x0018, 0x7020, + EVR_DS, "DetectorElementPhysicalSize", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7022, 0x0018, 0x7022, + EVR_DS, "DetectorElementSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7024, 0x0018, 0x7024, + EVR_CS, "DetectorActiveShape", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7026, 0x0018, 0x7026, + EVR_DS, "DetectorActiveDimensions", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7028, 0x0018, 0x7028, + EVR_DS, "DetectorActiveOrigin", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x702a, 0x0018, 0x702a, + EVR_LO, "DetectorManufacturerName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x702b, 0x0018, 0x702b, + EVR_LO, "DetectorManufacturerModelName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7030, 0x0018, 0x7030, + EVR_DS, "FieldOfViewOrigin", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7032, 0x0018, 0x7032, + EVR_DS, "FieldOfViewRotation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7034, 0x0018, 0x7034, + EVR_CS, "FieldOfViewHorizontalFlip", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7036, 0x0018, 0x7036, + EVR_FL, "PixelDataAreaOriginRelativeToFOV", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7038, 0x0018, 0x7038, + EVR_FL, "PixelDataAreaRotationAngleRelativeToFOV", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7040, 0x0018, 0x7040, + EVR_LT, "GridAbsorbingMaterial", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7041, 0x0018, 0x7041, + EVR_LT, "GridSpacingMaterial", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7042, 0x0018, 0x7042, + EVR_DS, "GridThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7044, 0x0018, 0x7044, + EVR_DS, "GridPitch", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7046, 0x0018, 0x7046, + EVR_IS, "GridAspectRatio", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7048, 0x0018, 0x7048, + EVR_DS, "GridPeriod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x704c, 0x0018, 0x704c, + EVR_DS, "GridFocalDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7050, 0x0018, 0x7050, + EVR_CS, "FilterMaterial", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7052, 0x0018, 0x7052, + EVR_DS, "FilterThicknessMinimum", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7054, 0x0018, 0x7054, + EVR_DS, "FilterThicknessMaximum", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7056, 0x0018, 0x7056, + EVR_FL, "FilterBeamPathLengthMinimum", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7058, 0x0018, 0x7058, + EVR_FL, "FilterBeamPathLengthMaximum", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7060, 0x0018, 0x7060, + EVR_CS, "ExposureControlMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7062, 0x0018, 0x7062, + EVR_LT, "ExposureControlModeDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7064, 0x0018, 0x7064, + EVR_CS, "ExposureStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x7065, 0x0018, 0x7065, + EVR_DS, "PhototimerSetting", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x8150, 0x0018, 0x8150, + EVR_DS, "ExposureTimeInuS", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x8151, 0x0018, 0x8151, + EVR_DS, "XRayTubeCurrentInuA", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9004, 0x0018, 0x9004, + EVR_CS, "ContentQualification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9005, 0x0018, 0x9005, + EVR_SH, "PulseSequenceName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9006, 0x0018, 0x9006, + EVR_SQ, "MRImagingModifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9008, 0x0018, 0x9008, + EVR_CS, "EchoPulseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9009, 0x0018, 0x9009, + EVR_CS, "InversionRecovery", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9010, 0x0018, 0x9010, + EVR_CS, "FlowCompensation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9011, 0x0018, 0x9011, + EVR_CS, "MultipleSpinEcho", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9012, 0x0018, 0x9012, + EVR_CS, "MultiPlanarExcitation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9014, 0x0018, 0x9014, + EVR_CS, "PhaseContrast", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9015, 0x0018, 0x9015, + EVR_CS, "TimeOfFlightContrast", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9016, 0x0018, 0x9016, + EVR_CS, "Spoiling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9017, 0x0018, 0x9017, + EVR_CS, "SteadyStatePulseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9018, 0x0018, 0x9018, + EVR_CS, "EchoPlanarPulseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9019, 0x0018, 0x9019, + EVR_FD, "TagAngleFirstAxis", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9020, 0x0018, 0x9020, + EVR_CS, "MagnetizationTransfer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9021, 0x0018, 0x9021, + EVR_CS, "T2Preparation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9022, 0x0018, 0x9022, + EVR_CS, "BloodSignalNulling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9024, 0x0018, 0x9024, + EVR_CS, "SaturationRecovery", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9025, 0x0018, 0x9025, + EVR_CS, "SpectrallySelectedSuppression", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9026, 0x0018, 0x9026, + EVR_CS, "SpectrallySelectedExcitation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9027, 0x0018, 0x9027, + EVR_CS, "SpatialPresaturation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9028, 0x0018, 0x9028, + EVR_CS, "Tagging", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9029, 0x0018, 0x9029, + EVR_CS, "OversamplingPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9030, 0x0018, 0x9030, + EVR_FD, "TagSpacingFirstDimension", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9032, 0x0018, 0x9032, + EVR_CS, "GeometryOfKSpaceTraversal", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9033, 0x0018, 0x9033, + EVR_CS, "SegmentedKSpaceTraversal", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9034, 0x0018, 0x9034, + EVR_CS, "RectilinearPhaseEncodeReordering", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9035, 0x0018, 0x9035, + EVR_FD, "TagThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9036, 0x0018, 0x9036, + EVR_CS, "PartialFourierDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9037, 0x0018, 0x9037, + EVR_CS, "CardiacSynchronizationTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9041, 0x0018, 0x9041, + EVR_LO, "ReceiveCoilManufacturerName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9042, 0x0018, 0x9042, + EVR_SQ, "MRReceiveCoilSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9043, 0x0018, 0x9043, + EVR_CS, "ReceiveCoilType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9044, 0x0018, 0x9044, + EVR_CS, "QuadratureReceiveCoil", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9045, 0x0018, 0x9045, + EVR_SQ, "MultiCoilDefinitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9046, 0x0018, 0x9046, + EVR_LO, "MultiCoilConfiguration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9047, 0x0018, 0x9047, + EVR_SH, "MultiCoilElementName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9048, 0x0018, 0x9048, + EVR_CS, "MultiCoilElementUsed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9049, 0x0018, 0x9049, + EVR_SQ, "MRTransmitCoilSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9050, 0x0018, 0x9050, + EVR_LO, "TransmitCoilManufacturerName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9051, 0x0018, 0x9051, + EVR_CS, "TransmitCoilType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9052, 0x0018, 0x9052, + EVR_FD, "SpectralWidth", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9053, 0x0018, 0x9053, + EVR_FD, "ChemicalShiftReference", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9054, 0x0018, 0x9054, + EVR_CS, "VolumeLocalizationTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9058, 0x0018, 0x9058, + EVR_US, "MRAcquisitionFrequencyEncodingSteps", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9059, 0x0018, 0x9059, + EVR_CS, "Decoupling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9060, 0x0018, 0x9060, + EVR_CS, "DecoupledNucleus", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9061, 0x0018, 0x9061, + EVR_FD, "DecouplingFrequency", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9062, 0x0018, 0x9062, + EVR_CS, "DecouplingMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9063, 0x0018, 0x9063, + EVR_FD, "DecouplingChemicalShiftReference", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9064, 0x0018, 0x9064, + EVR_CS, "KSpaceFiltering", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9065, 0x0018, 0x9065, + EVR_CS, "TimeDomainFiltering", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9066, 0x0018, 0x9066, + EVR_US, "NumberOfZeroFills", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9067, 0x0018, 0x9067, + EVR_CS, "BaselineCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9069, 0x0018, 0x9069, + EVR_FD, "ParallelReductionFactorInPlane", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9070, 0x0018, 0x9070, + EVR_FD, "CardiacRRIntervalSpecified", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9073, 0x0018, 0x9073, + EVR_FD, "AcquisitionDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9074, 0x0018, 0x9074, + EVR_DT, "FrameAcquisitionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9075, 0x0018, 0x9075, + EVR_CS, "DiffusionDirectionality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9076, 0x0018, 0x9076, + EVR_SQ, "DiffusionGradientDirectionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9077, 0x0018, 0x9077, + EVR_CS, "ParallelAcquisition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9078, 0x0018, 0x9078, + EVR_CS, "ParallelAcquisitionTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9079, 0x0018, 0x9079, + EVR_FD, "InversionTimes", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9080, 0x0018, 0x9080, + EVR_ST, "MetaboliteMapDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9081, 0x0018, 0x9081, + EVR_CS, "PartialFourier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9082, 0x0018, 0x9082, + EVR_FD, "EffectiveEchoTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9083, 0x0018, 0x9083, + EVR_SQ, "MetaboliteMapCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9084, 0x0018, 0x9084, + EVR_SQ, "ChemicalShiftSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9085, 0x0018, 0x9085, + EVR_CS, "CardiacSignalSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9087, 0x0018, 0x9087, + EVR_FD, "DiffusionBValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9089, 0x0018, 0x9089, + EVR_FD, "DiffusionGradientOrientation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9090, 0x0018, 0x9090, + EVR_FD, "VelocityEncodingDirection", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9091, 0x0018, 0x9091, + EVR_FD, "VelocityEncodingMinimumValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9092, 0x0018, 0x9092, + EVR_SQ, "VelocityEncodingAcquisitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9093, 0x0018, 0x9093, + EVR_US, "NumberOfKSpaceTrajectories", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9094, 0x0018, 0x9094, + EVR_CS, "CoverageOfKSpace", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9095, 0x0018, 0x9095, + EVR_UL, "SpectroscopyAcquisitionPhaseRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9096, 0x0018, 0x9096, + EVR_FD, "RETIRED_ParallelReductionFactorInPlaneRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9098, 0x0018, 0x9098, + EVR_FD, "TransmitterFrequency", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9100, 0x0018, 0x9100, + EVR_CS, "ResonantNucleus", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9101, 0x0018, 0x9101, + EVR_CS, "FrequencyCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9103, 0x0018, 0x9103, + EVR_SQ, "MRSpectroscopyFOVGeometrySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9104, 0x0018, 0x9104, + EVR_FD, "SlabThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9105, 0x0018, 0x9105, + EVR_FD, "SlabOrientation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9106, 0x0018, 0x9106, + EVR_FD, "MidSlabPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9107, 0x0018, 0x9107, + EVR_SQ, "MRSpatialSaturationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9112, 0x0018, 0x9112, + EVR_SQ, "MRTimingAndRelatedParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9114, 0x0018, 0x9114, + EVR_SQ, "MREchoSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9115, 0x0018, 0x9115, + EVR_SQ, "MRModifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9117, 0x0018, 0x9117, + EVR_SQ, "MRDiffusionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9118, 0x0018, 0x9118, + EVR_SQ, "CardiacSynchronizationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9119, 0x0018, 0x9119, + EVR_SQ, "MRAveragesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9125, 0x0018, 0x9125, + EVR_SQ, "MRFOVGeometrySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9126, 0x0018, 0x9126, + EVR_SQ, "VolumeLocalizationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9127, 0x0018, 0x9127, + EVR_UL, "SpectroscopyAcquisitionDataColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9147, 0x0018, 0x9147, + EVR_CS, "DiffusionAnisotropyType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9151, 0x0018, 0x9151, + EVR_DT, "FrameReferenceDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9152, 0x0018, 0x9152, + EVR_SQ, "MRMetaboliteMapSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9155, 0x0018, 0x9155, + EVR_FD, "ParallelReductionFactorOutOfPlane", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9159, 0x0018, 0x9159, + EVR_UL, "SpectroscopyAcquisitionOutOfPlanePhaseSteps", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9166, 0x0018, 0x9166, + EVR_CS, "RETIRED_BulkMotionStatus", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9168, 0x0018, 0x9168, + EVR_FD, "ParallelReductionFactorSecondInPlane", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9169, 0x0018, 0x9169, + EVR_CS, "CardiacBeatRejectionTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9170, 0x0018, 0x9170, + EVR_CS, "RespiratoryMotionCompensationTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9171, 0x0018, 0x9171, + EVR_CS, "RespiratorySignalSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9172, 0x0018, 0x9172, + EVR_CS, "BulkMotionCompensationTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9173, 0x0018, 0x9173, + EVR_CS, "BulkMotionSignalSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9174, 0x0018, 0x9174, + EVR_CS, "ApplicableSafetyStandardAgency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9175, 0x0018, 0x9175, + EVR_LO, "ApplicableSafetyStandardDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9176, 0x0018, 0x9176, + EVR_SQ, "OperatingModeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9177, 0x0018, 0x9177, + EVR_CS, "OperatingModeType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9178, 0x0018, 0x9178, + EVR_CS, "OperatingMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9179, 0x0018, 0x9179, + EVR_CS, "SpecificAbsorptionRateDefinition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9180, 0x0018, 0x9180, + EVR_CS, "GradientOutputType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9181, 0x0018, 0x9181, + EVR_FD, "SpecificAbsorptionRateValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9182, 0x0018, 0x9182, + EVR_FD, "GradientOutput", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9183, 0x0018, 0x9183, + EVR_CS, "FlowCompensationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9184, 0x0018, 0x9184, + EVR_FD, "TaggingDelay", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9185, 0x0018, 0x9185, + EVR_ST, "RespiratoryMotionCompensationTechniqueDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9186, 0x0018, 0x9186, + EVR_SH, "RespiratorySignalSourceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9195, 0x0018, 0x9195, + EVR_FD, "RETIRED_ChemicalShiftMinimumIntegrationLimitInHz", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9196, 0x0018, 0x9196, + EVR_FD, "RETIRED_ChemicalShiftMaximumIntegrationLimitInHz", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9197, 0x0018, 0x9197, + EVR_SQ, "MRVelocityEncodingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9198, 0x0018, 0x9198, + EVR_CS, "FirstOrderPhaseCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9199, 0x0018, 0x9199, + EVR_CS, "WaterReferencedPhaseCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9200, 0x0018, 0x9200, + EVR_CS, "MRSpectroscopyAcquisitionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9214, 0x0018, 0x9214, + EVR_CS, "RespiratoryCyclePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9217, 0x0018, 0x9217, + EVR_FD, "VelocityEncodingMaximumValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9218, 0x0018, 0x9218, + EVR_FD, "TagSpacingSecondDimension", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9219, 0x0018, 0x9219, + EVR_SS, "TagAngleSecondAxis", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9220, 0x0018, 0x9220, + EVR_FD, "FrameAcquisitionDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9226, 0x0018, 0x9226, + EVR_SQ, "MRImageFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9227, 0x0018, 0x9227, + EVR_SQ, "MRSpectroscopyFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9231, 0x0018, 0x9231, + EVR_US, "MRAcquisitionPhaseEncodingStepsInPlane", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9232, 0x0018, 0x9232, + EVR_US, "MRAcquisitionPhaseEncodingStepsOutOfPlane", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9234, 0x0018, 0x9234, + EVR_UL, "SpectroscopyAcquisitionPhaseColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9236, 0x0018, 0x9236, + EVR_CS, "CardiacCyclePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9239, 0x0018, 0x9239, + EVR_SQ, "SpecificAbsorptionRateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9240, 0x0018, 0x9240, + EVR_US, "RFEchoTrainLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9241, 0x0018, 0x9241, + EVR_US, "GradientEchoTrainLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9250, 0x0018, 0x9250, + EVR_CS, "ArterialSpinLabelingContrast", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9251, 0x0018, 0x9251, + EVR_SQ, "MRArterialSpinLabelingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9252, 0x0018, 0x9252, + EVR_LO, "ASLTechniqueDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9253, 0x0018, 0x9253, + EVR_US, "ASLSlabNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9254, 0x0018, 0x9254, + EVR_FD, "ASLSlabThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9255, 0x0018, 0x9255, + EVR_FD, "ASLSlabOrientation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9256, 0x0018, 0x9256, + EVR_FD, "ASLMidSlabPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9257, 0x0018, 0x9257, + EVR_CS, "ASLContext", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9258, 0x0018, 0x9258, + EVR_UL, "ASLPulseTrainDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9259, 0x0018, 0x9259, + EVR_CS, "ASLCrusherFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x925a, 0x0018, 0x925a, + EVR_FD, "ASLCrusherFlowLimit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x925b, 0x0018, 0x925b, + EVR_LO, "ASLCrusherDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x925c, 0x0018, 0x925c, + EVR_CS, "ASLBolusCutoffFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x925d, 0x0018, 0x925d, + EVR_SQ, "ASLBolusCutoffTimingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x925e, 0x0018, 0x925e, + EVR_LO, "ASLBolusCutoffTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x925f, 0x0018, 0x925f, + EVR_UL, "ASLBolusCutoffDelayTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9260, 0x0018, 0x9260, + EVR_SQ, "ASLSlabSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9295, 0x0018, 0x9295, + EVR_FD, "ChemicalShiftMinimumIntegrationLimitInppm", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9296, 0x0018, 0x9296, + EVR_FD, "ChemicalShiftMaximumIntegrationLimitInppm", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9297, 0x0018, 0x9297, + EVR_CS, "WaterReferenceAcquisition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9298, 0x0018, 0x9298, + EVR_IS, "EchoPeakPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9301, 0x0018, 0x9301, + EVR_SQ, "CTAcquisitionTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9302, 0x0018, 0x9302, + EVR_CS, "AcquisitionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9303, 0x0018, 0x9303, + EVR_FD, "TubeAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9304, 0x0018, 0x9304, + EVR_SQ, "CTAcquisitionDetailsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9305, 0x0018, 0x9305, + EVR_FD, "RevolutionTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9306, 0x0018, 0x9306, + EVR_FD, "SingleCollimationWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9307, 0x0018, 0x9307, + EVR_FD, "TotalCollimationWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9308, 0x0018, 0x9308, + EVR_SQ, "CTTableDynamicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9309, 0x0018, 0x9309, + EVR_FD, "TableSpeed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9310, 0x0018, 0x9310, + EVR_FD, "TableFeedPerRotation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9311, 0x0018, 0x9311, + EVR_FD, "SpiralPitchFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9312, 0x0018, 0x9312, + EVR_SQ, "CTGeometrySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9313, 0x0018, 0x9313, + EVR_FD, "DataCollectionCenterPatient", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9314, 0x0018, 0x9314, + EVR_SQ, "CTReconstructionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9315, 0x0018, 0x9315, + EVR_CS, "ReconstructionAlgorithm", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9316, 0x0018, 0x9316, + EVR_CS, "ConvolutionKernelGroup", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9317, 0x0018, 0x9317, + EVR_FD, "ReconstructionFieldOfView", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9318, 0x0018, 0x9318, + EVR_FD, "ReconstructionTargetCenterPatient", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9319, 0x0018, 0x9319, + EVR_FD, "ReconstructionAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9320, 0x0018, 0x9320, + EVR_SH, "ImageFilter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9321, 0x0018, 0x9321, + EVR_SQ, "CTExposureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9322, 0x0018, 0x9322, + EVR_FD, "ReconstructionPixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9323, 0x0018, 0x9323, + EVR_CS, "ExposureModulationType", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9324, 0x0018, 0x9324, + EVR_FD, "EstimatedDoseSaving", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9325, 0x0018, 0x9325, + EVR_SQ, "CTXRayDetailsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9326, 0x0018, 0x9326, + EVR_SQ, "CTPositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9327, 0x0018, 0x9327, + EVR_FD, "TablePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9328, 0x0018, 0x9328, + EVR_FD, "ExposureTimeInms", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9329, 0x0018, 0x9329, + EVR_SQ, "CTImageFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9330, 0x0018, 0x9330, + EVR_FD, "XRayTubeCurrentInmA", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9332, 0x0018, 0x9332, + EVR_FD, "ExposureInmAs", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9333, 0x0018, 0x9333, + EVR_CS, "ConstantVolumeFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9334, 0x0018, 0x9334, + EVR_CS, "FluoroscopyFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9335, 0x0018, 0x9335, + EVR_FD, "DistanceSourceToDataCollectionCenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9337, 0x0018, 0x9337, + EVR_US, "ContrastBolusAgentNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9338, 0x0018, 0x9338, + EVR_SQ, "ContrastBolusIngredientCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9340, 0x0018, 0x9340, + EVR_SQ, "ContrastAdministrationProfileSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9341, 0x0018, 0x9341, + EVR_SQ, "ContrastBolusUsageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9342, 0x0018, 0x9342, + EVR_CS, "ContrastBolusAgentAdministered", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9343, 0x0018, 0x9343, + EVR_CS, "ContrastBolusAgentDetected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9344, 0x0018, 0x9344, + EVR_CS, "ContrastBolusAgentPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9345, 0x0018, 0x9345, + EVR_FD, "CTDIvol", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9346, 0x0018, 0x9346, + EVR_SQ, "CTDIPhantomTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9351, 0x0018, 0x9351, + EVR_FL, "CalciumScoringMassFactorPatient", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9352, 0x0018, 0x9352, + EVR_FL, "CalciumScoringMassFactorDevice", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9353, 0x0018, 0x9353, + EVR_FL, "EnergyWeightingFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9360, 0x0018, 0x9360, + EVR_SQ, "CTAdditionalXRaySourceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9361, 0x0018, 0x9361, + EVR_CS, "MultienergyCTAcquisition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9362, 0x0018, 0x9362, + EVR_SQ, "MultienergyCTAcquisitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9363, 0x0018, 0x9363, + EVR_SQ, "MultienergyCTProcessingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9364, 0x0018, 0x9364, + EVR_SQ, "MultienergyCTCharacteristicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9365, 0x0018, 0x9365, + EVR_SQ, "MultienergyCTXRaySourceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9366, 0x0018, 0x9366, + EVR_US, "XRaySourceIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9367, 0x0018, 0x9367, + EVR_UC, "XRaySourceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9368, 0x0018, 0x9368, + EVR_CS, "MultienergySourceTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9369, 0x0018, 0x9369, + EVR_DT, "SourceStartDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x936a, 0x0018, 0x936a, + EVR_DT, "SourceEndDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x936b, 0x0018, 0x936b, + EVR_US, "SwitchingPhaseNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x936c, 0x0018, 0x936c, + EVR_DS, "SwitchingPhaseNominalDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x936d, 0x0018, 0x936d, + EVR_DS, "SwitchingPhaseTransitionDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x936e, 0x0018, 0x936e, + EVR_DS, "EffectiveBinEnergy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x936f, 0x0018, 0x936f, + EVR_SQ, "MultienergyCTXRayDetectorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9370, 0x0018, 0x9370, + EVR_US, "XRayDetectorIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9371, 0x0018, 0x9371, + EVR_UC, "XRayDetectorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9372, 0x0018, 0x9372, + EVR_CS, "MultienergyDetectorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9373, 0x0018, 0x9373, + EVR_ST, "XRayDetectorLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9374, 0x0018, 0x9374, + EVR_DS, "NominalMaxEnergy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9375, 0x0018, 0x9375, + EVR_DS, "NominalMinEnergy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9376, 0x0018, 0x9376, + EVR_US, "ReferencedXRayDetectorIndex", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9377, 0x0018, 0x9377, + EVR_US, "ReferencedXRaySourceIndex", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9378, 0x0018, 0x9378, + EVR_US, "ReferencedPathIndex", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9379, 0x0018, 0x9379, + EVR_SQ, "MultienergyCTPathSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x937a, 0x0018, 0x937a, + EVR_US, "MultienergyCTPathIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x937b, 0x0018, 0x937b, + EVR_UT, "MultienergyAcquisitionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x937c, 0x0018, 0x937c, + EVR_FD, "MonoenergeticEnergyEquivalent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x937d, 0x0018, 0x937d, + EVR_SQ, "MaterialCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x937e, 0x0018, 0x937e, + EVR_CS, "DecompositionMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x937f, 0x0018, 0x937f, + EVR_UT, "DecompositionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9380, 0x0018, 0x9380, + EVR_SQ, "DecompositionAlgorithmIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9381, 0x0018, 0x9381, + EVR_SQ, "DecompositionMaterialSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9382, 0x0018, 0x9382, + EVR_SQ, "MaterialAttenuationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9383, 0x0018, 0x9383, + EVR_DS, "PhotonEnergy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9384, 0x0018, 0x9384, + EVR_DS, "XRayMassAttenuationCoefficient", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9401, 0x0018, 0x9401, + EVR_SQ, "ProjectionPixelCalibrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9402, 0x0018, 0x9402, + EVR_FL, "DistanceSourceToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9403, 0x0018, 0x9403, + EVR_FL, "DistanceObjectToTableTop", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9404, 0x0018, 0x9404, + EVR_FL, "ObjectPixelSpacingInCenterOfBeam", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9405, 0x0018, 0x9405, + EVR_SQ, "PositionerPositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9406, 0x0018, 0x9406, + EVR_SQ, "TablePositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9407, 0x0018, 0x9407, + EVR_SQ, "CollimatorShapeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9410, 0x0018, 0x9410, + EVR_CS, "PlanesInAcquisition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9412, 0x0018, 0x9412, + EVR_SQ, "XAXRFFrameCharacteristicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9417, 0x0018, 0x9417, + EVR_SQ, "FrameAcquisitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9420, 0x0018, 0x9420, + EVR_CS, "XRayReceptorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9423, 0x0018, 0x9423, + EVR_LO, "AcquisitionProtocolName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9424, 0x0018, 0x9424, + EVR_LT, "AcquisitionProtocolDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9425, 0x0018, 0x9425, + EVR_CS, "ContrastBolusIngredientOpaque", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9426, 0x0018, 0x9426, + EVR_FL, "DistanceReceptorPlaneToDetectorHousing", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9427, 0x0018, 0x9427, + EVR_CS, "IntensifierActiveShape", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9428, 0x0018, 0x9428, + EVR_FL, "IntensifierActiveDimensions", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9429, 0x0018, 0x9429, + EVR_FL, "PhysicalDetectorSize", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9430, 0x0018, 0x9430, + EVR_FL, "PositionOfIsocenterProjection", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9432, 0x0018, 0x9432, + EVR_SQ, "FieldOfViewSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9433, 0x0018, 0x9433, + EVR_LO, "FieldOfViewDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9434, 0x0018, 0x9434, + EVR_SQ, "ExposureControlSensingRegionsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9435, 0x0018, 0x9435, + EVR_CS, "ExposureControlSensingRegionShape", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9436, 0x0018, 0x9436, + EVR_SS, "ExposureControlSensingRegionLeftVerticalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9437, 0x0018, 0x9437, + EVR_SS, "ExposureControlSensingRegionRightVerticalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9438, 0x0018, 0x9438, + EVR_SS, "ExposureControlSensingRegionUpperHorizontalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9439, 0x0018, 0x9439, + EVR_SS, "ExposureControlSensingRegionLowerHorizontalEdge", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9440, 0x0018, 0x9440, + EVR_SS, "CenterOfCircularExposureControlSensingRegion", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9441, 0x0018, 0x9441, + EVR_US, "RadiusOfCircularExposureControlSensingRegion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9442, 0x0018, 0x9442, + EVR_SS, "VerticesOfThePolygonalExposureControlSensingRegion", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9447, 0x0018, 0x9447, + EVR_FL, "ColumnAngulationPatient", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9449, 0x0018, 0x9449, + EVR_FL, "BeamAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9451, 0x0018, 0x9451, + EVR_SQ, "FrameDetectorParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9452, 0x0018, 0x9452, + EVR_FL, "CalculatedAnatomyThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9455, 0x0018, 0x9455, + EVR_SQ, "CalibrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9456, 0x0018, 0x9456, + EVR_SQ, "ObjectThicknessSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9457, 0x0018, 0x9457, + EVR_CS, "PlaneIdentification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9461, 0x0018, 0x9461, + EVR_FL, "FieldOfViewDimensionsInFloat", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9462, 0x0018, 0x9462, + EVR_SQ, "IsocenterReferenceSystemSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9463, 0x0018, 0x9463, + EVR_FL, "PositionerIsocenterPrimaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9464, 0x0018, 0x9464, + EVR_FL, "PositionerIsocenterSecondaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9465, 0x0018, 0x9465, + EVR_FL, "PositionerIsocenterDetectorRotationAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9466, 0x0018, 0x9466, + EVR_FL, "TableXPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9467, 0x0018, 0x9467, + EVR_FL, "TableYPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9468, 0x0018, 0x9468, + EVR_FL, "TableZPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9469, 0x0018, 0x9469, + EVR_FL, "TableHorizontalRotationAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9470, 0x0018, 0x9470, + EVR_FL, "TableHeadTiltAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9471, 0x0018, 0x9471, + EVR_FL, "TableCradleTiltAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9472, 0x0018, 0x9472, + EVR_SQ, "FrameDisplayShutterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9473, 0x0018, 0x9473, + EVR_FL, "AcquiredImageAreaDoseProduct", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9474, 0x0018, 0x9474, + EVR_CS, "CArmPositionerTabletopRelationship", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9476, 0x0018, 0x9476, + EVR_SQ, "XRayGeometrySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9477, 0x0018, 0x9477, + EVR_SQ, "IrradiationEventIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9504, 0x0018, 0x9504, + EVR_SQ, "XRay3DFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9506, 0x0018, 0x9506, + EVR_SQ, "ContributingSourcesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9507, 0x0018, 0x9507, + EVR_SQ, "XRay3DAcquisitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9508, 0x0018, 0x9508, + EVR_FL, "PrimaryPositionerScanArc", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9509, 0x0018, 0x9509, + EVR_FL, "SecondaryPositionerScanArc", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9510, 0x0018, 0x9510, + EVR_FL, "PrimaryPositionerScanStartAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9511, 0x0018, 0x9511, + EVR_FL, "SecondaryPositionerScanStartAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9514, 0x0018, 0x9514, + EVR_FL, "PrimaryPositionerIncrement", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9515, 0x0018, 0x9515, + EVR_FL, "SecondaryPositionerIncrement", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9516, 0x0018, 0x9516, + EVR_DT, "StartAcquisitionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9517, 0x0018, 0x9517, + EVR_DT, "EndAcquisitionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9518, 0x0018, 0x9518, + EVR_SS, "PrimaryPositionerIncrementSign", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9519, 0x0018, 0x9519, + EVR_SS, "SecondaryPositionerIncrementSign", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9524, 0x0018, 0x9524, + EVR_LO, "ApplicationName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9525, 0x0018, 0x9525, + EVR_LO, "ApplicationVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9526, 0x0018, 0x9526, + EVR_LO, "ApplicationManufacturer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9527, 0x0018, 0x9527, + EVR_CS, "AlgorithmType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9528, 0x0018, 0x9528, + EVR_LO, "AlgorithmDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9530, 0x0018, 0x9530, + EVR_SQ, "XRay3DReconstructionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9531, 0x0018, 0x9531, + EVR_LO, "ReconstructionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9538, 0x0018, 0x9538, + EVR_SQ, "PerProjectionAcquisitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9541, 0x0018, 0x9541, + EVR_SQ, "DetectorPositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9542, 0x0018, 0x9542, + EVR_SQ, "XRayAcquisitionDoseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9543, 0x0018, 0x9543, + EVR_FD, "XRaySourceIsocenterPrimaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9544, 0x0018, 0x9544, + EVR_FD, "XRaySourceIsocenterSecondaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9545, 0x0018, 0x9545, + EVR_FD, "BreastSupportIsocenterPrimaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9546, 0x0018, 0x9546, + EVR_FD, "BreastSupportIsocenterSecondaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9547, 0x0018, 0x9547, + EVR_FD, "BreastSupportXPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9548, 0x0018, 0x9548, + EVR_FD, "BreastSupportYPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9549, 0x0018, 0x9549, + EVR_FD, "BreastSupportZPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9550, 0x0018, 0x9550, + EVR_FD, "DetectorIsocenterPrimaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9551, 0x0018, 0x9551, + EVR_FD, "DetectorIsocenterSecondaryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9552, 0x0018, 0x9552, + EVR_FD, "DetectorXPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9553, 0x0018, 0x9553, + EVR_FD, "DetectorYPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9554, 0x0018, 0x9554, + EVR_FD, "DetectorZPositionToIsocenter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9555, 0x0018, 0x9555, + EVR_SQ, "XRayGridSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9556, 0x0018, 0x9556, + EVR_SQ, "XRayFilterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9557, 0x0018, 0x9557, + EVR_FD, "DetectorActiveAreaTLHCPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9558, 0x0018, 0x9558, + EVR_FD, "DetectorActiveAreaOrientation", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9559, 0x0018, 0x9559, + EVR_CS, "PositionerPrimaryAngleDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9601, 0x0018, 0x9601, + EVR_SQ, "DiffusionBMatrixSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9602, 0x0018, 0x9602, + EVR_FD, "DiffusionBValueXX", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9603, 0x0018, 0x9603, + EVR_FD, "DiffusionBValueXY", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9604, 0x0018, 0x9604, + EVR_FD, "DiffusionBValueXZ", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9605, 0x0018, 0x9605, + EVR_FD, "DiffusionBValueYY", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9606, 0x0018, 0x9606, + EVR_FD, "DiffusionBValueYZ", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9607, 0x0018, 0x9607, + EVR_FD, "DiffusionBValueZZ", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9621, 0x0018, 0x9621, + EVR_SQ, "FunctionalMRSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9622, 0x0018, 0x9622, + EVR_CS, "FunctionalSettlingPhaseFramesPresent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9623, 0x0018, 0x9623, + EVR_DT, "FunctionalSyncPulse", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9624, 0x0018, 0x9624, + EVR_CS, "SettlingPhaseFrame", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9701, 0x0018, 0x9701, + EVR_DT, "DecayCorrectionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9715, 0x0018, 0x9715, + EVR_FD, "StartDensityThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9716, 0x0018, 0x9716, + EVR_FD, "StartRelativeDensityDifferenceThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9717, 0x0018, 0x9717, + EVR_FD, "StartCardiacTriggerCountThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9718, 0x0018, 0x9718, + EVR_FD, "StartRespiratoryTriggerCountThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9719, 0x0018, 0x9719, + EVR_FD, "TerminationCountsThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9720, 0x0018, 0x9720, + EVR_FD, "TerminationDensityThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9721, 0x0018, 0x9721, + EVR_FD, "TerminationRelativeDensityThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9722, 0x0018, 0x9722, + EVR_FD, "TerminationTimeThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9723, 0x0018, 0x9723, + EVR_FD, "TerminationCardiacTriggerCountThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9724, 0x0018, 0x9724, + EVR_FD, "TerminationRespiratoryTriggerCountThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9725, 0x0018, 0x9725, + EVR_CS, "DetectorGeometry", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9726, 0x0018, 0x9726, + EVR_FD, "TransverseDetectorSeparation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9727, 0x0018, 0x9727, + EVR_FD, "AxialDetectorDimension", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9729, 0x0018, 0x9729, + EVR_US, "RadiopharmaceuticalAgentNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9732, 0x0018, 0x9732, + EVR_SQ, "PETFrameAcquisitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9733, 0x0018, 0x9733, + EVR_SQ, "PETDetectorMotionDetailsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9734, 0x0018, 0x9734, + EVR_SQ, "PETTableDynamicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9735, 0x0018, 0x9735, + EVR_SQ, "PETPositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9736, 0x0018, 0x9736, + EVR_SQ, "PETFrameCorrectionFactorsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9737, 0x0018, 0x9737, + EVR_SQ, "RadiopharmaceuticalUsageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9738, 0x0018, 0x9738, + EVR_CS, "AttenuationCorrectionSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9739, 0x0018, 0x9739, + EVR_US, "NumberOfIterations", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9740, 0x0018, 0x9740, + EVR_US, "NumberOfSubsets", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9749, 0x0018, 0x9749, + EVR_SQ, "PETReconstructionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9751, 0x0018, 0x9751, + EVR_SQ, "PETFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9755, 0x0018, 0x9755, + EVR_CS, "TimeOfFlightInformationUsed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9756, 0x0018, 0x9756, + EVR_CS, "ReconstructionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9758, 0x0018, 0x9758, + EVR_CS, "DecayCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9759, 0x0018, 0x9759, + EVR_CS, "AttenuationCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9760, 0x0018, 0x9760, + EVR_CS, "ScatterCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9761, 0x0018, 0x9761, + EVR_CS, "DeadTimeCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9762, 0x0018, 0x9762, + EVR_CS, "GantryMotionCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9763, 0x0018, 0x9763, + EVR_CS, "PatientMotionCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9764, 0x0018, 0x9764, + EVR_CS, "CountLossNormalizationCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9765, 0x0018, 0x9765, + EVR_CS, "RandomsCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9766, 0x0018, 0x9766, + EVR_CS, "NonUniformRadialSamplingCorrected", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9767, 0x0018, 0x9767, + EVR_CS, "SensitivityCalibrated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9768, 0x0018, 0x9768, + EVR_CS, "DetectorNormalizationCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9769, 0x0018, 0x9769, + EVR_CS, "IterativeReconstructionMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9770, 0x0018, 0x9770, + EVR_CS, "AttenuationCorrectionTemporalRelationship", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9771, 0x0018, 0x9771, + EVR_SQ, "PatientPhysiologicalStateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9772, 0x0018, 0x9772, + EVR_SQ, "PatientPhysiologicalStateCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9801, 0x0018, 0x9801, + EVR_FD, "DepthsOfFocus", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9803, 0x0018, 0x9803, + EVR_SQ, "ExcludedIntervalsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9804, 0x0018, 0x9804, + EVR_DT, "ExclusionStartDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9805, 0x0018, 0x9805, + EVR_FD, "ExclusionDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9806, 0x0018, 0x9806, + EVR_SQ, "USImageDescriptionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9807, 0x0018, 0x9807, + EVR_SQ, "ImageDataTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9808, 0x0018, 0x9808, + EVR_CS, "DataType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9809, 0x0018, 0x9809, + EVR_SQ, "TransducerScanPatternCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x980b, 0x0018, 0x980b, + EVR_CS, "AliasedDataType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x980c, 0x0018, 0x980c, + EVR_CS, "PositionMeasuringDeviceUsed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x980d, 0x0018, 0x980d, + EVR_SQ, "TransducerGeometryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x980e, 0x0018, 0x980e, + EVR_SQ, "TransducerBeamSteeringCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x980f, 0x0018, 0x980f, + EVR_SQ, "TransducerApplicationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9810, 0x0018, 0x9810, + EVR_xs, "ZeroVelocityPixelValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9900, 0x0018, 0x9900, + EVR_LO, "ReferenceLocationLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9901, 0x0018, 0x9901, + EVR_UT, "ReferenceLocationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9902, 0x0018, 0x9902, + EVR_SQ, "ReferenceBasisCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9903, 0x0018, 0x9903, + EVR_SQ, "ReferenceGeometryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9904, 0x0018, 0x9904, + EVR_DS, "OffsetDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9905, 0x0018, 0x9905, + EVR_CS, "OffsetDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9906, 0x0018, 0x9906, + EVR_SQ, "PotentialScheduledProtocolCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9907, 0x0018, 0x9907, + EVR_SQ, "PotentialRequestedProcedureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9908, 0x0018, 0x9908, + EVR_UC, "PotentialReasonsForProcedure", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9909, 0x0018, 0x9909, + EVR_SQ, "PotentialReasonsForProcedureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x990a, 0x0018, 0x990a, + EVR_UC, "PotentialDiagnosticTasks", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x990b, 0x0018, 0x990b, + EVR_SQ, "ContraindicationsCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x990c, 0x0018, 0x990c, + EVR_SQ, "ReferencedDefinedProtocolSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x990d, 0x0018, 0x990d, + EVR_SQ, "ReferencedPerformedProtocolSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x990e, 0x0018, 0x990e, + EVR_SQ, "PredecessorProtocolSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x990f, 0x0018, 0x990f, + EVR_UT, "ProtocolPlanningInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9910, 0x0018, 0x9910, + EVR_UT, "ProtocolDesignRationale", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9911, 0x0018, 0x9911, + EVR_SQ, "PatientSpecificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9912, 0x0018, 0x9912, + EVR_SQ, "ModelSpecificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9913, 0x0018, 0x9913, + EVR_SQ, "ParametersSpecificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9914, 0x0018, 0x9914, + EVR_SQ, "InstructionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9915, 0x0018, 0x9915, + EVR_US, "InstructionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9916, 0x0018, 0x9916, + EVR_LO, "InstructionText", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9917, 0x0018, 0x9917, + EVR_UT, "InstructionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9918, 0x0018, 0x9918, + EVR_CS, "InstructionPerformedFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9919, 0x0018, 0x9919, + EVR_DT, "InstructionPerformedDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x991a, 0x0018, 0x991a, + EVR_UT, "InstructionPerformanceComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x991b, 0x0018, 0x991b, + EVR_SQ, "PatientPositioningInstructionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x991c, 0x0018, 0x991c, + EVR_SQ, "PositioningMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x991d, 0x0018, 0x991d, + EVR_SQ, "PositioningLandmarkSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x991e, 0x0018, 0x991e, + EVR_UI, "TargetFrameOfReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x991f, 0x0018, 0x991f, + EVR_SQ, "AcquisitionProtocolElementSpecificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9920, 0x0018, 0x9920, + EVR_SQ, "AcquisitionProtocolElementSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9921, 0x0018, 0x9921, + EVR_US, "ProtocolElementNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9922, 0x0018, 0x9922, + EVR_LO, "ProtocolElementName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9923, 0x0018, 0x9923, + EVR_UT, "ProtocolElementCharacteristicsSummary", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9924, 0x0018, 0x9924, + EVR_UT, "ProtocolElementPurpose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9930, 0x0018, 0x9930, + EVR_CS, "AcquisitionMotion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9931, 0x0018, 0x9931, + EVR_SQ, "AcquisitionStartLocationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9932, 0x0018, 0x9932, + EVR_SQ, "AcquisitionEndLocationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9933, 0x0018, 0x9933, + EVR_SQ, "ReconstructionProtocolElementSpecificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9934, 0x0018, 0x9934, + EVR_SQ, "ReconstructionProtocolElementSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9935, 0x0018, 0x9935, + EVR_SQ, "StorageProtocolElementSpecificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9936, 0x0018, 0x9936, + EVR_SQ, "StorageProtocolElementSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9937, 0x0018, 0x9937, + EVR_LO, "RequestedSeriesDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9938, 0x0018, 0x9938, + EVR_US, "SourceAcquisitionProtocolElementNumber", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9939, 0x0018, 0x9939, + EVR_US, "SourceAcquisitionBeamNumber", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x993a, 0x0018, 0x993a, + EVR_US, "SourceReconstructionProtocolElementNumber", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x993b, 0x0018, 0x993b, + EVR_SQ, "ReconstructionStartLocationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x993c, 0x0018, 0x993c, + EVR_SQ, "ReconstructionEndLocationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x993d, 0x0018, 0x993d, + EVR_SQ, "ReconstructionAlgorithmSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x993e, 0x0018, 0x993e, + EVR_SQ, "ReconstructionTargetCenterLocationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9941, 0x0018, 0x9941, + EVR_UT, "ImageFilterDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9942, 0x0018, 0x9942, + EVR_FD, "CTDIvolNotificationTrigger", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9943, 0x0018, 0x9943, + EVR_FD, "DLPNotificationTrigger", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9944, 0x0018, 0x9944, + EVR_CS, "AutoKVPSelectionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9945, 0x0018, 0x9945, + EVR_FD, "AutoKVPUpperBound", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9946, 0x0018, 0x9946, + EVR_FD, "AutoKVPLowerBound", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0x9947, 0x0018, 0x9947, + EVR_CS, "ProtocolDefinedPatientPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0xa001, 0x0018, 0xa001, + EVR_SQ, "ContributingEquipmentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0xa002, 0x0018, 0xa002, + EVR_DT, "ContributionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0018, 0xa003, 0x0018, 0xa003, + EVR_ST, "ContributionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0019, 0x0000, 0x0019, 0x0000, + EVR_CS, "ImageBlankingShape", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0000, 0x0019, 0x0000, + EVR_UN, "PhysiologicalDataType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0000, 0x0019, 0x0000, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AEGIS_DICOM_2.00" } + , { 0x0019, 0x0000, 0x0019, 0x0000, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0000, 0x0019, 0x0000, + EVR_IS, "AECField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0000, 0x0019, 0x0000, + EVR_LO, "APRName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0019, 0x0000, 0x0019, 0x0000, + EVR_US, "ReviewMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_DS, "AngleValueLArm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_UN, "PhysiologicalDataChannelAndKind", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_IS, "AECFilmScreen", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_US, "AnatomicalBackgroundPercent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0001, 0x0019, 0x0001, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_DS, "AngleValuePArm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_IS, "ImageBlankingLeftVerticalEdge", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_US, "SampleBitsAllocated", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_SL, "NumberOfCellsInDetector", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_IS, "AECDensity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_US, "NumberOfPhases", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0002, 0x0019, 0x0002, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0003, 0x0019, 0x0003, + EVR_DS, "AngleValueCArm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0003, 0x0019, 0x0003, + EVR_US, "SampleBitsStored", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0003, 0x0019, 0x0003, + EVR_DS, "CellNumberAtTheta", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0003, 0x0019, 0x0003, + EVR_US, "ApplyAnatomicalBackground", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0003, 0x0019, 0x0003, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0003, 0x0019, 0x0003, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0004, 0x0019, 0x0004, + EVR_CS, "AngleLabelLArm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0004, 0x0019, 0x0004, + EVR_IS, "ImageBlankingRightVerticalEdge", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0004, 0x0019, 0x0004, + EVR_US, "SampleHighBit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0004, 0x0019, 0x0004, + EVR_DS, "CellSpacing", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0004, 0x0019, 0x0004, + EVR_SS, "PixelShiftArray", 4, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0004, 0x0019, 0x0004, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0004, 0x0019, 0x0004, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0005, 0x0019, 0x0005, + EVR_CS, "AngleLabelPArm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0005, 0x0019, 0x0005, + EVR_US, "SampleRepresentation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0005, 0x0019, 0x0005, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0005, 0x0019, 0x0005, + EVR_US, "Brightness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0005, 0x0019, 0x0005, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0005, 0x0019, 0x0005, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0006, 0x0019, 0x0006, + EVR_CS, "AngleLabelCArm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0006, 0x0019, 0x0006, + EVR_IS, "ImageBlankingUpperHorizontalEdge", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0006, 0x0019, 0x0006, + EVR_UN, "SmallestSampleValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0006, 0x0019, 0x0006, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0006, 0x0019, 0x0006, + EVR_US, "Contrast", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0006, 0x0019, 0x0006, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0006, 0x0019, 0x0006, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0007, 0x0019, 0x0007, + EVR_ST, "ProcedureName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0007, 0x0019, 0x0007, + EVR_UN, "LargestSampleValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0007, 0x0019, 0x0007, + EVR_US, "Enabled", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0007, 0x0019, 0x0007, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0007, 0x0019, 0x0007, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0008, 0x0019, 0x0008, + EVR_ST, "ExamName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0008, 0x0019, 0x0008, + EVR_IS, "ImageBlankingLowerHorizontalEdge", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0008, 0x0019, 0x0008, + EVR_UN, "NumberOfSamples", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0008, 0x0019, 0x0008, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0008, 0x0019, 0x0008, + EVR_US, "NativeEdgeEnhancementPercentGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0008, 0x0019, 0x0008, + EVR_LT, "OrientationHeadFeet", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0008, 0x0019, 0x0008, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0009, 0x0019, 0x0009, + EVR_SH, "PatientSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0009, 0x0019, 0x0009, + EVR_DS, "MainMagneticField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x0009, 0x0019, 0x0009, + EVR_UN, "SampleData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0009, 0x0019, 0x0009, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0009, 0x0019, 0x0009, + EVR_SS, "NativeEdgeEnhancementLUTIndex", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0009, 0x0019, 0x0009, + EVR_LT, "ViewDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x0009, 0x0019, 0x0009, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x000a, 0x0019, 0x000a, + EVR_IS, "RecordView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x000a, 0x0019, 0x000a, + EVR_UN, "SampleRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x000a, 0x0019, 0x000a, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x000a, 0x0019, 0x000a, + EVR_SS, "NativeEdgeEnhancementKernelSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x000a, 0x0019, 0x000a, + EVR_LT, "OrientationSupineProne", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x000b, 0x0019, 0x000b, + EVR_US, "SubtrEdgeEnhancementPercentGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x000b, 0x0019, 0x000b, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x000c, 0x0019, 0x000c, + EVR_SS, "SubtrEdgeEnhancementLUTIndex", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x000c, 0x0019, 0x000c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x000d, 0x0019, 0x000d, + EVR_SS, "SubtrEdgeEnhancementKernelSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x000d, 0x0019, 0x000d, + EVR_TM, "Time", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x000e, 0x0019, 0x000e, + EVR_IS, "FlowCompensation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x000e, 0x0019, 0x000e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x000e, 0x0019, 0x000e, + EVR_US, "FadePercent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x000e, 0x0019, 0x000e, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x0019, 0x000f, 0x0019, 0x000f, + EVR_DS, "HorizontalFrameOfReference", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x000f, 0x0019, 0x000f, + EVR_US, "FlippedBeforeLateralityApplied", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_LT, "MeasurementMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_LT, "VideoBeamBoost", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-XSB-DCI Release 1" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_UN, "ECGTimeMapDataBitsAllocated", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_DS, "InjectorDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_IS, "CenterOfCircularImageBlanking", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_UN, "PhysiologicalDataType2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_US, "MainsFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_IS, "PatientThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_US, "ApplyFade", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_DS, "SourceSideCollimatorAperture", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_DS, "DistanceSourceToSourceSideCollimator", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_ST, "CRImageParamsCommon", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "1.2.840.113681" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_DS, "NetFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_LT, "ParameterFileName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 ACQU" } + , { 0x0019, 0x0010, 0x0019, 0x0010, + EVR_DS, "TotalMeasurementTimeNominal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_LT, "ImageType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_US, "ChannelGeneratingVideoSync", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-XSB-DCI Release 1" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_UN, "ECGTimeMapDataBitsStored", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_CS, "AutoInject", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_UN, "PhysiologicalDataChannelAndKind2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_SS, "SeriesContrast", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_IS, "ChemicalShiftNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS-MR-1" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_DS, "DetectorSideCollimatorAperture", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_DS, "DistanceSourceToDetectorSideCollimator", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_ST, "CRImageIPParamsSingle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "1.2.840.113681" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_LO, "SequenceFileName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 ACQU" } + , { 0x0019, 0x0011, 0x0019, 0x0011, + EVR_DS, "TotalMeasurementTimeCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_US, "VideoGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-XSB-DCI Release 1" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_UN, "ECGTimeMapDataHighBit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_IS, "RadiusOfCircularImageBlanking", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_US, "SampleBitsAllocated2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_SS, "LastPseq", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_IS, "PhaseNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS-MR-1" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_US, "Zoom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_DS, "MagneticFieldStrength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_ST, "CRImageIPParamsLeft", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "1.2.840.113681" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_LT, "SequenceFileOwner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 ACQU" } + , { 0x0019, 0x0012, 0x0019, 0x0012, + EVR_DS, "StartDelayTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_US, "VideoOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-XSB-DCI Release 1" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_UN, "ECGTimeMapDataRepresentation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_US, "SampleBitsStored2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_SS, "StartNumberForBaseline", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_SS, "PanX", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_ST, "CRImageIPParamsRight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "1.2.840.113681" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_LT, "SequenceDescription", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 ACQU" } + , { 0x0019, 0x0013, 0x0019, 0x0013, + EVR_DS, "DwellTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_UN, "ECGTimeMapDataSmallestDataValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_IS, "AcquisitionMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_US, "SampleHighBit2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_SS, "EndNumberForBaseline", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_SS, "PanY", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_DS, "ADCVoltage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_LT, "EPIFileName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 ACQU" } + , { 0x0019, 0x0014, 0x0019, 0x0014, + EVR_IS, "NumberOfPhases", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_LT, "SoftwareVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_UN, "ECGTimeMapDataLargestDataValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_CS, "CameraRotationEnabled", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_LT, "OfflineUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_US, "SampleRepresentation2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_SS, "StartNumberForEnhancedScans", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_SS, "NativeEdgeEnhancementAdvPercGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_LO, "AcquiredPlane", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_LO, "KanjiBodyPartForExposure", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0015, 0x0019, 0x0015, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_UN, "ECGTimeMapDataNumberOfDataValues", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_CS, "ReverseSweep", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_UN, "SmallestSampleValue2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_SS, "EndNumberForEnhancedScans", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_SS, "SubtrEdgeEnhancementAdvPercGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_DS, "ADCOffset", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0016, 0x0019, 0x0016, + EVR_UL, "SequenceControlMask", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0017, 0x0019, 0x0017, + EVR_UN, "ECGTimeMapData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-DCI Release 1" } + , { 0x0019, 0x0017, 0x0019, 0x0017, + EVR_IS, "SpatialFilterStrength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0017, 0x0019, 0x0017, + EVR_UN, "LargestSampleValue2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0017, 0x0019, 0x0017, + EVR_SS, "SeriesPlane", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0017, 0x0019, 0x0017, + EVR_US, "InvertFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x0017, 0x0019, 0x0017, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_IS, "ZoomFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_UN, "NumberOfSamples2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_LO, "FirstScanRAS", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_IS, "BeamDistance", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0018, 0x0019, 0x0018, + EVR_UL, "MeasurementStatusMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0019, 0x0019, 0x0019, + EVR_IS, "XZoomCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x0019, 0x0019, 0x0019, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0019, 0x0019, 0x0019, + EVR_UN, "SampleData2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x0019, 0x0019, 0x0019, + EVR_DS, "FirstScanLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0019, 0x0019, 0x0019, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x001a, 0x0019, 0x001a, + EVR_IS, "YZoomCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x001a, 0x0019, 0x001a, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x001a, 0x0019, 0x001a, + EVR_UN, "SampleRate2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0019, 0x001a, 0x0019, 0x001a, + EVR_LO, "LastScanRAS", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x001a, 0x0019, 0x001a, + EVR_OB, "Quant1KOverlay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x001a, 0x0019, 0x001a, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x001b, 0x0019, 0x001b, + EVR_DS, "Focus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x001b, 0x0019, 0x001b, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x001b, 0x0019, 0x001b, + EVR_DS, "LastScanLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x001b, 0x0019, 0x001b, + EVR_US, "OriginalResolution", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x001b, 0x0019, 0x001b, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x001c, 0x0019, 0x001c, + EVR_CS, "Dose", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x001c, 0x0019, 0x001c, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x001c, 0x0019, 0x001c, + EVR_DS, "AutoWindowCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x001c, 0x0019, 0x001c, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x001d, 0x0019, 0x001d, + EVR_IS, "SideMark", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x001d, 0x0019, 0x001d, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x001d, 0x0019, 0x001d, + EVR_DS, "AutoWindowWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX VIEW 1.0" } + , { 0x0019, 0x001d, 0x0019, 0x001d, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x001e, 0x0019, 0x001e, + EVR_IS, "PercentageLandscape", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x001e, 0x0019, 0x001e, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x001e, 0x0019, 0x001e, + EVR_DS, "DisplayFieldOfView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x001e, 0x0019, 0x001e, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x001f, 0x0019, 0x001f, + EVR_DS, "ExposureDuration", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DLX_SERIE_01" } + , { 0x0019, 0x001f, 0x0019, 0x001f, + EVR_SS, "Internal", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x001f, 0x0019, 0x001f, + EVR_SS, "DefaultTableIsoCenterHeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x001f, 0x0019, 0x001f, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_LT, "MPMCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_DS, "RTDDataCompressionFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-XSB-DCI Release 1" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_SS, "SystemCalibFactorPlaneA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_TM, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_IS, "WorkstationNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_DS, "TransmitterAmplitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_DS, "ExposureTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_IS, "NumberOfPossibleChannels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_SL, "SceneFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_LT, "MeasurementMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_SL, "SystemCalibFactorPlaneB", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0020, 0x0019, 0x0020, + EVR_IS, "NumberOfFourierLinesNominal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0021, 0x0019, 0x0021, + EVR_LT, "Latitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0021, 0x0019, 0x0021, + EVR_IS, "NumberOfTransmitterAmplitudes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0021, 0x0019, 0x0021, + EVR_DS, "ExposureCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0021, 0x0019, 0x0021, + EVR_IS, "MeanChannelNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0021, 0x0019, 0x0021, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0021, 0x0019, 0x0021, + EVR_IS, "NumberOfFourierLinesCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_LT, "Sensitivity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_SS, "XRayParameterSetNo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_UN, "RouteAET", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_DS, "TransmitterAttenuator", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_DS, "DetectorSpacing", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_SL, "RefPhotofileFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0022, 0x0019, 0x0022, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0023, 0x0019, 0x0023, + EVR_LT, "EDR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0023, 0x0019, 0x0023, + EVR_DS, "PCRPrintScale", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0023, 0x0019, 0x0023, + EVR_DS, "TableSpeed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0023, 0x0019, 0x0023, + EVR_DS, "DetectorCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0023, 0x0019, 0x0023, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_LT, "LFix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_SS, "XRaySystem", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_UN, "PCRPrintJobEnd", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_DS, "MidScanTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_DS, "TransmitterCalibration", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_DS, "ReadingIntegrationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_LO, "SceneName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0024, 0x0019, 0x0024, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0025, 0x0019, 0x0025, + EVR_LT, "SFix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0025, 0x0019, 0x0025, + EVR_IS, "PCRNoFilmCopies", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0025, 0x0019, 0x0025, + EVR_SS, "MidScanFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0025, 0x0019, 0x0025, + EVR_LT, "OriginalPixelDataQuality", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0025, 0x0019, 0x0025, + EVR_DS, "KVPGeneratorPowerCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0025, 0x0019, 0x0025, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_LT, "PresetMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_IS, "PCRFilmLayoutPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_SL, "DegreesOfAzimuth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_DS, "TransmitterReference", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_DS, "GeneratorVoltage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_SS, "AcquisitionIndex", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0026, 0x0019, 0x0026, + EVR_IS, "NumberOfFourierLinesAfterZero", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0027, 0x0019, 0x0027, + EVR_LT, "Region", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0027, 0x0019, 0x0027, + EVR_UN, "PCRPrintReportName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0027, 0x0019, 0x0027, + EVR_DS, "GantryPeriod", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0027, 0x0019, 0x0027, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0028, 0x0019, 0x0028, + EVR_LT, "Subregion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0028, 0x0019, 0x0028, + EVR_SS, "AcquiredDisplayMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0028, 0x0019, 0x0028, + EVR_IS, "TubeNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0028, 0x0019, 0x0028, + EVR_SS, "MixedPulseMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0028, 0x0019, 0x0028, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0028, 0x0019, 0x0028, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0028, 0x0019, 0x0028, + EVR_IS, "FirstMeasuredFourierLine", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0029, 0x0019, 0x0029, + EVR_IS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x002a, 0x0019, 0x002a, + EVR_SS, "AcquisitionDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x002a, 0x0019, 0x002a, + EVR_DS, "XrayOnPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x002a, 0x0019, 0x002a, + EVR_SS, "NoOfPositions", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x002a, 0x0019, 0x002a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x002b, 0x0019, 0x002b, + EVR_DS, "XrayOffPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x002c, 0x0019, 0x002c, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x002c, 0x0019, 0x002c, + EVR_SL, "NumberOfTriggers", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x002c, 0x0019, 0x002c, + EVR_SS, "NoOfPhases", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x002c, 0x0019, 0x002c, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x002d, 0x0019, 0x002d, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x002e, 0x0019, 0x002e, + EVR_SS, "MaxFramesLimit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x002e, 0x0019, 0x002e, + EVR_DS, "AngleOfFirstView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x002e, 0x0019, 0x002e, + EVR_SS, "FrameRateForPositions", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x002e, 0x0019, 0x002e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x002f, 0x0019, 0x002f, + EVR_DS, "TriggerFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_LT, "Orientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_US, "MaximumFrameSizeNIU", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_UL, "MaximumImageFrameSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_LO, "CREDRMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE ??? From Adantage Review CS" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_IS, "BuckyGrid", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_US, "ECGTriggering", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_SS, "NoOfFramesForPositions", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-PCR Release 2" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_LT, "CalculationMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0030, 0x0019, 0x0030, + EVR_IS, "AcquisitionColumns", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0031, 0x0019, 0x0031, + EVR_LT, "MarkOnFilm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0031, 0x0019, 0x0031, + EVR_UN, "ECG1Offset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0031, 0x0019, 0x0031, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0019, 0x0031, 0x0019, 0x0031, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0031, 0x0019, 0x0031, + EVR_IS, "ReconstructionColumns", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0032, 0x0019, 0x0032, + EVR_LT, "RotationOnDRC", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0032, 0x0019, 0x0032, + EVR_SS, "SubtractedFilterType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0032, 0x0019, 0x0032, + EVR_UN, "ECG2Offset1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0032, 0x0019, 0x0032, + EVR_SS, "SteppingDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0032, 0x0019, 0x0032, + EVR_LO, "KanjiMenuName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0032, 0x0019, 0x0032, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0032, 0x0019, 0x0032, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0033, 0x0019, 0x0033, + EVR_UN, "ECG2Offset2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0034, 0x0019, 0x0034, + EVR_SS, "FilterFactorNative", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0034, 0x0019, 0x0034, + EVR_IS, "Focus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0034, 0x0019, 0x0034, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0034, 0x0019, 0x0034, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0036, 0x0019, 0x0036, + EVR_SS, "AnatomicBackgroundFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0036, 0x0019, 0x0036, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0036, 0x0019, 0x0036, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0038, 0x0019, 0x0038, + EVR_SS, "WindowUpperLimitNative", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0038, 0x0019, 0x0038, + EVR_IS, "Child", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0038, 0x0019, 0x0038, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0038, 0x0019, 0x0038, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0039, 0x0019, 0x0039, + EVR_SS, "AxialType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x0039, 0x0019, 0x0039, + EVR_SS, "ScanFOVType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x003a, 0x0019, 0x003a, + EVR_SS, "WindowLowerLimitNative", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x003a, 0x0019, 0x003a, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x003a, 0x0019, 0x003a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x003a, 0x0019, 0x003a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x003b, 0x0019, 0x003b, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x003c, 0x0019, 0x003c, + EVR_SS, "WindowBrightnessPhase1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x003c, 0x0019, 0x003c, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x003c, 0x0019, 0x003c, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x003c, 0x0019, 0x003c, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x003e, 0x0019, 0x003e, + EVR_SS, "WindowBrightnessPhase2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x003e, 0x0019, 0x003e, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x003e, 0x0019, 0x003e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x003e, 0x0019, 0x003e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x003f, 0x0019, 0x003f, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_LT, "ReaderType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_SS, "WindowContrastPhase1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_SS, "StatReconFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_LO, "CRLatitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE ??? From Adantage Review CS" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_DS, "FrameRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_IS, "CollimatorDistanceX", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_UL, "MasterControlMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_CS, "ImageProcessingType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_IS, "ArrayCoilElementNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0040, 0x0019, 0x0040, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0041, 0x0019, 0x0041, + EVR_LT, "SubModality", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0041, 0x0019, 0x0041, + EVR_SS, "ComputeType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0041, 0x0019, 0x0041, + EVR_IS, "CollimatorDistanceY", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0041, 0x0019, 0x0041, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0041, 0x0019, 0x0041, + EVR_UL, "ArrayCoilElementSelectMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_LT, "ReaderSerialNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_SS, "WindowContrastPhase2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_SS, "SegmentNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_US, "ProcessingMask", 5, 5, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_IS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_UL, "ArrayCoilElementDataMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0042, 0x0019, 0x0042, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0043, 0x0019, 0x0043, + EVR_SS, "TotalSegmentsRequested", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0043, 0x0019, 0x0043, + EVR_IS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0043, 0x0019, 0x0043, + EVR_IS, "ArrayCoilElementToADCConnect", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0044, 0x0019, 0x0044, + EVR_SS, "FilterFactorSub", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0044, 0x0019, 0x0044, + EVR_DS, "InterscanDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0044, 0x0019, 0x0044, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0044, 0x0019, 0x0044, + EVR_SS, "ImageTransferDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0044, 0x0019, 0x0044, + EVR_DS, "ArrayCoilElementNoiseLevel", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0044, 0x0019, 0x0044, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0045, 0x0019, 0x0045, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0045, 0x0019, 0x0045, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0045, 0x0019, 0x0045, + EVR_IS, "ArrayCoilADCPairNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0046, 0x0019, 0x0046, + EVR_SS, "PeakOpacified", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0046, 0x0019, 0x0046, + EVR_SL, "InversFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0046, 0x0019, 0x0046, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0046, 0x0019, 0x0046, + EVR_UL, "ArrayCoilCombinationMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0046, 0x0019, 0x0046, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0047, 0x0019, 0x0047, + EVR_SS, "ViewCompressionFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0047, 0x0019, 0x0047, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0048, 0x0019, 0x0048, + EVR_SL, "MaskFrame", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0048, 0x0019, 0x0048, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0048, 0x0019, 0x0048, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0048, 0x0019, 0x0048, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0048, 0x0019, 0x0048, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0049, 0x0019, 0x0049, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0049, 0x0019, 0x0049, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x004a, 0x0019, 0x004a, + EVR_SL, "BIHFrame", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x004a, 0x0019, 0x004a, + EVR_SS, "TotalNumberOfRefChannels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x004a, 0x0019, 0x004a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x004a, 0x0019, 0x004a, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x004b, 0x0019, 0x004b, + EVR_SL, "DataSizeForScanData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x004c, 0x0019, 0x004c, + EVR_SS, "CentBeamAngulationCaudCran", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x004c, 0x0019, 0x004c, + EVR_SS, "BlankingCircleDiameter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x004c, 0x0019, 0x004c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x004e, 0x0019, 0x004e, + EVR_SS, "CentBeamAngulationLRAnterior", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x004e, 0x0019, 0x004e, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_LT, "CassetteScale", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_SS, "LongitudinalPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_US, "VideoScanMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_LO, "CRGroupNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE ??? From Adantage Review CS" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_IS, "CentralBeamHeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_DS, "ReceiverTotalGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_SL, "StandDataValid", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_DS, "DetectorAlignment", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_CS, "EDRMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_IS, "NoiseLevel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_IS, "NumberOfAverages", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0050, 0x0019, 0x0050, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0051, 0x0019, 0x0051, + EVR_LT, "CassetteMatrix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0051, 0x0019, 0x0051, + EVR_US, "VideoLineRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0051, 0x0019, 0x0051, + EVR_DS, "ReceiverAmplifierGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0052, 0x0019, 0x0052, + EVR_LT, "CassetteSubmatrix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0052, 0x0019, 0x0052, + EVR_SS, "SideOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0052, 0x0019, 0x0052, + EVR_SS, "ReconPostProcessingFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0052, 0x0019, 0x0052, + EVR_DS, "ReceiverPreamplifierGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0052, 0x0019, 0x0052, + EVR_SS, "TableTilt", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0052, 0x0019, 0x0052, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0052, 0x0019, 0x0052, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0053, 0x0019, 0x0053, + EVR_LT, "Barcode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0054, 0x0019, 0x0054, + EVR_SS, "IsoCenterHeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0054, 0x0019, 0x0054, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0054, 0x0019, 0x0054, + EVR_DS, "ReceiverCableAttenuation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0054, 0x0019, 0x0054, + EVR_SS, "TableAxisRotation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0054, 0x0019, 0x0054, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0054, 0x0019, 0x0054, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0055, 0x0019, 0x0055, + EVR_DS, "ReceiverReferenceGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0056, 0x0019, 0x0056, + EVR_SS, "ImageTwist", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0056, 0x0019, 0x0056, + EVR_DS, "ReceiverFilterFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0056, 0x0019, 0x0056, + EVR_SS, "TableLongitudalPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0056, 0x0019, 0x0056, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0057, 0x0019, 0x0057, + EVR_SS, "CTWaterNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0058, 0x0019, 0x0058, + EVR_SS, "SourceImageDistance", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0058, 0x0019, 0x0058, + EVR_SS, "CTBoneNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0058, 0x0019, 0x0058, + EVR_SS, "TableSideOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0058, 0x0019, 0x0058, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x005a, 0x0019, 0x005a, + EVR_SS, "MechanicalMagnificationFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x005a, 0x0019, 0x005a, + EVR_FL, "AcquisitionDuration", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x005a, 0x0019, 0x005a, + EVR_SS, "TableIsoCenterHeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x005a, 0x0019, 0x005a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x005c, 0x0019, 0x005c, + EVR_SL, "CalibrationFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x005c, 0x0019, 0x005c, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x005c, 0x0019, 0x005c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x005d, 0x0019, 0x005d, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x005e, 0x0019, 0x005e, + EVR_SL, "CalibrationAngleCranCaud", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x005e, 0x0019, 0x005e, + EVR_SL, "NumberOfChannels1To512", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x005e, 0x0019, 0x005e, + EVR_SL, "CollimationDataValid", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x005e, 0x0019, 0x005e, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x005f, 0x0019, 0x005f, + EVR_SL, "IncrementBetweenChannels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_LT, "ContrastType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_SL, "CalibrationAngleRAOLAO", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_SL, "StartingView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_US, "XrayTechnique", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_IS, "BuckyAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_DS, "ReconstructionScaleFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_SL, "PeriSequenceNo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_DS, "FocusAlignment", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_SH, "RadiographersCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_IS, "NumberOfDataBytes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_DS, "FlipAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0060, 0x0019, 0x0060, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0061, 0x0019, 0x0061, + EVR_LT, "RotationAmount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0061, 0x0019, 0x0061, + EVR_SL, "NumberOfViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0061, 0x0019, 0x0061, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0061, 0x0019, 0x0061, + EVR_DS, "ImageIdentifierFromat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0061, 0x0019, 0x0061, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_LT, "RotationCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_SL, "CalibrationTableToFloorDist", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_SL, "IncrementBetweenViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_US, "IrisDiaphragm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_IS, "NumberOfVirtuellChannels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_DS, "ReferenceScaleFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_SL, "PeriTotalScenes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0062, 0x0019, 0x0062, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0063, 0x0019, 0x0063, + EVR_LT, "DensityShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0063, 0x0019, 0x0063, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0063, 0x0019, 0x0063, + EVR_CS, "Filter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0064, 0x0019, 0x0064, + EVR_US, "FrequencyRank", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0064, 0x0019, 0x0064, + EVR_SL, "CalibrationIsocenterToFloorDist", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0064, 0x0019, 0x0064, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0064, 0x0019, 0x0064, + EVR_CS, "CineParallel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0064, 0x0019, 0x0064, + EVR_SL, "PeriOverlapTop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0064, 0x0019, 0x0064, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0065, 0x0019, 0x0065, + EVR_LT, "FrequencyEnhancement", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0065, 0x0019, 0x0065, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0065, 0x0019, 0x0065, + EVR_CS, "CineMaster", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0065, 0x0019, 0x0065, + EVR_UL, "FocalSpotDeflectionAmplitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0066, 0x0019, 0x0066, + EVR_LT, "FrequencyType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0066, 0x0019, 0x0066, + EVR_SL, "CalibrationIsocenterToSourceDist", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0066, 0x0019, 0x0066, + EVR_SL, "PeriOverlapBottom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0066, 0x0019, 0x0066, + EVR_UL, "FocalSpotDeflectionPhase", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0066, 0x0019, 0x0066, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0067, 0x0019, 0x0067, + EVR_LT, "KernelLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0067, 0x0019, 0x0067, + EVR_UL, "FocalSpotDeflectionOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0068, 0x0019, 0x0068, + EVR_UL, "KernelMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0068, 0x0019, 0x0068, + EVR_SL, "CalibrationSourceToII", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0068, 0x0019, 0x0068, + EVR_IS, "CArmAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0068, 0x0019, 0x0068, + EVR_SL, "RawImageNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0068, 0x0019, 0x0068, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0069, 0x0019, 0x0069, + EVR_UL, "ConvolutionMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0069, 0x0019, 0x0069, + EVR_IS, "CollimatorAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x006a, 0x0019, 0x006a, + EVR_SL, "CalibrationIIZoom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x006a, 0x0019, 0x006a, + EVR_SS, "DependantOnNumberOfViewsProcessed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x006a, 0x0019, 0x006a, + EVR_SL, "XRayDataValid", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x006a, 0x0019, 0x006a, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x006b, 0x0019, 0x006b, + EVR_SS, "FieldOfViewInDetectorCells", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x006c, 0x0019, 0x006c, + EVR_SL, "CalibrationIIField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x006c, 0x0019, 0x006c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x006e, 0x0019, 0x006e, + EVR_SL, "CalibrationFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x006e, 0x0019, 0x006e, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_LT, "PLASource", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_SL, "CalibrationObjectToImageDistance", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_UN, "RADProtocolPrinter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_SS, "ValueOfBackProjectionButton", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_LO, "CRImageSerialNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE ??? From Adantage Review CS" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_US, "ExposureChannel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_IS, "FilterNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_IS, "NumberOfReadings", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_DS, "PhaseGradientAmplitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_DS, "WaterScalingFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_IS, "SplitExposureFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_IS, "NumberOfPrescans", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0070, 0x0019, 0x0070, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_LT, "PLADestination", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_UN, "RADProtocolMedium", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_SS, "SetIfFatqEstimatesWereUsed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_UN, "ExposureChannelFirstImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_LT, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_DS, "ReadoutGradientAmplitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_DS, "InterpolationFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_IS, "NoOfSplitExposureFrames", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0071, 0x0019, 0x0071, + EVR_IS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0072, 0x0019, 0x0072, + EVR_SL, "CalibrationSystemFactor", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0072, 0x0019, 0x0072, + EVR_DS, "ZChannelAvgOverViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0072, 0x0019, 0x0072, + EVR_US, "ProcessingChannel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0072, 0x0019, 0x0072, + EVR_DS, "SelectionGradientAmplitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0072, 0x0019, 0x0072, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0072, 0x0019, 0x0072, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0072, 0x0019, 0x0072, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0073, 0x0019, 0x0073, + EVR_DS, "AvgOfLeftRefChannelsOverViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0073, 0x0019, 0x0073, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0074, 0x0019, 0x0074, + EVR_SL, "CalibrationSystemCorrection", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0074, 0x0019, 0x0074, + EVR_DS, "MaxLeftChannelOverViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0074, 0x0019, 0x0074, + EVR_LO, "FilterMaterial1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0074, 0x0019, 0x0074, + EVR_IS, "NumberOfProjections", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0074, 0x0019, 0x0074, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0074, 0x0019, 0x0074, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0074, 0x0019, 0x0074, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0075, 0x0019, 0x0075, + EVR_LT, "UIDOriginalImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0075, 0x0019, 0x0075, + EVR_DS, "AvgOfRightRefChannelsOverViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0075, 0x0019, 0x0075, + EVR_LO, "FilterMaterial2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0075, 0x0019, 0x0075, + EVR_IS, "NumberOfBytes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0076, 0x0019, 0x0076, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0076, 0x0019, 0x0076, + EVR_SL, "CalibrationSystemIIFormats", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0076, 0x0019, 0x0076, + EVR_DS, "MaxRightChannelOverViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0076, 0x0019, 0x0076, + EVR_SL, "FillingAverageFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0076, 0x0019, 0x0076, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0076, 0x0019, 0x0076, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0077, 0x0019, 0x0077, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0078, 0x0019, 0x0078, + EVR_SL, "CalibrationGantryDataValid", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0078, 0x0019, 0x0078, + EVR_DS, "FilterThickness1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0078, 0x0019, 0x0078, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0078, 0x0019, 0x0078, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0078, 0x0019, 0x0078, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0079, 0x0019, 0x0079, + EVR_DS, "FilterThickness2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0079, 0x0019, 0x0079, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x007a, 0x0019, 0x007a, + EVR_SS, "CollimatorSquareBreadth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x007a, 0x0019, 0x007a, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x007a, 0x0019, 0x007a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x007c, 0x0019, 0x007c, + EVR_SS, "CollimatorSquareHeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x007c, 0x0019, 0x007c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x007c, 0x0019, 0x007c, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x007d, 0x0019, 0x007d, + EVR_DS, "SecondEcho", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x007e, 0x0019, 0x007e, + EVR_SS, "CollimatorSquareDiameter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x007e, 0x0019, 0x007e, + EVR_SS, "NumberOfEchos", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x007e, 0x0019, 0x007e, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x007e, 0x0019, 0x007e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x007f, 0x0019, 0x007f, + EVR_DS, "TableDelta", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_SS, "CollimaterFingerTurnAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_DS, "AcquisitionDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_IS, "BuckyFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_LO, "CRBarCodeNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE ??? From Adantage Review CS" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_DS, "GradientDelayTime", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_LT, "ReconstructionAlgorithmSet", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_LT, "PatientRegion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_IS, "ReadingPositionSpecification", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR SPECTRO;1" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0080, 0x0019, 0x0080, + EVR_LT, "ReaderHeader", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0081, 0x0019, 0x0081, + EVR_SS, "Contiguous", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0081, 0x0019, 0x0081, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0081, 0x0019, 0x0081, + EVR_UN, "RelativeImageTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0081, 0x0019, 0x0081, + EVR_IS, "ObjectPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0081, 0x0019, 0x0081, + EVR_LT, "ReconstructionAlgorithmIndex", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0081, 0x0019, 0x0081, + EVR_IS, "ReadingSensitivityCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0081, 0x0019, 0x0081, + EVR_LT, "FilterTypeForRawData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_SS, "CollimaterFingerPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_DS, "TotalGradientDelayTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_LT, "RegenerationSoftwareVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_LT, "PatientPhaseOfLife", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0082, 0x0019, 0x0082, + EVR_DS, "FilterParameterForRawData", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0083, 0x0019, 0x0083, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0083, 0x0019, 0x0083, + EVR_LT, "FilterTypeForImageData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0084, 0x0019, 0x0084, + EVR_SS, "CollimaterDiaphragmTurnAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0084, 0x0019, 0x0084, + EVR_DS, "PeakSAR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0084, 0x0019, 0x0084, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0084, 0x0019, 0x0084, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0084, 0x0019, 0x0084, + EVR_DS, "FilterParameterForImageData", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0085, 0x0019, 0x0085, + EVR_SS, "MonitorSAR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0085, 0x0019, 0x0085, + EVR_LT, "FilterTypeForPhaseCorrection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0086, 0x0019, 0x0086, + EVR_SS, "CollimaterDiaphragmPosition1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0086, 0x0019, 0x0086, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0086, 0x0019, 0x0086, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0086, 0x0019, 0x0086, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0086, 0x0019, 0x0086, + EVR_DS, "FilterParameterForPhaseCorrection", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0087, 0x0019, 0x0087, + EVR_DS, "CardiacRepetitionTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0087, 0x0019, 0x0087, + EVR_LT, "NormalizationFilterTypeForImageData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0088, 0x0019, 0x0088, + EVR_SS, "CollimaterDiaphragmPosition2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0088, 0x0019, 0x0088, + EVR_SS, "ImagesPerCardiacCycle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0088, 0x0019, 0x0088, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0019, 0x0088, 0x0019, 0x0088, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0088, 0x0019, 0x0088, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0088, 0x0019, 0x0088, + EVR_DS, "NormalizationFilterParameterForImageData", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x008a, 0x0019, 0x008a, + EVR_SS, "CollimaterDiaphragmMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x008a, 0x0019, 0x008a, + EVR_SS, "ActualReceiveGainAnalog", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x008a, 0x0019, 0x008a, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x008a, 0x0019, 0x008a, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x008b, 0x0019, 0x008b, + EVR_SS, "ActualReceiveGainDigital", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x008c, 0x0019, 0x008c, + EVR_SS, "CollimaterBeamLimitBreadth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x008c, 0x0019, 0x008c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x008c, 0x0019, 0x008c, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x008d, 0x0019, 0x008d, + EVR_DS, "DelayAfterTrigger", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x008e, 0x0019, 0x008e, + EVR_SS, "CollimaterBeamLimitHeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x008e, 0x0019, 0x008e, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x008e, 0x0019, 0x008e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x008f, 0x0019, 0x008f, + EVR_SS, "SwapPhaseFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x008f, 0x0019, 0x008f, + EVR_SS, "SwapPhaseFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_SS, "CollimaterBeamLimitDiameter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_LO, "UnprocessedFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_SS, "PauseInterval", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_CS, "VideoWhiteCompression", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_LO, "CRFilmOutputExposures", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE ??? From Adantage Review CS" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_LO, "DeskCommand", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_LT, "SensitivityCorrectionLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_DS, "OsteoOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_SH, "FilmAnnotationCharacterString1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_IS, "NumberOfSaturationRegions", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0090, 0x0019, 0x0090, + EVR_LT, "PLAOfSecondaryDestination", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x0091, 0x0019, 0x0091, + EVR_UN, "KeyValues", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0091, 0x0019, 0x0091, + EVR_DS, "PulseTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0091, 0x0019, 0x0091, + EVR_DS, "SaturationPhaseEncodingVectorCoronalComponent", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0091, 0x0019, 0x0091, + EVR_SH, "FilmAnnotationCharacterString2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0019, 0x0091, 0x0019, 0x0091, + EVR_DS, "SaturationPhaseEncodingVectorSagittalComponent", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_SS, "X-RayControlMOde", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_UN, "DestinationPostprocessingFunction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_SL, "SliceOffsetOnFrequencyAxis", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_DS, "SaturationReadoutVectorCoronalComponent", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_DS, "OsteoRegressionLineSlope", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0092, 0x0019, 0x0092, + EVR_DS, "SaturationReadoutVectorSagittalComponent", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0093, 0x0019, 0x0093, + EVR_DS, "CenterFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0093, 0x0019, 0x0093, + EVR_DS, "OsteoRegressionLineIntercept", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0093, 0x0019, 0x0093, + EVR_DS, "EPIStimulationMonitorMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0094, 0x0019, 0x0094, + EVR_SS, "X-RaySystem", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0094, 0x0019, 0x0094, + EVR_SS, "TransmitGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0094, 0x0019, 0x0094, + EVR_DS, "OsteoStandardizationCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0094, 0x0019, 0x0094, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0094, 0x0019, 0x0094, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0094, 0x0019, 0x0094, + EVR_DS, "ImageRotationAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0095, 0x0019, 0x0095, + EVR_SS, "AnalogReceiverGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0096, 0x0019, 0x0096, + EVR_SS, "FocalSpot", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0096, 0x0019, 0x0096, + EVR_SS, "DigitalReceiverGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0096, 0x0019, 0x0096, + EVR_IS, "OsteoPhantomNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x0096, 0x0019, 0x0096, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0096, 0x0019, 0x0096, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0096, 0x0019, 0x0096, + EVR_UL, "CoilIDMask", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0097, 0x0019, 0x0097, + EVR_SL, "BitmapDefiningCVs", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0097, 0x0019, 0x0097, + EVR_UL, "CoilClassMask", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0098, 0x0019, 0x0098, + EVR_SS, "ExposureControl", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x0098, 0x0019, 0x0098, + EVR_SS, "CenterFrequencyMethod", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x0098, 0x0019, 0x0098, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x0098, 0x0019, 0x0098, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x0098, 0x0019, 0x0098, + EVR_DS, "CoilPosition", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x0099, 0x0019, 0x0099, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x009a, 0x0019, 0x009a, + EVR_SL, "XRayVoltage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x009a, 0x0019, 0x009a, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x009a, 0x0019, 0x009a, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x009b, 0x0019, 0x009b, + EVR_SS, "PulseSequenceMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x009c, 0x0019, 0x009c, + EVR_SL, "XRayCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x009c, 0x0019, 0x009c, + EVR_SS, "PulseSequenceName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x009c, 0x0019, 0x009c, + EVR_LO, "PulseSequenceName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x009c, 0x0019, 0x009c, + EVR_SL, "IntensifierLevelCalibrationFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x009c, 0x0019, 0x009c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x009d, 0x0019, 0x009d, + EVR_DT, "PulseSequenceDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x009e, 0x0019, 0x009e, + EVR_SL, "XRayCurrentTimeProduct", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x009e, 0x0019, 0x009e, + EVR_LO, "InternalPulseSequenceName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x009e, 0x0019, 0x009e, + EVR_SL, "NativeReviewFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x009e, 0x0019, 0x009e, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x009f, 0x0019, 0x009f, + EVR_SS, "CoilType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x009f, 0x0019, 0x009f, + EVR_SS, "TransmittingCoil", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_SL, "XRayPulseTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_UN, "Version", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_SS, "SurfaceCoilType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_DS, "ExtendedExposureTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_US, "Angulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_US, "RFWatchdogMask", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_DS, "EPIReconstructionPhase", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x00a0, 0x0019, 0x00a0, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_UN, "RangingMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_SS, "ExtremityCoilFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_DS, "ActualExposureTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_US, "Rotation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_DS, "EPIReconstructionSlope", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_DS, "EPIReconstructionSlope", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0019, 0x00a1, 0x0019, 0x00a1, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0019, 0x00a2, 0x0019, 0x00a2, + EVR_SL, "XRaySceneTimeFluoroClock", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00a2, 0x0019, 0x00a2, + EVR_UN, "AbdomenBrightness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a2, 0x0019, 0x00a2, + EVR_SL, "RawDataRunNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a2, 0x0019, 0x00a2, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x00a2, 0x0019, 0x00a2, + EVR_DS, "RFPowerErrorIndicator", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00a2, 0x0019, 0x00a2, + EVR_SL, "SceneNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00a2, 0x0019, 0x00a2, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x00a3, 0x0019, 0x00a3, + EVR_UN, "FixedBrightness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a3, 0x0019, 0x00a3, + EVR_UL, "CalibratedFieldStrength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a3, 0x0019, 0x00a3, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x00a3, 0x0019, 0x00a3, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00a4, 0x0019, 0x00a4, + EVR_SS, "MaximumPulseRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00a4, 0x0019, 0x00a4, + EVR_SS, "SATFatWaterBone", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00a4, 0x0019, 0x00a4, + EVR_UN, "DetailContrast", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a4, 0x0019, 0x00a4, + EVR_SS, "SATFatWaterBone", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a4, 0x0019, 0x00a4, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00a4, 0x0019, 0x00a4, + EVR_SS, "AcquisitionMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00a4, 0x0019, 0x00a4, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x00a5, 0x0019, 0x00a5, + EVR_UN, "ContrastBalance", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a5, 0x0019, 0x00a5, + EVR_DS, "ReceiveBandwidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a5, 0x0019, 0x00a5, + EVR_DS, "SpecificAbsorptionRateWholeBody", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00a5, 0x0019, 0x00a5, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00a5, 0x0019, 0x00a5, + EVR_SS, "AcquisitonFrameRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00a6, 0x0019, 0x00a6, + EVR_SS, "PulsesPerScene", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00a6, 0x0019, 0x00a6, + EVR_UN, "StructureBoost", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a6, 0x0019, 0x00a6, + EVR_DS, "SpecificEnergyDose", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00a6, 0x0019, 0x00a6, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00a6, 0x0019, 0x00a6, + EVR_SL, "ECGFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00a6, 0x0019, 0x00a6, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x00a7, 0x0019, 0x00a7, + EVR_UN, "StructurePreference", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a7, 0x0019, 0x00a7, + EVR_DS, "UserData0", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a7, 0x0019, 0x00a7, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00a7, 0x0019, 0x00a7, + EVR_SL, "AdditionalSceneData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00a8, 0x0019, 0x00a8, + EVR_SL, "DoseAreaProductOfScene", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00a8, 0x0019, 0x00a8, + EVR_UN, "NoiseRobustness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a8, 0x0019, 0x00a8, + EVR_DS, "UserData1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a8, 0x0019, 0x00a8, + EVR_DS, "ExtendedXRayTubeCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0019, 0x00a8, 0x0019, 0x00a8, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00a8, 0x0019, 0x00a8, + EVR_SL, "FileCopyFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00a8, 0x0019, 0x00a8, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x00a9, 0x0019, 0x00a9, + EVR_UN, "NoiseDoseLimit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00a9, 0x0019, 0x00a9, + EVR_DS, "UserData2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00a9, 0x0019, 0x00a9, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00a9, 0x0019, 0x00a9, + EVR_SL, "PhlebovisionFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00aa, 0x0019, 0x00aa, + EVR_SS, "Dose", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00aa, 0x0019, 0x00aa, + EVR_UN, "NoiseDoseStep", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00aa, 0x0019, 0x00aa, + EVR_DS, "UserData3", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00aa, 0x0019, 0x00aa, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00aa, 0x0019, 0x00aa, + EVR_SL, "Co2Flag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00aa, 0x0019, 0x00aa, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x00ab, 0x0019, 0x00ab, + EVR_UN, "NoiseFrequencyLimit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00ab, 0x0019, 0x00ab, + EVR_DS, "UserData4", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ab, 0x0019, 0x00ab, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00ab, 0x0019, 0x00ab, + EVR_SS, "MaxSpeed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00ac, 0x0019, 0x00ac, + EVR_SS, "DoseRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00ac, 0x0019, 0x00ac, + EVR_UN, "WeakContrastLimit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00ac, 0x0019, 0x00ac, + EVR_DS, "UserData5", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ac, 0x0019, 0x00ac, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00ac, 0x0019, 0x00ac, + EVR_SS, "StepWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00ac, 0x0019, 0x00ac, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE B" } + , { 0x0019, 0x00ad, 0x0019, 0x00ad, + EVR_UN, "StrongContrastLimit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00ad, 0x0019, 0x00ad, + EVR_DS, "UserData6", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ad, 0x0019, 0x00ad, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00ad, 0x0019, 0x00ad, + EVR_SL, "DigitalAcquisitionZoom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x00ae, 0x0019, 0x00ae, + EVR_SL, "IIToCoverDistance", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00ae, 0x0019, 0x00ae, + EVR_UN, "StructureBoostOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00ae, 0x0019, 0x00ae, + EVR_DS, "UserData7", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ae, 0x0019, 0x00ae, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00af, 0x0019, 0x00af, + EVR_UN, "SmoothGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00af, 0x0019, 0x00af, + EVR_DS, "UserData8", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00af, 0x0019, 0x00af, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00b0, 0x0019, 0x00b0, + EVR_SS, "LastFramePhase1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b0, 0x0019, 0x00b0, + EVR_UN, "MeasureField1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00b0, 0x0019, 0x00b0, + EVR_DS, "UserData9", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b0, 0x0019, 0x00b0, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x00b0, 0x0019, 0x00b0, + EVR_UL, "AdjustmentStatusMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00b0, 0x0019, 0x00b0, + EVR_DS, "FeedPerRotation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00b1, 0x0019, 0x00b1, + EVR_SS, "FrameRatePhase1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b1, 0x0019, 0x00b1, + EVR_IS, "MinimumRRInterval", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00b1, 0x0019, 0x00b1, + EVR_UN, "MeasureField2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00b1, 0x0019, 0x00b1, + EVR_DS, "UserData10", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b1, 0x0019, 0x00b1, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0019, 0x00b2, 0x0019, 0x00b2, + EVR_SS, "LastFramePhase2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b2, 0x0019, 0x00b2, + EVR_IS, "MaximumRRInterval", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00b2, 0x0019, 0x00b2, + EVR_UN, "KeyPercentile1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00b2, 0x0019, 0x00b2, + EVR_DS, "UserData11", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b3, 0x0019, 0x00b3, + EVR_SS, "FrameRatePhase2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b3, 0x0019, 0x00b3, + EVR_IS, "NumberOfRejections", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00b3, 0x0019, 0x00b3, + EVR_UN, "KeyPercentile2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00b3, 0x0019, 0x00b3, + EVR_DS, "UserData12", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b4, 0x0019, 0x00b4, + EVR_SS, "LastFramePhase3", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b4, 0x0019, 0x00b4, + EVR_IS, "NumberOfRRIntervals", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00b4, 0x0019, 0x00b4, + EVR_UN, "DensityLUT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00b4, 0x0019, 0x00b4, + EVR_DS, "UserData13", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b5, 0x0019, 0x00b5, + EVR_SS, "FrameRatePhase3", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b5, 0x0019, 0x00b5, + EVR_IS, "ArrhythmiaRejection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00b5, 0x0019, 0x00b5, + EVR_UN, "Brightness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00b5, 0x0019, 0x00b5, + EVR_DS, "UserData14", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b6, 0x0019, 0x00b6, + EVR_SS, "LastFramePhase4", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b6, 0x0019, 0x00b6, + EVR_UN, "Gamma", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0019, 0x00b6, 0x0019, 0x00b6, + EVR_DS, "UserData15", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b7, 0x0019, 0x00b7, + EVR_SS, "FrameRatePhase4", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b7, 0x0019, 0x00b7, + EVR_DS, "UserData16", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b8, 0x0019, 0x00b8, + EVR_SS, "GammaOfNativeImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b8, 0x0019, 0x00b8, + EVR_DS, "UserData17", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00b9, 0x0019, 0x00b9, + EVR_SS, "GammaOfTVSystem", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00b9, 0x0019, 0x00b9, + EVR_DS, "UserData18", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ba, 0x0019, 0x00ba, + EVR_DS, "UserData19", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00bb, 0x0019, 0x00bb, + EVR_SL, "PixelshiftX", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00bb, 0x0019, 0x00bb, + EVR_DS, "UserData20", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00bc, 0x0019, 0x00bc, + EVR_SL, "PixelshiftY", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00bc, 0x0019, 0x00bc, + EVR_DS, "UserData21", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00bd, 0x0019, 0x00bd, + EVR_SL, "MaskAverageFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00bd, 0x0019, 0x00bd, + EVR_DS, "UserData22", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00bd, 0x0019, 0x00bd, + EVR_IS, "PulmoTriggerLevel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00be, 0x0019, 0x00be, + EVR_SL, "BlankingCircleFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00be, 0x0019, 0x00be, + EVR_DS, "ProjectionAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00be, 0x0019, 0x00be, + EVR_DS, "ExpiratoricReserveVolume", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00bf, 0x0019, 0x00bf, + EVR_SL, "CircleRowStart", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00bf, 0x0019, 0x00bf, + EVR_DS, "VitalCapacity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00c0, 0x0019, 0x00c0, + EVR_DS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00c0, 0x0019, 0x00c0, + EVR_SL, "CircleRowEnd", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c0, 0x0019, 0x00c0, + EVR_SS, "BitmapOfSATSelections", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00c0, 0x0019, 0x00c0, + EVR_SS, "SaturationPlanes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c0, 0x0019, 0x00c0, + EVR_DS, "PulmoWater", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00c1, 0x0019, 0x00c1, + EVR_SL, "CircleColumnStart", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c1, 0x0019, 0x00c1, + EVR_SS, "SurfaceCoilIntensityCorrectionFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00c1, 0x0019, 0x00c1, + EVR_SS, "SurfaceCoilIntensityCorrectionFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c1, 0x0019, 0x00c1, + EVR_DS, "EPICapacity", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00c1, 0x0019, 0x00c1, + EVR_DS, "PulmoAir", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00c2, 0x0019, 0x00c2, + EVR_SL, "CircleColumnEnd", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c2, 0x0019, 0x00c2, + EVR_SS, "SATLocationR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c2, 0x0019, 0x00c2, + EVR_DS, "EPIInductance", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00c2, 0x0019, 0x00c2, + EVR_DA, "PulmoDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00c3, 0x0019, 0x00c3, + EVR_SL, "CircleDiameter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c3, 0x0019, 0x00c3, + EVR_SS, "SATLocationL", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c3, 0x0019, 0x00c3, + EVR_IS, "EPISwitchConfigurationCode", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00c3, 0x0019, 0x00c3, + EVR_TM, "PulmoTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 COAD" } + , { 0x0019, 0x00c4, 0x0019, 0x00c4, + EVR_SL, "RectangularCollimaterFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c4, 0x0019, 0x00c4, + EVR_SS, "SATLocationA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c4, 0x0019, 0x00c4, + EVR_IS, "EPISwitchHardwareCode", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00c5, 0x0019, 0x00c5, + EVR_SL, "RectangleRowStart", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c5, 0x0019, 0x00c5, + EVR_SS, "SATLocationP", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c5, 0x0019, 0x00c5, + EVR_DS, "EPISwitchDelayTime", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00c6, 0x0019, 0x00c6, + EVR_IS, "CycledMultipleSlice", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00c6, 0x0019, 0x00c6, + EVR_SL, "RectangleRowEnd", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c6, 0x0019, 0x00c6, + EVR_SS, "SATLocationH", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c7, 0x0019, 0x00c7, + EVR_SL, "RectangleColumnStart", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c7, 0x0019, 0x00c7, + EVR_SS, "SATLocationF", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c8, 0x0019, 0x00c8, + EVR_SL, "RectangleColumnEnd", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c8, 0x0019, 0x00c8, + EVR_SS, "SATThicknessRL", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00c9, 0x0019, 0x00c9, + EVR_SL, "RectangleAngulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00c9, 0x0019, 0x00c9, + EVR_SS, "SATThicknessAP", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ca, 0x0019, 0x00ca, + EVR_SL, "IrisCollimatorFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00ca, 0x0019, 0x00ca, + EVR_SS, "SATThicknessHF", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00cb, 0x0019, 0x00cb, + EVR_SL, "IrisRowStart", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00cb, 0x0019, 0x00cb, + EVR_SS, "PhaseContrastFlowAxis", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00cb, 0x0019, 0x00cb, + EVR_SS, "PrescribedFlowAxis", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00cc, 0x0019, 0x00cc, + EVR_SL, "IrisRowEnd", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00cc, 0x0019, 0x00cc, + EVR_SS, "PhaseContrastVelocityEncoding", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00cc, 0x0019, 0x00cc, + EVR_SS, "VelocityEncoding", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00cd, 0x0019, 0x00cd, + EVR_SL, "IrisColumnStart", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00cd, 0x0019, 0x00cd, + EVR_SS, "ThicknessDisclaimer", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ce, 0x0019, 0x00ce, + EVR_IS, "REST", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00ce, 0x0019, 0x00ce, + EVR_SL, "IrisColumnEnd", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00ce, 0x0019, 0x00ce, + EVR_SS, "PrescanType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00cf, 0x0019, 0x00cf, + EVR_SL, "IrisAngulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00cf, 0x0019, 0x00cf, + EVR_SS, "PrescanStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d0, 0x0019, 0x00d0, + EVR_SH, "RawDataType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d1, 0x0019, 0x00d1, + EVR_SS, "NumberOfFramesPlane", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d1, 0x0019, 0x00d1, + EVR_DS, "FlowSensitivity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d2, 0x0019, 0x00d2, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d2, 0x0019, 0x00d2, + EVR_SS, "ProjectionAlgorithm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d2, 0x0019, 0x00d2, + EVR_LT, "CalculationSubmode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d3, 0x0019, 0x00d3, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d3, 0x0019, 0x00d3, + EVR_SH, "ProjectionAlgorithm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d3, 0x0019, 0x00d3, + EVR_DS, "FieldOfViewRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d4, 0x0019, 0x00d4, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d4, 0x0019, 0x00d4, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d4, 0x0019, 0x00d4, + EVR_IS, "BaseRawMatrixSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d5, 0x0019, 0x00d5, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00d5, 0x0019, 0x00d5, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d5, 0x0019, 0x00d5, + EVR_SS, "FractionalEcho", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00d5, 0x0019, 0x00d5, + EVR_SS, "FractionalEcho", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d5, 0x0019, 0x00d5, + EVR_IS, "2DOversamplingLines", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d6, 0x0019, 0x00d6, + EVR_IS, "FourierInterpolation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00d6, 0x0019, 0x00d6, + EVR_SS, "Internal", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d6, 0x0019, 0x00d6, + EVR_SS, "PrepPulse", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d6, 0x0019, 0x00d6, + EVR_IS, "3DPhaseOversamplingPartitions", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d7, 0x0019, 0x00d7, + EVR_SS, "Internal", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d7, 0x0019, 0x00d7, + EVR_SS, "CardiacPhases", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d7, 0x0019, 0x00d7, + EVR_IS, "EchoLinePosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d8, 0x0019, 0x00d8, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d8, 0x0019, 0x00d8, + EVR_SS, "VariableEchoFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00d8, 0x0019, 0x00d8, + EVR_SS, "VariableEchoFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d8, 0x0019, 0x00d8, + EVR_IS, "EchoColumnPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00d9, 0x0019, 0x00d9, + EVR_IS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00d9, 0x0019, 0x00d9, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00d9, 0x0019, 0x00d9, + EVR_DS, "ConcatenatedSat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00d9, 0x0019, 0x00d9, + EVR_DS, "ConcatenatedSAT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00d9, 0x0019, 0x00d9, + EVR_IS, "LinesPerSegment", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00da, 0x0019, 0x00da, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00da, 0x0019, 0x00da, + EVR_SS, "ReferenceChannelUsed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00da, 0x0019, 0x00da, + EVR_LT, "PhaseCodingDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 COAD" } + , { 0x0019, 0x00db, 0x0019, 0x00db, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00db, 0x0019, 0x00db, + EVR_DS, "BackProjectorCoefficient", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00dc, 0x0019, 0x00dc, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00dc, 0x0019, 0x00dc, + EVR_SS, "PrimarySpeedCorrectionUsed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00dd, 0x0019, 0x00dd, + EVR_SL, "AnatomicBackground", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00dd, 0x0019, 0x00dd, + EVR_SS, "OverrangeCorrectionUsed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00de, 0x0019, 0x00de, + EVR_SL, "AutoWindowBase", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00de, 0x0019, 0x00de, + EVR_DS, "DynamicZAlphaValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00df, 0x0019, 0x00df, + EVR_SS, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00df, 0x0019, 0x00df, + EVR_DS, "UserData23", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e0, 0x0019, 0x00e0, + EVR_IS, "Prepulse", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00e0, 0x0019, 0x00e0, + EVR_SL, "Internal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA PLANE A" } + , { 0x0019, 0x00e0, 0x0019, 0x00e0, + EVR_DS, "UserData24", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e1, 0x0019, 0x00e1, + EVR_DS, "PrepulseDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00e1, 0x0019, 0x00e1, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e2, 0x0019, 0x00e2, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00e2, 0x0019, 0x00e2, + EVR_DS, "VelocityEncodeScale", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e3, 0x0019, 0x00e3, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00e3, 0x0019, 0x00e3, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e4, 0x0019, 0x00e4, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e5, 0x0019, 0x00e5, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e6, 0x0019, 0x00e6, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e8, 0x0019, 0x00e8, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00e9, 0x0019, 0x00e9, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00eb, 0x0019, 0x00eb, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ec, 0x0019, 0x00ec, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00f0, 0x0019, 0x00f0, + EVR_LT, "WSProtocolString1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00f0, 0x0019, 0x00f0, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00f1, 0x0019, 0x00f1, + EVR_LT, "WSProtocolString2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00f1, 0x0019, 0x00f1, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00f2, 0x0019, 0x00f2, + EVR_LT, "WSProtocolString3", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00f2, 0x0019, 0x00f2, + EVR_SS, "NumberOfPhases", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0019, 0x00f2, 0x0019, 0x00f2, + EVR_SS, "FastPhases", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00f3, 0x0019, 0x00f3, + EVR_LT, "WSProtocolString4", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0019, 0x00f3, 0x0019, 0x00f3, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00f4, 0x0019, 0x00f4, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00f9, 0x0019, 0x00f9, + EVR_DS, "TransmitGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACQU_01" } + , { 0x0019, 0x00ff, 0x0019, 0x00ff, + EVR_SS, "Internal", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0019, 0x1000, 0x0019, 0x1000, + EVR_DS, "FieldOfView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR R5.5/PART" } + , { 0x0019, 0x1000, 0x0019, 0x1000, + EVR_DS, "FieldOfView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR R5.6/PART" } + , { 0x0019, 0x1000, 0x0019, 0x1000, + EVR_DS, "FieldOfView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1005, 0x0019, 0x1005, + EVR_DS, "CCAngulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1006, 0x0019, 0x1006, + EVR_DS, "APAngulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1007, 0x0019, 0x1007, + EVR_DS, "LRAngulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1008, 0x0019, 0x1008, + EVR_IS, "PatientPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1009, 0x0019, 0x1009, + EVR_IS, "PatientOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x100a, 0x0019, 0x100a, + EVR_IS, "SliceOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x100b, 0x0019, 0x100b, + EVR_DS, "LROffcenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x100c, 0x0019, 0x100c, + EVR_DS, "CCOffcenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x100d, 0x0019, 0x100d, + EVR_DS, "APOffcenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x100e, 0x0019, 0x100e, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x100f, 0x0019, 0x100f, + EVR_IS, "NumberOfSlices", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1010, 0x0019, 0x1010, + EVR_DS, "SliceFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1011, 0x0019, 0x1011, + EVR_DS, "EchoTimes", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1015, 0x0019, 0x1015, + EVR_IS, "DynamicStudy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1018, 0x0019, 0x1018, + EVR_DS, "HeartbeatInterval", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1019, 0x0019, 0x1019, + EVR_DS, "RepetitionTimeFFE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x101a, 0x0019, 0x101a, + EVR_DS, "FFEFlipAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x101b, 0x0019, 0x101b, + EVR_IS, "NumberOfScans", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1021, 0x0019, 0x1021, + EVR_DS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1022, 0x0019, 0x1022, + EVR_DS, "DynamicScanTimeBegin", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1024, 0x0019, 0x1024, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1064, 0x0019, 0x1064, + EVR_DS, "RepetitionTimeSE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1065, 0x0019, 0x1065, + EVR_DS, "RepetitionTimeIR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1069, 0x0019, 0x1069, + EVR_IS, "NumberOfPhases", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x106a, 0x0019, 0x106a, + EVR_IS, "CardiacFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x106b, 0x0019, 0x106b, + EVR_DS, "InversionDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x106c, 0x0019, 0x106c, + EVR_DS, "GateDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x106d, 0x0019, 0x106d, + EVR_DS, "GateWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x106e, 0x0019, 0x106e, + EVR_DS, "TriggerDelayTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1080, 0x0019, 0x1080, + EVR_IS, "NumberOfChemicalShifts", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1081, 0x0019, 0x1081, + EVR_DS, "ChemicalShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1084, 0x0019, 0x1084, + EVR_IS, "NumberOfRows", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1085, 0x0019, 0x1085, + EVR_IS, "NumberOfSamples", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1094, 0x0019, 0x1094, + EVR_LO, "MagnetizationTransferContrast", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1095, 0x0019, 0x1095, + EVR_LO, "SpectralPresaturationWithInversionRecovery", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1096, 0x0019, 0x1096, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1097, 0x0019, 0x1097, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10a0, 0x0019, 0x10a0, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10a1, 0x0019, 0x10a1, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10a3, 0x0019, 0x10a3, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10a4, 0x0019, 0x10a4, + EVR_CS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10c8, 0x0019, 0x10c8, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10c9, 0x0019, 0x10c9, + EVR_IS, "FoldoverDirectionTransverse", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10ca, 0x0019, 0x10ca, + EVR_IS, "FoldoverDirectionSagittal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10cb, 0x0019, 0x10cb, + EVR_IS, "FoldoverDirectionCoronal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10cc, 0x0019, 0x10cc, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10cd, 0x0019, 0x10cd, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10ce, 0x0019, 0x10ce, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10cf, 0x0019, 0x10cf, + EVR_IS, "NumberOfEchoes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d0, 0x0019, 0x10d0, + EVR_IS, "ScanResolution", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d2, 0x0019, 0x10d2, + EVR_LO, "WaterFatShift", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d4, 0x0019, 0x10d4, + EVR_IS, "ArtifactReduction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d5, 0x0019, 0x10d5, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d6, 0x0019, 0x10d6, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d7, 0x0019, 0x10d7, + EVR_DS, "ScanPercentage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d8, 0x0019, 0x10d8, + EVR_IS, "Halfscan", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10d9, 0x0019, 0x10d9, + EVR_IS, "EPIFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10da, 0x0019, 0x10da, + EVR_IS, "TurboFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10db, 0x0019, 0x10db, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10e0, 0x0019, 0x10e0, + EVR_IS, "PercentageOfScanCompleted", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x10e1, 0x0019, 0x10e1, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1100, 0x0019, 0x1100, + EVR_IS, "NumberOfStacks", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1101, 0x0019, 0x1101, + EVR_IS, "StackType", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1102, 0x0019, 0x1102, + EVR_IS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x110b, 0x0019, 0x110b, + EVR_DS, "LROffcenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x110c, 0x0019, 0x110c, + EVR_DS, "CCOffcenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x110d, 0x0019, 0x110d, + EVR_DS, "APOffcenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x1145, 0x0019, 0x1145, + EVR_IS, "ReconstructionResolution", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x11fc, 0x0019, 0x11fc, + EVR_IS, "ResonanceFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x12c0, 0x0019, 0x12c0, + EVR_DS, "TriggerDelayTimes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x12e0, 0x0019, 0x12e0, + EVR_IS, "PrepulseType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x12e1, 0x0019, 0x12e1, + EVR_DS, "PrepulseDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0019, 0x12e3, 0x0019, 0x12e3, + EVR_DS, "PhaseContrastVelocity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } +#endif + , { 0x0020, 0x000d, 0x0020, 0x000d, + EVR_UI, "StudyInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x000e, 0x0020, 0x000e, + EVR_UI, "SeriesInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0010, 0x0020, 0x0010, + EVR_SH, "StudyID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0011, 0x0020, 0x0011, + EVR_IS, "SeriesNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0012, 0x0020, 0x0012, + EVR_IS, "AcquisitionNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0013, 0x0020, 0x0013, + EVR_IS, "InstanceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0014, 0x0020, 0x0014, + EVR_IS, "RETIRED_IsotopeNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0015, 0x0020, 0x0015, + EVR_IS, "RETIRED_PhaseNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0016, 0x0020, 0x0016, + EVR_IS, "RETIRED_IntervalNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0017, 0x0020, 0x0017, + EVR_IS, "RETIRED_TimeSlotNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0018, 0x0020, 0x0018, + EVR_IS, "RETIRED_AngleNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0019, 0x0020, 0x0019, + EVR_IS, "ItemNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0020, 0x0020, 0x0020, + EVR_CS, "PatientOrientation", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0022, 0x0020, 0x0022, + EVR_IS, "RETIRED_OverlayNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0024, 0x0020, 0x0024, + EVR_IS, "RETIRED_CurveNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0026, 0x0020, 0x0026, + EVR_IS, "RETIRED_LUTNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0030, 0x0020, 0x0030, + EVR_DS, "RETIRED_ImagePosition", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0032, 0x0020, 0x0032, + EVR_DS, "ImagePositionPatient", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0035, 0x0020, 0x0035, + EVR_DS, "RETIRED_ImageOrientation", 6, 6, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0037, 0x0020, 0x0037, + EVR_DS, "ImageOrientationPatient", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0050, 0x0020, 0x0050, + EVR_DS, "RETIRED_Location", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0052, 0x0020, 0x0052, + EVR_UI, "FrameOfReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0060, 0x0020, 0x0060, + EVR_CS, "Laterality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0062, 0x0020, 0x0062, + EVR_CS, "ImageLaterality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0070, 0x0020, 0x0070, + EVR_LO, "RETIRED_ImageGeometryType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0080, 0x0020, 0x0080, + EVR_CS, "RETIRED_MaskingImage", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x00aa, 0x0020, 0x00aa, + EVR_IS, "RETIRED_ReportNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0100, 0x0020, 0x0100, + EVR_IS, "TemporalPositionIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0105, 0x0020, 0x0105, + EVR_IS, "NumberOfTemporalPositions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0110, 0x0020, 0x0110, + EVR_DS, "TemporalResolution", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0200, 0x0020, 0x0200, + EVR_UI, "SynchronizationFrameOfReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x0242, 0x0020, 0x0242, + EVR_UI, "SOPInstanceUIDOfConcatenationSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1000, 0x0020, 0x1000, + EVR_IS, "RETIRED_SeriesInStudy", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1001, 0x0020, 0x1001, + EVR_IS, "RETIRED_AcquisitionsInSeries", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1002, 0x0020, 0x1002, + EVR_IS, "ImagesInAcquisition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1003, 0x0020, 0x1003, + EVR_IS, "RETIRED_ImagesInSeries", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1004, 0x0020, 0x1004, + EVR_IS, "RETIRED_AcquisitionsInStudy", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1005, 0x0020, 0x1005, + EVR_IS, "RETIRED_ImagesInStudy", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1020, 0x0020, 0x1020, + EVR_LO, "RETIRED_Reference", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x103f, 0x0020, 0x103f, + EVR_LO, "TargetPositionReferenceIndicator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1040, 0x0020, 0x1040, + EVR_LO, "PositionReferenceIndicator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1041, 0x0020, 0x1041, + EVR_DS, "SliceLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1070, 0x0020, 0x1070, + EVR_IS, "RETIRED_OtherStudyNumbers", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1200, 0x0020, 0x1200, + EVR_IS, "NumberOfPatientRelatedStudies", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1202, 0x0020, 0x1202, + EVR_IS, "NumberOfPatientRelatedSeries", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1204, 0x0020, 0x1204, + EVR_IS, "NumberOfPatientRelatedInstances", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1206, 0x0020, 0x1206, + EVR_IS, "NumberOfStudyRelatedSeries", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1208, 0x0020, 0x1208, + EVR_IS, "NumberOfStudyRelatedInstances", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x1209, 0x0020, 0x1209, + EVR_IS, "NumberOfSeriesRelatedInstances", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x3401, 0x0020, 0x3401, + EVR_CS, "RETIRED_ModifyingDeviceID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x3402, 0x0020, 0x3402, + EVR_CS, "RETIRED_ModifiedImageID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x3403, 0x0020, 0x3403, + EVR_DA, "RETIRED_ModifiedImageDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x3404, 0x0020, 0x3404, + EVR_LO, "RETIRED_ModifyingDeviceManufacturer", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x3405, 0x0020, 0x3405, + EVR_TM, "RETIRED_ModifiedImageTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x3406, 0x0020, 0x3406, + EVR_LO, "RETIRED_ModifiedImageDescription", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x4000, 0x0020, 0x4000, + EVR_LT, "ImageComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x5000, 0x0020, 0x5000, + EVR_AT, "RETIRED_OriginalImageIdentification", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x5002, 0x0020, 0x5002, + EVR_LO, "RETIRED_OriginalImageIdentificationNomenclature", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9056, 0x0020, 0x9056, + EVR_SH, "StackID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9057, 0x0020, 0x9057, + EVR_UL, "InStackPositionNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9071, 0x0020, 0x9071, + EVR_SQ, "FrameAnatomySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9072, 0x0020, 0x9072, + EVR_CS, "FrameLaterality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9111, 0x0020, 0x9111, + EVR_SQ, "FrameContentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9113, 0x0020, 0x9113, + EVR_SQ, "PlanePositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9116, 0x0020, 0x9116, + EVR_SQ, "PlaneOrientationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9128, 0x0020, 0x9128, + EVR_UL, "TemporalPositionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9153, 0x0020, 0x9153, + EVR_FD, "NominalCardiacTriggerDelayTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9154, 0x0020, 0x9154, + EVR_FL, "NominalCardiacTriggerTimePriorToRPeak", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9155, 0x0020, 0x9155, + EVR_FL, "ActualCardiacTriggerTimePriorToRPeak", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9156, 0x0020, 0x9156, + EVR_US, "FrameAcquisitionNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9157, 0x0020, 0x9157, + EVR_UL, "DimensionIndexValues", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9158, 0x0020, 0x9158, + EVR_LT, "FrameComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9161, 0x0020, 0x9161, + EVR_UI, "ConcatenationUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9162, 0x0020, 0x9162, + EVR_US, "InConcatenationNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9163, 0x0020, 0x9163, + EVR_US, "InConcatenationTotalNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9164, 0x0020, 0x9164, + EVR_UI, "DimensionOrganizationUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9165, 0x0020, 0x9165, + EVR_AT, "DimensionIndexPointer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9167, 0x0020, 0x9167, + EVR_AT, "FunctionalGroupPointer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9170, 0x0020, 0x9170, + EVR_SQ, "UnassignedSharedConvertedAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9171, 0x0020, 0x9171, + EVR_SQ, "UnassignedPerFrameConvertedAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9172, 0x0020, 0x9172, + EVR_SQ, "ConversionSourceAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9213, 0x0020, 0x9213, + EVR_LO, "DimensionIndexPrivateCreator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9221, 0x0020, 0x9221, + EVR_SQ, "DimensionOrganizationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9222, 0x0020, 0x9222, + EVR_SQ, "DimensionIndexSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9228, 0x0020, 0x9228, + EVR_UL, "ConcatenationFrameOffsetNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9238, 0x0020, 0x9238, + EVR_LO, "FunctionalGroupPrivateCreator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9241, 0x0020, 0x9241, + EVR_FL, "NominalPercentageOfCardiacPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9245, 0x0020, 0x9245, + EVR_FL, "NominalPercentageOfRespiratoryPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9246, 0x0020, 0x9246, + EVR_FL, "StartingRespiratoryAmplitude", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9247, 0x0020, 0x9247, + EVR_CS, "StartingRespiratoryPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9248, 0x0020, 0x9248, + EVR_FL, "EndingRespiratoryAmplitude", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9249, 0x0020, 0x9249, + EVR_CS, "EndingRespiratoryPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9250, 0x0020, 0x9250, + EVR_CS, "RespiratoryTriggerType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9251, 0x0020, 0x9251, + EVR_FD, "RRIntervalTimeNominal", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9252, 0x0020, 0x9252, + EVR_FD, "ActualCardiacTriggerDelayTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9253, 0x0020, 0x9253, + EVR_SQ, "RespiratorySynchronizationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9254, 0x0020, 0x9254, + EVR_FD, "RespiratoryIntervalTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9255, 0x0020, 0x9255, + EVR_FD, "NominalRespiratoryTriggerDelayTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9256, 0x0020, 0x9256, + EVR_FD, "RespiratoryTriggerDelayThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9257, 0x0020, 0x9257, + EVR_FD, "ActualRespiratoryTriggerDelayTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9301, 0x0020, 0x9301, + EVR_FD, "ImagePositionVolume", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9302, 0x0020, 0x9302, + EVR_FD, "ImageOrientationVolume", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9307, 0x0020, 0x9307, + EVR_CS, "UltrasoundAcquisitionGeometry", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9308, 0x0020, 0x9308, + EVR_FD, "ApexPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9309, 0x0020, 0x9309, + EVR_FD, "VolumeToTransducerMappingMatrix", 16, 16, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x930a, 0x0020, 0x930a, + EVR_FD, "VolumeToTableMappingMatrix", 16, 16, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x930b, 0x0020, 0x930b, + EVR_CS, "VolumeToTransducerRelationship", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x930c, 0x0020, 0x930c, + EVR_CS, "PatientFrameOfReferenceSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x930d, 0x0020, 0x930d, + EVR_FD, "TemporalPositionTimeOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x930e, 0x0020, 0x930e, + EVR_SQ, "PlanePositionVolumeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x930f, 0x0020, 0x930f, + EVR_SQ, "PlaneOrientationVolumeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9310, 0x0020, 0x9310, + EVR_SQ, "TemporalPositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9311, 0x0020, 0x9311, + EVR_CS, "DimensionOrganizationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9312, 0x0020, 0x9312, + EVR_UI, "VolumeFrameOfReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9313, 0x0020, 0x9313, + EVR_UI, "TableFrameOfReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9421, 0x0020, 0x9421, + EVR_LO, "DimensionDescriptionLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9450, 0x0020, 0x9450, + EVR_SQ, "PatientOrientationInFrameSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9453, 0x0020, 0x9453, + EVR_LO, "FrameLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9518, 0x0020, 0x9518, + EVR_US, "AcquisitionIndex", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9529, 0x0020, 0x9529, + EVR_SQ, "ContributingSOPInstancesReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x9536, 0x0020, 0x9536, + EVR_US, "ReconstructionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0021, 0x0000, 0x0021, 0x0000, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0021, 0x0000, 0x0021, 0x0000, + EVR_LT, "WindowOfImagesID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-CWS Release 1" } + , { 0x0021, 0x0000, 0x0021, 0x0000, + EVR_DS, "NoiseReduction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0000, 0x0021, 0x0000, + EVR_LT, "SequenceType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0000, 0x0021, 0x0000, + EVR_US, "AcquisitionType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0001, 0x0021, 0x0001, + EVR_CS, "WindowOfImagesType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-CWS Release 1" } + , { 0x0021, 0x0001, 0x0021, 0x0001, + EVR_IS, "ReconstructionNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS-MR-1" } + , { 0x0021, 0x0001, 0x0021, 0x0001, + EVR_DS, "ContrastAmplification", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0001, 0x0021, 0x0001, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0021, 0x0001, 0x0021, 0x0001, + EVR_IS, "VectorSizeOriginal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0001, 0x0021, 0x0001, + EVR_US, "AcquisitionMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0002, 0x0021, 0x0002, + EVR_IS, "WindowOfImagesScope", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private-CWS Release 1" } + , { 0x0021, 0x0002, 0x0021, 0x0002, + EVR_IS, "SliceNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS-MR-1" } + , { 0x0021, 0x0002, 0x0021, 0x0002, + EVR_DS, "EdgeContrastBoosting", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0002, 0x0021, 0x0002, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0021, 0x0002, 0x0021, 0x0002, + EVR_IS, "VectorSizeExtended", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0002, 0x0021, 0x0002, + EVR_US, "FootswitchIndex", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0003, 0x0021, 0x0003, + EVR_SS, "SeriesFromWhichPrescribed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0003, 0x0021, 0x0003, + EVR_DS, "LatitudeReduction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0003, 0x0021, 0x0003, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x0021, 0x0003, 0x0021, 0x0003, + EVR_DS, "AcquiredSpectralRange", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0003, 0x0021, 0x0003, + EVR_US, "AcquisitionRoom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0004, 0x0021, 0x0004, + EVR_DS, "VOIPosition", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0004, 0x0021, 0x0004, + EVR_SL, "CurrentTimeProduct", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0005, 0x0021, 0x0005, + EVR_SH, "GenesisVersionNow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0005, 0x0021, 0x0005, + EVR_DS, "VOISize", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0005, 0x0021, 0x0005, + EVR_SL, "Dose", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0006, 0x0021, 0x0006, + EVR_IS, "CSIMatrixSizeOriginal", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0006, 0x0021, 0x0006, + EVR_SL, "SkinDosePercent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0007, 0x0021, 0x0007, + EVR_UL, "SeriesRecordChecksum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0007, 0x0021, 0x0007, + EVR_IS, "CSIMatrixSizeExtended", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0007, 0x0021, 0x0007, + EVR_SL, "SkinDoseAccumulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0008, 0x0021, 0x0008, + EVR_DS, "SpatialGridShift", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0008, 0x0021, 0x0008, + EVR_SL, "SkinDoseRate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0009, 0x0021, 0x0009, + EVR_DS, "SignalLimitsMinimum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x000a, 0x0021, 0x000a, + EVR_UL, "CopperFilter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x000b, 0x0021, 0x000b, + EVR_US, "MeasuringField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x000c, 0x0021, 0x000c, + EVR_SS, "PostBlankingCircle", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x000d, 0x0021, 0x000d, + EVR_SS, "DynaAngles", 2, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x000e, 0x0021, 0x000e, + EVR_SS, "TotalSteps", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x000f, 0x0021, 0x000f, + EVR_SL, "DynaXRayInfo", 3, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_UL, "CreationMask", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_LO, "FindRangeAlgorithm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_IS, "RotationAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_DS, "Zoom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_DS, "SignalLimitsMaximum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_CS, "FCRImageID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0021, 0x0010, 0x0021, 0x0010, + EVR_US, "ModalityLUTInputGamma", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0011, 0x0021, 0x0011, + EVR_DS, "ThresholdCAlgorithm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0011, 0x0021, 0x0011, + EVR_IS, "StartAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0011, 0x0021, 0x0011, + EVR_DS, "Target", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0021, 0x0011, 0x0021, 0x0011, + EVR_DS, "SpecInfoMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0011, 0x0021, 0x0011, + EVR_US, "ModalityLUTOutputGamma", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0012, 0x0021, 0x0012, + EVR_IS, "ExposureNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0021, 0x0012, 0x0021, 0x0012, + EVR_LT, "SeriesUniqueIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0021, 0x0012, 0x0021, 0x0012, + EVR_IS, "TubeAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0021, 0x0012, 0x0021, 0x0012, + EVR_DS, "EPITimeRateOfChangeOfMagnitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0012, 0x0021, 0x0012, + EVR_OB, "SH_STPAR", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0013, 0x0021, 0x0013, + EVR_IS, "ImageSequenceNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0021, 0x0013, 0x0021, 0x0013, + EVR_DS, "EPITimeRateOfChangeOfXComponent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0013, 0x0021, 0x0013, + EVR_US, "AcquisitionZoom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0014, 0x0021, 0x0014, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0021, 0x0014, 0x0021, 0x0014, + EVR_DS, "EPITimeRateOfChangeOfYComponent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0014, 0x0021, 0x0014, + EVR_SS, "DynaAngulationStepWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0015, 0x0021, 0x0015, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0015, 0x0021, 0x0015, + EVR_SS, "ImagesInStudy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0021, 0x0015, 0x0021, 0x0015, + EVR_DS, "EPITimeRateOfChangeOfZComponent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0015, 0x0021, 0x0015, + EVR_US, "Harmonization", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0016, 0x0021, 0x0016, + EVR_SS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0016, 0x0021, 0x0016, + EVR_DS, "EPITimeRateOfChangeLegalLimit1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0016, 0x0021, 0x0016, + EVR_US, "DRSingleFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0017, 0x0021, 0x0017, + EVR_DS, "EPIOperationModeFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0017, 0x0021, 0x0017, + EVR_SL, "SourceToIsocenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0018, 0x0021, 0x0018, + EVR_SH, "GenesisVersionNow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0018, 0x0021, 0x0018, + EVR_DS, "EPIFieldCalculationSafetyFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0018, 0x0021, 0x0018, + EVR_US, "PressureData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0019, 0x0021, 0x0019, + EVR_UL, "AcqReconRecordChecksum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0019, 0x0021, 0x0019, + EVR_DS, "EPILegalLimit1OfChangeValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0019, 0x0021, 0x0019, + EVR_SL, "ECGIndexArray", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x001a, 0x0021, 0x001a, + EVR_US, "FDFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x001b, 0x0021, 0x001b, + EVR_OB, "SH_ZOOM", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x001c, 0x0021, 0x001c, + EVR_OB, "SH_COLPAR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x001d, 0x0021, 0x001d, + EVR_US, "K_Factor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x001e, 0x0021, 0x001e, + EVR_US, "EVE", 8, 8, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x001f, 0x0021, 0x001f, + EVR_SL, "TotalSceneTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_DS, "FoV", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_UL, "EvaluationMask", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_DS, "TableStartLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_LO, "SensometricCurve", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_SS, "ScenesInStudy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_US, "ROIMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_DS, "EPILegalLimit2OfChangeValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_IS, "PhaseCorrectionRowsSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0020, 0x0021, 0x0020, + EVR_US, "RestoreFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0021, 0x0021, 0x0021, + EVR_DS, "SliceGap", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0021, 0x0021, 0x0021, 0x0021, + EVR_DS, "EPIRiseTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0021, 0x0021, 0x0021, + EVR_IS, "PhaseCorrectionColumnsSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0021, 0x0021, 0x0021, + EVR_US, "StandMovementFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0022, 0x0021, 0x0022, + EVR_DS, "ImageMagnificationFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0022, 0x0021, 0x0022, + EVR_DS, "StackRadialAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0021, 0x0022, 0x0021, 0x0022, + EVR_IS, "PhaseCorrectionRowsReconstruction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0022, 0x0021, 0x0022, + EVR_US, "FDRows", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0023, 0x0021, 0x0023, + EVR_US, "FDColumns", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0024, 0x0021, 0x0024, + EVR_DS, "ImageScrollOffset", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0024, 0x0021, 0x0024, + EVR_IS, "PhaseCorrectionColumnsReconstruction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0024, 0x0021, 0x0024, + EVR_US, "TableMovementFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0025, 0x0021, 0x0025, + EVR_SS, "ImagesInPhotofile", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0021, 0x0025, 0x0021, 0x0025, + EVR_LO, "OriginalOrganProgramName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0026, 0x0021, 0x0026, + EVR_IS, "ImagePixelOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0026, 0x0021, 0x0026, + EVR_DS, "CrispyXPIFilter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ACQ 1.0" } + , { 0x0021, 0x0027, 0x0021, 0x0027, + EVR_SS, "PlaneBImagesExist", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0021, 0x0028, 0x0021, 0x0028, + EVR_SS, "NoOf2MBChunks", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_LT, "ViewDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_US, "ExtendedProcessingMask", 7, 7, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_DS, "LowerWindowOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_IS, "TopogramTubePosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_SS, "ImagesInAllScenes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_DS, "ArrayCoilADCOffset", 16, 16, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_IS, "NumberOf3DRawPartitionsNominal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0030, 0x0021, 0x0030, + EVR_CS, "SetNo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0021, 0x0031, 0x0021, 0x0031, + EVR_DS, "UpperWindowOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0031, 0x0021, 0x0031, + EVR_DS, "ArrayCoilPreamplifierGain", 16, 16, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0031, 0x0021, 0x0031, + EVR_IS, "NumberOf3DRawPartitionsCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0032, 0x0021, 0x0032, + EVR_CS, "PatientRestDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0032, 0x0021, 0x0032, + EVR_DS, "LengthOfTopogram", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0034, 0x0021, 0x0034, + EVR_DS, "TopogramCorrectionFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0034, 0x0021, 0x0034, + EVR_IS, "NumberOf3DImagePartitions", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0035, 0x0021, 0x0035, + EVR_SS, "SeriesFromWhichPrescribed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0036, 0x0021, 0x0036, + EVR_SS, "ImageFromWhichPrescribed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0036, 0x0021, 0x0036, + EVR_DS, "MaximumTablePosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0036, 0x0021, 0x0036, + EVR_IS, "Actual3DImagePartitionNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0037, 0x0021, 0x0037, + EVR_SS, "ScreenFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0039, 0x0021, 0x0039, + EVR_DS, "SlabThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_CDS Release 1" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_SS, "ArchiveSWInternalVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RA GEN" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_IS, "TableMoveDirectionCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_DS, "MinPrintableDensity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_IS, "NumberOfSlicesNominal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0040, 0x0021, 0x0040, + EVR_IS, "ImageNoInTheSet", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0021, 0x0041, 0x0021, 0x0041, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0041, 0x0021, 0x0041, + EVR_DS, "MaxPrintableDensity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0041, 0x0021, 0x0041, + EVR_IS, "NumberOfSlicesCurrent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0042, 0x0021, 0x0042, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0042, 0x0021, 0x0042, + EVR_IS, "CurrentSliceNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0043, 0x0021, 0x0043, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0043, 0x0021, 0x0043, + EVR_IS, "CurrentGroupNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0044, 0x0021, 0x0044, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0044, 0x0021, 0x0044, + EVR_DS, "CurrentSliceDistanceFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0045, 0x0021, 0x0045, + EVR_IS, "VOIStartRow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0045, 0x0021, 0x0045, + EVR_IS, "MIPStartRow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0046, 0x0021, 0x0046, + EVR_IS, "VOIStopRow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0046, 0x0021, 0x0046, + EVR_IS, "MIPStopRow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0047, 0x0021, 0x0047, + EVR_IS, "VOIStartColumn", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0047, 0x0021, 0x0047, + EVR_IS, "MIPStartColumn", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0048, 0x0021, 0x0048, + EVR_IS, "VOIStopColumn", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0048, 0x0021, 0x0048, + EVR_IS, "MIPStartColumn", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0049, 0x0021, 0x0049, + EVR_IS, "VOIStartSlice", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0049, 0x0021, 0x0049, + EVR_IS, "MIPStartSliceName=", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x004a, 0x0021, 0x004a, + EVR_LO, "AnatomicalReferenceForScout", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x004a, 0x0021, 0x004a, + EVR_IS, "VOIStopSlice", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x004a, 0x0021, 0x004a, + EVR_IS, "MIPStartSlice", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x004e, 0x0021, 0x004e, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x004f, 0x0021, 0x004f, + EVR_SS, "LocationsInAcquisition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x004f, 0x0021, 0x004f, + EVR_LT, "OrderofSlices", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0050, 0x0021, 0x0050, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0050, 0x0021, 0x0050, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 RAW" } + , { 0x0021, 0x0050, 0x0021, 0x0050, + EVR_SS, "GraphicallyPrescribed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0050, 0x0021, 0x0050, + EVR_IS, "VectorStartRow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0050, 0x0021, 0x0050, + EVR_LT, "SaturationType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0050, 0x0021, 0x0050, + EVR_US, "SignalMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0050, 0x0021, 0x0050, + EVR_CS, "PairProcessingInformation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0021, 0x0051, 0x0021, 0x0051, + EVR_DS, "RotationFromSourceXRot", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0051, 0x0021, 0x0051, + EVR_IS, "VectorRowStep", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0051, 0x0021, 0x0051, + EVR_DS, "SaturationNormalVector", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0052, 0x0021, 0x0052, + EVR_DS, "RotationFromSourceYRot", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0052, 0x0021, 0x0052, + EVR_IS, "VectorStartColumn", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0052, 0x0021, 0x0052, + EVR_DS, "SaturationPositionVector", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0052, 0x0021, 0x0052, + EVR_DS, "DelayAfterTrigger", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0053, 0x0021, 0x0053, + EVR_DS, "RotationFromSourceZRot", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0053, 0x0021, 0x0053, + EVR_IS, "VectorColumnStep", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0053, 0x0021, 0x0053, + EVR_DS, "SaturationThickness", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0053, 0x0021, 0x0053, + EVR_IS, "RRInterval", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0054, 0x0021, 0x0054, + EVR_SH, "ImagePosition", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0054, 0x0021, 0x0054, + EVR_DS, "SaturationWidth", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0054, 0x0021, 0x0054, + EVR_DS, "NumberOfTriggerPulses", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0055, 0x0021, 0x0055, + EVR_SH, "ImageOrientation", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0055, 0x0021, 0x0055, + EVR_DS, "SaturationDistance", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 RAW" } + , { 0x0021, 0x0056, 0x0021, 0x0056, + EVR_SL, "IntegerSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0056, 0x0021, 0x0056, + EVR_DS, "RepetitionTimeEffective", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0057, 0x0021, 0x0057, + EVR_SL, "IntegerSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0057, 0x0021, 0x0057, + EVR_LT, "GatePhase", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0058, 0x0021, 0x0058, + EVR_SL, "IntegerSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0058, 0x0021, 0x0058, + EVR_DS, "GateThreshold", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0059, 0x0021, 0x0059, + EVR_SL, "IntegerSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0059, 0x0021, 0x0059, + EVR_DS, "GatedRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x005a, 0x0021, 0x005a, + EVR_SL, "IntegerSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x005b, 0x0021, 0x005b, + EVR_DS, "FloatSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x005c, 0x0021, 0x005c, + EVR_DS, "FloatSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x005d, 0x0021, 0x005d, + EVR_DS, "FloatSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x005e, 0x0021, 0x005e, + EVR_DS, "FloatSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x005f, 0x0021, 0x005f, + EVR_DS, "FloatSlop", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0060, 0x0021, 0x0060, + EVR_DS, "ImagePosition", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0060, 0x0021, 0x0060, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0060, 0x0021, 0x0060, + EVR_IS, "RangeTypeCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0060, 0x0021, 0x0060, + EVR_IS, "NumberOfInterpolatedImages", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0061, 0x0021, 0x0061, + EVR_DS, "ImageNormal", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0062, 0x0021, 0x0062, + EVR_IS, "ReferenceTypeCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0063, 0x0021, 0x0063, + EVR_DS, "ImageDistance", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0065, 0x0021, 0x0065, + EVR_US, "ImagePositioningHistoryMask", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x006a, 0x0021, 0x006a, + EVR_DS, "ImageRow", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x006b, 0x0021, 0x006b, + EVR_DS, "ImageColumn", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0070, 0x0021, 0x0070, + EVR_LT, "PatientOrientationSet1", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0070, 0x0021, 0x0070, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0070, 0x0021, 0x0070, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0070, 0x0021, 0x0070, + EVR_DS, "ObjectOrientation", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0070, 0x0021, 0x0070, + EVR_IS, "NumberOfEchoes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0071, 0x0021, 0x0071, + EVR_LT, "PatientOrientationSet2", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0071, 0x0021, 0x0071, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0072, 0x0021, 0x0072, + EVR_DS, "LightOrientation", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0072, 0x0021, 0x0072, + EVR_DS, "SecondEchoTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0073, 0x0021, 0x0073, + EVR_DS, "SecondRepetitionTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0075, 0x0021, 0x0075, + EVR_DS, "LightBrightness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0076, 0x0021, 0x0076, + EVR_DS, "LightContrast", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x007a, 0x0021, 0x007a, + EVR_IS, "OverlayThreshold", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x007b, 0x0021, 0x007b, + EVR_IS, "SurfaceThreshold", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x007c, 0x0021, 0x007c, + EVR_IS, "GreyScaleThreshold", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x0080, 0x0021, 0x0080, + EVR_LT, "StudyName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0080, 0x0021, 0x0080, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0080, 0x0021, 0x0080, + EVR_OB, "EquipmentTypeSpecificInformation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0021, 0x0080, 0x0021, 0x0080, + EVR_IS, "CardiacCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0081, 0x0021, 0x0081, + EVR_DS, "AutoWindowLevelAlpha", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0082, 0x0021, 0x0082, + EVR_LT, "StudyType", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0021, 0x0082, 0x0021, 0x0082, + EVR_DS, "AutoWindowLevelBeta", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0083, 0x0021, 0x0083, + EVR_DS, "AutoWindowLevelWindow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0084, 0x0021, 0x0084, + EVR_DS, "AutoWindowLevelLevel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0090, 0x0021, 0x0090, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x0090, 0x0021, 0x0090, + EVR_SS, "TubeFocalSpotPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0090, 0x0021, 0x0090, + EVR_DS, "Brightness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0091, 0x0021, 0x0091, + EVR_SS, "BiopsyPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0091, 0x0021, 0x0091, + EVR_DS, "Contrast", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0091, 0x0021, 0x0091, + EVR_DS, "SaturationPhaseEncodingVectorTransverseComponent", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0092, 0x0021, 0x0092, + EVR_FL, "BiopsyTLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0092, 0x0021, 0x0092, + EVR_DS, "ShapeFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0021, 0x0092, 0x0021, 0x0092, + EVR_DS, "SaturationReadoutVectorTransverseComponent", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0093, 0x0021, 0x0093, + EVR_FL, "BiopsyRefLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_RELA_01" } + , { 0x0021, 0x0093, 0x0021, 0x0093, + EVR_DS, "EPIChangeValueOfMagnitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0094, 0x0021, 0x0094, + EVR_DS, "EPIChangeValueOfXComponent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0095, 0x0021, 0x0095, + EVR_DS, "EPIChangeValueOfYComponent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x0096, 0x0021, 0x0096, + EVR_DS, "EPIChangeValueOfZComponent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MR VA0 GEN" } + , { 0x0021, 0x00a0, 0x0021, 0x00a0, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x00a0, 0x0021, 0x00a0, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x00a1, 0x0021, 0x00a1, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x00a2, 0x0021, 0x00a2, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x00a2, 0x0021, 0x00a2, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x00a3, 0x0021, 0x00a3, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x00a4, 0x0021, 0x00a4, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x00a7, 0x0021, 0x00a7, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 GEN" } + , { 0x0021, 0x00b0, 0x0021, 0x00b0, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x00c0, 0x0021, 0x00c0, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0021, 0x1000, 0x0021, 0x1000, + EVR_IS, "ReconstructionNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1010, 0x0021, 0x1010, + EVR_IS, "ImageType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1020, 0x0021, 0x1020, + EVR_IS, "SliceNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1030, 0x0021, 0x1030, + EVR_IS, "EchoNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1031, 0x0021, 0x1031, + EVR_DS, "PatientReferenceID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1035, 0x0021, 0x1035, + EVR_IS, "ChemicalShiftNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1040, 0x0021, 0x1040, + EVR_IS, "PhaseNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1050, 0x0021, 0x1050, + EVR_IS, "DynamicScanNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1060, 0x0021, 0x1060, + EVR_IS, "NumberOfRowsInObject", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1061, 0x0021, 0x1061, + EVR_IS, "RowNumber", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1062, 0x0021, 0x1062, + EVR_IS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1100, 0x0021, 0x1100, + EVR_DA, "ScanDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1110, 0x0021, 0x1110, + EVR_TM, "ScanTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0021, 0x1221, 0x0021, 0x1221, + EVR_IS, "SliceGap", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } +#endif + , { 0x0022, 0x0001, 0x0022, 0x0001, + EVR_US, "LightPathFilterPassThroughWavelength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0002, 0x0022, 0x0002, + EVR_US, "LightPathFilterPassBand", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0003, 0x0022, 0x0003, + EVR_US, "ImagePathFilterPassThroughWavelength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0004, 0x0022, 0x0004, + EVR_US, "ImagePathFilterPassBand", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0005, 0x0022, 0x0005, + EVR_CS, "PatientEyeMovementCommanded", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0006, 0x0022, 0x0006, + EVR_SQ, "PatientEyeMovementCommandCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0007, 0x0022, 0x0007, + EVR_FL, "SphericalLensPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0008, 0x0022, 0x0008, + EVR_FL, "CylinderLensPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0009, 0x0022, 0x0009, + EVR_FL, "CylinderAxis", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x000a, 0x0022, 0x000a, + EVR_FL, "EmmetropicMagnification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x000b, 0x0022, 0x000b, + EVR_FL, "IntraOcularPressure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x000c, 0x0022, 0x000c, + EVR_FL, "HorizontalFieldOfView", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x000d, 0x0022, 0x000d, + EVR_CS, "PupilDilated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x000e, 0x0022, 0x000e, + EVR_FL, "DegreeOfDilation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0010, 0x0022, 0x0010, + EVR_FL, "StereoBaselineAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0011, 0x0022, 0x0011, + EVR_FL, "StereoBaselineDisplacement", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0012, 0x0022, 0x0012, + EVR_FL, "StereoHorizontalPixelOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0013, 0x0022, 0x0013, + EVR_FL, "StereoVerticalPixelOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0014, 0x0022, 0x0014, + EVR_FL, "StereoRotation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0015, 0x0022, 0x0015, + EVR_SQ, "AcquisitionDeviceTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0016, 0x0022, 0x0016, + EVR_SQ, "IlluminationTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0017, 0x0022, 0x0017, + EVR_SQ, "LightPathFilterTypeStackCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0018, 0x0022, 0x0018, + EVR_SQ, "ImagePathFilterTypeStackCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0019, 0x0022, 0x0019, + EVR_SQ, "LensesCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x001a, 0x0022, 0x001a, + EVR_SQ, "ChannelDescriptionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x001b, 0x0022, 0x001b, + EVR_SQ, "RefractiveStateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x001c, 0x0022, 0x001c, + EVR_SQ, "MydriaticAgentCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x001d, 0x0022, 0x001d, + EVR_SQ, "RelativeImagePositionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x001e, 0x0022, 0x001e, + EVR_FL, "CameraAngleOfView", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0020, 0x0022, 0x0020, + EVR_SQ, "StereoPairsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0021, 0x0022, 0x0021, + EVR_SQ, "LeftImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0022, 0x0022, 0x0022, + EVR_SQ, "RightImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0028, 0x0022, 0x0028, + EVR_CS, "StereoPairsPresent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0030, 0x0022, 0x0030, + EVR_FL, "AxialLengthOfTheEye", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0031, 0x0022, 0x0031, + EVR_SQ, "OphthalmicFrameLocationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0032, 0x0022, 0x0032, + EVR_FL, "ReferenceCoordinates", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0035, 0x0022, 0x0035, + EVR_FL, "DepthSpatialResolution", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0036, 0x0022, 0x0036, + EVR_FL, "MaximumDepthDistortion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0037, 0x0022, 0x0037, + EVR_FL, "AlongScanSpatialResolution", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0038, 0x0022, 0x0038, + EVR_FL, "MaximumAlongScanDistortion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0039, 0x0022, 0x0039, + EVR_CS, "OphthalmicImageOrientation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0041, 0x0022, 0x0041, + EVR_FL, "DepthOfTransverseImage", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0042, 0x0022, 0x0042, + EVR_SQ, "MydriaticAgentConcentrationUnitsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0048, 0x0022, 0x0048, + EVR_FL, "AcrossScanSpatialResolution", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0049, 0x0022, 0x0049, + EVR_FL, "MaximumAcrossScanDistortion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x004e, 0x0022, 0x004e, + EVR_DS, "MydriaticAgentConcentration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0055, 0x0022, 0x0055, + EVR_FL, "IlluminationWaveLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0056, 0x0022, 0x0056, + EVR_FL, "IlluminationPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0057, 0x0022, 0x0057, + EVR_FL, "IlluminationBandwidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x0058, 0x0022, 0x0058, + EVR_SQ, "MydriaticAgentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1007, 0x0022, 0x1007, + EVR_SQ, "OphthalmicAxialMeasurementsRightEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1008, 0x0022, 0x1008, + EVR_SQ, "OphthalmicAxialMeasurementsLeftEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1009, 0x0022, 0x1009, + EVR_CS, "OphthalmicAxialMeasurementsDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1010, 0x0022, 0x1010, + EVR_CS, "OphthalmicAxialLengthMeasurementsType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1012, 0x0022, 0x1012, + EVR_SQ, "OphthalmicAxialLengthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1019, 0x0022, 0x1019, + EVR_FL, "OphthalmicAxialLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1024, 0x0022, 0x1024, + EVR_SQ, "LensStatusCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1025, 0x0022, 0x1025, + EVR_SQ, "VitreousStatusCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1028, 0x0022, 0x1028, + EVR_SQ, "IOLFormulaCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1029, 0x0022, 0x1029, + EVR_LO, "IOLFormulaDetail", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1033, 0x0022, 0x1033, + EVR_FL, "KeratometerIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1035, 0x0022, 0x1035, + EVR_SQ, "SourceOfOphthalmicAxialLengthCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1036, 0x0022, 0x1036, + EVR_SQ, "SourceOfCornealSizeDataCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1037, 0x0022, 0x1037, + EVR_FL, "TargetRefraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1039, 0x0022, 0x1039, + EVR_CS, "RefractiveProcedureOccurred", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1040, 0x0022, 0x1040, + EVR_SQ, "RefractiveSurgeryTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1044, 0x0022, 0x1044, + EVR_SQ, "OphthalmicUltrasoundMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1045, 0x0022, 0x1045, + EVR_SQ, "SurgicallyInducedAstigmatismSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1046, 0x0022, 0x1046, + EVR_CS, "TypeOfOpticalCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1047, 0x0022, 0x1047, + EVR_SQ, "ToricIOLPowerSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1048, 0x0022, 0x1048, + EVR_SQ, "PredictedToricErrorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1049, 0x0022, 0x1049, + EVR_CS, "PreSelectedForImplantation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x104a, 0x0022, 0x104a, + EVR_SQ, "ToricIOLPowerForExactEmmetropiaSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x104b, 0x0022, 0x104b, + EVR_SQ, "ToricIOLPowerForExactTargetRefractionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1050, 0x0022, 0x1050, + EVR_SQ, "OphthalmicAxialLengthMeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1053, 0x0022, 0x1053, + EVR_FL, "IOLPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1054, 0x0022, 0x1054, + EVR_FL, "PredictedRefractiveError", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1059, 0x0022, 0x1059, + EVR_FL, "OphthalmicAxialLengthVelocity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1065, 0x0022, 0x1065, + EVR_LO, "LensStatusDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1066, 0x0022, 0x1066, + EVR_LO, "VitreousStatusDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1090, 0x0022, 0x1090, + EVR_SQ, "IOLPowerSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1092, 0x0022, 0x1092, + EVR_SQ, "LensConstantSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1093, 0x0022, 0x1093, + EVR_LO, "IOLManufacturer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1094, 0x0022, 0x1094, + EVR_LO, "RETIRED_LensConstantDescription", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1095, 0x0022, 0x1095, + EVR_LO, "ImplantName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1096, 0x0022, 0x1096, + EVR_SQ, "KeratometryMeasurementTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1097, 0x0022, 0x1097, + EVR_LO, "ImplantPartNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1100, 0x0022, 0x1100, + EVR_SQ, "ReferencedOphthalmicAxialMeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1101, 0x0022, 0x1101, + EVR_SQ, "OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1103, 0x0022, 0x1103, + EVR_SQ, "RefractiveErrorBeforeRefractiveSurgeryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1121, 0x0022, 0x1121, + EVR_FL, "IOLPowerForExactEmmetropia", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1122, 0x0022, 0x1122, + EVR_FL, "IOLPowerForExactTargetRefraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1125, 0x0022, 0x1125, + EVR_SQ, "AnteriorChamberDepthDefinitionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1127, 0x0022, 0x1127, + EVR_SQ, "LensThicknessSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1128, 0x0022, 0x1128, + EVR_SQ, "AnteriorChamberDepthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x112a, 0x0022, 0x112a, + EVR_SQ, "CalculationCommentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x112b, 0x0022, 0x112b, + EVR_CS, "CalculationCommentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x112c, 0x0022, 0x112c, + EVR_LT, "CalculationComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1130, 0x0022, 0x1130, + EVR_FL, "LensThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1131, 0x0022, 0x1131, + EVR_FL, "AnteriorChamberDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1132, 0x0022, 0x1132, + EVR_SQ, "SourceOfLensThicknessDataCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1133, 0x0022, 0x1133, + EVR_SQ, "SourceOfAnteriorChamberDepthDataCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1134, 0x0022, 0x1134, + EVR_SQ, "SourceOfRefractiveMeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1135, 0x0022, 0x1135, + EVR_SQ, "SourceOfRefractiveMeasurementsCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1140, 0x0022, 0x1140, + EVR_CS, "OphthalmicAxialLengthMeasurementModified", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1150, 0x0022, 0x1150, + EVR_SQ, "OphthalmicAxialLengthDataSourceCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1153, 0x0022, 0x1153, + EVR_SQ, "RETIRED_OphthalmicAxialLengthAcquisitionMethodCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1155, 0x0022, 0x1155, + EVR_FL, "SignalToNoiseRatio", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1159, 0x0022, 0x1159, + EVR_LO, "OphthalmicAxialLengthDataSourceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1210, 0x0022, 0x1210, + EVR_SQ, "OphthalmicAxialLengthMeasurementsTotalLengthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1211, 0x0022, 0x1211, + EVR_SQ, "OphthalmicAxialLengthMeasurementsSegmentalLengthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1212, 0x0022, 0x1212, + EVR_SQ, "OphthalmicAxialLengthMeasurementsLengthSummationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1220, 0x0022, 0x1220, + EVR_SQ, "UltrasoundOphthalmicAxialLengthMeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1225, 0x0022, 0x1225, + EVR_SQ, "OpticalOphthalmicAxialLengthMeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1230, 0x0022, 0x1230, + EVR_SQ, "UltrasoundSelectedOphthalmicAxialLengthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1250, 0x0022, 0x1250, + EVR_SQ, "OphthalmicAxialLengthSelectionMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1255, 0x0022, 0x1255, + EVR_SQ, "OpticalSelectedOphthalmicAxialLengthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1257, 0x0022, 0x1257, + EVR_SQ, "SelectedSegmentalOphthalmicAxialLengthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1260, 0x0022, 0x1260, + EVR_SQ, "SelectedTotalOphthalmicAxialLengthSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1262, 0x0022, 0x1262, + EVR_SQ, "OphthalmicAxialLengthQualityMetricSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1265, 0x0022, 0x1265, + EVR_SQ, "RETIRED_OphthalmicAxialLengthQualityMetricTypeCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1273, 0x0022, 0x1273, + EVR_LO, "RETIRED_OphthalmicAxialLengthQualityMetricTypeDescription", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1300, 0x0022, 0x1300, + EVR_SQ, "IntraocularLensCalculationsRightEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1310, 0x0022, 0x1310, + EVR_SQ, "IntraocularLensCalculationsLeftEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1330, 0x0022, 0x1330, + EVR_SQ, "ReferencedOphthalmicAxialLengthMeasurementQCImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1415, 0x0022, 0x1415, + EVR_CS, "OphthalmicMappingDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1420, 0x0022, 0x1420, + EVR_SQ, "AcquisitionMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1423, 0x0022, 0x1423, + EVR_SQ, "AcquisitionMethodAlgorithmSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1436, 0x0022, 0x1436, + EVR_SQ, "OphthalmicThicknessMapTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1443, 0x0022, 0x1443, + EVR_SQ, "OphthalmicThicknessMappingNormalsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1445, 0x0022, 0x1445, + EVR_SQ, "RetinalThicknessDefinitionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1450, 0x0022, 0x1450, + EVR_SQ, "PixelValueMappingToCodedConceptSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1452, 0x0022, 0x1452, + EVR_xs, "MappedPixelValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1454, 0x0022, 0x1454, + EVR_LO, "PixelValueMappingExplanation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1458, 0x0022, 0x1458, + EVR_SQ, "OphthalmicThicknessMapQualityThresholdSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1460, 0x0022, 0x1460, + EVR_FL, "OphthalmicThicknessMapThresholdQualityRating", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1463, 0x0022, 0x1463, + EVR_FL, "AnatomicStructureReferencePoint", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1465, 0x0022, 0x1465, + EVR_SQ, "RegistrationToLocalizerSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1466, 0x0022, 0x1466, + EVR_CS, "RegisteredLocalizerUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1467, 0x0022, 0x1467, + EVR_FL, "RegisteredLocalizerTopLeftHandCorner", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1468, 0x0022, 0x1468, + EVR_FL, "RegisteredLocalizerBottomRightHandCorner", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1470, 0x0022, 0x1470, + EVR_SQ, "OphthalmicThicknessMapQualityRatingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1472, 0x0022, 0x1472, + EVR_SQ, "RelevantOPTAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1512, 0x0022, 0x1512, + EVR_SQ, "TransformationMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1513, 0x0022, 0x1513, + EVR_SQ, "TransformationAlgorithmSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1515, 0x0022, 0x1515, + EVR_CS, "OphthalmicAxialLengthMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1517, 0x0022, 0x1517, + EVR_FL, "OphthalmicFOV", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1518, 0x0022, 0x1518, + EVR_SQ, "TwoDimensionalToThreeDimensionalMapSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1525, 0x0022, 0x1525, + EVR_SQ, "WideFieldOphthalmicPhotographyQualityRatingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1526, 0x0022, 0x1526, + EVR_SQ, "WideFieldOphthalmicPhotographyQualityThresholdSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1527, 0x0022, 0x1527, + EVR_FL, "WideFieldOphthalmicPhotographyThresholdQualityRating", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1528, 0x0022, 0x1528, + EVR_FL, "XCoordinatesCenterPixelViewAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1529, 0x0022, 0x1529, + EVR_FL, "YCoordinatesCenterPixelViewAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1530, 0x0022, 0x1530, + EVR_UL, "NumberOfMapPoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1531, 0x0022, 0x1531, + EVR_OF, "TwoDimensionalToThreeDimensionalMapData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1612, 0x0022, 0x1612, + EVR_SQ, "DerivationAlgorithmSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1615, 0x0022, 0x1615, + EVR_SQ, "OphthalmicImageTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1616, 0x0022, 0x1616, + EVR_LO, "OphthalmicImageTypeDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1618, 0x0022, 0x1618, + EVR_SQ, "ScanPatternTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1620, 0x0022, 0x1620, + EVR_SQ, "ReferencedSurfaceMeshIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1622, 0x0022, 0x1622, + EVR_CS, "OphthalmicVolumetricPropertiesFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1624, 0x0022, 0x1624, + EVR_FL, "OphthalmicAnatomicReferencePointXCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1626, 0x0022, 0x1626, + EVR_FL, "OphthalmicAnatomicReferencePointYCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1628, 0x0022, 0x1628, + EVR_SQ, "OphthalmicEnFaceImageQualityRatingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1630, 0x0022, 0x1630, + EVR_DS, "QualityThreshold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1640, 0x0022, 0x1640, + EVR_SQ, "OCTBscanAnalysisAcquisitionParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1642, 0x0022, 0x1642, + EVR_UL, "NumberofBscansPerFrame", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1643, 0x0022, 0x1643, + EVR_FL, "BscanSlabThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1644, 0x0022, 0x1644, + EVR_FL, "DistanceBetweenBscanSlabs", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1645, 0x0022, 0x1645, + EVR_FL, "BscanCycleTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1646, 0x0022, 0x1646, + EVR_FL, "BscanCycleTimeVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1649, 0x0022, 0x1649, + EVR_FL, "AscanRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1650, 0x0022, 0x1650, + EVR_FL, "BscanRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0022, 0x1658, 0x0022, 0x1658, + EVR_UL, "SurfaceMeshZPixelOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_DS, "CRDRE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_DS, "CRDRE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_LO, "ImageLaterality", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_DS, "HorizontalCalibrationPixelSize", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_LO, "CRExposureMenuCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_LO, "CRExposureMenuCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_US, "CRSShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0000, 0x0023, 0x0000, + EVR_US, "CRSShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0001, 0x0023, 0x0001, + EVR_IS, "LetterPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0023, 0x0001, 0x0023, 0x0001, + EVR_DS, "VerticalCalibrationPixelSize", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0001, 0x0023, 0x0001, + EVR_SL, "NumberOfSeriesInStudy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_STDY_01" } + , { 0x0023, 0x0002, 0x0023, 0x0002, + EVR_IS, "BurnedInAnnotation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0023, 0x0002, 0x0023, 0x0002, + EVR_LO, "CalibrationObject", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0002, 0x0023, 0x0002, + EVR_SL, "NumberOfUnarchivedSeries", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_STDY_01" } + , { 0x0023, 0x0003, 0x0023, 0x0003, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0023, 0x0003, 0x0023, 0x0003, + EVR_DS, "CalibrationObjectSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0004, 0x0023, 0x0004, + EVR_LO, "CalibrationMethod", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0005, 0x0023, 0x0005, + EVR_ST, "Filename", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0006, 0x0023, 0x0006, + EVR_IS, "FrameNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0007, 0x0023, 0x0007, + EVR_IS, "CalibrationFactorMultiplicity", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x0008, 0x0023, 0x0008, + EVR_IS, "CalibrationTODValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX QUANT 1.0" } + , { 0x0023, 0x000d, 0x0023, 0x000d, + EVR_UI, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 2;1" } + , { 0x0023, 0x000e, 0x0023, 0x000e, + EVR_UI, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 2;1" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_US, "CRDRN", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_US, "CRDRN", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_SS, "ReferenceImageField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_STDY_01" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_LO, "CRExposureMenuString", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_LO, "CRExposureMenuString", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_LO, "CRCShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0010, 0x0023, 0x0010, + EVR_DS, "CRCShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0020, 0x0023, 0x0020, + EVR_DS, "CRORE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0020, 0x0023, 0x0020, + EVR_DS, "CRORE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0020, 0x0023, 0x0020, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0023, 0x0020, 0x0023, 0x0020, + EVR_LO, "CREDRMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0020, 0x0023, 0x0020, + EVR_LO, "CREDRMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0020, 0x0023, 0x0020, + EVR_LO, "CRGT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0020, 0x0023, 0x0020, + EVR_DS, "CRGT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0030, 0x0023, 0x0030, + EVR_US, "CRORN", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0030, 0x0023, 0x0030, + EVR_US, "CRORN", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0030, 0x0023, 0x0030, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0023, 0x0030, 0x0023, 0x0030, + EVR_LO, "CRLatitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0030, 0x0023, 0x0030, + EVR_LO, "CRLatitude", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0030, 0x0023, 0x0030, + EVR_DS, "CRGA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0030, 0x0023, 0x0030, + EVR_DS, "CRGA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0040, 0x0023, 0x0040, + EVR_US, "CRORD", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0040, 0x0023, 0x0040, + EVR_US, "CRORD", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0040, 0x0023, 0x0040, + EVR_LO, "CRGroupNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0040, 0x0023, 0x0040, + EVR_LO, "CRGroupNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0040, 0x0023, 0x0040, + EVR_DS, "CRGC", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0040, 0x0023, 0x0040, + EVR_DS, "CRGC", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0050, 0x0023, 0x0050, + EVR_LO, "CRCassetteSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0050, 0x0023, 0x0050, + EVR_LO, "CRCassetteSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0050, 0x0023, 0x0050, + EVR_SS, "SummaryImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_STDY_01" } + , { 0x0023, 0x0050, 0x0023, 0x0050, + EVR_US, "CRImageSerialNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0050, 0x0023, 0x0050, + EVR_US, "CRImageSerialNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0050, 0x0023, 0x0050, + EVR_DS, "CRGS", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0050, 0x0023, 0x0050, + EVR_DS, "CRGS", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0060, 0x0023, 0x0060, + EVR_LO, "CRMachineID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0060, 0x0023, 0x0060, + EVR_LO, "CRMachineID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0060, 0x0023, 0x0060, + EVR_LO, "CRBarCodeNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0060, 0x0023, 0x0060, + EVR_LO, "CRBarCodeNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0060, 0x0023, 0x0060, + EVR_LO, "CRRT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0060, 0x0023, 0x0060, + EVR_DS, "CRRT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0070, 0x0023, 0x0070, + EVR_LO, "CRMachineType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0070, 0x0023, 0x0070, + EVR_LO, "CRMachineType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0070, 0x0023, 0x0070, + EVR_FD, "StartTimeSecsInFirstAxial", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_STDY_01" } + , { 0x0023, 0x0070, 0x0023, 0x0070, + EVR_LO, "CRFilmOutputExposure", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0070, 0x0023, 0x0070, + EVR_LO, "CRFilmOutputExposure", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0070, 0x0023, 0x0070, + EVR_DS, "CRRE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0070, 0x0023, 0x0070, + EVR_DS, "CRRE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0074, 0x0023, 0x0074, + EVR_SL, "NumberOfUpdatesToHeader", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_STDY_01" } + , { 0x0023, 0x007d, 0x0023, 0x007d, + EVR_SS, "IndicatesIfStudyHasCompleteInfo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_STDY_01" } + , { 0x0023, 0x0080, 0x0023, 0x0080, + EVR_LO, "CRFilmFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0080, 0x0023, 0x0080, + EVR_LO, "CRFilmFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0080, 0x0023, 0x0080, + EVR_US, "CRRN", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0080, 0x0023, 0x0080, + EVR_US, "CRRN", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0080, 0x0023, 0x0080, + EVR_LO, "CRTechnicianCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0080, 0x0023, 0x0080, + EVR_LO, "CRTechnicianCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x0090, 0x0023, 0x0090, + EVR_LO, "CRSShiftString", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK1" } + , { 0x0023, 0x0090, 0x0023, 0x0090, + EVR_LO, "CRSShiftString", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK1" } + , { 0x0023, 0x0090, 0x0023, 0x0090, + EVR_DS, "CRDRT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK2" } + , { 0x0023, 0x0090, 0x0023, 0x0090, + EVR_DS, "CRDRT", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK2" } + , { 0x0023, 0x0090, 0x0023, 0x0090, + EVR_LO, "CREnergySubtractionParameters", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x0090, 0x0023, 0x0090, + EVR_LO, "CREnergySubtractionParameters", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_1.0 BLOCK3" } + , { 0x0023, 0x00f0, 0x0023, 0x00f0, + EVR_IS, "ImageSOPClass", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0023, 0x00f0, 0x0023, 0x00f0, + EVR_LO, "CRDistributionCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } + , { 0x0023, 0x00ff, 0x0023, 0x00ff, + EVR_US, "CRShuttersApplied", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ACRQA_2.0 BLOCK3" } +#endif + , { 0x0024, 0x0010, 0x0024, 0x0010, + EVR_FL, "VisualFieldHorizontalExtent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0011, 0x0024, 0x0011, + EVR_FL, "VisualFieldVerticalExtent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0012, 0x0024, 0x0012, + EVR_CS, "VisualFieldShape", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0016, 0x0024, 0x0016, + EVR_SQ, "ScreeningTestModeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0018, 0x0024, 0x0018, + EVR_FL, "MaximumStimulusLuminance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0020, 0x0024, 0x0020, + EVR_FL, "BackgroundLuminance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0021, 0x0024, 0x0021, + EVR_SQ, "StimulusColorCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0024, 0x0024, 0x0024, + EVR_SQ, "BackgroundIlluminationColorCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0025, 0x0024, 0x0025, + EVR_FL, "StimulusArea", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0028, 0x0024, 0x0028, + EVR_FL, "StimulusPresentationTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0032, 0x0024, 0x0032, + EVR_SQ, "FixationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0033, 0x0024, 0x0033, + EVR_SQ, "FixationMonitoringCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0034, 0x0024, 0x0034, + EVR_SQ, "VisualFieldCatchTrialSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0035, 0x0024, 0x0035, + EVR_US, "FixationCheckedQuantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0036, 0x0024, 0x0036, + EVR_US, "PatientNotProperlyFixatedQuantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0037, 0x0024, 0x0037, + EVR_CS, "PresentedVisualStimuliDataFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0038, 0x0024, 0x0038, + EVR_US, "NumberOfVisualStimuli", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0039, 0x0024, 0x0039, + EVR_CS, "ExcessiveFixationLossesDataFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0040, 0x0024, 0x0040, + EVR_CS, "ExcessiveFixationLosses", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0042, 0x0024, 0x0042, + EVR_US, "StimuliRetestingQuantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0044, 0x0024, 0x0044, + EVR_LT, "CommentsOnPatientPerformanceOfVisualField", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0045, 0x0024, 0x0045, + EVR_CS, "FalseNegativesEstimateFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0046, 0x0024, 0x0046, + EVR_FL, "FalseNegativesEstimate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0048, 0x0024, 0x0048, + EVR_US, "NegativeCatchTrialsQuantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0050, 0x0024, 0x0050, + EVR_US, "FalseNegativesQuantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0051, 0x0024, 0x0051, + EVR_CS, "ExcessiveFalseNegativesDataFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0052, 0x0024, 0x0052, + EVR_CS, "ExcessiveFalseNegatives", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0053, 0x0024, 0x0053, + EVR_CS, "FalsePositivesEstimateFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0054, 0x0024, 0x0054, + EVR_FL, "FalsePositivesEstimate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0055, 0x0024, 0x0055, + EVR_CS, "CatchTrialsDataFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0056, 0x0024, 0x0056, + EVR_US, "PositiveCatchTrialsQuantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0057, 0x0024, 0x0057, + EVR_CS, "TestPointNormalsDataFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0058, 0x0024, 0x0058, + EVR_SQ, "TestPointNormalsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0059, 0x0024, 0x0059, + EVR_CS, "GlobalDeviationProbabilityNormalsFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0060, 0x0024, 0x0060, + EVR_US, "FalsePositivesQuantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0061, 0x0024, 0x0061, + EVR_CS, "ExcessiveFalsePositivesDataFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0062, 0x0024, 0x0062, + EVR_CS, "ExcessiveFalsePositives", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0063, 0x0024, 0x0063, + EVR_CS, "VisualFieldTestNormalsFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0064, 0x0024, 0x0064, + EVR_SQ, "ResultsNormalsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0065, 0x0024, 0x0065, + EVR_SQ, "AgeCorrectedSensitivityDeviationAlgorithmSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0066, 0x0024, 0x0066, + EVR_FL, "GlobalDeviationFromNormal", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0067, 0x0024, 0x0067, + EVR_SQ, "GeneralizedDefectSensitivityDeviationAlgorithmSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0068, 0x0024, 0x0068, + EVR_FL, "LocalizedDeviationFromNormal", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0069, 0x0024, 0x0069, + EVR_LO, "PatientReliabilityIndicator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0070, 0x0024, 0x0070, + EVR_FL, "VisualFieldMeanSensitivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0071, 0x0024, 0x0071, + EVR_FL, "GlobalDeviationProbability", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0072, 0x0024, 0x0072, + EVR_CS, "LocalDeviationProbabilityNormalsFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0073, 0x0024, 0x0073, + EVR_FL, "LocalizedDeviationProbability", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0074, 0x0024, 0x0074, + EVR_CS, "ShortTermFluctuationCalculated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0075, 0x0024, 0x0075, + EVR_FL, "ShortTermFluctuation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0076, 0x0024, 0x0076, + EVR_CS, "ShortTermFluctuationProbabilityCalculated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0077, 0x0024, 0x0077, + EVR_FL, "ShortTermFluctuationProbability", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0078, 0x0024, 0x0078, + EVR_CS, "CorrectedLocalizedDeviationFromNormalCalculated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0079, 0x0024, 0x0079, + EVR_FL, "CorrectedLocalizedDeviationFromNormal", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0080, 0x0024, 0x0080, + EVR_CS, "CorrectedLocalizedDeviationFromNormalProbabilityCalculated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0081, 0x0024, 0x0081, + EVR_FL, "CorrectedLocalizedDeviationFromNormalProbability", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0083, 0x0024, 0x0083, + EVR_SQ, "GlobalDeviationProbabilitySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0085, 0x0024, 0x0085, + EVR_SQ, "LocalizedDeviationProbabilitySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0086, 0x0024, 0x0086, + EVR_CS, "FovealSensitivityMeasured", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0087, 0x0024, 0x0087, + EVR_FL, "FovealSensitivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0088, 0x0024, 0x0088, + EVR_FL, "VisualFieldTestDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0089, 0x0024, 0x0089, + EVR_SQ, "VisualFieldTestPointSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0090, 0x0024, 0x0090, + EVR_FL, "VisualFieldTestPointXCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0091, 0x0024, 0x0091, + EVR_FL, "VisualFieldTestPointYCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0092, 0x0024, 0x0092, + EVR_FL, "AgeCorrectedSensitivityDeviationValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0093, 0x0024, 0x0093, + EVR_CS, "StimulusResults", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0094, 0x0024, 0x0094, + EVR_FL, "SensitivityValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0095, 0x0024, 0x0095, + EVR_CS, "RetestStimulusSeen", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0096, 0x0024, 0x0096, + EVR_FL, "RetestSensitivityValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0097, 0x0024, 0x0097, + EVR_SQ, "VisualFieldTestPointNormalsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0098, 0x0024, 0x0098, + EVR_FL, "QuantifiedDefect", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0100, 0x0024, 0x0100, + EVR_FL, "AgeCorrectedSensitivityDeviationProbabilityValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0102, 0x0024, 0x0102, + EVR_CS, "GeneralizedDefectCorrectedSensitivityDeviationFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0103, 0x0024, 0x0103, + EVR_FL, "GeneralizedDefectCorrectedSensitivityDeviationValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0104, 0x0024, 0x0104, + EVR_FL, "GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0105, 0x0024, 0x0105, + EVR_FL, "MinimumSensitivityValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0106, 0x0024, 0x0106, + EVR_CS, "BlindSpotLocalized", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0107, 0x0024, 0x0107, + EVR_FL, "BlindSpotXCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0108, 0x0024, 0x0108, + EVR_FL, "BlindSpotYCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0110, 0x0024, 0x0110, + EVR_SQ, "VisualAcuityMeasurementSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0112, 0x0024, 0x0112, + EVR_SQ, "RefractiveParametersUsedOnPatientSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0113, 0x0024, 0x0113, + EVR_CS, "MeasurementLaterality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0114, 0x0024, 0x0114, + EVR_SQ, "OphthalmicPatientClinicalInformationLeftEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0115, 0x0024, 0x0115, + EVR_SQ, "OphthalmicPatientClinicalInformationRightEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0117, 0x0024, 0x0117, + EVR_CS, "FovealPointNormativeDataFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0118, 0x0024, 0x0118, + EVR_FL, "FovealPointProbabilityValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0120, 0x0024, 0x0120, + EVR_CS, "ScreeningBaselineMeasured", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0122, 0x0024, 0x0122, + EVR_SQ, "ScreeningBaselineMeasuredSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0124, 0x0024, 0x0124, + EVR_CS, "ScreeningBaselineType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0126, 0x0024, 0x0126, + EVR_FL, "ScreeningBaselineValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0202, 0x0024, 0x0202, + EVR_LO, "AlgorithmSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0306, 0x0024, 0x0306, + EVR_LO, "DataSetName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0307, 0x0024, 0x0307, + EVR_LO, "DataSetVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0308, 0x0024, 0x0308, + EVR_LO, "DataSetSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0309, 0x0024, 0x0309, + EVR_LO, "DataSetDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0317, 0x0024, 0x0317, + EVR_SQ, "VisualFieldTestReliabilityGlobalIndexSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0320, 0x0024, 0x0320, + EVR_SQ, "VisualFieldGlobalResultsIndexSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0325, 0x0024, 0x0325, + EVR_SQ, "DataObservationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0338, 0x0024, 0x0338, + EVR_CS, "IndexNormalsFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0341, 0x0024, 0x0341, + EVR_FL, "IndexProbability", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0024, 0x0344, 0x0024, 0x0344, + EVR_SQ, "IndexProbabilitySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0025, 0x0000, 0x0025, 0x0000, + EVR_IS, "OriginalImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0000, 0x0025, 0x0000, + EVR_US, "ViewNative", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0001, 0x0025, 0x0001, + EVR_IS, "NotProcessedImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0001, 0x0025, 0x0001, + EVR_US, "OriginalSeriesNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0002, 0x0025, 0x0002, + EVR_IS, "CutOutImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0002, 0x0025, 0x0002, + EVR_US, "OriginalImageNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0003, 0x0025, 0x0003, + EVR_IS, "DuplicatedImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0003, 0x0025, 0x0003, + EVR_US, "WinCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0004, 0x0025, 0x0004, + EVR_IS, "StoredImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0004, 0x0025, 0x0004, + EVR_US, "WinWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0005, 0x0025, 0x0005, + EVR_IS, "RetrievedImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0005, 0x0025, 0x0005, + EVR_US, "WinBrightness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0006, 0x0025, 0x0006, + EVR_IS, "RemoteImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0006, 0x0025, 0x0006, + EVR_US, "WinContrast", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0006, 0x0025, 0x0006, + EVR_SS, "LastPulseSequenceUsed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0007, 0x0025, 0x0007, + EVR_IS, "MediaStoredImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0007, 0x0025, 0x0007, + EVR_US, "OriginalFrameNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0007, 0x0025, 0x0007, + EVR_SL, "ImagesInSeries", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0008, 0x0025, 0x0008, + EVR_IS, "ImageState", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0008, 0x0025, 0x0008, + EVR_US, "OriginalMaskFrameNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0009, 0x0025, 0x0009, + EVR_US, "Opac", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x000a, 0x0025, 0x000a, + EVR_US, "OriginalNumberOfFrames", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x000b, 0x0025, 0x000b, + EVR_DS, "OriginalSceneDuration", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x000c, 0x0025, 0x000c, + EVR_LO, "IdentifierLOID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x000d, 0x0025, 0x000d, + EVR_SS, "OriginalSceneVFRInfo", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x000e, 0x0025, 0x000e, + EVR_SS, "OriginalFrameECGPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x000f, 0x0025, 0x000f, + EVR_SS, "OriginalECG1stFrameOffset_retired", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0010, 0x0025, 0x0010, + EVR_US, "RelativeLightEmissionAmountSk", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0010, 0x0025, 0x0010, + EVR_SS, "ZoomFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0010, 0x0025, 0x0010, + EVR_SL, "LandmarkCounter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0011, 0x0025, 0x0011, + EVR_US, "TermOfCorrectionForEachIPTypeSt", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0011, 0x0025, 0x0011, + EVR_US, "Flex", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0011, 0x0025, 0x0011, + EVR_SS, "NumberOfAcquisitions", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0012, 0x0025, 0x0012, + EVR_US, "ReadingGainGp", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0012, 0x0025, 0x0012, + EVR_US, "NumberOfMaskFrames", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0013, 0x0025, 0x0013, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0013, 0x0025, 0x0013, + EVR_US, "NumberOfFillFrames", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0014, 0x0025, 0x0014, + EVR_US, "SeriesNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0014, 0x0025, 0x0014, + EVR_SL, "IndicatesNumberOfUpdatesToHeader", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0015, 0x0025, 0x0015, + EVR_CS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0015, 0x0025, 0x0015, + EVR_IS, "ImageNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS SMS-AX ORIGINAL IMAGE INFO 1.0" } + , { 0x0025, 0x0017, 0x0025, 0x0017, + EVR_SL, "SeriesCompleteFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0018, 0x0025, 0x0018, + EVR_SL, "NumberOfImagesArchived", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0019, 0x0025, 0x0019, + EVR_SL, "LastImageNumberUsed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x001a, 0x0025, 0x001a, + EVR_SH, "PrimaryReceiverSuiteAndHost", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SERS_01" } + , { 0x0025, 0x0020, 0x0025, 0x0020, + EVR_LO, "SourceImageFile", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0020, 0x0025, 0x0020, + EVR_US, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0021, 0x0025, 0x0021, + EVR_UI, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0025, 0x0021, 0x0025, 0x0021, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0030, 0x0025, 0x0030, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0031, 0x0025, 0x0031, + EVR_SS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0032, 0x0025, 0x0032, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0033, 0x0025, 0x0033, + EVR_SS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0034, 0x0025, 0x0034, + EVR_SS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0040, 0x0025, 0x0040, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0041, 0x0025, 0x0041, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0042, 0x0025, 0x0042, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0043, 0x0025, 0x0043, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0050, 0x0025, 0x0050, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0051, 0x0025, 0x0051, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0052, 0x0025, 0x0052, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0053, 0x0025, 0x0053, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0060, 0x0025, 0x0060, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0061, 0x0025, 0x0061, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0062, 0x0025, 0x0062, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0063, 0x0025, 0x0063, + EVR_CS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0070, 0x0025, 0x0070, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0071, 0x0025, 0x0071, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0072, 0x0025, 0x0072, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0073, 0x0025, 0x0073, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0074, 0x0025, 0x0074, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0080, 0x0025, 0x0080, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0081, 0x0025, 0x0081, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0082, 0x0025, 0x0082, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0083, 0x0025, 0x0083, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0084, 0x0025, 0x0084, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0090, 0x0025, 0x0090, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0091, 0x0025, 0x0091, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0092, 0x0025, 0x0092, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0093, 0x0025, 0x0093, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0094, 0x0025, 0x0094, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0095, 0x0025, 0x0095, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x0096, 0x0025, 0x0096, + EVR_CS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x00a0, 0x0025, 0x00a0, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x00a1, 0x0025, 0x00a1, + EVR_SS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x00a2, 0x0025, 0x00a2, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x00a3, 0x0025, 0x00a3, + EVR_SS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0025, 0x1010, 0x0025, 0x1010, + EVR_LO, "WorkspaceID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CMR42 CIRCLECVI" } + , { 0x0025, 0x1020, 0x0025, 0x1020, + EVR_LO, "WorkspaceTimeString", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CMR42 CIRCLECVI" } + , { 0x0025, 0x1030, 0x0025, 0x1030, + EVR_OB, "WorkspaceStream", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CMR42 CIRCLECVI" } + , { 0x0027, 0x0000, 0x0027, 0x0000, + EVR_IS, "NumberOfSeries", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0027, 0x0000, 0x0027, 0x0000, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0027, 0x0001, 0x0027, 0x0001, + EVR_IS, "NumberOfStudies", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0027, 0x0006, 0x0027, 0x0006, + EVR_SL, "ImageArchiveFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0010, 0x0027, 0x0010, + EVR_DT, "OldestSeries", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0027, 0x0010, 0x0027, 0x0010, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x0010, 0x0027, 0x0010, + EVR_SS, "ScoutType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0011, 0x0027, 0x0011, + EVR_DT, "NewestSeries", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0027, 0x0011, 0x0027, 0x0011, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0027, 0x0012, 0x0027, 0x0012, + EVR_DT, "OldestStudy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0027, 0x0012, 0x0027, 0x0012, + EVR_DS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0027, 0x0013, 0x0027, 0x0013, + EVR_DT, "NewestStudy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SVISION" } + , { 0x0027, 0x0013, 0x0027, 0x0013, + EVR_DS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0027, 0x0014, 0x0027, 0x0014, + EVR_DS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0027, 0x0015, 0x0027, 0x0015, + EVR_DS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0027, 0x0016, 0x0027, 0x0016, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0027, 0x001c, 0x0027, 0x001c, + EVR_SL, "VmaMamp", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x001d, 0x0027, 0x001d, + EVR_SS, "VmaPhase", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x001e, 0x0027, 0x001e, + EVR_SL, "VmaMod", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x001f, 0x0027, 0x001f, + EVR_SL, "VmaClip", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0020, 0x0027, 0x0020, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x0020, 0x0027, 0x0020, + EVR_SS, "SmartScanOnOffFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0030, 0x0027, 0x0030, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x0030, 0x0027, 0x0030, + EVR_SH, "ForeignImageRevision", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0031, 0x0027, 0x0031, + EVR_SS, "ImagingMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0032, 0x0027, 0x0032, + EVR_SS, "PulseSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0033, 0x0027, 0x0033, + EVR_SL, "ImagingOptions", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0035, 0x0027, 0x0035, + EVR_SS, "PlaneType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0036, 0x0027, 0x0036, + EVR_SL, "ObliquePlane", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0040, 0x0027, 0x0040, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x0040, 0x0027, 0x0040, + EVR_SH, "RASLetterOfImageLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0041, 0x0027, 0x0041, + EVR_FL, "ImageLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0042, 0x0027, 0x0042, + EVR_FL, "CenterRCoordOfPlaneImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0043, 0x0027, 0x0043, + EVR_FL, "CenterACoordOfPlaneImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0044, 0x0027, 0x0044, + EVR_FL, "CenterSCoordOfPlaneImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0045, 0x0027, 0x0045, + EVR_FL, "NormalRCoord", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0046, 0x0027, 0x0046, + EVR_FL, "NormalACoord", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0047, 0x0027, 0x0047, + EVR_FL, "NormalSCoord", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0048, 0x0027, 0x0048, + EVR_FL, "RCoordOfTopRightCorner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0049, 0x0027, 0x0049, + EVR_FL, "ACoordOfTopRightCorner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x004a, 0x0027, 0x004a, + EVR_FL, "SCoordOfTopRightCorner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x004b, 0x0027, 0x004b, + EVR_FL, "RCoordOfBottomRightCorner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x004c, 0x0027, 0x004c, + EVR_FL, "ACoordOfBottomRightCorner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x004d, 0x0027, 0x004d, + EVR_FL, "SCoordOfBottomRightCorner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0050, 0x0027, 0x0050, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x0050, 0x0027, 0x0050, + EVR_FL, "TableStartLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0051, 0x0027, 0x0051, + EVR_FL, "TableEndLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0052, 0x0027, 0x0052, + EVR_SH, "RASLetterForSideOfImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0053, 0x0027, 0x0053, + EVR_SH, "RASLetterForAnteriorPosterior", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0054, 0x0027, 0x0054, + EVR_SH, "RASLetterForScoutStartLoc", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0055, 0x0027, 0x0055, + EVR_SH, "RASLetterForScoutEndLoc", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0060, 0x0027, 0x0060, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x0060, 0x0027, 0x0060, + EVR_FL, "ImageDimensionX", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0061, 0x0027, 0x0061, + EVR_FL, "ImageDimensionY", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0062, 0x0027, 0x0062, + EVR_FL, "NumberOfExcitations", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMAG_01" } + , { 0x0027, 0x0070, 0x0027, 0x0070, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x0080, 0x0027, 0x0080, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x00a0, 0x0027, 0x00a0, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x00a1, 0x0027, 0x00a1, + EVR_CS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x00a2, 0x0027, 0x00a2, + EVR_CS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0027, 0x00a3, 0x0027, 0x00a3, + EVR_SS, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } +#endif + , { 0x0028, 0x0002, 0x0028, 0x0002, + EVR_US, "SamplesPerPixel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0003, 0x0028, 0x0003, + EVR_US, "SamplesPerPixelUsed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0004, 0x0028, 0x0004, + EVR_CS, "PhotometricInterpretation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0005, 0x0028, 0x0005, + EVR_US, "RETIRED_ImageDimensions", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0006, 0x0028, 0x0006, + EVR_US, "PlanarConfiguration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0008, 0x0028, 0x0008, + EVR_IS, "NumberOfFrames", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0009, 0x0028, 0x0009, + EVR_AT, "FrameIncrementPointer", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x000a, 0x0028, 0x000a, + EVR_AT, "FrameDimensionPointer", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0010, 0x0028, 0x0010, + EVR_US, "Rows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0011, 0x0028, 0x0011, + EVR_US, "Columns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0012, 0x0028, 0x0012, + EVR_US, "RETIRED_Planes", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0014, 0x0028, 0x0014, + EVR_US, "UltrasoundColorDataPresent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0030, 0x0028, 0x0030, + EVR_DS, "PixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0031, 0x0028, 0x0031, + EVR_DS, "ZoomFactor", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0032, 0x0028, 0x0032, + EVR_DS, "ZoomCenter", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0034, 0x0028, 0x0034, + EVR_IS, "PixelAspectRatio", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0040, 0x0028, 0x0040, + EVR_CS, "RETIRED_ImageFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0050, 0x0028, 0x0050, + EVR_LO, "RETIRED_ManipulatedImage", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0051, 0x0028, 0x0051, + EVR_CS, "CorrectedImage", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x005f, 0x0028, 0x005f, + EVR_LO, "RETIRED_CompressionRecognitionCode", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0060, 0x0028, 0x0060, + EVR_CS, "RETIRED_CompressionCode", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0061, 0x0028, 0x0061, + EVR_SH, "RETIRED_CompressionOriginator", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0062, 0x0028, 0x0062, + EVR_LO, "RETIRED_CompressionLabel", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0063, 0x0028, 0x0063, + EVR_SH, "RETIRED_CompressionDescription", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0065, 0x0028, 0x0065, + EVR_CS, "RETIRED_CompressionSequence", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0066, 0x0028, 0x0066, + EVR_AT, "RETIRED_CompressionStepPointers", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0068, 0x0028, 0x0068, + EVR_US, "RETIRED_RepeatInterval", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0069, 0x0028, 0x0069, + EVR_US, "RETIRED_BitsGrouped", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0070, 0x0028, 0x0070, + EVR_US, "RETIRED_PerimeterTable", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0071, 0x0028, 0x0071, + EVR_xs, "RETIRED_PerimeterValue", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0080, 0x0028, 0x0080, + EVR_US, "RETIRED_PredictorRows", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0081, 0x0028, 0x0081, + EVR_US, "RETIRED_PredictorColumns", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0082, 0x0028, 0x0082, + EVR_US, "RETIRED_PredictorConstants", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0090, 0x0028, 0x0090, + EVR_CS, "RETIRED_BlockedPixels", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0091, 0x0028, 0x0091, + EVR_US, "RETIRED_BlockRows", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0092, 0x0028, 0x0092, + EVR_US, "RETIRED_BlockColumns", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0093, 0x0028, 0x0093, + EVR_US, "RETIRED_RowOverlap", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0094, 0x0028, 0x0094, + EVR_US, "RETIRED_ColumnOverlap", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0100, 0x0028, 0x0100, + EVR_US, "BitsAllocated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0101, 0x0028, 0x0101, + EVR_US, "BitsStored", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0102, 0x0028, 0x0102, + EVR_US, "HighBit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0103, 0x0028, 0x0103, + EVR_US, "PixelRepresentation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0104, 0x0028, 0x0104, + EVR_xs, "RETIRED_SmallestValidPixelValue", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0105, 0x0028, 0x0105, + EVR_xs, "RETIRED_LargestValidPixelValue", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0106, 0x0028, 0x0106, + EVR_xs, "SmallestImagePixelValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0107, 0x0028, 0x0107, + EVR_xs, "LargestImagePixelValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0108, 0x0028, 0x0108, + EVR_xs, "SmallestPixelValueInSeries", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0109, 0x0028, 0x0109, + EVR_xs, "LargestPixelValueInSeries", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0110, 0x0028, 0x0110, + EVR_xs, "RETIRED_SmallestImagePixelValueInPlane", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0111, 0x0028, 0x0111, + EVR_xs, "RETIRED_LargestImagePixelValueInPlane", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0120, 0x0028, 0x0120, + EVR_xs, "PixelPaddingValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0121, 0x0028, 0x0121, + EVR_xs, "PixelPaddingRangeLimit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0122, 0x0028, 0x0122, + EVR_FL, "FloatPixelPaddingValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0123, 0x0028, 0x0123, + EVR_FD, "DoubleFloatPixelPaddingValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0124, 0x0028, 0x0124, + EVR_FL, "FloatPixelPaddingRangeLimit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0125, 0x0028, 0x0125, + EVR_FD, "DoubleFloatPixelPaddingRangeLimit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0200, 0x0028, 0x0200, + EVR_US, "RETIRED_ImageLocation", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0300, 0x0028, 0x0300, + EVR_CS, "QualityControlImage", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0301, 0x0028, 0x0301, + EVR_CS, "BurnedInAnnotation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0302, 0x0028, 0x0302, + EVR_CS, "RecognizableVisualFeatures", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0303, 0x0028, 0x0303, + EVR_CS, "LongitudinalTemporalInformationModified", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0304, 0x0028, 0x0304, + EVR_UI, "ReferencedColorPaletteInstanceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0400, 0x0028, 0x0400, + EVR_LO, "RETIRED_TransformLabel", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0401, 0x0028, 0x0401, + EVR_LO, "RETIRED_TransformVersionNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0402, 0x0028, 0x0402, + EVR_US, "RETIRED_NumberOfTransformSteps", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0403, 0x0028, 0x0403, + EVR_LO, "RETIRED_SequenceOfCompressedData", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0404, 0x0028, 0x0404, + EVR_AT, "RETIRED_DetailsOfCoefficients", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0410, 0x0028, 0x0410, + EVR_US, "RETIRED_RowsForNthOrderCoefficients", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0411, 0x0028, 0x0411, + EVR_US, "RETIRED_ColumnsForNthOrderCoefficients", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0412, 0x0028, 0x0412, + EVR_LO, "RETIRED_CoefficientCoding", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0413, 0x0028, 0x0413, + EVR_AT, "RETIRED_CoefficientCodingPointers", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0700, 0x0028, 0x0700, + EVR_LO, "RETIRED_DCTLabel", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0701, 0x0028, 0x0701, + EVR_CS, "RETIRED_DataBlockDescription", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0702, 0x0028, 0x0702, + EVR_AT, "RETIRED_DataBlock", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0710, 0x0028, 0x0710, + EVR_US, "RETIRED_NormalizationFactorFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0720, 0x0028, 0x0720, + EVR_US, "RETIRED_ZonalMapNumberFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0721, 0x0028, 0x0721, + EVR_AT, "RETIRED_ZonalMapLocation", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0722, 0x0028, 0x0722, + EVR_US, "RETIRED_ZonalMapFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0730, 0x0028, 0x0730, + EVR_US, "RETIRED_AdaptiveMapFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0740, 0x0028, 0x0740, + EVR_US, "RETIRED_CodeNumberFormat", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0800, 0x0028, 0x0800, + EVR_CS, "RETIRED_CodeLabel", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0802, 0x0028, 0x0802, + EVR_US, "RETIRED_NumberOfTables", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0803, 0x0028, 0x0803, + EVR_AT, "RETIRED_CodeTableLocation", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0804, 0x0028, 0x0804, + EVR_US, "RETIRED_BitsForCodeWord", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0808, 0x0028, 0x0808, + EVR_AT, "RETIRED_ImageDataLocation", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0a02, 0x0028, 0x0a02, + EVR_CS, "PixelSpacingCalibrationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x0a04, 0x0028, 0x0a04, + EVR_LO, "PixelSpacingCalibrationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1040, 0x0028, 0x1040, + EVR_CS, "PixelIntensityRelationship", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1041, 0x0028, 0x1041, + EVR_SS, "PixelIntensityRelationshipSign", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1050, 0x0028, 0x1050, + EVR_DS, "WindowCenter", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1051, 0x0028, 0x1051, + EVR_DS, "WindowWidth", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1052, 0x0028, 0x1052, + EVR_DS, "RescaleIntercept", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1053, 0x0028, 0x1053, + EVR_DS, "RescaleSlope", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1054, 0x0028, 0x1054, + EVR_LO, "RescaleType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1055, 0x0028, 0x1055, + EVR_LO, "WindowCenterWidthExplanation", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1056, 0x0028, 0x1056, + EVR_CS, "VOILUTFunction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1080, 0x0028, 0x1080, + EVR_CS, "RETIRED_GrayScale", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1090, 0x0028, 0x1090, + EVR_CS, "RecommendedViewingMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1100, 0x0028, 0x1100, + EVR_xs, "RETIRED_GrayLookupTableDescriptor", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1101, 0x0028, 0x1101, + EVR_xs, "RedPaletteColorLookupTableDescriptor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1102, 0x0028, 0x1102, + EVR_xs, "GreenPaletteColorLookupTableDescriptor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1103, 0x0028, 0x1103, + EVR_xs, "BluePaletteColorLookupTableDescriptor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1104, 0x0028, 0x1104, + EVR_US, "AlphaPaletteColorLookupTableDescriptor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1111, 0x0028, 0x1111, + EVR_xs, "RETIRED_LargeRedPaletteColorLookupTableDescriptor", 4, 4, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1112, 0x0028, 0x1112, + EVR_xs, "RETIRED_LargeGreenPaletteColorLookupTableDescriptor", 4, 4, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1113, 0x0028, 0x1113, + EVR_xs, "RETIRED_LargeBluePaletteColorLookupTableDescriptor", 4, 4, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1199, 0x0028, 0x1199, + EVR_UI, "PaletteColorLookupTableUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1200, 0x0028, 0x1200, + EVR_lt, "RETIRED_GrayLookupTableData", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1201, 0x0028, 0x1201, + EVR_OW, "RedPaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1202, 0x0028, 0x1202, + EVR_OW, "GreenPaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1203, 0x0028, 0x1203, + EVR_OW, "BluePaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1204, 0x0028, 0x1204, + EVR_OW, "AlphaPaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1211, 0x0028, 0x1211, + EVR_OW, "RETIRED_LargeRedPaletteColorLookupTableData", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1212, 0x0028, 0x1212, + EVR_OW, "RETIRED_LargeGreenPaletteColorLookupTableData", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1213, 0x0028, 0x1213, + EVR_OW, "RETIRED_LargeBluePaletteColorLookupTableData", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1214, 0x0028, 0x1214, + EVR_UI, "RETIRED_LargePaletteColorLookupTableUID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1221, 0x0028, 0x1221, + EVR_OW, "SegmentedRedPaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1222, 0x0028, 0x1222, + EVR_OW, "SegmentedGreenPaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1223, 0x0028, 0x1223, + EVR_OW, "SegmentedBluePaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1224, 0x0028, 0x1224, + EVR_OW, "SegmentedAlphaPaletteColorLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1230, 0x0028, 0x1230, + EVR_SQ, "StoredValueColorRangeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1231, 0x0028, 0x1231, + EVR_FD, "MinimumStoredValueMapped", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1232, 0x0028, 0x1232, + EVR_FD, "MaximumStoredValueMapped", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1300, 0x0028, 0x1300, + EVR_CS, "BreastImplantPresent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1350, 0x0028, 0x1350, + EVR_CS, "PartialView", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1351, 0x0028, 0x1351, + EVR_ST, "PartialViewDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1352, 0x0028, 0x1352, + EVR_SQ, "PartialViewCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x135a, 0x0028, 0x135a, + EVR_CS, "SpatialLocationsPreserved", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1401, 0x0028, 0x1401, + EVR_SQ, "DataFrameAssignmentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1402, 0x0028, 0x1402, + EVR_CS, "DataPathAssignment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1403, 0x0028, 0x1403, + EVR_US, "BitsMappedToColorLookupTable", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1404, 0x0028, 0x1404, + EVR_SQ, "BlendingLUT1Sequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1405, 0x0028, 0x1405, + EVR_CS, "BlendingLUT1TransferFunction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1406, 0x0028, 0x1406, + EVR_FD, "BlendingWeightConstant", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1407, 0x0028, 0x1407, + EVR_US, "BlendingLookupTableDescriptor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1408, 0x0028, 0x1408, + EVR_OW, "BlendingLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x140b, 0x0028, 0x140b, + EVR_SQ, "EnhancedPaletteColorLookupTableSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x140c, 0x0028, 0x140c, + EVR_SQ, "BlendingLUT2Sequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x140d, 0x0028, 0x140d, + EVR_CS, "BlendingLUT2TransferFunction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x140e, 0x0028, 0x140e, + EVR_CS, "DataPathID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x140f, 0x0028, 0x140f, + EVR_CS, "RGBLUTTransferFunction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x1410, 0x0028, 0x1410, + EVR_CS, "AlphaLUTTransferFunction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x2000, 0x0028, 0x2000, + EVR_OB, "ICCProfile", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x2002, 0x0028, 0x2002, + EVR_CS, "ColorSpace", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x2110, 0x0028, 0x2110, + EVR_CS, "LossyImageCompression", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x2112, 0x0028, 0x2112, + EVR_DS, "LossyImageCompressionRatio", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x2114, 0x0028, 0x2114, + EVR_CS, "LossyImageCompressionMethod", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x3000, 0x0028, 0x3000, + EVR_SQ, "ModalityLUTSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x3002, 0x0028, 0x3002, + EVR_xs, "LUTDescriptor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x3003, 0x0028, 0x3003, + EVR_LO, "LUTExplanation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x3004, 0x0028, 0x3004, + EVR_LO, "ModalityLUTType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x3006, 0x0028, 0x3006, + EVR_lt, "LUTData", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x3010, 0x0028, 0x3010, + EVR_SQ, "VOILUTSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x3110, 0x0028, 0x3110, + EVR_SQ, "SoftcopyVOILUTSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x4000, 0x0028, 0x4000, + EVR_LT, "RETIRED_ImagePresentationComments", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x5000, 0x0028, 0x5000, + EVR_SQ, "RETIRED_BiPlaneAcquisitionSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6010, 0x0028, 0x6010, + EVR_US, "RepresentativeFrameNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6020, 0x0028, 0x6020, + EVR_US, "FrameNumbersOfInterest", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6022, 0x0028, 0x6022, + EVR_LO, "FrameOfInterestDescription", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6023, 0x0028, 0x6023, + EVR_CS, "FrameOfInterestType", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6030, 0x0028, 0x6030, + EVR_US, "RETIRED_MaskPointers", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6040, 0x0028, 0x6040, + EVR_US, "RWavePointer", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6100, 0x0028, 0x6100, + EVR_SQ, "MaskSubtractionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6101, 0x0028, 0x6101, + EVR_CS, "MaskOperation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6102, 0x0028, 0x6102, + EVR_US, "ApplicableFrameRange", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6110, 0x0028, 0x6110, + EVR_US, "MaskFrameNumbers", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6112, 0x0028, 0x6112, + EVR_US, "ContrastFrameAveraging", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6114, 0x0028, 0x6114, + EVR_FL, "MaskSubPixelShift", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6120, 0x0028, 0x6120, + EVR_SS, "TIDOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x6190, 0x0028, 0x6190, + EVR_ST, "MaskOperationExplanation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7000, 0x0028, 0x7000, + EVR_SQ, "EquipmentAdministratorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7001, 0x0028, 0x7001, + EVR_US, "NumberOfDisplaySubsystems", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7002, 0x0028, 0x7002, + EVR_US, "CurrentConfigurationID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7003, 0x0028, 0x7003, + EVR_US, "DisplaySubsystemID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7004, 0x0028, 0x7004, + EVR_SH, "DisplaySubsystemName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7005, 0x0028, 0x7005, + EVR_LO, "DisplaySubsystemDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7006, 0x0028, 0x7006, + EVR_CS, "SystemStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7007, 0x0028, 0x7007, + EVR_LO, "SystemStatusComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7008, 0x0028, 0x7008, + EVR_SQ, "TargetLuminanceCharacteristicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7009, 0x0028, 0x7009, + EVR_US, "LuminanceCharacteristicsID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x700a, 0x0028, 0x700a, + EVR_SQ, "DisplaySubsystemConfigurationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x700b, 0x0028, 0x700b, + EVR_US, "ConfigurationID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x700c, 0x0028, 0x700c, + EVR_SH, "ConfigurationName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x700d, 0x0028, 0x700d, + EVR_LO, "ConfigurationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x700e, 0x0028, 0x700e, + EVR_US, "ReferencedTargetLuminanceCharacteristicsID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x700f, 0x0028, 0x700f, + EVR_SQ, "QAResultsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7010, 0x0028, 0x7010, + EVR_SQ, "DisplaySubsystemQAResultsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7011, 0x0028, 0x7011, + EVR_SQ, "ConfigurationQAResultsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7012, 0x0028, 0x7012, + EVR_SQ, "MeasurementEquipmentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7013, 0x0028, 0x7013, + EVR_CS, "MeasurementFunctions", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7014, 0x0028, 0x7014, + EVR_CS, "MeasurementEquipmentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7015, 0x0028, 0x7015, + EVR_SQ, "VisualEvaluationResultSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7016, 0x0028, 0x7016, + EVR_SQ, "DisplayCalibrationResultSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7017, 0x0028, 0x7017, + EVR_US, "DDLValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7018, 0x0028, 0x7018, + EVR_FL, "CIExyWhitePoint", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7019, 0x0028, 0x7019, + EVR_CS, "DisplayFunctionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x701a, 0x0028, 0x701a, + EVR_FL, "GammaValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x701b, 0x0028, 0x701b, + EVR_US, "NumberOfLuminancePoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x701c, 0x0028, 0x701c, + EVR_SQ, "LuminanceResponseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x701d, 0x0028, 0x701d, + EVR_FL, "TargetMinimumLuminance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x701e, 0x0028, 0x701e, + EVR_FL, "TargetMaximumLuminance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x701f, 0x0028, 0x701f, + EVR_FL, "LuminanceValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7020, 0x0028, 0x7020, + EVR_LO, "LuminanceResponseDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7021, 0x0028, 0x7021, + EVR_CS, "WhitePointFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7022, 0x0028, 0x7022, + EVR_SQ, "DisplayDeviceTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7023, 0x0028, 0x7023, + EVR_SQ, "DisplaySubsystemSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7024, 0x0028, 0x7024, + EVR_SQ, "LuminanceResultSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7025, 0x0028, 0x7025, + EVR_CS, "AmbientLightValueSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7026, 0x0028, 0x7026, + EVR_CS, "MeasuredCharacteristics", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7027, 0x0028, 0x7027, + EVR_SQ, "LuminanceUniformityResultSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7028, 0x0028, 0x7028, + EVR_SQ, "VisualEvaluationTestSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7029, 0x0028, 0x7029, + EVR_CS, "TestResult", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x702a, 0x0028, 0x702a, + EVR_LO, "TestResultComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x702b, 0x0028, 0x702b, + EVR_CS, "TestImageValidation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x702c, 0x0028, 0x702c, + EVR_SQ, "TestPatternCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x702d, 0x0028, 0x702d, + EVR_SQ, "MeasurementPatternCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x702e, 0x0028, 0x702e, + EVR_SQ, "VisualEvaluationMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x7fe0, 0x0028, 0x7fe0, + EVR_UR, "PixelDataProviderURL", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9001, 0x0028, 0x9001, + EVR_UL, "DataPointRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9002, 0x0028, 0x9002, + EVR_UL, "DataPointColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9003, 0x0028, 0x9003, + EVR_CS, "SignalDomainColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9099, 0x0028, 0x9099, + EVR_US, "RETIRED_LargestMonochromePixelValue", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9108, 0x0028, 0x9108, + EVR_CS, "DataRepresentation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9110, 0x0028, 0x9110, + EVR_SQ, "PixelMeasuresSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9132, 0x0028, 0x9132, + EVR_SQ, "FrameVOILUTSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9145, 0x0028, 0x9145, + EVR_SQ, "PixelValueTransformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9235, 0x0028, 0x9235, + EVR_CS, "SignalDomainRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9411, 0x0028, 0x9411, + EVR_FL, "DisplayFilterPercentage", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9415, 0x0028, 0x9415, + EVR_SQ, "FramePixelShiftSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9416, 0x0028, 0x9416, + EVR_US, "SubtractionItemID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9422, 0x0028, 0x9422, + EVR_SQ, "PixelIntensityRelationshipLUTSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9443, 0x0028, 0x9443, + EVR_SQ, "FramePixelDataPropertiesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9444, 0x0028, 0x9444, + EVR_CS, "GeometricalProperties", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9445, 0x0028, 0x9445, + EVR_FL, "GeometricMaximumDistortion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9446, 0x0028, 0x9446, + EVR_CS, "ImageProcessingApplied", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9454, 0x0028, 0x9454, + EVR_CS, "MaskSelectionMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9474, 0x0028, 0x9474, + EVR_CS, "LUTFunction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9478, 0x0028, 0x9478, + EVR_FL, "MaskVisibilityPercentage", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9501, 0x0028, 0x9501, + EVR_SQ, "PixelShiftSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9502, 0x0028, 0x9502, + EVR_SQ, "RegionPixelShiftSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9503, 0x0028, 0x9503, + EVR_SS, "VerticesOfTheRegion", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9505, 0x0028, 0x9505, + EVR_SQ, "MultiFramePresentationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9506, 0x0028, 0x9506, + EVR_US, "PixelShiftFrameRange", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9507, 0x0028, 0x9507, + EVR_US, "LUTFrameRange", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9520, 0x0028, 0x9520, + EVR_DS, "ImageToEquipmentMappingMatrix", 16, 16, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0028, 0x9537, 0x0028, 0x9537, + EVR_CS, "EquipmentCoordinateSystemIdentification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_LT, "ImageEnhancementID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_LT, "SubtractionMaskID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;2" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;1" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_DS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_SQ, "EdgeEnhancementSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_UI, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Graphics Export V1.0" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_CDS Release 1" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_LT, "ZoomID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_FD, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;2" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AEGIS_DICOM_2.00" } + , { 0x0029, 0x0000, 0x0029, 0x0000, + EVR_DS, "Unknown", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0001, 0x0029, 0x0001, + EVR_LT, "ImageEnhancement", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x0001, 0x0029, 0x0001, + EVR_US, "ConvolutionKernelSize", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0029, 0x0001, 0x0029, 0x0001, + EVR_DS, "ZoomRectangle", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0001, 0x0029, 0x0001, + EVR_FD, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;2" } + , { 0x0029, 0x0001, 0x0029, 0x0001, + EVR_FD, "ImageCompressionFraction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0002, 0x0029, 0x0002, + EVR_LT, "ConvolutionID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x0002, 0x0029, 0x0002, + EVR_DS, "ConvolutionKernelCoefficients", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0029, 0x0002, 0x0029, 0x0002, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;4" } + , { 0x0029, 0x0002, 0x0029, 0x0002, + EVR_FD, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;2" } + , { 0x0029, 0x0002, 0x0029, 0x0002, + EVR_FD, "ImageQuality", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0003, 0x0029, 0x0003, + EVR_LT, "ConvolutionType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x0003, 0x0029, 0x0003, + EVR_DS, "EdgeEnhancementGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CARDIO-D.R. 1.0" } + , { 0x0029, 0x0003, 0x0029, 0x0003, + EVR_DS, "ZoomFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0003, 0x0029, 0x0003, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;2" } + , { 0x0029, 0x0003, 0x0029, 0x0003, + EVR_FD, "ImageBytesTransferred", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0004, 0x0029, 0x0004, + EVR_LT, "ConvolutionKernelSizeID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x0004, 0x0029, 0x0004, + EVR_UN, "MaskingFunction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;2" } + , { 0x0029, 0x0004, 0x0029, 0x0004, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x0004, 0x0029, 0x0004, + EVR_LT, "PhotometricInterpretation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x0004, 0x0029, 0x0004, + EVR_US, "ZoomFunction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0004, 0x0029, 0x0004, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;2" } + , { 0x0029, 0x0004, 0x0029, 0x0004, + EVR_SL, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0005, 0x0029, 0x0005, + EVR_US, "ConvolutionKernelSize", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x0005, 0x0029, 0x0005, + EVR_FL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;1" } + , { 0x0029, 0x0005, 0x0029, 0x0005, + EVR_SL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;2" } + , { 0x0029, 0x0005, 0x0029, 0x0005, + EVR_DS, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0006, 0x0029, 0x0006, + EVR_US, "ConvolutionKernel", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x0006, 0x0029, 0x0006, + EVR_FL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;1" } + , { 0x0029, 0x0006, 0x0029, 0x0006, + EVR_DS, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0007, 0x0029, 0x0007, + EVR_SL, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0008, 0x0029, 0x0008, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x0008, 0x0029, 0x0008, + EVR_CS, "CSAImageHeaderType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA HEADER" } + , { 0x0029, 0x0008, 0x0029, 0x0008, + EVR_CS, "CSADataType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA NON-IMAGE" } + , { 0x0029, 0x0008, 0x0029, 0x0008, + EVR_CS, "MEDCOMOOGType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM OOG" } + , { 0x0029, 0x0008, 0x0029, 0x0008, + EVR_SH, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0008, 0x0029, 0x0008, + EVR_IS, "NumberOfExposureResults", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0029, 0x0008, 0x0029, 0x0008, + EVR_CS, "MedComHeaderType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0009, 0x0029, 0x0009, + EVR_LO, "CSAImageHeaderVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA HEADER" } + , { 0x0029, 0x0009, 0x0029, 0x0009, + EVR_LO, "CSADataVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA NON-IMAGE" } + , { 0x0029, 0x0009, 0x0029, 0x0009, + EVR_LO, "MEDCOMOOGVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM OOG" } + , { 0x0029, 0x0009, 0x0029, 0x0009, + EVR_SH, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0009, 0x0029, 0x0009, + EVR_LO, "MedComHeaderVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x000a, 0x0029, 0x000a, + EVR_SS, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x000c, 0x0029, 0x000c, + EVR_DS, "EnhancementGain", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x000c, 0x0029, 0x000c, + EVR_UN, "ProprietaryMaskingParameters", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;2" } + , { 0x0029, 0x000e, 0x0029, 0x000e, + EVR_CS, "ZoomEnableStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x000f, 0x0029, 0x000f, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x000f, 0x0029, 0x000f, + EVR_CS, "ZoomSelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_LT, "Commentline", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS IP" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_US, "ListOfGroupNumbers", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_LT, "WindowStyle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_OB, "CSAImageHeaderInfo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA HEADER" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_US, "RowsOfSubmatrix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_OB, "CSADataInfo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA NON-IMAGE" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_OB, "MEDCOMOOGInfo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM OOG" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_OB, "MedComHeaderInfo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_DS, "FPMin", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_SH, "J2cParameterType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0010, 0x0029, 0x0010, + EVR_US, "ListOfGroupNumbers", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0011, 0x0029, 0x0011, + EVR_IS, "LineName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0011, 0x0029, 0x0011, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x0011, 0x0029, 0x0011, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0011, 0x0029, 0x0011, + EVR_US, "ColumnsOfSubmatrix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x0011, 0x0029, 0x0011, + EVR_IS, "ROIName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0011, 0x0029, 0x0011, + EVR_IS, "AnnotationName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0011, 0x0029, 0x0011, + EVR_US, "J2cPixelRepresentation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0012, 0x0029, 0x0012, + EVR_LT, "LineNameFont", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0012, 0x0029, 0x0012, + EVR_LT, "ROINameFont", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0012, 0x0029, 0x0012, + EVR_LT, "AnnotationFont", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0012, 0x0029, 0x0012, + EVR_US, "J2cBitsAllocated", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0013, 0x0029, 0x0013, + EVR_UL, "LineNameDisplay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0013, 0x0029, 0x0013, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0013, 0x0029, 0x0013, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0013, 0x0029, 0x0013, + EVR_LT, "ROINormalColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0013, 0x0029, 0x0013, + EVR_LT, "AnnotationTextForegroundColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0013, 0x0029, 0x0013, + EVR_US, "J2cPixelShiftValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0014, 0x0029, 0x0014, + EVR_LT, "LineNormalColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0014, 0x0029, 0x0014, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0014, 0x0029, 0x0014, + EVR_UL, "ROIFillPattern", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0014, 0x0029, 0x0014, + EVR_LT, "AnnotationTextBackgroundColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0014, 0x0029, 0x0014, + EVR_US, "J2cPlanarConfiguration", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0015, 0x0029, 0x0015, + EVR_UL, "LineType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0015, 0x0029, 0x0015, + EVR_LT, "ListOfShadowOwnerCodes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0015, 0x0029, 0x0015, + EVR_UL, "ROIBpSeg", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0015, 0x0029, 0x0015, + EVR_UL, "AnnotationTextBackingMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0015, 0x0029, 0x0015, + EVR_SL, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0015, 0x0029, 0x0015, + EVR_DS, "J2cRescaleIntercept", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0015, 0x0029, 0x0015, + EVR_LT, "ListOfShadowOwnerCodes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0016, 0x0029, 0x0016, + EVR_UL, "LineThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0016, 0x0029, 0x0016, + EVR_UN, "ROIBpSegPairs", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0016, 0x0029, 0x0016, + EVR_UL, "AnnotationTextJustification", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0016, 0x0029, 0x0016, + EVR_SL, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0017, 0x0029, 0x0017, + EVR_UL, "LineStyle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0017, 0x0029, 0x0017, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0017, 0x0029, 0x0017, + EVR_UL, "ROISeedSpace", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0017, 0x0029, 0x0017, + EVR_UL, "AnnotationTextLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0017, 0x0029, 0x0017, + EVR_SL, "LowerRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0018, 0x0029, 0x0018, + EVR_UL, "LineDashLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0018, 0x0029, 0x0018, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0018, 0x0029, 0x0018, + EVR_CS, "CSASeriesHeaderType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA HEADER" } + , { 0x0029, 0x0018, 0x0029, 0x0018, + EVR_UN, "ROISeeds", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0018, 0x0029, 0x0018, + EVR_LT, "AnnotationTextString", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0018, 0x0029, 0x0018, + EVR_SL, "UpperRangeOfPixels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0019, 0x0029, 0x0019, + EVR_UL, "LineInteractivity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0019, 0x0029, 0x0019, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0019, 0x0029, 0x0019, + EVR_LO, "CSASeriesHeaderVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA HEADER" } + , { 0x0029, 0x0019, 0x0029, 0x0019, + EVR_UL, "ROILineThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0019, 0x0029, 0x0019, + EVR_UL, "AnnotationTextAttachMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x001a, 0x0029, 0x001a, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x001a, 0x0029, 0x001a, + EVR_SL, "LengthOfTotalHeaderInBytes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x001b, 0x0029, 0x001b, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x001b, 0x0029, 0x001b, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x001c, 0x0029, 0x001c, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x001c, 0x0029, 0x001c, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x001d, 0x0029, 0x001d, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x001e, 0x0029, 0x001e, + EVR_CS, "ImageEnhancementEnableStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x001e, 0x0029, 0x001e, + EVR_CS, "SubtractionMaskEnableStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;2" } + , { 0x0029, 0x001e, 0x0029, 0x001e, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x001f, 0x0029, 0x001f, + EVR_CS, "ImageEnhancementSelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;3" } + , { 0x0029, 0x001f, 0x0029, 0x001f, + EVR_CS, "SubtractionMaskSelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;2" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_DS, "PixelAspectRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_DS, "EdgeEnhancementCoefficient", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS IP" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_LT, "LineMeasurementColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_FL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;1" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_CS, "ImageScanningDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_US, "ListOfElementNumbers", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_LT, "PixelQualityCode", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_OB, "CSASeriesHeaderInfo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA HEADER" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_UL, "ROILineStyle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_UL, "AnnotationTextCursorMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_LO, "PixelDataMD5SumPerFrame", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_OB, "MedComHistoryInformation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_DS, "FPMax", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0020, 0x0029, 0x0020, + EVR_US, "ListOfElementNumbers", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_LT, "LineMeasurementFont", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_FL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;1" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_UL, "ROILineDashLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_UL, "AnnotationTextShadowOffsetX", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0021, 0x0029, 0x0021, + EVR_US, "HistogramPercentileLabels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0022, 0x0029, 0x0022, + EVR_UL, "LineMeasurementDashLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0022, 0x0029, 0x0022, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0022, 0x0029, 0x0022, + EVR_IS, "PixelQualityValue", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0022, 0x0029, 0x0022, + EVR_UL, "ROIInteractivity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0022, 0x0029, 0x0022, + EVR_UL, "AnnotationTextShadowOffsetY", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0022, 0x0029, 0x0022, + EVR_FD, "HistogramPercentileValues", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x0029, 0x0023, 0x0029, 0x0023, + EVR_UL, "LinePointSpace", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0023, 0x0029, 0x0023, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0023, 0x0029, 0x0023, + EVR_UL, "ROINamePosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0023, 0x0029, 0x0023, + EVR_LT, "AnnotationLineColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0024, 0x0029, 0x0024, + EVR_FD, "LinePoints", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0024, 0x0029, 0x0024, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0024, 0x0029, 0x0024, + EVR_UL, "ROINameDisplay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0024, 0x0029, 0x0024, + EVR_UL, "AnnotationLineThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0025, 0x0029, 0x0025, + EVR_UL, "LineControlPointSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0025, 0x0029, 0x0025, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0025, 0x0029, 0x0025, + EVR_LT, "ROILabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0025, 0x0029, 0x0025, + EVR_UL, "AnnotationLineType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0025, 0x0029, 0x0025, + EVR_LO, "ProcessedPixelDataQuality", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0026, 0x0029, 0x0026, + EVR_UL, "LineControlPointSpace", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0026, 0x0029, 0x0026, + EVR_UL, "ROIShape", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0026, 0x0029, 0x0026, + EVR_UL, "AnnotationLineStyle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0026, 0x0029, 0x0026, + EVR_SS, "VersionOfHeaderStructure", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0027, 0x0029, 0x0027, + EVR_FD, "LineControlPoints", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0027, 0x0029, 0x0027, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0027, 0x0029, 0x0027, + EVR_FD, "ROIShapeTilt", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0027, 0x0029, 0x0027, + EVR_UL, "AnnotationLineDashLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0028, 0x0029, 0x0028, + EVR_LT, "LineLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0028, 0x0029, 0x0028, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0028, 0x0029, 0x0028, + EVR_UL, "ROIShapePointsCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0028, 0x0029, 0x0028, + EVR_UL, "AnnotationLineAttachMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0029, 0x0029, 0x0029, + EVR_UL, "LineDontSave", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Line V1.0" } + , { 0x0029, 0x0029, 0x0029, 0x0029, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0029, 0x0029, 0x0029, + EVR_UL, "ROIShapePointsSpace", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0029, 0x0029, 0x0029, + EVR_UL, "AnnotationLinePointCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS IP" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_CS, "ExtendedReadingSizeValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_US, "ListOfTotalDisplayLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_FD, "ROIShapePoints", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_FD, "AnnotationLinePoints", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_DS, "ScaledMinimum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0030, 0x0029, 0x0030, + EVR_US, "ListOfTotalDisplayLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0031, 0x0029, 0x0031, + EVR_DS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x0031, 0x0029, 0x0031, + EVR_UL, "ROIShapeControlPointsCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0031, 0x0029, 0x0031, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x0031, 0x0029, 0x0031, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIGISCAN IMAGE" } + , { 0x0029, 0x0031, 0x0029, 0x0031, + EVR_UL, "AnnotationLineControlSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0031, 0x0029, 0x0031, + EVR_LO, "PMTFInformation1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0032, 0x0029, 0x0032, + EVR_DS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x0032, 0x0029, 0x0032, + EVR_UL, "ROIShapeControlPointsSpace", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0032, 0x0029, 0x0032, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x0032, 0x0029, 0x0032, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIGISCAN IMAGE" } + , { 0x0029, 0x0032, 0x0029, 0x0032, + EVR_LT, "AnnotationMarkerColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0032, 0x0029, 0x0032, + EVR_UL, "PMTFInformation2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0033, 0x0029, 0x0033, + EVR_FD, "ROIShapeControlPoints", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0033, 0x0029, 0x0033, + EVR_UL, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x0033, 0x0029, 0x0033, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIGISCAN IMAGE" } + , { 0x0029, 0x0033, 0x0029, 0x0033, + EVR_UL, "AnnotationMarkerType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0033, 0x0029, 0x0033, + EVR_UL, "PMTFInformation3", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0034, 0x0029, 0x0034, + EVR_US, "MagnificationReductionRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0029, 0x0034, 0x0029, 0x0034, + EVR_UL, "ROIDontSave", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette ROI V1.0" } + , { 0x0029, 0x0034, 0x0029, 0x0034, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIGISCAN IMAGE" } + , { 0x0029, 0x0034, 0x0029, 0x0034, + EVR_UL, "AnnotationMarkerSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0034, 0x0029, 0x0034, + EVR_SL, "AdvantageCompOverflow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0034, 0x0029, 0x0034, + EVR_CS, "PMTFInformation4", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0035, 0x0029, 0x0035, + EVR_FD, "AnnotationMarkerLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0035, 0x0029, 0x0035, + EVR_SL, "AdvantageCompUnderflow", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_IMPS_01" } + , { 0x0029, 0x0035, 0x0029, 0x0035, + EVR_UL, "PMTFInformation5", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0036, 0x0029, 0x0036, + EVR_UL, "AnnotationMarkerAttachMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0037, 0x0029, 0x0037, + EVR_LT, "AnnotationGeomColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0038, 0x0029, 0x0038, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0038, 0x0029, 0x0038, + EVR_UL, "AnnotationGeomThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0039, 0x0029, 0x0039, + EVR_UL, "AnnotationGeomLineStyle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0040, 0x0029, 0x0040, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS IP" } + , { 0x0029, 0x0040, 0x0029, 0x0040, + EVR_LT, "ListOfDisplayPrefix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0040, 0x0029, 0x0040, + EVR_LT, "MagnifyingGlassID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0040, 0x0029, 0x0040, + EVR_UL, "AnnotationGeomDashLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0040, 0x0029, 0x0040, + EVR_SQ, "ApplicationHeaderSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0040, 0x0029, 0x0040, + EVR_DS, "ScaledMaximum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0040, 0x0029, 0x0040, + EVR_LT, "ListOfDisplayPrefix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0041, 0x0029, 0x0041, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Sequence Ids V1.0" } + , { 0x0029, 0x0041, 0x0029, 0x0041, + EVR_DS, "MagnifyingGlassRectangle", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0041, 0x0029, 0x0041, + EVR_UL, "AnnotationGeomFillPattern", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0041, 0x0029, 0x0041, + EVR_CS, "ApplicationHeaderType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0042, 0x0029, 0x0042, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Sequence Ids V1.0" } + , { 0x0029, 0x0042, 0x0029, 0x0042, + EVR_UL, "AnnotationInteractivity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0042, 0x0029, 0x0042, + EVR_LO, "ApplicationHeaderID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0043, 0x0029, 0x0043, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x0043, 0x0029, 0x0043, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Sequence Ids V1.0" } + , { 0x0029, 0x0043, 0x0029, 0x0043, + EVR_DS, "MagnifyingGlassFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0043, 0x0029, 0x0043, + EVR_FD, "AnnotationArrowLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0043, 0x0029, 0x0043, + EVR_LO, "ApplicationHeaderVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0044, 0x0029, 0x0044, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x0044, 0x0029, 0x0044, + EVR_CS, "LineDensityCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0029, 0x0044, 0x0029, 0x0044, + EVR_US, "MagnifyingGlassFunction", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0044, 0x0029, 0x0044, + EVR_FD, "AnnotationArrowAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x0044, 0x0029, 0x0044, + EVR_OB, "ApplicationHeaderInfo", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0045, 0x0029, 0x0045, + EVR_UL, "AnnotationDontSave", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette Annot V1.0" } + , { 0x0029, 0x004c, 0x0029, 0x004c, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x004e, 0x0029, 0x004e, + EVR_CS, "MagnifyingGlassEnableStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x004f, 0x0029, 0x004f, + EVR_CS, "MagnifyingGlassSelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1;1" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_LT, "SceneText", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_CS, "DataCompressionCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_LT, "ArchiveCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_LT, "ListOfDisplayPostfix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_US, "OriginOfSubmatrix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_CS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;5" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_LO, "WorkflowControlFlags", 8, 8, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_DS, "WindowMinimum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0050, 0x0029, 0x0050, + EVR_LT, "ListOfDisplayPostfix", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0051, 0x0029, 0x0051, + EVR_LT, "ExposureCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0051, 0x0029, 0x0051, + EVR_CS, "ArchiveManagementFlagKeepOnline", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0052, 0x0029, 0x0052, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0052, 0x0029, 0x0052, + EVR_LT, "SortCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0052, 0x0029, 0x0052, + EVR_CS, "ArchiveManagementFlagDoNotArchive", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0053, 0x0029, 0x0053, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0053, 0x0029, 0x0053, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0053, 0x0029, 0x0053, + EVR_CS, "ImageLocationStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0054, 0x0029, 0x0054, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0054, 0x0029, 0x0054, + EVR_DS, "EstimatedRetrieveTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0055, 0x0029, 0x0055, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0055, 0x0029, 0x0055, + EVR_CS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;5" } + , { 0x0029, 0x0055, 0x0029, 0x0055, + EVR_DS, "DataSizeOfRetrievedImages", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0056, 0x0029, 0x0056, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0057, 0x0029, 0x0057, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Silhouette V1.0" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_LT, "ImageText", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_LT, "CompressionAlgorithm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI Release 1" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_LT, "Splash", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_US, "ListOfTextPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_LT, "CompressionAlgorithm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_LO, "SeriesWorkflowStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER2" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_DS, "WindowMaximum", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_LT, "CompressionAlgorithm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI RELEASE 1" } + , { 0x0029, 0x0060, 0x0029, 0x0060, + EVR_US, "ListOfTextPosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0061, 0x0029, 0x0061, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0061, 0x0029, 0x0061, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0067, 0x0029, 0x0067, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x0067, 0x0029, 0x0067, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0068, 0x0029, 0x0068, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x006a, 0x0029, 0x006a, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x006b, 0x0029, 0x006b, + EVR_US, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1" } + , { 0x0029, 0x0070, 0x0029, 0x0070, + EVR_IS, "PixelShiftHorizontal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS" } + , { 0x0029, 0x0070, 0x0029, 0x0070, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ISG shadow" } + , { 0x0029, 0x0070, 0x0029, 0x0070, + EVR_LT, "ListOfTextConcatenation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED HG" } + , { 0x0029, 0x0070, 0x0029, 0x0070, + EVR_SQ, "SiemensLinkSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0070, 0x0029, 0x0070, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0070, 0x0029, 0x0070, + EVR_LT, "ListOfTextConcatenation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED MG" } + , { 0x0029, 0x0070, 0x0029, 0x0070, + EVR_LT, "WindowID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0071, 0x0029, 0x0071, + EVR_AT, "ReferencedTag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0071, 0x0029, 0x0071, + EVR_DS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0071, 0x0029, 0x0071, + EVR_CS, "VideoInvertSubtracted", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0072, 0x0029, 0x0072, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0072, 0x0029, 0x0072, + EVR_CS, "ReferencedTagType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0072, 0x0029, 0x0072, + EVR_CS, "VideoInvertNonsubtracted", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0073, 0x0029, 0x0073, + EVR_UL, "ReferencedValueLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0074, 0x0029, 0x0074, + EVR_CS, "ReferencedObjectDeviceType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0075, 0x0029, 0x0075, + EVR_OB, "ReferencedObjectDeviceLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0076, 0x0029, 0x0076, + EVR_OB, "ReferencedObjectDeviceID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MEDCOM HEADER" } + , { 0x0029, 0x0077, 0x0029, 0x0077, + EVR_CS, "WindowSelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0078, 0x0029, 0x0078, + EVR_LT, "ECGDisplayPrintingID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0079, 0x0029, 0x0079, + EVR_CS, "ECGDisplayPrinting", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x007e, 0x0029, 0x007e, + EVR_CS, "ECGDisplayPrintingEnableStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x007f, 0x0029, 0x007f, + EVR_CS, "ECGDisplayPrintingSelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0080, 0x0029, 0x0080, + EVR_IS, "PixelShiftVertical", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS" } + , { 0x0029, 0x0080, 0x0029, 0x0080, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ISG shadow" } + , { 0x0029, 0x0080, 0x0029, 0x0080, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x0080, 0x0029, 0x0080, + EVR_IS, "ViewCenter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0080, 0x0029, 0x0080, + EVR_LT, "PhysiologicalDisplayID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0081, 0x0029, 0x0081, + EVR_IS, "ViewSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0081, 0x0029, 0x0081, + EVR_US, "PreferredPhysiologicalChannelDisplay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0082, 0x0029, 0x0082, + EVR_IS, "ViewZoom", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x0083, 0x0029, 0x0083, + EVR_IS, "ViewTransform", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x0029, 0x008e, 0x0029, 0x008e, + EVR_CS, "PhysiologicalDisplayEnableStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x008f, 0x0029, 0x008f, + EVR_CS, "PhysiologicalDisplaySelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x0090, 0x0029, 0x0090, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "CAMTRONICS" } + , { 0x0029, 0x0090, 0x0029, 0x0090, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ISG shadow" } + , { 0x0029, 0x0090, 0x0029, 0x0090, + EVR_LO, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x0099, 0x0029, 0x0099, + EVR_LT, "ShutterType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x009a, 0x0029, 0x009a, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;4" } + , { 0x0029, 0x00a0, 0x0029, 0x00a0, + EVR_US, "RowsOfRectangularShutter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x00a1, 0x0029, 0x00a1, + EVR_US, "ColumnsOfRectangularShutter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x00a2, 0x0029, 0x00a2, + EVR_US, "OriginOfRectangularShutter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x00b0, 0x0029, 0x00b0, + EVR_US, "RadiusOfCircularShutter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x00b2, 0x0029, 0x00b2, + EVR_US, "OriginOfCircularShutter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x00c0, 0x0029, 0x00c0, + EVR_LT, "FunctionalShutterID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x00c0, 0x0029, 0x00c0, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;3" } + , { 0x0029, 0x00c1, 0x0029, 0x00c1, + EVR_US, "ContourOfIrregularShutter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED DISPLAY" } + , { 0x0029, 0x00c1, 0x0029, 0x00c1, + EVR_US, "FieldOfShutter", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x00c1, 0x0029, 0x00c1, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;3" } + , { 0x0029, 0x00c2, 0x0029, 0x00c2, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;3" } + , { 0x0029, 0x00c3, 0x0029, 0x00c3, + EVR_IS, "ScanResolution", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x00c3, 0x0029, 0x00c3, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;3" } + , { 0x0029, 0x00c4, 0x0029, 0x00c4, + EVR_IS, "FieldOfView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x00c4, 0x0029, 0x00c4, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;3" } + , { 0x0029, 0x00c5, 0x0029, 0x00c5, + EVR_LT, "FieldOfShutterRectangle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x00c5, 0x0029, 0x00c5, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;3" } + , { 0x0029, 0x00cd, 0x0029, 0x00cd, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;1" } + , { 0x0029, 0x00ce, 0x0029, 0x00ce, + EVR_CS, "ShutterEnableStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x00cf, 0x0029, 0x00cf, + EVR_CS, "ShutterSelectStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x0029, 0x00d0, 0x0029, 0x00d0, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x00d1, 0x0029, 0x00d1, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-GV-CT Release 1" } + , { 0x0029, 0x00d5, 0x0029, 0x00d5, + EVR_LT, "SliceThickness", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/PART" } + , { 0x0029, 0x00e0, 0x0029, 0x00e0, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P-Private_ICS Release 1;4" } + , { 0x0029, 0x1010, 0x0029, 0x1010, + EVR_OB, "OriginalMeasuringData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "OCULUS Optikgeraete GmbH" } + , { 0x0029, 0x1012, 0x0029, 0x1012, + EVR_UL, "OriginalMeasuringDataLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "OCULUS Optikgeraete GmbH" } + , { 0x0029, 0x1020, 0x0029, 0x1020, + EVR_OB, "OriginalMeasuringRawData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "OCULUS Optikgeraete GmbH" } + , { 0x0029, 0x1022, 0x0029, 0x1022, + EVR_UL, "OriginalMeasuringRawDataLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "OCULUS Optikgeraete GmbH" } + , { 0x0031, 0x0000, 0x0031, 0x0000, + EVR_CS, "StudyStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AGFA PACS Archive Mirroring 1.0" } + , { 0x0031, 0x0001, 0x0031, 0x0001, + EVR_UL, "DateTimeVerified", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AGFA PACS Archive Mirroring 1.0" } + , { 0x0031, 0x0010, 0x0031, 0x0010, + EVR_LT, "RequestUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0031, 0x0012, 0x0031, 0x0012, + EVR_LT, "ExaminationReason", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0031, 0x0030, 0x0031, 0x0030, + EVR_DA, "RequestedDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0031, 0x0032, 0x0031, 0x0032, + EVR_TM, "WorklistRequestStartTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0031, 0x0033, 0x0031, 0x0033, + EVR_TM, "WorklistRequestEndTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0031, 0x0045, 0x0031, 0x0045, + EVR_LT, "RequestingPhysician", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0031, 0x004a, 0x0031, 0x004a, + EVR_TM, "RequestedTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0031, 0x0050, 0x0031, 0x0050, + EVR_LT, "RequestedPhysician", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0031, 0x0080, 0x0031, 0x0080, + EVR_LT, "RequestedLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } +#endif + , { 0x0032, 0x000a, 0x0032, 0x000a, + EVR_CS, "RETIRED_StudyStatusID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x000c, 0x0032, 0x000c, + EVR_CS, "RETIRED_StudyPriorityID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x0012, 0x0032, 0x0012, + EVR_LO, "RETIRED_StudyIDIssuer", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x0032, 0x0032, 0x0032, + EVR_DA, "RETIRED_StudyVerifiedDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x0033, 0x0032, 0x0033, + EVR_TM, "RETIRED_StudyVerifiedTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x0034, 0x0032, 0x0034, + EVR_DA, "RETIRED_StudyReadDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x0035, 0x0032, 0x0035, + EVR_TM, "RETIRED_StudyReadTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1000, 0x0032, 0x1000, + EVR_DA, "RETIRED_ScheduledStudyStartDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1001, 0x0032, 0x1001, + EVR_TM, "RETIRED_ScheduledStudyStartTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1010, 0x0032, 0x1010, + EVR_DA, "RETIRED_ScheduledStudyStopDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1011, 0x0032, 0x1011, + EVR_TM, "RETIRED_ScheduledStudyStopTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1020, 0x0032, 0x1020, + EVR_LO, "RETIRED_ScheduledStudyLocation", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1021, 0x0032, 0x1021, + EVR_AE, "RETIRED_ScheduledStudyLocationAETitle", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1030, 0x0032, 0x1030, + EVR_LO, "RETIRED_ReasonForStudy", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1031, 0x0032, 0x1031, + EVR_SQ, "RequestingPhysicianIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1032, 0x0032, 0x1032, + EVR_PN, "RequestingPhysician", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1033, 0x0032, 0x1033, + EVR_LO, "RequestingService", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1034, 0x0032, 0x1034, + EVR_SQ, "RequestingServiceCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1040, 0x0032, 0x1040, + EVR_DA, "RETIRED_StudyArrivalDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1041, 0x0032, 0x1041, + EVR_TM, "RETIRED_StudyArrivalTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1050, 0x0032, 0x1050, + EVR_DA, "RETIRED_StudyCompletionDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1051, 0x0032, 0x1051, + EVR_TM, "RETIRED_StudyCompletionTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1055, 0x0032, 0x1055, + EVR_CS, "RETIRED_StudyComponentStatusID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1060, 0x0032, 0x1060, + EVR_LO, "RequestedProcedureDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1064, 0x0032, 0x1064, + EVR_SQ, "RequestedProcedureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1066, 0x0032, 0x1066, + EVR_UT, "ReasonForVisit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1067, 0x0032, 0x1067, + EVR_SQ, "ReasonForVisitCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x1070, 0x0032, 0x1070, + EVR_LO, "RequestedContrastAgent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0032, 0x4000, 0x0032, 0x4000, + EVR_LT, "RETIRED_StudyComments", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0033, 0x0001, 0x0033, 0x0001, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GNHD_01" } + , { 0x0033, 0x0002, 0x0033, 0x0002, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_CTHD_01" } + , { 0x0033, 0x0002, 0x0033, 0x0002, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_GNHD_01" } + , { 0x0033, 0x0005, 0x0033, 0x0005, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_YMHD_01" } + , { 0x0033, 0x0006, 0x0033, 0x0006, + EVR_UN, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_YMHD_01" } + , { 0x0033, 0x0010, 0x0033, 0x0010, + EVR_LT, "PatientStudyUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS RIS" } + , { 0x0037, 0x0010, 0x0037, 0x0010, + EVR_LO, "ReferringDepartment", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_DRS_1" } + , { 0x0037, 0x0020, 0x0037, 0x0020, + EVR_US, "ScreenNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_DRS_1" } + , { 0x0037, 0x0040, 0x0037, 0x0040, + EVR_SH, "LeftOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_DRS_1" } + , { 0x0037, 0x0042, 0x0037, 0x0042, + EVR_SH, "RightOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_DRS_1" } + , { 0x0037, 0x0050, 0x0037, 0x0050, + EVR_CS, "Inversion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_DRS_1" } + , { 0x0037, 0x0060, 0x0037, 0x0060, + EVR_US, "DSA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_DRS_1" } +#endif + , { 0x0038, 0x0004, 0x0038, 0x0004, + EVR_SQ, "ReferencedPatientAliasSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0008, 0x0038, 0x0008, + EVR_CS, "VisitStatusID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0010, 0x0038, 0x0010, + EVR_LO, "AdmissionID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0011, 0x0038, 0x0011, + EVR_LO, "RETIRED_IssuerOfAdmissionID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0014, 0x0038, 0x0014, + EVR_SQ, "IssuerOfAdmissionIDSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0016, 0x0038, 0x0016, + EVR_LO, "RouteOfAdmissions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x001a, 0x0038, 0x001a, + EVR_DA, "RETIRED_ScheduledAdmissionDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x001b, 0x0038, 0x001b, + EVR_TM, "RETIRED_ScheduledAdmissionTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x001c, 0x0038, 0x001c, + EVR_DA, "RETIRED_ScheduledDischargeDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x001d, 0x0038, 0x001d, + EVR_TM, "RETIRED_ScheduledDischargeTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x001e, 0x0038, 0x001e, + EVR_LO, "RETIRED_ScheduledPatientInstitutionResidence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0020, 0x0038, 0x0020, + EVR_DA, "AdmittingDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0021, 0x0038, 0x0021, + EVR_TM, "AdmittingTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0030, 0x0038, 0x0030, + EVR_DA, "RETIRED_DischargeDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0032, 0x0038, 0x0032, + EVR_TM, "RETIRED_DischargeTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0040, 0x0038, 0x0040, + EVR_LO, "RETIRED_DischargeDiagnosisDescription", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0044, 0x0038, 0x0044, + EVR_SQ, "RETIRED_DischargeDiagnosisCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0050, 0x0038, 0x0050, + EVR_LO, "SpecialNeeds", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0060, 0x0038, 0x0060, + EVR_LO, "ServiceEpisodeID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0061, 0x0038, 0x0061, + EVR_LO, "RETIRED_IssuerOfServiceEpisodeID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0062, 0x0038, 0x0062, + EVR_LO, "ServiceEpisodeDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0064, 0x0038, 0x0064, + EVR_SQ, "IssuerOfServiceEpisodeIDSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0100, 0x0038, 0x0100, + EVR_SQ, "PertinentDocumentsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0101, 0x0038, 0x0101, + EVR_SQ, "PertinentResourcesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0102, 0x0038, 0x0102, + EVR_LO, "ResourceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0300, 0x0038, 0x0300, + EVR_LO, "CurrentPatientLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0400, 0x0038, 0x0400, + EVR_LO, "PatientInstitutionResidence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0500, 0x0038, 0x0500, + EVR_LO, "PatientState", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x0502, 0x0038, 0x0502, + EVR_SQ, "PatientClinicalTrialParticipationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0038, 0x4000, 0x0038, 0x4000, + EVR_LT, "VisitComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0039, 0x0080, 0x0039, 0x0080, + EVR_IS, "PrivateEntityNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_DPO" } + , { 0x0039, 0x0085, 0x0039, 0x0085, + EVR_DA, "PrivateEntityDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_DPO" } + , { 0x0039, 0x0090, 0x0039, 0x0090, + EVR_TM, "PrivateEntityTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_DPO" } + , { 0x0039, 0x0095, 0x0039, 0x0095, + EVR_LO, "PrivateEntityLaunchCommand", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_DPO" } + , { 0x0039, 0x00aa, 0x0039, 0x00aa, + EVR_CS, "PrivateEntityType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_DPO" } +#endif + , { 0x003a, 0x0004, 0x003a, 0x0004, + EVR_CS, "WaveformOriginality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0005, 0x003a, 0x0005, + EVR_US, "NumberOfWaveformChannels", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0010, 0x003a, 0x0010, + EVR_UL, "NumberOfWaveformSamples", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x001a, 0x003a, 0x001a, + EVR_DS, "SamplingFrequency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0020, 0x003a, 0x0020, + EVR_SH, "MultiplexGroupLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0200, 0x003a, 0x0200, + EVR_SQ, "ChannelDefinitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0202, 0x003a, 0x0202, + EVR_IS, "WaveformChannelNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0203, 0x003a, 0x0203, + EVR_SH, "ChannelLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0205, 0x003a, 0x0205, + EVR_CS, "ChannelStatus", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0208, 0x003a, 0x0208, + EVR_SQ, "ChannelSourceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0209, 0x003a, 0x0209, + EVR_SQ, "ChannelSourceModifiersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x020a, 0x003a, 0x020a, + EVR_SQ, "SourceWaveformSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x020c, 0x003a, 0x020c, + EVR_LO, "ChannelDerivationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0210, 0x003a, 0x0210, + EVR_DS, "ChannelSensitivity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0211, 0x003a, 0x0211, + EVR_SQ, "ChannelSensitivityUnitsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0212, 0x003a, 0x0212, + EVR_DS, "ChannelSensitivityCorrectionFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0213, 0x003a, 0x0213, + EVR_DS, "ChannelBaseline", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0214, 0x003a, 0x0214, + EVR_DS, "ChannelTimeSkew", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0215, 0x003a, 0x0215, + EVR_DS, "ChannelSampleSkew", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0218, 0x003a, 0x0218, + EVR_DS, "ChannelOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x021a, 0x003a, 0x021a, + EVR_US, "WaveformBitsStored", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0220, 0x003a, 0x0220, + EVR_DS, "FilterLowFrequency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0221, 0x003a, 0x0221, + EVR_DS, "FilterHighFrequency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0222, 0x003a, 0x0222, + EVR_DS, "NotchFilterFrequency", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0223, 0x003a, 0x0223, + EVR_DS, "NotchFilterBandwidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0230, 0x003a, 0x0230, + EVR_FL, "WaveformDataDisplayScale", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0231, 0x003a, 0x0231, + EVR_US, "WaveformDisplayBackgroundCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0240, 0x003a, 0x0240, + EVR_SQ, "WaveformPresentationGroupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0241, 0x003a, 0x0241, + EVR_US, "PresentationGroupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0242, 0x003a, 0x0242, + EVR_SQ, "ChannelDisplaySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0244, 0x003a, 0x0244, + EVR_US, "ChannelRecommendedDisplayCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0245, 0x003a, 0x0245, + EVR_FL, "ChannelPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0246, 0x003a, 0x0246, + EVR_CS, "DisplayShadingFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0247, 0x003a, 0x0247, + EVR_FL, "FractionalChannelDisplayScale", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0248, 0x003a, 0x0248, + EVR_FL, "AbsoluteChannelDisplayScale", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0300, 0x003a, 0x0300, + EVR_SQ, "MultiplexedAudioChannelsDescriptionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0301, 0x003a, 0x0301, + EVR_IS, "ChannelIdentificationCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x003a, 0x0302, 0x003a, 0x0302, + EVR_CS, "ChannelMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0001, 0x0040, 0x0001, + EVR_AE, "ScheduledStationAETitle", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0002, 0x0040, 0x0002, + EVR_DA, "ScheduledProcedureStepStartDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0003, 0x0040, 0x0003, + EVR_TM, "ScheduledProcedureStepStartTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0004, 0x0040, 0x0004, + EVR_DA, "ScheduledProcedureStepEndDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0005, 0x0040, 0x0005, + EVR_TM, "ScheduledProcedureStepEndTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0006, 0x0040, 0x0006, + EVR_PN, "ScheduledPerformingPhysicianName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0007, 0x0040, 0x0007, + EVR_LO, "ScheduledProcedureStepDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0008, 0x0040, 0x0008, + EVR_SQ, "ScheduledProtocolCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0009, 0x0040, 0x0009, + EVR_SH, "ScheduledProcedureStepID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x000a, 0x0040, 0x000a, + EVR_SQ, "StageCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x000b, 0x0040, 0x000b, + EVR_SQ, "ScheduledPerformingPhysicianIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0010, 0x0040, 0x0010, + EVR_SH, "ScheduledStationName", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0011, 0x0040, 0x0011, + EVR_SH, "ScheduledProcedureStepLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0012, 0x0040, 0x0012, + EVR_LO, "PreMedication", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0020, 0x0040, 0x0020, + EVR_CS, "ScheduledProcedureStepStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0026, 0x0040, 0x0026, + EVR_SQ, "OrderPlacerIdentifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0027, 0x0040, 0x0027, + EVR_SQ, "OrderFillerIdentifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0031, 0x0040, 0x0031, + EVR_UT, "LocalNamespaceEntityID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0032, 0x0040, 0x0032, + EVR_UT, "UniversalEntityID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0033, 0x0040, 0x0033, + EVR_CS, "UniversalEntityIDType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0035, 0x0040, 0x0035, + EVR_CS, "IdentifierTypeCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0036, 0x0040, 0x0036, + EVR_SQ, "AssigningFacilitySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0039, 0x0040, 0x0039, + EVR_SQ, "AssigningJurisdictionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x003a, 0x0040, 0x003a, + EVR_SQ, "AssigningAgencyOrDepartmentCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0100, 0x0040, 0x0100, + EVR_SQ, "ScheduledProcedureStepSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0220, 0x0040, 0x0220, + EVR_SQ, "ReferencedNonImageCompositeSOPInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0241, 0x0040, 0x0241, + EVR_AE, "PerformedStationAETitle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0242, 0x0040, 0x0242, + EVR_SH, "PerformedStationName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0243, 0x0040, 0x0243, + EVR_SH, "PerformedLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0244, 0x0040, 0x0244, + EVR_DA, "PerformedProcedureStepStartDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0245, 0x0040, 0x0245, + EVR_TM, "PerformedProcedureStepStartTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0250, 0x0040, 0x0250, + EVR_DA, "PerformedProcedureStepEndDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0251, 0x0040, 0x0251, + EVR_TM, "PerformedProcedureStepEndTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0252, 0x0040, 0x0252, + EVR_CS, "PerformedProcedureStepStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0253, 0x0040, 0x0253, + EVR_SH, "PerformedProcedureStepID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0254, 0x0040, 0x0254, + EVR_LO, "PerformedProcedureStepDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0255, 0x0040, 0x0255, + EVR_LO, "PerformedProcedureTypeDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0260, 0x0040, 0x0260, + EVR_SQ, "PerformedProtocolCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0261, 0x0040, 0x0261, + EVR_CS, "PerformedProtocolType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0270, 0x0040, 0x0270, + EVR_SQ, "ScheduledStepAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0275, 0x0040, 0x0275, + EVR_SQ, "RequestAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0280, 0x0040, 0x0280, + EVR_ST, "CommentsOnThePerformedProcedureStep", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0281, 0x0040, 0x0281, + EVR_SQ, "PerformedProcedureStepDiscontinuationReasonCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0293, 0x0040, 0x0293, + EVR_SQ, "QuantitySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0294, 0x0040, 0x0294, + EVR_DS, "Quantity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0295, 0x0040, 0x0295, + EVR_SQ, "MeasuringUnitsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0296, 0x0040, 0x0296, + EVR_SQ, "BillingItemSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0300, 0x0040, 0x0300, + EVR_US, "RETIRED_TotalTimeOfFluoroscopy", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0301, 0x0040, 0x0301, + EVR_US, "RETIRED_TotalNumberOfExposures", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0302, 0x0040, 0x0302, + EVR_US, "EntranceDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0303, 0x0040, 0x0303, + EVR_US, "ExposedArea", 1, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0306, 0x0040, 0x0306, + EVR_DS, "DistanceSourceToEntrance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0307, 0x0040, 0x0307, + EVR_DS, "RETIRED_DistanceSourceToSupport", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x030e, 0x0040, 0x030e, + EVR_SQ, "RETIRED_ExposureDoseSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0310, 0x0040, 0x0310, + EVR_ST, "CommentsOnRadiationDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0312, 0x0040, 0x0312, + EVR_DS, "XRayOutput", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0314, 0x0040, 0x0314, + EVR_DS, "HalfValueLayer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0316, 0x0040, 0x0316, + EVR_DS, "OrganDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0318, 0x0040, 0x0318, + EVR_CS, "OrganExposed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0320, 0x0040, 0x0320, + EVR_SQ, "BillingProcedureStepSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0321, 0x0040, 0x0321, + EVR_SQ, "FilmConsumptionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0324, 0x0040, 0x0324, + EVR_SQ, "BillingSuppliesAndDevicesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0330, 0x0040, 0x0330, + EVR_SQ, "RETIRED_ReferencedProcedureStepSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0340, 0x0040, 0x0340, + EVR_SQ, "PerformedSeriesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0400, 0x0040, 0x0400, + EVR_LT, "CommentsOnTheScheduledProcedureStep", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0440, 0x0040, 0x0440, + EVR_SQ, "ProtocolContextSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0441, 0x0040, 0x0441, + EVR_SQ, "ContentItemModifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0500, 0x0040, 0x0500, + EVR_SQ, "ScheduledSpecimenSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x050a, 0x0040, 0x050a, + EVR_LO, "RETIRED_SpecimenAccessionNumber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0512, 0x0040, 0x0512, + EVR_LO, "ContainerIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0513, 0x0040, 0x0513, + EVR_SQ, "IssuerOfTheContainerIdentifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0515, 0x0040, 0x0515, + EVR_SQ, "AlternateContainerIdentifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0518, 0x0040, 0x0518, + EVR_SQ, "ContainerTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x051a, 0x0040, 0x051a, + EVR_LO, "ContainerDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0520, 0x0040, 0x0520, + EVR_SQ, "ContainerComponentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0550, 0x0040, 0x0550, + EVR_SQ, "RETIRED_SpecimenSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0551, 0x0040, 0x0551, + EVR_LO, "SpecimenIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0552, 0x0040, 0x0552, + EVR_SQ, "RETIRED_SpecimenDescriptionSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0553, 0x0040, 0x0553, + EVR_ST, "RETIRED_SpecimenDescriptionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0554, 0x0040, 0x0554, + EVR_UI, "SpecimenUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0555, 0x0040, 0x0555, + EVR_SQ, "AcquisitionContextSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0556, 0x0040, 0x0556, + EVR_ST, "AcquisitionContextDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0560, 0x0040, 0x0560, + EVR_SQ, "SpecimenDescriptionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0562, 0x0040, 0x0562, + EVR_SQ, "IssuerOfTheSpecimenIdentifierSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x059a, 0x0040, 0x059a, + EVR_SQ, "SpecimenTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0600, 0x0040, 0x0600, + EVR_LO, "SpecimenShortDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0602, 0x0040, 0x0602, + EVR_UT, "SpecimenDetailedDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0610, 0x0040, 0x0610, + EVR_SQ, "SpecimenPreparationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0612, 0x0040, 0x0612, + EVR_SQ, "SpecimenPreparationStepContentItemSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0620, 0x0040, 0x0620, + EVR_SQ, "SpecimenLocalizationContentItemSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x06fa, 0x0040, 0x06fa, + EVR_LO, "RETIRED_SlideIdentifier", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x0710, 0x0040, 0x0710, + EVR_SQ, "WholeSlideMicroscopyImageFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x071a, 0x0040, 0x071a, + EVR_SQ, "ImageCenterPointCoordinatesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x072a, 0x0040, 0x072a, + EVR_DS, "XOffsetInSlideCoordinateSystem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x073a, 0x0040, 0x073a, + EVR_DS, "YOffsetInSlideCoordinateSystem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x074a, 0x0040, 0x074a, + EVR_DS, "ZOffsetInSlideCoordinateSystem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x08d8, 0x0040, 0x08d8, + EVR_SQ, "RETIRED_PixelSpacingSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x08da, 0x0040, 0x08da, + EVR_SQ, "RETIRED_CoordinateSystemAxisCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x08ea, 0x0040, 0x08ea, + EVR_SQ, "MeasurementUnitsCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x09f8, 0x0040, 0x09f8, + EVR_SQ, "RETIRED_VitalStainCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1001, 0x0040, 0x1001, + EVR_SH, "RequestedProcedureID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1002, 0x0040, 0x1002, + EVR_LO, "ReasonForTheRequestedProcedure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1003, 0x0040, 0x1003, + EVR_SH, "RequestedProcedurePriority", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1004, 0x0040, 0x1004, + EVR_LO, "PatientTransportArrangements", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1005, 0x0040, 0x1005, + EVR_LO, "RequestedProcedureLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1006, 0x0040, 0x1006, + EVR_SH, "RETIRED_PlacerOrderNumberProcedure", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1007, 0x0040, 0x1007, + EVR_SH, "RETIRED_FillerOrderNumberProcedure", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1008, 0x0040, 0x1008, + EVR_LO, "ConfidentialityCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1009, 0x0040, 0x1009, + EVR_SH, "ReportingPriority", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x100a, 0x0040, 0x100a, + EVR_SQ, "ReasonForRequestedProcedureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1010, 0x0040, 0x1010, + EVR_PN, "NamesOfIntendedRecipientsOfResults", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1011, 0x0040, 0x1011, + EVR_SQ, "IntendedRecipientsOfResultsIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1012, 0x0040, 0x1012, + EVR_SQ, "ReasonForPerformedProcedureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1060, 0x0040, 0x1060, + EVR_LO, "RETIRED_RequestedProcedureDescriptionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1101, 0x0040, 0x1101, + EVR_SQ, "PersonIdentificationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1102, 0x0040, 0x1102, + EVR_ST, "PersonAddress", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1103, 0x0040, 0x1103, + EVR_LO, "PersonTelephoneNumbers", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1104, 0x0040, 0x1104, + EVR_LT, "PersonTelecomInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x1400, 0x0040, 0x1400, + EVR_LT, "RequestedProcedureComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2001, 0x0040, 0x2001, + EVR_LO, "RETIRED_ReasonForTheImagingServiceRequest", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2004, 0x0040, 0x2004, + EVR_DA, "IssueDateOfImagingServiceRequest", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2005, 0x0040, 0x2005, + EVR_TM, "IssueTimeOfImagingServiceRequest", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2006, 0x0040, 0x2006, + EVR_SH, "RETIRED_PlacerOrderNumberImagingServiceRequestRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2007, 0x0040, 0x2007, + EVR_SH, "RETIRED_FillerOrderNumberImagingServiceRequestRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2008, 0x0040, 0x2008, + EVR_PN, "OrderEnteredBy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2009, 0x0040, 0x2009, + EVR_SH, "OrderEntererLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2010, 0x0040, 0x2010, + EVR_SH, "OrderCallbackPhoneNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2011, 0x0040, 0x2011, + EVR_LT, "OrderCallbackTelecomInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2016, 0x0040, 0x2016, + EVR_LO, "PlacerOrderNumberImagingServiceRequest", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2017, 0x0040, 0x2017, + EVR_LO, "FillerOrderNumberImagingServiceRequest", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x2400, 0x0040, 0x2400, + EVR_LT, "ImagingServiceRequestComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x3001, 0x0040, 0x3001, + EVR_LO, "ConfidentialityConstraintOnPatientDataDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4001, 0x0040, 0x4001, + EVR_CS, "RETIRED_GeneralPurposeScheduledProcedureStepStatus", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4002, 0x0040, 0x4002, + EVR_CS, "RETIRED_GeneralPurposePerformedProcedureStepStatus", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4003, 0x0040, 0x4003, + EVR_CS, "RETIRED_GeneralPurposeScheduledProcedureStepPriority", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4004, 0x0040, 0x4004, + EVR_SQ, "RETIRED_ScheduledProcessingApplicationsCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4005, 0x0040, 0x4005, + EVR_DT, "ScheduledProcedureStepStartDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4006, 0x0040, 0x4006, + EVR_CS, "RETIRED_MultipleCopiesFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4007, 0x0040, 0x4007, + EVR_SQ, "RETIRED_PerformedProcessingApplicationsCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4008, 0x0040, 0x4008, + EVR_DT, "ScheduledProcedureStepExpirationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4009, 0x0040, 0x4009, + EVR_SQ, "HumanPerformerCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4010, 0x0040, 0x4010, + EVR_DT, "ScheduledProcedureStepModificationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4011, 0x0040, 0x4011, + EVR_DT, "ExpectedCompletionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4015, 0x0040, 0x4015, + EVR_SQ, "RETIRED_ResultingGeneralPurposePerformedProcedureStepsSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4016, 0x0040, 0x4016, + EVR_SQ, "RETIRED_ReferencedGeneralPurposeScheduledProcedureStepSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4018, 0x0040, 0x4018, + EVR_SQ, "ScheduledWorkitemCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4019, 0x0040, 0x4019, + EVR_SQ, "PerformedWorkitemCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4020, 0x0040, 0x4020, + EVR_CS, "RETIRED_InputAvailabilityFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4021, 0x0040, 0x4021, + EVR_SQ, "InputInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4022, 0x0040, 0x4022, + EVR_SQ, "RETIRED_RelevantInformationSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4023, 0x0040, 0x4023, + EVR_UI, "RETIRED_ReferencedGeneralPurposeScheduledProcedureStepTransactionUID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4025, 0x0040, 0x4025, + EVR_SQ, "ScheduledStationNameCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4026, 0x0040, 0x4026, + EVR_SQ, "ScheduledStationClassCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4027, 0x0040, 0x4027, + EVR_SQ, "ScheduledStationGeographicLocationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4028, 0x0040, 0x4028, + EVR_SQ, "PerformedStationNameCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4029, 0x0040, 0x4029, + EVR_SQ, "PerformedStationClassCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4030, 0x0040, 0x4030, + EVR_SQ, "PerformedStationGeographicLocationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4031, 0x0040, 0x4031, + EVR_SQ, "RETIRED_RequestedSubsequentWorkitemCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4032, 0x0040, 0x4032, + EVR_SQ, "RETIRED_NonDICOMOutputCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4033, 0x0040, 0x4033, + EVR_SQ, "OutputInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4034, 0x0040, 0x4034, + EVR_SQ, "ScheduledHumanPerformersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4035, 0x0040, 0x4035, + EVR_SQ, "ActualHumanPerformersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4036, 0x0040, 0x4036, + EVR_LO, "HumanPerformerOrganization", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4037, 0x0040, 0x4037, + EVR_PN, "HumanPerformerName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4040, 0x0040, 0x4040, + EVR_CS, "RawDataHandling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4041, 0x0040, 0x4041, + EVR_CS, "InputReadinessState", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4050, 0x0040, 0x4050, + EVR_DT, "PerformedProcedureStepStartDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4051, 0x0040, 0x4051, + EVR_DT, "PerformedProcedureStepEndDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4052, 0x0040, 0x4052, + EVR_DT, "ProcedureStepCancellationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4070, 0x0040, 0x4070, + EVR_SQ, "OutputDestinationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4071, 0x0040, 0x4071, + EVR_SQ, "DICOMStorageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4072, 0x0040, 0x4072, + EVR_SQ, "STOWRSStorageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4073, 0x0040, 0x4073, + EVR_UR, "StorageURL", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x4074, 0x0040, 0x4074, + EVR_SQ, "XDSStorageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x8302, 0x0040, 0x8302, + EVR_DS, "EntranceDoseInmGy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x8303, 0x0040, 0x8303, + EVR_CS, "EntranceDoseDerivation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9092, 0x0040, 0x9092, + EVR_SQ, "ParametricMapFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9094, 0x0040, 0x9094, + EVR_SQ, "ReferencedImageRealWorldValueMappingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9096, 0x0040, 0x9096, + EVR_SQ, "RealWorldValueMappingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9098, 0x0040, 0x9098, + EVR_SQ, "PixelValueMappingCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9210, 0x0040, 0x9210, + EVR_SH, "LUTLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9211, 0x0040, 0x9211, + EVR_xs, "RealWorldValueLastValueMapped", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9212, 0x0040, 0x9212, + EVR_FD, "RealWorldValueLUTData", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9213, 0x0040, 0x9213, + EVR_FD, "DoubleFloatRealWorldValueLastValueMapped", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9214, 0x0040, 0x9214, + EVR_FD, "DoubleFloatRealWorldValueFirstValueMapped", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9216, 0x0040, 0x9216, + EVR_xs, "RealWorldValueFirstValueMapped", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9220, 0x0040, 0x9220, + EVR_SQ, "QuantityDefinitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9224, 0x0040, 0x9224, + EVR_FD, "RealWorldValueIntercept", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0x9225, 0x0040, 0x9225, + EVR_FD, "RealWorldValueSlope", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa007, 0x0040, 0xa007, + EVR_CS, "RETIRED_FindingsFlagTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa010, 0x0040, 0xa010, + EVR_CS, "RelationshipType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa020, 0x0040, 0xa020, + EVR_SQ, "RETIRED_FindingsSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa021, 0x0040, 0xa021, + EVR_UI, "RETIRED_FindingsGroupUIDTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa022, 0x0040, 0xa022, + EVR_UI, "RETIRED_ReferencedFindingsGroupUIDTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa023, 0x0040, 0xa023, + EVR_DA, "RETIRED_FindingsGroupRecordingDateTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa024, 0x0040, 0xa024, + EVR_TM, "RETIRED_FindingsGroupRecordingTimeTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa026, 0x0040, 0xa026, + EVR_SQ, "RETIRED_FindingsSourceCategoryCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa027, 0x0040, 0xa027, + EVR_LO, "VerifyingOrganization", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa028, 0x0040, 0xa028, + EVR_SQ, "RETIRED_DocumentingOrganizationIdentifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa030, 0x0040, 0xa030, + EVR_DT, "VerificationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa032, 0x0040, 0xa032, + EVR_DT, "ObservationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa040, 0x0040, 0xa040, + EVR_CS, "ValueType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa043, 0x0040, 0xa043, + EVR_SQ, "ConceptNameCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa047, 0x0040, 0xa047, + EVR_LO, "RETIRED_MeasurementPrecisionDescriptionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa050, 0x0040, 0xa050, + EVR_CS, "ContinuityOfContent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa057, 0x0040, 0xa057, + EVR_CS, "RETIRED_UrgencyOrPriorityAlertsTrial", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa060, 0x0040, 0xa060, + EVR_LO, "RETIRED_SequencingIndicatorTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa066, 0x0040, 0xa066, + EVR_SQ, "RETIRED_DocumentIdentifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa067, 0x0040, 0xa067, + EVR_PN, "RETIRED_DocumentAuthorTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa068, 0x0040, 0xa068, + EVR_SQ, "RETIRED_DocumentAuthorIdentifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa070, 0x0040, 0xa070, + EVR_SQ, "RETIRED_IdentifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa073, 0x0040, 0xa073, + EVR_SQ, "VerifyingObserverSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa074, 0x0040, 0xa074, + EVR_OB, "RETIRED_ObjectBinaryIdentifierTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa075, 0x0040, 0xa075, + EVR_PN, "VerifyingObserverName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa076, 0x0040, 0xa076, + EVR_SQ, "RETIRED_DocumentingObserverIdentifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa078, 0x0040, 0xa078, + EVR_SQ, "AuthorObserverSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa07a, 0x0040, 0xa07a, + EVR_SQ, "ParticipantSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa07c, 0x0040, 0xa07c, + EVR_SQ, "CustodialOrganizationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa080, 0x0040, 0xa080, + EVR_CS, "ParticipationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa082, 0x0040, 0xa082, + EVR_DT, "ParticipationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa084, 0x0040, 0xa084, + EVR_CS, "ObserverType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa085, 0x0040, 0xa085, + EVR_SQ, "RETIRED_ProcedureIdentifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa088, 0x0040, 0xa088, + EVR_SQ, "VerifyingObserverIdentificationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa089, 0x0040, 0xa089, + EVR_OB, "RETIRED_ObjectDirectoryBinaryIdentifierTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa090, 0x0040, 0xa090, + EVR_SQ, "RETIRED_EquivalentCDADocumentSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa0b0, 0x0040, 0xa0b0, + EVR_US, "ReferencedWaveformChannels", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa110, 0x0040, 0xa110, + EVR_DA, "RETIRED_DateOfDocumentOrVerbalTransactionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa112, 0x0040, 0xa112, + EVR_TM, "RETIRED_TimeOfDocumentCreationOrVerbalTransactionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa120, 0x0040, 0xa120, + EVR_DT, "DateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa121, 0x0040, 0xa121, + EVR_DA, "Date", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa122, 0x0040, 0xa122, + EVR_TM, "Time", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa123, 0x0040, 0xa123, + EVR_PN, "PersonName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa124, 0x0040, 0xa124, + EVR_UI, "UID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa125, 0x0040, 0xa125, + EVR_CS, "RETIRED_ReportStatusIDTrial", 2, 2, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa130, 0x0040, 0xa130, + EVR_CS, "TemporalRangeType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa132, 0x0040, 0xa132, + EVR_UL, "ReferencedSamplePositions", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa136, 0x0040, 0xa136, + EVR_US, "RETIRED_ReferencedFrameNumbers", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa138, 0x0040, 0xa138, + EVR_DS, "ReferencedTimeOffsets", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa13a, 0x0040, 0xa13a, + EVR_DT, "ReferencedDateTime", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa160, 0x0040, 0xa160, + EVR_UT, "TextValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa161, 0x0040, 0xa161, + EVR_FD, "FloatingPointValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa162, 0x0040, 0xa162, + EVR_SL, "RationalNumeratorValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa163, 0x0040, 0xa163, + EVR_UL, "RationalDenominatorValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa167, 0x0040, 0xa167, + EVR_SQ, "RETIRED_ObservationCategoryCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa168, 0x0040, 0xa168, + EVR_SQ, "ConceptCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa16a, 0x0040, 0xa16a, + EVR_ST, "RETIRED_BibliographicCitationTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa170, 0x0040, 0xa170, + EVR_SQ, "PurposeOfReferenceCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa171, 0x0040, 0xa171, + EVR_UI, "ObservationUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa172, 0x0040, 0xa172, + EVR_UI, "RETIRED_ReferencedObservationUIDTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa173, 0x0040, 0xa173, + EVR_CS, "RETIRED_ReferencedObservationClassTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa174, 0x0040, 0xa174, + EVR_CS, "RETIRED_ReferencedObjectObservationClassTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa180, 0x0040, 0xa180, + EVR_US, "AnnotationGroupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa192, 0x0040, 0xa192, + EVR_DA, "RETIRED_ObservationDateTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa193, 0x0040, 0xa193, + EVR_TM, "RETIRED_ObservationTimeTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa194, 0x0040, 0xa194, + EVR_CS, "RETIRED_MeasurementAutomationTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa195, 0x0040, 0xa195, + EVR_SQ, "ModifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa224, 0x0040, 0xa224, + EVR_ST, "RETIRED_IdentificationDescriptionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa290, 0x0040, 0xa290, + EVR_CS, "RETIRED_CoordinatesSetGeometricTypeTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa296, 0x0040, 0xa296, + EVR_SQ, "RETIRED_AlgorithmCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa297, 0x0040, 0xa297, + EVR_ST, "RETIRED_AlgorithmDescriptionTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa29a, 0x0040, 0xa29a, + EVR_SL, "RETIRED_PixelCoordinatesSetTrial", 2, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa300, 0x0040, 0xa300, + EVR_SQ, "MeasuredValueSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa301, 0x0040, 0xa301, + EVR_SQ, "NumericValueQualifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa307, 0x0040, 0xa307, + EVR_PN, "RETIRED_CurrentObserverTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa30a, 0x0040, 0xa30a, + EVR_DS, "NumericValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa313, 0x0040, 0xa313, + EVR_SQ, "RETIRED_ReferencedAccessionSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa33a, 0x0040, 0xa33a, + EVR_ST, "RETIRED_ReportStatusCommentTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa340, 0x0040, 0xa340, + EVR_SQ, "RETIRED_ProcedureContextSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa352, 0x0040, 0xa352, + EVR_PN, "RETIRED_VerbalSourceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa353, 0x0040, 0xa353, + EVR_ST, "RETIRED_AddressTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa354, 0x0040, 0xa354, + EVR_LO, "RETIRED_TelephoneNumberTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa358, 0x0040, 0xa358, + EVR_SQ, "RETIRED_VerbalSourceIdentifierCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa360, 0x0040, 0xa360, + EVR_SQ, "PredecessorDocumentsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa370, 0x0040, 0xa370, + EVR_SQ, "ReferencedRequestSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa372, 0x0040, 0xa372, + EVR_SQ, "PerformedProcedureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa375, 0x0040, 0xa375, + EVR_SQ, "CurrentRequestedProcedureEvidenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa380, 0x0040, 0xa380, + EVR_SQ, "RETIRED_ReportDetailSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa385, 0x0040, 0xa385, + EVR_SQ, "PertinentOtherEvidenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa390, 0x0040, 0xa390, + EVR_SQ, "HL7StructuredDocumentReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa402, 0x0040, 0xa402, + EVR_UI, "RETIRED_ObservationSubjectUIDTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa403, 0x0040, 0xa403, + EVR_CS, "RETIRED_ObservationSubjectClassTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa404, 0x0040, 0xa404, + EVR_SQ, "RETIRED_ObservationSubjectTypeCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa491, 0x0040, 0xa491, + EVR_CS, "CompletionFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa492, 0x0040, 0xa492, + EVR_LO, "CompletionFlagDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa493, 0x0040, 0xa493, + EVR_CS, "VerificationFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa494, 0x0040, 0xa494, + EVR_CS, "ArchiveRequested", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa496, 0x0040, 0xa496, + EVR_CS, "PreliminaryFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa504, 0x0040, 0xa504, + EVR_SQ, "ContentTemplateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa525, 0x0040, 0xa525, + EVR_SQ, "IdenticalDocumentsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa600, 0x0040, 0xa600, + EVR_CS, "RETIRED_ObservationSubjectContextFlagTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa601, 0x0040, 0xa601, + EVR_CS, "RETIRED_ObserverContextFlagTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa603, 0x0040, 0xa603, + EVR_CS, "RETIRED_ProcedureContextFlagTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa730, 0x0040, 0xa730, + EVR_SQ, "ContentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa731, 0x0040, 0xa731, + EVR_SQ, "RETIRED_RelationshipSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa732, 0x0040, 0xa732, + EVR_SQ, "RETIRED_RelationshipTypeCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa744, 0x0040, 0xa744, + EVR_SQ, "RETIRED_LanguageCodeSequenceTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xa992, 0x0040, 0xa992, + EVR_ST, "RETIRED_UniformResourceLocatorTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xb020, 0x0040, 0xb020, + EVR_SQ, "WaveformAnnotationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xdb00, 0x0040, 0xdb00, + EVR_CS, "TemplateIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xdb06, 0x0040, 0xdb06, + EVR_DT, "RETIRED_TemplateVersion", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xdb07, 0x0040, 0xdb07, + EVR_DT, "RETIRED_TemplateLocalVersion", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xdb0b, 0x0040, 0xdb0b, + EVR_CS, "RETIRED_TemplateExtensionFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xdb0c, 0x0040, 0xdb0c, + EVR_UI, "RETIRED_TemplateExtensionOrganizationUID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xdb0d, 0x0040, 0xdb0d, + EVR_UI, "RETIRED_TemplateExtensionCreatorUID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xdb73, 0x0040, 0xdb73, + EVR_UL, "ReferencedContentItemIdentifier", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe001, 0x0040, 0xe001, + EVR_ST, "HL7InstanceIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe004, 0x0040, 0xe004, + EVR_DT, "HL7DocumentEffectiveTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe006, 0x0040, 0xe006, + EVR_SQ, "HL7DocumentTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe008, 0x0040, 0xe008, + EVR_SQ, "DocumentClassCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe010, 0x0040, 0xe010, + EVR_UR, "RetrieveURI", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe011, 0x0040, 0xe011, + EVR_UI, "RetrieveLocationUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe020, 0x0040, 0xe020, + EVR_CS, "TypeOfInstances", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe021, 0x0040, 0xe021, + EVR_SQ, "DICOMRetrievalSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe022, 0x0040, 0xe022, + EVR_SQ, "DICOMMediaRetrievalSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe023, 0x0040, 0xe023, + EVR_SQ, "WADORetrievalSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe024, 0x0040, 0xe024, + EVR_SQ, "XDSRetrievalSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe025, 0x0040, 0xe025, + EVR_SQ, "WADORSRetrievalSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe030, 0x0040, 0xe030, + EVR_UI, "RepositoryUniqueID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0040, 0xe031, 0x0040, 0xe031, + EVR_UI, "HomeCommunityID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0041, 0x0000, 0x0041, 0x0000, + EVR_LT, "PapyrusComments", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0000, 0x0041, 0x0000, + EVR_LT, "PapyrusComments", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0010, 0x0041, 0x0010, + EVR_SQ, "PointerSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0010, 0x0041, 0x0010, + EVR_US, "FolderType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0010, 0x0041, 0x0010, + EVR_US, "NumberOfHardcopies", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0041, 0x0011, 0x0041, 0x0011, + EVR_UL, "ImagePointer", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0011, 0x0041, 0x0011, + EVR_LT, "PatientFolderDataSetID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0012, 0x0041, 0x0012, + EVR_UL, "PixelOffset", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0013, 0x0041, 0x0013, + EVR_SQ, "ImageIdentifierSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0014, 0x0041, 0x0014, + EVR_SQ, "ExternalFileReferenceSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0015, 0x0041, 0x0015, + EVR_US, "NumberOfImages", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0020, 0x0041, 0x0020, + EVR_LT, "FolderName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0020, 0x0041, 0x0020, + EVR_LT, "FilmFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0041, 0x0020, 0x0041, 0x0020, + EVR_FL, "AccumulatedFluoroscopyDose", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0041, 0x0021, 0x0041, 0x0021, + EVR_UI, "ReferencedSOPClassUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0022, 0x0041, 0x0022, + EVR_UI, "ReferencedSOPInstanceUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0030, 0x0041, 0x0030, + EVR_DA, "CreationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0030, 0x0041, 0x0030, + EVR_LT, "FilmSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0041, 0x0030, 0x0041, 0x0030, + EVR_FL, "AccumulatedExposureDose", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0041, 0x0031, 0x0041, 0x0031, + EVR_LT, "ReferencedFileName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0031, 0x0041, 0x0031, + EVR_LT, "FullFilmFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS DLR.01" } + , { 0x0041, 0x0032, 0x0041, 0x0032, + EVR_LT, "ReferencedFilePath", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0032, 0x0041, 0x0032, + EVR_TM, "CreationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0034, 0x0041, 0x0034, + EVR_DA, "ModifiedDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0036, 0x0041, 0x0036, + EVR_TM, "ModifiedTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0040, 0x0041, 0x0040, + EVR_LT, "OwnerName", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0040, 0x0041, 0x0040, + EVR_FL, "TotalDose", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0041, 0x0041, 0x0041, 0x0041, + EVR_UI, "ReferencedImageSOPClassUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0041, 0x0041, 0x0041, + EVR_FL, "TotalNumberOfFrames", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0041, 0x0042, 0x0041, 0x0042, + EVR_UI, "ReferencedImageSOPInstanceUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0050, 0x0041, 0x0050, + EVR_SQ, "ImageSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x0041, 0x0050, 0x0041, 0x0050, + EVR_LT, "FolderStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0050, 0x0041, 0x0050, + EVR_SQ, "ExposureInformationSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTEGRIS 1.0" } + , { 0x0041, 0x0060, 0x0041, 0x0060, + EVR_UL, "NumberOfImages", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x0062, 0x0041, 0x0062, + EVR_UL, "NumberOfOther", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00a0, 0x0041, 0x00a0, + EVR_LT, "ExternalFolderElementDSID", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00a1, 0x0041, 0x00a1, + EVR_US, "ExternalFolderElementDataSetType", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00a2, 0x0041, 0x00a2, + EVR_LT, "ExternalFolderElementFileLocation", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00a3, 0x0041, 0x00a3, + EVR_UL, "ExternalFolderElementLength", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00b0, 0x0041, 0x00b0, + EVR_LT, "InternalFolderElementDSID", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00b1, 0x0041, 0x00b1, + EVR_US, "InternalFolderElementDataSetType", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00b2, 0x0041, 0x00b2, + EVR_UL, "InternalOffsetToDataSet", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } + , { 0x0041, 0x00b3, 0x0041, 0x00b3, + EVR_UL, "InternalOffsetToImage", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PAPYRUS" } +#endif + , { 0x0042, 0x0010, 0x0042, 0x0010, + EVR_ST, "DocumentTitle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0042, 0x0011, 0x0042, 0x0011, + EVR_OB, "EncapsulatedDocument", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0042, 0x0012, 0x0042, 0x0012, + EVR_LO, "MIMETypeOfEncapsulatedDocument", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0042, 0x0013, 0x0042, 0x0013, + EVR_SQ, "SourceInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0042, 0x0014, 0x0042, 0x0014, + EVR_LO, "ListOfMIMETypes", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0042, 0x0015, 0x0042, 0x0015, + EVR_UL, "EncapsulatedDocumentLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0043, 0x0001, 0x0043, 0x0001, + EVR_SS, "BitmapOfPrescanOptions", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0002, 0x0043, 0x0002, + EVR_SS, "GradientOffsetInX", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0003, 0x0043, 0x0003, + EVR_SS, "GradientOffsetInY", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0004, 0x0043, 0x0004, + EVR_SS, "GradientOffsetInZ", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0005, 0x0043, 0x0005, + EVR_SS, "ImageIsOriginalOrUnoriginal", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0006, 0x0043, 0x0006, + EVR_SS, "NumberOfEPIShots", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0007, 0x0043, 0x0007, + EVR_SS, "ViewsPerSegment", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0008, 0x0043, 0x0008, + EVR_SS, "RespiratoryRateInBPM", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0009, 0x0043, 0x0009, + EVR_SS, "RespiratoryTriggerPoint", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x000a, 0x0043, 0x000a, + EVR_SS, "TypeOfReceiverUsed", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x000b, 0x0043, 0x000b, + EVR_DS, "PeakRateOfChangeOfGradientField", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x000c, 0x0043, 0x000c, + EVR_DS, "LimitsInUnitsOfPercent", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x000d, 0x0043, 0x000d, + EVR_DS, "PSDEstimatedLimit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x000e, 0x0043, 0x000e, + EVR_DS, "PSDEstimatedLimitInTeslaPerSecond", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x000f, 0x0043, 0x000f, + EVR_DS, "SARAvgHead", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0010, 0x0043, 0x0010, + EVR_US, "WindowValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0011, 0x0043, 0x0011, + EVR_US, "TotalInputViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0012, 0x0043, 0x0012, + EVR_SS, "XrayChain", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0013, 0x0043, 0x0013, + EVR_SS, "ReconKernelParameters", 5, 5, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0014, 0x0043, 0x0014, + EVR_SS, "CalibrationParameters", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0015, 0x0043, 0x0015, + EVR_SS, "TotalOutputViews", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0016, 0x0043, 0x0016, + EVR_SS, "NumberOfOverranges", 5, 5, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0017, 0x0043, 0x0017, + EVR_DS, "IBHImageScaleFactors", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0018, 0x0043, 0x0018, + EVR_DS, "BBHCoefficients", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0019, 0x0043, 0x0019, + EVR_SS, "NumberOfBBHChainsToBlend", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x001a, 0x0043, 0x001a, + EVR_SL, "StartingChannelNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x001b, 0x0043, 0x001b, + EVR_SS, "PPScanParameters", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x001c, 0x0043, 0x001c, + EVR_SS, "GEImageIntegrity", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x001d, 0x0043, 0x001d, + EVR_SS, "LevelValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x001e, 0x0043, 0x001e, + EVR_DS, "DeltaStartTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0043, 0x001e, 0x0043, 0x001e, + EVR_DS, "DeltaStartTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x001f, 0x0043, 0x001f, + EVR_SL, "MaxOverrangesInAView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0020, 0x0043, 0x0020, + EVR_DS, "AvgOverrangesAllViews", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0021, 0x0043, 0x0021, + EVR_SS, "CorrectedAfterglowTerms", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0025, 0x0043, 0x0025, + EVR_SS, "ReferenceChannels", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0026, 0x0043, 0x0026, + EVR_US, "NoViewsRefChannelsBlocked", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0027, 0x0043, 0x0027, + EVR_SH, "ScanPitchRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GE_GENESIS_REV3.0" } + , { 0x0043, 0x0027, 0x0043, 0x0027, + EVR_SH, "ScanPitchRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0028, 0x0043, 0x0028, + EVR_OB, "UniqueImageIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0029, 0x0043, 0x0029, + EVR_OB, "HistogramTables", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x002a, 0x0043, 0x002a, + EVR_OB, "UserDefinedData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x002b, 0x0043, 0x002b, + EVR_SS, "PrivateScanOptions", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x002c, 0x0043, 0x002c, + EVR_SS, "EffectiveEchoSpacing", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x002d, 0x0043, 0x002d, + EVR_SH, "StringSlopField1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x002e, 0x0043, 0x002e, + EVR_SH, "StringSlopField2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x002f, 0x0043, 0x002f, + EVR_SS, "RawDataType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0030, 0x0043, 0x0030, + EVR_SS, "RawDataType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0031, 0x0043, 0x0031, + EVR_DS, "RACoordOfTargetReconCentre", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0032, 0x0043, 0x0032, + EVR_SS, "RawDataType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0033, 0x0043, 0x0033, + EVR_FL, "NegScanSpacing", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0034, 0x0043, 0x0034, + EVR_IS, "OffsetFrequency", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0035, 0x0043, 0x0035, + EVR_UL, "UserUsageTag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0036, 0x0043, 0x0036, + EVR_UL, "UserFillMapMSW", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0037, 0x0043, 0x0037, + EVR_UL, "UserFillMapLSW", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0038, 0x0043, 0x0038, + EVR_FL, "User25ToUser48", 24, 24, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0039, 0x0043, 0x0039, + EVR_IS, "SlopInteger6ToSlopInteger9", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0040, 0x0043, 0x0040, + EVR_FL, "TriggerOnPosition", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0041, 0x0043, 0x0041, + EVR_FL, "DegreeOfRotation", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0042, 0x0043, 0x0042, + EVR_SL, "DASTriggerSource", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0043, 0x0043, 0x0043, + EVR_SL, "DASFpaGain", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0044, 0x0043, 0x0044, + EVR_SL, "DASOutputSource", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0045, 0x0043, 0x0045, + EVR_SL, "DASAdInput", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0046, 0x0043, 0x0046, + EVR_SL, "DASCalMode", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0047, 0x0043, 0x0047, + EVR_SL, "DASCalFrequency", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0048, 0x0043, 0x0048, + EVR_SL, "DASRegXm", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0049, 0x0043, 0x0049, + EVR_SL, "DASAutoZero", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x004a, 0x0043, 0x004a, + EVR_SS, "StartingChannelOfView", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x004b, 0x0043, 0x004b, + EVR_SL, "DASXmPattern", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x004c, 0x0043, 0x004c, + EVR_SS, "TGGCTriggerMode", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x004d, 0x0043, 0x004d, + EVR_FL, "StartScanToXrayOnDelay", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x004e, 0x0043, 0x004e, + EVR_FL, "DurationOfXrayOn", 4, 4, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0060, 0x0043, 0x0060, + EVR_IS, "SlopInteger10ToSlopInteger17", 8, 8, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0061, 0x0043, 0x0061, + EVR_UI, "ScannerStudyEntityUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0062, 0x0043, 0x0062, + EVR_SH, "ScannerStudyID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x006f, 0x0043, 0x006f, + EVR_DS, "ScannerTableEntry", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0070, 0x0043, 0x0070, + EVR_LO, "ParadigmName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0071, 0x0043, 0x0071, + EVR_ST, "ParadigmDescription", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0072, 0x0043, 0x0072, + EVR_UI, "ParadigmUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0073, 0x0043, 0x0073, + EVR_US, "ExperimentType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0074, 0x0043, 0x0074, + EVR_US, "NumberOfRestVolumes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0075, 0x0043, 0x0075, + EVR_US, "NumberOfActiveVolumes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0076, 0x0043, 0x0076, + EVR_US, "NumberOfDummyScans", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0077, 0x0043, 0x0077, + EVR_SH, "ApplicationName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0078, 0x0043, 0x0078, + EVR_SH, "ApplicationVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0079, 0x0043, 0x0079, + EVR_US, "SlicesPerVolume", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x007a, 0x0043, 0x007a, + EVR_US, "ExpectedTimePoints", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x007b, 0x0043, 0x007b, + EVR_FL, "RegressorValues", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x007c, 0x0043, 0x007c, + EVR_FL, "DelayAfterSliceGroup", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x007d, 0x0043, 0x007d, + EVR_US, "ReconModeFlagWord", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x007e, 0x0043, 0x007e, + EVR_LO, "PACCSpecificInformation", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x007f, 0x0043, 0x007f, + EVR_DS, "EDWIScaleFactor", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0080, 0x0043, 0x0080, + EVR_LO, "CoilIDData", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0081, 0x0043, 0x0081, + EVR_LO, "GECoilName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0082, 0x0043, 0x0082, + EVR_LO, "SystemConfigurationInformation", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0083, 0x0043, 0x0083, + EVR_DS, "AssetRFactors", 1, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0084, 0x0043, 0x0084, + EVR_LO, "AdditionalAssetData", 5, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0085, 0x0043, 0x0085, + EVR_UT, "DebugDataTextFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0086, 0x0043, 0x0086, + EVR_OB, "DebugDataBinaryFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0087, 0x0043, 0x0087, + EVR_UT, "ScannerSoftwareVersionLongForm", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0088, 0x0043, 0x0088, + EVR_UI, "PUREAcquisitionCalibrationSeriesUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0089, 0x0043, 0x0089, + EVR_LO, "GoverningBodydBdtAndSARDefinition", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x008a, 0x0043, 0x008a, + EVR_CS, "PrivateInPlanePhaseEncodingDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x008b, 0x0043, 0x008b, + EVR_OB, "FMRIBinaryDataBlock", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x008c, 0x0043, 0x008c, + EVR_DS, "VoxelLocation", 6, 6, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x008d, 0x0043, 0x008d, + EVR_DS, "SATBandLocations", 7, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x008e, 0x0043, 0x008e, + EVR_DS, "SpectroPrescanValues", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x008f, 0x0043, 0x008f, + EVR_DS, "SpectroParameters", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0090, 0x0043, 0x0090, + EVR_LO, "SARDefinition", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0091, 0x0043, 0x0091, + EVR_DS, "SARValue", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0092, 0x0043, 0x0092, + EVR_LO, "ImageErrorText", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0093, 0x0043, 0x0093, + EVR_DS, "SpectroQuantitationValues", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0094, 0x0043, 0x0094, + EVR_DS, "SpectroRatioValues", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0095, 0x0043, 0x0095, + EVR_LO, "PrescanReuseString", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0096, 0x0043, 0x0096, + EVR_CS, "ContentQualification", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0097, 0x0043, 0x0097, + EVR_LO, "ImageFilteringParameters", 9, 9, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0098, 0x0043, 0x0098, + EVR_UI, "ASSETAcquisitionCalibrationSeriesUID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x0099, 0x0043, 0x0099, + EVR_LO, "ExtendedOptions", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x009a, 0x0043, 0x009a, + EVR_IS, "RxStackIdentification", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x009b, 0x0043, 0x009b, + EVR_DS, "NPWFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x009c, 0x0043, 0x009c, + EVR_OB, "ResearchTag1", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x009d, 0x0043, 0x009d, + EVR_OB, "ResearchTag2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x009e, 0x0043, 0x009e, + EVR_OB, "ResearchTag3", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } + , { 0x0043, 0x009f, 0x0043, 0x009f, + EVR_OB, "ResearchTag4", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_PARM_01" } +#endif + , { 0x0044, 0x0001, 0x0044, 0x0001, + EVR_ST, "ProductPackageIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0002, 0x0044, 0x0002, + EVR_CS, "SubstanceAdministrationApproval", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0003, 0x0044, 0x0003, + EVR_LT, "ApprovalStatusFurtherDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0004, 0x0044, 0x0004, + EVR_DT, "ApprovalStatusDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0007, 0x0044, 0x0007, + EVR_SQ, "ProductTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0008, 0x0044, 0x0008, + EVR_LO, "ProductName", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0009, 0x0044, 0x0009, + EVR_LT, "ProductDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x000a, 0x0044, 0x000a, + EVR_LO, "ProductLotIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x000b, 0x0044, 0x000b, + EVR_DT, "ProductExpirationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0010, 0x0044, 0x0010, + EVR_DT, "SubstanceAdministrationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0011, 0x0044, 0x0011, + EVR_LO, "SubstanceAdministrationNotes", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0012, 0x0044, 0x0012, + EVR_LO, "SubstanceAdministrationDeviceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0013, 0x0044, 0x0013, + EVR_SQ, "ProductParameterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0019, 0x0044, 0x0019, + EVR_SQ, "SubstanceAdministrationParameterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0100, 0x0044, 0x0100, + EVR_SQ, "ApprovalSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0101, 0x0044, 0x0101, + EVR_SQ, "AssertionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0102, 0x0044, 0x0102, + EVR_UI, "AssertionUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0103, 0x0044, 0x0103, + EVR_SQ, "AsserterIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0104, 0x0044, 0x0104, + EVR_DT, "AssertionDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0105, 0x0044, 0x0105, + EVR_DT, "AssertionExpirationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0106, 0x0044, 0x0106, + EVR_UT, "AssertionComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0107, 0x0044, 0x0107, + EVR_SQ, "RelatedAssertionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0108, 0x0044, 0x0108, + EVR_UI, "ReferencedAssertionUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x0109, 0x0044, 0x0109, + EVR_SQ, "ApprovalSubjectSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0044, 0x010a, 0x0044, 0x010a, + EVR_SQ, "OrganizationalRoleCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0045, 0x0004, 0x0045, 0x0004, + EVR_CS, "AES", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0006, 0x0045, 0x0006, + EVR_DS, "Angulation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0009, 0x0045, 0x0009, + EVR_DS, "RealMagnificationFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x000b, 0x0045, 0x000b, + EVR_CS, "SenographType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x000c, 0x0045, 0x000c, + EVR_DS, "IntegrationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x000d, 0x0045, 0x000d, + EVR_DS, "ROIOriginXY", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0011, 0x0045, 0x0011, + EVR_DS, "ReceptorSizeCmXY", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0012, 0x0045, 0x0012, + EVR_IS, "ReceptorSizePixelsXY", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0013, 0x0045, 0x0013, + EVR_ST, "Screen", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0014, 0x0045, 0x0014, + EVR_DS, "PixelPitchMicrons", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0015, 0x0045, 0x0015, + EVR_IS, "PixelDepthBits", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0016, 0x0045, 0x0016, + EVR_IS, "BinningFactorXY", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x001b, 0x0045, 0x001b, + EVR_CS, "ClinicalView", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x001d, 0x0045, 0x001d, + EVR_DS, "MeanOfRawGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x001e, 0x0045, 0x001e, + EVR_DS, "MeanOfOffsetGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x001f, 0x0045, 0x001f, + EVR_DS, "MeanOfCorrectedGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0020, 0x0045, 0x0020, + EVR_DS, "MeanOfRegionGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0021, 0x0045, 0x0021, + EVR_DS, "MeanOfLogRegionGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0022, 0x0045, 0x0022, + EVR_DS, "StandardDeviationOfRawGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0023, 0x0045, 0x0023, + EVR_DS, "StandardDeviationOfCorrectedGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0024, 0x0045, 0x0024, + EVR_DS, "StandardDeviationOfRegionGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0025, 0x0045, 0x0025, + EVR_DS, "StandardDeviationOfLogRegionGrayLevels", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0026, 0x0045, 0x0026, + EVR_OB, "MAOBuffer", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0027, 0x0045, 0x0027, + EVR_IS, "SetNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0028, 0x0045, 0x0028, + EVR_CS, "WindowingType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0029, 0x0045, 0x0029, + EVR_DS, "WindowingParameters", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x002a, 0x0045, 0x002a, + EVR_IS, "CrosshairCursorXCoordinates", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x002b, 0x0045, 0x002b, + EVR_IS, "CrosshairCursorYCoordinates", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x0039, 0x0045, 0x0039, + EVR_US, "VignetteRows", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x003a, 0x0045, 0x003a, + EVR_US, "VignetteColumns", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x003b, 0x0045, 0x003b, + EVR_US, "VignetteBitsAllocated", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x003c, 0x0045, 0x003c, + EVR_US, "VignetteBitsStored", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x003d, 0x0045, 0x003d, + EVR_US, "VignetteHighBit", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x003e, 0x0045, 0x003e, + EVR_US, "VignettePixelRepresentation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } + , { 0x0045, 0x003f, 0x0045, 0x003f, + EVR_OB, "VignettePixelData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_SENO_02" } +#endif + , { 0x0046, 0x0012, 0x0046, 0x0012, + EVR_LO, "LensDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0014, 0x0046, 0x0014, + EVR_SQ, "RightLensSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0015, 0x0046, 0x0015, + EVR_SQ, "LeftLensSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0016, 0x0046, 0x0016, + EVR_SQ, "UnspecifiedLateralityLensSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0018, 0x0046, 0x0018, + EVR_SQ, "CylinderSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0028, 0x0046, 0x0028, + EVR_SQ, "PrismSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0030, 0x0046, 0x0030, + EVR_FD, "HorizontalPrismPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0032, 0x0046, 0x0032, + EVR_CS, "HorizontalPrismBase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0034, 0x0046, 0x0034, + EVR_FD, "VerticalPrismPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0036, 0x0046, 0x0036, + EVR_CS, "VerticalPrismBase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0038, 0x0046, 0x0038, + EVR_CS, "LensSegmentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0040, 0x0046, 0x0040, + EVR_FD, "OpticalTransmittance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0042, 0x0046, 0x0042, + EVR_FD, "ChannelWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0044, 0x0046, 0x0044, + EVR_FD, "PupilSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0046, 0x0046, 0x0046, + EVR_FD, "CornealSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0047, 0x0046, 0x0047, + EVR_SQ, "CornealSizeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0050, 0x0046, 0x0050, + EVR_SQ, "AutorefractionRightEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0052, 0x0046, 0x0052, + EVR_SQ, "AutorefractionLeftEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0060, 0x0046, 0x0060, + EVR_FD, "DistancePupillaryDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0062, 0x0046, 0x0062, + EVR_FD, "NearPupillaryDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0063, 0x0046, 0x0063, + EVR_FD, "IntermediatePupillaryDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0064, 0x0046, 0x0064, + EVR_FD, "OtherPupillaryDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0070, 0x0046, 0x0070, + EVR_SQ, "KeratometryRightEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0071, 0x0046, 0x0071, + EVR_SQ, "KeratometryLeftEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0074, 0x0046, 0x0074, + EVR_SQ, "SteepKeratometricAxisSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0075, 0x0046, 0x0075, + EVR_FD, "RadiusOfCurvature", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0076, 0x0046, 0x0076, + EVR_FD, "KeratometricPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0077, 0x0046, 0x0077, + EVR_FD, "KeratometricAxis", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0080, 0x0046, 0x0080, + EVR_SQ, "FlatKeratometricAxisSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0092, 0x0046, 0x0092, + EVR_CS, "BackgroundColor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0094, 0x0046, 0x0094, + EVR_CS, "Optotype", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0095, 0x0046, 0x0095, + EVR_CS, "OptotypePresentation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0097, 0x0046, 0x0097, + EVR_SQ, "SubjectiveRefractionRightEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0098, 0x0046, 0x0098, + EVR_SQ, "SubjectiveRefractionLeftEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0100, 0x0046, 0x0100, + EVR_SQ, "AddNearSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0101, 0x0046, 0x0101, + EVR_SQ, "AddIntermediateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0102, 0x0046, 0x0102, + EVR_SQ, "AddOtherSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0104, 0x0046, 0x0104, + EVR_FD, "AddPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0106, 0x0046, 0x0106, + EVR_FD, "ViewingDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0110, 0x0046, 0x0110, + EVR_SQ, "CorneaMeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0111, 0x0046, 0x0111, + EVR_SQ, "SourceOfCorneaMeasurementDataCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0112, 0x0046, 0x0112, + EVR_SQ, "SteepCornealAxisSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0113, 0x0046, 0x0113, + EVR_SQ, "FlatCornealAxisSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0114, 0x0046, 0x0114, + EVR_FD, "CornealPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0115, 0x0046, 0x0115, + EVR_FD, "CornealAxis", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0116, 0x0046, 0x0116, + EVR_SQ, "CorneaMeasurementMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0117, 0x0046, 0x0117, + EVR_FL, "RefractiveIndexOfCornea", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0118, 0x0046, 0x0118, + EVR_FL, "RefractiveIndexOfAqueousHumor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0121, 0x0046, 0x0121, + EVR_SQ, "VisualAcuityTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0122, 0x0046, 0x0122, + EVR_SQ, "VisualAcuityRightEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0123, 0x0046, 0x0123, + EVR_SQ, "VisualAcuityLeftEyeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0124, 0x0046, 0x0124, + EVR_SQ, "VisualAcuityBothEyesOpenSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0125, 0x0046, 0x0125, + EVR_CS, "ViewingDistanceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0135, 0x0046, 0x0135, + EVR_SS, "VisualAcuityModifiers", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0137, 0x0046, 0x0137, + EVR_FD, "DecimalVisualAcuity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0139, 0x0046, 0x0139, + EVR_LO, "OptotypeDetailedDefinition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0145, 0x0046, 0x0145, + EVR_SQ, "ReferencedRefractiveMeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0146, 0x0046, 0x0146, + EVR_FD, "SpherePower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0147, 0x0046, 0x0147, + EVR_FD, "CylinderPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0201, 0x0046, 0x0201, + EVR_CS, "CornealTopographySurface", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0202, 0x0046, 0x0202, + EVR_FL, "CornealVertexLocation", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0203, 0x0046, 0x0203, + EVR_FL, "PupilCentroidXCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0204, 0x0046, 0x0204, + EVR_FL, "PupilCentroidYCoordinate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0205, 0x0046, 0x0205, + EVR_FL, "EquivalentPupilRadius", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0207, 0x0046, 0x0207, + EVR_SQ, "CornealTopographyMapTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0208, 0x0046, 0x0208, + EVR_IS, "VerticesOfTheOutlineOfPupil", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0210, 0x0046, 0x0210, + EVR_SQ, "CornealTopographyMappingNormalsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0211, 0x0046, 0x0211, + EVR_SQ, "MaximumCornealCurvatureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0212, 0x0046, 0x0212, + EVR_FL, "MaximumCornealCurvature", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0213, 0x0046, 0x0213, + EVR_FL, "MaximumCornealCurvatureLocation", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0215, 0x0046, 0x0215, + EVR_SQ, "MinimumKeratometricSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0218, 0x0046, 0x0218, + EVR_SQ, "SimulatedKeratometricCylinderSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0220, 0x0046, 0x0220, + EVR_FL, "AverageCornealPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0224, 0x0046, 0x0224, + EVR_FL, "CornealISValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0227, 0x0046, 0x0227, + EVR_FL, "AnalyzedArea", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0230, 0x0046, 0x0230, + EVR_FL, "SurfaceRegularityIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0232, 0x0046, 0x0232, + EVR_FL, "SurfaceAsymmetryIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0234, 0x0046, 0x0234, + EVR_FL, "CornealEccentricityIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0236, 0x0046, 0x0236, + EVR_FL, "KeratoconusPredictionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0238, 0x0046, 0x0238, + EVR_FL, "DecimalPotentialVisualAcuity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0242, 0x0046, 0x0242, + EVR_CS, "CornealTopographyMapQualityEvaluation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0244, 0x0046, 0x0244, + EVR_SQ, "SourceImageCornealProcessedDataSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0247, 0x0046, 0x0247, + EVR_FL, "CornealPointLocation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0248, 0x0046, 0x0248, + EVR_CS, "CornealPointEstimated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0249, 0x0046, 0x0249, + EVR_FL, "AxialPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0250, 0x0046, 0x0250, + EVR_FL, "TangentialPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0251, 0x0046, 0x0251, + EVR_FL, "RefractivePower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0252, 0x0046, 0x0252, + EVR_FL, "RelativeElevation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0046, 0x0253, 0x0046, 0x0253, + EVR_FL, "CornealWavefront", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0047, 0x0001, 0x0047, 0x0001, + EVR_SQ, "ReconstructionParametersSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0050, 0x0047, 0x0050, + EVR_UL, "VolumeVoxelCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0051, 0x0047, 0x0051, + EVR_UL, "VolumeSegmentCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0053, 0x0047, 0x0053, + EVR_US, "VolumeSliceSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0054, 0x0047, 0x0054, + EVR_US, "VolumeSliceCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0055, 0x0047, 0x0055, + EVR_SL, "VolumeThresholdValue", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0057, 0x0047, 0x0057, + EVR_DS, "VolumeVoxelRatio", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0058, 0x0047, 0x0058, + EVR_DS, "VolumeVoxelSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0059, 0x0047, 0x0059, + EVR_US, "VolumeZPositionSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0060, 0x0047, 0x0060, + EVR_DS, "VolumeBaseLine", 9, 9, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0061, 0x0047, 0x0061, + EVR_DS, "VolumeCenterPoint", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0063, 0x0047, 0x0063, + EVR_SL, "VolumeSkewBase", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0064, 0x0047, 0x0064, + EVR_DS, "VolumeRegistrationTransformRotationMatrix", 9, 9, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0065, 0x0047, 0x0065, + EVR_DS, "VolumeRegistrationTransformTranslationVector", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0070, 0x0047, 0x0070, + EVR_DS, "KVPList", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0071, 0x0047, 0x0071, + EVR_IS, "XRayTubeCurrentList", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0072, 0x0047, 0x0072, + EVR_IS, "ExposureList", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0080, 0x0047, 0x0080, + EVR_LO, "AcquisitionDLXIdentifier", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0085, 0x0047, 0x0085, + EVR_SQ, "AcquisitionDLX2DSeriesSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0089, 0x0047, 0x0089, + EVR_DS, "ContrastAgentVolumeList", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x008a, 0x0047, 0x008a, + EVR_US, "NumberOfInjections", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x008b, 0x0047, 0x008b, + EVR_US, "FrameCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0091, 0x0047, 0x0091, + EVR_LO, "XA3DReconstructionAlgorithmName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0092, 0x0047, 0x0092, + EVR_CS, "XA3DReconstructionAlgorithmVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0093, 0x0047, 0x0093, + EVR_DA, "DLXCalibrationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0094, 0x0047, 0x0094, + EVR_TM, "DLXCalibrationTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0095, 0x0047, 0x0095, + EVR_CS, "DLXCalibrationStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0096, 0x0047, 0x0096, + EVR_IS, "UsedFrames", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0098, 0x0047, 0x0098, + EVR_US, "TransformCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x0099, 0x0047, 0x0099, + EVR_SQ, "TransformSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x009a, 0x0047, 0x009a, + EVR_DS, "TransformRotationMatrix", 9, 9, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x009b, 0x0047, 0x009b, + EVR_DS, "TransformTranslationVector", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x009c, 0x0047, 0x009c, + EVR_LO, "TransformLabel", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b0, 0x0047, 0x00b0, + EVR_SQ, "WireframeList", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b1, 0x0047, 0x00b1, + EVR_US, "WireframeCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b2, 0x0047, 0x00b2, + EVR_US, "LocationSystem", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b5, 0x0047, 0x00b5, + EVR_LO, "WireframeName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b6, 0x0047, 0x00b6, + EVR_LO, "WireframeGroupName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b7, 0x0047, 0x00b7, + EVR_LO, "WireframeColor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b8, 0x0047, 0x00b8, + EVR_SL, "WireframeAttributes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00b9, 0x0047, 0x00b9, + EVR_SL, "WireframePointCount", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00ba, 0x0047, 0x00ba, + EVR_SL, "WireframeTimestamp", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00bb, 0x0047, 0x00bb, + EVR_SQ, "WireframePointList", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00bc, 0x0047, 0x00bc, + EVR_DS, "WireframePointsCoordinates", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00c0, 0x0047, 0x00c0, + EVR_DS, "VolumeUpperLeftHighCornerRAS", 3, 3, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00c1, 0x0047, 0x00c1, + EVR_DS, "VolumeSliceToRASRotationMatrix", 9, 9, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00c2, 0x0047, 0x00c2, + EVR_DS, "VolumeUpperLeftHighCornerTLOC", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00d1, 0x0047, 0x00d1, + EVR_OB, "VolumeSegmentList", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00d2, 0x0047, 0x00d2, + EVR_OB, "VolumeGradientList", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00d3, 0x0047, 0x00d3, + EVR_OB, "VolumeDensityList", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00d4, 0x0047, 0x00d4, + EVR_OB, "VolumeZPositionList", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } + , { 0x0047, 0x00d5, 0x0047, 0x00d5, + EVR_OB, "VolumeOriginalIndexList", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "GEMS_ADWSoft_3D1" } +#endif + , { 0x0048, 0x0001, 0x0048, 0x0001, + EVR_FL, "ImagedVolumeWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0002, 0x0048, 0x0002, + EVR_FL, "ImagedVolumeHeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0003, 0x0048, 0x0003, + EVR_FL, "ImagedVolumeDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0006, 0x0048, 0x0006, + EVR_UL, "TotalPixelMatrixColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0007, 0x0048, 0x0007, + EVR_UL, "TotalPixelMatrixRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0008, 0x0048, 0x0008, + EVR_SQ, "TotalPixelMatrixOriginSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0010, 0x0048, 0x0010, + EVR_CS, "SpecimenLabelInImage", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0011, 0x0048, 0x0011, + EVR_CS, "FocusMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0012, 0x0048, 0x0012, + EVR_CS, "ExtendedDepthOfField", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0013, 0x0048, 0x0013, + EVR_US, "NumberOfFocalPlanes", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0014, 0x0048, 0x0014, + EVR_FL, "DistanceBetweenFocalPlanes", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0015, 0x0048, 0x0015, + EVR_US, "RecommendedAbsentPixelCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0100, 0x0048, 0x0100, + EVR_SQ, "IlluminatorTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0102, 0x0048, 0x0102, + EVR_DS, "ImageOrientationSlide", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0105, 0x0048, 0x0105, + EVR_SQ, "OpticalPathSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0106, 0x0048, 0x0106, + EVR_SH, "OpticalPathIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0107, 0x0048, 0x0107, + EVR_ST, "OpticalPathDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0108, 0x0048, 0x0108, + EVR_SQ, "IlluminationColorCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0110, 0x0048, 0x0110, + EVR_SQ, "SpecimenReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0111, 0x0048, 0x0111, + EVR_DS, "CondenserLensPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0112, 0x0048, 0x0112, + EVR_DS, "ObjectiveLensPower", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0113, 0x0048, 0x0113, + EVR_DS, "ObjectiveLensNumericalAperture", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0120, 0x0048, 0x0120, + EVR_SQ, "PaletteColorLookupTableSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0200, 0x0048, 0x0200, + EVR_SQ, "ReferencedImageNavigationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0201, 0x0048, 0x0201, + EVR_US, "TopLeftHandCornerOfLocalizerArea", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0202, 0x0048, 0x0202, + EVR_US, "BottomRightHandCornerOfLocalizerArea", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0207, 0x0048, 0x0207, + EVR_SQ, "OpticalPathIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x021a, 0x0048, 0x021a, + EVR_SQ, "PlanePositionSlideSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x021e, 0x0048, 0x021e, + EVR_SL, "ColumnPositionInTotalImagePixelMatrix", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x021f, 0x0048, 0x021f, + EVR_SL, "RowPositionInTotalImagePixelMatrix", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0301, 0x0048, 0x0301, + EVR_CS, "PixelOriginInterpretation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0302, 0x0048, 0x0302, + EVR_UL, "NumberOfOpticalPaths", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0048, 0x0303, 0x0048, 0x0303, + EVR_UL, "TotalPixelMatrixFocalPlanes", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0004, 0x0050, 0x0004, + EVR_CS, "CalibrationImage", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0010, 0x0050, 0x0010, + EVR_SQ, "DeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0012, 0x0050, 0x0012, + EVR_SQ, "ContainerComponentTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0013, 0x0050, 0x0013, + EVR_FD, "ContainerComponentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0014, 0x0050, 0x0014, + EVR_DS, "DeviceLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0015, 0x0050, 0x0015, + EVR_FD, "ContainerComponentWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0016, 0x0050, 0x0016, + EVR_DS, "DeviceDiameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0017, 0x0050, 0x0017, + EVR_CS, "DeviceDiameterUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0018, 0x0050, 0x0018, + EVR_DS, "DeviceVolume", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0019, 0x0050, 0x0019, + EVR_DS, "InterMarkerDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x001a, 0x0050, 0x001a, + EVR_CS, "ContainerComponentMaterial", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x001b, 0x0050, 0x001b, + EVR_LO, "ContainerComponentID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x001c, 0x0050, 0x001c, + EVR_FD, "ContainerComponentLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x001d, 0x0050, 0x001d, + EVR_FD, "ContainerComponentDiameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x001e, 0x0050, 0x001e, + EVR_LO, "ContainerComponentDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0020, 0x0050, 0x0020, + EVR_LO, "DeviceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0050, 0x0021, 0x0050, 0x0021, + EVR_ST, "LongDeviceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0051, 0x0010, 0x0051, 0x0010, + EVR_LT, "ImageText", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } +#endif + , { 0x0052, 0x0001, 0x0052, 0x0001, + EVR_FL, "ContrastBolusIngredientPercentByVolume", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0002, 0x0052, 0x0002, + EVR_FD, "OCTFocalDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0003, 0x0052, 0x0003, + EVR_FD, "BeamSpotSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0004, 0x0052, 0x0004, + EVR_FD, "EffectiveRefractiveIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0006, 0x0052, 0x0006, + EVR_CS, "OCTAcquisitionDomain", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0007, 0x0052, 0x0007, + EVR_FD, "OCTOpticalCenterWavelength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0008, 0x0052, 0x0008, + EVR_FD, "AxialResolution", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0009, 0x0052, 0x0009, + EVR_FD, "RangingDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0011, 0x0052, 0x0011, + EVR_FD, "ALineRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0012, 0x0052, 0x0012, + EVR_US, "ALinesPerFrame", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0013, 0x0052, 0x0013, + EVR_FD, "CatheterRotationalRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0014, 0x0052, 0x0014, + EVR_FD, "ALinePixelSpacing", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0016, 0x0052, 0x0016, + EVR_SQ, "ModeOfPercutaneousAccessSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0025, 0x0052, 0x0025, + EVR_SQ, "IntravascularOCTFrameTypeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0026, 0x0052, 0x0026, + EVR_CS, "OCTZOffsetApplied", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0027, 0x0052, 0x0027, + EVR_SQ, "IntravascularFrameContentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0028, 0x0052, 0x0028, + EVR_FD, "IntravascularLongitudinalDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0029, 0x0052, 0x0029, + EVR_SQ, "IntravascularOCTFrameContentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0030, 0x0052, 0x0030, + EVR_SS, "OCTZOffsetCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0031, 0x0052, 0x0031, + EVR_CS, "CatheterDirectionOfRotation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0033, 0x0052, 0x0033, + EVR_FD, "SeamLineLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0034, 0x0052, 0x0034, + EVR_FD, "FirstALineLocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0036, 0x0052, 0x0036, + EVR_US, "SeamLineIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0038, 0x0052, 0x0038, + EVR_US, "NumberOfPaddedALines", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x0039, 0x0052, 0x0039, + EVR_CS, "InterpolationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0052, 0x003a, 0x0052, 0x003a, + EVR_CS, "RefractiveIndexApplied", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0010, 0x0054, 0x0010, + EVR_US, "EnergyWindowVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0011, 0x0054, 0x0011, + EVR_US, "NumberOfEnergyWindows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0012, 0x0054, 0x0012, + EVR_SQ, "EnergyWindowInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0013, 0x0054, 0x0013, + EVR_SQ, "EnergyWindowRangeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0014, 0x0054, 0x0014, + EVR_DS, "EnergyWindowLowerLimit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0015, 0x0054, 0x0015, + EVR_DS, "EnergyWindowUpperLimit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0016, 0x0054, 0x0016, + EVR_SQ, "RadiopharmaceuticalInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0017, 0x0054, 0x0017, + EVR_IS, "ResidualSyringeCounts", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0018, 0x0054, 0x0018, + EVR_SH, "EnergyWindowName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0020, 0x0054, 0x0020, + EVR_US, "DetectorVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0021, 0x0054, 0x0021, + EVR_US, "NumberOfDetectors", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0022, 0x0054, 0x0022, + EVR_SQ, "DetectorInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0030, 0x0054, 0x0030, + EVR_US, "PhaseVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0031, 0x0054, 0x0031, + EVR_US, "NumberOfPhases", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0032, 0x0054, 0x0032, + EVR_SQ, "PhaseInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0033, 0x0054, 0x0033, + EVR_US, "NumberOfFramesInPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0036, 0x0054, 0x0036, + EVR_IS, "PhaseDelay", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0038, 0x0054, 0x0038, + EVR_IS, "PauseBetweenFrames", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0039, 0x0054, 0x0039, + EVR_CS, "PhaseDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0050, 0x0054, 0x0050, + EVR_US, "RotationVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0051, 0x0054, 0x0051, + EVR_US, "NumberOfRotations", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0052, 0x0054, 0x0052, + EVR_SQ, "RotationInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0053, 0x0054, 0x0053, + EVR_US, "NumberOfFramesInRotation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0060, 0x0054, 0x0060, + EVR_US, "RRIntervalVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0061, 0x0054, 0x0061, + EVR_US, "NumberOfRRIntervals", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0062, 0x0054, 0x0062, + EVR_SQ, "GatedInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0063, 0x0054, 0x0063, + EVR_SQ, "DataInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0070, 0x0054, 0x0070, + EVR_US, "TimeSlotVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0071, 0x0054, 0x0071, + EVR_US, "NumberOfTimeSlots", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0072, 0x0054, 0x0072, + EVR_SQ, "TimeSlotInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0073, 0x0054, 0x0073, + EVR_DS, "TimeSlotTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0080, 0x0054, 0x0080, + EVR_US, "SliceVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0081, 0x0054, 0x0081, + EVR_US, "NumberOfSlices", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0090, 0x0054, 0x0090, + EVR_US, "AngularViewVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0100, 0x0054, 0x0100, + EVR_US, "TimeSliceVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0101, 0x0054, 0x0101, + EVR_US, "NumberOfTimeSlices", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0200, 0x0054, 0x0200, + EVR_DS, "StartAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0202, 0x0054, 0x0202, + EVR_CS, "TypeOfDetectorMotion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0210, 0x0054, 0x0210, + EVR_IS, "TriggerVector", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0211, 0x0054, 0x0211, + EVR_US, "NumberOfTriggersInPhase", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0220, 0x0054, 0x0220, + EVR_SQ, "ViewCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0222, 0x0054, 0x0222, + EVR_SQ, "ViewModifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0300, 0x0054, 0x0300, + EVR_SQ, "RadionuclideCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0302, 0x0054, 0x0302, + EVR_SQ, "AdministrationRouteCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0304, 0x0054, 0x0304, + EVR_SQ, "RadiopharmaceuticalCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0306, 0x0054, 0x0306, + EVR_SQ, "CalibrationDataSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0308, 0x0054, 0x0308, + EVR_US, "EnergyWindowNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0400, 0x0054, 0x0400, + EVR_SH, "ImageID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0410, 0x0054, 0x0410, + EVR_SQ, "PatientOrientationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0412, 0x0054, 0x0412, + EVR_SQ, "PatientOrientationModifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0414, 0x0054, 0x0414, + EVR_SQ, "PatientGantryRelationshipCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0500, 0x0054, 0x0500, + EVR_CS, "SliceProgressionDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x0501, 0x0054, 0x0501, + EVR_CS, "ScanProgressionDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1000, 0x0054, 0x1000, + EVR_CS, "SeriesType", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1001, 0x0054, 0x1001, + EVR_CS, "Units", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1002, 0x0054, 0x1002, + EVR_CS, "CountsSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1004, 0x0054, 0x1004, + EVR_CS, "ReprojectionMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1006, 0x0054, 0x1006, + EVR_CS, "SUVType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1100, 0x0054, 0x1100, + EVR_CS, "RandomsCorrectionMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1101, 0x0054, 0x1101, + EVR_LO, "AttenuationCorrectionMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1102, 0x0054, 0x1102, + EVR_CS, "DecayCorrection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1103, 0x0054, 0x1103, + EVR_LO, "ReconstructionMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1104, 0x0054, 0x1104, + EVR_LO, "DetectorLinesOfResponseUsed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1105, 0x0054, 0x1105, + EVR_LO, "ScatterCorrectionMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1200, 0x0054, 0x1200, + EVR_DS, "AxialAcceptance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1201, 0x0054, 0x1201, + EVR_IS, "AxialMash", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1202, 0x0054, 0x1202, + EVR_IS, "TransverseMash", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1203, 0x0054, 0x1203, + EVR_DS, "DetectorElementSize", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1210, 0x0054, 0x1210, + EVR_DS, "CoincidenceWindowWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1220, 0x0054, 0x1220, + EVR_CS, "SecondaryCountsType", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1300, 0x0054, 0x1300, + EVR_DS, "FrameReferenceTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1310, 0x0054, 0x1310, + EVR_IS, "PrimaryPromptsCountsAccumulated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1311, 0x0054, 0x1311, + EVR_IS, "SecondaryCountsAccumulated", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1320, 0x0054, 0x1320, + EVR_DS, "SliceSensitivityFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1321, 0x0054, 0x1321, + EVR_DS, "DecayFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1322, 0x0054, 0x1322, + EVR_DS, "DoseCalibrationFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1323, 0x0054, 0x1323, + EVR_DS, "ScatterFractionFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1324, 0x0054, 0x1324, + EVR_DS, "DeadTimeFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1330, 0x0054, 0x1330, + EVR_US, "ImageIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1400, 0x0054, 0x1400, + EVR_CS, "RETIRED_CountsIncluded", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0054, 0x1401, 0x0054, 0x1401, + EVR_CS, "RETIRED_DeadTimeCorrectionFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0055, 0x0046, 0x0055, 0x0046, + EVR_LT, "CurrentWard", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } +#endif + , { 0x0060, 0x3000, 0x0060, 0x3000, + EVR_SQ, "HistogramSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0060, 0x3002, 0x0060, 0x3002, + EVR_US, "HistogramNumberOfBins", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0060, 0x3004, 0x0060, 0x3004, + EVR_xs, "HistogramFirstBinValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0060, 0x3006, 0x0060, 0x3006, + EVR_xs, "HistogramLastBinValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0060, 0x3008, 0x0060, 0x3008, + EVR_US, "HistogramBinWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0060, 0x3010, 0x0060, 0x3010, + EVR_LO, "HistogramExplanation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0060, 0x3020, 0x0060, 0x3020, + EVR_UL, "HistogramData", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0001, 0x0062, 0x0001, + EVR_CS, "SegmentationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0002, 0x0062, 0x0002, + EVR_SQ, "SegmentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0003, 0x0062, 0x0003, + EVR_SQ, "SegmentedPropertyCategoryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0004, 0x0062, 0x0004, + EVR_US, "SegmentNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0005, 0x0062, 0x0005, + EVR_LO, "SegmentLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0006, 0x0062, 0x0006, + EVR_ST, "SegmentDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0007, 0x0062, 0x0007, + EVR_SQ, "SegmentationAlgorithmIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0008, 0x0062, 0x0008, + EVR_CS, "SegmentAlgorithmType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0009, 0x0062, 0x0009, + EVR_LO, "SegmentAlgorithmName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x000a, 0x0062, 0x000a, + EVR_SQ, "SegmentIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x000b, 0x0062, 0x000b, + EVR_US, "ReferencedSegmentNumber", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x000c, 0x0062, 0x000c, + EVR_US, "RecommendedDisplayGrayscaleValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x000d, 0x0062, 0x000d, + EVR_US, "RecommendedDisplayCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x000e, 0x0062, 0x000e, + EVR_US, "MaximumFractionalValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x000f, 0x0062, 0x000f, + EVR_SQ, "SegmentedPropertyTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0010, 0x0062, 0x0010, + EVR_CS, "SegmentationFractionalType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0011, 0x0062, 0x0011, + EVR_SQ, "SegmentedPropertyTypeModifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0012, 0x0062, 0x0012, + EVR_SQ, "UsedSegmentsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0013, 0x0062, 0x0013, + EVR_CS, "SegmentsOverlap", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0020, 0x0062, 0x0020, + EVR_UT, "TrackingID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0062, 0x0021, 0x0062, 0x0021, + EVR_UI, "TrackingUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x0002, 0x0064, 0x0002, + EVR_SQ, "DeformableRegistrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x0003, 0x0064, 0x0003, + EVR_UI, "SourceFrameOfReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x0005, 0x0064, 0x0005, + EVR_SQ, "DeformableRegistrationGridSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x0007, 0x0064, 0x0007, + EVR_UL, "GridDimensions", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x0008, 0x0064, 0x0008, + EVR_FD, "GridResolution", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x0009, 0x0064, 0x0009, + EVR_OF, "VectorGridData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x000f, 0x0064, 0x000f, + EVR_SQ, "PreDeformationMatrixRegistrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0064, 0x0010, 0x0064, 0x0010, + EVR_SQ, "PostDeformationMatrixRegistrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0001, 0x0066, 0x0001, + EVR_UL, "NumberOfSurfaces", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0002, 0x0066, 0x0002, + EVR_SQ, "SurfaceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0003, 0x0066, 0x0003, + EVR_UL, "SurfaceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0004, 0x0066, 0x0004, + EVR_LT, "SurfaceComments", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0009, 0x0066, 0x0009, + EVR_CS, "SurfaceProcessing", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x000a, 0x0066, 0x000a, + EVR_FL, "SurfaceProcessingRatio", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x000b, 0x0066, 0x000b, + EVR_LO, "SurfaceProcessingDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x000c, 0x0066, 0x000c, + EVR_FL, "RecommendedPresentationOpacity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x000d, 0x0066, 0x000d, + EVR_CS, "RecommendedPresentationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x000e, 0x0066, 0x000e, + EVR_CS, "FiniteVolume", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0010, 0x0066, 0x0010, + EVR_CS, "Manifold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0011, 0x0066, 0x0011, + EVR_SQ, "SurfacePointsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0012, 0x0066, 0x0012, + EVR_SQ, "SurfacePointsNormalsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0013, 0x0066, 0x0013, + EVR_SQ, "SurfaceMeshPrimitivesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0015, 0x0066, 0x0015, + EVR_UL, "NumberOfSurfacePoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0016, 0x0066, 0x0016, + EVR_OF, "PointCoordinatesData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0017, 0x0066, 0x0017, + EVR_FL, "PointPositionAccuracy", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0018, 0x0066, 0x0018, + EVR_FL, "MeanPointDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0019, 0x0066, 0x0019, + EVR_FL, "MaximumPointDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x001a, 0x0066, 0x001a, + EVR_FL, "PointsBoundingBoxCoordinates", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x001b, 0x0066, 0x001b, + EVR_FL, "AxisOfRotation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x001c, 0x0066, 0x001c, + EVR_FL, "CenterOfRotation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x001e, 0x0066, 0x001e, + EVR_UL, "NumberOfVectors", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x001f, 0x0066, 0x001f, + EVR_US, "VectorDimensionality", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0020, 0x0066, 0x0020, + EVR_FL, "VectorAccuracy", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0021, 0x0066, 0x0021, + EVR_OF, "VectorCoordinateData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0023, 0x0066, 0x0023, + EVR_OW, "RETIRED_TrianglePointIndexList", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0024, 0x0066, 0x0024, + EVR_OW, "RETIRED_EdgePointIndexList", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0025, 0x0066, 0x0025, + EVR_OW, "RETIRED_VertexPointIndexList", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0026, 0x0066, 0x0026, + EVR_SQ, "TriangleStripSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0027, 0x0066, 0x0027, + EVR_SQ, "TriangleFanSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0028, 0x0066, 0x0028, + EVR_SQ, "LineSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0029, 0x0066, 0x0029, + EVR_OW, "RETIRED_PrimitivePointIndexList", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x002a, 0x0066, 0x002a, + EVR_UL, "SurfaceCount", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x002b, 0x0066, 0x002b, + EVR_SQ, "ReferencedSurfaceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x002c, 0x0066, 0x002c, + EVR_UL, "ReferencedSurfaceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x002d, 0x0066, 0x002d, + EVR_SQ, "SegmentSurfaceGenerationAlgorithmIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x002e, 0x0066, 0x002e, + EVR_SQ, "SegmentSurfaceSourceInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x002f, 0x0066, 0x002f, + EVR_SQ, "AlgorithmFamilyCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0030, 0x0066, 0x0030, + EVR_SQ, "AlgorithmNameCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0031, 0x0066, 0x0031, + EVR_LO, "AlgorithmVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0032, 0x0066, 0x0032, + EVR_LT, "AlgorithmParameters", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0034, 0x0066, 0x0034, + EVR_SQ, "FacetSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0035, 0x0066, 0x0035, + EVR_SQ, "SurfaceProcessingAlgorithmIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0036, 0x0066, 0x0036, + EVR_LO, "AlgorithmName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0037, 0x0066, 0x0037, + EVR_FL, "RecommendedPointRadius", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0038, 0x0066, 0x0038, + EVR_FL, "RecommendedLineThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0040, 0x0066, 0x0040, + EVR_OL, "LongPrimitivePointIndexList", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0041, 0x0066, 0x0041, + EVR_OL, "LongTrianglePointIndexList", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0042, 0x0066, 0x0042, + EVR_OL, "LongEdgePointIndexList", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0043, 0x0066, 0x0043, + EVR_OL, "LongVertexPointIndexList", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0101, 0x0066, 0x0101, + EVR_SQ, "TrackSetSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0102, 0x0066, 0x0102, + EVR_SQ, "TrackSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0103, 0x0066, 0x0103, + EVR_OW, "RecommendedDisplayCIELabValueList", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0104, 0x0066, 0x0104, + EVR_SQ, "TrackingAlgorithmIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0105, 0x0066, 0x0105, + EVR_UL, "TrackSetNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0106, 0x0066, 0x0106, + EVR_LO, "TrackSetLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0107, 0x0066, 0x0107, + EVR_UT, "TrackSetDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0108, 0x0066, 0x0108, + EVR_SQ, "TrackSetAnatomicalTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0121, 0x0066, 0x0121, + EVR_SQ, "MeasurementsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0124, 0x0066, 0x0124, + EVR_SQ, "TrackSetStatisticsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0125, 0x0066, 0x0125, + EVR_OF, "FloatingPointValues", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0129, 0x0066, 0x0129, + EVR_OL, "TrackPointIndexList", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0130, 0x0066, 0x0130, + EVR_SQ, "TrackStatisticsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0132, 0x0066, 0x0132, + EVR_SQ, "MeasurementValuesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0133, 0x0066, 0x0133, + EVR_SQ, "DiffusionAcquisitionCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0066, 0x0134, 0x0066, 0x0134, + EVR_SQ, "DiffusionModelCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6210, 0x0068, 0x6210, + EVR_LO, "ImplantSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6221, 0x0068, 0x6221, + EVR_LO, "ImplantTemplateVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6222, 0x0068, 0x6222, + EVR_SQ, "ReplacedImplantTemplateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6223, 0x0068, 0x6223, + EVR_CS, "ImplantType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6224, 0x0068, 0x6224, + EVR_SQ, "DerivationImplantTemplateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6225, 0x0068, 0x6225, + EVR_SQ, "OriginalImplantTemplateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6226, 0x0068, 0x6226, + EVR_DT, "EffectiveDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6230, 0x0068, 0x6230, + EVR_SQ, "ImplantTargetAnatomySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6260, 0x0068, 0x6260, + EVR_SQ, "InformationFromManufacturerSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6265, 0x0068, 0x6265, + EVR_SQ, "NotificationFromManufacturerSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6270, 0x0068, 0x6270, + EVR_DT, "InformationIssueDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6280, 0x0068, 0x6280, + EVR_ST, "InformationSummary", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62a0, 0x0068, 0x62a0, + EVR_SQ, "ImplantRegulatoryDisapprovalCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62a5, 0x0068, 0x62a5, + EVR_FD, "OverallTemplateSpatialTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62c0, 0x0068, 0x62c0, + EVR_SQ, "HPGLDocumentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62d0, 0x0068, 0x62d0, + EVR_US, "HPGLDocumentID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62d5, 0x0068, 0x62d5, + EVR_LO, "HPGLDocumentLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62e0, 0x0068, 0x62e0, + EVR_SQ, "ViewOrientationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62f0, 0x0068, 0x62f0, + EVR_SQ, "ViewOrientationModifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x62f2, 0x0068, 0x62f2, + EVR_FD, "HPGLDocumentScaling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6300, 0x0068, 0x6300, + EVR_OB, "HPGLDocument", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6310, 0x0068, 0x6310, + EVR_US, "HPGLContourPenNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6320, 0x0068, 0x6320, + EVR_SQ, "HPGLPenSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6330, 0x0068, 0x6330, + EVR_US, "HPGLPenNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6340, 0x0068, 0x6340, + EVR_LO, "HPGLPenLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6345, 0x0068, 0x6345, + EVR_ST, "HPGLPenDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6346, 0x0068, 0x6346, + EVR_FD, "RecommendedRotationPoint", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6347, 0x0068, 0x6347, + EVR_FD, "BoundingRectangle", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6350, 0x0068, 0x6350, + EVR_US, "ImplantTemplate3DModelSurfaceNumber", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6360, 0x0068, 0x6360, + EVR_SQ, "SurfaceModelDescriptionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6380, 0x0068, 0x6380, + EVR_LO, "SurfaceModelLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6390, 0x0068, 0x6390, + EVR_FD, "SurfaceModelScalingFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63a0, 0x0068, 0x63a0, + EVR_SQ, "MaterialsCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63a4, 0x0068, 0x63a4, + EVR_SQ, "CoatingMaterialsCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63a8, 0x0068, 0x63a8, + EVR_SQ, "ImplantTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63ac, 0x0068, 0x63ac, + EVR_SQ, "FixationMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63b0, 0x0068, 0x63b0, + EVR_SQ, "MatingFeatureSetsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63c0, 0x0068, 0x63c0, + EVR_US, "MatingFeatureSetID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63d0, 0x0068, 0x63d0, + EVR_LO, "MatingFeatureSetLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63e0, 0x0068, 0x63e0, + EVR_SQ, "MatingFeatureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x63f0, 0x0068, 0x63f0, + EVR_US, "MatingFeatureID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6400, 0x0068, 0x6400, + EVR_SQ, "MatingFeatureDegreeOfFreedomSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6410, 0x0068, 0x6410, + EVR_US, "DegreeOfFreedomID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6420, 0x0068, 0x6420, + EVR_CS, "DegreeOfFreedomType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6430, 0x0068, 0x6430, + EVR_SQ, "TwoDMatingFeatureCoordinatesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6440, 0x0068, 0x6440, + EVR_US, "ReferencedHPGLDocumentID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6450, 0x0068, 0x6450, + EVR_FD, "TwoDMatingPoint", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6460, 0x0068, 0x6460, + EVR_FD, "TwoDMatingAxes", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6470, 0x0068, 0x6470, + EVR_SQ, "TwoDDegreeOfFreedomSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6490, 0x0068, 0x6490, + EVR_FD, "ThreeDDegreeOfFreedomAxis", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x64a0, 0x0068, 0x64a0, + EVR_FD, "RangeOfFreedom", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x64c0, 0x0068, 0x64c0, + EVR_FD, "ThreeDMatingPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x64d0, 0x0068, 0x64d0, + EVR_FD, "ThreeDMatingAxes", 9, 9, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x64f0, 0x0068, 0x64f0, + EVR_FD, "TwoDDegreeOfFreedomAxis", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6500, 0x0068, 0x6500, + EVR_SQ, "PlanningLandmarkPointSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6510, 0x0068, 0x6510, + EVR_SQ, "PlanningLandmarkLineSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6520, 0x0068, 0x6520, + EVR_SQ, "PlanningLandmarkPlaneSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6530, 0x0068, 0x6530, + EVR_US, "PlanningLandmarkID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6540, 0x0068, 0x6540, + EVR_LO, "PlanningLandmarkDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6545, 0x0068, 0x6545, + EVR_SQ, "PlanningLandmarkIdentificationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6550, 0x0068, 0x6550, + EVR_SQ, "TwoDPointCoordinatesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6560, 0x0068, 0x6560, + EVR_FD, "TwoDPointCoordinates", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6590, 0x0068, 0x6590, + EVR_FD, "ThreeDPointCoordinates", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x65a0, 0x0068, 0x65a0, + EVR_SQ, "TwoDLineCoordinatesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x65b0, 0x0068, 0x65b0, + EVR_FD, "TwoDLineCoordinates", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x65d0, 0x0068, 0x65d0, + EVR_FD, "ThreeDLineCoordinates", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x65e0, 0x0068, 0x65e0, + EVR_SQ, "TwoDPlaneCoordinatesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x65f0, 0x0068, 0x65f0, + EVR_FD, "TwoDPlaneIntersection", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6610, 0x0068, 0x6610, + EVR_FD, "ThreeDPlaneOrigin", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x6620, 0x0068, 0x6620, + EVR_FD, "ThreeDPlaneNormal", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x7001, 0x0068, 0x7001, + EVR_CS, "ModelModification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x7002, 0x0068, 0x7002, + EVR_CS, "ModelMirroring", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0068, 0x7003, 0x0068, 0x7003, + EVR_SQ, "ModelUsageCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0001, 0x0070, 0x0001, + EVR_SQ, "GraphicAnnotationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0002, 0x0070, 0x0002, + EVR_CS, "GraphicLayer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0003, 0x0070, 0x0003, + EVR_CS, "BoundingBoxAnnotationUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0004, 0x0070, 0x0004, + EVR_CS, "AnchorPointAnnotationUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0005, 0x0070, 0x0005, + EVR_CS, "GraphicAnnotationUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0006, 0x0070, 0x0006, + EVR_ST, "UnformattedTextValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0008, 0x0070, 0x0008, + EVR_SQ, "TextObjectSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0009, 0x0070, 0x0009, + EVR_SQ, "GraphicObjectSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0010, 0x0070, 0x0010, + EVR_FL, "BoundingBoxTopLeftHandCorner", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0011, 0x0070, 0x0011, + EVR_FL, "BoundingBoxBottomRightHandCorner", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0012, 0x0070, 0x0012, + EVR_CS, "BoundingBoxTextHorizontalJustification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0014, 0x0070, 0x0014, + EVR_FL, "AnchorPoint", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0015, 0x0070, 0x0015, + EVR_CS, "AnchorPointVisibility", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0020, 0x0070, 0x0020, + EVR_US, "GraphicDimensions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0021, 0x0070, 0x0021, + EVR_US, "NumberOfGraphicPoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0022, 0x0070, 0x0022, + EVR_FL, "GraphicData", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0023, 0x0070, 0x0023, + EVR_CS, "GraphicType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0024, 0x0070, 0x0024, + EVR_CS, "GraphicFilled", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0040, 0x0070, 0x0040, + EVR_IS, "RETIRED_ImageRotationRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0041, 0x0070, 0x0041, + EVR_CS, "ImageHorizontalFlip", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0042, 0x0070, 0x0042, + EVR_US, "ImageRotation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0050, 0x0070, 0x0050, + EVR_US, "RETIRED_DisplayedAreaTopLeftHandCornerTrial", 2, 2, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0051, 0x0070, 0x0051, + EVR_US, "RETIRED_DisplayedAreaBottomRightHandCornerTrial", 2, 2, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0052, 0x0070, 0x0052, + EVR_SL, "DisplayedAreaTopLeftHandCorner", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0053, 0x0070, 0x0053, + EVR_SL, "DisplayedAreaBottomRightHandCorner", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x005a, 0x0070, 0x005a, + EVR_SQ, "DisplayedAreaSelectionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0060, 0x0070, 0x0060, + EVR_SQ, "GraphicLayerSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0062, 0x0070, 0x0062, + EVR_IS, "GraphicLayerOrder", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0066, 0x0070, 0x0066, + EVR_US, "GraphicLayerRecommendedDisplayGrayscaleValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0067, 0x0070, 0x0067, + EVR_US, "RETIRED_GraphicLayerRecommendedDisplayRGBValue", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0068, 0x0070, 0x0068, + EVR_LO, "GraphicLayerDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0080, 0x0070, 0x0080, + EVR_CS, "ContentLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0081, 0x0070, 0x0081, + EVR_LO, "ContentDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0082, 0x0070, 0x0082, + EVR_DA, "PresentationCreationDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0083, 0x0070, 0x0083, + EVR_TM, "PresentationCreationTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0084, 0x0070, 0x0084, + EVR_PN, "ContentCreatorName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0086, 0x0070, 0x0086, + EVR_SQ, "ContentCreatorIdentificationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0087, 0x0070, 0x0087, + EVR_SQ, "AlternateContentDescriptionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0100, 0x0070, 0x0100, + EVR_CS, "PresentationSizeMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0101, 0x0070, 0x0101, + EVR_DS, "PresentationPixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0102, 0x0070, 0x0102, + EVR_IS, "PresentationPixelAspectRatio", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0103, 0x0070, 0x0103, + EVR_FL, "PresentationPixelMagnificationRatio", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0207, 0x0070, 0x0207, + EVR_LO, "GraphicGroupLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0208, 0x0070, 0x0208, + EVR_ST, "GraphicGroupDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0209, 0x0070, 0x0209, + EVR_SQ, "CompoundGraphicSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0226, 0x0070, 0x0226, + EVR_UL, "CompoundGraphicInstanceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0227, 0x0070, 0x0227, + EVR_LO, "FontName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0228, 0x0070, 0x0228, + EVR_CS, "FontNameType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0229, 0x0070, 0x0229, + EVR_LO, "CSSFontName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0230, 0x0070, 0x0230, + EVR_FD, "RotationAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0231, 0x0070, 0x0231, + EVR_SQ, "TextStyleSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0232, 0x0070, 0x0232, + EVR_SQ, "LineStyleSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0233, 0x0070, 0x0233, + EVR_SQ, "FillStyleSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0234, 0x0070, 0x0234, + EVR_SQ, "GraphicGroupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0241, 0x0070, 0x0241, + EVR_US, "TextColorCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0242, 0x0070, 0x0242, + EVR_CS, "HorizontalAlignment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0243, 0x0070, 0x0243, + EVR_CS, "VerticalAlignment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0244, 0x0070, 0x0244, + EVR_CS, "ShadowStyle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0245, 0x0070, 0x0245, + EVR_FL, "ShadowOffsetX", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0246, 0x0070, 0x0246, + EVR_FL, "ShadowOffsetY", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0247, 0x0070, 0x0247, + EVR_US, "ShadowColorCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0248, 0x0070, 0x0248, + EVR_CS, "Underlined", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0249, 0x0070, 0x0249, + EVR_CS, "Bold", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0250, 0x0070, 0x0250, + EVR_CS, "Italic", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0251, 0x0070, 0x0251, + EVR_US, "PatternOnColorCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0252, 0x0070, 0x0252, + EVR_US, "PatternOffColorCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0253, 0x0070, 0x0253, + EVR_FL, "LineThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0254, 0x0070, 0x0254, + EVR_CS, "LineDashingStyle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0255, 0x0070, 0x0255, + EVR_UL, "LinePattern", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0256, 0x0070, 0x0256, + EVR_OB, "FillPattern", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0257, 0x0070, 0x0257, + EVR_CS, "FillMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0258, 0x0070, 0x0258, + EVR_FL, "ShadowOpacity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0261, 0x0070, 0x0261, + EVR_FL, "GapLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0262, 0x0070, 0x0262, + EVR_FL, "DiameterOfVisibility", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0273, 0x0070, 0x0273, + EVR_FL, "RotationPoint", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0274, 0x0070, 0x0274, + EVR_CS, "TickAlignment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0278, 0x0070, 0x0278, + EVR_CS, "ShowTickLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0279, 0x0070, 0x0279, + EVR_CS, "TickLabelAlignment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0282, 0x0070, 0x0282, + EVR_CS, "CompoundGraphicUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0284, 0x0070, 0x0284, + EVR_FL, "PatternOnOpacity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0285, 0x0070, 0x0285, + EVR_FL, "PatternOffOpacity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0287, 0x0070, 0x0287, + EVR_SQ, "MajorTicksSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0288, 0x0070, 0x0288, + EVR_FL, "TickPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0289, 0x0070, 0x0289, + EVR_SH, "TickLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0294, 0x0070, 0x0294, + EVR_CS, "CompoundGraphicType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0295, 0x0070, 0x0295, + EVR_UL, "GraphicGroupID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0306, 0x0070, 0x0306, + EVR_CS, "ShapeType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0308, 0x0070, 0x0308, + EVR_SQ, "RegistrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0309, 0x0070, 0x0309, + EVR_SQ, "MatrixRegistrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x030a, 0x0070, 0x030a, + EVR_SQ, "MatrixSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x030b, 0x0070, 0x030b, + EVR_FD, "FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix", 16, 16, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x030c, 0x0070, 0x030c, + EVR_CS, "FrameOfReferenceTransformationMatrixType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x030d, 0x0070, 0x030d, + EVR_SQ, "RegistrationTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x030f, 0x0070, 0x030f, + EVR_ST, "FiducialDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0310, 0x0070, 0x0310, + EVR_SH, "FiducialIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0311, 0x0070, 0x0311, + EVR_SQ, "FiducialIdentifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0312, 0x0070, 0x0312, + EVR_FD, "ContourUncertaintyRadius", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0314, 0x0070, 0x0314, + EVR_SQ, "UsedFiducialsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0318, 0x0070, 0x0318, + EVR_SQ, "GraphicCoordinatesDataSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x031a, 0x0070, 0x031a, + EVR_UI, "FiducialUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x031b, 0x0070, 0x031b, + EVR_UI, "ReferencedFiducialUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x031c, 0x0070, 0x031c, + EVR_SQ, "FiducialSetSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x031e, 0x0070, 0x031e, + EVR_SQ, "FiducialSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x031f, 0x0070, 0x031f, + EVR_SQ, "FiducialsPropertyCategoryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0401, 0x0070, 0x0401, + EVR_US, "GraphicLayerRecommendedDisplayCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0402, 0x0070, 0x0402, + EVR_SQ, "BlendingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0403, 0x0070, 0x0403, + EVR_FL, "RelativeOpacity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0404, 0x0070, 0x0404, + EVR_SQ, "ReferencedSpatialRegistrationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x0405, 0x0070, 0x0405, + EVR_CS, "BlendingPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1101, 0x0070, 0x1101, + EVR_UI, "PresentationDisplayCollectionUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1102, 0x0070, 0x1102, + EVR_UI, "PresentationSequenceCollectionUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1103, 0x0070, 0x1103, + EVR_US, "PresentationSequencePositionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1104, 0x0070, 0x1104, + EVR_SQ, "RenderedImageReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1201, 0x0070, 0x1201, + EVR_SQ, "VolumetricPresentationStateInputSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1202, 0x0070, 0x1202, + EVR_CS, "PresentationInputType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1203, 0x0070, 0x1203, + EVR_US, "InputSequencePositionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1204, 0x0070, 0x1204, + EVR_CS, "Crop", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1205, 0x0070, 0x1205, + EVR_US, "CroppingSpecificationIndex", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1206, 0x0070, 0x1206, + EVR_CS, "RETIRED_CompositingMethod", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1207, 0x0070, 0x1207, + EVR_US, "VolumetricPresentationInputNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1208, 0x0070, 0x1208, + EVR_CS, "ImageVolumeGeometry", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1209, 0x0070, 0x1209, + EVR_UI, "VolumetricPresentationInputSetUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x120a, 0x0070, 0x120a, + EVR_SQ, "VolumetricPresentationInputSetSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x120b, 0x0070, 0x120b, + EVR_CS, "GlobalCrop", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x120c, 0x0070, 0x120c, + EVR_US, "GlobalCroppingSpecificationIndex", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x120d, 0x0070, 0x120d, + EVR_CS, "RenderingMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1301, 0x0070, 0x1301, + EVR_SQ, "VolumeCroppingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1302, 0x0070, 0x1302, + EVR_CS, "VolumeCroppingMethod", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1303, 0x0070, 0x1303, + EVR_FD, "BoundingBoxCrop", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1304, 0x0070, 0x1304, + EVR_SQ, "ObliqueCroppingPlaneSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1305, 0x0070, 0x1305, + EVR_FD, "Plane", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1306, 0x0070, 0x1306, + EVR_FD, "PlaneNormal", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1309, 0x0070, 0x1309, + EVR_US, "CroppingSpecificationNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1501, 0x0070, 0x1501, + EVR_CS, "MultiPlanarReconstructionStyle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1502, 0x0070, 0x1502, + EVR_CS, "MPRThicknessType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1503, 0x0070, 0x1503, + EVR_FD, "MPRSlabThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1505, 0x0070, 0x1505, + EVR_FD, "MPRTopLeftHandCorner", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1507, 0x0070, 0x1507, + EVR_FD, "MPRViewWidthDirection", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1508, 0x0070, 0x1508, + EVR_FD, "MPRViewWidth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x150c, 0x0070, 0x150c, + EVR_UL, "NumberOfVolumetricCurvePoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x150d, 0x0070, 0x150d, + EVR_OD, "VolumetricCurvePoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1511, 0x0070, 0x1511, + EVR_FD, "MPRViewHeightDirection", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1512, 0x0070, 0x1512, + EVR_FD, "MPRViewHeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1602, 0x0070, 0x1602, + EVR_CS, "RenderProjection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1603, 0x0070, 0x1603, + EVR_FD, "ViewpointPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1604, 0x0070, 0x1604, + EVR_FD, "ViewpointLookAtPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1605, 0x0070, 0x1605, + EVR_FD, "ViewpointUpDirection", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1606, 0x0070, 0x1606, + EVR_FD, "RenderFieldOfView", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1607, 0x0070, 0x1607, + EVR_FD, "SamplingStepSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1701, 0x0070, 0x1701, + EVR_CS, "ShadingStyle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1702, 0x0070, 0x1702, + EVR_FD, "AmbientReflectionIntensity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1703, 0x0070, 0x1703, + EVR_FD, "LightDirection", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1704, 0x0070, 0x1704, + EVR_FD, "DiffuseReflectionIntensity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1705, 0x0070, 0x1705, + EVR_FD, "SpecularReflectionIntensity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1706, 0x0070, 0x1706, + EVR_FD, "Shininess", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1801, 0x0070, 0x1801, + EVR_SQ, "PresentationStateClassificationComponentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1802, 0x0070, 0x1802, + EVR_CS, "ComponentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1803, 0x0070, 0x1803, + EVR_SQ, "ComponentInputSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1804, 0x0070, 0x1804, + EVR_US, "VolumetricPresentationInputIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1805, 0x0070, 0x1805, + EVR_SQ, "PresentationStateCompositorComponentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1806, 0x0070, 0x1806, + EVR_SQ, "WeightingTransferFunctionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1807, 0x0070, 0x1807, + EVR_US, "WeightingLookupTableDescriptor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1808, 0x0070, 0x1808, + EVR_OB, "WeightingLookupTableData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1901, 0x0070, 0x1901, + EVR_SQ, "VolumetricAnnotationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1903, 0x0070, 0x1903, + EVR_SQ, "ReferencedStructuredContextSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1904, 0x0070, 0x1904, + EVR_UI, "ReferencedContentItem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1905, 0x0070, 0x1905, + EVR_SQ, "VolumetricPresentationInputAnnotationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1907, 0x0070, 0x1907, + EVR_CS, "AnnotationClipping", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a01, 0x0070, 0x1a01, + EVR_CS, "PresentationAnimationStyle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a03, 0x0070, 0x1a03, + EVR_FD, "RecommendedAnimationRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a04, 0x0070, 0x1a04, + EVR_SQ, "AnimationCurveSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a05, 0x0070, 0x1a05, + EVR_FD, "AnimationStepSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a06, 0x0070, 0x1a06, + EVR_FD, "SwivelRange", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a07, 0x0070, 0x1a07, + EVR_OD, "VolumetricCurveUpDirections", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a08, 0x0070, 0x1a08, + EVR_SQ, "VolumeStreamSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1a09, 0x0070, 0x1a09, + EVR_LO, "RGBATransferFunctionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b01, 0x0070, 0x1b01, + EVR_SQ, "AdvancedBlendingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b02, 0x0070, 0x1b02, + EVR_US, "BlendingInputNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b03, 0x0070, 0x1b03, + EVR_SQ, "BlendingDisplayInputSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b04, 0x0070, 0x1b04, + EVR_SQ, "BlendingDisplaySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b06, 0x0070, 0x1b06, + EVR_CS, "BlendingMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b07, 0x0070, 0x1b07, + EVR_CS, "TimeSeriesBlending", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b08, 0x0070, 0x1b08, + EVR_CS, "GeometryForDisplay", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b11, 0x0070, 0x1b11, + EVR_SQ, "ThresholdSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b12, 0x0070, 0x1b12, + EVR_SQ, "ThresholdValueSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b13, 0x0070, 0x1b13, + EVR_CS, "ThresholdType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0070, 0x1b14, 0x0070, 0x1b14, + EVR_FD, "ThresholdValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0002, 0x0072, 0x0002, + EVR_SH, "HangingProtocolName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0004, 0x0072, 0x0004, + EVR_LO, "HangingProtocolDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0006, 0x0072, 0x0006, + EVR_CS, "HangingProtocolLevel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0008, 0x0072, 0x0008, + EVR_LO, "HangingProtocolCreator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x000a, 0x0072, 0x000a, + EVR_DT, "HangingProtocolCreationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x000c, 0x0072, 0x000c, + EVR_SQ, "HangingProtocolDefinitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x000e, 0x0072, 0x000e, + EVR_SQ, "HangingProtocolUserIdentificationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0010, 0x0072, 0x0010, + EVR_LO, "HangingProtocolUserGroupName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0012, 0x0072, 0x0012, + EVR_SQ, "SourceHangingProtocolSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0014, 0x0072, 0x0014, + EVR_US, "NumberOfPriorsReferenced", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0020, 0x0072, 0x0020, + EVR_SQ, "ImageSetsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0022, 0x0072, 0x0022, + EVR_SQ, "ImageSetSelectorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0024, 0x0072, 0x0024, + EVR_CS, "ImageSetSelectorUsageFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0026, 0x0072, 0x0026, + EVR_AT, "SelectorAttribute", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0028, 0x0072, 0x0028, + EVR_US, "SelectorValueNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0030, 0x0072, 0x0030, + EVR_SQ, "TimeBasedImageSetsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0032, 0x0072, 0x0032, + EVR_US, "ImageSetNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0034, 0x0072, 0x0034, + EVR_CS, "ImageSetSelectorCategory", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0038, 0x0072, 0x0038, + EVR_US, "RelativeTime", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x003a, 0x0072, 0x003a, + EVR_CS, "RelativeTimeUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x003c, 0x0072, 0x003c, + EVR_SS, "AbstractPriorValue", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x003e, 0x0072, 0x003e, + EVR_SQ, "AbstractPriorCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0040, 0x0072, 0x0040, + EVR_LO, "ImageSetLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0050, 0x0072, 0x0050, + EVR_CS, "SelectorAttributeVR", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0052, 0x0072, 0x0052, + EVR_AT, "SelectorSequencePointer", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0054, 0x0072, 0x0054, + EVR_LO, "SelectorSequencePointerPrivateCreator", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0056, 0x0072, 0x0056, + EVR_LO, "SelectorAttributePrivateCreator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x005e, 0x0072, 0x005e, + EVR_AE, "SelectorAEValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x005f, 0x0072, 0x005f, + EVR_AS, "SelectorASValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0060, 0x0072, 0x0060, + EVR_AT, "SelectorATValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0061, 0x0072, 0x0061, + EVR_DA, "SelectorDAValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0062, 0x0072, 0x0062, + EVR_CS, "SelectorCSValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0063, 0x0072, 0x0063, + EVR_DT, "SelectorDTValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0064, 0x0072, 0x0064, + EVR_IS, "SelectorISValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0065, 0x0072, 0x0065, + EVR_OB, "SelectorOBValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0066, 0x0072, 0x0066, + EVR_LO, "SelectorLOValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0067, 0x0072, 0x0067, + EVR_OF, "SelectorOFValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0068, 0x0072, 0x0068, + EVR_LT, "SelectorLTValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0069, 0x0072, 0x0069, + EVR_OW, "SelectorOWValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x006a, 0x0072, 0x006a, + EVR_PN, "SelectorPNValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x006b, 0x0072, 0x006b, + EVR_TM, "SelectorTMValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x006c, 0x0072, 0x006c, + EVR_SH, "SelectorSHValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x006d, 0x0072, 0x006d, + EVR_UN, "SelectorUNValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x006e, 0x0072, 0x006e, + EVR_ST, "SelectorSTValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x006f, 0x0072, 0x006f, + EVR_UC, "SelectorUCValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0070, 0x0072, 0x0070, + EVR_UT, "SelectorUTValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0071, 0x0072, 0x0071, + EVR_UR, "SelectorURValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0072, 0x0072, 0x0072, + EVR_DS, "SelectorDSValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0073, 0x0072, 0x0073, + EVR_OD, "SelectorODValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0074, 0x0072, 0x0074, + EVR_FD, "SelectorFDValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0075, 0x0072, 0x0075, + EVR_OL, "SelectorOLValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0076, 0x0072, 0x0076, + EVR_FL, "SelectorFLValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0078, 0x0072, 0x0078, + EVR_UL, "SelectorULValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x007a, 0x0072, 0x007a, + EVR_US, "SelectorUSValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x007c, 0x0072, 0x007c, + EVR_SL, "SelectorSLValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x007e, 0x0072, 0x007e, + EVR_SS, "SelectorSSValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x007f, 0x0072, 0x007f, + EVR_UI, "SelectorUIValue", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0080, 0x0072, 0x0080, + EVR_SQ, "SelectorCodeSequenceValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0100, 0x0072, 0x0100, + EVR_US, "NumberOfScreens", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0102, 0x0072, 0x0102, + EVR_SQ, "NominalScreenDefinitionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0104, 0x0072, 0x0104, + EVR_US, "NumberOfVerticalPixels", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0106, 0x0072, 0x0106, + EVR_US, "NumberOfHorizontalPixels", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0108, 0x0072, 0x0108, + EVR_FD, "DisplayEnvironmentSpatialPosition", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x010a, 0x0072, 0x010a, + EVR_US, "ScreenMinimumGrayscaleBitDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x010c, 0x0072, 0x010c, + EVR_US, "ScreenMinimumColorBitDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x010e, 0x0072, 0x010e, + EVR_US, "ApplicationMaximumRepaintTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0200, 0x0072, 0x0200, + EVR_SQ, "DisplaySetsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0202, 0x0072, 0x0202, + EVR_US, "DisplaySetNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0203, 0x0072, 0x0203, + EVR_LO, "DisplaySetLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0204, 0x0072, 0x0204, + EVR_US, "DisplaySetPresentationGroup", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0206, 0x0072, 0x0206, + EVR_LO, "DisplaySetPresentationGroupDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0208, 0x0072, 0x0208, + EVR_CS, "PartialDataDisplayHandling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0210, 0x0072, 0x0210, + EVR_SQ, "SynchronizedScrollingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0212, 0x0072, 0x0212, + EVR_US, "DisplaySetScrollingGroup", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0214, 0x0072, 0x0214, + EVR_SQ, "NavigationIndicatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0216, 0x0072, 0x0216, + EVR_US, "NavigationDisplaySet", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0218, 0x0072, 0x0218, + EVR_US, "ReferenceDisplaySets", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0300, 0x0072, 0x0300, + EVR_SQ, "ImageBoxesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0302, 0x0072, 0x0302, + EVR_US, "ImageBoxNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0304, 0x0072, 0x0304, + EVR_CS, "ImageBoxLayoutType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0306, 0x0072, 0x0306, + EVR_US, "ImageBoxTileHorizontalDimension", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0308, 0x0072, 0x0308, + EVR_US, "ImageBoxTileVerticalDimension", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0310, 0x0072, 0x0310, + EVR_CS, "ImageBoxScrollDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0312, 0x0072, 0x0312, + EVR_CS, "ImageBoxSmallScrollType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0314, 0x0072, 0x0314, + EVR_US, "ImageBoxSmallScrollAmount", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0316, 0x0072, 0x0316, + EVR_CS, "ImageBoxLargeScrollType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0318, 0x0072, 0x0318, + EVR_US, "ImageBoxLargeScrollAmount", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0320, 0x0072, 0x0320, + EVR_US, "ImageBoxOverlapPriority", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0330, 0x0072, 0x0330, + EVR_FD, "CineRelativeToRealTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0400, 0x0072, 0x0400, + EVR_SQ, "FilterOperationsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0402, 0x0072, 0x0402, + EVR_CS, "FilterByCategory", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0404, 0x0072, 0x0404, + EVR_CS, "FilterByAttributePresence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0406, 0x0072, 0x0406, + EVR_CS, "FilterByOperator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0420, 0x0072, 0x0420, + EVR_US, "StructuredDisplayBackgroundCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0421, 0x0072, 0x0421, + EVR_US, "EmptyImageBoxCIELabValue", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0422, 0x0072, 0x0422, + EVR_SQ, "StructuredDisplayImageBoxSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0424, 0x0072, 0x0424, + EVR_SQ, "StructuredDisplayTextBoxSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0427, 0x0072, 0x0427, + EVR_SQ, "ReferencedFirstFrameSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0430, 0x0072, 0x0430, + EVR_SQ, "ImageBoxSynchronizationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0432, 0x0072, 0x0432, + EVR_US, "SynchronizedImageBoxList", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0434, 0x0072, 0x0434, + EVR_CS, "TypeOfSynchronization", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0500, 0x0072, 0x0500, + EVR_CS, "BlendingOperationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0510, 0x0072, 0x0510, + EVR_CS, "ReformattingOperationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0512, 0x0072, 0x0512, + EVR_FD, "ReformattingThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0514, 0x0072, 0x0514, + EVR_FD, "ReformattingInterval", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0516, 0x0072, 0x0516, + EVR_CS, "ReformattingOperationInitialViewDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0520, 0x0072, 0x0520, + EVR_CS, "ThreeDRenderingType", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0600, 0x0072, 0x0600, + EVR_SQ, "SortingOperationsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0602, 0x0072, 0x0602, + EVR_CS, "SortByCategory", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0604, 0x0072, 0x0604, + EVR_CS, "SortingDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0700, 0x0072, 0x0700, + EVR_CS, "DisplaySetPatientOrientation", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0702, 0x0072, 0x0702, + EVR_CS, "VOIType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0704, 0x0072, 0x0704, + EVR_CS, "PseudoColorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0705, 0x0072, 0x0705, + EVR_SQ, "PseudoColorPaletteInstanceReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0706, 0x0072, 0x0706, + EVR_CS, "ShowGrayscaleInverted", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0710, 0x0072, 0x0710, + EVR_CS, "ShowImageTrueSizeFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0712, 0x0072, 0x0712, + EVR_CS, "ShowGraphicAnnotationFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0714, 0x0072, 0x0714, + EVR_CS, "ShowPatientDemographicsFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0716, 0x0072, 0x0716, + EVR_CS, "ShowAcquisitionTechniquesFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0717, 0x0072, 0x0717, + EVR_CS, "DisplaySetHorizontalJustification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0072, 0x0718, 0x0072, 0x0718, + EVR_CS, "DisplaySetVerticalJustification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x0120, 0x0074, 0x0120, + EVR_FD, "ContinuationStartMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x0121, 0x0074, 0x0121, + EVR_FD, "ContinuationEndMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1000, 0x0074, 0x1000, + EVR_CS, "ProcedureStepState", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1002, 0x0074, 0x1002, + EVR_SQ, "ProcedureStepProgressInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1004, 0x0074, 0x1004, + EVR_DS, "ProcedureStepProgress", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1006, 0x0074, 0x1006, + EVR_ST, "ProcedureStepProgressDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1007, 0x0074, 0x1007, + EVR_SQ, "ProcedureStepProgressParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1008, 0x0074, 0x1008, + EVR_SQ, "ProcedureStepCommunicationsURISequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x100a, 0x0074, 0x100a, + EVR_UR, "ContactURI", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x100c, 0x0074, 0x100c, + EVR_LO, "ContactDisplayName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x100e, 0x0074, 0x100e, + EVR_SQ, "ProcedureStepDiscontinuationReasonCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1020, 0x0074, 0x1020, + EVR_SQ, "BeamTaskSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1022, 0x0074, 0x1022, + EVR_CS, "BeamTaskType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1024, 0x0074, 0x1024, + EVR_IS, "RETIRED_BeamOrderIndexTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1025, 0x0074, 0x1025, + EVR_CS, "AutosequenceFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1026, 0x0074, 0x1026, + EVR_FD, "TableTopVerticalAdjustedPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1027, 0x0074, 0x1027, + EVR_FD, "TableTopLongitudinalAdjustedPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1028, 0x0074, 0x1028, + EVR_FD, "TableTopLateralAdjustedPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x102a, 0x0074, 0x102a, + EVR_FD, "PatientSupportAdjustedAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x102b, 0x0074, 0x102b, + EVR_FD, "TableTopEccentricAdjustedAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x102c, 0x0074, 0x102c, + EVR_FD, "TableTopPitchAdjustedAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x102d, 0x0074, 0x102d, + EVR_FD, "TableTopRollAdjustedAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1030, 0x0074, 0x1030, + EVR_SQ, "DeliveryVerificationImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1032, 0x0074, 0x1032, + EVR_CS, "VerificationImageTiming", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1034, 0x0074, 0x1034, + EVR_CS, "DoubleExposureFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1036, 0x0074, 0x1036, + EVR_CS, "DoubleExposureOrdering", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1038, 0x0074, 0x1038, + EVR_DS, "RETIRED_DoubleExposureMetersetTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x103a, 0x0074, 0x103a, + EVR_DS, "RETIRED_DoubleExposureFieldDeltaTrial", 4, 4, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1040, 0x0074, 0x1040, + EVR_SQ, "RelatedReferenceRTImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1042, 0x0074, 0x1042, + EVR_SQ, "GeneralMachineVerificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1044, 0x0074, 0x1044, + EVR_SQ, "ConventionalMachineVerificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1046, 0x0074, 0x1046, + EVR_SQ, "IonMachineVerificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1048, 0x0074, 0x1048, + EVR_SQ, "FailedAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x104a, 0x0074, 0x104a, + EVR_SQ, "OverriddenAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x104c, 0x0074, 0x104c, + EVR_SQ, "ConventionalControlPointVerificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x104e, 0x0074, 0x104e, + EVR_SQ, "IonControlPointVerificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1050, 0x0074, 0x1050, + EVR_SQ, "AttributeOccurrenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1052, 0x0074, 0x1052, + EVR_AT, "AttributeOccurrencePointer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1054, 0x0074, 0x1054, + EVR_UL, "AttributeItemSelector", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1056, 0x0074, 0x1056, + EVR_LO, "AttributeOccurrencePrivateCreator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1057, 0x0074, 0x1057, + EVR_IS, "SelectorSequencePointerItems", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1200, 0x0074, 0x1200, + EVR_CS, "ScheduledProcedureStepPriority", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1202, 0x0074, 0x1202, + EVR_LO, "WorklistLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1204, 0x0074, 0x1204, + EVR_LO, "ProcedureStepLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1210, 0x0074, 0x1210, + EVR_SQ, "ScheduledProcessingParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1212, 0x0074, 0x1212, + EVR_SQ, "PerformedProcessingParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1216, 0x0074, 0x1216, + EVR_SQ, "UnifiedProcedureStepPerformedProcedureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1220, 0x0074, 0x1220, + EVR_SQ, "RETIRED_RelatedProcedureStepSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1222, 0x0074, 0x1222, + EVR_LO, "RETIRED_ProcedureStepRelationshipType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1224, 0x0074, 0x1224, + EVR_SQ, "ReplacedProcedureStepSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1230, 0x0074, 0x1230, + EVR_LO, "DeletionLock", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1234, 0x0074, 0x1234, + EVR_AE, "ReceivingAE", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1236, 0x0074, 0x1236, + EVR_AE, "RequestingAE", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1238, 0x0074, 0x1238, + EVR_LT, "ReasonForCancellation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1242, 0x0074, 0x1242, + EVR_CS, "SCPStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1244, 0x0074, 0x1244, + EVR_CS, "SubscriptionListStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1246, 0x0074, 0x1246, + EVR_CS, "UnifiedProcedureStepListStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1324, 0x0074, 0x1324, + EVR_UL, "BeamOrderIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1338, 0x0074, 0x1338, + EVR_FD, "DoubleExposureMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x133a, 0x0074, 0x133a, + EVR_FD, "DoubleExposureFieldDelta", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1401, 0x0074, 0x1401, + EVR_SQ, "BrachyTaskSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1402, 0x0074, 0x1402, + EVR_DS, "ContinuationStartTotalReferenceAirKerma", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1403, 0x0074, 0x1403, + EVR_DS, "ContinuationEndTotalReferenceAirKerma", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1404, 0x0074, 0x1404, + EVR_IS, "ContinuationPulseNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1405, 0x0074, 0x1405, + EVR_SQ, "ChannelDeliveryOrderSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1406, 0x0074, 0x1406, + EVR_IS, "ReferencedChannelNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1407, 0x0074, 0x1407, + EVR_DS, "StartCumulativeTimeWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1408, 0x0074, 0x1408, + EVR_DS, "EndCumulativeTimeWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x1409, 0x0074, 0x1409, + EVR_SQ, "OmittedChannelSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x140a, 0x0074, 0x140a, + EVR_CS, "ReasonForChannelOmission", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x140b, 0x0074, 0x140b, + EVR_LO, "ReasonForChannelOmissionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x140c, 0x0074, 0x140c, + EVR_IS, "ChannelDeliveryOrderIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x140d, 0x0074, 0x140d, + EVR_SQ, "ChannelDeliveryContinuationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0074, 0x140e, 0x0074, 0x140e, + EVR_SQ, "OmittedApplicationSetupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0001, 0x0076, 0x0001, + EVR_LO, "ImplantAssemblyTemplateName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0003, 0x0076, 0x0003, + EVR_LO, "ImplantAssemblyTemplateIssuer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0006, 0x0076, 0x0006, + EVR_LO, "ImplantAssemblyTemplateVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0008, 0x0076, 0x0008, + EVR_SQ, "ReplacedImplantAssemblyTemplateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x000a, 0x0076, 0x000a, + EVR_CS, "ImplantAssemblyTemplateType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x000c, 0x0076, 0x000c, + EVR_SQ, "OriginalImplantAssemblyTemplateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x000e, 0x0076, 0x000e, + EVR_SQ, "DerivationImplantAssemblyTemplateSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0010, 0x0076, 0x0010, + EVR_SQ, "ImplantAssemblyTemplateTargetAnatomySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0020, 0x0076, 0x0020, + EVR_SQ, "ProcedureTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0030, 0x0076, 0x0030, + EVR_LO, "SurgicalTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0032, 0x0076, 0x0032, + EVR_SQ, "ComponentTypesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0034, 0x0076, 0x0034, + EVR_SQ, "ComponentTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0036, 0x0076, 0x0036, + EVR_CS, "ExclusiveComponentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0038, 0x0076, 0x0038, + EVR_CS, "MandatoryComponentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0040, 0x0076, 0x0040, + EVR_SQ, "ComponentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0055, 0x0076, 0x0055, + EVR_US, "ComponentID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0060, 0x0076, 0x0060, + EVR_SQ, "ComponentAssemblySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0070, 0x0076, 0x0070, + EVR_US, "Component1ReferencedID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0080, 0x0076, 0x0080, + EVR_US, "Component1ReferencedMatingFeatureSetID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x0090, 0x0076, 0x0090, + EVR_US, "Component1ReferencedMatingFeatureID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x00a0, 0x0076, 0x00a0, + EVR_US, "Component2ReferencedID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x00b0, 0x0076, 0x00b0, + EVR_US, "Component2ReferencedMatingFeatureSetID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0076, 0x00c0, 0x0076, 0x00c0, + EVR_US, "Component2ReferencedMatingFeatureID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0001, 0x0078, 0x0001, + EVR_LO, "ImplantTemplateGroupName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0010, 0x0078, 0x0010, + EVR_ST, "ImplantTemplateGroupDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0020, 0x0078, 0x0020, + EVR_LO, "ImplantTemplateGroupIssuer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0024, 0x0078, 0x0024, + EVR_LO, "ImplantTemplateGroupVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0026, 0x0078, 0x0026, + EVR_SQ, "ReplacedImplantTemplateGroupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0028, 0x0078, 0x0028, + EVR_SQ, "ImplantTemplateGroupTargetAnatomySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x002a, 0x0078, 0x002a, + EVR_SQ, "ImplantTemplateGroupMembersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x002e, 0x0078, 0x002e, + EVR_US, "ImplantTemplateGroupMemberID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0050, 0x0078, 0x0050, + EVR_FD, "ThreeDImplantTemplateGroupMemberMatchingPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0060, 0x0078, 0x0060, + EVR_FD, "ThreeDImplantTemplateGroupMemberMatchingAxes", 9, 9, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0070, 0x0078, 0x0070, + EVR_SQ, "ImplantTemplateGroupMemberMatching2DCoordinatesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x0090, 0x0078, 0x0090, + EVR_FD, "TwoDImplantTemplateGroupMemberMatchingPoint", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x00a0, 0x0078, 0x00a0, + EVR_FD, "TwoDImplantTemplateGroupMemberMatchingAxes", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x00b0, 0x0078, 0x00b0, + EVR_SQ, "ImplantTemplateGroupVariationDimensionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x00b2, 0x0078, 0x00b2, + EVR_LO, "ImplantTemplateGroupVariationDimensionName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x00b4, 0x0078, 0x00b4, + EVR_SQ, "ImplantTemplateGroupVariationDimensionRankSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x00b6, 0x0078, 0x00b6, + EVR_US, "ReferencedImplantTemplateGroupMemberID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0078, 0x00b8, 0x0078, 0x00b8, + EVR_US, "ImplantTemplateGroupVariationDimensionRank", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0001, 0x0080, 0x0001, + EVR_SQ, "SurfaceScanAcquisitionTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0002, 0x0080, 0x0002, + EVR_SQ, "SurfaceScanModeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0003, 0x0080, 0x0003, + EVR_SQ, "RegistrationMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0004, 0x0080, 0x0004, + EVR_FD, "ShotDurationTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0005, 0x0080, 0x0005, + EVR_FD, "ShotOffsetTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0006, 0x0080, 0x0006, + EVR_US, "SurfacePointPresentationValueData", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0007, 0x0080, 0x0007, + EVR_US, "SurfacePointColorCIELabValueData", 3, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0008, 0x0080, 0x0008, + EVR_SQ, "UVMappingSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0009, 0x0080, 0x0009, + EVR_SH, "TextureLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0010, 0x0080, 0x0010, + EVR_OF, "UValueData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0011, 0x0080, 0x0011, + EVR_OF, "VValueData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0012, 0x0080, 0x0012, + EVR_SQ, "ReferencedTextureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0080, 0x0013, 0x0080, 0x0013, + EVR_SQ, "ReferencedSurfaceDataSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0001, 0x0082, 0x0001, + EVR_CS, "AssessmentSummary", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0003, 0x0082, 0x0003, + EVR_UT, "AssessmentSummaryDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0004, 0x0082, 0x0004, + EVR_SQ, "AssessedSOPInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0005, 0x0082, 0x0005, + EVR_SQ, "ReferencedComparisonSOPInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0006, 0x0082, 0x0006, + EVR_UL, "NumberOfAssessmentObservations", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0007, 0x0082, 0x0007, + EVR_SQ, "AssessmentObservationsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0008, 0x0082, 0x0008, + EVR_CS, "ObservationSignificance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x000a, 0x0082, 0x000a, + EVR_UT, "ObservationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x000c, 0x0082, 0x000c, + EVR_SQ, "StructuredConstraintObservationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0010, 0x0082, 0x0010, + EVR_SQ, "AssessedAttributeValueSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0016, 0x0082, 0x0016, + EVR_LO, "AssessmentSetID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0017, 0x0082, 0x0017, + EVR_SQ, "AssessmentRequesterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0018, 0x0082, 0x0018, + EVR_LO, "SelectorAttributeName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0019, 0x0082, 0x0019, + EVR_LO, "SelectorAttributeKeyword", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0021, 0x0082, 0x0021, + EVR_SQ, "AssessmentTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0022, 0x0082, 0x0022, + EVR_SQ, "ObservationBasisCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0023, 0x0082, 0x0023, + EVR_LO, "AssessmentLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0032, 0x0082, 0x0032, + EVR_CS, "ConstraintType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0033, 0x0082, 0x0033, + EVR_UT, "SpecificationSelectionGuidance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0034, 0x0082, 0x0034, + EVR_SQ, "ConstraintValueSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0035, 0x0082, 0x0035, + EVR_SQ, "RecommendedDefaultValueSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0036, 0x0082, 0x0036, + EVR_CS, "ConstraintViolationSignificance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0037, 0x0082, 0x0037, + EVR_UT, "ConstraintViolationCondition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0082, 0x0038, 0x0082, 0x0038, + EVR_CS, "ModifiableConstraintFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0087, 0x0010, 0x0087, 0x0010, + EVR_CS, "MediaType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "1.2.840.113708.794.1.1.2.0" } + , { 0x0087, 0x0020, 0x0087, 0x0020, + EVR_CS, "MediaLocation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "1.2.840.113708.794.1.1.2.0" } + , { 0x0087, 0x0050, 0x0087, 0x0050, + EVR_IS, "EstimatedRetrieveTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "1.2.840.113708.794.1.1.2.0" } +#endif + , { 0x0088, 0x0130, 0x0088, 0x0130, + EVR_SH, "StorageMediaFileSetID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0088, 0x0140, 0x0088, 0x0140, + EVR_UI, "StorageMediaFileSetUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0088, 0x0200, 0x0088, 0x0200, + EVR_SQ, "IconImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0088, 0x0904, 0x0088, 0x0904, + EVR_LO, "RETIRED_TopicTitle", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0088, 0x0906, 0x0088, 0x0906, + EVR_ST, "RETIRED_TopicSubject", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0088, 0x0910, 0x0088, 0x0910, + EVR_LO, "RETIRED_TopicAuthor", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0088, 0x0912, 0x0088, 0x0912, + EVR_LO, "RETIRED_TopicKeywords", 1, 32, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0089, 0x0010, 0x0089, 0x0010, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "DIDI TO PCR 1.1" } + , { 0x0095, 0x0001, 0x0095, 0x0001, + EVR_LT, "ExaminationFolderID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0095, 0x0004, 0x0095, 0x0004, + EVR_UL, "FolderReportedStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0095, 0x0005, 0x0095, 0x0005, + EVR_LT, "FolderReportingRadiologist", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0095, 0x0007, 0x0095, 0x0007, + EVR_LT, "SIENETISAPLA", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x0099, 0x0002, 0x0099, 0x0002, + EVR_UL, "DataObjectAttributes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIENET" } + , { 0x00e1, 0x0001, 0x00e1, 0x0001, + EVR_US, "DataDictionaryVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x00e1, 0x0014, 0x00e1, 0x0014, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x00e1, 0x0022, 0x00e1, 0x0022, + EVR_DS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x00e1, 0x0023, 0x00e1, 0x0023, + EVR_DS, "Unknown", 2, 2, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x00e1, 0x0024, 0x00e1, 0x0024, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x00e1, 0x0025, 0x00e1, 0x0025, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x00e1, 0x0040, 0x00e1, 0x0040, + EVR_SH, "OffsetFromCTMRImages", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } +#endif + , { 0x0100, 0x0410, 0x0100, 0x0410, + EVR_CS, "SOPInstanceStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0100, 0x0420, 0x0100, 0x0420, + EVR_DT, "SOPAuthorizationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0100, 0x0424, 0x0100, 0x0424, + EVR_LT, "SOPAuthorizationComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0100, 0x0426, 0x0100, 0x0426, + EVR_LO, "AuthorizationEquipmentCertificationNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0135, 0x0010, 0x0135, 0x0010, + EVR_LO, "UltrasoundScannerName", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SONOWAND AS" } + , { 0x0135, 0x0011, 0x0135, 0x0011, + EVR_LO, "TransducerSerial", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SONOWAND AS" } + , { 0x0135, 0x0012, 0x0135, 0x0012, + EVR_LO, "ProbeApplication", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SONOWAND AS" } + , { 0x0193, 0x0002, 0x0193, 0x0002, + EVR_DS, "RISKey", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0307, 0x0001, 0x0307, 0x0001, + EVR_UN, "RISWorklistIMGEF", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x0309, 0x0001, 0x0309, 0x0001, + EVR_UN, "RISReportIMGEF", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } +#endif + , { 0x0400, 0x0005, 0x0400, 0x0005, + EVR_US, "MACIDNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0010, 0x0400, 0x0010, + EVR_UI, "MACCalculationTransferSyntaxUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0015, 0x0400, 0x0015, + EVR_CS, "MACAlgorithm", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0020, 0x0400, 0x0020, + EVR_AT, "DataElementsSigned", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0100, 0x0400, 0x0100, + EVR_UI, "DigitalSignatureUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0105, 0x0400, 0x0105, + EVR_DT, "DigitalSignatureDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0110, 0x0400, 0x0110, + EVR_CS, "CertificateType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0115, 0x0400, 0x0115, + EVR_OB, "CertificateOfSigner", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0120, 0x0400, 0x0120, + EVR_OB, "Signature", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0305, 0x0400, 0x0305, + EVR_CS, "CertifiedTimestampType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0310, 0x0400, 0x0310, + EVR_OB, "CertifiedTimestamp", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0401, 0x0400, 0x0401, + EVR_SQ, "DigitalSignaturePurposeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0402, 0x0400, 0x0402, + EVR_SQ, "ReferencedDigitalSignatureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0403, 0x0400, 0x0403, + EVR_SQ, "ReferencedSOPInstanceMACSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0404, 0x0400, 0x0404, + EVR_OB, "MAC", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0500, 0x0400, 0x0500, + EVR_SQ, "EncryptedAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0510, 0x0400, 0x0510, + EVR_UI, "EncryptedContentTransferSyntaxUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0520, 0x0400, 0x0520, + EVR_OB, "EncryptedContent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0550, 0x0400, 0x0550, + EVR_SQ, "ModifiedAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0551, 0x0400, 0x0551, + EVR_SQ, "NonconformingModifiedAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0552, 0x0400, 0x0552, + EVR_OB, "NonconformingDataElementValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0561, 0x0400, 0x0561, + EVR_SQ, "OriginalAttributesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0562, 0x0400, 0x0562, + EVR_DT, "AttributeModificationDateTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0563, 0x0400, 0x0563, + EVR_LO, "ModifyingSystem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0564, 0x0400, 0x0564, + EVR_LO, "SourceOfPreviousValues", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0565, 0x0400, 0x0565, + EVR_CS, "ReasonForTheAttributeModification", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x0400, 0x0600, 0x0400, 0x0600, + EVR_CS, "InstanceOriginStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x0601, 0x0000, 0x0601, 0x0000, + EVR_SH, "ImplementationVersion", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0020, 0x0601, 0x0020, + EVR_DS, "RelativeTablePosition", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0021, 0x0601, 0x0021, + EVR_DS, "RelativeTableHeight", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0030, 0x0601, 0x0030, + EVR_SH, "SurviewDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0031, 0x0601, 0x0031, + EVR_DS, "SurviewLength", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0050, 0x0601, 0x0050, + EVR_SH, "ImageViewType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0070, 0x0601, 0x0070, + EVR_DS, "BatchNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0071, 0x0601, 0x0071, + EVR_DS, "BatchSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } + , { 0x0601, 0x0072, 0x0601, 0x0072, + EVR_DS, "BatchSliceNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "ELSCINT1" } +#endif + , { 0x1000, 0x0010, 0x1000, 0x0010, + EVR_US, "RETIRED_EscapeTriplet", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x1000, 0x0011, 0x1000, 0x0011, + EVR_US, "RETIRED_RunLengthTriplet", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x1000, 0x0012, 0x1000, 0x0012, + EVR_US, "RETIRED_HuffmanTableSize", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x1000, 0x0013, 0x1000, 0x0013, + EVR_US, "RETIRED_HuffmanTableTriplet", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x1000, 0x0014, 0x1000, 0x0014, + EVR_US, "RETIRED_ShiftTableSize", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x1000, 0x0015, 0x1000, 0x0015, + EVR_US, "RETIRED_ShiftTableTriplet", 3, 3, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x1010, 0x0004, 0x1010, 0x0004, + EVR_US, "RETIRED_ZonalMap", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x1369, 0x0000, 0x1369, 0x0000, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "AEGIS_DICOM_2.00" } +#endif + , { 0x2000, 0x0010, 0x2000, 0x0010, + EVR_IS, "NumberOfCopies", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x001e, 0x2000, 0x001e, + EVR_SQ, "PrinterConfigurationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0020, 0x2000, 0x0020, + EVR_CS, "PrintPriority", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0030, 0x2000, 0x0030, + EVR_CS, "MediumType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0040, 0x2000, 0x0040, + EVR_CS, "FilmDestination", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0050, 0x2000, 0x0050, + EVR_LO, "FilmSessionLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0060, 0x2000, 0x0060, + EVR_IS, "MemoryAllocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0061, 0x2000, 0x0061, + EVR_IS, "MaximumMemoryAllocation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0062, 0x2000, 0x0062, + EVR_CS, "RETIRED_ColorImagePrintingFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0063, 0x2000, 0x0063, + EVR_CS, "RETIRED_CollationFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0065, 0x2000, 0x0065, + EVR_CS, "RETIRED_AnnotationFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0067, 0x2000, 0x0067, + EVR_CS, "RETIRED_ImageOverlayFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0069, 0x2000, 0x0069, + EVR_CS, "RETIRED_PresentationLUTFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x006a, 0x2000, 0x006a, + EVR_CS, "RETIRED_ImageBoxPresentationLUTFlag", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x00a0, 0x2000, 0x00a0, + EVR_US, "MemoryBitDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x00a1, 0x2000, 0x00a1, + EVR_US, "PrintingBitDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x00a2, 0x2000, 0x00a2, + EVR_SQ, "MediaInstalledSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x00a4, 0x2000, 0x00a4, + EVR_SQ, "OtherMediaAvailableSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x00a8, 0x2000, 0x00a8, + EVR_SQ, "SupportedImageDisplayFormatsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0500, 0x2000, 0x0500, + EVR_SQ, "ReferencedFilmBoxSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2000, 0x0510, 0x2000, 0x0510, + EVR_SQ, "RETIRED_ReferencedStoredPrintSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x2001, 0x0001, 0x2001, 0x0001, + EVR_FL, "ChemicalShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0001, 0x2001, 0x0001, + EVR_FL, "ChemicalShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0002, 0x2001, 0x0002, + EVR_IS, "ChemicalShiftNumberMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0002, 0x2001, 0x0002, + EVR_IS, "ChemicalShiftNumberMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0003, 0x2001, 0x0003, + EVR_FL, "DiffusionBFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0003, 0x2001, 0x0003, + EVR_FL, "DiffusionBFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0004, 0x2001, 0x0004, + EVR_CS, "DiffusionDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0004, 0x2001, 0x0004, + EVR_CS, "DiffusionDirection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0006, 0x2001, 0x0006, + EVR_CS, "ImageEnhanced", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0006, 0x2001, 0x0006, + EVR_CS, "ImageEnhanced", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0007, 0x2001, 0x0007, + EVR_CS, "ImageTypeEDES", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0007, 0x2001, 0x0007, + EVR_CS, "ImageTypeEDES", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0008, 0x2001, 0x0008, + EVR_IS, "PhaseNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0008, 0x2001, 0x0008, + EVR_IS, "PhaseNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0009, 0x2001, 0x0009, + EVR_FL, "ImagePrepulseDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0009, 0x2001, 0x0009, + EVR_FL, "ImagePrepulseDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x000a, 0x2001, 0x000a, + EVR_IS, "SliceNumberMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x000a, 0x2001, 0x000a, + EVR_IS, "SliceNumberMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x000b, 0x2001, 0x000b, + EVR_CS, "SliceOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x000b, 0x2001, 0x000b, + EVR_CS, "SliceOrientation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x000c, 0x2001, 0x000c, + EVR_CS, "ArrhythmiaRejection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x000c, 0x2001, 0x000c, + EVR_CS, "ArrhythmiaRejection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x000e, 0x2001, 0x000e, + EVR_CS, "CardiacCycled", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x000e, 0x2001, 0x000e, + EVR_CS, "CardiacCycled", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x000f, 0x2001, 0x000f, + EVR_SS, "CardiacGateWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x000f, 0x2001, 0x000f, + EVR_SS, "CardiacGateWidth", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0010, 0x2001, 0x0010, + EVR_CS, "CardiacSync", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0010, 0x2001, 0x0010, + EVR_CS, "CardiacSync", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0011, 0x2001, 0x0011, + EVR_FL, "DiffusionEchoTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0011, 0x2001, 0x0011, + EVR_FL, "DiffusionEchoTime", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0012, 0x2001, 0x0012, + EVR_CS, "DynamicSeries", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0012, 0x2001, 0x0012, + EVR_CS, "DynamicSeries", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0013, 0x2001, 0x0013, + EVR_SL, "EPIFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0013, 0x2001, 0x0013, + EVR_SL, "EPIFactor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0014, 0x2001, 0x0014, + EVR_SL, "NumberOfEchoes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0014, 0x2001, 0x0014, + EVR_SL, "NumberOfEchoes", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0015, 0x2001, 0x0015, + EVR_SS, "NumberOfLocations", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0015, 0x2001, 0x0015, + EVR_SS, "NumberOfLocations", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0016, 0x2001, 0x0016, + EVR_SS, "NumberOfPCDirections", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0016, 0x2001, 0x0016, + EVR_SS, "NumberOfPCDirections", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0017, 0x2001, 0x0017, + EVR_SL, "NumberOfPhasesMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0017, 0x2001, 0x0017, + EVR_SL, "NumberOfPhasesMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0018, 0x2001, 0x0018, + EVR_SL, "NumberOfSlicesMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0018, 0x2001, 0x0018, + EVR_SL, "NumberOfSlicesMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0019, 0x2001, 0x0019, + EVR_CS, "PartialMatrixScanned", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0019, 0x2001, 0x0019, + EVR_CS, "PartialMatrixScanned", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x001a, 0x2001, 0x001a, + EVR_FL, "PCVelocity", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x001a, 0x2001, 0x001a, + EVR_FL, "PCVelocity", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x001b, 0x2001, 0x001b, + EVR_FL, "PrepulseDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x001b, 0x2001, 0x001b, + EVR_FL, "PrepulseDelay", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x001c, 0x2001, 0x001c, + EVR_CS, "PrepulseType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x001c, 0x2001, 0x001c, + EVR_CS, "PrepulseType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x001d, 0x2001, 0x001d, + EVR_IS, "ReconstructionNumberMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x001d, 0x2001, 0x001d, + EVR_IS, "ReconstructionNumberMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x001f, 0x2001, 0x001f, + EVR_CS, "RespirationSync", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x001f, 0x2001, 0x001f, + EVR_CS, "RespirationSync", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0020, 0x2001, 0x0020, + EVR_LO, "ScanningTechnique", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0020, 0x2001, 0x0020, + EVR_LO, "ScanningTechnique", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0021, 0x2001, 0x0021, + EVR_CS, "SPIR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0021, 0x2001, 0x0021, + EVR_CS, "SPIR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0022, 0x2001, 0x0022, + EVR_FL, "WaterFatShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0022, 0x2001, 0x0022, + EVR_FL, "WaterFatShift", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0023, 0x2001, 0x0023, + EVR_DS, "FlipAnglePhilips", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0023, 0x2001, 0x0023, + EVR_DS, "FlipAnglePhilips", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0024, 0x2001, 0x0024, + EVR_CS, "SeriesIsInteractive", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0024, 0x2001, 0x0024, + EVR_CS, "SeriesIsInteractive", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0025, 0x2001, 0x0025, + EVR_SH, "EchoTimeDisplayMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0025, 0x2001, 0x0025, + EVR_SH, "EchoTimeDisplayMR", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0026, 0x2001, 0x0026, + EVR_CS, "PresentationStateSubtractionActive", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0026, 0x2001, 0x0026, + EVR_CS, "PresentationStateSubtractionActive", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x002d, 0x2001, 0x002d, + EVR_SS, "StackNumberOfSlices", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x002d, 0x2001, 0x002d, + EVR_SS, "StackNumberOfSlices", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0032, 0x2001, 0x0032, + EVR_FL, "StackRadialAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0032, 0x2001, 0x0032, + EVR_FL, "StackRadialAngle", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0033, 0x2001, 0x0033, + EVR_CS, "StackRadialAxis", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0033, 0x2001, 0x0033, + EVR_CS, "StackRadialAxis", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0035, 0x2001, 0x0035, + EVR_SS, "StackSliceNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0035, 0x2001, 0x0035, + EVR_SS, "StackSliceNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0036, 0x2001, 0x0036, + EVR_CS, "StackType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0036, 0x2001, 0x0036, + EVR_CS, "StackType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x003f, 0x2001, 0x003f, + EVR_CS, "ZoomMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x003f, 0x2001, 0x003f, + EVR_CS, "ZoomMode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0058, 0x2001, 0x0058, + EVR_UL, "ContrastTransferTaste", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0058, 0x2001, 0x0058, + EVR_UL, "ContrastTransferTaste", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x005f, 0x2001, 0x005f, + EVR_SQ, "StackSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x005f, 0x2001, 0x005f, + EVR_SQ, "StackSequence", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0060, 0x2001, 0x0060, + EVR_SL, "NumberOfStacks", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0060, 0x2001, 0x0060, + EVR_SL, "NumberOfStacks", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0061, 0x2001, 0x0061, + EVR_CS, "SeriesTransmitted", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0061, 0x2001, 0x0061, + EVR_CS, "SeriesTransmitted", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0062, 0x2001, 0x0062, + EVR_CS, "SeriesCommitted", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0062, 0x2001, 0x0062, + EVR_CS, "SeriesCommitted", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0063, 0x2001, 0x0063, + EVR_CS, "ExaminationSource", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0063, 0x2001, 0x0063, + EVR_CS, "ExaminationSource", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0067, 0x2001, 0x0067, + EVR_CS, "LinearPresentationGLTrafoShapeSub", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0067, 0x2001, 0x0067, + EVR_CS, "LinearPresentationGLTrafoShapeSub", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0077, 0x2001, 0x0077, + EVR_CS, "GLTrafoType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0077, 0x2001, 0x0077, + EVR_CS, "GLTrafoType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x007b, 0x2001, 0x007b, + EVR_IS, "AcquisitionNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x007b, 0x2001, 0x007b, + EVR_IS, "AcquisitionNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x0081, 0x2001, 0x0081, + EVR_IS, "NumberOfDynamicScans", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x0081, 0x2001, 0x0081, + EVR_IS, "NumberOfDynamicScans", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x009f, 0x2001, 0x009f, + EVR_US, "PixelProcessingKernelSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x009f, 0x2001, 0x009f, + EVR_US, "PixelProcessingKernelSize", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x00a1, 0x2001, 0x00a1, + EVR_CS, "IsRawImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x00a1, 0x2001, 0x00a1, + EVR_CS, "IsRawImage", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x00f1, 0x2001, 0x00f1, + EVR_FL, "ProspectiveMotionCorrection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x00f1, 0x2001, 0x00f1, + EVR_FL, "ProspectiveMotionCorrection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2001, 0x00f2, 0x2001, 0x00f2, + EVR_FL, "RetrospectiveMotionCorrection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips Imaging DD 001" } + , { 0x2001, 0x00f2, 0x2001, 0x00f2, + EVR_FL, "RetrospectiveMotionCorrection", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS IMAGING DD 001" } + , { 0x2005, 0x0002, 0x2005, 0x0002, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 005" } + , { 0x2005, 0x0005, 0x2005, 0x0005, + EVR_CS, "SynergyReconstructionType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x0005, 0x2005, 0x0005, + EVR_CS, "SynergyReconstructionType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x001e, 0x2005, 0x001e, + EVR_SH, "MIPProtocol", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x001e, 0x2005, 0x001e, + EVR_SH, "MIPProtocol", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x001f, 0x2005, 0x001f, + EVR_SH, "MPRProtocol", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x001f, 0x2005, 0x001f, + EVR_SH, "MPRProtocol", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x0020, 0x2005, 0x0020, + EVR_SL, "NumberOfChemicalShifts", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x0020, 0x2005, 0x0020, + EVR_SL, "NumberOfChemicalShifts", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x002d, 0x2005, 0x002d, + EVR_SS, "NumberOfStackSlices", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x002d, 0x2005, 0x002d, + EVR_SS, "NumberOfStackSlices", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x0083, 0x2005, 0x0083, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x0083, 0x2005, 0x0083, + EVR_SQ, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x00a1, 0x2005, 0x00a1, + EVR_CS, "SyncraScanType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x00a1, 0x2005, 0x00a1, + EVR_CS, "SyncraScanType", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x00b0, 0x2005, 0x00b0, + EVR_FL, "DiffusionDirectionRL", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x00b0, 0x2005, 0x00b0, + EVR_FL, "DiffusionDirectionRL", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x00b1, 0x2005, 0x00b1, + EVR_FL, "DiffusionDirectionAP", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x00b1, 0x2005, 0x00b1, + EVR_FL, "DiffusionDirectionAP", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } + , { 0x2005, 0x00b2, 0x2005, 0x00b2, + EVR_FL, "DiffusionDirectionFH", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Philips MR Imaging DD 001" } + , { 0x2005, 0x00b2, 0x2005, 0x00b2, + EVR_FL, "DiffusionDirectionFH", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR IMAGING DD 001" } +#endif + , { 0x2010, 0x0010, 0x2010, 0x0010, + EVR_ST, "ImageDisplayFormat", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0030, 0x2010, 0x0030, + EVR_CS, "AnnotationDisplayFormatID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0040, 0x2010, 0x0040, + EVR_CS, "FilmOrientation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0050, 0x2010, 0x0050, + EVR_CS, "FilmSizeID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0052, 0x2010, 0x0052, + EVR_CS, "PrinterResolutionID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0054, 0x2010, 0x0054, + EVR_CS, "DefaultPrinterResolutionID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0060, 0x2010, 0x0060, + EVR_CS, "MagnificationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0080, 0x2010, 0x0080, + EVR_CS, "SmoothingType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x00a6, 0x2010, 0x00a6, + EVR_CS, "DefaultMagnificationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x00a7, 0x2010, 0x00a7, + EVR_CS, "OtherMagnificationTypesAvailable", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x00a8, 0x2010, 0x00a8, + EVR_CS, "DefaultSmoothingType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x00a9, 0x2010, 0x00a9, + EVR_CS, "OtherSmoothingTypesAvailable", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0100, 0x2010, 0x0100, + EVR_CS, "BorderDensity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0110, 0x2010, 0x0110, + EVR_CS, "EmptyImageDensity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0120, 0x2010, 0x0120, + EVR_US, "MinDensity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0130, 0x2010, 0x0130, + EVR_US, "MaxDensity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0140, 0x2010, 0x0140, + EVR_CS, "Trim", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0150, 0x2010, 0x0150, + EVR_ST, "ConfigurationInformation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0152, 0x2010, 0x0152, + EVR_LT, "ConfigurationInformationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0154, 0x2010, 0x0154, + EVR_IS, "MaximumCollatedFilms", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x015e, 0x2010, 0x015e, + EVR_US, "Illumination", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0160, 0x2010, 0x0160, + EVR_US, "ReflectedAmbientLight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0376, 0x2010, 0x0376, + EVR_DS, "PrinterPixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0500, 0x2010, 0x0500, + EVR_SQ, "ReferencedFilmSessionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0510, 0x2010, 0x0510, + EVR_SQ, "ReferencedImageBoxSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2010, 0x0520, 0x2010, 0x0520, + EVR_SQ, "ReferencedBasicAnnotationBoxSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x2011, 0x0011, 0x2011, 0x0011, + EVR_CS, "ImagePositionSpecifyingFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } +#endif + , { 0x2020, 0x0010, 0x2020, 0x0010, + EVR_US, "ImageBoxPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0020, 0x2020, 0x0020, + EVR_CS, "Polarity", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0030, 0x2020, 0x0030, + EVR_DS, "RequestedImageSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0040, 0x2020, 0x0040, + EVR_CS, "RequestedDecimateCropBehavior", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0050, 0x2020, 0x0050, + EVR_CS, "RequestedResolutionID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x00a0, 0x2020, 0x00a0, + EVR_CS, "RequestedImageSizeFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x00a2, 0x2020, 0x00a2, + EVR_CS, "DecimateCropResult", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0110, 0x2020, 0x0110, + EVR_SQ, "BasicGrayscaleImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0111, 0x2020, 0x0111, + EVR_SQ, "BasicColorImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0130, 0x2020, 0x0130, + EVR_SQ, "RETIRED_ReferencedImageOverlayBoxSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2020, 0x0140, 0x2020, 0x0140, + EVR_SQ, "RETIRED_ReferencedVOILUTBoxSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2030, 0x0010, 0x2030, 0x0010, + EVR_US, "AnnotationPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2030, 0x0020, 0x2030, 0x0020, + EVR_LO, "TextString", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0010, 0x2040, 0x0010, + EVR_SQ, "RETIRED_ReferencedOverlayPlaneSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0011, 0x2040, 0x0011, + EVR_US, "RETIRED_ReferencedOverlayPlaneGroups", 1, 99, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0020, 0x2040, 0x0020, + EVR_SQ, "RETIRED_OverlayPixelDataSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0060, 0x2040, 0x0060, + EVR_CS, "RETIRED_OverlayMagnificationType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0070, 0x2040, 0x0070, + EVR_CS, "RETIRED_OverlaySmoothingType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0072, 0x2040, 0x0072, + EVR_CS, "RETIRED_OverlayOrImageMagnification", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0074, 0x2040, 0x0074, + EVR_US, "RETIRED_MagnifyToNumberOfColumns", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0080, 0x2040, 0x0080, + EVR_CS, "RETIRED_OverlayForegroundDensity", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0082, 0x2040, 0x0082, + EVR_CS, "RETIRED_OverlayBackgroundDensity", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0090, 0x2040, 0x0090, + EVR_CS, "RETIRED_OverlayMode", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0100, 0x2040, 0x0100, + EVR_CS, "RETIRED_ThresholdDensity", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2040, 0x0500, 0x2040, 0x0500, + EVR_SQ, "RETIRED_ReferencedImageBoxSequenceRetired", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2050, 0x0010, 0x2050, 0x0010, + EVR_SQ, "PresentationLUTSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2050, 0x0020, 0x2050, 0x0020, + EVR_CS, "PresentationLUTShape", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2050, 0x0500, 0x2050, 0x0500, + EVR_SQ, "ReferencedPresentationLUTSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0010, 0x2100, 0x0010, + EVR_SH, "RETIRED_PrintJobID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0020, 0x2100, 0x0020, + EVR_CS, "ExecutionStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0030, 0x2100, 0x0030, + EVR_CS, "ExecutionStatusInfo", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0040, 0x2100, 0x0040, + EVR_DA, "CreationDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0050, 0x2100, 0x0050, + EVR_TM, "CreationTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0070, 0x2100, 0x0070, + EVR_AE, "Originator", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0140, 0x2100, 0x0140, + EVR_AE, "DestinationAE", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0160, 0x2100, 0x0160, + EVR_SH, "OwnerID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0170, 0x2100, 0x0170, + EVR_IS, "NumberOfFilms", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2100, 0x0500, 0x2100, 0x0500, + EVR_SQ, "RETIRED_ReferencedPrintJobSequencePullStoredPrint", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2110, 0x0010, 0x2110, 0x0010, + EVR_CS, "PrinterStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2110, 0x0020, 0x2110, 0x0020, + EVR_CS, "PrinterStatusInfo", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2110, 0x0030, 0x2110, 0x0030, + EVR_LO, "PrinterName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2110, 0x0099, 0x2110, 0x0099, + EVR_SH, "RETIRED_PrintQueueID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2120, 0x0010, 0x2120, 0x0010, + EVR_CS, "RETIRED_QueueStatus", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2120, 0x0050, 0x2120, 0x0050, + EVR_SQ, "RETIRED_PrintJobDescriptionSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2120, 0x0070, 0x2120, 0x0070, + EVR_SQ, "RETIRED_ReferencedPrintJobSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x0010, 0x2130, 0x0010, + EVR_SQ, "RETIRED_PrintManagementCapabilitiesSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x0015, 0x2130, 0x0015, + EVR_SQ, "RETIRED_PrinterCharacteristicsSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x0030, 0x2130, 0x0030, + EVR_SQ, "RETIRED_FilmBoxContentSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x0040, 0x2130, 0x0040, + EVR_SQ, "RETIRED_ImageBoxContentSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x0050, 0x2130, 0x0050, + EVR_SQ, "RETIRED_AnnotationContentSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x0060, 0x2130, 0x0060, + EVR_SQ, "RETIRED_ImageOverlayBoxContentSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x0080, 0x2130, 0x0080, + EVR_SQ, "RETIRED_PresentationLUTContentSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x00a0, 0x2130, 0x00a0, + EVR_SQ, "RETIRED_ProposedStudySequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2130, 0x00c0, 0x2130, 0x00c0, + EVR_SQ, "RETIRED_OriginalImageSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0001, 0x2200, 0x0001, + EVR_CS, "LabelUsingInformationExtractedFromInstances", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0002, 0x2200, 0x0002, + EVR_UT, "LabelText", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0003, 0x2200, 0x0003, + EVR_CS, "LabelStyleSelection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0004, 0x2200, 0x0004, + EVR_LT, "MediaDisposition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0005, 0x2200, 0x0005, + EVR_LT, "BarcodeValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0006, 0x2200, 0x0006, + EVR_CS, "BarcodeSymbology", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0007, 0x2200, 0x0007, + EVR_CS, "AllowMediaSplitting", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0008, 0x2200, 0x0008, + EVR_CS, "IncludeNonDICOMObjects", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0009, 0x2200, 0x0009, + EVR_CS, "IncludeDisplayApplication", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x000a, 0x2200, 0x000a, + EVR_CS, "PreserveCompositeInstancesAfterMediaCreation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x000b, 0x2200, 0x000b, + EVR_US, "TotalNumberOfPiecesOfMediaCreated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x000c, 0x2200, 0x000c, + EVR_LO, "RequestedMediaApplicationProfile", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x000d, 0x2200, 0x000d, + EVR_SQ, "ReferencedStorageMediaSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x000e, 0x2200, 0x000e, + EVR_AT, "FailureAttributes", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x000f, 0x2200, 0x000f, + EVR_CS, "AllowLossyCompression", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x2200, 0x0020, 0x2200, 0x0020, + EVR_CS, "RequestPriority", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0002, 0x3002, 0x0002, + EVR_SH, "RTImageLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0003, 0x3002, 0x0003, + EVR_LO, "RTImageName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0004, 0x3002, 0x0004, + EVR_ST, "RTImageDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x000a, 0x3002, 0x000a, + EVR_CS, "ReportedValuesOrigin", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x000c, 0x3002, 0x000c, + EVR_CS, "RTImagePlane", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x000d, 0x3002, 0x000d, + EVR_DS, "XRayImageReceptorTranslation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x000e, 0x3002, 0x000e, + EVR_DS, "XRayImageReceptorAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0010, 0x3002, 0x0010, + EVR_DS, "RTImageOrientation", 6, 6, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0011, 0x3002, 0x0011, + EVR_DS, "ImagePlanePixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0012, 0x3002, 0x0012, + EVR_DS, "RTImagePosition", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0020, 0x3002, 0x0020, + EVR_SH, "RadiationMachineName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0022, 0x3002, 0x0022, + EVR_DS, "RadiationMachineSAD", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0024, 0x3002, 0x0024, + EVR_DS, "RadiationMachineSSD", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0026, 0x3002, 0x0026, + EVR_DS, "RTImageSID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0028, 0x3002, 0x0028, + EVR_DS, "SourceToReferenceObjectDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0029, 0x3002, 0x0029, + EVR_IS, "FractionNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0030, 0x3002, 0x0030, + EVR_SQ, "ExposureSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0032, 0x3002, 0x0032, + EVR_DS, "MetersetExposure", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0034, 0x3002, 0x0034, + EVR_DS, "DiaphragmPosition", 4, 4, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0040, 0x3002, 0x0040, + EVR_SQ, "FluenceMapSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0041, 0x3002, 0x0041, + EVR_CS, "FluenceDataSource", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0042, 0x3002, 0x0042, + EVR_DS, "FluenceDataScale", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0050, 0x3002, 0x0050, + EVR_SQ, "PrimaryFluenceModeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0051, 0x3002, 0x0051, + EVR_CS, "FluenceMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3002, 0x0052, 0x3002, 0x0052, + EVR_SH, "FluenceModeID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0001, 0x3004, 0x0001, + EVR_CS, "DVHType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0002, 0x3004, 0x0002, + EVR_CS, "DoseUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0004, 0x3004, 0x0004, + EVR_CS, "DoseType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0005, 0x3004, 0x0005, + EVR_CS, "SpatialTransformOfDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0006, 0x3004, 0x0006, + EVR_LO, "DoseComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0008, 0x3004, 0x0008, + EVR_DS, "NormalizationPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x000a, 0x3004, 0x000a, + EVR_CS, "DoseSummationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x000c, 0x3004, 0x000c, + EVR_DS, "GridFrameOffsetVector", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x000e, 0x3004, 0x000e, + EVR_DS, "DoseGridScaling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0010, 0x3004, 0x0010, + EVR_SQ, "RTDoseROISequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0012, 0x3004, 0x0012, + EVR_DS, "DoseValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0014, 0x3004, 0x0014, + EVR_CS, "TissueHeterogeneityCorrection", 1, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0040, 0x3004, 0x0040, + EVR_DS, "DVHNormalizationPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0042, 0x3004, 0x0042, + EVR_DS, "DVHNormalizationDoseValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0050, 0x3004, 0x0050, + EVR_SQ, "DVHSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0052, 0x3004, 0x0052, + EVR_DS, "DVHDoseScaling", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0054, 0x3004, 0x0054, + EVR_CS, "DVHVolumeUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0056, 0x3004, 0x0056, + EVR_IS, "DVHNumberOfBins", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0058, 0x3004, 0x0058, + EVR_DS, "DVHData", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0060, 0x3004, 0x0060, + EVR_SQ, "DVHReferencedROISequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0062, 0x3004, 0x0062, + EVR_CS, "DVHROIContributionType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0070, 0x3004, 0x0070, + EVR_DS, "DVHMinimumDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0072, 0x3004, 0x0072, + EVR_DS, "DVHMaximumDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3004, 0x0074, 0x3004, 0x0074, + EVR_DS, "DVHMeanDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0002, 0x3006, 0x0002, + EVR_SH, "StructureSetLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0004, 0x3006, 0x0004, + EVR_LO, "StructureSetName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0006, 0x3006, 0x0006, + EVR_ST, "StructureSetDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0008, 0x3006, 0x0008, + EVR_DA, "StructureSetDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0009, 0x3006, 0x0009, + EVR_TM, "StructureSetTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0010, 0x3006, 0x0010, + EVR_SQ, "ReferencedFrameOfReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0012, 0x3006, 0x0012, + EVR_SQ, "RTReferencedStudySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0014, 0x3006, 0x0014, + EVR_SQ, "RTReferencedSeriesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0016, 0x3006, 0x0016, + EVR_SQ, "ContourImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0018, 0x3006, 0x0018, + EVR_SQ, "PredecessorStructureSetSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0020, 0x3006, 0x0020, + EVR_SQ, "StructureSetROISequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0022, 0x3006, 0x0022, + EVR_IS, "ROINumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0024, 0x3006, 0x0024, + EVR_UI, "ReferencedFrameOfReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0026, 0x3006, 0x0026, + EVR_LO, "ROIName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0028, 0x3006, 0x0028, + EVR_ST, "ROIDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x002a, 0x3006, 0x002a, + EVR_IS, "ROIDisplayColor", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x002c, 0x3006, 0x002c, + EVR_DS, "ROIVolume", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0030, 0x3006, 0x0030, + EVR_SQ, "RTRelatedROISequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0033, 0x3006, 0x0033, + EVR_CS, "RTROIRelationship", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0036, 0x3006, 0x0036, + EVR_CS, "ROIGenerationAlgorithm", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0037, 0x3006, 0x0037, + EVR_SQ, "ROIDerivationAlgorithmIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0038, 0x3006, 0x0038, + EVR_LO, "ROIGenerationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0039, 0x3006, 0x0039, + EVR_SQ, "ROIContourSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0040, 0x3006, 0x0040, + EVR_SQ, "ContourSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0042, 0x3006, 0x0042, + EVR_CS, "ContourGeometricType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0044, 0x3006, 0x0044, + EVR_DS, "ContourSlabThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0045, 0x3006, 0x0045, + EVR_DS, "ContourOffsetVector", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0046, 0x3006, 0x0046, + EVR_IS, "NumberOfContourPoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0048, 0x3006, 0x0048, + EVR_IS, "ContourNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0049, 0x3006, 0x0049, + EVR_IS, "AttachedContours", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0050, 0x3006, 0x0050, + EVR_DS, "ContourData", 3, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0080, 0x3006, 0x0080, + EVR_SQ, "RTROIObservationsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0082, 0x3006, 0x0082, + EVR_IS, "ObservationNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0084, 0x3006, 0x0084, + EVR_IS, "ReferencedROINumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0085, 0x3006, 0x0085, + EVR_SH, "ROIObservationLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0086, 0x3006, 0x0086, + EVR_SQ, "RTROIIdentificationCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x0088, 0x3006, 0x0088, + EVR_ST, "ROIObservationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00a0, 0x3006, 0x00a0, + EVR_SQ, "RelatedRTROIObservationsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00a4, 0x3006, 0x00a4, + EVR_CS, "RTROIInterpretedType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00a6, 0x3006, 0x00a6, + EVR_PN, "ROIInterpreter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00b0, 0x3006, 0x00b0, + EVR_SQ, "ROIPhysicalPropertiesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00b2, 0x3006, 0x00b2, + EVR_CS, "ROIPhysicalProperty", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00b4, 0x3006, 0x00b4, + EVR_DS, "ROIPhysicalPropertyValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00b6, 0x3006, 0x00b6, + EVR_SQ, "ROIElementalCompositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00b7, 0x3006, 0x00b7, + EVR_US, "ROIElementalCompositionAtomicNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00b8, 0x3006, 0x00b8, + EVR_FL, "ROIElementalCompositionAtomicMassFraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00b9, 0x3006, 0x00b9, + EVR_SQ, "RETIRED_AdditionalRTROIIdentificationCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00c0, 0x3006, 0x00c0, + EVR_SQ, "RETIRED_FrameOfReferenceRelationshipSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00c2, 0x3006, 0x00c2, + EVR_UI, "RETIRED_RelatedFrameOfReferenceUID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00c4, 0x3006, 0x00c4, + EVR_CS, "RETIRED_FrameOfReferenceTransformationType", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00c6, 0x3006, 0x00c6, + EVR_DS, "FrameOfReferenceTransformationMatrix", 16, 16, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00c8, 0x3006, 0x00c8, + EVR_LO, "FrameOfReferenceTransformationComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00c9, 0x3006, 0x00c9, + EVR_SQ, "PatientLocationCoordinatesSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00ca, 0x3006, 0x00ca, + EVR_SQ, "PatientLocationCoordinatesCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3006, 0x00cb, 0x3006, 0x00cb, + EVR_SQ, "PatientSupportPositionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0010, 0x3008, 0x0010, + EVR_SQ, "MeasuredDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0012, 0x3008, 0x0012, + EVR_ST, "MeasuredDoseDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0014, 0x3008, 0x0014, + EVR_CS, "MeasuredDoseType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0016, 0x3008, 0x0016, + EVR_DS, "MeasuredDoseValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0020, 0x3008, 0x0020, + EVR_SQ, "TreatmentSessionBeamSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0021, 0x3008, 0x0021, + EVR_SQ, "TreatmentSessionIonBeamSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0022, 0x3008, 0x0022, + EVR_IS, "CurrentFractionNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0024, 0x3008, 0x0024, + EVR_DA, "TreatmentControlPointDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0025, 0x3008, 0x0025, + EVR_TM, "TreatmentControlPointTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x002a, 0x3008, 0x002a, + EVR_CS, "TreatmentTerminationStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x002b, 0x3008, 0x002b, + EVR_SH, "TreatmentTerminationCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x002c, 0x3008, 0x002c, + EVR_CS, "TreatmentVerificationStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0030, 0x3008, 0x0030, + EVR_SQ, "ReferencedTreatmentRecordSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0032, 0x3008, 0x0032, + EVR_DS, "SpecifiedPrimaryMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0033, 0x3008, 0x0033, + EVR_DS, "SpecifiedSecondaryMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0036, 0x3008, 0x0036, + EVR_DS, "DeliveredPrimaryMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0037, 0x3008, 0x0037, + EVR_DS, "DeliveredSecondaryMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x003a, 0x3008, 0x003a, + EVR_DS, "SpecifiedTreatmentTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x003b, 0x3008, 0x003b, + EVR_DS, "DeliveredTreatmentTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0040, 0x3008, 0x0040, + EVR_SQ, "ControlPointDeliverySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0041, 0x3008, 0x0041, + EVR_SQ, "IonControlPointDeliverySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0042, 0x3008, 0x0042, + EVR_DS, "SpecifiedMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0044, 0x3008, 0x0044, + EVR_DS, "DeliveredMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0045, 0x3008, 0x0045, + EVR_FL, "MetersetRateSet", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0046, 0x3008, 0x0046, + EVR_FL, "MetersetRateDelivered", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0047, 0x3008, 0x0047, + EVR_FL, "ScanSpotMetersetsDelivered", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0048, 0x3008, 0x0048, + EVR_DS, "DoseRateDelivered", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0050, 0x3008, 0x0050, + EVR_SQ, "TreatmentSummaryCalculatedDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0052, 0x3008, 0x0052, + EVR_DS, "CumulativeDoseToDoseReference", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0054, 0x3008, 0x0054, + EVR_DA, "FirstTreatmentDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0056, 0x3008, 0x0056, + EVR_DA, "MostRecentTreatmentDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x005a, 0x3008, 0x005a, + EVR_IS, "NumberOfFractionsDelivered", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0060, 0x3008, 0x0060, + EVR_SQ, "OverrideSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0061, 0x3008, 0x0061, + EVR_AT, "ParameterSequencePointer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0062, 0x3008, 0x0062, + EVR_AT, "OverrideParameterPointer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0063, 0x3008, 0x0063, + EVR_IS, "ParameterItemIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0064, 0x3008, 0x0064, + EVR_IS, "MeasuredDoseReferenceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0065, 0x3008, 0x0065, + EVR_AT, "ParameterPointer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0066, 0x3008, 0x0066, + EVR_ST, "OverrideReason", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0067, 0x3008, 0x0067, + EVR_US, "ParameterValueNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0068, 0x3008, 0x0068, + EVR_SQ, "CorrectedParameterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x006a, 0x3008, 0x006a, + EVR_FL, "CorrectionValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0070, 0x3008, 0x0070, + EVR_SQ, "CalculatedDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0072, 0x3008, 0x0072, + EVR_IS, "CalculatedDoseReferenceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0074, 0x3008, 0x0074, + EVR_ST, "CalculatedDoseReferenceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0076, 0x3008, 0x0076, + EVR_DS, "CalculatedDoseReferenceDoseValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0078, 0x3008, 0x0078, + EVR_DS, "StartMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x007a, 0x3008, 0x007a, + EVR_DS, "EndMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0080, 0x3008, 0x0080, + EVR_SQ, "ReferencedMeasuredDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0082, 0x3008, 0x0082, + EVR_IS, "ReferencedMeasuredDoseReferenceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0090, 0x3008, 0x0090, + EVR_SQ, "ReferencedCalculatedDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0092, 0x3008, 0x0092, + EVR_IS, "ReferencedCalculatedDoseReferenceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00a0, 0x3008, 0x00a0, + EVR_SQ, "BeamLimitingDeviceLeafPairsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00b0, 0x3008, 0x00b0, + EVR_SQ, "RecordedWedgeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00c0, 0x3008, 0x00c0, + EVR_SQ, "RecordedCompensatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00d0, 0x3008, 0x00d0, + EVR_SQ, "RecordedBlockSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00e0, 0x3008, 0x00e0, + EVR_SQ, "TreatmentSummaryMeasuredDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00f0, 0x3008, 0x00f0, + EVR_SQ, "RecordedSnoutSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00f2, 0x3008, 0x00f2, + EVR_SQ, "RecordedRangeShifterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00f4, 0x3008, 0x00f4, + EVR_SQ, "RecordedLateralSpreadingDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x00f6, 0x3008, 0x00f6, + EVR_SQ, "RecordedRangeModulatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0100, 0x3008, 0x0100, + EVR_SQ, "RecordedSourceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0105, 0x3008, 0x0105, + EVR_LO, "SourceSerialNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0110, 0x3008, 0x0110, + EVR_SQ, "TreatmentSessionApplicationSetupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0116, 0x3008, 0x0116, + EVR_CS, "ApplicationSetupCheck", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0120, 0x3008, 0x0120, + EVR_SQ, "RecordedBrachyAccessoryDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0122, 0x3008, 0x0122, + EVR_IS, "ReferencedBrachyAccessoryDeviceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0130, 0x3008, 0x0130, + EVR_SQ, "RecordedChannelSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0132, 0x3008, 0x0132, + EVR_DS, "SpecifiedChannelTotalTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0134, 0x3008, 0x0134, + EVR_DS, "DeliveredChannelTotalTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0136, 0x3008, 0x0136, + EVR_IS, "SpecifiedNumberOfPulses", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0138, 0x3008, 0x0138, + EVR_IS, "DeliveredNumberOfPulses", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x013a, 0x3008, 0x013a, + EVR_DS, "SpecifiedPulseRepetitionInterval", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x013c, 0x3008, 0x013c, + EVR_DS, "DeliveredPulseRepetitionInterval", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0140, 0x3008, 0x0140, + EVR_SQ, "RecordedSourceApplicatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0142, 0x3008, 0x0142, + EVR_IS, "ReferencedSourceApplicatorNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0150, 0x3008, 0x0150, + EVR_SQ, "RecordedChannelShieldSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0152, 0x3008, 0x0152, + EVR_IS, "ReferencedChannelShieldNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0160, 0x3008, 0x0160, + EVR_SQ, "BrachyControlPointDeliveredSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0162, 0x3008, 0x0162, + EVR_DA, "SafePositionExitDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0164, 0x3008, 0x0164, + EVR_TM, "SafePositionExitTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0166, 0x3008, 0x0166, + EVR_DA, "SafePositionReturnDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0168, 0x3008, 0x0168, + EVR_TM, "SafePositionReturnTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0171, 0x3008, 0x0171, + EVR_SQ, "PulseSpecificBrachyControlPointDeliveredSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0172, 0x3008, 0x0172, + EVR_US, "PulseNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0173, 0x3008, 0x0173, + EVR_SQ, "BrachyPulseControlPointDeliveredSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0200, 0x3008, 0x0200, + EVR_CS, "CurrentTreatmentStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0202, 0x3008, 0x0202, + EVR_ST, "TreatmentStatusComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0220, 0x3008, 0x0220, + EVR_SQ, "FractionGroupSummarySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0223, 0x3008, 0x0223, + EVR_IS, "ReferencedFractionNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0224, 0x3008, 0x0224, + EVR_CS, "FractionGroupType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0230, 0x3008, 0x0230, + EVR_CS, "BeamStopperPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0240, 0x3008, 0x0240, + EVR_SQ, "FractionStatusSummarySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0250, 0x3008, 0x0250, + EVR_DA, "TreatmentDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3008, 0x0251, 0x3008, 0x0251, + EVR_TM, "TreatmentTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0002, 0x300a, 0x0002, + EVR_SH, "RTPlanLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0003, 0x300a, 0x0003, + EVR_LO, "RTPlanName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0004, 0x300a, 0x0004, + EVR_ST, "RTPlanDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0006, 0x300a, 0x0006, + EVR_DA, "RTPlanDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0007, 0x300a, 0x0007, + EVR_TM, "RTPlanTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0009, 0x300a, 0x0009, + EVR_LO, "TreatmentProtocols", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x000a, 0x300a, 0x000a, + EVR_CS, "PlanIntent", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x000b, 0x300a, 0x000b, + EVR_LO, "TreatmentSites", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x000c, 0x300a, 0x000c, + EVR_CS, "RTPlanGeometry", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x000e, 0x300a, 0x000e, + EVR_ST, "PrescriptionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0010, 0x300a, 0x0010, + EVR_SQ, "DoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0012, 0x300a, 0x0012, + EVR_IS, "DoseReferenceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0013, 0x300a, 0x0013, + EVR_UI, "DoseReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0014, 0x300a, 0x0014, + EVR_CS, "DoseReferenceStructureType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0015, 0x300a, 0x0015, + EVR_CS, "NominalBeamEnergyUnit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0016, 0x300a, 0x0016, + EVR_LO, "DoseReferenceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0018, 0x300a, 0x0018, + EVR_DS, "DoseReferencePointCoordinates", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x001a, 0x300a, 0x001a, + EVR_DS, "NominalPriorDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0020, 0x300a, 0x0020, + EVR_CS, "DoseReferenceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0021, 0x300a, 0x0021, + EVR_DS, "ConstraintWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0022, 0x300a, 0x0022, + EVR_DS, "DeliveryWarningDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0023, 0x300a, 0x0023, + EVR_DS, "DeliveryMaximumDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0025, 0x300a, 0x0025, + EVR_DS, "TargetMinimumDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0026, 0x300a, 0x0026, + EVR_DS, "TargetPrescriptionDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0027, 0x300a, 0x0027, + EVR_DS, "TargetMaximumDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0028, 0x300a, 0x0028, + EVR_DS, "TargetUnderdoseVolumeFraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x002a, 0x300a, 0x002a, + EVR_DS, "OrganAtRiskFullVolumeDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x002b, 0x300a, 0x002b, + EVR_DS, "OrganAtRiskLimitDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x002c, 0x300a, 0x002c, + EVR_DS, "OrganAtRiskMaximumDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x002d, 0x300a, 0x002d, + EVR_DS, "OrganAtRiskOverdoseVolumeFraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0040, 0x300a, 0x0040, + EVR_SQ, "ToleranceTableSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0042, 0x300a, 0x0042, + EVR_IS, "ToleranceTableNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0043, 0x300a, 0x0043, + EVR_SH, "ToleranceTableLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0044, 0x300a, 0x0044, + EVR_DS, "GantryAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0046, 0x300a, 0x0046, + EVR_DS, "BeamLimitingDeviceAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0048, 0x300a, 0x0048, + EVR_SQ, "BeamLimitingDeviceToleranceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x004a, 0x300a, 0x004a, + EVR_DS, "BeamLimitingDevicePositionTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x004b, 0x300a, 0x004b, + EVR_FL, "SnoutPositionTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x004c, 0x300a, 0x004c, + EVR_DS, "PatientSupportAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x004e, 0x300a, 0x004e, + EVR_DS, "TableTopEccentricAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x004f, 0x300a, 0x004f, + EVR_FL, "TableTopPitchAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0050, 0x300a, 0x0050, + EVR_FL, "TableTopRollAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0051, 0x300a, 0x0051, + EVR_DS, "TableTopVerticalPositionTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0052, 0x300a, 0x0052, + EVR_DS, "TableTopLongitudinalPositionTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0053, 0x300a, 0x0053, + EVR_DS, "TableTopLateralPositionTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0055, 0x300a, 0x0055, + EVR_CS, "RTPlanRelationship", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0070, 0x300a, 0x0070, + EVR_SQ, "FractionGroupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0071, 0x300a, 0x0071, + EVR_IS, "FractionGroupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0072, 0x300a, 0x0072, + EVR_LO, "FractionGroupDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0078, 0x300a, 0x0078, + EVR_IS, "NumberOfFractionsPlanned", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0079, 0x300a, 0x0079, + EVR_IS, "NumberOfFractionPatternDigitsPerDay", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x007a, 0x300a, 0x007a, + EVR_IS, "RepeatFractionCycleLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x007b, 0x300a, 0x007b, + EVR_LT, "FractionPattern", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0080, 0x300a, 0x0080, + EVR_IS, "NumberOfBeams", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0082, 0x300a, 0x0082, + EVR_DS, "BeamDoseSpecificationPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0083, 0x300a, 0x0083, + EVR_UI, "ReferencedDoseReferenceUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0084, 0x300a, 0x0084, + EVR_DS, "BeamDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0086, 0x300a, 0x0086, + EVR_DS, "BeamMeterset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0088, 0x300a, 0x0088, + EVR_FL, "BeamDosePointDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0089, 0x300a, 0x0089, + EVR_FL, "BeamDosePointEquivalentDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x008a, 0x300a, 0x008a, + EVR_FL, "BeamDosePointSSD", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x008b, 0x300a, 0x008b, + EVR_CS, "BeamDoseMeaning", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x008c, 0x300a, 0x008c, + EVR_SQ, "BeamDoseVerificationControlPointSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x008d, 0x300a, 0x008d, + EVR_FL, "RETIRED_AverageBeamDosePointDepth", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x008e, 0x300a, 0x008e, + EVR_FL, "RETIRED_AverageBeamDosePointEquivalentDepth", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x008f, 0x300a, 0x008f, + EVR_FL, "RETIRED_AverageBeamDosePointSSD", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0090, 0x300a, 0x0090, + EVR_CS, "BeamDoseType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0091, 0x300a, 0x0091, + EVR_DS, "AlternateBeamDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0092, 0x300a, 0x0092, + EVR_CS, "AlternateBeamDoseType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0093, 0x300a, 0x0093, + EVR_CS, "DepthValueAveragingFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0094, 0x300a, 0x0094, + EVR_DS, "BeamDosePointSourceToExternalContourDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00a0, 0x300a, 0x00a0, + EVR_IS, "NumberOfBrachyApplicationSetups", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00a2, 0x300a, 0x00a2, + EVR_DS, "BrachyApplicationSetupDoseSpecificationPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00a4, 0x300a, 0x00a4, + EVR_DS, "BrachyApplicationSetupDose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00b0, 0x300a, 0x00b0, + EVR_SQ, "BeamSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00b2, 0x300a, 0x00b2, + EVR_SH, "TreatmentMachineName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00b3, 0x300a, 0x00b3, + EVR_CS, "PrimaryDosimeterUnit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00b4, 0x300a, 0x00b4, + EVR_DS, "SourceAxisDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00b6, 0x300a, 0x00b6, + EVR_SQ, "BeamLimitingDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00b8, 0x300a, 0x00b8, + EVR_CS, "RTBeamLimitingDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ba, 0x300a, 0x00ba, + EVR_DS, "SourceToBeamLimitingDeviceDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00bb, 0x300a, 0x00bb, + EVR_FL, "IsocenterToBeamLimitingDeviceDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00bc, 0x300a, 0x00bc, + EVR_IS, "NumberOfLeafJawPairs", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00be, 0x300a, 0x00be, + EVR_DS, "LeafPositionBoundaries", 3, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c0, 0x300a, 0x00c0, + EVR_IS, "BeamNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c2, 0x300a, 0x00c2, + EVR_LO, "BeamName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c3, 0x300a, 0x00c3, + EVR_ST, "BeamDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c4, 0x300a, 0x00c4, + EVR_CS, "BeamType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c5, 0x300a, 0x00c5, + EVR_FD, "BeamDeliveryDurationLimit", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c6, 0x300a, 0x00c6, + EVR_CS, "RadiationType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c7, 0x300a, 0x00c7, + EVR_CS, "HighDoseTechniqueType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00c8, 0x300a, 0x00c8, + EVR_IS, "ReferenceImageNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ca, 0x300a, 0x00ca, + EVR_SQ, "PlannedVerificationImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00cc, 0x300a, 0x00cc, + EVR_LO, "ImagingDeviceSpecificAcquisitionParameters", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ce, 0x300a, 0x00ce, + EVR_CS, "TreatmentDeliveryType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d0, 0x300a, 0x00d0, + EVR_IS, "NumberOfWedges", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d1, 0x300a, 0x00d1, + EVR_SQ, "WedgeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d2, 0x300a, 0x00d2, + EVR_IS, "WedgeNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d3, 0x300a, 0x00d3, + EVR_CS, "WedgeType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d4, 0x300a, 0x00d4, + EVR_SH, "WedgeID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d5, 0x300a, 0x00d5, + EVR_IS, "WedgeAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d6, 0x300a, 0x00d6, + EVR_DS, "WedgeFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d7, 0x300a, 0x00d7, + EVR_FL, "TotalWedgeTrayWaterEquivalentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d8, 0x300a, 0x00d8, + EVR_DS, "WedgeOrientation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00d9, 0x300a, 0x00d9, + EVR_FL, "IsocenterToWedgeTrayDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00da, 0x300a, 0x00da, + EVR_DS, "SourceToWedgeTrayDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00db, 0x300a, 0x00db, + EVR_FL, "WedgeThinEdgePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00dc, 0x300a, 0x00dc, + EVR_SH, "BolusID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00dd, 0x300a, 0x00dd, + EVR_ST, "BolusDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00de, 0x300a, 0x00de, + EVR_DS, "EffectiveWedgeAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e0, 0x300a, 0x00e0, + EVR_IS, "NumberOfCompensators", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e1, 0x300a, 0x00e1, + EVR_SH, "MaterialID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e2, 0x300a, 0x00e2, + EVR_DS, "TotalCompensatorTrayFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e3, 0x300a, 0x00e3, + EVR_SQ, "CompensatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e4, 0x300a, 0x00e4, + EVR_IS, "CompensatorNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e5, 0x300a, 0x00e5, + EVR_SH, "CompensatorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e6, 0x300a, 0x00e6, + EVR_DS, "SourceToCompensatorTrayDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e7, 0x300a, 0x00e7, + EVR_IS, "CompensatorRows", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e8, 0x300a, 0x00e8, + EVR_IS, "CompensatorColumns", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00e9, 0x300a, 0x00e9, + EVR_DS, "CompensatorPixelSpacing", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ea, 0x300a, 0x00ea, + EVR_DS, "CompensatorPosition", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00eb, 0x300a, 0x00eb, + EVR_DS, "CompensatorTransmissionData", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ec, 0x300a, 0x00ec, + EVR_DS, "CompensatorThicknessData", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ed, 0x300a, 0x00ed, + EVR_IS, "NumberOfBoli", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ee, 0x300a, 0x00ee, + EVR_CS, "CompensatorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00ef, 0x300a, 0x00ef, + EVR_SH, "CompensatorTrayID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f0, 0x300a, 0x00f0, + EVR_IS, "NumberOfBlocks", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f2, 0x300a, 0x00f2, + EVR_DS, "TotalBlockTrayFactor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f3, 0x300a, 0x00f3, + EVR_FL, "TotalBlockTrayWaterEquivalentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f4, 0x300a, 0x00f4, + EVR_SQ, "BlockSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f5, 0x300a, 0x00f5, + EVR_SH, "BlockTrayID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f6, 0x300a, 0x00f6, + EVR_DS, "SourceToBlockTrayDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f7, 0x300a, 0x00f7, + EVR_FL, "IsocenterToBlockTrayDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f8, 0x300a, 0x00f8, + EVR_CS, "BlockType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00f9, 0x300a, 0x00f9, + EVR_LO, "AccessoryCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00fa, 0x300a, 0x00fa, + EVR_CS, "BlockDivergence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00fb, 0x300a, 0x00fb, + EVR_CS, "BlockMountingPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00fc, 0x300a, 0x00fc, + EVR_IS, "BlockNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x00fe, 0x300a, 0x00fe, + EVR_LO, "BlockName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0100, 0x300a, 0x0100, + EVR_DS, "BlockThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0102, 0x300a, 0x0102, + EVR_DS, "BlockTransmission", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0104, 0x300a, 0x0104, + EVR_IS, "BlockNumberOfPoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0106, 0x300a, 0x0106, + EVR_DS, "BlockData", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0107, 0x300a, 0x0107, + EVR_SQ, "ApplicatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0108, 0x300a, 0x0108, + EVR_SH, "ApplicatorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0109, 0x300a, 0x0109, + EVR_CS, "ApplicatorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x010a, 0x300a, 0x010a, + EVR_LO, "ApplicatorDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x010c, 0x300a, 0x010c, + EVR_DS, "CumulativeDoseReferenceCoefficient", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x010e, 0x300a, 0x010e, + EVR_DS, "FinalCumulativeMetersetWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0110, 0x300a, 0x0110, + EVR_IS, "NumberOfControlPoints", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0111, 0x300a, 0x0111, + EVR_SQ, "ControlPointSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0112, 0x300a, 0x0112, + EVR_IS, "ControlPointIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0114, 0x300a, 0x0114, + EVR_DS, "NominalBeamEnergy", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0115, 0x300a, 0x0115, + EVR_DS, "DoseRateSet", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0116, 0x300a, 0x0116, + EVR_SQ, "WedgePositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0118, 0x300a, 0x0118, + EVR_CS, "WedgePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x011a, 0x300a, 0x011a, + EVR_SQ, "BeamLimitingDevicePositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x011c, 0x300a, 0x011c, + EVR_DS, "LeafJawPositions", 2, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x011e, 0x300a, 0x011e, + EVR_DS, "GantryAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x011f, 0x300a, 0x011f, + EVR_CS, "GantryRotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0120, 0x300a, 0x0120, + EVR_DS, "BeamLimitingDeviceAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0121, 0x300a, 0x0121, + EVR_CS, "BeamLimitingDeviceRotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0122, 0x300a, 0x0122, + EVR_DS, "PatientSupportAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0123, 0x300a, 0x0123, + EVR_CS, "PatientSupportRotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0124, 0x300a, 0x0124, + EVR_DS, "TableTopEccentricAxisDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0125, 0x300a, 0x0125, + EVR_DS, "TableTopEccentricAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0126, 0x300a, 0x0126, + EVR_CS, "TableTopEccentricRotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0128, 0x300a, 0x0128, + EVR_DS, "TableTopVerticalPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0129, 0x300a, 0x0129, + EVR_DS, "TableTopLongitudinalPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x012a, 0x300a, 0x012a, + EVR_DS, "TableTopLateralPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x012c, 0x300a, 0x012c, + EVR_DS, "IsocenterPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x012e, 0x300a, 0x012e, + EVR_DS, "SurfaceEntryPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0130, 0x300a, 0x0130, + EVR_DS, "SourceToSurfaceDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0131, 0x300a, 0x0131, + EVR_FL, "AverageBeamDosePointSourceToExternalContourDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0132, 0x300a, 0x0132, + EVR_FL, "SourceToExternalContourDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0133, 0x300a, 0x0133, + EVR_FL, "ExternalContourEntryPoint", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0134, 0x300a, 0x0134, + EVR_DS, "CumulativeMetersetWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0140, 0x300a, 0x0140, + EVR_FL, "TableTopPitchAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0142, 0x300a, 0x0142, + EVR_CS, "TableTopPitchRotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0144, 0x300a, 0x0144, + EVR_FL, "TableTopRollAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0146, 0x300a, 0x0146, + EVR_CS, "TableTopRollRotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0148, 0x300a, 0x0148, + EVR_FL, "HeadFixationAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x014a, 0x300a, 0x014a, + EVR_FL, "GantryPitchAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x014c, 0x300a, 0x014c, + EVR_CS, "GantryPitchRotationDirection", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x014e, 0x300a, 0x014e, + EVR_FL, "GantryPitchAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0150, 0x300a, 0x0150, + EVR_CS, "FixationEye", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0151, 0x300a, 0x0151, + EVR_DS, "ChairHeadFramePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0152, 0x300a, 0x0152, + EVR_DS, "HeadFixationAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0153, 0x300a, 0x0153, + EVR_DS, "ChairHeadFramePositionTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0154, 0x300a, 0x0154, + EVR_DS, "FixationLightAzimuthalAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0155, 0x300a, 0x0155, + EVR_DS, "FixationLightPolarAngleTolerance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0180, 0x300a, 0x0180, + EVR_SQ, "PatientSetupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0182, 0x300a, 0x0182, + EVR_IS, "PatientSetupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0183, 0x300a, 0x0183, + EVR_LO, "PatientSetupLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0184, 0x300a, 0x0184, + EVR_LO, "PatientAdditionalPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0190, 0x300a, 0x0190, + EVR_SQ, "FixationDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0192, 0x300a, 0x0192, + EVR_CS, "FixationDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0194, 0x300a, 0x0194, + EVR_SH, "FixationDeviceLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0196, 0x300a, 0x0196, + EVR_ST, "FixationDeviceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0198, 0x300a, 0x0198, + EVR_SH, "FixationDevicePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0199, 0x300a, 0x0199, + EVR_FL, "FixationDevicePitchAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x019a, 0x300a, 0x019a, + EVR_FL, "FixationDeviceRollAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01a0, 0x300a, 0x01a0, + EVR_SQ, "ShieldingDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01a2, 0x300a, 0x01a2, + EVR_CS, "ShieldingDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01a4, 0x300a, 0x01a4, + EVR_SH, "ShieldingDeviceLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01a6, 0x300a, 0x01a6, + EVR_ST, "ShieldingDeviceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01a8, 0x300a, 0x01a8, + EVR_SH, "ShieldingDevicePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01b0, 0x300a, 0x01b0, + EVR_CS, "SetupTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01b2, 0x300a, 0x01b2, + EVR_ST, "SetupTechniqueDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01b4, 0x300a, 0x01b4, + EVR_SQ, "SetupDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01b6, 0x300a, 0x01b6, + EVR_CS, "SetupDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01b8, 0x300a, 0x01b8, + EVR_SH, "SetupDeviceLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01ba, 0x300a, 0x01ba, + EVR_ST, "SetupDeviceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01bc, 0x300a, 0x01bc, + EVR_DS, "SetupDeviceParameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01d0, 0x300a, 0x01d0, + EVR_ST, "SetupReferenceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01d2, 0x300a, 0x01d2, + EVR_DS, "TableTopVerticalSetupDisplacement", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01d4, 0x300a, 0x01d4, + EVR_DS, "TableTopLongitudinalSetupDisplacement", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x01d6, 0x300a, 0x01d6, + EVR_DS, "TableTopLateralSetupDisplacement", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0200, 0x300a, 0x0200, + EVR_CS, "BrachyTreatmentTechnique", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0202, 0x300a, 0x0202, + EVR_CS, "BrachyTreatmentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0206, 0x300a, 0x0206, + EVR_SQ, "TreatmentMachineSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0210, 0x300a, 0x0210, + EVR_SQ, "SourceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0212, 0x300a, 0x0212, + EVR_IS, "SourceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0214, 0x300a, 0x0214, + EVR_CS, "SourceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0216, 0x300a, 0x0216, + EVR_LO, "SourceManufacturer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0218, 0x300a, 0x0218, + EVR_DS, "ActiveSourceDiameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x021a, 0x300a, 0x021a, + EVR_DS, "ActiveSourceLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x021b, 0x300a, 0x021b, + EVR_SH, "SourceModelID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x021c, 0x300a, 0x021c, + EVR_LO, "SourceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0222, 0x300a, 0x0222, + EVR_DS, "SourceEncapsulationNominalThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0224, 0x300a, 0x0224, + EVR_DS, "SourceEncapsulationNominalTransmission", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0226, 0x300a, 0x0226, + EVR_LO, "SourceIsotopeName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0228, 0x300a, 0x0228, + EVR_DS, "SourceIsotopeHalfLife", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0229, 0x300a, 0x0229, + EVR_CS, "SourceStrengthUnits", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x022a, 0x300a, 0x022a, + EVR_DS, "ReferenceAirKermaRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x022b, 0x300a, 0x022b, + EVR_DS, "SourceStrength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x022c, 0x300a, 0x022c, + EVR_DA, "SourceStrengthReferenceDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x022e, 0x300a, 0x022e, + EVR_TM, "SourceStrengthReferenceTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0230, 0x300a, 0x0230, + EVR_SQ, "ApplicationSetupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0232, 0x300a, 0x0232, + EVR_CS, "ApplicationSetupType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0234, 0x300a, 0x0234, + EVR_IS, "ApplicationSetupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0236, 0x300a, 0x0236, + EVR_LO, "ApplicationSetupName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0238, 0x300a, 0x0238, + EVR_LO, "ApplicationSetupManufacturer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0240, 0x300a, 0x0240, + EVR_IS, "TemplateNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0242, 0x300a, 0x0242, + EVR_SH, "TemplateType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0244, 0x300a, 0x0244, + EVR_LO, "TemplateName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0250, 0x300a, 0x0250, + EVR_DS, "TotalReferenceAirKerma", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0260, 0x300a, 0x0260, + EVR_SQ, "BrachyAccessoryDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0262, 0x300a, 0x0262, + EVR_IS, "BrachyAccessoryDeviceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0263, 0x300a, 0x0263, + EVR_SH, "BrachyAccessoryDeviceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0264, 0x300a, 0x0264, + EVR_CS, "BrachyAccessoryDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0266, 0x300a, 0x0266, + EVR_LO, "BrachyAccessoryDeviceName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x026a, 0x300a, 0x026a, + EVR_DS, "BrachyAccessoryDeviceNominalThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x026c, 0x300a, 0x026c, + EVR_DS, "BrachyAccessoryDeviceNominalTransmission", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0271, 0x300a, 0x0271, + EVR_DS, "ChannelEffectiveLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0272, 0x300a, 0x0272, + EVR_DS, "ChannelInnerLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0273, 0x300a, 0x0273, + EVR_SH, "AfterloaderChannelID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0274, 0x300a, 0x0274, + EVR_DS, "SourceApplicatorTipLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0280, 0x300a, 0x0280, + EVR_SQ, "ChannelSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0282, 0x300a, 0x0282, + EVR_IS, "ChannelNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0284, 0x300a, 0x0284, + EVR_DS, "ChannelLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0286, 0x300a, 0x0286, + EVR_DS, "ChannelTotalTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0288, 0x300a, 0x0288, + EVR_CS, "SourceMovementType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x028a, 0x300a, 0x028a, + EVR_IS, "NumberOfPulses", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x028c, 0x300a, 0x028c, + EVR_DS, "PulseRepetitionInterval", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0290, 0x300a, 0x0290, + EVR_IS, "SourceApplicatorNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0291, 0x300a, 0x0291, + EVR_SH, "SourceApplicatorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0292, 0x300a, 0x0292, + EVR_CS, "SourceApplicatorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0294, 0x300a, 0x0294, + EVR_LO, "SourceApplicatorName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0296, 0x300a, 0x0296, + EVR_DS, "SourceApplicatorLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0298, 0x300a, 0x0298, + EVR_LO, "SourceApplicatorManufacturer", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x029c, 0x300a, 0x029c, + EVR_DS, "SourceApplicatorWallNominalThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x029e, 0x300a, 0x029e, + EVR_DS, "SourceApplicatorWallNominalTransmission", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02a0, 0x300a, 0x02a0, + EVR_DS, "SourceApplicatorStepSize", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02a2, 0x300a, 0x02a2, + EVR_IS, "TransferTubeNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02a4, 0x300a, 0x02a4, + EVR_DS, "TransferTubeLength", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02b0, 0x300a, 0x02b0, + EVR_SQ, "ChannelShieldSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02b2, 0x300a, 0x02b2, + EVR_IS, "ChannelShieldNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02b3, 0x300a, 0x02b3, + EVR_SH, "ChannelShieldID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02b4, 0x300a, 0x02b4, + EVR_LO, "ChannelShieldName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02b8, 0x300a, 0x02b8, + EVR_DS, "ChannelShieldNominalThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02ba, 0x300a, 0x02ba, + EVR_DS, "ChannelShieldNominalTransmission", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02c8, 0x300a, 0x02c8, + EVR_DS, "FinalCumulativeTimeWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02d0, 0x300a, 0x02d0, + EVR_SQ, "BrachyControlPointSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02d2, 0x300a, 0x02d2, + EVR_DS, "ControlPointRelativePosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02d4, 0x300a, 0x02d4, + EVR_DS, "ControlPoint3DPosition", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02d6, 0x300a, 0x02d6, + EVR_DS, "CumulativeTimeWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e0, 0x300a, 0x02e0, + EVR_CS, "CompensatorDivergence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e1, 0x300a, 0x02e1, + EVR_CS, "CompensatorMountingPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e2, 0x300a, 0x02e2, + EVR_DS, "SourceToCompensatorDistance", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e3, 0x300a, 0x02e3, + EVR_FL, "TotalCompensatorTrayWaterEquivalentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e4, 0x300a, 0x02e4, + EVR_FL, "IsocenterToCompensatorTrayDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e5, 0x300a, 0x02e5, + EVR_FL, "CompensatorColumnOffset", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e6, 0x300a, 0x02e6, + EVR_FL, "IsocenterToCompensatorDistances", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e7, 0x300a, 0x02e7, + EVR_FL, "CompensatorRelativeStoppingPowerRatio", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02e8, 0x300a, 0x02e8, + EVR_FL, "CompensatorMillingToolDiameter", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02ea, 0x300a, 0x02ea, + EVR_SQ, "IonRangeCompensatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x02eb, 0x300a, 0x02eb, + EVR_LT, "CompensatorDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0302, 0x300a, 0x0302, + EVR_IS, "RadiationMassNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0304, 0x300a, 0x0304, + EVR_IS, "RadiationAtomicNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0306, 0x300a, 0x0306, + EVR_SS, "RadiationChargeState", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0308, 0x300a, 0x0308, + EVR_CS, "ScanMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0309, 0x300a, 0x0309, + EVR_CS, "ModulatedScanModeType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x030a, 0x300a, 0x030a, + EVR_FL, "VirtualSourceAxisDistances", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x030c, 0x300a, 0x030c, + EVR_SQ, "SnoutSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x030d, 0x300a, 0x030d, + EVR_FL, "SnoutPosition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x030f, 0x300a, 0x030f, + EVR_SH, "SnoutID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0312, 0x300a, 0x0312, + EVR_IS, "NumberOfRangeShifters", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0314, 0x300a, 0x0314, + EVR_SQ, "RangeShifterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0316, 0x300a, 0x0316, + EVR_IS, "RangeShifterNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0318, 0x300a, 0x0318, + EVR_SH, "RangeShifterID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0320, 0x300a, 0x0320, + EVR_CS, "RangeShifterType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0322, 0x300a, 0x0322, + EVR_LO, "RangeShifterDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0330, 0x300a, 0x0330, + EVR_IS, "NumberOfLateralSpreadingDevices", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0332, 0x300a, 0x0332, + EVR_SQ, "LateralSpreadingDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0334, 0x300a, 0x0334, + EVR_IS, "LateralSpreadingDeviceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0336, 0x300a, 0x0336, + EVR_SH, "LateralSpreadingDeviceID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0338, 0x300a, 0x0338, + EVR_CS, "LateralSpreadingDeviceType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x033a, 0x300a, 0x033a, + EVR_LO, "LateralSpreadingDeviceDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x033c, 0x300a, 0x033c, + EVR_FL, "LateralSpreadingDeviceWaterEquivalentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0340, 0x300a, 0x0340, + EVR_IS, "NumberOfRangeModulators", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0342, 0x300a, 0x0342, + EVR_SQ, "RangeModulatorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0344, 0x300a, 0x0344, + EVR_IS, "RangeModulatorNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0346, 0x300a, 0x0346, + EVR_SH, "RangeModulatorID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0348, 0x300a, 0x0348, + EVR_CS, "RangeModulatorType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x034a, 0x300a, 0x034a, + EVR_LO, "RangeModulatorDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x034c, 0x300a, 0x034c, + EVR_SH, "BeamCurrentModulationID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0350, 0x300a, 0x0350, + EVR_CS, "PatientSupportType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0352, 0x300a, 0x0352, + EVR_SH, "PatientSupportID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0354, 0x300a, 0x0354, + EVR_LO, "PatientSupportAccessoryCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0355, 0x300a, 0x0355, + EVR_LO, "TrayAccessoryCode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0356, 0x300a, 0x0356, + EVR_FL, "FixationLightAzimuthalAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0358, 0x300a, 0x0358, + EVR_FL, "FixationLightPolarAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x035a, 0x300a, 0x035a, + EVR_FL, "MetersetRate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0360, 0x300a, 0x0360, + EVR_SQ, "RangeShifterSettingsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0362, 0x300a, 0x0362, + EVR_LO, "RangeShifterSetting", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0364, 0x300a, 0x0364, + EVR_FL, "IsocenterToRangeShifterDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0366, 0x300a, 0x0366, + EVR_FL, "RangeShifterWaterEquivalentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0370, 0x300a, 0x0370, + EVR_SQ, "LateralSpreadingDeviceSettingsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0372, 0x300a, 0x0372, + EVR_LO, "LateralSpreadingDeviceSetting", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0374, 0x300a, 0x0374, + EVR_FL, "IsocenterToLateralSpreadingDeviceDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0380, 0x300a, 0x0380, + EVR_SQ, "RangeModulatorSettingsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0382, 0x300a, 0x0382, + EVR_FL, "RangeModulatorGatingStartValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0384, 0x300a, 0x0384, + EVR_FL, "RangeModulatorGatingStopValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0386, 0x300a, 0x0386, + EVR_FL, "RangeModulatorGatingStartWaterEquivalentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0388, 0x300a, 0x0388, + EVR_FL, "RangeModulatorGatingStopWaterEquivalentThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x038a, 0x300a, 0x038a, + EVR_FL, "IsocenterToRangeModulatorDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x038f, 0x300a, 0x038f, + EVR_FL, "ScanSpotTimeOffset", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0390, 0x300a, 0x0390, + EVR_SH, "ScanSpotTuneID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0391, 0x300a, 0x0391, + EVR_IS, "ScanSpotPrescribedIndices", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0392, 0x300a, 0x0392, + EVR_IS, "NumberOfScanSpotPositions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0393, 0x300a, 0x0393, + EVR_CS, "ScanSpotReordered", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0394, 0x300a, 0x0394, + EVR_FL, "ScanSpotPositionMap", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0395, 0x300a, 0x0395, + EVR_CS, "ScanSpotReorderingAllowed", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0396, 0x300a, 0x0396, + EVR_FL, "ScanSpotMetersetWeights", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0398, 0x300a, 0x0398, + EVR_FL, "ScanningSpotSize", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x039a, 0x300a, 0x039a, + EVR_IS, "NumberOfPaintings", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x03a0, 0x300a, 0x03a0, + EVR_SQ, "IonToleranceTableSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x03a2, 0x300a, 0x03a2, + EVR_SQ, "IonBeamSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x03a4, 0x300a, 0x03a4, + EVR_SQ, "IonBeamLimitingDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x03a6, 0x300a, 0x03a6, + EVR_SQ, "IonBlockSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x03a8, 0x300a, 0x03a8, + EVR_SQ, "IonControlPointSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x03aa, 0x300a, 0x03aa, + EVR_SQ, "IonWedgeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x03ac, 0x300a, 0x03ac, + EVR_SQ, "IonWedgePositionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0401, 0x300a, 0x0401, + EVR_SQ, "ReferencedSetupImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0402, 0x300a, 0x0402, + EVR_ST, "SetupImageComment", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0410, 0x300a, 0x0410, + EVR_SQ, "MotionSynchronizationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0412, 0x300a, 0x0412, + EVR_FL, "ControlPointOrientation", 3, 3, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0420, 0x300a, 0x0420, + EVR_SQ, "GeneralAccessorySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0421, 0x300a, 0x0421, + EVR_SH, "GeneralAccessoryID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0422, 0x300a, 0x0422, + EVR_ST, "GeneralAccessoryDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0423, 0x300a, 0x0423, + EVR_CS, "GeneralAccessoryType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0424, 0x300a, 0x0424, + EVR_IS, "GeneralAccessoryNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0425, 0x300a, 0x0425, + EVR_FL, "SourceToGeneralAccessoryDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0431, 0x300a, 0x0431, + EVR_SQ, "ApplicatorGeometrySequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0432, 0x300a, 0x0432, + EVR_CS, "ApplicatorApertureShape", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0433, 0x300a, 0x0433, + EVR_FL, "ApplicatorOpening", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0434, 0x300a, 0x0434, + EVR_FL, "ApplicatorOpeningX", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0435, 0x300a, 0x0435, + EVR_FL, "ApplicatorOpeningY", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0436, 0x300a, 0x0436, + EVR_FL, "SourceToApplicatorMountingPositionDistance", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0440, 0x300a, 0x0440, + EVR_IS, "NumberOfBlockSlabItems", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0441, 0x300a, 0x0441, + EVR_SQ, "BlockSlabSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0442, 0x300a, 0x0442, + EVR_DS, "BlockSlabThickness", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0443, 0x300a, 0x0443, + EVR_US, "BlockSlabNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0450, 0x300a, 0x0450, + EVR_SQ, "DeviceMotionControlSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0451, 0x300a, 0x0451, + EVR_CS, "DeviceMotionExecutionMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0452, 0x300a, 0x0452, + EVR_CS, "DeviceMotionObservationMode", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0453, 0x300a, 0x0453, + EVR_SQ, "DeviceMotionParameterCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0501, 0x300a, 0x0501, + EVR_FL, "DistalDepthFraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0502, 0x300a, 0x0502, + EVR_FL, "DistalDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0503, 0x300a, 0x0503, + EVR_FL, "NominalRangeModulationFractions", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0504, 0x300a, 0x0504, + EVR_FL, "NominalRangeModulatedRegionDepths", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0505, 0x300a, 0x0505, + EVR_SQ, "DepthDoseParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0506, 0x300a, 0x0506, + EVR_SQ, "DeliveredDepthDoseParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0507, 0x300a, 0x0507, + EVR_FL, "DeliveredDistalDepthFraction", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0508, 0x300a, 0x0508, + EVR_FL, "DeliveredDistalDepth", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0509, 0x300a, 0x0509, + EVR_FL, "DeliveredNominalRangeModulationFractions", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0510, 0x300a, 0x0510, + EVR_FL, "DeliveredNominalRangeModulatedRegionDepths", 2, 2, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0511, 0x300a, 0x0511, + EVR_CS, "DeliveredReferenceDoseDefinition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0512, 0x300a, 0x0512, + EVR_CS, "ReferenceDoseDefinition", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0600, 0x300a, 0x0600, + EVR_US, "RTControlPointIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0601, 0x300a, 0x0601, + EVR_US, "RadiationGenerationModeIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0602, 0x300a, 0x0602, + EVR_US, "ReferencedDefinedDeviceIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0603, 0x300a, 0x0603, + EVR_US, "RadiationDoseIdentificationIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0604, 0x300a, 0x0604, + EVR_US, "NumberOfRTControlPoints", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0605, 0x300a, 0x0605, + EVR_US, "ReferencedRadiationGenerationModeIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0606, 0x300a, 0x0606, + EVR_US, "TreatmentPositionIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0607, 0x300a, 0x0607, + EVR_US, "ReferencedDeviceIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0608, 0x300a, 0x0608, + EVR_LO, "TreatmentPositionGroupLabel", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0609, 0x300a, 0x0609, + EVR_UI, "TreatmentPositionGroupUID", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x060a, 0x300a, 0x060a, + EVR_SQ, "TreatmentPositionGroupSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x060b, 0x300a, 0x060b, + EVR_US, "ReferencedTreatmentPositionIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x060c, 0x300a, 0x060c, + EVR_US, "ReferencedRadiationDoseIdentificationIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x060d, 0x300a, 0x060d, + EVR_FD, "RTAccessoryHolderWaterEquivalentThickness", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x060e, 0x300a, 0x060e, + EVR_US, "ReferencedRTAccessoryHolderDeviceIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x060f, 0x300a, 0x060f, + EVR_CS, "RTAccessoryHolderSlotExistenceFlag", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0610, 0x300a, 0x0610, + EVR_SQ, "RTAccessoryHolderSlotSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0611, 0x300a, 0x0611, + EVR_LO, "RTAccessoryHolderSlotID", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0612, 0x300a, 0x0612, + EVR_FD, "RTAccessoryHolderSlotDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0613, 0x300a, 0x0613, + EVR_FD, "RTAccessorySlotDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0614, 0x300a, 0x0614, + EVR_SQ, "RTAccessoryHolderDefinitionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0615, 0x300a, 0x0615, + EVR_LO, "RTAccessoryDeviceSlotID", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0616, 0x300a, 0x0616, + EVR_SQ, "RTRadiationSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0617, 0x300a, 0x0617, + EVR_SQ, "RadiationDoseSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0618, 0x300a, 0x0618, + EVR_SQ, "RadiationDoseIdentificationSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0619, 0x300a, 0x0619, + EVR_LO, "RadiationDoseIdentificationLabel", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x061a, 0x300a, 0x061a, + EVR_CS, "ReferenceDoseType", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x061b, 0x300a, 0x061b, + EVR_CS, "PrimaryDoseValueIndicator", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x061c, 0x300a, 0x061c, + EVR_SQ, "DoseValuesSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x061d, 0x300a, 0x061d, + EVR_CS, "DoseValuePurpose", 1, -1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x061e, 0x300a, 0x061e, + EVR_FD, "ReferenceDosePointCoordinates", 3, 3, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x061f, 0x300a, 0x061f, + EVR_SQ, "RadiationDoseValuesParametersSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0620, 0x300a, 0x0620, + EVR_SQ, "MetersetToDoseMappingSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0621, 0x300a, 0x0621, + EVR_SQ, "ExpectedInVivoMeasurementValuesSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0622, 0x300a, 0x0622, + EVR_US, "ExpectedInVivoMeasurementValueIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0623, 0x300a, 0x0623, + EVR_LO, "RadiationDoseInVivoMeasurementLabel", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0624, 0x300a, 0x0624, + EVR_FD, "RadiationDoseCentralAxisDisplacement", 2, 2, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0625, 0x300a, 0x0625, + EVR_FD, "RadiationDoseValue", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0626, 0x300a, 0x0626, + EVR_FD, "RadiationDoseSourceToSkinDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0627, 0x300a, 0x0627, + EVR_FD, "RadiationDoseMeasurementPointCoordinates", 3, 3, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0628, 0x300a, 0x0628, + EVR_FD, "RadiationDoseSourceToExternalContourDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0629, 0x300a, 0x0629, + EVR_SQ, "RTToleranceSetSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x062a, 0x300a, 0x062a, + EVR_LO, "RTToleranceSetLabel", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x062b, 0x300a, 0x062b, + EVR_SQ, "AttributeToleranceValuesSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x062c, 0x300a, 0x062c, + EVR_FD, "ToleranceValue", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x062d, 0x300a, 0x062d, + EVR_SQ, "PatientSupportPositionToleranceSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x062e, 0x300a, 0x062e, + EVR_FD, "TreatmentTimeLimit", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x062f, 0x300a, 0x062f, + EVR_SQ, "CArmPhotonElectronControlPointSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0630, 0x300a, 0x0630, + EVR_SQ, "ReferencedRTRadiationSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0631, 0x300a, 0x0631, + EVR_SQ, "ReferencedRTInstanceSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0632, 0x300a, 0x0632, + EVR_SQ, "ReferencedRTPatientSetupSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0634, 0x300a, 0x0634, + EVR_FD, "SourceToPatientSurfaceDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0635, 0x300a, 0x0635, + EVR_SQ, "TreatmentMachineSpecialModeCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0636, 0x300a, 0x0636, + EVR_US, "IntendedNumberOfFractions", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0637, 0x300a, 0x0637, + EVR_CS, "RTRadiationSetIntent", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0638, 0x300a, 0x0638, + EVR_CS, "RTRadiationPhysicalAndGeometricContentDetailFlag", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0639, 0x300a, 0x0639, + EVR_CS, "RTRecordFlag", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x063a, 0x300a, 0x063a, + EVR_SQ, "TreatmentDeviceIdentificationSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x063b, 0x300a, 0x063b, + EVR_SQ, "ReferencedRTPhysicianIntentSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x063c, 0x300a, 0x063c, + EVR_FD, "CumulativeMeterset", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x063d, 0x300a, 0x063d, + EVR_FD, "DeliveryRate", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x063e, 0x300a, 0x063e, + EVR_SQ, "DeliveryRateUnitSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x063f, 0x300a, 0x063f, + EVR_SQ, "TreatmentPositionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0640, 0x300a, 0x0640, + EVR_FD, "RadiationSourceAxisDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0641, 0x300a, 0x0641, + EVR_US, "NumberOfRTBeamLimitingDevices", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0642, 0x300a, 0x0642, + EVR_FD, "RTBeamLimitingDeviceProximalDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0643, 0x300a, 0x0643, + EVR_FD, "RTBeamLimitingDeviceDistalDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0644, 0x300a, 0x0644, + EVR_SQ, "ParallelRTBeamDelimiterDeviceOrientationLabelCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0645, 0x300a, 0x0645, + EVR_FD, "BeamsModifierOrientationAngle", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0646, 0x300a, 0x0646, + EVR_SQ, "FixedRTBeamDelimiterDeviceSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0647, 0x300a, 0x0647, + EVR_SQ, "ParallelRTBeamDelimiterDeviceSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0648, 0x300a, 0x0648, + EVR_US, "NumberOfParallelRTBeamDelimiters", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0649, 0x300a, 0x0649, + EVR_FD, "ParallelRTBeamDelimiterBoundaries", 2, -1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x064a, 0x300a, 0x064a, + EVR_FD, "ParallelRTBeamDelimiterPositions", 2, -1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x064b, 0x300a, 0x064b, + EVR_FD, "RTBeamLimitingDeviceOffset", 2, 2, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x064c, 0x300a, 0x064c, + EVR_SQ, "RTBeamDelimiterGeometrySequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x064d, 0x300a, 0x064d, + EVR_SQ, "RTBeamLimitingDeviceDefinitionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x064e, 0x300a, 0x064e, + EVR_CS, "ParallelRTBeamDelimiterOpeningMode", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x064f, 0x300a, 0x064f, + EVR_CS, "ParallelRTBeamDelimiterLeafMountingSide", 1, -1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0650, 0x300a, 0x0650, + EVR_UI, "PatientSetupUID", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0651, 0x300a, 0x0651, + EVR_SQ, "WedgeDefinitionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0652, 0x300a, 0x0652, + EVR_FD, "RadiationBeamWedgeAngle", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0653, 0x300a, 0x0653, + EVR_FD, "RadiationBeamWedgeThinEdgeDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0654, 0x300a, 0x0654, + EVR_FD, "RadiationBeamEffectiveWedgeAngle", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0655, 0x300a, 0x0655, + EVR_US, "NumberOfWedgePositions", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0656, 0x300a, 0x0656, + EVR_SQ, "RTBeamLimitingDeviceOpeningSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0657, 0x300a, 0x0657, + EVR_US, "NumberOfRTBeamLimitingDeviceOpenings", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0658, 0x300a, 0x0658, + EVR_SQ, "RadiationDosimeterUnitSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0659, 0x300a, 0x0659, + EVR_SQ, "RTDeviceDistanceReferenceLocationCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x065a, 0x300a, 0x065a, + EVR_SQ, "RadiationDeviceConfigurationAndCommissioningKeySequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x065b, 0x300a, 0x065b, + EVR_SQ, "PatientSupportPositionParameterSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x065c, 0x300a, 0x065c, + EVR_CS, "PatientSupportPositionSpecificationMethod", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x065d, 0x300a, 0x065d, + EVR_SQ, "PatientSupportPositionDeviceParameterSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x065e, 0x300a, 0x065e, + EVR_US, "DeviceOrderIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x065f, 0x300a, 0x065f, + EVR_US, "PatientSupportPositionParameterOrderIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0660, 0x300a, 0x0660, + EVR_SQ, "PatientSupportPositionDeviceToleranceSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0661, 0x300a, 0x0661, + EVR_US, "PatientSupportPositionToleranceOrderIndex", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0662, 0x300a, 0x0662, + EVR_SQ, "CompensatorDefinitionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0663, 0x300a, 0x0663, + EVR_CS, "CompensatorMapOrientation", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0664, 0x300a, 0x0664, + EVR_OF, "CompensatorProximalThicknessMap", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0665, 0x300a, 0x0665, + EVR_OF, "CompensatorDistalThicknessMap", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0666, 0x300a, 0x0666, + EVR_FD, "CompensatorBasePlaneOffset", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0667, 0x300a, 0x0667, + EVR_SQ, "CompensatorShapeFabricationCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0668, 0x300a, 0x0668, + EVR_SQ, "CompensatorShapeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0669, 0x300a, 0x0669, + EVR_FD, "RadiationBeamCompensatorMillingToolDiameter", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x066a, 0x300a, 0x066a, + EVR_SQ, "BlockDefinitionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x066b, 0x300a, 0x066b, + EVR_OF, "BlockEdgeData", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x066c, 0x300a, 0x066c, + EVR_CS, "BlockOrientation", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x066d, 0x300a, 0x066d, + EVR_FD, "RadiationBeamBlockThickness", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x066e, 0x300a, 0x066e, + EVR_FD, "RadiationBeamBlockSlabThickness", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x066f, 0x300a, 0x066f, + EVR_SQ, "BlockEdgeDataSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0670, 0x300a, 0x0670, + EVR_US, "NumberOfRTAccessoryHolders", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0671, 0x300a, 0x0671, + EVR_SQ, "GeneralAccessoryDefinitionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0672, 0x300a, 0x0672, + EVR_US, "NumberOfGeneralAccessories", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0673, 0x300a, 0x0673, + EVR_SQ, "BolusDefinitionSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0674, 0x300a, 0x0674, + EVR_US, "NumberOfBoluses", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0675, 0x300a, 0x0675, + EVR_UI, "EquipmentFrameOfReferenceUID", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0676, 0x300a, 0x0676, + EVR_ST, "EquipmentFrameOfReferenceDescription", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0677, 0x300a, 0x0677, + EVR_SQ, "EquipmentReferencePointCoordinatesSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0678, 0x300a, 0x0678, + EVR_SQ, "EquipmentReferencePointCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0679, 0x300a, 0x0679, + EVR_FD, "RTBeamLimitingDeviceAngle", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x067a, 0x300a, 0x067a, + EVR_FD, "SourceRollAngle", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x067b, 0x300a, 0x067b, + EVR_SQ, "RadiationGenerationModeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x067c, 0x300a, 0x067c, + EVR_SH, "RadiationGenerationModeLabel", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x067d, 0x300a, 0x067d, + EVR_ST, "RadiationGenerationModeDescription", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x067e, 0x300a, 0x067e, + EVR_SQ, "RadiationGenerationModeMachineCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x067f, 0x300a, 0x067f, + EVR_SQ, "RadiationTypeCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0680, 0x300a, 0x0680, + EVR_DS, "NominalEnergy", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0681, 0x300a, 0x0681, + EVR_DS, "MinimumNominalEnergy", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0682, 0x300a, 0x0682, + EVR_DS, "MaximumNominalEnergy", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0683, 0x300a, 0x0683, + EVR_SQ, "RadiationFluenceModifierCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0684, 0x300a, 0x0684, + EVR_SQ, "EnergyUnitCodeSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0685, 0x300a, 0x0685, + EVR_US, "NumberOfRadiationGenerationModes", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0686, 0x300a, 0x0686, + EVR_SQ, "PatientSupportDevicesSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0687, 0x300a, 0x0687, + EVR_US, "NumberOfPatientSupportDevices", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0688, 0x300a, 0x0688, + EVR_FD, "RTBeamModifierDefinitionDistance", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300a, 0x0689, 0x300a, 0x0689, + EVR_SQ, "BeamAreaLimitSequence", 1, 1, "DICOM/Supplement_175", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0002, 0x300c, 0x0002, + EVR_SQ, "ReferencedRTPlanSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0004, 0x300c, 0x0004, + EVR_SQ, "ReferencedBeamSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0006, 0x300c, 0x0006, + EVR_IS, "ReferencedBeamNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0007, 0x300c, 0x0007, + EVR_IS, "ReferencedReferenceImageNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0008, 0x300c, 0x0008, + EVR_DS, "StartCumulativeMetersetWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0009, 0x300c, 0x0009, + EVR_DS, "EndCumulativeMetersetWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x000a, 0x300c, 0x000a, + EVR_SQ, "ReferencedBrachyApplicationSetupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x000c, 0x300c, 0x000c, + EVR_IS, "ReferencedBrachyApplicationSetupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x000e, 0x300c, 0x000e, + EVR_IS, "ReferencedSourceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0020, 0x300c, 0x0020, + EVR_SQ, "ReferencedFractionGroupSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0022, 0x300c, 0x0022, + EVR_IS, "ReferencedFractionGroupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0040, 0x300c, 0x0040, + EVR_SQ, "ReferencedVerificationImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0042, 0x300c, 0x0042, + EVR_SQ, "ReferencedReferenceImageSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0050, 0x300c, 0x0050, + EVR_SQ, "ReferencedDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0051, 0x300c, 0x0051, + EVR_IS, "ReferencedDoseReferenceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0055, 0x300c, 0x0055, + EVR_SQ, "BrachyReferencedDoseReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0060, 0x300c, 0x0060, + EVR_SQ, "ReferencedStructureSetSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x006a, 0x300c, 0x006a, + EVR_IS, "ReferencedPatientSetupNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0080, 0x300c, 0x0080, + EVR_SQ, "ReferencedDoseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00a0, 0x300c, 0x00a0, + EVR_IS, "ReferencedToleranceTableNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00b0, 0x300c, 0x00b0, + EVR_SQ, "ReferencedBolusSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00c0, 0x300c, 0x00c0, + EVR_IS, "ReferencedWedgeNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00d0, 0x300c, 0x00d0, + EVR_IS, "ReferencedCompensatorNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00e0, 0x300c, 0x00e0, + EVR_IS, "ReferencedBlockNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00f0, 0x300c, 0x00f0, + EVR_IS, "ReferencedControlPointIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00f2, 0x300c, 0x00f2, + EVR_SQ, "ReferencedControlPointSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00f4, 0x300c, 0x00f4, + EVR_IS, "ReferencedStartControlPointIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x00f6, 0x300c, 0x00f6, + EVR_IS, "ReferencedStopControlPointIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0100, 0x300c, 0x0100, + EVR_IS, "ReferencedRangeShifterNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0102, 0x300c, 0x0102, + EVR_IS, "ReferencedLateralSpreadingDeviceNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0104, 0x300c, 0x0104, + EVR_IS, "ReferencedRangeModulatorNumber", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0111, 0x300c, 0x0111, + EVR_SQ, "OmittedBeamTaskSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0112, 0x300c, 0x0112, + EVR_CS, "ReasonForOmission", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300c, 0x0113, 0x300c, 0x0113, + EVR_LO, "ReasonForOmissionDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300e, 0x0002, 0x300e, 0x0002, + EVR_CS, "ApprovalStatus", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300e, 0x0004, 0x300e, 0x0004, + EVR_DA, "ReviewDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300e, 0x0005, 0x300e, 0x0005, + EVR_TM, "ReviewTime", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x300e, 0x0008, 0x300e, 0x0008, + EVR_PN, "ReviewerName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0001, 0x3010, 0x0001, + EVR_SQ, "RadiobiologicalDoseEffectSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0002, 0x3010, 0x0002, + EVR_CS, "RadiobiologicalDoseEffectFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0003, 0x3010, 0x0003, + EVR_SQ, "EffectiveDoseCalculationMethodCategoryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0004, 0x3010, 0x0004, + EVR_SQ, "EffectiveDoseCalculationMethodCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0005, 0x3010, 0x0005, + EVR_LO, "EffectiveDoseCalculationMethodDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0006, 0x3010, 0x0006, + EVR_UI, "ConceptualVolumeUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0007, 0x3010, 0x0007, + EVR_SQ, "OriginatingSOPInstanceReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0008, 0x3010, 0x0008, + EVR_SQ, "ConceptualVolumeConstituentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0009, 0x3010, 0x0009, + EVR_SQ, "EquivalentConceptualVolumeInstanceReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x000a, 0x3010, 0x000a, + EVR_SQ, "EquivalentConceptualVolumesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x000b, 0x3010, 0x000b, + EVR_UI, "ReferencedConceptualVolumeUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x000c, 0x3010, 0x000c, + EVR_UT, "ConceptualVolumeCombinationExpression", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x000d, 0x3010, 0x000d, + EVR_US, "ConceptualVolumeConstituentIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x000e, 0x3010, 0x000e, + EVR_CS, "ConceptualVolumeCombinationFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x000f, 0x3010, 0x000f, + EVR_ST, "ConceptualVolumeCombinationDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0010, 0x3010, 0x0010, + EVR_CS, "ConceptualVolumeSegmentationDefinedFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0011, 0x3010, 0x0011, + EVR_SQ, "ConceptualVolumeSegmentationReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0012, 0x3010, 0x0012, + EVR_SQ, "ConceptualVolumeConstituentSegmentationReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0013, 0x3010, 0x0013, + EVR_UI, "ConstituentConceptualVolumeUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0014, 0x3010, 0x0014, + EVR_SQ, "DerivationConceptualVolumeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0015, 0x3010, 0x0015, + EVR_UI, "SourceConceptualVolumeUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0016, 0x3010, 0x0016, + EVR_SQ, "ConceptualVolumeDerivationAlgorithmSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0017, 0x3010, 0x0017, + EVR_ST, "ConceptualVolumeDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0018, 0x3010, 0x0018, + EVR_SQ, "SourceConceptualVolumeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0019, 0x3010, 0x0019, + EVR_SQ, "AuthorIdentificationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x001a, 0x3010, 0x001a, + EVR_LO, "ManufacturerModelVersion", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x001b, 0x3010, 0x001b, + EVR_UC, "DeviceAlternateIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x001c, 0x3010, 0x001c, + EVR_CS, "DeviceAlternateIdentifierType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x001d, 0x3010, 0x001d, + EVR_LT, "DeviceAlternateIdentifierFormat", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x001e, 0x3010, 0x001e, + EVR_LO, "SegmentationCreationTemplateLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x001f, 0x3010, 0x001f, + EVR_UI, "SegmentationTemplateUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0020, 0x3010, 0x0020, + EVR_US, "ReferencedSegmentReferenceIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0021, 0x3010, 0x0021, + EVR_SQ, "SegmentReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0022, 0x3010, 0x0022, + EVR_US, "SegmentReferenceIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0023, 0x3010, 0x0023, + EVR_SQ, "DirectSegmentReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0024, 0x3010, 0x0024, + EVR_SQ, "CombinationSegmentReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0025, 0x3010, 0x0025, + EVR_SQ, "ConceptualVolumeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0026, 0x3010, 0x0026, + EVR_SQ, "SegmentedRTAccessoryDeviceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0027, 0x3010, 0x0027, + EVR_SQ, "SegmentCharacteristicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0028, 0x3010, 0x0028, + EVR_SQ, "RelatedSegmentCharacteristicsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0029, 0x3010, 0x0029, + EVR_US, "SegmentCharacteristicsPrecedence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x002a, 0x3010, 0x002a, + EVR_SQ, "RTSegmentAnnotationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x002b, 0x3010, 0x002b, + EVR_SQ, "SegmentAnnotationCategoryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x002c, 0x3010, 0x002c, + EVR_SQ, "SegmentAnnotationTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x002d, 0x3010, 0x002d, + EVR_LO, "DeviceLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x002e, 0x3010, 0x002e, + EVR_SQ, "DeviceTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0030, 0x3010, 0x0030, + EVR_SQ, "PatientEquipmentRelationshipCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0031, 0x3010, 0x0031, + EVR_UI, "ReferencedFiducialsUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0032, 0x3010, 0x0032, + EVR_SQ, "PatientTreatmentOrientationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0033, 0x3010, 0x0033, + EVR_SH, "UserContentLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0034, 0x3010, 0x0034, + EVR_LO, "UserContentLongLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0035, 0x3010, 0x0035, + EVR_SH, "EntityLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0036, 0x3010, 0x0036, + EVR_LO, "EntityName", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0037, 0x3010, 0x0037, + EVR_ST, "EntityDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0038, 0x3010, 0x0038, + EVR_LO, "EntityLongLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0039, 0x3010, 0x0039, + EVR_US, "DeviceIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x003a, 0x3010, 0x003a, + EVR_US, "RTTreatmentPhaseIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x003b, 0x3010, 0x003b, + EVR_UI, "RTTreatmentPhaseUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x003c, 0x3010, 0x003c, + EVR_US, "RTPrescriptionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x003d, 0x3010, 0x003d, + EVR_US, "RTSegmentAnnotationIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x003e, 0x3010, 0x003e, + EVR_US, "BasisRTTreatmentPhaseIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x003f, 0x3010, 0x003f, + EVR_US, "RelatedRTTreatmentPhaseIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0040, 0x3010, 0x0040, + EVR_US, "ReferencedRTTreatmentPhaseIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0041, 0x3010, 0x0041, + EVR_US, "ReferencedRTPrescriptionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0042, 0x3010, 0x0042, + EVR_US, "ReferencedParentRTPrescriptionIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0043, 0x3010, 0x0043, + EVR_ST, "ManufacturerDeviceIdentifier", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0044, 0x3010, 0x0044, + EVR_SQ, "InstanceLevelReferencedPerformedProcedureStepSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0045, 0x3010, 0x0045, + EVR_CS, "RTTreatmentPhaseIntentPresenceFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0046, 0x3010, 0x0046, + EVR_CS, "RadiotherapyTreatmentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0047, 0x3010, 0x0047, + EVR_CS, "TeletherapyRadiationType", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0048, 0x3010, 0x0048, + EVR_CS, "BrachytherapySourceType", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0049, 0x3010, 0x0049, + EVR_SQ, "ReferencedRTTreatmentPhaseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x004a, 0x3010, 0x004a, + EVR_SQ, "ReferencedDirectSegmentInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x004b, 0x3010, 0x004b, + EVR_SQ, "IntendedRTTreatmentPhaseSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x004c, 0x3010, 0x004c, + EVR_DA, "IntendedPhaseStartDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x004d, 0x3010, 0x004d, + EVR_DA, "IntendedPhaseEndDate", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x004e, 0x3010, 0x004e, + EVR_SQ, "RTTreatmentPhaseIntervalSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x004f, 0x3010, 0x004f, + EVR_CS, "TemporalRelationshipIntervalAnchor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0050, 0x3010, 0x0050, + EVR_FD, "MinimumNumberOfIntervalDays", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0051, 0x3010, 0x0051, + EVR_FD, "MaximumNumberOfIntervalDays", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0052, 0x3010, 0x0052, + EVR_UI, "PertinentSOPClassesInStudy", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0053, 0x3010, 0x0053, + EVR_UI, "PertinentSOPClassesInSeries", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0054, 0x3010, 0x0054, + EVR_LO, "RTPrescriptionLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0055, 0x3010, 0x0055, + EVR_SQ, "RTPhysicianIntentPredecessorSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0056, 0x3010, 0x0056, + EVR_LO, "RTTreatmentApproachLabel", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0057, 0x3010, 0x0057, + EVR_SQ, "RTPhysicianIntentSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0058, 0x3010, 0x0058, + EVR_US, "RTPhysicianIntentIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0059, 0x3010, 0x0059, + EVR_CS, "RTTreatmentIntentType", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x005a, 0x3010, 0x005a, + EVR_UT, "RTPhysicianIntentNarrative", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x005b, 0x3010, 0x005b, + EVR_SQ, "RTProtocolCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x005c, 0x3010, 0x005c, + EVR_ST, "ReasonForSuperseding", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x005d, 0x3010, 0x005d, + EVR_SQ, "RTDiagnosisCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x005e, 0x3010, 0x005e, + EVR_US, "ReferencedRTPhysicianIntentIndex", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x005f, 0x3010, 0x005f, + EVR_SQ, "RTPhysicianIntentInputInstanceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0060, 0x3010, 0x0060, + EVR_SQ, "RTAnatomicPrescriptionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0061, 0x3010, 0x0061, + EVR_UT, "PriorTreatmentDoseDescription", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0062, 0x3010, 0x0062, + EVR_SQ, "PriorTreatmentReferenceSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0063, 0x3010, 0x0063, + EVR_CS, "DosimetricObjectiveEvaluationScope", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0064, 0x3010, 0x0064, + EVR_SQ, "TherapeuticRoleCategoryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0065, 0x3010, 0x0065, + EVR_SQ, "TherapeuticRoleTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0066, 0x3010, 0x0066, + EVR_US, "ConceptualVolumeOptimizationPrecedence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0067, 0x3010, 0x0067, + EVR_SQ, "ConceptualVolumeCategoryCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0068, 0x3010, 0x0068, + EVR_CS, "ConceptualVolumeBlockingConstraint", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0069, 0x3010, 0x0069, + EVR_SQ, "ConceptualVolumeTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x006a, 0x3010, 0x006a, + EVR_SQ, "ConceptualVolumeTypeModifierCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x006b, 0x3010, 0x006b, + EVR_SQ, "RTPrescriptionSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x006c, 0x3010, 0x006c, + EVR_SQ, "DosimetricObjectiveSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x006d, 0x3010, 0x006d, + EVR_SQ, "DosimetricObjectiveTypeCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x006e, 0x3010, 0x006e, + EVR_UI, "DosimetricObjectiveUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x006f, 0x3010, 0x006f, + EVR_UI, "ReferencedDosimetricObjectiveUID", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0070, 0x3010, 0x0070, + EVR_SQ, "DosimetricObjectiveParameterSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0071, 0x3010, 0x0071, + EVR_SQ, "ReferencedDosimetricObjectivesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0073, 0x3010, 0x0073, + EVR_CS, "AbsoluteDosimetricObjectiveFlag", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0074, 0x3010, 0x0074, + EVR_FD, "DosimetricObjectiveWeight", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0075, 0x3010, 0x0075, + EVR_CS, "DosimetricObjectivePurpose", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0076, 0x3010, 0x0076, + EVR_SQ, "PlanningInputInformationSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0077, 0x3010, 0x0077, + EVR_LO, "TreatmentSite", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0078, 0x3010, 0x0078, + EVR_SQ, "TreatmentSiteCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0079, 0x3010, 0x0079, + EVR_SQ, "FractionPatternSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x007a, 0x3010, 0x007a, + EVR_UT, "TreatmentTechniqueNotes", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x007b, 0x3010, 0x007b, + EVR_UT, "PrescriptionNotes", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x007c, 0x3010, 0x007c, + EVR_IS, "NumberOfIntervalFractions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x007d, 0x3010, 0x007d, + EVR_US, "NumberOfFractions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x007e, 0x3010, 0x007e, + EVR_US, "IntendedDeliveryDuration", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x007f, 0x3010, 0x007f, + EVR_UT, "FractionationNotes", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0080, 0x3010, 0x0080, + EVR_SQ, "RTTreatmentTechniqueCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0081, 0x3010, 0x0081, + EVR_SQ, "PrescriptionNotesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0082, 0x3010, 0x0082, + EVR_SQ, "FractionBasedRelationshipSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0083, 0x3010, 0x0083, + EVR_CS, "FractionBasedRelationshipIntervalAnchor", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0084, 0x3010, 0x0084, + EVR_FD, "MinimumHoursBetweenFractions", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0085, 0x3010, 0x0085, + EVR_TM, "IntendedFractionStartTime", 1, -1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0086, 0x3010, 0x0086, + EVR_LT, "IntendedStartDayOfWeek", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0087, 0x3010, 0x0087, + EVR_SQ, "WeekdayFractionPatternSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x3010, 0x0088, 0x3010, 0x0088, + EVR_SQ, "DeliveryTimeStructureCodeSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x3f01, 0x0001, 0x3f01, 0x0001, + EVR_LO, "InstitutionCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x3f01, 0x0002, 0x3f01, 0x0002, + EVR_LO, "RoutedTransferAE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x3f01, 0x0003, 0x3f01, 0x0003, + EVR_LO, "SourceAE", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x3f01, 0x0004, 0x3f01, 0x0004, + EVR_SH, "DeferredValidation", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x3f01, 0x0005, 0x3f01, 0x0005, + EVR_LO, "SeriesOwner", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x3f01, 0x0006, 0x3f01, 0x0006, + EVR_LO, "OrderGroupNumber", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x3f01, 0x0007, 0x3f01, 0x0007, + EVR_SH, "StrippedPixelData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } + , { 0x3f01, 0x0008, 0x3f01, 0x0008, + EVR_SH, "PendingMoveRequest", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "INTELERAD MEDICAL SYSTEMS" } +#endif + , { 0x4000, 0x0010, 0x4000, 0x0010, + EVR_LT, "RETIRED_Arbitrary", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4000, 0x4000, 0x4000, 0x4000, + EVR_LT, "RETIRED_TextComments", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0040, 0x4008, 0x0040, + EVR_SH, "RETIRED_ResultsID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0042, 0x4008, 0x0042, + EVR_LO, "RETIRED_ResultsIDIssuer", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0050, 0x4008, 0x0050, + EVR_SQ, "RETIRED_ReferencedInterpretationSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x00ff, 0x4008, 0x00ff, + EVR_CS, "RETIRED_ReportProductionStatusTrial", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0100, 0x4008, 0x0100, + EVR_DA, "RETIRED_InterpretationRecordedDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0101, 0x4008, 0x0101, + EVR_TM, "RETIRED_InterpretationRecordedTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0102, 0x4008, 0x0102, + EVR_PN, "RETIRED_InterpretationRecorder", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0103, 0x4008, 0x0103, + EVR_LO, "RETIRED_ReferenceToRecordedSound", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0108, 0x4008, 0x0108, + EVR_DA, "RETIRED_InterpretationTranscriptionDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0109, 0x4008, 0x0109, + EVR_TM, "RETIRED_InterpretationTranscriptionTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x010a, 0x4008, 0x010a, + EVR_PN, "RETIRED_InterpretationTranscriber", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x010b, 0x4008, 0x010b, + EVR_ST, "RETIRED_InterpretationText", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x010c, 0x4008, 0x010c, + EVR_PN, "RETIRED_InterpretationAuthor", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0111, 0x4008, 0x0111, + EVR_SQ, "RETIRED_InterpretationApproverSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0112, 0x4008, 0x0112, + EVR_DA, "RETIRED_InterpretationApprovalDate", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0113, 0x4008, 0x0113, + EVR_TM, "RETIRED_InterpretationApprovalTime", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0114, 0x4008, 0x0114, + EVR_PN, "RETIRED_PhysicianApprovingInterpretation", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0115, 0x4008, 0x0115, + EVR_LT, "RETIRED_InterpretationDiagnosisDescription", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0117, 0x4008, 0x0117, + EVR_SQ, "RETIRED_InterpretationDiagnosisCodeSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0118, 0x4008, 0x0118, + EVR_SQ, "RETIRED_ResultsDistributionListSequence", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0119, 0x4008, 0x0119, + EVR_PN, "RETIRED_DistributionName", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x011a, 0x4008, 0x011a, + EVR_LO, "RETIRED_DistributionAddress", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0200, 0x4008, 0x0200, + EVR_SH, "RETIRED_InterpretationID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0202, 0x4008, 0x0202, + EVR_LO, "RETIRED_InterpretationIDIssuer", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0210, 0x4008, 0x0210, + EVR_CS, "RETIRED_InterpretationTypeID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0212, 0x4008, 0x0212, + EVR_CS, "RETIRED_InterpretationStatusID", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x0300, 0x4008, 0x0300, + EVR_ST, "RETIRED_Impressions", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4008, 0x4000, 0x4008, 0x4000, + EVR_ST, "RETIRED_ResultsComments", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x4009, 0x0001, 0x4009, 0x0001, + EVR_LT, "ReportID", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x4009, 0x0020, 0x4009, 0x0020, + EVR_LT, "ReportStatus", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x4009, 0x0030, 0x4009, 0x0030, + EVR_DA, "ReportCreationDate", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x4009, 0x0070, 0x4009, 0x0070, + EVR_LT, "ReportApprovingPhysician", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x4009, 0x00e0, 0x4009, 0x00e0, + EVR_LT, "ReportText", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x4009, 0x00e1, 0x4009, 0x00e1, + EVR_LT, "ReportAuthor", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } + , { 0x4009, 0x00e3, 0x4009, 0x00e3, + EVR_LT, "ReportingRadiologist", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS ISI" } +#endif + , { 0x4010, 0x0001, 0x4010, 0x0001, + EVR_CS, "LowEnergyDetectors", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x0002, 0x4010, 0x0002, + EVR_CS, "HighEnergyDetectors", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x0004, 0x4010, 0x0004, + EVR_SQ, "DetectorGeometrySequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1001, 0x4010, 0x1001, + EVR_SQ, "ThreatROIVoxelSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1004, 0x4010, 0x1004, + EVR_FL, "ThreatROIBase", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1005, 0x4010, 0x1005, + EVR_FL, "ThreatROIExtents", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1006, 0x4010, 0x1006, + EVR_OB, "ThreatROIBitmap", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1007, 0x4010, 0x1007, + EVR_SH, "RouteSegmentID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1008, 0x4010, 0x1008, + EVR_CS, "GantryType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1009, 0x4010, 0x1009, + EVR_CS, "OOIOwnerType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x100a, 0x4010, 0x100a, + EVR_SQ, "RouteSegmentSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1010, 0x4010, 0x1010, + EVR_US, "PotentialThreatObjectID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1011, 0x4010, 0x1011, + EVR_SQ, "ThreatSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1012, 0x4010, 0x1012, + EVR_CS, "ThreatCategory", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1013, 0x4010, 0x1013, + EVR_LT, "ThreatCategoryDescription", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1014, 0x4010, 0x1014, + EVR_CS, "ATDAbilityAssessment", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1015, 0x4010, 0x1015, + EVR_CS, "ATDAssessmentFlag", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1016, 0x4010, 0x1016, + EVR_FL, "ATDAssessmentProbability", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1017, 0x4010, 0x1017, + EVR_FL, "Mass", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1018, 0x4010, 0x1018, + EVR_FL, "Density", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1019, 0x4010, 0x1019, + EVR_FL, "ZEffective", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x101a, 0x4010, 0x101a, + EVR_SH, "BoardingPassID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x101b, 0x4010, 0x101b, + EVR_FL, "CenterOfMass", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x101c, 0x4010, 0x101c, + EVR_FL, "CenterOfPTO", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x101d, 0x4010, 0x101d, + EVR_FL, "BoundingPolygon", 6, -1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x101e, 0x4010, 0x101e, + EVR_SH, "RouteSegmentStartLocationID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x101f, 0x4010, 0x101f, + EVR_SH, "RouteSegmentEndLocationID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1020, 0x4010, 0x1020, + EVR_CS, "RouteSegmentLocationIDType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1021, 0x4010, 0x1021, + EVR_CS, "AbortReason", 1, -1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1023, 0x4010, 0x1023, + EVR_FL, "VolumeOfPTO", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1024, 0x4010, 0x1024, + EVR_CS, "AbortFlag", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1025, 0x4010, 0x1025, + EVR_DT, "RouteSegmentStartTime", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1026, 0x4010, 0x1026, + EVR_DT, "RouteSegmentEndTime", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1027, 0x4010, 0x1027, + EVR_CS, "TDRType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1028, 0x4010, 0x1028, + EVR_CS, "InternationalRouteSegment", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1029, 0x4010, 0x1029, + EVR_LO, "ThreatDetectionAlgorithmandVersion", 1, -1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x102a, 0x4010, 0x102a, + EVR_SH, "AssignedLocation", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x102b, 0x4010, 0x102b, + EVR_DT, "AlarmDecisionTime", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1031, 0x4010, 0x1031, + EVR_CS, "AlarmDecision", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1033, 0x4010, 0x1033, + EVR_US, "NumberOfTotalObjects", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1034, 0x4010, 0x1034, + EVR_US, "NumberOfAlarmObjects", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1037, 0x4010, 0x1037, + EVR_SQ, "PTORepresentationSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1038, 0x4010, 0x1038, + EVR_SQ, "ATDAssessmentSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1039, 0x4010, 0x1039, + EVR_CS, "TIPType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x103a, 0x4010, 0x103a, + EVR_CS, "DICOSVersion", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1041, 0x4010, 0x1041, + EVR_DT, "OOIOwnerCreationTime", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1042, 0x4010, 0x1042, + EVR_CS, "OOIType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1043, 0x4010, 0x1043, + EVR_FL, "OOISize", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1044, 0x4010, 0x1044, + EVR_CS, "AcquisitionStatus", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1045, 0x4010, 0x1045, + EVR_SQ, "BasisMaterialsCodeSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1046, 0x4010, 0x1046, + EVR_CS, "PhantomType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1047, 0x4010, 0x1047, + EVR_SQ, "OOIOwnerSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1048, 0x4010, 0x1048, + EVR_CS, "ScanType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1051, 0x4010, 0x1051, + EVR_LO, "ItineraryID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1052, 0x4010, 0x1052, + EVR_SH, "ItineraryIDType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1053, 0x4010, 0x1053, + EVR_LO, "ItineraryIDAssigningAuthority", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1054, 0x4010, 0x1054, + EVR_SH, "RouteID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1055, 0x4010, 0x1055, + EVR_SH, "RouteIDAssigningAuthority", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1056, 0x4010, 0x1056, + EVR_CS, "InboundArrivalType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1058, 0x4010, 0x1058, + EVR_SH, "CarrierID", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1059, 0x4010, 0x1059, + EVR_CS, "CarrierIDAssigningAuthority", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1060, 0x4010, 0x1060, + EVR_FL, "SourceOrientation", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1061, 0x4010, 0x1061, + EVR_FL, "SourcePosition", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1062, 0x4010, 0x1062, + EVR_FL, "BeltHeight", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1064, 0x4010, 0x1064, + EVR_SQ, "AlgorithmRoutingCodeSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1067, 0x4010, 0x1067, + EVR_CS, "TransportClassification", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1068, 0x4010, 0x1068, + EVR_LT, "OOITypeDescriptor", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1069, 0x4010, 0x1069, + EVR_FL, "TotalProcessingTime", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x106c, 0x4010, 0x106c, + EVR_OB, "DetectorCalibrationData", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x106d, 0x4010, 0x106d, + EVR_CS, "AdditionalScreeningPerformed", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x106e, 0x4010, 0x106e, + EVR_CS, "AdditionalInspectionSelectionCriteria", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x106f, 0x4010, 0x106f, + EVR_SQ, "AdditionalInspectionMethodSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1070, 0x4010, 0x1070, + EVR_CS, "AITDeviceType", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1071, 0x4010, 0x1071, + EVR_SQ, "QRMeasurementsSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1072, 0x4010, 0x1072, + EVR_SQ, "TargetMaterialSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1073, 0x4010, 0x1073, + EVR_FD, "SNRThreshold", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1075, 0x4010, 0x1075, + EVR_DS, "ImageScaleRepresentation", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1076, 0x4010, 0x1076, + EVR_SQ, "ReferencedPTOSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1077, 0x4010, 0x1077, + EVR_SQ, "ReferencedTDRInstanceSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1078, 0x4010, 0x1078, + EVR_ST, "PTOLocationDescription", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x1079, 0x4010, 0x1079, + EVR_SQ, "AnomalyLocatorIndicatorSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x107a, 0x4010, 0x107a, + EVR_FL, "AnomalyLocatorIndicator", 3, 3, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x107b, 0x4010, 0x107b, + EVR_SQ, "PTORegionSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x107c, 0x4010, 0x107c, + EVR_CS, "InspectionSelectionCriteria", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x107d, 0x4010, 0x107d, + EVR_SQ, "SecondaryInspectionMethodSequence", 1, 1, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4010, 0x107e, 0x4010, 0x107e, + EVR_DS, "PRCSToRCSOrientation", 6, 6, "DICOM/DICOS", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x4ffe, 0x0001, 0x4ffe, 0x0001, + EVR_SQ, "MACParametersSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x50f1, 0x0006, 0x50f1, 0x0006, + EVR_CS, "EnergySubtractionParam", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x50f1, 0x0007, 0x50f1, 0x0007, + EVR_CS, "SubtractionRegistrationResult", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x50f1, 0x0008, 0x50f1, 0x0008, + EVR_CS, "EnergySubtractionParam2", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x50f1, 0x0009, 0x50f1, 0x0009, + EVR_SL, "AfinConversionCoefficient", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x50f1, 0x0010, 0x50f1, 0x0010, + EVR_CS, "FilmOutputFormat", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } + , { 0x50f1, 0x0020, 0x50f1, 0x0020, + EVR_CS, "ImageProcessingModificationFlag", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "FDMS 1.0" } +#endif + , { 0x5200, 0x9229, 0x5200, 0x9229, + EVR_SQ, "SharedFunctionalGroupsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5200, 0x9230, 0x5200, 0x9230, + EVR_SQ, "PerFrameFunctionalGroupsSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5400, 0x0100, 0x5400, 0x0100, + EVR_SQ, "WaveformSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5400, 0x0110, 0x5400, 0x0110, + EVR_ox, "ChannelMinimumValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5400, 0x0112, 0x5400, 0x0112, + EVR_ox, "ChannelMaximumValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5400, 0x1004, 0x5400, 0x1004, + EVR_US, "WaveformBitsAllocated", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5400, 0x1006, 0x5400, 0x1006, + EVR_CS, "WaveformSampleInterpretation", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5400, 0x100a, 0x5400, 0x100a, + EVR_ox, "WaveformPaddingValue", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5400, 0x1010, 0x5400, 0x1010, + EVR_ox, "WaveformData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5600, 0x0010, 0x5600, 0x0010, + EVR_OF, "FirstOrderPhaseCorrectionAngle", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x5600, 0x0020, 0x5600, 0x0020, + EVR_OF, "SpectroscopyData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x6001, 0x0000, 0x6001, 0x0000, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "PHILIPS MR/LAST" } + , { 0x6021, 0x0000, 0x6021, 0x0000, + EVR_LT, "ImageGraphicsFormatCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x6021, 0x0000, 0x6021, 0x0000, + EVR_LT, "OsteoContourComment", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 OST" } + , { 0x6021, 0x0010, 0x6021, 0x0010, + EVR_LT, "ImageGraphics", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x6021, 0x0010, 0x6021, 0x0010, + EVR_US, "OsteoContourBuffer", 256, 256, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CT VA0 OST" } + , { 0x7001, 0x0001, 0x7001, 0x0001, + EVR_UI, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Picker NM Private Group" } + , { 0x7001, 0x0002, 0x7001, 0x0002, + EVR_OB, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "Picker NM Private Group" } + , { 0x7001, 0x0010, 0x7001, 0x0010, + EVR_LT, "Dummy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x7003, 0x0010, 0x7003, 0x0010, + EVR_LT, "Header", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } + , { 0x7005, 0x0010, 0x7005, 0x0010, + EVR_LT, "Dummy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS MED" } +#endif + , { 0x7fe0, 0x0001, 0x7fe0, 0x0001, + EVR_OV, "ExtendedOffsetTable", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x7fe0, 0x0002, 0x7fe0, 0x0002, + EVR_OV, "ExtendedOffsetTableLengths", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x7fe0, 0x0008, 0x7fe0, 0x0008, + EVR_OF, "FloatPixelData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x7fe0, 0x0009, 0x7fe0, 0x0009, + EVR_OD, "DoubleFloatPixelData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x7fe0, 0x0010, 0x7fe0, 0x0010, + EVR_ox, "PixelData", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x7fe0, 0x0020, 0x7fe0, 0x0020, + EVR_OW, "RETIRED_CoefficientsSDVN", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x7fe0, 0x0030, 0x7fe0, 0x0030, + EVR_OW, "RETIRED_CoefficientsSDHN", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x7fe0, 0x0040, 0x7fe0, 0x0040, + EVR_OW, "RETIRED_CoefficientsSDDN", 1, 1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x7fe1, 0x0000, 0x7fe1, 0x0000, + EVR_OB, "BinaryData", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CM VA0 CMS" } + , { 0x7fe1, 0x0010, 0x7fe1, 0x0010, + EVR_OB, "CSAData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS CSA NON-IMAGE" } + , { 0x7fe1, 0x0010, 0x7fe1, 0x0010, + EVR_ox, "PixelData", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SPI-P Release 1" } + , { 0x7fe3, 0x0000, 0x7fe3, 0x0000, + EVR_LT, "ImageGraphicsFormatCode", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS NUMARIS II" } + , { 0x7fe3, 0x0010, 0x7fe3, 0x0010, + EVR_OB, "ImageGraphics", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS NUMARIS II" } + , { 0x7fe3, 0x0020, 0x7fe3, 0x0020, + EVR_OB, "ImageGraphicsDummy", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "SIEMENS NUMARIS II" } + , { 0x7ff1, 0x0001, 0x7ff1, 0x0001, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x7ff1, 0x0001, 0x7ff1, 0x0001, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0002, 0x7ff1, 0x0002, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x7ff1, 0x0002, 0x7ff1, 0x0002, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0003, 0x7ff1, 0x0003, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } + , { 0x7ff1, 0x0003, 0x7ff1, 0x0003, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0004, 0x7ff1, 0x0004, + EVR_IS, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0005, 0x7ff1, 0x0005, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0007, 0x7ff1, 0x0007, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0008, 0x7ff1, 0x0008, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0009, 0x7ff1, 0x0009, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x000a, 0x7ff1, 0x000a, + EVR_LT, "Unknown", 1, 1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x000b, 0x7ff1, 0x000b, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x000c, 0x7ff1, 0x000c, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x000d, 0x7ff1, 0x000d, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_CT_1.0" } + , { 0x7ff1, 0x0010, 0x7ff1, 0x0010, + EVR_US, "Unknown", 1, -1, "PrivateTag", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + "TOSHIBA_MEC_1.0" } +#endif + , { 0xfffa, 0xfffa, 0xfffa, 0xfffa, + EVR_SQ, "DigitalSignaturesSequence", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0xfffc, 0xfffc, 0xfffc, 0xfffc, + EVR_OB, "DataSetTrailingPadding", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0xfffe, 0xe000, 0xfffe, 0xe000, + EVR_na, "Item", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0xfffe, 0xe00d, 0xfffe, 0xe00d, + EVR_na, "ItemDelimitationItem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0xfffe, 0xe0dd, 0xfffe, 0xe0dd, + EVR_na, "SequenceDelimitationItem", 1, 1, "DICOM", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0010, 0x60ff, 0x0010, + EVR_US, "OverlayRows", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0011, 0x60ff, 0x0011, + EVR_US, "OverlayColumns", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0015, 0x60ff, 0x0015, + EVR_IS, "NumberOfFramesInOverlay", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0022, 0x60ff, 0x0022, + EVR_LO, "OverlayDescription", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0040, 0x60ff, 0x0040, + EVR_CS, "OverlayType", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0045, 0x60ff, 0x0045, + EVR_LO, "OverlaySubtype", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0050, 0x60ff, 0x0050, + EVR_SS, "OverlayOrigin", 2, 2, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0051, 0x60ff, 0x0051, + EVR_US, "ImageFrameOrigin", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0100, 0x60ff, 0x0100, + EVR_US, "OverlayBitsAllocated", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0102, 0x60ff, 0x0102, + EVR_US, "OverlayBitPosition", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1001, 0x60ff, 0x1001, + EVR_CS, "OverlayActivationLayer", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1301, 0x60ff, 0x1301, + EVR_IS, "ROIArea", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1302, 0x60ff, 0x1302, + EVR_DS, "ROIMean", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1303, 0x60ff, 0x1303, + EVR_DS, "ROIStandardDeviation", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1500, 0x60ff, 0x1500, + EVR_LO, "OverlayLabel", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x3000, 0x60ff, 0x3000, + EVR_ox, "OverlayData", 1, 1, "DICOM", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x0020, 0x3100, 0x0020, 0x31ff, + EVR_CS, "RETIRED_SourceImageIDs", 1, -1, "DICOM/retired", + DcmDictRange_Unspecified, DcmDictRange_Even, + NULL } + , { 0x5000, 0x0005, 0x50ff, 0x0005, + EVR_US, "RETIRED_CurveDimensions", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0010, 0x50ff, 0x0010, + EVR_US, "RETIRED_NumberOfPoints", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0020, 0x50ff, 0x0020, + EVR_CS, "RETIRED_TypeOfData", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0022, 0x50ff, 0x0022, + EVR_LO, "RETIRED_CurveDescription", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0030, 0x50ff, 0x0030, + EVR_SH, "RETIRED_AxisUnits", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0040, 0x50ff, 0x0040, + EVR_SH, "RETIRED_AxisLabels", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0103, 0x50ff, 0x0103, + EVR_US, "RETIRED_DataValueRepresentation", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0104, 0x50ff, 0x0104, + EVR_US, "RETIRED_MinimumCoordinateValue", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0105, 0x50ff, 0x0105, + EVR_US, "RETIRED_MaximumCoordinateValue", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0106, 0x50ff, 0x0106, + EVR_SH, "RETIRED_CurveRange", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0110, 0x50ff, 0x0110, + EVR_US, "RETIRED_CurveDataDescriptor", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0112, 0x50ff, 0x0112, + EVR_US, "RETIRED_CoordinateStartValue", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x0114, 0x50ff, 0x0114, + EVR_US, "RETIRED_CoordinateStepValue", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x1001, 0x50ff, 0x1001, + EVR_CS, "RETIRED_CurveActivationLayer", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2000, 0x50ff, 0x2000, + EVR_US, "RETIRED_AudioType", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2002, 0x50ff, 0x2002, + EVR_US, "RETIRED_AudioSampleFormat", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2004, 0x50ff, 0x2004, + EVR_US, "RETIRED_NumberOfChannels", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2006, 0x50ff, 0x2006, + EVR_UL, "RETIRED_NumberOfSamples", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2008, 0x50ff, 0x2008, + EVR_UL, "RETIRED_SampleRate", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x200a, 0x50ff, 0x200a, + EVR_UL, "RETIRED_TotalTime", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x200c, 0x50ff, 0x200c, + EVR_ox, "RETIRED_AudioSampleData", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x200e, 0x50ff, 0x200e, + EVR_LT, "RETIRED_AudioComments", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2500, 0x50ff, 0x2500, + EVR_LO, "RETIRED_CurveLabel", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2600, 0x50ff, 0x2600, + EVR_SQ, "RETIRED_CurveReferencedOverlaySequence", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x2610, 0x50ff, 0x2610, + EVR_US, "RETIRED_CurveReferencedOverlayGroup", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x5000, 0x3000, 0x50ff, 0x3000, + EVR_ox, "RETIRED_CurveData", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0012, 0x60ff, 0x0012, + EVR_US, "RETIRED_OverlayPlanes", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0052, 0x60ff, 0x0052, + EVR_US, "RETIRED_OverlayPlaneOrigin", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0060, 0x60ff, 0x0060, + EVR_CS, "RETIRED_OverlayCompressionCode", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0061, 0x60ff, 0x0061, + EVR_SH, "RETIRED_OverlayCompressionOriginator", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0062, 0x60ff, 0x0062, + EVR_SH, "RETIRED_OverlayCompressionLabel", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0063, 0x60ff, 0x0063, + EVR_CS, "RETIRED_OverlayCompressionDescription", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0066, 0x60ff, 0x0066, + EVR_AT, "RETIRED_OverlayCompressionStepPointers", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0068, 0x60ff, 0x0068, + EVR_US, "RETIRED_OverlayRepeatInterval", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0069, 0x60ff, 0x0069, + EVR_US, "RETIRED_OverlayBitsGrouped", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0110, 0x60ff, 0x0110, + EVR_CS, "RETIRED_OverlayFormat", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0200, 0x60ff, 0x0200, + EVR_US, "RETIRED_OverlayLocation", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0800, 0x60ff, 0x0800, + EVR_CS, "RETIRED_OverlayCodeLabel", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0802, 0x60ff, 0x0802, + EVR_US, "RETIRED_OverlayNumberOfTables", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0803, 0x60ff, 0x0803, + EVR_AT, "RETIRED_OverlayCodeTableLocation", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x0804, 0x60ff, 0x0804, + EVR_US, "RETIRED_OverlayBitsForCodeWord", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1100, 0x60ff, 0x1100, + EVR_US, "RETIRED_OverlayDescriptorGray", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1101, 0x60ff, 0x1101, + EVR_US, "RETIRED_OverlayDescriptorRed", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1102, 0x60ff, 0x1102, + EVR_US, "RETIRED_OverlayDescriptorGreen", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1103, 0x60ff, 0x1103, + EVR_US, "RETIRED_OverlayDescriptorBlue", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1200, 0x60ff, 0x1200, + EVR_US, "RETIRED_OverlaysGray", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1201, 0x60ff, 0x1201, + EVR_US, "RETIRED_OverlaysRed", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1202, 0x60ff, 0x1202, + EVR_US, "RETIRED_OverlaysGreen", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x1203, 0x60ff, 0x1203, + EVR_US, "RETIRED_OverlaysBlue", 1, -1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x6000, 0x4000, 0x60ff, 0x4000, + EVR_LT, "RETIRED_OverlayComments", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x7f00, 0x0010, 0x7fff, 0x0010, + EVR_ox, "RETIRED_VariablePixelData", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x7f00, 0x0011, 0x7fff, 0x0011, + EVR_US, "RETIRED_VariableNextDataGroup", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x7f00, 0x0020, 0x7fff, 0x0020, + EVR_OW, "RETIRED_VariableCoefficientsSDVN", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x7f00, 0x0030, 0x7fff, 0x0030, + EVR_OW, "RETIRED_VariableCoefficientsSDHN", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x7f00, 0x0040, 0x7fff, 0x0040, + EVR_OW, "RETIRED_VariableCoefficientsSDDN", 1, 1, "DICOM/retired", + DcmDictRange_Even, DcmDictRange_Unspecified, + NULL } + , { 0x0009, 0x0000, 0xffff, 0x0000, + EVR_UL, "PrivateGroupLength", 1, 1, "PRIVATE", + DcmDictRange_Odd, DcmDictRange_Unspecified, + NULL } + , { 0x0009, 0x0010, 0xffff, 0x00ff, + EVR_LO, "PrivateCreator", 1, 1, "PRIVATE", + DcmDictRange_Odd, DcmDictRange_Unspecified, + NULL } + , { 0x0001, 0x0000, 0x0007, 0x0000, + EVR_UL, "IllegalGroupLength", 1, 1, "ILLEGAL", + DcmDictRange_Odd, DcmDictRange_Unspecified, + NULL } + , { 0x0001, 0x0010, 0x0007, 0x00ff, + EVR_LO, "IllegalPrivateCreator", 1, 1, "ILLEGAL", + DcmDictRange_Odd, DcmDictRange_Unspecified, + NULL } + , { 0x0000, 0x0000, 0xffff, 0x0000, + EVR_UL, "GenericGroupLength", 1, 1, "GENERIC", + DcmDictRange_Unspecified, DcmDictRange_Unspecified, + NULL } +#ifdef ENABLE_PRIVATE_TAGS + , { 0x7001, 0x0004, 0x70ff, 0x0004, + EVR_ST, "TextAnnotation", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "DLX_ANNOT_01" } + , { 0x7001, 0x0005, 0x70ff, 0x0005, + EVR_IS, "Box", 2, 2, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "DLX_ANNOT_01" } + , { 0x7001, 0x0007, 0x70ff, 0x0007, + EVR_IS, "ArrowEnd", 2, 2, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "DLX_ANNOT_01" } + , { 0x6001, 0x0001, 0x60ff, 0x0001, + EVR_US, "GrayPaletteColorLookupTableDescriptor", 3, 3, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "DLX_LKUP_01" } + , { 0x6001, 0x0002, 0x60ff, 0x0002, + EVR_US, "GrayPaletteColorLookupTableData", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "DLX_LKUP_01" } + , { 0x6001, 0x0000, 0x60ff, 0x0000, + EVR_IS, "OverlayID", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0001, 0x60ff, 0x0001, + EVR_LT, "LinkedOverlays", 1, -1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0010, 0x60ff, 0x0010, + EVR_US, "OverlayRows", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0011, 0x60ff, 0x0011, + EVR_US, "OverlayColumns", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0040, 0x60ff, 0x0040, + EVR_LO, "OverlayType", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0050, 0x60ff, 0x0050, + EVR_US, "OverlayOrigin", 1, -1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0060, 0x60ff, 0x0060, + EVR_LO, "Editable", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0070, 0x60ff, 0x0070, + EVR_LO, "OverlayFont", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0072, 0x60ff, 0x0072, + EVR_LO, "OverlayStyle", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0074, 0x60ff, 0x0074, + EVR_US, "OverlayFontSize", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0076, 0x60ff, 0x0076, + EVR_LO, "OverlayColor", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0078, 0x60ff, 0x0078, + EVR_US, "ShadowSize", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0080, 0x60ff, 0x0080, + EVR_LO, "FillPattern", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x0082, 0x60ff, 0x0082, + EVR_US, "OverlayPenSize", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00a0, 0x60ff, 0x00a0, + EVR_LO, "Label", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00a2, 0x60ff, 0x00a2, + EVR_LT, "PostItText", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00a4, 0x60ff, 0x00a4, + EVR_US, "AnchorPoint", 2, 2, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00b0, 0x60ff, 0x00b0, + EVR_LO, "ROIType", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00b2, 0x60ff, 0x00b2, + EVR_LT, "AttachedAnnotation", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00ba, 0x60ff, 0x00ba, + EVR_US, "ContourPoints", 1, -1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00bc, 0x60ff, 0x00bc, + EVR_US, "MaskData", 1, -1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } + , { 0x6001, 0x00c0, 0x60ff, 0x00c0, + EVR_SQ, "UINOverlaySequence", 1, 1, "PrivateTag", + DcmDictRange_Odd, DcmDictRange_Unspecified, + "PAPYRUS 3.0" } +#endif + +}; + +static const size_t simpleBuiltinDict_count = + sizeof(simpleBuiltinDict)/sizeof(DBI_SimpleEntry); + + +void +DcmDataDictionary::loadBuiltinDictionary() +{ + DcmDictEntry* e = NULL; + const DBI_SimpleEntry *b = simpleBuiltinDict; + for (size_t i=0; igroup, b->element, + b->upperGroup, b->upperElement, b->evr, + b->tagName, b->vmMin, b->vmMax, + b->standardVersion, OFFalse, b->privateCreator); + e->setGroupRangeRestriction(b->groupRestriction); + e->setElementRangeRestriction(b->elementRestriction); + addEntry(e); + } +} + + +#else // WITH_BUILTIN_DICTIONARY +void +DcmDataDictionary::loadBuiltinDictionary() +{ +/* + ** Empty Stub. + ** + ** We don't want a populated built-in data dictionary. In order to enable it, + ** define WITH_BUILTIN_DICTIONARY. To re-create the builtin dictionary from + ** a textfile like dicom.dic, use dcmdata/libsrc/mkdictbi. +*/ +} + +#endif // WITH_BUILTIN_DICTIONARY + diff --git a/dcmdata/libsrc/dcdirrec.cc b/dcmdata/libsrc/dcdirrec.cc new file mode 100644 index 00000000..8bcda4f2 --- /dev/null +++ b/dcmdata/libsrc/dcdirrec.cc @@ -0,0 +1,1632 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmDirectoryRecord + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CCTYPE +#define INCLUDE_LIBC +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmdata/dcdirrec.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcspchrs.h" + +#ifdef HAVE_UNIX_H +#if defined(macintosh) && defined (HAVE_WINSOCK_H) +/* unix.h defines timeval incompatible with winsock.h */ +#define timeval _UNWANTED_timeval +#endif +#include /* for unlink() under Metrowerks C++ (Macintosh) */ +#undef timeval +#endif + + +// ******************************** + + +static const char *DRTypeNames[] = +{ + "root", + "CURVE", + "FILM BOX", + "FILM SESSION", + "IMAGE", + "IMAGE BOX", + "INTERPRETATION", + "MODALITY LUT", + "MRDR", + "OVERLAY", + "PATIENT", + "PRINT QUEUE", + "PRIVATE", + "RESULTS", + "SERIES", + "STUDY", + "STUDY COMPONENT", + "TOPIC", + "VISIT", + "VOI LUT", + "SR DOCUMENT", /* was "STRUCT REPORT" in old frozen draft */ + "PRESENTATION", + "WAVEFORM", + "RT DOSE", + "RT STRUCTURE SET", + "RT PLAN", + "RT TREAT RECORD", + "STORED PRINT", + "KEY OBJECT DOC", + "REGISTRATION", + "FIDUCIAL", + "RAW DATA", + "SPECTROSCOPY", + "ENCAP DOC", + "VALUE MAP", + "HANGING PROTOCOL", + "STEREOMETRIC", + "HL7 STRUC DOC", + "PALETTE", + "SURFACE", + "MEASUREMENT", + "IMPLANT", + "IMPLANT GROUP", + "IMPLANT ASSY", + "PLAN", + "SURFACE SCAN", + "TRACT", + "ASSESSMENT", + "RADIOTHERAPY" +}; + +static const short DIM_OF_DRTypeNames = OFstatic_cast(short, (sizeof(DRTypeNames) / sizeof(DRTypeNames[0]))); + + +// ******************************** + + +DcmDirectoryRecord::DcmDirectoryRecord() + : DcmItem(DCM_ItemTag), + recordsOriginFile(), + lowerLevelList(new DcmSequenceOfItems(DCM_DirectoryRecordSequence)), + DirRecordType(ERT_Private), + referencedMRDR(NULL), + numberOfReferences(0), + offsetInFile(0) +{ +} + + +// ******************************** + + +DcmDirectoryRecord::DcmDirectoryRecord(const DcmTag &tag, + const Uint32 len) + : DcmItem(tag, len), + recordsOriginFile(), + lowerLevelList(new DcmSequenceOfItems(DCM_DirectoryRecordSequence)), + DirRecordType(ERT_Private), + referencedMRDR(NULL), + numberOfReferences(0), + offsetInFile(0) +{ +} + + +// ******************************** + + +DcmDirectoryRecord::DcmDirectoryRecord(const E_DirRecType recordType, + const char *referencedFileID, + const OFFilename &sourceFilename, + DcmFileFormat *fileFormat) + : DcmItem(DCM_ItemTag), + recordsOriginFile(), + lowerLevelList(new DcmSequenceOfItems(DCM_DirectoryRecordSequence)), + DirRecordType(recordType), + referencedMRDR(NULL), + numberOfReferences(0), + offsetInFile(0) +{ + setRecordsOriginFile(sourceFilename); + + if (DirRecordType != ERT_root) + errorFlag = fillElementsAndReadSOP(referencedFileID, sourceFilename, fileFormat); +} + + +// ******************************** + + +DcmDirectoryRecord::DcmDirectoryRecord(const char *recordTypeName, + const char *referencedFileID, + const OFFilename &sourceFilename, + DcmFileFormat *fileFormat) + : DcmItem(DCM_ItemTag), + recordsOriginFile(), + lowerLevelList(new DcmSequenceOfItems(DCM_DirectoryRecordSequence)), + DirRecordType(ERT_Private), + referencedMRDR(NULL), + numberOfReferences(0), + offsetInFile(0) +{ + DirRecordType = recordNameToType(recordTypeName); + setRecordsOriginFile(sourceFilename); + + if (DirRecordType != ERT_root) + errorFlag = fillElementsAndReadSOP(referencedFileID, sourceFilename, fileFormat); +} + + +// ******************************** + + +DcmDirectoryRecord::DcmDirectoryRecord(const DcmDirectoryRecord &old) + : DcmItem(old), + recordsOriginFile(old.recordsOriginFile), + lowerLevelList(new DcmSequenceOfItems(*old.lowerLevelList)), + DirRecordType(old.DirRecordType), + referencedMRDR(old.referencedMRDR), // copies a pointer! + numberOfReferences(old.numberOfReferences), + offsetInFile(old.offsetInFile) +{ +} + + +// ******************************** + + +DcmDirectoryRecord& DcmDirectoryRecord::operator=(const DcmDirectoryRecord& obj) +{ + if (this != &obj) + { + // copy parent's member variables + DcmItem::operator=(obj); + // copy DcmDirectoryRecords' member variables + recordsOriginFile = obj.recordsOriginFile; + lowerLevelList = new DcmSequenceOfItems(*obj.lowerLevelList); + DirRecordType = obj.DirRecordType; + referencedMRDR = obj.referencedMRDR; // copies a pointer! + numberOfReferences = obj.numberOfReferences; + offsetInFile = obj.offsetInFile; + } + return *this; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmDirectoryRecord &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmDirectoryRecord::~DcmDirectoryRecord() +{ + delete lowerLevelList; +} + + +// ******************************** + + +E_DirRecType DcmDirectoryRecord::recordNameToType(const char *recordTypeName) +{ + E_DirRecType recType = ERT_Private; + if (recordTypeName != NULL) + { + short i = 0; + while (i < DIM_OF_DRTypeNames && strcmp(DRTypeNames[i], recordTypeName) != 0) + i++; + + if (i < DIM_OF_DRTypeNames && strcmp(DRTypeNames[i], recordTypeName) == 0) + recType = OFstatic_cast(E_DirRecType, i); + else if (strcmp(recordTypeName,"STRUCT REPORT") == 0) + recType = ERT_SRDocument; // we recognize the old name as well + DCMDATA_TRACE("DcmDirectoryRecord::recordNameToType() input char*=\"" << recordTypeName + << "\" output enum=" << recType); + } + return recType; +} + + +// ******************************** + + +char *DcmDirectoryRecord::buildFileName(const char *origName, + char *destName, + size_t len) const +{ + const char *from = origName; + char *to = destName; + char c; + char lastchar = '\0'; + while ((c = *from++) != 0) + { + if (c == '\\') + { + if (lastchar != '\\') // eliminate double '\\' + *to++ = PATH_SEPARATOR; + } else { + *to++ = c; + } + lastchar = c; + } + *to = '\0'; + + /* + ** Some OS's append a '.' to the filename of a ISO9660 filesystem. + ** If the filename does not exist then try appending a '.' + */ + FILE* f = NULL; + if ((f = fopen(destName, "rb")) != NULL) + { + fclose(f); + } else { + size_t buflen = strlen(destName) + 2; + char* newname = new char[buflen]; + OFStandard::strlcpy(newname, destName, buflen); + OFStandard::strlcat(newname, ".", buflen); + if ((f = fopen(newname, "rb")) != NULL) + { + fclose(f); + OFStandard::strlcpy(destName, newname, len); + } else { + /* we cannot find the file. let the caller deal with this */ + } + delete[] newname; + } + return destName; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::checkHierarchy(const E_DirRecType upperRecord, + const E_DirRecType lowerRecord) +{ + OFCondition l_error = EC_IllegalCall; + switch (upperRecord) + { + case ERT_root: + switch (lowerRecord) + { + case ERT_Patient: + case ERT_PrintQueue: + case ERT_Topic: + case ERT_HangingProtocol: + case ERT_Palette: + case ERT_Implant: + case ERT_ImplantGroup: + case ERT_ImplantAssy: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_FilmBox: // retired + switch (lowerRecord) + { + case ERT_ImageBox: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_FilmSession: // retired + switch (lowerRecord) + { + case ERT_FilmBox: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_Patient: + switch (lowerRecord) + { + case ERT_Study: + case ERT_HL7StrucDoc: // retired + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_PrintQueue: // retired + switch (lowerRecord) + { + case ERT_FilmSession: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_Results: // retired + switch (lowerRecord) + { + case ERT_Interpretation: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_Series: + switch (lowerRecord) + { + case ERT_Curve: + case ERT_Image: + case ERT_ModalityLut: + case ERT_Overlay: + case ERT_VoiLut: + case ERT_SRDocument: + case ERT_Presentation: + case ERT_Waveform: + case ERT_RTDose: + case ERT_RTStructureSet: + case ERT_RTPlan: + case ERT_RTTreatRecord: + case ERT_StoredPrint: + case ERT_KeyObjectDoc: + case ERT_Registration: + case ERT_Fiducial: + case ERT_RawData: + case ERT_Spectroscopy: + case ERT_EncapDoc: + case ERT_ValueMap: + case ERT_Stereometric: + case ERT_Surface: + case ERT_Measurement: + case ERT_Plan: + case ERT_SurfaceScan: + case ERT_Tract: + case ERT_Assessment: + case ERT_Radiotherapy: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_Study: + switch (lowerRecord) + { + case ERT_FilmSession: + case ERT_Results: + case ERT_Series: + case ERT_StudyComponent: + case ERT_Visit: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_Topic: // retired + switch (lowerRecord) + { + case ERT_Curve: + case ERT_FilmSession: + case ERT_Image: + case ERT_ModalityLut: + case ERT_Overlay: + case ERT_Series: + case ERT_Study: + case ERT_VoiLut: + case ERT_SRDocument: + case ERT_Presentation: + case ERT_Waveform: + case ERT_RTDose: + case ERT_RTStructureSet: + case ERT_RTPlan: + case ERT_RTTreatRecord: + case ERT_StoredPrint: + case ERT_KeyObjectDoc: + case ERT_Registration: + case ERT_Fiducial: + case ERT_RawData: + case ERT_Spectroscopy: + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + case ERT_Mrdr: // retired + l_error = EC_IllegalCall; + break; + case ERT_Curve: + case ERT_Image: + case ERT_ImageBox: + case ERT_Interpretation: + case ERT_ModalityLut: + case ERT_Overlay: + case ERT_StudyComponent: + case ERT_Visit: + case ERT_VoiLut: + case ERT_SRDocument: + case ERT_Presentation: + case ERT_Waveform: + case ERT_RTDose: + case ERT_RTStructureSet: + case ERT_RTPlan: + case ERT_RTTreatRecord: + case ERT_StoredPrint: + case ERT_KeyObjectDoc: + case ERT_Registration: + case ERT_Fiducial: + case ERT_RawData: + case ERT_Spectroscopy: + case ERT_EncapDoc: + case ERT_ValueMap: + case ERT_HangingProtocol: + case ERT_Stereometric: + case ERT_HL7StrucDoc: // retired + case ERT_Palette: + case ERT_Surface: + case ERT_Measurement: + case ERT_Implant: + case ERT_ImplantGroup: + case ERT_ImplantAssy: + case ERT_Plan: + case ERT_SurfaceScan: + case ERT_Tract: + case ERT_Assessment: + case ERT_Radiotherapy: + case ERT_Private: + switch (lowerRecord) + { + case ERT_Private: + l_error = EC_Normal; + break; + default: + l_error = EC_IllegalCall; + break; + } + break; + default: + l_error = EC_Normal; + break; + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::setRecordType(E_DirRecType newType) +{ + OFCondition l_error = EC_Normal; + + DcmTag dirRecTag(DCM_DirectoryRecordType); + DcmCodeString *csP = new DcmCodeString(dirRecTag); + csP->putString(DRTypeNames[newType]); + insert(csP, OFTrue); + + return l_error; +} + + +// ******************************** + + + +E_DirRecType DcmDirectoryRecord::lookForRecordType() +{ + E_DirRecType localType = ERT_Private; + if (!elementList->empty()) + { + DcmStack stack; + if (search(DCM_DirectoryRecordType, stack, ESM_fromHere, OFFalse).good()) + { + if (stack.top()->ident() == EVR_CS) + { + char *recName = NULL; + DcmCodeString *recType = OFstatic_cast(DcmCodeString *, stack.top()); + recType->verify(OFTrue); // force dealignment + recType->getString(recName); + localType = recordNameToType(recName); + + DCMDATA_TRACE("DcmDirectoryRecord::lookForRecordType() RecordType Element " + << recType->getTag() << " Type = " << DRTypeNames[DirRecordType]); + } + } + } + return localType; +} + + +// ******************************** + +static void hostToDicomFilename(char *fname) +{ + /* + ** Massage filename into DICOM format. + ** Eliminate any invalid characters. + ** Most commonly there is a '.' at the end of a filename. + */ + size_t len = strlen(fname); + int k = 0; + unsigned char c = '\0'; + for (size_t i = 0; i < len; ++i) + { + c = OFstatic_cast(unsigned char, fname[i]); + /* the PATH_SEPARATOR depends on the OS (see ) */ + if (c == PATH_SEPARATOR) + { + fname[k++] = '\\'; + } else if (isalpha(c) || isdigit(c) || (c == '_') || (c == '\\')) { + /* filenames in DICOM must always be in uppercase */ + fname[k++] = OFstatic_cast(char, toupper(c)); + } + } + fname[k] = '\0'; +} + + +OFCondition DcmDirectoryRecord::setReferencedFileID(const char *referencedFileID) +{ + OFCondition l_error = EC_Normal; + + size_t bufsize = strlen(referencedFileID) + 1; + char* newFname = new char[bufsize]; + OFStandard::strlcpy(newFname, referencedFileID, bufsize); + hostToDicomFilename(newFname); + + DcmTag refFileTag(DCM_ReferencedFileID); + DcmCodeString *csP = new DcmCodeString(refFileTag); + if (referencedFileID != NULL) + csP->putString(newFname); + insert(csP, OFTrue); + + delete[] newFname; + return l_error; +} + + +// ******************************** + + +const char *DcmDirectoryRecord::lookForReferencedFileID() +{ + char *localFile = NULL; + if (!elementList->empty()) + { + DcmStack stack; + if (search(DCM_ReferencedFileID, stack, ESM_fromHere, OFFalse).good()) + { + if (stack.top()->ident() == EVR_CS) + { + DcmCodeString *refFile = OFstatic_cast(DcmCodeString *, stack.top()); + refFile->verify(OFTrue); // force dealignment + refFile->getString(localFile); + if (localFile != NULL && *localFile == '\0') + localFile = NULL; + } + } + } + DCMDATA_TRACE("DcmDirectoryRecord::lookForReferencedFileID() ReferencedFileID = " + << ((localFile) ? localFile : "")); + + return localFile; +} + + +// ******************************** + + +DcmDirectoryRecord *DcmDirectoryRecord::lookForReferencedMRDR() +{ + DcmDirectoryRecord *localMRDR = NULL; + if (!elementList->empty()) + { + DcmStack stack; + if (search(DCM_RETIRED_MRDRDirectoryRecordOffset, stack, ESM_fromHere, OFFalse).good()) + { + if (stack.top()->ident() == EVR_up) + { + DcmUnsignedLongOffset *offElem; + offElem = OFstatic_cast(DcmUnsignedLongOffset *, stack.top()); + localMRDR = OFstatic_cast(DcmDirectoryRecord *, offElem->getNextRecord()); +#ifdef DEBUG + Uint32 l_uint = 0; + offElem->getUint32(l_uint); + DCMDATA_TRACE("DcmDirectoryRecord::lookForReferencedMRDR() MRDR Offset Element " + << offElem->getTag() << " offs=0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(8) << l_uint + << " p=" << OFstatic_cast(void *, offElem) + << " n=" << OFstatic_cast(void *, localMRDR)); +#endif + } + } + } + if (localMRDR == NULL) + DCMDATA_TRACE("DcmDirectoryRecord::lookForReferencedMRDR() no ReferencedMRDR found"); + + return localMRDR; +} + + +// ******************************** + + +const char *DcmDirectoryRecord::getReferencedFileName() +{ + const char *localFile = NULL; + if (referencedMRDR != NULL) + localFile = referencedMRDR->lookForReferencedFileID(); + else + localFile = lookForReferencedFileID(); + return localFile; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::setRecordInUseFlag(const Uint16 newFlag) +{ + OFCondition l_error = EC_Normal; + + DcmTag recInUseTag(DCM_RecordInUseFlag); + DcmUnsignedShort *usP = new DcmUnsignedShort(recInUseTag); + usP->putUint16(newFlag); + insert(usP, OFTrue); + + return l_error; +} + + +// ******************************** + + +Uint16 DcmDirectoryRecord::lookForRecordInUseFlag() +{ + Uint16 localFlag = Uint16(0xffff); // default value: record is in use + if (!elementList->empty()) + { + DcmStack stack; + if (search(DCM_RecordInUseFlag, stack, ESM_fromHere, OFFalse).good()) + { + if (stack.top()->ident() == EVR_US) + errorFlag = OFstatic_cast(DcmUnsignedShort *, stack.top())->getUint16(localFlag); + } + } + return localFlag; +} + + +// ******************************** + + +Uint32 DcmDirectoryRecord::getFileOffset() const +{ + return offsetInFile; +} + + +// ******************************** + + +Uint32 DcmDirectoryRecord::setFileOffset(Uint32 position) +{ + offsetInFile = position; + return position; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::setNumberOfReferences(Uint32 newRefNum) +{ + OFCondition l_error = EC_Normal; + if (DirRecordType == ERT_Mrdr) + { + // insert new value + DcmTag numRefTag(DCM_RETIRED_NumberOfReferences); + DcmUnsignedLong *newUL = new DcmUnsignedLong(numRefTag); + newUL->putUint32(newRefNum); + insert(newUL, OFTrue); + } else { + errorFlag = EC_IllegalCall; + DCMDATA_ERROR("illegal usage of DcmDirectoryRecord::setNumberOfReferences() - RecordType must be MRDR"); + } + return l_error; +} + + +// ******************************** + + +Uint32 DcmDirectoryRecord::lookForNumberOfReferences() +{ + Uint32 localRefNum = 0L; + if (!elementList->empty()) + { + DcmStack stack; + if (search(DCM_RETIRED_NumberOfReferences, stack, ESM_fromHere, OFFalse).good()) + { + if (stack.top()->ident() == EVR_UL) + errorFlag = OFstatic_cast(DcmUnsignedLong *, stack.top())->getUint32(localRefNum); + } + } + return localRefNum; +} + + +// ******************************** + + +Uint32 DcmDirectoryRecord::increaseRefNum() +{ + if (DirRecordType == ERT_Mrdr) + { + if (numberOfReferences == 0L) + setRecordInUseFlag(0xffff); // activate record + numberOfReferences++; + errorFlag = setNumberOfReferences(numberOfReferences); + } else { + errorFlag = EC_IllegalCall; + DCMDATA_ERROR("illegal usage of DcmDirectoryRecord::increaseRefNum() - RecordType must be MRDR"); + } + return numberOfReferences; +} + + +// ******************************** + + +Uint32 DcmDirectoryRecord::decreaseRefNum() +{ + if (DirRecordType == ERT_Mrdr) + { + if (numberOfReferences > 0) + { + numberOfReferences--; + if (numberOfReferences == 0L) + setRecordInUseFlag(0x0000); // deactivate record + errorFlag = setNumberOfReferences(numberOfReferences); + } else { + errorFlag = EC_IllegalCall; + DCMDATA_WARN("DcmDirectoryRecord::decreaseRefNum() attempt to decrease value lower than zero"); + } + } else { + errorFlag = EC_IllegalCall; + DCMDATA_ERROR("illegal usage of DcmDirectoryRecord::decreaseRefNum() - RecordType must be MRDR"); + } + return numberOfReferences; +} + + + +// ******************************** + +// --- IGNORE THE FOLLOWING GERMAN COMMENT --- +// +// Es werden alle Datenelemente gemaess Tabelle B.3.2.2-1 DICOM part 10 +// erzeugt. +// Wird ein gueltiger Dateiname (referencedFileID) fuer eine SOP-Instanz +// uebergeben, so werden alle benoetigten keys aus dieser Datei ausgelesen: +// Das Datenelement MRDRDirectoryRecordOffset entfaellt. +// directFromFile == OFTrue +// +// Ist referencedFileID ein NULL-Zeiger, so wird versucht, die keys indirekt +// ueber den referenzierten MRDR zu besorgen. +// Das Datenelement ReferencedFileID bekommt die Laenge 0. +// indirectViaMRDR == OFTrue +// +// Existiert kein Verweis auf einen MRDR, so wird davon ausgegangen, das auch +// keine SOP-Instanz mit dem aktuellen Directory Record verknuepft werden soll: +// Die Datenelemente ReferencedFileID, MRDRDirectoryRecordOffset, +// ReferencedSOPClassUIDinFile und ReferencedSOPInstanceUIDinFile entfallen. +// !directFromFile && !indirectViaMRDR +// + +OFCondition DcmDirectoryRecord::fillElementsAndReadSOP(const char *referencedFileID, + const OFFilename &sourceFileName, + DcmFileFormat *fileFormat) +{ + OFCondition l_error = EC_Normal; + OFFilename fileName; + DcmFileFormat *refFile = NULL; + /* This variable is only set if we created our own DcmFileFormat instance */ + DcmFileFormat *ownFile = NULL; + + if (fileFormat != NULL && sourceFileName.isEmpty()) + return EC_IllegalCall; + + OFBool directFromFile = OFFalse; + OFBool indirectViaMRDR = OFFalse; + if (referencedFileID != NULL && *referencedFileID != '\0') + directFromFile = OFTrue; + else if (DirRecordType != ERT_Mrdr && referencedMRDR != NULL) // illegal for MRDR + { + indirectViaMRDR = OFTrue; + referencedFileID = referencedMRDR->lookForReferencedFileID(); + } + + if (referencedFileID != NULL && *referencedFileID != '\0') + { + if (sourceFileName.isEmpty()) + { + /* create a new source filename */ + size_t bufsize = strlen(referencedFileID) + 2; + char *newname = new char[bufsize]; + buildFileName(referencedFileID, newname, bufsize); + fileName.set(newname); + delete[] newname; + } else { + /* just copy the source filename */ + fileName = sourceFileName; + } + + if (DirRecordType != ERT_Mrdr) + { + if (fileFormat) + { + DCMDATA_TRACE("DcmDirectoryRecord::fillElementsAndReadSOP(): Using existing file format for \"" << fileName << "\"."); + refFile = fileFormat; + } else { + DCMDATA_TRACE("DcmDirectoryRecord::fillElementsAndReadSOP(): Load file \"" << fileName << "\" because our caller didn't do so."); + ownFile = new DcmFileFormat(); + l_error = ownFile->loadFile(fileName); + refFile = ownFile; + if (l_error.bad()) + { + DCMDATA_ERROR("DcmDirectoryRecord::fillElementsAndReadSOP(): DicomFile \"" + << fileName << "\" not found"); + directFromFile = OFFalse; + indirectViaMRDR = OFFalse; + } + } + } + } else { + directFromFile = OFFalse; + indirectViaMRDR = OFFalse; + } + + DcmStack stack; + DcmUnsignedLongOffset *uloP; + DcmUniqueIdentifier *uiP; + + DcmTag nextOffTag(DCM_OffsetOfTheNextDirectoryRecord); // (0004,1400) + uloP = new DcmUnsignedLongOffset(nextOffTag); + uloP->putUint32(Uint32(0)); + if (insert(uloP, OFFalse).bad()) + delete uloP; + + setRecordInUseFlag(0xffff); // (0004,1410) + + DcmTag lowerOffTag(DCM_OffsetOfReferencedLowerLevelDirectoryEntity); + uloP = new DcmUnsignedLongOffset(lowerOffTag); // (0004,1420) + uloP->putUint32(Uint32(0)); + if (insert(uloP, OFFalse).bad()) + delete uloP; + + setRecordType(DirRecordType); // (0004,1430) + + DcmTag privRecTag(DCM_PrivateRecordUID); // (0004,1432) + if (DirRecordType == ERT_Private) + { + uiP = new DcmUniqueIdentifier(privRecTag); + if (insert(uiP, OFFalse).bad()) + delete uiP; + } else + delete remove(privRecTag); + + if (directFromFile) // (0004,1500) + setReferencedFileID(referencedFileID); + else + { + DcmTag refFileTag(DCM_ReferencedFileID); + delete remove(refFileTag); + } + + DcmTag mrdrOffTag(DCM_RETIRED_MRDRDirectoryRecordOffset); // (0004,1504) + if (indirectViaMRDR) + { + // create pointer attribute to MRDR + DcmUnsignedLongOffset *uloP2 = new DcmUnsignedLongOffset(mrdrOffTag); + uloP2->putUint32(Uint32(0)); + uloP2->setNextRecord(referencedMRDR); + insert(uloP2, OFTrue); + } else + delete remove(mrdrOffTag); + + DcmTag refSOPClassTag(DCM_ReferencedSOPClassUIDInFile); + DcmTag refSOPInstTag(DCM_ReferencedSOPInstanceUIDInFile); + DcmTag refFileXferTag(DCM_ReferencedTransferSyntaxUIDInFile); + + if (DirRecordType != ERT_Mrdr && (directFromFile || indirectViaMRDR)) + { + if (refFile == NULL) + { + DCMDATA_ERROR("Internal ERROR in DcmDirectoryRecord::fillElementsAndReadSOP()"); + } + uiP = new DcmUniqueIdentifier(refSOPClassTag); // (0004,1510) + if (refFile->search(DCM_SOPClassUID, stack).good()) + { + char *uid = NULL; + OFstatic_cast(DcmUniqueIdentifier *, stack.top())->getString(uid); + uiP->putString(uid); + } else { + DCMDATA_ERROR("DcmDirectoryRecord::fillElementsAndReadSOP(): " + << "can't find SOPClassUID in Dataset: " << fileName); + l_error = EC_CorruptedData; + } + insert(uiP, OFTrue); + + uiP = new DcmUniqueIdentifier(refSOPInstTag); // (0004,1511) + if (refFile->search(DCM_SOPInstanceUID, stack).good() || refFile->search(DCM_MediaStorageSOPInstanceUID, stack).good()) + { + char *uid = NULL; + OFstatic_cast(DcmUniqueIdentifier *, stack.top())->getString(uid); + uiP->putString(uid); + } else { + DCMDATA_ERROR("DcmDirectoryRecord::fillElementsAndReadSOP(): " + << "can't find SOPInstanceUID neither in Dataset or MetaInfo of file: " << fileName); + l_error = EC_CorruptedData; + } + insert(uiP, OFTrue); + + uiP = new DcmUniqueIdentifier(refFileXferTag); // (0004,1512) + if (refFile->search(DCM_TransferSyntaxUID, stack).good()) + { + char *uid = NULL; + OFstatic_cast(DcmUniqueIdentifier *, stack.top())->getString(uid); + uiP->putString(uid); + } else { + DCMDATA_ERROR("DcmDirectoryRecord::fillElementsAndReadSOP(): " + << "can't find TransferSyntaxUID in MetaInfo of file: " << fileName); + l_error = EC_CorruptedData; + } + insert(uiP, OFTrue); + } + else // not only in this case: if (DirRecordType == ERT_Mrdr) + { + // remove SOP UIDs from Directory Record + delete remove(refSOPClassTag); + delete remove(refSOPInstTag); + delete remove(refFileXferTag); + } + + delete ownFile; + + return l_error; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::masterInsertSub(DcmDirectoryRecord *dirRec, + const unsigned long where) +{ + // insert without type check + errorFlag = lowerLevelList->insert(dirRec, where); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::purgeReferencedFile() +{ + OFCondition l_error = EC_Normal; + if (DirRecordType != ERT_root) + { + char *localFileName = NULL; + + // remove filename from directory record + const char *fileName = lookForReferencedFileID(); + if (fileName != NULL) + { + size_t buflen = strlen(fileName) + 2; + localFileName = new char[buflen]; + buildFileName(fileName, localFileName, buflen); + setReferencedFileID(NULL); + } + + DCMDATA_DEBUG("DcmDirectoryRecord::purgeReferencedFile() trying to purge file " + << localFileName << " from file system"); + + if (localFileName != NULL) + { // filename exists + if (unlink(localFileName) != 0) + { + OFString buffer = OFStandard::getLastSystemErrorCode().message(); + errorFlag = makeOFCondition(OFM_dcmdata, 19, OF_error, buffer.c_str()); + } + delete[] localFileName; + } else { // no referenced file exists + // do nothing + } + } else + l_error = EC_IllegalCall; + + return l_error; +} + + +// ******************************** +// ******** public methods ******** +// ******************************** + + +DcmEVR DcmDirectoryRecord::ident() const +{ + return EVR_dirRecord; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::convertCharacterSet(const OFString &fromCharset, + const OFString &toCharset, + const size_t flags, + const OFBool updateCharset) +{ + // call the method of the base class; this method is only needed to avoid a compiler warning + return DcmItem::convertCharacterSet(fromCharset, toCharset, flags, updateCharset); +} + + +OFCondition DcmDirectoryRecord::convertCharacterSet(const OFString &toCharset, + const size_t flags, + const OFBool ignoreCharset) +{ + // call the method of the base class; this method is only needed to avoid a compiler warning + return DcmItem::convertCharacterSet(toCharset, flags, ignoreCharset); +} + + +OFCondition DcmDirectoryRecord::convertCharacterSet(DcmSpecificCharacterSet &converter) +{ + DCMDATA_DEBUG("DcmDirectoryRecord::convertCharacterSet() processing directory record with offset " + << getFileOffset()); + // handle special case of DICOMDIR: the Specific Character Set (0008,0005) + // can be specified individually for each directory record (i.e. item) + OFCondition status = EC_Normal; + OFString fromCharset; + const OFString toCharset = converter.getDestinationCharacterSet(); + // determine value of Specific Character Set (0008,0005) if present in this item + if (findAndGetOFStringArray(DCM_SpecificCharacterSet, fromCharset, OFFalse /*searchIntoSub*/).good() && + (fromCharset != converter.getSourceCharacterSet())) + { + DcmSpecificCharacterSet newConverter; + // create a new character set converter + DCMDATA_DEBUG("DcmDirectoryRecord::convertCharacterSet() creating a new character set converter for '" + << fromCharset << "'" << (fromCharset.empty() ? " (ASCII)" : "") << " to '" + << toCharset << "'" << (toCharset.empty() ? " (ASCII)" : "")); + // select source and destination character set, use same transliteration mode + status = newConverter.selectCharacterSet(fromCharset, toCharset); + if (status.good()) + { + const unsigned cflags = converter.getConversionFlags(); + if (cflags > 0) + status = newConverter.setConversionFlags(cflags); + if (status.good()) + { + // convert all affected element values in the item with the new converter + status = DcmItem::convertCharacterSet(newConverter); + // update the Specific Character Set (0008,0005) element + updateSpecificCharacterSet(status, newConverter); + } + } + } else { + // no Specific Character Set attribute or the same character set, + // so proceed with the given converter + status = DcmItem::convertCharacterSet(converter); + } + return status; +} + + +// ******************************** + + +void DcmDirectoryRecord::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + if (flags & DCMTypes::PF_showTreeStructure) + { + /* print record line */ + OFOStringStream oss; + oss << "\"Directory Record\" (offset=$" + << getFileOffset() << ")" << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + printInfoLine(out, flags, level, tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + /* print item content */ + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (elementList->seek(ELP_next)); + } + if (lowerLevelList->card() > 0) + lowerLevelList->print(out, flags, level + 1); + } else { + /* print record start line */ + OFOStringStream oss; + oss << "\"Directory Record\" " << DRTypeNames[DirRecordType] + << " #=" << card() << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + printInfoLine(out, flags, level, tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + /* print record comment line */ + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_INFO; + printNestingLevel(out, flags, level); + out << "# offset=$" << getFileOffset(); + if (referencedMRDR != NULL) + out << " refMRDR=$" << referencedMRDR->getFileOffset(); + if (DirRecordType == ERT_Mrdr) + out << " refCount=" << numberOfReferences; + const char *refFile = getReferencedFileName(); + if (refFile != NULL) + out << " refFileID=\"" << refFile << "\""; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_RESET; + out << OFendl; + /* print item content */ + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (elementList->seek(ELP_next)); + } + if (lowerLevelList->card() > 0) + lowerLevelList->print(out, flags, level + 1); + /* print record end line */ + DcmTag delimItemTag(DCM_ItemDelimitationItemTag); + if (getLengthField() == DCM_UndefinedLength) + printInfoLine(out, flags, level, "\"ItemDelimitationItem\"", &delimItemTag); + else + printInfoLine(out, flags, level, "\"ItemDelimitationItem for re-encoding\"", &delimItemTag); + } +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + OFCondition l_error = EC_Normal; + if (flags & DCMTypes::XF_useNativeModel) + { + /* in Native DICOM Model, there is no concept of a DICOMDIR */ + l_error = makeOFCondition(OFM_dcmdata, EC_CODE_CannotConvertToXML, OF_error, + "Cannot convert Directory Record to Native DICOM Model"); + } else { + /* XML start tag for "item" */ + out << "" << OFendl; + /* write item content */ + if (!elementList->empty()) + { + /* write content of all children */ + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + l_error = dO->writeXML(out, flags); + } while (l_error.good() && elementList->seek(ELP_next)); + } + if (l_error.good()) + { + if (lowerLevelList->card() > 0) + lowerLevelList->writeXML(out, flags); + /* XML end tag for "item" */ + out << "" << OFendl; + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::read(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + if (getTransferState() != ERW_ready) + { + DcmXfer xferSyn(xfer); + errorFlag = DcmItem::read(inStream, xfer, glenc, maxReadLength); + /* + ** Remember the actual file offset for this Directory Record. + ** Compute by subtracting the Item header (tag & length fields) + ** from the start position of data within the Item (fStartPosition). + ** fStartPosition is set in DcmItem::read(...) + ** offsetInFile is used in the print(...) method. + */ + offsetInFile = OFstatic_cast(Uint32, fStartPosition) - xferSyn.sizeofTagHeader(getTag().getEVR()); + } + + if (getTransferState() == ERW_ready && DirRecordType == ERT_Private) // minimizes multiple evaluation + { + DirRecordType = lookForRecordType(); + if (DirRecordType == ERT_Mrdr) + numberOfReferences = lookForNumberOfReferences(); + } + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::verify(const OFBool autocorrect) +{ + OFCondition err1 = EC_Normal; + OFCondition err2 = EC_Normal; + errorFlag = EC_Normal; + if (autocorrect == OFTrue && DirRecordType != ERT_root) + errorFlag = fillElementsAndReadSOP(getReferencedFileName(), ""); + + err1 = DcmItem::verify(autocorrect); + err2 = lowerLevelList->verify(autocorrect); + if (errorFlag.good() && (err1.bad() || err2.bad())) + errorFlag = EC_CorruptedData; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::search(const DcmTagKey &tag, + DcmStack &resultStack, + E_SearchMode mode, + OFBool searchIntoSub) +{ + OFCondition l_error = DcmItem::search(tag, resultStack, mode, searchIntoSub); + if (l_error.bad()) + { + if (mode != ESM_afterStackTop || resultStack.top() == this) + resultStack.push(lowerLevelList); + l_error = lowerLevelList->search(tag, resultStack, mode, searchIntoSub); + if (l_error.bad()) + resultStack.pop(); + } + return l_error; +} + + +// ******************************** + + +E_DirRecType DcmDirectoryRecord::getRecordType() +{ + return DirRecordType; +} + + +// ******************************** + + +DcmDirectoryRecord* DcmDirectoryRecord::getReferencedMRDR() +{ + return referencedMRDR; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::assignToSOPFile(const char *referencedFileID, + const OFFilename &sourceFileName) +{ + errorFlag = EC_Normal; + + if (DirRecordType != ERT_root) + { + DCMDATA_DEBUG("DcmDirectoryRecord::assignToSOPFile() old Referenced File ID was " + << getReferencedFileName()); + DCMDATA_DEBUG("new Referenced File ID is " << referencedFileID); + + // update against the old reference counter + if (referencedMRDR != NULL) + referencedMRDR->decreaseRefNum(); + referencedMRDR = NULL; + + errorFlag = fillElementsAndReadSOP(referencedFileID, sourceFileName); + } else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::assignToMRDR(DcmDirectoryRecord *mrdr) +{ + errorFlag = EC_Normal; + if (DirRecordType != ERT_root + && mrdr != NULL // new MRDR available + && mrdr != referencedMRDR // old MRDR != new MRDR + ) + { + DCMDATA_DEBUG("DcmDirectoryRecord::assignToMRDR() old Referenced File ID was " + << getReferencedFileName()); + DCMDATA_DEBUG("new Referenced File ID is " << mrdr->lookForReferencedFileID()); + + // set internal pointer to mrdr and update against the old value + if (referencedMRDR != NULL) + referencedMRDR->decreaseRefNum(); + referencedMRDR = mrdr; + + // increase reference counter in referencedMRDR by one + referencedMRDR->increaseRefNum(); + + // set length of Referenced File ID to zero and fill data elements + errorFlag = fillElementsAndReadSOP(NULL, ""); + } else + errorFlag = EC_IllegalCall; + + return errorFlag; +} + + +// ******************************** + + +unsigned long DcmDirectoryRecord::cardSub() const +{ + return lowerLevelList->card(); +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::insertSub(DcmDirectoryRecord *dirRec, + unsigned long where, + OFBool before) +{ + if (dirRec != NULL) + { + if (checkHierarchy(DirRecordType, dirRec->DirRecordType).good()) + errorFlag = lowerLevelList->insert(dirRec, where, before); + else + { + errorFlag = EC_IllegalCall; + DCMDATA_DEBUG("DcmDirectoryRecord::insertSub() dcdirrec: (" + << DRTypeNames[getRecordType()] << " -> " + << DRTypeNames[dirRec->getRecordType()] << ") hierarchy not allowed"); + } + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::insertSubAtCurrentPos(DcmDirectoryRecord *dirRec, + OFBool before) +{ + if (dirRec != NULL) + { + if (checkHierarchy(DirRecordType, dirRec->DirRecordType).good()) + errorFlag = lowerLevelList->insertAtCurrentPos(dirRec, before); + else { + errorFlag = EC_IllegalCall; + DCMDATA_DEBUG("DcmDirectoryRecord::insertSubAtCurrentPos() dcdirrec: (" + << DRTypeNames[getRecordType()] << " -> " << DRTypeNames[dirRec->getRecordType()] + << ") hierarchy not allowed"); + } + } + return errorFlag; +} + + +// ******************************** + + +DcmDirectoryRecord *DcmDirectoryRecord::getSub(const unsigned long num) +{ + DcmDirectoryRecord *retRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->getItem(num)); + errorFlag = lowerLevelList->error(); + return retRec; +} + + +// ******************************** + + +DcmDirectoryRecord *DcmDirectoryRecord::nextSub(const DcmDirectoryRecord *dirRec) +{ + DcmDirectoryRecord *retRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->nextInContainer(dirRec)); + errorFlag = lowerLevelList->error(); + return retRec; +} + + +// ******************************** + + +DcmDirectoryRecord* DcmDirectoryRecord::removeSub(const unsigned long num) +{ + DcmDirectoryRecord *retRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->remove(num)); + errorFlag = lowerLevelList->error(); + return retRec; +} + + +// ******************************** + + +DcmDirectoryRecord* DcmDirectoryRecord::removeSub(DcmDirectoryRecord *dirRec) +{ + DcmDirectoryRecord *retRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->remove(dirRec)); + errorFlag = lowerLevelList->error(); + return retRec; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::deleteSubAndPurgeFile(const unsigned long num) +{ + DcmDirectoryRecord *subDirRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->remove(num)); + errorFlag = lowerLevelList->error(); + if (subDirRec != NULL) + { + DcmDirectoryRecord *localSubRefMRDR = subDirRec->getReferencedMRDR(); + + if (localSubRefMRDR != NULL) + { // file is referenced (indirect) + localSubRefMRDR->decreaseRefNum(); + } else // remove file directly + errorFlag = subDirRec->purgeReferencedFile(); + + DCMDATA_DEBUG("DcmDirectoryRecord::deleteSubAndPurgeFile() now purging lower records:"); + + while (subDirRec->cardSub() > 0) // remove all sub sub records + subDirRec->deleteSubAndPurgeFile(OFstatic_cast(unsigned long, 0)); + delete subDirRec; // remove sub directory record + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmDirectoryRecord::deleteSubAndPurgeFile(DcmDirectoryRecord *dirRec) +{ + DcmDirectoryRecord *subDirRec = OFstatic_cast(DcmDirectoryRecord *, lowerLevelList->remove(dirRec)); + errorFlag = lowerLevelList->error(); + if (subDirRec != NULL) + { + DcmDirectoryRecord *localSubRefMRDR = subDirRec->getReferencedMRDR(); + + if (localSubRefMRDR != NULL) + { // file is referenced (indirect) + localSubRefMRDR->decreaseRefNum(); + } else // remove file directly + errorFlag = subDirRec->purgeReferencedFile(); + + DCMDATA_DEBUG("DcmDirectoryRecord::deleteSubAndPurgeFile() now purging lower records:"); + + while (subDirRec->cardSub() > 0) // remove all sub sub records + subDirRec->deleteSubAndPurgeFile(OFstatic_cast(unsigned long, 0)); + delete subDirRec; // remove sub directory record + } + return errorFlag; +} + + +OFCondition DcmDirectoryRecord::clearSub() +{ + errorFlag = lowerLevelList->clear(); + return errorFlag; +} + + +void DcmDirectoryRecord::setRecordsOriginFile(const OFFilename &fname) +{ + recordsOriginFile = fname; +} + +const OFFilename &DcmDirectoryRecord::getRecordsOriginFile() +{ + return recordsOriginFile; +} diff --git a/dcmdata/libsrc/dcelem.cc b/dcmdata/libsrc/dcelem.cc new file mode 100644 index 00000000..12dcf4c9 --- /dev/null +++ b/dcmdata/libsrc/dcelem.cc @@ -0,0 +1,2314 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmElement + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_NEW +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofdefine.h" + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ +#include "dcmtk/dcmdata/dcfcache.h" /* for class DcmFileCache */ +#include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/vrscan.h" +#include "dcmtk/dcmdata/dcpath.h" + +#define SWAPBUFFER_SIZE 16 /* sufficient for all DICOM VRs as per the 2007 edition */ + +// +// CLASS DcmElement +// + +DcmElement::DcmElement(const DcmTag &tag, + const Uint32 len) + : DcmObject(tag, len), + fByteOrder(gLocalByteOrder), + fLoadValue(NULL), + fValue(NULL) +{ +} + + +DcmElement::DcmElement(const DcmElement &elem) + : DcmObject(elem), + fByteOrder(elem.fByteOrder), + fLoadValue(NULL), + fValue(NULL) +{ + if (elem.fValue) + { + DcmVR vr(elem.getVR()); + const unsigned short pad = (vr.isaString()) ? OFstatic_cast(unsigned short, 1) : OFstatic_cast(unsigned short, 0); + + // The next lines are a special version of newValueField(). + // newValueField() cannot be used because it is virtual and it does + // not allocate enough bytes for strings. The number of pad bytes + // is added to the Length for this purpose. + if (getLengthField() & 1) + { +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + fValue = new (std::nothrow) Uint8[getLengthField() + 1 + pad]; // protocol error: odd value length +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + fValue = new Uint8[getLengthField() + 1 + pad]; // protocol error: odd value length + } + catch (STD_NAMESPACE bad_alloc const &) + { + fValue = NULL; + } +#endif + if (fValue) + fValue[getLengthField()] = 0; + setLengthField(getLengthField() + 1); // make Length even + } + else + { +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + fValue = new (std::nothrow) Uint8[getLengthField() + pad]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + fValue = new Uint8[getLengthField() + pad]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + fValue = NULL; + } +#endif + } + + if (!fValue) + errorFlag = EC_MemoryExhausted; + + if (pad && fValue) + fValue[getLengthField()] = 0; + + if (fValue) + memcpy(fValue, elem.fValue, size_t(getLengthField() + pad)); + } + + if (elem.fLoadValue) + fLoadValue = elem.fLoadValue->clone(); +} + + +DcmElement &DcmElement::operator=(const DcmElement &obj) +{ + if (this != &obj) + { +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + delete fLoadValue; + fLoadValue = NULL; + fValue = NULL; + + DcmObject::operator=(obj); + fByteOrder = obj.fByteOrder; + + if (obj.fValue) + { + DcmVR vr(obj.getVR()); + const unsigned short pad = (vr.isaString()) ? OFstatic_cast(unsigned short, 1) : OFstatic_cast(unsigned short, 0); + + // The next lines are a special version of newValueField(). + // newValueField() cannot be used because it is virtual and it does + // not allocate enough bytes for strings. The number of pad bytes + // is added to the Length for this purpose. + + if (getLengthField() & 1) + { +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + fValue = new (std::nothrow) Uint8[getLengthField() + 1 + pad]; // protocol error: odd value length +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + fValue = new Uint8[getLengthField() + 1 + pad]; // protocol error: odd value length + } + catch (STD_NAMESPACE bad_alloc const &) + { + fValue = NULL; + } +#endif + if (fValue) + fValue[getLengthField()] = 0; + setLengthField(getLengthField() + 1); // make Length even + } + else + { +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + fValue = new (std::nothrow) Uint8[getLengthField() + pad]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + fValue = new Uint8[getLengthField() + pad]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + fValue = NULL; + } +#endif + } + + if (!fValue) + errorFlag = EC_MemoryExhausted; + + if (pad && fValue) + fValue[getLengthField()] = 0; + if (fValue) + memcpy(fValue, obj.fValue, size_t(getLengthField()+pad)); + } + + if (obj.fLoadValue) + fLoadValue = obj.fLoadValue->clone(); + + } + return *this; +} + + +int DcmElement::compare(const DcmElement& rhs) const +{ + if (this == &rhs) + return 0; + + DcmElement* myThis = OFconst_cast(DcmElement*, this); + DcmElement* myRhs = OFconst_cast(DcmElement*, &rhs); + + DcmTagKey thisKey = (*myThis).getTag().getXTag(); + DcmTagKey rhsKey = (*myRhs).getTag().getXTag(); + + if ( thisKey > rhsKey ) + { + return 1; + } + else if (thisKey < rhsKey) + { + return -1; + } + + if ( this->ident() != rhs.ident() ) + return -1; + + return 0; +} + + +OFCondition DcmElement::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmElement &, rhs); + } + return EC_Normal; +} + + +DcmElement::~DcmElement() +{ +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + delete fLoadValue; +} + + +// ******************************** + + +OFCondition DcmElement::clear() +{ + errorFlag = EC_Normal; +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + fValue = NULL; + delete fLoadValue; + fLoadValue = NULL; + setLengthField(0); + return errorFlag; +} + + +OFCondition DcmElement::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + return EC_IllegalCall; +} + + +// ******************************** + + +Uint32 DcmElement::calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + DcmXfer xferSyn(xfer); + DcmEVR vr = getVR(); + + /* These VRs don't use extended length encoding, but when writing, they are + * converted to EVR_UN, which DOES use extended length encoding. + * (EVR_na should never happen here, it's just handled for completeness) + */ + if (vr == EVR_UNKNOWN2B || vr == EVR_na) + vr = EVR_UN; + + /* compute length of element value */ + const Uint32 elemLength = getLength(xfer, enctype); + + /* Create an object that represents this object's "valid" data type */ + DcmVR myvalidvr(vr); + + if ((elemLength) > 0xffff && (! myvalidvr.usesExtendedLengthEncoding()) && xferSyn.isExplicitVR()) + { + /* special case: we are writing in explicit VR, the VR of this + * element uses a 2-byte length encoding, but the element length is + * too large for a 2-byte length field. We need to write this element + * as VR=UN (or VR=OB) and adjust the length calculation accordingly. + * Since UN and OB always have the same header length, we can simply + * assume that we are using UN. + */ + vr = EVR_UN; + } + + /* now compute length of header */ + const Uint32 headerLength = xferSyn.sizeofTagHeader(vr); + + if (OFStandard::check32BitAddOverflow(headerLength, elemLength)) + return DCM_UndefinedLength; + else + return headerLength + elemLength; +} + + +OFBool DcmElement::canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax /*oldXfer*/) +{ + return (newXfer != EXS_Unknown); +} + + +OFCondition DcmElement::detachValueField(OFBool copy) +{ + OFCondition l_error = EC_Normal; + if (getLengthField() != 0) + { + if (copy) + { + if (!fValue) + l_error = loadValue(); + if (l_error.good()) + { + Uint8 * newValue; +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available + newValue = new (std::nothrow) Uint8[getLengthField()]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + newValue = new Uint8[getLengthField()]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + newValue = NULL; + } +#endif + if (newValue) + { + memcpy(newValue, fValue, size_t(getLengthField())); + fValue = newValue; + } else { + /* the copy could not be created, so return an error */ + l_error = EC_MemoryExhausted; + } + } + } else { + fValue = NULL; + setLengthField(0); + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmElement::getUint8(Uint8 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getSint16(Sint16 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getUint16(Uint16 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getSint32(Sint32 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getUint32(Uint32 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getFloat32(Float32 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getSint64(Sint64 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getUint64(Uint64 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getFloat64(Float64 & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getTagVal(DcmTagKey & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getOFString(OFString & /*val*/, + const unsigned long /*pos*/, + OFBool /*normalize*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getString(char * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getString(char * & /*val*/, + Uint32 & /*len*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getOFStringArray(OFString &value, + OFBool normalize) +{ + /* this is a general implementation which is only used when the derived + VR class does not reimplement it + */ + errorFlag = EC_Normal; + const unsigned long count = getVM(); + /* initialize result string */ + value.clear(); + if (count > 0) + { + OFString string; + unsigned long i = 0; + /* reserve number of bytes expected (heuristic) */ + value.reserve(OFstatic_cast(unsigned int, getLength())); + /* iterate over all values and convert them to a character string */ + while ((i < count) && (errorFlag = getOFString(string, i, normalize)).good()) + { + if (i > 0) + value += '\\'; + /* append current value to the result string */ + value += string; + i++; + } + } + return errorFlag; +} + + +OFCondition DcmElement::getUint8Array(Uint8 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getSint16Array(Sint16 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getUint16Array(Uint16 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getSint32Array(Sint32 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getUint32Array(Uint32 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getFloat32Array(Float32 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getSint64Array(Sint64 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getUint64Array(Uint64 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::getFloat64Array(Float64 * & /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +void *DcmElement::getValue(const E_ByteOrder newByteOrder) +{ + /* initialize return value */ + Uint8 * value = NULL; + /* if the byte ordering is unknown, this is an illegal call */ + if (newByteOrder == EBO_unknown) + errorFlag = EC_IllegalCall; + else + { + /* in case this call is not illegal, we need to do something. First of all, set the error flag to ok */ + errorFlag = EC_Normal; + /* do something only if the length of this element's value does not equal (i.e. is greater than) 0 */ + if (getLengthField() != 0) + { + /* if the value has not yet been loaded, do so now */ + if (!fValue) + errorFlag = loadValue(); + /* if everything is ok */ + if (errorFlag.good()) + { + /* if this element's value's byte ordering does not correspond to the */ + /* desired byte ordering, we need to rearrange this value's bytes and */ + /* set its byte order indicator variable correspondingly */ + if (newByteOrder != fByteOrder) + { + swapIfNecessary(newByteOrder, fByteOrder, fValue, + getLengthField(), getTag().getVR().getValueWidth()); + fByteOrder = newByteOrder; + } + /* if everything is ok, assign the current value to the result variable */ + if (errorFlag.good()) + value = fValue; + } + } + } + /* return result */ + return value; +} + + +// ******************************** + + +OFCondition DcmElement::loadAllDataIntoMemory() +{ + errorFlag = EC_Normal; + if (!fValue && (getLengthField() != 0)) + errorFlag = loadValue(); + return errorFlag; +} + + +OFCondition DcmElement::loadValue(DcmInputStream *inStream) +{ + /* initialize return value */ + errorFlag = EC_Normal; + /* only if the length of this element does not equal 0, read information */ + if (getLengthField() != 0) + { + DcmInputStream *readStream = inStream; + OFBool isStreamNew = OFFalse; + + // if the NULL pointer was passed (i.e. we're not in the middle of + // a read() cycle, and fValue is NULL (i.e. the attribute value still + // remains in file and fLoadValue is not NULL (i.e. we know how to + // load the value from that file, then let's do it.. + if (!readStream && fLoadValue && !fValue) + { + /* we need to read information from the stream which is */ + /* accessible through fLoadValue. Hence, reassign readStream */ + readStream = fLoadValue->create(); + + isStreamNew = OFTrue; + + /* reset number of transferred bytes to zero */ + setTransferredBytes(0); + } + /* if we have a stream from which we can read */ + if (readStream) + { + /* check if the stream reported an error */ + errorFlag = readStream->status(); + /* if we encountered the end of the stream, set the error flag correspondingly */ + if (errorFlag.good() && readStream->eos()) + errorFlag = EC_EndOfStream; + /* if we did not encounter the end of the stream and no error occurred so far, go ahead */ + else if (errorFlag.good()) + { + /* if the object which holds this element's value does not yet exist, create it */ + if (!fValue) + fValue = newValueField(); /* also set errorFlag in case of error */ + + /* if object could be created (i.e. we have an object which can be used to capture this element's */ + /* value) we need to read a certain amount of bytes from the stream */ + if (fValue) + { + /* determine how many bytes shall be read from the stream */ + const Uint32 readLength = getLengthField() - getTransferredBytes(); + + /* read a corresponding amount of bytes from the stream, store the information in fValue */ + /* increase the counter that counts how many bytes were actually read */ + incTransferredBytes(OFstatic_cast(Uint32, readStream->read(&fValue[getTransferredBytes()], readLength))); + + /* if we have read all the bytes which make up this element's value */ + if (getLengthField() == getTransferredBytes()) + { + /* call a function which performs certain operations on the information which was read */ + postLoadValue(); + errorFlag = EC_Normal; + } + /* else set the return value correspondingly */ + else if (readStream->eos()) + { + errorFlag = EC_InvalidStream; // premature end of stream + DCMDATA_ERROR("DcmElement: " << getTagName() << " " << getTag() + << " larger (" << getLengthField() << ") than remaining bytes (" + << getTransferredBytes() << ") in file, premature end of stream"); + } + else + errorFlag = EC_StreamNotifyClient; + } + } + /* if we created the stream from which information was read in this */ + /* function, we need to we need to delete this object here as well */ + if (isStreamNew) + delete readStream; + } + } + /* return result value */ + return errorFlag; +} + + +// ******************************** + + +Uint8 *DcmElement::newValueField() +{ + Uint8 * value; + /* if this element's length is odd */ + Uint32 lengthField = getLengthField(); + if (lengthField & 1) + { + if (lengthField == DCM_UndefinedLength) + { + /* Print an error message when private attribute states to have an odd length + * equal to the maximum length, because we are not able then to make this value even (+1) + * which would an overflow on some systems as well as being illegal in DICOM + */ + DCMDATA_ERROR("DcmElement: " << getTagName() << " " << getTag() + << " has odd maximum length (" << DCM_UndefinedLength << ") and therefore is not loaded"); + errorFlag = EC_CorruptedData; + return NULL; + } + /* create an array of Length+1 bytes */ +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + value = new (std::nothrow) Uint8[lengthField + 1]; // protocol error: odd value length +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + value = new Uint8[lengthField + 1]; // protocol error: odd value length + } + catch (STD_NAMESPACE bad_alloc const &) + { + value = NULL; + } +#endif + /* if creation was successful, set last byte to 0 (in order to initialize this byte) */ + /* (no value will be assigned to this byte later, since Length was odd) */ + if (value) + value[lengthField] = 0; + /* enforce old (pre DCMTK 3.5.2) behaviour ? */ + if (!dcmAcceptOddAttributeLength.get()) + { + lengthField++; + setLengthField(lengthField); // make Length even + } + } + /* if this element's length is even, create a corresponding array of Length bytes */ + else +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + value = new (std::nothrow) Uint8[lengthField]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + value = new Uint8[lengthField]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + value = NULL; + } +#endif + /* if creation was not successful set member error flag correspondingly */ + if (!value) + errorFlag = EC_MemoryExhausted; + /* return byte array */ + return value; +} + + +// ******************************** + + +void DcmElement::postLoadValue() +{ + if (dcmEnableAutomaticInputDataCorrection.get()) + { + // newValueField always allocates an even number of bytes + // and sets the pad byte to zero, so we can safely increase Length here + if (getLengthField() & 1) + setLengthField(getLengthField() + 1); // make Length even + } +} + + +// ******************************** + + +OFCondition DcmElement::changeValue(const void *value, + const Uint32 position, + const Uint32 num) +{ + errorFlag = EC_Normal; + // check for invalid parameter values + if (position % num != 0 || getLengthField() % num != 0 || position > getLengthField()) + errorFlag = EC_IllegalCall; + else if (position == getLengthField()) + { + // append value + if (getLengthField() == 0) + { + errorFlag = putValue(value, num); + } else { + // load value (if not loaded yet) + if (!fValue) + errorFlag = loadValue(); + if (errorFlag.good()) + { + Uint8 * newValue; + // allocate new memory for value +#ifdef HAVE_STD__NOTHROW + // we want to use a non-throwing new here if available. + // If the allocation fails, we report an EC_MemoryExhausted error + // back to the caller. + newValue = new (std::nothrow) Uint8[getLengthField() + num]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + newValue = new Uint8[getLengthField() + num]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + newValue = NULL; + } +#endif + if (!newValue) + errorFlag = EC_MemoryExhausted; + if (errorFlag.good()) + { + // swap to local byte order + swapIfNecessary(gLocalByteOrder, fByteOrder, fValue, + getLengthField(), getTag().getVR().getValueWidth()); + fByteOrder = gLocalByteOrder; + // copy old value in the beginning of new value + memcpy(newValue, fValue, size_t(getLengthField())); + // copy value passed as a parameter to the end + memcpy(&newValue[getLengthField()], OFstatic_cast(const Uint8 *, value), size_t(num)); +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + fValue = newValue; + setLengthField(getLengthField() + num); + } else + errorFlag = EC_MemoryExhausted; + } + } + } else { + // load value (if not loaded yet) + if (!fValue) + errorFlag = loadValue(); + if (errorFlag.good()) + { + // swap to local byte order + swapIfNecessary(gLocalByteOrder, fByteOrder, fValue, + getLengthField(), getTag().getVR().getValueWidth()); + // copy value at given position + memcpy(&fValue[position], OFstatic_cast(const Uint8 *, value), size_t(num)); + fByteOrder = gLocalByteOrder; + } + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmElement::putOFStringArray(const OFString &val) +{ + /* sets the value of a complete (possibly multi-valued) string attribute */ + return putString(val.c_str(), OFstatic_cast(Uint32, val.length())); +} + + +OFCondition DcmElement::putString(const char * /*val*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putString(const char * /*val*/, + const Uint32 /*len*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putSint16(const Sint16 /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putUint16(const Uint16 /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putSint32(const Sint32 /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putUint32(const Uint32 /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putFloat32(const Float32 /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putFloat64(const Float64 /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putTagVal(const DcmTagKey & /*val*/, + const unsigned long /*pos*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putUint8Array(const Uint8 * /*val*/, + const unsigned long /*num*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putSint16Array(const Sint16 * /*val*/, + const unsigned long /*num*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putUint16Array(const Uint16 * /*val*/, + const unsigned long /*num*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putSint32Array(const Sint32 * /*val*/, + const unsigned long /*num*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putUint32Array(const Uint32 * /*val*/, + const unsigned long /*num*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putFloat32Array(const Float32 * /*val*/, + const unsigned long /*num*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putFloat64Array(const Float64 * /*val*/, + const unsigned long /*num*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::putValue(const void * newValue, + const Uint32 length) +{ + errorFlag = EC_Normal; + + if (fValue) + { +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + } + fValue = NULL; + + if (fLoadValue) + delete fLoadValue; + fLoadValue = NULL; + + setLengthField(length); + + if (length != 0) + { + fValue = newValueField(); + + // newValueField always allocates an even number of bytes + // and sets the pad byte to zero, so we can safely increase Length here + if (getLengthField() & 1) + setLengthField(getLengthField() + 1); // make Length even + + // copy length (which may be odd), not Length (which is always even) + if (fValue) + memcpy(fValue, newValue, size_t(length)); + else + errorFlag = EC_MemoryExhausted; + } + fByteOrder = gLocalByteOrder; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmElement::createUint8Array(const Uint32 /*numBytes*/, + Uint8 *& /*bytes*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +OFCondition DcmElement::createUint16Array(const Uint32 /*numWords*/, + Uint16 *& /*bytes*/) +{ + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmElement::createEmptyValue(const Uint32 length) +{ + errorFlag = EC_Normal; + if (fValue) + { +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + } + fValue = NULL; + if (fLoadValue) + delete fLoadValue; + fLoadValue = NULL; + setLengthField(length); + + if (length != 0) + { + fValue = newValueField(); + // newValueField always allocates an even number of bytes + // and sets the pad byte to zero, so we can safely increase Length here + if (getLengthField() & 1) + setLengthField(getLengthField() + 1); // make Length even + + // initialize bytes (which may be odd), not Length (which is always even) + if (fValue) + memzero(fValue, size_t(length)); + else + errorFlag = EC_MemoryExhausted; + } + fByteOrder = gLocalByteOrder; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmElement::read(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding /*glenc*/, + const Uint32 maxReadLength) +{ + /* if this element's transfer state shows ERW_notInitialized, this is an illegal call */ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* if this is not an illegal call, go ahead and create a DcmXfer */ + /* object based on the transfer syntax which was passed */ + DcmXfer inXfer(ixfer); + + /* determine the transfer syntax's byte ordering */ + if (getTag() == DCM_PixelData) + fByteOrder = inXfer.getPixelDataByteOrder(); + else fByteOrder = inXfer.getByteOrder(); + + /* check if the stream reported an error */ + errorFlag = inStream.status(); + /* if we encountered the end of the stream, set the error flag correspondingly */ + if (errorFlag.good() && inStream.eos()) + { + errorFlag = EC_EndOfStream; // not handled as parsing error by caller + /* Network can never report EOS at this point, so we are in a file + * and no bytes are left for reading. This is only valid if + * the announced length of the current value is 0 and we are in the + * last element of the dataset (e.g. Pixel Data) otherwise it must be an error */ + if (getLengthField() > 0) + { + /* Return error code if we are are not ignoring parsing errors */ + if (!dcmIgnoreParsingErrors.get()) + errorFlag = EC_StreamNotifyClient; + /* In any case, make sure that calling the load value routine on this + * element will fail later. For that, create the stream factory that + * the load routine will use. Otherwise it would not realize + * that there is a problem */ + delete fLoadValue; + fLoadValue = inStream.newFactory(); + /* Print an error message when too few bytes are available in the file in order to + * distinguish this problem from any other generic "InvalidStream" problem. */ + DCMDATA_ERROR("DcmElement: " << getTagName() << " " << getTag() + << " larger (" << getLengthField() << ") than remaining bytes in file"); + } + } + /* if we did not encounter the end of the stream and no error occurred so far, go ahead */ + else if (errorFlag.good()) + { + /* if the transfer state is ERW_init, we need to prepare */ + /* the reading of this element's value from the stream */ + if (getTransferState() == ERW_init) + { + /* if the Length of this element's value is greater than the amount of bytes we */ + /* can read from the stream and if the stream has random access, we want to create */ + /* a DcmInputStreamFactory object that enables us to read this element's value later. */ + /* This new object will be stored (together with the position where we have to start */ + /* reading the value) in the member variable fLoadValue. */ + if (getLengthField() > maxReadLength) + { + /* try to create a stream factory to read the value later */ + delete fLoadValue; + fLoadValue = inStream.newFactory(); + + if (fLoadValue) + { + offile_off_t skipped = inStream.skip(getLengthField()); + if (skipped < OFstatic_cast(offile_off_t, getLengthField())) + { + /* If desired, specific parser errors will be ignored */ + if (dcmIgnoreParsingErrors.get()) + errorFlag = EC_Normal; + else + errorFlag = EC_StreamNotifyClient; + /* Print an error message when too few bytes are available in the file in order to + * distinguish this problem from any other generic "InvalidStream" problem. */ + DCMDATA_ERROR("DcmElement: " << getTagName() << " " << getTag() + << " larger (" << getLengthField() << ") than remaining bytes in file"); + } + } + } + /* if there is already a value for this element, delete this value */ +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + /* set the transfer state to ERW_inWork */ + setTransferState(ERW_inWork); + } + /* if the transfer state is ERW_inWork and we are not supposed */ + /* to read this element's value later, read the value now */ + if (getTransferState() == ERW_inWork && !fLoadValue) + errorFlag = loadValue(&inStream); + /* if the amount of transferred bytes equals the Length of this element */ + /* or the object which contains information to read the value of this */ + /* element later is existent, set the transfer state to ERW_ready */ + if (getTransferredBytes() == getLengthField() || fLoadValue) + setTransferState(ERW_ready); + } + } + + /* return result value */ + return errorFlag; +} + + +// ******************************** + + +void DcmElement::swapValueField(size_t valueWidth) +{ + if (getLengthField() != 0) + { + if (!fValue) + errorFlag = loadValue(); + + if (errorFlag.good()) + swapBytes(fValue, getLengthField(), valueWidth); + } +} + + +// ******************************** + + +void DcmElement::transferInit() +{ + DcmObject::transferInit(); + setTransferredBytes(0); +} + + +// ******************************** + +OFCondition DcmElement::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + DcmWriteCache wcache2; + + /* Create an object that represents this object's data type */ + DcmVR myvr(getVR()); + + /* create an object that represents the transfer syntax */ + DcmXfer outXfer(oxfer); + + /* getValidEVR() will convert post 1993 VRs to "OB" if these are disabled */ + DcmEVR vr = myvr.getValidEVR(); + + /* compute length of element value */ + const Uint32 elemLength = getLength(oxfer, enctype); + + /* Create an object that represents this object's "valid" data type */ + DcmVR myvalidvr(vr); + + if ((elemLength) > 0xffff && (! myvalidvr.usesExtendedLengthEncoding()) && outXfer.isExplicitVR()) + { + /* special case: we are writing in explicit VR, the VR of this + * element uses a 2-byte length encoding, but the element length is + * too large for a 2-byte length field. We need to write this element + * as VR=UN (or VR=OB if the generation of UN is disabled). + * In this method, the variable "vr" is only used to determine the + * output byte order, which is always the same for OB and UN. + * Therefore, we do not need to distinguish between these two. + */ + vr = EVR_UN; + } + + /* In case the transfer state is not initialized, this is an illegal call */ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* if this is not an illegal call, we need to do something. First */ + /* of all, check the error state of the stream that was passed */ + /* only do something if the error state of the stream is ok */ + errorFlag = outStream.status(); + if (errorFlag.good()) + { + E_ByteOrder outByteOrder; + + /* determine the transfer syntax's byte ordering for this element */ + if (getTag() == DCM_PixelData) + outByteOrder = outXfer.getPixelDataByteOrder(); + else outByteOrder = outXfer.getByteOrder(); + + /* UN and OB element content always needs to be written in little endian. + We need to set this manually for the case that we are converting + elements to UN or OB while writing because some post-1993 VRs are disabled */ + if ((vr == EVR_OB) || (vr == EVR_UN)) outByteOrder = EBO_LittleEndian; + + /* pointer to element value if value resides in memory or old-style + * write behaviour is active (i.e. everything loaded into memory upon write) + */ + Uint8 *value = NULL; + OFBool accessPossible = OFFalse; + + /* check that we actually do have access to the element's value. + * If the element is unaccessible (which would mean that the value resides + * in file and access to the file fails), write an empty element with + * zero length. + */ + if (getLengthField() > 0) + { + if (valueLoaded()) + { + /* get this element's value. Mind the byte ordering (little */ + /* or big endian) of the transfer syntax which shall be used */ + value = OFstatic_cast(Uint8 *, getValue(outByteOrder)); + if (value) accessPossible = OFTrue; + } + else + { + /* Use local cache object if needed. This may cause those bytes + * that are read but not written because the output stream stalls to + * be read again, and the file from being re-opened next time. + * Therefore, this case should be avoided. + */ + if (!wcache) wcache = &wcache2; + + /* initialize cache object. This is safe even if the object was already initialized */ + wcache->init(this, getLengthField(), getTransferredBytes(), outByteOrder); + + /* access first block of element content */ + errorFlag = wcache->fillBuffer(*this); + + /* check that everything worked and the buffer is non-empty now */ + accessPossible = errorFlag.good() && (! wcache->bufferIsEmpty()); + } + } + + /* if this element's transfer state is ERW_init (i.e. it has not yet been written to */ + /* the stream) and if the outstream provides enough space for tag and length information */ + /* write tag and length information to it, do something */ + if (getTransferState() == ERW_init) + { + /* first compare with DCM_TagInfoLength (12). If there is not enough space + * in the buffer, check if the buffer is still sufficient for the requirements + * of this element, which may need only 8 instead of 12 bytes. + */ + if ((outStream.avail() >= OFstatic_cast(offile_off_t, DCM_TagInfoLength)) || + (outStream.avail() >= OFstatic_cast(offile_off_t, getTagAndLengthSize(oxfer)))) + { + /* if there is no value, Length (member variable) shall be set to 0 */ + if (! accessPossible) setLengthField(0); + + /* remember how many bytes have been written to the stream, currently none so far */ + Uint32 writtenBytes = 0; + + /* write tag and length information (and possibly also data type information) to the stream, */ + /* mind the transfer syntax and remember the amount of bytes that have been written */ + errorFlag = writeTagAndLength(outStream, oxfer, writtenBytes); + + /* if the writing was successful, set this element's transfer */ + /* state to ERW_inWork and the amount of transferred bytes to 0 */ + if (errorFlag.good()) + { + setTransferState(ERW_inWork); + setTransferredBytes(0); + } + } else errorFlag = EC_StreamNotifyClient; + } + + /* if there is a value that has to be written to the stream */ + /* and if this element's transfer state is ERW_inWork */ + if (accessPossible && getTransferState() == ERW_inWork) + { + Uint32 len = 0; + if (valueLoaded()) + { + /* write as many bytes as possible to the stream starting at value[getTransferredBytes()] */ + /* (note that the bytes value[0] to value[getTransferredBytes()-1] have already been */ + /* written to the stream) */ + len = OFstatic_cast(Uint32, outStream.write(&value[getTransferredBytes()], getLengthField() - getTransferredBytes())); + + /* increase the amount of bytes which have been transfered correspondingly */ + incTransferredBytes(len); + + /* see if there is something fishy with the stream */ + errorFlag = outStream.status(); + } + else + { + Uint32 buflen = 0; + OFBool done = getTransferredBytes() == getLengthField(); + while (! done) + { + // re-fill buffer from file if empty + errorFlag = wcache->fillBuffer(*this); + buflen = wcache->contentLength(); + + if (errorFlag.good()) + { + // write as many bytes from cache buffer to stream as possible + len = wcache->writeBuffer(outStream); + + /* increase the amount of bytes which have been transfered correspondingly */ + incTransferredBytes(len); + + /* see if there is something fishy with the stream */ + errorFlag = outStream.status(); + } + + // stop writing if something went wrong, we were unable to send all of the buffer content + // (which indicates that the output stream needs to be flushed, or everything was sent out. + done = errorFlag.bad() || (len < buflen) || (getTransferredBytes() == getLengthField()); + } + } + + /* if the amount of transferred bytes equals the length of the element's value, the */ + /* entire value has been written to the stream. Thus, this element's transfer state */ + /* has to be set to ERW_ready. If this is not the case but the error flag still shows */ + /* an ok value, there was no more space in the stream and a corresponding return value */ + /* has to be set. (Isn't the "else if" part superfluous?!?) */ + if (getLengthField() == getTransferredBytes()) setTransferState(ERW_ready); + else if (errorFlag.good()) errorFlag = EC_StreamNotifyClient; + + } + } + } + /* return result value */ + return errorFlag; +} + + +OFCondition DcmElement::writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + // for normal DICOM elements (everything except sequences), the data + // stream used for digital signature creation or verification is + // identical to the stream used for network communication or media + // storage. + return write(outStream, oxfer, enctype, wcache); +} + + +// ******************************** + + +void DcmElement::writeXMLStartTag(STD_NAMESPACE ostream &out, + const size_t flags, + const char *attrText) +{ + OFString xmlString; + DcmVR vr(getTag().getVR()); + DcmTag tag = getTag(); + const OFBool isPrivate = tag.isPrivate(); + + /* write XML start tag for attribute */ + if (flags & DCMTypes::XF_useNativeModel) + { + out << "" << OFendl; + } else { + /* value multiplicity = 1..n */ + out << " vm=\"" << getVM() << "\""; + /* value length in bytes = 0..max */ + out << " len=\"" << getLengthField() << "\""; + /* tag name (if known and not suppressed) */ + if (!(flags & DCMTypes::XF_omitDataElementName)) + out << " name=\"" << OFStandard::convertToMarkupString(getTagName(), xmlString) << "\""; + /* value loaded = no (or absent)*/ + if (!valueLoaded()) + out << " loaded=\"no\""; + /* write additional attributes (if any) */ + if ((attrText != NULL) && (attrText[0] != '\0')) + out << " " << attrText; + /* close XML start tag */ + out << ">"; + } +} + + +void DcmElement::writeXMLEndTag(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* write standardized XML end tag for all element types */ + if (flags & DCMTypes::XF_useNativeModel) + out << "" << OFendl; + else + out << "" << OFendl; +} + + +OFCondition DcmElement::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* do not output group length elements in Native DICOM Model + * (as per PS 3.19 section A.1.1, introduced with Supplement 166) */ + if (!(flags & DCMTypes::XF_useNativeModel) || !getTag().isGroupLength()) + { + /* write XML start tag */ + writeXMLStartTag(out, flags); + OFString value; + const OFBool convertNonASCII = (flags & DCMTypes::XF_convertNonASCII) > 0; + if (flags & DCMTypes::XF_useNativeModel) + { + /* write element value (if non-empty) */ + if (!isEmpty()) + { + const unsigned long vm = getVM(); + for (unsigned long valNo = 0; valNo < vm; valNo++) + { + if (getOFString(value, valNo).good()) + { + out << ""; + /* check whether conversion to XML markup string is required */ + if (OFStandard::checkForMarkupConversion(value, convertNonASCII)) + OFStandard::convertToMarkupStream(out, value, convertNonASCII); + else + out << value; + out << "" << OFendl; + } + } + } + } else { + /* write element value (only if loaded) */ + if (valueLoaded()) + { + if (getOFStringArray(value).good()) + { + /* check whether conversion to XML markup string is required */ + if (OFStandard::checkForMarkupConversion(value, convertNonASCII)) + OFStandard::convertToMarkupStream(out, value, convertNonASCII); + else + out << value; + } + } + } + /* write XML end tag */ + writeXMLEndTag(out, flags); + } + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +void DcmElement::writeJsonOpener(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + DcmVR vr(getTag().getVR()); + DcmTag tag = getTag(); + /* increase indention level */ + /* write attribute tag */ + out << ++format.indent() << "\"" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(4) << tag.getGTag(); + /* write "ggggeeee" (no comma, upper case!) */ + /* for private element numbers, zero out 2 first element digits */ + /* or output full element number "eeee" */ + out << STD_NAMESPACE setw(4) << STD_NAMESPACE uppercase << tag.getETag() << "\":" + << format.space() << "{" << STD_NAMESPACE dec << STD_NAMESPACE setfill(' '); + out << STD_NAMESPACE nouppercase; + /* increase indention level */ + /* value representation = VR */ + out << format.newline() << ++format.indent() << "\"vr\":" << format.space() << "\"" + << vr.getValidVRName() << "\""; +} + + +void DcmElement::writeJsonCloser(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* output JSON ending and decrease indention level */ + out << format.newline() << --format.indent() << "}"; + --format.indent(); +} + + +OFCondition DcmElement::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + writeJsonOpener(out, format); + /* write element value (if non-empty) */ + if (!isEmpty()) + { + OFString value; + if (format.asBulkDataURI(getTag(), value)) + { + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, value); + } + else + { + OFCondition status = getOFString(value, 0L); + if (status.bad()) + return status; + format.printValuePrefix(out); + DcmJsonFormat::printNumberDecimal(out, value); + const unsigned long vm = getVM(); + for (unsigned long valNo = 1; valNo < vm; ++valNo) + { + status = getOFString(value, valNo); + if (status.bad()) + return status; + format.printNextArrayElementPrefix(out); + DcmJsonFormat::printNumberDecimal(out, value); + } + format.printValueSuffix(out); + } + } + /* write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmElement::getPartialValue(void *targetBuffer, + const Uint32 offset, + Uint32 numBytes, + DcmFileCache *cache, + E_ByteOrder byteOrder) +{ + // check integrity of parameters passed to this method + if (targetBuffer == NULL) return EC_IllegalCall; + + // if the user has only requested zero bytes, we immediately return + if (numBytes == 0) return EC_Normal; + + // offset must always be less than attribute length (unless offset, + // attribute length and numBytes are all zero, a case that was + // handled above). + if (offset >= getLengthField()) return EC_InvalidOffset; + + // check if the caller is trying to read past the end of the value field + if (numBytes > (getLengthField() - offset)) return EC_TooManyBytesRequested; + + // check if the value is already in memory + if (valueLoaded()) + { + // the attribute value is already in memory. + // change internal byte order of the attribute value to the desired byte order. + // This should only happen once for multiple calls to this method since the + // caller will hopefully always request the same byte order. + char *value = OFstatic_cast(char *, getValue(byteOrder)); + if (value) + { + memcpy(targetBuffer, value + offset, numBytes); + } + else + { + // this should never happen because valueLoaded() returned true, but + // we don't want to dereference a NULL pointer anyway + return EC_IllegalCall; + } + } + else + { + // the value is not in memory. We should directly read from file and + // also consider byte order. + + // since the value is not in memory, fLoadValue should exist. Check anyway. + if (! fLoadValue) return EC_IllegalCall; + + // make sure we have a file cache object + DcmFileCache defaultcache; // automatic object, creation is cheap. + if (cache == NULL) cache = &defaultcache; + + // the stream from which we will read the attribute value + DcmInputStream *readStream = NULL; + + // check if we need to seek to a position in file earlier than + // the one specified by the user in order to correctly swap according + // to the VR. + size_t valueWidth = getTag().getVR().getValueWidth(); + + // we need to cast the target buffer to something we can increment bytewise + char *targetBufferChar = OFreinterpret_cast(char *, targetBuffer); + + // the swap buffer should be large enough to keep one value of the current VR + unsigned char swapBuffer[SWAPBUFFER_SIZE]; + if (valueWidth > SWAPBUFFER_SIZE) return EC_IllegalCall; + + // seekoffset is the number of bytes we need to skip from the beginning of the + // value field to the point where we will start reading. This is always at the + // start of a new value of a multi-valued attribute. + Uint32 partialvalue = 0; + const Uint32 partialoffset = OFstatic_cast(Uint32, offset % valueWidth); + const offile_off_t seekoffset = offset - partialoffset; + + // check if cache already contains the stream we're looking for + if (cache->isUser(this)) + { + readStream = cache->getStream(); + + // since we cannot seek back in the stream (only forward), check if the stream + // is already past our needed start position + if (readStream->tell() - cache->getOffset() > seekoffset) + { + readStream = NULL; + } + } + + // initialize the cache with new stream + if (!readStream) + { + readStream = fLoadValue->create(); + + // check that read stream is non-NULL + if (readStream == NULL) return EC_InvalidStream; + + // check that stream status is OK + if (readStream->status().bad()) return readStream->status(); + + cache->init(readStream, this); + } + + // now skip bytes from our current position in file to where we + // want to start reading. + offile_off_t remainingBytesToSkip = seekoffset - (readStream->tell() - cache->getOffset()); + offile_off_t skipResult; + + while (remainingBytesToSkip) + { + skipResult = readStream->skip(remainingBytesToSkip); + if (skipResult == 0) return EC_InvalidStream; // error while skipping + remainingBytesToSkip -= skipResult; + } + + // check if the first few bytes we want to read are "in the middle" of one value + // of a multi-valued attribute. In that case we need to read the complete value, + // swap it and then copy only the last bytes in desired byte order. + if (partialoffset > 0) + { + // we possibly want to reset the stream to this point later + readStream->mark(); + + // compute the number of bytes we need to copy from the first attributes + partialvalue = OFstatic_cast(Uint32, valueWidth - partialoffset); + + // we need to read a single data element into the swap buffer + if (valueWidth != OFstatic_cast(size_t, readStream->read(swapBuffer, valueWidth))) + return EC_InvalidStream; + + // swap to desired byte order. fByteOrder contains the byte order in file. + swapIfNecessary(byteOrder, fByteOrder, swapBuffer, OFstatic_cast(Uint32, valueWidth), valueWidth); + + // copy to target buffer and adjust values + if (partialvalue > numBytes) + { + memcpy(targetBufferChar, &swapBuffer[partialoffset], numBytes); + targetBufferChar += numBytes; + numBytes = 0; + + // Reset stream to position marked before, since we have not copied the complete value + readStream->putback(); + } + else + { + memcpy(targetBufferChar, &swapBuffer[partialoffset], partialvalue); + targetBufferChar += partialvalue; + numBytes -= partialvalue; + } + } + + // now read the main block of data directly into the target buffer + partialvalue = OFstatic_cast(Uint32, numBytes % valueWidth); + const Uint32 bytesToRead = numBytes - partialvalue; + + if (bytesToRead > 0) + { + // here we read the main block of data + if (OFstatic_cast(offile_off_t, bytesToRead) != readStream->read(targetBufferChar, bytesToRead)) + return EC_InvalidStream; + + // swap to desired byte order. fByteOrder contains the byte order in file. + swapIfNecessary(byteOrder, fByteOrder, targetBufferChar, bytesToRead, valueWidth); + + // adjust pointer to target buffer + targetBufferChar += bytesToRead; + } + + // check if the last few bytes we want to read are only a partial value. + // In that case we need to read the complete value, swap it and then copy + // only the first few bytes in desired byte order. + if (partialvalue > 0) + { + OFBool appendDuplicateByte = OFFalse; + size_t partialBytesToRead = valueWidth; + + // we want to reset the stream to this point later + readStream->mark(); + + if (readStream->tell() + valueWidth > getLengthField()) { + // We are trying to read past the end of the value. We already made sure + // above that the requested range fits completely into the element's + // size, so this must mean that the length is not a multiple of the VR's + // value width. + // We allow this for OW and error out on all other VRs. + if (getTag().getVR().getValidEVR() == EVR_OW) + { + DCMDATA_WARN("DcmElement: Trying to read past end of value, duplicating last byte"); + appendDuplicateByte = OFTrue; + // This is 2 for OW, but we know that only 1 byte of data is available + partialBytesToRead--; + } + else + { + // This would read the beginning of the next element from the stream, + // possibly hitting the end of stream. + DCMDATA_ERROR("DcmElement: Trying to read past end of value"); + return EC_InvalidStream; + } + } + + // we need to read a single data element into the swap buffer + if (partialBytesToRead != OFstatic_cast(size_t, readStream->read(swapBuffer, partialBytesToRead))) + return EC_InvalidStream; + + if (appendDuplicateByte) + swapBuffer[partialBytesToRead] = swapBuffer[partialBytesToRead - 1]; + + // swap to desired byte order. fByteOrder contains the byte order in file. + swapIfNecessary(byteOrder, fByteOrder, swapBuffer, OFstatic_cast(Uint32, valueWidth), valueWidth); + + // copy to target buffer and adjust values + memcpy(targetBufferChar, swapBuffer, partialvalue); + + // finally reset stream to position marked before + readStream->putback(); + } + } + + // done. + return EC_Normal; +} + + +void DcmElement::compact() +{ + if (fLoadValue && fValue) + { + DCMDATA_DEBUG("DcmElement::compact() removed element value of " << getTag() + << " with " << getTransferredBytes() << " bytes"); + delete[] fValue; + fValue = NULL; + setTransferredBytes(0); + } +} + + +OFCondition DcmElement::createValueFromTempFile(DcmInputStreamFactory *factory, + const Uint32 length, + const E_ByteOrder byteOrder) +{ + if (factory && !(length & 1)) + { +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + // if created with the nothrow version it must also be deleted with + // the nothrow version else memory error. + operator delete[] (fValue, std::nothrow); +#else + delete[] fValue; +#endif + fValue = 0; + delete fLoadValue; + fLoadValue = factory; + fByteOrder = byteOrder; + setLengthField(length); + return EC_Normal; + } + else return EC_IllegalCall; +} + + +// the following macro makes the source code more readable and easier to maintain + +#define GET_AND_CHECK_UINT16_VALUE(tag, variable) \ + result = dataset->findAndGetUint16(tag, variable); \ + if (result == EC_TagNotFound) \ + { \ + DCMDATA_WARN("DcmElement: Mandatory element " << DcmTag(tag).getTagName() << " " << tag << " is missing"); \ + result = EC_MissingAttribute; \ + } \ + else if ((result == EC_IllegalCall) || (result == EC_IllegalParameter)) \ + { \ + DCMDATA_WARN("DcmElement: No value for mandatory element " << DcmTag(tag).getTagName() << " " << tag); \ + result = EC_MissingValue; \ + } \ + else if (result.bad()) \ + DCMDATA_WARN("DcmElement: Cannot retrieve value of element " << DcmTag(tag).getTagName() << " " << tag << ": " << result.text()); + + +OFCondition DcmElement::getUncompressedFrameSize(DcmItem *dataset, + Uint32 &frameSize) const +{ + OFCondition result = EC_IllegalParameter; + if (dataset != NULL) + { + Uint16 rows = 0; + Uint16 cols = 0; + Uint16 samplesPerPixel = 0; + Uint16 bitsAllocated = 0; + /* retrieve values from dataset (and check them for validity and plausibility) */ + GET_AND_CHECK_UINT16_VALUE(DCM_Columns, cols) + else if (cols == 0) + DCMDATA_WARN("DcmElement: Dubious value (" << cols << ") for element Columns " << DCM_Columns); + if (result.good()) + { + GET_AND_CHECK_UINT16_VALUE(DCM_Rows, rows) + else if (rows == 0) + DCMDATA_WARN("DcmElement: Dubious value (" << rows << ") for element Rows " << DCM_Rows); + } + if (result.good()) + { + GET_AND_CHECK_UINT16_VALUE(DCM_SamplesPerPixel, samplesPerPixel) + else /* result.good() */ + { + /* also need to check value of PhotometricInterpretation */ + OFString photometricInterpretation; + if (dataset->findAndGetOFStringArray(DCM_PhotometricInterpretation, photometricInterpretation).good()) + { + if (photometricInterpretation.empty()) + DCMDATA_WARN("DcmElement: No value for mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation); + else { + const OFBool isMono = (photometricInterpretation == "MONOCHROME1") || + (photometricInterpretation == "MONOCHROME2"); + const OFBool isColor1 = (photometricInterpretation == "PALETTE COLOR"); + const OFBool isColor3 = (photometricInterpretation == "RGB") || + (photometricInterpretation == "HSV" /* retired */) || + (photometricInterpretation == "YBR_FULL") || + (photometricInterpretation == "YBR_FULL_422") || + (photometricInterpretation == "YBR_PARTIAL_422" /* retired */) || + (photometricInterpretation == "YBR_PARTIAL_420") || + (photometricInterpretation == "YBR_ICT") || + (photometricInterpretation == "YBR_RCT"); + const OFBool isColor4 = (photometricInterpretation == "ARGB" /* retired */) || + (photometricInterpretation == "CMYK" /* retired */); + if (((isMono || isColor1) && (samplesPerPixel != 1)) || (isColor3 && (samplesPerPixel != 3)) || (isColor4 && (samplesPerPixel != 4))) + + { + DCMDATA_WARN("DcmElement: Invalid value (" << samplesPerPixel << ") for element SamplesPerPixel " << DCM_SamplesPerPixel + << " when PhotometricInterpretation " << DCM_PhotometricInterpretation << " is " << photometricInterpretation); + result = EC_InvalidValue; + } + else if (!isMono && !isColor1 && !isColor3 && !isColor4) + DCMDATA_WARN("DcmElement: Unsupported value (" << photometricInterpretation << ") for element PhotometricInterpretation " << DCM_PhotometricInterpretation); + } + } + if (result.good() && (samplesPerPixel != 1) && (samplesPerPixel != 3)) + DCMDATA_WARN("DcmElement: Dubious value (" << samplesPerPixel << ") for element SamplesPerPixel " << DCM_SamplesPerPixel); + } + } + if (result.good()) + { + GET_AND_CHECK_UINT16_VALUE(DCM_BitsAllocated, bitsAllocated) + /* see PS3.3 Table C.7-11c: "Bits Allocated (0028,0100) shall be either 1, or a multiple of 8." */ + else if ((bitsAllocated == 0) || ((bitsAllocated > 1) && (bitsAllocated % 8 != 0))) + DCMDATA_WARN("DcmElement: Dubious value (" << bitsAllocated << ") for element BitsAllocated " << DCM_BitsAllocated); + } + /* if all checks were passed... */ + if (result.good()) + { + /* compute frame size (TODO: check for 32-bit integer overflow?) */ + if ((bitsAllocated % 8) == 0) + { + const Uint16 bytesAllocated = bitsAllocated / 8; + frameSize = bytesAllocated * rows * cols * samplesPerPixel; + } + else + { + /* need to split calculation in order to avoid integer overflow for large pixel data */ + const Uint32 v1 = rows * cols * samplesPerPixel; + const Uint32 v2 = (bitsAllocated / 8) * v1; + const Uint32 v3 = ((bitsAllocated % 8) * v1 + 7) / 8; + // # old code: frameSize = (bitsAllocated * rows * cols * samplesPerPixel + 7) / 8; + frameSize = v2 + v3; + } + } else { + /* in case of error, return a frame size of 0 */ + frameSize = 0; + } + } + return result; +} + + +OFCondition DcmElement::getUncompressedFrame(DcmItem * /* dataset */ , + Uint32 /* frameNo */ , + Uint32& /* startFragment */ , + void * /* buffer */ , + Uint32 /* bufSize */ , + OFString& /* decompressedColorModel */ , + DcmFileCache * /* cache */ ) +{ + return EC_IllegalCall; +} + + +OFCondition DcmElement::getDecompressedColorModel(DcmItem * /* dataset */, + OFString & /* decompressedColorModel */) +{ + return EC_IllegalCall; +} + + +// ******************************** + + +int DcmElement::scanValue(const OFString &value, + const OFString &vr, + const size_t pos, + const size_t num) +{ + return scanValue(vr, value.data() + pos, num != OFString_npos ? num : value.size() - pos); +} + + +int DcmElement::scanValue(const OFString& vr, + const char* const value, + const size_t size) +{ + return vrscan::scan(vr, value, size); +} + + +unsigned long DcmElement::determineVM(const char *str, + const size_t len) +{ + unsigned long vm = 0; + // check for non-empty string + if ((str != NULL) && (len > 0)) + { + // count number of delimiters (plus 1) + vm = 1; + const char *p = str; + for (size_t i = 0; i < len; i++) + { + if (*p++ == '\\') + vm++; + } + } + return vm; +} + + +size_t DcmElement::getValueFromString(const char *str, + const size_t pos, + const size_t len, + OFString &val) +{ + size_t newPos = pos; + // check for non-empty string or invalid start position + if ((str != NULL) && (len > 0) && (pos < len)) + { + // start at given position + const char *p = str + pos; + // search for next backslash (if any) + while ((newPos++ < len) && (*p != '\\')) + p++; + // extract selected value from string + val.assign(str + pos, newPos - pos - 1); + } else + val.clear(); + return newPos; +} + + +OFCondition DcmElement::checkVM(const unsigned long vmNum, + const OFString &vmStr) +{ + OFCondition result = EC_Normal; + // only check non-empty values + if (vmNum > 0) + { + if (vmStr == "1") + { + if (vmNum != 1) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "1-2") + { + if (vmNum > 2) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "1-3") + { + if (vmNum > 3) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "1-8") + { + if (vmNum > 8) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "1-99") + { + if (vmNum > 99) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "2") + { + if (vmNum != 2) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "2-n") + { + if (vmNum < 2) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "2-2n") + { + if ((vmNum % 2) != 0) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "3") + { + if (vmNum != 3) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "3-n") + { + if (vmNum < 3) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "3-3n") + { + if ((vmNum % 3) != 0) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "4") + { + if (vmNum != 4) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "5") + { + if (vmNum != 5) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "5-n") + { + if (vmNum < 5) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "6") + { + if (vmNum != 6) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "7") + { + if (vmNum != 7) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "7-7n") + { + if ((vmNum % 7) != 0) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "8") + { + if (vmNum != 8) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "9") + { + if (vmNum != 9) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "16") + { + if (vmNum != 16) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "24") + { + if (vmNum != 24) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "32") + { + if (vmNum != 32) result = EC_ValueMultiplicityViolated; + } + else if (vmStr == "256") + { + if (vmNum != 256) result = EC_ValueMultiplicityViolated; + } + else if ((vmStr != "1-n") && (vmStr != "0-n")) + { + // given value of 'vmStr' not (yet) supported + result = EC_IllegalParameter; + } + } + return result; +} + + +OFBool DcmElement::isUniversalMatch(const OFBool normalize, + const OFBool enableWildCardMatching) +{ + OFstatic_cast(void,enableWildCardMatching); + return isEmpty(normalize); +} + +OFBool DcmElement::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,candidate); + OFstatic_cast(void,enableWildCardMatching); + return OFFalse; +} + + +OFBool DcmElement::combinationMatches(const DcmElement& keySecond, + const DcmElement& candidateFirst, + const DcmElement& candidateSecond) const +{ + OFstatic_cast(void,keySecond); + OFstatic_cast(void,candidateFirst); + OFstatic_cast(void,candidateSecond); + return OFFalse; +} diff --git a/dcmdata/libsrc/dcencdoc.cc b/dcmdata/libsrc/dcencdoc.cc new file mode 100644 index 00000000..d83430dc --- /dev/null +++ b/dcmdata/libsrc/dcencdoc.cc @@ -0,0 +1,1437 @@ +/* + * + * Copyright (C) 2018-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Pedro Arizpe + * + * Purpose: Implementation of Document encapsulation + * + */ + +//make sure OS specific configuration is included first +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcencdoc.h" + +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofxml.h" +#include "dcmtk/ofstd/oftypes.h" + +#include "dcmtk/dcmdata/dcpath.h" +#include "dcmtk/dcmdata/dccodec.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcvrpobw.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" + +#define SHORTCOL 3 +#define LONGCOL 21 + +// exit codes for this command line tool +// (common codes are defined in "ofexit.h" included from "ofconapp.h") + +// general errors +#define EXITCODE_MEMORY_EXHAUSTED 4 + +DcmEncapsulatedDocument::DcmEncapsulatedDocument() : + opt_patientBirthdate(), + opt_patientID(), + opt_patientName(), + opt_patientSex(), + + opt_conceptCM(), + opt_conceptCSD(), + opt_conceptCV(), + + opt_documentTitle(), + opt_seriesFile(), + opt_seriesUID(), + opt_studyUID(), + + opt_oenctype(EET_ExplicitLength), + opt_writeMode(EWM_fileformat), + opt_oglenc(EGL_withoutGL), + opt_opadenc(EPD_withoutPadding), + opt_oxfer(EXS_LittleEndianExplicit), + opt_filepad(0), + opt_itempad(0), + + opt_readSeriesInfo(OFFalse), + opt_annotation(OFTrue), + opt_increment(OFFalse), + + opt_instance(1), + opt_overrideKeys(), + + cda_mediaTypes(), + hl7_InstanceIdentifier(), + opt_override(OFFalse), + // Frame of Reference Module (STL) + opt_frameOfReferenceUID(), + opt_positionReferenceIndicator(), + // Frame of Reference Module (STL) + opt_manufacturer(), + opt_manufacturerModelName(), + opt_deviceSerialNumber(), + opt_softwareVersions(), + // Enhanced General Equipment Module (STL) + opt_measurementUnitsCM(), + opt_measurementUnitsCSD(), + opt_measurementUnitsCV(), + //encapsulation file type + ftype() +{ +} + +OFBool DcmEncapsulatedDocument::XMLsearchAttribute( + XMLNode currnode, + OFList *results, + OFString attr) +{ + OFBool found = OFFalse; +#ifndef _XMLWIDECHAR + if (currnode.nChildNode() == 0) + { + //"currnode has no children (leaf)"; + if (currnode.isAttributeSet(attr.c_str())) + { + //attribute found on leaf + results->push_back(OFSTRING_GUARD(currnode.getAttribute(attr.c_str()))); + found = OFTrue; + } + } + else + { + //"currnode has children (branch)"; + if (currnode.isAttributeSet(attr.c_str())) + { + //attribute found on branch + results->push_back(OFSTRING_GUARD(currnode.getAttribute(attr.c_str()))); + found = OFTrue; + } + for (int i = 0; i < currnode.nChildNode(); i++) + { + //search all children recursively + OFBool childfound = XMLsearchAttribute(currnode.getChildNode(i), results, attr); + found |= childfound; + } + } +#endif + return found; +} + +OFString DcmEncapsulatedDocument::XMLgetAllAttributeValues( + XMLNode fileNode, + OFString attr) +{ + OFString attributeValues; +#ifndef _XMLWIDECHAR + OFList attributeValueslist; + if (XMLsearchAttribute(fileNode, &attributeValueslist, attr)) + { + //If the Attribute is mediaType, initialize with text/xml to exclude + //the primary MIME Type of the encapsulated document + if (attr == "mediaType") attributeValues.append("text/xml"); + while (!attributeValueslist.empty()) + { + if (attributeValues.find(attributeValueslist.front()) == OFString_npos) + { + if (!attributeValues.empty()) attributeValues.append("\\"); + attributeValues.append(attributeValueslist.front()); + } + attributeValueslist.pop_front(); + } + //remove the primary MIME Type of the + //encapsulated document + if (attr == "mediaType") + { + if (attributeValues.size() > 9) + attributeValues.erase(0, 9); + else + attributeValues = ""; + } + } +#endif + return attributeValues; +} + +OFString DcmEncapsulatedDocument::XMLgetAttribute( + XMLNode fileNode, + DcmTagKey attr) +{ + OFString result = ""; +#ifndef _XMLWIDECHAR + if (attr == DCM_DocumentTitle) + { + if (fileNode.getChildNode("title").getText() != NULL) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNode("title").getText())); + } + } + if (attr == DCM_HL7InstanceIdentifier) + { + result = OFString(OFSTRING_GUARD( + fileNode.getChildNode("id").getAttribute("root"))) + "^" + OFString(OFSTRING_GUARD( + fileNode.getChildNode("id").getAttribute("extension"))); + } + /*PatientNameExtension could reflect the type of name (PHON, IDE, ABC) + if (attr == DCM_PatientNameExtension) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name").getAttribute("use"))); + }*/ + if (attr == DCM_PatientName) + { + result = OFString(OFSTRING_GUARD( + fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name/family").getText())) + "^" + OFString(OFSTRING_GUARD( + fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name").getChildNode("given", 0).getText())) + "^" + OFString(OFSTRING_GUARD( + fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name").getChildNode("given", 1).getText())) + "^" + OFString(OFSTRING_GUARD( + fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name/prefix").getText())) + "^" + OFString(OFSTRING_GUARD( + fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name/suffix").getText())); + } + if (attr == DCM_PatientSex) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/patient/administrativeGenderCode").getAttribute("code"))); + } + if (attr == DCM_PatientBirthDate) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/patient/birthTime").getAttribute("value"))); + } + //Table A.8-1. Basic Code Attributes Mapping to HL7 V3 Code Data Types (CV, CS, CE and CD) + if (attr == DCM_PatientID) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/id").getAttribute("extension"))); + } + if (attr == DCM_CodeValue)//Code Value + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("code"))); + } + if (attr == DCM_CodingSchemeUID)//Coding Scheme UID (PS3.16) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("codeSystem"))); + } + if (attr == DCM_CodingSchemeDesignator)//Coding Scheme Designator (0008,0102) + { + OFString CSDtemp=OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("codeSystemName"))); + // Abbreviate most common CSNs + if(CSDtemp==OFString("LOINC")) + { + result = OFString("LN"); + } + else + { + if(CSDtemp==OFString("DICOM")) + { + result = OFString("DC"); + } + else + { + if(CSDtemp==OFString("SNOMED")) + { + result = OFString("SRT"); + } + else + { + result=CSDtemp; + } + } + } + } + if (attr == DCM_CodingSchemeVersion)//Coding Scheme Version (0008,0103) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("codeSystemVersion"))); + } + if (attr == DCM_CodeMeaning)//Code Meaning (0008,0104) + { + result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("displayName"))); + } +#endif + return result; +} + +int DcmEncapsulatedDocument::getCDAData( + const char *filename, + OFLogger &appLogger) +{ +#ifdef _XMLWIDECHAR + OFLOG_ERROR(appLogger, "DCMTK compiled with \"wide char XML parser\". Cannot parse CDA data because of incompatible API."); + return 99; +#else + if (ftype != "cda") + { + OFLOG_WARN(appLogger, "Filetype mismatch or filetype not set. Current ftype is " << ftype); + } + XMLResults err; + XMLNode fileNode = XMLNode::parseFile(filename, "ClinicalDocument", &err); + OFLOG_TRACE(appLogger, "checking if the XML file is correctly formatted"); + if (0 != err.error) + { + OFLOG_ERROR(appLogger, fileNode.getError(err.error)); + return EXITCODE_INVALID_INPUT_FILE; + } + else + { + OFLOG_TRACE(appLogger, "XML file is correctly formatted"); + } + OFLOG_TRACE(appLogger, "Getting all media types from CDA file"); + cda_mediaTypes = XMLgetAllAttributeValues(fileNode, "mediaType"); + OFLOG_TRACE(appLogger, "Following mediaTypes were found: " << cda_mediaTypes); + OFLOG_TRACE(appLogger, "Getting HL7 Instance Identifier from CDA file"); + hl7_InstanceIdentifier = XMLgetAttribute(fileNode, DCM_HL7InstanceIdentifier); + OFLOG_TRACE(appLogger, "Reading and comparing patient information between CDA File and options"); + OFString pID = XMLgetAttribute(fileNode, DCM_PatientID); + if ((pID != "") && (opt_patientID != pID)) + { + if (opt_patientID != "") + { + //if no-override option is inactive, return an error + if (!opt_override) + { + OFLOG_ERROR(appLogger, "Patient ID mismatch:" << OFendl + << "Found in the CDA file : " << pID << OFendl + << "Entered (or found in DCM file): " << opt_patientID << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else + { + OFLOG_WARN(appLogger, "Patient ID mismatch:" << OFendl + << "Found in the CDA file : " << pID << OFendl + << "Provided (in DCM file): " << opt_patientID); + } + } + else + { + opt_patientID = pID; + } + } + OFString pBirthDate = XMLgetAttribute(fileNode, DCM_PatientBirthDate); + if ((pBirthDate != "") && (opt_patientBirthdate != pBirthDate)) + { + if (opt_patientBirthdate != "") + { + if (!opt_override) + { + OFLOG_ERROR(appLogger, "Patient Birth Date mismatch:" << OFendl + << "Found in the CDA file : " << pBirthDate << OFendl + << "Provided (in DCM file): " << opt_patientBirthdate << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else { + OFLOG_WARN(appLogger, "Patient Birth Date mismatch:" << OFendl + << "Found in the CDA file : " << pBirthDate << OFendl + << "Provided (in DCM file): " << opt_patientBirthdate); + } + } + else opt_patientBirthdate = pBirthDate; + } + OFString pSex = XMLgetAttribute(fileNode, DCM_PatientSex); + if ((pSex != "") && (opt_patientSex != pSex)) + { + if (opt_patientSex != "") + { + if (!opt_override) + { + OFLOG_ERROR(appLogger, "Patient Sex mismatch:" << OFendl + << "Found in the CDA file : " << pSex << OFendl + << "Provided (in DCM file): " << opt_patientSex << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else { + OFLOG_WARN(appLogger, "Patient Sex mismatch:" << OFendl + << "Found in the CDA file : " << pSex << OFendl + << "Provided (in DCM file): " << opt_patientSex); + } + } + else opt_patientSex = pSex; + } + OFString pName = XMLgetAttribute(fileNode, DCM_PatientName); + if ((pName != "^^^^") && (opt_patientName != pName)) + { + if (opt_patientName != "") + { + if (!opt_override) + { + OFLOG_ERROR(appLogger, "Patient Name mismatch:" << OFendl + << "Found in the CDA file : " << pName << OFendl + << "Provided (in DCM file): " << opt_patientName << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else { + OFLOG_WARN(appLogger, "Patient Name mismatch:" << OFendl + << "Found in the CDA file : " << pName << OFendl + << "Provided (in DCM file): " << opt_patientName); + } + } + else opt_patientName = pName; + } + //get document title from CDA + OFString dTitle = XMLgetAttribute(fileNode, DCM_DocumentTitle); + if (opt_documentTitle == "") + { + if (opt_conceptCSD != "") opt_documentTitle = opt_conceptCSD; + if (opt_conceptCV != "") opt_documentTitle = opt_conceptCV; + if (opt_conceptCM != "") opt_documentTitle = opt_conceptCM; + } + + if ((dTitle != "") && (opt_documentTitle != dTitle)) + { + if (opt_documentTitle != "") + { + if (!opt_override) + { + OFLOG_ERROR(appLogger, "Document Title mismatch:" << OFendl + << "Found in the CDA file : " << dTitle << OFendl + << "Provided (in DCM file): " << opt_documentTitle << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else { + OFLOG_WARN(appLogger, "Document Title mismatch:" << OFendl + << "Found in the CDA file : " << dTitle << OFendl + << "Provided (in DCM file): " << opt_documentTitle); + } + } + else opt_documentTitle = dTitle; + } + //get Concept information from CDA + OFString cCSD = XMLgetAttribute(fileNode, DCM_CodingSchemeDesignator); + if ((cCSD != "") && (opt_conceptCSD != cCSD)) + { + if (opt_conceptCSD != "") + { + if (!opt_override) + { + OFLOG_ERROR(appLogger, "concept CSD mismatch:" << OFendl + << "Found in the CDA file : " << cCSD << OFendl + << "Provided (in DCM file): " << opt_conceptCSD << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else { + OFLOG_WARN(appLogger, "concept CSD mismatch:" << OFendl + << "Found in the CDA file : " << cCSD << OFendl + << "Provided (in DCM file): " << opt_conceptCSD); + } + } + else opt_conceptCSD = cCSD; + } + OFString cCV = XMLgetAttribute(fileNode, DCM_CodeValue); + if ((cCV != "") && (opt_conceptCV != cCV)) + { + if (opt_conceptCV != "") + { + if (!opt_override) + { + OFLOG_ERROR(appLogger, "concept CV mismatch:" << OFendl + << "Found in the CDA file : " << cCV << OFendl + << "Provided (in DCM file): " << opt_conceptCV << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else { + OFLOG_WARN(appLogger, "concept CV mismatch:" << OFendl + << "Found in the CDA file : " << cCV << OFendl + << "Provided (in DCM file): " << opt_conceptCV); + } + } + else opt_conceptCV = cCV; + } + OFString cCM = XMLgetAttribute(fileNode, DCM_CodeMeaning); + if ((cCM != "") && (opt_conceptCM != cCM)) + { + if (opt_conceptCM != "") + { + if (!opt_override) + { + OFLOG_ERROR(appLogger, "concept CM mismatch:" << OFendl + << "Found in the CDA file : " << cCM << OFendl + << "Provided (in DCM file): " << opt_conceptCM << OFendl + << "If you wish to override, run again with +ov"); + return EXITCODE_COMMANDLINE_SYNTAX_ERROR; + } + else { + OFLOG_WARN(appLogger, "concept CM mismatch:" << OFendl + << "Found in the CDA file : " << cCM << OFendl + << "Provided (in DCM file): " << opt_conceptCM); + } + } + else opt_conceptCM = cCM; + } + return EXITCODE_NO_ERROR; +#endif +} + +void DcmEncapsulatedDocument::addCDACommandlineOptions(OFCommandLine &cmd) +{ + ftype = "cda"; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam( "cdafile-in", "CDA input filename to be converted"); + cmd.addParam( "dcmfile-out", "DICOM output filename"); + addGeneralOptions(cmd); + addDocumentOptions(cmd); + cmd.addSubGroup("override CDA data:"); + cmd.addOption("--no-override", "-ov", "CDA patient and document data must match study,\nseries or manually entered information (default)"); + cmd.addOption("--override", "+ov", "CDA's data will be overwritten by study, series\nor manually entered information"); + addOutputOptions(cmd); +} + +void DcmEncapsulatedDocument::addPDFCommandlineOptions(OFCommandLine &cmd) +{ + ftype = "pdf"; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam( "pdffile-in", "PDF input filename to be converted"); + cmd.addParam( "dcmfile-out", "DICOM output filename"); + addGeneralOptions(cmd); + addDocumentOptions(cmd); + addOutputOptions(cmd); +} + +void DcmEncapsulatedDocument::addSTLCommandlineOptions(OFCommandLine &cmd) +{ + ftype = "stl"; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam( "stlfile-in", "STL input filename to be converted"); + cmd.addParam( "dcmfile-out", "DICOM output filename"); + addGeneralOptions(cmd); + addDocumentOptions(cmd); + cmd.addSubGroup("enhanced general equipment:"); + cmd.addOption("--manufacturer", "+mn", 1, "[n]ame: string", + "manufacturer's name"); + cmd.addOption("--manufacturer-model", "+mm", 1, "[n]ame: string", + "manufacturer's model name"); + cmd.addOption("--device-serial", "+ds", 1, "[n]umber: string", + "device serial number"); + cmd.addOption("--software-versions", "+sv", 1, "[v]ersions: string", + "software versions"); + cmd.addSubGroup("3d model measurement units:"); + cmd.addOption("--measurement-units", "+mu", 3, "[CSD] [CV] [CM]: string (default: UCUM, um, um)", + "measurement units defined by coding scheme\ndesignator CSD, code value CV, code meaning CM"); + addOutputOptions(cmd); +} + +void DcmEncapsulatedDocument::addGeneralOptions(OFCommandLine &cmd) +{ + cmd.addGroup( "general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption( "--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption( "--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); +} + +void DcmEncapsulatedDocument::addDocumentOptions(OFCommandLine &cmd) +{ + cmd.addGroup( "DICOM document options:"); + cmd.addSubGroup("document title:"); + cmd.addOption("--title", "+t", 1, "[t]itle: string (default: empty)", + "document title"); + cmd.addOption("--concept-name", "+cn", 3, "[CSD] [CV] [CM]: string (default: empty)", + "coded representation of document title defined\nby coding scheme designator CSD,\ncode value CV and code meaning CM"); + cmd.addSubGroup("patient data:"); + cmd.addOption("--patient-name", "+pn", 1, "[n]ame: string", + "patient's name in DICOM PN syntax"); + cmd.addOption("--patient-id", "+pi", 1, "[i]d: string", + "patient identifier"); + cmd.addOption("--patient-birthdate", "+pb", 1, "[d]ate: string (YYYYMMDD)", + "patient's birth date"); + cmd.addOption("--patient-sex", "+ps", 1, "[s]ex: string (M, F or O)", + "patient's sex"); + cmd.addSubGroup("study and series:"); + cmd.addOption("--generate", "+sg", "generate new study and\nseries UIDs (default)"); + cmd.addOption("--study-from", "+st", 1, "[f]ilename: string", + "read patient/study data from DICOM file"); + cmd.addOption("--series-from", "+se", 1, "[f]ilename: string", + "read patient/study/series data from DICOM file"); + cmd.addSubGroup("instance number:"); + cmd.addOption("--instance-one", "+i1", "use instance number 1\n(default, not with +se)"); + cmd.addOption("--instance-inc", "+ii", "increment instance number (only with +se)"); + cmd.addOption("--instance-set", "+is", 1, "[i]nstance number: integer", "use instance number i"); + cmd.addSubGroup("burned-in annotation:"); + cmd.addOption("--annotation-yes", "+an", "document contains patient identifying data\n(default)"); + cmd.addOption("--annotation-no", "-an", "document does not contain patient identif. data"); +} + +void DcmEncapsulatedDocument::addOutputOptions(OFCommandLine &cmd) +{ + cmd.addGroup( "processing options:"); + cmd.addSubGroup("other processing options:"); + cmd.addOption("--key", "-k", 1, "[k]ey: gggg,eeee=\"str\", path or dict. name=\"str\"", + "add further attribute"); + cmd.addGroup( "output options:"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian (default)"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding (default)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +} + +void DcmEncapsulatedDocument::parseArguments( + OFConsoleApplication& app, + OFCommandLine& cmd) +{ + //command line parameters and options + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + dcmEnableGenerationOfNewVRs(); + + // Override keys are applied at the very end of the conversion "pipeline" + OFList overrideKeys; + + cmd.beginOptionBlock(); + if (cmd.findOption("--generate")) + { + opt_seriesFile = ""; + opt_readSeriesInfo = OFFalse; + } + + if (cmd.findOption("--series-from")) + { + app.checkValue(cmd.getValue(opt_seriesFile)); + opt_readSeriesInfo = OFTrue; + } + + if (cmd.findOption("--study-from")) + { + app.checkValue(cmd.getValue(opt_seriesFile)); + opt_readSeriesInfo = OFFalse; + } + cmd.endOptionBlock(); + if (cmd.findOption("--title")) + { + app.checkValue(cmd.getValue(opt_documentTitle)); + } + if (cmd.findOption("--concept-name")) + { + app.checkValue(cmd.getValue(opt_conceptCSD)); + app.checkValue(cmd.getValue(opt_conceptCV)); + app.checkValue(cmd.getValue(opt_conceptCM)); + } + if (cmd.findOption("--patient-name")) + { + app.checkValue(cmd.getValue(opt_patientName)); + app.checkConflict("--patient-name", "--study-from or --series-from", + opt_seriesFile != ""); + } + if (cmd.findOption("--patient-id")) + { + app.checkValue(cmd.getValue(opt_patientID)); + app.checkConflict("--patient-id", "--study-from or --series-from", + opt_seriesFile != ""); + } + if (cmd.findOption("--patient-birthdate")) + { + app.checkValue(cmd.getValue(opt_patientBirthdate)); + app.checkConflict("--patient-birthdate", "--study-from or --series-from", opt_seriesFile != ""); + } + if (cmd.findOption("--patient-sex")) + { + app.checkValue(cmd.getValue(opt_patientSex)); + app.checkConflict("--patient-sex", "--study-from or --series-from", opt_seriesFile != ""); + } + cmd.beginOptionBlock(); + if (cmd.findOption("--annotation-yes")) + { + opt_annotation = OFTrue; + } + if (cmd.findOption("--annotation-no")) + { + opt_annotation = OFFalse; + } + cmd.endOptionBlock(); + if (ftype == "cda") + { + cmd.beginOptionBlock(); + if (cmd.findOption("--override")) + { + opt_override = OFTrue; + } + if (cmd.findOption("--no-override")) + { + opt_override = OFFalse; + } + cmd.endOptionBlock(); + } + if (ftype == "stl") + { + if (cmd.findOption("--measurement-units")) + { + app.checkValue(cmd.getValue(opt_measurementUnitsCSD)); + app.checkValue(cmd.getValue(opt_measurementUnitsCV)); + app.checkValue(cmd.getValue(opt_measurementUnitsCM)); + } + if (cmd.findOption("--manufacturer")) app.checkValue(cmd.getValue(opt_manufacturer)); + if (cmd.findOption("--manufacturer-model")) app.checkValue(cmd.getValue(opt_manufacturerModelName)); + if (cmd.findOption("--device-serial")) app.checkValue(cmd.getValue(opt_deviceSerialNumber)); + if (cmd.findOption("--software-versions")) app.checkValue(cmd.getValue(opt_softwareVersions)); + } + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", + opt_writeMode == EWM_dataset); + opt_opadenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", + opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + + // create override attribute dataset (copied from findscu code) + if (cmd.findOption("--key", 0, OFCommandLine::FOM_FirstFromLeft ) ) + { + const char *ovKey = NULL; + do { + app.checkValue(cmd.getValue(ovKey)); + overrideKeys.push_back(ovKey); + } while (cmd.findOption("--key", 0, OFCommandLine::FOM_NextFromLeft ) ); + } + DcmEncapsulatedDocument::setOverrideKeys(overrideKeys); + // initialize default for --series-from + if (opt_seriesFile!="" && opt_readSeriesInfo) opt_increment = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--instance-one")) + { + app.checkConflict("--instance-one", "--series-from", + (opt_seriesFile != "") && opt_readSeriesInfo); + opt_increment = OFFalse; + opt_instance = 1; + } + if (cmd.findOption("--instance-inc")) + { + app.checkDependence("--instance-inc", "--series-from", + (opt_seriesFile != "") && opt_readSeriesInfo); + opt_increment = OFTrue; + } + if (cmd.findOption("--instance-set")) + { + opt_increment = OFFalse; + app.checkValue(cmd.getValueAndCheckMin(opt_instance, 1)); + } + cmd.endOptionBlock(); +} + +OFCondition DcmEncapsulatedDocument::createIdentifiers(OFLogger& appLogger) +{ + char buf[100]; + OFCondition cond = EC_Normal; + Sint32 incrementedInstance = 0; + if (opt_seriesFile != "") + { + DcmFileFormat dfile; + cond = dfile.loadFile(opt_seriesFile, EXS_Unknown, EGL_noChange); + if (cond.bad()) + { + OFLOG_WARN(appLogger, cond.text() + << ": reading file: " << opt_seriesFile); + } + else + { + const char *c = NULL; + DcmDataset *dset = dfile.getDataset(); + if (dset) + { + OFLOG_TRACE(appLogger, "reading patient attributes"); + c = NULL; + if (dset->findAndGetString(DCM_PatientName, c).good() && c) + { + opt_patientName = c; + } + c = NULL; + if (dset->findAndGetString(DCM_PatientID, c).good() && c) + { + opt_patientID = c; + } + c = NULL; + if (dset->findAndGetString(DCM_PatientBirthDate, c).good() && c) + { + opt_patientBirthdate = c; + } + c = NULL; + if (dset->findAndGetString(DCM_PatientSex, c).good() && c) + { + opt_patientSex = c; + } + OFLOG_TRACE(appLogger, "reading study attributes"); + c = NULL; + if (dset->findAndGetString(DCM_StudyInstanceUID, c).good() && c) + { + opt_studyUID = c; + } + OFLOG_TRACE(appLogger, "reading series attributes"); + if (opt_readSeriesInfo) + { + c = NULL; + if (dset->findAndGetString(DCM_SeriesInstanceUID, c).good() && c) + { + opt_seriesUID = c; + } + if (dset->findAndGetSint32(DCM_InstanceNumber, + incrementedInstance).good()) + { + ++incrementedInstance; + } + else + { + incrementedInstance = 0; + } + if (opt_increment) opt_instance = incrementedInstance; + } + if (ftype == "stl") + { + OFLOG_TRACE(appLogger, "reading STL specific information"); + c = NULL; + OFLOG_TRACE(appLogger, "reading Frame of Reference Info"); + if (dset->findAndGetString(DCM_FrameOfReferenceUID, c).good() && c) + { + opt_frameOfReferenceUID = c; + } + c = NULL; + if (dset->findAndGetString(DCM_PositionReferenceIndicator, c).good() && c) + { + opt_positionReferenceIndicator = c; + } + OFLOG_TRACE(appLogger, "reading Enhanced Equipment info"); + c = NULL; + if (dset->findAndGetString(DCM_Manufacturer, c).good() && c) + { + opt_manufacturer = c; + } + c = NULL; + if (dset->findAndGetString(DCM_ManufacturerModelName, c).good() && c) + { + opt_manufacturerModelName = c; + } + c = NULL; + if (dset->findAndGetString(DCM_DeviceSerialNumber, c).good() && c) + { + opt_deviceSerialNumber = c; + } + c = NULL; + if (dset->findAndGetString(DCM_SoftwareVersions, c).good() && c) + { + opt_softwareVersions = c; + } + OFLOG_TRACE(appLogger, "reading manufacturing 3d model info"); + { + + OFLOG_TRACE(appLogger, "manufacturing 3d model info read successfully"); + } + } + } + } + } + if (opt_studyUID.empty()) + { + dcmGenerateUniqueIdentifier(buf, SITE_STUDY_UID_ROOT); + opt_studyUID = buf; + } + if (opt_seriesUID.empty()) + { + dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT); + opt_seriesUID = buf; + } + return cond; +} + +int DcmEncapsulatedDocument::insertEncapsulatedDocument( + DcmItem *dataset, + OFLogger& appLogger) +{ + char buf[100]; + size_t fileSize = 0; + size_t buflen = 100; + struct stat fileStat; + + if (0 == stat(opt_ifname.c_str(), &fileStat)) + { + fileSize = OFstatic_cast(size_t, fileStat.st_size); + } + else + { + OFLOG_ERROR(appLogger, "file " << opt_ifname << " not found"); + return EXITCODE_NO_INPUT_FILES; + } + if (fileSize == 0) + { + OFLOG_ERROR(appLogger, "file " << opt_ifname << " is empty"); + return EXITCODE_INVALID_INPUT_FILE; + } + FILE *encapfile = fopen(opt_ifname.c_str(), "rb"); + if (encapfile == NULL) + { + OFLOG_ERROR(appLogger, "unable to read file " << opt_ifname); + return EXITCODE_CANNOT_READ_INPUT_FILE; + } + if (fileSize < buflen) + { + buflen = fileSize; + } + if (buflen != fread(buf, 1, buflen, encapfile)) + { + OFLOG_ERROR(appLogger, "read error in file " << opt_ifname); + fclose(encapfile); + return EXITCODE_INVALID_INPUT_FILE; + } + if (ftype == "pdf") + { + // check magic word for PDF file + if (0 != strncmp("%PDF-", buf, 5)) + { + OFLOG_ERROR(appLogger, "file " << opt_ifname << " is not a PDF file"); + fclose(encapfile); + return EXITCODE_INVALID_INPUT_FILE; + } + // check PDF version number + char *version = buf + 5; + OFBool found = OFFalse; + for (int i = 0; i < 5; ++i) + { + if (version[i] == 10 || version[i] == 13) + { + version[i] = 0; // insert end of string + found = OFTrue; + break; + } + } + if (!found) + { + OFLOG_ERROR(appLogger, "file " << opt_ifname + << ": unable to decode PDF version number"); + fclose(encapfile); + return EXITCODE_INVALID_INPUT_FILE; + } + OFLOG_INFO(appLogger, "file " << opt_ifname + << ": PDF " << version << ", " + << (fileSize + 1023) / 1024 << "kB"); + } + else + { + if (ftype == "cda") + { + //xml validation occurs when getting data + OFLOG_INFO(appLogger, "file " << opt_ifname + << ": HL7 CDA file (XML Format)" << ", " + << (fileSize + 1023) / 1024 << "kB"); + } + else + { + if (ftype == "stl") + { + // Each facet contains: + // - Normals: 3 floats (4 bytes) + // - Vertices: 3x floats (4 byte each, 12 bytes total) + // - AttributeCount: 1 short (2 bytes) + // Total: 50 bytes per facet + const size_t facetSize32 = 3 * sizeof(Float32) + + 3 * 3 * sizeof(Float32) + + sizeof(Uint16); + const size_t facetSize64 = 3 * sizeof(Float64) + + 3 * 3 * sizeof(Float64) + + sizeof(Uint16); + // STL validation for ASCII CODE + if (fileSize < 15) + { + // "solid " and "endsolid " markers for an ASCII file + OFLOG_ERROR(appLogger, "The STL file is not long enough" + << " (" << fileSize << "kB)"); + fclose(encapfile); + return EXITCODE_INVALID_INPUT_FILE; + } + // Binary files should never start with "solid ", + // but just in case, check for ASCII, + // and if not valid then check for binary... + // Look for text "solid " in first 6 bytes, + // indicating the possibility that this is an + // ASCII STL format. + if (0 == strncmp("solid ", buf, 6)) + { + OFLOG_ERROR(appLogger, "File " << opt_ifname + << " starts with 'solid '. " + << "It is a valid STL file but it is in ASCII Code" + << "and DICOM only accepts binary STL"); + return EXITCODE_INVALID_INPUT_FILE; + } + //////STL validation for Binary Format + else + { + OFLOG_DEBUG(appLogger, "Magic word 'solid ' not found. " + << "Validating STL file " + << "in Binary format"); + // 80-byte header + 4-byte "number of triangles" for a binary file + if (fileSize < 84) + { + OFLOG_ERROR(appLogger, "The binary STL file is not long enough" + << " (" << fileSize << "kB)"); + fclose(encapfile); + return EXITCODE_INVALID_INPUT_FILE; + } + // Header is from bytes 0-79 + // The number of Triangles starts at byte offset 80 and is a uint32 (4 Bytes) + char ntriangleschar[5]; + for (int j = 0; j < 4; j++) + ntriangleschar[j] = buf[80 + j]; + ntriangleschar[4] = 0; + Uint32* nTriangles = OFreinterpret_cast(Uint32*, ntriangleschar); + // Verify that file size equals the sum of + // header + nTriangles value + all triangles + OFLOG_DEBUG(appLogger, "verifying if the file size is consistent"); + if (fileSize == (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize32) || + fileSize == (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize64)) + { + OFLOG_DEBUG(appLogger, "File " << opt_ifname + << " passed binary STL validation." << OFendl + << "Assuming valid STL file " + << "in binary format" + ); + OFLOG_TRACE(appLogger, "The binary STL file is:" << OFendl + << fileSize << " kB " << " as expected." << OFendl + << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize32) << " kB for x86" << OFendl + << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize64) << " kB for x64" << OFendl + << "(84 + triangles number * facet size)" << OFendl + << " number of Triangles " << *OFconst_cast(Uint32*, nTriangles) << OFendl + << " nTriangles (Uint32): " << nTriangles << OFendl + << " facetSize32: " << facetSize32 << OFendl + << " facetSize64: " << facetSize64 << OFendl + ); + } + else + { + OFLOG_ERROR(appLogger, "The binary STL file is not consistent." << OFendl + << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize32) << " kB for x86 and " + << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize64) << " kB for x64 " << OFendl + << "(84 + triangles number * facet size)" << OFendl + << " number of Triangles " << *OFconst_cast(Uint32*, nTriangles) << OFendl + << " nTriangles (Uint32): " << nTriangles << OFendl + << " facetSize32: " << facetSize32 << OFendl + << " facetSize64: " << facetSize64 << OFendl + ); + fclose(encapfile); + return EXITCODE_INVALID_INPUT_FILE; + } + } + } + else + { + OFLOG_WARN(appLogger, "Filetype not supported or filetype not set. Current ftype is " << ftype << OFendl + << "The name of the passed logger is: " << appLogger.getName()); + } + } + } + if (0 != fseek(encapfile, 0, SEEK_SET)) + { + OFLOG_ERROR(appLogger, "file " << opt_ifname << ": seek error"); + fclose(encapfile); + return EXITCODE_CANNOT_READ_INPUT_FILE; + } + OFCondition result = EC_Normal; + DcmPolymorphOBOW *elem = new DcmPolymorphOBOW(DCM_EncapsulatedDocument); + if (elem) + { + size_t numBytes = fileSize; + if (numBytes & 1) ++numBytes; + Uint8 *bytes = NULL; + result = elem->createUint8Array(OFstatic_cast(Uint32, numBytes), bytes); + if (result.good()) + { + // blank pad byte + bytes[numBytes - 1] = 0; + // read file content + if (fileSize != fread(bytes, 1, fileSize, encapfile)) + { + OFLOG_ERROR(appLogger, "read error in file " << opt_ifname); + return EXITCODE_CANNOT_READ_INPUT_FILE; + } + } + } + else + { + fclose(encapfile); + return EXITCODE_MEMORY_EXHAUSTED; + } + // if successful, insert element into dataset + if (result.good()) + { + result = dataset->insert(elem); + } + else + { + delete elem; + OFLOG_ERROR(appLogger, "Unsuccessful, did not insert element."); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + // close file + fclose(encapfile); + if (result.good()) + { + return EXITCODE_NO_ERROR; + } + else + { + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } +} + +OFCondition DcmEncapsulatedDocument::createHeader( + DcmItem *dataset, + OFLogger& logger) +{ + OFCondition result = EC_Normal; + char buf[80]; + // insert empty type 2 attributes + if (result.good()) result = dataset->insertEmptyElement(DCM_StudyDate); + if (result.good()) result = dataset->insertEmptyElement(DCM_StudyTime); + if (result.good()) result = dataset->insertEmptyElement(DCM_AccessionNumber); + if (result.good()) result = dataset->insertEmptyElement(DCM_Manufacturer); + if (result.good()) result = dataset->insertEmptyElement(DCM_ReferringPhysicianName); + if (result.good()) result = dataset->insertEmptyElement(DCM_StudyID); + if (result.good()) result = dataset->insertEmptyElement(DCM_ContentDate); + if (result.good()) result = dataset->insertEmptyElement(DCM_ContentTime); + if (result.good()) result = dataset->insertEmptyElement(DCM_AcquisitionDateTime); + if (result.good()) + { + if (opt_conceptCSD!="" && opt_conceptCV != "" && opt_conceptCM != "") + { + result = DcmCodec::insertCodeSequence(dataset, DCM_ConceptNameCodeSequence, + opt_conceptCSD.c_str(), + opt_conceptCV.c_str(), + opt_conceptCM.c_str()); + } + else + { + result = dataset->insertEmptyElement(DCM_ConceptNameCodeSequence); + } + } + // insert const value attributes + if (result.good()) + { + result = dataset->putAndInsertString(DCM_SpecificCharacterSet, "ISO_IR 100"); + } + //insert encapsulated file storage UID (CDA/PDF/STL) + if (result.good()) + { + if (ftype == "pdf") + { + OFLOG_TRACE(logger, "Inserting SOPClassUID to dataset"); + result = dataset->putAndInsertString(DCM_SOPClassUID, UID_EncapsulatedPDFStorage); + } + if (ftype == "cda") + { + OFLOG_TRACE(logger, "Inserting SOPClassUID to dataset"); + result = dataset->putAndInsertString(DCM_SOPClassUID, UID_EncapsulatedCDAStorage); + } + if (ftype == "stl") + {//STL Specific modules + OFLOG_TRACE(logger, "Validating Frame of Reference UID value"); + if (opt_frameOfReferenceUID.empty()) + { + OFLOG_DEBUG(logger, "Frame of Reference UID " + << DCM_FrameOfReferenceUID + << " value was empty, generating a new one." + ); + dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT); + opt_frameOfReferenceUID = buf; + } + else + { + if (DcmUniqueIdentifier::checkStringValue(opt_frameOfReferenceUID, "1").bad()) + { + OFLOG_DEBUG(logger, "Frame of Reference UID " + << DCM_FrameOfReferenceUID + << " value was faulty, generating a new one." + ); + dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT); + opt_frameOfReferenceUID = buf; + } + } + if (result.good()) + { + OFLOG_TRACE(logger, "Inserting Frame of Reference info to dataset"); + result = dataset->putAndInsertOFStringArray(DCM_FrameOfReferenceUID, opt_frameOfReferenceUID); + } + if (result.good())result = dataset->putAndInsertOFStringArray(DCM_PositionReferenceIndicator, opt_positionReferenceIndicator); + OFLOG_TRACE(logger, "Validating and inserting Enhanced General Equipment fields"); + if (result.good()) + { + if (opt_manufacturer.empty()) + { + opt_manufacturer="DCMTK_MANUFACTURING"; + OFLOG_WARN(logger, "No Manufacturer " + << DCM_Manufacturer + << " provided nor found in series. This attribute is " + << "required for Enhanced General Equipment module. " + << opt_manufacturer + << " will be inserted as dummy value." + ); + } + result = dataset->putAndInsertOFStringArray(DCM_Manufacturer, opt_manufacturer); + } + if (result.good()) + { + if (opt_manufacturerModelName.empty()) + { + opt_manufacturerModelName="DCMTK_3DMODEL_3"; + OFLOG_WARN(logger, "No Manufacturer Model Name " + << DCM_ManufacturerModelName + << " provided nor found in series. This attribute is " + << "required for Enhanced General Equipment module. " + << opt_manufacturerModelName + << " will be inserted as dummy value." + ); + } + result = dataset->putAndInsertOFStringArray(DCM_ManufacturerModelName, opt_manufacturerModelName); + } + if (result.good()) + { + if (opt_deviceSerialNumber.empty()) + { + opt_deviceSerialNumber="DCMTK01234567890"; + OFLOG_WARN(logger, "No Device Serial Number " + << DCM_DeviceSerialNumber + << " provided nor found in series. This attribute is " + << "required for Enhanced General Equipment module. " + << opt_deviceSerialNumber + << " will be inserted as dummy value." + ); + } + result = dataset->putAndInsertOFStringArray(DCM_DeviceSerialNumber, opt_deviceSerialNumber); + } + if (result.good()) + { + if (opt_softwareVersions.empty()) + { + opt_softwareVersions=OFFIS_DCMTK_VERSION; + OFLOG_WARN(logger, "No Software Versions " + << DCM_SoftwareVersions + << " provided nor found in series. This attribute is " + << "required for Enhanced General Equipment module. " + << opt_softwareVersions + << " will be inserted as dummy value." + ); + } + result = dataset->putAndInsertOFStringArray(DCM_SoftwareVersions, opt_softwareVersions); + } + if (result.good()) + { + if (opt_measurementUnitsCSD != "" && opt_measurementUnitsCV != "" && opt_measurementUnitsCM != "") + { + result = DcmCodec::insertCodeSequence(dataset, DCM_MeasurementUnitsCodeSequence, + opt_measurementUnitsCSD.c_str(), + opt_measurementUnitsCV.c_str(), + opt_measurementUnitsCM.c_str()); + } + else + { + OFLOG_DEBUG(logger, "Measurement Units Code Sequence " + << DCM_FrameOfReferenceUID + << "had one or more empty values, generating default values." + ); + result = DcmCodec::insertCodeSequence(dataset, DCM_MeasurementUnitsCodeSequence, "UCUM","um","um"); + } + } + if (result.good()) + { + OFLOG_TRACE(logger, "Inserting SOPClassUID to dataset"); + result = dataset->putAndInsertString(DCM_SOPClassUID, UID_EncapsulatedSTLStorage); + } + } + } + if (result.good()) + { + if (ftype=="stl") + { + result = dataset->putAndInsertString(DCM_Modality, "M3D"); + } + else + { + // we are now using "DOC" for the modality, which seems to be more appropriate than "OT" (see CP-749) + result = dataset->putAndInsertString(DCM_Modality, "DOC"); + } + } + if (result.good()) + { + if (ftype != "stl") + { + OFLOG_TRACE(logger, "Inserting default Conversion type: Workstation (WSD) to dataset"); + result = dataset->putAndInsertString(DCM_ConversionType, "WSD"); + } + else + { + OFLOG_TRACE(logger, "STL has no Conversion Type"); + result = EC_Normal; + } + } + if (result.good()) + { + // according to C.24.2.1 on part 3, (0042,0012) is text/XML for CDA. + if (ftype=="cda") + result = dataset->putAndInsertString(DCM_MIMETypeOfEncapsulatedDocument, "text/XML"); + // according to A.45.1.4.1 on part 3, MIME Type is application/pdf for PDF. + if (ftype=="pdf") + result = dataset->putAndInsertString(DCM_MIMETypeOfEncapsulatedDocument, "application/pdf"); + // according to A.85.1.4.2 on part 3, MIME Type is model/stl. + if (ftype=="stl") + result = dataset->putAndInsertString(DCM_MIMETypeOfEncapsulatedDocument, "model/stl"); + } + // there is no way we could determine a meaningful series number, so we just use a constant. + if (result.good()) result = dataset->putAndInsertString(DCM_SeriesNumber, "1"); + // insert variable value attributes + if (result.good()) result = dataset->putAndInsertString(DCM_DocumentTitle, opt_documentTitle.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_PatientName, opt_patientName.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_PatientID, opt_patientID.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_PatientBirthDate, opt_patientBirthdate.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_PatientSex, opt_patientSex.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_BurnedInAnnotation, opt_annotation ? "YES" : "NO"); + if (strlen(cda_mediaTypes.c_str()) >0) + { + if (result.good()) result = dataset->putAndInsertString(DCM_ListOfMIMETypes, cda_mediaTypes.c_str()); + } + if (hl7_InstanceIdentifier.size() >0) + { + if (result.good()) result = dataset->putAndInsertString(DCM_HL7InstanceIdentifier, hl7_InstanceIdentifier.c_str()); + } + sprintf(buf, "%ld", OFstatic_cast(long, opt_instance)); + if (result.good()) result = dataset->putAndInsertString(DCM_InstanceNumber, buf); + dcmGenerateUniqueIdentifier(buf, SITE_INSTANCE_UID_ROOT); + if (result.good()) result = dataset->putAndInsertString(DCM_StudyInstanceUID, opt_studyUID.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_SeriesInstanceUID, opt_seriesUID.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_SOPInstanceUID, buf); + // set instance creation date and time + OFString s; + if (result.good()) result = DcmDate::getCurrentDate(s); + if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationDate, s); + if (result.good()) result = DcmTime::getCurrentTime(s); + if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationTime, s); + return result; +} + +OFCondition DcmEncapsulatedDocument::applyOverrideKeys(DcmDataset *outputDset) +{ + // replace specific keys by those in overrideKeys, copied from findscu + OFListConstIterator(OFString) path = opt_overrideKeys.begin(); + OFListConstIterator(OFString) endOfList = opt_overrideKeys.end(); + OFCondition cond; + DcmPathProcessor proc; + while (path != endOfList) + { + cond = proc.applyPathWithValue(outputDset, *path); + if (cond.bad()) + { + OFString err; + err += "Bad override key/path: "; err += *path; err += ": "; err += cond.text(); + return makeOFCondition(OFM_dcmdata, 18, OF_error, err.c_str()); + } + path++; + } + return cond; +} + +void DcmEncapsulatedDocument::setOverrideKeys(const OFList& ovkeys) +{ + OFListConstIterator(OFString) it = ovkeys.begin(); + OFListConstIterator(OFString) end = ovkeys.end(); + while (it != end) + { + opt_overrideKeys.push_back(*it); + it++; + } +} + +OFCondition DcmEncapsulatedDocument::saveFile(DcmFileFormat fileformat) +{ + return fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, + opt_opadenc, OFstatic_cast(Uint32, opt_filepad), + OFstatic_cast(Uint32, opt_itempad)); +} + +OFString DcmEncapsulatedDocument::getInputFileName() +{ + return opt_ifname; +} + +void DcmEncapsulatedDocument::setInputFileName(OFString fName) +{ + opt_ifname= fName; +} + +OFString DcmEncapsulatedDocument::getOutputFileName() +{ + return opt_ofname; +} + +void DcmEncapsulatedDocument::setOutputFileName(OFString fName) +{ + opt_ofname = fName; +} + +OFString DcmEncapsulatedDocument::getFileType() +{ + return ftype; +} + +void DcmEncapsulatedDocument::setFileType(OFString fType) +{ + ftype = fType; +} + +E_TransferSyntax DcmEncapsulatedDocument::getTransferSyntax() +{ + return opt_oxfer; +} + +DcmEncapsulatedDocument::~DcmEncapsulatedDocument() +{ +} diff --git a/dcmdata/libsrc/dcerror.cc b/dcmdata/libsrc/dcerror.cc new file mode 100644 index 00000000..be125dd7 --- /dev/null +++ b/dcmdata/libsrc/dcerror.cc @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Error handling, codes and strings + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcerror.h" + +makeOFConditionConst(EC_InvalidTag, OFM_dcmdata, 1, OF_error, "Invalid tag" ); +makeOFConditionConst(EC_TagNotFound, OFM_dcmdata, 2, OF_error, "Tag not found" ); +makeOFConditionConst(EC_InvalidVR, OFM_dcmdata, 3, OF_error, "Invalid VR" ); +makeOFConditionConst(EC_InvalidStream, OFM_dcmdata, 4, OF_error, "Invalid stream" ); +makeOFConditionConst(EC_EndOfStream, OFM_dcmdata, 5, OF_error, "End of stream" ); +makeOFConditionConst(EC_CorruptedData, OFM_dcmdata, 6, OF_error, "Corrupted data" ); +makeOFConditionConst(EC_IllegalCall, OFM_dcmdata, 7, OF_error, "Illegal call, perhaps wrong parameters" ); +makeOFConditionConst(EC_SequEnd, OFM_dcmdata, 8, OF_error, "Sequence end" ); +makeOFConditionConst(EC_DoubledTag, OFM_dcmdata, 9, OF_error, "Doubled tag" ); +makeOFConditionConst(EC_StreamNotifyClient, OFM_dcmdata, 10, OF_error, "I/O suspension or premature end of stream" ); +makeOFConditionConst(EC_WrongStreamMode, OFM_dcmdata, 11, OF_error, "Mode (R/W, random/sequence) is wrong" ); +makeOFConditionConst(EC_ItemEnd, OFM_dcmdata, 12, OF_error, "Item end" ); +makeOFConditionConst(EC_RepresentationNotFound, OFM_dcmdata, 13, OF_error, "Pixel representation not found" ); +makeOFConditionConst(EC_CannotChangeRepresentation, OFM_dcmdata, 14, OF_error, "Pixel representation cannot be changed" ); +makeOFConditionConst(EC_UnsupportedEncoding, OFM_dcmdata, 15, OF_error, "Unsupported compression or encryption" ); +// error code 16 is reserved for zlib-related error messages +makeOFConditionConst(EC_PutbackFailed, OFM_dcmdata, 17, OF_error, "Parser failure: Putback operation failed" ); +// error code 18 is reserved for file read error messages +// error code 19 is reserved for file write error messages +makeOFConditionConst(EC_DoubleCompressionFilters, OFM_dcmdata, 20, OF_error, "Too many compression filters" ); +makeOFConditionConst(EC_ApplicationProfileViolated, OFM_dcmdata, 21, OF_error, "Storage media application profile violated" ); +// error code 22 is reserved for dcmodify error messages +makeOFConditionConst(EC_InvalidOffset, OFM_dcmdata, 23, OF_error, "Invalid offset" ); +makeOFConditionConst(EC_TooManyBytesRequested, OFM_dcmdata, 24, OF_error, "Too many bytes requested" ); +// error code 25 is reserved for tag path parsing error messages +makeOFConditionConst(EC_InvalidBasicOffsetTable, OFM_dcmdata, 26, OF_error, "Invalid basic offset table" ); +makeOFConditionConst(EC_ElemLengthLargerThanItem, OFM_dcmdata, 27, OF_error, "Length of element larger than explicit length of surrounding item" ); +makeOFConditionConst(EC_FileMetaInfoHeaderMissing, OFM_dcmdata, 28, OF_error, "File meta information header missing" ); +makeOFConditionConst(EC_SeqOrItemContentOverflow, OFM_dcmdata, 29, OF_error, "Item or sequence content exceeds maximum of 32-bit length field"); +makeOFConditionConst(EC_ValueRepresentationViolated, OFM_dcmdata, 30, OF_error, "Value Representation violated" ); +makeOFConditionConst(EC_ValueMultiplicityViolated, OFM_dcmdata, 31, OF_error, "Value Multiplicity violated" ); +makeOFConditionConst(EC_MaximumLengthViolated, OFM_dcmdata, 32, OF_error, "Maximum VR length violated" ); +makeOFConditionConst(EC_ElemLengthExceeds16BitField, OFM_dcmdata, 33, OF_error, "Length of element value exceeds maximum of 16-bit length field" ); +makeOFConditionConst(EC_SequDelimitationItemMissing, OFM_dcmdata, 34, OF_error, "Sequence Delimitation Item missing" ); +// error codes 35..36 are reserved for specific character set error messages (see below) +// error code 37 is reserved for XML conversion error messages (see below) +makeOFConditionConst(EC_ItemDelimitationItemMissing, OFM_dcmdata, 38, OF_error, "Item Delimitation Item missing" ); +makeOFConditionConst(EC_PrematureSequDelimitationItem, OFM_dcmdata, 39, OF_error, "Sequence Delimitation Item occurred before Item was completely read" ); +makeOFConditionConst(EC_InvalidDICOMDIR, OFM_dcmdata, 40, OF_error, "Invalid DICOMDIR" ); +makeOFConditionConst(EC_UnknownVR, OFM_dcmdata, 41, OF_error, "Unknown VR: Tag not found in data dictionary" ); +makeOFConditionConst(EC_InvalidValue, OFM_dcmdata, 42, OF_error, "Invalid Value"); +makeOFConditionConst(EC_ItemNotFound, OFM_dcmdata, 43, OF_error, "Item not found"); +makeOFConditionConst(EC_UnknownTransferSyntax, OFM_dcmdata, 44, OF_error, "Unknown Transfer Syntax"); +makeOFConditionConst(EC_CannotCheck, OFM_dcmdata, 45, OF_error, "Cannot perform check"); +makeOFConditionConst(EC_MissingValue, OFM_dcmdata, 46, OF_error, "Missing value"); +makeOFConditionConst(EC_MissingAttribute, OFM_dcmdata, 47, OF_error, "Missing attribute"); +makeOFConditionConst(EC_InternalError, OFM_dcmdata, 48, OF_error, "Internal error"); +makeOFConditionConst(EC_InvalidCharacter, OFM_dcmdata, 49, OF_error, "Invalid character"); +// error code 50 is reserved for determine start fragment error messages (see below) +makeOFConditionConst(EC_UndefinedLengthOBOW, OFM_dcmdata, 51, OF_error, "Illegal element with OB or OW Value Representation and undefined length encountered"); +makeOFConditionConst(EC_VOI_LUT_OBOW, OFM_dcmdata, 52, OF_error, "Illegal VOI LUT Sequence element with OB or OW Value Representation and explicit length encountered"); +makeOFConditionConst(EC_PixelDataExplLengthIllegal, OFM_dcmdata, 53, OF_error, "Pixel data in top level dataset in compressed Transfer Syntax uses explicit length"); +makeOFConditionConst(EC_ElemLengthExceeds32BitField, OFM_dcmdata, 54, OF_error, "Length of element value exceeds maximum of 32-bit length field" ); + + +const unsigned short EC_CODE_CannotSelectCharacterSet = 35; +const unsigned short EC_CODE_CannotConvertCharacterSet = 36; +const unsigned short EC_CODE_CannotConvertToXML = 37; +const unsigned short EC_CODE_CannotDetermineStartFragment = 50; diff --git a/dcmdata/libsrc/dcfilefo.cc b/dcmdata/libsrc/dcfilefo.cc new file mode 100644 index 00000000..452ff97e --- /dev/null +++ b/dcmdata/libsrc/dcfilefo.cc @@ -0,0 +1,1121 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: class DcmFileFormat + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CTIME +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrul.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcvrae.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcmetinf.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ +#include "dcmtk/dcmdata/dcostrmf.h" /* for class DcmOutputFileStream */ +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcistrmf.h" /* for class DcmInputFileStream */ +#include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ +#include "dcmtk/dcmdata/dcjson.h" + + +// ******************************** + + +DcmFileFormat::DcmFileFormat() + : DcmSequenceOfItems(DCM_InternalUseTag), + FileReadMode(ERM_autoDetect) +{ + DcmMetaInfo *MetaInfo = new DcmMetaInfo(); + DcmSequenceOfItems::itemList->insert(MetaInfo); + MetaInfo->setParent(this); + + DcmDataset *Dataset = new DcmDataset(); + DcmSequenceOfItems::itemList->insert(Dataset); + Dataset->setParent(this); +} + + +DcmFileFormat::DcmFileFormat(DcmDataset *dataset, + OFBool deepCopy) + : DcmSequenceOfItems(DCM_InternalUseTag), + FileReadMode(ERM_autoDetect) +{ + DcmMetaInfo *MetaInfo = new DcmMetaInfo(); + DcmSequenceOfItems::itemList->insert(MetaInfo); + MetaInfo->setParent(this); + + DcmDataset* insertion; + if (dataset == NULL) + { + insertion = new DcmDataset(); + } + else if (deepCopy) + { + insertion = new DcmDataset(*dataset); + } + else // shallow copy + { + insertion = dataset; + } + insertion->setParent(this); + DcmSequenceOfItems::itemList->insert(insertion); +} + + +DcmFileFormat::DcmFileFormat(const DcmFileFormat &old) + : DcmSequenceOfItems(old), + FileReadMode(old.FileReadMode) +{ +} + + +OFCondition DcmFileFormat::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmFileFormat &, rhs); + } + return EC_Normal; +} + + +DcmFileFormat::~DcmFileFormat() +{ +} + + +DcmFileFormat &DcmFileFormat::operator=(const DcmFileFormat &obj) +{ + if (this != &obj) + { + DcmSequenceOfItems::operator=(obj); + FileReadMode = obj.FileReadMode; + } + + return *this; +} + + +// ******************************** + + +DcmEVR DcmFileFormat::ident() const +{ + return EVR_fileFormat; +} + + +// ******************************** + + +void DcmFileFormat::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + out << OFendl; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + printNestingLevel(out, flags, level); + out << "# Dicom-File-Format"; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_RESET; + out << OFendl; + if (!itemList->empty()) + { + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + dO->print(out, flags, level, pixelFileName, pixelCounter); + } while (itemList->seek(ELP_next)); + } else { + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + printNestingLevel(out, flags, level); + out << "# Dicom-File-Format has been erased"; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_RESET; + out << OFendl; + } +} + + +// ******************************** + + +OFCondition DcmFileFormat::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + OFCondition l_error = EC_Normal; + if (flags & DCMTypes::XF_useNativeModel) + { + /* in Native DICOM Model, there is no concept of a "file format" */ + DcmDataset *dset = getDataset(); + if (dset != NULL) + { + /* write content of dataset */ + l_error = dset->writeXML(out, flags); + } else { + l_error = makeOFCondition(OFM_dcmdata, EC_CODE_CannotConvertToXML, OF_error, + "Cannot convert to Native DICOM Model: No data set present"); + } + } else { + /* XML start tag for "file-format" */ + out << "" << OFendl; + /* write content of file meta information and dataset */ + if (!itemList->empty()) + { + /* write content of all children */ + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + l_error = dO->writeXML(out, flags & ~DCMTypes::XF_useXMLNamespace); + } while (l_error.good() && itemList->seek(ELP_next)); + } else { + /* a file format should never be empty */ + l_error = EC_CorruptedData; + } + if (l_error.good()) + { + /* XML end tag for "file-format" */ + out << "" << OFendl; + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmFileFormat::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + if (format.printMetaheaderInformation) + { + if (!itemList->empty()) + { + out << format.indent() << "{" << format.newline(); + // write content of all children (DcmObject) + itemList->seek(ELP_first); + OFCondition status = EC_Normal; + status = itemList->get()->writeJson(out, format); + while (status.good() && itemList->seek(ELP_next)) + { + out << "," << format.newline(); + status = itemList->get()->writeJson(out, format); + } + out << format.newline() << format.indent() << "}" << format.newline(); + return status; + } + else + { + return EC_CorruptedData; + } + } + else + { + if (DcmDataset *dset = getDataset()) + { + out << format.indent() << "{" << format.newline(); + OFCondition status = EC_Normal; + // write content of dataset + status = dset->writeJson(out, format); + out << format.newline() << format.indent() << "}" << format.newline(); + return status; + } + else + { + out << format.indent() << "{}" << format.newline(); + return EC_Normal; + } + } + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmFileFormat::checkMetaHeaderValue(DcmMetaInfo *metainfo, + DcmDataset *dataset, + const DcmTagKey &atagkey, + DcmObject *obj, + const E_TransferSyntax oxfer, + const E_FileWriteMode writeMode) + /* + * This function checks if a particular data element of the file meta information header is + * existent. If the element is not existent, it will be inserted. Additionally, this function + * makes sure that the corresponding data element will contain a correct value. + * + * Parameters: + * metainfo - [in] The meta header information. + * dataset - [in] The data set information. + * atagkey - [in] Tag of the data element which shall be checked. + * obj - [in] Data object from metainfo which represents the data element that shall be checked. + * Equals NULL, if this data element is not existent in the meta header information. + * oxfer - [in] The transfer syntax which shall be used. + * writeMode - [in] Flag indicating whether to update the file meta information or not. + */ +{ + /* initialize result value */ + OFCondition l_error = EC_Normal; + + /* if there is meta header information and also data set information, do something */ + if ((metainfo != NULL) && (dataset != NULL)) + { + /* initialize variables */ + DcmStack stack; + DcmTag tag(atagkey); + if (obj != NULL) + tag = obj->getTag(); + + DcmTagKey xtag = tag.getXTag(); + DcmElement *elem = OFstatic_cast(DcmElement *, obj); + + /* go ahead and scrutinize one particular data element (depending on xtag) */ + if (xtag == DCM_FileMetaInformationGroupLength) // (0002,0000) + { + if (elem == NULL) + { + elem = new DcmUnsignedLong(tag); + metainfo->insert(elem, OFTrue); + } + Uint32 temp = 0; + if ((elem->getLength() == 0) && (elem->ident() == EVR_UL)) + OFstatic_cast(DcmUnsignedLong *, elem)->putUint32Array(&temp, 1); + // the calculation of actual group length value is contained in validateMetaInfo() + } + else if (xtag == DCM_FileMetaInformationVersion) // (0002,0001) + { + if (elem == NULL) + { + elem = new DcmOtherByteOtherWord(tag); + metainfo->insert(elem, OFTrue); + } + // supported version of this implementation: 00\01 + Uint8 version[2] = {0, 1}; + if ((elem->getLength() == 0) && (elem->ident() == EVR_OB)) + OFstatic_cast(DcmOtherByteOtherWord *, elem)->putUint8Array(version, 2); + + // check version of meta header + Uint8 *currVers = NULL; + l_error = OFstatic_cast(DcmOtherByteOtherWord *, elem)->getUint8Array(currVers); + if (l_error.good() && (currVers != NULL)) + { + // the version information is stored in a bit field + if (((currVers[0] & version[0] & 0xff) == version[0]) && + ((currVers[1] & version[1] & 0xff) == version[1])) + { + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() Version of MetaHeader is ok: 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(2) << OFstatic_cast(int, currVers[0]) + << STD_NAMESPACE setw(2) << OFstatic_cast(int, currVers[1])); + } else { + DCMDATA_WARN ("DcmFileFormat: Unknown Version of MetaHeader detected: 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(2) << OFstatic_cast(int, currVers[0]) + << STD_NAMESPACE setw(2) << OFstatic_cast(int, currVers[1]) + << ", supported: 0x" + << STD_NAMESPACE setw(2) << OFstatic_cast(int, version[0]) + << STD_NAMESPACE setw(2) << OFstatic_cast(int, version[1])); + } + } else { + DCMDATA_ERROR("DcmFileFormat: Cannot determine Version of MetaHeader"); + } + } + else if (xtag == DCM_MediaStorageSOPClassUID) // (0002,0002) + { + if (elem == NULL) + { + elem = new DcmUniqueIdentifier(tag); + metainfo->insert(elem, OFTrue); + } + if (elem->ident() == EVR_UI) + { + if ((writeMode == EWM_updateMeta) || (elem->getLength() == 0)) + { + if (dataset->search(DCM_SOPClassUID, stack).good()) + { + char *uid = NULL; + l_error = OFstatic_cast(DcmUniqueIdentifier *, stack.top())->getString(uid); + OFstatic_cast(DcmUniqueIdentifier *, elem)->putString(uid); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() use SOPClassUID [" << uid << "] from Dataset"); + } + else if (elem->getLength() == 0) + { + OFstatic_cast(DcmUniqueIdentifier *, elem)->putString(UID_PrivateGenericFileSOPClass); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() no SOPClassUID in Dataset, using PrivateGenericFileSOPClass"); + } + } + else if (DCM_dcmdataLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + { + // check whether UID in meta-header is identical to the one in the dataset + if (dataset->search(DCM_SOPClassUID, stack).good()) + { + OFString uidDataset, uidMetaHeader; + OFstatic_cast(DcmUniqueIdentifier *, stack.top())->getOFStringArray(uidDataset); + OFstatic_cast(DcmUniqueIdentifier *, elem)->getOFStringArray(uidMetaHeader); + if (uidDataset != uidMetaHeader) + { + DCMDATA_WARN("DcmFileFormat: Value of SOPClassUID in MetaHeader and Dataset is different"); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() value of MediaStorageSOPClassUID (MetaHeader) [" << uidMetaHeader << "]"); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() value of SOPClassUID (Dataset) [" << uidDataset << "]"); + } + } + } + } + } + else if (xtag == DCM_MediaStorageSOPInstanceUID) // (0002,0003) + { + if (elem == NULL) + { + elem = new DcmUniqueIdentifier(tag); + metainfo->insert(elem, OFTrue); + } + if (elem->ident() == EVR_UI) + { + if ((writeMode == EWM_updateMeta) || (elem->getLength() == 0)) + { + if (dataset->search(DCM_SOPInstanceUID, stack).good()) + { + char* uid = NULL; + l_error = OFstatic_cast(DcmUniqueIdentifier *, stack.top())->getString(uid); + OFstatic_cast(DcmUniqueIdentifier *, elem)->putString(uid); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() use SOPInstanceUID [" << uid << "] from Dataset"); + } + else if (elem->getLength() == 0) + { + char uid[128]; + dcmGenerateUniqueIdentifier(uid); // from dcuid.h + OFstatic_cast(DcmUniqueIdentifier *, elem)->putString(uid); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() use new generated SOPInstanceUID [" << uid << "]"); + } + } + else if (DCM_dcmdataLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + { + // check whether UID in meta-header is identical to the one in the dataset + if (dataset->search(DCM_SOPInstanceUID, stack).good()) + { + OFString uidDataset, uidMetaHeader; + OFstatic_cast(DcmUniqueIdentifier *, stack.top())->getOFStringArray(uidDataset); + OFstatic_cast(DcmUniqueIdentifier *, elem)->getOFStringArray(uidMetaHeader); + if (uidDataset != uidMetaHeader) + { + DCMDATA_WARN("DcmFileFormat: Value of SOPInstanceUID in MetaHeader and Dataset is different"); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() value of MediaStorageSOPInstanceUID (MetaHeader) [" << uidMetaHeader << "]"); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() value of SOPInstanceUID (Dataset) [" << uidDataset << "]"); + } + } + } + } + } + else if (xtag == DCM_TransferSyntaxUID) // (0002,0010) + { + if (elem == NULL) + { + elem = new DcmUniqueIdentifier(tag); + metainfo->insert(elem, OFTrue); + } + if (elem->ident() == EVR_UI) + { +#ifdef DEBUG + char * uidtmp = NULL; + OFstatic_cast(DcmUniqueIdentifier *, elem)->getString(uidtmp); + if (uidtmp != NULL) + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() found old TransferSyntaxUID [" << uidtmp << "]"); +#endif + DcmXfer dcXfer(oxfer); + const char *uid = dcXfer.getXferID(); + elem->putString(uid); + DCMDATA_DEBUG("DcmFileFormat::checkMetaHeaderValue() use new TransferSyntaxUID [" + << dcXfer.getXferName() << "] on writing following Dataset"); + } + } + else if (xtag == DCM_ImplementationClassUID) // (0002,0012) + { + if (elem == NULL) + { + elem = new DcmUniqueIdentifier(tag); + metainfo->insert(elem, OFTrue); + } + if (elem->ident() == EVR_UI) + { + const char *uid = OFFIS_IMPLEMENTATION_CLASS_UID; + OFstatic_cast(DcmUniqueIdentifier *, elem)->putString(uid); + } + } + else if (xtag == DCM_ImplementationVersionName) // (0002,0013) + { + if (elem == NULL) + { + elem = new DcmShortString(tag); + metainfo->insert(elem, OFTrue); + } + if (elem->ident() == EVR_SH) + { + const char *uid = OFFIS_DTK_IMPLEMENTATION_VERSION_NAME; + OFstatic_cast(DcmShortString *, elem)->putString(uid); + } + } + else if ((xtag == DCM_SourceApplicationEntityTitle) || // (0002,0016) + (xtag == DCM_SendingApplicationEntityTitle) || // (0002,0017) + (xtag == DCM_ReceivingApplicationEntityTitle)) // (0002,0018) + { + if (elem == NULL) + { + elem = new DcmApplicationEntity(tag); + metainfo->insert(elem, OFTrue); + } + DCMDATA_WARN("DcmFileFormat: Don't know how to handle " << tag.getTagName()); + } + else if (xtag == DCM_PrivateInformationCreatorUID) // (0002,0100) + { + if (elem == NULL) + { + elem = new DcmUniqueIdentifier(tag); + metainfo->insert(elem, OFTrue); + } + DCMDATA_WARN("DcmFileFormat: Don't know how to handle PrivateInformationCreatorUID"); + } + else if (xtag == DCM_PrivateInformation) // (0002,0102) + { + if (elem == NULL) + { + elem = new DcmOtherByteOtherWord(tag); + metainfo->insert(elem, OFTrue); + } + DCMDATA_WARN("DcmFileFormat: Don't know how to handle PrivateInformation"); + } else + DCMDATA_ERROR("DcmFileFormat: Don't know how to handle " << tag.getTagName()); + + /* if at this point elem still equals NULL, something is fishy */ + if (elem == NULL) + l_error = EC_InvalidVR; + } else { + /* (i.e. there is either no meta header information or no data set information */ + l_error = EC_IllegalCall; + } + + /* return result value */ + return l_error; +} + + +// ******************************** + + +OFCondition DcmFileFormat::validateMetaInfo(const E_TransferSyntax oxfer, + const E_FileWriteMode writeMode) + /* + * This function makes sure that all data elements of the meta header information are existent + * in metainfo and contain correct values. + * + * Parameters: + * oxfer - [in] The transfer syntax which shall be used. + * writeMode - [in] Flag indicating whether to update the file meta information or not. + */ +{ + /* initialize some variables */ + OFCondition l_error = EC_Normal; + DcmMetaInfo *metinf = getMetaInfo(); + DcmDataset *datset = getDataset(); + + /* if there is meta header information and data set information, do something */ + if (metinf != NULL && datset != NULL) + { + if (writeMode == EWM_dontUpdateMeta) + { + DCMDATA_WARN("DcmFileFormat: Meta Information Header is not updated!"); + } else { + /* start with empty file meta information */ + if (writeMode == EWM_createNewMeta) + metinf->clear(); + + /* in the following, we want to make sure all elements of the meta header */ + /* are existent in metinf and contain correct values */ + DcmStack stack; + + /* DCM_FileMetaInformationGroupLength */ + metinf->search(DCM_FileMetaInformationGroupLength, stack, ESM_fromHere, OFFalse); + checkMetaHeaderValue(metinf, datset, DCM_FileMetaInformationGroupLength, stack.top(), oxfer, writeMode); + + /* DCM_FileMetaInformationVersion */ + metinf->search(DCM_FileMetaInformationVersion, stack, ESM_fromHere, OFFalse); + checkMetaHeaderValue(metinf, datset, DCM_FileMetaInformationVersion, stack.top(), oxfer, writeMode); + + /* DCM_MediaStorageSOPClassUID */ + metinf->search(DCM_MediaStorageSOPClassUID, stack, ESM_fromHere, OFFalse); + checkMetaHeaderValue(metinf, datset, DCM_MediaStorageSOPClassUID, stack.top(), oxfer, writeMode); + + /* DCM_MediaStorageSOPInstanceUID */ + metinf->search(DCM_MediaStorageSOPInstanceUID, stack, ESM_fromHere, OFFalse); + checkMetaHeaderValue(metinf, datset, DCM_MediaStorageSOPInstanceUID, stack.top(), oxfer, writeMode); + + /* DCM_TransferSyntaxUID */ + metinf->search(DCM_TransferSyntaxUID, stack, ESM_fromHere, OFFalse); + checkMetaHeaderValue(metinf, datset, DCM_TransferSyntaxUID, stack.top(), oxfer, writeMode); + + /* DCM_ImplementationClassUID */ + metinf->search(DCM_ImplementationClassUID, stack, ESM_fromHere, OFFalse); + checkMetaHeaderValue(metinf, datset, DCM_ImplementationClassUID, stack.top(), oxfer, writeMode); + + /* DCM_ImplementationVersionName */ + metinf->search(DCM_ImplementationVersionName, stack, ESM_fromHere, OFFalse); + checkMetaHeaderValue(metinf, datset, DCM_ImplementationVersionName, stack.top(), oxfer, writeMode); + + /* dump some information if required */ + DCMDATA_DEBUG("DcmFileFormat::validateMetaInfo() found " << metinf->card() << " Elements in DcmMetaInfo 'metinf'"); + + /* calculate new GroupLength for meta header */ + if (metinf->computeGroupLengthAndPadding(EGL_withGL, EPD_noChange, + META_HEADER_DEFAULT_TRANSFERSYNTAX, EET_UndefinedLength).bad()) + { + DCMDATA_ERROR("DcmFileFormat: Group length of Meta Information Header not adapted"); + } + } + } else { + /* (i.e. there is either no meta header information or no data set information, or both are missing) */ + l_error = EC_CorruptedData; + } + + /* return result value */ + return l_error; +} + + + +// ******************************** + + +E_TransferSyntax DcmFileFormat::lookForXfer(DcmMetaInfo *metainfo) +{ + E_TransferSyntax newxfer = EXS_Unknown; + DcmStack stack; + /* check whether meta header is present (and non-empty, i.e. contains elements) */ + if (metainfo && !metainfo->isEmpty()) + { + if (metainfo->search(DCM_TransferSyntaxUID, stack).good()) + { + DcmUniqueIdentifier *xferUI = OFstatic_cast(DcmUniqueIdentifier *, stack.top()); + if (xferUI->getTag().getXTag() == DCM_TransferSyntaxUID) + { + char *xferid = NULL; + xferUI->getString(xferid); + DcmXfer localXfer(xferid); // decode to E_TransferSyntax + newxfer = localXfer.getXfer(); + DCMDATA_TRACE("DcmFileFormat::lookForXfer() TransferSyntax=\"" + << localXfer.getXferName() << "\" in MetaInfo"); + } + } else { + /* there is no transfer syntax UID element in the meta header */ + DCMDATA_DEBUG("DcmFileFormat::lookForXfer() no TransferSyntax in MetaInfo"); + } + } else { + /* no meta header present at all (or it is empty, i.e. contains no elements) */ + DCMDATA_DEBUG("DcmFileFormat::lookForXfer() no MetaInfo found"); + } + return newxfer; +} + + +// ******************************** + + +Uint32 DcmFileFormat::calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + return getMetaInfo()->calcElementLength(xfer, enctype) + + getDataset()->calcElementLength(xfer, enctype); +} + + +// ******************************** + + +OFBool DcmFileFormat::canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer) +{ + DcmDataset *dataset = getDataset(); + + if (dataset) + return dataset->canWriteXfer(newXfer, oldXfer); + else + return OFFalse; +} + + +// ******************************** + + +OFCondition DcmFileFormat::read(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + return DcmFileFormat::readUntilTag(inStream,xfer,glenc,maxReadLength,DCM_UndefinedTagKey); +} + +OFCondition DcmFileFormat::readUntilTag(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength, + const DcmTagKey &stopParsingAtElement) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + errorFlag = inStream.status(); + + E_TransferSyntax newxfer = xfer; + DcmDataset *dataset = NULL; + + if (errorFlag.good() && inStream.eos()) + errorFlag = EC_EndOfStream; + else if (errorFlag.good() && getTransferState() != ERW_ready) + { + // the new data is added to the end + itemList->seek(ELP_last); + + DcmMetaInfo *metaInfo = getMetaInfo(); + if (metaInfo == NULL && getTransferState() == ERW_init) + { + metaInfo = new DcmMetaInfo(); + itemList->insert(metaInfo, ELP_first); + // remember the parent + metaInfo->setParent(this); + } + if (metaInfo && metaInfo->transferState() != ERW_ready) + { + // do read meta header not in given transfer syntax (always Little Endian Explicit) + errorFlag = metaInfo->read(inStream, EXS_Unknown, glenc, maxReadLength); + } + + // determine xfer from tag (0002,0010) in the meta header + newxfer = lookForXfer(metaInfo); + if ((FileReadMode == ERM_fileOnly) || (FileReadMode == ERM_metaOnly)) + { + // reject file if no meta header present + if (errorFlag.good() && (newxfer == EXS_Unknown)) + errorFlag = EC_FileMetaInfoHeaderMissing; + } + if (errorFlag.good() && (!metaInfo || metaInfo->transferState() == ERW_ready)) + { + dataset = getDataset(); + if (dataset == NULL && getTransferState() == ERW_init) + { + dataset = new DcmDataset(); + itemList->seek (ELP_first); + itemList->insert(dataset, ELP_next); + // remember the parent + dataset->setParent(this); + } + // check whether to read the dataset at all + if (FileReadMode != ERM_metaOnly) + { + if (dataset && dataset->transferState() != ERW_ready) + { + errorFlag = dataset->readUntilTag(inStream, newxfer, glenc, maxReadLength, stopParsingAtElement); + } + } + } + } + if (getTransferState() == ERW_init) + setTransferState(ERW_inWork); + + if (dataset && dataset->transferState() == ERW_ready) + setTransferState(ERW_ready); + } + return errorFlag; +} // DcmFileFormat::readUntilTag() + + +// ******************************** + + +OFCondition DcmFileFormat::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + return write(outStream, oxfer, enctype, wcache, EGL_recalcGL, EPD_noChange); +} + + +OFCondition DcmFileFormat::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache, + const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc, + const Uint32 padlen, + const Uint32 subPadlen, + Uint32 instanceLength, + const E_FileWriteMode writeMode) + /* + * This function writes data values which are contained in this to the stream which is + * passed as first argument. With regard to the writing of information, the other parameters + * which are passed are accounted for. The function will return EC_Normal, if the information + * from all elements of this data set has been written to the buffer, and it will return some + * other (error) value if there was an error. + * + * Parameters: + * outStream - [inout] The stream that the information will be written to. + * oxfer - [in] The transfer syntax which shall be used. + * enctype - [in] Encoding type for sequences. Specifies how sequences will be handled. + * glenc - [in] Encoding type for group length. Specifies what will be done with group length tags. + * padenc - [in] Encoding type for padding. Specifies what will be done with padding tags. + * padlen - [in] The length up to which the dataset shall be padded, if padding is desired. + * subPadlen - [in] For sequences (i.e. sub elements), the length up to which item shall be padded, + * if padding is desired. + * instanceLength - [in] Number of extra bytes added to the item/dataset length used when computing the + * padding. This parameter is for instance used to pass the length of the file meta + * header from the DcmFileFormat to the DcmDataset object. + * writeMode - [in] Write file with or without meta header. Also allows for updating the information + * in the file meta information header. + */ +{ + /* if the transfer state of this is not initialized, this is an illegal call */ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* if this is not an illegal call, do something */ + + /* assign data set and the meta information header to local variables */ + DcmDataset *dataset = getDataset(); + DcmMetaInfo *metainfo = getMetaInfo(); + /* Determine the transfer syntax which shall be used. Either we use the one which was passed, */ + /* or (if it's an unknown transfer syntax) we use the data set's original transfer syntax. */ + E_TransferSyntax outxfer = oxfer; + if (outxfer == EXS_Unknown && dataset) + outxfer = dataset->getOriginalXfer(); + /* check if the stream reported an error so far */ + errorFlag = outStream.status(); + /* check if we can actually write data to the stream; in certain cases we cannot. */ + if (outxfer == EXS_Unknown || outxfer == EXS_BigEndianImplicit) + errorFlag = EC_IllegalCall; + else if (itemList->empty()) + errorFlag = EC_CorruptedData; + else if (errorFlag.good() && getTransferState() != ERW_ready) + { + /* in this case we can write data to the stream */ + + /* if this function was called for the first time for the dataset object, the transferState is */ + /* still set to ERW_init. In this case, we need to validate the meta header information, set the */ + /* item list pointer to the fist element and we need to set the transfer state to ERW_inWork. */ + if (getTransferState() == ERW_init) + { + validateMetaInfo(outxfer, writeMode); + itemList->seek(ELP_first); + setTransferState(ERW_inWork); + } + /* if the transfer state is set to ERW_inWork, we need to write the */ + /* information which is included in this to the buffer which was passed. */ + if (getTransferState() == ERW_inWork) + { + /* write meta header information */ + errorFlag = metainfo->write(outStream, outxfer, enctype, wcache); + /* recalculate the instance length */ + instanceLength += metainfo->calcElementLength(outxfer, enctype); + /* if everything is ok, write the data set */ + if (errorFlag.good()) + errorFlag = dataset->write(outStream, outxfer, enctype, wcache, glenc, padenc, padlen, + subPadlen, instanceLength); + /* if everything is ok, set the transfer state to ERW_ready */ + if (errorFlag.good()) + setTransferState(ERW_ready); + } + } + /* in case the transfer syntax which shall be used is indeed the */ + /* BigEndianImplicit transfer syntax dump some error information */ + if (outxfer == EXS_BigEndianImplicit) + DCMDATA_ERROR("DcmFileFormat: Illegal TransferSyntax (BigEndianImplicit) used in write method"); + } + /* return result value */ + return errorFlag; +} + + +// ******************************** + +OFCondition DcmFileFormat::loadFile(const OFFilename &fileName, + const E_TransferSyntax readXfer, + const E_GrpLenEncoding groupLength, + const Uint32 maxReadLength, + const E_FileReadMode readMode) +{ + return DcmFileFormat::loadFileUntilTag(fileName, readXfer, groupLength, maxReadLength, readMode, DCM_UndefinedTagKey); +} + + +OFCondition DcmFileFormat::loadFileUntilTag( + const OFFilename &fileName, + const E_TransferSyntax readXfer, + const E_GrpLenEncoding groupLength, + const Uint32 maxReadLength, + const E_FileReadMode readMode, + const DcmTagKey &stopParsingAtElement) +{ + if (readMode == ERM_dataset) + return getDataset()->loadFileUntilTag(fileName, readXfer, groupLength, maxReadLength, stopParsingAtElement); + + OFCondition l_error = EC_InvalidFilename; + /* check parameters first */ + if (!fileName.isEmpty()) + { + /* open file for input */ + DcmInputFileStream fileStream(fileName); + /* check stream status */ + l_error = fileStream.status(); + if (l_error.good()) + { + /* clear this object */ + l_error = clear(); + if (l_error.good()) + { + /* save old value */ + const E_FileReadMode oldMode = FileReadMode; + FileReadMode = readMode; + /* read data from file */ + transferInit(); + l_error = readUntilTag(fileStream, readXfer, groupLength, maxReadLength, stopParsingAtElement); + transferEnd(); + /* restore old value */ + FileReadMode = oldMode; + } + } + } + return l_error; +} + + +OFCondition DcmFileFormat::saveFile(const OFFilename &fileName, + const E_TransferSyntax writeXfer, + const E_EncodingType encodingType, + const E_GrpLenEncoding groupLength, + const E_PaddingEncoding padEncoding, + const Uint32 padLength, + const Uint32 subPadLength, + const E_FileWriteMode writeMode) +{ + if (writeMode == EWM_dataset) + { + return getDataset()->saveFile(fileName, writeXfer, encodingType, groupLength, + padEncoding, padLength, subPadLength); + } + OFCondition l_error = EC_InvalidFilename; + /* check parameters first */ + if (!fileName.isEmpty()) + { + DcmWriteCache wcache; + + /* open file for output */ + DcmOutputFileStream fileStream(fileName); + + /* check stream status */ + l_error = fileStream.status(); + if (l_error.good()) + { + /* write data to file */ + transferInit(); + l_error = write(fileStream, writeXfer, encodingType, &wcache, groupLength, + padEncoding, padLength, subPadLength, 0 /*instanceLength*/, writeMode); + transferEnd(); + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmFileFormat::insertItem(DcmItem * /*item*/, + const unsigned long /*where*/) +{ + DCMDATA_WARN("Illegal call of DcmFileFormat::insert(DcmItem *, unsigned long)"); + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +void DcmFileFormat::removeInvalidGroups() +{ + getMetaInfo()->removeInvalidGroups(); + getDataset()->removeInvalidGroups(); +} + + +// ******************************** + + +DcmItem *DcmFileFormat::remove(const unsigned long /*num*/) +{ + DCMDATA_WARN("Illegal call of DcmFileFormat::remove(unsigned long)"); + errorFlag = EC_IllegalCall; + return NULL; +} + + +// ******************************** + + +DcmItem *DcmFileFormat::remove(DcmItem* /*item*/) +{ + DCMDATA_WARN("Illegal call of DcmFileFormat::remove(DcmItem *)"); + errorFlag = EC_IllegalCall; + return NULL; +} + + +// ******************************** + + +OFCondition DcmFileFormat::clear() +{ + getMetaInfo()->clear(); + return getDataset()->clear(); +} + + +// ******************************** + + +DcmMetaInfo *DcmFileFormat::getMetaInfo() +{ + errorFlag = EC_Normal; + DcmMetaInfo *meta = NULL; + if (itemList->seek_to(0) != NULL && itemList->get()->ident() == EVR_metainfo) + meta = OFstatic_cast(DcmMetaInfo *, itemList->get()); + else + errorFlag = EC_IllegalCall; + return meta; +} + + +// ******************************** + + +DcmDataset *DcmFileFormat::getDataset() +{ + errorFlag = EC_Normal; + DcmDataset *data = NULL; + if (itemList->seek_to(1) != NULL && itemList->get()->ident() == EVR_dataset) + data = OFstatic_cast(DcmDataset *, itemList->get()); + else + errorFlag = EC_IllegalCall; + return data; +} + + +// ******************************** + + +DcmDataset *DcmFileFormat::getAndRemoveDataset() +{ + errorFlag = EC_Normal; + DcmDataset *data = NULL; + if (itemList->seek_to(1) != NULL && itemList->get()->ident() == EVR_dataset) + { + data = OFstatic_cast(DcmDataset *, itemList->remove()); + // forget about the parent + data->setParent(NULL); + DcmDataset *Dataset = new DcmDataset(); + DcmSequenceOfItems::itemList->insert(Dataset, ELP_last); + // remember the parent + Dataset->setParent(this); + } + else + errorFlag = EC_IllegalCall; + return data; +} + + +// ******************************** + + +OFCondition DcmFileFormat::convertCharacterSet(const OFString &fromCharset, + const OFString &toCharset, + const size_t flags) +{ + // convert the dataset associated with this object + return getDataset()->convertCharacterSet(fromCharset, toCharset, flags); +} + + +OFCondition DcmFileFormat::convertCharacterSet(const OFString &toCharset, + const size_t flags) +{ + OFString sopClass; + OFBool ignoreCharset = OFFalse; + // check whether this dataset belongs to a DICOMDIR, + // because the Basic Directory IOD has no SOP Common Module + if (getMetaInfo()->findAndGetOFString(DCM_MediaStorageSOPClassUID, sopClass).good() && + (sopClass == UID_MediaStorageDirectoryStorage)) + { + DCMDATA_DEBUG("DcmFileFormat::convertCharacterSet() according to the value of MediaStorageSOPClassUID " + << DCM_MediaStorageSOPClassUID << " this is a DICOMDIR, which has no SOP Common Module"); + ignoreCharset = OFTrue; + } + // usually, we check for Specific Character Set (0008,0005) element in the dataset + return getDataset()->convertCharacterSet(toCharset, flags, ignoreCharset); +} + + +OFCondition DcmFileFormat::convertCharacterSet(DcmSpecificCharacterSet &converter) +{ + // convert the dataset associated with this object + return getDataset()->convertCharacterSet(converter); +} + + +OFCondition DcmFileFormat::convertToUTF8() +{ + // the DICOM defined term "ISO_IR 192" is used for "UTF-8" + return convertCharacterSet("ISO_IR 192", 0 /*flags*/); +} diff --git a/dcmdata/libsrc/dcfilter.cc b/dcmdata/libsrc/dcfilter.cc new file mode 100644 index 00000000..001a1019 --- /dev/null +++ b/dcmdata/libsrc/dcfilter.cc @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Jan Schlamelcher + * + * Purpose: Implementation of DcmAttributeFilter + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcfilter.h" + + +class DcmAttributeFilter::SingleValueFilter : public FilterInterface +{ +public: + SingleValueFilter( const OFString& value ) + : m_Value( value ) + { + + } + + virtual OFBool apply( const OFString& value ) + { + return m_Value == value; + } + +private: + const OFString m_Value; +}; + +DcmAttributeFilter::DcmAttributeFilter() +: m_Tag(), m_pFilter( NULL ) +{ + +} + +DcmAttributeFilter::DcmAttributeFilter( const DcmTagKey& tag, const OFString& value ) +: m_Tag( tag ), m_pFilter( new SingleValueFilter( value ) ) +{ + +} + +DcmAttributeFilter::DcmAttributeFilter( const DcmTagKey& tag, const char* const value ) +: m_Tag( tag ), m_pFilter( new SingleValueFilter( value ) ) +{ + +} + +DcmAttributeFilter::~DcmAttributeFilter() +{ + delete m_pFilter; +} + +OFBool DcmAttributeFilter::apply( DcmItem& item ) const +{ + if( m_pFilter ) + { + OFString value; + return item.findAndGetOFStringArray( m_Tag, value ).good() + && m_pFilter->apply( value ); + } + else return true; +} + +OFBool DcmAttributeFilter::operator()( DcmItem& item ) const +{ + return apply( item ); +} + +OFBool DcmAttributeFilter::apply( DcmFileFormat& dcmfile ) const +{ + DcmDataset* const dataset = dcmfile.getDataset(); + return dataset && apply( *dataset ); +} + +OFBool DcmAttributeFilter::operator()( DcmFileFormat& dcmfile ) const +{ + return apply( dcmfile ); +} diff --git a/dcmdata/libsrc/dchashdi.cc b/dcmdata/libsrc/dchashdi.cc new file mode 100644 index 00000000..010b9f62 --- /dev/null +++ b/dcmdata/libsrc/dchashdi.cc @@ -0,0 +1,410 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Hash table interface for DICOM data dictionary + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dchashdi.h" +#include "dcmtk/dcmdata/dcdicent.h" +#include "dcmtk/dcmdata/dctypes.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CASSERT +#include "dcmtk/ofstd/ofstdinc.h" + +/* +** DcmDictEntryList +*/ + +DcmDictEntryList::~DcmDictEntryList() +{ + clear(); +} + +void +DcmDictEntryList::clear() +{ + while (!empty()) { + delete list_.front(); + list_.pop_front(); + } +} + +DcmDictEntry* +DcmDictEntryList::insertAndReplace(DcmDictEntry* entry) +{ + if (empty()) { + list_.push_front(entry); + } else { + DcmDictEntryListIterator iter(begin()); + DcmDictEntryListIterator last(end()); + Uint32 eHash = entry->hash(); + Uint32 iterHash = 0; + // insert smallest first + for (iter = begin(); iter != last; ++iter) { + iterHash = (*iter)->hash(); + if (eHash == iterHash) + { + if (entry->privateCreatorMatch(**iter)) + { + // entry is already there so replace it + DcmDictEntry* oldEntry = *iter; + *iter = entry; + return oldEntry; + } + else + { + // insert before listEntry + insert(iter, entry); + return NULL; + } + } + else if (eHash < iterHash) + { + // insert before listEntry + insert(iter, entry); + return NULL; + } + } + // add to end + push_back(entry); + } + return NULL; +} + + +DcmDictEntry *DcmDictEntryList::find(const DcmTagKey& key, const char *privCreator) +{ + if (!empty()) { + DcmDictEntryListIterator iter; + DcmDictEntryListIterator last = end(); + Uint32 kHash = key.hash(); + Uint32 iterHash = 0; + for (iter = begin(); iter != last; ++iter) { + iterHash = (*iter)->hash(); + if ((iterHash == kHash) && (*iter)->privateCreatorMatch(privCreator)) + { + return *iter; + } else if (iterHash > kHash) { + return NULL; // not there + } + } + } + return NULL; +} + +unsigned int +DcmDictEntryList::size() const +{ + return OFstatic_cast(unsigned int, list_.size()); +} + +OFBool +DcmDictEntryList::empty() const +{ + return list_.empty(); +} + +DcmDictEntryListIterator +DcmDictEntryList::begin() +{ + return list_.begin(); +} + +DcmDictEntryListIterator +DcmDictEntryList::end() +{ + return list_.end(); +} + +DcmDictEntryListConstIterator +DcmDictEntryList::begin() const +{ + return list_.begin(); +} + +DcmDictEntryListConstIterator +DcmDictEntryList::end() const +{ + return list_.end(); +} + +DcmDictEntryListIterator +DcmDictEntryList::insert(DcmDictEntryListIterator position, DcmDictEntry *entry) +{ + return list_.insert(position, entry); +} + +void +DcmDictEntryList::remove(DcmDictEntry *entry) +{ + list_.remove(entry); +} + +void +DcmDictEntryList::push_back(DcmDictEntry *entry) +{ + list_.push_back(entry); +} + +/* +** DcmHashDictIterator +*/ + +void +DcmHashDictIterator::init(const DcmHashDict* d, OFBool atEnd) +{ + dict = d; + hindex = 0; + iterating = OFFalse; + if (dict != NULL) { + if (atEnd || dict->size() == 0) { + hindex = dict->highestBucket; + if (dict->size() > 0) { + iter = dict->hashTab[hindex]->end(); + iterating = OFTrue; + } + } else { + hindex = dict->lowestBucket; + iter = dict->hashTab[hindex]->begin(); + iterating = OFTrue; + } + } +} + +void +DcmHashDictIterator::stepUp() +{ + assert(dict != NULL); + + while (hindex <= dict->highestBucket) { + DcmDictEntryList* bucket = dict->hashTab[hindex]; + if (bucket == NULL) { + if (hindex == dict->highestBucket) + return; /* We reached the end of the dictionary */ + hindex++; // move on to next bucket + iterating = OFFalse; + } else { + if (!iterating) { + iter = bucket->begin(); + iterating = OFTrue; + if (iter != bucket->end()) { + return; /* we have found the next one */ + } + } + if (iter == bucket->end()) { + if (hindex == dict->highestBucket) + return; /* We reached the end of the dictionary */ + iterating = OFFalse; + hindex++; + } else { + ++iter; + if (iter != bucket->end()) { + return; /* we have found the next one */ + } + } + } + } +} + + +/* +** DcmHashDict +*/ + +// This number shouldn't have any small factors, so that +// DcmHashDict::hash() produces fewer collisions. +const int DcmHashDict::hashTabLength = 2011; + +void +DcmHashDict::_init() +{ + hashTab = new DcmDictEntryList*[hashTabLength]; + assert(hashTab != NULL); + for (int i=0; ihash(); + + // If there is a private creator, hash that in, too + for (; privCreator != NULL && *privCreator != '\0'; privCreator++) { + h ^= *privCreator << ((++i & 3) << 3); + } + + // This 'hash function' only works well if hashTabLength is prime + int res = h % hashTabLength; + + assert((res >= 0) && (res < hashTabLength)); + + return res; +} + +DcmDictEntry* +DcmHashDict::insertInList(DcmDictEntryList& l, DcmDictEntry* entry) +{ + return l.insertAndReplace(entry); +} + +void +DcmHashDict::put(DcmDictEntry* entry) +{ + int idx = hash(entry, entry->getPrivateCreator()); + + DcmDictEntryList* bucket = hashTab[idx]; + // if there is no bucket then create one + if (bucket == NULL) { + bucket = new DcmDictEntryList; + assert(bucket != NULL); + hashTab[idx] = bucket; + } + + DcmDictEntry* old = insertInList(*bucket, entry); + if (old != NULL) { + /* an old entry has been replaced */ +#ifdef PRINT_REPLACED_DICTIONARY_ENTRIES + DCMDATA_WARN("replacing " << *old); +#endif + delete old; + } else { + entryCount++; + } + + lowestBucket = (lowestBucketidx)?(highestBucket):(idx); +} + +DcmDictEntry *DcmHashDict::findInList(DcmDictEntryList& l, const DcmTagKey& key, const char *privCreator) const +{ + return l.find(key, privCreator); +} + +const DcmDictEntry* +DcmHashDict::get(const DcmTagKey& key, const char *privCreator) const +{ + const DcmDictEntry* entry = NULL; + + // first we look for an entry that exactly matches the given tag key + Uint32 idx = hash(&key, privCreator); + DcmDictEntryList* bucket = hashTab[idx]; + if (bucket) entry = findInList(*bucket, key, privCreator); + + if ((entry == NULL) && privCreator) + { + // As a second guess, we look for a private tag with flexible element number. + DcmTagKey tk(key.getGroup(), OFstatic_cast(unsigned short, key.getElement() & 0xff)); + idx = hash(&tk, privCreator); + bucket = hashTab[idx]; + if (bucket) entry = findInList(*bucket, tk, privCreator); + } + + return entry; +} + +DcmDictEntry* +DcmHashDict::removeInList(DcmDictEntryList& l, const DcmTagKey& key, const char *privCreator) +{ + DcmDictEntry* entry = findInList(l, key, privCreator); + l.remove(entry); // does not delete entry + return entry; +} + +void +DcmHashDict::del(const DcmTagKey& key, const char *privCreator) +{ + Uint32 idx = hash(&key, privCreator); + + DcmDictEntryList* bucket = hashTab[idx]; + if (bucket != NULL) { + DcmDictEntry* entry = removeInList(*bucket, key, privCreator); + delete entry; + } +} + +STD_NAMESPACE ostream& +DcmHashDict::loadSummary(STD_NAMESPACE ostream& out) +{ + out << "DcmHashDict: size=" << hashTabLength << + ", total entries=" << size() << OFendl; + DcmDictEntryList* bucket = NULL; + int largestBucket = 0; + for (int i=0; isize()) > largestBucket) { + largestBucket = bucket->size(); + } + } + } + + for (int j=0; jsize() << " entries" << OFendl; + } + } + out << "Bucket Sizes" << OFendl; + int n, x, k, l_size; + for (x=0; x<=largestBucket; x++) { + n = 0; + for (k=0; ksize(); + } + if (l_size == x) { + n++; + } + } + out << " entries{" << x << "}: " << n << " buckets" << OFendl; + } + + return out; +} diff --git a/dcmdata/libsrc/dcistrma.cc b/dcmdata/libsrc/dcistrma.cc new file mode 100644 index 00000000..b61a79b7 --- /dev/null +++ b/dcmdata/libsrc/dcistrma.cc @@ -0,0 +1,125 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: base classes for input streams + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcistrma.h" +#include "dcmtk/dcmdata/dcistrmz.h" /* for DcmZLibInputFilter */ +#include "dcmtk/dcmdata/dcerror.h" /* for EC_IllegalCall */ + +DcmInputStream::DcmInputStream(DcmProducer *initial) +: current_(initial) +, compressionFilter_(NULL) +, tell_(0) +, mark_(0) +{ +} + +DcmInputStream::~DcmInputStream() +{ + // we cannot access the stream anymore at this point because the + // producer has most probably already been deleted. + delete compressionFilter_; +} + +OFBool DcmInputStream::good() const +{ + return current_->good(); +} + +OFCondition DcmInputStream::status() const +{ + return current_->status(); +} + +OFBool DcmInputStream::eos() +{ + return current_->eos(); +} + +offile_off_t DcmInputStream::avail() +{ + return current_->avail(); +} + +offile_off_t DcmInputStream::read(void *buf, offile_off_t buflen) +{ + offile_off_t result = current_->read(buf, buflen); + tell_ += result; + return result; +} + +offile_off_t DcmInputStream::skip(offile_off_t skiplen) +{ + offile_off_t result = current_->skip(skiplen); + tell_ += result; + return result; +} + +offile_off_t DcmInputStream::tell() const +{ + return tell_; +} + +void DcmInputStream::mark() +{ + mark_ = tell_; +} + +void DcmInputStream::putback() +{ + current_->putback(tell_ - mark_); + tell_ = mark_; +} + +const DcmProducer *DcmInputStream::currentProducer() const +{ + return current_; +} + +OFCondition DcmInputStream::installCompressionFilter(E_StreamCompression filterType) +{ + OFCondition result = EC_Normal; + if (compressionFilter_) result = EC_DoubleCompressionFilters; + else + { + switch (filterType) + { +#ifdef WITH_ZLIB + case ESC_zlib: + compressionFilter_ = new DcmZLibInputFilter(); + if (compressionFilter_) + { + compressionFilter_->append(*current_); + // feed the compression engine with data from the producer + compressionFilter_->skip(0); + current_ = compressionFilter_; + } else result = EC_MemoryExhausted; + break; +#endif + case ESC_none: + case ESC_unsupported: + result = EC_UnsupportedEncoding; + break; + } + } + + return result; +} diff --git a/dcmdata/libsrc/dcistrmb.cc b/dcmdata/libsrc/dcistrmb.cc new file mode 100644 index 00000000..2132a604 --- /dev/null +++ b/dcmdata/libsrc/dcistrmb.cc @@ -0,0 +1,326 @@ +/* + * + * Copyright (C) 2002-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmInputBufferStream and related classes, + * implements input to blocks of memory as needed in the dcmnet module. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcistrmb.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define DCMBUFFERPRODUCER_BUFSIZE 1024 + +DcmBufferProducer::DcmBufferProducer() +: DcmProducer() +, buffer_(NULL) +, backup_(new unsigned char[DCMBUFFERPRODUCER_BUFSIZE]) +, bufSize_(0) +, bufIndex_(0) +, backupIndex_(DCMBUFFERPRODUCER_BUFSIZE) +, backupStart_(DCMBUFFERPRODUCER_BUFSIZE) +, status_(EC_Normal) +, eosflag_(OFFalse) +{ + if (!backup_) status_ = EC_MemoryExhausted; +} + + +DcmBufferProducer::~DcmBufferProducer() +{ + delete[] backup_; +} + + +OFBool DcmBufferProducer::good() const +{ + return status_.good(); +} + +OFCondition DcmBufferProducer::status() const +{ + return status_; +} + +OFBool DcmBufferProducer::eos() +{ + // end of stream is true if the user has called setEos() before + // and there is no more data available in the current buffer. + // We also flag end of stream if the status is bad. + return (eosflag_ && (avail() == 0)) || (!status_.good()); +} + + +offile_off_t DcmBufferProducer::avail() +{ + if (status_.good()) + { + // in the backup buffer, we have (DCMBUFFERPRODUCER_BUFSIZE - backupIndex_) + // bytes available. In the user buffer, we have (bufSize_ - bufIndex_). + return DCMBUFFERPRODUCER_BUFSIZE + bufSize_ - bufIndex_ - backupIndex_; + } + else return 0; +} + + +offile_off_t DcmBufferProducer::read(void *buf, offile_off_t buflen) +{ + offile_off_t result = 0; + if (status_.good() && buflen && buf) + { + unsigned char *target = OFstatic_cast(unsigned char *, buf); + if (backupIndex_ < DCMBUFFERPRODUCER_BUFSIZE) + { + // we have data in the backup buffer, read first + result = DCMBUFFERPRODUCER_BUFSIZE - backupIndex_; + if (result > buflen) result = buflen; + memcpy(target, backup_ + backupIndex_, OFstatic_cast(size_t, result)); + backupIndex_ += result; + target += result; + buflen -= result; + } + + if (buflen && bufSize_) + { + // read data from user buffer + offile_off_t numbytes = bufSize_ - bufIndex_; + if (numbytes > buflen) numbytes = buflen; + memcpy(target, buffer_ + bufIndex_, OFstatic_cast(size_t, numbytes)); + bufIndex_ += numbytes; + result += numbytes; + } + } + return result; +} + + +offile_off_t DcmBufferProducer::skip(offile_off_t skiplen) +{ + offile_off_t result = 0; + if (status_.good() && skiplen) + { + if (backupIndex_ < DCMBUFFERPRODUCER_BUFSIZE) + { + // we have data in the backup buffer, skip first + result = DCMBUFFERPRODUCER_BUFSIZE - backupIndex_; + if (result > skiplen) result = skiplen; + backupIndex_ += result; + skiplen -= result; + } + + if (skiplen && bufSize_) + { + // skip data from user buffer + offile_off_t skipbytes = bufSize_ - bufIndex_; + if (skipbytes > skiplen) skipbytes = skiplen; + bufIndex_ += skipbytes; + result += skipbytes; + } + } + return result; +} + +void DcmBufferProducer::putback(offile_off_t num) +{ + if (status_.good() && num) + { + if (bufSize_ && bufIndex_) + { + // since bufIndex_ > 0, data has already been read from the user buffer. + // This means we should putback in the user buffer first, and only + // if this is not sufficient we also touch the backup buffer. + if (num > bufIndex_) + { + num -= bufIndex_; + bufIndex_ = 0; + } + else + { + bufIndex_ -= num; + num = 0; + } + } + + if (num && (backupIndex_ > backupStart_)) + { + // there is still a number of bytes to putback, and we have data in the + // backup buffer, so we can actually putback something there. + // This will cause the next read operation to read from the backup + // buffer first and only then access the user buffer. + if (num > (backupIndex_ - backupStart_)) + { + num -= backupIndex_ - backupStart_; + backupIndex_ = backupStart_; + } + else + { + backupIndex_ -= num; + num = 0; + } + } + + if (num) + { + // we didn't manage to execute the putback request because there was + // not enough data available in both buffers. Producer failure. + status_ = EC_PutbackFailed; + } + } +} + +void DcmBufferProducer::setBuffer(const void *buf, offile_off_t buflen) +{ + if (status_.good()) + { + if (buffer_ || eosflag_) + { + // error: attempt to set new buffer without calling releaseBuffer before + // or after calling setEos. + status_ = EC_IllegalCall; + } + else if (buf && buflen) + { + buffer_ = OFstatic_cast(unsigned char *, OFconst_cast(void *, buf)); + bufSize_ = buflen; + bufIndex_ = 0; + } + } +} + +void DcmBufferProducer::releaseBuffer() +{ + // releaseBuffer() might be called multiple times, so buffer_ could already be NULL. + if (status_.good() && buffer_) + { + // compute the least number of bytes that we have to store in the backup buffer + offile_off_t numBytes = bufSize_ - bufIndex_; + + if (numBytes > backupIndex_) + { + // number of bytes is larger than free space in backup buffer; fail. + status_ = EC_IllegalCall; + } + else + { + // if number of bytes is smaller than free space in backup buffer, make as large as possible + if (numBytes < backupIndex_) + { + numBytes = (backupIndex_ < bufSize_) ? backupIndex_ : bufSize_; + } + + // if number of bytes is smaller than backup buffer, move old + // data in backup buffer to keep older data available for putback operations + if (numBytes < DCMBUFFERPRODUCER_BUFSIZE) + { + // move (DCMBUFFERPRODUCER_BUFSIZE - numBytes) bytes from end of backup buffer + // to start of backup buffer. Everything else will be overwritten from the + // user buffer. + memmove(backup_, backup_ + numBytes, OFstatic_cast(size_t, DCMBUFFERPRODUCER_BUFSIZE - numBytes)); + + // adjust backupStart_ + if (backupStart_ < numBytes) backupStart_ = 0; else backupStart_ -= numBytes; + } + else + { + // the backup buffer will be filled completely from the user buffer + backupStart_ = 0; + } + + // copy (numBytes) bytes from the end of the user buffer to the end of the backup buffer + memcpy(backup_ + DCMBUFFERPRODUCER_BUFSIZE - numBytes, buffer_ + bufSize_ - numBytes, OFstatic_cast(size_t, numBytes)); + + // adjust backupIndex_ + if (backupIndex_ == DCMBUFFERPRODUCER_BUFSIZE) + { + // there was no unread data in the backup buffer before. + // backupIndex_ only depends on the number of unread bytes in the user buffer. + // we know that (bufSize_ - bufIndex_ < DCMBUFFERPRODUCER_BUFSIZE) because this was tested before. + backupIndex_ = DCMBUFFERPRODUCER_BUFSIZE + bufIndex_ - bufSize_; + } + else + { + // there was unread data in the backup buffer before. + // This implies that all of the user buffer is unread and the complete user + // buffer fits into the free space in the backup buffer, because otherwise + // we would not have got this far. + // Adjust backupIndex_ by the number of bytes we have moved the content of the backup buffer. + backupIndex_ -= numBytes; + } + + // release user buffer + buffer_ = NULL; + bufSize_ = 0; + bufIndex_ = 0; + } + } + + // the number of bytes that can be putback after this operation depends + // on the size of the backup buffer and on the number of unread bytes + // in both buffers at the time of the releaseBuffer() operation. + // If the user only calls releaseBuffer() when most data has been read + // from the buffer, we should be able to putback almost 1K. +} + +void DcmBufferProducer::setEos() +{ + eosflag_ = OFTrue; +} + +/* ======================================================================= */ + +DcmInputBufferStream::DcmInputBufferStream() +: DcmInputStream(&producer_) // safe because DcmInputStream only stores pointer +, producer_() +{ +} + +DcmInputBufferStream::~DcmInputBufferStream() +{ +#ifdef DEBUG + if ((!eos()) && (avail() > 0)) + { + DCMDATA_WARN("closing unflushed DcmInputBufferStream, loss of data!"); + } +#endif +} + +DcmInputStreamFactory *DcmInputBufferStream::newFactory() const +{ + // we don't support delayed loading from buffer streams + return NULL; +} + +void DcmInputBufferStream::setBuffer(const void *buf, offile_off_t buflen) +{ + producer_.setBuffer(buf, buflen); + + // if there is a compression filter, the following call will + // cause it to feed the compression engine with data from the + // new buffer. + skip(0); +} + +void DcmInputBufferStream::releaseBuffer() +{ + producer_.releaseBuffer(); +} + +void DcmInputBufferStream::setEos() +{ + producer_.setEos(); +} diff --git a/dcmdata/libsrc/dcistrmf.cc b/dcmdata/libsrc/dcistrmf.cc new file mode 100644 index 00000000..61dba66b --- /dev/null +++ b/dcmdata/libsrc/dcistrmf.cc @@ -0,0 +1,259 @@ +/* + * + * Copyright (C) 2002-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmInputFileStream and related classes, + * implements streamed input from files. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcistrmf.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CERRNO +#include "dcmtk/ofstd/ofstdinc.h" + + +DcmFileProducer::DcmFileProducer(const OFFilename &filename, offile_off_t offset) +: DcmProducer() +, file_() +, status_(EC_Normal) +, size_(0) +{ + if (file_.fopen(filename, "rb")) + { + // Get number of bytes in file + file_.fseek(0L, SEEK_END); + size_ = file_.ftell(); + if (0 != file_.fseek(offset, SEEK_SET)) + { + OFString s("(unknown error code)"); + file_.getLastErrorString(s); + status_ = makeOFCondition(OFM_dcmdata, 18, OF_error, s.c_str()); + } + } + else + { + OFString s("(unknown error code)"); + file_.getLastErrorString(s); + status_ = makeOFCondition(OFM_dcmdata, 18, OF_error, s.c_str()); + } +} + +DcmFileProducer::~DcmFileProducer() +{ +} + +OFBool DcmFileProducer::good() const +{ + return status_.good(); +} + +OFCondition DcmFileProducer::status() const +{ + return status_; +} + +OFBool DcmFileProducer::eos() +{ + if (file_.open()) + { + return (file_.eof() || (size_ == file_.ftell())); + } + else return OFTrue; +} + +offile_off_t DcmFileProducer::avail() +{ + if (file_.open()) return size_ - file_.ftell(); else return 0; +} + +offile_off_t DcmFileProducer::read(void *buf, offile_off_t buflen) +{ + offile_off_t result = 0; + if (status_.good() && file_.open() && buf && buflen) + { + result = file_.fread(buf, 1, OFstatic_cast(size_t, buflen)); + } + return result; +} + +offile_off_t DcmFileProducer::skip(offile_off_t skiplen) +{ + offile_off_t result = 0; + if (status_.good() && file_.open() && skiplen) + { + offile_off_t pos = file_.ftell(); + result = (size_ - pos < skiplen) ? (size_ - pos) : skiplen; + if (file_.fseek(result, SEEK_CUR)) + { + OFString s("(unknown error code)"); + file_.getLastErrorString(s); + status_ = makeOFCondition(OFM_dcmdata, 18, OF_error, s.c_str()); + } + } + return result; +} + +void DcmFileProducer::putback(offile_off_t num) +{ + if (status_.good() && file_.open() && num) + { + offile_off_t pos = file_.ftell(); + if (num <= pos) + { + if (file_.fseek(-num, SEEK_CUR)) + { + OFString s("(unknown error code)"); + file_.getLastErrorString(s); + status_ = makeOFCondition(OFM_dcmdata, 18, OF_error, s.c_str()); + } + } + else status_ = EC_PutbackFailed; // tried to putback before start of file + } +} + + +/* ======================================================================= */ + +DcmInputFileStreamFactory::DcmInputFileStreamFactory(const OFFilename &filename, offile_off_t offset) +: DcmInputStreamFactory() +, filename_(filename) +, offset_(offset) +{ +} + +DcmInputFileStreamFactory::DcmInputFileStreamFactory(const DcmInputFileStreamFactory& arg) +: DcmInputStreamFactory(arg) +, filename_(arg.filename_) +, offset_(arg.offset_) +{ +} + +DcmInputFileStreamFactory::~DcmInputFileStreamFactory() +{ +} + +DcmInputStream *DcmInputFileStreamFactory::create() const +{ + return new DcmInputFileStream(filename_, offset_); +} + +/* ======================================================================= */ + +DcmInputFileStream::DcmInputFileStream(const OFFilename &filename, offile_off_t offset) +: DcmInputStream(&producer_) // safe because DcmInputStream only stores pointer +, producer_(filename, offset) +, filename_(filename) +{ +} + +DcmInputFileStream::~DcmInputFileStream() +{ +} + +DcmInputStreamFactory *DcmInputFileStream::newFactory() const +{ + DcmInputStreamFactory *result = NULL; + if (currentProducer() == &producer_) + { + // no filter installed, can create factory object + result = new DcmInputFileStreamFactory(filename_, tell()); + } + return result; +} + +/* ======================================================================= */ + +DcmInputStream *DcmTempFileHandler::create() const +{ + return new DcmInputFileStream(filename_, 0); +} + +DcmTempFileHandler::DcmTempFileHandler(const OFFilename &filename) +#ifdef WITH_THREADS +: refCount_(1), mutex_(), filename_(filename) +#else +: refCount_(1), filename_(filename) +#endif +{ +} + +DcmTempFileHandler::~DcmTempFileHandler() +{ + OFStandard::deleteFile(filename_); +} + +DcmTempFileHandler *DcmTempFileHandler::newInstance(const OFFilename &filename) +{ + return new DcmTempFileHandler(filename); +} + +void DcmTempFileHandler::increaseRefCount() +{ +#ifdef WITH_THREADS + mutex_.lock(); +#endif + ++refCount_; +#ifdef WITH_THREADS + mutex_.unlock(); +#endif +} + +void DcmTempFileHandler::decreaseRefCount() +{ +#ifdef WITH_THREADS + mutex_.lock(); +#endif + size_t result = --refCount_; +#ifdef WITH_THREADS + mutex_.unlock(); +#endif + if (result == 0) delete this; +} + +/* ======================================================================= */ + +DcmInputTempFileStreamFactory::DcmInputTempFileStreamFactory(DcmTempFileHandler *handler) +: DcmInputStreamFactory() +, fileHandler_(handler) +{ + fileHandler_->increaseRefCount(); +} + +DcmInputTempFileStreamFactory::DcmInputTempFileStreamFactory(const DcmInputTempFileStreamFactory &arg) +: DcmInputStreamFactory(arg) +, fileHandler_(arg.fileHandler_) +{ + fileHandler_->increaseRefCount(); +} + +DcmInputTempFileStreamFactory::~DcmInputTempFileStreamFactory() +{ + fileHandler_->decreaseRefCount(); +} + +DcmInputStream *DcmInputTempFileStreamFactory::create() const +{ + return fileHandler_->create(); +} + +DcmInputStreamFactory *DcmInputTempFileStreamFactory::clone() const +{ + return new DcmInputTempFileStreamFactory(*this); +} diff --git a/dcmdata/libsrc/dcistrmz.cc b/dcmdata/libsrc/dcistrmz.cc new file mode 100644 index 00000000..0a6a6fd9 --- /dev/null +++ b/dcmdata/libsrc/dcistrmz.cc @@ -0,0 +1,432 @@ +/* + * + * Copyright (C) 2002-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: zlib compression filter for input streams + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_ZLIB + +#include "dcmtk/dcmdata/dcistrmz.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define DCMZLIBINPUTFILTER_BUFSIZE 4096 +#define DCMZLIBINPUTFILTER_PUTBACKSIZE 1024 + +OFGlobal dcmZlibExpectRFC1950Encoding(OFFalse); + +// helper methods to fix old-style casts warnings +BEGIN_EXTERN_C +static int OFinflateInit(z_stream* const stream) +{ + return inflateInit(stream); +} + +static int OFinflateInit2(z_stream* const stream) +{ + return inflateInit2(stream, -MAX_WBITS); +} +END_EXTERN_C + +DcmZLibInputFilter::DcmZLibInputFilter() +: DcmInputFilter() +, current_(NULL) +, zstream_(new z_stream) +, status_(EC_MemoryExhausted) +, eos_(OFFalse) +, inputBuf_(new unsigned char[DCMZLIBINPUTFILTER_BUFSIZE]) +, inputBufStart_(0) +, inputBufCount_(0) +, outputBuf_(new unsigned char[DCMZLIBINPUTFILTER_BUFSIZE]) +, outputBufStart_(0) +, outputBufCount_(0) +, outputBufPutback_(0) +, padded_(OFFalse) +{ + if (zstream_ && inputBuf_ && outputBuf_) + { + zstream_->zalloc = Z_NULL; + zstream_->zfree = Z_NULL; + zstream_->opaque = Z_NULL; + zstream_->next_in = Z_NULL; + zstream_->avail_in = 0; + + if (dcmZlibExpectRFC1950Encoding.get()) + { + /* expect non-standard bitstream *with* zlib header + * This is easy because it is the normal zlib format anyway. + */ + if (Z_OK == OFinflateInit(zstream_)) + status_ = EC_Normal; + else + { + OFString etext = "ZLib Error: "; + if (zstream_->msg) etext += zstream_->msg; + status_ = makeOFCondition(OFM_dcmdata, 16, OF_error, etext.c_str()); + } + } + else + { + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + */ + if (Z_OK == OFinflateInit2(zstream_)) + status_ = EC_Normal; + else + { + OFString etext = "ZLib Error: "; + if (zstream_->msg) etext += zstream_->msg; + status_ = makeOFCondition(OFM_dcmdata, 16, OF_error, etext.c_str()); + } + } + } +} + +DcmZLibInputFilter::~DcmZLibInputFilter() +{ + if (zstream_) + { + inflateEnd(zstream_); // discards any unprocessed input and does not flush any pending output + delete zstream_; + } + delete[] inputBuf_; + delete[] outputBuf_; +} + +OFBool DcmZLibInputFilter::good() const +{ + return status_.good(); +} + +OFCondition DcmZLibInputFilter::status() const +{ + return status_; +} + +OFBool DcmZLibInputFilter::eos() +{ + if (status_.bad() || (current_ == NULL)) return OFTrue; + + // there may be trailing garbage after the compressed stream. + // we report eos if the decompressor has reported Z_STREAM_END + // and the output buffer is empty. + return (outputBufCount_ == 0) && eos_; +} + +offile_off_t DcmZLibInputFilter::avail() +{ + if (status_.good()) return outputBufCount_; else return 0; +} + +offile_off_t DcmZLibInputFilter::read(void *buf, offile_off_t buflen) +{ + if (status_.bad() || (current_ == NULL) || (buf == NULL)) return 0; + unsigned char *target = OFstatic_cast(unsigned char *, buf); + offile_off_t offset = 0; + offile_off_t availBytes = 0; + offile_off_t result = 0; + do + { + // copy bytes from output buffer to user provided block of data + if (outputBufCount_) + { + // determine next block of data in output buffer + offset = outputBufStart_ + outputBufPutback_; + if (offset >= DCMZLIBINPUTFILTER_BUFSIZE) offset -= DCMZLIBINPUTFILTER_BUFSIZE; + + availBytes = outputBufCount_; + if (offset + availBytes > DCMZLIBINPUTFILTER_BUFSIZE) availBytes = DCMZLIBINPUTFILTER_BUFSIZE - offset; + if (availBytes > buflen) availBytes = buflen; + + if (availBytes) memcpy(target, outputBuf_ + offset, OFstatic_cast(size_t, availBytes)); + target += availBytes; + result += availBytes; + buflen -= availBytes; + + // adjust pointers + outputBufPutback_ += availBytes; + outputBufCount_ -= availBytes; + if (outputBufPutback_ > DCMZLIBINPUTFILTER_PUTBACKSIZE) + { + outputBufStart_ += outputBufPutback_ - DCMZLIBINPUTFILTER_PUTBACKSIZE; + if (outputBufStart_ >= DCMZLIBINPUTFILTER_BUFSIZE) outputBufStart_ -= DCMZLIBINPUTFILTER_BUFSIZE; + outputBufPutback_ = DCMZLIBINPUTFILTER_PUTBACKSIZE; + } + } + + // refill output buffer + fillOutputBuffer(); + } while (buflen && outputBufCount_); + + // we're either done or the output buffer is empty because of producer suspension + return result; +} + +offile_off_t DcmZLibInputFilter::skip(offile_off_t skiplen) +{ + if (status_.bad() || (current_ == NULL)) return 0; + offile_off_t offset = 0; + offile_off_t availBytes = 0; + offile_off_t result = 0; + do + { + // copy bytes from output buffer to user provided block of data + if (outputBufCount_) + { + // determine next block of data in output buffer + offset = outputBufStart_ + outputBufPutback_; + if (offset >= DCMZLIBINPUTFILTER_BUFSIZE) offset -= DCMZLIBINPUTFILTER_BUFSIZE; + + availBytes = outputBufCount_; + if (offset + availBytes > DCMZLIBINPUTFILTER_BUFSIZE) availBytes = DCMZLIBINPUTFILTER_BUFSIZE - offset; + if (availBytes > skiplen) availBytes = skiplen; + result += availBytes; + skiplen -= availBytes; + + // adjust pointers + outputBufPutback_ += availBytes; + outputBufCount_ -= availBytes; + if (outputBufPutback_ > DCMZLIBINPUTFILTER_PUTBACKSIZE) + { + outputBufStart_ += outputBufPutback_ - DCMZLIBINPUTFILTER_PUTBACKSIZE; + outputBufPutback_ = DCMZLIBINPUTFILTER_PUTBACKSIZE; + if (outputBufStart_ >= DCMZLIBINPUTFILTER_BUFSIZE) outputBufStart_ -= DCMZLIBINPUTFILTER_BUFSIZE; + } + } + + // refill output buffer + fillOutputBuffer(); + } while (skiplen && outputBufCount_); + + // we're either done or the output buffer is empty because of producer suspension + return result; +} + +void DcmZLibInputFilter::putback(offile_off_t num) +{ + if (num > outputBufPutback_) status_ = EC_PutbackFailed; + else + { + outputBufPutback_ -= num; + outputBufCount_ += num; + } +} + +void DcmZLibInputFilter::append(DcmProducer& producer) +{ + current_ = &producer; +} + +offile_off_t DcmZLibInputFilter::fillInputBuffer() +{ + offile_off_t result = 0; + if (status_.good() && current_ && (inputBufCount_ < DCMZLIBINPUTFILTER_BUFSIZE)) + { + + // use first part of input buffer + if (inputBufStart_ + inputBufCount_ < DCMZLIBINPUTFILTER_BUFSIZE) + { + result = current_->read(inputBuf_ + inputBufStart_ + inputBufCount_, + DCMZLIBINPUTFILTER_BUFSIZE - (inputBufStart_ + inputBufCount_)); + + inputBufCount_ += result; + + if (result == 0) + { + if (current_->eos() && !padded_) + { + // producer has signalled eos, now append zero pad byte that makes + // zlib recognize the end of stream when no zlib header is present + *(inputBuf_ + inputBufStart_ + inputBufCount_) = 0; + inputBufCount_++; + padded_ = OFTrue; + } + return result; // producer suspension + } + } + + // use second part of input buffer + if (inputBufCount_ < DCMZLIBINPUTFILTER_BUFSIZE && + inputBufStart_ + inputBufCount_ >= DCMZLIBINPUTFILTER_BUFSIZE) + { + offile_off_t result2 = current_->read(inputBuf_ + (inputBufStart_ + inputBufCount_ - DCMZLIBINPUTFILTER_BUFSIZE), + DCMZLIBINPUTFILTER_BUFSIZE - inputBufCount_); + + inputBufCount_ += result2; + result += result2; + + if (result2 == 0 && current_->eos() && !padded_) + { + // producer has signalled eos, now append zero pad byte that makes + // zlib recognize the end of stream when no zlib header is present + *(inputBuf_ + inputBufStart_ + inputBufCount_ - DCMZLIBINPUTFILTER_BUFSIZE) = 0; + inputBufCount_++; + padded_ = OFTrue; + } + } + } + return result; +} + + +offile_off_t DcmZLibInputFilter::decompress(const void *buf, offile_off_t buflen) +{ + offile_off_t result = 0; + + zstream_->next_out = OFstatic_cast(Bytef *, OFconst_cast(void *, buf)); + zstream_->avail_out = OFstatic_cast(uInt, buflen); + int astatus; + + // decompress from inputBufStart_ to end of data or end of buffer, whatever comes first + offile_off_t numBytes = (inputBufStart_ + inputBufCount_ > DCMZLIBINPUTFILTER_BUFSIZE) ? + (DCMZLIBINPUTFILTER_BUFSIZE - inputBufStart_) : inputBufCount_ ; + + if (numBytes || buflen) + { + zstream_->next_in = OFstatic_cast(Bytef *, inputBuf_ + inputBufStart_); + zstream_->avail_in = OFstatic_cast(uInt, numBytes); + astatus = inflate(zstream_, 0); + + if (astatus == Z_OK || astatus == Z_BUF_ERROR) { /* everything OK */ } + else if (astatus == Z_STREAM_END) + { +#ifdef DEBUG + if (!eos_) + { + offile_off_t count = inputBufCount_ - (numBytes - OFstatic_cast(offile_off_t, zstream_->avail_in)); + if (count > 2) + { + /* we silently ignore up to two trailing bytes after the end of the + * deflated stream. One byte has been added by ourselves to make sure + * zlib detects eos, another one might be the padding necessary for + * odd length zlib streams transmitted through a DICOM network + * (where PDVs always have even length). + * Everything else generates a warning. + */ + DCMDATA_WARN("zlib: " << OFstatic_cast(ulong, count-1) << " pending input bytes in buffer."); + } + } +#endif + eos_ = OFTrue; + } + else + { + OFString etext = "ZLib Error: "; + if (zstream_->msg) etext += zstream_->msg; + status_ = makeOFCondition(OFM_dcmdata, 16, OF_error, etext.c_str()); + } + + // adjust counters + inputBufStart_ += numBytes - OFstatic_cast(offile_off_t, zstream_->avail_in); + inputBufCount_ -= numBytes - OFstatic_cast(offile_off_t, zstream_->avail_in); + + if (inputBufStart_ == DCMZLIBINPUTFILTER_BUFSIZE) + { + // wrapped around + inputBufStart_ = 0; + + // now flush to end of data + if (inputBufCount_ && (zstream_->avail_out > 0)) + { + zstream_->next_in = OFstatic_cast(Bytef *, inputBuf_); + zstream_->avail_in = OFstatic_cast(uInt, inputBufCount_); + astatus = inflate(zstream_, 0); + + if (astatus == Z_OK || astatus == Z_BUF_ERROR) { /* everything OK */ } + else if (astatus == Z_STREAM_END) + { +#ifdef DEBUG + if (!eos_) + { + offile_off_t count = OFstatic_cast(offile_off_t, zstream_->avail_in); + if (count > 2) + { + /* we silently ignore up to two trailing bytes after the end of the + * deflated stream. One byte has been added by ourselves to make sure + * zlib detects eos, another one might be the padding necessary for + * odd length zlib streams transmitted through a DICOM network + * (where PDVs always have even length). + * Everything else generates a warning. + */ + DCMDATA_WARN("zlib: " << OFstatic_cast(ulong, count-1) << " pending input bytes in buffer."); + } + } +#endif + eos_ = OFTrue; + } + else + { + OFString etext = "ZLib Error: "; + if (zstream_->msg) etext += zstream_->msg; + status_ = makeOFCondition(OFM_dcmdata, 16, OF_error, etext.c_str()); + } + + // adjust counters + inputBufStart_ += inputBufCount_ - OFstatic_cast(offile_off_t, zstream_->avail_in); + inputBufCount_ = OFstatic_cast(offile_off_t, zstream_->avail_in); + + } + } + + // reset buffer start to make things faster + if (inputBufCount_ == 0) inputBufStart_ = 0; + + // compute result + result = buflen - OFstatic_cast(offile_off_t, zstream_->avail_out); + } + return result; +} + +void DcmZLibInputFilter::fillOutputBuffer() +{ + offile_off_t inputBytes = 0; + offile_off_t outputBytes = 0; + offile_off_t offset = 0; + offile_off_t availBytes = 0; + do + { + inputBytes = fillInputBuffer(); + + // determine next block of free space in output buffer + offset = outputBufStart_ + outputBufPutback_ + outputBufCount_; + if (offset >= DCMZLIBINPUTFILTER_BUFSIZE) offset -= DCMZLIBINPUTFILTER_BUFSIZE; + + availBytes = DCMZLIBINPUTFILTER_BUFSIZE - (outputBufPutback_ + outputBufCount_); + if (offset + availBytes > DCMZLIBINPUTFILTER_BUFSIZE) availBytes = DCMZLIBINPUTFILTER_BUFSIZE - offset; + + // decompress to output buffer + outputBytes = decompress(outputBuf_ + offset, availBytes); + outputBufCount_ += outputBytes; + } + while (inputBytes || outputBytes); +} + +#else /* WITH_ZLIB */ + +/* make sure that the object file is not completely empty if compiled + * without zlib because some linkers might fail otherwise. + */ +void dcistrmz_dummy_function() +{ + return; +} + +#endif /* WITH_ZLIB */ diff --git a/dcmdata/libsrc/dcitem.cc b/dcmdata/libsrc/dcitem.cc new file mode 100644 index 00000000..1a62caf9 --- /dev/null +++ b/dcmdata/libsrc/dcitem.cc @@ -0,0 +1,4720 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: class DcmItem + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/ofstd/ofdefine.h" /* for memzero() */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for name constants */ +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ +#include "dcmtk/dcmdata/dcovlay.h" +#include "dcmtk/dcmdata/dcpixel.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcvrae.h" +#include "dcmtk/dcmdata/dcvras.h" +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmdata/dcvrfl.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrlt.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcvrod.h" +#include "dcmtk/dcmdata/dcvrof.h" +#include "dcmtk/dcmdata/dcvrol.h" +#include "dcmtk/dcmdata/dcvrov.h" +#include "dcmtk/dcmdata/dcvrpn.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcvrsl.h" +#include "dcmtk/dcmdata/dcvrss.h" +#include "dcmtk/dcmdata/dcvrst.h" +#include "dcmtk/dcmdata/dcvrsv.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvruc.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrul.h" +#include "dcmtk/dcmdata/dcvrulup.h" +#include "dcmtk/dcmdata/dcvrur.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcvrut.h" +#include "dcmtk/dcmdata/dcvruv.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcspchrs.h" /* for class DcmSpecificCharacterSet */ +#include "dcmtk/dcmdata/dcjson.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/ofstd/ofstd.h" + +// ******************************** + + +DcmItem::DcmItem() + : DcmObject(DCM_ItemTag), + elementList(NULL), + lastElementComplete(OFTrue), + fStartPosition(0), + privateCreatorCache() +{ + elementList = new DcmList; +} + + +DcmItem::DcmItem(const DcmTag &tag, + const Uint32 len) + : DcmObject(tag, len), + elementList(NULL), + lastElementComplete(OFTrue), + fStartPosition(0), + privateCreatorCache() +{ + elementList = new DcmList; +} + + +DcmItem::DcmItem(const DcmItem &old) + : DcmObject(old), + elementList(new DcmList), + lastElementComplete(old.lastElementComplete), + fStartPosition(old.fStartPosition), + privateCreatorCache() +{ + if (!old.elementList->empty()) + { + elementList->seek(ELP_first); + old.elementList->seek(ELP_first); + do + { + DcmObject *dO = old.elementList->get()->clone(); + elementList->insert(dO, ELP_next); + // remember the parent + dO->setParent(this); + } while (old.elementList->seek(ELP_next)); + } +} + + +DcmItem& DcmItem::operator=(const DcmItem& obj) +{ + if (this != &obj) + { + // copy parent's member variables + DcmObject::operator=(obj); + + // delete any existing elements + elementList->deleteAllElements(); + + // copy DcmItem's member variables + lastElementComplete = obj.lastElementComplete; + fStartPosition = obj.fStartPosition; + if (!obj.elementList->empty()) + { + elementList->seek(ELP_first); + obj.elementList->seek(ELP_first); + do + { + DcmObject *dO = obj.elementList->get()->clone(); + elementList->insert(dO, ELP_next); + // remember the parent + dO->setParent(this); + } while (obj.elementList->seek(ELP_next)); + } + } + return *this; +} + + +int DcmItem::compare(const DcmItem& rhs) const +{ + if (this == &rhs) + return 0; + + // cast away constness (dcmdata is not const correct...) + DcmItem* myThis = NULL; + DcmItem* myRhs = NULL; + myThis = OFconst_cast(DcmItem*, this); + myRhs = OFconst_cast(DcmItem*, &rhs); + + // check length, i.e. number of elements in item + unsigned long thisNumValues = myThis->card(); + unsigned long rhsNumValues = myRhs->card(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + // iterate over all items and test equality + for (unsigned long count = 0; count < thisNumValues; count++) + { + DcmElement* val = myThis->getElement(count); + if (val) + { + DcmElement* rhsVal = myRhs->getElement(count); + if (rhsVal) + { + int result = val->compare(*rhsVal); + if (result != 0) + { + return result; + } + // otherwise they are equal, continue comparison + } + } + } + + // all values as well as VM equal: objects are equal + return 0; +} + + +OFCondition DcmItem::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmItem &, rhs); + } + return EC_Normal; +} + + +DcmItem::~DcmItem() +{ + elementList->deleteAllElements(); + delete elementList; +} + + +// ******************************** + + +OFBool DcmItem::foundVR(const Uint8* atposition) +{ + const Uint8 c1 = atposition[0]; + const Uint8 c2 = atposition[1]; + OFBool valid = OFFalse; + + if (isalpha(c1) && isalpha(c2)) + { + Uint8 vrName[3]; + vrName[0] = c1; + vrName[1] = c2; + vrName[2] = '\0'; + + /* is this VR name a standard VR descriptor */ + DcmVR vr( OFreinterpret_cast(const char*, &vrName[0] ) ); + valid = vr.isStandard(); + } else { + /* cannot be a valid VR name since non-characters */ + valid = OFFalse; + } + return valid; +} + + +// ******************************** + + +E_TransferSyntax DcmItem::checkTransferSyntax(DcmInputStream &inStream) +{ + E_TransferSyntax transferSyntax; + Uint8 tagAndVR[6]; + + /* we need 6 bytes, if there is less available we can't do much */ + if (inStream.avail() < 6) + return EXS_LittleEndianExplicit; + + /* read 6 bytes from the input stream (try to read tag and VR (data type)) */ + inStream.mark(); + inStream.read(tagAndVR, 6); // check tag & VR + inStream.putback(); + + /* create two tag variables (one for little, one for big */ + /* endian) in order to figure out, if there is a valid tag */ + const Uint8 c1 = tagAndVR[0]; + const Uint8 c2 = tagAndVR[1]; + const Uint8 c3 = tagAndVR[2]; + const Uint8 c4 = tagAndVR[3]; + const Uint16 t1 = OFstatic_cast(unsigned short, (c1 & 0xff) + ((c2 & 0xff) << 8)); // explicit little endian + const Uint16 t2 = OFstatic_cast(unsigned short, (c3 & 0xff) + ((c4 & 0xff) << 8)); // conversion + DcmTag taglittle(t1, t2); + DcmTag tagbig(swapShort(t1), swapShort(t2)); + + /* now we want to determine the transfer syntax which was used to code the information in the stream. */ + /* The decision is based on two questions: a) Did we encounter a valid tag? and b) Do the last 2 bytes */ + /* which were read from the stream represent a valid VR? In certain special cases, where the transfer */ + /* cannot be determined without doubt, we want to guess the most probable transfer syntax. */ + + /* if both tag variables show an error, we encountered an invalid tag */ + if ((taglittle.error().bad()) && (tagbig.error().bad())) + { + /* in case we encountered an invalid tag, we want to assume that the used transfer syntax */ + /* is a little endian transfer syntax. Now we have to figure out, if it is an implicit or */ + /* explicit transfer syntax. Hence, check if the last 2 bytes represent a valid VR. */ + if (foundVR(&tagAndVR[4])) + { + /* if the last 2 bytes represent a valid VR, we assume that the used */ + /* transfer syntax is the little endian explicit transfer syntax. */ + transferSyntax = EXS_LittleEndianExplicit; + } else { + /* if the last 2 bytes did not represent a valid VR, we assume that the */ + /* used transfer syntax is the little endian implicit transfer syntax. */ + transferSyntax = EXS_LittleEndianImplicit; + } + } + /* if at least one tag variable did not show an error, we encountered a valid tag */ + else + { + /* in case we encountered a valid tag, we want to figure out, if it is an implicit or */ + /* explicit transfer syntax. Hence, check if the last 2 bytes represent a valid VR. */ + if (foundVR(&tagAndVR[4])) + { + /* having figured out that the last 2 bytes represent a valid */ + /* VR, we need to find out which of the two tags was valid */ + if (taglittle.error().bad()) + { + /* if the little endian tag was invalid, the transfer syntax is big endian explicit */ + transferSyntax = EXS_BigEndianExplicit; + } + else if (tagbig.error().bad()) + { + /* if the big endian tag was invalid, the transfer syntax is little endian explicit */ + transferSyntax = EXS_LittleEndianExplicit; + } else { + /* if both tags were valid, we take a look at the group numbers. Since */ + /* group 0008 is much more probable than group 0800 for the first tag */ + /* we specify the following: */ + if ((taglittle.getGTag() > 0xff)&&(tagbig.getGTag() <= 0xff)) transferSyntax = EXS_BigEndianExplicit; + else transferSyntax = EXS_LittleEndianExplicit; + } + } else { + /* having figured out that the last 2 bytes do not represent a */ + /* valid VR, we need to find out which of the two tags was valid */ + if (taglittle.error().bad()) + { + /* if the litte endian tag was invalid, the transfer syntax is big endian implicit */ + transferSyntax = EXS_BigEndianImplicit; + } + else if (tagbig.error().bad()) + { + /* if the big endian tag was invalid, the transfer syntax is little endian implicit */ + transferSyntax = EXS_LittleEndianImplicit; + } else { + /* if both tags were valid, we take a look at the group numbers. Since */ + /* group 0008 is much more probable than group 0800 for the first tag */ + /* we specify the following: */ + if ((taglittle.getGTag() > 0xff)&&(tagbig.getGTag() <= 0xff)) transferSyntax = EXS_BigEndianImplicit; + else transferSyntax = EXS_LittleEndianImplicit; + } + } + } + + /* return determined transfer syntax */ + return transferSyntax; +} + + +// ******************************** + + +void DcmItem::checkAndUpdateVR(DcmItem &item, + DcmTag &tag) +{ + /* handle special cases where the VR can be determined by some other element values */ + if (((tag == DCM_WaveformData) || (tag == DCM_WaveformPaddingValue) || + (tag == DCM_ChannelMinimumValue) || (tag == DCM_ChannelMaximumValue)) && (tag.getEVR() == EVR_ox)) + { + /* case 1 (WaveformData and others): see section 8.3 in PS 3.5 */ + Uint16 bitsAlloc; + if (item.findAndGetUint16(DCM_WaveformBitsAllocated, bitsAlloc).good()) + { + if (bitsAlloc == 8) + { + DCMDATA_DEBUG("DcmItem::checkAndUpdateVR() setting undefined VR of " + << tag.getTagName() << " " << tag << " to 'OB' because WaveformBitsAllocated " + << DCM_WaveformBitsAllocated << " has a value of 8"); + tag.setVR(EVR_OB); + } else { + DCMDATA_DEBUG("DcmItem::checkAndUpdateVR() setting undefined VR of " + << tag.getTagName() << " " << tag << " to 'OW' because WaveformBitsAllocated " + << DCM_WaveformBitsAllocated << " has a value that is different from 8"); + tag.setVR(EVR_OW); + } + } + } + else if (((tag == DCM_PixelPaddingValue) || (tag == DCM_PixelPaddingRangeLimit) || + (tag == DCM_HistogramFirstBinValue) || (tag == DCM_HistogramLastBinValue) || + (tag == DCM_ZeroVelocityPixelValue) || (tag == DCM_SmallestImagePixelValue) || + (tag == DCM_LargestImagePixelValue) || (tag == DCM_SmallestPixelValueInSeries) || + (tag == DCM_LargestPixelValueInSeries) || (tag == DCM_LUTDescriptor) || + (tag == DCM_RealWorldValueLastValueMapped) || (tag == DCM_RealWorldValueFirstValueMapped)) && + (tag.getEVR() == EVR_xs)) + { + /* case 2 (PixelPaddingValue and others): see section C.7.5.1, C.7.6.16.x and C.11.5 in PS 3.3 */ + Uint16 pixelRep; + if (item.findAndGetUint16(DCM_PixelRepresentation, pixelRep).good()) + { + if (pixelRep == 0x0001) + { + DCMDATA_DEBUG("DcmItem::checkAndUpdateVR() setting undefined VR of " << tag.getTagName() + << " " << tag << " to 'SS' because PixelRepresentation " + << DCM_PixelRepresentation << " has a value of 1"); + tag.setVR(EVR_SS); + } else { + DCMDATA_DEBUG("DcmItem::checkAndUpdateVR() setting undefined VR of " << tag.getTagName() + << " " << tag << " to 'US' because PixelRepresentation " + << DCM_PixelRepresentation << " has a value that is different from 1"); + tag.setVR(EVR_US); + } + } + } + else if (((tag.getBaseTag() == DCM_OverlayData) || (tag == DCM_PixelData)) && (tag.getEVR() == EVR_ox)) + { + /* case 3 (OverlayData and PixelData): see section 8.1.2 and 8.2 in PS 3.5 */ + DCMDATA_DEBUG("DcmItem::checkAndUpdateVR() setting undefined VR of " + << tag.getTagName() << " " << tag << " to 'OW'"); + tag.setVR(EVR_OW); + } + else if ((tag.getBaseTag() == DCM_RETIRED_CurveData) && (tag.getEVR() == EVR_ox)) + { + /* case 4 (CurveData): see section A.1 in PS 3.5-2004 */ + DCMDATA_DEBUG("DcmItem::checkAndUpdateVR() setting undefined VR of " + << tag.getTagName() << " " << tag << " to 'OB'"); + tag.setVR(EVR_OB); + } + /* currently unhandled: + * - MappedPixelValue (0022,1452), US or SS + * - RedPaletteColorLookupTableDescriptor (0028,1101), US or SS + * - GreenPaletteColorLookupTableDescriptor (0028,1102), US or SS + * - BluePaletteColorLookupTableDescriptor (0028,1103), US or SS + * and some retired DICOM attributes as well as some DICONDE attributes + */ +} + + +// ******************************** + + +DcmEVR DcmItem::ident() const +{ + return EVR_item; +} + + +unsigned long DcmItem::getVM() +{ + return 1; +} + + +unsigned long DcmItem::getNumberOfValues() +{ + return elementList->card(); +} + + +unsigned long DcmItem::card() const +{ + return elementList->card(); +} + + +// ******************************** + + +void DcmItem::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + if (flags & DCMTypes::PF_showTreeStructure) + { + /* print item line with empty text */ + printInfoLine(out, flags, level); + /* print item content */ + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (elementList->seek(ELP_next)); + } + } else { + /* print item start line */ + OFOStringStream oss; + oss << "(Item with "; + if (getLengthField() == DCM_UndefinedLength) + oss << "undefined"; + else + oss << "explicit"; + oss << " length #=" << card() << ")" << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + printInfoLine(out, flags, level, tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + /* print item content */ + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (elementList->seek(ELP_next)); + } + /* print item end line */ + DcmTag delimItemTag(DCM_ItemDelimitationItemTag); + if (getLengthField() == DCM_UndefinedLength) + printInfoLine(out, flags, level, "(ItemDelimitationItem)", &delimItemTag); + else + printInfoLine(out, flags, level, "(ItemDelimitationItem for re-encoding)", &delimItemTag); + } +} + + +// ******************************** + + +OFCondition DcmItem::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + OFCondition l_error = EC_Normal; + if (!(flags & DCMTypes::XF_useNativeModel)) + { + /* XML start tag for "item" */ + out << "" << OFendl; + } + /* write item content */ + if (!elementList->empty()) + { + /* write content of all children */ + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + l_error = dO->writeXML(out, flags); + } while (l_error.good() && elementList->seek(ELP_next)); + } + if (l_error.good()) + { + if (!(flags & DCMTypes::XF_useNativeModel)) + { + /* XML end tag for "item" */ + out << "" << OFendl; + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmItem::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + if (!elementList->empty()) + { + // write content of all children + out << "{" << format.newline(); + elementList->seek(ELP_first); + OFCondition status = EC_Normal; + status = elementList->get()->writeJson(out, format); + while (status.good() && elementList->seek(ELP_next)) + { + out << "," << format.newline(); + status = elementList->get()->writeJson(out, format); + } + out << format.newline() << format.indent() << "}"; + return status; + } + else + { + out << "{}" << format.newline(); + } + return EC_Normal; +} + +// ******************************** + + +OFBool DcmItem::canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer) +{ + OFBool canWrite = OFTrue; + if (newXfer == EXS_Unknown) + canWrite = OFFalse; + else if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + canWrite = dO->canWriteXfer(newXfer, oldXfer); + } while (elementList->seek(ELP_next) && canWrite); + } + return canWrite; +} + + +// ******************************** + + +Uint32 DcmItem::calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + Uint32 itemlen = 0; + DcmXfer xferSyn(xfer); + /* Length of item's start header */ + const Uint32 headersize = xferSyn.sizeofTagHeader(getVR()); + /* Length of item's content, i.e. contained elements */ + itemlen = getLength(xfer, enctype); + /* Since the item's total length can exceed the maximum length of 32 bit, it is + * always necessary to check for overflows. The approach taken is not elegant + * but should work... + */ + if ( (itemlen == DCM_UndefinedLength) || OFStandard::check32BitAddOverflow(itemlen, headersize) ) + return DCM_UndefinedLength; + itemlen += headersize; + if (enctype == EET_UndefinedLength) // add bytes for closing item tag marker if necessary + { + if (OFStandard::check32BitAddOverflow(itemlen, 8)) + return DCM_UndefinedLength; + else + itemlen += 8; + } + return itemlen; +} + + +// ******************************** + + +Uint32 DcmItem::getLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + Uint32 itemlen = 0; + Uint32 sublen = 0; + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + sublen = dO->calcElementLength(xfer, enctype); + /* explicit length: be sure that total size of contained elements fits into item's + 32 Bit length field. If not, switch encoding automatically to undefined + length for this item. Nevertheless, any contained elements will be + written with explicit length if possible. + */ + if ( (enctype == EET_ExplicitLength) && OFStandard::check32BitAddOverflow(sublen, itemlen) ) + { + if (dcmWriteOversizedSeqsAndItemsUndefined.get()) + { + DCMDATA_WARN("DcmItem: Explicit length of item exceeds 32-Bit length field, " + << "trying to encode with undefined length"); + } + else + { + DCMDATA_WARN("DcmItem: Explicit length of item exceeds 32-Bit length field, " + << "aborting write"); + errorFlag = EC_SeqOrItemContentOverflow; + } + return DCM_UndefinedLength; + } + else + itemlen += sublen; + } while (elementList->seek(ELP_next)); + } + return itemlen; +} + + +// ******************************** + + +OFCondition DcmItem::computeGroupLengthAndPadding(const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc, + const E_TransferSyntax xfer, + const E_EncodingType enctype, + const Uint32 padlen, + const Uint32 subPadlen, + Uint32 instanceLength) +{ + /* if certain conditions are met, this is considered to be an illegal call. */ + if ((padenc == EPD_withPadding && (padlen % 2 || subPadlen % 2)) || + ((glenc == EGL_recalcGL || glenc == EGL_withGL || + padenc == EPD_withPadding) && xfer == EXS_Unknown)) + return EC_IllegalCall; + + /* if the caller specified that group length tags and padding */ + /* tags are not supposed to be changed, there is nothing to do. */ + if (glenc == EGL_noChange && padenc == EPD_noChange) + return EC_Normal; + + /* if we get to this point, we need to do something. First of all, set the error indicator to normal. */ + OFCondition l_error = EC_Normal; + /* collects group length elements that cannot be calculated due to length field overflows */ + OFList exceededGroupLengthElems; + + /* if there are elements in this item... */ + if (!elementList->empty()) + { + /* initialize some variables */ + DcmObject *dO; + OFBool beginning = OFTrue; + Uint16 lastGrp = 0x0000; + Uint16 actGrp; + DcmUnsignedLong * actGLElem = NULL; + DcmUnsignedLong * paddingGL = NULL; + Uint32 grplen = 0; + DcmXfer xferSyn(xfer); + Uint32 sublen = 0; + OFBool groupLengthExceeded = OFFalse; + + /* determine the current seek mode and set the list pointer to the first element */ + E_ListPos seekmode = ELP_next; + elementList->seek(ELP_first); + + /* start a loop: we want to go through all elements as long as everything is okay */ + do + { + /* set the seek mode to "next" again, in case it has been modified in the last iteration */ + seekmode = ELP_next; + + /* get the current element and assign it to a local variable */ + dO = elementList->get(); + + /* if the current element is a sequence, compute group length and padding for the sub sequence */ + if (dO->getVR() == EVR_SQ) + { + // add size of sequence header + Uint32 templen = instanceLength + xferSyn.sizeofTagHeader(EVR_SQ); + // call computeGroupLengthAndPadding for all contained items + l_error = OFstatic_cast(DcmSequenceOfItems *, dO)->computeGroupLengthAndPadding + (glenc, padenc, xfer, enctype, subPadlen, subPadlen, templen); + } + + /* if everything is ok so far */ + if (l_error.good()) + { + /* in case one of the following two conditions is met */ + /* (i) the caller specified that we want to add or remove group length elements and the current */ + /* element's tag shows that it is a group length element (tag's element number equals 0x0000) */ + /* (ii) the caller specified that we want to add or remove padding elements and the current */ + /* element's tag shows that it is a padding element (tag is (0xfffc,0xfffc) */ + /* then we want to delete the current (group length or padding) element */ + if (((glenc == EGL_withGL || glenc == EGL_withoutGL) && dO->getETag() == 0x0000) || + (padenc != EPD_noChange && dO->getTag() == DCM_DataSetTrailingPadding)) + { + delete elementList->remove(); + seekmode = ELP_atpos; // remove advances 1 element forward -> make next seek() work + dO = NULL; + } + /* if the above mentioned conditions are not met but the caller specified that we want to add group */ + /* length tags for every group or that we want to recalculate values for existing group length tags */ + else if (glenc == EGL_withGL || glenc == EGL_recalcGL) + { + /* we need to determine the current element's group number */ + actGrp = dO->getGTag(); + + /* and if the group number is different from the last remembered group number or */ + /* if this id the very first element that is treated then we've found a new group */ + if (actGrp != lastGrp || beginning) // new Group found + { + /* set beginning to false in order to specify that the */ + /* very first element has already been treated */ + beginning = OFFalse; + + /* if the current element is a group length element and its data type */ + /* is not UL replace this element with one that has a UL data type since */ + /* group length elements are supposed to have this data type */ + if (dO->getETag() == 0x0000 && dO->ident() != EVR_UL) + { + delete elementList->remove(); + DcmTag tagUL(actGrp, 0x0000, EVR_UL); + DcmUnsignedLong *dUL = new DcmUnsignedLong(tagUL); + elementList->insert(dUL, ELP_prev); + dO = dUL; + // remember the parent + dO->setParent(this); + DCMDATA_WARN("DcmItem: Group Length with VR other than UL found, corrected"); + } + /* if the above mentioned condition is not met but the caller specified */ + /* that we want to add group length elements, we need to add such an element */ + else if (glenc == EGL_withGL) + { + // Create GroupLength element + DcmTag tagUL(actGrp, 0x0000, EVR_UL); + DcmUnsignedLong *dUL = new DcmUnsignedLong(tagUL); + // insert new GroupLength element + elementList->insert(dUL, ELP_prev); + dO = dUL; + // remember the parent + dO->setParent(this); + } + + /* in case we want to add padding elements and the current element is a */ + /* padding element we want to remember the padding element so that the */ + /* group length of this element can be stored later */ + if (padenc == EPD_withPadding && actGrp == 0xfffc) + paddingGL = OFstatic_cast(DcmUnsignedLong *, dO); + + /* if actGLElem contains a valid pointer it was set in one of the last iterations */ + /* to the group length element of the last group. We need to write the current computed */ + /* group length value to this element. Exception: If group length exceeds maximum possible */ + /* value, than remove group length element instead of setting it */ + if (actGLElem != NULL) + { + if (!groupLengthExceeded) + { + // do not use putUint32() in order to make sure that the resulting VM is really 1 + actGLElem->putUint32Array(&grplen, 1); + DCMDATA_DEBUG("DcmItem::computeGroupLengthAndPadding() Length of Group 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(4) << actGLElem->getGTag() + << STD_NAMESPACE dec << STD_NAMESPACE setfill(' ') + << " len=" << grplen); + } + else + { + DCMDATA_WARN("DcmItem: Group length of group 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(4) << actGLElem->getGTag() + << " exceeds 32-Bit length field. " + << "Cannot calculate/write group length for this group."); + exceededGroupLengthElems.push_back(actGLElem); + groupLengthExceeded = OFFalse; + } + } + + /* set the group length value to 0 since it is the beginning of the new group */ + grplen = 0; + + /* if the current element is a group length element, remember its address for later */ + /* (we need to assign the group length value to this element in a subsequent iteration) */ + /* in case the current element (at the beginning of the group) is not a group length */ + /* element, set the actGLElem pointer to NULL. */ + if (dO->getETag() == 0x0000) + actGLElem = OFstatic_cast(DcmUnsignedLong *, dO); + else + actGLElem = NULL; + } + /* if this is not a new group, calculate the element's length and add it */ + /* to the currently computed group length value. If group length is larger */ + /* than group length field permits, set flag to not add group length for this group */ + else + { + sublen = dO->calcElementLength(xfer, enctype); + // test for 32-bit overflow return value + if ((sublen == DCM_UndefinedLength) || OFStandard::check32BitAddOverflow(sublen, grplen)) + { + groupLengthExceeded = OFTrue; + } + else + { + grplen += sublen; + } + } + + /* remember the current element's group number so that it is possible to */ + /* figure out if a new group is treated in the following iteration */ + lastGrp = actGrp; + } + } + } while (l_error.good() && elementList->seek(seekmode)); + + /* if there was no error and the caller specified that we want to add or recalculate */ + /* group length tags and if actGLElem has a valid value, we need to add the above */ + /* computed group length value to the last group's group length element. Exception: */ + /* If group length exceeds maximum possible value, remove group length element and */ + /* i.e. do not write it for this group. */ + if (l_error.good() && (glenc == EGL_withGL || glenc == EGL_recalcGL) && actGLElem) + { + if (groupLengthExceeded) + { + exceededGroupLengthElems.push_back(actGLElem); + } + else + { + actGLElem->putUint32(grplen); + } + } + + /* if the caller specified that we want to add padding elements and */ + /* if the length up to which shall be padded does not equal 0 we might */ + /* have to add a padding element */ + if (padenc == EPD_withPadding && padlen) + { + /* calculate how much space the entire padding element is supposed to occupy */ + Uint32 padding; + if (ident() == EVR_dataset) + { + instanceLength += calcElementLength(xfer, enctype); + padding = padlen - (instanceLength % padlen); + } else + padding = padlen - (getLength(xfer, enctype) % padlen); + + /* if now padding does not equal padlen we need to create a padding element. (if both values are equal */ + /* the element does have the exact required padlen length and does not need a padding element.) */ + if (padding != padlen) + { + /* Create new padding element */ + DcmOtherByteOtherWord * paddingEl = new DcmOtherByteOtherWord(DCM_DataSetTrailingPadding); + + /* calculate the length of the new element */ + Uint32 tmplen = paddingEl->calcElementLength(xfer, enctype); + + /* in case padding is smaller than the header of the padding element, we */ + /* need to increase padding (the value which specifies how much space the */ + /* entire padding element is supposed to occupy) until it is no longer smaller */ + while (tmplen > padding) + padding += padlen; + + /* determine the amount of bytes that have to be added to the */ + /* padding element so that it has the correct size */ + padding -= tmplen; + + /* create an array of a corresponding size and set the array fields */ + Uint8 * padBytes = new Uint8[padding]; + memzero(padBytes, size_t(padding)); + + /* set information in the above created padding element (size and actual value) */ + paddingEl->putUint8Array(padBytes, padding); + + /* delete the above created array */ + delete[] padBytes; + + /* insert the padding element into this */ + insert(paddingEl); + + /* finally we need to update the group length for the padding element if it exists */ + if (paddingGL) + { + Uint32 len; + paddingGL->getUint32(len); + len += paddingEl->calcElementLength(xfer, enctype); + paddingGL->putUint32(len); + } + } + } + } + /* delete invalid group length elements from item. Cannot be done in */ + /* above while loop because then elementList iterator is invalidated */ + const size_t numElems = exceededGroupLengthElems.size(); + for (size_t i = 0; i < numElems; i++) + { + delete remove(exceededGroupLengthElems.front()); + exceededGroupLengthElems.pop_front(); + } + + return l_error; +} + + +// ******************************** + + +OFCondition DcmItem::readTagAndLength(DcmInputStream &inStream, + const E_TransferSyntax xfer, + DcmTag &tag, + Uint32 &length, + Uint32 &bytesRead) +{ + OFCondition l_error = EC_Normal; + Uint32 valueLength = 0; + Uint16 groupTag = 0xffff; + Uint16 elementTag = 0xffff; + + /* create a DcmXfer object based on the transfer syntax which was passed */ + DcmXfer xferSyn(xfer); + +#ifdef DEBUG + /* dump some information if required */ + DCMDATA_TRACE("DcmItem::readTagAndLength() TransferSyntax=\"" << xferSyn.getXferName() << "\""); +#endif + + /* bail out if at end of stream */ + if (inStream.eos()) + return EC_EndOfStream; + + /* check if either 4 (for implicit transfer syntaxes) or 6 (for explicit transfer */ + /* syntaxes) bytes are available in (i.e. can be read from) inStream. if an error */ + /* occurred while performing this check return this error */ + if (inStream.avail() < OFstatic_cast(offile_off_t, xferSyn.isExplicitVR() ? 6 : 4)) + return EC_StreamNotifyClient; + + /* determine the byte ordering of the transfer syntax which was passed; */ + /* if the byte ordering is unknown, this is an illegal call. */ + const E_ByteOrder byteOrder = xferSyn.getByteOrder(); + if (byteOrder == EBO_unknown) + return EC_IllegalCall; + + /* read tag information (4 bytes) from inStream and create a corresponding DcmTag object */ + inStream.mark(); + inStream.read(&groupTag, 2); + inStream.read(&elementTag, 2); + swapIfNecessary(gLocalByteOrder, byteOrder, &groupTag, 2, 2); + swapIfNecessary(gLocalByteOrder, byteOrder, &elementTag, 2, 2); + // tag has been read + bytesRead = 4; + DcmTag newTag(groupTag, elementTag); + DcmEVR newEVR = newTag.getEVR(); + // check whether tag is private + OFBool isPrivate = groupTag & 1; + + /* if the transfer syntax which was passed is an explicit VR syntax and if the current */ + /* item is not a delimitation item (note that delimitation items do not have a VR), go */ + /* ahead and read 2 bytes from inStream. These 2 bytes contain this item's VR value. */ + if (xferSyn.isExplicitVR() && (newEVR != EVR_na)) + { + char vrstr[3]; + vrstr[2] = '\0'; + + /* read 2 bytes */ + inStream.read(vrstr, 2); + + /* create a corresponding DcmVR object */ + DcmVR vr(vrstr); + + /* if the VR which was read is not a standard VR, print a warning */ + if (!vr.isStandard()) + { + OFOStringStream oss; + oss << "DcmItem: Non-standard VR '" + << ((OFstatic_cast(unsigned char, vrstr[0]) < 32) ? ' ' : vrstr[0]) + << ((OFstatic_cast(unsigned char, vrstr[1]) < 32) ? ' ' : vrstr[1]) << "' (" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(2) << OFstatic_cast(unsigned int, vrstr[0] & 0xff) << "\\" + << STD_NAMESPACE setw(2) << OFstatic_cast(unsigned int, vrstr[1] & 0xff) + << ") encountered while parsing element " << newTag << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + /* encoding of this data element might be wrong, try to correct it */ + if (dcmAcceptUnexpectedImplicitEncoding.get()) + { + DCMDATA_WARN(tmpString << ", trying again with Implicit VR Little Endian"); + /* put back read bytes to input stream ... */ + inStream.putback(); + bytesRead = 0; + /* ... and retry with Implicit VR Little Endian transfer syntax */ + return readTagAndLength(inStream, EXS_LittleEndianImplicit, tag, length, bytesRead); + } else { + DCMDATA_WARN(tmpString << ", assuming " << (vr.usesExtendedLengthEncoding() ? "4" : "2") + << " byte length field"); + } + OFSTRINGSTREAM_FREESTR(tmpString) + + /* workaround: handle known issue with non-standard VR "OX" for PixelData element */ + if ((newTag == DCM_PixelData) && (strncmp(vrstr, "OX", 2) == 0)) + { + DCMDATA_WARN("DcmItem: Non-standard VR 'OX' is known to be wrongly used for PixelData " << newTag + << ", setting VR to 'OW'"); + vr.setVR(EVR_OW); + } + } + + /* the VR in the dataset might be wrong, so the user can decide to ignore it */ + if (dcmPreferVRFromDataDictionary.get() && (newEVR != EVR_UNKNOWN) && (newEVR != EVR_UNKNOWN2B)) + { + if (newEVR != vr.getEVR()) + { + /* ignore explicit VR in dataset if tag is defined in data dictionary */ + DCMDATA_DEBUG("DcmItem::readTagAndLength() ignoring explicit VR in data set (" + << vr.getVRName() << ") for element " << newTag + << ", using the one from data dictionary (" << newTag.getVRName() << ")"); + } + } else { + /* set the VR which was read in the above created tag object */ + newTag.setVR(vr); + } + + if (!dcmPreferLengthFieldSizeFromDataDictionary.get() || newEVR == EVR_UNKNOWN || newEVR == EVR_UNKNOWN2B) { + /* determine VR read from dataset, because this VR specifies the number of bytes for the length-field */ + newEVR = vr.getEVR(); + } else { + /* use the VR from the dictionary for deciding the length of the length field */ + } + + /* increase counter by 2 */ + bytesRead += 2; + } + + /* special handling for private elements */ + if (isPrivate && (newTag.getElement() >= 0x1000)) + { + const char *pc = privateCreatorCache.findPrivateCreator(newTag); + if (pc) + { + // we have a private creator for this element + newTag.setPrivateCreator(pc); + + if (xferSyn.isImplicitVR()) + { + // try to update VR from dictionary now that private creator is known + newTag.lookupVRinDictionary(); + // also update the VR + newEVR = newTag.getEVR(); + } + } + } + + /* the next thing we want to do is read the value in the length field from inStream. */ + /* determine if there is a corresponding amount of bytes (for the length field) still */ + /* available in inStream. If not, return an error. */ + if (inStream.avail() < OFstatic_cast(offile_off_t, xferSyn.sizeofTagHeader(newEVR) - bytesRead)) + { + inStream.putback(); // the UnsetPutbackMark is in readSubElement + bytesRead = 0; + l_error = EC_StreamNotifyClient; + return l_error; + } + + /* read the value in the length field. In some cases, it is 4 bytes wide, in other */ + /* cases only 2 bytes (see DICOM standard part 5, section 7.1.1) */ + if (xferSyn.isImplicitVR() || newEVR == EVR_na) // note that delimitation items don't have a VR + { + inStream.read(&valueLength, 4); // length field is 4 bytes wide + swapIfNecessary(gLocalByteOrder, byteOrder, &valueLength, 4, 4); + bytesRead += 4; + } else { // the transfer syntax is explicit VR + DcmVR vr(newEVR); + if (vr.usesExtendedLengthEncoding()) + { + Uint16 reserved; + inStream.read(&reserved, 2); // 2 reserved bytes + inStream.read(&valueLength, 4); // length field is 4 bytes wide + swapIfNecessary(gLocalByteOrder, byteOrder, &valueLength, 4, 4); + bytesRead += 6; + } else { + Uint16 tmpValueLength; + inStream.read(&tmpValueLength, 2); // length field is 2 bytes wide + swapIfNecessary(gLocalByteOrder, byteOrder, &tmpValueLength, 2, 2); + bytesRead += 2; + valueLength = tmpValueLength; + } + /* check whether value in length field is appropriate for this VR */ + const size_t vrSize = vr.getValueWidth(); + if ((vrSize > 1) && (valueLength % vrSize != 0)) + { + /* warning is only reported for standard, fixed-size VRs that require more than 1 byte per value */ + DCMDATA_WARN("DcmItem: Length of element " << newTag << " is not a multiple of " << vrSize << " (VR=" << vr.getVRName() << ")"); + } + } + /* if the value in the length field is odd, print an error message */ + if ((valueLength & 1) && (valueLength != DCM_UndefinedLength)) + { + DCMDATA_WARN("DcmItem: Length of element " << newTag << " is odd"); + } + + /* if desired, handle private attributes with maximum length as VR SQ */ + if (isPrivate && dcmReadImplPrivAttribMaxLengthAsSQ.get() && (valueLength == DCM_UndefinedLength)) + { + /* re-set tag to be a sequence and also delete private creator cache */ + newTag.setVR(EVR_SQ); + newTag.setPrivateCreator(""); + } + + /* if desired, check if length is greater than length of surrounding item */ + const Uint32 valueLengthItem = getLengthField(); + if ((ident() == EVR_item /* e.g. meta info would have length 0 */) && + (valueLengthItem != DCM_UndefinedLength /* this does not work in undefined length items */) && + (valueLength != DCM_UndefinedLength) /* Also, do not check sequences with undefined length 0xFFFFFFFF */ + ) + { + const offile_off_t remainingItemBytes = valueLengthItem - (inStream.tell() - fStartPosition); + /* is the explicit item length too small to cover the full value of the element value length to be read? */ + if (remainingItemBytes < 0) + { + DCMDATA_WARN("DcmItem: Explicit item length (" << valueLengthItem << " bytes) too large for the elements contained in the item"); + /* if the next tag is the sequence delimiter item, we can adapt to the situation */ + if (newTag.getXTag() == DCM_SequenceDelimitationItem) + { + DCMDATA_WARN("DcmItem: Sequence delimitation occurred before all bytes announced by explicit item length could be read"); + l_error = EC_PrematureSequDelimitationItem; + /* rewind to start of sequence delimiter which is read in a regular way */ + /* by DcmSequenceOfItems later (if error is ignored in DcmItem::read()) */ + inStream.putback(); + } + } + else if (OFstatic_cast(offile_off_t, valueLength) > remainingItemBytes) + { + DCMDATA_WARN("DcmItem: Element " << newTag.getTagName() << " " << newTag + << " larger (" << valueLength << ") than remaining bytes (" + /* need to cast remainingItemBytes to unsigned long because VC6 cannot print offile_off_t (int64_t). */ + << OFstatic_cast(unsigned long, remainingItemBytes) << ") of surrounding item"); + l_error = EC_ElemLengthLargerThanItem; + } + } + + /* assign values to out parameter */ + length = valueLength; + tag = newTag; + + /* return return value */ + return l_error; +} + + +// ******************************** + + +OFCondition DcmItem::readSubElement(DcmInputStream &inStream, + DcmTag &newTag, + const Uint32 newLength, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + DcmElement *subElem = NULL; + + /* create a new DcmElement* object with corresponding tag and */ + /* length; the object will be accessible through subElem */ + OFBool readAsUN = OFFalse; + OFCondition l_error = DcmItem::newDicomElement(subElem, newTag, newLength, &privateCreatorCache, readAsUN); + + /* if no error occurred and subElem does not equal NULL, go ahead */ + if (l_error.good() && subElem != NULL) + { + // inStream.UnsetPutbackMark(); // not needed anymore with new stream architecture + + /* insert the new element into the (sorted) element list and */ + /* assign information which was read from the inStream to it */ + subElem->transferInit(); + /* we need to read the content of the attribute, no matter if */ + /* inserting the attribute succeeds or fails */ + l_error = subElem->read(inStream, (readAsUN ? EXS_LittleEndianImplicit : xfer), glenc, maxReadLength); + // try to insert element into item. Note that + // "elementList->insert(subElem, ELP_next)" would be faster, + // but this is better since this insert-function creates a + // sorted element list. + // We insert the element even if subElem->read() reported an error + // because otherwise I/O suspension would fail. + OFCondition temp_error = insert(subElem, OFFalse, OFTrue); + + if (temp_error.bad()) + { + // produce diagnostics + DCMDATA_WARN("DcmItem: Element " << newTag + << " found twice in one data set or item, ignoring second entry"); + delete subElem; + } + } + /* else if an error occurred, try to recover from this error */ + else if (l_error == EC_InvalidTag) + { + /* This is the second putback operation on the putback mark in */ + /* readTagAndLength but it is impossible that both can be executed */ + /* without setting the Mark twice. */ + inStream.putback(); + DCMDATA_WARN("DcmItem: Parse error while parsing element " << newTag); + } + else if (l_error == EC_UndefinedLengthOBOW) + { + // do nothing + } + else if (l_error == EC_VOI_LUT_OBOW) + { + // do nothing + } + else if (l_error != EC_ItemEnd) + { + // inStream.UnsetPutbackMark(); // not needed anymore with new stream architecture + + // dump some information if required + if (dcmIgnoreParsingErrors.get() || (dcmReplaceWrongDelimitationItem.get() && (l_error == EC_SequEnd))) + { + DCMDATA_WARN("DcmItem: Parse error in sequence item, found " << newTag + << " instead of item delimiter " << DCM_ItemDelimitationItem); + } else { + DCMDATA_ERROR("DcmItem: Parse error in sequence item, found " << newTag + << " instead of item delimiter " << DCM_ItemDelimitationItem); + } + // some systems use the wrong delimitation item at the end of a sequence + if (dcmReplaceWrongDelimitationItem.get() && (l_error == EC_SequEnd)) + { + DCMDATA_DEBUG("DcmItem::readSubItem() replacing wrong sequence delimiter " + << DCM_SequenceDelimitationItem << " by item delimiter " + << DCM_ItemDelimitationItem << " because it is expected here"); + l_error = EC_ItemEnd; + } else { + DCMDATA_DEBUG("DcmItem::readSubElement() cannot create Sub Element " << newTag); + // treat this incorrect encoding as an error + if (!dcmIgnoreParsingErrors.get()) + l_error = EC_ItemDelimitationItemMissing; + } + } else { + // inStream.UnsetPutbackMark(); // not needed anymore with new stream architecture + } + + /* dump some information if required */ + DCMDATA_TRACE("DcmItem::readSubItem() returns error = " << l_error.text()); + /* return result value */ + return l_error; +} + + +// ******************************** + + +OFCondition DcmItem::read(DcmInputStream & inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + return DcmItem::readUntilTag(inStream, xfer, glenc, maxReadLength, DCM_UndefinedTagKey); +} + +OFCondition DcmItem::readUntilTag(DcmInputStream & inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength, + const DcmTagKey &stopParsingAtElement) +{ + /* check if this is an illegal call; if so set the error flag and do nothing, else go ahead */ + if (getTransferState() == ERW_notInitialized) + { + errorFlag = EC_IllegalCall; + return errorFlag; + } + + /* figure out if the stream reported an error */ + errorFlag = inStream.status(); + /* if the stream reported an error or if it is the end of the */ + /* stream, set the error flag correspondingly; else go ahead */ + if (errorFlag.good() && inStream.eos()) + errorFlag = EC_EndOfStream; + else if (errorFlag.good() && getTransferState() != ERW_ready) + { + /* if the transfer state of this item is ERW_init, get its start */ + /* position in the stream and set the transfer state to ERW_inWork */ + if (getTransferState() == ERW_init) + { + fStartPosition = inStream.tell(); // start position of this item + setTransferState(ERW_inWork); + } + DcmTag newTag; + OFBool readStopElem = OFFalse; + /* start a loop in order to read all elements (attributes) which are contained in the inStream */ + while (inStream.good() && (getTransferredBytes() < getLengthField() || !lastElementComplete) && !readStopElem) + { + /* initialize variables */ + Uint32 newValueLength = 0; + Uint32 bytes_tagAndLen = 0; + /* if the reading of the last element was complete, go ahead and read the next element */ + if (lastElementComplete) + { + /* read this element's tag and length information */ + /* (and possibly also VR information) from the inStream */ + errorFlag = readTagAndLength(inStream, xfer, newTag, newValueLength, bytes_tagAndLen); + /* increase counter correspondingly */ + incTransferredBytes(bytes_tagAndLen); + + /* if desired, try to ignore parse error -> skip item */ + if ((errorFlag == EC_ElemLengthLargerThanItem) && dcmIgnoreParsingErrors.get()) + { + DCMDATA_WARN("DcmItem: Element " << newTag.getTagName() << " " << newTag + << " too large, trying to skip over rest of item"); + /* we can call getLengthField because error does only occur for explicit length items */ + const offile_off_t bytesToSkip = getLengthField() - bytes_tagAndLen; + if (bytesToSkip > inStream.avail()) // no chance to recover + break; + inStream.skip(bytesToSkip); + errorFlag = EC_Normal; + } + /* if desired, accept premature sequence delimitation item and continue as if item has been completely read. */ + /* The stream position has been rewound to the start position of the sequence end */ + /* delimiter tag in order to let DcmSequenceOfItems handle the delimiter in the reading routine. */ + else if ((errorFlag == EC_PrematureSequDelimitationItem) && dcmIgnoreParsingErrors.get()) + { + DCMDATA_WARN("DcmItem: Sequence delimitation occurred before all bytes announced by explicit item length could be read" + << ", trying to continue as if item was completely read"); + errorFlag = EC_ItemEnd; // make sure that error code leads to normal return from item reading loop + break; // we are completed with the item since sequence is closed + } + else /* continue with normal case: parse rest of element */ + { + /* if there was an error while we were reading from the stream, terminate the while-loop */ + /* (note that if the last element had been read from the inStream in the last iteration, */ + /* another iteration will be started, and of course then readTagAndLength(...) above will */ + /* return that it encountered the end of the stream. It is only then (and here) when the */ + /* while loop will be terminated.) */ + if (errorFlag.bad()) + break; + /* If we get to this point, we just started reading the first part */ + /* of an element; hence, lastElementComplete is not longer true */ + lastElementComplete = OFFalse; + /* in case of implicit VR, check whether the "default VR" is really appropriate */ + if (DcmXfer(xfer).isImplicitVR()) + checkAndUpdateVR(*this, newTag); + + /* check if we want to stop parsing at this point, in the main dataset only */ + if( (stopParsingAtElement != DCM_UndefinedTagKey) && (newTag.getXTag()>=stopParsingAtElement) && ident() == EVR_dataset) + { + lastElementComplete = OFTrue; + readStopElem = OFTrue; + DCMDATA_WARN("DcmItem: Element " << newTag.getTagName() << " " << newTag + << " encountered, skipping rest of dataset"); + } + else + { + /* read the actual data value which belongs to this element */ + /* (attribute) and insert this information into the elementList */ + errorFlag = readSubElement(inStream, newTag, newValueLength, xfer, glenc, maxReadLength); + /* if reading was successful, we read the entire data value information */ + /* for this element; hence lastElementComplete is true again */ + if (errorFlag.good()) + lastElementComplete = OFTrue; + + /* in data or command sets, group 0x0001 to 0x0003, 0x0005, 0x0007 and 0xFFFF are not allowed. */ + /* (we cannot check for group 0x0000 since we do not know whether we read a data or command set.)*/ + if (!newTag.hasValidGroup() || (newTag.getGroup() == 0x0002)) + DCMDATA_WARN("DcmItem: Invalid Element " << newTag << " found in data set"); + } + } + } else { + /* if lastElementComplete is false, we have only read the current element's */ + /* tag and length (and possibly VR) information as well as maybe some data */ + /* data value information. We need to continue reading the data value */ + /* information for this particular element. */ + errorFlag = elementList->get()->read(inStream, xfer, glenc, maxReadLength); + /* if reading was successful, we read the entire information */ + /* for this element; hence lastElementComplete is true */ + if (errorFlag.good()) + lastElementComplete = OFTrue; + } + /* remember how many bytes were read */ + setTransferredBytes(OFstatic_cast(Uint32, inStream.tell() - fStartPosition)); + if (errorFlag.good()) + { + // If we completed one element, update the private tag cache. + if (lastElementComplete) + { + privateCreatorCache.updateCache(elementList->get()); + // evaluate option for skipping rest of dataset + if ( (dcmStopParsingAfterElement.get() != DCM_UndefinedTagKey) && + (dcmStopParsingAfterElement.get() == elementList->get()->getTag()) && + ident() == EVR_dataset) + { + DCMDATA_WARN("DcmItem: Element " << newTag.getTagName() << " " << newTag + << " encountered, skipping rest of data set"); + readStopElem = OFTrue; + } + } + } else + break; // if some error was encountered terminate the while-loop + } //while + + /* determine an appropriate result value; note that if the above called read function */ + /* encountered the end of the stream before all information for this element could be */ + /* read from the stream, the errorFlag has already been set to EC_StreamNotifyClient. */ + if (errorFlag.good()) + { + // if stop element was read or end of stream occurs, tell parser end of stream is reached + if (readStopElem || inStream.eos()) + errorFlag = EC_EndOfStream; + // if all bytes could be read or last element read could not be completed, set to error + else if ((getTransferredBytes() < getLengthField() || !lastElementComplete)) + errorFlag = EC_StreamNotifyClient; + } + } // else errorFlag + /* modify the result value: three kinds of special error codes do not count as an error */ + if (errorFlag == EC_ItemEnd || errorFlag == EC_EndOfStream) + errorFlag = EC_Normal; + else if (errorFlag == EC_SequEnd) + { + if (dcmIgnoreParsingErrors.get()) + { + /* do not treat the missing delimiter as an error */ + errorFlag = EC_Normal; + } else + errorFlag = EC_ItemDelimitationItemMissing; + } + + /* if at this point the error flag indicates success, the item has */ + /* been read completely; hence, set the transfer state to ERW_ready. */ + /* Note that all information for this element could be read from the */ + /* stream, the errorFlag is still set to EC_StreamNotifyClient. */ + if (errorFlag.good()) + setTransferState(ERW_ready); + + /* dump information if required */ + DCMDATA_TRACE("DcmItem::read() returns error = " << errorFlag.text()); + + /* return result value */ + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmItem::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + errorFlag = outStream.status(); + if (errorFlag.good() && getTransferState() != ERW_ready) + { + if (getTransferState() == ERW_init) + { + if (outStream.avail() >= 8) + { + if (enctype == EET_ExplicitLength) + setLengthField(getLength(oxfer, enctype)); + else + setLengthField(DCM_UndefinedLength); + if (errorFlag == EC_SeqOrItemContentOverflow) + return errorFlag; + errorFlag = writeTag(outStream, getTag(), oxfer); + Uint32 valueLength = getLengthField(); + DcmXfer outXfer(oxfer); + const E_ByteOrder oByteOrder = outXfer.getByteOrder(); + if (oByteOrder == EBO_unknown) return EC_IllegalCall; + swapIfNecessary(oByteOrder, gLocalByteOrder, &valueLength, 4, 4); + outStream.write(&valueLength, 4); // 4 bytes length + elementList->seek(ELP_first); + setTransferState(ERW_inWork); + } else + errorFlag = EC_StreamNotifyClient; + } + if (getTransferState() == ERW_inWork) + { + // elementList->get() can be NULL if buffer was full after + // writing the last item but before writing the sequence delimitation. + if (!elementList->empty() && (elementList->get() != NULL)) + { + DcmObject *dO = NULL; + do + { + dO = elementList->get(); + if (dO->transferState() != ERW_ready) + errorFlag = dO->write(outStream, oxfer, enctype, wcache); + } while (errorFlag.good() && elementList->seek(ELP_next)); + } + if (errorFlag.good()) + { + setTransferState(ERW_ready); + if (getLengthField() == DCM_UndefinedLength) + { + if (outStream.avail() >= 8) + { + // write Item delimitation + DcmTag delim(DCM_ItemDelimitationItemTag); + errorFlag = writeTag(outStream, delim, oxfer); + Uint32 delimLen = 0L; + outStream.write(&delimLen, 4); // 4 bytes length + } + else + { + // Every subelement of the item is written but it + // is not possible to write the delimitation item into the buffer. + errorFlag = EC_StreamNotifyClient; + setTransferState(ERW_inWork); + } + } + } + } + } + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmItem::writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + errorFlag = outStream.status(); + if (errorFlag.good() && getTransferState() != ERW_ready) + { + if (getTransferState() == ERW_init) + { + if (outStream.avail() >= 4) + { + if (enctype == EET_ExplicitLength) + setLengthField(getLength(oxfer, enctype)); + else + setLengthField(DCM_UndefinedLength); + errorFlag = writeTag(outStream, getTag(), oxfer); + /* we don't write the item length */ + elementList->seek(ELP_first); + setTransferState(ERW_inWork); + } else + errorFlag = EC_StreamNotifyClient; + } + if (getTransferState() == ERW_inWork) + { + // elementList->get() can be NULL if buffer was full after + // writing the last item but before writing the sequence delimitation. + if (!elementList->empty() && (elementList->get() != NULL)) + { + DcmObject *dO = NULL; + do + { + dO = elementList->get(); + if (dO->transferState() != ERW_ready) + errorFlag = dO->writeSignatureFormat(outStream, oxfer, enctype, wcache); + } while (errorFlag.good() && elementList->seek(ELP_next)); + } + if (errorFlag.good()) + { + setTransferState(ERW_ready); + /* we don't write an item delimitation even if the item has undefined length */ + } + } + } + } + return errorFlag; +} + + +// ******************************** + + +OFBool DcmItem::isNested() const +{ + OFBool nested = OFFalse; + if (getParent() != NULL) + { + // check for surrounding structure of sequence of items + const DcmEVR parentIdent = getParent()->ident(); + if ((parentIdent == EVR_SQ) || (parentIdent == EVR_pixelSQ)) + nested = OFTrue; + } + return nested; +} + + +DcmItem *DcmItem::getParentItem() +{ + DcmItem *parentItem = NULL; + if (getParent() != NULL) + { + // make sure that the direct parent has the correct type + const DcmEVR parentIdent = getParent()->ident(); + if ((parentIdent == EVR_SQ) || (parentIdent == EVR_pixelSQ)) + { + DcmObject *parent = getParent()->getParent(); + if (parent != NULL) + { + // make sure that it is really a class derived from DcmItem + switch (parent->ident()) + { + case EVR_metainfo: + case EVR_dataset: + case EVR_item: + case EVR_dirRecord: + parentItem = OFreinterpret_cast(DcmItem *, parent); + break; + default: + DCMDATA_DEBUG("DcmItem::getParentItem() Parent object has wrong class identifier: " + << OFstatic_cast(int, parent->ident()) + << " (" << DcmVR(parent->ident()).getVRName() << ")"); + break; + } + } + // When our parent is a fileformat, we should be a dataset or a metainfo. + // In these cases, there really is no parent item, so no message. + } else if (parentIdent != EVR_fileFormat) { + DCMDATA_DEBUG("DcmItem::getParentItem() Direct parent object is not a sequence element"); + } + } + return parentItem; +} + + +// ******************************** + + +void DcmItem::transferInit() +{ + DcmObject::transferInit(); + fStartPosition = 0; + lastElementComplete = OFTrue; + privateCreatorCache.clear(); + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + elementList->get()->transferInit(); + } while (elementList->seek(ELP_next)); + } +} + + +void DcmItem::transferEnd() +{ + DcmObject::transferEnd(); + privateCreatorCache.clear(); + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + elementList->get()->transferEnd(); + } while (elementList->seek(ELP_next)); + } +} + + +// ******************************** + + +OFCondition DcmItem::insert(DcmElement *elem, + OFBool replaceOld, + OFBool checkInsertOrder) +{ + /* initialize error flag with ok */ + errorFlag = EC_Normal; + /* do something only if the pointer which was passed does not equal NULL */ + if (elem != NULL) + { + DcmElement *dE; + E_ListPos seekmode = ELP_last; + /* iterate through elementList (from the last element to the first) */ + do { + /* get current element from elementList */ + dE = OFstatic_cast(DcmElement *, elementList->seek(seekmode)); + /* if there is no element, i.e. elementList is empty */ + if (dE == NULL) + { + /* insert new element at the beginning of elementList */ + elementList->insert(elem, ELP_first); + if (checkInsertOrder) + { + // check if we have inserted at the end of the list + if (elem != OFstatic_cast(DcmElement *, elementList->seek(ELP_last))) + { + // produce diagnostics + DCMDATA_WARN("DcmItem: Dataset not in ascending tag order, at element " << elem->getTag()); + } + } + /* dump some information if required */ + DCMDATA_TRACE("DcmItem::insert() Element " << elem->getTag() + << " VR=\"" << DcmVR(elem->getVR()).getVRName() << "\" inserted at beginning"); + /* check whether the new element already has a parent */ + if (elem->getParent() != NULL) + { + DCMDATA_DEBUG("DcmItem::insert() Element " << elem->getTag() << " already has a parent: " + << elem->getParent()->getTag() << " VR=" << DcmVR(elem->getParent()->getVR()).getVRName()); + } + /* remember the parent (i.e. the surrounding item/dataset) */ + elem->setParent(this); + /* terminate do-while-loop */ + break; + } + /* else if the new element's tag is greater than the current element's tag */ + /* (i.e. we have found the position where the new element shall be inserted) */ + else if (elem->getTag() > dE->getTag()) + { + /* insert the new element after the current element */ + elementList->insert(elem, ELP_next); + if (checkInsertOrder) + { + // check if we have inserted at the end of the list + if (elem != OFstatic_cast(DcmElement *, elementList->seek(ELP_last))) + { + // produce diagnostics + DCMDATA_WARN("DcmItem: Dataset not in ascending tag order, at element " << elem->getTag()); + } + } + /* dump some information if required */ + DCMDATA_TRACE("DcmItem::insert() Element " << elem->getTag() + << " VR=\"" << DcmVR(elem->getVR()).getVRName() << "\" inserted"); + /* check whether the new element already has a parent */ + if (elem->getParent() != NULL) + { + DCMDATA_DEBUG("DcmItem::insert() Element " << elem->getTag() << " already has a parent: " + << elem->getParent()->getTag() << " VR=" << DcmVR(elem->getParent()->getVR()).getVRName()); + } + /* remember the parent (i.e. the surrounding item/dataset) */ + elem->setParent(this); + /* terminate do-while-loop */ + break; + } + /* else if the current element and the new element show the same tag */ + else if (elem->getTag() == dE->getTag()) + { + /* if new and current element are not identical */ + if (elem != dE) + { + /* if the current (old) element shall be replaced */ + if (replaceOld) + { + /* remove current element from list */ + DcmObject *remObj = elementList->remove(); + + /* now the following holds: remObj == dE and elementList */ + /* points to the element after the former current element. */ + + /* if the pointer to the removed object does not */ + /* equal NULL (the usual case), delete this object */ + /* and dump some information if required */ + if (remObj != NULL) + { + /* dump some information if required */ + DCMDATA_TRACE("DcmItem::insert() Element " << remObj->getTag() + << " VR=\"" << DcmVR(remObj->getVR()).getVRName() + << "\" p=" << OFstatic_cast(void *, remObj) << " removed and deleted"); + delete remObj; + } + /* insert the new element before the current element */ + elementList->insert(elem, ELP_prev); + /* dump some information if required */ + DCMDATA_TRACE("DcmItem::insert() Element " << elem->getTag() + << " VR=\"" << DcmVR(elem->getVR()).getVRName() + << "\" p=" << OFstatic_cast(void *, elem) << " replaced older one"); + /* check whether the new element already has a parent */ + if (elem->getParent() != NULL) + { + DCMDATA_DEBUG("DcmItem::insert() Element " << elem->getTag() << " already has a parent: " + << elem->getParent()->getTag() << " VR=" << DcmVR(elem->getParent()->getVR()).getVRName()); + } + /* remember the parent (i.e. the surrounding item/dataset) */ + elem->setParent(this); + } // if (replaceOld) + /* or else, i.e. the current element shall not be replaced by the new element */ + else { + /* set the error flag correspondingly; we do not */ + /* allow two elements with the same tag in elementList */ + errorFlag = EC_DoubledTag; + } // if (!replaceOld) + } // if (elem != dE) + /* if the new and the current element are identical, the caller tries to insert */ + /* one element twice. Most probably an application error. */ + else { + errorFlag = EC_DoubledTag; + } + /* terminate do-while-loop */ + break; + } + /* set the seek mode to "get the previous element" */ + seekmode = ELP_prev; + } while (dE); + } + /* if the pointer which was passed equals NULL, this is an illegal call */ + else + errorFlag = EC_IllegalCall; + /* return result value */ + return errorFlag; +} + + +// ******************************** + + +DcmElement *DcmItem::getElement(const unsigned long num) +{ + errorFlag = EC_Normal; + DcmElement *elem; + elem = OFstatic_cast(DcmElement *, elementList->seek_to(num)); + /* reads element from list */ + if (elem == NULL) + errorFlag = EC_IllegalCall; + return elem; +} + + +// ******************************** + + +DcmObject *DcmItem::nextInContainer(const DcmObject *obj) +{ + if (!obj) + return elementList->get(ELP_first); + else + { + if (elementList->get() != obj) + { + for(DcmObject * search_obj = elementList->seek(ELP_first); + search_obj && search_obj != obj; + search_obj = elementList->seek(ELP_next) + ) { + /* do nothing, just keep iterating */ + } + } + return elementList->seek(ELP_next); + } +} + + +// ******************************** + + +OFCondition DcmItem::nextObject(DcmStack &stack, + const OFBool intoSub) +{ + OFCondition l_error = EC_Normal; + DcmObject * container = NULL; + DcmObject * obj = NULL; + DcmObject * result = NULL; + OFBool examSub = intoSub; + + if (stack.empty()) + { + stack.push(this); + examSub = OFTrue; + } + + obj = stack.top(); + if (obj->isLeaf() || !intoSub) + { + stack.pop(); + if (stack.card() > 0) + { + container = stack.top(); + result = container->nextInContainer(obj); + } + } else if (examSub) + result = obj->nextInContainer(NULL); + + if (result) + stack.push(result); + else if (intoSub) + l_error = nextUp(stack); + else + l_error = EC_SequEnd; + + return l_error; +} + + +// ******************************** + + +DcmElement *DcmItem::remove(const unsigned long num) +{ + errorFlag = EC_Normal; + DcmElement *elem; + elem = OFstatic_cast(DcmElement *, elementList->seek_to(num)); + // read element from list + if (elem != NULL) + { + elementList->remove(); // removes element from list but does not delete it + elem->setParent(NULL); // forget about the parent + } else + errorFlag = EC_IllegalCall; + return elem; +} + + +// ******************************** + + +DcmElement *DcmItem::remove(DcmObject *elem) +{ + errorFlag = EC_IllegalCall; + if (!elementList->empty() && elem != NULL) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + if (dO == elem) + { + elementList->remove(); // removes element from list but does not delete it + elem->setParent(NULL); // forget about the parent + errorFlag = EC_Normal; + break; + } + } while (elementList->seek(ELP_next)); + } + if (errorFlag == EC_IllegalCall) + return NULL; + else + return OFstatic_cast(DcmElement *, elem); +} + + +// ******************************** + + +DcmElement *DcmItem::remove(const DcmTagKey &tag) +{ + errorFlag = EC_TagNotFound; + DcmObject *dO = NULL; + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + dO = elementList->get(); + if (dO->getTag() == tag) + { + elementList->remove(); // removes element from list but does not delete it + dO->setParent(NULL); // forget about the parent + errorFlag = EC_Normal; + break; + } + } while (elementList->seek(ELP_next)); + } + + if (errorFlag == EC_TagNotFound) + return NULL; + else + return OFstatic_cast(DcmElement *, dO); +} + + +// ******************************** + + +OFCondition DcmItem::clear() +{ + errorFlag = EC_Normal; + // remove all elements from item and delete them from memory + elementList->deleteAllElements(); + setLengthField(0); + + return errorFlag; +} + + +OFBool DcmItem::isEmpty(const OFBool /*normalize*/) +{ + return elementList->empty(); +} + + +// ******************************** + + +OFCondition DcmItem::verify(const OFBool autocorrect) +{ + errorFlag = EC_Normal; + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + if (dO->verify(autocorrect).bad()) + errorFlag = EC_CorruptedData; + } while (elementList->seek(ELP_next)); + } + if (autocorrect) + setLengthField(getLength()); + return errorFlag; +} + + +// ******************************** + +// Precondition: elementList is non-empty! +// Result: - return EC_Normal; +// push element pointer on resultStack +// - return EC_TagNotFound; +// resultStack unmodified +// Search again: push pointer of sub-element on resultStack and +// start sub-search + +OFCondition DcmItem::searchSubFromHere(const DcmTagKey &tag, + DcmStack &resultStack, + OFBool searchIntoSub) +{ + DcmObject *dO; + OFCondition l_error = EC_TagNotFound; + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + dO = elementList->get(); + if (searchIntoSub) + { + resultStack.push(dO); + if (dO->getTag() == tag) + l_error = EC_Normal; + else + l_error = dO->search(tag, resultStack, ESM_fromStackTop, OFTrue); + if (l_error.bad()) + resultStack.pop(); + } else { + if (dO->getTag() == tag) + { + resultStack.push(dO); + l_error = EC_Normal; + } + } + } while (l_error.bad() && elementList->seek(ELP_next)); + if (l_error==EC_Normal && dO->getTag()==tag) + { + DCMDATA_TRACE("DcmItem::searchSubFromHere() Element " << tag << " found"); + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmItem::search(const DcmTagKey &tag, + DcmStack &resultStack, + E_SearchMode mode, + OFBool searchIntoSub) +{ + DcmObject *dO = NULL; + OFCondition l_error = EC_TagNotFound; + if (mode == ESM_afterStackTop && resultStack.top() == this) + { + l_error = searchSubFromHere(tag, resultStack, searchIntoSub); + } + else if (!elementList->empty()) + { + if (mode == ESM_fromHere || resultStack.empty()) + { + resultStack.clear(); + l_error = searchSubFromHere(tag, resultStack, searchIntoSub); + } + else if (mode == ESM_fromStackTop) + { + dO = resultStack.top(); + if (dO == this) + l_error = searchSubFromHere(tag, resultStack, searchIntoSub); + else + { // gehe direkt zu Sub-Baum und suche dort weiter + l_error = dO->search(tag, resultStack, mode, searchIntoSub); +// The next two lines destroy the stack->so delete them +// if (l_error.bad()) // raeumt nur die oberste Stackebene +// resultStack.pop(); // ab; der Rest ist unveraendert + } + } + else if (mode == ESM_afterStackTop && searchIntoSub) + { + // resultStack enthaelt Zielinformationen: + // - stelle Zustand der letzen Suche in den einzelnen Suchroutinen + // wieder her + // - finde Position von dO in Baum-Struktur + // 1. suche eigenen Stack-Eintrag + // - bei Fehlschlag Suche beenden + // 2. nehme naechsthoeheren Eintrag dnO + // 3. stelle eigene Liste auf Position von dnO + // 4. starte Suche ab dnO + + unsigned long i = resultStack.card(); + while (i > 0 && (dO = resultStack.elem(i-1)) != this) + { + i--; + } + if (dO != this && resultStack.card() > 0) + { // oberste Ebene steht nie in resultStack + i = resultStack.card()+1;// zeige jetzt auf hoechste Ebene+1 + dO = this; // Treffer der hoechsten Ebene! + } + if (dO == this) + { + if (i == 1) // habe resultStack.top() gefunden + l_error = EC_TagNotFound; // markiere als kein Treffer, s.o. + else // siehe oben + { + E_SearchMode submode = mode; + OFBool searchNode = OFTrue; + DcmObject *dnO; + dnO = resultStack.elem(i - 2); // Knoten der naechsten Ebene + elementList->seek(ELP_first); + do { + dO = elementList->get(); + searchNode = searchNode ? (dO != dnO) : OFFalse; + if (!searchNode) + { // suche jetzt weiter + if (submode == ESM_fromStackTop) + resultStack.push(dO); // Stack aktualisieren + if (submode == ESM_fromStackTop && dO->getTag() == tag) + l_error = EC_Normal; + else + l_error = dO->search(tag, resultStack, submode, OFTrue); + if (l_error.bad()) + resultStack.pop(); + else + break; + submode = ESM_fromStackTop; // ab hier normale Suche + } + } while (elementList->seek(ELP_next)); + } + } else + l_error = EC_IllegalCall; + } // (mode == ESM_afterStackTop + else + l_error = EC_IllegalCall; + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmItem::loadAllDataIntoMemory() +{ + OFCondition l_error = EC_Normal; + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + OFCondition err = EC_Normal; + DcmObject *dO = elementList->get(); + if ((err = dO->loadAllDataIntoMemory()).bad()) + l_error = err; + } while (elementList->seek(ELP_next)); + } + return l_error; +} + + +// ******************************** + + +void DcmItem::compactElements(const Uint32 maxLength) +{ + DcmStack stack; + DcmObject *object = NULL; + /* iterate over all elements */ + while (nextObject(stack, OFTrue).good()) + { + object = stack.top(); + // compact element if maximum length is exceeded + if (object->isLeaf() && (object->getLength() > maxLength)) + OFstatic_cast(DcmElement *, object)->compact(); + } +} + + +// ******************************** + +// Support functions + + +OFCondition nextUp(DcmStack &stack) +{ + DcmObject *oldContainer = stack.pop(); + if (oldContainer->isLeaf()) + return EC_IllegalCall; + else if (!stack.empty()) + { + DcmObject *container = stack.top(); + DcmObject *result = container->nextInContainer(oldContainer); + if (result) + { + stack.push(result); + return EC_Normal; + } + else + return nextUp(stack); + } + return EC_TagNotFound; +} + + +/* +** Simple tests for existence +*/ + +OFBool DcmItem::tagExists(const DcmTagKey &key, + OFBool searchIntoSub) +{ + DcmStack stack; + + OFCondition ec = search(key, stack, ESM_fromHere, searchIntoSub); + return (ec.good()); +} + + +OFBool DcmItem::tagExistsWithValue(const DcmTagKey &key, + OFBool searchIntoSub) +{ + DcmStack stack; + OFBool result = OFFalse; + + if (search(key, stack, ESM_fromHere, searchIntoSub).good()) + { + DcmElement *elem = OFstatic_cast(DcmElement *, stack.top()); + if (elem != NULL) + result = !(elem->isEmpty()); + } + + return result; +} + + +// ******************************** + +/* --- findAndGet functions: find an element and get it or the value, respectively --- */ + +OFCondition DcmItem::findAndGetElement(const DcmTagKey &tagKey, + DcmElement *&element, + const OFBool searchIntoSub, + const OFBool createCopy) +{ + DcmStack stack; + /* find the element */ + OFCondition status = search(tagKey, stack, ESM_fromHere, searchIntoSub); + if (status.good()) + { + element = OFstatic_cast(DcmElement *, stack.top()); + /* should never happen but ... */ + if (element == NULL) + status = EC_CorruptedData; + else if (createCopy) + { + /* create a copy of the element */ + element = OFstatic_cast(DcmElement *, element->clone()); + if (element == NULL) + status = EC_MemoryExhausted; + } + } else { + /* reset element pointer */ + element = NULL; + } + return status; +} + + +OFCondition DcmItem::findAndGetElements(const DcmTagKey &tagKey, + DcmStack &resultStack) +{ + OFCondition status = EC_TagNotFound; + DcmStack stack; + DcmObject *object = NULL; + /* iterate over all elements */ + while (nextObject(stack, OFTrue).good()) + { + /* get element */ + object = stack.top(); + if (object->getTag() == tagKey) + { + /* add it to the result stack */ + resultStack.push(object); + status = EC_Normal; + } + } + return status; +} + + +OFCondition DcmItem::findAndGetString(const DcmTagKey& tagKey, + const char *&value, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getString(OFconst_cast(char *&, value)); + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetString(const DcmTagKey& tagKey, + const char *&value, + Uint32 &length, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getString(OFconst_cast(char *&, value), length); + } + /* reset values */ + if (status.bad()) + { + value = NULL; + length = 0; + } + return status; +} + + +OFCondition DcmItem::findAndGetOFString(const DcmTagKey& tagKey, + OFString &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getOFString(value, pos); + } + /* reset value */ + if (status.bad()) + value.clear(); + return status; +} + + +OFCondition DcmItem::findAndGetOFStringArray(const DcmTagKey& tagKey, + OFString &value, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getOFStringArray(value); + } + /* reset value */ + if (status.bad()) + value.clear(); + return status; +} + + +OFCondition DcmItem::findAndGetUint8(const DcmTagKey& tagKey, + Uint8 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getUint8(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetUint8Array(const DcmTagKey& tagKey, + const Uint8 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Uint8 *array = NULL; + status = elem->getUint8Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetUint16(const DcmTagKey& tagKey, + Uint16 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getUint16(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetUint16Array(const DcmTagKey& tagKey, + const Uint16 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Uint16 *array = NULL; + status = elem->getUint16Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetSint16(const DcmTagKey& tagKey, + Sint16 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getSint16(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetSint16Array(const DcmTagKey& tagKey, + const Sint16 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Sint16 *array = NULL; + status = elem->getSint16Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetUint32(const DcmTagKey& tagKey, + Uint32 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getUint32(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetUint32Array(const DcmTagKey& tagKey, + const Uint32 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Uint32 *array = NULL; + status = elem->getUint32Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetSint32(const DcmTagKey& tagKey, + Sint32 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getSint32(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetSint32Array(const DcmTagKey& tagKey, + const Sint32 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Sint32 *array = NULL; + status = elem->getSint32Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetUint64(const DcmTagKey& tagKey, + Uint64 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getUint64(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetUint64Array(const DcmTagKey& tagKey, + const Uint64 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Uint64 *array = NULL; + status = elem->getUint64Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetSint64(const DcmTagKey& tagKey, + Sint64 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getSint64(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetSint64Array(const DcmTagKey& tagKey, + const Sint64 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Sint64 *array = NULL; + status = elem->getSint64Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetLongInt(const DcmTagKey& tagKey, + long int &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* distinguish supported VRs */ + switch (elem->ident()) + { + case EVR_UL: + case EVR_OL: + case EVR_up: + Uint32 ul; + status = elem->getUint32(ul, pos); + value = OFstatic_cast(long int, ul); + break; + case EVR_SL: + case EVR_IS: + Sint32 sl; + status = elem->getSint32(sl, pos); + value = OFstatic_cast(long int, sl); + break; + case EVR_US: + case EVR_xs: + case EVR_lt: + Uint16 us; + status = elem->getUint16(us, pos); + value = OFstatic_cast(long int, us); + break; + case EVR_SS: + Sint16 ss; + status = elem->getSint16(ss, pos); + value = OFstatic_cast(long int, ss); + break; + default: + status = EC_IllegalCall; + break; + } + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetFloat32(const DcmTagKey& tagKey, + Float32 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getFloat32(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetFloat32Array(const DcmTagKey& tagKey, + const Float32 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Float32 *array = NULL; + status = elem->getFloat32Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetFloat64(const DcmTagKey& tagKey, + Float64 &value, + const unsigned long pos, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + status = elem->getFloat64(value, pos); + } + /* reset value */ + if (status.bad()) + value = 0; + return status; +} + + +OFCondition DcmItem::findAndGetFloat64Array(const DcmTagKey& tagKey, + const Float64 *&value, + unsigned long *count, + const OFBool searchIntoSub) +{ + DcmElement *elem; + /* find the element */ + OFCondition status = findAndGetElement(tagKey, elem, searchIntoSub); + if (status.good()) + { + /* get the value */ + Float64 *array = NULL; + status = elem->getFloat64Array(array); + value = array; + } + /* set optional count parameter */ + if (count != NULL) + { + if (status.good()) + *count = elem->getNumberOfValues(); + else + *count = 0; + } + /* reset value */ + if (status.bad()) + value = NULL; + return status; +} + + +OFCondition DcmItem::findAndGetSequence(const DcmTagKey &seqTagKey, + DcmSequenceOfItems *&sequence, + const OFBool searchIntoSub, + const OFBool createCopy) +{ + DcmStack stack; + /* find the element */ + OFCondition status = search(seqTagKey, stack, ESM_fromHere, searchIntoSub); + if (status.good()) + { + DcmElement *delem = OFstatic_cast(DcmElement *, stack.top()); + /* should never happen but ... */ + if (delem == NULL) + status = EC_CorruptedData; + /* check for correct VR */ + else if ((delem->ident() == EVR_SQ) || (delem->ident() == EVR_pixelSQ)) + { + sequence = OFstatic_cast(DcmSequenceOfItems *, delem); + /* create a copy of the sequence? */ + if (createCopy) + { + sequence = OFstatic_cast(DcmSequenceOfItems *, sequence->clone()); + if (sequence == NULL) + status = EC_MemoryExhausted; + } + } else + status = EC_InvalidVR; + } + if (status.bad()) + { + /* reset sequence pointer */ + sequence = NULL; + } + return status; +} + + +OFCondition DcmItem::findAndGetSequenceItem(const DcmTagKey &seqTagKey, + DcmItem *&item, + const signed long itemNum, + const OFBool createCopy) +{ + DcmStack stack; + /* find sequence */ + OFCondition status = search(seqTagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + if (status.good()) + { + /* get element */ + DcmElement *delem = OFstatic_cast(DcmElement *, stack.top()); + if (delem != NULL) + { + /* check VR */ + if ((delem->ident() == EVR_SQ) || (delem->ident() == EVR_pixelSQ)) + { + DcmSequenceOfItems *sequence = OFstatic_cast(DcmSequenceOfItems *, delem); + const unsigned long count = sequence->card(); + /* empty sequence? */ + if (count > 0) + { + /* get last item */ + if (itemNum == -1) + item = sequence->getItem(count - 1); + /* get specified item */ + else if ((itemNum >= 0) && (OFstatic_cast(unsigned long, itemNum) < count)) + item = sequence->getItem(OFstatic_cast(unsigned long, itemNum)); + /* invalid item number */ + else + status = EC_IllegalParameter; + /* create a copy of the item? */ + if (createCopy) + { + if (status.good() && (item != NULL)) + { + item = OFstatic_cast(DcmItem *, item->clone()); + if (item == NULL) + status = EC_MemoryExhausted; + } + } + } else + status = EC_IllegalParameter; + } else + status = EC_InvalidVR; + } else + status = EC_CorruptedData; + } + /* reset item value */ + if (status.bad()) + item = NULL; + else if (item == NULL) + status = EC_IllegalCall; + return status; +} + + +// ******************************** + +/* --- findOrCreate functions: find an element or create a new one --- */ + +OFCondition DcmItem::findOrCreateSequenceItem(const DcmTag& seqTag, + DcmItem *&item, + const signed long itemNum) +{ + DcmStack stack; + /* find sequence */ + OFCondition status = search(seqTag, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + DcmSequenceOfItems *sequence = NULL; + /* sequence found? */ + if (status.good()) + { + /* get element */ + DcmElement *delem = OFstatic_cast(DcmElement *, stack.top()); + if (delem != NULL) + { + /* check VR */ + if ((delem->ident() == EVR_SQ) || (delem->ident() == EVR_pixelSQ)) + sequence = OFstatic_cast(DcmSequenceOfItems *, delem); + else + status = EC_InvalidVR; + } else + status = EC_CorruptedData; + } else { + /* create new sequence element */ + sequence = new DcmSequenceOfItems(seqTag); + if (sequence != NULL) + { + /* insert into item/dataset */ + status = insert(sequence, OFTrue /*replaceOld*/); + if (status.bad()) + delete sequence; + } else + status = EC_MemoryExhausted; + } + if (status.good()) + { + if (sequence != NULL) + { + const unsigned long count = sequence->card(); + /* existing item? */ + if ((count > 0) && (itemNum >= -1) && (itemNum < OFstatic_cast(signed long, count))) + { + if (itemNum == -1) + { + /* get last item */ + item = sequence->getItem(count - 1); + } else { + /* get specified item */ + item = sequence->getItem(OFstatic_cast(unsigned long, itemNum)); + } + /* create new item(s) */ + } else { + unsigned long i = 0; + /* create empty trailing items if required */ + const unsigned long itemCount = (itemNum > OFstatic_cast(signed long, count)) ? (itemNum - count + 1) : 1; + while ((i < itemCount) && status.good()) + { + item = new DcmItem(); + if (item != NULL) + { + /* append new item to end of sequence */ + status = sequence->append(item); + if (status.bad()) + delete item; + } else + status = EC_MemoryExhausted; + i++; + } + } + } else + status = EC_IllegalCall; + } + /* reset item value */ + if (status.bad()) + item = NULL; + else if (item == NULL) + status = EC_IllegalCall; + return status; +} + + +// ******************************** + + +/* --- findAndXXX functions: find an element and do something with it --- */ + +OFCondition DcmItem::findAndInsertCopyOfElement(const DcmTagKey &tagKey, + DcmItem *destItem, + const OFBool replaceOld) +{ + OFCondition status = EC_IllegalParameter; + if (destItem != NULL) + { + DcmElement *delem = NULL; + /* get copy of element from current dataset */ + status = findAndGetElement(tagKey, delem, OFFalse /*searchIntoSub*/, OFTrue /*createCopy*/); + if (status.good()) + { + /* ... and insert it into the destination dataset */ + status = destItem->insert(delem, replaceOld); + if (status.bad()) + delete delem; + } + } + return status; +} + + +OFCondition DcmItem::findAndDeleteElement(const DcmTagKey &tagKey, + const OFBool allOccurrences, + const OFBool searchIntoSub) +{ + OFCondition status = EC_TagNotFound; + DcmStack stack; + DcmObject *object = NULL; + OFBool intoSub = OFTrue; + /* iterate over all elements */ + while (nextObject(stack, intoSub).good()) + { + /* get element */ + object = stack.top(); + if (object->getTag() == tagKey) + { + stack.pop(); + /* remove element from dataset and free memory */ + delete OFstatic_cast(DcmItem *, stack.top())->remove(object); + status = EC_Normal; + /* delete only the first element? */ + if (!allOccurrences) + break; + } + intoSub = searchIntoSub || allOccurrences; + } + return status; +} + + +OFCondition DcmItem::findAndDeleteSequenceItem(const DcmTagKey &seqTagKey, + const signed long itemNum) +{ + DcmStack stack; + /* find sequence */ + OFCondition status = search(seqTagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + if (status.good()) + { + /* get element */ + DcmElement *delem = OFstatic_cast(DcmElement *, stack.top()); + if (delem != NULL) + { + /* check VR */ + if ((delem->ident() == EVR_SQ) || (delem->ident() == EVR_pixelSQ)) + { + DcmSequenceOfItems *sequence = OFstatic_cast(DcmSequenceOfItems *, delem); + const unsigned long count = sequence->card(); + /* last item? */ + if (itemNum == -1) + delete sequence->remove(count - 1); + /* valid item? */ + else if ((itemNum >= 0) && (OFstatic_cast(unsigned long, itemNum) < count)) + delete sequence->remove(OFstatic_cast(unsigned long, itemNum)); + else + status = EC_IllegalParameter; + } else + status = EC_InvalidVR; + } else + status = EC_CorruptedData; + } + return status; +} + + +// ******************************** + +/* --- putAndInsert functions: put value and insert new element --- */ + +OFCondition DcmItem::putAndInsertString(const DcmTag& tag, + const char *value, + const OFBool replaceOld) +{ + /* determine length of the string value */ + const Uint32 length = (value != NULL) ? OFstatic_cast(Uint32, strlen(value)) : 0; + /* call the real function */ + return putAndInsertString(tag, value, length, replaceOld); +} + + +OFCondition DcmItem::putAndInsertString(const DcmTag& tag, + const char *value, + const Uint32 length, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_AE: + elem = new DcmApplicationEntity(tag); + break; + case EVR_AS: + elem = new DcmAgeString(tag); + break; + case EVR_AT: + elem = new DcmAttributeTag(tag); + break; + case EVR_CS: + elem = new DcmCodeString(tag); + break; + case EVR_DA: + elem = new DcmDate(tag); + break; + case EVR_DS: + elem = new DcmDecimalString(tag); + break; + case EVR_DT: + elem = new DcmDateTime(tag); + break; + case EVR_FL: + elem = new DcmFloatingPointSingle(tag); + break; + case EVR_FD: + elem = new DcmFloatingPointDouble(tag); + break; + case EVR_IS: + elem = new DcmIntegerString(tag); + break; + case EVR_LO: + elem = new DcmLongString(tag); + break; + case EVR_LT: + elem = new DcmLongText(tag); + break; + case EVR_OB: + case EVR_OW: + elem = new DcmOtherByteOtherWord(tag); + break; + case EVR_OD: + elem = new DcmOtherDouble(tag); + break; + case EVR_OF: + elem = new DcmOtherFloat(tag); + break; + case EVR_OL: + elem = new DcmOtherLong(tag); + break; + case EVR_OV: + elem = new DcmOther64bitVeryLong(tag); + break; + case EVR_PN: + elem = new DcmPersonName(tag); + break; + case EVR_SH: + elem = new DcmShortString(tag); + break; + case EVR_SL: + elem = new DcmSignedLong(tag); + break; + case EVR_SS: + elem = new DcmSignedShort(tag); + break; + case EVR_ST: + elem = new DcmShortText(tag); + break; + case EVR_SV: + elem = new DcmSigned64bitVeryLong(tag); + break; + case EVR_TM: + elem = new DcmTime(tag); + break; + case EVR_UC: + elem = new DcmUnlimitedCharacters(tag); + break; + case EVR_UI: + elem = new DcmUniqueIdentifier(tag); + break; + case EVR_UL: + elem = new DcmUnsignedLong(tag); + break; + case EVR_UR: + elem = new DcmUniversalResourceIdentifierOrLocator(tag); + break; + case EVR_US: + elem = new DcmUnsignedShort(tag); + break; + case EVR_UT: + elem = new DcmUnlimitedText(tag); + break; + case EVR_UV: + elem = new DcmUnsigned64bitVeryLong(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putString(value, length); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertOFStringArray(const DcmTag& tag, + const OFString &value, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_AE: + elem = new DcmApplicationEntity(tag); + break; + case EVR_AS: + elem = new DcmAgeString(tag); + break; + case EVR_CS: + elem = new DcmCodeString(tag); + break; + case EVR_DA: + elem = new DcmDate(tag); + break; + case EVR_DS: + elem = new DcmDecimalString(tag); + break; + case EVR_DT: + elem = new DcmDateTime(tag); + break; + case EVR_IS: + elem = new DcmIntegerString(tag); + break; + case EVR_LO: + elem = new DcmLongString(tag); + break; + case EVR_LT: + elem = new DcmLongText(tag); + break; + case EVR_PN: + elem = new DcmPersonName(tag); + break; + case EVR_SH: + elem = new DcmShortString(tag); + break; + case EVR_ST: + elem = new DcmShortText(tag); + break; + case EVR_TM: + elem = new DcmTime(tag); + break; + case EVR_UC: + elem = new DcmUnlimitedCharacters(tag); + break; + case EVR_UI: + elem = new DcmUniqueIdentifier(tag); + break; + case EVR_UR: + elem = new DcmUniversalResourceIdentifierOrLocator(tag); + break; + case EVR_UT: + elem = new DcmUnlimitedText(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putOFStringArray(value); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertUint8Array(const DcmTag& tag, + const Uint8 *value, + const unsigned long count, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_OB: + elem = new DcmOtherByteOtherWord(tag); + break; + case EVR_ox: + /* special handling for Pixel Data */ + if (tag == DCM_PixelData) + { + elem = new DcmPixelData(tag); + if (elem != NULL) + elem->setVR(EVR_OB); + } else + elem = new DcmPolymorphOBOW(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putUint8Array(value, count); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertUint16(const DcmTag& tag, + const Uint16 value, + const unsigned long pos, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_US: + elem = new DcmUnsignedShort(tag); + break; + case EVR_lt: + case EVR_xs: + /* special handling */ + elem = new DcmUnsignedShort(DcmTag(tag, EVR_US)); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putUint16(value, pos); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertUint16Array(const DcmTag& tag, + const Uint16 *value, + const unsigned long count, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_AT: + elem = new DcmAttributeTag(tag); + break; + case EVR_lt: + case EVR_OW: + elem = new DcmOtherByteOtherWord(tag); + break; + case EVR_US: + elem = new DcmUnsignedShort(tag); + break; + case EVR_ox: + /* special handling */ + if (tag == DCM_PixelData) + { + elem = new DcmPixelData(tag); + if (elem != NULL) elem->setVR(EVR_OW); + } + else + elem = new DcmPolymorphOBOW(tag); + break; + case EVR_xs: + /* special handling */ + elem = new DcmUnsignedShort(DcmTag(tag, EVR_US)); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putUint16Array(value, count); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertSint16(const DcmTag& tag, + const Sint16 value, + const unsigned long pos, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_SS: + elem = new DcmSignedShort(tag); + break; + case EVR_lt: + case EVR_xs: + /* special handling */ + elem = new DcmSignedShort(DcmTag(tag, EVR_SS)); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putSint16(value, pos); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertSint16Array(const DcmTag& tag, + const Sint16 *value, + const unsigned long count, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_SS: + elem = new DcmSignedShort(tag); + break; + case EVR_lt: + case EVR_xs: + /* special handling */ + elem = new DcmSignedShort(DcmTag(tag, EVR_SS)); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putSint16Array(value, count); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertUint32(const DcmTag& tag, + const Uint32 value, + const unsigned long pos, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_UL: + elem = new DcmUnsignedLong(tag); + break; + case EVR_OL: + elem = new DcmOtherLong(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putUint32(value, pos); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertUint32Array(const DcmTag& tag, + const Uint32 *value, + const unsigned long count, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_OL: + elem = new DcmOtherLong(tag); + break; + case EVR_UL: + elem = new DcmUnsignedLong(tag); + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putUint32Array(value, count); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertSint32(const DcmTag& tag, + const Sint32 value, + const unsigned long pos, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_SL: + elem = new DcmSignedLong(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putSint32(value, pos); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertFloat32(const DcmTag& tag, + const Float32 value, + const unsigned long pos, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_FL: + elem = new DcmFloatingPointSingle(tag); + break; + case EVR_OF: + elem = new DcmOtherFloat(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putFloat32(value, pos); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertFloat32Array(const DcmTag& tag, + const Float32 *value, + const unsigned long count, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_FL: + elem = new DcmFloatingPointSingle(tag); + break; + case EVR_OF: + elem = new DcmOtherFloat(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putFloat32Array(value, count); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertFloat64(const DcmTag& tag, + const Float64 value, + const unsigned long pos, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_FD: + elem = new DcmFloatingPointDouble(tag); + break; + case EVR_OD: + elem = new DcmOtherDouble(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putFloat64(value, pos); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertFloat64Array(const DcmTag& tag, + const Float64 *value, + const unsigned long count, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_FD: + elem = new DcmFloatingPointDouble(tag); + break; + case EVR_OD: + elem = new DcmOtherDouble(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putFloat64Array(value, count); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::putAndInsertTagKey(const DcmTag& tag, + const DcmTagKey &value, + const unsigned long pos, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_AT: + elem = new DcmAttributeTag(tag); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* put value */ + status = elem->putTagVal(value, pos); + /* insert into dataset/item */ + if (status.good()) + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +// ******************************** + + +OFCondition DcmItem::insertEmptyElement(const DcmTag& tag, + const OFBool replaceOld) +{ + OFCondition status = EC_Normal; + /* create new element */ + DcmElement *elem = NULL; + switch(tag.getEVR()) + { + case EVR_AE: + elem = new DcmApplicationEntity(tag); + break; + case EVR_AS: + elem = new DcmAgeString(tag); + break; + case EVR_AT: + elem = new DcmAttributeTag(tag); + break; + case EVR_CS: + elem = new DcmCodeString(tag); + break; + case EVR_DA: + elem = new DcmDate(tag); + break; + case EVR_DS: + elem = new DcmDecimalString(tag); + break; + case EVR_DT: + elem = new DcmDateTime(tag); + break; + case EVR_FL: + elem = new DcmFloatingPointSingle(tag); + break; + case EVR_FD: + elem = new DcmFloatingPointDouble(tag); + break; + case EVR_IS: + elem = new DcmIntegerString(tag); + break; + case EVR_LO: + elem = new DcmLongString(tag); + break; + case EVR_LT: + elem = new DcmLongText(tag); + break; + case EVR_OB: + case EVR_OW: + elem = new DcmOtherByteOtherWord(tag); + break; + case EVR_OD: + elem = new DcmOtherDouble(tag); + break; + case EVR_OF: + elem = new DcmOtherFloat(tag); + break; + case EVR_OL: + elem = new DcmOtherLong(tag); + break; + case EVR_OV: + elem = new DcmOther64bitVeryLong(tag); + break; + case EVR_PN: + elem = new DcmPersonName(tag); + break; + case EVR_SH: + elem = new DcmShortString(tag); + break; + case EVR_SL: + elem = new DcmSignedLong(tag); + break; + case EVR_SQ: + elem = new DcmSequenceOfItems(tag); + break; + case EVR_SS: + elem = new DcmSignedShort(tag); + break; + case EVR_ST: + elem = new DcmShortText(tag); + break; + case EVR_SV: + elem = new DcmSigned64bitVeryLong(tag); + break; + case EVR_TM: + elem = new DcmTime(tag); + break; + case EVR_UC: + elem = new DcmUnlimitedCharacters(tag); + break; + case EVR_UI: + elem = new DcmUniqueIdentifier(tag); + break; + case EVR_UL: + elem = new DcmUnsignedLong(tag); + break; + case EVR_UR: + elem = new DcmUniversalResourceIdentifierOrLocator(tag); + break; + case EVR_US: + elem = new DcmUnsignedShort(tag); + break; + case EVR_UT: + elem = new DcmUnlimitedText(tag); + break; + case EVR_UV: + elem = new DcmUnsigned64bitVeryLong(tag); + break; + case EVR_PixelData: + elem = new DcmPixelData(tag); + // set VR to OW to make sure that we never write/send the internal VR + if (elem) elem->setVR(EVR_OW); + break; + case EVR_OverlayData: + elem = new DcmOverlayData(tag); + // set VR to OW to make sure that we never write/send the internal VR + if (elem) elem->setVR(EVR_OW); + break; + case EVR_UNKNOWN: + /* Unknown VR, e.g. tag not found in data dictionary */ + status = EC_UnknownVR; + break; + default: + status = EC_IllegalCall; + break; + } + if (elem != NULL) + { + /* insert new element into dataset/item */ + status = insert(elem, replaceOld); + /* could not be inserted, therefore, delete it immediately */ + if (status.bad()) + delete elem; + } else if (status.good()) + status = EC_MemoryExhausted; + return status; +} + + +OFCondition DcmItem::insertSequenceItem(const DcmTag &seqTag, + DcmItem *item, + const signed long itemNum) +{ + OFCondition status = EC_IllegalParameter; + if (item != NULL) + { + DcmStack stack; + /* find sequence */ + status = search(seqTag, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + DcmSequenceOfItems *sequence = NULL; + /* sequence found? */ + if (status.good()) + { + /* get element */ + DcmElement *delem = OFstatic_cast(DcmElement *, stack.top()); + if (delem != NULL) + { + /* check VR */ + if ((delem->ident() == EVR_SQ) || (delem->ident() == EVR_pixelSQ)) + sequence = OFstatic_cast(DcmSequenceOfItems *, delem); + else + status = EC_InvalidVR; + } else + status = EC_CorruptedData; + } else { + /* create new sequence element */ + sequence = new DcmSequenceOfItems(seqTag); + if (sequence != NULL) + { + /* insert into item/dataset */ + status = insert(sequence, OFTrue /*replaceOld*/); + if (status.bad()) + delete sequence; + } else + status = EC_MemoryExhausted; + } + if (status.good()) + { + if (sequence != NULL) + { + const unsigned long count = sequence->card(); + /* 'itemNum' specifies and existing item? */ + if ((count > 0) && (itemNum >= -1) && (itemNum < OFstatic_cast(signed long, count))) + { + if (itemNum == -1) + { + /* insert given item before last entry */ + status = sequence->insert(item, count - 1, OFTrue /*before*/); + } else { + /* insert given item before specified entry */ + status = sequence->insert(item, OFstatic_cast(unsigned long, itemNum), OFTrue /*before*/); + } + /* create empty item(s) and append */ + } else { + DcmItem *newItem = NULL; + unsigned long i = 0; + /* create empty trailing items if required */ + const unsigned long itemCount = (itemNum > OFstatic_cast(signed long, count)) ? (itemNum - count) : 0; + while ((i < itemCount) && status.good()) + { + newItem = new DcmItem(); + if (newItem != NULL) + { + /* append new item to end of sequence */ + status = sequence->append(newItem); + if (status.bad()) + delete newItem; + } else + status = EC_MemoryExhausted; + i++; + } + /* append given item to end of sequence */ + status = sequence->append(item); + } + } else + status = EC_IllegalCall; + } + } + return status; +} + + +// ******************************** + + +OFBool DcmItem::containsUnknownVR() const +{ + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + if (elementList->get()->containsUnknownVR()) + return OFTrue; + } while (elementList->seek(ELP_next)); + } + return OFFalse; +} + + +OFBool DcmItem::containsExtendedCharacters(const OFBool checkAllStrings) +{ + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + if (elementList->get()->containsExtendedCharacters(checkAllStrings)) + return OFTrue; + } while (elementList->seek(ELP_next)); + } + return OFFalse; +} + + +OFBool DcmItem::isAffectedBySpecificCharacterSet() const +{ + if (!elementList->empty()) + { + elementList->seek(ELP_first); + do { + if (elementList->get()->isAffectedBySpecificCharacterSet()) + return OFTrue; + } while (elementList->seek(ELP_next)); + } + return OFFalse; +} + + +// ******************************** + + +void DcmItem::updateSpecificCharacterSet(OFCondition &status, + const DcmSpecificCharacterSet &converter) +{ + const OFString encoding = converter.getDestinationEncoding(); + if (status.good()) + { + // check whether the attribute Specific Character Set (0008,0005) should be present at all + if (checkForSpecificCharacterSet()) + { + const OFString toCharset = converter.getDestinationCharacterSet(); + // check for default character set (ASCII), also make sure that the value "ISO_IR 6" is never used + // in a dataset; open question: should we also check for non-ASCII characters in the element value? + if (toCharset.empty() || (toCharset == "ISO_IR 6")) + { + // delete Specific Character Set (0008,0005) data element (type 1C) + if (findAndDeleteElement(DCM_SpecificCharacterSet, OFFalse /*allOccurrences*/, OFFalse /*searchIntoSub*/).good()) + { + DCMDATA_DEBUG("DcmItem::convertCharacterSet() deleted element SpecificCharacterSet " + << DCM_SpecificCharacterSet << " during the conversion to " << encoding << " encoding"); + } + } else { + DCMDATA_DEBUG("DcmItem::convertCharacterSet() updating value of element SpecificCharacterSet " + << DCM_SpecificCharacterSet << " to '" << toCharset << "'"); + // update/set value of Specific Character Set (0008,0005) if needed + status = putAndInsertOFStringArray(DCM_SpecificCharacterSet, toCharset); + } + } else { + // otherwise delete it (if present) + if (findAndDeleteElement(DCM_SpecificCharacterSet, OFFalse /*allOccurrences*/, OFFalse /*searchIntoSub*/).good()) + { + DCMDATA_WARN("DcmItem: Deleted element SpecificCharacterSet " << DCM_SpecificCharacterSet + << " during the conversion to " << encoding << " encoding"); + } + } + } else { + // an error occurred in a previous processing step + DCMDATA_WARN("DcmItem: An error occurred during the conversion to " << encoding << " encoding, " + << "the value of SpecificCharacterSet " << DCM_SpecificCharacterSet << " is not updated"); + } +} + + +OFCondition DcmItem::convertCharacterSet(const OFString &fromCharset, + const OFString &toCharset, + const size_t flags, + const OFBool updateCharset) +{ + OFCondition status = EC_Normal; + // if the item is empty, there is nothing to do + if (!elementList->empty()) + { + DcmSpecificCharacterSet converter; + // create a new character set converter + DCMDATA_DEBUG("DcmItem::convertCharacterSet() creating a new character set converter for '" + << fromCharset << "'" << (fromCharset.empty() ? " (ASCII)" : "") << " to '" + << toCharset << "'" << (toCharset.empty() ? " (ASCII)" : "")); + // select source and destination character set + status = converter.selectCharacterSet(fromCharset, toCharset); + if (status.good()) + { + unsigned cflags = 0; + /* pass flags to underlying implementation */ + if (flags & DCMTypes::CF_discardIllegal) + cflags |= OFCharacterEncoding::DiscardIllegalSequences; + if (flags & DCMTypes::CF_transliterate) + cflags |= OFCharacterEncoding::TransliterateIllegalSequences; + if (cflags > 0) + status = converter.setConversionFlags(cflags); + if (status.good()) + { + // convert all affected element values in the item + status = convertCharacterSet(converter); + if (updateCharset) + { + // update the Specific Character Set (0008,0005) element + updateSpecificCharacterSet(status, converter); + } + } + } + } + return status; +} + + +OFCondition DcmItem::convertCharacterSet(const OFString &toCharset, + const size_t flags, + const OFBool ignoreCharset) +{ + OFString fromCharset; + // check whether this item can contain the attribute SpecificCharacterSet (0008,0005) + if (checkForSpecificCharacterSet() && !ignoreCharset) + { + // determine value of Specific Character Set (0008,0005) if present in this item + findAndGetOFStringArray(DCM_SpecificCharacterSet, fromCharset, OFFalse /*searchIntoSub*/); + } + // do the real work, if Specific Character Set is missing or empty use the default (ASCII) + return convertCharacterSet(fromCharset, toCharset, flags, !ignoreCharset /*updateCharset*/); +} + + +OFCondition DcmItem::convertCharacterSet(DcmSpecificCharacterSet &converter) +{ + OFCondition status = EC_Normal; + // if the item is empty, there is nothing to do + if (!elementList->empty()) + { + // iterate over all data elements in this item and convert the strings + elementList->seek(ELP_first); + do { + status = elementList->get()->convertCharacterSet(converter); + } while (status.good() && elementList->seek(ELP_next)); + } + return status; +} + + +OFCondition DcmItem::convertToUTF8() +{ + // the DICOM defined term "ISO_IR 192" is used for "UTF-8" + return convertCharacterSet("ISO_IR 192", 0 /*flags*/); +} + + +// ******************************** + + +DcmElement* DcmItem::newDicomElement(const DcmTagKey& tag, + const char *privateCreator) +{ + DcmTag temp(tag, privateCreator); + DcmElement* elem = NULL; + OFBool readAsUN = OFFalse; + newDicomElement( + elem, + temp, + 0, // Length + NULL, // Private creator + readAsUN); // read as VR UN (result ignored) + return elem; +} + + +OFCondition DcmItem::newDicomElementWithVR(DcmElement*& newElement, const DcmTag& tag) +{ + DcmTag temp(tag); + OFBool readAsUN = OFFalse; + return newDicomElement( + newElement, + temp, + 0, // Length + NULL, // Private creator + readAsUN); // read as VR UN (result ignored) +} + + +OFCondition DcmItem::newDicomElement(DcmElement*& newElement, + const DcmTagKey& tag, + const char *privateCreator) +{ + DcmTag temp(tag, privateCreator); + newElement = NULL; + OFBool readAsUN = OFFalse; + return newDicomElement( + newElement, + temp, + 0, // Length + NULL, // Private creator + readAsUN); // read as VR UN (result ignored) +} + + +OFCondition DcmItem::newDicomElement(DcmElement *&newElement, + DcmTag &tag, + const Uint32 length, + DcmPrivateTagCache *privateCreatorCache, + OFBool& readAsUN) +{ + /* initialize variables */ + OFCondition l_error = EC_Normal; + newElement = NULL; + DcmEVR evr = tag.getEVR(); + readAsUN = OFFalse; + + /* revert UN elements with finite length back to known VR if possible */ + if ((evr == EVR_UN) && (length != DCM_UndefinedLength) && dcmEnableUnknownVRConversion.get()) + { + /* look up VR in data dictionary */ + DcmTag newTag(tag.getGroup(), tag.getElement()); + + /* special handling for private elements */ + if (privateCreatorCache && (newTag.getGroup() & 1) && (newTag.getElement() >= 0x1000)) + { + const char *pc = privateCreatorCache->findPrivateCreator(newTag); + if (pc != NULL) + { + // we have a private creator for this element + newTag.setPrivateCreator(pc); + newTag.lookupVRinDictionary(); + } + } + + /* update VR for tag, set "readAsUN" flag that makes sure the element value + * is read in Little Endian Implicit VR (i.e. the UN encoding) + */ + if (newTag.getEVR() != EVR_UNKNOWN) + { + tag.setVR(newTag.getVR()); + evr = tag.getEVR(); + readAsUN = OFTrue; + } + } + + /* depending on the VR of the tag which was passed, create the new object */ + switch (evr) + { + // byte strings: + case EVR_AE : + newElement = new DcmApplicationEntity(tag, length); + break; + case EVR_AS : + newElement = new DcmAgeString(tag, length); + break; + case EVR_CS : + newElement = new DcmCodeString(tag, length); + break; + case EVR_DA : + newElement = new DcmDate(tag, length); + break; + case EVR_DS : + newElement = new DcmDecimalString(tag, length); + break; + case EVR_DT : + newElement = new DcmDateTime(tag, length); + break; + case EVR_IS : + newElement = new DcmIntegerString(tag, length); + break; + case EVR_TM : + newElement = new DcmTime(tag, length); + break; + case EVR_UI : + newElement = new DcmUniqueIdentifier(tag, length); + break; + case EVR_UR: + newElement = new DcmUniversalResourceIdentifierOrLocator(tag, length); + break; + + // character strings: + case EVR_LO : + newElement = new DcmLongString(tag, length); + break; + case EVR_LT : + newElement = new DcmLongText(tag, length); + break; + case EVR_PN : + newElement = new DcmPersonName(tag, length); + break; + case EVR_SH : + newElement = new DcmShortString(tag, length); + break; + case EVR_ST : + newElement = new DcmShortText(tag, length); + break; + case EVR_UC: + newElement = new DcmUnlimitedCharacters(tag, length); + break; + case EVR_UT: + newElement = new DcmUnlimitedText(tag, length); + break; + + // dependent on byte order: + case EVR_AT : + newElement = new DcmAttributeTag(tag, length); + break; + case EVR_SS : + newElement = new DcmSignedShort(tag, length); + break; + case EVR_xs : // according to DICOM standard + case EVR_US : + newElement = new DcmUnsignedShort(tag, length); + break; + case EVR_SL : + newElement = new DcmSignedLong(tag, length); + break; + case EVR_up : // for (0004,eeee) according to DICOM standard + case EVR_UL : + { + // generate tag with VR from dictionary! + DcmTag ulupTag(tag.getXTag()); + if (ulupTag.getEVR() == EVR_up) + newElement = new DcmUnsignedLongOffset(ulupTag, length); + else + newElement = new DcmUnsignedLong(tag, length); + } + break; + case EVR_OL : + newElement = new DcmOtherLong(tag, length); + break; + case EVR_SV : + newElement = new DcmSigned64bitVeryLong(tag, length); + break; + case EVR_UV : + newElement = new DcmUnsigned64bitVeryLong(tag, length); + break; + case EVR_OV : + newElement = new DcmOther64bitVeryLong(tag, length); + break; + case EVR_FL : + newElement = new DcmFloatingPointSingle(tag, length); + break; + case EVR_FD : + newElement = new DcmFloatingPointDouble(tag, length); + break; + case EVR_OF : + newElement = new DcmOtherFloat(tag, length); + break; + case EVR_OD : + newElement = new DcmOtherDouble(tag, length); + break; + + // sequences and items: + case EVR_SQ : + newElement = new DcmSequenceOfItems(tag, length); + break; + case EVR_na : + if (tag.getXTag() == DCM_Item) + l_error = EC_InvalidTag; + else if (tag.getXTag() == DCM_SequenceDelimitationItem) + l_error = EC_SequEnd; + else if (tag.getXTag() == DCM_ItemDelimitationItem) + l_error = EC_ItemEnd; + else + l_error = EC_InvalidTag; + break; + + // pixel sequences (EVR_pixelSQ) are handled through class DcmPixelData + // and should never appear here. + + // unclear 8 or 16 bit: + case EVR_ox : + if (tag == DCM_PixelData) + newElement = new DcmPixelData(tag, length); + else if (tag.getBaseTag() == DCM_OverlayData) + newElement = new DcmOverlayData(tag, length); + else + /* we don't know this element's real transfer syntax, so we just + * use the defaults of class DcmOtherByteOtherWord and let the + * application handle it. + */ + newElement = new DcmOtherByteOtherWord(tag, length); + break; + + // This case should only occur if we encounter an element with an invalid + // "Pi" VR. Make sure this does not cause problems later on + case EVR_PixelData : + newElement = new DcmPixelData(tag, length); + // set VR to OW to make sure that we never write/send the internal VR + if (newElement) newElement->setVR(EVR_OW); + break; + + // This case should only occur if we encounter an element with an invalid + // "Ov" VR. Make sure this does not cause problems later on + case EVR_OverlayData : + newElement = new DcmOverlayData(tag, length); + // set VR to OW to make sure that we never write/send the internal VR + if (newElement) newElement->setVR(EVR_OW); + break; + + case EVR_lt : + newElement = new DcmOtherByteOtherWord(tag, length); + break; + + case EVR_OB : + case EVR_OW : + if (tag == DCM_PixelData) + newElement = new DcmPixelData(tag, length); + else if (tag.getBaseTag() == DCM_OverlayData) + newElement = new DcmOverlayData(tag, length); + else if ((tag == DCM_VOILUTSequence) && (length != DCM_UndefinedLength)) + { + // this is an incorrectly encoded VOI LUT Sequence. + // Real-world examples of this issue have been reported in 2016. + if (dcmConvertVOILUTSequenceOWtoSQ.get()) + { + // Silently fix the error by interpreting as a sequence. + DcmTag newTag(tag); + newTag.setVR(DcmVR(EVR_SQ)); // on writing we will handle this element as SQ, not OB/OW + newElement = new DcmSequenceOfItems(newTag, length); + } else { + + if (dcmIgnoreParsingErrors.get()) + { + // ignore parse error, keep VR unchanged + DCMDATA_WARN("DcmItem: VOI LUT Sequence with VR=OW and explicit length encountered."); + newElement = new DcmOtherByteOtherWord(tag, length); + } + else + { + // bail out with an error + DCMDATA_ERROR("DcmItem: VOI LUT Sequence with VR=OW and explicit length encountered."); + l_error = EC_VOI_LUT_OBOW; + } + } + } + else + if (length == DCM_UndefinedLength) + { + // The attribute is OB or OW but is encoded with undefined + // length, and it is not Pixel Data. This is illegal. + if (dcmConvertUndefinedLengthOBOWtoSQ.get()) + { + // Assume that this is in fact a sequence so that we can + // catch the sequence delimitation item. + DcmTag newTag(tag); + newTag.setVR(DcmVR(EVR_SQ)); // on writing we will handle this element as SQ, not OB/OW + newElement = new DcmSequenceOfItems(newTag, length); + } else { + if (dcmIgnoreParsingErrors.get()) + { + // ignore parse error, keep VR unchanged + OFCondition tempcond = EC_UndefinedLengthOBOW; + DCMDATA_WARN("DcmItem: Parse error in " << tag << ": " << tempcond.text()); + newElement = new DcmSequenceOfItems(tag, length); + } + else + { + // bail out with an error + l_error = EC_UndefinedLengthOBOW; + DCMDATA_ERROR("DcmItem: Parse error in " << tag << ": " << l_error.text()); + } + } + } else { + newElement = new DcmOtherByteOtherWord(tag, length); + } + break; + + // read unknown types as byte string: + case EVR_UNKNOWN : + case EVR_UNKNOWN2B : + case EVR_UN : + if (length == DCM_UndefinedLength) + { + // The attribute VR is UN with undefined length. Assume it is really + // a sequence so that we can catch the sequence delimitation item. + DcmTag newTag(tag); + newTag.setVR(DcmVR(EVR_SQ)); // on writing we will handle this element as SQ, not UN + if (dcmEnableCP246Support.get()) + { + DCMDATA_WARN("Found element " << newTag << " with VR UN and undefined length, " + << "reading a sequence with transfer syntax LittleEndianImplicit (CP-246)"); + } else { + DCMDATA_WARN("Found element " << newTag << " with VR UN and undefined length"); + } + newElement = new DcmSequenceOfItems(newTag, length, dcmEnableCP246Support.get()); + } else { + // defined length UN element, treat like OB + newElement = new DcmOtherByteOtherWord(tag, length); + } + break; + + // these types should never occur + case EVR_item : + case EVR_metainfo : + case EVR_dataset : + case EVR_fileFormat : + case EVR_dicomDir : + case EVR_dirRecord : + case EVR_pixelSQ : + case EVR_pixelItem : + l_error = EC_IllegalCall; + break; + + // we deliberately have no default clause to make sure a warning is raised + // when an DcmEVR enum is not explicitly handled here + } + + /* check for valid element pointer */ + if (l_error.good() && (newElement == NULL)) + l_error = EC_MemoryExhausted; + + /* return result value */ + return l_error; +} diff --git a/dcmdata/libsrc/dcjson.cc b/dcmdata/libsrc/dcjson.cc new file mode 100644 index 00000000..9efb1b9b --- /dev/null +++ b/dcmdata/libsrc/dcjson.cc @@ -0,0 +1,281 @@ +/* + * + * Copyright (C) 2016-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * Module: dcmdata + * + * Author: Sebastian Grallert + * + * Purpose: Providing basic JSON formatting functionalities + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcjson.h" + +#define INCLUDE_CASSERT +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofdefine.h" +#include "dcmtk/ofstd/ofstring.h" + +void DcmJsonFormat::escapeControlCharacters(STD_NAMESPACE ostream &out, const OFString &value) +{ + // escapes all forbidden control characters in JSON + for (size_t i = 0; i < value.size(); ++i) + { + const char c = value.at(i); + switch (c) + { + case '\\': + out << "\\\\"; + break; + case '"': + out << "\\\""; + break; + case '\b': + out << "\\b"; + break; + case '\n': + out << "\\n"; + break; + case '\r': + out << "\\r"; + break; + case '\t': + out << "\\t"; + break; + case '\f': + out << "\\f"; + break; + default: + //escapes all other control characters + if (c >= '\0' && c < ' ') + { + out << "\\u" << STD_NAMESPACE hex + << STD_NAMESPACE setw(4) << STD_NAMESPACE setfill('0') + << OFstatic_cast(unsigned, OFstatic_cast(unsigned char, c)); + } + else + { + out << c; + } + } + } +} + +// Formats the number to JSON standard as DecimalString +void DcmJsonFormat::normalizeDecimalString(OFString &value) +{ + OFBool minus = OFFalse; + + if (value[0] == '-') + { + value = value.substr(1); + minus = OFTrue; + } + + size_t pos = value.find_first_not_of("0"); + + if (pos == OFString_npos) + value = "0"; + else + { + if (value[pos] == '.') + value = '0' + value.substr(pos); + else + value = value.substr(pos); + } + + if (minus) + value = '-' + value; +} + +// Formats the number to JSON standard as IntegerString +void DcmJsonFormat::normalizeIntegerString(OFString &value) +{ + OFBool minus = OFFalse; + + if (value[0] == '-') + { + value = value.substr(1); + minus = OFTrue; + } + + size_t pos = value.find_first_not_of("0"); + + if (pos == OFString_npos) + value = "0"; + else + value = value.substr(pos); + + if (minus) + value = '-' + value; +} + +// Print a string in JSON format +void DcmJsonFormat::printString(STD_NAMESPACE ostream &out, + const OFString &value) +{ + out << "\""; + escapeControlCharacters(out, value); + out << "\""; +} + +// Print a string in JSON format +// Print null if OFString is empty +void DcmJsonFormat::printValueString(STD_NAMESPACE ostream &out, + const OFString &value) +{ + if (!value.empty()) + { + printString(out, value); + } + else + { + out << "null"; + } +} + +// Print a integer in JSON format +// Print null if OFString is empty +void DcmJsonFormat::printNumberInteger(STD_NAMESPACE ostream &out, + OFString &value) +{ + if (!value.empty()) + { + normalizeIntegerString(value); + out << value; + } + else + { + out << "null"; + } +} + +// Print a decimal in JSON format +// Print null if OFString is empty +void DcmJsonFormat::printNumberDecimal(STD_NAMESPACE ostream &out, + OFString &value) +{ + if (!value.empty()) + { + normalizeDecimalString(value); + out << value; + } + else + { + out << "null"; + } +} + +// Print the prefix for Value +void DcmJsonFormat::printValuePrefix(STD_NAMESPACE ostream &out) +{ + out << "," << newline() << indent() << "\"Value\":" << space() << "[" << newline(); + out << ++indent(); +} + +// Print the suffix for Value +void DcmJsonFormat::printValueSuffix(STD_NAMESPACE ostream &out) +{ + out << newline() << --indent() << "]"; +} + +// Print the prefix for BulkDataURI +void DcmJsonFormat::printBulkDataURIPrefix(STD_NAMESPACE ostream &out) +{ + out << "," << newline() << indent() << "\"BulkDataURI\":" << space(); +} + +// Print the prefix for InlineBinary +void DcmJsonFormat::printInlineBinaryPrefix(STD_NAMESPACE ostream &out) +{ + out << "," << newline() << indent() << "\"InlineBinary\":" << space(); +} + +// Print the prefix for array elements in JSON format +void DcmJsonFormat::printNextArrayElementPrefix(STD_NAMESPACE ostream &out) +{ + out << "," << newline() << indent(); +} + +// Method for holding and determine if BulkDataURI should be printed. +// This also manipulate uri String, if BulkDataURI should be printed. +OFBool DcmJsonFormat::asBulkDataURI(const DcmTagKey& /*tag*/, OFString& /*uri*/) +{ + return false; +} + +//Class for formatted output +DcmJsonFormatPretty::DcmJsonFormatPretty(const OFBool printMetaInfo) +: DcmJsonFormat(printMetaInfo) +, m_IndentionLevel(0) +{ + +} + +void DcmJsonFormatPretty::printIndention(STD_NAMESPACE ostream& out) +{ + for (unsigned ui = 0; ui < m_IndentionLevel; ++ui) + out << " "; +} + +void DcmJsonFormatPretty::increaseIndention() +{ + ++m_IndentionLevel; +} + +void DcmJsonFormatPretty::decreaseIndention() +{ + assert(m_IndentionLevel); + --m_IndentionLevel; +} + +OFString DcmJsonFormatPretty::newline() +{ + return "\n"; +} + +OFString DcmJsonFormatPretty::space() +{ + return " "; +} + + +//Class for unformatted output +DcmJsonFormatCompact::DcmJsonFormatCompact(const OFBool printMetaInfo) +: DcmJsonFormat(printMetaInfo) +{ + +} + +void DcmJsonFormatCompact::printIndention(STD_NAMESPACE ostream& /*out*/) +{} + +void DcmJsonFormatCompact::increaseIndention() +{} + +void DcmJsonFormatCompact::decreaseIndention() +{} + +OFString DcmJsonFormatCompact::newline() +{ + return OFString(); +} + +OFString DcmJsonFormatCompact::space() +{ + return OFString(); +} diff --git a/dcmdata/libsrc/dclist.cc b/dcmdata/libsrc/dclist.cc new file mode 100644 index 00000000..d859672d --- /dev/null +++ b/dcmdata/libsrc/dclist.cc @@ -0,0 +1,295 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: generic list class + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dclist.h" + + +// ***************************************** +// *** DcmListNode ************************* +// ***************************************** + + +DcmListNode::DcmListNode( DcmObject *obj ) + : nextNode(NULL), + prevNode(NULL), + objNodeValue(obj) +{ +} + + +// ******************************** + + +DcmListNode::~DcmListNode() +{ +} + + +// ***************************************** +// *** DcmList ***************************** +// ***************************************** + + +DcmList::DcmList() + : firstNode(NULL), + lastNode(NULL), + currentNode(NULL), + cardinality(0) +{ +} + + +// ******************************** + + +DcmList::~DcmList() +{ + if ( !DcmList::empty() ) // list is not empty ! + { + lastNode->nextNode = NULL; // set to 0 for safety reasons + do { + DcmListNode *temp = firstNode; + firstNode = firstNode->nextNode; + // delete temp->objNodeValue;; // dangerous! + delete temp; + } while ( firstNode != NULL ); + currentNode = firstNode = lastNode = NULL; + } +} + + +// ******************************** + + +DcmObject *DcmList::append( DcmObject *obj ) +{ + if ( obj != NULL ) + { + if ( DcmList::empty() ) // list is empty ! + currentNode = firstNode = lastNode = new DcmListNode(obj); + else + { + DcmListNode *node = new DcmListNode(obj); + lastNode->nextNode = node; + node->prevNode = lastNode; + currentNode = lastNode = node; + } + cardinality++; + } // obj == NULL + return obj; +} + + +// ******************************** + + +DcmObject *DcmList::prepend( DcmObject *obj ) +{ + if ( obj != NULL ) + { + if ( DcmList::empty() ) // list is empty ! + currentNode = firstNode = lastNode = new DcmListNode(obj); + else + { + DcmListNode *node = new DcmListNode(obj); + node->nextNode = firstNode; + firstNode->prevNode = node; + currentNode = firstNode = node; + } + cardinality++; + } // obj == NULL + return obj; +} + + +// ******************************** + + +DcmObject *DcmList::insert( DcmObject *obj, E_ListPos pos ) +{ + if ( obj != NULL ) + { + if ( DcmList::empty() ) // list is empty ! + { + currentNode = firstNode = lastNode = new DcmListNode(obj); + cardinality++; + } + else { + if ( pos==ELP_last ) + DcmList::append( obj ); // cardinality++; + else if ( pos==ELP_first ) + DcmList::prepend( obj ); // cardinality++; + else if ( !DcmList::valid() ) + // set current node to the end if there is no predecessor or + // there are successors to be determined + DcmList::append( obj ); // cardinality++; + else if ( pos == ELP_prev ) // insert before current node + { + DcmListNode *node = new DcmListNode(obj); + if ( currentNode->prevNode == NULL ) + firstNode = node; // insert at the beginning + else + currentNode->prevNode->nextNode = node; + node->prevNode = currentNode->prevNode; + node->nextNode = currentNode; + currentNode->prevNode = node; + currentNode = node; + cardinality++; + } + else //( pos==ELP_next || pos==ELP_atpos ) + // insert after current node + { + DcmListNode *node = new DcmListNode(obj); + if ( currentNode->nextNode == NULL ) + lastNode = node; // append to the end + else + currentNode->nextNode->prevNode = node; + node->nextNode = currentNode->nextNode; + node->prevNode = currentNode; + currentNode->nextNode = node; + currentNode = node; + cardinality++; + } + } + } // obj == NULL + return obj; +} + + +// ******************************** + + +DcmObject *DcmList::remove() +{ + DcmObject *tempobj; + DcmListNode *tempnode; + + if ( DcmList::empty() ) // list is empty ! + return NULL; + else if ( !DcmList::valid() ) + return NULL; // current node is 0 + else + { + tempnode = currentNode; + + if ( currentNode->prevNode == NULL ) + firstNode = currentNode->nextNode; // delete first element + else + currentNode->prevNode->nextNode = currentNode->nextNode; + + if ( currentNode->nextNode == NULL ) + lastNode = currentNode->prevNode; // delete last element + else + currentNode->nextNode->prevNode = currentNode->prevNode; + + currentNode = currentNode->nextNode; + tempobj = tempnode->value(); + delete tempnode; + cardinality--; + return tempobj; + } +} + + +// ******************************** + + +DcmObject *DcmList::get( E_ListPos pos ) +{ + return seek( pos ); +} + + +// ******************************** + + +DcmObject *DcmList::seek( E_ListPos pos ) +{ + switch (pos) + { + case ELP_first : + currentNode = firstNode; + break; + case ELP_last : + currentNode = lastNode; + break; + case ELP_prev : + if ( DcmList::valid() ) + currentNode = currentNode->prevNode; + break; + case ELP_next : + if ( DcmList::valid() ) + currentNode = currentNode->nextNode; + break; + default: + break; + } + return DcmList::valid() ? currentNode->value() : NULL; +} + + +// ******************************** + + +DcmObject *DcmList::seek_to(unsigned long absolute_position) +{ + const unsigned long tmppos = absolute_position < cardinality ? absolute_position : cardinality; + seek( ELP_first ); + for (unsigned long i = 0; i < tmppos; i++) + seek( ELP_next ); + return get( ELP_atpos ); +} + + +// ******************************** + + +void DcmList::deleteAllElements() +{ + unsigned long numElements = cardinality; + DcmListNode* tmpNode = NULL; + DcmObject* tmpObject = NULL; + // delete all elements + for (unsigned long i = 0; i < numElements; i++) + { + // always select first node so no search is necessary + tmpNode = firstNode; + // clear value of node + tmpObject = tmpNode->value(); + if (tmpObject != NULL) + { + // delete load of selected list node + delete tmpObject; + tmpObject = NULL; + } + firstNode = tmpNode->nextNode; + // delete the list node itself + delete tmpNode; + } + // reset all attributes for later use + firstNode = NULL; + lastNode = NULL; + currentNode = NULL; + cardinality = 0; +} diff --git a/dcmdata/libsrc/dcmatch.cc b/dcmdata/libsrc/dcmatch.cc new file mode 100644 index 00000000..ebb103ef --- /dev/null +++ b/dcmdata/libsrc/dcmatch.cc @@ -0,0 +1,385 @@ +/* + * + * Copyright (C) 2017-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Jan Schlamelcher + * + * Purpose: Implementing attribute matching for being used in dcmqrdb and dcmwlm etc. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofdiag.h" +#include "dcmtk/dcmdata/dcmatch.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrtm.h" + +class DcmAttributeMatching::WildCardMatcher +{ +public: + +#include DCMTK_DIAGNOSTIC_PUSH +#include DCMTK_DIAGNOSTIC_IGNORE_SHADOW + // constructor, remembering the end of the query and candidate strings + WildCardMatcher( const char* queryDataEnd, const char* candidateDataEnd ) + : queryDataEnd( queryDataEnd ) + , candidateDataEnd( candidateDataEnd ) + { + + } +#include DCMTK_DIAGNOSTIC_POP + + // the actual match function, taking two pointers to the beginning of + // the query and the candidate string + OFBool match( const char* queryData, const char* candidateData ) const + { + // matches all regular chars and '?' wildcard with the candidate string + while( queryData != queryDataEnd && candidateData != candidateDataEnd && *queryData != '*' ) + { + if( *queryData == '?' || *queryData == *candidateData ) + { + ++queryData; + ++candidateData; + } + else + { + return OFFalse; + } + } + // if the end of the query is reached, there was no '*' wildcard + // therefor it is either a match (if the end of the candidate was + // also reached) or not + if( queryData == queryDataEnd ) + return candidateData == candidateDataEnd; + // if the current char in the query is not the '*' wildcard, the + // values don't match, since all other chars would have been + // matched by the previous while loop + if( *queryData != '*' ) + return OFFalse; + // skip all '*' wildcard characters, because even a string like "****" + // equals the sematics of '*'. If the end of the query is reached + // any remaining part of the candidate is a match, therefore return + // OFTrue + do if( ++queryData == queryDataEnd ) + return OFTrue; + while( *queryData == '*' ); + // If this part of the code is reached, at least one non wildcard + // character exists in the query after the previously skipped + // wildcards. Search for a match of the remaining query characters + // in the remaining candidate characters, by recursively calling + // match. + while( candidateData != candidateDataEnd ) + { + if( !match( queryData, candidateData ) ) + ++candidateData; + else + return OFTrue; + } + // if the end of the candidate is reached, both strings don't match. + return OFFalse; + } + +private: + // the ends of both the query and the candidate string, will remain + // constant per match operation + const char* const queryDataEnd; + const char* const candidateDataEnd; +}; + +DcmAttributeMatching::Range::Range( const void* const data, const size_t size, const char separator ) +: first( OFreinterpret_cast( const char* const, data ) ) +, firstSize( 0 ) +, second( first ) +, secondSize( size ) +{ + while( firstSize != secondSize && separator != first[firstSize] ) + ++firstSize; + if( firstSize != secondSize ) + { + secondSize = secondSize - firstSize - 1; + second = second + firstSize + 1; + } +} + +OFBool DcmAttributeMatching::Range::isRange() const +{ + return first != second; +} + + +OFBool DcmAttributeMatching::Range::hasOpenBeginning() const +{ + return !firstSize; +} + +OFBool DcmAttributeMatching::Range::hasOpenEnd() const +{ + return !secondSize; +} + +OFBool DcmAttributeMatching::singleValueMatching( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) +{ + return !querySize || ( querySize == candidateSize && !memcmp( queryData, candidateData, querySize ) ); +} + +OFBool DcmAttributeMatching::wildCardMatching( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) +{ + return !querySize || WildCardMatcher + ( + OFreinterpret_cast( const char*, queryData ) + querySize, + OFreinterpret_cast( const char*, candidateData ) + candidateSize + ) + .match + ( + OFreinterpret_cast( const char*, queryData ), + OFreinterpret_cast( const char*, candidateData ) + ); +} + +OFBool DcmAttributeMatching::checkRangeQuery( OFBool (*check)(const char*,const size_t), + const void* queryData, const size_t querySize ) +{ + const Range range( queryData, querySize ); + if( !range.isRange() ) + return check( range.first, range.firstSize ); + return ( range.hasOpenBeginning() || check( range.first, range.firstSize ) ) && + ( range.hasOpenEnd() || check( range.second, range.secondSize ) ) + ; +} + +template +OFBool DcmAttributeMatching::rangeMatchingTemplate( OFCondition (*parse)(const char*,const size_t,T&), + const Range& query, const T& candidate ) +{ + T first; + if( query.hasOpenBeginning() || parse( query.first, query.firstSize, first ).good() ) + { + if( !query.isRange() ) + return query.firstSize && first == candidate; + T second; + if( query.hasOpenEnd() || parse( query.second, query.secondSize, second ).good() ) + return ( query.hasOpenBeginning() || first <= candidate ) + && ( query.hasOpenEnd() || second >= candidate ); + } + return OFFalse; +} + +template +OFBool DcmAttributeMatching::rangeMatchingTemplate( OFCondition (*parse)(const char*,const size_t,T&), + const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) +{ + if( !querySize ) + return OFTrue; + T candidate; + if( parse( OFreinterpret_cast( const char*, candidateData ), candidateSize, candidate ).bad() ) + return OFFalse; + return rangeMatchingTemplate( parse, Range( queryData, querySize ), candidate ); +} + +OFBool DcmAttributeMatching::isDateQuery( const void* queryData, const size_t querySize ) +{ + return checkRangeQuery( &DcmDate::check, queryData, querySize ); +} + +OFBool DcmAttributeMatching::isTimeQuery( const void* queryData, const size_t querySize ) +{ + return checkRangeQuery( &DcmTime::check, queryData, querySize ); +} + +OFBool DcmAttributeMatching::isDateTimeQuery( const void* queryData, const size_t querySize ) +{ + return checkRangeQuery( &DcmDateTime::check, queryData, querySize ); +} + +OFBool DcmAttributeMatching::rangeMatchingDate( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) +{ + return rangeMatchingTemplate( &DcmDate::getOFDateFromString, queryData, querySize, candidateData, candidateSize ); +} + +OFBool DcmAttributeMatching::rangeMatchingTime( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) +{ + return rangeMatchingTemplate( &DcmTime::getOFTimeFromString, queryData, querySize, candidateData, candidateSize ); +} + +OFBool DcmAttributeMatching::rangeMatchingDateTime( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) +{ + return rangeMatchingTemplate( &DcmDateTime::getOFDateTimeFromString, queryData, querySize, candidateData, candidateSize ); +} + +OFBool DcmAttributeMatching::rangeMatchingDateTime( const void* dateQueryData, const size_t dateQuerySize, + const void* timeQueryData, const size_t timeQuerySize, + const void* dateCandidateData, const size_t dateCandidateSize, + const void* timeCandidateData, const size_t timeCandidateSize ) +{ + if( !dateQuerySize ) + return rangeMatchingTime( timeQueryData, timeQuerySize, timeCandidateData, timeCandidateSize ); + if( !timeQuerySize ) + return rangeMatchingDate( dateQueryData, dateQuerySize, dateCandidateData, dateCandidateSize ); + OFDateTime candidate; + if( DcmDate::getOFDateFromString( OFreinterpret_cast( const char*, dateCandidateData ), dateCandidateSize, candidate.Date ).bad() ) + return OFFalse; + if( timeCandidateSize && DcmTime::getOFTimeFromString( OFreinterpret_cast( const char*, timeCandidateData ), timeCandidateSize, candidate.Time ).bad() ) + return OFFalse; + const Range dateQuery( dateQueryData, dateQuerySize ); + const Range timeQuery( timeQueryData, timeQuerySize ); + // check that both date/time ranges have the same structure + if + ( + ( dateQuery.isRange() != timeQuery.isRange() ) || + ( dateQuery.hasOpenBeginning() && !timeQuery.hasOpenBeginning() ) || + ( dateQuery.hasOpenEnd() && !timeQuery.hasOpenEnd() ) + ) + { + // fall back to individually matching them in case they don't + return rangeMatchingTemplate( &DcmDate::getOFDateFromString, dateQuery, candidate.getDate() ) + && rangeMatchingTemplate( &DcmTime::getOFTimeFromString, timeQuery, candidate.getTime() ); + } + OFDateTime first; + // parse the first date/time + if( !dateQuery.hasOpenBeginning() ) + { + if( DcmDate::getOFDateFromString( dateQuery.first, dateQuery.firstSize, first.Date ).bad() ) + return OFFalse; + if( !timeQuery.hasOpenBeginning() && DcmTime::getOFTimeFromString( timeQuery.first, timeQuery.firstSize, first.Time ).bad() ) + return OFFalse; + } + if( !dateQuery.isRange() ) + return dateQuery.firstSize && first == candidate; + OFDateTime second; + // parse the second date/time + if( !dateQuery.hasOpenEnd() ) + { + if( DcmDate::getOFDateFromString( dateQuery.second, dateQuery.secondSize, second.Date ).bad() ) + return OFFalse; + if( !timeQuery.hasOpenEnd() && DcmTime::getOFTimeFromString( timeQuery.second, timeQuery.secondSize, second.Time ).bad() ) + return OFFalse; + } + // compare candidate with the date/time range + return ( dateQuery.hasOpenBeginning() || first <= candidate ) + && ( dateQuery.hasOpenEnd() || second >= candidate ); +} + +OFBool DcmAttributeMatching::listOfUIDMatching( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) +{ + if( !querySize ) + return OFTrue; + const char* pQuery = OFreinterpret_cast( const char*, queryData ); + const char* const pQueryEnd = pQuery + querySize; + const char* pCandidate = OFreinterpret_cast( const char*, candidateData ); + const char* const pCandidateEnd = pCandidate + candidateSize; + // character wise match both strings, reset candidate pointer whenever a + // '\\' character is encountered within a multi-valued query. + while( pQuery != pQueryEnd ) + { + if( pCandidate != pCandidateEnd && *pQuery == *pCandidate ) + { + ++pQuery; + ++pCandidate; + } + else + { + // test whether the candidate matches with the current value from the query + if( pCandidate == pCandidateEnd && *pQuery == '\\' ) + return OFTrue; + // mismatch, search for a '\\' char to try again with the next value from the query, + // return OFFalse if none can be found, i.e. this was the last value. + while( *pQuery != '\\' ) + if( ++pQuery == pQueryEnd ) + return OFFalse; + // skip the '\\' character + ++pQuery; + // reset candidate pointer to the beginning of the candidate + pCandidate = OFreinterpret_cast( const char*, candidateData ); + } + } + // the query is at its end, we have a match if the candidate is also + return pCandidate == pCandidateEnd; +} + +DcmAttributeMatching::DcmAttributeMatching() +: m_pMatch( OFnullptr ) +{ + +} + +DcmAttributeMatching::DcmAttributeMatching( const DcmVR vr ) +: m_pMatch( OFnullptr ) +{ + switch( vr.getEVR() ) + { + default: + m_pMatch = &DcmAttributeMatching::singleValueMatching; + break; + + case EVR_AE: + case EVR_CS: + case EVR_LO: + case EVR_LT: + case EVR_PN: + case EVR_SH: + case EVR_ST: + case EVR_UC: + case EVR_UR: + case EVR_UT: + m_pMatch = &DcmAttributeMatching::wildCardMatching; + break; + + case EVR_DA: + m_pMatch = &DcmAttributeMatching::rangeMatchingDate; + break; + + case EVR_TM: + m_pMatch = &DcmAttributeMatching::rangeMatchingTime; + break; + + case EVR_DT: + m_pMatch = &DcmAttributeMatching::rangeMatchingDateTime; + break; + + case EVR_UI: + m_pMatch = &DcmAttributeMatching::listOfUIDMatching; + break; + } +} + +DcmAttributeMatching::operator OFBool() const +{ +#include DCMTK_DIAGNOSTIC_PUSH +#include DCMTK_DIAGNOSTIC_IGNORE_VISUAL_STUDIO_PERFORMANCE_WARNING + return m_pMatch; +#include DCMTK_DIAGNOSTIC_POP +} + +OFBool DcmAttributeMatching::operator!() const +{ + return !m_pMatch; +} + +OFBool DcmAttributeMatching::operator()( const void* queryData, const size_t querySize, + const void* candidateData, const size_t candidateSize ) const +{ + assert( m_pMatch ); + return m_pMatch( queryData, querySize, candidateData, candidateSize ); +} diff --git a/dcmdata/libsrc/dcmetinf.cc b/dcmdata/libsrc/dcmetinf.cc new file mode 100644 index 00000000..68b68784 --- /dev/null +++ b/dcmdata/libsrc/dcmetinf.cc @@ -0,0 +1,660 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmMetaInfo + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcvrul.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/ofstd/ofdefine.h" +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcistrmf.h" /* for class DcmInputFileStream */ +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ +#include "dcmtk/dcmdata/dcjson.h" + + +const Uint32 DCM_GroupLengthElementLength = 12; + + +// ******************************** + + +DcmMetaInfo::DcmMetaInfo() + : DcmItem(DCM_ItemTag), + preambleUsed(OFFalse), + fPreambleTransferState(ERW_init), + Xfer(META_HEADER_DEFAULT_TRANSFERSYNTAX) +{ + setPreamble(); +} + + +DcmMetaInfo::DcmMetaInfo(const DcmMetaInfo &old) + : DcmItem(old), + preambleUsed(old.preambleUsed), + fPreambleTransferState(ERW_init), + Xfer(old.Xfer) +{ + memcpy(filePreamble, old.filePreamble, 128); +} + + +DcmMetaInfo& DcmMetaInfo::operator=(const DcmMetaInfo& obj) +{ + if (this != &obj) + { + // copy parent's member variables + DcmItem::operator=(obj); + // copy DcmMetaInfo's member variables + preambleUsed = obj.preambleUsed; + fPreambleTransferState = obj.fPreambleTransferState; + Xfer = obj.Xfer; + memcpy(filePreamble, obj.filePreamble, 128); + } + return *this; +} + + +OFCondition DcmMetaInfo::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmMetaInfo &, rhs); + } + return EC_Normal; +} + + +DcmMetaInfo::~DcmMetaInfo() +{ +} + + +// ******************************** + + +DcmEVR DcmMetaInfo::ident() const +{ + return EVR_metainfo; +} + + +E_TransferSyntax DcmMetaInfo::getOriginalXfer() const +{ + return Xfer; +} + + +void DcmMetaInfo::removeInvalidGroups() +{ + DcmStack stack; + DcmObject *object = NULL; + /* iterate over all elements */ + while (nextObject(stack, OFTrue).good()) + { + object = stack.top(); + /* delete invalid elements */ + if (object->getGTag() != 0x0002) + { + DCMDATA_DEBUG("DcmMetaInfo::removeInvalidGroups() removing element " + << object->getTag() << " from meta header"); + stack.pop(); + /* remove element from meta information header and free memory */ + delete OFstatic_cast(DcmItem *, stack.top())->remove(object); + } + } +} + + +// ******************************** + + +void DcmMetaInfo::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + out << OFendl; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + printNestingLevel(out, flags, level); + out << "# Dicom-Meta-Information-Header" << OFendl; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + printNestingLevel(out, flags, level); + out << "# Used TransferSyntax: " << DcmXfer(Xfer).getXferName(); + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_RESET; + out << OFendl; + if (!elementList->empty()) + { + DcmObject *dO; + elementList->seek(ELP_first); + do { + dO = elementList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (elementList->seek(ELP_next)); + } +} + + +// ******************************** + + +OFCondition DcmMetaInfo::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + OFCondition l_error = EC_Normal; + if (flags & DCMTypes::XF_useNativeModel) + { + /* in Native DICOM Model, there is no concept of a "file format" */ + l_error = makeOFCondition(OFM_dcmdata, EC_CODE_CannotConvertToXML, OF_error, + "Cannot convert File Meta Information to Native DICOM Model"); + } else { + OFString xmlString; + DcmXfer xfer(Xfer); + /* XML start tag for "meta-header" */ + out << "" << OFendl; + /* write content of file meta information */ + if (!elementList->empty()) + { + /* write content of all children */ + DcmObject *dO; + elementList->seek(ELP_first); + do + { + dO = elementList->get(); + l_error = dO->writeXML(out, flags); + } while (l_error.good() && elementList->seek(ELP_next)); + } + if (l_error.good()) + { + /* XML end tag for "meta-header" */ + out << "" << OFendl; + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmMetaInfo::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + if (format.printMetaheaderInformation) + { + // write content of file meta information + if (!elementList->empty()) + { + elementList->seek(ELP_first); + OFCondition status = EC_Normal; + status = elementList->get()->writeJson(out, format); + while (status.good() && elementList->seek(ELP_next)) + { + out << "," << format.newline(); + status = elementList->get()->writeJson(out, format); + } + return status; + } + } + return EC_Normal; +} + +// ******************************** + +void DcmMetaInfo::setPreamble() +{ + memzero(filePreamble, sizeof(filePreamble)); + preambleUsed = OFFalse; +} + + +// ******************************** + + +OFBool DcmMetaInfo::checkAndReadPreamble(DcmInputStream &inStream, + E_TransferSyntax &newxfer) +{ + if (fPreambleTransferState == ERW_init) + { + inStream.mark(); + fPreambleTransferState = ERW_inWork; + } + // by default, we assume that there is no preamble + OFBool hasPreamble = OFFalse; + if (fPreambleTransferState == ERW_inWork) + { + const Uint32 preambleLen = DCM_PreambleLen + DCM_MagicLen; + const Uint32 readLen = preambleLen - getTransferredBytes(); + if (readLen > 0) + incTransferredBytes(OFstatic_cast(Uint32, inStream.read(&filePreamble[getTransferredBytes()], readLen))); + // file too short, no preamble + if (inStream.eos() && getTransferredBytes() != preambleLen) + { + inStream.putback(); + DCMDATA_TRACE("DcmMetaInfo::checkAndReadPreamble() No Preamble available: File too short (" + << preambleLen << ") < " << DCM_PreambleLen + DCM_MagicLen << " bytes"); + this -> setPreamble(); + fPreambleTransferState = ERW_ready; + } + // check preamble and DICOM prefix + else if (getTransferredBytes() == preambleLen) + { + // set prefix to appropriate position + char *prefix = filePreamble + DCM_PreambleLen; + if (memcmp(prefix, DCM_Magic, DCM_MagicLen) == 0) + { + // preamble present + hasPreamble = OFTrue; + // inStream.UnsetPutbackMark(); // not needed anymore with new stream architecture + } else { + // no preamble + this -> setPreamble(); + inStream.putback(); + } + fPreambleTransferState = ERW_ready; + } else + errorFlag = EC_StreamNotifyClient; + } + + if (fPreambleTransferState == ERW_ready) + { + E_TransferSyntax tmpXfer = checkTransferSyntax(inStream); + DcmXfer tmpXferSyn(tmpXfer); + DcmXfer xferSyn(newxfer); + // check determined transfer syntax + if ((tmpXferSyn.isExplicitVR() && xferSyn.isImplicitVR()) || + (tmpXferSyn.isImplicitVR() && xferSyn.isExplicitVR()) || + xferSyn.getXfer() == EXS_Unknown) + { + // use determined transfer syntax + newxfer = tmpXferSyn.getXfer(); + if (xferSyn.getXfer() != EXS_Unknown) + DCMDATA_WARN("DcmMetaInfo: TransferSyntax of MetaInfo is other than expected"); + } else + newxfer = xferSyn.getXfer(); + } + if (hasPreamble) + { + DCMDATA_TRACE("DcmMetaInfo::checkAndReadPreamble() Preamble = 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(4) << OFstatic_cast(Uint32, *filePreamble)); + DCMDATA_DEBUG("DcmMetaInfo::checkAndReadPreamble() TransferSyntax=\"" + << DcmXfer(newxfer).getXferName() << "\""); + } else + DCMDATA_TRACE("DcmMetaInfo::checkAndReadPreamble() No Preamble found"); + + return hasPreamble; +} + + +// ******************************** + + +OFBool DcmMetaInfo::nextTagIsMeta(DcmInputStream &inStream) +{ + char testbytes[2]; + inStream.mark(); + inStream.read(testbytes, 2); + inStream.putback(); + // check for group 0x0002 only + return (testbytes[0] == 0x02 && testbytes[1] == 0x00) || (testbytes[0] == 0x00 && testbytes[1] == 0x02); +} + + +// ******************************** + + +Uint32 DcmMetaInfo::calcElementLength(const E_TransferSyntax /*xfer*/, + const E_EncodingType enctype) +{ + Uint32 metaLength = DcmItem::getLength(META_HEADER_DEFAULT_TRANSFERSYNTAX, enctype); + metaLength += DCM_PreambleLen + DCM_MagicLen; + return metaLength; +} + + +// ******************************** + + +OFCondition DcmMetaInfo::readGroupLength(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const DcmTagKey &xtag, + const E_GrpLenEncoding glenc, + Uint32 &headerLen, + Uint32 &bytesRead, + const Uint32 maxReadLength) +{ + OFCondition l_error = EC_TagNotFound; + E_TransferSyntax newxfer = xfer; + bytesRead = 0; + headerLen = 0; + if (nextTagIsMeta(inStream)) + { + DcmTag newTag; + Uint32 newValueLength = 0; + Uint32 bytes_tagAndLen = 0; + l_error = DcmItem::readTagAndLength(inStream, newxfer, newTag, newValueLength, bytes_tagAndLen); + bytesRead += bytes_tagAndLen; + if (l_error.good() && !inStream.good()) + l_error = inStream.status(); + if (l_error.good()) + { + l_error = DcmItem::readSubElement(inStream, newTag, newValueLength, newxfer, glenc, maxReadLength); + bytesRead += newValueLength; + if (l_error.good() && newTag.getXTag() == xtag && elementList->get() != NULL && newValueLength > 0) + { + l_error = (OFstatic_cast(DcmUnsignedLong *, elementList->get()))->getUint32(headerLen); + DCMDATA_TRACE("DcmMetaInfo::readGroupLength() Group Length of File Meta Header = " << headerLen + bytesRead); + } else { + l_error = EC_CorruptedData; + DCMDATA_WARN("DcmMetaInfo: No Group Length available in Meta Information Header"); + } + } + } + + DCMDATA_TRACE("DcmMetaInfo::readGroupLength() returns error = " << l_error.text()); + return l_error; +} + + +// ******************************** + + +OFCondition DcmMetaInfo::read(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + if (fPreambleTransferState == ERW_notInitialized || getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + Xfer = xfer; + E_TransferSyntax newxfer = xfer; + // figure out if the stream reported an error + errorFlag = inStream.status(); + if (errorFlag.good() && inStream.eos()) + errorFlag = EC_EndOfStream; + else if (errorFlag.good() && getTransferState() != ERW_ready) + { + if (getTransferState() == ERW_init && fPreambleTransferState != ERW_ready) + { + if (xfer == EXS_Unknown) + preambleUsed = checkAndReadPreamble(inStream, newxfer); + else + newxfer = xfer; + if (fPreambleTransferState == ERW_ready) + { + Xfer = newxfer; // store parameter transfer syntax + setTransferState(ERW_inWork); + setTransferredBytes(0); + fStartPosition = inStream.tell(); + setLengthField(0); + } + } + if (getTransferState() == ERW_inWork && getLengthField() == 0) + { + if (inStream.avail() < OFstatic_cast(offile_off_t, DCM_GroupLengthElementLength)) + errorFlag = EC_StreamNotifyClient; + else + { + Uint32 headerLength = 0; + Uint32 bytesRead = 0; + errorFlag = readGroupLength(inStream, newxfer, DCM_FileMetaInformationGroupLength, glenc, + headerLength, bytesRead, maxReadLength); + + setTransferredBytes(bytesRead); + + if (errorFlag.good()) + { + /* FileMetaInformationGroupLength (0002,0000) is present but should be ignored */ + if (dcmIgnoreFileMetaInformationGroupLength.get()) + { + DCMDATA_WARN("DcmMetaInfo: Ignoring Group Length of Meta Information Header"); + setLengthField(DCM_UndefinedLength); + } else + setLengthField(headerLength + getTransferredBytes()); + } else + setLengthField(DCM_UndefinedLength); + } + } +#ifdef REJECT_FILE_IF_META_GROUP_LENGTH_ABSENT + // this is the old behaviour up to DCMTK 3.5.3: fail with EC_CorruptedData error code + // if the file meta header group length (0002,0000) is absent. + if (getTransferState() == ERW_inWork && getLengthField() != 0 && errorFlag.good()) + { +#else + // new behaviour: accept file without meta header group length, determine end of + // meta header based on heuristic that checks for group 0002 tags. + if (getTransferState() == ERW_inWork && getLengthField() != 0 && (errorFlag.good() || + ((errorFlag == EC_CorruptedData) && (getLengthField() == DCM_UndefinedLength)))) + { + // start with "no error" in order to handle meta-header with only one data element + errorFlag = EC_Normal; +#endif + while (inStream.good() && !inStream.eos() && + ((getLengthField() < DCM_UndefinedLength && getTransferredBytes() < getLengthField()) || + (getLengthField() == DCM_UndefinedLength && nextTagIsMeta(inStream)) || + !lastElementComplete)) + { + DcmTag newTag; + Uint32 newValueLength = 0; + Uint32 bytes_tagAndLen = 0; + if (lastElementComplete) + { + errorFlag = DcmItem::readTagAndLength(inStream, newxfer, newTag, newValueLength, bytes_tagAndLen); + incTransferredBytes(bytes_tagAndLen); + if (errorFlag != EC_Normal) + break; // terminate while loop + lastElementComplete = OFFalse; + errorFlag = DcmItem::readSubElement(inStream, newTag, newValueLength, newxfer, glenc, maxReadLength); + if (errorFlag.good()) + lastElementComplete = OFTrue; + /* check for valid meta-header elements */ + if (newTag.getGroup() != 0x0002) + DCMDATA_WARN("DcmMetaInfo: Invalid Element " << newTag << " found in Meta Information Header"); + } else { + errorFlag = elementList->get()->read(inStream, xfer, glenc, maxReadLength); + if (errorFlag.good()) + lastElementComplete = OFTrue; + } + setTransferredBytes(OFstatic_cast(Uint32, inStream.tell() - fStartPosition)); + if (errorFlag.bad()) + break; // terminate while loop + + } //while + } + if (errorFlag == EC_TagNotFound || errorFlag == EC_EndOfStream) + { + errorFlag = EC_Normal; // there is no meta header + Xfer = EXS_Unknown; + if (preambleUsed) // ... but a preamble! + DCMDATA_WARN("DcmMetaInfo: Found Preamble but no Meta Information Header"); + } else if (errorFlag == EC_ItemEnd) + errorFlag = EC_Normal; + if (errorFlag.good()) + { + if (getLengthField() != DCM_UndefinedLength && getTransferredBytes() != getLengthField()) + DCMDATA_WARN("DcmMetaInfo: Group Length of Meta Information Header has incorrect value"); + setTransferState(ERW_ready); // MetaInfo is complete + } + } + } + return errorFlag; +} // DcmMetaInfo::read() + + +// ******************************** + + +void DcmMetaInfo::transferInit() +{ + DcmItem::transferInit(); + fPreambleTransferState = ERW_init; +} + + +// ******************************** + + +void DcmMetaInfo::transferEnd() +{ + DcmItem::transferEnd(); + fPreambleTransferState = ERW_notInitialized; +} + + +// ******************************** + + +OFCondition DcmMetaInfo::write( + DcmOutputStream &outStream, + const E_TransferSyntax /*oxfer*/, + const E_EncodingType enctype, + DcmWriteCache *wcache) + /* + * This function writes all data elements which make up the meta header to the stream. + * For a specification of the elements that make up the meta header see DICOM standard + * (year 2000) part 10, section 7.1)) or the corresponding section in a later version of + * the standard). + * + * Parameters: + * outStream - [inout] The stream that the information will be written to. + * oxfer - [in] The transfer syntax which shall be used. (is not necessary since the meta header + * shall always be encoded in the explicit VR little endian transfer syntax) + * enctype - [in] Encoding type for sequences. Specifies how sequences will be handled. + */ +{ + /* if the transfer state of this is not initialized, this is an illegal call */ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* if this is not an illegal call, do something */ + + /* determine the (default) transfer syntax which shall be used (always explicit VR little endian) */ + E_TransferSyntax outxfer = META_HEADER_DEFAULT_TRANSFERSYNTAX; + /* check if the stream reported an error so far */ + errorFlag = outStream.status(); + /* if the stream did not report any error and the transfer state is ERW_ready, */ + /* go ahead and write the meta header information to the out stream */ + if (errorFlag.good() && getTransferState() != ERW_ready) + { + /* if some particular conditions are met we need to write the file preamble (128 byte wide) and */ + /* the DICOM prefix "DICM" to the stream. Always check if there is enough space in the stream and */ + /* set the transfer state of certain elements to indicate that they have already been written. */ + if (getTransferState() == ERW_init) + { + if (preambleUsed || !elementList->empty()) + { + if (fPreambleTransferState == ERW_init) + { + incTransferredBytes(OFstatic_cast(Uint32, outStream.write(&filePreamble[getTransferredBytes()], + DCM_PreambleLen - getTransferredBytes()))); + if (getTransferredBytes() != DCM_PreambleLen) + errorFlag = EC_StreamNotifyClient; + else + fPreambleTransferState = ERW_inWork; + } + if (fPreambleTransferState == ERW_inWork && outStream.avail() >= 4) + { + outStream.write(DCM_Magic, 4); + fPreambleTransferState = ERW_ready; + setTransferState(ERW_inWork); + elementList->seek(ELP_first); + } else + errorFlag = EC_StreamNotifyClient; + } + } + /* if the file preamble and the DICOM prefix have been written, go */ + /* ahead and write the meta header's data elements to the stream. */ + /* (note that at this point elementList->get() should never be NULL, */ + /* but lets play the game safe here...) */ + if (!elementList->empty() && (getTransferState() == ERW_inWork) && (elementList->get() != NULL)) + { + DcmObject *dO; + /* iterate over the list of data elements and write them to the stream */ + do { + dO = elementList->get(); + errorFlag = dO->write(outStream, outxfer, enctype, wcache); + } while (errorFlag.good() && elementList->seek(ELP_next)); + } + /* if the error flag equals ok and the transfer state equals ERW_inWork, all data elements of the meta */ + /* header have been written to the stream. Indicate this by setting the transfer state to ERW_ready */ + if (errorFlag.good() && getTransferState() == ERW_inWork) + setTransferState(ERW_ready); + } + } + /* return result value */ + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmMetaInfo::loadFile(const OFFilename &fileName, + const E_TransferSyntax readXfer, + const E_GrpLenEncoding groupLength, + const Uint32 maxReadLength) +{ + OFCondition l_error = EC_InvalidFilename; + /* check parameters first */ + if (!fileName.isEmpty()) + { + /* open file for input */ + DcmInputFileStream fileStream(fileName); + /* check stream status */ + l_error = fileStream.status(); + if (l_error.good()) + { + /* clear this object */ + l_error = clear(); + if (l_error.good()) + { + /* read data from file */ + transferInit(); + l_error = read(fileStream, readXfer, groupLength, maxReadLength); + transferEnd(); + /* make sure that the file preamble is present */ + if (l_error.good() && !preambleUsed) + l_error = EC_FileMetaInfoHeaderMissing; + } + } + } + return l_error; +} diff --git a/dcmdata/libsrc/dcobject.cc b/dcmdata/libsrc/dcobject.cc new file mode 100644 index 00000000..8d1d2ad4 --- /dev/null +++ b/dcmdata/libsrc/dcobject.cc @@ -0,0 +1,641 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: + * This file contains the interface to routines which provide + * DICOM object encoding/decoding, search and lookup facilities. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ + +#define INCLUDE_CSTDIO +#define INCLUDE_IOMANIP +#include "dcmtk/ofstd/ofstdinc.h" + + +// global flags + +OFGlobal dcmEnableAutomaticInputDataCorrection(OFTrue); +OFGlobal dcmAcceptOddAttributeLength(OFTrue); +OFGlobal dcmEnableCP246Support(OFTrue); +OFGlobal dcmEnableOldSignatureFormat(OFFalse); +OFGlobal dcmAutoDetectDatasetXfer(OFFalse); +OFGlobal dcmAcceptUnexpectedImplicitEncoding(OFFalse); +OFGlobal dcmPreferVRFromDataDictionary(OFFalse); +OFGlobal dcmPreferLengthFieldSizeFromDataDictionary(OFFalse); +OFGlobal dcmReadImplPrivAttribMaxLengthAsSQ(OFFalse); +OFGlobal dcmIgnoreParsingErrors(OFFalse); +OFGlobal dcmStopParsingAfterElement(DCM_UndefinedTagKey); // (0xffff,0xffff) +OFGlobal dcmWriteOversizedSeqsAndItemsUndefined(OFTrue); +OFGlobal dcmIgnoreFileMetaInformationGroupLength(OFFalse); +OFGlobal dcmReplaceWrongDelimitationItem(OFFalse); +OFGlobal dcmConvertUndefinedLengthOBOWtoSQ(OFFalse); +OFGlobal dcmConvertVOILUTSequenceOWtoSQ(OFFalse); +OFGlobal dcmUseExplLengthPixDataForEncTS(OFFalse); + +// ****** public methods ********************************** + + +DcmObject::DcmObject(const DcmTag &tag, + const Uint32 len) +: errorFlag(EC_Normal) +, Tag(tag) +, Length(len) +, fTransferState(ERW_init) +, fTransferredBytes(0) +, Parent(NULL) +{ +} + + +DcmObject::DcmObject(const DcmObject &obj) +: errorFlag(obj.errorFlag) +, Tag(obj.Tag) +, Length(obj.Length) +, fTransferState(obj.fTransferState) +, fTransferredBytes(obj.fTransferredBytes) +, Parent(NULL) +{ +} + + +DcmObject::~DcmObject() +{ +} + + +DcmObject &DcmObject::operator=(const DcmObject &obj) +{ + if (this != &obj) + { + Tag = obj.Tag; + Length = obj.Length; + errorFlag = obj.errorFlag; + fTransferState = obj.fTransferState; + fTransferredBytes = obj.fTransferredBytes; + Parent = NULL; + } + return *this; +} + + +// ******************************** + + +void DcmObject::transferInit() +{ + fTransferState = ERW_init; + fTransferredBytes = 0; +} + + +void DcmObject::transferEnd() +{ + fTransferState = ERW_notInitialized; +} + + +// ******************************** + + +OFBool DcmObject::isNested() const +{ + OFBool nested = OFFalse; + if (Parent != NULL) + { + // check for surrounding structure of item and sequence + DcmEVR parentIdent = Parent->ident(); + if ((parentIdent == EVR_item) || (parentIdent == EVR_dirRecord)) + { + if (Parent->getParent() != NULL) + { + parentIdent = Parent->getParent()->ident(); + if ((parentIdent == EVR_SQ) || (parentIdent == EVR_pixelSQ)) + nested = OFTrue; + } + } + } + return nested; +} + + +DcmItem *DcmObject::getRootItem() +{ + DcmItem *rootItem = NULL; + DcmObject *parent = this; + // search for the root object + do { + // stop at top-level dataset/item + if ((parent->getParent() == NULL) || (parent->getParent()->ident() == EVR_fileFormat)) + break; + parent = parent->getParent(); + } while (parent != NULL); + if (parent != NULL) + { + // make sure that it is really a class derived from DcmItem + switch (parent->ident()) + { + case EVR_metainfo: + case EVR_dataset: + case EVR_item: + case EVR_dirRecord: + rootItem = OFreinterpret_cast(DcmItem *, parent); + break; + default: + // Don't generate a message when there is no root + if (this != parent) + { + DCMDATA_DEBUG("DcmObject::getRootItem() Root object has wrong class identifier: " + << OFstatic_cast(int, parent->ident()) + << " (" << DcmVR(parent->ident()).getVRName() << ")"); + } + break; + } + } + return rootItem; +} + + +DcmItem *DcmObject::getParentItem() +{ + DcmItem *parentItem = NULL; + if (Parent != NULL) + { + // make sure that it is really a class derived from DcmItem + switch (Parent->ident()) + { + case EVR_metainfo: + case EVR_dataset: + case EVR_item: + case EVR_dirRecord: + parentItem = OFreinterpret_cast(DcmItem *, Parent); + break; + default: + DCMDATA_DEBUG("DcmObject::getParentItem() Parent object has wrong class identifier: " + << OFstatic_cast(int, Parent->ident()) + << " (" << DcmVR(Parent->ident()).getVRName() << ")"); + break; + } + } + return parentItem; +} + + +// ******************************** + + +DcmObject *DcmObject::nextInContainer(const DcmObject * /*obj*/) +{ + return NULL; +} + + +OFCondition DcmObject::nextObject(DcmStack & /*stack*/, + const OFBool /*intoSub*/) +{ + return EC_TagNotFound; +} + + +// ******************************** + + +OFCondition DcmObject::search(const DcmTagKey &/*tag*/, + DcmStack &/*resultStack*/, + E_SearchMode /*mode*/, + OFBool /*searchIntoSub*/) +{ + return EC_TagNotFound; +} + + +// ******************************** + + +OFCondition DcmObject::writeXML(STD_NAMESPACE ostream& /*out*/, + const size_t /*flags*/) +{ + return EC_IllegalCall; +} + + +// ******************************** + + +OFCondition DcmObject::writeJson(STD_NAMESPACE ostream& /*out*/, + DcmJsonFormat& /*format*/) +{ + return EC_IllegalCall; +} + + +// *********************************************************** +// ****** protected methods ********************************** +// *********************************************************** + + +void DcmObject::printNestingLevel(STD_NAMESPACE ostream &out, + const size_t flags, + const int level) +{ + if (flags & DCMTypes::PF_showTreeStructure) + { + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_LINE; + /* show vertical bar for the tree structure */ + for (int i = 1; i < level; i++) + out << "| "; + } else { + /* show nesting level */ + for (int i = 1; i < level; i++) + out << " "; + } +} + + +void DcmObject::printInfoLineStart(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + DcmTag *tag) +{ + /* default: use object's tag */ + if (tag == NULL) + tag = &Tag; + DcmVR vr(tag->getVR()); + /* show nesting level */ + printNestingLevel(out, flags, level); + if (flags & DCMTypes::PF_showTreeStructure) + { + if (flags & DCMTypes::PF_useANSIEscapeCodes) + { + if (*tag == DCM_Item) + out << DCMDATA_ANSI_ESCAPE_CODE_ITEM; + else if ((vr.getEVR() == EVR_SQ) || (vr.getEVR() == EVR_pixelSQ)) + { + if (level == 1) + out << DCMDATA_ANSI_ESCAPE_CODE_SEQUENCE_1; + else + out << DCMDATA_ANSI_ESCAPE_CODE_SEQUENCE; + } else if (level == 1) + out << DCMDATA_ANSI_ESCAPE_CODE_NAME_1; + else + out << DCMDATA_ANSI_ESCAPE_CODE_NAME; + } + /* print tag name */ + out << tag->getTagName() << ' '; + /* add padding spaces if required */ + const STD_NAMESPACE ptrdiff_t padLength = DCM_OptPrintAttributeNameLength - strlen(tag->getTagName()) - 2 * level; + if (padLength > 0) + out << OFString(OFstatic_cast(size_t, padLength), ' '); + } else { + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_TAG; + /* print line start: tag */ + out << *tag << " "; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_VR; + /* print line start: VR */ + out << vr.getVRName() << " " + << STD_NAMESPACE dec << STD_NAMESPACE setfill(' '); + } + /* set color for subsequent element value */ + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_VALUE; +} + + +void DcmObject::printInfoLineEnd(STD_NAMESPACE ostream &out, + const size_t flags, + const unsigned long printedLength, + DcmTag *tag) +{ + unsigned long vm = 0; + unsigned long length = 0; + /* default: use object's tag, VM and length */ + if (tag == NULL) + { + tag = &Tag; + vm = getVM(); + length = Length; + } + if (!(flags & DCMTypes::PF_showTreeStructure)) + { + /* fill with spaces if necessary */ + if (printedLength < DCM_OptPrintValueLength) + out << OFString(OFstatic_cast(size_t, DCM_OptPrintValueLength - printedLength), ' '); + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + out << " # "; + /* print line end: length */ + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_LENGTH; + if (length == DCM_UndefinedLength) + out << "u/l"; // means "undefined/length" + else + out << STD_NAMESPACE setw(3) << length; + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_COMMENT; + out << ","; + /* print line end: VM */ + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_VM; + out << STD_NAMESPACE setw(2) << vm << " "; + /* print line end: name */ + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_NAME; + out << tag->getTagName(); + } + /* reset all colors and styles */ + if (flags & DCMTypes::PF_useANSIEscapeCodes) + out << DCMDATA_ANSI_ESCAPE_CODE_RESET; + /* finish the current line */ + out << OFendl; +} + + +void DcmObject::printInfoLine(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *info, + DcmTag *tag, + const OFBool isInfo) +{ + /* print tag and VR */ + printInfoLineStart(out, flags, level, tag); + /* check whether info text fits into the limit */ + size_t printedLength = 0; + /* check for valid info text */ + if (info != NULL) + { + if (isInfo && (flags & DCMTypes::PF_useANSIEscapeCodes)) + out << DCMDATA_ANSI_ESCAPE_CODE_INFO; + /* check info text length */ + printedLength = strlen(info); + if (printedLength > DCM_OptPrintValueLength) + { + /* check whether full info text should be printed */ + if ((flags & DCMTypes::PF_shortenLongTagValues) && (printedLength > DCM_OptPrintLineLength)) + { + char output[DCM_OptPrintLineLength + 1]; + /* truncate info text and append "..." */ + OFStandard::strlcpy(output, info, OFstatic_cast(size_t, DCM_OptPrintLineLength) - 3 /* for "..." */ + 1); + OFStandard::strlcat(output, "...", OFstatic_cast(size_t, DCM_OptPrintLineLength) + 1); + out << output; + printedLength = DCM_OptPrintLineLength; + } else + out << info; + } else + out << info; + } + /* print length, VM and tag name */ + printInfoLineEnd(out, flags, OFstatic_cast(unsigned long, printedLength), tag); +} + + +// ******************************** + + +OFCondition DcmObject::writeTag(DcmOutputStream &outStream, + const DcmTag &tag, + const E_TransferSyntax oxfer) + /* + * This function writes the tag information which was passed to the stream. When + * writing information, the transfer syntax which was passed is accounted for. + * + * Parameters: + * outStream - [out] The stream that the information will be written to. + * tag - [in] The tag which shall be written. + * oxfer - [in] The transfer syntax which shall be used. + */ +{ + /* create an object which represents the transfer syntax */ + DcmXfer outXfer(oxfer); + /* determine the byte ordering */ + const E_ByteOrder outByteOrder = outXfer.getByteOrder(); + /* if the byte ordering is unknown, this is an illegal call (return error) */ + if (outByteOrder == EBO_unknown) + return EC_IllegalCall; + /* determine the group number, mind the transfer syntax and */ + /* write the group number value (2 bytes) to the stream */ + Uint16 groupTag = tag.getGTag(); + swapIfNecessary(outByteOrder, gLocalByteOrder, &groupTag, 2, 2); + outStream.write(&groupTag, 2); + /* determine the element number, mind the transfer syntax and */ + /* write the element number value (2 bytes) to the stream */ + Uint16 elementTag = tag.getETag(); // 2 byte length; + swapIfNecessary(outByteOrder, gLocalByteOrder, &elementTag, 2, 2); + outStream.write(&elementTag, 2); + /* if the stream reports an error return this error, else return ok */ + return outStream.status(); +} + + +Uint32 DcmObject::getTagAndLengthSize(const E_TransferSyntax oxfer) const +{ + /* create an object which represents the transfer syntax */ + DcmXfer oxferSyn(oxfer); + + if (oxferSyn.isExplicitVR()) + { + /* map "UN" to "OB" if generation of "UN" is disabled */ + DcmVR outvr(getTag().getVR().getValidEVR()); + + if (Length > 0xffff || outvr.usesExtendedLengthEncoding()) + { + // we are either using extended length encoding or the + // element length is > 64k (i.e. we have to convert to OB/UN). + // In any case we need a 12-byte header field. + // This is also the case for any object with undefined length, + // so we don't need to check that as a special case. + return 12; + } + } + return 8; +} + + +OFCondition DcmObject::writeTagAndLength(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + Uint32 &writtenBytes) const + /* + * This function writes this DICOM object's tag and length information to the stream. When + * writing information, the transfer syntax which was passed is accounted for. If the transfer + * syntax shows an explicit value representation, the data type of this object is also written + * to the stream. In general, this function follows the rules which are specified in the DICOM + * standard (see DICOM standard part 5, section 7) concerning the encoding of a data set which + * shall be transmitted. + * + * Parameters: + * outStream - [out] The stream that the information will be written to. + * oxfer - [in] The transfer syntax which shall be used. + * writtenBytes - [out] Contains in the end the amount of bytes which have been written to the stream. + */ +{ + /* check the error status of the stream. If it is not ok, nothing can be done */ + OFCondition l_error = outStream.status(); + if (l_error.bad()) + { + writtenBytes = 0; + } else { + /* if the stream is ok, we need to do something */ + + /* write the tag information (a total of 4 bytes, group number and element */ + /* number) to the stream. Mind the transfer syntax's byte ordering. */ + l_error = writeTag(outStream, getTag(), oxfer); + writtenBytes = 4; + + /* create an object which represents the transfer syntax */ + DcmXfer oxferSyn(oxfer); + + /* determine the byte ordering */ + const E_ByteOrder oByteOrder = oxferSyn.getByteOrder(); + + /* if the byte ordering is unknown, this is an illegal call (return error) */ + if (oByteOrder == EBO_unknown) + return EC_IllegalCall; + + /* if the transfer syntax is one with explicit value representation */ + /* this value's data type also has to be written to the stream. Do so */ + /* and also write the length information to the stream. */ + if (oxferSyn.isExplicitVR()) + { + /* Create an object that represents this object's data type */ + DcmVR myvr(getVR()); + + /* getValidEVR() will convert datatype "UN" to "OB" if generation of "UN" is disabled */ + DcmEVR vr = myvr.getValidEVR(); + myvr.setVR(vr); + + if (Length > 0xffff && (!myvr.usesExtendedLengthEncoding())) + { + // Attribute length is larger than 64 kBytes. + // We need to encode this as UN (or OB, if generation of UN is disabled + if (dcmEnableUnknownVRGeneration.get()) vr = EVR_UN; else vr = EVR_OB; + myvr.setVR(vr); + } + + /* get name of data type */ + const char *vrname = myvr.getValidVRName(); + + /* write data type name to the stream (a total of 2 bytes) */ + outStream.write(vrname, 2); + writtenBytes += 2; + + /* create another data type object on the basis of the above created object */ + DcmVR outvr(vr); + + /* in case we are dealing with a transfer syntax with explicit VR (see if above) */ + /* and the actual VR uses extended length encoding (see DICOM standard part 5, */ + /* section 7.1.2) we have to add 2 reserved bytes (set to a value of 00H) to the */ + /* data type field and the actual length field is 4 bytes wide. Write the */ + /* corresponding information to the stream. */ + if (outvr.usesExtendedLengthEncoding()) + { + Uint16 reserved = 0; + outStream.write(&reserved, 2); // write 2 reserved bytes to stream + Uint32 valueLength = Length; // determine length + swapIfNecessary(oByteOrder, gLocalByteOrder, &valueLength, 4, 4); // mind transfer syntax + outStream.write(&valueLength, 4); // write length, 4 bytes wide + writtenBytes += 6; // remember that 6 bytes were written in total + } + /* in case that we are dealing with a transfer syntax with explicit VR (see if above) and */ + /* the actual VR does not use extended length encoding (see DICOM standard part 5, section */ + /* 7.1.2) we do not have to add reserved bytes to the data type field and the actual length */ + /* is 2 bytes wide. Write the corresponding information to the stream. But, make sure that */ + /* the length really fits into the 2-byte field ... */ + else if (Length <= 0xffff) + { + Uint16 valueLength = OFstatic_cast(Uint16, Length); // determine length (cast to 16 bit) + swapIfNecessary(oByteOrder, gLocalByteOrder, &valueLength, 2, 2); // mind transfer syntax + outStream.write(&valueLength, 2); // write length, 2 bytes wide + writtenBytes += 2; // remember that 2 bytes were written in total + } + /* ... if not, report an error message and return an error code. + * This should never happen because we automatically convert such + * elements to UN/OB, but just in case, we leave the check in here. + */ + else { + DcmTag tag(Tag); + DCMDATA_ERROR("DcmObject: Length of element " << tag.getTagName() << " " << tag + << " exceeds maximum of 16-bit length field"); + l_error = EC_ElemLengthExceeds16BitField; + } + } + /* if the transfer syntax is one with implicit value representation this value's data type */ + /* does not have to be written to the stream. Only the length information has to be written */ + /* to the stream. According to the DICOM standard the length field is in this case always 4 */ + /* byte wide. (see DICOM standard part 5, section 7.1.2) */ + else { + Uint32 valueLength = Length; // determine length + swapIfNecessary(oByteOrder, gLocalByteOrder, &valueLength, 4, 4); // mind transfer syntax + outStream.write(&valueLength, 4); // write length, 4 bytes wide + writtenBytes += 4; // remember that 4 bytes were written in total + } + } + + /* return result */ + return l_error; +} + + +OFBool DcmObject::isSignable() const +{ + return Tag.isSignable(); +} + + +OFBool DcmObject::containsUnknownVR() const +{ + return Tag.isUnknownVR(); +} + + +OFBool DcmObject::containsExtendedCharacters(const OFBool /*checkAllStrings*/) +{ + return OFFalse; +} + + +OFBool DcmObject::isAffectedBySpecificCharacterSet() const +{ + return OFFalse; +} + + +OFCondition DcmObject::convertCharacterSet(DcmSpecificCharacterSet & /*converter*/) +{ + return EC_Normal; +} + + +OFBool DcmObject::isEmpty(const OFBool /*normalize*/) +{ + return (Length == 0); +} diff --git a/dcmdata/libsrc/dcostrma.cc b/dcmdata/libsrc/dcostrma.cc new file mode 100644 index 00000000..44fdb0a4 --- /dev/null +++ b/dcmdata/libsrc/dcostrma.cc @@ -0,0 +1,103 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: base classes for output streams + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcostrma.h" +#include "dcmtk/dcmdata/dcostrmz.h" /* for DcmZLibOutputFilter */ +#include "dcmtk/dcmdata/dcerror.h" /* for EC_IllegalCall */ + +DcmOutputStream::DcmOutputStream(DcmConsumer *initial) +: current_(initial) +, compressionFilter_(NULL) +, tell_(0) +{ +} + +DcmOutputStream::~DcmOutputStream() +{ + // we cannot access the stream anymore at this point because the + // consumer has most probably already been deleted. + delete compressionFilter_; +} + +OFCondition DcmOutputStream::installCompressionFilter(E_StreamCompression filterType) +{ + OFCondition result = EC_Normal; + if (compressionFilter_) result = EC_DoubleCompressionFilters; + else + { + switch (filterType) + { +#ifdef WITH_ZLIB + case ESC_zlib: + compressionFilter_ = new DcmZLibOutputFilter(); + if (compressionFilter_) + { + compressionFilter_->append(*current_); + current_ = compressionFilter_; + } else result = EC_MemoryExhausted; + break; +#endif + case ESC_none: + case ESC_unsupported: + result = EC_UnsupportedEncoding; + break; + } + } + return result; +} + +OFBool DcmOutputStream::good() const +{ + return current_->good(); +} + +OFCondition DcmOutputStream::status() const +{ + return current_->status(); +} + +OFBool DcmOutputStream::isFlushed() const +{ + return current_->isFlushed(); +} + +offile_off_t DcmOutputStream::avail() const +{ + return current_->avail(); +} + +offile_off_t DcmOutputStream::write(const void *buf, offile_off_t buflen) +{ + offile_off_t result = current_->write(buf, buflen); + tell_ += result; + return result; +} + +void DcmOutputStream::flush() +{ + current_->flush(); +} + +offile_off_t DcmOutputStream::tell() const +{ + return tell_; +} diff --git a/dcmdata/libsrc/dcostrmb.cc b/dcmdata/libsrc/dcostrmb.cc new file mode 100644 index 00000000..3d13ad09 --- /dev/null +++ b/dcmdata/libsrc/dcostrmb.cc @@ -0,0 +1,118 @@ +/* + * + * Copyright (C) 2002-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmOutputBufferStream and related classes, + * implements output to blocks of memory as needed in the dcmnet module. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcostrmb.h" +#include "dcmtk/dcmdata/dcerror.h" + + +DcmBufferConsumer::DcmBufferConsumer(void *buf, offile_off_t bufLen) +: DcmConsumer() +, buffer_(OFstatic_cast(unsigned char *, buf)) +, bufSize_(bufLen) +, filled_(0) +, status_(EC_Normal) +{ + if (buffer_ == NULL) status_ = EC_IllegalCall; +} + +DcmBufferConsumer::~DcmBufferConsumer() +{ +} + +OFBool DcmBufferConsumer::good() const +{ + return status_.good(); +} + +OFCondition DcmBufferConsumer::status() const +{ + return status_; +} + +OFBool DcmBufferConsumer::isFlushed() const +{ + return (filled_ == 0); +} + +offile_off_t DcmBufferConsumer::avail() const +{ + return bufSize_ - filled_; +} + +offile_off_t DcmBufferConsumer::write(const void *buf, offile_off_t buflen) +{ + offile_off_t result = 0; + if (status_.good() && buf && buflen) + { + result = bufSize_ - filled_; + if (result > buflen) result = buflen; + memcpy(buffer_+ filled_, buf, OFstatic_cast(size_t, result)); + filled_ += result; + } + return result; +} + +void DcmBufferConsumer::flush() +{ + // nothing to flush +} + +void DcmBufferConsumer::flushBuffer(void *& buffer, offile_off_t& length) +{ + buffer = buffer_; + length = filled_; + filled_ = 0; +} + +offile_off_t DcmBufferConsumer::filled() +{ + return filled_; +} + +/* ======================================================================= */ + +DcmOutputBufferStream::DcmOutputBufferStream(void *buf, offile_off_t bufLen) +: DcmOutputStream(&consumer_) // safe because DcmOutputStream only stores pointer +, consumer_(buf, bufLen) +{ +} + +DcmOutputBufferStream::~DcmOutputBufferStream() +{ +#ifdef DEBUG + if (! isFlushed()) + { + DCMDATA_WARN("DcmOutputBufferStream: Closing unflushed DcmOutputBufferStream, loss of data!"); + } +#endif +} + +void DcmOutputBufferStream::flushBuffer(void *& buffer, offile_off_t& length) +{ + consumer_.flushBuffer(buffer, length); +} + +offile_off_t DcmOutputBufferStream::filled() +{ + return consumer_.filled(); +} diff --git a/dcmdata/libsrc/dcostrmf.cc b/dcmdata/libsrc/dcostrmf.cc new file mode 100644 index 00000000..ac6ef7a2 --- /dev/null +++ b/dcmdata/libsrc/dcostrmf.cc @@ -0,0 +1,144 @@ +/* + * + * Copyright (C) 2002-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: DcmOutputFileStream and related classes, + * implements streamed output to files. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcostrmf.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + + +DcmFileConsumer::DcmFileConsumer(const OFFilename &filename) +: DcmConsumer() +, file_() +, status_(EC_Normal) +{ + if (!file_.fopen(filename, "wb")) + { + OFString buffer = OFStandard::getLastSystemErrorCode().message(); + status_ = makeOFCondition(OFM_dcmdata, 19, OF_error, buffer.c_str()); + } +} + +DcmFileConsumer::DcmFileConsumer(FILE *file) +: DcmConsumer() +, file_(file) +, status_(EC_Normal) +{ +} + +DcmFileConsumer::~DcmFileConsumer() +{ + file_.fclose(); +} + +OFBool DcmFileConsumer::good() const +{ + return status_.good(); +} + +OFCondition DcmFileConsumer::status() const +{ + return status_; +} + +OFBool DcmFileConsumer::isFlushed() const +{ + return OFTrue; +} + +offile_off_t DcmFileConsumer::avail() const +{ + // since we cannot report "unlimited", let's claim that we can still write 2GB. + // Note that offile_off_t is a signed type. + return 2147483647L; +} + +offile_off_t DcmFileConsumer::write(const void *buf, offile_off_t buflen) +{ + offile_off_t result = 0; + if (status_.good() && file_.open() && buf && buflen) + { +#ifdef WRITE_VERY_LARGE_CHUNKS + /* This is the old behaviour prior to DCMTK 3.5.5 */ + result = OFstatic_cast(offile_off_t, file_.fwrite(buf, 1, OFstatic_cast(size_t, buflen))); +#else + /* On Windows (at least for some versions of MSVC), calls to fwrite() for more than + * 67,076,095 bytes (a bit less than 64 MByte) fail if we're writing to a network + * share. See MSDN KB899149. As a workaround, we always write in chunks of + * 32M which should hardly negatively affect performance. + */ +#define DcmFileConsumer_MAX_CHUNK_SIZE 33554432 /* 32 MByte */ + offile_off_t written; + const char *buf2 = OFstatic_cast(const char *, buf); + while (buflen > DcmFileConsumer_MAX_CHUNK_SIZE) + { + written = OFstatic_cast(offile_off_t, file_.fwrite(buf2, 1, DcmFileConsumer_MAX_CHUNK_SIZE)); + result += written; + buf2 += written; + + // if we have not written a complete chunk, there is problem; bail out + if (written == DcmFileConsumer_MAX_CHUNK_SIZE) buflen -= DcmFileConsumer_MAX_CHUNK_SIZE; else buflen = 0; + } + + // last call to fwrite if the file size is not a multiple of DcmFileConsumer_MAX_CHUNK_SIZE + if (buflen) + { + written = OFstatic_cast(offile_off_t, file_.fwrite(buf2, 1, OFstatic_cast(size_t, buflen))); + result += written; + } +#endif + } + return result; +} + +void DcmFileConsumer::flush() +{ + // nothing to flush +} + +/* ======================================================================= */ + +DcmOutputFileStream::DcmOutputFileStream(const OFFilename &filename) +: DcmOutputStream(&consumer_) // safe because DcmOutputStream only stores pointer +, consumer_(filename) +{ +} + +DcmOutputFileStream::DcmOutputFileStream(FILE *file) +: DcmOutputStream(&consumer_) // safe because DcmOutputStream only stores pointer +, consumer_(file) +{ +} + +DcmOutputFileStream::~DcmOutputFileStream() +{ + // last attempt to flush stream before file is closed + flush(); +#ifdef DEBUG + if (! isFlushed()) + { + DCMDATA_WARN("closing unflushed DcmOutputFileStream, loss of data!"); + } +#endif +} diff --git a/dcmdata/libsrc/dcostrmz.cc b/dcmdata/libsrc/dcostrmz.cc new file mode 100644 index 00000000..da63b564 --- /dev/null +++ b/dcmdata/libsrc/dcostrmz.cc @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2002-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: zlib compression filter for output streams + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_ZLIB + +#include "dcmtk/dcmdata/dcostrmz.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define DCMZLIBOUTPUTFILTER_BUFSIZE 4096 + +/* taken from zutil.h */ +#if MAX_MEM_LEVEL >= 8 +#define DEF_MEM_LEVEL 8 +#else +#define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif + +OFGlobal dcmZlibCompressionLevel(Z_DEFAULT_COMPRESSION); + +// helper method to fix old-style casts warnings +BEGIN_EXTERN_C +static int OFdeflateInit(z_stream* const stream, int level) +{ +#ifdef ZLIB_ENCODE_RFC1950_HEADER + /* create deflated ZLIB format instead of deflated bitstream format + * (i.e. RFC 1950 instead of RFC 1951). + * THE RESULTING BITSTREAM IS NOT DICOM COMPLIANT! + * Use only for testing, and use with care. + */ + return deflateInit(stream, level); +#else + /* windowBits is passed < 0 to suppress zlib header */ + return deflateInit2(stream, level, Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +#endif +} +END_EXTERN_C + +DcmZLibOutputFilter::DcmZLibOutputFilter() +: DcmOutputFilter() +, current_(NULL) +, zstream_(new z_stream) +, status_(EC_MemoryExhausted) +, flushed_(OFFalse) +, inputBuf_(new unsigned char[DCMZLIBOUTPUTFILTER_BUFSIZE]) +, inputBufStart_(0) +, inputBufCount_(0) +, outputBuf_(new unsigned char[DCMZLIBOUTPUTFILTER_BUFSIZE]) +, outputBufStart_(0) +, outputBufCount_(0) +{ + if (zstream_ && inputBuf_ && outputBuf_) + { + zstream_->zalloc = Z_NULL; + zstream_->zfree = Z_NULL; + zstream_->opaque = Z_NULL; + if (Z_OK == OFdeflateInit(zstream_, dcmZlibCompressionLevel.get())) + status_ = EC_Normal; + else + { + OFString etext = "ZLib Error: "; + if (zstream_->msg) etext += zstream_->msg; + status_ = makeOFCondition(OFM_dcmdata, 16, OF_error, etext.c_str()); + } + } +} + +DcmZLibOutputFilter::~DcmZLibOutputFilter() +{ + if (zstream_) + { + deflateEnd(zstream_); // discards any unprocessed input and does not flush any pending output + delete zstream_; + } + delete[] inputBuf_; + delete[] outputBuf_; +} + + +OFBool DcmZLibOutputFilter::good() const +{ + return status_.good(); +} + +OFCondition DcmZLibOutputFilter::status() const +{ + return status_; +} + +OFBool DcmZLibOutputFilter::isFlushed() const +{ + if (status_.bad() || (current_ == NULL)) return OFTrue; + return (inputBufCount_ == 0) && (outputBufCount_ == 0) && flushed_ && current_->isFlushed(); +} + + +offile_off_t DcmZLibOutputFilter::avail() const +{ + // compute number of bytes available in input buffer + if (status_.good() ) return DCMZLIBOUTPUTFILTER_BUFSIZE - inputBufCount_; + else return 0; +} + +void DcmZLibOutputFilter::flushOutputBuffer() +{ + if (outputBufCount_) + { + // flush from outputBufStart_ to end of data or end of buffer, whatever comes first + offile_off_t numBytes = (outputBufStart_ + outputBufCount_ > DCMZLIBOUTPUTFILTER_BUFSIZE) ? + (DCMZLIBOUTPUTFILTER_BUFSIZE - outputBufStart_) : outputBufCount_ ; + + offile_off_t written = current_->write(outputBuf_ + outputBufStart_, numBytes); + + // adjust counters + outputBufCount_ -= written; + outputBufStart_ += written; + + if (outputBufStart_ == DCMZLIBOUTPUTFILTER_BUFSIZE) + { + // wrapped around + outputBufStart_ = 0; + + // now flush to end of data + if (outputBufCount_ && written) + { + written = current_->write(outputBuf_, outputBufCount_); + + // adjust counters + outputBufCount_ -= written; + outputBufStart_ += written; + } + } + + // reset buffer start to make things faster + if (outputBufCount_ == 0) outputBufStart_ = 0; + } +} + +offile_off_t DcmZLibOutputFilter::fillInputBuffer(const void *buf, offile_off_t buflen) +{ + offile_off_t result = 0; + if (buf && buflen && inputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + + const unsigned char *data = OFstatic_cast(const unsigned char *, buf); + + // use first part of input buffer + if (inputBufStart_ + inputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + result = DCMZLIBOUTPUTFILTER_BUFSIZE - (inputBufStart_ + inputBufCount_); + if (result > buflen) result = buflen; + + memcpy(inputBuf_ + inputBufStart_ + inputBufCount_, data, OFstatic_cast(size_t, result)); + inputBufCount_ += result; + data += result; + buflen -= result; + } + + // use second part of input buffer + if (buflen && (inputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) && + inputBufStart_ + inputBufCount_ >= DCMZLIBOUTPUTFILTER_BUFSIZE) + { + offile_off_t len = DCMZLIBOUTPUTFILTER_BUFSIZE - inputBufCount_; + if (len > buflen) len = buflen; + + memcpy(inputBuf_ + (inputBufStart_ + inputBufCount_ - DCMZLIBOUTPUTFILTER_BUFSIZE), data, OFstatic_cast(size_t, len)); + + inputBufCount_ += len; + result += len; + } + } + return result; +} + +void DcmZLibOutputFilter::compressInputBuffer(OFBool finalize) +{ + if (inputBufCount_ || finalize) + { + // flush from inputBufStart_ to end of data or end of buffer, whatever comes first + offile_off_t numBytes = (inputBufStart_ + inputBufCount_ > DCMZLIBOUTPUTFILTER_BUFSIZE) ? + (DCMZLIBOUTPUTFILTER_BUFSIZE - inputBufStart_) : inputBufCount_ ; + + offile_off_t written = compress(inputBuf_ + inputBufStart_, numBytes, finalize); + + // adjust counters + inputBufCount_ -= written; + inputBufStart_ += written; + + if (inputBufStart_ == DCMZLIBOUTPUTFILTER_BUFSIZE) + { + // wrapped around + inputBufStart_ = 0; + + // now flush to end of data + if (inputBufCount_ && written) + { + written = compress(inputBuf_, inputBufCount_, finalize); + + // adjust counters + inputBufCount_ -= written; + inputBufStart_ += written; + } + } + + // reset buffer start to make things faster + if (inputBufCount_ == 0) inputBufStart_ = 0; + } +} + +offile_off_t DcmZLibOutputFilter::compress(const void *buf, offile_off_t buflen, OFBool finalize) +{ + offile_off_t result = 0; + if (outputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + zstream_->next_in = OFstatic_cast(Bytef *, OFconst_cast(void *, buf)); + zstream_->avail_in = OFstatic_cast(uInt, buflen); + int zstatus; + + // use first part of output buffer + if (outputBufStart_ + outputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + zstream_->next_out = OFstatic_cast(Bytef *, outputBuf_ + outputBufStart_ + outputBufCount_); + zstream_->avail_out = OFstatic_cast(uInt, DCMZLIBOUTPUTFILTER_BUFSIZE - (outputBufStart_ + outputBufCount_)); + zstatus = deflate(zstream_, (finalize ? Z_FINISH : 0)); + + if (zstatus == Z_OK || zstatus == Z_BUF_ERROR) { /* everything OK */ } + else if (zstatus == Z_STREAM_END) flushed_ = OFTrue; + else + { + OFString etext = "ZLib Error: "; + if (zstream_->msg) etext += zstream_->msg; + status_ = makeOFCondition(OFM_dcmdata, 16, OF_error, etext.c_str()); + } + + outputBufCount_ = DCMZLIBOUTPUTFILTER_BUFSIZE - outputBufStart_ - OFstatic_cast(offile_off_t, zstream_->avail_out); + } + + // use second part of output buffer + if ((outputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) && + outputBufStart_ + outputBufCount_ >= DCMZLIBOUTPUTFILTER_BUFSIZE) + { + zstream_->next_out = OFstatic_cast(Bytef *, outputBuf_ + (outputBufStart_ + outputBufCount_ - DCMZLIBOUTPUTFILTER_BUFSIZE)); + zstream_->avail_out = OFstatic_cast(uInt, DCMZLIBOUTPUTFILTER_BUFSIZE - outputBufCount_); + zstatus = deflate(zstream_, (finalize ? Z_FINISH : 0)); + + if (zstatus == Z_OK || zstatus == Z_BUF_ERROR) { /* everything OK */ } + else if (zstatus == Z_STREAM_END) flushed_ = OFTrue; + else + { + OFString etext = "ZLib Error: "; + if (zstream_->msg) etext += zstream_->msg; + status_ = makeOFCondition(OFM_dcmdata, 16, OF_error, etext.c_str()); + } + + outputBufCount_ = DCMZLIBOUTPUTFILTER_BUFSIZE - OFstatic_cast(offile_off_t, zstream_->avail_out); + } + + result = (buflen - OFstatic_cast(offile_off_t, zstream_->avail_in)); + } + return result; +} + +offile_off_t DcmZLibOutputFilter::write(const void *buf, offile_off_t buflen) +{ + if (status_.bad() || (current_ == NULL)) return 0; + + // flush output buffer if necessary + if (outputBufCount_ == DCMZLIBOUTPUTFILTER_BUFSIZE) flushOutputBuffer(); + + // compress pending input from input buffer + while (status_.good() && inputBufCount_ > 0 && outputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + compressInputBuffer(OFFalse); + if (outputBufCount_ == DCMZLIBOUTPUTFILTER_BUFSIZE) flushOutputBuffer(); + } + + const unsigned char *data = OFstatic_cast(const unsigned char *, buf); + offile_off_t result = 0; + + // compress user data only if input buffer is empty + if (inputBufCount_ == 0) + { + while (status_.good() && (buflen > result) && outputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + result += compress(data+result, buflen-result, OFFalse); + if (outputBufCount_ == DCMZLIBOUTPUTFILTER_BUFSIZE) flushOutputBuffer(); + } + } + + // finally stuff as much into the input buffer as possible + result += fillInputBuffer(data+result, buflen-result); + + // total number of bytes consumed from input + return result; +} + + +void DcmZLibOutputFilter::flush() +{ + if (status_.good() && current_) + { + // flush output buffer first + if (outputBufCount_ == DCMZLIBOUTPUTFILTER_BUFSIZE) flushOutputBuffer(); + + // compress pending input from input buffer + while (status_.good() && inputBufCount_ > 0 && outputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + compressInputBuffer(OFTrue); + if (outputBufCount_ == DCMZLIBOUTPUTFILTER_BUFSIZE) flushOutputBuffer(); + } + + while (status_.good() && (! flushed_) && outputBufCount_ < DCMZLIBOUTPUTFILTER_BUFSIZE) + { + // create output from compression engine until end of compressed stream + compress(NULL, 0, OFTrue); + if (outputBufCount_ == DCMZLIBOUTPUTFILTER_BUFSIZE) flushOutputBuffer(); + } + + // final attempt to flush output buffer + if (outputBufCount_ > 0) flushOutputBuffer(); + } +} + + +void DcmZLibOutputFilter::append(DcmConsumer& consumer) +{ + current_ = &consumer; +} + +#else /* WITH_ZLIB */ + +/* make sure that the object file is not completely empty if compiled + * without zlib because some linkers might fail otherwise. + */ +void dcostrmz_dummy_function() +{ + return; +} + +#endif /* WITH_ZLIB */ diff --git a/dcmdata/libsrc/dcpath.cc b/dcmdata/libsrc/dcpath.cc new file mode 100644 index 00000000..ae8acfc7 --- /dev/null +++ b/dcmdata/libsrc/dcpath.cc @@ -0,0 +1,948 @@ +/* + * + * Copyright (C) 2008-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Class definitions for accessing DICOM dataset structures (items, + * sequences and leaf elements via string-based path access. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcpath.h" +#include "dcmtk/dcmdata/dcsequen.h" + +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +/*******************************************************************/ +/* Implementation of class DcmPath */ +/*******************************************************************/ + +// Constructor +DcmPath::DcmPath() : + m_path() +{ +} + + +// Construct from existing path (kind of copy constructor) +DcmPath::DcmPath(const OFList& currentPath) : + m_path() +{ + OFListConstIterator(DcmPathNode*) it = currentPath.begin(); + OFListConstIterator(DcmPathNode*) endOfPath = currentPath.end(); + while (it != endOfPath) + { + m_path.push_back(new DcmPathNode( (*it)->m_obj, (*it)->m_itemNo )); + it++; + } +} + + +// Append a node to the path +void DcmPath::append(DcmPathNode* node) +{ + if (node != NULL) + m_path.push_back(node); // do any validity checking? +} + + +// Deletes last node from the path and frees corresponding memory +void DcmPath::deleteBackNode() +{ + DcmPathNode* node = m_path.back(); + m_path.pop_back(); + if (node) + { + delete node; node = NULL; + } +} + + +// Returns iterator to first element of the path +OFListIterator(DcmPathNode*) DcmPath::begin() +{ + return m_path.begin(); +} + + +// Returns iterator to last element of the path +DcmPathNode* DcmPath::back() +{ + return m_path.back(); +} + +// Returns iterator to the end of path, i.e. dummy after actual last element +OFListIterator(DcmPathNode*) DcmPath::end() +{ + return m_path.end(); +} + + +// Returns number of path nodes in the path +Uint32 DcmPath::size() const +{ + return OFstatic_cast(Uint32, m_path.size()); +} + + +// Returns true if path is empty, i.e. number of path nodes is zero +OFBool DcmPath::empty() const +{ + return (m_path.size() == 0); +} + + +// Returns string representation of the path +OFString DcmPath::toString() const +{ + OFListConstIterator(DcmPathNode*) it = m_path.begin(); + OFListConstIterator(DcmPathNode*) endOfList = m_path.end(); + OFString pathStr; DcmEVR vr; DcmObject* obj; + char buf[500]; + while (it != endOfList) + { + if ( ((*it) == NULL) || ((*it)->m_obj == NULL) ) + return "Invalid search result"; + obj = (*it)->m_obj; + vr = obj->ident(); + if ((vr == EVR_SQ) || ( obj->isLeaf()) ) + { + pathStr.append( OFconst_cast(DcmTag*, &obj->getTag())->getTagName() ); + it++; + } + else if ( (vr == EVR_item) || (vr == EVR_dataset) ) + { +#ifdef PRIu32 + sprintf(buf, "[%" PRIu32 "]", (*it)->m_itemNo); +#elif SIZEOF_LONG == 8 + sprintf(buf, "[%u]", (*it)->m_itemNo); +#else + sprintf(buf, "[%lu]", (*it)->m_itemNo); +#endif + pathStr.append(buf); + it++; + if (it != endOfList) pathStr.append("."); + } + else + { + pathStr.append(""); + it++; + } + } + return pathStr; +} + + +// Checks whether a specific group number is used in the path's path nodes +OFBool DcmPath::containsGroup(const Uint16 groupNo) const +{ + OFListConstIterator(DcmPathNode*) it = m_path.begin(); + OFListConstIterator(DcmPathNode*) endOfList = m_path.end(); + while (it != endOfList) + { + DcmPathNode* node = *it; + if ( (node == NULL) || (node->m_obj == NULL) ) return OFFalse; + if (node->m_obj->getGTag() == groupNo) return OFTrue; + it++; + } + return OFFalse; +} + + +// Helper function for findOrCreatePath(). Parses item no from start of string +OFCondition DcmPath::parseItemNoFromPath(OFString& path, // inout + Uint32& itemNo, // out + OFBool& wasWildcard) // out +{ + wasWildcard = OFFalse; + itemNo = 0; + // check whether there is an item to parse + size_t closePos = path.find_first_of(']', 0); + if ( (closePos != OFString_npos) && (path[0] == '[') ) + { + long int parsedNo; + // try parsing item number; parsing for %lu would cause overflows in case of negative numbers + int parsed = sscanf(path.c_str(), "[%ld]", &parsedNo); + if (parsed == 1) + { + if (parsedNo < 0) + { + OFString errMsg = "Negative item number (not permitted) at beginning of path: "; errMsg += path; + return makeOFCondition(OFM_dcmdata, 25, OF_error, errMsg.c_str()); + } + itemNo = OFstatic_cast(Uint32, parsedNo); + if (closePos + 1 < path.length()) // if end of path not reached, cut off "." + closePos ++; + path.erase(0, closePos + 1); // remove item from path + return EC_Normal; + } + char aChar; + parsed = sscanf(path.c_str(), "[%c]", &aChar); + if ( (parsed == 1) && (aChar =='*') ) + { + wasWildcard = OFTrue; + if (closePos + 1 < path.length()) // if end of path not reached, cut off "." + closePos ++; + path.erase(0, closePos + 1); // remove item from path + return EC_Normal; + } + } + OFString errMsg = "Unable to parse item number at beginning of path: "; errMsg += path; + return makeOFCondition(OFM_dcmdata, 25, OF_error, errMsg.c_str()); +} + + +// Function that parses a tag from the beginning of a path string. +OFCondition DcmPath::parseTagFromPath(OFString& path, // inout + DcmTag& tag) // out +{ + OFCondition result; + size_t pos = OFString_npos; + + // In case we have a tag "(gggg,xxxx)" + if ( path[0] == '(') + { + pos = path.find_first_of(')', 0); + if (pos != OFString_npos) + result = DcmTag::findTagFromName(path.substr(1, pos - 1).c_str() /* "gggg,eeee" */, tag); + else + { + OFString errMsg("Unable to parse tag at beginning of path: "); errMsg += path; + return makeOFCondition(OFM_dcmdata, 25, OF_error, errMsg.c_str()); + } + pos++; // also cut off closing bracket + } + // otherwise we could have a dictionary name + else + { + // maybe an item follows + pos = path.find_first_of('[', 0); + if (pos == OFString_npos) + result = DcmTag::findTagFromName(path.c_str(), tag); // check full path + else + result = DcmTag::findTagFromName(path.substr(0, pos).c_str(), tag); // parse path up to "[" char + } + // construct error message if necessary and return + if (result.bad()) + { + OFString errMsg("Unable to parse tag/dictionary name at beginning of path: "); errMsg += path; + return makeOFCondition(OFM_dcmdata, 25, OF_error, errMsg.c_str()); + } + // else remove parsed tag from path and return success + else + path.erase(0, pos); + return EC_Normal; +} + + +// Destructor, frees memory of path nodes (but not of underlying DICOM objects) +DcmPath::~DcmPath() +{ + // free dynamically allocated memory + while (m_path.size() != 0) + { + DcmPathNode* node = m_path.front(); + delete node; node = NULL; + m_path.pop_front(); + } +} + + +// Separate a string path into the different nodes +OFCondition DcmPath::separatePathNodes(const OFString& path, + OFList& result) +{ + OFString pathStr(path); + OFCondition status = EC_Normal; + OFBool nextIsItem = OFTrue; + Uint32 itemNo = 0; + OFBool isWildcard = OFFalse; + + // initialize parsing loop + if (!pathStr.empty()) + { + if (pathStr[0] != '[') + nextIsItem = OFFalse; + } + + char buf[100]; + // parse node for node and only stop if error occurs or parsing completes + while ( !pathStr.empty() ) + { + if (nextIsItem) + { + status = parseItemNoFromPath(pathStr, itemNo, isWildcard); + if (status.bad()) return status; + if (isWildcard) + result.push_back("[*]"); + else + { +#ifdef PRIu32 + if (sprintf(buf, "[%" PRIu32 "]", itemNo) < 2) return EC_IllegalParameter; +#elif SIZEOF_LONG == 8 + if (sprintf(buf, "[%u]", itemNo) < 2) return EC_IllegalParameter; +#else + if (sprintf(buf, "[%lu]", itemNo) < 2) return EC_IllegalParameter; +#endif + result.push_back(buf); + } + nextIsItem = OFFalse; + } + else + { + DcmTag tag; + status = parseTagFromPath(pathStr, tag); + if (status.bad()) + return status; + if (sprintf(buf, "(%04X,%04X)", tag.getGroup(), tag.getElement()) != 11) + return EC_IllegalParameter; + result.push_back(buf); + nextIsItem = OFTrue; + } + } + return status; +} + + +/*******************************************************************/ +/* Implementation of class DcmPathProcessor */ +/*******************************************************************/ + + +// Constructor, constructs an empty path processor +DcmPathProcessor::DcmPathProcessor() : + m_currentPath(), + m_results(), + m_createIfNecessary(OFFalse), + m_checkPrivateReservations(OFTrue), + m_itemWildcardsEnabled(OFTrue) +{ +} + + +// enables (class default:enabled) or disables checking of private reservations +void DcmPathProcessor::checkPrivateReservations(const OFBool doChecking) +{ + m_checkPrivateReservations = doChecking; +} + + +// enables (class default:enabled) or disables support for item wildcards +void DcmPathProcessor::setItemWildcardSupport(const OFBool supported) +{ + m_itemWildcardsEnabled = supported; +} + + +// Permits finding and creating DICOM object hierarchies based on a path string +OFCondition DcmPathProcessor::findOrCreatePath(DcmObject* obj, + const OFString& path, + OFBool createIfNecessary) +{ + // check input parameters + if ( (obj == NULL) || path.empty()) + return EC_IllegalParameter; + + if (!m_itemWildcardsEnabled) + { + if (path.find('*') != OFString_npos) + { + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Item wildcard '*' found in path but wildcards disabled"); + } + } + clear(); + m_createIfNecessary = createIfNecessary; + + // do real work in private member functions + OFString pathCopy = path; + if ((obj->ident() == EVR_item) || (obj->ident() == EVR_dataset)) + return findOrCreateItemPath(OFstatic_cast(DcmItem*, obj), pathCopy); + else if (obj->ident() == EVR_SQ) + return findOrCreateSequencePath(OFstatic_cast(DcmSequenceOfItems*, obj), pathCopy); + else + return EC_IllegalParameter; +} + + +// Permits deleting DICOM object hierarchies based on a path string +OFCondition DcmPathProcessor::findOrDeletePath(DcmObject* obj, + const OFString& path, + Uint32& numDeleted) +{ + // check input parameters + if ( (obj == NULL) || path.empty()) + return EC_IllegalParameter; + numDeleted = 0; + if (!m_itemWildcardsEnabled) + { + if (path.find('*') != OFString_npos) + { + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Item wildcard '*' found in path but wildcards disabled"); + } + } + + // search + m_createIfNecessary = OFFalse; + OFString pathCopy = path; + OFCondition result; + clear(); + if ((obj->ident() == EVR_item) || (obj->ident() == EVR_dataset)) + result = findOrCreateItemPath(OFstatic_cast(DcmItem*, obj), pathCopy); + else if (obj->ident() == EVR_SQ) + result = findOrCreateSequencePath(OFstatic_cast(DcmSequenceOfItems*, obj), pathCopy); + else + return EC_IllegalParameter; + if (result.bad()) return result; + + // check results + OFList resultPaths; + Uint32 numPaths = getResults(resultPaths); + if (numPaths == 0) return EC_IllegalCall; // should never happen at this point + OFListIterator(DcmPath*) pathIt = resultPaths.begin(); + OFListIterator(DcmPath*) endIt = resultPaths.end(); + while (pathIt != endIt) + { + // get last item/element from path which should be deleted + DcmPathNode* nodeToDelete = (*pathIt)->back(); + if ( (nodeToDelete == NULL) || (nodeToDelete->m_obj == NULL) ) return EC_IllegalCall; + + // if it's not an item, delete element from item. + // deletes DICOM content of node but not node itself (done later) + if (nodeToDelete->m_obj->ident() != EVR_item) + { + result = deleteLastElemFromPath(obj, *pathIt, nodeToDelete); + } + // otherwise we need to delete an item from a sequence + else + { + result = deleteLastItemFromPath(obj, *pathIt, nodeToDelete); + } + if (result.bad()) return result; + // if success, remove node from path and clear node memory + (*pathIt)->deleteBackNode(); + numDeleted++; + pathIt++; + } + return result; +} + + +// Get results of a an operation started before (e.g. findOrCreatePath()) +Uint32 DcmPathProcessor::getResults(OFList& searchResults) +{ + if (m_results.size() > 0) + { + // explicitly copy (shallow) + OFListIterator(DcmPath*) it = m_results.begin(); + while (it != m_results.end()) + { + searchResults.push_back(*it); + it++; + } + } + return OFstatic_cast(Uint32, m_results.size()); +} + +// applies a string path (optionally with value) to a dataset +OFCondition DcmPathProcessor::applyPathWithValue(DcmDataset* dataset, + const OFString& overrideKey) +{ + if (dataset == NULL) return EC_IllegalCall; + if (overrideKey.empty()) return EC_Normal; + OFString path = overrideKey; + OFString value; + size_t pos = path.find('='); + // separate tag from value if there is one + if (pos != OFString_npos) + { + value = path.substr(pos + 1); // value now contains value + path.erase(pos); // pure path without value + } + clear(); + + // create path + OFCondition result = findOrCreatePath(dataset, path, OFTrue /* create if necessary */); + if (result.bad()) + return result; + + // prepare for value insertion + OFListConstIterator(DcmPath*) it = m_results.begin(); + OFListConstIterator(DcmPath*) endList = m_results.end(); + DcmPathNode* last = (*it)->back(); + if (last == NULL) return EC_IllegalCall; + // if value is specified, be sure path does not end with item + if ( !last->m_obj->isLeaf() ) + { + if (value.empty()) + return EC_Normal; + else + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Cannot insert value into path ending with item or sequence"); + } + // insert value into each element affected by path + while (it != endList) + { + last = (*it)->back(); + if (last == NULL) return EC_IllegalCall; + DcmElement* elem = OFstatic_cast(DcmElement*, last->m_obj); + if (elem == NULL) return EC_IllegalCall; + result = elem->putString(value.c_str()); + if (result.bad()) + break; + it++; + } + return result; +} + + +// Resets status (including results) of DcmPathProcessor and frees corresponding memory +void DcmPathProcessor::clear() +{ + while (m_results.size() != 0) + { + DcmPath* result = m_results.front(); + if (result != NULL) + { + delete result; + result = NULL; + } + m_results.pop_front(); + } + + while (m_currentPath.size() != 0) + { + DcmPathNode* node = m_currentPath.front(); + if (node != NULL) + { + delete node; + node = NULL; + } + m_currentPath.pop_front(); + } + +} + + +// Destructor, frees memory by calling clear() +DcmPathProcessor::~DcmPathProcessor() +{ + clear(); +} + + +/* protected helper functions */ + +// Helper function that deletes last DICOM element from a path from the DICOM hierarchy +OFCondition DcmPathProcessor::deleteLastElemFromPath(DcmObject* objSearchedIn, + DcmPath* path, + DcmPathNode* toDelete) +{ + // item containing the element to delete + DcmItem* containingItem = NULL; + if ( path->size() == 1) + { + // if we have only a single elem in path, given object must be cont. item + if ( (objSearchedIn->ident() != EVR_item) && (objSearchedIn->ident() != EVR_dataset) ) + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Cannot search leaf element in object being not an item"); + containingItem = OFstatic_cast(DcmItem*, objSearchedIn); + } + else + { + // get containing item from path which is the penultimate in the path + OFListIterator(DcmPathNode*) temp = path->end(); + temp--; temp--; + if (*temp == NULL) return EC_IllegalCall; // never happens here... + if ( (*temp)->m_obj == NULL ) return EC_IllegalCall; + if ( (*temp)->m_obj->ident() != EVR_item) // (no test for dataset needed) + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Cannot search leaf element in object being not an item"); + containingItem = OFstatic_cast(DcmItem*, (*temp)->m_obj); + } + if (containingItem == NULL) return EC_IllegalCall; + OFCondition result = containingItem->findAndDeleteElement(toDelete->m_obj->getTag(), OFFalse, OFFalse); + return result; +} + + +// Helper function that deletes last DICOM item from a path from the DICOM hierarchy +OFCondition DcmPathProcessor::deleteLastItemFromPath(DcmObject* objSearchedIn, + DcmPath* path, + DcmPathNode* toDelete) +{ + DcmSequenceOfItems* containingSeq = NULL; + if ( path->size() == 1) + { + // if we have only a single elem in path, given object must be cont. item + if (objSearchedIn->ident() != EVR_SQ) + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Cannot search item in object being not a sequence"); + containingSeq = OFstatic_cast(DcmSequenceOfItems*, objSearchedIn); + } + else + { + // get containing item from path which is the penultimate in the path + OFListIterator(DcmPathNode*) temp = path->end(); + temp--; temp--; + if (*temp == NULL) return EC_IllegalCall; // never happens here... + if ( (*temp)->m_obj == NULL ) return EC_IllegalCall; + if ( (*temp)->m_obj->ident() != EVR_SQ) + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Cannot search item in object being not a sequence"); + containingSeq = OFstatic_cast(DcmSequenceOfItems*, (*temp)->m_obj); + } + if (containingSeq == NULL ) return EC_IllegalCall; + DcmItem* item2BDeleted = containingSeq->remove(OFstatic_cast(DcmItem*, toDelete->m_obj)); + if ( item2BDeleted == NULL ) + return EC_IllegalCall; // should not happen here... + delete item2BDeleted; item2BDeleted = NULL; + return EC_Normal; +} + + +// Helper function that does work for findOrCreatePath() +OFCondition DcmPathProcessor::findOrCreateItemPath(DcmItem* item, + OFString& path) +{ + if (item == NULL) + return EC_IllegalParameter; + + if (path.empty()) + return EC_IllegalParameter; + + OFString restPath(path); + OFCondition status = EC_Normal; + DcmTag tag; + OFString privCreator; + OFBool newlyCreated = OFFalse; // denotes whether an element was created + DcmElement* elem = NULL; + DcmPath* currentResult = NULL; + + // parse tag + status = DcmPath::parseTagFromPath(restPath, tag); + if (status.bad()) + return status; + + // insert element or sequence + if ( !(item->tagExists(tag)) ) // do not to overwrite existing tags + { + if (m_createIfNecessary) + { + // private tags needs special handling, e.g. checking reservation + if (tag.isPrivate() && m_checkPrivateReservations) + { + status = checkPrivateTagReservation(item, tag); + if (status.bad()) return status; + } + elem = DcmItem::newDicomElement(tag); + if (elem == NULL) + return EC_IllegalCall; + status = item->insert(elem, OFTrue); + if (status.bad()) + { + delete elem; elem = NULL; + return status; + } + newlyCreated = OFTrue; + } + else + return EC_TagNotFound; + } + + // get element + status = item->findAndGetElement(tag, elem); + if (status.bad()) + return EC_CorruptedData; // should not happen + + // start recursion if element was a sequence + if (tag.getEVR() == EVR_SQ) + { + DcmSequenceOfItems* seq = NULL; + seq = OFstatic_cast(DcmSequenceOfItems*, elem); + if (!seq) + status = EC_IllegalCall; // should not happen + else + { + // if sequence could be inserted and there is nothing more to do: add current path to results and return success + if (restPath.empty()) + { + currentResult = new DcmPath(m_currentPath); + currentResult->append(new DcmPathNode(elem,0)); + m_results.push_back(currentResult); + return EC_Normal; + } + // start recursion if there is path left + DcmPathNode* node = new DcmPathNode(seq, 0); + m_currentPath.push_back(node); + status = findOrCreateSequencePath(seq, restPath); + m_currentPath.pop_back(); // avoid side effects + delete node; + } + } + else if (restPath.empty()) // we inserted a leaf element: path must be completed + { + // add element and add current path to overall results; then return success + currentResult = new DcmPath(m_currentPath); + currentResult->append(new DcmPathNode(elem, 0)); + m_results.push_back(currentResult); + return EC_Normal; + } + else // we inserted a leaf element but there is path left -> error + status = makeOFCondition(OFM_dcmdata, 25, OF_error, "Invalid Path: Non-sequence tag found with rest path following"); + + // in case of errors: delete result path copy and delete DICOM element if it was newly created + if ( status.bad() && (elem != NULL) ) + { + m_results.remove(currentResult); // remove from search result + if (currentResult) + { + delete currentResult; + currentResult = NULL; + } + if (newlyCreated) // only delete from this dataset and memory if newly created ("undo") + { + if (item->findAndDeleteElement(tag).bad()) + delete elem; // delete manually if not found in dataset + } + elem = NULL; + } + return status; +} + + +// Helper function that does work for findOrCreatePath() +OFCondition DcmPathProcessor::findOrCreateSequencePath(DcmSequenceOfItems* seq, + OFString& path) +{ + if (seq == NULL) + return EC_IllegalParameter; + + // prepare variables + OFString restPath(path); + OFCondition status = EC_Normal; + DcmItem* resultItem = NULL; + Uint32 itemNo = 0; + Uint32 newlyCreated = 0; // number of items created (appended) (only non-wildcard mode) + Uint32 newPathsCreated = 0; // wildcard mode: number of paths found + + // parse item number + OFBool isWildcard = OFFalse; + status = DcmPath::parseItemNoFromPath(restPath, itemNo, isWildcard); + if (status.bad()) + return status; + + // wildcard code: add result path for every matching item + if (isWildcard) + { + // if there are no items -> no results are found + Uint32 numItems = OFstatic_cast(Uint32, seq->card()); + if (numItems == 0) + { + if (!m_createIfNecessary) + return EC_TagNotFound; + else + return makeOFCondition(OFM_dcmdata, 25, OF_error, "Cannot insert unspecified number (wildcard) of items into sequence"); + } + + // copy every item to result + for (itemNo = 0; itemNo < numItems; itemNo++) + { + DcmItem* oneItem = seq->getItem(itemNo); + /* if we found an item that matches, copy current result path, then + add the item found and finally start recursive search for + that item. + */ + if (oneItem != NULL) + { + // if the item was the last thing to parse, add list to results and return + if (restPath.empty()) + { + DcmPathNode* itemNode = new DcmPathNode(oneItem, itemNo); + DcmPath* currentResult = new DcmPath(m_currentPath); + currentResult->append(itemNode); + m_results.push_back(currentResult); + newPathsCreated++; + } + // else there is path left: continue searching in the new item + else + { + DcmPathNode* itemNode = new DcmPathNode(oneItem, itemNo); + m_currentPath.push_back(itemNode); + status = findOrCreateItemPath(oneItem, restPath); + m_currentPath.pop_back(); // avoid side effects + delete itemNode; itemNode = NULL; + if (status.bad()) // we did not find the path in that item + { + if (status != EC_TagNotFound) + return status; + } + else + { + newPathsCreated++; + } + } + } + else // should be possible to get every item, however... + return EC_IllegalCall; + } + // if there was at least one result, success can be returned + if (newPathsCreated != 0) + { + return EC_Normal; + } + else + return EC_TagNotFound; + } + + + /* no wildcard, just select single item or create it if necessary */ + + // if item already exists, just grab a reference + if (itemNo < seq->card()) + resultItem = seq->getItem(itemNo); + // if item does not exist, create new if desired + else if (m_createIfNecessary) + { + // create and insert items until desired item count is reached + while ( (seq->card() <= itemNo) || (status.bad()) ) + { + resultItem = new DcmItem(); + if (!resultItem) return EC_MemoryExhausted; + status = seq->insert(resultItem); + if (status.bad()) + delete resultItem; + else + newlyCreated++; + } + } + // item does not exist and should not be created newly, return "path not found" + else + return EC_TagNotFound; + + // at this point, the item has been obtained and everything is fine so far + + // finding/creating the path was successful. now check whether there is more to do + if (!restPath.empty()) + { + // push new item to result path and continue + DcmPathNode* itemNode = new DcmPathNode(resultItem, itemNo); + m_currentPath.push_back(itemNode); + status = findOrCreateItemPath(resultItem, restPath); + m_currentPath.pop_back(); // avoid side effects to input parameter + delete itemNode; itemNode = NULL; + // in case of no success, delete any items that were newly created and return error + if (status.bad()) + { + for (Uint32 i=newlyCreated; i > 0; i--) + { + DcmItem* todelete = seq->remove(i - 1); + if (todelete != NULL) + { + delete todelete; + todelete = NULL; + } + } + return status; + } + } + else // finally everything was successful + { + DcmPathNode* itemNode = new DcmPathNode(resultItem, itemNo); + m_currentPath.push_back(itemNode); + m_results.push_back(new DcmPath(m_currentPath)); + m_currentPath.pop_back(); // avoid side effects + delete itemNode; itemNode = NULL; + status = EC_Normal; + } + return status; +} + + +DcmTagKey DcmPathProcessor::calcPrivateReservationTag(const DcmTagKey &privateKey) +{ + DcmTagKey reservationTag(0xFFFF, 0xFFFF); + // if not a private key is given return "error" + if (!privateKey.isPrivate()) + return reservationTag; + // if the private key given is already a reservation key, return it + if (privateKey.isPrivateReservation()) + return privateKey; + + // Calculate corresponding private creator element + Uint16 elemNo = privateKey.getElement(); + // Get yz from given element number wxyz, groups stays the same + elemNo = OFstatic_cast(Uint16, elemNo >> 8); + reservationTag.setGroup(privateKey.getGroup()); + reservationTag.setElement(elemNo); + return reservationTag; +} + + +OFCondition DcmPathProcessor::checkPrivateTagReservation(DcmItem* item, + const DcmTagKey& tagKey, + const OFString& privateCreator) +{ + // if this is already a private reservation, there is nothing to do + if (!tagKey.isPrivateReservation()) + { + DcmTagKey reservationKey = calcPrivateReservationTag(tagKey); + if (reservationKey == DCM_UndefinedTagKey) + { + OFString msg("Unable to compute private reservation for tag: "); msg += tagKey.toString(); + return makeOFCondition(OFM_dcmdata, 25, OF_error, msg.c_str()); + } + if (!item->tagExists(reservationKey)) + { + OFString msg("Private reservation missing for tag: "); msg += tagKey.toString(); + return makeOFCondition(OFM_dcmdata, 25, OF_error, msg.c_str()); + } + else + { + // set private creator for new element + OFString actualPrivateCreator; + if (item->findAndGetOFString(reservationKey, actualPrivateCreator).bad() || (actualPrivateCreator.empty())) + { + OFString msg = "Invalid or empty private creator tag: "; msg += reservationKey.toString(); + return makeOFCondition(OFM_dcmdata, 25, OF_error, msg.c_str()); + } + else if (!privateCreator.empty()) + { + // check whether private creator is correct + if (actualPrivateCreator != privateCreator) + { + OFString msg = "Private creator string ("; msg += actualPrivateCreator; msg += ") other than expected ( "; msg += privateCreator; msg += privateCreator; + return makeOFCondition(OFM_dcmdata, 25, OF_error, msg.c_str()); + } + } + } + } + return EC_Normal; +} + + + +OFCondition DcmPathProcessor::checkPrivateTagReservation(DcmItem* item /* in */, + DcmTag& tag /* inout */, + const OFString& privateCreator) +{ + OFCondition result = checkPrivateTagReservation(item, tag.getXTag(), privateCreator); + if (result.good()) + { + // tell tag its private creator and VR + tag.setPrivateCreator(privateCreator.c_str()); + tag.lookupVRinDictionary(); // not done automatically when saving + } + return result; +} + diff --git a/dcmdata/libsrc/dcpcache.cc b/dcmdata/libsrc/dcpcache.cc new file mode 100644 index 00000000..918bf56b --- /dev/null +++ b/dcmdata/libsrc/dcpcache.cc @@ -0,0 +1,106 @@ +/* + * + * Copyright (C) 2002-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: ofstd + * + * Author: Marco Eichelberg + * + * Purpose: general purpose 32-bit CRC in C++ + * Code is based on the CRC32 implementation (C)1986 Gary S. Brown + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcpcache.h" +#include "dcmtk/dcmdata/dcelem.h" /* for DcmElement, DcmObject */ + +DcmPrivateTagCacheEntry::DcmPrivateTagCacheEntry(const DcmTagKey& tk, const char *pc) +: tagKey(tk) +, privateCreator(pc) +{ +} + + +DcmPrivateTagCacheEntry::~DcmPrivateTagCacheEntry() +{ +} + + +const char *DcmPrivateTagCacheEntry::getPrivateCreator() const +{ + return privateCreator.c_str(); +} + + +OFBool DcmPrivateTagCacheEntry::isPrivateCreatorFor(const DcmTagKey& tk) const +{ + return (tagKey.getGroup() == tk.getGroup()) && + ((tagKey.getElement() << 8) == (tk.getElement() & 0xff00)); +} + +/* ======================================================================= */ + +DcmPrivateTagCache::DcmPrivateTagCache() +: list_() +{ +} + + +DcmPrivateTagCache::~DcmPrivateTagCache() +{ + clear(); +} + + +void DcmPrivateTagCache::clear() +{ + OFListIterator(DcmPrivateTagCacheEntry *) first = list_.begin(); + OFListIterator(DcmPrivateTagCacheEntry *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + + +const char *DcmPrivateTagCache::findPrivateCreator(const DcmTagKey& tk) const +{ + OFListConstIterator(DcmPrivateTagCacheEntry *) first = list_.begin(); + OFListConstIterator(DcmPrivateTagCacheEntry *) last = list_.end(); + while (first != last) + { + if ((*first)->isPrivateCreatorFor(tk)) return (*first)->getPrivateCreator(); + ++first; + } + return NULL; +} + + +void DcmPrivateTagCache::updateCache(DcmObject *dobj) +{ + if (dobj) + { + const DcmTag& tag = dobj->getTag(); + if (dobj->isLeaf() && (tag.getGTag() & 1) && (tag.getETag() <= 0xff) && (tag.getETag() >= 0x10)) + { + // dobj is DcmElement containing private creator + char *c = NULL; + if ((OFstatic_cast(DcmElement *, dobj)->getString(c)).good() && c) + { + list_.push_back(new DcmPrivateTagCacheEntry(tag, c)); + } + } + } +} diff --git a/dcmdata/libsrc/dcpixel.cc b/dcmdata/libsrc/dcpixel.cc new file mode 100644 index 00000000..7c402499 --- /dev/null +++ b/dcmdata/libsrc/dcpixel.cc @@ -0,0 +1,1272 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: class DcmPixelData + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcpixel.h" +#include "dcmtk/dcmdata/dccodec.h" +#include "dcmtk/dcmdata/dcpixseq.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcpxitem.h" + +// +// class DcmRepresentationEntry +// + +DcmRepresentationEntry::DcmRepresentationEntry( + const E_TransferSyntax rt, + const DcmRepresentationParameter *rp, + DcmPixelSequence * ps) + : repType(rt), + repParam(NULL), + pixSeq(ps) +{ + if (rp) + repParam = rp->clone(); +} + +DcmRepresentationEntry::DcmRepresentationEntry( + const DcmRepresentationEntry & oldEntry) + : repType(oldEntry.repType), + repParam(NULL), + pixSeq(NULL) +{ + if (oldEntry.repParam) + repParam = oldEntry.repParam->clone(); + pixSeq = new DcmPixelSequence(*(oldEntry.pixSeq)); +} + +DcmRepresentationEntry::~DcmRepresentationEntry() +{ + delete repParam; + delete pixSeq; +} + +OFBool +DcmRepresentationEntry::operator==(const DcmRepresentationEntry & x) const +{ + return (repType == x.repType) && + ((x.repParam == NULL && repParam == NULL) || + ((x.repParam != NULL) && (repParam != NULL) && (*(x.repParam) == *repParam))); +} + +// +// class DcmPixelData +// + +// Constructors / Deconstructors + +DcmPixelData::DcmPixelData( + const DcmTag & tag, + const Uint32 len) + : DcmPolymorphOBOW(tag, len), + repList(), + repListEnd(), + original(), + current(), + existUnencapsulated(OFFalse), + alwaysUnencapsulated(OFFalse), + unencapsulatedVR(EVR_UNKNOWN), + pixelSeqForWrite(NULL) +{ + repListEnd = repList.end(); + current = original = repListEnd; + if (getTag().getEVR() == EVR_ox) setTagVR(EVR_OW); + unencapsulatedVR = getTag().getEVR(); + recalcVR(); +} + +DcmPixelData::DcmPixelData( + const DcmPixelData & oldPixelData) + : DcmPolymorphOBOW(oldPixelData), + repList(), + repListEnd(), + original(), + current(), + existUnencapsulated(oldPixelData.existUnencapsulated), + alwaysUnencapsulated(oldPixelData.alwaysUnencapsulated), + unencapsulatedVR(oldPixelData.unencapsulatedVR), + pixelSeqForWrite(NULL) +{ + repListEnd = repList.end(); + original = repListEnd; + current = original; + recalcVR(); + DcmRepresentationListConstIterator oldEnd(oldPixelData.repList.end()); + for (DcmRepresentationListConstIterator it(oldPixelData.repList.begin()); + it != oldEnd; + ++it) + { + DcmRepresentationEntry * repEnt = new DcmRepresentationEntry(**it); + repList.push_back(repEnt); + if (it == oldPixelData.original) + original = --repList.end(); + + if (it == oldPixelData.current) + { + current = --repList.end(); + recalcVR(); + } + } +} + + +DcmPixelData::~DcmPixelData() +{ + for (DcmRepresentationListIterator it(repList.begin()); + it != repListEnd; + ++it) + { + delete *it; + *it = NULL; + } +} + +DcmPixelData &DcmPixelData::operator=(const DcmPixelData &obj) +{ + if (this != &obj) + { + DcmPolymorphOBOW::operator=(obj); + existUnencapsulated = obj.existUnencapsulated; + alwaysUnencapsulated = obj.alwaysUnencapsulated; + unencapsulatedVR = obj.unencapsulatedVR; + pixelSeqForWrite = NULL; + repList.clear(); + repListEnd = repList.end(); + original = repListEnd; + current = original; + recalcVR(); + DcmRepresentationListConstIterator oldEnd(obj.repList.end()); + DcmRepresentationListConstIterator it(obj.repList.begin()); + while (it != oldEnd) + { + DcmRepresentationEntry *repEnt = new DcmRepresentationEntry(**it); + repList.push_back(repEnt); + if (it == obj.original) original = --repList.end(); + if (it == current) + { + current = --repList.end(); + recalcVR(); + } + ++it; + } + + } + return *this; +} + +// methods in alphabetical order + +Uint32 +DcmPixelData::calcElementLength( + const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + DcmXfer xferSyn(xfer); + errorFlag = EC_Normal; + Uint32 elementLength = 0; + + if (xferSyn.isEncapsulated() && (! writeUnencapsulated(xfer))) + { + DcmRepresentationListIterator found; + errorFlag = findConformingEncapsulatedRepresentation(xfer, NULL, found); + if (errorFlag == EC_Normal) + elementLength = (*found)->pixSeq->calcElementLength(xfer, enctype); + } + else if (existUnencapsulated) + elementLength = DcmPolymorphOBOW::calcElementLength(xfer, enctype); + else + errorFlag = EC_RepresentationNotFound; + + return elementLength; +} + + +OFBool +DcmPixelData::canChooseRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam) +{ + OFBool result = OFFalse; + DcmXfer toType(repType); + + const DcmRepresentationEntry findEntry(repType, repParam, NULL); + DcmRepresentationListIterator resultIt(repListEnd); + // find out whether we have the desired target representation available. Three possibilities: + // 1. we have uncompressed data, and target is uncompressed (conversion between uncompressed always possible) + // 2. we have uncompressed and want compressed, but we are forced to write uncompressed anyway + // 3. we want to go to compressed, and already have the desired representation available + if ((!toType.isEncapsulated() && existUnencapsulated) || + (toType.isEncapsulated() && writeUnencapsulated(repType) && existUnencapsulated) || + (toType.isEncapsulated() && findRepresentationEntry(findEntry, resultIt) == EC_Normal)) + { + // representation found + result = OFTrue; + } + // otherwise let's see whether we know how to convert to the target representation + else + { + // representation not found, check if we have a codec that can create the + // desired representation. + if (original == repListEnd) + { + // we have uncompressed data, check whether we know how to go from uncompressed to desired compression + result = DcmCodecList::canChangeCoding(EXS_LittleEndianExplicit, toType.getXfer()); + } + else if (toType.isEncapsulated()) + { + // we have already compressed data, check whether we know how to transcode + result = DcmCodecList::canChangeCoding((*original)->repType, toType.getXfer()); + if (!result) + { + // direct transcoding is not possible. Check if we can decode and then encode. + result = canChooseRepresentation(EXS_LittleEndianExplicit, NULL); + if (result) result = DcmCodecList::canChangeCoding(EXS_LittleEndianExplicit, toType.getXfer()); + } + } + else + { + // target transfer syntax is uncompressed, look whether decompression is possible + result = DcmCodecList::canChangeCoding((*original)->repType, EXS_LittleEndianExplicit); + } + } + return result; +} + +OFBool +DcmPixelData::canWriteXfer( + const E_TransferSyntax newXfer, + const E_TransferSyntax /*oldXfer*/) +{ + DcmXfer newXferSyn(newXfer); + DcmRepresentationListIterator found; + OFBool result = existUnencapsulated && (!newXferSyn.isEncapsulated() || writeUnencapsulated(newXfer)); + + if (!result && newXferSyn.isEncapsulated()) + result = (findConformingEncapsulatedRepresentation(newXferSyn, NULL, found) == EC_Normal); + return result; +} + +OFCondition +DcmPixelData::chooseRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam, + DcmStack & pixelStack) +{ + OFCondition l_error = EC_CannotChangeRepresentation; + DcmXfer toType(repType); + + const DcmRepresentationEntry findEntry(repType, repParam, NULL); + DcmRepresentationListIterator result(repListEnd); + if ((!toType.isEncapsulated() && existUnencapsulated) || + (toType.isEncapsulated() && findRepresentationEntry(findEntry, result) == EC_Normal)) + { + // representation found + current = result; + recalcVR(); + l_error = EC_Normal; + } + else + { + if (original == repListEnd) + l_error = encode(EXS_LittleEndianExplicit, NULL, NULL, + toType, repParam, pixelStack); + else if (toType.isEncapsulated()) + l_error = encode((*original)->repType, (*original)->repParam, + (*original)->pixSeq, toType, repParam, pixelStack); + else + l_error = decode((*original)->repType, (*original)->repParam, + (*original)->pixSeq, pixelStack); + } + if (l_error.bad() && toType.isEncapsulated() && existUnencapsulated && writeUnencapsulated(repType)) + // Encoding failed so this will be written out unencapsulated + l_error = EC_Normal; + return l_error; +} + + +int DcmPixelData::compare(const DcmElement& rhs) const +{ + // check tag and VR + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + // cast away constness (dcmdata is not const correct...) + DcmPixelData* myThis = NULL; + DcmPixelData* myRhs = NULL; + myThis = OFconst_cast(DcmPixelData*, this); + myRhs = OFstatic_cast(DcmPixelData*, OFconst_cast(DcmElement*, &rhs)); + + if (myThis->existUnencapsulated && myRhs->existUnencapsulated) + { + // we have uncompressed representations, which can be compared using DcmPolymorphOBOW::compare + return DcmPolymorphOBOW::compare(rhs); + } + + // both do not have uncompressed data, we must compare compressed ones. + // check both have a current representation at all. + if ((myThis->current == myThis->repList.end()) && (myRhs->current != myRhs->repList.end())) return -1; + if ((myThis->current != myThis->repList.end()) && (myRhs->current == myRhs->repList.end())) return 1; + if ((myThis->current == myThis->repList.end()) && (myRhs->current == myRhs->repList.end())) + { + // if one of both have uncompressed data at least, that one is considered "bigger" + if (myThis->existUnencapsulated) return 1; + if (myRhs->existUnencapsulated) return -1; + else return 0; + } + + // both have compressed data: compare current representation (only) + if ((myThis->current != myThis->repList.end()) && (myRhs->current != myRhs->repList.end()) ) + { + E_TransferSyntax myRep = (*(myThis->current))->repType; + E_TransferSyntax rhsRep = (*(myRhs->current))->repType; + DcmXfer myXfer(myRep); + DcmXfer rhsXfer(rhsRep); + // if both transfer syntaxes are different, we have to perform more checks to + // find out whether the related pixel data is comparable; this is the case + // for all uncompressed transfer syntaxes, except Big Endian with OW data + // since it uses a different memory layout, and we do not want to byte-swap + // the values for the comparison. + if (myRep != rhsRep) + { + return 1; + } + else + { + // For compressed, compare pixel items bytewise + DcmPixelSequence* myPix = (*(myThis->current))->pixSeq; + DcmPixelSequence* rhsPix = (*(myRhs->current))->pixSeq; + if (!myPix && rhsPix) return -1; + if (myPix && !rhsPix) return 1; + if (!myPix && !rhsPix) return 0; + // Check number of pixel items + long unsigned int myNumPix = myPix->card(); + long unsigned int rhsNumPix = rhsPix->card(); + if (myNumPix < rhsNumPix) return -1; + if (myNumPix > rhsNumPix) return 1; + // loop over pixel items, both have the same number of pixel items + for (unsigned long n = 0; n < myNumPix; n++) + { + DcmPixelItem* myPixItem = NULL; + DcmPixelItem* rhsPixItem = NULL; + if (myPix->getItem(myPixItem, n).good() && rhsPix->getItem(rhsPixItem, n).good()) + { + // compare them value by value, using DcmOtherByteOtherWord::compare() method + result = myPixItem->compare(*rhsPixItem); + if (result != 0) + { + return result; + } + } + else + { + DCMDATA_ERROR("Internal error: Could not get pixel item #" << n << " from Pixel Sequence"); + return 1; + } + } + return 0; + } + } + // if one of both have a current representation; consider that one "bigger". + // if none has a current one, consider both equal (neither uncompressed or compressed data present). + else + { + if (myThis->current != myThis->repList.end()) return 1; + if (myRhs->current != myRhs->repList.end()) return -1; + else return 0; + } +} + +OFCondition DcmPixelData::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmPixelData &, rhs); + } + return EC_Normal; +} + +void DcmPixelData::clearRepresentationList( + DcmRepresentationListIterator leaveInList) +{ + /* define iterators to go through all representations in the list */ + DcmRepresentationListIterator it(repList.begin()); + DcmRepresentationListIterator del; + + /* as long as we have not encountered the end of the */ + /* representation list, go through all representations */ + while (it != repListEnd) + { + /* if this representation shall not be left in the list */ + if (it != leaveInList) + { + /* delete representation and move it to the next representation */ + delete *it; + del = it++; + repList.erase(del); + } + /* else leave this representation in the list and just go to the next */ + else + ++it; + } +} + +OFCondition +DcmPixelData::decode( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + DcmStack & pixelStack) +{ + if (existUnencapsulated) return EC_Normal; + OFCondition l_error = DcmCodecList::decode(fromType, fromParam, fromPixSeq, *this, pixelStack); + if (l_error.good()) + { + existUnencapsulated = OFTrue; + current = repListEnd; + setVR(EVR_OW); + recalcVR(); + } + else + { + DcmPolymorphOBOW::putUint16Array(NULL,0); + existUnencapsulated = OFFalse; + } + return l_error; +} + + + +OFCondition +DcmPixelData::encode( + const DcmXfer & fromType, + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmXfer & toType, + const DcmRepresentationParameter *toParam, + DcmStack & pixelStack) +{ + OFCondition l_error = EC_CannotChangeRepresentation; + if (toType.isEncapsulated()) + { + DcmPixelSequence * toPixSeq = NULL; + if (fromType.isEncapsulated()) + { + l_error = DcmCodecList::encode(fromType.getXfer(), fromParam, fromPixSeq, + toType.getXfer(), toParam, toPixSeq, pixelStack); + } + else + { + Uint16 * pixelData; + l_error = DcmPolymorphOBOW::getUint16Array(pixelData); + Uint32 length = DcmPolymorphOBOW::getLength(); + if (l_error == EC_Normal) + { + l_error = DcmCodecList::encode(fromType.getXfer(), pixelData, length, + toType.getXfer(), toParam, toPixSeq, pixelStack); + } + } + + if (l_error.good()) + { + current = insertRepresentationEntry( + new DcmRepresentationEntry(toType.getXfer(), toParam, toPixSeq)); + recalcVR(); + } else delete toPixSeq; + + // if it was possible to convert one encapsulated syntax into + // another directly try it using decoding and encoding! + if (l_error.bad() && fromType.isEncapsulated()) + { + l_error = decode(fromType, fromParam, fromPixSeq, pixelStack); + if (l_error.good()) l_error = encode(EXS_LittleEndianExplicit, NULL, NULL, toType, toParam, pixelStack); + } + } + return l_error; +} + +OFCondition +DcmPixelData::findRepresentationEntry( + const DcmRepresentationEntry & findEntry, + DcmRepresentationListIterator & result) +{ + result = repList.begin(); + while(result != repListEnd && + (*result)->repType < findEntry.repType) + ++result; + + DcmRepresentationListIterator it(result); + + while(it != repListEnd && **it != findEntry) + ++it; + if (it == repListEnd || **it != findEntry) + return EC_RepresentationNotFound; + else + { + result = it; + return EC_Normal; + } +} + + +OFCondition +DcmPixelData::findConformingEncapsulatedRepresentation( + const DcmXfer & repTypeSyn, + const DcmRepresentationParameter * repParam, + DcmRepresentationListIterator & result) +{ + E_TransferSyntax repType = repTypeSyn.getXfer(); + result = repListEnd; + OFCondition l_error = EC_RepresentationNotFound; + // we are looking for an encapsulated representation + // of this pixel data element which meets both + // the transfer syntax and (if given) the representation + // parameter (i.e. quality factor for lossy JPEG). + if (repTypeSyn.isEncapsulated()) + { + // first we check the current (active) representation if any. + if ((current != repListEnd) && ((*current)->repType == repType) && + ((repParam==NULL) || (((*current)->repParam != NULL)&&(*(*current)->repParam == *repParam)))) + { + result = current; + l_error = EC_Normal; + } + else + { + // now we check all representations + DcmRepresentationListIterator it(repList.begin()); + OFBool found = OFFalse; + while (!found && (it != repListEnd)) + { + if ((*it)->repType == repType) + { + if ((repParam == NULL) || (((*it)->repParam != NULL)&&(*(*it)->repParam == *repParam))) + { + // repParam is NULL or matches the one we are comparing with + found = OFTrue; + result = it; + l_error = EC_Normal; + } else ++it; + } else ++it; + } + } + } + return l_error; +} + + +OFCondition +DcmPixelData::getEncapsulatedRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam, + DcmPixelSequence * & pixSeq) +{ + DcmRepresentationListIterator found; + DcmRepresentationEntry findEntry(repType, repParam, NULL); + if (findRepresentationEntry(findEntry, found) == EC_Normal) + { + pixSeq = (*found)->pixSeq; + return EC_Normal; + } + + return EC_RepresentationNotFound; +} + + +OFBool +DcmPixelData::hasRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam) +{ + DcmXfer repTypeSyn(repType); + DcmRepresentationListIterator found; + if (!repTypeSyn.isEncapsulated() && existUnencapsulated) + return OFTrue; + else if (repTypeSyn.isEncapsulated()) + return findConformingEncapsulatedRepresentation(repTypeSyn, repParam, found).good(); + return OFFalse; +} + + +Uint32 +DcmPixelData::getLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + DcmXfer xferSyn(xfer); + errorFlag = EC_Normal; + Uint32 valueLength = 0; + + if (xferSyn.isEncapsulated() && !writeUnencapsulated(xfer)) + { + DcmRepresentationListIterator foundEntry; + errorFlag = findConformingEncapsulatedRepresentation( + xferSyn, NULL, foundEntry); + if (errorFlag == EC_Normal) + valueLength = (*foundEntry)->pixSeq->getLength(xfer, enctype); + } + else if (existUnencapsulated) + valueLength = DcmPolymorphOBOW::getLength(xfer, enctype); + else + errorFlag = EC_RepresentationNotFound; + + return valueLength; +} + + +void +DcmPixelData::getCurrentRepresentationKey( + E_TransferSyntax & repType, + const DcmRepresentationParameter * & repParam) +{ + if (current != repListEnd) + { + repType = (*current)->repType; + repParam = (*current)->repParam; + } + else + { + repType = EXS_LittleEndianExplicit; + repParam = NULL; + } +} + +void +DcmPixelData::getOriginalRepresentationKey( + E_TransferSyntax & repType, + const DcmRepresentationParameter * & repParam) +{ + if (original != repListEnd) + { + repType = (*original)->repType; + repParam = (*original)->repParam; + } + else + { + repType = EXS_LittleEndianExplicit; + repParam = NULL; + } +} + +DcmRepresentationListIterator +DcmPixelData::insertRepresentationEntry( + DcmRepresentationEntry * repEntry) +{ + DcmRepresentationListIterator insertedEntry; + DcmRepresentationListIterator result; + if (findRepresentationEntry(*repEntry, result).good()) + { + // this type of representation entry was already present in the list + if (repEntry != *result) + { + insertedEntry = repList.insert(result, repEntry); + + // delete old entry from representation list + delete *result; + repList.erase(result); + } + } + else + insertedEntry = repList.insert(result,repEntry); + return insertedEntry; +} + +void +DcmPixelData::print( + STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + if (current == repListEnd) + printPixel(out, flags, level, pixelFileName, pixelCounter); + else + (*current)->pixSeq->print(out, flags, level, pixelFileName, pixelCounter); +} + +OFCondition +DcmPixelData::putUint8Array( + const Uint8 * byteValue, + const unsigned long length) +{ + // clear RepresentationList + clearRepresentationList(repListEnd); + OFCondition l_error = DcmPolymorphOBOW::putUint8Array(byteValue, length); + original = current = repListEnd; + recalcVR(); + existUnencapsulated = OFTrue; + return l_error; +} + +OFCondition +DcmPixelData::putUint16Array( + const Uint16 * wordValue, + const unsigned long length) +{ + // clear RepresentationList + clearRepresentationList(repListEnd); + OFCondition l_error = DcmPolymorphOBOW::putUint16Array(wordValue, length); + original = current = repListEnd; + recalcVR(); + existUnencapsulated = OFTrue; + return l_error; +} + +OFCondition +DcmPixelData::createUint8Array( + const Uint32 numBytes, + Uint8 * & bytes) +{ + OFCondition l_error = DcmPolymorphOBOW::createUint8Array(numBytes, bytes); + existUnencapsulated = OFTrue; + return l_error; +} + +OFCondition +DcmPixelData::createUint16Array( + const Uint32 numWords, + Uint16 * & words) +{ + OFCondition l_error = DcmPolymorphOBOW::createUint16Array(numWords, words); + existUnencapsulated = OFTrue; + return l_error; +} + +OFCondition +DcmPixelData::createValueFromTempFile( + DcmInputStreamFactory *factory, + const Uint32 length, + const E_ByteOrder byteOrder) +{ + OFCondition l_error = DcmPolymorphOBOW::createValueFromTempFile(factory, length, byteOrder); + existUnencapsulated = OFTrue; + return l_error; +} + +void +DcmPixelData::putOriginalRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam, + DcmPixelSequence * pixSeq) +{ + // delete RepresentationList + clearRepresentationList(repListEnd); + // delete unencapsulated representation + DcmPolymorphOBOW::putUint16Array(NULL,0); + existUnencapsulated = OFFalse; + // insert new Representation + current = original = insertRepresentationEntry( + new DcmRepresentationEntry(repType, repParam, pixSeq)); + recalcVR(); +} + +OFCondition +DcmPixelData::read( + DcmInputStream & inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + /* if this element's transfer state shows ERW_notInitialized, this is an illegal call */ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* if this is not an illegal call, go ahead */ + + /* if the transfer state is ERW_init, we need to prepare the reading of the pixel */ + /* data from the stream: remove all representations from the representation list. */ + if (getTransferState() == ERW_init) + clearRepresentationList(repListEnd); + + /* create a DcmXfer object based on the transfer syntax which was passed */ + DcmXfer ixferSyn(ixfer); + + /* determine if the pixel data is captured in native (uncompressed) or encapsulated + * (compressed) format. We only derive this information from the length field + * which is set to undefined length for encapsulated data because even in + * compressed transfer syntaxes the Icon Image Sequence may contain an + * uncompressed image. + */ + if (getLengthField() == DCM_UndefinedLength) + { + /* the pixel data is captured in encapsulated (compressed) format */ + + /* if the transfer state is ERW_init, we need to prepare */ + /* the reading of the pixel data from the stream. */ + if (getTransferState() == ERW_init) + { + current = insertRepresentationEntry( + new DcmRepresentationEntry( + ixfer, NULL, new DcmPixelSequence(getTag(), getLengthField()))); + recalcVR(); + original = current; + existUnencapsulated = OFFalse; + setTransferState(ERW_inWork); + + if (! ixferSyn.isEncapsulated()) + { + /* Special case: we have encountered a compressed image + * although we're decoding an uncompressed transfer syntax. + * This could be a compressed image stored without meta-header. + * For now, we just accept the data element; however, any attempt + * to write the dataset will fail because no suitable decoder + * is known. + */ + } + } + + /* conduct the reading process */ + errorFlag = + (*current)->pixSeq->read(inStream, ixfer, glenc, maxReadLength); + + /* if the errorFlag equals EC_Normal, all pixel data has been */ + /* read; hence, the transfer state has to be set to ERW_ready */ + if (errorFlag == EC_Normal) + setTransferState(ERW_ready); + } + else + { + /* the pixel data is captured in native (uncompressed) format */ + + /* if the transfer state is ERW_init, we need to prepare */ + /* the reading of the pixel data from the stream. */ + if (getTransferState() == ERW_init) + { + current = original = repListEnd; + unencapsulatedVR = getTag().getEVR(); + recalcVR(); + existUnencapsulated = OFTrue; + + if (ixferSyn.isEncapsulated()) + { + /* Special case: we have encountered an uncompressed image + * although we're decoding an encapsulated transfer syntax. + * This is probably an icon image. + */ + alwaysUnencapsulated = OFTrue; + } + } + + /* conduct the reading process */ + errorFlag = + DcmPolymorphOBOW::read(inStream, ixfer, glenc, maxReadLength); + } + } + + /* return result value */ + return errorFlag; +} + + +void +DcmPixelData::removeAllButCurrentRepresentations() +{ + clearRepresentationList(current); + if (current != repListEnd && existUnencapsulated) + { + DcmPolymorphOBOW::putUint16Array(NULL,0); + existUnencapsulated = OFFalse; + } + original = current; +} + + +void +DcmPixelData::removeAllButOriginalRepresentations() +{ + clearRepresentationList(original); + if (original != repListEnd && existUnencapsulated) + { + DcmPolymorphOBOW::putUint16Array(NULL,0); + existUnencapsulated = OFFalse; + } + current = original; + recalcVR(); +} + +OFCondition +DcmPixelData::removeOriginalRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam) +{ + OFCondition l_error = EC_Normal; + DcmXfer repTypeSyn(repType); + + if (!repTypeSyn.isEncapsulated()) + { + if (original != repListEnd) + { + if (current == original) + { + current = repListEnd; + recalcVR(); + } + repList.erase(original); + original = repListEnd; + } + else + l_error = EC_IllegalCall; + } + else + { + DcmRepresentationListIterator result; + DcmRepresentationEntry findEntry(repType, repParam, NULL); + if (findRepresentationEntry(findEntry, result) == EC_Normal) + { + if (result != original) + { + if (current == original) + { + current = result; + recalcVR(); + } + if (original == repListEnd) + { + DcmPolymorphOBOW::putUint16Array(NULL, 0); + existUnencapsulated = OFFalse; + } + else + repList.erase(original); + original = result; + } + else + l_error = EC_IllegalCall; + } + else + l_error = EC_RepresentationNotFound; + } + return l_error; +} + +OFCondition +DcmPixelData::removeRepresentation( + const E_TransferSyntax repType, + const DcmRepresentationParameter * repParam) +{ + OFCondition l_error = EC_Normal; + DcmXfer repTypeSyn(repType); + + if (!repTypeSyn.isEncapsulated()) + { + if (original != repListEnd && existUnencapsulated) + { + DcmPolymorphOBOW::putUint16Array(NULL, 0); + existUnencapsulated = OFFalse; + } + else + l_error = EC_CannotChangeRepresentation; + } + else + { + DcmRepresentationListIterator result; + DcmRepresentationEntry findEntry(repType, repParam, NULL); + if (findRepresentationEntry(findEntry, result) == EC_Normal) + { + if (original != result) + repList.erase(result); + else l_error = EC_CannotChangeRepresentation; + } + else + l_error = EC_RepresentationNotFound; + } + return l_error; +} + + +OFCondition +DcmPixelData::setCurrentRepresentationParameter( + const DcmRepresentationParameter * repParam) +{ + if (current != repListEnd) + { + if (repParam == NULL) + (*current)->repParam = NULL; + else + (*current)->repParam = repParam->clone(); + return EC_Normal; + } + return EC_RepresentationNotFound; +} + +OFCondition +DcmPixelData::setVR(DcmEVR vr) +{ + unencapsulatedVR = vr; + return DcmPolymorphOBOW::setVR(vr); +} + +void +DcmPixelData::transferEnd() +{ + DcmPolymorphOBOW::transferEnd(); + for (DcmRepresentationListIterator it(repList.begin()); + it != repListEnd; + ++it) + (*it)->pixSeq->transferEnd(); +} + +void +DcmPixelData::transferInit() +{ + DcmPolymorphOBOW::transferInit(); + for (DcmRepresentationListIterator it(repList.begin()); + it != repListEnd; + ++it) + (*it)->pixSeq->transferInit(); +} + +OFCondition DcmPixelData::write( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + errorFlag = EC_Normal; + if (getTransferState() == ERW_notInitialized) errorFlag = EC_IllegalCall; + else + { + // check if the output transfer syntax is encapsulated + // and we are not requested to write an uncompressed dataset + // for example because this is within an Icon Image Sequence + DcmXfer xferSyn(oxfer); + if (xferSyn.isEncapsulated() && (! writeUnencapsulated(oxfer))) + { + // write encapsulated representation (i.e., compressed image) + if (getTransferState() == ERW_init) + { + DcmRepresentationListIterator found; + // find a compressed image matching the output transfer syntax + errorFlag = findConformingEncapsulatedRepresentation(xferSyn, NULL, found); + if (errorFlag == EC_Normal) + { + current = found; + recalcVR(); + pixelSeqForWrite = (*found)->pixSeq; + setTransferState(ERW_inWork); + } + } + // write compressed image + if (errorFlag == EC_Normal && pixelSeqForWrite) errorFlag = pixelSeqForWrite->write(outStream, oxfer, enctype, wcache); + if (errorFlag == EC_Normal) setTransferState(ERW_ready); + } + else if (existUnencapsulated) + { + // we're supposed to write an uncompressed image, and we happen to have one available. + current = repListEnd; + recalcVR(); + // write uncompressed image + errorFlag = DcmPolymorphOBOW::write(outStream, oxfer, enctype, wcache); + } + else if ((getValue() == NULL) && (current == repListEnd)) + { + // the PixelData is empty. Write an empty element. + errorFlag = DcmPolymorphOBOW::write(outStream, oxfer, enctype, wcache); + } else errorFlag = EC_RepresentationNotFound; + } + return errorFlag; +} + +OFCondition DcmPixelData::writeXML( + STD_NAMESPACE ostream &out, + const size_t flags) +{ + if (current == repListEnd) + { + errorFlag = DcmPolymorphOBOW::writeXML(out, flags); + } else { + /* pixel sequence (encapsulated data) */ + errorFlag = (*current)->pixSeq->writeXML(out, flags); + } + return errorFlag; +} + +OFCondition DcmPixelData::writeSignatureFormat( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + errorFlag = EC_Normal; + if (getTransferState() == ERW_notInitialized) errorFlag = EC_IllegalCall; + else if (getTag().isSignable()) + { + DcmXfer xferSyn(oxfer); + if (xferSyn.isEncapsulated() && (! writeUnencapsulated(oxfer))) + { + if (getTransferState() == ERW_init) + { + DcmRepresentationListIterator found; + errorFlag = findConformingEncapsulatedRepresentation(xferSyn, NULL, found); + if (errorFlag == EC_Normal) + { + current = found; + recalcVR(); + pixelSeqForWrite = (*found)->pixSeq; + setTransferState(ERW_inWork); + } + } + if (errorFlag == EC_Normal && pixelSeqForWrite) errorFlag = pixelSeqForWrite->writeSignatureFormat(outStream, oxfer, enctype, wcache); + if (errorFlag == EC_Normal) setTransferState(ERW_ready); + } + else if (existUnencapsulated) + { + current = repListEnd; + recalcVR(); + errorFlag = DcmPolymorphOBOW::writeSignatureFormat(outStream, oxfer, enctype, wcache); + } + else if (getValue() == NULL) + { + errorFlag = DcmPolymorphOBOW::writeSignatureFormat(outStream, oxfer, enctype, wcache); + } else errorFlag = EC_RepresentationNotFound; + } else errorFlag = EC_Normal; + return errorFlag; +} + +OFCondition DcmPixelData::loadAllDataIntoMemory(void) +{ + if (current == repListEnd) + return DcmElement::loadAllDataIntoMemory(); + else + return (*current)->pixSeq->loadAllDataIntoMemory(); +} + +void DcmPixelData::setNonEncapsulationFlag(OFBool flag) +{ + alwaysUnencapsulated = flag; +} + +OFCondition DcmPixelData::getUncompressedFrame( + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel, + DcmFileCache *cache) +{ + if ((dataset == NULL) || (buffer == NULL)) return EC_IllegalCall; + + Sint32 numberOfFrames = 1; + dataset->findAndGetSint32(DCM_NumberOfFrames, numberOfFrames); // don't fail if absent + if (numberOfFrames < 1) numberOfFrames = 1; + + Uint32 frameSize; + OFCondition result = getUncompressedFrameSize(dataset, frameSize); + if (result.bad()) return result; + + // determine the minimum buffer size, which may be frame size plus one pad byte if frame size is odd. + // We need this extra byte, because the image might be in a different + // endianness than our host cpu. In this case the decoder will swap + // the data to the host byte order which could overflow the buffer. + Uint32 minBufSize = frameSize; + if (minBufSize & 1) ++minBufSize; + + if (bufSize < minBufSize) return EC_IllegalCall; + + // check frame number + if (frameNo >= OFstatic_cast(Uint32, numberOfFrames)) return EC_IllegalCall; + + if (existUnencapsulated) + { + // we already have an uncompressed version of the pixel data + // either in memory or in file. We can directly access this using + // DcmElement::getPartialValue. + result = getPartialValue(buffer, frameNo * frameSize, frameSize, cache); + if (result.good()) result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel); + } + else + { + // we only have a compressed version of the pixel data. + // Identify a codec for decompressing the frame. + result = DcmCodecList::decodeFrame( + (*original)->repType, (*original)->repParam, (*original)->pixSeq, + dataset, frameNo, startFragment, buffer, bufSize, decompressedColorModel); + } + return result; +} + + +OFCondition DcmPixelData::getDecompressedColorModel( + DcmItem *dataset, + OFString &decompressedColorModel) +{ + OFCondition result = EC_IllegalParameter; + if (dataset != NULL) + { + if (existUnencapsulated) + { + // we already have an uncompressed version of the pixel data either in memory or in file, + // so just retrieve the color model from the given dataset + result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel); + if (result == EC_TagNotFound) + { + DCMDATA_WARN("DcmPixelData: Mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation << " is missing"); + result = EC_MissingAttribute; + } + else if (result.bad()) + { + DCMDATA_WARN("DcmPixelData: Cannot retrieve value of element PhotometricInterpretation " << DCM_PhotometricInterpretation << ": " << result.text()); + } + else if (decompressedColorModel.empty()) + { + DCMDATA_WARN("DcmPixelData: No value for mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation); + result = EC_MissingValue; + } + } else { + // we only have a compressed version of the pixel data. + // Identify a codec for determining the color model. + result = DcmCodecList::determineDecompressedColorModel( + (*original)->repType, (*original)->repParam, (*original)->pixSeq, + dataset, decompressedColorModel); + } + } + return result; +} + +OFBool DcmPixelData::writeUnencapsulated(const E_TransferSyntax xfer) +{ + // There are three cases under which a dataset is written out + // unencapsulated: + // + // - It was already read unencapsulated (handled via alwaysUnencapsulated) + // - We were told to do so (handled via alwaysUnencapsulated) + // - This is not the pixel data element on the main level and it exists + // unencapsulated. + + if (alwaysUnencapsulated) + return OFTrue; + if (DcmXfer(xfer).isEncapsulated()) { + DcmRepresentationListIterator found; + OFCondition cond = findConformingEncapsulatedRepresentation(xfer, NULL, found); + if (cond.good()) { + // We found a suitable encapsulated representation, so encapsulate + // this element in the output. + return OFFalse; + } + } + + return existUnencapsulated && isNested(); +} diff --git a/dcmdata/libsrc/dcpixseq.cc b/dcmdata/libsrc/dcpixseq.cc new file mode 100644 index 00000000..d8cdcf1a --- /dev/null +++ b/dcmdata/libsrc/dcpixseq.cc @@ -0,0 +1,440 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmPixelSequence + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofuuid.h" + +#include "dcmtk/dcmdata/dcpixseq.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvr.h" + +#include "dcmtk/dcmdata/dcdeftag.h" + + +// ******************************** + + +DcmPixelSequence::DcmPixelSequence(const DcmTag &tag) + : DcmSequenceOfItems(tag, 0), + Xfer(EXS_Unknown) +{ + setTagVR(EVR_OB); + setLengthField(DCM_UndefinedLength); // pixel sequences always use undefined length +} + + +DcmPixelSequence::DcmPixelSequence(const DcmTag &tag, + const Uint32 len) + : DcmSequenceOfItems(tag, len), + Xfer(EXS_Unknown) +{ + setTagVR(EVR_OB); + setLengthField(DCM_UndefinedLength); // pixel sequences always use undefined length +} + + +DcmPixelSequence::DcmPixelSequence(const DcmPixelSequence &old) + : DcmSequenceOfItems(old), + Xfer(old.Xfer) +{ + /* everything gets handled in DcmSequenceOfItems constructor */ +} + + +DcmPixelSequence::~DcmPixelSequence() +{ +} + + +DcmPixelSequence &DcmPixelSequence::operator=(const DcmPixelSequence &obj) +{ + if (this != &obj) + { + DcmSequenceOfItems::operator=(obj); + Xfer = obj.Xfer; + } + return *this; +} + + +OFCondition DcmPixelSequence::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmPixelSequence &, rhs); + } + return EC_Normal; +} + +// ******************************** + + +void DcmPixelSequence::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + /* print pixel sequence start line */ + if (flags & DCMTypes::PF_showTreeStructure) + { + /* empty text */ + printInfoLine(out, flags, level); + /* print pixel sequence content */ + if (!itemList->empty()) + { + /* print pixel items */ + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (itemList->seek(ELP_next)); + } + } else { + OFOStringStream oss; + oss << "(PixelSequence "; + if (getLengthField() != DCM_UndefinedLength) + oss << "with explicit length "; + oss << "#=" << card() << ")" << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + printInfoLine(out, flags, level, tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + /* print pixel sequence content */ + if (!itemList->empty()) + { + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (itemList->seek(ELP_next)); + } + /* print pixel sequence end line */ + DcmTag delimItemTag(DCM_SequenceDelimitationItemTag); + if (getLengthField() == DCM_UndefinedLength) + printInfoLine(out, flags, level, "(SequenceDelimitationItem)", &delimItemTag); + else + printInfoLine(out, flags, level, "(SequenceDelimitationItem for re-encod.)", &delimItemTag); + } +} + + +// ******************************** + + +OFCondition DcmPixelSequence::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + OFCondition l_error = EC_Normal; + if (flags & DCMTypes::XF_useNativeModel) + { + /* write XML start tag */ + writeXMLStartTag(out, flags); + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + out << ""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "" << OFendl; + } else { + /* generate a new UID but the binary data is not (yet) written. */ + OFUUID uuid; + out << "" << OFendl; + } + } + /* write XML end tag */ + writeXMLEndTag(out, flags); + } else { + /* the DCMTK-specific XML format requires no special handling */ + l_error = DcmSequenceOfItems::writeXML(out, flags); + } + return l_error; +} + + +// ******************************** + + +Uint32 DcmPixelSequence::calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + // add 8 bytes for Sequence Delimitation Tag which always exists for Pixel Sequences + return DcmElement::calcElementLength(xfer, enctype) + 8; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::makeSubObject(DcmObject *&subObject, + const DcmTag &newTag, + const Uint32 newLength) +{ + OFCondition l_error = EC_Normal; + DcmObject *newObject = NULL; + + switch (newTag.getEVR()) + { + case EVR_na: + if (newTag.getXTag() == DCM_Item) + newObject = new DcmPixelItem(newTag, newLength); + else if (newTag.getXTag() == DCM_SequenceDelimitationItem) + l_error = EC_SequEnd; + else if (newTag.getXTag() == DCM_ItemDelimitationItem) + l_error = EC_ItemEnd; + else + l_error = EC_InvalidTag; + break; + + default: + newObject = new DcmPixelItem(newTag, newLength); + l_error = EC_CorruptedData; + break; + } + + subObject = newObject; + return l_error; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::insert(DcmPixelItem *item, + unsigned long where) +{ + errorFlag = EC_Normal; + if (item != NULL) + { + itemList->seek_to(where); + itemList->insert(item); + if (where < itemList->card()) + DCMDATA_TRACE("DcmPixelSequence::insert() Item at position " << where << " inserted"); + if (where >= itemList->card()) + DCMDATA_TRACE("DcmPixelSequence::insert() Item at last position inserted"); + // check whether the new item already has a parent + if (item->getParent() != NULL) + { + DCMDATA_DEBUG("DcmPixelSequence::insert() PixelItem already has a parent: " + << item->getParent()->getTag() << " VR=" << DcmVR(item->getParent()->getVR()).getVRName()); + } + // remember the parent (i.e. the surrounding sequence) + item->setParent(this); + } else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::getItem(DcmPixelItem *&item, + const unsigned long num) +{ + errorFlag = EC_Normal; + item = OFstatic_cast(DcmPixelItem*, itemList->seek_to(num)); // read item from list + if (item == NULL) + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::remove(DcmPixelItem *&item, + const unsigned long num) +{ + errorFlag = EC_Normal; + item = OFstatic_cast(DcmPixelItem*, itemList->seek_to(num)); // read item from list + if (item != NULL) + { + itemList->remove(); + item->setParent(NULL); // forget about the parent + } else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::remove(DcmPixelItem *item) +{ + errorFlag = EC_IllegalCall; + if (!itemList->empty() && item != NULL) + { + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + if (dO == item) + { + itemList->remove(); // remove element from list, but do no delete it + item->setParent(NULL); // forget about the parent + errorFlag = EC_Normal; + break; + } + } while (itemList->seek(ELP_next)); + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::changeXfer(const E_TransferSyntax newXfer) +{ + if (Xfer == EXS_Unknown || canWriteXfer(newXfer, Xfer)) + { + Xfer = newXfer; + return EC_Normal; + } else + return EC_IllegalCall; +} + + +// ******************************** + + +OFBool DcmPixelSequence::canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer) +{ + DcmXfer newXferSyn(newXfer); + + return newXferSyn.isEncapsulated() && newXfer == oldXfer && oldXfer == Xfer; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::read(DcmInputStream &inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + OFCondition l_error = changeXfer(ixfer); + if (l_error.good()) + return DcmSequenceOfItems::read(inStream, ixfer, glenc, maxReadLength); + + return l_error; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType /*enctype*/, + DcmWriteCache *wcache) +{ + OFCondition l_error = changeXfer(oxfer); + if (l_error.good()) + return DcmSequenceOfItems::write(outStream, oxfer, EET_UndefinedLength, wcache); + + return l_error; +} + + +// ******************************** + + +OFCondition DcmPixelSequence::writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType /*enctype*/, + DcmWriteCache *wcache) +{ + OFCondition l_error = changeXfer(oxfer); + if (l_error.good()) + return DcmSequenceOfItems::writeSignatureFormat(outStream, oxfer, EET_UndefinedLength, wcache); + + return l_error; +} + + +OFCondition DcmPixelSequence::storeCompressedFrame(DcmOffsetList &offsetList, + Uint8 *compressedData, + Uint32 compressedLen, + Uint32 fragmentSize) +{ + if (compressedData == NULL) + return EC_IllegalCall; + + OFCondition result = EC_Normal; + if (fragmentSize >= 0x400000) + fragmentSize = 0; // prevent overflow + else + fragmentSize <<= 10; // unit is kbytes + if (fragmentSize == 0) + fragmentSize = compressedLen; + + Uint32 offset = 0; + Uint32 currentSize = 0; + Uint32 numFragments = 0; + DcmPixelItem *fragment = NULL; + + while ((offset < compressedLen) && (result.good())) + { + fragment = new DcmPixelItem(DCM_PixelItemTag); + if (fragment == NULL) + result = EC_MemoryExhausted; + else + { + insert(fragment); + numFragments++; + currentSize = fragmentSize; + if (offset + currentSize > compressedLen) + currentSize = compressedLen - offset; + // if currentSize is odd this will be fixed during DcmOtherByteOtherWord::write() + result = fragment->putUint8Array(compressedData + offset, currentSize); + if (result.good()) + offset += currentSize; + } + } + + currentSize = offset + (numFragments << 3); // 8 bytes extra for each item header + // odd frame size requires padding, i.e. last fragment uses odd length pixel item + if (currentSize & 1) + currentSize++; + offsetList.push_back(currentSize); + return result; +} diff --git a/dcmdata/libsrc/dcpxitem.cc b/dcmdata/libsrc/dcpxitem.cc new file mode 100644 index 00000000..936ab274 --- /dev/null +++ b/dcmdata/libsrc/dcpxitem.cc @@ -0,0 +1,461 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmPixelItem + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ +#include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ + + +// ******************************** + + +DcmPixelItem::DcmPixelItem(const DcmTag &tag, + const Uint32 len) + : DcmOtherByteOtherWord(tag, len) +{ + setTagVR(EVR_pixelItem); +} + + +DcmPixelItem::DcmPixelItem(const DcmPixelItem &old) + : DcmOtherByteOtherWord(old) +{ +} + + +DcmPixelItem &DcmPixelItem::operator=(const DcmPixelItem &obj) +{ + DcmOtherByteOtherWord::operator=(obj); + return *this; +} + + +OFCondition DcmPixelItem::copyFrom(const DcmObject &rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmPixelItem &, rhs); + } + return EC_Normal; +} + + +DcmPixelItem::~DcmPixelItem() +{ +} + + +// ******************************** + + +OFBool DcmPixelItem::isNested() const +{ + OFBool nested = OFFalse; + if (getParent() != NULL) + { + // check for surrounding structure of a pixel sequence + if ((getParent()->ident() == EVR_pixelSQ)) + nested = OFTrue; + } + return nested; +} + + +DcmItem *DcmPixelItem::getParentItem() +{ + DcmItem *parentItem = NULL; + if (getParent() != NULL) + { + // make sure that the direct parent has the correct type + if (getParent()->ident() == EVR_pixelSQ) + { + DcmObject *parent = getParent()->getParent(); + if (parent != NULL) + { + // make sure that it is really a class derived from DcmItem + switch (parent->ident()) + { + case EVR_metainfo: + case EVR_dataset: + case EVR_item: + case EVR_dirRecord: + parentItem = OFreinterpret_cast(DcmItem *, parent); + break; + default: + DCMDATA_DEBUG("DcmPixelItem::getParentItem() Parent object has wrong class identifier: " + << OFstatic_cast(int, parent->ident()) + << " (" << DcmVR(parent->ident()).getVRName() << ")"); + break; + } + } + } else { + DCMDATA_DEBUG("DcmPixelItem::getParentItem() Direct parent object is not a pixel sequence"); + } + } + return parentItem; +} + + +// ******************************** + + +Uint32 DcmPixelItem::calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + /* silence unused arguments warnings */ + OFstatic_cast(void, xfer); + OFstatic_cast(void, enctype); + /* get length of the pixel data */ + Uint32 valueLength = getLengthField(); + /* make sure the value did not overflow, clamp it otherwise. */ + if (OFStandard::check32BitAddOverflow(valueLength, 8)) + return OFnumeric_limits::max(); + return valueLength + 8; +} + + +// ******************************** + + +OFCondition DcmPixelItem::writeTagAndLength(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + Uint32 &writtenBytes) const +{ + OFCondition l_error = outStream.status(); + if (l_error.good()) + { + /* write tag information */ + l_error = writeTag(outStream, getTag(), oxfer); + writtenBytes = 4; + /* prepare to write the value field */ + Uint32 valueLength = getLengthField(); + DcmXfer outXfer(oxfer); + /* check byte-ordering */ + const E_ByteOrder oByteOrder = outXfer.getByteOrder(); + if (oByteOrder == EBO_unknown) + { + return EC_IllegalCall; + } + swapIfNecessary(oByteOrder, gLocalByteOrder, &valueLength, 4, 4); + // availability of four bytes space in output buffer + // has been checked by caller. + writtenBytes += OFstatic_cast(Uint32, outStream.write(&valueLength, 4)); + } else + writtenBytes = 0; + return l_error; +} + + +void DcmPixelItem::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + /* call inherited method */ + printPixel(out, flags, level, pixelFileName, pixelCounter); +} + + +OFCondition DcmPixelItem::createOffsetTable(const DcmOffsetList &offsetList) +{ + OFCondition result = EC_Normal; + + size_t numEntries = offsetList.size(); + if (numEntries > 0) + { + Uint32 current = 0; + Uint32 *array = new Uint32[numEntries]; + if (array) + { + DCMDATA_DEBUG("DcmPixelItem: creating offset table with " << numEntries << " entries"); + OFListConstIterator(Uint32) first = offsetList.begin(); + OFListConstIterator(Uint32) last = offsetList.end(); + unsigned long idx = 0; + OFBool overflow = OFFalse; + while ((first != last) && result.good()) + { + // check for 32-bit unsigned integer overflow (during previous iteration) and report on this + if (overflow) + { + DCMDATA_WARN("DcmPixelItem: offset value exceeds maximum (32-bit unsigned integer) for frame #" + << (idx + 1) << ", cannot create offset table"); + result = EC_InvalidBasicOffsetTable; + } + // check for odd offset values, should never happen at this point (if list was filled by an encoder) + else if (current & 1) + { + DCMDATA_WARN("DcmPixelItem: odd offset value (" << current << ") for frame #" + << (idx + 1) << ", cannot create offset table"); + result = EC_InvalidBasicOffsetTable; + } else { + // value "current" is proven to be valid + array[idx++] = current; + // check for 32-bit unsigned integer overflow (but report only during next iteration) + overflow = !OFStandard::safeAdd(current, *first, current); + ++first; + } + } + if (result.good()) + { + result = swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, array, OFstatic_cast(Uint32, numEntries * sizeof(Uint32)), sizeof(Uint32)); + if (result.good()) + result = putUint8Array(OFreinterpret_cast(Uint8 *, array), OFstatic_cast(unsigned long, numEntries * sizeof(Uint32))); + } + delete[] array; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DcmPixelItem::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + if (flags & DCMTypes::XF_useNativeModel) + { + /* in Native DICOM Model, there is no concept of a "pixel item" */ + return makeOFCondition(OFM_dcmdata, EC_CODE_CannotConvertToXML, OF_error, + "Cannot convert Pixel Item to Native DICOM Model"); + } else { + /* XML start tag for "item" */ + out << ""; + /* write element value (if loaded) */ + if (valueLoaded() && (flags & DCMTypes::XF_writeBinaryData)) + { + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + /* pixel items always contain 8 bit data, therefore, byte swapping not required */ + OFStandard::encodeBase64(out, OFstatic_cast(Uint8 *, getValue()), OFstatic_cast(size_t, getLengthField())); + } else { + /* get and check 8 bit data */ + Uint8 *byteValues = NULL; + if (getUint8Array(byteValues).good() && (byteValues != NULL)) + { + const unsigned long count = getLengthField(); + out << STD_NAMESPACE hex << STD_NAMESPACE setfill('0'); + /* print byte values in hex mode */ + out << STD_NAMESPACE setw(2) << OFstatic_cast(int, *(byteValues++)); + for (unsigned long i = 1; i < count; i++) + out << "\\" << STD_NAMESPACE setw(2) << OFstatic_cast(int, *(byteValues++)); + /* reset i/o manipulators */ + out << STD_NAMESPACE dec << STD_NAMESPACE setfill(' '); + } + } + } + /* XML end tag for "item" */ + out << "" << OFendl; + /* always report success */ + return EC_Normal; + } +} + + +OFCondition DcmPixelItem::writeSignatureFormat( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (dcmEnableOldSignatureFormat.get()) + { + /* Old signature format as created by DCMTK releases previous to 3.5.4. + * This is non-conformant because it includes the item length in pixel items. + */ + return DcmOtherByteOtherWord::writeSignatureFormat(outStream, oxfer, enctype, wcache); + } + else + { + DcmWriteCache wcache2; + + /* In case the transfer state is not initialized, this is an illegal call */ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + /* if this is not an illegal call, we need to do something. First */ + /* of all, check the error state of the stream that was passed */ + /* only do something if the error state of the stream is ok */ + errorFlag = outStream.status(); + if (errorFlag.good()) + { + /* create an object that represents the transfer syntax */ + DcmXfer outXfer(oxfer); + + /* pointer to element value if value resides in memory or old-style + * write behaviour is active (i.e. everything loaded into memory upon write + */ + Uint8 *value = NULL; + OFBool accessPossible = OFFalse; + + /* check that we actually do have access to the element's value. + * If the element is unaccessible (which would mean that the value resides + * in file and access to the file fails), write an empty element with + * zero length. + */ + if (getLengthField() > 0) + { + if (valueLoaded()) + { + /* get this element's value. Mind the byte ordering (little */ + /* or big endian) of the transfer syntax which shall be used */ + value = OFstatic_cast(Uint8 *, getValue(outXfer.getByteOrder())); + if (value) accessPossible = OFTrue; + } + else + { + /* Use local cache object if needed. This may cause those bytes + * that are read but not written because the output stream stalls to + * be read again, and the file from being re-opened next time. + * Therefore, this case should be avoided. + */ + if (!wcache) wcache = &wcache2; + + /* initialize cache object. This is safe even if the object was already initialized */ + wcache->init(this, getLengthField(), getTransferredBytes(), outXfer.getByteOrder()); + + /* access first block of element content */ + errorFlag = wcache->fillBuffer(*this); + + /* check that everything worked and the buffer is non-empty now */ + accessPossible = errorFlag.good() && (! wcache->bufferIsEmpty()); + } + } + + /* if this element's transfer state is ERW_init (i.e. it has not yet been written to */ + /* the stream) and if the outstream provides enough space for tag and length information */ + /* write tag and length information to it, do something */ + if (getTransferState() == ERW_init) + { + /* first compare with DCM_TagInfoLength (12). If there is not enough space + * in the buffer, check if the buffer is still sufficient for the requirements + * of this element, which may need only 8 instead of 12 bytes. + */ + if (outStream.avail() >= 4) + { + /* if there is no value, Length (member variable) shall be set to 0 */ + if (! accessPossible) setLengthField(0); + + /* write tag and length information (and possibly also data type information) to the stream, */ + /* mind the transfer syntax and remember the amount of bytes that have been written */ + errorFlag = writeTag(outStream, getTag(), oxfer); + + /* if the writing was successful, set this element's transfer */ + /* state to ERW_inWork and the amount of transferred bytes to 0 */ + if (errorFlag.good()) + { + setTransferState(ERW_inWork); + setTransferredBytes(0); + } + } else + errorFlag = EC_StreamNotifyClient; + } + /* if there is a value that has to be written to the stream */ + /* and if this element's transfer state is ERW_inWork */ + if (accessPossible && getTransferState() == ERW_inWork) + { + + Uint32 len = 0; + if (valueLoaded()) + { + /* write as many bytes as possible to the stream starting at value[getTransferredBytes()] */ + /* (note that the bytes value[0] to value[getTransferredBytes()-1] have already been */ + /* written to the stream) */ + len = OFstatic_cast(Uint32, outStream.write(&value[getTransferredBytes()], getLengthField() - getTransferredBytes())); + + /* increase the amount of bytes which have been transfered correspondingly */ + incTransferredBytes(len); + + /* see if there is something fishy with the stream */ + errorFlag = outStream.status(); + } + else + { + Uint32 buflen = 0; + OFBool done = getTransferredBytes() == getLengthField(); + while (! done) + { + // re-fill buffer from file if empty + errorFlag = wcache->fillBuffer(*this); + buflen = wcache->contentLength(); + + if (errorFlag.good()) + { + // write as many bytes from cache buffer to stream as possible + len = wcache->writeBuffer(outStream); + + /* increase the amount of bytes which have been transfered correspondingly */ + incTransferredBytes(len); + + /* see if there is something fishy with the stream */ + errorFlag = outStream.status(); + } + + // stop writing if something went wrong, we were unable to send all of the buffer content + // (which indicates that the output stream needs to be flushed, or everything was sent out. + done = errorFlag.bad() || (len < buflen) || (getTransferredBytes() == getLengthField()); + } + } + + /* if the amount of transferred bytes equals the length of the element's value, the */ + /* entire value has been written to the stream. Thus, this element's transfer state */ + /* has to be set to ERW_ready. If this is not the case but the error flag still shows */ + /* an ok value, there was no more space in the stream and a corresponding return value */ + /* has to be set. (Isn't the "else if" part superfluous?!?) */ + if (getLengthField() == getTransferredBytes()) setTransferState(ERW_ready); + else if (errorFlag.good()) errorFlag = EC_StreamNotifyClient; + } + } + } + } + + /* return result value */ + return errorFlag; +} diff --git a/dcmdata/libsrc/dcrleccd.cc b/dcmdata/libsrc/dcrleccd.cc new file mode 100644 index 00000000..61fde6be --- /dev/null +++ b/dcmdata/libsrc/dcrleccd.cc @@ -0,0 +1,760 @@ +/* + * + * Copyright (C) 2002-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: decoder codec class for RLE + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcrleccd.h" + +// dcmdata includes +#include "dcmtk/dcmdata/dcrlecp.h" /* for class DcmRLECodecParameter */ +#include "dcmtk/dcmdata/dcrledec.h" /* for class DcmRLEDecoder */ +#include "dcmtk/dcmdata/dcdatset.h" /* for class DcmDataset */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for class DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/dcvrpobw.h" /* for class DcmPolymorphOBOW */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary() */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmGenerateUniqueIdentifer()*/ + + +DcmRLECodecDecoder::DcmRLECodecDecoder() +: DcmCodec() +{ +} + + +DcmRLECodecDecoder::~DcmRLECodecDecoder() +{ +} + + +OFBool DcmRLECodecDecoder::canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const +{ + E_TransferSyntax myXfer = EXS_RLELossless; + DcmXfer newRep(newRepType); + if (newRep.isNotEncapsulated() && (oldRepType == myXfer)) return OFTrue; // decompress requested + + // we don't support re-coding for now. + return OFFalse; +} + + +OFCondition DcmRLECodecDecoder::decode( + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const +{ + OFCondition result = EC_Normal; + + // assume we can cast the codec parameter to what we need + const DcmRLECodecParameter *djcp = OFstatic_cast(const DcmRLECodecParameter *, cp); + + OFBool enableReverseByteOrder = djcp->getReverseDecompressionByteOrder(); + + DcmStack localStack(objStack); + (void)localStack.pop(); // pop pixel data element from stack + DcmObject *dataset = localStack.pop(); // this is the item in which the pixel data is located + if ((!dataset)||((dataset->ident()!= EVR_dataset) && (dataset->ident()!= EVR_item))) result = EC_InvalidTag; + else + { + Uint16 imageSamplesPerPixel = 0; + Uint16 imageRows = 0; + Uint16 imageColumns = 0; + Sint32 imageFrames = 1; + Uint16 imageBitsAllocated = 0; + Uint16 imageBytesAllocated = 0; + Uint16 imagePlanarConfiguration = 0; + Uint32 rleHeader[16]; + DcmItem *ditem = OFstatic_cast(DcmItem *, dataset); + OFBool numberOfFramesPresent = OFFalse; + + if (result.good()) result = ditem->findAndGetUint16(DCM_SamplesPerPixel, imageSamplesPerPixel); + if (result.good()) result = ditem->findAndGetUint16(DCM_Rows, imageRows); + if (result.good()) result = ditem->findAndGetUint16(DCM_Columns, imageColumns); + if (result.good()) result = ditem->findAndGetUint16(DCM_BitsAllocated, imageBitsAllocated); + if (result.good()) + { + imageBytesAllocated = OFstatic_cast(Uint16, imageBitsAllocated / 8); + if ((imageBitsAllocated < 8)||(imageBitsAllocated % 8 != 0)) + { + DCMDATA_ERROR("The RLE decoder only supports images where BitsAllocated is a multiple of 8."); + result = EC_CannotChangeRepresentation; + } + } + if (result.good() && (imageSamplesPerPixel > 1)) + { + result = ditem->findAndGetUint16(DCM_PlanarConfiguration, imagePlanarConfiguration); + } + + // number of frames is an optional attribute - we don't mind if it isn't present. + if (result.good()) + { + if (ditem->findAndGetSint32(DCM_NumberOfFrames, imageFrames).good()) numberOfFramesPresent = OFTrue; + } + + if (imageFrames >= OFstatic_cast(Sint32, pixSeq->card())) + imageFrames = OFstatic_cast(Sint32, pixSeq->card()) - 1; // limit number of frames to number of pixel items - 1 + if (imageFrames < 1) + imageFrames = 1; // default in case the number of frames attribute is absent or contains garbage + + if (result.good()) + { + DcmPixelItem *pixItem = NULL; + Uint8 * rleData = NULL; + const size_t bytesPerStripe = OFstatic_cast(size_t, imageColumns) * OFstatic_cast(size_t, imageRows); + + DcmRLEDecoder rledecoder(bytesPerStripe); + if (rledecoder.fail()) result = EC_MemoryExhausted; // RLE decoder failed to initialize + else + { + const size_t frameSize = OFstatic_cast(size_t, imageBytesAllocated) * OFstatic_cast(size_t, imageRows) + * OFstatic_cast(size_t, imageColumns) * OFstatic_cast(size_t, imageSamplesPerPixel); + size_t totalSize = frameSize * imageFrames; + if (totalSize & 1) totalSize++; // align on 16-bit word boundary + Uint16 *imageData16 = NULL; + Sint32 currentFrame = 0; + Uint32 currentItem = 1; // ignore offset table + Uint32 numberOfStripes = 0; + Uint32 fragmentLength = 0; + + result = uncompressedPixelData.createUint16Array(OFstatic_cast(Uint32, totalSize/sizeof(Uint16)), imageData16); + if (result.good()) + { + Uint8 *imageData8 = OFreinterpret_cast(Uint8 *, imageData16); + + while ((currentFrame < imageFrames) && result.good()) + { + DCMDATA_DEBUG("RLE decoder processes frame " << currentFrame); + DCMDATA_DEBUG("RLE decoder processes pixel item " << currentItem); + // get first pixel item of this frame + result = pixSeq->getItem(pixItem, currentItem++); + if (result.good()) + { + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(rleData); + if (result.good()) + { + // we require that the RLE header must be completely + // contained in the first fragment; otherwise bail out + if (fragmentLength < 64) + { + DCMDATA_ERROR("Pixel item shorter than 64 bytes, RLE header incomplete."); + result = EC_CannotChangeRepresentation; + } + } + } + + if (result.good()) + { + // copy RLE header to buffer and adjust byte order + memcpy(rleHeader, rleData, 64); + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, rleHeader, 16*OFstatic_cast(Uint32, sizeof(Uint32)), sizeof(Uint32)); + + // determine number of stripes. + numberOfStripes = rleHeader[0]; + + // check that number of stripes in RLE header matches our expectation + if ((numberOfStripes < 1) || (numberOfStripes > 15) || + (numberOfStripes != OFstatic_cast(Uint32, imageBytesAllocated) * imageSamplesPerPixel)) + { + DCMDATA_ERROR("Number of stripes in RLE header incorrect: found " << numberOfStripes << ", expected " << (OFstatic_cast(Uint32, imageBytesAllocated) * imageSamplesPerPixel)); + result = EC_CannotChangeRepresentation; + } + } + + if (result.good()) + { + // this variable keeps the number of bytes we have processed + // for the current frame in earlier pixel fragments + Uint32 fragmentOffset = 0; + + // this variable keeps the current position within the current fragment + Uint32 byteOffset = 0; + + OFBool lastStripe = OFFalse; + OFBool lastStripeOfColor = OFFalse; + Uint32 inputBytes = 0; + + // pointers for buffer copy operations + Uint8 *outputBuffer = NULL; + Uint8 *pixelPointer = NULL; + + // byte offset for first sample in frame + Uint32 sampleOffset = 0; + + // byte offset between samples + Uint32 offsetBetweenSamples = 0; + + // temporary variables + Uint32 sample = 0; + Uint32 byte = 0; + Uint32 pixel = 0; + + // for each stripe in stripe set + for (Uint32 stripeIndex = 0; (stripeIndex < numberOfStripes) && result.good(); ++stripeIndex) + { + // reset RLE codec + rledecoder.clear(); + + // adjust start point for RLE stripe, ignoring trailing garbage from the last run + byteOffset = rleHeader[stripeIndex + 1]; + if (byteOffset < fragmentOffset) + { + DCMDATA_ERROR("Byte offset in RLE header is wrong."); + result = EC_CannotChangeRepresentation; + } + else + { + byteOffset -= fragmentOffset; // now byteOffset is correct but may point to next fragment + while ((byteOffset > fragmentLength) && result.good()) + { + DCMDATA_DEBUG("RLE decoder processes pixel item " << currentItem); + result = pixSeq->getItem(pixItem, currentItem++); + if (result.good()) + { + byteOffset -= fragmentLength; + fragmentOffset += fragmentLength; + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(rleData); + if (result.bad()) + { + DCMDATA_ERROR("Cannot access pixel fragment."); + } + } + else + { + DCMDATA_ERROR("Cannot access pixel fragment."); + } + } + } + + // something went wrong; most likely the byte offset in the RLE header is incorrect. + if (result.bad()) return EC_CannotChangeRepresentation; + + // byteOffset now points to the first byte of the new RLE stripe + // check if the current stripe is the last one for this frame + if (stripeIndex + 1 == numberOfStripes) lastStripe = OFTrue; else lastStripe = OFFalse; + + if (lastStripe) + { + // the last stripe needs special handling because we cannot use the + // offset table to determine the number of bytes to feed to the codec + // if the RLE data is split in multiple fragments. We need to feed + // data fragment by fragment until the RLE codec has produced + // sufficient output. + while ((rledecoder.size() < bytesPerStripe) && result.good()) + { + // feed complete remaining content of fragment to RLE codec and + // switch to next fragment + result = rledecoder.decompress(rleData + byteOffset, OFstatic_cast(size_t, fragmentLength - byteOffset)); + + // special handling for zero pad byte at the end of the RLE stream + // which results in an EC_StreamNotifyClient return code + // or trailing garbage data which results in EC_CorruptedData + if (rledecoder.size() == bytesPerStripe) result = EC_Normal; + + // Check if we're already done. If yes, don't change fragment + if (result.good() || result == EC_StreamNotifyClient) + { + if (rledecoder.size() < bytesPerStripe) + { + DCMDATA_WARN("RLE decoder is finished but has produced insufficient data for this stripe, will continue with next pixel item"); + DCMDATA_DEBUG("RLE decoder processes pixel item " << currentItem); + result = pixSeq->getItem(pixItem, currentItem++); + if (result.good()) + { + byteOffset = 0; + fragmentOffset += fragmentLength; + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(rleData); + } + } + else byteOffset = fragmentLength; + } + } /* while */ + } + else + { + // not the last stripe. We can use the offset table to determine + // the number of bytes to feed to the RLE codec. + inputBytes = rleHeader[stripeIndex+2]; + if (inputBytes < rleHeader[stripeIndex + 1]) + { + DCMDATA_ERROR("Byte offset in RLE header is wrong."); + result = EC_CannotChangeRepresentation; + } + else + { + inputBytes -= rleHeader[stripeIndex + 1]; // number of bytes to feed to codec + while ((inputBytes > (fragmentLength - byteOffset)) && result.good()) + { + // feed complete remaining content of fragment to RLE codec and + // switch to next fragment + result = rledecoder.decompress(rleData + byteOffset, OFstatic_cast(size_t, fragmentLength - byteOffset)); + + if (result.good() || result == EC_StreamNotifyClient) + { + DCMDATA_DEBUG("RLE decoder processes pixel item " << currentItem); + result = pixSeq->getItem(pixItem, currentItem++); + } + if (result.good()) + { + inputBytes -= fragmentLength - byteOffset; + byteOffset = 0; + fragmentOffset += fragmentLength; + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(rleData); + } + } /* while */ + + // last fragment for this RLE stripe + result = rledecoder.decompress(rleData + byteOffset, OFstatic_cast(size_t, inputBytes)); + + // special handling for zero pad byte at the end of the RLE stream + // which results in an EC_StreamNotifyClient return code + // or trailing garbage data which results in EC_CorruptedData + if (rledecoder.size() == bytesPerStripe) result = EC_Normal; + + byteOffset += inputBytes; + } + } + + // copy the decoded stuff over to the buffer here... + // make sure the RLE decoder has produced the right amount of data + lastStripeOfColor = lastStripe || ((imagePlanarConfiguration == 1) && ((stripeIndex + 1) % imageBytesAllocated == 0)); + + if (lastStripeOfColor && (rledecoder.size() < bytesPerStripe)) + { + // stripe ended prematurely? report a warning and continue + DCMDATA_WARN("RLE decoder is finished but has produced insufficient data for this stripe, filling remaining pixels"); + result = EC_Normal; + } + else if (rledecoder.size() != bytesPerStripe) + { + DCMDATA_ERROR("RLE decoder is finished but has produced insufficient data for this stripe"); + result = EC_CannotChangeRepresentation; + } + + // distribute decompressed bytes into output image array + if (result.good()) + { + // which sample and byte are we currently compressing? + sample = stripeIndex / imageBytesAllocated; + byte = stripeIndex % imageBytesAllocated; + + // raw buffer containing bytesPerStripe bytes of uncompressed data + outputBuffer = OFstatic_cast(Uint8 *, rledecoder.getOutputBuffer()); + + // compute byte offsets + if (imagePlanarConfiguration == 0) + { + sampleOffset = sample * imageBytesAllocated; + offsetBetweenSamples = imageSamplesPerPixel * imageBytesAllocated; + } + else + { + sampleOffset = sample * imageBytesAllocated * imageColumns * imageRows; + offsetBetweenSamples = imageBytesAllocated; + } + + // initialize pointer to output data + if (enableReverseByteOrder) + { + // assume incorrect LSB to MSB order of RLE segments as produced by some tools + pixelPointer = imageData8 + sampleOffset + byte; + } + else + { + pixelPointer = imageData8 + sampleOffset + imageBytesAllocated - byte - 1; + } + + // loop through all pixels of the frame + for (pixel = 0; pixel < bytesPerStripe; ++pixel) + { + *pixelPointer = *outputBuffer++; + pixelPointer += offsetBetweenSamples; + } + } + } /* for */ + } + + // advance by one frame + if (result.good()) + { + currentFrame++; + imageData8 += frameSize; + } + + } /* while still frames to process */ + + // adjust byte order for uncompressed image to little endian + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, imageData16, OFstatic_cast(Uint32, totalSize), sizeof(Uint16)); + + // Number of Frames might have changed in case the previous value was wrong + if (result.good() && (numberOfFramesPresent || (imageFrames > 1))) + { + char numBuf[20]; + sprintf(numBuf, "%ld", OFstatic_cast(long, imageFrames)); + result = OFstatic_cast(DcmItem *, dataset)->putAndInsertString(DCM_NumberOfFrames, numBuf); + } + } + } + } + + // the following operations do not affect the Image Pixel Module + // but other modules such as SOP Common. We only perform these + // changes if we're on the main level of the dataset, + // which should always identify itself as dataset, not as item. + if (dataset->ident() == EVR_dataset) + { + // create new SOP instance UID if codec parameters require so + if (result.good() && djcp->getUIDCreation()) result = + DcmCodec::newInstance(OFstatic_cast(DcmItem *, dataset), NULL, NULL, NULL); + } + } + return result; +} + + +OFCondition DcmRLECodecDecoder::decodeFrame( + const DcmRepresentationParameter * /* fromParam */, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const +{ + OFCondition result = EC_Normal; + + // assume we can cast the codec parameter to what we need + const DcmRLECodecParameter *djcp = OFstatic_cast(const DcmRLECodecParameter *, cp); + + OFBool enableReverseByteOrder = djcp->getReverseDecompressionByteOrder(); + + if ((!dataset)||((dataset->ident()!= EVR_dataset) && (dataset->ident()!= EVR_item))) return EC_InvalidTag; + + Uint16 imageSamplesPerPixel = 0; + Uint16 imageRows = 0; + Uint16 imageColumns = 0; + Sint32 imageFrames = 1; + Uint16 imageBitsAllocated = 0; + Uint16 imageBytesAllocated = 0; + Uint16 imagePlanarConfiguration = 0; + Uint32 rleHeader[16]; + OFString photometricInterpretation; + DcmItem *ditem = OFstatic_cast(DcmItem *, dataset); + + if (result.good()) result = ditem->findAndGetUint16(DCM_SamplesPerPixel, imageSamplesPerPixel); + if (result.good()) result = ditem->findAndGetUint16(DCM_Rows, imageRows); + if (result.good()) result = ditem->findAndGetUint16(DCM_Columns, imageColumns); + if (result.good()) result = ditem->findAndGetUint16(DCM_BitsAllocated, imageBitsAllocated); + if (result.good()) result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, photometricInterpretation); + if (result.good()) + { + imageBytesAllocated = OFstatic_cast(Uint16, imageBitsAllocated / 8); + if ((imageBitsAllocated < 8)||(imageBitsAllocated % 8 != 0)) + { + DCMDATA_ERROR("The RLE decoder only supports images where BitsAllocated is a multiple of 8."); + return EC_CannotChangeRepresentation; + } + } + if (result.good() && (imageSamplesPerPixel > 1)) + { + result = ditem->findAndGetUint16(DCM_PlanarConfiguration, imagePlanarConfiguration); + } + + // number of frames is an optional attribute - we don't mind if it isn't present. + if (result.good()) (void) ditem->findAndGetSint32(DCM_NumberOfFrames, imageFrames); + if (imageFrames < 1) imageFrames = 1; // default in case this attribute contains garbage + + if (result.bad()) + return result; + + DcmPixelItem *pixItem = NULL; + Uint8 * rleData = NULL; + const size_t bytesPerStripe = OFstatic_cast(size_t, imageColumns) * OFstatic_cast(size_t, imageRows); + Uint32 numberOfStripes = 0; + Uint32 fragmentLength = 0; + Uint32 frameSize = OFstatic_cast(Uint32, imageBytesAllocated) * OFstatic_cast(Uint32, imageRows) + * OFstatic_cast(Uint32, imageColumns) * OFstatic_cast(Uint32, imageSamplesPerPixel); + + if (frameSize > bufSize) return EC_IllegalCall; + + DcmRLEDecoder rledecoder(bytesPerStripe); + if (rledecoder.fail()) return EC_MemoryExhausted; // RLE decoder failed to initialize + + DCMDATA_DEBUG("RLE decoder processes frame " << frameNo); + + // determine the corresponding item (first fragment) for this frame + Uint32 currentItem = startFragment; + + // if the user has provided this information, we trust him. + // If the user has passed a zero, try to find out ourselves. + if (currentItem == 0 && result.good()) + { + result = determineStartFragment(frameNo, imageFrames, fromPixSeq, currentItem); + if (result.bad()) + return result; + } + + DCMDATA_DEBUG("RLE decoder processes pixel item " << currentItem); + // now access and decompress the frame starting at the item we have identified + result = fromPixSeq->getItem(pixItem, currentItem); + if (result.bad()) + return result; + + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(rleData); + if (result.bad()) + return result; + + // copy RLE header to buffer and adjust byte order + memcpy(rleHeader, rleData, 64); + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, rleHeader, OFstatic_cast(Uint32, 16*sizeof(Uint32)), sizeof(Uint32)); + + // determine number of stripes. + numberOfStripes = rleHeader[0]; + + // check that number of stripes in RLE header matches our expectation + if ((numberOfStripes < 1) || (numberOfStripes > 15) || (numberOfStripes != OFstatic_cast(Uint32, imageBytesAllocated) * imageSamplesPerPixel)) + { + DCMDATA_ERROR("Number of stripes in RLE header incorrect: found " << numberOfStripes << ", expected " << (OFstatic_cast(Uint32, imageBytesAllocated) * imageSamplesPerPixel)); + return EC_CannotChangeRepresentation; + } + + // this variable keeps the current position within the current fragment + Uint32 byteOffset = 0; + + OFBool lastStripe = OFFalse; + OFBool lastStripeOfColor = OFFalse; + Uint32 inputBytes = 0; + + // pointers for buffer copy operations + Uint8 *outputBuffer = NULL; + Uint8 *pixelPointer = NULL; + Uint16 *imageData16 = OFreinterpret_cast(Uint16 *, buffer); + Uint8 *imageData8 = OFreinterpret_cast(Uint8 *, buffer); + + // byte offset for first sample in frame + Uint32 sampleOffset = 0; + + // byte offset between samples + Uint32 offsetBetweenSamples = 0; + + // temporary variables + Uint32 sample = 0; + Uint32 byte = 0; + Uint32 pixel = 0; + size_t bytesToDecode; + + // for each stripe in stripe set + for (Uint32 stripeIndex = 0; stripeIndex < numberOfStripes; ++stripeIndex) + { + // reset RLE codec + rledecoder.clear(); + + // adjust start point for RLE stripe + byteOffset = rleHeader[stripeIndex + 1]; + + // byteOffset now points to the first byte of the new RLE stripe + // check if the current stripe is the last one for this frame + if (stripeIndex + 1 == numberOfStripes) lastStripe = OFTrue; else lastStripe = OFFalse; + + if (lastStripe) + { + // the last stripe needs special handling because we cannot use the + // offset table to determine the number of bytes to feed to the codec + // if the RLE data is split in multiple fragments. We need to feed + // data fragment by fragment until the RLE codec has produced + // sufficient output. + bytesToDecode = OFstatic_cast(size_t, fragmentLength - byteOffset); + } + else + { + // not the last stripe. We can use the offset table to determine + // the number of bytes to feed to the RLE codec. + inputBytes = rleHeader[stripeIndex+2]; + if (inputBytes < rleHeader[stripeIndex + 1]) + { + DCMDATA_ERROR("Byte offset in RLE header is wrong."); + return EC_CannotChangeRepresentation; + } + + inputBytes -= rleHeader[stripeIndex + 1]; // number of bytes to feed to codec + + bytesToDecode = OFstatic_cast(size_t, inputBytes); + } + + // last fragment for this RLE stripe + result = rledecoder.decompress(rleData + byteOffset, bytesToDecode); + + // special handling for zero pad byte at the end of the RLE stream + // which results in an EC_StreamNotifyClient return code + // or trailing garbage data which results in EC_CorruptedData + if (rledecoder.size() == bytesPerStripe) result = EC_Normal; + + byteOffset += inputBytes; + + // copy the decoded stuff over to the buffer here... + // make sure the RLE decoder has produced the right amount of data + lastStripeOfColor = lastStripe || ((imagePlanarConfiguration == 1) && ((stripeIndex + 1) % imageBytesAllocated == 0)); + if (lastStripeOfColor && (rledecoder.size() < bytesPerStripe)) + { + // stripe ended prematurely? report a warning and continue + DCMDATA_WARN("RLE decoder is finished but has produced insufficient data for this stripe, filling remaining pixels"); + result = EC_Normal; + } + else if (rledecoder.size() != bytesPerStripe) + { + DCMDATA_ERROR("RLE decoder is finished but has produced insufficient data for this stripe"); + return EC_CannotChangeRepresentation; + } + + // distribute decompressed bytes into output image array + // which sample and byte are we currently decompressing? + sample = stripeIndex / imageBytesAllocated; + byte = stripeIndex % imageBytesAllocated; + + // raw buffer containing bytesPerStripe bytes of uncompressed data + outputBuffer = OFstatic_cast(Uint8 *, rledecoder.getOutputBuffer()); + + // compute byte offsets + if (imagePlanarConfiguration == 0) + { + sampleOffset = sample * imageBytesAllocated; + offsetBetweenSamples = imageSamplesPerPixel * imageBytesAllocated; + } + else + { + sampleOffset = sample * imageBytesAllocated * imageColumns * imageRows; + offsetBetweenSamples = imageBytesAllocated; + } + + // initialize pointer to output data + if (enableReverseByteOrder) + { + // assume incorrect LSB to MSB order of RLE segments as produced by some tools + pixelPointer = imageData8 + sampleOffset + byte; + } + else + { + pixelPointer = imageData8 + sampleOffset + imageBytesAllocated - byte - 1; + } + + // copy the pixel data that was decoded + const size_t decoderSize = rledecoder.size(); + for (pixel = 0; pixel < decoderSize; ++pixel) + { + *pixelPointer = *outputBuffer++; + pixelPointer += offsetBetweenSamples; + } + // and fill the remainder of the image with copies of the last decoded pixel + const Uint8 lastPixelValue = *(outputBuffer - 1); + for (pixel = OFstatic_cast(Uint32, decoderSize); pixel < bytesPerStripe; ++pixel) + { + *pixelPointer = lastPixelValue; + pixelPointer += offsetBetweenSamples; + } + } + + /* remove used fragment from memory */ + pixItem->compact(); // there should only be one... + + if (result.good()) + { + // compression was successful. Now update output parameters + startFragment = currentItem + 1; + decompressedColorModel = photometricInterpretation; + } + + // adjust byte order for uncompressed image to little endian + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, imageData16, frameSize, sizeof(Uint16)); + + return result; +} + + +OFCondition DcmRLECodecDecoder::encode( + const Uint16 * /* pixelData */, + const Uint32 /* length */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* pixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we are a decoder only + return EC_IllegalCall; +} + + +OFCondition DcmRLECodecDecoder::encode( + const E_TransferSyntax /* fromRepType */, + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* toPixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we don't support re-coding for now. + return EC_IllegalCall; +} + + +OFCondition DcmRLECodecDecoder::determineDecompressedColorModel( + const DcmRepresentationParameter * /* fromParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmCodecParameter * /* cp */, + DcmItem *dataset, + OFString &decompressedColorModel) const +{ + OFCondition result = EC_IllegalParameter; + if (dataset != NULL ) + { + if ((dataset->ident() == EVR_dataset) || (dataset->ident() == EVR_item)) + { + // retrieve color model from given dataset + result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel); + if (result == EC_TagNotFound) + { + DCMDATA_WARN("DcmRLECodecDecoder: Mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation << " is missing"); + result = EC_MissingAttribute; + } + else if (result.bad()) + { + DCMDATA_WARN("DcmRLECodecDecoder: Cannot retrieve value of element PhotometricInterpretation " << DCM_PhotometricInterpretation << ": " << result.text()); + } + else if (decompressedColorModel.empty()) + { + DCMDATA_WARN("DcmRLECodecDecoder: No value for mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation); + result = EC_MissingValue; + } + } else + result = EC_CorruptedData; + } + return result; +} diff --git a/dcmdata/libsrc/dcrlecce.cc b/dcmdata/libsrc/dcrlecce.cc new file mode 100644 index 00000000..6d54eff0 --- /dev/null +++ b/dcmdata/libsrc/dcrlecce.cc @@ -0,0 +1,436 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: encoder codec class for RLE + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcrlecce.h" + +#include "dcmtk/dcmdata/dcrleenc.h" /* for class DcmRLEEncoder */ +#include "dcmtk/dcmdata/dcrlecp.h" /* for class DcmRLECodecParameter */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for class DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + + +typedef OFList DcmRLEEncoderList; +typedef OFListIterator(DcmRLEEncoder *) DcmRLEEncoderListIterator; + + +// ======================================================================= + +DcmRLECodecEncoder::DcmRLECodecEncoder() +: DcmCodec() +{ +} + + +DcmRLECodecEncoder::~DcmRLECodecEncoder() +{ +} + + +OFBool DcmRLECodecEncoder::canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const +{ + E_TransferSyntax myXfer = EXS_RLELossless; + DcmXfer newRep(newRepType); + DcmXfer oldRep(oldRepType); + if (oldRep.isNotEncapsulated() && (newRepType == myXfer)) return OFTrue; // compress requested + + // we don't support re-coding for now. + return OFFalse; +} + + +OFCondition DcmRLECodecEncoder::decode( + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* pixSeq */, + DcmPolymorphOBOW& /* uncompressedPixelData */, + const DcmCodecParameter * /* cp */, + const DcmStack& /* objStack */) const +{ + // we are an encoder only + return EC_IllegalCall; +} + + +OFCondition DcmRLECodecEncoder::decodeFrame( + const DcmRepresentationParameter * /* fromParam */ , + DcmPixelSequence * /* fromPixSeq */ , + const DcmCodecParameter * /* cp */ , + DcmItem * /* dataset */ , + Uint32 /* frameNo */ , + Uint32& /* startFragment */ , + void * /* buffer */ , + Uint32 /* bufSize */ , + OFString& /* decompressedColorModel */ ) const +{ + // we are an encoder only + return EC_IllegalCall; +} + + +OFCondition DcmRLECodecEncoder::encode( + const E_TransferSyntax /* fromRepType */, + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* toPixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we don't support re-coding for now. + return EC_IllegalCall; +} + + +OFCondition DcmRLECodecEncoder::encode( + const Uint16 *pixelData, + const Uint32 length, + const DcmRepresentationParameter * /* toRepParam */ , + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const +{ + OFCondition result = EC_Normal; + + // assume we can cast the codec parameter to what we need + const DcmRLECodecParameter *djcp = OFstatic_cast(const DcmRLECodecParameter *, cp); + DcmStack localStack(objStack); + (void)localStack.pop(); // pop pixel data element from stack + DcmObject *dataset = localStack.pop(); // this is the item in which the pixel data is located + Uint8 *pixelData8 = OFreinterpret_cast(Uint8 *, OFconst_cast(Uint16 *, pixelData)); + Uint8 *pixelPointer = NULL; + DcmOffsetList offsetList; + DcmRLEEncoderList rleEncoderList; + DcmRLEEncoderListIterator first = rleEncoderList.begin(); + DcmRLEEncoderListIterator last = rleEncoderList.end(); + Uint32 rleHeader[16]; + Uint32 i; + OFBool byteSwapped = OFFalse; // true if we have byte-swapped the original pixel data + + if ((!dataset)||((dataset->ident()!= EVR_dataset) && (dataset->ident()!= EVR_item))) result = EC_InvalidTag; + else + { + DcmItem *ditem = OFstatic_cast(DcmItem *, dataset); + Uint16 bitsAllocated = 0; + Uint16 bytesAllocated = 0; + Uint16 samplesPerPixel = 0; + Uint16 planarConfiguration = 0; + Uint16 columns = 0; + Uint16 rows = 0; + Sint32 numberOfFrames = 1; + Uint32 numberOfStripes = 0; + Uint32 compressedSize = 0; + + result = ditem->findAndGetUint16(DCM_BitsAllocated, bitsAllocated); + if (result.good()) result = ditem->findAndGetUint16(DCM_SamplesPerPixel, samplesPerPixel); + if (result.good()) result = ditem->findAndGetUint16(DCM_Columns, columns); + if (result.good()) result = ditem->findAndGetUint16(DCM_Rows, rows); + if (result.good()) + { + result = ditem->findAndGetSint32(DCM_NumberOfFrames, numberOfFrames); + if (result.bad() || numberOfFrames < 1) numberOfFrames = 1; + result = EC_Normal; + } + if (result.good() && (samplesPerPixel > 1)) + { + result = ditem->findAndGetUint16(DCM_PlanarConfiguration, planarConfiguration); + } + + if (result.good()) + { + // check if bitsAllocated is a multiple of 8 - we don't handle anything else + bytesAllocated = OFstatic_cast(Uint16, bitsAllocated / 8); + if ((bitsAllocated < 8)||(bitsAllocated % 8 != 0)) result = EC_CannotChangeRepresentation; + + // make sure that all the descriptive attributes have sensible values + if ((columns < 1)||(rows < 1)||(samplesPerPixel < 1)) result = EC_CannotChangeRepresentation; + + // an RLE stripe set can have at most 15 stripes, i.e. 15 bytes allocated per pixel + numberOfStripes = bytesAllocated * samplesPerPixel; + if (numberOfStripes > 15) result = EC_CannotChangeRepresentation; + + // make sure that we have at least as many bytes of pixel data as we expect + if (numberOfStripes * columns * rows * numberOfFrames > length) result = EC_CannotChangeRepresentation; + } + + DcmPixelSequence *pixelSequence = NULL; + DcmPixelItem *offsetTable = NULL; + + // create initial pixel sequence + if (result.good()) + { + pixelSequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSequence == NULL) result = EC_MemoryExhausted; + else + { + // create empty offset table + offsetTable = new DcmPixelItem(DCM_PixelItemTag); + if (offsetTable == NULL) result = EC_MemoryExhausted; + else pixelSequence->insert(offsetTable); + } + } + + // byte swap pixel data to little endian + if (gLocalByteOrder == EBO_BigEndian) + { + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, OFstatic_cast(void *, OFconst_cast(Uint16 *, pixelData)), length, sizeof(Uint16)); + } + + // create RLE stripe sets + if (result.good()) + { + const Uint32 bytesPerStripe = columns * rows; + const Uint32 frameSize = columns * rows * samplesPerPixel * bytesAllocated; + Uint32 frameOffset = 0; + Uint32 sampleOffset = 0; + Uint32 offsetBetweenSamples = 0; + Uint32 sample = 0; + Uint32 byte = 0; + Uint32 pixel = 0; + Uint32 columnCounter = 0; + + DcmRLEEncoder *rleEncoder = NULL; + Uint32 rleSize = 0; + Uint8 *rleData = NULL; + Uint8 *rleData2 = NULL; + + // warn about (possibly) non-standard fragmentation + if (djcp->getFragmentSize() > 0) + DCMDATA_WARN("DcmRLECodecEncoder: limiting the fragment size may result in non-standard conformant encoding"); + + // compute byte offset between samples + if (planarConfiguration == 0) + offsetBetweenSamples = samplesPerPixel * bytesAllocated; + else offsetBetweenSamples = bytesAllocated; + + // loop through all frames of the image + for (Uint32 currentFrame = 0; ((currentFrame < OFstatic_cast(Uint32, numberOfFrames)) && result.good()); currentFrame++) + { + // offset to start of frame, in bytes + frameOffset = frameSize * currentFrame; + + // loop through all samples of one frame + for (sample = 0; sample < samplesPerPixel; sample++) + { + // compute byte offset for first sample in frame + if (planarConfiguration == 0) + sampleOffset = sample * bytesAllocated; + else sampleOffset = sample * bytesAllocated * columns * rows; + + // loop through the bytes of one sample + for (byte = 0; byte < bytesAllocated; byte++) + { + pixelPointer = pixelData8 + frameOffset + sampleOffset + bytesAllocated - byte - 1; + + // initialize new RLE codec for this stripe + rleEncoder = new DcmRLEEncoder(1 /* DICOM padding required */); + if (rleEncoder) + { + rleEncoderList.push_back(rleEncoder); + columnCounter = columns; + + // loop through all pixels of the frame + for (pixel = 0; pixel < bytesPerStripe; ++pixel) + { + rleEncoder->add(*pixelPointer); + + // enforce DICOM rule that "Each row of the image shall be encoded + // separately and not cross a row boundary." + // (see DICOM part 5 section G.3.1) + if (--columnCounter == 0) + { + rleEncoder->flush(); + columnCounter = columns; + } + pixelPointer += offsetBetweenSamples; + } + + rleEncoder->flush(); + if (rleEncoder->fail()) result = EC_MemoryExhausted; + } else result = EC_MemoryExhausted; + } + } + + // store frame and erase RLE codec list + if (result.good() && (rleEncoderList.size() > 0) && (rleEncoderList.size() < 16)) + { + // compute size of compressed frame including RLE header + // and populate RLE header + for (i=0; i<16; i++) rleHeader[i] = 0; + rleHeader[0] = OFstatic_cast(Uint32, rleEncoderList.size()); + rleSize = 64; + i = 1; + first = rleEncoderList.begin(); + while (first != last) + { + rleHeader[i++] = rleSize; + rleSize += OFstatic_cast(Uint32, (*first)->size()); + ++first; + } + + // allocate buffer for compressed frame + rleData = new Uint8[rleSize]; + + if (rleData) + { + // copy RLE header to compressed frame buffer + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, rleHeader, OFstatic_cast(Uint32, 16*sizeof(Uint32)), sizeof(Uint32)); + memcpy(rleData, rleHeader, 64); + + // store RLE stripe sets in compressed frame buffer + rleData2 = rleData + 64; + first = rleEncoderList.begin(); + while (first != last) + { + (*first)->write(rleData2); + rleData2 += (*first)->size(); + delete *first; + first = rleEncoderList.erase(first); + } + + // store compressed frame, breaking into segments if necessary + result = pixelSequence->storeCompressedFrame(offsetList, rleData, rleSize, djcp->getFragmentSize()); + compressedSize += rleSize; + + // erase buffer for compressed frame + delete[] rleData; + } else result = EC_MemoryExhausted; + } + else + { + // erase RLE codec list + first = rleEncoderList.begin(); + while (first != last) + { + delete *first; + first = rleEncoderList.erase(first); + } + if (result.good()) result = EC_CannotChangeRepresentation; + } + + } + + } + + // store pixel sequence if everything went well. + if (result.good()) pixSeq = pixelSequence; + else + { + delete pixelSequence; + pixSeq = NULL; + } + + if ((result.good()) && (djcp->getCreateOffsetTable())) + { + // create offset table + result = offsetTable->createOffsetTable(offsetList); + } + + // the following operations do not affect the Image Pixel Module + // but other modules such as SOP Common. We only perform these + // changes if we're on the main level of the dataset, + // which should always identify itself as dataset, not as item. + if (dataset->ident() == EVR_dataset) + { + if (result.good()) + { + // create new UID if mode is true or if we're converting to Secondary Capture + if (djcp->getConvertToSC() || djcp->getUIDCreation()) + { + result = DcmCodec::newInstance(OFstatic_cast(DcmItem *, dataset), "DCM", "121320", "Uncompressed predecessor"); + + // set image type to DERIVED + if (result.good()) result = updateImageType(OFstatic_cast(DcmItem *, dataset)); + + // update derivation description + if (result.good()) + { + // compute original image size in bytes, ignoring any padding bits. + double compressionRatio = 0.0; + if (compressedSize > 0) compressionRatio = (OFstatic_cast(double, columns * rows * bitsAllocated * OFstatic_cast(Uint32, numberOfFrames) * samplesPerPixel) / 8.0) / compressedSize; + result = updateDerivationDescription(OFstatic_cast(DcmItem *, dataset), compressionRatio); + } + } + } + + // convert to Secondary Capture if requested by user. + // This method creates a new SOP class UID, so it should be executed + // after the call to newInstance() which creates a Source Image Sequence. + if (result.good() && djcp->getConvertToSC()) result = DcmCodec::convertToSecondaryCapture(OFstatic_cast(DcmItem *, dataset)); + } + } + + // byte swap pixel data back to local endian if necessary + if (byteSwapped) + { + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, OFstatic_cast(void *, OFconst_cast(Uint16 *, pixelData)), length, sizeof(Uint16)); + } + return result; +} + + +OFCondition DcmRLECodecEncoder::updateDerivationDescription( + DcmItem *dataset, + double ratio) +{ + char buf[32]; + + // create new Derivation Description + OFString derivationDescription = "Lossless RLE compression, compression ratio "; + OFStandard::ftoa(buf, sizeof(buf), ratio, OFStandard::ftoa_uppercase, 0, 5); + derivationDescription += buf; + + // append old Derivation Description, if any + const char *oldDerivation = NULL; + if ((dataset->findAndGetString(DCM_DerivationDescription, oldDerivation)).good() && oldDerivation) + { + derivationDescription += " ["; + derivationDescription += oldDerivation; + derivationDescription += "]"; + if (derivationDescription.length() > 1024) + { + // ST is limited to 1024 characters, cut off tail + derivationDescription.erase(1020); + derivationDescription += "...]"; + } + } + + return dataset->putAndInsertString(DCM_DerivationDescription, derivationDescription.c_str()); +} + + +OFCondition DcmRLECodecEncoder::determineDecompressedColorModel( + const DcmRepresentationParameter * /* fromParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmCodecParameter * /* cp */, + DcmItem * /* dataset */, + OFString & /* decompressedColorModel */) const +{ + return EC_IllegalCall; +} diff --git a/dcmdata/libsrc/dcrlecp.cc b/dcmdata/libsrc/dcrlecp.cc new file mode 100644 index 00000000..192a98af --- /dev/null +++ b/dcmdata/libsrc/dcrlecp.cc @@ -0,0 +1,63 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: codec parameter for RLE + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcrlecp.h" + +DcmRLECodecParameter::DcmRLECodecParameter( + OFBool pCreateSOPInstanceUID, + Uint32 pFragmentSize, + OFBool pCreateOffsetTable, + OFBool pConvertToSC, + OFBool pReverseDecompressionByteOrder) +: DcmCodecParameter() +, fragmentSize(pFragmentSize) +, createOffsetTable(pCreateOffsetTable) +, convertToSC(pConvertToSC) +, createInstanceUID(pCreateSOPInstanceUID) +, reverseDecompressionByteOrder(pReverseDecompressionByteOrder) +{ +} + + +DcmRLECodecParameter::DcmRLECodecParameter(const DcmRLECodecParameter& arg) +: DcmCodecParameter(arg) +, fragmentSize(arg.fragmentSize) +, createOffsetTable(arg.createOffsetTable) +, convertToSC(arg.convertToSC) +, createInstanceUID(arg.createInstanceUID) +, reverseDecompressionByteOrder(arg.reverseDecompressionByteOrder) +{ +} + +DcmRLECodecParameter::~DcmRLECodecParameter() +{ +} + +DcmCodecParameter *DcmRLECodecParameter::clone() const +{ + return new DcmRLECodecParameter(*this); +} + +const char *DcmRLECodecParameter::className() const +{ + return "DcmRLECodecParameter"; +} diff --git a/dcmdata/libsrc/dcrledrg.cc b/dcmdata/libsrc/dcrledrg.cc new file mode 100644 index 00000000..439efd48 --- /dev/null +++ b/dcmdata/libsrc/dcrledrg.cc @@ -0,0 +1,68 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers RLE decoder. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcrledrg.h" + +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecStruct */ +#include "dcmtk/dcmdata/dcrleccd.h" /* for class DcmRLECodecDecoder */ +#include "dcmtk/dcmdata/dcrlecp.h" /* for class DcmRLECodecParameter */ + +// initialization of static members +OFBool DcmRLEDecoderRegistration::registered = OFFalse; +DcmRLECodecParameter *DcmRLEDecoderRegistration::cp = NULL; +DcmRLECodecDecoder *DcmRLEDecoderRegistration::codec = NULL; + +void DcmRLEDecoderRegistration::registerCodecs( + OFBool pCreateSOPInstanceUID, + OFBool pReverseDecompressionByteOrder) +{ + if (! registered) + { + cp = new DcmRLECodecParameter( + pCreateSOPInstanceUID, + 0, OFTrue, OFFalse, + pReverseDecompressionByteOrder); + + if (cp) + { + codec = new DcmRLECodecDecoder(); + if (codec) DcmCodecList::registerCodec(codec, NULL, cp); + registered = OFTrue; + } + } +} + +void DcmRLEDecoderRegistration::cleanup() +{ + if (registered) + { + DcmCodecList::deregisterCodec(codec); + delete codec; + delete cp; + registered = OFFalse; +#ifdef DEBUG + // not needed but useful for debugging purposes + codec = NULL; + cp = NULL; +#endif + } +} diff --git a/dcmdata/libsrc/dcrleerg.cc b/dcmdata/libsrc/dcrleerg.cc new file mode 100644 index 00000000..c86d1b4e --- /dev/null +++ b/dcmdata/libsrc/dcrleerg.cc @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers RLE encoder. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcrleerg.h" + +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecStruct */ +#include "dcmtk/dcmdata/dcrlecce.h" /* for class DcmRLECodecEncoder */ +#include "dcmtk/dcmdata/dcrlecp.h" /* for class DcmRLECodecParameter */ + +// initialization of static members +OFBool DcmRLEEncoderRegistration::registered = OFFalse; +DcmRLECodecParameter *DcmRLEEncoderRegistration::cp = NULL; +DcmRLECodecEncoder *DcmRLEEncoderRegistration::codec = NULL; + +void DcmRLEEncoderRegistration::registerCodecs( + OFBool pCreateSOPInstanceUID, + Uint32 pFragmentSize, + OFBool pCreateOffsetTable, + OFBool pConvertToSC) +{ + if (! registered) + { + cp = new DcmRLECodecParameter( + pCreateSOPInstanceUID, + pFragmentSize, + pCreateOffsetTable, + pConvertToSC); + + if (cp) + { + codec = new DcmRLECodecEncoder(); + if (codec) DcmCodecList::registerCodec(codec, NULL, cp); + registered = OFTrue; + } + } +} + +void DcmRLEEncoderRegistration::cleanup() +{ + if (registered) + { + DcmCodecList::deregisterCodec(codec); + delete codec; + delete cp; + registered = OFFalse; +#ifdef DEBUG + // not needed but useful for debugging purposes + codec = NULL; + cp = NULL; +#endif + + } +} diff --git a/dcmdata/libsrc/dcrlerp.cc b/dcmdata/libsrc/dcrlerp.cc new file mode 100644 index 00000000..a3cd50ed --- /dev/null +++ b/dcmdata/libsrc/dcrlerp.cc @@ -0,0 +1,59 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: representation parameter for RLE + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcrlerp.h" + + +DcmRLERepresentationParameter::DcmRLERepresentationParameter() +: DcmRepresentationParameter() +{ +} + +DcmRLERepresentationParameter::DcmRLERepresentationParameter(const DcmRLERepresentationParameter& arg) +: DcmRepresentationParameter(arg) +{ +} + +DcmRLERepresentationParameter::~DcmRLERepresentationParameter() +{ +} + +DcmRepresentationParameter *DcmRLERepresentationParameter::clone() const +{ + return new DcmRLERepresentationParameter(*this); +} + +const char *DcmRLERepresentationParameter::className() const +{ + return "DcmRLERepresentationParameter"; +} + +OFBool DcmRLERepresentationParameter::operator==(const DcmRepresentationParameter &arg) const +{ + const char *argname = arg.className(); + if (argname) + { + OFString argstring(argname); + if (argstring == className()) return OFTrue; + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcsequen.cc b/dcmdata/libsrc/dcsequen.cc new file mode 100644 index 00000000..af8f7dbe --- /dev/null +++ b/dcmdata/libsrc/dcsequen.cc @@ -0,0 +1,1523 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmSequenceOfItems + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcdirrec.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcistrma.h" /* for class DcmInputStream */ +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ + + +DcmSequenceOfItems::DcmSequenceOfItems(const DcmTag &tag) +: DcmElement(tag, 0), + itemList(new DcmList), + lastItemComplete(OFTrue), + fStartPosition(0), + readAsUN_(OFFalse) +{ +} + + +// ******************************** + + +DcmSequenceOfItems::DcmSequenceOfItems( + const DcmTag &tag, + const Uint32 len, + OFBool readAsUN) +: DcmElement(tag, len), + itemList(new DcmList), + lastItemComplete(OFTrue), + fStartPosition(0), + readAsUN_(readAsUN) +{ +} + + +// ******************************** + + +DcmSequenceOfItems::DcmSequenceOfItems(const DcmSequenceOfItems &old) + : DcmElement(old), + itemList(new DcmList), + lastItemComplete(old.lastItemComplete), + fStartPosition(old.fStartPosition), + readAsUN_(old.readAsUN_) +{ + if (!old.itemList->empty()) + { + itemList->seek(ELP_first); + old.itemList->seek(ELP_first); + do + { + DcmObject *dO = old.itemList->get()->clone(); + itemList->insert(dO, ELP_next); + // remember the parent + dO->setParent(this); + } while (old.itemList->seek(ELP_next)); + } +} + + +// ******************************** + + +DcmSequenceOfItems::~DcmSequenceOfItems() +{ + itemList->deleteAllElements(); + delete itemList; +} + + +// ******************************** + + +DcmSequenceOfItems &DcmSequenceOfItems::operator=(const DcmSequenceOfItems &obj) +{ + if (this != &obj) + { + DcmElement::operator=(obj); + lastItemComplete = obj.lastItemComplete; + fStartPosition = obj.fStartPosition; + readAsUN_ = obj.readAsUN_; + + // DcmList has no copy constructor. Need to copy ourselves. + DcmList *newList = new DcmList; + if (newList) + { + switch (obj.ident()) + { + case EVR_SQ: + case EVR_pixelSQ: + case EVR_fileFormat: + if (!obj.itemList->empty()) + { + DcmObject *oldDO; + DcmObject *newDO; + newList->seek(ELP_first); + obj.itemList->seek(ELP_first); + do { + oldDO = obj.itemList->get(); + switch (oldDO->ident()) + { + case EVR_item: + newDO = new DcmItem(*OFstatic_cast(DcmItem *, oldDO)); + break; + case EVR_pixelItem: + newDO = new DcmPixelItem(*OFstatic_cast(DcmPixelItem *, oldDO)); + break; + case EVR_metainfo: + newDO = new DcmMetaInfo(*OFstatic_cast(DcmMetaInfo *, oldDO)); + break; + case EVR_dataset: + newDO = new DcmDataset(*OFstatic_cast(DcmDataset *, oldDO)); + break; + default: + newDO = new DcmItem(oldDO->getTag()); + DCMDATA_WARN("DcmSequenceOfItems: Non-item element " << oldDO->getTag() << " found"); + break; + } + newList->insert(newDO, ELP_next); + // remember the parent + newDO->setParent(this); + } while (obj.itemList->seek(ELP_next)); + } + break; + default: + // wrong use of assignment operator, should never happen + break; + } + } + // be sure to clear memory of former elements not in use any more... + itemList->deleteAllElements(); + // ...and delete the list itself + delete itemList; + itemList = newList; + } + return *this; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmSequenceOfItems &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +int DcmSequenceOfItems::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmSequenceOfItems* myThis = NULL; + DcmSequenceOfItems* myRhs = NULL; + myThis = OFconst_cast(DcmSequenceOfItems*, this); + myRhs = OFstatic_cast(DcmSequenceOfItems*, OFconst_cast(DcmElement*, &rhs)); + + /* check number of items */ + unsigned long rhsNumItems = myRhs->card(); + unsigned long thisNumItems = myThis->card(); + if (thisNumItems < rhsNumItems) + { + return -1; + } + else if (thisNumItems > rhsNumItems) + { + return 1; + } + + /* iterate over all items and test equality */ + for (unsigned long count = 0; count < thisNumItems; count++) + { + DcmItem* val = myThis->getItem(count); + if (val) + { + DcmItem* rhsVal = myRhs->getItem(count); + if (rhsVal) + { + result = val->compare(*rhsVal); + if (result != 0) + { + return result; + } + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::checkValue(const OFString &cardinality, + const OFBool /*oldFormat*/) +{ + /* check cardinality (number of items) only */ + return DcmElement::checkVM(this->card(), cardinality); +} + + +unsigned long DcmSequenceOfItems::getVM() +{ + return 1; +} + + +unsigned long DcmSequenceOfItems::getNumberOfValues() +{ + return itemList->card(); +} + + +unsigned long DcmSequenceOfItems::card() const +{ + return itemList->card(); +} + + +// ******************************** + + +void DcmSequenceOfItems::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + /* print sequence start line */ + if (flags & DCMTypes::PF_showTreeStructure) + { + /* empty text */ + printInfoLine(out, flags, level); + /* print sequence content */ + if (!itemList->empty()) + { + /* print all items contained in the sequence */ + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (itemList->seek(ELP_next)); + } + } else { + OFOStringStream oss; + oss << "(Sequence with "; + if (getLengthField() == DCM_UndefinedLength) + oss << "undefined"; + else + oss << "explicit"; + oss << " length #=" << card() << ")" << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + printInfoLine(out, flags, level, tmpString); + OFSTRINGSTREAM_FREESTR(tmpString) + /* print sequence content */ + if (!itemList->empty()) + { + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + dO->print(out, flags, level + 1, pixelFileName, pixelCounter); + } while (itemList->seek(ELP_next)); + } + /* print sequence end line */ + DcmTag delimItemTag(DCM_SequenceDelimitationItemTag); + if (getLengthField() == DCM_UndefinedLength) + printInfoLine(out, flags, level, "(SequenceDelimitationItem)", &delimItemTag); + else + printInfoLine(out, flags, level, "(SequenceDelimitationItem for re-encod.)", &delimItemTag); + } +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + OFCondition l_error = EC_Normal; + if (flags & DCMTypes::XF_useNativeModel) + { + /* use common method from DcmElement to write start tag */ + DcmElement::writeXMLStartTag(out, flags); + /* write sequence content */ + if (!itemList->empty()) + { + unsigned long itemNo = 1; + /* write content of all children */ + DcmObject *dO; + itemList->seek(ELP_first); + do + { + out << "" << OFendl; + dO = itemList->get(); + l_error = dO->writeXML(out, flags); + /* exit loop in case of error */ + if (l_error.bad()) break; + out << "" << OFendl; + } while (itemList->seek(ELP_next)); + } + if (l_error.good()) + { + /* use common method from DcmElement to write end tag */ + DcmElement::writeXMLEndTag(out, flags); + } + } else { + OFString xmlString; + DcmVR vr(getTag().getVR()); + /* XML start tag for "sequence" */ + out << "" << OFendl; + /* write sequence content */ + if (!itemList->empty()) + { + /* write content of all children */ + DcmObject *dO; + itemList->seek(ELP_first); + do + { + dO = itemList->get(); + l_error = dO->writeXML(out, flags); + } while (l_error.good() && itemList->seek(ELP_next)); + } + if (l_error.good()) + { + /* XML end tag for "sequence" */ + out << "" << OFendl; + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::writeJson(STD_NAMESPACE ostream& out, + DcmJsonFormat &format) +{ + // use common method from DcmElement to write opener + DcmElement::writeJsonOpener(out, format); + OFCondition status = EC_Normal; + // write sequence content + if (!itemList->empty()) + { + format.printValuePrefix(out); + itemList->seek(ELP_first); + status = itemList->get()->writeJson(out, format); + while (status.good() && itemList->seek(ELP_next)) + { + format.printNextArrayElementPrefix(out); + status = itemList->get()->writeJson(out, format); + } + format.printValueSuffix(out); + } + DcmElement::writeJsonCloser(out, format); + return status; +} + + +// ******************************** + + +OFBool DcmSequenceOfItems::canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax oldXfer) +{ + OFBool canWrite = OFTrue; + + if (newXfer == EXS_Unknown) + canWrite = OFFalse; + else if (!itemList->empty()) + { + DcmObject *dO; + itemList->seek(ELP_first); + do + { + dO = itemList->get(); + canWrite = dO -> canWriteXfer(newXfer, oldXfer); + } while (itemList->seek(ELP_next) && canWrite); + } + + return canWrite; +} + + +// ******************************** + + +Uint32 DcmSequenceOfItems::calcElementLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + /* Get length of sequence header + sequence content (will call DcmSequenceOfItems::getLength()) */ + Uint32 seqlen = DcmElement::calcElementLength(xfer, enctype); + if (seqlen == DCM_UndefinedLength) + return DCM_UndefinedLength; + if (enctype == EET_UndefinedLength) + { + if (OFStandard::check32BitAddOverflow(seqlen, 8)) + return DCM_UndefinedLength; + else + seqlen += 8; // for Sequence Delimitation Tag + } + return seqlen; +} + + +// ******************************** + + +Uint32 DcmSequenceOfItems::getLength(const E_TransferSyntax xfer, + const E_EncodingType enctype) +{ + Uint32 seqlen = 0; + Uint32 sublen = 0; + if (!itemList->empty()) + { + DcmItem *dI; + itemList->seek(ELP_first); + do { + dI = OFstatic_cast(DcmItem *, itemList->get()); + sublen = dI->calcElementLength(xfer, enctype); + /* explicit length: be sure that total size of contained elements fits into sequence's + 32 Bit length field. If not, switch encoding automatically to undefined + length for this sequence. Nevertheless, any contained items will be + written with explicit length if possible. + */ + if ( (enctype == EET_ExplicitLength) && OFStandard::check32BitAddOverflow(seqlen, sublen) ) + { + if (dcmWriteOversizedSeqsAndItemsUndefined.get()) + { + DCMDATA_WARN("DcmSequenceOfItems: Explicit length of sequence " << getTagName() << " " << getTag() + << " exceeds 32-bit length field, trying to treat it as undefined length instead"); + } + else + { + DCMDATA_WARN("DcmSequenceOfItems: Explicit length of sequence " << getTagName() << " " << getTag() + << " exceeds 32-bit length field, writing with explicit length will not be possible"); + errorFlag = EC_SeqOrItemContentOverflow; + } + return DCM_UndefinedLength; + } + seqlen += sublen; + } while (itemList->seek(ELP_next)); + } + return seqlen; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::computeGroupLengthAndPadding(const E_GrpLenEncoding glenc, + const E_PaddingEncoding padenc, + const E_TransferSyntax xfer, + const E_EncodingType enctype, + const Uint32 padlen, + const Uint32 subPadlen, + Uint32 instanceLength) +{ + OFCondition l_error = EC_Normal; + + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + DcmItem *dO = OFstatic_cast(DcmItem *, itemList->get()); + l_error = dO->computeGroupLengthAndPadding + (glenc, padenc, xfer, enctype, padlen, subPadlen, instanceLength); + } while (l_error.good() && itemList->seek(ELP_next)); + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::makeSubObject(DcmObject *&subObject, + const DcmTag &newTag, + const Uint32 newLength) +{ + OFCondition l_error = EC_Normal; + DcmItem *subItem = NULL; + + switch (newTag.getEVR()) + { + case EVR_na: + if (newTag.getXTag() == DCM_Item) + { + if (getTag().getXTag() == DCM_DirectoryRecordSequence) + subItem = new DcmDirectoryRecord(newTag, newLength); + else + subItem = new DcmItem(newTag, newLength); + } + else if (newTag.getXTag() == DCM_SequenceDelimitationItem) + l_error = EC_SequEnd; + else if (newTag.getXTag() == DCM_ItemDelimitationItem) + l_error = EC_ItemEnd; + else + l_error = EC_InvalidTag; + break; + + default: + subItem = new DcmItem(newTag, newLength); + l_error = EC_CorruptedData; + break; + } + subObject = subItem; + return l_error; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::readTagAndLength(DcmInputStream &inStream, + const E_TransferSyntax xfer, + DcmTag &tag, + Uint32 &length) +{ + Uint16 groupTag = 0xffff; + Uint16 elementTag = 0xffff; + + OFCondition l_error = EC_Normal; + if (inStream.avail() < 8) + l_error = EC_StreamNotifyClient; + + if (l_error.good()) + { + DcmXfer iXfer(xfer); + const E_ByteOrder iByteOrder = iXfer.getByteOrder(); + if (iByteOrder == EBO_unknown) + return EC_IllegalCall; + inStream.mark(); + inStream.read(&groupTag, 2); + inStream.read(&elementTag, 2); + swapIfNecessary(gLocalByteOrder, iByteOrder, &groupTag, 2, 2); + swapIfNecessary(gLocalByteOrder, iByteOrder, &elementTag, 2, 2); + // tag has been read + + DcmTag newTag(groupTag, elementTag); + + Uint32 valueLength = 0; + inStream.read(&valueLength, 4); + swapIfNecessary(gLocalByteOrder, iByteOrder, &valueLength, 4, 4); + if ((valueLength & 1) && (valueLength != DCM_UndefinedLength)) + { + DCMDATA_WARN("DcmSequenceOfItems: Length of item in sequence " + << getTagName() << " " << getTag() << " is odd"); + } + length = valueLength; + tag = newTag; // return value: assignment-operator + } + + if (l_error.bad()) + DCMDATA_TRACE("DcmSequenceOfItems::readTagAndLength() returns error = " << l_error.text()); + return l_error; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::readSubItem(DcmInputStream &inStream, + const DcmTag &newTag, + const Uint32 newLength, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + // For DcmSequenceOfItems, subObject is always inherited from DcmItem. + // For DcmPixelSequence, subObject is always inherited from DcmPixelItem. + DcmObject *subObject = NULL; + OFCondition l_error = makeSubObject(subObject, newTag, newLength); + if (l_error.good() && (subObject != NULL)) + { + // inStream.UnsetPutbackMark(); // not needed anymore with new stream architecture + itemList->insert(subObject, ELP_next); + // dump some information if required + DCMDATA_TRACE("DcmSequenceOfItems::readSubItem() Sub Item " << newTag << " inserted"); + // remember the parent (i.e. the surrounding sequence) + subObject->setParent(this); + // read sub-item + l_error = subObject->read(inStream, xfer, glenc, maxReadLength); + // prevent subObject from getting deleted + return l_error; + } + else if (l_error == EC_InvalidTag) // try to recover parsing + { + inStream.putback(); + // dump some information if required + DCMDATA_WARN("DcmSequenceOfItems: Parse error in sequence " << getTag() << ", found " + << newTag << " instead of item tag " << DCM_Item); + } + else if (l_error != EC_SequEnd) + { + // dump some information if required + if (dcmIgnoreParsingErrors.get() || (dcmReplaceWrongDelimitationItem.get() && (l_error == EC_ItemEnd))) + { + DCMDATA_WARN("DcmSequenceOfItems: Parse error in sequence " << getTag() << ", found " + << newTag << " instead of sequence delimiter " << DCM_SequenceDelimitationItem); + } else { + DCMDATA_ERROR("DcmSequenceOfItems: Parse error in sequence " << getTag() << ", found " + << newTag << " instead of sequence delimiter " << DCM_SequenceDelimitationItem); + } + // some systems use the wrong delimitation item at the end of a sequence + if (dcmReplaceWrongDelimitationItem.get() && (l_error == EC_ItemEnd)) + { + DCMDATA_DEBUG("DcmSequenceOfItems::readSubItem() replacing wrong item delimiter " + << DCM_ItemDelimitationItem << " by sequence delimiter " + << DCM_SequenceDelimitationItem << " because it is expected here"); + l_error = EC_SequEnd; + } else { + DCMDATA_DEBUG("DcmSequenceOfItems::readSubItem() cannot create Sub Item " << newTag); + // treat this incorrect encoding as an error + if (!dcmIgnoreParsingErrors.get()) + l_error = EC_SequDelimitationItemMissing; + } + } else { + // inStream.UnsetPutbackMark(); // not needed anymore with new stream architecture + } + + if (subObject) + delete subObject; // only executed if makeSubObject() has returned an error + // dump some information if required + DCMDATA_TRACE("DcmSequenceOfItems::readSubItem() returns error = " << l_error.text()); + return l_error; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::read(DcmInputStream &inStream, + const E_TransferSyntax xfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + errorFlag = inStream.status(); + + if (errorFlag.good() && inStream.eos()) + errorFlag = EC_EndOfStream; + else if (errorFlag.good() && (getTransferState() != ERW_ready)) + { + if (getTransferState() == ERW_init) + { + fStartPosition = inStream.tell(); // Position Sequence-Value + setTransferState(ERW_inWork); + } + + E_TransferSyntax readxfer = readAsUN_ ? EXS_LittleEndianImplicit : xfer; + + itemList->seek(ELP_last); // append data at end + while (inStream.good() && ((getTransferredBytes() < getLengthField()) || !lastItemComplete)) + { + DcmTag newTag; + Uint32 newValueLength = 0; + + if (lastItemComplete) + { + if (inStream.eos()) + { + DCMDATA_WARN("DcmSequenceOfItems: Reached end of stream before the end of sequence " + << getTagName() << " " << getTag()); + if (dcmIgnoreParsingErrors.get()) + { + /* "Invent" a SequenceDelimitationItem. + * This will be turned into EC_Normal below. */ + errorFlag = EC_SequEnd; + } + else + errorFlag = EC_SequDelimitationItemMissing; + break; + } + + errorFlag = readTagAndLength(inStream, readxfer, newTag, newValueLength); + + if (errorFlag.bad()) + break; // finish while loop + else + incTransferredBytes(8); + + lastItemComplete = OFFalse; + errorFlag = readSubItem(inStream, newTag, newValueLength, readxfer, glenc, maxReadLength); + if (errorFlag.good()) + lastItemComplete = OFTrue; + } + else + { + errorFlag = itemList->get()->read(inStream, readxfer, glenc, maxReadLength); + if (errorFlag.good()) + lastItemComplete = OFTrue; + } + setTransferredBytes(OFstatic_cast(Uint32, inStream.tell() - fStartPosition)); + + if (errorFlag.bad()) + break; + + } //while + if (((getTransferredBytes() < getLengthField()) || !lastItemComplete) && errorFlag.good()) + errorFlag = EC_StreamNotifyClient; + } // else errorFlag + + if (errorFlag == EC_SequEnd) + errorFlag = EC_Normal; + if (errorFlag.good()) + setTransferState(ERW_ready); // sequence is complete + } + // dump information if required + DCMDATA_TRACE("DcmSequenceOfItems::read() returns error = " << errorFlag.text()); + return errorFlag; +} + + +// ******************************** + +OFCondition DcmSequenceOfItems::write(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + errorFlag = outStream.status(); + if (errorFlag.good() && (getTransferState() != ERW_ready)) + { + if (getTransferState() == ERW_init) + { + /* first compare with DCM_TagInfoLength (12). If there is not enough space + * in the buffer, check if the buffer is still sufficient for the requirements + * of this element, which may need only 8 instead of 12 bytes. + */ + if ((outStream.avail() >= OFstatic_cast(offile_off_t, DCM_TagInfoLength)) || + (outStream.avail() >= OFstatic_cast(offile_off_t, getTagAndLengthSize(oxfer)))) + { + if (enctype == EET_ExplicitLength) + setLengthField(getLength(oxfer, enctype)); + else + setLengthField(DCM_UndefinedLength); + if (errorFlag == EC_SeqOrItemContentOverflow) + return EC_SeqOrItemContentOverflow; + Uint32 written_bytes = 0; + errorFlag = writeTagAndLength(outStream, oxfer, written_bytes); + if (errorFlag.good()) + { + setTransferState(ERW_inWork); + itemList->seek(ELP_first); + } + } else + errorFlag = EC_StreamNotifyClient; + } + if (getTransferState() == ERW_inWork) + { + // itemList->get() can be NULL if buffer was full after + // writing the last item but before writing the sequence delimitation. + if (!itemList->empty() && (itemList->get() != NULL)) + { + DcmObject *dO; + do + { + dO = itemList->get(); + if (dO->transferState() != ERW_ready) + errorFlag = dO->write(outStream, oxfer, enctype, wcache); + } while (errorFlag.good() && itemList->seek(ELP_next)); + } + if (errorFlag.good()) + { + setTransferState(ERW_ready); + if (getLengthField() == DCM_UndefinedLength) + { + if (outStream.avail() >= 8) + { + // write sequence delimitation item + const DcmTag delim(DCM_SequenceDelimitationItemTag); + errorFlag = writeTag(outStream, delim, oxfer); + Uint32 delimLen = 0L; + outStream.write(&delimLen, 4); // 4 bytes length + } else { + // the complete sequence is written but it + // is not possible to write the delimitation item into the buffer. + errorFlag = EC_StreamNotifyClient; + setTransferState(ERW_inWork); + } + } + } + } + } + } + return errorFlag; +} + +// ******************************** + + +OFCondition DcmSequenceOfItems::writeTagAndVR(DcmOutputStream &outStream, + const DcmTag &tag, + DcmEVR vr, + const E_TransferSyntax oxfer) +{ + OFCondition l_error = outStream.status(); + if (l_error.good()) + { + /* write the tag information (a total of 4 bytes, group number and element */ + /* number) to the stream. Mind the transfer syntax's byte ordering. */ + l_error = writeTag(outStream, tag, oxfer); + /* create an object which represents the transfer syntax */ + DcmXfer oxferSyn(oxfer); + /* if the transfer syntax is one with explicit value representation */ + /* this value's data type also has to be written to the stream. Do so */ + /* and also write the length information to the stream. */ + if (oxferSyn.isExplicitVR()) + { + /* Create an object that represents this object's data type */ + DcmVR myvr(vr); + /* get name of data type */ + const char *vrname = myvr.getValidVRName(); + /* write data type name to the stream (a total of 2 bytes) */ + outStream.write(vrname, 2); + /* create another data type object on the basis of the above created object */ + DcmVR outvr(myvr.getValidEVR()); + /* in case we are dealing with a transfer syntax with explicit VR (see if above) */ + /* and the actual VR uses extended length encoding (see DICOM standard (year 2000) */ + /* part 5, section 7.1.2) (or the corresponding section in a later version of the */ + /* standard) we have to add 2 reserved bytes (set to a value of 00H) to the data */ + /* type field and the actual length field is 4 bytes wide. Write the corresponding */ + /* information to the stream. */ + if (outvr.usesExtendedLengthEncoding()) + { + Uint16 reserved = 0; + outStream.write(&reserved, 2); // write 2 reserved bytes to stream + } + } + } + /* return result */ + return l_error; +} + + +OFCondition DcmSequenceOfItems::writeSignatureFormat(DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + errorFlag = outStream.status(); + if (errorFlag.good() && (getTransferState() != ERW_ready)) + { + if (getTransferState() == ERW_init) + { + /* first compare with DCM_TagInfoLength (12). If there is not enough space + * in the buffer, check if the buffer is still sufficient for the requirements + * of this element, which may need only 8 instead of 12 bytes. + */ + if ((outStream.avail() >= OFstatic_cast(offile_off_t, DCM_TagInfoLength)) || + (outStream.avail() >= OFstatic_cast(offile_off_t, getTagAndLengthSize(oxfer)))) + { + if (enctype == EET_ExplicitLength) + setLengthField(getLength(oxfer, enctype)); + else + setLengthField(DCM_UndefinedLength); + errorFlag = writeTagAndVR(outStream, getTag(), getVR(), oxfer); + /* we don't write the sequence length */ + if (errorFlag.good()) + { + setTransferState(ERW_inWork); + itemList->seek(ELP_first); + } + } else + errorFlag = EC_StreamNotifyClient; + } + if (getTransferState() == ERW_inWork) + { + // itemList->get() can be NULL if buffer was full after + // writing the last item but before writing the sequence delimitation. + if (!itemList->empty() && (itemList->get() != NULL)) + { + DcmObject *dO; + do { + dO = itemList->get(); + if (dO->transferState() != ERW_ready) + errorFlag = dO->writeSignatureFormat(outStream, oxfer, enctype, wcache); + } while (errorFlag.good() && itemList->seek(ELP_next)); + } + if (errorFlag.good()) + { + setTransferState(ERW_ready); + /* we always write a sequence delimitation item tag, but no length */ + if (outStream.avail() >= 4) + { + // write sequence delimitation item + const DcmTag delim(DCM_SequenceDelimitationItemTag); + errorFlag = writeTag(outStream, delim, oxfer); + } else { + // Every subelement of the item was written but it + // is not possible to write the delimitation item + // into the buffer. + setTransferState(ERW_inWork); + errorFlag = EC_StreamNotifyClient; + } + } + } + } + } + return errorFlag; +} + + +// ******************************** + + +void DcmSequenceOfItems::transferInit() +{ + DcmObject::transferInit(); + fStartPosition = 0; + lastItemComplete = OFTrue; + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + itemList->get()->transferInit(); + } while (itemList->seek(ELP_next)); + } +} + + +// ******************************** + + +void DcmSequenceOfItems::transferEnd() +{ + DcmObject::transferEnd(); + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + itemList->get()->transferEnd(); + } while (itemList->seek(ELP_next)); + } +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::prepend(DcmItem *item) +{ + errorFlag = EC_Normal; + if (item != NULL) + { + itemList->prepend(item); + // remember the parent (i.e. the surrounding sequence) + item->setParent(this); + } else + errorFlag = EC_IllegalCall; + + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::insert(DcmItem *item, + unsigned long where, + OFBool before) +{ + errorFlag = EC_Normal; + if (item != NULL) + { + itemList->seek_to(where); + // insert before or after "where" + E_ListPos whichSide = (before) ? (ELP_prev) : (ELP_next); + itemList->insert(item, whichSide); + if (where == DCM_EndOfListIndex) + { + DCMDATA_TRACE("DcmSequenceOfItems::insert() Item inserted " + << (before ? "before" : "after") << " last position"); + } else { + DCMDATA_TRACE("DcmSequenceOfItems::insert() Item inserted " + << (before ? "before" : "after") << " position " << where); + } + // check whether the new item already has a parent + if (item->getParent() != NULL) + { + DCMDATA_DEBUG("DcmSequenceOfItems::insert() Item already has a parent: " + << item->getParent()->getTag() << " VR=" << DcmVR(item->getParent()->getVR()).getVRName()); + } + // remember the parent (i.e. the surrounding sequence) + item->setParent(this); + } else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::insertAtCurrentPos(DcmItem *item, + OFBool before) +{ + errorFlag = EC_Normal; + if (item != NULL) + { + // insert before or after current position + E_ListPos whichSide = (before) ? (ELP_prev) : (ELP_next); + itemList->insert(item, whichSide); + // check whether the new item already has a parent + if (item->getParent() != NULL) + { + DCMDATA_DEBUG("DcmSequenceOfItems::insertAtCurrentPos() Item already has a parent: " + << item->getParent()->getTag() << " VR=" << DcmVR(item->getParent()->getVR()).getVRName()); + } + // remember the parent (i.e. the surrounding sequence) + item->setParent(this); + } else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::append(DcmItem *item) +{ + errorFlag = EC_Normal; + if (item != NULL) + { + itemList->append(item); + // check whether the new item already has a parent + if (item->getParent() != NULL) + { + DCMDATA_DEBUG("DcmSequenceOfItems::append() Item already has a parent: " + << item->getParent()->getTag() << " VR=" << DcmVR(item->getParent()->getVR()).getVRName()); + } + // remember the parent (i.e. the surrounding sequence) + item->setParent(this); + } else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +DcmItem* DcmSequenceOfItems::getItem(const unsigned long num) +{ + errorFlag = EC_Normal; + DcmItem *item; + item = OFstatic_cast(DcmItem *, itemList->seek_to(num)); // read item from list + if (item == NULL) + errorFlag = EC_IllegalCall; + return item; +} + + +// ******************************** + + +DcmObject *DcmSequenceOfItems::nextInContainer(const DcmObject *obj) +{ + if (!obj) + return itemList->get(ELP_first); + else + { + if (itemList->get() != obj) + { + for (DcmObject *search_obj = itemList -> seek(ELP_first); + search_obj && (search_obj != obj); + search_obj = itemList -> seek(ELP_next) + ) + { /* do nothing */ } + } + return itemList -> seek(ELP_next); + } +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::nextObject(DcmStack &stack, + const OFBool intoSub) +{ + OFCondition l_error = EC_Normal; + DcmObject *container = NULL; + DcmObject *obj = NULL; + DcmObject *result = NULL; + OFBool examSub = intoSub; + + if (stack.empty()) + { + stack.push(this); + examSub = OFTrue; + } + + obj = stack.top(); + if (obj->isLeaf() || !intoSub) + { + stack.pop(); + if (stack.card() > 0) + { + container = stack.top(); + result = container -> nextInContainer(obj); + } + } else if (examSub) + result = obj -> nextInContainer(NULL); + + if (result) + stack.push(result); + else if (intoSub) + l_error = nextUp(stack); + else + l_error = EC_SequEnd; + + return l_error; +} + + +// ******************************** + + +DcmItem *DcmSequenceOfItems::remove(const unsigned long num) +{ + errorFlag = EC_Normal; + DcmItem *item; + item = OFstatic_cast(DcmItem *, itemList->seek_to(num)); // read item from list + if (item != NULL) + { + itemList->remove(); + item->setParent(NULL); // forget about the parent + } else + errorFlag = EC_IllegalCall; + return item; +} + + +// ******************************** + + +DcmItem *DcmSequenceOfItems::remove(DcmItem *item) +{ + DcmItem *retItem = NULL; + errorFlag = EC_IllegalCall; + if (!itemList->empty() && (item != NULL)) + { + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + if (dO == item) + { + itemList->remove(); // removes element from list but does not delete it + item->setParent(NULL); // forget about the parent + errorFlag = EC_Normal; + break; + } + } while (itemList->seek(ELP_next)); + } + if (errorFlag == EC_IllegalCall) + retItem = NULL; + else + retItem = item; + return retItem; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::clear() +{ + errorFlag = EC_Normal; + // remove all items from sequence and delete them from memory + itemList->deleteAllElements(); + setLengthField(0); + return errorFlag; +} + + +OFBool DcmSequenceOfItems::isEmpty(const OFBool /*normalize*/) +{ + return itemList->empty(); +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::verify(const OFBool autocorrect) +{ + errorFlag = EC_Normal; + if (!itemList->empty()) + { + DcmObject *dO; + itemList->seek(ELP_first); + do { + dO = itemList->get(); + if (dO->verify(autocorrect).bad()) + errorFlag = EC_CorruptedData; + } while (itemList->seek(ELP_next)); + } + if (autocorrect == OFTrue) + setLengthField(getLength()); + + return errorFlag; +} + + +/* + * precondition: itemList not empty. + * result: + * - element pointer on resultStack if return value is EC_Normal + * - unmodified resultStack if return value is EC_TagNotFound + * continue search: push pointer to sub-element onto resultStack and start sub-search + */ + +OFCondition DcmSequenceOfItems::searchSubFromHere(const DcmTagKey &tag, + DcmStack &resultStack, + const OFBool searchIntoSub) +{ + DcmObject *dO; + OFCondition l_error = EC_TagNotFound; + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + dO = itemList->get(); + if (searchIntoSub) + { + resultStack.push(dO); + if (tag == dO->getTag()) + l_error = EC_Normal; + else + l_error = dO->search(tag, resultStack, ESM_fromStackTop, OFTrue); + if (l_error.bad()) + resultStack.pop(); + } else { + if (tag == dO->getTag()) + { + resultStack.push(dO); + l_error = EC_Normal; + } + } + } while (l_error.bad() && itemList->seek(ELP_next)); + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::search(const DcmTagKey &tag, + DcmStack &resultStack, + E_SearchMode mode, + OFBool searchIntoSub) +{ + DcmObject *dO = NULL; + OFCondition l_error = EC_TagNotFound; + if ((mode == ESM_afterStackTop) && (resultStack.top() == this)) + { + l_error = searchSubFromHere(tag, resultStack, searchIntoSub); + } + else if (!itemList->empty()) + { + if ((mode == ESM_fromHere) || resultStack.empty()) + { + resultStack.clear(); + l_error = searchSubFromHere(tag, resultStack, searchIntoSub); + } + else if (mode == ESM_fromStackTop) + { + dO = resultStack.top(); + if (dO == this) + l_error = searchSubFromHere(tag, resultStack, searchIntoSub); + else + { // continue directly in sub-tree + l_error = dO->search(tag, resultStack, mode, searchIntoSub); +// The next two lines destroy the stack, delete them +// if (l_error.bad()) +// resultStack.pop(); + } + } + else if ((mode == ESM_afterStackTop) && searchIntoSub) + { + // resultStack contains additional information: + // - restore state of the last search in each search routine + // - find position of dO in tree structure + // 1. search for own stack entry + // - in case of failure terminate search + // 2. take next upper entry dnO + // 3. set own list to position of dnO + // 4. restart search from dnO + + unsigned long i = resultStack.card(); + while ((i > 0) && ((dO = resultStack.elem(i-1)) != this)) + { + i--; + } + if ((dO != this) && (resultStack.card() > 0)) + { // highest level is never in resultStack + i = resultStack.card()+1; // now points to highest level +1 + dO = this; // match in highest level + } + if (dO == this) + { + if (i == 1) // resultStack.top() found + l_error = EC_TagNotFound; // don't mark as match, see above + else + { + E_SearchMode submode = mode; + OFBool searchNode = OFTrue; + DcmObject *dnO; + dnO = resultStack.elem(i-2); // node of next level + itemList->seek(ELP_first); + do { + dO = itemList->get(); + searchNode = searchNode ? (dO != dnO) : OFFalse; + if (!searchNode) + { // continue search + if (submode == ESM_fromStackTop) + resultStack.push(dO); // update stack + if ((submode == ESM_fromStackTop) && (tag == dO->getTag())) + l_error = EC_Normal; + else + l_error = dO->search(tag, resultStack, submode, OFTrue); + if (l_error.bad()) + resultStack.pop(); + else + break; + submode = ESM_fromStackTop; // normal search from here + } + } while (itemList->seek(ELP_next)); + } + } else // probably never reached + l_error = EC_IllegalCall; + } // (mode == ESM_afterStackTop + else + l_error = EC_IllegalCall; + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmSequenceOfItems::loadAllDataIntoMemory() +{ + OFCondition l_error = EC_Normal; + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + OFCondition err = EC_Normal; + DcmObject *dO = itemList->get(); + if ((err = dO->loadAllDataIntoMemory()).bad()) + l_error = err; + } while (itemList->seek(ELP_next)); + } + return l_error; +} + + +// ******************************** + + +OFBool DcmSequenceOfItems::isSignable() const +{ + // a sequence is signable if the tag and VR doesn't prevent signing + // and if none of the items contains a UN element + return DcmElement::isSignable() && !containsUnknownVR(); +} + + +OFBool DcmSequenceOfItems::containsUnknownVR() const +{ + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + if (itemList->get()->containsUnknownVR()) + return OFTrue; + } while (itemList->seek(ELP_next)); + } + return OFFalse; +} + + +OFBool DcmSequenceOfItems::containsExtendedCharacters(const OFBool checkAllStrings) +{ + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + if (itemList->get()->containsExtendedCharacters(checkAllStrings)) + return OFTrue; + } while (itemList->seek(ELP_next)); + } + return OFFalse; +} + + +OFBool DcmSequenceOfItems::isAffectedBySpecificCharacterSet() const +{ + if (!itemList->empty()) + { + itemList->seek(ELP_first); + do { + if (itemList->get()->isAffectedBySpecificCharacterSet()) + return OFTrue; + } while (itemList->seek(ELP_next)); + } + return OFFalse; +} + + +OFCondition DcmSequenceOfItems::convertCharacterSet(DcmSpecificCharacterSet &converter) +{ + OFCondition status = EC_Normal; + if (!itemList->empty()) + { + // iterate over all items in this sequence and convert the string elements + itemList->seek(ELP_first); + do { + status = itemList->get()->convertCharacterSet(converter); + } while (status.good() && itemList->seek(ELP_next)); + } + return status; +} + + +OFCondition DcmSequenceOfItems::getPartialValue(void * /* targetBuffer */, + const Uint32 /* offset */, + Uint32 /* numBytes */, + DcmFileCache * /* cache */, + E_ByteOrder /* byteOrder */) +{ + // cannot use getPartialValue() with class DcmSequenceOfItems or derived classes + return EC_IllegalCall; +} diff --git a/dcmdata/libsrc/dcspchrs.cc b/dcmdata/libsrc/dcspchrs.cc new file mode 100644 index 00000000..8aca34f6 --- /dev/null +++ b/dcmdata/libsrc/dcspchrs.cc @@ -0,0 +1,804 @@ +/* + * + * Copyright (C) 2011-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Class for supporting the Specific Character Set attribute + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcspchrs.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcbytstr.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" + + +#define MAX_OUTPUT_STRING_LENGTH 60 + + +/*------------------* + * implementation * + *------------------*/ + +DcmSpecificCharacterSet::DcmSpecificCharacterSet() + : SourceCharacterSet(), + DestinationCharacterSet(), + DestinationEncoding(), + DefaultEncodingConverter(), + EncodingConverters() +{ +} + + +DcmSpecificCharacterSet::~DcmSpecificCharacterSet() +{ + clear(); +} + + +void DcmSpecificCharacterSet::clear() +{ + DefaultEncodingConverter.clear(); + EncodingConverters.clear(); + SourceCharacterSet.clear(); + DestinationCharacterSet.clear(); + DestinationEncoding.clear(); +} + + +DcmSpecificCharacterSet::operator OFBool() const +{ + return OFstatic_cast(OFBool, DefaultEncodingConverter); +} + + +OFBool DcmSpecificCharacterSet::operator!() const +{ + return !DefaultEncodingConverter; +} + + +const OFString &DcmSpecificCharacterSet::getSourceCharacterSet() const +{ + return SourceCharacterSet; +} + + +const OFString &DcmSpecificCharacterSet::getDestinationCharacterSet() const +{ + return DestinationCharacterSet; +} + + +const OFString &DcmSpecificCharacterSet::getDestinationEncoding() const +{ + return DestinationEncoding; +} + + +unsigned DcmSpecificCharacterSet::getConversionFlags() const +{ + return DefaultEncodingConverter.getConversionFlags(); +} + + +OFCondition DcmSpecificCharacterSet::setConversionFlags(const unsigned flags) +{ + if (!EncodingConverters.empty()) + { + /* pass conversion flags to all "encoding converters" */ + for (T_EncodingConvertersMap::iterator it = EncodingConverters.begin(); + it != EncodingConverters.end(); ++it) + { + OFCondition status = it->second.setConversionFlags(flags); + if (status.bad()) + return status; + } + return EC_Normal; + } else return DefaultEncodingConverter.setConversionFlags(flags); +} + + +OFCondition DcmSpecificCharacterSet::selectCharacterSet(const OFString &fromCharset, + const OFString &toCharset) +{ + // first, make sure that all converters are cleared + clear(); + // determine the destination encoding (and check whether it is supported at all) + OFCondition status = determineDestinationEncoding(toCharset); + if (status.good()) + { + // normalize the given string (original VR is "CS" with VM "1-n") + SourceCharacterSet = fromCharset; + normalizeString(SourceCharacterSet, MULTIPART, DELETE_LEADING, DELETE_TRAILING); + // check whether it is multi-valued + const unsigned long sourceVM = DcmElement::determineVM(SourceCharacterSet.c_str(), SourceCharacterSet.length()); + if (sourceVM == 0) + { + // no character set specified, use ASCII + status = DefaultEncodingConverter.selectEncoding("ASCII", DestinationEncoding); + // output some useful debug information + if (status.good()) + { + DCMDATA_DEBUG("DcmSpecificCharacterSet: Selected character set '' (ASCII) " + << "for the conversion to " << DestinationEncoding); + } + } + else if (sourceVM == 1) + { + // a single character set specified (no code extensions) + status = selectCharacterSetWithoutCodeExtensions(); + } else { + // multiple character sets specified (code extensions used) + status = selectCharacterSetWithCodeExtensions(sourceVM); + } + } + return status; +} + + +OFCondition DcmSpecificCharacterSet::selectCharacterSet(DcmItem &dataset, + const OFString &toCharset) +{ + OFString fromCharset; + // check whether Specific Character Set (0008,0005) is present in the given item/dataset + dataset.findAndGetOFStringArray(DCM_SpecificCharacterSet, fromCharset, OFFalse /*searchIntoSub*/); + // if missing or empty, the default character set (ASCII) will be used + return selectCharacterSet(fromCharset, toCharset); +} + + +OFCondition DcmSpecificCharacterSet::determineDestinationEncoding(const OFString &toCharset) +{ + OFCondition status = EC_Normal; + // normalize the given string (original VR is "CS" with VM "1-n", but we only support VM "1") + DestinationCharacterSet = toCharset; + normalizeString(DestinationCharacterSet, !MULTIPART, DELETE_LEADING, DELETE_TRAILING); + // there should only be a single character set specified (no code extensions) + if (DestinationCharacterSet.empty()) // ASCII (no value) + DestinationEncoding = "ASCII"; + else if (DestinationCharacterSet == "ISO_IR 6") // ASCII + { + DCMDATA_WARN("DcmSpecificCharacterSet: 'ISO_IR 6' is not a defined term in DICOM, " + << "will be treated as an empty value (ASCII)"); + DestinationCharacterSet.clear(); + DestinationEncoding = "ASCII"; + } + else if (DestinationCharacterSet == "ISO_IR 100") // Latin alphabet No. 1 + DestinationEncoding = "ISO-8859-1"; + else if (DestinationCharacterSet == "ISO_IR 101") // Latin alphabet No. 2 + DestinationEncoding = "ISO-8859-2"; + else if (DestinationCharacterSet == "ISO_IR 109") // Latin alphabet No. 3 + DestinationEncoding = "ISO-8859-3"; + else if (DestinationCharacterSet == "ISO_IR 110") // Latin alphabet No. 4 + DestinationEncoding = "ISO-8859-4"; + else if (DestinationCharacterSet == "ISO_IR 144") // Cyrillic + DestinationEncoding = "ISO-8859-5"; + else if (DestinationCharacterSet == "ISO_IR 127") // Arabic + DestinationEncoding = "ISO-8859-6"; + else if (DestinationCharacterSet == "ISO_IR 126") // Greek + DestinationEncoding = "ISO-8859-7"; + else if (DestinationCharacterSet == "ISO_IR 138") // Hebrew + DestinationEncoding = "ISO-8859-8"; + else if (DestinationCharacterSet == "ISO_IR 148") // Latin alphabet No. 5 + DestinationEncoding = "ISO-8859-9"; + else if (DestinationCharacterSet == "ISO_IR 13") // Japanese +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICONV + DestinationEncoding = "JIS_X0201"; // - the name "ISO-IR-13" is not supported by libiconv +#else + DestinationEncoding = "Shift_JIS"; // - ICU and stdlibc iconv only know "Shift_JIS" (is this mapping correct?) +#endif + else if (DestinationCharacterSet == "ISO_IR 166") // Thai +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICU + DestinationEncoding = "TIS-620"; // - the name "ISO-IR-166" is not supported by ICU +#else + DestinationEncoding = "ISO-IR-166"; +#endif + else if (DestinationCharacterSet == "ISO_IR 192") // Unicode in UTF-8 (multi-byte) + DestinationEncoding = "UTF-8"; + else if (DestinationCharacterSet == "GB18030") // Chinese (multi-byte) + DestinationEncoding = "GB18030"; + else if (DestinationCharacterSet == "GBK") // Chinese (multi-byte, subset of "GB 18030") + DestinationEncoding = "GBK"; + else { + DestinationEncoding.clear(); + // create an appropriate error code + OFOStringStream stream; + stream << "Cannot select destination character set: SpecificCharacterSet (0008,0005) value '" + << DestinationCharacterSet << "' not supported" << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, message) + status = makeOFCondition(OFM_dcmdata, EC_CODE_CannotSelectCharacterSet, OF_error, message.c_str()); + } + return status; +} + + +OFCondition DcmSpecificCharacterSet::selectCharacterSetWithoutCodeExtensions() +{ + OFCondition status = EC_Normal; + // a single character set specified (no code extensions) + OFString fromEncoding; + if (SourceCharacterSet == "ISO_IR 6") // ASCII + { + DCMDATA_WARN("DcmSpecificCharacterSet: 'ISO_IR 6' is not a defined term in DICOM, " + << "will be treated as an empty value (ASCII)"); + SourceCharacterSet.clear(); + fromEncoding = "ASCII"; + } + else if (SourceCharacterSet == "ISO_IR 100") // Latin alphabet No. 1 + fromEncoding = "ISO-8859-1"; + else if (SourceCharacterSet == "ISO_IR 101") // Latin alphabet No. 2 + fromEncoding = "ISO-8859-2"; + else if (SourceCharacterSet == "ISO_IR 109") // Latin alphabet No. 3 + fromEncoding = "ISO-8859-3"; + else if (SourceCharacterSet == "ISO_IR 110") // Latin alphabet No. 4 + fromEncoding = "ISO-8859-4"; + else if (SourceCharacterSet == "ISO_IR 144") // Cyrillic + fromEncoding = "ISO-8859-5"; + else if (SourceCharacterSet == "ISO_IR 127") // Arabic + fromEncoding = "ISO-8859-6"; + else if (SourceCharacterSet == "ISO_IR 126") // Greek + fromEncoding = "ISO-8859-7"; + else if (SourceCharacterSet == "ISO_IR 138") // Hebrew + fromEncoding = "ISO-8859-8"; + else if (SourceCharacterSet == "ISO_IR 148") // Latin alphabet No. 5 + fromEncoding = "ISO-8859-9"; + else if (SourceCharacterSet == "ISO_IR 13") // Japanese +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICONV + fromEncoding = "JIS_X0201"; // - the name "ISO-IR-13" is not supported by libiconv +#else + fromEncoding = "Shift_JIS"; // - ICU and stdlibc iconv only know "Shift_JIS" (is this mapping correct?) +#endif + else if (SourceCharacterSet == "ISO_IR 166") // Thai +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICU + fromEncoding = "TIS-620"; // - the name "ISO-IR-166" is not supported by ICU +#else + fromEncoding = "ISO-IR-166"; +#endif + else if (SourceCharacterSet == "ISO_IR 192") // Unicode in UTF-8 (multi-byte) + fromEncoding = "UTF-8"; + else if (SourceCharacterSet == "GB18030") // Chinese (multi-byte) + fromEncoding = "GB18030"; + else if (SourceCharacterSet == "GBK") // Chinese (multi-byte, subset of "GB 18030") + fromEncoding = "GBK"; + else { + // create an appropriate error code + OFOStringStream stream; + stream << "Cannot select source character set: SpecificCharacterSet (0008,0005) value '" + << SourceCharacterSet << "' not supported" << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, message) + status = makeOFCondition(OFM_dcmdata, EC_CODE_CannotSelectCharacterSet, OF_error, message.c_str()); + } + // check whether an appropriate character encoding has been found + if (!fromEncoding.empty()) + { + status = DefaultEncodingConverter.selectEncoding(fromEncoding, DestinationEncoding); + // output some useful debug information + if (status.good()) + { + DCMDATA_DEBUG("DcmSpecificCharacterSet: Selected character set '" << SourceCharacterSet + << "' (" << fromEncoding << ") for the conversion to " << DestinationEncoding); + } + } + return status; +} + + +OFCondition DcmSpecificCharacterSet::selectCharacterSetWithCodeExtensions(const unsigned long sourceVM) +{ + // first, check whether multiple character sets are specified (i.e. code extensions used) + if (sourceVM <= 1) + return EC_IllegalCall; + // then proceed with the real work + OFCondition status = EC_Normal; + size_t pos = 0; + OFBool needsASCII = OFFalse; + OFBool notFirstValue = OFFalse; + OFString definedTerm; + unsigned long i = 0; + while ((i < sourceVM) && status.good()) + { + // extract single value from string (separated by a backslash) + pos = DcmElement::getValueFromString(SourceCharacterSet.c_str(), pos, SourceCharacterSet.length(), definedTerm); + if (definedTerm.empty() && (i == 0)) // assuming ASCII (according to DICOM PS 3.5) + definedTerm = "ISO 2022 IR 6"; + // determine character encoding from DICOM defined term + OFString encodingName; + if (definedTerm == "ISO 2022 IR 6") // ASCII + encodingName = "ASCII"; + else if (definedTerm == "ISO 2022 IR 100") // Latin alphabet No. 1 + { + encodingName = "ISO-8859-1"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 101") // Latin alphabet No. 2 + { + encodingName = "ISO-8859-2"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 109") // Latin alphabet No. 3 + { + encodingName = "ISO-8859-3"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 110") // Latin alphabet No. 4 + { + encodingName = "ISO-8859-4"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 144") // Cyrillic + { + encodingName = "ISO-8859-5"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 127") // Arabic + { + encodingName = "ISO-8859-6"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 126") // Greek + { + encodingName = "ISO-8859-7"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 138") // Hebrew + { + encodingName = "ISO-8859-8"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 148") // Latin alphabet No. 5 + { + encodingName = "ISO-8859-9"; + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 13") // Japanese + { +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICONV + encodingName = "JIS_X0201"; // - the name "ISO-IR-13" is not supported by libiconv +#else + encodingName = "Shift_JIS"; // - ICU and stdlibc iconv only know "Shift_JIS" (is this mapping correct?) +#endif + } + else if (definedTerm == "ISO 2022 IR 166") // Thai + { +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICU + encodingName = "TIS-620"; // - "ISO-IR-166" is not supported by ICU +#else + encodingName = "ISO-IR-166"; +#endif + needsASCII = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 87") // Japanese (multi-byte) + { + encodingName = "ISO-IR-87"; // - this might generate an error since "ISO-IR-87" is not supported by ICU and stdlibc iconv + notFirstValue = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 159") // Japanese (multi-byte) + { + encodingName = "ISO-IR-159"; // - this might generate an error since "ISO-IR-159" is not supported by ICU and stdlibc iconv + notFirstValue = OFTrue; + } + else if (definedTerm == "ISO 2022 IR 149") // Korean (multi-byte) + { + encodingName = "EUC-KR"; // - is this mapping really correct? + notFirstValue = OFTrue; // "ISO-IR-149" does not work with the sample from DICOM PS 3.5 + } + else if (definedTerm == "ISO 2022 IR 58") // Simplified Chinese (multi-byte) + { + encodingName = "GB2312"; // - should work, but not tested yet! + notFirstValue = OFTrue; + } + else { + // create an appropriate error code + OFOStringStream stream; + stream << "Cannot select source character set: SpecificCharacterSet (0008,0005) value " << (i + 1) + << " of " << sourceVM << " '" << definedTerm << "' not supported" << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, message) + status = makeOFCondition(OFM_dcmdata, EC_CODE_CannotSelectCharacterSet, OF_error, message.c_str()); + } + // check whether character set is allowed as the default (first value) + if ((i == 0) && notFirstValue) + { + OFOStringStream stream; + stream << "Cannot select source character set: '" << definedTerm << "' is not a allowed " + << "as the first value in SpecificCharacterSet (0008,0005)" << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, message) + status = makeOFCondition(OFM_dcmdata, EC_CODE_CannotSelectCharacterSet, OF_error, message.c_str()); + } + // add descriptor to the map using the defined term as a key + if (status.good() && !encodingName.empty()) + { + OFPair conv = EncodingConverters.insert( + OFMake_pair(definedTerm, OFCharacterEncoding())); + // but first check whether this encoding has already been added before + if (conv.second) + { + status = conv.first->second.selectEncoding(encodingName, DestinationEncoding); + if (status.good()) + { + // output some useful debug information + DCMDATA_DEBUG("DcmSpecificCharacterSet: Added character set '" << definedTerm + << "' (" << encodingName << ") for the conversion to " << DestinationEncoding); + // also remember the default descriptor, which refers to the first character set + if (i == 0) + { + DefaultEncodingConverter = conv.first->second; + DCMDATA_TRACE("DcmSpecificCharacterSet: Also selected this character set " + << "(i.e. '" << definedTerm << "') as the default one"); + } + } else { + DCMDATA_ERROR("DcmSpecificCharacterSet: '" << definedTerm << + "' is not supported by the utilized character set conversion library '" + << OFCharacterEncoding::getLibraryVersionString() << '\''); + EncodingConverters.erase(conv.first); + } + } else { + DCMDATA_WARN("DcmSpecificCharacterSet: '" << definedTerm << "' is defined more than once " + << "in SpecificCharacterSet (0008,0005), ignoring the duplicate definition"); + } + } + ++i; + } + // add ASCII to the map if needed but not already there + if (status.good() && needsASCII) + { + OFPair conv = EncodingConverters.insert( + OFMake_pair(OFString("ISO 2022 IR 6"), OFCharacterEncoding())); + if (conv.second) + { + status = conv.first->second.selectEncoding("ASCII", DestinationEncoding); + if (status.good()) + { + // output some useful debug information + DCMDATA_DEBUG("DcmSpecificCharacterSet: Added character set 'ISO 2022 IR 6' (ASCII) " + << "for the conversion to " << DestinationEncoding + << " (because it is needed for one or more of the previously added character sets)"); + } else { + DCMDATA_ERROR("DcmSpecificCharacterSet: 'ISO 2022 IR 6' is not supported by" + << " the utilized character set conversion library '" + << OFCharacterEncoding::getLibraryVersionString() << '\''); + EncodingConverters.erase(conv.first); + } + } + } + return status; +} + + +OFCondition DcmSpecificCharacterSet::convertString(const OFString &fromString, + OFString &toString, + const OFString &delimiters) +{ + // call the real method converting the given string + return convertString(fromString.c_str(), fromString.length(), toString, delimiters); +} + + +OFCondition DcmSpecificCharacterSet::convertString(const char *fromString, + const size_t fromLength, + OFString &toString, + const OFString &delimiters) +{ + OFCondition status = EC_Normal; + // check whether there are any code extensions at all + if (EncodingConverters.empty() || !checkForEscapeCharacter(fromString, fromLength)) + { + DCMDATA_DEBUG("DcmSpecificCharacterSet: Converting '" + << convertToLengthLimitedOctalString(fromString, fromLength) << "'"); + // no code extensions according to ISO 2022 used - this is the simple case + status = DefaultEncodingConverter.convertString(fromString, fromLength, toString, OFTrue /*clearMode*/); + } else { + if (delimiters.empty()) + { + DCMDATA_DEBUG("DcmSpecificCharacterSet: Converting '" + << convertToLengthLimitedOctalString(fromString, fromLength) + << "' (with code extensions)"); + } else { + DCMDATA_DEBUG("DcmSpecificCharacterSet: Converting '" + << convertToLengthLimitedOctalString(fromString, fromLength) + << "' (with code extensions and delimiters '" << delimiters << "')"); + } + // code extensions according to ISO 2022 used, so we need to check for + // particular escape sequences in order to switch between character sets + toString.clear(); + size_t pos = 0; + // some (extended) character sets use more than 1 byte per character + // (however, the default character set always uses a single byte) + unsigned char bytesPerChar = 1; + // check whether '=' is a delimiter, as it is used in PN values + OFBool isFirstGroup = (delimiters.find('=') != OFString_npos); + // by default, we expect that delimiters can be checked by their corresponding ASCII codes + // (this implies that the default character set is not "ISO 2022 IR 87" or "ISO 2022 IR 159") + OFBool checkDelimiters = OFTrue; + const char *firstChar = fromString; + const char *currentChar = fromString; + // initially, use the default descriptor + OFCharacterEncoding converter = DefaultEncodingConverter; + DCMDATA_TRACE(" Starting with the default character set"); + // iterate over all characters of the string (as long as there is no error) + while ((pos < fromLength) && status.good()) + { + const char c0 = *currentChar++; + // check for characters ESC, HT, LF, FF, CR or any other specified delimiter + const OFBool isEscape = (c0 == '\033'); + const OFBool isDelimiter = checkDelimiters && + ((c0 == '\011') || (c0 == '\012') || (c0 == '\014') || (c0 == '\015') || (delimiters.find(c0) != OFString_npos)); + if (isEscape || isDelimiter) + { + // convert the sub-string (before the delimiter) with the current character set + const size_t convertLength = currentChar - firstChar - 1; + if (convertLength > 0) + { + // output some debug information + DCMDATA_TRACE(" Converting sub-string '" + << convertToLengthLimitedOctalString(firstChar, convertLength) << "'"); + status = converter.convertString(firstChar, convertLength, toString, OFFalse /*clearMode*/); + if (status.bad()) + DCMDATA_TRACE(" -> ERROR: " << status.text()); + } + // check whether this was the first component group of a PN value + if (isDelimiter && (c0 == '=')) + isFirstGroup = OFFalse; + } + // the ESC character is used to explicitly switch between character sets + if (isEscape) + { + // report a warning as this is a violation of DICOM PS 3.5 Section 6.2.1 + if (isFirstGroup) + { + DCMDATA_WARN("DcmSpecificCharacterSet: Escape sequences shall not be used " + << "in the first component group of a Person Name (PN), using them anyway"); + } + // we need at least two more characters to determine the new character set + size_t escLength = 2; + if (pos + escLength < fromLength) + { + OFString key; + const char c1 = *currentChar++; + const char c2 = *currentChar++; + char c3 = '\0'; + if ((c1 == 0x28) && (c2 == 0x42)) // ASCII + key = "ISO 2022 IR 6"; + else if ((c1 == 0x2d) && (c2 == 0x41)) // Latin alphabet No. 1 + key = "ISO 2022 IR 100"; + else if ((c1 == 0x2d) && (c2 == 0x42)) // Latin alphabet No. 2 + key = "ISO 2022 IR 101"; + else if ((c1 == 0x2d) && (c2 == 0x43)) // Latin alphabet No. 3 + key = "ISO 2022 IR 109"; + else if ((c1 == 0x2d) && (c2 == 0x44)) // Latin alphabet No. 4 + key = "ISO 2022 IR 110"; + else if ((c1 == 0x2d) && (c2 == 0x4c)) // Cyrillic + key = "ISO 2022 IR 144"; + else if ((c1 == 0x2d) && (c2 == 0x47)) // Arabic + key = "ISO 2022 IR 127"; + else if ((c1 == 0x2d) && (c2 == 0x46)) // Greek + key = "ISO 2022 IR 126"; + else if ((c1 == 0x2d) && (c2 == 0x48)) // Hebrew + key = "ISO 2022 IR 138"; + else if ((c1 == 0x2d) && (c2 == 0x4d)) // Latin alphabet No. 5 + key = "ISO 2022 IR 148"; + else if ((c1 == 0x29) && (c2 == 0x49)) // Japanese + key = "ISO 2022 IR 13"; + else if ((c1 == 0x28) && (c2 == 0x4a)) // Japanese - is this really correct? + key = "ISO 2022 IR 13"; + else if ((c1 == 0x2d) && (c2 == 0x54)) // Thai + key = "ISO 2022 IR 166"; + else if ((c1 == 0x24) && (c2 == 0x42)) // Japanese (multi-byte) + key = "ISO 2022 IR 87"; + else if ((c1 == 0x24) && (c2 == 0x28)) // Japanese (multi-byte) + { + escLength = 3; + // do we still have another character in the string? + if (pos + escLength < fromLength) + { + c3 = *currentChar++; + if (c3 == 0x44) + key = "ISO 2022 IR 159"; + } + } + else if ((c1 == 0x24) && (c2 == 0x29)) // might be Korean or Chinese + { + escLength = 3; + // do we still have another character in the string? + if (pos + escLength < fromLength) + { + c3 = *currentChar++; + if (c3 == 0x43) // Korean (single- and multi-byte) + key = "ISO 2022 IR 149"; + else if (c3 == 0x41) // Simplified Chinese (multi-byte) + key = "ISO 2022 IR 58"; + } + } + // check whether a valid escape sequence has been found + if (key.empty()) + { + OFOStringStream stream; + stream << "Cannot convert character set: Illegal escape sequence 'ESC " + << STD_NAMESPACE dec << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(2) << OFstatic_cast(int, c1 >> 4) << "/" + << STD_NAMESPACE setw(2) << OFstatic_cast(int, c1 & 0x0f) << " " + << STD_NAMESPACE setw(2) << OFstatic_cast(int, c2 >> 4) << "/" + << STD_NAMESPACE setw(2) << OFstatic_cast(int, c2 & 0x0f); + if (escLength == 3) + { + stream << " " << STD_NAMESPACE setw(2) << OFstatic_cast(int, c3 >> 4) << "/" + << STD_NAMESPACE setw(2) << OFstatic_cast(int, c3 & 0x0f); + } + stream << "' found" << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, message) + status = makeOFCondition(OFM_dcmdata, EC_CODE_CannotConvertCharacterSet, OF_error, message.c_str()); + } + if (status.good()) + { + DCMDATA_TRACE(" Switching to character set '" << key << "'"); + T_EncodingConvertersMap::const_iterator it = EncodingConverters.find(key); + // check whether the descriptor was found in the map, i.e. properly declared in (0008,0005) + if (it != EncodingConverters.end()) + { + converter = it->second; + // special case: these Japanese character sets replace the ASCII part (G0 code area), + // so according to DICOM PS 3.5 Section 6.2.1.2 an explicit switch to the default is required + checkDelimiters = (key != "ISO 2022 IR 87") && (key != "ISO 2022 IR 159"); + // determine number of bytes per character (used by the selected character set) + if ((key == "ISO 2022 IR 87") || (key == "ISO 2022 IR 159") || (key == "ISO 2022 IR 58")) + { + DCMDATA_TRACE(" Now using 2 bytes per character"); + bytesPerChar = 2; + } + else if (key == "ISO 2022 IR 149") + { + DCMDATA_TRACE(" Now using 1 or 2 bytes per character"); + bytesPerChar = 0; // special handling for single- and multi-byte + } else { + DCMDATA_TRACE(" Now using 1 byte per character"); + bytesPerChar = 1; + } + } else { + OFOStringStream stream; + stream << "Cannot convert character set: Escape sequence refers to character set '" << key << "' that " + "was not declared in SpecificCharacterSet (0008,0005)" << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, message) + status = makeOFCondition(OFM_dcmdata, EC_CODE_CannotConvertCharacterSet, OF_error, message.c_str()); + } + } + pos += escLength; + } + // check whether the escape sequence was complete + if (status.good() && (pos >= fromLength)) + { + OFOStringStream stream; + stream << "Cannot convert character set: Incomplete escape sequence (" << (escLength + 1) + << " bytes expected) at the end of the string to be converted" << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(stream, message) + status = makeOFCondition(OFM_dcmdata, EC_CODE_CannotConvertCharacterSet, OF_error, message.c_str()); + } + // do not copy the escape sequence to the output + firstChar = currentChar; + } + // the HT, LF, FF, CR character or other delimiters (depending on the VR) also cause a switch + else if (isDelimiter) + { + // output some debug information + DCMDATA_TRACE(" Appending delimiter '" + << convertToLengthLimitedOctalString(currentChar - 1 /* identical to c0 */, 1) + << "' to the output"); + // don't forget to append the delimiter + toString += c0; + // use the default descriptor again (see DICOM PS 3.5) + if (converter != DefaultEncodingConverter) + { + DCMDATA_TRACE(" Switching back to the default character set (because a delimiter was found)"); + converter = DefaultEncodingConverter; + checkDelimiters = OFTrue; + } + // start new sub-string after delimiter + firstChar = currentChar; + } + // skip remaining bytes of current character (if any) + else if (bytesPerChar != 1) + { + const size_t skipBytes = (bytesPerChar > 0) ? (bytesPerChar - 1) : ((c0 & 0x80) ? 1 : 0); + if (pos + skipBytes < fromLength) + currentChar += skipBytes; + pos += skipBytes; + } + ++pos; + } + if (status.good()) + { + // convert any remaining characters from the input string + const size_t convertLength = currentChar - firstChar; + if (convertLength > 0) + { + // output some debug information + DCMDATA_TRACE(" Converting remaining sub-string '" + << convertToLengthLimitedOctalString(firstChar, convertLength) << "'"); + status = converter.convertString(firstChar, convertLength, toString, OFFalse /*clearMode*/); + if (status.bad()) + DCMDATA_TRACE(" -> ERROR: " << status.text()); + } + } + } + if (status.good()) + { + // finally, output some debug information + if (DestinationEncoding == "UTF-8") + { + // output code points only in case of UTF-8 output + DCMDATA_TRACE("Converted result in " << DestinationEncoding << " is '" + << convertToLengthLimitedOctalString(toString.c_str(), toString.length()) << "' (" + << countCharactersInUTF8String(toString) << " code points)"); + } else { + DCMDATA_TRACE("Converted result in " << DestinationEncoding << " is '" + << convertToLengthLimitedOctalString(toString.c_str(), toString.length()) << "'"); + } + } + return status; +} + + +OFBool DcmSpecificCharacterSet::isConversionAvailable() +{ + // just call the appropriate function from the underlying class + return OFCharacterEncoding::isLibraryAvailable(); +} + + +size_t DcmSpecificCharacterSet::countCharactersInUTF8String(const OFString &utf8String) +{ + // just call the appropriate function from the underlying class + return OFCharacterEncoding::countCharactersInUTF8String(utf8String); +} + + +OFBool DcmSpecificCharacterSet::checkForEscapeCharacter(const char *strValue, + const size_t strLength) const +{ + OFBool result = OFFalse; + // iterate over the string of characters + for (size_t pos = 0; pos < strLength; ++pos) + { + // and search for the first ESC character + if (*strValue++ == '\033') + { + // then return with "true" + result = OFTrue; + break; + } + } + return result; +} + + +OFString DcmSpecificCharacterSet::convertToLengthLimitedOctalString(const char *strValue, + const size_t strLength) const +{ + OFString octalString; + // convert given string to octal representation, allow one character more than the maximum ... + OFStandard::convertToOctalString(OFString(strValue, strLength), octalString, MAX_OUTPUT_STRING_LENGTH + 1); + // ... in order to determine whether trailing dots should be added, i.e. the string was cropped + if (octalString.length() > MAX_OUTPUT_STRING_LENGTH) + { + octalString.erase(MAX_OUTPUT_STRING_LENGTH); + octalString.append("..."); + } + // return string by-value (in order to avoid another parameter) + return octalString; +} diff --git a/dcmdata/libsrc/dcstack.cc b/dcmdata/libsrc/dcstack.cc new file mode 100644 index 00000000..44514470 --- /dev/null +++ b/dcmdata/libsrc/dcstack.cc @@ -0,0 +1,265 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: stack class + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcstack.h" + + +// ************************************************ +// *** DcmStackNode() ***************************** +// ************************************************ + + +DcmStackNode::DcmStackNode( DcmObject *obj ) + : link(NULL), + objNodeValue(obj) +{ +} + + +// ******************************** + + +DcmStackNode::~DcmStackNode() +{ +} + + +// ******************************** + + +DcmObject* DcmStackNode::value() const +{ + return objNodeValue; +} + + + +// ************************************************ +// *** DcmStack() ********************************* +// ************************************************ + + +DcmStack::DcmStack() + : topNode_(NULL), + cardinality_(0) +{ +} + + +// ************************************************ + + +DcmStack::DcmStack( const DcmStack & oldStack) + : topNode_(NULL), + cardinality_(oldStack.cardinality_) +{ + if (cardinality_) + { + topNode_ = new DcmStackNode(oldStack.topNode_->objNodeValue); + DcmStackNode * oldPtr = oldStack.topNode_->link; + DcmStackNode * newPtr = topNode_; + while (oldPtr) + { + newPtr->link = new DcmStackNode(oldPtr->objNodeValue); + oldPtr = oldPtr->link; + newPtr = newPtr->link; + } + } +} + + +// ******************************** + + +DcmStack::~DcmStack() +{ + clear(); +} + + +// ******************************** + + +void DcmStack::clear() +{ + DcmStackNode *node; + while (topNode_ != NULL) + { + node = topNode_; + topNode_ = topNode_->link; + delete node; + } + cardinality_ = 0; +} + + +// ******************************** + + +DcmObject* DcmStack::push( DcmObject *obj ) +{ + if ( obj != NULL ) + { + DcmStackNode *node = new DcmStackNode( obj ); + node->link = topNode_; + topNode_ = node; + cardinality_++; + } + return obj; +} + + +// ******************************** + + +DcmObject* DcmStack::pop() +{ + DcmObject *obj; + DcmStackNode *node; + if ( topNode_ != NULL ) + { + obj = topNode_->value(); + node = topNode_; + topNode_ = topNode_->link; + delete node; + cardinality_--; + } + else + obj = NULL; + return obj; +} + + +// ******************************** + + +DcmObject* DcmStack::elem(const unsigned long number) const +{ + unsigned long num = number; + DcmObject *obj; + DcmStackNode *node = topNode_; + while ( num > 0 && node != NULL ) + { + node = node->link; + --num; + } + if ( node != NULL ) + obj = node->value(); + else + obj = NULL; + return obj; +} + + +// ******************************** + + +DcmObject* DcmStack::top() const +{ + DcmObject *obj; + if ( topNode_ != NULL ) + obj = topNode_->value(); + else + obj = NULL; + return obj; +} + + +// ******************************** + + +unsigned long DcmStack::card() const +{ + return cardinality_; +} + + +// ******************************** + + +OFBool DcmStack::empty() const +{ + return OFstatic_cast(OFBool, topNode_ == NULL ); +} + + +DcmStack& DcmStack::operator=(const DcmStack& arg) +{ + if (this != &arg) + { + clear(); + cardinality_ = arg.cardinality_; + if (cardinality_) + { + topNode_ = new DcmStackNode(arg.topNode_->objNodeValue); + DcmStackNode * oldPtr = arg.topNode_->link; + DcmStackNode * newPtr = topNode_; + while (oldPtr) + { + newPtr->link = new DcmStackNode(oldPtr->objNodeValue); + oldPtr = oldPtr->link; + newPtr = newPtr->link; + } + } + } + return *this; +} + + +OFBool DcmStack::operator<(const DcmStack& arg) const +{ + if (cardinality_ < arg.cardinality_) return OFTrue; + if (cardinality_ > arg.cardinality_) return OFFalse; + + // cardinality_ is equal. Now walk through stack and do pointer arithmetics + DcmStackNode * thisPtr = topNode_; + DcmStackNode * argPtr = arg.topNode_; + while (thisPtr) + { + if (thisPtr->objNodeValue < argPtr->objNodeValue) return OFTrue; + if (thisPtr->objNodeValue > argPtr->objNodeValue) return OFFalse; + thisPtr = thisPtr->link; + argPtr = argPtr->link; + } + return OFFalse; // stacks are equal +} + + +OFBool DcmStack::operator==(const DcmStack& arg) const +{ + if (cardinality_ != arg.cardinality_) return OFFalse; + + DcmStackNode * thisPtr = topNode_; + DcmStackNode * argPtr = arg.topNode_; + while (thisPtr) + { + if (thisPtr->objNodeValue != argPtr->objNodeValue) return OFFalse; + thisPtr = thisPtr->link; + argPtr = argPtr->link; + } + return OFTrue; +} diff --git a/dcmdata/libsrc/dcswap.cc b/dcmdata/libsrc/dcswap.cc new file mode 100644 index 00000000..37fa4a7e --- /dev/null +++ b/dcmdata/libsrc/dcswap.cc @@ -0,0 +1,136 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: byte order functions + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcswap.h" + +OFCondition swapIfNecessary(const E_ByteOrder newByteOrder, + const E_ByteOrder oldByteOrder, + void * value, const Uint32 byteLength, + const size_t valWidth) + /* + * This function swaps byteLength bytes in value if newByteOrder and oldByteOrder + * differ from each other. In case bytes have to be swapped, these bytes are seperated + * in valWidth elements which will be swapped seperately. + * + * Parameters: + * newByteOrder - [in] The new byte ordering (little or big endian). + * oldByteOrder - [in] The current old byte ordering (little or big endian). + * value - [in] Array that contains the actual bytes which might have to be swapped. + * byteLength - [in] Length of the above array. + * valWidth - [in] Specifies how many bytes shall be treated together as one element. + */ +{ + /* if the two byte orderings are unknown this is an illegal call */ + if (oldByteOrder != EBO_unknown && newByteOrder != EBO_unknown) + { + /* and if they differ from each other and valWidth is not 1 */ + if (oldByteOrder != newByteOrder && valWidth != 1) + { + /* in case the array length equals valWidth and only 2 or 4 bytes have to be swapped */ + /* we can swiftly swap these bytes by calling the corresponding functions. If this is */ + /* not the case we have to call a more sophisticated function. */ + if (byteLength == valWidth) + { + if (valWidth == 2) + swap2Bytes(OFstatic_cast(Uint8 *, value)); + else if (valWidth == 4) + swap4Bytes(OFstatic_cast(Uint8 *, value)); + else + swapBytes(value, byteLength, valWidth); + } + else + swapBytes(value, byteLength, valWidth); + } + return EC_Normal; + } + return EC_IllegalCall; +} + + + +void swapBytes(void * value, const Uint32 byteLength, + const size_t valWidth) + /* + * This function swaps byteLength bytes in value. These bytes are seperated + * in valWidth elements which will be swapped seperately. + * + * Parameters: + * value - [in] Array that contains the actual bytes which might have to be swapped. + * byteLength - [in] Length of the above array. + * valWidth - [in] Specifies how many bytes shall be treated together as one element. + */ +{ + Uint8 save; + + /* in case valWidth equals 2, swap correspondingly */ + if (valWidth == 2) + { + Uint8 *first = &OFstatic_cast(Uint8*, value)[0]; + Uint8 *second = &OFstatic_cast(Uint8*, value)[1]; + Uint32 times = byteLength / 2; + while(times) + { + --times; + save = *first; + *first = *second; + *second = save; + first += 2; + second += 2; + } + } + /* if valWidth is greater than 2, swap correspondingly */ + else if (valWidth > 2) + { + size_t i; + const size_t halfWidth = valWidth / 2; + const size_t offset = valWidth - 1; + Uint8 *start; + Uint8 *end; + + Uint32 times = OFstatic_cast(Uint32, byteLength / valWidth); + Uint8 *base = OFstatic_cast(Uint8 *, value); + + while (times) + { + --times; + i = halfWidth; + start = base; + end = base+offset; + while (i) + { + --i; + save = *start; + *start++ = *end; + *end-- = save; + } + base += valWidth; + } + } +} + + +Uint16 swapShort(const Uint16 toSwap) +{ + Uint8 *swapped = OFreinterpret_cast(Uint8 *, OFconst_cast(Uint16 *, &toSwap)); + swap2Bytes(swapped); + return *OFreinterpret_cast(Uint16*, swapped); +} diff --git a/dcmdata/libsrc/dctag.cc b/dcmdata/libsrc/dctag.cc new file mode 100644 index 00000000..3a4692a7 --- /dev/null +++ b/dcmdata/libsrc/dctag.cc @@ -0,0 +1,271 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andrew Hewett + * + * Purpose: class DcmTag + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctag.h" +#include "dcmtk/dcmdata/dcerror.h" /* for dcmdata error constants */ +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dcdicent.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +DcmTag::DcmTag() + : vr(EVR_UNKNOWN), + tagName(NULL), + privateCreator(NULL), + errorFlag(EC_InvalidTag) +{ +} + +DcmTag::DcmTag(const DcmTagKey& akey, const char *privCreator) + : DcmTagKey(akey), + vr(EVR_UNKNOWN), + tagName(NULL), + privateCreator(NULL), + errorFlag(EC_InvalidTag) +{ + if (privCreator) + updatePrivateCreator(privCreator); + lookupVRinDictionary(); +} + +DcmTag::DcmTag(Uint16 g, Uint16 e, const char *privCreator) + : DcmTagKey(g, e), + vr(EVR_UNKNOWN), + tagName(NULL), + privateCreator(NULL), + errorFlag(EC_InvalidTag) +{ + if (privCreator) + updatePrivateCreator(privCreator); + lookupVRinDictionary(); +} + +DcmTag::DcmTag(const DcmTagKey& akey, const DcmVR& avr) + : DcmTagKey(akey), + vr(avr), + tagName(NULL), + privateCreator(NULL), + errorFlag(EC_Normal) +{ +} + +DcmTag::DcmTag(Uint16 g, Uint16 e, const DcmVR& avr) + : DcmTagKey(g, e), + vr(avr), + tagName(NULL), + privateCreator(NULL), + errorFlag(EC_Normal) +{ +} + +DcmTag::DcmTag(const DcmTag& tag) + : DcmTagKey(tag), + vr(tag.vr), + tagName(NULL), + privateCreator(NULL), + errorFlag(tag.errorFlag) +{ + updateTagName(tag.tagName); + updatePrivateCreator(tag.privateCreator); +} + + +// ******************************** + + +DcmTag::~DcmTag() +{ + delete[] tagName; + delete[] privateCreator; +} + + +// ******************************** + + +DcmTag& DcmTag::operator=(const DcmTag& tag) +{ + if (this != &tag) + { + updateTagName(tag.tagName); + updatePrivateCreator(tag.privateCreator); + DcmTagKey::set(tag); + vr = tag.vr; + errorFlag = tag.errorFlag; + } + return *this; +} + +// ******************************** + +void DcmTag::lookupVRinDictionary() +{ + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dictRef = globalDataDict.findEntry(*this, privateCreator); + if (dictRef) + { + vr = dictRef->getVR(); + errorFlag = EC_Normal; + } + dcmDataDict.rdunlock(); +} + +// ******************************** + + +DcmVR DcmTag::setVR(const DcmVR& avr) // resolve ambiguous VR +{ + vr = avr; + + if (vr.getEVR() == EVR_UNKNOWN) + { + errorFlag = EC_InvalidVR; + } else { + errorFlag = EC_Normal; + } + return vr; +} + + +const char *DcmTag::getTagName() +{ + if (tagName) + return tagName; + + const char *newTagName = NULL; + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dictRef = globalDataDict.findEntry(*this, privateCreator); + if (dictRef) + newTagName=dictRef->getTagName(); + if (newTagName == NULL) + newTagName = DcmTag_ERROR_TagName; + updateTagName(newTagName); + dcmDataDict.rdunlock(); + + if (tagName) + return tagName; + return DcmTag_ERROR_TagName; +} + +OFBool DcmTag::isSignable() const +{ + OFBool result = isSignableTag(); + if (result) + result = !isUnknownVR(); + return result; +} + +OFBool DcmTag::isUnknownVR() const +{ + OFBool result = OFFalse; + switch (vr.getValidEVR()) // this is the VR we're going to write in explicit VR + { + case EVR_UNKNOWN: + case EVR_UNKNOWN2B: + case EVR_UN: + result = OFTrue; + break; + default: + /* nothing */ + break; + } + return result; +} + + +OFCondition DcmTag::findTagFromName(const char *name, DcmTag &value) +{ + OFCondition result = EC_IllegalParameter; + /* check parameters first */ + if ((name != NULL) && (strlen(name) > 0)) + { + result = EC_Normal; + unsigned int grp = 0xffff; + unsigned int elm = 0xffff; + /* check whether tag name has format 'gggg,eeee' */ + if (sscanf(name, "%x,%x", &grp, &elm) == 2) + { + /* store resulting tag value */ + value.set(OFstatic_cast(Uint16, grp), OFstatic_cast(Uint16, elm)); + value.lookupVRinDictionary(); + } else { + /* it is a name: look up in the dictionary */ + const DcmDataDictionary &globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(name); + /* store resulting tag value */ + if (dicent != NULL) + { + value.set(dicent->getKey()); + value.setVR(dicent->getVR()); + } + else + result = EC_TagNotFound; + dcmDataDict.rdunlock(); + } + } + return result; +} + + +const char* DcmTag::getPrivateCreator() const +{ + return privateCreator; +} + +void DcmTag::setPrivateCreator(const char *privCreator) +{ + // a new private creator code probably changes the name + // of the tag. Enforce new dictionary lookup the next time + // getTagName() is called. + updateTagName(NULL); + updatePrivateCreator(privCreator); +} + +void DcmTag::updateTagName(const char *c) +{ + delete[] tagName; + if (c) + { + size_t buflen = strlen(c) + 1; + tagName = new char[buflen]; + if (tagName) + OFStandard::strlcpy(tagName, c, buflen); + } else + tagName = NULL; +} + +void DcmTag::updatePrivateCreator(const char *c) +{ + delete[] privateCreator; + if (c) + { + size_t buflen = strlen(c) + 1; + privateCreator = new char[buflen]; + if (privateCreator) + OFStandard::strlcpy(privateCreator, c, buflen); + } else + privateCreator = NULL; +} diff --git a/dcmdata/libsrc/dctagkey.cc b/dcmdata/libsrc/dctagkey.cc new file mode 100644 index 00000000..a9090cf7 --- /dev/null +++ b/dcmdata/libsrc/dctagkey.cc @@ -0,0 +1,95 @@ +/* + * + * Copyright (C) 1994-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Basis class for dicom tags. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +/* + * DcmTagKey member functions + */ + +DcmTagKey DcmTagKey::getBaseTag() const +{ + // make sure that the group number is even (i.e. a standard tag). We also + // accept more than 16 repeating groups because of known real-world examples. + const Uint16 baseGroup = group & 0xFF01; + // check for curve or overlay repeating group + if ((baseGroup == 0x5000) || (baseGroup == 0x6000)) + return DcmTagKey(baseGroup, element); + else + return *this; +} + + +OFString DcmTagKey::toString() const +{ + char tagBuf[16]; + + if (group == 0xffff && element == 0xffff) + { + OFStandard::strlcpy(tagBuf, "(\?\?\?\?,\?\?\?\?)", 16); // prevent trigraph expansion in string constant + } else { + sprintf(tagBuf, "(%04x,%04x)", OFstatic_cast(unsigned, group), OFstatic_cast(unsigned, element)); + } + return tagBuf; +} + + +OFBool DcmTagKey::isSignableTag() const +{ + //no group length tags (element number of 0000) + if (element == 0) return OFFalse; + + // no Length to End Tag + if ((group == 0x0008)&&(element==0x0001)) return OFFalse; + + //no tags with group number less than 0008 + if (group < 8) return OFFalse; + + //no tags from group FFFA (digital signatures sequence) + if (group == 0xfffa) return OFFalse; + + // no MAC Parameters sequence + if ((group == 0x4ffe)&&(element==0x0001)) return OFFalse; + + //no Data Set trailing Padding + if ((group == 0xfffc)&&(element==0xfffc)) return OFFalse; + + //no Sequence or Item Delimitation Tag + if ((group == 0xfffe)&&((element==0xe00d)||(element==0xe0dd))) return OFFalse; + + return OFTrue; +} + +/* +** DcmTagKey friend functions +*/ + +STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& s, const DcmTagKey& k) +{ + s << k.toString(); + return s; +} diff --git a/dcmdata/libsrc/dctypes.cc b/dcmdata/libsrc/dctypes.cc new file mode 100644 index 00000000..b52e5cea --- /dev/null +++ b/dcmdata/libsrc/dctypes.cc @@ -0,0 +1,49 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: global type and constant definitions + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" + +OFLogger DCM_dcmdataLogger = OFLog::getLogger("dcmtk.dcmdata"); + +/* print flags */ +const size_t DCMTypes::PF_shortenLongTagValues = 1 << 0; +const size_t DCMTypes::PF_showTreeStructure = 1 << 1; +const size_t DCMTypes::PF_doNotMapUIDsToNames = 1 << 2; +const size_t DCMTypes::PF_convertToMarkup = 1 << 3; +const size_t DCMTypes::PF_convertToOctalNumbers = 1 << 4; +const size_t DCMTypes::PF_useANSIEscapeCodes = 1 << 5; + +/* write XML flags */ +const size_t DCMTypes::XF_addDocumentType = 1 << 0; +const size_t DCMTypes::XF_writeBinaryData = 1 << 1; +const size_t DCMTypes::XF_encodeBase64 = 1 << 2; +const size_t DCMTypes::XF_useXMLNamespace = 1 << 3; +const size_t DCMTypes::XF_embedDocumentType = 1 << 4; +const size_t DCMTypes::XF_omitDataElementName = 1 << 5; +const size_t DCMTypes::XF_convertNonASCII = 1 << 6; +const size_t DCMTypes::XF_useNativeModel = 1 << 7; + +/* character set conversion flags */ +const size_t DCMTypes::CF_transliterate = 1 << 0; +const size_t DCMTypes::CF_discardIllegal = 1 << 1; diff --git a/dcmdata/libsrc/dcuid.cc b/dcmdata/libsrc/dcuid.cc new file mode 100644 index 00000000..55469ac7 --- /dev/null +++ b/dcmdata/libsrc/dcuid.cc @@ -0,0 +1,1765 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: + * Definitions of "well known" DICOM Unique Identifiers, + * routines for finding and creating UIDs. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#ifdef HAVE_WINDOWS_H +// on Windows, we need Winsock2 for getting network adapter information +#include +#include +#include +#endif + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CTIME +#define INCLUDE_LIBC +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#ifndef DCOMPAT_SYS_SOCKET_H_ +#define DCOMPAT_SYS_SOCKET_H_ +/* some systems don't protect sys/socket.h (e.g. DEC Ultrix) */ +#include +#endif +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif + +#ifndef HAVE_WINDOWS_H +#ifndef HAVE_PROTOTYPE_GETTIMEOFDAY + /* Ultrix has gettimeofday() but no prototype in the header files */ + int gettimeofday(struct timeval *tp, void *); +#endif +#endif + +#ifdef __MINGW32__ +#include /* needed for NO_ERROR constant on MinGW */ +#endif + +END_EXTERN_C + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/ofstd/ofthread.h" +#include "dcmtk/ofstd/ofcrc32.h" +#include "dcmtk/ofstd/ofdefine.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/ofstd/ofsockad.h" + +struct UIDNameMap { + const char* uid; + const char* name; +}; + +// +// It is very important that the names of the UIDs may not use the following +// characters: space ( ) [ ], = < > + +static const UIDNameMap uidNameMap[] = { + + { UID_StandardApplicationContext, "StandardApplicationContext" }, + + // Transfer Syntax + { UID_LittleEndianImplicitTransferSyntax, "LittleEndianImplicit" }, + { UID_LittleEndianExplicitTransferSyntax, "LittleEndianExplicit" }, + { UID_BigEndianExplicitTransferSyntax, "BigEndianExplicit" }, + { UID_JPEGProcess1TransferSyntax, "JPEGBaseline" }, + { UID_JPEGProcess2_4TransferSyntax, "JPEGExtended:Process2+4" }, + { UID_JPEGProcess3_5TransferSyntax, "JPEGExtended:Process3+5" }, + { UID_JPEGProcess6_8TransferSyntax, "JPEGSpectralSelection:Non-hierarchical:Process6+8" }, + { UID_JPEGProcess7_9TransferSyntax, "JPEGSpectralSelection:Non-hierarchical:Process7+9" }, + { UID_JPEGProcess10_12TransferSyntax, "JPEGFullProgression:Non-hierarchical:Process10+12" }, + { UID_JPEGProcess11_13TransferSyntax, "JPEGFullProgression:Non-hierarchical:Process11+13" }, + { UID_JPEGProcess14TransferSyntax, "JPEGLossless:Non-hierarchical:Process14" }, + { UID_JPEGProcess15TransferSyntax, "JPEGLossless:Non-hierarchical:Process15" }, + { UID_JPEGProcess16_18TransferSyntax, "JPEGExtended:Hierarchical:Process16+18" }, + { UID_JPEGProcess17_19TransferSyntax, "JPEGExtended:Hierarchical:Process17+19" }, + { UID_JPEGProcess20_22TransferSyntax, "JPEGSpectralSelection:Hierarchical:Process20+22" }, + { UID_JPEGProcess21_23TransferSyntax, "JPEGSpectralSelection:Hierarchical:Process21+23" }, + { UID_JPEGProcess24_26TransferSyntax, "JPEGFullProgression:Hierarchical:Process24+26" }, + { UID_JPEGProcess25_27TransferSyntax, "JPEGFullProgression:Hierarchical:Process25+27" }, + { UID_JPEGProcess28TransferSyntax, "JPEGLossless:Hierarchical:Process28" }, + { UID_JPEGProcess29TransferSyntax, "JPEGLossless:Hierarchical:Process29" }, + { UID_JPEGProcess14SV1TransferSyntax, "JPEGLossless:Non-hierarchical-1stOrderPrediction" }, + { UID_JPEGLSLosslessTransferSyntax, "JPEGLSLossless" }, + { UID_JPEGLSLossyTransferSyntax, "JPEGLSLossy" }, + { UID_RLELosslessTransferSyntax, "RLELossless" }, + { UID_DeflatedExplicitVRLittleEndianTransferSyntax, "DeflatedLittleEndianExplicit" }, + { UID_JPEG2000LosslessOnlyTransferSyntax, "JPEG2000LosslessOnly" }, + { UID_JPEG2000TransferSyntax, "JPEG2000" }, + { UID_JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax, "JPEG2000MulticomponentLosslessOnly" }, + { UID_JPEG2000Part2MulticomponentImageCompressionTransferSyntax, "JPEG2000Multicomponent" }, + { UID_JPIPReferencedTransferSyntax, "JPIPReferenced" }, + { UID_JPIPReferencedDeflateTransferSyntax, "JPIPReferencedDeflate" }, + { UID_MPEG2MainProfileAtMainLevelTransferSyntax, "MPEG2MainProfile@MainLevel" }, + { UID_MPEG2MainProfileAtHighLevelTransferSyntax, "MPEG2MainProfile@HighLevel" }, + { UID_MPEG4HighProfileLevel4_1TransferSyntax, "MPEG4HighProfile/Level4.1" }, + { UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax, "MPEG4BDcompatibleHighProfile/Level4.1" }, + { UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax, "MPEG4HighProfile/Level4.2For2DVideo" }, + { UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax, "MPEG4HighProfile/Level4.2For3DVideo" }, + { UID_MPEG4StereoHighProfileLevel4_2TransferSyntax, "MPEG4StereoHighProfile/Level4.2" }, + { UID_HEVCMainProfileLevel5_1TransferSyntax, "HEVCMainProfile/Level5.1" }, + { UID_HEVCMain10ProfileLevel5_1TransferSyntax, "HEVCMain10Profile/Level5.1" }, + { UID_RFC2557MIMEEncapsulationTransferSyntax, "RFC2557MIMEEncapsulation" }, + { UID_XMLEncodingTransferSyntax, "XMLEncoding" }, + { UID_PrivateGE_LEI_WithBigEndianPixelDataTransferSyntax, "PrivateGELittleEndianImplicitWithBigEndianPixelData" }, + + // Storage (DICOM) + { UID_AcquisitionContextSRStorage, "AcquisitionContextSRStorage" }, + { UID_AdvancedBlendingPresentationStateStorage, "AdvancedBlendingPresentationStateStorage" }, + { UID_AmbulatoryECGWaveformStorage, "AmbulatoryECGWaveformStorage" }, + { UID_ArterialPulseWaveformStorage, "ArterialPulseWaveformStorage" }, + { UID_AutorefractionMeasurementsStorage, "AutorefractionMeasurementsStorage" }, + { UID_BasicStructuredDisplayStorage, "BasicStructuredDisplayStorage" }, + { UID_BasicTextSRStorage, "BasicTextSRStorage" }, + { UID_BasicVoiceAudioWaveformStorage, "BasicVoiceAudioWaveformStorage" }, + { UID_BlendingSoftcopyPresentationStateStorage, "BlendingSoftcopyPresentationStateStorage" }, + { UID_BreastProjectionXRayImageStorageForPresentation, "BreastProjectionXRayImageStorageForPresentation" }, + { UID_BreastProjectionXRayImageStorageForProcessing, "BreastProjectionXRayImageStorageForProcessing" }, + { UID_BreastTomosynthesisImageStorage, "BreastTomosynthesisImageStorage" }, + { UID_CardiacElectrophysiologyWaveformStorage, "CardiacElectrophysiologyWaveformStorage" }, + { UID_CArmPhotonElectronRadiationStorage, "CArmPhotonElectronRadiationStorage" }, + { UID_ChestCADSRStorage, "ChestCADSRStorage" }, + { UID_ColonCADSRStorage, "ColonCADSRStorage" }, + { UID_ColorPaletteStorage, "ColorPaletteStorage" }, + { UID_ColorSoftcopyPresentationStateStorage, "ColorSoftcopyPresentationStateStorage" }, + { UID_CompositingPlanarMPRVolumetricPresentationStateStorage, "CompositingPlanarMPRVolumetricPresentationStateStorage" }, + { UID_Comprehensive3DSRStorage, "Comprehensive3DSRStorage" }, + { UID_ComprehensiveSRStorage, "ComprehensiveSRStorage" }, + { UID_ComputedRadiographyImageStorage, "ComputedRadiographyImageStorage" }, + { UID_ContentAssessmentResultsStorage, "ContentAssessmentResultsStorage" }, + { UID_CornealTopographyMapStorage, "CornealTopographyMapStorage" }, + { UID_CTDefinedProcedureProtocolStorage, "CTDefinedProcedureProtocolStorage" }, + { UID_CTImageStorage, "CTImageStorage" }, + { UID_CTPerformedProcedureProtocolStorage, "CTPerformedProcedureProtocolStorage" }, + { UID_DeformableSpatialRegistrationStorage, "DeformableSpatialRegistrationStorage" }, + { UID_DigitalIntraOralXRayImageStorageForPresentation, "DigitalIntraOralXRayImageStorageForPresentation" }, + { UID_DigitalIntraOralXRayImageStorageForProcessing, "DigitalIntraOralXRayImageStorageForProcessing" }, + { UID_DigitalMammographyXRayImageStorageForPresentation, "DigitalMammographyXRayImageStorageForPresentation" }, + { UID_DigitalMammographyXRayImageStorageForProcessing, "DigitalMammographyXRayImageStorageForProcessing" }, + { UID_DigitalXRayImageStorageForPresentation, "DigitalXRayImageStorageForPresentation" }, + { UID_DigitalXRayImageStorageForProcessing, "DigitalXRayImageStorageForProcessing" }, + { UID_EncapsulatedCDAStorage, "EncapsulatedCDAStorage" }, + { UID_EncapsulatedPDFStorage, "EncapsulatedPDFStorage" }, + { UID_EncapsulatedSTLStorage, "EncapsulatedSTLStorage" }, + { UID_EnhancedCTImageStorage, "EnhancedCTImageStorage" }, + { UID_EnhancedMRColorImageStorage, "EnhancedMRColorImageStorage" }, + { UID_EnhancedMRImageStorage, "EnhancedMRImageStorage" }, + { UID_EnhancedPETImageStorage, "EnhancedPETImageStorage" }, + { UID_EnhancedSRStorage, "EnhancedSRStorage" }, + { UID_EnhancedUSVolumeStorage, "EnhancedUSVolumeStorage" }, + { UID_EnhancedXAImageStorage, "EnhancedXAImageStorage" }, + { UID_EnhancedXRFImageStorage, "EnhancedXRFImageStorage" }, + { UID_ExtensibleSRStorage, "ExtensibleSRStorage" }, + { UID_GeneralAudioWaveformStorage, "GeneralAudioWaveformStorage" }, + { UID_GeneralECGWaveformStorage, "GeneralECGWaveformStorage" }, + { UID_GenericImplantTemplateStorage, "GenericImplantTemplateStorage" }, + { UID_GrayscalePlanarMPRVolumetricPresentationStateStorage, "GrayscalePlanarMPRVolumetricPresentationStateStorage" }, + { UID_GrayscaleSoftcopyPresentationStateStorage, "GrayscaleSoftcopyPresentationStateStorage" }, + { UID_HangingProtocolStorage, "HangingProtocolStorage" }, + { UID_HemodynamicWaveformStorage, "HemodynamicWaveformStorage" }, + { UID_ImplantAssemblyTemplateStorage, "ImplantAssemblyTemplateStorage" }, + { UID_ImplantationPlanSRDocumentStorage, "ImplantationPlanSRDocumentStorage" }, + { UID_ImplantTemplateGroupStorage, "ImplantTemplateGroupStorage" }, + { UID_IntraocularLensCalculationsStorage, "IntraocularLensCalculationsStorage" }, + { UID_IntravascularOpticalCoherenceTomographyImageStorageForPresentation, "IntravascularOpticalCoherenceTomographyImageStorageForPresentation" }, + { UID_IntravascularOpticalCoherenceTomographyImageStorageForProcessing, "IntravascularOpticalCoherenceTomographyImageStorageForProcessing" }, + { UID_KeratometryMeasurementsStorage, "KeratometryMeasurementsStorage" }, + { UID_KeyObjectSelectionDocumentStorage, "KeyObjectSelectionDocumentStorage" }, + { UID_LegacyConvertedEnhancedCTImageStorage, "LegacyConvertedEnhancedCTImageStorage" }, + { UID_LegacyConvertedEnhancedMRImageStorage, "LegacyConvertedEnhancedMRImageStorage" }, + { UID_LegacyConvertedEnhancedPETImageStorage, "LegacyConvertedEnhancedPETImageStorage" }, + { UID_LensometryMeasurementsStorage, "LensometryMeasurementsStorage" }, + { UID_MacularGridThicknessAndVolumeReportStorage, "MacularGridThicknessAndVolumeReportStorage" }, + { UID_MammographyCADSRStorage, "MammographyCADSRStorage" }, + { UID_MediaStorageDirectoryStorage, "MediaStorageDirectoryStorage" }, + { UID_MRImageStorage, "MRImageStorage" }, + { UID_MRSpectroscopyStorage, "MRSpectroscopyStorage" }, + { UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, "MultiframeGrayscaleByteSecondaryCaptureImageStorage" }, + { UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, "MultiframeGrayscaleWordSecondaryCaptureImageStorage" }, + { UID_MultiframeSingleBitSecondaryCaptureImageStorage, "MultiframeSingleBitSecondaryCaptureImageStorage" }, + { UID_MultiframeTrueColorSecondaryCaptureImageStorage, "MultiframeTrueColorSecondaryCaptureImageStorage" }, + { UID_MultipleVolumeRenderingVolumetricPresentationStateStorage, "MultipleVolumeRenderingVolumetricPresentationStateStorage" }, + { UID_NuclearMedicineImageStorage, "NuclearMedicineImageStorage" }, + { UID_OphthalmicAxialMeasurementsStorage, "OphthalmicAxialMeasurementsStorage" }, + { UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage, "OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage" }, + { UID_OphthalmicOpticalCoherenceTomographyEnFaceImageStorage, "OphthalmicOpticalCoherenceTomographyEnFaceImageStorage" }, + { UID_OphthalmicPhotography16BitImageStorage, "OphthalmicPhotography16BitImageStorage" }, + { UID_OphthalmicPhotography8BitImageStorage, "OphthalmicPhotography8BitImageStorage" }, + { UID_OphthalmicThicknessMapStorage, "OphthalmicThicknessMapStorage" }, + { UID_OphthalmicTomographyImageStorage, "OphthalmicTomographyImageStorage" }, + { UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, "OphthalmicVisualFieldStaticPerimetryMeasurementsStorage" }, + { UID_ParametricMapStorage, "ParametricMapStorage" }, + { UID_PatientRadiationDoseSRStorage, "PatientRadiationDoseSRStorage" }, + { UID_PerformedImagingAgentAdministrationSRStorage, "PerformedImagingAgentAdministrationSRStorage" }, + { UID_PlannedImagingAgentAdministrationSRStorage, "PlannedImagingAgentAdministrationSRStorage" }, + { UID_PositronEmissionTomographyImageStorage, "PositronEmissionTomographyImageStorage" }, + { UID_ProcedureLogStorage, "ProcedureLogStorage" }, + { UID_ProtocolApprovalStorage, "ProtocolApprovalStorage" }, + { UID_PseudoColorSoftcopyPresentationStateStorage, "PseudoColorSoftcopyPresentationStateStorage" }, + { UID_RadiopharmaceuticalRadiationDoseSRStorage, "RadiopharmaceuticalRadiationDoseSRStorage" }, + { UID_RawDataStorage, "RawDataStorage" }, + { UID_RealWorldValueMappingStorage, "RealWorldValueMappingStorage" }, + { UID_RespiratoryWaveformStorage, "RespiratoryWaveformStorage" }, + { UID_RTBeamsDeliveryInstructionStorage, "RTBeamsDeliveryInstructionStorage" }, + { UID_RTBeamsTreatmentRecordStorage, "RTBeamsTreatmentRecordStorage" }, + { UID_RTBrachyApplicationSetupDeliveryInstructionStorage, "RTBrachyApplicationSetupDeliveryInstructionStorage" }, + { UID_RTBrachyTreatmentRecordStorage, "RTBrachyTreatmentRecordStorage" }, + { UID_RTDoseStorage, "RTDoseStorage" }, + { UID_RTImageStorage, "RTImageStorage" }, + { UID_RTIonBeamsTreatmentRecordStorage, "RTIonBeamsTreatmentRecordStorage" }, + { UID_RTIonPlanStorage, "RTIonPlanStorage" }, + { UID_RTPhysicianIntentStorage, "RTPhysicianIntentStorage" }, + { UID_RTPlanStorage, "RTPlanStorage" }, + { UID_RTRadiationSetStorage, "RTRadiationSetStorage" }, + { UID_RTSegmentAnnotationStorage, "RTSegmentAnnotationStorage" }, + { UID_RTStructureSetStorage, "RTStructureSetStorage" }, + { UID_RTTreatmentSummaryRecordStorage, "RTTreatmentSummaryRecordStorage" }, + { UID_SecondaryCaptureImageStorage, "SecondaryCaptureImageStorage" }, + { UID_SegmentationStorage, "SegmentationStorage" }, + { UID_SegmentedVolumeRenderingVolumetricPresentationStateStorage, "SegmentedVolumeRenderingVolumetricPresentationStateStorage" }, + { UID_SimplifiedAdultEchoSRStorage, "SimplifiedAdultEchoSRStorage" }, + { UID_SpatialFiducialsStorage, "SpatialFiducialsStorage" }, + { UID_SpatialRegistrationStorage, "SpatialRegistrationStorage" }, + { UID_SpectaclePrescriptionReportStorage, "SpectaclePrescriptionReportStorage" }, + { UID_StereometricRelationshipStorage, "StereometricRelationshipStorage" }, + { UID_SubjectiveRefractionMeasurementsStorage, "SubjectiveRefractionMeasurementsStorage" }, + { UID_SurfaceScanMeshStorage, "SurfaceScanMeshStorage" }, + { UID_SurfaceScanPointCloudStorage, "SurfaceScanPointCloudStorage" }, + { UID_SurfaceSegmentationStorage, "SurfaceSegmentationStorage" }, + { UID_TractographyResultsStorage, "TractographyResultsStorage" }, + { UID_TwelveLeadECGWaveformStorage, "TwelveLeadECGWaveformStorage" }, + { UID_UltrasoundImageStorage, "UltrasoundImageStorage" }, + { UID_UltrasoundMultiframeImageStorage, "UltrasoundMultiframeImageStorage" }, + { UID_VideoEndoscopicImageStorage, "VideoEndoscopicImageStorage" }, + { UID_VideoMicroscopicImageStorage, "VideoMicroscopicImageStorage" }, + { UID_VideoPhotographicImageStorage, "VideoPhotographicImageStorage" }, + { UID_VisualAcuityMeasurementsStorage, "VisualAcuityMeasurementsStorage" }, + { UID_VLEndoscopicImageStorage, "VLEndoscopicImageStorage" }, + { UID_VLMicroscopicImageStorage, "VLMicroscopicImageStorage" }, + { UID_VLPhotographicImageStorage, "VLPhotographicImageStorage" }, + { UID_VLSlideCoordinatesMicroscopicImageStorage, "VLSlideCoordinatesMicroscopicImageStorage" }, + { UID_VLWholeSlideMicroscopyImageStorage, "VLWholeSlideMicroscopyImageStorage" }, + { UID_VolumeRenderingVolumetricPresentationStateStorage, "VolumeRenderingVolumetricPresentationStateStorage" }, + { UID_WideFieldOphthalmicPhotographyStereographicProjectionImageStorage, "WideFieldOphthalmicPhotographyStereographicProjectionImageStorage" }, + { UID_WideFieldOphthalmicPhotography3DCoordinatesImageStorage, "WideFieldOphthalmicPhotography3DCoordinatesImageStorage" }, + { UID_XAXRFGrayscaleSoftcopyPresentationStateStorage, "XAXRFGrayscaleSoftcopyPresentationStateStorage" }, + { UID_XRay3DAngiographicImageStorage, "XRay3DAngiographicImageStorage" }, + { UID_XRay3DCraniofacialImageStorage, "XRay3DCraniofacialImageStorage" }, + { UID_XRayAngiographicImageStorage, "XRayAngiographicImageStorage" }, + { UID_XRayRadiationDoseSRStorage, "XRayRadiationDoseSRStorage" }, + { UID_XRayRadiofluoroscopicImageStorage, "XRayRadiofluoroscopicImageStorage" }, + // Storage (retired) + { UID_RETIRED_HardcopyColorImageStorage, "RETIRED_HardcopyColorImageStorage" }, + { UID_RETIRED_HardcopyGrayscaleImageStorage, "RETIRED_HardcopyGrayscaleImageStorage" }, + { UID_RETIRED_NuclearMedicineImageStorage, "RETIRED_NuclearMedicineImageStorage" }, + { UID_RETIRED_StandaloneCurveStorage, "RETIRED_StandaloneCurveStorage" }, + { UID_RETIRED_StandaloneModalityLUTStorage, "RETIRED_StandaloneModalityLUTStorage" }, + { UID_RETIRED_StandaloneOverlayStorage, "RETIRED_StandaloneOverlayStorage" }, + { UID_RETIRED_StandalonePETCurveStorage, "RETIRED_StandalonePETCurveStorage" }, + { UID_RETIRED_StandaloneVOILUTStorage, "RETIRED_StandaloneVOILUTStorage" }, + { UID_RETIRED_StoredPrintStorage, "RETIRED_StoredPrintStorage" }, + { UID_RETIRED_UltrasoundImageStorage, "RETIRED_UltrasoundImageStorage" }, + { UID_RETIRED_UltrasoundMultiframeImageStorage, "RETIRED_UltrasoundMultiframeImageStorage" }, + { UID_RETIRED_VLImageStorage, "RETIRED_VLImageStorage" }, + { UID_RETIRED_VLMultiframeImageStorage, "RETIRED_VLMultiframeImageStorage" }, + { UID_RETIRED_XRayAngiographicBiPlaneImageStorage, "RETIRED_XRayAngiographicBiPlaneImageStorage" }, + // Storage (DICOS) + { UID_DICOS_CTImageStorage, "DICOS_CTImageStorage" }, + { UID_DICOS_DigitalXRayImageStorageForPresentation, "DICOS_DigitalXRayImageStorageForPresentation" }, + { UID_DICOS_DigitalXRayImageStorageForProcessing, "DICOS_DigitalXRayImageStorageForProcessing" }, + { UID_DICOS_ThreatDetectionReportStorage, "DICOS_ThreatDetectionReportStorage" }, + { UID_DICOS_2DAITStorage, "DICOS_2DAITStorage" }, + { UID_DICOS_3DAITStorage, "DICOS_3DAITStorage" }, + { UID_DICOS_QuadrupoleResonanceStorage, "DICOS_QuadrupoleResonanceStorage" }, + // Storage (DICONDE) + { UID_DICONDE_EddyCurrentImageStorage, "DICONDE_EddyCurrentImageStorage" }, + { UID_DICONDE_EddyCurrentMultiframeImageStorage, "DICONDE_EddyCurrentMultiframeImageStorage" }, + + // Query/Retrieve + { UID_FINDPatientRootQueryRetrieveInformationModel, "FINDPatientRootQueryRetrieveInformationModel" }, + { UID_FINDStudyRootQueryRetrieveInformationModel, "FINDStudyRootQueryRetrieveInformationModel" }, + { UID_GETPatientRootQueryRetrieveInformationModel, "GETPatientRootQueryRetrieveInformationModel" }, + { UID_GETStudyRootQueryRetrieveInformationModel, "GETStudyRootQueryRetrieveInformationModel" }, + { UID_MOVEPatientRootQueryRetrieveInformationModel, "MOVEPatientRootQueryRetrieveInformationModel" }, + { UID_MOVEStudyRootQueryRetrieveInformationModel, "MOVEStudyRootQueryRetrieveInformationModel" }, + { UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel, "RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel" }, + { UID_GETCompositeInstanceRetrieveWithoutBulkData, "GETCompositeInstanceRetrieveWithoutBulkData" }, + { UID_GETCompositeInstanceRootRetrieve, "GETCompositeInstanceRootRetrieve" }, + { UID_RETIRED_GETPatientStudyOnlyQueryRetrieveInformationModel, "RETIRED_GETPatientStudyOnlyQueryRetrieveInformationModel" }, + { UID_MOVECompositeInstanceRootRetrieve, "MOVECompositeInstanceRootRetrieve" }, + { UID_RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel, "RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel" }, + + // Modality Worklist + { UID_FINDModalityWorklistInformationModel, "FINDModalityWorklistInformationModel" }, + + // General Purpose Worklist + { UID_RETIRED_FINDGeneralPurposeWorklistInformationModel, "RETIRED_FINDGeneralPurposeWorklistInformationModel" }, + { UID_RETIRED_GeneralPurposePerformedProcedureStepSOPClass, "RETIRED_GeneralPurposePerformedProcedureStepSOPClass" }, + { UID_RETIRED_GeneralPurposeScheduledProcedureStepSOPClass, "RETIRED_GeneralPurposeScheduledProcedureStepSOPClass" }, + { UID_RETIRED_GeneralPurposeWorklistManagementMetaSOPClass, "RETIRED_GeneralPurposeWorklistManagementMetaSOPClass" }, + + // MPPS + { UID_ModalityPerformedProcedureStepNotificationSOPClass, "ModalityPerformedProcedureStepNotificationSOPClass" }, + { UID_ModalityPerformedProcedureStepRetrieveSOPClass, "ModalityPerformedProcedureStepRetrieveSOPClass" }, + { UID_ModalityPerformedProcedureStepSOPClass, "ModalityPerformedProcedureStepSOPClass" }, + + // Radiotherapy + { UID_RTConventionalMachineVerification, "RTConventionalMachineVerification" }, + { UID_RTIonMachineVerification, "RTIonMachineVerification" }, + + // Unified Worklist and Procedure Step + { UID_UnifiedWorklistAndProcedureStepServiceClass, "UnifiedWorklistAndProcedureStepServiceClass" }, + { UID_UnifiedProcedureStepPushSOPClass, "UnifiedProcedureStepPushSOPClass" }, + { UID_UnifiedProcedureStepWatchSOPClass, "UnifiedProcedureStepWatchSOPClass" }, + { UID_UnifiedProcedureStepPullSOPClass, "UnifiedProcedureStepPullSOPClass" }, + { UID_UnifiedProcedureStepEventSOPClass, "UnifiedProcedureStepEventSOPClass" }, + { UID_UPSGlobalSubscriptionSOPInstance, "UPSGlobalSubscriptionSOPInstance" }, + { UID_UPSFilteredGlobalSubscriptionSOPInstance, "UPSFilteredGlobalSubscriptionSOPInstance" }, + + // Storage Commitment + { UID_RETIRED_StorageCommitmentPullModelSOPClass, "RETIRED_StorageCommitmentPullModelSOPClass" }, + { UID_RETIRED_StorageCommitmentPullModelSOPInstance, "RETIRED_StorageCommitmentPullModelSOPInstance" }, + { UID_StorageCommitmentPushModelSOPClass, "StorageCommitmentPushModelSOPClass" }, + { UID_StorageCommitmentPushModelSOPInstance, "StorageCommitmentPushModelSOPInstance" }, + + // Hanging Protocols + { UID_FINDHangingProtocolInformationModel, "FINDHangingProtocolInformationModel" }, + { UID_MOVEHangingProtocolInformationModel, "MOVEHangingProtocolInformationModel" }, + + // Relevant Patient Information Query + { UID_BreastImagingRelevantPatientInformationQuery, "BreastImagingRelevantPatientInformationQuery" }, + { UID_CardiacRelevantPatientInformationQuery, "CardiacRelevantPatientInformationQuery" }, + { UID_GeneralRelevantPatientInformationQuery, "GeneralRelevantPatientInformationQuery" }, + + // Color Palette Query/Retrieve + { UID_FINDColorPaletteInformationModel, "FINDColorPaletteInformationModel" }, + { UID_MOVEColorPaletteInformationModel, "MOVEColorPaletteInformationModel" }, + { UID_GETColorPaletteInformationModel, "GETColorPaletteInformationModel" }, + + // Implant Template Query/Retrieve + { UID_FINDGenericImplantTemplateInformationModel, "FINDGenericImplantTemplateInformationModel" }, + { UID_MOVEGenericImplantTemplateInformationModel, "MOVEGenericImplantTemplateInformationModel" }, + { UID_GETGenericImplantTemplateInformationModel, "GETGenericImplantTemplateInformationModel" }, + { UID_FINDImplantAssemblyTemplateInformationModel, "FINDImplantAssemblyTemplateInformationModel" }, + { UID_MOVEImplantAssemblyTemplateInformationModel, "MOVEImplantAssemblyTemplateInformationModel" }, + { UID_GETImplantAssemblyTemplateInformationModel, "GETImplantAssemblyTemplateInformationModel" }, + { UID_FINDImplantTemplateGroupInformationModel, "FINDImplantTemplateGroupInformationModel" }, + { UID_MOVEImplantTemplateGroupInformationModel, "MOVEImplantTemplateGroupInformationModel" }, + { UID_GETImplantTemplateGroupInformationModel, "GETImplantTemplateGroupInformationModel" }, + + // Defined Procedure Protocol Query/Retrieve + { UID_FINDDefinedProcedureProtocolInformationModel, "FINDDefinedProcedureProtocolInformationModel" }, + { UID_MOVEDefinedProcedureProtocolInformationModel, "MOVEDefinedProcedureProtocolInformationModel" }, + { UID_GETDefinedProcedureProtocolInformationModel, "GETDefinedProcedureProtocolInformationModel" }, + + // Protocol Approval Query/Retrieve + { UID_FINDProtocolApprovalInformationModel, "FINDProtocolApprovalInformationModel" }, + { UID_MOVEProtocolApprovalInformationModel, "MOVEProtocolApprovalInformationModel" }, + { UID_GETProtocolApprovalInformationModel, "GETProtocolApprovalInformationModel" }, + + // Print + { UID_BasicAnnotationBoxSOPClass, "BasicAnnotationBoxSOPClass" }, + { UID_BasicColorImageBoxSOPClass, "BasicColorImageBoxSOPClass" }, + { UID_BasicColorPrintManagementMetaSOPClass, "BasicColorPrintManagementMetaSOPClass" }, + { UID_BasicFilmBoxSOPClass, "BasicFilmBoxSOPClass" }, + { UID_BasicFilmSessionSOPClass, "BasicFilmSessionSOPClass" }, + { UID_BasicGrayscaleImageBoxSOPClass, "BasicGrayscaleImageBoxSOPClass" }, + { UID_BasicGrayscalePrintManagementMetaSOPClass, "BasicGrayscalePrintManagementMetaSOPClass" }, + { UID_PresentationLUTSOPClass, "PresentationLUTSOPClass" }, + { UID_PrintJobSOPClass, "PrintJobSOPClass" }, + { UID_PrinterConfigurationRetrievalSOPClass, "PrinterConfigurationRetrievalSOPClass" }, + { UID_PrinterConfigurationRetrievalSOPInstance, "PrinterConfigurationRetrievalSOPInstance" }, + { UID_PrinterSOPClass, "PrinterSOPClass" }, + { UID_PrinterSOPInstance, "PrinterSOPInstance" }, + { UID_RETIRED_BasicPrintImageOverlayBoxSOPClass, "RETIRED_BasicPrintImageOverlayBoxSOPClass" }, + { UID_RETIRED_ImageOverlayBoxSOPClass, "RETIRED_ImageOverlayBoxSOPClass" }, + { UID_RETIRED_PrintQueueManagementSOPClass, "RETIRED_PrintQueueManagementSOPClass" }, + { UID_RETIRED_PrintQueueSOPInstance, "RETIRED_PrintQueueSOPInstance" }, + { UID_RETIRED_PullPrintRequestSOPClass, "RETIRED_PullPrintRequestSOPClass" }, + { UID_RETIRED_PullStoredPrintManagementMetaSOPClass, "RETIRED_PullStoredPrintManagementMetaSOPClass" }, + { UID_RETIRED_ReferencedColorPrintManagementMetaSOPClass, "RETIRED_ReferencedColorPrintManagementMetaSOPClass" }, + { UID_RETIRED_ReferencedGrayscalePrintManagementMetaSOPClass, "RETIRED_ReferencedGrayscalePrintManagementMetaSOPClass" }, + { UID_RETIRED_ReferencedImageBoxSOPClass, "RETIRED_ReferencedImageBoxSOPClass" }, + { UID_VOILUTBoxSOPClass, "VOILUTBoxSOPClass" }, + + // Detached Management + { UID_RETIRED_DetachedInterpretationManagementSOPClass, "RETIRED_DetachedInterpretationManagementSOPClass" }, + { UID_RETIRED_DetachedPatientManagementMetaSOPClass, "RETIRED_DetachedPatientManagementMetaSOPClass" }, + { UID_RETIRED_DetachedPatientManagementSOPClass, "RETIRED_DetachedPatientManagementSOPClass" }, + { UID_RETIRED_DetachedResultsManagementMetaSOPClass, "RETIRED_DetachedResultsManagementMetaSOPClass" }, + { UID_RETIRED_DetachedResultsManagementSOPClass, "RETIRED_DetachedResultsManagementSOPClass" }, + { UID_RETIRED_DetachedStudyManagementMetaSOPClass, "RETIRED_DetachedStudyManagementMetaSOPClass" }, + { UID_RETIRED_DetachedStudyManagementSOPClass, "RETIRED_DetachedStudyManagementSOPClass" }, + { UID_RETIRED_DetachedVisitManagementSOPClass, "RETIRED_DetachedVisitManagementSOPClass" }, + + // Procedure Log + { UID_ProceduralEventLoggingSOPClass, "ProceduralEventLoggingSOPClass" }, + { UID_ProceduralEventLoggingSOPInstance, "ProceduralEventLoggingSOPInstance" }, + + // Substance Administration + { UID_SubstanceAdministrationLoggingSOPClass, "SubstanceAdministrationLoggingSOPClass" }, + { UID_SubstanceAdministrationLoggingSOPInstance, "SubstanceAdministrationLoggingSOPInstance" }, + { UID_ProductCharacteristicsQuerySOPClass, "ProductCharacteristicsQuerySOPClass" }, + { UID_SubstanceApprovalQuerySOPClass, "SubstanceApprovalQuerySOPClass" }, + + // Media Creation + { UID_MediaCreationManagementSOPClass, "MediaCreationManagementSOPClass" }, + + // SOP Class Relationship Negotiation + { UID_StorageServiceClass, "StorageServiceClass" }, + + // Instance Availability Notification + { UID_InstanceAvailabilityNotificationSOPClass, "InstanceAvailabilityNotificationSOPClass" }, + + // Application Hosting + { UID_NativeDICOMModel, "NativeDICOMModel" }, + { UID_AbstractMultiDimensionalImageModel, "AbstractMultiDimensionalImageModel" }, + + // Communication of Display Parameters + { UID_DisplaySystemSOPClass, "DisplaySystemSOPClass" }, + { UID_DisplaySystemSOPInstance, "DisplaySystemSOPInstance" }, + + // Other + { UID_RETIRED_BasicStudyContentNotificationSOPClass, "RETIRED_BasicStudyContentNotificationSOPClass" }, + { UID_RETIRED_StudyComponentManagementSOPClass, "RETIRED_StudyComponentManagementSOPClass" }, + { UID_VerificationSOPClass, "VerificationSOPClass" }, + + // Mapping Resources + { UID_DICOMContentMappingResource, "DICOMContentMappingResource" }, + + // Coding Schemes + { UID_DICOMControlledTerminologyCodingScheme, "DICOMControlledTerminologyCodingScheme" }, + { UID_DICOMUIDRegistryCodingScheme, "DICOMUIDRegistryCodingScheme" }, + + // Configuration Management LDAP UIDs + { UID_LDAP_dicomAETitle, "LDAP_dicomAETitle" }, + { UID_LDAP_dicomApplicationCluster, "LDAP_dicomApplicationCluster" }, + { UID_LDAP_dicomAssociationAcceptor, "LDAP_dicomAssociationAcceptor" }, + { UID_LDAP_dicomAssociationInitiator, "LDAP_dicomAssociationInitiator" }, + { UID_LDAP_dicomAuthorizedNodeCertificateReference, "LDAP_dicomAuthorizedNodeCertificateReference" }, + { UID_LDAP_dicomConfigurationRoot, "LDAP_dicomConfigurationRoot" }, + { UID_LDAP_dicomDescription, "LDAP_dicomDescription" }, + { UID_LDAP_dicomDevice, "LDAP_dicomDevice" }, + { UID_LDAP_dicomDeviceName, "LDAP_dicomDeviceName" }, + { UID_LDAP_dicomDeviceSerialNumber, "LDAP_dicomDeviceSerialNumber" }, + { UID_LDAP_dicomDevicesRoot, "LDAP_dicomDevicesRoot" }, + { UID_LDAP_dicomHostname, "LDAP_dicomHostname" }, + { UID_LDAP_dicomInstalled, "LDAP_dicomInstalled" }, + { UID_LDAP_dicomInstitutionAddress, "LDAP_dicomInstitutionAddress" }, + { UID_LDAP_dicomInstitutionDepartmentName, "LDAP_dicomInstitutionDepartmentName" }, + { UID_LDAP_dicomInstitutionName, "LDAP_dicomInstitutionName" }, + { UID_LDAP_dicomIssuerOfPatientID, "LDAP_dicomIssuerOfPatientID" }, + { UID_LDAP_dicomManufacturer, "LDAP_dicomManufacturer" }, + { UID_LDAP_dicomManufacturerModelName, "LDAP_dicomManufacturerModelName" }, + { UID_LDAP_dicomNetworkAE, "LDAP_dicomNetworkAE" }, + { UID_LDAP_dicomNetworkConnection, "LDAP_dicomNetworkConnection" }, + { UID_LDAP_dicomNetworkConnectionReference, "LDAP_dicomNetworkConnectionReference" }, + { UID_LDAP_dicomPort, "LDAP_dicomPort" }, + { UID_LDAP_dicomPreferredCalledAETitle, "LDAP_dicomPreferredCalledAETitle" }, + { UID_LDAP_dicomPreferredCallingAETitle, "LDAP_dicomPreferredCallingAETitle" }, + { UID_LDAP_dicomPrimaryDeviceType, "LDAP_dicomPrimaryDeviceType" }, + { UID_LDAP_dicomRelatedDeviceReference, "LDAP_dicomRelatedDeviceReference" }, + { UID_LDAP_dicomSOPClass, "LDAP_dicomSOPClass" }, + { UID_LDAP_dicomSoftwareVersion, "LDAP_dicomSoftwareVersion" }, + { UID_LDAP_dicomStationName, "LDAP_dicomStationName" }, + { UID_LDAP_dicomSupportedCharacterSet, "LDAP_dicomSupportedCharacterSet" }, + { UID_LDAP_dicomTLSCyphersuite, "LDAP_dicomTLSCyphersuite" }, + { UID_LDAP_dicomThisNodeCertificateReference, "LDAP_dicomThisNodeCertificateReference" }, + { UID_LDAP_dicomTransferCapability, "LDAP_dicomTransferCapability" }, + { UID_LDAP_dicomTransferRole, "LDAP_dicomTransferRole" }, + { UID_LDAP_dicomTransferSyntax, "LDAP_dicomTransferSyntax" }, + { UID_LDAP_dicomUniqueAETitle, "LDAP_dicomUniqueAETitle" }, + { UID_LDAP_dicomUniqueAETitlesRegistryRoot, "LDAP_dicomUniqueAETitlesRegistryRoot" }, + { UID_LDAP_dicomVendorData, "LDAP_dicomVendorData" }, + + // Well-known Frame of References + { UID_ICBM452T1FrameOfReference, "ICBM452T1FrameOfReference" }, + { UID_ICBMSingleSubjectMRIFrameOfReference, "ICBMSingleSubjectMRIFrameOfReference" }, + { UID_IEC61217FixedCoordinateSystemFrameOfReference, "IEC61217FixedCoordinateSystemFrameOfReference" }, + { UID_SPM2AVG152PDFrameOfReference, "SPM2AVG152PDFrameOfReference" }, + { UID_SPM2AVG152T1FrameOfReference, "SPM2AVG152T1FrameOfReference" }, + { UID_SPM2AVG152T2FrameOfReference, "SPM2AVG152T2FrameOfReference" }, + { UID_SPM2AVG305T1FrameOfReference, "SPM2AVG305T1FrameOfReference" }, + { UID_SPM2BRAINMASKFrameOfReference, "SPM2BRAINMASKFrameOfReference" }, + { UID_SPM2CSFFrameOfReference, "SPM2CSFFrameOfReference" }, + { UID_SPM2EPIFrameOfReference, "SPM2EPIFrameOfReference" }, + { UID_SPM2FILT1FrameOfReference, "SPM2FILT1FrameOfReference" }, + { UID_SPM2GRAYFrameOfReference, "SPM2GRAYFrameOfReference" }, + { UID_SPM2PDFrameOfReference, "SPM2PDFrameOfReference" }, + { UID_SPM2PETFrameOfReference, "SPM2PETFrameOfReference" }, + { UID_SPM2SINGLESUBJT1FrameOfReference, "SPM2SINGLESUBJT1FrameOfReference" }, + { UID_SPM2SPECTFrameOfReference, "SPM2SPECTFrameOfReference" }, + { UID_SPM2T1FrameOfReference, "SPM2T1FrameOfReference" }, + { UID_SPM2T2FrameOfReference, "SPM2T2FrameOfReference" }, + { UID_SPM2TRANSMFrameOfReference, "SPM2TRANSMFrameOfReference" }, + { UID_SPM2WHITEFrameOfReference, "SPM2WHITEFrameOfReference" }, + { UID_TalairachBrainAtlasFrameOfReference, "TalairachBrainAtlasFrameOfReference" }, + + // UTC Synchronization Frame of Reference + { UID_UniversalCoordinatedTimeSynchronizationFrameOfReference, "UniversalCoordinatedTimeSynchronizationFrameOfReference" }, + + // Well-known SOP Instances for Color Palettes + { UID_HotIronColorPaletteSOPInstance, "HotIronColorPaletteSOPInstance" }, + { UID_HotMetalBlueColorPaletteSOPInstance, "HotMetalBlueColorPaletteSOPInstance" }, + { UID_PET20StepColorPaletteSOPInstance, "PET20StepColorPaletteSOPInstance" }, + { UID_PETColorPaletteSOPInstance, "PETColorPaletteSOPInstance" }, + { UID_SpringColorPaletteSOPInstance, "SpringColorPaletteSOPInstance" }, + { UID_SummerColorPaletteSOPInstance, "SummerColorPaletteSOPInstance" }, + { UID_FallColorPaletteSOPInstance, "FallColorPaletteSOPInstance" }, + { UID_WinterColorPaletteSOPInstance, "WinterColorPaletteSOPInstance" }, + + // Draft Supplements + { UID_DRAFT_RTBeamsDeliveryInstructionStorage, "DRAFT_RTBeamsDeliveryInstructionStorage" }, + { UID_DRAFT_RTConventionalMachineVerification, "DRAFT_RTConventionalMachineVerification" }, + { UID_DRAFT_RTIonMachineVerification, "DRAFT_RTIonMachineVerification" }, + { UID_DRAFT_SRAudioStorage, "DRAFT_SRAudioStorage" }, + { UID_DRAFT_SRComprehensiveStorage, "DRAFT_SRComprehensiveStorage" }, + { UID_DRAFT_SRDetailStorage, "DRAFT_SRDetailStorage" }, + { UID_DRAFT_SRTextStorage, "DRAFT_SRTextStorage" }, + { UID_DRAFT_WaveformStorage, "DRAFT_WaveformStorage" }, + { UID_DRAFT_UnifiedWorklistAndProcedureStepServiceClass, "DRAFT_UnifiedWorklistAndProcedureStepServiceClass" }, + { UID_DRAFT_UnifiedProcedureStepPushSOPClass, "DRAFT_UnifiedProcedureStepPushSOPClass" }, + { UID_DRAFT_UnifiedProcedureStepWatchSOPClass, "DRAFT_UnifiedProcedureStepWatchSOPClass" }, + { UID_DRAFT_UnifiedProcedureStepPullSOPClass, "DRAFT_UnifiedProcedureStepPullSOPClass" }, + { UID_DRAFT_UnifiedProcedureStepEventSOPClass, "DRAFT_UnifiedProcedureStepEventSOPClass" }, + + { NULL, NULL } +}; + +static const int uidNameMap_size = OFstatic_cast(int, sizeof(uidNameMap) / sizeof(UIDNameMap)); + + +/** an array of const strings containing all known Storage SOP Classes + * that fit into the conventional PATIENT-STUDY-SERIES-INSTANCE information + * model, i.e. everything a Storage SCP might want to store in a PACS. + * Special cases such as the Hanging Protocol or Color Palette Storage SOP + * Class are not included in this list but in dcmNonPatientStorageSOPClassUIDs. + * + * THIS LIST CONTAINS ALL STORAGE SOP CLASSES INCLUDING RETIRED ONES + * AND IS (MUCH) LARGER THAN 64 ENTRIES. + */ + +const char* dcmAllStorageSOPClassUIDs[] = { + UID_AcquisitionContextSRStorage, + UID_AdvancedBlendingPresentationStateStorage, + UID_AmbulatoryECGWaveformStorage, + UID_ArterialPulseWaveformStorage, + UID_AutorefractionMeasurementsStorage, + UID_BasicStructuredDisplayStorage, + UID_BasicTextSRStorage, + UID_BasicVoiceAudioWaveformStorage, + UID_BlendingSoftcopyPresentationStateStorage, + UID_BreastProjectionXRayImageStorageForPresentation, + UID_BreastProjectionXRayImageStorageForProcessing, + UID_BreastTomosynthesisImageStorage, + UID_CardiacElectrophysiologyWaveformStorage, + UID_CArmPhotonElectronRadiationStorage, + UID_ChestCADSRStorage, + UID_ColonCADSRStorage, + UID_ColorSoftcopyPresentationStateStorage, + UID_CompositingPlanarMPRVolumetricPresentationStateStorage, + UID_Comprehensive3DSRStorage, + UID_ComprehensiveSRStorage, + UID_ComputedRadiographyImageStorage, + UID_ContentAssessmentResultsStorage, + UID_CornealTopographyMapStorage, + UID_CTImageStorage, + UID_CTPerformedProcedureProtocolStorage, + UID_DeformableSpatialRegistrationStorage, + UID_DigitalIntraOralXRayImageStorageForPresentation, + UID_DigitalIntraOralXRayImageStorageForProcessing, + UID_DigitalMammographyXRayImageStorageForPresentation, + UID_DigitalMammographyXRayImageStorageForProcessing, + UID_DigitalXRayImageStorageForPresentation, + UID_DigitalXRayImageStorageForProcessing, + UID_EncapsulatedCDAStorage, + UID_EncapsulatedPDFStorage, + UID_EncapsulatedSTLStorage, + UID_EnhancedCTImageStorage, + UID_EnhancedMRColorImageStorage, + UID_EnhancedMRImageStorage, + UID_EnhancedPETImageStorage, + UID_EnhancedSRStorage, + UID_EnhancedUSVolumeStorage, + UID_EnhancedXAImageStorage, + UID_EnhancedXRFImageStorage, + UID_ExtensibleSRStorage, + UID_GeneralAudioWaveformStorage, + UID_GeneralECGWaveformStorage, + UID_GrayscalePlanarMPRVolumetricPresentationStateStorage, + UID_GrayscaleSoftcopyPresentationStateStorage, + UID_HemodynamicWaveformStorage, + UID_ImplantationPlanSRDocumentStorage, + UID_IntraocularLensCalculationsStorage, + UID_IntravascularOpticalCoherenceTomographyImageStorageForPresentation, + UID_IntravascularOpticalCoherenceTomographyImageStorageForProcessing, + UID_KeratometryMeasurementsStorage, + UID_KeyObjectSelectionDocumentStorage, + UID_LegacyConvertedEnhancedCTImageStorage, + UID_LegacyConvertedEnhancedMRImageStorage, + UID_LegacyConvertedEnhancedPETImageStorage, + UID_LensometryMeasurementsStorage, + UID_MacularGridThicknessAndVolumeReportStorage, + UID_MammographyCADSRStorage, + UID_MRImageStorage, + UID_MRSpectroscopyStorage, + UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, + UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, + UID_MultiframeSingleBitSecondaryCaptureImageStorage, + UID_MultiframeTrueColorSecondaryCaptureImageStorage, + UID_MultipleVolumeRenderingVolumetricPresentationStateStorage, + UID_NuclearMedicineImageStorage, + UID_OphthalmicAxialMeasurementsStorage, + UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage, + UID_OphthalmicOpticalCoherenceTomographyEnFaceImageStorage, + UID_OphthalmicPhotography16BitImageStorage, + UID_OphthalmicPhotography8BitImageStorage, + UID_OphthalmicThicknessMapStorage, + UID_OphthalmicTomographyImageStorage, + UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, + UID_ParametricMapStorage, + UID_PatientRadiationDoseSRStorage, + UID_PerformedImagingAgentAdministrationSRStorage, + UID_PlannedImagingAgentAdministrationSRStorage, + UID_PositronEmissionTomographyImageStorage, + UID_ProcedureLogStorage, + UID_PseudoColorSoftcopyPresentationStateStorage, + UID_RadiopharmaceuticalRadiationDoseSRStorage, + UID_RawDataStorage, + UID_RealWorldValueMappingStorage, + UID_RespiratoryWaveformStorage, + UID_RTBeamsDeliveryInstructionStorage, + UID_RTBeamsTreatmentRecordStorage, + UID_RTBrachyApplicationSetupDeliveryInstructionStorage, + UID_RTBrachyTreatmentRecordStorage, + UID_RTDoseStorage, + UID_RTImageStorage, + UID_RTIonBeamsTreatmentRecordStorage, + UID_RTIonPlanStorage, + UID_RTPhysicianIntentStorage, + UID_RTPlanStorage, + UID_RTRadiationSetStorage, + UID_RTSegmentAnnotationStorage, + UID_RTStructureSetStorage, + UID_RTTreatmentSummaryRecordStorage, + UID_SecondaryCaptureImageStorage, + UID_SegmentationStorage, + UID_SegmentedVolumeRenderingVolumetricPresentationStateStorage, + UID_SimplifiedAdultEchoSRStorage, + UID_SpatialFiducialsStorage, + UID_SpatialRegistrationStorage, + UID_SpectaclePrescriptionReportStorage, + UID_StereometricRelationshipStorage, + UID_SubjectiveRefractionMeasurementsStorage, + UID_SurfaceScanMeshStorage, + UID_SurfaceScanPointCloudStorage, + UID_SurfaceSegmentationStorage, + UID_TractographyResultsStorage, + UID_TwelveLeadECGWaveformStorage, + UID_UltrasoundImageStorage, + UID_UltrasoundMultiframeImageStorage, + UID_VideoEndoscopicImageStorage, + UID_VideoMicroscopicImageStorage, + UID_VideoPhotographicImageStorage, + UID_VisualAcuityMeasurementsStorage, + UID_VLEndoscopicImageStorage, + UID_VLMicroscopicImageStorage, + UID_VLPhotographicImageStorage, + UID_VLSlideCoordinatesMicroscopicImageStorage, + UID_VLWholeSlideMicroscopyImageStorage, + UID_VolumeRenderingVolumetricPresentationStateStorage, + UID_WideFieldOphthalmicPhotographyStereographicProjectionImageStorage, + UID_WideFieldOphthalmicPhotography3DCoordinatesImageStorage, + UID_XAXRFGrayscaleSoftcopyPresentationStateStorage, + UID_XRay3DAngiographicImageStorage, + UID_XRay3DCraniofacialImageStorage, + UID_XRayAngiographicImageStorage, + UID_XRayRadiationDoseSRStorage, + UID_XRayRadiofluoroscopicImageStorage, + // non-patient DICOM objects: + // - do not add them here but in dcmNonPatientStorageSOPClassUIDs + // retired + UID_RETIRED_HardcopyColorImageStorage, + UID_RETIRED_HardcopyGrayscaleImageStorage, + UID_RETIRED_NuclearMedicineImageStorage, + UID_RETIRED_StandaloneCurveStorage, + UID_RETIRED_StandaloneModalityLUTStorage, + UID_RETIRED_StandaloneOverlayStorage, + UID_RETIRED_StandalonePETCurveStorage, + UID_RETIRED_StandaloneVOILUTStorage, + UID_RETIRED_StoredPrintStorage, + UID_RETIRED_UltrasoundImageStorage, + UID_RETIRED_UltrasoundMultiframeImageStorage, + UID_RETIRED_VLImageStorage, + UID_RETIRED_VLMultiframeImageStorage, + UID_RETIRED_XRayAngiographicBiPlaneImageStorage, + // draft + UID_DRAFT_SRAudioStorage, + UID_DRAFT_SRComprehensiveStorage, + UID_DRAFT_SRDetailStorage, + UID_DRAFT_SRTextStorage, + UID_DRAFT_WaveformStorage, + UID_DRAFT_RTBeamsDeliveryInstructionStorage, + // DICOS + UID_DICOS_CTImageStorage, + UID_DICOS_DigitalXRayImageStorageForPresentation, + UID_DICOS_DigitalXRayImageStorageForProcessing, + UID_DICOS_ThreatDetectionReportStorage, + UID_DICOS_2DAITStorage, + UID_DICOS_3DAITStorage, + UID_DICOS_QuadrupoleResonanceStorage, + // DICONDE + UID_DICONDE_EddyCurrentImageStorage, + UID_DICONDE_EddyCurrentMultiframeImageStorage, + NULL +}; + +const int numberOfDcmAllStorageSOPClassUIDs = OFstatic_cast(int, sizeof(dcmAllStorageSOPClassUIDs) / sizeof(const char*) - 1); + + +/** an array of const strings containing all known Storage SOP Classes + * that do not fit into the conventional PATIENT-STUDY-SERIES-INSTANCE + * information model. See function dcmIsaStorageSOPClassUID(). + */ + +const char* dcmNonPatientStorageSOPClassUIDs[] = { + UID_ColorPaletteStorage, + UID_CTDefinedProcedureProtocolStorage, + UID_GenericImplantTemplateStorage, + UID_HangingProtocolStorage, + UID_ImplantAssemblyTemplateStorage, + UID_ImplantTemplateGroupStorage, + UID_ProtocolApprovalStorage, + // end marker (important!) + NULL +}; + + +/* an array of const strings containing all storage SOP classes that + * are proposed by default by those Storage SCU components in DCMTK + * that always propose one presentation context for each SOP class, + * e.g. movescu or dcmqrdb. This list is guaranteed to have at most + * 120 entries (currently: 120) to leave enough room for FIND/MOVE + * presentation contexts. + */ +const char* dcmLongSCUStorageSOPClassUIDs[] = { + UID_AmbulatoryECGWaveformStorage, + UID_ArterialPulseWaveformStorage, + UID_AutorefractionMeasurementsStorage, + UID_BasicStructuredDisplayStorage, + UID_BasicTextSRStorage, + UID_BasicVoiceAudioWaveformStorage, + UID_BlendingSoftcopyPresentationStateStorage, + UID_BreastTomosynthesisImageStorage, + UID_CardiacElectrophysiologyWaveformStorage, + UID_ChestCADSRStorage, + UID_ColonCADSRStorage, + UID_ColorSoftcopyPresentationStateStorage, + UID_Comprehensive3DSRStorage, + UID_ComprehensiveSRStorage, + UID_ComputedRadiographyImageStorage, + UID_CTImageStorage, + UID_DeformableSpatialRegistrationStorage, + UID_DigitalIntraOralXRayImageStorageForPresentation, + UID_DigitalIntraOralXRayImageStorageForProcessing, + UID_DigitalMammographyXRayImageStorageForPresentation, + UID_DigitalMammographyXRayImageStorageForProcessing, + UID_DigitalXRayImageStorageForPresentation, + UID_DigitalXRayImageStorageForProcessing, + UID_EncapsulatedCDAStorage, + UID_EncapsulatedPDFStorage, + UID_EnhancedCTImageStorage, + UID_EnhancedMRColorImageStorage, + UID_EnhancedMRImageStorage, + UID_EnhancedPETImageStorage, + UID_EnhancedSRStorage, + UID_EnhancedUSVolumeStorage, + UID_EnhancedXAImageStorage, + UID_EnhancedXRFImageStorage, + UID_GeneralAudioWaveformStorage, + UID_GeneralECGWaveformStorage, + UID_GrayscaleSoftcopyPresentationStateStorage, + UID_HemodynamicWaveformStorage, + UID_ImplantationPlanSRDocumentStorage, + UID_IntraocularLensCalculationsStorage, + UID_IntravascularOpticalCoherenceTomographyImageStorageForPresentation, + UID_IntravascularOpticalCoherenceTomographyImageStorageForProcessing, + UID_KeratometryMeasurementsStorage, + UID_KeyObjectSelectionDocumentStorage, + UID_LegacyConvertedEnhancedCTImageStorage, + UID_LegacyConvertedEnhancedMRImageStorage, + UID_LegacyConvertedEnhancedPETImageStorage, + UID_LensometryMeasurementsStorage, + UID_MacularGridThicknessAndVolumeReportStorage, + UID_MammographyCADSRStorage, + UID_MRImageStorage, + UID_MRSpectroscopyStorage, + UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, + UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, + UID_MultiframeSingleBitSecondaryCaptureImageStorage, + UID_MultiframeTrueColorSecondaryCaptureImageStorage, + UID_NuclearMedicineImageStorage, + UID_OphthalmicAxialMeasurementsStorage, + UID_OphthalmicPhotography16BitImageStorage, + UID_OphthalmicPhotography8BitImageStorage, + UID_OphthalmicThicknessMapStorage, + UID_OphthalmicTomographyImageStorage, + UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, + UID_PositronEmissionTomographyImageStorage, + UID_ProcedureLogStorage, + UID_PseudoColorSoftcopyPresentationStateStorage, + UID_RawDataStorage, + UID_RealWorldValueMappingStorage, + UID_RespiratoryWaveformStorage, + UID_RTBeamsDeliveryInstructionStorage, + UID_RTBeamsTreatmentRecordStorage, + UID_RTBrachyTreatmentRecordStorage, + UID_RTDoseStorage, + UID_RTImageStorage, + UID_RTIonBeamsTreatmentRecordStorage, + UID_RTIonPlanStorage, + UID_RTPlanStorage, + UID_RTStructureSetStorage, + UID_RTTreatmentSummaryRecordStorage, + UID_SecondaryCaptureImageStorage, + UID_SegmentationStorage, + UID_SpatialFiducialsStorage, + UID_SpatialRegistrationStorage, + UID_SpectaclePrescriptionReportStorage, + UID_StereometricRelationshipStorage, + UID_SubjectiveRefractionMeasurementsStorage, + UID_SurfaceScanMeshStorage, + UID_SurfaceScanPointCloudStorage, + UID_SurfaceSegmentationStorage, + UID_TwelveLeadECGWaveformStorage, + UID_UltrasoundImageStorage, + UID_UltrasoundMultiframeImageStorage, + UID_VideoEndoscopicImageStorage, + UID_VideoMicroscopicImageStorage, + UID_VideoPhotographicImageStorage, + UID_VisualAcuityMeasurementsStorage, + UID_VLEndoscopicImageStorage, + UID_VLMicroscopicImageStorage, + UID_VLPhotographicImageStorage, + UID_VLSlideCoordinatesMicroscopicImageStorage, + UID_VLWholeSlideMicroscopyImageStorage, + UID_XAXRFGrayscaleSoftcopyPresentationStateStorage, + UID_XRay3DAngiographicImageStorage, + UID_XRay3DCraniofacialImageStorage, + UID_XRayAngiographicImageStorage, + UID_XRayRadiationDoseSRStorage, + UID_XRayRadiofluoroscopicImageStorage, + // recently approved +// UID_AcquisitionContextSRStorage, +// UID_AdvancedBlendingPresentationStateStorage, +// UID_BreastProjectionXRayImageStorageForPresentation, +// UID_BreastProjectionXRayImageStorageForProcessing, +// UID_CArmPhotonElectronRadiationStorage, +// UID_CompositingPlanarMPRVolumetricPresentationStateStorage, +// UID_ContentAssessmentResultsStorage, +// UID_CornealTopographyMapStorage, +// UID_CTPerformedProcedureProtocolStorage, +// UID_EncapsulatedSTLStorage, +// UID_ExtensibleSRStorage, +// UID_GrayscalePlanarMPRVolumetricPresentationStateStorage +// UID_MultipleVolumeRenderingVolumetricPresentationStateStorage, +// UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage, +// UID_OphthalmicOpticalCoherenceTomographyEnFaceImageStorage, +// UID_ParametricMapStorage, +// UID_PatientRadiationDoseSRStorage, +// UID_PerformedImagingAgentAdministrationSRStorage, +// UID_PlannedImagingAgentAdministrationSRStorage, +// UID_RadiopharmaceuticalRadiationDoseSRStorage, +// UID_RTBrachyApplicationSetupDeliveryInstructionStorage, +// UID_RTPhysicianIntentStorage, +// UID_RTRadiationSetStorage, +// UID_RTSegmentAnnotationStorage, +// UID_SegmentedVolumeRenderingVolumetricPresentationStateStorage, +// UID_SimplifiedAdultEchoSRStorage, +// UID_TractographyResultsStorage, +// UID_VolumeRenderingVolumetricPresentationStateStorage, +// UID_WideFieldOphthalmicPhotographyStereographicProjectionImageStorage, +// UID_WideFieldOphthalmicPhotography3DCoordinatesImageStorage, + // non-patient +// UID_ColorPaletteStorage, +// UID_CTDefinedProcedureProtocolStorage, +// UID_GenericImplantTemplateStorage, +// UID_HangingProtocolStorage, +// UID_ImplantAssemblyTemplateStorage, +// UID_ImplantTemplateGroupStorage, +// UID_ProtocolApprovalStorage, + // retired + UID_RETIRED_HardcopyColorImageStorage, + UID_RETIRED_HardcopyGrayscaleImageStorage, + UID_RETIRED_NuclearMedicineImageStorage, + UID_RETIRED_StandaloneCurveStorage, + UID_RETIRED_StandaloneModalityLUTStorage, + UID_RETIRED_StandaloneOverlayStorage, + UID_RETIRED_StandalonePETCurveStorage, + UID_RETIRED_StandaloneVOILUTStorage, + UID_RETIRED_StoredPrintStorage, + UID_RETIRED_UltrasoundImageStorage, + UID_RETIRED_UltrasoundMultiframeImageStorage, + UID_RETIRED_VLImageStorage, + UID_RETIRED_VLMultiframeImageStorage, + UID_RETIRED_XRayAngiographicBiPlaneImageStorage, + // draft +// UID_DRAFT_RTBeamsDeliveryInstructionStorage, +// UID_DRAFT_SRAudioStorage, +// UID_DRAFT_SRComprehensiveStorage, +// UID_DRAFT_SRDetailStorage, +// UID_DRAFT_SRTextStorage, +// UID_DRAFT_WaveformStorage, + // DICOS +// UID_DICOS_CTImageStorage, +// UID_DICOS_DigitalXRayImageStorageForPresentation, +// UID_DICOS_DigitalXRayImageStorageForProcessing, +// UID_DICOS_ThreatDetectionReportStorage, +// UID_DICOS_2DAITStorage, +// UID_DICOS_3DAITStorage, +// UID_DICOS_QuadrupoleResonanceStorage, + // DICONDE +// UID_DICONDE_EddyCurrentImageStorage, +// UID_DICONDE_EddyCurrentMultiframeImageStorage, + NULL +}; + +const int numberOfDcmLongSCUStorageSOPClassUIDs = OFstatic_cast(int, sizeof(dcmLongSCUStorageSOPClassUIDs) / sizeof(const char*) - 1); + + +/** an array of const strings containing all storage SOP classes that + * are proposed by default by those Storage SCU components in DCMTK + * that always propose TWO presentation context for each SOP class, + * e.g. storescu. This list is guaranteed to have at most 64 entries. + */ +const char* dcmShortSCUStorageSOPClassUIDs[] = { + /* This list *must* be limited to 64 SOP classes or less (currently: 64). + * If we have more than 64 storage transfer syntaxes, tools such as + * storescu will fail because they attempt to negotiate two presentation + * contexts for each SOP class, and there is a total limit of 128 contexts + * for one association. + * Because of this limitation, all draft and retired storage SOP classes + * are removed from this list. We have also omitted support for some + * recently approved SOP classes. + * UID_MediaStorageDirectoryStorage should not be present in this list. + */ + UID_AmbulatoryECGWaveformStorage, + UID_BasicTextSRStorage, + UID_BasicVoiceAudioWaveformStorage, + UID_BlendingSoftcopyPresentationStateStorage, + UID_CardiacElectrophysiologyWaveformStorage, + UID_ChestCADSRStorage, + UID_ColonCADSRStorage, + UID_ColorSoftcopyPresentationStateStorage, + UID_ComprehensiveSRStorage, + UID_ComputedRadiographyImageStorage, + UID_CTImageStorage, + UID_DigitalIntraOralXRayImageStorageForPresentation, + UID_DigitalIntraOralXRayImageStorageForProcessing, + UID_DigitalMammographyXRayImageStorageForPresentation, + UID_DigitalMammographyXRayImageStorageForProcessing, + UID_DigitalXRayImageStorageForPresentation, + UID_DigitalXRayImageStorageForProcessing, + UID_EncapsulatedPDFStorage, + UID_EnhancedCTImageStorage, + UID_EnhancedMRImageStorage, + UID_EnhancedSRStorage, + UID_EnhancedXAImageStorage, + UID_EnhancedXRFImageStorage, + UID_GeneralECGWaveformStorage, + UID_GrayscaleSoftcopyPresentationStateStorage, + UID_HemodynamicWaveformStorage, + UID_KeyObjectSelectionDocumentStorage, + UID_MammographyCADSRStorage, + UID_MRImageStorage, + UID_MRSpectroscopyStorage, + UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, + UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, + UID_MultiframeSingleBitSecondaryCaptureImageStorage, + UID_MultiframeTrueColorSecondaryCaptureImageStorage, + UID_NuclearMedicineImageStorage, + UID_OphthalmicPhotography16BitImageStorage, + UID_OphthalmicPhotography8BitImageStorage, + UID_OphthalmicTomographyImageStorage, + UID_PositronEmissionTomographyImageStorage, + UID_ProcedureLogStorage, + UID_PseudoColorSoftcopyPresentationStateStorage, + UID_RawDataStorage, + UID_RealWorldValueMappingStorage, + UID_RTBeamsTreatmentRecordStorage, + UID_RTBrachyTreatmentRecordStorage, + UID_RTDoseStorage, + UID_RTImageStorage, + UID_RTPlanStorage, + UID_RTStructureSetStorage, + UID_RTTreatmentSummaryRecordStorage, + UID_SecondaryCaptureImageStorage, + UID_SpatialFiducialsStorage, + UID_SpatialRegistrationStorage, + UID_StereometricRelationshipStorage, + UID_TwelveLeadECGWaveformStorage, + UID_UltrasoundImageStorage, + UID_UltrasoundMultiframeImageStorage, + UID_VLEndoscopicImageStorage, + UID_VLMicroscopicImageStorage, + UID_VLPhotographicImageStorage, + UID_VLSlideCoordinatesMicroscopicImageStorage, + UID_XRayAngiographicImageStorage, + UID_XRayRadiationDoseSRStorage, + UID_XRayRadiofluoroscopicImageStorage, + NULL +}; + +const int numberOfDcmShortSCUStorageSOPClassUIDs = OFstatic_cast(int, sizeof(dcmShortSCUStorageSOPClassUIDs) / sizeof(const char*) - 1); + + +/* +** The global variable dcmImageSOPClassUIDs is an array of +** string pointers containing the UIDs of all known Image SOP +** Classes. The instances of SOP Classes in this list can be +** referenced from DICOMDIR IMAGE records. +** +** The dcmgpdir/dcmmkdir program uses this list to determine +** what kind of objects can be referenced from IMAGE records. +** Be _very_ careful when adding SOP Classes to this list!! +** +** The global variable numberOfDcmImageSOPClassUIDs defines the +** size of the array. +*/ +const char* dcmImageSOPClassUIDs[] = { + UID_BreastProjectionXRayImageStorageForPresentation, + UID_BreastProjectionXRayImageStorageForProcessing, + UID_BreastTomosynthesisImageStorage, + UID_ComputedRadiographyImageStorage, + UID_CTImageStorage, + UID_CornealTopographyMapStorage, + UID_DigitalIntraOralXRayImageStorageForPresentation, + UID_DigitalIntraOralXRayImageStorageForProcessing, + UID_DigitalMammographyXRayImageStorageForPresentation, + UID_DigitalMammographyXRayImageStorageForProcessing, + UID_DigitalXRayImageStorageForPresentation, + UID_DigitalXRayImageStorageForProcessing, + UID_EnhancedCTImageStorage, + UID_EnhancedMRColorImageStorage, + UID_EnhancedMRImageStorage, + UID_EnhancedPETImageStorage, + UID_EnhancedUSVolumeStorage, + UID_EnhancedXAImageStorage, + UID_EnhancedXRFImageStorage, + UID_IntravascularOpticalCoherenceTomographyImageStorageForPresentation, + UID_IntravascularOpticalCoherenceTomographyImageStorageForProcessing, + UID_LegacyConvertedEnhancedCTImageStorage, + UID_LegacyConvertedEnhancedMRImageStorage, + UID_LegacyConvertedEnhancedPETImageStorage, + UID_MRImageStorage, + UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, + UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, + UID_MultiframeSingleBitSecondaryCaptureImageStorage, + UID_MultiframeTrueColorSecondaryCaptureImageStorage, + UID_NuclearMedicineImageStorage, + UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage, + UID_OphthalmicOpticalCoherenceTomographyEnFaceImageStorage, + UID_OphthalmicPhotography16BitImageStorage, + UID_OphthalmicPhotography8BitImageStorage, + UID_OphthalmicThicknessMapStorage, + UID_OphthalmicTomographyImageStorage, + UID_ParametricMapStorage, + UID_PositronEmissionTomographyImageStorage, + UID_RTImageStorage, + UID_SecondaryCaptureImageStorage, + UID_UltrasoundImageStorage, + UID_UltrasoundMultiframeImageStorage, + UID_VideoEndoscopicImageStorage, + UID_VideoMicroscopicImageStorage, + UID_VideoPhotographicImageStorage, + UID_VLEndoscopicImageStorage, + UID_VLMicroscopicImageStorage, + UID_VLPhotographicImageStorage, + UID_VLSlideCoordinatesMicroscopicImageStorage, + UID_VLWholeSlideMicroscopyImageStorage, + UID_WideFieldOphthalmicPhotographyStereographicProjectionImageStorage, + UID_WideFieldOphthalmicPhotography3DCoordinatesImageStorage, + UID_XRay3DAngiographicImageStorage, + UID_XRay3DCraniofacialImageStorage, + UID_XRayAngiographicImageStorage, + UID_XRayRadiofluoroscopicImageStorage, + // retired + UID_RETIRED_HardcopyColorImageStorage, + UID_RETIRED_HardcopyGrayscaleImageStorage, + UID_RETIRED_NuclearMedicineImageStorage, + UID_RETIRED_UltrasoundImageStorage, + UID_RETIRED_UltrasoundMultiframeImageStorage, + UID_RETIRED_VLImageStorage, + UID_RETIRED_VLMultiframeImageStorage, + UID_RETIRED_XRayAngiographicBiPlaneImageStorage, + // DICOS + UID_DICOS_CTImageStorage, + UID_DICOS_DigitalXRayImageStorageForPresentation, + UID_DICOS_DigitalXRayImageStorageForProcessing, + // DICONDE + UID_DICONDE_EddyCurrentImageStorage, + UID_DICONDE_EddyCurrentMultiframeImageStorage, + NULL +}; + +const int numberOfDcmImageSOPClassUIDs = OFstatic_cast(int, sizeof(dcmImageSOPClassUIDs) / sizeof(const char*) - 1); + + +typedef struct { + const char *sopClass; + const char *modality; + unsigned long averageSize; /* can be way, way out */ +} DcmModalityTable; + +/* +** The modalities table defines a short character code for each +** Storage SOP Class for use in filenames. +** It also gives a typical size for each SOP Instance. This will +** usually be way out, but is useful in user interfaces to give an +** idea of progress when receiving an image (C-STORE does not indicate +** the size of an image being transmitted). +*/ +static const DcmModalityTable modalities[] = { + { UID_AcquisitionContextSRStorage, "SRa", 4096 }, + { UID_AdvancedBlendingPresentationStateStorage, "PSa", 4096 }, + { UID_AmbulatoryECGWaveformStorage, "ECA", 4096 }, + { UID_ArterialPulseWaveformStorage, "WVa", 4096 }, + { UID_AutorefractionMeasurementsStorage, "OPa", 4096 }, + { UID_BasicStructuredDisplayStorage, "SD", 4096 }, + { UID_BasicTextSRStorage, "SRt", 4096 }, + { UID_BasicVoiceAudioWaveformStorage, "AUV", 4096 }, + { UID_BlendingSoftcopyPresentationStateStorage, "PSb", 4096 }, + { UID_BreastProjectionXRayImageStorageForPresentation, "BX", 4096 * 4096 * 2 }, + { UID_BreastProjectionXRayImageStorageForProcessing, "BP", 4096 * 4096 * 2 }, + { UID_BreastTomosynthesisImageStorage, "BT", 4096 * 4096 * 2 }, + { UID_CardiacElectrophysiologyWaveformStorage, "WVc", 4096 }, + { UID_CArmPhotonElectronRadiationStorage, "RRc", 4096 }, + { UID_ChestCADSRStorage, "SRh", 4096 }, + { UID_ColonCADSRStorage, "SRo", 4096 }, + { UID_ColorPaletteStorage, "CP", 4096 }, + { UID_ColorSoftcopyPresentationStateStorage, "PSc", 4096 }, + { UID_CompositingPlanarMPRVolumetricPresentationStateStorage, "VPc", 4096 }, + { UID_Comprehensive3DSRStorage, "SR3", 4096 }, + { UID_ComprehensiveSRStorage, "SRc", 4096 }, + { UID_ComputedRadiographyImageStorage, "CR", 2048 * 2048 * 2 }, + { UID_ContentAssessmentResultsStorage, "AS", 4096 }, + { UID_CornealTopographyMapStorage, "CM", 512 * 512 }, + { UID_CTDefinedProcedureProtocolStorage, "PPd", 4096 }, + { UID_CTImageStorage, "CT", 512 * 512 * 2 }, + { UID_CTPerformedProcedureProtocolStorage, "PPp", 4096 }, + { UID_DeformableSpatialRegistrationStorage, "RGd", 4096 }, + { UID_DigitalIntraOralXRayImageStorageForPresentation, "DXo", 1024 * 1024 * 2 }, + { UID_DigitalIntraOralXRayImageStorageForProcessing, "DPo", 1024 * 1024 * 2 }, + { UID_DigitalMammographyXRayImageStorageForPresentation, "DXm", 4096 * 4096 * 2 }, + { UID_DigitalMammographyXRayImageStorageForProcessing, "DPm", 4096 * 4096 * 2 }, + { UID_DigitalXRayImageStorageForPresentation, "DX", 2048 * 2048 * 2 }, + { UID_DigitalXRayImageStorageForProcessing, "DP", 2048 * 2048 * 2 }, + { UID_EncapsulatedCDAStorage, "CDA", 4096 }, + { UID_EncapsulatedPDFStorage, "PDF", 1024 * 1024 }, + { UID_EncapsulatedSTLStorage, "STL", 4096 }, + { UID_EnhancedCTImageStorage, "CTe", 256 * 512 * 512 }, + { UID_EnhancedMRColorImageStorage, "MRc", 256 * 512 * 512 * 3 }, + { UID_EnhancedMRImageStorage, "MRe", 256 * 512 * 512 }, + { UID_EnhancedPETImageStorage, "PIe", 512 * 512 * 2 }, + { UID_EnhancedSRStorage, "SRe", 4096 }, + { UID_EnhancedUSVolumeStorage, "USe", 512 * 512 }, + { UID_EnhancedXAImageStorage, "XAe", 256 * 512 * 512 }, + { UID_EnhancedXRFImageStorage, "RFe", 256 * 512 * 512 }, + { UID_ExtensibleSRStorage, "SRx", 4096 }, + { UID_GeneralAudioWaveformStorage, "AUG", 4096 }, + { UID_GeneralECGWaveformStorage, "ECG", 4096 }, + { UID_GenericImplantTemplateStorage, "IT", 4096 }, + { UID_GrayscalePlanarMPRVolumetricPresentationStateStorage, "VPg", 4096 }, + { UID_GrayscaleSoftcopyPresentationStateStorage, "PSg", 4096 }, + { UID_HangingProtocolStorage, "HP", 4096 }, + { UID_HemodynamicWaveformStorage, "WVh", 4096 }, + { UID_ImplantAssemblyTemplateStorage, "ITa", 4096 }, + { UID_ImplantationPlanSRDocumentStorage, "SRi", 4096 }, + { UID_ImplantTemplateGroupStorage, "ITg", 4096 }, + { UID_IntraocularLensCalculationsStorage, "OPc", 4096 }, + { UID_IntravascularOpticalCoherenceTomographyImageStorageForPresentation, "OCt", 512 * 512 }, + { UID_IntravascularOpticalCoherenceTomographyImageStorageForProcessing, "OCp", 512 * 512 }, + { UID_KeratometryMeasurementsStorage, "OPk", 4096 }, + { UID_KeyObjectSelectionDocumentStorage, "KO", 4096 }, + { UID_LegacyConvertedEnhancedCTImageStorage, "CTl", 512 * 512 * 2 }, + { UID_LegacyConvertedEnhancedMRImageStorage, "MRl", 256 * 256 * 2 }, + { UID_LegacyConvertedEnhancedPETImageStorage, "PIl", 512 * 512 * 2 }, + { UID_LensometryMeasurementsStorage, "OPl", 4096 }, + { UID_MacularGridThicknessAndVolumeReportStorage, "SRg", 4096 }, + { UID_MammographyCADSRStorage, "SRm", 4096 }, + { UID_MRImageStorage, "MR", 256 * 256 * 2 }, + { UID_MRSpectroscopyStorage, "MRs", 256 * 512 * 512 }, + { UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, "SCb", 512 * 512 }, + { UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, "SCw", 512 * 512 * 2 }, + { UID_MultiframeSingleBitSecondaryCaptureImageStorage, "SCs", 1024 * 1024 }, /* roughly an A4 300dpi scan */ + { UID_MultiframeTrueColorSecondaryCaptureImageStorage, "SCc", 512 * 512 * 3 }, + { UID_MultipleVolumeRenderingVolumetricPresentationStateStorage, "VPm" , 4096 }, + { UID_NuclearMedicineImageStorage, "NM", 64 * 64 * 2 }, + { UID_OphthalmicAxialMeasurementsStorage, "OPx", 4096 }, + { UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage, "OCb" , 768 * 576 }, + { UID_OphthalmicOpticalCoherenceTomographyEnFaceImageStorage, "OCe", 768 * 576 * 2 }, + { UID_OphthalmicPhotography16BitImageStorage, "OPw", 768 * 576 * 6 }, + { UID_OphthalmicPhotography8BitImageStorage, "OPb", 768 * 576 * 3 }, + { UID_OphthalmicThicknessMapStorage, "OPm", 768 * 576 }, + { UID_OphthalmicTomographyImageStorage, "OPt", 768 * 576 * 3 }, + { UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, "OPp", 4096 }, + { UID_ParametricMapStorage, "PM", 256 * 256 * 4 }, + { UID_PatientRadiationDoseSRStorage, "SRq", 4096 }, + { UID_PerformedImagingAgentAdministrationSRStorage, "SRi", 4096 }, + { UID_PlannedImagingAgentAdministrationSRStorage, "SRj", 4096 }, + { UID_PositronEmissionTomographyImageStorage, "PI", 512 * 512 * 2 }, + { UID_ProcedureLogStorage, "SRp", 4096 }, + { UID_ProtocolApprovalStorage, "PA", 4096 }, + { UID_PseudoColorSoftcopyPresentationStateStorage, "PSp", 4096 }, + { UID_RadiopharmaceuticalRadiationDoseSRStorage, "SRr", 4096 }, + { UID_RawDataStorage, "RAW", 512 * 512 * 256 }, + { UID_RealWorldValueMappingStorage, "RWM", 4096 }, + { UID_RespiratoryWaveformStorage, "WVr", 4096 }, + { UID_RTBeamsDeliveryInstructionStorage, "RTd", 4096 }, + { UID_RTBeamsTreatmentRecordStorage, "RTb", 4096 }, + { UID_RTBrachyApplicationSetupDeliveryInstructionStorage, "RTa", 4096 }, + { UID_RTBrachyTreatmentRecordStorage, "RTr", 4096 }, + { UID_RTDoseStorage, "RD", 4096 }, + { UID_RTImageStorage, "RI", 4096 }, + { UID_RTIonBeamsTreatmentRecordStorage, "RTi", 4096 }, + { UID_RTIonPlanStorage, "RPi", 4096 }, + { UID_RTPlanStorage, "RP" , 4096 }, + { UID_RTPhysicianIntentStorage, "RIp", 4096 }, + { UID_RTRadiationSetStorage, "RRs", 4096 }, + { UID_RTSegmentAnnotationStorage, "RSa", 4096 }, + { UID_RTStructureSetStorage, "RS", 4096 }, + { UID_RTTreatmentSummaryRecordStorage, "RTs", 4096 }, + { UID_SecondaryCaptureImageStorage, "SC", 512 * 512 * 2 }, + { UID_SegmentationStorage, "SG", 4096 }, + { UID_SegmentedVolumeRenderingVolumetricPresentationStateStorage, "VPs", 4096 }, + { UID_SimplifiedAdultEchoSRStorage, "SRu", 4096 }, + { UID_SpatialFiducialsStorage, "FID", 4096 }, + { UID_SpatialRegistrationStorage, "RGs", 4096 }, + { UID_SpectaclePrescriptionReportStorage, "SRs", 4096 }, + { UID_StereometricRelationshipStorage, "OPr", 4096 }, + { UID_SubjectiveRefractionMeasurementsStorage, "OPs", 4096 }, + { UID_SurfaceScanMeshStorage, "SSm", 4096 }, + { UID_SurfaceScanPointCloudStorage, "SSp", 4096 }, + { UID_SurfaceSegmentationStorage, "SGs", 4096 }, + { UID_TractographyResultsStorage, "TR", 4096 }, + { UID_TwelveLeadECGWaveformStorage, "TLE", 4096 }, + { UID_UltrasoundImageStorage, "US", 512 * 512 }, + { UID_UltrasoundMultiframeImageStorage, "USm", 512 * 512 }, + { UID_VideoEndoscopicImageStorage, "VVe", 768 * 576 * 3 }, + { UID_VideoMicroscopicImageStorage, "VVm", 768 * 576 * 3 }, + { UID_VideoPhotographicImageStorage, "VVp", 768 * 576 * 3 }, + { UID_VisualAcuityMeasurementsStorage, "OPv", 4096 }, + { UID_VLEndoscopicImageStorage, "VLe", 768 * 576 * 3 }, + { UID_VLMicroscopicImageStorage, "VLm", 768 * 576 * 3 }, + { UID_VLPhotographicImageStorage, "VLp", 768 * 576 * 3 }, + { UID_VLSlideCoordinatesMicroscopicImageStorage, "VLs", 768 * 576 * 3 }, + { UID_VLWholeSlideMicroscopyImageStorage, "VLw", 10000 * 10000 * 3 }, + { UID_VolumeRenderingVolumetricPresentationStateStorage, "VPv", 4096 }, + { UID_WideFieldOphthalmicPhotographyStereographicProjectionImageStorage, "OWs", 768 * 576 * 3 }, + { UID_WideFieldOphthalmicPhotography3DCoordinatesImageStorage, "OW3", 768 * 576 * 3 }, + { UID_XAXRFGrayscaleSoftcopyPresentationStateStorage, "PSx", 4096 }, + { UID_XRay3DAngiographicImageStorage, "XA3", 256 * 512 * 512 }, + { UID_XRay3DCraniofacialImageStorage, "XC3", 256 * 512 * 512 }, + { UID_XRayAngiographicImageStorage, "XA", 256 * 512 * 512 }, + { UID_XRayRadiationDoseSRStorage, "SRd", 4096 }, + { UID_XRayRadiofluoroscopicImageStorage, "RF", 256 * 512 * 512 }, + // retired + { UID_RETIRED_HardcopyColorImageStorage, "HC", 4096 }, + { UID_RETIRED_HardcopyGrayscaleImageStorage, "HG", 4096 }, + { UID_RETIRED_NuclearMedicineImageStorage, "NMr", 64 * 64 * 2 }, + { UID_RETIRED_StandaloneCurveStorage, "CV", 4096 }, + { UID_RETIRED_StandaloneModalityLUTStorage, "ML", 4096 * 2 }, + { UID_RETIRED_StandaloneOverlayStorage, "OV", 512 * 512 }, + { UID_RETIRED_StandalonePETCurveStorage, "PC", 4096 }, + { UID_RETIRED_StandaloneVOILUTStorage, "VO", 4096 * 2 }, + { UID_RETIRED_StoredPrintStorage, "SP", 4096 }, + { UID_RETIRED_UltrasoundImageStorage, "USr", 512 * 512 }, + { UID_RETIRED_UltrasoundMultiframeImageStorage, "USf", 512 * 512 }, + { UID_RETIRED_VLImageStorage, "VLr", 768 * 576 * 3 }, + { UID_RETIRED_VLMultiframeImageStorage, "VMr", 768 * 576 * 3 }, + { UID_RETIRED_XRayAngiographicBiPlaneImageStorage, "XB", 512 * 512 * 2 }, + // draft + { UID_DRAFT_RTBeamsDeliveryInstructionStorage, "RBd", 4096 }, + { UID_DRAFT_SRAudioStorage, "SR_", 4096 }, /* was "SRw" */ + { UID_DRAFT_SRComprehensiveStorage, "SR_", 4096 }, /* was "SRx" */ + { UID_DRAFT_SRDetailStorage, "SR_", 4096 }, /* was "SRy" */ + { UID_DRAFT_SRTextStorage, "SR_", 4096 }, /* was "SRz" */ + { UID_DRAFT_WaveformStorage, "WVd", 4096 }, + // DICOS + { UID_DICOS_CTImageStorage, "CTs", 512 * 512 * 2 }, + { UID_DICOS_DigitalXRayImageStorageForPresentation, "DXs", 2048 * 2048 * 2 }, + { UID_DICOS_DigitalXRayImageStorageForProcessing, "DPs", 2048 * 2048 * 2 }, + { UID_DICOS_ThreatDetectionReportStorage, "TDR", 4096 }, + { UID_DICOS_2DAITStorage, "AI2", 4096 }, + { UID_DICOS_3DAITStorage, "AI3", 4096 }, + { UID_DICOS_QuadrupoleResonanceStorage, "QR", 4096 }, + // DICONDE + { UID_DICONDE_EddyCurrentImageStorage, "EC", 512 * 512 }, + { UID_DICONDE_EddyCurrentMultiframeImageStorage, "ECm", 512 * 512 } +}; + +static const int numberOfDcmModalityTableEntries = OFstatic_cast(int, sizeof(modalities) / sizeof(DcmModalityTable)); + + +/* + * Public Function Prototypes + */ + + +const char *dcmSOPClassUIDToModality(const char *sopClassUID, + const char *defaultValue) +{ + if (sopClassUID == NULL) return NULL; + /* check for known SOP class */ + for (int i = 0; i < numberOfDcmModalityTableEntries; i++) + { + if (strcmp(modalities[i].sopClass, sopClassUID) == 0) return modalities[i].modality; + } + /* SOP class not found */ + return defaultValue; +} + +unsigned long dcmGuessModalityBytes(const char *sopClassUID) +{ + unsigned long nbytes = 1048576; /* default: 1 MByte */ + + if (sopClassUID == NULL) return nbytes; + + int found=0; + for (int i = 0; (!found && (i < numberOfDcmModalityTableEntries)); i++) + { + found = (strcmp(modalities[i].sopClass, sopClassUID) == 0); + if (found) nbytes = modalities[i].averageSize; + } + + return nbytes; +} + + +/* +** dcmFindNameOfUID(const char* uid) +** Return the name of a UID. +** Performs a table lookup and returns a pointer to a read-only string. +** Returns defaultValue of the UID is not known. +*/ + +const char* +dcmFindNameOfUID(const char* uid, const char* defaultValue) +{ + if (uid == NULL) return defaultValue; + for (int i = 0; i < uidNameMap_size; i++) { + if (uidNameMap[i].uid != NULL && strcmp(uid, uidNameMap[i].uid) == 0) { + return uidNameMap[i].name; + } + } + return defaultValue; +} + +// +// dcmFindUIDFromName(const char* name) +// Return the UID of a name. +// Performs a table lookup and returns a pointer to a read-only string. +// Returns NULL of the name is not known. +// + +const char* +dcmFindUIDFromName(const char* name) +{ + if (name == NULL) return NULL; + for(int i = 0; i < uidNameMap_size; i++) + { + if (uidNameMap[i].name != NULL && strcmp(name, uidNameMap[i].name) == 0) + return uidNameMap[i].uid; + } + return NULL; +} + + +/* +** dcmIsaStorageSOPClassUID(const char* uid) +** Returns true if the uid is one of the Storage SOP Classes. +** Performs a table lookup in the dcmAllStorageSOPClassUIDs, +** dcmNonPatientStorageSOPClassUIDs and/or dcmImageSOPClassUIDs table. +*/ +OFBool +dcmIsaStorageSOPClassUID(const char* uid, const E_StorageSOPClassType type) +{ + if (uid == NULL) return OFFalse; + /* check for patient object */ + if (type & ESSC_Patient) { + for (int i = 0; i < numberOfDcmAllStorageSOPClassUIDs; i++) { + if (dcmAllStorageSOPClassUIDs[i] != NULL && strcmp(uid, dcmAllStorageSOPClassUIDs[i]) == 0) { + return OFTrue; + } + } + } + /* check for non-patient object */ + if (type & ESSC_NonPatient) { + for (int i = 0; dcmNonPatientStorageSOPClassUIDs[i] != NULL; i++) { + if (strcmp(uid, dcmNonPatientStorageSOPClassUIDs[i]) == 0) { + return OFTrue; + } + } + } + /* check for image object */ + if (type & ESSC_Image) { + for (int i = 0; i < numberOfDcmImageSOPClassUIDs; i++) { + if (dcmImageSOPClassUIDs[i] != NULL && strcmp(uid, dcmImageSOPClassUIDs[i]) == 0) { + return OFTrue; + } + } + } + return OFFalse; +} + + +/* +** dcmIsImageStorageSOPClassUID(const char* uid) +** Returns true if the uid is one of the Image Storage SOP Classes. +*/ +OFBool +dcmIsImageStorageSOPClassUID(const char* uid) +{ + return dcmIsaStorageSOPClassUID(uid, ESSC_Image); +} + +// ******************************** + +#ifndef HAVE_GETHOSTID +#if defined(HAVE_SYSINFO) && defined(HAVE_SYS_SYSTEMINFO_H) + +/* Implementation of gethostid() based on sysinfo(). + * This implementation is used, for example, on Solaris. + */ +#include +static long gethostid(void) +{ + if (sysinfo(SI_HW_SERIAL, buf, 128) == -1) { + DCMDATA_FATAL("sysinfo: " << OFStandard::getLastSystemErrorCode().message()); + exit(1); + } +#ifdef HAVE_STRTOUL + return(strtoul(buf, NULL, 0)); +#else + long result; + sscanf(buf, "%ld", &result); + return result; +#endif +} + +#else // !HAVE_SYSINFO + +/* +** There is no implementation of gethostid() and we cannot implement it in +** terms of sysinfo() so define a workaround. +*/ +#if (defined(HAVE_GETHOSTNAME) && defined(HAVE_GETHOSTBYNAME)) || defined(HAVE_WINDOWS_H) + +#ifdef _WIN32 + +/* On Windows systems specify a routine to determine the MAC address of the Ethernet adapter. + * This implementation uses Win32 system calls available on Windows 2000 and newer. + * A different implementation supporting Windows 95 was used in DCMTK releases up to 3.6.0, + * but that implementation does not work reliably anymore on Windows 10. + */ +static IP_ADAPTER_INFO* getMACAddresses(OFVector& buffer) +{ + // get adapter info using OFVector to allocate memory + DWORD bufferSize = 0; + DWORD status = GetAdaptersInfo(OFnullptr, &bufferSize); + if (status == ERROR_BUFFER_OVERFLOW) + { + buffer.resize(bufferSize); + status = GetAdaptersInfo(OFreinterpret_cast(IP_ADAPTER_INFO*, &*buffer.begin()), &bufferSize); + } + if (status == ERROR_SUCCESS) + return OFreinterpret_cast(IP_ADAPTER_INFO*, &*buffer.begin()); + // print out the error message for debugging + OFString message; + LPVOID errBuf = OFnullptr; + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + OFnullptr, status, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), OFreinterpret_cast(LPTSTR, &errBuf), 0, OFnullptr) > 0) + { + message = OFstatic_cast(const char*, errBuf); + // remove "\r\n" + if (message.size() >= 2 && message.substr(message.length() - 2) == "\r\n") + message = message.substr(0, message.length() - 2); + } + LocalFree(errBuf); + if (!message.empty()) + { + DCMDATA_WARN("GetAdaptersInfo() failed with the error: '" << message << '\''); + } + else + { + DCMDATA_WARN("GetAdaptersInfo() failed with an unknown error"); + } + // a null pointer indicates that no adapter is available + return OFnullptr; +} +#endif + +#ifdef HAVE_PROTOTYPE_GETHOSTID +/* CW10 has a prototype but no implementation (gethostid() is already declared extern */ +long gethostid(void) +#else +static long gethostid(void) +#endif +{ + long result = 0; +#if defined(HAVE_GETHOSTNAME) || defined(HAVE_WINDOWS_H) + char name[1024]; + + /* + ** Define the hostid to be the system's main IP address. + ** This is not perfect but it is better than nothing (i.e. using zero) + */ + OFStandard::initializeNetwork(); + if (gethostname(name, 1024) == 0) + { + struct sockaddr_in *sin = NULL; + struct sockaddr_in6 *sin6 = NULL; + long *lp = NULL; + OFSockAddr sa; + OFStandard::getAddressByHostname(name, sa); + switch (sa.getFamily()) + { + case AF_INET: + sin = sa. getSockaddr_in(); + result = OFstatic_cast(long, sin->sin_addr.s_addr); + break; + case AF_INET6: + sin6 = sa. getSockaddr_in6(); + // interpret the first four bytes of the IPv6 address as a long + lp = OFreinterpret_cast(long *, &sin6->sin6_addr); + result = *lp; + break; + default: + // unknown protocol family. Do nothing. + break; + } + } + + OFStandard::shutdownNetwork(); +#endif /* defined(HAVE_GETHOSTNAME) */ +/* on Windows systems determine some system specific information (e.g. MAC address) */ +#ifdef HAVE_WINDOWS_H + OFCRC32 crc; + /* get some processor specific information in addition to the MAC address */ + SYSTEM_INFO systemInfo; + GetSystemInfo(&systemInfo); + /* get volume information of the system drive */ + char systemDrive[MAX_PATH]; + DWORD serialNumber = 0; + if (GetSystemDirectory(systemDrive, OFstatic_cast(UINT, sizeof(systemDrive))) >= 0) + { + /* check for proper pathname */ + if ((strlen(systemDrive) >= 3) && (systemDrive[1] == ':') && (systemDrive[2] == '\\')) + { + /* truncate the pathname directly after the drive specification */ + systemDrive[3] = 0; + if (!GetVolumeInformation(systemDrive, NULL, 0, &serialNumber, NULL, NULL, NULL, 0)) + serialNumber = 0; + } + } + /* concatenate the host specific elements and compute a 32-bit checksum */ + crc.addBlock(&result /*ip address*/, OFstatic_cast(unsigned long, sizeof(result))); + // add the MAC addresses of all adapters + { + OFVector buffer; + for (IP_ADAPTER_INFO* adapterInfo = getMACAddresses(buffer); adapterInfo; adapterInfo = adapterInfo->Next) + crc.addBlock(adapterInfo->Address, adapterInfo->AddressLength); + } + crc.addBlock(&serialNumber, OFstatic_cast(unsigned long, sizeof(serialNumber))); + crc.addBlock(&systemInfo.wProcessorLevel, OFstatic_cast(unsigned long, sizeof(systemInfo.wProcessorLevel))); + crc.addBlock(&systemInfo.wProcessorRevision, OFstatic_cast(unsigned long, sizeof(systemInfo.wProcessorRevision))); + crc.addBlock(&systemInfo.dwProcessorType, OFstatic_cast(unsigned long, sizeof(systemInfo.dwProcessorType))); + result = OFstatic_cast(long, crc.getCRC32()); +#endif + /* 'artificial' hostid: on Windows system a CRC32 checksum over some host specific + information (e.g. MAC address), the 4 bytes TCP/IP address otherwise. + */ + return result; +} + +#else // !(defined(HAVE_GETHOSTNAME) && defined(HAVE_GETHOSTBYNAME)) +/* +** last chance workaround if there is no other way +*/ +#ifdef HAVE_PROTOTYPE_GETHOSTID +/* CW10 has a prototype but no implementation (gethostid() is already declared extern */ +long gethostid(void) { return 0; } +#else +static long gethostid(void) { return 0; } +#endif +#endif // !(defined(HAVE_GETHOSTNAME) && defined(HAVE_GETHOSTBYNAME)) + +#endif // !HAVE_SYSINFO +#else // HAVE_GETHOSTID +#ifndef HAVE_PROTOTYPE_GETHOSTID +extern "C" { +long gethostid(void); +} +#endif // !HAVE_PROTOTYPE_GETHOSTID +#endif // HAVE_GETHOSTID + +// ******************************** + +/* + * Global variable storing the return value of gethostid(). + * Since the variable is not declared in the header file it can only be used + * within this source file. Any access to or modification of its value is + * protected by a mutex (see dcmGenerateUniqueIdentifier()). + */ + +static unsigned long hostIdentifier = 0; + + +/* +** char* generateUniqueIdentifier(char* buf) +** Creates a Unique Identifier in buf and returns buf. +** buf must be at least 65 bytes. +*/ + + +#ifdef WITH_THREADS +static OFMutex uidCounterMutex; // mutex protecting access to counterOfCurrentUID and hostIdentifier +#endif + +static unsigned int counterOfCurrentUID = 0; + +static const unsigned int maxUIDLen = 64; /* A UID may be 64 chars or less */ + +static void +initCounterOfCurrentUID() +{ + /* Code taken from oftime.cc */ +#ifdef HAVE_WINDOWS_H + /* Windows: no microseconds available, use milliseconds instead */ + SYSTEMTIME timebuf; + GetSystemTime(&timebuf); + counterOfCurrentUID = timebuf.wMilliseconds; /* This is in the range 0 - 999 */ +#else /* Unix */ + struct timeval tv; + if (gettimeofday(&tv, NULL) == 0) + counterOfCurrentUID = OFstatic_cast(Uint32, tv.tv_usec); /* This is in the range 0 - 999999 */ +#endif + /* Do not ever use "0" for the counter */ + counterOfCurrentUID++; +} + + +static char* +stripTrailing(char* s, char c) +{ + if (s == NULL) return s; + for + ( + char* it = s + strlen(s) - 1; + it >= s && *it == c; + *it-- = '\0' + ); + return s; +} + +static void +addUIDComponent(char* uid, const char* s) +{ + /* copy into UID as much of the contents of s as possible */ + if (OFStandard::strlcat(uid, s, maxUIDLen + 1) >= maxUIDLen + 1) // maxUIDLen+1 because strlcat() wants the size of the buffer, not the permitted number of characters. + { + DCMDATA_WARN("Truncated UID in dcmGenerateUniqueIdentifier(), SITE_UID_ROOT too long?"); + } + stripTrailing(uid, '.'); +} + +inline static unsigned long +forcePositive(long i) +{ + return (i < 0) ? OFstatic_cast(unsigned long, -i) : OFstatic_cast(unsigned long, i); +} + +char* dcmGenerateUniqueIdentifier(char* uid, const char* prefix) +{ + char buf[128]; /* be very safe */ + + uid[0] = '\0'; /* initialize */ + +#ifdef WITH_THREADS + uidCounterMutex.lock(); +#endif + if (hostIdentifier == 0) + { + /* On 64-bit Linux, the "32-bit identifier" returned by gethostid() is + sign-extended to a 64-bit long, so we need to blank the upper 32 bits */ + hostIdentifier = OFstatic_cast(unsigned long, gethostid() & 0xffffffff); + } + if (counterOfCurrentUID == 0) + initCounterOfCurrentUID(); + + unsigned int counter = counterOfCurrentUID++; +#ifdef WITH_THREADS + uidCounterMutex.unlock(); +#endif + + if (prefix != NULL ) { + addUIDComponent(uid, prefix); + } else { + addUIDComponent(uid, SITE_INSTANCE_UID_ROOT); + } + + sprintf(buf, ".%lu", hostIdentifier); + addUIDComponent(uid, buf); + + sprintf(buf, ".%lu", forcePositive(OFStandard::getProcessID())); + addUIDComponent(uid, buf); + + sprintf(buf, ".%lu", forcePositive(OFstatic_cast(long, time(NULL)))); + addUIDComponent(uid, buf); + + sprintf(buf, ".%u", counter); + + addUIDComponent(uid, buf); + + return uid; +} diff --git a/dcmdata/libsrc/dcvr.cc b/dcmdata/libsrc/dcvr.cc new file mode 100644 index 00000000..f27c9343 --- /dev/null +++ b/dcmdata/libsrc/dcvr.cc @@ -0,0 +1,527 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth, Andrew Hewett + * + * Purpose: class DcmVR: Value Representation + * + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dctypes.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +/* +** global flags +*/ +OFGlobal dcmEnableUnknownVRGeneration(OFTrue); +OFGlobal dcmEnableUnlimitedTextVRGeneration(OFTrue); +OFGlobal dcmEnableOtherFloatVRGeneration(OFTrue); +OFGlobal dcmEnableOtherDoubleVRGeneration(OFTrue); +OFGlobal dcmEnableOtherLongVRGeneration(OFTrue); +OFGlobal dcmEnableUniversalResourceIdentifierOrLocatorVRGeneration(OFTrue); +OFGlobal dcmEnableUnlimitedCharactersVRGeneration(OFTrue); +OFGlobal dcmEnableOther64bitVeryLongVRGeneration(OFTrue); +OFGlobal dcmEnableSigned64bitVeryLongVRGeneration(OFTrue); +OFGlobal dcmEnableUnsigned64bitVeryLongVRGeneration(OFTrue); +OFGlobal dcmEnableUnknownVRConversion(OFFalse); + +/* +** global functions +*/ +void dcmEnableGenerationOfNewVRs() +{ + dcmEnableUnknownVRGeneration.set(OFTrue); + dcmEnableUnlimitedTextVRGeneration.set(OFTrue); + dcmEnableOtherFloatVRGeneration.set(OFTrue); + dcmEnableOtherDoubleVRGeneration.set(OFTrue); + dcmEnableOtherLongVRGeneration.set(OFTrue); + dcmEnableUniversalResourceIdentifierOrLocatorVRGeneration.set(OFTrue); + dcmEnableUnlimitedCharactersVRGeneration.set(OFTrue); + dcmEnableOther64bitVeryLongVRGeneration.set(OFTrue); + dcmEnableSigned64bitVeryLongVRGeneration.set(OFTrue); + dcmEnableUnsigned64bitVeryLongVRGeneration.set(OFTrue); +} + +void dcmDisableGenerationOfNewVRs() +{ + dcmEnableUnknownVRGeneration.set(OFFalse); + dcmEnableUnlimitedTextVRGeneration.set(OFFalse); + dcmEnableOtherFloatVRGeneration.set(OFFalse); + dcmEnableOtherDoubleVRGeneration.set(OFFalse); + dcmEnableOtherLongVRGeneration.set(OFFalse); + dcmEnableUniversalResourceIdentifierOrLocatorVRGeneration.set(OFFalse); + dcmEnableUnlimitedCharactersVRGeneration.set(OFFalse); + dcmEnableOther64bitVeryLongVRGeneration.set(OFFalse); + dcmEnableSigned64bitVeryLongVRGeneration.set(OFFalse); + dcmEnableUnsigned64bitVeryLongVRGeneration.set(OFFalse); +} + + +/* +** VR property table +*/ + +#define DCMVR_PROP_NONE 0x00 +#define DCMVR_PROP_NONSTANDARD 0x01 +#define DCMVR_PROP_INTERNAL 0x02 +#define DCMVR_PROP_EXTENDEDLENGTHENCODING 0x04 +#define DCMVR_PROP_ISASTRING 0x08 +#define DCMVR_PROP_ISAFFECTEDBYCHARSET 0x10 +#define DCMVR_PROP_ISLENGTHINCHAR 0x20 +#define DCMVR_PROP_UNDEFINEDLENGTH 0x40 + +struct DcmVREntry { + DcmEVR vr; // Enumeration Value of Value representation + const char* vrName; // Name of Value representation + const OFString* delimiterChars; // Delimiter characters, switch to default charset + size_t fValWidth; // Length of minimal unit, used for swapping + int propertyFlags; // Normal, internal, non-standard VR, etc. + Uint32 minValueLength; // Minimum length of a single value (bytes or characters) + Uint32 maxValueLength; // Maximum length of a single value (bytes or characters) +}; + +static const OFString noDelimiters; // none +static const OFString bsDelimiter("\\"); // backslash +static const OFString pnDelimiters("\\^="); // person name + +static const DcmVREntry DcmVRDict[] = { + + { EVR_AE, "AE", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 0, 16 }, + { EVR_AS, "AS", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 4, 4 }, + { EVR_AT, "AT", &noDelimiters, sizeof(Uint16), DCMVR_PROP_NONE, 4, 4 }, + { EVR_CS, "CS", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 0, 16 }, + { EVR_DA, "DA", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 8, 10 }, + { EVR_DS, "DS", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 0, 16 }, + { EVR_DT, "DT", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 0, 26 }, + { EVR_FL, "FL", &noDelimiters, sizeof(Float32), DCMVR_PROP_NONE, 4, 4 }, + { EVR_FD, "FD", &noDelimiters, sizeof(Float64), DCMVR_PROP_NONE, 8, 8 }, + { EVR_IS, "IS", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 0, 12 }, + { EVR_LO, "LO", &bsDelimiter, sizeof(char), DCMVR_PROP_ISASTRING | DCMVR_PROP_ISAFFECTEDBYCHARSET | DCMVR_PROP_ISLENGTHINCHAR, 0, 64 }, + { EVR_LT, "LT", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING | DCMVR_PROP_ISAFFECTEDBYCHARSET | DCMVR_PROP_ISLENGTHINCHAR, 0, 10240 }, + { EVR_OB, "OB", &noDelimiters, sizeof(Uint8), DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967294U }, + { EVR_OD, "OD", &noDelimiters, sizeof(Float64), DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967288U }, + { EVR_OF, "OF", &noDelimiters, sizeof(Float32), DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967292U }, + { EVR_OL, "OL", &noDelimiters, sizeof(Uint32), DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967292U }, + { EVR_OV, "OV", &noDelimiters, sizeof(Uint64), DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967288U }, + { EVR_OW, "OW", &noDelimiters, sizeof(Uint16), DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967294U }, + { EVR_PN, "PN", &pnDelimiters, sizeof(char), DCMVR_PROP_ISASTRING | DCMVR_PROP_ISAFFECTEDBYCHARSET | DCMVR_PROP_ISLENGTHINCHAR, 0, 64 }, + { EVR_SH, "SH", &bsDelimiter, sizeof(char), DCMVR_PROP_ISASTRING | DCMVR_PROP_ISAFFECTEDBYCHARSET | DCMVR_PROP_ISLENGTHINCHAR, 0, 16 }, + { EVR_SL, "SL", &noDelimiters, sizeof(Sint32), DCMVR_PROP_NONE, 4, 4 }, + { EVR_SQ, "SQ", &noDelimiters, 0, DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967294U }, + { EVR_SS, "SS", &noDelimiters, sizeof(Sint16), DCMVR_PROP_NONE, 2, 2 }, + { EVR_ST, "ST", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING | DCMVR_PROP_ISAFFECTEDBYCHARSET | DCMVR_PROP_ISLENGTHINCHAR, 0, 1024 }, + { EVR_SV, "SV", &noDelimiters, sizeof(Sint64), DCMVR_PROP_EXTENDEDLENGTHENCODING, 8, 8 }, + { EVR_TM, "TM", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 0, 16 }, + { EVR_UC, "UC", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING | DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_ISAFFECTEDBYCHARSET, 0, 4294967294U }, + { EVR_UI, "UI", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING, 0, 64 }, + { EVR_UL, "UL", &noDelimiters, sizeof(Uint32), DCMVR_PROP_NONE, 4, 4 }, + { EVR_UR, "UR", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING|DCMVR_PROP_EXTENDEDLENGTHENCODING, 0, 4294967294U }, + { EVR_US, "US", &noDelimiters, sizeof(Uint16), DCMVR_PROP_NONE, 2, 2 }, + { EVR_UT, "UT", &noDelimiters, sizeof(char), DCMVR_PROP_ISASTRING | DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_ISAFFECTEDBYCHARSET, 0, 4294967294U }, + { EVR_UV, "UV", &noDelimiters, sizeof(Uint64), DCMVR_PROP_EXTENDEDLENGTHENCODING, 8, 8 }, + { EVR_ox, "ox", &noDelimiters, sizeof(Uint8), DCMVR_PROP_NONSTANDARD | DCMVR_PROP_EXTENDEDLENGTHENCODING, 0, 4294967294U }, + { EVR_xs, "xs", &noDelimiters, sizeof(Uint16), DCMVR_PROP_NONSTANDARD, 2, 2 }, + { EVR_lt, "lt", &noDelimiters, sizeof(Uint16), DCMVR_PROP_NONSTANDARD | DCMVR_PROP_EXTENDEDLENGTHENCODING, 0, 4294967294U }, + { EVR_na, "na", &noDelimiters, 0, DCMVR_PROP_NONSTANDARD, 0, 0 }, + { EVR_up, "up", &noDelimiters, sizeof(Uint32), DCMVR_PROP_NONSTANDARD, 4, 4 }, + + /* unique prefixes have been "invented" for the following internal VRs */ + { EVR_item, "it_EVR_item", &noDelimiters, 0, + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, 0 }, + { EVR_metainfo, "mi_EVR_metainfo", &noDelimiters, 0, + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, 0 }, + { EVR_dataset, "ds_EVR_dataset", &noDelimiters, 0, + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, 0 }, + { EVR_fileFormat, "ff_EVR_fileFormat", &noDelimiters, 0, + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, 0 }, + { EVR_dicomDir, "dd_EVR_dicomDir", &noDelimiters, 0, + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, 0 }, + { EVR_dirRecord, "dr_EVR_dirRecord", &noDelimiters, 0, + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, 0 }, + + { EVR_pixelSQ, "ps_EVR_pixelSQ", &noDelimiters, sizeof(Uint8), + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, DCM_UndefinedLength }, + /* Moved from internal use to non standard only: necessary to distinguish from "normal" OB */ + { EVR_pixelItem, "pi", &noDelimiters, sizeof(Uint8), + DCMVR_PROP_NONSTANDARD, 0, DCM_UndefinedLength }, + + { EVR_UNKNOWN, "??", &noDelimiters, sizeof(Uint8), /* EVR_UNKNOWN (i.e. "future" VRs) should be mapped to UN or OB */ + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL | DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, DCM_UndefinedLength }, + + /* Unknown Value Representation */ + { EVR_UN, "UN", &noDelimiters, sizeof(Uint8), DCMVR_PROP_EXTENDEDLENGTHENCODING | DCMVR_PROP_UNDEFINEDLENGTH, 0, 4294967294U }, + + /* Pixel Data - only used in ident() */ + { EVR_PixelData, "PixelData", &noDelimiters, 0, DCMVR_PROP_INTERNAL, 0, DCM_UndefinedLength }, + /* Overlay Data - only used in ident() */ + { EVR_OverlayData, "OverlayData", &noDelimiters, 0, DCMVR_PROP_INTERNAL, 0, DCM_UndefinedLength }, + + { EVR_UNKNOWN2B, "??", &noDelimiters, sizeof(Uint8), /* illegal VRs, we assume no extended length coding */ + DCMVR_PROP_NONSTANDARD | DCMVR_PROP_INTERNAL, 0, DCM_UndefinedLength }, + +}; + +static const int DcmVRDict_DIM = OFstatic_cast(int, sizeof(DcmVRDict) / sizeof(DcmVREntry)); + + +/* +** Check the consistency of the DcmVRDict +*/ + +#ifdef DEBUG + +#include "dcmtk/ofstd/ofstream.h" + +class DcmVRDict_checker { +private: + int error_found; +public: + DcmVRDict_checker(); +}; + +DcmVRDict_checker::DcmVRDict_checker() + : error_found(OFFalse) +{ + for (int i = 0; i < DcmVRDict_DIM; i++) { + if (DcmVRDict[i].vr != i) { + error_found = OFTrue; + DCMDATA_FATAL("DcmVRDict: Internal ERROR: inconsistent indexing: " << DcmVRDict[i].vrName); + abort(); + } + } +} + +const DcmVRDict_checker DcmVRDict_startup_check(); + +#endif + +/* +** DcmVR member functions +*/ + +void +DcmVR::setVR(DcmEVR evr) +{ + if ((OFstatic_cast(int, evr) >= 0) && (OFstatic_cast(int, evr) < DcmVRDict_DIM)) { + vr = evr; + } else { + vr = EVR_UNKNOWN; + } +} + +void +DcmVR::setVR(const char* vrName) +{ + vr = EVR_UNKNOWN; /* default */ + if (vrName != NULL) + { + int found = OFFalse; + int i = 0; + for (i = 0; (!found && (i < DcmVRDict_DIM)); i++) + { + /* We only compare the first two characters of the passed string and + * never accept a VR that is labeled for internal use only. + */ + if ((strncmp(vrName, DcmVRDict[i].vrName, 2) == 0) && + !(DcmVRDict[i].propertyFlags & DCMVR_PROP_INTERNAL)) + { + found = OFTrue; + vr = DcmVRDict[i].vr; + } + } + /* Workaround: There have been reports of systems transmitting + * illegal VR strings in explicit VR (i.e. "??") without using + * extended length fields. This is particularly bad because the + * DICOM committee has announced that all future VRs will use + * extended length. In order to distinguish between these two + * variants, we treat all unknown VRs consisting of uppercase + * letters as "real" future VRs (and thus assume extended length). + * All other VR strings are treated as "illegal" VRs. + */ + char c1 = *vrName; + char c2 = (c1) ? (*(vrName + 1)) : ('\0'); + if ((c1 == '?') && (c2 == '?')) vr = EVR_UNKNOWN2B; + if (!found && ((c1 < 'A') || (c1 > 'Z') || (c2 < 'A') || (c2 > 'Z'))) vr = EVR_UNKNOWN2B; + } +} + +DcmEVR +DcmVR::getValidEVR() const +{ + DcmEVR evr = EVR_UNKNOWN; + + if (isStandard()) { + evr = vr; + } else { + switch (vr) { + case EVR_up: + evr = EVR_UL; + break; + case EVR_xs: + evr = EVR_US; + break; + case EVR_lt: + evr = EVR_OW; + break; + case EVR_ox: + case EVR_pixelSQ: + evr = EVR_OB; + break; + default: + evr = EVR_UN; /* handle as Unknown VR */ + break; + } + } + + /* + ** If the generation of post-1993 VRs is not globally enabled then use OB instead. + ** We may not want to generate these "new" VRs if other software cannot handle it. + */ + DcmEVR oldVR = evr; + switch (evr) { + case EVR_UN: + if (!dcmEnableUnknownVRGeneration.get()) + evr = EVR_OB; /* handle UN as if OB */ + break; + case EVR_UT: + if (!dcmEnableUnlimitedTextVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle UT as if UN */ + else + evr = EVR_OB; /* handle UT as if OB */ + } + break; + case EVR_OF: + if (!dcmEnableOtherFloatVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle OF as if UN */ + else + evr = EVR_OB; /* handle OF as if OB */ + } + break; + case EVR_OD: + if (!dcmEnableOtherDoubleVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle OD as if UN */ + else + evr = EVR_OB; /* handle OD as if OB */ + } + break; + case EVR_OL: + if (!dcmEnableOtherLongVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle OL as if UN */ + else + evr = EVR_OB; /* handle OL as if OB */ + } + break; + case EVR_UR: + if (!dcmEnableUniversalResourceIdentifierOrLocatorVRGeneration.get()) + { + if (dcmEnableUnlimitedTextVRGeneration.get()) + evr = EVR_UT; /* handle UR as if UT */ + else if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle UR as if UN */ + else + evr = EVR_OB; /* handle UR as if OB */ + } + break; + case EVR_UC: + if (!dcmEnableUnlimitedCharactersVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle UC as if UN */ + else + evr = EVR_OB; /* handle UC as if OB */ + } + break; + case EVR_OV: + if (!dcmEnableOther64bitVeryLongVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle OV as if UN */ + else + evr = EVR_OB; /* handle OV as if OB */ + } + break; + case EVR_SV: + if (!dcmEnableSigned64bitVeryLongVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle SV as if UN */ + else + evr = EVR_OB; /* handle SV as if OB */ + } + break; + case EVR_UV: + if (!dcmEnableUnsigned64bitVeryLongVRGeneration.get()) + { + if (dcmEnableUnknownVRGeneration.get()) + evr = EVR_UN; /* handle UV as if UN */ + else + evr = EVR_OB; /* handle UV as if OB */ + } + break; + default: + /* in all other cases, do nothing */ + break; + } + if (oldVR != evr) + { + DCMDATA_TRACE("DcmVR::getValidEVR() VR=\"" << DcmVR(oldVR).getVRName() + << "\" replaced by \"" << DcmVR(evr).getVRName() << "\" since support is disabled"); + } + + return evr; +} + +size_t +DcmVR::getValueWidth(void) const +{ + return DcmVRDict[vr].fValWidth; +} + + +const char* +DcmVR::getVRName() const +{ + return DcmVRDict[vr].vrName; +} + +const char* +DcmVR::getValidVRName() const +{ + DcmVR avr(getValidEVR()); + return avr.getVRName(); +} + +OFBool +DcmVR::isStandard() const +{ + return (DcmVRDict[vr].propertyFlags & DCMVR_PROP_NONSTANDARD) ? OFFalse : OFTrue; +} + +OFBool +DcmVR::isForInternalUseOnly() const +{ + return (DcmVRDict[vr].propertyFlags & DCMVR_PROP_INTERNAL) ? OFTrue : OFFalse; +} + +/* returns true if VR represents a string */ +OFBool +DcmVR::isaString() const +{ + return (DcmVRDict[vr].propertyFlags & DCMVR_PROP_ISASTRING) ? OFTrue : OFFalse; +} + +/* + * returns true if VR uses an extended length encoding + * for explicit transfer syntaxes + */ +OFBool +DcmVR::usesExtendedLengthEncoding() const +{ + return (DcmVRDict[vr].propertyFlags & DCMVR_PROP_EXTENDEDLENGTHENCODING) ? OFTrue : OFFalse; +} + +/* returns true if VR supports undefined length */ +OFBool +DcmVR::supportsUndefinedLength() const +{ + return (DcmVRDict[vr].propertyFlags & DCMVR_PROP_UNDEFINEDLENGTH) ? OFTrue : OFFalse; +} + +Uint32 +DcmVR::getMinValueLength() const +{ + return (DcmVRDict[vr].minValueLength); +} + +Uint32 +DcmVR::getMaxValueLength() const +{ + return (DcmVRDict[vr].maxValueLength); +} + +/* returns true if the VR is equivalent */ +OFBool +DcmVR::isEquivalent(const DcmVR& avr) const +{ + DcmEVR evr = avr.getEVR(); + if (vr == evr) return OFTrue; + + OFBool result = OFFalse; + switch (vr) + { + case EVR_ox: + result = (evr == EVR_OB || evr == EVR_OW); + break; + case EVR_lt: + result = (evr == EVR_OW || evr == EVR_US || evr == EVR_SS); + break; + case EVR_OB: + result = (evr == EVR_ox); + break; + case EVR_OW: + result = (evr == EVR_ox || evr == EVR_lt); + break; + case EVR_up: + result = (evr == EVR_UL); + break; + case EVR_UL: + result = (evr == EVR_up); + break; + case EVR_xs: + result = (evr == EVR_SS || evr == EVR_US); + break; + case EVR_SS: + case EVR_US: + result = (evr == EVR_xs || evr == EVR_lt); + break; + default: + break; + } + return result; +} + +OFBool +DcmVR::isAffectedBySpecificCharacterSet() const +{ + return (DcmVRDict[vr].propertyFlags & DCMVR_PROP_ISAFFECTEDBYCHARSET) ? OFTrue : OFFalse; +} + +const OFString& +DcmVR::getDelimiterChars() const +{ + return *DcmVRDict[vr].delimiterChars; +} + +/* returns true if VR length is in char */ +OFBool +DcmVR::isLengthInChar() const +{ + return (DcmVRDict[vr].propertyFlags & DCMVR_PROP_ISLENGTHINCHAR) ? OFTrue : OFFalse; +} diff --git a/dcmdata/libsrc/dcvrae.cc b/dcmdata/libsrc/dcvrae.cc new file mode 100644 index 00000000..41497aca --- /dev/null +++ b/dcmdata/libsrc/dcvrae.cc @@ -0,0 +1,149 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmApplicationEntity + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrae.h" +#include "dcmtk/dcmdata/dcmatch.h" + + +#define MAX_AE_LENGTH 16 + + +// ******************************** + + +DcmApplicationEntity::DcmApplicationEntity(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(MAX_AE_LENGTH); + setNonSignificantChars(" \\"); +} + + +DcmApplicationEntity::DcmApplicationEntity(const DcmApplicationEntity &old) + : DcmByteString(old) +{ +} + + +DcmApplicationEntity::~DcmApplicationEntity() +{ +} + + +DcmApplicationEntity &DcmApplicationEntity::operator=(const DcmApplicationEntity &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmApplicationEntity::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmApplicationEntity &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmApplicationEntity::ident() const +{ + return EVR_AE; +} + + +OFCondition DcmApplicationEntity::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmApplicationEntity::checkStringValue(strVal, vm); + return l_error; +} + + +// ******************************** + + +OFCondition DcmApplicationEntity::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + /* call inherited method */ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos, normalize); + /* normalize string if required */ + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmApplicationEntity::checkStringValue(const OFString &value, + const OFString &vm) +{ + return DcmByteString::checkStringValue(value, vm, "ae", 13, MAX_AE_LENGTH); +} + + +OFBool DcmApplicationEntity::isUniversalMatch(const OFBool normalize, + const OFBool enableWildCardMatching) +{ + if(!isEmpty(normalize)) + { + if(enableWildCardMatching) + { + OFString value; + for(unsigned long valNo = 0; valNo < getVM(); ++valNo) + { + getOFString(value, valNo, normalize); + if(value.find_first_not_of( '*' ) != OFString_npos) + return OFFalse; + } + } + else + return OFFalse; + } + return OFTrue; +} + + +OFBool DcmApplicationEntity::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + if (enableWildCardMatching) + return DcmAttributeMatching::wildCardMatching(key.c_str(), key.length(), candidate.c_str(), candidate.length()); + else + return DcmByteString::matches(key, candidate, OFFalse); +} diff --git a/dcmdata/libsrc/dcvras.cc b/dcmdata/libsrc/dcvras.cc new file mode 100644 index 00000000..13d25d31 --- /dev/null +++ b/dcmdata/libsrc/dcvras.cc @@ -0,0 +1,95 @@ +/* + * + * Copyright (C) 1994-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmAgeString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvras.h" + + +// ******************************** + + +DcmAgeString::DcmAgeString(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(4); +} + + +DcmAgeString::DcmAgeString(const DcmAgeString &old) + : DcmByteString(old) +{ +} + + +DcmAgeString::~DcmAgeString() +{ +} + +DcmAgeString &DcmAgeString::operator=(const DcmAgeString &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmAgeString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmAgeString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmAgeString::ident() const +{ + return EVR_AS; +} + + +OFCondition DcmAgeString::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmAgeString::checkStringValue(strVal, vm); + return l_error; +} + + +// ******************************** + + +OFCondition DcmAgeString::checkStringValue(const OFString &value, + const OFString &vm) +{ + return DcmByteString::checkStringValue(value, vm, "as", 1); +} diff --git a/dcmdata/libsrc/dcvrat.cc b/dcmdata/libsrc/dcvrat.cc new file mode 100644 index 00000000..428f9a59 --- /dev/null +++ b/dcmdata/libsrc/dcvrat.cc @@ -0,0 +1,477 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmAttributeTag + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcjson.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +// ******************************** + + +DcmAttributeTag::DcmAttributeTag(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + +DcmAttributeTag::DcmAttributeTag(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmAttributeTag::DcmAttributeTag(const DcmAttributeTag &old) + : DcmElement(old) +{ +} + + +DcmAttributeTag::~DcmAttributeTag() +{ +} + + +DcmAttributeTag &DcmAttributeTag::operator=(const DcmAttributeTag &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmAttributeTag::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmAttributeTag* myThis = NULL; + DcmAttributeTag* myRhs = NULL; + myThis = OFconst_cast(DcmAttributeTag*, this); + myRhs = OFstatic_cast(DcmAttributeTag*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + DcmTagKey val; + if (myThis->getTagVal(val, count).good()) + { + DcmTagKey rhsVal; + if (myRhs->getTagVal(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + /* otherwise they are equal, continue comparison */ + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmAttributeTag::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmAttributeTag &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmAttributeTag::ident() const +{ + return EVR_AT; +} + + +OFCondition DcmAttributeTag::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only, further checks on the attribute tags could be added later */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmAttributeTag::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmAttributeTag::getNumberOfValues() +{ + /* attribute tags store pairs of 16 bit values */ + return OFstatic_cast(unsigned long, getLengthField() / (2 * sizeof(Uint16))); +} + + +// ******************************** + + +void DcmAttributeTag::print(STD_NAMESPACE ostream& out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get unsigned integer data */ + Uint16 *uintVals; + errorFlag = getUint16Array(uintVals); + const unsigned long count = getNumberOfValues(); + if ((uintVals != NULL) && (count > 0)) + { + /* determine number of values to be printed */ + unsigned long expectedLength = count * (11 + 1) - 1; + const unsigned long printCount = + ((expectedLength > DCM_OptPrintLineLength) && (flags & DCMTypes::PF_shortenLongTagValues)) ? + (DCM_OptPrintLineLength - 3 /* for "..." */ + 1) / (11 /* (gggg,eeee) */ + 1 /* for "\" */) : count; + unsigned long printedLength = printCount * (11 + 1) - 1; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + if (printCount > 0) + { + out << STD_NAMESPACE hex << STD_NAMESPACE setfill('0'); + /* print tag values (group,element) in hex mode */ + out << '(' << STD_NAMESPACE setw(4) << (*(uintVals++)); + out << ',' << STD_NAMESPACE setw(4) << (*(uintVals++)) << ')'; + for (unsigned long i = 1; i < printCount; i++) + { + out << "\\" << '(' << STD_NAMESPACE setw(4) << (*(uintVals++)); + out << ',' << STD_NAMESPACE setw(4) << (*(uintVals++)) << ')'; + } + /* reset i/o manipulators */ + out << STD_NAMESPACE dec << STD_NAMESPACE setfill(' '); + } + /* print trailing "..." if data has been truncated */ + if (printCount < count) + { + out << "..."; + printedLength += 3; + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmAttributeTag::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* AT requires special handling in the Native DICOM Model format */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* write normal XML start tag */ + DcmElement::writeXMLStartTag(out, flags); + /* get unsigned integer data */ + Uint16 *uintVals; + getUint16Array(uintVals); + const unsigned long vm = getVM(); + /* check for empty/invalid value */ + if ((uintVals != NULL) && (vm > 0)) + { + out << STD_NAMESPACE uppercase << STD_NAMESPACE setfill('0'); + /* print tag values "ggggeeee" in hex mode (upper case!) */ + for (unsigned long valNo = 0; valNo < vm; valNo++) + { + out << ""; + out << STD_NAMESPACE hex << STD_NAMESPACE setw(4) << (*(uintVals++)); + out << STD_NAMESPACE setw(4) << (*(uintVals++)) << STD_NAMESPACE dec; + out << "" << OFendl; + } + /* reset i/o manipulators */ + out << STD_NAMESPACE nouppercase << STD_NAMESPACE setfill(' '); + } + /* write normal XML end tag */ + DcmElement::writeXMLEndTag(out, flags); + /* always report success */ + return EC_Normal; + } else { + /* DCMTK-specific format does not require anything special */ + return DcmElement::writeXML(out, flags); + } +} + + +// ******************************** + + +OFCondition DcmAttributeTag::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + // always write JSON Opener + DcmElement::writeJsonOpener(out, format); + Uint16 *uintVals; + getUint16Array(uintVals); + const unsigned long vm = getVM(); + // check for empty/invalid value + if ((uintVals != NULL) && (vm > 0)) + { + format.printValuePrefix(out); + out << STD_NAMESPACE uppercase << STD_NAMESPACE setfill('0'); + // print tag values "ggggeeee" in hex mode (upper case!) + out << "\""; + out << STD_NAMESPACE hex << STD_NAMESPACE setw(4) << (*(uintVals++)); + out << STD_NAMESPACE setw(4) << (*(uintVals++)) << STD_NAMESPACE dec; + out << "\""; + for (unsigned long valNo = 1; valNo < vm; valNo++) + { + format.printNextArrayElementPrefix(out); + out << "\""; + out << STD_NAMESPACE hex << STD_NAMESPACE setw(4) << (*(uintVals++)); + out << STD_NAMESPACE setw(4) << (*(uintVals++)) << STD_NAMESPACE dec; + out << "\""; + } + // reset i/o manipulators + out << STD_NAMESPACE nouppercase << STD_NAMESPACE setfill(' '); + format.printValueSuffix(out); + } + // write normal JSON closer + DcmElement::writeJsonCloser(out, format); + // always report success + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmAttributeTag::getTagVal(DcmTagKey &tagVal, + const unsigned long pos) +{ + /* get unsigned integer data */ + Uint16 *uintValues; + errorFlag = getUint16Array(uintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (uintValues == NULL) + errorFlag = EC_IllegalCall; + else if (pos >= getVM()) + errorFlag = EC_IllegalParameter; + else + tagVal.set(uintValues[2 * pos] /*group*/, uintValues[2 * pos + 1] /*element*/); + } + /* clear value in case of error */ + if (errorFlag.bad()) + tagVal = DcmTagKey(); + return errorFlag; +} + + +OFCondition DcmAttributeTag::getUint16Array(Uint16 *&uintVals) +{ + uintVals = OFstatic_cast(Uint16 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmAttributeTag::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + DcmTagKey tagVal; + /* get the specified tag value */ + errorFlag = getTagVal(tagVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[32]; + sprintf(buffer, "(%4.4x,%4.4x)", tagVal.getGroup(), tagVal.getElement()); + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmAttributeTag::putTagVal(const DcmTagKey &tagVal, + const unsigned long pos) +{ + /* create tag data */ + Uint16 uintVals[2]; + uintVals[0] = tagVal.getGroup(); + uintVals[1] = tagVal.getElement(); + /* change element value */ + errorFlag = changeValue(uintVals, OFstatic_cast(Uint32, 2 * sizeof(Uint16) * OFstatic_cast(size_t, pos)), 2 * OFstatic_cast(Uint32, sizeof(Uint16))); + return errorFlag; +} + + +OFCondition DcmAttributeTag::putUint16Array(const Uint16 *uintVals, + const unsigned long numUints) +{ + errorFlag = EC_Normal; + if (numUints > 0) + { + /* check for valid data */ + if (uintVals != NULL) + errorFlag = putValue(uintVals, OFstatic_cast(Uint32, 2 * sizeof(Uint16) * OFstatic_cast(size_t, numUints))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmAttributeTag::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmAttributeTag::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Uint16 * field = new Uint16[2 * vm]; + OFString value; + size_t pos = 0; + /* retrieve attribute tag data from character string */ + for (unsigned long i = 0; (i < 2 * vm) && errorFlag.good(); i += 2) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (value.empty() || sscanf(value.c_str(), "(%hx,%hx)", &field[i], &field[i + 1]) != 2) + errorFlag = EC_CorruptedData; + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putUint16Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmAttributeTag::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (2 * sizeof(Uint16)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % (2* OFstatic_cast(Uint32, sizeof(Uint16))))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmAttributeTag::checkStringValue(const OFString &value, + const OFString &vm) +{ + return DcmElement::checkVM(DcmElement::determineVM(value.c_str(), value.length()), vm); +} + + +// ******************************** + + +OFBool DcmAttributeTag::isUniversalMatch(const OFBool normalize, + const OFBool enableWildCardMatching) +{ + if(!isEmpty(normalize)) + { + if(enableWildCardMatching) + { + OFString value; + for(unsigned long valNo = 0; valNo < getVM(); ++valNo) + { + getOFString(value, valNo, normalize); + if(value.find_first_not_of( '*' ) != OFString_npos) + return OFFalse; + } + } + else + return OFFalse; + } + return OFTrue; +} diff --git a/dcmdata/libsrc/dcvrcs.cc b/dcmdata/libsrc/dcvrcs.cc new file mode 100644 index 00000000..f3db927d --- /dev/null +++ b/dcmdata/libsrc/dcvrcs.cc @@ -0,0 +1,178 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: class DcmCodeString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcmatch.h" + + +#define MAX_CS_LENGTH 16 + + +// ******************************** + + +DcmCodeString::DcmCodeString(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(MAX_CS_LENGTH); + setNonSignificantChars(" \\"); +} + + +DcmCodeString::DcmCodeString(const DcmCodeString &old) + : DcmByteString(old) +{ +} + + +DcmCodeString::~DcmCodeString() +{ +} + + +DcmCodeString &DcmCodeString::operator=(const DcmCodeString &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmCodeString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmCodeString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmCodeString::ident() const +{ + return EVR_CS; +} + + +OFCondition DcmCodeString::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmCodeString::checkStringValue(strVal, vm); + return l_error; +} + + +// ******************************** + + +OFCondition DcmCodeString::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFBool DcmCodeString::checkVR(const OFString &value, + size_t *pos, + const OFBool checkLength) +{ + unsigned char c; + size_t i; + const size_t length = value.length(); + const size_t maxlen = (length < MAX_CS_LENGTH) || (!checkLength) ? length : MAX_CS_LENGTH; + /* iterate over all characters (up to the maximum) */ + for (i = 0; i < maxlen; i++) + { + c = value.at(i); + /* check for valid CS character: A-Z, 0-9, _ and ' ' (space) */ + if ((c != ' ') && (c != '_') && !isdigit(c) && !(isalpha(c) && isupper(c))) + break; + } + /* return position of first invalid character (eos if all valid) */ + if (pos != NULL) + *pos = i; + /* OFFalse in case of any invalid character */ + return (i == length); +} + + +// ******************************** + + +OFCondition DcmCodeString::checkStringValue(const OFString &value, + const OFString &vm) +{ + return DcmByteString::checkStringValue(value, vm, "cs", 10, MAX_CS_LENGTH); +} + + +OFBool DcmCodeString::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + if (enableWildCardMatching) + return DcmAttributeMatching::wildCardMatching(key.c_str(), key.length(), candidate.c_str(), candidate.length()); + else + return DcmByteString::matches(key, candidate, OFFalse); +} + + +OFBool DcmCodeString::isUniversalMatch(const OFBool normalize, + const OFBool enableWildCardMatching) +{ + if(!isEmpty(normalize)) + { + if(enableWildCardMatching) + { + OFString value; + for(unsigned long valNo = 0; valNo < getVM(); ++valNo) + { + getOFString(value, valNo, normalize); + if(value.find_first_not_of( '*' ) != OFString_npos) + return OFFalse; + } + } + else + return OFFalse; + } + return OFTrue; +} diff --git a/dcmdata/libsrc/dcvrda.cc b/dcmdata/libsrc/dcvrda.cc new file mode 100644 index 00000000..d459de0c --- /dev/null +++ b/dcmdata/libsrc/dcvrda.cc @@ -0,0 +1,387 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth, Joerg Riesmeier + * + * Purpose: Implementation of class DcmDate + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/dcmdata/dcmatch.h" + + +// ******************************** + + +DcmDate::DcmDate(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(10); + setNonSignificantChars("\\"); +} + + +DcmDate::DcmDate(const DcmDate &old) + : DcmByteString(old) +{ +} + + +DcmDate::~DcmDate() +{ +} + + +DcmDate &DcmDate::operator=(const DcmDate &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmDate::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmDate &, rhs); + } + return EC_Normal; +} + + + +// ******************************** + + +DcmEVR DcmDate::ident() const +{ + return EVR_DA; +} + + +OFCondition DcmDate::checkValue(const OFString &vm, + const OFBool oldFormat) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmDate::checkStringValue(strVal, vm, oldFormat); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDate::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDate::getOFDate(OFDate &dateValue, + const unsigned long pos, + const OFBool supportOldFormat) +{ + OFString dicomDate; + /* convert the current element value to OFDate format */ + OFCondition l_error = getOFString(dicomDate, pos); + if (l_error.good()) + l_error = getOFDateFromString(dicomDate, dateValue, supportOldFormat); + else + dateValue.clear(); + return l_error; +} + + +OFCondition DcmDate::getISOFormattedDate(OFString &formattedDate, + const unsigned long pos, + const OFBool supportOldFormat) +{ + OFString dicomDate; + /* get current element value and convert to ISO formatted date */ + OFCondition l_error = getOFString(dicomDate, pos); + if (l_error.good()) + l_error = getISOFormattedDateFromString(dicomDate, formattedDate, supportOldFormat); + else + formattedDate.clear(); + return l_error; +} + + +OFCondition DcmDate::setCurrentDate() +{ + OFString dicomDate; + /* set the element value to the current system date */ + OFCondition l_error = getCurrentDate(dicomDate); + if (l_error.good()) + l_error = putOFStringArray(dicomDate); + return l_error; +} + + +OFCondition DcmDate::setOFDate(const OFDate &dateValue) +{ + OFString dicomDate; + /* convert OFDate value to DICOM DA format and set the element value */ + OFCondition l_error = getDicomDateFromOFDate(dateValue, dicomDate); + if (l_error.good()) + l_error = putOFStringArray(dicomDate); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDate::getCurrentDate(OFString &dicomDate) +{ + OFCondition l_error = EC_IllegalCall; + OFDate dateValue; + /* get the current system date */ + if (dateValue.setCurrentDate()) + { + /* format: YYYYMMDD */ + if (dateValue.getISOFormattedDate(dicomDate, OFFalse /*showDelimiter*/)) + l_error = EC_Normal; + } + /* set default date if an error occurred */ + if (l_error.bad()) + { + /* format: YYYYMMDD */ + dicomDate = "19000101"; + } + return l_error; +} + + +OFCondition DcmDate::getDicomDateFromOFDate(const OFDate &dateValue, + OFString &dicomDate) +{ + OFCondition l_error = EC_IllegalParameter; + /* convert OFDate value to DICOM DA format */ + if (dateValue.getISOFormattedDate(dicomDate, OFFalse /*showDelimiter*/)) + l_error = EC_Normal; + return l_error; +} + +OFCondition DcmDate::getOFDateFromString(const OFString &dicomDate, + OFDate &dateValue) +{ + return getOFDateFromString(dicomDate.c_str(), dicomDate.size(), dateValue, OFTrue); +} + +OFCondition DcmDate::getOFDateFromString(const OFString &dicomDate, + OFDate &dateValue, + const OFBool supportOldFormat) +{ + return getOFDateFromString(dicomDate.c_str(), dicomDate.size(), dateValue, supportOldFormat); +} + +OFCondition DcmDate::getOFDateFromString(const char* dicomDate, + const size_t dicomDateSize, + OFDate &dateValue) +{ + return getOFDateFromString(dicomDate, dicomDateSize, dateValue, OFTrue); +} + +OFCondition DcmDate::getOFDateFromString(const char* dicomDate, + const size_t dicomDateSize, + OFDate &dateValue, + const OFBool supportOldFormat) +{ + // clear result variable + dateValue.clear(); + // fixed length 8 bytes required by DICOM part 5: YYYYMMDD + if (dicomDateSize == 8 && OFStandard::checkDigits<8>(dicomDate)) + { + // extract components from date string + if + ( + dateValue.setDate + ( + OFStandard::extractDigits(dicomDate), + OFStandard::extractDigits(dicomDate + 4), + OFStandard::extractDigits(dicomDate + 6) + ) + ) + { + return EC_Normal; + } + } + // old prior V3.0 version of VR=DA with fixed length 10 bytes: YYYY.MM.DD + else if + ( + supportOldFormat && dicomDateSize == 10 && dicomDate[4] == '.' && dicomDate[7] == '.' && + OFStandard::checkDigits<4>(dicomDate) && + OFStandard::checkDigits<2>(dicomDate + 5) && + OFStandard::checkDigits<2>(dicomDate + 8) + ) + { + // extract components from date string + if + ( + dateValue.setDate + ( + OFStandard::extractDigits(dicomDate), + OFStandard::extractDigits(dicomDate + 5), + OFStandard::extractDigits(dicomDate + 8) + ) + ) + { + return EC_Normal; + } + } + return EC_IllegalParameter; +} + + +OFCondition DcmDate::getISOFormattedDateFromString(const OFString &dicomDate, + OFString &formattedDate, + const OFBool supportOldFormat) +{ + OFCondition l_error = EC_Normal; + if (!dicomDate.empty()) + { + OFDate dateValue; + /* convert string to OFDate */ + l_error = getOFDateFromString(dicomDate, dateValue, supportOldFormat); + if (l_error.good()) + { + /* convert OFDate to ISO formatted date */ + if (!dateValue.getISOFormattedDate(formattedDate)) + l_error = EC_CorruptedData; + } + /* clear the result variable in case of error */ + if (l_error.bad()) + formattedDate.clear(); + } else { + /* input string is empty, so is the result string */ + formattedDate.clear(); + } + return l_error; +} + + +// ******************************** + +OFBool DcmDate::check(const char* dicomDate, + const size_t dicomDateSize) +{ + return check(dicomDate, dicomDateSize, OFFalse); +} + +OFBool DcmDate::check(const char* dicomDate, + const size_t dicomDateSize, + const OFBool supportOldFormat) +{ + switch (DcmElement::scanValue("da", dicomDate, dicomDateSize)) + { + case 2 /* DA */: + case 17 /* dubious DA (pre 1850 or post 2049) */: + return OFTrue; + case 3 /* old style DA */: + return supportOldFormat; + default: + return OFFalse; + } +} + +OFCondition DcmDate::checkStringValue(const OFString &value, + const OFString &vm, + const OFBool oldFormat) +{ + OFCondition result = EC_Normal; + const size_t valLen = value.length(); + if (valLen > 0) + { + size_t posStart = 0; + unsigned long vmNum = 0; + /* iterate over all value components */ + while (posStart != OFString_npos) + { + ++vmNum; + /* search for next component separator */ + const size_t posEnd = value.find('\\', posStart); + const size_t length = (posEnd == OFString_npos) ? valLen - posStart : posEnd - posStart; + if (dcmEnableVRCheckerForStringValues.get()) + { + /* check value representation */ + if (!check(value.data() + posStart, length, oldFormat)) + { + result = EC_ValueRepresentationViolated; + break; + } + } + posStart = (posEnd == OFString_npos) ? posEnd : posEnd + 1; + } + if (result.good() && !vm.empty()) + { + /* check value multiplicity */ + result = DcmElement::checkVM(vmNum, vm); + } + } + return result; +} + +OFBool DcmDate::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + return DcmAttributeMatching::rangeMatchingDate(key.c_str(), key.length(), candidate.c_str(), candidate.length()); +} + +OFBool DcmDate::combinationMatches(const DcmElement& keySecond, + const DcmElement& candidateFirst, + const DcmElement& candidateSecond) const +{ + if (keySecond.ident() == EVR_TM && candidateFirst.ident() == EVR_DA && candidateSecond.ident() == EVR_TM) + { + // do many const casts, but we do not modify the value, I promise... + DcmDate& queryDate = OFconst_cast(DcmDate&, *this); + DcmDate& candidateDate = OFconst_cast(DcmDate&, OFstatic_cast(const DcmDate&, candidateFirst)); + DcmTime& queryTime = OFconst_cast(DcmTime&, OFstatic_cast(const DcmTime&, keySecond)); + DcmTime& candidateTime = OFconst_cast(DcmTime&, OFstatic_cast(const DcmTime&, candidateSecond)); + OFString a0, a1, b0, b1; + // no support for VM>1 so far! + return queryDate.getOFString( a0, 0, OFTrue ).good() && queryTime.getOFString( a1, 0, OFTrue ).good() && + candidateDate.getOFString( b0, 0, OFTrue ).good() && candidateTime.getOFString( b1, 0, OFTrue ).good() && + DcmAttributeMatching::rangeMatchingDateTime + ( + a0.c_str(), a0.length(), a1.c_str(), a1.length(), b0.c_str(), b0.length(), b1.c_str(), b1.length() + ); + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcvrds.cc b/dcmdata/libsrc/dcvrds.cc new file mode 100644 index 00000000..e8895e76 --- /dev/null +++ b/dcmdata/libsrc/dcvrds.cc @@ -0,0 +1,280 @@ +/* + * + * Copyright (C) 1994-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmDecimalString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstd.h" + + +#define MAX_DS_LENGTH 16 + + +// ******************************** + + +DcmDecimalString::DcmDecimalString(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(MAX_DS_LENGTH); + setNonSignificantChars(" \\"); +} + + +DcmDecimalString::DcmDecimalString(const DcmDecimalString &old) + : DcmByteString(old) +{ +} + + +DcmDecimalString::~DcmDecimalString() +{ +} + + +DcmDecimalString &DcmDecimalString::operator=(const DcmDecimalString &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmDecimalString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmDecimalString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmDecimalString::ident() const +{ + return EVR_DS; +} + + +OFCondition DcmDecimalString::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmDecimalString::checkStringValue(strVal, vm); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDecimalString::getFloat64(Float64 &doubleVal, + const unsigned long pos) +{ + /* get decimal string value */ + OFString str; + OFCondition l_error = getOFString(str, pos, OFTrue /*normalize*/); + if (l_error.good()) + { + OFBool success = OFFalse; + /* convert string to float value */ + doubleVal = OFStandard::atof(str.c_str(), &success); + if (!success) + l_error = EC_CorruptedData; + } + return l_error; +} + + +OFCondition DcmDecimalString::getFloat64Vector(OFVector &doubleVals) +{ + /* get stored value */ + char *strVal = NULL; + Uint32 strLen = 0; + OFCondition l_error = getString(strVal, strLen); + /* clear result variable */ + doubleVals.clear(); + if (l_error.good() && (strVal != NULL)) + { + /* determine number of stored values */ + const unsigned long vm = getVM(); + if (vm > 0) + { + Float64 doubleVal; + OFString doubleStr; + char *p = strVal; + OFBool success = OFFalse; + /* avoid memory re-allocations by specifying the expected size */ + doubleVals.reserve(vm); + /* iterate over the string value and search for delimiters */ + for (Uint32 i = 0; i <= strLen; i++) + { + if ((i == strLen) || (*p == '\\')) + { + /* extract single value and convert it to floating point */ + doubleStr.assign(strVal, p - strVal); + doubleVal = OFStandard::atof(doubleStr.c_str(), &success); + if (success) + { + /* store floating point value in result variable */ + doubleVals.push_back(doubleVal); + strVal = p + 1; + } + else + { + l_error = EC_CorruptedData; + break; + } + } + ++p; + } + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmDecimalString::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + /* call inherited method */ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos); + /* normalize string if required */ + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDecimalString::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + if (flags & DCMTypes::XF_useNativeModel) + { + /* for the Native DICOM Model output, we do not need any specific DS handling */ + return DcmElement::writeXML(out, flags); + } else { + /* XML start tag: */ + writeXMLStartTag(out, flags); + /* write element value (if loaded) */ + if (valueLoaded()) + { + /* get string data (without normalization) */ + char *value = NULL; + Uint32 length = 0; + getString(value, length); + if ((value != NULL) && (length > 0)) + { + /* explicitly convert to OFString because of possible NULL bytes */ + OFString stringVal(value, length); + const OFBool convertNonASCII = (flags & DCMTypes::XF_convertNonASCII) > 0; + /* check whether conversion to XML markup string is required */ + if (OFStandard::checkForMarkupConversion(stringVal, convertNonASCII)) + OFStandard::convertToMarkupStream(out, stringVal, convertNonASCII); + else + out << value; + } + } + /* XML end tag: */ + writeXMLEndTag(out, flags); + /* always report success */ + return EC_Normal; + } +} + + +// ******************************** + + +OFCondition DcmDecimalString::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + writeJsonOpener(out, format); + /* write element value (if loaded) */ + if (valueLoaded()) + { + OFString bulkDataValue; + if (format.asBulkDataURI(getTag(), bulkDataValue)) + { + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, bulkDataValue); + } + else + { + /* get string data (without normalization) */ + char *value_ = OFnullptr; + Uint32 length = 0; + getString(value_, length); + if ((value_ != OFnullptr) && (length > 0)) + { + /* explicitly convert to OFString because of possible NULL bytes */ + OFString value(value_, length); + OFCondition status = getOFString(value, 0L); + if (status.bad()) + return status; + format.printValuePrefix(out); + DcmJsonFormat::printNumberDecimal(out, value); + const unsigned long vm = getVM(); + for (unsigned long valNo = 1; valNo < vm; ++valNo) + { + status = getOFString(value, valNo); + if (status.bad()) + return status; + format.printNextArrayElementPrefix(out); + DcmJsonFormat::printNumberDecimal(out, value); + } + format.printValueSuffix(out); + } + } + } + /* write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmDecimalString::checkStringValue(const OFString &value, + const OFString &vm) +{ + return DcmByteString::checkStringValue(value, vm, "ds", 6, MAX_DS_LENGTH); +} diff --git a/dcmdata/libsrc/dcvrdt.cc b/dcmdata/libsrc/dcvrdt.cc new file mode 100644 index 00000000..f0088c31 --- /dev/null +++ b/dcmdata/libsrc/dcvrdt.cc @@ -0,0 +1,417 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth, Joerg Riesmeier + * + * Purpose: Implementation of class DcmDateTime + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcmatch.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + + +#define MAX_DT_LENGTH 26 + + +// ******************************** + + +DcmDateTime::DcmDateTime(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(MAX_DT_LENGTH); + setNonSignificantChars(" \\"); +} + +DcmDateTime::DcmDateTime(const DcmDateTime &old) + : DcmByteString(old) +{ +} + + +DcmDateTime::~DcmDateTime() +{ +} + + +DcmDateTime &DcmDateTime::operator=(const DcmDateTime &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmDateTime::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmDateTime &, rhs); + } + return EC_Normal; +} + +// ******************************** + + +DcmEVR DcmDateTime::ident() const +{ + return EVR_DT; +} + + +OFCondition DcmDateTime::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmDateTime::checkStringValue(strVal, vm); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDateTime::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDateTime::getOFDateTime(OFDateTime &dateTimeValue, + const unsigned long pos) +{ + OFString dicomDateTime; + /* convert the current element value to OFDateTime format */ + OFCondition l_error = getOFString(dicomDateTime, pos); + if (l_error.good()) + l_error = getOFDateTimeFromString(dicomDateTime, dateTimeValue); + else + dateTimeValue.clear(); + return l_error; +} + + +OFCondition DcmDateTime::getISOFormattedDateTime(OFString &formattedDateTime, + const unsigned long pos, + const OFBool seconds, + const OFBool fraction, + const OFBool timeZone, + const OFBool createMissingPart, + const OFString &dateTimeSeparator, + const OFString &timeZoneSeparator) +{ + OFString dicomDateTime; + /* get current element value and convert to ISO formatted date/time */ + OFCondition l_error = getOFString(dicomDateTime, pos); + if (l_error.good()) + { + l_error = getISOFormattedDateTimeFromString(dicomDateTime, formattedDateTime, seconds, fraction, + timeZone, createMissingPart, dateTimeSeparator, timeZoneSeparator); + } else + formattedDateTime.clear(); + return l_error; +} + + +OFCondition DcmDateTime::setCurrentDateTime(const OFBool seconds, + const OFBool fraction, + const OFBool timeZone) +{ + OFString dicomDateTime; + OFCondition l_error = getCurrentDateTime(dicomDateTime, seconds, fraction, timeZone); + if (l_error.good()) + l_error = putOFStringArray(dicomDateTime); + return l_error; +} + + +OFCondition DcmDateTime::setOFDateTime(const OFDateTime &dateTimeValue) +{ + OFString dicomDateTime; + /* convert OFDateTime value to DICOM DT format and set the element value */ + OFCondition l_error = getDicomDateTimeFromOFDateTime(dateTimeValue, dicomDateTime); + if (l_error.good()) + l_error = putOFStringArray(dicomDateTime); + return l_error; +} + + +// ******************************** + + +OFCondition DcmDateTime::getCurrentDateTime(OFString &dicomDateTime, + const OFBool seconds, + const OFBool fraction, + const OFBool timeZone) +{ + OFCondition l_error = EC_IllegalCall; + OFDateTime dateTimeValue; + /* get the current system time */ + if (dateTimeValue.setCurrentDateTime()) + { + /* format: YYYYMMDDHHMM[SS[.FFFFFF]] */ + if (dateTimeValue.getISOFormattedDateTime(dicomDateTime, seconds, fraction, timeZone, OFFalse /*showDelimiter*/)) + l_error = EC_Normal; + } + /* set default date/time if an error occurred */ + if (l_error.bad()) + { + /* format: YYYYMMDDHHMM */ + dicomDateTime = "190001010000"; + if (seconds) + { + /* format: SS */ + dicomDateTime += "00"; + if (fraction) + { + /* format: .FFFFFF */ + dicomDateTime += ".000000"; + } + } + if (timeZone) + { + /* format: CHHMM */ + dicomDateTime += "+0000"; + } + } + return l_error; +} + + +OFCondition DcmDateTime::getDicomDateTimeFromOFDateTime(const OFDateTime &dateTimeValue, + OFString &dicomDateTime, + const OFBool seconds, + const OFBool fraction, + const OFBool timeZone) +{ + OFCondition l_error = EC_IllegalParameter; + /* convert OFDateTime value to DICOM DT format */ + if (dateTimeValue.getISOFormattedDateTime(dicomDateTime, seconds, fraction, timeZone, OFFalse /*showDelimiter*/)) + l_error = EC_Normal; + return l_error; +} + +OFCondition DcmDateTime::getOFDateTimeFromString(const OFString &dicomDateTime, + OFDateTime &dateTimeValue) +{ + return getOFDateTimeFromString(dicomDateTime.c_str(), dicomDateTime.size(), dateTimeValue); +} + +OFCondition DcmDateTime::getOFDateTimeFromString(const char *dicomDateTime, + size_t dicomDateTimeSize, + OFDateTime &dateTimeValue) +{ + // clear result variable + dateTimeValue.clear(); + /* minimal check for valid format: YYYY */ + if (dicomDateTimeSize < 4 || !OFStandard::checkDigits<4>(dicomDateTime)) + return EC_IllegalParameter; + unsigned int month = 1; + unsigned int day = 1; + double timeZone; + // check for/extract time zone + if (dicomDateTimeSize >= 9 && DcmTime::getTimeZoneFromString(dicomDateTime + dicomDateTimeSize - 5, 5, timeZone).good()) + dicomDateTimeSize -= 5; + else + timeZone = OFTime::getLocalTimeZone(); + switch(dicomDateTimeSize) + { + default: + // check whether a time value is contained or it is simply an error + if (dicomDateTimeSize >= 10) + { + OFCondition status = DcmTime::getOFTimeFromString(dicomDateTime + 8, + dicomDateTimeSize - 8, + dateTimeValue.Time, + OFFalse, // no support for HH:MM:SS in VR=DT + timeZone); + if (status.bad()) + return status; + } + else break; + + case 8: + if (OFStandard::checkDigits<2>(dicomDateTime + 6)) + day = OFStandard::extractDigits(dicomDateTime + 6); + else + break; + case 6: + if (OFStandard::checkDigits<2>(dicomDateTime + 4)) + month = OFStandard::extractDigits(dicomDateTime + 4); + else + break; + case 4: + if (dateTimeValue.Date.setDate(OFStandard::extractDigits(dicomDateTime), month, day)) + { + // set timezone if it hasn't been set + if (dicomDateTimeSize <= 8) + dateTimeValue.Time.setTimeZone(timeZone); + return EC_Normal; + } + break; + } + return EC_IllegalParameter; +} + + +OFCondition DcmDateTime::getISOFormattedDateTimeFromString(const OFString &dicomDateTime, + OFString &formattedDateTime, + const OFBool seconds, + const OFBool fraction, + const OFBool timeZone, + const OFBool createMissingPart, + const OFString &dateTimeSeparator, + const OFString &timeZoneSeparator) +{ + OFCondition l_error = EC_Normal; + const size_t length = dicomDateTime.length(); + /* minimum DT format: YYYYMMDD */ + if (length >= 8) + { + OFString timeString; + OFDate dateValue; + /* get formatted date: YYYY-MM-DD */ + l_error = DcmDate::getOFDateFromString(dicomDateTime.substr(0, 8), dateValue, OFFalse /*supportOldFormat*/); + if (l_error.good()) + { + dateValue.getISOFormattedDate(formattedDateTime); + /* get formatted time: [HH[:MM[:SS[.FFFFFF]]]] */ + const size_t posSign = dicomDateTime.find_first_of("+-", 8); + OFString dicomTime = (posSign != OFString_npos) ? dicomDateTime.substr(8, posSign - 8) : dicomDateTime.substr(8); + l_error = DcmTime::getISOFormattedTimeFromString(dicomTime, timeString, seconds, fraction, createMissingPart, OFFalse /*supportOldFormat*/); + if (l_error.good() && !timeString.empty()) + { + /* add time string with separator */ + formattedDateTime += dateTimeSeparator; + formattedDateTime += timeString; + /* add optional time zone: [+/-HH:MM] */ + if (timeZone) + { + /* check whether optional time zone is present: &ZZZZ */ + if ((posSign != OFString_npos) && (length >= posSign + 5)) + { + formattedDateTime += timeZoneSeparator; + formattedDateTime += dicomDateTime[posSign]; + formattedDateTime += dicomDateTime.substr(posSign + 1, 2); + formattedDateTime += ":"; + formattedDateTime += dicomDateTime.substr(posSign + 3, 2); + } + else if (createMissingPart) + { + formattedDateTime += timeZoneSeparator; + formattedDateTime += "+00:00"; + } + } + } + } + } + else if (length == 0) + { + /* an empty input string is no error ... */ + formattedDateTime.clear(); + } else { + /* ... but all other formats are (if not handled before) */ + l_error = EC_IllegalParameter; + } + /* clear result variable in case of error */ + if (l_error.bad()) + formattedDateTime.clear(); + return l_error; +} + + +// ******************************** + + +OFBool DcmDateTime::check(const char* dicomDateTime, + const size_t dicomDateTimeSize) +{ + const int vrID = DcmElement::scanValue("dt", dicomDateTime, dicomDateTimeSize); + return vrID == 7 /* DT */ || vrID == 18 /* dubious DT (pre 1850 or post 2049) */; +} + +OFCondition DcmDateTime::checkStringValue(const OFString &value, + const OFString &vm) +{ + OFCondition result = EC_Normal; + const size_t valLen = value.length(); + if (valLen > 0) + { + size_t posStart = 0; + unsigned long vmNum = 0; + /* iterate over all value components */ + while (posStart != OFString_npos) + { + ++vmNum; + /* search for next component separator */ + const size_t posEnd = value.find('\\', posStart); + const size_t length = (posEnd == OFString_npos) ? valLen - posStart : posEnd - posStart; + /* check length of current value component */ + if (length > MAX_DT_LENGTH) + { + result = EC_MaximumLengthViolated; + break; + } + else if (dcmEnableVRCheckerForStringValues.get()) + { + /* check value representation */ + if (!check(value.data() + posStart, length)) + { + result = EC_ValueRepresentationViolated; + break; + } + } + posStart = (posEnd == OFString_npos) ? posEnd : posEnd + 1; + } + if (result.good() && !vm.empty()) + { + /* check value multiplicity */ + result = DcmElement::checkVM(vmNum, vm); + } + } + return result; +} + + +OFBool DcmDateTime::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + return DcmAttributeMatching::rangeMatchingDateTime(key.c_str(), key.length(), candidate.c_str(), candidate.length()); +} diff --git a/dcmdata/libsrc/dcvrfd.cc b/dcmdata/libsrc/dcvrfd.cc new file mode 100644 index 00000000..acf6758c --- /dev/null +++ b/dcmdata/libsrc/dcvrfd.cc @@ -0,0 +1,397 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmFloatingPointDouble + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcvrfd.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + +DcmFloatingPointDouble::DcmFloatingPointDouble(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmFloatingPointDouble::DcmFloatingPointDouble(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmFloatingPointDouble::DcmFloatingPointDouble(const DcmFloatingPointDouble &old) + : DcmElement(old) +{ +} + + +DcmFloatingPointDouble::~DcmFloatingPointDouble() +{ +} + + +DcmFloatingPointDouble &DcmFloatingPointDouble::operator=(const DcmFloatingPointDouble &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmFloatingPointDouble::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmFloatingPointDouble* myThis = NULL; + DcmFloatingPointDouble* myRhs = NULL; + myThis = OFconst_cast(DcmFloatingPointDouble*, this); + myRhs = OFstatic_cast(DcmFloatingPointDouble*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + Float64 val = 0; + if (myThis->getFloat64(val, count).good()) + { + Float64 rhsVal = 0; + if (myRhs->getFloat64(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmFloatingPointDouble::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmFloatingPointDouble &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmFloatingPointDouble::ident() const +{ + return EVR_FD; +} + + +OFCondition DcmFloatingPointDouble::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only, further checks on the floating point values could be added later */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmFloatingPointDouble::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmFloatingPointDouble::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Float64)); +} + + +// ******************************** + + +void DcmFloatingPointDouble::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get double data */ + Float64 *doubleVals; + errorFlag = getFloat64Array(doubleVals); + if (doubleVals != NULL) + { + /* do not use getVM() because derived classes might always return 1 */ + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[64]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, doubleVals++) + { + /* check whether first value is printed (omit delimiter) */ + if (i == 0) + OFStandard::ftoa(buffer, sizeof(buffer), *doubleVals, 0, 0, 17 /* DBL_DIG + 2 for DICOM FD */); + else + { + buffer[0] = '\\'; + OFStandard::ftoa(buffer + 1, sizeof(buffer) - 1, *doubleVals, 0, 0, 17 /* DBL_DIG + 2 for DICOM FD */); + } + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than eight bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)" ); + } else + printInfoLine(out, flags, level, "(not loaded)" ); +} + + +// ******************************** + + +OFCondition DcmFloatingPointDouble::getFloat64(Float64 &doubleVal, + const unsigned long pos) +{ + /* get double data */ + Float64 *doubleValues = NULL; + errorFlag = getFloat64Array(doubleValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (doubleValues == NULL) + errorFlag = EC_IllegalCall; + /* do not use getVM() because derived classes might always return 1 */ + else if (pos >= getNumberOfValues()) + errorFlag = EC_IllegalParameter; + else + doubleVal = doubleValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + doubleVal = 0; + return errorFlag; +} + + +OFCondition DcmFloatingPointDouble::getFloat64Array(Float64 *&doubleVals) +{ + doubleVals = OFstatic_cast(Float64 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointDouble::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + Float64 doubleVal; + /* get the specified numeric value */ + errorFlag = getFloat64(doubleVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[64]; + OFStandard::ftoa(buffer, sizeof(buffer), doubleVal, 0, 0, 17 /* DBL_DIG + 2 for DICOM FD */); + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointDouble::putFloat64(const Float64 doubleVal, + const unsigned long pos) +{ + Float64 val = doubleVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Float64) * pos), OFstatic_cast(Uint32, sizeof(Float64))); + return errorFlag; +} + + +OFCondition DcmFloatingPointDouble::putFloat64Array(const Float64 *doubleVals, + const unsigned long numDoubles) +{ + errorFlag = EC_Normal; + if (numDoubles > 0) + { + /* check for valid data */ + if (doubleVals != NULL) + errorFlag = putValue(doubleVals, OFstatic_cast(Uint32, sizeof(Float64) * OFstatic_cast(size_t, numDoubles))); + else + errorFlag = EC_CorruptedData; + } else + putValue(NULL, 0); + + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointDouble::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmFloatingPointDouble::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Float64 *field = new Float64[vm]; + OFBool success = OFFalse; + OFString value; + size_t pos = 0; + /* retrieve double data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (!value.empty()) + { + field[i] = OFStandard::atof(value.c_str(), &success); + if (!success) + errorFlag = EC_CorruptedData; + } else + errorFlag = EC_CorruptedData; + } + /* set binary data as the element value */ + if (errorFlag == EC_Normal) + errorFlag = putFloat64Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointDouble::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Float64)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Float64)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} + + +OFBool DcmFloatingPointDouble::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + if (ident() == candidate.ident()) + { + // some const casts to call the getter functions, I do not modify the values, I promise! + DcmFloatingPointDouble& key = OFconst_cast(DcmFloatingPointDouble&,*this); + DcmElement& can = OFconst_cast(DcmElement&,candidate); + Float64 a, b; + for( unsigned long ui = 0; ui < key.getVM(); ++ui ) + for( unsigned long uj = 0; uj < can.getVM(); ++uj ) + if( key.getFloat64( a, ui ).good() && can.getFloat64( b, uj ).good() && a == b ) + return OFTrue; + return key.getVM() == 0; + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcvrfl.cc b/dcmdata/libsrc/dcvrfl.cc new file mode 100644 index 00000000..c8673e69 --- /dev/null +++ b/dcmdata/libsrc/dcvrfl.cc @@ -0,0 +1,399 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmFloatingPointSingle + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcvrfl.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmFloatingPointSingle::DcmFloatingPointSingle(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmFloatingPointSingle::DcmFloatingPointSingle(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmFloatingPointSingle::DcmFloatingPointSingle(const DcmFloatingPointSingle &old) + : DcmElement(old) +{ +} + + +DcmFloatingPointSingle::~DcmFloatingPointSingle() +{ +} + + +DcmFloatingPointSingle &DcmFloatingPointSingle::operator=(const DcmFloatingPointSingle &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmFloatingPointSingle::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmFloatingPointSingle* myThis = NULL; + DcmFloatingPointSingle* myRhs = NULL; + myThis = OFconst_cast(DcmFloatingPointSingle*, this); + myRhs = OFstatic_cast(DcmFloatingPointSingle*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + // iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + Float32 val = 0; + if (myThis->getFloat32(val, count).good()) + { + Float32 rhsVal = 0; + if (myRhs->getFloat32(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + + +OFCondition DcmFloatingPointSingle::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmFloatingPointSingle &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmFloatingPointSingle::ident() const +{ + return EVR_FL; +} + + +OFCondition DcmFloatingPointSingle::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only, further checks on the floating point values could be added later */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmFloatingPointSingle::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmFloatingPointSingle::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Float32)); +} + + +// ******************************** + + +void DcmFloatingPointSingle::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get float data */ + Float32 *floatVals; + errorFlag = getFloat32Array(floatVals); + if (floatVals != NULL) + { + /* do not use getVM() because derived classes might always return 1 */ + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[64]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, floatVals++) + { + /* check whether first value is printed (omit delimiter) */ + if (i == 0) + OFStandard::ftoa(buffer, sizeof(buffer), *floatVals, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */); + else + { + buffer[0] = '\\'; + OFStandard::ftoa(buffer + 1, sizeof(buffer) - 1, *floatVals, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */); + } + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than four bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)" ); + } else + printInfoLine(out, flags, level, "(not loaded)" ); +} + + +// ******************************** + + +OFCondition DcmFloatingPointSingle::getFloat32(Float32 &floatVal, + const unsigned long pos) +{ + /* get float data */ + Float32 *floatValues = NULL; + errorFlag = getFloat32Array(floatValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (floatValues == NULL) + errorFlag = EC_IllegalCall; + /* do not use getVM() because derived classes might always return 1 */ + else if (pos >= getNumberOfValues()) + errorFlag = EC_IllegalParameter; + else + floatVal = floatValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + floatVal = 0; + return errorFlag; +} + + +OFCondition DcmFloatingPointSingle::getFloat32Array(Float32 *&floatVals) +{ + floatVals = OFstatic_cast(Float32 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointSingle::getOFString(OFString &value, + const unsigned long pos, + OFBool /*normalize*/) +{ + Float32 floatVal; + /* get the specified numeric value */ + errorFlag = getFloat32(floatVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[64]; + OFStandard::ftoa(buffer, sizeof(buffer), floatVal, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */); + /* assign result */ + value = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointSingle::putFloat32(const Float32 floatVal, + const unsigned long pos) +{ + Float32 val = floatVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Float32) * pos), OFstatic_cast(Uint32, sizeof(Float32))); + return errorFlag; +} + + +OFCondition DcmFloatingPointSingle::putFloat32Array(const Float32 *floatVals, + const unsigned long numFloats) +{ + errorFlag = EC_Normal; + if (numFloats > 0) + { + /* check for valid float data */ + if (floatVals != NULL) + errorFlag = putValue(floatVals, OFstatic_cast(Uint32, sizeof(Float32) * OFstatic_cast(size_t, numFloats))); + else + errorFlag = EC_CorruptedData; + } else + putValue(NULL, 0); + + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointSingle::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmFloatingPointSingle::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Float32 *field = new Float32[vm]; + OFBool success = OFFalse; + OFString value; + size_t pos = 0; + /* retrieve float data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (!value.empty()) + { + field[i] = OFstatic_cast(Float32, OFStandard::atof(value.c_str(), &success)); + if (!success) + errorFlag = EC_CorruptedData; + } else + errorFlag = EC_CorruptedData; + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putFloat32Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmFloatingPointSingle::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Float32)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Float32)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} + + +OFBool DcmFloatingPointSingle::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + if (ident() == candidate.ident()) + { + // some const casts to call the getter functions, I do not modify the values, I promise! + DcmFloatingPointSingle& key = OFconst_cast(DcmFloatingPointSingle&,*this); + DcmElement& can = OFconst_cast(DcmElement&,candidate); + Float32 a, b; + for( unsigned long ui = 0; ui < key.getVM(); ++ui ) + for( unsigned long uj = 0; uj < can.getVM(); ++uj ) + if( key.getFloat32( a, ui ).good() && can.getFloat32( b, uj ).good() && a == b ) + return OFTrue; + return key.getVM() == 0; + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcvris.cc b/dcmdata/libsrc/dcvris.cc new file mode 100644 index 00000000..876bbe3d --- /dev/null +++ b/dcmdata/libsrc/dcvris.cc @@ -0,0 +1,198 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmIntegerString + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/ofstd/ofstring.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +#define MAX_IS_LENGTH 12 + + +// ******************************** + + +DcmIntegerString::DcmIntegerString(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(MAX_IS_LENGTH); + setNonSignificantChars(" \\"); +} + + +DcmIntegerString::DcmIntegerString(const DcmIntegerString &old) + : DcmByteString(old) +{ +} + + +DcmIntegerString::~DcmIntegerString() +{ +} + + +DcmIntegerString &DcmIntegerString::operator=(const DcmIntegerString &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmIntegerString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmIntegerString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmIntegerString::ident() const +{ + return EVR_IS; +} + + +OFCondition DcmIntegerString::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmIntegerString::checkStringValue(strVal, vm); + return l_error; +} + + +// ******************************** + + +OFCondition DcmIntegerString::getSint32(Sint32 &sintVal, + const unsigned long pos) +{ + /* get integer string value */ + OFString str; + OFCondition l_error = getOFString(str, pos, OFTrue); + if (l_error.good()) + { + /* convert string to integer value */ +#ifdef SCNd32 + if (sscanf(str.c_str(), "%" SCNd32, &sintVal) != 1) +#elif SIZEOF_LONG == 8 + if (sscanf(str.c_str(), "%d", &sintVal) != 1) +#else + if (sscanf(str.c_str(), "%ld", &sintVal) != 1) +#endif + l_error = EC_CorruptedData; + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmIntegerString::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + /* call inherited method */ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos, normalize); + /* normalize string if required */ + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmIntegerString::checkStringValue(const OFString &value, + const OFString &vm) +{ + return DcmByteString::checkStringValue(value, vm, "is", 8, MAX_IS_LENGTH); +} + + +// ******************************** + + +OFCondition DcmIntegerString::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + writeJsonOpener(out, format); + /* write element value (if loaded) */ + if (valueLoaded()) + { + OFString bulkDataValue; + if (format.asBulkDataURI(getTag(), bulkDataValue)) + { + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, bulkDataValue); + } + else + { + /* get string data (without normalization) */ + char *value_ = NULL; + Uint32 length = 0; + getString(value_, length); + if ((value_ != NULL) && (length > 0)) + { + /* explicitly convert to OFString because of possible NULL bytes */ + OFString value(value_, length); + OFCondition status = getOFString(value, 0L); + if (status.bad()) + return status; + format.printValuePrefix(out); + DcmJsonFormat::printNumberInteger(out, value); + const unsigned long vm = getVM(); + for (unsigned long valNo = 1; valNo < vm; ++valNo) + { + status = getOFString(value, valNo); + if (status.bad()) + return status; + format.printNextArrayElementPrefix(out); + DcmJsonFormat::printNumberInteger(out, value); + } + format.printValueSuffix(out); + } + } + } + /* write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} diff --git a/dcmdata/libsrc/dcvrlo.cc b/dcmdata/libsrc/dcvrlo.cc new file mode 100644 index 00000000..2840cdbd --- /dev/null +++ b/dcmdata/libsrc/dcvrlo.cc @@ -0,0 +1,163 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation class DcmLongString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcvrlo.h" + + +// ******************************** + + +DcmLongString::DcmLongString(const DcmTag &tag, + const Uint32 len) + : DcmCharString(tag, len) +{ + setMaxLength(64); + setNonSignificantChars(" \\"); +} + + +DcmLongString::DcmLongString(const DcmLongString &old) + : DcmCharString(old) +{ +} + + +DcmLongString::~DcmLongString() +{ +} + + +DcmLongString &DcmLongString::operator=(const DcmLongString &obj) +{ + DcmCharString::operator=(obj); + return *this; +} + + +OFCondition DcmLongString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmLongString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmLongString::ident() const +{ + return EVR_LO; +} + + +OFCondition DcmLongString::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + { + OFString charset; + /* try to determine the value of the SpecificCharacterSet element */ + if (getSpecificCharacterSet(charset) == EC_CorruptedData) + charset = "UNKNOWN"; + l_error = DcmLongString::checkStringValue(strVal, vm, charset); + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmLongString::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmCharString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmLongString::checkStringValue(const OFString &value, + const OFString &vm, + const OFString &charset) +{ + return DcmByteString::checkStringValue(value, vm, "lo", 12, 0 /* maxLen: no check */, charset); +} + + +// ******************************** + + +OFCondition DcmLongString::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + DcmElement::writeJsonOpener(out, format); + /* write element value (if non-empty) */ + if (!isEmpty()) + { + OFString value; + OFCondition status = getOFString(value, 0L); + if (status.bad()) + return status; + format.printValuePrefix(out); + DcmJsonFormat::printValueString(out, value); + const unsigned long vm = getVM(); + for (unsigned long valNo = 1; valNo < vm; ++valNo) + { + status = getOFString(value, valNo); + if (status.bad()) + return status; + format.printNextArrayElementPrefix(out); + DcmJsonFormat::printValueString(out, value); + } + format.printValueSuffix(out); + } + /* write JSON Closer */ + DcmElement::writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +const OFString& DcmLongString::getDelimiterChars() const +{ + return DcmVR(EVR_LO).getDelimiterChars(); +} diff --git a/dcmdata/libsrc/dcvrlt.cc b/dcmdata/libsrc/dcvrlt.cc new file mode 100644 index 00000000..6ce7996b --- /dev/null +++ b/dcmdata/libsrc/dcvrlt.cc @@ -0,0 +1,166 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmLongText + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrlt.h" + + +// ******************************** + + +DcmLongText::DcmLongText(const DcmTag &tag, + const Uint32 len) + : DcmCharString(tag, len) +{ + setMaxLength(10240); +} + + +DcmLongText::DcmLongText(const DcmLongText& old) + : DcmCharString(old) +{ +} + + +DcmLongText::~DcmLongText() +{ +} + + +DcmLongText &DcmLongText::operator=(const DcmLongText &obj) +{ + DcmCharString::operator=(obj); + return *this; +} + + +OFCondition DcmLongText::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmLongText &, rhs); + } + return EC_Normal; +} + + +int DcmLongText::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmLongText* myThis = NULL; + DcmLongText* myRhs = NULL; + myThis = OFconst_cast(DcmLongText*, this); + myRhs = OFstatic_cast(DcmLongText*, OFconst_cast(DcmElement*, &rhs)); + + /* compare length */ + unsigned long thisLength = myThis->getLength(); + unsigned long rhsLength = myRhs->getLength(); + if (thisLength < rhsLength) + { + return -1; + } + else if (thisLength > rhsLength) + { + return 1; + } + + /* check whether values are equal */ + OFString thisValue, rhsValue; + myThis->getOFStringArray(thisValue); + myThis->getOFStringArray(rhsValue); + return thisValue.compare(rhsValue); +} + + +// ******************************** + + +DcmEVR DcmLongText::ident() const +{ + return EVR_LT; +} + + +OFCondition DcmLongText::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + { + OFString charset; + /* try to determine the value of the SpecificCharacterSet element */ + if (getSpecificCharacterSet(charset) == EC_CorruptedData) + charset = "UNKNOWN"; + l_error = DcmLongText::checkStringValue(strVal, charset); + } + return l_error; +} + + +unsigned long DcmLongText::getVM() +{ + /* value multiplicity is 1 for non-empty string, 0 otherwise */ + return (getRealLength() > 0) ? 1 : 0; +} + + +// ******************************** + + +OFCondition DcmLongText::getOFString(OFString &stringVal, + const unsigned long /*pos*/, + OFBool normalize) +{ + /* treat backslash as a normal character */ + return getOFStringArray(stringVal, normalize); +} + + +OFCondition DcmLongText::getOFStringArray(OFString &stringVal, + OFBool normalize) +{ + /* get string value without handling the "\" as a delimiter */ + OFCondition l_error = getStringValue(stringVal); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmLongText::checkStringValue(const OFString &value, + const OFString &charset) +{ + return DcmByteString::checkStringValue(value, "" /* vm */, "lt", 14, 0 /* maxLen: no check */, charset); +} diff --git a/dcmdata/libsrc/dcvrobow.cc b/dcmdata/libsrc/dcvrobow.cc new file mode 100644 index 00000000..6ad14ae4 --- /dev/null +++ b/dcmdata/libsrc/dcvrobow.cc @@ -0,0 +1,881 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmOtherByteOtherWord + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofuuid.h" +#include "dcmtk/ofstd/offile.h" + +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcuid.h" /* for UID generation */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmOtherByteOtherWord::DcmOtherByteOtherWord(const DcmTag &tag) +: DcmElement(tag, 0) +, compactAfterTransfer(OFFalse) +{ +} + + +DcmOtherByteOtherWord::DcmOtherByteOtherWord(const DcmTag &tag, + const Uint32 len) +: DcmElement(tag, len) +, compactAfterTransfer(OFFalse) +{ +} + + +DcmOtherByteOtherWord::DcmOtherByteOtherWord(const DcmOtherByteOtherWord &old) +: DcmElement(old) +, compactAfterTransfer(old.compactAfterTransfer) +{ +} + + +DcmOtherByteOtherWord::~DcmOtherByteOtherWord() +{ +} + + +DcmOtherByteOtherWord &DcmOtherByteOtherWord::operator=(const DcmOtherByteOtherWord &obj) +{ + DcmElement::operator=(obj); + compactAfterTransfer = obj.compactAfterTransfer; + return *this; +} + + +int DcmOtherByteOtherWord::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmOtherByteOtherWord* myThis = NULL; + DcmOtherByteOtherWord* myRhs = NULL; + myThis = OFconst_cast(DcmOtherByteOtherWord*, this); + myRhs = OFstatic_cast(DcmOtherByteOtherWord*, OFconst_cast(DcmElement*, &rhs)); + + /* compare length */ + unsigned long thisLength = myThis->getLength(); + unsigned long rhsLength= myRhs->getLength(); + if (thisLength < rhsLength) + { + return -1; + } + else if (thisLength > rhsLength) + { + return 1; + } + /* finally, check equality of values. getValue() makes sure byte + * swapping is applied as necessary. */ + void* thisData = myThis->getValue(); + void* rhsData = myRhs->getValue(); + return memcmp(thisData, rhsData, thisLength); +} + + +OFCondition DcmOtherByteOtherWord::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmOtherByteOtherWord &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmOtherByteOtherWord::ident() const +{ + return getTag().getEVR(); +} + + +OFCondition DcmOtherByteOtherWord::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + /* currently no checks are performed */ + return EC_Normal; +} + + +unsigned long DcmOtherByteOtherWord::getVM() +{ + /* value multiplicity for OB/OW is defined as 1 */ + return 1; +} + + +unsigned long DcmOtherByteOtherWord::getNumberOfValues() +{ + const DcmEVR evr = getTag().getEVR(); + unsigned long result = OFstatic_cast(unsigned long, getLengthField()); + /* check whether values are stored as 16 bit */ + if ((evr == EVR_OW) || (evr == EVR_lt)) + result /= 2; + return result; +} + + +OFCondition DcmOtherByteOtherWord::setVR(DcmEVR vr) +{ + setTagVR(vr); + return EC_Normal; +} + + +// ******************************** + + +void DcmOtherByteOtherWord::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + const DcmEVR evr = getTag().getEVR(); + Uint16 *wordValues = NULL; + Uint8 *byteValues = NULL; + /* get 8 or 16 bit data respectively */ + if (evr == EVR_OW || evr == EVR_lt) + errorFlag = getUint16Array(wordValues); + else + errorFlag = getUint8Array(byteValues); + /* check data */ + if ((wordValues != NULL) || (byteValues != NULL)) + { + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + /* determine number of values to be printed */ + const unsigned int vrSize = (evr == EVR_OW || evr == EVR_lt) ? 4 : 2; + unsigned long expectedLength = count * (vrSize + 1) - 1; + const unsigned long printCount = + ((expectedLength > DCM_OptPrintLineLength) && (flags & DCMTypes::PF_shortenLongTagValues)) ? + (DCM_OptPrintLineLength - 3 /* for "..." */ + 1 /* for last "\" */) / (vrSize + 1) : count; + unsigned long printedLength = printCount * (vrSize + 1) - 1; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + if (printCount > 0) + { + out << STD_NAMESPACE hex << STD_NAMESPACE setfill('0'); + if (evr == EVR_OW || evr == EVR_lt) + { + /* print word values in hex mode */ + out << STD_NAMESPACE setw(vrSize) << (*(wordValues++)); + for (unsigned long i = 1; i < printCount; i++) + out << "\\" << STD_NAMESPACE setw(vrSize) << (*(wordValues++)); + } else { + /* print byte values in hex mode */ + out << STD_NAMESPACE setw(vrSize) << OFstatic_cast(int, *(byteValues++)); + for (unsigned long i = 1; i < printCount; i++) + out << "\\" << STD_NAMESPACE setw(vrSize) << OFstatic_cast(int, *(byteValues++)); + } + /* reset i/o manipulators */ + out << STD_NAMESPACE dec << STD_NAMESPACE setfill(' '); + } + /* print trailing "..." if data has been truncated */ + if (printCount < count) + { + out << "..."; + printedLength += 3; + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid OW element with less than two bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +void DcmOtherByteOtherWord::printPixel(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char *pixelFileName, + size_t *pixelCounter) +{ + if (pixelFileName != NULL) + { + /* create filename for pixel data file */ + OFString fname = pixelFileName; + fname += "."; + if (pixelCounter != NULL) + { + char num[20]; + sprintf(num, "%ld", OFstatic_cast(long, (*pixelCounter)++)); + fname += num; + } + fname += ".raw"; + /* create reference to pixel data file in dump output */ + OFString str = "="; + str += fname; + printInfoLine(out, flags, level, str.c_str(), NULL /*tag*/, OFFalse /*isInfo*/); + /* check whether pixel data file already exists */ + if (!OFStandard::fileExists(fname)) + { + /* create binary file for pixel data */ + FILE *file = fopen(fname.c_str(), "wb"); + if (file != NULL) + { + if (getTag().getEVR() == EVR_OW || getTag().getEVR() == EVR_lt) + { + /* write 16 bit data in little endian byte-order */ + Uint16 *data = NULL; + getUint16Array(data); + if (data != NULL) + { + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, data, getLengthField(), sizeof(Uint16)); + setByteOrder(EBO_LittleEndian); + const size_t tobewritten = OFstatic_cast(size_t, getLengthField() / sizeof(Uint16)); + const size_t written = fwrite(data, sizeof(Uint16), tobewritten, file); + if (written != tobewritten) + DCMDATA_WARN("DcmOtherByteOtherWord: Some bytes were not written: " << (tobewritten - written)); + } + } else { + Uint8 *data = NULL; + getUint8Array(data); + if (data != NULL) + { + const size_t tobewritten = OFstatic_cast(size_t, getLengthField()); + const size_t written = fwrite(data, sizeof(Uint8), tobewritten, file); + if (written != tobewritten) + DCMDATA_WARN("DcmOtherByteOtherWord: Some bytes were not written: " << (tobewritten - written)); + } + } + fclose(file); + } else { + DCMDATA_WARN("DcmOtherByteOtherWord: Can't open output file for pixel data: " << fname); + } + } else { + DCMDATA_WARN("DcmOtherByteOtherWord: Output file for pixel data already exists, skipping: " << fname); + } + } else + DcmOtherByteOtherWord::print(out, flags, level, pixelFileName, pixelCounter); +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::alignValue() +{ + errorFlag = EC_Normal; + if ((getTag().getEVR() != EVR_OW && getTag().getEVR() != EVR_lt) && (getLengthField() > 0) && ((getLengthField() & 1) != 0)) + { + // We have an odd number of bytes. This should never happen and is certainly not allowed in DICOM. + // To fix this problem, we will add a zero pad byte at the end of the value field. + // This requires us to load the value field into memory, which may very well be a problem + // if this is part of a very large multi-frame object. + Uint8 *bytes = OFstatic_cast(Uint8 *, getValue(getByteOrder())); + + // getValue() could call loadValue() which then calls postLoadValue() + // which in turn calls this function again. Thus, we have to make sure + // that the length field is still odd after getValue() returns. + if (bytes && (getLengthField() & 1) != 0) + { + // newValueField always allocates an even number of bytes + // and sets the pad byte to zero, so we can safely increase Length here + setLengthField(getLengthField() + 1); + } + } + return errorFlag; +} + + +void DcmOtherByteOtherWord::postLoadValue() +{ + if (dcmEnableAutomaticInputDataCorrection.get()) + alignValue(); +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::putUint8Array(const Uint8 *byteValue, + const unsigned long numBytes) +{ + errorFlag = EC_Normal; + if (numBytes > 0) + { + /* check for valid 8 bit data */ + if ((byteValue != NULL) && (getTag().getEVR() != EVR_OW && getTag().getEVR() != EVR_lt)) + { + errorFlag = putValue(byteValue, OFstatic_cast(Uint32, sizeof(Uint8) * OFstatic_cast(size_t, numBytes))); + alignValue(); + } else + errorFlag = EC_CorruptedData; + } else + putValue(NULL, 0); + return errorFlag; +} + + +OFCondition DcmOtherByteOtherWord::putUint16Array(const Uint16 *wordValue, + const unsigned long numWords) +{ + errorFlag = EC_Normal; + if (numWords > 0) + { + /* check for valid 16 bit data */ + if ((wordValue != NULL) && (getTag().getEVR() == EVR_OW || getTag().getEVR() == EVR_lt)) + errorFlag = putValue(wordValue, OFstatic_cast(Uint32, sizeof(Uint16) * OFstatic_cast(size_t, numWords))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::createUint8Array(const Uint32 numBytes, + Uint8 *&bytes) +{ + /* check value representation */ + if ((getTag().getEVR() != EVR_OW) && (getTag().getEVR() != EVR_lt)) + errorFlag = createEmptyValue(OFstatic_cast(Uint32, sizeof(Uint8) * OFstatic_cast(size_t, numBytes))); + else + errorFlag = EC_CorruptedData; + if (errorFlag.good()) + bytes = OFstatic_cast(Uint8 *, this->getValue()); + else + bytes = NULL; + return errorFlag; +} + + +OFCondition DcmOtherByteOtherWord::createUint16Array(const Uint32 numWords, + Uint16 *&words) +{ + /* check value representation */ + if ((getTag().getEVR() == EVR_OW) || (getTag().getEVR() == EVR_lt)) + { + Uint32 bytesRequired = 0; + OFBool size_fits = OFStandard::safeMult(numWords, OFstatic_cast(Uint32, sizeof(Uint16)), bytesRequired); + if (size_fits) + errorFlag = createEmptyValue(bytesRequired); + else + errorFlag = EC_CorruptedData; + } + else + errorFlag = EC_CorruptedData; + if (errorFlag.good()) + words = OFstatic_cast(Uint16 *, this->getValue()); + else + words = NULL; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmOtherByteOtherWord::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + const DcmEVR evr = getTag().getEVR(); + Uint8 *byteField = NULL; + Uint16 *wordField = NULL; + /* create new value field */ + if (evr == EVR_OW || evr == EVR_lt) + wordField = new Uint16[vm]; + else + byteField = new Uint8[vm]; + Uint16 intVal = 0; + OFString value; + size_t pos = 0; + /* retrieve binary data from hexa-decimal string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (!value.empty()) + { + /* integer overflow is currently not checked! */ + if (sscanf(value.c_str(), "%hx", &intVal) != 1) + errorFlag = EC_CorruptedData; + else if (evr == EVR_OW || evr == EVR_lt) + wordField[i] = OFstatic_cast(Uint16, intVal); + else + byteField[i] = OFstatic_cast(Uint8, intVal); + } else + errorFlag = EC_CorruptedData; + } + /* set binary data as the element value */ + if (errorFlag.good()) + { + if (evr == EVR_OW || evr == EVR_lt) + errorFlag = putUint16Array(wordField, vm); + else + errorFlag = putUint8Array(byteField, vm); + } + /* delete temporary buffers */ + delete[] byteField; + delete[] wordField; + } else + putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::getUint8(Uint8 &byteVal, + const unsigned long pos) +{ + /* get 8 bit data */ + Uint8 *uintValues = NULL; + errorFlag = getUint8Array(uintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (uintValues == NULL) + errorFlag = EC_IllegalCall; + else if (pos >= getLength() /*bytes*/) + errorFlag = EC_IllegalParameter; + else + byteVal = uintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + byteVal = 0; + return errorFlag; +} + + +OFCondition DcmOtherByteOtherWord::getUint8Array(Uint8 *&byteVals) +{ + errorFlag = EC_Normal; + if (getTag().getEVR() != EVR_OW && getTag().getEVR() != EVR_lt) + byteVals = OFstatic_cast(Uint8 *, getValue()); + else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::getUint16(Uint16 &wordVal, + const unsigned long pos) +{ + Uint16 *uintValues = NULL; + errorFlag = getUint16Array(uintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (uintValues == NULL) + errorFlag = EC_IllegalCall; + else if (pos >= getLength() / sizeof(Uint16) /*words*/) + errorFlag = EC_IllegalParameter; + else + wordVal = uintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + wordVal = 0; + return errorFlag; +} + + +OFCondition DcmOtherByteOtherWord::getUint16Array(Uint16 *&wordVals) +{ + errorFlag = EC_Normal; + if (getTag().getEVR() == EVR_OW || getTag().getEVR() == EVR_lt) + wordVals = OFstatic_cast(Uint16 *, getValue()); + else + errorFlag = EC_IllegalCall; + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + if (getTag().getEVR() == EVR_OW || getTag().getEVR() == EVR_lt) + { + Uint16 uint16Val; + /* get the specified numeric value (16 bit) */ + errorFlag = getUint16(uint16Val, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string (hex mode) */ + char buffer[32]; + sprintf(buffer, "%4.4hx", uint16Val); + /* assign result */ + stringVal = buffer; + } + } else { + Uint8 uint8Val; + /* get the specified numeric value (8 bit) */ + errorFlag = getUint8(uint8Val, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string (hex mode) */ + char buffer[32]; + sprintf(buffer, "%2.2hx", OFstatic_cast(unsigned short, uint8Val)); + /* assign result */ + stringVal = buffer; + } + } + return errorFlag; +} + + +OFCondition DcmOtherByteOtherWord::getOFStringArray(OFString &stringVal, + OFBool /*normalize*/) +{ + if (getTag().getEVR() == EVR_OW || getTag().getEVR() == EVR_lt) + { + /* get array of 16 bit values */ + Uint16 *uint16Vals = OFstatic_cast(Uint16 *, getValue()); + const size_t count = OFstatic_cast(size_t, getLength() / sizeof(Uint16)); + if ((uint16Vals != NULL) && (count > 0)) + { + OFOStringStream stream; + /* output first value in hexadecimal format */ + stream << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(4) << *(uint16Vals++); + /* for all other array elements ... */ + for (size_t i = 1; i < count; i++) + stream << "\\" << STD_NAMESPACE setw(4) << *(uint16Vals++); + stream << OFStringStream_ends; + /* convert string stream into a character string */ + OFSTRINGSTREAM_GETSTR(stream, buffer_str) + stringVal.assign(buffer_str); + OFSTRINGSTREAM_FREESTR(buffer_str) + errorFlag = EC_Normal; + } else + errorFlag = EC_IllegalCall; + } else { + /* get array of 8 bit values */ + Uint8 *uint8Vals = OFstatic_cast(Uint8 *, getValue()); + const size_t count = OFstatic_cast(size_t, getLength()); + if ((uint8Vals != NULL) && (count > 0)) + { + OFOStringStream stream; + /* output first value in hexadecimal format */ + stream << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(2) << OFstatic_cast(int, *(uint8Vals++)); + /* for all other array elements ... */ + for (size_t i = 1; i < count; i++) + stream << "\\" << STD_NAMESPACE setw(2) << OFstatic_cast(int, *(uint8Vals++)); + stream << OFStringStream_ends; + /* convert string stream into a character string */ + OFSTRINGSTREAM_GETSTR(stream, buffer_str) + stringVal.assign(buffer_str); + OFSTRINGSTREAM_FREESTR(buffer_str) + errorFlag = EC_Normal; + } else + errorFlag = EC_IllegalCall; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::verify(const OFBool autocorrect) +{ + errorFlag = EC_Normal; + if (autocorrect) + errorFlag = alignValue(); + return errorFlag; +} + + +// ******************************** + + +OFBool DcmOtherByteOtherWord::canWriteXfer(const E_TransferSyntax newXfer, + const E_TransferSyntax /*oldXfer*/) +{ + DcmXfer newXferSyn(newXfer); + return (getTag() != DCM_PixelData) || !newXferSyn.isEncapsulated(); +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::write( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + if (getTransferState() == ERW_init) + { + // if the attribute value is in file, we should call compact() if the write + // operation causes the value to be loaded into main memory, which can happen + // for odd length attributes. + compactAfterTransfer = ! valueLoaded(); + + // this call may cause the attribute to be loaded into memory + alignValue(); + } + + // call inherited method + errorFlag = DcmElement::write(outStream, oxfer, enctype, wcache); + } + + // if the write operation has completed successfully, call compact if the + // attribute value resided in file prior to the write operation. + if (errorFlag.good() && compactAfterTransfer) compact(); + + // return error status + return errorFlag; +} + + +OFCondition DcmOtherByteOtherWord::writeSignatureFormat( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + if (getTransferState() == ERW_notInitialized) + errorFlag = EC_IllegalCall; + else + { + if (getTransferState() == ERW_init) + { + // if the attribute value is in file, we should call compact() if the write + // operation causes the value to be loaded into main memory, which can happen + // for odd length attributes. + compactAfterTransfer = ! valueLoaded(); + + // this call may cause the attribute to be loaded into memory + alignValue(); + } + + // call inherited method + errorFlag = DcmElement::writeSignatureFormat(outStream, oxfer, enctype, wcache); + } + + // if the write operation has completed successfully, call compact if the + // attribute value resided in file prior to the write operation. + if (errorFlag.good() && compactAfterTransfer) compact(); + + // return error status + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* OB/OW data requires special handling in the Native DICOM Model format */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* write XML start tag */ + writeXMLStartTag(out, flags); + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + const DcmEVR evr = getTag().getEVR(); + out << ""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + if ((evr == EVR_OW) || (evr == EVR_lt)) + { + /* Base64 encoder requires big endian input data */ + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, byteValues, getLengthField(), sizeof(Uint16)); + /* update the byte order indicator variable correspondingly */ + setByteOrder(EBO_BigEndian); + } + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "" << OFendl; + } else { + /* generate a new UID but the binary data is not (yet) written. */ + OFUUID uuid; + out << "" << OFendl; + } + } + /* write XML end tag */ + writeXMLEndTag(out, flags); + } else { + /* XML start tag: */ + if (!(flags & DCMTypes::XF_writeBinaryData)) + writeXMLStartTag(out, flags, "binary=\"hidden\""); + else if (flags & DCMTypes::XF_encodeBase64) + writeXMLStartTag(out, flags, "binary=\"base64\""); + else + writeXMLStartTag(out, flags, "binary=\"yes\""); + /* write element value (if loaded) */ + if (valueLoaded() && (flags & DCMTypes::XF_writeBinaryData)) + { + const DcmEVR evr = getTag().getEVR(); + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + if ((evr == EVR_OW) || (evr == EVR_lt)) + { + /* Base64 encoder requires big endian input data */ + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, byteValues, getLengthField(), sizeof(Uint16)); + /* update the byte order indicator variable correspondingly */ + setByteOrder(EBO_BigEndian); + } + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + } else { + if ((evr == EVR_OW) || (evr == EVR_lt)) + { + /* get and check 16 bit data */ + Uint16 *wordValues = NULL; + if (getUint16Array(wordValues).good() && (wordValues != NULL)) + { + const unsigned long count = getLengthField() / OFstatic_cast(unsigned long, sizeof(Uint16)); + /* count can be zero if we have an invalid element with less than two bytes length */ + if (count > 0) + { + out << STD_NAMESPACE hex << STD_NAMESPACE setfill('0'); + /* print word values in hex mode */ + out << STD_NAMESPACE setw(4) << (*(wordValues++)); + for (unsigned long i = 1; i < count; i++) + out << "\\" << STD_NAMESPACE setw(4) << (*(wordValues++)); + /* reset i/o manipulators */ + out << STD_NAMESPACE dec << STD_NAMESPACE setfill(' '); + } + } + } else { + /* get and check 8 bit data */ + Uint8 *byteValues = NULL; + if (getUint8Array(byteValues).good() && (byteValues != NULL)) + { + const unsigned long count = getLengthField(); + out << STD_NAMESPACE hex << STD_NAMESPACE setfill('0'); + /* print byte values in hex mode */ + out << STD_NAMESPACE setw(2) << OFstatic_cast(int, *(byteValues++)); + for (unsigned long i = 1; i < count; i++) + out << "\\" << STD_NAMESPACE setw(2) << OFstatic_cast(int, *(byteValues++)); + /* reset i/o manipulators */ + out << STD_NAMESPACE dec << STD_NAMESPACE setfill(' '); + } + } + } + } + /* XML end tag: */ + writeXMLEndTag(out, flags); + } + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOtherByteOtherWord::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* write JSON Opener */ + writeJsonOpener(out, format); + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + OFString value; + if (format.asBulkDataURI(getTag(), value)) + { + /* return defined BulkDataURI */ + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, value); + } + else + { + /* encode binary data as Base64 */ + format.printInlineBinaryPrefix(out); + out << "\""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "\""; + } + } + /* write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} diff --git a/dcmdata/libsrc/dcvrod.cc b/dcmdata/libsrc/dcvrod.cc new file mode 100644 index 00000000..1d63ccd8 --- /dev/null +++ b/dcmdata/libsrc/dcvrod.cc @@ -0,0 +1,212 @@ +/* + * + * Copyright (C) 2013-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmOtherDouble + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofuuid.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmdata/dcvrod.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcjson.h" + + +// ******************************** + + +DcmOtherDouble::DcmOtherDouble(const DcmTag &tag, + const Uint32 len) + : DcmFloatingPointDouble(tag, len) +{ +} + + +DcmOtherDouble::DcmOtherDouble(const DcmOtherDouble &old) + : DcmFloatingPointDouble(old) +{ +} + + +DcmOtherDouble::~DcmOtherDouble() +{ +} + + +DcmOtherDouble &DcmOtherDouble::operator=(const DcmOtherDouble &obj) +{ + DcmFloatingPointDouble::operator=(obj); + return *this; +} + + +OFCondition DcmOtherDouble::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmOtherDouble &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmOtherDouble::ident() const +{ + return EVR_OD; +} + + +OFCondition DcmOtherDouble::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + /* currently no checks are performed */ + return EC_Normal; +} + + +unsigned long DcmOtherDouble::getVM() +{ + /* value multiplicity for OD is defined as 1 */ + return 1; +} + + +// ******************************** + + +OFCondition DcmOtherDouble::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* always write XML start tag */ + writeXMLStartTag(out, flags); + /* OD data requires special handling in the Native DICOM Model format */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + out << ""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + /* Base64 encoder requires big endian input data */ + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, byteValues, getLengthField(), sizeof(Float64)); + /* update the byte order indicator variable correspondingly */ + setByteOrder(EBO_BigEndian); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "" << OFendl; + } else { + /* generate a new UID but the binary data is not (yet) written. */ + OFUUID uuid; + out << "" << OFendl; + } + } + } else { + /* write element value (if loaded) */ + if (valueLoaded()) + { + Float64 *floatValues = NULL; + /* get and check 64 bit float data */ + if (getFloat64Array(floatValues).good() && (floatValues != NULL)) + { + const size_t count = getNumberOfValues(); + /* count can be zero if we have an invalid element with less than eight bytes length */ + if (count > 0) + { + /* increase default precision - see DcmFloatingPointDouble::print() */ + const STD_NAMESPACE streamsize oldPrecision = out.precision(17); + /* print float values with separators */ + out << (*(floatValues++)); + for (unsigned long i = 1; i < count; i++) + out << "\\" << (*(floatValues++)); + /* reset i/o manipulators */ + out.precision(oldPrecision); + } + } + } + } + /* always write XML end tag */ + writeXMLEndTag(out, flags); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOtherDouble::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + writeJsonOpener(out, format); + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + OFString value; + if (format.asBulkDataURI(getTag(), value)) + { + /* return defined BulkDataURI */ + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, value); + } + else + { + /* encode binary data as Base64 */ + format.printInlineBinaryPrefix(out); + out << "\""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "\""; + } + } + /* write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOtherDouble::createFloat64Array(const Uint32 numDoubles, + Float64 *&doubleVals) +{ + Uint32 bytesRequired = 0; + /* make sure that max length is not exceeded */ + if (OFStandard::safeMult(numDoubles, OFstatic_cast(Uint32, sizeof(Float64)), bytesRequired)) + errorFlag = createEmptyValue(bytesRequired); + else + errorFlag = EC_ElemLengthExceeds32BitField; + if (errorFlag.good()) + doubleVals = OFstatic_cast(Float64 *, this->getValue()); + else + doubleVals = NULL; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcvrof.cc b/dcmdata/libsrc/dcvrof.cc new file mode 100644 index 00000000..8c4e2355 --- /dev/null +++ b/dcmdata/libsrc/dcvrof.cc @@ -0,0 +1,212 @@ +/* + * + * Copyright (C) 2002-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmOtherFloat + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofuuid.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcvrof.h" +#include "dcmtk/dcmdata/dcswap.h" + + +// ******************************** + + +DcmOtherFloat::DcmOtherFloat(const DcmTag &tag, + const Uint32 len) + : DcmFloatingPointSingle(tag, len) +{ +} + + +DcmOtherFloat::DcmOtherFloat(const DcmOtherFloat &old) + : DcmFloatingPointSingle(old) +{ +} + + +DcmOtherFloat::~DcmOtherFloat() +{ +} + + +DcmOtherFloat &DcmOtherFloat::operator=(const DcmOtherFloat &obj) +{ + DcmFloatingPointSingle::operator=(obj); + return *this; +} + + +OFCondition DcmOtherFloat::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmOtherFloat &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmOtherFloat::ident() const +{ + return EVR_OF; +} + + +OFCondition DcmOtherFloat::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + /* currently no checks are performed */ + return EC_Normal; +} + + +unsigned long DcmOtherFloat::getVM() +{ + /* value multiplicity for OF is defined as 1 */ + return 1; +} + + +// ******************************** + + +OFCondition DcmOtherFloat::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* always write XML start tag */ + writeXMLStartTag(out, flags); + /* OF data requires special handling in the Native DICOM Model format */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + out << ""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + /* Base64 encoder requires big endian input data */ + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, byteValues, getLengthField(), sizeof(Float32)); + /* update the byte order indicator variable correspondingly */ + setByteOrder(EBO_BigEndian); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "" << OFendl; + } else { + /* generate a new UID but the binary data is not (yet) written. */ + OFUUID uuid; + out << "" << OFendl; + } + } + } else { + /* write element value (if loaded) */ + if (valueLoaded()) + { + Float32 *floatValues = NULL; + /* get and check 32 bit float data */ + if (getFloat32Array(floatValues).good() && (floatValues != NULL)) + { + const size_t count = getNumberOfValues(); + /* count can be zero if we have an invalid element with less than four bytes length */ + if (count > 0) + { + /* increase default precision - see DcmFloatingPointSingle::print() */ + const STD_NAMESPACE streamsize oldPrecision = out.precision(8); + /* print float values with separators */ + out << (*(floatValues++)); + for (unsigned long i = 1; i < count; i++) + out << "\\" << (*(floatValues++)); + /* reset i/o manipulators */ + out.precision(oldPrecision); + } + } + } + } + /* always write XML end tag */ + writeXMLEndTag(out, flags); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOtherFloat::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + writeJsonOpener(out, format); + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + OFString value; + if (format.asBulkDataURI(getTag(), value)) + { + /* return defined BulkDataURI */ + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, value); + } + else + { + /* encode binary data as Base64 */ + format.printInlineBinaryPrefix(out); + out << "\""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "\""; + } + } + /* always write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOtherFloat::createFloat32Array(const Uint32 numFloats, + Float32 *&floatVals) +{ + Uint32 bytesRequired = 0; + /* make sure that max length is not exceeded */ + if (OFStandard::safeMult(numFloats, OFstatic_cast(Uint32, sizeof(Float32)), bytesRequired)) + errorFlag = createEmptyValue(bytesRequired); + else + errorFlag = EC_ElemLengthExceeds32BitField; + if (errorFlag.good()) + floatVals = OFstatic_cast(Float32 *, this->getValue()); + else + floatVals = NULL; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcvrol.cc b/dcmdata/libsrc/dcvrol.cc new file mode 100644 index 00000000..cbb1b6c6 --- /dev/null +++ b/dcmdata/libsrc/dcvrol.cc @@ -0,0 +1,214 @@ +/* + * + * Copyright (C) 2016-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmOtherLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofuuid.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmdata/dcvrol.h" +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcswap.h" + + +// ******************************** + + +DcmOtherLong::DcmOtherLong(const DcmTag &tag) + : DcmUnsignedLong(tag, 0) +{ +} + + +DcmOtherLong::DcmOtherLong(const DcmTag &tag, + const Uint32 len) + : DcmUnsignedLong(tag, len) +{ +} + + +DcmOtherLong::DcmOtherLong(const DcmOtherLong &old) + : DcmUnsignedLong(old) +{ +} + + +DcmOtherLong::~DcmOtherLong() +{ +} + + +DcmOtherLong &DcmOtherLong::operator=(const DcmOtherLong &obj) +{ + DcmUnsignedLong::operator=(obj); + return *this; +} + + +OFCondition DcmOtherLong::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmOtherLong &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmOtherLong::ident() const +{ + return EVR_OL; +} + + +OFCondition DcmOtherLong::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + /* currently no checks are performed */ + return EC_Normal; +} + + +unsigned long DcmOtherLong::getVM() +{ + /* value multiplicity for OL is defined as 1 */ + return 1; +} + + +// ******************************** + + +OFCondition DcmOtherLong::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* always write XML start tag */ + writeXMLStartTag(out, flags); + /* OL data requires special handling in the Native DICOM Model format */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + out << ""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + /* Base64 encoder requires big endian input data */ + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, byteValues, getLengthField(), sizeof(Uint32)); + /* update the byte order indicator variable correspondingly */ + setByteOrder(EBO_BigEndian); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "" << OFendl; + } else { + /* generate a new UID but the binary data is not (yet) written. */ + OFUUID uuid; + out << "" << OFendl; + } + } + } else { + /* write element value (if loaded) */ + if (valueLoaded()) + { + Uint32 *uintVals = NULL; + /* get and check 32 bit data */ + if (getUint32Array(uintVals).good() && (uintVals != NULL)) + { + const size_t count = getNumberOfValues(); + /* count can be zero if we have an invalid element with less than four bytes length */ + if (count > 0) + { + /* print unsigned long values in hex mode */ + out << (*(uintVals++)); + for (unsigned long i = 1; i < count; i++) + out << "\\" << (*(uintVals++)); + } + } + } + } + /* always write XML end tag */ + writeXMLEndTag(out, flags); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOtherLong::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* write JSON Opener */ + writeJsonOpener(out, format); + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + OFString value; + if (format.asBulkDataURI(getTag(), value)) + { + /* return defined BulkDataURI */ + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, value); + } + else + { + /* encode binary data as Base64 */ + format.printInlineBinaryPrefix(out); + out << "\""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "\""; + } + } + /* write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOtherLong::createUint32Array(const Uint32 numDoubleWords, + Uint32 *&doubleWords) +{ + Uint32 bytesRequired = 0; + /* make sure that max length is not exceeded */ + if (OFStandard::safeMult(numDoubleWords, OFstatic_cast(Uint32, sizeof(Uint32)), bytesRequired)) + errorFlag = createEmptyValue(bytesRequired); + else + errorFlag = EC_ElemLengthExceeds32BitField; + if (errorFlag.good()) + doubleWords = OFstatic_cast(Uint32 *, this->getValue()); + else + doubleWords = NULL; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcvrov.cc b/dcmdata/libsrc/dcvrov.cc new file mode 100644 index 00000000..c671732d --- /dev/null +++ b/dcmdata/libsrc/dcvrov.cc @@ -0,0 +1,214 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmOther64bitVeryLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofuuid.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmdata/dcvrov.h" +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcswap.h" + + +// ******************************** + + +DcmOther64bitVeryLong::DcmOther64bitVeryLong(const DcmTag &tag) + : DcmUnsigned64bitVeryLong(tag, 0) +{ +} + + +DcmOther64bitVeryLong::DcmOther64bitVeryLong(const DcmTag &tag, + const Uint32 len) + : DcmUnsigned64bitVeryLong(tag, len) +{ +} + + +DcmOther64bitVeryLong::DcmOther64bitVeryLong(const DcmOther64bitVeryLong &old) + : DcmUnsigned64bitVeryLong(old) +{ +} + + +DcmOther64bitVeryLong::~DcmOther64bitVeryLong() +{ +} + + +DcmOther64bitVeryLong &DcmOther64bitVeryLong::operator=(const DcmOther64bitVeryLong &obj) +{ + DcmUnsigned64bitVeryLong::operator=(obj); + return *this; +} + + +OFCondition DcmOther64bitVeryLong::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmOther64bitVeryLong &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmOther64bitVeryLong::ident() const +{ + return EVR_OV; +} + + +OFCondition DcmOther64bitVeryLong::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + /* currently no checks are performed */ + return EC_Normal; +} + + +unsigned long DcmOther64bitVeryLong::getVM() +{ + /* value multiplicity for OV is defined as 1 */ + return 1; +} + + +// ******************************** + + +OFCondition DcmOther64bitVeryLong::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* always write XML start tag */ + writeXMLStartTag(out, flags); + /* OV data requires special handling in the Native DICOM Model format */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + /* encode binary data as Base64 */ + if (flags & DCMTypes::XF_encodeBase64) + { + out << ""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + /* Base64 encoder requires big endian input data */ + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, byteValues, getLengthField(), sizeof(Uint64)); + /* update the byte order indicator variable correspondingly */ + setByteOrder(EBO_BigEndian); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "" << OFendl; + } else { + /* generate a new UID but the binary data is not (yet) written. */ + OFUUID uuid; + out << "" << OFendl; + } + } + } else { + /* write element value (if loaded) */ + if (valueLoaded()) + { + Uint64 *uintVals = NULL; + /* get and check 64 bit data */ + if (getUint64Array(uintVals).good() && (uintVals != NULL)) + { + const size_t count = getNumberOfValues(); + /* count can be zero if we have an invalid element with less than eight bytes length */ + if (count > 0) + { + /* print unsigned long values in hex mode */ + out << (*(uintVals++)); + for (unsigned long i = 1; i < count; i++) + out << "\\" << (*(uintVals++)); + } + } + } + } + /* always write XML end tag */ + writeXMLEndTag(out, flags); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOther64bitVeryLong::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* write JSON Opener */ + writeJsonOpener(out, format); + /* for an empty value field, we do not need to do anything */ + if (getLengthField() > 0) + { + OFString value; + if (format.asBulkDataURI(getTag(), value)) + { + /* return defined BulkDataURI */ + format.printBulkDataURIPrefix(out); + DcmJsonFormat::printString(out, value); + } + else + { + /* encode binary data as Base64 */ + format.printInlineBinaryPrefix(out); + out << "\""; + Uint8 *byteValues = OFstatic_cast(Uint8 *, getValue()); + OFStandard::encodeBase64(out, byteValues, OFstatic_cast(size_t, getLengthField())); + out << "\""; + } + } + /* write JSON Closer */ + writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmOther64bitVeryLong::createUint64Array(const Uint32 numQuadWords, + Uint64 *&quadWords) +{ + Uint32 bytesRequired = 0; + /* make sure that max length is not exceeded */ + if (OFStandard::safeMult(numQuadWords, OFstatic_cast(Uint32, sizeof(Uint64)), bytesRequired)) + errorFlag = createEmptyValue(bytesRequired); + else + errorFlag = EC_ElemLengthExceeds32BitField; + if (errorFlag.good()) + quadWords = OFstatic_cast(Uint64 *, this->getValue()); + else + quadWords = NULL; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcvrpn.cc b/dcmdata/libsrc/dcvrpn.cc new file mode 100644 index 00000000..3424ccc6 --- /dev/null +++ b/dcmdata/libsrc/dcvrpn.cc @@ -0,0 +1,741 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth, Joerg Riesmeier + * + * Purpose: Implementation of class DcmPersonName + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcjson.h" +#include "dcmtk/dcmdata/dcvrpn.h" + + +// ******************************** + + +const char* const DcmPersonName::componentGroupNames[3] = { "Alphabetic", "Ideographic", "Phonetic" }; + + +DcmPersonName::DcmPersonName(const DcmTag &tag, + const Uint32 len) + : DcmCharString(tag, len) +{ + setMaxLength(64); // not correct: max length of PN is 3*64+2 = 194 characters (not bytes!) + setNonSignificantChars(" \\^="); +} + + +DcmPersonName::DcmPersonName(const DcmPersonName& old) + : DcmCharString(old) +{ +} + + +DcmPersonName::~DcmPersonName() +{ +} + + +DcmPersonName &DcmPersonName::operator=(const DcmPersonName &obj) +{ + DcmCharString::operator=(obj); + return *this; +} + + +OFCondition DcmPersonName::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmPersonName &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmPersonName::ident() const +{ + return EVR_PN; +} + + +OFCondition DcmPersonName::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + { + OFString charset; + /* try to determine the value of the SpecificCharacterSet element */ + if (getSpecificCharacterSet(charset) == EC_CorruptedData) + charset = "UNKNOWN"; + l_error = DcmPersonName::checkStringValue(strVal, vm, charset); + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmPersonName::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmCharString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +OFCondition DcmPersonName::writeXML(STD_NAMESPACE ostream &out, + const size_t flags) +{ + /* PN requires special handling in the Native DICOM Model format */ + if (flags & DCMTypes::XF_useNativeModel) + { + /* write normal XML start tag */ + DcmElement::writeXMLStartTag(out, flags); + /* if the value is empty, we do not need to insert any PersonName attribute at all */ + if (!isEmpty()) + { + /* condition variable, not meant to be used as a result of this method */ + OFCondition result; + /* iterate over multiple Person Names if necessary */ + const unsigned long vm = getVM(); + /* strings to hold family, first, and middle name as well as prefix and suffix component */ + OFString components[5]; + /* arrays in order to permit looping while creating the output */ + const char* compNames[5] = { "FamilyName", "GivenName", "MiddleName", "NamePrefix", "NameSuffix" }; + for (unsigned int it = 0; it < vm; it++) + { + out << "" << OFendl; + OFString allGroups, oneCompGroup; + result = getOFString(allGroups, it); + if (result.good()) + { + /* process alphabetic, ideographic and phonetic encoding, as available */ + for (unsigned int cg = 0; cg < 3; cg++) + { + /* get one component group (more efficient to check for non-zero length on whole group later) */ + result = getComponentGroup(allGroups, cg, oneCompGroup); + if (result.good() && !oneCompGroup.empty()) + { + /* get all name components from current group, i.e. last, first, middle name, prefix, suffix. + * uses single group, so the component group parameter is always 0 + */ + result = getNameComponentsFromString(oneCompGroup, components[0], components[1], components[2], components[3], components[4], 0); + } + /* output one component group, e.g. Onken */ + if (result.good()) + { + out << "<" << componentGroupNames[cg] << ">" << OFendl; // e.g. + /* go through components (last name, first name, ...) */ + for (unsigned short c = 0; c < 5; c++) + { + if (!components[c].empty()) + { + /* output name component, e.g. Onken */ + out << "<" << compNames[c] << ">" << components[c] << "" << OFendl; + } + } + out << "" << OFendl; // e.g. + } + } + } + out << "" << OFendl; + } + } + /* write normal XML end tag */ + DcmElement::writeXMLEndTag(out, flags); + /* always report success */ + return EC_Normal; + } else { + /* DCMTK-specific format does not require anything special */ + return DcmElement::writeXML(out, flags); + } +} + + +// ******************************** + + +OFCondition DcmPersonName::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + // helper struct to operate on the value pointers + struct Lexer + { + // initializes everything with foolproof defaults + Lexer() + : it(OFnullptr) + , end(OFnullptr) + , componentGroupName(componentGroupNames) + , currentComponent(0) + , hasTrailingNull(OFFalse) + { + + } + + // resets component groups and components for the new value and + // remembers that there was a value separator, so that trailing + // 'null' values can be printed. + void handleValue() + { + currentComponent = 0; + componentGroupName = componentGroupNames; + hasTrailingNull = OFTrue; + } + + // check component group validity and set members + // appropriately + // emit warnings for invalid component groups + void handleComponentGroup() + { + if (componentGroupName != componentGroupNames + 2) + { + currentComponent = 0; + ++componentGroupName; + } + else + { + DCMDATA_ERROR("DcmPersonName::writeJson(): omitting invalid " + "component group (more than three component groups present)"); + // seek to the end of the current component group - 1, since + // the iterator will be incremented in the calling code + while (++it != end && *it != '\\' && *it != '='); + --it; + } + } + + // searches for the next significant character + // (no delimiter or padding character). + // keeps track of the component group name and component + // number. + // returns OFFalse if no more significant characters exist. + OFBool nextValue() + { + for (; it != end; ++it) switch (*it) + { + case '\\': + handleValue(); + return OFTrue; + case '=': + handleComponentGroup(); + break; + case '^': + ++currentComponent; + break; + case ' ': + break; + default: + return OFTrue; + } + // this ends the output, unless we have to write + // a trailing 'null' + return hasTrailingNull; + } + + // searches for the next significant character + // (no delimiter or padding character) + // within the current value. + // keeps track of the current component group and component + // number. + // returns OFFalse if no more significant characters exist + // within the current value. + OFBool nextComponentGroup() + { + for (; it != end; ++it) switch(*it) + { + case '\\': + // skip over any value separator + ++it; + handleValue(); + return OFFalse; + case '=': + handleComponentGroup(); + break; + case '^': + ++currentComponent; + break; + case ' ': + break; + default: + return OFTrue; + } + return OFFalse; + } + + // searches for the next significant character + // (no delimiter or padding character) + // within the current component group. + // keeps track of the current component number. + // returns OFFalse if no more significant characters exist + // within the current component group. + OFBool nextComponent() + { + for (; it != end; ++it) switch(*it) + { + case '\\': + case '=': + return OFFalse; + case '^': + ++currentComponent; + break; + case ' ': + break; + default: + return OFTrue; + } + return OFFalse; + } + + // writes all significant characters of the current component, + // prepending '^' characters as required by the current component + // number. + void writeComponent(STD_NAMESPACE ostream &out) + { + for (; currentComponent; --currentComponent) + out << '^'; + const char* const begin = it; + while (++it != end && *it != '\\' && *it != '=' && *it != '^'); + const char* componentEnd = it - 1; + while (*componentEnd == ' ') + --componentEnd; + out.write(begin, componentEnd - begin + 1); + } + + // writes the name of the current component group and all components + // within the current component group that contain at least one significant + // character. + // All others are replaced by a single '^' character each, except for the + // trailing ones (that are omitted). + void writeComponentGroup(STD_NAMESPACE ostream &out, DcmJsonFormat &format) + { + out << format.indent() << '"' << *componentGroupName << "\":" + << format.space() << '"'; + writeComponent(out); + while (nextComponent()) + writeComponent(out); + out << '"'; + } + + // writes all component groups of the current value that contain at least + // a single significant character, separated by ',' characters. + // all other component groups are omitted entirely. + // writes 'null' if all component groups are empty. + void writeCurrentValue(STD_NAMESPACE ostream &out, DcmJsonFormat &format) + { + hasTrailingNull = OFFalse; + if (nextComponentGroup()) + { + out << '{' << format.newline(); + ++format.indent(); + writeComponentGroup(out, format); + while (nextComponentGroup()) + { + out << ',' << format.newline(); + writeComponentGroup(out, format); + } + out << format.newline() << --format.indent() << '}'; + } + else out << "null"; + } + + // points to the character that is currently being processed + const char* it; + + // points to the end of the entire attribute's data, including + // all values + const char* const end; + + // points to the respective entry of the componentGroupNames + // array that contains the name of the component group that + // is currently being processed + const char* const * componentGroupName; + + // denotes the number of empty components within the current + // component group since the last component that contained + // at least one significant character. + unsigned currentComponent; + + // will be OFTrue if the last value is empty, so that a + // trailing 'null' will be written + OFBool hasTrailingNull; + } lexer; + + // initialize the lexer, return an error if the data + // of the current attribute can't be accessed for whatever + // reason + OFCondition result = DcmCharString::getString(OFconst_cast(char*&, lexer.it)); + if (result.bad()) + return result; + OFconst_cast(const char*&, lexer.end) = lexer.it + DcmCharString::getLength(); + + // write attribute name etc., even if the attribute is empty + DcmElement::writeJsonOpener(out, format); + + // search for the first significant character within the + // entire data or the first value separator '\' + if (lexer.nextValue()) + { + // write the fist value or 'null' + format.printValuePrefix(out); + lexer.writeCurrentValue(out, format); + // search for the first significant character within + // the next value or the next '\' + while (lexer.nextValue()) + { + // write array element separator and the next + // value or 'null' + format.printNextArrayElementPrefix(out); + lexer.writeCurrentValue(out, format); + } + // close the array after the last value + format.printValueSuffix(out); + } + + // close the current attribute + DcmElement::writeJsonCloser(out, format); + + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmPersonName::getNameComponents(OFString &lastName, + OFString &firstName, + OFString &middleName, + OFString &namePrefix, + OFString &nameSuffix, + const unsigned long pos, + const unsigned int componentGroup) +{ + OFString dicomName; + OFCondition l_error = getOFString(dicomName, pos); + if (l_error.good()) + l_error = getNameComponentsFromString(dicomName, lastName, firstName, middleName, namePrefix, nameSuffix, componentGroup); + else + { + lastName.clear(); + firstName.clear(); + middleName.clear(); + namePrefix.clear(); + nameSuffix.clear(); + } + return l_error; +} + + +OFCondition DcmPersonName::getNameComponentsFromString(const OFString &dicomName, + OFString &lastName, + OFString &firstName, + OFString &middleName, + OFString &namePrefix, + OFString &nameSuffix, + const unsigned int componentGroup) +{ + OFCondition l_error = EC_Normal; + /* initialize all name components */ + lastName.clear(); + firstName.clear(); + middleName.clear(); + namePrefix.clear(); + nameSuffix.clear(); + if (!dicomName.empty()) + { + /* Excerpt from DICOM part 5: + "For the purpose of writing names in ideographic characters and in + phonetic characters, up to 3 groups of components may be used." + */ + OFString name; + l_error = getComponentGroup(dicomName, componentGroup, name); + /* check whether component group is valid (= non-empty) */ + if (l_error.good() && !name.empty()) + { + /* find caret separators */ + /* (tbd: add more sophisticated heuristics for comma and space separated names) */ + const size_t pos1 = name.find('^'); + if (pos1 != OFString_npos) + { + const size_t pos2 = name.find('^', pos1 + 1); + lastName = name.substr(0, pos1); + if (pos2 != OFString_npos) + { + const size_t pos3 = name.find('^', pos2 + 1); + firstName = name.substr(pos1 + 1, pos2 - pos1 - 1); + if (pos3 != OFString_npos) + { + const size_t pos4 = name.find('^', pos3 + 1); + middleName = name.substr(pos2 + 1, pos3 - pos2 - 1); + if (pos4 != OFString_npos) + { + namePrefix = name.substr(pos3 + 1, pos4 - pos3 - 1); + nameSuffix = name.substr(pos4 + 1); + } else + namePrefix = name.substr(pos3 + 1); + } else + middleName = name.substr(pos2 + 1); + } else + firstName = name.substr(pos1 + 1); + } else + lastName = name; + } + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmPersonName::getFormattedName(OFString &formattedName, + const unsigned long pos, + const unsigned int componentGroup) +{ + OFString dicomName; + OFCondition l_error = getOFString(dicomName, pos); + if (l_error.good()) + l_error = getFormattedNameFromString(dicomName, formattedName, componentGroup); + else + formattedName.clear(); + return l_error; +} + + +OFCondition DcmPersonName::getComponentGroup(const OFString &allCmpGroups, + const unsigned int groupNo, + OFString &cmpGroup) +{ + OFCondition l_error = EC_IllegalParameter; + cmpGroup.clear(); + /* Excerpt from DICOM part 5: + "For the purpose of writing names in ideographic characters and in + phonetic characters, up to 3 groups of components may be used." + */ + if (groupNo < 3) + { + // find component group (0..2) + const size_t posA = allCmpGroups.find('='); + if (posA != OFString_npos) + { + if (groupNo > 0) + { + const size_t posB = allCmpGroups.find('=', posA + 1); + if (posB != OFString_npos) + { + if (groupNo == 1) + cmpGroup = allCmpGroups.substr(posA + 1, posB - posA - 1); + else /* groupNo == 2 */ + cmpGroup = allCmpGroups.substr(posB + 1); + l_error = EC_Normal; + } + else if (groupNo == 1) + { + cmpGroup = allCmpGroups.substr(posA + 1); + l_error = EC_Normal; + } + } else { + /* groupNo == 0 */ + cmpGroup = allCmpGroups.substr(0, posA); + l_error = EC_Normal; + } + } + else if (groupNo == 0) + { + cmpGroup = allCmpGroups; + l_error = EC_Normal; + } + } + return l_error; +} + + +OFCondition DcmPersonName::getFormattedNameFromString(const OFString &dicomName, + OFString &formattedName, + const unsigned int componentGroup) +{ + OFString lastName, firstName, middleName, namePrefix, nameSuffix; + OFCondition l_error = getNameComponentsFromString(dicomName, lastName, firstName, middleName, namePrefix, nameSuffix, componentGroup); + if (l_error.good()) + l_error = getFormattedNameFromComponents(lastName, firstName, middleName, namePrefix, nameSuffix, formattedName); + else + formattedName.clear(); + return l_error; +} + + +OFCondition DcmPersonName::getFormattedNameFromComponents(const OFString &lastName, + const OFString &firstName, + const OFString &middleName, + const OFString &namePrefix, + const OFString &nameSuffix, + OFString &formattedName) +{ + formattedName.clear(); + /* concatenate name components */ + if (!namePrefix.empty()) + formattedName += namePrefix; + if (!firstName.empty()) + { + if (!formattedName.empty()) + formattedName += ' '; + formattedName += firstName; + } + if (!middleName.empty()) + { + if (!formattedName.empty()) + formattedName += ' '; + formattedName += middleName; + } + if (!lastName.empty()) + { + if (!formattedName.empty()) + formattedName += ' '; + formattedName += lastName; + } + if (!nameSuffix.empty()) + { + if (!formattedName.empty()) + formattedName += ", "; + formattedName += nameSuffix; + } + return EC_Normal; +} + + +OFCondition DcmPersonName::getStringFromNameComponents(const OFString &lastName, + const OFString &firstName, + const OFString &middleName, + const OFString &namePrefix, + const OFString &nameSuffix, + OFString &dicomName) +{ + const size_t middleLen = middleName.length(); + const size_t prefixLen = namePrefix.length(); + const size_t suffixLen = nameSuffix.length(); + /* concatenate name components */ + dicomName = lastName; + if (firstName.length() + middleLen + prefixLen + suffixLen > 0) + dicomName += '^'; + dicomName += firstName; + if (middleLen + prefixLen + suffixLen > 0) + dicomName += '^'; + dicomName += middleName; + if (prefixLen + suffixLen > 0) + dicomName += '^'; + dicomName += namePrefix; + if (suffixLen > 0) + dicomName += '^'; + dicomName += nameSuffix; + return EC_Normal; +} + + +// ******************************** + + +OFCondition DcmPersonName::putNameComponents(const OFString &lastName, + const OFString &firstName, + const OFString &middleName, + const OFString &namePrefix, + const OFString &nameSuffix) +{ + OFString dicomName; + /* concatenate name components */ + OFCondition l_error = getStringFromNameComponents(lastName, firstName, middleName, namePrefix, nameSuffix, dicomName); + /* put element value */ + if (l_error.good()) + l_error = putOFStringArray(dicomName); + return l_error; +} + + +// ******************************** + + +OFCondition DcmPersonName::checkStringValue(const OFString &value, + const OFString &vm, + const OFString &charset) +{ + /* currently not checked: maximum length per component group (64 characters) */ + OFCondition result = EC_Normal; + const size_t valLen = value.length(); + if (valLen > 0) + { + size_t posStart = 0; + unsigned long vmNum = 0; + /* iterate over all value components */ + while (posStart != OFString_npos) + { + ++vmNum; + /* search for next component separator */ + const size_t posEnd = value.find('\\', posStart); + const size_t length = (posEnd == OFString_npos) ? valLen - posStart : posEnd - posStart; + if (dcmEnableVRCheckerForStringValues.get()) + { + /* check for non-ASCII characters (if default character set used) */ + if (charset.empty() || (charset == "ISO_IR 6")) + { + if (DcmByteString::containsExtendedCharacters(value.c_str() + posStart, length)) + { + result = EC_InvalidCharacter; + break; + } + } + /* currently, the VR checker only supports ASCII and Latin-1 */ + if (charset.empty() || (charset == "ISO_IR 6") || (charset == "ISO_IR 100")) + { + /* check value representation (VR) */ + const int vrID = DcmElement::scanValue(value, "pn", posStart, length); + if (vrID != 11) + { + result = EC_ValueRepresentationViolated; + break; + } + } + } + posStart = (posEnd == OFString_npos) ? posEnd : posEnd + 1; + } + if (result.good() && !vm.empty()) + { + /* check value multiplicity (VM) */ + result = DcmElement::checkVM(vmNum, vm); + } + } + return result; +} + + +// ******************************** + + +const OFString& DcmPersonName::getDelimiterChars() const +{ + return DcmVR(EVR_PN).getDelimiterChars(); +} diff --git a/dcmdata/libsrc/dcvrpobw.cc b/dcmdata/libsrc/dcvrpobw.cc new file mode 100644 index 00000000..67df5ee2 --- /dev/null +++ b/dcmdata/libsrc/dcvrpobw.cc @@ -0,0 +1,406 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andreas Barth + * + * Purpose: + * class DcmPolymorphOBOW for Tags that can change their VR + * between OB and OW (e.g. Tag PixelData, OverlayData). This class shall + * not be used directly in applications. No identification exists. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcvrpobw.h" + +DcmPolymorphOBOW::DcmPolymorphOBOW( + const DcmTag & tag, + const Uint32 len) + : DcmOtherByteOtherWord(tag, len), + changeVR(OFFalse), + currentVR(EVR_OW) +{ + if (getTag().getEVR() == EVR_ox || getTag().getEVR() == EVR_lt) setTagVR(EVR_OW); +} + +DcmPolymorphOBOW::DcmPolymorphOBOW(const DcmPolymorphOBOW & oldObj) +: DcmOtherByteOtherWord(oldObj) +, changeVR(oldObj.changeVR) +, currentVR(oldObj.currentVR) +{ +} + +DcmPolymorphOBOW::~DcmPolymorphOBOW() +{ +} + +DcmPolymorphOBOW &DcmPolymorphOBOW::operator=(const DcmPolymorphOBOW & obj) +{ + if (this != &obj) + { + DcmOtherByteOtherWord::operator=(obj); + changeVR = obj.changeVR; + currentVR = obj.currentVR; + } + return *this; +} + +int DcmPolymorphOBOW::compare(const DcmElement& rhs) const +{ + /* check tag and VR */ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmPolymorphOBOW* myThis = NULL; + DcmPolymorphOBOW* myRhs = NULL; + myThis = OFconst_cast(DcmPolymorphOBOW*, this); + myRhs = OFstatic_cast(DcmPolymorphOBOW*, OFconst_cast(DcmElement*, &rhs)); + + /* compare length */ + Uint32 myLength = myThis->getLength(); + Uint32 rhsLength = myRhs->getLength(); + if (myLength < rhsLength) + return -1; + else if (myLength > rhsLength) + return 1; + /* finally check whether values are the same */ + else + { + // Get values, always compare in Little Endian byte order (only relevant for OW) + void* myValue = myThis->getValue(EBO_LittleEndian); + void* rhsValue = myRhs->getValue(EBO_LittleEndian); + result = memcmp(myValue, rhsValue, myLength); + if (result < 0) + return -1; + else if (result > 0) + return 1; + else + return 0; + } + /* we never get here */ +} + +OFCondition DcmPolymorphOBOW::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmPolymorphOBOW &, rhs); + } + return EC_Normal; +} + +OFCondition +DcmPolymorphOBOW::getUint8Array( + Uint8 * & bytes) +{ + errorFlag = EC_Normal; + OFBool bchangeVR = OFFalse; + if (currentVR == EVR_OW) + { + if (getByteOrder() == EBO_BigEndian) + { + swapValueField(sizeof(Uint16)); + setByteOrder(EBO_LittleEndian); + } + if (getTag().getEVR() == EVR_OW) + { + bchangeVR = OFTrue; + setTagVR(EVR_OB); + currentVR = EVR_OB; + } + } + bytes = OFstatic_cast(Uint8 *, this -> getValue()); + if (bchangeVR) + setTagVR(EVR_OW); + + return errorFlag; +} + + +OFCondition +DcmPolymorphOBOW::getUint16Array( + Uint16 * & words) +{ + errorFlag = EC_Normal; + OFBool bchangeVR = OFFalse; + if (currentVR == EVR_OB) + { + setByteOrder(EBO_LittleEndian); + currentVR = EVR_OW; + if (getTag().getEVR() == EVR_OB) + { + setTagVR(EVR_OW); + bchangeVR = OFTrue; + } + } + words = OFstatic_cast(Uint16 *, this -> getValue()); + if (bchangeVR) + setTagVR(EVR_OB); + + return errorFlag; +} + +OFCondition +DcmPolymorphOBOW::createUint8Array( + const Uint32 numBytes, + Uint8 * & bytes) +{ + currentVR = EVR_OB; + setTagVR(EVR_OB); + errorFlag = createEmptyValue(OFstatic_cast(Uint32, sizeof(Uint8) * OFstatic_cast(size_t, numBytes))); + setByteOrder(gLocalByteOrder); + if (EC_Normal == errorFlag) + bytes = OFstatic_cast(Uint8 *, this->getValue()); + else + bytes = NULL; + return errorFlag; +} + + +OFCondition +DcmPolymorphOBOW::createUint16Array( + const Uint32 numWords, + Uint16 * & words) +{ + // Check whether input would lead to a buffer allocation of more than + // 4 GB for a value, which is not possible in DICOM. The biggest input + // parameter value permitted is 2147483647, since 2147483647*2 is still + // < 2^32-1 (4 GB). + if (numWords > 2147483647) + { + errorFlag = EC_TooManyBytesRequested; + return errorFlag; + } + currentVR = EVR_OW; + setTagVR(EVR_OW); + errorFlag = createEmptyValue(OFstatic_cast(Uint32, sizeof(Uint16) * OFstatic_cast(size_t, numWords))); + setByteOrder(gLocalByteOrder); + if (EC_Normal == errorFlag) + words = OFstatic_cast(Uint16 *, this->getValue()); + else + words = NULL; + return errorFlag; +} + + +OFCondition +DcmPolymorphOBOW::putUint8Array( + const Uint8 * byteValue, + const unsigned long numBytes) +{ + errorFlag = EC_Normal; + currentVR = getTag().getEVR(); + if (numBytes) + { + if (byteValue) + { + // Check if more than 4 GB is requested, which is the maximum + // length DICOM can handle. Take into account that the alignValue() + // call adds a byte if an odd length is provided, thus, 4294967295 + // would not work. + if (numBytes > 4294967294UL) + { + errorFlag = EC_TooManyBytesRequested; + return errorFlag; + } + errorFlag = putValue(byteValue, OFstatic_cast(Uint32, sizeof(Uint8) * OFstatic_cast(size_t, numBytes))); + if (errorFlag == EC_Normal) + { + if (getTag().getEVR() == EVR_OW && getByteOrder() == EBO_BigEndian) + setByteOrder(EBO_LittleEndian); + this -> alignValue(); + } + } + else + errorFlag = EC_CorruptedData; + + } + else + this -> putValue(NULL, 0); + + return errorFlag; +} + + +OFCondition +DcmPolymorphOBOW::putUint16Array( + const Uint16 * wordValue, + const unsigned long numWords) +{ + errorFlag = EC_Normal; + currentVR = getTag().getEVR(); + if (numWords) + { + if (wordValue) + { + // Check whether input would lead to a buffer allocation of more than + // 4 GB for a value, which is not possible in DICOM. The biggest input + // parameter value permitted is 2147483647, since 2147483647*2 is still + // < 2^32-1 (4 GB). + if (numWords > 2147483647) + { + errorFlag = EC_TooManyBytesRequested; + return EC_TooManyBytesRequested; + } + errorFlag = putValue(wordValue, OFstatic_cast(Uint32, sizeof(Uint16) * OFstatic_cast(size_t, numWords))); + if (errorFlag == EC_Normal && + getTag().getEVR() == EVR_OB && getByteOrder() == EBO_BigEndian) + { + swapValueField(sizeof(Uint16)); + setByteOrder(EBO_LittleEndian); + } + } + else + errorFlag = EC_CorruptedData; + } + else + errorFlag = this -> putValue(NULL, 0); + + return errorFlag; +} + + +OFCondition +DcmPolymorphOBOW::read( + DcmInputStream & inStream, + const E_TransferSyntax ixfer, + const E_GrpLenEncoding glenc, + const Uint32 maxReadLength) +{ + OFCondition l_error = + DcmOtherByteOtherWord::read(inStream, ixfer, glenc, maxReadLength); + + if (getTransferState() == ERW_ready) + currentVR = getTag().getEVR(); + + return l_error; +} + +void +DcmPolymorphOBOW::transferEnd() +{ + changeVR = OFFalse; + DcmOtherByteOtherWord::transferEnd(); +} + +void +DcmPolymorphOBOW::transferInit() +{ + changeVR = OFFalse; + DcmOtherByteOtherWord::transferInit(); +} + +OFCondition DcmPolymorphOBOW::write( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + DcmXfer oXferSyn(oxfer); + if (getTransferState() == ERW_init) + { + if (getTag().getEVR() == EVR_OB && oXferSyn.isImplicitVR()) + { + // This element was read or created as OB, but we are writing in + // implicit VR transfer syntax (which always uses OW). Therefore, + // change the VR associated with the tag to OW. + setTagVR(EVR_OW); + + // If the data is currently in OB representation in memory, + // adjust the VR to OW and update the current byte order. + // OB data is equivalent to OW data in little endian byte order. + if (currentVR == EVR_OB) + { + setByteOrder(EBO_LittleEndian); + currentVR = EVR_OW; + } + + // remember that we have changed the VR associated with the tag + changeVR = OFTrue; + } + + else if (getTag().getEVR() == EVR_OW && currentVR == EVR_OB) + { + // the element was originally read/created as OW + // but is currently in OB format. Change back to OW. + + // OB data is equivalent to OW data in little endian byte order. + setByteOrder(EBO_LittleEndian); + currentVR = EVR_OW; + } + } + errorFlag = DcmOtherByteOtherWord::write(outStream, oxfer, enctype, wcache); + if (getTransferState() == ERW_ready && changeVR) + { + // Change the VR associated with the tag + // (not the current VR!) back from OW to OB + setTagVR(EVR_OB); + } + return errorFlag; +} + +OFCondition DcmPolymorphOBOW::writeSignatureFormat( + DcmOutputStream &outStream, + const E_TransferSyntax oxfer, + const E_EncodingType enctype, + DcmWriteCache *wcache) +{ + DcmXfer oXferSyn(oxfer); + if (getTransferState() == ERW_init) + { + if (getTag().getEVR() == EVR_OB && oXferSyn.isImplicitVR()) + { + // This element was read or created as OB, but we are writing in + // implicit VR transfer syntax (which always uses OW). Therefore, + // change the VR associated with the tag to OW. + setTagVR(EVR_OW); + + // If the data is currently in OB representation in memory, + // adjust the VR to OW and update the current byte order. + // OB data is equivalent to OW data in little endian byte order. + if (currentVR == EVR_OB) + { + setByteOrder(EBO_LittleEndian); + currentVR = EVR_OW; + } + + // remember that we have changed the VR associated with the tag + changeVR = OFTrue; + } + + else if (getTag().getEVR() == EVR_OW && currentVR == EVR_OB) + { + // the element was originally read/created as OW + // but is currently in OB format. Change back to OW. + + // OB data is equivalent to OW data in little endian byte order. + setByteOrder(EBO_LittleEndian); + currentVR = EVR_OW; + } + } + errorFlag = DcmOtherByteOtherWord::writeSignatureFormat(outStream, oxfer, enctype, wcache); + if (getTransferState() == ERW_ready && changeVR) + { + // Change the VR associated with the tag + // (not the current VR!) back from OW to OB + setTagVR(EVR_OB); + } + return errorFlag; +} diff --git a/dcmdata/libsrc/dcvrsh.cc b/dcmdata/libsrc/dcvrsh.cc new file mode 100644 index 00000000..549e7f7f --- /dev/null +++ b/dcmdata/libsrc/dcvrsh.cc @@ -0,0 +1,163 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: Implementation of class DcmShortString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcjson.h" + + +// ******************************** + + +DcmShortString::DcmShortString(const DcmTag &tag, + const Uint32 len) + : DcmCharString(tag, len) +{ + setMaxLength(16); + setNonSignificantChars(" \\"); +} + + +DcmShortString::DcmShortString(const DcmShortString &old) + : DcmCharString(old) +{ +} + + +DcmShortString::~DcmShortString() +{ +} + + +DcmShortString &DcmShortString::operator=(const DcmShortString &obj) +{ + DcmCharString::operator=(obj); + return *this; +} + + +OFCondition DcmShortString::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmShortString &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmShortString::ident() const +{ + return EVR_SH; +} + + +OFCondition DcmShortString::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + { + OFString charset; + /* try to determine the value of the SpecificCharacterSet element */ + if (getSpecificCharacterSet(charset) == EC_CorruptedData) + charset = "UNKNOWN"; + l_error = DcmShortString::checkStringValue(strVal, vm, charset); + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmShortString::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmCharString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmShortString::checkStringValue(const OFString &value, + const OFString &vm, + const OFString &charset) +{ + return DcmByteString::checkStringValue(value, vm, "lo", 12, 0 /* maxLen: no check */, charset); +} + + +// ******************************** + + +OFCondition DcmShortString::writeJson(STD_NAMESPACE ostream &out, + DcmJsonFormat &format) +{ + /* always write JSON Opener */ + DcmElement::writeJsonOpener(out, format); + /* write element value (if non-empty) */ + if (!isEmpty()) + { + OFString value; + OFCondition status = getOFString(value, 0L); + if (status.bad()) + return status; + format.printValuePrefix(out); + DcmJsonFormat::printValueString(out, value); + const unsigned long vm = getVM(); + for (unsigned long valNo = 1; valNo < vm; ++valNo) + { + status = getOFString(value, valNo); + if (status.bad()) + return status; + format.printNextArrayElementPrefix(out); + DcmJsonFormat::printValueString(out, value); + } + format.printValueSuffix(out); + } + /* write JSON Closer */ + DcmElement::writeJsonCloser(out, format); + /* always report success */ + return EC_Normal; +} + + +// ******************************** + + +const OFString& DcmShortString::getDelimiterChars() const +{ + return DcmVR(EVR_SH).getDelimiterChars(); +} diff --git a/dcmdata/libsrc/dcvrsl.cc b/dcmdata/libsrc/dcvrsl.cc new file mode 100644 index 00000000..d4dc35f9 --- /dev/null +++ b/dcmdata/libsrc/dcvrsl.cc @@ -0,0 +1,410 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmSignedLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrsl.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmSignedLong::DcmSignedLong(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmSignedLong::DcmSignedLong(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmSignedLong::DcmSignedLong(const DcmSignedLong &old) + : DcmElement(old) +{ +} + + +DcmSignedLong::~DcmSignedLong() +{ +} + + +DcmSignedLong &DcmSignedLong::operator=(const DcmSignedLong &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmSignedLong::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmSignedLong* myThis = NULL; + DcmSignedLong* myRhs = NULL; + myThis = OFconst_cast(DcmSignedLong*, this); + myRhs = OFstatic_cast(DcmSignedLong*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + Sint32 val = 0; + if (myThis->getSint32(val, count).good()) + { + Sint32 rhsVal = 0; + if (myRhs->getSint32(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + /* otherwise they are equal, continue comparison */ + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmSignedLong::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmSignedLong &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmSignedLong::ident() const +{ + return EVR_SL; +} + + +OFCondition DcmSignedLong::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmSignedLong::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmSignedLong::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Sint32)); +} + + +// ******************************** + + +void DcmSignedLong::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get signed integer data */ + Sint32 *sintVals; + errorFlag = getSint32Array(sintVals); + if (sintVals != NULL) + { + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[32]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, sintVals++) + { + /* check whether first value is printed (omit delimiter) */ +#ifdef PRId32 + if (i == 0) + sprintf(buffer, "%" PRId32, *sintVals); + else + sprintf(buffer, "\\%" PRId32, *sintVals); +#elif SIZEOF_LONG == 8 + if (i == 0) + sprintf(buffer, "%d", *sintVals); + else + sprintf(buffer, "\\%d", *sintVals); +#else + if (i == 0) + sprintf(buffer, "%ld", *sintVals); + else + sprintf(buffer, "\\%ld", *sintVals); +#endif + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than four bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmSignedLong::getSint32(Sint32 &sintVal, + const unsigned long pos) +{ + /* get signed integer data */ + Sint32 *sintValues = NULL; + errorFlag = getSint32Array(sintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (sintValues == NULL) + errorFlag = EC_IllegalCall; + else if (pos >= getVM()) + errorFlag = EC_IllegalParameter; + else + sintVal = sintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + sintVal = 0; + return errorFlag; +} + + +OFCondition DcmSignedLong::getSint32Array(Sint32 *&sintVals) +{ + sintVals = OFstatic_cast(Sint32 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedLong::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + Sint32 sintVal; + /* get the specified numeric value */ + errorFlag = getSint32(sintVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[32]; + sprintf(buffer, "%li", OFstatic_cast(long, sintVal)); + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedLong::putSint32(const Sint32 sintVal, + const unsigned long pos) +{ + Sint32 val = sintVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Sint32) * pos), OFstatic_cast(Uint32, sizeof(Sint32))); + return errorFlag; +} + + +OFCondition DcmSignedLong::putSint32Array(const Sint32 *sintVals, + const unsigned long numSints) +{ + errorFlag = EC_Normal; + if (numSints > 0) + { + /* check for valid data */ + if (sintVals != NULL) + errorFlag = putValue(sintVals, OFstatic_cast(Uint32, sizeof(Sint32) * OFstatic_cast(size_t, numSints))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedLong::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmSignedLong::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Sint32 *field = new Sint32[vm]; + OFString value; + size_t pos = 0; + /* retrieve signed integer data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (value.empty() || +#ifdef SCNd32 + (sscanf(value.c_str(), "%" SCNd32, &field[i]) != 1) +#elif SIZEOF_LONG == 8 + (sscanf(value.c_str(), "%d", &field[i]) != 1) +#else + (sscanf(value.c_str(), "%ld", &field[i]) != 1) +#endif + ) + { + errorFlag = EC_CorruptedData; + } + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putSint32Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedLong::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Sint32)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Sint32)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} + + +OFBool DcmSignedLong::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + if (ident() == candidate.ident()) + { + // some const casts to call the getter functions, I do not modify the values, I promise! + DcmSignedLong& key = OFconst_cast(DcmSignedLong&,*this); + DcmElement& can = OFconst_cast(DcmElement&,candidate); + Sint32 a, b; + for( unsigned long ui = 0; ui < key.getVM(); ++ui ) + for( unsigned long uj = 0; uj < can.getVM(); ++uj ) + if( key.getSint32( a, ui ).good() && can.getSint32( b, uj ).good() && a == b ) + return OFTrue; + return key.getVM() == 0; + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcvrss.cc b/dcmdata/libsrc/dcvrss.cc new file mode 100644 index 00000000..ba0665d2 --- /dev/null +++ b/dcmdata/libsrc/dcvrss.cc @@ -0,0 +1,387 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmSignedShort + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrss.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmSignedShort::DcmSignedShort(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmSignedShort::DcmSignedShort(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmSignedShort::DcmSignedShort(const DcmSignedShort &old) + : DcmElement(old) +{ +} + + +DcmSignedShort::~DcmSignedShort() +{ +} + + +DcmSignedShort &DcmSignedShort::operator=(const DcmSignedShort &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmSignedShort::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmSignedShort* myThis = NULL; + DcmSignedShort* myRhs = NULL; + myThis = OFconst_cast(DcmSignedShort*, this); + myRhs = OFstatic_cast(DcmSignedShort*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long rhisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (rhisNumValues < rhsNumValues) + { + return -1; + } + else if (rhisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < rhisNumValues; count++) + { + Sint16 val = 0; + if (myThis->getSint16(val, count).good()) + { + Sint16 rhsVal = 0; + if (myRhs->getSint16(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + /* otherwise they are equal, continue comparison */ + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmSignedShort::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmSignedShort &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmSignedShort::ident() const +{ + return EVR_SS; +} + + +OFCondition DcmSignedShort::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmSignedShort::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmSignedShort::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Sint16)); +} + + +// ******************************** + + +void DcmSignedShort::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get signed integer data */ + Sint16 *sintVals; + errorFlag = getSint16Array(sintVals); + if (sintVals != NULL) + { + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[32]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, sintVals++) + { + /* check whether first value is printed (omit delimiter) */ + if (i == 0) + sprintf(buffer, "%hd", *sintVals); + else + sprintf(buffer, "\\%hd", *sintVals); + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than two bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmSignedShort::getSint16(Sint16 &sintVal, + const unsigned long pos) +{ + /* get signed integer data */ + Sint16 *sintValues = NULL; + errorFlag = getSint16Array(sintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (sintValues == NULL) + errorFlag = EC_IllegalCall; + else if (pos >= getVM()) + errorFlag = EC_IllegalParameter; + else + sintVal = sintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + sintVal = 0; + return errorFlag; +} + + +OFCondition DcmSignedShort::getSint16Array(Sint16 *&sintVals) +{ + sintVals = OFstatic_cast(Sint16 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedShort::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + Sint16 sintVal; + /* get the specified numeric value */ + errorFlag = getSint16(sintVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[32]; + sprintf(buffer, "%i", sintVal); + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedShort::putSint16(const Sint16 sintVal, + const unsigned long pos) +{ + Sint16 val = sintVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Sint16) * pos), OFstatic_cast(Uint32, sizeof(Sint16))); + return errorFlag; +} + + +OFCondition DcmSignedShort::putSint16Array(const Sint16 *sintVals, + const unsigned long numSints) +{ + errorFlag = EC_Normal; + if (numSints > 0) + { + /* check for valid data */ + if (sintVals != NULL) + errorFlag = putValue(sintVals, OFstatic_cast(Uint32, sizeof(Sint16) * OFstatic_cast(size_t, numSints))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedShort::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmSignedShort::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Sint16 *field = new Sint16[vm]; + OFString value; + size_t pos = 0; + /* retrieve signed integer data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (value.empty() || (sscanf(value.c_str(), "%hd", &field[i]) != 1)) + errorFlag = EC_CorruptedData; + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putSint16Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSignedShort::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Sint16)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Sint16)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} + + +OFBool DcmSignedShort::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + if (ident() == candidate.ident()) + { + // some const casts to call the getter functions, I do not modify the values, I promise! + DcmSignedShort& key = OFconst_cast(DcmSignedShort&,*this); + DcmElement& can = OFconst_cast(DcmElement&,candidate); + Sint16 a, b; + for( unsigned long ui = 0; ui < key.getVM(); ++ui ) + for( unsigned long uj = 0; uj < can.getVM(); ++uj ) + if( key.getSint16( a, ui ).good() && can.getSint16( b, uj ).good() && a == b ) + return OFTrue; + return key.getVM() == 0; + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcvrst.cc b/dcmdata/libsrc/dcvrst.cc new file mode 100644 index 00000000..bddf17e9 --- /dev/null +++ b/dcmdata/libsrc/dcvrst.cc @@ -0,0 +1,166 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: Implementation of class DcmShortText + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrst.h" + + +// ******************************** + + +DcmShortText::DcmShortText(const DcmTag &tag, + const Uint32 len) + : DcmCharString(tag, len) +{ + setMaxLength(1024); +} + + +DcmShortText::DcmShortText(const DcmShortText &old) + : DcmCharString(old) +{ +} + + +DcmShortText::~DcmShortText() +{ +} + + +DcmShortText &DcmShortText::operator=(const DcmShortText &obj) +{ + DcmCharString::operator=(obj); + return *this; +} + + +int DcmShortText::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmShortText* myThis = NULL; + DcmShortText* myRhs = NULL; + myThis = OFconst_cast(DcmShortText*, this); + myRhs = OFstatic_cast(DcmShortText*, OFconst_cast(DcmElement*, &rhs)); + + /* compare length */ + unsigned long thisLength = myThis->getLength(); + unsigned long rhsLength = myRhs->getLength(); + if (thisLength < rhsLength) + { + return -1; + } + else if (thisLength > rhsLength) + { + return 1; + } + + /* check whether values are equal */ + OFString thisValue, rhsValue; + myThis->getOFStringArray(thisValue); + myThis->getOFStringArray(rhsValue); + return thisValue.compare(rhsValue); +} + + +OFCondition DcmShortText::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmShortText &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmShortText::ident() const +{ + return EVR_ST; +} + + +OFCondition DcmShortText::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + { + OFString charset; + /* try to determine the value of the SpecificCharacterSet element */ + if (getSpecificCharacterSet(charset) == EC_CorruptedData) + charset = "UNKNOWN"; + l_error = DcmShortText::checkStringValue(strVal, charset); + } + return l_error; +} + + +unsigned long DcmShortText::getVM() +{ + /* value multiplicity is 1 for non-empty string, 0 otherwise */ + return (getRealLength() > 0) ? 1 : 0; +} + + +// ******************************** + + +OFCondition DcmShortText::getOFString(OFString &stringVal, + const unsigned long /*pos*/, + OFBool normalize) +{ + /* treat backslash as a normal character */ + return getOFStringArray(stringVal, normalize); +} + + +OFCondition DcmShortText::getOFStringArray(OFString &stringVal, + OFBool normalize) +{ + /* get string value without handling the "\" as a delimiter */ + OFCondition l_error = getStringValue(stringVal); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmShortText::checkStringValue(const OFString &value, + const OFString &charset) +{ + return DcmByteString::checkStringValue(value, "" /* vm */, "lt", 14, 0 /* maxLen: no check */, charset); +} diff --git a/dcmdata/libsrc/dcvrsv.cc b/dcmdata/libsrc/dcvrsv.cc new file mode 100644 index 00000000..6360a570 --- /dev/null +++ b/dcmdata/libsrc/dcvrsv.cc @@ -0,0 +1,396 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmSigned64bitVeryLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrsv.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmSigned64bitVeryLong::DcmSigned64bitVeryLong(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmSigned64bitVeryLong::DcmSigned64bitVeryLong(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmSigned64bitVeryLong::DcmSigned64bitVeryLong(const DcmSigned64bitVeryLong &old) + : DcmElement(old) +{ +} + + +DcmSigned64bitVeryLong::~DcmSigned64bitVeryLong() +{ +} + + +DcmSigned64bitVeryLong &DcmSigned64bitVeryLong::operator=(const DcmSigned64bitVeryLong &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmSigned64bitVeryLong::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmSigned64bitVeryLong* myThis = NULL; + DcmSigned64bitVeryLong* myRhs = NULL; + myThis = OFconst_cast(DcmSigned64bitVeryLong*, this); + myRhs = OFstatic_cast(DcmSigned64bitVeryLong*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + Sint64 val = 0; + if (myThis->getSint64(val, count).good()) + { + Sint64 rhsVal = 0; + if (myRhs->getSint64(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + /* otherwise they are equal, continue comparison */ + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmSigned64bitVeryLong::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmSigned64bitVeryLong &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmSigned64bitVeryLong::ident() const +{ + return EVR_SV; +} + + +OFCondition DcmSigned64bitVeryLong::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmSigned64bitVeryLong::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmSigned64bitVeryLong::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Sint64)); +} + + +// ******************************** + + +void DcmSigned64bitVeryLong::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get signed integer data */ + Sint64 *sintVals; + errorFlag = getSint64Array(sintVals); + if (sintVals != NULL) + { + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[32]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, sintVals++) + { + /* check whether first value is printed (omit delimiter) */ +#ifdef PRId64 + if (i == 0) + sprintf(buffer, "%" PRId64, *sintVals); + else + sprintf(buffer, "\\%" PRId64, *sintVals); +#elif SIZEOF_LONG == 8 + if (i == 0) + sprintf(buffer, "%ld", *sintVals); + else + sprintf(buffer, "\\%ld", *sintVals); +#else // assume "long long" is 64 bits + if (i == 0) + sprintf(buffer, "%lld", *sintVals); + else + sprintf(buffer, "\\%lld", *sintVals); +#endif + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than eight bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmSigned64bitVeryLong::getSint64(Sint64 &sintVal, + const unsigned long pos) +{ + /* get signed integer data */ + Sint64 *sintValues = NULL; + errorFlag = getSint64Array(sintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (sintValues == NULL) + errorFlag = EC_IllegalCall; + else if (pos >= getVM()) + errorFlag = EC_IllegalParameter; + else + sintVal = sintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + sintVal = 0; + return errorFlag; +} + + +OFCondition DcmSigned64bitVeryLong::getSint64Array(Sint64 *&sintVals) +{ + sintVals = OFstatic_cast(Sint64 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSigned64bitVeryLong::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + Sint64 sintVal; + /* get the specified numeric value */ + errorFlag = getSint64(sintVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[32]; +#ifdef PRId64 + sprintf(buffer, "%" PRId64, sintVal); +#elif SIZEOF_LONG == 8 + sprintf(buffer, "%ld", sintVal); +#else // assume "long long" is 64 bits + sprintf(buffer, "%lld", sintVal); +#endif + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSigned64bitVeryLong::putSint64(const Sint64 sintVal, + const unsigned long pos) +{ + Sint64 val = sintVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Sint64) * pos), OFstatic_cast(Uint32, sizeof(Sint64))); + return errorFlag; +} + + +OFCondition DcmSigned64bitVeryLong::putSint64Array(const Sint64 *sintVals, + const unsigned long numSints) +{ + errorFlag = EC_Normal; + if (numSints > 0) + { + /* check for valid data */ + if (sintVals != NULL) + errorFlag = putValue(sintVals, OFstatic_cast(Uint32, sizeof(Sint64) * OFstatic_cast(size_t, numSints))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSigned64bitVeryLong::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmSigned64bitVeryLong::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Sint64 *field = new Sint64[vm]; + OFString value; + size_t pos = 0; + /* retrieve signed integer data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (value.empty() || +#ifdef SCNd64 + (sscanf(value.c_str(), "%" SCNd64, &field[i]) != 1) +#elif SIZEOF_LONG == 8 + (sscanf(value.c_str(), "%ld", &field[i]) != 1) +#else // assume "long long" is 64 bits + (sscanf(value.c_str(), "%lld", &field[i]) != 1) +#endif + ) + { + errorFlag = EC_CorruptedData; + } + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putSint64Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmSigned64bitVeryLong::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Sint64)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Sint64)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcvrtm.cc b/dcmdata/libsrc/dcvrtm.cc new file mode 100644 index 00000000..4ea654b4 --- /dev/null +++ b/dcmdata/libsrc/dcvrtm.cc @@ -0,0 +1,515 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Joerg Riesmeier + * + * Purpose: Implementation of class DcmTime + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/dcmdata/dcmatch.h" + + +#define MAX_TM_LENGTH 16 + + +// ******************************** + + +DcmTime::DcmTime(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(MAX_TM_LENGTH); + setNonSignificantChars("\\"); +} + + +DcmTime::DcmTime(const DcmTime &old) + : DcmByteString(old) +{ +} + + +DcmTime::~DcmTime() +{ +} + + +DcmTime &DcmTime::operator=(const DcmTime &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmTime::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmTime &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmTime::ident() const +{ + return EVR_TM; +} + + +OFCondition DcmTime::checkValue(const OFString &vm, + const OFBool oldFormat) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmTime::checkStringValue(strVal, vm, oldFormat); + return l_error; +} + + +// ******************************** + + +OFCondition DcmTime::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmTime::getOFTime(OFTime &timeValue, + const unsigned long pos, + const OFBool supportOldFormat) +{ + OFString dicomTime; + /* convert the current element value to OFTime format */ + OFCondition l_error = getOFString(dicomTime, pos); + if (l_error.good()) + l_error = getOFTimeFromString(dicomTime, timeValue, supportOldFormat); + else + timeValue.clear(); + return l_error; +} + + +OFCondition DcmTime::getISOFormattedTime(OFString &formattedTime, + const unsigned long pos, + const OFBool seconds, + const OFBool fraction, + const OFBool createMissingPart, + const OFBool supportOldFormat) +{ + OFString dicomTime; + /* get current element value and convert to ISO formatted time */ + OFCondition l_error = getOFString(dicomTime, pos); + if (l_error.good()) + l_error = getISOFormattedTimeFromString(dicomTime, formattedTime, seconds, fraction, createMissingPart, supportOldFormat); + else + formattedTime.clear(); + return l_error; +} + + +OFCondition DcmTime::setCurrentTime(const OFBool seconds, + const OFBool fraction) +{ + OFString dicomTime; + /* set the element value to the current system time */ + OFCondition l_error = getCurrentTime(dicomTime, seconds, fraction); + if (l_error.good()) + l_error = putOFStringArray(dicomTime); + return l_error; +} + + +OFCondition DcmTime::setOFTime(const OFTime &timeValue) +{ + OFString dicomTime; + /* convert OFTime value to DICOM TM format and set the element value */ + OFCondition l_error = getDicomTimeFromOFTime(timeValue, dicomTime); + if (l_error.good()) + l_error = putOFStringArray(dicomTime); + return l_error; +} + + +// ******************************** + + +OFCondition DcmTime::getCurrentTime(OFString &dicomTime, + const OFBool seconds, + const OFBool fraction) +{ + OFCondition l_error = EC_IllegalCall; + OFTime timeValue; + /* get the current system time */ + if (timeValue.setCurrentTime()) + { + /* format: HHMM[SS[.FFFFFF]] */ + if (timeValue.getISOFormattedTime(dicomTime, seconds, fraction, OFFalse /*timeZone*/, OFFalse /*showDelimiter*/)) + l_error = EC_Normal; + } + /* set default time if an error occurred */ + if (l_error.bad()) + { + /* if the current system time cannot be retrieved create a valid default time */ + if (seconds) + { + if (fraction) + { + /* format: HHMMSS.FFFFFF */ + dicomTime = "000000.000000"; + } else { + /* format: HHMMS */ + dicomTime = "000000"; + } + } else { + /* format: HHMM */ + dicomTime = "0000"; + } + } + return l_error; +} + + +OFCondition DcmTime::getDicomTimeFromOFTime(const OFTime &timeValue, + OFString &dicomTime, + const OFBool seconds, + const OFBool fraction) +{ + OFCondition l_error = EC_IllegalParameter; + /* convert OFTime value to DICOM TM format */ + if (timeValue.getISOFormattedTime(dicomTime, seconds, fraction, OFFalse /*timeZone*/, OFFalse /*showDelimiter*/)) + l_error = EC_Normal; + return l_error; +} + +OFCondition DcmTime::getOFTimeFromString(const OFString &dicomTime, + OFTime &timeValue) +{ + return getOFTimeFromString(dicomTime.c_str(), dicomTime.size(), timeValue, OFTrue); +} + +OFCondition DcmTime::getOFTimeFromString(const OFString &dicomTime, + OFTime &timeValue, + const OFBool supportOldFormat) +{ + return getOFTimeFromString(dicomTime.c_str(), dicomTime.size(), timeValue, supportOldFormat); +} + +OFCondition DcmTime::getOFTimeFromString(const OFString &dicomTime, + OFTime &timeValue, + const OFBool supportOldFormat, + const double timeZone) +{ + return getOFTimeFromString(dicomTime.c_str(), dicomTime.size(), timeValue, supportOldFormat, timeZone); +} + +OFCondition DcmTime::getOFTimeFromString(const char *dicomTime, + const size_t dicomTimeSize, + OFTime &timeValue) +{ + return getOFTimeFromString(dicomTime, dicomTimeSize, timeValue, OFTrue); +} + +OFCondition DcmTime::getOFTimeFromString(const char *dicomTime, + const size_t dicomTimeSize, + OFTime &timeValue, + const OFBool supportOldFormat) +{ + return getOFTimeFromString(dicomTime, dicomTimeSize, timeValue, supportOldFormat, OFTime::getLocalTimeZone()); +} + +OFCondition DcmTime::getOFTimeFromString(const char *dicomTime, + const size_t dicomTimeSize, + OFTime &timeValue, + const OFBool supportOldFormat, + const double timeZone) +{ + // clear result variable + timeValue.clear(); + // do checks for any valid DICOM time format, before performing any extraction + if (dicomTimeSize < 2 || !OFStandard::checkDigits<2>(dicomTime)) + return EC_IllegalParameter; + unsigned int minutes = 0; + double seconds = 0; + // test for HH[MM[SS[.FFFFFF]]] format + switch (dicomTimeSize) + { + default: + if (dicomTimeSize < 7 || dicomTime[6] != '.' || !parseFragment(dicomTime + 7, dicomTimeSize - 7, seconds)) + break; + case 6: + if (OFStandard::checkDigits<2>(dicomTime + 4)) + seconds += OFStandard::extractDigits(dicomTime + 4); + else + break; + case 4: + if (OFStandard::checkDigits<2>(dicomTime + 2)) + minutes = OFStandard::extractDigits(dicomTime + 2); + else + break; + case 2: + if (timeValue.setTime(OFStandard::extractDigits(dicomTime), minutes, seconds, timeZone)) + return EC_Normal; + else + return EC_IllegalParameter; + } + // test for legacy time format HH[:MM[:SS[.FFFFFF]]], if enabled + if (supportOldFormat && dicomTimeSize >= 5 && dicomTime[2] == ':' && OFStandard::checkDigits<2>(dicomTime + 3)) + { + seconds = 0; + switch (dicomTimeSize) + { + default: + if (dicomTimeSize < 9 || dicomTime[8] != '.' || !parseFragment(dicomTime + 9, dicomTimeSize - 9, seconds)) + break; + case 8: + if (dicomTime[5] == ':' && OFStandard::checkDigits<2>(dicomTime + 6)) + seconds += OFStandard::extractDigits(dicomTime + 6); + else + break; + case 5: + if + ( + timeValue.setTime + ( + OFStandard::extractDigits(dicomTime), + OFStandard::extractDigits(dicomTime + 3), + seconds, + timeZone + ) + ) + { + return EC_Normal; + } + break; + } + } + return EC_IllegalParameter; +} + + +OFCondition DcmTime::getISOFormattedTimeFromString(const OFString &dicomTime, + OFString &formattedTime, + const OFBool seconds, + const OFBool fraction, + const OFBool createMissingPart, + const OFBool supportOldFormat) +{ + OFCondition result = EC_Normal; + if (!dicomTime.empty()) + { + /* minimal check for valid format */ + if (supportOldFormat || (dicomTime.find(":") == OFString_npos)) + { + const size_t length = dicomTime.length(); + /* check for prior V3.0 version of VR=TM: HH:MM:SS.frac */ + const size_t minPos = (supportOldFormat && (length > 2) && (dicomTime[2] == ':')) ? 3 : 2; + const size_t secPos = (supportOldFormat && (length > minPos + 2) && (dicomTime[minPos + 2] == ':')) ? minPos + 3 : minPos + 2; + /* decimal point for fractional seconds */ + const size_t decPoint = dicomTime.find("."); + const size_t decLength = (decPoint != OFString_npos) ? decPoint : length; + OFString hourStr, minStr, secStr, fracStr; + /* hours */ + if (decLength >= 2) + hourStr = dicomTime.substr(0, 2); + else + hourStr = "00"; + /* minutes */ + if (decLength >= minPos + 2) + minStr = dicomTime.substr(minPos, 2); + else + minStr = "00"; + /* seconds */ + if (decLength >= secPos + 2) + secStr = dicomTime.substr(secPos, 2); + else if (createMissingPart) + secStr = "00"; + /* fractional seconds */ + if ((length >= secPos + 4) && (decPoint == secPos + 2)) + { + if (length < secPos + 9) + { + fracStr = dicomTime.substr(secPos + 3); + fracStr.append(secPos + 9 - length, '0'); + } else + fracStr = dicomTime.substr(secPos + 3, 6); + } else if (createMissingPart) + fracStr = "000000"; + /* concatenate time components */ + formattedTime = hourStr; + formattedTime += ":"; + formattedTime += minStr; + if (seconds && !secStr.empty()) + { + formattedTime += ":"; + formattedTime += secStr; + if (fraction && !fracStr.empty()) + { + formattedTime += "."; + formattedTime += fracStr; + } + } + result = EC_Normal; + } else { + /* invalid input format */ + result = EC_IllegalParameter; + } + /* clear the result variable in case of error */ + if (result.bad()) + formattedTime.clear(); + } else { + /* input string is empty, so is the result string */ + formattedTime.clear(); + } + return result; +} + +OFCondition DcmTime::getTimeZoneFromString(const OFString &dicomTimeZone, + double &timeZone) +{ + return getTimeZoneFromString(dicomTimeZone.c_str(), dicomTimeZone.size(), timeZone); +} + +OFCondition DcmTime::getTimeZoneFromString(const char *dicomTimeZone, + const size_t dicomTimeZoneSize, + double &timeZone) +{ + /* init return value */ + timeZone = 0; + /* minimal check for valid format */ + if (dicomTimeZoneSize == 5 && (dicomTimeZone[0] == '+' || dicomTimeZone[0] == '-') && OFStandard::checkDigits<4>(dicomTimeZone + 1)) + { + timeZone = OFstatic_cast(double, (OFStandard::extractDigits(dicomTimeZone + 1))) + + OFstatic_cast(double, (OFStandard::extractDigits(dicomTimeZone + 3))) / 60; + if (dicomTimeZone[0] == '-') + timeZone = -timeZone; + return EC_Normal; + } + return EC_IllegalParameter; +} + + +// ******************************** + +OFBool DcmTime::check(const char* dicomTime, + const size_t dicomTimeSize) +{ + return check(dicomTime, dicomTimeSize, OFFalse); +} + +OFBool DcmTime::check(const char* dicomTime, + const size_t dicomTimeSize, + const OFBool supportOldFormat) +{ + switch (DcmElement::scanValue("tm", dicomTime, dicomTimeSize)) + { + case 4 /* TM */: + return OFTrue; + case 5 /* old style TM */: + return supportOldFormat; + default: + return OFFalse; + } +} + +OFCondition DcmTime::checkStringValue(const OFString &value, + const OFString &vm, + const OFBool oldFormat) +{ + OFCondition result = EC_Normal; + const size_t valLen = value.length(); + if (valLen > 0) + { + size_t posStart = 0; + unsigned long vmNum = 0; + /* iterate over all value components */ + while (posStart != OFString_npos) + { + ++vmNum; + /* search for next component separator */ + const size_t posEnd = value.find('\\', posStart); + const size_t length = (posEnd == OFString_npos) ? valLen - posStart : posEnd - posStart; + /* check length of current value component */ + if (length > MAX_TM_LENGTH) + { + result = EC_MaximumLengthViolated; + break; + } + else if (dcmEnableVRCheckerForStringValues.get()) + { + /* check value representation */ + if (!check(value.data() + posStart, length, oldFormat)) + { + result = EC_ValueRepresentationViolated; + break; + } + } + posStart = (posEnd == OFString_npos) ? posEnd : posEnd + 1; + } + if (result.good() && !vm.empty()) + { + /* check value multiplicity */ + result = DcmElement::checkVM(vmNum, vm); + } + } + return result; +} + +OFBool DcmTime::parseFragment(const char* const string, const size_t size, double& result) +{ + const char* p = string + size - 1; + if (p >= string && OFStandard::checkDigits<1>( p )) + { + result = OFStandard::extractDigits( p ) / 10.0; + while (--p >= string && OFStandard::checkDigits<1>( p )) + result = ( result + OFStandard::extractDigits( p ) ) / 10.0; + return p < string; + } + return OFFalse; +} + + +OFBool DcmTime::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + return DcmAttributeMatching::rangeMatchingTime(key.c_str(), key.length(), candidate.c_str(), candidate.length()); +} diff --git a/dcmdata/libsrc/dcvruc.cc b/dcmdata/libsrc/dcvruc.cc new file mode 100644 index 00000000..d0781b2f --- /dev/null +++ b/dcmdata/libsrc/dcvruc.cc @@ -0,0 +1,117 @@ +/* + * + * Copyright (C) 2015-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmUnlimitedCharacters + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvruc.h" + + +// ******************************** + + +DcmUnlimitedCharacters::DcmUnlimitedCharacters(const DcmTag &tag, + const Uint32 len) + : DcmCharString(tag, len) +{ + setMaxLength(DCM_UndefinedLength); +} + + +DcmUnlimitedCharacters::DcmUnlimitedCharacters(const DcmUnlimitedCharacters &old) + : DcmCharString(old) +{ +} + + +DcmUnlimitedCharacters::~DcmUnlimitedCharacters() +{ +} + + +DcmUnlimitedCharacters &DcmUnlimitedCharacters::operator=(const DcmUnlimitedCharacters &obj) +{ + DcmCharString::operator=(obj); + return *this; +} + + +OFCondition DcmUnlimitedCharacters::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUnlimitedCharacters &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUnlimitedCharacters::ident() const +{ + return EVR_UC; +} + + +OFCondition DcmUnlimitedCharacters::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + { + OFString charset; + /* try to determine the value of the SpecificCharacterSet element */ + if (getSpecificCharacterSet(charset) == EC_CorruptedData) + charset = "UNKNOWN"; + l_error = DcmUnlimitedCharacters::checkStringValue(strVal, vm, charset); + } + return l_error; +} + + +// ******************************** + + +OFCondition DcmUnlimitedCharacters::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmCharString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmUnlimitedCharacters::checkStringValue(const OFString &value, + const OFString &vm, + const OFString &charset) +{ + return DcmByteString::checkStringValue(value, vm, "uc", 20, 0 /* maxLen: no check */, charset); +} diff --git a/dcmdata/libsrc/dcvrui.cc b/dcmdata/libsrc/dcvrui.cc new file mode 100644 index 00000000..c2e5f5ce --- /dev/null +++ b/dcmdata/libsrc/dcvrui.cc @@ -0,0 +1,248 @@ +/* + * + * Copyright (C) 1994-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmUniqueIdentifier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcuid.h" + +#define INCLUDE_CSTRING +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + + +#define MAX_UI_LENGTH 64 + + +// ******************************** + + +DcmUniqueIdentifier::DcmUniqueIdentifier(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + /* padding character is NULL not a space! */ + setPaddingChar('\0'); + setMaxLength(MAX_UI_LENGTH); + setNonSignificantChars("\\"); +} + + +DcmUniqueIdentifier::DcmUniqueIdentifier(const DcmUniqueIdentifier &old) + : DcmByteString(old) +{ +} + + +DcmUniqueIdentifier::~DcmUniqueIdentifier() +{ +} + + +DcmUniqueIdentifier &DcmUniqueIdentifier::operator=(const DcmUniqueIdentifier &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +OFCondition DcmUniqueIdentifier::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUniqueIdentifier &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUniqueIdentifier::ident() const +{ + return EVR_UI; +} + + +OFCondition DcmUniqueIdentifier::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmUniqueIdentifier::checkStringValue(strVal, vm); + return l_error; +} + + +// ******************************** + + +void DcmUniqueIdentifier::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get string data (possibly multi-valued) */ + char *stringVal = NULL; + Uint32 stringLen = 0; + getString(stringVal, stringLen); + if ((stringVal != NULL) && (stringLen > 0)) + { + const char *symbol = NULL; + if (!(flags & DCMTypes::PF_doNotMapUIDsToNames)) + { + /* check whether UID number can be mapped to a UID name */ + symbol = dcmFindNameOfUID(stringVal); + } + if ((symbol != NULL) && (strlen(symbol) > 0)) + { + const size_t bufSize = strlen(symbol) + 1 /* for "=" */ + 1; + char *buffer = new char[bufSize]; + if (buffer != NULL) + { + /* concatenate "=" and the UID name */ + OFStandard::strlcpy(buffer, "=", bufSize); + OFStandard::strlcat(buffer, symbol, bufSize); + printInfoLine(out, flags, level, buffer, NULL /*tag*/, OFFalse /*isInfo*/); + /* delete temporary character buffer */ + delete[] buffer; + } else /* could not allocate buffer */ + DcmByteString::print(out, flags, level); + } else /* no symbol (UID name) found or mapping switched off */ + DcmByteString::print(out, flags, level); + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmUniqueIdentifier::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool normalize) +{ + OFCondition l_error = DcmByteString::getOFString(stringVal, pos, normalize); + if (l_error.good() && normalize) + normalizeString(stringVal, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING, getPaddingChar() /* NULL-byte */); + return l_error; +} + + +// ******************************** + + +OFCondition DcmUniqueIdentifier::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmUniqueIdentifier::putString(const char *stringVal, + const Uint32 stringLen) +{ + const char *uid = stringVal; + Uint32 uidLen = stringLen; + /* check whether parameter contains a UID name instead of a UID number */ + if ((stringVal != NULL) && (stringVal[0] == '=')) + { + uid = dcmFindUIDFromName(stringVal + 1); + uidLen = (uid != NULL) ? OFstatic_cast(Uint32, strlen(uid)) : 0; + } + /* call inherited method to set the UID string */ + return DcmByteString::putString(uid, uidLen); +} + + +// ******************************** + + +OFCondition DcmUniqueIdentifier::makeMachineByteString(const Uint32 length) +{ + /* get string data */ + char *value = OFstatic_cast(char *, getValue()); + /* determine initial string length */ + const size_t len = (length == 0) ? getLengthField() : length; + if ((value != NULL) && (len > 0)) + { + /* check whether string representation is not the internal one */ + if (getStringMode() != DCM_MachineString) + { + /* check whether automatic input data correction is enabled */ + if (dcmEnableAutomaticInputDataCorrection.get()) + { + /* + ** Remove any leading, embedded, or trailing white space. + ** This manipulation attempts to correct problems with + ** incorrectly encoded UIDs which have been observed in + ** some images. + */ + size_t curPos = 0; + for (size_t i = 0; i < len; i++) + { + if (!isspace(OFstatic_cast(unsigned char, value[i]))) + value[curPos++] = value[i]; + } + /* there was at least one space character in the string */ + if (curPos < len) + { + DCMDATA_WARN("DcmUniqueIdentifier: Element " << getTagName() << " " << getTag() + << " contains one or more space characters, which were removed"); + /* remember new length */ + const Uint32 newLen = OFstatic_cast(Uint32, curPos); + /* blank out all trailing characters */ + while (curPos < len) + value[curPos++] = '\0'; + /* call inherited method: re-computes the string length, etc. */ + return DcmByteString::makeMachineByteString(newLen); + } + } + } + } + /* call inherited method: re-computes the string length, etc. */ + return DcmByteString::makeMachineByteString(OFstatic_cast(Uint32, len)); +} + + +// ******************************** + + +OFCondition DcmUniqueIdentifier::checkStringValue(const OFString &value, + const OFString &vm) +{ + return DcmByteString::checkStringValue(value, vm, "ui", 9, MAX_UI_LENGTH); +} diff --git a/dcmdata/libsrc/dcvrul.cc b/dcmdata/libsrc/dcvrul.cc new file mode 100644 index 00000000..aa22f5e0 --- /dev/null +++ b/dcmdata/libsrc/dcvrul.cc @@ -0,0 +1,409 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmUnsignedLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrul.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmUnsignedLong::DcmUnsignedLong(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmUnsignedLong::DcmUnsignedLong(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmUnsignedLong::DcmUnsignedLong(const DcmUnsignedLong &old) + : DcmElement(old) +{ +} + + +DcmUnsignedLong::~DcmUnsignedLong() +{ +} + + +DcmUnsignedLong &DcmUnsignedLong::operator=(const DcmUnsignedLong &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmUnsignedLong::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmUnsignedLong* myThis = NULL; + DcmUnsignedLong* myRhs = NULL; + myThis = OFconst_cast(DcmUnsignedLong*, this); + myRhs = OFstatic_cast(DcmUnsignedLong*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + Uint32 val = 0; + if (myThis->getUint32(val, count).good()) + { + Uint32 rhsVal = 0; + if (myRhs->getUint32(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmUnsignedLong::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUnsignedLong &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUnsignedLong::ident() const +{ + return EVR_UL; +} + + +OFCondition DcmUnsignedLong::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmUnsignedLong::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmUnsignedLong::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Uint32)); +} + + +// ******************************** + + +void DcmUnsignedLong::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get unsigned integer data */ + Uint32 *uintVals; + errorFlag = getUint32Array(uintVals); + if (uintVals != NULL) + { + /* do not use getVM() because derived classes might always return 1 */ + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[32]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, uintVals++) + { + /* check whether first value is printed (omit delimiter) */ + if (i == 0) +#ifdef PRIu32 + sprintf(buffer, "%" PRIu32, *uintVals); + else + sprintf(buffer, "\\%" PRIu32, *uintVals); +#elif SIZEOF_LONG == 8 + sprintf(buffer, "%u", *uintVals); + else + sprintf(buffer, "\\%u", *uintVals); +#else + sprintf(buffer, "%lu", *uintVals); + else + sprintf(buffer, "\\%lu", *uintVals); +#endif + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than four bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmUnsignedLong::getUint32(Uint32 &uintVal, + const unsigned long pos) +{ + /* get unsigned integer data */ + Uint32 *uintValues = NULL; + errorFlag = getUint32Array(uintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (uintValues == NULL) + errorFlag = EC_IllegalCall; + /* do not use getVM() because derived classes might always return 1 */ + else if (pos >= getNumberOfValues()) + errorFlag = EC_IllegalParameter; + else + uintVal = uintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + uintVal = 0; + return errorFlag; +} + + +OFCondition DcmUnsignedLong::getUint32Array(Uint32 *&uintVals) +{ + uintVals = OFstatic_cast(Uint32 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedLong::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + Uint32 uintVal; + /* get the specified numeric value */ + errorFlag = getUint32(uintVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[32]; + sprintf(buffer, "%lu", OFstatic_cast(unsigned long, uintVal)); + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedLong::putUint32(const Uint32 uintVal, + const unsigned long pos) +{ + Uint32 val = uintVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Uint32) * pos), OFstatic_cast(Uint32, sizeof(Uint32))); + return errorFlag; +} + + +OFCondition DcmUnsignedLong::putUint32Array(const Uint32 *uintVals, + const unsigned long numUints) +{ + errorFlag = EC_Normal; + if (numUints > 0) + { + /* check for valid data */ + if (uintVals != NULL) + errorFlag = putValue(uintVals, OFstatic_cast(Uint32, sizeof(Uint32) * OFstatic_cast(size_t, numUints))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedLong::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmUnsignedLong::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Uint32 *field = new Uint32[vm]; + OFString value; + size_t pos = 0; + /* retrieve unsigned integer data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (value.empty() || +#ifdef SCNu32 + (sscanf(value.c_str(), "%" SCNu32, &field[i]) != 1) +#elif SIZEOF_LONG == 8 + (sscanf(value.c_str(), "%u", &field[i]) != 1) +#else + (sscanf(value.c_str(), "%lu", &field[i]) != 1) +#endif + ) + { + errorFlag = EC_CorruptedData; + } + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putUint32Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedLong::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Uint32)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Uint32)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} + + +OFBool DcmUnsignedLong::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + if (ident() == candidate.ident()) + { + // some const casts to call the getter functions, I do not modify the values, I promise! + DcmUnsignedLong& key = OFconst_cast(DcmUnsignedLong&,*this); + DcmElement& can = OFconst_cast(DcmElement&,candidate); + Uint32 a, b; + for( unsigned long ui = 0; ui < key.getVM(); ++ui ) + for( unsigned long uj = 0; uj < can.getVM(); ++uj ) + if( key.getUint32( a, ui ).good() && can.getUint32( b, uj ).good() && a == b ) + return OFTrue; + return key.getVM() == 0; + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcvrulup.cc b/dcmdata/libsrc/dcvrulup.cc new file mode 100644 index 00000000..0086cd5d --- /dev/null +++ b/dcmdata/libsrc/dcvrulup.cc @@ -0,0 +1,138 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmUnsignedLongOffset + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcvrulup.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmUnsignedLongOffset::DcmUnsignedLongOffset(const DcmTag &tag) + : DcmUnsignedLong(tag, 0), + nextRecord(NULL) +{ +} + + +DcmUnsignedLongOffset::DcmUnsignedLongOffset(const DcmTag &tag, + const Uint32 len) + : DcmUnsignedLong(tag, len), + nextRecord(NULL) +{ +} + + +DcmUnsignedLongOffset::DcmUnsignedLongOffset(const DcmUnsignedLongOffset &old) + : DcmUnsignedLong(old), + nextRecord(old.nextRecord) +{ +} + + +DcmUnsignedLongOffset& DcmUnsignedLongOffset::operator=(const DcmUnsignedLongOffset& obj) +{ + if (this != &obj) + { + // copy parent's member variables + DcmUnsignedLong::operator=(obj); + // copy member variables + nextRecord = obj.nextRecord; + } + return *this; +} + + +DcmUnsignedLongOffset::~DcmUnsignedLongOffset() +{ +} + + +OFCondition DcmUnsignedLongOffset::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUnsignedLongOffset &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUnsignedLongOffset::ident() const +{ + /* internal type identifier */ + return EVR_up; +} + + +OFCondition DcmUnsignedLongOffset::clear() +{ + /* call inherited method */ + errorFlag = DcmUnsignedLong::clear(); + /* remove reference to object */ + nextRecord = NULL; + return errorFlag; +} + + +// ******************************** + + +DcmObject* DcmUnsignedLongOffset::getNextRecord() +{ + errorFlag = EC_Normal; + /* return pointer to currently stored object reference */ + return nextRecord; +} + + +DcmObject *DcmUnsignedLongOffset::setNextRecord(DcmObject *record) +{ + errorFlag = EC_Normal; + /* store new object reference */ + nextRecord = record; + return record; +} + + +// ******************************** + + +OFCondition DcmUnsignedLongOffset::verify(const OFBool autocorrect) +{ + /* call inherited method */ + errorFlag = DcmUnsignedLong::verify(autocorrect); + /* perform additional checks on the stored value */ + Uint32 *uintVals; + errorFlag = getUint32Array(uintVals); + if (errorFlag.good() && (getLengthField() > 0) && (uintVals != NULL) && (*uintVals != 0) && (nextRecord == NULL)) + errorFlag = EC_CorruptedData; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcvrur.cc b/dcmdata/libsrc/dcvrur.cc new file mode 100644 index 00000000..258db4d6 --- /dev/null +++ b/dcmdata/libsrc/dcvrur.cc @@ -0,0 +1,191 @@ +/* + * + * Copyright (C) 2014-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmUniversalResourceIdentifierOrLocator + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrur.h" +#include "dcmtk/dcmdata/dcmatch.h" + + +// ******************************** + + +DcmUniversalResourceIdentifierOrLocator::DcmUniversalResourceIdentifierOrLocator(const DcmTag &tag, + const Uint32 len) + : DcmByteString(tag, len) +{ + setMaxLength(DCM_UndefinedLength); +} + + +DcmUniversalResourceIdentifierOrLocator::DcmUniversalResourceIdentifierOrLocator(const DcmUniversalResourceIdentifierOrLocator &old) + : DcmByteString(old) +{ +} + + +DcmUniversalResourceIdentifierOrLocator::~DcmUniversalResourceIdentifierOrLocator() +{ +} + + +DcmUniversalResourceIdentifierOrLocator &DcmUniversalResourceIdentifierOrLocator::operator=(const DcmUniversalResourceIdentifierOrLocator &obj) +{ + DcmByteString::operator=(obj); + return *this; +} + + +int DcmUniversalResourceIdentifierOrLocator::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmUniversalResourceIdentifierOrLocator* myThis = NULL; + DcmUniversalResourceIdentifierOrLocator* myRhs = NULL; + myThis = OFconst_cast(DcmUniversalResourceIdentifierOrLocator*, this); + myRhs = OFstatic_cast(DcmUniversalResourceIdentifierOrLocator*, OFconst_cast(DcmElement*, &rhs)); + + /* compare length */ + unsigned long thisLength = myThis->getLength(); + unsigned long rhsLength = myRhs->getLength(); + if (thisLength < rhsLength) + { + return -1; + } + else if (thisLength > rhsLength) + { + return 1; + } + + /* check whether values are equal */ + OFString thisValue, rhsValue; + myThis->getOFStringArray(thisValue); + myThis->getOFStringArray(rhsValue); + return thisValue.compare(rhsValue); +} + + +OFCondition DcmUniversalResourceIdentifierOrLocator::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUniversalResourceIdentifierOrLocator &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUniversalResourceIdentifierOrLocator::ident() const +{ + return EVR_UR; +} + + +OFCondition DcmUniversalResourceIdentifierOrLocator::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + l_error = DcmUniversalResourceIdentifierOrLocator::checkStringValue(strVal); + return l_error; +} + + +unsigned long DcmUniversalResourceIdentifierOrLocator::getVM() +{ + /* value multiplicity is 1 for non-empty string, 0 otherwise */ + return (getRealLength() > 0) ? 1 : 0; +} + + +// ******************************** + + +OFCondition DcmUniversalResourceIdentifierOrLocator::getOFString(OFString &strValue, + const unsigned long /*pos*/, + OFBool normalize) +{ + /* treat backslash as a normal character */ + return getOFStringArray(strValue, normalize); +} + + +OFCondition DcmUniversalResourceIdentifierOrLocator::getOFStringArray(OFString &strValue, + OFBool normalize) +{ + /* get string value without handling the "\" as a delimiter */ + OFCondition l_error = getStringValue(strValue); + if (l_error.good() && normalize) + normalizeString(strValue, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmUniversalResourceIdentifierOrLocator::checkStringValue(const OFString &value) +{ + return DcmByteString::checkStringValue(value, "" /* vm */, "ur", 19, 0 /* maxLen: no check */); +} + + +OFBool DcmUniversalResourceIdentifierOrLocator::matches(const OFString& key, + const OFString& candidate, + const OFBool enableWildCardMatching) const +{ + if (enableWildCardMatching) + return DcmAttributeMatching::wildCardMatching(key.c_str(), key.length(), candidate.c_str(), candidate.length()); + else + return DcmByteString::matches(key, candidate, OFFalse); +} + + +OFBool DcmUniversalResourceIdentifierOrLocator::isUniversalMatch(const OFBool normalize, + const OFBool enableWildCardMatching) +{ + if(!isEmpty(normalize)) + { + if(enableWildCardMatching) + { + OFString value; + /* by definition, the VM of a non-empty value of this VR is 1 */ + getOFStringArray(value, normalize); + if(value.find_first_not_of( '*' ) != OFString_npos) + return OFFalse; + } + else + return OFFalse; + } + return OFTrue; +} diff --git a/dcmdata/libsrc/dcvrus.cc b/dcmdata/libsrc/dcvrus.cc new file mode 100644 index 00000000..da91f354 --- /dev/null +++ b/dcmdata/libsrc/dcvrus.cc @@ -0,0 +1,384 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers, Andreas Barth + * + * Purpose: Implementation of class DcmUnsignedShort + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrus.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmUnsignedShort::DcmUnsignedShort(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmUnsignedShort::DcmUnsignedShort(const DcmTag &tag, const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmUnsignedShort::DcmUnsignedShort(const DcmUnsignedShort &old) + : DcmElement(old) +{ +} + + +DcmUnsignedShort::~DcmUnsignedShort() +{ +} + + +DcmUnsignedShort &DcmUnsignedShort::operator=(const DcmUnsignedShort &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmUnsignedShort::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmUnsignedShort* myThis = NULL; + DcmUnsignedShort* myRhs = NULL; + myThis = OFconst_cast(DcmUnsignedShort*, this); + myRhs = OFstatic_cast(DcmUnsignedShort*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + Uint16 val = 0; + if (myThis->getUint16(val, count).good()) + { + Uint16 rhsVal = 0; + if (myRhs->getUint16(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmUnsignedShort::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUnsignedShort &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUnsignedShort::ident() const +{ + return EVR_US; +} + + +OFCondition DcmUnsignedShort::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmUnsignedShort::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmUnsignedShort::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Uint16)); +} + + +// ******************************** + + +void DcmUnsignedShort::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get unsigned integer data */ + Uint16 *uintVals; + errorFlag = getUint16Array(uintVals); + if (uintVals != NULL) + { + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[32]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, uintVals++) + { + /* check whether first value is printed (omit delimiter) */ + if (i == 0) + sprintf(buffer, "%hu", *uintVals); + else + sprintf(buffer, "\\%hu", *uintVals); + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than two bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmUnsignedShort::getUint16(Uint16 &uintVal, + const unsigned long pos) +{ + /* get unsigned integer data */ + Uint16 *uintValues = NULL; + errorFlag = getUint16Array(uintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (uintValues == NULL) + errorFlag = EC_IllegalCall; + else if (pos >= getVM()) + errorFlag = EC_IllegalParameter; + else + uintVal = uintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + uintVal = 0; + return errorFlag; +} + + +OFCondition DcmUnsignedShort::getUint16Array(Uint16 *&uintVals) +{ + uintVals = OFstatic_cast(Uint16 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedShort::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + Uint16 uintVal; + /* get the specified numeric value */ + errorFlag = getUint16(uintVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[32]; + sprintf(buffer, "%hu", uintVal); + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedShort::putUint16(const Uint16 uintVal, + const unsigned long pos) +{ + Uint16 val = uintVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Uint16) * pos), OFstatic_cast(Uint32, sizeof(Uint16))); + return errorFlag; +} + + +OFCondition DcmUnsignedShort::putUint16Array(const Uint16 *uintVals, + const unsigned long numUints) +{ + errorFlag = EC_Normal; + if (numUints > 0) + { + /* check for valid data */ + if (uintVals != NULL) + errorFlag = putValue(uintVals, OFstatic_cast(Uint32, sizeof(Uint16) * OFstatic_cast(size_t, numUints))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedShort::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmUnsignedShort::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Uint16 *field = new Uint16[vm]; + OFString value; + size_t pos = 0; + /* retrieve unsigned integer data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (value.empty() || (sscanf(value.c_str(), "%hu", &field[i]) != 1)) + errorFlag = EC_CorruptedData; + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putUint16Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsignedShort::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Uint16)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Uint16)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} + + +OFBool DcmUnsignedShort::matches(const DcmElement& candidate, + const OFBool enableWildCardMatching) const +{ + OFstatic_cast(void,enableWildCardMatching); + if (ident() == candidate.ident()) + { + // some const casts to call the getter functions, I do not modify the values, I promise! + DcmUnsignedShort& key = OFconst_cast(DcmUnsignedShort&,*this); + DcmElement& can = OFconst_cast(DcmElement&,candidate); + Uint16 a, b; + for( unsigned long ui = 0; ui < key.getVM(); ++ui ) + for( unsigned long uj = 0; uj < can.getVM(); ++uj ) + if( key.getUint16( a, ui ).good() && can.getUint16( b, uj ).good() && a == b ) + return OFTrue; + return key.getVM() == 0; + } + return OFFalse; +} diff --git a/dcmdata/libsrc/dcvrut.cc b/dcmdata/libsrc/dcvrut.cc new file mode 100644 index 00000000..2690eb38 --- /dev/null +++ b/dcmdata/libsrc/dcvrut.cc @@ -0,0 +1,167 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Implementation of class DcmUnlimitedText + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrut.h" + + +// ******************************** + + +DcmUnlimitedText::DcmUnlimitedText(const DcmTag &tag, + const Uint32 len) + : DcmCharString(tag, len) +{ + setMaxLength(DCM_UndefinedLength); +} + + +DcmUnlimitedText::DcmUnlimitedText(const DcmUnlimitedText &old) + : DcmCharString(old) +{ +} + + +DcmUnlimitedText::~DcmUnlimitedText() +{ +} + + +DcmUnlimitedText &DcmUnlimitedText::operator=(const DcmUnlimitedText &obj) +{ + DcmCharString::operator=(obj); + return *this; +} + + +int DcmUnlimitedText::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmUnlimitedText* myThis = NULL; + DcmUnlimitedText* myRhs = NULL; + myThis = OFconst_cast(DcmUnlimitedText*, this); + myRhs = OFstatic_cast(DcmUnlimitedText*, OFconst_cast(DcmElement*, &rhs)); + + /* compare length */ + unsigned long thisLength = myThis->getLength(); + unsigned long rhsLength = myRhs->getLength(); + if (thisLength < rhsLength) + { + return -1; + } + else if (thisLength > rhsLength) + { + return 1; + } + + /* check whether values are equal */ + OFString thisValue, rhsValue; + myThis->getOFStringArray(thisValue); + myThis->getOFStringArray(rhsValue); + return thisValue.compare(rhsValue); +} + + + +OFCondition DcmUnlimitedText::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUnlimitedText &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUnlimitedText::ident() const +{ + return EVR_UT; +} + + +OFCondition DcmUnlimitedText::checkValue(const OFString & /*vm*/, + const OFBool /*oldFormat*/) +{ + OFString strVal; + /* get "raw value" without any modifications (if possible) */ + OFCondition l_error = getStringValue(strVal); + if (l_error.good()) + { + OFString charset; + /* try to determine the value of the SpecificCharacterSet element */ + if (getSpecificCharacterSet(charset) == EC_CorruptedData) + charset = "UNKNOWN"; + l_error = DcmUnlimitedText::checkStringValue(strVal, charset); + } + return l_error; +} + + +unsigned long DcmUnlimitedText::getVM() +{ + /* value multiplicity is 1 for non-empty string, 0 otherwise */ + return (getRealLength() > 0) ? 1 : 0; +} + + +// ******************************** + + +OFCondition DcmUnlimitedText::getOFString(OFString &strValue, + const unsigned long /*pos*/, + OFBool normalize) +{ + /* treat backslash as a normal character */ + return getOFStringArray(strValue, normalize); +} + + +OFCondition DcmUnlimitedText::getOFStringArray(OFString &strValue, + OFBool normalize) +{ + /* get string value without handling the "\" as a delimiter */ + OFCondition l_error = getStringValue(strValue); + if (l_error.good() && normalize) + normalizeString(strValue, !MULTIPART, !DELETE_LEADING, DELETE_TRAILING); + return l_error; +} + + +// ******************************** + + +OFCondition DcmUnlimitedText::checkStringValue(const OFString &value, + const OFString &charset) +{ + return DcmByteString::checkStringValue(value, "" /* vm */, "lt", 14, 0 /* maxLen: no check */, charset); +} diff --git a/dcmdata/libsrc/dcvruv.cc b/dcmdata/libsrc/dcvruv.cc new file mode 100644 index 00000000..501a2902 --- /dev/null +++ b/dcmdata/libsrc/dcvruv.cc @@ -0,0 +1,395 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of class DcmUnsigned64bitVeryLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvruv.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +// ******************************** + + +DcmUnsigned64bitVeryLong::DcmUnsigned64bitVeryLong(const DcmTag &tag) + : DcmElement(tag, 0) +{ +} + + +DcmUnsigned64bitVeryLong::DcmUnsigned64bitVeryLong(const DcmTag &tag, + const Uint32 len) + : DcmElement(tag, len) +{ +} + + +DcmUnsigned64bitVeryLong::DcmUnsigned64bitVeryLong(const DcmUnsigned64bitVeryLong &old) + : DcmElement(old) +{ +} + + +DcmUnsigned64bitVeryLong::~DcmUnsigned64bitVeryLong() +{ +} + + +DcmUnsigned64bitVeryLong &DcmUnsigned64bitVeryLong::operator=(const DcmUnsigned64bitVeryLong &obj) +{ + DcmElement::operator=(obj); + return *this; +} + + +int DcmUnsigned64bitVeryLong::compare(const DcmElement& rhs) const +{ + int result = DcmElement::compare(rhs); + if (result != 0) + { + return result; + } + + /* cast away constness (dcmdata is not const correct...) */ + DcmUnsigned64bitVeryLong* myThis = NULL; + DcmUnsigned64bitVeryLong* myRhs = NULL; + myThis = OFconst_cast(DcmUnsigned64bitVeryLong*, this); + myRhs = OFstatic_cast(DcmUnsigned64bitVeryLong*, OFconst_cast(DcmElement*, &rhs)); + + /* compare number of values */ + unsigned long thisNumValues = myThis->getNumberOfValues(); + unsigned long rhsNumValues = myRhs->getNumberOfValues(); + if (thisNumValues < rhsNumValues) + { + return -1; + } + else if (thisNumValues > rhsNumValues) + { + return 1; + } + + /* iterate over all components and test equality */ + for (unsigned long count = 0; count < thisNumValues; count++) + { + Uint64 val = 0; + if (myThis->getUint64(val, count).good()) + { + Uint64 rhsVal = 0; + if (myRhs->getUint64(rhsVal, count).good()) + { + if (val > rhsVal) + { + return 1; + } + else if (val < rhsVal) + { + return -1; + } + } + } + } + + /* all values as well as VM equal: objects are equal */ + return 0; +} + + +OFCondition DcmUnsigned64bitVeryLong::copyFrom(const DcmObject& rhs) +{ + if (this != &rhs) + { + if (rhs.ident() != ident()) return EC_IllegalCall; + *this = OFstatic_cast(const DcmUnsigned64bitVeryLong &, rhs); + } + return EC_Normal; +} + + +// ******************************** + + +DcmEVR DcmUnsigned64bitVeryLong::ident() const +{ + return EVR_UV; +} + + +OFCondition DcmUnsigned64bitVeryLong::checkValue(const OFString &vm, + const OFBool /*oldFormat*/) +{ + /* check VM only */ + return DcmElement::checkVM(getVM(), vm); +} + + +unsigned long DcmUnsigned64bitVeryLong::getVM() +{ + return getNumberOfValues(); +} + + +unsigned long DcmUnsigned64bitVeryLong::getNumberOfValues() +{ + return OFstatic_cast(unsigned long, getLengthField() / sizeof(Uint64)); +} + + +// ******************************** + + +void DcmUnsigned64bitVeryLong::print(STD_NAMESPACE ostream &out, + const size_t flags, + const int level, + const char * /*pixelFileName*/, + size_t * /*pixelCounter*/) +{ + if (valueLoaded()) + { + /* get unsigned integer data */ + Uint64 *uintVals; + errorFlag = getUint64Array(uintVals); + if (uintVals != NULL) + { + /* do not use getVM() because derived classes might always return 1 */ + const unsigned long count = getNumberOfValues(); + /* double-check length field for valid value */ + if (count > 0) + { + const unsigned long maxLength = (flags & DCMTypes::PF_shortenLongTagValues) ? + DCM_OptPrintLineLength : OFstatic_cast(unsigned long, -1) /*unlimited*/; + unsigned long printedLength = 0; + unsigned long newLength = 0; + char buffer[32]; + /* print line start with tag and VR */ + printInfoLineStart(out, flags, level); + /* print multiple values */ + for (unsigned int i = 0; i < count; i++, uintVals++) + { + /* check whether first value is printed (omit delimiter) */ + if (i == 0) +#ifdef PRIu64 + sprintf(buffer, "%" PRIu64, *uintVals); + else + sprintf(buffer, "\\%" PRIu64, *uintVals); +#elif SIZEOF_LONG == 8 + sprintf(buffer, "%lu", *uintVals); + else + sprintf(buffer, "\\%lu", *uintVals); +#else // assume "long long" is 64 bits + sprintf(buffer, "%llu", *uintVals); + else + sprintf(buffer, "\\%llu", *uintVals); +#endif + /* check whether current value sticks to the length limit */ + newLength = printedLength + OFstatic_cast(unsigned long, strlen(buffer)); + if ((newLength <= maxLength) && ((i + 1 == count) || (newLength + 3 <= maxLength))) + { + out << buffer; + printedLength = newLength; + } else { + /* check whether output has been truncated */ + if (i + 1 < count) + { + out << "..."; + printedLength += 3; + } + break; + } + } + /* print line end with length, VM and tag name */ + printInfoLineEnd(out, flags, printedLength); + } else { + /* count can be zero if we have an invalid element with less than eight bytes length */ + printInfoLine(out, flags, level, "(invalid value)"); + } + } else + printInfoLine(out, flags, level, "(no value available)"); + } else + printInfoLine(out, flags, level, "(not loaded)"); +} + + +// ******************************** + + +OFCondition DcmUnsigned64bitVeryLong::getUint64(Uint64 &uintVal, + const unsigned long pos) +{ + /* get unsigned integer data */ + Uint64 *uintValues = NULL; + errorFlag = getUint64Array(uintValues); + /* check data before returning */ + if (errorFlag.good()) + { + if (uintValues == NULL) + errorFlag = EC_IllegalCall; + /* do not use getVM() because derived classes might always return 1 */ + else if (pos >= getNumberOfValues()) + errorFlag = EC_IllegalParameter; + else + uintVal = uintValues[pos]; + } + /* clear value in case of error */ + if (errorFlag.bad()) + uintVal = 0; + return errorFlag; +} + + +OFCondition DcmUnsigned64bitVeryLong::getUint64Array(Uint64 *&uintVals) +{ + uintVals = OFstatic_cast(Uint64 *, getValue()); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsigned64bitVeryLong::getOFString(OFString &stringVal, + const unsigned long pos, + OFBool /*normalize*/) +{ + Uint64 uintVal; + /* get the specified numeric value */ + errorFlag = getUint64(uintVal, pos); + if (errorFlag.good()) + { + /* ... and convert it to a character string */ + char buffer[32]; +#ifdef PRIu64 + sprintf(buffer, "%" PRIu64, uintVal); +#elif SIZEOF_LONG == 8 + sprintf(buffer, "%lu", uintVal); +#else // assume "long long" is 64 bits + sprintf(buffer, "%llu", uintVal); +#endif + /* assign result */ + stringVal = buffer; + } + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsigned64bitVeryLong::putUint64(const Uint64 uintVal, + const unsigned long pos) +{ + Uint64 val = uintVal; + errorFlag = changeValue(&val, OFstatic_cast(Uint32, sizeof(Uint64) * pos), OFstatic_cast(Uint32, sizeof(Uint64))); + return errorFlag; +} + + +OFCondition DcmUnsigned64bitVeryLong::putUint64Array(const Uint64 *uintVals, + const unsigned long numUints) +{ + errorFlag = EC_Normal; + if (numUints > 0) + { + /* check for valid data */ + if (uintVals != NULL) + errorFlag = putValue(uintVals, OFstatic_cast(Uint32, sizeof(Uint64) * OFstatic_cast(size_t, numUints))); + else + errorFlag = EC_CorruptedData; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsigned64bitVeryLong::putString(const char *stringVal) +{ + /* determine length of the string value */ + const size_t stringLen = (stringVal != NULL) ? strlen(stringVal) : 0; + /* call the real function */ + return putString(stringVal, OFstatic_cast(Uint32, stringLen)); +} + + +OFCondition DcmUnsigned64bitVeryLong::putString(const char *stringVal, + const Uint32 stringLen) +{ + errorFlag = EC_Normal; + /* determine VM of the string */ + const unsigned long vm = DcmElement::determineVM(stringVal, stringLen); + if (vm > 0) + { + Uint64 *field = new Uint64[vm]; + OFString value; + size_t pos = 0; + /* retrieve unsigned integer data from character string */ + for (unsigned long i = 0; (i < vm) && errorFlag.good(); i++) + { + /* get specified value from multi-valued string */ + pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value); + if (value.empty() || +#ifdef SCNu64 + (sscanf(value.c_str(), "%" SCNu64, &field[i]) != 1) +#elif SIZEOF_LONG == 8 + (sscanf(value.c_str(), "%lu", &field[i]) != 1) +#else // assume "long long" is 64 bits + (sscanf(value.c_str(), "%llu", &field[i]) != 1) +#endif + ) + { + errorFlag = EC_CorruptedData; + } + } + /* set binary data as the element value */ + if (errorFlag.good()) + errorFlag = putUint64Array(field, vm); + /* delete temporary buffer */ + delete[] field; + } else + errorFlag = putValue(NULL, 0); + return errorFlag; +} + + +// ******************************** + + +OFCondition DcmUnsigned64bitVeryLong::verify(const OFBool autocorrect) +{ + /* check for valid value length */ + if (getLengthField() % (sizeof(Uint64)) != 0) + { + errorFlag = EC_CorruptedData; + if (autocorrect) + { + /* strip to valid length */ + setLengthField(getLengthField() - (getLengthField() % OFstatic_cast(Uint32, sizeof(Uint64)))); + } + } else + errorFlag = EC_Normal; + return errorFlag; +} diff --git a/dcmdata/libsrc/dcwcache.cc b/dcmdata/libsrc/dcwcache.cc new file mode 100644 index 00000000..5791c9c7 --- /dev/null +++ b/dcmdata/libsrc/dcwcache.cc @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2007-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: Implementation of class DcmWriteCache + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ +#include "dcmtk/dcmdata/dcelem.h" /* for class DcmElement */ +#include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ + + +void DcmWriteCache::init(void *owner, + Uint32 fieldLength, + Uint32 bytesTransferred, + E_ByteOrder byteOrder) +{ + if (! buf_) + { + capacity_ = DcmWriteCacheBufsize; + buf_ = new Uint8[capacity_]; + } + + if (owner != owner_) + { + owner_ = owner; + fieldLength_ = fieldLength; + fieldOffset_ = bytesTransferred; + byteOrder_ = byteOrder; + offset_ = 0; + numBytes_ = 0; + } +} + +OFCondition DcmWriteCache::fillBuffer(DcmElement& elem) +{ + OFCondition result = EC_Normal; + if (buf_) + { + // re-fill the buffer only if completely empty + if (! numBytes_) + { + offset_ = 0; + + // compute the number of bytes to read - either buffer size or + // the remaining number of bytes in the element, whatever is smaller + Uint32 bytesToRead = fieldLength_ - fieldOffset_; + if (bytesToRead > capacity_) bytesToRead = capacity_; + + result = elem.getPartialValue(buf_, fieldOffset_, bytesToRead, &fcache_, byteOrder_); + + if (result.good()) + { + numBytes_ = bytesToRead; + fieldOffset_ += numBytes_; + } + + } + } else result = EC_IllegalCall; + return result; +} + +Uint32 DcmWriteCache::writeBuffer(DcmOutputStream &outStream) +{ + Uint32 result = 0; + if (buf_ && numBytes_) + { + result = OFstatic_cast(Uint32, outStream.write(buf_ + offset_, numBytes_)); + + numBytes_ -= result; + offset_ += result; + } + return result; +} diff --git a/dcmdata/libsrc/dcxfer.cc b/dcmdata/libsrc/dcxfer.cc new file mode 100644 index 00000000..236036c4 --- /dev/null +++ b/dcmdata/libsrc/dcxfer.cc @@ -0,0 +1,910 @@ +/* + * + * Copyright (C) 1994-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Gerd Ehlers + * + * Purpose: handling of transfer syntaxes + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmdata/dcuid.h" + +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +typedef struct +{ + const char *xferID; + const char *xferName; + E_TransferSyntax xfer; + E_ByteOrder byteOrder; + E_ByteOrder pixelDataByteOrder; + E_VRType vrType; + E_JPEGEncapsulated encapsulated; + Uint32 JPEGProcess8; + Uint32 JPEGProcess12; + OFBool lossy; + OFBool retired; + E_StreamCompression streamCompression; + OFBool referenced; +} S_XferNames; + + +#define ERROR_XferName "Unknown Transfer Syntax" + + +const S_XferNames XferNames[] = +{ + // entry #0 + { UID_LittleEndianImplicitTransferSyntax, + "Little Endian Implicit", + EXS_LittleEndianImplicit, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Implicit, + EJE_NotEncapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #1 + { "", // illegal type + "Virtual Big Endian Implicit", + EXS_BigEndianImplicit, + EBO_BigEndian, + EBO_BigEndian, + EVT_Implicit, + EJE_NotEncapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #2 + { UID_LittleEndianExplicitTransferSyntax, + "Little Endian Explicit", + EXS_LittleEndianExplicit, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_NotEncapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #3 + { UID_BigEndianExplicitTransferSyntax, + "Big Endian Explicit", + EXS_BigEndianExplicit, + EBO_BigEndian, + EBO_BigEndian, + EVT_Explicit, + EJE_NotEncapsulated, + 0L, 0L, + OFFalse, + OFTrue, // retired with Supplement 98 + ESC_none, + OFFalse + }, + // entry #4 + { UID_JPEGProcess1TransferSyntax, + "JPEG Baseline", + EXS_JPEGProcess1, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 1L, 1L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #5 + { UID_JPEGProcess2_4TransferSyntax, + "JPEG Extended, Process 2+4", + EXS_JPEGProcess2_4, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 2L ,4L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #6 + { UID_JPEGProcess3_5TransferSyntax, + "JPEG Extended, Process 3+5", + EXS_JPEGProcess3_5, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 3L ,5L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #7 + { UID_JPEGProcess6_8TransferSyntax, + "JPEG Spectral Selection, Non-hierarchical, Process 6+8", + EXS_JPEGProcess6_8, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 6L ,8L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #8 + { UID_JPEGProcess7_9TransferSyntax, + "JPEG Spectral Selection, Non-hierarchical, Process 7+9", + EXS_JPEGProcess7_9, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 7L ,9L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #9 + { UID_JPEGProcess10_12TransferSyntax, + "JPEG Full Progression, Non-hierarchical, Process 10+12", + EXS_JPEGProcess10_12, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 10L ,12L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #10 + { UID_JPEGProcess11_13TransferSyntax, + "JPEG Full Progression, Non-hierarchical, Process 11+13", + EXS_JPEGProcess11_13, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 11L ,13L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #11 + { UID_JPEGProcess14TransferSyntax, + "JPEG Lossless, Non-hierarchical, Process 14", + EXS_JPEGProcess14, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 14L ,14L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #12 + { UID_JPEGProcess15TransferSyntax, + "JPEG Lossless, Non-hierarchical, Process 15", + EXS_JPEGProcess15, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 15L ,15L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #13 + { UID_JPEGProcess16_18TransferSyntax, + "JPEG Extended, Hierarchical, Process 16+18", + EXS_JPEGProcess16_18, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 16L ,18L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #14 + { UID_JPEGProcess17_19TransferSyntax, + "JPEG Extended, Hierarchical, Process 17+19", + EXS_JPEGProcess17_19, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 17L ,19L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #15 + { UID_JPEGProcess20_22TransferSyntax, + "JPEG Spectral Selection, Hierarchical, Process 20+22", + EXS_JPEGProcess20_22, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 20L ,22L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #16 + { UID_JPEGProcess21_23TransferSyntax, + "JPEG Spectral Selection, Hierarchical, Process 21+23", + EXS_JPEGProcess21_23, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 21L ,23L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #17 + { UID_JPEGProcess24_26TransferSyntax, + "JPEG Full Progression, Hierarchical, Process 24+26", + EXS_JPEGProcess24_26, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 24L ,26L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #18 + { UID_JPEGProcess25_27TransferSyntax, + "JPEG Full Progression, Hierarchical, Process 25+27", + EXS_JPEGProcess25_27, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 25L ,27L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #19 + { UID_JPEGProcess28TransferSyntax, + "JPEG Lossless, Hierarchical, Process 28", + EXS_JPEGProcess28, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 28L ,28L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #20 + { UID_JPEGProcess29TransferSyntax, + "JPEG Lossless, Hierarchical, Process 29", + EXS_JPEGProcess29, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 29L ,29L, + OFTrue, + OFTrue, + ESC_none, + OFFalse + }, + // entry #21 + { UID_JPEGProcess14SV1TransferSyntax, + "JPEG Lossless, Non-hierarchical, 1st Order Prediction", + EXS_JPEGProcess14SV1, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 14L ,14L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #22 + { UID_RLELosslessTransferSyntax, + "RLE Lossless", + EXS_RLELossless, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #23 + { UID_DeflatedExplicitVRLittleEndianTransferSyntax, + "Deflated Explicit VR Little Endian", + EXS_DeflatedLittleEndianExplicit, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_NotEncapsulated, + 0L, 0L, + OFFalse, + OFFalse, +#ifdef WITH_ZLIB + ESC_zlib, +#else + ESC_unsupported, +#endif + OFFalse + }, + // entry #24 + { UID_JPEGLSLosslessTransferSyntax, + "JPEG-LS Lossless", + EXS_JPEGLSLossless, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #25 + { UID_JPEGLSLossyTransferSyntax, + "JPEG-LS Lossy (Near-lossless)", + EXS_JPEGLSLossy, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #26 + { UID_JPEG2000LosslessOnlyTransferSyntax, + "JPEG 2000 (Lossless only)", + EXS_JPEG2000LosslessOnly, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #27 + { UID_JPEG2000TransferSyntax, + "JPEG 2000 (Lossless or Lossy)", + EXS_JPEG2000, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #28 + { UID_JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax, + "JPEG 2000 Part 2 Multicomponent Image Compression (Lossless only)", + EXS_JPEG2000MulticomponentLosslessOnly, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + }, + // entry #29 + { UID_JPEG2000Part2MulticomponentImageCompressionTransferSyntax, + "JPEG 2000 Part 2 Multicomponent Image Compression (Lossless or Lossy)", + EXS_JPEG2000Multicomponent, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #30 + { UID_JPIPReferencedTransferSyntax, + "JPIP Referenced", + EXS_JPIPReferenced, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_NotEncapsulated, // in fact, pixel data shall be referenced via (0028,7FE0) Pixel Data Provider URL + 0L, 0L, + OFTrue, // really lossy? + OFFalse, + ESC_none, + OFTrue + }, + // entry #31 + { UID_JPIPReferencedDeflateTransferSyntax, + "JPIP Referenced Deflate", + EXS_JPIPReferencedDeflate, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_NotEncapsulated, // in fact, pixel data shall be referenced via (0028,7FE0) Pixel Data Provider URL + 0L, 0L, + OFTrue, // really lossy? + OFFalse, +#ifdef WITH_ZLIB + ESC_zlib, +#else + ESC_unsupported, +#endif + OFTrue + }, + // entry #32 + { UID_MPEG2MainProfileAtMainLevelTransferSyntax, + "MPEG2 Main Profile @ Main Level", // changed with DICOM 2016e to: MPEG2 Main Profile / Main Level + EXS_MPEG2MainProfileAtMainLevel, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #33 + { UID_MPEG2MainProfileAtHighLevelTransferSyntax, + "MPEG2 Main Profile @ High Level", // changed with DICOM 2016e to: MPEG2 Main Profile / High Level + EXS_MPEG2MainProfileAtHighLevel, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #34 + { UID_MPEG4HighProfileLevel4_1TransferSyntax, + "MPEG-4 AVC/H.264 High Profile / Level 4.1", + EXS_MPEG4HighProfileLevel4_1, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #35 + { UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax, + "MPEG-4 AVC/H.264 BD-compatible High Profile / Level 4.1", + EXS_MPEG4BDcompatibleHighProfileLevel4_1, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #36 + { UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax, + "MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video", + EXS_MPEG4HighProfileLevel4_2_For2DVideo, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #37 + { UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax, + "MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video", + EXS_MPEG4HighProfileLevel4_2_For3DVideo, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #38 + { UID_MPEG4StereoHighProfileLevel4_2TransferSyntax, + "MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2", + EXS_MPEG4StereoHighProfileLevel4_2, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #39 + { UID_HEVCMainProfileLevel5_1TransferSyntax, + "HEVC/H.265 Main Profile / Level 5.1", + EXS_HEVCMainProfileLevel5_1, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #40 + { UID_HEVCMain10ProfileLevel5_1TransferSyntax, + "HEVC/H.265 Main 10 Profile / Level 5.1", + EXS_HEVCMain10ProfileLevel5_1, + EBO_LittleEndian, + EBO_LittleEndian, + EVT_Explicit, + EJE_Encapsulated, + 0L, 0L, + OFTrue, + OFFalse, + ESC_none, + OFFalse + }, + // entry #41 + { UID_PrivateGE_LEI_WithBigEndianPixelDataTransferSyntax, + "Private GE Little Endian Implicit with big endian pixel data", + EXS_PrivateGE_LEI_WithBigEndianPixelData, + EBO_LittleEndian, + EBO_BigEndian, + EVT_Implicit, + EJE_NotEncapsulated, + 0L, 0L, + OFFalse, + OFFalse, + ESC_none, + OFFalse + } +}; + +const int DIM_OF_XferNames = OFstatic_cast(int, sizeof(XferNames) / sizeof(S_XferNames)); + + +// ******************************** + + +DcmXfer::DcmXfer(E_TransferSyntax xfer) + : xferID(""), + xferName(ERROR_XferName), + xferSyn(EXS_Unknown), + byteOrder(EBO_unknown), + pixelDataByteOrder(EBO_unknown), + vrType(EVT_Implicit), + encapsulated(EJE_NotEncapsulated), + JPEGProcess8(0L), + JPEGProcess12(0L), + lossy(OFFalse), + retired(OFFalse), + streamCompression(ESC_none), + referenced(OFFalse) +{ + int i = 0; + while ((i < DIM_OF_XferNames) && XferNames[i].xfer != xfer) + i++; + if ((i < DIM_OF_XferNames) && (XferNames[i].xfer == xfer)) + { + xferSyn = XferNames[i].xfer; + xferID = XferNames[i].xferID; + xferName = XferNames[i].xferName; + byteOrder = XferNames[i].byteOrder; + pixelDataByteOrder = XferNames[i].pixelDataByteOrder; + vrType = XferNames[i].vrType; + encapsulated = XferNames[i].encapsulated; + JPEGProcess8 = XferNames[i].JPEGProcess8; + JPEGProcess12 = XferNames[i].JPEGProcess12; + lossy = XferNames[i].lossy; + retired = XferNames[i].retired; + streamCompression = XferNames[i].streamCompression; + referenced = XferNames[i].referenced; + } +} + + +// ******************************** + + +DcmXfer::DcmXfer(const char* xferName_xferID) + : xferID(""), + xferName(ERROR_XferName), + xferSyn(EXS_Unknown), + byteOrder(EBO_unknown), + pixelDataByteOrder(EBO_unknown), + vrType(EVT_Implicit), + encapsulated(EJE_NotEncapsulated), + JPEGProcess8(0L), + JPEGProcess12(0L), + lossy(OFFalse), + retired(OFFalse), + streamCompression(ESC_none), + referenced(OFFalse) +{ + const char* xname = xferName_xferID; + if (xname != NULL) + { + int i = 0; + while ((i < DIM_OF_XferNames) && (strcmp(XferNames[i].xferID, xname) != 0)) + i++; + if ((i < DIM_OF_XferNames) && (strcmp(XferNames[i].xferID, xname) == 0)) + { + xferSyn = XferNames[i].xfer; + xferID = XferNames[i].xferID; + xferName = XferNames[i].xferName; + byteOrder = XferNames[i].byteOrder; + pixelDataByteOrder = XferNames[i].pixelDataByteOrder; + vrType = XferNames[i].vrType; + encapsulated = XferNames[i].encapsulated; + JPEGProcess8 = XferNames[i].JPEGProcess8; + JPEGProcess12 = XferNames[i].JPEGProcess12; + lossy = XferNames[i].lossy; + retired = XferNames[i].retired; + streamCompression = XferNames[i].streamCompression; + referenced = XferNames[i].referenced; + } + else + { + i = 0; + while ((i < DIM_OF_XferNames) && (strcmp(XferNames[i].xferName, xname) != 0)) + i++; + if ((i < DIM_OF_XferNames) && (strcmp(XferNames[i].xferName, xname) == 0)) + { + xferSyn = XferNames[i].xfer; + xferID = XferNames[i].xferID; + xferName = XferNames[i].xferName; + byteOrder = XferNames[i].byteOrder; + pixelDataByteOrder = XferNames[i].pixelDataByteOrder; + vrType = XferNames[i].vrType; + encapsulated = XferNames[i].encapsulated; + JPEGProcess8 = XferNames[i].JPEGProcess8; + JPEGProcess12 = XferNames[i].JPEGProcess12; + lossy = XferNames[i].lossy; + retired = XferNames[i].retired; + streamCompression = XferNames[i].streamCompression; + referenced = XferNames[i].referenced; + } + } + } +} + + +// ******************************** + + +DcmXfer::DcmXfer(const DcmXfer &newXfer) + : xferID(newXfer.xferID), + xferName(newXfer.xferName), + xferSyn(newXfer.xferSyn), + byteOrder(newXfer.byteOrder), + pixelDataByteOrder(newXfer.pixelDataByteOrder), + vrType(newXfer.vrType), + encapsulated(newXfer.encapsulated), + JPEGProcess8(newXfer.JPEGProcess8), + JPEGProcess12(newXfer.JPEGProcess12), + lossy(newXfer.lossy), + retired(newXfer.retired), + streamCompression(newXfer.streamCompression), + referenced(newXfer.referenced) +{ +} + + +// ******************************** + + +DcmXfer::~DcmXfer() +{ +} + + +// ******************************** + + +DcmXfer &DcmXfer::operator=(const E_TransferSyntax xfer) +{ + // tbc: if the enum value is consistent with the index of the array, + // why do we need to iterate over the array entries? + int i = 0; + while ((i < DIM_OF_XferNames) && (XferNames[i].xfer != xfer)) + i++; + if ((i < DIM_OF_XferNames) && (XferNames[i].xfer == xfer)) + { + xferSyn = XferNames[i].xfer; + xferID = XferNames[i].xferID; + xferName = XferNames[i].xferName; + byteOrder = XferNames[i].byteOrder; + pixelDataByteOrder = XferNames[i].pixelDataByteOrder; + vrType = XferNames[i].vrType; + encapsulated = XferNames[i].encapsulated; + JPEGProcess8 = XferNames[i].JPEGProcess8; + JPEGProcess12 = XferNames[i].JPEGProcess12; + lossy = XferNames[i].lossy; + retired = XferNames[i].retired; + streamCompression = XferNames[i].streamCompression; + referenced = XferNames[i].referenced; + } else { + xferSyn = EXS_Unknown; + xferID = ""; + xferName = ERROR_XferName; + byteOrder = EBO_unknown; + pixelDataByteOrder = EBO_unknown; + vrType = EVT_Implicit; + encapsulated = EJE_NotEncapsulated; + JPEGProcess8 = 0L; + JPEGProcess12 = 0L; + lossy = OFFalse; + retired = OFFalse; + streamCompression = ESC_none; + referenced = OFFalse; + } + return *this; +} + + +// ******************************** + + +DcmXfer &DcmXfer::operator=(const DcmXfer &newXfer) +{ + if (this != &newXfer) + { + xferSyn = newXfer.xferSyn; + xferID = newXfer.xferID; + xferName = newXfer.xferName; + byteOrder = newXfer.byteOrder; + pixelDataByteOrder = newXfer.pixelDataByteOrder; + vrType = newXfer.vrType; + encapsulated = newXfer.encapsulated; + JPEGProcess8 = newXfer.JPEGProcess8; + JPEGProcess12 = newXfer.JPEGProcess12; + lossy = newXfer.lossy; + retired = newXfer.retired; + streamCompression = newXfer.streamCompression; + referenced = newXfer.referenced; + } + return *this; +} + + +// ******************************** + +Uint32 DcmXfer::sizeofTagHeader(DcmEVR evr) const +{ + Uint32 len = 0; + if (isExplicitVR()) + { + // some VRs have an extended format + DcmVR vr(evr); + if (vr.usesExtendedLengthEncoding()) { + len = 12; // for Tag, Length, VR and reserved + } else { + len = 8; // for Tag, Length and VR + } + } else { + // all implicit VRs have the same format + len = 8; // for Tag and Length + } + return len; +} + +// ******************************** + +static E_ByteOrder FindMachineTransferSyntax() +{ + E_ByteOrder localByteOrderFlag; + union + { + Uint32 ul; + char uc[4]; + } tl; + + union + { + Uint16 us; + char uc[2]; + } ts; + + tl.ul = 1; + ts.us = 1; + + if (tl.uc[0] == 1 && !(tl.uc[1] | tl.uc[2] | tl.uc[3]) && ts.uc[0] == 1 && !(ts.uc[1])) + localByteOrderFlag = EBO_LittleEndian; + else if (tl.uc[3] == 1 && !(tl.uc[0] | tl.uc[1] | tl.uc[2]) && ts.uc[1] == 1 && !(ts.uc[0])) + localByteOrderFlag = EBO_BigEndian; + else + localByteOrderFlag = EBO_unknown; + + return localByteOrderFlag; +} + +// global constant: local byte order (little or big endian) +const E_ByteOrder gLocalByteOrder = FindMachineTransferSyntax(); diff --git a/dcmdata/libsrc/mkdeftag.cc b/dcmdata/libsrc/mkdeftag.cc new file mode 100644 index 00000000..e519fc37 --- /dev/null +++ b/dcmdata/libsrc/mkdeftag.cc @@ -0,0 +1,254 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: Generate a C++ header defining symbolic names for DICOM Tags. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofdatime.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcdicent.h" + +static char* +convertToIdentifier(char* s) +{ + if (s == NULL) { + return s; + } + size_t len = strlen(s); + size_t i=0; + unsigned char c; + + for (i=0; igetTagName() == NULL) + return; + + OFStandard::strlcpy(buf, e->getTagName(), DCM_MAXDICTLINESIZE+1); + + convertToIdentifier(buf); + + tagPrefix = "#define DCM_"; + fputs(tagPrefix, fout); /* write out prefix */ + fputs(buf, fout); /* write out rest of name */ + + const OFintptr_t n = 48 - (strlen(tagPrefix) + strlen(buf)); + for (OFintptr_t i=0; igetGroup(), e->getElement()); + + if (e->isRepeating()) { + fprintf(fout, " /* (0x%04x", e->getGroup()); + if (e->isRepeatingGroup()) { + if (e->getGroupRangeRestriction() != DcmDictRange_Even) { + fprintf(fout, "-%c", + rangeRestriction2char(e->getGroupRangeRestriction())); + } + fprintf(fout, "-0x%04x", e->getUpperGroup()); + } + fprintf(fout, ",0x%04x", e->getElement()); + if (e->isRepeatingElement()) { + if (e->getElementRangeRestriction() != DcmDictRange_Even) { + fprintf(fout, "-%c", + rangeRestriction2char(e->getElementRangeRestriction())); + } + fprintf(fout, "-0x%04x", e->getUpperElement()); + } + fprintf(fout, ") */"); + } + fputs("\n", fout); +} + +int main(int argc, char* argv[]) +{ + const char* progname = "mkdeftag"; + const char* filename = NULL; + DcmDictEntry* e = NULL; + int i = 0; + FILE* fout = NULL; + + OFStandard::initializeNetwork(); + + prepareCmdLineArgs(argc, argv, "mkdeftag"); + + DcmDataDictionary& globalDataDict = dcmDataDict.wrlock(); + + /* clear out global data dictionary */ + globalDataDict.clear(); + + progname = argv[0]; + + if (argc >= 3 && 0 == strcmp(argv[1], "-o")) { + filename = argv[2]; + argv += 2; + argc -= 2; + } + + for (i=1; i 1) { + fprintf(fout, "** From: %s\n", argv[1]); + for (i=2; igetPrivateCreator() == NULL) // exclude private tags + { + e = new DcmDictEntry(*(*iter)); + list.insertAndReplace(e); + } + } + + /* generate the entries themselves */ + fputs("\n/*\n", fout); + fputs("** Fixed Tags in ascending (gggg,eeee) order.\n", fout); + fprintf(fout, "** Number of entries: %lu\n", OFstatic_cast(unsigned long, list.size())); + fputs("** Tags with a repeating component (repeating tags) are listed later.\n", fout); + fputs("*/\n", fout); + + /* output the list contents */ + DcmDictEntryListIterator listIter(list.begin()); + DcmDictEntryListIterator listLast(list.end()); + for (; listIter != listLast; ++listIter) + { + printDefined(fout, *listIter); + } + + // count non-private repeating tags in dictionary + int repCount = 0; + DcmDictEntryListIterator repIter(globalDataDict.repeatingBegin()); + DcmDictEntryListIterator repLast(globalDataDict.repeatingEnd()); + for (; repIter != repLast; ++repIter) + { + if ((*repIter)->getPrivateCreator() == NULL) ++repCount; + } + + fputs("\n/*\n", fout); + fputs("** Tags where the group/element can vary (repeating tags).\n", + fout); + fprintf(fout, "** Number of entries: %d\n", repCount); + fputs("*/\n", fout); + + repIter = globalDataDict.repeatingBegin(); + for (; repIter != repLast; ++repIter) + { + if ((*repIter)->getPrivateCreator() == NULL) // exclude private tags + { + printDefined(fout, *repIter); + } + } + fputs("\n#endif /* !DCDEFTAG_H */\n", fout); + + dcmDataDict.wrunlock(); + return 0; +} + +void +DcmDataDictionary::loadBuiltinDictionary() +{ + /* + * * Empty Stub. + ** + ** Used to keep compiler happy when building mkdictbi since it links itself + ** against dcdict.cc. + */ +} diff --git a/dcmdata/libsrc/mkdictbi.cc b/dcmdata/libsrc/mkdictbi.cc new file mode 100644 index 00000000..97b1464c --- /dev/null +++ b/dcmdata/libsrc/mkdictbi.cc @@ -0,0 +1,275 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Andrew Hewett + * + * Purpose: + * Generate a builtin data dictionary which can be compiled into + * the dcmdata library. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofdatime.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcdicent.h" + +#define PRIVATE_TAGS_IFNAME "ENABLE_PRIVATE_TAGS" + +void +DcmDataDictionary::loadBuiltinDictionary() +{ + /* + * * Empty Stub. + ** + ** Used to keep compiler happy when building mkdictbi since it links itself + ** against dcdict.cc. + */ +} + +static const char* +rr2s(DcmDictRangeRestriction rr) +{ + const char* s; + switch (rr) { + case DcmDictRange_Unspecified: + s = "DcmDictRange_Unspecified"; + break; + case DcmDictRange_Odd: + s = "DcmDictRange_Odd"; + break; + case DcmDictRange_Even: + s = "DcmDictRange_Even"; + break; + default: + s = "DcmDictRange_GENERATOR_ERROR"; + break; + } + return s; +} + +static void +printSimpleEntry(FILE* fout, const DcmDictEntry* e, OFBool& isFirst, OFBool& isPrivate) +{ + + const char *c = e->getPrivateCreator(); + + if (c && !isPrivate) + { + fprintf(fout, "#ifdef %s\n", PRIVATE_TAGS_IFNAME); + isPrivate = OFTrue; + } + else if (isPrivate && !c) + { + fprintf(fout, "#endif\n"); + isPrivate = OFFalse; + } + + if (isFirst) + { + fprintf(fout, " "); + isFirst = OFFalse; + } else fprintf(fout, " , "); + + fprintf(fout, "{ 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n", + e->getGroup(), e->getElement(), + e->getUpperGroup(), e->getUpperElement()); + fprintf(fout, " EVR_%s, \"%s\", %d, %d, \"%s\",\n", + e->getVR().getVRName(), + e->getTagName(), + e->getVMMin(), e->getVMMax(), + OFSTRING_GUARD(e->getStandardVersion())); + fprintf(fout, " %s, %s,\n", rr2s(e->getGroupRangeRestriction()), + rr2s(e->getElementRangeRestriction())); + + if (c) + fprintf(fout, " \"%s\" }\n", c); + else + fprintf(fout, " NULL }\n"); +} + +int +main(int argc, char* argv[]) +{ + char* progname; + const char* filename = NULL; + FILE* fout = NULL; + DcmDictEntry* e = NULL; + + OFStandard::initializeNetwork(); + + prepareCmdLineArgs(argc, argv, "mkdictbi"); + + DcmDataDictionary& globalDataDict = dcmDataDict.wrlock(); + + /* clear out any preloaded dictionary */ + globalDataDict.clear(); + + progname = argv[0]; + + if (argc >= 3 && 0 == strcmp(argv[1], "-o")) { + filename = argv[2]; + argv += 2; + argc -= 2; + } + + int i; + for (i=1; i 1) { + fprintf(fout, "** From: %s\n", argv[1]); + for (i=2; igroup, b->element,\n"); + fprintf(fout, " b->upperGroup, b->upperElement, b->evr,\n"); + fprintf(fout, " b->tagName, b->vmMin, b->vmMax,\n"); + fprintf(fout, " b->standardVersion, OFFalse, b->privateCreator);\n"); + fprintf(fout, " e->setGroupRangeRestriction(b->groupRestriction);\n"); + fprintf(fout, " e->setElementRangeRestriction(b->elementRestriction);\n"); + fprintf(fout, " addEntry(e);\n"); + fprintf(fout, " }\n"); + fprintf(fout, "}\n"); + fprintf(fout, "\n"); + fprintf(fout, "\n"); + fprintf(fout, "#else // WITH_BUILTIN_DICTIONARY\n"); + fprintf(fout, "void\n"); + fprintf(fout, "DcmDataDictionary::loadBuiltinDictionary()\n"); + fprintf(fout, "{\n"); + fprintf(fout, "/*\n"); + fprintf(fout, " ** Empty Stub.\n"); + fprintf(fout, " **\n"); + fprintf(fout, " ** We don't want a populated built-in data dictionary. In order to enable it,\n"); + fprintf(fout, " ** define WITH_BUILTIN_DICTIONARY. To re-create the builtin dictionary from\n"); + fprintf(fout, " ** a textfile like dicom.dic, use dcmdata/libsrc/mkdictbi.\n"); + fprintf(fout, "*/\n"); + fprintf(fout, "}\n"); + fprintf(fout, "\n"); + fprintf(fout, "#endif // WITH_BUILTIN_DICTIONARY\n"); + fprintf(fout, "\n"); + dcmDataDict.wrunlock(); + if (filename) + { + fclose(fout); + } + return 0; +} diff --git a/dcmdata/libsrc/vrscan.cc b/dcmdata/libsrc/vrscan.cc new file mode 100644 index 00000000..d246391c --- /dev/null +++ b/dcmdata/libsrc/vrscan.cc @@ -0,0 +1,80 @@ +/* + * + * Copyright (C) 2010-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: Interface to the VR scanner. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/vrscan.h" +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/ofstd/ofstd.h" /* For OFString::strerror() */ +#include "dcmtk/dcmdata/dctypes.h" /* For DCMDATA_WARN() */ + +BEGIN_EXTERN_C +#include "vrscani.h" +#include "vrscanl.h" +END_EXTERN_C + +int vrscan::scan(const OFString& vr, const char* const value, const size_t size) +{ + yyscan_t scanner; + if (yylex_init(&scanner)) + { + DCMDATA_WARN("Error while setting up lexer: " + << OFStandard::getLastSystemErrorCode().message()); + return 16 /* UNKNOWN */; + } + + struct cleanup_t + { + cleanup_t(yyscan_t& y) : t(y) {} + ~cleanup_t() { yylex_destroy(t); } + yyscan_t& t; + } + cleanup(scanner); + + OFString buffer; + buffer.reserve(vr.size() + size + 2); + buffer.append(vr); + buffer.append(value, size); + buffer.append("\0\0", 2); // yy_scan_buffer() requires this + + struct vrscan_error error; + error.error_msg = "(Unknown error)"; + yyset_extra(&error, scanner); + + if (setjmp(error.setjmp_buffer)) // poor man's catch() + { + DCMDATA_WARN("Fatal error in lexer: " << error.error_msg); + return 16 /* UNKNOWN */; + } + + yy_scan_buffer(OFconst_cast(char*, buffer.data()), buffer.size(), scanner); + const int result = yylex(scanner); + if (yylex(scanner)) + return 16 /* UNKNOWN */; + + return result; +} + +int vrscan::scan(const OFString& vr, const OFString& value) +{ + return scan(vr, value.data(), value.size()); +} diff --git a/dcmdata/libsrc/vrscani.h b/dcmdata/libsrc/vrscani.h new file mode 100644 index 00000000..031f27ca --- /dev/null +++ b/dcmdata/libsrc/vrscani.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (C) 2010-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: Internal header for vrscanl.c and vrscan.cc + * + */ + +#ifndef VRSCANI_H +#define VRSCANI_H + +/* This needs its own header because both vrscanl.c and vrscan.cc need it. */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include + +struct vrscan_error { + jmp_buf setjmp_buffer; + const char *error_msg; +}; + +#define YY_EXTRA_TYPE struct vrscan_error * +#define YY_FATAL_ERROR(msg) do { \ + yyget_extra(yyscanner)->error_msg = msg; \ + longjmp(yyget_extra(yyscanner)->setjmp_buffer, 1); \ +} while (0); + +#ifndef HAVE_UNISTD_H + +/* Don't try to include unistd.h which doesn't exist on windows */ +#define YY_NO_UNISTD_H + +/* Declare isatty() to avoid a warning when compiling vrscanl.l */ +int isatty(int fd); + +#endif + +#endif /* VRSCANI_H */ diff --git a/dcmdata/libsrc/vrscanl.c b/dcmdata/libsrc/vrscanl.c new file mode 100644 index 00000000..b221522a --- /dev/null +++ b/dcmdata/libsrc/vrscanl.c @@ -0,0 +1,6445 @@ +#line 1 "vrscanl.c" + +#line 3 "vrscanl.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define yywrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 22 +#define YY_END_OF_BUFFER 23 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[1613] = + { 0, + 0, 0, 23, 21, 20, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 16, 1, 12, 2, 7, 8, + 10, 15, 0, 0, 13, 5, 0, 11, 0, 0, + 16, 16, 0, 1, 12, 12, 12, 0, 0, 0, + 2, 0, 0, 0, 7, 7, 0, 0, 0, 8, + 0, 0, 0, 10, 10, 10, 10, 10, 15, 15, + 15, 17, 0, 13, 13, 13, 13, 13, 0, 0, + 5, 19, 11, 11, 11, 18, 16, 16, 0, 16, + 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, + 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, + + 0, 7, 0, 0, 0, 0, 0, 0, 0, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 0, 0, 0, 10, 10, 10, 10, 15, + 15, 15, 15, 17, 0, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 5, 0, 0, 19, + 0, 11, 11, 11, 18, 16, 16, 0, 0, 12, + 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 7, 7, 7, 7, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 15, 15, 14, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 5, 0, 0, 5, 5, 0, 11, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 7, 0, 7, 0, + 7, 0, 0, 7, 9, 8, 0, 0, 0, 0, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 14, 14, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 5, 0, 0, 0, 5, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, + 0, 7, 9, 0, 0, 9, 8, 0, 0, 9, + 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 14, 14, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 0, 0, 5, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 9, 8, 9, 0, 0, 8, 0, 0, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 14, 13, 13, 13, 13, 13, + + 13, 13, 13, 13, 13, 13, 13, 13, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, + 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 13, 13, + 13, 13, 13, 13, 13, 0, 0, 5, 0, 0, + 4, 2, 0, 0, 0, 0, 0, 0, 0, 9, + 8, 0, 0, 0, 0, 0, 0, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 13, 13, 5, 0, 0, 0, 0, 0, 0, 4, + 2, 0, 4, 2, 0, 0, 0, 0, 9, 8, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 5, 0, 5, 0, 3, 0, 0, + 0, 0, 0, 0, 9, 8, 0, 0, 0, 0, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + + 10, 5, 0, 5, 0, 3, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 9, 8, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 5, 0, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, + + 0, 8, 0, 0, 0, 0, 0, 0, 5, 0, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, + 0, 0, 0, 0, 8, 5, 0, 5, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 9, 0, 8, 0, 0, 0, 0, 9, + 0, 0, 0, 8, 6, 0, 9, 8, 9, 0, + 8, 0, 6, 6, 6, 9, 8, 9, 8, 0, + 0, 6, 9, 8, 9, 8, 0, 9, 8, 9, + + 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, + 8, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, + 1, 5, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 7, 6, 8, 9, 6, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 6, 6, + 21, 6, 6, 6, 22, 22, 22, 23, 24, 22, + 22, 22, 22, 22, 22, 22, 23, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 23, 22, 23, 22, + 6, 25, 6, 26, 22, 6, 27, 6, 28, 29, + + 30, 6, 6, 6, 31, 6, 6, 32, 33, 34, + 35, 36, 6, 37, 38, 39, 40, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4 + } ; + +static const YY_CHAR yy_meta[41] = + { 0, + 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, + 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, + 12, 13, 13, 14, 15, 16, 5, 5, 5, 17, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 + } ; + +static const flex_int16_t yy_base[2637] = + { 0, + 0, 38, 1164,16659,16659, 0, 1122, 6, 1088, 7, + 1092, 1060, 1059, 6, 0, 1065, 1, 36, 46, 38, + 74, 47, 0, 1047, 75, 92, 0, 50, 0, 51, + 89, 90, 0, 1030, 93, 100, 101, 0, 0, 990, + 96, 104, 2, 0, 111, 123, 0, 2, 988, 112, + 948, 135, 1, 156, 114, 139, 122, 177, 128, 129, + 133, 943, 898, 178, 192, 195, 201, 203, 0, 4, + 200, 905, 137, 154, 58, 903, 140, 151, 152, 173, + 0, 0, 209, 210, 214, 218, 0, 229, 0, 239, + 0, 4, 882, 231, 232, 235, 249, 50, 259, 225, + + 0, 266, 0, 270, 0, 287, 0, 133, 875, 297, + 237, 267, 258, 298, 319, 300, 316, 314, 315, 323, + 344, 354, 365, 338, 270, 380, 346, 396, 383, 384, + 395, 397, 398, 866, 819, 405, 407, 399, 413, 422, + 424, 430, 432, 439, 441, 447, 449, 0, 403, 835, + 815, 450, 452, 454, 771, 465, 466, 750, 0, 471, + 473, 0, 0, 0, 0, 0, 465, 0, 475, 262, + 487, 286, 0, 488, 490, 494, 497, 499, 310, 0, + 0, 0, 0, 0, 515, 0, 525, 535, 500, 551, + 501, 538, 539, 572, 555, 593, 550, 568, 567, 569, + + 575, 614, 603, 576, 597, 615, 636, 618, 657, 631, + 653, 632, 640, 678, 654, 675, 676, 679, 682, 703, + 713, 704, 705, 725, 706, 728, 730, 736, 738, 744, + 746, 753, 755, 761, 763, 770, 772, 778, 780, 787, + 785, 0, 0, 727, 789, 732, 485, 715, 713, 431, + 548, 0, 0, 0, 0, 0, 795, 0, 797, 345, + 802, 379, 0, 806, 813, 823, 0, 0, 0, 0, + 844, 810, 840, 811, 812, 814, 865, 734, 816, 839, + 841, 886, 842, 907, 847, 863, 881, 882, 884, 928, + 917, 888, 889, 890, 949, 911, 930, 932, 944, 945, + + 970, 980, 991, 946, 1007, 947, 951, 953, 1028, 1009, + 1049, 972, 1024, 974, 1006, 1023, 1070, 1059, 1025, 1031, + 1032, 1091, 1053, 1072, 709, 1074, 1086, 1088, 1110, 1112, + 1118, 1093, 1115, 1120, 1127, 1129, 1137, 1144, 1146, 1152, + 1154, 1161, 1163, 1122, 0, 0, 1014, 1151, 0, 0, + 687, 490, 0, 1003, 0, 1118, 1180, 1183, 0, 1156, + 0, 1178, 1180, 0, 1185, 677, 1193, 0, 1189, 1197, + 1199, 1220, 1201, 1218, 1215, 1216, 1222, 1243, 1201, 1239, + 1241, 1244, 1265, 1246, 1247, 1260, 1262, 1268, 1289, 1299, + 1310, 1291, 1326, 1292, 1293, 1314, 1347, 1330, 1325, 1328, + + 1329, 1368, 1342, 1343, 1344, 1350, 1351, 1389, 1378, 1372, + 1390, 1391, 1393, 1404, 1405, 1406, 1427, 1408, 1443, 1422, + 1430, 1431, 1464, 1447, 1445, 1446, 1459, 1485, 1460, 1506, + 1461, 1462, 1483, 1487, 1488, 1527, 1516, 1489, 1510, 1528, + 1549, 1531, 1544, 1545, 1546, 1550, 1571, 1581, 1552, 1553, + 1574, 1592, 1596, 1598, 1604, 1606, 1607, 1609, 1611, 1621, + 1623, 1633, 1635, 1645, 1647, 1648, 1657, 0, 657, 1638, + 1640, 0, 0, 1409, 1594, 1664, 531, 0, 1495, 0, + 1669, 1678, 1682, 1659, 0, 1686, 1680, 0, 1689, 1703, + 1681, 1699, 1706, 1707, 1718, 1739, 1723, 1720, 1721, 1722, + + 1760, 1734, 1735, 1736, 1737, 1743, 1781, 1770, 1762, 1764, + 1783, 1785, 1796, 1797, 1798, 1819, 1800, 1802, 1814, 1815, + 1821, 1842, 1852, 1823, 1844, 1845, 1866, 1863, 1867, 1868, + 1869, 1870, 1891, 1901, 1892, 1893, 1894, 1895, 1916, 1917, + 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1945, 1920, 1966, + 1929, 1962, 1961, 1963, 1964, 1987, 1997, 1969, 1970, 1988, + 2009, 1991, 2010, 2012, 2013, 2024, 2045, 2029, 2066, 2026, + 2042, 2040, 2041, 2043, 2087, 2076, 2049, 2068, 2070, 2108, + 2089, 2091, 2103, 2104, 2105, 2129, 2139, 2106, 2110, 2112, + 2131, 2133, 2150, 2152, 2154, 2155, 2157, 2159, 2165, 2166, + + 2167, 2169, 2171, 2180, 2183, 2193, 2194, 2195, 2198, 0, + 0, 646, 651, 0, 634, 560, 0, 632, 585, 0, + 1831, 1927, 2200, 0, 628, 624, 0, 611, 688, 2216, + 2220, 2241, 2197, 2237, 2212, 2219, 2238, 2262, 2272, 2244, + 2245, 2263, 2284, 2266, 2285, 2287, 2288, 2299, 2320, 2304, + 2301, 2302, 2303, 2315, 2316, 2324, 2339, 2341, 2342, 2343, + 2345, 2346, 2347, 2368, 2343, 2389, 2352, 2364, 2371, 2385, + 2386, 2410, 2348, 2387, 2392, 2393, 2431, 2408, 2414, 2426, + 2427, 2429, 2452, 2462, 2433, 2435, 2454, 2456, 2473, 2475, + 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2504, 2479, 2505, + + 2506, 2507, 2508, 2519, 2520, 2521, 2542, 2523, 2563, 2537, + 2559, 2538, 2546, 2560, 2584, 2524, 2561, 2567, 2582, 2605, + 2586, 2588, 2600, 2601, 2603, 2626, 2636, 2607, 2609, 2628, + 2630, 2647, 2649, 2651, 2672, 2653, 2654, 2655, 2656, 2668, + 2693, 2703, 2670, 2694, 2695, 2716, 2697, 2718, 2719, 2720, + 2731, 2752, 2736, 2733, 2734, 2735, 2747, 2748, 2756, 2771, + 2773, 2774, 2775, 2777, 2778, 2779, 2800, 2775, 2784, 2796, + 2801, 2803, 2815, 2817, 2818, 0, 0, 2825, 0, 2780, + 574, 503, 509, 0, 506, 695, 0, 499, 819, 2836, + 2844, 0, 497, 832, 0, 493, 1041, 2865, 2819, 2826, + + 2827, 2828, 2840, 2886, 2875, 2867, 2868, 2869, 2907, 2890, + 2902, 2903, 2904, 2905, 2928, 2938, 2909, 2911, 2930, 2932, + 2949, 2951, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2980, + 2847, 2961, 2962, 2963, 2984, 2995, 2996, 2997, 3018, 2999, + 3039, 3001, 3002, 3013, 3014, 3020, 3060, 3049, 3041, 3042, + 3043, 3081, 3064, 3076, 3077, 3078, 3079, 3102, 3112, 3083, + 3085, 3104, 3106, 3123, 3125, 3127, 3128, 3129, 3130, 3131, + 3132, 3133, 3154, 3004, 3135, 3136, 3137, 3158, 3169, 3170, + 3171, 3192, 3173, 3175, 3176, 3187, 3188, 3194, 3209, 3210, + 3211, 3232, 3174, 3253, 3213, 3215, 3216, 3227, 3228, 3274, + + 3217, 3234, 3249, 3250, 3295, 3251, 3255, 3256, 3257, 3272, + 3316, 3305, 3278, 3297, 3299, 3318, 3320, 3331, 3332, 3333, + 3334, 3335, 3337, 3339, 3341, 3362, 3341, 3383, 3343, 3360, + 3358, 3364, 3379, 3404, 3414, 3381, 3385, 3386, 3425, 3387, + 3408, 3426, 3427, 3429, 3450, 3435, 3448, 3451, 3452, 3453, + 3454, 3465, 3466, 3467, 3469, 3475, 3476, 3477, 3480, 3501, + 3476, 3498, 3499, 3502, 3503, 3504, 3505, 3516, 3537, 3520, + 3532, 3533, 3534, 488, 0, 0, 0, 426, 1111, 394, + 1940, 3485, 392, 386, 0, 3521, 0, 3553, 3562, 3565, + 3586, 3535, 3583, 3556, 3564, 3581, 3607, 3617, 3590, 3608, + + 3609, 3630, 3611, 3632, 3633, 3634, 3645, 3666, 3650, 3647, + 3648, 3649, 3661, 3662, 3670, 3685, 3687, 3688, 3689, 3691, + 3692, 3693, 3714, 3572, 3695, 3696, 3697, 3698, 3710, 3729, + 3731, 3752, 3733, 3735, 3736, 3747, 3748, 3750, 3754, 3769, + 3771, 3792, 3694, 3813, 3773, 3775, 3776, 3787, 3788, 3834, + 3732, 3790, 3794, 3809, 3855, 3811, 3815, 3816, 3817, 3830, + 3876, 3737, 3832, 3838, 3851, 3853, 3857, 3878, 3859, 3874, + 3880, 3893, 3895, 3897, 3899, 3920, 3777, 3901, 3902, 3903, + 3904, 3916, 3918, 3935, 3956, 3937, 3939, 3951, 3952, 3953, + 3954, 3958, 3960, 3975, 3996, 3900, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 1198, 3977, 4017, 3979, 4013, + 3991, 3992, 3994, 4038, 3936, 4000, 4015, 4021, 4059, 4034, + 4036, 4040, 4042, 4055, 4080, 3941, 4057, 4061, 4063, 4076, + 4078, 4095, 4082, 4084, 4097, 4099, 4101, 4103, 4105, 4126, + 3976, 4107, 4110, 4122, 4124, 4128, 4129, 4141, 4162, 4143, + 4183, 4145, 4179, 4157, 4158, 4160, 4204, 3980, 4166, 4181, + 4187, 4225, 4200, 4202, 4206, 4208, 4221, 4246, 4145, 4223, + 4227, 4229, 4242, 4244, 4261, 4248, 4250, 4263, 4265, 4267, + 4269, 4271, 4292, 4106, 4273, 4276, 4288, 4290, 4294, 4295, + 4307, 4328, 4309, 4311, 4323, 4324, 4325, 4326, 4330, 4332, + + 4347, 4368, 4311, 4349, 0, 4351, 365, 325, 0, 1270, + 337, 0, 332, 1281, 4363, 4384, 0, 4272, 0, 4348, + 4405, 4370, 4389, 4372, 4400, 4401, 4426, 4352, 4402, 4403, + 4407, 4447, 4408, 4424, 4429, 4430, 4442, 4468, 4478, 4443, + 4445, 4451, 4469, 4470, 4491, 4472, 4493, 4494, 4495, 4496, + 4497, 4498, 4519, 4391, 4500, 4501, 4502, 4503, 4534, 4535, + 4536, 4557, 4538, 4540, 4541, 4552, 4553, 4559, 4574, 4575, + 4576, 4597, 4501, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 287, 4578, 4618, 4580, 4581, 4592, 4593, 4599, + 4639, 4537, 4614, 4615, 4616, 4660, 4620, 4621, 4622, 4637, + + 4643, 4681, 4542, 4655, 4656, 4658, 4662, 4664, 4683, 4679, + 4685, 4698, 4700, 4702, 4704, 4706, 4727, 4577, 4708, 4709, + 4710, 4711, 4723, 4725, 4742, 4763, 4744, 4746, 4758, 4759, + 4760, 4761, 4765, 4767, 4782, 4803, 4707, 4824, 4784, 4786, + 4798, 4799, 4800, 4845, 4743, 4801, 4805, 4807, 4866, 4822, + 4826, 4828, 4840, 4841, 4887, 4748, 4843, 4847, 4849, 4862, + 4864, 4889, 4868, 4870, 4885, 4891, 4904, 4906, 4908, 4929, + 4583, 4910, 4912, 4913, 4925, 4927, 4931, 4944, 4965, 4946, + 4948, 4960, 4961, 4962, 4963, 4967, 4969, 4984, 5005, 4788, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1327, + + 4986, 4988, 0, 5000, 0, 279, 0, 4904, 0, 4914, + 270, 1360, 1415, 0, 1452, 1537, 0, 5021, 5026, 5047, + 5002, 5030, 5007, 5031, 5042, 5068, 4947, 5043, 5044, 5045, + 5089, 5049, 5066, 5070, 5071, 5072, 5110, 4985, 5084, 5085, + 5087, 5093, 5106, 5114, 5111, 5112, 5125, 5129, 5133, 5135, + 5136, 5157, 4990, 5138, 5139, 5140, 5141, 5152, 5154, 5173, + 5194, 5175, 5176, 5178, 5189, 5190, 5191, 5192, 5197, 5213, + 5234, 5174, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 257, 5215, 5216, 0, 5218, 0, 0, 0, 0, + 0, 0, 0, 5179, 0, 2155, 5229, 0, 5214, 0, + + 2224, 5250, 1562, 1719, 0, 1807, 1876, 0, 5237, 0, + 5251, 0, 0, 1879, 2022, 0, 231, 0, 228, 0, + 0, 221, 0, 199, 0, 0, 5219, 0, 2228, 5256, + 0, 5255, 0, 2485, 5265, 5255, 0, 5266, 0, 0, + 0, 197, 195, 5277, 0, 191, 176, 5287, 0, 170, + 0, 149, 0, 0, 145, 0, 112, 0, 0, 5272, + 0, 101, 5273, 0, 5274, 0, 0, 87, 54, 5296, + 0, 52, 49, 5301, 5282, 0, 5306, 5310, 5295, 0, + 5311, 0, 5314, 5312, 5320, 5322, 5333, 5341, 5345, 0, + 5032, 5329, 5352, 5356, 5360, 5364, 4, 5368, 5375, 5379, + + 5383, 5387, 5391, 5398, 5402, 5406, 5410, 5414, 5421, 5425, + 5429,16659, 5454, 5468, 5478, 5490, 5498, 5510, 5518, 5531, + 5547, 5562, 5577, 5587, 5598, 5612, 5626, 5636, 5639, 5651, + 5659, 5662, 5670, 5677, 5691, 5699, 5702, 5710, 5717, 5729, + 5742, 5757, 5772, 5787, 5797, 5801, 5809, 5821, 5831, 5834, + 5837, 5840, 5843, 5850, 5862, 5865, 5872, 5882, 5885, 5888, + 5895, 5907, 5919, 5931, 5943, 5955, 5963, 5970, 5982, 5995, + 6010, 6026, 6041, 6056, 6071, 6086, 6101, 6116, 6131, 6146, + 6160, 6168, 6176, 6186, 6190, 6199, 6211, 6221, 6228, 6236, + 6239, 6242, 6245, 6250, 6257, 6269, 6272, 6279, 6293, 6307, + + 6319, 6322, 6325, 6328, 6331, 6338, 6350, 6362, 6374, 6386, + 6398, 6410, 6422, 6434, 6446, 6458, 6470, 6482, 6494, 6506, + 6518, 6530, 6542, 6555, 6570, 6585, 6600, 6615, 6630, 6645, + 6660, 6675, 6690, 6705, 6720, 6735, 6745, 2256, 6752, 6760, + 6764, 6772, 6775, 6778, 6781, 6786, 6793, 6805, 6808, 6811, + 6814, 6821, 6833, 6845, 6857, 6869, 6881, 6893, 6905, 6917, + 6929, 6941, 6953, 6965, 6977, 6989, 7001, 7013, 7025, 7037, + 7049, 7061, 7073, 7085, 7097, 7109, 7121, 7133, 7145, 7157, + 7169, 7181, 7193, 7206, 7221, 7236, 7251, 7266, 7281, 7296, + 7311, 7326, 7341, 7356, 7371, 7386, 7401, 7415, 7423, 7426, + + 7429, 2314, 2530, 2540, 7432, 7435, 2653, 7438, 2660, 7450, + 7462, 7474, 7486, 7498, 7510, 7522, 7534, 7546, 7558, 7570, + 7582, 7594, 7606, 7618, 7630, 7642, 7654, 7666, 7678, 7690, + 7702, 7714, 7726, 7738, 7750, 7762, 7774, 7786, 7798, 7810, + 7822, 7834, 7846, 7858, 7870, 7882, 7894, 7906, 7918, 7930, + 7942, 7954, 7966, 7978, 7990, 8002, 8014, 8026, 8038, 8050, + 8063, 8078, 8093, 8108, 8123, 8138, 8153, 8168, 8183, 8198, + 8213, 8228, 8243, 8253, 8260, 8272, 8280, 2745, 2785, 2853, + 2857, 2962, 8287, 8299, 8311, 8323, 8335, 8347, 8359, 8371, + 8383, 8395, 8407, 8419, 8431, 8443, 8455, 8467, 8479, 8491, + + 8503, 8515, 8527, 8539, 8551, 8563, 8575, 8587, 8599, 8611, + 8623, 8635, 8647, 8659, 8671, 8683, 8695, 8707, 8719, 8731, + 8743, 8755, 8767, 8779, 8791, 8803, 8815, 8827, 8839, 8851, + 8863, 8875, 8887, 8899, 8911, 8923, 8935, 8947, 8959, 8971, + 8983, 8995, 9007, 9019, 9031, 9043, 9055, 9067, 9079, 9091, + 9103, 9115, 9127, 9139, 9151, 9163, 9175, 9188, 9203, 9218, + 9233, 9248, 9263, 9278, 9293, 9308, 3002, 9318, 3031, 3136, + 3180, 3213, 3285, 9325, 9337, 9349, 9361, 9373, 9385, 9397, + 9409, 9421, 9433, 9445, 9457, 9469, 9481, 9493, 9505, 9517, + 9529, 9541, 9553, 9565, 9577, 9589, 9601, 9613, 9625, 9637, + + 9649, 9661, 9673, 9685, 9697, 9709, 9721, 9733, 9745, 9757, + 9769, 9781, 9793, 9805, 9817, 9829, 9841, 9853, 9865, 9877, + 9889, 9901, 9913, 9925, 9937, 9949, 9961, 9973, 9985, 9997, + 10009,10021,10033,10045,10057,10069,10081,10093,10105,10117, + 10129,10141,10153,10165,10177,10189,10201,10213,10225,10237, + 10249,10261,10273,10285,10297,10309,10321,10333,10345,10357, + 10369,10381,10393,10405,10417,10429,10441,10453,10465,10477, + 10489,10501,10513,10525,10537,10550,10565,10580,10595,10605, + 10608, 3527, 3534, 3569, 3600, 3659,10615,10627,10639,10651, + 10663,10675,10687,10699,10711,10723,10735,10747,10759,10771, + + 10783,10795,10807,10819,10831,10843,10855,10867,10879,10891, + 10903,10915,10927,10939,10951,10963,10975,10987,10999,11011, + 11023,11035,11047,11059,11071,11083,11095,11107,11119,11131, + 11143,11155,11167,11179,11191,11203,11215,11227,11239,11251, + 11263,11275,11287,11299,11311,11323,11335,11347,11359,11371, + 11383,11395,11407,11419,11431,11443,11455,11467,11479,11491, + 11503,11515,11527,11539,11551,11563,11575,11587,11599,11611, + 11623,11635,11647,11659,11671,11683,11695,11707,11719,11731, + 11743,11755,11767,11779,11791,11803,11815,11827,11839,11851, + 11863,11875,11887,11899,11911,11923,11935,11947,11959,11971, + + 11983,11995,12007,12019,12031,12043,12055,12067,12079,12091, + 12103,12115,12127,12139,12151,12163,12175,12187,12200,12214, + 12222,12225, 3773,12228,12236,12239,12246,12258,12270,12282, + 12294,12306,12318,12330,12342,12354,12366,12378,12390,12402, + 12414,12426,12438,12450,12462,12474,12486,12498,12510,12522, + 12534,12546,12558,12570,12582,12594,12606,12618,12630,12642, + 12654,12666,12678,12690,12702,12714,12726,12738,12750,12762, + 12774,12786,12798,12810,12822,12834,12846,12858,12870,12882, + 12894,12906,12918,12930,12942,12954,12966,12978,12990,13002, + 13014,13026,13038,13050,13062,13074,13086,13098,13110,13122, + + 13134,13146,13158,13170,13182,13194,13206,13218,13230,13242, + 13254,13266,13278,13290,13302,13314,13326,13338,13350,13362, + 13374,13386,13398,13410,13422,13434,13446,13458,13470,13482, + 13494,13506,13518,13530,13542,13554,13566,13578,13590,13602, + 13614,13626,13638,13650,13662,13674,13686,13698,13710,13722, + 13734,13746,13758,13770,13782,13794,13806,13818,13830,13842, + 13854,13866,13878,13890,13902,13914,13926,13938,13950,13962, + 13974,13986,13998,14010,14022,14034,14046,14058,14070,14082, + 14094,14106,14118,14126,14133,14141, 3906,14148,14160,14168, + 14171,14178,14190,14202,14214,14226,14238,14250,14262,14274, + + 14286,14298,14310,14322,14334,14346,14358,14370,14382,14394, + 14406,14418,14430,14442,14454,14466,14478,14490,14502,14514, + 14526,14538,14550,14562,14574,14586,14598,14610,14622,14634, + 14646,14658,14670,14682,14694,14706,14718,14730,14742,14754, + 14766,14778,14790,14802,14814,14826,14838,14850,14862,14874, + 14886,14898,14910,14922,14934,14946,14958,14970,14982,14994, + 15006,15018,15030,15042,15054,15066,15078,15090,15102,15114, + 15126,15138,15150,15162,15174,15186,15198,15210,15222,15234, + 15246,15258,15270,15282,15294,15306,15318,15330,15342,15354, + 15366,15378,15390,15402,15414,15426,15438,15450,15462,15474, + + 15486,15498,15510,15522,15534,15546,15558,15570,15582,15594, + 15606,15618,15630,15642,15654,15662,15669,15677,15680,15688, + 15691,15694,15697,15704,15716,15728,15740,15752,15764,15776, + 15788,15800,15812,15824,15836,15848,15860,15872,15884,15896, + 15908,15920,15932,15944,15956,15968,15980,15992,16004,16016, + 16028,16040,16052,16064,16076,16088,16100,16112,16124,16136, + 16148,16160,16172,16184,16196,16208,16220,16228,16235,16243, + 16246,16249,16252, 4151, 4317,16259, 4784, 4953,16271,16279, + 16282,16289,16297,16304,16312,16315, 5029,16318, 5139,16321, + 5142, 5146,16328, 5279, 5323,16340,16348,16355,16363,16366, + + 16369,16372, 5334,16375, 5347,16378,16381,16384,16387,16390, + 16393,16396,16399,16406,16418,16426,16429,16436,16448,16460, + 16472,16480,16487,16499,16511,16523,16535,16547,16559,16571, + 16583,16595,16607,16619,16631,16643 + } ; + +static const flex_int16_t yy_def[2637] = + { 0, + 1613, 1613, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1614, 1615, 1616, 1617, 1618, 1619, + 1612, 1620, 1621, 1612, 1622, 1612, 1623, 1624, 1625, 1614, + 1626, 1627, 1628, 1629, 1616, 1616, 1630, 1631, 1631, 1631, + 1632, 1618, 42, 1633, 1634, 1635, 1636, 1636, 1636, 1637, + 21, 21, 1638, 1612, 1639, 1640, 1640, 1612, 1620, 1620, + 1641, 1621, 1612, 1622, 1622, 1642, 1643, 1644, 1645, 1612, + 1612, 1623, 1612, 1646, 1647, 1625, 1626, 1626, 1627, 1648, + 1649, 1650, 1616, 1616, 1630, 1630, 1651, 1651, 1652, 1651, + 1653, 1653, 1653, 1633, 1612, 1654, 1634, 1655, 1635, 99, + + 1656, 1657, 1658, 1658, 1659, 1658, 1660, 1660, 1660, 1612, + 1661, 1662, 1662, 1612, 1612, 1663, 1664, 1664, 1665, 1666, + 1612, 121, 1612, 123, 1667, 1612, 1668, 1669, 1669, 1670, + 1670, 1671, 1671, 1672, 1612, 1673, 1673, 1674, 1675, 1676, + 1676, 1677, 1678, 1679, 1679, 1680, 1681, 1682, 1612, 1683, + 1684, 1685, 1612, 1686, 1612, 1687, 1687, 1612, 1688, 1689, + 1689, 1690, 1691, 1691, 1691, 1692, 1692, 1693, 1692, 1694, + 1695, 1696, 1697, 1697, 1698, 1612, 1699, 1700, 1701, 1702, + 1703, 1703, 1703, 1704, 1704, 1705, 1704, 1612, 1706, 1707, + 1707, 1708, 1709, 1612, 194, 1612, 1710, 1711, 1711, 1712, + + 1713, 1612, 202, 1714, 1715, 1716, 1612, 1717, 1612, 1718, + 1719, 1719, 1612, 1612, 1720, 1721, 1721, 1722, 1723, 1612, + 220, 1724, 1724, 1725, 1726, 1726, 1727, 1728, 1728, 1729, + 1730, 1730, 1731, 1732, 1733, 1733, 1734, 1735, 1735, 1736, + 1612, 1737, 1738, 1612, 1739, 1740, 1741, 1612, 1612, 1612, + 1612, 1742, 1743, 1743, 1743, 1744, 1744, 1745, 1745, 1746, + 1747, 1748, 1749, 1749, 1612, 1612, 1750, 1751, 1751, 1751, + 1612, 1752, 1753, 1753, 1754, 1755, 1612, 277, 1756, 1757, + 1758, 1612, 1759, 1612, 1760, 1761, 1761, 1762, 1763, 1612, + 290, 1764, 1765, 1766, 1612, 1767, 1768, 1769, 1770, 1771, + + 1612, 301, 1612, 1772, 1773, 1773, 1774, 1775, 1612, 309, + 1612, 1776, 1777, 1777, 1778, 1779, 1612, 317, 1780, 1781, + 1782, 1612, 1783, 1784, 1785, 1786, 1786, 1787, 1788, 1788, + 1789, 1790, 1790, 1791, 1792, 1792, 1793, 1794, 1794, 1795, + 1796, 1796, 1797, 1798, 1799, 1800, 1612, 1612, 1801, 1802, + 1612, 1612, 1803, 1612, 1804, 1612, 1612, 1612, 1805, 1805, + 1806, 1806, 1612, 1807, 1612, 1808, 1612, 1809, 1612, 1612, + 1612, 1612, 1810, 1811, 1811, 1812, 1813, 1612, 378, 1814, + 1815, 1816, 1612, 1817, 1818, 1819, 1820, 1821, 1612, 389, + 1612, 1822, 1823, 1823, 1824, 1825, 1612, 397, 1826, 1827, + + 1828, 1612, 1829, 1830, 1831, 1832, 1833, 1612, 408, 1834, + 1835, 1836, 1837, 1838, 1839, 1840, 1612, 1841, 1842, 1842, + 1843, 1844, 1612, 423, 1845, 1846, 1847, 1612, 1848, 1612, + 1849, 1850, 1850, 1851, 1852, 1612, 436, 1853, 1854, 1855, + 1612, 1856, 1857, 1858, 1859, 1860, 1612, 447, 1861, 1862, + 1863, 1863, 1864, 1865, 1865, 1866, 1867, 1867, 1868, 1869, + 1869, 1870, 1871, 1871, 1872, 1873, 1873, 1874, 1612, 1875, + 1876, 1877, 1878, 1612, 1612, 1612, 1612, 1879, 1612, 1880, + 1612, 1612, 1612, 1612, 1881, 1612, 1612, 1882, 1612, 1612, + 1883, 1884, 1884, 1885, 1886, 1612, 496, 1887, 1888, 1889, + + 1612, 1890, 1891, 1892, 1893, 1894, 1612, 507, 1895, 1896, + 1897, 1898, 1899, 1900, 1901, 1612, 1902, 1903, 1903, 1904, + 1905, 1612, 522, 1906, 1907, 1908, 1612, 1909, 1910, 1911, + 1912, 1913, 1612, 533, 1914, 1915, 1916, 1917, 1918, 1919, + 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1612, 548, 1612, + 1927, 1928, 1928, 1929, 1930, 1612, 556, 1931, 1932, 1933, + 1612, 1934, 1935, 1936, 1937, 1938, 1612, 567, 1612, 1939, + 1940, 1940, 1941, 1942, 1612, 575, 1943, 1944, 1945, 1612, + 1946, 1947, 1948, 1949, 1950, 1612, 586, 1951, 1952, 1953, + 1954, 1955, 1956, 1957, 1958, 1959, 1959, 1960, 1961, 1961, + + 1962, 1962, 1963, 1964, 1964, 1965, 1966, 1966, 1612, 1967, + 1968, 1612, 1612, 1969, 1969, 1612, 1970, 1970, 1612, 1971, + 1612, 1612, 1612, 1972, 1972, 1612, 1973, 1973, 1612, 1612, + 1612, 1612, 1974, 1975, 1975, 1976, 1977, 1612, 638, 1978, + 1979, 1980, 1612, 1981, 1982, 1983, 1984, 1985, 1612, 649, + 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, + 1996, 1997, 1998, 1612, 664, 1612, 1999, 2000, 2000, 2001, + 2002, 1612, 672, 2003, 2004, 2005, 1612, 2006, 2007, 2008, + 2009, 2010, 1612, 683, 2011, 2012, 2013, 2014, 2015, 2016, + 2017, 2018, 2019, 2020, 2021, 2022, 2023, 1612, 698, 2024, + + 2025, 2026, 2027, 2028, 2029, 2030, 1612, 2031, 1612, 2032, + 2033, 2033, 2034, 2035, 1612, 715, 2036, 2037, 2038, 1612, + 2039, 2040, 2041, 2042, 2043, 1612, 726, 2044, 2045, 2046, + 2047, 2048, 2049, 2050, 1612, 2051, 2052, 2052, 2053, 2054, + 1612, 741, 2055, 2056, 2057, 1612, 2058, 2059, 2060, 2061, + 2062, 1612, 752, 2063, 2064, 2065, 2066, 2067, 2068, 2069, + 2070, 2071, 2072, 2073, 2074, 2075, 1612, 767, 2076, 2076, + 2077, 2077, 2078, 2079, 2079, 2080, 2081, 1612, 2082, 1612, + 1612, 1612, 1612, 2083, 2083, 1612, 2084, 2084, 1612, 1612, + 1612, 2085, 2085, 1612, 2086, 2086, 1612, 1612, 2087, 2088, + + 2088, 2089, 2090, 1612, 804, 2091, 2092, 2093, 1612, 2094, + 2095, 2096, 2097, 2098, 1612, 815, 2099, 2100, 2101, 2102, + 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 1612, + 830, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 1612, 2119, + 1612, 2120, 2121, 2121, 2122, 2123, 1612, 847, 2124, 2125, + 2126, 1612, 2127, 2128, 2129, 2130, 2131, 1612, 858, 2132, + 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, + 2143, 2144, 1612, 873, 2145, 2146, 2147, 2148, 2149, 2150, + 2151, 1612, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, + 2160, 1612, 892, 1612, 2161, 2162, 2162, 2163, 2164, 1612, + + 900, 2165, 2166, 2167, 1612, 2168, 2169, 2170, 2171, 2172, + 1612, 911, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, + 2181, 2182, 2183, 2184, 2185, 1612, 926, 1612, 2186, 2187, + 2187, 2188, 2189, 1612, 934, 2190, 2191, 2192, 1612, 2193, + 2194, 2195, 2196, 2197, 1612, 945, 2198, 2199, 2200, 2201, + 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 1612, + 960, 2211, 2212, 2213, 2214, 2215, 2216, 2217, 1612, 2218, + 2219, 2219, 2220, 1612, 2221, 2222, 2223, 2223, 1612, 2224, + 2224, 1612, 1612, 1612, 2225, 1612, 2226, 1612, 1612, 1612, + 1612, 2227, 2228, 2228, 2229, 2230, 1612, 997, 2231, 2232, + + 2233, 1612, 2234, 2235, 2236, 2237, 2238, 1612, 1008, 2239, + 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, + 2250, 2251, 1612, 1023, 2252, 2253, 2254, 2255, 2256, 2257, + 2258, 1612, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, + 2267, 1612, 1042, 1612, 2268, 2269, 2269, 2270, 2271, 1612, + 1050, 2272, 2273, 2274, 1612, 2275, 2276, 2277, 2278, 2279, + 1612, 1061, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 2287, + 2288, 2289, 2290, 2291, 2292, 1612, 1076, 2293, 2294, 2295, + 2296, 2297, 2298, 2299, 1612, 2300, 2301, 2302, 2303, 2304, + 2305, 2306, 2307, 2308, 1612, 1095, 1096, 1096, 1096, 1096, + + 1096, 1096, 1096, 1096, 1096, 1096, 1612, 1612, 2309, 2310, + 2310, 2311, 2312, 1612, 1114, 2313, 2314, 2315, 1612, 2316, + 2317, 2318, 2319, 2320, 1612, 1125, 2321, 2322, 2323, 2324, + 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 1612, + 1140, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 1612, 2341, + 1612, 2342, 2343, 2343, 2344, 2345, 1612, 1157, 2346, 2347, + 2348, 1612, 2349, 2350, 2351, 2352, 2353, 1612, 1168, 2354, + 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, + 2365, 2366, 1612, 1183, 2367, 2368, 2369, 2370, 2371, 2372, + 2373, 1612, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, + + 2382, 1612, 1202, 2383, 2384, 2385, 1612, 1612, 2386, 2386, + 2386, 2387, 2387, 1612, 2388, 2389, 2390, 1612, 2391, 1612, + 1612, 2392, 2393, 2393, 2394, 2395, 1612, 1227, 2396, 2397, + 2398, 1612, 2399, 2400, 2401, 2402, 2403, 1612, 1238, 2404, + 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, + 2415, 2416, 1612, 1253, 2417, 2418, 2419, 2420, 2421, 2422, + 2423, 1612, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, + 2432, 1612, 1272, 1273, 1273, 1273, 1273, 1273, 1273, 1273, + 1273, 1273, 1273, 1612, 1612, 2433, 2434, 2434, 2435, 2436, + 1612, 1291, 2437, 2438, 2439, 1612, 2440, 2441, 2442, 2443, + + 2444, 1612, 1302, 2445, 2446, 2447, 2448, 2449, 2450, 2451, + 2452, 2453, 2454, 2455, 2456, 2457, 1612, 1317, 2458, 2459, + 2460, 2461, 2462, 2463, 2464, 1612, 2465, 2466, 2467, 2468, + 2469, 2470, 2471, 2472, 2473, 1612, 1336, 1612, 2474, 2475, + 2475, 2476, 2477, 1612, 1344, 2478, 2479, 2480, 1612, 2481, + 2482, 2483, 2484, 2485, 1612, 1355, 2486, 2487, 2488, 2489, + 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 1612, + 1370, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 1612, 2506, + 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 1612, 1389, + 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, + + 1612, 2515, 2516, 2517, 2518, 2519, 2520, 2520, 2521, 2520, + 1612, 1612, 1612, 2522, 1612, 1612, 2523, 2524, 2525, 1612, + 2526, 2527, 2527, 2528, 2529, 1612, 1426, 2530, 2531, 2532, + 1612, 2533, 2534, 2535, 2536, 2537, 1612, 1437, 2538, 2539, + 2540, 2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, + 2550, 1612, 1452, 2551, 2552, 2553, 2554, 2555, 2556, 2557, + 1612, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, + 1612, 1471, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + 1472, 1472, 1612, 2567, 2568, 2569, 2570, 2571, 2572, 2573, + 2573, 2573, 2574, 1612, 2575, 1612, 2576, 2577, 1612, 2578, + + 1612, 2579, 1612, 1612, 2580, 1612, 1612, 2581, 2582, 2583, + 2584, 2585, 2586, 1612, 1612, 2587, 1612, 2587, 1612, 2588, + 2589, 1612, 2589, 1612, 2590, 2591, 1612, 2592, 1612, 2593, + 2594, 1612, 2595, 1612, 2596, 1612, 2597, 2598, 2599, 2600, + 2601, 1612, 1612, 1612, 2602, 1612, 1612, 1612, 2603, 1612, + 2603, 1612, 2604, 2605, 1612, 2605, 1612, 2606, 2607, 1612, + 2608, 1612, 1612, 2609, 1612, 2610, 2611, 1612, 1612, 1612, + 2612, 1612, 1612, 1612, 1612, 2613, 2614, 2615, 1612, 2616, + 1612, 2617, 1612, 1612, 1612, 2618, 2619, 2620, 2621, 2622, + 1612, 1612, 2623, 2624, 2625, 2626, 1612, 2627, 2628, 2629, + + 2630, 2631, 2632, 2633, 2634, 1612, 1612, 2635, 2636, 1612, + 1612, 0, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612 + } ; + +static const flex_int16_t yy_nxt[16700] = + { 0, + 1612, 1612, 5, 1612, 30, 35, 1612, 1612, 1612, 1612, + 110, 111, 112, 147, 147, 147, 147, 88, 89, 104, + 105, 167, 168, 350, 32, 37, 6, 7, 8, 15, + 9, 10, 18, 27, 11, 12, 28, 16, 13, 14, + 5, 22, 29, 19, 20, 23, 39, 40, 48, 49, + 42, 60, 43, 43, 44, 30, 173, 173, 1581, 73, + 41, 1581, 50, 1579, 6, 7, 8, 153, 9, 10, + 46, 61, 11, 12, 75, 1612, 13, 14, 51, 65, + 52, 53, 75, 54, 55, 56, 57, 57, 57, 57, + 57, 57, 57, 77, 79, 66, 1579, 83, 58, 67, + + 68, 69, 69, 70, 84, 85, 92, 93, 42, 477, + 43, 43, 44, 32, 32, 95, 71, 37, 114, 96, + 41, 1573, 108, 109, 37, 37, 114, 99, 1612, 100, + 100, 101, 130, 131, 98, 46, 50, 133, 58, 1612, + 98, 1612, 1612, 114, 77, 151, 58, 46, 120, 121, + 185, 186, 61, 61, 1572, 77, 79, 61, 1569, 1612, + 114, 75, 151, 58, 32, 115, 116, 117, 118, 118, + 118, 118, 118, 118, 118, 32, 1612, 156, 75, 1568, + 58, 123, 65, 124, 125, 1565, 126, 127, 128, 129, + 129, 129, 129, 129, 129, 129, 65, 32, 66, 137, + + 1565, 58, 67, 68, 1563, 141, 1563, 145, 1547, 148, + 148, 149, 66, 83, 84, 138, 67, 68, 160, 67, + 139, 142, 161, 66, 71, 67, 143, 67, 146, 1612, + 1546, 1612, 1612, 37, 37, 95, 95, 1543, 37, 95, + 1542, 114, 37, 163, 163, 163, 163, 163, 165, 165, + 165, 165, 165, 95, 170, 46, 46, 96, 172, 46, + 170, 58, 114, 99, 172, 100, 100, 101, 256, 256, + 176, 114, 98, 46, 177, 1612, 193, 194, 98, 209, + 210, 211, 58, 1612, 181, 181, 181, 181, 181, 179, + 46, 58, 258, 258, 1406, 179, 183, 183, 183, 183, + + 183, 114, 114, 1406, 114, 1612, 188, 189, 190, 191, + 191, 191, 191, 191, 191, 191, 263, 263, 114, 114, + 114, 58, 58, 114, 58, 201, 202, 114, 196, 197, + 198, 199, 199, 199, 199, 199, 199, 199, 58, 58, + 58, 1411, 1612, 58, 1612, 1612, 1410, 58, 114, 1406, + 213, 359, 359, 206, 206, 206, 206, 207, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 58, 123, + 58, 124, 125, 1405, 126, 127, 128, 129, 129, 129, + 129, 129, 129, 129, 213, 361, 361, 213, 130, 214, + 215, 216, 217, 217, 217, 217, 217, 217, 217, 131, + + 213, 222, 223, 226, 58, 219, 220, 58, 61, 137, + 981, 137, 245, 245, 245, 245, 980, 229, 980, 61, + 58, 61, 61, 67, 227, 138, 141, 138, 141, 67, + 139, 67, 139, 138, 232, 1208, 236, 67, 230, 352, + 353, 354, 142, 145, 142, 145, 67, 143, 67, 143, + 233, 239, 142, 241, 67, 234, 67, 237, 151, 66, + 246, 66, 246, 67, 146, 67, 146, 66, 243, 156, + 156, 67, 240, 244, 75, 160, 75, 161, 75, 253, + 253, 253, 253, 253, 255, 255, 255, 255, 255, 32, + 32, 95, 95, 246, 176, 37, 1205, 37, 176, 473, + + 474, 176, 990, 176, 114, 114, 989, 177, 984, 75, + 98, 46, 46, 260, 46, 983, 98, 982, 46, 260, + 262, 46, 179, 46, 58, 58, 262, 981, 179, 268, + 268, 268, 268, 268, 270, 270, 270, 270, 270, 114, + 620, 621, 114, 114, 271, 272, 273, 274, 274, 274, + 274, 274, 274, 274, 114, 114, 352, 355, 356, 58, + 276, 277, 58, 58, 283, 283, 283, 283, 283, 781, + 781, 114, 114, 114, 58, 58, 114, 289, 290, 114, + 114, 281, 281, 281, 281, 282, 283, 283, 283, 283, + 283, 58, 58, 58, 782, 782, 58, 114, 980, 58, + + 58, 114, 284, 285, 286, 287, 287, 287, 287, 287, + 287, 287, 296, 296, 296, 296, 296, 58, 114, 114, + 791, 58, 114, 294, 294, 294, 294, 295, 296, 296, + 296, 296, 296, 790, 790, 213, 213, 790, 58, 58, + 114, 782, 58, 781, 213, 300, 300, 300, 300, 300, + 300, 300, 301, 302, 302, 58, 58, 213, 213, 780, + 58, 213, 308, 309, 58, 779, 303, 304, 305, 306, + 306, 306, 306, 306, 306, 306, 610, 58, 58, 213, + 213, 58, 213, 213, 316, 317, 213, 311, 312, 313, + 314, 314, 314, 314, 314, 314, 314, 791, 791, 58, + + 58, 366, 58, 58, 983, 983, 58, 213, 222, 223, + 226, 34, 321, 321, 321, 321, 322, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 58, 61, 61, + 67, 227, 226, 325, 327, 351, 346, 346, 347, 34, + 229, 153, 229, 384, 384, 384, 384, 384, 330, 325, + 232, 244, 67, 227, 67, 328, 138, 232, 138, 333, + 67, 230, 67, 230, 138, 336, 233, 236, 67, 331, + 67, 234, 248, 233, 236, 155, 339, 67, 234, 67, + 334, 233, 239, 142, 239, 67, 337, 67, 237, 241, + 142, 342, 142, 348, 67, 237, 67, 340, 66, 95, + + 66, 95, 67, 240, 67, 240, 176, 66, 350, 244, + 176, 67, 343, 244, 114, 114, 114, 363, 114, 46, + 114, 46, 364, 365, 73, 179, 46, 367, 984, 984, + 46, 179, 368, 369, 58, 58, 58, 366, 58, 150, + 58, 989, 989, 114, 114, 114, 114, 50, 114, 377, + 378, 114, 224, 372, 373, 374, 375, 375, 375, 375, + 375, 375, 375, 58, 58, 58, 58, 114, 58, 114, + 134, 58, 396, 397, 382, 382, 382, 382, 383, 384, + 384, 384, 384, 384, 187, 114, 114, 58, 114, 58, + 114, 169, 114, 114, 114, 388, 388, 388, 388, 388, + + 388, 388, 389, 390, 390, 58, 58, 155, 58, 150, + 58, 114, 58, 58, 58, 114, 391, 392, 393, 394, + 394, 394, 394, 394, 394, 394, 403, 403, 403, 403, + 403, 58, 114, 135, 114, 58, 114, 401, 401, 401, + 401, 402, 403, 403, 403, 403, 403, 134, 114, 114, + 213, 213, 58, 114, 58, 213, 58, 213, 407, 407, + 407, 407, 407, 407, 407, 408, 409, 409, 58, 58, + 58, 58, 1612, 58, 114, 58, 213, 58, 213, 414, + 414, 414, 414, 415, 416, 416, 416, 416, 416, 416, + 416, 416, 416, 416, 58, 213, 58, 106, 58, 90, + + 417, 418, 419, 420, 420, 420, 420, 420, 420, 420, + 213, 213, 475, 475, 475, 58, 422, 423, 429, 429, + 429, 429, 429, 470, 470, 470, 470, 213, 213, 213, + 58, 58, 213, 435, 436, 213, 213, 427, 427, 427, + 427, 428, 429, 429, 429, 429, 429, 58, 58, 58, + 990, 990, 58, 213, 34, 58, 58, 213, 430, 431, + 432, 433, 433, 433, 433, 433, 433, 433, 442, 442, + 442, 442, 442, 58, 213, 63, 449, 58, 327, 440, + 440, 440, 440, 441, 442, 442, 442, 442, 442, 34, + 327, 26, 452, 25, 58, 213, 325, 333, 67, 328, + + 446, 446, 446, 446, 446, 446, 446, 447, 448, 448, + 67, 328, 67, 453, 330, 58, 330, 67, 334, 333, + 1208, 1208, 455, 24, 458, 21, 241, 476, 476, 476, + 138, 336, 138, 336, 67, 331, 67, 331, 138, 67, + 334, 461, 67, 456, 67, 459, 244, 233, 339, 233, + 339, 67, 337, 67, 337, 348, 464, 233, 342, 17, + 176, 67, 462, 1612, 142, 342, 142, 467, 67, 340, + 67, 340, 142, 1612, 66, 244, 67, 465, 67, 343, + 46, 66, 176, 66, 363, 67, 343, 67, 477, 478, + 479, 477, 480, 481, 482, 482, 482, 367, 483, 483, + + 483, 484, 46, 487, 366, 114, 485, 486, 488, 489, + 502, 502, 502, 502, 502, 1612, 1612, 50, 1612, 114, + 114, 366, 114, 50, 114, 58, 114, 495, 496, 490, + 491, 492, 493, 493, 493, 493, 493, 493, 493, 58, + 58, 1612, 58, 114, 58, 114, 58, 114, 114, 1612, + 114, 114, 500, 500, 500, 500, 501, 502, 502, 502, + 502, 502, 1612, 58, 114, 58, 114, 58, 58, 114, + 58, 58, 114, 1612, 506, 506, 506, 506, 506, 506, + 506, 507, 508, 508, 58, 1612, 58, 1408, 1409, 58, + 1411, 1411, 58, 114, 1612, 114, 114, 114, 513, 513, + + 513, 513, 514, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 58, 114, 58, 58, 58, 114, 516, + 517, 518, 519, 519, 519, 519, 519, 519, 519, 114, + 114, 1612, 114, 114, 58, 521, 522, 1612, 58, 528, + 528, 528, 528, 528, 1612, 1612, 114, 114, 114, 58, + 58, 114, 58, 58, 114, 114, 526, 526, 526, 526, + 527, 528, 528, 528, 528, 528, 58, 58, 58, 1493, + 1494, 58, 114, 1612, 58, 58, 114, 532, 532, 532, + 532, 532, 532, 532, 533, 534, 534, 541, 541, 541, + 541, 541, 58, 114, 114, 114, 58, 114, 539, 539, + + 539, 539, 540, 541, 541, 541, 541, 541, 114, 114, + 114, 1612, 213, 58, 58, 58, 1612, 58, 613, 613, + 613, 1612, 548, 549, 1495, 1496, 213, 1612, 58, 58, + 58, 213, 58, 1612, 213, 213, 550, 551, 552, 553, + 553, 553, 553, 553, 553, 553, 58, 213, 1612, 213, + 213, 58, 555, 556, 58, 58, 562, 562, 562, 562, + 562, 1498, 1499, 213, 213, 213, 213, 58, 213, 58, + 58, 574, 575, 560, 560, 560, 560, 561, 562, 562, + 562, 562, 562, 58, 58, 58, 58, 213, 58, 213, + 1612, 213, 213, 213, 566, 566, 566, 566, 566, 566, + + 566, 567, 568, 568, 622, 622, 622, 58, 1612, 58, + 213, 58, 58, 58, 213, 569, 570, 571, 572, 572, + 572, 572, 572, 572, 572, 581, 581, 581, 581, 581, + 58, 213, 213, 1612, 58, 213, 579, 579, 579, 579, + 580, 581, 581, 581, 581, 581, 1500, 1501, 213, 213, + 213, 58, 58, 213, 213, 58, 449, 595, 585, 585, + 585, 585, 585, 585, 585, 586, 587, 587, 58, 58, + 58, 1526, 1527, 58, 58, 213, 325, 325, 452, 1612, + 592, 592, 592, 592, 593, 594, 594, 594, 594, 594, + 594, 594, 594, 594, 594, 58, 452, 1612, 67, 453, + + 597, 1612, 455, 614, 615, 615, 616, 1612, 455, 1612, + 600, 458, 1612, 458, 1612, 602, 67, 453, 138, 1612, + 67, 598, 67, 456, 138, 461, 138, 461, 67, 456, + 67, 67, 459, 67, 459, 67, 603, 605, 1612, 464, + 1612, 233, 348, 233, 348, 67, 462, 67, 462, 464, + 1612, 608, 467, 233, 1612, 142, 1612, 67, 606, 67, + 465, 467, 244, 484, 244, 142, 1612, 142, 66, 67, + 465, 67, 67, 617, 618, 618, 619, 66, 623, 623, + 623, 67, 363, 366, 487, 114, 367, 624, 625, 625, + 626, 627, 628, 628, 629, 630, 630, 630, 631, 631, + + 631, 1612, 366, 114, 50, 58, 50, 114, 637, 638, + 114, 114, 632, 633, 634, 635, 635, 635, 635, 635, + 635, 635, 114, 58, 114, 114, 114, 58, 1528, 1529, + 58, 58, 644, 644, 644, 644, 644, 1612, 114, 114, + 114, 114, 58, 114, 58, 58, 58, 114, 642, 642, + 642, 642, 643, 644, 644, 644, 644, 644, 58, 58, + 58, 58, 1612, 58, 114, 1612, 114, 58, 114, 648, + 648, 648, 648, 648, 648, 648, 649, 650, 650, 657, + 657, 657, 657, 657, 58, 114, 58, 114, 58, 114, + 655, 655, 655, 655, 656, 657, 657, 657, 657, 657, + + 114, 114, 114, 1612, 114, 58, 114, 58, 1612, 58, + 1612, 671, 672, 1612, 664, 665, 1531, 1532, 114, 114, + 58, 58, 58, 114, 58, 114, 58, 114, 666, 667, + 668, 669, 669, 669, 669, 669, 669, 669, 58, 58, + 783, 783, 783, 58, 1612, 58, 114, 58, 114, 114, + 1612, 676, 676, 676, 676, 677, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 58, 114, 58, 58, + 114, 114, 114, 114, 114, 682, 682, 682, 682, 682, + 682, 682, 683, 684, 684, 1533, 1534, 58, 478, 479, + 58, 58, 58, 58, 58, 114, 114, 114, 114, 114, + + 689, 689, 689, 689, 690, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 58, 58, 58, 58, 58, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 708, + 708, 708, 708, 213, 698, 699, 784, 785, 785, 786, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 114, + 1210, 1211, 1612, 58, 706, 706, 706, 707, 708, 708, + 708, 708, 708, 708, 981, 213, 213, 213, 213, 58, + 213, 714, 715, 213, 213, 709, 710, 711, 712, 712, + 712, 712, 712, 712, 712, 58, 58, 58, 58, 1612, + 58, 213, 213, 58, 58, 213, 719, 719, 719, 719, + + 720, 721, 721, 721, 721, 721, 721, 721, 721, 721, + 721, 58, 58, 213, 213, 58, 213, 213, 725, 725, + 725, 725, 725, 725, 725, 726, 727, 727, 213, 1612, + 213, 480, 481, 58, 58, 1612, 58, 58, 734, 734, + 734, 734, 734, 1612, 213, 213, 213, 213, 58, 213, + 58, 740, 741, 213, 732, 732, 732, 732, 733, 734, + 734, 734, 734, 734, 58, 58, 58, 58, 1612, 58, + 213, 1612, 213, 58, 213, 735, 736, 737, 738, 738, + 738, 738, 738, 738, 738, 747, 747, 747, 747, 747, + 58, 213, 58, 213, 58, 213, 745, 745, 745, 745, + + 746, 747, 747, 747, 747, 747, 1612, 213, 213, 213, + 213, 58, 213, 58, 213, 58, 213, 751, 751, 751, + 751, 751, 751, 751, 752, 753, 753, 58, 58, 58, + 58, 1612, 58, 213, 58, 213, 58, 213, 758, 758, + 758, 758, 759, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 58, 213, 58, 213, 58, 595, 597, + 1612, 597, 1612, 770, 1518, 1518, 1519, 767, 768, 600, + 600, 602, 1612, 602, 58, 772, 58, 1612, 325, 67, + 598, 67, 598, 67, 605, 138, 138, 605, 1612, 67, + 67, 67, 603, 67, 603, 67, 773, 775, 608, 608, + + 233, 114, 241, 233, 67, 606, 776, 67, 606, 787, + 788, 788, 789, 233, 142, 142, 114, 67, 67, 67, + 484, 58, 244, 114, 487, 792, 793, 793, 794, 795, + 796, 796, 797, 1523, 1523, 1524, 58, 1551, 1551, 1552, + 366, 114, 114, 58, 50, 114, 803, 804, 114, 114, + 798, 799, 800, 801, 801, 801, 801, 801, 801, 801, + 1612, 58, 58, 345, 345, 58, 114, 114, 58, 58, + 114, 808, 808, 808, 808, 809, 810, 810, 810, 810, + 810, 810, 810, 810, 810, 810, 58, 58, 114, 114, + 58, 114, 114, 814, 814, 814, 814, 814, 814, 814, + + 815, 816, 816, 114, 1612, 114, 114, 114, 58, 58, + 1612, 58, 58, 823, 823, 823, 823, 823, 1612, 114, + 114, 472, 472, 58, 114, 58, 58, 58, 114, 821, + 821, 821, 821, 822, 823, 823, 823, 823, 823, 58, + 58, 830, 831, 114, 58, 114, 114, 114, 58, 114, + 114, 114, 840, 840, 840, 840, 114, 853, 853, 853, + 853, 853, 1612, 58, 1612, 58, 58, 58, 114, 58, + 58, 58, 114, 846, 847, 114, 58, 838, 838, 838, + 839, 840, 840, 840, 840, 840, 840, 1612, 58, 114, + 114, 114, 58, 114, 1612, 58, 114, 114, 841, 842, + + 843, 844, 844, 844, 844, 844, 844, 844, 1612, 58, + 58, 58, 114, 58, 114, 1612, 58, 58, 114, 851, + 851, 851, 851, 852, 853, 853, 853, 853, 853, 1612, + 114, 114, 58, 114, 58, 114, 1612, 114, 58, 114, + 857, 857, 857, 857, 857, 857, 857, 858, 859, 859, + 58, 58, 1612, 58, 1612, 58, 114, 58, 114, 58, + 114, 864, 864, 864, 864, 865, 866, 866, 866, 866, + 866, 866, 866, 866, 866, 866, 58, 114, 58, 114, + 58, 114, 114, 114, 114, 114, 114, 114, 883, 883, + 883, 883, 873, 874, 1556, 1556, 1557, 58, 1612, 58, + + 1612, 58, 58, 58, 58, 58, 58, 58, 114, 114, + 114, 114, 114, 881, 881, 881, 882, 883, 883, 883, + 883, 883, 883, 114, 114, 114, 1612, 114, 58, 58, + 58, 58, 58, 906, 906, 906, 906, 906, 475, 475, + 1612, 213, 213, 58, 58, 58, 114, 58, 476, 476, + 213, 891, 891, 891, 891, 891, 891, 892, 893, 893, + 893, 58, 58, 213, 213, 213, 58, 213, 899, 900, + 58, 213, 894, 895, 896, 897, 897, 897, 897, 897, + 897, 897, 1612, 58, 58, 58, 213, 58, 213, 1612, + 213, 58, 213, 904, 904, 904, 904, 905, 906, 906, + + 906, 906, 906, 1612, 213, 213, 58, 213, 58, 213, + 58, 213, 58, 213, 910, 910, 910, 910, 910, 910, + 910, 911, 912, 912, 58, 58, 1612, 58, 1612, 58, + 213, 58, 213, 58, 213, 917, 917, 917, 917, 918, + 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, + 58, 213, 58, 213, 58, 213, 1612, 213, 213, 213, + 213, 482, 482, 933, 934, 1612, 926, 927, 483, 483, + 1612, 58, 213, 58, 213, 58, 213, 58, 58, 58, + 58, 928, 929, 930, 931, 931, 931, 931, 931, 931, + 931, 1612, 58, 1612, 58, 1612, 58, 213, 213, 213, + + 1612, 213, 938, 938, 938, 938, 939, 940, 940, 940, + 940, 940, 940, 940, 940, 940, 940, 58, 58, 58, + 213, 58, 213, 213, 213, 944, 944, 944, 944, 944, + 944, 944, 945, 946, 946, 213, 1612, 213, 213, 213, + 58, 1612, 58, 58, 58, 953, 953, 953, 953, 953, + 1612, 213, 213, 613, 613, 58, 213, 58, 58, 58, + 213, 951, 951, 951, 951, 952, 953, 953, 953, 953, + 953, 58, 58, 960, 961, 213, 58, 213, 213, 213, + 58, 213, 213, 213, 970, 970, 970, 970, 770, 977, + 978, 978, 979, 622, 622, 58, 1612, 58, 58, 58, + + 770, 58, 58, 58, 213, 772, 1612, 772, 67, 968, + 968, 968, 969, 970, 970, 970, 970, 970, 970, 972, + 67, 775, 775, 114, 58, 67, 773, 67, 773, 348, + 114, 114, 114, 975, 1612, 996, 997, 233, 233, 67, + 363, 67, 67, 58, 114, 985, 985, 986, 367, 244, + 58, 58, 58, 987, 987, 988, 1033, 1033, 1033, 1033, + 366, 623, 623, 1612, 58, 630, 630, 1612, 50, 114, + 1612, 114, 114, 114, 991, 992, 993, 994, 994, 994, + 994, 994, 994, 994, 1003, 1003, 1003, 1003, 1003, 58, + 114, 58, 58, 58, 114, 1001, 1001, 1001, 1001, 1002, + + 1003, 1003, 1003, 1003, 1003, 1612, 114, 114, 114, 114, + 58, 114, 1612, 114, 58, 114, 1007, 1007, 1007, 1007, + 1007, 1007, 1007, 1008, 1009, 1009, 58, 58, 58, 58, + 1612, 58, 114, 58, 114, 58, 114, 1014, 1014, 1014, + 1014, 1015, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, + 1016, 1016, 58, 114, 58, 114, 58, 114, 114, 114, + 114, 114, 114, 114, 1612, 114, 114, 114, 1023, 1024, + 631, 631, 1612, 58, 1612, 58, 1612, 58, 58, 58, + 58, 58, 58, 58, 114, 58, 58, 58, 114, 1031, + 1031, 1031, 1032, 1033, 1033, 1033, 1033, 1033, 1033, 114, + + 114, 114, 1612, 114, 58, 114, 114, 1612, 58, 777, + 777, 1049, 1050, 1086, 1086, 1086, 1086, 114, 114, 58, + 58, 58, 114, 58, 114, 58, 58, 1041, 1041, 1041, + 1041, 1041, 1041, 1042, 1043, 1043, 1043, 58, 58, 781, + 781, 1612, 58, 114, 58, 114, 114, 114, 1044, 1045, + 1046, 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1056, 1056, + 1056, 1056, 1056, 58, 114, 58, 58, 58, 114, 1054, + 1054, 1054, 1054, 1055, 1056, 1056, 1056, 1056, 1056, 1612, + 114, 114, 114, 114, 58, 114, 1612, 114, 58, 114, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1061, 1062, 1062, + + 58, 58, 58, 58, 1612, 58, 114, 58, 114, 58, + 114, 1067, 1067, 1067, 1067, 1068, 1069, 1069, 1069, 1069, + 1069, 1069, 1069, 1069, 1069, 1069, 58, 114, 58, 114, + 58, 114, 114, 114, 114, 114, 114, 114, 1612, 114, + 114, 114, 1076, 1077, 782, 782, 1612, 58, 1612, 58, + 1612, 58, 58, 58, 58, 58, 58, 58, 114, 58, + 58, 58, 114, 1084, 1084, 1084, 1085, 1086, 1086, 1086, + 1086, 1086, 1086, 114, 114, 114, 1612, 114, 58, 114, + 114, 1612, 58, 1107, 1107, 1107, 1107, 1107, 783, 783, + 1612, 114, 114, 58, 58, 58, 114, 58, 114, 58, + + 58, 1094, 1094, 1094, 1094, 1094, 1094, 1095, 1096, 1096, + 1096, 58, 58, 114, 114, 114, 58, 213, 58, 213, + 213, 790, 790, 1612, 1113, 1114, 1120, 1120, 1120, 1120, + 1120, 213, 213, 58, 58, 58, 114, 58, 213, 58, + 58, 1105, 1105, 1105, 1105, 1106, 1107, 1107, 1107, 1107, + 1107, 58, 58, 213, 213, 213, 58, 213, 58, 213, + 213, 213, 1108, 1109, 1110, 1111, 1111, 1111, 1111, 1111, + 1111, 1111, 1612, 58, 58, 58, 213, 58, 213, 58, + 58, 58, 213, 1118, 1118, 1118, 1118, 1119, 1120, 1120, + 1120, 1120, 1120, 791, 791, 1612, 58, 1612, 58, 213, + + 1612, 213, 58, 213, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1125, 1126, 1126, 1133, 1133, 1133, 1133, 1133, 58, + 213, 58, 213, 58, 213, 1131, 1131, 1131, 1131, 1132, + 1133, 1133, 1133, 1133, 1133, 213, 213, 213, 213, 213, + 58, 213, 58, 213, 58, 213, 1612, 213, 1140, 1141, + 1150, 1150, 1150, 1150, 1612, 58, 58, 58, 58, 58, + 1612, 58, 213, 58, 213, 58, 213, 58, 213, 1156, + 1157, 1148, 1148, 1148, 1149, 1150, 1150, 1150, 1150, 1150, + 1150, 1612, 58, 213, 58, 213, 58, 213, 58, 213, + 213, 213, 1151, 1152, 1153, 1154, 1154, 1154, 1154, 1154, + + 1154, 1154, 1612, 58, 1612, 58, 1612, 58, 213, 58, + 58, 58, 213, 1161, 1161, 1161, 1161, 1162, 1163, 1163, + 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 58, 213, + 213, 213, 58, 213, 1167, 1167, 1167, 1167, 1167, 1167, + 1167, 1168, 1169, 1169, 1176, 1176, 1176, 1176, 1176, 58, + 58, 58, 213, 58, 213, 213, 213, 213, 213, 1174, + 1174, 1174, 1174, 1175, 1176, 1176, 1176, 1176, 1176, 213, + 213, 213, 58, 213, 58, 58, 58, 58, 58, 213, + 213, 213, 1183, 1184, 213, 1193, 1193, 1193, 1193, 58, + 58, 58, 1612, 58, 1212, 1213, 1213, 1214, 1612, 58, + + 58, 58, 213, 213, 58, 213, 213, 213, 213, 213, + 1191, 1191, 1191, 1192, 1193, 1193, 1193, 1193, 1193, 1193, + 213, 1612, 58, 58, 213, 58, 58, 58, 58, 58, + 1215, 1215, 1215, 1215, 976, 976, 972, 972, 241, 114, + 58, 213, 983, 983, 58, 1612, 1201, 1201, 1201, 1201, + 1201, 1201, 1202, 1203, 1203, 1203, 67, 67, 244, 58, + 114, 58, 1216, 1216, 1216, 1216, 484, 1612, 114, 487, + 1612, 1217, 1217, 1218, 1219, 1219, 1220, 984, 984, 1612, + 58, 1263, 1263, 1263, 1263, 114, 366, 114, 58, 50, + 114, 1612, 1226, 1227, 114, 1221, 1222, 1223, 1224, 1224, + + 1224, 1224, 1224, 1224, 1224, 58, 1612, 58, 989, 989, + 58, 114, 114, 114, 58, 114, 1231, 1231, 1231, 1231, + 1232, 1233, 1233, 1233, 1233, 1233, 1233, 1233, 1233, 1233, + 1233, 58, 58, 58, 114, 58, 114, 114, 114, 1237, + 1237, 1237, 1237, 1237, 1237, 1237, 1238, 1239, 1239, 114, + 1612, 114, 114, 114, 58, 1612, 58, 58, 58, 1246, + 1246, 1246, 1246, 1246, 1612, 114, 114, 990, 990, 58, + 114, 58, 58, 58, 114, 1244, 1244, 1244, 1244, 1245, + 1246, 1246, 1246, 1246, 1246, 58, 58, 1253, 1254, 114, + 58, 114, 114, 114, 58, 114, 114, 114, 1612, 114, + + 114, 114, 114, 1284, 1284, 1284, 1284, 1284, 1612, 58, + 1612, 58, 58, 58, 114, 58, 58, 58, 114, 58, + 58, 58, 58, 1261, 1261, 1261, 1262, 1263, 1263, 1263, + 1263, 1263, 1263, 114, 58, 114, 1612, 114, 58, 114, + 114, 1056, 1056, 1056, 1056, 1056, 1069, 1069, 1069, 1069, + 1069, 114, 114, 58, 114, 58, 114, 58, 114, 58, + 58, 1271, 1271, 1271, 1271, 1271, 1271, 1272, 1273, 1273, + 1273, 58, 58, 114, 58, 114, 58, 114, 58, 114, + 114, 1208, 1208, 1612, 1049, 1050, 1086, 1086, 1086, 1086, + 1612, 114, 114, 58, 114, 58, 114, 58, 114, 58, + + 58, 1282, 1282, 1282, 1282, 1283, 1284, 1284, 1284, 1284, + 1284, 58, 58, 114, 58, 114, 58, 114, 58, 114, + 114, 114, 1044, 1045, 1046, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1612, 58, 114, 58, 114, 58, 114, 58, + 58, 58, 114, 1054, 1054, 1054, 1054, 1055, 1056, 1056, + 1056, 1056, 1056, 1612, 58, 114, 58, 114, 58, 114, + 1612, 114, 58, 114, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1061, 1062, 1062, 1612, 58, 1612, 58, 114, 58, + 114, 58, 114, 58, 114, 1067, 1067, 1067, 1067, 1068, + 1069, 1069, 1069, 1069, 1069, 1076, 1077, 114, 58, 114, + + 58, 114, 58, 114, 58, 114, 114, 114, 114, 1107, + 1107, 1107, 1107, 1107, 1411, 1411, 1612, 58, 1612, 58, + 114, 58, 114, 58, 114, 58, 58, 58, 58, 1084, + 1084, 1084, 1085, 1086, 1086, 1086, 1086, 1086, 1086, 114, + 58, 114, 58, 114, 58, 1297, 1297, 1297, 1297, 1297, + 1310, 1310, 1310, 1310, 1310, 114, 114, 114, 114, 58, + 114, 58, 114, 58, 114, 1094, 1094, 1094, 1094, 1094, + 1094, 1095, 1096, 1096, 1096, 58, 58, 58, 58, 114, + 58, 114, 58, 213, 58, 1327, 1327, 1327, 1327, 1350, + 1350, 1350, 1350, 1350, 1612, 213, 213, 1612, 213, 58, + + 114, 58, 1612, 58, 213, 1105, 1105, 1105, 1105, 1106, + 1107, 1107, 1107, 1107, 1107, 58, 58, 213, 58, 213, + 58, 213, 1290, 1291, 58, 213, 1285, 1286, 1287, 1288, + 1288, 1288, 1288, 1288, 1288, 1288, 1612, 58, 213, 58, + 213, 58, 213, 1612, 213, 58, 213, 1295, 1295, 1295, + 1295, 1296, 1297, 1297, 1297, 1297, 1297, 1612, 58, 213, + 58, 213, 58, 213, 58, 213, 58, 213, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1302, 1303, 1303, 1612, 58, + 213, 58, 213, 58, 213, 58, 213, 58, 213, 1308, + 1308, 1308, 1308, 1309, 1310, 1310, 1310, 1310, 1310, 213, + + 58, 213, 58, 213, 58, 213, 58, 213, 58, 213, + 1612, 213, 1317, 1318, 213, 1380, 1380, 1380, 1380, 58, + 1612, 58, 1612, 58, 1612, 58, 213, 58, 213, 58, + 213, 58, 213, 213, 58, 1325, 1325, 1325, 1326, 1327, + 1327, 1327, 1327, 1327, 1327, 213, 58, 213, 58, 213, + 58, 1612, 58, 58, 1363, 1363, 1363, 1363, 1363, 1516, + 1516, 213, 213, 1612, 213, 58, 213, 58, 1612, 58, + 213, 1335, 1335, 1335, 1335, 1335, 1335, 1336, 1337, 1337, + 1337, 58, 58, 213, 58, 213, 58, 213, 1343, 1344, + 58, 213, 1338, 1339, 1340, 1341, 1341, 1341, 1341, 1341, + + 1341, 1341, 1612, 58, 213, 58, 213, 58, 213, 1612, + 213, 58, 213, 1348, 1348, 1348, 1348, 1349, 1350, 1350, + 1350, 1350, 1350, 1612, 58, 213, 58, 213, 58, 213, + 58, 213, 58, 213, 1354, 1354, 1354, 1354, 1354, 1354, + 1354, 1355, 1356, 1356, 1612, 58, 213, 58, 213, 58, + 213, 58, 213, 58, 213, 1361, 1361, 1361, 1361, 1362, + 1363, 1363, 1363, 1363, 1363, 213, 58, 213, 58, 213, + 58, 213, 58, 213, 58, 213, 1612, 213, 1370, 1371, + 213, 1418, 1418, 1418, 1418, 58, 1612, 58, 1612, 58, + 1612, 58, 213, 58, 213, 58, 213, 58, 213, 213, + + 58, 1378, 1378, 1378, 1379, 1380, 1380, 1380, 1380, 1380, + 1380, 213, 58, 213, 58, 213, 58, 1612, 58, 58, + 1401, 1401, 1401, 1401, 1401, 1518, 1518, 213, 213, 213, + 213, 58, 213, 58, 213, 58, 213, 1388, 1388, 1388, + 1388, 1388, 1388, 1389, 1390, 1390, 1390, 58, 58, 58, + 58, 213, 58, 241, 58, 348, 58, 1419, 1419, 1419, + 1419, 1233, 1233, 1233, 1233, 1233, 1612, 363, 1612, 1412, + 1413, 58, 213, 244, 114, 244, 114, 1399, 1399, 1399, + 1399, 1400, 1401, 1401, 1401, 1401, 1401, 366, 367, 1612, + 1415, 1416, 58, 114, 58, 1612, 58, 1612, 1226, 1227, + + 1263, 1263, 1263, 1263, 114, 114, 114, 114, 50, 114, + 1612, 114, 114, 58, 1221, 1222, 1223, 1224, 1224, 1224, + 1224, 1224, 1224, 1224, 58, 58, 58, 58, 114, 58, + 114, 58, 58, 114, 114, 1231, 1231, 1231, 1231, 1232, + 1233, 1233, 1233, 1233, 1233, 1612, 114, 114, 58, 114, + 58, 114, 1612, 58, 58, 114, 1237, 1237, 1237, 1237, + 1237, 1237, 1237, 1238, 1239, 1239, 58, 58, 1612, 58, + 1612, 58, 114, 114, 114, 58, 114, 1244, 1244, 1244, + 1244, 1245, 1246, 1246, 1246, 1246, 1246, 1246, 1246, 1246, + 1246, 1246, 58, 58, 58, 114, 58, 114, 114, 114, + + 114, 114, 114, 1612, 114, 114, 114, 114, 1253, 1254, + 1284, 1284, 1284, 1284, 1284, 58, 1612, 58, 58, 58, + 58, 58, 58, 114, 58, 58, 58, 58, 1261, 1261, + 1261, 1262, 1263, 1263, 1263, 1263, 1263, 1263, 114, 114, + 114, 1612, 114, 58, 114, 114, 1432, 1432, 1432, 1432, + 1432, 1445, 1445, 1445, 1445, 1445, 114, 114, 58, 58, + 58, 114, 58, 114, 58, 58, 1271, 1271, 1271, 1271, + 1271, 1271, 1272, 1273, 1273, 1273, 58, 58, 114, 114, + 114, 58, 114, 58, 213, 213, 1462, 1462, 1462, 1462, + 1425, 1426, 1380, 1380, 1380, 1380, 213, 213, 58, 58, + + 58, 114, 58, 213, 58, 58, 1282, 1282, 1282, 1282, + 1283, 1284, 1284, 1284, 1284, 1284, 58, 58, 213, 213, + 213, 58, 213, 58, 213, 213, 213, 1420, 1421, 1422, + 1423, 1423, 1423, 1423, 1423, 1423, 1423, 1612, 58, 58, + 58, 213, 58, 213, 58, 58, 58, 213, 1430, 1430, + 1430, 1430, 1431, 1432, 1432, 1432, 1432, 1432, 1612, 213, + 213, 58, 213, 58, 213, 1612, 213, 58, 213, 1436, + 1436, 1436, 1436, 1436, 1436, 1436, 1437, 1438, 1438, 58, + 58, 1612, 58, 213, 58, 213, 58, 213, 58, 213, + 1443, 1443, 1443, 1443, 1444, 1445, 1445, 1445, 1445, 1445, + + 1452, 1453, 213, 58, 213, 58, 213, 58, 213, 58, + 213, 1612, 213, 213, 213, 213, 1483, 1483, 1483, 1483, + 1483, 1612, 58, 1612, 58, 1612, 58, 213, 58, 213, + 58, 213, 58, 58, 58, 58, 1460, 1460, 1460, 1461, + 1462, 1462, 1462, 1462, 1462, 1462, 213, 58, 213, 58, + 213, 58, 1350, 1350, 1350, 1350, 1350, 1363, 1363, 1363, + 1363, 1363, 213, 213, 213, 213, 58, 213, 58, 213, + 58, 213, 1470, 1470, 1470, 1470, 1470, 1470, 1471, 1472, + 1472, 1472, 58, 58, 58, 58, 213, 58, 213, 58, + 213, 58, 1521, 1521, 1612, 1343, 1344, 1401, 1401, 1401, + + 1401, 1401, 213, 213, 213, 213, 58, 213, 58, 213, + 58, 213, 1481, 1481, 1481, 1481, 1482, 1483, 1483, 1483, + 1483, 1483, 58, 58, 58, 58, 213, 58, 213, 58, + 213, 58, 213, 1338, 1339, 1340, 1341, 1341, 1341, 1341, + 1341, 1341, 1341, 1612, 213, 213, 58, 213, 58, 213, + 58, 213, 58, 213, 1348, 1348, 1348, 1348, 1349, 1350, + 1350, 1350, 1350, 1350, 58, 58, 213, 58, 213, 58, + 213, 58, 213, 58, 213, 1354, 1354, 1354, 1354, 1354, + 1354, 1354, 1355, 1356, 1356, 1612, 58, 1612, 58, 213, + 58, 213, 58, 213, 58, 213, 1361, 1361, 1361, 1361, + + 1362, 1363, 1363, 1363, 1363, 1363, 1370, 1371, 213, 58, + 213, 58, 213, 58, 213, 58, 213, 213, 1490, 1490, + 1490, 1490, 1490, 1492, 1492, 1492, 1492, 1492, 58, 213, + 58, 213, 58, 213, 58, 213, 58, 58, 1378, 1378, + 1378, 1379, 1380, 1380, 1380, 1380, 1380, 1380, 213, 58, + 213, 58, 213, 58, 1612, 58, 1432, 1432, 1432, 1432, + 1432, 1523, 1523, 1612, 213, 213, 213, 213, 58, 213, + 58, 213, 58, 213, 1388, 1388, 1388, 1388, 1388, 1388, + 1389, 1390, 1390, 1390, 58, 58, 58, 58, 213, 58, + 213, 58, 241, 58, 1445, 1445, 1445, 1445, 1445, 1462, + + 1462, 1462, 1462, 1612, 348, 1612, 213, 1612, 58, 213, + 58, 213, 244, 1612, 1399, 1399, 1399, 1399, 1400, 1401, + 1401, 1401, 1401, 1401, 244, 484, 58, 1503, 1504, 58, + 487, 58, 1506, 1507, 213, 213, 1541, 1541, 1612, 1425, + 1426, 1597, 1597, 1597, 1597, 366, 213, 213, 213, 213, + 50, 213, 1612, 213, 58, 58, 1420, 1421, 1422, 1423, + 1423, 1423, 1423, 1423, 1423, 1423, 58, 58, 58, 58, + 213, 58, 213, 58, 213, 213, 213, 1430, 1430, 1430, + 1430, 1431, 1432, 1432, 1432, 1432, 1432, 1612, 213, 213, + 58, 213, 58, 213, 58, 58, 58, 213, 1436, 1436, + + 1436, 1436, 1436, 1436, 1436, 1437, 1438, 1438, 58, 58, + 213, 58, 1612, 58, 213, 213, 213, 58, 213, 1443, + 1443, 1443, 1443, 1444, 1445, 1445, 1445, 1445, 1445, 213, + 58, 1452, 1453, 213, 58, 58, 58, 213, 58, 213, + 213, 1612, 213, 213, 213, 213, 1545, 1545, 1612, 58, + 1549, 1549, 1612, 58, 1551, 1551, 213, 58, 213, 58, + 58, 213, 58, 58, 58, 58, 1460, 1460, 1460, 1461, + 1462, 1462, 1462, 1462, 1462, 1462, 58, 213, 58, 213, + 213, 58, 213, 1483, 1483, 1483, 1483, 1483, 1516, 1516, + 1516, 1516, 1517, 213, 213, 213, 213, 58, 213, 58, + + 58, 213, 58, 1470, 1470, 1470, 1470, 1470, 1470, 1471, + 1472, 1472, 1472, 58, 58, 58, 58, 213, 58, 213, + 241, 58, 348, 1521, 1521, 1521, 1521, 1522, 1549, 1549, + 1549, 1549, 1550, 363, 1612, 1412, 1413, 58, 213, 58, + 244, 241, 244, 1481, 1481, 1481, 1481, 1482, 1483, 1483, + 1483, 1483, 1483, 366, 367, 348, 1415, 1416, 58, 241, + 484, 244, 1503, 1504, 1554, 1554, 1554, 1554, 1555, 487, + 348, 1506, 1507, 1612, 50, 244, 348, 363, 367, 244, + 366, 363, 1612, 1412, 1413, 1564, 1583, 1554, 1554, 50, + 244, 367, 1612, 1415, 1416, 1566, 244, 366, 50, 484, + + 484, 366, 1503, 1504, 1580, 487, 1584, 1506, 1507, 1582, + 363, 50, 1412, 1413, 367, 487, 1415, 1416, 1583, 366, + 366, 1590, 1590, 1591, 1592, 50, 363, 1612, 1412, 1413, + 366, 1556, 1556, 1592, 50, 50, 1584, 367, 1584, 1415, + 1416, 1567, 1567, 1612, 1584, 484, 366, 1503, 1504, 487, + 1612, 1506, 1507, 1584, 1571, 1571, 363, 50, 1412, 1413, + 367, 1612, 1415, 1416, 484, 366, 1503, 1504, 487, 50, + 1506, 1507, 363, 1612, 1412, 1413, 366, 1612, 1612, 367, + 50, 1415, 1416, 484, 366, 1503, 1504, 487, 50, 1506, + 1507, 363, 366, 1412, 1413, 367, 1612, 1415, 1416, 50, + + 1612, 1612, 484, 366, 1503, 1504, 487, 50, 1506, 1507, + 363, 366, 1412, 1413, 367, 50, 1415, 1416, 484, 1612, + 1503, 1504, 366, 1612, 1612, 487, 50, 1506, 1507, 484, + 366, 1503, 1504, 487, 50, 1506, 1507, 1612, 366, 1612, + 1612, 1612, 1612, 1612, 1612, 50, 1612, 1612, 1612, 366, + 1612, 1612, 1612, 50, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 33, 33, 33, 1612, 1612, + 1612, 1612, 33, 36, 1612, 1612, 1612, 36, 36, 36, + + 1612, 1612, 36, 36, 36, 38, 38, 38, 1612, 1612, + 1612, 1612, 38, 45, 1612, 45, 45, 45, 45, 45, + 1612, 1612, 1612, 1612, 45, 47, 47, 47, 1612, 1612, + 1612, 1612, 47, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 1612, 72, 72, 74, 74, 74, 1612, 1612, 1612, + + 1612, 74, 76, 76, 76, 76, 76, 76, 76, 76, + 76, 76, 1612, 76, 76, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 81, 81, 81, 82, 82, 82, 1612, + 1612, 1612, 1612, 82, 86, 1612, 1612, 1612, 86, 86, + 86, 1612, 1612, 86, 86, 86, 87, 87, 87, 91, + 91, 91, 1612, 1612, 1612, 1612, 91, 94, 94, 94, + 97, 1612, 1612, 97, 97, 97, 97, 1612, 1612, 1612, + 97, 97, 1612, 97, 102, 1612, 102, 102, 102, 102, + + 102, 1612, 1612, 1612, 1612, 102, 103, 103, 103, 107, + 107, 107, 1612, 1612, 1612, 1612, 107, 113, 113, 113, + 119, 1612, 1612, 1612, 119, 119, 119, 1612, 1612, 1612, + 1612, 119, 122, 1612, 1612, 1612, 122, 122, 122, 1612, + 1612, 1612, 1612, 122, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, + + 144, 144, 144, 144, 147, 147, 147, 152, 152, 152, + 152, 1612, 1612, 1612, 1612, 152, 154, 154, 154, 1612, + 1612, 1612, 1612, 154, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 158, 158, + 158, 159, 159, 159, 162, 162, 162, 164, 164, 164, + 166, 166, 166, 171, 1612, 1612, 1612, 171, 171, 171, + 1612, 1612, 1612, 171, 171, 1612, 171, 174, 1612, 174, + 174, 174, 175, 175, 175, 178, 1612, 1612, 178, 178, + 178, 178, 1612, 1612, 1612, 178, 178, 1612, 178, 180, + 180, 180, 182, 182, 182, 184, 184, 184, 192, 1612, + + 1612, 1612, 192, 192, 192, 1612, 1612, 1612, 1612, 192, + 195, 1612, 1612, 1612, 195, 195, 195, 1612, 1612, 1612, + 1612, 195, 200, 1612, 1612, 1612, 200, 200, 200, 1612, + 1612, 1612, 1612, 200, 203, 1612, 1612, 1612, 203, 203, + 203, 1612, 1612, 1612, 1612, 203, 204, 1612, 1612, 1612, + 204, 204, 204, 1612, 1612, 1612, 1612, 204, 205, 1612, + 1612, 1612, 205, 205, 205, 1612, 1612, 1612, 1612, 205, + 212, 212, 212, 218, 1612, 1612, 1612, 218, 218, 218, + 1612, 1612, 1612, 1612, 218, 221, 1612, 1612, 1612, 221, + 221, 221, 1612, 1612, 1612, 1612, 221, 59, 59, 59, + + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 1612, 225, 225, + 225, 225, 225, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + + 140, 140, 140, 231, 231, 231, 231, 231, 231, 231, + 231, 231, 231, 231, 231, 231, 231, 231, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 144, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 242, 1612, 1612, 1612, 242, 242, 1612, + 242, 1612, 1612, 1612, 242, 245, 245, 245, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 1612, 72, 72, 74, 74, 74, 152, 152, 152, 152, + + 1612, 1612, 1612, 1612, 152, 247, 247, 247, 247, 1612, + 1612, 1612, 1612, 247, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 249, 249, + 249, 86, 1612, 1612, 1612, 86, 86, 86, 1612, 1612, + 86, 86, 86, 250, 250, 250, 251, 251, 251, 252, + 252, 252, 254, 254, 254, 257, 1612, 257, 257, 257, + 171, 1612, 1612, 1612, 171, 171, 171, 1612, 1612, 1612, + 171, 171, 1612, 171, 259, 1612, 259, 259, 259, 174, + 174, 174, 175, 1612, 1612, 1612, 175, 175, 175, 1612, + 1612, 1612, 175, 175, 1612, 175, 261, 1612, 1612, 1612, + + 261, 261, 261, 1612, 1612, 1612, 261, 261, 1612, 261, + 178, 1612, 1612, 178, 178, 178, 178, 1612, 1612, 1612, + 178, 178, 1612, 178, 264, 1612, 264, 264, 264, 265, + 265, 265, 266, 266, 266, 267, 267, 267, 269, 269, + 269, 275, 1612, 1612, 1612, 275, 275, 275, 1612, 1612, + 1612, 1612, 275, 278, 1612, 1612, 1612, 278, 278, 278, + 1612, 1612, 1612, 1612, 278, 279, 1612, 1612, 1612, 279, + 279, 279, 1612, 1612, 1612, 1612, 279, 280, 1612, 1612, + 1612, 280, 280, 280, 1612, 1612, 1612, 1612, 280, 288, + 1612, 1612, 1612, 288, 288, 288, 1612, 1612, 1612, 1612, + + 288, 291, 1612, 1612, 1612, 291, 291, 291, 1612, 1612, + 1612, 1612, 291, 292, 1612, 1612, 1612, 292, 292, 292, + 1612, 1612, 1612, 1612, 292, 293, 1612, 1612, 1612, 293, + 293, 293, 1612, 1612, 1612, 1612, 293, 297, 1612, 1612, + 1612, 297, 297, 297, 1612, 1612, 1612, 1612, 297, 298, + 1612, 1612, 1612, 298, 298, 298, 1612, 1612, 1612, 1612, + 298, 299, 1612, 1612, 1612, 299, 299, 299, 1612, 1612, + 1612, 1612, 299, 302, 1612, 1612, 1612, 302, 302, 302, + 1612, 1612, 1612, 1612, 302, 307, 1612, 1612, 1612, 307, + 307, 307, 1612, 1612, 1612, 1612, 307, 310, 1612, 1612, + + 1612, 310, 310, 310, 1612, 1612, 1612, 1612, 310, 315, + 1612, 1612, 1612, 315, 315, 315, 1612, 1612, 1612, 1612, + 315, 318, 1612, 1612, 1612, 318, 318, 318, 1612, 1612, + 1612, 1612, 318, 319, 1612, 1612, 1612, 319, 319, 319, + 1612, 1612, 1612, 1612, 319, 320, 1612, 1612, 1612, 320, + 320, 320, 1612, 1612, 1612, 1612, 320, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 324, 324, 324, 324, 324, 324, 324, 324, + 324, 1612, 324, 324, 324, 1612, 324, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 1612, 225, 225, 225, + + 225, 225, 326, 326, 326, 326, 326, 326, 326, 326, + 326, 1612, 326, 326, 326, 326, 326, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 231, 231, 231, + 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, + 231, 231, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 1612, 332, 332, 332, 332, 332, 335, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 235, 235, 235, 235, 235, 235, 235, 235, + + 235, 235, 235, 235, 235, 235, 235, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 341, 341, 341, + 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, + 341, 341, 344, 344, 344, 349, 1612, 1612, 1612, 349, + 349, 1612, 349, 1612, 1612, 1612, 349, 154, 154, 154, + 247, 247, 247, 247, 1612, 1612, 1612, 1612, 247, 357, + 357, 357, 358, 358, 358, 257, 257, 257, 259, 259, + 259, 360, 1612, 360, 360, 360, 261, 1612, 1612, 1612, + + 261, 261, 261, 1612, 1612, 1612, 261, 261, 1612, 261, + 362, 1612, 362, 362, 362, 264, 264, 264, 370, 370, + 370, 371, 371, 371, 376, 1612, 1612, 1612, 376, 376, + 376, 1612, 1612, 1612, 1612, 376, 379, 1612, 1612, 1612, + 379, 379, 379, 1612, 1612, 1612, 1612, 379, 380, 1612, + 1612, 1612, 380, 380, 380, 1612, 1612, 1612, 1612, 380, + 381, 1612, 1612, 1612, 381, 381, 381, 1612, 1612, 1612, + 1612, 381, 385, 1612, 1612, 1612, 385, 385, 385, 1612, + 1612, 1612, 1612, 385, 386, 1612, 1612, 1612, 386, 386, + 386, 1612, 1612, 1612, 1612, 386, 387, 1612, 1612, 1612, + + 387, 387, 387, 1612, 1612, 1612, 1612, 387, 390, 1612, + 1612, 1612, 390, 390, 390, 1612, 1612, 1612, 1612, 390, + 395, 1612, 1612, 1612, 395, 395, 395, 1612, 1612, 1612, + 1612, 395, 398, 1612, 1612, 1612, 398, 398, 398, 1612, + 1612, 1612, 1612, 398, 399, 1612, 1612, 1612, 399, 399, + 399, 1612, 1612, 1612, 1612, 399, 400, 1612, 1612, 1612, + 400, 400, 400, 1612, 1612, 1612, 1612, 400, 404, 1612, + 1612, 1612, 404, 404, 404, 1612, 1612, 1612, 1612, 404, + 405, 1612, 1612, 1612, 405, 405, 405, 1612, 1612, 1612, + 1612, 405, 406, 1612, 1612, 1612, 406, 406, 406, 1612, + + 1612, 1612, 1612, 406, 409, 1612, 1612, 1612, 409, 409, + 409, 1612, 1612, 1612, 1612, 409, 410, 1612, 1612, 1612, + 410, 410, 410, 1612, 1612, 1612, 1612, 410, 411, 1612, + 1612, 1612, 411, 411, 411, 1612, 1612, 1612, 1612, 411, + 412, 1612, 1612, 1612, 412, 412, 412, 1612, 1612, 1612, + 1612, 412, 413, 1612, 1612, 1612, 413, 413, 413, 1612, + 1612, 1612, 1612, 413, 421, 1612, 1612, 1612, 421, 421, + 421, 1612, 1612, 1612, 1612, 421, 424, 1612, 1612, 1612, + 424, 424, 424, 1612, 1612, 1612, 1612, 424, 425, 1612, + 1612, 1612, 425, 425, 425, 1612, 1612, 1612, 1612, 425, + + 426, 1612, 1612, 1612, 426, 426, 426, 1612, 1612, 1612, + 1612, 426, 434, 1612, 1612, 1612, 434, 434, 434, 1612, + 1612, 1612, 1612, 434, 437, 1612, 1612, 1612, 437, 437, + 437, 1612, 1612, 1612, 1612, 437, 438, 1612, 1612, 1612, + 438, 438, 438, 1612, 1612, 1612, 1612, 438, 439, 1612, + 1612, 1612, 439, 439, 439, 1612, 1612, 1612, 1612, 439, + 443, 1612, 1612, 1612, 443, 443, 443, 1612, 1612, 1612, + 1612, 443, 444, 1612, 1612, 1612, 444, 444, 444, 1612, + 1612, 1612, 1612, 444, 445, 1612, 1612, 1612, 445, 445, + 445, 1612, 1612, 1612, 1612, 445, 448, 1612, 1612, 1612, + + 448, 448, 448, 1612, 1612, 1612, 1612, 448, 324, 324, + 324, 324, 324, 324, 324, 324, 324, 1612, 324, 324, + 324, 1612, 324, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 1612, 450, 450, 450, 1612, 450, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 1612, 326, 326, + 326, 326, 326, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 1612, 451, 451, 451, 451, 451, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 454, 454, 454, 454, 454, 454, 454, + 454, 454, 454, 454, 454, 454, 454, 454, 332, 332, + + 332, 332, 332, 332, 332, 332, 332, 1612, 332, 332, + 332, 332, 332, 457, 457, 457, 457, 457, 457, 457, + 457, 457, 1612, 457, 457, 457, 457, 457, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 460, 460, 460, 460, 460, 460, 460, + 460, 460, 460, 460, 460, 460, 460, 460, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 341, 341, + 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, + + 341, 341, 341, 466, 466, 466, 466, 466, 466, 466, + 466, 466, 466, 466, 466, 466, 1612, 466, 468, 1612, + 1612, 1612, 468, 468, 1612, 1612, 1612, 1612, 1612, 468, + 469, 469, 469, 470, 470, 470, 471, 471, 471, 360, + 360, 360, 362, 362, 362, 107, 107, 107, 1612, 1612, + 1612, 1612, 107, 494, 1612, 1612, 1612, 494, 494, 494, + 1612, 1612, 1612, 1612, 494, 497, 1612, 1612, 1612, 497, + 497, 497, 1612, 1612, 1612, 1612, 497, 498, 1612, 1612, + 1612, 498, 498, 498, 1612, 1612, 1612, 1612, 498, 499, + 1612, 1612, 1612, 499, 499, 499, 1612, 1612, 1612, 1612, + + 499, 503, 1612, 1612, 1612, 503, 503, 503, 1612, 1612, + 1612, 1612, 503, 504, 1612, 1612, 1612, 504, 504, 504, + 1612, 1612, 1612, 1612, 504, 505, 1612, 1612, 1612, 505, + 505, 505, 1612, 1612, 1612, 1612, 505, 508, 1612, 1612, + 1612, 508, 508, 508, 1612, 1612, 1612, 1612, 508, 509, + 1612, 1612, 1612, 509, 509, 509, 1612, 1612, 1612, 1612, + 509, 510, 1612, 1612, 1612, 510, 510, 510, 1612, 1612, + 1612, 1612, 510, 511, 1612, 1612, 1612, 511, 511, 511, + 1612, 1612, 1612, 1612, 511, 512, 1612, 1612, 1612, 512, + 512, 512, 1612, 1612, 1612, 1612, 512, 520, 1612, 1612, + + 1612, 520, 520, 520, 1612, 1612, 1612, 1612, 520, 523, + 1612, 1612, 1612, 523, 523, 523, 1612, 1612, 1612, 1612, + 523, 524, 1612, 1612, 1612, 524, 524, 524, 1612, 1612, + 1612, 1612, 524, 525, 1612, 1612, 1612, 525, 525, 525, + 1612, 1612, 1612, 1612, 525, 529, 1612, 1612, 1612, 529, + 529, 529, 1612, 1612, 1612, 1612, 529, 530, 1612, 1612, + 1612, 530, 530, 530, 1612, 1612, 1612, 1612, 530, 531, + 1612, 1612, 1612, 531, 531, 531, 1612, 1612, 1612, 1612, + 531, 534, 1612, 1612, 1612, 534, 534, 534, 1612, 1612, + 1612, 1612, 534, 535, 1612, 1612, 1612, 535, 535, 535, + + 1612, 1612, 1612, 1612, 535, 536, 1612, 1612, 1612, 536, + 536, 536, 1612, 1612, 1612, 1612, 536, 537, 1612, 1612, + 1612, 537, 537, 537, 1612, 1612, 1612, 1612, 537, 538, + 1612, 1612, 1612, 538, 538, 538, 1612, 1612, 1612, 1612, + 538, 542, 1612, 1612, 1612, 542, 542, 542, 1612, 1612, + 1612, 1612, 542, 543, 1612, 1612, 1612, 543, 543, 543, + 1612, 1612, 1612, 1612, 543, 544, 1612, 1612, 1612, 544, + 544, 544, 1612, 1612, 1612, 1612, 544, 545, 1612, 1612, + 1612, 545, 545, 545, 1612, 1612, 1612, 1612, 545, 546, + 1612, 1612, 1612, 546, 546, 546, 1612, 1612, 1612, 1612, + + 546, 547, 1612, 1612, 1612, 547, 547, 547, 1612, 1612, + 1612, 1612, 547, 549, 1612, 1612, 1612, 549, 549, 549, + 1612, 1612, 1612, 1612, 549, 554, 1612, 1612, 1612, 554, + 554, 554, 1612, 1612, 1612, 1612, 554, 557, 1612, 1612, + 1612, 557, 557, 557, 1612, 1612, 1612, 1612, 557, 558, + 1612, 1612, 1612, 558, 558, 558, 1612, 1612, 1612, 1612, + 558, 559, 1612, 1612, 1612, 559, 559, 559, 1612, 1612, + 1612, 1612, 559, 563, 1612, 1612, 1612, 563, 563, 563, + 1612, 1612, 1612, 1612, 563, 564, 1612, 1612, 1612, 564, + 564, 564, 1612, 1612, 1612, 1612, 564, 565, 1612, 1612, + + 1612, 565, 565, 565, 1612, 1612, 1612, 1612, 565, 568, + 1612, 1612, 1612, 568, 568, 568, 1612, 1612, 1612, 1612, + 568, 573, 1612, 1612, 1612, 573, 573, 573, 1612, 1612, + 1612, 1612, 573, 576, 1612, 1612, 1612, 576, 576, 576, + 1612, 1612, 1612, 1612, 576, 577, 1612, 1612, 1612, 577, + 577, 577, 1612, 1612, 1612, 1612, 577, 578, 1612, 1612, + 1612, 578, 578, 578, 1612, 1612, 1612, 1612, 578, 582, + 1612, 1612, 1612, 582, 582, 582, 1612, 1612, 1612, 1612, + 582, 583, 1612, 1612, 1612, 583, 583, 583, 1612, 1612, + 1612, 1612, 583, 584, 1612, 1612, 1612, 584, 584, 584, + + 1612, 1612, 1612, 1612, 584, 587, 1612, 1612, 1612, 587, + 587, 587, 1612, 1612, 1612, 1612, 587, 588, 1612, 1612, + 1612, 588, 588, 588, 1612, 1612, 1612, 1612, 588, 589, + 1612, 1612, 1612, 589, 589, 589, 1612, 1612, 1612, 1612, + 589, 590, 1612, 1612, 1612, 590, 590, 590, 1612, 1612, + 1612, 1612, 590, 591, 1612, 1612, 1612, 591, 591, 591, + 1612, 1612, 1612, 1612, 591, 324, 324, 324, 324, 324, + 324, 324, 324, 324, 1612, 324, 324, 324, 1612, 324, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 1612, + 450, 450, 450, 1612, 450, 451, 451, 451, 451, 451, + + 451, 451, 451, 451, 1612, 451, 451, 451, 451, 451, + 596, 596, 596, 596, 596, 596, 596, 596, 596, 1612, + 596, 596, 596, 596, 596, 454, 454, 454, 454, 454, + 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, + 599, 599, 599, 1612, 599, 457, 457, 457, 457, 457, + 457, 457, 457, 457, 1612, 457, 457, 457, 457, 457, + 601, 601, 601, 601, 601, 601, 601, 601, 601, 1612, + 601, 601, 601, 601, 601, 460, 460, 460, 460, 460, + 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, + + 604, 604, 604, 604, 604, 604, 604, 604, 604, 604, + 604, 604, 604, 604, 604, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 1612, 607, 466, 466, 466, 466, 466, + 466, 466, 466, 466, 466, 466, 466, 466, 1612, 466, + 609, 609, 609, 349, 1612, 1612, 1612, 349, 349, 1612, + 1612, 1612, 1612, 1612, 349, 611, 1612, 1612, 1612, 611, + 611, 1612, 1612, 1612, 1612, 1612, 611, 612, 612, 612, + 636, 1612, 1612, 1612, 636, 636, 636, 1612, 1612, 1612, + + 1612, 636, 639, 1612, 1612, 1612, 639, 639, 639, 1612, + 1612, 1612, 1612, 639, 640, 1612, 1612, 1612, 640, 640, + 640, 1612, 1612, 1612, 1612, 640, 641, 1612, 1612, 1612, + 641, 641, 641, 1612, 1612, 1612, 1612, 641, 645, 1612, + 1612, 1612, 645, 645, 645, 1612, 1612, 1612, 1612, 645, + 646, 1612, 1612, 1612, 646, 646, 646, 1612, 1612, 1612, + 1612, 646, 647, 1612, 1612, 1612, 647, 647, 647, 1612, + 1612, 1612, 1612, 647, 650, 1612, 1612, 1612, 650, 650, + 650, 1612, 1612, 1612, 1612, 650, 651, 1612, 1612, 1612, + 651, 651, 651, 1612, 1612, 1612, 1612, 651, 652, 1612, + + 1612, 1612, 652, 652, 652, 1612, 1612, 1612, 1612, 652, + 653, 1612, 1612, 1612, 653, 653, 653, 1612, 1612, 1612, + 1612, 653, 654, 1612, 1612, 1612, 654, 654, 654, 1612, + 1612, 1612, 1612, 654, 658, 1612, 1612, 1612, 658, 658, + 658, 1612, 1612, 1612, 1612, 658, 659, 1612, 1612, 1612, + 659, 659, 659, 1612, 1612, 1612, 1612, 659, 660, 1612, + 1612, 1612, 660, 660, 660, 1612, 1612, 1612, 1612, 660, + 661, 1612, 1612, 1612, 661, 661, 661, 1612, 1612, 1612, + 1612, 661, 662, 1612, 1612, 1612, 662, 662, 662, 1612, + 1612, 1612, 1612, 662, 663, 1612, 1612, 1612, 663, 663, + + 663, 1612, 1612, 1612, 1612, 663, 665, 1612, 1612, 1612, + 665, 665, 665, 1612, 1612, 1612, 1612, 665, 670, 1612, + 1612, 1612, 670, 670, 670, 1612, 1612, 1612, 1612, 670, + 673, 1612, 1612, 1612, 673, 673, 673, 1612, 1612, 1612, + 1612, 673, 674, 1612, 1612, 1612, 674, 674, 674, 1612, + 1612, 1612, 1612, 674, 675, 1612, 1612, 1612, 675, 675, + 675, 1612, 1612, 1612, 1612, 675, 679, 1612, 1612, 1612, + 679, 679, 679, 1612, 1612, 1612, 1612, 679, 680, 1612, + 1612, 1612, 680, 680, 680, 1612, 1612, 1612, 1612, 680, + 681, 1612, 1612, 1612, 681, 681, 681, 1612, 1612, 1612, + + 1612, 681, 684, 1612, 1612, 1612, 684, 684, 684, 1612, + 1612, 1612, 1612, 684, 685, 1612, 1612, 1612, 685, 685, + 685, 1612, 1612, 1612, 1612, 685, 686, 1612, 1612, 1612, + 686, 686, 686, 1612, 1612, 1612, 1612, 686, 687, 1612, + 1612, 1612, 687, 687, 687, 1612, 1612, 1612, 1612, 687, + 688, 1612, 1612, 1612, 688, 688, 688, 1612, 1612, 1612, + 1612, 688, 692, 1612, 1612, 1612, 692, 692, 692, 1612, + 1612, 1612, 1612, 692, 693, 1612, 1612, 1612, 693, 693, + 693, 1612, 1612, 1612, 1612, 693, 694, 1612, 1612, 1612, + 694, 694, 694, 1612, 1612, 1612, 1612, 694, 695, 1612, + + 1612, 1612, 695, 695, 695, 1612, 1612, 1612, 1612, 695, + 696, 1612, 1612, 1612, 696, 696, 696, 1612, 1612, 1612, + 1612, 696, 697, 1612, 1612, 1612, 697, 697, 697, 1612, + 1612, 1612, 1612, 697, 699, 1612, 1612, 1612, 699, 699, + 699, 1612, 1612, 1612, 1612, 699, 700, 1612, 1612, 1612, + 700, 700, 700, 1612, 1612, 1612, 1612, 700, 701, 1612, + 1612, 1612, 701, 701, 701, 1612, 1612, 1612, 1612, 701, + 702, 1612, 1612, 1612, 702, 702, 702, 1612, 1612, 1612, + 1612, 702, 703, 1612, 1612, 1612, 703, 703, 703, 1612, + 1612, 1612, 1612, 703, 704, 1612, 1612, 1612, 704, 704, + + 704, 1612, 1612, 1612, 1612, 704, 705, 1612, 1612, 1612, + 705, 705, 705, 1612, 1612, 1612, 1612, 705, 713, 1612, + 1612, 1612, 713, 713, 713, 1612, 1612, 1612, 1612, 713, + 716, 1612, 1612, 1612, 716, 716, 716, 1612, 1612, 1612, + 1612, 716, 717, 1612, 1612, 1612, 717, 717, 717, 1612, + 1612, 1612, 1612, 717, 718, 1612, 1612, 1612, 718, 718, + 718, 1612, 1612, 1612, 1612, 718, 722, 1612, 1612, 1612, + 722, 722, 722, 1612, 1612, 1612, 1612, 722, 723, 1612, + 1612, 1612, 723, 723, 723, 1612, 1612, 1612, 1612, 723, + 724, 1612, 1612, 1612, 724, 724, 724, 1612, 1612, 1612, + + 1612, 724, 727, 1612, 1612, 1612, 727, 727, 727, 1612, + 1612, 1612, 1612, 727, 728, 1612, 1612, 1612, 728, 728, + 728, 1612, 1612, 1612, 1612, 728, 729, 1612, 1612, 1612, + 729, 729, 729, 1612, 1612, 1612, 1612, 729, 730, 1612, + 1612, 1612, 730, 730, 730, 1612, 1612, 1612, 1612, 730, + 731, 1612, 1612, 1612, 731, 731, 731, 1612, 1612, 1612, + 1612, 731, 739, 1612, 1612, 1612, 739, 739, 739, 1612, + 1612, 1612, 1612, 739, 742, 1612, 1612, 1612, 742, 742, + 742, 1612, 1612, 1612, 1612, 742, 743, 1612, 1612, 1612, + 743, 743, 743, 1612, 1612, 1612, 1612, 743, 744, 1612, + + 1612, 1612, 744, 744, 744, 1612, 1612, 1612, 1612, 744, + 748, 1612, 1612, 1612, 748, 748, 748, 1612, 1612, 1612, + 1612, 748, 749, 1612, 1612, 1612, 749, 749, 749, 1612, + 1612, 1612, 1612, 749, 750, 1612, 1612, 1612, 750, 750, + 750, 1612, 1612, 1612, 1612, 750, 753, 1612, 1612, 1612, + 753, 753, 753, 1612, 1612, 1612, 1612, 753, 754, 1612, + 1612, 1612, 754, 754, 754, 1612, 1612, 1612, 1612, 754, + 755, 1612, 1612, 1612, 755, 755, 755, 1612, 1612, 1612, + 1612, 755, 756, 1612, 1612, 1612, 756, 756, 756, 1612, + 1612, 1612, 1612, 756, 757, 1612, 1612, 1612, 757, 757, + + 757, 1612, 1612, 1612, 1612, 757, 761, 1612, 1612, 1612, + 761, 761, 761, 1612, 1612, 1612, 1612, 761, 762, 1612, + 1612, 1612, 762, 762, 762, 1612, 1612, 1612, 1612, 762, + 763, 1612, 1612, 1612, 763, 763, 763, 1612, 1612, 1612, + 1612, 763, 764, 1612, 1612, 1612, 764, 764, 764, 1612, + 1612, 1612, 1612, 764, 765, 1612, 1612, 1612, 765, 765, + 765, 1612, 1612, 1612, 1612, 765, 766, 1612, 1612, 1612, + 766, 766, 766, 1612, 1612, 1612, 1612, 766, 768, 1612, + 1612, 1612, 768, 768, 768, 1612, 1612, 1612, 1612, 768, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 1612, + + 450, 450, 450, 1612, 450, 596, 596, 596, 596, 596, + 596, 596, 596, 596, 1612, 596, 596, 596, 596, 596, + 769, 769, 769, 769, 769, 769, 769, 769, 769, 1612, + 769, 769, 769, 1612, 769, 599, 599, 599, 599, 599, + 599, 599, 599, 599, 599, 599, 599, 599, 1612, 599, + 601, 601, 601, 601, 601, 601, 601, 601, 601, 1612, + 601, 601, 601, 601, 601, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 1612, 771, 771, 771, 771, 771, + 604, 604, 604, 604, 604, 604, 604, 604, 604, 604, + 604, 604, 604, 604, 604, 774, 774, 774, 774, 774, + + 774, 774, 774, 774, 774, 774, 774, 774, 1612, 774, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 1612, 607, 778, 778, 778, 802, 1612, + 1612, 1612, 802, 802, 802, 1612, 1612, 1612, 1612, 802, + 805, 1612, 1612, 1612, 805, 805, 805, 1612, 1612, 1612, + 1612, 805, 806, 1612, 1612, 1612, 806, 806, 806, 1612, + 1612, 1612, 1612, 806, 807, 1612, 1612, 1612, 807, 807, + 807, 1612, 1612, 1612, 1612, 807, 811, 1612, 1612, 1612, + 811, 811, 811, 1612, 1612, 1612, 1612, 811, 812, 1612, + 1612, 1612, 812, 812, 812, 1612, 1612, 1612, 1612, 812, + + 813, 1612, 1612, 1612, 813, 813, 813, 1612, 1612, 1612, + 1612, 813, 816, 1612, 1612, 1612, 816, 816, 816, 1612, + 1612, 1612, 1612, 816, 817, 1612, 1612, 1612, 817, 817, + 817, 1612, 1612, 1612, 1612, 817, 818, 1612, 1612, 1612, + 818, 818, 818, 1612, 1612, 1612, 1612, 818, 819, 1612, + 1612, 1612, 819, 819, 819, 1612, 1612, 1612, 1612, 819, + 820, 1612, 1612, 1612, 820, 820, 820, 1612, 1612, 1612, + 1612, 820, 824, 1612, 1612, 1612, 824, 824, 824, 1612, + 1612, 1612, 1612, 824, 825, 1612, 1612, 1612, 825, 825, + 825, 1612, 1612, 1612, 1612, 825, 826, 1612, 1612, 1612, + + 826, 826, 826, 1612, 1612, 1612, 1612, 826, 827, 1612, + 1612, 1612, 827, 827, 827, 1612, 1612, 1612, 1612, 827, + 828, 1612, 1612, 1612, 828, 828, 828, 1612, 1612, 1612, + 1612, 828, 829, 1612, 1612, 1612, 829, 829, 829, 1612, + 1612, 1612, 1612, 829, 831, 1612, 1612, 1612, 831, 831, + 831, 1612, 1612, 1612, 1612, 831, 832, 1612, 1612, 1612, + 832, 832, 832, 1612, 1612, 1612, 1612, 832, 833, 1612, + 1612, 1612, 833, 833, 833, 1612, 1612, 1612, 1612, 833, + 834, 1612, 1612, 1612, 834, 834, 834, 1612, 1612, 1612, + 1612, 834, 835, 1612, 1612, 1612, 835, 835, 835, 1612, + + 1612, 1612, 1612, 835, 836, 1612, 1612, 1612, 836, 836, + 836, 1612, 1612, 1612, 1612, 836, 837, 1612, 1612, 1612, + 837, 837, 837, 1612, 1612, 1612, 1612, 837, 845, 1612, + 1612, 1612, 845, 845, 845, 1612, 1612, 1612, 1612, 845, + 848, 1612, 1612, 1612, 848, 848, 848, 1612, 1612, 1612, + 1612, 848, 849, 1612, 1612, 1612, 849, 849, 849, 1612, + 1612, 1612, 1612, 849, 850, 1612, 1612, 1612, 850, 850, + 850, 1612, 1612, 1612, 1612, 850, 854, 1612, 1612, 1612, + 854, 854, 854, 1612, 1612, 1612, 1612, 854, 855, 1612, + 1612, 1612, 855, 855, 855, 1612, 1612, 1612, 1612, 855, + + 856, 1612, 1612, 1612, 856, 856, 856, 1612, 1612, 1612, + 1612, 856, 859, 1612, 1612, 1612, 859, 859, 859, 1612, + 1612, 1612, 1612, 859, 860, 1612, 1612, 1612, 860, 860, + 860, 1612, 1612, 1612, 1612, 860, 861, 1612, 1612, 1612, + 861, 861, 861, 1612, 1612, 1612, 1612, 861, 862, 1612, + 1612, 1612, 862, 862, 862, 1612, 1612, 1612, 1612, 862, + 863, 1612, 1612, 1612, 863, 863, 863, 1612, 1612, 1612, + 1612, 863, 867, 1612, 1612, 1612, 867, 867, 867, 1612, + 1612, 1612, 1612, 867, 868, 1612, 1612, 1612, 868, 868, + 868, 1612, 1612, 1612, 1612, 868, 869, 1612, 1612, 1612, + + 869, 869, 869, 1612, 1612, 1612, 1612, 869, 870, 1612, + 1612, 1612, 870, 870, 870, 1612, 1612, 1612, 1612, 870, + 871, 1612, 1612, 1612, 871, 871, 871, 1612, 1612, 1612, + 1612, 871, 872, 1612, 1612, 1612, 872, 872, 872, 1612, + 1612, 1612, 1612, 872, 874, 1612, 1612, 1612, 874, 874, + 874, 1612, 1612, 1612, 1612, 874, 875, 1612, 1612, 1612, + 875, 875, 875, 1612, 1612, 1612, 1612, 875, 876, 1612, + 1612, 1612, 876, 876, 876, 1612, 1612, 1612, 1612, 876, + 877, 1612, 1612, 1612, 877, 877, 877, 1612, 1612, 1612, + 1612, 877, 878, 1612, 1612, 1612, 878, 878, 878, 1612, + + 1612, 1612, 1612, 878, 879, 1612, 1612, 1612, 879, 879, + 879, 1612, 1612, 1612, 1612, 879, 880, 1612, 1612, 1612, + 880, 880, 880, 1612, 1612, 1612, 1612, 880, 884, 1612, + 1612, 1612, 884, 884, 884, 1612, 1612, 1612, 1612, 884, + 885, 1612, 1612, 1612, 885, 885, 885, 1612, 1612, 1612, + 1612, 885, 886, 1612, 1612, 1612, 886, 886, 886, 1612, + 1612, 1612, 1612, 886, 887, 1612, 1612, 1612, 887, 887, + 887, 1612, 1612, 1612, 1612, 887, 888, 1612, 1612, 1612, + 888, 888, 888, 1612, 1612, 1612, 1612, 888, 889, 1612, + 1612, 1612, 889, 889, 889, 1612, 1612, 1612, 1612, 889, + + 890, 1612, 1612, 1612, 890, 890, 890, 1612, 1612, 1612, + 1612, 890, 893, 1612, 1612, 1612, 893, 893, 893, 1612, + 1612, 1612, 1612, 893, 898, 1612, 1612, 1612, 898, 898, + 898, 1612, 1612, 1612, 1612, 898, 901, 1612, 1612, 1612, + 901, 901, 901, 1612, 1612, 1612, 1612, 901, 902, 1612, + 1612, 1612, 902, 902, 902, 1612, 1612, 1612, 1612, 902, + 903, 1612, 1612, 1612, 903, 903, 903, 1612, 1612, 1612, + 1612, 903, 907, 1612, 1612, 1612, 907, 907, 907, 1612, + 1612, 1612, 1612, 907, 908, 1612, 1612, 1612, 908, 908, + 908, 1612, 1612, 1612, 1612, 908, 909, 1612, 1612, 1612, + + 909, 909, 909, 1612, 1612, 1612, 1612, 909, 912, 1612, + 1612, 1612, 912, 912, 912, 1612, 1612, 1612, 1612, 912, + 913, 1612, 1612, 1612, 913, 913, 913, 1612, 1612, 1612, + 1612, 913, 914, 1612, 1612, 1612, 914, 914, 914, 1612, + 1612, 1612, 1612, 914, 915, 1612, 1612, 1612, 915, 915, + 915, 1612, 1612, 1612, 1612, 915, 916, 1612, 1612, 1612, + 916, 916, 916, 1612, 1612, 1612, 1612, 916, 920, 1612, + 1612, 1612, 920, 920, 920, 1612, 1612, 1612, 1612, 920, + 921, 1612, 1612, 1612, 921, 921, 921, 1612, 1612, 1612, + 1612, 921, 922, 1612, 1612, 1612, 922, 922, 922, 1612, + + 1612, 1612, 1612, 922, 923, 1612, 1612, 1612, 923, 923, + 923, 1612, 1612, 1612, 1612, 923, 924, 1612, 1612, 1612, + 924, 924, 924, 1612, 1612, 1612, 1612, 924, 925, 1612, + 1612, 1612, 925, 925, 925, 1612, 1612, 1612, 1612, 925, + 927, 1612, 1612, 1612, 927, 927, 927, 1612, 1612, 1612, + 1612, 927, 932, 1612, 1612, 1612, 932, 932, 932, 1612, + 1612, 1612, 1612, 932, 935, 1612, 1612, 1612, 935, 935, + 935, 1612, 1612, 1612, 1612, 935, 936, 1612, 1612, 1612, + 936, 936, 936, 1612, 1612, 1612, 1612, 936, 937, 1612, + 1612, 1612, 937, 937, 937, 1612, 1612, 1612, 1612, 937, + + 941, 1612, 1612, 1612, 941, 941, 941, 1612, 1612, 1612, + 1612, 941, 942, 1612, 1612, 1612, 942, 942, 942, 1612, + 1612, 1612, 1612, 942, 943, 1612, 1612, 1612, 943, 943, + 943, 1612, 1612, 1612, 1612, 943, 946, 1612, 1612, 1612, + 946, 946, 946, 1612, 1612, 1612, 1612, 946, 947, 1612, + 1612, 1612, 947, 947, 947, 1612, 1612, 1612, 1612, 947, + 948, 1612, 1612, 1612, 948, 948, 948, 1612, 1612, 1612, + 1612, 948, 949, 1612, 1612, 1612, 949, 949, 949, 1612, + 1612, 1612, 1612, 949, 950, 1612, 1612, 1612, 950, 950, + 950, 1612, 1612, 1612, 1612, 950, 954, 1612, 1612, 1612, + + 954, 954, 954, 1612, 1612, 1612, 1612, 954, 955, 1612, + 1612, 1612, 955, 955, 955, 1612, 1612, 1612, 1612, 955, + 956, 1612, 1612, 1612, 956, 956, 956, 1612, 1612, 1612, + 1612, 956, 957, 1612, 1612, 1612, 957, 957, 957, 1612, + 1612, 1612, 1612, 957, 958, 1612, 1612, 1612, 958, 958, + 958, 1612, 1612, 1612, 1612, 958, 959, 1612, 1612, 1612, + 959, 959, 959, 1612, 1612, 1612, 1612, 959, 961, 1612, + 1612, 1612, 961, 961, 961, 1612, 1612, 1612, 1612, 961, + 962, 1612, 1612, 1612, 962, 962, 962, 1612, 1612, 1612, + 1612, 962, 963, 1612, 1612, 1612, 963, 963, 963, 1612, + + 1612, 1612, 1612, 963, 964, 1612, 1612, 1612, 964, 964, + 964, 1612, 1612, 1612, 1612, 964, 965, 1612, 1612, 1612, + 965, 965, 965, 1612, 1612, 1612, 1612, 965, 966, 1612, + 1612, 1612, 966, 966, 966, 1612, 1612, 1612, 1612, 966, + 967, 1612, 1612, 1612, 967, 967, 967, 1612, 1612, 1612, + 1612, 967, 769, 769, 769, 769, 769, 769, 769, 769, + 769, 1612, 769, 769, 769, 1612, 769, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 1612, 771, 771, 771, + 771, 771, 971, 971, 971, 971, 971, 971, 971, 971, + 971, 1612, 971, 971, 971, 1612, 971, 774, 774, 774, + + 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, + 1612, 774, 973, 973, 973, 974, 974, 974, 995, 1612, + 1612, 1612, 995, 995, 995, 1612, 1612, 1612, 1612, 995, + 998, 1612, 1612, 1612, 998, 998, 998, 1612, 1612, 1612, + 1612, 998, 999, 1612, 1612, 1612, 999, 999, 999, 1612, + 1612, 1612, 1612, 999, 1000, 1612, 1612, 1612, 1000, 1000, + 1000, 1612, 1612, 1612, 1612, 1000, 1004, 1612, 1612, 1612, + 1004, 1004, 1004, 1612, 1612, 1612, 1612, 1004, 1005, 1612, + 1612, 1612, 1005, 1005, 1005, 1612, 1612, 1612, 1612, 1005, + 1006, 1612, 1612, 1612, 1006, 1006, 1006, 1612, 1612, 1612, + + 1612, 1006, 1009, 1612, 1612, 1612, 1009, 1009, 1009, 1612, + 1612, 1612, 1612, 1009, 1010, 1612, 1612, 1612, 1010, 1010, + 1010, 1612, 1612, 1612, 1612, 1010, 1011, 1612, 1612, 1612, + 1011, 1011, 1011, 1612, 1612, 1612, 1612, 1011, 1012, 1612, + 1612, 1612, 1012, 1012, 1012, 1612, 1612, 1612, 1612, 1012, + 1013, 1612, 1612, 1612, 1013, 1013, 1013, 1612, 1612, 1612, + 1612, 1013, 1017, 1612, 1612, 1612, 1017, 1017, 1017, 1612, + 1612, 1612, 1612, 1017, 1018, 1612, 1612, 1612, 1018, 1018, + 1018, 1612, 1612, 1612, 1612, 1018, 1019, 1612, 1612, 1612, + 1019, 1019, 1019, 1612, 1612, 1612, 1612, 1019, 1020, 1612, + + 1612, 1612, 1020, 1020, 1020, 1612, 1612, 1612, 1612, 1020, + 1021, 1612, 1612, 1612, 1021, 1021, 1021, 1612, 1612, 1612, + 1612, 1021, 1022, 1612, 1612, 1612, 1022, 1022, 1022, 1612, + 1612, 1612, 1612, 1022, 1024, 1612, 1612, 1612, 1024, 1024, + 1024, 1612, 1612, 1612, 1612, 1024, 1025, 1612, 1612, 1612, + 1025, 1025, 1025, 1612, 1612, 1612, 1612, 1025, 1026, 1612, + 1612, 1612, 1026, 1026, 1026, 1612, 1612, 1612, 1612, 1026, + 1027, 1612, 1612, 1612, 1027, 1027, 1027, 1612, 1612, 1612, + 1612, 1027, 1028, 1612, 1612, 1612, 1028, 1028, 1028, 1612, + 1612, 1612, 1612, 1028, 1029, 1612, 1612, 1612, 1029, 1029, + + 1029, 1612, 1612, 1612, 1612, 1029, 1030, 1612, 1612, 1612, + 1030, 1030, 1030, 1612, 1612, 1612, 1612, 1030, 1034, 1612, + 1612, 1612, 1034, 1034, 1034, 1612, 1612, 1612, 1612, 1034, + 1035, 1612, 1612, 1612, 1035, 1035, 1035, 1612, 1612, 1612, + 1612, 1035, 1036, 1612, 1612, 1612, 1036, 1036, 1036, 1612, + 1612, 1612, 1612, 1036, 1037, 1612, 1612, 1612, 1037, 1037, + 1037, 1612, 1612, 1612, 1612, 1037, 1038, 1612, 1612, 1612, + 1038, 1038, 1038, 1612, 1612, 1612, 1612, 1038, 1039, 1612, + 1612, 1612, 1039, 1039, 1039, 1612, 1612, 1612, 1612, 1039, + 1040, 1612, 1612, 1612, 1040, 1040, 1040, 1612, 1612, 1612, + + 1612, 1040, 1043, 1612, 1612, 1612, 1043, 1043, 1043, 1612, + 1612, 1612, 1612, 1043, 1048, 1612, 1612, 1612, 1048, 1048, + 1048, 1612, 1612, 1612, 1612, 1048, 1051, 1612, 1612, 1612, + 1051, 1051, 1051, 1612, 1612, 1612, 1612, 1051, 1052, 1612, + 1612, 1612, 1052, 1052, 1052, 1612, 1612, 1612, 1612, 1052, + 1053, 1612, 1612, 1612, 1053, 1053, 1053, 1612, 1612, 1612, + 1612, 1053, 1057, 1612, 1612, 1612, 1057, 1057, 1057, 1612, + 1612, 1612, 1612, 1057, 1058, 1612, 1612, 1612, 1058, 1058, + 1058, 1612, 1612, 1612, 1612, 1058, 1059, 1612, 1612, 1612, + 1059, 1059, 1059, 1612, 1612, 1612, 1612, 1059, 1062, 1612, + + 1612, 1612, 1062, 1062, 1062, 1612, 1612, 1612, 1612, 1062, + 1063, 1612, 1612, 1612, 1063, 1063, 1063, 1612, 1612, 1612, + 1612, 1063, 1064, 1612, 1612, 1612, 1064, 1064, 1064, 1612, + 1612, 1612, 1612, 1064, 1065, 1612, 1612, 1612, 1065, 1065, + 1065, 1612, 1612, 1612, 1612, 1065, 1066, 1612, 1612, 1612, + 1066, 1066, 1066, 1612, 1612, 1612, 1612, 1066, 1070, 1612, + 1612, 1612, 1070, 1070, 1070, 1612, 1612, 1612, 1612, 1070, + 1071, 1612, 1612, 1612, 1071, 1071, 1071, 1612, 1612, 1612, + 1612, 1071, 1072, 1612, 1612, 1612, 1072, 1072, 1072, 1612, + 1612, 1612, 1612, 1072, 1073, 1612, 1612, 1612, 1073, 1073, + + 1073, 1612, 1612, 1612, 1612, 1073, 1074, 1612, 1612, 1612, + 1074, 1074, 1074, 1612, 1612, 1612, 1612, 1074, 1075, 1612, + 1612, 1612, 1075, 1075, 1075, 1612, 1612, 1612, 1612, 1075, + 1077, 1612, 1612, 1612, 1077, 1077, 1077, 1612, 1612, 1612, + 1612, 1077, 1078, 1612, 1612, 1612, 1078, 1078, 1078, 1612, + 1612, 1612, 1612, 1078, 1079, 1612, 1612, 1612, 1079, 1079, + 1079, 1612, 1612, 1612, 1612, 1079, 1080, 1612, 1612, 1612, + 1080, 1080, 1080, 1612, 1612, 1612, 1612, 1080, 1081, 1612, + 1612, 1612, 1081, 1081, 1081, 1612, 1612, 1612, 1612, 1081, + 1082, 1612, 1612, 1612, 1082, 1082, 1082, 1612, 1612, 1612, + + 1612, 1082, 1083, 1612, 1612, 1612, 1083, 1083, 1083, 1612, + 1612, 1612, 1612, 1083, 1087, 1612, 1612, 1612, 1087, 1087, + 1087, 1612, 1612, 1612, 1612, 1087, 1088, 1612, 1612, 1612, + 1088, 1088, 1088, 1612, 1612, 1612, 1612, 1088, 1089, 1612, + 1612, 1612, 1089, 1089, 1089, 1612, 1612, 1612, 1612, 1089, + 1090, 1612, 1612, 1612, 1090, 1090, 1090, 1612, 1612, 1612, + 1612, 1090, 1091, 1612, 1612, 1612, 1091, 1091, 1091, 1612, + 1612, 1612, 1612, 1091, 1092, 1612, 1612, 1612, 1092, 1092, + 1092, 1612, 1612, 1612, 1612, 1092, 1093, 1612, 1612, 1612, + 1093, 1093, 1093, 1612, 1612, 1612, 1612, 1093, 1096, 1612, + + 1612, 1612, 1096, 1096, 1096, 1612, 1612, 1612, 1612, 1096, + 1097, 1612, 1612, 1612, 1097, 1097, 1097, 1612, 1612, 1612, + 1612, 1097, 1098, 1612, 1612, 1612, 1098, 1098, 1098, 1612, + 1612, 1612, 1612, 1098, 1099, 1612, 1612, 1612, 1099, 1099, + 1099, 1612, 1612, 1612, 1612, 1099, 1100, 1612, 1612, 1612, + 1100, 1100, 1100, 1612, 1612, 1612, 1612, 1100, 1101, 1612, + 1612, 1612, 1101, 1101, 1101, 1612, 1612, 1612, 1612, 1101, + 1102, 1612, 1612, 1612, 1102, 1102, 1102, 1612, 1612, 1612, + 1612, 1102, 1103, 1612, 1612, 1612, 1103, 1103, 1103, 1612, + 1612, 1612, 1612, 1103, 1104, 1612, 1612, 1612, 1104, 1104, + + 1104, 1612, 1612, 1612, 1612, 1104, 1112, 1612, 1612, 1612, + 1112, 1112, 1112, 1612, 1612, 1612, 1612, 1112, 1115, 1612, + 1612, 1612, 1115, 1115, 1115, 1612, 1612, 1612, 1612, 1115, + 1116, 1612, 1612, 1612, 1116, 1116, 1116, 1612, 1612, 1612, + 1612, 1116, 1117, 1612, 1612, 1612, 1117, 1117, 1117, 1612, + 1612, 1612, 1612, 1117, 1121, 1612, 1612, 1612, 1121, 1121, + 1121, 1612, 1612, 1612, 1612, 1121, 1122, 1612, 1612, 1612, + 1122, 1122, 1122, 1612, 1612, 1612, 1612, 1122, 1123, 1612, + 1612, 1612, 1123, 1123, 1123, 1612, 1612, 1612, 1612, 1123, + 1126, 1612, 1612, 1612, 1126, 1126, 1126, 1612, 1612, 1612, + + 1612, 1126, 1127, 1612, 1612, 1612, 1127, 1127, 1127, 1612, + 1612, 1612, 1612, 1127, 1128, 1612, 1612, 1612, 1128, 1128, + 1128, 1612, 1612, 1612, 1612, 1128, 1129, 1612, 1612, 1612, + 1129, 1129, 1129, 1612, 1612, 1612, 1612, 1129, 1130, 1612, + 1612, 1612, 1130, 1130, 1130, 1612, 1612, 1612, 1612, 1130, + 1134, 1612, 1612, 1612, 1134, 1134, 1134, 1612, 1612, 1612, + 1612, 1134, 1135, 1612, 1612, 1612, 1135, 1135, 1135, 1612, + 1612, 1612, 1612, 1135, 1136, 1612, 1612, 1612, 1136, 1136, + 1136, 1612, 1612, 1612, 1612, 1136, 1137, 1612, 1612, 1612, + 1137, 1137, 1137, 1612, 1612, 1612, 1612, 1137, 1138, 1612, + + 1612, 1612, 1138, 1138, 1138, 1612, 1612, 1612, 1612, 1138, + 1139, 1612, 1612, 1612, 1139, 1139, 1139, 1612, 1612, 1612, + 1612, 1139, 1141, 1612, 1612, 1612, 1141, 1141, 1141, 1612, + 1612, 1612, 1612, 1141, 1142, 1612, 1612, 1612, 1142, 1142, + 1142, 1612, 1612, 1612, 1612, 1142, 1143, 1612, 1612, 1612, + 1143, 1143, 1143, 1612, 1612, 1612, 1612, 1143, 1144, 1612, + 1612, 1612, 1144, 1144, 1144, 1612, 1612, 1612, 1612, 1144, + 1145, 1612, 1612, 1612, 1145, 1145, 1145, 1612, 1612, 1612, + 1612, 1145, 1146, 1612, 1612, 1612, 1146, 1146, 1146, 1612, + 1612, 1612, 1612, 1146, 1147, 1612, 1612, 1612, 1147, 1147, + + 1147, 1612, 1612, 1612, 1612, 1147, 1155, 1612, 1612, 1612, + 1155, 1155, 1155, 1612, 1612, 1612, 1612, 1155, 1158, 1612, + 1612, 1612, 1158, 1158, 1158, 1612, 1612, 1612, 1612, 1158, + 1159, 1612, 1612, 1612, 1159, 1159, 1159, 1612, 1612, 1612, + 1612, 1159, 1160, 1612, 1612, 1612, 1160, 1160, 1160, 1612, + 1612, 1612, 1612, 1160, 1164, 1612, 1612, 1612, 1164, 1164, + 1164, 1612, 1612, 1612, 1612, 1164, 1165, 1612, 1612, 1612, + 1165, 1165, 1165, 1612, 1612, 1612, 1612, 1165, 1166, 1612, + 1612, 1612, 1166, 1166, 1166, 1612, 1612, 1612, 1612, 1166, + 1169, 1612, 1612, 1612, 1169, 1169, 1169, 1612, 1612, 1612, + + 1612, 1169, 1170, 1612, 1612, 1612, 1170, 1170, 1170, 1612, + 1612, 1612, 1612, 1170, 1171, 1612, 1612, 1612, 1171, 1171, + 1171, 1612, 1612, 1612, 1612, 1171, 1172, 1612, 1612, 1612, + 1172, 1172, 1172, 1612, 1612, 1612, 1612, 1172, 1173, 1612, + 1612, 1612, 1173, 1173, 1173, 1612, 1612, 1612, 1612, 1173, + 1177, 1612, 1612, 1612, 1177, 1177, 1177, 1612, 1612, 1612, + 1612, 1177, 1178, 1612, 1612, 1612, 1178, 1178, 1178, 1612, + 1612, 1612, 1612, 1178, 1179, 1612, 1612, 1612, 1179, 1179, + 1179, 1612, 1612, 1612, 1612, 1179, 1180, 1612, 1612, 1612, + 1180, 1180, 1180, 1612, 1612, 1612, 1612, 1180, 1181, 1612, + + 1612, 1612, 1181, 1181, 1181, 1612, 1612, 1612, 1612, 1181, + 1182, 1612, 1612, 1612, 1182, 1182, 1182, 1612, 1612, 1612, + 1612, 1182, 1184, 1612, 1612, 1612, 1184, 1184, 1184, 1612, + 1612, 1612, 1612, 1184, 1185, 1612, 1612, 1612, 1185, 1185, + 1185, 1612, 1612, 1612, 1612, 1185, 1186, 1612, 1612, 1612, + 1186, 1186, 1186, 1612, 1612, 1612, 1612, 1186, 1187, 1612, + 1612, 1612, 1187, 1187, 1187, 1612, 1612, 1612, 1612, 1187, + 1188, 1612, 1612, 1612, 1188, 1188, 1188, 1612, 1612, 1612, + 1612, 1188, 1189, 1612, 1612, 1612, 1189, 1189, 1189, 1612, + 1612, 1612, 1612, 1189, 1190, 1612, 1612, 1612, 1190, 1190, + + 1190, 1612, 1612, 1612, 1612, 1190, 1194, 1612, 1612, 1612, + 1194, 1194, 1194, 1612, 1612, 1612, 1612, 1194, 1195, 1612, + 1612, 1612, 1195, 1195, 1195, 1612, 1612, 1612, 1612, 1195, + 1196, 1612, 1612, 1612, 1196, 1196, 1196, 1612, 1612, 1612, + 1612, 1196, 1197, 1612, 1612, 1612, 1197, 1197, 1197, 1612, + 1612, 1612, 1612, 1197, 1198, 1612, 1612, 1612, 1198, 1198, + 1198, 1612, 1612, 1612, 1612, 1198, 1199, 1612, 1612, 1612, + 1199, 1199, 1199, 1612, 1612, 1612, 1612, 1199, 1200, 1612, + 1612, 1612, 1200, 1200, 1200, 1612, 1612, 1612, 1612, 1200, + 1203, 1612, 1612, 1612, 1203, 1203, 1203, 1612, 1612, 1612, + + 1612, 1203, 971, 971, 971, 971, 971, 971, 971, 971, + 971, 1612, 971, 971, 971, 1612, 971, 1204, 1612, 1612, + 1612, 1204, 1204, 1204, 1612, 1612, 1612, 1612, 1204, 1206, + 1206, 1206, 1207, 1207, 1207, 1209, 1209, 1209, 1612, 1612, + 1612, 1612, 1209, 1215, 1215, 1215, 1216, 1216, 1216, 1225, + 1612, 1612, 1612, 1225, 1225, 1225, 1612, 1612, 1612, 1612, + 1225, 1228, 1612, 1612, 1612, 1228, 1228, 1228, 1612, 1612, + 1612, 1612, 1228, 1229, 1612, 1612, 1612, 1229, 1229, 1229, + 1612, 1612, 1612, 1612, 1229, 1230, 1612, 1612, 1612, 1230, + 1230, 1230, 1612, 1612, 1612, 1612, 1230, 1234, 1612, 1612, + + 1612, 1234, 1234, 1234, 1612, 1612, 1612, 1612, 1234, 1235, + 1612, 1612, 1612, 1235, 1235, 1235, 1612, 1612, 1612, 1612, + 1235, 1236, 1612, 1612, 1612, 1236, 1236, 1236, 1612, 1612, + 1612, 1612, 1236, 1239, 1612, 1612, 1612, 1239, 1239, 1239, + 1612, 1612, 1612, 1612, 1239, 1240, 1612, 1612, 1612, 1240, + 1240, 1240, 1612, 1612, 1612, 1612, 1240, 1241, 1612, 1612, + 1612, 1241, 1241, 1241, 1612, 1612, 1612, 1612, 1241, 1242, + 1612, 1612, 1612, 1242, 1242, 1242, 1612, 1612, 1612, 1612, + 1242, 1243, 1612, 1612, 1612, 1243, 1243, 1243, 1612, 1612, + 1612, 1612, 1243, 1247, 1612, 1612, 1612, 1247, 1247, 1247, + + 1612, 1612, 1612, 1612, 1247, 1248, 1612, 1612, 1612, 1248, + 1248, 1248, 1612, 1612, 1612, 1612, 1248, 1249, 1612, 1612, + 1612, 1249, 1249, 1249, 1612, 1612, 1612, 1612, 1249, 1250, + 1612, 1612, 1612, 1250, 1250, 1250, 1612, 1612, 1612, 1612, + 1250, 1251, 1612, 1612, 1612, 1251, 1251, 1251, 1612, 1612, + 1612, 1612, 1251, 1252, 1612, 1612, 1612, 1252, 1252, 1252, + 1612, 1612, 1612, 1612, 1252, 1254, 1612, 1612, 1612, 1254, + 1254, 1254, 1612, 1612, 1612, 1612, 1254, 1255, 1612, 1612, + 1612, 1255, 1255, 1255, 1612, 1612, 1612, 1612, 1255, 1256, + 1612, 1612, 1612, 1256, 1256, 1256, 1612, 1612, 1612, 1612, + + 1256, 1257, 1612, 1612, 1612, 1257, 1257, 1257, 1612, 1612, + 1612, 1612, 1257, 1258, 1612, 1612, 1612, 1258, 1258, 1258, + 1612, 1612, 1612, 1612, 1258, 1259, 1612, 1612, 1612, 1259, + 1259, 1259, 1612, 1612, 1612, 1612, 1259, 1260, 1612, 1612, + 1612, 1260, 1260, 1260, 1612, 1612, 1612, 1612, 1260, 1264, + 1612, 1612, 1612, 1264, 1264, 1264, 1612, 1612, 1612, 1612, + 1264, 1265, 1612, 1612, 1612, 1265, 1265, 1265, 1612, 1612, + 1612, 1612, 1265, 1266, 1612, 1612, 1612, 1266, 1266, 1266, + 1612, 1612, 1612, 1612, 1266, 1267, 1612, 1612, 1612, 1267, + 1267, 1267, 1612, 1612, 1612, 1612, 1267, 1268, 1612, 1612, + + 1612, 1268, 1268, 1268, 1612, 1612, 1612, 1612, 1268, 1269, + 1612, 1612, 1612, 1269, 1269, 1269, 1612, 1612, 1612, 1612, + 1269, 1270, 1612, 1612, 1612, 1270, 1270, 1270, 1612, 1612, + 1612, 1612, 1270, 1273, 1612, 1612, 1612, 1273, 1273, 1273, + 1612, 1612, 1612, 1612, 1273, 1274, 1612, 1612, 1612, 1274, + 1274, 1274, 1612, 1612, 1612, 1612, 1274, 1275, 1612, 1612, + 1612, 1275, 1275, 1275, 1612, 1612, 1612, 1612, 1275, 1276, + 1612, 1612, 1612, 1276, 1276, 1276, 1612, 1612, 1612, 1612, + 1276, 1277, 1612, 1612, 1612, 1277, 1277, 1277, 1612, 1612, + 1612, 1612, 1277, 1278, 1612, 1612, 1612, 1278, 1278, 1278, + + 1612, 1612, 1612, 1612, 1278, 1279, 1612, 1612, 1612, 1279, + 1279, 1279, 1612, 1612, 1612, 1612, 1279, 1280, 1612, 1612, + 1612, 1280, 1280, 1280, 1612, 1612, 1612, 1612, 1280, 1281, + 1612, 1612, 1612, 1281, 1281, 1281, 1612, 1612, 1612, 1612, + 1281, 1048, 1612, 1612, 1612, 1048, 1048, 1048, 1612, 1612, + 1612, 1612, 1048, 1051, 1612, 1612, 1612, 1051, 1051, 1051, + 1612, 1612, 1612, 1612, 1051, 1052, 1612, 1612, 1612, 1052, + 1052, 1052, 1612, 1612, 1612, 1612, 1052, 1053, 1612, 1612, + 1612, 1053, 1053, 1053, 1612, 1612, 1612, 1612, 1053, 1057, + 1612, 1612, 1612, 1057, 1057, 1057, 1612, 1612, 1612, 1612, + + 1057, 1058, 1612, 1612, 1612, 1058, 1058, 1058, 1612, 1612, + 1612, 1612, 1058, 1059, 1612, 1612, 1612, 1059, 1059, 1059, + 1612, 1612, 1612, 1612, 1059, 1062, 1612, 1612, 1612, 1062, + 1062, 1062, 1612, 1612, 1612, 1612, 1062, 1063, 1612, 1612, + 1612, 1063, 1063, 1063, 1612, 1612, 1612, 1612, 1063, 1064, + 1612, 1612, 1612, 1064, 1064, 1064, 1612, 1612, 1612, 1612, + 1064, 1065, 1612, 1612, 1612, 1065, 1065, 1065, 1612, 1612, + 1612, 1612, 1065, 1066, 1612, 1612, 1612, 1066, 1066, 1066, + 1612, 1612, 1612, 1612, 1066, 1070, 1612, 1612, 1612, 1070, + 1070, 1070, 1612, 1612, 1612, 1612, 1070, 1071, 1612, 1612, + + 1612, 1071, 1071, 1071, 1612, 1612, 1612, 1612, 1071, 1072, + 1612, 1612, 1612, 1072, 1072, 1072, 1612, 1612, 1612, 1612, + 1072, 1073, 1612, 1612, 1612, 1073, 1073, 1073, 1612, 1612, + 1612, 1612, 1073, 1074, 1612, 1612, 1612, 1074, 1074, 1074, + 1612, 1612, 1612, 1612, 1074, 1075, 1612, 1612, 1612, 1075, + 1075, 1075, 1612, 1612, 1612, 1612, 1075, 1077, 1612, 1612, + 1612, 1077, 1077, 1077, 1612, 1612, 1612, 1612, 1077, 1078, + 1612, 1612, 1612, 1078, 1078, 1078, 1612, 1612, 1612, 1612, + 1078, 1079, 1612, 1612, 1612, 1079, 1079, 1079, 1612, 1612, + 1612, 1612, 1079, 1080, 1612, 1612, 1612, 1080, 1080, 1080, + + 1612, 1612, 1612, 1612, 1080, 1081, 1612, 1612, 1612, 1081, + 1081, 1081, 1612, 1612, 1612, 1612, 1081, 1082, 1612, 1612, + 1612, 1082, 1082, 1082, 1612, 1612, 1612, 1612, 1082, 1083, + 1612, 1612, 1612, 1083, 1083, 1083, 1612, 1612, 1612, 1612, + 1083, 1087, 1612, 1612, 1612, 1087, 1087, 1087, 1612, 1612, + 1612, 1612, 1087, 1088, 1612, 1612, 1612, 1088, 1088, 1088, + 1612, 1612, 1612, 1612, 1088, 1089, 1612, 1612, 1612, 1089, + 1089, 1089, 1612, 1612, 1612, 1612, 1089, 1090, 1612, 1612, + 1612, 1090, 1090, 1090, 1612, 1612, 1612, 1612, 1090, 1091, + 1612, 1612, 1612, 1091, 1091, 1091, 1612, 1612, 1612, 1612, + + 1091, 1092, 1612, 1612, 1612, 1092, 1092, 1092, 1612, 1612, + 1612, 1612, 1092, 1093, 1612, 1612, 1612, 1093, 1093, 1093, + 1612, 1612, 1612, 1612, 1093, 1096, 1612, 1612, 1612, 1096, + 1096, 1096, 1612, 1612, 1612, 1612, 1096, 1097, 1612, 1612, + 1612, 1097, 1097, 1097, 1612, 1612, 1612, 1612, 1097, 1098, + 1612, 1612, 1612, 1098, 1098, 1098, 1612, 1612, 1612, 1612, + 1098, 1099, 1612, 1612, 1612, 1099, 1099, 1099, 1612, 1612, + 1612, 1612, 1099, 1100, 1612, 1612, 1612, 1100, 1100, 1100, + 1612, 1612, 1612, 1612, 1100, 1101, 1612, 1612, 1612, 1101, + 1101, 1101, 1612, 1612, 1612, 1612, 1101, 1102, 1612, 1612, + + 1612, 1102, 1102, 1102, 1612, 1612, 1612, 1612, 1102, 1103, + 1612, 1612, 1612, 1103, 1103, 1103, 1612, 1612, 1612, 1612, + 1103, 1104, 1612, 1612, 1612, 1104, 1104, 1104, 1612, 1612, + 1612, 1612, 1104, 1289, 1612, 1612, 1612, 1289, 1289, 1289, + 1612, 1612, 1612, 1612, 1289, 1292, 1612, 1612, 1612, 1292, + 1292, 1292, 1612, 1612, 1612, 1612, 1292, 1293, 1612, 1612, + 1612, 1293, 1293, 1293, 1612, 1612, 1612, 1612, 1293, 1294, + 1612, 1612, 1612, 1294, 1294, 1294, 1612, 1612, 1612, 1612, + 1294, 1298, 1612, 1612, 1612, 1298, 1298, 1298, 1612, 1612, + 1612, 1612, 1298, 1299, 1612, 1612, 1612, 1299, 1299, 1299, + + 1612, 1612, 1612, 1612, 1299, 1300, 1612, 1612, 1612, 1300, + 1300, 1300, 1612, 1612, 1612, 1612, 1300, 1303, 1612, 1612, + 1612, 1303, 1303, 1303, 1612, 1612, 1612, 1612, 1303, 1304, + 1612, 1612, 1612, 1304, 1304, 1304, 1612, 1612, 1612, 1612, + 1304, 1305, 1612, 1612, 1612, 1305, 1305, 1305, 1612, 1612, + 1612, 1612, 1305, 1306, 1612, 1612, 1612, 1306, 1306, 1306, + 1612, 1612, 1612, 1612, 1306, 1307, 1612, 1612, 1612, 1307, + 1307, 1307, 1612, 1612, 1612, 1612, 1307, 1311, 1612, 1612, + 1612, 1311, 1311, 1311, 1612, 1612, 1612, 1612, 1311, 1312, + 1612, 1612, 1612, 1312, 1312, 1312, 1612, 1612, 1612, 1612, + + 1312, 1313, 1612, 1612, 1612, 1313, 1313, 1313, 1612, 1612, + 1612, 1612, 1313, 1314, 1612, 1612, 1612, 1314, 1314, 1314, + 1612, 1612, 1612, 1612, 1314, 1315, 1612, 1612, 1612, 1315, + 1315, 1315, 1612, 1612, 1612, 1612, 1315, 1316, 1612, 1612, + 1612, 1316, 1316, 1316, 1612, 1612, 1612, 1612, 1316, 1318, + 1612, 1612, 1612, 1318, 1318, 1318, 1612, 1612, 1612, 1612, + 1318, 1319, 1612, 1612, 1612, 1319, 1319, 1319, 1612, 1612, + 1612, 1612, 1319, 1320, 1612, 1612, 1612, 1320, 1320, 1320, + 1612, 1612, 1612, 1612, 1320, 1321, 1612, 1612, 1612, 1321, + 1321, 1321, 1612, 1612, 1612, 1612, 1321, 1322, 1612, 1612, + + 1612, 1322, 1322, 1322, 1612, 1612, 1612, 1612, 1322, 1323, + 1612, 1612, 1612, 1323, 1323, 1323, 1612, 1612, 1612, 1612, + 1323, 1324, 1612, 1612, 1612, 1324, 1324, 1324, 1612, 1612, + 1612, 1612, 1324, 1328, 1612, 1612, 1612, 1328, 1328, 1328, + 1612, 1612, 1612, 1612, 1328, 1329, 1612, 1612, 1612, 1329, + 1329, 1329, 1612, 1612, 1612, 1612, 1329, 1330, 1612, 1612, + 1612, 1330, 1330, 1330, 1612, 1612, 1612, 1612, 1330, 1331, + 1612, 1612, 1612, 1331, 1331, 1331, 1612, 1612, 1612, 1612, + 1331, 1332, 1612, 1612, 1612, 1332, 1332, 1332, 1612, 1612, + 1612, 1612, 1332, 1333, 1612, 1612, 1612, 1333, 1333, 1333, + + 1612, 1612, 1612, 1612, 1333, 1334, 1612, 1612, 1612, 1334, + 1334, 1334, 1612, 1612, 1612, 1612, 1334, 1337, 1612, 1612, + 1612, 1337, 1337, 1337, 1612, 1612, 1612, 1612, 1337, 1342, + 1612, 1612, 1612, 1342, 1342, 1342, 1612, 1612, 1612, 1612, + 1342, 1345, 1612, 1612, 1612, 1345, 1345, 1345, 1612, 1612, + 1612, 1612, 1345, 1346, 1612, 1612, 1612, 1346, 1346, 1346, + 1612, 1612, 1612, 1612, 1346, 1347, 1612, 1612, 1612, 1347, + 1347, 1347, 1612, 1612, 1612, 1612, 1347, 1351, 1612, 1612, + 1612, 1351, 1351, 1351, 1612, 1612, 1612, 1612, 1351, 1352, + 1612, 1612, 1612, 1352, 1352, 1352, 1612, 1612, 1612, 1612, + + 1352, 1353, 1612, 1612, 1612, 1353, 1353, 1353, 1612, 1612, + 1612, 1612, 1353, 1356, 1612, 1612, 1612, 1356, 1356, 1356, + 1612, 1612, 1612, 1612, 1356, 1357, 1612, 1612, 1612, 1357, + 1357, 1357, 1612, 1612, 1612, 1612, 1357, 1358, 1612, 1612, + 1612, 1358, 1358, 1358, 1612, 1612, 1612, 1612, 1358, 1359, + 1612, 1612, 1612, 1359, 1359, 1359, 1612, 1612, 1612, 1612, + 1359, 1360, 1612, 1612, 1612, 1360, 1360, 1360, 1612, 1612, + 1612, 1612, 1360, 1364, 1612, 1612, 1612, 1364, 1364, 1364, + 1612, 1612, 1612, 1612, 1364, 1365, 1612, 1612, 1612, 1365, + 1365, 1365, 1612, 1612, 1612, 1612, 1365, 1366, 1612, 1612, + + 1612, 1366, 1366, 1366, 1612, 1612, 1612, 1612, 1366, 1367, + 1612, 1612, 1612, 1367, 1367, 1367, 1612, 1612, 1612, 1612, + 1367, 1368, 1612, 1612, 1612, 1368, 1368, 1368, 1612, 1612, + 1612, 1612, 1368, 1369, 1612, 1612, 1612, 1369, 1369, 1369, + 1612, 1612, 1612, 1612, 1369, 1371, 1612, 1612, 1612, 1371, + 1371, 1371, 1612, 1612, 1612, 1612, 1371, 1372, 1612, 1612, + 1612, 1372, 1372, 1372, 1612, 1612, 1612, 1612, 1372, 1373, + 1612, 1612, 1612, 1373, 1373, 1373, 1612, 1612, 1612, 1612, + 1373, 1374, 1612, 1612, 1612, 1374, 1374, 1374, 1612, 1612, + 1612, 1612, 1374, 1375, 1612, 1612, 1612, 1375, 1375, 1375, + + 1612, 1612, 1612, 1612, 1375, 1376, 1612, 1612, 1612, 1376, + 1376, 1376, 1612, 1612, 1612, 1612, 1376, 1377, 1612, 1612, + 1612, 1377, 1377, 1377, 1612, 1612, 1612, 1612, 1377, 1381, + 1612, 1612, 1612, 1381, 1381, 1381, 1612, 1612, 1612, 1612, + 1381, 1382, 1612, 1612, 1612, 1382, 1382, 1382, 1612, 1612, + 1612, 1612, 1382, 1383, 1612, 1612, 1612, 1383, 1383, 1383, + 1612, 1612, 1612, 1612, 1383, 1384, 1612, 1612, 1612, 1384, + 1384, 1384, 1612, 1612, 1612, 1612, 1384, 1385, 1612, 1612, + 1612, 1385, 1385, 1385, 1612, 1612, 1612, 1612, 1385, 1386, + 1612, 1612, 1612, 1386, 1386, 1386, 1612, 1612, 1612, 1612, + + 1386, 1387, 1612, 1612, 1612, 1387, 1387, 1387, 1612, 1612, + 1612, 1612, 1387, 1390, 1612, 1612, 1612, 1390, 1390, 1390, + 1612, 1612, 1612, 1612, 1390, 1391, 1612, 1612, 1612, 1391, + 1391, 1391, 1612, 1612, 1612, 1612, 1391, 1392, 1612, 1612, + 1612, 1392, 1392, 1392, 1612, 1612, 1612, 1612, 1392, 1393, + 1612, 1612, 1612, 1393, 1393, 1393, 1612, 1612, 1612, 1612, + 1393, 1394, 1612, 1612, 1612, 1394, 1394, 1394, 1612, 1612, + 1612, 1612, 1394, 1395, 1612, 1612, 1612, 1395, 1395, 1395, + 1612, 1612, 1612, 1612, 1395, 1396, 1612, 1612, 1612, 1396, + 1396, 1396, 1612, 1612, 1612, 1612, 1396, 1397, 1612, 1612, + + 1612, 1397, 1397, 1397, 1612, 1612, 1612, 1612, 1397, 1398, + 1612, 1612, 1612, 1398, 1398, 1398, 1612, 1612, 1612, 1612, + 1398, 1402, 1612, 1612, 1612, 1402, 1402, 1402, 1612, 1612, + 1612, 1612, 1402, 1403, 1403, 1403, 1404, 1612, 1612, 1612, + 1404, 1404, 1404, 1612, 1612, 1612, 1612, 1404, 1407, 1407, + 1407, 1414, 1612, 1414, 1612, 1414, 1414, 1612, 1612, 1612, + 1612, 1612, 1414, 1417, 1612, 1417, 1612, 1417, 1417, 1612, + 1612, 1612, 1612, 1612, 1417, 1418, 1418, 1418, 1419, 1419, + 1419, 1225, 1612, 1612, 1612, 1225, 1225, 1225, 1612, 1612, + 1612, 1612, 1225, 1228, 1612, 1612, 1612, 1228, 1228, 1228, + + 1612, 1612, 1612, 1612, 1228, 1229, 1612, 1612, 1612, 1229, + 1229, 1229, 1612, 1612, 1612, 1612, 1229, 1230, 1612, 1612, + 1612, 1230, 1230, 1230, 1612, 1612, 1612, 1612, 1230, 1234, + 1612, 1612, 1612, 1234, 1234, 1234, 1612, 1612, 1612, 1612, + 1234, 1235, 1612, 1612, 1612, 1235, 1235, 1235, 1612, 1612, + 1612, 1612, 1235, 1236, 1612, 1612, 1612, 1236, 1236, 1236, + 1612, 1612, 1612, 1612, 1236, 1239, 1612, 1612, 1612, 1239, + 1239, 1239, 1612, 1612, 1612, 1612, 1239, 1240, 1612, 1612, + 1612, 1240, 1240, 1240, 1612, 1612, 1612, 1612, 1240, 1241, + 1612, 1612, 1612, 1241, 1241, 1241, 1612, 1612, 1612, 1612, + + 1241, 1242, 1612, 1612, 1612, 1242, 1242, 1242, 1612, 1612, + 1612, 1612, 1242, 1243, 1612, 1612, 1612, 1243, 1243, 1243, + 1612, 1612, 1612, 1612, 1243, 1247, 1612, 1612, 1612, 1247, + 1247, 1247, 1612, 1612, 1612, 1612, 1247, 1248, 1612, 1612, + 1612, 1248, 1248, 1248, 1612, 1612, 1612, 1612, 1248, 1249, + 1612, 1612, 1612, 1249, 1249, 1249, 1612, 1612, 1612, 1612, + 1249, 1250, 1612, 1612, 1612, 1250, 1250, 1250, 1612, 1612, + 1612, 1612, 1250, 1251, 1612, 1612, 1612, 1251, 1251, 1251, + 1612, 1612, 1612, 1612, 1251, 1252, 1612, 1612, 1612, 1252, + 1252, 1252, 1612, 1612, 1612, 1612, 1252, 1254, 1612, 1612, + + 1612, 1254, 1254, 1254, 1612, 1612, 1612, 1612, 1254, 1255, + 1612, 1612, 1612, 1255, 1255, 1255, 1612, 1612, 1612, 1612, + 1255, 1256, 1612, 1612, 1612, 1256, 1256, 1256, 1612, 1612, + 1612, 1612, 1256, 1257, 1612, 1612, 1612, 1257, 1257, 1257, + 1612, 1612, 1612, 1612, 1257, 1258, 1612, 1612, 1612, 1258, + 1258, 1258, 1612, 1612, 1612, 1612, 1258, 1259, 1612, 1612, + 1612, 1259, 1259, 1259, 1612, 1612, 1612, 1612, 1259, 1260, + 1612, 1612, 1612, 1260, 1260, 1260, 1612, 1612, 1612, 1612, + 1260, 1264, 1612, 1612, 1612, 1264, 1264, 1264, 1612, 1612, + 1612, 1612, 1264, 1265, 1612, 1612, 1612, 1265, 1265, 1265, + + 1612, 1612, 1612, 1612, 1265, 1266, 1612, 1612, 1612, 1266, + 1266, 1266, 1612, 1612, 1612, 1612, 1266, 1267, 1612, 1612, + 1612, 1267, 1267, 1267, 1612, 1612, 1612, 1612, 1267, 1268, + 1612, 1612, 1612, 1268, 1268, 1268, 1612, 1612, 1612, 1612, + 1268, 1269, 1612, 1612, 1612, 1269, 1269, 1269, 1612, 1612, + 1612, 1612, 1269, 1270, 1612, 1612, 1612, 1270, 1270, 1270, + 1612, 1612, 1612, 1612, 1270, 1273, 1612, 1612, 1612, 1273, + 1273, 1273, 1612, 1612, 1612, 1612, 1273, 1274, 1612, 1612, + 1612, 1274, 1274, 1274, 1612, 1612, 1612, 1612, 1274, 1275, + 1612, 1612, 1612, 1275, 1275, 1275, 1612, 1612, 1612, 1612, + + 1275, 1276, 1612, 1612, 1612, 1276, 1276, 1276, 1612, 1612, + 1612, 1612, 1276, 1277, 1612, 1612, 1612, 1277, 1277, 1277, + 1612, 1612, 1612, 1612, 1277, 1278, 1612, 1612, 1612, 1278, + 1278, 1278, 1612, 1612, 1612, 1612, 1278, 1279, 1612, 1612, + 1612, 1279, 1279, 1279, 1612, 1612, 1612, 1612, 1279, 1280, + 1612, 1612, 1612, 1280, 1280, 1280, 1612, 1612, 1612, 1612, + 1280, 1281, 1612, 1612, 1612, 1281, 1281, 1281, 1612, 1612, + 1612, 1612, 1281, 1424, 1612, 1612, 1612, 1424, 1424, 1424, + 1612, 1612, 1612, 1612, 1424, 1427, 1612, 1612, 1612, 1427, + 1427, 1427, 1612, 1612, 1612, 1612, 1427, 1428, 1612, 1612, + + 1612, 1428, 1428, 1428, 1612, 1612, 1612, 1612, 1428, 1429, + 1612, 1612, 1612, 1429, 1429, 1429, 1612, 1612, 1612, 1612, + 1429, 1433, 1612, 1612, 1612, 1433, 1433, 1433, 1612, 1612, + 1612, 1612, 1433, 1434, 1612, 1612, 1612, 1434, 1434, 1434, + 1612, 1612, 1612, 1612, 1434, 1435, 1612, 1612, 1612, 1435, + 1435, 1435, 1612, 1612, 1612, 1612, 1435, 1438, 1612, 1612, + 1612, 1438, 1438, 1438, 1612, 1612, 1612, 1612, 1438, 1439, + 1612, 1612, 1612, 1439, 1439, 1439, 1612, 1612, 1612, 1612, + 1439, 1440, 1612, 1612, 1612, 1440, 1440, 1440, 1612, 1612, + 1612, 1612, 1440, 1441, 1612, 1612, 1612, 1441, 1441, 1441, + + 1612, 1612, 1612, 1612, 1441, 1442, 1612, 1612, 1612, 1442, + 1442, 1442, 1612, 1612, 1612, 1612, 1442, 1446, 1612, 1612, + 1612, 1446, 1446, 1446, 1612, 1612, 1612, 1612, 1446, 1447, + 1612, 1612, 1612, 1447, 1447, 1447, 1612, 1612, 1612, 1612, + 1447, 1448, 1612, 1612, 1612, 1448, 1448, 1448, 1612, 1612, + 1612, 1612, 1448, 1449, 1612, 1612, 1612, 1449, 1449, 1449, + 1612, 1612, 1612, 1612, 1449, 1450, 1612, 1612, 1612, 1450, + 1450, 1450, 1612, 1612, 1612, 1612, 1450, 1451, 1612, 1612, + 1612, 1451, 1451, 1451, 1612, 1612, 1612, 1612, 1451, 1453, + 1612, 1612, 1612, 1453, 1453, 1453, 1612, 1612, 1612, 1612, + + 1453, 1454, 1612, 1612, 1612, 1454, 1454, 1454, 1612, 1612, + 1612, 1612, 1454, 1455, 1612, 1612, 1612, 1455, 1455, 1455, + 1612, 1612, 1612, 1612, 1455, 1456, 1612, 1612, 1612, 1456, + 1456, 1456, 1612, 1612, 1612, 1612, 1456, 1457, 1612, 1612, + 1612, 1457, 1457, 1457, 1612, 1612, 1612, 1612, 1457, 1458, + 1612, 1612, 1612, 1458, 1458, 1458, 1612, 1612, 1612, 1612, + 1458, 1459, 1612, 1612, 1612, 1459, 1459, 1459, 1612, 1612, + 1612, 1612, 1459, 1463, 1612, 1612, 1612, 1463, 1463, 1463, + 1612, 1612, 1612, 1612, 1463, 1464, 1612, 1612, 1612, 1464, + 1464, 1464, 1612, 1612, 1612, 1612, 1464, 1465, 1612, 1612, + + 1612, 1465, 1465, 1465, 1612, 1612, 1612, 1612, 1465, 1466, + 1612, 1612, 1612, 1466, 1466, 1466, 1612, 1612, 1612, 1612, + 1466, 1467, 1612, 1612, 1612, 1467, 1467, 1467, 1612, 1612, + 1612, 1612, 1467, 1468, 1612, 1612, 1612, 1468, 1468, 1468, + 1612, 1612, 1612, 1612, 1468, 1469, 1612, 1612, 1612, 1469, + 1469, 1469, 1612, 1612, 1612, 1612, 1469, 1472, 1612, 1612, + 1612, 1472, 1472, 1472, 1612, 1612, 1612, 1612, 1472, 1473, + 1612, 1612, 1612, 1473, 1473, 1473, 1612, 1612, 1612, 1612, + 1473, 1474, 1612, 1612, 1612, 1474, 1474, 1474, 1612, 1612, + 1612, 1612, 1474, 1475, 1612, 1612, 1612, 1475, 1475, 1475, + + 1612, 1612, 1612, 1612, 1475, 1476, 1612, 1612, 1612, 1476, + 1476, 1476, 1612, 1612, 1612, 1612, 1476, 1477, 1612, 1612, + 1612, 1477, 1477, 1477, 1612, 1612, 1612, 1612, 1477, 1478, + 1612, 1612, 1612, 1478, 1478, 1478, 1612, 1612, 1612, 1612, + 1478, 1479, 1612, 1612, 1612, 1479, 1479, 1479, 1612, 1612, + 1612, 1612, 1479, 1480, 1612, 1612, 1612, 1480, 1480, 1480, + 1612, 1612, 1612, 1612, 1480, 1342, 1612, 1612, 1612, 1342, + 1342, 1342, 1612, 1612, 1612, 1612, 1342, 1345, 1612, 1612, + 1612, 1345, 1345, 1345, 1612, 1612, 1612, 1612, 1345, 1346, + 1612, 1612, 1612, 1346, 1346, 1346, 1612, 1612, 1612, 1612, + + 1346, 1347, 1612, 1612, 1612, 1347, 1347, 1347, 1612, 1612, + 1612, 1612, 1347, 1351, 1612, 1612, 1612, 1351, 1351, 1351, + 1612, 1612, 1612, 1612, 1351, 1352, 1612, 1612, 1612, 1352, + 1352, 1352, 1612, 1612, 1612, 1612, 1352, 1353, 1612, 1612, + 1612, 1353, 1353, 1353, 1612, 1612, 1612, 1612, 1353, 1356, + 1612, 1612, 1612, 1356, 1356, 1356, 1612, 1612, 1612, 1612, + 1356, 1357, 1612, 1612, 1612, 1357, 1357, 1357, 1612, 1612, + 1612, 1612, 1357, 1358, 1612, 1612, 1612, 1358, 1358, 1358, + 1612, 1612, 1612, 1612, 1358, 1359, 1612, 1612, 1612, 1359, + 1359, 1359, 1612, 1612, 1612, 1612, 1359, 1360, 1612, 1612, + + 1612, 1360, 1360, 1360, 1612, 1612, 1612, 1612, 1360, 1364, + 1612, 1612, 1612, 1364, 1364, 1364, 1612, 1612, 1612, 1612, + 1364, 1365, 1612, 1612, 1612, 1365, 1365, 1365, 1612, 1612, + 1612, 1612, 1365, 1366, 1612, 1612, 1612, 1366, 1366, 1366, + 1612, 1612, 1612, 1612, 1366, 1367, 1612, 1612, 1612, 1367, + 1367, 1367, 1612, 1612, 1612, 1612, 1367, 1368, 1612, 1612, + 1612, 1368, 1368, 1368, 1612, 1612, 1612, 1612, 1368, 1369, + 1612, 1612, 1612, 1369, 1369, 1369, 1612, 1612, 1612, 1612, + 1369, 1371, 1612, 1612, 1612, 1371, 1371, 1371, 1612, 1612, + 1612, 1612, 1371, 1372, 1612, 1612, 1612, 1372, 1372, 1372, + + 1612, 1612, 1612, 1612, 1372, 1373, 1612, 1612, 1612, 1373, + 1373, 1373, 1612, 1612, 1612, 1612, 1373, 1374, 1612, 1612, + 1612, 1374, 1374, 1374, 1612, 1612, 1612, 1612, 1374, 1375, + 1612, 1612, 1612, 1375, 1375, 1375, 1612, 1612, 1612, 1612, + 1375, 1376, 1612, 1612, 1612, 1376, 1376, 1376, 1612, 1612, + 1612, 1612, 1376, 1377, 1612, 1612, 1612, 1377, 1377, 1377, + 1612, 1612, 1612, 1612, 1377, 1381, 1612, 1612, 1612, 1381, + 1381, 1381, 1612, 1612, 1612, 1612, 1381, 1382, 1612, 1612, + 1612, 1382, 1382, 1382, 1612, 1612, 1612, 1612, 1382, 1383, + 1612, 1612, 1612, 1383, 1383, 1383, 1612, 1612, 1612, 1612, + + 1383, 1384, 1612, 1612, 1612, 1384, 1384, 1384, 1612, 1612, + 1612, 1612, 1384, 1385, 1612, 1612, 1612, 1385, 1385, 1385, + 1612, 1612, 1612, 1612, 1385, 1386, 1612, 1612, 1612, 1386, + 1386, 1386, 1612, 1612, 1612, 1612, 1386, 1387, 1612, 1612, + 1612, 1387, 1387, 1387, 1612, 1612, 1612, 1612, 1387, 1390, + 1612, 1612, 1612, 1390, 1390, 1390, 1612, 1612, 1612, 1612, + 1390, 1391, 1612, 1612, 1612, 1391, 1391, 1391, 1612, 1612, + 1612, 1612, 1391, 1392, 1612, 1612, 1612, 1392, 1392, 1392, + 1612, 1612, 1612, 1612, 1392, 1393, 1612, 1612, 1612, 1393, + 1393, 1393, 1612, 1612, 1612, 1612, 1393, 1394, 1612, 1612, + + 1612, 1394, 1394, 1394, 1612, 1612, 1612, 1612, 1394, 1395, + 1612, 1612, 1612, 1395, 1395, 1395, 1612, 1612, 1612, 1612, + 1395, 1396, 1612, 1612, 1612, 1396, 1396, 1396, 1612, 1612, + 1612, 1612, 1396, 1397, 1612, 1612, 1612, 1397, 1397, 1397, + 1612, 1612, 1612, 1612, 1397, 1398, 1612, 1612, 1612, 1398, + 1398, 1398, 1612, 1612, 1612, 1612, 1398, 1484, 1612, 1612, + 1612, 1484, 1484, 1484, 1612, 1612, 1612, 1612, 1484, 1485, + 1485, 1485, 1486, 1612, 1612, 1612, 1486, 1486, 1486, 1612, + 1612, 1612, 1612, 1486, 1487, 1487, 1487, 1488, 1488, 1488, + 1612, 1612, 1612, 1612, 1488, 1489, 1489, 1489, 1491, 1491, + + 1491, 1497, 1497, 1497, 1502, 1502, 1502, 1505, 1612, 1505, + 1612, 1505, 1505, 1612, 1612, 1612, 1612, 1612, 1505, 1508, + 1612, 1508, 1612, 1508, 1508, 1612, 1612, 1612, 1612, 1612, + 1508, 1424, 1612, 1612, 1612, 1424, 1424, 1424, 1612, 1612, + 1612, 1612, 1424, 1427, 1612, 1612, 1612, 1427, 1427, 1427, + 1612, 1612, 1612, 1612, 1427, 1428, 1612, 1612, 1612, 1428, + 1428, 1428, 1612, 1612, 1612, 1612, 1428, 1429, 1612, 1612, + 1612, 1429, 1429, 1429, 1612, 1612, 1612, 1612, 1429, 1433, + 1612, 1612, 1612, 1433, 1433, 1433, 1612, 1612, 1612, 1612, + 1433, 1434, 1612, 1612, 1612, 1434, 1434, 1434, 1612, 1612, + + 1612, 1612, 1434, 1435, 1612, 1612, 1612, 1435, 1435, 1435, + 1612, 1612, 1612, 1612, 1435, 1438, 1612, 1612, 1612, 1438, + 1438, 1438, 1612, 1612, 1612, 1612, 1438, 1439, 1612, 1612, + 1612, 1439, 1439, 1439, 1612, 1612, 1612, 1612, 1439, 1440, + 1612, 1612, 1612, 1440, 1440, 1440, 1612, 1612, 1612, 1612, + 1440, 1441, 1612, 1612, 1612, 1441, 1441, 1441, 1612, 1612, + 1612, 1612, 1441, 1442, 1612, 1612, 1612, 1442, 1442, 1442, + 1612, 1612, 1612, 1612, 1442, 1446, 1612, 1612, 1612, 1446, + 1446, 1446, 1612, 1612, 1612, 1612, 1446, 1447, 1612, 1612, + 1612, 1447, 1447, 1447, 1612, 1612, 1612, 1612, 1447, 1448, + + 1612, 1612, 1612, 1448, 1448, 1448, 1612, 1612, 1612, 1612, + 1448, 1449, 1612, 1612, 1612, 1449, 1449, 1449, 1612, 1612, + 1612, 1612, 1449, 1450, 1612, 1612, 1612, 1450, 1450, 1450, + 1612, 1612, 1612, 1612, 1450, 1451, 1612, 1612, 1612, 1451, + 1451, 1451, 1612, 1612, 1612, 1612, 1451, 1453, 1612, 1612, + 1612, 1453, 1453, 1453, 1612, 1612, 1612, 1612, 1453, 1454, + 1612, 1612, 1612, 1454, 1454, 1454, 1612, 1612, 1612, 1612, + 1454, 1455, 1612, 1612, 1612, 1455, 1455, 1455, 1612, 1612, + 1612, 1612, 1455, 1456, 1612, 1612, 1612, 1456, 1456, 1456, + 1612, 1612, 1612, 1612, 1456, 1457, 1612, 1612, 1612, 1457, + + 1457, 1457, 1612, 1612, 1612, 1612, 1457, 1458, 1612, 1612, + 1612, 1458, 1458, 1458, 1612, 1612, 1612, 1612, 1458, 1459, + 1612, 1612, 1612, 1459, 1459, 1459, 1612, 1612, 1612, 1612, + 1459, 1463, 1612, 1612, 1612, 1463, 1463, 1463, 1612, 1612, + 1612, 1612, 1463, 1464, 1612, 1612, 1612, 1464, 1464, 1464, + 1612, 1612, 1612, 1612, 1464, 1465, 1612, 1612, 1612, 1465, + 1465, 1465, 1612, 1612, 1612, 1612, 1465, 1466, 1612, 1612, + 1612, 1466, 1466, 1466, 1612, 1612, 1612, 1612, 1466, 1467, + 1612, 1612, 1612, 1467, 1467, 1467, 1612, 1612, 1612, 1612, + 1467, 1468, 1612, 1612, 1612, 1468, 1468, 1468, 1612, 1612, + + 1612, 1612, 1468, 1469, 1612, 1612, 1612, 1469, 1469, 1469, + 1612, 1612, 1612, 1612, 1469, 1472, 1612, 1612, 1612, 1472, + 1472, 1472, 1612, 1612, 1612, 1612, 1472, 1473, 1612, 1612, + 1612, 1473, 1473, 1473, 1612, 1612, 1612, 1612, 1473, 1474, + 1612, 1612, 1612, 1474, 1474, 1474, 1612, 1612, 1612, 1612, + 1474, 1475, 1612, 1612, 1612, 1475, 1475, 1475, 1612, 1612, + 1612, 1612, 1475, 1476, 1612, 1612, 1612, 1476, 1476, 1476, + 1612, 1612, 1612, 1612, 1476, 1477, 1612, 1612, 1612, 1477, + 1477, 1477, 1612, 1612, 1612, 1612, 1477, 1478, 1612, 1612, + 1612, 1478, 1478, 1478, 1612, 1612, 1612, 1612, 1478, 1479, + + 1612, 1612, 1612, 1479, 1479, 1479, 1612, 1612, 1612, 1612, + 1479, 1480, 1612, 1612, 1612, 1480, 1480, 1480, 1612, 1612, + 1612, 1612, 1480, 1509, 1612, 1612, 1612, 1509, 1509, 1509, + 1612, 1612, 1612, 1612, 1509, 1510, 1510, 1510, 1511, 1612, + 1612, 1612, 1511, 1511, 1511, 1612, 1612, 1612, 1612, 1511, + 1512, 1512, 1512, 1513, 1513, 1513, 1514, 1514, 1514, 1515, + 1515, 1515, 1520, 1612, 1520, 1612, 1520, 1520, 1612, 1612, + 1612, 1612, 1612, 1520, 1525, 1612, 1525, 1612, 1525, 1525, + 1612, 1612, 1612, 1612, 1612, 1525, 1530, 1530, 1530, 1535, + 1535, 1535, 1536, 1612, 1612, 1612, 1536, 1536, 1536, 1612, + + 1612, 1612, 1612, 1536, 1537, 1537, 1537, 1538, 1612, 1612, + 1612, 1538, 1538, 1538, 1612, 1612, 1612, 1612, 1538, 1539, + 1539, 1539, 1540, 1540, 1540, 1544, 1544, 1544, 1548, 1548, + 1548, 1553, 1612, 1553, 1612, 1553, 1553, 1612, 1612, 1612, + 1612, 1612, 1553, 1558, 1612, 1558, 1612, 1558, 1558, 1612, + 1612, 1612, 1612, 1612, 1558, 1559, 1559, 1559, 1560, 1612, + 1612, 1612, 1560, 1560, 1560, 1612, 1612, 1612, 1612, 1560, + 1561, 1561, 1561, 1562, 1562, 1562, 1563, 1563, 1563, 1565, + 1565, 1565, 1570, 1570, 1570, 1574, 1574, 1574, 1575, 1575, + 1575, 1576, 1576, 1576, 1577, 1577, 1577, 1578, 1578, 1578, + + 1579, 1579, 1579, 1581, 1581, 1581, 1585, 1585, 1585, 1586, + 1612, 1586, 1612, 1586, 1586, 1586, 1612, 1612, 1612, 1612, + 1586, 1587, 1612, 1587, 1612, 1587, 1587, 1587, 1612, 1612, + 1612, 1612, 1587, 1588, 1588, 1588, 1589, 1589, 1589, 1593, + 1612, 1593, 1612, 1593, 1593, 1593, 1612, 1612, 1612, 1612, + 1593, 1594, 1612, 1594, 1612, 1594, 1594, 1594, 1612, 1612, + 1612, 1612, 1594, 1595, 1612, 1595, 1612, 1595, 1595, 1595, + 1612, 1612, 1612, 1612, 1595, 1596, 1612, 1596, 1612, 1596, + 1596, 1596, 1612, 1612, 1612, 1612, 1596, 1597, 1597, 1597, + 1598, 1612, 1598, 1612, 1598, 1598, 1598, 1612, 1612, 1612, + + 1612, 1598, 1599, 1612, 1599, 1612, 1599, 1599, 1599, 1612, + 1612, 1612, 1612, 1599, 1600, 1612, 1600, 1612, 1600, 1600, + 1600, 1612, 1612, 1612, 1612, 1600, 1601, 1612, 1601, 1612, + 1601, 1601, 1601, 1612, 1612, 1612, 1612, 1601, 1602, 1612, + 1602, 1612, 1602, 1602, 1602, 1612, 1612, 1612, 1612, 1602, + 1603, 1612, 1603, 1612, 1603, 1603, 1603, 1612, 1612, 1612, + 1612, 1603, 1604, 1612, 1604, 1612, 1604, 1604, 1604, 1612, + 1612, 1612, 1612, 1604, 1605, 1612, 1605, 1612, 1605, 1605, + 1605, 1612, 1612, 1612, 1612, 1605, 1606, 1612, 1606, 1612, + 1606, 1606, 1606, 1612, 1612, 1612, 1612, 1606, 1607, 1612, + + 1607, 1612, 1607, 1607, 1607, 1612, 1612, 1612, 1612, 1607, + 1608, 1612, 1608, 1612, 1608, 1608, 1608, 1612, 1612, 1612, + 1612, 1608, 1609, 1612, 1609, 1612, 1609, 1609, 1609, 1612, + 1612, 1612, 1612, 1609, 1610, 1612, 1610, 1612, 1610, 1610, + 1610, 1612, 1612, 1612, 1612, 1610, 1611, 1612, 1611, 1612, + 1611, 1611, 1611, 1612, 1612, 1612, 1612, 1611, 3, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612 + + } ; + +static const flex_int16_t yy_chk[16700] = + { 0, + 0, 0, 1, 0, 15, 17, 43, 0, 43, 43, + 53, 53, 53, 70, 70, 70, 70, 39, 39, 48, + 48, 92, 92, 1597, 15, 17, 1, 1, 1, 6, + 1, 1, 8, 14, 1, 1, 14, 6, 1, 1, + 2, 10, 14, 8, 8, 10, 18, 18, 20, 20, + 19, 22, 19, 19, 19, 30, 98, 98, 1573, 28, + 18, 1572, 20, 1569, 2, 2, 2, 75, 2, 2, + 19, 22, 2, 2, 28, 30, 2, 2, 21, 25, + 21, 21, 75, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 31, 32, 25, 1568, 35, 21, 25, + + 25, 26, 26, 26, 36, 37, 41, 41, 42, 1562, + 42, 42, 42, 31, 32, 45, 26, 35, 55, 45, + 41, 1557, 50, 50, 36, 37, 57, 46, 42, 46, + 46, 46, 59, 60, 45, 45, 50, 61, 55, 52, + 45, 52, 52, 56, 77, 73, 57, 46, 56, 56, + 108, 108, 59, 60, 1555, 78, 79, 61, 1552, 52, + 54, 73, 74, 56, 77, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 78, 79, 80, 74, 1550, + 54, 58, 64, 58, 58, 1547, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 65, 80, 64, 66, + + 1546, 58, 64, 64, 1543, 67, 1542, 68, 1524, 71, + 71, 71, 65, 83, 84, 66, 65, 65, 85, 66, + 66, 67, 86, 68, 71, 67, 67, 68, 68, 100, + 1522, 100, 100, 83, 84, 94, 95, 1519, 85, 96, + 1517, 111, 86, 88, 88, 88, 88, 88, 90, 90, + 90, 90, 90, 97, 94, 94, 95, 97, 96, 96, + 94, 111, 113, 99, 96, 99, 99, 99, 170, 170, + 102, 112, 97, 97, 102, 1482, 112, 112, 97, 125, + 125, 125, 113, 99, 104, 104, 104, 104, 104, 102, + 102, 112, 172, 172, 1411, 102, 106, 106, 106, 106, + + 106, 110, 114, 1406, 116, 1283, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 179, 179, 118, 119, + 117, 110, 114, 115, 116, 117, 117, 120, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 118, 119, + 117, 1213, 124, 115, 124, 124, 1211, 120, 121, 1208, + 127, 260, 260, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 122, 122, 122, 122, 122, 121, 123, + 127, 123, 123, 1207, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 126, 262, 262, 129, 130, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 131, + + 128, 132, 133, 138, 126, 128, 128, 129, 130, 136, + 984, 137, 149, 149, 149, 149, 983, 139, 980, 131, + 128, 132, 133, 138, 138, 136, 140, 137, 141, 136, + 136, 137, 137, 139, 142, 978, 143, 139, 139, 250, + 250, 250, 140, 144, 141, 145, 140, 140, 141, 141, + 142, 146, 143, 147, 142, 142, 143, 143, 152, 144, + 153, 145, 154, 144, 144, 145, 145, 146, 147, 156, + 157, 146, 146, 147, 152, 160, 153, 161, 154, 167, + 167, 167, 167, 167, 169, 169, 169, 169, 169, 156, + 157, 171, 174, 247, 175, 160, 974, 161, 176, 352, + + 352, 177, 796, 178, 189, 191, 793, 178, 788, 247, + 171, 171, 174, 175, 175, 785, 171, 783, 176, 175, + 177, 177, 178, 178, 189, 191, 177, 782, 178, 185, + 185, 185, 185, 185, 187, 187, 187, 187, 187, 188, + 477, 477, 192, 193, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 197, 190, 251, 251, 251, 188, + 190, 190, 192, 193, 195, 195, 195, 195, 195, 616, + 616, 199, 198, 200, 197, 190, 194, 198, 198, 201, + 204, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 199, 198, 200, 619, 619, 194, 196, 781, 201, + + 204, 205, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 203, 203, 203, 203, 203, 196, 202, 206, + 628, 205, 208, 202, 202, 202, 202, 202, 202, 202, + 202, 202, 202, 626, 626, 210, 212, 625, 202, 206, + 207, 618, 208, 615, 213, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 210, 212, 211, 215, 613, + 207, 209, 211, 211, 213, 612, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 469, 211, 215, 216, + 217, 209, 214, 218, 216, 216, 219, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 629, 629, 216, + + 217, 366, 214, 218, 786, 786, 219, 220, 222, 223, + 225, 351, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 221, 221, 221, 221, 221, 220, 222, 223, + 225, 225, 226, 325, 227, 249, 244, 244, 244, 248, + 228, 246, 229, 278, 278, 278, 278, 278, 230, 224, + 231, 244, 226, 226, 227, 227, 228, 232, 229, 233, + 228, 228, 229, 229, 230, 234, 231, 235, 230, 230, + 231, 231, 158, 232, 236, 155, 237, 232, 232, 233, + 233, 234, 238, 235, 239, 234, 234, 235, 235, 241, + 236, 240, 237, 245, 236, 236, 237, 237, 238, 257, + + 239, 259, 238, 238, 239, 239, 261, 240, 245, 241, + 264, 240, 240, 245, 272, 274, 275, 265, 276, 257, + 279, 259, 265, 265, 151, 261, 261, 266, 789, 789, + 264, 261, 266, 266, 272, 274, 275, 265, 276, 150, + 279, 794, 794, 280, 273, 281, 283, 266, 271, 273, + 273, 285, 135, 271, 271, 271, 271, 271, 271, 271, + 271, 271, 271, 280, 273, 281, 283, 286, 271, 277, + 134, 285, 286, 286, 277, 277, 277, 277, 277, 277, + 277, 277, 277, 277, 109, 287, 288, 286, 289, 277, + 282, 93, 292, 293, 294, 282, 282, 282, 282, 282, + + 282, 282, 282, 282, 282, 287, 288, 76, 289, 72, + 282, 284, 292, 293, 294, 296, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 291, 291, 291, 291, + 291, 284, 290, 63, 297, 296, 298, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 62, 299, 300, + 304, 306, 290, 295, 297, 307, 298, 308, 295, 295, + 295, 295, 295, 295, 295, 295, 295, 295, 299, 300, + 304, 306, 51, 295, 301, 307, 312, 308, 314, 301, + 301, 301, 301, 301, 301, 301, 301, 301, 301, 302, + 302, 302, 302, 302, 301, 303, 312, 49, 314, 40, + + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 315, 305, 354, 354, 354, 303, 305, 305, 310, 310, + 310, 310, 310, 347, 347, 347, 347, 316, 313, 319, + 315, 305, 309, 313, 313, 320, 321, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 316, 313, 319, + 797, 797, 309, 311, 34, 320, 321, 323, 311, 311, + 311, 311, 311, 311, 311, 311, 311, 311, 318, 318, + 318, 318, 318, 311, 317, 24, 324, 323, 326, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 16, + 327, 13, 328, 12, 317, 322, 324, 332, 326, 326, + + 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, + 327, 327, 328, 328, 329, 322, 330, 332, 332, 333, + 979, 979, 331, 11, 334, 9, 344, 356, 356, 356, + 329, 335, 330, 336, 329, 329, 330, 330, 331, 333, + 333, 337, 331, 331, 334, 334, 344, 335, 338, 336, + 339, 335, 335, 336, 336, 348, 340, 337, 341, 7, + 360, 337, 337, 3, 338, 342, 339, 343, 338, 338, + 339, 339, 340, 0, 341, 348, 340, 340, 341, 341, + 360, 342, 362, 343, 363, 342, 342, 343, 357, 357, + 357, 358, 358, 358, 365, 365, 365, 367, 369, 369, + + 369, 370, 362, 371, 363, 373, 370, 370, 371, 371, + 379, 379, 379, 379, 379, 1106, 1106, 367, 0, 375, + 376, 370, 374, 371, 372, 373, 377, 374, 374, 372, + 372, 372, 372, 372, 372, 372, 372, 372, 372, 375, + 376, 0, 374, 380, 372, 381, 377, 378, 382, 0, + 384, 385, 378, 378, 378, 378, 378, 378, 378, 378, + 378, 378, 0, 380, 386, 381, 387, 378, 382, 383, + 384, 385, 388, 0, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 386, 0, 387, 1210, 1210, 383, + 1214, 1214, 388, 389, 0, 392, 394, 395, 389, 389, + + 389, 389, 389, 389, 389, 389, 389, 389, 390, 390, + 390, 390, 390, 389, 391, 392, 394, 395, 396, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 399, + 393, 0, 400, 401, 391, 393, 393, 0, 396, 398, + 398, 398, 398, 398, 1400, 1400, 403, 404, 405, 399, + 393, 397, 400, 401, 406, 407, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 403, 404, 405, 1412, + 1412, 397, 402, 0, 406, 407, 410, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 409, 409, 409, + 409, 409, 402, 408, 411, 412, 410, 413, 408, 408, + + 408, 408, 408, 408, 408, 408, 408, 408, 414, 415, + 416, 0, 418, 408, 411, 412, 0, 413, 474, 474, + 474, 0, 415, 415, 1413, 1413, 420, 0, 414, 415, + 416, 417, 418, 0, 421, 422, 417, 417, 417, 417, + 417, 417, 417, 417, 417, 417, 420, 419, 0, 425, + 426, 417, 419, 419, 421, 422, 424, 424, 424, 424, + 424, 1415, 1415, 427, 429, 431, 432, 419, 423, 425, + 426, 432, 432, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 427, 429, 431, 432, 433, 423, 428, + 0, 434, 435, 438, 428, 428, 428, 428, 428, 428, + + 428, 428, 428, 428, 479, 479, 479, 433, 0, 428, + 430, 434, 435, 438, 439, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 437, 437, 437, 437, 437, + 430, 436, 440, 0, 439, 442, 436, 436, 436, 436, + 436, 436, 436, 436, 436, 436, 1416, 1416, 443, 444, + 445, 436, 440, 441, 446, 442, 449, 450, 441, 441, + 441, 441, 441, 441, 441, 441, 441, 441, 443, 444, + 445, 1503, 1503, 441, 446, 447, 449, 450, 451, 0, + 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, + 448, 448, 448, 448, 448, 447, 452, 0, 451, 451, + + 453, 0, 454, 475, 475, 475, 475, 0, 455, 0, + 456, 457, 0, 458, 0, 459, 452, 452, 454, 0, + 453, 453, 454, 454, 455, 460, 456, 461, 455, 455, + 456, 457, 457, 458, 458, 459, 459, 462, 0, 463, + 0, 460, 470, 461, 471, 460, 460, 461, 461, 464, + 0, 465, 466, 462, 0, 463, 0, 462, 462, 463, + 463, 467, 470, 484, 471, 464, 0, 465, 466, 464, + 464, 465, 466, 476, 476, 476, 476, 467, 481, 481, + 481, 467, 482, 484, 487, 491, 483, 482, 482, 482, + 482, 483, 483, 483, 483, 486, 486, 486, 489, 489, + + 489, 0, 482, 492, 487, 491, 483, 490, 492, 492, + 493, 494, 490, 490, 490, 490, 490, 490, 490, 490, + 490, 490, 495, 492, 498, 499, 500, 490, 1504, 1504, + 493, 494, 497, 497, 497, 497, 497, 0, 502, 503, + 504, 505, 495, 496, 498, 499, 500, 506, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 502, 503, + 504, 505, 0, 496, 501, 0, 509, 506, 510, 501, + 501, 501, 501, 501, 501, 501, 501, 501, 501, 508, + 508, 508, 508, 508, 501, 507, 509, 511, 510, 512, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 513, 514, 515, 0, 517, 507, 518, 511, 0, 512, + 0, 518, 518, 0, 514, 514, 1506, 1506, 519, 520, + 513, 514, 515, 516, 517, 521, 518, 524, 516, 516, + 516, 516, 516, 516, 516, 516, 516, 516, 519, 520, + 621, 621, 621, 516, 0, 521, 522, 524, 525, 526, + 0, 522, 522, 522, 522, 522, 522, 522, 522, 522, + 522, 523, 523, 523, 523, 523, 522, 528, 525, 526, + 527, 529, 530, 531, 532, 527, 527, 527, 527, 527, + 527, 527, 527, 527, 527, 1507, 1507, 528, 1514, 1514, + 527, 529, 530, 531, 532, 533, 535, 536, 537, 538, + + 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, + 534, 534, 534, 534, 534, 533, 535, 536, 537, 538, + 539, 540, 541, 542, 543, 544, 545, 546, 547, 549, + 549, 549, 549, 551, 540, 540, 622, 622, 622, 622, + 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 981, 981, 0, 551, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 981, 553, 552, 554, 555, 548, + 550, 552, 552, 558, 559, 550, 550, 550, 550, 550, + 550, 550, 550, 550, 550, 553, 552, 554, 555, 0, + 550, 556, 560, 558, 559, 562, 556, 556, 556, 556, + + 556, 556, 556, 556, 556, 556, 557, 557, 557, 557, + 557, 556, 560, 561, 563, 562, 564, 565, 561, 561, + 561, 561, 561, 561, 561, 561, 561, 561, 566, 0, + 570, 1515, 1515, 561, 563, 0, 564, 565, 568, 568, + 568, 568, 568, 0, 572, 573, 571, 574, 566, 567, + 570, 571, 571, 577, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 572, 573, 571, 574, 0, 567, + 569, 0, 578, 577, 579, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 576, 576, 576, 576, 576, + 569, 575, 578, 581, 579, 582, 575, 575, 575, 575, + + 575, 575, 575, 575, 575, 575, 0, 583, 584, 585, + 588, 575, 580, 581, 589, 582, 590, 580, 580, 580, + 580, 580, 580, 580, 580, 580, 580, 583, 584, 585, + 588, 0, 580, 586, 589, 591, 590, 592, 586, 586, + 586, 586, 586, 586, 586, 586, 586, 586, 587, 587, + 587, 587, 587, 586, 593, 591, 594, 592, 595, 596, + 0, 597, 0, 598, 1496, 1496, 1496, 593, 593, 599, + 600, 601, 0, 602, 593, 603, 594, 0, 595, 596, + 596, 597, 597, 598, 604, 599, 600, 605, 0, 599, + 600, 601, 601, 602, 602, 603, 603, 606, 607, 608, + + 604, 633, 609, 605, 604, 604, 609, 605, 605, 623, + 623, 623, 623, 606, 607, 608, 635, 606, 607, 608, + 630, 633, 609, 636, 631, 630, 630, 630, 630, 631, + 631, 631, 631, 1501, 1501, 1501, 635, 1529, 1529, 1529, + 630, 634, 637, 636, 631, 632, 634, 634, 640, 641, + 632, 632, 632, 632, 632, 632, 632, 632, 632, 632, + 0, 634, 637, 1738, 1738, 632, 638, 642, 640, 641, + 644, 638, 638, 638, 638, 638, 638, 638, 638, 638, + 638, 639, 639, 639, 639, 639, 638, 642, 643, 645, + 644, 646, 647, 643, 643, 643, 643, 643, 643, 643, + + 643, 643, 643, 648, 0, 651, 652, 653, 643, 645, + 0, 646, 647, 650, 650, 650, 650, 650, 0, 654, + 655, 1802, 1802, 648, 649, 651, 652, 653, 656, 649, + 649, 649, 649, 649, 649, 649, 649, 649, 649, 654, + 655, 656, 656, 657, 649, 658, 659, 660, 656, 661, + 662, 663, 665, 665, 665, 665, 667, 673, 673, 673, + 673, 673, 0, 657, 0, 658, 659, 660, 668, 661, + 662, 663, 664, 668, 668, 669, 667, 664, 664, 664, + 664, 664, 664, 664, 664, 664, 664, 0, 668, 670, + 671, 674, 664, 666, 0, 669, 675, 676, 666, 666, + + 666, 666, 666, 666, 666, 666, 666, 666, 0, 670, + 671, 674, 678, 666, 672, 0, 675, 676, 679, 672, + 672, 672, 672, 672, 672, 672, 672, 672, 672, 0, + 680, 681, 678, 682, 672, 677, 0, 685, 679, 686, + 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, + 680, 681, 0, 682, 0, 677, 683, 685, 687, 686, + 688, 683, 683, 683, 683, 683, 683, 683, 683, 683, + 683, 684, 684, 684, 684, 684, 683, 689, 687, 690, + 688, 691, 692, 693, 694, 695, 696, 697, 699, 699, + 699, 699, 690, 690, 1534, 1534, 1534, 689, 0, 690, + + 0, 691, 692, 693, 694, 695, 696, 697, 698, 700, + 701, 702, 703, 698, 698, 698, 698, 698, 698, 698, + 698, 698, 698, 704, 705, 706, 0, 708, 698, 700, + 701, 702, 703, 716, 716, 716, 716, 716, 1803, 1803, + 0, 710, 712, 704, 705, 706, 707, 708, 1804, 1804, + 713, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 710, 712, 711, 714, 717, 707, 709, 711, 711, + 713, 718, 709, 709, 709, 709, 709, 709, 709, 709, + 709, 709, 0, 711, 714, 717, 719, 709, 715, 0, + 721, 718, 722, 715, 715, 715, 715, 715, 715, 715, + + 715, 715, 715, 0, 723, 724, 719, 725, 715, 720, + 721, 728, 722, 729, 720, 720, 720, 720, 720, 720, + 720, 720, 720, 720, 723, 724, 0, 725, 0, 720, + 726, 728, 730, 729, 731, 726, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 727, 727, 727, 727, 727, + 726, 732, 730, 733, 731, 734, 0, 736, 737, 738, + 739, 1807, 1807, 737, 737, 0, 733, 733, 1809, 1809, + 0, 732, 740, 733, 743, 734, 735, 736, 737, 738, + 739, 735, 735, 735, 735, 735, 735, 735, 735, 735, + 735, 0, 740, 0, 743, 0, 735, 741, 744, 745, + + 0, 747, 741, 741, 741, 741, 741, 741, 741, 741, + 741, 741, 742, 742, 742, 742, 742, 741, 744, 745, + 746, 747, 748, 749, 750, 746, 746, 746, 746, 746, + 746, 746, 746, 746, 746, 751, 0, 754, 755, 756, + 746, 0, 748, 749, 750, 753, 753, 753, 753, 753, + 0, 757, 758, 1878, 1878, 751, 752, 754, 755, 756, + 759, 752, 752, 752, 752, 752, 752, 752, 752, 752, + 752, 757, 758, 759, 759, 760, 752, 761, 762, 763, + 759, 764, 765, 766, 768, 768, 768, 768, 769, 780, + 780, 780, 780, 1879, 1879, 760, 0, 761, 762, 763, + + 770, 764, 765, 766, 767, 771, 0, 772, 769, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 773, + 770, 774, 775, 799, 767, 771, 771, 772, 772, 778, + 800, 801, 802, 778, 0, 800, 800, 774, 775, 773, + 790, 774, 775, 799, 803, 790, 790, 790, 791, 778, + 800, 801, 802, 791, 791, 791, 831, 831, 831, 831, + 790, 1880, 1880, 0, 803, 1881, 1881, 0, 791, 798, + 0, 806, 807, 808, 798, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 805, 805, 805, 805, 805, 798, + 804, 806, 807, 808, 810, 804, 804, 804, 804, 804, + + 804, 804, 804, 804, 804, 0, 811, 812, 813, 814, + 804, 809, 0, 817, 810, 818, 809, 809, 809, 809, + 809, 809, 809, 809, 809, 809, 811, 812, 813, 814, + 0, 809, 815, 817, 819, 818, 820, 815, 815, 815, + 815, 815, 815, 815, 815, 815, 815, 816, 816, 816, + 816, 816, 815, 821, 819, 822, 820, 823, 824, 825, + 826, 827, 828, 829, 0, 832, 833, 834, 822, 822, + 1882, 1882, 0, 821, 0, 822, 0, 823, 824, 825, + 826, 827, 828, 829, 830, 832, 833, 834, 835, 830, + 830, 830, 830, 830, 830, 830, 830, 830, 830, 836, + + 837, 838, 0, 840, 830, 842, 843, 0, 835, 1967, + 1967, 843, 843, 874, 874, 874, 874, 844, 845, 836, + 837, 838, 839, 840, 846, 842, 843, 839, 839, 839, + 839, 839, 839, 839, 839, 839, 839, 844, 845, 1969, + 1969, 0, 839, 841, 846, 849, 850, 851, 841, 841, + 841, 841, 841, 841, 841, 841, 841, 841, 848, 848, + 848, 848, 848, 841, 847, 849, 850, 851, 853, 847, + 847, 847, 847, 847, 847, 847, 847, 847, 847, 0, + 854, 855, 856, 857, 847, 852, 0, 860, 853, 861, + 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, + + 854, 855, 856, 857, 0, 852, 858, 860, 862, 861, + 863, 858, 858, 858, 858, 858, 858, 858, 858, 858, + 858, 859, 859, 859, 859, 859, 858, 864, 862, 865, + 863, 866, 867, 868, 869, 870, 871, 872, 0, 875, + 876, 877, 865, 865, 1970, 1970, 0, 864, 0, 865, + 0, 866, 867, 868, 869, 870, 871, 872, 873, 875, + 876, 877, 878, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 879, 880, 881, 0, 883, 873, 884, + 885, 0, 878, 893, 893, 893, 893, 893, 1971, 1971, + 0, 886, 887, 879, 880, 881, 882, 883, 888, 884, + + 885, 882, 882, 882, 882, 882, 882, 882, 882, 882, + 882, 886, 887, 889, 890, 891, 882, 895, 888, 896, + 897, 1972, 1972, 0, 896, 896, 901, 901, 901, 901, + 901, 898, 899, 889, 890, 891, 892, 895, 902, 896, + 897, 892, 892, 892, 892, 892, 892, 892, 892, 892, + 892, 898, 899, 903, 904, 906, 892, 894, 902, 907, + 908, 909, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 0, 903, 904, 906, 910, 894, 900, 907, + 908, 909, 913, 900, 900, 900, 900, 900, 900, 900, + 900, 900, 900, 1973, 1973, 0, 910, 0, 900, 905, + + 0, 914, 913, 915, 905, 905, 905, 905, 905, 905, + 905, 905, 905, 905, 912, 912, 912, 912, 912, 905, + 911, 914, 916, 915, 917, 911, 911, 911, 911, 911, + 911, 911, 911, 911, 911, 918, 919, 920, 921, 922, + 911, 923, 916, 924, 917, 925, 0, 929, 918, 918, + 927, 927, 927, 927, 0, 918, 919, 920, 921, 922, + 0, 923, 931, 924, 930, 925, 926, 929, 932, 930, + 930, 926, 926, 926, 926, 926, 926, 926, 926, 926, + 926, 0, 931, 933, 930, 936, 926, 928, 932, 937, + 938, 940, 928, 928, 928, 928, 928, 928, 928, 928, + + 928, 928, 0, 933, 0, 936, 0, 928, 934, 937, + 938, 940, 941, 934, 934, 934, 934, 934, 934, 934, + 934, 934, 934, 935, 935, 935, 935, 935, 934, 939, + 942, 943, 941, 944, 939, 939, 939, 939, 939, 939, + 939, 939, 939, 939, 946, 946, 946, 946, 946, 939, + 942, 943, 947, 944, 945, 948, 949, 950, 951, 945, + 945, 945, 945, 945, 945, 945, 945, 945, 945, 952, + 953, 954, 947, 955, 945, 948, 949, 950, 951, 956, + 957, 958, 952, 952, 959, 961, 961, 961, 961, 952, + 953, 954, 0, 955, 982, 982, 982, 982, 0, 956, + + 957, 958, 962, 963, 959, 960, 964, 965, 966, 967, + 960, 960, 960, 960, 960, 960, 960, 960, 960, 960, + 968, 0, 962, 963, 970, 960, 964, 965, 966, 967, + 986, 986, 986, 986, 2082, 2082, 971, 972, 973, 992, + 968, 969, 2083, 2083, 970, 0, 969, 969, 969, 969, + 969, 969, 969, 969, 969, 969, 971, 972, 973, 992, + 994, 969, 988, 988, 988, 988, 989, 0, 995, 990, + 0, 989, 989, 989, 990, 990, 990, 2084, 2084, 0, + 994, 1024, 1024, 1024, 1024, 996, 989, 993, 995, 990, + 991, 0, 993, 993, 999, 991, 991, 991, 991, 991, + + 991, 991, 991, 991, 991, 996, 0, 993, 2085, 2085, + 991, 997, 1000, 1001, 999, 1003, 997, 997, 997, 997, + 997, 997, 997, 997, 997, 997, 998, 998, 998, 998, + 998, 997, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1002, + 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1007, + 0, 1010, 1011, 1012, 1002, 0, 1004, 1005, 1006, 1009, + 1009, 1009, 1009, 1009, 0, 1013, 1014, 2086, 2086, 1007, + 1008, 1010, 1011, 1012, 1015, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1013, 1014, 1015, 1015, 1016, + 1008, 1017, 1018, 1019, 1015, 1020, 1021, 1022, 0, 1025, + + 1026, 1027, 1028, 1043, 1043, 1043, 1043, 1043, 0, 1016, + 0, 1017, 1018, 1019, 1029, 1020, 1021, 1022, 1023, 1025, + 1026, 1027, 1028, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1030, 1029, 1031, 0, 1033, 1023, 1034, + 1035, 1051, 1051, 1051, 1051, 1051, 1062, 1062, 1062, 1062, + 1062, 1036, 1037, 1030, 1038, 1031, 1032, 1033, 1039, 1034, + 1035, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1036, 1037, 1040, 1038, 1041, 1032, 1045, 1039, 1046, + 1047, 2223, 2223, 0, 1046, 1046, 1077, 1077, 1077, 1077, + 0, 1048, 1049, 1040, 1052, 1041, 1042, 1045, 1053, 1046, + + 1047, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, + 1042, 1048, 1049, 1054, 1052, 1056, 1042, 1044, 1053, 1057, + 1058, 1059, 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 0, 1054, 1060, 1056, 1063, 1044, 1050, 1057, + 1058, 1059, 1064, 1050, 1050, 1050, 1050, 1050, 1050, 1050, + 1050, 1050, 1050, 0, 1060, 1065, 1063, 1066, 1050, 1055, + 0, 1067, 1064, 1069, 1055, 1055, 1055, 1055, 1055, 1055, + 1055, 1055, 1055, 1055, 0, 1065, 0, 1066, 1070, 1055, + 1061, 1067, 1068, 1069, 1071, 1061, 1061, 1061, 1061, 1061, + 1061, 1061, 1061, 1061, 1061, 1068, 1068, 1072, 1070, 1073, + + 1061, 1074, 1068, 1075, 1071, 1078, 1079, 1080, 1081, 1096, + 1096, 1096, 1096, 1096, 2387, 2387, 0, 1072, 0, 1073, + 1082, 1074, 1083, 1075, 1076, 1078, 1079, 1080, 1081, 1076, + 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1084, + 1082, 1086, 1083, 1087, 1076, 1115, 1115, 1115, 1115, 1115, + 1126, 1126, 1126, 1126, 1126, 1088, 1089, 1090, 1091, 1084, + 1085, 1086, 1092, 1087, 1093, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1088, 1089, 1090, 1091, 1094, + 1085, 1107, 1092, 1109, 1093, 1141, 1141, 1141, 1141, 1158, + 1158, 1158, 1158, 1158, 0, 1111, 1112, 0, 1113, 1094, + + 1095, 1107, 0, 1109, 1116, 1095, 1095, 1095, 1095, 1095, + 1095, 1095, 1095, 1095, 1095, 1111, 1112, 1110, 1113, 1117, + 1095, 1108, 1110, 1110, 1116, 1118, 1108, 1108, 1108, 1108, + 1108, 1108, 1108, 1108, 1108, 1108, 0, 1110, 1120, 1117, + 1121, 1108, 1114, 0, 1122, 1118, 1123, 1114, 1114, 1114, + 1114, 1114, 1114, 1114, 1114, 1114, 1114, 0, 1120, 1124, + 1121, 1127, 1114, 1119, 1122, 1128, 1123, 1129, 1119, 1119, + 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 0, 1124, + 1130, 1127, 1131, 1119, 1125, 1128, 1133, 1129, 1134, 1125, + 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1132, + + 1130, 1135, 1131, 1136, 1125, 1137, 1133, 1138, 1134, 1139, + 0, 1142, 1132, 1132, 1143, 1184, 1184, 1184, 1184, 1132, + 0, 1135, 0, 1136, 0, 1137, 1144, 1138, 1145, 1139, + 1140, 1142, 1146, 1147, 1143, 1140, 1140, 1140, 1140, 1140, + 1140, 1140, 1140, 1140, 1140, 1148, 1144, 1150, 1145, 1152, + 1140, 0, 1146, 1147, 1169, 1169, 1169, 1169, 1169, 2574, + 2574, 1154, 1155, 0, 1156, 1148, 1149, 1150, 0, 1152, + 1159, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, + 1149, 1154, 1155, 1153, 1156, 1160, 1149, 1151, 1153, 1153, + 1159, 1161, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, + + 1151, 1151, 0, 1153, 1163, 1160, 1164, 1151, 1157, 0, + 1165, 1161, 1166, 1157, 1157, 1157, 1157, 1157, 1157, 1157, + 1157, 1157, 1157, 0, 1163, 1167, 1164, 1170, 1157, 1162, + 1165, 1171, 1166, 1172, 1162, 1162, 1162, 1162, 1162, 1162, + 1162, 1162, 1162, 1162, 0, 1167, 1173, 1170, 1174, 1162, + 1168, 1171, 1176, 1172, 1177, 1168, 1168, 1168, 1168, 1168, + 1168, 1168, 1168, 1168, 1168, 1175, 1173, 1178, 1174, 1179, + 1168, 1180, 1176, 1181, 1177, 1182, 0, 1185, 1175, 1175, + 1186, 1218, 1218, 1218, 1218, 1175, 0, 1178, 0, 1179, + 0, 1180, 1187, 1181, 1188, 1182, 1183, 1185, 1189, 1190, + + 1186, 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1183, + 1183, 1191, 1187, 1193, 1188, 1194, 1183, 0, 1189, 1190, + 1203, 1203, 1203, 1203, 1203, 2575, 2575, 1195, 1196, 1197, + 1198, 1191, 1192, 1193, 1199, 1194, 1200, 1192, 1192, 1192, + 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1195, 1196, 1197, + 1198, 1201, 1192, 1204, 1199, 1206, 1200, 1220, 1220, 1220, + 1220, 1228, 1228, 1228, 1228, 1228, 0, 1215, 0, 1215, + 1215, 1201, 1202, 1204, 1222, 1206, 1224, 1202, 1202, 1202, + 1202, 1202, 1202, 1202, 1202, 1202, 1202, 1215, 1216, 0, + 1216, 1216, 1202, 1223, 1222, 0, 1224, 0, 1223, 1223, + + 1254, 1254, 1254, 1254, 1225, 1226, 1229, 1230, 1216, 1221, + 0, 1231, 1233, 1223, 1221, 1221, 1221, 1221, 1221, 1221, + 1221, 1221, 1221, 1221, 1225, 1226, 1229, 1230, 1234, 1221, + 1227, 1231, 1233, 1235, 1236, 1227, 1227, 1227, 1227, 1227, + 1227, 1227, 1227, 1227, 1227, 0, 1237, 1240, 1234, 1241, + 1227, 1232, 0, 1235, 1236, 1242, 1232, 1232, 1232, 1232, + 1232, 1232, 1232, 1232, 1232, 1232, 1237, 1240, 0, 1241, + 0, 1232, 1238, 1243, 1244, 1242, 1246, 1238, 1238, 1238, + 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1239, 1239, 1239, + 1239, 1239, 1238, 1243, 1244, 1245, 1246, 1247, 1248, 1249, + + 1250, 1251, 1252, 0, 1255, 1256, 1257, 1258, 1245, 1245, + 1273, 1273, 1273, 1273, 1273, 1245, 0, 1247, 1248, 1249, + 1250, 1251, 1252, 1253, 1255, 1256, 1257, 1258, 1253, 1253, + 1253, 1253, 1253, 1253, 1253, 1253, 1253, 1253, 1259, 1260, + 1261, 0, 1263, 1253, 1264, 1265, 1292, 1292, 1292, 1292, + 1292, 1303, 1303, 1303, 1303, 1303, 1266, 1267, 1259, 1260, + 1261, 1262, 1263, 1268, 1264, 1265, 1262, 1262, 1262, 1262, + 1262, 1262, 1262, 1262, 1262, 1262, 1266, 1267, 1269, 1270, + 1271, 1262, 1284, 1268, 1286, 1287, 1318, 1318, 1318, 1318, + 1287, 1287, 1371, 1371, 1371, 1371, 1288, 1289, 1269, 1270, + + 1271, 1272, 1284, 1290, 1286, 1287, 1272, 1272, 1272, 1272, + 1272, 1272, 1272, 1272, 1272, 1272, 1288, 1289, 1293, 1294, + 1295, 1272, 1285, 1290, 1297, 1298, 1299, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 0, 1293, 1294, + 1295, 1300, 1285, 1291, 1297, 1298, 1299, 1301, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 0, 1304, + 1305, 1300, 1306, 1291, 1296, 0, 1307, 1301, 1308, 1296, + 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1304, + 1305, 0, 1306, 1310, 1296, 1302, 1307, 1309, 1308, 1311, + 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, + + 1309, 1309, 1312, 1310, 1313, 1302, 1314, 1309, 1315, 1311, + 1316, 0, 1319, 1320, 1321, 1322, 1337, 1337, 1337, 1337, + 1337, 0, 1312, 0, 1313, 0, 1314, 1323, 1315, 1324, + 1316, 1317, 1319, 1320, 1321, 1322, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1325, 1323, 1327, 1324, + 1328, 1317, 1345, 1345, 1345, 1345, 1345, 1356, 1356, 1356, + 1356, 1356, 1329, 1330, 1331, 1332, 1325, 1326, 1327, 1333, + 1328, 1334, 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326, + 1326, 1326, 1329, 1330, 1331, 1332, 1335, 1326, 1339, 1333, + 1340, 1334, 2577, 2577, 0, 1340, 1340, 1390, 1390, 1390, + + 1390, 1390, 1341, 1342, 1343, 1346, 1335, 1336, 1339, 1347, + 1340, 1348, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, + 1336, 1336, 1341, 1342, 1343, 1346, 1350, 1336, 1338, 1347, + 1351, 1348, 1352, 1338, 1338, 1338, 1338, 1338, 1338, 1338, + 1338, 1338, 1338, 0, 1353, 1354, 1350, 1357, 1338, 1344, + 1351, 1358, 1352, 1359, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1353, 1354, 1360, 1357, 1361, 1344, + 1349, 1358, 1363, 1359, 1364, 1349, 1349, 1349, 1349, 1349, + 1349, 1349, 1349, 1349, 1349, 0, 1360, 0, 1361, 1365, + 1349, 1355, 1363, 1362, 1364, 1366, 1355, 1355, 1355, 1355, + + 1355, 1355, 1355, 1355, 1355, 1355, 1362, 1362, 1367, 1365, + 1368, 1355, 1369, 1362, 1372, 1366, 1373, 1374, 1408, 1408, + 1408, 1408, 1408, 1410, 1410, 1410, 1410, 1410, 1367, 1375, + 1368, 1376, 1369, 1370, 1372, 1377, 1373, 1374, 1370, 1370, + 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1378, 1375, + 1380, 1376, 1381, 1370, 0, 1377, 1427, 1427, 1427, 1427, + 1427, 2578, 2578, 0, 1382, 1383, 1384, 1385, 1378, 1379, + 1380, 1386, 1381, 1387, 1379, 1379, 1379, 1379, 1379, 1379, + 1379, 1379, 1379, 1379, 1382, 1383, 1384, 1385, 1388, 1379, + 1401, 1386, 1402, 1387, 1438, 1438, 1438, 1438, 1438, 1453, + + 1453, 1453, 1453, 0, 1404, 0, 1421, 0, 1388, 1389, + 1401, 1423, 1402, 0, 1389, 1389, 1389, 1389, 1389, 1389, + 1389, 1389, 1389, 1389, 1404, 1418, 1421, 1418, 1418, 1389, + 1419, 1423, 1419, 1419, 1422, 1424, 2587, 2587, 0, 1422, + 1422, 1591, 1591, 1591, 1591, 1418, 1425, 1428, 1429, 1430, + 1419, 1420, 0, 1432, 1422, 1424, 1420, 1420, 1420, 1420, + 1420, 1420, 1420, 1420, 1420, 1420, 1425, 1428, 1429, 1430, + 1433, 1420, 1426, 1432, 1434, 1435, 1436, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 0, 1439, 1440, + 1433, 1441, 1426, 1431, 1434, 1435, 1436, 1442, 1431, 1431, + + 1431, 1431, 1431, 1431, 1431, 1431, 1431, 1431, 1439, 1440, + 1443, 1441, 0, 1431, 1437, 1445, 1446, 1442, 1444, 1437, + 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1447, + 1443, 1444, 1444, 1448, 1437, 1445, 1446, 1449, 1444, 1450, + 1451, 0, 1454, 1455, 1456, 1457, 2589, 2589, 0, 1447, + 2591, 2591, 0, 1448, 2592, 2592, 1458, 1449, 1459, 1450, + 1451, 1452, 1454, 1455, 1456, 1457, 1452, 1452, 1452, 1452, + 1452, 1452, 1452, 1452, 1452, 1452, 1458, 1460, 1459, 1462, + 1463, 1452, 1464, 1472, 1472, 1472, 1472, 1472, 1494, 1494, + 1494, 1494, 1494, 1465, 1466, 1467, 1468, 1460, 1461, 1462, + + 1463, 1469, 1464, 1461, 1461, 1461, 1461, 1461, 1461, 1461, + 1461, 1461, 1461, 1465, 1466, 1467, 1468, 1470, 1461, 1483, + 1484, 1469, 1486, 1499, 1499, 1499, 1499, 1499, 1527, 1527, + 1527, 1527, 1527, 1497, 0, 1497, 1497, 1470, 1471, 1483, + 1484, 1509, 1486, 1471, 1471, 1471, 1471, 1471, 1471, 1471, + 1471, 1471, 1471, 1497, 1502, 1511, 1502, 1502, 1471, 1536, + 1530, 1509, 1530, 1530, 1532, 1532, 1532, 1532, 1532, 1535, + 1538, 1535, 1535, 0, 1502, 1511, 1560, 1563, 1565, 1536, + 1530, 1544, 0, 1544, 1544, 1544, 1575, 2594, 2594, 1535, + 1538, 1548, 0, 1548, 1548, 1548, 1560, 1563, 1565, 1579, + + 1570, 1544, 1570, 1570, 1570, 1574, 1575, 1574, 1574, 1574, + 1577, 1548, 1577, 1577, 1578, 1581, 1578, 1578, 1583, 1579, + 1570, 1584, 1584, 1584, 1585, 1574, 1586, 0, 1586, 1586, + 1577, 2595, 2595, 1592, 1578, 1581, 1584, 1587, 1583, 1587, + 1587, 2603, 2603, 0, 1585, 1588, 1586, 1588, 1588, 1589, + 0, 1589, 1589, 1592, 2605, 2605, 1593, 1587, 1593, 1593, + 1594, 0, 1594, 1594, 1595, 1588, 1595, 1595, 1596, 1589, + 1596, 1596, 1598, 0, 1598, 1598, 1593, 0, 0, 1599, + 1594, 1599, 1599, 1600, 1595, 1600, 1600, 1601, 1596, 1601, + 1601, 1602, 1598, 1602, 1602, 1603, 0, 1603, 1603, 1599, + + 0, 0, 1604, 1600, 1604, 1604, 1605, 1601, 1605, 1605, + 1606, 1602, 1606, 1606, 1607, 1603, 1607, 1607, 1608, 0, + 1608, 1608, 1604, 0, 0, 1609, 1605, 1609, 1609, 1610, + 1606, 1610, 1610, 1611, 1607, 1611, 1611, 0, 1608, 0, + 0, 0, 0, 0, 0, 1609, 0, 0, 0, 1610, + 0, 0, 0, 1611, 1613, 1613, 1613, 1613, 1613, 1613, + 1613, 1613, 1613, 1613, 1613, 1613, 1613, 1613, 1613, 1613, + 1613, 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614, + 1614, 1614, 1614, 1614, 1614, 1615, 1615, 1615, 0, 0, + 0, 0, 1615, 1616, 0, 0, 0, 1616, 1616, 1616, + + 0, 0, 1616, 1616, 1616, 1617, 1617, 1617, 0, 0, + 0, 0, 1617, 1618, 0, 1618, 1618, 1618, 1618, 1618, + 0, 0, 0, 0, 1618, 1619, 1619, 1619, 0, 0, + 0, 0, 1619, 1620, 1620, 1620, 1620, 1620, 1620, 1620, + 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1621, 1621, + 1621, 1621, 1621, 1621, 1621, 1621, 1621, 1621, 1621, 1621, + 1621, 1621, 1621, 1621, 1622, 1622, 1622, 1622, 1622, 1622, + 1622, 1622, 1622, 1622, 1622, 1622, 1622, 1622, 1622, 1623, + 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623, + 1623, 0, 1623, 1623, 1624, 1624, 1624, 0, 0, 0, + + 0, 1624, 1625, 1625, 1625, 1625, 1625, 1625, 1625, 1625, + 1625, 1625, 0, 1625, 1625, 1626, 1626, 1626, 1626, 1626, + 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1627, + 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627, + 1627, 1627, 1627, 1628, 1628, 1628, 1629, 1629, 1629, 0, + 0, 0, 0, 1629, 1630, 0, 0, 0, 1630, 1630, + 1630, 0, 0, 1630, 1630, 1630, 1631, 1631, 1631, 1632, + 1632, 1632, 0, 0, 0, 0, 1632, 1633, 1633, 1633, + 1634, 0, 0, 1634, 1634, 1634, 1634, 0, 0, 0, + 1634, 1634, 0, 1634, 1635, 0, 1635, 1635, 1635, 1635, + + 1635, 0, 0, 0, 0, 1635, 1636, 1636, 1636, 1637, + 1637, 1637, 0, 0, 0, 0, 1637, 1638, 1638, 1638, + 1639, 0, 0, 0, 1639, 1639, 1639, 0, 0, 0, + 0, 1639, 1640, 0, 0, 0, 1640, 1640, 1640, 0, + 0, 0, 0, 1640, 1641, 1641, 1641, 1641, 1641, 1641, + 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1642, + 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, + 1642, 1642, 1642, 1642, 1643, 1643, 1643, 1643, 1643, 1643, + 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1644, + 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644, + + 1644, 1644, 1644, 1644, 1645, 1645, 1645, 1646, 1646, 1646, + 1646, 0, 0, 0, 0, 1646, 1647, 1647, 1647, 0, + 0, 0, 0, 1647, 1648, 1648, 1648, 1648, 1648, 1648, + 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1649, 1649, + 1649, 1650, 1650, 1650, 1651, 1651, 1651, 1652, 1652, 1652, + 1653, 1653, 1653, 1654, 0, 0, 0, 1654, 1654, 1654, + 0, 0, 0, 1654, 1654, 0, 1654, 1655, 0, 1655, + 1655, 1655, 1656, 1656, 1656, 1657, 0, 0, 1657, 1657, + 1657, 1657, 0, 0, 0, 1657, 1657, 0, 1657, 1658, + 1658, 1658, 1659, 1659, 1659, 1660, 1660, 1660, 1661, 0, + + 0, 0, 1661, 1661, 1661, 0, 0, 0, 0, 1661, + 1662, 0, 0, 0, 1662, 1662, 1662, 0, 0, 0, + 0, 1662, 1663, 0, 0, 0, 1663, 1663, 1663, 0, + 0, 0, 0, 1663, 1664, 0, 0, 0, 1664, 1664, + 1664, 0, 0, 0, 0, 1664, 1665, 0, 0, 0, + 1665, 1665, 1665, 0, 0, 0, 0, 1665, 1666, 0, + 0, 0, 1666, 1666, 1666, 0, 0, 0, 0, 1666, + 1667, 1667, 1667, 1668, 0, 0, 0, 1668, 1668, 1668, + 0, 0, 0, 0, 1668, 1669, 0, 0, 0, 1669, + 1669, 1669, 0, 0, 0, 0, 1669, 1670, 1670, 1670, + + 1670, 1670, 1670, 1670, 1670, 1670, 1670, 1670, 1670, 1670, + 1670, 1670, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, + 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1672, 1672, 1672, + 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, + 1672, 1672, 1672, 1673, 1673, 1673, 1673, 1673, 1673, 1673, + 1673, 1673, 1673, 1673, 1673, 1673, 1673, 1673, 1674, 1674, + 1674, 1674, 1674, 1674, 1674, 1674, 1674, 0, 1674, 1674, + 1674, 1674, 1674, 1675, 1675, 1675, 1675, 1675, 1675, 1675, + 1675, 1675, 1675, 1675, 1675, 1675, 1675, 1675, 1676, 1676, + 1676, 1676, 1676, 1676, 1676, 1676, 1676, 1676, 1676, 1676, + + 1676, 1676, 1676, 1677, 1677, 1677, 1677, 1677, 1677, 1677, + 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1678, 1678, + 1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678, + 1678, 1678, 1678, 1679, 1679, 1679, 1679, 1679, 1679, 1679, + 1679, 1679, 1679, 1679, 1679, 1679, 1679, 1679, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1681, 0, 0, 0, 1681, 1681, 0, + 1681, 0, 0, 0, 1681, 1682, 1682, 1682, 1683, 1683, + 1683, 1683, 1683, 1683, 1683, 1683, 1683, 1683, 1683, 1683, + 0, 1683, 1683, 1684, 1684, 1684, 1685, 1685, 1685, 1685, + + 0, 0, 0, 0, 1685, 1686, 1686, 1686, 1686, 0, + 0, 0, 0, 1686, 1687, 1687, 1687, 1687, 1687, 1687, + 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1688, 1688, + 1688, 1689, 0, 0, 0, 1689, 1689, 1689, 0, 0, + 1689, 1689, 1689, 1690, 1690, 1690, 1691, 1691, 1691, 1692, + 1692, 1692, 1693, 1693, 1693, 1694, 0, 1694, 1694, 1694, + 1695, 0, 0, 0, 1695, 1695, 1695, 0, 0, 0, + 1695, 1695, 0, 1695, 1696, 0, 1696, 1696, 1696, 1697, + 1697, 1697, 1698, 0, 0, 0, 1698, 1698, 1698, 0, + 0, 0, 1698, 1698, 0, 1698, 1699, 0, 0, 0, + + 1699, 1699, 1699, 0, 0, 0, 1699, 1699, 0, 1699, + 1700, 0, 0, 1700, 1700, 1700, 1700, 0, 0, 0, + 1700, 1700, 0, 1700, 1701, 0, 1701, 1701, 1701, 1702, + 1702, 1702, 1703, 1703, 1703, 1704, 1704, 1704, 1705, 1705, + 1705, 1706, 0, 0, 0, 1706, 1706, 1706, 0, 0, + 0, 0, 1706, 1707, 0, 0, 0, 1707, 1707, 1707, + 0, 0, 0, 0, 1707, 1708, 0, 0, 0, 1708, + 1708, 1708, 0, 0, 0, 0, 1708, 1709, 0, 0, + 0, 1709, 1709, 1709, 0, 0, 0, 0, 1709, 1710, + 0, 0, 0, 1710, 1710, 1710, 0, 0, 0, 0, + + 1710, 1711, 0, 0, 0, 1711, 1711, 1711, 0, 0, + 0, 0, 1711, 1712, 0, 0, 0, 1712, 1712, 1712, + 0, 0, 0, 0, 1712, 1713, 0, 0, 0, 1713, + 1713, 1713, 0, 0, 0, 0, 1713, 1714, 0, 0, + 0, 1714, 1714, 1714, 0, 0, 0, 0, 1714, 1715, + 0, 0, 0, 1715, 1715, 1715, 0, 0, 0, 0, + 1715, 1716, 0, 0, 0, 1716, 1716, 1716, 0, 0, + 0, 0, 1716, 1717, 0, 0, 0, 1717, 1717, 1717, + 0, 0, 0, 0, 1717, 1718, 0, 0, 0, 1718, + 1718, 1718, 0, 0, 0, 0, 1718, 1719, 0, 0, + + 0, 1719, 1719, 1719, 0, 0, 0, 0, 1719, 1720, + 0, 0, 0, 1720, 1720, 1720, 0, 0, 0, 0, + 1720, 1721, 0, 0, 0, 1721, 1721, 1721, 0, 0, + 0, 0, 1721, 1722, 0, 0, 0, 1722, 1722, 1722, + 0, 0, 0, 0, 1722, 1723, 0, 0, 0, 1723, + 1723, 1723, 0, 0, 0, 0, 1723, 1724, 1724, 1724, + 1724, 1724, 1724, 1724, 1724, 1724, 1724, 1724, 1724, 1724, + 1724, 1724, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725, + 1725, 0, 1725, 1725, 1725, 0, 1725, 1726, 1726, 1726, + 1726, 1726, 1726, 1726, 1726, 1726, 0, 1726, 1726, 1726, + + 1726, 1726, 1727, 1727, 1727, 1727, 1727, 1727, 1727, 1727, + 1727, 0, 1727, 1727, 1727, 1727, 1727, 1728, 1728, 1728, + 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1728, + 1728, 1728, 1729, 1729, 1729, 1729, 1729, 1729, 1729, 1729, + 1729, 1729, 1729, 1729, 1729, 1729, 1729, 1730, 1730, 1730, + 1730, 1730, 1730, 1730, 1730, 1730, 1730, 1730, 1730, 1730, + 1730, 1730, 1731, 1731, 1731, 1731, 1731, 1731, 1731, 1731, + 1731, 0, 1731, 1731, 1731, 1731, 1731, 1732, 1732, 1732, + 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, + 1732, 1732, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, + + 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1734, 1734, 1734, + 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, + 1734, 1734, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, + 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1736, 1736, 1736, + 1736, 1736, 1736, 1736, 1736, 1736, 1736, 1736, 1736, 1736, + 1736, 1736, 1737, 1737, 1737, 1739, 0, 0, 0, 1739, + 1739, 0, 1739, 0, 0, 0, 1739, 1740, 1740, 1740, + 1741, 1741, 1741, 1741, 0, 0, 0, 0, 1741, 1742, + 1742, 1742, 1743, 1743, 1743, 1744, 1744, 1744, 1745, 1745, + 1745, 1746, 0, 1746, 1746, 1746, 1747, 0, 0, 0, + + 1747, 1747, 1747, 0, 0, 0, 1747, 1747, 0, 1747, + 1748, 0, 1748, 1748, 1748, 1749, 1749, 1749, 1750, 1750, + 1750, 1751, 1751, 1751, 1752, 0, 0, 0, 1752, 1752, + 1752, 0, 0, 0, 0, 1752, 1753, 0, 0, 0, + 1753, 1753, 1753, 0, 0, 0, 0, 1753, 1754, 0, + 0, 0, 1754, 1754, 1754, 0, 0, 0, 0, 1754, + 1755, 0, 0, 0, 1755, 1755, 1755, 0, 0, 0, + 0, 1755, 1756, 0, 0, 0, 1756, 1756, 1756, 0, + 0, 0, 0, 1756, 1757, 0, 0, 0, 1757, 1757, + 1757, 0, 0, 0, 0, 1757, 1758, 0, 0, 0, + + 1758, 1758, 1758, 0, 0, 0, 0, 1758, 1759, 0, + 0, 0, 1759, 1759, 1759, 0, 0, 0, 0, 1759, + 1760, 0, 0, 0, 1760, 1760, 1760, 0, 0, 0, + 0, 1760, 1761, 0, 0, 0, 1761, 1761, 1761, 0, + 0, 0, 0, 1761, 1762, 0, 0, 0, 1762, 1762, + 1762, 0, 0, 0, 0, 1762, 1763, 0, 0, 0, + 1763, 1763, 1763, 0, 0, 0, 0, 1763, 1764, 0, + 0, 0, 1764, 1764, 1764, 0, 0, 0, 0, 1764, + 1765, 0, 0, 0, 1765, 1765, 1765, 0, 0, 0, + 0, 1765, 1766, 0, 0, 0, 1766, 1766, 1766, 0, + + 0, 0, 0, 1766, 1767, 0, 0, 0, 1767, 1767, + 1767, 0, 0, 0, 0, 1767, 1768, 0, 0, 0, + 1768, 1768, 1768, 0, 0, 0, 0, 1768, 1769, 0, + 0, 0, 1769, 1769, 1769, 0, 0, 0, 0, 1769, + 1770, 0, 0, 0, 1770, 1770, 1770, 0, 0, 0, + 0, 1770, 1771, 0, 0, 0, 1771, 1771, 1771, 0, + 0, 0, 0, 1771, 1772, 0, 0, 0, 1772, 1772, + 1772, 0, 0, 0, 0, 1772, 1773, 0, 0, 0, + 1773, 1773, 1773, 0, 0, 0, 0, 1773, 1774, 0, + 0, 0, 1774, 1774, 1774, 0, 0, 0, 0, 1774, + + 1775, 0, 0, 0, 1775, 1775, 1775, 0, 0, 0, + 0, 1775, 1776, 0, 0, 0, 1776, 1776, 1776, 0, + 0, 0, 0, 1776, 1777, 0, 0, 0, 1777, 1777, + 1777, 0, 0, 0, 0, 1777, 1778, 0, 0, 0, + 1778, 1778, 1778, 0, 0, 0, 0, 1778, 1779, 0, + 0, 0, 1779, 1779, 1779, 0, 0, 0, 0, 1779, + 1780, 0, 0, 0, 1780, 1780, 1780, 0, 0, 0, + 0, 1780, 1781, 0, 0, 0, 1781, 1781, 1781, 0, + 0, 0, 0, 1781, 1782, 0, 0, 0, 1782, 1782, + 1782, 0, 0, 0, 0, 1782, 1783, 0, 0, 0, + + 1783, 1783, 1783, 0, 0, 0, 0, 1783, 1784, 1784, + 1784, 1784, 1784, 1784, 1784, 1784, 1784, 0, 1784, 1784, + 1784, 0, 1784, 1785, 1785, 1785, 1785, 1785, 1785, 1785, + 1785, 1785, 0, 1785, 1785, 1785, 0, 1785, 1786, 1786, + 1786, 1786, 1786, 1786, 1786, 1786, 1786, 0, 1786, 1786, + 1786, 1786, 1786, 1787, 1787, 1787, 1787, 1787, 1787, 1787, + 1787, 1787, 0, 1787, 1787, 1787, 1787, 1787, 1788, 1788, + 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, + 1788, 1788, 1788, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1790, 1790, + + 1790, 1790, 1790, 1790, 1790, 1790, 1790, 0, 1790, 1790, + 1790, 1790, 1790, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 0, 1791, 1791, 1791, 1791, 1791, 1792, 1792, + 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1792, 1793, 1793, 1793, 1793, 1793, 1793, 1793, + 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1794, 1794, + 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + 1794, 1794, 1794, 1795, 1795, 1795, 1795, 1795, 1795, 1795, + 1795, 1795, 1795, 1795, 1795, 1795, 1795, 1795, 1796, 1796, + 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, + + 1796, 1796, 1796, 1797, 1797, 1797, 1797, 1797, 1797, 1797, + 1797, 1797, 1797, 1797, 1797, 1797, 0, 1797, 1798, 0, + 0, 0, 1798, 1798, 0, 0, 0, 0, 0, 1798, + 1799, 1799, 1799, 1800, 1800, 1800, 1801, 1801, 1801, 1805, + 1805, 1805, 1806, 1806, 1806, 1808, 1808, 1808, 0, 0, + 0, 0, 1808, 1810, 0, 0, 0, 1810, 1810, 1810, + 0, 0, 0, 0, 1810, 1811, 0, 0, 0, 1811, + 1811, 1811, 0, 0, 0, 0, 1811, 1812, 0, 0, + 0, 1812, 1812, 1812, 0, 0, 0, 0, 1812, 1813, + 0, 0, 0, 1813, 1813, 1813, 0, 0, 0, 0, + + 1813, 1814, 0, 0, 0, 1814, 1814, 1814, 0, 0, + 0, 0, 1814, 1815, 0, 0, 0, 1815, 1815, 1815, + 0, 0, 0, 0, 1815, 1816, 0, 0, 0, 1816, + 1816, 1816, 0, 0, 0, 0, 1816, 1817, 0, 0, + 0, 1817, 1817, 1817, 0, 0, 0, 0, 1817, 1818, + 0, 0, 0, 1818, 1818, 1818, 0, 0, 0, 0, + 1818, 1819, 0, 0, 0, 1819, 1819, 1819, 0, 0, + 0, 0, 1819, 1820, 0, 0, 0, 1820, 1820, 1820, + 0, 0, 0, 0, 1820, 1821, 0, 0, 0, 1821, + 1821, 1821, 0, 0, 0, 0, 1821, 1822, 0, 0, + + 0, 1822, 1822, 1822, 0, 0, 0, 0, 1822, 1823, + 0, 0, 0, 1823, 1823, 1823, 0, 0, 0, 0, + 1823, 1824, 0, 0, 0, 1824, 1824, 1824, 0, 0, + 0, 0, 1824, 1825, 0, 0, 0, 1825, 1825, 1825, + 0, 0, 0, 0, 1825, 1826, 0, 0, 0, 1826, + 1826, 1826, 0, 0, 0, 0, 1826, 1827, 0, 0, + 0, 1827, 1827, 1827, 0, 0, 0, 0, 1827, 1828, + 0, 0, 0, 1828, 1828, 1828, 0, 0, 0, 0, + 1828, 1829, 0, 0, 0, 1829, 1829, 1829, 0, 0, + 0, 0, 1829, 1830, 0, 0, 0, 1830, 1830, 1830, + + 0, 0, 0, 0, 1830, 1831, 0, 0, 0, 1831, + 1831, 1831, 0, 0, 0, 0, 1831, 1832, 0, 0, + 0, 1832, 1832, 1832, 0, 0, 0, 0, 1832, 1833, + 0, 0, 0, 1833, 1833, 1833, 0, 0, 0, 0, + 1833, 1834, 0, 0, 0, 1834, 1834, 1834, 0, 0, + 0, 0, 1834, 1835, 0, 0, 0, 1835, 1835, 1835, + 0, 0, 0, 0, 1835, 1836, 0, 0, 0, 1836, + 1836, 1836, 0, 0, 0, 0, 1836, 1837, 0, 0, + 0, 1837, 1837, 1837, 0, 0, 0, 0, 1837, 1838, + 0, 0, 0, 1838, 1838, 1838, 0, 0, 0, 0, + + 1838, 1839, 0, 0, 0, 1839, 1839, 1839, 0, 0, + 0, 0, 1839, 1840, 0, 0, 0, 1840, 1840, 1840, + 0, 0, 0, 0, 1840, 1841, 0, 0, 0, 1841, + 1841, 1841, 0, 0, 0, 0, 1841, 1842, 0, 0, + 0, 1842, 1842, 1842, 0, 0, 0, 0, 1842, 1843, + 0, 0, 0, 1843, 1843, 1843, 0, 0, 0, 0, + 1843, 1844, 0, 0, 0, 1844, 1844, 1844, 0, 0, + 0, 0, 1844, 1845, 0, 0, 0, 1845, 1845, 1845, + 0, 0, 0, 0, 1845, 1846, 0, 0, 0, 1846, + 1846, 1846, 0, 0, 0, 0, 1846, 1847, 0, 0, + + 0, 1847, 1847, 1847, 0, 0, 0, 0, 1847, 1848, + 0, 0, 0, 1848, 1848, 1848, 0, 0, 0, 0, + 1848, 1849, 0, 0, 0, 1849, 1849, 1849, 0, 0, + 0, 0, 1849, 1850, 0, 0, 0, 1850, 1850, 1850, + 0, 0, 0, 0, 1850, 1851, 0, 0, 0, 1851, + 1851, 1851, 0, 0, 0, 0, 1851, 1852, 0, 0, + 0, 1852, 1852, 1852, 0, 0, 0, 0, 1852, 1853, + 0, 0, 0, 1853, 1853, 1853, 0, 0, 0, 0, + 1853, 1854, 0, 0, 0, 1854, 1854, 1854, 0, 0, + 0, 0, 1854, 1855, 0, 0, 0, 1855, 1855, 1855, + + 0, 0, 0, 0, 1855, 1856, 0, 0, 0, 1856, + 1856, 1856, 0, 0, 0, 0, 1856, 1857, 0, 0, + 0, 1857, 1857, 1857, 0, 0, 0, 0, 1857, 1858, + 0, 0, 0, 1858, 1858, 1858, 0, 0, 0, 0, + 1858, 1859, 0, 0, 0, 1859, 1859, 1859, 0, 0, + 0, 0, 1859, 1860, 0, 0, 0, 1860, 1860, 1860, + 0, 0, 0, 0, 1860, 1861, 1861, 1861, 1861, 1861, + 1861, 1861, 1861, 1861, 0, 1861, 1861, 1861, 0, 1861, + 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 0, + 1862, 1862, 1862, 0, 1862, 1863, 1863, 1863, 1863, 1863, + + 1863, 1863, 1863, 1863, 0, 1863, 1863, 1863, 1863, 1863, + 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 0, + 1864, 1864, 1864, 1864, 1864, 1865, 1865, 1865, 1865, 1865, + 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, + 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + 1866, 1866, 1866, 0, 1866, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 0, 1867, 1867, 1867, 1867, 1867, + 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 0, + 1868, 1868, 1868, 1868, 1868, 1869, 1869, 1869, 1869, 1869, + 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, + + 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, + 1870, 1870, 1870, 1870, 1870, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, + 1872, 1872, 1872, 0, 1872, 1873, 1873, 1873, 1873, 1873, + 1873, 1873, 1873, 1873, 1873, 1873, 1873, 1873, 0, 1873, + 1874, 1874, 1874, 1875, 0, 0, 0, 1875, 1875, 0, + 0, 0, 0, 0, 1875, 1876, 0, 0, 0, 1876, + 1876, 0, 0, 0, 0, 0, 1876, 1877, 1877, 1877, + 1883, 0, 0, 0, 1883, 1883, 1883, 0, 0, 0, + + 0, 1883, 1884, 0, 0, 0, 1884, 1884, 1884, 0, + 0, 0, 0, 1884, 1885, 0, 0, 0, 1885, 1885, + 1885, 0, 0, 0, 0, 1885, 1886, 0, 0, 0, + 1886, 1886, 1886, 0, 0, 0, 0, 1886, 1887, 0, + 0, 0, 1887, 1887, 1887, 0, 0, 0, 0, 1887, + 1888, 0, 0, 0, 1888, 1888, 1888, 0, 0, 0, + 0, 1888, 1889, 0, 0, 0, 1889, 1889, 1889, 0, + 0, 0, 0, 1889, 1890, 0, 0, 0, 1890, 1890, + 1890, 0, 0, 0, 0, 1890, 1891, 0, 0, 0, + 1891, 1891, 1891, 0, 0, 0, 0, 1891, 1892, 0, + + 0, 0, 1892, 1892, 1892, 0, 0, 0, 0, 1892, + 1893, 0, 0, 0, 1893, 1893, 1893, 0, 0, 0, + 0, 1893, 1894, 0, 0, 0, 1894, 1894, 1894, 0, + 0, 0, 0, 1894, 1895, 0, 0, 0, 1895, 1895, + 1895, 0, 0, 0, 0, 1895, 1896, 0, 0, 0, + 1896, 1896, 1896, 0, 0, 0, 0, 1896, 1897, 0, + 0, 0, 1897, 1897, 1897, 0, 0, 0, 0, 1897, + 1898, 0, 0, 0, 1898, 1898, 1898, 0, 0, 0, + 0, 1898, 1899, 0, 0, 0, 1899, 1899, 1899, 0, + 0, 0, 0, 1899, 1900, 0, 0, 0, 1900, 1900, + + 1900, 0, 0, 0, 0, 1900, 1901, 0, 0, 0, + 1901, 1901, 1901, 0, 0, 0, 0, 1901, 1902, 0, + 0, 0, 1902, 1902, 1902, 0, 0, 0, 0, 1902, + 1903, 0, 0, 0, 1903, 1903, 1903, 0, 0, 0, + 0, 1903, 1904, 0, 0, 0, 1904, 1904, 1904, 0, + 0, 0, 0, 1904, 1905, 0, 0, 0, 1905, 1905, + 1905, 0, 0, 0, 0, 1905, 1906, 0, 0, 0, + 1906, 1906, 1906, 0, 0, 0, 0, 1906, 1907, 0, + 0, 0, 1907, 1907, 1907, 0, 0, 0, 0, 1907, + 1908, 0, 0, 0, 1908, 1908, 1908, 0, 0, 0, + + 0, 1908, 1909, 0, 0, 0, 1909, 1909, 1909, 0, + 0, 0, 0, 1909, 1910, 0, 0, 0, 1910, 1910, + 1910, 0, 0, 0, 0, 1910, 1911, 0, 0, 0, + 1911, 1911, 1911, 0, 0, 0, 0, 1911, 1912, 0, + 0, 0, 1912, 1912, 1912, 0, 0, 0, 0, 1912, + 1913, 0, 0, 0, 1913, 1913, 1913, 0, 0, 0, + 0, 1913, 1914, 0, 0, 0, 1914, 1914, 1914, 0, + 0, 0, 0, 1914, 1915, 0, 0, 0, 1915, 1915, + 1915, 0, 0, 0, 0, 1915, 1916, 0, 0, 0, + 1916, 1916, 1916, 0, 0, 0, 0, 1916, 1917, 0, + + 0, 0, 1917, 1917, 1917, 0, 0, 0, 0, 1917, + 1918, 0, 0, 0, 1918, 1918, 1918, 0, 0, 0, + 0, 1918, 1919, 0, 0, 0, 1919, 1919, 1919, 0, + 0, 0, 0, 1919, 1920, 0, 0, 0, 1920, 1920, + 1920, 0, 0, 0, 0, 1920, 1921, 0, 0, 0, + 1921, 1921, 1921, 0, 0, 0, 0, 1921, 1922, 0, + 0, 0, 1922, 1922, 1922, 0, 0, 0, 0, 1922, + 1923, 0, 0, 0, 1923, 1923, 1923, 0, 0, 0, + 0, 1923, 1924, 0, 0, 0, 1924, 1924, 1924, 0, + 0, 0, 0, 1924, 1925, 0, 0, 0, 1925, 1925, + + 1925, 0, 0, 0, 0, 1925, 1926, 0, 0, 0, + 1926, 1926, 1926, 0, 0, 0, 0, 1926, 1927, 0, + 0, 0, 1927, 1927, 1927, 0, 0, 0, 0, 1927, + 1928, 0, 0, 0, 1928, 1928, 1928, 0, 0, 0, + 0, 1928, 1929, 0, 0, 0, 1929, 1929, 1929, 0, + 0, 0, 0, 1929, 1930, 0, 0, 0, 1930, 1930, + 1930, 0, 0, 0, 0, 1930, 1931, 0, 0, 0, + 1931, 1931, 1931, 0, 0, 0, 0, 1931, 1932, 0, + 0, 0, 1932, 1932, 1932, 0, 0, 0, 0, 1932, + 1933, 0, 0, 0, 1933, 1933, 1933, 0, 0, 0, + + 0, 1933, 1934, 0, 0, 0, 1934, 1934, 1934, 0, + 0, 0, 0, 1934, 1935, 0, 0, 0, 1935, 1935, + 1935, 0, 0, 0, 0, 1935, 1936, 0, 0, 0, + 1936, 1936, 1936, 0, 0, 0, 0, 1936, 1937, 0, + 0, 0, 1937, 1937, 1937, 0, 0, 0, 0, 1937, + 1938, 0, 0, 0, 1938, 1938, 1938, 0, 0, 0, + 0, 1938, 1939, 0, 0, 0, 1939, 1939, 1939, 0, + 0, 0, 0, 1939, 1940, 0, 0, 0, 1940, 1940, + 1940, 0, 0, 0, 0, 1940, 1941, 0, 0, 0, + 1941, 1941, 1941, 0, 0, 0, 0, 1941, 1942, 0, + + 0, 0, 1942, 1942, 1942, 0, 0, 0, 0, 1942, + 1943, 0, 0, 0, 1943, 1943, 1943, 0, 0, 0, + 0, 1943, 1944, 0, 0, 0, 1944, 1944, 1944, 0, + 0, 0, 0, 1944, 1945, 0, 0, 0, 1945, 1945, + 1945, 0, 0, 0, 0, 1945, 1946, 0, 0, 0, + 1946, 1946, 1946, 0, 0, 0, 0, 1946, 1947, 0, + 0, 0, 1947, 1947, 1947, 0, 0, 0, 0, 1947, + 1948, 0, 0, 0, 1948, 1948, 1948, 0, 0, 0, + 0, 1948, 1949, 0, 0, 0, 1949, 1949, 1949, 0, + 0, 0, 0, 1949, 1950, 0, 0, 0, 1950, 1950, + + 1950, 0, 0, 0, 0, 1950, 1951, 0, 0, 0, + 1951, 1951, 1951, 0, 0, 0, 0, 1951, 1952, 0, + 0, 0, 1952, 1952, 1952, 0, 0, 0, 0, 1952, + 1953, 0, 0, 0, 1953, 1953, 1953, 0, 0, 0, + 0, 1953, 1954, 0, 0, 0, 1954, 1954, 1954, 0, + 0, 0, 0, 1954, 1955, 0, 0, 0, 1955, 1955, + 1955, 0, 0, 0, 0, 1955, 1956, 0, 0, 0, + 1956, 1956, 1956, 0, 0, 0, 0, 1956, 1957, 0, + 0, 0, 1957, 1957, 1957, 0, 0, 0, 0, 1957, + 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 0, + + 1958, 1958, 1958, 0, 1958, 1959, 1959, 1959, 1959, 1959, + 1959, 1959, 1959, 1959, 0, 1959, 1959, 1959, 1959, 1959, + 1960, 1960, 1960, 1960, 1960, 1960, 1960, 1960, 1960, 0, + 1960, 1960, 1960, 0, 1960, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 0, 1961, + 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962, 0, + 1962, 1962, 1962, 1962, 1962, 1963, 1963, 1963, 1963, 1963, + 1963, 1963, 1963, 1963, 0, 1963, 1963, 1963, 1963, 1963, + 1964, 1964, 1964, 1964, 1964, 1964, 1964, 1964, 1964, 1964, + 1964, 1964, 1964, 1964, 1964, 1965, 1965, 1965, 1965, 1965, + + 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 0, 1965, + 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, + 1966, 1966, 1966, 0, 1966, 1968, 1968, 1968, 1974, 0, + 0, 0, 1974, 1974, 1974, 0, 0, 0, 0, 1974, + 1975, 0, 0, 0, 1975, 1975, 1975, 0, 0, 0, + 0, 1975, 1976, 0, 0, 0, 1976, 1976, 1976, 0, + 0, 0, 0, 1976, 1977, 0, 0, 0, 1977, 1977, + 1977, 0, 0, 0, 0, 1977, 1978, 0, 0, 0, + 1978, 1978, 1978, 0, 0, 0, 0, 1978, 1979, 0, + 0, 0, 1979, 1979, 1979, 0, 0, 0, 0, 1979, + + 1980, 0, 0, 0, 1980, 1980, 1980, 0, 0, 0, + 0, 1980, 1981, 0, 0, 0, 1981, 1981, 1981, 0, + 0, 0, 0, 1981, 1982, 0, 0, 0, 1982, 1982, + 1982, 0, 0, 0, 0, 1982, 1983, 0, 0, 0, + 1983, 1983, 1983, 0, 0, 0, 0, 1983, 1984, 0, + 0, 0, 1984, 1984, 1984, 0, 0, 0, 0, 1984, + 1985, 0, 0, 0, 1985, 1985, 1985, 0, 0, 0, + 0, 1985, 1986, 0, 0, 0, 1986, 1986, 1986, 0, + 0, 0, 0, 1986, 1987, 0, 0, 0, 1987, 1987, + 1987, 0, 0, 0, 0, 1987, 1988, 0, 0, 0, + + 1988, 1988, 1988, 0, 0, 0, 0, 1988, 1989, 0, + 0, 0, 1989, 1989, 1989, 0, 0, 0, 0, 1989, + 1990, 0, 0, 0, 1990, 1990, 1990, 0, 0, 0, + 0, 1990, 1991, 0, 0, 0, 1991, 1991, 1991, 0, + 0, 0, 0, 1991, 1992, 0, 0, 0, 1992, 1992, + 1992, 0, 0, 0, 0, 1992, 1993, 0, 0, 0, + 1993, 1993, 1993, 0, 0, 0, 0, 1993, 1994, 0, + 0, 0, 1994, 1994, 1994, 0, 0, 0, 0, 1994, + 1995, 0, 0, 0, 1995, 1995, 1995, 0, 0, 0, + 0, 1995, 1996, 0, 0, 0, 1996, 1996, 1996, 0, + + 0, 0, 0, 1996, 1997, 0, 0, 0, 1997, 1997, + 1997, 0, 0, 0, 0, 1997, 1998, 0, 0, 0, + 1998, 1998, 1998, 0, 0, 0, 0, 1998, 1999, 0, + 0, 0, 1999, 1999, 1999, 0, 0, 0, 0, 1999, + 2000, 0, 0, 0, 2000, 2000, 2000, 0, 0, 0, + 0, 2000, 2001, 0, 0, 0, 2001, 2001, 2001, 0, + 0, 0, 0, 2001, 2002, 0, 0, 0, 2002, 2002, + 2002, 0, 0, 0, 0, 2002, 2003, 0, 0, 0, + 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2004, 0, + 0, 0, 2004, 2004, 2004, 0, 0, 0, 0, 2004, + + 2005, 0, 0, 0, 2005, 2005, 2005, 0, 0, 0, + 0, 2005, 2006, 0, 0, 0, 2006, 2006, 2006, 0, + 0, 0, 0, 2006, 2007, 0, 0, 0, 2007, 2007, + 2007, 0, 0, 0, 0, 2007, 2008, 0, 0, 0, + 2008, 2008, 2008, 0, 0, 0, 0, 2008, 2009, 0, + 0, 0, 2009, 2009, 2009, 0, 0, 0, 0, 2009, + 2010, 0, 0, 0, 2010, 2010, 2010, 0, 0, 0, + 0, 2010, 2011, 0, 0, 0, 2011, 2011, 2011, 0, + 0, 0, 0, 2011, 2012, 0, 0, 0, 2012, 2012, + 2012, 0, 0, 0, 0, 2012, 2013, 0, 0, 0, + + 2013, 2013, 2013, 0, 0, 0, 0, 2013, 2014, 0, + 0, 0, 2014, 2014, 2014, 0, 0, 0, 0, 2014, + 2015, 0, 0, 0, 2015, 2015, 2015, 0, 0, 0, + 0, 2015, 2016, 0, 0, 0, 2016, 2016, 2016, 0, + 0, 0, 0, 2016, 2017, 0, 0, 0, 2017, 2017, + 2017, 0, 0, 0, 0, 2017, 2018, 0, 0, 0, + 2018, 2018, 2018, 0, 0, 0, 0, 2018, 2019, 0, + 0, 0, 2019, 2019, 2019, 0, 0, 0, 0, 2019, + 2020, 0, 0, 0, 2020, 2020, 2020, 0, 0, 0, + 0, 2020, 2021, 0, 0, 0, 2021, 2021, 2021, 0, + + 0, 0, 0, 2021, 2022, 0, 0, 0, 2022, 2022, + 2022, 0, 0, 0, 0, 2022, 2023, 0, 0, 0, + 2023, 2023, 2023, 0, 0, 0, 0, 2023, 2024, 0, + 0, 0, 2024, 2024, 2024, 0, 0, 0, 0, 2024, + 2025, 0, 0, 0, 2025, 2025, 2025, 0, 0, 0, + 0, 2025, 2026, 0, 0, 0, 2026, 2026, 2026, 0, + 0, 0, 0, 2026, 2027, 0, 0, 0, 2027, 2027, + 2027, 0, 0, 0, 0, 2027, 2028, 0, 0, 0, + 2028, 2028, 2028, 0, 0, 0, 0, 2028, 2029, 0, + 0, 0, 2029, 2029, 2029, 0, 0, 0, 0, 2029, + + 2030, 0, 0, 0, 2030, 2030, 2030, 0, 0, 0, + 0, 2030, 2031, 0, 0, 0, 2031, 2031, 2031, 0, + 0, 0, 0, 2031, 2032, 0, 0, 0, 2032, 2032, + 2032, 0, 0, 0, 0, 2032, 2033, 0, 0, 0, + 2033, 2033, 2033, 0, 0, 0, 0, 2033, 2034, 0, + 0, 0, 2034, 2034, 2034, 0, 0, 0, 0, 2034, + 2035, 0, 0, 0, 2035, 2035, 2035, 0, 0, 0, + 0, 2035, 2036, 0, 0, 0, 2036, 2036, 2036, 0, + 0, 0, 0, 2036, 2037, 0, 0, 0, 2037, 2037, + 2037, 0, 0, 0, 0, 2037, 2038, 0, 0, 0, + + 2038, 2038, 2038, 0, 0, 0, 0, 2038, 2039, 0, + 0, 0, 2039, 2039, 2039, 0, 0, 0, 0, 2039, + 2040, 0, 0, 0, 2040, 2040, 2040, 0, 0, 0, + 0, 2040, 2041, 0, 0, 0, 2041, 2041, 2041, 0, + 0, 0, 0, 2041, 2042, 0, 0, 0, 2042, 2042, + 2042, 0, 0, 0, 0, 2042, 2043, 0, 0, 0, + 2043, 2043, 2043, 0, 0, 0, 0, 2043, 2044, 0, + 0, 0, 2044, 2044, 2044, 0, 0, 0, 0, 2044, + 2045, 0, 0, 0, 2045, 2045, 2045, 0, 0, 0, + 0, 2045, 2046, 0, 0, 0, 2046, 2046, 2046, 0, + + 0, 0, 0, 2046, 2047, 0, 0, 0, 2047, 2047, + 2047, 0, 0, 0, 0, 2047, 2048, 0, 0, 0, + 2048, 2048, 2048, 0, 0, 0, 0, 2048, 2049, 0, + 0, 0, 2049, 2049, 2049, 0, 0, 0, 0, 2049, + 2050, 0, 0, 0, 2050, 2050, 2050, 0, 0, 0, + 0, 2050, 2051, 0, 0, 0, 2051, 2051, 2051, 0, + 0, 0, 0, 2051, 2052, 0, 0, 0, 2052, 2052, + 2052, 0, 0, 0, 0, 2052, 2053, 0, 0, 0, + 2053, 2053, 2053, 0, 0, 0, 0, 2053, 2054, 0, + 0, 0, 2054, 2054, 2054, 0, 0, 0, 0, 2054, + + 2055, 0, 0, 0, 2055, 2055, 2055, 0, 0, 0, + 0, 2055, 2056, 0, 0, 0, 2056, 2056, 2056, 0, + 0, 0, 0, 2056, 2057, 0, 0, 0, 2057, 2057, + 2057, 0, 0, 0, 0, 2057, 2058, 0, 0, 0, + 2058, 2058, 2058, 0, 0, 0, 0, 2058, 2059, 0, + 0, 0, 2059, 2059, 2059, 0, 0, 0, 0, 2059, + 2060, 0, 0, 0, 2060, 2060, 2060, 0, 0, 0, + 0, 2060, 2061, 0, 0, 0, 2061, 2061, 2061, 0, + 0, 0, 0, 2061, 2062, 0, 0, 0, 2062, 2062, + 2062, 0, 0, 0, 0, 2062, 2063, 0, 0, 0, + + 2063, 2063, 2063, 0, 0, 0, 0, 2063, 2064, 0, + 0, 0, 2064, 2064, 2064, 0, 0, 0, 0, 2064, + 2065, 0, 0, 0, 2065, 2065, 2065, 0, 0, 0, + 0, 2065, 2066, 0, 0, 0, 2066, 2066, 2066, 0, + 0, 0, 0, 2066, 2067, 0, 0, 0, 2067, 2067, + 2067, 0, 0, 0, 0, 2067, 2068, 0, 0, 0, + 2068, 2068, 2068, 0, 0, 0, 0, 2068, 2069, 0, + 0, 0, 2069, 2069, 2069, 0, 0, 0, 0, 2069, + 2070, 0, 0, 0, 2070, 2070, 2070, 0, 0, 0, + 0, 2070, 2071, 0, 0, 0, 2071, 2071, 2071, 0, + + 0, 0, 0, 2071, 2072, 0, 0, 0, 2072, 2072, + 2072, 0, 0, 0, 0, 2072, 2073, 0, 0, 0, + 2073, 2073, 2073, 0, 0, 0, 0, 2073, 2074, 0, + 0, 0, 2074, 2074, 2074, 0, 0, 0, 0, 2074, + 2075, 0, 0, 0, 2075, 2075, 2075, 0, 0, 0, + 0, 2075, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, + 2076, 0, 2076, 2076, 2076, 0, 2076, 2077, 2077, 2077, + 2077, 2077, 2077, 2077, 2077, 2077, 0, 2077, 2077, 2077, + 2077, 2077, 2078, 2078, 2078, 2078, 2078, 2078, 2078, 2078, + 2078, 0, 2078, 2078, 2078, 0, 2078, 2079, 2079, 2079, + + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 0, 2079, 2080, 2080, 2080, 2081, 2081, 2081, 2087, 0, + 0, 0, 2087, 2087, 2087, 0, 0, 0, 0, 2087, + 2088, 0, 0, 0, 2088, 2088, 2088, 0, 0, 0, + 0, 2088, 2089, 0, 0, 0, 2089, 2089, 2089, 0, + 0, 0, 0, 2089, 2090, 0, 0, 0, 2090, 2090, + 2090, 0, 0, 0, 0, 2090, 2091, 0, 0, 0, + 2091, 2091, 2091, 0, 0, 0, 0, 2091, 2092, 0, + 0, 0, 2092, 2092, 2092, 0, 0, 0, 0, 2092, + 2093, 0, 0, 0, 2093, 2093, 2093, 0, 0, 0, + + 0, 2093, 2094, 0, 0, 0, 2094, 2094, 2094, 0, + 0, 0, 0, 2094, 2095, 0, 0, 0, 2095, 2095, + 2095, 0, 0, 0, 0, 2095, 2096, 0, 0, 0, + 2096, 2096, 2096, 0, 0, 0, 0, 2096, 2097, 0, + 0, 0, 2097, 2097, 2097, 0, 0, 0, 0, 2097, + 2098, 0, 0, 0, 2098, 2098, 2098, 0, 0, 0, + 0, 2098, 2099, 0, 0, 0, 2099, 2099, 2099, 0, + 0, 0, 0, 2099, 2100, 0, 0, 0, 2100, 2100, + 2100, 0, 0, 0, 0, 2100, 2101, 0, 0, 0, + 2101, 2101, 2101, 0, 0, 0, 0, 2101, 2102, 0, + + 0, 0, 2102, 2102, 2102, 0, 0, 0, 0, 2102, + 2103, 0, 0, 0, 2103, 2103, 2103, 0, 0, 0, + 0, 2103, 2104, 0, 0, 0, 2104, 2104, 2104, 0, + 0, 0, 0, 2104, 2105, 0, 0, 0, 2105, 2105, + 2105, 0, 0, 0, 0, 2105, 2106, 0, 0, 0, + 2106, 2106, 2106, 0, 0, 0, 0, 2106, 2107, 0, + 0, 0, 2107, 2107, 2107, 0, 0, 0, 0, 2107, + 2108, 0, 0, 0, 2108, 2108, 2108, 0, 0, 0, + 0, 2108, 2109, 0, 0, 0, 2109, 2109, 2109, 0, + 0, 0, 0, 2109, 2110, 0, 0, 0, 2110, 2110, + + 2110, 0, 0, 0, 0, 2110, 2111, 0, 0, 0, + 2111, 2111, 2111, 0, 0, 0, 0, 2111, 2112, 0, + 0, 0, 2112, 2112, 2112, 0, 0, 0, 0, 2112, + 2113, 0, 0, 0, 2113, 2113, 2113, 0, 0, 0, + 0, 2113, 2114, 0, 0, 0, 2114, 2114, 2114, 0, + 0, 0, 0, 2114, 2115, 0, 0, 0, 2115, 2115, + 2115, 0, 0, 0, 0, 2115, 2116, 0, 0, 0, + 2116, 2116, 2116, 0, 0, 0, 0, 2116, 2117, 0, + 0, 0, 2117, 2117, 2117, 0, 0, 0, 0, 2117, + 2118, 0, 0, 0, 2118, 2118, 2118, 0, 0, 0, + + 0, 2118, 2119, 0, 0, 0, 2119, 2119, 2119, 0, + 0, 0, 0, 2119, 2120, 0, 0, 0, 2120, 2120, + 2120, 0, 0, 0, 0, 2120, 2121, 0, 0, 0, + 2121, 2121, 2121, 0, 0, 0, 0, 2121, 2122, 0, + 0, 0, 2122, 2122, 2122, 0, 0, 0, 0, 2122, + 2123, 0, 0, 0, 2123, 2123, 2123, 0, 0, 0, + 0, 2123, 2124, 0, 0, 0, 2124, 2124, 2124, 0, + 0, 0, 0, 2124, 2125, 0, 0, 0, 2125, 2125, + 2125, 0, 0, 0, 0, 2125, 2126, 0, 0, 0, + 2126, 2126, 2126, 0, 0, 0, 0, 2126, 2127, 0, + + 0, 0, 2127, 2127, 2127, 0, 0, 0, 0, 2127, + 2128, 0, 0, 0, 2128, 2128, 2128, 0, 0, 0, + 0, 2128, 2129, 0, 0, 0, 2129, 2129, 2129, 0, + 0, 0, 0, 2129, 2130, 0, 0, 0, 2130, 2130, + 2130, 0, 0, 0, 0, 2130, 2131, 0, 0, 0, + 2131, 2131, 2131, 0, 0, 0, 0, 2131, 2132, 0, + 0, 0, 2132, 2132, 2132, 0, 0, 0, 0, 2132, + 2133, 0, 0, 0, 2133, 2133, 2133, 0, 0, 0, + 0, 2133, 2134, 0, 0, 0, 2134, 2134, 2134, 0, + 0, 0, 0, 2134, 2135, 0, 0, 0, 2135, 2135, + + 2135, 0, 0, 0, 0, 2135, 2136, 0, 0, 0, + 2136, 2136, 2136, 0, 0, 0, 0, 2136, 2137, 0, + 0, 0, 2137, 2137, 2137, 0, 0, 0, 0, 2137, + 2138, 0, 0, 0, 2138, 2138, 2138, 0, 0, 0, + 0, 2138, 2139, 0, 0, 0, 2139, 2139, 2139, 0, + 0, 0, 0, 2139, 2140, 0, 0, 0, 2140, 2140, + 2140, 0, 0, 0, 0, 2140, 2141, 0, 0, 0, + 2141, 2141, 2141, 0, 0, 0, 0, 2141, 2142, 0, + 0, 0, 2142, 2142, 2142, 0, 0, 0, 0, 2142, + 2143, 0, 0, 0, 2143, 2143, 2143, 0, 0, 0, + + 0, 2143, 2144, 0, 0, 0, 2144, 2144, 2144, 0, + 0, 0, 0, 2144, 2145, 0, 0, 0, 2145, 2145, + 2145, 0, 0, 0, 0, 2145, 2146, 0, 0, 0, + 2146, 2146, 2146, 0, 0, 0, 0, 2146, 2147, 0, + 0, 0, 2147, 2147, 2147, 0, 0, 0, 0, 2147, + 2148, 0, 0, 0, 2148, 2148, 2148, 0, 0, 0, + 0, 2148, 2149, 0, 0, 0, 2149, 2149, 2149, 0, + 0, 0, 0, 2149, 2150, 0, 0, 0, 2150, 2150, + 2150, 0, 0, 0, 0, 2150, 2151, 0, 0, 0, + 2151, 2151, 2151, 0, 0, 0, 0, 2151, 2152, 0, + + 0, 0, 2152, 2152, 2152, 0, 0, 0, 0, 2152, + 2153, 0, 0, 0, 2153, 2153, 2153, 0, 0, 0, + 0, 2153, 2154, 0, 0, 0, 2154, 2154, 2154, 0, + 0, 0, 0, 2154, 2155, 0, 0, 0, 2155, 2155, + 2155, 0, 0, 0, 0, 2155, 2156, 0, 0, 0, + 2156, 2156, 2156, 0, 0, 0, 0, 2156, 2157, 0, + 0, 0, 2157, 2157, 2157, 0, 0, 0, 0, 2157, + 2158, 0, 0, 0, 2158, 2158, 2158, 0, 0, 0, + 0, 2158, 2159, 0, 0, 0, 2159, 2159, 2159, 0, + 0, 0, 0, 2159, 2160, 0, 0, 0, 2160, 2160, + + 2160, 0, 0, 0, 0, 2160, 2161, 0, 0, 0, + 2161, 2161, 2161, 0, 0, 0, 0, 2161, 2162, 0, + 0, 0, 2162, 2162, 2162, 0, 0, 0, 0, 2162, + 2163, 0, 0, 0, 2163, 2163, 2163, 0, 0, 0, + 0, 2163, 2164, 0, 0, 0, 2164, 2164, 2164, 0, + 0, 0, 0, 2164, 2165, 0, 0, 0, 2165, 2165, + 2165, 0, 0, 0, 0, 2165, 2166, 0, 0, 0, + 2166, 2166, 2166, 0, 0, 0, 0, 2166, 2167, 0, + 0, 0, 2167, 2167, 2167, 0, 0, 0, 0, 2167, + 2168, 0, 0, 0, 2168, 2168, 2168, 0, 0, 0, + + 0, 2168, 2169, 0, 0, 0, 2169, 2169, 2169, 0, + 0, 0, 0, 2169, 2170, 0, 0, 0, 2170, 2170, + 2170, 0, 0, 0, 0, 2170, 2171, 0, 0, 0, + 2171, 2171, 2171, 0, 0, 0, 0, 2171, 2172, 0, + 0, 0, 2172, 2172, 2172, 0, 0, 0, 0, 2172, + 2173, 0, 0, 0, 2173, 2173, 2173, 0, 0, 0, + 0, 2173, 2174, 0, 0, 0, 2174, 2174, 2174, 0, + 0, 0, 0, 2174, 2175, 0, 0, 0, 2175, 2175, + 2175, 0, 0, 0, 0, 2175, 2176, 0, 0, 0, + 2176, 2176, 2176, 0, 0, 0, 0, 2176, 2177, 0, + + 0, 0, 2177, 2177, 2177, 0, 0, 0, 0, 2177, + 2178, 0, 0, 0, 2178, 2178, 2178, 0, 0, 0, + 0, 2178, 2179, 0, 0, 0, 2179, 2179, 2179, 0, + 0, 0, 0, 2179, 2180, 0, 0, 0, 2180, 2180, + 2180, 0, 0, 0, 0, 2180, 2181, 0, 0, 0, + 2181, 2181, 2181, 0, 0, 0, 0, 2181, 2182, 0, + 0, 0, 2182, 2182, 2182, 0, 0, 0, 0, 2182, + 2183, 0, 0, 0, 2183, 2183, 2183, 0, 0, 0, + 0, 2183, 2184, 0, 0, 0, 2184, 2184, 2184, 0, + 0, 0, 0, 2184, 2185, 0, 0, 0, 2185, 2185, + + 2185, 0, 0, 0, 0, 2185, 2186, 0, 0, 0, + 2186, 2186, 2186, 0, 0, 0, 0, 2186, 2187, 0, + 0, 0, 2187, 2187, 2187, 0, 0, 0, 0, 2187, + 2188, 0, 0, 0, 2188, 2188, 2188, 0, 0, 0, + 0, 2188, 2189, 0, 0, 0, 2189, 2189, 2189, 0, + 0, 0, 0, 2189, 2190, 0, 0, 0, 2190, 2190, + 2190, 0, 0, 0, 0, 2190, 2191, 0, 0, 0, + 2191, 2191, 2191, 0, 0, 0, 0, 2191, 2192, 0, + 0, 0, 2192, 2192, 2192, 0, 0, 0, 0, 2192, + 2193, 0, 0, 0, 2193, 2193, 2193, 0, 0, 0, + + 0, 2193, 2194, 0, 0, 0, 2194, 2194, 2194, 0, + 0, 0, 0, 2194, 2195, 0, 0, 0, 2195, 2195, + 2195, 0, 0, 0, 0, 2195, 2196, 0, 0, 0, + 2196, 2196, 2196, 0, 0, 0, 0, 2196, 2197, 0, + 0, 0, 2197, 2197, 2197, 0, 0, 0, 0, 2197, + 2198, 0, 0, 0, 2198, 2198, 2198, 0, 0, 0, + 0, 2198, 2199, 0, 0, 0, 2199, 2199, 2199, 0, + 0, 0, 0, 2199, 2200, 0, 0, 0, 2200, 2200, + 2200, 0, 0, 0, 0, 2200, 2201, 0, 0, 0, + 2201, 2201, 2201, 0, 0, 0, 0, 2201, 2202, 0, + + 0, 0, 2202, 2202, 2202, 0, 0, 0, 0, 2202, + 2203, 0, 0, 0, 2203, 2203, 2203, 0, 0, 0, + 0, 2203, 2204, 0, 0, 0, 2204, 2204, 2204, 0, + 0, 0, 0, 2204, 2205, 0, 0, 0, 2205, 2205, + 2205, 0, 0, 0, 0, 2205, 2206, 0, 0, 0, + 2206, 2206, 2206, 0, 0, 0, 0, 2206, 2207, 0, + 0, 0, 2207, 2207, 2207, 0, 0, 0, 0, 2207, + 2208, 0, 0, 0, 2208, 2208, 2208, 0, 0, 0, + 0, 2208, 2209, 0, 0, 0, 2209, 2209, 2209, 0, + 0, 0, 0, 2209, 2210, 0, 0, 0, 2210, 2210, + + 2210, 0, 0, 0, 0, 2210, 2211, 0, 0, 0, + 2211, 2211, 2211, 0, 0, 0, 0, 2211, 2212, 0, + 0, 0, 2212, 2212, 2212, 0, 0, 0, 0, 2212, + 2213, 0, 0, 0, 2213, 2213, 2213, 0, 0, 0, + 0, 2213, 2214, 0, 0, 0, 2214, 2214, 2214, 0, + 0, 0, 0, 2214, 2215, 0, 0, 0, 2215, 2215, + 2215, 0, 0, 0, 0, 2215, 2216, 0, 0, 0, + 2216, 2216, 2216, 0, 0, 0, 0, 2216, 2217, 0, + 0, 0, 2217, 2217, 2217, 0, 0, 0, 0, 2217, + 2218, 0, 0, 0, 2218, 2218, 2218, 0, 0, 0, + + 0, 2218, 2219, 2219, 2219, 2219, 2219, 2219, 2219, 2219, + 2219, 0, 2219, 2219, 2219, 0, 2219, 2220, 0, 0, + 0, 2220, 2220, 2220, 0, 0, 0, 0, 2220, 2221, + 2221, 2221, 2222, 2222, 2222, 2224, 2224, 2224, 0, 0, + 0, 0, 2224, 2225, 2225, 2225, 2226, 2226, 2226, 2227, + 0, 0, 0, 2227, 2227, 2227, 0, 0, 0, 0, + 2227, 2228, 0, 0, 0, 2228, 2228, 2228, 0, 0, + 0, 0, 2228, 2229, 0, 0, 0, 2229, 2229, 2229, + 0, 0, 0, 0, 2229, 2230, 0, 0, 0, 2230, + 2230, 2230, 0, 0, 0, 0, 2230, 2231, 0, 0, + + 0, 2231, 2231, 2231, 0, 0, 0, 0, 2231, 2232, + 0, 0, 0, 2232, 2232, 2232, 0, 0, 0, 0, + 2232, 2233, 0, 0, 0, 2233, 2233, 2233, 0, 0, + 0, 0, 2233, 2234, 0, 0, 0, 2234, 2234, 2234, + 0, 0, 0, 0, 2234, 2235, 0, 0, 0, 2235, + 2235, 2235, 0, 0, 0, 0, 2235, 2236, 0, 0, + 0, 2236, 2236, 2236, 0, 0, 0, 0, 2236, 2237, + 0, 0, 0, 2237, 2237, 2237, 0, 0, 0, 0, + 2237, 2238, 0, 0, 0, 2238, 2238, 2238, 0, 0, + 0, 0, 2238, 2239, 0, 0, 0, 2239, 2239, 2239, + + 0, 0, 0, 0, 2239, 2240, 0, 0, 0, 2240, + 2240, 2240, 0, 0, 0, 0, 2240, 2241, 0, 0, + 0, 2241, 2241, 2241, 0, 0, 0, 0, 2241, 2242, + 0, 0, 0, 2242, 2242, 2242, 0, 0, 0, 0, + 2242, 2243, 0, 0, 0, 2243, 2243, 2243, 0, 0, + 0, 0, 2243, 2244, 0, 0, 0, 2244, 2244, 2244, + 0, 0, 0, 0, 2244, 2245, 0, 0, 0, 2245, + 2245, 2245, 0, 0, 0, 0, 2245, 2246, 0, 0, + 0, 2246, 2246, 2246, 0, 0, 0, 0, 2246, 2247, + 0, 0, 0, 2247, 2247, 2247, 0, 0, 0, 0, + + 2247, 2248, 0, 0, 0, 2248, 2248, 2248, 0, 0, + 0, 0, 2248, 2249, 0, 0, 0, 2249, 2249, 2249, + 0, 0, 0, 0, 2249, 2250, 0, 0, 0, 2250, + 2250, 2250, 0, 0, 0, 0, 2250, 2251, 0, 0, + 0, 2251, 2251, 2251, 0, 0, 0, 0, 2251, 2252, + 0, 0, 0, 2252, 2252, 2252, 0, 0, 0, 0, + 2252, 2253, 0, 0, 0, 2253, 2253, 2253, 0, 0, + 0, 0, 2253, 2254, 0, 0, 0, 2254, 2254, 2254, + 0, 0, 0, 0, 2254, 2255, 0, 0, 0, 2255, + 2255, 2255, 0, 0, 0, 0, 2255, 2256, 0, 0, + + 0, 2256, 2256, 2256, 0, 0, 0, 0, 2256, 2257, + 0, 0, 0, 2257, 2257, 2257, 0, 0, 0, 0, + 2257, 2258, 0, 0, 0, 2258, 2258, 2258, 0, 0, + 0, 0, 2258, 2259, 0, 0, 0, 2259, 2259, 2259, + 0, 0, 0, 0, 2259, 2260, 0, 0, 0, 2260, + 2260, 2260, 0, 0, 0, 0, 2260, 2261, 0, 0, + 0, 2261, 2261, 2261, 0, 0, 0, 0, 2261, 2262, + 0, 0, 0, 2262, 2262, 2262, 0, 0, 0, 0, + 2262, 2263, 0, 0, 0, 2263, 2263, 2263, 0, 0, + 0, 0, 2263, 2264, 0, 0, 0, 2264, 2264, 2264, + + 0, 0, 0, 0, 2264, 2265, 0, 0, 0, 2265, + 2265, 2265, 0, 0, 0, 0, 2265, 2266, 0, 0, + 0, 2266, 2266, 2266, 0, 0, 0, 0, 2266, 2267, + 0, 0, 0, 2267, 2267, 2267, 0, 0, 0, 0, + 2267, 2268, 0, 0, 0, 2268, 2268, 2268, 0, 0, + 0, 0, 2268, 2269, 0, 0, 0, 2269, 2269, 2269, + 0, 0, 0, 0, 2269, 2270, 0, 0, 0, 2270, + 2270, 2270, 0, 0, 0, 0, 2270, 2271, 0, 0, + 0, 2271, 2271, 2271, 0, 0, 0, 0, 2271, 2272, + 0, 0, 0, 2272, 2272, 2272, 0, 0, 0, 0, + + 2272, 2273, 0, 0, 0, 2273, 2273, 2273, 0, 0, + 0, 0, 2273, 2274, 0, 0, 0, 2274, 2274, 2274, + 0, 0, 0, 0, 2274, 2275, 0, 0, 0, 2275, + 2275, 2275, 0, 0, 0, 0, 2275, 2276, 0, 0, + 0, 2276, 2276, 2276, 0, 0, 0, 0, 2276, 2277, + 0, 0, 0, 2277, 2277, 2277, 0, 0, 0, 0, + 2277, 2278, 0, 0, 0, 2278, 2278, 2278, 0, 0, + 0, 0, 2278, 2279, 0, 0, 0, 2279, 2279, 2279, + 0, 0, 0, 0, 2279, 2280, 0, 0, 0, 2280, + 2280, 2280, 0, 0, 0, 0, 2280, 2281, 0, 0, + + 0, 2281, 2281, 2281, 0, 0, 0, 0, 2281, 2282, + 0, 0, 0, 2282, 2282, 2282, 0, 0, 0, 0, + 2282, 2283, 0, 0, 0, 2283, 2283, 2283, 0, 0, + 0, 0, 2283, 2284, 0, 0, 0, 2284, 2284, 2284, + 0, 0, 0, 0, 2284, 2285, 0, 0, 0, 2285, + 2285, 2285, 0, 0, 0, 0, 2285, 2286, 0, 0, + 0, 2286, 2286, 2286, 0, 0, 0, 0, 2286, 2287, + 0, 0, 0, 2287, 2287, 2287, 0, 0, 0, 0, + 2287, 2288, 0, 0, 0, 2288, 2288, 2288, 0, 0, + 0, 0, 2288, 2289, 0, 0, 0, 2289, 2289, 2289, + + 0, 0, 0, 0, 2289, 2290, 0, 0, 0, 2290, + 2290, 2290, 0, 0, 0, 0, 2290, 2291, 0, 0, + 0, 2291, 2291, 2291, 0, 0, 0, 0, 2291, 2292, + 0, 0, 0, 2292, 2292, 2292, 0, 0, 0, 0, + 2292, 2293, 0, 0, 0, 2293, 2293, 2293, 0, 0, + 0, 0, 2293, 2294, 0, 0, 0, 2294, 2294, 2294, + 0, 0, 0, 0, 2294, 2295, 0, 0, 0, 2295, + 2295, 2295, 0, 0, 0, 0, 2295, 2296, 0, 0, + 0, 2296, 2296, 2296, 0, 0, 0, 0, 2296, 2297, + 0, 0, 0, 2297, 2297, 2297, 0, 0, 0, 0, + + 2297, 2298, 0, 0, 0, 2298, 2298, 2298, 0, 0, + 0, 0, 2298, 2299, 0, 0, 0, 2299, 2299, 2299, + 0, 0, 0, 0, 2299, 2300, 0, 0, 0, 2300, + 2300, 2300, 0, 0, 0, 0, 2300, 2301, 0, 0, + 0, 2301, 2301, 2301, 0, 0, 0, 0, 2301, 2302, + 0, 0, 0, 2302, 2302, 2302, 0, 0, 0, 0, + 2302, 2303, 0, 0, 0, 2303, 2303, 2303, 0, 0, + 0, 0, 2303, 2304, 0, 0, 0, 2304, 2304, 2304, + 0, 0, 0, 0, 2304, 2305, 0, 0, 0, 2305, + 2305, 2305, 0, 0, 0, 0, 2305, 2306, 0, 0, + + 0, 2306, 2306, 2306, 0, 0, 0, 0, 2306, 2307, + 0, 0, 0, 2307, 2307, 2307, 0, 0, 0, 0, + 2307, 2308, 0, 0, 0, 2308, 2308, 2308, 0, 0, + 0, 0, 2308, 2309, 0, 0, 0, 2309, 2309, 2309, + 0, 0, 0, 0, 2309, 2310, 0, 0, 0, 2310, + 2310, 2310, 0, 0, 0, 0, 2310, 2311, 0, 0, + 0, 2311, 2311, 2311, 0, 0, 0, 0, 2311, 2312, + 0, 0, 0, 2312, 2312, 2312, 0, 0, 0, 0, + 2312, 2313, 0, 0, 0, 2313, 2313, 2313, 0, 0, + 0, 0, 2313, 2314, 0, 0, 0, 2314, 2314, 2314, + + 0, 0, 0, 0, 2314, 2315, 0, 0, 0, 2315, + 2315, 2315, 0, 0, 0, 0, 2315, 2316, 0, 0, + 0, 2316, 2316, 2316, 0, 0, 0, 0, 2316, 2317, + 0, 0, 0, 2317, 2317, 2317, 0, 0, 0, 0, + 2317, 2318, 0, 0, 0, 2318, 2318, 2318, 0, 0, + 0, 0, 2318, 2319, 0, 0, 0, 2319, 2319, 2319, + 0, 0, 0, 0, 2319, 2320, 0, 0, 0, 2320, + 2320, 2320, 0, 0, 0, 0, 2320, 2321, 0, 0, + 0, 2321, 2321, 2321, 0, 0, 0, 0, 2321, 2322, + 0, 0, 0, 2322, 2322, 2322, 0, 0, 0, 0, + + 2322, 2323, 0, 0, 0, 2323, 2323, 2323, 0, 0, + 0, 0, 2323, 2324, 0, 0, 0, 2324, 2324, 2324, + 0, 0, 0, 0, 2324, 2325, 0, 0, 0, 2325, + 2325, 2325, 0, 0, 0, 0, 2325, 2326, 0, 0, + 0, 2326, 2326, 2326, 0, 0, 0, 0, 2326, 2327, + 0, 0, 0, 2327, 2327, 2327, 0, 0, 0, 0, + 2327, 2328, 0, 0, 0, 2328, 2328, 2328, 0, 0, + 0, 0, 2328, 2329, 0, 0, 0, 2329, 2329, 2329, + 0, 0, 0, 0, 2329, 2330, 0, 0, 0, 2330, + 2330, 2330, 0, 0, 0, 0, 2330, 2331, 0, 0, + + 0, 2331, 2331, 2331, 0, 0, 0, 0, 2331, 2332, + 0, 0, 0, 2332, 2332, 2332, 0, 0, 0, 0, + 2332, 2333, 0, 0, 0, 2333, 2333, 2333, 0, 0, + 0, 0, 2333, 2334, 0, 0, 0, 2334, 2334, 2334, + 0, 0, 0, 0, 2334, 2335, 0, 0, 0, 2335, + 2335, 2335, 0, 0, 0, 0, 2335, 2336, 0, 0, + 0, 2336, 2336, 2336, 0, 0, 0, 0, 2336, 2337, + 0, 0, 0, 2337, 2337, 2337, 0, 0, 0, 0, + 2337, 2338, 0, 0, 0, 2338, 2338, 2338, 0, 0, + 0, 0, 2338, 2339, 0, 0, 0, 2339, 2339, 2339, + + 0, 0, 0, 0, 2339, 2340, 0, 0, 0, 2340, + 2340, 2340, 0, 0, 0, 0, 2340, 2341, 0, 0, + 0, 2341, 2341, 2341, 0, 0, 0, 0, 2341, 2342, + 0, 0, 0, 2342, 2342, 2342, 0, 0, 0, 0, + 2342, 2343, 0, 0, 0, 2343, 2343, 2343, 0, 0, + 0, 0, 2343, 2344, 0, 0, 0, 2344, 2344, 2344, + 0, 0, 0, 0, 2344, 2345, 0, 0, 0, 2345, + 2345, 2345, 0, 0, 0, 0, 2345, 2346, 0, 0, + 0, 2346, 2346, 2346, 0, 0, 0, 0, 2346, 2347, + 0, 0, 0, 2347, 2347, 2347, 0, 0, 0, 0, + + 2347, 2348, 0, 0, 0, 2348, 2348, 2348, 0, 0, + 0, 0, 2348, 2349, 0, 0, 0, 2349, 2349, 2349, + 0, 0, 0, 0, 2349, 2350, 0, 0, 0, 2350, + 2350, 2350, 0, 0, 0, 0, 2350, 2351, 0, 0, + 0, 2351, 2351, 2351, 0, 0, 0, 0, 2351, 2352, + 0, 0, 0, 2352, 2352, 2352, 0, 0, 0, 0, + 2352, 2353, 0, 0, 0, 2353, 2353, 2353, 0, 0, + 0, 0, 2353, 2354, 0, 0, 0, 2354, 2354, 2354, + 0, 0, 0, 0, 2354, 2355, 0, 0, 0, 2355, + 2355, 2355, 0, 0, 0, 0, 2355, 2356, 0, 0, + + 0, 2356, 2356, 2356, 0, 0, 0, 0, 2356, 2357, + 0, 0, 0, 2357, 2357, 2357, 0, 0, 0, 0, + 2357, 2358, 0, 0, 0, 2358, 2358, 2358, 0, 0, + 0, 0, 2358, 2359, 0, 0, 0, 2359, 2359, 2359, + 0, 0, 0, 0, 2359, 2360, 0, 0, 0, 2360, + 2360, 2360, 0, 0, 0, 0, 2360, 2361, 0, 0, + 0, 2361, 2361, 2361, 0, 0, 0, 0, 2361, 2362, + 0, 0, 0, 2362, 2362, 2362, 0, 0, 0, 0, + 2362, 2363, 0, 0, 0, 2363, 2363, 2363, 0, 0, + 0, 0, 2363, 2364, 0, 0, 0, 2364, 2364, 2364, + + 0, 0, 0, 0, 2364, 2365, 0, 0, 0, 2365, + 2365, 2365, 0, 0, 0, 0, 2365, 2366, 0, 0, + 0, 2366, 2366, 2366, 0, 0, 0, 0, 2366, 2367, + 0, 0, 0, 2367, 2367, 2367, 0, 0, 0, 0, + 2367, 2368, 0, 0, 0, 2368, 2368, 2368, 0, 0, + 0, 0, 2368, 2369, 0, 0, 0, 2369, 2369, 2369, + 0, 0, 0, 0, 2369, 2370, 0, 0, 0, 2370, + 2370, 2370, 0, 0, 0, 0, 2370, 2371, 0, 0, + 0, 2371, 2371, 2371, 0, 0, 0, 0, 2371, 2372, + 0, 0, 0, 2372, 2372, 2372, 0, 0, 0, 0, + + 2372, 2373, 0, 0, 0, 2373, 2373, 2373, 0, 0, + 0, 0, 2373, 2374, 0, 0, 0, 2374, 2374, 2374, + 0, 0, 0, 0, 2374, 2375, 0, 0, 0, 2375, + 2375, 2375, 0, 0, 0, 0, 2375, 2376, 0, 0, + 0, 2376, 2376, 2376, 0, 0, 0, 0, 2376, 2377, + 0, 0, 0, 2377, 2377, 2377, 0, 0, 0, 0, + 2377, 2378, 0, 0, 0, 2378, 2378, 2378, 0, 0, + 0, 0, 2378, 2379, 0, 0, 0, 2379, 2379, 2379, + 0, 0, 0, 0, 2379, 2380, 0, 0, 0, 2380, + 2380, 2380, 0, 0, 0, 0, 2380, 2381, 0, 0, + + 0, 2381, 2381, 2381, 0, 0, 0, 0, 2381, 2382, + 0, 0, 0, 2382, 2382, 2382, 0, 0, 0, 0, + 2382, 2383, 0, 0, 0, 2383, 2383, 2383, 0, 0, + 0, 0, 2383, 2384, 2384, 2384, 2385, 0, 0, 0, + 2385, 2385, 2385, 0, 0, 0, 0, 2385, 2386, 2386, + 2386, 2388, 0, 2388, 0, 2388, 2388, 0, 0, 0, + 0, 0, 2388, 2389, 0, 2389, 0, 2389, 2389, 0, + 0, 0, 0, 0, 2389, 2390, 2390, 2390, 2391, 2391, + 2391, 2392, 0, 0, 0, 2392, 2392, 2392, 0, 0, + 0, 0, 2392, 2393, 0, 0, 0, 2393, 2393, 2393, + + 0, 0, 0, 0, 2393, 2394, 0, 0, 0, 2394, + 2394, 2394, 0, 0, 0, 0, 2394, 2395, 0, 0, + 0, 2395, 2395, 2395, 0, 0, 0, 0, 2395, 2396, + 0, 0, 0, 2396, 2396, 2396, 0, 0, 0, 0, + 2396, 2397, 0, 0, 0, 2397, 2397, 2397, 0, 0, + 0, 0, 2397, 2398, 0, 0, 0, 2398, 2398, 2398, + 0, 0, 0, 0, 2398, 2399, 0, 0, 0, 2399, + 2399, 2399, 0, 0, 0, 0, 2399, 2400, 0, 0, + 0, 2400, 2400, 2400, 0, 0, 0, 0, 2400, 2401, + 0, 0, 0, 2401, 2401, 2401, 0, 0, 0, 0, + + 2401, 2402, 0, 0, 0, 2402, 2402, 2402, 0, 0, + 0, 0, 2402, 2403, 0, 0, 0, 2403, 2403, 2403, + 0, 0, 0, 0, 2403, 2404, 0, 0, 0, 2404, + 2404, 2404, 0, 0, 0, 0, 2404, 2405, 0, 0, + 0, 2405, 2405, 2405, 0, 0, 0, 0, 2405, 2406, + 0, 0, 0, 2406, 2406, 2406, 0, 0, 0, 0, + 2406, 2407, 0, 0, 0, 2407, 2407, 2407, 0, 0, + 0, 0, 2407, 2408, 0, 0, 0, 2408, 2408, 2408, + 0, 0, 0, 0, 2408, 2409, 0, 0, 0, 2409, + 2409, 2409, 0, 0, 0, 0, 2409, 2410, 0, 0, + + 0, 2410, 2410, 2410, 0, 0, 0, 0, 2410, 2411, + 0, 0, 0, 2411, 2411, 2411, 0, 0, 0, 0, + 2411, 2412, 0, 0, 0, 2412, 2412, 2412, 0, 0, + 0, 0, 2412, 2413, 0, 0, 0, 2413, 2413, 2413, + 0, 0, 0, 0, 2413, 2414, 0, 0, 0, 2414, + 2414, 2414, 0, 0, 0, 0, 2414, 2415, 0, 0, + 0, 2415, 2415, 2415, 0, 0, 0, 0, 2415, 2416, + 0, 0, 0, 2416, 2416, 2416, 0, 0, 0, 0, + 2416, 2417, 0, 0, 0, 2417, 2417, 2417, 0, 0, + 0, 0, 2417, 2418, 0, 0, 0, 2418, 2418, 2418, + + 0, 0, 0, 0, 2418, 2419, 0, 0, 0, 2419, + 2419, 2419, 0, 0, 0, 0, 2419, 2420, 0, 0, + 0, 2420, 2420, 2420, 0, 0, 0, 0, 2420, 2421, + 0, 0, 0, 2421, 2421, 2421, 0, 0, 0, 0, + 2421, 2422, 0, 0, 0, 2422, 2422, 2422, 0, 0, + 0, 0, 2422, 2423, 0, 0, 0, 2423, 2423, 2423, + 0, 0, 0, 0, 2423, 2424, 0, 0, 0, 2424, + 2424, 2424, 0, 0, 0, 0, 2424, 2425, 0, 0, + 0, 2425, 2425, 2425, 0, 0, 0, 0, 2425, 2426, + 0, 0, 0, 2426, 2426, 2426, 0, 0, 0, 0, + + 2426, 2427, 0, 0, 0, 2427, 2427, 2427, 0, 0, + 0, 0, 2427, 2428, 0, 0, 0, 2428, 2428, 2428, + 0, 0, 0, 0, 2428, 2429, 0, 0, 0, 2429, + 2429, 2429, 0, 0, 0, 0, 2429, 2430, 0, 0, + 0, 2430, 2430, 2430, 0, 0, 0, 0, 2430, 2431, + 0, 0, 0, 2431, 2431, 2431, 0, 0, 0, 0, + 2431, 2432, 0, 0, 0, 2432, 2432, 2432, 0, 0, + 0, 0, 2432, 2433, 0, 0, 0, 2433, 2433, 2433, + 0, 0, 0, 0, 2433, 2434, 0, 0, 0, 2434, + 2434, 2434, 0, 0, 0, 0, 2434, 2435, 0, 0, + + 0, 2435, 2435, 2435, 0, 0, 0, 0, 2435, 2436, + 0, 0, 0, 2436, 2436, 2436, 0, 0, 0, 0, + 2436, 2437, 0, 0, 0, 2437, 2437, 2437, 0, 0, + 0, 0, 2437, 2438, 0, 0, 0, 2438, 2438, 2438, + 0, 0, 0, 0, 2438, 2439, 0, 0, 0, 2439, + 2439, 2439, 0, 0, 0, 0, 2439, 2440, 0, 0, + 0, 2440, 2440, 2440, 0, 0, 0, 0, 2440, 2441, + 0, 0, 0, 2441, 2441, 2441, 0, 0, 0, 0, + 2441, 2442, 0, 0, 0, 2442, 2442, 2442, 0, 0, + 0, 0, 2442, 2443, 0, 0, 0, 2443, 2443, 2443, + + 0, 0, 0, 0, 2443, 2444, 0, 0, 0, 2444, + 2444, 2444, 0, 0, 0, 0, 2444, 2445, 0, 0, + 0, 2445, 2445, 2445, 0, 0, 0, 0, 2445, 2446, + 0, 0, 0, 2446, 2446, 2446, 0, 0, 0, 0, + 2446, 2447, 0, 0, 0, 2447, 2447, 2447, 0, 0, + 0, 0, 2447, 2448, 0, 0, 0, 2448, 2448, 2448, + 0, 0, 0, 0, 2448, 2449, 0, 0, 0, 2449, + 2449, 2449, 0, 0, 0, 0, 2449, 2450, 0, 0, + 0, 2450, 2450, 2450, 0, 0, 0, 0, 2450, 2451, + 0, 0, 0, 2451, 2451, 2451, 0, 0, 0, 0, + + 2451, 2452, 0, 0, 0, 2452, 2452, 2452, 0, 0, + 0, 0, 2452, 2453, 0, 0, 0, 2453, 2453, 2453, + 0, 0, 0, 0, 2453, 2454, 0, 0, 0, 2454, + 2454, 2454, 0, 0, 0, 0, 2454, 2455, 0, 0, + 0, 2455, 2455, 2455, 0, 0, 0, 0, 2455, 2456, + 0, 0, 0, 2456, 2456, 2456, 0, 0, 0, 0, + 2456, 2457, 0, 0, 0, 2457, 2457, 2457, 0, 0, + 0, 0, 2457, 2458, 0, 0, 0, 2458, 2458, 2458, + 0, 0, 0, 0, 2458, 2459, 0, 0, 0, 2459, + 2459, 2459, 0, 0, 0, 0, 2459, 2460, 0, 0, + + 0, 2460, 2460, 2460, 0, 0, 0, 0, 2460, 2461, + 0, 0, 0, 2461, 2461, 2461, 0, 0, 0, 0, + 2461, 2462, 0, 0, 0, 2462, 2462, 2462, 0, 0, + 0, 0, 2462, 2463, 0, 0, 0, 2463, 2463, 2463, + 0, 0, 0, 0, 2463, 2464, 0, 0, 0, 2464, + 2464, 2464, 0, 0, 0, 0, 2464, 2465, 0, 0, + 0, 2465, 2465, 2465, 0, 0, 0, 0, 2465, 2466, + 0, 0, 0, 2466, 2466, 2466, 0, 0, 0, 0, + 2466, 2467, 0, 0, 0, 2467, 2467, 2467, 0, 0, + 0, 0, 2467, 2468, 0, 0, 0, 2468, 2468, 2468, + + 0, 0, 0, 0, 2468, 2469, 0, 0, 0, 2469, + 2469, 2469, 0, 0, 0, 0, 2469, 2470, 0, 0, + 0, 2470, 2470, 2470, 0, 0, 0, 0, 2470, 2471, + 0, 0, 0, 2471, 2471, 2471, 0, 0, 0, 0, + 2471, 2472, 0, 0, 0, 2472, 2472, 2472, 0, 0, + 0, 0, 2472, 2473, 0, 0, 0, 2473, 2473, 2473, + 0, 0, 0, 0, 2473, 2474, 0, 0, 0, 2474, + 2474, 2474, 0, 0, 0, 0, 2474, 2475, 0, 0, + 0, 2475, 2475, 2475, 0, 0, 0, 0, 2475, 2476, + 0, 0, 0, 2476, 2476, 2476, 0, 0, 0, 0, + + 2476, 2477, 0, 0, 0, 2477, 2477, 2477, 0, 0, + 0, 0, 2477, 2478, 0, 0, 0, 2478, 2478, 2478, + 0, 0, 0, 0, 2478, 2479, 0, 0, 0, 2479, + 2479, 2479, 0, 0, 0, 0, 2479, 2480, 0, 0, + 0, 2480, 2480, 2480, 0, 0, 0, 0, 2480, 2481, + 0, 0, 0, 2481, 2481, 2481, 0, 0, 0, 0, + 2481, 2482, 0, 0, 0, 2482, 2482, 2482, 0, 0, + 0, 0, 2482, 2483, 0, 0, 0, 2483, 2483, 2483, + 0, 0, 0, 0, 2483, 2484, 0, 0, 0, 2484, + 2484, 2484, 0, 0, 0, 0, 2484, 2485, 0, 0, + + 0, 2485, 2485, 2485, 0, 0, 0, 0, 2485, 2486, + 0, 0, 0, 2486, 2486, 2486, 0, 0, 0, 0, + 2486, 2487, 0, 0, 0, 2487, 2487, 2487, 0, 0, + 0, 0, 2487, 2488, 0, 0, 0, 2488, 2488, 2488, + 0, 0, 0, 0, 2488, 2489, 0, 0, 0, 2489, + 2489, 2489, 0, 0, 0, 0, 2489, 2490, 0, 0, + 0, 2490, 2490, 2490, 0, 0, 0, 0, 2490, 2491, + 0, 0, 0, 2491, 2491, 2491, 0, 0, 0, 0, + 2491, 2492, 0, 0, 0, 2492, 2492, 2492, 0, 0, + 0, 0, 2492, 2493, 0, 0, 0, 2493, 2493, 2493, + + 0, 0, 0, 0, 2493, 2494, 0, 0, 0, 2494, + 2494, 2494, 0, 0, 0, 0, 2494, 2495, 0, 0, + 0, 2495, 2495, 2495, 0, 0, 0, 0, 2495, 2496, + 0, 0, 0, 2496, 2496, 2496, 0, 0, 0, 0, + 2496, 2497, 0, 0, 0, 2497, 2497, 2497, 0, 0, + 0, 0, 2497, 2498, 0, 0, 0, 2498, 2498, 2498, + 0, 0, 0, 0, 2498, 2499, 0, 0, 0, 2499, + 2499, 2499, 0, 0, 0, 0, 2499, 2500, 0, 0, + 0, 2500, 2500, 2500, 0, 0, 0, 0, 2500, 2501, + 0, 0, 0, 2501, 2501, 2501, 0, 0, 0, 0, + + 2501, 2502, 0, 0, 0, 2502, 2502, 2502, 0, 0, + 0, 0, 2502, 2503, 0, 0, 0, 2503, 2503, 2503, + 0, 0, 0, 0, 2503, 2504, 0, 0, 0, 2504, + 2504, 2504, 0, 0, 0, 0, 2504, 2505, 0, 0, + 0, 2505, 2505, 2505, 0, 0, 0, 0, 2505, 2506, + 0, 0, 0, 2506, 2506, 2506, 0, 0, 0, 0, + 2506, 2507, 0, 0, 0, 2507, 2507, 2507, 0, 0, + 0, 0, 2507, 2508, 0, 0, 0, 2508, 2508, 2508, + 0, 0, 0, 0, 2508, 2509, 0, 0, 0, 2509, + 2509, 2509, 0, 0, 0, 0, 2509, 2510, 0, 0, + + 0, 2510, 2510, 2510, 0, 0, 0, 0, 2510, 2511, + 0, 0, 0, 2511, 2511, 2511, 0, 0, 0, 0, + 2511, 2512, 0, 0, 0, 2512, 2512, 2512, 0, 0, + 0, 0, 2512, 2513, 0, 0, 0, 2513, 2513, 2513, + 0, 0, 0, 0, 2513, 2514, 0, 0, 0, 2514, + 2514, 2514, 0, 0, 0, 0, 2514, 2515, 0, 0, + 0, 2515, 2515, 2515, 0, 0, 0, 0, 2515, 2516, + 2516, 2516, 2517, 0, 0, 0, 2517, 2517, 2517, 0, + 0, 0, 0, 2517, 2518, 2518, 2518, 2519, 2519, 2519, + 0, 0, 0, 0, 2519, 2520, 2520, 2520, 2521, 2521, + + 2521, 2522, 2522, 2522, 2523, 2523, 2523, 2524, 0, 2524, + 0, 2524, 2524, 0, 0, 0, 0, 0, 2524, 2525, + 0, 2525, 0, 2525, 2525, 0, 0, 0, 0, 0, + 2525, 2526, 0, 0, 0, 2526, 2526, 2526, 0, 0, + 0, 0, 2526, 2527, 0, 0, 0, 2527, 2527, 2527, + 0, 0, 0, 0, 2527, 2528, 0, 0, 0, 2528, + 2528, 2528, 0, 0, 0, 0, 2528, 2529, 0, 0, + 0, 2529, 2529, 2529, 0, 0, 0, 0, 2529, 2530, + 0, 0, 0, 2530, 2530, 2530, 0, 0, 0, 0, + 2530, 2531, 0, 0, 0, 2531, 2531, 2531, 0, 0, + + 0, 0, 2531, 2532, 0, 0, 0, 2532, 2532, 2532, + 0, 0, 0, 0, 2532, 2533, 0, 0, 0, 2533, + 2533, 2533, 0, 0, 0, 0, 2533, 2534, 0, 0, + 0, 2534, 2534, 2534, 0, 0, 0, 0, 2534, 2535, + 0, 0, 0, 2535, 2535, 2535, 0, 0, 0, 0, + 2535, 2536, 0, 0, 0, 2536, 2536, 2536, 0, 0, + 0, 0, 2536, 2537, 0, 0, 0, 2537, 2537, 2537, + 0, 0, 0, 0, 2537, 2538, 0, 0, 0, 2538, + 2538, 2538, 0, 0, 0, 0, 2538, 2539, 0, 0, + 0, 2539, 2539, 2539, 0, 0, 0, 0, 2539, 2540, + + 0, 0, 0, 2540, 2540, 2540, 0, 0, 0, 0, + 2540, 2541, 0, 0, 0, 2541, 2541, 2541, 0, 0, + 0, 0, 2541, 2542, 0, 0, 0, 2542, 2542, 2542, + 0, 0, 0, 0, 2542, 2543, 0, 0, 0, 2543, + 2543, 2543, 0, 0, 0, 0, 2543, 2544, 0, 0, + 0, 2544, 2544, 2544, 0, 0, 0, 0, 2544, 2545, + 0, 0, 0, 2545, 2545, 2545, 0, 0, 0, 0, + 2545, 2546, 0, 0, 0, 2546, 2546, 2546, 0, 0, + 0, 0, 2546, 2547, 0, 0, 0, 2547, 2547, 2547, + 0, 0, 0, 0, 2547, 2548, 0, 0, 0, 2548, + + 2548, 2548, 0, 0, 0, 0, 2548, 2549, 0, 0, + 0, 2549, 2549, 2549, 0, 0, 0, 0, 2549, 2550, + 0, 0, 0, 2550, 2550, 2550, 0, 0, 0, 0, + 2550, 2551, 0, 0, 0, 2551, 2551, 2551, 0, 0, + 0, 0, 2551, 2552, 0, 0, 0, 2552, 2552, 2552, + 0, 0, 0, 0, 2552, 2553, 0, 0, 0, 2553, + 2553, 2553, 0, 0, 0, 0, 2553, 2554, 0, 0, + 0, 2554, 2554, 2554, 0, 0, 0, 0, 2554, 2555, + 0, 0, 0, 2555, 2555, 2555, 0, 0, 0, 0, + 2555, 2556, 0, 0, 0, 2556, 2556, 2556, 0, 0, + + 0, 0, 2556, 2557, 0, 0, 0, 2557, 2557, 2557, + 0, 0, 0, 0, 2557, 2558, 0, 0, 0, 2558, + 2558, 2558, 0, 0, 0, 0, 2558, 2559, 0, 0, + 0, 2559, 2559, 2559, 0, 0, 0, 0, 2559, 2560, + 0, 0, 0, 2560, 2560, 2560, 0, 0, 0, 0, + 2560, 2561, 0, 0, 0, 2561, 2561, 2561, 0, 0, + 0, 0, 2561, 2562, 0, 0, 0, 2562, 2562, 2562, + 0, 0, 0, 0, 2562, 2563, 0, 0, 0, 2563, + 2563, 2563, 0, 0, 0, 0, 2563, 2564, 0, 0, + 0, 2564, 2564, 2564, 0, 0, 0, 0, 2564, 2565, + + 0, 0, 0, 2565, 2565, 2565, 0, 0, 0, 0, + 2565, 2566, 0, 0, 0, 2566, 2566, 2566, 0, 0, + 0, 0, 2566, 2567, 0, 0, 0, 2567, 2567, 2567, + 0, 0, 0, 0, 2567, 2568, 2568, 2568, 2569, 0, + 0, 0, 2569, 2569, 2569, 0, 0, 0, 0, 2569, + 2570, 2570, 2570, 2571, 2571, 2571, 2572, 2572, 2572, 2573, + 2573, 2573, 2576, 0, 2576, 0, 2576, 2576, 0, 0, + 0, 0, 0, 2576, 2579, 0, 2579, 0, 2579, 2579, + 0, 0, 0, 0, 0, 2579, 2580, 2580, 2580, 2581, + 2581, 2581, 2582, 0, 0, 0, 2582, 2582, 2582, 0, + + 0, 0, 0, 2582, 2583, 2583, 2583, 2584, 0, 0, + 0, 2584, 2584, 2584, 0, 0, 0, 0, 2584, 2585, + 2585, 2585, 2586, 2586, 2586, 2588, 2588, 2588, 2590, 2590, + 2590, 2593, 0, 2593, 0, 2593, 2593, 0, 0, 0, + 0, 0, 2593, 2596, 0, 2596, 0, 2596, 2596, 0, + 0, 0, 0, 0, 2596, 2597, 2597, 2597, 2598, 0, + 0, 0, 2598, 2598, 2598, 0, 0, 0, 0, 2598, + 2599, 2599, 2599, 2600, 2600, 2600, 2601, 2601, 2601, 2602, + 2602, 2602, 2604, 2604, 2604, 2606, 2606, 2606, 2607, 2607, + 2607, 2608, 2608, 2608, 2609, 2609, 2609, 2610, 2610, 2610, + + 2611, 2611, 2611, 2612, 2612, 2612, 2613, 2613, 2613, 2614, + 0, 2614, 0, 2614, 2614, 2614, 0, 0, 0, 0, + 2614, 2615, 0, 2615, 0, 2615, 2615, 2615, 0, 0, + 0, 0, 2615, 2616, 2616, 2616, 2617, 2617, 2617, 2618, + 0, 2618, 0, 2618, 2618, 2618, 0, 0, 0, 0, + 2618, 2619, 0, 2619, 0, 2619, 2619, 2619, 0, 0, + 0, 0, 2619, 2620, 0, 2620, 0, 2620, 2620, 2620, + 0, 0, 0, 0, 2620, 2621, 0, 2621, 0, 2621, + 2621, 2621, 0, 0, 0, 0, 2621, 2622, 2622, 2622, + 2623, 0, 2623, 0, 2623, 2623, 2623, 0, 0, 0, + + 0, 2623, 2624, 0, 2624, 0, 2624, 2624, 2624, 0, + 0, 0, 0, 2624, 2625, 0, 2625, 0, 2625, 2625, + 2625, 0, 0, 0, 0, 2625, 2626, 0, 2626, 0, + 2626, 2626, 2626, 0, 0, 0, 0, 2626, 2627, 0, + 2627, 0, 2627, 2627, 2627, 0, 0, 0, 0, 2627, + 2628, 0, 2628, 0, 2628, 2628, 2628, 0, 0, 0, + 0, 2628, 2629, 0, 2629, 0, 2629, 2629, 2629, 0, + 0, 0, 0, 2629, 2630, 0, 2630, 0, 2630, 2630, + 2630, 0, 0, 0, 0, 2630, 2631, 0, 2631, 0, + 2631, 2631, 2631, 0, 0, 0, 0, 2631, 2632, 0, + + 2632, 0, 2632, 2632, 2632, 0, 0, 0, 0, 2632, + 2633, 0, 2633, 0, 2633, 2633, 2633, 0, 0, 0, + 0, 2633, 2634, 0, 2634, 0, 2634, 2634, 2634, 0, + 0, 0, 0, 2634, 2635, 0, 2635, 0, 2635, 2635, + 2635, 0, 0, 0, 0, 2635, 2636, 0, 2636, 0, + 2636, 2636, 2636, 0, 0, 0, 0, 2636, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612 + + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "vrscanl.l" +/* + * + * Copyright (C) 1997-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Hermann Grevemeyer et al. + * + * Purpose: + * These are the regular expressions for the value representations + * + */ +/* Avoid compiler warnings about unused functions */ +#define YY_NO_INPUT 1 +#line 28 "vrscanl.l" +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "vrscani.h" +#line 4878 "vrscanl.c" +/* Make this work on windows (we don't need interactivity anyway) */ +/* This seems to be a bug: The .c file won't include it, but .h will + * nevertheless. + * %option nounistd + * Our workaround: Define YY_NO_UNISTD_H in vrscani.h and make + * sure that header is included before vrscanl.h. + */ +#line 4886 "vrscanl.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 100 "vrscanl.l" + + +#line 5147 "vrscanl.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1613 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 1612 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 102 "vrscanl.l" +{return 1; /* AS */} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 103 "vrscanl.l" +{return 2; /* DA */} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 104 "vrscanl.l" +{return 3; /* OLD_DA */} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 105 "vrscanl.l" +{return 17; /* dubious DA */} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 106 "vrscanl.l" +{return 4; /* TM */} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 107 "vrscanl.l" +{return 5; /* OLD_TM */} + YY_BREAK +case 7: +YY_RULE_SETUP +#line 108 "vrscanl.l" +{return 6; /* DS */} + YY_BREAK +case 8: +YY_RULE_SETUP +#line 109 "vrscanl.l" +{return 7; /* DT */} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 110 "vrscanl.l" +{return 18; /* dubious DT */} + YY_BREAK +case 10: +YY_RULE_SETUP +#line 111 "vrscanl.l" +{return 8; /* IS */} + YY_BREAK +case 11: +YY_RULE_SETUP +#line 112 "vrscanl.l" +{return 9; /* UI */} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 113 "vrscanl.l" +{return 10; /* CS */} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 114 "vrscanl.l" +{return 11; /* PN */} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 115 "vrscanl.l" +{return 15; /* OLD_PN: not used any longer within DCMTK */} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 116 "vrscanl.l" +{return 12; /* LO | SH */} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 117 "vrscanl.l" +{return 13; /* AE */} + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP +#line 118 "vrscanl.l" +{return 14; /* LT | ST | UT */} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 119 "vrscanl.l" +{return 19; /* UR */} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 120 "vrscanl.l" +{return 20; /* UC */} + YY_BREAK +/* . doesn't match \n, this needs a special case! */ +case 20: +/* rule 20 can match eol */ +#line 123 "vrscanl.l" +case 21: +/* rule 21 can match eol */ +YY_RULE_SETUP +#line 123 "vrscanl.l" +{return 16; /* UNKNOWN */;} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 125 "vrscanl.l" +ECHO; + YY_BREAK +#line 5311 "vrscanl.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1613 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1613 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 1612); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 125 "vrscanl.l" + + diff --git a/dcmdata/libsrc/vrscanl.h b/dcmdata/libsrc/vrscanl.h new file mode 100644 index 00000000..69d833aa --- /dev/null +++ b/dcmdata/libsrc/vrscanl.h @@ -0,0 +1,492 @@ +#ifndef yyHEADER_H +#define yyHEADER_H 1 +#define yyIN_HEADER 1 + +#line 5 "vrscanl.h" + +#line 7 "vrscanl.h" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define yywrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef yy_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef yy_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef yy_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef yy_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef yy_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef yy_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef yy_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef yy_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef yy_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef yypush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef yypop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef yyensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef yylex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef yyrestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef yylex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef yylex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef yylex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef yyget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef yyset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef yyget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef yyset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef yyget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef yyset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef yyget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef yyset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef yyget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef yyget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef yyget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef yyset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef yyget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef yyset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef yywrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef yyget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef yyset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef yyget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef yyset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef yyalloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef yyrealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef yyfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef yytext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef yyleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef yyin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef yyout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef yy_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef yylineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef yytables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef yytables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef yyTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 125 "vrscanl.l" + + +#line 490 "vrscanl.h" +#undef yyIN_HEADER +#endif /* yyHEADER_H */ diff --git a/dcmdata/libsrc/vrscanl.l b/dcmdata/libsrc/vrscanl.l new file mode 100644 index 00000000..40512095 --- /dev/null +++ b/dcmdata/libsrc/vrscanl.l @@ -0,0 +1,125 @@ +/* + * + * Copyright (C) 1997-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Hermann Grevemeyer et al. + * + * Purpose: + * These are the regular expressions for the value representations + * + */ + +%option reentrant +/* Avoid compiler warnings about unused functions */ +%option noyywrap nounput noinput + +%{ +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "vrscani.h" +%} + +/* Make this work on windows (we don't need interactivity anyway) */ +%option nointeractive +/* This seems to be a bug: The .c file won't include it, but .h will + * nevertheless. + * %option nounistd + * Our workaround: Define YY_NO_UNISTD_H in vrscani.h and make + * sure that header is included before vrscanl.h. + */ + +default_charset_without_control_chars [\041-\133\135-\176][\040-\133\135-\176]* +charset_without_control_chars [\040-\133\135-\176\240-\377\033]+ +charset_with_control_chars [\040-\176\240-\377\011\012\014\015\033]+ +spaces [ ]* +dt_offset (\-1200)|(\+1400)|(((\-((0[1-9])|(1[0-1])))|(\+((0[1-9])|(1[0-3])))){tm_minute}) +da_year (18[5-9][0-9])|(19[0-9]{2})|(20[0-4][0-9]) +da_year_dub [0-9]{4} +da_month (0[1-9])|(1[0-2]) +da_day (0[1-9])|([1-2][0-9])|(3[0-1]) +tm_hour ([0-1][0-9])|(2[0-3]) +tm_minute [0-5][0-9] +tm_second [0-5][0-9] +is_positive \+?0*(([0-9]{1,9})|(1[0-9]{9})|(20[0-9]{8})|(21[0-3][0-9]{7})|(214[0-6][0-9]{6})|(2147[0-3][0-9]{5})|(21474[0-7][0-9]{4})|(214748[0-2][0-9]{3})|(2147483[0-5][0-9]{2})|(21474836[0-3][0-9])|(214748364[0-7])) +is_negative \-0*(([0-9]{1,9})|(1[0-9]{9})|(20[0-9]{8})|(21[0-3][0-9]{7})|(214[0-6][0-9]{6})|(2147[0-3][0-9]{5})|(21474[0-7][0-9]{4})|(214748[0-2][0-9]{3})|(2147483[0-5][0-9]{2})|(21474836[0-3][0-9])|(214748364[0-8])) +pn_chars [\040-\074\076-\133\135\137-\176\240-\377\033]+ +ur_chars [\041-\133\135-\176]+ +pn_component_group {pn_chars}?(\^{pn_chars}?(\^{pn_chars}?(\^{pn_chars}?(\^{pn_chars}?)?)?)?)? + +normalized-as [0-9]{3}[DWMY] +normalized-da {da_year}{da_month}{da_day} +normalized-da-old {da_year_dub}\.{da_month}\.{da_day} +normalized-da-dub {da_year_dub}{da_month}{da_day} +normalized-tm {tm_hour}({tm_minute}({tm_second}(\.[0-9]{1,6})?)?)? +normalized-tm-old {tm_hour}:{tm_minute}:{tm_second}\.[0-9]{6} +normalized-ds ([\-\+]?[0-9]*[\.]?[0-9]+)|([\-\+]?[0-9]+[\.]?[0-9]*)|([\-\+]?[0-9]*[\.]?[0-9]+[Ee][\+\-]?[0-9]+)|([\-\+]?[0-9]+[\.]?[0-9]*[Ee][\+\-]?[0-9]+) +normalized-dt {da_year}({da_month}({da_day}({normalized-tm}{dt_offset}?)?)?)? +normalized-dt-dub {da_year_dub}({da_month}({da_day}({normalized-tm}{dt_offset}?)?)?)? +normalized-is {is_positive}|{is_negative} +normalized-ui (([0-9]\.)|([1-9][0-9]+\.))*(([0-9])|([1-9][0-9]+)) +normalized-cs [0-9A-Z _]+ +normalized-pn {pn_component_group}(\={pn_component_group}(\={pn_component_group})?)? +normalized-pn-old {pn_chars} +normalized-lo-sh {charset_without_control_chars} +normalized-ae {default_charset_without_control_chars} +normalized-lt-st-ut {charset_with_control_chars} +normalized-ur {ur_chars} +normalized-uc {charset_without_control_chars} + +as {normalized-as} +da {normalized-da} +da-old {normalized-da-old} +da-dub {normalized-da-dub} +tm {normalized-tm}{spaces} +tm-old {normalized-tm-old}{spaces} +ds {spaces}{normalized-ds}{spaces} +dt {normalized-dt}{spaces} +dt-dub {normalized-dt-dub}{spaces} +is {spaces}{normalized-is}{spaces} +ui {normalized-ui} +cs {spaces}{normalized-cs}{spaces} +pn {normalized-pn}{spaces} +pn-old {normalized-pn-old}{spaces} +lo-sh {spaces}{normalized-lo-sh}{spaces} +ae {spaces}{normalized-ae}{spaces} +lt-st-ut {normalized-lt-st-ut}{spaces} +ur {normalized-ur}{spaces} +uc {normalized-uc}{spaces} + +%% + +as{as}?(\\{as}?)* {return 1; /* AS */} +da{da}?(\\{da}?)* {return 2; /* DA */} +da{da-old}?(\\{da-old}?)* {return 3; /* OLD_DA */} +da{da-dub}?(\\{da-dub}?)* {return 17; /* dubious DA */} +tm{tm}?(\\{tm}?)* {return 4; /* TM */} +tm{tm-old}?(\\{tm-old}?)* {return 5; /* OLD_TM */} +ds{ds}?(\\{ds}?)* {return 6; /* DS */} +dt{dt}?(\\{dt}?)* {return 7; /* DT */} +dt{dt-dub}?(\\{dt-dub}?)* {return 18; /* dubious DT */} +is{is}?(\\{is}?)* {return 8; /* IS */} +ui{ui}?(\\{ui}?)* {return 9; /* UI */} +cs{cs}?(\\{cs}?)* {return 10; /* CS */} +pn{pn}?(\\{pn}?)* {return 11; /* PN */} +oldpn{pn-old}?(\\{pn-old}?)* {return 15; /* OLD_PN: not used any longer within DCMTK */} +lo{lo-sh}?(\\{lo-sh}?)* {return 12; /* LO | SH */} +ae{ae}?(\\{ae}?)* {return 13; /* AE */} +lt{lt-st-ut} {return 14; /* LT | ST | UT */} +ur{ur} {return 19; /* UR */} +uc{uc} {return 20; /* UC */} + /* . doesn't match \n, this needs a special case! */ +\n | +. {return 16; /* UNKNOWN */;} + +%% diff --git a/dcmdata/tests/CMakeLists.txt b/dcmdata/tests/CMakeLists.txt new file mode 100644 index 00000000..c1a1c6c4 --- /dev/null +++ b/dcmdata/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +# declare executables +DCMTK_ADD_EXECUTABLE(dcmdata_tests tests tpread ti2dbmp tchval tpath tvrdatim telemlen tparser tdict tvrds tvrfd tvrpn tvrui tvrol tvrov tvrsv tvruv tstrval tspchrs tparent tfilter tvrcomp tmatch tnewdcme tgenuid) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(dcmdata_tests i2d dcmdata oflog ofstd) + +# This macro parses tests.cc and registers all tests +DCMTK_ADD_TESTS(dcmdata) diff --git a/dcmdata/tests/Makefile.dep b/dcmdata/tests/Makefile.dep new file mode 100644 index 00000000..6f141c65 --- /dev/null +++ b/dcmdata/tests/Makefile.dep @@ -0,0 +1,1592 @@ +tchval.o: tchval.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/vrscan.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h +tdict.o: tdict.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcdicent.h +telemlen.o: telemlen.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcostrmb.h +tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +tfilter.o: tfilter.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcfilter.h \ + ../../ofstd/include/dcmtk/ofstd/ofalgo.h \ + ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h +tgenuid.o: tgenuid.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +ti2dbmp.o: ti2dbmp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/libi2d/i2dbmps.h \ + ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/libi2d/i2define.h +tmatch.o: tmatch.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcmatch.h +tnewdcme.o: tnewdcme.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcdict.h \ + ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdicent.h +tparent.o: tparent.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h dctmacro.h \ + ../include/dcmtk/dcmdata/dcistrmb.h ../include/dcmtk/dcmdata/dcostrmb.h +tparser.o: tparser.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/oftempf.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcistrmb.h ../include/dcmtk/dcmdata/dcostrmb.h \ + dctmacro.h +tpath.o: tpath.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcpath.h +tpread.o: tpread.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h ../include/dcmtk/dcmdata/dctk.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dcdicent.h ../include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmdata/dcdict.h ../include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \ + ../include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \ + ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \ + ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \ + ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \ + ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcostrmz.h \ + ../include/dcmtk/dcmdata/dcistrmz.h ../include/dcmtk/dcmdata/dcfcache.h +tspchrs.o: tspchrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmdata/dctypes.h +tstrval.o: tstrval.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h +tvrcomp.o: tvrcomp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcvras.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcvrlo.h ../include/dcmtk/dcmdata/dcvrlt.h \ + ../include/dcmtk/dcmdata/dcvrpn.h ../include/dcmtk/dcmdata/dcvrst.h \ + ../include/dcmtk/dcmdata/dcvrur.h ../include/dcmtk/dcmdata/dcvrut.h \ + ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmdata/dcvrod.h ../include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrfl.h \ + ../include/dcmtk/dcmdata/dcvrtm.h ../include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrobow.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrsh.h \ + ../include/dcmtk/dcmdata/dcvrsl.h ../include/dcmtk/dcmdata/dcvrss.h \ + ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrus.h \ + ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcpxitem.h \ + ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcpixel.h \ + ../include/dcmtk/dcmdata/dcovlay.h ../include/dcmtk/dcmdata/dcpixseq.h +tvrdatim.o: tvrdatim.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvrda.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../include/dcmtk/dcmdata/dcvrtm.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../include/dcmtk/dcmdata/dcdeftag.h +tvrds.o: tvrds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcdeftag.h +tvrfd.o: tvrfd.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvrfd.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcdeftag.h +tvrol.o: tvrol.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcdeftag.h +tvrov.o: tvrov.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcvrov.h ../include/dcmtk/dcmdata/dcvruv.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcdeftag.h +tvrpn.o: tvrpn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvrpn.h ../include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \ + ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h +tvrsv.o: tvrsv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcvrsv.h ../include/dcmtk/dcmdata/dcelem.h +tvrui.o: tvrui.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dcdeftag.h +tvruv.o: tvruv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \ + ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \ + ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \ + ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmdata/dcvruv.h ../include/dcmtk/dcmdata/dcelem.h diff --git a/dcmdata/tests/Makefile.in b/dcmdata/tests/Makefile.in new file mode 100644 index 00000000..eb003974 --- /dev/null +++ b/dcmdata/tests/Makefile.in @@ -0,0 +1,57 @@ +# +# Makefile for dcmdata/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog + +LOCALINCLUDES = -I$(top_srcdir)/include -I$(ofstddir)/include -I$(oflogdir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(top_srcdir)/libi2d -L$(ofstddir)/libsrc \ + -L$(oflogdir)/libsrc +LOCALLIBS = -ldcmdata -loflog -lofstd $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) +I2DLIBS = -li2d + +objs = tests.o tpread.o ti2dbmp.o tchval.o tpath.o tvrdatim.o telemlen.o tparser.o \ + tdict.o tvrds.o tvrfd.o tvrui.o tvrol.o tvrov.o tvrsv.o tvruv.o tstrval.o \ + tspchrs.o tvrpn.o tparent.o tfilter.o tvrcomp.o tmatch.o tnewdcme.o \ + tgenuid.o + +progs = tests + + +all: $(progs) + +tests: $(objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $(objs) $(I2DLIBS) $(LOCALLIBS) $(LIBS) + + +check: tests + DCMDICTPATH=../data/dicom.dic ./tests + +check-exhaustive: tests + DCMDICTPATH=../data/dicom.dic ./tests -x + + +install: all + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmdata/tests/dcmpsdmp.tcl b/dcmdata/tests/dcmpsdmp.tcl new file mode 100644 index 00000000..aa2b0169 --- /dev/null +++ b/dcmdata/tests/dcmpsdmp.tcl @@ -0,0 +1,187 @@ +#!/bin/sh +# the next line restarts using wish \ +exec wish4.2 "$0" "$@" + +# inserts the tag value + +proc insertTagValue {w s} { + set sp [string index $s 0] + if {$sp == "("} { + if {[string match {*\,*} $s] == 0} { + $w insert end $s tag_val1 + } else { + $w insert end $s tag_val2 + } + } elseif {$sp == "\["} { + $w insert end $s tag_val2 + } elseif {$sp == "="} { + $w insert end $s tag_val3 + } else { + $w insert end $s tag_val4 + } +} + + +# load text from file into window + +proc loadText {w name} { +# $w configure -state normal + set f [open $name] + while {![eof $f]} { + gets $f s + set sp [string index $s 0] + if {$sp == "#" || $sp == "*"} { + $w insert end $s tag_emph + } elseif {[string match {(\ )*\(*\)*\#*} $s] == 0} { + set sp1 [string first ")" $s] + $w insert end [string range $s 0 $sp1] tag_tag + set sp1 [expr int ($sp1 + 1)] + set sp2 [expr int ($sp1 + 3)] + $w insert end [string range $s $sp1 $sp2] tag_vr + set sp3 [string last "#" $s] + set sp1 [expr int ($sp2 + 1)] + set sp2 [expr int ($sp3 - 1)] + insertTagValue $w [string range $s $sp1 $sp2] + set ss [string range $s $sp3 end] + set sp3 [string last " " $ss] + set sp2 [expr int ($sp3)] + $w insert end [string range $ss 0 $sp2] tag_len + set sp1 [expr int ($sp3 + 1)] + $w insert end [string range $ss $sp1 end] tag_name + } else { + $w insert end $s + } + $w insert end "\n" + } + close $f +# $w configure -state disabled +} + + +# search string in text window and mark all positions with tag + +proc findText {w name tag} { + $w tag remove $tag 1.0 end + set hits 0 + set pos -1 + if {$name != ""} { + set cur 1.0 + while 1 { + set cur [$w search -count length -- $name $cur end] + if {$cur == ""} { + break + } + if {$pos < 0} { + set pos $cur + } + $w tag add $tag $cur "$cur + $length char" + set cur [$w index "$cur + $length char"] + incr hits + } + } + if {$pos >= 0} { + $w see $pos + } + return $hits +} + +# search string in both text windows + +proc findTextCommand {name} { + global hitsText + + set dh [findText .dump.text $name tag_found] + set hitsText [concat "Hits: " $dh] + focus .find.entry + .find.entry delete 0 end +} + + +# set up text window + +proc setupTextWindow {} { + global findName + global hitsText + + set hitsText "Hits: 0" + + frame .find + button .find.button -text "Find" -command "findTextCommand \$findName" -width 4 -anchor w + entry .find.entry -textvariable findName + label .find.label -textvariable hitsText -width 13 + pack .find.button -side left + pack .find.label -side right + pack .find.entry -fill x -expand yes -padx 5 + + frame .dump + text .dump.text -height 1 -wrap none -background #fff7e9 -selectbackground lightgray -font -*-Courier-Medium-R-Normal--*-150-*-*-*-*-*-* -xscrollcommand ".dump.xscroll set" -yscrollcommand ".dump.yscroll set" + scrollbar .dump.xscroll -orient horizontal -command ".dump.text xview" + scrollbar .dump.yscroll -orient vertical -command ".dump.text yview" + pack .dump.xscroll -side bottom -fill x + pack .dump.yscroll -side right -fill y + pack .dump.text -expand yes -fill both + + + .dump.text tag configure tag_emph -foreground black -font -*-Courier-Bold-R-Normal--*-150-*-*-*-*-*-* + .dump.text tag configure tag_found -background lightgray -underline true + .dump.text tag configure tag_tag -foreground darkblue + .dump.text tag configure tag_vr -foreground darkred + .dump.text tag configure tag_val1 -foreground darkgray + .dump.text tag configure tag_val2 -foreground black + .dump.text tag configure tag_val3 -foreground darkblue + .dump.text tag configure tag_val4 -foreground black + .dump.text tag configure tag_len -foreground darkgray + .dump.text tag configure tag_name -foreground darkblue + + pack .find -side top -fill x + pack .dump -expand yes -fill both + + bind .find.entry "findTextCommand \$findName" + bind .dump.text {if {[.dump.text tag nextrange sel 1.0] != ""} {findTextCommand [selection get]}} + + focus .find.entry +} + + +# main window +catch {eval destroy [winfo child .]} errMsg +if {$errMsg > 0} { + exit 1 +} + +# initialization +set temp "/tmp" +if [info exists env(TEMP)] { + set temp $env(TEMP) +} elseif [info exists env(TMP)] { + set temp $env(TMP) +} +set dumpReport [file join $temp dcmdump.report] +set dumpApp "dcmdump" + +# set up window +wm iconname . "DICOM Dump" +if {$tcl_platform(os) == "SunOS"} { + wm geometry . 956x903 +} else { + wm geometry . [expr int([winfo screenwidth .] * 0.995)]x[expr int([winfo screenheight .] * 0.938)] +} +wm geometry . +0+0 +wm minsize . 400 165 + +setupTextWindow + +# set up bindings +bind all {destroy .} + +# start dump process +if {$argc > 0} { + set fileName [lindex $argv 0] + wm title . "Please wait ..." + catch {exec $dumpApp $fileName >& $dumpReport} + loadText .dump.text $dumpReport + update + wm title . [format "DICOM File Contents - %s" $fileName] +} else { + wm title . [format "DICOM File Contents - "] +} diff --git a/dcmdata/tests/dctmacro.h b/dcmdata/tests/dctmacro.h new file mode 100644 index 00000000..c487f88e --- /dev/null +++ b/dcmdata/tests/dctmacro.h @@ -0,0 +1,126 @@ +/* + * + * Copyright (C) 2011-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: test program for reading DICOM datasets + * + */ + + +#ifndef DCTMACRO_H +#define DCTMACRO_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcistrmb.h" +#include "dcmtk/dcmdata/dcostrmb.h" +#include "dcmtk/dcmdata/dcxfer.h" + + +/* Macros for handling the endianness */ +#define LITTLE_ENDIAN_UINT16(w) OFstatic_cast(Uint8, (w) & 0xff), OFstatic_cast(Uint8, (w) >> 8) +#define LITTLE_ENDIAN_UINT32(w) LITTLE_ENDIAN_UINT16((w) & 0xffff), LITTLE_ENDIAN_UINT16((w) >> 16) + +#define BIG_ENDIAN_UINT16(w) OFstatic_cast(Uint8, (w) >> 8), OFstatic_cast(Uint8, (w) & 0xff) +#define BIG_ENDIAN_UINT32(w) BIG_ENDIAN_UINT16((w) >> 16), BIG_ENDIAN_UINT16((w) & 0xffff) + +/* Various definitions for "fake generating" DICOM datasets, explicit transfer syntaxes */ +#define RESERVED_BYTES 0, 0 +#define TAG(tag) ENDIAN_UINT16((tag).getGroup()), ENDIAN_UINT16((tag).getElement()) +#define TAG_AND_LENGTH(tag, v, r, length) \ + TAG(tag), v, r, RESERVED_BYTES, ENDIAN_UINT32(length) +#define TAG_AND_LENGTH_SHORT(tag, v, r, length) \ + TAG(tag), v, r, ENDIAN_UINT16(length) +#define ITEM(length) \ + TAG(DCM_Item), ENDIAN_UINT32(length) +#define ITEM_END \ + TAG(DCM_ItemDelimitationItem), ENDIAN_UINT32(0) +#define SEQUENCE_END \ + TAG(DCM_SequenceDelimitationItem), ENDIAN_UINT32(0) + +/* Various definitions for "fake generating" DICOM datasets, implicit transfer syntaxes */ +#define IMPLICIT_TAG_AND_LENGTH(tag, length) \ + TAG(tag), ENDIAN_UINT32(length) + +#define UNDEFINED_LENGTH 0xffffffff +#define UNDEFINED_LENGTH_SHORT 0xffff +#define VALUE 0x2a + + +/** + * Read the dataset from the buffer into a dataset object. + * @param dset the dataset to read into + * @param buffer the buffer to read from + * @param length the length of the buffer + * @param ts the transfer syntax that is used + * @return EC_Normal if reading worked, else an error + */ +static inline OFCondition readDataset(DcmDataset& dset, const Uint8* buffer, size_t length, E_TransferSyntax ts) +{ + DcmInputBufferStream stream; + stream.setBuffer(buffer, length); + stream.setEos(); + + dset.clear(); + dset.transferInit(); + const OFCondition cond = dset.read(stream, ts); + dset.transferEnd(); + + return cond; +} + +/** + * Read the dataset from the buffer into a dataset object. + * The difference to readDataset() is that this function then writes it out into + * a buffer again which is read again. So this also tests the write functions. + * @param dset the dataset to read itno + * @param buffer the buffer to read from + * @param length the length of the buffer + * @param ts1 the transfer syntax that is used in buffer + * @param ts2 the transfer syntax that should be used for the write/read cycle + * @return EC_Normal if reading worked, else an error + */ +static inline OFCondition readDatasetTwice(DcmDataset& dset, const Uint8* buffer, + size_t length, E_TransferSyntax ts1, E_TransferSyntax ts2, E_EncodingType encType = EET_ExplicitLength) +{ + OFCondition cond = readDataset(dset, buffer, length, ts1); + if (cond.bad()) + return cond; + + // Write the dataset into a temporary buffer + OFVector writeBuffer(length * 2); + DcmOutputBufferStream out(&writeBuffer[0], writeBuffer.size()); + dset.transferInit(); + cond = dset.write(out, ts1, encType, NULL); + dset.transferEnd(); + + // To avoid error messages, we must always flush the buffer + void *outBuffer; + offile_off_t outLength; + out.flushBuffer(outBuffer, outLength); + + if (cond.bad()) + // Writing failed + return cond; + + // Now read the dataset again + return readDataset(dset, OFstatic_cast(const Uint8 *, outBuffer), + OFstatic_cast(size_t, outLength), ts2); +} + + +#endif // DCTMACRO_H diff --git a/dcmdata/tests/tchval.cc b/dcmdata/tests/tchval.cc new file mode 100644 index 00000000..e57c1f50 --- /dev/null +++ b/dcmdata/tests/tchval.cc @@ -0,0 +1,278 @@ +/* + * + * Copyright (C) 2009-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for checkStringValue() methods + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/vrscan.h" +#include "dcmtk/ofstd/ofbmanip.h" + + +#define CHECK_GOOD(number, check) do { \ + if (!(check).good()) \ + OFCHECK_FAIL(number ": " #check); \ +} while (0); + +#define CHECK_BAD(number, check) do { \ + if (!(check).bad()) \ + OFCHECK_FAIL(number ": " #check); \ +} while (0); + +OFTEST(dcmdata_checkStringValue) +{ + /* test "Application Entity" */ + CHECK_BAD ( "AE-01", DcmApplicationEntity::checkStringValue(" ", "1") ) + CHECK_GOOD( "AE-02", DcmApplicationEntity::checkStringValue("A\\") ) + CHECK_GOOD( "AE-03", DcmApplicationEntity::checkStringValue(" AETITLE", "1") ) + CHECK_GOOD( "AE-04", DcmApplicationEntity::checkStringValue("AE-Title ", "1") ) + CHECK_GOOD( "AE-05", DcmApplicationEntity::checkStringValue(" AE Title ", "1") ) + CHECK_GOOD( "AE-06", DcmApplicationEntity::checkStringValue("A \\ B", "2") ) + CHECK_BAD ( "AE-07", DcmApplicationEntity::checkStringValue("J\366rg", "1") ) + CHECK_BAD ( "AE-08", DcmApplicationEntity::checkStringValue("1234567890-ABCDE ") ) + CHECK_GOOD( "AE-09", DcmApplicationEntity::checkStringValue("\\ AE \\", "3-3n") ) + + /* test "Age String" */ + CHECK_GOOD( "AS-01", DcmAgeString::checkStringValue("001Y", "1") ) + CHECK_GOOD( "AS-02", DcmAgeString::checkStringValue("099Y", "1") ) + CHECK_BAD ( "AS-03", DcmAgeString::checkStringValue("099Z", "1") ) + CHECK_GOOD( "AS-04", DcmAgeString::checkStringValue("199D\\000W\\500M", "2-n") ) + CHECK_BAD ( "AS-05", DcmAgeString::checkStringValue("Y010", "1") ) + CHECK_BAD ( "AS-06", DcmAgeString::checkStringValue("10Y", "1") ) + CHECK_BAD ( "AS-07", DcmAgeString::checkStringValue("010 Y", "1") ) + CHECK_BAD ( "AS-08", DcmAgeString::checkStringValue(" 010Y", "1") ) + CHECK_BAD ( "AS-09", DcmAgeString::checkStringValue("010Y ", "1") ) + CHECK_BAD ( "AS-10", DcmAgeString::checkStringValue("0109Y", "1") ) + + /* test "Code String" */ + CHECK_GOOD( "CS-01", DcmCodeString::checkStringValue("TEST 1234567890\\TEST", "2-2n") ) + CHECK_BAD ( "CS-02", DcmCodeString::checkStringValue("TEST 1234567890\\TEST\\", "2-2n") ) + CHECK_GOOD( "CS-03", DcmCodeString::checkStringValue("", "2-2n") ) + CHECK_GOOD( "CS-04", DcmCodeString::checkStringValue("\\TEST 1234567890", "2") ) + CHECK_GOOD( "CS-05", DcmCodeString::checkStringValue("\\ ", "2") ) + CHECK_BAD ( "CS-06", DcmCodeString::checkStringValue("\\TEST 1234567890 A", "2") ) + CHECK_BAD ( "CS-07", DcmCodeString::checkStringValue("J\366rg", "1-2") ) + CHECK_BAD ( "CS-08", DcmCodeString::checkStringValue("Joerg", "1-2") ) + CHECK_GOOD( "CS-09", DcmCodeString::checkStringValue("MARCO \\ JOERG", "1-2") ) + CHECK_GOOD( "CS-10", DcmCodeString::checkStringValue("MARCO\\ MICHAEL \\JOERG\\") ) + CHECK_BAD ( "CS-11", DcmCodeString::checkStringValue(" 1234567890 ") ) + CHECK_BAD ( "CS-12", DcmCodeString::checkStringValue("1234567890-ABCDE") ) + CHECK_GOOD( "CS-13", DcmCodeString::checkStringValue(" ") ) + CHECK_BAD ( "CS-14", DcmCodeString::checkStringValue(" ") ) + + /* test "Date" */ + CHECK_GOOD( "DA-01", DcmDate::checkStringValue("20090731", "1") ) + CHECK_GOOD( "DA-02", DcmDate::checkStringValue("18200101", "1") ) + CHECK_GOOD( "DA-03", DcmDate::checkStringValue("21001231", "1") ) + CHECK_BAD ( "DA-04", DcmDate::checkStringValue("1820.01.01", "1", OFFalse) ) + CHECK_GOOD( "DA-05", DcmDate::checkStringValue("1820.01.01", "1", OFTrue) ) + CHECK_GOOD( "DA-06", DcmDate::checkStringValue("20090731\\18200101") ) + CHECK_GOOD( "DA-07", DcmDate::checkStringValue("20090731\\18200101", "2-2n") ) + CHECK_GOOD( "DA-08", DcmDate::checkStringValue("20090731\\18200101\\20000101\\21001231", "2-2n") ) + CHECK_BAD ( "DA-09", DcmDate::checkStringValue("20090731", "6") ) + CHECK_BAD ( "DA-10", DcmDate::checkStringValue("20000001", "1") ) + CHECK_BAD ( "DA-11", DcmDate::checkStringValue("00001232", "1") ) + CHECK_BAD ( "DA-12", DcmDate::checkStringValue("20000000", "1") ) + + /* test "Date Time" */ + CHECK_GOOD( "DT-01", DcmDateTime::checkStringValue("200907311230", "1") ) + CHECK_GOOD( "DT-02", DcmDateTime::checkStringValue("18200101000000", "1") ) + CHECK_GOOD( "DT-03", DcmDateTime::checkStringValue("21001231235959.000001", "1") ) + CHECK_GOOD( "DT-04", DcmDateTime::checkStringValue("20090731", "1") ) + CHECK_BAD ( "DT-05", DcmDateTime::checkStringValue("200907312400", "1") ) + CHECK_BAD ( "DT-06", DcmDateTime::checkStringValue("20090731 1200") ) + CHECK_GOOD( "DT-07", DcmDateTime::checkStringValue("2009073100\\1820010112", "2-2n") ) + CHECK_GOOD( "DT-08", DcmDateTime::checkStringValue("2009073100\\1820010112\\200001010030\\21001231171540.123", "2-2n") ) + CHECK_GOOD( "DT-09", DcmDateTime::checkStringValue("200907311230+0100", "1") ) + CHECK_GOOD( "DT-10", DcmDateTime::checkStringValue("20090731123000+1000", "1") ) + CHECK_BAD ( "DT-11", DcmDateTime::checkStringValue("200907311230+1900", "1") ) + CHECK_GOOD( "DT-12", DcmDateTime::checkStringValue("20090731123000.123456+0100", "1") ) + CHECK_BAD ( "DT-13", DcmDateTime::checkStringValue("20090731123000.123456+0100 ", "1") ) + CHECK_GOOD( "DT-14", DcmDateTime::checkStringValue("200907311230", "1") ) + CHECK_GOOD( "DT-15", DcmDateTime::checkStringValue("200907", "1") ) + CHECK_GOOD( "DT-16", DcmDateTime::checkStringValue("2009", "1") ) + CHECK_BAD ( "DT-17", DcmDateTime::checkStringValue("20091", "1") ) + + /* test "Decimal String" */ + CHECK_GOOD( "DS-01", DcmDecimalString::checkStringValue(" 0", "1") ) + CHECK_GOOD( "DS-02", DcmDecimalString::checkStringValue("0.0 ", "1") ) + CHECK_GOOD( "DS-03", DcmDecimalString::checkStringValue("-1", "1") ) + CHECK_GOOD( "DS-04", DcmDecimalString::checkStringValue("+12345.67890", "1") ) + CHECK_BAD ( "DS-05", DcmDecimalString::checkStringValue(" -12345.6789 ", "1") ) + CHECK_GOOD( "DS-06", DcmDecimalString::checkStringValue("01.01", "1") ) + CHECK_BAD ( "DS-06", DcmDecimalString::checkStringValue("0.1.01", "1") ) + CHECK_BAD ( "DS-07", DcmDecimalString::checkStringValue("0 1", "1") ) + CHECK_BAD ( "DS-08", DcmDecimalString::checkStringValue("0-1", "1") ) + CHECK_GOOD( "DS-09", DcmDecimalString::checkStringValue("1.0E99", "1") ) + CHECK_BAD ( "DS-10", DcmDecimalString::checkStringValue("1.099E", "1") ) + CHECK_GOOD( "DS-11", DcmDecimalString::checkStringValue("-10e+99", "1") ) + CHECK_GOOD( "DS-12", DcmDecimalString::checkStringValue("-10e+99\\+1E-1", "2") ) + + /* test "Integer String" */ + CHECK_GOOD( "IS-01", DcmIntegerString::checkStringValue("0", "1") ) + CHECK_GOOD( "IS-02", DcmIntegerString::checkStringValue("+0", "1") ) + CHECK_GOOD( "IS-03", DcmIntegerString::checkStringValue("-0", "1") ) + CHECK_GOOD( "IS-04", DcmIntegerString::checkStringValue("00", "1") ) + CHECK_GOOD( "IS-05", DcmIntegerString::checkStringValue("000000000001", "1") ) + CHECK_BAD ( "IS-06", DcmIntegerString::checkStringValue("1000000000001", "1") ) + CHECK_BAD ( "IS-07", DcmIntegerString::checkStringValue("-000000000001", "1") ) + CHECK_BAD ( "IS-08", DcmIntegerString::checkStringValue("3000000000", "1") ) + CHECK_GOOD( "IS-08", DcmIntegerString::checkStringValue("+2000000000", "1") ) + CHECK_GOOD( "IS-09", DcmIntegerString::checkStringValue("+2147483647", "1") ) + CHECK_BAD ( "IS-10", DcmIntegerString::checkStringValue("2147483648", "1") ) + CHECK_GOOD( "IS-11", DcmIntegerString::checkStringValue("-2147483648", "1") ) + CHECK_BAD ( "IS-12", DcmIntegerString::checkStringValue("-2147483649", "1") ) + CHECK_GOOD( "IS-13", DcmIntegerString::checkStringValue(" -2147483648\\+2147483647 ", "2") ) + CHECK_BAD ( "IS-14", DcmIntegerString::checkStringValue(" -2147483648 \\+2147483647", "2") ) + + /* test "Long String" */ + CHECK_GOOD( "LO-01", DcmLongString::checkStringValue(" ", "1") ) + CHECK_GOOD( "LO-02", DcmLongString::checkStringValue(" . ", "1") ) + CHECK_GOOD( "LO-03", DcmLongString::checkStringValue("ABC 123 abc _+-/", "1") ) + CHECK_GOOD( "LO-04", DcmLongString::checkStringValue(" ", "1") ) + CHECK_GOOD( "LO-05", DcmLongString::checkStringValue("ABC\\123", "2") ) + CHECK_GOOD( "LO-06", DcmLongString::checkStringValue(" J\366rg Riesmeier ", "1", "ISO_IR 100") ) +// maximum length cannot be checked if given in characters (and not bytes) +// CHECK_BAD ( "LO-07", DcmLongString::checkStringValueu("OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany, http://www.offis.de/", "1") ) + CHECK_GOOD( "LO-08", DcmLongString::checkStringValue("\\ _2_ \\ _3_ \\ _4_ \\ _5_ \\", "6") ) + CHECK_GOOD( "LO-09", DcmLongString::checkStringValue("ESC\033aping", "1") ) + CHECK_BAD ( "LO-10", DcmLongString::checkStringValue("not allowed: \r\014", "1") ) + + /* test "Long Text" */ + CHECK_GOOD( "LT-01", DcmLongText::checkStringValue(" Hello \\ 12345 \\ \344\366\374\337 ", "ISO_IR 100") ) + CHECK_GOOD( "LT-02", DcmLongText::checkStringValue(" permitted control characters: \011 \012 \014 \015 ") ) + CHECK_GOOD( "LT-03", DcmLongText::checkStringValue(" ") ) + + /* test "Person Name" */ + CHECK_GOOD( "PN-01", DcmPersonName::checkStringValue("A^Riesmeier^^=R^J\366rg", "1", "ISO_IR 100") ) + CHECK_GOOD( "PN-02", DcmPersonName::checkStringValue("A^Riesmeier^^=R^J\366rg\\", "1-n", "ISO_IR 100") ) + CHECK_BAD ( "PN-03", DcmPersonName::checkStringValue("A^Riesmeier^^=R^J\366rg\\", "1") ) + CHECK_GOOD( "PN-04", DcmPersonName::checkStringValue("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", "1", "ISO_IR 100") ) + CHECK_GOOD( "PN-05", DcmPersonName::checkStringValue("Eichelberg\\Onken\\Riesmeier", "3") ) + CHECK_GOOD( "PN-06", DcmPersonName::checkStringValue(" ") ) + CHECK_GOOD( "PN-07", DcmPersonName::checkStringValue(" A") ) + CHECK_GOOD( "PN-08", DcmPersonName::checkStringValue("^^^^") ) + CHECK_BAD ( "PN-09", DcmPersonName::checkStringValue("^ J\366rg ^") ) + CHECK_GOOD( "PN-10", DcmPersonName::checkStringValue("^^^^MD ") ) + CHECK_BAD ( "PN-11", DcmPersonName::checkStringValue("^^^^^") ) + CHECK_GOOD( "PN-12", DcmPersonName::checkStringValue("A^B^C^D^E=F^G^H^I^J=K^L^M^N^O") ) + /* The almighty DICOM standard says: + * Any component group may be absent, including the first component group. + * In this case, the person name may start with one or more “=” delimiters. + */ + CHECK_GOOD( "PN-13", DcmPersonName::checkStringValue("==Test") ) + CHECK_GOOD( "PN-14", DcmPersonName::checkStringValue("Test==") ) + CHECK_GOOD( "PN-15", DcmPersonName::checkStringValue("==") ) + CHECK_BAD ( "PN-16", DcmPersonName::checkStringValue("===") ) + CHECK_BAD ( "PN-17", DcmPersonName::checkStringValue("^=^=^=^") ) + CHECK_GOOD( "PN-18", DcmPersonName::checkStringValue("^^^^=^^^^=^^^^") ) + CHECK_GOOD( "PN-19", DcmPersonName::checkStringValue("") ) + /* further tests for component groups */ + CHECK_GOOD( "PN-20", DcmPersonName::checkStringValue("Unspecified^^^^=^^^^=^^^^") ) + CHECK_GOOD( "PN-21", DcmPersonName::checkStringValue("^^^^=^^Unspecified^^=^^^^") ) + CHECK_GOOD( "PN-22", DcmPersonName::checkStringValue("^^^^=^^^^=^^^^Unspecified") ) + + /* test "Short String" */ + CHECK_GOOD( "SH-01", DcmShortString::checkStringValue(" ", "1") ) + CHECK_GOOD( "SH-02", DcmShortString::checkStringValue(" . ", "1") ) + CHECK_GOOD( "SH-03", DcmShortString::checkStringValue("ABC 123 abc _+-/", "1") ) + CHECK_GOOD( "SH-04", DcmShortString::checkStringValue(" ", "1") ) + CHECK_GOOD( "SH-05", DcmShortString::checkStringValue("ABC\\123", "2") ) + CHECK_GOOD( "SH-06", DcmShortString::checkStringValue(" J\366rg Riesmeier ", "1", "ISO_IR 100") ) +// maximum length cannot be checked if given in characters (and not bytes) +// CHECK_BAD ( "SH-07", DcmShortString::checkStringValue("OFFIS e.V., Oldenburg", "1") ) + CHECK_GOOD( "SH-08", DcmShortString::checkStringValue("\\ _2_ \\ _3_ \\ _4_ \\ _5_ \\", "6") ) + CHECK_BAD ( "SH-09", DcmShortString::checkStringValue(" ", "2") ) + CHECK_GOOD( "SH-10", DcmShortString::checkStringValue("", "2") ) + CHECK_GOOD( "SH-11", DcmShortString::checkStringValue("ESC\033aping", "1") ) + CHECK_BAD ( "SH-12", DcmShortString::checkStringValue("not allowed: \n\010\r\014", "1") ) + + /* test "Short Text" */ + CHECK_GOOD( "ST-01", DcmShortText::checkStringValue(" umlaut characters are allowed: \304\326\334\344\366\374\naccented characters also: \341\340\351\350\355\354\342\352\364\rand control characters, of course, including \033=ESC ", "ISO_IR 100") ) + CHECK_BAD ( "ST-02", DcmShortText::checkStringValue(" other control characters are not allowed: \013 \010 \200 ") ) + CHECK_GOOD( "ST-03", DcmShortText::checkStringValue(" . ") ) + CHECK_GOOD( "ST-04", DcmShortText::checkStringValue(" ") ) + + /* test "Time" */ + CHECK_GOOD( "TM-01", DcmTime::checkStringValue("0000", "1") ) + CHECK_BAD ( "TM-02", DcmTime::checkStringValue("2400", "1") ) + CHECK_GOOD( "TM-03", DcmTime::checkStringValue("123045", "1") ) + CHECK_GOOD( "TM-04", DcmTime::checkStringValue("235959.123", "1") ) + CHECK_GOOD( "TM-05", DcmTime::checkStringValue("235959.987654", "1") ) + CHECK_BAD ( "TM-06", DcmTime::checkStringValue("000000.0000000", "1") ) + CHECK_GOOD( "TM-07", DcmTime::checkStringValue("1215 ", "1") ) + CHECK_BAD ( "TM-08", DcmTime::checkStringValue(" 1215", "1") ) + CHECK_BAD ( "TM-09", DcmTime::checkStringValue("12 15", "1") ) + CHECK_BAD ( "TM-10", DcmTime::checkStringValue("235959.987654 ", "1") ) + CHECK_GOOD( "TM-11", DcmTime::checkStringValue("0000 \\010101 \\020202.02 \\030303.0303", "4") ) + CHECK_BAD ( "TM-12", DcmTime::checkStringValue("12:30:00.123456", "1", OFFalse) ) + CHECK_GOOD( "TM-13", DcmTime::checkStringValue("12:30:00.123456", "1", OFTrue) ) + CHECK_BAD ( "TM-14", DcmTime::checkStringValue("12:30", "1", OFTrue) ) + CHECK_GOOD( "TM-15", DcmTime::checkStringValue("12 ", "1") ) + CHECK_BAD ( "TM-16", DcmTime::checkStringValue(" ", "1") ) + + /* test "Unlimited Characters" */ + CHECK_GOOD( "UC-01", DcmUnlimitedCharacters::checkStringValue("ABC", "1") ) + CHECK_GOOD( "UC-02", DcmUnlimitedCharacters::checkStringValue("ABC\\123", "2") ) + CHECK_GOOD( "UC-03", DcmUnlimitedCharacters::checkStringValue(" J\366rg Riesmeier ", "1", "ISO_IR 100") ) + CHECK_GOOD( "UC-04", DcmUnlimitedCharacters::checkStringValue("ESC\033aping", "1") ) + CHECK_BAD ( "UC-05", DcmUnlimitedCharacters::checkStringValue("not allowed: \n\010\r\014", "1") ) + CHECK_GOOD( "UC-06", DcmUnlimitedCharacters::checkStringValue(" ", "1") ) + CHECK_GOOD( "UC-07", DcmUnlimitedCharacters::checkStringValue("A\\B", "2") ) + + /* test "Unique Identifier" */ + CHECK_GOOD( "UI-01", DcmUniqueIdentifier::checkStringValue("0", "1") ) + CHECK_GOOD( "UI-02", DcmUniqueIdentifier::checkStringValue("0.1", "1") ) + CHECK_GOOD( "UI-03", DcmUniqueIdentifier::checkStringValue("1.2.3.4.5.6.7.8.9.0.123.4321", "1") ) + CHECK_BAD ( "UI-04", DcmUniqueIdentifier::checkStringValue("1.02", "1") ) + CHECK_BAD ( "UI-05", DcmUniqueIdentifier::checkStringValue(".2", "1") ) + CHECK_BAD ( "UI-06", DcmUniqueIdentifier::checkStringValue("1.", "1") ) + CHECK_BAD ( "UI-07", DcmUniqueIdentifier::checkStringValue("1.2.3.4.5.6.7.8.9.0 ", "1") ) + CHECK_BAD ( "UI-08", DcmUniqueIdentifier::checkStringValue(" 1.2.3.4.5.6.7.8.9.0", "1") ) + CHECK_BAD ( "UI-09", DcmUniqueIdentifier::checkStringValue("1.2.3.4.5. 6.7.8.9.0", "1") ) + CHECK_GOOD( "UI-10", DcmUniqueIdentifier::checkStringValue("1.2.3.4.5.6.7.8.9.0\\99", "2") ) + CHECK_GOOD( "UI-11", DcmUniqueIdentifier::checkStringValue("1.2.3.4.5.6.7.8.9.0.123.456.789.0.111222333444555666777888999000", "1") ) + CHECK_BAD ( "UI-12", DcmUniqueIdentifier::checkStringValue("1.2.3.4.5.6.7.8.9.0.123.456.789.10.111222333444555666777888999000", "1") ) + CHECK_BAD ( "UI-13", DcmUniqueIdentifier::checkStringValue("007", "1") ) + + /* test "Universal Resource Identifier or Universal Resource Locator (URI/URL)" */ + CHECK_GOOD( "UR-01", DcmUniversalResourceIdentifierOrLocator::checkStringValue("http://www.dcmtk.org/ ") ) + CHECK_BAD ( "UR-02", DcmUniversalResourceIdentifierOrLocator::checkStringValue(" http://www.dcmtk.org/") ) + CHECK_BAD ( "UR-03", DcmUniversalResourceIdentifierOrLocator::checkStringValue("http:\\\\www.dcmtk.org") ) + CHECK_BAD ( "UR-04", DcmUniversalResourceIdentifierOrLocator::checkStringValue("http://localhost/some space") ) + CHECK_GOOD( "UR-05", DcmUniversalResourceIdentifierOrLocator::checkStringValue("http://localhost/some%20space") ) + CHECK_GOOD( "UR-06", DcmUniversalResourceIdentifierOrLocator::checkStringValue("foo://example.com:8042/over/there?name=ferret#nose") ) + CHECK_GOOD( "UR-07", DcmUniversalResourceIdentifierOrLocator::checkStringValue("urn:example:animal:ferret:nose") ) + CHECK_GOOD( "UR-08", DcmUniversalResourceIdentifierOrLocator::checkStringValue("http://joe:passwd@www.example.net:8080/index.html?action=something&session=A54C6FE2#info") ) + + /* test "Unlimited Text" */ + OFString hugeString(1024 * 512, 'n'); + + CHECK_GOOD( "UT-01", DcmUnlimitedText::checkStringValue(" This text can be pretty long ... ") ) + CHECK_GOOD( "UT-02", DcmUnlimitedText::checkStringValue(hugeString) ) + + hugeString[hugeString.length() / 2] = '\t'; + CHECK_GOOD( "UT-03", DcmUnlimitedText::checkStringValue(hugeString) ) + + hugeString[hugeString.length() - 1] = '\v'; + CHECK_BAD ( "UT-04", DcmUnlimitedText::checkStringValue(hugeString) ) +} diff --git a/dcmdata/tests/tdict.cc b/dcmdata/tests/tdict.cc new file mode 100644 index 00000000..13e690d0 --- /dev/null +++ b/dcmdata/tests/tdict.cc @@ -0,0 +1,117 @@ +/* + * + * Copyright (C) 2011-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: test program for the data dictionary + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcdicent.h" + +OFTEST(dcmdata_readingDataDictionary) +{ + // Does loading the global data dictionary work? + OFCHECK(dcmDataDict.isDictionaryLoaded()); +} + +OFTEST(dcmdata_usingDataDictionary) +{ + // All tests run with an DCMDICTPATH external dictionary defined. This test + // expects an empty dictionary though, so we disable the DCMDICTPATH + // dictionary in this test by unsetting the environment variable. +#ifdef _WIN32 + _putenv_s("DCMDICTPATH", ""); +#else + setenv("DCMDICTPATH","", 1 /* overwrite */); +#endif + + // This dictionary will only contain the skeleton entries + DcmDataDictionary localDict(OFFalse, OFFalse); + DcmDictEntry *entry1; + DcmDictEntry *entry2; + const char *name = "TestEntry"; + const char *creator = "Test"; + DcmTagKey key1(2, 2); + DcmTagKey key2(4, 5); + int entries; + +#define checkDictionary(num_entries, e_name, key1_c, key2_c, key1_nc, key2_nc) \ + entries = localDict.numberOfNormalTagEntries(); \ + entries += localDict.numberOfRepeatingTagEntries(); \ + OFCHECK_EQUAL(localDict.numberOfSkeletonEntries() + num_entries, entries); \ + OFCHECK_EQUAL(localDict.numberOfEntries(), num_entries); \ + OFCHECK(!localDict.isDictionaryLoaded()); \ + OFCHECK(localDict.findEntry("UnexistingEntry") == NULL); \ + OFCHECK(localDict.findEntry(name) == e_name); \ + OFCHECK(localDict.findEntry(key1, creator) == key1_c); \ + OFCHECK(localDict.findEntry(key2, creator) == key2_c); \ + OFCHECK(localDict.findEntry(key1, NULL) == key1_nc); \ + OFCHECK(localDict.findEntry(key2, NULL) == key2_nc); + + checkDictionary(0, NULL, NULL, NULL, NULL, NULL); + + entry1 = new DcmDictEntry(2, 2, DcmVR(EVR_PN), name, 0, 1, + "test", OFTrue, "Test"); + entry2 = new DcmDictEntry(4, 4, 4, 6, DcmVR(EVR_PN), name, 0, 1, + "test", OFTrue, "Test"); + localDict.addEntry(entry1); + localDict.addEntry(entry2); + + checkDictionary(2, entry1, entry1, entry2, NULL, NULL); + + // This also gets rid of the skeleton entries! + localDict.clear(); + + OFCHECK_EQUAL(localDict.numberOfNormalTagEntries(), 0); + OFCHECK_EQUAL(localDict.numberOfRepeatingTagEntries(), 0); + OFCHECK_EQUAL(localDict.numberOfSkeletonEntries(), 0); + OFCHECK_EQUAL(localDict.numberOfEntries(), 0); + + checkDictionary(0, NULL, NULL, NULL, NULL, NULL); + + // Load the skeleton dictionary again + OFCHECK(localDict.reloadDictionaries(OFFalse, OFFalse)); + + checkDictionary(0, NULL, NULL, NULL, NULL, NULL); + + entry1 = new DcmDictEntry(2, 2, DcmVR(EVR_PN), name, 0, 1, + "test", OFTrue, NULL); + entry2 = new DcmDictEntry(4, 4, 4, 6, DcmVR(EVR_PN), name, 0, 1, + "test", OFTrue, NULL); + localDict.addEntry(entry1); + localDict.addEntry(entry2); + + checkDictionary(2, entry1, NULL, NULL, entry1, entry2); + + // Now we will overwrite entries + entry1 = new DcmDictEntry(2, 2, DcmVR(EVR_PN), "overwritten", 0, 1, + "test", OFTrue, NULL); + entry2 = new DcmDictEntry(4, 4, 4, 6, DcmVR(EVR_PN), "overwritten", 0, 1, + "test", OFTrue, NULL); + localDict.addEntry(entry1); + localDict.addEntry(entry2); + + checkDictionary(2, NULL, NULL, NULL, entry1, entry2); + +#undef checkDictionary +} diff --git a/dcmdata/tests/telemlen.cc b/dcmdata/tests/telemlen.cc new file mode 100644 index 00000000..d275eff8 --- /dev/null +++ b/dcmdata/tests/telemlen.cc @@ -0,0 +1,159 @@ +/* + * + * Copyright (C) 2011-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: test program for DcmElement::calcElementLength + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/dcostrmb.h" + + +static void testElementLengthForElem(DcmElement& elem, const char *type, + offile_off_t len) +{ + const int maxSize = 100; + Uint8 buf[maxSize]; + DcmOutputBufferStream stream(buf, maxSize); + void *unused; + offile_off_t length; + OFCondition cond; + + elem.transferInit(); + cond = elem.write(stream, EXS_LittleEndianExplicit, EET_ExplicitLength, NULL); + elem.transferEnd(); + + stream.flushBuffer(unused, length); + if (cond.bad()) + OFCHECK_FAIL("Failed to write element " << type << " to stream: " << cond.text()); + if (length != len) + { + OFCHECK_FAIL("Expected length (" << OFstatic_cast(size_t, len) + << "), but got (" << OFstatic_cast(size_t, length) + << ") while writing " << type); + } + + length = elem.calcElementLength(EXS_LittleEndianExplicit, EET_ExplicitLength); + if (length != len) + { + OFCHECK_FAIL("Expected length (" << OFstatic_cast(size_t, len) + << "), but got (" << OFstatic_cast(size_t, length) + << ") while handling " << type); + } +} + +static void testElementLengthForVR(DcmEVR vr, offile_off_t len) +{ + const DcmTag tag(DCM_PatientName, vr); + + // Test all the calcElementLength and write implementations + DcmUnlimitedText ut(tag); + DcmByteString bs(tag); + DcmPixelData pd(tag); + DcmPolymorphOBOW po(tag); + DcmSequenceOfItems sq(tag); + DcmOtherByteOtherWord oo(tag); + + // Make sure the PixelData assumes it is un-encapsulated, else + // calcElementLength() will fail (Yes, this is a hack) + pd.putUint8Array(NULL, 0); + pd.setVR(vr); + + testElementLengthForElem(ut, "UnlimitedText", len); + testElementLengthForElem(bs, "ByteString", len); + testElementLengthForElem(pd, "PixelData", len); + testElementLengthForElem(po, "PolymorphOBOW", len); + testElementLengthForElem(sq, "SequenceOfItems", len); + testElementLengthForElem(oo, "OtherByteOtherWord", len); +} + +// These don't make sense to be tested: EVR_item, EVR_metainfo, +// EVR_dataset, EVR_fileFormat, EVR_dicomDir, EVR_dirRecord, EVR_pixelSQ + +OFTEST(dcmdata_elementLength_pixelItem) +{ + // EVR_pixelItem only makes sense for class DcmPixelItem. + // In fact, it enforces that VR in the constructor. + const DcmTag tag(DCM_PatientName, EVR_pixelItem); + DcmPixelItem pi(tag); + testElementLengthForElem(pi, "PixelItem", 8); +} + +OFTEST(dcmdata_elementLength_pixelSequence) +{ + // DcmPixelSequence forces EVR_OB, no point in trying other VRs. + const DcmTag tag(DCM_PatientName, EVR_OB); + DcmPixelSequence ps(tag); + testElementLengthForElem(ps, "PixelSeq", 20); +} + +/* Test extended length VRs */ +#define TEST_VR(vr) OFTEST(dcmdata_elementLength_ ## vr) { testElementLengthForVR(vr, 12); } +TEST_VR(EVR_OB) +TEST_VR(EVR_OD) +TEST_VR(EVR_OF) +TEST_VR(EVR_OL) +TEST_VR(EVR_OV) +TEST_VR(EVR_OW) +TEST_VR(EVR_SV) +TEST_VR(EVR_UV) +TEST_VR(EVR_SQ) +TEST_VR(EVR_UC) +TEST_VR(EVR_UR) +TEST_VR(EVR_UT) +TEST_VR(EVR_ox) +TEST_VR(EVR_lt) +TEST_VR(EVR_UNKNOWN) +TEST_VR(EVR_UN) +/* Converted to UN during write */ +TEST_VR(EVR_na) +TEST_VR(EVR_UNKNOWN2B) +#undef TEST_VR + +/* Test "short" length VRs */ +#define TEST_VR(vr) OFTEST(dcmdata_elementLength_ ## vr) { testElementLengthForVR(vr, 8); } +TEST_VR(EVR_AE) +TEST_VR(EVR_AS) +TEST_VR(EVR_AT) +TEST_VR(EVR_CS) +TEST_VR(EVR_DA) +TEST_VR(EVR_DS) +TEST_VR(EVR_DT) +TEST_VR(EVR_FL) +TEST_VR(EVR_FD) +TEST_VR(EVR_IS) +TEST_VR(EVR_LO) +TEST_VR(EVR_PN) +TEST_VR(EVR_SH) +TEST_VR(EVR_SL) +TEST_VR(EVR_SS) +TEST_VR(EVR_ST) +TEST_VR(EVR_TM) +TEST_VR(EVR_UI) +TEST_VR(EVR_UL) +TEST_VR(EVR_US) +TEST_VR(EVR_xs) +TEST_VR(EVR_LT) +TEST_VR(EVR_up) +TEST_VR(EVR_PixelData) +TEST_VR(EVR_OverlayData) +#undef TEST_VR diff --git a/dcmdata/tests/tests.cc b/dcmdata/tests/tests.cc new file mode 100644 index 00000000..f6cb826e --- /dev/null +++ b/dcmdata/tests/tests.cc @@ -0,0 +1,115 @@ +/* + * + * Copyright (C) 2011-2019 OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: main test program + * + */ + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/oftest.h" + +OFTEST_REGISTER(dcmdata_partialElementAccess); +OFTEST_REGISTER(dcmdata_i2d_bmp); +OFTEST_REGISTER(dcmdata_checkStringValue); +OFTEST_REGISTER(dcmdata_determineVM); +OFTEST_REGISTER(dcmdata_getValueFromString); +OFTEST_REGISTER(dcmdata_pathAccess); +OFTEST_REGISTER(dcmdata_dateTime); +OFTEST_REGISTER(dcmdata_decimalString_1); +OFTEST_REGISTER(dcmdata_decimalString_2); +OFTEST_REGISTER(dcmdata_decimalString_3); +OFTEST_REGISTER(dcmdata_decimalString_4); +OFTEST_REGISTER(dcmdata_floatingPointDouble); +OFTEST_REGISTER(dcmdata_personName); +OFTEST_REGISTER(dcmdata_uniqueIdentifier_1); +OFTEST_REGISTER(dcmdata_uniqueIdentifier_2); +OFTEST_REGISTER(dcmdata_otherLong); +OFTEST_REGISTER(dcmdata_other64bitVeryLong); +OFTEST_REGISTER(dcmdata_signed64bitVeryLong); +OFTEST_REGISTER(dcmdata_unsigned64bitVeryLong); +OFTEST_REGISTER(dcmdata_VRCompare); +OFTEST_REGISTER(dcmdata_elementLength_EVR_AE); +OFTEST_REGISTER(dcmdata_elementLength_EVR_AS); +OFTEST_REGISTER(dcmdata_elementLength_EVR_AT); +OFTEST_REGISTER(dcmdata_elementLength_EVR_CS); +OFTEST_REGISTER(dcmdata_elementLength_EVR_DA); +OFTEST_REGISTER(dcmdata_elementLength_EVR_DS); +OFTEST_REGISTER(dcmdata_elementLength_EVR_DT); +OFTEST_REGISTER(dcmdata_elementLength_EVR_FD); +OFTEST_REGISTER(dcmdata_elementLength_EVR_FL); +OFTEST_REGISTER(dcmdata_elementLength_EVR_IS); +OFTEST_REGISTER(dcmdata_elementLength_EVR_LO); +OFTEST_REGISTER(dcmdata_elementLength_EVR_LT); +OFTEST_REGISTER(dcmdata_elementLength_EVR_OB); +OFTEST_REGISTER(dcmdata_elementLength_EVR_OD); +OFTEST_REGISTER(dcmdata_elementLength_EVR_OF); +OFTEST_REGISTER(dcmdata_elementLength_EVR_OL); +OFTEST_REGISTER(dcmdata_elementLength_EVR_OV); +OFTEST_REGISTER(dcmdata_elementLength_EVR_OW); +OFTEST_REGISTER(dcmdata_elementLength_EVR_OverlayData); +OFTEST_REGISTER(dcmdata_elementLength_EVR_PN); +OFTEST_REGISTER(dcmdata_elementLength_EVR_PixelData); +OFTEST_REGISTER(dcmdata_elementLength_EVR_SH); +OFTEST_REGISTER(dcmdata_elementLength_EVR_SL); +OFTEST_REGISTER(dcmdata_elementLength_EVR_SQ); +OFTEST_REGISTER(dcmdata_elementLength_EVR_SS); +OFTEST_REGISTER(dcmdata_elementLength_EVR_ST); +OFTEST_REGISTER(dcmdata_elementLength_EVR_SV); +OFTEST_REGISTER(dcmdata_elementLength_EVR_TM); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UC); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UI); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UL); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UN); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UNKNOWN); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UNKNOWN2B); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UR); +OFTEST_REGISTER(dcmdata_elementLength_EVR_US); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UV); +OFTEST_REGISTER(dcmdata_elementLength_EVR_UT); +OFTEST_REGISTER(dcmdata_elementLength_EVR_lt); +OFTEST_REGISTER(dcmdata_elementLength_EVR_na); +OFTEST_REGISTER(dcmdata_elementLength_EVR_ox); +OFTEST_REGISTER(dcmdata_elementLength_EVR_up); +OFTEST_REGISTER(dcmdata_elementLength_EVR_xs); +OFTEST_REGISTER(dcmdata_elementLength_pixelItem); +OFTEST_REGISTER(dcmdata_elementLength_pixelSequence); +OFTEST_REGISTER(dcmdata_elementParent); +OFTEST_REGISTER(dcmdata_parser_missingDelimitationItems); +OFTEST_REGISTER(dcmdata_parser_missingSequenceDelimitationItem_1); +OFTEST_REGISTER(dcmdata_parser_missingSequenceDelimitationItem_2); +OFTEST_REGISTER(dcmdata_parser_wrongDelimitationItemForSequence); +OFTEST_REGISTER(dcmdata_parser_wrongDelimitationItemForItem); +OFTEST_REGISTER(dcmdata_parser_explicitItemLengthTooLarge); +OFTEST_REGISTER(dcmdata_parser_oddLengthPartialValue_lastItem); +OFTEST_REGISTER(dcmdata_parser_oddLengthPartialValue_notLastItem); +OFTEST_REGISTER(dcmdata_parser_wrongExplicitVRinDataset_default); +OFTEST_REGISTER(dcmdata_parser_wrongExplicitVRinDataset_defaultVR_dictLen); +OFTEST_REGISTER(dcmdata_parser_wrongExplicitVRinDataset_dictVR_defaultLen); +OFTEST_REGISTER(dcmdata_parser_wrongExplicitVRinDataset_preferDataDict); +OFTEST_REGISTER(dcmdata_parser_undefinedLengthUNSequence); +OFTEST_REGISTER(dcmdata_readingDataDictionary); +OFTEST_REGISTER(dcmdata_usingDataDictionary); +OFTEST_REGISTER(dcmdata_specificCharacterSet_1); +OFTEST_REGISTER(dcmdata_specificCharacterSet_2); +OFTEST_REGISTER(dcmdata_specificCharacterSet_3); +OFTEST_REGISTER(dcmdata_specificCharacterSet_4); +OFTEST_REGISTER(dcmdata_attribute_filter); +OFTEST_REGISTER(dcmdata_attribute_matching); +OFTEST_REGISTER(dcmdata_newDicomElementPrivate); +OFTEST_REGISTER(dcmdata_generateUniqueIdentifier); +OFTEST_MAIN("dcmdata") diff --git a/dcmdata/tests/tfilter.cc b/dcmdata/tests/tfilter.cc new file mode 100644 index 00000000..9370f302 --- /dev/null +++ b/dcmdata/tests/tfilter.cc @@ -0,0 +1,78 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Jan Schlamelcher + * + * Purpose: test program for class DcmAttributeFilter + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcfilter.h" + + +OFTEST( dcmdata_attribute_filter ) +{ + DcmAttributeFilter ct_filter( DCM_SOPClassUID, UID_CTImageStorage ); + DcmItem item; + + item.putAndInsertString( DCM_SOPClassUID, UID_CTImageStorage ); + OFCHECK( ct_filter( item ) ); // test filter matches + item.putAndInsertString( DCM_SOPClassUID, UID_ComputedRadiographyImageStorage ); + OFCHECK( !ct_filter( item ) ); // test filter fails + // test anonymous filter object + OFCHECK( DcmAttributeFilter( DCM_SOPClassUID, UID_ComputedRadiographyImageStorage )( item ) ); + +#if !defined(_MSC_VER) || _MSC_VER > 1200 // iterator based filters not supported for VS <= 6.0. + // test iterator (array) based range + const char* filter_range[3] = + { + UID_ComputedRadiographyImageStorage, + UID_CTImageStorage, + UID_MRImageStorage + }; + + // create filter from range (iterators) + DcmAttributeFilter cr_ct_mr_filter( DCM_SOPClassUID, filter_range + 0, filter_range + 3 ); + + // test container-based (OFVector) range + OFVector filter_vector; + filter_vector.push_back( UID_CTImageStorage ); + filter_vector.push_back( UID_MRImageStorage ); + + // create filter from range (container) + DcmAttributeFilter ct_mr_filter( DCM_SOPClassUID, filter_vector ); + + // test all range-based filters + OFCHECK( cr_ct_mr_filter( item ) ); + OFCHECK( !ct_mr_filter( item ) ); + item.putAndInsertString( DCM_SOPClassUID, UID_CTImageStorage ); + OFCHECK( cr_ct_mr_filter( item ) ); + OFCHECK( ct_mr_filter( item ) ); + item.putAndInsertString( DCM_SOPClassUID, UID_MRImageStorage ); + OFCHECK( cr_ct_mr_filter( item ) ); + OFCHECK( ct_mr_filter( item ) ); + item.putAndInsertString( DCM_SOPClassUID, UID_EnhancedCTImageStorage ); + OFCHECK( !cr_ct_mr_filter( item ) ); +#endif + + OFCHECK( DcmAttributeFilter()( item ) ); // test default constructed (allow any) filter. +} diff --git a/dcmdata/tests/tgenuid.cc b/dcmdata/tests/tgenuid.cc new file mode 100644 index 00000000..9830dbfc --- /dev/null +++ b/dcmdata/tests/tgenuid.cc @@ -0,0 +1,56 @@ +/* + * + * Copyright (C) 2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: test program for function dcmGenerateUniqueIdentifier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcuid.h" + + +OFTEST(dcmdata_generateUniqueIdentifier) +{ + // test generation of UIDs. We generate 10000 UIDs in quick + // succession and check if they are pair-wise different. + // This will also catch any application error during UID generation. + + char uid[65]; + OFString previousuid; + + // This variable name will be printed on the console if the test fails. + // In fact a generated UID is not unique if this variable is false! + OFBool generated_uid_is_not_unique; + + for (size_t i = 0; i < 10000; ++i) + { + // generate UID + dcmGenerateUniqueIdentifier(uid); + + // compare with the previously generated UID, should be different. + generated_uid_is_not_unique = (previousuid != uid); + OFCHECK(generated_uid_is_not_unique); + previousuid = uid; + + // if we have found a non-unique UID, the test has failed. + // Break out of the loop. + if (! generated_uid_is_not_unique) break; + } +} diff --git a/dcmdata/tests/ti2dbmp.cc b/dcmdata/tests/ti2dbmp.cc new file mode 100644 index 00000000..74d5ec4b --- /dev/null +++ b/dcmdata/tests/ti2dbmp.cc @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2010-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: test program for class I2DBmpSource + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/libi2d/i2dbmps.h" + +static OFLogger i2dbmpLogger = OFLog::getLogger("dcmtk.test.i2dbmp"); + +enum offset { + BMP_IMAGE_OFFSET = 10, + BMP_WIDTH = 18, + BMP_HEIGHT = 22, + // BPP is only 2 bytes wide! + BMP_BPP = 28, + BMP_COLORS = 46 +}; + +// temporary file which will be used +static const char *temporaryFile = "i2dbmp.tmp"; + +static Uint8 bmpHeader[] = { + // Offset 0, Magic identification number + 'B', 'M', + // 2, File size, most likely wrong anyway + 42, 0x42, 13, 37, + // 6, Reservered + 0x13, 0x37, 0xde, 0xad, + // 10, Offset of the image data from start of data, this is IMPORTANT + 0, 0, 0, 0, + // 14, value is 40, the size of the BITMAPINFOHEADER struct (the following data) + 40, 0, 0, 0, + // 18, Width of the image + 0, 0, 0, 0, + // 22, height of image, if this is negative it's a top-down image + 0, 0, 0, 0, + // 26, number of planes, always 1 in BMP + 1, 0, + // 28, Bit depth + 24, 0, + // 30, compression info + 0, 0, 0, 0, + // 34, zero or size of image data in bytes + 12, 11, 10, 9, + // 38, X pixels per meter + 8, 7, 6, 5, + // 42, X pixels per meter + 4, 3, 2, 1, + // 46, colors used, 0 means the default value + 5, 0, 0, 0, + // 50, number of important colors, this field is useless + 1, 2, 3, 4, + + // Now comes the color table, this one gives us just some colors (the fourth + // byte is unused, let's write some garbage into it) + // color 0, black + 0x00, 0x00, 0x00, 18, + // color 1, blue + 0xff, 0x00, 0x00, 97, + // color 2, green + 0x00, 0xff, 0x00, 123, + // color 3, red + 0x00, 0x00, 0xff, 93, + // color 4, white + 0xff, 0xff, 0xff, 30, + + // Now you'd get the actual pixel data +}; + +#define LOG_DEBUG(arg) OFLOG_DEBUG(i2dbmpLogger, arg) +#define TEST(arg) LOG_DEBUG(arg << "...") + +#define EXPECT_SUCCESS(b) OFCHECK(b) +#define EXPECT_FAIL(b) EXPECT_SUCCESS(!(b)) + +static void setDWord(int offset, int width, bool sign = false) +{ + Uint32 w = width; + if (sign) + w = ~w + 1; + + for (int i = 0; i < 4; i++) + { + bmpHeader[offset++] = OFstatic_cast(Uint8, w & 0xff); + w >>= 8; + } +} + +static bool writeImage(const void *pixelData, unsigned int pixelDataLength) +{ + OFFile file; + if (!file.fopen(temporaryFile, "wb")) + { + OFCHECK_FAIL("Failed to open temporary file " << temporaryFile); + return false; + } + + file.fwrite(bmpHeader, 1, sizeof(bmpHeader)); + if (pixelData != NULL) + file.fwrite(pixelData, 1, pixelDataLength); + file.fclose(); + + return true; +} + +static bool readFile(char *&pixData, Uint32 &outputLength, Uint16 &rows, Uint16 &cols) +{ + I2DBmpSource source; + Uint16 samplesPerPixel, bitsAlloc, bitsStored; + Uint16 highBit, pixelRepr, planConf, pixAspectH, pixAspectV; + OFString photoMetrInt; + E_TransferSyntax ts; + + source.setImageFile(temporaryFile); + OFCondition res = source.readPixelData(rows, cols, samplesPerPixel, photoMetrInt, + bitsAlloc, bitsStored, highBit, pixelRepr, + planConf, pixAspectH, pixAspectV, pixData, + outputLength, ts); + if (res.bad()) + { + LOG_DEBUG("Reading file failed: " << res.text()); + return false; + } + + return true; +} + +static bool canHandleImage(const void *pixelData, unsigned int pixelDataLength) +{ + if (!writeImage(pixelData, pixelDataLength)) + return false; + + char *pixData; + Uint32 length; + Uint16 rows, cols; + + if (!readFile(pixData, length, rows, cols)) + return false; + + return true; +} + +static bool compareImage(const void *pixelData, unsigned int pixelDataLength, + void *expectedOutput, unsigned int expectedOutputLength, + Uint16 width, Uint16 height) +{ + if (!writeImage(pixelData, pixelDataLength)) + return false; + + char *pixData; + Uint32 length; + Uint16 rows, cols; + + if (!readFile(pixData, length, rows, cols)) + return false; + + if (expectedOutputLength != length) + { + LOG_DEBUG("Output length does not match!"); + delete[] pixData; + return false; + } + if (memcmp(expectedOutput, pixData, expectedOutputLength) != 0) + { + LOG_DEBUG("Output data does not match!"); + delete[] pixData; + return false; + } + + delete[] pixData; + + if (width != cols) + { + LOG_DEBUG("Output width does not match!"); + return false; + } + if (height != rows) + { + LOG_DEBUG("Output height does not match!"); + return false; + } + + return true; +} + +OFTEST(dcmdata_i2d_bmp) +{ + // This pixel data is used for all tests with at least 16bpp + Uint8 pixelData1[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 }; + Uint8 expected1a[] = { 0x77, 0x66, 0x55, 0x33, 0x22, 0x11 }; // 32/24bpp, 1x2, bottom-up + Uint8 expected1b[] = { 0x33, 0x22, 0x11, 0x77, 0x66, 0x55 }; // 32/24bpp, 1x2, top-down + Uint8 expected1c[] = { 0x33, 0x22, 0x11, 0x66, 0x55, 0x44 }; // 24bpp, 2x1, bottom-up + Uint8 expected1d[] = { 0xc8, 0x90, 0xa8, 0x10, 0x18, 0xb8, + 0x40, 0x80, 0x88, 0x88, 0x08, 0x98, + }; // 16bpp, 2x2, top-down + + // These are the values of the color table +#define BLACK 0x00, 0x00, 0x00 +#define BLUE 0x00, 0x00, 0xff +#define GREEN 0x00, 0xff, 0x00 +#define RED 0xff, 0x00, 0x00 +#define WHITE 0xff, 0xff, 0xff + + Uint8 pixelData2[] = { 0, 1, 2, 3, 4, 3, 2, 1 }; + Uint8 expected2[] = { BLACK, BLUE, GREEN, WHITE, RED, GREEN }; // 8bpp, 3x2, top-down + + // Only byte 0 and 4 are actually used + Uint8 pixelData3[] = { 0x40, 0xff, 0xff, 0xff, 0x32, 0xff, 0xff, 0xff }; + Uint8 expected3[] = { RED, GREEN, WHITE, BLACK }; // 4bpp, 2x2, bottom-up + + /* Only first three *bits* of byte 0 and 4 are important, + * thanks to the 4 byte alignment requirement for rows. + */ + Uint8 pixelData4[] = { 0xaf, 0xff, 0x00, 0xad, 0x80, 0xde, 0xad, 0xab }; + Uint8 expected4[] = { BLUE, BLACK, BLACK, BLUE, BLACK, BLUE }; // 1bpp, 3x2, bottom-up + +#undef BLACK +#undef BLUE +#undef GREEN +#undef RED +#undef WHITE + + setDWord(BMP_IMAGE_OFFSET, OFstatic_cast(int, sizeof(bmpHeader))); + + TEST("Trying to read a 0x0 image"); + setDWord(BMP_WIDTH, 0); + setDWord(BMP_HEIGHT, 0); + EXPECT_FAIL(canHandleImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)))); + setDWord(BMP_WIDTH, 1); + setDWord(BMP_HEIGHT, 2); + + TEST("Checking large bpp values"); + bmpHeader[BMP_BPP ] = 0; + bmpHeader[BMP_BPP + 1] = 0xef; + EXPECT_FAIL(canHandleImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)))); + bmpHeader[BMP_BPP ] = 32; + bmpHeader[BMP_BPP + 1] = 0; + + TEST("Checking large number of colors"); + setDWord(BMP_COLORS, 1 << 31); + EXPECT_FAIL(canHandleImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)))); + setDWord(BMP_COLORS, 5); + + TEST("Checking premature end of file"); + EXPECT_FAIL(canHandleImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)) - 1)); + + TEST("Decoding a 32bpp image"); + EXPECT_SUCCESS(compareImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)), expected1a, OFstatic_cast(Uint32, sizeof(expected1a)), 1, 2)); + + TEST("Decoding a 24bpp image"); + // Because rows are aligned to 4-bytes boundaries, this can use the + // same pixel data as the 32bpp image + bmpHeader[BMP_BPP] = 24; + EXPECT_SUCCESS(compareImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)), expected1a, OFstatic_cast(Uint32, sizeof(expected1a)), 1, 2)); + + TEST("Decoding a 24bpp top-down image"); + setDWord(BMP_HEIGHT, -2); + EXPECT_SUCCESS(compareImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)), expected1b, OFstatic_cast(Uint32, sizeof(expected1b)), 1, 2)); + + TEST("Checking correct handling of row alignment"); + setDWord(BMP_WIDTH, 2); + setDWord(BMP_HEIGHT, 1); + EXPECT_SUCCESS(compareImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)), expected1c, OFstatic_cast(Uint32, sizeof(expected1c)), 2, 1)); + + TEST("Decoding a 16bpp image"); + bmpHeader[BMP_BPP] = 16; + setDWord(BMP_WIDTH, 2); + setDWord(BMP_HEIGHT, 2); + EXPECT_SUCCESS(compareImage(pixelData1, OFstatic_cast(Uint32, sizeof(pixelData1)), expected1d, OFstatic_cast(Uint32, sizeof(expected1d)), 2, 2)); + + // Everything starting from 8bpp uses color tables! + TEST("Decoding a 8bpp top-down image"); + setDWord(BMP_WIDTH, 3); + setDWord(BMP_HEIGHT, -2); + bmpHeader[BMP_BPP] = 8; + EXPECT_SUCCESS(compareImage(pixelData2, OFstatic_cast(Uint32, sizeof(pixelData2)), expected2, OFstatic_cast(Uint32, sizeof(expected2)), 3, 2)); + + TEST("Decoding a 4bpp image"); + bmpHeader[BMP_BPP] = 4; + setDWord(BMP_WIDTH, 2); + setDWord(BMP_HEIGHT, 2); + EXPECT_SUCCESS(compareImage(pixelData3, OFstatic_cast(Uint32, sizeof(pixelData3)), expected3, OFstatic_cast(Uint32, sizeof(expected3)), 2, 2)); + + TEST("Decoding a 1bpp image"); + bmpHeader[BMP_BPP] = 1; + setDWord(BMP_WIDTH, 3); + setDWord(BMP_HEIGHT, 2); + EXPECT_SUCCESS(compareImage(pixelData4, OFstatic_cast(Uint32, sizeof(pixelData4)), expected4, OFstatic_cast(Uint32, sizeof(expected4)), 3, 2)); + + TEST("Decoding an image with too large color table"); + setDWord(BMP_COLORS, -1); + EXPECT_FAIL(canHandleImage(pixelData4, OFstatic_cast(Uint32, sizeof(pixelData4)))); + + TEST("Decoding an image with too small color table"); + setDWord(BMP_COLORS, 1); + EXPECT_FAIL(canHandleImage(pixelData4, OFstatic_cast(Uint32, sizeof(pixelData4)))); + + /* Remove our temporary file */ + unlink(temporaryFile); +} diff --git a/dcmdata/tests/tmatch.cc b/dcmdata/tests/tmatch.cc new file mode 100644 index 00000000..643a9e48 --- /dev/null +++ b/dcmdata/tests/tmatch.cc @@ -0,0 +1,165 @@ +/* + * + * Copyright (C) 2017-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Jan Schlamelcher + * + * Purpose: unit test for DcmAttributeMatching + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcvr.h" +#include "dcmtk/dcmdata/dcmatch.h" + +static OFBool test_singlevalue( const char* const query, const char* const candidate ) +{ + return DcmAttributeMatching::singleValueMatching( query, strlen( query ), candidate, strlen( candidate ) ); +} + +static OFBool test_wildcards( const char* const query, const char* const candidate ) +{ + return DcmAttributeMatching::wildCardMatching( query, strlen( query ), candidate, strlen( candidate ) ); +} + +static OFBool test_date( const char* const query ) +{ + return DcmAttributeMatching::isDateQuery( query, strlen( query ) ); +} + +static OFBool test_date( const char* const query, const char* const candidate ) +{ + return DcmAttributeMatching::rangeMatchingDate( query, strlen( query ), candidate, strlen( candidate ) ); +} + +static OFBool test_time( const char* const query ) +{ + return DcmAttributeMatching::isTimeQuery( query, strlen( query ) ); +} + +static OFBool test_time( const char* const query, const char* const candidate ) +{ + return DcmAttributeMatching::rangeMatchingTime( query, strlen( query ), candidate, strlen( candidate ) ); +} + +static OFBool test_datetime( const char* const query ) +{ + return DcmAttributeMatching::isDateTimeQuery( query, strlen( query ) ); +} + +static OFBool test_datetime( const char* const query, const char* const candidate ) +{ + return DcmAttributeMatching::rangeMatchingDateTime( query, strlen( query ), candidate, strlen( candidate ) ); +} + +static OFBool test_uids( const char* const query, const char* const candidate ) +{ + return DcmAttributeMatching::listOfUIDMatching( query, strlen( query ), candidate, strlen( candidate ) ); +} + +OFTEST(dcmdata_attribute_matching) +{ + // wild card matching tests + OFCHECK(test_wildcards( "", "hello world" )); + OFCHECK(test_wildcards( "*", "hello world" )); + OFCHECK(!test_wildcards( "?", "hello world" )); + OFCHECK(test_wildcards( "?*", "hello world" )); + OFCHECK(test_wildcards( "?ell*??l?", "hello world" )); + OFCHECK(!test_wildcards( "?ell***?*?l??", "hello world" )); + OFCHECK(test_wildcards( "?ell*?**?l?*", "hello world" )); + // date + OFCHECK(test_date( "17000101" )); + OFCHECK(test_date( "30001010" )); + OFCHECK(test_date( "-12000101" )); + OFCHECK(test_date( "12451210-" )); + OFCHECK(test_date( "20451210-29110114" )); + OFCHECK(!test_date( "204512101-29110114" )); + OFCHECK(!test_date( "20451210-29110134" )); + OFCHECK(!test_date( "3124" )); + OFCHECK(!test_date( "2017.05.12" )); + OFCHECK(test_date( "", "20170224" )); + OFCHECK(test_date( "1987.08.02", "19870802" )); + OFCHECK(test_date( "-20000101", "20000101" )); + OFCHECK(test_date( "-20000101", "19990531" )); + OFCHECK(!test_date( "-20000101", "20010101" )); + OFCHECK(test_date( "20000101-", "20010101" )); + OFCHECK(!test_date( "20000101-", "19991231" )); + OFCHECK(test_date( "19990101-20000305", "20000101" )); + OFCHECK(!test_date( "19990101-20000305", "19980107")); + OFCHECK(!test_date( "19990101-20000305", "20000306")); + OFCHECK(!test_date( "19990101-20000305", "122713.114122")); + // time + OFCHECK(test_time( "12" )); + OFCHECK(!test_time( "49" )); + OFCHECK(!test_time( "12:00:00" )); + OFCHECK(test_time( "122413.123456-13" )); + OFCHECK(!test_time( "29-13" )); + OFCHECK(!test_time( "04-25" )); + OFCHECK(test_time( "-231211" )); + OFCHECK(test_time( "124222-" )); + OFCHECK(test_time( "", "120224" )); + OFCHECK(test_time( "11:23:17.123456", "112317.123456" )); + OFCHECK(test_time( "-12", "120000" )); + OFCHECK(test_time( "-12", "113059.654321" )); + OFCHECK(!test_time( "-12", "120000.000001" )); + OFCHECK(test_time( "1200-", "120000.000000" )); + OFCHECK(!test_time( "12-", "115959.999999" )); + OFCHECK(test_time( "11-121428.234763", "12" )); + OFCHECK(!test_time( "11-121428.234763", "105959.999999")); + OFCHECK(!test_time( "11-121428.234763", "121428.234764")); + OFCHECK(!test_time( "11-121428.234763", "20140909")); + // datetime + OFCHECK(test_datetime( "20170224120224+0100" )); + OFCHECK(!test_datetime( "2017224120224+0100" )); + OFCHECK(test_datetime( "2017-2018" )); + OFCHECK(!test_datetime( "201713-2018" )); + OFCHECK(!test_datetime( "2017-201813" )); + OFCHECK(test_datetime( "2017-201812" )); + OFCHECK(test_datetime( "191712-19991231235959.999999" )); + OFCHECK(test_datetime( "19991231235959.999999-" )); + OFCHECK(test_datetime( "-20000305173259.123456" )); + OFCHECK(test_datetime( "", "20170224120224+0100" )); + OFCHECK(test_datetime( "20170224113224.000000+0030", "20170224120224+0100" )); + OFCHECK(test_datetime( "-2000", "20000101000000.000000" )); + OFCHECK(test_datetime( "-2000", "19990531132417.231194" )); + OFCHECK(!test_datetime( "-2000", "20000102000000.000001" )); + OFCHECK(test_datetime( "200001-", "2001010100" )); + OFCHECK(!test_datetime( "2000-", "19991231235959.999999" )); + OFCHECK(!test_datetime( "1999-20000305173259.123456", "1998010712+0430")); + OFCHECK(!test_datetime( "1999-20000305173259.123456", "20000306")); + OFCHECK(!test_datetime( "1999-20000305173259.123456", "122713.114122")); + // UIDs + OFCHECK(test_uids("","123.456.789.10")); + OFCHECK(test_uids("123.456.789.10","123.456.789.10")); + OFCHECK(!test_uids("456.789.10","123.456.789.10")); + OFCHECK(test_uids("456.789.10\\123.456.789.10","123.456.789.10")); + OFCHECK(test_uids("456.789.10\\123.456.789.10\\456.123.789.10","123.456.789.10")); + OFCHECK(!test_uids("456.789.10\\123.456.79.10\\456.123.789.10","123.456.789.10")); + // single value matching + OFCHECK(test_singlevalue( "", "Hello world!" )); + OFCHECK(test_singlevalue( "Hello world!", "Hello world!" )); + OFCHECK(test_singlevalue( "Hello*world!", "Hello*world!" )); + OFCHECK(!test_singlevalue( "Hello*world!", "Hello world!" )); + // high level API tests + DcmAttributeMatching match( EVR_DA ); + OFCHECK(match); + OFCHECK(!!match); + OFCHECK(match( "20160101-20181231", 17, "20170713", 8 )); + match = DcmAttributeMatching( EVR_TM ); + OFCHECK(match( "-12", 3, "11", 2 )); + OFCHECK(!DcmAttributeMatching( EVR_PN )( "M?ller", 6, "^Martin", 7 )); +} diff --git a/dcmdata/tests/tnewdcme.cc b/dcmdata/tests/tnewdcme.cc new file mode 100644 index 00000000..d995d2a7 --- /dev/null +++ b/dcmdata/tests/tnewdcme.cc @@ -0,0 +1,101 @@ +/* + * + * Copyright (C) 2017-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Tests for DcmItem's newDicomElement() helper methods + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dcdicent.h" + +// Definitions of private tag info we use in this test + +#define PRIVATE_CREATOR_NAME "John Doe Testing Corporation" +#define PRIVATE_ELEMENT_STRINGELEM 0x0029, 0x1000 +#define PRIVATE_ELEMENT_NOTINDICT 0x0029, 0x1111 +#define PRIVATE_STRING_VALUE "Test Value" + +/** Register private tag(s) in runtime dictionary + */ +void registerPrivateTag() + +{ + DcmDataDictionary &dict = dcmDataDict.wrlock(); + dict.addEntry(new DcmDictEntry(PRIVATE_ELEMENT_STRINGELEM, EVR_LO, "StringAttributeForTesting", 1, 1, "private", OFTrue, PRIVATE_CREATOR_NAME)); + dcmDataDict.wrunlock(); + +} + + +OFTEST(dcmdata_newDicomElementPrivate) +{ + // Pre-register the private tags we want to use for this test in the dictionary + registerPrivateTag(); + + // Test cases when constructing a known, private element: + + // API 1: Construct DICOM element and get it as a return value. + DcmElement *elem = DcmItem::newDicomElement(DcmTagKey(PRIVATE_ELEMENT_STRINGELEM), PRIVATE_CREATOR_NAME); + // Check whether creation as well as tag and value assignment are correct + OFCHECK(elem); + OFCHECK(elem->putOFStringArray(PRIVATE_STRING_VALUE).good()); + OFCHECK(elem->getTag().getXTag() == DcmTagKey(PRIVATE_ELEMENT_STRINGELEM)); + OFCHECK(elem->getVR() == EVR_LO); + OFCHECK(elem->putOFStringArray(PRIVATE_STRING_VALUE).good()); + char *charVal = NULL; + OFCHECK(elem->getString(charVal).good()); + OFCHECK(OFString(charVal) == PRIVATE_STRING_VALUE); + charVal = NULL; + + // API 2: Construct DICOM element and get it as parameter output value + DcmElement* elem2 = NULL; + // Check whether creation as well as tag and value assignment are correct + OFCHECK(DcmItem::newDicomElement(elem2, DcmTagKey(PRIVATE_ELEMENT_STRINGELEM), PRIVATE_CREATOR_NAME).good()); + OFCHECK(elem2->getTag().getXTag() == DcmTagKey(PRIVATE_ELEMENT_STRINGELEM)); + OFCHECK(elem->getVR() == EVR_LO); + OFCHECK(elem2->putOFStringArray(PRIVATE_STRING_VALUE).good()); + OFCHECK(elem2->getString(charVal).good()); + OFCHECK(OFString(charVal) == PRIVATE_STRING_VALUE); + + delete elem; + delete elem2; + + // Test cases when constructing an unknown, private element resulting in creation + // with VR "EVR_UNKNOWN": + + // API 1 + DcmElement *elem_un = NULL; + elem_un = DcmItem::newDicomElement(DcmTagKey(PRIVATE_ELEMENT_NOTINDICT), PRIVATE_CREATOR_NAME); + OFCHECK(elem_un); + OFCHECK(elem_un->getTag().getXTag() == DcmTagKey(PRIVATE_ELEMENT_NOTINDICT)); + OFCHECK(elem_un->getVR() == EVR_UNKNOWN); + delete elem_un; + + // API 2 + elem_un = NULL; + OFCHECK(DcmItem::newDicomElement(elem_un, DcmTagKey(PRIVATE_ELEMENT_NOTINDICT), PRIVATE_CREATOR_NAME).good()); + OFCHECK(elem_un); + OFCHECK(elem_un->getVR() == EVR_UNKNOWN); + delete elem_un; +} diff --git a/dcmdata/tests/tparent.cc b/dcmdata/tests/tparent.cc new file mode 100644 index 00000000..a202da48 --- /dev/null +++ b/dcmdata/tests/tparent.cc @@ -0,0 +1,185 @@ +/* + * + * Copyright (C) 2012-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: test program for parent element handling + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dctmacro.h" + + +/* To switch between big and little endian, just change these macros */ +#define TRANSFER_SYNTAX EXS_LittleEndianExplicit +#define ENDIAN_UINT16(w) LITTLE_ENDIAN_UINT16(w) +#define ENDIAN_UINT32(w) LITTLE_ENDIAN_UINT32(w) + + +// This checks if each object's parent is set correctly. This should be called +// as testParent(fileFormat); because other parameters are just used internally. +static void testParents(DcmObject& item, DcmObject *root = NULL, DcmObject *parent = NULL) +{ + OFCHECK_EQUAL(item.getParent(), parent); + + // DcmFileFormat doesn't count as root, but DcmMetaInfo and DcmDataset do. + // Thus we need some magic to check against them as root. + if (root != NULL) + { + DcmItem *pItem = item.getParentItem(); + OFCHECK(pItem == parent || pItem == parent->getParent()); + if (pItem) + { + DcmEVR ident = pItem->ident(); + OFCHECK(ident == EVR_item || ident == EVR_dataset + || ident == EVR_metainfo || ident == EVR_dirRecord); + } + + OFCHECK_EQUAL(item.getRootItem(), root); + } + else + { + OFCHECK(item.getRootItem() == NULL); + OFCHECK(item.getParentItem() == NULL); + } + + // iterate over all children and check them, too + DcmObject *obj = NULL; + while ((obj = item.nextInContainer(obj)) != NULL) + testParents(*obj, root == NULL ? obj : root, &item); +} + +OFTEST(dcmdata_elementParent) +{ + DcmFileFormat ff; + DcmItem *item = NULL; + DcmElement *elem = NULL; + DcmSequenceOfItems *seq = NULL; + OFCondition cond = EC_Normal; + + testParents(ff); + + // Some test dataset that we use to verify that reading works + const Uint8 testData[] = { + TAG_AND_LENGTH(DCM_DirectoryRecordSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH_SHORT(DCM_OffsetOfTheNextDirectoryRecord, 'U', 'L', 4), + 0x42, 0x00, 0x00, 0x00, + ITEM_END, + SEQUENCE_END, + TAG_AND_LENGTH_SHORT(DCM_PatientName, 'P', 'N', 4), + 'T', 'e', 's', 't', + TAG_AND_LENGTH(DCM_ConceptNameCodeSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH_SHORT(DCM_CodeValue, 'S', 'H', 6), + 'D', 'T', '.', '0', '6', ' ', + ITEM_END, + SEQUENCE_END, + TAG_AND_LENGTH(DCM_VerifyingObserverSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH_SHORT(DCM_VerificationDateTime, 'D', 'T', 8), + '2', '0', '1', '2', '0', '4', '2', '3', + TAG_AND_LENGTH(DCM_VerifyingObserverIdentificationCodeSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH_SHORT(DCM_CodeValue, 'S', 'H', 10), + 'U', 'S', 'R', '.', '0', '0', '0', '0', '2', ' ', + ITEM_END, + SEQUENCE_END, + ITEM_END, + SEQUENCE_END, + TAG_AND_LENGTH(DCM_PixelData, 'O', 'B', UNDEFINED_LENGTH), + ITEM(8), 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + ITEM(8), 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + ITEM(2), 0x10, 0x2a, + SEQUENCE_END + }; + + cond = readDataset(*ff.getDataset(), testData, sizeof(testData), EXS_LittleEndianExplicit); + OFCHECK(cond.good()); + testParents(ff); + + // Now test the insert/remove methods directly + DcmDataset *dset = ff.getAndRemoveDataset(); + OFCHECK(dset->getParent() == NULL); + delete dset; + testParents(ff); + dset = ff.getDataset(); + + elem = new DcmPersonName(DCM_PatientName); + OFCHECK(elem->getParent() == NULL); + cond = dset->insert(elem); + OFCHECK(cond.good()); + OFCHECK(elem->getParent() == dset); + testParents(ff); + + seq = new DcmSequenceOfItems(DCM_OtherPatientIDsSequence); + OFCHECK(seq->getParent() == NULL); + cond = dset->insert(seq); + OFCHECK(cond.good()); + OFCHECK(seq->getParent() == dset); + testParents(ff); + + item = new DcmItem(DCM_Item); + OFCHECK(item->getParent() == NULL); + cond = seq->insert(item); + OFCHECK(cond.good()); + OFCHECK(item->getParent() == seq); + testParents(ff); + + elem = new DcmLongString(DCM_RETIRED_OtherPatientIDs); + OFCHECK(elem->getParent() == NULL); + cond = item->insert(elem); + OFCHECK(cond.good()); + OFCHECK(elem->getParent() == item); + testParents(ff); + + item = new DcmItem(DCM_Item); + OFCHECK(item->getParent() == NULL); + cond = seq->insert(item); + OFCHECK(cond.good()); + OFCHECK(item->getParent() == seq); + testParents(ff); + + elem = new DcmLongString(DCM_RETIRED_OtherPatientIDs); + OFCHECK(elem->getParent() == NULL); + cond = item->insert(elem); + OFCHECK(cond.good()); + OFCHECK(elem->getParent() == item); + testParents(ff); + + elem = new DcmPersonName(DCM_PatientName); + OFCHECK(elem->getParent() == NULL); + cond = item->insert(elem); + OFCHECK(cond.good()); + OFCHECK(elem->getParent() == item); + testParents(ff); + + elem = item->remove(1); + OFCHECK_EQUAL(elem->getTag(), DCM_RETIRED_OtherPatientIDs); + OFCHECK(elem->getParent() == NULL); + delete elem; + testParents(ff); + + elem = item->remove(DCM_PatientName); + OFCHECK_EQUAL(elem->getTag(), DCM_PatientName); + OFCHECK(elem->getParent() == NULL); + delete elem; + testParents(ff); +} diff --git a/dcmdata/tests/tparser.cc b/dcmdata/tests/tparser.cc new file mode 100644 index 00000000..cb8f93c3 --- /dev/null +++ b/dcmdata/tests/tparser.cc @@ -0,0 +1,490 @@ +/* + * + * Copyright (C) 2011-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Uli Schlachter + * + * Purpose: test program for reading DICOM datasets + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/oftempf.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/dcistrmb.h" +#include "dcmtk/dcmdata/dcostrmb.h" +#include "dctmacro.h" + + +/* To switch between big and little endian, just change these macros */ +#define TRANSFER_SYNTAX EXS_LittleEndianExplicit +#define ENDIAN_UINT16(w) LITTLE_ENDIAN_UINT16(w) +#define ENDIAN_UINT32(w) LITTLE_ENDIAN_UINT32(w) + + +static OFLogger tparserLogger = OFLog::getLogger("dcmtk.test.tparser"); + +OFTEST(dcmdata_parser_missingDelimitationItems) +{ + const Uint8 data[] = { + TAG_AND_LENGTH(DCM_IconImageSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH(DCM_PixelData, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE, + /* Delimitation Items missing at the end of the stream */ + }; + DcmDataset dset; + OFCondition cond; + + // This should assume the above sequence is complete + dcmIgnoreParsingErrors.set(OFTrue); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond.bad()) + { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + } + + // This should complain about the missing item + dcmIgnoreParsingErrors.set(OFFalse); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond != EC_SequDelimitationItemMissing) + { + OFCHECK_FAIL("Parsing should have failed with 'Sequence Delimitation Item missing', but got: " << cond.text()); + } +} + +OFTEST(dcmdata_parser_missingSequenceDelimitationItem_1) +{ + const Uint8 data[] = { + TAG_AND_LENGTH(DCM_PixelData, 'O', 'B', UNDEFINED_LENGTH), + ITEM(4), + VALUE, VALUE, VALUE, VALUE + /* SequenceDelimitationItem missing at the end of the stream */ + }; + DcmDataset dset; + OFCondition cond; + + // This should assume the above sequence is complete + dcmIgnoreParsingErrors.set(OFTrue); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond.bad()) + { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + } + + // This should complain about the missing item + dcmIgnoreParsingErrors.set(OFFalse); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond != EC_SequDelimitationItemMissing) + { + OFCHECK_FAIL("Parsing should have failed with 'Sequence Delimitation Item missing', but got: " << cond.text()); + } +} + +OFTEST(dcmdata_parser_missingSequenceDelimitationItem_2) +{ + const Uint8 data[] = { + TAG_AND_LENGTH(DCM_IconImageSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH(DCM_PixelData, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE, + ITEM_END, + /* SequenceDelimitationItem missing, but there's further data after the sequence */ + TAG_AND_LENGTH(DCM_DataSetTrailingPadding, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE + }; + DcmDataset dset; + OFCondition cond; + + // This should fail with a specific error code + dcmIgnoreParsingErrors.set(OFFalse); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond != EC_SequDelimitationItemMissing) + { + OFCHECK_FAIL("Parsing should have failed with 'Sequence Delimitation Item missing', but got: " << cond.text()); + } +} + +OFTEST(dcmdata_parser_wrongDelimitationItemForSequence) +{ + const Uint8 data[] = { + TAG_AND_LENGTH(DCM_IconImageSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH(DCM_PixelData, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE, + ITEM_END, + /* wrong delimitation item */ + ITEM_END, + TAG_AND_LENGTH(DCM_DataSetTrailingPadding, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE + }; + DcmDataset dset; + OFCondition cond; + + // This should complain about the wrong delimitation item + dcmIgnoreParsingErrors.set(OFFalse); + dcmReplaceWrongDelimitationItem.set(OFFalse); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond != EC_SequDelimitationItemMissing) + { + OFCHECK_FAIL("Parsing should have failed with 'Sequence Delimitation Item missing', but got: " << cond.text()); + } + + // This should assume the above sequence encoding is correct + dcmIgnoreParsingErrors.set(OFTrue); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond.good()) + { + OFLOG_DEBUG(tparserLogger, DcmObject::PrintHelper(dset)); + if (dset.card() != 1) + OFCHECK_FAIL("There should be exactly 1 element on the main dataset level, but " << dset.card() << " found"); + } else { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + } + + // This should replace the wrong delimitation item + dcmIgnoreParsingErrors.set(OFFalse); + dcmReplaceWrongDelimitationItem.set(OFTrue); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond.good()) + { + OFLOG_DEBUG(tparserLogger, DcmObject::PrintHelper(dset)); + if (dset.card() != 2) + OFCHECK_FAIL("There should be exactly 2 elements on the main dataset level, but " << dset.card() << " found"); + } else { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + } +} + +OFTEST(dcmdata_parser_wrongDelimitationItemForItem) +{ + const Uint8 data[] = { + TAG_AND_LENGTH(DCM_IconImageSequence, 'S', 'Q', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + TAG_AND_LENGTH(DCM_PixelData, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE, + /* wrong delimitation item */ + SEQUENCE_END, + SEQUENCE_END, + TAG_AND_LENGTH(DCM_DataSetTrailingPadding, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE + }; + DcmDataset dset; + OFCondition cond; + + // This should complain about the wrong delimitation item + dcmIgnoreParsingErrors.set(OFFalse); + dcmReplaceWrongDelimitationItem.set(OFFalse); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond != EC_ItemDelimitationItemMissing) + { + OFCHECK_FAIL("Parsing should have failed with 'Item Delimitation Item missing', but got: " << cond.text()); + } + + // This should assume the above item encoding is correct + dcmIgnoreParsingErrors.set(OFTrue); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond.good()) + { + OFLOG_DEBUG(tparserLogger, DcmObject::PrintHelper(dset)); + if (dset.card() != 2) + OFCHECK_FAIL("There should be exactly 2 elements on the main dataset level, but " << dset.card() << " found"); + } else { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + } + + // This should replace the wrong delimitation item + dcmIgnoreParsingErrors.set(OFFalse); + dcmReplaceWrongDelimitationItem.set(OFTrue); + cond = readDataset(dset, data, sizeof(data), TRANSFER_SYNTAX); + if (cond.good()) + { + OFLOG_DEBUG(tparserLogger, DcmObject::PrintHelper(dset)); + if (dset.card() != 2) + OFCHECK_FAIL("There should be exactly 2 elements on the main dataset level, but " << dset.card() << " found"); + } else { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + } +} + +OFTEST(dcmdata_parser_explicitItemLengthTooLarge) +{ + /* Produce some test data: Sequence with single item, containing a single element. */ + const Uint8 data[] = { + IMPLICIT_TAG_AND_LENGTH(DCM_RequestAttributesSequence, UNDEFINED_LENGTH), + ITEM(12), // 4 for tag, 4 for length, and 4 bytes extra that should produce the error + IMPLICIT_TAG_AND_LENGTH(DCM_CodeValue, 0), + SEQUENCE_END + }; + DcmDataset dset; + OFCondition cond; + + // This should complain about the item being too large + dcmIgnoreParsingErrors.set(OFFalse); + cond = readDataset(dset, data, sizeof(data), EXS_LittleEndianImplicit); + if (cond != EC_PrematureSequDelimitationItem) + { + OFCHECK_FAIL("Parsing should have failed with 'Sequence Delimitation Item occurred before Item was completely read', but got: " << cond.text()); + } + + // This should ignore the error during parsing + dcmIgnoreParsingErrors.set(OFTrue); + cond = readDataset(dset, data, sizeof(data), EXS_LittleEndianImplicit); + if (cond.bad()) + { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + } +} + +static void testOddLengthPartialValue(const Uint8* data, size_t length) +{ + const unsigned int bytesToRead = 5; + DcmFileFormat dfile; + OFCondition cond; + DcmElement *elem; + Uint8 buf[bytesToRead]; + OFTempFile temp; + + if (temp.getStatus().bad()) + { + OFCHECK_FAIL("Could not create temporary file: " << temp.getStatus().text()); + return; + } + + // Deferred value loading only works with files + OFFile f; + f.fopen(temp.getFilename(), "wb"); + f.fwrite(data, 1, length); + f.fclose(); + + // Everything larger than 1 byte won't be loaded now but only later + cond = dfile.loadFile(temp.getFilename(), TRANSFER_SYNTAX, EGL_noChange, 1, ERM_dataset); + if (cond.bad()) + { + OFCHECK_FAIL(cond.text()); + return; + } + + cond = dfile.getDataset()->findAndGetElement(DCM_PixelData, elem); + if (cond.bad()) + { + OFCHECK_FAIL(cond.text()); + return; + } + + // This is what we are actually testing for. The bug was that + // getPartialValue() tried to load one more byte than what was available. + // This resulted in an "Invalid stream" error. + cond = elem->getPartialValue(buf, 0, bytesToRead); + if (cond.bad()) + { + OFCHECK_FAIL(cond.text()); + return; + } + + for (unsigned int i = 0; i < bytesToRead; i++) + { + OFCHECK_EQUAL(buf[i], VALUE); + } +} + +OFTEST(dcmdata_parser_oddLengthPartialValue_lastItem) +{ + const Uint8 data[] = { + /* This needs an odd length and OW for the bug that we are testing */ + TAG_AND_LENGTH(DCM_PixelData, 'O', 'W', 5), + VALUE, VALUE, VALUE, VALUE, VALUE + }; + + testOddLengthPartialValue(data, sizeof(data)); +} + +OFTEST(dcmdata_parser_oddLengthPartialValue_notLastItem) +{ + const Uint8 data[] = { + /* This needs an odd length and OW for the bug that we are testing */ + TAG_AND_LENGTH(DCM_PixelData, 'O', 'W', 5), + VALUE, VALUE, VALUE, VALUE, VALUE, + /* This time something else is behind the tested element */ + TAG_AND_LENGTH(DCM_DataSetTrailingPadding, 'O', 'B', 4), + VALUE, VALUE, VALUE, VALUE + }; + + testOddLengthPartialValue(data, sizeof(data)); +} + +static const DcmTagKey wrongExplicitVRinDataset_unknownTag1(0x0006, 0x0006); +static const DcmTagKey wrongExplicitVRinDataset_unknownTag2(0x0006, 0x0008); + +#define WRONG_EXPLICIT_VR_COMMON \ + /* This non-standard tag cannot be corrected (not in data dictionary, short length field) */ \ + TAG_AND_LENGTH_SHORT(wrongExplicitVRinDataset_unknownTag1, 'P', 'N', 4), \ + 'A', 'B', 'C', 'D', \ + /* This non-standard tag cannot be corrected (not in data dictionary, long length field) */ \ + TAG_AND_LENGTH(wrongExplicitVRinDataset_unknownTag2, 'U', 'T', 4), \ + 'E', 'F', 'G', 'H', \ + /* This standard tag has a wrong VR ("ST" instead of "PN") */ \ + TAG_AND_LENGTH_SHORT(DCM_PatientName, 'S', 'T', 4), \ + 'I', 'J', 'K', 'L', \ + /* This standard tag has a correct VR, no modification required */ \ + TAG_AND_LENGTH_SHORT(DCM_PatientSex, 'C', 'S', 2), \ + 'O', ' ' + +static const Uint8 wrongExplicitVRinDataset_default_testData[] = { + WRONG_EXPLICIT_VR_COMMON, + /* This standard tag has a wrong VR ("UN") and does not use the "PN" length field size */ + TAG_AND_LENGTH(DCM_PatientBirthName, 'U', 'N', 4), + '0', '8', '1', '5', + /* This standard tag has a wrong VR ("LO") and does not use the "UT" length field size */ + TAG_AND_LENGTH_SHORT(DCM_PixelDataProviderURL, 'L', 'O', 4), + '4', '2', '4', '2', +}; + +static const Uint8 wrongExplicitVRinDataset_dictLen_testData[] = { + WRONG_EXPLICIT_VR_COMMON, + /* This standard tag has a wrong VR ("UN") and uses the "PN" length field size */ + TAG_AND_LENGTH_SHORT(DCM_PatientBirthName, 'U', 'N', 4), + '0', '8', '1', '5', + /* This standard tag has a wrong VR ("LO") and uses the "UT" length field size */ + TAG_AND_LENGTH(DCM_PixelDataProviderURL, 'L', 'O', 4), + '4', '2', '4', '2', +}; +#undef WRONG_EXPLICIT_VR_COMMON + +static void testForExpectedVR(DcmDataset &dset, const DcmTagKey &tag, const DcmEVR vr) +{ + DcmElement *elem; + OFCondition cond = dset.findAndGetElement(tag, elem); + if (cond.good()) + { + /* check whether the VR generated by the parser is the expected one */ + OFCHECK_EQUAL(elem->getVR(), vr); + } else { + OFCHECK_FAIL(cond.text()); + } +} + +static void testExplicitVRinDataset(OFBool useDictionaryVR, OFBool useDictionaryVRLen) +{ + DcmDataset dset; + OFCondition cond; + const OFConditionConst *expectedError; + const Uint8 *broken, *working; + size_t brokenLength, workingLength; + + if (useDictionaryVRLen) { + broken = wrongExplicitVRinDataset_default_testData; + brokenLength = sizeof(wrongExplicitVRinDataset_default_testData); + working = wrongExplicitVRinDataset_dictLen_testData; + workingLength = sizeof(wrongExplicitVRinDataset_dictLen_testData); + // This gets the length field wrong and interprets an element's value as + // the beginning of the following element; then complains about the length + expectedError = NULL; + } else { + working = wrongExplicitVRinDataset_default_testData; + workingLength = sizeof(wrongExplicitVRinDataset_default_testData); + broken = wrongExplicitVRinDataset_dictLen_testData; + brokenLength = sizeof(wrongExplicitVRinDataset_dictLen_testData); + // This gets the length field wrong and tries to allocate a huge element + expectedError = &EC_MemoryExhausted; + } + + dcmPreferLengthFieldSizeFromDataDictionary.set(useDictionaryVRLen); + dcmPreferVRFromDataDictionary.set(useDictionaryVR); + + // The broken version shouldn't be parseable + cond = readDataset(dset, broken, brokenLength, TRANSFER_SYNTAX); + if (cond != EC_InvalidStream && (expectedError == NULL || cond != *expectedError)) + { + OFCHECK_FAIL("Dataset should fail, but got: " << cond.text()); + if (cond.good()) + OFLOG_DEBUG(tparserLogger, DcmObject::PrintHelper(dset)); + } + + // The good version should work + cond = readDataset(dset, working, workingLength, TRANSFER_SYNTAX); + + // Reset to the default values + dcmPreferLengthFieldSizeFromDataDictionary.set(OFFalse); + dcmPreferVRFromDataDictionary.set(OFFalse); + if (cond.bad()) { + OFCHECK_FAIL(cond.text()); + return; + } + OFLOG_DEBUG(tparserLogger, DcmObject::PrintHelper(dset)); + testForExpectedVR(dset, wrongExplicitVRinDataset_unknownTag1, EVR_PN); + testForExpectedVR(dset, wrongExplicitVRinDataset_unknownTag2, EVR_UT); + testForExpectedVR(dset, DCM_PatientName, useDictionaryVR ? EVR_PN : EVR_ST); + testForExpectedVR(dset, DCM_PatientBirthName, useDictionaryVR ? EVR_PN : EVR_UN); + testForExpectedVR(dset, DCM_PixelDataProviderURL, useDictionaryVR ? EVR_UR : EVR_LO); +} + +OFTEST(dcmdata_parser_wrongExplicitVRinDataset_default) +{ + testExplicitVRinDataset(OFFalse, OFFalse); +} + +OFTEST(dcmdata_parser_wrongExplicitVRinDataset_defaultVR_dictLen) +{ + testExplicitVRinDataset(OFFalse, OFTrue); +} + +OFTEST(dcmdata_parser_wrongExplicitVRinDataset_dictVR_defaultLen) +{ + testExplicitVRinDataset(OFTrue, OFFalse); +} + +OFTEST(dcmdata_parser_wrongExplicitVRinDataset_preferDataDict) +{ + testExplicitVRinDataset(OFTrue, OFTrue); +} + +OFTEST(dcmdata_parser_undefinedLengthUNSequence) +{ + const Uint8 data[] = { + // Sequence with undefined length and VR UN => gets read as implicit TS + TAG_AND_LENGTH(DCM_IconImageSequence, 'U', 'N', UNDEFINED_LENGTH), + ITEM(UNDEFINED_LENGTH), + IMPLICIT_TAG_AND_LENGTH(DCM_PatientName, 4), + 'A', 'B', 'C', 'D', + IMPLICIT_TAG_AND_LENGTH(DCM_PixelData, 2), + VALUE, VALUE, + ITEM_END, + SEQUENCE_END + }; + DcmDataset dset; + OFCondition cond; + + cond = readDatasetTwice(dset, data, sizeof(data), EXS_JPEGProcess14, EXS_JPEGProcess14); + if (cond.good()) + { + OFLOG_DEBUG(tparserLogger, DcmObject::PrintHelper(dset)); + OFCHECK_EQUAL(1, dset.card()); + + DcmElement *elem = NULL; + cond = dset.findAndGetElement(DCM_PatientName, elem, OFTrue); + if (cond.good()) + OFCHECK(elem != NULL); + else + OFCHECK_FAIL("There should have been a PatientName item, but: " << cond.text()); + } else { + OFCHECK_FAIL("Parsing should have worked, but got error: " << cond.text()); + return; + } +} diff --git a/dcmdata/tests/tpath.cc b/dcmdata/tests/tpath.cc new file mode 100644 index 00000000..5b18a928 --- /dev/null +++ b/dcmdata/tests/tpath.cc @@ -0,0 +1,350 @@ +/* + * + * Copyright (C) 2008-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: Test program for testing path features of DcmItem + * and DcmSequenceOfItem + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcpath.h" + + +static OFLogger tpathLogger = OFLog::getLogger("dcmtk.test.tpath"); + +#define CHECK_GOOD(check) OFCHECK((check).good()) + +#define RETURN_ERROR(msg) do { \ + OFOStringStream oss; \ + OFCondition cond; \ + oss << msg << OFStringStream_ends; \ + OFSTRINGSTREAM_GETSTR(oss, str) \ + cond = makeOFCondition(OFM_dcmdata, 1, OF_error, str); \ + OFSTRINGSTREAM_FREESTR(str) \ + return cond; \ +} while (0) + + +static OFCondition testPathInsertionsWithoutWildcard(const OFString& path, + DcmDataset *dset, + const Uint16& expectedNumObjects, + const OFBool& expectFailed = OFFalse, + const OFBool& createIfNecessary = OFTrue) +{ + DcmPathProcessor proc; + OFCondition result = proc.findOrCreatePath(dset, path, createIfNecessary); + if (result.bad()) + { + if (!expectFailed) + { + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Path " << (createIfNecessary ? "insertion" : "lookup") << " failed: " << result.text()); + } + return EC_Normal; + } + + // get results + OFList< DcmPath* > results; + Uint32 numResults = proc.getResults(results); + if (numResults != 1) + { + // non-wildcard insertion should ALWAYS only return one result + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Returned path list does contain more than one result but no wildcard was specified"); + } + DcmPath* oneResult = * (results.begin()); + + if (oneResult->size() != expectedNumObjects) + { + if (!expectFailed) + { + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Returned object list does not contain " << expectedNumObjects << " but only " << oneResult->size() << "elements"); + } + } + else + { + OFListIterator(DcmPathNode*) it = oneResult->begin(); + for (Uint16 i=0; i < expectedNumObjects; i++) + { + if (*it == NULL) + { + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Path insertion failed: One of the created objects is NULL"); + } + it++; + } + } + + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... OK"); + return EC_Normal; +} + +static OFCondition testPathInsertionsWithWildcard(const OFString& path, + DcmDataset *dset, + const Uint16& expectedNumResults, + const OFBool& expectFailed = OFFalse, + const OFBool& createIfNecessary = OFTrue) +{ + DcmPathProcessor proc; + OFCondition result = proc.findOrCreatePath(dset, path, createIfNecessary); + if (result.bad()) + { + if (!expectFailed) + { + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Path " << (createIfNecessary ? "insertion" : "lookup") << " failed: " << result.text()); + } + return EC_Normal; + } + + // get results + OFList< DcmPath* > results; + Uint32 numResults = proc.getResults(results); + if ( (numResults != expectedNumResults) && !expectFailed ) + { + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Expected " << expectedNumResults << " but " << numResults << " results were returned"); + } + // check results + OFListIterator(DcmPath*) oneResult = results.begin(); + while (oneResult != results.end()) + { + if (*oneResult) + { + OFListIterator(DcmPathNode*) it = (*oneResult)->begin(); + while (it != (*oneResult)->end()) + { + if (*it == NULL) + { + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Path insertion failed: One of the result paths contains NULL"); + } + it++; + } + } + else + { + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... FAILED!"); + RETURN_ERROR("Path insertion failed: One of the returned paths is NULL"); + } + oneResult++; + } + OFLOG_DEBUG(tpathLogger, "Path: " << path << " ... OK"); + return EC_Normal; +} + +OFTEST(dcmdata_pathAccess) +{ + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFCHECK_FAIL("no data dictionary loaded, check environment variable: " DCM_DICT_ENVIRONMENT_VARIABLE); + return; + } + + DcmFileFormat dcmff; + DcmDataset *dset = dcmff.getDataset(); + OFString path; + const OFString precalculatedDump = /* break the dump into smaller parts because MSVC6 only accepts 2048 character string constants maximum */ + "# Dicom-Data-Set\n# Used TransferSyntax: Unknown Transfer Syntax\n(0040,a730) SQ (Sequence with explicit length #=6) # 0, 1 ContentSequence\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n (0040,a730) SQ (Sequence with explicit length #=4) # 0, 1 ContentSequence\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n (0040,a043) SQ (Sequence with explicit length #=1) # 0, 1 ConceptNameCodeSequence\n" + " (fffe,e000) na (Item with explicit length #=2) # 0, 1 Item\n (0008,0100) SH (no value available) # 0, 0 CodeValue\n" + " (0008,0104) LO (no value available) # 0, 0 CodeMeaning\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + "(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n"; + + const OFString precalculatedDump2 = + "# Dicom-Data-Set\n# Used TransferSyntax: Unknown Transfer Syntax\n(0010,0020) LO (no value available) # 0, 0 PatientID\n" + "(0040,a730) SQ (Sequence with explicit length #=6) # 0, 1 ContentSequence\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0040,a730) SQ (Sequence with explicit length #=4) # 0, 1 ContentSequence\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0010,0020) LO (no value available) # 0, 0 PatientID\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n (0010,0010) PN (no value available) # 0, 0 PatientName\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0040,a730) SQ (Sequence with explicit length #=4) # 0, 1 ContentSequence\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0010,0020) LO (no value available) # 0, 0 PatientID\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n (0010,0010) PN (no value available) # 0, 0 PatientName\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0040,a730) SQ (Sequence with explicit length #=4) # 0, 1 ContentSequence\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0010,0020) LO (no value available) # 0, 0 PatientID\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n (0010,0010) PN (no value available) # 0, 0 PatientName\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0040,a730) SQ (Sequence with explicit length #=4) # 0, 1 ContentSequence\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0010,0020) LO (no value available) # 0, 0 PatientID\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n (0010,0010) PN (no value available) # 0, 0 PatientName\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0040,a730) SQ (Sequence with explicit length #=4) # 0, 1 ContentSequence\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0010,0020) LO (no value available) # 0, 0 PatientID\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n (0010,0010) PN (no value available) # 0, 0 PatientName\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0040,a730) SQ (Sequence with explicit length #=4) # 0, 1 ContentSequence\n (fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n" + " (0010,0020) LO (no value available) # 0, 0 PatientID\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=0) # 0, 1 Item\n (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n" + " (fffe,e000) na (Item with explicit length #=2) # 0, 1 Item\n (0010,0010) PN (no value available) # 0, 0 PatientName\n" + " (0040,a043) SQ (Sequence with explicit length #=1) # 0, 1 ConceptNameCodeSequence\n (fffe,e000) na (Item with explicit length #=2) # 0, 1 Item\n" + " (0008,0100) SH (no value available) # 0, 0 CodeValue\n (0008,0104) LO (no value available) # 0, 0 CodeMeaning\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n" + " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n"; + + const Uint32 precalculatedLength = 148; + const Uint32 precalculatedLength2 = 464; + + /* ********************************************************************* */ + /* Test insertions using no wildcards */ + /* ********************************************************************* */ + + OFLOG_DEBUG(tpathLogger, "These insertions should work:\n" + << "============================="); + path = "PatientID"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1)); + path = "ContentSequence"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1)); + path = "(0040,A730)"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1)); + path = "(0040,A730)[5]"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 2)); + path = "(0040,A730)[5].ContentSequence[3].ConceptNameCodeSequence[0].CodeValue"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 7)); + path = "ContentSequence[5].ContentSequence[3].ConceptNameCodeSequence[0].(0008,0104)"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 7)); + + OFLOG_DEBUG(tpathLogger, "\nThese insertions should NOT work (wrong syntax):\n" + << "================================================"); + + path = "ContentSequences"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFTrue)); + path = "(1234,ContentSequences"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFTrue)); + path = "(00X4,A730)"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFTrue)); + path = "(0040,A730)[-5]"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 2, OFTrue)); + path = "(0040,A730)[a].ContentSequence[3].ConceptNameCodeSequence[0].CodeValue"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 7, OFTrue)); + + OFLOG_DEBUG(tpathLogger, "\nThese find routines should work:\n" + << "================================"); + + path = "PatientID"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFFalse, OFFalse /* do not create */)); + path = "ContentSequence"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFFalse, OFFalse /* do not create */)); + path = "(0040,A730)"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFFalse, OFFalse /* do not create */)); + path = "(0040,A730)[5]"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 2, OFFalse, OFFalse /* do not create */)); + path = "(0040,A730)[5].ContentSequence[3].ConceptNameCodeSequence[0].CodeValue"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 7, OFFalse, OFFalse /* do not create */)); + path = "ContentSequence[5].ContentSequence[3].ConceptNameCodeSequence[0].(0008,0104)"; + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 7, OFFalse, OFFalse /* do not create */)); + + OFLOG_DEBUG(tpathLogger, "\nThese find routines should NOT work:\n" + << "===================================="); + + path = "PatientName"; // was never inserted + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFTrue, OFFalse /* do not create */)); + path = "(0040,A730)[6]"; // we only have 6 items in there (not 7) + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 2, OFTrue, OFFalse /* do not create */)); + path = "ConceptNameCodeSequence"; // should not exist on main level + CHECK_GOOD(testPathInsertionsWithoutWildcard(path, dset, 1, OFTrue, OFFalse /* do not create */)); + + OFLOG_DEBUG(tpathLogger, "\nChecking dataset length:\n" + << "========================"); + Uint32 length = dset->calcElementLength(EXS_LittleEndianExplicit,EET_ExplicitLength); + if (length == precalculatedLength) + { + OFLOG_DEBUG(tpathLogger, "Checking whether length of encoded dataset matches pre-calculated length ... OK"); + } + else + { + OFLOG_DEBUG(tpathLogger, "Checking whether length of encoded dataset matches pre-calculated length ... FAILED!"); + OFLOG_DEBUG(tpathLogger, "Length is " << length << ", but should be " << precalculatedLength); + OFLOG_DEBUG(tpathLogger, "Please check dump and adapt test in case of false alarm:" << OFendl); + OFLOG_DEBUG(tpathLogger, "Dump of assembled test object:"); + OFLOG_DEBUG(tpathLogger, DcmObject::PrintHelper(*dset)); + OFLOG_DEBUG(tpathLogger, "Dump of pre-defined template:" << OFendl); + OFLOG_DEBUG(tpathLogger, precalculatedDump); + OFCHECK_FAIL("Wrong length"); + } + + /* ********************************************************************* */ + /* Test insertions using wildcards */ + /* ********************************************************************* */ + + OFLOG_DEBUG(tpathLogger, "\nThese wildcard insertions should work:\n" + << "======================================"); + path = "ContentSequence[*].ContentSequence[3].PatientName"; + CHECK_GOOD(testPathInsertionsWithWildcard(path, dset, 6, OFFalse /* should work*/, OFTrue /*do create*/)); + path = "ContentSequence[*].ContentSequence[0].PatientID"; + CHECK_GOOD(testPathInsertionsWithWildcard(path, dset, 6, OFFalse /* should work*/, OFTrue /*do create*/)); + + OFLOG_DEBUG(tpathLogger, "\nTesting wildcard insertions should NOT work:\n" + << "============================================"); + path = "SourceImageSequence[*]"; + CHECK_GOOD(testPathInsertionsWithWildcard(path, dset, 0, OFTrue /* should fail*/, OFTrue /*do create*/)); + path = "ContentSequence[*].SourceImageSequence[*]"; + CHECK_GOOD(testPathInsertionsWithWildcard(path, dset, 0, OFTrue /* should fail*/, OFTrue /*do create*/)); + + OFLOG_DEBUG(tpathLogger, "\nChecking dataset length:\n" + << "========================"); + length = dset->calcElementLength(EXS_LittleEndianExplicit,EET_ExplicitLength); + if (length == precalculatedLength2) + { + OFLOG_DEBUG(tpathLogger, "Checking whether length of encoded dataset matches pre-calculated length ... OK"); + } + else + { + OFLOG_DEBUG(tpathLogger, "Checking whether length of encoded dataset matches pre-calculated length ... FAILED!"); + OFLOG_DEBUG(tpathLogger, "Length is " << length << ", but should be " << precalculatedLength2); + OFLOG_DEBUG(tpathLogger, "Please check dump and adapt test in case of false alarm:" << OFendl); + OFLOG_DEBUG(tpathLogger, "Dump of assembled test object:"); + OFLOG_DEBUG(tpathLogger, DcmObject::PrintHelper(*dset)); + OFLOG_DEBUG(tpathLogger, "Dump of pre-defined template:" << OFendl); + OFLOG_DEBUG(tpathLogger, precalculatedDump2); + OFCHECK_FAIL("Wrong length"); + } +} diff --git a/dcmdata/tests/tpread.cc b/dcmdata/tests/tpread.cc new file mode 100644 index 00000000..52c4270a --- /dev/null +++ b/dcmdata/tests/tpread.cc @@ -0,0 +1,414 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Marco Eichelberg + * + * Purpose: Test application for partial element access API + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/ofstd/ofrand.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/dcmdata/dcistrmz.h" /* for dcmZlibExpectRFC1950Encoding */ +#include "dcmtk/dcmdata/dcfcache.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +static OFLogger tstpreadLogger = OFLog::getLogger("dcmtk.test.tstpread"); + +// ******************************************** + +#define BUFSIZE 32768 + +static void createTestDataset(DcmDataset *dset, unsigned char *buffer) +{ + // byte array, VR=OB + dset->putAndInsertUint8Array(DCM_EncapsulatedDocument, buffer, BUFSIZE); + + // short array, VR=US + dset->putAndInsertUint16Array(DCM_RWavePointer, OFreinterpret_cast(Uint16 *, buffer), BUFSIZE/OFstatic_cast(Uint32, sizeof(Uint16))); + + // long array, VR=UL + DcmElement *elem = new DcmUnsignedLong(DCM_TableOfPixelValues); + elem->putUint32Array(OFreinterpret_cast(Uint32 *, buffer), BUFSIZE/OFstatic_cast(Uint32, sizeof(Uint32))); + dset->insert(elem); + + // double array, VR=FD + elem = new DcmFloatingPointDouble(DCM_TableOfYBreakPoints); + elem->putFloat64Array(OFreinterpret_cast(Float64 *, buffer), BUFSIZE/OFstatic_cast(Uint32, sizeof(Float64))); + dset->insert(elem); +} + +static OFCondition sequentialNonOverlappingRead(OFRandom& rnd, DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer) +{ + unsigned char *target = new unsigned char[BUFSIZE]; + Uint32 offset = 0; + Uint32 bytes_to_read = 0; + OFCondition cond; + + while (offset < BUFSIZE) + { + bytes_to_read = (rnd.getRND32() % 20)+1; // read 1 to 20 bytes + + // make sure we don't attempt to read beyond the end of the attribute value + if (offset + bytes_to_read > BUFSIZE) bytes_to_read = BUFSIZE - offset; + + cond = delem->getPartialValue(target, offset, bytes_to_read, dcache); + if (cond.bad()) + { + + delete[] target; + return cond; + } + + if (0 != memcmp(target, buffer+offset, bytes_to_read)) + { + OFOStringStream str; + str << "Error: unexpected sequence of " << bytes_to_read << " bytes found at offset " << offset << OFendl; + str << "Expected: "; + for (Uint32 i=0; i BUFSIZE) bytes_to_read = BUFSIZE - offset; + + cond = delem->getPartialValue(target, offset, bytes_to_read, dcache); + if (cond.bad()) + { + delete[] target; + return cond; + } + + if (0 != memcmp(target, buffer+offset, bytes_to_read)) + { + OFOStringStream str; + str << "Error: unexpected sequence of " << bytes_to_read << " bytes found at offset " << offset << OFendl; + str << "Expected: "; + for (Uint32 i=0; i 4) && (offset < BUFSIZE)) offset -= (rnd.getRND32() % 4); // let the read operations overlap by 0-3 bytes + } + delete[] target; + return EC_Normal; +} + +static OFCondition randomRead(OFRandom& rnd, DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer) +{ + unsigned char *target = new unsigned char[BUFSIZE]; + Uint32 offset = 0; + Uint32 bytes_to_read = 0; + OFCondition cond; + + for (int i=1000; i; --i) + { + bytes_to_read = (rnd.getRND32() % 20)+1; // read 1 to 20 bytes + offset = rnd.getRND32() % BUFSIZE; + + // make sure we don't attempt to read beyond the end of the attribute value + if (offset + bytes_to_read > BUFSIZE) bytes_to_read = BUFSIZE - offset; + + cond = delem->getPartialValue(target, offset, bytes_to_read, dcache); + if (cond.bad()) + { + delete[] target; + return cond; + } + + if (0 != memcmp(target, buffer+offset, bytes_to_read)) + { + OFOStringStream str; + str << "Error: unexpected sequence of " << bytes_to_read << " bytes found at offset " << offset << OFendl; + str << "Expected: "; + for (Uint32 k=0; kfindAndGetElement(DCM_EncapsulatedDocument, delem); + if (cond.bad()) return cond; + + cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_RWavePointer, delem); + if (cond.bad()) return cond; + + cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_TableOfPixelValues, delem); + if (cond.bad()) return cond; + + cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_TableOfYBreakPoints, delem); + if (cond.bad()) return cond; + + cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer); + + return cond; +} + +static OFCondition sequentialOverlappingRead(OFRandom& rnd, DcmDataset *dset, unsigned char *buffer) +{ + DcmFileCache cache; + DcmElement *delem = NULL; + OFCondition cond; + + cond = dset->findAndGetElement(DCM_EncapsulatedDocument, delem); + if (cond.bad()) return cond; + + cond = sequentialOverlappingRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_RWavePointer, delem); + if (cond.bad()) return cond; + + cond = sequentialOverlappingRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_TableOfPixelValues, delem); + if (cond.bad()) return cond; + + cond = sequentialOverlappingRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_TableOfYBreakPoints, delem); + if (cond.bad()) return cond; + + cond = sequentialOverlappingRead(rnd, delem, &cache, buffer); + + return cond; +} + +static OFCondition randomRead(OFRandom& rnd, DcmDataset *dset, unsigned char *buffer) +{ + DcmFileCache cache; + DcmElement *delem = NULL; + OFCondition cond; + + cond = dset->findAndGetElement(DCM_EncapsulatedDocument, delem); + if (cond.bad()) return cond; + + cond = randomRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_RWavePointer, delem); + if (cond.bad()) return cond; + + cond = randomRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_TableOfPixelValues, delem); + if (cond.bad()) return cond; + + cond = randomRead(rnd, delem, &cache, buffer); + if (cond.bad()) return cond; + + cond = dset->findAndGetElement(DCM_TableOfYBreakPoints, delem); + if (cond.bad()) return cond; + + cond = randomRead(rnd, delem, &cache, buffer); + + return cond; +} + +OFTEST(dcmdata_partialElementAccess) +{ + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFCHECK_FAIL("no data dictionary loaded, check environment variable: " DCM_DICT_ENVIRONMENT_VARIABLE); + return; + } + + OFLOG_DEBUG(tstpreadLogger, "Creating test dataset"); + + OFRandom rnd; + DcmFileFormat dfile; + + unsigned char *buffer = new unsigned char[BUFSIZE]; + unsigned char *bufptr = buffer; + for (int i = BUFSIZE; i; --i) + { + *bufptr++ = OFstatic_cast(unsigned char, rnd.getRND32()); + } + + createTestDataset(dfile.getDataset(), buffer); + OFCondition cond = EC_Normal; + + OFLOG_DEBUG(tstpreadLogger, "Writing test files"); + + cond = dfile.saveFile("test_be.dcm", EXS_BigEndianExplicit); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + cond = dfile.saveFile("test_le.dcm", EXS_LittleEndianExplicit); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } +#ifdef WITH_ZLIB + cond = dfile.saveFile("test_df.dcm", EXS_DeflatedLittleEndianExplicit); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } +#endif + + OFLOG_DEBUG(tstpreadLogger, "Opening test files"); + + DcmFileFormat dfile_be; + DcmFileFormat dfile_le; + DcmFileFormat dfile_df; + + cond = dfile_be.loadFile("test_be.dcm"); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + + cond = dfile_le.loadFile("test_le.dcm"); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + +#ifdef WITH_ZLIB + cond = dfile_df.loadFile("test_df.dcm"); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } +#endif + + // testing sequential, non overlapping reads of partial element values + OFLOG_DEBUG(tstpreadLogger, "Testing sequential, non overlapping reads of partial element values"); + + cond = sequentialNonOverlappingRead(rnd, dfile_be.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + + cond = sequentialNonOverlappingRead(rnd, dfile_le.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + +#ifdef WITH_ZLIB + cond = sequentialNonOverlappingRead(rnd, dfile_df.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } +#endif + + // testing random reads of partial element values + OFLOG_DEBUG(tstpreadLogger, "Testing random reads of partial element values"); + + cond = randomRead(rnd, dfile_be.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + + cond = randomRead(rnd, dfile_le.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + +#ifdef WITH_ZLIB + cond = randomRead(rnd, dfile_df.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } +#endif + + // testing overlapping reads of partial element values + OFLOG_DEBUG(tstpreadLogger, "Testing overlapping reads of partial element values"); + + cond = sequentialOverlappingRead(rnd, dfile_be.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + + cond = sequentialOverlappingRead(rnd, dfile_le.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } + +#ifdef WITH_ZLIB + cond = sequentialOverlappingRead(rnd, dfile_df.getDataset(), buffer); + if (cond.bad()) { OFCHECK_FAIL(cond.text()); } +#endif + + unlink("test_be.dcm"); + unlink("test_le.dcm"); +#ifdef WITH_ZLIB + unlink("test_df.dcm"); +#endif + delete[] buffer; +} diff --git a/dcmdata/tests/tspchrs.cc b/dcmdata/tests/tspchrs.cc new file mode 100644 index 00000000..3be6a1a2 --- /dev/null +++ b/dcmdata/tests/tspchrs.cc @@ -0,0 +1,219 @@ +/* + * + * Copyright (C) 2011-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmSpecificCharacterSet + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcspchrs.h" +#include "dcmtk/dcmdata/dctypes.h" + + +OFTEST(dcmdata_specificCharacterSet_1) +{ + DcmSpecificCharacterSet converter; + if (converter.isConversionAvailable()) + { + // try to select all DICOM character sets without code extensions + OFCHECK(converter.selectCharacterSet("").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 6 ").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 100").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 101").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 109").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 110").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 144").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 127").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 126").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 138").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 148").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 13 ").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 166").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 192").good()); + OFCHECK(converter.selectCharacterSet(" GB18030 ").good()); + OFCHECK(converter.selectCharacterSet(" GBK ").good()); + // try to select all DICOM character sets with code extensions + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 6 ").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 100").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 101").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 109").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 110").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 144").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 127").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 126").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 138").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 148").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 13 ").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 166").good()); +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICONV + // (only the ICONV library supports these character sets) + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 87 ").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 159").good()); +#endif + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 149").good()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 58 ").good()); + // the following should fail + OFCHECK(converter.selectCharacterSet("DCMTK").bad()); + OFCHECK(converter.selectCharacterSet(" \\ ").bad()); + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 999").bad()); + OFCHECK(converter.selectCharacterSet("\\ISO_IR 100").bad()); + OFCHECK(converter.selectCharacterSet("ISO 2022 IR 87\\ISO 2022 IR 100").bad()); + OFCHECK(converter.selectCharacterSet("ISO 2022 IR 159\\ISO 2022 IR 100").bad()); + OFCHECK(converter.selectCharacterSet("ISO 2022 IR 149\\ISO 2022 IR 100").bad()); + // the following should work + OFCHECK(converter.selectCharacterSet("ISO 2022 IR 6\\ISO 2022 IR 100").good()); + OFCHECK(converter.selectCharacterSet("ISO 2022 IR 100\\ISO 2022 IR 126").good()); + OFCHECK(converter.selectCharacterSet("ISO 2022 IR 144\\ISO 2022 IR 138").good()); + // use a different destination character set than the default (UTF-8) + OFCHECK(converter.selectCharacterSet("", "ISO_IR 100").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 6", "ISO_IR 100").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 192", " ISO_IR 100 ").good()); + OFCHECK(converter.selectCharacterSet("ISO_IR 192", "ISO 2022 IR 100\\ISO 2022 IR 126").bad()); + } else { + // in case there is no libiconv, report a warning but do not fail + DCMDATA_WARN("Cannot test DcmSpecificCharacterSet since the underlying character set conversion library is not available"); + } +} + +OFTEST(dcmdata_specificCharacterSet_2) +{ + DcmSpecificCharacterSet converter; + if (converter.isConversionAvailable()) + { + OFString resultStr; + // check whether string conversion from Latin-1 to UTF-8 works + OFCHECK(converter.selectCharacterSet("ISO_IR 100").good()); + OFCHECK(converter.convertString("J\366rg", resultStr).good()); + OFCHECK_EQUAL(resultStr, "J\303\266rg"); + OFCHECK(converter.convertString("J\351r\364me", resultStr).good()); + OFCHECK_EQUAL(resultStr, "J\303\251r\303\264me"); + // check whether string conversion from UTF-8 to UTF-8 works :-) + OFCHECK(converter.selectCharacterSet("ISO_IR 192").good()); + OFCHECK(converter.convertString("J\303\266rg", resultStr).good()); + OFCHECK_EQUAL(resultStr, "J\303\266rg"); + OFCHECK(converter.convertString("J\303\251r\303\264me", resultStr).good()); + OFCHECK_EQUAL(resultStr, "J\303\251r\303\264me"); + // the following should fail + converter.clear(); + OFCHECK(converter.convertString("Some Text", resultStr).bad()); + } else { + // in case there is no libiconv, report a warning but do not fail + DCMDATA_WARN("Cannot test DcmSpecificCharacterSet since the underlying character set conversion library is not available"); + } +} + + +OFTEST(dcmdata_specificCharacterSet_3) +{ + DcmSpecificCharacterSet converter; + if (converter.isConversionAvailable()) + { + OFString resultStr; + // we need the PN delimiters for a standard comformant conversion + const OFString delimiters("\\^="); +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICONV + // check whether string conversion from Japanese language to UTF-8 works + // (only the ICONV library supports these character sets) + // example taken from DICOM PS 3.5 Annex H.3.1 + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 87").good()); + OFCHECK(converter.convertString("Yamada^Tarou=\033$B;3ED\033(B^\033$BB@O:\033(B=\033$B$d$^$@\033(B^\033$B$?$m$&\033(B", resultStr, delimiters).good()); + OFCHECK_EQUAL(resultStr, "Yamada^Tarou=\345\261\261\347\224\260^\345\244\252\351\203\216=\343\202\204\343\201\276\343\201\240^\343\201\237\343\202\215\343\201\206"); + // example taken from DICOM PS 3.5 Annex H.3.2 + OFCHECK(converter.selectCharacterSet("ISO 2022 IR 13\\ISO 2022 IR 87").good()); + OFCHECK(converter.convertString("\324\317\300\336^\300\333\263=\033$B;3ED\033(J^\033$BB@O:\033(J=\033$B$d$^$@\033(J^\033$B$?$m$&\033(J", resultStr, delimiters).good()); + OFCHECK_EQUAL(resultStr, "\357\276\224\357\276\217\357\276\200\357\276\236^\357\276\200\357\276\233\357\275\263=\345\261\261\347\224\260^\345\244\252\351\203\216=\343\202\204\343\201\276\343\201\240^\343\201\237\343\202\215\343\201\206"); +#endif + // check whether string conversion from Korean language to UTF-8 works + // example taken from DICOM PS 3.5 Annex I.2 + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 149").good()); + OFCHECK(converter.convertString("Hong^Gildong=\033$)C\373\363^\033$)C\321\316\324\327=\033$)C\310\253^\033$)C\261\346\265\277", resultStr, delimiters).good()); + OFCHECK_EQUAL(resultStr, "Hong^Gildong=\346\264\252^\345\220\211\346\264\236=\355\231\215^\352\270\270\353\217\231"); + // modified example: check for 8-bit mode (using ASCII characters) + OFCHECK(converter.convertString("Hong^Gildong=\033$)C\373\363^\033$)C\321\316ASCII\324\327=\033$)C\310\253^\033$)C\261\346\265\277", resultStr, delimiters).good()); + OFCHECK_EQUAL(resultStr, "Hong^Gildong=\346\264\252^\345\220\211ASCII\346\264\236=\355\231\215^\352\270\270\353\217\231"); + // check whether string conversion from Chinese language to UTF-8 works + // example taken from DICOM PS 3.5 Annex J.3 + OFCHECK(converter.selectCharacterSet("GB18030").good()); + OFCHECK(converter.convertString("Wang^XiaoDong=\315\365^\320\241\266\253=", resultStr, delimiters).good()); + OFCHECK_EQUAL(resultStr, "Wang^XiaoDong=\347\216\213^\345\260\217\344\270\234="); + // check whether string conversion from Chinese language to UTF-8 works + // example taken from DICOM PS 3.5 Annex K.2 + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 58").good()); + OFCHECK(converter.convertString("Zhang^XiaoDong=\033\044\051\101\325\305\136\033\044\051\101\320\241\266\253=", resultStr, delimiters).good()); + OFCHECK_EQUAL(resultStr, "Zhang^XiaoDong=\345\274\240\136\345\260\217\344\270\234="); + // check whether CR and LF are detected correctly + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 13").good()); + OFCHECK(converter.convertString("Japanese\r\033(J\324\317\300\336\nText", resultStr).good()); + OFCHECK_EQUAL(resultStr, "Japanese\015\357\276\224\357\276\217\357\276\200\357\276\236\012Text"); + // same with '\' (backslash), which is used for separating multiple values + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 13").good()); + OFCHECK(converter.convertString("Japanese\\\033(J\324\317\300\336\\Text", resultStr, "\\").good()); + OFCHECK_EQUAL(resultStr, "Japanese\\\357\276\224\357\276\217\357\276\200\357\276\236\\Text"); + // the following should fail (wrong character set) + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 166").good()); + OFCHECK(converter.convertString("Yamada^Tarou=\033$B;3ED\033(B^\033$BB@O:\033(B=\033$B$d$^$@\033(B^\033$B$?$m$&\033(B", resultStr, delimiters).bad()); + } else { + // in case there is no libiconv, report a warning but do not fail + DCMDATA_WARN("Cannot test DcmSpecificCharacterSet since the underlying character set conversion library is not available"); + } +} + + +OFTEST(dcmdata_specificCharacterSet_4) +{ + DcmSpecificCharacterSet converter; + if (converter.isConversionAvailable()) + { + OFString resultStr; + // check whether string conversion from UTF-8 to Latin-1 works + OFCHECK(converter.selectCharacterSet("ISO_IR 192", "ISO_IR 100").good()); + OFCHECK(converter.convertString("J\303\266rg", resultStr).good()); + OFCHECK_EQUAL(resultStr, "J\366rg"); + OFCHECK(converter.convertString("J\303\251r\303\264me", resultStr).good()); + OFCHECK_EQUAL(resultStr, "J\351r\364me"); +#if DCMTK_ENABLE_CHARSET_CONVERSION == DCMTK_CHARSET_CONVERSION_ICONV + // (only the ICONV library supports this character set) + // the following should fail + OFCHECK(converter.selectCharacterSet("\\ISO 2022 IR 87", "ISO_IR 100").good()); + OFCHECK(converter.convertString("Yamada^Tarou=\033$B;3ED\033(B^\033$BB@O:\033(B=\033$B$d$^$@\033(B^\033$B$?$m$&\033(B", resultStr).bad()); +#endif + OFCHECK(converter.selectCharacterSet("ISO_IR 100", "").good()); + if (OFCharacterEncoding::supportsConversionFlags(OFCharacterEncoding::AbortTranscodingOnIllegalSequence)) + { + OFCHECK(converter.setConversionFlags(OFCharacterEncoding::AbortTranscodingOnIllegalSequence).good()); + OFCHECK(converter.convertString("J\366rg", resultStr).bad()); + } + if (OFCharacterEncoding::supportsConversionFlags(OFCharacterEncoding::DiscardIllegalSequences)) + { + OFCHECK(converter.setConversionFlags(OFCharacterEncoding::DiscardIllegalSequences).good()); + OFCHECK(converter.convertString("J\366rg", resultStr).good()); + OFCHECK_EQUAL(resultStr, "Jrg"); // discard mode removes characters that cannot be "translated" + } + if (OFCharacterEncoding::supportsConversionFlags(OFCharacterEncoding::TransliterateIllegalSequences)) + { + OFCHECK(converter.setConversionFlags(OFCharacterEncoding::TransliterateIllegalSequences).good()); + OFCHECK(converter.convertString("J\366rg", resultStr).good()); + OFCHECK_EQUAL(resultStr, "J\"org"); + } + } else { + // in case there is no libiconv, report a warning but do not fail + DCMDATA_WARN("Cannot test DcmSpecificCharacterSet since the underlying character set conversion library is not available"); + } +} diff --git a/dcmdata/tests/tstrval.cc b/dcmdata/tests/tstrval.cc new file mode 100644 index 00000000..9c059b5a --- /dev/null +++ b/dcmdata/tests/tstrval.cc @@ -0,0 +1,67 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for various "string value" methods + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcelem.h" + + +OFTEST(dcmdata_determineVM) +{ + OFCHECK_EQUAL(DcmElement::determineVM(NULL, 0), 0); + OFCHECK_EQUAL(DcmElement::determineVM("", 0), 0); + OFCHECK_EQUAL(DcmElement::determineVM(" ", 1), 1); + OFCHECK_EQUAL(DcmElement::determineVM("\\", 1), 2); + OFCHECK_EQUAL(DcmElement::determineVM("1\\2", 3), 2); + OFCHECK_EQUAL(DcmElement::determineVM("1\\2\\", 4), 3); + OFCHECK_EQUAL(DcmElement::determineVM("\\2\\3\\", 5), 4); + OFCHECK_EQUAL(DcmElement::determineVM("1\\\\\\4", 5), 4); + /* also test with embedded NULL byte */ + OFCHECK_EQUAL(DcmElement::determineVM("1\\\\\\\04", 6), 4); +} + +OFTEST(dcmdata_getValueFromString) +{ + OFString str; + /* simple test */ + OFCHECK_EQUAL(DcmElement::getValueFromString("1\\2\\3\\4", 0, 7, str), 2); + OFCHECK_EQUAL(str, "1"); + OFCHECK_EQUAL(DcmElement::getValueFromString("1\\2\\3\\4", 2, 7, str), 4); + OFCHECK_EQUAL(str, "2"); + OFCHECK_EQUAL(DcmElement::getValueFromString("1\\2\\3\\4", 4, 7, str), 6); + OFCHECK_EQUAL(str, "3"); + OFCHECK_EQUAL(DcmElement::getValueFromString("1\\2\\3\\4", 6, 7, str), 8); + OFCHECK_EQUAL(str, "4"); + /* boundary test */ + OFCHECK_EQUAL(DcmElement::getValueFromString("\\aa\\bbb\\", 0, 8, str), 1); + OFCHECK_EQUAL(str, ""); + OFCHECK_EQUAL(DcmElement::getValueFromString("\\aa\\bbb\\", 1, 8, str), 4); + OFCHECK_EQUAL(str, "aa"); + OFCHECK_EQUAL(DcmElement::getValueFromString("\\aa\\bbb\\", 4, 8, str), 8); + OFCHECK_EQUAL(str, "bbb"); + OFCHECK_EQUAL(DcmElement::getValueFromString("\\aa\\bbb\\", 8, 8, str), 8); + OFCHECK_EQUAL(str, ""); + /* test with embedded NULL byte */ + OFCHECK_EQUAL(DcmElement::getValueFromString("\\aa\\b\0bb\\", 4, 9, str), 9); + OFCHECK_EQUAL(str, OFString("b\0bb", 4)); +} diff --git a/dcmdata/tests/tvrcomp.cc b/dcmdata/tests/tvrcomp.cc new file mode 100644 index 00000000..a0b3cc73 --- /dev/null +++ b/dcmdata/tests/tvrcomp.cc @@ -0,0 +1,894 @@ +/* + * + * Copyright (C) 2015-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: tests for compare() operator of VR classes + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define OFTEST_OFSTD_ONLY +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcvras.h" +#include "dcmtk/dcmdata/dcvrae.h" +#include "dcmtk/dcmdata/dcchrstr.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrlt.h" +#include "dcmtk/dcmdata/dcvrpn.h" +#include "dcmtk/dcmdata/dcvrst.h" +#include "dcmtk/dcmdata/dcvrur.h" +#include "dcmtk/dcmdata/dcvrut.h" +#include "dcmtk/dcmdata/dcvras.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmdata/dcvrod.h" +#include "dcmtk/dcmdata/dcvrof.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmdata/dcvrfl.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcvrol.h" +#include "dcmtk/dcmdata/dcvrpobw.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcvrsl.h" +#include "dcmtk/dcmdata/dcvrss.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvruc.h" +#include "dcmtk/dcmdata/dcvrul.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcpxitem.h" +#include "dcmtk/dcmdata/dcpixel.h" +#include "dcmtk/dcmdata/dcvrpobw.h" +#include "dcmtk/dcmdata/dcovlay.h" +#include "dcmtk/dcmdata/dcpixel.h" +#include "dcmtk/dcmdata/dcpixseq.h" + + +template +static void checkStringBased( + const DcmTagKey& key, + const OFString& shortVal, + const OFString& longVal) +{ + // Start with equal values + StringType obj1(key); + StringType obj2(key); + StringType objOtherTag(DCM_UndefinedTagKey); + obj1.putOFStringArray(shortVal); + obj2.putOFStringArray(shortVal); + + // Check equality + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putOFStringArray(shortVal /* same value*/); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + OFCHECK(obj1 <= objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second string longer + obj2.putOFStringArray(longVal); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different number of values + OFString twoValues, threeValues; + twoValues = shortVal + "\\"; twoValues += shortVal; + threeValues = twoValues + "\\"; threeValues += shortVal; + obj1.putOFStringArray(twoValues); + obj2.putOFStringArray(threeValues); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + +static void checkAttributeTags() +{ + // Start with equal values + DcmAttributeTag obj1(DCM_FrameIncrementPointer); + DcmAttributeTag obj2(DCM_FrameIncrementPointer); + DcmAttributeTag objOtherTag(DCM_UndefinedTagKey); + obj1.putTagVal(DCM_PatientName); + obj2.putTagVal(DCM_PatientName); + + // Check equality + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putTagVal(DCM_PatientName); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + OFCHECK(obj1 <= objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second attribute larger + obj2.putTagVal(DCM_PatientID); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM + obj1.putTagVal(DCM_PatientName, 1); // VM = 2 + obj2.putTagVal(DCM_PatientName, 0); + obj2.putTagVal(DCM_PatientName, 1); + obj2.putTagVal(DCM_PatientName, 2); // VM = 3 + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + +static void checkOtherByteOtherWord() +{ + // Start with equal values + DcmOtherByteOtherWord obj1(DCM_PixelData); + DcmOtherByteOtherWord obj2(DCM_PixelData); + DcmOtherByteOtherWord objOtherTag(DCM_UndefinedTagKey); + + // Check equality + Uint8 testData[1] = {100}; + obj1.putUint8Array(testData, 1); + obj2.putUint8Array(testData, 1); + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putUint8Array(testData, 1); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + OFCHECK(obj1 <= objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second attribute larger + Uint8 biggerTestData[1] = {101}; + obj2.putUint8Array(biggerTestData, 1); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM + Uint8 largeVMTestData[2] = {100, 101}; + Uint8 evenLargerVMTestData[3] = {100, 101, 102}; + obj1.putUint8Array(largeVMTestData, 2); // VM = 2 + obj2.putUint8Array(evenLargerVMTestData, 3); // VM = 3 + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + +static void checkPolymorphOtherByteOtherWord() +{ + // Start comparing OB with OB + DcmPolymorphOBOW obj1_ob(DCM_PixelData); + DcmPolymorphOBOW obj2_ob(DCM_PixelData); + obj1_ob.setVR(EVR_OB); + obj2_ob.setVR(EVR_OB); + + OFCHECK(obj1_ob.compare(obj2_ob) == 0); + OFCHECK(obj1_ob >= obj2_ob); + OFCHECK(obj1_ob <= obj2_ob); + OFCHECK(obj2_ob >= obj1_ob); + OFCHECK(obj2_ob <= obj2_ob); + + // Compare with same values (still equal) + Uint8 testData_100[1] = {100}; + OFCHECK(obj1_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == 0); + OFCHECK(obj1_ob >= obj2_ob); + OFCHECK(obj1_ob <= obj2_ob); + OFCHECK(obj2_ob >= obj1_ob); + OFCHECK(obj2_ob <= obj2_ob); + OFCHECK(!(obj1_ob > obj2_ob)); + OFCHECK(!(obj1_ob < obj2_ob)); + + + // Compare with different values (single value, obj1 < obj2) + Uint8 testData_200[1] = {200}; + OFCHECK(obj1_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj2_ob.putUint8Array(testData_200, 1).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == -1); + OFCHECK(obj1_ob < obj2_ob); + OFCHECK(obj1_ob <= obj2_ob); + + // Compare with different number of values (less values, i.e. obj1, means smaller) + Uint8 testData_100_200[2] = {100,200}; + OFCHECK(obj1_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj1_ob.compare(obj2_ob) < 0); + OFCHECK(obj1_ob < obj2_ob); + OFCHECK(obj1_ob <= obj2_ob); + + // Compare values (same multiple values means equal) + OFCHECK(obj1_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == 0); + OFCHECK(!(obj1_ob < obj2_ob)); + OFCHECK(!(obj2_ob < obj2_ob)); + OFCHECK(obj1_ob <= obj2_ob); + + // Compare values (same number of values but different values means not equal, obj1 < obj2) + Uint8 testData_100_201[2] = {100,201}; + OFCHECK(obj1_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100_201, 2).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == -1); + OFCHECK(obj1_ob < obj2_ob); + OFCHECK(!(obj2_ob < obj2_ob)); + OFCHECK(obj1_ob <= obj2_ob); +} + + +static void checkDcmPixelDataNative() +{ + // Testing DcmPixelData having uncompressed pixel data. + // The tests here finally boil down in the usage of + // DcmPolymorphOBOW::compare() which is called within + // DcmPixelData::compare() + + // ------------------------------- + // Start with comparing OB with OB + // ------------------------------- + + DcmPixelData obj1_ob(DCM_PixelData); + DcmPixelData obj2_ob(DCM_PixelData); + obj1_ob.setVR(EVR_OB); + obj2_ob.setVR(EVR_OB); + + // Compare empty + OFCHECK(obj1_ob.compare(obj2_ob) == 0); + OFCHECK(obj1_ob >= obj2_ob); + OFCHECK(obj2_ob >= obj1_ob); + + // Compare with same values (still equal), uncompressed + Uint8 testData_100[1] = {100}; + OFCHECK(obj1_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == 0); + OFCHECK(obj1_ob >= obj2_ob); + OFCHECK(obj2_ob >= obj1_ob); + OFCHECK(!(obj1_ob > obj2_ob)); + OFCHECK(!(obj1_ob < obj2_ob)); + + // Compare with different values (single value, obj1 < obj2) + Uint8 testData_200[1] = {200}; + OFCHECK(obj1_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj2_ob.putUint8Array(testData_200, 1).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == -1); + OFCHECK(obj1_ob < obj2_ob); + OFCHECK(obj1_ob <= obj2_ob); + + // Compare with different number of values (less values, i.e. obj1, means smaller) + Uint8 testData_100_200[2] = {100,200}; + OFCHECK(obj1_ob.putUint8Array(testData_100, 1).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj1_ob.compare(obj2_ob) < 0); + OFCHECK(obj1_ob < obj2_ob); + OFCHECK(obj1_ob <= obj2_ob); + + // Compare values (same multiple values means equal) + OFCHECK(obj1_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == 0); + OFCHECK(!(obj1_ob < obj2_ob)); + OFCHECK(!(obj2_ob < obj2_ob)); + OFCHECK(obj1_ob <= obj2_ob); + + // Compare values (same number of values but different values means not equal, obj1 < obj2) + Uint8 testData_100_201[2] = {100,201}; + OFCHECK(obj1_ob.putUint8Array(testData_100_200, 2).good()); + OFCHECK(obj2_ob.putUint8Array(testData_100_201, 2).good()); + OFCHECK(obj1_ob.compare(obj2_ob) == -1); + OFCHECK(obj1_ob < obj2_ob); + OFCHECK(!(obj2_ob < obj2_ob)); + OFCHECK(obj1_ob <= obj2_ob); + + // ------------------------------- + // Continue comparing OW with OW + // ------------------------------- + + DcmPixelData obj1_ow(DCM_PixelData); + DcmPixelData obj2_ow(DCM_PixelData); + obj1_ow.setVR(EVR_OW); + obj2_ow.setVR(EVR_OW); + + // Compare empty (equal) + OFCHECK(obj1_ow.compare(obj2_ow) == 0); + OFCHECK(obj1_ow >= obj2_ow); + OFCHECK(obj2_ow >= obj1_ow); + + // Compare with same values (still equal), uncompressed + Uint16 testData_1000[1] = {0x1000}; + OFCHECK(obj1_ow.putUint16Array(testData_1000, 1).good()); + OFCHECK(obj2_ow.putUint16Array(testData_1000, 1).good()); + OFCHECK(obj1_ow.compare(obj2_ow) == 0); + OFCHECK(obj1_ow >= obj2_ow); + OFCHECK(obj2_ow >= obj1_ow); + + // Compare with different values (single value) + Uint16 testData_2000[1] = {0x2000}; + OFCHECK(obj1_ow.putUint16Array(testData_1000, 1).good()); + OFCHECK(obj2_ow.putUint16Array(testData_2000, 1).good()); + OFCHECK(obj1_ow.compare(obj2_ow) == -1); + OFCHECK(obj1_ow < obj2_ow); + + // Compare with different number of values (less values, i.e. obj1, means smaller) + Uint16 testData_1000_2000[2] = {0x1000,0x2000}; + OFCHECK(obj1_ow.putUint16Array(testData_1000, 1).good()); + OFCHECK(obj2_ow.putUint16Array(testData_1000_2000, 2).good()); + OFCHECK(obj1_ow.compare(obj2_ow) < 0); + OFCHECK(obj1_ow < obj2_ow); + + // Compare values (same multiple values means equal) + OFCHECK(obj1_ow.putUint16Array(testData_1000_2000, 2).good()); + OFCHECK(obj2_ow.putUint16Array(testData_1000_2000, 2).good()); + OFCHECK(obj1_ow.compare(obj2_ow) == 0); + OFCHECK(!(obj1_ow < obj2_ow)); + OFCHECK(!(obj2_ow < obj2_ow)); + OFCHECK(obj1_ow <= obj2_ow); + + // Compare values (same number of values but different values means not equal, obj1 < obj2) + Uint16 testData_1000_2001[2] = {0x1000,0x2001}; + OFCHECK(obj1_ow.putUint16Array(testData_1000_2000, 2).good()); + OFCHECK(obj2_ow.putUint16Array(testData_1000_2001, 2).good()); + OFCHECK(obj1_ow.compare(obj2_ow) == -1); + OFCHECK(obj1_ow < obj2_ow); + OFCHECK(!(obj2_ow < obj2_ow)); + OFCHECK(obj1_ow <= obj2_ow); + + + // Continue with comparison of OB with OW + Uint8 testData8_10[1] = {0x10}; + Uint16 testData16_0010[1] = {0x0010}; + obj1_ob.putUint8Array(testData8_10, 1); + obj2_ow.putUint16Array(testData16_0010, 1); + // OB and OW with same value should be equal + // (comparison takes place bytewise in little endian) + OFCHECK(obj1_ob.compare(obj2_ow) == 0); + OFCHECK(obj1_ob >= obj2_ow); + OFCHECK(obj2_ow >= obj1_ob); + + // Compare with different values + Uint16 testData16_0011[1] = {0x0011}; + OFCHECK(obj1_ob.putUint8Array(testData8_10, 1).good()); + OFCHECK(obj2_ow.putUint16Array(testData16_0011, 1).good()); + OFCHECK(obj1_ob.compare(obj2_ow) < 0); + OFCHECK(obj1_ob < obj2_ow); + + // Compare with different number of values (less values, i.e. obj1, means smaller) + Uint16 testData16_0010_0020[2] = {0x0010,0x0020}; + OFCHECK(obj1_ob.putUint8Array(testData8_10, 1).good()); + OFCHECK(obj2_ow.putUint16Array(testData16_0010_0020, 2).good()); + OFCHECK(obj1_ow.compare(obj2_ow) < 0); + OFCHECK(obj1_ow < obj2_ow); +} + + +static void checkDcmPixelDataEncapsulatedOB() +{ + DcmPixelData obj1_ob(DCM_PixelData); + DcmPixelData obj2_ob(DCM_PixelData); + obj1_ob.setVR(EVR_OB); + obj2_ob.setVR(EVR_OB); + Uint8 testData8_1010[2] = {0x10,0x10}; + + // (Compare empty already om checkDcmPixelDataNative()) + + // -------------------------------------------- + // Compare with same current representation + // -------------------------------------------- + + DcmPixelSequence *pixseq1 = new DcmPixelSequence(DCM_PixelData); + OFCHECK(pixseq1 != NULL); + DcmOffsetList offsetList; + DcmPixelItem *offsetItem = new DcmPixelItem(DCM_PixelItemTag); + OFCHECK(offsetItem != NULL); + // First item is always offset table + OFCHECK(pixseq1->insert(offsetItem).good()); + OFCHECK(pixseq1->storeCompressedFrame(offsetList, testData8_1010, 2, 0).good()); + obj1_ob.putOriginalRepresentation(EXS_JPEGProcess14SV1, NULL, pixseq1); + + // Compare objects with two equal single frames + DcmPixelSequence *pixseq2 = new DcmPixelSequence(DCM_PixelData); + OFCHECK(pixseq2 != NULL); + offsetItem = new DcmPixelItem(DCM_PixelItemTag); + OFCHECK(offsetItem != NULL); + OFCHECK(pixseq2->insert(offsetItem).good()); + OFCHECK(pixseq2->storeCompressedFrame(offsetList, testData8_1010, 2, 0).good()); + obj2_ob.putOriginalRepresentation(EXS_JPEGProcess14SV1, NULL, pixseq2); + OFCHECK(obj1_ob.compare(obj2_ob) == 0); + OFCHECK(obj1_ob >= obj2_ob); + + // Compare object with single frame with one with no frame + DcmPixelItem* remove = NULL; + OFCHECK(pixseq2->remove(remove, 1).good()); // remove frame 1 + OFCHECK(obj1_ob.compare(obj2_ob) > 0 ); + + // Compare object with single frame, and with two frames + OFCHECK(pixseq2->insert(remove, 1).good()); // insert frame 1 back in again + OFCHECK(pixseq2->storeCompressedFrame(offsetList, testData8_1010, 2, 0).good()); + OFCHECK(obj1_ob.compare(obj2_ob) < 0); //1 frames < 2 frames + + // Compare objects, both having two frames, with the second frame being different + Uint8 testData8_0505[2] = {0x05,0x05}; + OFCHECK(pixseq1->storeCompressedFrame(offsetList, testData8_0505, 2, 0).good()); + OFCHECK(obj1_ob.compare(obj2_ob) < 0); + + // -------------------------------------------- + // Compare with different current representation + // -------------------------------------------- + + DcmPixelData obj3_ob(DCM_PixelData); + obj3_ob.setVR(EVR_OB); + DcmPixelSequence *pixseq3 = new DcmPixelSequence(DCM_PixelData); + OFCHECK(pixseq3 != NULL); + offsetItem = new DcmPixelItem(DCM_PixelItemTag); + OFCHECK(offsetItem != NULL); + OFCHECK(pixseq3->insert(offsetItem).good()); + // Add same data as in pixseq1 + OFCHECK(pixseq3->storeCompressedFrame(offsetList, testData8_1010, 2, 0).good()); + OFCHECK(pixseq3->storeCompressedFrame(offsetList, testData8_0505, 2, 0).good()); + // But insert and pretend that is RLE + obj3_ob.putOriginalRepresentation(EXS_RLELossless, NULL, pixseq3); + // compare JPEG (pixseq1), with RLE (pixseq3) + OFCHECK(obj1_ob.compare(obj3_ob) == 1); // different current representation returns 1 +} + + +static void checkSignedLong() +{ + // Start with equal values + DcmSignedLong obj1(DCM_SelectorSLValue); + DcmSignedLong obj2(DCM_SelectorSLValue); + DcmSignedLong objOtherTag(DCM_UndefinedTagKey); + + // Check equality + obj1.putSint32(-10); + obj2.putSint32(-10); + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putSint32(-10); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second attribute larger + obj2.putSint32(-5); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM + obj1.putSint32(-10); // VM = 2 + obj2.putSint32(-10, 0); + obj2.putSint32(-10, 1); + obj2.putSint32(-10, 2); // VM = 3 + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + +static void checkSignedShort() +{ + // Start with equal values + DcmSignedShort obj1(DCM_SelectorSSValue); + DcmSignedShort obj2(DCM_SelectorSSValue); + DcmSignedShort objOtherTag(DCM_UndefinedTagKey); + + // Check equality + obj1.putSint16(-10); + obj2.putSint16(-10); + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putSint16(-10); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + OFCHECK(obj1 <= objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second attribute larger + obj2.putSint16(-5); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM + obj1.putSint16(-10); // VM = 2 + obj2.putSint16(-10, 0); + obj2.putSint16(-10, 1); + obj2.putSint16(-10, 2); // VM = 3 + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + +static void checkUnsignedLong() +{ + // Start with equal values + DcmUnsignedLong obj1(DCM_SelectorULValue); + DcmUnsignedLong obj2(DCM_SelectorULValue); + DcmUnsignedLong objOtherTag(DCM_UndefinedTagKey); + + // Check equality + obj1.putUint32(10); + obj2.putUint32(10); + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putUint32(10); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + OFCHECK(obj1 <= objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second attribute larger + obj2.putUint32(10000); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM + obj1.putUint32(10); // VM = 2 + obj2.putUint32(10, 0); + obj2.putUint32(10, 1); + obj2.putUint32(10, 2); // VM = 3 + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + +static void checkUnsignedShort() +{ + // Start with equal values + DcmUnsignedShort obj1(DCM_SelectorUSValue); + DcmUnsignedShort obj2(DCM_SelectorUSValue); + DcmUnsignedShort objOtherTag(DCM_UndefinedTagKey); + + // Check equality + obj1.putUint16(10); + obj2.putUint16(10); + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj2) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putUint16(10); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + OFCHECK(obj1 <= objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second attribute larger + obj2.putUint16(10000); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM + obj1.putUint16(10); // VM = 2 + obj2.putUint16(10, 0); + obj2.putUint16(10, 1); + obj2.putUint16(10, 2); // VM = 3 + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + + +static void checkOtherLong() +{ + // Start with equal values + DcmOtherLong obj1(DCM_LongTrianglePointIndexList); + DcmOtherLong obj2(DCM_LongTrianglePointIndexList); + DcmOtherLong objOtherTag(DCM_UndefinedTagKey); + + // Check equality + obj1.putUint32(100000); + obj2.putUint32(100000); + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj2) && (obj1 >= obj2) ); + + // Check differing tags (DCM_UndefinedTagKey always smaller than any other key) + objOtherTag.putUint32(100000); + OFCHECK(obj1.compare(objOtherTag) < 0); + OFCHECK(obj1 < objOtherTag); + OFCHECK(obj1 <= objOtherTag); + // Reverse test should yield opposite result + OFCHECK(objOtherTag.compare(obj1) > 0); + OFCHECK(objOtherTag > obj1); + OFCHECK(objOtherTag >= obj1); + + // Check second attribute larger + obj2.putUint32(200000); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM + obj1.putUint32(100000); // VM = 2 + obj2.putUint32(100000, 0); + obj2.putUint32(100000, 1); + obj2.putUint32(100000, 2); // VM = 3 + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); +} + + + +static void checkDcmItemAndSequences() +{ + // Start with equal values + DcmItem obj1; + DcmItem obj2; + + obj1.putAndInsertUint16(DCM_Rows, 10); + obj1.putAndInsertUint16(DCM_Columns, 10); + obj2.putAndInsertUint16(DCM_Rows, 10); + obj2.putAndInsertUint16(DCM_Columns, 10); + + // Check equality + OFCHECK_EQUAL(obj1.compare(obj2), 0); + OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(obj2.compare(obj1), 0); + OFCHECK( (obj2 >= obj2) && (obj1 >= obj1) ); + + // Check values in second item larger. Make sure that the first value remains equal. + obj2.putAndInsertUint16(DCM_Columns, 100); + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1); + OFCHECK(obj2 >= obj1); + + // Test different VM (i.e. item cardinality): + // obj1 has VM = 2 + // Make obj2 VM = 3 by adding another tag + obj2.insertEmptyElement(DCM_PixelData); + + OFCHECK(obj1.compare(obj2) < 0); + OFCHECK(obj1 < obj2); + OFCHECK(obj1 <= obj2 ); + // Reverse test should yield opposite result + OFCHECK(obj2.compare(obj1) > 0); + OFCHECK(obj2 > obj1 ); + OFCHECK(obj2 >= obj1 ); + + // Check sequences + + DcmSequenceOfItems seq1(DCM_AnatomicRegionModifierSequence); + obj2.findAndDeleteElement(DCM_PixelData); // reset obj2 + seq1.insert(new DcmItem(obj1)); + seq1.insert(new DcmItem(obj2)); + DcmSequenceOfItems seq2(DCM_AnatomicRegionModifierSequence); + seq2.insert(new DcmItem(obj1)); + seq2.insert(new DcmItem(obj2)); + + // Check equality + OFCHECK_EQUAL(seq1.compare(seq2), 0); + OFCHECK( (seq1 <= seq2) && (seq2 <= seq1) ); + // Reverse test should yield same result + OFCHECK_EQUAL(seq2.compare(seq1), 0); + OFCHECK( (seq2 >= seq1) && (seq1 >= seq2) ); + + // Test different VM (i.e. sequence cardinality): + // seq1 has VM = 2 + // Make seq2 VM = 3 by adding another item + seq2.insertAtCurrentPos(new DcmItem());; + + OFCHECK(seq1.compare(seq2) < 0); + OFCHECK(seq1 < seq2); + OFCHECK(seq1 <= seq2); + // Reverse test should yield opposite result + OFCHECK(seq2.compare(seq1) > 0); + OFCHECK(seq2 > seq1); + OFCHECK(seq2 >= seq1); +} + + +OFTEST(dcmdata_VRCompare) +{ + // Check the different String-based VRs (in the sense that the method + // putAndInsertOFStringArray() can be used by the test method for initializing + // the test values. + // This applies to: AE, AS, CS, DA, DS, DT, FD, FL, IS, LO, LT, OD, OF, PN, + // SH, ST, TM, UC, UI, UR, UT. + // Sometimes the maximum length of the VR is exceed deliberately to perform + // the test, which is even useful since on that level DCMTK allows invalid + // values in order to handle incorrect datasets. + checkStringBased(DCM_RetrieveAETitle,"AE1", "AE1_CT"); + checkStringBased(DCM_PatientAge, "008Y", "008YY"); + checkStringBased(DCM_BlendingMode, "SOME", "SOME_LONGER"); + checkStringBased(DCM_StudyDate, "19771212", "1977121200"); + checkStringBased(DCM_ProcedureStepProgress, "0.0", "0.01"); + checkStringBased(DCM_SOPAuthorizationDateTime, "19771212235900", "19771212235900.123456"); + checkStringBased(DCM_BeamDeliveryDurationLimit, "10", "10.5"); + checkStringBased(DCM_IsocenterToWedgeTrayDistance, "10", "10.5"); + checkStringBased(DCM_NumberOfWedges, "100", "1000"); + checkStringBased(DCM_SeriesDescription, "Description", "Description Long"); + checkStringBased(DCM_AdditionalPatientHistory, "Text", "Text Long"); + checkStringBased(DCM_DoubleFloatPixelData, "10", "10.5"); + checkStringBased(DCM_FloatPixelData, "10", "10.5"); + checkStringBased(DCM_OtherPatientNames, "Bond^James", "Bond^James^T."); + checkStringBased(DCM_WedgeID, "WEDGE1", "WEDGE1_LONG"); + checkStringBased(DCM_RTPlanDescription, "Text", "Text Long"); + checkStringBased(DCM_StudyTime, "235959", "235959.123456"); + checkStringBased(DCM_LongCodeValue, "Code_0815", "Code_0815_4711"); + checkStringBased(DCM_SOPInstanceUID, "1.2.3.4", "1.2.3.4.5"); + checkStringBased(DCM_RetrieveURL, "http://wwww.dcmtk.org", "http://www.dcmtk.org/dcmtk.php.en"); + checkStringBased(DCM_TextValue, "Some (very long) text...", "Some (very long) text... hmm, not really."); + + // Check the rest + checkAttributeTags(); + checkOtherByteOtherWord(); + checkPolymorphOtherByteOtherWord(); + checkOtherLong(); + checkSignedLong(); + checkSignedShort(); + checkDcmItemAndSequences(); + checkUnsignedLong(); + checkUnsignedShort(); + // Special VR helper classes: + checkDcmPixelDataNative(); + checkDcmPixelDataEncapsulatedOB(); + // UN is not represented by its own class but is handled by OB/OW VR + + // The following, recently introduced VRs are not tested yet: OV, SV, UV. +} diff --git a/dcmdata/tests/tvrdatim.cc b/dcmdata/tests/tvrdatim.cc new file mode 100644 index 00000000..16d21cfa --- /dev/null +++ b/dcmdata/tests/tvrdatim.cc @@ -0,0 +1,144 @@ +/* + * + * Copyright (C) 2002-2013, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for classes DcmDate, DcmTime and DcmDateTime + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +#define CHECK_EQUAL(string) do { \ + strstream << OFStringStream_ends; \ + OFSTRINGSTREAM_GETOFSTRING(strstream, res); \ + OFCHECK_EQUAL(res, string); \ + strstream.clear(); \ + strstream.str(""); \ +} while (0) +#define CHECK_STREAM_EQUAL(val, string) do { \ + strstream << val; \ + CHECK_EQUAL(string); \ + strstream.clear(); \ + strstream.str(""); \ +} while(0) + +OFTEST(dcmdata_dateTime) +{ + double timeZone; + OFDate dateVal; + OFTime timeVal; + OFDateTime dateTime; + OFString string; + DcmDate dcmDate(DCM_StudyDate); + DcmTime dcmTime(DCM_StudyTime); + DcmDateTime dcmDateTime(DCM_DateTime); + OFOStringStream strstream; + + // Determine the local time zone, needed because setOFTime loses the timezone + timeVal.setCurrentTime(); + const double localTimeZone = timeVal.getTimeZone(); + + OFDate curDateVal(2011, 5, 9); + OFTime curTimeVal(10, 35, 20, localTimeZone); + OFDateTime curDateTimeVal(curDateVal, curTimeVal); + + dcmDate.setOFDate(curDateVal); + dcmDate.print(strstream); + CHECK_EQUAL("(0008,0020) DA [20110509] # 8, 1 StudyDate\n"); + OFCHECK(dcmDate.getOFDate(dateVal).good()); + OFCHECK_EQUAL(dateVal, curDateVal); + + dcmTime.setOFTime(curTimeVal); + dcmTime.print(strstream); + CHECK_EQUAL("(0008,0030) TM [103520] # 6, 1 StudyTime\n"); + OFCHECK(dcmTime.getOFTime(timeVal).good()); + OFCHECK_EQUAL(timeVal, curTimeVal); + + dcmDateTime.setOFDateTime(curDateTimeVal); + dcmDateTime.print(strstream); + CHECK_EQUAL("(0040,a120) DT [20110509103520] # 14, 1 DateTime\n"); + OFCHECK(dcmDateTime.getOFDateTime(dateTime).good()); + OFCHECK_EQUAL(dateTime, curDateTimeVal); + OFCHECK(dateTime.getISOFormattedDateTime(string, OFTrue /*seconds*/, OFTrue /*fraction*/, OFFalse /*timeZone*/, OFFalse /*delimiter*/)); + OFCHECK_EQUAL(string, "20110509103520.000000"); + + dcmTime.putString("12"); + dcmTime.print(strstream); + CHECK_EQUAL("(0008,0030) TM [12] # 2, 1 StudyTime\n"); + OFCHECK(dcmTime.getOFTime(timeVal).good()); + CHECK_STREAM_EQUAL(timeVal, "12:00:00"); + + dcmTime.putString("1203"); + dcmTime.print(strstream); + CHECK_EQUAL("(0008,0030) TM [1203] # 4, 1 StudyTime\n"); + OFCHECK(dcmTime.getOFTime(timeVal).good()); + CHECK_STREAM_EQUAL(timeVal, "12:03:00"); + + dcmTime.putString("120315"); + dcmTime.print(strstream); + CHECK_EQUAL("(0008,0030) TM [120315] # 6, 1 StudyTime\n"); + OFCHECK(dcmTime.getOFTime(timeVal).good()); + CHECK_STREAM_EQUAL(timeVal, "12:03:15"); + dcmTime.putString("120301.99"); + dcmTime.print(strstream); + CHECK_EQUAL("(0008,0030) TM [120301.99] # 10, 1 StudyTime\n"); + OFCHECK(dcmTime.getOFTime(timeVal).good()); + timeVal.getISOFormattedTime(string, OFTrue /*seconds*/, OFTrue /*fraction*/, OFFalse /*timeZone*/); + OFCHECK_EQUAL(string, "12:03:01.990000"); + + dcmTime.putString("12:03"); + dcmTime.print(strstream); + CHECK_EQUAL("(0008,0030) TM [12:03] # 6, 1 StudyTime\n"); + OFCHECK(dcmTime.getOFTime(timeVal).good()); + CHECK_STREAM_EQUAL(timeVal, "12:03:00"); + dcmTime.putString("12:03:15"); + dcmTime.print(strstream); + CHECK_EQUAL("(0008,0030) TM [12:03:15] # 8, 1 StudyTime\n"); + OFCHECK(dcmTime.getOFTime(timeVal).good()); + CHECK_STREAM_EQUAL(timeVal, "12:03:15"); + + OFCHECK(DcmTime::getTimeZoneFromString("+0030", timeZone).good()); + OFCHECK_EQUAL(timeZone, 0.5); + OFCHECK(DcmTime::getTimeZoneFromString("+1130", timeZone).good()); + OFCHECK_EQUAL(timeZone, 11.5); + OFCHECK(DcmTime::getTimeZoneFromString("-0100", timeZone).good()); + OFCHECK_EQUAL(timeZone, -1); + OFCHECK(DcmTime::getTimeZoneFromString("-0530", timeZone).good()); + OFCHECK_EQUAL(timeZone, -5.5); + OFCHECK(DcmTime::getTimeZoneFromString("01130", timeZone).bad()); + OFCHECK(DcmTime::getTimeZoneFromString("+100", timeZone).bad()); + OFCHECK(DcmTime::getTimeZoneFromString("UTC+1", timeZone).bad()); + + dcmDateTime.putString("200204101203+0500"); + dcmDateTime.print(strstream); + CHECK_EQUAL("(0040,a120) DT [200204101203+0500] # 18, 1 DateTime\n"); + OFCHECK(dcmDateTime.getOFDateTime(dateTime).good()); + CHECK_STREAM_EQUAL(dateTime, "2002-04-10 12:03:00"); + + dcmDateTime.putString("20020410"); + dcmDateTime.print(strstream); + CHECK_EQUAL("(0040,a120) DT [20020410] # 8, 1 DateTime\n"); + OFCHECK(dcmDateTime.getOFDateTime(dateTime).good()); + dateTime.getISOFormattedDateTime(string, OFTrue /*seconds*/, OFFalse /*fraction*/, OFFalse /*timeZone*/); + OFCHECK_EQUAL(string, "2002-04-10 00:00:00"); +} diff --git a/dcmdata/tests/tvrds.cc b/dcmdata/tests/tvrds.cc new file mode 100644 index 00000000..8c3a15ff --- /dev/null +++ b/dcmdata/tests/tvrds.cc @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmDecimalString + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +OFTEST(dcmdata_decimalString_1) +{ + DcmDecimalString decStr(DCM_ContourData); + OFVector doubleVals; + OFCHECK(decStr.putString("1\\2.0\\3.5\\-4.99\\+500.005\\6.66E-01").good()); + OFCHECK(decStr.getFloat64Vector(doubleVals).good()); + OFCHECK_EQUAL(doubleVals.size(), 6); + OFCHECK_EQUAL(doubleVals[0], 1); + OFCHECK_EQUAL(doubleVals[1], 2); + OFCHECK_EQUAL(doubleVals[2], 3.5); + OFCHECK_EQUAL(doubleVals[3], -4.99); + OFCHECK_EQUAL(doubleVals[4], 500.005); + OFCHECK_EQUAL(doubleVals[5], 0.666); +} + +OFTEST(dcmdata_decimalString_2) +{ + DcmDecimalString decStr(DCM_ContourData); + OFVector doubleVals; + /* insert a NULL byte into the string */ + OFCHECK(decStr.putString("1\\2.0\\3.5\\-4.99\0\\+500.005\\6.66E-01", 34).good()); + OFCHECK(decStr.getFloat64Vector(doubleVals).good()); + OFCHECK_EQUAL(doubleVals.size(), 6); + OFCHECK_EQUAL(doubleVals[0], 1); + OFCHECK_EQUAL(doubleVals[1], 2); + OFCHECK_EQUAL(doubleVals[2], 3.5); + OFCHECK_EQUAL(doubleVals[3], -4.99); + OFCHECK_EQUAL(doubleVals[4], 500.005); + OFCHECK_EQUAL(doubleVals[5], 0.666); +} + +OFTEST(dcmdata_decimalString_3) +{ + DcmDecimalString decStr(DCM_ContourData); + OFVector doubleVals; + /* insert a NULL byte into the string */ + OFCHECK(decStr.putOFStringArray(OFString("1\\2.0\\3.5\\-4.99\0\\+500.005\\6.66E-01", 34)).good()); + OFCHECK(decStr.getFloat64Vector(doubleVals).good()); + OFCHECK_EQUAL(doubleVals.size(), 6); + OFCHECK_EQUAL(doubleVals[0], 1); + OFCHECK_EQUAL(doubleVals[1], 2); + OFCHECK_EQUAL(doubleVals[2], 3.5); + OFCHECK_EQUAL(doubleVals[3], -4.99); + OFCHECK_EQUAL(doubleVals[4], 500.005); + OFCHECK_EQUAL(doubleVals[5], 0.666); +} + +OFTEST(dcmdata_decimalString_4) +{ + DcmDecimalString decStr(DCM_ContourData); + OFVector doubleVals; + OFCHECK(decStr.putString("1\\2.0\\3.5\\-4.99\\+500.005\\6.66E-01\\").good()); + OFCHECK_EQUAL(decStr.getVM(), 7); + OFCHECK(decStr.putString("\\1\\2.0\\3.5\\-4.99\\+500.005\\6.66E-01").good()); + OFCHECK_EQUAL(decStr.getVM(), 7); + OFCHECK(decStr.putString("1\\2.0\\3.5\\-4.99\\ \\+500.005\\6.66E-01").good()); + OFCHECK_EQUAL(decStr.getVM(), 7); + /* insert an invalid value into the string */ + OFCHECK(decStr.putString("1\\2.0\\3.5\\-4.99\\ - \\+500.005\\6.66E-01").good()); + OFCHECK(decStr.getFloat64Vector(doubleVals).bad()); + OFCHECK_EQUAL(doubleVals.size(), 4); +} diff --git a/dcmdata/tests/tvrfd.cc b/dcmdata/tests/tvrfd.cc new file mode 100644 index 00000000..45fd48df --- /dev/null +++ b/dcmdata/tests/tvrfd.cc @@ -0,0 +1,63 @@ +/* + * + * Copyright (C) 2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmFloatingPointDouble + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +OFTEST(dcmdata_floatingPointDouble) +{ + Float64 value; + DcmFloatingPointDouble floatDouble(DCM_InversionTimes); + /* append new values */ + OFCHECK(floatDouble.putFloat64(1.1, 0).good()); + OFCHECK(floatDouble.putFloat64(2.2, 1).good()); + OFCHECK(floatDouble.putFloat64(3.3, 2).good()); + OFCHECK(floatDouble.putFloat64(4.4, 3).good()); + OFCHECK(floatDouble.putFloat64(5.5, 5).bad()); + /* check number of values */ + OFCHECK_EQUAL(floatDouble.getVM(), 4); + /* check all set values */ + OFCHECK(floatDouble.getFloat64(value, 0).good()); + OFCHECK_EQUAL(value, 1.1); + OFCHECK(floatDouble.getFloat64(value, 1).good()); + OFCHECK_EQUAL(value, 2.2); + OFCHECK(floatDouble.getFloat64(value, 2).good()); + OFCHECK_EQUAL(value, 3.3); + OFCHECK(floatDouble.getFloat64(value, 3).good()); + OFCHECK_EQUAL(value, 4.4); + /* change existing values */ + OFCHECK(floatDouble.putFloat64(22.22, 1).good()); + OFCHECK(floatDouble.putFloat64(33.33, 2).good()); + /* check again all set values */ + OFCHECK(floatDouble.getFloat64(value, 0).good()); + OFCHECK_EQUAL(value, 1.1); + OFCHECK(floatDouble.getFloat64(value, 1).good()); + OFCHECK_EQUAL(value, 22.22); + OFCHECK(floatDouble.getFloat64(value, 2).good()); + OFCHECK_EQUAL(value, 33.33); + OFCHECK(floatDouble.getFloat64(value, 3).good()); + OFCHECK_EQUAL(value, 4.4); +} diff --git a/dcmdata/tests/tvrol.cc b/dcmdata/tests/tvrol.cc new file mode 100644 index 00000000..d08ca6c1 --- /dev/null +++ b/dcmdata/tests/tvrol.cc @@ -0,0 +1,48 @@ +/* + * + * Copyright (C) 2016-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmOtherLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcvrol.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +OFTEST(dcmdata_otherLong) +{ + DcmOtherLong otherLong(DCM_TrackPointIndexList); + /* append new values */ + OFCHECK(otherLong.putUint32(1, 0).good()); + OFCHECK(otherLong.putUint32(22, 1).good()); + OFCHECK(otherLong.putUint32(333, 2).good()); + OFCHECK(otherLong.putUint32(4444, 3).good()); + OFCHECK(otherLong.putUint32(55555, 4).good()); + OFCHECK(otherLong.putUint32(666666, 5).good()); + OFCHECK(otherLong.putUint32(7777777, 6).good()); + OFCHECK(otherLong.putUint32(88888888, 7).good()); + OFCHECK(otherLong.putUint32(999999999, 8).good()); + /* value multiplicity should always be 1 */ + OFCHECK_EQUAL(otherLong.getVM(), 1); + /* number of values should be higher */ + OFCHECK_EQUAL(otherLong.getNumberOfValues(), 9); +} diff --git a/dcmdata/tests/tvrov.cc b/dcmdata/tests/tvrov.cc new file mode 100644 index 00000000..c7eaf420 --- /dev/null +++ b/dcmdata/tests/tvrov.cc @@ -0,0 +1,50 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmOther64bitVeryLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcvrov.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +OFTEST(dcmdata_other64bitVeryLong) +{ + DcmOther64bitVeryLong veryLong(DCM_ExtendedOffsetTable); + /* append new values */ + OFCHECK(veryLong.putUint64(1, 0).good()); + OFCHECK(veryLong.putUint64(22, 1).good()); + OFCHECK(veryLong.putUint64(333, 2).good()); + OFCHECK(veryLong.putUint64(4444, 3).good()); + OFCHECK(veryLong.putUint64(55555, 4).good()); + OFCHECK(veryLong.putUint64(666666, 5).good()); + OFCHECK(veryLong.putUint64(7777777, 6).good()); + OFCHECK(veryLong.putUint64(88888888, 7).good()); + OFCHECK(veryLong.putUint64(999999999, 8).good()); + OFCHECK(veryLong.putUint64(1111111111, 9).good()); + OFCHECK(veryLong.putUint64(22222222222UL, 10).good()); + /* value multiplicity should always be 1 */ + OFCHECK_EQUAL(veryLong.getVM(), 1); + /* number of values should be higher */ + OFCHECK_EQUAL(veryLong.getNumberOfValues(), 11); +} diff --git a/dcmdata/tests/tvrpn.cc b/dcmdata/tests/tvrpn.cc new file mode 100644 index 00000000..b251fad0 --- /dev/null +++ b/dcmdata/tests/tvrpn.cc @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 2011-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Michael Onken + * + * Purpose: test program for class DcmPersonName + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcvrpn.h" + + +OFTEST(dcmdata_personName) +{ + /* test getComponentGroup()*/ + OFString resultStr; + OFCHECK( DcmPersonName::getComponentGroup("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", 0, resultStr).good() ); + OFCHECK_EQUAL(resultStr, "Eichelberg^Marco^^Dr."); + OFCHECK( DcmPersonName::getComponentGroup("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", 1, resultStr).good() ); + OFCHECK_EQUAL(resultStr, "Onken^Michael^"); + OFCHECK( DcmPersonName::getComponentGroup("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", 2, resultStr).good() ); + OFCHECK_EQUAL(resultStr, "Riesmeier^J\366rg^^Dr.^"); + + OFCHECK( DcmPersonName::getComponentGroup("=Onken^Michael^", 1, resultStr).good() ); + OFCHECK_EQUAL(resultStr, "Onken^Michael^"); + OFCHECK( DcmPersonName::getComponentGroup("==Riesmeier^J\366rg^^Dr.^", 2, resultStr).good() ); + OFCHECK_EQUAL(resultStr, "Riesmeier^J\366rg^^Dr.^"); + + OFCHECK( DcmPersonName::getComponentGroup("", 0, resultStr).good() ); + OFCHECK_EQUAL(resultStr, ""); + OFCHECK( DcmPersonName::getComponentGroup("Riesmeier^J\366rg^^Dr.^==", 0, resultStr).good() ); + OFCHECK_EQUAL(resultStr, "Riesmeier^J\366rg^^Dr.^"); + + OFCHECK( DcmPersonName::getComponentGroup("Eichelberg^Marco", 1, resultStr).bad() ); + OFCHECK( DcmPersonName::getComponentGroup("Onken^Michael^=Riesmeier^J\366rg^^Dr.^", 2, resultStr).bad() ); + OFCHECK( DcmPersonName::getComponentGroup("=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", 0, resultStr).good() ); + OFCHECK_EQUAL(resultStr, ""); + + /* test getComponentsFromString(). So far only minimal tests to assure + * changes to getComponentGroup does not introduce problems + */ + OFString l, f, m, p, s; + OFCHECK( DcmPersonName::getNameComponentsFromString("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", l,f,m,p,s, 0).good()); + OFCHECK_EQUAL(l, "Eichelberg"); + OFCHECK_EQUAL(f, "Marco"); + OFCHECK_EQUAL(m, ""); + OFCHECK_EQUAL(p, "Dr."); + OFCHECK_EQUAL(s, ""); + + OFCHECK( DcmPersonName::getNameComponentsFromString("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", l,f,m,p,s, 1).good()); + OFCHECK_EQUAL(l, "Onken"); + OFCHECK_EQUAL(f, "Michael"); + OFCHECK_EQUAL(m, ""); + OFCHECK_EQUAL(p, ""); + OFCHECK_EQUAL(s, ""); + + OFCHECK( DcmPersonName::getNameComponentsFromString("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", l,f,m,p,s, 2).good()); + OFCHECK_EQUAL(l, "Riesmeier"); + OFCHECK_EQUAL(f, "J\366rg"); + OFCHECK_EQUAL(m, ""); + OFCHECK_EQUAL(p, "Dr."); + OFCHECK_EQUAL(s, ""); + + OFCHECK( DcmPersonName::getNameComponentsFromString("Eichelberg^Marco^^Dr.=Onken^Michael^=Riesmeier^J\366rg^^Dr.^", l,f,m,p,s, 2).good()); + OFCHECK_EQUAL(l, "Riesmeier"); + OFCHECK_EQUAL(f, "J\366rg"); + OFCHECK_EQUAL(m, ""); + OFCHECK_EQUAL(p, "Dr."); + OFCHECK_EQUAL(s, ""); +} diff --git a/dcmdata/tests/tvrsv.cc b/dcmdata/tests/tvrsv.cc new file mode 100644 index 00000000..b068af64 --- /dev/null +++ b/dcmdata/tests/tvrsv.cc @@ -0,0 +1,68 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmSigned64bitVeryLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcvrsv.h" +#include "dcmtk/dcmdata/dctagkey.h" + + +OFTEST(dcmdata_signed64bitVeryLong) +{ + Sint64 value; + DcmSigned64bitVeryLong veryLong(DcmTagKey(0x1111, 0x1111)); + /* append new values */ + OFCHECK(veryLong.putSint64(-2222, 0).good()); + OFCHECK(veryLong.putSint64(-11, 1).good()); + OFCHECK(veryLong.putSint64(0, 2).good()); + OFCHECK(veryLong.putSint64(11, 3).good()); + OFCHECK(veryLong.putSint64(2222, 4).good()); + /* check number of values */ + OFCHECK_EQUAL(veryLong.getVM(), 5); + /* check all set values */ + OFCHECK(veryLong.getSint64(value, 0).good()); + OFCHECK_EQUAL(value, -2222); + OFCHECK(veryLong.getSint64(value, 1).good()); + OFCHECK_EQUAL(value, -11); + OFCHECK(veryLong.getSint64(value, 2).good()); + OFCHECK_EQUAL(value, 0); + OFCHECK(veryLong.getSint64(value, 3).good()); + OFCHECK_EQUAL(value, 11); + OFCHECK(veryLong.getSint64(value, 4).good()); + OFCHECK_EQUAL(value, 2222); + /* change existing values */ + OFCHECK(veryLong.putSint64(-1111, 1).good()); + OFCHECK(veryLong.putSint64(1111, 3).good()); + /* check again all set values */ + OFCHECK(veryLong.getSint64(value, 0).good()); + OFCHECK_EQUAL(value, -2222); + OFCHECK(veryLong.getSint64(value, 1).good()); + OFCHECK_EQUAL(value, -1111); + OFCHECK(veryLong.getSint64(value, 2).good()); + OFCHECK_EQUAL(value, 0); + OFCHECK(veryLong.getSint64(value, 3).good()); + OFCHECK_EQUAL(value, 1111); + OFCHECK(veryLong.getSint64(value, 4).good()); + OFCHECK_EQUAL(value, 2222); +} diff --git a/dcmdata/tests/tvrui.cc b/dcmdata/tests/tvrui.cc new file mode 100644 index 00000000..e131a0c0 --- /dev/null +++ b/dcmdata/tests/tvrui.cc @@ -0,0 +1,87 @@ +/* + * + * Copyright (C) 2011-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmUniqueIdentifier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +OFTEST(dcmdata_uniqueIdentifier_1) +{ + /* test UI value with 0-byte padding */ + OFString value; + DcmUniqueIdentifier sopInstanceUID(DCM_SOPInstanceUID); + dcmEnableAutomaticInputDataCorrection.set(OFTrue); + OFCHECK(sopInstanceUID.putString("1.2.3.4\0", 8).good()); + OFCHECK_EQUAL(sopInstanceUID.getNumberOfValues(), 1); + OFCHECK(sopInstanceUID.checkValue("1").good()); + OFCHECK(sopInstanceUID.getOFString(value, 0).good()); + OFCHECK_EQUAL(value, "1.2.3.4"); + // switch automatic data correct off + dcmEnableAutomaticInputDataCorrection.set(OFFalse); + OFCHECK(sopInstanceUID.putString("1.2.3.4\\5.6.7.8").good()); + OFCHECK_EQUAL(sopInstanceUID.getNumberOfValues(), 2); + OFCHECK(sopInstanceUID.checkValue("2").good()); + OFCHECK(sopInstanceUID.putString("1.2.3.4\\5.6.7.8\0", 16).good()); + // the trailing 0-byte is still there, which leads to an error + OFCHECK(sopInstanceUID.checkValue("2").bad()); + OFCHECK(sopInstanceUID.getOFString(value, 1 /*, normalize = OFTrue */).good()); + OFCHECK_EQUAL(value, "5.6.7.8"); + OFCHECK(sopInstanceUID.getOFString(value, 1, OFFalse /*normalize*/).good()); + OFCHECK_EQUAL(value, OFString("5.6.7.8\0", 8)); +} + + +OFTEST(dcmdata_uniqueIdentifier_2) +{ + /* test UI value with space character padding */ + OFString value; + DcmUniqueIdentifier sopInstanceUID(DCM_SOPInstanceUID); + dcmEnableAutomaticInputDataCorrection.set(OFTrue); + OFCHECK(sopInstanceUID.putString("1.2.3.4 ").good()); + OFCHECK(sopInstanceUID.checkValue("1").good()); + OFCHECK(sopInstanceUID.putString("1.2.3.4 ").good()); + OFCHECK(sopInstanceUID.checkValue("1").good()); + OFCHECK(sopInstanceUID.getOFString(value, 0).good()); + OFCHECK_EQUAL(value, "1.2.3.4"); + // we also accept leading and embedded space characters + OFCHECK(sopInstanceUID.putString(" 1.2.3.4 ").good()); + OFCHECK(sopInstanceUID.checkValue("1").good()); + OFCHECK(sopInstanceUID.putString("1.2. 3.4").good()); + OFCHECK(sopInstanceUID.checkValue("1").good()); + OFCHECK(sopInstanceUID.getOFString(value, 0).good()); + OFCHECK_EQUAL(value, "1.2.3.4"); + // switch automatic data correct off + dcmEnableAutomaticInputDataCorrection.set(OFFalse); + OFCHECK(sopInstanceUID.putString("1.2.3.4 ").good()); + OFCHECK(sopInstanceUID.checkValue("1").bad()); + OFCHECK(sopInstanceUID.getOFString(value, 0).good()); + OFCHECK_EQUAL(value, "1.2.3.4 "); + OFCHECK(sopInstanceUID.putString("1.2.3.4\\5.6.7.8 ").good()); + OFCHECK(sopInstanceUID.checkValue("2").bad()); + OFCHECK(sopInstanceUID.getOFString(value, 0).good()); + OFCHECK_EQUAL(value, "1.2.3.4"); + OFCHECK(sopInstanceUID.getOFString(value, 1).good()); + OFCHECK_EQUAL(value, "5.6.7.8 "); +} diff --git a/dcmdata/tests/tvruv.cc b/dcmdata/tests/tvruv.cc new file mode 100644 index 00000000..38195042 --- /dev/null +++ b/dcmdata/tests/tvruv.cc @@ -0,0 +1,64 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: test program for class DcmUnsigned64bitVeryLong + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcvruv.h" +#include "dcmtk/dcmdata/dctagkey.h" + + +OFTEST(dcmdata_unsigned64bitVeryLong) +{ + Uint64 value; + DcmUnsigned64bitVeryLong veryLong(DcmTagKey(0x1111, 0x1111)); + /* append new values */ + OFCHECK(veryLong.putUint64(1, 0).good()); + OFCHECK(veryLong.putUint64(22, 1).good()); + OFCHECK(veryLong.putUint64(333, 2).good()); + OFCHECK(veryLong.putUint64(4444, 3).good()); + OFCHECK(veryLong.putUint64(55555, 5).bad()); + /* check number of values */ + OFCHECK_EQUAL(veryLong.getVM(), 4); + /* check all set values */ + OFCHECK(veryLong.getUint64(value, 0).good()); + OFCHECK_EQUAL(value, 1); + OFCHECK(veryLong.getUint64(value, 1).good()); + OFCHECK_EQUAL(value, 22); + OFCHECK(veryLong.getUint64(value, 2).good()); + OFCHECK_EQUAL(value, 333); + OFCHECK(veryLong.getUint64(value, 3).good()); + OFCHECK_EQUAL(value, 4444); + /* change existing values */ + OFCHECK(veryLong.putUint64(2222, 1).good()); + OFCHECK(veryLong.putUint64(3333, 2).good()); + /* check again all set values */ + OFCHECK(veryLong.getUint64(value, 0).good()); + OFCHECK_EQUAL(value, 1); + OFCHECK(veryLong.getUint64(value, 1).good()); + OFCHECK_EQUAL(value, 2222); + OFCHECK(veryLong.getUint64(value, 2).good()); + OFCHECK_EQUAL(value, 3333); + OFCHECK(veryLong.getUint64(value, 3).good()); + OFCHECK_EQUAL(value, 4444); +} diff --git a/dcmfg/CMakeLists.txt b/dcmfg/CMakeLists.txt new file mode 100644 index 00000000..ca64875a --- /dev/null +++ b/dcmfg/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmfg) + +# declare include directories which hold for all subdirectories +include_directories("${dcmfg_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc include tests) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmfg/Makefile.in b/dcmfg/Makefile.in new file mode 100644 index 00000000..fb523c51 --- /dev/null +++ b/dcmfg/Makefile.in @@ -0,0 +1,86 @@ +# +# Makefile for dcmfg +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all tests-all + +install: install-doc install-support + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmfg/configure b/dcmfg/configure new file mode 100755 index 00000000..425e8d6d --- /dev/null +++ b/dcmfg/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmfg/data/Makefile.in b/dcmfg/data/Makefile.in new file mode 100644 index 00000000..007da889 --- /dev/null +++ b/dcmfg/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmfg/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmfg/docs/Makefile.in b/dcmfg/docs/Makefile.in new file mode 100644 index 00000000..d44d05da --- /dev/null +++ b/dcmfg/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmfg/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmfg/docs/dcmfg.dox b/dcmfg/docs/dcmfg.dox new file mode 100644 index 00000000..989c540f --- /dev/null +++ b/dcmfg/docs/dcmfg.dox @@ -0,0 +1,14 @@ +/*! + +\page mod_dcmfg dcmfg: a library for working with functional groups + +This module contains classes to deal with DICOM Functional Groups as they are +used in objects of the "Enhanced" family in DICOM. Some but not all functional +groups have been implemented. However, unknown groups can be read and written, +and modified using a low(er) level access method. + +The main classes are (in alphabetical order): +\li \b FGBase +\li \b FGInterface + +*/ diff --git a/dcmfg/etc/Makefile.in b/dcmfg/etc/Makefile.in new file mode 100644 index 00000000..808115cc --- /dev/null +++ b/dcmfg/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmfg/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmfg/include/CMakeLists.txt b/dcmfg/include/CMakeLists.txt new file mode 100644 index 00000000..26c255ee --- /dev/null +++ b/dcmfg/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmfg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmfg/include/Makefile.in b/dcmfg/include/Makefile.in new file mode 100644 index 00000000..23a4a91c --- /dev/null +++ b/dcmfg/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmfg/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmfg + for file in dcmtk/dcmfg/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmfg ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmfg/include/dcmtk/dcmfg/fg.h b/dcmfg/include/dcmtk/dcmfg/fg.h new file mode 100644 index 00000000..b240d0de --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fg.h @@ -0,0 +1,114 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Functional Groups from a DICOM object + * + */ + +#ifndef FG_H +#define FG_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/dcmfg/fgtypes.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmdata/dcsequen.h" + + +// forward declaration +class FGBase; + +/** Class representing a list of functional groups where each type of group + * can only be once in the list. + */ +class DCMTK_DCMFG_EXPORT FunctionalGroups +{ + +public: + + /// Iterator type for iterating functional groups + typedef OFMap::iterator iterator; + + /// Const iterator type for iterating functional groups + typedef OFMap::const_iterator const_iterator; + + /** Constructor, creates empty set of functional groups + */ + FunctionalGroups(); + + /** Virtual destructor, cleans up set of functional groups and + * frees the related memory + */ + virtual ~FunctionalGroups(); + + /** Cleans up set of functional groups and frees the related memory + */ + virtual void clear(); + + /** Find a functional group by its type + * @param fgType The type of the functional group + * @return The functional group, if found, NULL otherwise + */ + virtual FGBase* find(const DcmFGTypes::E_FGType fgType); + + /** Iterator pointing to first functional group in the set + * @return First functional group in set + */ + virtual FunctionalGroups::iterator begin(); + + /** Iterator pointing behind last functional group in the set + * @return Iterator pointing behind last functional group in the set + */ + virtual FunctionalGroups::iterator end(); + + /** Const iterator pointing to first functional group in the set + * @return First functional group in set + */ + virtual FunctionalGroups::const_iterator begin() const; + + /** Const iterator pointing behind last functional group in the set + * @return Iterator pointing behind last functional group in the set + */ + virtual FunctionalGroups::const_iterator end() const; + + /** Insert new functional group; ownership is taken over from caller if + * function call is successful. + * @param group The group to insert + * @param replaceOld If OFTrue, then the existing functional group of the + * same type (if existing) is deleted and replaced by the given one. + * @return EC_Normal, if insertion was successful, error otherwise. In the + * latter case, the caller keeps the ownership of the given object. + */ + virtual OFCondition insert(FGBase* group, + const OFBool replaceOld); + + /** Remove functional group specified by its type. The memory is not + * freed by the call but must freed by the caller using the returned pointer. + * @param fgType The type of the group to remove + * @return The functional group removed, or NULL, if not found + */ + virtual FGBase* remove(const DcmFGTypes::E_FGType fgType); + +private: + + /// Map holding the functional groups, one of each type at most + OFMap m_groups; + +}; + +#endif // FG_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgbase.h b/dcmfg/include/dcmtk/dcmfg/fgbase.h new file mode 100644 index 00000000..4d1645d9 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgbase.h @@ -0,0 +1,269 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Base class(es) for functional groups + * + */ + +#ifndef FGBASE_H +#define FGBASE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgtypes.h" + +/** Abstract base class for deriving specific functional groups + */ +class DCMTK_DCMFG_EXPORT FGBase +{ + +public: + + /** Constructor, creates new functional group of given type. + * @param fgType The type of functional group to create + */ + FGBase(const DcmFGTypes::E_FGType fgType); + + /** Check whether functional group has valid and complete data + * @return EC_Normal, if check is ok, error otherwise + */ + virtual OFCondition check() const = 0; + + /** Read functional group from given item. Old data is overwritten. + * @param item The item to read from. This must contain the sequence + * element that uniquely identifies the functional group. + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item) = 0; + + /** Write functional group to given item. If the functional group already + * exists it is overwritten. + * @param item The item to write to. The method will write the sequence + * specific for the functional group into the item + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item) = 0; + + /** Find out whether functional group is potentially only shared, only + * per-frame or can be both + * @return The functional group "shared type" + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const =0; + + /** Return the type of this functional group + * @return The functional group's type + */ + virtual DcmFGTypes::E_FGType getType() const; + + /** Clear any data in the group + */ + virtual void clearData() =0; + + /** Virtual destructor + */ + virtual ~FGBase(); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (e.g.\ both + * FGDerivationImage) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the rhs object, or all compared components match + * but the rhs component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in the rhs object, or all compared components match + * but the rhs component is longer. + */ + virtual int compare(const FGBase& rhs) const = 0; + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const = 0; + +protected: + + /** Get the item containing the payload of a functional group sequence, + * identified by the functional group's sequence key provided and the desired + * item number. + * @param source The item to read the sequence from, e.g.\ item of the + * Shared Functional Group Sequence + * @param seqKey The identifying key of the functional group's sequence + * @param itemNum The item number to get from that sequence (usually, + * a functional group has exactly a single item, i.e.\ the parameter + * would be set to 0 + * @param result The item if found, otherwise NULL + * @return EC_Normal, if specified item could be retrieved, error otherwise + */ + virtual OFCondition getItemFromFGSequence(DcmItem& source, + const DcmTagKey& seqKey, + const unsigned long itemNum, + DcmItem*& result); + + /** Create functional group sequence specified by given sequence tag key + * @param destination The item to put the sequence into + * @param seqKey The functional group's tag key + * @param numItems The number of items to create within sequence (minus 1). + * Usually, functional group only contain a single item, + * i.e.\ numItems would be set to 0 + * @param firstItem Reference to the first item the method created + * @return EC_Normal if creation was successful, error otherwise + */ + virtual OFCondition createNewFGSequence(DcmItem& destination, + const DcmTagKey& seqKey, + const unsigned long numItems, + DcmItem*& firstItem); + +private: + + /// Private default constructor, shall not be used + FGBase(); + + /// The type of the functional group + DcmFGTypes::E_FGType m_fgType; + +}; + + +/** Class representing an "unknown" functional group, e.g.\ a private one + * specified by a vendor or one that is not explicitly known yet to the + * dcmfg library. + * The main purpose is to have a container for such functional groups that + * allows to read them into memory, access them using a low level API, and + * to be able to write store them back. + */ +class DCMTK_DCMFG_EXPORT FGUnknown : public FGBase +{ + +public: + + /** Creates unknown (to the dcmfg class library) functional group + * @param seqStartTag The tag that uniquely identifies this functional group + * @param sharedType Defines whether this group is potentially per-frame, + * shared or can be both. Default is "unknown". + */ + FGUnknown(const DcmTagKey& seqStartTag, + const DcmFGTypes::E_FGSharedType sharedType = DcmFGTypes::EFGS_UNKNOWN); + + /** Copy constructor, performs a deep copy of the given object. + * @param rhs The functional group to initialize from + */ + FGUnknown(const FGUnknown& rhs); + + /** Assignment operator, performs a deep copy for assigning given object. + * @param rhs The functional group to assign from + * @return Reference to this object + */ + FGUnknown& operator=(const FGUnknown& rhs); + + /** Returns type of this functional group (always "EFG_UNKNOWN") + * @return Always returns DcmFGTypes::EFG_UNKNOWN + */ + virtual DcmFGTypes::E_FGType getType() const {return DcmFGTypes::EFG_UNKNOWN;} + + /** Returns whether this group is potentially per-frame, shared or can be both + * @return The functional group's "shared type" + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return m_sharedType;} + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Check whether this functional group contains valid data + * @returns EC_Normal if functional group is valid. For now, always returns + * EC_Normal + */ + virtual OFCondition check() const; + + /** Clear data within this group + */ + virtual void clearData(); + + /** Read this group into memory + * @param item The item to read from + */ + virtual OFCondition read(DcmItem& item); + + /** Write this group to given item + * @param item The item to write to + */ + virtual OFCondition write(DcmItem& item); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + /** Virtual destructor, frees memory + */ + virtual ~FGUnknown(); + +private: + + /** Private default constructor, shall not be used + */ + FGUnknown(); + + /// The tag that uniquely identifies this functional group + DcmTagKey m_seqStartTag; + + /// The data hold by this item, i.e.\ the sequence making up the functional + /// group + DcmSequenceOfItems* m_fgSequence; + + /// Denotes whether this group is potentially per-frame, shared or can be both + DcmFGTypes::E_FGSharedType m_sharedType; + +}; + +#endif // FGBASE_H + diff --git a/dcmfg/include/dcmtk/dcmfg/fgdefine.h b/dcmfg/include/dcmtk/dcmfg/fgdefine.h new file mode 100644 index 00000000..72e2371a --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgdefine.h @@ -0,0 +1,36 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef FGDEFINE_H +#define FGDEFINE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmfg_EXPORTS +#define DCMTK_DCMFG_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMFG_EXPORT DCMTK_DECL_IMPORT +#endif + +#endif // FGDEFINE_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgderimg.h b/dcmfg/include/dcmtk/dcmfg/fgderimg.h new file mode 100644 index 00000000..24b312eb --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgderimg.h @@ -0,0 +1,414 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Derivation Image Functional Group + * + */ + + +#ifndef FGDERIMG_H +#define FGDERIMG_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing a single item of the Source Image Sequence + */ +class DCMTK_DCMFG_EXPORT SourceImageItem +{ + +public: + + /** Constructor, constructs empty Source Image Sequence item + */ + SourceImageItem(); + + /** Virtual destructor, cleans up memory + */ + virtual ~SourceImageItem(); + + /** Clears all data handled by this component + */ + virtual void clearData(); + + /** Check whether this item contains valid data + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Return handle to to purpose of reference code + * @return EC_Normal if data is valid, error otherwise + */ + virtual CodeSequenceMacro& getPurposeOfReferenceCode(); + + /** Returns handle to to image sop instance reference + * @return EC_Normal if data is valid, error otherwise + */ + virtual ImageSOPInstanceReferenceMacro& getImageSOPInstanceReference(); + + /** Reads source image item from given item + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& itemOfSourceImageSequence, + const OFBool clearOldData = OFTrue); + + /** Writes source image item to given item + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& itemOfSourceImageSequence); + + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const SourceImageItem& rhs) const; + + /** Assignment operator, deletes old data + * @param rhs The item that should be assigned to "this" class + * @return Reference to "this" class + */ + SourceImageItem& operator=(const SourceImageItem& rhs); + +private: + + /// Describes purpose of reference (single item of Purpose of Reference Code + /// Sequence) + CodeSequenceMacro m_PurposeOfReferenceCode; + + /// Contains the referenced images (as represented by one of the items of + /// "this" Source Image Sequence) + ImageSOPInstanceReferenceMacro m_ImageSOPInstanceReference; +}; + +/// Iterator for traversing over items of the Source Image Sequence +typedef OFVector::iterator SourceImageIterator; + + +/** Class representing a single item in Derivation Image Sequence + */ +class DCMTK_DCMFG_EXPORT DerivationImageItem +{ +public: + + /** Constructor, initializes empty derivation image item + */ + DerivationImageItem(); + + /** Virtual destructor + */ + virtual ~DerivationImageItem(); + + /** Assignment operator, deletes old data + * @param rhs The item that should be assigned to "this" class + * @return Reference to "this" class + */ + DerivationImageItem& operator=(const DerivationImageItem& rhs); + + /** Copy constructor, deletes old data + * @param rhs The item that should be used for initialization + */ + DerivationImageItem(const DerivationImageItem& rhs); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type + * @param rhs The right hand side of the comparison + * @return 0 If the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the rhs object, or all compared components match + * but the rhs component is shorter. Also returned if rhs cannot be + * casted to DcmAttributeTag. + * 1 if either the value of the first component that does not match + * is greater in the rhs object, or all compared components match + * but the rhs component is longer. + */ + virtual int compare(const DerivationImageItem& rhs) const; + + /** Clears all data handled by this component + */ + virtual void clearData(); + + /** Check whether item contains valid data + * @return EC_Normal if item is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Convenience function to add item representing reference to an object. No + * restrictions are set which frames or segments from this image has been + * actually used. However, such information could be added to the source + * image item later by modifying the resulting item being handed back to the + * caller. + * @param file Files that should be referenced by their UID, must be readable. + * @param purposeOfReference Code representing the purpose of reference + * (Defined CID 7202) + * @param resultSourceImageItem The created derivation image item if + * successful, NULL otherwise + * @return EC_Normal if adding works, error code otherwise + */ + virtual OFCondition addSourceImageItem(const OFString& file, + const CodeSequenceMacro& purposeOfReference, + SourceImageItem*& resultSourceImageItem); + + /** Convenience function to add item representing reference to an object. No + * restrictions are set which frames or segments from this image has been + * actually used. However, such information could be added to the source + * image item later by modifying the resulting item being handed back to the + * caller. + * @param dataset DICOM dataset that should be referenced by their UID + * @param purposeOfReference Code representing the purpose of reference + * (Defined CID 7202) + * @param resultSourceImageItem The created derivation image item if + * successful, NULL otherwise + * @return EC_Normal if adding works, error code otherwise + */ + virtual OFCondition addSourceImageItem(DcmDataset *dataset, + const CodeSequenceMacro& purposeOfReference, + SourceImageItem*& resultSourceImageItem); + + /** Convenience function to add items representing references to some objects + * which all have the same purpose of reference (code). No restrictions are + * set which frames or segments from those images have been actually used. + * However, such information could be added to the source image item later by + * modifying the resulting item handed back to the caller. + * @param files List of files that should be referenced by their UIDs. + * @param purposeOfReference Code representing the purpose of reference + * (Defined CID 7202) + * @param resultSourceImageItems The created derivation image items (one per + * file) if successful, NULL otherwise + * @param skipFileErrors If OFTrue, then files that could not be added will + * not lead to error. + * @return EC_Normal if adding works, error code otherwise + */ + virtual OFCondition addSourceImageItems(const OFVector& files, + const CodeSequenceMacro& purposeOfReference, + OFVector& resultSourceImageItems, + const OFBool skipFileErrors = OFFalse); + + /** Convenience function to add items representing references to some objects + * which all have the same purpose of reference (code). No restrictions are + * set which frames or segments from those images have been actually used. + * However, such information could be added to the source image item later by + * modifying the resulting item handed back to the caller. + * @param datasets List of datasets that should be referenced by their UIDs. + * @param purposeOfReference Code representing the purpose of reference + * (Defined CID 7202) + * @param resultSourceImageItems The created derivation image items (one per + * file) if successful, NULL otherwise + * @param skipErrors If OFTrue, then files that could not be added will + * not lead to error. + * @return EC_Normal if adding works, error code otherwise + */ + virtual OFCondition addSourceImageItems(const OFVector& datasets, + const CodeSequenceMacro& purposeOfReference, + OFVector& resultSourceImageItems, + const OFBool skipErrors = OFFalse); + + /** Get Derivation Description + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDerivationDescription(OFString &value, + const signed long pos = 0) const; + + /** Get reference to derivation code items + * @return Reference to derivation code items + */ + virtual OFVector& getDerivationCodeItems(); + + /** Get reference to source image items + * @return Reference to source image items + */ + virtual OFVector& getSourceImageItems(); + + /** Set Derivation Description + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDerivationDescription(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Read Derivation Image Sequence Item describing derivation from a + * set of images + * @param itemOfDerivationImageSequence The item to read from + * @param clearOldData If OFTrue, old data is deleted first + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& itemOfDerivationImageSequence, + const OFBool clearOldData = OFTrue); + + /** Write Derivation Image Sequence Item describing derivation from a + * set of images + * @param itemOfDerivationImageSequence The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& itemOfDerivationImageSequence); + +private: + + // DICOM attributes. + // The comments for each attribute describe "Name: (VR, VM, Type)". + // See DICOM standard for further reference. + + /// Derivation Description: (ST, 1, 3) + DcmShortText m_DerivationDescription; + + /// List of derivation codes for this set of images (1-n items permitted) + OFVector m_DerivationCodeItems; + + // List of source images, as described by Source Image Sequence (0-n items + // permitted) + OFVector m_SourceImageItems; + +}; + +/** Class representing the "Derivation Image Functional Group Macro" + */ +class DCMTK_DCMFG_EXPORT FGDerivationImage : public FGBase +{ +public: + + /** Constructor creating an empty functional group + */ + FGDerivationImage(); + + /** Virtual destructor, frees memory + */ + virtual ~FGDerivationImage(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Convenience function to create a minimalistic FGDerivationImage + * @param derivationImages The list of SOP instances to reference + * @param derivationDescription Description of the derivation performed + * @param derivationCode Coded representation of the derivation description + * @param purposeOfReference Purpose of referencing the SOP instances + * @return The created derivation image item, if successful, NULL otherwise + */ + static FGDerivationImage* createMinimal(const OFVector& derivationImages, + const OFString& derivationDescription, + const CodeSequenceMacro& derivationCode, + const CodeSequenceMacro& purposeOfReference); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGDerivationImage) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the rhs object, or all compared components match + * but the rhs component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in the rhs object, or all compared components match + * but the rhs component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + /** Returns shared type of this functional group + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Convenience function to add an item only having a single derivation code + * derivation description. No source images have to provided but can be added + * later on the resulting DerivationImageItem. + * @param derivationCode Code describing derivation + * @param derivationDescription Free text description of derivation (can be + * empty) + * @param item The created derivation image item if successful, NULL + * otherwise + * @return EC_Normal if adding works, error code otherwise + */ + virtual OFCondition addDerivationImageItem(const CodeSequenceMacro& derivationCode, + const OFString& derivationDescription, + DerivationImageItem*& item); + + /** Clears all data handled by this component + */ + virtual void clearData(); + + /** Checks whether this class contains valid data + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Get reference to derivation image items + * @return Reference to derivation image items + */ + virtual OFVector& getDerivationImageItems(); + + /** Read Derivation Image Sequence from given item, which can contain zero or + * more items + * @param item The item to read from + * @return Returns EC_Normal if at least one derivation image item could be + * read or no item exists at all, otherwise an error is returned + */ + virtual OFCondition read(DcmItem& item); + + /** Write Derivation Image Sequence (containing contain zero or more items) + * to given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + +private: + + /// List of derivation image items making up the Derivation Image Sequence + OFVector m_DerivationImageItems; + +}; + +#endif // FGDERIMG_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgfact.h b/dcmfg/include/dcmtk/dcmfg/fgfact.h new file mode 100644 index 00000000..c44de470 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgfact.h @@ -0,0 +1,80 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Factory class for creating functional groups + * + */ + +#ifndef FGFACT_H +#define FGFACT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmfg/fgtypes.h" + +class FGBase; + + +/** Singleton class that is used to create functional groups by knowing + * their type or other unique features, i.e.\ offering factory functionality. + */ +class DCMTK_DCMFG_EXPORT FGFactory +{ +public: + + /** Return the single instance of the factory + * @return The instance of FGFactory + */ + static FGFactory& instance(); + + /** Create new functional group based on given type + * @param fgtype The type of functional group to create + * @return The functional group or NULL if error occurs + */ + FGBase *create(const DcmFGTypes::E_FGType fgtype); + + /** Create new functional group based its unique sequence tag key + * @param fgSequenceKey Tag key of the functional groups sequence + * @return The functional group or NULL if error occurs + */ + FGBase *create(const DcmTagKey& fgSequenceKey); + +private: + + /** Private undefined constructor (singleton implementation) + */ + FGFactory(); + + /** Private undefined copy constructor (singleton implementation) + */ + FGFactory(const FGFactory&); + + /** Private undefined assignment operator (singleton implementation) + */ + FGFactory& operator=(const FGFactory&); + + /** Private undefined destructor (singleton implementation) + */ + ~FGFactory() {} + + /// The instance of FGFactory handled by this singleton class + static FGFactory* m_Instance; + +}; + +#endif // FGFACT_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgfracon.h b/dcmfg/include/dcmtk/dcmfg/fgfracon.h new file mode 100644 index 00000000..2aea9849 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgfracon.h @@ -0,0 +1,378 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing the Frame Content Functional Group + * + */ + +#ifndef FGFRACON_H +#define FGFRACON_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the "Frame Content" Functional Group Macro. Can only be + * used as per-frame functional group (never shared). + */ +class DCMTK_DCMFG_EXPORT FGFrameContent : public FGBase +{ +public: + + /** Constructor, creates empty functional group + */ + FGFrameContent(); + + /** Virtual destructor + */ + virtual ~FGFrameContent(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Returns shared functional group type (always "per-frame") + * @return The functional group type (DcmFGTypes::EFGS_ONLYPERFRAME) + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_ONLYPERFRAME;} + + /** Clear all data + */ + virtual void clearData(); + + /** Check whether the current content of this group is consistent and complete + * @return EC_Normal, if no errors are found, error otherwise + */ + virtual OFCondition check() const; + + /** Read Frame Content Sequence from given item + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Writes the content of this class into Frame Content Sequence + * (newly cerated) into given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + // --- get() functionality --- + + /** Get Frame Acquisition Number + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getFrameAcquisitionNumber(Uint16& value, + const signed long pos = 0); + + /** Get Frame Reference Date Time + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getFrameReferenceDateTime(OFString& value, + const signed long pos = 0); + /** Get Frame Acquisition Date Time + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getFrameAcquisitionDateTime(OFString& value, + const signed long pos = 0); + + /** Get Frame Acquisition Duration + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getFrameAcquisitionDuration(Float64& value, + const unsigned long pos = 0); + + /** Get Cardiac Cycle Position + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getCardiacCyclePosition(OFString& value, + const signed long pos = 0); + + /** Get Respiratory Cycle Position + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getRespiratoryCyclePosition(OFString& value, + const signed long pos = 0); + + /** Get Dimension Index Value + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getDimensionIndexValues(Uint32& value, + const signed long pos = 0); + + /** Get Temporal Position Index + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getTemporalPositionIndex(Uint32& value, + const signed long pos = 0); + + /** Get Stack ID + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getStackID(OFString& value, + const signed long pos = 0); + + /** Get In-Stack Position Number + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getInStackPositionNumber(Uint32& value, + const signed long pos = 0); + + /** Get Frame Comments + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getFrameComments(OFString& value, + const signed long pos = 0); + + /** Get Frame Label + * @param value Reference to variable that should hold the result + * @param pos Position of the value inside the DICOM element. If 0, the first + * value is returned. If the no value at the given position exists, + * an error is returned. + * @return EC_Normal, if value could be returned, error otherwise + */ + virtual OFCondition getFrameLabel(OFString& value, + const signed long pos = 0); + + // --- set() functionality --- + + /** Set Frame Acquisition Number + * @param value Value that should be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setFrameAcquisitionNumber(const Uint16& value, + const OFBool checkValue = OFTrue); + + /** Set Frame Frame Reference Date Time + * @param value Value that should be set + * @param checkValue If OFTrue, basic checks are performed whether the value is + * valid for this attribute + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setFrameReferenceDateTime(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Frame Acquisition Date Time + * @param value Value that should be set + * @param checkValue If OFTrue, basic checks are performed whether the value is + * valid for this attribute + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setFrameAcquisitionDateTime(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Frame Acquisition Duration + * @param value Value that should be set + * @param checkValue If OFTrue, basic checks are performed whether the value is + * valid for this attribute + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setFrameAcquisitionDuration(const Float64& value, + const OFBool checkValue = OFTrue); + + /** Set Cardiac Cycle Position + * @param value Value that should be set + * @param checkValue If OFTrue, basic checks are performed whether the value is + * valid for this attribute + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setCardiacCyclePosition(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Respiratory Cycle Position + * @param value Value that should be set + * @param checkValue If OFTrue, basic checks are performed whether the value is + * valid for this attribute + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setRespiratoryCyclePosition(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set one of the Dimension Index Values + * @param value Value that should be set (lowest index starts with 1) + * @param dim The position of the value that should be set (lowest index + * starts with 0), i.e.\ select the 1st, 2nd, ..nth dimension + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setDimensionIndexValues(const Uint32& value, + const unsigned int dim, + const OFBool checkValue = OFTrue); + + /** Set Temporal Position Index + * @param value Value that should be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setTemporalPositionIndex(const Uint32& value, + const OFBool checkValue = OFTrue); + + /** Set Stack ID + * @param value Value that should be set + * @param checkValue If OFTrue, basic checks are performed whether the value is + * valid for this attribute + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setStackID(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set In-Stack Position Number + * @param value Value that should be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setInStackPositionNumber(const Uint32& value, + const OFBool checkValue = OFTrue); + + /** Set Frame Comments + * @param value Value that should be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setFrameComments(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Frame Label + * @param value Value that should be set + * @param checkValue If OFTrue, basic checks are performed whether the value is + * valid for this attribute + * @return EC_Normal, if value was set, error otherwise + */ + virtual OFCondition setFrameLabel(const OFString& value, + const OFBool checkValue = OFTrue); + +private: + + /* Content of Frame Content Macro */ + + /// Frame Acquisition Number (US, VM 1, Required type 3) + DcmUnsignedShort m_FrameAcquisitonNumber; + + /// Frame Reference DateTime (DT, 1, 1C) + DcmDateTime m_FrameReferenceDateTime; + + /// Frame Acquisition DateTime (DT, 1, 1C) + DcmDateTime m_FrameAcquisitionDateTime; + + /// Frame Acquisition Duration (FD, 1, 1C) + DcmFloatingPointDouble m_FrameAcquisitionDuration; + + /// Cardiac Cycle Position (CS, 1, 3) + DcmCodeString m_CardiacCyclePosition; + + /// Respiratory Cycle Position (CS, 1, 3) + DcmCodeString m_RespiratoryCyclePosition; + + /// Dimension Index Values (UL, 1-n, 1C) + DcmUnsignedLong m_DimensionIndexValues; + + /// Temporal Position Index (UL, 1, 1C) + DcmUnsignedLong m_TemporalPositionIndex; + + /// Stack ID (SH, 1, 1C) + DcmShortString m_StackID; + + /// In-Stack Position Number (UL, 1, 1C) + DcmUnsignedLong m_InStackPositionNumber; + + /// Frame Comments (LT, 1, 3) + DcmLongText m_FrameComments; + + /// Frame Label (LO, 1, 3) + DcmLongString m_FrameLabel; +}; + +#endif // FGFRACON_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgframeanatomy.h b/dcmfg/include/dcmtk/dcmfg/fgframeanatomy.h new file mode 100644 index 00000000..c29a78e9 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgframeanatomy.h @@ -0,0 +1,157 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Frame Anatomy Functional Group + * + */ + +#ifndef FGFRAMEANATOMY_H +#define FGFRAMEANATOMY_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the Frame Anatomy Functional Group Macro + */ +class DCMTK_DCMFG_EXPORT FGFrameAnatomy : public FGBase +{ +public: + + /** Enumerated values for attribute "Laterality" + */ + enum LATERALITY + { + /// Undefined (e.g.\ value not set) + LATERALITY_UNDEFINED, + /// Invalid Laterality, e.g. when invalid value is read from file + LATERALITY_INVALID, + /// Right body part + LATERALITY_R, + /// Left body part + LATERALITY_L, + /// Unpaired body part + LATERALITY_UNPAIRED, + /// Both, left and right + LATERALITY_BOTH + }; + + /** Constructor, creates empty Frame Anatomy Functional Group + */ + FGFrameAnatomy(); + + /** Virtual destructor, frees memory + */ + virtual ~FGFrameAnatomy(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Returns shared type of this group (can be shared or per-frame) + * @return Always returns DcmFGTypes::EFGS_BOTH; + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clear all data + */ + virtual void clearData(); + + /** Check whether data in functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from given item + * @param item The item to read from, must contain Frame Anatomy Sequence + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write functional group to given item + * @param item The item to write Frame Anatomy Sequence to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + // --- get() functionality --- + + /** Get Laterality + * @param value Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise (i.e. if + * value is LATERALITY_INVALID). + */ + virtual OFCondition getLaterality(LATERALITY& value); + + /** Get anatomy information + * @return Reference to anatomic information + */ + virtual GeneralAnatomyMacro& getAnatomy(); + + // --- set() functionality --- + + /** Set Laterality + * @param value Value to be set + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLaterality(const LATERALITY& value); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + static LATERALITY str2Laterality(const OFString& lat); + + static OFString laterality2Str(const LATERALITY lat); + + static OFBool isLateralityValid(const LATERALITY lat); + +private: + + /* Content of Frame Anatomy Macro */ + + /// Frame Laterality (DS, VM 1, Required type 1) + LATERALITY m_FrameLaterality; + + /// General Anatomy Mandatory Macro + GeneralAnatomyMacro m_Anatomy; +}; + +#endif // FGFRAMEANATOMY_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgframevoilut.h b/dcmfg/include/dcmtk/dcmfg/fgframevoilut.h new file mode 100644 index 00000000..81cb6605 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgframevoilut.h @@ -0,0 +1,209 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Frame VOI LUT Functional Group + * + */ + +#ifndef FGFRAMEVOILUT_H +#define FGFRAMEVOILUT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the "Frame VOI LUT" Functional Group Macro + */ +class DCMTK_DCMFG_EXPORT FGFrameVOILUT : public FGBase +{ +public: + + /** Constructor creating empty functional group + */ + FGFrameVOILUT(); + + /** Virtual destructor + */ + virtual ~FGFrameVOILUT(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Get shared type of this kind functional group (can be both, per-frame or + * shared) + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clear old values + */ + virtual void clearData(); + + /** Check whether functional group contains valid data + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read Frame VOI LUT Sequence from given item + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write Frame VOI LUT Sequence to given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + // --- get() functionality --- + + /** Get Window Center + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowCenter(Float64& value, + const unsigned long pos = 0); + + /** Get Window Width + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowWidth(Float64& value, + const unsigned long pos = 0); + + /** Get Window Center and Window Width Explanation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowCenterAndWindowWidthExplanation(OFString& value, + const unsigned long pos = 0); + + /** Get tripe of information: Window Center, Window With, Window Center and + * Window Width Explanation + * @param windowCenter Reference to variable in which Window Center should + * be stored + * @param windowWidth Reference to variable in which Window Width should + * be stored + * @param explanation Reference to variable in which Window Center and + * Window Width Explanation should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCenterWidthExplanation(Float64& windowCenter, + Float64& windowWidth, + OFString& explanation); + + /** Get VOI LUT Function + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVOILUTFunction(OFString& value, + const unsigned long pos = 0); + + + // --- set() functionality --- + + /** Set Window Center + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setWindowCenter(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Window Width + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setWindowWidth(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Window Center and Window Width Explanation + * @param windowCenter Value for Window Center + * @param windowWidth Value for Window Width + * @param explanation Value for Window Center and Window Width Explanation + * should be stored + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1-n) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCenterWidthExplanation(const Float64& windowCenter, + const Float64& windowWidth, + const OFString& explanation = "", + const OFBool checkValue = OFTrue); + + /** Set VOI LUT Function + * @param value Value for VOI LUT Function + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVOILUTFunction(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of Frame VOI LUT Macro */ + + /// Window Center (DS, VM 1-n, Required type 1) + DcmDecimalString m_WindowCenter; + + /// Window Width (DS, VM 1-n, Required type 1) + DcmDecimalString m_WindowWidth; + + /// Window Center & Window Width Explanation (LO, VM 1-n, Required type 3) + DcmLongString m_WindowCenterWindowWidthExplanation; + + /// VOI LUT Function (CS, VM 1, Requirement Type 3) + DcmCodeString m_VOILUTFunction; +}; + +#endif // FGFRAMEVOILUT_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgimagedatatype.h b/dcmfg/include/dcmtk/dcmfg/fgimagedatatype.h new file mode 100644 index 00000000..1ba990f4 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgimagedatatype.h @@ -0,0 +1,179 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Image Data Type Functional Group + * + */ + +#ifndef FGIMAGEDATATYPE_H +#define FGIMAGEDATATYPE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class for managing Image Data Type Functional Group that identifies the + * data type characteristics of this frame + */ +class DCMTK_DCMFG_EXPORT FGImageDataType : public FGBase +{ +public: + + /** Constructor, creates empty Image Data Type functional group + */ + FGImageDataType(); + + /** Destructor, frees memory + */ + virtual ~FGImageDataType(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Get potential shared type of this group, always returns + * DcmFGTypes::EFGS_BOTH + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clear data + */ + virtual void clearData(); + + /** Check whether current data of this functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read Image Data Type Sequence (this functional group) from given item + * @param item Item to read from + * @return EC_Normal if reading works, error otherwise + */ + virtual OFCondition read(DcmItem &item); + + /** Write Image Data Type Sequence (this functional group) to given item + * @param item Item to write to + * @return EC_Normal if writing works, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + // --- get() functionality --- + + /** Get Data Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDataType(OFString& value, + const signed long pos = 0); + + /** Get Aliased Data Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAliasedDataType(OFString& value, + const signed long pos = 0); + + /** Get Zero Velocity Pixel Value + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getZeroVelocityPixelValue(Sint32& value, + const signed long pos = 0); + + // --- set() functionality --- + + /** Set Data Type + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDataType(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Aliased Data Type + * @param value Permitted values: "YES" or "NO". + * @param checkValue If enabled, the value is checked for conformance + * @return EC_Normal if value was set, error code otherwise + */ + virtual OFCondition setAliasedDataType(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Zero Velocity Pixel Value. Only use if Zero Velocity Pixel Value is of + * VR US, i.e.\ Pixel Representation = 0 + * @param value Value to be set + + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setZeroVelocityPixelValueUS(const Uint16 value); + + /** Set Zero Velocity Pixel Value. Only use if Zero Velocity Pixel Value is of + * VR SS, i.e.\ Pixel Representation = 1 + * @param value Value to be set + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setZeroVelocityPixelValueSS(const Sint16 value); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of Image Data Type Macro */ + + /// Data Type (CS, VM 1, Required type 1) + DcmCodeString m_DataType; + + /// Aliased Data Type (CS, VM 1, Required Type 1) + DcmCodeString m_AliasedDataType; + + /// Zero Velocity Pixel Value (US or SS, VM , Required Type 1C) + DcmUnsignedShort m_ZeroVelocityPixelValueUS; + + /// Zero Velocity Pixel Value (US or SS, VM , Required Type 1C) + DcmSignedShort m_ZeroVelocityPixelValueSS; + +}; + +#endif // FGIMAGEDATATYPE_H diff --git a/dcmfg/include/dcmtk/dcmfg/fginterface.h b/dcmfg/include/dcmtk/dcmfg/fginterface.h new file mode 100644 index 00000000..bd9c6cc5 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fginterface.h @@ -0,0 +1,317 @@ +/* + * + * Copyright (C) 2015-2019, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Main interface class for managing Functional Groups + * + */ + +#ifndef FGINTERFACE_H +#define FGINTERFACE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmfg/fgtypes.h" +#include "dcmtk/dcmfg/fgdefine.h" +#include "dcmtk/dcmfg/fg.h" + +// Forward declaration +class IODMultiframeDimensionModule; + +/** Main interface class to access functional groups from DICOM Enhanced + * objects. Allows reading, modifying and writing functional groups back + * and forth from DICOM datasets. + */ +class DCMTK_DCMFG_EXPORT FGInterface +{ + +public: + + /// Type representing per-frame functional groups, i.e.\ a number of + /// functional groups assigned to each frame + typedef OFMap PerFrameGroups; + + /// Iterator type for iterating over functional groups + typedef FunctionalGroups::iterator iterator; + + /// Const iterator type for iterating over functional groups + typedef FunctionalGroups::const_iterator const_iterator; + + /** Constructor, constructs empty sets of per-frame and shared + * functional groups + */ + FGInterface(); + + /** Virtual destructor, frees memory + */ + virtual ~FGInterface(); + + /** Delete all functional groups (shared and per-frame) + */ + virtual void clear(); + + /** Checks the functional groups for consistency. The following checks are + * performed: + * -# Check that every frame has a FrameContent functional group. + * -# Check that any per-frame group is not shared at the same time. + * -# Check for each per-frame group, that it is allowed to be per-frame. + * -# Check for each shared group, that it is allowed to be shared. + * @return OFTrue, if check consistency is ok, error otherwise + */ + virtual OFBool check(); + + /** Returns number of frames. Computed by number of per-frame + * functional group items (i.e.\ the Number of Frames attribute + * is not taken into account). + * @return Number of frames + */ + virtual size_t getNumberOfFrames(); + + /** Read enhanced multi-frame information from DICOM item, usually + * DcmDataset, i.e.\ must contain Shared and Per-frame Functional Group + * Sequences + * @param dataset The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& dataset); + + /** Write enhanced multi-frame information to DICOM item, + * usually DcmDataset, i.e.\ writes Shared and Per-frame Functional Group + * Sequences + * @param dataset The item to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& dataset); + + /** Get specific functional group for a frame, no matter whether it is stored + * per frame or shared + * @param frameNo The frame number the functional group should apply to + * (starts with 0) + * @param fgType The type of functional group to look for + * @return The functional group if found, NULL otherwise + */ + virtual FGBase* get(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType); + + // TODO Add get(..) version that takes the sequence tag (e.g.\ for unknown + // functional groups + + /** Get specific functional group for a frame, no matter whether it is stored + * per frame or shared. + * @param frameNo The frame number of group of interest (starts from 0) + * @param fgType The type of functional group to look for + * @param isPerFrame If OFTrue, the group found was found as per-frame, + * otherwise it is a shared functional group + * @return The functional group if found, error otherwise + */ + virtual FGBase* get(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType, + OFBool& isPerFrame); + + /** Return all per-frame functional groups, e.g.\ to iterate over them + * @param frameNo The frame number of the groups of interest (starts from 0) + * @return The per-frame functional groups for the given frame + */ + const FunctionalGroups* getPerFrame(const Uint32 frameNo) const; + + /** Return all shared functional groups, e.g.\ to iterate over them + * @return The shared functional groups + */ + const FunctionalGroups* getShared() const; + + /** Add functional group that should be shared for all frames. This will + * delete all per-frame groups of the same type if existing. + * @param group The group to be added. The group is copied. + * @return EC_Normal, if adding was successful, error otherwise + */ + virtual OFCondition addShared(const FGBase& group); + + /** Add functional group for given frame. If there is already a shared + * functional group with identical values, the call returns without + * errors, too. If there is a shared group that differs, the shared group + * is converted to be "per-frame" for all frames and then the given group + * is inserted for the frame specified by the user. + * If a per-frame functional group of the same type already exists it is + * overwritten. + * @param frameNo The frame number this group should be added for (starts + * from 0) + * @param group The group to be added. The group is copied when adding, + * so the ownership stays with the caller, no matter what the + * method returns. + * @return EC_Normal, if adding was successful, error otherwise + */ + virtual OFCondition addPerFrame(const Uint32 frameNo, + const FGBase& group); + + /** Deletes a shared functional group of the given type + * @param fgType The type of functional group to delete + * @return OFTrue if group existed and could be deleted, OFFalse (group did + * not exist) otherwise + */ + virtual OFBool deleteShared(const DcmFGTypes::E_FGType fgType); + + /** Deletes per-frame functional group of the given type for a specific frame + * @param frameNo The frame number for the functional group of interest. + * First frame is frame 0. + * @param fgType The type of functional group to delete + * @return OFTrue if group existed and could be deleted, OFFalse (group did + * not exist) otherwise + */ + virtual OFBool deletePerFrame(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType); + + /** Deletes per-frame functional group for all frames + * @param fgType The type of functional group to delete + * @return Number of per-frame groups deleted (usually equal to number of + * frames) + */ + size_t deletePerFrame(const DcmFGTypes::E_FGType fgType); + + /** Deletes all functional groups for a specific frame + * @param frameNo The frame number whose functional groups should be deleted. + * First frame is frame 0. + * @return Number of per-frame groups deleted for this frame + */ + size_t deleteFrame(const Uint32 frameNo); + + /** If enabled, functional group structure is checked before actual writing + * is performed in the write() method. Checking might be time consuming + * on functional groups with many frames, though disabling might result in + * invalid functional group structures. Disabling should only be done if the + * user knows that the functional groups are valid, wants to to adapt the + * functional groups manually after calling write() or knows what he's doing + * otherwise.
+ * Per default, checking is enabled. + * @param doCheck If OFTrue, checking will be performed. If OFFalse, + * no checks are performed. + */ + virtual void setCheckOnWrite(const OFBool doCheck); + + /** Returns whether functional group structure is checked before actual + * writing is performed in the write() method. + * @return OFTrue if checking is performed, OFFalse otherwise + */ + virtual OFBool getCheckOnWrite(); + +protected: + + /** Get shared functional group based on its type + * @param fgType The type of functional group + * @return The functional group or NULL if not existent + */ + virtual FGBase* getShared(const DcmFGTypes::E_FGType fgType); + + /** Insert shared functional group + * @param group The functional group to be inserted + * @param replaceExisting If OFTrue, an existing shared functional group + * will be deleted, otherwise the old group is not overwritten + * @return EC_Normal if insertion worked, FG_EC_DoubledFG if group exists and + * is not overwritten, other error code for other cases + */ + virtual OFCondition insertShared(FGBase* group, + const OFBool replaceExisting = OFTrue); + + /** Get per-frame functional group + * @param frameNo The frame number of the group + * @param fgType The type of the group + * @return The functional group or NULL if not existent + */ + virtual FGBase* getPerFrame(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType); + + /** Insert per-frame functional group + * @param frameNo The frame number the group should be added for + * @param group The functional group to be inserted + * @param replaceExisting If OFTrue, an existing per-frame functional group + * will be deleted, otherwise the old group is not overwritten + * @return EC_Normal if insertion worked, FG_EC_DoubledFG if group exists and + * is not overwritten, other error code for other cases + */ + virtual OFCondition insertPerFrame(const Uint32 frameNo, + FGBase* group, + const OFBool replaceExisting = OFTrue); + + /** Get existing per-frame group or create it for the given frame. Note that + * the per-frame groups do not have to be created "in order", i.e.\ one could + * add groups in order 3,5,1 ,... . + * @param frameNo The frame number to get/create per-frame groups for + * @return The functional groups if found/created, NULL in case of error + */ + virtual FunctionalGroups* getOrCreatePerFrameGroups(const Uint32 frameNo); + + /** Read Shared Functional Group Sequence from given item + * @param dataset The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition readSharedFG(DcmItem& dataset); + + /** Read Per-Frame Functional Group Sequence from given item + * @param dataset The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition readPerFrameFG(DcmItem& dataset); + + /** Read single functional group into the item provided + * @param fgItem The item to read from + * @param groups The resulting group after reading + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition readSingleFG(DcmItem& fgItem, + FunctionalGroups& groups); + + /** Write Shared Functional Group Sequence to given item + * @param dataset The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeSharedFG(DcmItem& dataset); + + /** Write Per-Frame Functional Group Sequence to given item + * @param dataset The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writePerFrameFG(DcmItem& dataset); + + /** Convert a shared functional group to a per-frame one by copying the + * shared one into a per-frame one for each frame and deleting the shared one + * aftewrards. + * @param fgType The type of functional group to convert + * @return EC_Normal if conversion worked out, FG_EC_NoSuchGroup if such a + * group does not exist and other error otherwise. In the last case + * the functional groups may be left in invalid state, but that + * should only happen for fatal errors like exhausted memory. + */ + virtual OFCondition convertSharedToPerFrame(const DcmFGTypes::E_FGType fgType); + +private: + + /// Shared functional groups + FunctionalGroups m_shared; + + /// Link from frame number (map key) to the list of functional groups (value) + /// relevant for the frame + PerFrameGroups m_perFrame; + + /// If enabled, functional group structure is checked on write(). Otherwise, + /// checks are skipped. + OFBool m_checkOnWrite; +}; + +#endif // MODMULTIFRAMEFGH_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgparametricmapframetype.h b/dcmfg/include/dcmtk/dcmfg/fgparametricmapframetype.h new file mode 100644 index 00000000..fd463464 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgparametricmapframetype.h @@ -0,0 +1,124 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Parametric Map Frame Type Functional Group + * + */ + +#ifndef FGPARAMETRICMAPFRAMETYPE_H +#define FGPARAMETRICMAPFRAMETYPE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmdata/dcvrcs.h" + +/** Class representing the Parametric Map Frame Type Functional Group Macro. + */ +class DCMTK_DCMFG_EXPORT FGParametricMapFrameType : public FGBase +{ +public: + /** Constructor, creates empty Parametric Map Frame Type Functional Group + */ + FGParametricMapFrameType(); + + /** Destructor, frees memory + */ + virtual ~FGParametricMapFrameType(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Get shared type of this functional group (can be both, per-frame and + * shared) + * @return Always returns EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clears all data + */ + virtual void clearData(); + + /** Check whether functional group contains valid data + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from given item, i.e.\ read Parametric Map Frame Type Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write functional group to given item, i.e.\ write Parametric Map Frame Type Sequence + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Get FrameType + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameType(OFString &value, + const signed long pos = 0) const; + + /** Set FrameType + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (4) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameType(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of Parametric Map Frame Type Functional Group Macro */ + + /// FrameType (CS, VM 4, Required type 1) + DcmCodeString m_FrameType; +}; + +#endif // FGPARAMETRICMAPFRAMETYPE_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgpixeltransform.h b/dcmfg/include/dcmtk/dcmfg/fgpixeltransform.h new file mode 100644 index 00000000..d98771fa --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgpixeltransform.h @@ -0,0 +1,187 @@ +/* + * + * Copyright (C) 2016-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the (Identity) Pixel Value Transformation FG + * + */ + +#ifndef FGPIXELTRANSFORM_H +#define FGPIXELTRANSFORM_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcvrlo.h" + + +/** Class representing the Identity Pixel Value Transformation as well as the + * Pixel Value Transformation Functional Group Macro. + * The former just differs in a way that Rescale Slope, Intercept and Type + * have fixed values (1, 0 and "US" respectively). + * Rescale Intercept to 0. Right now the + */ +class DCMTK_DCMFG_EXPORT FGPixelValueTransformation : public FGBase +{ +public: + + /** Constructor, creates (Identity) Pixel Value Transformation Functional Group. + * All values (Rescale Slope, Intercept and Type) are initialized as if the + * class is used as the Identity Pixel Value Transformation FG, i.e. Rescale + * Slope is set to 1, Intercept to 0 and Type to "US". + */ + FGPixelValueTransformation(); + + /** Destructor, frees memory + */ + virtual ~FGPixelValueTransformation(); + + /** Tell this class that it should behave like the Identity Pixel Value + * Transformation Functional Group. This does not make a difference when + * reading data, but when writing, it is assured that Rescale Slope, + * Intercept and Type are forced to be set to 1, 0 and "US" respectively. + */ + virtual void setUseAsIdentityPixelValueTransformation(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Get shared type of this functional group (can be both, per-frame and + * shared) + * @return Always returns EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clears all data + */ + virtual void clearData(); + + /** Check whether functional group contains valid data + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from given item, i.e.\ read (Identity) Pixel Value + * Transformation Sequence. Clears existing data before reading. + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write functional group to given item, i.e.\ write (Identity) Pixel Value + * Transformation Sequence + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Get RescaleIntercept + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleIntercept(OFString &value, + const signed long pos = 0) const; + + /** Get RescaleSlope + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleSlope(OFString &value, + const signed long pos = 0) const; + + /** Get RescaleType + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleType(OFString &value, + const signed long pos = 0) const; + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + /** Set RescaleIntercept + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleIntercept(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set RescaleSlope + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleSlope(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set RescaleType + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleType(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /* Content of Identity Pixel Value Transformation Functional Group Macro */ + + /// RescaleIntercept (DS, VM 1, Required type 1) + DcmDecimalString m_RescaleIntercept; + + /// RescaleSlope (DS, VM 1, Required type 1) + DcmDecimalString m_RescaleSlope; + + /// RescaleType (LO, VM 1, Required type 1) + DcmLongString m_RescaleType; + + /// If OFTrue, tells this class that it should behave like the Identity Pixel + /// Value Transformation Functional Group. This does not make a difference when + /// reading data, but when writing, it is assured that Rescale Slope, + /// Intercept and Type are forced to be set to 1, 0 and "US" respectively. + OFBool m_UseAsIdentityPixelValueTransformationFG; +}; + +#endif // FGPIXELTRANSFORM_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgpixmsr.h b/dcmfg/include/dcmtk/dcmfg/fgpixmsr.h new file mode 100644 index 00000000..72f43f12 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgpixmsr.h @@ -0,0 +1,170 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Pixel Measures Functional Group + * + */ + +#ifndef FGPIXMSR_H +#define FGPIXMSR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the Pixel Measures Functional Group Macro + */ +class DCMTK_DCMFG_EXPORT FGPixelMeasures : public FGBase +{ +public: + + /** Constructor, creates empty Pixel Measures Functional Group + */ + FGPixelMeasures(); + + /** Virtual destructor, frees memory + */ + virtual ~FGPixelMeasures(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + + /** Returns shared type of this group (can be shared or per-frame) + * @return Always returns DcmFGTypes::EFGS_BOTH; + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clear all data + */ + virtual void clearData(); + + /** Check whether data in functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from given item + * @param item The item to read from, must contain Pixel Measures Sequence + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write functional group to given item + * @param item The item to write Pixel Measures Sequence to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + // --- get() functionality --- + + /** Get Pixel Spacing + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelSpacing(Float64& value, + const signed long pos = 0); + + /** Get Slice Thickness + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSliceThickness(Float64& value, + const signed long pos = 0); + + /** Get Spacing Between Slices + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpacingBetweenSlices(Float64& value, + const signed long pos = 0); + + // --- set() functionality --- + + /** Set Pixel Spacing + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (2) if + * enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelSpacing(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Slice Thickness + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) if + * enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSliceThickness(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Spacing between Slices + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) if + * enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpacingBetweenSlices(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of Pixel Measures Macro */ + + /// Pixel Spacing (DS, VM 2, Required type 1C) + DcmDecimalString m_PixelSpacing; + + /// Slice Thickness (DS, VM 1, Required type 1C) + DcmDecimalString m_SliceThickness; + + /// Spacing Between Slices (DS, VM 1, Required type 3) + DcmDecimalString m_SpacingBetweenSlices; +}; + +#endif // FGPIXMSRS_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgplanor.h b/dcmfg/include/dcmtk/dcmfg/fgplanor.h new file mode 100644 index 00000000..2b8de192 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgplanor.h @@ -0,0 +1,175 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Orientation (Patient) Functional Group + * + */ + +#ifndef FGPLANOR_H +#define FGPLANOR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcvrds.h" + +/** Class representing the Plane Orientation (Patient) Functional Group Macro. + * It specifies the direction cosines of the first row and the first column + * with respect to the patient. + */ +class DCMTK_DCMFG_EXPORT FGPlaneOrientationPatient : public FGBase +{ +public: + + /** Constructor, creates empty functional group + */ + FGPlaneOrientationPatient(); + + /** Destructor, frees memory + */ + virtual ~FGPlaneOrientationPatient(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Convenience function to create a minimal functional group. + * @param imageOrientationPatientRowX Row X Value + * @param imageOrientationPatientRowY Row Y Value + * @param imageOrientationPatientRowZ Row Z Value + * @param imageOrientationPatientColX Column X Value + * @param imageOrientationPatientColY Column Y Value + * @param imageOrientationPatientColZ Column Z Value + * @return The functional group created with above parameters + */ + static FGPlaneOrientationPatient* createMinimal(const OFString& imageOrientationPatientRowX, + const OFString& imageOrientationPatientRowY, + const OFString& imageOrientationPatientRowZ, + const OFString& imageOrientationPatientColX, + const OFString& imageOrientationPatientColY, + const OFString& imageOrientationPatientColZ); + + /** Get shared type of this functional group (can be both, shared and + * per-frame) + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clears all data + */ + virtual void clearData(); + + /** Check whether this group contains valid data + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from item, must contain the Plane Orientation + * Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Writes functional group to given item (will write Plane Orientation + * Sequence to it) + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + // --- get() functionality --- + + /** Get Image Orientation Patient + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageOrientationPatient(OFString& value, + const signed long pos); + + /** Retrieve all values of Image Orientation Patient at the same time + * @param rowX Row X Value + * @param rowY Row Y Value + * @param rowZ Row Z Value + * @param colX Column X Value + * @param colY Column Y Value + * @param colZ Column Z Value + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageOrientationPatient(Float64& rowX, + Float64& rowY, + Float64& rowZ, + Float64& colX, + Float64& colY, + Float64& colZ); + + // --- set() functionality --- + + /** Set all values of Image Orientation Patient at once + * @param rowX Row X Value + * @param rowY Row Y Value + * @param rowZ Row Z Value + * @param colX Column X Value + * @param colY Column Y Value + * @param colZ Column Z Value + * @param checkValue If OFTrue, values are checked for validity + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageOrientationPatient(const OFString& rowX, + const OFString& rowY, + const OFString& rowZ, + const OFString& colX, + const OFString& colY, + const OFString& colZ, + const OFBool checkValue = OFTrue); + +private: + + /* Content of Plane Orientation (Patient) Macro */ + + /// Image Orientation (Patient) (DS, VM 6, Required type 1C) + DcmDecimalString m_ImageOrientationPatient; +}; + +#endif // FGPLANOR_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgplanorvol.h b/dcmfg/include/dcmtk/dcmfg/fgplanorvol.h new file mode 100644 index 00000000..16729c94 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgplanorvol.h @@ -0,0 +1,159 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Orientation (Volume) Functional Group + * + */ + +#ifndef FGPLANORVOL_H +#define FGPLANORVOL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the Plane Orientation (Volume) Functional Group Macro. + * It specifies the direction cosines of the first row and the first column of + * the frame with respect to the Volume Frame of Reference. + */ +class DCMTK_DCMFG_EXPORT FGPlaneOrientationVolume : public FGBase +{ +public: + + /** Constructor, creates empty Plane Orientation (Volume) Functional Group + */ + FGPlaneOrientationVolume(); + + /** Destructor, frees memory + */ + virtual ~FGPlaneOrientationVolume(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Get shared type of this functional group (can be both, per-frame and + * shared) + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clears all data + */ + virtual void clearData(); + + /** Check whether functional group contains valid data + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from given item, i.e.\ read Plane Orientation + * (Volume) Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write functional group to given item, i.e.\ write Plane Orientation + * (Volume) Sequence + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + // --- get() functionality --- + + /** Get Image Orientation Volume + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageOrientationVolume(Float64& value, + const unsigned long pos = 0); + + /** Retrieve all values of Image Orientation Volume at the same time + * @param rowX Row X Value + * @param rowY Row Y Value + * @param rowZ Row Z Value + * @param colX Column X Value + * @param colY Column Y Value + * @param colZ Column Z Value + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageOrientationVolume(Float64& rowX, + Float64& rowY, + Float64& rowZ, + Float64& colX, + Float64& colY, + Float64& colZ); + + // --- set() functionality --- + + /** Set all values of Image Orientation Volume at once + * @param rowX Row X Value + * @param rowY Row Y Value + * @param rowZ Row Z Value + * @param colX Column X Value + * @param colY Column Y Value + * @param colZ Column Z Value + * @param checkValue If OFTrue, values are checked for validity (not + * implemented yet) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageOrientationVolume(const Float64& rowX, + const Float64& rowY, + const Float64& rowZ, + const Float64& colX, + const Float64& colY, + const Float64& colZ, + const OFBool checkValue = OFTrue); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of Plane Orientation (Volume) Macro */ + + /// Image Orientation (Volume) (FD, VM 6, Required type 1) + DcmFloatingPointDouble m_ImageOrientationVolume; +}; + +#endif // FGPLANORVOL_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgplanpo.h b/dcmfg/include/dcmtk/dcmfg/fgplanpo.h new file mode 100644 index 00000000..1fcf2a21 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgplanpo.h @@ -0,0 +1,157 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Position (Patient) Functional Group + * + */ + +#ifndef FGPLANPO_H +#define FGPLANPO_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcvrds.h" + +/** Class representing the Plane Position (Patient) Functional Group containing + * the x, y, and z coordinates of the upper left hand corner (center of the + * first voxel transmitted) of the frame. + */ +class DCMTK_DCMFG_EXPORT FGPlanePosPatient : public FGBase +{ +public: + + /** Constructor, creates empty functional group + */ + FGPlanePosPatient(); + + /** Destructor, frees memory + */ + virtual ~FGPlanePosPatient(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Convenience function to create minimal functional group + * @param imagePositionPatientX The X coordinate of the upper left hand + * corner of the the frame in mm. + * @param imagePositionPatientY The Y coordinate of the upper left hand + * corner of the the frame in mm. + * @param imagePositionPatientZ The Z coordinate of the upper left hand + * corner of the the frame in mm. + */ + static FGPlanePosPatient* createMinimal(const OFString& imagePositionPatientX, + const OFString& imagePositionPatientY, + const OFString& imagePositionPatientZ); + + /** Returns that this functional group can be shared or per-frame (both) + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clears all data + */ + virtual void clearData(); + + /** Check whether data in functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from item, must contain the Plane Position Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write functional group to item, will write the Plane Position Sequence + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + // --- get() functionality --- + + /** Get Image Position Patient + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePositionPatient(OFString& value, + const signed long pos); + + /** Retrieve all values of Image Orientation Patient at the same time + * @param coordinateX X coordinate of upper left hand corner voxel in mm + * @param coordinateY Y coordinate of upper left hand corner voxel in mm + * @param coordinateZ Z coordinate of upper left hand corner voxel in mm + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePositionPatient(Float64& coordinateX, + Float64& coordinateY, + Float64& coordinateZ); + + // --- set() functionality --- + + /** Set Image Position Patient. The x, y, and z coordinates of the upper left + * hand corner (center of the first voxel transmitted) of the frame, in mm. + * @param coordinateX X coordinate of upper left hand corner voxel in mm + * @param coordinateY Y coordinate of upper left hand corner voxel in mm + * @param coordinateZ Z coordinate of upper left hand corner voxel in mm + * @param checkValue Check coordinates for validity, including VR (DS) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImagePositionPatient(const OFString& coordinateX, + const OFString& coordinateY, + const OFString& coordinateZ, + const OFBool checkValue = OFTrue); + +private: + + /* Content of Plane Position Patient Macro */ + + /// Image Position (Patient) (DS, VM 3, Required type 1C) + DcmDecimalString m_ImagePositionPatient; +}; + +#endif // FGPLANPO_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgplanposvol.h b/dcmfg/include/dcmtk/dcmfg/fgplanposvol.h new file mode 100644 index 00000000..40086ca8 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgplanposvol.h @@ -0,0 +1,159 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Position (Volume) Functional Group + * + */ + +#ifndef FGPLANEPOSVOL_H +#define FGPLANEPOSVOL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the Plane Position (Volume) Functional Group that + * identifies the position of the plane of this frame. + */ +class DCMTK_DCMFG_EXPORT FGPlanePositionVolume : public FGBase +{ +public: + + /** Constructor, creates empty functional group + */ + FGPlanePositionVolume(); + + /** Virtual destructor, frees memory + */ + virtual ~FGPlanePositionVolume(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Returns shared type of this functional group (can be shared or per-frame, + * i.e.\ both) + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clears all data + */ + virtual void clearData(); + + /** Check whether data of this functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from item, must contain the Plane Position (Volume) + * Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Writes functional group to item, i.e.\ writes the Plane Position (Volume) + * Sequence + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + // --- get() functionality --- + + /** Get Image Position Volume + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePositionVolume(Float64& value, + const unsigned long pos = 0); + + /** Retrieve all values of Image Position Volume at the same time + * @param valueX X coordinate of upper left hand corner voxel in mm + * @param valueY Y coordinate of upper left hand corner voxel in mm + * @param valueZ Z coordinate of upper left hand corner voxel in mm + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePositionVolume(Float64& valueX, + Float64& valueY, + Float64& valueZ); + + // --- set() functionality --- + + /** Set Image Position Volume, i.e.\ the x/y/z coordinates of the upper left + * hand corner (center of the first voxel transmitted) of the frame, in mm. + * @param value X,Y or Z coordinate of upper left hand corner voxel in mm + * @param pos pos 0 is x, pos 1 is Y, pos 2 addresses Z coordinate + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImagePositionVolume(const Float64& value, + const unsigned long pos = 0, + const OFBool checkValue = OFTrue); + + /** Set Image Position Volume, i.e.\ the x/y/z coordinates of the upper left + * hand corner (center of the first voxel transmitted) of the frame, in mm. + * @param valueX X coordinate of upper left hand corner voxel in mm + * @param valueY coordinate of upper left hand corner voxel in mm + * @param valueZ coordinate of upper left hand corner voxel in mm + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImagePositionVolume(const Float64& valueX, + const Float64& valueY, + const Float64& valueZ, + const OFBool checkValue = OFTrue); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of Plane Position (Volume) Macro */ + + /// Image Position (Volume) (FD, VM 3, Required type 1) + DcmFloatingPointDouble m_ImagePositionVolume; +}; + +#endif // FGPLANEPOSVOL_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgrealworldvaluemapping.h b/dcmfg/include/dcmtk/dcmfg/fgrealworldvaluemapping.h new file mode 100644 index 00000000..27545f9f --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgrealworldvaluemapping.h @@ -0,0 +1,420 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Real World Value Mapping Functional Group + * + */ + +#ifndef FGREALWORLDVALUEMAPPING_H +#define FGREALWORLDVALUEMAPPING_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmiod/iodcontentitemmacro.h" + +/** Class representing the Real World Value Mapping Functional Group that + * specifies the mapping of stored values to associated Real World values + */ +class DCMTK_DCMFG_EXPORT FGRealWorldValueMapping: public FGBase +{ +public: + + // Forward declaration + class RWVMItem; + + /** Constructor, creates empty functional group + */ + FGRealWorldValueMapping(); + + /** Destructor, frees memory + */ + virtual ~FGRealWorldValueMapping(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Returns that this functional group can be used as both, shared + * and per-frame + * @returns Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clear all data + */ + virtual void clearData(); + + /** Check whether data of functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from item, must contain the Real World Value Mapping + * Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Writes this functional group to item, i.e.\ will write the Real World Value + * Mapping Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + // --- get() functionality --- + + /** Return references to the various items inside the Real World Value Mapping + * Sequence + * @return Reference to Real World Value Mapping Sequence items + */ + virtual OFVector< RWVMItem* >& getRealWorldValueMapping(); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of Real World Value Mapping Macro */ + + /// Items (1-n) of Real World Value Mapping Sequence + OFVector m_Items; +}; + +/** Class representing the Real World Value Mapping Item Macro: + * Attribute name: (VR, VM, Requirement Type) + * Real World Value First Value Mapped: (US or SS, 1, 1) + * Real World Value Last Value Mapped: (US or SS, 1, 1) + * Real World Value Intercept: (FD, 1, 1C) + * Real World Value Slope: (FD, 1, 1C) + * Real World Value LUT Data (FD, 1-n, 1C) + * LUT Explanation (LO, 1, 1) + * LUT Label (SH, 1, 1) + * Measurement Units Code Sequence (SQ, 1, 1) + * Quantity Definition Sequence (SQ, 1, 3) + */ +class DCMTK_DCMFG_EXPORT FGRealWorldValueMapping::RWVMItem : public IODComponent +{ +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + RWVMItem(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + RWVMItem(IODComponent* parent = NULL); + + /** Copy Constructor + * @param rhs The item to copy from + */ + RWVMItem(const RWVMItem& rhs); + + /** Clone this class (perform deep copy) + * @return Clone of this class or NULL (e.g.\ if memory exhausted) + */ + RWVMItem* clone(); + + /** Virtual destructor, frees memory + */ + virtual ~RWVMItem(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of component + * @return Name of the module + */ + virtual OFString getName() const; + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const IODComponent& rhs) const; + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. + * Otherwise old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + // --- get() functionality --- + + /** Get Real World Value First Value Mapped + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRealWorldValueFirstValueMapped(Sint32& value, + const unsigned long pos = 0) const; + + /** Get Real World Value First Value Mapped + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRealWorldValueLastValueMapped(Sint32 &value, + const unsigned long pos = 0) const; + + /** Get Double Float Real World Value First Value Mapped + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoubleFloatRealWorldValueFirstValueMapped(Float64& value, + const unsigned long pos = 0) const; + + /** Get Double Float Real World Value Last Value Mapped + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoubleFloatRealWorldValueLastValueMapped(Float64& value, + const unsigned long pos = 0) const; + + /** Get Real World Value LUT Data + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRealWorldValueLUTData(Float64 &value, + const unsigned long pos = 0) const; + + /** Get Real World Value LUT Data + * @param values Reference to variable in which the values should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRealWorldValueLUTData(OFVector& values) const; + + /** Get LUT Explanation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLUTExplanation(OFString &value, + const signed long pos = 0) const; + + /** Get LUT Label + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLUTLabel(OFString &value, + const signed long pos = 0) const; + + /** Get Measurement Units Code Sequence (content) + * @return Reference to Measurement Units Code + */ + virtual CodeSequenceMacro& getMeasurementUnitsCode(); + + /** Get a reference to the entire ConceptNameCodeSequence, including items + * exceeding the value multiplicity restriction of "1" + * @return a reference to the entire ConceptNameCodeSequence + */ + virtual OFVector& getEntireQuantityDefinitionSequence(); + + // --- set() functionality --- + + /** Set Real World Value First Value Mapped + * @param value Value to be set. If Pixel Representation is 0 (unsigned + * pixel data) value must be 0 < value < 2^16. Otherwise use + * setRealWorldValueFirstValueMappedSigned(). + * @param checkValue Check 'value' for conformance with VR (US and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRealWorldValueFirstValueMappedUnsigned(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Real World Value First Value Mapped + * @param value Value to be set. If Pixel Representation is -1 (signed + * pixel data) value must be -2^15 < value < 2^15-1. Otherwise use + * setRealWorldValueFirstValueMappedUnsigned(). + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRealWorldValueFirstValueMappedSigned(const Sint16 &value, + const OFBool checkValue = OFTrue); + + /** Set Real World Value Last Value Mapped + * @param value Value to be set. If Pixel Representation is 0 (unsigned + * pixel data) value must be 0 < value < 2^16. Otherwise use + * setRealWorldValueLastValueMappedSigned(). + * @param checkValue Check 'value' for conformance with VR (US and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRealWorldValueLastValueMappedUnsigned(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Real World Value Last Value Mapped + * @param value Value to be set. If Pixel Representation is -1 (signed + * pixel data) value must be -2^15 < value < 2^15-1. Otherwise use + * setRealWorldValueLastValueMappedUnsigned(). + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRealWorldValueLastValueMappedSigned(const Sint16 &value, + const OFBool checkValue = OFTrue); + + /** Set Double Float Real World Value First Value Mapped + * @param value Value to be set + * @param checkValue Check 'value'. Does nothing, only for consistency with + * other set() functions. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoubleFloatRealWorldValueFirstValueMapped(const Float64 value, + const OFBool checkValue = OFTrue); + + /** Set Double Float Real World Value Last Value Mapped + * @param value Value to be set + * @param checkValue Check 'value'. Does nothing, only for consistency with + * other set() functions. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoubleFloatRealWorldValueLastValueMapped(const Float64 value, + const OFBool checkValue = OFTrue); + + /** Set Real World Value Intercept + * @param value Value to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRealWorldValueIntercept(const Float64 value, + const OFBool checkValue = OFTrue); + + /** Set Real World Value Slope + * @param value Value to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRealWorldValueSlope(const Float64 value, + const OFBool checkValue = OFTrue); + + /** Set Real World Value LUT Data + * @param value Values to be set + * @param checkValue Check 'value' for conformance with VR (FD) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRealWorldValueLUTData(const OFVector& value, + const OFBool checkValue = OFTrue); + + /** Set LUT Explanation + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLUTExplanation(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set LUT Label + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLUTLabel(const OFString &value, + const OFBool checkValue = OFTrue); + +protected: + + static OFCondition getUSorSS(DcmItem& item, + const DcmTagKey& key, + const unsigned long pos, + Sint32& value); + +private: + + /// The name of this module ("RealWorldValueMappingItemMacro") + static const OFString m_ModuleName; + + /// Measurement Units Code Sequence + CodeSequenceMacro m_MeasurementUnitsCode; + + /// Quantity Definition Sequence + OFVector m_QuantityDefinitionSequence; +}; + +#endif // FGREALWORLDVALUEMAPPING_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgseg.h b/dcmfg/include/dcmtk/dcmfg/fgseg.h new file mode 100644 index 00000000..153e8818 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgseg.h @@ -0,0 +1,128 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Segmentation Functional Group + * + */ + +#ifndef FGSEG_H +#define FGSEG_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the Segmentation Functional Group Macro + */ +class DCMTK_DCMFG_EXPORT FGSegmentation : public FGBase +{ + +public: + + /** Constructor, creates empty functional group + */ + FGSegmentation(); + + /** Destructor, frees memory + */ + virtual ~FGSegmentation(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Returns that this functional group can be used shared or per-frame, + * i.e.\ both + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + /** Clear all data + */ + virtual void clearData(); + + /** Check whether data in this functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + OFCondition check() const; + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGSegmentation) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the rhs object, or all compared components match + * but the rhs component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in the rhs object, or all compared components match + * but the rhs component is longer. + */ + virtual int compare(const FGBase& rhs) const; + + /** Get Referenced Segment Number + * @param value Reference to variable in which the value should be stored + * @param pos Index value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedSegmentNumber(Uint16 &value, + const unsigned long pos = 0); + + /** Set Referenced Segment Number + * @param segmentNumber Value to be set + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferencedSegmentNumber(const Uint16 &segmentNumber); + + /** Read functional group from item, must contain the Segment Identification + * Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Write functional group to item, will write Segment Identification + * Sequence + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + +private: + + /// Referenced Segment Number: (US, 1-n, 1) + /// Represents single value within the single permitted item of the + /// Segment Identification Sequence being the data structure the + /// Segmentation FG is made of. + DcmUnsignedShort m_ReferencedSegmentNumber; +}; + +#endif // FGSEG_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgtypes.h b/dcmfg/include/dcmtk/dcmfg/fgtypes.h new file mode 100644 index 00000000..f790cb7a --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgtypes.h @@ -0,0 +1,219 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing common functional group types + * + */ + +#ifndef FGTYPES_H +#define FGTYPES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmfg/fgdefine.h" + +class FGBase; +class FunctionalGroups; + +/*-----------------------* + * logging * + *-----------------------*/ + +extern DCMTK_DCMFG_EXPORT OFLogger DCM_dcmfgLogger; + +#define DCMFG_TRACE(msg) OFLOG_TRACE(DCM_dcmfgLogger, msg) +#define DCMFG_DEBUG(msg) OFLOG_DEBUG(DCM_dcmfgLogger, msg) +#define DCMFG_INFO(msg) OFLOG_INFO(DCM_dcmfgLogger, msg) +#define DCMFG_WARN(msg) OFLOG_WARN(DCM_dcmfgLogger, msg) +#define DCMFG_ERROR(msg) OFLOG_ERROR(DCM_dcmfgLogger, msg) +#define DCMFG_FATAL(msg) OFLOG_FATAL(DCM_dcmfgLogger, msg) + + +// include this file in doxygen documentation + +/** @file fgtypes.h + * @brief type definitions, constants and helper functions for the dcmfg module + */ + + +/*-----------------------* + * constant definitions * + *-----------------------*/ + +/* Specific error conditions for module dcmfg. + * These error codes can be used in addition to the general purpose + * codes defined in module dcmdata. + */ + +/// Functional group already exists +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_DoubledFG; +/// Specified functional group does not exist +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_NoSuchGroup; +/// Not enough items +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_NotEnoughItems; +/// Too many Items +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_TooManyItems; +/// Invalid data +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_InvalidData; +/// Could not write functional group +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_CouldNotWriteFG; +/// Could not insert functional group +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_CouldNotInsertFG; +/// No such shared functional group +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_NoSharedFG; +/// No such per-frame functional group +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_NoPerFrameFG; +/// Could not create functional group +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_CouldNotCreateFG; +/// Could not create functional group +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_CouldNotReadSourceImage; +/// Could not create functional group +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_CouldNotAddFG; +/// Not enough frames found +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_NotEnoughFrames; +/// No stacks specified (but expected) +extern DCMTK_DCMFG_EXPORT const OFConditionConst FG_EC_NoStacksFound; + +/*---------------------* + * class declaration * + *---------------------*/ + +/** General purpose class hiding global functions, constants and types related + * to functional groups from the global namespace. + */ +class DCMTK_DCMFG_EXPORT DcmFGTypes +{ + +public: + + // --- Type definitions --- + + /** Functional group types + */ + enum E_FGType + { + /// Undefined functional group + EFG_UNDEFINED, + /// Unknown functional group + EFG_UNKNOWN, + /// Cardiac Synchronization + EFG_CARDIACSYNC, + /// Contrast/Bolus Usage + EFG_CONTRASTBOLUSUSAGE, + /// Derivation Image + EFG_DERIVATIONIMAGE, + /// Frame Anatomy + EFG_FRAMEANATOMY, + /// Frame Content + EFG_FRAMECONTENT, + /// Frame Display Shutter + EFG_FRAMEDISPLAYSHUTTER, + /// Frame Pixel Shift + EFG_FRAMEPIXELSHIFT, + /// "Frame VOI LUT" or "Frame VOI LUT with LUT" Macro (share same starting sequence) + EFG_FRAMEVOILUTMETA, + /// Image Data Type + EFG_IMAGEDATATYPE, + /// Irradiation Event Identification + EFG_IRRADIATIONEVENTIDENT, + /// Parametric Map Frame Type + EFG_PARAMETRICMAPFRAMETYPE, + /// Patient Orientation in Frame + EFG_PATIENTORIENTINFRAME, + /// Patient Physiological State + EFG_PATIENTPHYSIOSTATE, + /// Pixel Intensity Relationship LUT + EFG_PIXELINTENSITYRELLUT, + /// Pixel Measures + EFG_PIXELMEASURES, + /// "Pixel Value Transformation" or "Identity Pixel Value Transformation" + /// (both share the same sequence and attributes) + EFG_PIXELVALUETRANSMETA, + /// Plane Orientation (Volume) + EFG_PLANEORIENTVOLUME, + /// Plane Position (Volume) + EFG_PLANEPOSITIONVOLUME, + /// Plane Position (Patient) + EFG_PLANEPOSPATIENT, + /// Plane Orientation (Patient) + EFG_PLANEORIENTPATIENT, + /// Radiopharmaceutical Usage + EFG_RADIOPHARAMAUSAGE, + /// Real World Value Mapping + EFG_REALWORLDVALUEMAPPING, + /// Respiratory Synchronization + EFG_RESPIRATORYSYNC, + /// Segmentation Macro + EFG_SEGMENTATION, + /// Temporal Position Macro + EFG_TEMPORALPOSITION, + /// Unassigned Shared Converted Attributes Macro + EFG_UNASSIGNEDSHAREDCONVERTEDATTRIBUTES, + /// US Image Description Macro + EFG_USIMAGEDESCRIPTION + }; + + /** Functional group types + */ + enum E_FGSharedType + { + /// Unknown + EFGS_UNKNOWN, + /// Functional Group can be shared or per-frame + EFGS_BOTH, + /// Functional Group can only be shared (not per-frame) + EFGS_ONLYSHARED, + /// Functional Group can only be per-frame (not shared) + EFGS_ONLYPERFRAME + }; + + /** US Image Description Frame Type (first value) + */ + enum E_FGUSFrameType + { + /// Unknown + EFGFT_UNKNOWN, + /// ORIGINAL + EFGFT_ORIGINAL, + /// DERIVED + EFGFT_DERIVED + }; + + // -- static helpers -- + + /** Returns functional group type based on tag key + * @param key The key to get the group type for + * @return The functional group type + */ + static E_FGType tagKey2FGType(const DcmTagKey& key); + + /** Returns the name of the functional group based on the group type + * @param fgType The functional group type + * @return The name of the functional group + */ + static OFString FGType2OFString(const E_FGType fgType); + + /** Returns the name of a functional group based on a given tag key + * @param key The tag key to get the functional group type for + * @return The name of the functional group + */ + static OFString tagKey2FGString(const DcmTagKey& key); + +}; + +#endif // FGTYPES_H diff --git a/dcmfg/include/dcmtk/dcmfg/fgusimagedescription.h b/dcmfg/include/dcmtk/dcmfg/fgusimagedescription.h new file mode 100644 index 00000000..cfc3fcc1 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/fgusimagedescription.h @@ -0,0 +1,183 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing US Image Description Functional Group + * + */ + +#ifndef FGUSIMAGEDESCRIPTION_H +#define FGUSIMAGEDESCRIPTION_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmfg/fgtypes.h" +#include "dcmtk/dcmfg/fgbase.h" + +/** Class representing the US Image Description Functional Group + */ +class DCMTK_DCMFG_EXPORT FGUSImageDescription: public FGBase +{ +public: + + /** Constructor, creates empty functional group + */ + FGUSImageDescription(); + + /** Destructor, frees memory + */ + virtual ~FGUSImageDescription(); + + /** Returns a deep copy of this object + * @return Deep copy of this object + */ + virtual FGBase *clone() const; + + /** Clears all data + */ + virtual void clearData(); + + /** Check whether data in this functional group is valid + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Read functional group from item, must contain the US Image Description + * Sequence + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem &item); + + /** Write functional group to item, will write to US Image Description + * Sequence + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Get shared type of this functional group (can be both, shared and + * per-frame) + * @return Always returns DcmFGTypes::EFGS_BOTH + */ + virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;} + + // --- get() functionality --- + + /** Get Frame Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameType(OFString& value, + const signed long pos = 0); + + /** Get Volumetric Properties + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumetricProperties(OFString& value, + const signed long pos = 0); + + /** Get Volume Based Calculation Technique + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumeBasedCalculationTechnique(OFString& value, + const signed long pos = 0); + + // --- set() functionality --- + + /** Set Frame Type. Frame Type contains up to four values. Value 3 and 4 are + * optional and can be left empty if desired. The values in their order + * of occurrence are: + * 1) Pixel Data Characteristics: Either ORIGINAL or DERIVED + * 2) Patient Examination Characteristics: Fixed to "PRIMARY", thus cannot be + * influenced through this function. + * 3) Image Flavor: Defined Terms listed in the standard + * 4) Derived Pixel Contrast: Defined Terms listed in the standard + * @param pixelDataChar Value 1 of Frame Type + * @param imageFlavor Value 3 of Frame Type + * @param derivedPixelContrast Value 4 of Frame Type + * @param checkValue If OFTrue, the value is checked for conformance. + * @return EC_Normal if setting was successful, error otherwise. + */ + virtual OFCondition setFrameType(const DcmFGTypes::E_FGUSFrameType pixelDataChar, + const OFString& imageFlavor = "", + const OFString& derivedPixelContrast = "", + const OFBool checkValue = OFTrue); + + /** Set Volumetric Properties + * @param value The value to set. Permitted values: + * "VOLUME", "SAMPLED", "DISTORTED", "MIXED" + * @param checkValue If OFTrue, the value is checked for conformance + * @return EC_Normal if setting was successful, error otherwise. + */ + virtual OFCondition setVolumetricProperties(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Volume Based Calculation Technique + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVolumeBasedCalculationTechnique(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * functional groups (this and rhs parameter) are compared by value! + * Both objects (this and rhs) need to have the same type (i.e.\ both + * FGUnknown) to be comparable. This function is used in order + * to decide whether a functional group already exists, or is new. This + * is used in particular to find out whether a given functional group + * can be shared (i.e.\ the same information already exists as shared + * functional group) or is different from the same shared group. In that + * case the shared functional group must be distributed into per-frame + * functional groups, instead. The exact implementation for implementing + * the comparison is not relevant. However, it must be a comparison + * by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the this object, or all compared components match + * but this component is shorter. Also returned if this type and + * rhs type (DcmFGTypes::E_FGType) do not match. + * 1 if either the value of the first component that does not match + * is greater in this object, or all compared components match + * but this component is longer. + */ + virtual int compare(const FGBase& rhs) const; + +private: + + /* Content of US Image Description Macro */ + + /// Frame Type (CS, VM 4, Required type 1) + DcmCodeString m_FrameType; + + /// Volumetric Properties (CS 1, VM 1, Required Type 1) + DcmCodeString m_VolumetricProperties; + + /// Volume Based Calculation Technique (CS, VM 1, Required Type 1) + DcmCodeString m_VolumeBasedCalculationTechnique; +}; + +#endif // FGUSIMAGEDESCRIPTION_H + diff --git a/dcmfg/include/dcmtk/dcmfg/stack.h b/dcmfg/include/dcmtk/dcmfg/stack.h new file mode 100644 index 00000000..a04b84a2 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/stack.h @@ -0,0 +1,140 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class representing a stack in the context of Enhanced DICOM objects + * + */ + +#ifndef FGSTACK_H +#define FGSTACK_H + +#include "dcmtk/config/osconfig.h" +#include +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmfg/fgdefine.h" + +/** Class representing a stack in the context of an Enhanced DICOM object. + * Therefore the class stores the ID of the stack (Stack ID) and all the frame + * numbers being part of that stack, as well as for each frame its position + * within the stack. + */ +class DCMTK_DCMFG_EXPORT FGStack +{ +public: + + // Make sure the main interface class has easy access to internal members + friend class FGStackInterface; + + /// Iterator type for iterating over the frames of a stack + typedef OFMap::iterator iterator; + + /// Const iterator for iterating over the frames of a stack + typedef OFMap::const_iterator const_iterator; + + /** Constructor, creates stack from Stack ID and assigned frame numbers + * @param stackID The Stack ID of the stack + * @param frameNumbers A map with frame numbers as the keys, and the + * position of the frame within the stack as the value for each + * frame. First position is 1. There may be frames having the same + * positions in the same stack. However, in that case the standard + * lists some elements which at least must have the same values, then: + * - Dimension Organization UID (0020,9164) to qualify the Stack ID + * - Image Position (Patient) (0020,0032) + * - Image Orientation (Patient) (0020,0037) + * - Rows (0028,0010) * first value of Pixel Spacing (0028,0030) (= field of view in the row direction) + * - Columns (0028,0011) * second value of Pixel Spacing (0028,0030) (= field of view in the column direction) + * - Slice Thickness (0018,0050) + * The values may change over time (last check was DICOM 2014a), so + * the latest edition of the standard should be consulted if it is + * planned to apply the same in-stack position to different frames. + */ + FGStack(const OFString& stackID, + const OFMap frameNumbers); + + /** Constructor, create empty stack with given Stack ID (and fill in frames + * later) + * @param stackID The Stack ID of the frame + */ + FGStack(const OFString& stackID); + + /** Virtual destructor, frees memory + */ + virtual ~FGStack(); + + /** Return const iterator to first frame (not sorted after stack position) + * @return Const iterator to first frame + */ + const_iterator begin() const; + + /** Return iterator to first frame (not sorted after stack position) + * @return Iterator to first frame + */ + iterator begin(); + + /** Return const iterator pointing behind last frame (not sorted after stack position) + * @return Const iterator pointing behind last frame + */ + const_iterator end() const; + + /** Return iterator pointing behind last frame (not sorted after stack position) + * @return Iterator pointing behind last frame + */ + iterator end(); + + /** Add frame to stack and set its in-stack position. Any old position + * will be overwritten. + * @param frameNumber The frame number that should be added to the stack + * @param inStackPos The position in the stack (starting from 1). More than + * one frame can have the same position in the stack, however there + * are rules (see documentation of constructor and the DICOM + * standard) + */ + virtual OFBool addFrame(const Uint32 frameNumber, + const Uint32 inStackPos); + + /** Get Stack ID uniquely identifying this stack + * @return The Stack ID + */ + virtual OFString getStackID() const; + + /** Get the stack position for a given frame + * @param frameNumber The number of the frame + * @return The stack position for that frame + */ + Uint32 getInStackPos(const Uint32 frameNumber) const; + + /** Get list of frames that are set to a specific In-Stack Position + * @param inStackPos In-Stack Position Number to find frames for + * @param resultFrameNumbers The frame numbers assigned to that stack + * position + */ + void getFramesAtStackPos(const Uint32 inStackPos, + OFVector& resultFrameNumbers); + +private: + + /// The Stack ID of this frame + OFString m_StackID; + + /// Map with frames, key is the frame number, value is the in-stack position. + /// More than one frame can have the same in-stack position + OFMap m_FrameNumbers; + +}; + +#endif // STACKREADER_H diff --git a/dcmfg/include/dcmtk/dcmfg/stackinterface.h b/dcmfg/include/dcmtk/dcmfg/stackinterface.h new file mode 100644 index 00000000..9c929c70 --- /dev/null +++ b/dcmfg/include/dcmtk/dcmfg/stackinterface.h @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for reading, accessing and writing stacks + * + */ + +#ifndef STACKINTERFACE_H +#define STACKINTERFACE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmfg/fginterface.h" +#include "dcmtk/dcmfg/stack.h" + +// Forward declaration +class FGFrameContent; + + +/** Class for convenient access of stacks within an Enhanced DICOM object + */ +class DCMTK_DCMFG_EXPORT FGStackInterface +{ +public: + + FGStackInterface(); + + OFBool checkConsistency(FGInterface* fgContext = NULL); + + virtual void clear(); + + virtual ~FGStackInterface(); + + virtual OFBool addStack(FGStack* stack); + + virtual OFCondition read(FGInterface& fgSource); + + virtual OFCondition write(FGInterface& fgDestination); + + size_t numStacks() const; + +protected: + + FGFrameContent* ensureFrameContentFG(const Uint32 frameNo, + FGInterface& fg); + + // Returns number of errors + virtual size_t checkContext(FGStack* stack, + FGInterface* context); + +private: + + /// The stacks found + OFMap m_Stacks; +}; + +#endif // STACKINTERFACE_H diff --git a/dcmfg/libsrc/CMakeLists.txt b/dcmfg/libsrc/CMakeLists.txt new file mode 100644 index 00000000..6426874d --- /dev/null +++ b/dcmfg/libsrc/CMakeLists.txt @@ -0,0 +1,26 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmfg + fg + fgbase + fgderimg + fgfact + fgfracon + fgframeanatomy + fgframevoilut + fgpixeltransform + fgimagedatatype + fginterface + fgpixmsr + fgparametricmapframetype + fgplanor + fgplanorvol + fgplanpo + fgplanposvol + fgrealworldvaluemapping + fgseg + fgusimagedescription + fgtypes + stack + stackinterface) + +DCMTK_TARGET_LINK_MODULES(dcmfg dcmiod dcmdata ofstd oflog) diff --git a/dcmfg/libsrc/Makefile.dep b/dcmfg/libsrc/Makefile.dep new file mode 100644 index 00000000..78a385a7 --- /dev/null +++ b/dcmfg/libsrc/Makefile.dep @@ -0,0 +1,2645 @@ +fg.o: fg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fg.h ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmfg/fgtypes.h ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgbase.h +fgbase.o: fgbase.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgbase.h ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfor.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \ + ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h +fgderimg.o: fgderimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmfg/fgderimg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h +fgfact.o: fgfact.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgfact.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgderimg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgfracon.h \ + ../include/dcmtk/dcmfg/fgframeanatomy.h \ + ../include/dcmtk/dcmfg/fgframevoilut.h \ + ../include/dcmtk/dcmfg/fgpixeltransform.h \ + ../include/dcmtk/dcmfg/fgimagedatatype.h \ + ../include/dcmtk/dcmfg/fgparametricmapframetype.h \ + ../include/dcmtk/dcmfg/fgpixmsr.h ../include/dcmtk/dcmfg/fgplanor.h \ + ../include/dcmtk/dcmfg/fgplanorvol.h ../include/dcmtk/dcmfg/fgplanpo.h \ + ../include/dcmtk/dcmfg/fgplanposvol.h ../include/dcmtk/dcmfg/fgseg.h \ + ../include/dcmtk/dcmfg/fgusimagedescription.h \ + ../include/dcmtk/dcmfg/fgrealworldvaluemapping.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h +fgfracon.o: fgfracon.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgfracon.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../include/dcmtk/dcmfg/fgdefine.h +fgframeanatomy.o: fgframeanatomy.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgframeanatomy.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +fgframevoilut.o: fgframevoilut.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgframevoilut.h ../include/dcmtk/dcmfg/fgbase.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h +fgimagedatatype.o: fgimagedatatype.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgimagedatatype.h ../include/dcmtk/dcmfg/fgbase.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h +fginterface.o: fginterface.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fginterface.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgtypes.h ../include/dcmtk/dcmfg/fgdefine.h \ + ../include/dcmtk/dcmfg/fg.h ../include/dcmtk/dcmfg/fgbase.h \ + ../include/dcmtk/dcmfg/fgfact.h +fgparametricmapframetype.o: fgparametricmapframetype.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgparametricmapframetype.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h +fgpixeltransform.o: fgpixeltransform.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgpixeltransform.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h +fgpixmsr.o: fgpixmsr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgpixmsr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h +fgplanor.o: fgplanor.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgplanor.h ../include/dcmtk/dcmfg/fgbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgfact.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h +fgplanorvol.o: fgplanorvol.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgplanorvol.h ../include/dcmtk/dcmfg/fgbase.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h +fgplanpo.o: fgplanpo.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgplanpo.h ../include/dcmtk/dcmfg/fgbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgfact.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h +fgplanposvol.o: fgplanposvol.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgplanposvol.h ../include/dcmtk/dcmfg/fgbase.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h +fgrealworldvaluemapping.o: fgrealworldvaluemapping.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgrealworldvaluemapping.h \ + ../include/dcmtk/dcmfg/fgbase.h ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +fgseg.o: fgseg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgseg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h +fgtypes.o: fgtypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgtypes.h ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfor.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \ + ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h +fgusimagedescription.o: fgusimagedescription.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fgusimagedescription.h \ + ../include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgbase.h +stack.o: stack.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/stack.h ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../include/dcmtk/dcmfg/fgdefine.h +stackinterface.o: stackinterface.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/stackinterface.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fginterface.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fg.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/stack.h \ + ../include/dcmtk/dcmfg/fgfracon.h diff --git a/dcmfg/libsrc/Makefile.in b/dcmfg/libsrc/Makefile.in new file mode 100644 index 00000000..def09187 --- /dev/null +++ b/dcmfg/libsrc/Makefile.in @@ -0,0 +1,58 @@ +# +# Makefile for dcmfg/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmioddir = $(top_srcdir)/../dcmiod + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmioddir)/include + +LOCALDEFS = + +objs = fgderimg.o fgframevoilut.o fgpixmsr.o fgplanpo.o fgseg.o stackinterface.o \ + fgbase.o fgfact.o fgimagedatatype.o fgplanor.o fgplanposvol.o fgtypes.o \ + fg.o fgfracon.o fginterface.o fgplanorvol.o fgrealworldvaluemapping.o \ + fgusimagedescription.o fgparametricmapframetype.o \ + fgpixeltransform.o fgframeanatomy.o stack.o + + +library = libdcmfg.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmfg/libsrc/fg.cc b/dcmfg/libsrc/fg.cc new file mode 100644 index 00000000..b97d2f19 --- /dev/null +++ b/dcmfg/libsrc/fg.cc @@ -0,0 +1,132 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Functional Groups from a DICOM object + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fg.h" + + +FunctionalGroups::FunctionalGroups() +: m_groups() +{ +} + + +FunctionalGroups::~FunctionalGroups() +{ + clear(); +} + + +void FunctionalGroups::clear() +{ + // free memory of underlying map + while ( m_groups.size() > 0) + { + FunctionalGroups::iterator it = m_groups.begin(); + FGBase* fg = (*it).second; + m_groups.erase(it); + delete fg; + } +} + + + +FGBase* FunctionalGroups::find(const DcmFGTypes::E_FGType fgType) +{ + FGBase* group = NULL; + FunctionalGroups::iterator it = m_groups.find(fgType); + FunctionalGroups::iterator done = m_groups.end(); + if ( it != done) + { + group = (*it).second; + } + return group; +} + + +FunctionalGroups::iterator FunctionalGroups::begin() +{ + return m_groups.begin(); +} + + +FunctionalGroups::iterator FunctionalGroups::end() +{ + return m_groups.end(); +} + + +FunctionalGroups::const_iterator FunctionalGroups::begin() const +{ + return m_groups.begin(); +} + + +FunctionalGroups::const_iterator FunctionalGroups::end() const +{ + return m_groups.end(); +} + + +OFCondition FunctionalGroups::insert(FGBase* group, + const OFBool replaceOld) +{ + if (group == NULL) + return EC_IllegalParameter; + + OFCondition result; + FGBase* existing = find(group->getType()); + if (existing) + { + if (replaceOld) + { + DCMFG_DEBUG("Replacing existing functional group"); + delete remove(group->getType()); + } + else + { + DCMFG_ERROR("Cannot insert functional group: Group does already exist"); + result = FG_EC_DoubledFG; + } + } + if (result.good()) + { + if ( (m_groups.insert(OFMake_pair(group->getType(), group)).second) ) + { + DCMFG_DEBUG("Functional group successfully inserted: " << DcmFGTypes::FGType2OFString(group->getType())); + } + else + { + DCMFG_ERROR("Cannot insert functional group: Internal error"); + result = FG_EC_CouldNotInsertFG; + } + } + return result; +} + + +FGBase* FunctionalGroups::remove(const DcmFGTypes::E_FGType fgType) +{ + FGBase* fg = find(fgType); + m_groups.erase(fgType); + return fg; +} + diff --git a/dcmfg/libsrc/fgbase.cc b/dcmfg/libsrc/fgbase.cc new file mode 100644 index 00000000..d382e054 --- /dev/null +++ b/dcmfg/libsrc/fgbase.cc @@ -0,0 +1,239 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Base class(es) for functional groups + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodcommn.h" // for static element helpers + + +FGBase::FGBase(const DcmFGTypes::E_FGType fgType) : + m_fgType(fgType) +{ +} + + +FGBase::~FGBase() +{ +} + + +void FGBase::clearData() +{ +} + + +DcmFGTypes::E_FGType FGBase::getType() const +{ + return m_fgType; +} + + +DcmFGTypes::E_FGSharedType FGBase::getSharedType() const +{ + return DcmFGTypes::EFGS_UNKNOWN; +} + + +int FGBase::compare(const FGBase& rhs) const +{ + // Check for equality from FGBase' point of view + + // Same objects? + if (this == &rhs) + return 0; + + // Type identical? + if ( this->getType() != rhs.getType() ) + return -1; + + // This is all we can do + return 0; +} + + +OFCondition FGBase::getItemFromFGSequence(DcmItem& source, + const DcmTagKey& seqKey, + const long unsigned int itemNum, + DcmItem*& result) +{ + result = NULL; + DcmSequenceOfItems *seq = NULL; + if (source.findAndGetSequence(seqKey, seq).bad()) + { + DCMFG_ERROR("Functional Group Sequence does not exist: " << seqKey << " (" << DcmFGTypes::tagKey2FGType(seqKey) << ")"); + return EC_TagNotFound; + } + result = seq->getItem(itemNum); + if (result == NULL) + { + DCMFG_DEBUG("Functional Group Sequence " << seqKey << " (" << DcmFGTypes::tagKey2FGType(seqKey) << ") does not have " << itemNum-1 << " items"); + return FG_EC_NotEnoughItems; + } + return EC_Normal; +} + + +OFCondition FGBase::createNewFGSequence(DcmItem& destination, + const DcmTagKey& seqKey, + const long unsigned int numItems, + DcmItem*& firstItem) +{ + firstItem = NULL; + OFCondition result = destination.insertEmptyElement(seqKey, OFTrue /* replace old */); + if (result.bad()) + { + DCMFG_ERROR("Could not create Functional Group with sequence " << seqKey << " (" << DcmFGTypes::tagKey2FGType(seqKey) << ")"); + return FG_EC_CouldNotInsertFG; + } + DcmItem* dummy =NULL; + result = destination.findOrCreateSequenceItem(seqKey, dummy, numItems ); + if (result.bad()) + { + // clean up + destination.findAndDeleteElement(seqKey); + DCMFG_ERROR("Could not create " << numItems << " items in Functional Group with sequence " << seqKey << " (" << DcmFGTypes::tagKey2FGType(seqKey) << ")"); + return FG_EC_CouldNotInsertFG; + } + destination.findOrCreateSequenceItem(seqKey, firstItem, 0); + return EC_Normal; +} + + +// ------------------ class FGUnknown ------------------------------------ + + +FGUnknown::FGUnknown(const DcmTagKey& seqStartTag, + const DcmFGTypes::E_FGSharedType sharedType) : + FGBase(DcmFGTypes::EFG_UNKNOWN), + m_seqStartTag(seqStartTag), + m_fgSequence(NULL), + m_sharedType(sharedType) +{ +} + +FGUnknown::FGUnknown(const FGUnknown& rhs) : + FGBase(DcmFGTypes::EFG_UNKNOWN), + m_seqStartTag(rhs.m_seqStartTag), + m_fgSequence(OFstatic_cast(DcmSequenceOfItems*, rhs.m_fgSequence->clone())), + m_sharedType(rhs.m_sharedType) +{ +} + + +FGUnknown & FGUnknown::operator=(const FGUnknown& rhs) +{ + m_seqStartTag = rhs.m_seqStartTag; + m_fgSequence = OFstatic_cast(DcmSequenceOfItems*, rhs.m_fgSequence->clone()); + m_sharedType = rhs.m_sharedType; + return *this; +} + + +void FGUnknown::clearData() +{ + if (m_fgSequence != NULL) + { + delete m_fgSequence; + m_fgSequence = NULL; + } +} + + +OFCondition FGUnknown::read(DcmItem& item) +{ + // clear old data + clearData(); + OFCondition result = item.findAndGetSequence(m_seqStartTag, m_fgSequence, OFFalse /* no depth search */, OFTrue /* create copy! */); + if ( result.bad() ) + { + if (m_fgSequence != NULL) + delete m_fgSequence; + m_fgSequence = NULL; + } + return result; +} + + +OFCondition FGUnknown::write(DcmItem& item) +{ + return item.insert(new DcmSequenceOfItems(*m_fgSequence), OFTrue /* replace old! */); +} + + +OFCondition FGUnknown::check() const +{ + return EC_Normal; +} + + +int FGUnknown::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result == 0) + { + const FGUnknown* myRhs = OFstatic_cast(const FGUnknown*, &rhs); + + // Compare all elements + if (m_seqStartTag == myRhs->m_seqStartTag) + { + if (m_fgSequence && myRhs->m_fgSequence) + { + result = m_fgSequence->compare( *(myRhs->m_fgSequence) ); + } + else if (!m_fgSequence && !myRhs->m_fgSequence) // if both are not set, objects are still equal + { + result = 0; + } + else if (m_fgSequence) + { + result = 1; // this object is bigger (more information) + } + else if (myRhs->m_fgSequence) + { + result = -1; // rhs object is bigger (more information) + } + } + else + { + result = (m_seqStartTag < myRhs->m_seqStartTag) ? -1 : 1; + } + } + + return result; +} + + +FGUnknown::~FGUnknown() +{ + clearData(); +} + + +FGBase* FGUnknown::clone() const +{ + FGUnknown* copy = new FGUnknown(this->m_seqStartTag); + if (copy) + { + *(copy->m_fgSequence) = *(this->m_fgSequence); + } + return copy; +} diff --git a/dcmfg/libsrc/fgderimg.cc b/dcmfg/libsrc/fgderimg.cc new file mode 100644 index 00000000..d6874474 --- /dev/null +++ b/dcmfg/libsrc/fgderimg.cc @@ -0,0 +1,712 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Derivation Image Functional Group + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcdatutl.h" +#include "dcmtk/dcmfg/fgderimg.h" +#include "dcmtk/dcmiod/iodutil.h" + + +FGDerivationImage::FGDerivationImage() : + FGBase(DcmFGTypes::EFG_DERIVATIONIMAGE), + m_DerivationImageItems() +{ +} + + +FGDerivationImage::~FGDerivationImage() +{ + DcmIODUtil::freeContainer(m_DerivationImageItems); +} + + +FGBase* FGDerivationImage::clone() const +{ + FGDerivationImage* copy = new FGDerivationImage(); + if (copy) + { + OFVector::const_iterator it = m_DerivationImageItems.begin(); + while ( it != m_DerivationImageItems.end() ) + { + DerivationImageItem* itemCopy = new DerivationImageItem(); + if (!itemCopy) + { + DCMFG_FATAL("Cannot clone FGDerivationImage: Memory exhausted"); + return NULL; + } + *itemCopy = **it; + copy->getDerivationImageItems().push_back(itemCopy); + it++; + } + } + return copy; +} + + +FGDerivationImage* FGDerivationImage::createMinimal(const OFVector& derivationImages, + const OFString& derivationDescription, + const CodeSequenceMacro& derivationCode, + const CodeSequenceMacro& purposeOfReference) +{ + OFCondition result; + FGDerivationImage* group = new FGDerivationImage(); + if (group) + { + DerivationImageItem* derivItem = NULL; + result = group->addDerivationImageItem(derivationCode, derivationDescription, derivItem); + if (result.good()) + { + OFVector srcImages = derivItem->getSourceImageItems(); + OFVector::const_iterator imageRef = derivationImages.begin(); + while (imageRef != derivationImages.end()) + { + SourceImageItem* item = new SourceImageItem(); + if (item) + { + item->getPurposeOfReferenceCode() = purposeOfReference; + item->getImageSOPInstanceReference() = *imageRef; + derivItem->getSourceImageItems().push_back(item); + } + else + { + DCMFG_ERROR("Cannot create derivation description: Out of memory"); + result = EC_MemoryExhausted; + } + imageRef++; + } + } + else + { + DCMFG_ERROR("Cannot create derivation description: " << result.text()); + } + } + else + { + result = EC_MemoryExhausted; + } + + if (result.bad()) + { + delete group; + group = NULL; + } + + return group; +} + + +int FGDerivationImage::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGDerivationImage* myRhs = OFstatic_cast(const FGDerivationImage*, &rhs); + if (!myRhs) + { + return -1; + } + + size_t thisSize = m_DerivationImageItems.size(); + size_t rhsSize = myRhs->m_DerivationImageItems.size(); + if (thisSize < rhsSize) + { + return 1; + } + else if (thisSize > rhsSize) + { + return -1; + } + + for (size_t count = 0; count < thisSize; count++) + { + int error = (*(m_DerivationImageItems[count])).compare( (*(myRhs->m_DerivationImageItems[count])) ); + if (error != 0) + { + return error; + } + } + + return 0; + +} + + +void FGDerivationImage::clearData() +{ + DcmIODUtil::freeContainer(m_DerivationImageItems); +} + + +OFCondition FGDerivationImage::check() const +{ + OFCondition result; + OFVector::const_iterator it = m_DerivationImageItems.begin(); + while ( (it != m_DerivationImageItems.end()) && result.good() ) + { + result = (*it)->check(); + it++; + } + + return result; +} + +DerivationImageItem& DerivationImageItem::operator=(const DerivationImageItem& rhs) +{ + m_DerivationDescription = rhs.m_DerivationDescription; + // Copy nested structures: Derivation Codes + OFVector::const_iterator code = rhs.m_DerivationCodeItems.begin(); + while ( code != rhs.m_DerivationCodeItems.end() ) + { + m_DerivationCodeItems.push_back(new CodeSequenceMacro(**code)); + code++; + } + // Copy nested structures: Derivation Codes + OFVector::const_iterator source = rhs.m_SourceImageItems.begin(); + while ( source != rhs.m_SourceImageItems.end() ) + { + m_SourceImageItems.push_back(new SourceImageItem(**source)); + source++; + } + return *this; +} + + +OFCondition FGDerivationImage::addDerivationImageItem(const CodeSequenceMacro& derivationCode, + const OFString& derivationDescription, + DerivationImageItem*& item) +{ + OFCondition result; + item = new DerivationImageItem(); + if (item == NULL) + { + return EC_MemoryExhausted; + } + + // Initialize with given data + if (result.good()) + { + result = item->setDerivationDescription(derivationDescription); + } + if (result.good()) + { + item->getDerivationCodeItems().push_back(new CodeSequenceMacro(derivationCode)); + m_DerivationImageItems.push_back(item); + } + else + { + delete item; + item = NULL; + result = FG_EC_InvalidData; + } + return result; +} + + +OFVector& FGDerivationImage::getDerivationImageItems() +{ + return m_DerivationImageItems; +} + + +OFCondition FGDerivationImage::read(DcmItem& item) +{ + /* re-initialize object */ + clearData(); + + DcmSequenceOfItems *derivationImageSequence = NULL; + if (item.findAndGetSequence(DCM_DerivationImageSequence, derivationImageSequence).bad()) + return FG_EC_NoSuchGroup; + + /* Read Derivation Image Sequence */ + DcmIODUtil::readSubSequence > + ( derivationImageSequence, + DCM_DerivationImageSequence, + m_DerivationImageItems, + "0-n", + "2", + "DerivationImageMacro"); + + return EC_Normal; +} + + +OFCondition FGDerivationImage::write(DcmItem& item) +{ + OFCondition result = check(); + DcmIODUtil::writeSubSequence > + ( result, + DCM_DerivationImageSequence, + m_DerivationImageItems, + item, + "0-n", + "2", + "DerivationImageMacro" ); + return result; +} + + +/* -- Class SourceImage Implementation -- */ + +SourceImageItem::SourceImageItem() + : m_PurposeOfReferenceCode(), + m_ImageSOPInstanceReference() +{ +} + + +SourceImageItem::~SourceImageItem() +{ + clearData(); +} + + +SourceImageItem& SourceImageItem::operator=(const SourceImageItem& rhs) +{ + m_PurposeOfReferenceCode = rhs.m_PurposeOfReferenceCode; + m_ImageSOPInstanceReference = rhs.m_ImageSOPInstanceReference; + return *this; +} + + +void SourceImageItem::clearData() +{ + m_PurposeOfReferenceCode.clearData(); + m_ImageSOPInstanceReference.clear(); +} + + +OFCondition SourceImageItem::check() const +{ + OFCondition result = OFconst_cast(ImageSOPInstanceReferenceMacro*, &m_ImageSOPInstanceReference)->check(); + if (result.bad()) + { + return result; + } + + return OFconst_cast(CodeSequenceMacro*, &m_PurposeOfReferenceCode)->check(); +} + + +int SourceImageItem::compare(const SourceImageItem& rhs) const +{ + int result = this->m_PurposeOfReferenceCode.compare(rhs.m_PurposeOfReferenceCode); + if (result != 0) + { + result = this->m_ImageSOPInstanceReference.compare(rhs.m_ImageSOPInstanceReference); + } + + return result; +} + + +CodeSequenceMacro& SourceImageItem::getPurposeOfReferenceCode() +{ + return m_PurposeOfReferenceCode; +} + + +ImageSOPInstanceReferenceMacro& SourceImageItem::getImageSOPInstanceReference() +{ + return m_ImageSOPInstanceReference; +} + + +OFCondition SourceImageItem::read(DcmItem& itemOfSourceImageSequence, + const OFBool clearOldData) +{ + /* Re-initialize object */ + if (clearOldData) + clearData(); + + /* Read Purpose of Reference Code Sequence */ + DcmIODUtil::readSingleItem(itemOfSourceImageSequence, DCM_PurposeOfReferenceCodeSequence, m_PurposeOfReferenceCode, "1", "DerivationImageMacro"); + + /* Read Source Image Sequence */ + m_ImageSOPInstanceReference.read(itemOfSourceImageSequence); + + return EC_Normal; +} + + +OFCondition SourceImageItem::write(DcmItem& itemOfSourceImageSequence) +{ + OFCondition result = EC_Normal; + + /* Write Purpose of Reference Code Sequence */ + DcmIODUtil::writeSingleItem(result, DCM_PurposeOfReferenceCodeSequence, m_PurposeOfReferenceCode, itemOfSourceImageSequence, "1", "DerivationImageMacro"); + + /* Write Image SOP Instance Reference Macro */ + if ( result.good() ) + { + m_ImageSOPInstanceReference.write(itemOfSourceImageSequence); + } + + return result; +} + + +/* -- Class DerivationImageItem Implementation -- */ + +DerivationImageItem::DerivationImageItem() + : m_DerivationDescription(DCM_DerivationDescription), + m_DerivationCodeItems(), + m_SourceImageItems() +{ +} + + +DerivationImageItem::DerivationImageItem(const DerivationImageItem& rhs) + : m_DerivationDescription(rhs.m_DerivationDescription), + m_DerivationCodeItems(), + m_SourceImageItems() +{ + OFVector::const_iterator it = rhs.m_DerivationCodeItems.begin(); + while (it != rhs.m_DerivationCodeItems.end()) + { + CodeSequenceMacro* copy = new CodeSequenceMacro(**it); + if (!copy) + { + DCMFG_ERROR("Could not create copy of DerivationImageItem: Memory exhausted"); + this->clearData(); + return; + } + m_DerivationCodeItems.push_back(copy); + it++; + } + + OFVector::const_iterator src = rhs.m_SourceImageItems.begin(); + while (src != rhs.m_SourceImageItems.end()) + { + SourceImageItem* copy = new SourceImageItem(**src); + if (!copy) + { + DCMFG_ERROR("Could not create copy of DerivationImageItem: Memory exhausted"); + this->clearData(); + return; + } + m_SourceImageItems.push_back(copy); + it++; + } +} + + +void DerivationImageItem::clearData() +{ + m_DerivationDescription.clear(); + DcmIODUtil::freeContainer(m_DerivationCodeItems); + DcmIODUtil::freeContainer(m_SourceImageItems); +} + + +int DerivationImageItem::compare(const DerivationImageItem& rhs) const +{ + if (this == &rhs) + return OFTrue; + + int result = m_DerivationDescription.compare(rhs.m_DerivationDescription); + if (result != 0) return result; + + size_t numThis = m_DerivationCodeItems.size(); + size_t numRhs = rhs.m_DerivationCodeItems.size(); + size_t maxSize = (numThis > numRhs) ? numThis : numRhs; + for (size_t count = 0; count < maxSize; count++) + { + int error = (*m_DerivationCodeItems[count]).compare(*(rhs.m_DerivationCodeItems[count])); + if (error != 0) + { + return error; + } + } + if (numThis < numRhs) + { + return 1; + } + else if (numThis > numRhs) + { + return -1; + } + + numThis = m_SourceImageItems.size(); + numRhs = rhs.m_SourceImageItems.size(); + maxSize = (numThis > numRhs) ? numThis : numRhs; + for (size_t count = 0; count < maxSize; count++) + { + int error = (*m_SourceImageItems[count]).compare(*(rhs.m_SourceImageItems[count])); + if (error != 0) + { + return error; + } + } + if (numThis < numRhs) + { + return 1; + } + else if (numThis > numRhs) + { + return -1; + } + + // If we get here, the object values must be identical + return 0; +} + + +OFCondition DerivationImageItem::check() const +{ + if (m_DerivationCodeItems.size() == 0) + { + DCMFG_ERROR("Derivation Code Sequence in Derivation Image Functional Group Macro must have one or more items"); + return FG_EC_InvalidData; + } + + OFCondition result; + OFVector::const_iterator it = m_DerivationCodeItems.begin(); + while (it != m_DerivationCodeItems.end() && result.good()) + { + result = (*it)->check(); + it++; + } + + OFVector::const_iterator ref = m_SourceImageItems.begin(); + while ((ref != m_SourceImageItems.end()) && result.good()) + { + result = (*ref)->check(); + ref++; + } + return result; +} + + +DerivationImageItem::~DerivationImageItem() +{ + clearData(); +} + + +OFCondition DerivationImageItem::addSourceImageItem(const OFString& file, + const CodeSequenceMacro& purposeOfReference, + SourceImageItem*& resultSourceImageItem) +{ + DcmFileFormat dcmff; + DcmDataset *dataset = NULL; + OFCondition result = dcmff.loadFile(file.c_str()); + if (result.bad()) + { + DCMFG_ERROR("Could not load file " << file << ": " << result.text()); + return result; + } + dataset = dcmff.getDataset(); + return addSourceImageItem(dataset, purposeOfReference, resultSourceImageItem); +} + + +OFCondition DerivationImageItem::addSourceImageItem(DcmDataset *dataset, + const CodeSequenceMacro& purposeOfReference, + SourceImageItem*& resultSourceImageItem) +{ + // Create new source image item + SourceImageItem *item = new SourceImageItem(); + if (item == NULL) + { + return EC_MemoryExhausted; + } + + // check code validity + if ( OFconst_cast(CodeSequenceMacro*, &purposeOfReference)->check().bad() ) + { + DCMFG_ERROR("Purpose of Reference code within item of Derivation Image Sequence is invalid"); + return FG_EC_InvalidData; + } + + item->getPurposeOfReferenceCode() = purposeOfReference; + resultSourceImageItem = NULL; + OFString sopClass, sopInstance, ts; + OFCondition result = DcmDataUtil::getSOPInstanceFromDataset(dataset, EXS_Unknown, sopClass, sopInstance, ts /*ignored*/); + { + if ( result.good() ) result = item->getImageSOPInstanceReference().setReferencedSOPClassUID(sopClass); + if ( result.good() ) result = item->getImageSOPInstanceReference().setReferencedSOPInstanceUID(sopInstance); + } + if (result.good()) + { + m_SourceImageItems.push_back(item); + resultSourceImageItem = item; + } + else + { + delete item; + } + + return result; +} + + +OFCondition DerivationImageItem::addSourceImageItems(const OFVector< OFString >& files, + const CodeSequenceMacro& purposeOfReference, + OFVector& resultSourceImageItems, + const OFBool skipErrors) +{ + DcmFileFormat dcmff; + OFCondition result; + DcmDataset *dataset = NULL; + OFVector datasets; + OFVector::const_iterator it = files.begin(); + while (it != files.end()) + { + result = dcmff.loadFile((*it).c_str()); + if (result.bad()) + { + DCMFG_ERROR("Could not load file " << (*it) << ": " << result.text()); + return result; + } + dataset = dcmff.getDataset(); + datasets.push_back(dataset); + it++; + } + return addSourceImageItems(datasets, purposeOfReference, resultSourceImageItems, skipErrors); +} + + +OFCondition DerivationImageItem::addSourceImageItems(const OFVector& datasets, + const CodeSequenceMacro& purposeOfReference, + OFVector& resultSourceImageItems, + const OFBool skipErrors) + { + OFCondition result; + OFVector::const_iterator it = datasets.begin(); + while (it != datasets.end()) + { + SourceImageItem* resultItem = NULL; + result = addSourceImageItem((*it), purposeOfReference, resultItem); + if (result.good()) + { + resultSourceImageItems.push_back(resultItem); + } + else if (result.bad() && !skipErrors) + { + DCMFG_ERROR("Could not add Source Image Sequence item for file " << *it << ": " << result.text()); + break; + } + else if (result.bad()) + { + DCMFG_WARN("Could not add Source Image Sequence item for file " << *it << ": " << result.text()); + } + it++; + } + + return result; +} + + +OFVector& DerivationImageItem::getDerivationCodeItems() +{ + return m_DerivationCodeItems; +} + + +OFCondition DerivationImageItem::getDerivationDescription(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_DerivationDescription, value, pos); +} + + +OFCondition DerivationImageItem::setDerivationDescription(const OFString& value, + const OFBool checkValue) +{ + (void)checkValue; + return m_DerivationDescription.putOFStringArray(value); +} + + +OFVector& DerivationImageItem::getSourceImageItems() +{ + return m_SourceImageItems; +} + + +OFCondition DerivationImageItem::read(DcmItem& itemOfDerivationImageSequence, + const OFBool clearOldData) +{ + OFCondition result = EC_Normal; + + /* re-initialize object */ + if (clearOldData) + clearData(); + + /* Derivation Description */ + DcmIODUtil::getAndCheckElementFromDataset(itemOfDerivationImageSequence, m_DerivationDescription, "1" /* vm */, "3" /* type */, "DerivationImageMacro"); + + /* Derivation Code Sequence */ + DcmIODUtil::readSubSequence > + ( itemOfDerivationImageSequence, + DCM_DerivationCodeSequence, + m_DerivationCodeItems, + "1" /* vm */, + "3" /* type */, + "DerivationImageMacro" ); + + + /* Source Image Sequence */ + DcmIODUtil::readSubSequence > + ( itemOfDerivationImageSequence, + DCM_SourceImageSequence, + m_SourceImageItems, + "0-n" /* vm */, + "2" /* type */, + "DerivationImageMacro" ); + + return result; +} + + +OFCondition DerivationImageItem::write(DcmItem& itemOfDerivationImageSequence) +{ + OFCondition result = EC_Normal; + + /* Write Derivation Description */ + DcmIODUtil::copyElementToDataset(result, itemOfDerivationImageSequence, m_DerivationDescription, "1", "3", "DerivationImageMacro"); + + /* Write Derivation Code Sequence */ + DcmIODUtil::writeSubSequence > + ( result, + DCM_DerivationCodeSequence, + m_DerivationCodeItems, + itemOfDerivationImageSequence, + "1-n", + "1", + "DerivationImageMacro" ); + + /* Write Source Image Sequence */ + DcmIODUtil::writeSubSequence > + ( result, + DCM_SourceImageSequence, + m_SourceImageItems, + itemOfDerivationImageSequence, + "0-n", + "2", + "DerivationImageMacro" ); + + return result; +} + diff --git a/dcmfg/libsrc/fgfact.cc b/dcmfg/libsrc/fgfact.cc new file mode 100644 index 00000000..a7146a93 --- /dev/null +++ b/dcmfg/libsrc/fgfact.cc @@ -0,0 +1,155 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Factory class for creating functional groups + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgfact.h" +#include "dcmtk/dcmfg/fgderimg.h" +#include "dcmtk/dcmfg/fgfracon.h" +#include "dcmtk/dcmfg/fgframeanatomy.h" +#include "dcmtk/dcmfg/fgframevoilut.h" +#include "dcmtk/dcmfg/fgpixeltransform.h" +#include "dcmtk/dcmfg/fgimagedatatype.h" +#include "dcmtk/dcmfg/fgparametricmapframetype.h" +#include "dcmtk/dcmfg/fgpixmsr.h" +#include "dcmtk/dcmfg/fgplanor.h" +#include "dcmtk/dcmfg/fgplanorvol.h" +#include "dcmtk/dcmfg/fgplanpo.h" +#include "dcmtk/dcmfg/fgplanposvol.h" +#include "dcmtk/dcmfg/fgseg.h" +#include "dcmtk/dcmfg/fgusimagedescription.h" +#include "dcmtk/dcmfg/fgrealworldvaluemapping.h" + + +FGFactory* FGFactory::m_Instance = NULL; + +FGFactory::FGFactory() +{ + // noting to do (private constructor) +} + + + +FGFactory& FGFactory::instance() +{ + if (m_Instance == NULL) + { + m_Instance = new FGFactory(); + } + return *m_Instance; +} + + +FGBase* FGFactory::create(const DcmFGTypes::E_FGType fgtype) +{ + switch(fgtype) + { + case DcmFGTypes::EFG_PIXELMEASURES: + return new FGPixelMeasures(); + break; + case DcmFGTypes::EFG_FRAMEANATOMY: + return new FGFrameAnatomy(); + break; + case DcmFGTypes::EFG_FRAMECONTENT: + return new FGFrameContent(); + break; + case DcmFGTypes::EFG_FRAMEVOILUTMETA: // Frame VOI LUT and Frame VOI LUT with LUT + return new FGFrameVOILUT(); + break; + case DcmFGTypes::EFG_PARAMETRICMAPFRAMETYPE: + return new FGParametricMapFrameType; + break; + case DcmFGTypes::EFG_PLANEPOSPATIENT: + return new FGPlanePosPatient(); + break; + case DcmFGTypes::EFG_PLANEPOSITIONVOLUME: + return new FGPlanePositionVolume(); + case DcmFGTypes::EFG_PLANEORIENTPATIENT: + return new FGPlaneOrientationPatient(); + break; + case DcmFGTypes::EFG_PLANEORIENTVOLUME: + return new FGPlaneOrientationVolume(); + case DcmFGTypes::EFG_DERIVATIONIMAGE: + return new FGDerivationImage(); + break; + case DcmFGTypes::EFG_PIXELVALUETRANSMETA: // Pixel Value Transformation Macro or Identity Pixel Value Transformation Macro: + return new FGPixelValueTransformation(); + break; + case DcmFGTypes::EFG_IMAGEDATATYPE: + return new FGImageDataType(); + break; + case DcmFGTypes::EFG_REALWORLDVALUEMAPPING: + return new FGRealWorldValueMapping(); + break; + case DcmFGTypes::EFG_SEGMENTATION: + return new FGSegmentation(); + break; + case DcmFGTypes::EFG_USIMAGEDESCRIPTION: + return new FGUSImageDescription(); + break; + case DcmFGTypes::EFG_CARDIACSYNC: + case DcmFGTypes::EFG_CONTRASTBOLUSUSAGE: + case DcmFGTypes::EFG_PIXELINTENSITYRELLUT: + case DcmFGTypes::EFG_FRAMEPIXELSHIFT: + case DcmFGTypes::EFG_PATIENTORIENTINFRAME: + case DcmFGTypes::EFG_FRAMEDISPLAYSHUTTER: + case DcmFGTypes::EFG_RESPIRATORYSYNC: + case DcmFGTypes::EFG_IRRADIATIONEVENTIDENT: + case DcmFGTypes::EFG_RADIOPHARAMAUSAGE: + case DcmFGTypes::EFG_PATIENTPHYSIOSTATE: + case DcmFGTypes::EFG_TEMPORALPOSITION: + { + DCMFG_DEBUG("Encountered functional group that is not explicitly supported yet:" << DcmFGTypes::FGType2OFString(fgtype)); + return NULL; + break; + } + default: + { + DCMFG_DEBUG("Encountered unknown functional group"); + return NULL; + break; + } + } + return NULL; +} + + +FGBase* FGFactory::create(const DcmTagKey& fgSequenceKey) +{ + if (!DcmIODUtil::isSequenceTag(fgSequenceKey)) + { + DCMFG_ERROR("Cannot create functional group from non-sequence tag"); + return NULL; + } + FGBase* fg = NULL; + DcmFGTypes::E_FGType fgType = DcmFGTypes::tagKey2FGType(fgSequenceKey); + if (fgType != DcmFGTypes::EFG_UNKNOWN) + { + fg = create(fgType); + } + /* if the sequence is know but there is no specific implementation, create generic functional group */ + if (fg == NULL) + { + DCMFG_DEBUG("Encountered unknown functional group, started by tag key: " << fgSequenceKey); + fg = new FGUnknown(fgSequenceKey); + } + return fg; +} diff --git a/dcmfg/libsrc/fgfracon.cc b/dcmfg/libsrc/fgfracon.cc new file mode 100644 index 00000000..e24a4c35 --- /dev/null +++ b/dcmfg/libsrc/fgfracon.cc @@ -0,0 +1,376 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing the Frame Content Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgfracon.h" +#include "dcmtk/dcmfg/fgtypes.h" + +// Constructor +FGFrameContent::FGFrameContent() : + FGBase(DcmFGTypes::EFG_FRAMECONTENT), + m_FrameAcquisitonNumber(DCM_FrameAcquisitionNumber), + m_FrameReferenceDateTime(DCM_FrameReferenceDateTime), + m_FrameAcquisitionDateTime(DCM_FrameAcquisitionDateTime), + m_FrameAcquisitionDuration(DCM_FrameAcquisitionDuration), + m_CardiacCyclePosition(DCM_CardiacCyclePosition), + m_RespiratoryCyclePosition(DCM_RespiratoryCyclePosition), + m_DimensionIndexValues(DCM_DimensionIndexValues), + m_TemporalPositionIndex(DCM_TemporalPositionIndex), + m_StackID(DCM_StackID), + m_InStackPositionNumber(DCM_InStackPositionNumber), + m_FrameComments(DCM_FrameComments), + m_FrameLabel(DCM_FrameLabel) +{ +} + + +FGFrameContent::~FGFrameContent() +{ + // nothing to do +} + + +FGBase* FGFrameContent::clone() const +{ + FGFrameContent* copy = new FGFrameContent(); + if (copy) + { + copy->m_FrameAcquisitonNumber = this->m_FrameAcquisitonNumber; + copy->m_FrameReferenceDateTime = this->m_FrameReferenceDateTime; + copy->m_FrameAcquisitionDateTime = this->m_FrameAcquisitionDateTime; + copy->m_FrameAcquisitionDuration = this->m_FrameAcquisitionDuration; + copy->m_CardiacCyclePosition = this->m_CardiacCyclePosition; + copy->m_RespiratoryCyclePosition = this->m_RespiratoryCyclePosition; + copy->m_DimensionIndexValues = this->m_DimensionIndexValues; + copy->m_TemporalPositionIndex = this->m_TemporalPositionIndex; + copy->m_StackID = this->m_StackID; + copy->m_InStackPositionNumber = this->m_InStackPositionNumber; + copy->m_FrameComments = this->m_FrameComments; + copy->m_FrameLabel = this->m_FrameLabel; + } + return copy; +} + + +void FGFrameContent::clearData() +{ + m_FrameAcquisitonNumber.clear(); + m_FrameReferenceDateTime.clear(); + m_FrameAcquisitionDateTime.clear(); + m_FrameAcquisitionDuration.clear(); + m_CardiacCyclePosition.clear(); + m_RespiratoryCyclePosition.clear(); + m_DimensionIndexValues.clear(); + m_TemporalPositionIndex.clear(); + m_StackID.clear(); + m_InStackPositionNumber.clear(); + m_FrameComments.clear(); + m_FrameLabel.clear(); +} + + +OFCondition FGFrameContent::check() const +{ + // Maybe add checks later + return EC_Normal; +} + + +/// Read Frame Content Sequence from given item +OFCondition FGFrameContent::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_FrameContentSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameAcquisitonNumber, "1", "3", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameReferenceDateTime, "1", "1C", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameAcquisitionDateTime, "1", "1C", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameAcquisitionDuration, "1", "1C", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_CardiacCyclePosition, "1", "3", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_RespiratoryCyclePosition, "1", "3", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_DimensionIndexValues, "1-n", "1C", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_TemporalPositionIndex, "1", "1C", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_StackID, "1", "1C", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_InStackPositionNumber, "1", "1C", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameComments, "1", "3", "FrameContentMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameLabel, "1", "3", "FrameContentMacro"); + + return EC_Normal; + +} + +/// Writes single Frame Content Sequence into given item +OFCondition FGFrameContent::write(DcmItem& item) +{ + DcmItem *seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_FrameContentSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write frame content macro attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameAcquisitonNumber, "1", "3", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameReferenceDateTime, "1", "1C", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameAcquisitionDateTime, "1", "1C", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameAcquisitionDuration, "1", "1C", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_CardiacCyclePosition, "1", "3", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_RespiratoryCyclePosition, "1", "3", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_DimensionIndexValues, "1-n", "1C", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_TemporalPositionIndex, "1", "1C", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_StackID, "1", "1C", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_InStackPositionNumber, "1", "1C", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameComments, "1", "3", "FrameContentMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameLabel, "1", "3", "FrameContentMacro"); + return result; +} + + +int FGFrameContent::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGFrameContent* myRhs = OFstatic_cast(const FGFrameContent*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_FrameAcquisitonNumber.compare(myRhs->m_FrameAcquisitonNumber); + if (result == 0) + result = m_FrameReferenceDateTime.compare(myRhs->m_FrameReferenceDateTime); + if (result == 0) + result = m_FrameAcquisitionDateTime.compare(myRhs->m_FrameAcquisitionDateTime); + if (result == 0) + result = m_FrameAcquisitionDuration.compare(myRhs->m_FrameAcquisitionDuration); + if (result == 0) + result = m_CardiacCyclePosition.compare(myRhs->m_CardiacCyclePosition); + if (result == 0) + result = m_RespiratoryCyclePosition.compare(myRhs->m_RespiratoryCyclePosition); + if (result == 0) + result = m_DimensionIndexValues.compare(myRhs->m_DimensionIndexValues); + if (result == 0) + result = m_TemporalPositionIndex.compare(myRhs->m_TemporalPositionIndex); + if (result == 0) + result = m_StackID.compare(myRhs->m_StackID); + if (result == 0) + result = m_InStackPositionNumber.compare(myRhs->m_InStackPositionNumber); + if (result == 0) + result = m_FrameComments.compare(myRhs->m_FrameComments); + if (result == 0) + result = m_FrameLabel.compare(myRhs->m_FrameLabel); + + return result; +} + + +// --- get() functionality --- + +OFCondition FGFrameContent::getFrameAcquisitionNumber(Uint16& value, + const signed long pos) +{ + return m_FrameAcquisitonNumber.getUint16(value, pos); +} + +OFCondition FGFrameContent::getFrameReferenceDateTime(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_FrameReferenceDateTime, value, pos); +} + +OFCondition FGFrameContent::getFrameAcquisitionDateTime(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_FrameAcquisitionDateTime, value, pos); +} + +OFCondition FGFrameContent::getFrameAcquisitionDuration(Float64& value, + const unsigned long pos) +{ + return m_FrameAcquisitionDuration.getFloat64(value, pos); +} + +OFCondition FGFrameContent::getCardiacCyclePosition(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_CardiacCyclePosition, value, pos); +} + +OFCondition FGFrameContent::getRespiratoryCyclePosition(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_RespiratoryCyclePosition, value, pos); +} + +OFCondition FGFrameContent::getDimensionIndexValues(Uint32& value, + const signed long pos) +{ + return m_DimensionIndexValues.getUint32(value, pos); +} + +OFCondition FGFrameContent::getTemporalPositionIndex(Uint32& value, + const signed long pos) +{ + return m_TemporalPositionIndex.getUint32(value, pos); +} + +OFCondition FGFrameContent::getStackID(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_StackID, value, pos); +} + +OFCondition FGFrameContent::getInStackPositionNumber(Uint32& value, + const long signed int pos) +{ + return m_InStackPositionNumber.getUint32(value, pos); +} + + +OFCondition FGFrameContent::getFrameComments(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_FrameComments, value, pos); +} + +OFCondition FGFrameContent::getFrameLabel(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_FrameLabel, value, pos); +} + +// --- set() functionality --- + +OFCondition FGFrameContent::setFrameAcquisitionNumber(const Uint16& value, + const OFBool checkValue) +{ + (void)checkValue; + m_FrameAcquisitonNumber.putUint16(value); + return EC_Normal; +} + +OFCondition FGFrameContent::setFrameReferenceDateTime(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_FrameReferenceDateTime.putOFStringArray(value); + return result; +} + +OFCondition FGFrameContent::setFrameAcquisitionDateTime(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_FrameAcquisitionDateTime.putOFStringArray(value); + return result; +} + +OFCondition FGFrameContent::setFrameAcquisitionDuration(const Float64& value, + const OFBool checkValue) +{ + (void)checkValue; + // basic checking always included + return m_FrameAcquisitionDuration.putFloat64(value); +} + +OFCondition FGFrameContent::setCardiacCyclePosition(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_CardiacCyclePosition.putOFStringArray(value); + return result; +} + +OFCondition FGFrameContent::setRespiratoryCyclePosition(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_RespiratoryCyclePosition.putOFStringArray(value); + return result; +} + +OFCondition FGFrameContent::setDimensionIndexValues(const Uint32& value, + const unsigned int dim, + const OFBool checkValue) +{ + // no other meaningful checks possible in this context + (void)checkValue; + if (value == 0) + { + DCMFG_ERROR("Cannot set dimension index value 0, must be >= 1)"); + return EC_InvalidValue; + } + return m_DimensionIndexValues.putUint32(value, dim); +} + +OFCondition FGFrameContent::setTemporalPositionIndex(const Uint32& value, + const OFBool checkValue) +{ + // no meaningful check possible in this context + (void)checkValue; + return m_TemporalPositionIndex.putUint32(value); +} + +OFCondition FGFrameContent::setStackID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_StackID.putOFStringArray(value); + return result; +} + + +OFCondition FGFrameContent::setInStackPositionNumber(const Uint32& value, + const OFBool checkValue) +{ + // no meaningful check possible in this context + (void)checkValue; + return m_InStackPositionNumber.putUint32(value); +} + + +OFCondition FGFrameContent::setFrameComments(const OFString& value, + const OFBool checkValue) +{ + (void)checkValue; + return m_FrameComments.putOFStringArray(value); +} + + +OFCondition FGFrameContent::setFrameLabel(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_FrameLabel.putOFStringArray(value); + return result; +} + diff --git a/dcmfg/libsrc/fgframeanatomy.cc b/dcmfg/libsrc/fgframeanatomy.cc new file mode 100644 index 00000000..22a9ea41 --- /dev/null +++ b/dcmfg/libsrc/fgframeanatomy.cc @@ -0,0 +1,205 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Frame Anatomy Functional Group + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgframeanatomy.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + + +FGFrameAnatomy::FGFrameAnatomy() +: FGBase(DcmFGTypes::EFG_FRAMEANATOMY), + m_FrameLaterality(LATERALITY_UNDEFINED), + m_Anatomy("1" /* Use Mandatory version of macro, i.e. make "Anatomic Region Sequence type 1" */) +{ +} + + +FGFrameAnatomy::~FGFrameAnatomy() +{ + // nothing to do +} + + +FGBase* FGFrameAnatomy::clone() const +{ + FGFrameAnatomy* copy = new FGFrameAnatomy(); + if (copy) + { + copy->m_FrameLaterality= this->m_FrameLaterality; + copy->m_Anatomy = this->m_Anatomy; + } + return copy; +} + + +void FGFrameAnatomy::clearData() +{ + m_FrameLaterality = LATERALITY_UNDEFINED; + m_Anatomy.clearData(); +} + + +OFCondition FGFrameAnatomy::check() const +{ + if (!isLateralityValid(m_FrameLaterality)) + { + DCMFG_ERROR("Frame Laterality invalid"); + return FG_EC_InvalidData; + } + return OFconst_cast(GeneralAnatomyMacro*, &m_Anatomy)->check(); +} + + +int FGFrameAnatomy::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGFrameAnatomy* myRhs = OFstatic_cast(const FGFrameAnatomy*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + if (m_FrameLaterality != myRhs->m_FrameLaterality) + return 1; + + return m_Anatomy.compare(myRhs->m_Anatomy); +} + + +/// Read from Frame Content Sequence +OFCondition FGFrameAnatomy::read(DcmItem& item) +{ + clearData(); + + OFCondition result; + DcmItem* seqItem = NULL; + result = getItemFromFGSequence(item, DCM_FrameAnatomySequence, 0, seqItem); + if (result.bad()) + return result; + + DcmCodeString elem(DCM_FrameLaterality); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, elem, "1", "1", "FrameAnatomyMacro"); + OFString val; + elem.getOFStringArray(val); + m_FrameLaterality = str2Laterality(val); + + m_Anatomy.read(*seqItem); + + return EC_Normal; +} + + +OFCondition FGFrameAnatomy::write(DcmItem& item) +{ + OFCondition result = check(); + if (result.good()) + { + DcmItem* seqItem = NULL; + result = createNewFGSequence(item, DCM_FrameAnatomySequence, 0, seqItem); + if (result.good()) + { + OFString lat = laterality2Str(m_FrameLaterality); + result = seqItem->putAndInsertOFStringArray(DCM_FrameLaterality, lat); + if (result.good()) + { + result = m_Anatomy.write(*seqItem); + } + } + } + + return result; +} + + +OFCondition FGFrameAnatomy::getLaterality(FGFrameAnatomy::LATERALITY& value) +{ + value = m_FrameLaterality; + return EC_Normal; +} + + +GeneralAnatomyMacro& FGFrameAnatomy::getAnatomy() +{ + return m_Anatomy; +} + + +OFCondition FGFrameAnatomy::setLaterality(const FGFrameAnatomy::LATERALITY& value) +{ + if (isLateralityValid(value)) + { + m_FrameLaterality = value; + return EC_Normal; + } + else + { + return FG_EC_InvalidData; + } +} + + +OFString FGFrameAnatomy::laterality2Str(const FGFrameAnatomy::LATERALITY lat) +{ + switch(lat) + { + case LATERALITY_INVALID: return "Invalid"; + case LATERALITY_L: return "L"; + case LATERALITY_R: return "R"; + case LATERALITY_BOTH: return "B"; + case LATERALITY_UNDEFINED: return "Undefined"; + case LATERALITY_UNPAIRED: return "U"; + default: return "Invalid"; + } +} + + +FGFrameAnatomy::LATERALITY FGFrameAnatomy::str2Laterality(const OFString& lat) +{ + if (lat == "L") + return LATERALITY_L; + if (lat == "R") + return LATERALITY_R; + if (lat == "U") + return LATERALITY_UNPAIRED; + if (lat == "B") + return LATERALITY_BOTH; + + if (lat.empty()) + return LATERALITY_UNDEFINED; + + return LATERALITY_INVALID; + +} + + +OFBool FGFrameAnatomy::isLateralityValid(const FGFrameAnatomy::LATERALITY lat) +{ + if ( (lat == LATERALITY_L) || (lat == LATERALITY_R) || (lat == LATERALITY_BOTH) || + (lat == LATERALITY_UNPAIRED) ) + return OFTrue; + else + return OFFalse; +} + diff --git a/dcmfg/libsrc/fgframevoilut.cc b/dcmfg/libsrc/fgframevoilut.cc new file mode 100644 index 00000000..9a85ba54 --- /dev/null +++ b/dcmfg/libsrc/fgframevoilut.cc @@ -0,0 +1,225 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Frame VOI LUT Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgframevoilut.h" +#include "dcmtk/dcmfg/fgtypes.h" + +// Constructor +FGFrameVOILUT::FGFrameVOILUT() : + FGBase(DcmFGTypes::EFG_FRAMEVOILUTMETA), + m_WindowCenter(DCM_WindowCenter), + m_WindowWidth(DCM_WindowWidth), + m_WindowCenterWindowWidthExplanation(DCM_WindowCenterWidthExplanation), + m_VOILUTFunction(DCM_VOILUTFunction) +{ +} + + +FGFrameVOILUT::~FGFrameVOILUT() +{ + // nothing to do +} + + +FGBase* FGFrameVOILUT::clone() const +{ + FGFrameVOILUT* copy = new FGFrameVOILUT(); + if (copy) + { + copy->m_WindowCenter = this->m_WindowCenter; + copy->m_WindowWidth= this->m_WindowWidth; + copy->m_WindowCenterWindowWidthExplanation = this->m_WindowCenterWindowWidthExplanation; + copy->m_VOILUTFunction= this->m_VOILUTFunction; + } + return copy; +} + + +void FGFrameVOILUT::clearData() +{ + m_WindowCenter.clear(); + m_WindowWidth.clear(); + m_WindowCenterWindowWidthExplanation.clear(); + m_VOILUTFunction.clear(); +} + + +OFCondition FGFrameVOILUT::check() const +{ + // For now attribute-based checks in read() and write() are sufficient + return EC_Normal; +} + + +// --- get() functionality --- + + +OFCondition FGFrameVOILUT::getWindowCenter(Float64& value, + const unsigned long pos) +{ + return m_WindowCenter.getFloat64(value, pos); +} + + +OFCondition FGFrameVOILUT::getWindowWidth(Float64& value, + const unsigned long pos) +{ + return m_WindowWidth.getFloat64(value, pos); +} + + +OFCondition FGFrameVOILUT::getWindowCenterAndWindowWidthExplanation(OFString& value, + const unsigned long pos) +{ + return m_WindowCenterWindowWidthExplanation.getOFString(value, pos); +} + + +OFCondition FGFrameVOILUT::getCenterWidthExplanation(Float64& windowCenter, + Float64& windowWidth, + OFString& explanation) +{ + OFCondition result = m_WindowCenter.getFloat64(windowCenter); + if (result.good()) result = m_WindowWidth.getFloat64(windowWidth); + if (result.good()) result = m_WindowCenterWindowWidthExplanation.getOFString(explanation, 0); + return result; +} + + +OFCondition FGFrameVOILUT::getVOILUTFunction(OFString& value, + const unsigned long pos) +{ + return m_VOILUTFunction.getOFString(value, pos); +} + + +// --- set() functionality --- + + +OFCondition FGFrameVOILUT::setWindowCenter(const OFString& value, + const OFBool checkValue) +{ + // no checks at the moment + (void)checkValue; + return m_WindowCenter.putOFStringArray(value); +} + +OFCondition FGFrameVOILUT::setWindowWidth(const OFString& value, + const OFBool checkValue) +{ + // no checks at the moment + (void)checkValue; + return m_WindowWidth.putOFStringArray(value); +} + + +OFCondition FGFrameVOILUT::setCenterWidthExplanation(const Float64& windowCenter, + const Float64& windowWidth, + const OFString& explanation, + const OFBool checkValue) +{ + OFCondition result = m_WindowCenter.putFloat64(windowCenter); + if (result.good()) result = m_WindowWidth.putFloat64(windowWidth); + if (result.good() && !explanation.empty()) + { + if (checkValue) + { + result = (checkValue) ? DcmLongString::checkStringValue(explanation, "1") : EC_Normal; + } + if (result.good()) + { + result = m_WindowCenterWindowWidthExplanation.putString(explanation.c_str()); + } + } + return result; +} + + +OFCondition FGFrameVOILUT::setVOILUTFunction(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_VOILUTFunction.putString(value.c_str()); + return result; +} + + +/// Read Frame Content Sequence from given item +OFCondition FGFrameVOILUT::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_FrameVOILUTSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_WindowCenter, "1-n", "1", "FrameVOILUTMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_WindowWidth, "1-n", "1", "FrameVOILUTMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_WindowCenterWindowWidthExplanation, "1-n", "3", "FrameVOILUTMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_VOILUTFunction, "1", "3", "FrameVOILUTMacro"); + + return EC_Normal; + +} + +/// Writes single Frame Content Sequence into given item +OFCondition FGFrameVOILUT::write(DcmItem& item) +{ + DcmItem *seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_FrameVOILUTSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write frame content macro attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_WindowCenter, "1-n", "1", "FrameVOILUTMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_WindowWidth, "1-n", "1", "FrameVOILUTMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_WindowCenterWindowWidthExplanation, "1-n", "3", "FrameVOILUTMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_VOILUTFunction, "1", "3", "FrameVOILUTMacro"); + return result; +} + + +int FGFrameVOILUT::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGFrameVOILUT* myRhs = OFstatic_cast(const FGFrameVOILUT*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_WindowCenter.compare(myRhs->m_WindowCenter); + if (result == 0) + result = m_WindowWidth.compare(myRhs->m_WindowWidth); + if (result == 0) + result = m_WindowCenterWindowWidthExplanation.compare(myRhs->m_WindowCenterWindowWidthExplanation); + if (result == 0) + result = m_VOILUTFunction.compare(myRhs->m_VOILUTFunction); + + return result; +} diff --git a/dcmfg/libsrc/fgimagedatatype.cc b/dcmfg/libsrc/fgimagedatatype.cc new file mode 100644 index 00000000..782ee443 --- /dev/null +++ b/dcmfg/libsrc/fgimagedatatype.cc @@ -0,0 +1,269 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Image Data Type Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgimagedatatype.h" +#include "dcmtk/dcmfg/fgtypes.h" + +// Constructor +FGImageDataType::FGImageDataType() : + FGBase(DcmFGTypes::EFG_IMAGEDATATYPE), + m_DataType(DCM_DataType), + m_AliasedDataType(DCM_AliasedDataType), + m_ZeroVelocityPixelValueUS(DCM_ZeroVelocityPixelValue), + m_ZeroVelocityPixelValueSS(DCM_ZeroVelocityPixelValue) +{ +} + + +FGImageDataType::~FGImageDataType() +{ + // nothing to do +} + + +FGBase* FGImageDataType::clone() const +{ + FGImageDataType* copy = new FGImageDataType(); + if (copy) + { + copy->m_DataType = this->m_DataType; + copy->m_AliasedDataType= this->m_AliasedDataType; + if (! OFconst_cast(DcmSignedShort*, &this->m_ZeroVelocityPixelValueSS)->isEmpty()) + { + copy->m_ZeroVelocityPixelValueSS = this->m_ZeroVelocityPixelValueSS; + } + else if (! OFconst_cast(DcmUnsignedShort*, &this->m_ZeroVelocityPixelValueUS)->isEmpty()) + { + copy->m_ZeroVelocityPixelValueUS = this->m_ZeroVelocityPixelValueUS; + } + // both emtpy? nothing to do then + } + return copy; +} + + +void FGImageDataType::clearData() +{ + m_DataType.clear(); + m_AliasedDataType.clear(); + m_ZeroVelocityPixelValueSS.clear(); + m_ZeroVelocityPixelValueUS.clear(); +} + + +OFCondition FGImageDataType::check() const +{ + // For now, checks in read() and write() are sufficient + return EC_Normal; +} + + +// --- get() functionality --- + +OFCondition FGImageDataType::getDataType(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromElement(m_DataType, value, pos); +} + + +OFCondition FGImageDataType::getAliasedDataType(OFString& value, const long signed int pos) +{ + return DcmIODUtil::getStringValueFromElement(m_AliasedDataType, value, pos); +} + + +OFCondition FGImageDataType::getZeroVelocityPixelValue(Sint32& value, + const long signed int pos) +{ + OFCondition result; + if (!m_ZeroVelocityPixelValueSS.isEmpty()) + { + Sint16 val = 0; + if ( (result = m_ZeroVelocityPixelValueSS.getSint16(val, pos)).good()) + { + value = val; + } + } + else if (!m_ZeroVelocityPixelValueUS.isEmpty()) + { + Uint16 val = 0; + if ( (result = m_ZeroVelocityPixelValueUS.getUint16(val, pos)).good()) + { + value = val; + } + } + else + return EC_TagNotFound; + + return EC_Normal; +} + + +// --- set() functionality --- + + +OFCondition FGImageDataType::setDataType(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_DataType.putOFStringArray(value); + return result; +} + + +OFCondition FGImageDataType::setAliasedDataType(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_AliasedDataType.putOFStringArray(value); + return result; +} + + +OFCondition FGImageDataType::setZeroVelocityPixelValueSS(const Sint16 value) +{ + return m_ZeroVelocityPixelValueSS.putSint16(value); +} + + +OFCondition FGImageDataType::setZeroVelocityPixelValueUS(const Uint16 value) +{ + return m_ZeroVelocityPixelValueUS.putUint16(value); +} + + +// Read Frame Content Sequence from given item +OFCondition FGImageDataType::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_ImageDataTypeSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmElement* elem = NULL; + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_DataType, "1", "1", "ImageDataTypeMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_AliasedDataType, "1", "1", "ImageDataTypeMacro"); + // We do not know the VR of Zero Velocity Pixel Value (US or SS), so we cannot + // use the regular getAndCheckElementFromDataset() method that implicitly gets + // this information via the provided element. Instead, get element first and + // and then check it in an extra step, afterwards access value depending on + // the element's VR. + seqItem->findAndGetElement(DCM_ZeroVelocityPixelValue, elem); + DcmIODUtil::checkElementValue(elem, DCM_ZeroVelocityPixelValue, "1", "1C", EC_Normal, "ImageDataTypeMacro"); + if (elem) + { + if (elem->getVR() == EVR_SS) + { + m_ZeroVelocityPixelValueSS.copyFrom(*elem); + } + else if (elem->getVR() == EVR_US) + { + m_ZeroVelocityPixelValueUS.copyFrom(*elem); + } + else + { + Uint16 pixrep = 0; + if (item.findAndGetUint16(DCM_PixelRepresentation, pixrep).good()) + { + if (pixrep == 0) + { + m_ZeroVelocityPixelValueUS.putUint16(pixrep, 0); + } + else + { + m_ZeroVelocityPixelValueSS.putSint16(pixrep, 1); + } + } + else + { + DCMFG_ERROR("Cannot read Zero Velocity Pixel Value"); + } + } + } + return EC_Normal; +} + + +// Writes single Frame Content Sequence into given item +OFCondition FGImageDataType::write(DcmItem& item) +{ + DcmItem *seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_ImageDataTypeSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write frame content macro attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_DataType, "1", "1", "ImageDataTypeMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_AliasedDataType, "1", "1", "ImageDataTypeMacro"); + if (!m_ZeroVelocityPixelValueSS.isEmpty()) + { + DcmIODUtil::copyElementToDataset(result, *seqItem, m_ZeroVelocityPixelValueSS, "1", "1C", "ImageDataTypeMacro"); + } else if (!m_ZeroVelocityPixelValueUS.isEmpty()) + { + DcmIODUtil::copyElementToDataset(result, *seqItem, m_ZeroVelocityPixelValueUS, "1", "1C", "ImageDataTypeMacro"); + } + // Zero Velocity Pixel Value is required in case Data Type is TISSUE_VELOCITY, + // FLOW_VELOCITY or DIRECTION_POWER. + else + { + OFString val; + m_DataType.getOFStringArray(val); + if ( (val == "TISSUE_VELOCITY") || (val == "FLOW_VELOCITY") || (val == "DIRECTION_POWER") ) + { + DCMFG_ERROR("Missing value for Zero Velocity Pixel Value (required if Data Type has" << + "the value TISSUE_VELOCITY, FLOW_VELOCITY or DIRECTION_POWER"); + return FG_EC_InvalidData; + } + } + + return result; +} + + +int FGImageDataType::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGImageDataType* myRhs = OFstatic_cast(const FGImageDataType*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_DataType.compare(myRhs->m_DataType); + if (result == 0) + result = m_AliasedDataType.compare(myRhs->m_AliasedDataType); + if (result == 0) + result = m_ZeroVelocityPixelValueSS.compare(myRhs->m_ZeroVelocityPixelValueSS); + if (result == 0) + result = m_ZeroVelocityPixelValueUS.compare(myRhs->m_ZeroVelocityPixelValueUS); + + return result; +} diff --git a/dcmfg/libsrc/fginterface.cc b/dcmfg/libsrc/fginterface.cc new file mode 100644 index 00000000..03b17c78 --- /dev/null +++ b/dcmfg/libsrc/fginterface.cc @@ -0,0 +1,718 @@ +/* + * + * Copyright (C) 2015-2019, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Main interface class for managing Functional Groups + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/dcmiod/iodutil.h" // for static helpers +#include "dcmtk/dcmfg/fginterface.h" +#include "dcmtk/dcmfg/fg.h" +#include "dcmtk/dcmfg/fgfact.h" // for creating new functional groups + + +FGInterface::FGInterface() : +m_shared(), +m_perFrame(), +m_checkOnWrite(OFTrue) +{ +} + + +FGInterface::~FGInterface() +{ + clear(); +} + + +void FGInterface::clear() +{ + // Clear per frame functional groups + while (m_perFrame.size() > 0) + { + OFMap::iterator it = m_perFrame.begin(); + FunctionalGroups* fg = (*it).second; + m_perFrame.erase(it); + delete fg; + } + + // Clear shared functional groups + m_shared.clear(); +} + + +size_t FGInterface::getNumberOfFrames() +{ + return m_perFrame.size(); +} + + +OFCondition FGInterface::addShared(const FGBase& group) +{ + DcmFGTypes::E_FGSharedType sharedType = group.getSharedType(); + if ( sharedType == DcmFGTypes::EFGS_ONLYPERFRAME ) + { + DCMFG_ERROR("Cannot add group as shared, per DICOM, group type " << DcmFGTypes::FGType2OFString(group.getType()) << " is always per-frame"); + return FG_EC_CouldNotAddFG; + } + + // Delete all per frame groups of this type + for (size_t count = 0; count < m_perFrame.size(); count++) + { + deletePerFrame(OFstatic_cast(Uint32, count), group.getType()); + } + + // Create copy for insertion + FGBase* copy = group.clone(); + if (!copy) + { + return EC_MemoryExhausted; + } + + // Insert shared one, replace old one if existing + OFCondition result = insertShared(copy, OFTrue /* replace */); + if (result.bad()) + { + DCMFG_ERROR("Could not add shared group of type: " << DcmFGTypes::FGType2OFString(group.getType())); + delete copy; + } + + return result; +} + + +OFCondition FGInterface::addPerFrame(const Uint32 frameNo, + const FGBase& group) +{ + OFCondition result = EC_Normal; + DcmFGTypes::E_FGSharedType sharedType = group.getSharedType(); + if ( sharedType == DcmFGTypes::EFGS_ONLYSHARED) + { + DCMFG_ERROR("Cannot add group as per-frame, group type " << DcmFGTypes::FGType2OFString(group.getType()) << " is always shared"); + return FG_EC_CouldNotAddFG; + } + + // Check whether there is already a shared group of this type. + // If the content is equal to the given group, we re-use the shared one + FGBase* shared = getShared(group.getType()); + // If there is a shared group + if ( shared ) + { + // If shared has identical values as given group, nothing has to be done. + // Else if shared group with such type exists, but content differs, + // we must the make the existing shared FG "per-frame", i.e. distribute + // it to all frames, and add the given group for the given frame. + if ( (*shared).compare(group) != 0 ) + { + // We need to unshare this group, i.e. distribute it to frames + DCMFG_DEBUG("Converting shared group of type " << DcmFGTypes::FGType2OFString(group.getType()) << " to per-frame, triggered by deviating per-frame insertion"); + result = convertSharedToPerFrame(group.getType()); + } + else + { + DCMFG_DEBUG("Re-using shared group instead of adding per-frame for frame " << frameNo << ", type " << DcmFGTypes::FGType2OFString(group.getType())); + return EC_Normal; + } + } + + if (result.good()) + { + FGBase* copy = group.clone(); + if (!copy) + { + return EC_MemoryExhausted; + } + result = insertPerFrame(frameNo, copy); + if (result.bad()) + delete copy; + } + + return result; +} + + +// Get specific functional group for a frame, +// no matter whether it is stored per frame or shared +FGBase* FGInterface::get(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType) +{ + OFBool helpShared; // throw-away variable + return get(frameNo, fgType, helpShared); +} + + +const FunctionalGroups* FGInterface::getPerFrame(const Uint32 frameNo) const +{ + if (frameNo > m_perFrame.size()) + { + return NULL; + } + else + { + return (*(m_perFrame.find(frameNo))).second; + } +} + + +const FunctionalGroups* FGInterface::getShared() const +{ + return &m_shared; +} + + +// Read enhanced multi-frame information from DICOM item, usually DcmDataset +OFCondition FGInterface::read(DcmItem& dataset) +{ + OFCondition result = EC_Normal; + + // clear any old values + clear(); + + /* read shared functional groups */ + if (result.good()) + { + result = readSharedFG(dataset); + } + + /* read per frame functional groups */ + if (result.good()) + { + result = readPerFrameFG(dataset); + } + + return result; + +} + + +OFCondition FGInterface::readSharedFG(DcmItem& dataset) +{ + /* read shared functional groups */ + DcmSequenceOfItems *shared = NULL; + OFCondition result = dataset.findAndGetSequence(DCM_SharedFunctionalGroupsSequence, shared); + if (result.bad()) + { + DCMFG_ERROR("Could not find Shared Functional Group Sequence"); + return FG_EC_NoSharedFG; + } + + if (shared->card() > 1) + { + DCMFG_WARN("More than one item in Shared Functional Group Sequence, only considering the first one"); + } + else if (shared->card() == 0) + { + DCMFG_WARN("No Item in Shared Functional Group Sequence but exactly one expected"); + return FG_EC_NoSharedFG; + } + + // get the only item of shared functional group sequence + DcmItem* sharedFGs = shared->getItem(0); + // read all functional groups from shared fg sequence item + result = readSingleFG(*sharedFGs, m_shared); + + return result; +} + + + +OFCondition FGInterface::readPerFrameFG(DcmItem& dataset) +{ + /* read per-frame functional groups */ + DcmSequenceOfItems *perFrame = NULL; + OFCondition result = dataset.findAndGetSequence(DCM_PerFrameFunctionalGroupsSequence, perFrame); + if (result.bad()) + { + DCMFG_ERROR("Could not find Per-Frame Functional Group Sequence"); + return FG_EC_NoPerFrameFG; + } + + /* 1-n items required */ + size_t numFrames = perFrame->card(); + if (numFrames == 0) + { + DCMFG_WARN("No Item in Shared Functional Group Sequence but exactly one or more expected"); + return FG_EC_NoPerFrameFG; + } + + /* Read functional groups for each item (one per frame) */ + DcmItem *oneFrameItem = OFstatic_cast(DcmItem*, perFrame->nextInContainer(NULL)); + Uint32 count = 0; + while (oneFrameItem != NULL) + { + OFunique_ptr perFrameGroups(new FunctionalGroups()); + if (!oneFrameItem) + { + DCMFG_ERROR("Could not get functional group item for frame #" << count << " (internal error)"); + } + else if (!perFrameGroups.get()) + { + DCMFG_ERROR("Could not create functional groups for frame #" << count << ": Memory exhausted?"); + } + else + { + result = readSingleFG(*oneFrameItem, *perFrameGroups); + if (result.good()) + { + if ( !m_perFrame.insert( OFMake_pair(count, perFrameGroups.release()) ).second ) + { + DCMFG_ERROR("Could not store functional groups for frame #" << count << " (internal error)"); + } + } + else + { + DCMFG_ERROR("Could not read functional groups for frame #" << count << ": " << result.text()); + } + } + oneFrameItem = OFstatic_cast(DcmItem*, perFrame->nextInContainer(oneFrameItem)); + count++; + } + return EC_Normal; // for now we always return EC_Normal... +} + + + +OFCondition FGInterface::readSingleFG(DcmItem& fgItem, + FunctionalGroups& groups) +{ + OFCondition result; + size_t card = fgItem.card(); + OFString fgname; + for (size_t count = 0; count < card; count++) + { + DcmElement *elem = fgItem.getElement(OFstatic_cast(unsigned long, count)); + // TODO: non-sequence elements are not explicitly forbidden here(?), we could store them and re-store them later + if (elem->getVR() != EVR_SQ) + { + DCMFG_WARN("Found non-sequence element in functional group sequence item (ignored): " << elem->getTag()); + } + else + { + FGBase *fg = FGFactory::instance().create(elem->getTag()); + if (fg != NULL) + { + OFStringStream stream; + stream << DcmFGTypes::tagKey2FGString(elem->getTag()) << " " << elem->getTag(); + OFSTRINGSTREAM_GETSTR(stream,tmpstr) + fgname = tmpstr; + OFSTRINGSTREAM_FREESTR(tmpstr) + result = fg->read(fgItem); + if (result.bad()) + { + DCMFG_WARN("Cannot read functional group: " << fgname << " (ignored)"); + } + // we also accept groups while reading which could instantiated but not could not be read + result = groups.insert(fg, OFTrue); + if (result.good()) + { + DCMFG_DEBUG("Inserted functional group: " << fgname ); + } + else + { + DCMFG_ERROR("Could not insert functional group: " << fgname << " (internal error)"); + delete fg; + } + } + else + { + DCMFG_WARN("Cannot understand functional group for sequence tag: " << elem->getTag()); + } + } + } + return EC_Normal; // for now we always return EC_Normal... +} + + +// Write enhanced multi-frame information to DICOM item, usually DcmDataset +OFCondition FGInterface::write(DcmItem& dataset) +{ + //Check data integrity of functional group macros */ + if (m_checkOnWrite) + { + if ( !check() ) + return FG_EC_CouldNotWriteFG; + } + + // Write shared functional Groups + OFCondition result = writeSharedFG(dataset); + + // Write per frame functional groups + if ( result.good() ) result = writePerFrameFG(dataset); + + return result; +} + + +FGBase* FGInterface::getShared(const DcmFGTypes::E_FGType fgType) +{ + return m_shared.find(fgType); +} + + +OFCondition FGInterface::insertShared(FGBase* group, + const OFBool replaceExisting) +{ + return m_shared.insert(group, replaceExisting); +} + + +FGBase* FGInterface::getPerFrame(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType) +{ + FGBase* group = NULL; + OFMap::iterator it = m_perFrame.find(frameNo); + if ( it != m_perFrame.end() ) + { + FunctionalGroups* perFrameGroups = (*it).second; + group = perFrameGroups->find(fgType); + } + + return group; +} + + +OFBool FGInterface::deleteShared(const DcmFGTypes::E_FGType fgType) +{ + FGBase* group = m_shared.find(fgType); + if (group) + { + delete m_shared.remove(fgType); + return OFTrue; + } + return OFFalse; +} + + + +OFBool FGInterface::deletePerFrame(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType) +{ + OFMap::iterator it = m_perFrame.find(frameNo); + if (it != m_perFrame.end()) + { + if ( (*it).second ) + { + FGBase *remove = (*it).second->remove(fgType); + if (remove) + { + DCMFG_DEBUG("Deleting FG for frame " << frameNo << ", type: " << DcmFGTypes::FGType2OFString(fgType)); + delete remove; + remove = NULL; + return OFTrue; + } + } + } + return OFFalse; +} + + +size_t FGInterface::deletePerFrame(const DcmFGTypes::E_FGType fgType) +{ + size_t numDeleted = 0; + const size_t numFrames = m_perFrame.size(); + for (size_t frameNo = 0; frameNo < numFrames; frameNo++) + { + if (deletePerFrame(OFstatic_cast(Uint32, frameNo), fgType)) + { + numDeleted++; + } + } + return numDeleted; +} + + +size_t FGInterface::deleteFrame(const Uint32 frameNo) +{ + OFMap::iterator it = m_perFrame.find(frameNo); + if (it != m_perFrame.end()) + { + if ( (*it).second ) + { + FunctionalGroups::iterator fg = (*it).second->begin(); + while (fg != (*it).second->end()) + { + delete (*fg).second; + fg++; + } + } + m_perFrame.erase(it); + } + return OFFalse; +} + + +void FGInterface::setCheckOnWrite(const OFBool doCheck) +{ + m_checkOnWrite = doCheck; +} + + +OFBool FGInterface::getCheckOnWrite() +{ + return m_checkOnWrite; +} + + +FunctionalGroups* FGInterface::getOrCreatePerFrameGroups(const Uint32 frameNo) +{ + OFMap::iterator it = m_perFrame.find(frameNo); + if (it != m_perFrame.end()) + return (*it).second; + + FunctionalGroups *fg = new FunctionalGroups(); + if (fg != NULL) + { + if ( !(m_perFrame.insert(OFMake_pair(frameNo, fg))).second ) + { + DCMFG_ERROR("Could not insert Per-frame Functional Groups for frame " << frameNo << ": " << "Internal error"); + delete fg; + fg = NULL; + } + } + else + { + DCMFG_ERROR("Could not create Per-frame Functional Groups for frame " << frameNo << ": " << "Memory exhausted"); + } + + return fg; +} + + +OFCondition FGInterface::writePerFrameFG(DcmItem& dataset) +{ + DCMFG_DEBUG("Writing per-frame functional groups"); + OFCondition result = dataset.insertEmptyElement(DCM_PerFrameFunctionalGroupsSequence, OFTrue); // start with empty sequence + if (result.bad()) + { + DCMFG_ERROR("Could not create Per-frame Functional Groups Sequence"); + return result; + } + + /* Iterate over frames */ + OFMap::iterator it = m_perFrame.begin(); + size_t numFrames = m_perFrame.size(); + for ( size_t count = 0; (count < numFrames) && result.good(); count++) + { + DcmItem* perFrameItem = NULL; + result = dataset.findOrCreateSequenceItem(DCM_PerFrameFunctionalGroupsSequence, perFrameItem, OFstatic_cast(long, count)); + if (result.good()) + { + /* Iterate over groups for each frame */ + FunctionalGroups::iterator groupIt = (*it).second->begin(); + while ( result.good() && (groupIt != (*it).second->end()) ) + { + DCMFG_DEBUG("Writing per-frame group: " << DcmFGTypes::FGType2OFString((*groupIt).second->getType()) << " for frame #" << count); + result = (*groupIt).second->write(*perFrameItem); + groupIt++; + } + } + else + { + DCMFG_ERROR("Cannot create item in Per-frame Functional Groups Sequence"); + } + it++; + } + return result; +} + + +OFCondition FGInterface::writeSharedFG(DcmItem& dataset) +{ + DCMFG_DEBUG("Writing shared functional groups"); + OFCondition result = dataset.insertEmptyElement(DCM_SharedFunctionalGroupsSequence, OFTrue); // start with empty sequence + DcmItem *sharedFGItem = NULL; + if (result.good()) + { + result = dataset.findOrCreateSequenceItem(DCM_SharedFunctionalGroupsSequence, sharedFGItem, 0); + } + if (result.bad()) + { + DCMFG_ERROR("Could not create Shared Functional Groups Sequence with single item"); + return result; + } + + FunctionalGroups::iterator it = m_shared.begin(); + FunctionalGroups::iterator end = m_shared.end(); + while ( (it != end) && result.good() ) + { + DCMFG_DEBUG("Writing shared group: " << DcmFGTypes::FGType2OFString((*it).second->getType())); + result = (*it).second->write(*sharedFGItem); + it++; + } + return result; +} + + +OFCondition FGInterface::insertPerFrame(const Uint32 frameNo, + FGBase* group, + const OFBool replaceExisting) +{ + if (group == NULL) + return EC_IllegalParameter; + + OFCondition result = EC_Normal; + FGBase* existing = getPerFrame(frameNo, group->getType()); + if (existing) + { + if (replaceExisting) + { + DCMFG_DEBUG("Replacing per-frame FG for frame: " << frameNo << ", type: " << DcmFGTypes::FGType2OFString(group->getType())); + deletePerFrame(frameNo, group->getType()); + } + else + { + result = FG_EC_DoubledFG; + } + } + + // Insert per-frame functional group + if (result.good()) + { + FunctionalGroups* perFrameGroups = getOrCreatePerFrameGroups(frameNo); + if (perFrameGroups != NULL) + { + result = perFrameGroups->insert(group, replaceExisting); + } + else + { + result = FG_EC_CouldNotInsertFG; + } + } + return result; +} + + +OFCondition FGInterface::convertSharedToPerFrame(const DcmFGTypes::E_FGType fgType) +{ + FGBase* shared = m_shared.remove(fgType); + if (!shared) + { + return FG_EC_NoSuchGroup; + } + + OFCondition result; + size_t numFrames = m_perFrame.size(); + // Walk over all existing frames and copy "old" shared group to them + size_t count = 0; + for (count = 0; result.good() && (count < numFrames); count++) + { + FGBase* clone = shared->clone(); + if (!clone) + { + result = EC_MemoryExhausted; + } + else + { + result = insertPerFrame(OFstatic_cast(Uint32, count), clone, OFTrue /* replace existing */); + if (result.bad()) + { + delete clone; + } + } + } + return result ; +} + + +FGBase* FGInterface::get(const Uint32 frameNo, + const DcmFGTypes::E_FGType fgType, + OFBool& isPerFrame) +{ + FGBase *group = m_shared.find(fgType); + if ( !group ) + { + group = getPerFrame(frameNo, fgType); + isPerFrame = OFTrue; + } + else + { + isPerFrame = OFFalse; + } + + return group; +} + + +OFBool FGInterface::check() +{ + size_t numFrames = m_perFrame.size(); + DCMFG_DEBUG("Checking functional group structure for " << numFrames << " frames"); + size_t numErrors = 0; + for (size_t frameCount = 0; frameCount < numFrames; frameCount++) + { + DCMFG_TRACE("Checking frame " << frameCount << "..."); + // Every frame requires the FrameContent functional group, check "en passant" + OFBool foundFrameContent = OFFalse; + OFMap::iterator frameFG = m_perFrame.begin(); + OFMap::iterator end = m_perFrame.end(); + while (frameFG != end) + { + FunctionalGroups::iterator group = (*frameFG).second->begin(); + FunctionalGroups::iterator groupEnd = (*frameFG).second->end(); + while (group != groupEnd) + { + // Check that per-frame group is not a shared group at the same time + DcmFGTypes::E_FGType groupType = group->second->getType(); + if ( (groupType != DcmFGTypes::EFG_UNDEFINED) && + (groupType != DcmFGTypes::EFG_UNKNOWN) ) + { + if (m_shared.find(groupType) != NULL) + { + DCMFG_ERROR("Functional group of type " << DcmFGTypes::FGType2OFString(groupType) << " is shared AND per-frame for frame " << frameCount); + numErrors++; + } + if (groupType == DcmFGTypes::EFG_FRAMECONTENT) + foundFrameContent = OFTrue; + } + // Check if "per-frame" is allowed for this group; + if (group->second->getSharedType() == DcmFGTypes::EFGS_ONLYSHARED) + { + DCMFG_ERROR("Functional group of type " << DcmFGTypes::FGType2OFString(groupType) << " can never be per-frame, but found for frame " << frameCount); + numErrors++; + } + group++; + } + frameFG++; + } + if (!foundFrameContent) + { + DCMFG_ERROR("Frame Content Functional group missing for frame #" << frameCount); + numErrors++; + } + } + + // Check whether shared groups contain FGs that are only permitted per-frame + FunctionalGroups::iterator it = m_shared.begin(); + FunctionalGroups::iterator end = m_shared.end(); + while (it != end) + { + if ( (*it).second->getSharedType() == DcmFGTypes::EFGS_ONLYPERFRAME ) + { + DCMFG_ERROR("Functional group of type " << DcmFGTypes::FGType2OFString((*it).second->getType()) << " used as shared functional group but must be per-frame"); + numErrors++; + } + it++; + } + + if (numErrors > 0) + return OFFalse; + + return OFTrue; +} diff --git a/dcmfg/libsrc/fgparametricmapframetype.cc b/dcmfg/libsrc/fgparametricmapframetype.cc new file mode 100644 index 00000000..d3956057 --- /dev/null +++ b/dcmfg/libsrc/fgparametricmapframetype.cc @@ -0,0 +1,147 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Parametric Map Frame Type + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgparametricmapframetype.h" + +FGParametricMapFrameType::FGParametricMapFrameType() +: FGBase(DcmFGTypes::EFG_PARAMETRICMAPFRAMETYPE) +, m_FrameType(DCM_FrameType) +{ + +} + +FGParametricMapFrameType::~FGParametricMapFrameType() +{ + +} + +void FGParametricMapFrameType::clearData() +{ + m_FrameType.clear(); +} + +FGBase* FGParametricMapFrameType::clone() const +{ + if(FGParametricMapFrameType* copy = new FGParametricMapFrameType) + { + copy->m_FrameType = m_FrameType; + return copy; + } + return OFnullptr; +} + +OFCondition FGParametricMapFrameType::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem; + OFCondition result; + + seqItem = OFnullptr; + result = getItemFromFGSequence(item, DCM_ParametricMapFrameTypeSequence, 0, seqItem); + if(result.bad()) + return result; + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameType, "4", "1", "Parametric Map Frame Type"); + + return EC_Normal; +} + + +OFCondition FGParametricMapFrameType::write(DcmItem& item) +{ + OFCondition result = check(); + if (result.good()) + { + DcmItem* seqItem; + seqItem = OFnullptr; + result = createNewFGSequence(item, DCM_ParametricMapFrameTypeSequence, 0, seqItem); + if(result.good()) + { + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameType, "4", "1", "Parametric Map Frame Type"); + } + } + return result; +} + + +int FGParametricMapFrameType::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if(result == 0) + { + const FGParametricMapFrameType* myRhs = OFstatic_cast(const FGParametricMapFrameType*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_FrameType.compare(myRhs->m_FrameType); + } + + return result; +} + + +OFCondition FGParametricMapFrameType::check() const +{ + DcmCodeString myFrameType = m_FrameType; + OFCondition result = myFrameType.checkValue("4"); + if (result.good()) + { + OFString val; + myFrameType.getOFString(val, 0); + if (val == "DERIVED") + { + val.clear(); + myFrameType.getOFString(val, 1); + if (val == "PRIMARY") + { + val.clear(); + myFrameType.getOFString(val, 1); + return EC_Normal; + } + else + DCMFG_ERROR("Frame Type' 2nd value must be \"PRIMARY\" but is \"" << val << "\""); + } + else + DCMFG_ERROR("Frame Type 1st value must be \"DERIVED\" but is \"" << val << "\""); + } + return FG_EC_InvalidData; +} + + +OFCondition FGParametricMapFrameType::getFrameType(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_FrameType, value, pos); +} + + +OFCondition FGParametricMapFrameType::setFrameType(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "4") : EC_Normal; + if (result.good()) + result = m_FrameType.putString(value.c_str()); + return result; +} diff --git a/dcmfg/libsrc/fgpixeltransform.cc b/dcmfg/libsrc/fgpixeltransform.cc new file mode 100644 index 00000000..de4b7225 --- /dev/null +++ b/dcmfg/libsrc/fgpixeltransform.cc @@ -0,0 +1,239 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the (Identity) Pixel Value Transformation FG + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgpixeltransform.h" + +FGPixelValueTransformation::FGPixelValueTransformation() +: FGBase(DcmFGTypes::EFG_UNDEFINED) +, m_RescaleIntercept(DCM_RescaleIntercept) +, m_RescaleSlope(DCM_RescaleSlope) +, m_RescaleType(DCM_RescaleType) +, m_UseAsIdentityPixelValueTransformationFG(OFFalse) +{ + m_RescaleIntercept.putOFStringArray("0"); + m_RescaleSlope.putOFStringArray("1"); + m_RescaleType.putOFStringArray("US"); +} + + +void FGPixelValueTransformation::setUseAsIdentityPixelValueTransformation() +{ + m_UseAsIdentityPixelValueTransformationFG = OFTrue; +} + + + +FGPixelValueTransformation::~FGPixelValueTransformation() +{ + +} + + +OFCondition FGPixelValueTransformation::check() const +{ + if (m_UseAsIdentityPixelValueTransformationFG) + { + Float64 rs, ri; + rs = ri = 0; + OFString rt; + OFBool ok = OFTrue; + if (OFconst_cast(DcmDecimalString*, &m_RescaleIntercept)->getFloat64(ri).good()) + { + if (ri != 0) + { + DCMFG_ERROR("Rescale Intercept in Identity Pixel Value Transformation FG must be 0 but is set to " << ri); + ok = OFFalse; + } + } + else + { + DCMFG_ERROR("Invalid or no value for Rescale Intercept in Identity Pixel Value Transformation FG (0 is the only valid value"); + ok = OFFalse; + } + + if (OFconst_cast(DcmDecimalString*, &m_RescaleSlope)->getFloat64(rs).good()) + { + if (rs != 1) + { + DCMFG_ERROR("Rescale Slope in Identity Pixel Value Transformation FG must be 1 but is set to " << rs); + ok = OFFalse; + } + } + else + { + DCMFG_ERROR("Invalid or no value for Rescale Slope in Identity Pixel Value Transformation FG (1 is the only valid value"); + ok = OFFalse; + } + + if (OFconst_cast(DcmLongString*, &m_RescaleType)->getOFStringArray(rt).good()) + { + if (rt != "US") + { + DCMFG_ERROR("Rescale Type in Identity Pixel Value Transformation FG must be \"US\" but is set to " << rt); + ok = OFFalse; + } + } + else + { + DCMFG_ERROR("Invalid or no value for Rescale Type in Identity Pixel Value Transformation FG (\"US\" is the only valid value"); + ok = OFFalse; + } + if (!ok) + { + return FG_EC_InvalidData; + } + } + return EC_Normal; +} + + +void FGPixelValueTransformation::clearData() +{ + m_RescaleIntercept.clear(); + m_RescaleSlope.clear(); + m_RescaleType.clear(); +} + + +FGBase* FGPixelValueTransformation::clone() const +{ + if(FGPixelValueTransformation* copy = new FGPixelValueTransformation) + { + copy->m_RescaleIntercept = m_RescaleIntercept; + copy->m_RescaleSlope = m_RescaleSlope; + copy->m_RescaleType = m_RescaleType; + return copy; + } + return OFnullptr; +} + + +OFCondition FGPixelValueTransformation::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem; + OFCondition result; + + seqItem = OFnullptr; + result = getItemFromFGSequence(item, DCM_PixelValueTransformationSequence, 0, seqItem); + if(result.bad()) + return result; + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_RescaleIntercept, "1", "1", "Identity Pixel Value Transformation"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_RescaleSlope, "1", "1", "Identity Pixel Value Transformation"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_RescaleType, "1", "1", "Identity Pixel Value Transformation"); + + return EC_Normal; +} + + +OFCondition FGPixelValueTransformation::write(DcmItem& item) +{ + DcmItem* seqItem; + DCMFG_DEBUG("Identity Pixel Value Transformation Macro: Fixing values for Rescale Slope, Intercept and Type to enumerated values '1', '0' and 'US'"); + m_RescaleSlope.putOFStringArray("1"); + m_RescaleIntercept.putOFStringArray("0"); + m_RescaleType.putOFStringArray("US"); + + seqItem = OFnullptr; + OFCondition result = createNewFGSequence(item, DCM_PixelValueTransformationSequence, 0, seqItem); + if(result.bad()) + return result; + DcmIODUtil::copyElementToDataset(result, *seqItem, m_RescaleIntercept, "1", "1", "Identity Pixel Value Transformation"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_RescaleSlope, "1", "1", "Identity Pixel Value Transformation"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_RescaleType, "1", "1", "Identity Pixel Value Transformation"); + + return result; +} + + +int FGPixelValueTransformation::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if(result == 0) + { + const FGPixelValueTransformation* myRhs = OFstatic_cast(const FGPixelValueTransformation*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_RescaleIntercept.compare(myRhs->m_RescaleIntercept); + if (result == 0) result = m_RescaleSlope.compare(myRhs->m_RescaleSlope); + if (result == 0) result = m_RescaleType.compare(myRhs->m_RescaleType); + } + + return result; +} + + +OFCondition FGPixelValueTransformation::getRescaleIntercept(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_RescaleIntercept, value, pos); +} + + +OFCondition FGPixelValueTransformation::getRescaleSlope(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_RescaleSlope, value, pos); +} + + +OFCondition FGPixelValueTransformation::getRescaleType(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_RescaleType, value, pos); +} + + +OFCondition FGPixelValueTransformation::setRescaleIntercept(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_RescaleIntercept.putString(value.c_str()); + return result; +} + + +OFCondition FGPixelValueTransformation::setRescaleSlope(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_RescaleSlope.putString(value.c_str()); + return result; +} + + +OFCondition FGPixelValueTransformation::setRescaleType(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_RescaleType.putString(value.c_str()); + return result; +} + diff --git a/dcmfg/libsrc/fgpixmsr.cc b/dcmfg/libsrc/fgpixmsr.cc new file mode 100644 index 00000000..76bb4bb9 --- /dev/null +++ b/dcmfg/libsrc/fgpixmsr.cc @@ -0,0 +1,180 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Pixel Measures Functional Group + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgpixmsr.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + + +FGPixelMeasures::FGPixelMeasures() +: FGBase(DcmFGTypes::EFG_PIXELMEASURES), + m_PixelSpacing(DCM_PixelSpacing), + m_SliceThickness(DCM_SliceThickness), + m_SpacingBetweenSlices(DCM_SpacingBetweenSlices) +{ +} + + +FGPixelMeasures::~FGPixelMeasures() +{ + // nothing to do +} + + +FGBase* FGPixelMeasures::clone() const +{ + FGPixelMeasures* copy = new FGPixelMeasures(); + if (copy) + { + copy->m_PixelSpacing = this->m_PixelSpacing; + copy->m_SliceThickness = this->m_SliceThickness; + copy->m_SpacingBetweenSlices = this->m_SpacingBetweenSlices; + } + return copy; +} + + +void FGPixelMeasures::clearData() +{ + m_PixelSpacing.clear(); + m_SliceThickness.clear(); + m_SpacingBetweenSlices.clear(); +} + + +OFCondition FGPixelMeasures::check() const +{ + // Checks in read() and write() are sufficient for now + return EC_Normal; +} + + +int FGPixelMeasures::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGPixelMeasures* myRhs = OFstatic_cast(const FGPixelMeasures*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_PixelSpacing.compare(myRhs->m_PixelSpacing); + if (result == 0) + result = m_SliceThickness.compare(myRhs->m_SliceThickness); + if (result == 0) + result = m_SpacingBetweenSlices.compare(myRhs->m_SpacingBetweenSlices); + + return result; +} + + +/// Read from Frame Content Sequence +OFCondition FGPixelMeasures::read(DcmItem& item) +{ + clearData(); + + OFCondition result; + DcmItem* seqItem = NULL; + result = getItemFromFGSequence(item, DCM_PixelMeasuresSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_PixelSpacing, "2", "1C", "PixelMeasuresMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_SliceThickness, "1", "1C", "PixelMeasuresMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_SpacingBetweenSlices, "1", "3", "PixelMeasuresMacro"); + + return EC_Normal; +} + +OFCondition FGPixelMeasures::write(DcmItem& item) +{ + DcmItem* seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_PixelMeasuresSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write frame content macro attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_PixelSpacing, "2", "1C", "PixelMeasuresMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_SliceThickness, "1", "1C", "PixelMeasuresMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_SpacingBetweenSlices, "1", "3", "PixelMeasuresMacro"); + + return result; +} + + +OFCondition FGPixelMeasures::getPixelSpacing(Float64& value, + const signed long pos) +{ + return m_PixelSpacing.getFloat64(value, pos); +} + + +OFCondition FGPixelMeasures:: getSliceThickness(Float64& value, + const signed long pos) +{ + return m_SliceThickness.getFloat64(value, pos); +} + + +OFCondition FGPixelMeasures:: getSpacingBetweenSlices(Float64& value, + const signed long pos) +{ + return m_SpacingBetweenSlices.getFloat64(value, pos); +} + + +OFCondition FGPixelMeasures::setPixelSpacing(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + { + result = m_PixelSpacing.putOFStringArray(value); + } + return result; +} + + +OFCondition FGPixelMeasures::setSliceThickness(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + result = m_SliceThickness.putOFStringArray(value); + } + return result; +} + +OFCondition FGPixelMeasures::setSpacingBetweenSlices(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + result = m_SpacingBetweenSlices.putOFStringArray(value); + } + return result; +} diff --git a/dcmfg/libsrc/fgplanor.cc b/dcmfg/libsrc/fgplanor.cc new file mode 100644 index 00000000..36a00dca --- /dev/null +++ b/dcmfg/libsrc/fgplanor.cc @@ -0,0 +1,187 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Orientation (Patient) Functional Group + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgplanor.h" +#include "dcmtk/dcmfg/fgfact.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + + +FGPlaneOrientationPatient::FGPlaneOrientationPatient() : + FGBase(DcmFGTypes::EFG_PLANEORIENTPATIENT), + m_ImageOrientationPatient(DCM_ImageOrientationPatient) +{ +} + +/// clear old values +void FGPlaneOrientationPatient::clearData() +{ + m_ImageOrientationPatient.clear(); +} + + +OFCondition FGPlaneOrientationPatient::check() const +{ + // Checks in read() and write() are sufficient for now + return EC_Normal; +} + + +FGBase* FGPlaneOrientationPatient::clone() const +{ + FGPlaneOrientationPatient* copy = new FGPlaneOrientationPatient(); + if (copy) + { + copy->m_ImageOrientationPatient = this->m_ImageOrientationPatient; + } + return copy; +} + + +FGPlaneOrientationPatient* FGPlaneOrientationPatient::createMinimal(const OFString& imageOrientationPatientRowX, + const OFString& imageOrientationPatientRowY, + const OFString& imageOrientationPatientRowZ, + const OFString& imageOrientationPatientColX, + const OFString& imageOrientationPatientColY, + const OFString& imageOrientationPatientColZ) +{ + FGPlaneOrientationPatient *fg = OFstatic_cast(FGPlaneOrientationPatient*, FGFactory::instance().create(DcmFGTypes::EFG_PLANEORIENTPATIENT)); + if (fg) + { + OFCondition result = fg->setImageOrientationPatient(imageOrientationPatientRowX, + imageOrientationPatientRowY, + imageOrientationPatientRowZ, + imageOrientationPatientColX, + imageOrientationPatientColY, + imageOrientationPatientColZ); + if (result.bad()) + { + DCMFG_ERROR("Could not create new FGPlaneOrientationPatient: Invalid data for Image Orientation Patient: " << result.text()); + delete fg; + return NULL; + } + } + return fg; +} + + + +/// Read from Plane Position Sequence +OFCondition FGPlaneOrientationPatient::read(DcmItem& item) +{ + clearData(); + + DcmItem *seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_PlaneOrientationSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_ImageOrientationPatient, "6", "1C", "PlaneOrientationPatient"); + + return EC_Normal; +} + + +OFCondition FGPlaneOrientationPatient::write(DcmItem& item) +{ + DcmItem *seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_PlaneOrientationSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write plane position (patient) attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_ImageOrientationPatient, "6", "1C", "PlaneOrientationPatient"); + + return result; +} + + + +int FGPlaneOrientationPatient::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result == 0) + { + const FGPlaneOrientationPatient* myRhs = OFstatic_cast(const FGPlaneOrientationPatient*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_ImageOrientationPatient.compare(myRhs->m_ImageOrientationPatient); + } + + return result; +} + + +OFCondition FGPlaneOrientationPatient::getImageOrientationPatient(OFString& value, + const signed long pos = 0) + +{ + return DcmIODUtil::getStringValueFromElement(m_ImageOrientationPatient, value, pos); +} + + +OFCondition FGPlaneOrientationPatient::getImageOrientationPatient(Float64& rowX, + Float64& rowY, + Float64& rowZ, + Float64& colX, + Float64& colY, + Float64& colZ) +{ + OFCondition result = m_ImageOrientationPatient.getFloat64(rowX, 0); + if (result.good()) m_ImageOrientationPatient.getFloat64(rowY, 1); + if (result.good()) m_ImageOrientationPatient.getFloat64(rowZ, 2); + if (result.good()) m_ImageOrientationPatient.getFloat64(colX, 3); + if (result.good()) m_ImageOrientationPatient.getFloat64(colY, 4); + if (result.good()) m_ImageOrientationPatient.getFloat64(colZ, 5); + return result; +} + + +OFCondition FGPlaneOrientationPatient::setImageOrientationPatient(const OFString& rowX, + const OFString& rowY, + const OFString& rowZ, + const OFString& colX, + const OFString& colY, + const OFString& colZ, + const OFBool checkValue) +{ + OFString str(rowX); str += "\\"; + str += rowY; str += "\\"; + str += rowZ; str += "\\"; + str += colX; str += "\\"; + str += colY; str += "\\"; + str += colZ; + + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(str, "6") : EC_Normal; + if (result.good()) + result = m_ImageOrientationPatient.putOFStringArray(str); + return result; +} + + +FGPlaneOrientationPatient::~FGPlaneOrientationPatient() +{ + // nothing to do +} diff --git a/dcmfg/libsrc/fgplanorvol.cc b/dcmfg/libsrc/fgplanorvol.cc new file mode 100644 index 00000000..c7d41171 --- /dev/null +++ b/dcmfg/libsrc/fgplanorvol.cc @@ -0,0 +1,162 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Orientation (Volume) Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgplanorvol.h" +#include "dcmtk/dcmfg/fgtypes.h" + + +// Constructor +FGPlaneOrientationVolume::FGPlaneOrientationVolume() : + FGBase(DcmFGTypes::EFG_PLANEORIENTVOLUME), + m_ImageOrientationVolume(DCM_ImageOrientationVolume) +{ +} + + +FGPlaneOrientationVolume::~FGPlaneOrientationVolume() +{ + // nothing to do +} + + +FGBase* FGPlaneOrientationVolume::clone() const +{ + FGPlaneOrientationVolume* copy = new FGPlaneOrientationVolume(); + if (copy) + { + copy->m_ImageOrientationVolume = this->m_ImageOrientationVolume; + } + return copy; +} + + +void FGPlaneOrientationVolume::clearData() +{ + m_ImageOrientationVolume.clear(); +} + + +OFCondition FGPlaneOrientationVolume::check() const +{ + // Checks in read() and write() are sufficient for now + return EC_Normal; +} + + +// --- get() functionality --- + +OFCondition FGPlaneOrientationVolume::getImageOrientationVolume(Float64& value, + const long unsigned int pos) +{ + return m_ImageOrientationVolume.getFloat64(value, pos); +} + + + +OFCondition FGPlaneOrientationVolume::getImageOrientationVolume(Float64& rowX, + Float64& rowY, + Float64& rowZ, + Float64& colX, + Float64& colY, + Float64& colZ) +{ + OFCondition result = m_ImageOrientationVolume.getFloat64(rowX, 0); + if (result.good()) result = m_ImageOrientationVolume.getFloat64(rowY, 1); + if (result.good()) result = m_ImageOrientationVolume.getFloat64(rowZ, 2); + if (result.good()) result = m_ImageOrientationVolume.getFloat64(colX, 3); + if (result.good()) result = m_ImageOrientationVolume.getFloat64(colY, 4); + if (result.good()) result = m_ImageOrientationVolume.getFloat64(colZ, 5); + return result; +} + + +// --- set() functionality --- + + +OFCondition FGPlaneOrientationVolume::setImageOrientationVolume(const Float64& rowX, + const Float64& rowY, + const Float64& rowZ, + const Float64& colX, + const Float64& colY, + const Float64& colZ, + const OFBool) +{ + OFCondition result = m_ImageOrientationVolume.putFloat64(rowX, 0); + if (result.good()) m_ImageOrientationVolume.putFloat64(rowY, 1); + if (result.good()) m_ImageOrientationVolume.putFloat64(rowZ, 2); + if (result.good()) m_ImageOrientationVolume.putFloat64(colX, 3); + if (result.good()) m_ImageOrientationVolume.putFloat64(colY, 4); + if (result.good()) m_ImageOrientationVolume.putFloat64(colZ, 5); + return result; +} + + +/// Read Plane Orientation (Volume) Sequence from given item +OFCondition FGPlaneOrientationVolume::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_PlaneOrientationVolumeSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_ImageOrientationVolume, "6", "1", "PlaneOrientationVolume"); + + return EC_Normal; + +} + +/// Writes single Plane Orientation (Volume) Sequence into given item +OFCondition FGPlaneOrientationVolume::write(DcmItem& item) +{ + DcmItem *seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_PlaneOrientationVolumeSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write frame content macro attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_ImageOrientationVolume, "6", "1", "PlaneOrientationVolume"); + return result; +} + + +int FGPlaneOrientationVolume::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGPlaneOrientationVolume* myRhs = OFstatic_cast(const FGPlaneOrientationVolume*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_ImageOrientationVolume.compare(myRhs->m_ImageOrientationVolume); + return result; +} + + + diff --git a/dcmfg/libsrc/fgplanpo.cc b/dcmfg/libsrc/fgplanpo.cc new file mode 100644 index 00000000..b1c46109 --- /dev/null +++ b/dcmfg/libsrc/fgplanpo.cc @@ -0,0 +1,168 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Position (Patient) Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgplanpo.h" +#include "dcmtk/dcmfg/fgfact.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + +FGPlanePosPatient::FGPlanePosPatient() : + FGBase(DcmFGTypes::EFG_PLANEPOSPATIENT), + m_ImagePositionPatient(DCM_ImagePositionPatient) +{ +} + +FGBase* FGPlanePosPatient::clone() const +{ + FGPlanePosPatient* copy = new FGPlanePosPatient(); + if (copy) + { + copy->m_ImagePositionPatient = this->m_ImagePositionPatient; + } + return copy; +} + + +FGPlanePosPatient* FGPlanePosPatient::createMinimal(const OFString& imagePositionPatientX, + const OFString& imagePositionPatientY, + const OFString& imagePositionPatientZ) +{ + FGPlanePosPatient *fg = OFstatic_cast(FGPlanePosPatient*, FGFactory::instance().create(DcmFGTypes::EFG_PLANEPOSPATIENT)); + if (fg) + { + OFCondition result = fg->setImagePositionPatient(imagePositionPatientX, imagePositionPatientY, imagePositionPatientZ); + if (result.bad()) + { + DCMFG_ERROR("Could not create new FGPlanePosPatient: Invalid data for Image Position Patient: " << result.text()); + delete fg; + return NULL; + } + } + return fg; +} + + + +/// clear old values +void FGPlanePosPatient::clearData() +{ + m_ImagePositionPatient.clear(); +} + + +OFCondition FGPlanePosPatient::check() const +{ + // Checks in read() and write() are sufficient for now + return EC_Normal; +} + + +/// Read from Plane Position Sequence +OFCondition FGPlanePosPatient::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_PlanePositionSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_ImagePositionPatient, "3", "1C", "PlanePositionSequence"); + + return EC_Normal; +} + + +OFCondition FGPlanePosPatient::write(DcmItem& item) +{ + DcmItem* seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_PlanePositionSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write plane position (patient) attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_ImagePositionPatient, "3", "1C", "PlanePositionSequence"); + + return result; +} + + +int FGPlanePosPatient::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result == 0) + { + const FGPlanePosPatient* myRhs = OFstatic_cast(const FGPlanePosPatient*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_ImagePositionPatient.compare(myRhs->m_ImagePositionPatient); + } + + return result; +} + + + +OFCondition FGPlanePosPatient::getImagePositionPatient(OFString& value, + const signed long pos = 0) + +{ + return DcmIODUtil::getStringValueFromElement(m_ImagePositionPatient, value, pos); +} + + +OFCondition FGPlanePosPatient::getImagePositionPatient(Float64& coordinateX, + Float64& coordinateY, + Float64& coordinateZ) +{ + OFCondition result = m_ImagePositionPatient.getFloat64(coordinateX, 0); + if (result.good()) result = m_ImagePositionPatient.getFloat64(coordinateY, 1); + if (result.good()) result = m_ImagePositionPatient.getFloat64(coordinateZ, 2); + return result; +} + + +OFCondition FGPlanePosPatient::setImagePositionPatient(const OFString& coordinateX, + const OFString& coordinateY, + const OFString& coordinateZ, + const OFBool checkValue) + +{ + + OFString str(coordinateX); + str += "\\"; + str += coordinateY; + str += "\\"; + str += coordinateZ; + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(str, "3") : EC_Normal; + if (result.good()) + result = m_ImagePositionPatient.putOFStringArray(str); + return result; +} + + +FGPlanePosPatient::~FGPlanePosPatient() +{ + // nothing to do +} diff --git a/dcmfg/libsrc/fgplanposvol.cc b/dcmfg/libsrc/fgplanposvol.cc new file mode 100644 index 00000000..70e650a4 --- /dev/null +++ b/dcmfg/libsrc/fgplanposvol.cc @@ -0,0 +1,155 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Plane Position (Volume) Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgplanposvol.h" +#include "dcmtk/dcmfg/fgtypes.h" + +// Constructor +FGPlanePositionVolume::FGPlanePositionVolume() : + FGBase(DcmFGTypes::EFG_PLANEPOSITIONVOLUME), + m_ImagePositionVolume(DCM_ImagePositionVolume) +{ +} + + +FGPlanePositionVolume::~FGPlanePositionVolume() +{ + // nothing to do +} + + +FGBase* FGPlanePositionVolume::clone() const +{ + FGPlanePositionVolume* copy = new FGPlanePositionVolume(); + if (copy) + { + copy->m_ImagePositionVolume = this->m_ImagePositionVolume; + } + return copy; +} + + +void FGPlanePositionVolume::clearData() +{ + m_ImagePositionVolume.clear(); +} + + +OFCondition FGPlanePositionVolume::check() const +{ + // Checks in read() and write() are sufficient for now + return EC_Normal; +} + + +// --- get() functionality --- + +OFCondition FGPlanePositionVolume::getImagePositionVolume(Float64& value, + const long unsigned int pos) +{ + return m_ImagePositionVolume.getFloat64(value, pos); +} + + +OFCondition FGPlanePositionVolume::getImagePositionVolume(Float64& valueX, + Float64& valueY, + Float64& valueZ) +{ + OFCondition result = m_ImagePositionVolume.getFloat64(valueX, 0); + if (result.good()) result = m_ImagePositionVolume.getFloat64(valueY, 1); + if (result.good()) result = m_ImagePositionVolume.getFloat64(valueZ, 2); + return result; +} + + +OFCondition FGPlanePositionVolume::setImagePositionVolume(const Float64& valueX, + const Float64& valueY, + const Float64& valueZ, + const OFBool checkValue) +{ + (void)checkValue; + OFCondition result = m_ImagePositionVolume.putFloat64(valueX, 0); + if (result.good()) result = m_ImagePositionVolume.putFloat64(valueY, 1); + if (result.good()) result = m_ImagePositionVolume.putFloat64(valueZ, 2); + return result; +} + + +OFCondition FGPlanePositionVolume::setImagePositionVolume(const Float64& value, + const long unsigned int pos, + const OFBool checkValue) +{ + // no checks + (void)checkValue; + if (pos > 2) + return EC_ValueMultiplicityViolated; + + return m_ImagePositionVolume.putFloat64(value, pos); +} + + +/// Read Plane Position (Volume) Sequence from given item +OFCondition FGPlanePositionVolume::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_PlanePositionVolumeSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_ImagePositionVolume, "3", "1", "PlanePositionVolume"); + + return EC_Normal; + +} + +/// Writes single Plane Position (Volume) Sequence into given item +OFCondition FGPlanePositionVolume::write(DcmItem& item) +{ + DcmItem *seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_PlanePositionVolumeSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write frame content macro attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_ImagePositionVolume, "3", "1", "PlanePositionVolume"); + return result; +} + + +int FGPlanePositionVolume::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGPlanePositionVolume* myRhs = OFstatic_cast(const FGPlanePositionVolume*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_ImagePositionVolume.compare(myRhs->m_ImagePositionVolume); + return result; +} diff --git a/dcmfg/libsrc/fgrealworldvaluemapping.cc b/dcmfg/libsrc/fgrealworldvaluemapping.cc new file mode 100644 index 00000000..b876b39b --- /dev/null +++ b/dcmfg/libsrc/fgrealworldvaluemapping.cc @@ -0,0 +1,477 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Real World Value Mapping Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgrealworldvaluemapping.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString FGRealWorldValueMapping::RWVMItem::m_ModuleName = "RealWorldValueMappingItemMacro"; + +FGRealWorldValueMapping::FGRealWorldValueMapping() +: FGBase(DcmFGTypes::EFG_REALWORLDVALUEMAPPING), + m_Items() +{ +} + + +FGRealWorldValueMapping::~FGRealWorldValueMapping() +{ + clearData(); +} + + +FGBase* FGRealWorldValueMapping::clone() const +{ + FGRealWorldValueMapping* copy = new FGRealWorldValueMapping(); + if (copy) + { + for (OFVector::const_iterator it = m_Items.begin(); it < m_Items.end(); it++) + { + if (*it == NULL) return NULL; + FGRealWorldValueMapping::RWVMItem* item = (*it)->clone(); + if (item == NULL) return NULL; + copy->m_Items.push_back(item); + } + } + return copy; +} + + +void FGRealWorldValueMapping::clearData() +{ + DcmIODUtil::freeContainer(m_Items); +} + + +OFCondition FGRealWorldValueMapping::check() const +{ + // More checks checks for 1C conditions could be added + return EC_Normal; +} + + +int FGRealWorldValueMapping::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGRealWorldValueMapping* myRhs = OFstatic_cast(const FGRealWorldValueMapping*, &rhs); + if (!myRhs) + return -1; + + // Compare all items, start with VM + if (m_Items.size() < myRhs->m_Items.size()) + return 1; + else if (m_Items.size() > myRhs->m_Items.size()) + return -1; + + for (size_t n = 0; m_Items.size(); n++) + { + result = m_Items[n]->compare( *(myRhs->m_Items[n]) ); + if (result != 0) return result; + } + return result; +} + + +/// Read from Frame Content Sequence +OFCondition FGRealWorldValueMapping::read(DcmItem& item) +{ + clearData(); + + DcmIODUtil::readSubSequence(item, DCM_RealWorldValueMappingSequence, m_Items, "1-n", "1", "RealWorldValueMappingMacro"); + + return EC_Normal; +} + +OFCondition FGRealWorldValueMapping::write(DcmItem& item) +{ + // OFCondition result = createNewFGSequence(item, DCM_RealWorldValueMappingSequence, 0, seqItem); + OFCondition result; + DcmIODUtil::writeSubSequence(result, DCM_RealWorldValueMappingSequence, m_Items, item, "1-n", "1", "RealWorldValueMappingMacro"); + return result; +} + + +OFVector< FGRealWorldValueMapping::RWVMItem* >& FGRealWorldValueMapping::getRealWorldValueMapping() +{ + return m_Items; +} + + +// ----------------------------------------------------------- + + +FGRealWorldValueMapping::RWVMItem::RWVMItem(IODComponent* parent) +: IODComponent(parent), + m_MeasurementUnitsCode(), + m_QuantityDefinitionSequence() +{ + resetRules(); +} + + +FGRealWorldValueMapping::RWVMItem::RWVMItem(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules, + IODComponent* parent) +: IODComponent(item, rules, parent), + m_MeasurementUnitsCode(), + m_QuantityDefinitionSequence() +{ + resetRules(); +} + + +FGRealWorldValueMapping::RWVMItem::RWVMItem(const FGRealWorldValueMapping::RWVMItem& rhs) +: IODComponent(rhs), + m_MeasurementUnitsCode(rhs.m_MeasurementUnitsCode), + m_QuantityDefinitionSequence() +{ + OFVector::const_iterator it = rhs.m_QuantityDefinitionSequence.begin(); + while (it != rhs.m_QuantityDefinitionSequence.end()) + { + ContentItemMacro* macro = new ContentItemMacro(**it); + if (macro == NULL) + { + DCMFG_ERROR("Out of memory in copy constructor of FGRealWorldValueMapping::RWVMItem::RWVMItem"); + return; + } + m_QuantityDefinitionSequence.push_back(macro); + it++; + } +} + + + +FGRealWorldValueMapping::RWVMItem* FGRealWorldValueMapping::RWVMItem::clone() +{ + return new FGRealWorldValueMapping::RWVMItem(*this); +} + + + +FGRealWorldValueMapping::RWVMItem::~RWVMItem() +{ + DcmIODUtil::freeContainer(m_QuantityDefinitionSequence); +} + + +OFString FGRealWorldValueMapping::RWVMItem::getName() const +{ + return m_ModuleName; +} + + +int FGRealWorldValueMapping::RWVMItem::compare(const IODComponent& rhs) const +{ + int result = IODComponent::compare(rhs); + const FGRealWorldValueMapping::RWVMItem* myRhs = OFstatic_cast(const FGRealWorldValueMapping::RWVMItem*, &rhs); + if (!myRhs) + return -1; + + if (result == 0) result = m_MeasurementUnitsCode.compare(*myRhs); + if (result == 0) + { + size_t rhsSize = myRhs->m_QuantityDefinitionSequence.size(); + size_t thisSize = m_QuantityDefinitionSequence.size(); + if (thisSize < rhsSize) + return -1; + else if (thisSize > rhsSize) + return 1; + + OFVector::const_iterator it = m_QuantityDefinitionSequence.begin(); + OFVector::const_iterator rhsIt = myRhs->m_QuantityDefinitionSequence.begin(); + while (it != m_QuantityDefinitionSequence.end() && (result == 0)) + { + result = (*it)->compare( *(*rhsIt) ); + it++; + } + } + return result; + +} + + +void FGRealWorldValueMapping::RWVMItem::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_RealWorldValueFirstValueMapped, "1","1C",getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_RealWorldValueLastValueMapped, "1","1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DoubleFloatRealWorldValueFirstValueMapped, "1","1C",getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DoubleFloatRealWorldValueLastValueMapped, "1","1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_RealWorldValueIntercept, "1","1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_RealWorldValueSlope, "1","1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_RealWorldValueLUTData, "1-n","1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LUTExplanation, "1","1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LUTLabel, "1","1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_MeasurementUnitsCodeSequence, "1","1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_QuantityDefinitionSequence, "1-n","3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::read(DcmItem& source, + const OFBool clearOldData) +{ + DcmIODUtil::readSingleItem(source, DCM_MeasurementUnitsCodeSequence, m_MeasurementUnitsCode, "1", m_ModuleName); + DcmIODUtil::readSubSequence(source, DCM_QuantityDefinitionSequence, m_QuantityDefinitionSequence, m_Rules->getByTag(DCM_QuantityDefinitionSequence)); + return IODComponent::read(source, clearOldData); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::write(DcmItem& destination) +{ + OFCondition result; + DcmIODUtil::writeSingleItem(result, DCM_MeasurementUnitsCodeSequence, m_MeasurementUnitsCode, *m_Item, "1", m_ModuleName); + DcmIODUtil::writeSubSequence(result, DCM_QuantityDefinitionSequence, m_QuantityDefinitionSequence, *m_Item, m_Rules->getByTag(DCM_QuantityDefinitionSequence)); + if (result.good()) result = IODComponent::write(destination); + return result; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getRealWorldValueFirstValueMapped(Sint32& value, + const unsigned long pos) const +{ + return getUSorSS(*m_Item, DCM_RealWorldValueFirstValueMapped, pos, value); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getRealWorldValueLastValueMapped(Sint32& value, + const unsigned long pos) const +{ + return getUSorSS(*m_Item, DCM_RealWorldValueLastValueMapped, pos, value); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getDoubleFloatRealWorldValueFirstValueMapped(Float64& value, + const unsigned long pos) const +{ + return (*m_Item).findAndGetFloat64(DCM_DoubleFloatRealWorldValueFirstValueMapped, value, pos); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getDoubleFloatRealWorldValueLastValueMapped(Float64& value, + const unsigned long pos) const +{ + return (*m_Item).findAndGetFloat64(DCM_DoubleFloatRealWorldValueFirstValueMapped, value, pos); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getRealWorldValueLUTData(OFVector< Float64 >& values) const +{ + DcmElement* elem = NULL; + OFCondition result = m_Item->findAndGetElement(DCM_RealWorldValueLUTData, elem); + if (result.good()) + { + size_t numValues = elem->getNumberOfValues(); + for (size_t n = 0; n < numValues; n++) + { + Float64 value; + result = elem->getFloat64(value, OFstatic_cast(unsigned long, n)); + if (result.good()) values.push_back(value); + } + } + return result; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getRealWorldValueLUTData(Float64& value, + const unsigned long pos) const +{ + return m_Item->findAndGetFloat64(DCM_RealWorldValueLUTData, value, pos); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getLUTExplanation(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_LUTExplanation, *m_Item, value, pos); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getLUTLabel(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_LUTLabel, *m_Item, value, pos); +} + + +CodeSequenceMacro& FGRealWorldValueMapping::RWVMItem::getMeasurementUnitsCode() +{ + return m_MeasurementUnitsCode; +} + + +OFVector & FGRealWorldValueMapping::RWVMItem::getEntireQuantityDefinitionSequence() +{ + return m_QuantityDefinitionSequence; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setRealWorldValueFirstValueMappedUnsigned(const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + DcmUnsignedShort* us = new DcmUnsignedShort(DCM_RealWorldValueFirstValueMapped); + OFCondition result = us->putUint16(value); + if (result.good()) result = m_Item->insert(us, OFTrue /* replace old */); + if (result.bad()) delete us; + return result; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setRealWorldValueFirstValueMappedSigned(const Sint16& value, + const OFBool checkValue) +{ + (void)checkValue; + DcmSignedShort* ss = new DcmSignedShort(DCM_RealWorldValueFirstValueMapped); + OFCondition result = ss->putSint16(value); + if (result.good()) result = m_Item->insert(ss, OFTrue /* replace old */); + if (result.bad()) delete ss; + return result; +} + +OFCondition FGRealWorldValueMapping::RWVMItem::setRealWorldValueLastValueMappedSigned(const Sint16& value, + const OFBool checkValue) +{ + (void)checkValue; + DcmSignedShort* ss = new DcmSignedShort(DCM_RealWorldValueLastValueMapped); + OFCondition result = ss->putSint16(value); + if (result.good()) result = m_Item->insert(ss, OFTrue /* replace old */); + if (result.bad()) delete ss; + return result; + +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setRealWorldValueLastValueMappedUnsigned(const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + DcmUnsignedShort* us = new DcmUnsignedShort(DCM_RealWorldValueLastValueMapped); + OFCondition result = us->putUint16(value); + if (result.good()) result = m_Item->insert(us, OFTrue /* replace old */); + if (result.bad()) delete us; + return result; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setDoubleFloatRealWorldValueFirstValueMapped(const Float64 value, + const OFBool checkValue) +{ + (void)checkValue; + return (*m_Item).putAndInsertFloat64(DCM_DoubleFloatRealWorldValueFirstValueMapped, value); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setDoubleFloatRealWorldValueLastValueMapped(const Float64 value, + const OFBool checkValue) +{ + (void)checkValue; + return (*m_Item).putAndInsertFloat64(DCM_DoubleFloatRealWorldValueLastValueMapped, value); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setRealWorldValueIntercept(const Float64 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat64(DCM_RealWorldValueIntercept, value); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setRealWorldValueSlope(const Float64 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat64(DCM_RealWorldValueSlope, value); +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setRealWorldValueLUTData(const OFVector< Float64 >& value, + const OFBool checkValue) +{ + (void)checkValue; + DcmElement *elem = NULL; + OFCondition result = m_Item->findAndGetElement(DCM_RealWorldValueLUTData, elem); + if (result.good()) + { + size_t count = value.size(); + for (size_t n = 0; n < count; n++) + { + if (result.good()) result = elem->putFloat64(value[n], OFstatic_cast(unsigned long, n)); + } + } + return result; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setLUTExplanation(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LUTExplanation, value); + return result; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::setLUTLabel(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LUTLabel, value); + return result; +} + + +OFCondition FGRealWorldValueMapping::RWVMItem::getUSorSS(DcmItem& item, + const DcmTagKey& key, + const unsigned long pos, + Sint32& value) +{ + DcmElement *elem = NULL; + OFCondition result = item.findAndGetElement(key, elem); + if (result.good() && elem) + { + DcmEVR evr = elem->getVR(); + if (evr == EVR_US) + { + Uint16 num; + result = elem->getUint16(num, pos); + if (result.good()) value = num; + } + else if (evr == EVR_SS) + { + Sint16 num; + result = elem->getSint16(num, pos); + if (result.good()) value = num; + } + else + { + DCMFG_ERROR("Illegal VR " << DcmVR(evr).getVRName() << " for tag " << DcmTag(key).getTagName()); + result = EC_InvalidVR; + } + } + return result; +} diff --git a/dcmfg/libsrc/fgseg.cc b/dcmfg/libsrc/fgseg.cc new file mode 100644 index 00000000..99850107 --- /dev/null +++ b/dcmfg/libsrc/fgseg.cc @@ -0,0 +1,140 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing Segmentation Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgseg.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" // for static element helpers + + +FGSegmentation::FGSegmentation() : + FGBase(DcmFGTypes::EFG_SEGMENTATION), + m_ReferencedSegmentNumber(DCM_ReferencedSegmentNumber) +{ +} + + +FGSegmentation::~FGSegmentation() +{ + clearData(); +} + +FGBase* FGSegmentation::clone() const +{ + FGSegmentation* copy = new FGSegmentation(); + if (copy) + { + copy->m_ReferencedSegmentNumber = this->m_ReferencedSegmentNumber; + } + return copy; +} + + + +void FGSegmentation::clearData() +{ + m_ReferencedSegmentNumber.clear(); +} + + +OFCondition FGSegmentation::check() const +{ + // Checks in read() and write() are sufficient for now + return EC_Normal; +} + + +OFCondition FGSegmentation::getReferencedSegmentNumber(Uint16& value, + const unsigned long pos) +{ + return m_ReferencedSegmentNumber.getUint16(value, pos); +} + + +OFCondition FGSegmentation::setReferencedSegmentNumber(const Uint16& segmentNumber) +{ + return m_ReferencedSegmentNumber.putUint16(segmentNumber); +} + + +OFCondition FGSegmentation::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + + /* Clear old data */ + item.findAndDeleteElement(DCM_SegmentIdentificationSequence); + + /* write and get Segment Identification Sequence with one item */ + DcmItem *newItem = NULL; + result = item.findOrCreateSequenceItem(DCM_SegmentIdentificationSequence, newItem, 0); + if ( result.bad() ) + { + DCMFG_ERROR("Could not create Segment Identification Sequence with one item (internal error): " << result.text()); + return FG_EC_CouldNotWriteFG; + } + DcmIODUtil::copyElementToDataset(result, *newItem, m_ReferencedSegmentNumber, "1-n", "1", "SegmentationMacro"); + + /* Return result */ + return result; +} + + +OFCondition FGSegmentation::read(DcmItem& item) +{ + OFCondition result = EC_Normal; + + /* re-initialize object */ + clearData(); + + DcmSequenceOfItems *segmentIdentificationSequence = NULL; + result = item.findAndGetSequence(DCM_SegmentIdentificationSequence, segmentIdentificationSequence); + + if ( result.good() ) + { + /* Referenced Segment Number */ + // check whether structure is ok (single item in sequence) and report problems + DcmItem *idItem= NULL; + DcmIODUtil::getAndCheckSingleItem(*segmentIdentificationSequence, idItem, DCM_SegmentIdentificationSequence); + if (idItem) + { + // so far we ignore the result when reading (but report problems to the logger) + DcmIODUtil::getAndCheckElementFromDataset(*idItem, m_ReferencedSegmentNumber, "1-n" /* vm */, "1" /* type */, "SegmentationMacro"); + } + } + return result; +} + + +int FGSegmentation::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result == 0) + { + const FGSegmentation* myRhs = OFstatic_cast(const FGSegmentation*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_ReferencedSegmentNumber.compare(myRhs->m_ReferencedSegmentNumber); + } + + return result; +} diff --git a/dcmfg/libsrc/fgtypes.cc b/dcmfg/libsrc/fgtypes.cc new file mode 100644 index 00000000..9fd72311 --- /dev/null +++ b/dcmfg/libsrc/fgtypes.cc @@ -0,0 +1,187 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing common functional group types + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fgtypes.h" +#include "dcmtk/dcmdata/dcerror.h" +#include "dcmtk/dcmfg/fgdefine.h" +#include "dcmtk/dcmfg/fgbase.h" +#include "dcmtk/dcmiod/iodcommn.h" + +OFLogger DCM_dcmfgLogger = OFLog::getLogger("dcmtk.dcmfg"); + +/*---------------------------------* + * constant definitions + *---------------------------------*/ + +// conditions +makeOFConditionConst(FG_EC_DoubledFG, OFM_dcmfg, 1, OF_error, "Doubled Functional Group"); +makeOFConditionConst(FG_EC_NoSuchGroup, OFM_dcmfg, 2, OF_error, "No such Functional Group"); +makeOFConditionConst(FG_EC_NotEnoughItems, OFM_dcmfg, 3, OF_error, "Not enough Items in Functional Group"); +makeOFConditionConst(FG_EC_TooManyItems, OFM_dcmfg, 4, OF_error, "Too many Items in Functional Group"); +makeOFConditionConst(FG_EC_InvalidData, OFM_dcmfg, 5, OF_error, "Invalid data in Functional Group"); +makeOFConditionConst(FG_EC_CouldNotWriteFG, OFM_dcmfg, 6, OF_error, "Could not write Functional Group"); +makeOFConditionConst(FG_EC_CouldNotInsertFG, OFM_dcmfg, 7, OF_error, "Could not insert Functional Group"); +makeOFConditionConst(FG_EC_NoSharedFG, OFM_dcmfg, 8, OF_error, "No shared Functional Groups found"); +makeOFConditionConst(FG_EC_NoPerFrameFG, OFM_dcmfg, 9, OF_error, "No Per-Frame Functional Groups found"); +makeOFConditionConst(FG_EC_CouldNotCreateFG, OFM_dcmfg, 10, OF_error, "Could not create Functional Group"); +makeOFConditionConst(FG_EC_CouldNotReadSourceImage, OFM_dcmfg, 11, OF_error, "Could not read source image"); +makeOFConditionConst(FG_EC_CouldNotAddFG, OFM_dcmfg, 12, OF_error, "Could add Functional Group"); +makeOFConditionConst(FG_EC_NotEnoughFrames, OFM_dcmfg, 13, OF_error, "Not enough frames"); +makeOFConditionConst(FG_EC_NoStacksFound, OFM_dcmfg, 14, OF_error, "No stacks found"); + + +OFString DcmFGTypes::FGType2OFString(const DcmFGTypes::E_FGType fgType) +{ + switch (fgType) + { + /// Undefined functional group + case EFG_UNDEFINED: return "Undefined Functional Group Macro"; break; + /// Unknown functional group + case EFG_UNKNOWN: return "Unknown Functional Group Macro"; break; + /// Pixel Measures + case EFG_PIXELMEASURES: return "Pixel Measures Functional Group Macro"; break; + /// Frame Content + case EFG_FRAMECONTENT: return "Frame Content Functional Group Macro"; break; + /// Plane Position (Patient) + case EFG_PLANEPOSPATIENT: return "Plane Position (Patient) Functional Group Macro"; break; + /// Plane Orientation (Patient) + case EFG_PLANEORIENTPATIENT: return "Plane Orientation (Patient) Functional Group Macro"; break; + /// Derivation Image + case EFG_DERIVATIONIMAGE: return "Derivation Image Functional Group Macro"; break; + /// Cardiac Synchronization + case EFG_CARDIACSYNC: return "Cardiac Synchronization Functional Group Macro"; break; + /// Frame Anatomy + case EFG_FRAMEANATOMY: return "Frame Anatomy Functional Group Macro"; break; + /// Pixel Value Transformation or Identity Pixel Value Transformation + case EFG_PIXELVALUETRANSMETA: return "Pixel Value Transformation / Identity Pixel Value Transformation Functional Group Macro"; break; + /// Frame VOI LUT or Frame VOI LUT with LUT + case EFG_FRAMEVOILUTMETA: return "Frame VOI LUT / Frame VOI LUT with LUT Macro"; break; + /// Real World Value Mapping + case EFG_REALWORLDVALUEMAPPING: return "Real World Value Mapping Functional Group Macro"; break; + /// Contrast/Bolus Usage + case EFG_CONTRASTBOLUSUSAGE: return "Contrast/Bolus Usage Group Macro"; break; + /// Pixel Intensity Relationship LUT + case EFG_PIXELINTENSITYRELLUT: return "Pixel Intensity Relation LUT Functional Group Macro"; break; + /// Frame Pixel Shift + case EFG_FRAMEPIXELSHIFT: return "Frame Pixel Shift Functional Group Macro"; break; + /// Patient Orientation in Frame + case EFG_PATIENTORIENTINFRAME: return "Patient Orientation in Frame Functional Group Macro"; break; + /// Frame Display Shutter + case EFG_FRAMEDISPLAYSHUTTER: return "Frame Display Shutter Functional Group Macro"; break; + /// Respiratory Synchronization + case EFG_RESPIRATORYSYNC: return "Respiratory Synchronization Functional Group Macro"; break; + /// Irradiation Event Identification + case EFG_IRRADIATIONEVENTIDENT: return "Irradiation Event Identification Functional Group Macro"; break; + /// Radiopharmaceutical Usage + case EFG_RADIOPHARAMAUSAGE: return "Radiopharmaceutical Usage Functional Group Macro"; break; + /// Parametric Map Frame Type + case EFG_PARAMETRICMAPFRAMETYPE: return "Parametric Map Frame Type Functional Group Macro"; break; + /// Patient Physiological State + case EFG_PATIENTPHYSIOSTATE: return "Patient Physiological State Functional Group Macro"; break; + /// Plane Position (Volume) + case EFG_PLANEPOSITIONVOLUME: return "Plane Position (Volume) Functional Group Macro"; break; + /// Plane Orientation (Volume) + case EFG_PLANEORIENTVOLUME: return "Plane Orientation (Volume) Functional Group Macro"; break; + /// Temporal Position Macro + case EFG_TEMPORALPOSITION: return "Temporal Position Functional Group Macro"; break; + /// Image Data Type + case EFG_IMAGEDATATYPE: return "Image Data Type Functional Group Macro"; break; + /// Unassigned Shared Converted Attributes Macro + case EFG_UNASSIGNEDSHAREDCONVERTEDATTRIBUTES: return "Unassigned Shared Converted Attributes Macro"; break; + /// Segmentation Macro + case EFG_SEGMENTATION: return "Segmentation Functional Group Macro"; break; + /// US Image Description Functional Group Macro + case EFG_USIMAGEDESCRIPTION: return "US Image Description Functional Group Macro"; break; + } + return "Unknown Functional Group Macro (internal error)"; +} + + +DcmFGTypes::E_FGType DcmFGTypes::tagKey2FGType(const DcmTagKey& key) +{ + // Note: Use neat value to enum trick from Alexandrescu in order to have switch statement instead? + if (key == DCM_PixelMeasuresSequence) + return EFG_PIXELMEASURES; + else if (key == DCM_FrameContentSequence) + return EFG_FRAMECONTENT; + else if (key == DCM_PlanePositionSequence) + return EFG_PLANEPOSPATIENT; + else if (key == DCM_PlaneOrientationSequence) + return EFG_PLANEORIENTPATIENT; + else if (key == DCM_DerivationImageSequence) + return EFG_DERIVATIONIMAGE; + else if (key == DCM_CardiacSynchronizationSequence) + return EFG_CARDIACSYNC; + else if (key == DCM_FrameAnatomySequence) + return EFG_FRAMEANATOMY; + else if (key == DCM_PixelValueTransformationSequence) + return EFG_PIXELVALUETRANSMETA; + else if (key == DCM_FrameVOILUTSequence) + return EFG_FRAMEVOILUTMETA; + else if (key == DCM_RealWorldValueMappingSequence) + return EFG_REALWORLDVALUEMAPPING; + else if (key == DCM_ContrastBolusUsageSequence) + return EFG_CONTRASTBOLUSUSAGE; + else if (key == DCM_PixelIntensityRelationshipLUTSequence) + return EFG_PIXELINTENSITYRELLUT; + else if (key == DCM_FramePixelShiftSequence) + return EFG_FRAMEPIXELSHIFT; + else if (key == DCM_PatientOrientationInFrameSequence) + return EFG_PATIENTORIENTINFRAME; + else if (key == DCM_FrameDisplayShutterSequence) + return EFG_FRAMEDISPLAYSHUTTER; + else if (key == DCM_RespiratorySynchronizationSequence) + return EFG_RESPIRATORYSYNC; + else if (key == DCM_IrradiationEventIdentificationSequence) + return EFG_IRRADIATIONEVENTIDENT; + else if (key == DCM_RadiopharmaceuticalUsageSequence) + return EFG_RADIOPHARAMAUSAGE; + else if (key == DCM_PatientPhysiologicalStateSequence) + return EFG_PATIENTPHYSIOSTATE; + else if (key == DCM_ParametricMapFrameTypeSequence) + return EFG_PARAMETRICMAPFRAMETYPE; + else if (key == DCM_PlanePositionVolumeSequence) + return EFG_PLANEPOSITIONVOLUME; + else if (key == DCM_PlaneOrientationVolumeSequence) + return EFG_PLANEORIENTVOLUME; + else if (key == DCM_TemporalPositionSequence) + return EFG_TEMPORALPOSITION; + else if (key == DCM_ImageDataTypeSequence) + return EFG_IMAGEDATATYPE; + else if (key == DCM_UnassignedSharedConvertedAttributesSequence) + return EFG_UNASSIGNEDSHAREDCONVERTEDATTRIBUTES; + else if (key == DCM_SegmentIdentificationSequence) + return EFG_SEGMENTATION; + else if (key == DCM_USImageDescriptionSequence) + return EFG_USIMAGEDESCRIPTION; + else + return EFG_UNKNOWN; +} + + +OFString DcmFGTypes::tagKey2FGString(const DcmTagKey& key) +{ + E_FGType fgtype = tagKey2FGType(key); + return FGType2OFString(fgtype); +} + + diff --git a/dcmfg/libsrc/fgusimagedescription.cc b/dcmfg/libsrc/fgusimagedescription.cc new file mode 100644 index 00000000..53a3339c --- /dev/null +++ b/dcmfg/libsrc/fgusimagedescription.cc @@ -0,0 +1,211 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for managing US Image Description Functional Group + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmiod/iodtypes.h" +#include "dcmtk/dcmfg/fgusimagedescription.h" + +// Constructor +FGUSImageDescription::FGUSImageDescription() : + FGBase(DcmFGTypes::EFG_USIMAGEDESCRIPTION), + m_FrameType(DCM_FrameType), + m_VolumetricProperties(DCM_VolumetricProperties), + m_VolumeBasedCalculationTechnique(DCM_VolumeBasedCalculationTechnique) +{ +} + + +FGUSImageDescription::~FGUSImageDescription() +{ + // nothing to do +} + + +FGBase* FGUSImageDescription::clone() const +{ + FGUSImageDescription* copy = new FGUSImageDescription(); + if (copy) + { + copy->m_FrameType = this->m_FrameType; + copy->m_VolumetricProperties = this->m_VolumetricProperties; + copy->m_VolumeBasedCalculationTechnique = this->m_VolumeBasedCalculationTechnique; + } + return copy; +} + + +void FGUSImageDescription::clearData() +{ + m_FrameType.clear(); + m_VolumetricProperties.clear(); + m_VolumeBasedCalculationTechnique.clear(); +} + + +OFCondition FGUSImageDescription::check() const +{ + // Checks in read() and write() are sufficient for now + return EC_Normal; +} + + +// --- get() functionality --- + +OFCondition FGUSImageDescription::getFrameType(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromElement(m_FrameType, value, pos); +} + + +OFCondition FGUSImageDescription::getVolumetricProperties(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromElement(m_VolumetricProperties, value, pos); +} + + +OFCondition FGUSImageDescription::getVolumeBasedCalculationTechnique(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromElement(m_VolumeBasedCalculationTechnique, value, pos); +} + + +// --- set() functionality --- + + +OFCondition FGUSImageDescription::setFrameType(const DcmFGTypes::E_FGUSFrameType pixelDataChar, + const OFString& imageFlavor, + const OFString& derivedPixelContrast, + const OFBool checkValue) +{ + // Build a string of VM 4 with first two values at least set + OFString value; + switch (pixelDataChar) + { + case(DcmFGTypes::EFGFT_ORIGINAL): value = "ORIGINAL\\PRIMARY\\"; break; + case(DcmFGTypes::EFGFT_DERIVED) : value = "DERIVED\\PRIMARY\\"; break; + default: return IOD_EC_InvalidElementValue; + } + value += imageFlavor; + value += "\\"; + value += derivedPixelContrast; + + OFCondition result; + if (checkValue) + { + result = DcmCodeString::checkStringValue(value, "4"); + } + if (result.good()) + { + result = m_FrameType.putOFStringArray(value); + } + return result; +} + + +OFCondition FGUSImageDescription::setVolumetricProperties(const OFString& value, + const OFBool checkValue) +{ + OFCondition result; + if (checkValue) + { + if ( (value != "VOLUME") && (value != "SAMPLED") && (value != "DISTORTED") && (value != "MIXED") ) + { + result = IOD_EC_InvalidElementValue; + } + else + result = DcmCodeString::checkStringValue(value, "1"); + } + if (result.good()) + { + result = m_VolumetricProperties.putOFStringArray(value); + } + return result; +} + + +OFCondition FGUSImageDescription::setVolumeBasedCalculationTechnique(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_VolumeBasedCalculationTechnique.putOFStringArray(value); + return result; +} + + +/// Read Frame Content Sequence from given item +OFCondition FGUSImageDescription::read(DcmItem& item) +{ + clearData(); + + DcmItem* seqItem = NULL; + OFCondition result = getItemFromFGSequence(item, DCM_USImageDescriptionSequence, 0, seqItem); + if (result.bad()) + return result; + + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_FrameType, "4", "1", "USImageDescriptionMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_VolumetricProperties, "1", "1", "USImageDescriptionMacro"); + DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_VolumeBasedCalculationTechnique, "1", "1", "USImageDescriptionMacro"); + return result; +} + + +/// Writes single Frame Content Sequence into given item +OFCondition FGUSImageDescription::write(DcmItem& item) +{ + DcmItem *seqItem = NULL; + OFCondition result = createNewFGSequence(item, DCM_USImageDescriptionSequence, 0, seqItem); + if (result.bad()) + return result; + + // --- write frame content macro attributes --- + DcmIODUtil::copyElementToDataset(result, *seqItem, m_FrameType, "4", "1", "USImageDescriptionMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_VolumetricProperties, "1", "1", "USImageDescriptionMacro"); + DcmIODUtil::copyElementToDataset(result, *seqItem, m_VolumeBasedCalculationTechnique, "1", "1", "USImageDescriptionMacro"); + + return result; +} + + +int FGUSImageDescription::compare(const FGBase& rhs) const +{ + int result = FGBase::compare(rhs); + if (result != 0) + return result; + + const FGUSImageDescription* myRhs = OFstatic_cast(const FGUSImageDescription*, &rhs); + if (!myRhs) + return -1; + + // Compare all elements + result = m_FrameType.compare(myRhs->m_FrameType); + if (result == 0) + result = m_VolumetricProperties.compare(myRhs->m_VolumetricProperties); + if (result == 0) + result = m_VolumeBasedCalculationTechnique.compare(myRhs->m_VolumeBasedCalculationTechnique); + + return result; +} diff --git a/dcmfg/libsrc/stack.cc b/dcmfg/libsrc/stack.cc new file mode 100644 index 00000000..d59f1f4d --- /dev/null +++ b/dcmfg/libsrc/stack.cc @@ -0,0 +1,107 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class representing a stack in the context of Enhanced multiframe + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/stack.h" + + +FGStack::FGStack(const OFString& stackID, + const OFMap< Uint32, Uint32 > frameNumbers) +: m_StackID(stackID), + m_FrameNumbers(frameNumbers) +{ + +} + +FGStack::FGStack(const OFString& stackID) +: m_StackID(stackID), + m_FrameNumbers() +{ + +} + +OFBool FGStack::addFrame(const Uint32 frameNumber, + const Uint32 inStackPos) +{ + m_FrameNumbers.insert(OFMake_pair(frameNumber, inStackPos)); + return OFTrue; +} + + +FGStack::~FGStack() +{ + +} + + +FGStack::const_iterator FGStack::begin() const +{ + return m_FrameNumbers.begin(); +} + + +FGStack::iterator FGStack::begin() +{ + return m_FrameNumbers.begin(); +} + + +FGStack::const_iterator FGStack::end() const +{ + return m_FrameNumbers.end(); +} + + +FGStack::iterator FGStack::end() +{ + return m_FrameNumbers.end(); +} + + +OFString FGStack::getStackID() const +{ + return m_StackID; +} + + +Uint32 FGStack::getInStackPos(const Uint32 frameNumber) const +{ + FGStack::const_iterator it = m_FrameNumbers.find(frameNumber); + if (it == m_FrameNumbers.end()) + return 0; + else + return (*it).second; +} + + +void FGStack::getFramesAtStackPos(const Uint32 inStackPos, + OFVector& resultFrameNumbers) +{ + FGStack::iterator it = m_FrameNumbers.begin(); + while (it != m_FrameNumbers.end()) + { + if ((*it).second == inStackPos) + { + resultFrameNumbers.push_back( (*it).second); + } + it++; + } +} diff --git a/dcmfg/libsrc/stackinterface.cc b/dcmfg/libsrc/stackinterface.cc new file mode 100644 index 00000000..c9e0c32a --- /dev/null +++ b/dcmfg/libsrc/stackinterface.cc @@ -0,0 +1,275 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Class for reading, accessing and writing stacks + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/stackinterface.h" +#include "dcmtk/dcmfg/fgfracon.h" + + +FGStackInterface::FGStackInterface() +: m_Stacks() +{ +} + + +FGStackInterface::~FGStackInterface() +{ + while (m_Stacks.size() != 0) + { + OFMap::iterator it = m_Stacks.begin(); + FGStack *toDelete = (*it).second; + m_Stacks.erase(it); + delete toDelete; + } +} + + +void FGStackInterface::clear() +{ + size_t stackSize = m_Stacks.size(); + OFMap::iterator it; + for (size_t count = 0; count < stackSize; count++) + { + it = m_Stacks.begin(); + m_Stacks.erase(it); + } +} + + +OFCondition FGStackInterface::read(FGInterface& fgSource) +{ + clear(); + size_t numFrames = fgSource.getNumberOfFrames(); + for (size_t count = 0; count < numFrames; count++) + { + // Get frame content FG if existing + FGFrameContent* fracon = OFstatic_cast(FGFrameContent*, fgSource.get(OFstatic_cast(Uint32, count), DcmFGTypes::EFG_FRAMECONTENT)); + if (fracon != NULL) + { + OFString stackID; + Uint32 inStackPos; + // Check whether stack ID is actually present and get value + if ( (fracon->getStackID(stackID).good()) && (fracon->getInStackPositionNumber(inStackPos).good()) ) + { + // Check whether this is a stack ID we do not know yet + OFMap::iterator it = m_Stacks.begin(); + while (it != m_Stacks.end()) + { + // If this is an old stack, add frame to it + if ( (*it).second->getStackID() == stackID) + { + // Add frame to stack if it is not in yet + if ( (*it).second->getInStackPos(OFstatic_cast(Uint32, count)) == 0) + { + (*it).second->addFrame(OFstatic_cast(Uint32, count), inStackPos); + } + } + it++; + } + // If this is a new stack, add it to the list + if (it == m_Stacks.end()) + { + FGStack *stack = new FGStack(stackID); + if (stack == NULL) + { + return EC_MemoryExhausted; + } + stack->addFrame(OFstatic_cast(Uint32, count), inStackPos); + if ( !m_Stacks.insert(OFMake_pair(stack->getStackID(), stack)).second ) + { + delete stack; + DCMFG_ERROR("Could not add stack to internal list (internal error, ignored)"); + } + } + } + else + { + DCMFG_WARN("Reading stacks but Frame " << count << " does not provide Stack ID or In-Stack Position"); + } + } + else + { + DCMFG_WARN("Reading stacks but Frame " << count << " does not provide a Frame Content functional group"); + } + } + + if (m_Stacks.size() == 0) + { + return FG_EC_NoStacksFound; + } + + return EC_Normal; +} + + +OFCondition FGStackInterface::write(FGInterface& fgDestination) +{ + size_t numFrames = fgDestination.getNumberOfFrames(); + if (numFrames == 0) + { + return FG_EC_NotEnoughFrames; + } + + // Check whether maximum in-stack position does not exceed number of frames in image + if (!checkConsistency(&fgDestination)) + { + return FG_EC_InvalidData; + } + + // Walk through stacks, and for each, add/overwrite stack information to + // the respective Frame Content functional groups + OFCondition result; + OFMap::iterator stack = m_Stacks.begin(); + while (result.good() && (stack != m_Stacks.end()) ) + { + OFString stackID = (*stack).second->getStackID(); + // Walk over all referenced frames and add Stack information + OFMap::const_iterator stackEntry = (*stack).second->begin(); + while (stackEntry != (*stack).second->end()) + { + Uint32 frameNo = (*stackEntry).first; + Uint32 inStackPos = (*stackEntry).second; + FGFrameContent* fg = ensureFrameContentFG(frameNo, fgDestination); + // Create functional group if not already existing + if (fg == NULL) + { + result = FG_EC_CouldNotAddFG; + } + if (result.good()) result = fg->setStackID(stackID); + if (result.good()) result = fg->setInStackPositionNumber(inStackPos+1 /* vector counts from 0, position in DICOM starts with 1 */); + if (result.bad()) + { + DCMFG_ERROR("Could not create or add stack with ID " << stackID << " to frame " << frameNo << ": " << result.text()); + } + stackEntry++; + } + stack++; + } + return result; +} + + +FGFrameContent* FGStackInterface::ensureFrameContentFG(const Uint32 frameNo, + FGInterface& fg) +{ + FGFrameContent* content = OFstatic_cast(FGFrameContent*, fg.get(frameNo, DcmFGTypes::EFG_FRAMECONTENT)); + if (!content) + { + FGFrameContent newContent; + OFCondition result = fg.addPerFrame(frameNo, newContent); + if (result.bad()) + { + DCMFG_ERROR("Could not add Frame Content FG for frame " << frameNo); + } + else + { + content = OFstatic_cast(FGFrameContent*, fg.get(frameNo, DcmFGTypes::EFG_FRAMECONTENT)); + } + } + return content; +} + + +OFBool FGStackInterface::addStack(FGStack* stack) +{ + if (stack == NULL) + return OFFalse; + + if (stack->getStackID().empty()) + { + DCMFG_ERROR("Stack ID cannot be empty"); + return OFFalse; + } + + return m_Stacks.insert(OFMake_pair(stack->getStackID(), stack)).second; +} + + +size_t FGStackInterface::numStacks() const +{ + return m_Stacks.size(); +} + + +OFBool FGStackInterface::checkConsistency(FGInterface* fgContext) +{ + size_t errors = 0; + size_t count = 0; + // Run over stacks and check whether each has a Stack ID. + // Also check whether stacks can be valid in the context + // of the given functional groups (e.g. frame range ok) + OFMap::iterator it = m_Stacks.begin(); + while (it != m_Stacks.end()) + { + if ( (*it).second->getStackID().empty()) + { + errors++; + DCMFG_ERROR("Stack ID for stack #" << count << " is empty"); + } + if (fgContext) + { + errors += checkContext((*it).second, fgContext); + } + it++; + count++; + } + return (errors == 0); +} + + +size_t FGStackInterface::checkContext(FGStack* stack, + FGInterface* context) +{ + // Must be non-empty + if ( !stack || !context) + return 1; + + // Check whether we have any frames + size_t numFrames = context->getNumberOfFrames(); + if (numFrames == 0) + { + DCMFG_ERROR("Cannot have stacks without frames"); + return 1; + } + + // Walk over frames in stack and check that frame number and + // in-stack position is in range with the number of available frames + size_t errors = 0; + const OFMap& frames = stack->m_FrameNumbers; + FGStack::const_iterator it = frames.begin(); + for (size_t count = 0; count < numFrames; count++) + { + // Frame number must be in range + if ( (*it).first > numFrames ) + { + DCMFG_ERROR("Stack references frame #" << (*it).first << " but only #" << numFrames << " frames exist"); + errors++; + } + if ( (*it).second> numFrames ) + { + DCMFG_ERROR("Stack references in-stack position #" << (*it).first << " but only #" << numFrames << " frames exist"); + errors++; + } + } + return errors; +} + diff --git a/dcmfg/tests/CMakeLists.txt b/dcmfg/tests/CMakeLists.txt new file mode 100644 index 00000000..7407bd0b --- /dev/null +++ b/dcmfg/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +# declare executables +DCMTK_ADD_EXECUTABLE(dcmfg_tests tests t_deriv_image.cc t_frame_content.cc) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(dcmfg_tests dcmfg dcmdata oflog ofstd) + +# This macro parses tests.cc and registers all tests +DCMTK_ADD_TESTS(dcmfg) diff --git a/dcmfg/tests/Makefile.dep b/dcmfg/tests/Makefile.dep new file mode 100644 index 00000000..8dcc7db6 --- /dev/null +++ b/dcmfg/tests/Makefile.dep @@ -0,0 +1,307 @@ +t_deriv_image.o: t_deriv_image.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgderimg.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fginterface.h \ + ../include/dcmtk/dcmfg/fg.h ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +t_frame_content.o: t_frame_content.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmfg/fgfracon.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmfg/fgbase.h ../include/dcmtk/dcmfg/fgtypes.h \ + ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fginterface.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmfg/fg.h ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h diff --git a/dcmfg/tests/Makefile.in b/dcmfg/tests/Makefile.in new file mode 100644 index 00000000..4f6c0763 --- /dev/null +++ b/dcmfg/tests/Makefile.in @@ -0,0 +1,58 @@ +# +# Makefile for dcmfg/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmioddir = $(top_srcdir)/../dcmiod + +LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc \ + -L$(dcmdatadir)/libsrc -L$(dcmioddir)/libsrc +LOCALLIBS = -ldcmfg -ldcmiod -ldcmdata -loflog -lofstd $(ZLIBLIBS) \ + $(CHARCONVLIBS) $(MATHLIBS) +LOCALINCLUDES = -I$(top_srcdir)/include -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmioddir)/include \ + +test_objs = tests.o t_deriv_image.o t_frame_content.o +objs = $(test_objs) +progs = tests + + +all: $(progs) + +tests: $(test_objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $(test_objs) $(LOCALLIBS) $(LIBS) + + +check: tests + ./tests + +check-exhaustive: tests + ./tests -x + + +install: all + + +clean: + rm -f $(objs) $(progs) $(LOCALTRASH) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(LOCALTRASH) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmfg/tests/t_deriv_image.cc b/dcmfg/tests/t_deriv_image.cc new file mode 100644 index 00000000..f3147502 --- /dev/null +++ b/dcmfg/tests/t_deriv_image.cc @@ -0,0 +1,164 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Tests for Derivation Image FG class + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmfg/fgderimg.h" +#include "dcmtk/dcmfg/fginterface.h" +#include "dcmtk/ofstd/oftest.h" + +static void init_template(OFString& fg_dump) +{ + fg_dump = "(fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n"; + fg_dump += "(0008,9124) SQ (Sequence with explicit length #=1) # 0, 1 DerivationImageSequence\n"; + fg_dump += " (fffe,e000) na (Item with explicit length #=3) # 0, 1 Item\n"; + fg_dump += " (0008,2111) ST [Some Description] # 16, 1 DerivationDescription\n"; + fg_dump += " (0008,2112) SQ (Sequence with explicit length #=1) # 0, 1 SourceImageSequence\n"; + fg_dump += " (fffe,e000) na (Item with explicit length #=5) # 0, 1 Item\n"; + fg_dump += " (0008,1150) UI =CTImageStorage # 26, 1 ReferencedSOPClassUID\n"; + fg_dump += " (0008,1155) UI [1.2.3.4] # 8, 1 ReferencedSOPInstanceUID\n"; + fg_dump += " (0008,1160) IS [1\\2] # 4, 2 ReferencedFrameNumber\n"; + fg_dump + += " (0040,a170) SQ (Sequence with explicit length #=1) # 0, 1 PurposeOfReferenceCodeSequence\n"; + fg_dump += " (fffe,e000) na (Item with explicit length #=3) # 0, 1 Item\n"; + fg_dump += " (0008,0100) SH [PURPOSE CODE] # 12, 1 CodeValue\n"; + fg_dump += " (0008,0102) SH [99DCMFG] # 8, 1 CodingSchemeDesignator\n"; + fg_dump += " (0008,0104) LO [Code Meaning Purpose] # 20, 1 CodeMeaning\n"; + fg_dump += " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n"; + fg_dump += " (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n"; + fg_dump += " (0062,000b) US 3\\4 # 4, 2 ReferencedSegmentNumber\n"; + fg_dump += " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n"; + fg_dump += " (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n"; + fg_dump += " (0008,9215) SQ (Sequence with explicit length #=1) # 0, 1 DerivationCodeSequence\n"; + fg_dump += " (fffe,e000) na (Item with explicit length #=3) # 0, 1 Item\n"; + fg_dump += " (0008,0100) SH [CODE_VALUE] # 10, 1 CodeValue\n"; + fg_dump += " (0008,0102) SH [99DCMFG] # 8, 1 CodingSchemeDesignator\n"; + fg_dump += " (0008,0104) LO [Code Meaning Derivation Description] # 36, 1 CodeMeaning\n"; + fg_dump += " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n"; + fg_dump += " (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n"; + fg_dump += " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n"; + fg_dump += "(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n"; + fg_dump += "(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n"; +} + +static void check_deriv_image_fg(FGDerivationImage& fg) +{ + OFVector deriv_img_items = fg.getDerivationImageItems(); + OFCHECK(deriv_img_items.size() == 1); + if (deriv_img_items.size() == 0) return; + OFVector& deriv_code_items = deriv_img_items[0]->getDerivationCodeItems(); + OFCHECK(deriv_code_items.size() == 1); + if (deriv_code_items.size() == 0) return; + CodeSequenceMacro* code_item = deriv_code_items[0]; + OFString str; + code_item->getCodeValue(str); + OFCHECK(str == "CODE_VALUE"); + code_item->getCodingSchemeDesignator(str); + OFCHECK(str == "99DCMFG"); + code_item->getCodeMeaning(str); + OFCHECK(str == "Code Meaning Derivation Description"); + + DerivationImageItem* deriv_item = deriv_img_items[0]; + OFCHECK(deriv_item->getSourceImageItems().size() == 1); + OFVector numbers; + deriv_item->getSourceImageItems()[0]->getImageSOPInstanceReference().getReferencedFrameNumber(numbers); + OFCHECK(numbers.size() == 2); + OFCHECK(numbers[0] == 1); + OFCHECK(numbers[1] == 2); + numbers.clear(); + deriv_item->getSourceImageItems()[0]->getImageSOPInstanceReference().getReferencedSegmentNumber(numbers); + OFCHECK(numbers.size() == 2); + OFCHECK(numbers[0] == 3); + OFCHECK(numbers[1] == 4); + deriv_item->getSourceImageItems()[0]->getImageSOPInstanceReference().getReferencedSOPClassUID(str); + OFCHECK(str == UID_CTImageStorage); + deriv_item->getSourceImageItems()[0]->getImageSOPInstanceReference().getReferencedSOPInstanceUID(str); + OFCHECK(str == "1.2.3.4"); + CodeSequenceMacro& code = deriv_item->getSourceImageItems()[0]->getPurposeOfReferenceCode(); + code.getCodeValue(str); + OFCHECK(str == "PURPOSE CODE"); + code.getCodingSchemeDesignator(str); + OFCHECK(str == "99DCMFG"); + code.getCodeMeaning(str); + OFCHECK(str == "Code Meaning Purpose"); +} + +OFTEST(dcmfg_derivation_image) +{ + OFString fg_dump; + init_template(fg_dump); + + FGDerivationImage fg; + CodeSequenceMacro deriv_code("CODE_VALUE", "99DCMFG", "Code Meaning Derivation Description"); + DerivationImageItem* deriv_item = NULL; + OFCondition result = fg.addDerivationImageItem(deriv_code, "Some Description", deriv_item); + OFCHECK(result.good()); + OFCHECK(deriv_item != NULL); + if (result.bad() || !deriv_item) return; + + SourceImageItem* src_image_item = new SourceImageItem(); + OFCHECK(src_image_item != NULL); + if (!deriv_item) return; + OFCHECK(src_image_item->getImageSOPInstanceReference().addReferencedFrameNumber(1).good()); + OFCHECK(src_image_item->getImageSOPInstanceReference().addReferencedFrameNumber(2).good()); + OFCHECK(src_image_item->getImageSOPInstanceReference().addReferencedSegmentNumber(3).good()); + OFCHECK(src_image_item->getImageSOPInstanceReference().addReferencedSegmentNumber(4).good()); + OFCHECK(src_image_item->getImageSOPInstanceReference().setReferencedSOPInstanceUID("1.2.3.4").good()); + OFCHECK(src_image_item->getImageSOPInstanceReference().setReferencedSOPClassUID(UID_CTImageStorage).good()); + OFCHECK(src_image_item->getPurposeOfReferenceCode().set("PURPOSE CODE", "99DCMFG", "Code Meaning Purpose").good()); + + OFVector& src_image_items = deriv_item->getSourceImageItems(); + src_image_items.push_back(src_image_item); + + // Check data structure in memory + check_deriv_image_fg(fg); + + // Write to DcmItem and compare with pre-defined template + DcmItem dest_item; + result = fg.write(dest_item); + OFCHECK(result.good()); + OFStringStream out; + dest_item.print(out); + OFCHECK(out.str() == fg_dump.c_str()); + + // Test read method: Read from dataset, write again, and compare another time + FGDerivationImage fg_for_read; + out.str(""); // set to empty + fg_for_read.read(dest_item); + dest_item.clear(); + result = fg_for_read.write(dest_item); + OFCHECK(result.good()); + if (result.bad()) return; + dest_item.print(out); + OFCHECK(out.str() == fg_dump.c_str()); + + // Test compare() method + OFCHECK(fg.compare(fg_for_read) == 0); + fg_for_read.getDerivationImageItems()[0]->setDerivationDescription("Another Description"); + OFCHECK(fg.compare(fg_for_read) != 0); + + // Test clone() method + FGDerivationImage* clone = OFstatic_cast(FGDerivationImage*, fg.clone()); + OFCHECK(clone != NULL); + if (clone == NULL) return; + OFCHECK(clone->compare(fg) == 0); + delete clone; +} diff --git a/dcmfg/tests/t_frame_content.cc b/dcmfg/tests/t_frame_content.cc new file mode 100644 index 00000000..ebd87093 --- /dev/null +++ b/dcmfg/tests/t_frame_content.cc @@ -0,0 +1,137 @@ +/* + * + * Copyright (C) 2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: Tests for Frame Content FG class + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmfg/fgfracon.h" +#include "dcmtk/dcmfg/fginterface.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/ofstd/oftest.h" + +static void init_template(OFString& fg_dump) +{ + fg_dump += "(fffe,e000) na (Item with explicit length #=1) # 0, 1 Item\n"; + fg_dump += "(0020,9111) SQ (Sequence with explicit length #=1) # 0, 1 FrameContentSequence\n"; + fg_dump += " (fffe,e000) na (Item with explicit length #=12) # 0, 1 Item\n"; + fg_dump += " (0018,9074) DT [20190508214701] # 14, 1 FrameAcquisitionDateTime\n"; + fg_dump += " (0018,9151) DT [20190508214701] # 14, 1 FrameReferenceDateTime\n"; + fg_dump += " (0018,9214) CS [START_RESPIR] # 12, 1 RespiratoryCyclePosition\n"; + fg_dump += " (0018,9220) FD 500.5 # 8, 1 FrameAcquisitionDuration\n"; + fg_dump += " (0018,9236) CS [END_SYSTOLE] # 12, 1 CardiacCyclePosition\n"; + fg_dump += " (0020,9056) SH [1] # 2, 1 StackID\n"; + fg_dump += " (0020,9057) UL 3 # 4, 1 InStackPositionNumber\n"; + fg_dump += " (0020,9128) UL 4 # 4, 1 TemporalPositionIndex\n"; + fg_dump += " (0020,9156) US 2 # 2, 1 FrameAcquisitionNumber\n"; + fg_dump += " (0020,9157) UL 1 # 4, 1 DimensionIndexValues\n"; + fg_dump += " (0020,9158) LT [Comments] # 8, 1 FrameComments\n"; + fg_dump += " (0020,9453) LO [LABEL] # 6, 1 FrameLabel\n"; + fg_dump += " (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n"; + fg_dump += "(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem\n"; + fg_dump += "(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem\n"; +} + +static void check_frame_content_fg(FGFrameContent& fg) +{ + OFCondition result; + OFString val; + OFCHECK(fg.getCardiacCyclePosition(val).good()); + OFCHECK(val == "END_SYSTOLE"); + Uint32 uint32 = 0; + OFCHECK(fg.getDimensionIndexValues(uint32).good()); + OFCHECK(uint32 == 1); + OFCHECK(fg.getFrameAcquisitionDateTime(val).good()); + OFCHECK(val == "20190508214701"); + Float64 float64 = 0.0; + OFCHECK(fg.getFrameAcquisitionDuration(float64).good()); + OFCHECK(float64 == 500.50); + Uint16 uint16 = 0; + fg.getFrameAcquisitionNumber(uint16); + OFCHECK(fg.getFrameAcquisitionNumber(uint16).good()); + OFCHECK(uint16 == 2); + OFCHECK(fg.getFrameComments(val).good()); + OFCHECK(val == "Comments"); + OFCHECK(fg.getFrameLabel(val).good()); + OFCHECK(val == "LABEL"); + OFCHECK(fg.getFrameReferenceDateTime(val).good()); + OFCHECK(val == "20190508214701"); + OFCHECK(fg.getInStackPositionNumber(uint32).good()); + OFCHECK(uint32 == 3); + OFCHECK(fg.getRespiratoryCyclePosition(val).good()); + OFCHECK(val == "START_RESPIR"); + OFCHECK(fg.getStackID(val).good()); + OFCHECK(val == "1"); + OFCHECK(fg.getTemporalPositionIndex(uint32).good()); + OFCHECK(uint32 == 4); +} + +OFTEST(dcmfg_frame_content) +{ + OFString fg_dump; + init_template(fg_dump); + + FGFrameContent fg; + OFCHECK(fg.setCardiacCyclePosition("END_SYSTOLE").good()); + OFCHECK(fg.setDimensionIndexValues(1, 0).good()); + OFCHECK(fg.setFrameAcquisitionDateTime("20190508214701").good()); + OFCHECK(fg.setFrameAcquisitionDuration(500.50).good()); + OFCHECK(fg.setFrameAcquisitionNumber(2).good()); + OFCHECK(fg.setFrameComments("Comments").good()); + OFCHECK(fg.setFrameLabel("LABEL").good()); + OFCHECK(fg.setFrameReferenceDateTime("20190508214701").good()); + OFCHECK(fg.setInStackPositionNumber(3).good()); + OFCHECK(fg.setRespiratoryCyclePosition("START_RESPIR").good()); + OFCHECK(fg.setStackID("1").good()); + OFCHECK(fg.setTemporalPositionIndex(4).good()); + + // Check data structure in memory + check_frame_content_fg(fg); + + // Write to DcmItem and compare with pre-defined template + DcmItem dest_item; + OFCondition result = fg.write(dest_item); + OFCHECK(result.good()); + OFStringStream out; + dest_item.print(out); + OFCHECK(out.str() == fg_dump.c_str()); /**/ + + // Test read method: Read from dataset, write again, and compare another time + FGFrameContent fg_for_read; + out.str(""); // set to empty + fg_for_read.read(dest_item); + dest_item.clear(); + result = fg_for_read.write(dest_item); + OFCHECK(result.good()); + if (result.bad()) return; + dest_item.print(out); + OFCHECK(out.str() == fg_dump.c_str()); + + // Test compare() method + OFCHECK(fg.compare(fg_for_read) == 0); + fg_for_read.setFrameComments("Another Comment"); + OFCHECK(fg.compare(fg_for_read) != 0); + + // Test clone() method + FGFrameContent* clone = OFstatic_cast(FGFrameContent*, fg.clone()); + OFCHECK(clone != NULL); + if (clone == NULL) return; + OFCHECK(clone->compare(fg) == 0); + delete clone; +} diff --git a/dcmfg/tests/tests.cc b/dcmfg/tests/tests.cc new file mode 100644 index 00000000..af66e545 --- /dev/null +++ b/dcmfg/tests/tests.cc @@ -0,0 +1,27 @@ +/* + * + * Copyright (C) 2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmfg + * + * Author: Michael Onken + * + * Purpose: main test program + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftest.h" + +OFTEST_REGISTER(dcmfg_derivation_image); +OFTEST_REGISTER(dcmfg_frame_content); +OFTEST_MAIN("dcmfg") diff --git a/dcmimage/CMakeLists.txt b/dcmimage/CMakeLists.txt new file mode 100644 index 00000000..7a90faff --- /dev/null +++ b/dcmimage/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmimage) + +# declare include directories which hold for all subdirectories +include_directories("${dcmimage_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc apps include) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmimage/Makefile.in b/dcmimage/Makefile.in new file mode 100644 index 00000000..27206e96 --- /dev/null +++ b/dcmimage/Makefile.in @@ -0,0 +1,97 @@ +# +# Makefile for dcmimage +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) +# (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmimage/apps/CMakeLists.txt b/dcmimage/apps/CMakeLists.txt new file mode 100644 index 00000000..77b88b77 --- /dev/null +++ b/dcmimage/apps/CMakeLists.txt @@ -0,0 +1,9 @@ +# declare executables +foreach(PROGRAM dcm2pnm dcmquant dcmscale dcmicmp) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcm2pnm dcmquant dcmscale dcmicmp) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmimage dcmimgle dcmdata oflog ofstd) +endforeach() diff --git a/dcmimage/apps/Makefile.dep b/dcmimage/apps/Makefile.dep new file mode 100644 index 00000000..8a68266d --- /dev/null +++ b/dcmimage/apps/Makefile.dep @@ -0,0 +1,553 @@ +dcm2pnm.o: dcm2pnm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcrledrg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/digsdfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diciefn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dicielut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didislut.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmimage/dipitiff.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../include/dcmtk/dcmimage/dipipng.h +dcmicmp.o: dcmicmp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/dcmicmph.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h +dcmquant.o: dcmquant.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../include/dcmtk/dcmimage/dicdefin.h ../include/dcmtk/dcmimage/diquant.h \ + ../include/dcmtk/dcmimage/diqttype.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h +dcmscale.o: dcmscale.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcrledrg.h diff --git a/dcmimage/apps/Makefile.in b/dcmimage/apps/Makefile.in new file mode 100644 index 00000000..759b8a26 --- /dev/null +++ b/dcmimage/apps/Makefile.in @@ -0,0 +1,63 @@ +# +# Makefile for dcmimage/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmimgledir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc \ + -L$(dcmdatadir)/libsrc -L$(dcmimgledir)/libsrc +LOCALLIBS = -ldcmimage -ldcmimgle -ldcmdata -loflog -lofstd $(TIFFLIBS) $(PNGLIBS) \ + $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +objs = dcm2pnm.o dcmquant.o dcmscale.o dcmicmp.o +progs = dcm2pnm dcmquant dcmscale dcmicmp + + +all: $(progs) + +dcm2pnm: dcm2pnm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmquant: dcmquant.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmscale: dcmscale.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmicmp: dcmicmp.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmimage/apps/dcm2pnm.cc b/dcmimage/apps/dcm2pnm.cc new file mode 100644 index 00000000..4fa8482c --- /dev/null +++ b/dcmimage/apps/dcm2pnm.cc @@ -0,0 +1,1546 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Authors: Marco Eichelberg, Joerg Riesmeier + * + * Purpose: Convert DICOM Images to PPM or PGM using the dcmimage library. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" /* for various dcmdata headers */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcrledrg.h" /* for DcmRLEDecoderRegistration */ + +#include "dcmtk/dcmimgle/dcmimage.h" /* for DicomImage */ +#include "dcmtk/dcmimgle/digsdfn.h" /* for DiGSDFunction */ +#include "dcmtk/dcmimgle/diciefn.h" /* for DiCIELABFunction */ + +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/ofstd/ofcmdln.h" /* for OFCommandLine */ + +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ +#include "dcmtk/ofstd/ofstd.h" /* for OFStandard */ + +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM +#include "dcmtk/dcmjpeg/djdecode.h" /* for dcmjpeg decoders */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ +#endif + +#ifdef BUILD_DCM2PNM_AS_DCML2PNM +#include "dcmtk/dcmjpls/djdecode.h" /* for dcmjpls decoders */ +#endif + +#ifdef WITH_LIBTIFF +#include "dcmtk/dcmimage/dipitiff.h" /* for dcmimage TIFF plugin */ +#endif + +#ifdef WITH_LIBPNG +#include "dcmtk/dcmimage/dipipng.h" /* for dcmimage PNG plugin */ +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/oflog/oflog.h" + +#define OFFIS_OUTFILE_DESCRIPTION "output filename to be written (default: stdout)" + +#ifdef BUILD_DCM2PNM_AS_DCML2PNM +# define OFFIS_CONSOLE_APPLICATION "dcml2pnm" +#elif defined(BUILD_DCM2PNM_AS_DCMJ2PNM) +# define OFFIS_CONSOLE_APPLICATION "dcmj2pnm" +#else +# define OFFIS_CONSOLE_APPLICATION "dcm2pnm" +#endif + +static OFLogger dcm2pnmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static const char *consoleDescription = "Convert DICOM images to PGM/PPM" +#ifdef WITH_LIBPNG + ", PNG" +#endif +#ifdef WITH_LIBTIFF + ", TIFF" +#endif +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + ", JPEG" +#endif + " or BMP"; + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define SHORTCOL 4 +#define LONGCOL 20 + +/* output file types */ +enum E_FileType +{ + EFT_RawPNM, + EFT_8bitPNM, + EFT_16bitPNM, + EFT_NbitPNM, + EFT_BMP, + EFT_8bitBMP, + EFT_24bitBMP, + EFT_32bitBMP, + EFT_JPEG, + EFT_TIFF, + EFT_PNG, + EFT_16bitPNG +#ifdef PASTEL_COLOR_OUTPUT + ,EFT_PastelPNM +#endif +}; + + +// ******************************************** + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, consoleDescription, rcsid); + OFCommandLine cmd; + + E_FileReadMode opt_readMode = ERM_autoDetect; /* default: fileformat or dataset */ + E_TransferSyntax opt_transferSyntax = EXS_Unknown; /* default: xfer syntax recognition */ + + unsigned long opt_compatibilityMode = CIF_MayDetachPixelData | CIF_TakeOverExternalDataset; + OFBool opt_ignoreVoiLutDepth = OFFalse; /* default: do not ignore VOI LUT bit depth */ + OFCmdUnsignedInt opt_frame = 1; /* default: first frame */ + OFCmdUnsignedInt opt_frameCount = 1; /* default: one frame */ + OFBool opt_useFrameNumber = OFFalse; /* default: use frame counter */ + OFBool opt_multiFrame = OFFalse; /* default: no multiframes */ + int opt_convertToGrayscale = 0; /* default: color or grayscale */ + int opt_changePolarity = 0; /* default: normal polarity */ + int opt_useAspectRatio = 1; /* default: use aspect ratio for scaling */ + OFCmdUnsignedInt opt_useInterpolation = 1; /* default: use interpolation method '1' for scaling */ + int opt_useClip = 0; /* default: don't clip */ + OFCmdSignedInt opt_left = 0, opt_top = 0; /* clip region (origin) */ + OFCmdUnsignedInt opt_width = 0, opt_height = 0; /* clip region (extension) */ + int opt_rotateDegree = 0; /* default: no rotation */ + int opt_flipType = 0; /* default: no flipping */ + int opt_scaleType = 0; /* default: no scaling */ + /* 1 = X-factor, 2 = Y-factor, 3=X-size, 4=Y-size */ + OFCmdFloat opt_scale_factor = 1.0; + OFCmdUnsignedInt opt_scale_size = 1; + int opt_windowType = 0; /* default: no windowing */ + /* 1=Wi, 2=Wl, 3=Wm, 4=Wh, 5=Ww, 6=Wn, 7=Wr */ + OFCmdUnsignedInt opt_windowParameter = 0; + OFCmdUnsignedInt opt_roiLeft = 0, opt_roiTop = 0, opt_roiWidth = 0, opt_roiHeight = 0; + OFCmdFloat opt_windowCenter = 0.0, opt_windowWidth = 0.0; + + EF_VoiLutFunction opt_voiFunction = EFV_Default; + ES_PresentationLut opt_presShape = ESP_Default; + OFString opt_displayFile; + int opt_displayFunction = 0; /* default: GSDF */ + /* 0=GSDF, 1=CIELAB */ + OFCmdFloat opt_ambientLight = -1; /* default: not set */ + OFCmdFloat opt_illumination = -1; /* default: not set */ + OFCmdFloat opt_minDensity = -1; /* default: not set */ + OFCmdFloat opt_maxDensity = -1; /* default: not set */ + DiDisplayFunction::E_DeviceType deviceType = DiDisplayFunction::EDT_Monitor; + +#ifdef WITH_LIBTIFF + // TIFF parameters + DiTIFFCompression opt_tiffCompression = E_tiffLZWCompression; + DiTIFFLZWPredictor opt_lzwPredictor = E_tiffLZWPredictorDefault; + OFCmdUnsignedInt opt_rowsPerStrip = 0; +#endif + +#ifdef WITH_LIBPNG + // PNG parameters + DiPNGInterlace opt_interlace = E_pngInterlaceAdam7; + DiPNGMetainfo opt_metainfo = E_pngFileMetainfo; +#endif + +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + // JPEG parameters + OFCmdUnsignedInt opt_quality = 90; /* default: 90% JPEG quality */ + E_SubSampling opt_sampling = ESS_422; /* default: 4:2:2 sub-sampling */ + E_DecompressionColorSpaceConversion opt_decompCSconversion = EDC_photometricInterpretation; + OFBool opt_predictor6WorkaroundEnable = OFFalse; + OFBool opt_cornellWorkaroundEnable = OFFalse; + OFBool opt_forceSingleFragmentPerFrame = OFFalse; +#endif + + int opt_Overlay[16]; + int opt_O_used = 0; /* flag for +O parameter */ + EM_Overlay opt_OverlayMode = EMO_Default; /* default: Replace or ROI */ + + OFCmdFloat opt_foregroundDensity = 1.0; + OFCmdFloat opt_thresholdDensity = 0.5; + + int opt_imageInfo = 0; /* default: no info */ + int opt_suppressOutput = 0; /* default: create output */ + E_FileType opt_fileType = EFT_RawPNM; /* default: 8-bit PGM/PPM */ + /* (binary for file output and ASCII for stdout) */ + OFCmdUnsignedInt opt_fileBits = 0; /* default: 0 */ + const char * opt_ifname = NULL; + const char * opt_ofname = NULL; + + unsigned long i; + for (i = 0; i < 16; i++) + opt_Overlay[i] = 2; /* default: display all overlays if present */ + + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + cmd.setOptionColumns(LONGCOL, SHORTCOL); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("bitmap-out", OFFIS_OUTFILE_DESCRIPTION, OFCmdParam::PM_Optional); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("image processing options:"); + + cmd.addSubGroup("frame selection:"); + cmd.addOption("--frame", "+F", 1, "[n]umber: integer", + "select specified frame (default: 1)"); + cmd.addOption("--frame-range", "+Fr", 2, "[n]umber [c]ount: integer", + "select c frames beginning with frame n"); + cmd.addOption("--all-frames", "+Fa", "select all frames"); + + cmd.addSubGroup("rotation:"); + cmd.addOption("--rotate-left", "+Rl", "rotate image left (-90 degrees)"); + cmd.addOption("--rotate-right", "+Rr", "rotate image right (+90 degrees)"); + cmd.addOption("--rotate-top-down", "+Rtd", "rotate image top-down (180 degrees)"); + + cmd.addSubGroup("flipping:"); + cmd.addOption("--flip-horizontally", "+Lh", "flip image horizontally"); + cmd.addOption("--flip-vertically", "+Lv", "flip image vertically"); + cmd.addOption("--flip-both-axes", "+Lhv", "flip image horizontally and vertically"); + + cmd.addSubGroup("scaling:"); + cmd.addOption("--recognize-aspect", "+a", "recognize pixel aspect ratio (default)"); + cmd.addOption("--ignore-aspect", "-a", "ignore pixel aspect ratio when scaling"); + cmd.addOption("--interpolate", "+i", 1, "[n]umber of algorithm: integer", + "use interpolation when scaling (1..4, def: 1)"); + cmd.addOption("--no-interpolation", "-i", "no interpolation when scaling"); + cmd.addOption("--no-scaling", "-S", "no scaling, ignore pixel aspect ratio (default)"); + cmd.addOption("--scale-x-factor", "+Sxf", 1, "[f]actor: float", + "scale x axis by factor, auto-compute y axis"); + cmd.addOption("--scale-y-factor", "+Syf", 1, "[f]actor: float", + "scale y axis by factor, auto-compute x axis"); + cmd.addOption("--scale-x-size", "+Sxv", 1, "[n]umber: integer", + "scale x axis to n pixels, auto-compute y axis"); + cmd.addOption("--scale-y-size", "+Syv", 1, "[n]umber: integer", + "scale y axis to n pixels, auto-compute x axis"); +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + cmd.addSubGroup("color space conversion (JPEG compressed images only):"); + cmd.addOption("--conv-photometric", "+cp", "convert if YCbCr photometric interpr. (default)"); + cmd.addOption("--conv-lossy", "+cl", "convert YCbCr to RGB if lossy JPEG"); + cmd.addOption("--conv-guess", "+cg", "convert to RGB if YCbCr is guessed by library"); + cmd.addOption("--conv-guess-lossy", "+cgl", "convert to RGB if lossy JPEG and YCbCr is\nguessed by the underlying JPEG library"); + cmd.addOption("--conv-always", "+ca", "always convert YCbCr to RGB"); + cmd.addOption("--conv-never", "+cn", "never convert color space"); + + cmd.addSubGroup("workaround options for incorrect encodings (JPEG compressed images only):"); + cmd.addOption("--workaround-pred6", "+w6", "enable workaround for JPEG lossless images\nwith overflow in predictor 6"); + cmd.addOption("--workaround-incpl", "+wi", "enable workaround for incomplete JPEG data"); + cmd.addOption("--workaround-cornell", "+wc", "enable workaround for 16-bit JPEG lossless\nCornell images with Huffman table overflow"); +#endif + + cmd.addSubGroup("modality LUT transformation:"); + cmd.addOption("--no-modality", "-M", "ignore stored modality LUT transformation"); + cmd.addOption("--use-modality", "+M", "use modality LUT transformation (default)"); + + cmd.addSubGroup("VOI LUT transformation:"); + cmd.addOption("--no-windowing", "-W", "no VOI windowing (default)"); + cmd.addOption("--use-window", "+Wi", 1, "[n]umber: integer", + "use the n-th VOI window from image file"); + cmd.addOption("--use-voi-lut", "+Wl", 1, "[n]umber: integer", + "use the n-th VOI look up table from image file"); + cmd.addOption("--min-max-window", "+Wm", "compute VOI window using min-max algorithm"); + cmd.addOption("--min-max-window-n", "+Wn", "compute VOI window using min-max algorithm,\nignoring extreme values"); + cmd.addOption("--roi-min-max-window", "+Wr", 4, "[l]eft [t]op [w]idth [h]eight: integer", + "compute ROI window using min-max algorithm,\nregion of interest is specified by l,t,w,h"); + cmd.addOption("--histogram-window", "+Wh", 1, "[n]umber: integer", + "compute VOI window using Histogram algorithm,\nignoring n percent"); + cmd.addOption("--set-window", "+Ww", 2, "[c]enter [w]idth: float", + "compute VOI window using center c and width w"); + cmd.addOption("--linear-function", "+Wfl", "set VOI LUT function to LINEAR"); + cmd.addOption("--sigmoid-function", "+Wfs", "set VOI LUT function to SIGMOID"); + + cmd.addSubGroup("presentation LUT transformation:"); + cmd.addOption("--identity-shape", "+Pid", "set presentation LUT shape to IDENTITY"); + cmd.addOption("--inverse-shape", "+Piv", "set presentation LUT shape to INVERSE"); + cmd.addOption("--lin-od-shape", "+Pod", "set presentation LUT shape to LIN OD"); + + cmd.addSubGroup("overlay:"); + cmd.addOption("--no-overlays", "-O", "do not display overlays"); + cmd.addOption("--display-overlay", "+O" , 1, "[n]umber: integer", + "display overlay n (0..16, 0=all, default: +O 0)"); + cmd.addOption("--ovl-replace", "+Omr", "use overlay mode \"Replace\"\n(default for Graphic overlays)"); + cmd.addOption("--ovl-threshold", "+Omt", "use overlay mode \"Threshold Replace\""); + cmd.addOption("--ovl-complement", "+Omc", "use overlay mode \"Complement\""); + cmd.addOption("--ovl-invert", "+Omv", "use overlay mode \"Invert Bitmap\""); + cmd.addOption("--ovl-roi", "+Omi", "use overlay mode \"Region of Interest\"\n(default for ROI overlays)"); + cmd.addOption("--set-foreground", "+Osf", 1, "[d]ensity: float", + "set overlay foreground density (0..1, def: 1)"); + cmd.addOption("--set-threshold", "+Ost", 1, "[d]ensity: float", + "set overlay threshold density (0..1, def: 0.5)"); + + cmd.addSubGroup("display LUT transformation:"); + cmd.addOption("--monitor-file", "+Dm", 1, "[f]ilename: string", + "calibrate output according to monitor\ncharacteristics defined in f"); + cmd.addOption("--printer-file", "+Dp", 1, "[f]ilename: string", + "calibrate output according to printer\ncharacteristics defined in f"); + cmd.addOption("--ambient-light", "+Da", 1, "[a]mbient light: float", + "ambient light value (cd/m^2, default: file f)"); + cmd.addOption("--illumination", "+Di", 1, "[i]llumination: float", + "illumination value (cd/m^2, default: file f)"); + cmd.addOption("--min-density", "+Dn", 1, "[m]inimum optical density: float", + "Dmin value (default: off, only with +Dp)"); + cmd.addOption("--max-density", "+Dx", 1, "[m]aximum optical density: float", + "Dmax value (default: off, only with +Dp)"); + cmd.addOption("--gsd-function", "+Dg", "use GSDF for calibration (default for +Dm/+Dp)"); + cmd.addOption("--cielab-function", "+Dc", "use CIELAB function for calibration "); + + cmd.addSubGroup("compatibility:"); + cmd.addOption("--accept-acr-nema", "+Ma", "accept ACR-NEMA images without photometric\ninterpretation"); + cmd.addOption("--accept-palettes", "+Mp", "accept incorrect palette attribute tags\n(0028,111x) and (0028,121x)"); + cmd.addOption("--check-lut-depth", "+Mc", "check 3rd value of the LUT descriptor, compare\nwith expected bit depth based on LUT data"); + cmd.addOption("--ignore-mlut-depth", "+Mm", "ignore 3rd value of the modality LUT descriptor,\ndetermine bits per table entry automatically"); + cmd.addOption("--ignore-vlut-depth", "+Mv", "ignore 3rd value of the VOI LUT descriptor,\ndetermine bits per table entry automatically"); + +#ifdef WITH_LIBTIFF + cmd.addSubGroup("TIFF format:"); + cmd.addOption("--compr-lzw", "+Tl", "LZW compression (default)"); + cmd.addOption("--compr-rle", "+Tr", "RLE compression"); + cmd.addOption("--compr-none", "+Tn", "uncompressed"); + cmd.addOption("--predictor-default", "+Pd", "no LZW predictor (default)"); + cmd.addOption("--predictor-none", "+Pn", "LZW predictor 1 (no prediction)"); + cmd.addOption("--predictor-horz", "+Ph", "LZW predictor 2 (horizontal differencing)"); + cmd.addOption("--rows-per-strip", "+Rs", 1, "[r]ows: integer (default: 0)", + "rows per strip, default 8K per strip"); +#endif + +#ifdef WITH_LIBPNG + cmd.addSubGroup("PNG format:"); + cmd.addOption("--interlace", "+il", "create interlaced file (default)"); + cmd.addOption("--nointerlace", "-il", "create non-interlaced file"); + cmd.addOption("--meta-file", "+mf", "create PNG file meta information (default)"); + cmd.addOption("--meta-none", "-mf", "no PNG file meta information"); +#endif + +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + cmd.addSubGroup("JPEG format"); + cmd.addOption("--compr-quality", "+Jq", 1, "[q]uality: integer (0..100, default: 90)", + "quality value for compression (in percent)"); + cmd.addOption("--sample-444", "+Js4", "4:4:4 sampling (no subsampling)"); + cmd.addOption("--sample-422", "+Js2", "4:2:2 subsampling (horizontal subsampling of\nchroma components, default)"); + cmd.addOption("--sample-411", "+Js1", "4:1:1 subsampling (horizontal and vertical\nsubsampling of chroma components)"); +#endif + + cmd.addSubGroup("other transformations:"); + cmd.addOption("--grayscale", "+G", "convert to grayscale if necessary"); + cmd.addOption("--change-polarity", "+P", "change polarity (invert pixel output)"); + cmd.addOption("--clip-region", "+C", 4, "[l]eft [t]op [w]idth [h]eight: integer", + "clip image region (l, t, w, h)"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("general:"); + cmd.addOption("--image-info", "-im", "print image details (requires verbose mode)"); + cmd.addOption("--no-output", "-o", "do not create any output (useful with -im)"); + cmd.addSubGroup("filename generation (only with --frame-range or --all-frames):"); + cmd.addOption("--use-frame-counter", "+Fc", "use 0-based counter for filenames (default)"); + cmd.addOption("--use-frame-number", "+Fn", "use absolute frame number for filenames"); + cmd.addSubGroup("image format:"); + cmd.addOption("--write-raw-pnm", "+op", "write 8-bit binary PGM/PPM (default for files)"); + cmd.addOption("--write-8-bit-pnm", "+opb", "write 8-bit ASCII PGM/PPM (default for stdout)"); + cmd.addOption("--write-16-bit-pnm", "+opw", "write 16-bit ASCII PGM/PPM"); + cmd.addOption("--write-n-bit-pnm", "+opn", 1, "[n]umber: integer", + "write n-bit ASCII PGM/PPM (1..32)"); + cmd.addOption("--write-bmp", "+ob", "write 8-bit (monochrome) or 24-bit (color) BMP"); + cmd.addOption("--write-8-bit-bmp", "+obp", "write 8-bit palette BMP (monochrome only)"); + cmd.addOption("--write-24-bit-bmp", "+obt", "write 24-bit truecolor BMP"); + cmd.addOption("--write-32-bit-bmp", "+obr", "write 32-bit truecolor BMP"); +#ifdef WITH_LIBTIFF + cmd.addOption("--write-tiff", "+ot", "write 8-bit (monochrome) or 24-bit (color) TIFF"); +#endif +#ifdef WITH_LIBPNG + cmd.addOption("--write-png", "+on", "write 8-bit (monochrome) or 24-bit (color) PNG"); + cmd.addOption("--write-16-bit-png", "+on2", "write 16-bit (monochrome) or 48-bit (color) PNG"); +#endif +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + cmd.addOption("--write-jpeg", "+oj", "write 8-bit lossy JPEG (baseline)"); +#endif +#ifdef PASTEL_COLOR_OUTPUT + cmd.addOption("--write-pastel-pnm", "+op", "write 8-bit binary PPM with pastel colors\n(early experimental version)"); +#endif + + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(BUILD_DCM2PNM_AS_DCMJ2PNM) && !defined(BUILD_DCM2PNM_AS_DCML2PNM) && !defined(WITH_LIBTIFF) && !defined(WITH_LIBPNG) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; +#endif +#ifdef BUILD_DCM2PNM_AS_DCML2PNM + COUT << "- " << DJLSDecoderRegistration::getLibraryVersionString() << OFendl; +#endif +#ifdef WITH_LIBTIFF + COUT << "- " << DiTIFFPlugin::getLibraryVersionString() << OFendl; +#endif +#ifdef WITH_LIBPNG + COUT << "- " << DiPNGPlugin::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* general options */ + + OFLog::configureFromCommandLine(cmd, app); + + /* input options: input file format */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + /* input options: input transfer syntax */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_transferSyntax = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_transferSyntax = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_transferSyntax = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_transferSyntax = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + /* image processing options: compatibility options */ + + if (cmd.findOption("--accept-acr-nema")) + opt_compatibilityMode |= CIF_AcrNemaCompatibility; + if (cmd.findOption("--accept-palettes")) + opt_compatibilityMode |= CIF_WrongPaletteAttributeTags; + if (cmd.findOption("--check-lut-depth")) + opt_compatibilityMode |= CIF_CheckLutBitDepth; + if (cmd.findOption("--ignore-mlut-depth")) + opt_compatibilityMode |= CIF_IgnoreModalityLutBitDepth; + if (cmd.findOption("--ignore-vlut-depth")) + opt_ignoreVoiLutDepth = OFTrue; + + /* image processing options: frame selection */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--frame")) + app.checkValue(cmd.getValueAndCheckMin(opt_frame, 1)); + if (cmd.findOption("--frame-range")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_frame, 1)); + app.checkValue(cmd.getValueAndCheckMin(opt_frameCount, 1)); + opt_multiFrame = OFTrue; + } + if (cmd.findOption("--all-frames")) + { + opt_frameCount = 0; + opt_multiFrame = OFTrue; + } + cmd.endOptionBlock(); + + /* image processing options: other transformations */ + + if (cmd.findOption("--grayscale")) + opt_convertToGrayscale = 1; + if (cmd.findOption("--change-polarity")) + opt_changePolarity = 1; + + if (cmd.findOption("--clip-region")) + { + app.checkValue(cmd.getValue(opt_left)); + app.checkValue(cmd.getValue(opt_top)); + app.checkValue(cmd.getValue(opt_width)); + app.checkValue(cmd.getValue(opt_height)); + opt_useClip = 1; + } + + /* image processing options: rotation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--rotate-left")) + opt_rotateDegree = 270; + if (cmd.findOption("--rotate-right")) + opt_rotateDegree = 90; + if (cmd.findOption("--rotate-top-down")) + opt_rotateDegree = 180; + cmd.endOptionBlock(); + + /* image processing options: flipping */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--flip-horizontally")) + opt_flipType = 1; + if (cmd.findOption("--flip-vertically")) + opt_flipType = 2; + if (cmd.findOption("--flip-both-axes")) + opt_flipType = 3; + cmd.endOptionBlock(); + + /* image processing options: scaling */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--recognize-aspect")) + opt_useAspectRatio = 1; + if (cmd.findOption("--ignore-aspect")) + opt_useAspectRatio = 0; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--interpolate")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_useInterpolation, 1, 4)); + if (cmd.findOption("--no-interpolation")) + opt_useInterpolation = 0; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-scaling")) + opt_scaleType = 0; + if (cmd.findOption("--scale-x-factor")) + { + opt_scaleType = 1; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_factor, 0.0, OFFalse)); + } + if (cmd.findOption("--scale-y-factor")) + { + opt_scaleType = 2; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_factor, 0.0, OFFalse)); + } + if (cmd.findOption("--scale-x-size")) + { + opt_scaleType = 3; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_size, 1)); + } + if (cmd.findOption("--scale-y-size")) + { + opt_scaleType = 4; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_size, 1)); + } + cmd.endOptionBlock(); + + /* image processing options: color space conversion */ + +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + cmd.beginOptionBlock(); + if (cmd.findOption("--conv-photometric")) + opt_decompCSconversion = EDC_photometricInterpretation; + if (cmd.findOption("--conv-lossy")) + opt_decompCSconversion = EDC_lossyOnly; + if (cmd.findOption("--conv-guess")) + opt_decompCSconversion = EDC_guess; + if (cmd.findOption("--conv-guess-lossy")) + opt_decompCSconversion = EDC_guessLossyOnly; + if (cmd.findOption("--conv-always")) + opt_decompCSconversion = EDC_always; + if (cmd.findOption("--conv-never")) + opt_decompCSconversion = EDC_never; + cmd.endOptionBlock(); + + if (cmd.findOption("--workaround-pred6")) opt_predictor6WorkaroundEnable = OFTrue; + if (cmd.findOption("--workaround-incpl")) opt_forceSingleFragmentPerFrame = OFTrue; + if (cmd.findOption("--workaround-cornell")) opt_cornellWorkaroundEnable = OFTrue; +#endif + + /* image processing options: modality LUT transformation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-modality")) + opt_compatibilityMode |= CIF_IgnoreModalityTransformation; + if (cmd.findOption("--use-modality")) + opt_compatibilityMode &= ~CIF_IgnoreModalityTransformation; + cmd.endOptionBlock(); + + /* image processing options: VOI LUT transformation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-windowing")) + opt_windowType = 0; + if (cmd.findOption("--use-window")) + { + opt_windowType = 1; + app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1)); + } + if (cmd.findOption("--use-voi-lut")) + { + opt_windowType = 2; + app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1)); + } + if (cmd.findOption("--min-max-window")) + opt_windowType = 3; + if (cmd.findOption("--min-max-window-n")) + opt_windowType = 6; + if (cmd.findOption("--roi-min-max-window")) + { + opt_windowType = 7; + app.checkValue(cmd.getValue(opt_roiLeft)); + app.checkValue(cmd.getValue(opt_roiTop)); + app.checkValue(cmd.getValueAndCheckMin(opt_roiWidth, 1)); + app.checkValue(cmd.getValueAndCheckMin(opt_roiHeight, 1)); + } + if (cmd.findOption("--histogram-window")) + { + opt_windowType = 4; + app.checkValue(cmd.getValueAndCheckMinMax(opt_windowParameter, 0, 100)); + } + if (cmd.findOption("--set-window")) + { + opt_windowType = 5; + app.checkValue(cmd.getValue(opt_windowCenter)); + app.checkValue(cmd.getValueAndCheckMin(opt_windowWidth, 1.0)); + } + cmd.endOptionBlock(); + cmd.beginOptionBlock(); + if (cmd.findOption("--linear-function")) + opt_voiFunction = EFV_Linear; + if (cmd.findOption("--sigmoid-function")) + opt_voiFunction = EFV_Sigmoid; + cmd.endOptionBlock(); + + /* image processing options: presentation LUT transformation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--identity-shape")) + opt_presShape = ESP_Identity; + if (cmd.findOption("--inverse-shape")) + opt_presShape = ESP_Inverse; + if (cmd.findOption("--lin-od-shape")) + opt_presShape = ESP_LinOD; + cmd.endOptionBlock(); + + /* image processing options: display LUT transformation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--monitor-file")) + { + app.checkValue(cmd.getValue(opt_displayFile)); + deviceType = DiDisplayFunction::EDT_Monitor; + } + if (cmd.findOption("--printer-file")) + { + app.checkValue(cmd.getValue(opt_displayFile)); + deviceType = DiDisplayFunction::EDT_Printer; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--ambient-light")) + app.checkValue(cmd.getValueAndCheckMin(opt_ambientLight, 0)); + if (cmd.findOption("--illumination")) + app.checkValue(cmd.getValueAndCheckMin(opt_illumination, 0)); + if (cmd.findOption("--min-density")) + { + app.checkDependence("--min-density", "--printer-file", deviceType == DiDisplayFunction::EDT_Printer); + app.checkValue(cmd.getValueAndCheckMin(opt_minDensity, 0)); + } + if (cmd.findOption("--max-density")) + { + app.checkDependence("--max-density", "--printer-file", deviceType == DiDisplayFunction::EDT_Printer); + app.checkValue(cmd.getValueAndCheckMin(opt_maxDensity, (opt_minDensity < 0) ? 0.0 : opt_minDensity, OFFalse /*incl*/)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--gsd-function")) + opt_displayFunction = 0; + if (cmd.findOption("--cielab-function")) + opt_displayFunction = 1; + cmd.endOptionBlock(); + + /* image processing options: overlay */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-overlays")) + { + opt_O_used = 1; + for (i = 0; i < 16; i++) + opt_Overlay[i] = 0; + } + if (cmd.findOption("--display-overlay", 0, OFCommandLine::FOM_First)) + { + do { + unsigned long l; + app.checkValue(cmd.getValueAndCheckMinMax(l, 0, 16)); + if (!opt_O_used) + { + for (i = 0; i < 16; i++) opt_Overlay[i] = 0; + opt_O_used = 1; + } + if (l > 0) + opt_Overlay[l - 1] = 1; + else + { + for (i = 0; i < 16; i++) + opt_Overlay[i] = 2; + } + } while (cmd.findOption("--display-overlay", 0, OFCommandLine::FOM_Next)); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--ovl-replace")) + opt_OverlayMode = EMO_Replace; + if (cmd.findOption("--ovl-threshold")) + opt_OverlayMode = EMO_ThresholdReplace; + if (cmd.findOption("--ovl-complement")) + opt_OverlayMode = EMO_Complement; + if (cmd.findOption("--ovl-invert")) + opt_OverlayMode = EMO_InvertBitmap; + if (cmd.findOption("--ovl-roi")) + opt_OverlayMode = EMO_RegionOfInterest; + cmd.endOptionBlock(); + + if (cmd.findOption("--set-foreground")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_foregroundDensity, 0.0, 1.0)); + if (cmd.findOption("--set-threshold")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_thresholdDensity, 0.0, 1.0)); + + /* image processing options: TIFF options */ + +#ifdef WITH_LIBTIFF + cmd.beginOptionBlock(); + if (cmd.findOption("--compr-lzw")) opt_tiffCompression = E_tiffLZWCompression; + if (cmd.findOption("--compr-rle")) opt_tiffCompression = E_tiffPackBitsCompression; + if (cmd.findOption("--compr-none")) opt_tiffCompression = E_tiffNoCompression; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--predictor-default")) opt_lzwPredictor = E_tiffLZWPredictorDefault; + if (cmd.findOption("--predictor-none")) opt_lzwPredictor = E_tiffLZWPredictorNoPrediction; + if (cmd.findOption("--predictor-horz")) opt_lzwPredictor = E_tiffLZWPredictorHDifferencing; + cmd.endOptionBlock(); + + if (cmd.findOption("--rows-per-strip")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_rowsPerStrip, 0, 65535)); +#endif + + /* image processing options: PNG options */ + +#ifdef WITH_LIBPNG + cmd.beginOptionBlock(); + if (cmd.findOption("--interlace")) opt_interlace = E_pngInterlaceAdam7; + if (cmd.findOption("--nointerlace")) opt_interlace = E_pngInterlaceNone; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--meta-none")) opt_metainfo = E_pngNoMetainfo; + if (cmd.findOption("--meta-file")) opt_metainfo = E_pngFileMetainfo; + cmd.endOptionBlock(); +#endif + + /* image processing options: JPEG options */ + +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + if (cmd.findOption("--compr-quality")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_quality, 0, 100)); + cmd.beginOptionBlock(); + if (cmd.findOption("--sample-444")) + opt_sampling = ESS_444; + if (cmd.findOption("--sample-422")) + opt_sampling = ESS_422; + if (cmd.findOption("--sample-411")) + opt_sampling = ESS_411; + cmd.endOptionBlock(); +#endif + + /* output options */ + + if (cmd.findOption("--image-info")) + { + app.checkDependence("--image-info", "verbose mode", dcm2pnmLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_imageInfo = 1; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--use-frame-counter")) + { + app.checkDependence("--use-frame-counter", "--frame-range or --all-frames", opt_multiFrame); + opt_useFrameNumber = OFFalse; + } + if (cmd.findOption("--use-frame-number")) + { + app.checkDependence("--use-frame-number", "--frame-range or --all-frames", opt_multiFrame); + opt_useFrameNumber = OFTrue; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-output")) + opt_suppressOutput = 1; + if (cmd.findOption("--write-raw-pnm")) + opt_fileType = EFT_RawPNM; + if (cmd.findOption("--write-8-bit-pnm")) + opt_fileType = EFT_8bitPNM; + if (cmd.findOption("--write-16-bit-pnm")) + opt_fileType = EFT_16bitPNM; + if (cmd.findOption("--write-n-bit-pnm")) + { + opt_fileType = EFT_NbitPNM; + app.checkValue(cmd.getValueAndCheckMinMax(opt_fileBits, 1, 32)); + } + if (cmd.findOption("--write-bmp")) + opt_fileType = EFT_BMP; + if (cmd.findOption("--write-8-bit-bmp")) + opt_fileType = EFT_8bitBMP; + if (cmd.findOption("--write-24-bit-bmp")) + opt_fileType = EFT_24bitBMP; + if (cmd.findOption("--write-32-bit-bmp")) + opt_fileType = EFT_32bitBMP; +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + if (cmd.findOption("--write-jpeg")) + opt_fileType = EFT_JPEG; +#endif +#ifdef WITH_LIBTIFF + if (cmd.findOption("--write-tiff")) + opt_fileType = EFT_TIFF; +#endif +#ifdef WITH_LIBPNG + if (cmd.findOption("--write-png")) + opt_fileType = EFT_PNG; + if (cmd.findOption("--write-16-bit-png")) + opt_fileType = EFT_16bitPNG; +#endif +#ifdef PASTEL_COLOR_OUTPUT + if (cmd.findOption("--write-pastel-pnm")) + opt_fileType = EFT_PastelPNM; +#endif + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcm2pnmLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcm2pnmLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + if (opt_suppressOutput && opt_ofname) + OFLOG_WARN(dcm2pnmLogger, "ignoring parameter bitmap-out because of option --no-output"); + + OFLOG_INFO(dcm2pnmLogger, "reading DICOM file: " << opt_ifname); + + // register RLE decompression codec + DcmRLEDecoderRegistration::registerCodecs(); +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + // register JPEG decompression codecs + DJDecoderRegistration::registerCodecs(opt_decompCSconversion, EUC_default, + EPC_default, opt_predictor6WorkaroundEnable, opt_cornellWorkaroundEnable, + opt_forceSingleFragmentPerFrame); +#endif +#ifdef BUILD_DCM2PNM_AS_DCML2PNM + // register JPEG-LS decompression codecs + DJLSDecoderRegistration::registerCodecs(); +#endif + + DcmFileFormat *dfile = new DcmFileFormat(); + OFCondition cond = dfile->loadFile(opt_ifname, opt_transferSyntax, EGL_withoutGL, DCM_MaxReadLength, opt_readMode); + + if (cond.bad()) + { + OFLOG_FATAL(dcm2pnmLogger, cond.text() << ": reading file: " << opt_ifname); + return 1; + } + + OFLOG_INFO(dcm2pnmLogger, "preparing pixel data"); + + DcmDataset *dataset = dfile->getDataset(); + E_TransferSyntax xfer = dataset->getOriginalXfer(); + + Sint32 frameCount; + if (dataset->findAndGetSint32(DCM_NumberOfFrames, frameCount).bad()) + frameCount = 1; + if ((opt_frameCount == 0) || ((opt_frame == 1) && (opt_frameCount == OFstatic_cast(Uint32, frameCount)))) + { + // since we process all frames anyway, decompress the complete pixel data (if required) + opt_compatibilityMode |= CIF_DecompressCompletePixelData; + } + if ((frameCount > 1) && !(opt_compatibilityMode & CIF_DecompressCompletePixelData)) + { + // use partial read access to pixel data (only in case of multiple frames, but not for all frames) + opt_compatibilityMode |= CIF_UsePartialAccessToPixelData; + } + + DicomImage *di = new DicomImage(dfile, xfer, opt_compatibilityMode, opt_frame - 1, opt_frameCount); + if (di == NULL) + { + OFLOG_FATAL(dcm2pnmLogger, "Out of memory"); + return 1; + } + + if (di->getStatus() != EIS_Normal) + { + OFLOG_FATAL(dcm2pnmLogger, DicomImage::getString(di->getStatus())); + return 1; + } + + /* create & set display function */ + DiDisplayFunction *disp = NULL; + if (!opt_displayFile.empty()) + { + if (opt_displayFunction == 1) + disp = new DiCIELABFunction(opt_displayFile.c_str(), deviceType); + else + disp = new DiGSDFunction(opt_displayFile.c_str(), deviceType); + if (disp != NULL) + { + if (opt_ambientLight >= 0) + disp->setAmbientLightValue(opt_ambientLight); + if (opt_illumination >= 0) + disp->setIlluminationValue(opt_illumination); + if (opt_minDensity >= 0) + disp->setMinDensityValue(opt_minDensity); + if (opt_maxDensity >= 0) + disp->setMaxDensityValue(opt_maxDensity); + if ((di != NULL) && (disp->isValid())) + { + OFLOG_INFO(dcm2pnmLogger, "activating " + << ((opt_displayFunction == 1) ? "CIELAB" : "GSDF") + << " display function for " + << ((deviceType == DiDisplayFunction::EDT_Monitor) ? "softcopy" : "hardcopy") + << " devices"); + if (!di->setDisplayFunction(disp)) + OFLOG_WARN(dcm2pnmLogger, "cannot select display function"); + } + } + } + + if (opt_imageInfo) + { + /* dump image parameters */ + OFLOG_INFO(dcm2pnmLogger, "dumping image parameters"); + + double minVal = 0.0; + double maxVal = 0.0; + const char *colorModel; + const char *SOPClassUID = NULL; + const char *SOPInstanceUID = NULL; + const char *SOPClassText = NULL; + const char *XferText = DcmXfer(xfer).getXferName(); + + int minmaxValid = di->getMinMaxValues(minVal, maxVal); + colorModel = di->getString(di->getPhotometricInterpretation()); + if (colorModel == NULL) + colorModel = "unknown"; + + dataset->findAndGetString(DCM_SOPClassUID, SOPClassUID); + dataset->findAndGetString(DCM_SOPInstanceUID, SOPInstanceUID); + + if (SOPInstanceUID == NULL) + SOPInstanceUID = "not present"; + if (SOPClassUID == NULL) + SOPClassText = "not present"; + else + SOPClassText = dcmFindNameOfUID(SOPClassUID); + if (SOPClassText == NULL) + SOPClassText = SOPClassUID; + + char aspectRatio[30]; + OFStandard::ftoa(aspectRatio, sizeof(aspectRatio), di->getHeightWidthRatio(), OFStandard::ftoa_format_f, 0, 2); + + /* dump some general information */ + OFLOG_INFO(dcm2pnmLogger, " filename : " << opt_ifname << OFendl + << " transfer syntax : " << XferText << OFendl + << " SOP class : " << SOPClassText << OFendl + << " SOP instance UID : " << SOPInstanceUID << OFendl + << " columns x rows : " << di->getWidth() << " x " << di->getHeight() << OFendl + << " bits per sample : " << di->getDepth() << OFendl + << " color model : " << colorModel << OFendl + << " pixel aspect ratio : " << aspectRatio << OFendl + << " number of frames : " << di->getNumberOfFrames() << " (" << di->getFrameCount() << " processed)"); + if (di->getFrameTime() > 0) + OFLOG_INFO(dcm2pnmLogger, " frame time (in ms) : " << di->getFrameTime()); + + /* dump VOI windows */ + unsigned long count; + OFString explStr, funcStr; + count = di->getWindowCount(); + switch (di->getVoiLutFunction()) + { + case EFV_Default: + funcStr = ""; + break; + case EFV_Linear: + funcStr = "LINEAR"; + break; + case EFV_Sigmoid: + funcStr = "SIGMOID"; + break; + } + OFLOG_INFO(dcm2pnmLogger, " VOI LUT function : " << funcStr); + OFLOG_INFO(dcm2pnmLogger, " VOI windows in file : " << di->getWindowCount()); + for (i = 0; i < count; i++) + { + if (di->getVoiWindowExplanation(i, explStr) == NULL) + OFLOG_INFO(dcm2pnmLogger, " - "); + else + OFLOG_INFO(dcm2pnmLogger, " - " << explStr); + } + + /* dump VOI LUTs */ + count = di->getVoiLutCount(); + OFLOG_INFO(dcm2pnmLogger, " VOI LUTs in file : " << count); + for (i = 0; i < count; i++) + { + if (di->getVoiLutExplanation(i, explStr) == NULL) + OFLOG_INFO(dcm2pnmLogger, " - "); + else + OFLOG_INFO(dcm2pnmLogger, " - " << explStr); + } + + /* dump presentation LUT shape */ + OFString shapeStr; + switch (di->getPresentationLutShape()) + { + case ESP_Default: + shapeStr = ""; + break; + case ESP_Identity: + shapeStr = "IDENTITY"; + break; + case ESP_Inverse: + shapeStr = "INVERSE"; + break; + case ESP_LinOD: + shapeStr = "LIN OD"; + break; + } + OFLOG_INFO(dcm2pnmLogger, " presentation shape : " << shapeStr); + + /* dump overlays */ + OFLOG_INFO(dcm2pnmLogger, " overlays in file : " << di->getOverlayCount()); + + if (minmaxValid) + { + char minmaxText[30]; + OFStandard::ftoa(minmaxText, sizeof(minmaxText), maxVal, OFStandard::ftoa_format_f, 0, 0); + OFLOG_INFO(dcm2pnmLogger, " maximum pixel value : " << minmaxText); + OFStandard::ftoa(minmaxText, sizeof(minmaxText), minVal, OFStandard::ftoa_format_f, 0, 0); + OFLOG_INFO(dcm2pnmLogger, " minimum pixel value : " << minmaxText); + } + } + + if (!opt_suppressOutput) + { + /* try to select frame */ + if (opt_frame != di->getFirstFrame() + 1) + { + OFLOG_FATAL(dcm2pnmLogger, "cannot select frame " << opt_frame << ", invalid frame number"); + return 1; + } + + /* convert to grayscale if necessary */ + if ((opt_convertToGrayscale) && (!di->isMonochrome())) + { + OFLOG_INFO(dcm2pnmLogger, "converting image to grayscale"); + + DicomImage *newimage = di->createMonochromeImage(); + if (newimage == NULL) + { + OFLOG_FATAL(dcm2pnmLogger, "Out of memory or cannot convert to monochrome image"); + return 1; + } + else if (newimage->getStatus() != EIS_Normal) + { + OFLOG_FATAL(dcm2pnmLogger, DicomImage::getString(newimage->getStatus())); + return 1; + } + else + { + delete di; + di = newimage; + } + } + + /* process overlay parameters */ + di->hideAllOverlays(); + for (unsigned int k = 0; k < 16; k++) + { + if (opt_Overlay[k]) + { + if ((opt_Overlay[k] == 1) || (k < di->getOverlayCount())) + { + OFLOG_INFO(dcm2pnmLogger, "activating overlay plane " << k + 1); + if (opt_OverlayMode != EMO_Default) + { + if (!di->showOverlay(k, opt_OverlayMode, opt_foregroundDensity, opt_thresholdDensity)) + OFLOG_WARN(dcm2pnmLogger, "cannot display overlay plane " << k + 1); + } else { + if (!di->showOverlay(k)) /* use default values */ + OFLOG_WARN(dcm2pnmLogger, "cannot display overlay plane " << k + 1); + } + } + } + } + + /* process VOI parameters */ + switch (opt_windowType) + { + case 1: /* use the n-th VOI window from the image file */ + if ((opt_windowParameter < 1) || (opt_windowParameter > di->getWindowCount())) + { + OFLOG_FATAL(dcm2pnmLogger, "cannot select VOI window " << opt_windowParameter << ", only " + << di->getWindowCount() << " window(s) in file"); + return 1; + } + OFLOG_INFO(dcm2pnmLogger, "activating VOI window " << opt_windowParameter); + if (!di->setWindow(opt_windowParameter - 1)) + OFLOG_WARN(dcm2pnmLogger, "cannot select VOI window " << opt_windowParameter); + break; + case 2: /* use the n-th VOI look up table from the image file */ + if ((opt_windowParameter < 1) || (opt_windowParameter > di->getVoiLutCount())) + { + OFLOG_FATAL(dcm2pnmLogger, "cannot select VOI LUT " << opt_windowParameter << ", only " + << di->getVoiLutCount() << " LUT(s) in file"); + return 1; + } + OFLOG_INFO(dcm2pnmLogger, "activating VOI LUT " << opt_windowParameter); + if (!di->setVoiLut(opt_windowParameter - 1, opt_ignoreVoiLutDepth ? ELM_IgnoreValue : ELM_UseValue)) + OFLOG_WARN(dcm2pnmLogger, "cannot select VOI LUT " << opt_windowParameter); + break; + case 3: /* Compute VOI window using min-max algorithm */ + OFLOG_INFO(dcm2pnmLogger, "activating VOI window min-max algorithm"); + if (!di->setMinMaxWindow(0)) + OFLOG_WARN(dcm2pnmLogger, "cannot compute min/max VOI window"); + break; + case 4: /* Compute VOI window using Histogram algorithm, ignoring n percent */ + OFLOG_INFO(dcm2pnmLogger, "activating VOI window histogram algorithm, ignoring " << opt_windowParameter << "%"); + if (!di->setHistogramWindow(OFstatic_cast(double, opt_windowParameter)/100.0)) + OFLOG_WARN(dcm2pnmLogger, "cannot compute histogram VOI window"); + break; + case 5: /* Compute VOI window using center and width */ + OFLOG_INFO(dcm2pnmLogger, "activating VOI window center=" << opt_windowCenter << ", width=" << opt_windowWidth); + if (!di->setWindow(opt_windowCenter, opt_windowWidth)) + OFLOG_WARN(dcm2pnmLogger, "cannot set VOI window to specified values"); + break; + case 6: /* Compute VOI window using min-max algorithm ignoring extremes */ + OFLOG_INFO(dcm2pnmLogger, "activating VOI window min-max algorithm, ignoring extreme values"); + if (!di->setMinMaxWindow(1)) + OFLOG_WARN(dcm2pnmLogger, "cannot compute min/max VOI window"); + break; + case 7: /* Compute region of interest VOI window */ + OFLOG_INFO(dcm2pnmLogger, "activating region of interest VOI window"); + if (!di->setRoiWindow(opt_roiLeft, opt_roiTop, opt_roiWidth, opt_roiHeight)) + OFLOG_WARN(dcm2pnmLogger, "cannot compute region of interest VOI window"); + break; + default: /* no VOI windowing */ + if (di->isMonochrome()) + { + OFLOG_INFO(dcm2pnmLogger, "disabling VOI window computation"); + if (!di->setNoVoiTransformation()) + OFLOG_WARN(dcm2pnmLogger, "cannot ignore VOI window"); + } + break; + } + /* VOI LUT function */ + if (opt_voiFunction != EFV_Default) + { + if (opt_voiFunction == EFV_Linear) + OFLOG_INFO(dcm2pnmLogger, "setting VOI LUT function to LINEAR"); + else if (opt_voiFunction == EFV_Sigmoid) + OFLOG_INFO(dcm2pnmLogger, "setting VOI LUT function to SIGMOID"); + if (!di->setVoiLutFunction(opt_voiFunction)) + OFLOG_WARN(dcm2pnmLogger, "cannot set VOI LUT function"); + } + + /* process presentation LUT parameters */ + if (opt_presShape != ESP_Default) + { + if (opt_presShape == ESP_Identity) + OFLOG_INFO(dcm2pnmLogger, "setting presentation LUT shape to IDENTITY"); + else if (opt_presShape == ESP_Inverse) + OFLOG_INFO(dcm2pnmLogger, "setting presentation LUT shape to INVERSE"); + else if (opt_presShape == ESP_LinOD) + OFLOG_INFO(dcm2pnmLogger, "setting presentation LUT shape to LIN OD"); + if (!di->setPresentationLutShape(opt_presShape)) + OFLOG_WARN(dcm2pnmLogger, "cannot set presentation LUT shape"); + } + + /* change polarity */ + if (opt_changePolarity) + { + OFLOG_INFO(dcm2pnmLogger, "setting polarity to REVERSE"); + if (!di->setPolarity(EPP_Reverse)) + OFLOG_WARN(dcm2pnmLogger, "cannot set polarity"); + } + + /* perform clipping */ + if (opt_useClip && (opt_scaleType == 0)) + { + OFLOG_INFO(dcm2pnmLogger, "clipping image to (" << opt_left << "," << opt_top << "," << opt_width + << "," << opt_height << ")"); + DicomImage *newimage = di->createClippedImage(opt_left, opt_top, opt_width, opt_height); + if (newimage == NULL) + { + OFLOG_FATAL(dcm2pnmLogger, "clipping to (" << opt_left << "," << opt_top << "," << opt_width + << "," << opt_height << ") failed"); + return 1; + } else if (newimage->getStatus() != EIS_Normal) + { + OFLOG_FATAL(dcm2pnmLogger, DicomImage::getString(newimage->getStatus())); + return 1; + } + else + { + delete di; + di = newimage; + } + } + + /* perform rotation */ + if (opt_rotateDegree > 0) + { + OFLOG_INFO(dcm2pnmLogger, "rotating image by " << opt_rotateDegree << " degrees"); + if (!di->rotateImage(opt_rotateDegree)) + OFLOG_WARN(dcm2pnmLogger, "cannot rotate image"); + } + + /* perform flipping */ + if (opt_flipType > 0) + { + switch (opt_flipType) + { + case 1: + OFLOG_INFO(dcm2pnmLogger, "flipping image horizontally"); + if (!di->flipImage(1, 0)) + OFLOG_WARN(dcm2pnmLogger, "cannot flip image"); + break; + case 2: + OFLOG_INFO(dcm2pnmLogger, "flipping image vertically"); + if (!di->flipImage(0, 1)) + OFLOG_WARN(dcm2pnmLogger, "cannot flip image"); + break; + case 3: + OFLOG_INFO(dcm2pnmLogger, "flipping image horizontally and vertically"); + if (!di->flipImage(1, 1)) + OFLOG_WARN(dcm2pnmLogger, "cannot flip image"); + break; + default: + break; + } + } + + /* perform scaling */ + if (opt_scaleType > 0) + { + DicomImage *newimage; + if (opt_useClip) + OFLOG_INFO(dcm2pnmLogger, "clipping image to (" << opt_left << "," << opt_top << "," << opt_width << "," << opt_height << ")"); + switch (opt_scaleType) + { + case 1: + OFLOG_INFO(dcm2pnmLogger, "scaling image, X factor=" << opt_scale_factor + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, opt_scale_factor, 0.0, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(opt_scale_factor, 0.0, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + case 2: + OFLOG_INFO(dcm2pnmLogger, "scaling image, Y factor=" << opt_scale_factor + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, 0.0, opt_scale_factor, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(0.0, opt_scale_factor, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + case 3: + OFLOG_INFO(dcm2pnmLogger, "scaling image, X size=" << opt_scale_size + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, opt_scale_size, 0, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(opt_scale_size, 0, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + case 4: + OFLOG_INFO(dcm2pnmLogger, "scaling image, Y size=" << opt_scale_size + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, 0, opt_scale_size, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(0, opt_scale_size, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + default: + OFLOG_INFO(dcm2pnmLogger, "internal error: unknown scaling type"); + newimage = NULL; + break; + } + if (newimage == NULL) + { + OFLOG_FATAL(dcm2pnmLogger, "Out of memory or cannot scale image"); + return 1; + } + else if (newimage->getStatus() != EIS_Normal) + { + OFLOG_FATAL(dcm2pnmLogger, DicomImage::getString(newimage->getStatus())); + return 1; + } + else + { + delete di; + di = newimage; + } + } + + /* write selected frame(s) to file */ + + int result = 0; + FILE *ofile = NULL; + OFString ofname; + unsigned int fcount = OFstatic_cast(unsigned int, ((opt_frameCount > 0) && (opt_frameCount <= di->getFrameCount())) ? opt_frameCount : di->getFrameCount()); + const char *ofext = NULL; + /* determine default file extension */ + switch (opt_fileType) + { + case EFT_BMP: + case EFT_8bitBMP: + case EFT_24bitBMP: + case EFT_32bitBMP: + ofext = "bmp"; + break; + case EFT_JPEG: + ofext = "jpg"; + break; + case EFT_TIFF: + ofext = "tif"; + break; + case EFT_PNG: + case EFT_16bitPNG: + ofext = "png"; + break; + default: + if (di->isMonochrome()) ofext = "pgm"; else ofext = "ppm"; + break; + } + + if (fcount < opt_frameCount) + { + OFLOG_WARN(dcm2pnmLogger, "cannot select " << opt_frameCount << " frames, limiting to " + << fcount << " frames"); + } + + for (unsigned int frame = 0; frame < fcount; frame++) + { + if (opt_ofname) + { + /* output to file */ + if (opt_multiFrame) + { + OFOStringStream stream; + /* generate output filename */ + stream << opt_ofname << "."; + if (opt_useFrameNumber) + stream << "f" << (opt_frame + frame); + else + stream << frame; + stream << "." << ofext << OFStringStream_ends; + /* convert string stream into a character string */ + OFSTRINGSTREAM_GETSTR(stream, buffer_str) + ofname.assign(buffer_str); + OFSTRINGSTREAM_FREESTR(buffer_str) + } else + ofname.assign(opt_ofname); + OFLOG_INFO(dcm2pnmLogger, "writing frame " << (opt_frame + frame) << " to " << ofname); + ofile = fopen(ofname.c_str(), "wb"); + if (ofile == NULL) + { + OFLOG_FATAL(dcm2pnmLogger, "cannot create file " << ofname); + return 1; + } + } else { + /* output to stdout */ + ofile = stdout; + OFLOG_INFO(dcm2pnmLogger, "writing frame " << (opt_frame + frame) << " to stdout"); + } + + /* finally create output image file */ + + switch (opt_fileType) + { + case EFT_RawPNM: + result = di->writeRawPPM(ofile, 8, frame); + break; + case EFT_8bitPNM: + result = di->writePPM(ofile, 8, frame); + break; + case EFT_16bitPNM: + result = di->writePPM(ofile, 16, frame); + break; + case EFT_NbitPNM: + result = di->writePPM(ofile, OFstatic_cast(int, opt_fileBits), frame); + break; + case EFT_BMP: + result = di->writeBMP(ofile, 0, frame); + break; + case EFT_8bitBMP: + result = di->writeBMP(ofile, 8, frame); + break; + case EFT_24bitBMP: + result = di->writeBMP(ofile, 24, frame); + break; + case EFT_32bitBMP: + result = di->writeBMP(ofile, 32, frame); + break; +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + case EFT_JPEG: + { + /* initialize JPEG plugin */ + DiJPEGPlugin plugin; + plugin.setQuality(OFstatic_cast(unsigned int, opt_quality)); + plugin.setSampling(opt_sampling); + result = di->writePluginFormat(&plugin, ofile, frame); + } + break; +#endif +#ifdef WITH_LIBTIFF + case EFT_TIFF: + { + /* initialize TIFF plugin */ + DiTIFFPlugin tiffPlugin; + tiffPlugin.setCompressionType(opt_tiffCompression); + tiffPlugin.setLZWPredictor(opt_lzwPredictor); + tiffPlugin.setRowsPerStrip(OFstatic_cast(unsigned long, opt_rowsPerStrip)); + result = di->writePluginFormat(&tiffPlugin, ofile, frame); + } + break; +#endif +#ifdef WITH_LIBPNG + case EFT_PNG: + case EFT_16bitPNG: + { + /* initialize PNG plugin */ + DiPNGPlugin pngPlugin; + pngPlugin.setInterlaceType(opt_interlace); + pngPlugin.setMetainfoType(opt_metainfo); + if (opt_fileType == EFT_16bitPNG) + pngPlugin.setBitsPerSample(16); + result = di->writePluginFormat(&pngPlugin, ofile, frame); + } + break; +#endif +#ifdef PASTEL_COLOR_OUTPUT + case EFT_PastelPNM: + result = di->writePPM(ofile, MI_PastelColor, frame); + break; +#endif + default: + if (opt_ofname) + result = di->writeRawPPM(ofile, 8, frame); + else /* stdout */ + result = di->writePPM(ofile, 8, frame); + break; + } + + if (opt_ofname) + fclose(ofile); + + if (!result) + { + OFLOG_FATAL(dcm2pnmLogger, "cannot write frame"); + return 1; + } + } + } + + /* done, now cleanup. */ + OFLOG_INFO(dcm2pnmLogger, "cleaning up memory"); + delete di; + delete disp; + + // deregister RLE decompression codec + DcmRLEDecoderRegistration::cleanup(); +#ifdef BUILD_DCM2PNM_AS_DCMJ2PNM + // deregister JPEG decompression codecs + DJDecoderRegistration::cleanup(); +#endif +#ifdef BUILD_DCM2PNM_AS_DCML2PNM + // deregister JPEG-LS decompression codecs + DJLSDecoderRegistration::cleanup(); +#endif + + return 0; +} diff --git a/dcmimage/apps/dcmicmp.cc b/dcmimage/apps/dcmicmp.cc new file mode 100644 index 00000000..cb7db193 --- /dev/null +++ b/dcmimage/apps/dcmicmp.cc @@ -0,0 +1,441 @@ +/* + * + * Copyright (C) 2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Authors: Marco Eichelberg + * + * Purpose: Compare DICOM images and compute difference metrics + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmimage/dcmicmph.h" /* for DicomImageComparison */ +#include "dcmtk/dcmdata/dctk.h" /* for various dcmdata headers */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/ofstd/ofcmdln.h" /* for OFCommandLine */ +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ +#include "dcmtk/oflog/oflog.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmicmp" + +static OFLogger dcmicmpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static const char *consoleDescription = "Compare DICOM images and compute difference metrics"; + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define SHORTCOL 4 +#define LONGCOL 20 + +// processing errors (80-99) +#define EXITCODE_INITIALIZE_DIFF_IMAGE 80 +#define EXITCODE_DISPLAY_PIPELINE 81 +#define EXITCODE_IMAGE_COMPARISON 82 +#define EXITCODE_LIMIT_EXCEEDED_MAX_ERROR 90 +#define EXITCODE_LIMIT_EXCEEDED_MAE 91 +#define EXITCODE_LIMIT_EXCEEDED_RMSE 92 +#define EXITCODE_LIMIT_EXCEEDED_PSNR 93 +#define EXITCODE_LIMIT_EXCEEDED_SNR 94 + +// ******************************************** + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, consoleDescription, rcsid); + OFCommandLine cmd; + + E_FileReadMode opt_readMode = ERM_autoDetect; /* default: fileformat or dataset */ + E_TransferSyntax opt_transferSyntax = EXS_Unknown; /* default: xfer syntax recognition */ + unsigned long opt_compatibilityMode = 0; + EW_WindowType opt_windowType = EWT_none; /* default: no windowing */ + OFCmdUnsignedInt opt_windowParameter = 0; + OFCmdFloat opt_windowCenter = 0.0, opt_windowWidth = 0.0; + OFBool opt_sharedWindow = OFFalse; + EF_VoiLutFunction opt_voiFunction = EFV_Default; + ES_PresentationLut opt_presShape = ESP_Default; + const char * opt_ifname1 = NULL; + const char * opt_ifname2 = NULL; + const char * opt_ofname = NULL; + + OFBool opt_checkError = OFFalse; + OFBool opt_checkMAE = OFFalse; + OFBool opt_checkRMSE = OFFalse; + OFBool opt_checkPSNR = OFFalse; + OFBool opt_checkSNR = OFFalse; + OFCmdUnsignedInt opt_checkErrorLimit = 0; + OFCmdFloat opt_checkMAELimit = 0.0; + OFCmdFloat opt_checkRMSELimit = 0.0; + OFCmdFloat opt_checkPSNRLimit = 0.0; + OFCmdFloat opt_checkSNRLimit = 0.0; + OFCmdFloat opt_amplify = 1.0; + + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + cmd.setOptionColumns(LONGCOL, SHORTCOL); + + cmd.addParam("dcmfile-in-1", "Reference DICOM image file for comparison"); + cmd.addParam("dcmfile-in-2", "Test DICOM image file for comparison"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("image processing options:"); + + cmd.addSubGroup("modality LUT transformation:"); + cmd.addOption("--use-modality", "+M", "use modality LUT transformation (default)"); + cmd.addOption("--no-modality", "-M", "ignore stored modality LUT transformation"); + + cmd.addSubGroup("VOI LUT transformation:"); + cmd.addOption("--no-windowing", "-W", "no VOI windowing (default)"); + cmd.addOption("--use-window", "+Wi", 1, "[n]umber: integer", + "use the n-th VOI window from image file"); + cmd.addOption("--use-voi-lut", "+Wl", 1, "[n]umber: integer", + "use the n-th VOI look up table from image file"); + cmd.addOption("--min-max-window", "+Wm", "compute VOI window using min-max algorithm\non both images separately"); + cmd.addOption("--min-max-window-n", "+Wn", "compute VOI window using min-max algorithm\non both images separately, ignoring extremes"); + cmd.addOption("--min-max-ref", "+Wr", "compute VOI window using min-max algorithm\nand use same window for the test image"); + cmd.addOption("--min-max-n-ref", "+Wq", "compute VOI window using min-max algorithm,\nignoring extreme values\nand use same window for the test image"); + cmd.addOption("--set-window", "+Ww", 2, "[c]enter [w]idth: float", + "compute VOI window using center c and width w"); + cmd.addOption("--linear-function", "+Wfl", "set VOI LUT function to LINEAR"); + cmd.addOption("--sigmoid-function", "+Wfs", "set VOI LUT function to SIGMOID"); + + cmd.addSubGroup("presentation LUT transformation:"); + cmd.addOption("--identity-shape", "+Pid", "set presentation LUT shape to IDENTITY"); + cmd.addOption("--inverse-shape", "+Piv", "set presentation LUT shape to INVERSE"); + cmd.addOption("--lin-od-shape", "+Pod", "set presentation LUT shape to LIN OD"); + + cmd.addGroup("image comparison metrics options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--check-error", "+ce", 1, "[l]imit: integer", + "check if max absolute error <= limit"); + cmd.addOption("--check-mae", "+cm", 1, "[l]imit: float", + "check if mean absolute error <= limit"); + cmd.addOption("--check-rmse", "+cr", 1, "[l]imit: float", + "check if root mean square error <= limit"); + cmd.addOption("--check-psnr", "+cp", 1, "[l]imit: float", + "check if PSNR >= limit"); + cmd.addOption("--check-snr", "+cs", 1, "[l]imit: float", + "check if SNR >= limit"); + + cmd.addGroup("output options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--save-diff", "+sd", 1, "[f]ilename: string", + "write secondary capture difference image"); + cmd.addOption("--amplify", "+a", 1, "[f]actor: float", + "multiply diff image pixel values by f"); + + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return EXITCODE_NO_ERROR; + } + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname1); + cmd.getParam(2, opt_ifname2); + + /* general options */ + + OFLog::configureFromCommandLine(cmd, app); + + /* input options: input file format */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + /* input options: input transfer syntax */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_transferSyntax = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_transferSyntax = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_transferSyntax = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_transferSyntax = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + /* image processing options: modality LUT transformation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-modality")) + opt_compatibilityMode |= CIF_IgnoreModalityTransformation; + if (cmd.findOption("--use-modality")) + opt_compatibilityMode &= ~CIF_IgnoreModalityTransformation; + cmd.endOptionBlock(); + + /* image processing options: VOI LUT transformation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-windowing")) + opt_windowType = EWT_none; + if (cmd.findOption("--use-window")) + { + opt_windowType = EWT_window_from_file; + app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1)); + } + if (cmd.findOption("--use-voi-lut")) + { + opt_windowType = EWT_voi_lut_from_file; + app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1)); + } + if (cmd.findOption("--min-max-window")) + { + opt_windowType = EWT_window_minmax; + opt_sharedWindow = OFFalse; + } + if (cmd.findOption("--min-max-window-n")) + { + opt_windowType = EWT_window_minmax_n; + opt_sharedWindow = OFFalse; + } + + if (cmd.findOption("--min-max-ref")) + { + opt_windowType = EWT_window_minmax; + opt_sharedWindow = OFTrue; + } + if (cmd.findOption("--min-max-n-ref")) + { + opt_windowType = EWT_window_minmax_n; + opt_sharedWindow = OFTrue; + } + + if (cmd.findOption("--set-window")) + { + opt_windowType = EWT_window_center_width; + app.checkValue(cmd.getValue(opt_windowCenter)); + app.checkValue(cmd.getValueAndCheckMin(opt_windowWidth, 1.0)); + } + cmd.endOptionBlock(); + cmd.beginOptionBlock(); + if (cmd.findOption("--linear-function")) + opt_voiFunction = EFV_Linear; + if (cmd.findOption("--sigmoid-function")) + opt_voiFunction = EFV_Sigmoid; + cmd.endOptionBlock(); + + /* image processing options: presentation LUT transformation */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--identity-shape")) + opt_presShape = ESP_Identity; + if (cmd.findOption("--inverse-shape")) + opt_presShape = ESP_Inverse; + if (cmd.findOption("--lin-od-shape")) + opt_presShape = ESP_LinOD; + cmd.endOptionBlock(); + + /* image comparison metrics options */ + + if (cmd.findOption("--check-error")) + { + opt_checkError = OFTrue; + app.checkValue(cmd.getValueAndCheckMinMax(opt_checkErrorLimit, 0, 65535)); + } + if (cmd.findOption("--check-mae")) + { + opt_checkMAE = OFTrue; + app.checkValue(cmd.getValueAndCheckMin(opt_checkMAELimit, 0.0)); + } + if (cmd.findOption("--check-rmse")) + { + opt_checkRMSE = OFTrue; + app.checkValue(cmd.getValueAndCheckMin(opt_checkRMSELimit, 0.0)); + } + if (cmd.findOption("--check-psnr")) + { + opt_checkPSNR = OFTrue; + app.checkValue(cmd.getValueAndCheckMin(opt_checkPSNRLimit, 0.0)); + } + if (cmd.findOption("--check-snr")) + { + opt_checkSNR = OFTrue; + app.checkValue(cmd.getValueAndCheckMin(opt_checkSNRLimit, 0.0)); + } + + /* output options */ + + if (cmd.findOption("--save-diff")) + { + app.checkValue(cmd.getValue(opt_ofname)); + } + + if (cmd.findOption("--amplify")) + { + app.checkDependence("--amplify", "--save-diff", (opt_ofname != NULL)); + app.checkValue(cmd.getValueAndCheckMinMax(opt_amplify, 1.0, 65535.0)); + } + + + /* print resource identifier */ + OFLOG_DEBUG(dcmicmpLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmicmpLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + DicomImageComparison dicmp; + OFCondition cond; + + if (opt_ofname) + { + // prepare the creation of a difference image file + cond = dicmp.initializeDiffImage(opt_amplify); + if (cond.bad()) + { + OFLOG_FATAL(dcmicmpLogger, "Error while initializing difference image: " << cond.text()); + return EXITCODE_INITIALIZE_DIFF_IMAGE; + } + } + + // read the reference image + cond = dicmp.readReferenceImage(opt_ifname1, opt_transferSyntax, opt_readMode, opt_compatibilityMode); + if (cond.bad()) + { + OFLOG_FATAL(dcmicmpLogger, "Error while loading reference image: " << cond.text()); + return EXITCODE_INVALID_INPUT_FILE; + } + + // read the test image + cond = dicmp.readTestImage(opt_ifname2, opt_transferSyntax, opt_readMode, opt_compatibilityMode); + if (cond.bad()) + { + OFLOG_FATAL(dcmicmpLogger, "Error while loading test image: " << cond.text()); + return EXITCODE_INVALID_INPUT_FILE; + } + + // configure the display pipelines for both images with the same parameter set + cond = dicmp.configureImages(opt_windowType, opt_sharedWindow, opt_windowParameter, opt_windowCenter, opt_windowWidth, opt_voiFunction, opt_presShape); + if (cond.bad()) + { + OFLOG_FATAL(dcmicmpLogger, "Error while configuring display pipeline: " << cond.text()); + return EXITCODE_DISPLAY_PIPELINE; + } + + // compute image comparison metrics + cond = dicmp.computeImageComparisonMetrics(opt_windowType); + if (cond.bad()) + { + OFLOG_FATAL(dcmicmpLogger, "Error while performing image comparison: " << cond.text()); + return EXITCODE_IMAGE_COMPARISON; + } + + // print image comparison metrics + COUT << "Max Absolute Error = " << dicmp.getMaxAbsoluteError() << "\n" + << "Mean Absolute Error (MAE) = " << dicmp.getMeanAbsoluteError() << "\n" + << "Root Mean Square Error (RMSE) = " << dicmp.getRootMeanSquareError() << "\n" + << "Peak Signal to Noise Ratio (PSNR) [dB] = " << dicmp.getPeakSignalToNoiseRatio() << "\n" + << "Signal to Noise Ratio (SNR) [dB] = " << dicmp.getSignalToNoiseRatio() << OFendl; + + if (opt_ofname) + { + // save difference image + cond = dicmp.saveDiffImage(opt_ofname); + if (cond.bad()) + { + OFLOG_FATAL(dcmicmpLogger, "Error while writing difference image: " << cond.text()); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + } + + // process --check options + if (opt_checkError && (dicmp.getMaxAbsoluteError() > opt_checkErrorLimit)) + { + OFLOG_FATAL(dcmicmpLogger, "Maximum absolute error " << dicmp.getMaxAbsoluteError() << " exceeds limit " << opt_checkErrorLimit); + return EXITCODE_LIMIT_EXCEEDED_MAX_ERROR; + } + + if (opt_checkMAE && (dicmp.getMeanAbsoluteError() > opt_checkMAELimit)) + { + OFLOG_FATAL(dcmicmpLogger, "Mean absolute error " << dicmp.getMeanAbsoluteError() << " exceeds limit " << opt_checkMAELimit); + return EXITCODE_LIMIT_EXCEEDED_MAE; + } + + if (opt_checkRMSE && (dicmp.getRootMeanSquareError() > opt_checkRMSELimit)) + { + OFLOG_FATAL(dcmicmpLogger, "Root mean square error (RMSE) " << dicmp.getRootMeanSquareError() << " exceeds limit " << opt_checkRMSELimit); + return EXITCODE_LIMIT_EXCEEDED_RMSE; + } + + if (opt_checkPSNR && (dicmp.getPeakSignalToNoiseRatio() < opt_checkPSNRLimit)) + { + OFLOG_FATAL(dcmicmpLogger, "Peak signal to noise ratio (PSNR) " << dicmp.getPeakSignalToNoiseRatio() << " below limit " << opt_checkPSNRLimit); + return EXITCODE_LIMIT_EXCEEDED_PSNR; + } + + if (opt_checkSNR && (dicmp.getSignalToNoiseRatio() < opt_checkSNRLimit)) + { + OFLOG_FATAL(dcmicmpLogger, "Signal to noise ratio (SNR) " << dicmp.getSignalToNoiseRatio() << " below limit " << opt_checkSNRLimit); + return EXITCODE_LIMIT_EXCEEDED_SNR; + } + + // done + return EXITCODE_NO_ERROR; +} diff --git a/dcmimage/apps/dcmquant.cc b/dcmimage/apps/dcmquant.cc new file mode 100644 index 00000000..6cd1d31a --- /dev/null +++ b/dcmimage/apps/dcmquant.cc @@ -0,0 +1,509 @@ +/* + * + * Copyright (C) 2001-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Authors: Marco Eichelberg + * + * Purpose: Convert DICOM color images palette color + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" /* for various dcmdata headers */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmimgle/dcmimage.h" /* for DicomImage */ + +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/ofstd/ofcmdln.h" /* for OFCommandLine */ + +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ +#include "dcmtk/dcmimage/diquant.h" /* for DcmQuant */ +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodec */ + +#ifdef BUILD_WITH_DCMJPEG_SUPPORT +#include "dcmtk/dcmjpeg/djdecode.h" /* for dcmjpeg decoders */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_DESCRIPTION "Convert DICOM color images to palette color" + +#ifdef BUILD_WITH_DCMJPEG_SUPPORT +#define OFFIS_CONSOLE_APPLICATION "dcmjquan" +#else +#define OFFIS_CONSOLE_APPLICATION "dcmquant" +#endif + +static OFLogger dcmquantLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define SHORTCOL 3 +#define LONGCOL 21 + + +// ******************************************** + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, OFFIS_CONSOLE_DESCRIPTION, rcsid); + OFCommandLine cmd; + + E_FileReadMode opt_readMode = ERM_autoDetect; + E_FileWriteMode opt_writeMode = EWM_fileformat; + E_TransferSyntax opt_ixfer = EXS_Unknown; + E_TransferSyntax opt_oxfer = EXS_Unknown; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + + unsigned long opt_compatibilityMode = CIF_MayDetachPixelData; + /* default: pixel data may detached if no longer needed */ + OFCmdUnsignedInt opt_frame = 1; /* default: first frame */ + OFCmdUnsignedInt opt_frameCount = 0; /* default: all frames */ + + OFBool opt_palette_ow = OFTrue; + OFBool opt_entries_word = OFFalse; + OFBool opt_palette_fs = OFFalse; + OFCmdUnsignedInt opt_palette_col = 256; + + DcmLargestDimensionType opt_largeType = DcmLargestDimensionType_default; + DcmRepresentativeColorType opt_repType = DcmRepresentativeColorType_default; + + OFBool opt_secondarycapture = OFFalse; + OFBool opt_uidcreation = OFTrue; + +#ifdef BUILD_WITH_DCMJPEG_SUPPORT + // JPEG parameters, currently not used +# if 0 + OFCmdUnsignedInt opt_quality = 90; /* default: 90% JPEG quality */ + E_SubSampling opt_sampling = ESS_422; /* default: 4:2:2 sub-sampling */ +# endif + E_DecompressionColorSpaceConversion opt_decompCSconversion = EDC_photometricInterpretation; +#endif + + const char * opt_ifname = NULL; + const char * opt_ofname = NULL; + + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + cmd.setOptionColumns(LONGCOL, SHORTCOL); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename to be written"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("image processing and encoding options:"); + cmd.addSubGroup("frame selection:"); + cmd.addOption("--frame", "+fr", 1, "[n]umber: integer", + "select specified frame"); + cmd.addOption("--all-frames", "+fa", "select all frames (default)"); + +#ifdef BUILD_WITH_DCMJPEG_SUPPORT + cmd.addSubGroup("color space conversion options (compressed images only):"); + cmd.addOption("--conv-photometric", "+cp", "convert if YCbCr photometric interpr. (default)"); + cmd.addOption("--conv-lossy", "+cl", "convert YCbCr to RGB if lossy JPEG"); + cmd.addOption("--conv-guess", "+cg", "convert to RGB if YCbCr is guessed by library"); + cmd.addOption("--conv-guess-lossy", "+cgl", "convert to RGB if lossy JPEG and YCbCr is\nguessed by the underlying JPEG library"); + cmd.addOption("--conv-always", "+ca", "always convert YCbCr to RGB"); + cmd.addOption("--conv-never", "+cn", "never convert color space"); +#endif + + cmd.addSubGroup("compatibility:"); + cmd.addOption("--accept-palettes", "+Mp", "accept incorrect palette attribute tags\n(0028,111x) and (0028,121x)"); + + cmd.addSubGroup("median cut dimension selection:"); + cmd.addOption("--mc-dimension-rgb", "+Dr", "max dimension from RGB range (default)"); + cmd.addOption("--mc-dimension-lum", "+Dl", "max dimension from luminance"); + + cmd.addSubGroup("median cut representative color selection:"); + cmd.addOption("--mc-color-avgbox", "+Cb", "average colors in box (default)"); + cmd.addOption("--mc-color-avgpixel", "+Cp", "average pixels in box"); + cmd.addOption("--mc-color-center", "+Cc", "select center of box"); + + cmd.addSubGroup("color palette value representation:"); + cmd.addOption("--write-ow", "+pw", "write Palette LUT as OW (default)"); + cmd.addOption("--write-us", "+pu", "write Palette LUT as US (retired)"); + + cmd.addSubGroup("color palette creation:"); + cmd.addOption("--lut-entries-word", "+pe", "write Palette LUT with 16-bit entries"); + cmd.addOption("--floyd-steinberg", "+pf", "use Floyd-Steinberg error diffusion"); + cmd.addOption("--colors", "+pc", 1, "number of colors: 2..65536 (default 256)", + "number of colors to quantize to"); + + cmd.addSubGroup("SOP Class UID:"); + cmd.addOption("--class-default", "+cd", "keep SOP Class UID (default)"); + cmd.addOption("--class-sc", "+cs", "convert to Secondary Capture Image\n(implies --uid-always)"); + + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-always", "+ua", "always assign new UID (default)"); + cmd.addOption("--uid-never", "+un", "never assign new UID"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(BUILD_WITH_DCMJPEG_SUPPORT) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef BUILD_WITH_DCMJPEG_SUPPORT + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--accept-palettes")) + opt_compatibilityMode |= CIF_WrongPaletteAttributeTags; + + cmd.beginOptionBlock(); + if (cmd.findOption("--frame")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_frame, 1)); + opt_frameCount = 1; + } + if (cmd.findOption("--all-frames")) + { + opt_frame = 1; + opt_frameCount = 0; + } + cmd.endOptionBlock(); + +#ifdef BUILD_WITH_DCMJPEG_SUPPORT + cmd.beginOptionBlock(); + if (cmd.findOption("--conv-photometric")) + opt_decompCSconversion = EDC_photometricInterpretation; + if (cmd.findOption("--conv-lossy")) + opt_decompCSconversion = EDC_lossyOnly; + if (cmd.findOption("--conv-guess")) + opt_decompCSconversion = EDC_guess; + if (cmd.findOption("--conv-guess-lossy")) + opt_decompCSconversion = EDC_guessLossyOnly; + if (cmd.findOption("--conv-always")) + opt_decompCSconversion = EDC_always; + if (cmd.findOption("--conv-never")) + opt_decompCSconversion = EDC_never; + cmd.endOptionBlock(); +#endif + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-ow")) opt_palette_ow = OFTrue; + if (cmd.findOption("--write-us")) opt_palette_ow = OFFalse; + cmd.endOptionBlock(); + + if (cmd.findOption("--lut-entries-word")) opt_entries_word = OFTrue; + if (cmd.findOption("--floyd-steinberg")) opt_palette_fs = OFTrue; + if (cmd.findOption("--colors")) cmd.getValueAndCheckMinMax(opt_palette_col, 2, 65536); + + cmd.beginOptionBlock(); + if (cmd.findOption("--mc-dimension-rgb")) opt_largeType = DcmLargestDimensionType_default; + if (cmd.findOption("--mc-dimension-lum")) opt_largeType = DcmLargestDimensionType_luminance; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--mc-color-avgbox")) opt_repType = DcmRepresentativeColorType_default; + if (cmd.findOption("--mc-color-avgpixel")) opt_repType = DcmRepresentativeColorType_averagePixels; + if (cmd.findOption("--mc-color-center")) opt_repType = DcmRepresentativeColorType_centerOfBox; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--class-default")) opt_secondarycapture = OFFalse; + if (cmd.findOption("--class-sc")) opt_secondarycapture = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-always")) opt_uidcreation = OFTrue; + if (cmd.findOption("--uid-never")) opt_uidcreation = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_oxfer = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_opadenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmquantLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmquantLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + +#ifdef BUILD_WITH_DCMJPEG_SUPPORT + // register global decompression codecs + DJDecoderRegistration::registerCodecs(opt_decompCSconversion); +#endif + + // ====================================================================== + // read input file + + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmquantLogger, "invalid filename: "); + return 1; + } + + DcmFileFormat fileformat; + DcmDataset *dataset = fileformat.getDataset(); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (error.bad()) + { + OFLOG_FATAL(dcmquantLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + OFLOG_INFO(dcmquantLogger, "load all data into memory"); + + /* make sure that pixel data is loaded before output file is created */ + dataset->loadAllDataIntoMemory(); + + // select uncompressed output transfer syntax. + // this will implicitly decompress the image if necessary. + + if (opt_oxfer == EXS_Unknown) + { + OFLOG_INFO(dcmquantLogger, "set output transfer syntax to input transfer syntax"); + opt_oxfer = dataset->getOriginalXfer(); + } + + OFLOG_INFO(dcmquantLogger, "check if new output transfer syntax is possible"); + + DcmXfer opt_oxferSyn(opt_oxfer); + if (dataset->chooseRepresentation(opt_oxfer, NULL).good() && dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_INFO(dcmquantLogger, "output transfer syntax " << opt_oxferSyn.getXferName() + << " can be written"); + } else { + OFLOG_FATAL(dcmquantLogger, "no conversion to transfer syntax " << opt_oxferSyn.getXferName() + << " possible"); + return 1; + } + + // ====================================================================== + // image processing starts here + + OFLOG_INFO(dcmquantLogger, "preparing pixel data."); + + // create DicomImage object + DicomImage di(dataset, opt_oxfer, opt_compatibilityMode, opt_frame - 1, opt_frameCount); + if (di.getStatus() != EIS_Normal) + { + OFLOG_FATAL(dcmquantLogger, DicomImage::getString(di.getStatus())); + return 1; + } + + if (di.isMonochrome()) + { + OFLOG_FATAL(dcmquantLogger, "cannot convert monochrome image to palette color"); + return 1; + } + + OFString derivationDescription; + + // create palette color image + error = DcmQuant::createPaletteColorImage( + di, *dataset, opt_palette_ow, opt_entries_word, opt_palette_fs, opt_palette_col, + derivationDescription, opt_largeType, opt_repType); + + // update image type + if (error.good()) error = DcmCodec::updateImageType(dataset); + + // update derivation description + if (error.good()) error = DcmQuant::updateDerivationDescription(dataset, derivationDescription.c_str()); + + // create new SOP instance UID + if (error.good() && (opt_secondarycapture || opt_uidcreation)) + error = DcmCodec::newInstance(dataset, "DCM", "121320", "Uncompressed predecessor"); + + // convert to Secondary Capture if requested by user. + // This method creates a new SOP class UID, so it should be executed + // after the call to newInstance() which creates a Source Image Sequence. + if (error.good() && opt_secondarycapture) error = DcmCodec::convertToSecondaryCapture(dataset); + + if (error.bad()) + { + OFLOG_FATAL(dcmquantLogger, error.text() << ": converting image: " << opt_ifname); + return 1; + } + + // ====================================================================== + // write back output file + + OFLOG_INFO(dcmquantLogger, "write converted DICOM file"); + + // update file meta information with new SOP Instance UID + if ((opt_uidcreation || opt_secondarycapture) && (opt_writeMode == EWM_fileformat)) + opt_writeMode = EWM_updateMeta; + + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + + if (error.bad()) + { + OFLOG_FATAL(dcmquantLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmquantLogger, "conversion successful"); + +#ifdef BUILD_WITH_DCMJPEG_SUPPORT + // deregister global decompression codecs + DJDecoderRegistration::cleanup(); +#endif + + return 0; +} diff --git a/dcmimage/apps/dcmscale.cc b/dcmimage/apps/dcmscale.cc new file mode 100644 index 00000000..7cadfce7 --- /dev/null +++ b/dcmimage/apps/dcmscale.cc @@ -0,0 +1,650 @@ +/* + * + * Copyright (C) 2002-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Authors: Joerg Riesmeier + * + * Purpose: Scale DICOM images + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" /* for various dcmdata headers */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ + +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/ofstd/ofcmdln.h" /* for OFCommandLine */ + +#include "dcmtk/oflog/oflog.h" /* for OFLogger */ + +#include "dcmtk/dcmimgle/dcmimage.h" /* for DicomImage */ +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ +#include "dcmtk/dcmdata/dcrledrg.h" /* for DcmRLEDecoderRegistration */ + +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL +#include "dcmtk/dcmjpeg/djdecode.h" /* for dcmjpeg decoders */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_DESCRIPTION "Scale DICOM images" + +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL +#define OFFIS_CONSOLE_APPLICATION "dcmjscal" +#else +#define OFFIS_CONSOLE_APPLICATION "dcmscale" +#endif + +static OFLogger dcmscaleLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define SHORTCOL 4 +#define LONGCOL 21 + + +// ******************************************** + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, OFFIS_CONSOLE_DESCRIPTION, rcsid); + OFCommandLine cmd; + + OFBool opt_uidCreation = OFTrue; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_FileWriteMode opt_writeMode = EWM_fileformat; + E_TransferSyntax opt_ixfer = EXS_Unknown; + E_TransferSyntax opt_oxfer = EXS_Unknown; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL + // JPEG parameters, currently not used +# if 0 + OFCmdUnsignedInt opt_quality = 90; /* default: 90% JPEG quality */ + E_SubSampling opt_sampling = ESS_422; /* default: 4:2:2 sub-sampling */ +# endif + E_DecompressionColorSpaceConversion opt_decompCSconversion = EDC_photometricInterpretation; +#endif + + int opt_useAspectRatio = 1; /* default: use aspect ratio for scaling */ + OFCmdUnsignedInt opt_useInterpolation = 1; /* default: use interpolation method '1' for scaling */ + int opt_scaleType = 0; /* default: no scaling */ + /* 1 = X-factor, 2 = Y-factor, 3=X-size, 4=Y-size */ + OFCmdFloat opt_scale_factor = 1.0; + OFCmdUnsignedInt opt_scale_size = 1; + + OFBool opt_useClip = OFFalse; /* default: don't clip */ + OFCmdSignedInt opt_left = 0, opt_top = 0; /* clip region (origin) */ + OFCmdUnsignedInt opt_width = 0, opt_height = 0; /* clip region (extension) */ + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + cmd.setOptionColumns(LONGCOL, SHORTCOL); + + cmd.addParam("dcmfile-in", "DICOM input filename to be scaled"); + cmd.addParam("dcmfile-out", "DICOM output filename to be written"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("image processing and encoding options:"); +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL + cmd.addSubGroup("color space conversion options (compressed images only):"); + cmd.addOption("--conv-photometric", "+cp", "convert if YCbCr photometric interpr. (default)"); + cmd.addOption("--conv-lossy", "+cl", "convert YCbCr to RGB if lossy JPEG"); + cmd.addOption("--conv-guess", "+cg", "convert to RGB if YCbCr is guessed by library"); + cmd.addOption("--conv-guess-lossy", "+cgl", "convert to RGB if lossy JPEG and YCbCr is\nguessed by the underlying JPEG library"); + cmd.addOption("--conv-always", "+ca", "always convert YCbCr to RGB"); + cmd.addOption("--conv-never", "+cn", "never convert color space"); +#endif + cmd.addSubGroup("scaling:"); + cmd.addOption("--recognize-aspect", "+a", "recognize pixel aspect ratio (default)"); + cmd.addOption("--ignore-aspect", "-a", "ignore pixel aspect ratio when scaling"); + cmd.addOption("--interpolate", "+i", 1, "[n]umber of algorithm: integer", + "use interpolation when scaling (1..4, def: 1)"); + cmd.addOption("--no-interpolation", "-i", "no interpolation when scaling"); + cmd.addOption("--no-scaling", "-S", "no scaling, ignore pixel aspect ratio (default)"); + cmd.addOption("--scale-x-factor", "+Sxf", 1, "[f]actor: float", + "scale x axis by factor, auto-compute y axis"); + cmd.addOption("--scale-y-factor", "+Syf", 1, "[f]actor: float", + "scale y axis by factor, auto-compute x axis"); + cmd.addOption("--scale-x-size", "+Sxv", 1, "[n]umber: integer", + "scale x axis to n pixels, auto-compute y axis"); + cmd.addOption("--scale-y-size", "+Syv", 1, "[n]umber: integer", + "scale y axis to n pixels, auto-compute x axis"); + cmd.addSubGroup("other transformations:"); + cmd.addOption("--clip-region", "+C", 4, "[l]eft [t]op [w]idth [h]eight: integer", + "clip rectangular image region (l, t, w, h)"); + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-always", "+ua", "always assign new SOP Instance UID (default)"); + cmd.addOption("--uid-never", "+un", "never assign new SOP Instance UID"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(BUILD_DCMSCALE_AS_DCMJSCAL) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* general options */ + + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + /* image processing options: color space conversion */ + +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL + cmd.beginOptionBlock(); + if (cmd.findOption("--conv-photometric")) + opt_decompCSconversion = EDC_photometricInterpretation; + if (cmd.findOption("--conv-lossy")) + opt_decompCSconversion = EDC_lossyOnly; + if (cmd.findOption("--conv-guess")) + opt_decompCSconversion = EDC_guess; + if (cmd.findOption("--conv-guess-lossy")) + opt_decompCSconversion = EDC_guessLossyOnly; + if (cmd.findOption("--conv-always")) + opt_decompCSconversion = EDC_always; + if (cmd.findOption("--conv-never")) + opt_decompCSconversion = EDC_never; + cmd.endOptionBlock(); +#endif + + /* image processing options: scaling */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--recognize-aspect")) + opt_useAspectRatio = 1; + if (cmd.findOption("--ignore-aspect")) + opt_useAspectRatio = 0; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--interpolate")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_useInterpolation, 1, 4)); + if (cmd.findOption("--no-interpolation")) + opt_useInterpolation = 0; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-scaling")) + opt_scaleType = 0; + if (cmd.findOption("--scale-x-factor")) + { + opt_scaleType = 1; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_factor, 0.0, OFFalse)); + } + if (cmd.findOption("--scale-y-factor")) + { + opt_scaleType = 2; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_factor, 0.0, OFFalse)); + } + if (cmd.findOption("--scale-x-size")) + { + opt_scaleType = 3; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_size, 1)); + } + if (cmd.findOption("--scale-y-size")) + { + opt_scaleType = 4; + app.checkValue(cmd.getValueAndCheckMin(opt_scale_size, 1)); + } + cmd.endOptionBlock(); + + /* image processing options: other transformations */ + + if (cmd.findOption("--clip-region")) + { + app.checkValue(cmd.getValue(opt_left)); + app.checkValue(cmd.getValue(opt_top)); + app.checkValue(cmd.getValue(opt_width)); + app.checkValue(cmd.getValue(opt_height)); + opt_useClip = OFTrue; + } + + /* image processing options: SOP Instance UID options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-always")) opt_uidCreation = OFTrue; + if (cmd.findOption("--uid-never")) opt_uidCreation = OFFalse; + cmd.endOptionBlock(); + + /* output options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_oxfer = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_opadenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmscaleLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmscaleLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // register RLE decompression codec + DcmRLEDecoderRegistration::registerCodecs(); +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL + // register global decompression codecs + DJDecoderRegistration::registerCodecs(opt_decompCSconversion); +#endif + + // ====================================================================== + // read input file + + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmscaleLogger, "invalid input filename: "); + return 1; + } + + /* no clipping/scaling */ + if (!opt_scaleType && !opt_useClip) + { + OFLOG_FATAL(dcmscaleLogger, "nothing to do"); + return 1; + } + + OFLOG_INFO(dcmscaleLogger, "open input file " << opt_ifname); + + DcmFileFormat fileformat; + DcmDataset *dataset = fileformat.getDataset(); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (error.bad()) + { + OFLOG_FATAL(dcmscaleLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + OFLOG_INFO(dcmscaleLogger, "load all data into memory"); + + /* make sure that pixel data is loaded before output file is created */ + dataset->loadAllDataIntoMemory(); + + // select uncompressed output transfer syntax. + // this will implicitly decompress the image if necessary. + + if (opt_oxfer == EXS_Unknown) + { + OFLOG_INFO(dcmscaleLogger, "set output transfer syntax to input transfer syntax"); + opt_oxfer = dataset->getOriginalXfer(); + } + + OFLOG_INFO(dcmscaleLogger, "check if new output transfer syntax is possible"); + + DcmXfer opt_oxferSyn(opt_oxfer); + if (dataset->chooseRepresentation(opt_oxfer, NULL).good() && dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_INFO(dcmscaleLogger, "output transfer syntax " << opt_oxferSyn.getXferName() + << " can be written"); + } else { + OFLOG_FATAL(dcmscaleLogger, "no conversion to transfer syntax " << opt_oxferSyn.getXferName() + << " possible"); + return 1; + } + + // ====================================================================== + // image processing starts here + + OFLOG_INFO(dcmscaleLogger, "preparing pixel data"); + + const unsigned long flags = (opt_scaleType > 0) ? CIF_MayDetachPixelData : 0; + // create DicomImage object + DicomImage *di = new DicomImage(dataset, opt_oxfer, flags); + if (di == NULL) + { + OFLOG_FATAL(dcmscaleLogger, "memory exhausted"); + return 1; + } + if (di->getStatus() != EIS_Normal) + { + OFLOG_FATAL(dcmscaleLogger, DicomImage::getString(di->getStatus())); + return 1; + } + + DicomImage *newimage = NULL; + OFString derivationDescription; + + if (opt_useClip) + OFLOG_INFO(dcmscaleLogger, "clipping image to (" << opt_left << "," << opt_top + << "," << opt_width << "," << opt_height << ")"); + // perform clipping (without scaling) + if (opt_scaleType <= 0) + { + if (opt_useClip) + { + newimage = di->createClippedImage(opt_left, opt_top, opt_width, opt_height); + derivationDescription = "Clipped rectangular image region"; + } + } + // perform scaling (and possibly clipping) + else if (opt_scaleType <= 4) + { + switch (opt_scaleType) + { + case 1: + OFLOG_INFO(dcmscaleLogger, "scaling image, X factor=" << opt_scale_factor + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, opt_scale_factor, 0.0, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(opt_scale_factor, 0.0, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + case 2: + OFLOG_INFO(dcmscaleLogger, "scaling image, Y factor=" << opt_scale_factor + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, 0.0, opt_scale_factor, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(0.0, opt_scale_factor, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + case 3: + OFLOG_INFO(dcmscaleLogger, "scaling image, X size=" << opt_scale_size + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, opt_scale_size, 0, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(opt_scale_size, 0, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + case 4: + OFLOG_INFO(dcmscaleLogger, "scaling image, Y size=" << opt_scale_size + << ", Interpolation=" << OFstatic_cast(int, opt_useInterpolation) + << ", Aspect Ratio=" << (opt_useAspectRatio ? "yes" : "no")); + if (opt_useClip) + newimage = di->createScaledImage(opt_left, opt_top, opt_width, opt_height, 0, opt_scale_size, + OFstatic_cast(int, opt_useInterpolation), opt_useAspectRatio); + else + newimage = di->createScaledImage(0, opt_scale_size, OFstatic_cast(int, opt_useInterpolation), + opt_useAspectRatio); + break; + default: + break; + } + if (opt_useClip) + derivationDescription = "Scaled rectangular image region"; + else + derivationDescription = "Scaled image"; + } + if (opt_scaleType > 4) + OFLOG_ERROR(dcmscaleLogger, "internal error: unknown scaling type"); + else if (newimage == NULL) + { + OFLOG_FATAL(dcmscaleLogger, "cannot create new image"); + return 1; + } + else if (newimage->getStatus() != EIS_Normal) + { + OFLOG_FATAL(dcmscaleLogger, DicomImage::getString(newimage->getStatus())); + return 1; + } + /* write scaled image to dataset (update attributes of Image Pixel Module) */ + else if (!newimage->writeImageToDataset(*dataset)) + { + OFLOG_FATAL(dcmscaleLogger, "cannot write new image to dataset"); + return 1; + } + delete newimage; + + /* cleanup original image */ + delete di; + + // ====================================================================== + // update some header attributes + + // update Derivation Description + if (!derivationDescription.empty()) + { + const char *oldDerivation = NULL; + if (dataset->findAndGetString(DCM_DerivationDescription, oldDerivation).good()) + { + // append old Derivation Description, if any + derivationDescription += " ["; + derivationDescription += oldDerivation; + derivationDescription += "]"; + if (derivationDescription.length() > 1024) + { + // ST is limited to 1024 characters, cut off tail + derivationDescription.erase(1020); + derivationDescription += "...]"; + } + } + dataset->putAndInsertString(DCM_DerivationDescription, derivationDescription.c_str()); + } + + // update Image Type + OFString imageType = "DERIVED"; + const char *oldImageType = NULL; + if (dataset->findAndGetString(DCM_ImageType, oldImageType).good()) + { + if (oldImageType != NULL) + { + // append old image type information beginning with second entry + const char *pos = strchr(oldImageType, '\\'); + if (pos != NULL) + imageType += pos; + } + } + dataset->putAndInsertString(DCM_ImageType, imageType.c_str()); + + // update SOP Instance UID + if (opt_uidCreation) + { + // add reference to source image + DcmItem *ditem = NULL; + const char *sopClassUID = NULL; + const char *sopInstanceUID = NULL; + if (dataset->findAndGetString(DCM_SOPClassUID, sopClassUID).good() && + dataset->findAndGetString(DCM_SOPInstanceUID, sopInstanceUID).good()) + { + dataset->findAndDeleteElement(DCM_SourceImageSequence); + if (dataset->findOrCreateSequenceItem(DCM_SourceImageSequence, ditem).good()) + { + ditem->putAndInsertString(DCM_SOPClassUID, sopClassUID); + ditem->putAndInsertString(DCM_SOPInstanceUID, sopInstanceUID); + } + } + // create new SOP instance UID + char new_uid[100]; + dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(new_uid)); + // force meta-header to refresh SOP Instance UID + if (opt_writeMode == EWM_fileformat) + opt_writeMode = EWM_updateMeta; + } + + // ====================================================================== + // write back output file + + OFLOG_INFO(dcmscaleLogger, "create output file " << opt_ofname); + + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + + if (error.bad()) + { + OFLOG_FATAL(dcmscaleLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmscaleLogger, "conversion successful"); + + // deregister RLE decompression codec + DcmRLEDecoderRegistration::cleanup(); +#ifdef BUILD_DCMSCALE_AS_DCMJSCAL + // deregister global decompression codecs + DJDecoderRegistration::cleanup(); +#endif + + return 0; +} diff --git a/dcmimage/configure b/dcmimage/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmimage/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmimage/data/Makefile.in b/dcmimage/data/Makefile.in new file mode 100644 index 00000000..d2fd21f1 --- /dev/null +++ b/dcmimage/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmimage/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimage/docs/Makefile.in b/dcmimage/docs/Makefile.in new file mode 100644 index 00000000..91c2c5e8 --- /dev/null +++ b/dcmimage/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmimage/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimage/docs/dcm2pnm.man b/dcmimage/docs/dcm2pnm.man new file mode 100644 index 00000000..cbd48576 --- /dev/null +++ b/dcmimage/docs/dcm2pnm.man @@ -0,0 +1,502 @@ +/*! + +\if MANPAGES +\page dcm2pnm Convert DICOM images to PGM/PPM, PNG, TIFF or BMP +\else +\page dcm2pnm dcm2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF or BMP +\endif + +\section dcm2pnm_synopsis SYNOPSIS + +\verbatim +dcm2pnm [options] dcmfile-in [bitmap-out] +\endverbatim + +\section dcm2pnm_description DESCRIPTION + +The \b dcm2pnm utility reads a DICOM image, converts the pixel data according +to the selected image processing options and writes back an image in the +well-known PGM/PPM (portable gray map / portable pix map), PNG, TIFF or +Windows BMP format. This utility only supports uncompressed and RLE +compressed DICOM images. The command line tool \b dcmj2pnm also supports a +number of JPEG compression schemes. + +\section dcm2pnm_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +bitmap-out output filename to be written (default: stdout) +\endverbatim + +\section dcm2pnm_options OPTIONS + +\subsection dcm2pnm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcm2pnm_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcm2pnm_image_processing_options image processing options +\verbatim +frame selection: + + +F --frame [n]umber: integer + select specified frame (default: 1) + + +Fr --frame-range [n]umber [c]ount: integer + select c frames beginning with frame n + + +Fa --all-frames + select all frames + +rotation: + + +Rl --rotate-left + rotate image left (-90 degrees) + + +Rr --rotate-right + rotate image right (+90 degrees) + + +Rtd --rotate-top-down + rotate image top-down (180 degrees) + +flipping: + + +Lh --flip-horizontally + flip image horizontally + + +Lv --flip-vertically + flip image vertically + + +Lhv --flip-both-axes + flip image horizontally and vertically + +scaling: + + +a --recognize-aspect + recognize pixel aspect ratio (default) + + -a --ignore-aspect + ignore pixel aspect ratio when scaling + + +i --interpolate [n]umber of algorithm: integer + use interpolation when scaling (1..4, default: 1) + + -i --no-interpolation + no interpolation when scaling + + -S --no-scaling + no scaling, ignore pixel aspect ratio (default) + + +Sxf --scale-x-factor [f]actor: float + scale x axis by factor, auto-compute y axis + + +Syf --scale-y-factor [f]actor: float + scale y axis by factor, auto-compute x axis + + +Sxv --scale-x-size [n]umber: integer + scale x axis to n pixels, auto-compute y axis + + +Syv --scale-y-size [n]umber: integer + scale y axis to n pixels, auto-compute x axis + +modality LUT transformation: + + -M --no-modality + ignore stored modality LUT transformation + + +M --use-modality + use modality LUT transformation (default) + +VOI LUT transformation: + + -W --no-windowing + no VOI windowing (default) + + +Wi --use-window [n]umber: integer + use the n-th VOI window from image file + + +Wl --use-voi-lut [n]umber: integer + use the n-th VOI look up table from image file + + +Wm --min-max-window + compute VOI window using min-max algorithm + + +Wn --min-max-window-n + compute VOI window using min-max algorithm, + ignoring extreme values + + +Wr --roi-min-max-window [l]eft [t]op [w]idth [h]eight: integer + compute ROI window using min-max algorithm, + region of interest is specified by l,t,w,h + + +Wh --histogram-window [n]umber: integer + compute VOI window using Histogram algorithm, + ignoring n percent + + +Ww --set-window [c]enter [w]idth: float + compute VOI window using center c and width w + + +Wfl --linear-function + set VOI LUT function to LINEAR + + +Wfs --sigmoid-function + set VOI LUT function to SIGMOID + +presentation LUT transformation: + + +Pid --identity-shape + set presentation LUT shape to IDENTITY + + +Piv --inverse-shape + set presentation LUT shape to INVERSE + + +Pod --lin-od-shape + set presentation LUT shape to LIN OD + +overlay: + + -O --no-overlays + do not display overlays + + +O --display-overlay [n]umber: integer + display overlay n (0..16, 0=all, default: +O 0) + + +Omr --ovl-replace + use overlay mode "Replace" + (default for Graphic overlays) + + +Omt --ovl-threshold + use overlay mode "Threshold Replace" + + +Omc --ovl-complement + use overlay mode "Complement" + + +Omv --ovl-invert + use overlay mode "Invert Bitmap" + + +Omi --ovl-roi + use overlay mode "Region of Interest" + (default for ROI overlays) + + +Osf --set-foreground [d]ensity: float + set overlay foreground density (0..1, default: 1) + + +Ost --set-threshold [d]ensity: float + set overlay threshold density (0..1, default: 0.5) + +display LUT transformation: + + +Dm --monitor-file [f]ilename: string + calibrate output according to monitor characteristics + defined in f + + +Dp --printer-file [f]ilename: string + calibrate output according to printer characteristics + defined in f + + +Da --ambient-light [a]mbient light: float + ambient light value (cd/m^2, default: file f) + + +Di --illumination [i]llumination: float + illumination value (cd/m^2, default: file f) + + +Dn --min-density [m]inimum optical density: float + Dmin value (default: off, only with +Dp) + + +Dx --max-density [m]aximum optical density: float + Dmax value (default: off, only with +Dp) + + +Dg --gsd-function + use GSDF for calibration (default for +Dm/+Dp) + + +Dc --cielab-function + use CIELAB function for calibration + +compatibility: + + +Ma --accept-acr-nema + accept ACR-NEMA images without photometric + interpretation + + +Mp --accept-palettes + accept incorrect palette attribute tags + (0028,111x) and (0028,121x) + + +Mc --check-lut-depth + check 3rd value of the LUT descriptor, compare + with expected bit depth based on LUT data + + +Mm --ignore-mlut-depth + ignore 3rd value of the modality LUT descriptor, + determine bits per table entry automatically + + +Mv --ignore-vlut-depth + ignore 3rd value of the VOI LUT descriptor, + determine bits per table entry automatically + +TIFF format: + + +Tl --compr-lzw + LZW compression (default) + + +Tr --compr-rle + RLE compression + + +Tn --compr-none + uncompressed + + +Pd --predictor-default + no LZW predictor (default) + + +Pn --predictor-none + LZW predictor 1 (no prediction) + + +Ph --predictor-horz + LZW predictor 2 (horizontal differencing) + + +Rs --rows-per-strip [r]ows: integer (default: 0) + rows per strip, default 8K per strip + +PNG format: + + +il --interlace + create interlaced file (default) + + -il --nointerlace + create non-interlaced file + + +mf --meta-file + create PNG file meta information (default) + + -mf --meta-none + no PNG file meta information + +other transformations: + + +G --grayscale + convert to grayscale if necessary + + +P --change-polarity + change polarity (invert pixel output) + + +C --clip-region [l]eft [t]op [w]idth [h]eight: integer + clip image region (l, t, w, h) +\endverbatim + +\subsection dcm2pnm_output_options output options +\verbatim +general: + + -im --image-info + print image details (requires verbose mode) + + -o --no-output + do not create any output (useful with -im) + +filename generation (only with --frame-range or --all-frames): + + +Fc --use-frame-counter + use 0-based counter for filenames (default) + + +Fn --use-frame-number + use absolute frame number for filenames + +image format: + + +op --write-raw-pnm + write 8-bit binary PGM/PPM (default for files) + + +opb --write-8-bit-pnm + write 8-bit ASCII PGM/PPM (default for stdout) + + +opw --write-16-bit-pnm + write 16-bit ASCII PGM/PPM + + +opn --write-n-bit-pnm [n]umber: integer + write n-bit ASCII PGM/PPM (1..32) + + +ob --write-bmp + write 8-bit (monochrome) or 24-bit (color) BMP + + +obp --write-8-bit-bmp + write 8-bit palette BMP (monochrome only) + + +obt --write-24-bit-bmp + write 24-bit truecolor BMP + + +obr --write-32-bit-bmp + write 32-bit truecolor BMP + + +ot --write-tiff + write 8-bit (monochrome) or 24-bit (color) TIFF + + +on --write-png + write 8-bit (monochrome) or 24-bit (color) PNG + + +on2 --write-16-bit-png + write 16-bit (monochrome) or 48-bit (color) PNG +\endverbatim + +\section dcm2pnm_notes NOTES + +The following preferred interpolation algorithms can be selected using the +\e --interpolate option: + +\li 1 = free scaling algorithm with interpolation from pbmplus toolkit +\li 2 = free scaling algorithm with interpolation from c't magazine +\li 3 = magnification algorithm with bilinear interpolation from Eduard Stanescu +\li 4 = magnification algorithm with bicubic interpolation from Eduard Stanescu + +The \e --write-tiff option is only available when DCMTK has been configured +and compiled with support for the external \b libtiff TIFF library. The +availability of the TIFF compression options depends on the \b libtiff +configuration. In particular, the patented LZW algorithm may not be +available. + +The \e --write-png option is only available when DCMTK has been configured +and compiled with support for the external \b libpng PNG library. Option +\e --interlace enables progressive image view while loading the PNG file. +Only a few applications take care of the meta info (TEXT) in a PNG file. + +\section dcm2pnm_transfer_syntaxes TRANSFER SYNTAXES + +\b dcm2pnm supports the following transfer syntaxes for input (\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +RLELosslessTransferSyntax 1.2.840.10008.1.2.5 +\endverbatim + +(*) if compiled with zlib support enabled + +\section dcm2pnm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcm2pnm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcm2pnm_environment ENVIRONMENT + +The \b dcm2pnm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcm2pnm_files FILES + +\/camera.lut - sample characteristics file of a camera +\n\/monitor.lut - sample characteristics file of a monitor +\n\/printer.lut - sample characteristics file of a printer +\n\/scanner.lut - sample characteristics file of a scanner + +\section dcm2pnm_see_also SEE ALSO + +dcmj2pnm(1), img2dcm(1) + +\section dcm2pnm_copyright COPYRIGHT + +Copyright (C) 1998-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmimage/docs/dcmicmp.man b/dcmimage/docs/dcmicmp.man new file mode 100644 index 00000000..37e84464 --- /dev/null +++ b/dcmimage/docs/dcmicmp.man @@ -0,0 +1,377 @@ +/*! + +\if MANPAGES +\page dcmicmp Compare DICOM images and compute difference metrics +\else +\page dcmicmp dcmicmp: Compare DICOM images and compute difference metrics +\endif + +\section dcmicmp_synopsis SYNOPSIS + +\verbatim +dcmicmp [options] dcmfile-in-1 dcmfile-in-2 +\endverbatim + +\section dcmicmp_description DESCRIPTION + +The \b dcmicmp utility reads two DICOM images, an original "reference +image" and a post-processed "test image", to which some kind of processing +such as a lossy image compression, followed by decompression, has been applied. +This tool requires that both images have the same resolution, the same number +of frames and are either both color or monochrome. Compressed images are +not supported. + +The \b dcmicmp utility then compares both images and computes and prints +metrics that describe how similar or different both images are: + + - the maximum absolute error is the largest difference between an + pixel value in the reference image and the corresponding pixel value in the + test image. + - the mean absolute error (MAE) is the average difference between original + pixel value and test image pixel value + - the root mean square error (RMSE) is computed by adding the squares of all + difference values, then dividing by the number of values added, and + then taking the square root. + - The peak signal to noise ratio (PSNR) considers the reference image as + a signal and the differences between reference and test image as noise. + PSNR is the maximum signal strength (i.e. maximum pixel value in the + reference image) divided by the RMSE, expressed on a logarithmic scale in + dB. + - The signal to noise ratio (PSNR) also considers the reference image as + a signal and the differences between reference and test image as noise. + SNR is the average signal strength divided by the RMSE, expressed on + a logarithmic scale in dB. + +All metrics are computed as defined in R.C. Gonzalez and R.E. Woods, +"Digital Image Processing," Prentice Hall 2008. + +\section dcmicmp_parameters PARAMETERS + +\verbatim +dcmfile-in-1 Reference DICOM image file for comparison + +dcmfile-in-2 Test DICOM image file for comparison +\endverbatim + +\section dcmicmp_options OPTIONS + +\subsection dcmicmp_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmicmp_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmicmp_image_processing_options image processing options +\verbatim +modality LUT transformation: + + +M --use-modality + use modality LUT transformation (default) + + -M --no-modality + ignore stored modality LUT transformation + +VOI LUT transformation: + + -W --no-windowing + no VOI windowing (default) + + +Wi --use-window [n]umber: integer + use the n-th VOI window from image file + + +Wl --use-voi-lut [n]umber: integer + use the n-th VOI look up table from image file + + +Wm --min-max-window + compute VOI window using min-max algorithm + on both images separately + + +Wn --min-max-window-n + compute VOI window using min-max algorithm + on both images separately, ignoring extremes + + +Wr --min-max-ref + compute VOI window using min-max algorithm + and use same window for the test image + + +Wq --min-max-n-ref + compute VOI window using min-max algorithm, + ignoring extreme values + and use same window for the test image + + +Ww --set-window [c]enter [w]idth: float + compute VOI window using center c and width w + + +Wfl --linear-function + set VOI LUT function to LINEAR + + +Wfs --sigmoid-function + set VOI LUT function to SIGMOID + +presentation LUT transformation: + + +Pid --identity-shape + set presentation LUT shape to IDENTITY + + +Piv --inverse-shape + set presentation LUT shape to INVERSE + + +Pod --lin-od-shape + set presentation LUT shape to LIN OD +\endverbatim + +\subsection dcmicmp_image_comparison_metrics_options image comparison metrics options +\verbatim + +ce --check-error [l]imit: integer + check if max absolute error <= limit + + # Return exit code EXITCODE_LIMIT_EXCEEDED_MAX_ERROR if the computed + # maximum absolute error is larger than the given limit. + + +cm --check-mae [l]imit: float + check if mean absolute error <= limit + + # Return exit code EXITCODE_LIMIT_EXCEEDED_MAE if the computed + # mean absolute error is larger than the given limit. + + +cr --check-rmse [l]imit: float + check if root mean square error <= limit + + # Return exit code EXITCODE_LIMIT_EXCEEDED_RMSE if the computed + # root mean square error is larger than the given limit. + + +cp --check-psnr [l]imit: float + check if PSNR >= limit + + # Return exit code EXITCODE_LIMIT_EXCEEDED_PSNR if the computed + # peak signal to noise ratio is smaller than the given limit + # (for PSNR, higher values mean better image quality) + + +cs --check-snr [l]imit: float + check if SNR >= limit + + # Return exit code EXITCODE_LIMIT_EXCEEDED_PSNR if the computed + # signal to noise ratio is smaller than the given limit + # (for SNR, higher values mean better image quality) +\endverbatim + +\subsection dcmicmp_output_options output options +\verbatim + +sd --save-diff [f]ilename: string + write secondary capture difference image + + # Create a Multiframe Secondary Capture image that contains a + # difference image between reference and test image. For monochrome + # images, one difference frame is created for each frame in the reference + # image. For color images, three monochrome frames are created for each + # frame in the reference image, corresponding to the differences in the + # red, green and blue color plane. The difference image will have + # BitsStored 8 or 16, depending on the properties of the reference image. + + +a --amplify [f]actor: float + multiply diff image pixel values by f + + # This option can be used to amplify the grayscale values in the + # difference image by multiplying each value with the given factor. + # Alternatively, a DICOM VOI LUT window may be used when visualizing + # the difference image. +\endverbatim + +\section dcmicmp_notes NOTES + +\subsection dcmicmp_notes_display_pipeline grayscale display pipeline + +Monochrome DICOM images require that a multi-stage display pipeline is +executed in order to convert the raw pixel values to the so-called +presentation values (p-values) that are sent to the (possibly calibrated) +display. When comparing the similarity of images before and after +post-processing, it can be relevant to activate some stages of this +display pipeline before calculating the difference image and metrics. +The image processing options allow the caller to either activate or +deactivate the Modality LUT, VOI LUT and Presentation LUT transformations. +In any case, the same transformation is applied to both images, although +possibly with different parameters if for example the "first VOI LUT window" +stored in each image is applied. This assumes that the post-processing +algorithm (e.g. compression algorithm) has adapted the values of such windows +during compression such that the image display after applying the window +is as close as possible to the reference. For images with more than +8 bits/sample it may be important to known which VOI LUT transformation +will be applied by the user when viewing the image, because this may +affect the perceived image quality. Therefore, absolute Window parameters +can also be given with the --set-window option, which will then be +applied to both images. + +\subsection dcmicmp_notes_diagnostics suitability of images for diagnostic purposes + +The user should also note that the metrics computed by this tool +cannot predict or estimate the suitability of lossy compressed +image for diagnostic purposes. Much more complex image processing +and an understanding of the image content (e.g. body part) would be +needed for this purpose. The metrics computed provide an estimation +of the level of distortion caused by the post-processing - no more and +no less. + +\section dcmicmp_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmicmp supports the following transfer syntaxes for input: + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +The difference image file is always written in Little Endian Implicit Transfer Syntax. + +(*) if compiled with zlib support enabled + +\section dcmicmp_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmicmp_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. + +\section dcmicmp_exit_codes EXIT CODES + +The \b dcmicmp utility uses the following exit codes when terminating. This +enables the user to check for the reason why the application terminated. + +\subsection dcmicmp_exit_codes_general general +\verbatim +EXITCODE_NO_ERROR 0 +EXITCODE_COMMANDLINE_SYNTAX_ERROR 1 +\endverbatim + +\subsection dcmicmp_exit_codes_input_file_errors input/output file errors +\verbatim +EXITCODE_INVALID_INPUT_FILE 22 +EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40 +\endverbatim + +\subsection dcmicmp_exit_codes_image_processing image processing errors +\verbatim +EXITCODE_INITIALIZE_DIFF_IMAGE 80 +EXITCODE_DISPLAY_PIPELINE 81 +EXITCODE_IMAGE_COMPARISON 82 +\endverbatim + +\subsection dcmicmp_exit_codes_limit_exceeded error codes for exceeded limits +\verbatim +EXITCODE_LIMIT_EXCEEDED_MAX_ERROR 90 +EXITCODE_LIMIT_EXCEEDED_MAE 91 +EXITCODE_LIMIT_EXCEEDED_RMSE 92 +EXITCODE_LIMIT_EXCEEDED_PSNR 93 +EXITCODE_LIMIT_EXCEEDED_SNR 94 +\endverbatim + +\section dcmicmp_environment ENVIRONMENT + +The \b dcmicmp utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmicmp_see_also SEE ALSO + +dcm2pnm(1) + +\section dcmicmp_copyright COPYRIGHT + +Copyright (C) 2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmimage/docs/dcmimage.dox b/dcmimage/docs/dcmimage.dox new file mode 100644 index 00000000..ccd922df --- /dev/null +++ b/dcmimage/docs/dcmimage.dox @@ -0,0 +1,44 @@ +/*! + +\page mod_dcmimage dcmimage: adds support for color images to dcmimgle + +This module contains classes to access and render DICOM color images. Support +for monochrome images is provided by the module \ref mod_dcmimgle "dcmimgle". +Support for JPEG compressed images is provide by the module +\ref mod_dcmjpeg "dcmjpeg". + +The main interface class is: +\li \b DicomImage (from module \ref mod_dcmimgle "dcmimgle") + +\section Tools + +This module contains the following command line tools: +\li \ref dcm2pnm +\li \ref dcmquant +\li \ref dcmscale + +\section Examples + +The following example shows how to load a DICOM single-frame image (monochrome +or color) and render its pixel data: + +\code +#include "dcmtk/dcmimage/diregist.h" /* required to support color images */ +/* ... */ +DicomImage *image = new DicomImage("test.dcm"); +if (image != NULL) +{ + if (image->getStatus() == EIS_Normal) + { + Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits per sample */)); + if (pixelData != NULL) + { + /* do something useful with the pixel data */ + } + } else + cerr << "Error: cannot load DICOM image (" << DicomImage::getString(image->getStatus()) << ")" << endl; +} +delete image; +\endcode + +*/ diff --git a/dcmimage/docs/dcmquant.man b/dcmimage/docs/dcmquant.man new file mode 100644 index 00000000..af50d5a1 --- /dev/null +++ b/dcmimage/docs/dcmquant.man @@ -0,0 +1,289 @@ +/*! + +\if MANPAGES +\page dcmquant Convert DICOM color images to palette color +\else +\page dcmquant dcmquant: Convert DICOM color images to palette color +\endif + +\section dcmquant_synopsis SYNOPSIS + +\verbatim +dcmquant [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmquant_description DESCRIPTION + +The \b dcmquant utility reads a DICOM color image, computes a palette color +look-up table of the desired size for this image (based on the median cut +algorithm published by Paul Heckbert) and converts the color image into a +DICOM palette color image. + +\section dcmquant_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename to be written +\endverbatim + +\section dcmquant_options OPTIONS + +\subsection dcmquant_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmquant_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmquant_processing_options image processing and encoding options +\verbatim +frame selection: + + +F --frame [n]umber: integer + select specified frame + + +Fa --all-frames + select all frames (default) + +compatibility: + + +Mp --accept-palettes + accept incorrect palette attribute tags + (0028,111x) and (0028,121x) + +median cut dimension selection: + + +Dr --mc-dimension-rgb + max dimension from RGB range (default) + + +Dl --mc-dimension-lum + max dimension from luminance + +median cut representative color selection: + + +Cb --mc-color-avgbox + average colors in box (default) + + +Cp --mc-color-avgpixel + average pixels in box + + +Cc --mc-color-center + select center of box + +color palette value representation: + + +pw --write-ow + write Palette LUT as OW (default) + + +pu --write-us + write Palette LUT as US (retired) + +color palette creation: + + +pe --lut-entries-word + write Palette LUT with 16-bit entries + + +pf --floyd-steinberg + use Floyd-Steinberg error diffusion + + +pc --colors number of colors: 2..65536 (default 256) + number of colors to quantize to + +SOP Class UID: + + +cd --class-default + keep SOP Class UID (default) + + +cs --class-sc + convert to Secondary Capture Image + (implies --uid-always) + +SOP Instance UID: + + +ua --uid-always + always assign new UID (default) + + +un --uid-never + never assign new UID +\endverbatim + +\subsection dcmquant_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding + (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes and items on + multiple of i bytes +\endverbatim + +\section dcmquant_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmquant_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmquant_environment ENVIRONMENT + +The \b dcmquant utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmquant_copyright COPYRIGHT + +Copyright (C) 2001-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmimage/docs/dcmscale.man b/dcmimage/docs/dcmscale.man new file mode 100644 index 00000000..bec7e6da --- /dev/null +++ b/dcmimage/docs/dcmscale.man @@ -0,0 +1,271 @@ +/*! + +\if MANPAGES +\page dcmscale Scale DICOM images +\else +\page dcmscale dcmscale: Scale DICOM images +\endif + +\section dcmscale_synopsis SYNOPSIS + +\verbatim +dcmscale [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmscale_description DESCRIPTION + +The \b dcmscale utility reads a DICOM image, scales it according to the +command line settings and writes back the DICOM image. This utility only +supports uncompressed and RLE compressed DICOM images. + +\section dcmscale_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be scaled + +dcmfile-out DICOM output filename to be written +\endverbatim + +\section dcmscale_options OPTIONS + +\subsection dcmscale_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmscale_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmscale_processing_options image processing and encoding options +\verbatim +scaling: + + +a --recognize-aspect + recognize pixel aspect ratio (default) + + -a --ignore-aspect + ignore pixel aspect ratio when scaling + + +i --interpolate [n]umber of algorithm: integer + use interpolation when scaling (1..4, default: 1) + + -i --no-interpolation + no interpolation when scaling + + -S --no-scaling + no scaling, ignore pixel aspect ratio (default) + + +Sxf --scale-x-factor [f]actor: float + scale x axis by factor, auto-compute y axis + + +Syf --scale-y-factor [f]actor: float + scale y axis by factor, auto-compute x axis + + +Sxv --scale-x-size [n]umber: integer + scale x axis to n pixels, auto-compute y axis + + +Syv --scale-y-size [n]umber: integer + scale y axis to n pixels, auto-compute x axis + +other transformations: + + +C --clip-region [l]eft [t]op [w]idth [h]eight: integer + clip rectangular image region (l, t, w, h) + +SOP Instance UID: + + +ua --uid-always + always assign new SOP Instance UID (default) + + +un --uid-never + never assign new SOP Instance UID +\endverbatim + +\subsection dcmscale_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding + (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes and items on + multiple of i bytes +\endverbatim + +\section dcmscale_notes NOTES + +The following preferred interpolation algorithms can be selected using the +\e --interpolate option: + +\li 1 = free scaling algorithm with interpolation from pbmplus toolkit +\li 2 = free scaling algorithm with interpolation from c't magazine +\li 3 = magnification algorithm with bilinear interpolation from Eduard Stanescu +\li 4 = magnification algorithm with bicubic interpolation from Eduard Stanescu + +\section dcmscale_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmscale_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmscale_environment ENVIRONMENT + +The \b dcmscale utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmscale_copyright COPYRIGHT + +Copyright (C) 2002-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmimage/etc/Makefile.in b/dcmimage/etc/Makefile.in new file mode 100644 index 00000000..d497229a --- /dev/null +++ b/dcmimage/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmimage/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimage/include/CMakeLists.txt b/dcmimage/include/CMakeLists.txt new file mode 100644 index 00000000..4197eaaf --- /dev/null +++ b/dcmimage/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmimage DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmimage/include/Makefile.in b/dcmimage/include/Makefile.in new file mode 100644 index 00000000..134bd1a1 --- /dev/null +++ b/dcmimage/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmimage/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmimage + for file in dcmtk/dcmimage/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmimage ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimage/include/dcmtk/dcmimage/dcmicmph.h b/dcmimage/include/dcmtk/dcmimage/dcmicmph.h new file mode 100644 index 00000000..9c147a7c --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dcmicmph.h @@ -0,0 +1,289 @@ +/* + * + * Copyright (C) 2018-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: A helper class for comparing an original image with + * a processed version (e.g. after lossy compression) + * + */ + +#ifndef DCMICMPH_H +#define DCMICMPH_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimage/dicdefin.h" /* for export macros */ +#include "dcmtk/dcmimgle/diutils.h" /* for EW_WindowType */ +#include "dcmtk/ofstd/ofstd.h" /* for OFCondition */ +#include "dcmtk/ofstd/ofcmdln.h" /* for OFCmdUnsignedInt */ +#include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */ + +class DicomImage; +class DcmFileFormat; +class DcmItem; + +/** A helper class for comparing an original image with + * a processed version (e.g. after lossy compression). + */ +class DCMTK_DCMIMAGE_EXPORT DicomImageComparison +{ +public: + /// default constructor + DicomImageComparison(); + + /// destructor + virtual ~DicomImageComparison(); + + /** instruct the DicomImageComparison instance that the creation + * of a difference image during image comparison is requested. + * This function must be called prior to the call to readReferenceImage(). + * @param amplify factor by which all pixel values in the difference image will be multiplied + * @return EC_Normal if successful, and error code otherwise + */ + OFCondition initializeDiffImage(OFCmdFloat amplify = 1.0); + + /** save the difference image created during image comparison. + * This function must be called after to the call to computeImageComparisonMetrics(). + * @param ofname filename to be created + * @return EC_Normal if successful, and error code otherwise + */ + OFCondition saveDiffImage(const char *ofname); + + /** read reference image for image comparison from file + * @param ifname filename for DcmFileFormat::loadFile() + * @param xfer DICOM transfer syntax for DcmFileFormat::loadFile() + * @param readMode file read mode for DcmFileFormat::loadFile() + * @param compatibilityMode compatibility mode for DicomImage constructor + * @return EC_Normal if successful, and error code otherwise + */ + OFCondition readReferenceImage( + const char *ifname, + E_TransferSyntax xfer, + E_FileReadMode readMode, + unsigned long compatibilityMode); + + /** read test image for image comparison from file + * @param ifname filename for DcmFileFormat::loadFile() + * @param xfer DICOM transfer syntax for DcmFileFormat::loadFile() + * @param readMode file read mode for DcmFileFormat::loadFile() + * @param compatibilityMode compatibility mode for DicomImage constructor + * @return EC_Normal if successful, and error code otherwise + */ + OFCondition readTestImage( + const char *ifname, + E_TransferSyntax xfer, + E_FileReadMode readMode, + unsigned long compatibilityMode); + + /** configure the display pipelines for both referenced and test image. + * @param windowType VOI LUT transformation to apply + * @param sharedWindow compute common min/max window for both images if true, separate windows if false + * @param windowParameter index of VOI LUT/window in file (if windowType is EWT_window_from_file or EWT_voi_lut_from_file) + * @param windowCenter window center (ignored unless windowType is EWT_window_parameters) + * @param windowWidth window width (ignored unless windowType is EWT_window_parameters) + * @param voiFunction VOI LUT function (linear or sigmoid) + * @param presShape Presentation LUT Shape (identity, reverse, lin OD) + * @return EC_Normal if successful, and error code otherwise + */ + OFCondition configureImages( + EW_WindowType windowType, + OFBool sharedWindow, + OFCmdUnsignedInt windowParameter, + OFCmdFloat windowCenter, + OFCmdFloat windowWidth, + EF_VoiLutFunction voiFunction, + ES_PresentationLut presShape); + + /** compare both images and compute image comparion metrics. + * @param windowType VOI LUT transformation to apply + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition computeImageComparisonMetrics(EW_WindowType windowType); + + /// return maximum absolute error + unsigned long getMaxAbsoluteError() const + { + return max_error; + } + + /// return mean absolute error + double getMeanAbsoluteError() const + { + return meanAbsoluteError; + } + + /// return root mean square error + double getRootMeanSquareError() const + { + return rootMeanSquareError; + } + + /// return peak signal to noise ratio + double getPeakSignalToNoiseRatio() const + { + return peakSignalToNoiseRatio; + } + + /// return signal to noise ratio + double getSignalToNoiseRatio() const + { + return signalToNoiseRatio; + } + +private: + + /// private undefined copy constructor + DicomImageComparison(const DicomImageComparison& rhs); + + /// private undefined copy assignment operator + DicomImageComparison& operator=(const DicomImageComparison& arg); + + /** read DICOM image and store pointer to it + * @param di pointer to DICOM image, not NULL upon success, NULL otherwise + * @param isReference indicates whether we're reading the reference image or the test image + * @param ifname filename for DcmFileFormat::loadFile() + * @param xfer DICOM transfer syntax for DcmFileFormat::loadFile() + * @param readMode file read mode for DcmFileFormat::loadFile() + * @param compatibilityMode compatibility mode for DicomImage constructor + * @param diffImage pointer to DICOM dataset for difference image, may be NULL + * @return EC_Normal if successful, and error code otherwise + */ + static OFCondition readDICOMImage( + DicomImage *& di, + OFBool isReference, + const char *ifname, + E_TransferSyntax xfer, + E_FileReadMode readMode, + unsigned long compatibilityMode, + DcmItem *diffImage); + + /** configure the display pipeline for a given DICOM image. + * @param di DICOM image, must not be NULL + * @param windowType VOI LUT transformation to apply + * @param windowParameter index of VOI LUT/window in file (if windowType is EWT_window_from_file or EWT_voi_lut_from_file) + * @param windowCenter window center (input for EWT_window_parameters, output for EWT_window_min_max and EWT_window_min_max_n) + * @param windowWidth window width (input for EWT_window_parameters, output for EWT_window_min_max and EWT_window_min_max_n) + * @param voiFunction VOI LUT function (linear or sigmoid) + * @param presShape Presentation LUT Shape (identity, reverse, lin OD) + * @param depth bit depth to be used when accessing pixel data for this image returned in this parameter + * @return EC_Normal if successful, and error code otherwise + */ + static OFCondition configureImage( + DicomImage *di, + EW_WindowType windowType, + OFCmdUnsignedInt windowParameter, + OFCmdFloat& windowCenter, + OFCmdFloat& windowWidth, + EF_VoiLutFunction voiFunction, + ES_PresentationLut presShape, + int& depth); + + /** initialize the difference image DICOM dataset by copying all required + * attributes from the reference image and by generating all other attributes + * except for the image pixel module, SOP Class UID, and the information to be copied + * from the test image. + * @param src reference image main dataset + * @param diffImage difference image main dataset + */ + static OFCondition copyReferenceImageAttributes(DcmItem *src, DcmItem *diffImage); + + /** further populate the difference image DICOM dataset by copying all required + * attributes from the test image. + * @param src reference image main dataset + * @param diffImage difference image main dataset + */ + static OFCondition copyTestImageAttributes(DcmItem *src, DcmItem *diffImage); + + /** print the characteristics of the image to to logger at DEBUG level. + * @param di DICOM image + * @param filename filename from which the image was loaded + */ + static void logImageInfo(DicomImage *di, const char *filename); + + /** create content for frame label vector + * @param s string to which the frame label vector is written + * @param numFrames number of frames present in the reference image + * @param isColor true if reference image is a color image + */ + static void createFrameLabelVector(OFString& s, unsigned long numFrames, OFBool isColor); + + /** check if reference and test image have the same resolution, + * number of frames and color model (color or monochrome). + * @return EC_Normal if matching, an error code otherwise. + */ + OFCondition checkImageCharacteristics() const; + + /** compare two images that are both monochrome and have more than + * 8 bits/pixel in internal storage, as determined by BitsStored and + * the Modality LUT that may have been applied. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition computeMonochromeImageComparionMetricsWord(); + + /** compare two monochrome images without setting a VOI window. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition computeMonochromeImageComparionMetricsRaw(); + + /** compare two images that are both monochrome and have at most + * 8 bits/pixel in internal storage, as determined by BitsStored and + * the Modality LUT that may have been applied. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition computeMonochromeImageComparionMetricsByte(); + + /** compare two images that are both color images. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition computeColorImageComparionMetrics(); + + /// pointer to reference image + DicomImage *di_reference; + + /// pointer to test image + DicomImage *di_test; + + /// difference image in DICOM format + DcmFileFormat *diff_image; + + /** result of image comparison: max difference between a sample value + * in the reference image and the corresponding sample value in the test image + */ + unsigned long max_error; + + /// bits/sample to use when processing the reference image + int reference_bits; + + /// bits/sample to use when processing the test image + int test_bits; + + /// result of image comparison: mean absolute error + double meanAbsoluteError; + + /// result of image comparison: root mean square error (RMSE) + double rootMeanSquareError; + + /// result of image comparison: peak signal to noise ratio (PSNR) + double peakSignalToNoiseRatio; + + /// result of image comparison: signal to noise ratio (SNR) + double signalToNoiseRatio; + + /// factor by which all pixel values of the difference image will be multiplied + double amplification; +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diargimg.h b/dcmimage/include/dcmtk/dcmimage/diargimg.h new file mode 100644 index 00000000..a16e3943 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diargimg.h @@ -0,0 +1,90 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DiARGBImage (Header) + * + */ + + +#ifndef DIARGIMG_H +#define DIARGIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiLookupTable; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for ARGB images + */ +class DCMTK_DCMIMAGE_EXPORT DiARGBImage + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiARGBImage(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiARGBImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); + + + private: + + /// three color palettes for R, G and B + DiLookupTable *Palette[3]; + + // --- declarations to avoid compiler warnings + + DiARGBImage(const DiARGBImage &); + DiARGBImage &operator=(const DiARGBImage &); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diargpxt.h b/dcmimage/include/dcmtk/dcmimage/diargpxt.h new file mode 100644 index 00000000..87aefa40 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diargpxt.h @@ -0,0 +1,193 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomARGBPixelTemplate (Header) - UNTESTED !!! + * + */ + + +#ifndef DIARGPXT_H +#define DIARGPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diluptab.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle ARGB pixel data + */ +template +class DiARGBPixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param palette pointer to RGB color palette + * @param status reference to status variable + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + */ + DiARGBPixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + DiLookupTable *palette[3], + EI_Status &status, + const unsigned long planeSize, + const int bits) + : DiColorPixelTemplate(docu, pixel, 4, status) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), palette, planeSize, bits); + } + + /** destructor + */ + virtual ~DiARGBPixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param palette pointer to RGB color palette + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + */ + void convert(const T1 *pixel, + DiLookupTable *palette[3], + const unsigned long planeSize, + const int bits) + { // not very much optimized, but no one really uses ARGB !! + if (this->Init(pixel)) + { + T2 value; + const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1)); + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + if (this->PlanarConfiguration) + { +/* + const T1 *a = pixel; // points to alpha plane + const T1 *rgb[3]; + rgb[0] = a + this->InputCount; // points to red plane + rgb[1] = rgb[0] + this->InputCount; // points to green plane + rgb[2] = rgb[1] + this->InputCount; // points to blue plane + for (i = 0; i < count; ++i) + { + value = OFstatic_cast(T2, *(a++)); // get alpha value + if (value > 0) + { + for (int j = 0; j < 3; ++j) // set palette color + { + if (value <= palette[j]->getFirstEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getFirstValue()); + else if (value >= palette[j]->getLastEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getLastValue()); + else + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getValue(value)); + ++rgb[j]; // skip RGB values + } + } + else + { + for (j = 0; j < 3; ++j) // copy RGB values + this->Data[j][i] = OFstatic_cast(T3, removeSign(*(rgb[j]++), offset)); + } + } +*/ + unsigned long l; + unsigned long i = 0; + const T1 *a = pixel; // points to alpha plane + const T1 *rgb[3]; + rgb[0] = a + planeSize; // points to red plane + rgb[1] = rgb[0] + planeSize; // points to green plane + rgb[2] = rgb[1] + planeSize; // points to blue plane + while (i < count) + { + /* convert a single frame */ + for (l = planeSize; (l != 0) && (i < count); --l, ++i) + { + value = OFstatic_cast(T2, *(a++)); // get alpha value + if (value > 0) + { + for (int j = 0; j < 3; ++j) // set palette color + { + if (value <= palette[j]->getFirstEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getFirstValue()); + else if (value >= palette[j]->getLastEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getLastValue()); + else + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getValue(value)); + ++rgb[j]; // skip RGB values + } + } + else + { + for (int j = 0; j < 3; ++j) // copy RGB values + this->Data[j][i] = OFstatic_cast(T3, removeSign(*(rgb[j]++), offset)); + } + } + /* jump to next frame start (skip 2 planes) */ + a += 2 * planeSize; + for (int j = 0; j < 3; ++j) + rgb[j] += 2 * planeSize; + } + } else { + unsigned long i; + const T1 *p = pixel; + for (i = 0; i < count; ++i) + { + value = OFstatic_cast(T2, *(p++)); // get alpha value + if (value > 0) + { + for (int j = 0; j < 3; ++j) // set palette color + { + if (value <= palette[j]->getFirstEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getFirstValue()); + else if (value >= palette[j]->getLastEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getLastValue()); + else + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getValue(value)); + } + p += 3; // skip RGB values + } + else + { + for (int j = 0; j < 3; ++j) // copy RGB values + this->Data[j][i] = OFstatic_cast(T3, removeSign(*(p++), offset)); + } + } + } + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicdefin.h b/dcmimage/include/dcmtk/dcmimage/dicdefin.h new file mode 100644 index 00000000..7b830176 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicdefin.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DICDEFIN_H +#define DICDEFIN_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmimage_EXPORTS +#define DCMTK_DCMIMAGE_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMIMAGE_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicmyimg.h b/dcmimage/include/dcmtk/dcmimage/dicmyimg.h new file mode 100644 index 00000000..290aea10 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicmyimg.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomCMYKImage (Header) + * + */ + + +#ifndef DICMYIMG_H +#define DICMYIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for CMYK images + */ +class DCMTK_DCMIMAGE_EXPORT DiCMYKImage + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiCMYKImage(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiCMYKImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicmypxt.h b/dcmimage/include/dcmtk/dcmimage/dicmypxt.h new file mode 100644 index 00000000..011ae82d --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicmypxt.h @@ -0,0 +1,146 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomCMYKPixelTemplate (Header) + * + */ + + +#ifndef DICMYPXT_H +#define DICMYPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle CMYK pixel data + */ +template +class DiCMYKPixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param status reference to status variable + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + */ + DiCMYKPixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + EI_Status &status, + const unsigned long planeSize, + const int bits) + : DiColorPixelTemplate(docu, pixel, 4, status) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), planeSize, bits); + } + + /** destructor + */ + virtual ~DiCMYKPixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + */ + void convert(const T1 *pixel, + const unsigned long planeSize, + const int bits) + { + if (this->Init(pixel)) + { + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + const T2 maxvalue = OFstatic_cast(T2, DicomImageClass::maxval(bits)); + const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1)); + const T1 *p = pixel; + if (this->PlanarConfiguration) + { +/* + const T1 *k; + T2 *q; + for (int j = 0; j < 3; ++j) + { + q = this->Data[j]; + k = pixel + 3 * this->InputCount; // beginning of 'black' plane + for (i = count; i != 0; --i) + *(q++) = maxvalue - removeSign(*(p++), offset) - removeSign(*(k++), offset); + } +*/ + const T1 *k; + T2 *q; + unsigned long l; + unsigned long i = 0; + while (i < count) + { + /* store current pixel index */ + const unsigned long iStart = i; + /* beginning of 'black' plane */ + const T1 *kStart = p + 3 * planeSize; + /* for all planes ... */ + for (int j = 0; j < 3; ++j) + { + q = this->Data[j] + iStart; + /* reset to beginning of 'black' plane */ + k = kStart; + /* convert a single plane */ + for (l = planeSize, i = iStart; (l != 0) && (i < count); --l, ++i) + *(q++) = maxvalue - removeSign(*(p++), offset) - removeSign(*(k++), offset); + } + /* skip black plane */ + p += planeSize; + } + } + else + { + T1 k; + int j; + unsigned long i; + for (i = 0; i < count; ++i) + { + k = *(p + 3); + for (j = 0; j < 3; ++j) + this->Data[j][i] = maxvalue - removeSign(*(p++), offset) - removeSign(k, offset); + ++p; // skip 'black' + } + } + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicocpt.h b/dcmimage/include/dcmtk/dcmimage/dicocpt.h new file mode 100644 index 00000000..7869bdee --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicocpt.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 1998-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorCopyTemplate (Header) + * + */ + + +#ifndef DICOCPT_H +#define DICOCPT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofbmanip.h" + +#include "dcmtk/dcmimage/dicopxt.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to copy color pixel data + */ +template +class DiColorCopyTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to color intermediate representation of pixel data + * @param fstart first frame to be copied + * @param fcount number of frames to be copied + * @param fsize size of one frame (in bytes) + */ + DiColorCopyTemplate(const DiColorPixel *pixel, + const unsigned long fstart, + const unsigned long fcount, + const unsigned long fsize) + : DiColorPixelTemplate(pixel, fcount * fsize) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if ((pixel->getCount() > fstart * fsize) && (pixel->getCount() >= (fstart + fcount) * fsize)) + copy(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), fstart * fsize); + } + } + + /** destructor + */ + ~DiColorCopyTemplate() + { + } + + + private: + + /** copy specified amount of pixel data + * + ** @param pixel array of pixel data (3 color components) to be copied + * @param offset offset to the first pixel to be copied + */ + inline void copy(const T *pixel[3], + const unsigned long offset) + { + if (this->Init(pixel)) + { + for (int j = 0; j < 3; j++) + OFBitmanipTemplate::copyMem(pixel[j] + offset, this->Data[j], this->getCount()); + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicoflt.h b/dcmimage/include/dcmtk/dcmimage/dicoflt.h new file mode 100644 index 00000000..f2e0c819 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicoflt.h @@ -0,0 +1,107 @@ +/* + * + * Copyright (C) 1998-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorFlipTemplate (Header) + * + */ + + +#ifndef DICOFLT_H +#define DICOFLT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diflipt.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to flip color images (on pixel data level) + * horizontally and vertically + */ +template +class DiColorFlipTemplate + : public DiColorPixelTemplate, + protected DiFlipTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param columns number of columns + * @param rows number of rows + * @param frames number of frames + * @param horz flip horizontally if true + * @param vert flip vertically if true + */ + DiColorFlipTemplate(const DiColorPixel *pixel, + const Uint16 columns, + const Uint16 rows, + const Uint32 frames, + const int horz, + const int vert) + : DiColorPixelTemplate(pixel, OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames), + DiFlipTemplate(3, columns, rows, frames) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if (pixel->getCount() == OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames) + flip(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), horz, vert); + else { + DCMIMAGE_WARN("could not flip image ... corrupted data"); + } + } + } + + /** destructor + */ + ~DiColorFlipTemplate() + { + } + + + private: + + /** choose flipping algorithm depending on given parameters + * + ** @param pixel pointer to pixel data (3 components) which should be flipped + * @param horz flip horizontally if true + * @param vert flip vertically if true + */ + inline void flip(const T *pixel[3], + const int horz, + const int vert) + { + if (this->Init(pixel)) + { + if (horz && vert) + this->flipHorzVert(pixel, this->Data); + else if (horz) + this->flipHorz(pixel, this->Data); + else if (vert) + this->flipVert(pixel, this->Data); + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicoimg.h b/dcmimage/include/dcmtk/dcmimage/dicoimg.h new file mode 100644 index 00000000..c38942e5 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicoimg.h @@ -0,0 +1,448 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorImage (Header) + * + */ + + +#ifndef DICOIMG_H +#define DICOIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diimage.h" +#include "dcmtk/dcmimage/dicopx.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiColorOutputPixel; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Base class for color images + */ +class DCMTK_DCMIMAGE_EXPORT DiColorImage + : public DiImage +{ + + public: + + /** constructor + * + ** @param docu pointer to the DICOM document + * @param status status of the image object + * @param spp sample per pixel (1, 3 or 4 depending on the color model) + * @param rgb specifies whether internal image representation is in RGB format + */ + DiColorImage(const DiDocument *docu, + const EI_Status status, + const int spp, + const OFBool rgb = OFTrue); + + /** destructor + */ + virtual ~DiColorImage(); + + /** get color model of internal pixel representation. + * + ** @return returns EPI_RGB or EPI_YBR_Full depending on the 'rgb' flag in the constructor + */ + virtual EP_Interpretation getInternalColorModel() const + { + return (RGBColorModel) ? EPI_RGB : EPI_YBR_Full; + } + + /** get number of bytes required for the rendered output of a single frame + * + * @param bits number of bits for the output pixel data (depth) + * + ** @return number of bytes if successful, 0 otherwise + */ + virtual unsigned long getOutputDataSize(const int bits = 0) const; + + /** get pixel data with specified format. + * (memory is handled internally) + * The standard color model of the pixel data is RGB, but if the flag "rgb" is OFFalse + * and the original color model was YCbCr_Full or YCbCr_Full_422 YCbCr_Full is used instead. + * + ** @param frame number of frame to be rendered + * @param bits number of bits per sample for the output pixel data (depth) + * @param planar 0 = color-by-pixel (R1G1B1...R2G2B2...R3G3B3...), + * 1 = color-by-plane (R1R2R3...G1G2G3...B1B2B3...) + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + const void *getOutputData(const unsigned long frame, + const int bits, + const int planar = 0); + + /** get pixel data with specified format. + * (memory is handled externally) + * The standard color model of the pixel data is RGB, but if the flag "rgb" is OFFalse + * and the original color model was YCbCr_Full or YCbCr_Full_422 YCbCr_Full is used instead. + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param size size of the memory buffer in bytes (will be checked) + * @param frame number of frame to be rendered + * @param bits number of bits per sample for the output pixel data (depth) + * @param planar 0 = color-by-pixel (R1G1B1...R2G2B2...R3G3B3...) + * 1 = color-by-plane (R1R2R3...G1G2G3...B1B2B3...) + * + ** @return status, true if successful, false otherwise + */ + int getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar = 0); + + /** get pixel data of specified plane. + * (memory is handled internally) + * + ** @param plane index of color plane + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + const void *getOutputPlane(const int plane) const; + + /** delete internally handled output memory buffer + * Save memory if data is no longer needed. + */ + void deleteOutputData(); + + /** create copy of current image object + * + ** @param fstart first frame to be processed + * @param fcount number of frames + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DiImage *createImage(const unsigned long fstart, + const unsigned long fcount) const; + + /** create scaled copy of specified (clipping) area of the current image object. + * + ** @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param src_cols width of area to be scaled + * @param src_rows height of area to be scaled + * @param dest_cols width of scaled image (in pixels) + * @param dest_rows height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue dummy parameter (only used for monochrome images) + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createScale(const signed long left_pos, + const signed long top_pos, + const unsigned long src_cols, + const unsigned long src_rows, + const unsigned long dest_cols, + const unsigned long dest_rows, + const int interpolate, + const int aspect, + const Uint16 pvalue) const; + + /** flip current image (horizontally and/or vertically) + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return true if successful (1 = flipped at least direction, + * 2 = not flipped, because of image resolution - width and/or height equal to 1), + * false otherwise + */ + int flip(const int horz, + const int vert); + + /** create a flipped copy of the current image + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createFlip(const int horz, + const int vert) const; + + /** rotate current image (by steps of 90 degrees) + * + ** @param degree angle by which the image shall be rotated (-360, -270, -180, -90, 0, 90, 180, 270, 360) + * + ** @return true if successful (1 = rotated by at least 90 degrees, + * 2 = not rotated, because of image resolution or angle), + * false otherwise + */ + int rotate(const int degree); + + /** create a rotated copy of the current image. + * + ** @param degree angle by which the image shall be rotated + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createRotate(const int degree) const; + + /** create monochrome copy of the current image + * + ** @param red coefficient by which the red component is weighted + * @param green coefficient by which the green component is weighted + * @param blue coefficient by which the blue component is weighted + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createMono(const double red, + const double green, + const double blue) const; + + /** get pointer to intermediate pixel data representation + * + ** @return pointer to intermediate pixel data + */ + const DiPixel *getInterData() const + { + return InterData; + } + + /** get pointer to intermediate pixel data representation + * + ** @return pointer to intermediate pixel data + */ + const DiColorPixel *getColorInterData() const + { + return InterData; + } + + /** create true color (24/32 bit) bitmap for MS Windows. + * memory is not handled internally - must be deleted from calling program. + * + ** @param data untyped pointer memory buffer (set to NULL if not allocated externally) + * @param size size of the memory buffer in bytes (if 0 'data' is set to NULL) + * @param frame index of frame to be converted (starting from 0) + * @param bits number of bits per pixel used for the output bitmap (24 or 32) + * @param upsideDown specifies the order of lines in the images (0 = top-down, bottom-up otherwise) + * @param padding align each line to a 32-bit address if true (default) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createDIB(void *&data, + const unsigned long size, + const unsigned long frame, + const int bits, + const int upsideDown, + const int padding = 1); + + /** create true color (32 bit) bitmap for Java (AWT default format). + * Memory is not handled internally - must be deleted from calling program. + * + ** @param data resulting pointer to bitmap data (set to NULL if an error occurred) + * @param frame index of frame to be converted (default: first frame) + * @param bits number of bits per pixel used for the output bitmap (32) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createAWTBitmap(void *&data, + const unsigned long frame, + const int bits); + + /** write current image and related attributes to DICOM dataset. + * + ** @param dataset reference to DICOM dataset where the image attributes are stored + * @param mode dummy parameter (only used for monochrome images) + * @param planar flag, whether the output data (for multi-planar images) should be planar or not + * + ** @return true if successful, false otherwise + */ + int writeImageToDataset(DcmItem &dataset, + const int mode, + const int planar); + + /** write pixel data to PPM file. + * pixel data is written in ASCII format. + * + ** @param stream open C++ output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + int writePPM(STD_NAMESPACE ostream& stream, + const unsigned long frame, + const int bits); + + /** write pixel data to PPM file. + * pixel data is written in ASCII format. + * + ** @param stream open C output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + int writePPM(FILE *stream, + const unsigned long frame, + const int bits); + + /** write pixel data to raw PPM file + * + ** @param stream open C output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + int writeRawPPM(FILE *stream, + const unsigned long frame, + const int bits); + + /** write pixel data to BMP file + * + ** @param stream open C output stream + * @param frame index of frame used for output (default: first frame = 0) + * @param bits number of bits used for output of pixel data (24 or 32, default (0) = 24) + * + ** @return true if successful, false otherwise + */ + int writeBMP(FILE *stream, + const unsigned long frame, + const int bits); + + + protected: + + /** constructor, copy + * + ** @param image pointer to reference image + * @param fstart first frame to be processed + * @param fcount number of frames + */ + DiColorImage(const DiColorImage *image, + const unsigned long fstart, + const unsigned long fcount); + + /** constructor, scale/clip + * + ** @param image pointer to reference image + * @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param src_cols width of area to be scaled + * @param src_rows height of area to be scaled + * @param dest_cols width of scaled image (in pixels) + * @param dest_rows height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + */ + DiColorImage(const DiColorImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate = 0, + const int aspect = 0); + + /** constructor, flip + * + ** @param image pointer to reference image + ** @param horz flip horizontally if true + * @param vert flip vertically if true + */ + DiColorImage(const DiColorImage *image, + const int horz, + const int vert); + + /** constructor, rotate + * + ** @param image pointer to reference image + * @param degree angle by which the image shall be rotated + */ + DiColorImage(const DiColorImage *image, + const int degree); + + /** check intermediate pixel representation for consistency + * + ** @param mode check number of pixels stored in the dataset if true + * + ** @return status, true if successful, false otherwise + */ + int checkInterData(const int mode = 1); + + /** get pixel data with specified format. + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param size size of the memory buffer in bytes (will be checked) + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flag, 0 = color-by-pixel and 1 = color-by-plane + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + const void *getData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar); + + /** update Image Pixel Module attributes in the given dataset. + * Removes color palette lookup tables. Used in writeXXXToDataset() routines. + * + ** @param dataset reference to DICOM image dataset + */ + virtual void updateImagePixelModuleAttributes(DcmItem &dataset); + + /// flag, indicating whether the intermediate representation uses the RGB color model + const OFBool RGBColorModel; + + /// points to intermediate pixel data representation (object) + DiColorPixel *InterData; + + + private: + + /// points to current output data (object) + DiColorOutputPixel *OutputData; + + // --- declarations to avoid compiler warnings + + DiColorImage(const DiColorImage &); + DiColorImage &operator=(const DiColorImage &); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicomot.h b/dcmimage/include/dcmtk/dcmimage/dicomot.h new file mode 100644 index 00000000..0a11f290 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicomot.h @@ -0,0 +1,111 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorMonochromeTemplate (Header) + * + */ + + +#ifndef DICOMOT_H +#define DICOMOT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimopxt.h" +#include "dcmtk/dcmimage/dicopx.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to convert color image to monochrome images. + * (on pixel data level) + */ +template +class DiColorMonoTemplate + : public DiMonoPixelTemplate +{ + + public: + + /** constructor + * + ** @param pixel intermediate representation of color pixel data + * @param modality pointer to object managing modality transform + * @param red coefficient of red pixel component + * @param green coefficient of green pixel component + * @param blue coefficient of blue pixel component + */ + DiColorMonoTemplate(const DiColorPixel *pixel, + DiMonoModality *modality, + const double red, + const double green, + const double blue) + : DiMonoPixelTemplate(pixel, modality) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + convert(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), red, green, blue); + this->determineMinMax(); + } + } + + /** destructor + */ + virtual ~DiColorMonoTemplate() + { + } + + + private: + + /** convert color pixel data to monochrome format + * + ** @param pixel intermediate representation of color pixel data + * @param red coefficient of red pixel component + * @param green coefficient of green pixel component + * @param blue coefficient of blue pixel component + */ + void convert(const T *pixel[3], + const double red, + const double green, + const double blue) + { + if (pixel != NULL) + { + this->Data = new T[this->Count]; + if (this->Data != NULL) + { + const T *r = pixel[0]; + const T *g = pixel[1]; + const T *b = pixel[2]; + T *q = this->Data; + unsigned long i; + for (i = this->Count; i != 0; i--) + { + *(q++) = OFstatic_cast(T, OFstatic_cast(double, *(r++)) * red + + OFstatic_cast(double, *(g++)) * green + + OFstatic_cast(double, *(b++)) * blue); + } + } + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicoopx.h b/dcmimage/include/dcmtk/dcmimage/dicoopx.h new file mode 100644 index 00000000..eba3038a --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicoopx.h @@ -0,0 +1,136 @@ +/* + * + * Copyright (C) 1996-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorOutputPixel (Header) + * + */ + + +#ifndef DICOOPX_H +#define DICOOPX_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimgle/diutils.h" +#include "dcmtk/ofstd/ofstream.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmimage/dicdefin.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiPixel; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Abstract base class to create color output data + */ +class DCMTK_DCMIMAGE_EXPORT DiColorOutputPixel +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param size number of pixel per frame + * @param frame frame to be rendered + */ + DiColorOutputPixel(const DiPixel *pixel, + const unsigned long size, + const unsigned long frame); + + /** destructor + */ + virtual ~DiColorOutputPixel(); + + /** get integer representation (abstract) + * + ** @return integer representation + */ + virtual EP_Representation getRepresentation() const = 0; + + /** get pointer to output pixel data (abstract) + * + ** @return pointer to pixel data + */ + virtual const void *getData() const = 0; + + /** get pointer to outpout pixel data (abstract) + * + ** @return pointer to pixel data + */ + virtual void *getDataPtr() = 0; + + /** get pointer to given plane of output pixel data (abstract) + * + ** @param plane number of the plane to be retrieved (0..2) + * + ** @return pointer to beginning of plane if successful, NULL otherwise + */ + virtual const void *getPlane(const int plane) const = 0; + + /** get size of one pixel / item in the pixel array (abstract) + * + ** @return item size + */ + virtual size_t getItemSize() const = 0; + + /** write pixel data of selected frame to PPM/ASCII file (abstract) + * + ** @param stream open C++ output stream + * + ** @return status, true if successful, false otherwise + */ + virtual int writePPM(STD_NAMESPACE ostream& stream) const = 0; + + /** write pixel data of selected frame to PPM/ASCII file (abstract) + * + ** @param stream open C file stream + * + ** @return status, true if successful, false otherwise + */ + virtual int writePPM(FILE *stream) const = 0; + + /** get number of pixel per frame + * + ** @return number of pixel per frame + */ + inline unsigned long getCount() const + { + return FrameSize; + } + + + protected: + + /// number of pixels per frame (intermediate representation) + /*const*/ unsigned long Count; + /// number of pixels per frame (memory buffer size) + const unsigned long FrameSize; +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicoopxt.h b/dcmimage/include/dcmtk/dcmimage/dicoopxt.h new file mode 100644 index 00000000..253ab1b6 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicoopxt.h @@ -0,0 +1,417 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorOutputPixelTemplate (Header) + * + */ + + +#ifndef DICOOPXT_H +#define DICOOPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoopx.h" +#include "dcmtk/dcmimage/dicopx.h" +#include "dcmtk/dcmimgle/dipxrept.h" + +#include "dcmtk/ofstd/ofbmanip.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to create color output data + */ +template +class DiColorOutputPixelTemplate + : public DiColorOutputPixel, + public DiPixelRepresentationTemplate +{ + + public: + + /** constructor + * + ** @param buffer storage area for the output pixel data (optional, maybe NULL) + * @param pixel pointer to intermediate pixel representation (color) + * @param count number of pixels per frame + * @param frame frame to be rendered + * @param bits1 bit depth of input data (intermediate) + * @param bits2 bit depth of output data + * @param planar flag indicating whether data shall be stored color-by-pixel or color-by-plane + * @param inverse invert pixel data if true (0/0/0 = white) + */ + DiColorOutputPixelTemplate(void *buffer, + const DiColorPixel *pixel, + const unsigned long count, + const unsigned long frame, + const int bits1, /* input depth */ + const int bits2, /* output depth */ + const int planar, + const int inverse) + : DiColorOutputPixel(pixel, count, frame), + Data(NULL), + DeleteData(buffer == NULL), + isPlanar(planar) + { + if ((pixel != NULL) && (Count > 0) && (FrameSize >= Count)) + { + Data = OFstatic_cast(T2 *, buffer); + convert(OFstatic_cast(const T1 **, OFconst_cast(void *, pixel->getData())), frame * FrameSize, bits1, bits2, planar, inverse); + } + } + + /** constructor + * + ** @param buffer storage area for the output pixel data (optional, maybe NULL) + * @param pixel pointer to intermediate pixel representation + * @param count number of pixels per frame + * @param frame frame to be rendered + * (#)param frames (total number of frames present in intermediate representation) + * @param planar flag indicating whether data shall be stored color-by-pixel or color-by-plane + */ + DiColorOutputPixelTemplate(void *buffer, + const DiPixel *pixel, + const unsigned long count, + const unsigned long frame, + const unsigned long /*frames*/, + const int planar) + : DiColorOutputPixel(pixel, count, frame), + Data(NULL), + DeleteData(buffer == NULL), + isPlanar(planar) + { + if ((pixel != NULL) && (Count > 0) && (FrameSize >= Count)) + Data = OFstatic_cast(T2 *, buffer); + } + + /** destructor + */ + virtual ~DiColorOutputPixelTemplate() + { + if (DeleteData) + delete[] Data; + } + + /** get integer representation + * + ** @return integer representation + */ + inline EP_Representation getRepresentation() const + { + return DiPixelRepresentationTemplate::getRepresentation(); + } + + /** get size of one pixel / item in the pixel array + * + ** @return item size + */ + inline size_t getItemSize() const + { + return sizeof(T2) * 3; + } + + /** get pointer to output pixel data + * + ** @return pointer to pixel data + */ + inline const void *getData() const + { + return OFstatic_cast(const void *, Data); + } + + /** get pointer to output pixel data + * + ** @return pointer to pixel data + */ + virtual void *getDataPtr() + { + return OFstatic_cast(void *, Data); + } + + /** get pointer to given plane of output pixel data + * + ** @param plane number of the plane to be retrieved (0..2) + * + ** @return pointer to beginning of plane if successful, NULL otherwise + */ + inline const void *getPlane(const int plane) const + { + void *result = NULL; + if (Data != NULL) + { + if (plane <= 0) + result = OFstatic_cast(void *, Data); + else + { + if (isPlanar) + result = OFstatic_cast(void *, Data + ((plane == 1) ? 1 : 2) * FrameSize); + else + result = OFstatic_cast(void *, Data + ((plane == 1) ? 1 : 2)); + } + } + return result; + } + + /** write pixel data of selected frame to PPM/ASCII file + * + ** @param stream open C++ output stream + * + ** @return status, true if successful, false otherwise + */ + int writePPM(STD_NAMESPACE ostream& stream) const + { + if (Data != NULL) + { + T2 *p = Data; + unsigned long i; + int j; + for (i = FrameSize; i != 0; --i) + for (j = 3; j != 0; --j) + stream << OFstatic_cast(unsigned long, *(p++)) << " "; // typecast to resolve problems with 'char' + return 1; + } + return 0; + } + + /** write pixel data of selected frame to PPM/ASCII file + * + ** @param stream open C file stream + * + ** @return status, true if successful, false otherwise + */ + int writePPM(FILE *stream) const + { + if (Data != NULL) + { + T2 *p = Data; + unsigned long i; + int j; + for (i = FrameSize; i != 0; --i) + for (j = 3; j != 0; --j) + fprintf(stream, "%lu ", OFstatic_cast(unsigned long, *(p++))); + return 1; + } + return 0; + } + + + protected: + + /// pointer to the storage area where the output data should be stored + T2 *Data; + + + private: + + /** convert intermediate pixel data to output format (render pixel data) + * + ** @param pixel pointer to intermediate pixel representation (color) + * @param start offset to first pixel to be converted + * @param bits1 bit depth of input data (intermediate) + * @param bits2 bit depth of output data + * @param planar flag indicating whether data shall be stored color-by-pixel or color-by-plane + * @param inverse invert pixel data if true (0/0/0 = white) + */ + void convert(const T1 *pixel[3], + const unsigned long start, + const int bits1, + const int bits2, + const int planar, + const int inverse) + { + if ((pixel[0] != NULL) && (pixel[1] != NULL) && (pixel[2] != NULL)) + { + if (Data == NULL) + Data = new T2[FrameSize * 3]; + if (Data != NULL) + { + DCMIMAGE_DEBUG("converting color pixel data to output format"); + T2 *q = Data; + unsigned long i; + const T2 max2 = OFstatic_cast(T2, DicomImageClass::maxval(bits2)); + if (planar) + { + const T1 *p; + if (bits1 == bits2) + { + for (int j = 0; j < 3; ++j) + { + p = pixel[j] + start; + /* invert output data */ + if (inverse) + { + for (i = Count; i != 0; --i) // copy inverted data + *(q++) = max2 - OFstatic_cast(T2, *(p++)); + } else { + for (i = Count; i != 0; --i) // copy + *(q++) = OFstatic_cast(T2, *(p++)); + } + if (Count < FrameSize) + { + OFBitmanipTemplate::zeroMem(q, FrameSize - Count); // set remaining pixels of frame to zero + q += (FrameSize - Count); + } + } + } + else if (bits1 < bits2) // optimization possible using LUT + { + const double gradient1 = OFstatic_cast(double, DicomImageClass::maxval(bits2)) / + OFstatic_cast(double, DicomImageClass::maxval(bits1)); + const T2 gradient2 = OFstatic_cast(T2, gradient1); + for (int j = 0; j < 3; ++j) + { + p = pixel[j] + start; + if (gradient1 == OFstatic_cast(double, gradient2)) // integer multiplication? + { + /* invert output data */ + if (inverse) + { + for (i = Count; i != 0; --i) // expand depth & invert + *(q++) = max2 - OFstatic_cast(T2, *(p++)) * gradient2; + } else { + for (i = Count; i != 0; --i) // expand depth + *(q++) = OFstatic_cast(T2, *(p++)) * gradient2; + } + } else { + /* invert output data */ + if (inverse) + { + for (i = Count; i != 0; --i) // expand depth & invert + *(q++) = max2 - OFstatic_cast(T2, OFstatic_cast(double, *(p++)) * gradient1); + } else { + for (i = Count; i != 0; --i) // expand depth + *(q++) = OFstatic_cast(T2, OFstatic_cast(double, *(p++)) * gradient1); + } + } + if (Count < FrameSize) + { + OFBitmanipTemplate::zeroMem(q, FrameSize - Count); // set remaining pixels of frame to zero + q += (FrameSize - Count); + } + } // ... to be enhanced ! + } + else /* bits1 > bits2 */ + { + const int shift = bits1 - bits2; + for (int j = 0; j < 3; ++j) + { + p = pixel[j] + start; + /* invert output data */ + if (inverse) + { + for (i = Count; i != 0; --i) // reduce depth & invert + *(q++) = max2 - OFstatic_cast(T2, *(p++) >> shift); + } else { + for (i = Count; i != 0; --i) // reduce depth + *(q++) = OFstatic_cast(T2, *(p++) >> shift); + } + if (Count < FrameSize) + { + OFBitmanipTemplate::zeroMem(q, FrameSize - Count); // set remaining pixels of frame to zero + q += (FrameSize - Count); + } + } + } + } + else /* not planar */ + { + int j; + if (bits1 == bits2) + { + /* invert output data */ + if (inverse) + { + for (i = start; i < start + Count; ++i) + for (j = 0; j < 3; ++j) // copy inverted data + *(q++) = max2 - OFstatic_cast(T2, pixel[j][i]); + } else { + for (i = start; i < start + Count; ++i) + for (j = 0; j < 3; ++j) // copy + *(q++) = OFstatic_cast(T2, pixel[j][i]); + } + } + else if (bits1 < bits2) // optimization possible using LUT + { + const double gradient1 = OFstatic_cast(double, DicomImageClass::maxval(bits2)) / + OFstatic_cast(double, DicomImageClass::maxval(bits1)); + const T2 gradient2 = OFstatic_cast(T2, gradient1); + if (gradient1 == OFstatic_cast(double, gradient2)) // integer multiplication? + { + /* invert output data */ + if (inverse) + { + for (i = start; i < start + Count; ++i) // expand depth & invert + for (j = 0; j < 3; ++j) + *(q++) = max2 - OFstatic_cast(T2, pixel[j][i]) * gradient2; + } else { + for (i = start; i < start + Count; ++i) + for (j = 0; j < 3; ++j) // expand depth + *(q++) = OFstatic_cast(T2, pixel[j][i]) * gradient2; + } + } else { + /* invert output data */ + if (inverse) + { + for (i = start; i < start + Count; ++i) + for (j = 0; j < 3; ++j) // expand depth & invert + *(q++) = max2 - OFstatic_cast(T2, OFstatic_cast(double, pixel[j][i]) * gradient1); + } else { + for (i = start; i < start + Count; ++i) + for (j = 0; j < 3; ++j) // expand depth + *(q++) = OFstatic_cast(T2, OFstatic_cast(double, pixel[j][i]) * gradient1); + } + } + } + else /* bits1 > bits2 */ + { + const int shift = bits1 - bits2; + /* invert output data */ + if (inverse) + { + for (i = start; i < start + Count; ++i) + for (j = 0; j < 3; ++j) // reduce depth & invert + *(q++) = max2 - OFstatic_cast(T2, pixel[j][i] >> shift); + } else { + for (i = start; i < start + Count; ++i) + for (j = 0; j < 3; ++j) // reduce depth + *(q++) = OFstatic_cast(T2, pixel[j][i] >> shift); + } + } + if (Count < FrameSize) + OFBitmanipTemplate::zeroMem(q, 3 * (FrameSize - Count)); // set remaining pixels of frame to zero + } + } + } else + Data = NULL; + } + + /// flag indicating whether the output data buffer should be deleted in the destructor + int DeleteData; + /// flag indicating whether pixel data is stored color-by-pixel or color-by-plane + int isPlanar; + + // --- declarations to avoid compiler warnings + + DiColorOutputPixelTemplate(const DiColorOutputPixelTemplate &); + DiColorOutputPixelTemplate &operator=(const DiColorOutputPixelTemplate &); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicopx.h b/dcmimage/include/dcmtk/dcmimage/dicopx.h new file mode 100644 index 00000000..59d6c870 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicopx.h @@ -0,0 +1,167 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorPixel (Header) + * + */ + + +#ifndef DICOPX_H +#define DICOPX_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/dipixel.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiDocument; +class DiInputPixel; +class DiMonoPixel; +class DiColorPixel; + + +/*---------------------* + * class declaration * + *---------------------*/ + + +/** Abstract base class to handle color pixel data + */ +class DCMTK_DCMIMAGE_EXPORT DiColorPixel + : public DiPixel +{ + + public: + + /** constructor + * + ** @param docu pointer to the DICOM document + * @param pixel pointer to input pixel data + * @param samples number of expected samples per pixel (for checking purposes) + * @param status status of the image object (reference variable) + * @param sample_rate dummy parameter (used for derived classes only) + */ + DiColorPixel(const DiDocument *docu, + const DiInputPixel *pixel, + const Uint16 samples, + EI_Status &status, + const Uint16 sample_rate = 0); + + /** destructor + */ + virtual ~DiColorPixel(); + + /** get number of planes + * + ** @return number of planes (here 3, color) + */ + inline int getPlanes() const + { + return 3; + } + + /** get planar configuration of the original pixel data + * + ** @return planar configuration (0 = color-by-pixel, 1 = color-by-plane) + */ + inline int getPlanarConfiguration() const + { + return PlanarConfiguration; + } + + /** fill given memory block with pixel data (all three image planes, RGB) + * + ** @param data pointer to memory block (array of 8 or 16 bit values, OB/OW) + * @param count number of T-size entries allocated in the 'data' array + * @param fcount number of pixels per frame + * @param frames total number of frames present in intermediate representation + * @param planar flag indicating whether data shall be stored color-by-pixel or color-by-plane + * + ** @return OFTrue if successful, OFFalse otherwise + */ + virtual OFBool getPixelData(void *data, + const unsigned long count, + const unsigned long fcount, + const unsigned long frames, + const int planar) const = 0; + + /** create true color (24/32 bit) bitmap for MS Windows. + * + ** @param data untyped pointer memory buffer (set to NULL if not allocated externally) + * @param size size of the memory buffer in bytes (if 0 'data' is set to NULL) + * @param width number of columns of the image + * @param height number of rows of the image + * @param frame index of frame to be converted (starting from 0) + * @param fromBits number of bits per sample used for internal representation of the image + * @param toBits number of bits per sample used for the output bitmap (<= 8) + * @param mode color output mode (24 or 32 bits, see dcmimgle/dcmimage.h for details) + * @param upsideDown specifies the order of lines in the images (0 = top-down, bottom-up otherwise) + * @param padding align each line to a 32-bit address if true + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + virtual unsigned long createDIB(void *&data, + const unsigned long size, + const Uint16 width, + const Uint16 height, + const unsigned long frame, + const int fromBits, + const int toBits, + const int mode, + const int upsideDown, + const int padding) const = 0; + + /** create true color (32 bit) bitmap for Java (AWT default format). + * + ** @param data resulting pointer to bitmap data (set to NULL if an error occurred) + * @param width number of columns of the image + * @param height number of rows of the image + * @param frame index of frame to be converted (starting from 0) + * @param fromBits number of bits per sample used for internal representation of the image + * @param toBits number of bits per sample used for the output bitmap (<= 8) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + virtual unsigned long createAWTBitmap(void *&data, + const Uint16 width, + const Uint16 height, + const unsigned long frame, + const int fromBits, + const int toBits) const = 0; + + + protected: + + /** constructor + * + ** @param pixel pointer to intermediate color pixel data + * @param count number of pixels + */ + DiColorPixel(const DiColorPixel *pixel, + const unsigned long count); + + /// planar configuration of the original pixel data (0 = color-by-pixel, 1 = color-by-plane) + int PlanarConfiguration; +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicopxt.h b/dcmimage/include/dcmtk/dcmimage/dicopxt.h new file mode 100644 index 00000000..d812d169 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicopxt.h @@ -0,0 +1,601 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorPixelTemplate (Header) + * + */ + + +#ifndef DICOPXT_H +#define DICOPXT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofbmanip.h" + +#include "dcmtk/dcmimage/dicopx.h" +#include "dcmtk/dcmimgle/dipxrept.h" + + +/********************************************************************/ + + +inline Uint8 removeSign(const Uint8 value, const Uint8) +{ + return value; +} + + +inline Uint16 removeSign(const Uint16 value, const Uint16) +{ + return value; +} + + +inline Uint32 removeSign(const Uint32 value, const Uint32) +{ + return value; +} + + +inline Uint8 removeSign(const Sint8 value, const Sint8 offset) +{ + return OFstatic_cast(Uint8, OFstatic_cast(Sint16, value) + OFstatic_cast(Sint16, offset) + 1); +} + + +inline Uint16 removeSign(const Sint16 value, const Sint16 offset) +{ + return OFstatic_cast(Uint16, OFstatic_cast(Sint32, value) + OFstatic_cast(Sint32, offset) + 1); +} + +/* +inline Uint32 removeSign(const Sint32 value, const Sint32 offset) +{ + return (value < 0) ? OFstatic_cast(Uint32, value + offset + 1) : OFstatic_cast(Uint32, value) + OFstatic_cast(Uint32, offset) + 1; +} + + +inline Uint8 removeSign(const Sint8 value, const Uint8 mask) +{ + return OFstatic_cast(Uint8, value) ^ mask; +} + + +inline Uint16 removeSign(const Sint16 value, const Uint16 mask) +{ + return OFstatic_cast(Uint16, value) ^ mask; +} +*/ + +inline Uint32 removeSign(const Sint32 value, const Uint32 mask) +{ + return OFstatic_cast(Uint32, value) ^ mask; +} + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle color pixel data + */ +template +class DiColorPixelTemplate + : public DiColorPixel, + public DiPixelRepresentationTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to the DICOM document + * @param pixel pointer to input pixel data + * @param samples number of expected samples per pixel (for checking purposes) + * @param status status of the image object (reference variable) + * @param sample_rate dummy parameter (used for derived classes only) + */ + DiColorPixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + const Uint16 samples, + EI_Status &status, + const Uint16 sample_rate = 0) + : DiColorPixel(docu, pixel, samples, status, sample_rate) + { + Data[0] = NULL; + Data[1] = NULL; + Data[2] = NULL; + } + + /** destructor + */ + virtual ~DiColorPixelTemplate() + { +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + /* use a non-throwing delete (if available) */ + operator delete[] (Data[0], std::nothrow); + operator delete[] (Data[1], std::nothrow); + operator delete[] (Data[2], std::nothrow); +#else + delete[] Data[0]; + delete[] Data[1]; + delete[] Data[2]; +#endif + } + + /** get integer representation + * + ** @return integer representation of the internally stored pixel data + */ + inline EP_Representation getRepresentation() const + { + return DiPixelRepresentationTemplate::getRepresentation(); + } + + /** get pointer to internal array of pixel data. + * The returned array [0..2] points to the three image planes. + * + ** @return pointer to array of pixel data + */ + inline const void *getData() const + { + return OFstatic_cast(const void *, Data); + } + + /** get pointer to internal array of pixel data. + * The returned array [0..2] points to the three image planes. + * + ** @return pointer to array of pixel data + */ + inline void *getDataPtr() + { + return OFstatic_cast(void *, Data); + } + + /** get pointer to internal array of pixel data. + * The returned array [0..2] points to the three image planes. + * + ** @return reference to pointer to pixel data + */ + inline void *getDataArrayPtr() + { + return OFstatic_cast(void *, Data); + } + + /** fill given memory block with pixel data (all three image planes, RGB) + * + ** @param data pointer to memory block (array of 8 or 16 bit values, OB/OW) + * @param count number of T-size entries allocated in the 'data' array + * @param fcount number of pixels per frame + * @param frames total number of frames present in intermediate representation + * @param planar flag indicating whether data shall be stored color-by-pixel or color-by-plane + * + ** @return OFTrue if successful, OFFalse otherwise + */ + OFBool getPixelData(void *data, + const unsigned long count, + const unsigned long fcount, + const unsigned long frames, + const int planar) const + { + OFBool result = OFFalse; + /* check parameters and internal data */ + if ((data != NULL) && (count >= Count * 3) && (frames > 0) && (frames * fcount <= Count) && + (Data[0] != NULL) && (Data[1] != NULL) && (Data[2] != NULL)) + { + T *q = OFstatic_cast(T *, data); + int j; + unsigned long k; + unsigned long offset = 0; + if (planar) + { + /* for all frames ... */ + for (k = 0; k < frames; ++k) + { + /* copy all three planes to the given memory block */ + for (j = 0; j < 3; ++j) + { + OFBitmanipTemplate::copyMem(Data[j] + offset, q, fcount); + q += fcount; + } + offset += fcount; + } + } else { + unsigned long i; + /* for all frames ... */ + for (k = 0; k < frames; ++k) + { + /* copy pixel data values from internal representation */ + for (i = 0; i < fcount; ++i) + { + for (j = 0; j < 3; ++j) + *(q++) = Data[j][i + offset]; + } + offset += fcount; + } + } + result = OFTrue; + } + return result; + } + + /** create true color (24/32 bit) bitmap for MS Windows. + * + ** @param data untyped pointer memory buffer (set to NULL if not allocated externally) + * @param size size of the memory buffer in bytes (if 0 'data' is set to NULL) + * @param width number of columns of the image + * @param height number of rows of the image + * @param frame index of frame to be converted (starting from 0) + * @param fromBits number of bits per sample used for internal representation of the image + * @param toBits number of bits per sample used for the output bitmap (<= 8) + * @param mode color output mode (24 or 32 bits, see dcmimgle/dcmimage.h for details) + * @param upsideDown specifies the order of lines in the images (0 = top-down, bottom-up otherwise) + * @param padding align each line to a 32-bit address if true + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createDIB(void *&data, + const unsigned long size, + const Uint16 width, + const Uint16 height, + const unsigned long frame, + const int fromBits, + const int toBits, + const int mode, + const int upsideDown, + const int padding) const + { + unsigned long bytes = 0; + if ((Data[0] != NULL) && (Data[1] != NULL) && (Data[2] != NULL) && (toBits <= 8)) + { + const unsigned long count = OFstatic_cast(unsigned long, width) * OFstatic_cast(unsigned long, height); + const unsigned long start = count * frame + ((upsideDown) ? + OFstatic_cast(unsigned long, height - 1) * OFstatic_cast(unsigned long, width) : 0); + const signed long nextRow = (upsideDown) ? -2 * OFstatic_cast(signed long, width) : 0; + const T *r = Data[0] + start; + const T *g = Data[1] + start; + const T *b = Data[2] + start; + Uint16 x; + Uint16 y; + if (mode == 24) // 24 bits per pixel + { + const unsigned long wid3 = OFstatic_cast(unsigned long, width) * 3; + // each line has to start at 32-bit-address, if 'padding' is true + const int gap = (padding) ? OFstatic_cast(int, (4 - (wid3 & 0x3)) & 0x3) : 0; + unsigned long fsize = (wid3 + gap) * OFstatic_cast(unsigned long, height); + if ((data == NULL) || (size >= fsize)) + { + if (data == NULL) + data = new Uint8[fsize]; + if (data != NULL) + { + Uint8 *q = OFstatic_cast(Uint8 *, data); + if (fromBits == toBits) + { + /* copy pixel data as is */ + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* reverse sample order: B-G-R */ + *(q++) = OFstatic_cast(Uint8, *(b++)); + *(q++) = OFstatic_cast(Uint8, *(g++)); + *(q++) = OFstatic_cast(Uint8, *(r++)); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + q += gap; // new line: jump to next 32-bit address + } + } + else if (fromBits < toBits) + { + /* increase color depth: multiply with factor */ + const double gradient1 = OFstatic_cast(double, DicomImageClass::maxval(toBits)) / + OFstatic_cast(double, DicomImageClass::maxval(fromBits)); + const Uint8 gradient2 = OFstatic_cast(Uint8, gradient1); + if (gradient1 == OFstatic_cast(double, gradient2)) // integer multiplication? + { + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* reverse sample order: B-G-R */ + *(q++) = OFstatic_cast(Uint8, *(b++) * gradient2); + *(q++) = OFstatic_cast(Uint8, *(g++) * gradient2); + *(q++) = OFstatic_cast(Uint8, *(r++) * gradient2); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + q += gap; // new line: jump to next 32-bit address + } + } else { + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* reverse sample order: B-G-R */ + *(q++) = OFstatic_cast(Uint8, OFstatic_cast(double, *(b++)) * gradient1); + *(q++) = OFstatic_cast(Uint8, OFstatic_cast(double, *(g++)) * gradient1); + *(q++) = OFstatic_cast(Uint8, OFstatic_cast(double, *(r++)) * gradient1); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + q += gap; // new line: jump to next 32-bit address + } + } + } + else /* fromBits > toBits */ + { + /* reduce color depth: right shift */ + const int shift = fromBits - toBits; + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* reverse sample order: B-G-R */ + *(q++) = OFstatic_cast(Uint8, *(b++) >> shift); + *(q++) = OFstatic_cast(Uint8, *(g++) >> shift); + *(q++) = OFstatic_cast(Uint8, *(r++) >> shift); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + q += gap; // new line: jump to next 32-bit address + } + } + bytes = fsize; + } + } + } + else if (mode == 32) // 32 bits per pixel + { + const unsigned long fsize = count * 4; + if ((data == NULL) || (size >= fsize)) + { + if (data == NULL) + data = new Uint32[count]; + if (data != NULL) + { + Uint32 *q = OFstatic_cast(Uint32 *, data); + if (fromBits == toBits) + { + /* copy pixel data as is */ + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* normal sample order: 0-R-G-B */ + *(q++) = (OFstatic_cast(Uint32, *(r++)) << 16) | + (OFstatic_cast(Uint32, *(g++)) << 8) | + OFstatic_cast(Uint32, *(b++)); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + } + } + else if (fromBits < toBits) + { + /* increase color depth: multiply with factor */ + const double gradient1 = OFstatic_cast(double, DicomImageClass::maxval(toBits)) / + OFstatic_cast(double, DicomImageClass::maxval(fromBits)); + const Uint32 gradient2 = OFstatic_cast(Uint32, gradient1); + if (gradient1 == OFstatic_cast(double, gradient2)) // integer multiplication? + { + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* normal sample order: 0-R-G-B */ + *(q++) = (OFstatic_cast(Uint32, *(r++) * gradient2) << 16) | + (OFstatic_cast(Uint32, *(g++) * gradient2) << 8) | + OFstatic_cast(Uint32, *(b++) * gradient2); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + } + } else { + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* normal sample order: 0-R-G-B */ + *(q++) = (OFstatic_cast(Uint32, OFstatic_cast(double, *(r++)) * gradient1) << 16) | + (OFstatic_cast(Uint32, OFstatic_cast(double, *(g++)) * gradient1) << 8) | + OFstatic_cast(Uint32, OFstatic_cast(double, *(b++)) * gradient1); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + } + } + } + else /* fromBits > toBits */ + { + /* reduce color depth: right shift */ + const int shift = fromBits - toBits; + for (y = height; y != 0; y--) + { + for (x = width; x != 0; x--) + { + /* normal sample order: 0-R-G-B */ + *(q++) = (OFstatic_cast(Uint32, *(r++) >> shift) << 16) | + (OFstatic_cast(Uint32, *(g++) >> shift) << 8) | + OFstatic_cast(Uint32, *(b++) >> shift); + } + r += nextRow; g += nextRow; b += nextRow; // go backwards if 'upsideDown' + } + } + bytes = fsize; + } + } + } + } + return bytes; + } + + /** create true color (32 bit) bitmap for Java (AWT default format). + * + ** @param data resulting pointer to bitmap data (set to NULL if an error occurred) + * @param width number of columns of the image + * @param height number of rows of the image + * @param frame index of frame to be converted (starting from 0) + * @param fromBits number of bits per sample used for internal representation of the image + * @param toBits number of bits per sample used for the output bitmap (<= 8) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createAWTBitmap(void *&data, + const Uint16 width, + const Uint16 height, + const unsigned long frame, + const int fromBits, + const int toBits) const + { + data = NULL; + unsigned long bytes = 0; + if ((Data[0] != NULL) && (Data[1] != NULL) && (Data[2] != NULL) && (toBits <= 8)) + { + const unsigned long count = OFstatic_cast(unsigned long, width) * OFstatic_cast(unsigned long, height); + data = new Uint32[count]; + if (data != NULL) + { + const unsigned long start = count * frame; + const T *r = Data[0] + start; + const T *g = Data[1] + start; + const T *b = Data[2] + start; + Uint32 *q = OFstatic_cast(Uint32 *, data); + unsigned long i; + if (fromBits == toBits) + { + /* copy pixel data as is */ + for (i = count; i != 0; --i) + { + /* sample order: R-G-B */ + *(q++) = (OFstatic_cast(Uint32, *(r++)) << 24) | + (OFstatic_cast(Uint32, *(g++)) << 16) | + (OFstatic_cast(Uint32, *(b++)) << 8); + } + } + else if (fromBits < toBits) + { + /* increase color depth: multiply with factor */ + const double gradient1 = OFstatic_cast(double, DicomImageClass::maxval(toBits)) / + OFstatic_cast(double, DicomImageClass::maxval(fromBits)); + const Uint32 gradient2 = OFstatic_cast(Uint32, gradient1); + if (gradient1 == OFstatic_cast(double, gradient2)) // integer multiplication? + { + for (i = count; i != 0; --i) + { + /* sample order: R-G-B */ + *(q++) = (OFstatic_cast(Uint32, *(r++) * gradient2) << 24) | + (OFstatic_cast(Uint32, *(g++) * gradient2) << 16) | + (OFstatic_cast(Uint32, *(b++) * gradient2) << 8); + } + } else { + for (i = count; i != 0; --i) + { + /* sample order: R-G-B */ + *(q++) = (OFstatic_cast(Uint32, OFstatic_cast(double, *(r++)) * gradient1) << 24) | + (OFstatic_cast(Uint32, OFstatic_cast(double, *(g++)) * gradient1) << 16) | + (OFstatic_cast(Uint32, OFstatic_cast(double, *(b++)) * gradient1) << 8); + } + } + } + else /* fromBits > toBits */ + { + /* reduce color depth: right shift */ + const int shift = fromBits - toBits; + for (i = count; i != 0; --i) + { + /* sample order: R-G-B */ + *(q++) = (OFstatic_cast(Uint32, *(r++) >> shift) << 24) | + (OFstatic_cast(Uint32, *(g++) >> shift) << 16) | + (OFstatic_cast(Uint32, *(b++) >> shift) << 8); + } + } + bytes = count * 4; + } + } + return bytes; + } + + + protected: + + /** constructor + * + ** @param pixel pointer to intermediate color pixel data + * @param count number of pixels + */ + DiColorPixelTemplate(const DiColorPixel *pixel, + const unsigned long count) + : DiColorPixel(pixel, count) + { + Data[0] = NULL; + Data[1] = NULL; + Data[2] = NULL; + } + + /** initialize internal memory + * + ** @param pixel pointer to input pixel data + * + ** @return true (1) if successful, false (0) otherwise + */ + inline int Init(const void *pixel) + { + int result = 0; + if (pixel != NULL) + { + result = 1; + /* allocate data buffer for the 3 planes */ + for (int j = 0; j < 3; j++) + { +#ifdef HAVE_STD__NOTHROW + /* use a non-throwing new here (if available) because the allocated buffer can be huge */ + Data[j] = new (std::nothrow) T[Count]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + Data[j] = new T[Count]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + Data[j] = NULL; + } +#endif + if (Data[j] != NULL) + { + /* erase empty part of the buffer (=blacken the background) */ + if (InputCount < Count) + OFBitmanipTemplate::zeroMem(Data[j] + InputCount, Count - InputCount); + } else { + DCMIMAGE_DEBUG("cannot allocate memory buffer for 'Data[" << j << "]' in DiColorPixelTemplate::Init()"); + result = 0; // at least one buffer could not be allocated! + } + } + } + return result; + } + + + /// pointer to pixel data (3 components) + T *Data[3]; + + + private: + + // --- declarations to avoid compiler warnings + + DiColorPixelTemplate(const DiColorPixelTemplate &); + DiColorPixelTemplate &operator=(const DiColorPixelTemplate &); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicorot.h b/dcmimage/include/dcmtk/dcmimage/dicorot.h new file mode 100644 index 00000000..a1533fe8 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicorot.h @@ -0,0 +1,107 @@ +/* + * + * Copyright (C) 1998-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorRotateTemplate (Header) + * + */ + + +#ifndef DICOROT_H +#define DICOROT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/dirotat.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to rotate color images (on pixel data level). + * by steps of 90 degrees + */ +template +class DiColorRotateTemplate + : public DiColorPixelTemplate, + protected DiRotateTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param src_cols width of clipping area + * @param src_rows height of clipping area + * @param dest_cols width of destination image (scaled image) + * @param dest_rows height of destination image + * @param frames number of frames + * @param degree angle by which the pixel data should be rotated + */ + DiColorRotateTemplate(const DiColorPixel *pixel, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const Uint32 frames, + const int degree) + : DiColorPixelTemplate(pixel, OFstatic_cast(unsigned long, dest_cols) * OFstatic_cast(unsigned long, dest_rows) * frames), + DiRotateTemplate(3, src_cols, src_rows, dest_cols, dest_rows, frames) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if (pixel->getCount() == OFstatic_cast(unsigned long, src_cols) * OFstatic_cast(unsigned long, src_rows) * frames) + rotate(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), degree); + else { + DCMIMAGE_WARN("could not rotate image ... corrupted data"); + } + } + } + + /** destructor + */ + ~DiColorRotateTemplate() + { + } + + + private: + + /** rotate pixel data + * + ** @param pixel pointer to pixel data (3 components) to be rotated + * @param degree angle by which the pixel data should be rotated + */ + inline void rotate(const T *pixel[3], + const int degree) + { + if (this->Init(pixel)) + { + if (degree == 90) + this->rotateRight(pixel, this->Data); + else if (degree == 180) + this->rotateTopDown(pixel, this->Data); + else if (degree == 270) + this->rotateLeft(pixel, this->Data); + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dicosct.h b/dcmimage/include/dcmtk/dcmimage/dicosct.h new file mode 100644 index 00000000..8eb31715 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dicosct.h @@ -0,0 +1,109 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorScaleTemplate (Header) + * + */ + + +#ifndef DICOSCT_H +#define DICOSCT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/discalet.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to scale color images (on pixel data level). + */ +template +class DiColorScaleTemplate + : public DiColorPixelTemplate, + protected DiScaleTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param columns width of source image + * @param rows height of source image + * @param left_pos left coordinate of clipping area + * @param top_pos top coordinate of clipping area + * @param src_cols width of clipping area + * @param src_rows height of clipping area + * @param dest_cols width of destination image (scaled image) + * @param dest_rows height of destination image + * @param frames number of frames + * @param bits number of bits per plane/pixel + * @param interpolate use of interpolation when scaling + */ + DiColorScaleTemplate(const DiColorPixel *pixel, + const Uint16 columns, + const Uint16 rows, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const Uint32 frames, + const int bits, + const int interpolate) + : DiColorPixelTemplate(pixel, OFstatic_cast(unsigned long, dest_cols) * OFstatic_cast(unsigned long, dest_rows) * frames), + DiScaleTemplate(3, columns, rows, left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, frames, bits) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if (pixel->getCount() == OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames) + scale(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), interpolate); + else { + DCMIMAGE_WARN("could not scale image ... corrupted data"); + } + } + } + + /** destructor + */ + virtual ~DiColorScaleTemplate() + { + } + + + private: + + /** scale pixel data + * + ** @param pixel pointer to pixel data (3 components9 to be scaled + * @param interpolate use of interpolation when scaling + */ + inline void scale(const T *pixel[3], + const int interpolate) + { + if (this->Init(pixel)) + this->scaleData(pixel, this->Data, interpolate); + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dihsvimg.h b/dcmimage/include/dcmtk/dcmimage/dihsvimg.h new file mode 100644 index 00000000..e9ba8a9a --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dihsvimg.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomHSVImage (Header) + * + */ + + +#ifndef DIHSVIMG_H +#define DIHSVIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for HSV images + */ +class DCMTK_DCMIMAGE_EXPORT DiHSVImage + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiHSVImage(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiHSVImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dihsvpxt.h b/dcmimage/include/dcmtk/dcmimage/dihsvpxt.h new file mode 100644 index 00000000..489fa1e6 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dihsvpxt.h @@ -0,0 +1,210 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomHSVPixelTemplate (Header) + * + */ + + +#ifndef DIHSVPXT_H +#define DIHSVPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle HSV pixel data + */ +template +class DiHSVPixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param status reference to status variable + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + */ + DiHSVPixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + EI_Status &status, + const unsigned long planeSize, + const int bits) + : DiColorPixelTemplate(docu, pixel, 3, status) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), planeSize, bits); + } + + /** destructor + */ + virtual ~DiHSVPixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + */ + void convert(const T1 *pixel, + const unsigned long planeSize, + const int bits) + { + if (this->Init(pixel)) + { + T2 *r = this->Data[0]; + T2 *g = this->Data[1]; + T2 *b = this->Data[2]; + const T2 maxvalue = OFstatic_cast(T2, DicomImageClass::maxval(bits)); + const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1)); + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + if (this->PlanarConfiguration) + { +/* + const T1 *h = pixel; + const T1 *s = h + this->InputCount; + const T1 *v = s + this->InputCount; + for (i = count; i != 0; --i) + convertValue(*(r++), *(g++), *(b++), removeSign(*(h++), offset), removeSign(*(s++), offset), + removeSign(*(v++), offset), maxvalue); +*/ + unsigned long l; + unsigned long i = count; + const T1 *h = pixel; + const T1 *s = h + planeSize; + const T1 *v = s + planeSize; + while (i != 0) + { + /* convert a single frame */ + for (l = planeSize; (l != 0) && (i != 0); --l, --i) + { + convertValue(*(r++), *(g++), *(b++), removeSign(*(h++), offset), removeSign(*(s++), offset), + removeSign(*(v++), offset), maxvalue); + } + /* jump to next frame start (skip 2 planes) */ + h += 2 * planeSize; + s += 2 * planeSize; + v += 2 * planeSize; + } + } + else + { + const T1 *p = pixel; + T2 h; + T2 s; + T2 v; + unsigned long i; + for (i = count; i != 0; --i) + { + h = removeSign(*(p++), offset); + s = removeSign(*(p++), offset); + v = removeSign(*(p++), offset); + convertValue(*(r++), *(g++), *(b++), h, s, v, maxvalue); + } + } + } + } + + /** convert a single HSV value to RGB + */ + void convertValue(T2 &red, + T2 &green, + T2 &blue, + const T2 hue, + const T2 saturation, + const T2 value, + const T2 maxvalue) + { + /* + * conversion algorithm taken from Foley et al.: 'Computer Graphics: Principles and Practice' (1990) + */ + + if (saturation == 0) + { + red = value; + green = value; + blue = value; + } + else + { + const double h = (OFstatic_cast(double, hue) * 6) / (OFstatic_cast(double, maxvalue) + 1); // '... + 1' to assert h < 6 + const double s = OFstatic_cast(double, saturation) / OFstatic_cast(double, maxvalue); + const double v = OFstatic_cast(double, value) / OFstatic_cast(double, maxvalue); + const T2 hi = OFstatic_cast(T2, h); + const double hf = h - hi; + const T2 p = OFstatic_cast(T2, maxvalue * v * (1 - s)); + const T2 q = OFstatic_cast(T2, maxvalue * v * (1 - s * hf)); + const T2 t = OFstatic_cast(T2, maxvalue * v * (1 - s * (1 - hf))); + switch (hi) + { + case 0: + red = value; + green = t; + blue = p; + break; + case 1: + red = q; + green = value; + blue = p; + break; + case 2: + red = p; + green = value; + blue = t; + break; + case 3: + red = p; + green = q; + blue = value; + break; + case 4: + red = t; + green = p; + blue = value; + break; + case 5: + red = value; + green = p; + blue = q; + break; + default: + DCMIMAGE_WARN("invalid value for 'hi' while converting HSV to RGB"); + } + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dilogger.h b/dcmimage/include/dcmtk/dcmimage/dilogger.h new file mode 100644 index 00000000..df868824 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dilogger.h @@ -0,0 +1,41 @@ +/* + * + * Copyright (C) 2009-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: Logger (Header) + * + */ + + +#ifndef DILOGGER_H +#define DILOGGER_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/oflog/oflog.h" + +#include "dcmtk/dcmimage/dicdefin.h" + +extern DCMTK_DCMIMAGE_EXPORT OFLogger DCM_dcmimageLogger; + +#define DCMIMAGE_TRACE(msg) OFLOG_TRACE(DCM_dcmimageLogger, msg) +#define DCMIMAGE_DEBUG(msg) OFLOG_DEBUG(DCM_dcmimageLogger, msg) +#define DCMIMAGE_INFO(msg) OFLOG_INFO(DCM_dcmimageLogger, msg) +#define DCMIMAGE_WARN(msg) OFLOG_WARN(DCM_dcmimageLogger, msg) +#define DCMIMAGE_ERROR(msg) OFLOG_ERROR(DCM_dcmimageLogger, msg) +#define DCMIMAGE_FATAL(msg) OFLOG_FATAL(DCM_dcmimageLogger, msg) + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dipalimg.h b/dcmimage/include/dcmtk/dcmimage/dipalimg.h new file mode 100644 index 00000000..c0342de8 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dipalimg.h @@ -0,0 +1,90 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomPaletteImage (Header) + * + */ + + +#ifndef DIPALIMG_H +#define DIPALIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiLookupTable; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for PALETTE COLOR images + */ +class DCMTK_DCMIMAGE_EXPORT DiPaletteImage + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiPaletteImage(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiPaletteImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); + + + private: + + /// three color palettes for R, G and B + DiLookupTable *Palette[3]; + + // --- declarations to avoid compiler warnings + + DiPaletteImage(const DiPaletteImage &); + DiPaletteImage &operator=(const DiPaletteImage &); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dipalpxt.h b/dcmimage/include/dcmtk/dcmimage/dipalpxt.h new file mode 100644 index 00000000..e1c498a8 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dipalpxt.h @@ -0,0 +1,115 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomPalettePixelTemplate (Header) + * + */ + + +#ifndef DIPALPXT_H +#define DIPALPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diluptab.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle Palette color pixel data + */ +template +class DiPalettePixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param palette pointer to RGB color palette + * @param status reference to status variable + */ + DiPalettePixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + DiLookupTable *palette[3], + EI_Status &status) + : DiColorPixelTemplate(docu, pixel, 1, status) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + { + if (this->PlanarConfiguration) + { + status = EIS_InvalidValue; + DCMIMAGE_ERROR("invalid value for 'PlanarConfiguration' (" << this->PlanarConfiguration << ")"); + } + else + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), palette); + } + } + + /** destructor + */ + virtual ~DiPalettePixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param palette pointer to RGB color palette + */ + void convert(const T1 *pixel, + DiLookupTable *palette[3]) + { // can be optimized if necessary ! + if (this->Init(pixel)) + { + const T1 *p = pixel; + T2 value = 0; + unsigned long i; + int j; + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + for (i = 0; i < count; ++i) + { + value = OFstatic_cast(T2, *(p++)); + for (j = 0; j < 3; ++j) + { + if (value <= palette[j]->getFirstEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getFirstValue()); + else if (value >= palette[j]->getLastEntry(value)) + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getLastValue()); + else + this->Data[j][i] = OFstatic_cast(T3, palette[j]->getValue(value)); + } + } + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dipipng.h b/dcmimage/include/dcmtk/dcmimage/dipipng.h new file mode 100644 index 00000000..a103b51e --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dipipng.h @@ -0,0 +1,143 @@ +/* + * + * Copyright (C) 2003-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Alexander Haderer + * + * Purpose: Implements PNG interface for plugable image formats + * + */ + + +#ifndef DIPIPNG_H +#define DIPIPNG_H + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_LIBPNG + +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmimgle/diplugin.h" +#include "dcmtk/dcmimage/dicdefin.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiImage; + + +/*--------------------* + * type definitions * + *--------------------*/ + +/** describes the different types of interlace supported by + * the PNG plugin. Enumeration depends on capabilities + * of underlying PNG library (libpng). + * @remark this enum is only available if DCMTK is compiled with + * PNG (libpng) support enabled. + */ +enum DiPNGInterlace +{ + /// Adam7 + E_pngInterlaceAdam7, + + /// no interlace + E_pngInterlaceNone +}; + +/** describes the different types of metainfo written to + * the png file. + * @remark this enum is only available if DCMTK is compiled with + * PNG (libpng) support enabled. + */ +enum DiPNGMetainfo +{ + /// no meta information + E_pngNoMetainfo, + + /// file time, creator + E_pngFileMetainfo +}; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of a PNG plugin for the dcmimgle/dcmimage library + * @remark This class is only available if DCMTK is compiled with + * PNG (libpng) support enabled. + */ +class DCMTK_DCMIMAGE_EXPORT DiPNGPlugin + : public DiPluginFormat +{ + + public: + + /** constructor + */ + DiPNGPlugin(); + + /** destructor + */ + virtual ~DiPNGPlugin(); + + /** write given image to a file stream (PNG format) + * @param image pointer to DICOM image object to be written + * @param stream stream to which the image is written (open in binary mode!) + * @param frame index of frame used for output (default: first frame = 0) + * @return true if successful, false otherwise + */ + virtual int write(DiImage *image, + FILE *stream, + const unsigned long frame = 0) const; + + /** set interlace type for PNG creation + * @param inter interlace type + */ + void setInterlaceType(DiPNGInterlace inter); + + /** set metainfo type for PNG creation + * @param minfo metainfo type + */ + void setMetainfoType(DiPNGMetainfo minfo); + + /* set bits per sample for PNG creation + * @param bpp bits per sample (8 or 16) + */ + void setBitsPerSample(const int bpp); + + /** get version information of the PNG library. + * Typical output format: "LIBPNG, Version 3.5.7" + * @return name and version number of the PNG library + */ + static OFString getLibraryVersionString(); + + + private: + + /// PNG interlace type + DiPNGInterlace interlaceType; + + /// PNG metainfo type + DiPNGMetainfo metainfoType; + + /// bits per sample (8 or 16, default: 8) + int bitsPerSample; +}; + +#endif +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dipitiff.h b/dcmimage/include/dcmtk/dcmimage/dipitiff.h new file mode 100644 index 00000000..d6853a6c --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dipitiff.h @@ -0,0 +1,152 @@ +/* + * + * Copyright (C) 2001-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: Implements TIFF interface for plugable image formats + * + */ + + +#ifndef DIPITIFF_H +#define DIPITIFF_H + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_LIBTIFF + +#include "dcmtk/ofstd/ofstring.h" + +#include "dcmtk/dcmimgle/diplugin.h" + +#include "dcmtk/dcmimage/dicdefin.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiImage; + + +/*--------------------* + * type definitions * + *--------------------*/ + +/** describes the different types of compression supported by + * the TIFF plugin. Enumeration depends on capabilities + * of underlying TIFF library (libtiff). + * @remark this enum is only available if DCMTK is compiled with + * TIFF (libtiff) support enabled. + */ +enum DiTIFFCompression +{ + /// PackBits compression (RLE) + E_tiffPackBitsCompression, + + /// LZW compression + E_tiffLZWCompression, + + /// uncompressed + E_tiffNoCompression +}; + +/** describes the optional predictor used with TIFF LZW compression + * @remark this enum is only available if DCMTK is compiled with + * TIFF (libtiff) support enabled. + */ +enum DiTIFFLZWPredictor +{ + /// omit preditor tag (defaults to no prediction) + E_tiffLZWPredictorDefault, + + /// predictor 1: no prediction scheme + E_tiffLZWPredictorNoPrediction, + + /// predictor 2: use horizontal differencing + E_tiffLZWPredictorHDifferencing +}; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of a TIFF plugin for the dcmimgle/dcmimage library + * @remark This class is only available if DCMTK is compiled with + * TIFF (libtiff) support enabled. + */ +class DCMTK_DCMIMAGE_EXPORT DiTIFFPlugin + : public DiPluginFormat +{ + + public: + + /** constructor + */ + DiTIFFPlugin(); + + /** destructor + */ + virtual ~DiTIFFPlugin(); + + /** write given image to a file stream (TIFF format) + * @param image pointer to DICOM image object to be written + * @param stream stream to which the image is written (open in binary mode!) + * @param frame index of frame used for output (default: first frame = 0) + * @return true if successful, false otherwise + */ + virtual int write(DiImage *image, + FILE *stream, + const unsigned long frame = 0) const; + + /** set compression type for TIFF creation + * @param ctype compression type + */ + void setCompressionType(DiTIFFCompression ctype); + + /** set predictor type for LZW compression + * @param pred predictor type + */ + void setLZWPredictor(DiTIFFLZWPredictor pred); + + /** set rows per strip for TIFF creation. + * @param rows rows per strip. By default (value 0), + * rows per strip is calculated automatically such that + * each strip contains about 8 kByte of data. + */ + void setRowsPerStrip(unsigned long rows = 0); + + /** get version information of the TIFF library. + * Typical output format: "LIBTIFF, Version 3.5.7" + * @return name and version number of the TIFF library + */ + static OFString getLibraryVersionString(); + + + private: + + /// TIFF compression type + DiTIFFCompression compressionType; + + /// TIFF predictor type + DiTIFFLZWPredictor predictor; + + /// TIFF rows per strip + unsigned long rowsPerStrip; +}; + +#endif +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqtcmap.h b/dcmimage/include/dcmtk/dcmimage/diqtcmap.h new file mode 100644 index 00000000..29267110 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqtcmap.h @@ -0,0 +1,131 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantColorMapping + * + */ + + +#ifndef DIQTCMAP_H +#define DIQTCMAP_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimage/diqttype.h" /* for DcmQuantComponent */ +#include "dcmtk/dcmimgle/dcmimage.h" /* gcc 3.4 needs this */ +#include "dcmtk/dcmimage/diqtstab.h" /* gcc 3.4 needs this */ +#include "dcmtk/dcmimage/diqtpix.h" /* gcc 3.4 needs this */ +#include "dcmtk/dcmimage/diqthash.h" /* gcc 3.4 needs this */ +#include "dcmtk/dcmimage/diqtctab.h" /* gcc 3.4 needs this */ + +class DicomImage; +class DcmQuantColorHashTable; +class DcmQuantColorTable; +class DcmQuantPixel; +class DcmQuantScaleTable; + + +/** template class that maps a color image into a palette color image + * with given color palette. The two template parameters define the + * error diffusion class used to implement e.g. Floyd-Steinberg error + * diffusion and the output type of the color index values, which may be + * 8 bit or 16 bit unsigned integers. + */ +template +class DcmQuantColorMapping +{ +public: + + /** converts a single frame of a color image into a palette color image. + * @param sourceImage color image + * @param frameNumber number of frame (in sourceImage) that is converted + * @param maxval maximum pixel value to which all color samples + * were down-sampled during computation of the histogram on which + * the color LUT is based. This value is required to make sure that the + * hash table doesn't get too large. + * @param cht color hash table. This table is passed by the caller since + * the same hash table can be used if multiple frames are converted. + * Initially (i.e. when called for the first frame) the hash table is empty. + * @param colormap color LUT to which the color image is mapped. + * @param fs error diffusion object, e.g. an instance of class DcmQuantIdent + * or class DcmQuantFloydSteinberg, depending on the template instantiation. + * @param tp pointer to an array to which the palette color image data + * is written. The array must be large enough to store sourceImage.getWidth() + * times sourceImage.getHeight() values of type T2. + */ + static void create( + DicomImage& sourceImage, + unsigned long frameNumber, + unsigned long maxval, + DcmQuantColorHashTable& cht, + DcmQuantColorTable& colormap, + T1& fs, + T2 *tp) + { + unsigned long cols = sourceImage.getWidth(); + unsigned long rows = sourceImage.getHeight(); + const int bits = sizeof(DcmQuantComponent)*8; + DcmQuantPixel px; + long limitcol; + long col; // must be signed! + long maxval_l = OFstatic_cast(long, maxval); + int ind; + const DcmQuantComponent *currentpixel; + DcmQuantComponent cr, cg, cb; + + // create scale table + DcmQuantScaleTable scaletable; + scaletable.createTable(OFstatic_cast(DcmQuantComponent, -1), maxval); + + const void *data = sourceImage.getOutputData(bits, frameNumber, 0); + if (data) + { + const DcmQuantComponent *cp = OFstatic_cast(const DcmQuantComponent *, data); + for (unsigned long row = 0; row < rows; ++row) + { + fs.startRow(col, limitcol); + do + { + currentpixel = cp + col + col + col; + cr = *currentpixel++; + cg = *currentpixel++; + cb = *currentpixel; + px.scale(cr, cg, cb, scaletable); + + fs.adjust(px, col, maxval_l); + + // Check hash table to see if we have already matched this color. + ind = cht.lookup(px); + if (ind < 0) + { + ind = colormap.computeIndex(px); + cht.add(px, ind); + } + + fs.propagate(px, colormap.getPixel(ind), col); + tp[col] = OFstatic_cast(T2, ind); + fs.nextCol(col); + } while ( col != limitcol ); + fs.finishRow(); + cp += (cols * 3); // advance source pointer by one row + tp += cols; // advance target pointer by one row + } // for all rows + } // if (data) + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqtctab.h b/dcmimage/include/dcmtk/dcmimage/diqtctab.h new file mode 100644 index 00000000..ae4a21ce --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqtctab.h @@ -0,0 +1,232 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantColorTable + * + */ + + +#ifndef DIQTCTAB_H +#define DIQTCTAB_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/ofstd/ofcond.h" /* for OFCondition */ +#include "dcmtk/dcmimage/diqtpix.h" /* for DcmQuantPixel */ +#include "dcmtk/dcmimage/diqthash.h" /* for DcmQuantHistogramItem */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ + + +class DicomImage; +class DcmItem; + + +/** this class implements a color table that can either be + * a look-up table or an image color histogram. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantColorTable +{ +public: + + /// constructor + DcmQuantColorTable(); + + /// destructor + ~DcmQuantColorTable(); + + /// resets the object to default-constructed state + void clear(); + + /** returns the number of colors in the color table + * @return number of colors in color table + */ + inline unsigned long getColors() const + { + return numColors; + } + + /** creates a description string suitable for use as + * Derivation Description. + * @param str description string returned in this parameter + */ + void setDescriptionString(OFString& str) const; + + /** creates a color table containing a histogram of the given + * image. Pixel sample values are downsampled if necessary + * to make sure the histogram fits into the given size limit. + * @param image color image for which a histogram is computed + * @param maxcolors maximum number of colors allowed in histogram. + * If necessary, pixel sample values are down-sampled to enforce + * this maximum. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition computeHistogram(DicomImage& image, unsigned long maxcolors); + + /** after a call to computeHistogram(), this method + * returns the maximum pixel value to which all color samples + * were down-sampled during computation of the histogram. + */ + inline unsigned long getMaxVal() const + { + return maxval; + } + + /** returns the color at index idx. + * @param idx index, must be < getColors() + * @return const reference to color + */ + inline const DcmQuantPixel& getPixel(unsigned long idx) const + { +#ifdef DEBUG + assert(array && idx < numColors); +#endif + return *(array[idx]); + } + + /** returns the red color component at index idx + * @param idx index, must be < getColors() + * @return red color component + */ + inline DcmQuantComponent getRed(unsigned long idx) const + { +#ifdef DEBUG + assert(array && idx < numColors); +#endif + return array[idx]->getRed(); + } + + /** returns the green color component at index idx + * @param idx index, must be < getColors() + * @return green color component + */ + inline DcmQuantComponent getGreen(unsigned long idx) const + { +#ifdef DEBUG + assert(array && idx < numColors); +#endif + return array[idx]->getGreen(); + } + + /** returns the blue color component at index idx + * @param idx index, must be < getColors() + * @return blue color component + */ + inline DcmQuantComponent getBlue(unsigned long idx) const + { +#ifdef DEBUG + assert(array && idx < numColors); +#endif + return array[idx]->getBlue(); + } + + /** computes a color LUT for the given image histogram. + * This median-cut colormap generator is based + * on Paul Heckbert's paper "Color Image Quantization for Frame Buffer + * Display", SIGGRAPH '82 Proceedings, page 297. + * @param histogram image color histogram + * @param sum number of pixels in image (colums * rows * frames) + * @param theMaxval maximum value to which pixels were + * downsampled for histogram computation + * @param numberOfColors desired number of colors in color LUT + * @param largeType algorithm used for determining the largest dimension + * in the Median Cut algorithm + * @param repType algorithm for choosing a representative color for each + * box in the Median Cut algorithm + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition medianCut( + DcmQuantColorTable& histogram, + unsigned long sum, + unsigned long theMaxval, + unsigned long numberOfColors, + DcmLargestDimensionType largeType, + DcmRepresentativeColorType repType); + + /** determines for a given color the closest match in the color LUT. + * @param px color to look up in LUT + * @return index of closest match in LUT, -1 if look-up table empty + */ + inline int computeIndex(const DcmQuantPixel& px) const + { + int result = -1; + int r2, g2, b2; + long newdist; + int r1 = OFstatic_cast(int, px.getRed()); + int g1 = OFstatic_cast(int, px.getGreen()); + int b1 = OFstatic_cast(int, px.getBlue()); + long dist = 2000000000; + for (unsigned long i = 0; i < numColors; ++i) + { + r2 = r1 - OFstatic_cast(int, array[i]->getRed()); + g2 = g1 - OFstatic_cast(int, array[i]->getGreen()); + b2 = b1 - OFstatic_cast(int, array[i]->getBlue()); + newdist = r2*r2 + g2*g2 + b2*b2; + if (newdist < dist) + { + result = OFstatic_cast(int, i); + dist = newdist; + if (dist < array[i]->getValue()) i=numColors; // break out of for loop + } + } + return result; + } + + /** writes the current color table into a DICOM object, encoded as + * Red/Green/Blue Palette Color Lookup Table and Data. + * @param target DICOM dataset to write to + * @param writeAsOW if true, LUT data is encoded as OW, otherwise LUT data + * is encoded as US. A LUT with 64k entries is always encoded as OW since + * a US data element with 64k entries cannot be written in explicit VR. + * @param write16BitEntries if true, LUT data is encoded with 16 bits per entry + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write( + DcmItem& target, + OFBool writeAsOW, + OFBool write16BitEntries); + + +private: + + /** after a call to medianCut(), this method computes for each entry in + * the color map the minimum of the euclidean distances to any other + * of the entries. Any color which has an euclidean distance of less + * than half of this distance is necessarily mapped to this entry. + * This data is used by computeIndex() + */ + void computeClusters(); + + /// private undefined copy constructor + DcmQuantColorTable(const DcmQuantColorTable& src); + + /// private undefined copy assignment operator + DcmQuantColorTable& operator=(const DcmQuantColorTable& src); + + /// color table data + DcmQuantHistogramItemPointer *array; + + /// number of entries in color table + unsigned long numColors; + + /** maximum pixel value to which all color samples + * were down-sampled during computation of the histogram. + */ + unsigned long maxval; + +}; + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqtfs.h b/dcmimage/include/dcmtk/dcmimage/diqtfs.h new file mode 100644 index 00000000..e2213add --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqtfs.h @@ -0,0 +1,220 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantFloydSteinberg + * + */ + + +#ifndef DIQTFS_H +#define DIQTFS_H + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimage/diqtpix.h" /* for DcmQuantPixel */ +#include "dcmtk/ofstd/ofcond.h" /* for OFCondition */ + + +/** Floyd-Steinberg error vectors are stored internally as integer numbers + * containing the error multiplied by this constant. + */ +#define DcmQuantFloydSteinbergScale 1024 + + +/** this class implements Floyd-Steinberg error diffusion. + * It is used during the color quantization of an image. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantFloydSteinberg +{ +public: + + /// constructor + DcmQuantFloydSteinberg(); + + /// destructor + ~DcmQuantFloydSteinberg(); + + /** initializes the Floyd-Steinberg error vectors for an image with the + * given number of columns. + * @param cols number of columns in image + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition initialize(unsigned long cols); + + /** uses the Floyd-Steinberg error vectors to adjust the color of the current image pixel. + * @param px the original image pixel is passed in this parameter. Upon return, the pixel + * value contains the new value after error diffusion. + * @param col column in which the current pixel is located, must be [0..columns-1] + * @param maxval maximum value for each color component. + */ + inline void adjust(DcmQuantPixel& px, long col, long maxval) + { + long sr = px.getRed() + thisrerr[col + 1] / DcmQuantFloydSteinbergScale; + long sg = px.getGreen() + thisgerr[col + 1] / DcmQuantFloydSteinbergScale; + long sb = px.getBlue() + thisberr[col + 1] / DcmQuantFloydSteinbergScale; + if ( sr < 0 ) sr = 0; + else if ( sr > OFstatic_cast(long, maxval) ) sr = maxval; + if ( sg < 0 ) sg = 0; + else if ( sg > OFstatic_cast(long, maxval) ) sg = maxval; + if ( sb < 0 ) sb = 0; + else if ( sb > OFstatic_cast(long, maxval) ) sb = maxval; + px.assign(OFstatic_cast(DcmQuantComponent, sr), OFstatic_cast(DcmQuantComponent, sg), OFstatic_cast(DcmQuantComponent, sb)); + } + + /** propagates the Floyd-Steinberg error terms for one pixel. + * @param px color value the current image pixel should have (after adjustment) + * @param mapped color value (selected from the color LUT) the current image pixel really uses + * @param col column in which the current pixel is located, must be [0..columns-1] + */ + inline void propagate(const DcmQuantPixel& px, const DcmQuantPixel& mapped, long col) + { + long err; + + /* Propagate Floyd-Steinberg error terms. */ + if ( fs_direction ) + { + err = ( OFstatic_cast(long, px.getRed()) - OFstatic_cast(long, mapped.getRed()) ) * DcmQuantFloydSteinbergScale; + thisrerr[col + 2] += ( err * 7 ) / 16; + nextrerr[col ] += ( err * 3 ) / 16; + nextrerr[col + 1] += ( err * 5 ) / 16; + nextrerr[col + 2] += ( err ) / 16; + err = ( OFstatic_cast(long, px.getGreen()) - OFstatic_cast(long, mapped.getGreen()) ) * DcmQuantFloydSteinbergScale; + thisgerr[col + 2] += ( err * 7 ) / 16; + nextgerr[col ] += ( err * 3 ) / 16; + nextgerr[col + 1] += ( err * 5 ) / 16; + nextgerr[col + 2] += ( err ) / 16; + err = ( OFstatic_cast(long, px.getBlue()) - OFstatic_cast(long, mapped.getBlue()) ) * DcmQuantFloydSteinbergScale; + thisberr[col + 2] += ( err * 7 ) / 16; + nextberr[col ] += ( err * 3 ) / 16; + nextberr[col + 1] += ( err * 5 ) / 16; + nextberr[col + 2] += ( err ) / 16; + } + else + { + err = ( OFstatic_cast(long, px.getRed()) - OFstatic_cast(long, mapped.getRed()) ) * DcmQuantFloydSteinbergScale; + thisrerr[col ] += ( err * 7 ) / 16; + nextrerr[col + 2] += ( err * 3 ) / 16; + nextrerr[col + 1] += ( err * 5 ) / 16; + nextrerr[col ] += ( err ) / 16; + err = ( OFstatic_cast(long, px.getGreen()) - OFstatic_cast(long, mapped.getGreen()) ) * DcmQuantFloydSteinbergScale; + thisgerr[col ] += ( err * 7 ) / 16; + nextgerr[col + 2] += ( err * 3 ) / 16; + nextgerr[col + 1] += ( err * 5 ) / 16; + nextgerr[col ] += ( err ) / 16; + err = ( OFstatic_cast(long, px.getBlue()) - OFstatic_cast(long, mapped.getBlue()) ) * DcmQuantFloydSteinbergScale; + thisberr[col ] += ( err * 7 ) / 16; + nextberr[col + 2] += ( err * 3 ) / 16; + nextberr[col + 1] += ( err * 5 ) / 16; + nextberr[col ] += ( err ) / 16; + } + } + + /** starts error diffusion for a new row. + * The error vectors for the next image row are initialized to zero. + * The initial and last column of the current row are determined + * @param col initial column for the current row returned in this parameter + * @param limitcol limit column (one past the last valid column) for the + * current row returned in this parameter. May become negative. + */ + inline void startRow(long& col, long& limitcol) + { + for (unsigned long c = 0; c < columns + 2; ++c) + nextrerr[c] = nextgerr[c] = nextberr[c] = 0; + + if (fs_direction) + { + col = 0; + limitcol = columns; + } + else + { + col = columns - 1; + limitcol = -1; + } + } + + /** finishes error diffusion for one image row. The direction flag is + * inverted and the error vectors for the "current" and "next" image row + * are swapped. + */ + inline void finishRow() + { + temperr = thisrerr; + thisrerr = nextrerr; + nextrerr = temperr; + temperr = thisgerr; + thisgerr = nextgerr; + nextgerr = temperr; + temperr = thisberr; + thisberr = nextberr; + nextberr = temperr; + fs_direction = ! fs_direction; + } + + /** increases or decreases the column number + * depending on the direction flag. + * @param col column number, may become negative + */ + inline void nextCol(long& col) const + { + if (fs_direction) ++col; else --col; + } + +private: + + /// frees all memory allocated by the error vectors + void cleanup(); + + /// private undefined copy constructor + DcmQuantFloydSteinberg(const DcmQuantFloydSteinberg& src); + + /// private undefined copy assignment operator + DcmQuantFloydSteinberg& operator=(const DcmQuantFloydSteinberg& src); + + /// current red error vector. Points to an array of (columns + 2) entries. + long *thisrerr; + + /// red error vector for next row. Points to an array of (columns + 2) entries. + long *nextrerr; + + /// current green error vector. Points to an array of (columns + 2) entries. + long *thisgerr; + + /// green error vector for next row. Points to an array of (columns + 2) entries. + long *nextgerr; + + /// current blue error vector. Points to an array of (columns + 2) entries. + long *thisberr; + + /// blue error vector for next row. Points to an array of (columns + 2) entries. + long *nextberr; + + /// temporary pointer used for swapping error vectors + long *temperr; + + /** boolean flag indicating in which direction (left to right/right to left) + * the FS distribution should be done. Flag is inverted after each row. + */ + int fs_direction; + + /// number of columns in image + unsigned long columns; + +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqthash.h b/dcmimage/include/dcmtk/dcmimage/diqthash.h new file mode 100644 index 00000000..715ee833 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqthash.h @@ -0,0 +1,129 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantColorHashTable + * + */ + + +#ifndef DIQTHASH_H +#define DIQTHASH_H + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmimage/diqtpix.h" /* for DcmQuantPixel */ +#include "dcmtk/dcmimage/diqthitl.h" /* for DcmQuantHistogramItemList */ + + +class DicomImage; + +/** this class implements a hash table for colors. + * Each entry of the hash table consists of an RGB + * color (DcmQuantPixel object) and an integer value (e. g. counter). + * This class is used during the quantization of a color image. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantColorHashTable +{ +public: + /// constructor + DcmQuantColorHashTable(); + + /// destructor + ~DcmQuantColorHashTable(); + + /** adds a new color to the hash table. The color must not yet + * be present (the caller is responsible for checking this). + * @param colorP color to be added to table + * @param value integer value (counter) associated to color + */ + inline void add(const DcmQuantPixel& colorP, int value) + { + item(colorP).push_front(colorP, value); + } + + /** looks up the given color in the hash table. + * If found, the value associated to the color is returned, -1 otherwise. + * @param colorP color to look up in hash table + * @return value associated to given color if found, -1 otherwise. + */ + inline int lookup(const DcmQuantPixel& colorP) const + { + DcmQuantHistogramItemListPointer const p(m_Table[colorP.hash()]); + return p ? p->lookup(colorP) : -1; + } + + /** adds all pixels of all frames of the given image (which must be a + * color image) to the hash table. The counter (integer value associated + * to each color) counts the occurence of the color in the image. + * If more than maxcolors colors are found, the function returns zero. + * @param image image in which colors are to be counted + * @param newmaxval maximum pixel value to which the contents of the + * image are scaled down (see documentation of class DcmQuantScaleTable) + * before counting colors. This is used by the caller to reduce the number + * of colors in the image if necessary. + * @param maxcolors maximum number of colors allowed. If more colors are found, + * the method immediately returns with a return value of zero. + * @return number of colors found, 0 if too many colors. + */ + unsigned long addToHashTable( + DicomImage& image, + unsigned long newmaxval, + unsigned long maxcolors); + + /** counts the number of entries in the hash table + * @return number of entries in hash table + */ + unsigned long countEntries() const; + + /** converts the contents of this hash table into a histogram array. + * After a successful call to addToHashTable(), this object contains + * an image histogram stored in a hash table. This method creates + * a new array of DcmQuantHistogramItem pointers on the heap + * and moves the contents of the hash table into this array. + * @param array the hash table array is returned in this parameter + * @return number of elements in array + */ + unsigned long createHistogram(DcmQuantHistogramItemPointer *& array); + +private: + + typedef OFVector table_type; + typedef table_type::iterator table_iterator; + typedef table_type::const_iterator const_table_iterator; + + /// private undefined copy constructor + DcmQuantColorHashTable(const DcmQuantColorHashTable& src); + + /// private undefined copy assignment operator + DcmQuantColorHashTable& operator=(const DcmQuantColorHashTable& src); + + /** Retrieves the specified item from the hash table. + * If the item has not been created a new item is created and is returned. + */ + DcmQuantHistogramItemList& item(const DcmQuantPixel& colorP) + { + DcmQuantHistogramItemListPointer& p(m_Table[colorP.hash()]); + return p ? *p : *(p = new DcmQuantHistogramItemList()); + } + + /// hash array of lists for color/value pairs + table_type m_Table; +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqthitl.h b/dcmimage/include/dcmtk/dcmimage/diqthitl.h new file mode 100644 index 00000000..bb161e14 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqthitl.h @@ -0,0 +1,129 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantHistogramItemList + * + */ + + +#ifndef DIQTHITL_H +#define DIQTHITL_H + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oflist.h" /* for OFList */ +#include "dcmtk/dcmimage/diqthitm.h" /* for DcmQuantHistogramItem */ + + +/** this is a helper class used by class DcmQuantColorHashTable. + * It maintains a list of DcmQuantHistogramItem objects. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantHistogramItemList +{ +public: + + /// constructor + DcmQuantHistogramItemList(); + + /// destructor. Destroys all objects pointed to by list. + ~DcmQuantHistogramItemList(); + + /** this method moves the contents of this list into the given array. + * The list becomes empty if the array is large enough to contain all list members. + * @param array array of pointers to DcmQuantHistogramItem + * @param counter When called, contains the index of the array element + * into which the first member of the list will be moved. Must be < numcolors. + * Upon return, contains the array index of the last element moved + 1. + * @param numcolors number of elements in array + */ + void moveto(DcmQuantHistogramItemPointer *array, unsigned long& counter, unsigned long numcolors); + + /** searches the list for an entry that equals the given pixel value. + * If found, the integer value assigned to that pixel is returned, otherwise returns -1. + * @param colorP pixel to lookup in list + * @return integer value for given color if found, -1 otherwise. + */ + inline int lookup(const DcmQuantPixel& colorP) + { + first = list_.begin(); + while (first != last) + { + if ((*first)->equals(colorP)) return (*first)->getValue(); + ++first; + } + return -1; + } + + /** adds the given pixel to the list. If the pixel is already + * contained in the list, it's integer value (counter) is increased + * and 0 is returned. Otherwise, a new entry with a counter of 1 + * is created and 1 is returned. + * @param colorP pixel to add to the list + * @return 0 if pixel was already in list, 1 otherwise. + */ + inline unsigned long add(const DcmQuantPixel& colorP) + { + first = list_.begin(); + while (first != last) + { + if ((*first)->equals(colorP)) + { + (*first)->incValue(); + return 0; + } + ++first; + } + + // not found in list, create new entry + list_.push_front(new DcmQuantHistogramItem(colorP, 1)); + return 1; + } + + /** inserts a new DcmQuantHistogramItem at the beginning of the list. + * @param colorP pixel value assigned to the new object in the list + * @param value integer value assigned to the new object in the list + */ + inline void push_front(const DcmQuantPixel& colorP, int value) + { + list_.push_front(new DcmQuantHistogramItem(colorP, value)); + } + + /// returns current number of objects in the list + inline size_t size() const + { + return list_.size(); + } + +private: + + /// list of (pointers to) DcmQuantHistogramItem objects + OFList list_; + + /// temporary iterator used in various methods; declared here for efficiency reasons only. + OFListIterator(DcmQuantHistogramItem *) first; + + /// constant iterator which always contains list_.end(); declared here for efficiency reasons only. + OFListIterator(DcmQuantHistogramItem *) last; + +}; + + +/// typedef for a pointer to a DcmQuantHistogramItemList object +typedef DcmQuantHistogramItemList *DcmQuantHistogramItemListPointer; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqthitm.h b/dcmimage/include/dcmtk/dcmimage/diqthitm.h new file mode 100644 index 00000000..be2b3cb0 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqthitm.h @@ -0,0 +1,109 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantHistogramItem + * + */ + + +#ifndef DIQTHITM_H +#define DIQTHITM_H + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmimage/diqtpix.h" /* for DcmQuantPixel */ + + +/** this class extends DcmQuantPixel by an integer value + * which is used for various purposes. + * The class is used as a helper class during computation of an image + * histogram, as a member of a color LUT and as a member of a color hash + * table. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantHistogramItem: public DcmQuantPixel +{ +public: + /** constructor + * @param colorP pixel value + * @param val initial value + */ + DcmQuantHistogramItem(const DcmQuantPixel& colorP, int val) + : DcmQuantPixel(colorP) + , value(val) + { + } + + /// default constructor + DcmQuantHistogramItem() + : DcmQuantPixel() + , value(0) + { + } + + // we don't declare a destructor here, but the standard destructor will do. + + /** compares the stored pixel value with the given pixel. + * @param colorP pixel to compare with + * @return true if pixel values are equal, false otherwise + */ + inline OFBool equals(const DcmQuantPixel& colorP) const + { + return *this == colorP; + } + + /// returns the integer value maintained by this object + inline int getValue() const + { + return value; + } + + /** assigns a new integer value to this object + * @param v new value + */ + inline void setValue(int v) + { + value = v; + } + + /// increases the integer value maintained by this object by one + inline void incValue() + { + ++value; + } + +private: + + /** integer value assigned to this pixel. This value is used for different + * purposes. + * During computation of a histogram it is used as a counter that counts + * the instances of the current color. + * In a color hash table, it contains the index value from the color LUT + * assigned to this color. + * In a color LUT, it is the cluster value, i.e. the radius in which all + * color are guaranteed to be mapped to this palette color. + */ + int value; + +}; + + +/// typedef for a pointer to a DcmQuantHistogramItem object +typedef DcmQuantHistogramItem *DcmQuantHistogramItemPointer; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqtid.h b/dcmimage/include/dcmtk/dcmimage/diqtid.h new file mode 100644 index 00000000..9ae02e15 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqtid.h @@ -0,0 +1,100 @@ +/* + * + * Copyright (C) 2002-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantIdent + * + */ + + +#ifndef DIQTID_H +#define DIQTID_H + + +#include "dcmtk/config/osconfig.h" + + +class DcmQuantPixel; + + +/** pseudo error diffusion class implementing an identity transformation. + * This class implements a public API mostly identical to that + * of class DcmQuantFloydSteinberg. + * Since several methods of the error diffusion class are called for each + * single image pixel during conversion of a color image to palette color, + * we do not use virtual methods and a common abstract base class here. + * Instead we implement all methods inline, and use a template to select + * the appropriate class at compile time. With a decent optimizer this + * reduces the overhead for using this class to zero. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantIdent +{ +public: + + /// constructor + DcmQuantIdent(unsigned long cols) + : columns(cols) + { + } + + /// destructor + ~DcmQuantIdent() + { + } + + /// dummy method needed for API compatibility with DcmQuantFloydSteinberg + inline void adjust(DcmQuantPixel&, long, long) + { + } + + /// dummy method needed for API compatibility with DcmQuantFloydSteinberg + inline void propagate(const DcmQuantPixel&, const DcmQuantPixel&, long) + { + } + + /** starts a new row. The initial and last column of the current row are determined. + * @param col initial column for the current row returned in this parameter + * @param limitcol limit column (one past the last valid column) for the + * current row returned in this parameter. + */ + inline void startRow(long& col, long& limitcol) + { + col = 0; + limitcol = columns; + } + + /// dummy method needed for API compatibility with DcmQuantFloydSteinberg + inline void finishRow() + { + } + + /** increases the column number + * @param col column number + */ + inline void nextCol(long& col) const + { + ++col; + } + +private: + + /// number of columns in image + unsigned long columns; + +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqtpbox.h b/dcmimage/include/dcmtk/dcmimage/diqtpbox.h new file mode 100644 index 00000000..97498766 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqtpbox.h @@ -0,0 +1,116 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantPixelBoxArray + * + */ + + +#ifndef DIQTPBOX_H +#define DIQTPBOX_H + + +#include "dcmtk/config/osconfig.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CASSERT +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmimage/dicdefin.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_TYPES_H +/* needed e.g. on Solaris for definition of size_t */ +#include +#endif +END_EXTERN_C + +/** helper structure for class DcmQuantPixelBoxArray. + * Each object of this class represents a pixel box used in the + * Median Cut algorithm. + */ +struct DCMTK_DCMIMAGE_EXPORT DcmQuantPixelBox +{ + /// index of the color histogram array where the colors represented by this box start + int ind; + + /// the number of colors represented by this box + int colors; + + /// the number of pixels represented by this box + unsigned long sum; +}; + + +/// typedef for a pointer to a DcmQuantPixelBox object +typedef DcmQuantPixelBox *DcmQuantPixelBoxPointer; + + +/** helper class for the Median Cut algorithm. An object of + * this class maintains an array of pixel boxes which is used + * to determine a color look-up table of given size for a + * true color image. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantPixelBoxArray +{ +public: + + /** constructor. Creates an array with the given number of pixel boxes. + * @param entries number of entries in array, must be > 0. + */ + DcmQuantPixelBoxArray(unsigned long entries); + + /// destructor + ~DcmQuantPixelBoxArray(); + + /** looks up an array element + * @param idx index, must be smaller than the number of entries + * with which this object was initialized + * @return non-const reference to DcmQuantPixelBox struct + */ + inline DcmQuantPixelBox& operator[](size_t idx) + { +#ifdef DEBUG + assert(idx < length); +#endif + return *(array[idx]); + } + + /** sorts the given number of pixel boxes in the array, + * starting with the first array element. + * The boxes are sorted in decreasing order of the "sum" member. + * @param boxes number of boxes to sort, must be <= entries. + */ + void sort(unsigned long boxes); + +private: + + /// private undefined copy constructor + DcmQuantPixelBoxArray(const DcmQuantPixelBoxArray& src); + + /// private undefined copy assignment operator + DcmQuantPixelBoxArray& operator=(const DcmQuantPixelBoxArray& src); + + /// array of pixel boxes + DcmQuantPixelBoxPointer *array; + + /// number of elements in array + unsigned long length; +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqtpix.h b/dcmimage/include/dcmtk/dcmimage/diqtpix.h new file mode 100644 index 00000000..87ff6d52 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqtpix.h @@ -0,0 +1,165 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantPixel + * + */ + + +#ifndef DIQTPIX_H +#define DIQTPIX_H + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmimage/diqttype.h" /* for DcmQuantHashSize, DcmQuantComponent */ +#include "dcmtk/dcmimage/diqtstab.h" /* for DcmScaleTable */ + + +/** objects of this class represent individual RGB pixels. This class is + * used by the color quantization classes. For efficiency considerations, + * all methods are declared inline. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantPixel +{ +public: + + /** default constructor, creates black pixel + */ + DcmQuantPixel() + : red(0) + , green(0) + , blue(0) + { + } + + /** copy assignment constructor + */ + DcmQuantPixel(const DcmQuantPixel& arg) + : red(arg.red) + , green(arg.green) + , blue(arg.blue) + { + } + + /** destructor + */ + virtual ~DcmQuantPixel() + { + } + + // we don't declare a destructor here, but the standard destructor will do. + + /// comparison operator for equality + inline OFBool operator==(const DcmQuantPixel& src) const + { + return (red == src.red) && (green == src.green) && (blue == src.blue); + } + + /** this method computes the luminance of the current pixel + * according to the NTSC formula. The range of the luminance equals the + * range of the underlying DcmQuantComponent type. However, the + * luminance is returned as a double. + * @return luminance of this pixel + */ + inline double luminance() const + { + return 0.299 * red + 0.587 * green + 0.114 * blue; + } + + /** this method computes an unsigned long hash value for the current pixel. + * The hash algorithm is taken from Jef Poskanzer's ppm utility library. + * The return value is guaranteed to be < DcmQuantHashSize. + * @return hash value for current pixel + */ + inline unsigned long hash() const + { + return ((OFstatic_cast(unsigned long, red) * 33023UL + OFstatic_cast(unsigned long, green) * 30013UL + + OFstatic_cast(unsigned long, blue) * 27011UL) & 0x7fffffffUL) % DcmQuantHashSize; + } + + /** returns the red component + * @return red component of this pixel + */ + inline DcmQuantComponent getRed() const + { + return red; + } + + /** returns the green component + * @return green component of this pixel + */ + inline DcmQuantComponent getGreen() const + { + return green; + } + + /** returns the blue component + * @return blue component of this pixel + */ + inline DcmQuantComponent getBlue() const + { + return blue; + } + + /** assigns new R, G and B values to this pixel + * @param r new R + * @param g new G + * @param b new B + */ + inline void assign( + DcmQuantComponent r, + DcmQuantComponent g, + DcmQuantComponent b) + { + red = r; + green = g; + blue = b; + } + + /** assigns new R, G and B values to this pixel + * using the given scale table in which all + * three values are looked up. + * @param r new R + * @param g new G + * @param b new B + * @param table scale table (LUT) in which R, G and B are looked up. + */ + inline void scale( + DcmQuantComponent r, + DcmQuantComponent g, + DcmQuantComponent b, + const DcmQuantScaleTable& table) + { + red = table[r]; + green = table[g]; + blue = table[b]; + } + +private: + /// red color component of this pixel + DcmQuantComponent red; + + /// green color component of this pixel + DcmQuantComponent green; + + /// blue color component of this pixel + DcmQuantComponent blue; +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqtstab.h b/dcmimage/include/dcmtk/dcmimage/diqtstab.h new file mode 100644 index 00000000..aab01920 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqtstab.h @@ -0,0 +1,115 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantScaleTable + * + */ + + +#ifndef DIQTSTAB_H +#define DIQTSTAB_H + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/dcmimage/diqttype.h" /* for DcmQuantComponent */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CASSERT +#include "dcmtk/ofstd/ofstdinc.h" + + +/** this is a helper class used for temporarily reducing the image bit depth + * during calculation of an image histogram. An object of this class + * contains a look-up table that maps image pixel values to scaled-down + * image pixel values. + */ +class DCMTK_DCMIMAGE_EXPORT DcmQuantScaleTable +{ +public: + + /// constructor + DcmQuantScaleTable() + : table(NULL) + , numEntries(0) + { + } + + /// destructor + ~DcmQuantScaleTable() + { + cleanup(); + } + + /** array look-up operation. + * @param idx pixel value to look up. Object must be initialized + * (i.e. createTable() must have been called before) and idx must + * be less or equal to the parameter oldmaxval passed to createTable(). + * @return scaled-down value from look-up table. + */ + inline DcmQuantComponent operator[](unsigned int idx) const + { +#ifdef DEBUG + assert(idx < numEntries); +#endif + return table[idx]; + } + + /** initializes the look-up table. + * @param oldmaxval maximum possible pixel value in source image + * @param newmaxval new desired maximum value, should be < oldmaxval + */ + void createTable( + unsigned long oldmaxval, + unsigned long newmaxval) + { + cleanup(); + + table = new DcmQuantComponent[oldmaxval+1]; + if (table) + { + numEntries = OFstatic_cast(unsigned int, oldmaxval) + 1; + for (unsigned int i=0; i < numEntries; i++) + table[i] = OFstatic_cast(DcmQuantComponent, (OFstatic_cast(unsigned long, i) * newmaxval + oldmaxval/2) / oldmaxval); + } + } + +private: + + /// resets the object to the default-constructed state + inline void cleanup() + { + delete[] table; + table = NULL; + numEntries = 0; + } + + /// private undefined copy constructor + DcmQuantScaleTable(const DcmQuantScaleTable& src); + + /// private undefined copy assignment operator + DcmQuantScaleTable& operator=(const DcmQuantScaleTable& src); + + /// array of pixel values + DcmQuantComponent *table; + + /// number of entries in array + unsigned int numEntries; +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diqttype.h b/dcmimage/include/dcmtk/dcmimage/diqttype.h new file mode 100644 index 00000000..a3299316 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diqttype.h @@ -0,0 +1,81 @@ +/* + * + * Copyright (C) 2002-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: typedefs and constants for the color quantization classes + * + */ + + +#ifndef DIQTTYPE_H +#define DIQTTYPE_H + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicdefin.h" + +/// the basic type for pixel color components +typedef unsigned char DcmQuantComponent; + +/// size of color hash table. Don't touch this. +#define DcmQuantHashSize 20023UL + +/** maximum number of colors we count in a color histogram. + * If the number of colors turns out to be larger than this, + * then the image bit depth is reduced until the number + * of colors becomes smaller than this maximum. + */ +#define DcmQuantMaxColors 65536 + + +// include this file in doxygen documentation + +/** @file diqttype.h + * @brief type definitions and constants for the color quantization classes + */ + + +/** defines the algorithm used for determining the + * largest dimension in the Median Cut algorithm + */ +enum DcmLargestDimensionType +{ + /// determine dimension by comparing the range in RGB space (default) + DcmLargestDimensionType_default, + + /// determine dimension by transforming into luminance before comparison + DcmLargestDimensionType_luminance +}; + + +/** defines the algorithm for choosing a representative color for each + * box in the Median Cut algorithm + */ +enum DcmRepresentativeColorType +{ + /// average all the colors in the box (as specified in Heckbert's paper; this is the default) + DcmRepresentativeColorType_default, + + /// average all pixels in the box + DcmRepresentativeColorType_averagePixels, + + /// choose center of the box, ignoring any structure within the boxes + DcmRepresentativeColorType_centerOfBox + +}; + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diquant.h b/dcmimage/include/dcmtk/dcmimage/diquant.h new file mode 100644 index 00000000..23993f02 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diquant.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 2002-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantFloydSteinberg + * + */ + + +#ifndef DIQUANT_H +#define DIQUANT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcond.h" /* for OFCondition */ +#include "dcmtk/dcmdata/dctypes.h" /* for Uint32 etc. */ +#include "dcmtk/dcmimage/diqttype.h" /* for enums */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ + + +class DicomImage; +class DcmItem; +class DcmTagKey; + + +class DCMTK_DCMIMAGE_EXPORT DcmQuant +{ +public: + + /** converts the given color image into a palette color image. + * All frames of the image are converted. The converted result + * is written as a complete Image Pixel module to the given + * target item. + * @param sourceImage DICOM color image + * @param target target item to which the palette color image is written + * @param writeAsOW if true, the LUT Data attributes are encoded as OW instead + * US. LUT Data is always written as OW if numberOfColors is 65536. + * @param write16BitEntries if true, LUT data is encoded with 16 bits per entry + * @param floydSteinberg determines whether or not to use Floyd-Steinberg + * error diffusion during creation of the palette color image + * @param numberOfColors desired number of colors in the color palette. + * Valid range is [2..65536]. + * @param description description string suitable for use as + * Derivation Description returned in this parameter + * @param largeType algorithm used for determining the largest dimension + * in the Median Cut algorithm + * @param repType algorithm for choosing a representative color for each + * box in the Median Cut algorithm + * @return EC_Normal if successful, an error code otherwise. + */ + static OFCondition createPaletteColorImage( + DicomImage& sourceImage, + DcmItem& target, + OFBool writeAsOW, + OFBool write16BitEntries, + OFBool floydSteinberg, + Uint32 numberOfColors, + OFString& description, + DcmLargestDimensionType largeType = DcmLargestDimensionType_default, + DcmRepresentativeColorType repType = DcmRepresentativeColorType_default); + + /** create Derivation Description. If a derivation description + * already exists, the old text is appended to the new text. + * @param dataset dataset to be modified + * @param description description string. + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition updateDerivationDescription(DcmItem *dataset, const char *description); + +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diregist.h b/dcmimage/include/dcmtk/dcmimage/diregist.h new file mode 100644 index 00000000..098025ae --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diregist.h @@ -0,0 +1,88 @@ +/* + * + * Copyright (C) 1998-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomRegister (Header) + * + */ + + +#ifndef DIREGIST_H +#define DIREGIST_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diregbas.h" + +#include "dcmtk/dcmimage/dicdefin.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to register color support to dcmimgle library + */ +class DCMTK_DCMIMAGE_EXPORT DiRegister + : public DiRegisterBase +{ + + public: + + /** constructor + */ + DiRegister(); + + /** destructor + */ + virtual ~DiRegister(); + + /** create color image representation + * + ** @param docu pointer to dataset (encapsulated) + * @param status image status + * @param photo photometric interpretation + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiImage *createImage(const DiDocument *docu, + const EI_Status status, + const EP_Interpretation photo); + + /** create monochrome pixel data from color image + * + ** @param image pointer to color image + * @param red coefficient by which the red component is weighted + * @param green coefficient by which the green component is weighted + * @param blue coefficient by which the blue component is weighted + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiMonoPixel *createMonoImageData(const DiColorImage *image, + const double red, + const double green, + const double blue); +}; + + +/*------------------* + * initialization * + *------------------*/ + +static DiRegister Init_dcmimage_Module; // registration pointer is initialized in class constructor + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dirgbimg.h b/dcmimage/include/dcmtk/dcmimage/dirgbimg.h new file mode 100644 index 00000000..02322d4f --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dirgbimg.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomRGBImage (Header) + * + */ + + +#ifndef DIRGBIMG_H +#define DIRGBIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for RGB images + */ +class DCMTK_DCMIMAGE_EXPORT DiRGBImage + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiRGBImage(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiRGBImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/dirgbpxt.h b/dcmimage/include/dcmtk/dcmimage/dirgbpxt.h new file mode 100644 index 00000000..6d4f5721 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/dirgbpxt.h @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomRGBPixelTemplate (Header) + * + */ + + +#ifndef DIRGBPXT_H +#define DIRGBPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle RGB pixel data + */ +template +class DiRGBPixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param status reference to status variable + * @param planeSize number of pixel in a single plane + * @param bits number of bits per sample + */ + DiRGBPixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + EI_Status &status, + const unsigned long planeSize, + const int bits) + : DiColorPixelTemplate(docu, pixel, 3, status) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), planeSize, bits); + } + + /** destructor + */ + virtual ~DiRGBPixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + */ + void convert(const T1 *pixel, + const unsigned long planeSize, + const int bits) + { + if (this->Init(pixel)) + { + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1)); + const T1 *p = pixel; + if (this->PlanarConfiguration) + { +/* + T2 *q; + // number of pixels to be skipped (only applicable if 'PixelData' contains more + // pixels than expected) + const unsigned long skip = (this->InputCount > this->Count) ? (this->InputCount - this->Count) : 0; + for (int j = 0; j < 3; ++j) + { + q = this->Data[j]; + for (i = count; i != 0; --i) + *(q++) = removeSign(*(p++), offset); + // skip to beginning of next plane + p += skip; + } +*/ + unsigned long l; + unsigned long i = 0; + while (i < count) + { + /* store current pixel index */ + const unsigned long iStart = i; + /* for all planes ... */ + for (int j = 0; j < 3; ++j) + { + /* convert a single plane */ + for (l = planeSize, i = iStart; (l != 0) && (i < count); --l, ++i) + this->Data[j][i] = removeSign(*(p++), offset); + } + } + } + else + { + int j; + unsigned long i; + for (i = 0; i < count; ++i) /* for all pixel ... */ + for (j = 0; j < 3; ++j) + this->Data[j][i] = removeSign(*(p++), offset); /* ... copy planes */ + } + } + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diybrimg.h b/dcmimage/include/dcmtk/dcmimage/diybrimg.h new file mode 100644 index 00000000..3c348c80 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diybrimg.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1998-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBRImage (Header) + * + */ + + +#ifndef DIYBRIMG_H +#define DIYBRIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for YCbCr images + */ +class DCMTK_DCMIMAGE_EXPORT DiYBRImage + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiYBRImage(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiYBRImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diybrpxt.h b/dcmimage/include/dcmtk/dcmimage/diybrpxt.h new file mode 100644 index 00000000..79bbb149 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diybrpxt.h @@ -0,0 +1,284 @@ +/* + * + * Copyright (C) 1998-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBRPixelTemplate (Header) + * + */ + + +#ifndef DIYBRPXT_H +#define DIYBRPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle YCbCr pixel data + */ +template +class DiYBRPixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param status reference to status variable + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + * @param rgb flag, convert color model to RGB only if true + */ + DiYBRPixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + EI_Status &status, + const unsigned long planeSize, + const int bits, + const OFBool rgb) + : DiColorPixelTemplate(docu, pixel, 3, status) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), planeSize, bits, rgb); + } + + /** destructor + */ + virtual ~DiYBRPixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param planeSize number of pixels in a plane + * @param bits number of bits per sample + * @param rgb flag, convert color model to RGB only if true + */ + void convert(const T1 *pixel, + const unsigned long planeSize, + const int bits, + const OFBool rgb) + { + if (this->Init(pixel)) + { + const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1)); + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + if (rgb) /* convert to RGB model */ + { + T2 *r = this->Data[0]; + T2 *g = this->Data[1]; + T2 *b = this->Data[2]; + const T2 maxvalue = OFstatic_cast(T2, DicomImageClass::maxval(bits)); + DiPixelRepresentationTemplate rep; + if (bits == 8 && !rep.isSigned()) // only for unsigned 8 bit + { + Sint16 rcr_tab[256]; + Sint16 gcb_tab[256]; + Sint16 gcr_tab[256]; + Sint16 bcb_tab[256]; + const double r_const = 0.7010 * OFstatic_cast(double, maxvalue); + const double g_const = 0.5291 * OFstatic_cast(double, maxvalue); + const double b_const = 0.8859 * OFstatic_cast(double, maxvalue); + unsigned long l; + for (l = 0; l < 256; ++l) + { + rcr_tab[l] = OFstatic_cast(Sint16, 1.4020 * OFstatic_cast(double, l) - r_const); + gcb_tab[l] = OFstatic_cast(Sint16, 0.3441 * OFstatic_cast(double, l)); + gcr_tab[l] = OFstatic_cast(Sint16, 0.7141 * OFstatic_cast(double, l) - g_const); + bcb_tab[l] = OFstatic_cast(Sint16, 1.7720 * OFstatic_cast(double, l) - b_const); + } + Sint32 sr; + Sint32 sg; + Sint32 sb; + if (this->PlanarConfiguration) + { +/* + const T1 *y = pixel; + const T1 *cb = y + this->InputCount; + const T1 *cr = cb + this->InputCount; + for (i = count; i != 0; --i, ++y, ++cb, ++cr) + { + sr = OFstatic_cast(Sint32, *y) + OFstatic_cast(Sint32, rcr_tab[*cr]); + sg = OFstatic_cast(Sint32, *y) - OFstatic_cast(Sint32, gcb_tab[*cb]) - OFstatic_cast(Sint32, gcr_tab[*cr]); + sb = OFstatic_cast(Sint32, *y) + OFstatic_cast(Sint32, bcb_tab[*cb]); + *(r++) = (sr < 0) ? 0 : (sr > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sr); + *(g++) = (sg < 0) ? 0 : (sg > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sg); + *(b++) = (sb < 0) ? 0 : (sb > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sb); + } +*/ + const T1 *y = pixel; + const T1 *cb = y + planeSize; + const T1 *cr = cb + planeSize; + unsigned long i = count; + while (i != 0) + { + /* convert a single frame */ + for (l = planeSize; (l != 0) && (i != 0); --l, --i, ++y, ++cb, ++cr) + { + sr = OFstatic_cast(Sint32, *y) + OFstatic_cast(Sint32, rcr_tab[OFstatic_cast(Uint32, *cr)]); + sg = OFstatic_cast(Sint32, *y) - OFstatic_cast(Sint32, gcb_tab[OFstatic_cast(Uint32, *cb)]) - OFstatic_cast(Sint32, gcr_tab[OFstatic_cast(Uint32, *cr)]); + sb = OFstatic_cast(Sint32, *y) + OFstatic_cast(Sint32, bcb_tab[OFstatic_cast(Uint32, *cb)]); + *(r++) = (sr < 0) ? 0 : (sr > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sr); + *(g++) = (sg < 0) ? 0 : (sg > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sg); + *(b++) = (sb < 0) ? 0 : (sb > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sb); + } + /* jump to next frame start (skip 2 planes) */ + y += 2 * planeSize; + cb += 2 * planeSize; + cr += 2 * planeSize; + } + } + else + { + const T1 *p = pixel; + T1 y; + T1 cb; + T1 cr; + unsigned long i; + for (i = count; i != 0; --i) + { + y = *(p++); + cb = *(p++); + cr = *(p++); + sr = OFstatic_cast(Sint32, y) + OFstatic_cast(Sint32, rcr_tab[OFstatic_cast(Uint32, cr)]); + sg = OFstatic_cast(Sint32, y) - OFstatic_cast(Sint32, gcb_tab[OFstatic_cast(Uint32, cb)]) - OFstatic_cast(Sint32, gcr_tab[OFstatic_cast(Uint32, cr)]); + sb = OFstatic_cast(Sint32, y) + OFstatic_cast(Sint32, bcb_tab[OFstatic_cast(Uint32, cb)]); + *(r++) = (sr < 0) ? 0 : (sr > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sr); + *(g++) = (sg < 0) ? 0 : (sg > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sg); + *(b++) = (sb < 0) ? 0 : (sb > OFstatic_cast(Sint32, maxvalue)) ? maxvalue : OFstatic_cast(T2, sb); + } + } + } + else + { + if (this->PlanarConfiguration) + { +/* + const T1 *y = pixel; + const T1 *cb = y + this->InputCount; + const T1 *cr = cb + this->InputCount; + for (i = count; i != 0; --i) + convertValue(*(r++), *(g++), *(b++), removeSign(*(y++), offset), removeSign(*(cb++), offset), + removeSign(*(cr++), offset), maxvalue); +*/ + unsigned long l; + unsigned long i = count; + const T1 *y = pixel; + const T1 *cb = y + planeSize; + const T1 *cr = cb + planeSize; + while (i != 0) + { + /* convert a single frame */ + for (l = planeSize; (l != 0) && (i != 0); --l, --i) + { + convertValue(*(r++), *(g++), *(b++), removeSign(*(y++), offset), removeSign(*(cb++), offset), + removeSign(*(cr++), offset), maxvalue); + } + /* jump to next frame start (skip 2 planes) */ + y += 2 * planeSize; + cb += 2 * planeSize; + cr += 2 * planeSize; + } + } + else + { + const T1 *p = pixel; + T2 y; + T2 cb; + T2 cr; + unsigned long i; + for (i = count; i != 0; --i) + { + y = removeSign(*(p++), offset); + cb = removeSign(*(p++), offset); + cr = removeSign(*(p++), offset); + convertValue(*(r++), *(g++), *(b++), y, cb, cr, maxvalue); + } + } + } + } else { /* retain YCbCr model */ + const T1 *p = pixel; + if (this->PlanarConfiguration) + { +/* + T2 *q; + // number of pixels to be skipped (only applicable if 'PixelData' contains more + // pixels than expected) + const unsigned long skip = (this->InputCount > this->Count) ? (this->InputCount - this->Count) : 0; + for (int j = 0; j < 3; ++j) + { + q = this->Data[j]; + for (i = count; i != 0; --i) + *(q++) = removeSign(*(p++), offset); + // skip to beginning of next plane + p += skip; + } +*/ + unsigned long l; + unsigned long i = 0; + while (i < count) + { + /* store current pixel index */ + const unsigned long iStart = i; + for (int j = 0; j < 3; ++j) + { + /* convert a single plane */ + for (l = planeSize, i = iStart; (l != 0) && (i < count); --l, ++i) + this->Data[j][i] = removeSign(*(p++), offset); + } + } + } + else + { + int j; + unsigned long i; + for (i = 0; i < count; ++i) /* for all pixel ... */ + for (j = 0; j < 3; ++j) + this->Data[j][i] = removeSign(*(p++), offset); /* ... copy planes */ + } + } + } + } + + /** convert a single YCbCr value to RGB + */ + inline void convertValue(T2 &red, T2 &green, T2 &blue, const T2 y, const T2 cb, const T2 cr, const T2 maxvalue) + { + double dr = OFstatic_cast(double, y) + 1.4020 * OFstatic_cast(double, cr) - 0.7010 * OFstatic_cast(double, maxvalue); + double dg = OFstatic_cast(double, y) - 0.3441 * OFstatic_cast(double, cb) - 0.7141 * OFstatic_cast(double, cr) + 0.5291 * OFstatic_cast(double, maxvalue); + double db = OFstatic_cast(double, y) + 1.7720 * OFstatic_cast(double, cb) - 0.8859 * OFstatic_cast(double, maxvalue); + red = (dr < 0.0) ? 0 : (dr > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, dr); + green = (dg < 0.0) ? 0 : (dg > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, dg); + blue = (db < 0.0) ? 0 : (db > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, db); + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diyf2img.h b/dcmimage/include/dcmtk/dcmimage/diyf2img.h new file mode 100644 index 00000000..7068bbf6 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diyf2img.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBR422Image (Header) + * + */ + + +#ifndef DIYF2IMG_H +#define DIYF2IMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for YCbCr Full 4:2:2 images + */ +class DCMTK_DCMIMAGE_EXPORT DiYBR422Image + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiYBR422Image(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiYBR422Image(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diyf2pxt.h b/dcmimage/include/dcmtk/dcmimage/diyf2pxt.h new file mode 100644 index 00000000..563d1837 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diyf2pxt.h @@ -0,0 +1,156 @@ +/* + * + * Copyright (C) 1998-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBR422PixelTemplate (Header) + * + */ + + +#ifndef DIYF2PXT_H +#define DIYF2PXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle YCbCr Full 4:2:2 pixel data + */ +template +class DiYBR422PixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param status reference to status variable + * @param bits number of bits per sample + * @param rgb flag, convert color model to RGB only if true + */ + DiYBR422PixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + EI_Status &status, + const int bits, + const OFBool rgb) + : DiColorPixelTemplate(docu, pixel, 3, status, 2) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + { + if (this->PlanarConfiguration) + { + status = EIS_InvalidValue; + DCMIMAGE_ERROR("invalid value for 'PlanarConfiguration' (" << this->PlanarConfiguration << ")"); + } + else + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), bits, rgb); + } + } + + /** destructor + */ + virtual ~DiYBR422PixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param bits number of bits per sample + * @param rgb flag, convert color model to RGB only if true + */ + void convert(const T1 *pixel, + const int bits, + const OFBool rgb) + { + if (this->Init(pixel)) + { + const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1)); + unsigned long i; + const T1 *p = pixel; + T2 *r = this->Data[0]; + T2 *g = this->Data[1]; + T2 *b = this->Data[2]; + T2 y1; + T2 y2; + T2 cb; + T2 cr; + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + if (rgb) /* convert to RGB model */ + { + const T2 maxvalue = OFstatic_cast(T2, DicomImageClass::maxval(bits)); + for (i = count / 2; i != 0; --i) + { + y1 = removeSign(*(p++), offset); + y2 = removeSign(*(p++), offset); + cb = removeSign(*(p++), offset); + cr = removeSign(*(p++), offset); + convertValue(*(r++), *(g++), *(b++), y1, cb, cr, maxvalue); + convertValue(*(r++), *(g++), *(b++), y2, cb, cr, maxvalue); + } + } else { /* retain YCbCr model: YCbCr_422_full -> YCbCr_full */ + for (i = count / 2; i != 0; --i) + { + y1 = removeSign(*(p++), offset); + y2 = removeSign(*(p++), offset); + cb = removeSign(*(p++), offset); + cr = removeSign(*(p++), offset); + *(r++) = y1; + *(g++) = cb; + *(b++) = cr; + *(r++) = y2; + *(g++) = cb; + *(b++) = cr; + } + } + } + } + + /** convert a single YCbCr value to RGB + */ + inline void convertValue(T2 &red, + T2 &green, + T2 &blue, + const T2 y, + const T2 cb, + const T2 cr, + const T2 maxvalue) + { + double dr = OFstatic_cast(double, y) + 1.4020 * OFstatic_cast(double, cr) - 0.7010 * OFstatic_cast(double, maxvalue); + double dg = OFstatic_cast(double, y) - 0.3441 * OFstatic_cast(double, cb) - 0.7141 * OFstatic_cast(double, cr) + 0.5291 * OFstatic_cast(double, maxvalue); + double db = OFstatic_cast(double, y) + 1.7720 * OFstatic_cast(double, cb) - 0.8859 * OFstatic_cast(double, maxvalue); + red = (dr < 0.0) ? 0 : (dr > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, dr); + green = (dg < 0.0) ? 0 : (dg > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, dg); + blue = (db < 0.0) ? 0 : (db > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, db); + } +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diyp2img.h b/dcmimage/include/dcmtk/dcmimage/diyp2img.h new file mode 100644 index 00000000..a3819739 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diyp2img.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1998-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBRPart422Image (Header) + * + */ + + +#ifndef DIYP2IMG_H +#define DIYP2IMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for YCbCr Partial 4:2:2 images + */ +class DCMTK_DCMIMAGE_EXPORT DiYBRPart422Image + : public DiColorImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiYBRPart422Image(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiYBRPart422Image(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + + protected: + + /** initialize internal data structures and member variables + */ + void Init(); +}; + + +#endif diff --git a/dcmimage/include/dcmtk/dcmimage/diyp2pxt.h b/dcmimage/include/dcmtk/dcmimage/diyp2pxt.h new file mode 100644 index 00000000..395f2d77 --- /dev/null +++ b/dcmimage/include/dcmtk/dcmimage/diyp2pxt.h @@ -0,0 +1,136 @@ +/* + * + * Copyright (C) 1998-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBRPart422PixelTemplate (Header) + * + */ + + +#ifndef DIYP2PXT_H +#define DIYP2PXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimgle/diinpx.h" /* gcc 3.4 needs this */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle YCbCr Partial 4:2:2 pixel data + */ +template +class DiYBRPart422PixelTemplate + : public DiColorPixelTemplate +{ + + public: + + /** constructor + * + ** @param docu pointer to DICOM document + * @param pixel pointer to input pixel representation + * @param status reference to status variable + * @param bits number of bits per sample + */ + DiYBRPart422PixelTemplate(const DiDocument *docu, + const DiInputPixel *pixel, + EI_Status &status, + const int bits) + : DiColorPixelTemplate(docu, pixel, 3, status, 2) + { + if ((pixel != NULL) && (this->Count > 0) && (status == EIS_Normal)) + { + if (this->PlanarConfiguration) + { + status = EIS_InvalidValue; + DCMIMAGE_ERROR("invalid value for 'PlanarConfiguration' (" << this->PlanarConfiguration << ")"); + } + else + convert(OFstatic_cast(const T1 *, pixel->getData()) + pixel->getPixelStart(), bits); + } + } + + /** destructor + */ + virtual ~DiYBRPart422PixelTemplate() + { + } + + + private: + + /** convert input pixel data to intermediate representation + * + ** @param pixel pointer to input pixel data + * @param bits number of bits per sample + */ + void convert(const T1 *pixel, + const int bits) + { + if (this->Init(pixel)) + { + T2 *r = this->Data[0]; + T2 *g = this->Data[1]; + T2 *b = this->Data[2]; + unsigned long i; + const T2 maxvalue = OFstatic_cast(T2, DicomImageClass::maxval(bits)); + const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1)); + // use the number of input pixels derived from the length of the 'PixelData' + // attribute), but not more than the size of the intermediate buffer + const unsigned long count = (this->InputCount < this->Count) ? this->InputCount : this->Count; + + const T1 *p = pixel; + T2 y1; + T2 y2; + T2 cb; + T2 cr; + for (i = count / 2; i != 0; --i) + { + y1 = removeSign(*(p++), offset); + y2 = removeSign(*(p++), offset); + cb = removeSign(*(p++), offset); + cr = removeSign(*(p++), offset); + convertValue(*(r++), *(g++), *(b++), y1, cb, cr, maxvalue); + convertValue(*(r++), *(g++), *(b++), y2, cb, cr, maxvalue); + } + } + } + + /** convert a single YCbCr value to RGB + */ + inline void convertValue(T2 &red, + T2 &green, + T2 &blue, + const T2 y, + const T2 cb, + const T2 cr, + const T2 maxvalue) + { + double dr = 1.1631 * OFstatic_cast(double, y) + 1.5969 * OFstatic_cast(double, cr) - 0.8713 * OFstatic_cast(double, maxvalue); + double dg = 1.1631 * OFstatic_cast(double, y) - 0.3913 * OFstatic_cast(double, cb) - 0.8121 * OFstatic_cast(double, cr) + 0.5290 * OFstatic_cast(double, maxvalue); + double db = 1.1631 * OFstatic_cast(double, y) + 2.0177 * OFstatic_cast(double, cb) - 1.0820 * OFstatic_cast(double, maxvalue); + red = (dr < 0.0) ? 0 : (dr > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, dr); + green = (dg < 0.0) ? 0 : (dg > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, dg); + blue = (db < 0.0) ? 0 : (db > OFstatic_cast(double, maxvalue)) ? maxvalue : OFstatic_cast(T2, db); + } +}; + + +#endif diff --git a/dcmimage/libsrc/CMakeLists.txt b/dcmimage/libsrc/CMakeLists.txt new file mode 100644 index 00000000..b3a57133 --- /dev/null +++ b/dcmimage/libsrc/CMakeLists.txt @@ -0,0 +1,5 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmimage diargimg dicmyimg dicoimg dicoopx dicopx dihsvimg dilogger dipalimg dipipng dipitiff diqtctab diqtfs diqthash diqthitl diqtpbox diquant diregist dirgbimg diybrimg diyf2img diyp2img dcmicmph) + +DCMTK_TARGET_LINK_MODULES(dcmimage oflog dcmdata dcmimgle) +DCMTK_TARGET_LINK_LIBRARIES(dcmimage ${LIBTIFF_LIBS} ${LIBPNG_LIBS}) diff --git a/dcmimage/libsrc/Makefile.dep b/dcmimage/libsrc/Makefile.dep new file mode 100644 index 00000000..b8334ccf --- /dev/null +++ b/dcmimage/libsrc/Makefile.dep @@ -0,0 +1,1470 @@ +dcmicmph.o: dcmicmph.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/dcmicmph.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h +diargimg.o: diargimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmimage/diargimg.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/diargpxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h \ + ../include/dcmtk/dcmimage/diqttype.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h +dicmyimg.o: dicmyimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimage/dicmyimg.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/dicmypxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h +dicoimg.o: dicoimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimo2img.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../include/dcmtk/dcmimage/dicocpt.h ../include/dcmtk/dcmimage/dicosct.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/discalet.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/ditranst.h \ + ../include/dcmtk/dcmimage/dicoflt.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diflipt.h \ + ../include/dcmtk/dcmimage/dicorot.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dirotat.h \ + ../include/dcmtk/dcmimage/dicoopxt.h ../include/dcmtk/dcmimage/dicoopx.h +dicoopx.o: dicoopx.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/dicoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h +dicopx.o: dicopx.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimage/diqttype.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h +dihsvimg.o: dihsvimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimage/dihsvimg.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/dihsvpxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h +dilogger.o: dilogger.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/dilogger.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimage/dicdefin.h +dipalimg.o: dipalimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimage/dipalimg.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/dipalpxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h \ + ../include/dcmtk/dcmimage/diqttype.h +dipipng.o: dipipng.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dipipng.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +dipitiff.o: dipitiff.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dipitiff.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../include/dcmtk/dcmimage/dicdefin.h +diqtctab.o: diqtctab.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/diqtctab.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmimage/diqtpix.h ../include/dcmtk/dcmimage/diqttype.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmimage/diqtstab.h \ + ../include/dcmtk/dcmimage/diqthash.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../include/dcmtk/dcmimage/diqthitl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmimage/diqthitm.h \ + ../include/dcmtk/dcmimage/diqtpbox.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +diqtfs.o: diqtfs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/diqtfs.h ../include/dcmtk/dcmimage/diqtpix.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimage/diqttype.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmimage/diqtstab.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +diqthash.o: diqthash.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/diqthash.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimage/diqtpix.h ../include/dcmtk/dcmimage/diqttype.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmimage/diqtstab.h \ + ../include/dcmtk/dcmimage/diqthitl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmimage/diqthitm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h +diqthitl.o: diqthitl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/diqthitl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimage/diqthitm.h ../include/dcmtk/dcmimage/diqtpix.h \ + ../include/dcmtk/dcmimage/diqttype.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmimage/diqtstab.h +diqtpbox.o: diqtpbox.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../include/dcmtk/dcmimage/diqtpbox.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h +diquant.o: diquant.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/diquant.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimage/diqttype.h \ + ../include/dcmtk/dcmimage/dicdefin.h ../include/dcmtk/dcmimage/diqtid.h \ + ../include/dcmtk/dcmimage/diqtcmap.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimage/diqtstab.h ../include/dcmtk/dcmimage/diqtpix.h \ + ../include/dcmtk/dcmimage/diqthash.h \ + ../include/dcmtk/dcmimage/diqthitl.h \ + ../include/dcmtk/dcmimage/diqthitm.h \ + ../include/dcmtk/dcmimage/diqtctab.h ../include/dcmtk/dcmimage/diqtfs.h \ + ../include/dcmtk/dcmimage/dilogger.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +diregist.o: diregist.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmimage/dipalimg.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/dirgbimg.h \ + ../include/dcmtk/dcmimage/dihsvimg.h \ + ../include/dcmtk/dcmimage/diargimg.h \ + ../include/dcmtk/dcmimage/dicmyimg.h \ + ../include/dcmtk/dcmimage/diybrimg.h \ + ../include/dcmtk/dcmimage/diyf2img.h \ + ../include/dcmtk/dcmimage/diyp2img.h ../include/dcmtk/dcmimage/dicomot.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h +dirgbimg.o: dirgbimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimage/dirgbimg.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/dirgbpxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h +diybrimg.o: diybrimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimage/diybrimg.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/diybrpxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h +diyf2img.o: diyf2img.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimage/diyf2img.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/diyf2pxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h +diyp2img.o: diyp2img.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimage/diyp2img.h ../include/dcmtk/dcmimage/dicoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimage/dicopx.h ../include/dcmtk/dcmimage/dilogger.h \ + ../include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimage/diyp2pxt.h ../include/dcmtk/dcmimage/dicopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diinpx.h diff --git a/dcmimage/libsrc/Makefile.in b/dcmimage/libsrc/Makefile.in new file mode 100644 index 00000000..fbcd5622 --- /dev/null +++ b/dcmimage/libsrc/Makefile.in @@ -0,0 +1,58 @@ +# +# Makefile for dcmimage/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle + +# Special defines for the Library, define them in LOCALDEFS +# REVERSE_OVERLAY_ORIGIN_ORDER +# swap order of overlay origin coordinates +# LOCALDEFS = -DREVERSE_OVERLAY_ORIGIN_ORDER + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include -I$(dcmimgledir)/include + +objs = dicoimg.o dicopx.o dicoopx.o diregist.o dilogger.o \ + diargimg.o dicmyimg.o dihsvimg.o dipalimg.o dirgbimg.o \ + diybrimg.o diyf2img.o diyp2img.o dipitiff.o dipipng.o \ + diqtctab.o diqtfs.o diqthash.o diqthitl.o diqtpbox.o \ + diquant.o dcmicmph.o + +library = libdcmimage.$(LIBEXT) + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmimage/libsrc/dcmicmph.cc b/dcmimage/libsrc/dcmicmph.cc new file mode 100644 index 00000000..0bb682cd --- /dev/null +++ b/dcmimage/libsrc/dcmicmph.cc @@ -0,0 +1,1526 @@ +/* + * + * Copyright (C) 2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Authors: Marco Eichelberg + * + * Purpose: A helper class for comparing an original image with + * a processed version (e.g. after lossy compression) + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmimage/dcmicmph.h" /* header file for this implementation file */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/ofstd/ofcmdln.h" /* for OFCommandLine */ +#include "dcmtk/ofstd/ofstd.h" /* for OFStandard */ +#include "dcmtk/dcmdata/dctk.h" /* for various dcmdata headers */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmimgle/dcmimage.h" /* for DicomImage */ +#include "dcmtk/dcmimage/dilogger.h" /* for the logger macros */ +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +// ******************************************** + +DicomImageComparison::DicomImageComparison() +: di_reference(NULL) +, di_test(NULL) +, diff_image(NULL) +, max_error(0) +, reference_bits(0) +, test_bits(0) +, meanAbsoluteError(0.0) +, rootMeanSquareError(0.0) +, peakSignalToNoiseRatio(0.0) +, signalToNoiseRatio(0.0) +, amplification(1.0) +{ +} + + +DicomImageComparison::~DicomImageComparison() +{ + delete di_reference; + delete di_test; + delete diff_image; +} + + +OFCondition DicomImageComparison::initializeDiffImage(OFCmdFloat amplify) +{ + // This function can only be called prior to the call to readReferenceImage(). + if (di_reference) return EC_IllegalCall; + + amplification = amplify; + delete diff_image; + diff_image = new DcmFileFormat(); + return EC_Normal; +} + + +OFCondition DicomImageComparison::saveDiffImage(const char *ofname) +{ + if (ofname == NULL) return EC_IllegalCall; + if (diff_image == NULL) return EC_IllegalCall; + return diff_image->saveFile(ofname, EXS_LittleEndianExplicit); +} + + +OFCondition DicomImageComparison::readDICOMImage( + DicomImage *& di, + OFBool isReference, + const char *ifname, + E_TransferSyntax xfer, + E_FileReadMode readMode, + unsigned long compatibilityMode, + DcmItem *diffImage) +{ + + // make sure that we do not create a memory leak + compatibilityMode |= (CIF_MayDetachPixelData | CIF_TakeOverExternalDataset) ; + + // since we process all frames anyway, decompress the complete pixel data (if required) + compatibilityMode |= CIF_DecompressCompletePixelData; + + if (ifname == NULL) return EC_IllegalCall; + + DCMIMAGE_INFO("reading DICOM file: " << ifname); + + // load DICOM file as DcmFileFormat + DcmFileFormat *dfile = new DcmFileFormat(); + OFCondition cond = dfile->loadFile(ifname, xfer, EGL_withoutGL, DCM_MaxReadLength, readMode); + if (cond.bad()) + { + DCMIMAGE_ERROR(cond.text() << ": reading file: " << ifname); + delete dfile; + } else { + // determine transfer syntax + E_TransferSyntax original_xfer = dfile->getDataset()->getOriginalXfer(); + + // The DicomImage instance takes ownership of the DcmFileFormat instance. Do not delete manually. + di = new DicomImage(dfile, original_xfer, compatibilityMode); + + // check status of the DICOM image object + if (di->getStatus() == EIS_Normal) + { + logImageInfo(di, ifname); + // initialize diff image from reference and test dataset + if (diffImage) + { + if (isReference) + cond = copyReferenceImageAttributes(dfile->getDataset(), diffImage); + else cond = copyTestImageAttributes(dfile->getDataset(), diffImage); + } + } else { + // Creation of DicomImage object failed. Bail out. + const char *msg = DicomImage::getString(di->getStatus()); + DCMIMAGE_ERROR(msg); + cond = makeOFCondition(OFM_dcmimage, 129, OF_error, msg); + delete di; + di = NULL; + } + } + return cond; +} + + +OFCondition DicomImageComparison::readReferenceImage( + const char *ifname, + E_TransferSyntax xfer, + E_FileReadMode readMode, + unsigned long compatibilityMode) +{ + delete di_reference; + di_reference = NULL; + DcmItem *di = NULL; + if (diff_image) di = diff_image->getDataset(); + return readDICOMImage(di_reference, OFTrue, ifname, xfer, readMode, compatibilityMode, di); +} + + +OFCondition DicomImageComparison::readTestImage( + const char *ifname, + E_TransferSyntax xfer, + E_FileReadMode readMode, + unsigned long compatibilityMode) +{ + delete di_test; + di_test = NULL; + DcmItem *di = NULL; + if (diff_image) di = diff_image->getDataset(); + return readDICOMImage(di_test, OFFalse, ifname, xfer, readMode, compatibilityMode, di); +} + + +OFCondition DicomImageComparison::configureImage( + DicomImage *di, + EW_WindowType windowType, + OFCmdUnsignedInt windowParameter, + OFCmdFloat& windowCenter, + OFCmdFloat& windowWidth, + EF_VoiLutFunction voiFunction, + ES_PresentationLut presShape, + int& depth) +{ + /* check parameters */ + if (di == NULL) return EC_IllegalCall; + + /* hide overlays*/ + di->hideAllOverlays(); + + /* determine bit depth to request when processing the pixel data */ + depth = di->getDepth(); + if (depth > 16) depth = 16; + if (depth < 8) depth = 8; + + /* process VOI parameters */ + switch (windowType) + { + case EWT_none: /* no VOI windowing */ + if (di->isMonochrome()) + { + DCMIMAGE_DEBUG("disabling VOI window computation"); + if (!di->setNoVoiTransformation()) + DCMIMAGE_WARN("cannot ignore VOI window"); + } + break; + case EWT_window_minmax: /* compute VOI window using min-max algorithm */ + if (!di->setMinMaxWindow(0)) + DCMIMAGE_WARN("cannot compute min/max VOI window"); + if (!di->getWindow(windowCenter, windowWidth)) + DCMIMAGE_WARN("cannot retrieve VOI window"); + DCMIMAGE_DEBUG("activating min/max VOI window center=" << windowCenter << ", width=" << windowWidth); + break; + case EWT_window_minmax_n: /* compute VOI window using min-max algorithm ignoring extremes */ + if (!di->setMinMaxWindow(0)) + DCMIMAGE_WARN("cannot compute min/max VOI window"); + if (!di->getWindow(windowCenter, windowWidth)) + DCMIMAGE_WARN("cannot retrieve VOI window"); + DCMIMAGE_DEBUG("activating min/max-n VOI window center=" << windowCenter << ", width=" << windowWidth); + break; + case EWT_window_from_file: /* use the n-th VOI window from the image file */ + if ((windowParameter < 1) || (windowParameter > di->getWindowCount())) + { + DCMIMAGE_FATAL("cannot select VOI window " << windowParameter << ", only " + << di->getWindowCount() << " window(s) in file"); + return makeOFCondition(OFM_dcmimage, 130, OF_error, "cannot select VOI window"); + } + DCMIMAGE_DEBUG("activating VOI window " << windowParameter); + if (!di->setWindow(windowParameter - 1)) + DCMIMAGE_WARN("cannot select VOI window " << windowParameter); + break; + case EWT_voi_lut_from_file: /* use the n-th VOI look up table from the image file */ + if ((windowParameter < 1) || (windowParameter > di->getVoiLutCount())) + { + DCMIMAGE_FATAL("cannot select VOI LUT " << windowParameter << ", only " + << di->getVoiLutCount() << " LUT(s) in file"); + return makeOFCondition(OFM_dcmimage, 131, OF_error, "cannot select VOI LUT"); + } + DCMIMAGE_DEBUG("activating VOI LUT " << windowParameter); + if (!di->setVoiLut(windowParameter - 1, ELM_UseValue)) + DCMIMAGE_WARN("cannot select VOI LUT " << windowParameter); + break; + case EWT_window_center_width: /* Compute VOI window using center and width */ + DCMIMAGE_DEBUG("activating VOI window center=" << windowCenter << ", width=" << windowWidth); + if (!di->setWindow(windowCenter, windowWidth)) + DCMIMAGE_WARN("cannot set VOI window to specified values"); + break; + default: /* unsupported type */ + DCMIMAGE_FATAL("unsupported type of VOI LUT transformation requested."); + return makeOFCondition(OFM_dcmimage, 132, OF_error, "unsupported type of VOI LUT transformation requested"); + break; + } + + /* VOI LUT function */ + if (voiFunction != EFV_Default) + { + if (voiFunction == EFV_Linear) + DCMIMAGE_DEBUG("setting VOI LUT function to LINEAR"); + else if (voiFunction == EFV_Sigmoid) + DCMIMAGE_DEBUG("setting VOI LUT function to SIGMOID"); + if (!di->setVoiLutFunction(voiFunction)) + DCMIMAGE_WARN("cannot set VOI LUT function"); + } + + /* process presentation LUT parameters */ + if (presShape != ESP_Default) + { + if (presShape == ESP_Identity) + DCMIMAGE_DEBUG("setting presentation LUT shape to IDENTITY"); + else if (presShape == ESP_Inverse) + DCMIMAGE_DEBUG("setting presentation LUT shape to INVERSE"); + else if (presShape == ESP_LinOD) + DCMIMAGE_DEBUG("setting presentation LUT shape to LIN OD"); + if (!di->setPresentationLutShape(presShape)) + DCMIMAGE_WARN("cannot set presentation LUT shape"); + } + + return EC_Normal; +} + + +OFCondition DicomImageComparison::configureImages( + EW_WindowType windowType, + OFBool sharedWindow, + OFCmdUnsignedInt windowParameter, + OFCmdFloat windowCenter, + OFCmdFloat windowWidth, + EF_VoiLutFunction voiFunction, + ES_PresentationLut presShape) +{ + OFCondition cond = configureImage(di_reference, windowType, windowParameter, windowCenter, windowWidth, voiFunction, presShape, reference_bits); + + // When the user has requested a shared min/max window, re-use the VOI window computed for the reference image also for the test image + EW_WindowType windowTypeTestImage = windowType; + if (sharedWindow && ((windowType == EWT_window_minmax)||(windowType == EWT_window_minmax_n))) + windowTypeTestImage = EWT_window_center_width; + + if (cond.good()) cond = configureImage(di_test, windowTypeTestImage, windowParameter, windowCenter, windowWidth, voiFunction, presShape, test_bits); + + if (di_reference->isMonochrome() && (windowType != EWT_none)) + { + // If a VOI window is applied, use the maximum of the bit depths + // determined by configureImage() for both images. + if (reference_bits > test_bits) + test_bits = reference_bits; + else reference_bits = test_bits; + } + + DCMIMAGE_DEBUG("Bits/sample selected for reference image: " << reference_bits); + DCMIMAGE_DEBUG("Bits/sample selected for test image: " << test_bits); + return cond; +} + +OFCondition DicomImageComparison::checkImageCharacteristics() const +{ + //check if images have actually been loaded + if (di_reference == NULL) return EC_IllegalCall; + if (di_test == NULL) return EC_IllegalCall; + + // check resolution + if ((di_reference->getWidth() != di_test->getWidth()) || (di_reference->getHeight() != di_test->getHeight())) + { + DCMIMAGE_FATAL("Resolution mismatch: " + << di_reference->getWidth() << " x " << di_reference->getHeight() << " vs. " + << di_test->getWidth() << " x " << di_test->getHeight()); + return makeOFCondition(OFM_dcmimage, 133, OF_error, "resolution mismatch between reference and test image"); + } + + // check color model + if ((di_reference->isMonochrome() && (! di_test->isMonochrome())) || (di_test->isMonochrome() && (! di_reference->isMonochrome()))) + { + const char *colorModel1 = di_reference->getString(di_reference->getPhotometricInterpretation()); + if (colorModel1 == NULL) colorModel1 = "unknown"; + + const char *colorModel2 = di_test->getString(di_test->getPhotometricInterpretation()); + if (colorModel2 == NULL) colorModel2 = "unknown"; + + DCMIMAGE_FATAL("Color model mismatch: " + << colorModel1 << " vs. " << colorModel2); + return makeOFCondition(OFM_dcmimage, 133, OF_error, "color model mismatch between reference and test image"); + } + + // check number of frames to process + if (di_reference->getFrameCount() != di_test->getFrameCount()) + { + DCMIMAGE_FATAL("Frame count mismatch: " + << di_reference->getFrameCount() << " vs. " << di_test->getFrameCount()); + return makeOFCondition(OFM_dcmimage, 133, OF_error, "frame count mismatch between reference and test image"); + } + + return EC_Normal; +} + + +OFCondition DicomImageComparison::computeImageComparisonMetrics(EW_WindowType windowType) +{ + DCMIMAGE_DEBUG("Computing image comparison metrics"); + + // initialize comparison results + max_error = 0; + meanAbsoluteError = 0.0; + rootMeanSquareError = 0.0; + peakSignalToNoiseRatio = 0.0; + signalToNoiseRatio = 0.0; + + OFCondition cond = checkImageCharacteristics(); + if (cond.good()) + { + // we don't need to check if di_reference == NULL, + // because checkImageCharacteristics() already did that for us. + if (di_reference->isMonochrome() && ((reference_bits > 8) || (windowType == EWT_none))) + { + // monochrome image with more than 8 bits/pixel + if (diff_image) + { + // monochrome image with more than 8 bits/pixel + // write Multiframe Grayscale Word SC Image + cond = diff_image->getDataset()->putAndInsertString(DCM_SOPClassUID, UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage); + if (cond.bad()) return cond; + cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsAllocated, 16); + if (cond.bad()) return cond; + cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsStored, 16); + if (cond.bad()) return cond; + cond = diff_image->getDataset()->putAndInsertUint16(DCM_HighBit, 15); + if (cond.bad()) return cond; + } + if (windowType == EWT_none) + cond = computeMonochromeImageComparionMetricsRaw(); + else cond = computeMonochromeImageComparionMetricsWord(); + } + else + { + if (diff_image) + { + // image with 8 bits/pixel (color or monochrome) + // the difference image is always be a Multiframe Grayscale Byte SC Image + cond = diff_image->getDataset()->putAndInsertString(DCM_SOPClassUID, UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage); + if (cond.bad()) return cond; + cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsAllocated, 8); + if (cond.bad()) return cond; + cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsStored, 8); + if (cond.bad()) return cond; + cond = diff_image->getDataset()->putAndInsertUint16(DCM_HighBit, 7); + if (cond.bad()) return cond; + } + if (di_reference->isMonochrome()) + cond = computeMonochromeImageComparionMetricsByte(); + else cond = computeColorImageComparionMetrics(); + } + } + return cond; +} + + +OFCondition DicomImageComparison::computeMonochromeImageComparionMetricsWord() +{ + DCMIMAGE_DEBUG("Type of computation: monochrome, 16-bits/sample"); + + // this check should have already been performed, but just to be sure, and since it's cheap... + OFCondition cond = checkImageCharacteristics(); + if (cond.good() && di_reference->isMonochrome() && (reference_bits > 8)) + { + unsigned long numBytes = di_reference->getOutputDataSize(reference_bits); + unsigned int fcount = di_reference->getFrameCount(); + if (numBytes != di_test->getOutputDataSize(test_bits)) + { + DCMIMAGE_FATAL("Frame size mismatch: " + << numBytes << " vs. " << di_test->getOutputDataSize(test_bits) << " bytes"); + return makeOFCondition(OFM_dcmimage, 134, OF_error, "frame size mismatch"); + } + unsigned long numValues = (numBytes+1) / sizeof(Uint16); + + // prepare creation of difference image pixel data + Uint16 *dv = NULL; + double dvp; + if (diff_image) + { + // create empty pixel data element and insert into main dataset + DcmPixelData *pxd = new DcmPixelData(DCM_PixelData); + cond = diff_image->getDataset()->insert(pxd); + if (cond.bad()) return cond; + + // create pixel data buffer for all frames of the difference image + Uint32 pixelDataLen = numValues * fcount; + cond = pxd->createUint16Array(pixelDataLen, dv); + if (cond.bad()) return cond; + } + + const Uint16 *f1; + const Uint16 *f2; + + double square_error_sum = 0; // sum of squared differences between reference and test + double simple_error_sum = 0; // sum of (unsigned) differences between reference and test + double square_reference_sum = 0; // sum of squared pixel values in reference image + unsigned long square_signal_strength = 0; // maximum pixel value in reference image + max_error = 0; // maximum (unsigned) difference between reference and test pixel value + + // iterate over all frames + for (unsigned int frame = 0; frame < fcount; frame++) + { + DCMIMAGE_DEBUG("Processing frame " << frame); + const void *frame1 = di_reference->getOutputData(16, frame); + const void *frame2 = di_test->getOutputData(16, frame); + if ((frame1 == NULL) || (frame2 == NULL)) + { + DCMIMAGE_FATAL("Memory exhausted while accessing frames"); + return EC_MemoryExhausted; + } + f1 = OFreinterpret_cast(const Uint16 *, frame1); + f2 = OFreinterpret_cast(const Uint16 *, frame2); + long i1, i2; + unsigned long i3, t; + + // iterate over all samples (pixel values) of the current frame + for (unsigned long i = 0; i < numValues; ++i) + { + i1 = *f1; // pixel value in the reference image + i2 = *f2; // pixel value in the test image + i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign + if (dv) + { + dvp = amplification * i3; // compute diff image pixel value + if (dvp > 65535) + *dv++ = OFstatic_cast(Uint16, 65535); + else *dv++ = OFstatic_cast(Uint16, dvp); + + } + max_error = (i3 > max_error ? i3 : max_error); + square_error_sum += (double)(i3*i3); + simple_error_sum += i3; + t = i1 * i1; + square_reference_sum += t; + square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength; + ++f1; + ++f2; + } + } + + // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in + // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008 + + DCMIMAGE_DEBUG("square_signal_strength: " << square_signal_strength); + DCMIMAGE_DEBUG("square_error_sum: " << square_error_sum); + + // as a helper variable, divide the sum of squared errors by the total number of samples + double meanSquareError = square_error_sum / (numValues * fcount); + + // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples + meanAbsoluteError = simple_error_sum / (numValues * fcount); + + // RMSE is the square root of the mean square error + rootMeanSquareError = sqrt(meanSquareError); + + // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength + //(maximum pixel value in reference image) + peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0; + + // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values) + // divided by the noise (squared sum of all difference values) + signalToNoiseRatio = log10(square_reference_sum / square_error_sum) * 10.0; + + if (diff_image) + { + char buf[30]; + OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, di_reference->getFrameCount())); + cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf); + if (di_reference->getFrameCount() > 1) + { + DcmTagKey frameIncrementPointer(0x0018, 0x2002); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer); + OFString frameLabelVector; + createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFFalse); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector); + } + } + } + return cond; +} + +OFCondition DicomImageComparison::computeMonochromeImageComparionMetricsRaw() +{ + DCMIMAGE_DEBUG("Type of computation: monochrome, without VOI transformation"); + + // this check should have already been performed, but just to be sure, and since it's cheap... + OFCondition cond = checkImageCharacteristics(); + if (cond.good() && di_reference->isMonochrome()) + { + // get pointer to internal image representation + // (which means Modality LUT has been applied unless disabled, but nothing else) + const DiPixel *dinter_reference = di_reference->getInterData(); + if (dinter_reference == NULL) return EC_IllegalCall; + const DiPixel *dinter_test = di_test->getInterData(); + if (dinter_test == NULL) return EC_IllegalCall; + + // get pointer to internal raw representations of image data + const void *draw_reference = dinter_reference->getData(); + if (draw_reference == NULL) return EC_IllegalCall; + const void *draw_test = dinter_test->getData(); + if (draw_test == NULL) return EC_IllegalCall; + + // get internal representations used for both images + EP_Representation drep_reference = dinter_reference->getRepresentation(); + EP_Representation drep_test = dinter_test->getRepresentation(); + + // determine number of pixels + unsigned int fcount = di_reference->getFrameCount(); + unsigned long numValues = di_reference->getWidth() * di_reference->getHeight() * fcount; + if (dinter_reference->getCount() < numValues) + { + DCMIMAGE_FATAL("Insufficient pixel data in reference image: " << numValues << " needed, " << dinter_reference->getCount() << " found."); + return makeOFCondition(OFM_dcmimage, 138, OF_error, "insufficient pixel data in reference image"); + } + if (dinter_test->getCount() < numValues) + { + DCMIMAGE_FATAL("Insufficient pixel data in test image: " << numValues << " needed, " << dinter_reference->getCount() << " found."); + return makeOFCondition(OFM_dcmimage, 139, OF_error, "insufficient pixel data in test image"); + } + + // prepare creation of difference image pixel data + Uint16 *dv = NULL; + double dvp; + if (diff_image) + { + // create empty pixel data element and insert into main dataset + DcmPixelData *pxd = new DcmPixelData(DCM_PixelData); + cond = diff_image->getDataset()->insert(pxd); + if (cond.bad()) return cond; + + // create pixel data buffer for all frames of the difference image + Uint32 pixelDataLen = numValues; + cond = pxd->createUint16Array(pixelDataLen, dv); + if (cond.bad()) return cond; + } + + // create pointers to reference image pixel data in all possible formats + const Uint8 *ref_as_uint8 = OFreinterpret_cast(const Uint8 *, draw_reference); + const Sint8 *ref_as_sint8 = OFreinterpret_cast(const Sint8 *, draw_reference); + const Uint16 *ref_as_uint16 = OFreinterpret_cast(const Uint16 *, draw_reference); + const Sint16 *ref_as_sint16 = OFreinterpret_cast(const Sint16 *, draw_reference); + + // create pointers to test image pixel data in all possible formats + const Uint8 *test_as_uint8 = OFreinterpret_cast(const Uint8 *, draw_test); + const Sint8 *test_as_sint8 = OFreinterpret_cast(const Sint8 *, draw_test); + const Uint16 *test_as_uint16 = OFreinterpret_cast(const Uint16 *, draw_test); + const Sint16 *test_as_sint16 = OFreinterpret_cast(const Sint16 *, draw_test); + + double square_error_sum = 0; // sum of squared differences between reference and test + double simple_error_sum = 0; // sum of (unsigned) differences between reference and test + double square_reference_sum = 0; // sum of squared pixel values in reference image + unsigned long square_signal_strength = 0; // maximum pixel value in reference image + max_error = 0; // maximum (unsigned) difference between reference and test pixel value + + long i1, i2; + unsigned long i3, t; + + // iterate over all samples (pixel values) of all frames + for (unsigned int i = 0; i < numValues; i++) + { + switch(drep_reference) + { + case EPR_Uint8: // image representation is 8 bit unsigned + i1 = *ref_as_uint8++; + break; + case EPR_Sint8: // image representation is 8 bit signed + i1 = *ref_as_sint8++; + break; + case EPR_Uint16: // image representation is 16 bit unsigned + i1 = *ref_as_uint16++; + break; + case EPR_Sint16: // image representation is 16 bit signed + i1 = *ref_as_sint16++; + break; + default: + return makeOFCondition(OFM_dcmimage, 140, OF_error, "unsupported internal pixel representation"); + break; + } + switch(drep_test) + { + case EPR_Uint8: // image representation is 8 bit unsigned + i2 = *test_as_uint8++; + break; + case EPR_Sint8: // image representation is 8 bit signed + i2 = *test_as_sint8++; + break; + case EPR_Uint16: // image representation is 16 bit unsigned + i2 = *test_as_uint16++; + break; + case EPR_Sint16: // image representation is 16 bit signed + i2 = *test_as_sint16++; + break; + default: + return makeOFCondition(OFM_dcmimage, 141, OF_error, "unsupported internal pixel representation"); + break; + } + + i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign + if (dv) + { + dvp = amplification * i3; // compute diff image pixel value + if (dvp > 65535) + *dv++ = OFstatic_cast(Uint16, 65535); + else *dv++ = OFstatic_cast(Uint16, dvp); + + } + max_error = (i3 > max_error ? i3 : max_error); + square_error_sum += (double)(i3*i3); + simple_error_sum += i3; + t = i1 * i1; + square_reference_sum += t; + square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength; + } + + // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in + // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008 + + DCMIMAGE_DEBUG("square_signal_strength: " << square_signal_strength); + DCMIMAGE_DEBUG("square_error_sum: " << square_error_sum); + + // as a helper variable, divide the sum of squared errors by the total number of samples + double meanSquareError = square_error_sum / (numValues * fcount); + + // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples + meanAbsoluteError = simple_error_sum / (numValues * fcount); + + // RMSE is the square root of the mean square error + rootMeanSquareError = sqrt(meanSquareError); + + // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength + //(maximum pixel value in reference image) + peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0; + + // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values) + // divided by the noise (squared sum of all difference values) + signalToNoiseRatio = log10(square_reference_sum / square_error_sum) * 10.0; + + if (diff_image) + { + char buf[30]; + OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, di_reference->getFrameCount())); + cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf); + if (di_reference->getFrameCount() > 1) + { + DcmTagKey frameIncrementPointer(0x0018, 0x2002); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer); + OFString frameLabelVector; + createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFFalse); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector); + } + } + } + return cond; +} + + +OFCondition DicomImageComparison::computeMonochromeImageComparionMetricsByte() +{ + DCMIMAGE_DEBUG("Type of computation: monochrome, 8-bits/sample"); + + // this check should have already been performed, but just to be sure, and since it's cheap... + OFCondition cond = checkImageCharacteristics(); + if (cond.good() && di_reference->isMonochrome()) + { + unsigned long numBytes = di_reference->getOutputDataSize(8); + unsigned int fcount = di_reference->getFrameCount(); + if (numBytes != di_test->getOutputDataSize(8)) + { + DCMIMAGE_FATAL("Frame size mismatch: " + << numBytes << " vs. " << di_test->getOutputDataSize(8) << " bytes"); + return makeOFCondition(OFM_dcmimage, 135, OF_error, "frame size mismatch"); + } + unsigned long numValues = numBytes; + + // prepare creation of difference image pixel data + Uint8 *dv = NULL; + double dvp; + if (diff_image) + { + // create empty pixel data element and insert into main dataset + DcmPixelData *pxd = new DcmPixelData(DCM_PixelData); + cond = diff_image->getDataset()->insert(pxd); + if (cond.bad()) return cond; + + // create pixel data buffer for all frames of the difference image + Uint32 pixelDataLen = numValues * fcount; + cond = pxd->createUint8Array(pixelDataLen, dv); + if (cond.bad()) return cond; + } + + const Uint8 *f1; + const Uint8 *f2; + + double square_error_sum = 0; // sum of squared differences between reference and test + double simple_error_sum = 0; // sum of (unsigned) differences between reference and test + double square_reference_sum = 0; // sum of squared pixel values in reference image + unsigned long square_signal_strength = 0; // maximum pixel value in reference image + max_error = 0; // maximum (unsigned) difference between reference and test pixel value + + // iterate over all frames + for (unsigned int frame = 0; frame < fcount; frame++) + { + DCMIMAGE_DEBUG("Processing frame " << frame); + const void *frame1 = di_reference->getOutputData(8, frame); + const void *frame2 = di_test->getOutputData(8, frame); + if ((frame1 == NULL) || (frame2 == NULL)) + { + DCMIMAGE_FATAL("Memory exhausted while accessing frames"); + return EC_MemoryExhausted; + } + f1 = OFreinterpret_cast(const Uint8 *, frame1); + f2 = OFreinterpret_cast(const Uint8 *, frame2); + long i1, i2; + unsigned long i3, t; + + // iterate over all samples (pixel values) of the current frame + for (unsigned long i = 0; i < numValues; ++i) + { + i1 = *f1; // pixel value in the reference image + i2 = *f2; // pixel value in the test image + i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign + if (dv) + { + dvp = amplification * i3; // compute diff image pixel value + if (dvp > 255) + *dv++ = OFstatic_cast(Uint8, 255); + else *dv++ = OFstatic_cast(Uint8, dvp); + + } + max_error = (i3 > max_error ? i3 : max_error); + square_error_sum += (double)(i3*i3); + simple_error_sum += i3; + t = i1 * i1; + square_reference_sum += t; + square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength; + ++f1; + ++f2; + } + } + + // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in + // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008 + + // as a helper variable, divide the sum of squared errors by the total number of samples + double meanSquareError = square_error_sum / (numValues * fcount); + + // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples + meanAbsoluteError = simple_error_sum / (numValues * fcount); + + // Compute RMSE by taking the square root of the mean square error + rootMeanSquareError = sqrt(meanSquareError); + + // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength + //(maximum pixel value in reference image) + peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0; + + // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values) + // divided by the noise (squared sum of all difference values) + signalToNoiseRatio = log10(square_reference_sum / square_error_sum) * 10.0; + + if (diff_image) + { + char buf[30]; + OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, di_reference->getFrameCount())); + cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf); + if (di_reference->getFrameCount() > 1) + { + DcmTagKey frameIncrementPointer(0x0018, 0x2002); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer); + OFString frameLabelVector; + createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFFalse); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector); + } + } + } + return cond; +} + + +OFCondition DicomImageComparison::computeColorImageComparionMetrics() +{ + DCMIMAGE_DEBUG("Type of computation: color, 8-bits/sample"); + + // this check should have already been performed, but just to be sure, and since it's cheap... + OFCondition cond = checkImageCharacteristics(); + if (cond.good() && (! di_reference->isMonochrome())) + { + unsigned long numBytes = di_reference->getOutputDataSize(8); + unsigned int fcount = di_reference->getFrameCount(); + if (numBytes != di_test->getOutputDataSize(8)) + { + DCMIMAGE_FATAL("Frame size mismatch: " + << numBytes << " vs. " << di_test->getOutputDataSize(8) << " bytes"); + return makeOFCondition(OFM_dcmimage, 136, OF_error, "frame size mismatch"); + } + unsigned long numValues = numBytes; + + // prepare creation of difference image pixel data + Uint8 *dv = NULL; + double dvp; + if (diff_image) + { + // create empty pixel data element and insert into main dataset + DcmPixelData *pxd = new DcmPixelData(DCM_PixelData); + cond = diff_image->getDataset()->insert(pxd); + if (cond.bad()) return cond; + + // create pixel data buffer for all frames of the difference image + Uint32 pixelDataLen = numValues * fcount; + cond = pxd->createUint8Array(pixelDataLen, dv); + if (cond.bad()) return cond; + } + + const Uint8 *f1; + const Uint8 *f2; + + double square_error_sum = 0; // sum of squared differences between reference and test + double simple_error_sum = 0; // sum of (unsigned) differences between reference and test + double square_reference_sum = 0; // sum of squared pixel values in reference image + unsigned long square_signal_strength = 0; // maximum pixel value in reference image + max_error = 0; // maximum (unsigned) difference between reference and test pixel value + + // iterate over all frames + for (unsigned int frame = 0; frame < fcount; frame++) + { + DCMIMAGE_DEBUG("Processing frame " << frame); + const void *frame1 = di_reference->getOutputData(8, frame, 1 /* color by plane */); + const void *frame2 = di_test->getOutputData(8, frame, 1 /* color by plane */); + if ((frame1 == NULL) || (frame2 == NULL)) + { + DCMIMAGE_FATAL("Memory exhausted while accessing frames"); + return EC_MemoryExhausted; + } + f1 = OFreinterpret_cast(const Uint8 *, frame1); + f2 = OFreinterpret_cast(const Uint8 *, frame2); + long i1, i2; + unsigned long i3, t; + + // iterate over all samples (R, G and B pixel values) of the current frame + for (unsigned long i = 0; i < numValues; ++i) + { + i1 = *f1; // pixel value in the reference image + i2 = *f2; // pixel value in the test image + i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign + if (dv) + { + dvp = amplification * i3; // compute diff image pixel value + if (dvp > 255) + *dv++ = OFstatic_cast(Uint8, 255); + else *dv++ = OFstatic_cast(Uint8, dvp); + + } + max_error = (i3 > max_error ? i3 : max_error); + square_error_sum += (double)(i3*i3); + simple_error_sum += i3; + t = i1 * i1; + square_reference_sum += t; + square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength; + ++f1; + ++f2; + } + } + + // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in + // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008 + + // as a helper variable, divide the sum of squared errors by the total number of samples + double meanSquareError = square_error_sum / (numValues * fcount); + + // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples + meanAbsoluteError = simple_error_sum / (numValues * fcount); + + // Compute RMSE by taking the square root of the mean square error + rootMeanSquareError = sqrt(meanSquareError); + + // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength + //(maximum pixel value in reference image) + peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0; + + // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values) + // divided by the noise (squared sum of all difference values) + signalToNoiseRatio = log10(square_reference_sum / square_error_sum) * 10.0; + + if (diff_image) + { + char buf[30]; + // For color images, the difference image is always multiframe + // because it contains separate R, G and B difference frames + OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, 3UL * di_reference->getFrameCount())); + cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth())); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf); + DcmTagKey frameIncrementPointer(0x0018, 0x2002); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer); + OFString frameLabelVector; + createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFTrue); + if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector); + } + } + return cond; +} + + +void DicomImageComparison::logImageInfo(DicomImage *di, const char *filename) +{ + if (di == NULL) return; + if (filename == NULL) return; + + double minVal = 0.0; + double maxVal = 0.0; + const char *colorModel; + unsigned long i; + + int minmaxValid = di->getMinMaxValues(minVal, maxVal); + colorModel = di->getString(di->getPhotometricInterpretation()); + if (colorModel == NULL) + colorModel = "unknown"; + + char aspectRatio[30]; + OFStandard::ftoa(aspectRatio, sizeof(aspectRatio), di->getHeightWidthRatio(), OFStandard::ftoa_format_f, 0, 2); + + /* dump some general information */ + DCMIMAGE_DEBUG("characteristics of file '" << filename << "':"); + DCMIMAGE_DEBUG( + " columns x rows : " << di->getWidth() << " x " << di->getHeight() << OFendl + << " bits per sample : " << di->getDepth() << OFendl + << " color model : " << colorModel << OFendl + << " pixel aspect ratio : " << aspectRatio << OFendl + << " number of frames : " << di->getNumberOfFrames() << " (" << di->getFrameCount() << " processed)"); + + /* dump VOI windows */ + unsigned long count; + OFString explStr, funcStr; + count = di->getWindowCount(); + switch (di->getVoiLutFunction()) + { + case EFV_Default: + funcStr = ""; + break; + case EFV_Linear: + funcStr = "LINEAR"; + break; + case EFV_Sigmoid: + funcStr = "SIGMOID"; + break; + } + DCMIMAGE_DEBUG(" VOI LUT function : " << funcStr); + DCMIMAGE_DEBUG(" VOI windows in file : " << di->getWindowCount()); + for (i = 0; i < count; i++) + { + if (di->getVoiWindowExplanation(i, explStr) == NULL) + DCMIMAGE_DEBUG(" - "); + else + DCMIMAGE_DEBUG(" - " << explStr); + } + + /* dump VOI LUTs */ + count = di->getVoiLutCount(); + DCMIMAGE_DEBUG(" VOI LUTs in file : " << count); + for (i = 0; i < count; i++) + { + if (di->getVoiLutExplanation(i, explStr) == NULL) + DCMIMAGE_DEBUG(" - "); + else + DCMIMAGE_DEBUG(" - " << explStr); + } + + /* dump presentation LUT shape */ + OFString shapeStr; + switch (di->getPresentationLutShape()) + { + case ESP_Default: + shapeStr = ""; + break; + case ESP_Identity: + shapeStr = "IDENTITY"; + break; + case ESP_Inverse: + shapeStr = "INVERSE"; + break; + case ESP_LinOD: + shapeStr = "LIN OD"; + break; + } + DCMIMAGE_DEBUG(" presentation shape : " << shapeStr); + + /* dump overlays */ + DCMIMAGE_DEBUG(" overlays in file : " << di->getOverlayCount()); + + if (minmaxValid) + { + char minmaxText[30]; + OFStandard::ftoa(minmaxText, sizeof(minmaxText), maxVal, OFStandard::ftoa_format_f, 0, 0); + DCMIMAGE_DEBUG(" maximum pixel value : " << minmaxText); + OFStandard::ftoa(minmaxText, sizeof(minmaxText), minVal, OFStandard::ftoa_format_f, 0, 0); + DCMIMAGE_DEBUG(" minimum pixel value : " << minmaxText); + } + + return; +} + + +OFCondition DicomImageComparison::copyReferenceImageAttributes(DcmItem *src, DcmItem *diffImage) +{ + if (src == NULL) return EC_IllegalCall; + if (diffImage == NULL) return EC_IllegalCall; + OFCondition cond; + + // Copy Patient Module attributes from the reference image. + // All these attributes are type 2 and should thus be present + OFString patientName; + OFString patientID; + OFString patientBirthDate; + OFString patientSex; + + if (src->findAndGetOFStringArray(DCM_PatientName, patientName).bad()) + DCMIMAGE_WARN("Patient Name not found in reference image, ignoring."); + if (src->findAndGetOFStringArray(DCM_PatientID, patientID).bad()) + DCMIMAGE_WARN("Patient ID not found in reference image, ignoring."); + if (src->findAndGetOFStringArray(DCM_PatientBirthDate, patientBirthDate).bad()) + DCMIMAGE_WARN("Patient's Sex not found in reference image, ignoring."); + if (src->findAndGetOFStringArray(DCM_PatientSex, patientSex).bad()) + DCMIMAGE_WARN("Patient's Birth Date not found in reference image, ignoring."); + + cond = diffImage->putAndInsertOFStringArray(DCM_PatientName, patientName); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_PatientID, patientID); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_PatientBirthDate, patientBirthDate); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_PatientSex, patientSex); + if (cond.bad()) return cond; + + // Copy General Study Module attributes from the reference image. + // All these attributes are type 1 or 2 and should thus be present + OFString studyInstanceUID; + OFString studyDate; + OFString studyTime; + OFString referringPhysicianName; + OFString studyID; + OFString accessionNumber; + + cond = src->findAndGetOFStringArray(DCM_StudyInstanceUID, studyInstanceUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("Study Instance UID not found in reference image."); + return cond; + } + if (src->findAndGetOFStringArray(DCM_StudyDate, studyDate).bad()) + DCMIMAGE_WARN("Study Date not found in reference image, ignoring."); + if (src->findAndGetOFStringArray(DCM_StudyTime, studyTime).bad()) + DCMIMAGE_WARN("Study Time not found in reference image, ignoring."); + if (src->findAndGetOFStringArray(DCM_ReferringPhysicianName, referringPhysicianName).bad()) + DCMIMAGE_WARN("Referring Physician's Name not found in reference image, ignoring."); + if (src->findAndGetOFStringArray(DCM_StudyID, studyID).bad()) + DCMIMAGE_WARN("Study ID not found in reference image, ignoring."); + if (src->findAndGetOFStringArray(DCM_AccessionNumber, accessionNumber).bad()) + DCMIMAGE_WARN("Accession Number not found in reference image, ignoring."); + + cond = diffImage->putAndInsertOFStringArray(DCM_StudyInstanceUID, studyInstanceUID); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_StudyDate, studyDate); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_StudyTime, studyTime); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_ReferringPhysicianName, referringPhysicianName); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_StudyID, studyID); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_AccessionNumber, accessionNumber); + if (cond.bad()) return cond; + + // Generate General Series Module attributes + OFString modality = "OT"; // OT = "other" + char uidbuf[65]; + OFString seriesInstanceUID; + OFString laterality; + OFString seriesNumber = "1"; + seriesInstanceUID = dcmGenerateUniqueIdentifier(uidbuf); + + cond = diffImage->putAndInsertOFStringArray(DCM_Modality, modality); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_SeriesNumber, seriesNumber); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_SeriesInstanceUID, seriesInstanceUID); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_Laterality, laterality); + if (cond.bad()) return cond; + + // Generate SC Equipment Module attributes + OFString conversionType = "SYN"; // SYN = "Synthetic Image" + cond = diffImage->putAndInsertOFStringArray(DCM_ConversionType, conversionType); + if (cond.bad()) return cond; + + // Generate General Image Module attributes + OFString instanceNumber = "1"; + OFString contentDate; + OFString contentTime; + OFString imageType = "DERIVED\\SECONDARY"; + OFString patientOrientation; + OFDateTime dt; + if ((! dt.setCurrentDateTime()) || + (! dt.getDate().getISOFormattedDate(contentDate, OFFalse)) || + (! dt.getTime().getISOFormattedTime(contentTime, OFTrue, OFFalse, OFFalse, OFFalse))) + { + DCMIMAGE_ERROR("Unable to retrieve current date/time"); + return makeOFCondition(OFM_dcmimage, 137, OF_error, "Unable to retrieve current date/time"); + } + + cond = diffImage->putAndInsertOFStringArray(DCM_InstanceNumber, instanceNumber); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_ContentDate, contentDate); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_ContentTime, contentTime); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_ImageType, imageType); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_PatientOrientation, patientOrientation); + if (cond.bad()) return cond; + + // Generate General Reference Module attributes + OFString derivationDescription = "Difference image between reference and lossy compressed test image"; + DcmItem *derivationCodeSequence = NULL; + OFString derivationCodeValue = "113062"; + OFString derivationCodingSchemeDesignator = "DCM"; + OFString derivationCodeMeaning = "Pixel by pixel subtraction"; + DcmItem *sourceImageSequence = NULL; + OFString referencedSOPClassUID; + OFString referencedSOPInstanceUID; + DcmItem *purposeOfReferenceCodeSequence = NULL; + OFString purposeOfReferenceCodeValue = "121320"; + OFString purposeOfReferenceCodingSchemeDesignator = "DCM"; + OFString purposeOfReferenceCodeMeaning = "Uncompressed predecessor"; + + cond = src->findAndGetOFStringArray(DCM_SOPClassUID, referencedSOPClassUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("SOP Class UID not found in reference image."); + return cond; + } + cond = src->findAndGetOFStringArray(DCM_SOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("SOP Instance UID not found in reference image."); + return cond; + } + + cond = diffImage->putAndInsertOFStringArray(DCM_DerivationDescription, derivationDescription); + if (cond.bad()) return cond; + cond = diffImage->findOrCreateSequenceItem(DCM_DerivationCodeSequence, derivationCodeSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = derivationCodeSequence->putAndInsertOFStringArray(DCM_CodeValue, derivationCodeValue); + if (cond.bad()) return cond; + cond = derivationCodeSequence->putAndInsertOFStringArray(DCM_CodingSchemeDesignator, derivationCodingSchemeDesignator); + if (cond.bad()) return cond; + cond = derivationCodeSequence->putAndInsertOFStringArray(DCM_CodeMeaning, derivationCodeMeaning); + if (cond.bad()) return cond; + cond = diffImage->findOrCreateSequenceItem(DCM_SourceImageSequence, sourceImageSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID); + if (cond.bad()) return cond; + cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) return cond; + cond = sourceImageSequence->findOrCreateSequenceItem(DCM_PurposeOfReferenceCodeSequence, purposeOfReferenceCodeSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeValue, purposeOfReferenceCodeValue); + if (cond.bad()) return cond; + cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodingSchemeDesignator, purposeOfReferenceCodingSchemeDesignator); + if (cond.bad()) return cond; + cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeMeaning, purposeOfReferenceCodeMeaning); + if (cond.bad()) return cond; + + // Most of the Image Pixel Module is generated elsewhere. + // Here we only populate a few values that are copied from the reference image or are constant + + OFString photometricInterpretation = "MONOCHROME2"; + Uint16 samplesPerPixel = 1; + Uint16 pixelRepresentation = 0; + OFString pixelAspectRatio; + + // First look for PixelAspectRatio in the reference image + if (src->findAndGetOFStringArray(DCM_PixelAspectRatio, pixelAspectRatio).bad()) + { + // Now look for PixelSpacing. Note that this is a DS (double string) element + Float64 rowSpacing = 0.0; + Float64 colSpacing = 0.0; + unsigned long row; + unsigned long col; + char buf[30]; + if (src->findAndGetFloat64(DCM_PixelSpacing, rowSpacing, 0).good() && + src->findAndGetFloat64(DCM_PixelSpacing, colSpacing, 1).good()) + { + row = OFstatic_cast(unsigned long, rowSpacing*1000); + col = OFstatic_cast(unsigned long, colSpacing*1000); + // only create pixelAspectRatio if pixels are not square + if (row != col) + { + OFStandard::snprintf(buf, 30, "%lu\\%lu", row, col); + pixelAspectRatio = buf; + } + } + else + { + // Finally look for ImagerPixelSpacing. Note that this is a DS (double string) element + if (src->findAndGetFloat64(DCM_ImagerPixelSpacing, rowSpacing, 0).good() && + src->findAndGetFloat64(DCM_ImagerPixelSpacing, colSpacing, 1).good()) + { + row = OFstatic_cast(unsigned long, rowSpacing*1000); + col = OFstatic_cast(unsigned long, colSpacing*1000); + // only create pixelAspectRatio if pixels are not square + if (row != col) + { + OFStandard::snprintf(buf, 30, "%lu\\%lu", row, col); + pixelAspectRatio = buf; + } + } + } + } + + cond = diffImage->putAndInsertOFStringArray(DCM_PhotometricInterpretation, photometricInterpretation); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertUint16(DCM_SamplesPerPixel, samplesPerPixel); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertUint16(DCM_PixelRepresentation, pixelRepresentation); + if (cond.bad()) return cond; + if (pixelAspectRatio.length() > 0) + { + cond = diffImage->putAndInsertOFStringArray(DCM_PixelAspectRatio, pixelAspectRatio); + if (cond.bad()) return cond; + } + + // Generate SC Multi-frame Image Module attributes + OFString burnedInAnnotation = "YES"; + OFString presentationLUTShape = "IDENTITY"; + OFString rescaleIntercept = "0"; + OFString rescaleSlope = "1"; + OFString rescaleType = "US"; // US = unspecified + + cond = diffImage->putAndInsertOFStringArray(DCM_BurnedInAnnotation, burnedInAnnotation); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_PresentationLUTShape, presentationLUTShape); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_RescaleIntercept, rescaleIntercept); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_RescaleSlope, rescaleSlope); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_RescaleType, rescaleType); + if (cond.bad()) return cond; + + // Generate SOP Common Module attributes (except SOP Class UID) + OFString sOPInstanceUID; + OFString specificCharacterSet; + // UID constant used for this tool + OFString instanceCreatorUID = "1.2.276.0.7230010.3.1.2.1787205428.20064.1535731842.951308"; + OFString InstanceNumber = "1"; + if (src->findAndGetOFStringArray(DCM_SpecificCharacterSet, specificCharacterSet).bad()) specificCharacterSet = ""; + sOPInstanceUID = dcmGenerateUniqueIdentifier(uidbuf); + + cond = diffImage->putAndInsertOFStringArray(DCM_SOPInstanceUID, sOPInstanceUID); + if (cond.bad()) return cond; + if (specificCharacterSet.length() > 0) + { + cond = diffImage->putAndInsertOFStringArray(DCM_SpecificCharacterSet, specificCharacterSet); + if (cond.bad()) return cond; + } + // our images always have the same values for content date/time and instance creation date/time + cond = diffImage->putAndInsertOFStringArray(DCM_InstanceCreationDate, contentDate); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_InstanceCreationTime, contentTime); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_InstanceCreatorUID, instanceCreatorUID); + if (cond.bad()) return cond; + cond = diffImage->putAndInsertOFStringArray(DCM_InstanceNumber, instanceNumber); + if (cond.bad()) return cond; + + // Generate Common Instance Reference Module attributes (except SOP Class UID) + DcmItem *referencedSeriesSequence = NULL; + DcmItem *referencedInstanceSequence = NULL; + OFString referencedSeriesInstanceUID; + cond = src->findAndGetOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("Series Instance UID not found in reference image."); + return cond; + } + + cond = diffImage->findOrCreateSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = referencedSeriesSequence->putAndInsertOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID); + if (cond.bad()) return cond; + cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) return cond; + + return cond; +} + +OFCondition DicomImageComparison::copyTestImageAttributes(DcmItem *src, DcmItem *diffImage) +{ + if (src == NULL) return EC_IllegalCall; + if (diffImage == NULL) return EC_IllegalCall; + OFCondition cond; + + // Generate General Reference Module attributes + DcmItem *sourceImageSequence = NULL; + OFString referencedSOPClassUID; + OFString referencedSOPInstanceUID; + DcmItem *purposeOfReferenceCodeSequence = NULL; + OFString purposeOfReferenceCodeValue = "121330"; + OFString purposeOfReferenceCodingSchemeDesignator = "DCM"; + OFString purposeOfReferenceCodeMeaning = "Lossy compressed predecessor"; + + cond = src->findAndGetOFStringArray(DCM_SOPClassUID, referencedSOPClassUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("SOP Class UID not found in test image."); + return cond; + } + cond = src->findAndGetOFStringArray(DCM_SOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("SOP Instance UID not found in test image."); + return cond; + } + + // Add reference to the test image to the Source Image Sequence + cond = diffImage->findOrCreateSequenceItem(DCM_SourceImageSequence, sourceImageSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID); + if (cond.bad()) return cond; + cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) return cond; + cond = sourceImageSequence->findOrCreateSequenceItem(DCM_PurposeOfReferenceCodeSequence, purposeOfReferenceCodeSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeValue, purposeOfReferenceCodeValue); + if (cond.bad()) return cond; + cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodingSchemeDesignator, purposeOfReferenceCodingSchemeDesignator); + if (cond.bad()) return cond; + cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeMeaning, purposeOfReferenceCodeMeaning); + if (cond.bad()) return cond; + + // Generate Common Instance Reference Module attributes (except SOP Class UID) + DcmItem *referencedSeriesSequence = NULL; + DcmItem *referencedInstanceSequence = NULL; + DcmItem *studiesContainingOtherReferencedInstancesSequence = NULL; + OFString referencedStudyInstanceUID; + OFString referencedSeriesInstanceUID; + OFString diffImageStudyInstanceUID; + OFString diffImageSeriesInstanceUID; + + cond = src->findAndGetOFStringArray(DCM_StudyInstanceUID, referencedStudyInstanceUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("Study Instance UID not found in test image."); + return cond; + } + cond = src->findAndGetOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("Series Instance UID not found in test image."); + return cond; + } + cond = diffImage->findAndGetOFStringArray(DCM_StudyInstanceUID, diffImageStudyInstanceUID); + if (cond.bad()) + { + DCMIMAGE_ERROR("Study Instance UID not found in difference image."); + return cond; + } + + if (diffImageStudyInstanceUID == referencedStudyInstanceUID) + { + // Reference image and test image share the same Study Instance UID. + // Now check the Series Instance UID. + cond = diffImage->findAndGetSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, 0); + if (cond.bad()) return cond; + cond = referencedSeriesSequence->findAndGetOFStringArray(DCM_SeriesInstanceUID, diffImageSeriesInstanceUID); + if (cond.bad()) return cond; + if (diffImageSeriesInstanceUID == referencedSeriesInstanceUID) + { + // Reference image and test image share the same Series Instance UID. + cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) return cond; + } + else + { + // Reference image and test image have different Series Instance UIDs. + // This should not happen unless some deidentification process has taken place. + DCMIMAGE_WARN("Test image has a different Series Instance UID than the reference image."); + cond = diffImage->findOrCreateSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = referencedSeriesSequence->putAndInsertOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID); + if (cond.bad()) return cond; + cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) return cond; + } + } + else + { + // Reference image and test image have different Study Instance UIDs. + // This should not happen unless some deidentification process has taken place. + DCMIMAGE_WARN("Test image has a different Study Instance UID than the reference image."); + cond = diffImage->findOrCreateSequenceItem(DCM_StudiesContainingOtherReferencedInstancesSequence, studiesContainingOtherReferencedInstancesSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = studiesContainingOtherReferencedInstancesSequence->putAndInsertOFStringArray(DCM_StudyInstanceUID, referencedStudyInstanceUID); + if (cond.bad()) return cond; + cond = studiesContainingOtherReferencedInstancesSequence->findOrCreateSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = referencedSeriesSequence->putAndInsertOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID); + if (cond.bad()) return cond; + cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2 /* append new item */); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID); + if (cond.bad()) return cond; + cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID); + if (cond.bad()) return cond; + } + + return cond; +} + + +void DicomImageComparison::createFrameLabelVector(OFString& s, unsigned long numFrames, OFBool isColor) +{ + // Create a multi-valued string with one label for each frame. + // For monochrome images, the labels will be F001\F002\F003... + // For color images, the labels will be F001R\F001G\F001B\F002R\F002G\F002B... + // since we store three monochrome difference frames for the R, G and B plane + // of each color frame in the reference image. + s = ""; + char buf[100]; + for (unsigned long i = 0; i < numFrames; ++i) + { + if (i > 0) s += "\\"; + if (isColor) + OFStandard::snprintf(buf, 100, "F%03luR\\F%03luG\\F%03luB", i+1, i+1, i+1); + else OFStandard::snprintf(buf, 100, "F%03lu", i+1); + s += buf; + } + + // check if we can really represent this string as SH element in explicit VR. + // This may become a problem if we have a color image with more than 3100 frames, + // or a monochrome image with more than 9300 frames. + if (s.length() > 65534) + { + DCMIMAGE_WARN("frame label vector too long"); + s.erase(65534); + } +} diff --git a/dcmimage/libsrc/diargimg.cc b/dcmimage/libsrc/diargimg.cc new file mode 100644 index 00000000..34c5bd04 --- /dev/null +++ b/dcmimage/libsrc/diargimg.cc @@ -0,0 +1,152 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DiARGBImage (Source) - UNTESTED !!! + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +#include "dcmtk/dcmimage/diargimg.h" +#include "dcmtk/dcmimage/diargpxt.h" +#include "dcmtk/dcmimage/diqttype.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diluptab.h" +#include "dcmtk/dcmimgle/diinpx.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiARGBImage::DiARGBImage(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 4), + Palette() // initializes the three color palettes to NULL +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + if (BitsStored <= MAX_TABLE_ENTRY_SIZE) // color depth <= 16 + { + const EL_BitsPerTableEntry descMode = (Document->getFlags() & CIF_CheckLutBitDepth) ? ELM_CheckValue : ELM_UseValue; + Palette[0] = new DiLookupTable(Document, DCM_RedPaletteColorLookupTableDescriptor, + DCM_RedPaletteColorLookupTableData, DCM_UndefinedTagKey, descMode, &ImageStatus); + Palette[1] = new DiLookupTable(Document, DCM_GreenPaletteColorLookupTableDescriptor, + DCM_GreenPaletteColorLookupTableData, DCM_UndefinedTagKey, descMode, &ImageStatus); + Palette[2] = new DiLookupTable(Document, DCM_BluePaletteColorLookupTableDescriptor, + DCM_BluePaletteColorLookupTableData, DCM_UndefinedTagKey, descMode, &ImageStatus); + if ((ImageStatus == EIS_Normal) && (Palette[0] != NULL) && (Palette[1] != NULL) && (Palette[2] != NULL)) + { + BitsPerSample = BitsStored; + for (int jj = 0; jj < 3; jj++) // determine maximum bit count + { + if (Palette[jj]->getBits() > OFstatic_cast(Uint16, BitsPerSample)) + BitsPerSample = Palette[jj]->getBits(); + } + Init(); // create intermediate representation + } + } + else // color depth > 16 + { + ImageStatus = EIS_InvalidValue; + DCMIMAGE_ERROR("invalid value for 'BitsStored' (" << BitsStored << ") " + << "... exceeds maximum palette entry size of " << MAX_TABLE_ENTRY_SIZE << " bits"); + } + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiARGBImage::~DiARGBImage() +{ + delete Palette[0]; + delete Palette[1]; + delete Palette[2]; +} + + +/*********************************************************************/ + + +void DiARGBImage::Init() +{ + /* number of pixels per plane */ + const unsigned long planeSize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + if (BitsPerSample <= 8) + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + else + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + break; + case EPR_Sint8: + if (BitsPerSample <= 8) + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + else + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + break; + case EPR_Uint16: + if (BitsPerSample <= 8) + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + else + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + break; + case EPR_Sint16: + if (BitsPerSample <= 8) + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + else + InterData = new DiARGBPixelTemplate(Document, InputData, Palette, ImageStatus, + planeSize, BitsStored); + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + deleteInputData(); // input data is no longer needed + checkInterData(); +} + + +/*********************************************************************/ + + +int DiARGBImage::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/libsrc/dicmyimg.cc b/dcmimage/libsrc/dicmyimg.cc new file mode 100644 index 00000000..e3985fad --- /dev/null +++ b/dcmimage/libsrc/dicmyimg.cc @@ -0,0 +1,103 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomCMYKImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimage/dicmyimg.h" +#include "dcmtk/dcmimage/dicmypxt.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diinpx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiCMYKImage::DiCMYKImage(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 4) +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + Init(); // create intermediate representation + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiCMYKImage::~DiCMYKImage() +{ +} + + +/*********************************************************************/ + + +void DiCMYKImage::Init() +{ + /* number of pixels per plane */ + const unsigned long planeSize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiCMYKPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint8: + InterData = new DiCMYKPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Uint16: + InterData = new DiCMYKPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint16: + InterData = new DiCMYKPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Uint32: + InterData = new DiCMYKPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint32: + InterData = new DiCMYKPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + } + deleteInputData(); + checkInterData(); +} + + +/*********************************************************************/ + + +int DiCMYKImage::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/libsrc/dicoimg.cc b/dcmimage/libsrc/dicoimg.cc new file mode 100644 index 00000000..06974c2a --- /dev/null +++ b/dcmimage/libsrc/dicoimg.cc @@ -0,0 +1,705 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcpixel.h" + +#include "dcmtk/dcmimage/dicoimg.h" +#include "dcmtk/dcmimgle/dimo2img.h" +#include "dcmtk/dcmimage/dicopxt.h" +#include "dcmtk/dcmimage/dicocpt.h" +#include "dcmtk/dcmimage/dicosct.h" +#include "dcmtk/dcmimage/dicoflt.h" +#include "dcmtk/dcmimage/dicorot.h" +#include "dcmtk/dcmimage/dicoopxt.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diutils.h" + +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiColorImage::DiColorImage(const DiDocument *docu, + const EI_Status status, + const int spp, + const OFBool rgb) + : DiImage(docu, status, spp), + RGBColorModel(rgb), + InterData(NULL), + OutputData(NULL) +{ + detachPixelData(); +} + + +DiColorImage::DiColorImage(const DiColorImage *image, + const unsigned long fstart, + const unsigned long fcount) + : DiImage(image, fstart, fcount), + RGBColorModel(image->RGBColorModel), + InterData(NULL), + OutputData(NULL) +{ + if (image->InterData != NULL) + { + const unsigned long fsize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiColorCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Sint8: + InterData = new DiColorCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Uint16: + InterData = new DiColorCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Sint16: + InterData = new DiColorCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Uint32: + InterData = new DiColorCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Sint32: + InterData = new DiColorCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + } + checkInterData(0); + } +} + + +DiColorImage::DiColorImage(const DiColorImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate, + const int aspect) + : DiImage(image, dest_cols, dest_rows, aspect), + RGBColorModel(image->RGBColorModel), + InterData(NULL), + OutputData(NULL) +{ + if (image->InterData != NULL) + { + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiColorScaleTemplate(image->InterData, image->Columns, image->Rows, left_pos, top_pos, + src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, image->BitsPerSample, interpolate); + break; + case EPR_Uint16: + InterData = new DiColorScaleTemplate(image->InterData, image->Columns, image->Rows, left_pos, top_pos, + src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, image->BitsPerSample, interpolate); + break; + case EPR_Uint32: + InterData = new DiColorScaleTemplate(image->InterData, image->Columns, image->Rows, left_pos, top_pos, + src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, image->BitsPerSample, interpolate); + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + checkInterData(0); + } +} + + +DiColorImage::DiColorImage(const DiColorImage *image, + const int horz, + const int vert) + : DiImage(image), + RGBColorModel(image->RGBColorModel), + InterData(NULL), + OutputData(NULL) +{ + if (image->InterData != NULL) + { + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiColorFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + case EPR_Uint16: + InterData = new DiColorFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + case EPR_Uint32: + InterData = new DiColorFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + checkInterData(0); + } +} + + +DiColorImage::DiColorImage(const DiColorImage *image, + const int degree) + : DiImage(image, degree), + RGBColorModel(image->RGBColorModel), + InterData(NULL), + OutputData(NULL) +{ + if (image->InterData != NULL) + { + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiColorRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + case EPR_Uint16: + InterData = new DiColorRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + case EPR_Uint32: + InterData = new DiColorRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + checkInterData(0); + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiColorImage::~DiColorImage() +{ + delete InterData; + delete OutputData; +} + + +/*********************************************************************/ + + +int DiColorImage::checkInterData(const int mode) +{ + if (InterData == NULL) + { + if (ImageStatus == EIS_Normal) + { + ImageStatus = EIS_MemoryFailure; + DCMIMAGE_ERROR("can't allocate memory for inter-representation"); + } else + ImageStatus = EIS_InvalidImage; + } + else if (InterData->getData() == NULL) + ImageStatus = EIS_InvalidImage; + else if (mode && (ImageStatus == EIS_Normal) && isOriginal /* do not check derived images */) + { + const unsigned long count = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows) * NumberOfFrames; + if ((InterData->getInputCount() != count) && ((InterData->getInputCount() >> 1) != ((count + 1) >> 1))) + { + DCMIMAGE_WARN("computed (" << count << ") and stored (" << InterData->getInputCount() + << ") " << "pixel count differ"); + } + } + return (ImageStatus == EIS_Normal); +} + + +void DiColorImage::deleteOutputData() +{ + delete OutputData; + OutputData = NULL; +} + + +unsigned long DiColorImage::getOutputDataSize(const int bits) const +{ + unsigned long result = 0; + if ((ImageStatus == EIS_Normal) && (bits > 0) && (bits <= MAX_BITS)) + { + int bytesPerPixel = 1; + if (bits > 16) + bytesPerPixel = 4; + else if (bits > 8) + bytesPerPixel = 2; + /* compute number of bytes required to store a rendered frame */ + result = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows) * 3 /*samples*/ * bytesPerPixel; + } + return result; +} + + +const void *DiColorImage::getOutputData(const unsigned long frame, + const int bits, + const int planar) +{ + return getData(NULL, 0, frame, bits, planar); +} + + +int DiColorImage::getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar) +{ + return (getData(buffer, size, frame, bits, planar) != NULL); +} + + +const void *DiColorImage::getData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar) +{ + if ((InterData != NULL) && (ImageStatus == EIS_Normal) && (frame < NumberOfFrames) && (bits > 0) && (bits <= MAX_BITS)) + { + if ((buffer == NULL) || (size >= getOutputDataSize(bits))) + { + deleteOutputData(); // delete old image data + const unsigned long count = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + const int inverse = (Polarity == EPP_Reverse); + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + if (bits <= 8) + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + else if (bits <= 16) + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + else + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + break; + case EPR_Uint16: + if (bits <= 8) + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + else if (bits <= 16) + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + else + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + break; + case EPR_Uint32: + if (bits <= 8) + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + else if (bits <= 16) + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + else + OutputData = new DiColorOutputPixelTemplate(buffer, InterData, count, frame, + getBits(), bits, planar, inverse); + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + if (OutputData == NULL) + { + ImageStatus = EIS_MemoryFailure; + DCMIMAGE_ERROR("can't allocate memory for inter-representation"); + } + else + return OutputData->getData(); + } else { + DCMIMAGE_ERROR("given output buffer is too small (only " << size << " bytes)"); + } + } + return NULL; +} + + +const void *DiColorImage::getOutputPlane(const int plane) const +{ + if (OutputData != NULL) + return OutputData->getPlane(plane); + return NULL; +} + + +DiImage *DiColorImage::createImage(const unsigned long fstart, + const unsigned long fcount) const +{ + DiImage *image = new DiColorImage(this, fstart, fcount); + return image; +} + + +DiImage *DiColorImage::createScale(const signed long left_pos, + const signed long top_pos, + const unsigned long src_cols, + const unsigned long src_rows, + const unsigned long dest_cols, + const unsigned long dest_rows, + const int interpolate, + const int aspect, + const Uint16 /*pvalue*/) const +{ + DiImage *image = new DiColorImage(this, left_pos, top_pos, OFstatic_cast(Uint16, src_cols), OFstatic_cast(Uint16, src_rows), + OFstatic_cast(Uint16, dest_cols), OFstatic_cast(Uint16, dest_rows), interpolate, aspect); + return image; +} + + +int DiColorImage::flip(const int horz, + const int vert) +{ + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + case EPR_Uint16: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + case EPR_Uint32: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + return 1; +} + + +DiImage *DiColorImage::createFlip(const int horz, + const int vert) const +{ + DiImage *image = new DiColorImage(this, horz, vert); + return image; +} + + +int DiColorImage::rotate(const int degree) +{ + const Uint16 old_cols = Columns; // save old values + const Uint16 old_rows = Rows; + DiImage::rotate(degree); // swap width and height if necessary + if ((Columns > 1) && (Rows > 1)) + { + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, + NumberOfFrames, degree); + } + break; + case EPR_Uint16: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, + NumberOfFrames, degree); + } + break; + case EPR_Uint32: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, + NumberOfFrames, degree); + } + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + } + return 1; +} + + +DiImage *DiColorImage::createRotate(const int degree) const +{ + DiImage *image = new DiColorImage(this, degree); + return image; +} + + +DiImage *DiColorImage::createMono(const double red, + const double green, + const double blue) const +{ + DiImage *image = NULL; + if (RGBColorModel) + image = new DiMono2Image(this, red, green, blue); + return image; +} + + +unsigned long DiColorImage::createDIB(void *&data, + const unsigned long size, + const unsigned long frame, + const int bits, + const int upsideDown, + const int padding) +{ + if (RGBColorModel && (InterData != NULL)) + { + if (size == 0) + data = NULL; + if ((bits == 24) || (bits == 32)) + return InterData->createDIB(data, size, Columns, Rows, frame, getBits() /*fromBits*/, 8 /*toBits*/, bits /*mode*/, upsideDown, padding); + } + return 0; +} + + +unsigned long DiColorImage::createAWTBitmap(void *&data, + const unsigned long frame, + const int bits) +{ + if (RGBColorModel && (InterData != NULL) && (bits == 32)) + return InterData->createAWTBitmap(data, Columns, Rows, frame, getBits() /*fromBits*/, 8 /*toBits*/); + return 0; +} + + +void DiColorImage::updateImagePixelModuleAttributes(DcmItem &dataset) +{ + DiImage::updateImagePixelModuleAttributes(dataset); + /* remove color palette LUTs (if any) */ + delete dataset.remove(DCM_PaletteColorLookupTableUID); + delete dataset.remove(DCM_RedPaletteColorLookupTableDescriptor); + delete dataset.remove(DCM_GreenPaletteColorLookupTableDescriptor); + delete dataset.remove(DCM_BluePaletteColorLookupTableDescriptor); + delete dataset.remove(DCM_RedPaletteColorLookupTableData); + delete dataset.remove(DCM_GreenPaletteColorLookupTableData); + delete dataset.remove(DCM_BluePaletteColorLookupTableData); + delete dataset.remove(DCM_SegmentedRedPaletteColorLookupTableData); + delete dataset.remove(DCM_SegmentedGreenPaletteColorLookupTableData); + delete dataset.remove(DCM_SegmentedBluePaletteColorLookupTableData); +} + + +// --- write current image to DICOM dataset + +int DiColorImage::writeImageToDataset(DcmItem &dataset, + const int /*mode*/, + const int planar) +{ + int result = 0; + if ((InterData != NULL) && (InterData->getCount() > 0) && (BitsPerSample > 0)) + { + /* create new pixel data element */ + DcmPixelData *pixel = new DcmPixelData(DCM_PixelData); + if (pixel != NULL) + { + OFBool ok = OFFalse; + /* number of samples */ + const unsigned long count = InterData->getCount() * 3 /*planes*/; + /* number of pixels per frame */ + const unsigned long fcount = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + /* determine planar configuration */ + const int planarConfig = (planar == 2) ? InterData->getPlanarConfiguration() : ((planar == 0) ? 0 : 1); + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + case EPR_Sint8: + { + /* write 8 bit pixel data (OB) */ + Uint8 *data = NULL; + if (pixel->createUint8Array(count, data).good() && + InterData->getPixelData(OFstatic_cast(void *, data), OFstatic_cast(size_t, count), fcount, NumberOfFrames, planarConfig)) + { + ok = OFTrue; + } + break; + } + case EPR_Uint16: + case EPR_Sint16: + { + /* write 16 bit pixel data (OW) */ + Uint16 *data = NULL; + if (pixel->createUint16Array(count, data).good() && + InterData->getPixelData(OFstatic_cast(void *, data), OFstatic_cast(size_t, count), fcount, NumberOfFrames, planarConfig)) + { + ok = OFTrue; + } + break; + } + case EPR_Uint32: + case EPR_Sint32: + { + /* write 32 bit pixel data (OW) */ + Uint16 *data = NULL; + if (pixel->createUint16Array(count * 2 /*double-words*/, data).good() && + InterData->getPixelData(OFstatic_cast(void *, data), OFstatic_cast(size_t, count), fcount, NumberOfFrames, planarConfig)) + { + ok = OFTrue; + } + break; + } + } + /* check whether pixel data has been written and insert element into the dataset */ + if (ok && dataset.insert(pixel, OFTrue /*replaceOld*/).good()) + { + char numBuf[20]; + /* set color model */ + if (getInternalColorModel() == EPI_YBR_Full) + dataset.putAndInsertString(DCM_PhotometricInterpretation, "YBR_FULL"); + else + dataset.putAndInsertString(DCM_PhotometricInterpretation, "RGB"); + /* set image resolution */ + dataset.putAndInsertUint16(DCM_Columns, Columns); + dataset.putAndInsertUint16(DCM_Rows, Rows); +#ifdef PRId32 + sprintf(numBuf, "%" PRId32, NumberOfFrames); +#elif SIZEOF_LONG == 8 + sprintf(numBuf, "%d", NumberOfFrames); +#else + sprintf(numBuf, "%ld", NumberOfFrames); +#endif + dataset.putAndInsertString(DCM_NumberOfFrames, numBuf); + dataset.putAndInsertUint16(DCM_SamplesPerPixel, 3); + dataset.putAndInsertUint16(DCM_PlanarConfiguration, planarConfig); + /* set pixel encoding and data */ + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + dataset.putAndInsertUint16(DCM_BitsAllocated, 8); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 0); + break; + case EPR_Sint8: + dataset.putAndInsertUint16(DCM_BitsAllocated, 8); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 1); + break; + case EPR_Uint16: + dataset.putAndInsertUint16(DCM_BitsAllocated, 16); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 0); + break; + case EPR_Sint16: + dataset.putAndInsertUint16(DCM_BitsAllocated, 16); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 1); + break; + case EPR_Uint32: + dataset.putAndInsertUint16(DCM_BitsAllocated, 32); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 0); + break; + case EPR_Sint32: + dataset.putAndInsertUint16(DCM_BitsAllocated, 32); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 1); + break; + } + dataset.putAndInsertUint16(DCM_BitsStored, BitsPerSample); + dataset.putAndInsertUint16(DCM_HighBit, BitsPerSample - 1); + /* update other DICOM attributes */ + updateImagePixelModuleAttributes(dataset); + result = 1; + } else { + /* pixel data element has not been inserted, thus delete it */ + delete pixel; + } + } + } + return result; +} + + +int DiColorImage::writePPM(STD_NAMESPACE ostream& stream, + const unsigned long frame, + const int bits) +{ + if (RGBColorModel) + { + getOutputData(frame, bits); + if (OutputData != NULL) + { + stream << "P3" << OFendl; + stream << Columns << " " << Rows << OFendl; + stream << DicomImageClass::maxval(bits) << OFendl; + int ok = OutputData->writePPM(stream); + deleteOutputData(); + return ok; + } + } + return 0; +} + + +int DiColorImage::writePPM(FILE *stream, + const unsigned long frame, + const int bits) +{ + if (RGBColorModel) + { + if (stream != NULL) + { + getOutputData(frame, bits); + if (OutputData != NULL) + { + fprintf(stream, "P3\n%u %u\n%lu\n", Columns, Rows, DicomImageClass::maxval(bits)); + int ok = OutputData->writePPM(stream); + deleteOutputData(); + return ok; + } + } + } + return 0; +} + + +int DiColorImage::writeRawPPM(FILE *stream, + const unsigned long frame, + const int bits) +{ + if (RGBColorModel) + { + if ((stream != NULL) && (bits <= MAX_RAWPPM_BITS)) + { + getOutputData(frame, bits); + if ((OutputData != NULL) && (OutputData->getData() != NULL)) + { + fprintf(stream, "P6\n%u %u\n%lu\n", Columns, Rows, DicomImageClass::maxval(bits)); + const size_t count = OFstatic_cast(size_t, OutputData->getCount()); + if (fwrite(OutputData->getData(), OutputData->getItemSize(), count, stream) == count) + return 1; + } + } + } + return 0; +} + + +int DiColorImage::writeBMP(FILE *stream, + const unsigned long frame, + const int bits) +{ + if (RGBColorModel && ((bits == 0) || (bits == 24) || (bits == 32))) + return DiImage::writeBMP(stream, frame, (bits == 0) ? 24 : bits); + return 0; +} diff --git a/dcmimage/libsrc/dicoopx.cc b/dcmimage/libsrc/dicoopx.cc new file mode 100644 index 00000000..451c6f87 --- /dev/null +++ b/dcmimage/libsrc/dicoopx.cc @@ -0,0 +1,55 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorOutputPixel (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dicoopx.h" +#include "dcmtk/dcmimgle/dipixel.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiColorOutputPixel::DiColorOutputPixel(const DiPixel *pixel, + const unsigned long size, + const unsigned long frame) + : Count(0), + FrameSize(size) +{ + if (pixel != NULL) + { + if (pixel->getCount() > frame * size) + Count = pixel->getCount() - frame * size; // number of pixels remaining for this 'frame' + } + if (Count > FrameSize) + Count = FrameSize; // cut off at frame 'size' +} + + +/*--------------* + * destructor * + *--------------*/ + +DiColorOutputPixel::~DiColorOutputPixel() +{ +} diff --git a/dcmimage/libsrc/dicopx.cc b/dcmimage/libsrc/dicopx.cc new file mode 100644 index 00000000..e1c279dc --- /dev/null +++ b/dcmimage/libsrc/dicopx.cc @@ -0,0 +1,106 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomColorPixel (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +#include "dcmtk/dcmimage/dicopx.h" +#include "dcmtk/dcmimage/diqttype.h" +#include "dcmtk/dcmimgle/dimopx.h" +#include "dcmtk/dcmimgle/diinpx.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiColorPixel::DiColorPixel(const DiDocument *docu, + const DiInputPixel *pixel, + const Uint16 samples, + EI_Status &status, + const Uint16 sample_rate) + : DiPixel(0), + PlanarConfiguration(0) +{ + if (docu != NULL) + { + Uint16 us = 0; + if (docu->getValue(DCM_SamplesPerPixel, us)) + { + if (us != samples) + { + DCMIMAGE_WARN("invalid value for 'SamplesPerPixel' (" << us + << ") ... assuming " << samples); + } + if (docu->getValue(DCM_PlanarConfiguration, us)) + { + /* only use Planar Configuration attribute if there are multiple planes */ + if (samples > 1) + { + PlanarConfiguration = (us == 1); + if ((us != 0) && (us != 1)) + { + DCMIMAGE_WARN("invalid value for 'PlanarConfiguration' (" << us + << ") ... assuming 'color-by-pixel' (0)"); + } + } else { + DCMIMAGE_WARN("unexpected attribute 'PlanarConfiguration' (" << us + << ") ... ignoring"); + } + } + else if (samples > 1) + { + status = EIS_MissingAttribute; + DCMIMAGE_ERROR("mandatory attribute 'PlanarConfiguration' is missing"); + return; + } + if (pixel != NULL) + { + // number of pixels (per plane) computed from the length of the PixelData attribute + InputCount = pixel->getPixelCount() / ((sample_rate == 0) ? samples : sample_rate); + // number of pixels allocated for the intermediate buffer + Count = pixel->getComputedCount() / ((sample_rate == 0) ? samples : sample_rate); + } + } else { + status = EIS_MissingAttribute; + DCMIMAGE_ERROR("mandatory attribute 'SamplesPerPixel' is missing"); + } + } +} + +DiColorPixel::DiColorPixel(const DiColorPixel *pixel, + const unsigned long count) + : DiPixel(count, pixel->InputCount), + PlanarConfiguration(pixel->PlanarConfiguration) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiColorPixel::~DiColorPixel() +{ +} diff --git a/dcmimage/libsrc/dihsvimg.cc b/dcmimage/libsrc/dihsvimg.cc new file mode 100644 index 00000000..49e4c1ae --- /dev/null +++ b/dcmimage/libsrc/dihsvimg.cc @@ -0,0 +1,103 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomHSVImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimage/dihsvimg.h" +#include "dcmtk/dcmimage/dihsvpxt.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diinpx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiHSVImage::DiHSVImage(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 3) +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + Init(); // create intermediate representation + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiHSVImage::~DiHSVImage() +{ +} + + +/*********************************************************************/ + + +void DiHSVImage::Init() +{ + /* number of pixels per plane */ + const unsigned long planeSize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiHSVPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint8: + InterData = new DiHSVPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Uint16: + InterData = new DiHSVPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint16: + InterData = new DiHSVPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Uint32: + InterData = new DiHSVPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint32: + InterData = new DiHSVPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + } + deleteInputData(); + checkInterData(); +} + + +/*********************************************************************/ + + +int DiHSVImage::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/libsrc/dilogger.cc b/dcmimage/libsrc/dilogger.cc new file mode 100644 index 00000000..e497115b --- /dev/null +++ b/dcmimage/libsrc/dilogger.cc @@ -0,0 +1,32 @@ +/* + * + * Copyright (C) 2009-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: Logger (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/dilogger.h" + + +/*--------------------* + * global variables * + *--------------------*/ + +OFLogger DCM_dcmimageLogger = OFLog::getLogger("dcmtk.dcmimage"); diff --git a/dcmimage/libsrc/dipalimg.cc b/dcmimage/libsrc/dipalimg.cc new file mode 100644 index 00000000..ab0a34e6 --- /dev/null +++ b/dcmimage/libsrc/dipalimg.cc @@ -0,0 +1,169 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomPaletteImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dctag.h" + +#include "dcmtk/dcmimgle/didocu.h" +#include "dcmtk/dcmimage/dipalimg.h" +#include "dcmtk/dcmimage/dipalpxt.h" +#include "dcmtk/dcmimage/diqttype.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diluptab.h" +#include "dcmtk/dcmimgle/diinpx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiPaletteImage::DiPaletteImage(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 1), + Palette() // initializes the three color palettes to NULL +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + if (BitsStored <= MAX_TABLE_ENTRY_SIZE) + { + const EL_BitsPerTableEntry descMode = (docu->getFlags() & CIF_CheckLutBitDepth) ? ELM_CheckValue : ELM_UseValue; + /* wrong palette attribute tags used */ + if (Document->getFlags() & CIF_WrongPaletteAttributeTags) + { + Palette[0] = new DiLookupTable(Document, DCM_RETIRED_LargeRedPaletteColorLookupTableDescriptor, + DCM_RETIRED_LargeRedPaletteColorLookupTableData, DCM_UndefinedTagKey /*explanation*/, descMode, &ImageStatus); + Palette[1] = new DiLookupTable(Document, DCM_RETIRED_LargeGreenPaletteColorLookupTableDescriptor, + DCM_RETIRED_LargeGreenPaletteColorLookupTableData, DCM_UndefinedTagKey /*explanation*/, descMode, &ImageStatus); + Palette[2] = new DiLookupTable(Document, DCM_RETIRED_LargeBluePaletteColorLookupTableDescriptor, + DCM_RETIRED_LargeBluePaletteColorLookupTableData, DCM_UndefinedTagKey /*explanation*/, descMode, &ImageStatus); + } else { + const Uint16 *dummy = NULL; + /* check for (non-empty) segmented palette */ + if ((Document->getValue(DCM_SegmentedRedPaletteColorLookupTableData, dummy) > 0) || + (Document->getValue(DCM_SegmentedGreenPaletteColorLookupTableData, dummy) > 0) || + (Document->getValue(DCM_SegmentedBluePaletteColorLookupTableData, dummy) > 0)) + { + DCMIMAGE_WARN("segmented palettes not yet supported ... ignoring"); + } + /* read data from non-segmented palettes (if present) */ + Palette[0] = new DiLookupTable(Document, DCM_RedPaletteColorLookupTableDescriptor, + DCM_RedPaletteColorLookupTableData, DCM_UndefinedTagKey /*explanation*/, descMode, &ImageStatus); + Palette[1] = new DiLookupTable(Document, DCM_GreenPaletteColorLookupTableDescriptor, + DCM_GreenPaletteColorLookupTableData, DCM_UndefinedTagKey /*explanation*/, descMode, &ImageStatus); + Palette[2] = new DiLookupTable(Document, DCM_BluePaletteColorLookupTableDescriptor, + DCM_BluePaletteColorLookupTableData, DCM_UndefinedTagKey /*explanation*/, descMode, &ImageStatus); + } + if ((ImageStatus == EIS_Normal) && (Palette[0] != NULL) && (Palette[1] != NULL) && (Palette[2] != NULL)) + { + BitsPerSample = 0; + /* determine the maximum value for bits stored of the three lookup tables */ + for (int jj = 0; jj < 3; jj++) + { + if (Palette[jj]->getBits() > OFstatic_cast(Uint16, BitsPerSample)) + BitsPerSample = Palette[jj]->getBits(); + } + if ((BitsPerSample < 1) || (BitsPerSample > MAX_TABLE_ENTRY_SIZE)) + { + DCMIMAGE_WARN("invalid value for 'BitsPerSample' (" << BitsPerSample + << ") computed from color palettes"); + } + Init(); // create intermediate representation + } + } + else + { + ImageStatus = EIS_InvalidValue; + DCMIMAGE_ERROR("invalid value for 'BitsStored' (" << BitsStored << ") " + << "... exceeds maximum palette entry size of " << MAX_TABLE_ENTRY_SIZE << " bits"); + } + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiPaletteImage::~DiPaletteImage() +{ + delete Palette[0]; + delete Palette[1]; + delete Palette[2]; +} + + +/*********************************************************************/ + + +void DiPaletteImage::Init() +{ + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + if (BitsPerSample <= 8) + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + else + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + break; + case EPR_Sint8: + if (BitsPerSample <= 8) + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + else + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + break; + case EPR_Uint16: + if (BitsPerSample <= 8) + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + else + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + break; + case EPR_Sint16: + if (BitsPerSample <= 8) + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + else + InterData = new DiPalettePixelTemplate(Document, InputData, Palette, ImageStatus); + break; + default: + DCMIMAGE_WARN("invalid value for inter-representation"); + } + deleteInputData(); + checkInterData(); +} + + +/*********************************************************************/ + + +int DiPaletteImage::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/libsrc/dipipng.cc b/dcmimage/libsrc/dipipng.cc new file mode 100644 index 00000000..162045d6 --- /dev/null +++ b/dcmimage/libsrc/dipipng.cc @@ -0,0 +1,235 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Alexander Haderer + * + * Purpose: Implements PNG interface for plugable image formats + * + */ + + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_LIBPNG + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmimgle/diimage.h" +#include "dcmtk/dcmimage/dipipng.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version */ + +BEGIN_EXTERN_C +#ifdef HAVE_LIBPNG_PNG_H +#include +#else +#include +#endif +END_EXTERN_C + + +DiPNGPlugin::DiPNGPlugin() +: DiPluginFormat() +, interlaceType(E_pngInterlaceAdam7) +, metainfoType(E_pngFileMetainfo) +, bitsPerSample(8) +{ +} + + +DiPNGPlugin::~DiPNGPlugin() +{ +} + + +int DiPNGPlugin::write( + DiImage *image, + FILE *stream, + const unsigned long frame) const +{ + volatile int result = 0; // gcc -W requires volatile here because of longjmp + if ((image != NULL) && (stream != NULL)) + { + /* create bitmap with 8 or 16 bits per sample */ + const int bit_depth = bitsPerSample; + const void *data = image->getOutputData(frame, bit_depth /*bits*/, 0 /*planar*/); + if (data != NULL) + { + png_struct *png_ptr = NULL; + png_info *info_ptr = NULL; + png_byte *pix_ptr = NULL; + + png_byte ** volatile row_ptr = NULL; + volatile png_textp text_ptr = NULL; + png_time ptime; + + const int width = image->getColumns(); + const int height = image->getRows(); + int color_type; + int bpp; // bytesperpixel + + int row; + + // create png write struct + png_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL ); + if( png_ptr == NULL ) { + return 0; + } + + // create png info struct + info_ptr = png_create_info_struct( png_ptr ); + if( info_ptr == NULL ) { + png_destroy_write_struct( &png_ptr, NULL ); + return 0; + } + + // setjmp stuff for png lib + if( setjmp(png_jmpbuf(png_ptr) ) ) { + png_destroy_write_struct( &png_ptr, NULL ); + if( row_ptr ) delete[] row_ptr; + if( text_ptr ) delete[] text_ptr; + return 0; + } + + if( (image->getInternalColorModel() == EPI_Monochrome1) || + (image->getInternalColorModel() == EPI_Monochrome2) ) + { + color_type = PNG_COLOR_TYPE_GRAY; + bpp = bit_depth / 8; + } else { + color_type = PNG_COLOR_TYPE_RGB; + bpp = 3 * bit_depth / 8; + } + + int opt_interlace = 0; + switch (interlaceType) { + case E_pngInterlaceAdam7: + opt_interlace = PNG_INTERLACE_ADAM7; + break; + case E_pngInterlaceNone: + opt_interlace = PNG_INTERLACE_NONE; + break; + } + + // init png io structure + png_init_io( png_ptr, stream ); + + // set write mode + png_set_IHDR( png_ptr, info_ptr, width, height, bit_depth, color_type, + opt_interlace, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + // set text & time + if( metainfoType == E_pngFileMetainfo ) { + text_ptr = new png_text[3]; + if( text_ptr == NULL ) { + png_destroy_write_struct( &png_ptr, NULL ); + return result; + } + text_ptr[0].key = OFconst_cast(char *, "Title"); + text_ptr[0].text = OFconst_cast(char *, "Converted DICOM Image"); + text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[1].key = OFconst_cast(char *, "Software"); + text_ptr[1].text = OFconst_cast(char *, "OFFIS DCMTK"); + text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[2].key = OFconst_cast(char *, "Version"); + text_ptr[2].text = OFconst_cast(char *, OFFIS_DCMTK_VERSION); + text_ptr[2].compression = PNG_TEXT_COMPRESSION_NONE; +#ifdef PNG_iTXt_SUPPORTED + text_ptr[0].lang = NULL; + text_ptr[1].lang = NULL; + text_ptr[2].lang = NULL; +#endif + png_set_text( png_ptr, info_ptr, text_ptr, 3 ); + + png_convert_from_time_t( &ptime, time(NULL) ); + png_set_tIME( png_ptr, info_ptr, &ptime ); + } + + // write header + png_write_info( png_ptr, info_ptr ); + row_ptr = new png_bytep[height]; + if( row_ptr == NULL ) { + png_destroy_write_struct( &png_ptr, NULL ); + if( text_ptr ) delete[] text_ptr; + return result; + } + for( row=0, pix_ptr=OFstatic_cast(png_byte*, OFconst_cast(void*, data)); + row + +#ifdef HAVE_WINDOWS_H +#include /* for _get_osfhandle() */ +#endif +END_EXTERN_C + + +DiTIFFPlugin::DiTIFFPlugin() +: DiPluginFormat() +, compressionType(E_tiffLZWCompression) +, predictor(E_tiffLZWPredictorDefault) +, rowsPerStrip(0) +{ +} + + +DiTIFFPlugin::~DiTIFFPlugin() +{ +} + + +int DiTIFFPlugin::write( + DiImage *image, + FILE *stream, + const unsigned long frame) const +{ + int result = 0; + if ((image != NULL) && (stream != NULL)) + { + int stream_fd = fileno(stream); + + +#ifdef HAVE_WINDOWS_H + +#if TIFFLIB_VERSION < 20050912 +#error TIFF library versions prior to 3.7.4 are not supported by DCMTK on Win32 - critical API change! +#endif + +/* Older versions of libtiff expected a Win32 HANDLE when compiled on Windows + * instead of a file descriptor. The code below was needed to make that work. + * Libtiff version 3.7.4 and newer are known to use a file descriptor instead, + * but it is not completely clear at which libtiff release the API change happened. + * + * #ifdef __CYGWIN__ + * stream_fd = OFstatic_cast(int, get_osfhandle(stream_fd)); + * #else + * stream_fd =OFstatic_cast(int, _get_osfhandle(stream_fd)); + * #endif + */ + +#elif TIFFLIB_VERSION < 20041016 +#error TIFF library versions prior to 3.7.0 are not supported by DCMTK - TIFFCleanup is missing! +#endif + + /* create bitmap with 8 bits per sample */ + void *data = OFconst_cast(void *, image->getOutputData(frame, 8 /*bits*/, 0 /*planar*/)); + if (data != NULL) + { + OFBool isMono = (image->getInternalColorModel() == EPI_Monochrome1) || (image->getInternalColorModel() == EPI_Monochrome2); + Uint16 rows = image->getRows(); + Uint16 cols = image->getColumns(); + + short photometric = isMono ? PHOTOMETRIC_MINISBLACK : PHOTOMETRIC_RGB; + short samplesperpixel = isMono ? 1 : 3; + unsigned long bytesperrow = cols * samplesperpixel; + if (bytesperrow > 0) + { + short opt_predictor = 0; + switch (predictor) + { + case E_tiffLZWPredictorDefault: + opt_predictor = 0; + break; + case E_tiffLZWPredictorNoPrediction: + opt_predictor = 1; + break; + case E_tiffLZWPredictorHDifferencing: + opt_predictor = 2; + break; + } + + unsigned short opt_compression = COMPRESSION_NONE; + switch (compressionType) + { + case E_tiffLZWCompression: + opt_compression = COMPRESSION_LZW; + break; + case E_tiffPackBitsCompression: + opt_compression = COMPRESSION_PACKBITS; + break; + case E_tiffNoCompression: + opt_compression = COMPRESSION_NONE; + break; + } + + long opt_rowsperstrip = OFstatic_cast(long, rowsPerStrip); + if (opt_rowsperstrip <= 0) opt_rowsperstrip = 8192 / bytesperrow; + if (opt_rowsperstrip == 0) opt_rowsperstrip++; + + OFBool OK = OFTrue; + unsigned char *bytedata = OFstatic_cast(unsigned char *, data); + TIFF *tif = TIFFFdOpen(stream_fd, "TIFF", "w"); + if (tif) + { + /* Set TIFF parameters. */ + TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, cols); + TIFFSetField(tif, TIFFTAG_IMAGELENGTH, rows); + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(tif, TIFFTAG_COMPRESSION, opt_compression); + if (opt_compression == COMPRESSION_LZW && opt_predictor != 0) + TIFFSetField(tif, TIFFTAG_PREDICTOR, opt_predictor); + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric); + TIFFSetField(tif, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB); + TIFFSetField(tif, TIFFTAG_DOCUMENTNAME, "unnamed"); + TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, "converted DICOM image"); + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, samplesperpixel); + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, opt_rowsperstrip); + /* TIFFSetField(tif, TIFFTAG_STRIPBYTECOUNTS, rows / opt_rowsperstrip); */ + TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + + /* Now write the TIFF data. */ + unsigned long offset = 0; + for (Uint16 i=0; (i < rows) && OK; i++) + { + if (TIFFWriteScanline(tif, bytedata + offset, i, 0) < 0) OK = OFFalse; + offset += bytesperrow; + } + TIFFFlushData(tif); + /* Clean up internal structures and free memory. + * However, the file will be closed by the caller, therefore + * TIFFClose(tif) is not called. + */ + TIFFCleanup(tif); + } + if (OK) result = 1; + } + } + + /* delete pixel data */ + image->deleteOutputData(); + } + return result; +} + + +void DiTIFFPlugin::setCompressionType(DiTIFFCompression ctype) +{ + compressionType = ctype; +} + +void DiTIFFPlugin::setLZWPredictor(DiTIFFLZWPredictor pred) +{ + predictor = pred; +} + +void DiTIFFPlugin::setRowsPerStrip(unsigned long rows) +{ + rowsPerStrip = rows; +} + +OFString DiTIFFPlugin::getLibraryVersionString() +{ + /* use first line only, omit copyright information */ + OFString versionStr = TIFFGetVersion(); + const size_t pos = versionStr.find('\n'); + if (pos != OFString_npos) + versionStr.erase(pos); + return versionStr; +} + +#else /* WITH_LIBTIFF */ + +int dipitiff_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmimage/libsrc/diqtctab.cc b/dcmimage/libsrc/diqtctab.cc new file mode 100644 index 00000000..3e5d385c --- /dev/null +++ b/dcmimage/libsrc/diqtctab.cc @@ -0,0 +1,546 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantColorTable + * + */ + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/diqtctab.h" +#include "dcmtk/dcmimage/diqtpbox.h" +#include "dcmtk/dcmdata/dcerror.h" /* for EC_IllegalCall */ +#include "dcmtk/dcmdata/dcelem.h" /* for DcmElement */ +#include "dcmtk/dcmdata/dcitem.h" /* for DcmItem */ +#include "dcmtk/dcmdata/dcvrus.h" /* for DcmUnsignedShort */ +#include "dcmtk/dcmdata/dcvrobow.h" /* for DcmOtherByteOtherWord */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary() */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcuid.h" /* for OFFIS_DCMTK_VERSION */ + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +/* ------------------------------------------------------------ */ + +// static comparison functions for qsort + +BEGIN_EXTERN_C +static int redcompare(const void *x1, const void *x2) +{ + return OFstatic_cast(int, (*OFstatic_cast(const DcmQuantHistogramItemPointer *, x1))->getRed()) + - OFstatic_cast(int, (*OFstatic_cast(const DcmQuantHistogramItemPointer *, x2))->getRed()); +} + +static int greencompare(const void *x1, const void *x2) +{ + return OFstatic_cast(int, (*OFstatic_cast(const DcmQuantHistogramItemPointer *, x1))->getGreen()) + - OFstatic_cast(int, (*OFstatic_cast(const DcmQuantHistogramItemPointer *, x2))->getGreen()); +} + +static int bluecompare(const void *x1, const void *x2) +{ + return OFstatic_cast(int, (*OFstatic_cast(const DcmQuantHistogramItemPointer *, x1))->getBlue()) + - OFstatic_cast(int, (*OFstatic_cast(const DcmQuantHistogramItemPointer *, x2))->getBlue()); +} +END_EXTERN_C + +/* ------------------------------------------------------------ */ + +DcmQuantColorTable::DcmQuantColorTable() +: array(NULL) +, numColors(0) +, maxval(0) +{ +} + + +DcmQuantColorTable::~DcmQuantColorTable() +{ + clear(); +} + + +void DcmQuantColorTable::clear() +{ + if (array) + { + for (unsigned long i=0; i < numColors; i++) delete array[i]; + delete[] array; + array = NULL; + } + numColors = 0; + maxval = 0; +} + + +OFCondition DcmQuantColorTable::computeHistogram( + DicomImage& image, + unsigned long maxcolors) +{ + // reset object to initial state + clear(); + + // compute initial maxval + maxval = OFstatic_cast(DcmQuantComponent, -1); + DcmQuantColorHashTable *htable = NULL; + + // attempt to make a histogram of the colors, unclustered. + // If at first we don't succeed, lower maxval to increase color + // coherence and try again. This will eventually terminate. + OFBool done = OFFalse; + while (! done) + { + htable = new DcmQuantColorHashTable(); + numColors = htable->addToHashTable(image, maxval, maxcolors); + if (numColors > 0) done = OFTrue; + else + { + delete htable; + maxval = maxval/2; + } + } + + numColors = htable->createHistogram(array); + delete htable; + return EC_Normal; +} + + +OFCondition DcmQuantColorTable::medianCut( + DcmQuantColorTable& histogram, + unsigned long sum, + unsigned long theMaxval, + unsigned long numberOfColors, + DcmLargestDimensionType largeType, + DcmRepresentativeColorType repType) +{ + // reset object to initial state + clear(); + + // update maxval + maxval = theMaxval; + + // initialize color table + array = new DcmQuantHistogramItemPointer[numberOfColors]; + for (unsigned int xx=0; xx < numberOfColors; xx++) array[xx] = new DcmQuantHistogramItem(); + numColors = numberOfColors; + + int i; + unsigned int bi; + DcmQuantPixelBoxArray bv(numberOfColors); + + // Set up the initial box. + bv[0].ind = 0; + bv[0].colors = OFstatic_cast(int, histogram.getColors()); + bv[0].sum = sum; + unsigned int boxes = 1; + + // Main loop: split boxes until we have enough. + while ( boxes < numberOfColors ) + { + int indx, clrs; + unsigned long sm; + int minr, maxr, ming, maxg, minb, maxb, v; + unsigned long halfsum, lowersum; + + // Find the first splittable box. + for ( bi = 0; bi < boxes; ++bi ) + if ( bv[bi].colors >= 2 ) + break; + if ( bi == boxes ) + break; /* ran out of colors! */ + indx = bv[bi].ind; + clrs = bv[bi].colors; + sm = bv[bi].sum; + + // Go through the box finding the minimum and maximum of each + // component - the boundaries of the box. + minr = maxr = histogram.array[indx]->getRed(); + ming = maxg = histogram.array[indx]->getGreen(); + minb = maxb = histogram.array[indx]->getBlue(); + for ( i = 1; i < clrs; ++i ) + { + v = histogram.array[indx+i]->getRed(); + if ( v < minr ) minr = v; + if ( v > maxr ) maxr = v; + v = histogram.array[indx+i]->getGreen(); + if ( v < ming ) ming = v; + if ( v > maxg ) maxg = v; + v = histogram.array[indx+i]->getBlue(); + if ( v < minb ) minb = v; + if ( v > maxb ) maxb = v; + } + + /* + ** Find the largest dimension, and sort by that component. I have + ** included two methods for determining the "largest" dimension; + ** first by simply comparing the range in RGB space, and second + ** by transforming into luminosities before the comparison. + */ + if (largeType == DcmLargestDimensionType_default) + { + if ( maxr - minr >= maxg - ming && maxr - minr >= maxb - minb ) + qsort(OFreinterpret_cast(char*, &(histogram.array[indx])), clrs, sizeof(DcmQuantHistogramItemPointer), redcompare); + else if ( maxg - ming >= maxb - minb ) + qsort(OFreinterpret_cast(char*, &(histogram.array[indx])), clrs, sizeof(DcmQuantHistogramItemPointer), greencompare); + else + qsort(OFreinterpret_cast(char*, &(histogram.array[indx])), clrs, sizeof(DcmQuantHistogramItemPointer), bluecompare); + } + else // DcmLargestDimensionType_luminance + { + double rl, gl, bl; + DcmQuantPixel p; + + p.assign(maxr - minr, 0, 0); + rl = p.luminance(); + + p.assign(0, maxg - ming, 0); + gl = p.luminance(); + + p.assign(0, 0, maxb - minb); + bl = p.luminance(); + + if ( rl >= gl && rl >= bl ) + qsort(OFreinterpret_cast(char*, &(histogram.array[indx])), clrs, sizeof(DcmQuantHistogramItemPointer), redcompare); + else if ( gl >= bl ) + qsort(OFreinterpret_cast(char*, &(histogram.array[indx])), clrs, sizeof(DcmQuantHistogramItemPointer), greencompare); + else + qsort(OFreinterpret_cast(char*, &(histogram.array[indx])), clrs, sizeof(DcmQuantHistogramItemPointer), bluecompare); + } + + /* + ** Now find the median based on the counts, so that about half the + ** pixels (not colors, pixels) are in each subdivision. + */ + lowersum = histogram.array[indx]->getValue(); + halfsum = sm / 2; + for ( i = 1; i < clrs - 1; ++i ) + { + if ( lowersum >= halfsum ) + break; + lowersum += histogram.array[indx+i]->getValue(); + } + + // Split the box, and sort to bring the biggest boxes to the top. + bv[bi].colors = i; + bv[bi].sum = lowersum; + bv[boxes].ind = indx + i; + bv[boxes].colors = clrs - i; + bv[boxes].sum = sm - lowersum; + ++boxes; + bv.sort(boxes); + } + + /* + ** Ok, we've got enough boxes. Now choose a representative color for + ** each box. There are a number of possible ways to make this choice. + ** One would be to choose the center of the box; this ignores any structure + ** within the boxes. Another method would be to average all the colors in + ** the box - this is the method specified in Heckbert's paper. A third + ** method is to average all the pixels in the box. + */ + if (repType == DcmRepresentativeColorType_centerOfBox) + { + for ( bi = 0; bi < boxes; ++bi ) + { + int indx = bv[bi].ind; + int clrs = bv[bi].colors; + int minr, maxr, ming, maxg, minb, maxb, v; + + minr = maxr = histogram.array[indx]->getRed(); + ming = maxg = histogram.array[indx]->getGreen(); + minb = maxb = histogram.array[indx]->getBlue(); + for ( i = 1; i < clrs; ++i ) + { + v = histogram.array[indx+i]->getRed(); + minr = (minr < v ? minr : v); + maxr = (minr > v ? minr : v); + v = histogram.array[indx+i]->getGreen(); + ming = (ming < v ? ming : v); + maxg = (ming > v ? ming : v); + v = histogram.array[indx+i]->getBlue(); + minb = (minb < v ? minb : v); + maxb = (minb > v ? minb : v); + } + array[bi]->assign(( minr + maxr ) / 2, ( ming + maxg ) / 2, ( minb + maxb ) / 2); + } + } + else if (repType == DcmRepresentativeColorType_default) + { + for ( bi = 0; bi < boxes; ++bi ) + { + int indx = bv[bi].ind; + int clrs = bv[bi].colors; + long r = 0, g = 0, b = 0; + + for ( i = 0; i < clrs; ++i ) + { + r += histogram.array[indx+i]->getRed(); + g += histogram.array[indx+i]->getGreen(); + b += histogram.array[indx+i]->getBlue(); + } + r = r / clrs; + g = g / clrs; + b = b / clrs; + array[bi]->assign(OFstatic_cast(DcmQuantComponent, r), OFstatic_cast(DcmQuantComponent, g), OFstatic_cast(DcmQuantComponent, b)); + } + } + else // DcmRepresentativeColorType_averagePixels + { + for ( bi = 0; bi < boxes; ++bi ) + { + int indx = bv[bi].ind; + int clrs = bv[bi].colors; + unsigned long r = 0, g = 0, b = 0, sumVal = 0; + + for ( i = 0; i < clrs; ++i ) + { + r += histogram.array[indx+i]->getRed() * histogram.array[indx+i]->getValue(); + g += histogram.array[indx+i]->getGreen() * histogram.array[indx+i]->getValue(); + b += histogram.array[indx+i]->getBlue() * histogram.array[indx+i]->getValue(); + sumVal += histogram.array[indx+i]->getValue(); + } + r = r / sumVal; + if ( r > maxval ) r = maxval; /* avoid math errors */ + g = g / sumVal; + if ( g > maxval ) g = maxval; + b = b / sumVal; + if ( b > maxval ) b = maxval; + array[bi]->assign(OFstatic_cast(DcmQuantComponent, r), OFstatic_cast(DcmQuantComponent, g), OFstatic_cast(DcmQuantComponent, b)); + } + } + + // All done, now compute clusters + computeClusters(); + return EC_Normal; +} + + +void DcmQuantColorTable::computeClusters() +{ + unsigned long i; + unsigned long j; + unsigned long k=0; + int cluster; + int newdist; + int r1, g1, b1; + int r2, g2, b2; + + // initialize clusters + for (i = 0; i < numColors; ++i) array[i]->setValue(2000000000); + + for (i = 0; i < numColors-1; ++i) + { + cluster = array[i]->getValue(); + r1 = OFstatic_cast(int, array[i]->getRed()); + g1 = OFstatic_cast(int, array[i]->getGreen()); + b1 = OFstatic_cast(int, array[i]->getBlue()); + + for (j = i+1; j < numColors; ++j) + { + // compute euclidean distance between i and j + r2 = r1 - OFstatic_cast(int, array[j]->getRed()); + g2 = g1 - OFstatic_cast(int, array[j]->getGreen()); + b2 = b1 - OFstatic_cast(int, array[j]->getBlue()); + newdist = (r2*r2 + g2*g2 + b2*b2)/2; + if (newdist < cluster) + { + cluster = newdist; + k = j; + } + } + array[i]->setValue(cluster); + array[k]->setValue(cluster); + } +} + + +OFCondition DcmQuantColorTable::write( + DcmItem& target, + OFBool writeAsOW, + OFBool write16BitEntries) +{ + if (numColors == 0) return EC_IllegalCall; + + // if we're using 16 bit per sample anyway, force 16 bit palette entries + if (sizeof(DcmQuantComponent) > 1) write16BitEntries = OFTrue; + + OFCondition result = EC_Normal; + if (array) + { + // create palette color LUT descriptor + Uint16 descriptor[3]; + descriptor[0] = (numColors > 65535) ? 0 : OFstatic_cast(Uint16, numColors); // number of entries + descriptor[1] = 0; // first pixel value mapped + descriptor[2] = write16BitEntries ? 16 : 8; // bits per entry, must be 8 or 16. + + // if we're writing a 16-bit LUT with 64K entries, we must write as OW because + // otherwise the US length field will overflow when writing in explicit VR! + if ((descriptor[0] == 0) && write16BitEntries) writeAsOW = OFTrue; + + DcmElement *elem; + if (result.good()) + { + elem = new DcmUnsignedShort(DCM_RedPaletteColorLookupTableDescriptor); + if (elem) + { + result = elem->putUint16Array(descriptor, 3); + if (result.good()) result = target.insert(elem, OFTrue); + if (result.bad()) delete elem; + } else result = EC_MemoryExhausted; + } + + if (result.good()) + { + elem = new DcmUnsignedShort(DCM_GreenPaletteColorLookupTableDescriptor); + if (elem) + { + result = elem->putUint16Array(descriptor, 3); + if (result.good()) result = target.insert(elem, OFTrue); + if (result.bad()) delete elem; + } else result = EC_MemoryExhausted; + } + + if (result.good()) + { + elem = new DcmUnsignedShort(DCM_BluePaletteColorLookupTableDescriptor); + if (elem) + { + result = elem->putUint16Array(descriptor, 3); + if (result.good()) result = target.insert(elem, OFTrue); + if (result.bad()) delete elem; + } else result = EC_MemoryExhausted; + } + + // now create the LUT content + if (result.good()) + { + Uint16* rLUT = NULL; + Uint16* gLUT = NULL; + Uint16* bLUT = NULL; + unsigned long numWords = 0; + double factor = 1.0; + if (write16BitEntries) + { + numWords = numColors; + rLUT = new Uint16[numWords]; + gLUT = new Uint16[numWords]; + bLUT = new Uint16[numWords]; + factor = 65535.0 / maxval; + if (rLUT && gLUT && bLUT) + { + for (unsigned long i=0; igetRed()) * factor); + gLUT[i] = OFstatic_cast(Uint16, OFstatic_cast(double, array[i]->getGreen()) * factor); + bLUT[i] = OFstatic_cast(Uint16, OFstatic_cast(double, array[i]->getBlue()) * factor); + + // if the source data is only 8 bits per entry, replicate high and low bytes + if (sizeof(DcmQuantComponent) == 1) + { + rLUT[i] |= rLUT[i] << 8; + gLUT[i] |= gLUT[i] << 8; + bLUT[i] |= bLUT[i] << 8; + } + } + } else result = EC_MemoryExhausted; + } + else + { + // number of Uint16 words needed to store numColors Uint8 values plus padding + numWords = (numColors+1)/2; + rLUT = new Uint16[numWords]; + gLUT = new Uint16[numWords]; + bLUT = new Uint16[numWords]; + rLUT[numWords-1] = 0; + gLUT[numWords-1] = 0; + bLUT[numWords-1] = 0; + factor = 255.0 / maxval; + if (rLUT && gLUT && bLUT) + { + Uint8 *rLUT8 = OFreinterpret_cast(Uint8 *, rLUT); + Uint8 *gLUT8 = OFreinterpret_cast(Uint8 *, gLUT); + Uint8 *bLUT8 = OFreinterpret_cast(Uint8 *, bLUT); + for (unsigned long i=0; igetRed()) * factor); + gLUT8[i] = OFstatic_cast(Uint8, OFstatic_cast(double, array[i]->getGreen()) * factor); + bLUT8[i] = OFstatic_cast(Uint8, OFstatic_cast(double, array[i]->getBlue()) * factor); + } + // we have written the byte array in little endian order, now swap to US/OW if neccessary + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, rLUT, numWords*sizeof(Uint16), sizeof(Uint16)); + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, gLUT, numWords*sizeof(Uint16), sizeof(Uint16)); + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, bLUT, numWords*sizeof(Uint16), sizeof(Uint16)); + } else result = EC_MemoryExhausted; + } + + // the LUT data is prepared, now create the corresponding DICOM elements + if (result.good()) + { + if (writeAsOW) elem = new DcmOtherByteOtherWord(DcmTag(DCM_RedPaletteColorLookupTableData, EVR_OW)); + else elem = new DcmUnsignedShort(DcmTag(DCM_RedPaletteColorLookupTableData, EVR_US)); + if (elem) + { + result = elem->putUint16Array(rLUT, numWords); + if (result.good()) result = target.insert(elem, OFTrue); + if (result.bad()) delete elem; + } else result = EC_MemoryExhausted; + } + + if (result.good()) + { + if (writeAsOW) elem = new DcmOtherByteOtherWord(DcmTag(DCM_GreenPaletteColorLookupTableData, EVR_OW)); + else elem = new DcmUnsignedShort(DcmTag(DCM_GreenPaletteColorLookupTableData, EVR_US)); + if (elem) + { + result = elem->putUint16Array(gLUT, numWords); + if (result.good()) result = target.insert(elem, OFTrue); + if (result.bad()) delete elem; + } else result = EC_MemoryExhausted; + } + + if (result.good()) + { + if (writeAsOW) elem = new DcmOtherByteOtherWord(DcmTag(DCM_BluePaletteColorLookupTableData, EVR_OW)); + else elem = new DcmUnsignedShort(DcmTag(DCM_BluePaletteColorLookupTableData, EVR_US)); + if (elem) + { + result = elem->putUint16Array(bLUT, numWords); + if (result.good()) result = target.insert(elem, OFTrue); + if (result.bad()) delete elem; + } else result = EC_MemoryExhausted; + } + delete[] rLUT; + delete[] gLUT; + delete[] bLUT; + } + } else result = EC_IllegalCall; + + return result; +} + +void DcmQuantColorTable::setDescriptionString(OFString& str) const +{ + char buf[100]; + + sprintf(buf, "Converted to PALETTE COLOR %lu/0/%u with DCMTK %s", + (numColors > 65535) ? 0 : numColors, (sizeof(DcmQuantComponent) == 1) ? 8 : 16, + OFFIS_DCMTK_VERSION); + + str = buf; +} diff --git a/dcmimage/libsrc/diqtfs.cc b/dcmimage/libsrc/diqtfs.cc new file mode 100644 index 00000000..57947e64 --- /dev/null +++ b/dcmimage/libsrc/diqtfs.cc @@ -0,0 +1,101 @@ +/* + * + * Copyright (C) 2002-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantFloydSteinberg + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimage/diqtfs.h" +#include "dcmtk/ofstd/ofstd.h" /* for OFStandard::myrand_r */ + +#define INCLUDE_CTIME +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include // needed for time() +END_EXTERN_C + + +DcmQuantFloydSteinberg::DcmQuantFloydSteinberg() +: thisrerr(NULL) +, nextrerr(NULL) +, thisgerr(NULL) +, nextgerr(NULL) +, thisberr(NULL) +, nextberr(NULL) +, temperr (NULL) +, fs_direction(0) +, columns(0) +{ +} + + +DcmQuantFloydSteinberg::~DcmQuantFloydSteinberg() +{ + cleanup(); +} + + +void DcmQuantFloydSteinberg::cleanup() +{ + delete[] thisrerr; + delete[] nextrerr; + delete[] thisgerr; + delete[] nextgerr; + delete[] thisberr; + delete[] nextberr; +} + + +OFCondition DcmQuantFloydSteinberg::initialize(unsigned long cols) +{ + columns = cols; + cleanup(); + unsigned int now = OFstatic_cast(unsigned int, time(NULL)); + + /* Initialize Floyd-Steinberg error vectors. */ + thisrerr = new long[columns+2]; + if (! thisrerr) return EC_MemoryExhausted; + + nextrerr = new long[columns+2]; + if (! nextrerr) return EC_MemoryExhausted; + + thisgerr = new long[columns+2]; + if (! thisgerr) return EC_MemoryExhausted; + + nextgerr = new long[columns+2]; + if (! nextgerr) return EC_MemoryExhausted; + + thisberr = new long[columns+2]; + if (! thisberr) return EC_MemoryExhausted; + + nextberr = new long[columns+2]; + if (! nextberr) return EC_MemoryExhausted; + + for (unsigned long col = 0; col < columns + 2; ++col) + { + thisrerr[col] = OFrand_r(now) % ( DcmQuantFloydSteinbergScale * 2 ) - DcmQuantFloydSteinbergScale; + thisgerr[col] = OFrand_r(now) % ( DcmQuantFloydSteinbergScale * 2 ) - DcmQuantFloydSteinbergScale; + thisberr[col] = OFrand_r(now) % ( DcmQuantFloydSteinbergScale * 2 ) - DcmQuantFloydSteinbergScale; + /* (random errors in [-1 .. 1]) */ + } + fs_direction = 1; + + return EC_Normal; +} diff --git a/dcmimage/libsrc/diqthash.cc b/dcmimage/libsrc/diqthash.cc new file mode 100644 index 00000000..6464b90f --- /dev/null +++ b/dcmimage/libsrc/diqthash.cc @@ -0,0 +1,114 @@ +/* + * + * Copyright (C) 2002-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantColorHashTable + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimage/diqthash.h" +#include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */ +#include "dcmtk/dcmimgle/dcmimage.h" /* for DicomImage */ + + +DcmQuantColorHashTable::DcmQuantColorHashTable() +: m_Table(DcmQuantHashSize, OFnullptr) +{ + +} + + +DcmQuantColorHashTable::~DcmQuantColorHashTable() +{ + for (table_iterator it = m_Table.begin(); it != m_Table.end(); delete *it++); +} + + +unsigned long DcmQuantColorHashTable::countEntries() const +{ + unsigned long result = 0; + for (const_table_iterator it = m_Table.begin(); it != m_Table.end(); ++it) + if (*it) result += OFstatic_cast(unsigned long, (*it)->size()); + return result; +} + + +unsigned long DcmQuantColorHashTable::createHistogram(DcmQuantHistogramItemPointer *& array) +{ + unsigned long numcolors = countEntries(); + array = new DcmQuantHistogramItemPointer[numcolors]; + if (array) + { + unsigned long counter = 0; + for (table_iterator it = m_Table.begin(); it != m_Table.end(); ++it) + if (*it) (*it)->moveto(array, counter, numcolors); + } + return numcolors; +} + + +unsigned long DcmQuantColorHashTable::addToHashTable( + DicomImage& image, + unsigned long newmaxval, + unsigned long maxcolors) +{ + const unsigned long cols = image.getWidth(); + const unsigned long rows = image.getHeight(); + const unsigned long frames = image.getFrameCount(); + const int bits = sizeof(DcmQuantComponent)*8; + + unsigned long numcolors = 0; + unsigned long j, k; + const DcmQuantComponent *cp; + DcmQuantPixel px; + const void *data = NULL; + + // compute maxval + unsigned long maxval = 0; + for (int bb=0; bb < bits; bb++) maxval = (maxval << 1) | 1; + + DcmQuantScaleTable scaletable; + scaletable.createTable(maxval, newmaxval); + + DcmQuantComponent r, g, b; + + for (unsigned long ff=0; ff maxcolors) return 0; + } + } + } + } + return numcolors; +} diff --git a/dcmimage/libsrc/diqthitl.cc b/dcmimage/libsrc/diqthitl.cc new file mode 100644 index 00000000..dbb67c31 --- /dev/null +++ b/dcmimage/libsrc/diqthitl.cc @@ -0,0 +1,53 @@ +/* + * + * Copyright (C) 2002-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantHistogramItemList + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimage/diqthitl.h" + + +DcmQuantHistogramItemList::DcmQuantHistogramItemList() +: list_() +, first(list_.end()) +, last(list_.end()) +{ +} + + +DcmQuantHistogramItemList::~DcmQuantHistogramItemList() +{ + first = list_.begin(); + while (first != last) + { + delete *first; + first = list_.erase(first); + } +} + + +void DcmQuantHistogramItemList::moveto(DcmQuantHistogramItemPointer *array, unsigned long& counter, unsigned long numcolors) +{ + first = list_.begin(); + while ((first != last) && (counter < numcolors)) + { + array[counter++] = *first; + first = list_.erase(first); + } +} diff --git a/dcmimage/libsrc/diqtpbox.cc b/dcmimage/libsrc/diqtpbox.cc new file mode 100644 index 00000000..ac3648d5 --- /dev/null +++ b/dcmimage/libsrc/diqtpbox.cc @@ -0,0 +1,65 @@ +/* + * + * Copyright (C) 2002-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQuantPixelBoxArray + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/dcmimage/diqtpbox.h" /* for DcmQuantPixelBoxArray */ + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines qsort() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + + +BEGIN_EXTERN_C +static int sumcompare(const void *x1, const void *x2) +{ + return (*(DcmQuantPixelBoxPointer *) x2)->sum + - (*(DcmQuantPixelBoxPointer *) x1)->sum; +} +END_EXTERN_C + + +void DcmQuantPixelBoxArray::sort(unsigned long boxes) +{ +#ifdef DEBUG + assert(boxes <= length); +#endif + qsort(OFreinterpret_cast(char *, array), OFstatic_cast(unsigned int, boxes), sizeof(DcmQuantPixelBoxPointer), sumcompare); +} + + +DcmQuantPixelBoxArray::DcmQuantPixelBoxArray(unsigned long entries) +: array(NULL) +, length(entries) +{ + array = new DcmQuantPixelBoxPointer[entries]; + for (unsigned long i=0; i 65536)||(numberOfColors < 2)) return EC_IllegalCall; + + OFCondition result = EC_Normal; + + // Create histogram of the colors, clustered if necessary + DCMIMAGE_DEBUG("computing image histogram"); + + DcmQuantColorTable chv; + result = chv.computeHistogram(sourceImage, DcmQuantMaxColors); + if (result.bad()) return result; + + unsigned long maxval = chv.getMaxVal(); + DCMIMAGE_DEBUG("image histogram: found " << chv.getColors() << " colors (at maxval=" << maxval << ")"); + + // apply median-cut to histogram, making the new colormap. + unsigned long cols = sourceImage.getWidth(); + unsigned long rows = sourceImage.getHeight(); + unsigned long frames = sourceImage.getFrameCount(); + + DCMIMAGE_DEBUG("computing color map using Heckbert's median cut algorithm"); + + DcmQuantColorTable colormap; + result = colormap.medianCut(chv, cols * rows * frames, maxval, numberOfColors, largeType, repType); + if (result.bad()) return result; + chv.clear(); // frees most memory used by chv. + + // map the colors in the image to their closest match in the + // new colormap, and write 'em out. + DcmQuantColorHashTable cht; + DCMIMAGE_DEBUG("mapping image data to color table"); + + DcmQuantFloydSteinberg fs; + if (floydSteinberg) + { + result = fs.initialize(cols); + if (result.bad()) return result; + } + DcmQuantIdent id(cols); + + OFBool isByteData = (numberOfColors <= 256); + + // compute size requirement for palette color pixel data in bytes + unsigned long totalSize = cols * rows * frames; + if (! isByteData) totalSize *= 2; + if (totalSize & 1) totalSize++; + + Uint16 *imageData16 = NULL; + Uint8 *imageData8 = NULL; + DcmPixelData *pixelData = new DcmPixelData(DCM_PixelData); + if (pixelData) + { + result = pixelData->createUint16Array(totalSize/sizeof(Uint16), imageData16); + if (result.good()) + { + imageData16[(totalSize/sizeof(Uint16)) -1] = 0; // make sure pad byte is zero + imageData8 = OFreinterpret_cast(Uint8 *, imageData16); + result = target.insert(pixelData, OFTrue); + if (result.good()) + { + for (unsigned long ff=0; ff::create(sourceImage, ff, maxval, cht, colormap, fs, imageData8 + cols*rows*ff); + else DcmQuantColorMapping::create(sourceImage, ff, maxval, cht, colormap, id, imageData8 + cols*rows*ff); + } + else + { + if (floydSteinberg) + DcmQuantColorMapping::create(sourceImage, ff, maxval, cht, colormap, fs, imageData16 + cols*rows*ff); + else DcmQuantColorMapping::create(sourceImage, ff, maxval, cht, colormap, id, imageData16 + cols*rows*ff); + } + } // for all frames + + // image creation is complete, finally adjust byte order if necessary + if (isByteData) + { + result = swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, imageData16, totalSize, sizeof(Uint16)); + } + + } + } + } + + DCMIMAGE_DEBUG("creating DICOM image pixel module"); + + // create target image pixel module + if (result.good()) result = target.putAndInsertUint16(DCM_SamplesPerPixel, 1); + if (result.good()) result = target.putAndInsertUint16(DCM_PixelRepresentation, 0); + if (result.good()) result = target.putAndInsertString(DCM_PhotometricInterpretation, "PALETTE COLOR"); + if (result.good()) result = target.putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, rows)); + if (result.good()) result = target.putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, cols)); + + // determine bits allocated, stored, high bit + Uint16 bitsAllocated = 8; + Uint16 bitsStored = 8; + Uint16 highBit = 7; + if (! isByteData) + { + bitsAllocated = 16; + bitsStored = 8; + while ((1UL << bitsStored) < OFstatic_cast(unsigned long, numberOfColors)) bitsStored++; + highBit = bitsStored - 1; + } + if (result.good()) result = target.putAndInsertUint16(DCM_BitsAllocated, bitsAllocated); + if (result.good()) result = target.putAndInsertUint16(DCM_BitsStored, bitsStored); + if (result.good()) result = target.putAndInsertUint16(DCM_HighBit, highBit); + + // make sure these attributes are not present in the target image + delete target.remove(DCM_SmallestImagePixelValue); + delete target.remove(DCM_LargestImagePixelValue); + delete target.remove(DCM_PixelPaddingValue); + delete target.remove(DCM_PixelPaddingRangeLimit); + delete target.remove(DCM_SmallestPixelValueInSeries); + delete target.remove(DCM_LargestPixelValueInSeries); + delete target.remove(DCM_PaletteColorLookupTableUID); + delete target.remove(DCM_SegmentedRedPaletteColorLookupTableData); + delete target.remove(DCM_SegmentedGreenPaletteColorLookupTableData); + delete target.remove(DCM_SegmentedBluePaletteColorLookupTableData); + delete target.remove(DCM_PlanarConfiguration); + + // UNIMPLEMENTED: frame increment pointer + // UNIMPLEMENTED: pixel aspect ratio/pixel spacing/imager pixel spacing + + if (frames > 1) + { + char buf[20]; + sprintf(buf, "%lu", frames); + if (result.good()) result = target.putAndInsertString(DCM_NumberOfFrames, buf); + } + + // create palette color LUT descriptor and data + if (result.good()) result = colormap.write(target, writeAsOW, write16BitEntries); + + // create derivation description string + if (result.good()) colormap.setDescriptionString(description); + + return result; +} + + +OFCondition DcmQuant::updateDerivationDescription(DcmItem *dataset, const char *description) +{ + if (description == NULL) return EC_IllegalCall; + + OFString derivationDescription(description); + + // append old Derivation Description, if any + const char *oldDerivation = NULL; + if ((dataset->findAndGetString(DCM_DerivationDescription, oldDerivation)).good() && oldDerivation) + { + derivationDescription += " ["; + derivationDescription += oldDerivation; + derivationDescription += "]"; + if (derivationDescription.length() > 1024) + { + // ST is limited to 1024 characters, cut off tail + derivationDescription.erase(1020); + derivationDescription += "...]"; + } + } + + return dataset->putAndInsertString(DCM_DerivationDescription, derivationDescription.c_str()); +} diff --git a/dcmimage/libsrc/diregist.cc b/dcmimage/libsrc/diregist.cc new file mode 100644 index 00000000..1133a655 --- /dev/null +++ b/dcmimage/libsrc/diregist.cc @@ -0,0 +1,136 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomRegister (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimage/diregist.h" +#include "dcmtk/dcmimage/dipalimg.h" +#include "dcmtk/dcmimage/dirgbimg.h" +#include "dcmtk/dcmimage/dihsvimg.h" +#include "dcmtk/dcmimage/diargimg.h" +#include "dcmtk/dcmimage/dicmyimg.h" +#include "dcmtk/dcmimage/diybrimg.h" +#include "dcmtk/dcmimage/diyf2img.h" +#include "dcmtk/dcmimage/diyp2img.h" +#include "dcmtk/dcmimage/dicomot.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiRegister::DiRegister() +{ + DiRegisterBase::Pointer = this; +} + + +/*--------------* + * destructor * + *--------------*/ + +DiRegister::~DiRegister() +{ +} + + +/*--------------*/ + +DiImage *DiRegister::createImage(const DiDocument *docu, + const EI_Status status, + const EP_Interpretation photo) +{ + DiImage *image = NULL; + switch (photo) + { + case EPI_PaletteColor: + image = new DiPaletteImage(docu, status); + break; + case EPI_RGB: + image = new DiRGBImage(docu, status); + break; + case EPI_HSV: + image = new DiHSVImage(docu, status); + break; + case EPI_ARGB: + image = new DiARGBImage(docu, status); + break; + case EPI_CMYK: + image = new DiCMYKImage(docu, status); + break; + case EPI_YBR_Full: + image = new DiYBRImage(docu, status); + break; + case EPI_YBR_Full_422: + image = new DiYBR422Image(docu, status); + break; + case EPI_YBR_Partial_422: + image = new DiYBRPart422Image(docu, status); + break; + default: + ; + } + return image; +} + + +DiMonoPixel *DiRegister::createMonoImageData(const DiColorImage *image, + const double red, + const double green, + const double blue) +{ + DiMonoPixel *inter = NULL; + if (image != NULL) + { + const DiColorPixel *color = image->getColorInterData(); + if (color != NULL) + { + DiMonoModality *modality = new DiMonoModality(image->getBits()); + if (modality != NULL) + { + switch (color->getRepresentation()) + { + case EPR_Uint8: + inter = new DiColorMonoTemplate(color, modality, red, green, blue); + break; + case EPR_Sint8: + inter = new DiColorMonoTemplate(color, modality, red, green, blue); + break; + case EPR_Uint16: + inter = new DiColorMonoTemplate(color, modality, red, green, blue); + break; + case EPR_Sint16: + inter = new DiColorMonoTemplate(color, modality, red, green, blue); + break; + case EPR_Uint32: + inter = new DiColorMonoTemplate(color, modality, red, green, blue); + break; + case EPR_Sint32: + inter = new DiColorMonoTemplate(color, modality, red, green, blue); + break; + } + } + } + } + return inter; +} diff --git a/dcmimage/libsrc/dirgbimg.cc b/dcmimage/libsrc/dirgbimg.cc new file mode 100644 index 00000000..432245ed --- /dev/null +++ b/dcmimage/libsrc/dirgbimg.cc @@ -0,0 +1,103 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomRGBImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimage/dirgbimg.h" +#include "dcmtk/dcmimage/dirgbpxt.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diinpx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiRGBImage::DiRGBImage(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 3) +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + Init(); // create intermediate representation + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiRGBImage::~DiRGBImage() +{ +} + + +/*********************************************************************/ + + +void DiRGBImage::Init() +{ + /* number of pixels per plane */ + const unsigned long planeSize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiRGBPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint8: + InterData = new DiRGBPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Uint16: + InterData = new DiRGBPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint16: + InterData = new DiRGBPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Uint32: + InterData = new DiRGBPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + case EPR_Sint32: + InterData = new DiRGBPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample); + break; + } + deleteInputData(); + checkInterData(); +} + + +/*********************************************************************/ + + +int DiRGBImage::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/libsrc/diybrimg.cc b/dcmimage/libsrc/diybrimg.cc new file mode 100644 index 00000000..81105594 --- /dev/null +++ b/dcmimage/libsrc/diybrimg.cc @@ -0,0 +1,104 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBRImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimage/diybrimg.h" +#include "dcmtk/dcmimage/diybrpxt.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diinpx.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiYBRImage::DiYBRImage(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 3, !(docu->getFlags() & CIF_KeepYCbCrColorModel) /* RGBColorModel */) +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + Init(); // create intermediate representation + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiYBRImage::~DiYBRImage() +{ +} + + +/*********************************************************************/ + + +void DiYBRImage::Init() +{ + /* number of pixels per plane */ + const unsigned long planeSize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiYBRPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample, RGBColorModel); + break; + case EPR_Sint8: + InterData = new DiYBRPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample, RGBColorModel); + break; + case EPR_Uint16: + InterData = new DiYBRPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample, RGBColorModel); + break; + case EPR_Sint16: + InterData = new DiYBRPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample, RGBColorModel); + break; + case EPR_Uint32: + InterData = new DiYBRPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample, RGBColorModel); + break; + case EPR_Sint32: + InterData = new DiYBRPixelTemplate(Document, InputData, ImageStatus, planeSize, BitsPerSample, RGBColorModel); + break; + } + deleteInputData(); + checkInterData(); +} + + +/*********************************************************************/ + + +int DiYBRImage::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/libsrc/diyf2img.cc b/dcmimage/libsrc/diyf2img.cc new file mode 100644 index 00000000..4aeaa7a8 --- /dev/null +++ b/dcmimage/libsrc/diyf2img.cc @@ -0,0 +1,102 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBR422Image (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimage/diyf2img.h" +#include "dcmtk/dcmimage/diyf2pxt.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diinpx.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiYBR422Image::DiYBR422Image(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 2, !(docu->getFlags() & CIF_KeepYCbCrColorModel) /* RGBColorModel */) +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + Init(); // create intermediate representation + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiYBR422Image::~DiYBR422Image() +{ +} + + +/*********************************************************************/ + + +void DiYBR422Image::Init() +{ + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiYBR422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample, RGBColorModel); + break; + case EPR_Sint8: + InterData = new DiYBR422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample, RGBColorModel); + break; + case EPR_Uint16: + InterData = new DiYBR422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample, RGBColorModel); + break; + case EPR_Sint16: + InterData = new DiYBR422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample, RGBColorModel); + break; + case EPR_Uint32: + InterData = new DiYBR422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample, RGBColorModel); + break; + case EPR_Sint32: + InterData = new DiYBR422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample, RGBColorModel); + break; + } + deleteInputData(); + checkInterData(); +} + + +/*********************************************************************/ + + +int DiYBR422Image::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/libsrc/diyp2img.cc b/dcmimage/libsrc/diyp2img.cc new file mode 100644 index 00000000..14437852 --- /dev/null +++ b/dcmimage/libsrc/diyp2img.cc @@ -0,0 +1,101 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimage + * + * Author: Joerg Riesmeier + * + * Purpose: DicomYBRPart422Image (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimage/diyp2img.h" +#include "dcmtk/dcmimage/diyp2pxt.h" +#include "dcmtk/dcmimage/dilogger.h" +#include "dcmtk/dcmimgle/diinpx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiYBRPart422Image::DiYBRPart422Image(const DiDocument *docu, + const EI_Status status) + : DiColorImage(docu, status, 2) +{ + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + Init(); // create intermediate representation + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiYBRPart422Image::~DiYBRPart422Image() +{ +} + + +/*********************************************************************/ + + +void DiYBRPart422Image::Init() +{ + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiYBRPart422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample); + break; + case EPR_Sint8: + InterData = new DiYBRPart422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample); + break; + case EPR_Uint16: + InterData = new DiYBRPart422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample); + break; + case EPR_Sint16: + InterData = new DiYBRPart422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample); + break; + case EPR_Uint32: + InterData = new DiYBRPart422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample); + break; + case EPR_Sint32: + InterData = new DiYBRPart422PixelTemplate(Document, InputData, ImageStatus, BitsPerSample); + break; + } + deleteInputData(); + checkInterData(); +} + + +/*********************************************************************/ + + +int DiYBRPart422Image::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + delete InterData; + InterData = NULL; + Init(); + return (ImageStatus == EIS_Normal); + } + return 0; +} diff --git a/dcmimage/tests/Makefile.in b/dcmimage/tests/Makefile.in new file mode 100644 index 00000000..44f4a480 --- /dev/null +++ b/dcmimage/tests/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmimage/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +check: + +check-exhaustive: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) + +dependencies: diff --git a/dcmimgle/CMakeLists.txt b/dcmimgle/CMakeLists.txt new file mode 100644 index 00000000..d47992c6 --- /dev/null +++ b/dcmimgle/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmimgle) + +# declare include directories which hold for all subdirectories +include_directories("${dcmimgle_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc apps include data) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmimgle/Makefile.in b/dcmimgle/Makefile.in new file mode 100644 index 00000000..a791ad08 --- /dev/null +++ b/dcmimgle/Makefile.in @@ -0,0 +1,97 @@ +# +# Makefile for dcmimgle +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) +# (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmimgle/apps/CMakeLists.txt b/dcmimgle/apps/CMakeLists.txt new file mode 100644 index 00000000..6909f5dc --- /dev/null +++ b/dcmimgle/apps/CMakeLists.txt @@ -0,0 +1,9 @@ +# declare executables +foreach(PROGRAM dcmdspfn dcod2lum dconvlum) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcmdspfn dcod2lum dconvlum) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmimgle dcmdata oflog ofstd) +endforeach() diff --git a/dcmimgle/apps/Makefile.dep b/dcmimgle/apps/Makefile.dep new file mode 100644 index 00000000..9386090b --- /dev/null +++ b/dcmimgle/apps/Makefile.dep @@ -0,0 +1,157 @@ +dcmdspfn.o: dcmdspfn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmimgle/digsdfn.h ../include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diciefn.h \ + ../include/dcmtk/dcmimgle/dicielut.h \ + ../include/dcmtk/dcmimgle/didislut.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/diutils.h +dcod2lum.o: dcod2lum.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimgle/didefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +dconvlum.o: dconvlum.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h diff --git a/dcmimgle/apps/Makefile.in b/dcmimgle/apps/Makefile.in new file mode 100644 index 00000000..cb876bb2 --- /dev/null +++ b/dcmimgle/apps/Makefile.in @@ -0,0 +1,56 @@ +# +# Makefile for dcmimgle/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc -L$(dcmdatadir)/libsrc +LOCALLIBS = -ldcmimgle -ldcmdata -loflog -lofstd $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +objs = dconvlum.o dcmdspfn.o dcod2lum.o +progs = dconvlum dcmdspfn dcod2lum + + +all: $(progs) + +dconvlum: dconvlum.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmdspfn: dcmdspfn.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcod2lum: dcod2lum.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmimgle/apps/dcmdspfn.cc b/dcmimgle/apps/dcmdspfn.cc new file mode 100644 index 00000000..725d3235 --- /dev/null +++ b/dcmimgle/apps/dcmdspfn.cc @@ -0,0 +1,305 @@ +/* + * + * Copyright (C) 1999-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Authors: Joerg Riesmeier + * + * Purpose: export display curves to a text file + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" + +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofcmdln.h" + +#include "dcmtk/dcmimgle/digsdfn.h" +#include "dcmtk/dcmimgle/diciefn.h" + +#define OFFIS_CONSOLE_APPLICATION "dcmdspfn" + +static OFLogger dcmdspfnLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define SHORTCOL 3 +#define LONGCOL 15 + +// ******************************************** + + +int main(int argc, char *argv[]) +{ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Export standard display curves to a text file", rcsid); + OFCommandLine cmd; + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + int opt_outputMode = 0; + OFCmdUnsignedInt opt_ddlCount = 256; + OFCmdSignedInt opt_polyOrder = -1; + OFCmdFloat opt_ambLight = -1; + OFCmdFloat opt_illum = -1; + OFCmdFloat opt_Dmin = -1; + OFCmdFloat opt_Dmax = -1; + OFCmdFloat opt_minVal = 0; + OFCmdFloat opt_maxVal = 0; + DiDisplayFunction::E_DeviceType deviceType = DiDisplayFunction::EDT_Monitor; + + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + cmd.setOptionColumns(LONGCOL, SHORTCOL); + + cmd.addGroup("general options:"); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options: (mutually exclusive)"); + cmd.addOption("--monitor-file", "+Im", 1, "[f]ilename: string", + "text file describing the monitor characteristics"); + cmd.addOption("--camera-file", "+Ic", 1, "[f]ilename: string", + "text file describing the camera characteristics"); + cmd.addOption("--printer-file", "+Ip", 1, "[f]ilename: string", + "text file describing the printer characteristics"); + cmd.addOption("--scanner-file", "+Is", 1, "[f]ilename: string", + "text file describing the scanner characteristics"); + cmd.addOption("--lum-range", "+Il", 2, "[m]in max: float", + "minimum and maximum luminance (cd/m^2)"); + cmd.addOption("--od-range", "+Io", 2, "[m]in max: float", + "minimum and maximum optical density (OD),\nautomatically converted to luminance"); + + cmd.addGroup("creation options:"); + cmd.addOption("--ambient-light", "+Ca", 1, "[a]mbient light: float", + "ambient light value (cd/m^2, default: file f)"); + cmd.addOption("--illumination", "+Ci", 1, "[i]llumination: float", + "illumination value (cd/m^2, default: file f)"); + cmd.addOption("--min-density", "+Dn", 1, "[m]inimum optical density: float", + "Dmin value (default: off, only with +Ip and +Io)"); + cmd.addOption("--max-density", "+Dx", 1, "[m]aximum optical density: float", + "Dmax value (default: off, only with +Ip and +Io)"); + cmd.addOption("--ddl-count", "+Cd", 1, "[n]umber of DDLs: integer", + "number of Digital Driving Levels\n(default: 256, only with --lum/od-range)"); + cmd.addOption("--curve-fitting", "+Cf", 1, "[n]umber : integer", + "use polynomial curve fitting algorithm with order n\n(0..99, default: file setting or cubic spline)"); + + cmd.addGroup("output options:"); + cmd.addOption("--gsdf", "+Og", 1, "[f]ilename: string", + "write GSDF curve data to file f"); + cmd.addOption("--cielab", "+Oc", 1, "[f]ilename: string", + "write CIELAB curve data to file f"); + + if (app.parseCommandLine(cmd, argc, argv)) + { + /* print help text and exit */ + if (cmd.getArgCount() == 0) + app.printUsage(); + + /* check exclusive options */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used: none" << OFendl; + return 0; + } + } + + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--ambient-light")) + app.checkValue(cmd.getValueAndCheckMin(opt_ambLight, 0)); + if (cmd.findOption("--illumination")) + app.checkValue(cmd.getValueAndCheckMin(opt_illum, 0)); + if (cmd.findOption("--ddl-count")) + { + if (opt_ifname != NULL) + { + app.checkConflict("--ddl-count", "--monitor-file", OFTrue); + app.checkConflict("--ddl-count", "--printer-file", OFTrue); + } else + app.checkValue(cmd.getValueAndCheckMinMax(opt_ddlCount, 2, 65536)); + } + if (cmd.findOption("--curve-fitting")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_polyOrder, 0, 99)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--monitor-file")) + { + app.checkValue(cmd.getValue(opt_ifname)); + deviceType = DiDisplayFunction::EDT_Monitor; + } + if (cmd.findOption("--camera-file")) + { + app.checkValue(cmd.getValue(opt_ifname)); + deviceType = DiDisplayFunction::EDT_Camera; + } + if (cmd.findOption("--printer-file")) + { + app.checkValue(cmd.getValue(opt_ifname)); + deviceType = DiDisplayFunction::EDT_Printer; + } + if (cmd.findOption("--scanner-file")) + { + app.checkValue(cmd.getValue(opt_ifname)); + deviceType = DiDisplayFunction::EDT_Scanner; + } + if (cmd.findOption("--lum-range")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_minVal, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_maxVal, opt_minVal, OFFalse)); + deviceType = DiDisplayFunction::EDT_Monitor; + } + if (cmd.findOption("--od-range")) + { + app.checkDependence("--od-range", "--illumination", opt_illum >= 0); + OFCmdFloat minVal = 0; + OFCmdFloat maxVal = 0; + app.checkValue(cmd.getValueAndCheckMin(minVal, 0)); + app.checkValue(cmd.getValueAndCheckMin(maxVal, minVal, OFFalse)); + deviceType = DiDisplayFunction::EDT_Printer; + /* convert given optical density to luminance */ + opt_minVal = DiDisplayFunction::convertODtoLum(maxVal, 0 /*ambLight*/, opt_illum); + opt_maxVal = DiDisplayFunction::convertODtoLum(minVal, 0 /*ambLight*/, opt_illum); + } + cmd.endOptionBlock(); + + if (cmd.findOption("--min-density")) + { + app.checkDependence("--min-density", "--printer-file or --od-range", deviceType == DiDisplayFunction::EDT_Printer); + app.checkValue(cmd.getValueAndCheckMin(opt_Dmin, 0)); + } + if (cmd.findOption("--max-density")) + { + app.checkDependence("--max-density", "--printer-file or --od-range", deviceType == DiDisplayFunction::EDT_Printer); + app.checkValue(cmd.getValueAndCheckMin(opt_Dmax, (opt_Dmin < 0) ? 0.0 : opt_Dmin, OFFalse /*incl*/)); + } + + if (cmd.findOption("--gsdf")) + ++opt_outputMode; + if (cmd.findOption("--cielab")) + ++opt_outputMode; + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmdspfnLogger, rcsid << OFendl); + + if (opt_outputMode > 0) + { + if (opt_ifname != NULL) + OFLOG_INFO(dcmdspfnLogger, "reading LUT file: " << opt_ifname); + + /* Grayscale Standard Display Function */ + if (cmd.findOption("--gsdf")) + { + OFLOG_INFO(dcmdspfnLogger, "creating GSDF display curve ..."); + app.checkValue(cmd.getValue(opt_ofname)); + DiGSDFunction *disp = NULL; + if (opt_ifname != NULL) + disp = new DiGSDFunction(opt_ifname, deviceType, OFstatic_cast(signed int, opt_polyOrder)); + else + disp = new DiGSDFunction(opt_minVal, opt_maxVal, opt_ddlCount, DiDisplayFunction::EDT_Monitor, + OFstatic_cast(signed int, opt_polyOrder)); + if ((disp != NULL) && disp->isValid()) + { + if (opt_ambLight >= 0) + { + OFLOG_INFO(dcmdspfnLogger, "setting ambient light value ..."); + disp->setAmbientLightValue(opt_ambLight); + } + if (opt_illum >= 0) + { + OFLOG_INFO(dcmdspfnLogger, "setting illumination value ..."); + disp->setIlluminationValue(opt_illum); + } + /* Dmin/max only supported for printers */ + if (disp->getDeviceType() == DiDisplayFunction::EDT_Printer) + { + if (opt_Dmin >= 0) + { + OFLOG_INFO(dcmdspfnLogger, "setting minimum optical density value ..."); + disp->setMinDensityValue(opt_Dmin); + } + if (opt_Dmax >= 0) + { + OFLOG_INFO(dcmdspfnLogger, "setting maximum optical density value ..."); + disp->setMaxDensityValue(opt_Dmax); + } + } + OFLOG_INFO(dcmdspfnLogger, "writing output file: " << opt_ofname); + if (!disp->writeCurveData(opt_ofname, opt_ifname != NULL)) + { + OFLOG_FATAL(dcmdspfnLogger, "can't write output file"); + return 1; + } + } else { + OFLOG_FATAL(dcmdspfnLogger, "can't create display curve"); + return 1; + } + delete disp; + } + + /* CIELAB display function */ + if (cmd.findOption("--cielab")) + { + OFLOG_INFO(dcmdspfnLogger, "creating CIELAB display curve ..."); + app.checkValue(cmd.getValue(opt_ofname)); + DiCIELABFunction *disp = NULL; + if (opt_ifname != NULL) + disp = new DiCIELABFunction(opt_ifname, deviceType, OFstatic_cast(signed int, opt_polyOrder)); + else + disp = new DiCIELABFunction(opt_minVal, opt_maxVal, opt_ddlCount, DiDisplayFunction::EDT_Monitor, + OFstatic_cast(signed int, opt_polyOrder)); + if ((disp != NULL) && disp->isValid()) + { + if (opt_ambLight >= 0) + { + OFLOG_INFO(dcmdspfnLogger, "setting ambient light value ..."); + disp->setAmbientLightValue(opt_ambLight); + } + /* Dmin/max only supported for printers */ + if (disp->getDeviceType() == DiDisplayFunction::EDT_Printer) + { + if (opt_Dmin >= 0) + { + OFLOG_INFO(dcmdspfnLogger, "setting minimum optical density value ..."); + disp->setMinDensityValue(opt_Dmin); + } + if (opt_Dmax >= 0) + { + OFLOG_INFO(dcmdspfnLogger, "setting maximum optical density value ..."); + disp->setMaxDensityValue(opt_Dmax); + } + } + OFLOG_INFO(dcmdspfnLogger, "writing output file: " << opt_ofname); + if (!disp->writeCurveData(opt_ofname, opt_ifname != NULL)) + { + OFLOG_FATAL(dcmdspfnLogger, "can't write output file"); + return 1; + } + } else { + OFLOG_FATAL(dcmdspfnLogger, "can't create display curve"); + return 1; + } + } + } else { + OFLOG_WARN(dcmdspfnLogger, "nothing to do, no output file specified"); + } + return 0; +} diff --git a/dcmimgle/apps/dcod2lum.cc b/dcmimgle/apps/dcod2lum.cc new file mode 100644 index 00000000..69d3d9ab --- /dev/null +++ b/dcmimgle/apps/dcod2lum.cc @@ -0,0 +1,171 @@ +/* + * + * Copyright (C) 2002-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Authors: Joerg Riesmeier + * + * Purpose: convert hardcopy characteristic curve file to softcopy format + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CCTYPE +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconsol.h" +#include "dcmtk/dcmimgle/didispfn.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ + + +#define OFFIS_CONSOLE_APPLICATION "dcod2lum" + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +int main(int argc, char *argv[]) +{ + int error = 0; + /* check number of arguments */ + if (argc == 3) + { + STD_NAMESPACE ifstream input(argv[1], OFopenmode_in_nocreate); + if (input) + { + STD_NAMESPACE ofstream output(argv[2]); + if (output) + { + char c; + int i = 0; + int maxddl = 0; + int order = -1; + double amb = 0; + double lum = 0; + output << "# Softcopy characteristic curve file (converted from hardcopy format)" << OFendl; + while (input.get(c) && !error) + { + if (c == '#') // comment character + { + while (input.get(c) && (c != '\n') && (c != '\r')); // skip comments + } + else if (!isspace(OFstatic_cast(unsigned char, c))) // skip whitespaces + { + input.putback(c); + if (maxddl == 0) // read maxvalue + { + char str[4]; + input.get(str, sizeof(str)); + if (strcmp(str, "max") == 0) // check for key word: max + { + input >> maxddl; + if (maxddl > 0) + { + output << OFendl << "# maximum DDL value" << OFendl; + output << "max " << maxddl << OFendl; + } else + error = 1; + } else + error = 1; + } + else if ((amb <= 0) && (c == 'a')) // read ambient light value (optional) + { + char str[4]; + input.get(str, sizeof(str)); + if (strcmp(str, "amb") == 0) // check for key word: amb + { + input >> amb; + if (amb >= 0) + { + output << OFendl << "# reflected ambient light (already included)" << OFendl; + output << "# amb " << amb << OFendl; + } else + error = 1; + } else + error = 1; + } + else if ((lum <= 0) && (c == 'l')) // read illumination value (optional) + { + char str[4]; + input.get(str, sizeof(str)); + if (strcmp(str, "lum") == 0) // check for key word: lum + { + input >> lum; + if (lum >= 0) + { + output << OFendl << "# illumination (already included)" << OFendl; + output << "# lum " << lum << OFendl; + } else + error = 1; + } else + error = 1; + } + else if ((order < 0) && (c == 'o')) // read polynomial order (optional) + { + char str[4]; + input.get(str, sizeof(str)); + if (strcmp(str, "ord") == 0) // check for key word: ord + { + input >> order; + if (order >= 0) + { + output << OFendl << "# order of the polynomial curve fitting algorithm (optional)" << OFendl; + output << "ord " << order << OFendl; + } else + error = 1; + } else + error = 1; + } else { + int ddlval; + double odval; + input >> ddlval; // read DDL value + input >> odval; // read OD value + if (input.good() && (ddlval <= maxddl)) + { + if (i == 0) + output << OFendl << "# DDL LumVal" << OFendl; + output << ddlval << "\t"; + output.setf(STD_NAMESPACE ios::fixed, STD_NAMESPACE ios::floatfield); + output << DiDisplayFunction::convertODtoLum(odval, amb, lum) << OFendl; + ++i; + } else + error = 1; + } + } + } + if (error) + { + output << OFendl << "# error: corrupted input file" << OFendl; + CERR << "ERROR: corrupted input file !" << OFendl; + } else + output << OFendl << "# end of file" << OFendl; + } else + CERR << "ERROR: can't create output file !" << OFendl; + } else + CERR << "ERROR: can't open input file !" << OFendl; + } else { + /* print usage */ + CERR << rcsid << OFendl << OFendl; + CERR << OFFIS_CONSOLE_APPLICATION << ": Convert hardcopy characteristic curve file to softcopy format" << OFendl; + CERR << "usage: " << OFFIS_CONSOLE_APPLICATION << " in-file out-file" << OFendl << OFendl; + CERR << "parameters:" << OFendl; + CERR << " in-file hardcopy characteristic curve file to be converted" << OFendl; + CERR << " out-file softcopy characteristic curve file to be written" << OFendl; + } + return error; +} diff --git a/dcmimgle/apps/dconvlum.cc b/dcmimgle/apps/dconvlum.cc new file mode 100644 index 00000000..f15f3d7f --- /dev/null +++ b/dcmimgle/apps/dconvlum.cc @@ -0,0 +1,106 @@ +/* + * + * Copyright (C) 1999-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Authors: Joerg Riesmeier + * + * Purpose: convert VeriLUM CCx_xx.dat files to DCMTK display files + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofconsol.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ + + +#define OFFIS_CONSOLE_APPLICATION "dconvlum" + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +int main(int argc, char *argv[]) +{ + /* check number of arguments */ + if ((argc >= 3) && (argc <= 4)) + { + STD_NAMESPACE ifstream input(argv[1], OFopenmode_in_nocreate); + if (input) + { + STD_NAMESPACE ofstream output(argv[2]); + if (output) + { + const unsigned int maxddl = 255; // maximum DDL value (8 bits) + output << "# Monitor characteristic file (converted from VeriLUM to DCMTK)" << OFendl << "# "; + char c; + while (input.get(c) && (c != '\n') && (c != '\r')) // read description + output << c; // ... and write it to output file + output << OFendl << OFendl; + output << "# maximum DDL value" << OFendl << OFendl; + output << " max " << maxddl << OFendl << OFendl; + if (argc == 4) + { + double ambient = OFStandard::atof(argv[3]); + output << "# ambient light value" << OFendl << OFendl; + output << " amb " << ambient << OFendl << OFendl; + } + output << "# DDL LumVal" << OFendl << OFendl; + double lum; + unsigned int ddl; + unsigned int i = 0; + while ((i <= maxddl) && input.good() && output.good()) + { + while (input.get(c) && !isdigit(OFstatic_cast(unsigned char, c))); // skip non-numeric chars + input.putback(c); + input >> ddl; // read DDL value + while (input.get(c) && !isdigit(OFstatic_cast(unsigned char, c))); // skip non-numeric chars + input.putback(c); + input >> lum; // read luminance value + output.width(5); + output << ddl; // write DDL value + output.width(12); + output.setf(STD_NAMESPACE ios::fixed, STD_NAMESPACE ios::floatfield); + output << lum << OFendl; // write luminance value + ++i; + } + if (i <= maxddl) + CERR << "ERROR: can't convert input file ... error in line #" << i << OFendl; + else { + output << OFendl << "# eof of file"; + return 0; // everything is OK + } + } else + CERR << "ERROR: can't create output file" << OFendl; + } else + CERR << "ERROR: can't open input file" << OFendl; + } else { + /* print usage */ + CERR << rcsid << OFendl << OFendl; + CERR << OFFIS_CONSOLE_APPLICATION << ": Convert VeriLUM \"CCx_xx.dat\" files to DCMTK display files" << OFendl; + CERR << "usage: " << OFFIS_CONSOLE_APPLICATION << " in-file out-file [ambient]" << OFendl << OFendl; + CERR << "parameters:" << OFendl; + CERR << " in-file VeriLUM characteristic curve file to be converted" << OFendl; + CERR << " out-file DCMTK display file to be written" << OFendl; + CERR << " ambient ambient light (cd/m^2, floating point value)" << OFendl; + } + return 1; // an error has happened +} diff --git a/dcmimgle/configure b/dcmimgle/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmimgle/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmimgle/data/CMakeLists.txt b/dcmimgle/data/CMakeLists.txt new file mode 100644 index 00000000..7a02a717 --- /dev/null +++ b/dcmimgle/data/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES camera.lut monitor.lut printer.lut scanner.lut DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data) diff --git a/dcmimgle/data/Makefile.in b/dcmimgle/data/Makefile.in new file mode 100644 index 00000000..88f91a2f --- /dev/null +++ b/dcmimgle/data/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmimgle/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = camera.lut monitor.lut printer.lut scanner.lut + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(datadir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(datadir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimgle/data/camera.lut b/dcmimgle/data/camera.lut new file mode 100644 index 00000000..2cfb8bfe --- /dev/null +++ b/dcmimgle/data/camera.lut @@ -0,0 +1,26 @@ +# Camera characteristic file + +# maximum DDL value + + max 4095 + +# DDL LumVal + + 0 11.588656 + 16 16.934737 + 32 23.521660 + 48 32.963072 + 96 46.394017 + 145 61.407916 + 241 82.615611 + 353 110.237447 + 514 151.589157 + 723 200.998517 + 996 261.785082 + 1461 357.560166 + 2023 489.766584 + 2794 657.187314 + 3758 863.159038 + 4095 1160.879875 + +# end of file diff --git a/dcmimgle/data/monitor.lut b/dcmimgle/data/monitor.lut new file mode 100644 index 00000000..1c229894 --- /dev/null +++ b/dcmimgle/data/monitor.lut @@ -0,0 +1,270 @@ +# Monitor characteristic file + +# maximum DDL value + + max 255 + +# ambient light (optional) + + amb 1.0 + +# DDL LumVal + + 0 0.186260 + 1 0.199540 + 2 0.213000 + 3 0.226850 + 4 0.241260 + 5 0.256440 + 6 0.272560 + 7 0.289820 + 8 0.308410 + 9 0.328520 + 10 0.350340 + 11 0.374050 + 12 0.399850 + 13 0.427930 + 14 0.458480 + 15 0.491690 + 16 0.527740 + 17 0.566800 + 18 0.608900 + 19 0.654050 + 20 0.702250 + 21 0.753510 + 22 0.807840 + 23 0.865250 + 24 0.925730 + 25 0.989300 + 26 1.055950 + 27 1.125710 + 28 1.198560 + 29 1.274530 + 30 1.353610 + 31 1.435800 + 32 1.521130 + 33 1.609590 + 34 1.701190 + 35 1.795960 + 36 1.893890 + 37 1.995020 + 38 2.099340 + 39 2.206880 + 40 2.317650 + 41 2.431660 + 42 2.548930 + 43 2.669460 + 44 2.793280 + 45 2.920390 + 46 3.050810 + 47 3.184560 + 48 3.321650 + 49 3.462090 + 50 3.605910 + 51 3.753140 + 52 3.903820 + 53 4.057970 + 54 4.215620 + 55 4.376800 + 56 4.541540 + 57 4.709880 + 58 4.881840 + 59 5.057460 + 60 5.236750 + 61 5.419770 + 62 5.606520 + 63 5.797050 + 64 5.991380 + 65 6.189550 + 66 6.391550 + 67 6.597390 + 68 6.807060 + 69 7.020590 + 70 7.237950 + 71 7.459160 + 72 7.684220 + 73 7.913130 + 74 8.145890 + 75 8.382510 + 76 8.622980 + 77 8.867310 + 78 9.115500 + 79 9.367550 + 80 9.623470 + 81 9.883250 + 82 10.146910 + 83 10.414440 + 84 10.685870 + 85 10.961190 + 86 11.240410 + 87 11.523550 + 88 11.810600 + 89 12.101570 + 90 12.396480 + 91 12.695330 + 92 12.998130 + 93 13.304880 + 94 13.615600 + 95 13.930280 + 96 14.248940 + 97 14.571590 + 98 14.898230 + 99 15.228890 + 100 15.563570 + 101 15.902290 + 102 16.245070 + 103 16.591910 + 104 16.942840 + 105 17.297860 + 106 17.656990 + 107 18.020250 + 108 18.387640 + 109 18.759180 + 110 19.134890 + 111 19.514770 + 112 19.898850 + 113 20.287130 + 114 20.679590 + 115 21.076230 + 116 21.477030 + 117 21.881960 + 118 22.291010 + 119 22.704160 + 120 23.121390 + 121 23.542700 + 122 23.968050 + 123 24.397430 + 124 24.830830 + 125 25.268230 + 126 25.709610 + 127 26.154950 + 128 26.604230 + 129 27.057450 + 130 27.514600 + 131 27.975710 + 132 28.440770 + 133 28.909800 + 134 29.382810 + 135 29.859810 + 136 30.340810 + 137 30.825820 + 138 31.314850 + 139 31.807910 + 140 32.305020 + 141 32.806170 + 142 33.311390 + 143 33.820680 + 144 34.334050 + 145 34.851510 + 146 35.373040 + 147 35.898610 + 148 36.428200 + 149 36.961790 + 150 37.499360 + 151 38.040870 + 152 38.586320 + 153 39.135660 + 154 39.688880 + 155 40.245950 + 156 40.806860 + 157 41.371570 + 158 41.940060 + 159 42.512310 + 160 43.088300 + 161 43.668010 + 162 44.251470 + 163 44.838720 + 164 45.429800 + 165 46.024740 + 166 46.623600 + 167 47.226410 + 168 47.833210 + 169 48.444030 + 170 49.058920 + 171 49.677930 + 172 50.301070 + 173 50.928410 + 174 51.559970 + 175 52.195800 + 176 52.835940 + 177 53.480410 + 178 54.129180 + 179 54.782210 + 180 55.439460 + 181 56.100870 + 182 56.766410 + 183 57.436030 + 184 58.109700 + 185 58.787350 + 186 59.468950 + 187 60.154460 + 188 60.843840 + 189 61.537030 + 190 62.233990 + 191 62.934680 + 192 63.639060 + 193 64.347100 + 194 65.058820 + 195 65.774270 + 196 66.493510 + 197 67.216560 + 198 67.943490 + 199 68.674330 + 200 69.409130 + 201 70.147940 + 202 70.890790 + 203 71.637750 + 204 72.388850 + 205 73.144130 + 206 73.903650 + 207 74.667450 + 208 75.435570 + 209 76.208050 + 210 76.984850 + 211 77.765920 + 212 78.551230 + 213 79.340710 + 214 80.134330 + 215 80.932040 + 216 81.733790 + 217 82.539530 + 218 83.349220 + 219 84.162800 + 220 84.980240 + 221 85.801480 + 222 86.626480 + 223 87.455180 + 224 88.287560 + 225 89.123560 + 226 89.963230 + 227 90.806620 + 228 91.653780 + 229 92.504770 + 230 93.359640 + 231 94.218430 + 232 95.081200 + 233 95.948010 + 234 96.818900 + 235 97.693920 + 236 98.573140 + 237 99.456590 + 238 100.344340 + 239 101.236440 + 240 102.132930 + 241 103.033820 + 242 103.938850 + 243 104.847740 + 244 105.760200 + 245 106.675910 + 246 107.594590 + 247 108.515940 + 248 109.439670 + 249 110.365470 + 250 111.293050 + 251 112.222110 + 252 113.152360 + 253 114.083500 + 254 115.015230 + 255 115.947260 + +# eof of file \ No newline at end of file diff --git a/dcmimgle/data/printer.lut b/dcmimgle/data/printer.lut new file mode 100644 index 00000000..d6b226f5 --- /dev/null +++ b/dcmimgle/data/printer.lut @@ -0,0 +1,38 @@ +# Printer characteristic file + +# maximum DDL value + + max 255 + +# illumination (optional) + + lum 2000 + +# reflected ambient light (optional) + + amb 10 + +# order of the polynomial curve fitting algorithm (optional) + + ord 5 + +# DDL OD Val + + 0 3.00 + 16 2.40 + 33 2.09 + 51 1.86 + 67 1.68 + 84 1.52 + 102 1.37 + 119 1.24 + 135 1.10 + 153 0.97 + 170 0.85 + 187 0.72 + 204 0.59 + 221 0.46 + 238 0.33 + 255 0.19 + +# eof of file \ No newline at end of file diff --git a/dcmimgle/data/scanner.lut b/dcmimgle/data/scanner.lut new file mode 100644 index 00000000..25b68a4e --- /dev/null +++ b/dcmimgle/data/scanner.lut @@ -0,0 +1,34 @@ +# Scanner characteristic file + +# maximum DDL value + + max 4095 + +# illumination (optional) + + lum 2000 + +# reflected ambient light (optional) + + amb 10 + +# DDL OD Val + + 0 3.10 + 16 2.46 + 32 2.17 + 48 1.94 + 96 1.74 + 145 1.59 + 241 1.44 + 353 1.30 + 514 1.15 + 723 1.02 + 996 0.90 + 1461 0.76 + 2023 0.62 + 2794 0.49 + 3758 0.37 + 4095 0.24 + +# eof of file \ No newline at end of file diff --git a/dcmimgle/docs/Makefile.in b/dcmimgle/docs/Makefile.in new file mode 100644 index 00000000..c1decf2f --- /dev/null +++ b/dcmimgle/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmimgle/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimgle/docs/dcmdspfn.man b/dcmimgle/docs/dcmdspfn.man new file mode 100644 index 00000000..92c4a5e6 --- /dev/null +++ b/dcmimgle/docs/dcmdspfn.man @@ -0,0 +1,201 @@ +/*! + +\if MANPAGES +\page dcmdspfn Export standard display curves to a text file +\else +\page dcmdspfn dcmdspfn: Export standard display curves to a text file +\endif + +\section dcmdspfn_synopsis SYNOPSIS + +\verbatim +dcmdspfn [options] +\endverbatim + +\section dcmdspfn_description DESCRIPTION + +Command line program converts a DCMTK monitor / camera / printer / scanner +characteristics file to tabbed text file describing the characteristic curve +(CC), the display function and the post-standardized curve (PSC) for an 8 bit +display. The 256 values of each curve can be visualized by a common spread +sheet program. Above that the display curve (without CC and PSC) can also be +computed for a specified luminance/OD range (min/max) and a certain number of +Digital Driving Levels (DDL). + +\section dcmdspfn_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be dumped +\endverbatim + +\section dcmdspfn_options OPTIONS + +\subsection dcmdspfn_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmdspfn_input_options input options (mutually exclusive) +\verbatim + +Im --monitor-file [f]ilename: string + text file describing the monitor characteristics + + +Ic --camera-file [f]ilename: string + text file describing the camera characteristics + + +Ip --printer-file [f]ilename: string + text file describing the printer characteristics + + +Is --scanner-file [f]ilename: string + text file describing the scanner characteristics + + +Il --lum-range [m]in max: float + minimum and maximum luminance (cd/m^2) + + +Io --od-range [m]in max: float + minimum and maximum optical density (OD), + automatically converted to luminance +\endverbatim + +\subsection dcmdspfn_creation_options creation options +\verbatim + +Ca --ambient-light [a]mbient light: float + ambient light value (cd/m^2, default: file f) + + +Ci --illumination [i]llumination: float + illumination value (cd/m^2, default: file f) + + +Dn --min-density [m]inimum optical density: float + Dmin value (default: off, only with +Ip and +Io) + + +Dx --max-density [m]aximum optical density: float + Dmax value (default: off, only with +Ip and +Io) + + +Cd --ddl-count [n]umber of DDLs: integer + number of Digital Driving Levels + (default: 256, only with --lum/od-range) + + +Cf --curve-fitting [n]umber: integer + use polynomial curve fitting algorithm with order n + (0..99, default: file setting or cubic spline) +\endverbatim + +\subsection dcmdspfn_output_options output options +\verbatim + +Og --gsdf [f]ilename: string + write GSDF curve data to file f + + +Oc --cielab [f]ilename: string + write CIELAB curve data to file f +\endverbatim + +\section dcmdspfn_notes NOTES + +The output file describing the CC, GSDF or CIELAB and PSC for an 8 bit display +system (monitor, camera, printer or scanner) is a simple text file. Lines +starting with a '#' are treated as comments and, therefore, skipped as well as +blank lines. An input file can for instance be created by the command line +tool \b dconvlum. + +The ambient light value possibly defined in the characteristics file is also +used for the calculation. In this case the value is part of the file comment +header as well as the number of DDL (digital driving level) values, the +absolute luminance range (measured in candela per square meter) and the range +of the JND index (just noticeable difference) in case of GSDF. Alternatively, +the ambient light value can be specified as a command line option. When +setting the two luminance values instead of reading a monitor characteristic +file as input the luminance range is linearly divided by the number of DDLs. + +For printers and scanners the illumination can be specified in addition to the +reflected ambient light (both in the characteristics file and on the command +line). The header of the output file includes the minimum and maximum Optical +Density (OD) instead of the luminance range. Please note that the OD values +in the input file have to be ordered in descending order (in contrast to the +luminance values used for monitors and cameras). The DDL value 0 always means +black (darkest value) and the maximum DDL value means white (brightest value, +clear film). + +The \e data folder contains sample characteristics file for monitors, +cameras, printers and scanners. See DICOM standard part 14 for more details +on display calibration and Barten's model (including GSDF). + +\section dcmdspfn_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmdspfn_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmdspfn_files FILES + +\/camera.lut - sample characteristics file of a camera +\n\/monitor.lut - sample characteristics file of a monitor +\n\/printer.lut - sample characteristics file of a printer +\n\/scanner.lut - sample characteristics file of a scanner + +\section dcmdspfn_see_also SEE ALSO + +dconvlum(1), dcod2lum(1) + +\section dcmdspfn_copyright COPYRIGHT + +Copyright (C) 1999-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmimgle/docs/dcmimgle.dox b/dcmimgle/docs/dcmimgle.dox new file mode 100644 index 00000000..3ad39e14 --- /dev/null +++ b/dcmimgle/docs/dcmimgle.dox @@ -0,0 +1,48 @@ +/*! + +\page mod_dcmimgle dcmimgle: an image processing library and utility apps + +This module contains classes to access and render DICOM monochrome images. +Support for color images is provided by the module +\ref mod_dcmimage "dcmimage". Support for JPEG compressed images is provided +by the module \ref mod_dcmjpeg "dcmjpeg". + +The main interface classes are: +\li \b DicomImage +\li \b DiDisplayFunction + +\section Tools + +This module contains the following command line tools: +\li \ref dcmdspfn +\li \ref dcod2lum +\li \ref dconvlum + +\section Examples + +The following example shows how to load a DICOM single-frame monochrome image +and render its pixel data: + +\code +DicomImage *image = new DicomImage("test.dcm"); +if (image != NULL) +{ + if (image->getStatus() == EIS_Normal) + { + if (image->isMonochrome()) + { + image->setMinMaxWindow(); + Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits */)); + if (pixelData != NULL) + { + /* do something useful with the pixel data */ + } + } + } else + cerr << "Error: cannot load DICOM image (" << DicomImage::getString(image->getStatus()) << ")" << endl; +} +delete image; +\endcode + + +*/ diff --git a/dcmimgle/docs/dcod2lum.man b/dcmimgle/docs/dcod2lum.man new file mode 100644 index 00000000..bed4c544 --- /dev/null +++ b/dcmimgle/docs/dcod2lum.man @@ -0,0 +1,61 @@ +/*! + +\if MANPAGES +\page dcod2lum Convert hardcopy characteristic curve file to softcopy format +\else +\page dcod2lum dcod2lum: Convert hardcopy characteristic curve file to softcopy format +\endif + +\section dcod2lum_synopsis SYNOPSIS + +\verbatim +dcod2lum in-file out-file +\endverbatim + +\section dcod2lum_description DESCRIPTION + +Command line program that converts a hardcopy characteristic curve file to +softcopy format. In other words, the measured optical density (OD) values +from the input file are transformed to the luminance space according to the +formula: + +\verbatim + L = La + L0 * 10^(-D) +\endverbatim + +where \e L is the resulting luminance, \e La is the reflected ambient light +and \e L0 the illumination (both measured in cd/m^2), 'D' the optical density +(OD). Please note that if no illumination value is specified in the input +file (keyword \e lum) all optical density values are mapped to a constant +luminance. + +\section dcod2lum_parameters PARAMETERS + +\verbatim +in-file hardcopy characteristic curve file to be converted + +out-file softcopy characteristic curve file to be written +\endverbatim + +\section dcod2lum_notes NOTES + +The format of both input and output file is described the documentation of the +\b dcmdspfn command line tool. In addition, the \e data folder contains +sample characteristics file monitors, cameras, printers and scanners. + +\section dcod2lum_files FILES + +\/camera.lut - sample characteristics file of a camera +\n\/monitor.lut - sample characteristics file of a monitor +\n\/printer.lut - sample characteristics file of a printer +\n\/scanner.lut - sample characteristics file of a scanner + +\section dcod2lum_see_also SEE ALSO + +dcmdspfn(1) + +\section dcod2lum_copyright COPYRIGHT + +Copyright (C) 2002-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmimgle/docs/dconvlum.man b/dcmimgle/docs/dconvlum.man new file mode 100644 index 00000000..4db83171 --- /dev/null +++ b/dcmimgle/docs/dconvlum.man @@ -0,0 +1,59 @@ +/*! + +\if MANPAGES +\page dconvlum Convert VeriLUM files to DCMTK display files +\else +\page dconvlum dconvlum: Convert VeriLUM files to DCMTK display files +\endif + +\section dconvlum_synopsis SYNOPSIS + +\verbatim +dconvlum in-file out-file [ambient] +\endverbatim + +\section dconvlum_description DESCRIPTION + +Command line program that converts VeriLUM file with characteristic curve data +(\e CCx_xx.dat) to a format used for the Barten transformation in this toolkit. +VeriLUM is a calibration package from ImageSmiths consisting of a photometer +(with serial RS232 connector) and a Windows NT software. + +\section dconvlum_parameters PARAMETERS + +\verbatim +in-file VeriLUM characteristic curve file to be converted + +out-file DCMTK display file to be written + +ambient ambient light (cd/m^2, floating point value) +\endverbatim + +\section dconvlum_notes NOTES + +The output file describing the characteristic curve of a display system +(monitor) is a simple text file. Lines starting with a '#' are treated as +comments and therefore skipped as well as blank lines. This conversion +program creates such a file automatically (including some comment lines) by +transforming the information stored in the VeriLUM file. The number following +the magic word 'max' defines the maximum DDL value (e.g. 255 for 8 bit +displays). This definition is required before the luminance data can be +defined. Optionally the ambient light value can be specified in this file +too. The floating point value (in candela per square meter) must follow the +word 'amb'. Finally the luminance values are defined for each corresponding +DDL (digital driving level) value. The entries do not necessarily have to be +ordered or complete, i.e. there can be less than 'max' + 1 entries. Missing +values are calculated by cubic spline interpolation. + +See DICOM standard part 14 for more details on display calibration and +Barten's model (including GSDF). + +\section dconvlum_see_also SEE ALSO + +dcmdspfn(1), dcm2pnm(1) + +\section dconvlum_copyright COPYRIGHT + +Copyright (C) 1999-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmimgle/etc/Makefile.in b/dcmimgle/etc/Makefile.in new file mode 100644 index 00000000..f951e882 --- /dev/null +++ b/dcmimgle/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmimgle/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimgle/include/CMakeLists.txt b/dcmimgle/include/CMakeLists.txt new file mode 100644 index 00000000..f961a2e0 --- /dev/null +++ b/dcmimgle/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmimgle DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmimgle/include/Makefile.in b/dcmimgle/include/Makefile.in new file mode 100644 index 00000000..3c83b384 --- /dev/null +++ b/dcmimgle/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmimgle/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmimgle + for file in dcmtk/dcmimgle/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmimgle ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmimgle/include/dcmtk/dcmimgle/dcmimage.h b/dcmimgle/include/dcmtk/dcmimgle/dcmimage.h new file mode 100644 index 00000000..ab0cd15d --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dcmimage.h @@ -0,0 +1,1912 @@ +/* + * + * Copyright (C) 1996-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: Provides main interface to the "DICOM image toolkit" + * + */ + + +#ifndef DCMIMAGE_H +#define DCMIMAGE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dimoimg.h" +#include "dcmtk/dcmimgle/didispfn.h" +#include "dcmtk/dcmimgle/diutils.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DcmXfer; +class DcmObject; +class DcmOverlayData; +class DcmLongString; +class DcmUnsignedShort; + +class DiPixel; +class DiDocument; +class DiPluginFormat; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Interface class for dcmimgle/dcmimage module. + * The main purpose of these modules is image display. + */ +class DCMTK_DCMIMGLE_EXPORT DicomImage +{ + + public: + + // --- constructors and destructor + + /** constructor, open a DICOM file. + * Opens specified file and reads image related data, creates internal representation + * of image data. Use getStatus() to obtain detailed information about any errors. + * + ** @param filename the DICOM file + * @param flags configuration flags (see diutils.h, CIF_MayDetachPixelData is set automatically) + * @param fstart first frame to be processed (optional, 0 = 1st frame), all subsequent use + * of parameters labeled 'frame' in this class refers to this start frame. + * @param fcount number of frames (optional, 0 = all frames) + */ + DicomImage(const char *filename, + const unsigned long flags = 0, + const unsigned long fstart = 0, + const unsigned long fcount = 0); + +#ifndef STARVIEW + /** constructor, use a given DcmObject + * + ** @param object pointer to DICOM data structures (fileformat, dataset or item). + * (do not delete while referenced, i.e. while this image object or any + * descendant exists; not deleted within dcmimage unless configuration flag + * CIF_TakeOverExternalDataset is set - in this case do not delete it at all) + * @param xfer transfer syntax of the 'object'. + * (could also be EXS_Unknown in case of fileformat or dataset) + * @param flags configuration flags (CIF_xxx, see diutils.h) + * @param fstart first frame to be processed (optional, 0 = 1st frame), all subsequent use + * of parameters labeled 'frame' in this class refers to this start frame. + * @param fcount number of frames (optional, 0 = all frames) + */ + DicomImage(DcmObject *object, + const E_TransferSyntax xfer, + const unsigned long flags = 0, + const unsigned long fstart = 0, + const unsigned long fcount = 0); + + /** constructor, use a given DcmObject with specified rescale/slope. + * NB: This constructor ignores the Photometric Interpretation stored in the DICOM dataset + * and always creates a MONOCHROME2 image - useful in combination with Presentation States. + * + ** @param object pointer to DICOM data structures (fileformat, dataset or item). + * (do not delete while referenced, i.e. while this image object or any + * descendant exists; not deleted within dcmimage unless configuration flag + * CIF_TakeOverExternalDataset is set - in this case do not delete it at all) + * @param xfer transfer syntax of the 'object'. + * (could also be EXS_Unknown in case of fileformat or dataset) + * @param slope rescale slope (modality transformation) + * @param intercept rescale intercept (modality transformation) + * @param flags configuration flags (CIF_xxx, see diutils.h) + * @param fstart first frame to be processed (optional, 0 = 1st frame), all subsequent use + * of parameters labeled 'frame' in this class refers to this start frame. + * @param fcount number of frames (optional, 0 = all frames) + */ + DicomImage(DcmObject *object, + const E_TransferSyntax xfer, + const double slope, + const double intercept, + const unsigned long flags = 0, + const unsigned long fstart = 0, + const unsigned long fcount = 0); + + /** constructor, use a given DcmObject with specified modality LUT. + * NB: This constructor ignores the Photometric Interpretation stored in the DICOM dataset + * and always creates a MONOCHROME2 image - useful in combination with Presentation States. + * + ** @param object pointer to DICOM data structures (fileformat, dataset or item). + * (do not delete while referenced, i.e. while this image object or any + * descendant exists; not deleted within dcmimage unless configuration flag + * CIF_TakeOverExternalDataset is set - in this case do not delete it at all) + * @param xfer transfer syntax of the 'object'. + * (could also be EXS_Unknown in case of fileformat or dataset) + * @param data dataset element containing modality LUT data + * @param descriptor dataset element containing modality LUT descriptor + * @param explanation dataset element containing modality LUT explanation + * @param flags configuration flags (CIF_xxx, see diutils.h) + * @param fstart first frame to be processed (optional, 0 = 1st frame), all subsequent use + * of parameters labeled 'frame' in this class refers to this start frame. + * @param fcount number of frames (optional, 0 = all frames) + */ + DicomImage(DcmObject *object, + E_TransferSyntax xfer, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation = NULL, + const unsigned long flags = 0, + const unsigned long fstart = 0, + const unsigned long fcount = 0); +#endif + + /** destructor + */ + virtual ~DicomImage(); + + + // --- multi-frame handling + + /** process next couple of frames. If the image object has been created with less than the number + * of frames stored in the DICOM image, this function allows for accessing the subsequent frames. + * Multiple calls to this function allow for successively processing all frames stored in the + * file or dataset. See parameters 'fstart' and 'fcount' of the constructor for how to initially + * create an instance of this class. + * NB: Only "original" images can be processed in this way, i.e. images that were created by one + * of the above constructors. Images that were created by one of the createXXX() methods can + * not be processed since they are derived from original image data in a certain way, e.g. + * scaled. + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + inline int processNextFrames(const unsigned long fcount = 0) + { + return (Image != NULL) ? + Image->processNextFrames(fcount) : 0; + } + + + // --- information: return requested value if successful + + /** convert status code to status string + * + ** @param status code of current internal status + * + ** @return pointer to status string + */ + static const char *getString(const EI_Status status); + + /** convert photometric interpretation code to interpretation string (defined term) + * + ** @param interpret code of image's photometric interpretation + * + ** @return pointer to photometric interpretation string + */ + static const char *getString(const EP_Interpretation interpret); + + /** get current status information + * + ** @return status code + */ + inline EI_Status getStatus() const + { + return (Image != NULL) ? + Image->getStatus() : ImageStatus; + } + + /** get number of frames. + * Please note that this function does not return the number of frames stored in the + * DICOM file/dataset (use getNumberOfFrames() instead). It rather refers to the + * number of frames processed by this class (see constructors for details). + * + ** @return number of frames processed by this class + */ + inline unsigned long getFrameCount() const + { + return (Image != NULL) ? + Image->getNumberOfFrames() : 0; + } + + /** get index of first frame. + * This functions returns the index of the first frame processed by this class (see + * constructors for details). + * + ** @return index of first frame (0..n-1) + */ + inline unsigned long getFirstFrame() const + { + return (Image != NULL) ? + Image->getFirstFrame() : 0; + } + + /** get number of frames stored in the DICOM file/dataset. + * This attribute is mandatory for DICOM images with multiple frames. + * For single frame images, the value defaults to 1. + * + ** @return number of frames stored in the DICOM file/dataset + */ + inline unsigned long getNumberOfFrames() const + { + return (Image != NULL) ? + Image->getTotalNumberOfFrames() : 0; + } + + /** get index of representative frame. + * This attribute is optionally stored in the DICOM dataset (type 3). + * + ** @return index of representative frame (0..n-1) + */ + inline unsigned long getRepresentativeFrame() const + { + return (Image != NULL) ? + Image->getRepresentativeFrame() : 0; + } + + /** get nominal time (in milliseconds) between individual frames. + * This attribute might not always be stored in the DICOM dataset. + * + ** @return nominal time between individual frames, 0 if absent + */ + inline double getFrameTime() const + { + return (Image != NULL) ? + Image->getFrameTime() : 0; + } + + /** get image width in pixels + * + ** @return number of pixels in one row + */ + inline unsigned long getWidth() const + { + return (Image != NULL) ? + Image->getColumns() : 0; + } + + /** get image height in pixels + * + ** @return number of pixels in one column + */ + inline unsigned long getHeight() const + { + return (Image != NULL) ? + Image->getRows() : 0; + } + + /** get image depth + * + ** @return number of bits per sample of the internal representation + */ + inline int getDepth() const + { + return (Image != NULL) ? + Image->getBits() : 0; + } + + /** get minimum and maximum pixel values. + * the resulting pixel values are stored in 'double' variables to avoid problems + * with different number ranges, limited to monochrome images. + * Please note that the min/max values refer to the full pixel data (i.e. including + * all possible present frames as specified in the constructor of this class). + * + ** @param min minimum pixel value (reference parameter) + * @param max maximum pixel value (reference parameter) + * @param mode 0 = min/max 'used' pixel values, + * 1 = min/max 'possible' pixel values (absolute min/max) + * + ** @return status code (true if successful) + */ + inline int getMinMaxValues(double &min, + double &max, + const int mode = 0) const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getMinMaxValues(min, max, mode) : 0; + } + + /** get width height ratio (pixel aspect ratio: x/y). + * If present in the dataset and not overwritten using setWidthHeightRatio(), the following + * attributes are checked in order to determine this value: + * - Pixel Spacing, Imager Pixel Spacing, Nominal Scanned Pixel Spacing, Pixel Aspect Ratio. + * The first attribute (Pixel Spacing) is checked both on the main dataset level and within + * the Pixel Measures Sequence of the Shared Functional Groups Sequence (if present). + * + ** @return pixel aspect ratio (floating point value) + */ + inline double getWidthHeightRatio() const + { + return (Image != NULL) ? + Image->getColumnRowRatio() : 0; + } + + /** get height width ratio (pixel aspect ratio: y/x). + * If present in the dataset and not overwritten using setWidthHeightRatio(), the following + * attributes are checked in order to determine this value: + * - Pixel Spacing, Imager Pixel Spacing, Nominal Scanned Pixel Spacing, Pixel Aspect Ratio + * The first attribute (Pixel Spacing) is checked both on the main dataset level and within + * the Pixel Measures Sequence of the Shared Functional Groups Sequence (if present). + * + ** @return pixel aspect ratio (floating point value) + */ + inline double getHeightWidthRatio() const + { + return (Image != NULL) ? + Image->getRowColumnRatio() : 0; + } + + /** set width height ratio (pixel aspect ratio: x/y) + * + ** @param ratio pixel aspect ratio (x/y) + * + ** @return status code (true if successful) + */ + inline int setWidthHeightRatio(const double ratio) const + { + return (Image != NULL) ? + Image->setColumnRowRatio(ratio) : 0; + } + + /** set height width ratio (pixel aspect ratio: y/x) + * + ** @param ratio pixel aspect ratio (y/x) + * + ** @return status code (true if successful) + */ + inline int setHeightWidthRatio(const double ratio) const + { + return (Image != NULL) ? + Image->setRowColumnRatio(ratio) : 0; + } + + /** check whether given output value is unused + * + ** @param value output value to be checked + * + ** @return status, true if unused (1 = within output range, 2 = out of range), false otherwise + */ + inline int isOutputValueUnused(const unsigned long value) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->isValueUnused(value) : 0; + } + + // --- output: return pointer to output data if successful + + /** get number of bytes required for the rendered output of a single frame. + * This function determines the size of a rendered frame as created by getOutputData(). + * Therefore, it can be used to allocate a sufficiently large memory buffer and pass + * its size to the second variant of getOutputData(). + * + ** @param bits number of bits per sample used to render the pixel data + * (image depth, 1..MAX_BITS, 0 means 'bits stored' in the image) + * (MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * + ** @return number of bytes if successful, 0 otherwise + */ + inline unsigned long getOutputDataSize(const int bits = 0) const + { + return (Image != NULL) ? + Image->getOutputDataSize(Image->getBits(bits)) : 0; + } + + /** render pixel data and return pointer to internal memory buffer. + * apply VOI/PLUT transformation and (visible) overlay planes. + * internal memory buffer will be delete for the next getBitmap/Output operation. + * output data is always padded to 8, 16, 32, ... bits (bits allocated). + * Supported output color models: Monochrome 2 for monochrome images and RGB + * (or YCbCr_Full if flag CIF_KeepYCbCrColorModel is set) for color images. + * The rendered pixel data is always unsigned. + * + ** @param bits number of bits per sample used to render the pixel data + * (image depth, 1..MAX_BITS, 0 means 'bits stored' in the image) + * (MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * @param frame number of frame to be rendered (0..n-1) + * @param planar 0 = color-by-pixel (R1G1B1...R2G2B2...R3G3B3...), + * 1 = color-by-plane (R1R2R3...G1G2G3...B1B2B3...) + * (only applicable to multi-planar/color images, otherwise ignored) + * + ** @return pointer to internal memory buffer containing rendered pixel data + * (if successful, NULL otherwise) + */ + inline const void *getOutputData(const int bits = 0, + const unsigned long frame = 0, + const int planar = 0) + { + return (Image != NULL) ? + Image->getOutputData(frame, Image->getBits(bits), planar) : NULL; + } + + /** render pixel data and output to given memory buffer. + * apply VOI/PLUT transformation and (visible) overlay planes. + * output data is always padded to 8, 16, 32, ... bits (bits allocated). + * Supported output color models: Monochrome 2 for monochrome images and RGB + * (or YCbCr_Full if flag CIF_KeepYCbCrColorModel is set) for color images. + * The rendered pixel data is always unsigned. + * + ** @param buffer pointer to memory buffer (must already be allocated) + * @param size size of memory buffer (will be checked whether it is sufficient) + * @param bits number of bits per sample used to render the pixel data + * (image depth, 1..MAX_BITS, 0 means 'bits stored' in the image) + * (MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * @param frame number of frame to be rendered (0..n-1) + * @param planar 0 = color-by-pixel (R1G1B1...R2G2B2...R3G3B3...), + * 1 = color-by-plane (R1R2R3...G1G2G3...B1B2B3...) + * (only applicable to multi-planar/color images, otherwise ignored) + * + ** @return status code (true if successful) + */ + inline int getOutputData(void *buffer, + const unsigned long size, + const int bits = 0, + const unsigned long frame = 0, + const int planar = 0) + { + return (Image != NULL) ? + Image->getOutputData(buffer, size, frame, Image->getBits(bits), planar) : 0; + } + + /** render pixel data and return pointer to given plane (internal memory buffer). + * apply VOI/PLUT transformation and (visible) overlay planes. + * internal memory buffer will be delete for the next getBitmap/Output operation. + * Supported output color models: Monochrome 2 for monochrome images and RGB + * (or YCbCr_Full if flag CIF_KeepYCbCrColorModel is set) for color images. + * The rendered pixel data is always unsigned. + * + ** @param plane number of plane to be rendered + * + ** @return pointer to internal memory buffer containing rendered pixel data + * (if successful, NULL otherwise) + */ + inline const void *getOutputPlane(const int plane) const + { + return (Image != NULL) ? + Image->getOutputPlane(plane) : NULL; + } + + /** delete internal memory buffer used for rendered images. + * Save memory if data is no longer needed. + */ + inline void deleteOutputData() const + { + if (Image != NULL) + Image->deleteOutputData(); + } + + // --- misc + + /** check whether image is monochrome or not. + * + ** @return true if image is monochrome, false otherwise (i.e. color image) + */ + inline int isMonochrome() const + { + return (PhotometricInterpretation == EPI_Monochrome1) || (PhotometricInterpretation == EPI_Monochrome2); + } + + /** get code for photometric interpretation (color model). + * + ** @return code for photometric interpretation of the image + */ + inline EP_Interpretation getPhotometricInterpretation() const + { + return PhotometricInterpretation; + } + + /** check whether image has given SOP class UID. + * + ** @param uid SOP class UID to be checked + * + ** @return true if image has given SOP class UID, false otherwise + */ + int hasSOPclassUID(const char *uid) const; + + /** get intermediate pixel data representation (read-only). + * This function allows to access the pixel data after they have been extracted + * from the DICOM data element and the modality transformation has been applied + * (if present and not disabled). Please note that for monochrome images the + * internal representation might be signed whereas color images are automatically + * converted to unsigned RGB format. Pixels are aligned to 8, 16 or 32 bits. + * Always use DiPixel::getRepresentation() in order to determine the integer + * representation of the internally stored pixel data. + * + ** @return pointer to intermediate pixel data representation + */ + inline const DiPixel *getInterData() const + { + return (Image != NULL) ? + Image->getInterData() : NULL; + } + + // --- display function for output device characteristic (calibration): + // only applicable to grayscale images + + /** get display function + * + ** @return pointer to current display function, NULL if absent + */ + inline DiDisplayFunction *getDisplayFunction() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getDisplayFunction() : OFstatic_cast(DiDisplayFunction *, NULL); + } + + /** set display function + * + ** @param display object describing the output device characteristic (only referenced!) + * + ** @return true if successful, false otherwise + */ + inline int setDisplayFunction(DiDisplayFunction *display) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setDisplayFunction(display) : 0; + } + + /** set no display function. + * disables display function transformation, object is not deleted! + * + ** @return true if successful (1 = disabled current function, + * 2 = there was no function to disable), + * false otherwise + */ + inline int setNoDisplayFunction() + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setNoDisplayFunction() : 0; + } + + /** delete specified display LUT(s) + * + ** @param bits parameter of LUT to be deleted (0 = all) + * + ** @return true if successful, false otherwise + */ + inline int deleteDisplayLUT(const int bits = 0) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->deleteDisplayLUT(bits) : 0; + } + + /** convert P-value to DDL. + * conversion uses display LUT if present, linear scaling otherwise. + * + ** @param pvalue P-value to be converted (0..65535) + * @param ddl reference to resulting DDL + * @param bits number of bits for output + * + ** @return true if successful (1 = display function transformation, + * 2 = linear scaling), + * false otherwise + */ + inline int convertPValueToDDL(const Uint16 pvalue, + Uint16 &ddl, + const int bits = 8) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->convertPValueToDDL(pvalue, ddl, bits) : 0; + } + + // --- windowing (voi): only applicable to grayscale images + // return true if successful (see also 'dimoimg.cc') + + /** unset all VOI transformations (windows and LUTs). + * only applicable to monochrome images + * + ** @return true if successful (1 = previous window/LUT has been valid, + * 2 = otherwise), + * false otherwise (image is invalid or not monochrome) + */ + inline int setNoVoiTransformation() + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setNoVoiTransformation() : 0; + } + + /** set automatically calculated minimum/maximum window. + * possibly active VOI LUT is implicitly disabled. + * Please note that the min/max values refer to the full pixel data (i.e. including + * all possible present frames as specified in the constructor of this class). + * + ** @param idx ignore global min/max values if true (1) + * + ** @return true if successful (1 = window has changed, + * 2 = new window is the same as previous one), + * false otherwise + */ + inline int setMinMaxWindow(const int idx = 0) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setMinMaxWindow(idx) : 0; + } + + /** set automatically calculated histogram window. + * possibly active VOI LUT is implicitly disabled. + * + ** @param thresh threshold value specifying percentage of histogram border which + * shall be ignored (defaut: 5%). + * + ** @return true if successful, false otherwise + */ + inline int setHistogramWindow(const double thresh = 0.05) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setHistogramWindow(thresh) : 0; + } + + /** set automatically calculated VOI window for the specified Region of Interest (ROI). + * The ROI is specified by means of a rectangle (left, top, width, height). Only the part + * of the ROI that overlaps with the image is regarded - if the overlapping area is empty + * this method returns false (0). + * Possibly active VOI LUT is implicitly disabled. + * + ** @param left_pos x-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param top_pos y-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param width width in pixels of the rectangular ROI (minimum: 1) + * @param height height in pixels of the rectangular ROI (minimum: 1) + * @param frame index of the frame to be used for calculation (default: 0 = first) + * + ** @return true if successful (1 = window has changed, + * 2 = new window is the same as previous one), + * false otherwise + */ + inline int setRoiWindow(const unsigned long left_pos, + const unsigned long top_pos, + const unsigned long width, + const unsigned long height, + const unsigned long frame = 0) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setRoiWindow(left_pos, top_pos, width, height, frame) : 0; + } + + /** set specified VOI window (given by index to window width/center sequence stored in image + * file). + * possibly active VOI LUT is implicitly disabled. + * NB: This function does nothing if the flag CIF_UsePresentationState is set. + * + ** @param window index to window width/center sequence (0..n-1) + * + ** @return true if successful, false otherwise (none monochrome or invalid index) + */ + inline int setWindow(const unsigned long window) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setWindow(window) : 0; + } + + /** set specified VOI window (given by window width and center). + * possibly active VOI LUT is implicitly disabled. + * + ** @param center center of specified window + * @param width width of specified window (>= 1.0) + * + ** @return true if successful (1 = window has changed, + * 2 = new window is the same as previous one), + * false otherwise + */ + inline int setWindow(const double center, + const double width) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setWindow(center, width) : 0; + } + + /** get current VOI window as window center and width values + * + ** @param center return current window center value + * @param width return current window width value + * + ** @return true if successful, false otherwise + */ + inline int getWindow(double ¢er, + double &width) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getWindow(center, width) : 0; + } + + /** get number of VOI windows (stored in image file). + * NB: This function does nothing if the flag CIF_UsePresentationState is set. + * + ** @return number of VOI windows + */ + inline unsigned long getWindowCount() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getWindowCount() : 0; + } + + /** set VOI LUT function + * + ** @param function type of VOI LUT function (default, linear or sigmoid). + * 'default' basically means the same as 'linear'. + * + ** @return true if successful (1 = function has changed, + * 2 = function has not changed), + * false otherwise + */ + inline int setVoiLutFunction(const EF_VoiLutFunction function) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setVoiLutFunction(function) : 0; + } + + /** get VOI LUT function. + * possible values are: EFV_Default, EFV_Linear, EFV_Sigmoid. + * + ** @return currently active VOI LUT function or EFV_Default if not set + */ + inline EF_VoiLutFunction getVoiLutFunction() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getVoiLutFunction() : EFV_Default; + } + + /** set VOI LUT (given by dcmdata elements). + * possibly active window/center is implicitly disabled. + * Given data is only referenced and not copied! Make sure that the corresponding DcmXXX + * objects exist as long as the VOI LUT is set. + * + ** @param data contains LUT data + * @param descriptor describes LUT structure + * @param explanation free form description of VOI LUT (optional) + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise + */ + inline int setVoiLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation = NULL, + const EL_BitsPerTableEntry descripMode = ELM_UseValue) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setVoiLut(data, descriptor, explanation, descripMode) : 0; + } + + /** set VOI LUT (given by index to VOI LUT sequence stored in image file). + * possibly active window/center is implicitly disabled. + * NB: This function does nothing if the flag CIF_UsePresentationState is set. + * + ** @param table index to VOI LUT sequence (0..n-1) + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise (none monochrome or invalid index) + */ + inline int setVoiLut(const unsigned long table, + const EL_BitsPerTableEntry descripMode = ELM_UseValue) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setVoiLut(table, descripMode) : 0; + } + + /** get number of VOI LUTs (stored in image file) + * + ** @return number of VOI LUTs + */ + inline unsigned long getVoiLutCount() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getVoiLutCount() : 0; + } + + /** get description of active VOI transformation + * + ** @return pointer to description text (NULL if absent) + */ + inline const char *getVoiTransformationExplanation() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getVoiTransformationExplanation() : OFstatic_cast(const char *, NULL); + } + + /** get description of specified VOI window (stored in the image file) + * + ** @param window index of the stored VOI window (0..n-1) + * @param explanation variable in which the explanation string is stored + * + ** @return pointer to description text (NULL if absent or index invalid) + */ + inline const char *getVoiWindowExplanation(const unsigned long window, + OFString &explanation) const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getVoiWindowExplanation(window, explanation) : OFstatic_cast(const char *, NULL); + } + + /** get description of specified VOI LUT (stored in the image file) + * + ** @param table index of the stored VOI LUT (0..n-1) + * @param explanation variable in which the explanation string is stored + * + ** @return pointer to description text (NULL if absent or index invalid) + */ + inline const char *getVoiLutExplanation(const unsigned long table, + OFString &explanation) const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getVoiLutExplanation(table, explanation) : OFstatic_cast(const char *, NULL); + } + + /** get description of performed modality LUT transformation + * + ** @return pointer to description text (NULL if absent) + */ + inline const char *getModalityLutExplanation() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getModalityLutExplanation() : OFstatic_cast(const char *, NULL); + } + + // --- hardcopy parameters + + /** get polarity. applicable to monochrome and color images. + * possible values are EPP_Normal and EPP_Reverse + * + ** @return currently active polarity mode or EPP_Normal if not applicable + */ + inline EP_Polarity getPolarity() const + { + return (Image != NULL) ? + Image->getPolarity() : EPP_Normal; + } + + /** set polarity. applicable to monochrome and color images. + * + ** @param polarity polarity (normal or reverse) + * + ** @return true if successful (1 = polarity has changed, + * 2 = polarity has not changed), + * false otherwise + */ + inline int setPolarity(const EP_Polarity polarity) + { + return (Image != NULL) ? + Image->setPolarity(polarity) : 0; + } + + /** set hardcopy parameters. only applicable to monochrome images. + * used to display LinOD images + * + ** @param min minimum density of the print-out (in hundreds of Optical Density, + * e.g. 150 means 1.5 OD) + * @param max maximum density of the print-out (ditto) + * @param reflect reflected ambient light (in candela per square meter - cd/m^2) + * @param illumin illumination (ditto) + * + ** @return true if successful (1 = at least one of the parameters has changed, + * 2 = no parameter has changed), + * false otherwise + */ + inline int setHardcopyParameters(const unsigned int min, + const unsigned int max, + const unsigned int reflect, + const unsigned int illumin) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setHardcopyParameters(min, max, reflect, illumin) : 0; + } + + // --- presentation LUT: only applicable to grayscale images + + /** get shape for presentation transformation. + * possible values are: ESP_Default, ESP_Identity, ESP_Inverse, ESP_LinOD. + * If a presentation LUT is currently active ESP_Default is always returned. + * + ** @return currently active presentation LUT shape or ESP_Default if not set + */ + inline ES_PresentationLut getPresentationLutShape() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getPresentationLutShape() : ESP_Default; + } + + /** set shape for presentation transformation. + * possibly active presentation LUT is implicitly disabled. + * + ** @param shape presentation LUT shape (default, identity, inverse or lin OD). + * 'default' means that the output data is always created with 0 for black + * and maxvalue for white (i.e. monochrome2 data is created for output). + * + ** @return true if successful (1 = shape has changed, + * 2 = shape has not changed), + * false otherwise + */ + inline int setPresentationLutShape(const ES_PresentationLut shape) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setPresentationLutShape(shape) : 0; + } + + /** set LUT for presentation transformation. + * possibly active presentation LUT is implicitly disabled. + * Given data is only referenced and not copied! Make sure that the corresponding DcmXXX + * objects exist as long as the presentation LUT is set. + * + ** @param data contains LUT data + * @param descriptor describes LUT structure + * @param explanation free form description of presentation LUT (optional) + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise + */ + inline int setPresentationLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation = NULL, + const EL_BitsPerTableEntry descripMode = ELM_UseValue) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setPresentationLut(data, descriptor, explanation, descripMode) : 0; + } + + /** get description of active presentation LUT + * + ** @return pointer to description text (NULL if absent) + */ + inline const char *getPresentationLutExplanation() const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getPresentationLutExplanation() : OFstatic_cast(const char *, NULL); + } + + /** set inverse LUT for presentation transformation. + * this LUT transform is e.g. used for DICOM print (12->8, 8->12 bit) + * possibly active presentation LUT will not be considered! + * + ** @param data contains LUT data + * @param descriptor describes LUT structure + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise + */ + inline int setInversePresentationLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const EL_BitsPerTableEntry descripMode = ELM_UseValue) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->setInversePresentationLut(data, descriptor, descripMode) : 0; + } + + // --- overlays: return true (!0) if successful (see also 'diovlay.cc') + // only applicable to grayscale images + + /** add specified plane to group of additional overlay planes. + * replaces old overlay plane if group number already exists. + * + ** @param group group number (0x60nn) of overlay plane + * @param width width of overlay plane (in pixels) + * @param height height of overlay plane (in pixels) + * @param left_pos x coordinate of plane origin (referring to image origin) + * @param top_pos y coordinate of plane origin + * @param data overlay plane data (dcmdata element) + * @param label overlay plane label + * @param description overlay plane description + * @param mode display mode (see 'diutils.h') + * + ** @return false (0) if an error occurred, true otherwise (1 = added new plane, + * 2 = replaced existing plane) + */ + inline int addOverlay(const unsigned int group, + const signed int left_pos, + const signed int top_pos, + const unsigned int width, + const unsigned int height, + const DcmOverlayData &data, + const DcmLongString &label, + const DcmLongString &description, + const EM_Overlay mode = EMO_Default) + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->addOverlay(group, left_pos, top_pos, width, height, data, label, description, mode) : 0; + } + + /** remove specified (additional) overlay plane + * + ** @param group group number (0x60nn) of overlay plane + * + ** @return false (0) if an error occurred (e.g. plane doesn't exist), true otherwise + */ + inline int removeOverlay(const unsigned int group) + { + return ((Image != NULL) && (Image->getOverlayPtr(1) != NULL)) ? + Image->getOverlayPtr(1)->removePlane(group) : 0; + } + + /** remove all additional overlay planes + * + ** @return false (0) if an error occurred, true otherwise (1 = all planes deleted, + * 2 = no planes to be deleted) + */ + inline int removeAllOverlays() + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->removeAllOverlays() : 0; + } + + /** check whether specified overlay plane is visible/activated. + * see show/hideOverlay() to modify the visibility status. + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return true (1) if overlay plane is visible, false (0) otherwise + */ + inline int isOverlayVisible(const unsigned int plane, + const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->isPlaneVisible(plane) : 0; + } + + /** activate specified overlay plane + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return false (0) if an error occurred, true otherwise (1 = plane successfully activated, + * 2 = plane has already been visible) + */ + inline int showOverlay(const unsigned int plane, + const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->showPlane(plane) : 0; + } + + /** activate specified overlay plane and change some parameters + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param mode display mode (see 'diutils.h') + * @param fore plane's foreground color (in percent, default: 1.0) + * @param thresh threshold value (in percent, default: 0.5), only for EMO_ThresholdReplace + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return false (0) if an error occurred, true otherwise + */ + inline int showOverlay(const unsigned int plane, + const EM_Overlay mode, + const double fore = 1.0, + const double thresh = 0.5, + const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->showPlane(plane, fore, thresh, mode) : 0; + } + + /** activate specified overlay plane and change 'pvalue' (only for bitmap shutters) + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param pvalue P-value used to display overlay plane + * + ** @return false (0) if an error occurred, true otherwise + */ + inline int showOverlay(const unsigned int plane, + const Uint16 pvalue) + { + return ((Image != NULL) && (Image->getOverlayPtr(1) != NULL)) ? + Image->getOverlayPtr(1)->showPlane(plane, pvalue) : 0; + } + + /** activate all overlay planes (make them visible) + * + ** @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return false (0) if an error occurred, true otherwise (1 = planes have been successfully activated, + * 2 = no planes to be activated) + */ + inline int showAllOverlays(const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->showAllPlanes() : 0; + } + + /** activate all overlay planes and set specified parameters + * + ** @param mode display mode (see 'diutils.h') + * @param fore plane's foreground color (in percent, default: 1.0) + * @param thresh threshold value (in percent, default: 0.5), only for EMO_ThresholdReplace + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return false (0) if an error occurred, true otherwise (1 = planes have been successfully activated, + * 2 = no planes to be activated) + */ + inline int showAllOverlays(const EM_Overlay mode, + const double fore = 1, + const double thresh = 0.5, + const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->showAllPlanes(fore, thresh, mode) : 0; + } + + /** deactivate specified overlay plane + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return false (0) if an error occurred, true otherwise (1 = plane successfully deactivated, + * 2 = plane has already been invisible) + */ + inline int hideOverlay(const unsigned int plane, + const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->hidePlane(plane) : 0; + } + + /** deactivate all overlay planes (make them invisible) + * + ** @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return false (0) if an error occurred, true otherwise (1 = planes have been successfully deactivated, + * 2 = no planes to be deactivated) + */ + inline int hideAllOverlays(const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->hideAllPlanes() : 0; + } + + /** move origin of specified overlay plane to given position + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param left_pos x coordinate of new plane origin (origin = 0) + * @param top_pos y coordinate of new plane origin (origin = 0) + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return false (0) if an error occurred, true otherwise (1 = plane has been successfully moved, + * 2 = old and new position are equal, nothing to do) + */ + inline int placeOverlay(const unsigned int plane, + const signed int left_pos, + const signed int top_pos, + const unsigned int idx = 0) + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->placePlane(plane, left_pos, top_pos) : 0; + } + + /** get number of overlay planes + * + ** @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return number of overlay planes stored in the image + */ + inline unsigned int getOverlayCount(const unsigned int idx = 0) const + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->getCount() : 0; + } + + /** get group number of specified overlay plane + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return group number of given overlay plane if successful, false (0) otherwise + */ + inline unsigned int getOverlayGroupNumber(const unsigned int plane, + const unsigned int idx = 0) const + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->getPlaneGroupNumber(plane) : 0; + } + + /** get label of specified overlay plane + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return pointer to overlay plane label if successful, false (NULL) otherwise + */ + inline const char *getOverlayLabel(const unsigned int plane, + const unsigned int idx = 0) const + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->getPlaneLabel(plane) : OFstatic_cast(const char *, NULL); + } + + /** get description of specified overlay plane + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return pointer to overlay plane description if successful, false (NULL) otherwise + */ + inline const char *getOverlayDescription(const unsigned int plane, + const unsigned int idx = 0) const + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->getPlaneDescription(plane) : OFstatic_cast(const char *, NULL); + } + + /** get mode of specified overlay plane + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param idx index of overlay group (0 = dataset, 1 = additional), default: 0 + * + ** @return mode of overlay plane if successful, EMO_Default otherwise + */ + inline EM_Overlay getOverlayMode(const unsigned int plane, + const unsigned int idx = 0) const + { + return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ? + Image->getOverlayPtr(idx)->getPlaneMode(plane) : EMO_Default; + } + + /** create bitmap for specified overlay plane. + * (up to 16 bits per pixel with two values: 'fore' and 'back') + * Please note that the current origin of the overlay plane is used. Furthermore, the size + * of the overlay plane is restricted to the size of the surrounding image. Use the method + * getFullOverlayData() if the complete bitmap data is required regardless of its position. + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param left_pos returns x coordinate of plane's origin + * @param top_pos returns y coordinate of plane's origin + * @param mode returns display mode (see 'diutils.h') + * @param frame index of frame used for output (default: 0 = first) + * @param bits number of bits (stored) in the resulting array, default: 8, range: 1..16 + * Used to mask the values for foreground and background color. The resulting + * array is always padded to 8 or 16 bits with 1, 8 or 16 bits allocated + * depending on the value of 'bits'. + * @param fore foreground color to be set in bitmap, default: 255, range: 0..2^bits-1 + * @param back background color to be set in bitmap (transparent), default: 0, range: 0..2^bits-1 + * @param idx index of overlay group (0 = dataset, planes stored in the image dataset; + * 1 = additional, planes added by addOverlay(); + * 2 = 'additional' overlay planes hide 'dataset' planes + * when the overlay group number exists in both), + * default: 2 + * + ** @return pointer to overlay plane data (internal memory buffer) + */ + const void *getOverlayData(const unsigned int plane, + unsigned int &left_pos, + unsigned int &top_pos, + unsigned int &width, + unsigned int &height, + EM_Overlay &mode, + const unsigned long frame = 0, + const int bits = 8, + const Uint16 fore = 0xff, + const Uint16 back = 0x0, + const unsigned int idx = 2) const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getOverlayData(frame, plane, left_pos, top_pos, width, height, mode, idx, bits, fore, back) : NULL; + } + + /** create bitmap for specified overlay plane. + * (up to 16 bits per pixel with two values: 'fore' and 'back') + * In contrast to the previous method the full bitmap data is always returned. + * + ** @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param frame index of frame used for output (default: 0 = first) + * @param bits number of bits (stored) in the resulting array, default: 8, range: 1..16 + * Used to mask the values for foreground and background color. The resulting + * array is always padded to 8 or 16 bits with 1, 8 or 16 bits allocated + * depending on the value of 'bits'. + * @param fore foreground color to be set in bitmap, default: 255, range: 0..2^bits-1 + * @param back background color to be set in bitmap (transparent), default: 0, range: 0..2^bits-1 + * @param idx index of overlay group (0 = dataset, planes stored in the image dataset; + * 1 = additional, planes added by addOverlay()), + * default: 0 + * + ** @return pointer to overlay plane data (internal memory buffer) + */ + const void *getFullOverlayData(const unsigned int plane, + unsigned int &width, + unsigned int &height, + const unsigned long frame = 0, + const int bits = 8, + const Uint16 fore = 0xff, + const Uint16 back = 0x0, + const unsigned int idx = 0) const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->getFullOverlayData(frame, plane, width, height, idx, bits, fore, back) : NULL; + } + + /** delete buffer for overlay plane data. + * Save memory if data is no longer needed. + */ + inline void deleteOverlayData() const + { + if ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) + Image->getMonoImagePtr()->deleteOverlayData(); + } + + /** create bitmap for specified overlay plane and store it in (6xxx,3000) format. + * (1 bit allocated and stored, foreground color is 1, background color is 0, + * data is 16 bit padded - even length) + * memory is allocated but not handled internally - must be deleted from calling program. + * + ** @param buffer stores pointer to overlay data (memory is allocated internally) + * @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param frames returns number of frames + * @param idx index of overlay group (0 = dataset, planes stored in the image dataset; + * 1 = additional, planes added by addOverlay()), + * default: 0 + * + ** @return number of bytes allocated for the 'buffer' if successful, 0 otherwise + */ + unsigned long create6xxx3000OverlayData(Uint8 *&buffer, + const unsigned int plane, + unsigned int &width, + unsigned int &height, + unsigned long &frames, + const unsigned int idx = 0) const + { + return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ? + Image->getMonoImagePtr()->create6xxx3000OverlayData(buffer, plane, width, height, frames, idx) : 0; + } + + + // --- create...Image: return pointer to new 'DicomImage' object, memory isn't handled internally ! + + /** create copy of current image object. + * memory is not handled internally - must be deleted from calling program. + * + ** @param fstart first frame to be processed (0 = 1st frame) + * @param fcount number of frames (0 = all frames) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createDicomImage(unsigned long fstart = 0, + unsigned long fcount = 0) const; + + /** create scaled copy of current image object (given by exact size). + * memory is not handled internally - must be deleted from calling program. + * + ** @param width width of new image (in pixels) + * @param height height of new image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createScaledImage(const unsigned long width, + const unsigned long height = 0, + const int interpolate = 0, + int aspect = 0) const; + + /** create scaled copy of current image object (given by scaling factors). + * memory is not handled internally - must be deleted from calling program. + * + ** @param xfactor width of new image is multiplied with this factor (> 0) + * @param yfactor height of new image is multiplied with this factor (> 0) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createScaledImage(const double xfactor, + const double yfactor = 0, + const int interpolate = 0, + const int aspect = 0) const; + + /** create scaled copy of specified (clipping) area of the current image object. + * memory is not handled internally - must be deleted from calling program. + * NB: Clipping and interpolated scaling at the same moment is not yet fully implemented! + * + ** @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param clip_width width of area to be scaled + * @param clip_height height of area to be scaled + * @param scale_width width of scaled image (in pixels) + * @param scale_height height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createScaledImage(const signed long left_pos, + const signed long top_pos, + unsigned long clip_width, + unsigned long clip_height, + unsigned long scale_width = 0, + unsigned long scale_height = 0, + const int interpolate = 0, + int aspect = 0, + const Uint16 pvalue = 0) const; + + /** create scaled copy of specified (clipping) area of the current image object. + * memory is not handled internally - must be deleted from calling program. + * NB: Clipping and interpolated scaling at the same moment is not yet fully implemented! + * + ** @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param width width of area to be scaled + * @param height height of area to be scaled + * @param xfactor width of new image is multiplied with this factor (> 0) + * @param yfactor height of new image is multiplied with this factor (> 0) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createScaledImage(const signed long left_pos, + const signed long top_pos, + unsigned long width, + unsigned long height, + const double xfactor, + const double yfactor = 0, + const int interpolate = 0, + const int aspect = 0, + const Uint16 pvalue = 0) const; + + /** create copy of specified area of the current image object (clipping). + * memory is not handled internally - must be deleted from calling program. + * + ** @param left_pos x coordinate of top left corner of area to be copied + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be copied + * @param width width of area to be copied/clipped + * @param height height of area to be copied/clipped + * @param pvalue P-value used for the border outside the image (0..65535) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createClippedImage(const signed long left_pos, + const signed long top_pos, + unsigned long width = 0, + unsigned long height = 0, + const Uint16 pvalue = 0) const; + + /** flip current image (horizontally and/or vertically) + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return true if successful (1 = flipped at least direction, + * 2 = not flipped, because of image resolution - width and/or height equal to 1), + * false otherwise + */ + int flipImage(int horz = 1, + int vert = 0) const; + + /** create a flipped copy of the current image. + * memory is not handled internally - must be deleted from calling program. + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createFlippedImage(int horz = 1, + int vert = 0) const; + + /** rotate current image (by steps of 90 degrees) + * + ** @param degree angle by which the image shall be rotated (-360, -270, -180, -90, 0, 90, 180, 270, 360) + * + ** @return true if successful (1 = rotated by at least 90 degrees, + * 2 = not rotated, because of image resolution or angle), + * false otherwise + */ + int rotateImage(signed int degree) const; + + /** create a rotated copy of the current image. + * memory is not handled internally - must be deleted from calling program. + * + ** @param degree angle by which the image shall be rotated (-360, -270, -180, -90, 0, 90, 180, 270, 360) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createRotatedImage(signed int degree) const; + + /** create monochrome copy of the current image. + * equal to createDicomImage() for monochrome images. + * memory is not handled internally - must be deleted from calling program. + * This method does not work if original YCbCr color model is retained (see CIF_KeepYCbCrColorModel). + * + ** @param red coefficient by which the red component is weighted (default: NTSC value) + * @param green coefficient by which the green component is weighted (default: NTSC value) + * @param blue coefficient by which the blue component is weighted (default: NTSC value) + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createMonochromeImage(const double red = 0.299, + const double green = 0.587, + const double blue = 0.114) const; + + /** create true color (24/32 bit) or palette (8 bit) bitmap for MS Windows. + * 8 bit images require an appropriate color palette (256 entries, values: 0 to 255) and are only + * applicable to monochrome images, the beginning of a each line starts on a 32-bit address (if + * 'padding' is true); 24 bit images store 24 bits per pixel (BGR) and do align each line to a + * 32-bit address (if 'padding' is true); 32 bit images store 32 bits per pixel (ARGB), but only + * use the lower 24 bits (-RGB). + * The memory buffer can be allocated both externally (from the calling program) and internally + * (inside this class/module). If the 'data' parameter is not NULL and the 'size' parameter, which + * describes the size (in bytes) of the allocated buffer, is sufficiently large, the bitmap is stored + * in this buffer. Otherwise (i.e. 'data' is NULL) the memory is allocated internally. Please note + * that in both cases the memory is not handled internally after this method has finished and, + * therefore, must be deleted from the calling program. + * This method does not work if original YCbCr color model is retained (see CIF_KeepYCbCrColorModel). + * + ** @param data untyped pointer memory buffer (set to NULL if not allocated externally) + * @param size size of the memory buffer in bytes (if 0 'data' is set to NULL) + * @param frame index of frame to be converted (default: 0 = first frame) + * @param bits number of bits per pixel used for the output bitmap (8, 24 or 32, default: 24) + * @param upsideDown flag indicating whether the first line stored is the top-most (default: 0) or + * the bottom-most of the source image (as required by the BMP file format) + * @param padding align each line to a 32-bit address if true (default) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createWindowsDIB(void *&data, + const unsigned long size, + const unsigned long frame = 0, + const int bits = 24, + const int upsideDown = 0, + const int padding = 1) + { + return (Image != NULL) ? + Image->createDIB(data, size, frame, bits, upsideDown, padding) : 0; + } + + /** create true color (32 bit) or palette (8 bit) bitmap for Java (AWT default format). + * 32 bit images allocate 32 bits per pixel (RGB), but only use the upper 24 bits. The sample + * order for color images is: Red, Green, Blue. + * Memory is not handled internally - must be deleted from calling program. + * This method does not work if original YCbCr color model is retained (see CIF_KeepYCbCrColorModel). + * + ** @param data resulting pointer to bitmap data (set to NULL if an error occurred) + * @param frame index of frame to be converted (default: 0 = first frame) + * @param bits number of bits per pixel used for the output bitmap (8 or 32, default: 32) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createJavaAWTBitmap(void *&data, + const unsigned long frame = 0, + const int bits = 32) + { + return (Image != NULL) ? + Image->createAWTBitmap(data, frame, bits) : 0; + } + + /** create 12 bit packed (monochrome) bitmap for DICOM printers. + * Memory is not handled internally - must be deleted from calling program. + * + ** @param buffer pointer to input memory buffer (16 bits allocated, 12 bits stored) + * @param size size of memory buffer (will be checked whether it is sufficient) + * @param count number of entries (pixels) in input buffer + * + ** @return pointer to memory buffer containing the packed output bitmap data (NULL if an error occurred) + */ + static void *create12BitPackedBitmap(const void *buffer, + const unsigned long size, + const unsigned long count) + { + return DiMonoImage::createPackedBitmap(buffer, size, count, 16, 12); + } + + /** create new single frame DicomImage with applied grayscale transformations. + * The method getOutputData() is used internally for the new bitmap. + * Limited to monochrome images. + * + ** @param frame index of frame to be converted + * @param bits number of bits per pixel used for the output bitmap + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DicomImage *createMonoOutputImage(const unsigned long frame, + const int bits); + + // --- output image file: return true ('1') if successful + + /** render pixel data of the given frame and write image related attributes to DICOM dataset. + * Applies VOI/PLUT transformation and (visible) overlay planes, output data is + * always padded to 8, 16, 32, ... bits (bits allocated). Replaces any modality + * transformation in the dataset by a linear rescale/slope since the modality + * transformation is rendered into the pixel data. Replaces the VOI transformations + * in the dataset by a "max range" VOI window. Removes all Overlay Plane Module + * attributes for embedded overlay planes from the dataset. + * Writes the following DICOM attributes (from Image Pixel Module): + * - Photometric Interpretation, Samples per Pixel + * - Columns, Rows, Number of Frames + * - Bits Allocated, Bits Stored, High Bit + * - Planar Configuration (only if "Samples per Pixel" is greater than 1) + * - Pixel Representation, Pixel Data + * Updates the following DICOM attributes (if present in the original image dataset): + * - Pixel Spacing and/or Pixel Aspect Ratio + * Supported output color models: Monochrome 2 for monochrome images and RGB + * (or YCbCr_Full if flag CIF_KeepYCbCrColorModel is set) for color images. + * + ** @param dataset reference to DICOM dataset where the image attributes are stored + * @param bits number of bits per sample (image depth, 1..MAX_BITS) + * @param frame number of frame to be rendered (0..n-1) + * @param planar 0 = color-by-pixel (R1G1B1...R2G2B2...R3G3B3...), + * 1 = color-by-plane (R1R2R3...G1G2G3...B1B2B3...) + * (only applicable to multi-planar/color images, otherwise ignored) + * + ** @return true if successful, false otherwise + */ + inline int writeFrameToDataset(DcmItem &dataset, + const int bits = 0, + const unsigned long frame = 0, + const int planar = 0) + { + return (Image != NULL) ? + Image->writeFrameToDataset(dataset, frame, bits, planar) : 0; + } + + /** write current image and related attributes to DICOM dataset. + * Uses the internal representation of the pixel data, therefore the output data is + * always padded to 8, 16, 32, ... bits (bits allocated). Replaces any modality + * transformation in the dataset by a linear rescale/slope since the modality + * transformation is rendered into the pixel data. Removes all Overlay Plane Module + * attributes for embedded overlay planes from the dataset. + * Writes the following DICOM attributes (from Image Pixel Module): + * - Photometric Interpretation, Samples per Pixel + * - Columns, Rows, Number of Frames + * - Bits Allocated, Bits Stored, High Bit + * - Planar Configuration (only if "Samples per Pixel" is greater than 1) + * - Pixel Representation, Pixel Data + * Updates the following DICOM attributes (if present in the original image dataset): + * - Pixel Spacing and/or Pixel Aspect Ratio + * Supported output color models: Monochrome 1 or 2 for monochrome images and RGB + * (or YCbCr_Full if flag CIF_KeepYCbCrColorModel is set) for color images. + * + ** @param dataset reference to DICOM dataset where the image attributes are stored + * @param mode 0 = determine value of BitsStored from 'used' pixel values, + * 1 = determine value of BitsStored from 'possible' pixel values + * (used for monochrome images only) + * @param planar 0 = color-by-pixel (R1G1B1...R2G2B2...R3G3B3...), + * 1 = color-by-plane (R1R2R3...G1G2G3...B1B2B3...), + * 2 = same as original DICOM image (i.e. color-by-pixel or color-by-plane) + * (only applicable to multi-planar/color images, otherwise ignored) + * + ** @return true if successful, false otherwise + */ + inline int writeImageToDataset(DcmItem &dataset, + const int mode = 0, + const int planar = 2) + { + return (Image != NULL) ? + Image->writeImageToDataset(dataset, mode, planar) : 0; + } + + /** write pixel data to PPM file (specified by filename). + * pixel data is written in ASCII format. + * This method does not work if original YCbCr color model is retained + * (see CIF_KeepYCbCrColorModel). + * + ** @param filename name of output file (%d is replaced by frame number if present) + * @param bits number of bits used for output of pixel data + * (default: full resolution, max: 32; + * MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writePPM(const char *filename, + const int bits = 0, + const unsigned long frame = 0); + + /** write pixel data to PPM file (specified by open C++ stream). + * pixel data is written in ASCII format. + * This method does not work if original YCbCr color model is retained + * (see CIF_KeepYCbCrColorModel). + * + ** @param stream open C++ output stream + * @param bits number of bits used for output of pixel data + * (default: full resolution, max: 32; + * MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writePPM(STD_NAMESPACE ostream& stream, + const int bits = 0, + const unsigned long frame = 0); + + /** write pixel data to PPM file (specified by open C stream). + * pixel data is written in ASCII format. + * This method does not work if original YCbCr color model is retained + * (see CIF_KeepYCbCrColorModel). + * + ** @param stream open C output stream + * @param bits number of bits used for output of pixel data + * (default: full resolution, max: 32; + * MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writePPM(FILE *stream, + const int bits = 0, + const unsigned long frame = 0); + + /** write pixel data to raw PPM file (specified by filename). + * pixel data is written in binary format. + * This method does not work if original YCbCr color model is retained + * (see CIF_KeepYCbCrColorModel). + * + ** @param filename name of output file (%d is replaced by frame number if present) + * @param bits number of bits used for output of pixel data + * (default: full resolution, max: 8; + * MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writeRawPPM(const char *filename, + const int bits = 0, + const unsigned long frame= 0); + + /** write pixel data to raw PPM file (specified by open C stream). + * pixel data is written in binary format. + * This method does not work if original YCbCr color model is retained + * (see CIF_KeepYCbCrColorModel). + * + ** @param stream open C output stream (binary mode required!) + * @param bits number of bits used for output of pixel data + * (default: full resolution, max: 8; + * MI_PastelColor = -1 for true color pastel mode, EXPERIMENTAL) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writeRawPPM(FILE *stream, + const int bits = 0, + const unsigned long frame = 0); + + /** write pixel data to BMP file (specified by open C stream). + * pixel data is written in palette or truecolor mode. + * This method does not work if original YCbCr color model is retained + * (see CIF_KeepYCbCrColorModel). + * + ** @param stream open C output stream (binary mode required!) + * @param bits number of bits used for output of pixel data + * (8, 24 or 32, default (0): 8 for monochrome and 24 for color images) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writeBMP(FILE *stream, + const int bits = 0, + const unsigned long frame = 0); + + /** write pixel data to BMP file (specified by filename). + * pixel data is written in palette or truecolor mode. + * This method does not work if original YCbCr color model is retained + * (see CIF_KeepYCbCrColorModel). + * + ** @param filename name of output file (%d is replaced by frame number if present) + * @param bits number of bits used for output of pixel data + * (8, 24 or 32, default (0): 8 for monochrome and 24 for color images) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writeBMP(const char *filename, + const int bits = 0, + const unsigned long frame = 0); + + /** write pixel data to pluggable image format file (specified by open C stream). + * Format specific parameters may be set directly in the instantiated 'plugin' class. + * + ** @param plugin pointer to image format plugin (derived from abstract class DiPluginFormat) + * @param stream open C output stream (binary mode required!) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writePluginFormat(const DiPluginFormat *plugin, + FILE *stream, + const unsigned long frame = 0); + + /** write pixel data to pluggable image format file (specified by filename). + * Format specific parameters may be set directly in the instantiated 'plugin' class. + * + ** @param plugin pointer to image format plugin (derived from abstract class DiPluginFormat) + * @param filename name of output file (%d is replaced by frame number if present) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + int writePluginFormat(const DiPluginFormat *plugin, + const char *filename, + const unsigned long frame = 0); + + + protected: + + /** constructor, create copy of given image object with different image data and photometric interpretation + * + ** @param dicom source object to be copied + * @param image new image data + * @param interpret new photometric interpretation + */ + DicomImage(const DicomImage *dicom, + DiImage *image, + const EP_Interpretation interpret = EPI_Unknown); + + /** initialize object. + * create internal image object depending on color model. is used for all 'real' constructors. + */ + void Init(); + + /** check whether data dictionary is present + * + ** @return true if dictionary is present, false otherwise + */ + int checkDataDictionary(); + + /** get SOP class UID of current image object + * + ** @return SOP class UID (or NULL if an error occurred) + */ + const char *getSOPclassUID() const; + + /** normalize given degree value (for internal use). + * negative value are mapped to positive range (-360 -> 0, -270 -> 90, -180 -> 180, -90 -> 270), + * 360 is set to 0, all other values are rejected + * + ** @param degree value to be normalized, valid values are: 0, 90, 180, 270 + * + ** @return true if successful, false otherwise (invalid value) + */ + int normalizeDegreeValue(signed int °ree) const; + + + private: + + /// current state of converting progress (error level) + EI_Status ImageStatus; + /// DICOM color model (enumeration) + EP_Interpretation PhotometricInterpretation; + + /// points to document object + DiDocument *Document; + /// points to image object + DiImage *Image; + + // --- declarations to avoid compiler warnings + + DicomImage(const DicomImage &); + DicomImage &operator=(const DicomImage &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dibaslut.h b/dcmimgle/include/dcmtk/dcmimgle/dibaslut.h new file mode 100644 index 00000000..82e78955 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dibaslut.h @@ -0,0 +1,310 @@ +/* + * + * Copyright (C) 1996-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomBaseLUT (Header) + * + */ + + +#ifndef DIBASLUT_H +#define DIBASLUT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/diutils.h" + + +/*---------------------* + * macro definitions * + *---------------------*/ + +#define MIN_TABLE_ENTRY_SIZE 8 +#define MAX_TABLE_ENTRY_SIZE 16 +#define MAX_TABLE_ENTRY_COUNT 65536 + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Base class to handle look-up tables + */ +class DCMTK_DCMIMGLE_EXPORT DiBaseLUT +{ + + public: + + /** constructor + * + ** @param count number of LUT entries + * @param bits number of bits per entry + */ + DiBaseLUT(const Uint32 count = 0, + const Uint16 bits = 0); + + /** destructor + */ + virtual ~DiBaseLUT(); + + /** get number of LUT entries + * + ** @return number of LUT entries + */ + inline Uint32 getCount() const + { + return Count; + } + + /** get number of bits per entry + * + ** @return number of bits per entry + */ + inline Uint16 getBits() const + { + return Bits; + } + + /** get index of first LUT entry. + * First input value mapped (FIV) in LUT descriptor is US -> 16 bit unsigned. + * ... or the previous pixel transformation requires an unsigned LUT input value. + * + ** (#)param dummy (used to distinguish between signed and unsigned methods) + * + ** @return index of first LUT entry + */ + inline Uint32 getFirstEntry(const Uint32 = 0) const + { + return FirstEntry; + } + + /** get index of first LUT entry. + * First input value mapped (FIV) in LUT descriptor is SS -> 16 bit signed. + * ... or the previous pixel transformation requires a signed LUT input value. + * + ** (#)param dummy (used to distinguish between signed and unsigned methods) + * + ** @return index of first LUT entry + */ + inline Sint32 getFirstEntry(const Sint32) const + { + return OFstatic_cast(Sint16, FirstEntry); + } + + /** get index of last LUT entry. + * FIV in LUT descriptor is US -> 16 bit unsigned. + * ... or the previous pixel transformation requires an unsigned LUT input value. + * + ** (#)param dummy (used to distinguish between signed and unsigned methods) + * + ** @return index of last LUT entry + */ + inline Uint32 getLastEntry(const Uint32 = 0) const + { + return FirstEntry + Count - 1; + } + + /** get index of last LUT entry. + * FIV in LUT descriptor is SS -> 16 bit signed. + * ... or the previous pixel transformation requires a signed LUT input value. + * + ** (#)param dummy (used to distinguish between signed and unsigned methods) + * + ** @return index of first LUT entry + */ + inline Sint32 getLastEntry(const Sint32) const + { + return OFstatic_cast(Sint32, OFstatic_cast(Sint16, FirstEntry)) + Count - 1; + } + + /** get value of specified LUT entry + * + ** @param pos position in the LUT to be returned + * + ** @return value of specified LUT entry + */ + inline Uint16 getValue(const Uint16 pos) const + { + return Data[pos]; + } + + /** get value of specified LUT entry. + * FIV in LUT descriptor is US -> 16 bit unsigned. + * ... or the previous pixel transformation requires an unsigned LUT input value. + * + ** @param pos position in the LUT to be returned + * + ** @return value of specified LUT entry + */ + inline Uint16 getValue(const Uint32 pos) const + { + return Data[pos - FirstEntry]; + } + + /** get value of specified LUT entry. + * FIV in LUT descriptor is SS -> 16 bit signed. + * ... or the previous pixel transformation requires a signed LUT input value. + * + ** @param pos position in the LUT to be returned + * + ** @return value of specified LUT entry + */ + inline Uint16 getValue(const Sint32 pos) const + { + return Data[pos - OFstatic_cast(Sint32, OFstatic_cast(Sint16, FirstEntry))]; + } + + /** get value of first LUT entry. + * + ** @return value of first LUT entry + */ + inline Uint16 getFirstValue() const + { + return Data[0]; + } + + /** get value of last LUT entry. + * + ** @return value of last LUT entry + */ + inline Uint16 getLastValue() const + { + return Data[Count - 1]; + } + + /** get pointer to LUT data + * + ** @return pointer to LUT data + */ + inline const Uint16 *getData() const + { + return Data; + } + + /** get minimum value of the LUT. + * + ** @return minimum value of the LUT + */ + inline Uint16 getMinValue() const + { + return MinValue; + } + + /** get maximum value of the LUT. + * + ** @return maximum value of the LUT + */ + inline Uint16 getMaxValue() const + { + return MaxValue; + } + + /** get absolute value range of the LUT entries. + * The maximum value which could be stored with the specified bit depth is calculated. + * + ** @return absolute range of LUT entries + */ + inline Uint32 getAbsMaxRange() const + { + return OFstatic_cast(Uint32, DicomImageClass::maxval(Bits, 0)); + } + + /** check whether LUT is valid + * + ** @return status, true if valid, false otherwise + */ + inline int isValid() const + { + return Valid; + } + + /** get LUT explanation string + * + ** @return LUT explanation string if successful, NULL otherwise + */ + inline const char *getExplanation() const + { + return (Explanation.empty()) ? OFstatic_cast(const char *, NULL) : Explanation.c_str(); + } + + /** compares current LUT with specified LUT + * + ** @param lut LUT to be compared with the current one + * + ** @return OFTrue if LUTs are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DiBaseLUT &lut); + + + protected: + + /** constructor + * + ** @param buffer pointer to array with LUT entries + * @param count number of LUT entries + * @param bits number of bits per entry + */ + DiBaseLUT(Uint16 *buffer, + const Uint32 count = 0, + const Uint16 bits = 0); + + /** compares current LUT with specified LUT + * + ** @param lut LUT to be compared with the current one + * + ** @return true if LUTs are not equal (1 = invalid LUT, + * 2 = descriptor differs, + * 3 = data differs) + * false (0) otherwise + */ + int compare(const DiBaseLUT *lut); + + /// number of LUT entries + Uint32 Count; + /// first input value mapped (FIV) + Uint16 FirstEntry; + /// number of bits per entry + Uint16 Bits; + + /// minimum LUT value + Uint16 MinValue; + /// maximum LUT value + Uint16 MaxValue; + + /// status code, indicating whether LUT is valid + int Valid; + + /// LUT explanation string + OFString Explanation; + + /// pointer to lookup table data + const Uint16 *Data; + /// pointer to data buffer (will be deleted in the destructor) + Uint16 *DataBuffer; + + + private: + + // --- declarations to avoid compiler warnings + + DiBaseLUT(const DiBaseLUT &); + DiBaseLUT &operator=(const DiBaseLUT &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diciefn.h b/dcmimgle/include/dcmtk/dcmimgle/diciefn.h new file mode 100644 index 00000000..632c0d39 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diciefn.h @@ -0,0 +1,145 @@ +/* + * + * Copyright (C) 1998-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomCIELABFunction (Header) + * + */ + + +#ifndef DICIEFN_H +#define DICIEFN_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/didispfn.h" +#include "dcmtk/dcmimgle/dicielut.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to manage CIELAB LUTs (for calibration) + */ +class DCMTK_DCMIMGLE_EXPORT DiCIELABFunction + : public DiDisplayFunction +{ + + public: + + /** constructor, read device characteristics file. + * Keywords: "max" for maximum DDL (Digital Driving Level, required at first position) + * "amb" for ambient light and "lum" for illumination (both optional) + * "ord" for the order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or absent = use cubic spline interpolation) + * + ** @param filename name of the characteristics file (luminance/OD for each DDL) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (-1 = use file setting, 0 = cubic spline) + */ + DiCIELABFunction(const char *filename, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = -1); + + /** constructor, use given array of luminance/OD values. UNTESTED + * Values must be sorted and complete (i.e. there must be an entry for each DDL) + * The given arrays are copied internally. + * + ** @param val_tab pointer to array with luminance/OD values + * @param count number of array elements (should be equal to 'max + 1') + * @param max maximum DDL (digital driving level) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiCIELABFunction(const double *val_tab, + const unsigned long count, + const Uint16 max = 255, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** constructor, use given array of DDL and luminance values. UNTESTED + * Values will be automatically sorted and missing values will be interpolated. + * The given arrays are copied internally. + * + ** @param ddl_tab pointer to array with DDL values (must be with the interval 0..max) + * @param val_tab pointer to array with luminance/OD values + * @param count number of array elements (2..65536) + * @param max maximum DDL (digital driving level) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiCIELABFunction(const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long count, + const Uint16 max = 255, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** constructor, compute luminance/OD values automatically within the specified range. + * + ** @param val_min minimum luminance/OD value + * @param val_max maximum luminance/OD value + * @param count number of DDLs (digital driving level, 1..65536)) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiCIELABFunction(const double val_min, + const double val_max, + const unsigned long count = 256, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** destructor + */ + virtual ~DiCIELABFunction(); + + /** write curve data to a text file + * + ** @param filename name of the text file to which the data should be written + * @param mode write CC and PSC to file if OFTrue + * + ** @return status, true if successful, false otherwise + */ + int writeCurveData(const char *filename, + const OFBool mode = OFTrue); + + + protected: + + /** create CIELAB LUT with specified number of entries + * + ** @param count number of LUT entries + * + ** @return pointer to created LUT if successful, NULL otherwise + */ + DiDisplayLUT *getDisplayLUT(unsigned long count); + + + private: + + // --- declarations to avoid compiler warnings + + DiCIELABFunction(const DiDisplayFunction &); + DiCIELABFunction &operator=(const DiDisplayFunction &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dicielut.h b/dcmimgle/include/dcmtk/dcmimgle/dicielut.h new file mode 100644 index 00000000..26eb2f66 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dicielut.h @@ -0,0 +1,108 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomCIELABLUT (Header) + * + */ + + +#ifndef DICIELUT_H +#define DICIELUT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/didislut.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to compute and store the CIELAB lookup table + */ +class DCMTK_DCMIMGLE_EXPORT DiCIELABLUT + : public DiDisplayLUT +{ + + public: + + /** constructor + * + ** @param count number of values to be stored in the LUT + * @param max maximum value to be stored in the LUT + * @param ddl_tab array of DDL values + * @param val_tab array of values + * @param ddl_cnt number of DDL values + * @param val_min minimum value in the array + * @param val_max maximum value in the array + * @param lum_min minimum luminance value to be used (lower border) + * @param lum_max maximum luminance value to be used (upper border) + * @param amb ambient light value + * @param inverse apply inverse transformation if OFTrue + * @param stream output stream (used to write curve data to a file) + * @param printMode write CC and PSC to stream if OFTrue + */ + DiCIELABLUT(const unsigned long count, + const Uint16 max, + const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double val_min, + const double val_max, + const double lum_min, + const double lum_max, + const double amb, + const OFBool inverse = OFFalse, + STD_NAMESPACE ostream *stream = NULL, + const OFBool printMode = OFTrue); + + /** destructor + */ + virtual ~DiCIELABLUT(); + + + protected: + + /** create lookup table + * + ** @param ddl_tab array of DDL values + * @param val_tab array of values + * @param ddl_cnt number of DDL values + * @param val_min minimum value in the array + * @param val_max maximum value in the array + * @param lum_min minimum luminance value to be used (lower border) + * @param lum_max maximum luminance value to be used (upper border) + * @param inverse apply inverse transformation if OFTrue + * @param stream output stream (used to write curve data to a file) + * @param printMode write CC and PSC to stream if OFTrue + * + ** @return status, true if successful, false otherwise + */ + int createLUT(const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double val_min, + const double val_max, + const double lum_min, + const double lum_max, + const OFBool inverse = OFFalse, + STD_NAMESPACE ostream *stream = NULL, + const OFBool printMode = OFTrue); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dicrvfit.h b/dcmimgle/include/dcmtk/dcmimgle/dicrvfit.h new file mode 100644 index 00000000..f010f35e --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dicrvfit.h @@ -0,0 +1,325 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DiCurveFitting (header/implementation) + * + */ + + +#ifndef DICRVFIT_H +#define DICRVFIT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofcast.h" + +#define INCLUDE_CMATH +#define INCLUDE_CSTDDEF /* For NULL */ +#include "dcmtk/ofstd/ofstdinc.h" + + +/*---------------------* + * macro definitions * + *---------------------*/ + +// SunCC 4.x does not support default values for template types :-/ +#define T3_ double + + +/*------------------* + * template class * + *------------------*/ + +/** Template class for polynomial curve fitting algorithm + */ +template +class DiCurveFitting +{ + + public: + + /** calculate coefficients for resulting polynomial function. + * T1 = type of x coordinates + * T2 = type of y coordinates + * T3_ = type of coefficients (and for internal calculations) + * + ** @param x array with x coordinates of given points + * @param y array with y coordinates of given points + * @param n number of entries in array (= points) + * @param o order of polynomial function + * @param c array to store the resulting coefficients (o+1 entries !) + * + ** @return true if successful, false otherwise + */ + static int calculateCoefficients(const T1 *x, + const T2 *y, + const unsigned int n, + const unsigned int o, + T3_ *c) + { + int result = 0; + if ((x != NULL) && (y != NULL) && (c !=NULL) && (n > 0)) + { + const unsigned int order = o + 1; + const unsigned int order2 = order * order; + T3_ *basis = new T3_[order * n]; + T3_ *alpha = new T3_[order2]; + T3_ *beta = new T3_[order]; + if ((basis != NULL) && (alpha != NULL) && (beta != NULL)) + { + unsigned int i; + unsigned int j; + unsigned int k; + for (i = 0; i < order; ++i) + { + for (j = 0; j < n; ++j) + { + k = i + j * order; + if (i == 0) + basis[k] = 1; + else + basis[k] = OFstatic_cast(T3_, x[j]) * basis[k - 1]; + } + } + T3_ sum; + for (i = 0; i < order; ++i) + { + const unsigned int i_order = i * order; + for (j = 0; j <= i; ++j) + { + sum = 0; + for (k = 0; k < n; ++k) + sum += basis[i + k * order] * basis[j + k * order]; + alpha[i + j * order] = sum; + if (i != j) + alpha[j + i_order] = sum; + } + } + for (i = 0; i < order; ++i) + { + sum = 0; + for (j = 0; j < n; ++j) + sum += OFstatic_cast(T3_, y[j]) * basis[i + j * order]; + beta[i] = sum; + } + if (solve(alpha, beta, order)) + { + for (i = 0; i < order; ++i) + c[i] = beta[i]; + result = 1; + } + } + delete[] basis; + delete[] alpha; + delete[] beta; + } + return result; + } + + + /** calculate y coordinates for the given range of x coordinates. + * The polynomial function is defined by the specified coefficients. + * T1 = type of x coordinates + * T2 = type of y coordinates + * T3_ = type of coefficients (and for internal calculations) + * + ** @param xs first x coordinate for computation + * @param xe last x coordinate for computation + * @param y array to store the resulting y coordinates (n entries !) + * @param n number of entries in array (= points) + * @param o order of polynomial function + * @param c array of coefficients computed by the above method (o+1 entries !) + * + ** @return true if successful, false otherwise + */ + static int calculateValues(const T1 xs, + const T1 xe, + T2 *y, + const unsigned int n, + const unsigned int o, + const T3_ *c) + { + int result = 0; + if ((y != NULL) && (c != NULL) && (n > 0) && (xe > xs)) + { + unsigned int i; + unsigned int j; + T3_ x; + T3_ x2; + T3_ w; + const T3_ xo = OFstatic_cast(T3_, xs); + const T3_ xi = OFstatic_cast(T3_, (OFstatic_cast(T3_, xe) - OFstatic_cast(T3_, xs)) / (n - 1)); + for (i = 0; i < n; ++i) + { + x = xo + OFstatic_cast(T3_, i) * xi; + x2 = 1; + w = 0; + for (j = 0; j <= o; ++j) + { + w += c[j] * x2; + x2 *= x; + } + convertValue(w, y[i]); // cut value if necessary + } + result = 1; + } + return result; + } + + + private: + + /** helper routine: convert to unsigned 8 bit value + * + ** @param input input value to be converted + * @param output output value (range: 0..255) + * + ** @return output value + */ + static void convertValue(const T3_ input, Uint8 &output) + { + output = (input <= 0) ? 0 : ((input >= 255) ? 255 : OFstatic_cast(Uint8, input)); + } + + /** helper routine: convert to signed 8 bit value + * + ** @param input input value to be converted + * @param output output value (range: -128..127) + * + ** @return output value + */ + static void convertValue(const T3_ input, Sint8 &output) + { + output = (input <= -128) ? -128 : ((input >= 127) ? 127 : OFstatic_cast(Sint8, input)); + } + + /** helper routine: convert to unsigned 16 bit value + * + ** @param input input value to be converted + * @param output output value (range: 0..65535) + * + ** @return output value + */ + static void convertValue(const T3_ input, Uint16 &output) + { + output = (input <= 0) ? 0 : ((input >= 65535) ? 65535 : OFstatic_cast(Uint16, input)); + } + + /** helper routine: convert to signed 16 bit value + * + ** @param input input value to be converted + * @param output output value (range: -32768..32767) + * + ** @return output value + */ + static void convertValue(const T3_ input, Sint16 &output) + { + output = (input <= -32768) ? -32768 : ((input >= 32767) ? 32767 : OFstatic_cast(Sint16, input)); + } + + /** helper routine: convert to floating point value (double precision) + * + ** @param input input value to be converted + * @param output output value (double) + * + ** @return output value + */ + static inline void convertValue(const T3_ input, double &output) + { + output = OFstatic_cast(double, input); + } + + /** solve the equation given by the two matrixes. + * T3_ = type of coefficients (and for internal calculations) + * + ** @param a first matrix (array of values) + * @param b second matrix (array of values) + * @param n number of entries in array + * + ** @return true if successful, false otherwise + */ + static int solve(T3_ *a, + T3_ *b, + const unsigned int n) + { + int result = 0; + if ((a != NULL) && (b != NULL) && (n > 0)) + { + unsigned int i; + unsigned int j; + unsigned int k; + signed int pivot; + T3_ mag; + T3_ mag2; + T3_ temp; + for (i = 0; i < n; ++i) + { + mag = 0; + pivot = -1; + for (j = i; j < n; ++j) + { + mag2 = fabs(a[i + j * n]); + if (mag2 > mag) + { + mag = mag2; + pivot = j; + } + } + if ((pivot == -1) || (mag == 0)) + break; + else + { + const unsigned int piv = OFstatic_cast(unsigned int, pivot); + const unsigned int i_n = i * n; + if (piv != i) + { + const unsigned int piv_n = piv * n; + for (j = i; j < n; ++j) + { + temp = a[j + i_n]; + a[j + i_n] = a[j + piv_n]; + a[j + piv_n] = temp; + } + temp = b[i]; + b[i] = b[piv]; + b[piv] = temp; + } + mag = a[i + i_n]; + for (j = i; j < n; ++j) + a[j + i_n] /= mag; + b[i] /= mag; + for (j = 0; j < n; ++j) + { + if (i == j) + continue; + const unsigned int j_n = j * n; + mag2 = a[i + j_n]; + for (k = i; k < n; ++k) + a[k + j_n] -= mag2 * a[k + i_n]; + b[j] -= mag2 * b[i]; + } + result = 1; + } + + } + } + return result; + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/didefine.h b/dcmimgle/include/dcmtk/dcmimgle/didefine.h new file mode 100644 index 00000000..6dce8579 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/didefine.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DIDEFINE_H +#define DIDEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmimgle_EXPORTS +#define DCMTK_DCMIMGLE_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMIMGLE_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/didislut.h b/dcmimgle/include/dcmtk/dcmimgle/didislut.h new file mode 100644 index 00000000..c3cc406b --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/didislut.h @@ -0,0 +1,87 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomDisplayLUT (Header) + * + */ + + +#ifndef DIDISLUT_H +#define DIDISLUT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dibaslut.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to compute and store the Display lookup table + */ +class DCMTK_DCMIMGLE_EXPORT DiDisplayLUT + : public DiBaseLUT +{ + + public: + + /** constructor + * + ** @param count number of values to be stored + * @param max maximum value to be stored + * @param amb ambient light value + * @param illum illumination value (optional) + */ + DiDisplayLUT(const unsigned long count, + const Uint16 max, + const double amb, + const double illum = 0); + + /** destructor + */ + virtual ~DiDisplayLUT(); + + /** get ambient light value + * + ** @return ambient light value + */ + inline double getAmbientLightValue() const + { + return AmbientLight; + } + + /** get illumination value + * + ** @return illumination value + */ + inline double getIlluminationValue() const + { + return Illumination; + } + + + private: + + /// ambient light value (measured in cd/m^2) + const double AmbientLight; + /// illumination value (measured in cd/m^2) + const double Illumination; +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/didispfn.h b/dcmimgle/include/dcmtk/dcmimgle/didispfn.h new file mode 100644 index 00000000..a170c5f1 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/didispfn.h @@ -0,0 +1,487 @@ +/* + * + * Copyright (C) 1998-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomDisplayFunction (Header) + * + */ + + +#ifndef DIDISPFN_H +#define DIDISPFN_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/oftypes.h" + +#include "dcmtk/dcmimgle/didefine.h" + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiDisplayLUT; + + +/*---------------------* + * macro definitions * + *---------------------*/ + +#define MAX_DISPLAY_FUNCTIONS 2 +#define MAX_NUMBER_OF_TABLES 15 +#define WIDTH_OF_PVALUES 16 + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to handle hardcopy and softcopy device characteristics file + * and manage display LUTs (for calibration) + */ +class DCMTK_DCMIMGLE_EXPORT DiDisplayFunction +{ + + public: + + /** output device type + */ + enum E_DeviceType + { + /// monitor (softcopy output device), values expected to be in luminance (cd/m^2) + EDT_Monitor, + /// camera (softcopy input device), values expected to be in luminance (cd/m^2) + EDT_Camera, + /// printer (hardcopy output device), values expected to be in optical density (OD) + EDT_Printer, + /// scanner (hardcopy input device), values expected to be in optical density (OD) + EDT_Scanner + }; + + /** constructor, read device characteristics file. + * Keywords: "max" for maximum DDL (digital driving level, required at first position) + * "amb" for ambient light and "lum" for illumination (both optional) + * "ord" for the order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or absent = use cubic spline interpolation) + * + ** @param filename name of the characteristics file (luminance/OD for each DDL) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (-1 = use file setting, 0 = cubic spline) + */ + DiDisplayFunction(const char *filename, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = -1); + + /** constructor, use given array of luminance/OD values. UNTESTED + * Values must be sorted and complete (i.e. there must be an entry for each DDL). + * The given arrays are copied internally. + * + ** @param val_tab pointer to array with luminance/OD values + * @param count number of array elements (should be equal to 'max + 1') + * @param max maximum DDL (digital driving level) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiDisplayFunction(const double *val_tab, + const unsigned long count, + const Uint16 max = 255, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** constructor, use given array of DDL and luminance/OD values. UNTESTED + * Values will be automatically sorted and missing values will be interpolated. + * The given arrays are copied internally. + * + ** @param ddl_tab pointer to array with DDL values (must be with the interval 0..max) + * @param val_tab pointer to array with luminance/OD values + * @param count number of array elements (2..65536) + * @param max maximum DDL (digital driving level) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiDisplayFunction(const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long count, + const Uint16 max = 255, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** constructor, compute luminance/OD values automatically within the specified range. + * Initial values for hardcopy: "lum" = 2000, "amb" = 10, for softcopy: "amb" = 0. + * + ** @param val_min minimum luminance/OD value + * @param val_max maximum luminance/OD value + * @param count number of DDLs (digital driving level, 1..65536) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiDisplayFunction(const double val_min, + const double val_max, + const unsigned long count = 256, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** destructor + */ + virtual ~DiDisplayFunction(); + + /** check whether DisplayFunction is valid + * + ** @return status, true if valid, false otherwise + */ + inline int isValid() const + { + return Valid; + } + + /** get output device type (monitor, camera, printer or scanner) + * + ** @return output device type + */ + inline E_DeviceType getDeviceType() const + { + return DeviceType; + } + + /** get maximum DDL value. + * The minimum DDL value is always 0. + * + ** @return maximum DDL value + */ + inline Uint16 getMaxDDLValue() const + { + return MaxDDLValue; + } + + /** get minimum luminance/OD value from the characteristic curve. + * In case of a usually monotonous characteristic curve the value is + * equivalent to the first/last entry of the array. + * + ** @return minimum luminance/OD value, 0 in case of error + */ + inline double getMinValue() const + { + return MinValue; + } + + /** get maximum luminance/OD value from the characteristic curve. + * In case of a usually monotonous characteristic curve the value is + * equivalent to the last/first entry of the array. + * + ** @return maximum luminance/OD value, 0 in case of error + */ + inline double getMaxValue() const + { + return MaxValue; + } + + /** get the luminance/OD value for a given DDL. + * Looks up a luminance/OD value in the device's characteristic curve. + * Please note that neither ambient light/illumination nor min/max + * density are used. + * + ** @param ddl DDL (digital driving level) to be looked up + * + ** @return luminance/OD value if successful, -1 otherwise + */ + double getValueforDDL(const Uint16 ddl) const; + + /** get the DDL for a given luminance/OD value. + * Determines the DDL from the device's characteristic curve which is + * mapped to the closest possible luminance/OD value. + * Please note that neither ambient light/illumination nor min/max + * density are used. + * + ** @param value luminance/OD value to be looked up + * + ** @return DDL (digital driving level) if successful, 0 otherwise + */ + Uint16 getDDLforValue(const double value) const; + + /** create look-up table with specified number of entries + * + ** @param bits depth of input values + * @param count number of LUT entries (default: 0 = computed automatically) + * + ** @return pointer to created LUT if successful, NULL otherwise + */ + const DiDisplayLUT *getLookupTable(const int bits, + unsigned long count = 0); + + /** delete specified LUT + * + ** @param bits depth of input values of the LUT to be deleted + * + ** @return status, true if valid, false otherwise + */ + int deleteLookupTable(const int bits); + + /** write curve data to a text file (abstract method) + * + ** @param filename name of the text file to which the data should be written + * @param mode write CC and PSC to file if OFTrue + * + ** @return status, true if successful, false otherwise + */ + virtual int writeCurveData(const char *filename, + const OFBool mode = OFTrue) = 0; + + /** get (reflected) ambient light value. + * measured in cd/m^2. + * + ** @return current ambient light value + */ + inline double getAmbientLightValue() const + { + return AmbientLight; + } + + /** set (reflected) ambient light value. + * measured in cd/m^2. applicable to softcopy and hardcopy devices. + * typical values: 0.5-5 for softcopy devices, 10 for transmissive hardcopy + * printer and 0 for reflective hardcopy printers. + * + ** @param value ambient light value to be set (>= 0) + * + ** @return status, true if successful, false otherwise + */ + virtual int setAmbientLightValue(const double value); + + /** get illumination value. + * measured in cd/m^2. + * + ** @return current illumination value + */ + inline double getIlluminationValue() const + { + return Illumination; + } + + /** set illumination value. + * measured in cd/m^2. applicable to hardcopy devices only. + * typical values: 2000 for transmissive hardcopy printer and 150 for + * reflective hardcopy printers. + * + ** @param value illumination value to be set (>= 0) + * + ** @return status, true if successful, false otherwise + */ + virtual int setIlluminationValue(const double value); + + /** get minimum optical density value "Dmin". + * measured in optical density (OD). + * + ** @return current Dmin value or -1 if not set + */ + inline double getMinDensityValue() const + { + return MinDensity; + } + + /** set minimum optical density value "Dmin". + * measured in optical density (OD). applicable to printers only. + * typical value: 0.2 + * + ** @param value Dmin value to be set (or < 0 to unset) + * + ** @return status, true if successful (1 = Dmin set, 2 = Dmin unset), false otherwise + */ + virtual int setMinDensityValue(const double value); + + /** get maximum optical density value "Dmax". + * measured in optical density (OD). + * + ** @return current Dmax value or -1 if not set + */ + inline double getMaxDensityValue() const + { + return MaxDensity; + } + + /** set maximum optical density value "Dmax". + * measured in optical density (OD). applicable to printers only. + * typical value: 3.0 + * + ** @param value Dmax value to be set (or < 0 to unset) + * + ** @return status, true if successful (1 = Dmax set, 2 = Dmax unset), false otherwise + */ + virtual int setMaxDensityValue(const double value); + + /** get minimum luminance value "Lmin". + * measured in cd/m^2. value is computed from "Dmax". + * + ** @return current Lmin value or -1 if Dmax not set + */ + double getMinLuminanceValue() const; + + /** get maximum luminance value "Lmax". + * measured in cd/m^2. value is computed from "Dmin". + * + ** @return current Lmax value or -1 if Dmin not set + */ + double getMaxLuminanceValue() const; + + /** get order of the polynomial curve fitting algorithm. + * used to interpolate the given base points. + * + ** @return polynomial order (0 = use cubic spline interpolation, -1 = not specified) + */ + inline signed int getPolynomialOrder() const + { + return Order; + } + + /** convert the given OD value to luminance. + * This function uses the currently set ambient light and illumination values. + * + ** @param value optical density value to be converted (>= 0) + * @param useAmb use ambient light value if OFTrue + * + ** @return luminance value if successful, -1 otherwise + */ + double convertODtoLum(const double value, + const OFBool useAmb = OFTrue) const; + + /** convert the given OD value to luminance. + * This function uses the specified ambient light and illumination values. + * + ** @param value optical density value to be converted (>= 0) + * @param ambient ambient light value used for the conversion (>= 0) + * @param illum illumination value used for the conversion (>= 0) + * + ** @return luminance value if successful, -1 otherwise + */ + static double convertODtoLum(const double value, + const double ambient, + const double illum); + + + protected: + + /** create display LUT with specified number of entries (abstract method) + * + ** @param count number of LUT entries + * + ** @return pointer to created LUT if successful, NULL otherwise + */ + virtual DiDisplayLUT *getDisplayLUT(unsigned long count) = 0; + + /** read the given device characteristics file + * + ** @param filename name of the characteristics file + * + ** @return status, true if successful, false otherwise + */ + int readConfigFile(const char *filename); + + /** create a sorted (by DDL) table from the given DDL and luminance/OD tables + * + ** @param ddl_tab pointer to array with DDL values + * @param val_tab pointer to array with luminance/OD values + * + ** @return status, true if successful, false otherwise + */ + int createSortedTable(const Uint16 *ddl_tab, + const double *val_tab); + + /** create a table with luminance values from the given OD table. + * Uses the currently set ambient light and illumination value. The resulting luminance + * table has to be deleted by the caller. + * + ** @param od_tab pointer to array with optical density values + * @param count number of entries in the array + * @param useAmb use ambient light value if OFTrue + * + ** @return pointer to luminance table if successful, NULL otherwise + */ + double *convertODtoLumTable(const double *od_tab, + const unsigned long count, + const OFBool useAmb); + + /** interpolate device characteristic curve by means of a cubic spline interpolation + */ + int interpolateValues(); + + /** calculate minimum and maximum luminance/OD values + * + ** @return status, true if successful, false otherwise + */ + int calculateMinMax(); + + /** check whether Dmin and Dmax are properly specified. + * report a warning message if "Dmin >= Dmax". + * + ** @return status, true if successful, false otherwise + */ + int checkMinMaxDensity() const; + + /// status flag, indicating whether display function is valid + int Valid; + + /// output device type (monitor, camera, printer or scanner) + const E_DeviceType DeviceType; + + /// number of DDL and luminance/OD values + unsigned long ValueCount; + /// maximum DDL value (usually 255) + Uint16 MaxDDLValue; + /// order of the polynomial curve fitting algorithm + signed int Order; + + /// (reflected) ambient light value + double AmbientLight; + /// illumination value + double Illumination; + + /// minimum optical density (-1 if unset) + double MinDensity; + /// maximum optical density (-1 if unset) + double MaxDensity; + + /// pointer to array of DDL values + Uint16 *DDLValue; + /// pointer to array of corresponding luminance/OD values + double *LODValue; + + /// minimum luminance/OD value + double MinValue; + /// maximum luminance/OD value + double MaxValue; + + /// constant defining minimum value for number of bits for LUT input (here: 8) + static const int MinBits; + /// constant defining maximum value for number of bits for LUT input (here: 16) + static const int MaxBits; + + /// array with pointer to the different lookup tables (here: 8-16 bits) + DiDisplayLUT *LookupTable[MAX_NUMBER_OF_TABLES]; + + + private: + + // --- declarations to avoid compiler warnings + + DiDisplayFunction(const DiDisplayFunction &); + DiDisplayFunction &operator=(const DiDisplayFunction &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/didocu.h b/dcmimgle/include/dcmtk/dcmimgle/didocu.h new file mode 100644 index 00000000..2fe2829d --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/didocu.h @@ -0,0 +1,424 @@ +/* + * + * Copyright (C) 1996-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomDocument (Header) + * + */ + + +#ifndef DIDOCU_H +#define DIDOCU_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmimgle/diobjcou.h" +#include "dcmtk/ofstd/ofstring.h" + +#define INCLUDE_CSTDDEF +#include "dcmtk/ofstd/ofstdinc.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DcmStack; +class DcmObject; +class DcmTagKey; +class DcmElement; +class DcmPixelData; +class DcmSequenceOfItems; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Interface class to DICOM data management (dcmdata). + * NB: This is an internal class of module dcmimgle/dcmimage. Please do not + * use it for accessing DICOM data structures. Instead use the classes + * and functions provided by dcmdata (e.g. class DcmFileFormat, DcmItem). + */ +class DCMTK_DCMIMGLE_EXPORT DiDocument + : public DiObjectCounter +{ + + public: + + /** constructor, open a DICOM file + * + ** @param filename the DICOM file + * @param flags configuration flags (only stored for later use) + * @param fstart first frame to be processed (only stored for later use) + * @param fcount number of frames (only stored for later use) + */ + DiDocument(const char *filename, + const unsigned long flags = 0, + const unsigned long fstart = 0, + const unsigned long fcount = 0); + + /** constructor, use a given DcmObject + * + ** @param object pointer to DICOM data structures (fileformat, dataset or item) + * @param xfer transfer syntax of the 'object'. + * (could also be EXS_Unknown in case of fileformat or dataset) + * @param flags configuration flags (only stored for later use) + * @param fstart first frame to be processed (only stored for later use) + * @param fcount number of frames (only stored for later use) + */ + DiDocument(DcmObject *object, + const E_TransferSyntax xfer, + const unsigned long flags = 0, + const unsigned long fstart = 0, + const unsigned long fcount = 0); + + /** destructor + */ + virtual ~DiDocument(); + + /** check whether current document is valid + * + ** @return status, true if successful, false otherwise + */ + inline int good() const + { + return Object != NULL; + } + + /** get current DICOM object (dataset) + * + ** @return pointer to DICOM object + */ + inline DcmObject *getDicomObject() const + { + return Object; + } + + /** get current DICOM dataset + * + ** @return pointer to DICOM dataset + */ + inline DcmDataset *getDataset() const + { + return OFstatic_cast(DcmDataset *, Object); + } + + /** get first frame to be processed + * + ** @return first frame to be processed + */ + inline unsigned long getFrameStart() const + { + return FrameStart; + } + + /** get number of frames to be processed + * + ** @return number of frames to be processed + */ + inline unsigned long getFrameCount() const + { + return FrameCount; + } + + /** get configuration flags + * + ** @return configuration flags + */ + inline unsigned long getFlags() const + { + return Flags; + } + + /** get transfer syntax of the DICOM dataset + * + ** @return transfer syntax + */ + inline E_TransferSyntax getTransferSyntax() const + { + return Xfer; + } + + /** get photometric interpretation (color model). + * Please note that this is the color model of the decompressed image which might + * deviate from the color model of the original compressed image. + * + ** @return photometric interpretation of the DICOM object + */ + inline const char *getPhotometricInterpretation() const + { + return PhotometricInterpretation.c_str(); + } + + /** get pixel data object + * + ** @return reference to pixel data object (might be NULL) + */ + inline DcmPixelData *getPixelData() const + { + return PixelData; + } + + /** check whether pixel data only exist in compressed format + * + ** @return true if pixel data is compressed, false if an uncompressed version exists + */ + inline OFBool isCompressed() const + { + return DcmXfer(Xfer).isEncapsulated(); + } + + /** search for given tag + * + ** @param tag tag to search for + * @param obj element in the dataset where the search should start (default: root) + * + ** @return pointer to element if successful, NULL otherwise + */ + DcmElement *search(const DcmTagKey &tag, + DcmObject *obj = NULL) const; + + /** search for given tag and put result(s) on a stack + * + ** @param tag tag to search for + * @param stack stack where the result(s) should be stored + * + ** @return status, true if successful, false otherwise + */ + int search(const DcmTagKey &tag, + DcmStack &stack) const; + + + /** get value multiplicity (VM) of given tag + * + ** @param tag tag to be searched + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getVM(const DcmTagKey &tag) const; + + /** get value of given tag (Uint16) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * @param item pointer to item in dataset where to start (default: main dataset) + * @param allowSigned also allow signed value (Sint16) if true + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + Uint16 &returnVal, + const unsigned long pos = 0, + DcmItem *item = NULL, + const OFBool allowSigned = OFFalse) const; + + /** get value of given tag (Sint16) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + Sint16 &returnVal, + const unsigned long pos = 0, + DcmItem *item = NULL) const; + + /** get value of given tag (Uint32) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + Uint32 &returnVal, + const unsigned long pos = 0, + DcmItem *item = NULL) const; + + /** get value of given tag (Sint32) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + Sint32 &returnVal, + const unsigned long pos = 0, + DcmItem *item = NULL) const; + + /** get value of given tag (double) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + double &returnVal, + const unsigned long pos = 0, + DcmItem *item = NULL) const; + + /** get value of given tag (Uint16 array) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return VM / number of values if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + const Uint16 *&returnVal, + DcmItem *item = NULL) const; + + /** get value of given tag (const char *) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + const char *&returnVal, + DcmItem *item = NULL) const; + + /** get value of given tag (OFString) + * + ** @param tag tag to search for + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return VM if successful, 0 otherwise + */ + unsigned long getValue(const DcmTagKey &tag, + OFString &returnVal, + const unsigned long pos = 0, + DcmItem *item = NULL) const; + + /** get sequence of given tag + * + ** @param tag tag to search for + * @param seq reference to the storage area for the resulting value + * @param item pointer to item in dataset where to start (default: main dataset) + * + ** @return cardinality if successful, 0 otherwise + */ + unsigned long getSequence(const DcmTagKey &tag, + DcmSequenceOfItems *&seq, + DcmItem *item = NULL) const; + + // --- static helper functions --- + + /** get value of given element (Uint16) + * + ** @param elem element where the value is stored + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * @param allowSigned also allow signed value (Sint16) if true + * + ** @return VM if successful, 0 otherwise + */ + static unsigned long getElemValue(const DcmElement *elem, + Uint16 &returnVal, + const unsigned long pos = 0, + const OFBool allowSigned = OFFalse); + + /** get value of given element (Uint16 array) + * + ** @param elem element where the value is stored + * @param returnVal reference to the storage area for the resulting value + * + ** @return VM / number of values if successful, 0 otherwise + */ + static unsigned long getElemValue(const DcmElement *elem, + const Uint16 *&returnVal); + + /** get value of given element (const char *) + * + ** @param elem element where the value is stored + * @param returnVal reference to the storage area for the resulting value + * + ** @return VM if successful, 0 otherwise + */ + static unsigned long getElemValue(const DcmElement *elem, + const char *&returnVal); + + /** get value of given element (OFString) + * + ** @param elem element where the value is stored + * @param returnVal reference to the storage area for the resulting value + * @param pos position in multi-valued elements (starting with 0) + * + ** @return VM if successful, 0 otherwise + */ + static unsigned long getElemValue(const DcmElement *elem, + OFString &returnVal, + const unsigned long pos = 0); + + + protected: + + /** convert pixel data to uncompressed representation (if required) + */ + void convertPixelData(); + + + private: + + /// reference to DICOM dataset (in memory) + DcmObject *Object; + /// reference to DICOM fileformat (read from file, maybe NULL) + DcmFileFormat *FileFormat; + /// reference to pixel data object + DcmPixelData *PixelData; + /// transfer syntax used for reading the dataset + E_TransferSyntax Xfer; + + /// first frame to be processed + unsigned long FrameStart; + /// number of frames to be processed + unsigned long FrameCount; + + /// configuration flags + unsigned long Flags; + + /// photometric interpretation (color model) + OFString PhotometricInterpretation; + + // --- declarations to avoid compiler warnings + + DiDocument(const DiDocument &); + DiDocument &operator=(const DiDocument &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diflipt.h b/dcmimgle/include/dcmtk/dcmimgle/diflipt.h new file mode 100644 index 00000000..5cf0eada --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diflipt.h @@ -0,0 +1,334 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomFlipTemplate (Header) + * + */ + + +#ifndef DIFLIPT_H +#define DIFLIPT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dipixel.h" +#include "dcmtk/dcmimgle/ditranst.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to flip images (on pixel data level). + * horizontally and vertically + */ +template +class DiFlipTemplate + : public DiTransTemplate +{ + + public: + + /** constructor. + * This method is used to flip an image and store the result in the same storage area. + * + ** @param pixel pointer to object where the pixel data are stored + * @param columns width of the image + * @param rows height of the image + * @param frames number of frames + * @param horz flags indicating whether to flip horizontally or not + * @param vert flags indicating whether to flip vertically or not + */ + DiFlipTemplate(DiPixel *pixel, + const Uint16 columns, + const Uint16 rows, + const Uint32 frames, + const int horz, + const int vert) + : DiTransTemplate(0, columns, rows, columns, rows, frames) + { + if (pixel != NULL) + { + this->Planes = pixel->getPlanes(); + if ((pixel->getCount() > 0) && (this->Planes > 0) && + (pixel->getCount() == OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames)) + { + if (horz && vert) + flipHorzVert(OFstatic_cast(T **, pixel->getDataArrayPtr())); + else if (horz) + flipHorz(OFstatic_cast(T **, pixel->getDataArrayPtr())); + else if (vert) + flipVert(OFstatic_cast(T **, pixel->getDataArrayPtr())); + } else { + DCMIMGLE_WARN("could not flip image ... corrupted data"); + } + } + } + + /** constructor. + * This method is used to perform only the preparation and to start flipping later with method 'flipData()' + * + ** @param planes number of planes (1 or 3) + * @param columns width of the image + * @param rows height of the image + * @param frames number of frames + */ + DiFlipTemplate(const int planes, + const Uint16 columns, + const Uint16 rows, + const Uint32 frames) + : DiTransTemplate(planes, columns, rows, columns, rows, frames) + { + } + + /** destructor + */ + virtual ~DiFlipTemplate() + { + } + + /** choose algorithm depending on flipping mode + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + * @param horz flags indicating whether to flip horizontally or not + * @param vert flags indicating whether to flip vertically or not + */ + inline void flipData(const T *src[], + T *dest[], + const int horz, + const int vert) + { + if ((src != NULL) && (dest != NULL)) + { + if (horz && vert) + flipHorzVert(src, dest); + else if (horz) + flipHorz(src, dest); + else if (vert) + flipVert(src, dest); + else + this->copyPixel(src, dest); + } + } + + + protected: + + /** flip source image horizontally and store result in destination image + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + inline void flipHorz(const T *src[], + T *dest[]) + { + if ((src != NULL) && (dest != NULL)) + { + Uint16 x; + Uint16 y; + const T *p; + T *q; + T *r; + for (int j = 0; j < this->Planes; ++j) + { + p = src[j]; + r = dest[j]; + for (Uint32 f = this->Frames; f != 0; --f) + { + for (y = this->Src_Y; y != 0; --y) + { + q = r + this->Dest_X; + for (x = this->Src_X; x != 0; --x) + *--q = *p++; + r += this->Dest_X; + } + } + } + } + } + + /** flip source image vertically and store result in destination image + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + inline void flipVert(const T *src[], + T *dest[]) + { + if ((src != NULL) && (dest != NULL)) + { + Uint16 x; + Uint16 y; + const T *p; + T *q; + T *r; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + p = src[j]; + r = dest[j]; + for (Uint32 f = this->Frames; f != 0; --f) + { + r += count; + for (y = this->Src_Y; y != 0; --y) + { + q = r - this->Dest_X; + for (x = this->Src_X; x != 0; --x) + *q++ = *p++; + r -= this->Dest_X; + } + r += count; + } + } + } + } + + /** flip source image horizontally and vertically and store result in destination image + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + inline void flipHorzVert(const T *src[], + T *dest[]) + { + if ((src != NULL) && (dest != NULL)) + { + unsigned long i; + const T *p; + T *q; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + p = src[j]; + q = dest[j]; + for (Uint32 f = this->Frames; f != 0; --f) + { + q += count; + for (i = count; i != 0; --i) + *--q = *p++; + q += count; + } + } + } + } + + private: + + /** flip image horizontally and store result in the same storage area + * + ** @param data array of pointers to source/destination image pixels + */ + inline void flipHorz(T *data[]) + { + Uint16 x; + Uint16 y; + T *p; + T *q; + T t; + T *r; + for (int j = 0; j < this->Planes; ++j) + { + r = data[j]; + for (Uint32 f = this->Frames; f != 0; --f) + { + for (y = this->Src_Y; y != 0; --y) + { + p = r; + r += this->Dest_X; + q = r; + for (x = this->Src_X / 2; x != 0; --x) + { + t = *p; + *p++ = *--q; + *q = t; + } + } + } + } + } + + /** flip image vertically and store result in the same storage area + * + ** @param data array of pointers to source/destination image pixels + */ + inline void flipVert(T *data[]) + { + Uint16 x; + Uint16 y; + T *p; + T *q; + T *r; + T t; + T *s; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + s = data[j]; + for (Uint32 f = this->Frames; f != 0; --f) + { + p = s; + s += count; + r = s; + for (y = this->Src_Y / 2; y != 0; --y) + { + r -= this->Dest_X; + q = r; + for (x = this->Src_X; x != 0; --x) + { + t = *p; + *p++ = *q; + *q++ = t; + } + } + } + } + } + + /** flip image horizontally and vertically and store result in the same storage area + * + ** @param data array of pointers to source/destination image pixels + */ + inline void flipHorzVert(T *data[]) + { + unsigned long i; + T *p; + T *q; + T t; + T *s; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + s = data[j]; + for (Uint32 f = this->Frames; f != 0; --f) + { + p = s; + q = s + count; + for (i = count / 2; i != 0; --i) + { + t = *p; + *p++ = *--q; + *q = t; + } + s += count; + } + } + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/digsdfn.h b/dcmimgle/include/dcmtk/dcmimgle/digsdfn.h new file mode 100644 index 00000000..6a9f47a8 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/digsdfn.h @@ -0,0 +1,227 @@ +/* + * + * Copyright (C) 1998-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomGSDFunction (Header) + * + */ + + +#ifndef DIGSDFN_H +#define DIGSDFN_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/didispfn.h" + +#define INCLUDE_CSTDDEF /* For NULL */ +#include "dcmtk/ofstd/ofstdinc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to manage GSDF LUTs (for calibration) + */ +class DCMTK_DCMIMGLE_EXPORT DiGSDFunction + : public DiDisplayFunction +{ + + public: + + /** constructor, read device characteristics file. + * Keywords: "max" for maximum DDL (Digital Driving Level, required at first position) + * "amb" for ambient light and "lum" for illumination (both optional) + * "ord" for the order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or absent = use cubic spline interpolation) + * + ** @param filename name of the characteristics file (luminance/OD for each DDL) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (-1 = use file setting, 0 = cubic spline) + */ + DiGSDFunction(const char *filename, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = -1); + + /** constructor, use given array of luminance/OD values. UNTESTED + * Values must be sorted and complete (i.e. there must be an entry for each DDL). + * The given arrays are copied internally. + * + ** @param val_tab pointer to array with luminance/OD values + * @param count number of array elements (should be equal to 'max + 1') + * @param max maximum DDL (digital driving level) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiGSDFunction(const double *val_tab, + const unsigned long count, + const Uint16 max = 255, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** constructor, use given array of DDL and luminance/OD values. UNTESTED + * Values will be automatically sorted and missing values will be interpolated. + * The given arrays are copied internally. + * + ** @param ddl_tab pointer to array with DDL values (must be with the interval 0..max) + * @param val_tab pointer to array with luminance/OD values + * @param count number of array elements (2..65536) + * @param max maximum DDL (digital driving level) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiGSDFunction(const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long count, + const Uint16 max = 255, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** constructor, compute luminance/OD values automatically within the specified range. + * + ** @param val_min minimum luminance/OD value + * @param val_max maximum luminance/OD value + * @param count number of DDLs (digital driving level, 1..65536)) + * @param deviceType type of the output device (default: monitor) + * @param ord order of the polynomial curve fitting algorithm used to interpolate + * the given base points (0 or negative = use cubic spline interpolation) + */ + DiGSDFunction(const double val_min, + const double val_max, + const unsigned long count = 256, + const E_DeviceType deviceType = EDT_Monitor, + const signed int ord = 0); + + /** destructor + */ + virtual ~DiGSDFunction(); + + /** write curve data to a text file + * + ** @param filename name of the text file to which the data should be written + * @param mode write CC and PSC to file if OFTrue + * + ** @return status, true if successful, false otherwise + */ + int writeCurveData(const char *filename, + const OFBool mode = OFTrue); + + /** set (reflected) ambient light value. + * measured in cd/m^2. applicable to softcopy and hardcopy devices. + * typical values: 0.5-5 for softcopy devices, 10 for transmissive hardcopy + * printer and 0 for reflective hardcopy printers. + * + ** @param value ambient light value to be set (>= 0) + * + ** @return status, true if successful, false otherwise + */ + int setAmbientLightValue(const double value); + + /** set illumination value. + * measured in cd/m^2. applicable to hardcopy devices only. + * typical values: 2000 for transmissive hardcopy printer and 150 for + * reflective hardcopy printers. + * + ** @param value illumination value to be set (>= 0) + * + ** @return status, true if successful, false otherwise + */ + int setIlluminationValue(const double value); + + /** set minimum optical density value "Dmin". + * measured in optical density (OD). applicable to printers only. + * typical value: 0.2 + * + ** @param value Dmin value to be set (or < 0 to unset) + * + ** @return status, true if successful (1 = Dmax set, 2 = Dmax unset), false otherwise + */ + int setMinDensityValue(const double value); + + /** set maximum optical density value "Dmax". + * measured in optical density (OD). applicable to printers only. + * typical value: 3.0 + * + ** @param value Dmax value to be set (or < 0 to unset) + * + ** @return status, true if successful (1 = Dmax set, 2 = Dmax unset), false otherwise + */ + int setMaxDensityValue(const double value); + + /** calculate the JND index for a given luminance value + * + ** @param lum luminance value + * + ** @return JND index if successful, -1 otherwise + */ + static double getJNDIndex(const double lum); + + + protected: + + /** create GSDF LUT with specified number of entries + * + ** @param count number of LUT entries + * + ** @return pointer to created LUT if successful, NULL otherwise + */ + DiDisplayLUT *getDisplayLUT(unsigned long count); + + /** calculate GSDF (array of 1023 luminance/OD values) + * + ** @return status, true if successful, false otherwise + */ + int calculateGSDF(); + + /** calculate helper function for GSDF interpolation + * + ** @return status, true if successful, false otherwise + */ + int calculateGSDFSpline(); + + /** calculate 'JNDMin' and 'JNDMax' for the given luminance/OD range + * + ** @return status, true if successful, false otherwise + */ + int calculateJNDBoundaries(); + + + private: + + /// minimum JND index value for the given display system + double JNDMin; + /// maximum JND index value for the given display system + double JNDMax; + + /// constant defining the number JND indexes for the maximum luminance/OD range (1023) + static const unsigned int GSDFCount; + /// array of luminance/OD values defining the GSDF + double *GSDFValue; + /// array of values used for the interpolation of the GSDF + double *GSDFSpline; + + // --- declarations to avoid compiler warnings + + DiGSDFunction(const DiGSDFunction &); + DiGSDFunction &operator=(const DiGSDFunction &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/digsdlut.h b/dcmimgle/include/dcmtk/dcmimgle/digsdlut.h new file mode 100644 index 00000000..b5f9356f --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/digsdlut.h @@ -0,0 +1,122 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomGSDFLUT (Header) + * + */ + + +#ifndef DIGSDLUT_H +#define DIGSDLUT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/didislut.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to compute and store the GSDF lookup table + */ +class DCMTK_DCMIMGLE_EXPORT DiGSDFLUT + : public DiDisplayLUT +{ + + public: + + /** constructor + * + ** @param count number of values to be stored in the LUT + * @param max maximum value to be stored in the LUT + * @param ddl_tab array of DDL values + * @param val_tab array of values + * @param ddl_cnt number of DDL values + * @param gsdf_tab array with Grayscale Standard Display Function + * @param gsdf_spl array with helper function used for interpolation + * @param gsdf_cnt number of values in GSDF array + * @param jnd_min minimum JND index value + * @param jnd_max maximum JND index value + * @param lum_min minimum luminance value to be used (lower border) + * @param lum_max maximum luminance value to be used (upper border) + * @param amb (reflected) ambient light value + * @param illum illumination value + * @param inverse apply inverse transformation if OFTrue + * @param stream output stream (used to write curve data to a file) + * @param printMode write CC and PSC to stream if OFTrue + */ + DiGSDFLUT(const unsigned long count, + const Uint16 max, + const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double *gsdf_tab, + const double *gsdf_spl, + const unsigned int gsdf_cnt, + const double jnd_min, + const double jnd_max, + const double lum_min, + const double lum_max, + const double amb, + const double illum, + const OFBool inverse = OFFalse, + STD_NAMESPACE ostream *stream = NULL, + const OFBool printMode = OFTrue); + + /** destructor + */ + virtual ~DiGSDFLUT(); + + + protected: + + /** create lookup table + * + ** @param ddl_tab array of DDL values + * @param val_tab array of luminance values + * @param ddl_cnt number of DDL values + * @param gsdf_tab array with Grayscale Standard Display Function + * @param gsdf_spl array with helper function used for interpolation + * @param gsdf_cnt number of values in GSDF array + * @param jnd_min minimum JND index value + * @param jnd_max maximum JND index value + * @param lum_min minimum luminance value to be used (lower border) + * @param lum_max maximum luminance value to be used (upper border) + * @param inverse apply inverse transformation if OFTrue + * @param stream output stream (used to write curve data to a file) + * @param printMode write CC and PSC to stream if OFTrue + * + ** @return status, true if successful, false otherwise + */ + int createLUT(const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double *gsdf_tab, + const double *gsdf_spl, + const unsigned int gsdf_cnt, + const double jnd_min, + const double jnd_max, + const double lum_min, + const double lum_max, + const OFBool inverse = OFFalse, + STD_NAMESPACE ostream *stream = NULL, + const OFBool printMode = OFTrue); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diimage.h b/dcmimgle/include/dcmtk/dcmimgle/diimage.h new file mode 100644 index 00000000..72a7adbb --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diimage.h @@ -0,0 +1,678 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomImage (Header) + * + */ + + +#ifndef DIIMAGE_H +#define DIIMAGE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcfcache.h" + +#ifdef SUNCC +#include "dcmtk/dcmimgle/didocu.h" +#endif + +#include "dcmtk/dcmimgle/diovlay.h" +#include "dcmtk/dcmimgle/diutils.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DcmPixelData; +class DcmUnsignedShort; + +#ifndef SUNCC + class DiDocument; +#endif + +class DiPixel; +class DiMonoImage; +class DiInputPixel; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Base class for images. + * NB: This is an internal class of module dcmimgle/dcmimage. Please do not + * use it directly. Instead use the main interface class DicomImage. + */ +class DCMTK_DCMIMGLE_EXPORT DiImage +{ + + public: + + /** constructor + * + ** @param docu pointer to the DICOM document + * @param status status of the image object + * @param spp samples per pixel + */ + DiImage(const DiDocument *docu, + const EI_Status status, + const int spp); + + /** destructor + */ + virtual ~DiImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + /** get status of the image object + * + ** @return status of the image object + */ + inline EI_Status getStatus() const + { + return ImageStatus; + } + + /** get number of frames + * + ** @return number of frames + */ + inline Uint32 getNumberOfFrames() const + { + return NumberOfFrames; + } + + /** get index of first frame + * + ** @return index of first frame + */ + inline Uint32 getFirstFrame() const + { + return FirstFrame; + } + + /** get total number of frames + * + ** @return total number of frames + */ + inline Uint32 getTotalNumberOfFrames() const + { + return TotalNumberOfFrames; + } + + /** get representative frame + * + ** @return representative frame + */ + inline Uint32 getRepresentativeFrame() const + { + return RepresentativeFrame; + } + + /** get frame time + * + ** @return frame time + */ + inline double getFrameTime() const + { + return FrameTime; + } + + /** get number of rows + * + ** @return number of rows + */ + inline Uint16 getRows() const + { + return Rows; + } + + /** get number of columns + * + ** @return number of columns + */ + inline Uint16 getColumns() const + { + return Columns; + } + + /** get pixel's width + * + ** @return pixel's width + */ + inline double getPixelWidth() const + { + return (PixelWidth > 0) ? PixelWidth : 1; + } + + /** get pixel's height + * + ** @return pixel's height + */ + inline double getPixelHeight() const + { + return (PixelHeight > 0) ? PixelHeight : 1; + } + + /** get pixel's rows/column ratio + * + ** @return pixel's rows/column ratio + */ + inline double getRowColumnRatio() const + { + return getPixelHeight() / getPixelWidth(); + } + + /** get pixel's column/rows ratio + * + ** @return pixel's column/rows ratio + */ + inline double getColumnRowRatio() const + { + return getPixelWidth() / getPixelHeight(); + } + + /** set pixel's rows/column ratio + * + ** @param ratio pixel's rows/column ratio + * + ** @return status, true if successful, false otherwise + */ + int setRowColumnRatio(const double ratio); + + /** set pixel's column/rows ratio + * + ** @param ratio pixel's column/rows ratio + * + ** @return status, true if successful, false otherwise + */ + int setColumnRowRatio(const double ratio); + + /** get polarity. + * possible values are EPP_Normal and EPP_Reverse + * + ** @return currently active polarity mode + */ + inline EP_Polarity getPolarity() const + { + return Polarity; + } + + /** set polarity. + * + ** @param polarity polarity (normal or reverse) + * + ** @return true if successful (1 = polarity has changed, + * 2 = polarity has not changed) + * false otherwise + */ + int setPolarity(const EP_Polarity polarity); + + /** get number of bits per sample. + * If the optional parameter is specified the value will be checked and in any case + * a valid value will be returned. + * + ** @param bits value to be returned (if less than 1 or greater than the maximum (32) + * the default value will be used which is equal to the bits per sample + * value stored in the DICOM dataset) + * + ** @return status, true if successful, false otherwise + */ + virtual int getBits(const int bits = 0) const + { + return ((bits < 1) || (bits > MAX_BITS)) ? BitsPerSample : bits; + } + + /** get color model of internal pixel representation. + * Possible values are: EPI_Monochrome1, EPI_Monochrome2, EPI_RGB and EPI_YBR_Full + * + ** @return color model of internal pixel representation + */ + virtual EP_Interpretation getInternalColorModel() const = 0; + + /** get access to intermediate pixel data representation (abstract) + * + ** @return pointer to intermediate pixel data + */ + virtual const DiPixel *getInterData() const = 0; + + /** get number of bytes required for the rendered output of a single frame + * + * @param bits number of bits for the output pixel data (depth) + * + ** @return number of bytes if successful, 0 otherwise + */ + virtual unsigned long getOutputDataSize(const int bits = 0) const = 0; + + /** get pixel data with specified format (abstract). + * (memory is handled internally) + * + ** @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flag, whether the output data (for multi-planar images) should be planar or not + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + virtual const void *getOutputData(const unsigned long frame, + const int bits, + const int planar) = 0; + + /** get pixel data with specified format (abstract). + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param size size of the memory buffer in bytes (will be checked) + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flag, whether the output data (for multi-planar images) should be planar or not + * + ** @return status, true if successful, false otherwise + */ + virtual int getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar) = 0; + + /** get pixel data of specified plane (abstract). + * (memory is handled internally) + * + ** @param plane number of plane which should be rendered (starting from 0) + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + virtual const void *getOutputPlane(const int plane) const = 0; + + /** delete internally handled output memory buffer (abstract) + */ + virtual void deleteOutputData() = 0; + + /** get pointer to the object managing the overlay planes + * + ** (#)param idx index of overlay group (here: not used, since only applicable for monochrome images) + * + ** @return pointer to the overlay managing object, here: NULL + */ + virtual DiOverlay *getOverlayPtr(const unsigned int /*idx*/) + { + return NULL; + } + + /** get pointer to monochrome image object + * + ** @return pointer to monochrome image object (here: always NULL) + */ + virtual DiMonoImage *getMonoImagePtr() + { + return NULL; + } + + /** create copy of current image object (abstract) + * + ** @param fstart first frame to be processed (not fully implemented!) + * @param fcount number of frames (not fully implemented!) + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiImage *createImage(const unsigned long fstart, + const unsigned long fcount) const = 0; + + /** create scaled copy of specified (clipping) area of the current image object (abstract). + * + ** @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param clip_width width of area to be scaled + * @param clip_height height of area to be scaled + * @param scale_width width of scaled image (in pixels) + * @param scale_height height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiImage *createScale(const signed long left_pos, + const signed long top_pos, + const unsigned long clip_width, + const unsigned long clip_height, + const unsigned long scale_width, + const unsigned long scale_height, + const int interpolate, + const int aspect, + const Uint16 pvalue) const = 0; + + /** flip current image horizontally and/or vertically (abstract) + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return true if successful, false otherwise + */ + virtual int flip(const int horz, + const int vert) = 0; + + /** create a flipped copy of the current image (abstract). + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiImage *createFlip(const int horz, + const int vert) const = 0; + + /** rotate current image (by steps of 90 degrees) + * + ** @param degree angle by which the image shall be rotated + * + ** @return true if successful, false otherwise + */ + virtual int rotate(const int degree); + + /** create a rotated copy of the current image (abstract). + * + ** @param degree angle by which the image shall be rotated + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiImage *createRotate(const int degree) const = 0; + + /** create monochrome copy of the current image (abstract). + * + ** @param red coefficient by which the red component is weighted + * @param green coefficient by which the green component is weighted + * @param blue coefficient by which the blue component is weighted + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiImage *createMono(const double red, + const double green, + const double blue) const = 0; + + /** create true color (24/32 bit) or palette (8 bit) bitmap for MS Windows (abstract). + * + ** @param data untyped pointer memory buffer (set to NULL if not allocated externally) + * @param size size of the memory buffer in bytes (if 0 'data' is set to NULL) + * @param frame index of frame to be converted (starting from 0) + * @param bits number of bits per pixel used for the output bitmap (8, 24 or 32) + * @param upsideDown specifies the order of lines in the images (0 = top-down, bottom-up otherwise) + * @param padding align each line to a 32-bit address if true (default) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + virtual unsigned long createDIB(void *&data, + const unsigned long size, + const unsigned long frame, + const int bits, + const int upsideDown, + const int padding = 1) = 0; + + /** create true color (32 bit) bitmap for Java AWT (abstract). + * + ** @param data resulting pointer to bitmap data (set to NULL if an error occurred) + * @param frame index of frame to be converted + * @param bits number of bits per pixel used for the output bitmap (8 or 32) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + virtual unsigned long createAWTBitmap(void *&data, + const unsigned long frame, + const int bits) = 0; + + /** render pixel data of given frame and write image related attributes to DICOM dataset. + * + ** @param dataset reference to DICOM dataset where the image attributes are stored + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * @param planar flag, whether the output data (for multi-planar images) should be planar or not + * + ** @return true if successful, false otherwise + */ + int writeFrameToDataset(DcmItem &dataset, + const unsigned long frame = 0, + const int bits = 0, + const int planar = 0); + + /** write current image and related attributes to DICOM dataset. + * + ** @param dataset reference to DICOM dataset where the image attributes are stored + * @param mode determine value of BitsStored from 'used' or 'possible' pixel values + * @param planar flag, whether the output data (for multi-planar images) should be planar or not + * + ** @return true if successful, false otherwise + */ + virtual int writeImageToDataset(DcmItem &dataset, + const int mode = 0, + const int planar = 2) = 0; + + /** write pixel data to PPM file (abstract). + * pixel data is written in ASCII format. + * + ** @param stream open C++ output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + virtual int writePPM(STD_NAMESPACE ostream& stream, + const unsigned long frame, + const int bits) = 0; + + /** write pixel data to PPM file (abstract). + * pixel data is written in ASCII format. + * + ** @param stream open C output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + virtual int writePPM(FILE *stream, + const unsigned long frame, + const int bits) = 0; + + /** write pixel data to raw PPM file (abstract) + * + ** @param stream open C output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + virtual int writeRawPPM(FILE *stream, + const unsigned long frame, + const int bits) = 0; + + /** write pixel data to BMP file + * + ** @param stream open C output stream + * @param frame index of frame used for output (default: first frame = 0) + * @param bits number of bits used for output of pixel data (8, 24 or 32) + * + ** @return true if successful, false otherwise + */ + virtual int writeBMP(FILE *stream, + const unsigned long frame, + const int bits); + + + protected: + + /** constructor + * + ** @param docu pointer to the DICOM document + * @param status status of the image object + */ + DiImage(const DiDocument *docu, + const EI_Status status); + + /** constructor, copy + * + ** @param image pointer to reference image + * @param fstart first frame to be processed + * @param fcount number of frames + */ + DiImage(const DiImage *image, + const unsigned long fstart, + const unsigned long fcount); + + /** constructor, scale/clip + * + ** @param image pointer to reference image + * @param width number of columns of the new image + * @param height number of rows of the new image + * @param aspect flag indicating whether pixel aspect ratio should be used or not + */ + DiImage(const DiImage *image, + const Uint16 width, + const Uint16 height, + const int aspect = 0); + + /** constructor, rotate + * + ** @param image pointer to reference image + * @param degree angle by which the image shall be rotated + */ + DiImage(const DiImage *image, + const int degree = 0); + + /** constructor, createMonoOutput + * + ** @param image pointer to reference image + * @param frame number of frame stored in the new image object + * @param stored number of bits stored + * @param alloc number of bits allocated + */ + DiImage(const DiImage *image, + const unsigned long frame, + const int stored, + const int alloc); + + /** delete internally handled object for the input pixel data conversion + */ + void deleteInputData(); + + /** check and possibly correct values for pixel spacing, aspect ratio etc. + */ + void checkPixelExtension(); + + /** create input pixel data representation from DICOM dataset structures + */ + void convertPixelData(); + + /** update Image Pixel Module attributes in the given dataset. + * Removes smallest/largest pixel value and updates pixel aspect ratio as well + * as pixel spacing (if required). + * Used in writeXXXToDataset() routines. + * + ** @param dataset reference to DICOM image dataset + */ + virtual void updateImagePixelModuleAttributes(DcmItem &dataset); + + /** detach pixel data. + * removes storage area used for the pixel data from memory + * + ** @return status, true if successful, false otherwise + */ + int detachPixelData(); + + /// copy of status variable declared in class 'DicomImage' + EI_Status ImageStatus; + /// points to special object, which encapsulates the dcmdata module + const DiDocument *Document; + + /// first frame to be processed + Uint32 FirstFrame; + /// number of frames in case of multi-frame images (otherwise '1') + Uint32 NumberOfFrames; + /// total number of frames stored in the dataset + Uint32 TotalNumberOfFrames; + /// number of representative frame, type 3 attribute (default '0') + Uint32 RepresentativeFrame; + /// nominal time between individual frames (0 if absent) + double FrameTime; + /// number of rows (in pixel) + Uint16 Rows; + /// number of columns (in pixel) + Uint16 Columns; + /// width of each pixel according to 'PixelSpacing/AspectRatio' + double PixelWidth; + /// height of each pixel according to 'PixelSpacing/AspectRatio' + double PixelHeight; + /// number of bits allocated for each pixel + Uint16 BitsAllocated; + /// number of bits stored for each pixel (see 'BitsPerSample') + Uint16 BitsStored; + /// position of highest stored bit + Uint16 HighBit; + + /// actual number of bits per sample (depth) + int BitsPerSample; + /// number of samples per pixel (1, 3 or 4) + int SamplesPerPixel; + + /// polarity (normal or reverse) + EP_Polarity Polarity; + + /// is 'true' if pixel data is signed + int hasSignedRepresentation; + /// is 'true' if attribute 'PixelSpacing' is present + int hasPixelSpacing; + /// is 'true' if attribute 'ImagerPixelSpacing' is present + int hasImagerPixelSpacing; + /// is 'true' if attribute 'hasNominalScannedPixelSpacing' is present + int hasNominalScannedPixelSpacing; + /// is 'true' if attribute 'PixelAspectRatio' is present + int hasPixelAspectRatio; + /// is 'false' if derived from original image data (e.g. scaled) + int isOriginal; + + /// points to intermediate pixel representation (template object) + DiInputPixel *InputData; + /// file cache object used for partial read + DcmFileCache FileCache; + /// current pixel item fragment (for encapsulated pixel data) + Uint32 CurrentFragment; + + // --- declarations to avoid compiler warnings + + DiImage(const DiImage &); + DiImage &operator=(const DiImage &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diinpx.h b/dcmimgle/include/dcmtk/dcmimgle/diinpx.h new file mode 100644 index 00000000..ade09a34 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diinpx.h @@ -0,0 +1,208 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomInputPixel (Header) + * + */ + + +#ifndef DIINPX_H +#define DIINPX_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diutils.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Abstract base class to convert DICOM pixel stream to intermediate representation + */ +class DCMTK_DCMIMGLE_EXPORT DiInputPixel +{ + + public: + + /** constructor + * + ** @param bits number of bits stored for each pixel (depth) + * @param first first frame to be processed + * @param number number of frames to be processed + * @param fsize number of pixels per frame (frame size) + */ + DiInputPixel(const unsigned int bits, + const unsigned long first, + const unsigned long number, + const unsigned long fsize); + + /** destructor + */ + virtual ~DiInputPixel(); + + /** determine minimum and maximum pixel value (abstract) + * + ** @return status, true if successful, false otherwise + */ + virtual int determineMinMax() = 0; + + /** get pixel representation (abstract). + * Determine which integer type (size and signed/unsigned) is necessary to store + * the pixel data. + * + ** @return pixel representation + */ + virtual EP_Representation getRepresentation() const = 0; + + /** get pointer to input pixel data (abstract) + * + ** @return pointer to input pixel data + */ + virtual const void *getData() const = 0; + + /** get pointer to input pixel data (abstract) + * + ** @return pointer to input pixel data + */ + virtual void *getDataPtr() = 0; + + /** remove reference to (internally handled) pixel data (abstract) + */ + virtual void removeDataReference() = 0; + + /** get minimum pixel value (abstract) + * + ** @param idx specifies whether to return the global minimum (0) or + * the minimum of the selected pixel range (1, see PixelStart/Range) + * + ** @return minimum pixel value + */ + virtual double getMinValue(const int idx) const = 0; + + /** get maximum pixel value (abstract) + * + ** @param idx specifies whether to return the global maximum (0) or + * the maximum of the selected pixel range (1, see PixelStart/Range) + * + ** @return maximum pixel value + */ + virtual double getMaxValue(const int idx) const = 0; + + /** get number of bits per pixel + * + ** @return number of bits per pixel + */ + inline unsigned int getBits() const + { + return Bits; + } + + /** get absolute minimum pixel value + * + ** @return absolute minimum pixel value + */ + inline double getAbsMinimum() const + { + return AbsMinimum; + } + + /** get absolute maximum pixel value + * + ** @return absolute maximum pixel value + */ + inline double getAbsMaximum() const + { + return AbsMaximum; + } + + /** get absolute pixel value range + * + ** @return absolute pixel value range + */ + inline double getAbsMaxRange() const + { + return AbsMaximum - AbsMinimum + 1; + } + + /** get number of pixels stored + * + ** @return number of pixels stored + */ + inline unsigned long getCount() const + { + return Count; + } + + /** get first pixel to be processed + * + ** @return first pixel to be processed + */ + inline unsigned long getPixelStart() const + { + return PixelStart; + } + + /** get number of pixels to be processed + * + ** @return number of pixels to be processed + */ + inline unsigned long getPixelCount() const + { + return PixelCount; + } + + /** get number of pixels computed from the image resolution + * + ** @return number of pixels computed + */ + inline unsigned long getComputedCount() const + { + return ComputedCount; + } + + + protected: + + /// number of pixels stored + unsigned long Count; + /// bits per pixel/sample + unsigned int Bits; + + /// first frame to be processed + unsigned long FirstFrame; + /// number of frames to be processed + unsigned long NumberOfFrames; + /// number of pixels per frame + unsigned long FrameSize; + + /// first pixel to be processed + unsigned long PixelStart; + /// number of pixels to be processed + unsigned long PixelCount; + + /// number of pixels computed from the image resolution + unsigned long ComputedCount; + + /// absolute minimum (possible) pixel value + double AbsMinimum; + /// absolute maximum (possible) pixel value + double AbsMaximum; +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diinpxt.h b/dcmimgle/include/dcmtk/dcmimgle/diinpxt.h new file mode 100644 index 00000000..b0f4a8d9 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diinpxt.h @@ -0,0 +1,674 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomInputPixelTemplate (Header) + * + */ + + +#ifndef DIINPXT_H +#define DIINPXT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcpixel.h" + +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/diinpx.h" +#include "dcmtk/dcmimgle/didocu.h" +#include "dcmtk/dcmimgle/dipxrept.h" + + +/*--------------------* + * helper functions * + *--------------------*/ + +static inline Uint8 expandSign(const Uint8 Value, + const Uint8, + const Uint8) +{ + return Value; +} + + +static inline Uint16 expandSign(const Uint16 Value, + const Uint16, + const Uint16) +{ + return Value; +} + + +static inline Uint32 expandSign(const Uint32 Value, + const Uint32, + const Uint32) +{ + return Value; +} + + +static inline Sint8 expandSign(const Sint8 Value, + const Sint8 SignBit, + const Sint8 SignMask) +{ + return (Value & SignBit) ? (Value | SignMask) : Value; +} + + +static inline Sint16 expandSign(const Sint16 Value, + const Sint16 SignBit, + const Sint16 SignMask) +{ + return (Value & SignBit) ? (Value | SignMask) : Value; +} + + +static inline Sint32 expandSign(const Sint32 Value, + const Sint32 SignBit, + const Sint32 SignMask) +{ + return (Value & SignBit) ? (Value | SignMask) : Value; +} + + +static Uint32 getPixelData(DcmPixelData *PixelData, + Uint8 *&pixel) +{ + PixelData->getUint8Array(pixel); + return PixelData->getLength(); +} + + +static Uint32 getPixelData(DcmPixelData *PixelData, + Uint16 *&pixel) +{ + PixelData->getUint16Array(pixel); + return PixelData->getLength(); +} + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to convert DICOM pixel stream to intermediate representation + */ +template +class DiInputPixelTemplate + : public DiInputPixel, + public DiPixelRepresentationTemplate +{ + + public: + + /** constructor + * + ** @param document pointer to DICOM image object + * @param alloc number of bits allocated for each pixel + * @param stored number of bits stored for each pixel + * @param high position of high bit within bits allocated + * @param first first frame to be processed + * @param number number of frames to be processed + * @param fsize number of pixels per frame (frame size) + * @param fileCache pointer to file cache object used for partial read + * @param fragment current pixel item fragment (for encapsulated pixel data) + */ + DiInputPixelTemplate(const DiDocument *document, + const Uint16 alloc, + const Uint16 stored, + const Uint16 high, + const unsigned long first, + const unsigned long number, + const unsigned long fsize, + DcmFileCache *fileCache, + Uint32 &fragment) + : DiInputPixel(stored, first, number, fsize), + Data(NULL) + { + MinValue[0] = 0; + MinValue[1] = 0; + MaxValue[0] = 0; + MaxValue[1] = 0; + if (this->isSigned()) + { + AbsMinimum = -OFstatic_cast(double, DicomImageClass::maxval(Bits - 1, 0)); + AbsMaximum = OFstatic_cast(double, DicomImageClass::maxval(Bits - 1)); + } else { + AbsMinimum = 0; + AbsMaximum = OFstatic_cast(double, DicomImageClass::maxval(Bits)); + } + if ((document != NULL) && (document->getPixelData() != NULL)) + convert(document, alloc, stored, high, fileCache, fragment); + if ((PixelCount == 0) || (PixelStart + PixelCount > Count)) // check for corrupt pixel length + { + PixelCount = Count - PixelStart; + DCMIMGLE_DEBUG("setting number of pixels to be processed (PixelCount) to " << PixelCount); + } + } + + /** destructor + */ + virtual ~DiInputPixelTemplate() + { +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + /* use a non-throwing delete (if available) */ + operator delete[] (Data, std::nothrow); +#else + delete[] Data; +#endif + } + + /** determine minimum and maximum pixel value + * + ** @return status, true if successful, false otherwise + */ + int determineMinMax() + { + if (Data != NULL) + { + DCMIMGLE_DEBUG("determining minimum and maximum pixel values for input data"); + T2 *p = Data; + unsigned long i; + const double absrange = getAbsMaxRange(); + const unsigned long ocnt = (absrange <= 10000000.0) ? OFstatic_cast(unsigned long, absrange) : 0 /* no LUT */; + Uint8 *lut = NULL; + if ((sizeof(T2) <= 2) && (ocnt > 0) && (Count > 3 * ocnt)) // optimization criteria + { + lut = new Uint8[ocnt]; + if (lut != NULL) + { + DCMIMGLE_DEBUG("using optimized routine with additional LUT"); + OFBitmanipTemplate::zeroMem(lut, ocnt); + Uint8 *q = lut - OFstatic_cast(T2, getAbsMinimum()); + for (i = Count; i != 0; --i) // fill lookup table + *(q + *(p++)) = 1; + q = lut; + for (i = 0; i < ocnt; ++i) // search for minimum + { + if (*(q++) != 0) + { + MinValue[0] = OFstatic_cast(T2, OFstatic_cast(double, i) + getAbsMinimum()); + break; + } + } + q = lut + ocnt; + for (i = ocnt; i != 0; --i) // search for maximum + { + if (*(--q) != 0) + { + MaxValue[0] = OFstatic_cast(T2, OFstatic_cast(double, i - 1) + getAbsMinimum()); + break; + } + } + if (Count >= PixelCount) // use global min/max value + { + MinValue[1] = MinValue[0]; + MaxValue[1] = MaxValue[0]; + } else { // calculate min/max for selected range + OFBitmanipTemplate::zeroMem(lut, ocnt); + p = Data + PixelStart; + q = lut - OFstatic_cast(T2, getAbsMinimum()); + for (i = PixelCount; i != 0; --i) // fill lookup table + *(q + *(p++)) = 1; + q = lut; + for (i = 0; i < ocnt; ++i) // search for minimum + { + if (*(q++) != 0) + { + MinValue[1] = OFstatic_cast(T2, OFstatic_cast(double, i) + getAbsMinimum()); + break; + } + } + q = lut + ocnt; + for (i = ocnt; i != 0; --i) // search for maximum + { + if (*(--q) != 0) + { + MaxValue[1] = OFstatic_cast(T2, OFstatic_cast(double, i - 1) + getAbsMinimum()); + break; + } + } + } + } + } + if (lut == NULL) // use conventional method + { + T2 value = *p; + MinValue[0] = value; + MaxValue[0] = value; + for (i = Count; i > 1; --i) + { + value = *(++p); + if (value < MinValue[0]) + MinValue[0] = value; + else if (value > MaxValue[0]) + MaxValue[0] = value; + } + if (Count <= PixelCount) // use global min/max value + { + MinValue[1] = MinValue[0]; + MaxValue[1] = MaxValue[0]; + } else { // calculate min/max for selected range + p = Data + PixelStart; + value = *p; + MinValue[1] = value; + MaxValue[1] = value; + for (i = PixelCount; i > 1; --i) + { + value = *(++p); + if (value < MinValue[1]) + MinValue[1] = value; + else if (value > MaxValue[1]) + MaxValue[1] = value; + } + } + } + delete[] lut; + return 1; + } + return 0; + } + + /** get pixel representation + * + ** @return pixel representation + */ + inline EP_Representation getRepresentation() const + { + return DiPixelRepresentationTemplate::getRepresentation(); + } + + /** get pointer to input pixel data + * + ** @return pointer to input pixel data + */ + inline const void *getData() const + { + return OFstatic_cast(const void *, Data); + } + + /** get reference to pointer to input pixel data + * + ** @return reference to pointer to input pixel data + */ + virtual void *getDataPtr() + { + return OFstatic_cast(void *, Data); + } + + /** remove reference to (internally handled) pixel data + */ + inline void removeDataReference() + { + Data = NULL; + } + + /** get minimum pixel value + * + ** @param idx specifies whether to return the global minimum (0) or + * the minimum of the selected pixel range (1, see PixelStart/Range) + * + ** @return minimum pixel value + */ + inline double getMinValue(const int idx) const + { + return (idx == 0) ? OFstatic_cast(double, MinValue[0]) : OFstatic_cast(double, MinValue[1]); + } + + /** get maximum pixel value + * + ** @param idx specifies whether to return the global maximum (0) or + * the maximum of the selected pixel range (1, see PixelStart/Range) + * + ** @return maximum pixel value + */ + inline double getMaxValue(const int idx) const + { + return (idx == 0) ? OFstatic_cast(double, MaxValue[0]) : OFstatic_cast(double, MaxValue[1]); + } + + + private: + + /** convert pixel data from DICOM dataset to input representation + * + ** @param document pointer to DICOM image object + * @param bitsAllocated number of bits allocated for each pixel + * @param bitsStored number of bits stored for each pixel + * @param highBit position of high bit within bits allocated + * @param fileCache pointer to file cache object used for partial read + * @param fragment current pixel item fragment (for encapsulated pixel data) + */ + void convert(const DiDocument *document, + const Uint16 bitsAllocated, + const Uint16 bitsStored, + const Uint16 highBit, + DcmFileCache *fileCache, + Uint32 &fragment) + { + T1 *pixel = NULL; + OFBool deletePixel = OFFalse; + Uint32 lengthBytes = 0; + DcmPixelData *pixelData = document->getPixelData(); + const Uint16 bitsof_T1 = bitsof(T1); + const Uint16 bitsof_T2 = bitsof(T2); + const OFBool uncompressed = pixelData->canWriteXfer(EXS_LittleEndianExplicit, EXS_Unknown); + /* check whether to use partial read */ + if ((document->getFlags() & CIF_UsePartialAccessToPixelData) && (PixelCount > 0) && (bitsAllocated % 8 == 0)) + { + /* Bits Allocated is always a multiple of 8 (see above), same for bits of T1 */ + const Uint32 byteFactor = bitsAllocated / 8; + const Uint32 bytes_T1 = bitsof_T1 / 8; + const Uint32 count_T1 = (byteFactor == bytes_T1) ? PixelCount : (PixelCount * byteFactor + bytes_T1 - 1) / bytes_T1; +#ifdef DEBUG + DCMIMGLE_TRACE("PixelCount: " << PixelCount << ", byteFactor: " << byteFactor << ", bytes_T1: " << bytes_T1 << ", count_T1: " << count_T1); +#endif + /* allocate temporary buffer, even number of bytes required for getUncompressedFrame() */ + const Uint32 extraByte = ((sizeof(T1) == 1) && (count_T1 & 1)) ? 1 : 0; +#ifdef HAVE_STD__NOTHROW + /* use a non-throwing new here (if available) because the allocated buffer can be huge */ + pixel = new (std::nothrow) T1[count_T1 + extraByte]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + pixel = new T1[count_T1 + extraByte]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + pixel = NULL; + } +#endif + if (pixel != NULL) + { + if (uncompressed) + { + DCMIMGLE_DEBUG("using partial read access to uncompressed pixel data"); + const Uint32 offset = PixelStart * byteFactor; + const Uint32 bufSize = PixelCount * byteFactor; + const OFCondition status = pixelData->getPartialValue(pixel, offset, bufSize, fileCache); + if (status.good()) + { + PixelStart = 0; + lengthBytes = bufSize; + } else { + DCMIMGLE_ERROR("can't access partial value from byte offset " << offset << " to " + << (offset + bufSize - 1) << ": " << status.text()); + } + } else { + DCMIMGLE_DEBUG("using partial read access to compressed pixel data"); + OFCondition status = EC_IllegalCall; + OFString decompressedColorModel; + const Uint32 fsize = FrameSize * byteFactor; + for (Uint32 frame = 0; frame < NumberOfFrames; ++frame) + { + /* make sure that the buffer always has an even number of bytes as required for getUncompressedFrame() */ + const Uint32 bufSize = (fsize & 1) ? fsize + 1 : fsize; + status = pixelData->getUncompressedFrame(document->getDataset(), FirstFrame + frame, fragment, + OFreinterpret_cast(Uint8 *, pixel) + lengthBytes, bufSize, decompressedColorModel, fileCache); + if (status.good()) + { + DCMIMGLE_TRACE("successfully decompressed frame " << FirstFrame + frame); + lengthBytes += fsize; + } else { + DCMIMGLE_ERROR("can't decompress frame " << FirstFrame + frame << ": " << status.text()); + break; + } + } + if (status.good()) + PixelStart = 0; + /* check whether color model changed during decompression */ + if (!decompressedColorModel.empty() && (decompressedColorModel != document->getPhotometricInterpretation())) + { + DCMIMGLE_WARN("Photometric Interpretation of decompressed pixel data deviates from original image: " + << decompressedColorModel); + } + } + deletePixel = OFTrue; + } else + DCMIMGLE_DEBUG("cannot allocate memory buffer for 'pixel' in DiInputPixelTemplate::convert()"); + } else { + DCMIMGLE_DEBUG("reading uncompressed pixel data completely into memory"); + /* always access complete pixel data */ + lengthBytes = getPixelData(pixelData, pixel); + } + if ((pixel != NULL) && (lengthBytes > 0)) + { + const Uint32 length_T1 = lengthBytes / sizeof(T1); + /* need to split 'length' in order to avoid integer overflow for large pixel data */ + const Uint32 length_B1 = lengthBytes / bitsAllocated; + const Uint32 length_B2 = lengthBytes % bitsAllocated; +// # old code: Count = ((lengthBytes * 8) + bitsAllocated - 1) / bitsAllocated; + Count = 8 * length_B1 + (8 * length_B2 + bitsAllocated - 1) / bitsAllocated; + unsigned long i; +#ifdef HAVE_STD__NOTHROW + /* use a non-throwing new here (if available) because the allocated buffer can be huge */ + Data = new (std::nothrow) T2[Count]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + Data = new T2[Count]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + Data = NULL; + } +#endif + if (Data != NULL) + { + DCMIMGLE_TRACE("Input length: " << lengthBytes << " bytes, Pixel count: " << Count + << " (" << PixelCount << "), In: " << bitsof_T1 << " bits, Out: " << bitsof_T2 + << " bits (" << (this->isSigned() ? "signed" : "unsigned") << ")"); + const T1 *p = pixel; + T2 *q = Data; + if (bitsof_T1 == bitsAllocated) // case 1: equal 8/16 bit + { + if (bitsStored == bitsAllocated) + { + DCMIMGLE_DEBUG("convert input pixel data: case 1a (single copy)"); + for (i = Count; i != 0; --i) + *(q++) = OFstatic_cast(T2, *(p++)); + } + else /* bitsStored < bitsAllocated */ + { + T1 mask = 0; + for (i = 0; i < bitsStored; ++i) + mask |= OFstatic_cast(T1, 1 << i); + const T2 sign = 1 << (bitsStored - 1); + T2 smask = 0; + for (i = bitsStored; i < bitsof_T2; ++i) + smask |= OFstatic_cast(T2, 1 << i); + const Uint16 shift = highBit + 1 - bitsStored; + if (shift == 0) + { + DCMIMGLE_DEBUG("convert input pixel data: case 1b (mask & sign)"); + for (i = length_T1; i != 0; --i) + *(q++) = expandSign(OFstatic_cast(T2, *(p++) & mask), sign, smask); + } + else /* shift > 0 */ + { + DCMIMGLE_DEBUG("convert input pixel data: case 1c (shift & mask & sign)"); + for (i = length_T1; i != 0; --i) + *(q++) = expandSign(OFstatic_cast(T2, (*(p++) >> shift) & mask), sign, smask); + } + } + } + else if ((bitsof_T1 > bitsAllocated) && (bitsof_T1 % bitsAllocated == 0)) // case 2: divisor of 8/16 bit + { + const Uint16 times = bitsof_T1 / bitsAllocated; + T1 mask = 0; + for (i = 0; i < bitsStored; ++i) + mask |= OFstatic_cast(T1, 1 << i); + Uint16 j; + T1 value; + if ((bitsStored == bitsAllocated) && (bitsStored == bitsof_T2)) + { + if (times == 2) + { + DCMIMGLE_DEBUG("convert input pixel data: case 2a (simple mask)"); + for (i = length_T1; i != 0; --i, ++p) + { + *(q++) = OFstatic_cast(T2, *p & mask); + *(q++) = OFstatic_cast(T2, *p >> bitsAllocated); + } + /* check for additional input pixel (in case of odd length when using partial access) */ + if (length_T1 * 2 /* times */ < lengthBytes) + { + DCMIMGLE_TRACE("found trailing pixel at the end of odd-length input data ... copying value"); + *(q++) = OFstatic_cast(T2, *p & mask); + } + } + else + { + DCMIMGLE_DEBUG("convert input pixel data: case 2b (mask)"); + for (i = length_T1; i != 0; --i) + { + value = *(p++); + for (j = times; j != 0; --j) + { + *(q++) = OFstatic_cast(T2, value & mask); + value >>= bitsAllocated; + } + } + } + } + else + { + DCMIMGLE_DEBUG("convert input pixel data: case 2c (shift & mask & sign)"); + const T2 sign = 1 << (bitsStored - 1); + T2 smask = 0; + for (i = bitsStored; i < bitsof_T2; ++i) + smask |= OFstatic_cast(T2, 1 << i); + const Uint16 shift = highBit + 1 - bitsStored; + for (i = length_T1; i != 0; --i) + { + value = *(p++) >> shift; + for (j = times; j != 0; --j) + { + *(q++) = expandSign(OFstatic_cast(T2, value & mask), sign, smask); + value >>= bitsAllocated; + } + } + } + } + else if ((bitsof_T1 < bitsAllocated) && (bitsAllocated % bitsof_T1 == 0) // case 3: multiplicand of 8/16 + && (bitsStored == bitsAllocated)) + { + DCMIMGLE_DEBUG("convert input pixel data: case 3 (multi copy)"); + const Uint16 times = bitsAllocated / bitsof_T1; + Uint16 j; + Uint16 shift; + T2 value; + for (i = length_T1; i != 0; --i) + { + shift = 0; + value = OFstatic_cast(T2, *(p++)); + for (j = times; j > 1; --j, --i) + { + shift += bitsof_T1; + value |= OFstatic_cast(T2, *(p++)) << shift; + } + *(q++) = value; + } + } + else // case 4: anything else + { + DCMIMGLE_DEBUG("convert input pixel data: case 4 (general)"); + T2 value = 0; + Uint16 bits = 0; + Uint32 skip = highBit + 1 - bitsStored; + Uint32 times; + T1 mask[bitsof_T1]; + mask[0] = 1; + for (i = 1; i < bitsof_T1; ++i) + mask[i] = (mask[i - 1] << 1) | 1; + T2 smask = 0; + for (i = bitsStored; i < bitsof_T2; ++i) + smask |= OFstatic_cast(T2, 1 << i); + const T2 sign = 1 << (bitsStored - 1); + const Uint32 gap = bitsAllocated - bitsStored; + i = 0; + while (i < length_T1) + { + if (skip < bitsof_T1) + { + if (skip + bitsStored - bits < bitsof_T1) // -++- --++ + { + value |= (OFstatic_cast(T2, (*p >> skip) & mask[bitsStored - bits - 1]) << bits); + skip += bitsStored - bits + gap; + bits = bitsStored; + } + else // ++-- ++++ + { + value |= (OFstatic_cast(T2, (*p >> skip) & mask[bitsof_T1 - skip - 1]) << bits); + bits += bitsof_T1 - OFstatic_cast(Uint16, skip); + skip = (bits == bitsStored) ? gap : 0; + ++i; + ++p; + } + if (bits == bitsStored) + { + *(q++) = expandSign(value, sign, smask); + value = 0; + bits = 0; + } + } + else + { + times = skip / bitsof_T1; + i += times; + p += times; + skip -= times * bitsof_T1; + } + } + } + } else + DCMIMGLE_DEBUG("cannot allocate memory buffer for 'Data' in DiInputPixelTemplate::convert()"); + } else { + /* in case of error, reset pixel count variable */ + Count = 0; + } + if (deletePixel) + { + /* delete temporary buffer */ +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + /* use a non-throwing delete (if available) */ + operator delete[] (pixel, std::nothrow); +#else + delete[] pixel; +#endif + } + } + + /// pointer to pixel data + T2 *Data; + + /// minimum pixel value ([0] = global, [1] = selected pixel range) + T2 MinValue[2]; + /// maximum pixel value ([0] = global, [1] = selected pixel range) + T2 MaxValue[2]; + + // --- declarations to avoid compiler warnings + + DiInputPixelTemplate(const DiInputPixelTemplate &); + DiInputPixelTemplate &operator=(const DiInputPixelTemplate &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diluptab.h b/dcmimgle/include/dcmtk/dcmimgle/diluptab.h new file mode 100644 index 00000000..4383f350 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diluptab.h @@ -0,0 +1,251 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomLookupTable (Header) + * + */ + + +#ifndef DILUPTAB_H +#define DILUPTAB_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctagkey.h" + +#include "dcmtk/dcmimgle/dibaslut.h" +#include "dcmtk/dcmimgle/diobjcou.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DcmObject; +class DcmUnsignedShort; +class DcmLongString; +class DiDocument; +class DcmItem; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to handle color palette look-up tables + */ +class DCMTK_DCMIMGLE_EXPORT DiLookupTable + : public DiBaseLUT, + public DiObjectCounter +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param descriptor tag key containing the LUT descriptor + * @param data tag key containing the LUT data + * @param explanation tag key containing the LUT explanation + * @param descripMode mode specifying the use of the bits per table entry value + * @param status pointer to image status variable (optional) + */ + DiLookupTable(const DiDocument *docu, + const DcmTagKey &descriptor, + const DcmTagKey &data, + const DcmTagKey &explanation, + const EL_BitsPerTableEntry descripMode = ELM_UseValue, + EI_Status *status = NULL); + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param sequence tag key containing the LUT sequence + * @param descriptor tag key containing the LUT descriptor + * @param data tag key containing the LUT data + * @param explanation tag key containing the LUT explanation + * @param descripMode mode specifying the use of the bits per table entry value + * @param pos position in the LUT sequence which should be used (optional) + * @param card pointer to storage area where the number of sequence entries + * should be stored (optional) + */ + DiLookupTable(const DiDocument *docu, + const DcmTagKey &sequence, + const DcmTagKey &descriptor, + const DcmTagKey &data, + const DcmTagKey &explanation, + const EL_BitsPerTableEntry descripMode = ELM_UseValue, + const unsigned long pos = 0, + unsigned long *card = NULL); + + /** constructor + * + ** @param data element containing the LUT data + * @param descriptor element containing the LUT descriptor + * @param explanation element containing the LUT explanation (optional) + * @param descripMode mode specifying the use of the bits per table entry value + * @param first expected value for "first input value mapped" (optional) + * @param status pointer to image status variable (optional) + */ + DiLookupTable(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation = NULL, + const EL_BitsPerTableEntry descripMode = ELM_UseValue, + const signed long first = -1, + EI_Status *status = NULL); + + /** constructor + * + ** @param buffer pointer to array with LUT entries + * @param count number of LUT entries + * @param bits number of bits per entry + */ + DiLookupTable(Uint16 *buffer, + const Uint32 count, + const Uint16 bits); + + /** destructor + */ + virtual ~DiLookupTable(); + + /** invert all LUT values. + * (new_value = max_value - old_value, e.g. used for presentation LUTs) + * + ** @param flag if bit 0 is set (0x1, default) the internal copy of the LUT data is modified + * or a copy of the original data is created (if not already existing), + * if bit 1 is set (0x2) the original LUT data is modified, + * a combination of both modes is also supported. + * + ** @return status true if successful (0x1 if internal data modified, 0x2 if original data, 0x3 if both), + * false otherwise + */ + int invertTable(const int flag = 0x1); + + /** mirror the order of all LUT entries. + * i.e. the last one becomes the first etc. + * (value[i] = value[last - i], e.g. used for presentation LUTs) + * + ** @param flag if bit 0 is set (0x1, default) the internal copy of the LUT data is modified + * or a copy of the original data is created (if not already existing), + * if bit 1 is set (0x2) the original LUT data is modified, + * a combination of both modes is also supported. + * + ** @return status true if successful (0x1 if internal data modified, 0x2 if original data, 0x3 if both), + * false otherwise + */ + int mirrorTable(const int flag = 0x1); + + /** create an inverse copy of the current LUT. + * (input values become output values and vice versa) + * This function is used for DICOM print (mainly 8<->12 bit). + * + ** @return pointer to inverse LUT + */ + DiLookupTable *createInverseLUT() const; + + /** compares current LUT with specified LUT + * + ** @param data element containing the LUT data + * @param descriptor element containing the LUT descriptor + * + ** @return true if LUTs are not equal (1 = invalid LUT / memory error, + * 2 = descriptor differs, + * 3 = data differs) + * false (0) otherwise + */ + int compareLUT(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor); + + + /** compares current LUT with specified LUT + * + ** @param lut LUT to be compared with the current one + * + ** @return OFTrue if LUTs are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DiBaseLUT &lut); + + /** compares current LUT with specified LUT + * + ** @param lut LUT to be compared with the current one + * + ** @return OFTrue if LUTs are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DiLookupTable &lut); + + + protected: + + /** initialize lookup table + * + ** @param docu pointer to dataset (encapsulated) + * @param item pointer to item in dataset where to start (maybe NULL) + * @param descriptor tag key containing the LUT descriptor + * @param data tag key containing the LUT data + * @param explanation tag key containing the LUT explanation + * @param descripMode mode specifying the use of the bits per table entry value + * @param status pointer to image status variable (optional) + */ + void Init(const DiDocument *docu, + DcmItem *item, + const DcmTagKey &descriptor, + const DcmTagKey &data, + const DcmTagKey &explanation, + const EL_BitsPerTableEntry descripMode = ELM_UseValue, + EI_Status *status = NULL); + + /** check (and possibly correct) lookup table for consistency + * + ** @param count number of LUT entries + * @param bits bits per LUT entry + * @param descripMode mode specifying the use of the bits per table entry value + * @param status pointer to image status variable (optional) + */ + void checkTable(unsigned long count, + Uint16 bits, + const EL_BitsPerTableEntry descripMode = ELM_UseValue, + EI_Status *status = NULL); + + /** check (and possibly correct) value for bits per LUT entry. + * Be very lenient with the value stored in the LUT descriptor and + * therefore perform some addition (heuristical tests) to assume the + * most probable value. + * + ** @param bits actual value for bits per entry + * @param rightBits right value (8 or 16) + * @param wrongBits wrong value (8 or 16) + * @param descripMode mode specifying the use of the bits per table entry value + */ + void checkBits(const Uint16 bits, + const Uint16 rightBits, + const Uint16 wrongBits = 0, + const EL_BitsPerTableEntry descripMode = ELM_UseValue); + + private: + + /// number of bits originally allocated for a LUT entry + int OriginalBitsAllocated; + /// pointer to original data buffer (where the LUT data is created from) + void *OriginalData; + + // --- declarations to avoid compiler warnings + + DiLookupTable(const DiLookupTable &); + DiLookupTable &operator=(const DiLookupTable &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimo1img.h b/dcmimgle/include/dcmtk/dcmimgle/dimo1img.h new file mode 100644 index 00000000..ec50d783 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimo1img.h @@ -0,0 +1,227 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochrome1Image (Header) + * + */ + + +#ifndef DIMO1IMG_H +#define DIMO1IMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for MONOCHROME1 images + */ +class DCMTK_DCMIMGLE_EXPORT DiMono1Image + : public DiMonoImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiMono1Image(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiMono1Image(); + + /** get color model of internal pixel representation. + * @return always returns EPI_Monochrome1 + */ + virtual EP_Interpretation getInternalColorModel() const + { + return EPI_Monochrome1; + } + + /** get pixel data with specified format. + * (memory is handled internally) + * + ** @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flags, whether the output data (for multi-planar images) should be planar or not + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + virtual const void *getOutputData(const unsigned long frame, + const int bits, + const int planar = 0); + + /** get pixel data with specified format. + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param size size of the memory buffer in bytes (will be checked) + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flags, whether the output data (for multi-planar images) should be planar or not + * + ** @return status, true if successful, false otherwise + */ + virtual int getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar = 0); + + /** create copy of current image object + * + ** @param fstart first frame to be processed + * @param fcount number of frames + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DiImage *createImage(const unsigned long fstart, + const unsigned long fcount) const; + + /** create scaled copy of specified (clipping) area of the current image object. + * + ** @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param clip_width width of area to be scaled + * @param clip_height height of area to be scaled + * @param scale_width width of scaled image (in pixels) + * @param scale_height height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createScale(const signed long left_pos, + const signed long top_pos, + const unsigned long clip_width, + const unsigned long clip_height, + const unsigned long scale_width, + const unsigned long scale_height, + const int interpolate, + const int aspect, + const Uint16 pvalue) const; + + /** create a flipped copy of the current image + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createFlip(const int horz, + const int vert) const; + + /** create a rotated copy of the current image. + * + ** @param degree angle by which the image shall be rotated + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createRotate(const int degree) const; + + /** create monochrome copy of the current image. + * Since the image is already monochrome the effect is the same as with createImage(). + * + ** @param dummy1 not used + * @param dummy2 not used + * @param dummy3 not used + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createMono(const double dummy1, + const double dummy2, + const double dummy3) const; + + + protected: + + /** constructor, copy + * + ** @param image pointer to reference image + * @param fstart first frame to be processed + * @param fcount number of frames + */ + DiMono1Image(const DiMonoImage *image, + const unsigned long fstart, + const unsigned long fcount); + + /** constructor, scale/clip + * + ** @param image pointer to reference image + * @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param src_cols width of area to be scaled + * @param src_rows height of area to be scaled + * @param dest_cols width of scaled image (in pixels) + * @param dest_rows height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + */ + DiMono1Image(const DiMonoImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate = 0, + const int aspect = 0, + const Uint16 pvalue = 0); + + /** constructor, flip + * + ** @param image pointer to reference image + ** @param horz flip horizontally if true + * @param vert flip vertically if true + */ + DiMono1Image(const DiMonoImage *image, + const int horz, + const int vert); + + /** constructor, rotate + * + ** @param image pointer to reference image + * @param degree angle by which the image shall be rotated + */ + DiMono1Image(const DiMonoImage *image, + const int degree); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimo2img.h b/dcmimgle/include/dcmtk/dcmimgle/dimo2img.h new file mode 100644 index 00000000..101f43e4 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimo2img.h @@ -0,0 +1,289 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochrome2Image (Header) + * + */ + + +#ifndef DIMO2IMG_H +#define DIMO2IMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimoimg.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for MONOCHROME2 images + */ +class DCMTK_DCMIMGLE_EXPORT DiMono2Image + : public DiMonoImage +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiMono2Image(const DiDocument *docu, + const EI_Status status); + + /** constructor, modality (linear) + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + * @param slope rescale slope + * @param intercept rescale intercept + */ + DiMono2Image(const DiDocument *docu, + const EI_Status status, + const double slope, + const double intercept); + + /** constructor, modality (LUT) + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + * @param data element containing the modality LUT data + * @param descriptor element containing the modality LUT descriptor + * @param explanation element containing the modality LUT explanation (optional) + */ + DiMono2Image(const DiDocument *docu, + const EI_Status status, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation); + + /** constructor, convert color images to monochrome + * + ** @param image pointer to reference image + * @param red coefficient by which the red component is weighted + * @param green coefficient by which the green component is weighted + * @param blue coefficient by which the blue component is weighted + */ + DiMono2Image(const DiColorImage *image, + const double red, + const double green, + const double blue); + + /** constructor, createMonoOutput + * + ** @param image pointer to reference image + * @param pixel pointer to output pixel data used for the new image + * @param frame number of frame stored in the new image object + * @param stored number of bits stored + * @param alloc number of bits allocated + */ + DiMono2Image(const DiMonoImage *image, + DiMonoOutputPixel *pixel, + const unsigned long frame, + const int stored, + const int alloc); + + /** destructor + */ + virtual ~DiMono2Image(); + + /** get color model of internal pixel representation. + * @return always returns EPI_Monochrome2 + */ + virtual EP_Interpretation getInternalColorModel() const + { + return EPI_Monochrome2; + } + + /** get pixel data with specified format. + * (memory is handled internally) + * + ** @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flags, whether the output data (for multi-planar images) should be planar or not + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + virtual const void *getOutputData(const unsigned long frame, + const int bits, + const int planar = 0); + + /** get pixel data with specified format. + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param size size of the memory buffer in bytes (will be checked) + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flags, whether the output data (for multi-planar images) should be planar or not + * + ** @return status, true if successful, false otherwise + */ + virtual int getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar = 0); + + /** create copy of current image object + * + ** @param fstart first frame to be processed + * @param fcount number of frames + * + ** @return pointer to new DicomImage object (NULL if an error occurred) + */ + DiImage *createImage(const unsigned long fstart, + const unsigned long fcount) const; + + /** create scaled copy of specified (clipping) area of the current image object. + * + ** @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param clip_width width of area to be scaled + * @param clip_height height of area to be scaled + * @param scale_width width of scaled image (in pixels) + * @param scale_height height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createScale(const signed long left_pos, + const signed long top_pos, + const unsigned long clip_width, + const unsigned long clip_height, + const unsigned long scale_width, + const unsigned long scale_height, + const int interpolate, + const int aspect, + const Uint16 pvalue) const; + + /** create a flipped copy of the current image + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createFlip(const int horz, + const int vert) const; + + /** create a rotated copy of the current image. + * + ** @param degree angle by which the image shall be rotated + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createRotate(const int degree) const; + + /** create monochrome copy of the current image. + * Since the image is already monochrome the effect is the same as with createImage(). + * + ** @param dummy1 not used + * @param dummy2 not used + * @param dummy3 not used + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createMono(const double dummy1, + const double dummy2, + const double dummy3) const; + + + protected: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + * @param dummy (necessary to be different from another constructor) + */ + DiMono2Image(const DiDocument *docu, + const EI_Status status, + const char dummy); + + /** constructor, copy + * + ** @param image pointer to reference image + * @param fstart first frame to be processed + * @param fcount number of frames + */ + DiMono2Image(const DiMonoImage *image, + const unsigned long fstart, + const unsigned long fcount); + + /** constructor, scale/clip + * + ** @param image pointer to reference image + * @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param src_cols width of area to be scaled + * @param src_rows height of area to be scaled + * @param dest_cols width of scaled image (in pixels) + * @param dest_rows height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + */ + DiMono2Image(const DiMonoImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate = 0, + const int aspect = 0, + const Uint16 pvalue = 0); + + /** constructor, flip + * + ** @param image pointer to reference image + ** @param horz flip horizontally if true + * @param vert flip vertically if true + */ + DiMono2Image(const DiMonoImage *image, + const int horz, + const int vert); + + /** constructor, rotate + * + ** @param image pointer to reference image + * @param degree angle by which the image shall be rotated + */ + DiMono2Image(const DiMonoImage *image, + const int degree); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimocpt.h b/dcmimgle/include/dcmtk/dcmimgle/dimocpt.h new file mode 100644 index 00000000..7172ea3a --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimocpt.h @@ -0,0 +1,93 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeCopyTemplate (Header) + * + */ + + +#ifndef DIMOCPT_H +#define DIMOCPT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dimopxt.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to copy monochrome pixel data + */ +template +class DiMonoCopyTemplate + : public DiMonoPixelTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to monochrome intermediate representation of pixel data + * @param fstart first frame to be copied + * @param fcount number of frames to be copied + * @param fsize size of one frame (in bytes) + */ + DiMonoCopyTemplate(const DiMonoPixel *pixel, + const unsigned long fstart, + const unsigned long fcount, + const unsigned long fsize) + : DiMonoPixelTemplate(pixel, fcount * fsize) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if ((pixel->getCount() > fstart * fsize) && (pixel->getCount() >= (fstart + fcount) * fsize)) + copy(OFstatic_cast(const T *, pixel->getData()) + fstart * fsize); + /* need to determine the global min/max value */ + this->determineMinMax(); + } + } + + /** destructor + */ + ~DiMonoCopyTemplate() + { + } + + + private: + + /** copy specified amount of pixel data + * + ** @param pixel array of pixel data to be copied + */ + inline void copy(const T *pixel) + { + if (pixel != NULL) + { + this->Data = new T[this->getCount()]; + if (this->Data != NULL) + OFBitmanipTemplate::copyMem(pixel, this->Data, this->getCount()); + } + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimoflt.h b/dcmimgle/include/dcmtk/dcmimgle/dimoflt.h new file mode 100644 index 00000000..bf626c3b --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimoflt.h @@ -0,0 +1,113 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeFlipTemplate (Header) + * + */ + + +#ifndef DIMOFLT_H +#define DIMOFLT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dimopxt.h" +#include "dcmtk/dcmimgle/diflipt.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to flip monochrome images (on pixel data level) + * horizontally and vertically + */ +template +class DiMonoFlipTemplate + : public DiMonoPixelTemplate, + protected DiFlipTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param columns number of columns + * @param rows number of rows + * @param frames number of frames + * @param horz flip horizontally if true + * @param vert flip vertically if true + */ + DiMonoFlipTemplate(const DiMonoPixel *pixel, + const Uint16 columns, + const Uint16 rows, + const Uint32 frames, + const int horz, + const int vert) + : DiMonoPixelTemplate(pixel, OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames), + DiFlipTemplate(1, columns, rows, frames) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if (pixel->getCount() == OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames) + flip(OFstatic_cast(const T *, pixel->getData()), horz, vert); + else { + DCMIMGLE_WARN("could not flip image ... corrupted data"); + } + } + } + + /** destructor + */ + ~DiMonoFlipTemplate() + { + } + + + private: + + /** choose flipping algorithm depending on given parameters + * + ** @param pixel pointer to pixel data which should be flipped + * @param horz flip horizontally if true + * @param vert flip vertically if true + */ + inline void flip(const T *pixel, + const int horz, + const int vert) + { + if (pixel != NULL) + { + this->Data = new T[this->getCount()]; + if (this->Data != NULL) + { + if (horz && vert) + this->flipHorzVert(&pixel, &this->Data); + else if (horz) + this->flipHorz(&pixel, &this->Data); + else if (vert) + this->flipVert(&pixel, &this->Data); + } + } + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimoimg.h b/dcmimgle/include/dcmtk/dcmimgle/dimoimg.h new file mode 100644 index 00000000..3077f374 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimoimg.h @@ -0,0 +1,1157 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeImage (Header) + * + */ + + +#ifndef DIMOIMG_H +#define DIMOIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/diimage.h" +#include "dcmtk/dcmimgle/dimopx.h" +#include "dcmtk/dcmimgle/dimoopx.h" +#include "dcmtk/dcmimgle/didispfn.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiColorImage; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Base class for monochrome images + */ +class DCMTK_DCMIMGLE_EXPORT DiMonoImage + : public DiImage +{ + + public: + + /** constructor + * + ** @param docu pointer to the DICOM document + * @param status status of the image object + */ + DiMonoImage(const DiDocument *docu, + const EI_Status status); + + /** constructor, rescale + * + ** @param docu pointer to the DICOM document + * @param status status of the image object + * @param slope rescale slope + * @param intercept rescale intercept + */ + DiMonoImage(const DiDocument *docu, + const EI_Status status, + const double slope, + const double intercept); + + /** constructor, modality LUT + * + ** @param docu pointer to the DICOM document + * @param status status of the image object + * @param data element containing the modality LUT data + * @param descriptor element containing the modality LUT descriptor + * @param explanation element containing the modality LUT explanation (optional) + */ + DiMonoImage(const DiDocument *docu, + const EI_Status status, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation); + + /** destructor + */ + virtual ~DiMonoImage(); + + /** process next couple of frames + * + ** @param fcount number of frames to be processed (0 = same number as before) + * + ** @return status, true if successful, false otherwise + */ + virtual int processNextFrames(const unsigned long fcount); + + /** get minimum and maximum pixel values. + * the resulting pixel values are stored in 'double' variables to avoid problems + * with different number ranges, limited to monochrome images + * + ** @param min minimum pixel value (reference parameter) + * @param max maximum pixel value (reference parameter) + * @param mode 0 = min/max 'used' pixel values, + * 1 = min/max 'possible' pixel values (absolute min/max) + * + ** @return status code (true if successful) + */ + int getMinMaxValues(double &min, + double &max, + const int mode) const; + + /** get display function + * + ** @return pointer to current display function, NULL if absent + */ + DiDisplayFunction *getDisplayFunction() const + { + return DisplayFunction; + } + + /** set display function + * + ** @param display object describing the output device characteristic (only referenced!) + * + ** @return true if successful, false otherwise + */ + int setDisplayFunction(DiDisplayFunction *display); + + /** set no display function. + * disables display function transformation, object is not deleted! + * + ** @return true if successful (1 = disabled current function, + * 2 = there was no function to disable) + * false otherwise + */ + int setNoDisplayFunction(); + + /** unset all VOI transformations (windows and LUTs). + * only applicable for monochrome images + * + ** @return true if successful (1 = previous window/LUT has been valid, + * 2 = otherwise), + * false otherwise (image is invalid or not monochrome) + */ + int setNoVoiTransformation(); + + /** delete specified display LUT(s) + * + ** @param bits parameter of LUT to be deleted (0 = all) + * + ** @return true if successful, false otherwise + */ + inline int deleteDisplayLUT(const int bits) + { + return (DisplayFunction != NULL) ? DisplayFunction->deleteLookupTable(bits) : 0; + } + + /** check whether given output value is unused + * + ** @param value output value to be checked + * + ** @return status, true if unused (1 = within output range, 2 = out of range), false otherwise + */ + inline int isValueUnused(const unsigned long value) + { + return (OutputData != NULL) ? OutputData->isUnused(value) : 0; + } + + /** convert P-value to DDL. + * conversion uses display LUT if present, linear scaling otherwise. + * + ** @param pvalue P-value to be converted (0..65535) + * @param ddl reference to resulting DDL + * @param bits number of bits for output + * + ** @return true if successful (1 = display function transformation, + * 2 = linear scaling), + * false otherwise + */ + int convertPValueToDDL(const Uint16 pvalue, + Uint16 &ddl, + const int bits); + + /** set automatically calculated minimum/maximum window. + * possibly active VOI LUT is implicitly disabled. + * + ** @param idx ignore global min/max values if false (0) + * + ** @return true if successful (1 = window has changed, + * 2 = new window is the same as previous one), + * false otherwise + */ + int setMinMaxWindow(const int idx = 1); + + /** set automatically calculated VOI window for the specified Region of Interest (ROI). + * The ROI is specified by means of a rectangle (left_pos, top_pos, width, height). + * Possibly active VOI LUT is implicitly disabled. + * + ** @param left_pos x-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param top_pos y-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param width width in pixels of the rectangular ROI (minimum: 1) + * @param height height in pixels of the rectangular ROI (minimum: 1) + * @param frame index of the frame to be used for the calculation + * + ** @return true if successful (1 = window has changed, + * 2 = new window is the same as previous one), + * false otherwise + */ + int setRoiWindow(const unsigned long left_pos, + const unsigned long top_pos, + const unsigned long width, + const unsigned long height, + const unsigned long frame); + + /** set automatically calculated histogram window. + * possibly active VOI LUT is implicitly disabled. + * + ** @param thresh threshold value specifying percentage of histogram border which shall be ignored + * + ** @return true if successful, false otherwise + */ + int setHistogramWindow(const double thresh); + + /** set specified window (given by index to window width/center sequence stored in image file). + * possibly active VOI LUT is implicitly disabled. + * + ** @param pos index to window width/center sequence + * + ** @return true if successful, false otherwise + */ + int setWindow(const unsigned long pos = 0); + + /** set specified window (given by window width and center). + * possibly active VOI LUT is implicitly disabled. + * + ** @param center center of specified window + * @param width width of specified window + * @param explanation window explanation (optional) + * + ** @return true if successful (1 = window has changed, + * 2 = new window is the same as previous one), + * false otherwise + */ + int setWindow(const double center, + const double width, + const char *explanation = NULL); + + /** get current window center and width values + * + ** @param center return current window center value + * @param width return current window width value + * + ** @return true if successful, false otherwise + */ + int getWindow(double ¢er, + double &width); + + /** get number of VOI windows (stored in image file) + * + ** @return number of VOI windows + */ + inline unsigned long getWindowCount() const + { + return WindowCount; + } + + /** get VOI LUT function. + * possible values are: EFV_Default, EFV_Linear, EFV_Sigmoid. + * + ** @return currently active VOI LUT function + */ + EF_VoiLutFunction getVoiLutFunction() const; + + /** set VOI LUT function + * + ** @param function type of VOI LUT function (default, linear or sigmoid). + * 'default' basically means the same as 'linear'. + * + ** @return true if successful (1 = function has changed, + * 2 = function has not changed) + * false otherwise + */ + int setVoiLutFunction(const EF_VoiLutFunction function); + + /** set VOI LUT (given by dcmdata elements). + * possibly active window/center is implicitly disabled. + * + ** @param data contains LUT data + * @param descriptor describes LUT structure + * @param explanation free form description of VOI LUT (optional) + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise + */ + int setVoiLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation, + const EL_BitsPerTableEntry descripMode = ELM_UseValue); + + /** set VOI LUT (given by index to VOI LUT sequence stored in image file). + * possibly active window/center is implicitly disabled. + * + ** @param pos index to VOI LUT sequence + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise + */ + int setVoiLut(const unsigned long pos, + const EL_BitsPerTableEntry descripMode = ELM_UseValue); + + /** get number of VOI LUTs (stored in image file) + * + ** @return number of VOI LUTs + */ + inline unsigned long getVoiLutCount() const + { + return VoiLutCount; + } + + /** get description of active VOI transformation + * + ** @return pointer to description text (NULL if absent) + */ + inline const char *getVoiTransformationExplanation() const + { + return VoiExplanation.c_str(); + } + + /** get description of specified VOI window (stored in the image file) + * + ** @param pos index of the stored VOI window (0..n-1) + * @param explanation variable in which the result text is stored + * + ** @return pointer to description text (NULL if absent or index invalid) + */ + const char *getVoiWindowExplanation(const unsigned long pos, + OFString &explanation) const; + + /** get description of specified VOI LUT (stored in the image file) + * + ** @param pos index of the stored VOI LUT (0..n-1) + * @param explanation variable in which the result text is stored + * + ** @return pointer to description text (NULL if absent or index invalid) + */ + const char *getVoiLutExplanation(const unsigned long pos, + OFString &explanation) const; + + /** get description of performed modality LUT transformation + * + ** @return pointer to description text (NULL if absent) + */ + inline const char *getModalityLutExplanation() const + { + return (InterData != NULL) ? InterData->getModalityLutExplanation() : OFstatic_cast(const char *, NULL); + } + + /** set hardcopy parameters. (used to display LinOD images) + * + ** @param min minimum density of the print-out (in hundreds of Optical Density, e.g. 150 means 1.5 OD) + * @param max maximum density of the print-out (ditto) + * @param reflect reflected ambient light (in candela per square meter - cd/m^2) + * @param illumin illumination (ditto) + * + ** @return true if successful (1 = at least one of the parameters has changed, + * 2 = no parameter has changed) + * false otherwise + */ + int setHardcopyParameters(const unsigned int min, + const unsigned int max, + const unsigned int reflect, + const unsigned int illumin); + + /** get shape for presentation transformation. + * possible values are: ESP_Default, ESP_Identity, ESP_Inverse, ESP_LinOD + * If a presentation LUT is currently active ESP_Default is always returned. + * + ** @return currently active presentation LUT shape + */ + ES_PresentationLut getPresentationLutShape() const; + + /** set shape for presentation transformation. + * possibly active presentation LUT is implicitly disabled. + * + ** @param shape presentation LUT shape (default, identity or inverse). + * 'default' means that the output data is always created with 0 for black + * and maxvalue for white (i.e. monochrome2 data is created for output). + * + ** @return true if successful (1 = shape has changed, + * 2 = shape has not changed) + * false otherwise + */ + int setPresentationLutShape(const ES_PresentationLut shape); + + /** set LUT for presentation transformation. + * possibly active presentation LUT is implicitly disabled. + * + ** @param data contains LUT data + * @param descriptor describes LUT structure + * @param explanation free form description of presentation LUT (optional) + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise + */ + int setPresentationLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation = NULL, + const EL_BitsPerTableEntry descripMode = ELM_UseValue); + + /** set inverse LUT for presentation transformation. + * this LUT transform is e.g. used for DICOM print (12->8, 8->12 bit) + * possibly active presentation LUT will not be considered ! + * + ** @param data contains LUT data + * @param descriptor describes LUT structure + * @param descripMode mode specifying the use of the bits per table entry value + * + ** @return true if successful, false otherwise + */ + int setInversePresentationLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const EL_BitsPerTableEntry descripMode = ELM_UseValue); + + /** get description of active presentation LUT + * + ** @return pointer to description text (NULL if absent) + */ + inline const char *getPresentationLutExplanation() const + { + return (PresLutData != NULL) ? PresLutData->getExplanation() : OFstatic_cast(const char *, NULL); + } + + /** add specified plane to group of additional overlay planes. + * replaces old overlay plane if group number already exists. + * + ** @param group group number (0x60nn) of overlay plane + * @param left_pos x coordinate of plane orgin (referring to image origin) + * @param top_pos y coordinate of plane origin + * @param columns width of overlay plane (in pixels) + * @param rows height of overlay plane (in pixels) + * @param data overlay plane data (dcmdata element) + * @param label overlay plane label + * @param description overlay plane description + * @param mode display mode (see 'diutils.h') + * + ** @return false (0) if an error occurred, true otherwise (1 = added new plane, + * 2 = replaced existing plane) + */ + int addOverlay(const unsigned int group, + const signed int left_pos, + const signed int top_pos, + const unsigned int columns, + const unsigned int rows, + const DcmOverlayData &data, + const DcmLongString &label, + const DcmLongString &description, + const EM_Overlay mode); + + /** remove all additional overlay planes + * + ** @return false (0) if an error occurred, true otherwise + */ + int removeAllOverlays(); + + /** get pointer to specified overlay managing object + * + ** @param idx index of overlay group (0 = dataset, 1 = additional) + * + ** @return pointer to overlay managing object (NULL if absent or invalid) + */ + inline DiOverlay *getOverlayPtr(const unsigned int idx) + { + return (idx < 2) ? Overlays[idx] : OFstatic_cast(DiOverlay *, NULL); + } + + /** get pointer to current monochrome image (this) + * + ** @return pointer to this object + */ + inline DiMonoImage *getMonoImagePtr() + { + return this; + } + + /** flip current image (horizontally and/or vertically) + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * + ** @return true if successful (1 = flipped at least direction, + * 2 = not flipped, because of image resolution - width and/or height equal to 1), + * false otherwise + */ + int flip(const int horz, + const int vert); + + /** rotate current image (by steps of 90 degrees) + * + ** @param degree angle by which the image shall be rotated (-360, -270, -180, -90, 0, 90, 180, 270, 360) + * + ** @return true if successful (1 = rotated by at least 90 degrees, + * 2 = not rotated, because of image resolution or angle), + * false otherwise + */ + int rotate(const int degree); + + /** get number of bits per sample. + * If the optional parameter is specified the value will be checked and in any case + * a valid value will be returned. + * + ** @param bits value to be returned (if less than 1 or greater than the maximum (32) + * the default value will be used which is equal to the bits per sample + * value stored in the DICOM dataset) + * + ** @return status, true if successful, false otherwise + */ + virtual int getBits(const int bits = 0) const + { + return (((bits < 1) || (bits > MAX_BITS)) && (bits != MI_PastelColor)) ? BitsPerSample : bits; + } + + /** get number of bytes required for the rendered output of a single frame + * + * @param bits number of bits for the output pixel data (depth) + * + ** @return number of bytes if successful, 0 otherwise + */ + virtual unsigned long getOutputDataSize(const int bits = 0) const; + + /** get pixel data with specified format. + * (memory is handled internally) + * + ** @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flag, only useful for multi-planar images (color) + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + virtual const void *getOutputData(const unsigned long frame, + const int bits, + const int planar = 0) = 0; + + /** get pixel data with specified format. + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param size size of the memory buffer in bytes (will be checked) + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flag, only useful for multi-planar images (color) + * + ** @return status, true if successful, false otherwise + */ + virtual int getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar = 0) = 0; + + /** get pixel data of specified plane. + * (memory is handled internally) + * + ** @param dummy (not used) + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + const void *getOutputPlane(const int dummy) const; + + /** delete internally handled output memory buffer + * Save memory if data is no longer needed. + */ + void deleteOutputData(); + + /** create bitmap for specified overlay plane. + * (up to 16 bits per pixel with two values: fore and back) + * + ** @param frame index of frame used for output + * @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param left_pos returns x coordinate of plane's origin + * @param top_pos returns y coordinate of plane's origin + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param mode return display mode (see 'diutils.h') + * @param idx index of overlay group (0 = dataset, 1 = additional, 2 = '1' plane hides '0' plane) + * @param bits number of bits (stored) in the resulting array, default: 8 + * @param fore foreground color to be set in bitmap, default: 255 + * @param back background color to be set in bitmap (transparent), default: 0 + * + ** @return pointer to overlay plane data (internal memory buffer) + */ + const void *getOverlayData(const unsigned long frame, + const unsigned int plane, + unsigned int &left_pos, + unsigned int &top_pos, + unsigned int &width, + unsigned int &height, + EM_Overlay &mode, + const unsigned int idx, + const int bits = 8, + const Uint16 fore = 0xff, + const Uint16 back = 0x0); + + /** create bitmap for specified overlay plane. + * (up to 16 bits per pixel with two values: fore and back) + * + ** @param frame index of frame used for output + * @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param idx index of overlay group (0 = dataset, 1 = additional, 2 = '1' plane hides '0' plane) + * @param bits number of bits (stored) in the resulting array, default: 8 + * @param fore foreground color to be set in bitmap, default: 255 + * @param back background color to be set in bitmap (transparent), default: 0 + * + ** @return pointer to overlay plane data (internal memory buffer) + */ + const void *getFullOverlayData(const unsigned long frame, + const unsigned int plane, + unsigned int &width, + unsigned int &height, + const unsigned int idx, + const int bits = 8, + const Uint16 fore = 0xff, + const Uint16 back = 0x0); + + /** delete buffer for overlay plane data. + * Save memory if data is no longer needed. + */ + void deleteOverlayData(); + + /** create bitmap for specified overlay plane and store it in (6xxx,3000) format. + * (1 bit allocated and stored, foreground color is 1, background color is 0, + * data is 16 bit padded - even length) + * memory is not handled internally - must be deleted from calling program. + * + ** @param buffer stores pointer to overlay data (memory is allocated internally) + * @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param frames returns number of frames (multiple overlay frames possible!) + * @param idx index of overlay group (0 = dataset, planes stored in the image dataset; + * 1 = additional, planes added by addOverlay()), + * default: 0 + * + ** @return number of bytes allocated for the 'buffer' if successful, 0 otherwise + */ + unsigned long create6xxx3000OverlayData(Uint8 *&buffer, + const unsigned int plane, + unsigned int &width, + unsigned int &height, + unsigned long &frames, + const unsigned int idx = 0); + + /** get pointer to intermediate pixel data representation + * + ** @return pointer to intermediate pixel data + */ + const DiPixel *getInterData() const + { + return InterData; + } + + /** get pointer to intermediate pixel data representation + * + ** @return pointer to intermediate pixel data + */ + const DiMonoPixel *getMonoInterData() const + { + return InterData; + } + + /** create true color (24/32 bit) or palette (8 bit) bitmap for MS Windows. + * memory is not handled internally - must be deleted from calling program. + * + ** @param data untyped pointer memory buffer (set to NULL if not allocated externally) + * @param size size of the memory buffer in bytes (if 0 'data' is set to NULL) + * @param frame index of frame to be converted (starting from 0) + * @param bits number of bits per pixel used for the output bitmap (8, 24 or 32) + * @param upsideDown specifies the order of lines in the images (0 = top-down, bottom-up otherwise) + * @param padding align each line to a 32-bit address if true (default) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createDIB(void *&data, + const unsigned long size, + const unsigned long frame, + const int bits, + const int upsideDown, + const int padding = 1); + + /** create true color (32 bit) or palette (8 bit) bitmap for Java (AWT default format). + * Memory is not handled internally - must be deleted from calling program. + * + ** @param data resulting pointer to bitmap data (set to NULL if an error occurred) + * @param frame index of frame to be converted (starting from 0) + * @param bits number of bits per pixel used for the output bitmap (8 or 32) + * + ** @return number of bytes allocated by the bitmap, or 0 if an error occurred + */ + unsigned long createAWTBitmap(void *&data, + const unsigned long frame, + const int bits); + + /** create packed bitmap (e.g. 12/16 bit -> 12/12 bit for DICOM printers). + * Memory is not handled internally - must be deleted from calling program. + * + ** @param buffer pointer to input memory buffer + * @param size size of memory buffer (will be checked whether it is sufficient) + * @param count number of entries (pixels) in input buffer + * @param alloc number of bits allocated for the pixels stored in the buffer (e.g. 16) + * @param stored number of bits stored for the pixels stored in the buffer (e.g. 12) + * + ** @return pointer to memory buffer containing the packed output bitmap data (NULL if an error occurred) + */ + static void *createPackedBitmap(const void *buffer, + const unsigned long size, + const unsigned long count, + const int alloc, + const int stored); + + /** create new single frame DiImage with applied grayscale transformations. + * The method getOutputData() is used internally for the new bitmap. + * + ** @param frame index of frame to be converted + * @param bits number of bits per pixel used for the output bitmap + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiImage *createOutputImage(const unsigned long frame, + const int bits); + + /** write current image and related attributes to DICOM dataset. + * + ** @param dataset reference to DICOM dataset where the image attributes are stored + * @param mode 0 = determine value of BitsStored from 'used' pixel values, + * 1 = determine value of BitsStored from 'possible' pixel values + * @param planar dummy parameter (only used for color images) + * + ** @return true if successful, false otherwise + */ + int writeImageToDataset(DcmItem &dataset, + const int mode, + const int planar); + + /** write pixel data to PPM file. + * pixel data is written in ASCII format. + * + ** @param stream open C++ output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + int writePPM(STD_NAMESPACE ostream& stream, + const unsigned long frame, + const int bits); + + /** write pixel data to PPM file. + * pixel data is written in ASCII format. + * + ** @param stream open C output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + int writePPM(FILE *stream, + const unsigned long frame, + const int bits); + + /** write pixel data to raw PPM file + * + ** @param stream open C output stream + * @param frame index of frame used for output + * @param bits number of bits used for output of pixel data + * + ** @return true if successful, false otherwise + */ + int writeRawPPM(FILE *stream, + const unsigned long frame, + const int bits); + + /** write pixel data to BMP file + * + ** @param stream open C output stream + * @param frame index of frame used for output (default: first frame = 0) + * @param bits number of bits used for output of pixel data (8, 24 or 32, default (0) = 8) + * + ** @return true if successful, false otherwise + */ + int writeBMP(FILE *stream, + const unsigned long frame, + const int bits); + + + protected: + + /** constructor + * + ** @param image pointer to dataset (encapsulated) + * @param status current image status + * @param dummy (necessary to be different from another constructor) + */ + DiMonoImage(const DiDocument *image, + const EI_Status status, + const char dummy); + + /** constructor, copy + * + ** @param image pointer to reference image + * @param fstart first frame to be processed + * @param fcount number of frames + */ + DiMonoImage(const DiMonoImage *image, + const unsigned long fstart, + const unsigned long fcount); + + /** constructor, convert color images to monochrome + * + ** @param image pointer to reference image + * @param red coefficient by which the red component is weighted + * @param green coefficient by which the green component is weighted + * @param blue coefficient by which the blue component is weighted + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + DiMonoImage(const DiColorImage *image, + const double red, + const double green, + const double blue); + + /** constructor, scale/clip + * + ** @param image pointer to reference image + * @param left_pos x coordinate of top left corner of area to be scaled + * (referring to image origin, negative values create a border around the image) + * @param top_pos y coordinate of top left corner of area to be scaled + * @param src_cols width of area to be scaled + * @param src_rows height of area to be scaled + * @param dest_cols width of scaled image (in pixels) + * @param dest_rows height of scaled image (in pixels) + * @param interpolate specifies whether scaling algorithm should use interpolation (if necessary). + * default: no interpolation (0), preferred interpolation algorithm (if applicable): + * 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, + * 4 = bicubic magnification + * @param aspect specifies whether pixel aspect ratio should be taken into consideration + * (if true, width OR height should be 0, i.e. this component will be calculated + * automatically) + * @param pvalue P-value used for the border outside the image (0..65535) + */ + DiMonoImage(const DiMonoImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate, + const int aspect, + const Uint16 pvalue); + + /** constructor, flip + * + ** @param image pointer to reference image + ** @param horz flip horizontally if true + * @param vert flip vertically if true + */ + DiMonoImage(const DiMonoImage *image, + const int horz, + const int vert); + + /** constructor, rotate + * + ** @param image pointer to reference image + * @param degree angle by which the image shall be rotated + */ + DiMonoImage(const DiMonoImage *image, + const int degree); + + /** constructor, createMonoOutput + * + ** @param image pointer to reference image + * @param pixel pointer to output pixel data used for the new image + * @param frame number of frame stored in the new image object + * @param stored number of bits stored + * @param alloc number of bits allocated + */ + DiMonoImage(const DiMonoImage *image, + DiMonoOutputPixel *pixel, + const unsigned long frame, + const int stored, + const int alloc); + + /** initialize internal data structures and member variables + * + ** @param modality pointer to object handling the modality transform + * @param reuse reuse particular information determined in a previous call + */ + void Init(DiMonoModality *modality, + const OFBool reuse = OFFalse); + + /** initialize internal data structures (for Uint8) + * + ** @param modality pointer to object handling the modality transform + */ + void InitUint8(DiMonoModality *modality); + + /** initialize internal data structures (for Sint8) + * + ** @param modality pointer to object handling the modality transform + */ + void InitSint8(DiMonoModality *modality); + + /** initialize internal data structures (for Uint16) + * + ** @param modality pointer to object handling the modality transform + */ + void InitUint16(DiMonoModality *modality); + + /** initialize internal data structures (for Sint16) + * + ** @param modality pointer to object handling the modality transform + */ + void InitSint16(DiMonoModality *modality); + + /** initialize internal data structures (for Uint32) + * + ** @param modality pointer to object handling the modality transform + */ + void InitUint32(DiMonoModality *modality); + + /** initialize internal data structures (for Sint32) + * + ** @param modality pointer to object handling the modality transform + */ + void InitSint32(DiMonoModality *modality); + + /** check intermediate pixel representation for consistency + * + ** @param mode check number of pixels stored in the dataset if true + * + ** @return status, true if successful, false otherwise + */ + int checkInterData(const int mode = 1); + + /** update Image Pixel Module attributes in the given dataset. + * Removes possibly existing embedded overlay planes and replaces any + * present modality transformation by a linear rescale/slope. + * Used in writeXXXToDataset() routines. + * + ** @param dataset reference to DICOM image dataset + */ + virtual void updateImagePixelModuleAttributes(DcmItem &dataset); + + /** get pixel data with specified format. + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param size size of the memory buffer in bytes (will be checked) + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param planar flag, only useful for multi-planar images (color) + * @param negative invert pixel data if true + * + ** @return untyped pointer to the pixel data if successful, NULL otherwise + */ + const void *getData(void *buffer, + const unsigned long size, + const unsigned long frame, + int bits, + const int planar, + const int negative); + + /** get pixel data with specified format for Uint8 input (helper function). + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param disp pointer to current display function object + * @param samples number of samples per pixel + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param low output pixel value to which 0 is mapped (min) + * @param high output pixel value to which 2^bits-1 is mapped (max) + */ + void getDataUint8(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high); + + /** get pixel data with specified format for Sint8 input (helper function). + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param disp pointer to current display function object + * @param samples number of samples per pixel + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param low output pixel value to which 0 is mapped (min) + * @param high output pixel value to which 2^bits-1 is mapped (max) + */ + void getDataSint8(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high); + + /** get pixel data with specified format for Uint16 input (helper function). + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param disp pointer to current display function object + * @param samples number of samples per pixel + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param low output pixel value to which 0 is mapped (min) + * @param high output pixel value to which 2^bits-1 is mapped (max) + */ + void getDataUint16(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high); + + /** get pixel data with specified format for Sint16 input (helper function). + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param disp pointer to current display function object + * @param samples number of samples per pixel + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param low output pixel value to which 0 is mapped (min) + * @param high output pixel value to which 2^bits-1 is mapped (max) + */ + void getDataSint16(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high); + + /** get pixel data with specified format for Uint32 input (helper function). + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param disp pointer to current display function object + * @param samples number of samples per pixel + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param low output pixel value to which 0 is mapped (min) + * @param high output pixel value to which 2^bits-1 is mapped (max) + */ + void getDataUint32(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high); + + /** get pixel data with specified format for Sint32 input (helper function). + * (memory is handled externally) + * + ** @param buffer untyped pointer to the externally allocated memory buffer + * @param disp pointer to current display function object + * @param samples number of samples per pixel + * @param frame number of frame to be rendered + * @param bits number of bits for the output pixel data (depth) + * @param low output pixel value to which 0 is mapped (min) + * @param high output pixel value to which 2^bits-1 is mapped (max) + */ + void getDataSint32(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high); + + /** create a presentation look-up table converting the pixel data which is linear to + * Optical Density to DDLs of the softcopy device (used to display print images on screen). + * + ** @param count number of LUT entries + * @param bits number of bits per entry + * + ** @return true if successful, false otherwise + */ + int createLinODPresentationLut(const unsigned long count, const int bits); + + /// center of current VOI-window + double WindowCenter; + /// width of current VOI-window + double WindowWidth; + /// number of stored VOI-windows + unsigned long WindowCount; + /// number of stored VOU-LUTs + unsigned long VoiLutCount; + + /// true, if current VOI-window is valid + int ValidWindow; + + /// free text explanation of current VOI transformation + OFString VoiExplanation; + /// VOI LUT function (linear or sigmoid) + EF_VoiLutFunction VoiLutFunction; + /// presentation LUT shape (identity, inverse or lin od) + ES_PresentationLut PresLutShape; + + /// minimum density of a print-out (in hundreds of Optical Density) + unsigned int MinDensity; + /// maximum density of a print-out (ditto) + unsigned int MaxDensity; + /// reflected ambient light (in candela per square meter) + unsigned int Reflection; + /// illumination (ditto) + unsigned int Illumination; + + /// points to associated overlay-objects ([0] = built-in, [1] = additional) + DiOverlay *Overlays[2]; + /// points to associated VOI-LUT-object + DiLookupTable *VoiLutData; + /// points to associated presentation-LUT-object + DiLookupTable *PresLutData; + /// points to intermediate pixel data representation (object) + DiMonoPixel *InterData; + + /// points to grayscale standard display function (only referenced!) + DiDisplayFunction *DisplayFunction; + + + private: + + /// points to current output data (object) + DiMonoOutputPixel *OutputData; + /// points to current overlay plane data (pixel array) + void *OverlayData; + + // --- declarations to avoid compiler warnings + + DiMonoImage(const DiMonoImage &); + DiMonoImage &operator=(const DiMonoImage &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h b/dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h new file mode 100644 index 00000000..9eca0fd5 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h @@ -0,0 +1,270 @@ +/* + * + * Copyright (C) 1996-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeInputPixelTemplate (Header) + * + */ + + +#ifndef DIMOIPXT_H +#define DIMOIPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dimopxt.h" +#include "dcmtk/dcmimgle/diinpx.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to convert monochrome pixel data to intermediate representation + */ +template +class DiMonoInputPixelTemplate + : public DiMonoPixelTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to input pixel representation + * @param modality pointer to modality transform object + */ + DiMonoInputPixelTemplate(DiInputPixel *pixel, + DiMonoModality *modality) + : DiMonoPixelTemplate(pixel, modality) + { + if ((pixel != NULL) && (this->Count > 0)) + { + // check whether to apply any modality transform + if ((this->Modality != NULL) && this->Modality->hasLookupTable() && (bitsof(T1) <= MAX_TABLE_ENTRY_SIZE)) + { + modlut(pixel); + // ignore modality LUT min/max values since the image does not necessarily have to use all LUT entries + this->determineMinMax(); + } + else if ((this->Modality != NULL) && this->Modality->hasRescaling()) + { + rescale(pixel, this->Modality->getRescaleSlope(), this->Modality->getRescaleIntercept()); + this->determineMinMax(OFstatic_cast(T3, this->Modality->getMinValue()), OFstatic_cast(T3, this->Modality->getMaxValue())); + } else { + rescale(pixel); // "copy" or reference pixel data + this->determineMinMax(OFstatic_cast(T3, this->Modality->getMinValue()), OFstatic_cast(T3, this->Modality->getMaxValue())); + } + /* erase empty part of the buffer (= blacken the background) */ + if ((this->Data != NULL) && (this->InputCount < this->Count)) + OFBitmanipTemplate::zeroMem(this->Data + this->InputCount, this->Count - this->InputCount); + } + } + + /** destructor + */ + virtual ~DiMonoInputPixelTemplate() + { + } + + + private: + + /** initialize optimization LUT + * + ** @param lut reference to storage area for lookup table + * @param ocnt number of LUT entries (will be check as optimization criteria) + * + ** @return status, true if successful (LUT has been created), false otherwise + */ + inline int initOptimizationLUT(T3 *&lut, + const unsigned long ocnt) + { + int result = 0; + if ((sizeof(T1) <= 2) && (this->InputCount > 3 * ocnt)) // optimization criteria + { // use LUT for optimization + lut = new T3[ocnt]; + if (lut != NULL) + { + DCMIMGLE_DEBUG("using optimized routine with additional LUT"); + result = 1; + } + } + return result; + } + + /** perform modality LUT transform + * + ** @param input pointer to input pixel representation + */ + void modlut(DiInputPixel *input) + { + const T1 *pixel = OFstatic_cast(const T1 *, input->getData()); + if ((pixel != NULL) && (this->Modality != NULL)) + { + const DiLookupTable *mlut = this->Modality->getTableData(); + if (mlut != NULL) + { + const int useInputBuffer = (sizeof(T1) == sizeof(T3)) && (this->Count <= input->getCount()); + if (useInputBuffer) // do not copy pixel data, reference them! + { + DCMIMGLE_DEBUG("re-using input buffer, do not copy pixel data"); + this->Data = OFstatic_cast(T3 *, input->getDataPtr()); + input->removeDataReference(); // avoid double deletion + } else + this->Data = new T3[this->Count]; + if (this->Data != NULL) + { + DCMIMGLE_DEBUG("applying modality transformation with LUT (" << mlut->getCount() << " entries)"); + T2 value = 0; + const T2 firstentry = mlut->getFirstEntry(value); // choose signed/unsigned method + const T2 lastentry = mlut->getLastEntry(value); + const T3 firstvalue = OFstatic_cast(T3, mlut->getFirstValue()); + const T3 lastvalue = OFstatic_cast(T3, mlut->getLastValue()); + const T1 *p = pixel + input->getPixelStart(); + T3 *q = this->Data; + unsigned long i; + T3 *lut = NULL; + const unsigned long ocnt = OFstatic_cast(unsigned long, input->getAbsMaxRange()); // number of LUT entries + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + const T2 absmin = OFstatic_cast(T2, input->getAbsMinimum()); + q = lut; + for (i = 0; i < ocnt; ++i) // calculating LUT entries + { + value = OFstatic_cast(T2, i) + absmin; + if (value <= firstentry) + *(q++) = firstvalue; + else if (value >= lastentry) + *(q++) = lastvalue; + else + *(q++) = OFstatic_cast(T3, mlut->getValue(value)); + } + const T3 *lut0 = lut - OFstatic_cast(T2, absmin); // points to 'zero' entry + q = this->Data; + for (i = this->InputCount; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + for (i = this->InputCount; i != 0; --i) + { + value = OFstatic_cast(T2, *(p++)); + if (value <= firstentry) + *(q++) = firstvalue; + else if (value >= lastentry) + *(q++) = lastvalue; + else + *(q++) = OFstatic_cast(T3, mlut->getValue(value)); + } + } + delete[] lut; + } + } + } + } + + /** perform rescale slope/intercept transform + * + ** @param input pointer to input pixel representation + * @param slope rescale slope value (optional) + * @param intercept rescale intercept value (optional) + */ + void rescale(DiInputPixel *input, + const double slope = 1.0, + const double intercept = 0.0) + { + const T1 *pixel = OFstatic_cast(const T1 *, input->getData()); + if (pixel != NULL) + { + const int useInputBuffer = (sizeof(T1) == sizeof(T3)) && (this->Count <= input->getCount()) && (input->getPixelStart() == 0); + if (useInputBuffer) + { // do not copy pixel data, reference them! + DCMIMGLE_DEBUG("re-using input buffer, do not copy pixel data"); + this->Data = OFstatic_cast(T3 *, input->getDataPtr()); + input->removeDataReference(); // avoid double deletion + } else + this->Data = new T3[this->Count]; + if (this->Data != NULL) + { + T3 *q = this->Data; + unsigned long i; + if ((slope == 1.0) && (intercept == 0.0)) + { + if (!useInputBuffer) + { + DCMIMGLE_DEBUG("copying pixel data from input buffer"); + const T1 *p = pixel + input->getPixelStart(); + for (i = this->InputCount; i != 0; --i) // copy pixel data: can't use copyMem because T1 isn't always equal to T3 + *(q++) = OFstatic_cast(T3, *(p++)); + } + } else { + DCMIMGLE_DEBUG("applying modality transformation with rescale slope = " << slope << ", intercept = " << intercept); + T3 *lut = NULL; + const T1 *p = pixel + input->getPixelStart(); + const unsigned long ocnt = OFstatic_cast(unsigned long, input->getAbsMaxRange()); // number of LUT entries + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + const double absmin = input->getAbsMinimum(); + q = lut; + if (slope == 1.0) + { + for (i = 0; i < ocnt; ++i) // calculating LUT entries + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, i) + absmin + intercept); + } else { + if (intercept == 0.0) + { + for (i = 0; i < ocnt; ++i) + *(q++) = OFstatic_cast(T3, (OFstatic_cast(double, i) + absmin) * slope); + } else { + for (i = 0; i < ocnt; ++i) + *(q++) = OFstatic_cast(T3, (OFstatic_cast(double, i) + absmin) * slope + intercept); + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, absmin); // points to 'zero' entry + q = this->Data; + for (i = this->InputCount; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (slope == 1.0) + { + for (i = this->InputCount; i != 0; --i) + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, *(p++)) + intercept); + } else { + if (intercept == 0.0) + { + for (i = this->InputCount; i != 0; --i) + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, *(p++)) * slope); + } else { + for (i = this->InputCount; i != 0; --i) + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, *(p++)) * slope + intercept); + } + } + } + delete[] lut; + } + } + } + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimomod.h b/dcmimgle/include/dcmtk/dcmimgle/dimomod.h new file mode 100644 index 00000000..4412d78a --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimomod.h @@ -0,0 +1,285 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeModality (Header) + * + */ + + +#ifndef DIMOMOD_H +#define DIMOMOD_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/diluptab.h" +#include "dcmtk/dcmimgle/diobjcou.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiDocument; +class DiInputPixel; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to handle modality specific transformations (incl. modality LUT) + */ +class DCMTK_DCMIMGLE_EXPORT DiMonoModality + : public DiObjectCounter +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param pixel pointer to input pixel data + */ + DiMonoModality(const DiDocument *docu, + DiInputPixel *pixel); + + /** constructor, rescale + * + ** @param docu pointer to dataset (encapsulated) + * @param pixel pointer to input pixel data + * @param slope rescale slope (<> 0) + * @param intercept rescale intercept + */ + DiMonoModality(const DiDocument *docu, + DiInputPixel *pixel, + const double slope, + const double intercept); + + /** constructor, LUT + * + ** @param docu pointer to dataset (encapsulated) + * @param pixel pointer to input pixel data + * @param data element containing the modality LUT data + * @param descriptor element containing the modality LUT descriptor + * @param explanation element containing the modality LUT explanation (optional) + */ + DiMonoModality(const DiDocument *docu, + DiInputPixel *pixel, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation); + + /** constructor, no modality transform + * + ** @param bits number of bits per pixel + */ + DiMonoModality(const int bits); + + /** destructor + */ + virtual ~DiMonoModality(); + + /** get integer representation + * + ** @return integer representation + */ + inline EP_Representation getRepresentation() const + { + return Representation; + } + + /** get minimum pixel value after modality transform + * + ** @return minimum pixel value + */ + inline double getMinValue() const + { + return MinValue; + } + + /** get maximum pixel value after modality transform + * + ** @return maximum pixel value + */ + inline double getMaxValue() const + { + return MaxValue; + } + + /** get number of bits describing the width of output data + * + ** @return number of bits (might be 0) + */ + inline unsigned int getBits() const + { + return Bits; + } + + /** get number of bits actually used to store the output data. + * (based on the range given by 'MinValue' and 'MaxValue') + * + ** @return number of used bits (might be 0) + */ + inline unsigned int getUsedBits() const + { + return UsedBits; + } + + /** get absolute (possible) minimum pixel value after modality transform + * + ** @return absolute minimum pixel value + */ + inline double getAbsMinimum() const + { + return AbsMinimum; + } + + /** get absolute (possible) maximum pixel value after modality transform + * + ** @return absolute maximum pixel value + */ + inline double getAbsMaximum() const + { + return AbsMaximum; + } + + /** get rescale intercept value + * + ** @return rescale intercept value + */ + inline double getRescaleIntercept() const + { + return RescaleIntercept; + } + + /** get rescale slope value + * + ** @return rescale slope value + */ + inline double getRescaleSlope() const + { + return RescaleSlope; + } + + /** get pointer to lookup table data + * + ** @return pointer to lookup table data or NULL if absent + */ + inline const DiLookupTable *getTableData() const + { + return TableData; + } + + /** get modality LUT explanation + * + ** @return modality LUT explanation or NULL if absent + */ + inline const char *getExplanation() const + { + return (TableData != NULL) ? TableData->getExplanation() : OFstatic_cast(const char *, NULL); + } + + /** check whether lookup table is present + * + ** @return true if lookup table is present, false otherwise + */ + inline int hasLookupTable() const + { + return LookupTable; + } + + /** check whether rescaling is present + * + ** @return true if rescaling is present, false otherwise + */ + inline int hasRescaling() const + { + return Rescaling; + } + + + protected: + + /** initialize internal data structures and values + * + ** @param docu pointer to dataset (encapsulated) + * @param pixel pointer to input pixel data + * + ** @return status, true if successful, false otherwise + */ + int Init(const DiDocument *docu, + DiInputPixel *pixel); + + /** check lookup table for validity (and possibly correct it) + */ + void checkTable(); + + /** check rescaling for validity (and possibly correct it) + * + ** @param pixel pointer to input pixel data + */ + void checkRescaling(const DiInputPixel *pixel); + + /** determine integer representation used for the output data + * + ** @param docu pointer to dataset (encapsulated) + */ + void determineRepresentation(const DiDocument *docu); + + + private: + + /// integer representation + EP_Representation Representation; + + /// minimum pixel value + double MinValue; + /// maximum pixel value + double MaxValue; + + /// number of bits + unsigned int Bits; + /// number of used bits + unsigned int UsedBits; + + /// absolute minimum pixel value + double AbsMinimum; + /// absolute maximum pixel value + double AbsMaximum; + + /// rescale intercept + double RescaleIntercept; + /// rescale slope + double RescaleSlope; + + /// status flag: lookup table present + int LookupTable; + /// status flag: rescaling present + int Rescaling; + + /// pointer to modality lookup table + DiLookupTable *TableData; + + // --- declarations to avoid compiler warnings + + DiMonoModality(const DiMonoModality &); + DiMonoModality &operator=(const DiMonoModality &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimoopx.h b/dcmimgle/include/dcmtk/dcmimgle/dimoopx.h new file mode 100644 index 00000000..99328299 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimoopx.h @@ -0,0 +1,157 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonoOutputPixel (Header) + * + */ + + +#ifndef DIMOOPX_H +#define DIMOOPX_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmimgle/diutils.h" + +#include "dcmtk/ofstd/ofstream.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiMonoPixel; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Abstract base class to create monochrome output data + */ +class DCMTK_DCMIMGLE_EXPORT DiMonoOutputPixel +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param size number of pixel per frame + * @param frame frame to be rendered + * @param max maximum output value + */ + DiMonoOutputPixel(const DiMonoPixel *pixel, + const unsigned long size, + const unsigned long frame, + const unsigned long max); + + /** destructor + */ + virtual ~DiMonoOutputPixel(); + + /** get integer representation (abstract) + * + ** @return integer representation + */ + virtual EP_Representation getRepresentation() const = 0; + + /** get pointer to output pixel data (abstract) + * + ** @return pointer to pixel data + */ + virtual const void *getData() const = 0; + + /** get pointer to output pixel data (abstract) + * + ** @return pointer to pixel data + */ + virtual void *getDataPtr() = 0; + + /** remove reference to (internally handled) pixel data (abstract) + */ + virtual void removeDataReference() = 0; + + /** get size of one pixel / item in the pixel array (abstract) + * + ** @return item size + */ + virtual size_t getItemSize() const = 0; + + /** write pixel data of selected frame to PPM/ASCII file (abstract) + * + ** @param stream open C++ output stream + * + ** @return status, true if successful, false otherwise + */ + virtual int writePPM(STD_NAMESPACE ostream& stream) const = 0; + + /** write pixel data of selected frame to PPM/ASCII file (abstract) + * + ** @param stream open C file stream + * + ** @return status, true if successful, false otherwise + */ + virtual int writePPM(FILE *stream) const = 0; + + /** get number of pixel per frame + * + ** @return number of pixel per frame + */ + inline unsigned long getCount() const + { + return FrameSize; + } + + /** check whether specified pixel value is used in the image. + * Pixel array is examined when this method is called for the first time + * (just-in-time creation / create on demand of the supporting table). + * + ** @param value pixel value to be checked + * + ** @return true if value is used, false otherwise + */ + int isUnused(const unsigned long value); + + + protected: + + /** examine which pixel values are actually used (abstract) + */ + virtual void determineUsedValues() = 0; + + + /// number of pixels per frame (intermediate representation) + /*const*/ unsigned long Count; + /// number of pixels per frame (memory buffer size) + const unsigned long FrameSize; + + /// array of used pixel values + Uint8 *UsedValues; + /// maximum output value + const unsigned long MaxValue; + + + private: + + // --- declarations to avoid compiler warnings + + DiMonoOutputPixel(const DiMonoOutputPixel &); + DiMonoOutputPixel &operator=(const DiMonoOutputPixel &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimoopxt.h b/dcmimgle/include/dcmtk/dcmimgle/dimoopxt.h new file mode 100644 index 00000000..e5d11b78 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimoopxt.h @@ -0,0 +1,1314 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonoOutputPixelTemplate (Header) + * + */ + + +#ifndef DIMOOPXT_H +#define DIMOOPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/ofstd/ofbmanip.h" + +#include "dcmtk/dcmimgle/dimoopx.h" +#include "dcmtk/dcmimgle/dimopx.h" +#include "dcmtk/dcmimgle/diluptab.h" +#include "dcmtk/dcmimgle/diovlay.h" +#include "dcmtk/dcmimgle/dipxrept.h" +#include "dcmtk/dcmimgle/didispfn.h" +#include "dcmtk/dcmimgle/didislut.h" + +#ifdef PASTEL_COLOR_OUTPUT +#include "dimcopxt.h" +#endif + +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to create monochrome output data + */ +template +class DiMonoOutputPixelTemplate + : public DiMonoOutputPixel, + public DiPixelRepresentationTemplate +{ + + public: + + /** constructor + * + ** @param buffer storage area for the output pixel data (optional, maybe NULL) + * @param pixel pointer to intermediate pixel representation + * @param overlays array of overlay management objects + * @param vlut VOI LUT (optional, maybe NULL) + * @param plut presentation LUT (optional, maybe NULL) + * @param disp display function (optional, maybe NULL) + * @param vfunc VOI LUT function (optional) + * @param center window center (optional, invalid if 'width' < 1) + * @param width window width (optional, invalid if < 1) + * @param low lowest pixel value for the output data (e.g. 0) + * @param high highest pixel value for the output data (e.g. 255) + * @param columns image's width (in pixels) + * @param rows image's height + * @param frame frame to be rendered + * (#)param frames total number of frames present in intermediate representation + * @param pastel flag indicating whether to use not only 'real' grayscale values (optional, experimental) + */ + DiMonoOutputPixelTemplate(void *buffer, + const DiMonoPixel *pixel, + DiOverlay *overlays[2], + const DiLookupTable *vlut, + const DiLookupTable *plut, + DiDisplayFunction *disp, + const EF_VoiLutFunction vfunc, + const double center, + const double width, + const Uint32 low, + const Uint32 high, + const Uint16 columns, + const Uint16 rows, + const unsigned long frame, +#ifdef PASTEL_COLOR_OUTPUT + const unsigned long frames, +#else + const unsigned long /*frames*/, +#endif + const int pastel = 0) + : DiMonoOutputPixel(pixel, OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows), frame, + OFstatic_cast(unsigned long, fabs(OFstatic_cast(double, high - low)))), + Data(NULL), + DeleteData(buffer == NULL), + ColorData(NULL) + { + if ((pixel != NULL) && (Count > 0) && (FrameSize >= Count)) + { + if (pastel) +#ifdef PASTEL_COLOR_OUTPUT + color(buffer, pixel, frame, frames); +#else + DCMIMGLE_ERROR("pastel color output not supported"); +#endif + else + { + DCMIMGLE_TRACE("monochrome output image - columns: " << columns << ", rows: " << rows << ", frame: " << frame); + DCMIMGLE_TRACE("monochrome output values - low: " << OFstatic_cast(unsigned long, low) << ", high: " + << OFstatic_cast(unsigned long, high) << ((low > high) ? " (inverted)" : "")); + Data = OFstatic_cast(T3 *, buffer); + if ((vlut != NULL) && (vlut->isValid())) // valid VOI LUT ? + voilut(pixel, frame * FrameSize, vlut, plut, disp, OFstatic_cast(T3, low), OFstatic_cast(T3, high)); + else + { + if (width < 1) // no valid window according to supplement 33 + nowindow(pixel, frame * FrameSize, plut, disp, OFstatic_cast(T3, low), OFstatic_cast(T3, high)); + else if (vfunc == EFV_Sigmoid) + sigmoid(pixel, frame * FrameSize, plut, disp, center, width, OFstatic_cast(T3, low), OFstatic_cast(T3, high)); + else // linear + window(pixel, frame * FrameSize, plut, disp, center, width, OFstatic_cast(T3, low), OFstatic_cast(T3, high)); + } + overlay(overlays, disp, columns, rows, frame); // add (visible) overlay planes to output bitmap + } + } + } + + /** destructor + */ + virtual ~DiMonoOutputPixelTemplate() + { + if (DeleteData) + delete[] Data; + delete ColorData; + } + + /** get integer representation of output data + * + ** @return integer representation + */ + inline EP_Representation getRepresentation() const + { + return DiPixelRepresentationTemplate::getRepresentation(); + } + + /** get size of one pixel / item in the pixel array + * + ** @return item size + */ + inline size_t getItemSize() const + { + return (ColorData != NULL) ? ColorData->getItemSize() : sizeof(T3); + } + + /** get pointer to output pixel data + * + ** @return pointer to pixel data + */ + inline const void *getData() const + { + return (ColorData != NULL) ? ColorData->getData() : OFstatic_cast(const void *, Data); + } + + /** get pointer to output pixel data + * + ** @return pointer to pixel data + */ + virtual void *getDataPtr() + { + return (ColorData != NULL) ? ColorData->getDataPtr() : OFstatic_cast(void *, Data); + } + + /** remove reference to (internally handled) pixel data (abstract) + */ + inline void removeDataReference() + { + Data = NULL; + DeleteData = 0; + } + + /** write pixel data of selected frame to PPM/ASCII file + * + ** @param stream open C++ output stream + * + ** @return status, true if successful, false otherwise + */ + inline int writePPM(STD_NAMESPACE ostream& stream) const + { + if (Data != NULL) + { + unsigned long i; + for (i = 0; i < FrameSize; ++i) + stream << OFstatic_cast(unsigned long, Data[i]) << " "; // typecast to resolve problems with 'char' + return 1; + } + if (ColorData != NULL) + return ColorData->writePPM(stream); + return 0; + } + + /** write pixel data of selected frame to PPM/ASCII file + * + ** @param stream open C file stream + * + ** @return status, true if successful, false otherwise + */ + inline int writePPM(FILE *stream) const + { + if (Data != NULL) + { + unsigned long i; + for (i = 0; i < FrameSize; ++i) + fprintf(stream, "%lu ", OFstatic_cast(unsigned long, Data[i])); + return 1; + } + if (ColorData != NULL) + return ColorData->writePPM(stream); + return 0; + } + + + protected: + + /** examine which pixel values are actually used + */ + inline void determineUsedValues() + { + if ((UsedValues == NULL) && (MaxValue > 0) && (MaxValue < MAX_TABLE_ENTRY_COUNT)) + { + UsedValues = new Uint8[MaxValue + 1]; + if (UsedValues != NULL) + { + OFBitmanipTemplate::zeroMem(UsedValues, MaxValue + 1); // initialize array + const T3 *p = Data; + Uint8 *q = UsedValues; + unsigned long i; + for (i = Count; i != 0; --i) + *(q + *(p++)) = 1; // mark used entries + } + } + } + + /** determine number of entries for the optimization LUT + * + ** @param count number of entries intended to be used for the optimization LUT + * (floating point value) + * + ** @return number of entries for the optimization LUT (unsigned integer value) + * or 0 if the size would exceed a certain limit (10,000,000 entries) + */ + inline unsigned long determineOptimizationCount(const double count) + { + return (count <= 10000000.0) ? OFstatic_cast(unsigned long, count) : 0 /* no LUT */; + } + + + private: + + /** create a display LUT with the specified number of input bits + * + ** @param dlut reference to storage area where the display LUT should be stored + * @param disp pointer to object describing the current display function + * @param bits number of bits defining the input width of the display LUT + */ + inline void createDisplayLUT(const DiDisplayLUT *&dlut, + DiDisplayFunction *disp, + const int bits) + { + if ((disp != NULL) && (disp->isValid())) + { // create Display LUT + dlut = disp->getLookupTable(bits); + if ((dlut != NULL) && (dlut->isValid())) // LUT is valid + { + DCMIMGLE_DEBUG("using display transformation"); + } else { + DCMIMGLE_WARN("can't create display LUT ... ignoring display transformation"); + dlut = NULL; + } + } + } + + /** initialize an optimization LUT if the optimization criteria is fulfilled + * + ** @param lut reference to storage area where the optimization LUT should be stored + * @param ocnt number of entries for the optimization LUT (0 = never create one) + * + ** @return status, true if successful, false otherwise + */ + inline int initOptimizationLUT(T3 *&lut, + const unsigned long ocnt) + { + int result = 0; + if ((sizeof(T1) <= 2) && (ocnt > 0) && (Count > 3 * ocnt)) // optimization criteria + { // use LUT for optimization + lut = new T3[ocnt]; + if (lut != NULL) + { + DCMIMGLE_DEBUG("using optimized routine with additional LUT (" << ocnt << " entries)"); + result = 1; + } + } + return result; + } + +#ifdef PASTEL_COLOR_OUTPUT + void color(void *buffer, // create true color pastel image + const DiMonoPixel *inter, + const unsigned long frame, + const unsigned long frames) + { + ColorData = new DiMonoColorOutputPixelTemplate(buffer, inter, frame, frames); + if (ColorData != NULL) + DCMIMGLE_DEBUG(">>> COLOR <<<"); + } +#endif + + /** apply the currently active VOI LUT to the output data + * + ** @param inter pointer to intermediate pixel representation + * @param start offset of the first pixel to be processed + * @param vlut VOI LUT + * @param plut presentation LUT (optional, maybe NULL) + * @param disp display function (optional, maybe NULL) + * @param low lowest pixel value for the output data (e.g. 0) + * @param high highest pixel value for the output data (e.g. 255) + */ + void voilut(const DiMonoPixel *inter, + const Uint32 start, + const DiLookupTable *vlut, + const DiLookupTable *plut, + DiDisplayFunction *disp, + const T3 low, + const T3 high) + { + const T1 *pixel = OFstatic_cast(const T1 *, inter->getData()); + if ((pixel != NULL) && (vlut != NULL)) + { + if (Data == NULL) + Data = new T3[FrameSize]; + if (Data != NULL) + { + DCMIMGLE_DEBUG("applying VOI transformation with LUT (" << vlut->getCount() << " entries)"); + const DiDisplayLUT *dlut = NULL; + const double minvalue = vlut->getMinValue(); + const double outrange = OFstatic_cast(double, high) - OFstatic_cast(double, low) + 1; + unsigned long i; + if (minvalue == vlut->getMaxValue()) // LUT has only one entry or all entries are equal + { + T3 value; + if ((plut != NULL) && (plut->isValid())) // has presentation LUT + { + DCMIMGLE_DEBUG("applying presentation LUT transformation"); + createDisplayLUT(dlut, disp, plut->getBits()); + const Uint32 value2 = OFstatic_cast(Uint32, (minvalue / OFstatic_cast(double, vlut->getAbsMaxRange())) * plut->getCount()); + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #1 - UNTESTED"); + if (low > high) // inverse + value = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, plut->getAbsMaxRange() - plut->getValue(value2) - 1))); + else // normal + value = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, plut->getValue(value2)))); + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #2"); + value = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value2)) * outrange / OFstatic_cast(double, plut->getAbsMaxRange())); + } + } else { // has no presentation LUT + createDisplayLUT(dlut, disp, vlut->getBits()); + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #3 - UNTESTED"); + if (low > high) // inverse + value = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, vlut->getAbsMaxRange() - minvalue - 1))); + else // normal + value = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, minvalue))); + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #4"); + value = OFstatic_cast(T3, OFstatic_cast(double, low) + (minvalue / OFstatic_cast(double, vlut->getAbsMaxRange())) * outrange); + } + } + OFBitmanipTemplate::setMem(Data, value, Count); // set output pixels to LUT value + } else { + T2 value = 0; + const T2 absmin = OFstatic_cast(T2, inter->getAbsMinimum()); + const T2 firstentry = vlut->getFirstEntry(value); // choose signed/unsigned method + const T2 lastentry = vlut->getLastEntry(value); + const unsigned long ocnt = determineOptimizationCount(inter->getAbsMaxRange()); // number of LUT entries + const T1 *p = pixel + start; + T3 *q = Data; + T3 *lut = NULL; + if ((plut != NULL) && (plut->isValid())) // has presentation LUT + { + DCMIMGLE_DEBUG("applying presentation LUT transformation"); + createDisplayLUT(dlut, disp, plut->getBits()); + Uint32 value2; // presentation LUT is always unsigned + const Uint32 pcnt = plut->getCount(); + const double gradient1 = OFstatic_cast(double, pcnt) / OFstatic_cast(double, vlut->getAbsMaxRange()); + const Uint32 firstvalue = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getFirstValue()) * gradient1); + const Uint32 lastvalue = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getLastValue()) * gradient1); + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #5"); + if (low > high) // inverse + { + const Uint16 maxvalue = OFstatic_cast(Uint16, plut->getAbsMaxRange() - 1); + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(T2, i) + absmin; + if (value <= firstentry) + value2 = firstvalue; + else if (value >= lastentry) + value2 = lastvalue; + else + value2 = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getValue(value)) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, maxvalue - plut->getValue(value2)))); + } + } else { // normal + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(T2, i) + absmin; + if (value <= firstentry) + value2 = firstvalue; + else if (value >= lastentry) + value2 = lastvalue; + else + value2 = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getValue(value)) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(plut->getValue(value2))); + } + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #6"); + const double gradient2 = outrange / OFstatic_cast(double, plut->getAbsMaxRange()); + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(T2, i) + absmin; + if (value <= firstentry) + value2 = firstvalue; + else if (value >= lastentry) + value2 = lastvalue; + else + value2 = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getValue(value)) * gradient1); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value2)) * gradient2); + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, inter->getAbsMinimum()); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #7"); + if (low > high) // inverse + { + const Uint16 maxvalue = OFstatic_cast(Uint16, vlut->getAbsMaxRange() - 1); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(T2, *(p++)); // pixel value + if (value <= firstentry) + value2 = firstvalue; + else if (value >= lastentry) + value2 = lastvalue; + else + value2 = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getValue(value)) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, maxvalue - plut->getValue(value2)))); + } + } else { // normal + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(T2, *(p++)); // pixel value + if (value <= firstentry) + value2 = firstvalue; + else if (value >= lastentry) + value2 = lastvalue; + else + value2 = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getValue(value)) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(plut->getValue(value2))); + } + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #8"); + const double gradient2 = outrange / OFstatic_cast(double, plut->getAbsMaxRange()); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(T2, *(p++)); // pixel value + if (value <= firstentry) + value2 = firstvalue; + else if (value >= lastentry) + value2 = lastvalue; + else + value2 = OFstatic_cast(Uint32, OFstatic_cast(double, vlut->getValue(value)) * gradient1); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value2)) * gradient2); + } + } + } + } else { // has no presentation LUT + createDisplayLUT(dlut, disp, vlut->getBits()); + const double gradient = outrange / OFstatic_cast(double, vlut->getAbsMaxRange()); + const T3 firstvalue = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, vlut->getFirstValue()) * gradient); + const T3 lastvalue = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, vlut->getLastValue()) * gradient); + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #9"); + if (low > high) // inverse + { + const Uint16 maxvalue = OFstatic_cast(Uint16, vlut->getAbsMaxRange() - 1); + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(T2, i) + absmin; + if (value < firstentry) + value = firstentry; + else if (value > lastentry) + value = lastentry; + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, maxvalue - vlut->getValue(value)))); + } + } else { // normal + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(T2, i) + absmin; + if (value < firstentry) + value = firstentry; + else if (value > lastentry) + value = lastentry; + *(q++) = OFstatic_cast(T3, dlut->getValue(vlut->getValue(value))); + } + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #10"); + for (i = 0; i < ocnt; ++i) // calculating LUT entries + { + value = OFstatic_cast(T2, i) + absmin; + if (value <= firstentry) + *(q++) = firstvalue; + else if (value >= lastentry) + *(q++) = lastvalue; + else + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, vlut->getValue(value)) * gradient); + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, inter->getAbsMinimum()); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #11"); + if (low > high) // inverse + { + const Uint16 maxvalue = OFstatic_cast(Uint16, vlut->getAbsMaxRange() - 1); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(T2, *(p++)); + if (value < firstentry) + value = firstentry; + else if (value > lastentry) + value = lastentry; + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, maxvalue - vlut->getValue(value)))); + } + } else { // normal + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(T2, *(p++)); + if (value < firstentry) + value = firstentry; + else if (value > lastentry) + value = lastentry; + *(q++) = OFstatic_cast(T3, dlut->getValue(vlut->getValue(value))); + } + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LUT #12"); + for (i = 0; i < Count; ++i) + { + value = OFstatic_cast(T2, *(p++)); + if (value <= firstentry) + *(q++) = firstvalue; + else if (value >= lastentry) + *(q++) = lastvalue; + else + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, vlut->getValue(value)) * gradient); + } + } + } + } + delete[] lut; + } + if (Count < FrameSize) + OFBitmanipTemplate::zeroMem(Data + Count, FrameSize - Count); // set remaining pixels of frame to zero + } + } else + Data = NULL; + } + + /** perform linear scaling to the output data (no windowing) + * + ** @param inter pointer to intermediate pixel representation + * @param start offset of the first pixel to be processed + * @param plut presentation LUT (optional, maybe NULL) + * @param disp display function (optional, maybe NULL) + * @param low lowest pixel value for the output data (e.g. 0) + * @param high highest pixel value for the output data (e.g. 255) + */ + void nowindow(const DiMonoPixel *inter, + const Uint32 start, + const DiLookupTable *plut, + DiDisplayFunction *disp, + const T3 low, + const T3 high) + { + const DiDisplayLUT *dlut = NULL; + const T1 *pixel = OFstatic_cast(const T1 *, inter->getData()); + if (pixel != NULL) + { + if (Data == NULL) // create new output buffer + Data = new T3[FrameSize]; + if (Data != NULL) + { + DCMIMGLE_DEBUG("applying no VOI transformation (linear scaling)"); + const double absmin = inter->getAbsMinimum(); + const double absmax = inter->getAbsMaximum(); + const double outrange = OFstatic_cast(double, high) - OFstatic_cast(double, low) + 1; // output range + const unsigned long ocnt = determineOptimizationCount(inter->getAbsMaxRange()); // number of LUT entries + DCMIMGLE_TRACE("intermediate pixel data - absmin: " << absmin << ", absmax: " << absmax); + const T1 *p = pixel + start; + T3 *q = Data; + unsigned long i; + T3 *lut = NULL; + if ((plut != NULL) && (plut->isValid())) // has presentation LUT + { + DCMIMGLE_DEBUG("applying presentation LUT transformation"); + createDisplayLUT(dlut, disp, plut->getBits()); + Uint32 value; // presentation LUT is always unsigned + const double gradient1 = OFstatic_cast(double, plut->getCount()) / inter->getAbsMaxRange(); + const double gradient2 = outrange / OFstatic_cast(double, plut->getAbsMaxRange()); + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #1"); + if (low > high) // inverse + { + const Uint16 maxvalue = OFstatic_cast(Uint16, plut->getAbsMaxRange() - 1); + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(Uint32, OFstatic_cast(double, i) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, maxvalue - plut->getValue(value)))); + } + } else { // normal + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(Uint32, OFstatic_cast(double, i) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(plut->getValue(value))); + } + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #2"); + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(Uint32, OFstatic_cast(double, i) * gradient1); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value)) * gradient2); + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, inter->getAbsMinimum()); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #3"); + if (low > high) // inverse + { + const Uint16 maxvalue = OFstatic_cast(Uint16, plut->getAbsMaxRange() - 1); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(Uint32, (OFstatic_cast(double, *(p++)) - absmin) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, maxvalue - plut->getValue(value)))); + } + } else { // normal + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(Uint32, (OFstatic_cast(double, *(p++)) - absmin) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(plut->getValue(value))); + } + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #4"); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(Uint32, (OFstatic_cast(double, *(p++)) - absmin) * gradient1); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value)) * gradient2); + } + } + } + } else { // has no presentation LUT + createDisplayLUT(dlut, disp, inter->getBits()); + const double gradient = outrange / (inter->getAbsMaxRange()); + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #5"); + if (low > high) // inverse + { + for (i = ocnt; i != 0; --i) // calculating LUT entries + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, i - 1))); + } else { // normal + for (i = 0; i < ocnt; ++i) // calculating LUT entries + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, i))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #6"); + for (i = 0; i < ocnt; ++i) // calculating LUT entries + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, i) * gradient); + } + const T3 *lut0 = lut - OFstatic_cast(T2, inter->getAbsMinimum()); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #7"); + if (low > high) // inverse + { + for (i = Count; i != 0; --i) + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, absmax - (OFstatic_cast(double, *(p++)) - absmin)))); + } else { // normal + for (i = Count; i != 0; --i) + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, OFstatic_cast(double, *(p++)) - absmin))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI NONE #8"); + for (i = Count; i != 0; --i) + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + (OFstatic_cast(double, *(p++)) - absmin) * gradient); + } + } + } + delete[] lut; + if (Count < FrameSize) + OFBitmanipTemplate::zeroMem(Data + Count, FrameSize - Count); // set remaining pixels of frame to zero + } + } else + Data = NULL; + } + + /** apply the currently active sigmoid VOI window to the output data + * + ** @param inter pointer to intermediate pixel representation + * @param start offset of the first pixel to be processed + * @param plut presentation LUT (optional, maybe NULL) + * @param disp display function (optional, maybe NULL) + * @param center window center + * @param width window width (>= 1) + * @param low lowest pixel value for the output data (e.g. 0) + * @param high highest pixel value for the output data (e.g. 255) + */ + void sigmoid(const DiMonoPixel *inter, + const Uint32 start, + const DiLookupTable *plut, + DiDisplayFunction *disp, + const double center, + const double width, + const T3 low, + const T3 high) + { + const T1 *pixel = OFstatic_cast(const T1 *, inter->getData()); + if (pixel != NULL) + { + if (Data == NULL) + Data = new T3[FrameSize]; // create new output buffer + if (Data != NULL) + { + DCMIMGLE_DEBUG("applying sigmoid VOI transformation with window center = " << center << ", width = " << width); + const DiDisplayLUT *dlut = NULL; + const double absmin = inter->getAbsMinimum(); + const double outrange = OFstatic_cast(double, high) - OFstatic_cast(double, low); // output range + const unsigned long ocnt = determineOptimizationCount(inter->getAbsMaxRange()); // number of LUT entries + const T1 *p = pixel + start; + T3 *q = Data; + unsigned long i; + double value; + T3 *lut = NULL; + if ((plut != NULL) && (plut->isValid())) // has presentation LUT + { + DCMIMGLE_DEBUG("applying presentation LUT transformation"); + createDisplayLUT(dlut, disp, plut->getBits()); + Uint32 value2; // presentation LUT is always unsigned + const double plutcnt_1 = OFstatic_cast(double, plut->getCount() - 1); + const double plutmax_1 = OFstatic_cast(double, plut->getAbsMaxRange() - 1); + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #1"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double offset = (low > high) ? maxvalue : 0; + const double gradient = (low > high) ? (-maxvalue / plutmax_1) : (maxvalue / plutmax_1); + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(double, i) + absmin; + value2 = OFstatic_cast(Uint32, plutcnt_1 / (1 + exp(-4 * (value - center) / width))); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + OFstatic_cast(double, plut->getValue(value2)) * gradient))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #2"); + const double gradient = outrange / plutmax_1; + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(double, i) + absmin; + value2 = OFstatic_cast(Uint32, plutcnt_1 / (1 + exp(-4 * (value - center) / width))); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value2)) * gradient); + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, absmin); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #3"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double offset = (low > high) ? maxvalue : 0; + const double gradient = (low > high) ? (-maxvalue / plutmax_1) : (maxvalue / plutmax_1); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(double, *(p++)); + value2 = OFstatic_cast(Uint32, plutcnt_1 / (1 + exp(-4 * (value - center) / width))); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + OFstatic_cast(double, plut->getValue(value2)) * gradient))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #4"); + const double gradient = outrange / plutmax_1; + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(double, *(p++)); + value2 = OFstatic_cast(Uint32, plutcnt_1 / (1 + exp(-4 * (value - center) / width))); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value2)) * gradient); + } + } + } + } else { // has no presentation LUT + createDisplayLUT(dlut, disp, bitsof(T1)); + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #5"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double outrange2 = (low > high) ? -maxvalue : maxvalue; + const double offset = (low > high) ? maxvalue : 0; + for (i = 0; i < ocnt; ++i) // calculating LUT entries + { + value = OFstatic_cast(double, i) + absmin; + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + outrange2 / (1 + exp(-4 * (value - center) / width))))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #6"); + for (i = 0; i < ocnt; ++i) // calculating LUT entries + { + value = OFstatic_cast(double, i) + absmin; + *(q++) = OFstatic_cast(T3, outrange / (1 + exp(-4 * (value - center) / width))); + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, absmin); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #7"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double outrange2 = (low > high) ? -maxvalue : maxvalue; + const double offset = (low > high) ? maxvalue : 0; + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(double, *(p++)); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + outrange2 / (1 + exp(-4 * (value - center) / width))))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI SIGMOID #8"); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(double, *(p++)); + *(q++) = OFstatic_cast(T3, outrange / (1 + exp(-4 * (value - center) / width))); + } + } + } + } + delete[] lut; + if (Count < FrameSize) + OFBitmanipTemplate::zeroMem(Data + Count, FrameSize - Count); // set remaining pixels of frame to zero + } + } else + Data = NULL; + } + + /** apply the currently active linear VOI window to the output data + * + ** @param inter pointer to intermediate pixel representation + * @param start offset of the first pixel to be processed + * @param plut presentation LUT (optional, maybe NULL) + * @param disp display function (optional, maybe NULL) + * @param center window center + * @param width window width (>= 1) + * @param low lowest pixel value for the output data (e.g. 0) + * @param high highest pixel value for the output data (e.g. 255) + */ + void window(const DiMonoPixel *inter, + const Uint32 start, + const DiLookupTable *plut, + DiDisplayFunction *disp, + const double center, + const double width, + const T3 low, + const T3 high) + { + const T1 *pixel = OFstatic_cast(const T1 *, inter->getData()); + if (pixel != NULL) + { + if (Data == NULL) + Data = new T3[FrameSize]; // create new output buffer + if (Data != NULL) + { + DCMIMGLE_DEBUG("applying linear VOI transformation with window center = " << center << ", width = " << width); + const DiDisplayLUT *dlut = NULL; + const double absmin = inter->getAbsMinimum(); + const double width_1 = width - 1; + const double leftBorder = center - 0.5 - width_1 / 2; // window borders, according to supplement 33 + const double rightBorder = center - 0.5 + width_1 / 2; + const double outrange = OFstatic_cast(double, high) - OFstatic_cast(double, low); // output range + const unsigned long ocnt = determineOptimizationCount(inter->getAbsMaxRange()); // number of LUT entries + const T1 *p = pixel + start; + T3 *q = Data; + unsigned long i; + double value; + T3 *lut = NULL; + if ((plut != NULL) && (plut->isValid())) // has presentation LUT + { + DCMIMGLE_DEBUG("applying presentation LUT transformation"); + createDisplayLUT(dlut, disp, plut->getBits()); + Uint32 value2; // presentation LUT is always unsigned + const Uint32 pcnt = plut->getCount(); + const double plutmax_1 = OFstatic_cast(double, plut->getAbsMaxRange()) - 1; + const double gradient1 = (width_1 == 0) ? 0 : OFstatic_cast(double, pcnt - 1) / width_1; + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #1"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double offset = (low > high) ? maxvalue : 0; + const double gradient2 = (low > high) ? (-maxvalue / plutmax_1) : (maxvalue / plutmax_1); + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(double, i) + absmin; // pixel value + if (value <= leftBorder) + value2 = 0; // first LUT index + else if (value > rightBorder) + value2 = pcnt - 1; // last LUT index + else + value2 = OFstatic_cast(Uint32, (value - leftBorder) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + OFstatic_cast(double, plut->getValue(value2)) * gradient2))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #2"); + const double gradient2 = outrange / plutmax_1; + for (i = 0; i < ocnt; ++i) + { + value = OFstatic_cast(double, i) + absmin; // pixel value + if (value <= leftBorder) + value2 = 0; // first LUT index + else if (value > rightBorder) + value2 = pcnt - 1; // last LUT index + else + value2 = OFstatic_cast(Uint32, (value - leftBorder) * gradient1); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value2)) * gradient2); + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, absmin); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #3"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double offset = (low > high) ? maxvalue : 0; + const double gradient2 = (low > high) ? (-maxvalue / plutmax_1) : (maxvalue / plutmax_1); + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(double, *(p++)); // pixel value + if (value <= leftBorder) + value2 = 0; // first LUT index + else if (value > rightBorder) + value2 = pcnt - 1; // last LUT index + else + value2 = OFstatic_cast(Uint32, (value - leftBorder) * gradient1); + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + OFstatic_cast(double, plut->getValue(value2)) * gradient2))); + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #4"); + const double gradient2 = outrange / plutmax_1; + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(double, *(p++)); // pixel value + if (value <= leftBorder) + value2 = 0; // first LUT index + else if (value > rightBorder) + value2 = pcnt - 1; // last LUT index + else + value2 = OFstatic_cast(Uint32, (value - leftBorder) * gradient1); + *(q++) = OFstatic_cast(T3, OFstatic_cast(double, low) + OFstatic_cast(double, plut->getValue(value2)) * gradient2); + } + } + } + } else { // has no presentation LUT + createDisplayLUT(dlut, disp, bitsof(T1)); + if (initOptimizationLUT(lut, ocnt)) + { // use LUT for optimization + q = lut; + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #5"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double offset = (low > high) ? maxvalue : 0; + const double gradient = (width_1 == 0) ? 0 : ((low > high) ? (-maxvalue / width_1) : (maxvalue / width_1)); + for (i = 0; i < ocnt; ++i) // calculating LUT entries + { + value = OFstatic_cast(double, i) + absmin - leftBorder; + if (value < 0) // left border + value = 0; + else if (value > width_1) // right border + value = width_1; + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + value * gradient))); // calculate value + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #6"); + const double offset = (width_1 == 0) ? 0 : (high - ((center - 0.5) / width_1 + 0.5) * outrange); + const double gradient = (width_1 == 0) ? 0 : outrange / width_1; + for (i = 0; i < ocnt; ++i) // calculating LUT entries + { + value = OFstatic_cast(double, i) + absmin; + if (value <= leftBorder) + *(q++) = low; // black/white + else if (value > rightBorder) + *(q++) = high; // white/black + else + *(q++) = OFstatic_cast(T3, offset + value * gradient); // gray value + } + } + const T3 *lut0 = lut - OFstatic_cast(T2, absmin); // points to 'zero' entry + q = Data; + for (i = Count; i != 0; --i) // apply LUT + *(q++) = *(lut0 + (*(p++))); + } + if (lut == NULL) // use "normal" transformation + { + if (dlut != NULL) // perform display transformation + { + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #7"); + const double maxvalue = OFstatic_cast(double, dlut->getCount() - 1); + const double offset = (low > high) ? maxvalue : 0; + const double gradient = (width_1 == 0) ? 0 : ((low > high) ? (-maxvalue / width_1) : (maxvalue / width_1)); + for (i = Count; i != 0; --i) // calculating LUT entries + { + value = OFstatic_cast(double, *(p++)) - leftBorder; + if (value < 0) // left border + value = 0; + else if (value > width_1) // right border + value = width_1; + *(q++) = OFstatic_cast(T3, dlut->getValue(OFstatic_cast(Uint16, offset + value * gradient))); // calculate value + } + } else { // don't use display: invalid or absent + DCMIMGLE_TRACE("monochrome rendering: VOI LINEAR #8"); + const double offset = (width_1 == 0) ? 0 : (high - ((center - 0.5) / width_1 + 0.5) * outrange); + const double gradient = (width_1 == 0) ? 0 : outrange / width_1; + for (i = Count; i != 0; --i) + { + value = OFstatic_cast(double, *(p++)); + if (value <= leftBorder) + *(q++) = low; // black/white + else if (value > rightBorder) + *(q++) = high; // white/black + else + *(q++) = OFstatic_cast(T3, offset + value * gradient); // gray value + } + } + } + } + delete[] lut; + if (Count < FrameSize) + OFBitmanipTemplate::zeroMem(Data + Count, FrameSize - Count); // set remaining pixels of frame to zero + } + } else + Data = NULL; + } + + + /** apply the currently active overlay planes to the output data + * + ** @param overlays array of overlay management objects + * @param disp display function (optional, maybe NULL) + * @param columns image's width (in pixels) + * @param rows image's height (in pixels) + * @param frame number of frame to be rendered + */ + void overlay(DiOverlay *overlays[2], + DiDisplayFunction *disp, + const Uint16 columns, + const Uint16 rows, + const unsigned long frame) + { + if ((Data != NULL) && (overlays != NULL)) + { + for (unsigned int j = 0; j < 2; ++j) + { + if (overlays[j] != NULL) + { + const signed long left_pos = overlays[j]->getLeft(); + const signed long top_pos = overlays[j]->getTop(); + if (overlays[j]->getCount() > 0) + { + DCMIMGLE_DEBUG("applying " << ((j == 0) ? "built-in" : "additional") << " overlay planes"); + DCMIMGLE_TRACE(" left_pos: " << left_pos << ", top_pos: " << top_pos << ", columns: " << columns << ", rows: " << rows); + } + DiOverlayPlane *plane; + for (unsigned int i = 0; i < overlays[j]->getCount(); ++i) + { + plane = overlays[j]->getPlane(i); + if ((plane != NULL) && plane->isVisible() && plane->reset(frame)) + { + T3 *q; + Uint16 x; + Uint16 y; + const Uint16 xmin = (plane->getLeft(left_pos) > 0) ? plane->getLeft(left_pos) : 0; + const Uint16 ymin = (plane->getTop(top_pos) > 0) ? plane->getTop(top_pos) : 0; + const Uint16 xmax = (plane->getRight(left_pos) < columns) ? plane->getRight(left_pos) : columns; + const Uint16 ymax = (plane->getBottom(top_pos) < rows) ? plane->getBottom(top_pos) : rows; + const T3 maxvalue = OFstatic_cast(T3, DicomImageClass::maxval(bitsof(T3))); + switch (plane->getMode()) + { + case EMO_Replace: + { + DCMIMGLE_DEBUG("applying overlay plane " << (i + 1) << " with 'replace' mode"); + const T3 fore = OFstatic_cast(T3, plane->getForeground() * maxvalue); + for (y = ymin; y < ymax; ++y) + { + plane->setStart(OFstatic_cast(Uint16, left_pos + xmin), OFstatic_cast(Uint16, top_pos + y)); + q = Data + OFstatic_cast(unsigned long, y) * OFstatic_cast(unsigned long, columns) + OFstatic_cast(unsigned long, xmin); + for (x = xmin; x < xmax; ++x, ++q) + { + if (plane->getNextBit()) + *q = fore; + } + } + break; + } + case EMO_ThresholdReplace: + { + DCMIMGLE_DEBUG("applying overlay plane " << (i + 1) << " with 'threshold replace' mode"); + const T3 fore = OFstatic_cast(T3, plane->getForeground() * maxvalue); + const T3 thresh = OFstatic_cast(T3, plane->getThreshold() * maxvalue); + for (y = ymin; y < ymax; ++y) + { + plane->setStart(OFstatic_cast(Uint16, left_pos + xmin), OFstatic_cast(Uint16, top_pos + y)); + q = Data + OFstatic_cast(unsigned long, y) * OFstatic_cast(unsigned long, columns) + OFstatic_cast(unsigned long, xmin); + for (x = xmin; x < xmax; ++x, ++q) + { + if (plane->getNextBit()) + *q = (*q <= thresh) ? fore : 1; + } + } + break; + } + case EMO_Complement: + { + DCMIMGLE_DEBUG("applying overlay plane " << (i + 1) << " with 'complement' mode"); + const T3 thresh = OFstatic_cast(T3, DicomImageClass::maxval(bitsof(T3) / 2)); + for (y = ymin; y < ymax; ++y) + { + plane->setStart(OFstatic_cast(Uint16, left_pos + xmin), OFstatic_cast(Uint16, top_pos + y)); + q = Data + OFstatic_cast(unsigned long, y) * OFstatic_cast(unsigned long, columns) + OFstatic_cast(unsigned long, xmin); + for (x = xmin; x < xmax; ++x, ++q) + { + if (plane->getNextBit()) + *q = (*q <= thresh) ? maxvalue : 0; + } + } + break; + } + case EMO_InvertBitmap: + { + DCMIMGLE_DEBUG("applying overlay plane " << (i + 1) << " with 'invert bitmap' mode"); + const T3 fore = OFstatic_cast(T3, plane->getForeground() * maxvalue); + for (y = ymin; y < ymax; ++y) + { + plane->setStart(OFstatic_cast(Uint16, left_pos + xmin), OFstatic_cast(Uint16, top_pos + y)); + q = Data + OFstatic_cast(unsigned long, y) * OFstatic_cast(unsigned long, columns) + OFstatic_cast(unsigned long, xmin); + for (x = xmin; x < xmax; ++x, ++q) + { + if (!plane->getNextBit()) + *q = fore; + } + } + break; + } + case EMO_RegionOfInterest: + { + DCMIMGLE_DEBUG("applying overlay plane " << (i + 1) << " with 'region of interest' mode"); + const int dim = bitsof(T3) / 2; + for (y = ymin; y < ymax; ++y) + { + plane->setStart(OFstatic_cast(Uint16, left_pos + xmin), OFstatic_cast(Uint16, top_pos + y)); + q = Data + OFstatic_cast(unsigned long, y) * OFstatic_cast(unsigned long, columns) + OFstatic_cast(unsigned long, xmin); + for (x = xmin; x < xmax; ++x, ++q) + { + if (!plane->getNextBit()) + *q = *q >> dim; + } + } + break; + } + case EMO_BitmapShutter: + { + DCMIMGLE_DEBUG("applying overlay plane " << (i + 1) << " with 'bitmap shutter' mode"); + T3 fore = OFstatic_cast(T3, OFstatic_cast(double, maxvalue) * OFstatic_cast(double, plane->getPValue()) / OFstatic_cast(double, DicomImageClass::maxval(WIDTH_OF_PVALUES))); + if ((disp != NULL) && (disp->isValid())) + { + const DiDisplayLUT *dlut = disp->getLookupTable(WIDTH_OF_PVALUES); + if ((dlut != NULL) && (dlut->isValid())) + fore = OFstatic_cast(T3, dlut->getValue(plane->getPValue())); + } + for (y = ymin; y < ymax; ++y) + { + plane->setStart(OFstatic_cast(Uint16, left_pos + xmin), OFstatic_cast(Uint16, top_pos + y)); + q = Data + OFstatic_cast(unsigned long, y) * OFstatic_cast(unsigned long, columns) + OFstatic_cast(unsigned long, xmin); + for (x = xmin; x < xmax; ++x, ++q) + { + if (plane->getNextBit()) + *q = fore; + } + } + break; + } + default: /* e.g. EMO_Default */ + DCMIMGLE_WARN("unhandled overlay mode (" << OFstatic_cast(int, plane->getMode()) << ") for plane " << (i + 1)); + } + DCMIMGLE_TRACE(" overlay data of this plane is " << (plane->isEmbedded() ? "embedded in the pixel data" : "stored separately")); + DCMIMGLE_TRACE(" xmin: " << xmin << ", ymin: " << ymin << ", xmax: " << xmax << ", ymax: " << ymax); + } + } + } + } + } + } + + + /// pointer to the storage area where the output data should be stored + T3 *Data; + /// flag indicating whether the output data buffer should be deleted in the destructor + int DeleteData; + +#ifdef PASTEL_COLOR_OUTPUT + DiMonoColorOutputPixelTemplate *ColorData; +#else + // dummy variable + DiMonoOutputPixel *ColorData; +#endif + + // --- declarations to avoid compiler warnings + + DiMonoOutputPixelTemplate(const DiMonoOutputPixelTemplate &); + DiMonoOutputPixelTemplate &operator=(const DiMonoOutputPixelTemplate &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimopx.h b/dcmimgle/include/dcmtk/dcmimgle/dimopx.h new file mode 100644 index 00000000..a2ca5fc7 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimopx.h @@ -0,0 +1,242 @@ +/* + * + * Copyright (C) 1996-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromePixel (Header) + * + */ + + +#ifndef DIMOPX_H +#define DIMOPX_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dipixel.h" +#include "dcmtk/dcmimgle/dimomod.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiInputPixel; +class DiMonoOutputPixel; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Abstract base class to handle monochrome pixel data + */ +class DCMTK_DCMIMGLE_EXPORT DiMonoPixel + : public DiPixel +{ + + public: + + /** constructor + * + ** @param count number of pixels + */ + DiMonoPixel(const unsigned long count); + + /** constructor + * + ** @param pixel pointer to input pixel data + * @param modality pointer to object managing modality transform + */ + DiMonoPixel(const DiInputPixel *pixel, + DiMonoModality *modality); + + /** constructor + * + ** @param pixel pointer to output pixel data used for intermediate representation + * @param modality pointer to object managing modality transform + */ + DiMonoPixel(DiMonoOutputPixel *pixel, + DiMonoModality *modality); + + /** destructor + */ + virtual ~DiMonoPixel(); + + /** get number of planes + * + ** @return number of planes (here 1, monochrome) + */ + inline int getPlanes() const + { + return 1; + } + + /** get minimum and maximum pixel values (abstract) + * + ** @param min reference to storage area for minimum pixel value + * @param max reference to storage area for maximum pixel value + * + ** @return status, true if successful, false otherwise + */ + virtual int getMinMaxValues(double &min, + double &max) const = 0; + + /** get automatically computed min-max window (abstract) + * + ** @param idx ignore global min/max pixel values if > 0 + * @param center reference to storage area for window center value + * @param width reference to storage area for window width value + * + ** @return status, true if successful, false otherwise + */ + virtual int getMinMaxWindow(const int idx, + double ¢er, + double &width) = 0; + + /** get automatically computed Region of Interest (ROI) window (abstract) + * + ** @param left_pos x-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param top_pos y-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param width width in pixels of the rectangular ROI (minimum: 1) + * @param height height in pixels of the rectangular ROI (minimum: 1) + * @param columns number of columns (width) of the associated image + * @param rows number of rows (height) of the associated image + * @param frame index of the frame to be used for the calculation + * @param voiCenter reference to storage area for window center value + * @param voiWidth reference to storage area for window width value + * + ** @return status, true if successful, false otherwise + */ + virtual int getRoiWindow(const unsigned long left_pos, + const unsigned long top_pos, + const unsigned long width, + const unsigned long height, + const unsigned long columns, + const unsigned long rows, + const unsigned long frame, + double &voiCenter, + double &voiWidth) = 0; + + /** get automatically computed histogram window (abstract) + * + ** @param thresh ignore certain percentage of pixels at lower and upper boundaries + * @param center reference to storage area for window center value + * @param width reference to storage area for window width value + * + ** @return status, true if successful, false otherwise + */ + virtual int getHistogramWindow(const double thresh, + double ¢er, + double &width) = 0; + + /** get number of bits per pixel + * + ** @return number of bits + */ + inline unsigned int getBits() const + { + return (Modality != NULL) ? Modality->getBits() : 0; + } + + /** get absolute minimum pixel value. + * The result depends on former transforms. + * + ** @return absolute minimum value + */ + inline double getAbsMinimum() const + { + return (Modality != NULL) ? Modality->getAbsMinimum() : 0; + } + + /** get absolute maximum pixel value. + * The result depends on former transforms. + * + ** @return absolute maximum value + */ + inline double getAbsMaximum() const + { + return (Modality != NULL) ? Modality->getAbsMaximum() : 0; + } + + /** get absolute pixel range + * + ** @return absolute pixel range + */ + inline double getAbsMaxRange() const + { + return getAbsMaximum() - getAbsMinimum() + 1; + } + + /** get modality LUT explanation string + * + ** @return modality LUT explanation + */ + inline const char *getModalityLutExplanation() const + { + return (Modality != NULL) ? Modality->getExplanation() : OFstatic_cast(const char *, NULL); + } + + /** add a reference to the internally managed modality transform object + * + ** @return pointer to modality transform object (might be NULL) + */ + DiMonoModality *addReferenceToModality(); + + /** check whether pixel data is 'potentially' signed. + * This check is necessary to interpret possibly following LUT descriptors correctly + * (see supplement 33) + * + ** @return true if pixel data is potentially signed, false otherwise + */ + inline int isPotentiallySigned() const + { + return (getAbsMinimum() < 0); + } + + + protected: + + /** constructor + * + ** @param pixel pointer to intermediate pixel data (not necessarily monochrome) + * @param modality pointer to object managing modality transform + */ + DiMonoPixel(const DiPixel *pixel, + DiMonoModality *modality); + + /** constructor + * + ** @param pixel pointer to intermediate monochrome pixel data + * @param count number of pixels + */ + DiMonoPixel(const DiMonoPixel *pixel, + const unsigned long count); + + /// pointer to modality transform object + DiMonoModality *Modality; + + + private: + + // --- declarations to avoid compiler warnings + + DiMonoPixel(const DiMonoPixel &); + DiMonoPixel &operator=(const DiMonoPixel &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimopxt.h b/dcmimgle/include/dcmtk/dcmimgle/dimopxt.h new file mode 100644 index 00000000..532ee3a0 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimopxt.h @@ -0,0 +1,437 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromePixelTemplate (Header) + * + */ + + +#ifndef DIMOPXT_H +#define DIMOPXT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dipxrept.h" +#include "dcmtk/dcmimgle/dimopx.h" +#include "dcmtk/dcmimgle/dimoopx.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to handle monochrome pixel data + */ +template +class DiMonoPixelTemplate + : public DiMonoPixel, + public DiPixelRepresentationTemplate +{ + + public: + + /** constructor + * + ** @param count number of pixels + */ + DiMonoPixelTemplate(const unsigned long count) + : DiMonoPixel(count), + Data(NULL) + { + MinValue[0] = 0; + MinValue[1] = 0; + MaxValue[0] = 0; + MaxValue[1] = 0; + // allocate buffer of given size +#ifdef HAVE_STD__NOTHROW + /* use a non-throwing new here (if available) because the allocated buffer can be huge */ + Data = new (std::nothrow) T[Count]; +#else + /* make sure that the pointer is set to NULL in case of error */ + try + { + Data = new T[Count]; + } + catch (STD_NAMESPACE bad_alloc const &) + { + Data = NULL; + } +#endif + if (Data == NULL) + DCMIMGLE_DEBUG("cannot allocate memory buffer for 'Data' in DiMonoPixelTemplate constructor"); + } + + /** constructor + * + ** @param pixel pointer to input pixel data + * @param modality pointer to object managing modality transform + */ + DiMonoPixelTemplate(const DiInputPixel *pixel, + DiMonoModality *modality) + : DiMonoPixel(pixel, modality), + Data(NULL) + { + MinValue[0] = 0; + MinValue[1] = 0; + MaxValue[0] = 0; + MaxValue[1] = 0; + } + + /** constructor + * + ** @param pixel pointer to output pixel data used for intermediate representation + * @param modality pointer to object managing modality transform + */ + DiMonoPixelTemplate(DiMonoOutputPixel *pixel, + DiMonoModality *modality) + : DiMonoPixel(pixel, modality), + Data(OFstatic_cast(T *, pixel->getDataPtr())) + { + MinValue[0] = 0; + MinValue[1] = 0; + MaxValue[0] = 0; + MaxValue[1] = 0; + } + + /** destructor + */ + virtual ~DiMonoPixelTemplate() + { +#if defined(HAVE_STD__NOTHROW) && defined(HAVE_NOTHROW_DELETE) + /* use a non-throwing delete (if available) */ + operator delete[] (Data, std::nothrow); +#else + delete[] Data; +#endif + } + + /** get integer representation + * + ** @return integer representation of the internally stored pixel data + */ + inline EP_Representation getRepresentation() const + { + return DiPixelRepresentationTemplate::getRepresentation(); + } + + /** get pointer to internal pixel data + * + ** @return pointer to pixel data + */ + inline const void *getData() const + { + return OFstatic_cast(const void *, Data); + } + + /** get pointer to internal pixel data + * + ** @return pointer to pixel data + */ + inline void *getDataPtr() + { + return OFstatic_cast(void *, Data); + } + + /** get reference to pointer to internal pixel data. + * The returned array points to the (single) image plane. The behaviour of + * this method is, therefore, identical for both monochrome and color images. + * + ** @return reference to pointer to pixel data + */ + inline void *getDataArrayPtr() + { + return OFstatic_cast(void *, &Data); + } + + /** get minimum and maximum pixel values + * + ** @param min reference to storage area for minimum pixel value + * @param max reference to storage area for maximum pixel value + * + ** @return status, true if successful, false otherwise + */ + inline int getMinMaxValues(double &min, + double &max) const + { + min = MinValue[0]; + max = MaxValue[0]; + return 1; + } + + /** get automatically computed min-max window + * + ** @param idx ignore global min/max pixel values if > 0 + * @param center reference to storage area for window center value + * @param width reference to storage area for window width value + * + ** @return status, true if successful, false otherwise + */ + inline int getMinMaxWindow(const int idx, + double ¢er, + double &width) + { + int result = 0; + if ((idx >= 0) && (idx <= 1)) + { + if ((idx == 1) && (MinValue[1] == 0) && (MaxValue[1] == 0)) + determineMinMax(0, 0, 0x2); // determine on demand + /* suppl. 33: "A Window Center of 2^n-1 and a Window Width of 2^n + selects the range of input values from 0 to 2^n-1." + */ + center = (OFstatic_cast(double, MinValue[idx]) + OFstatic_cast(double, MaxValue[idx]) + 1) / 2; // type cast to avoid overflows ! + width = OFstatic_cast(double, MaxValue[idx]) - OFstatic_cast(double, MinValue[idx]) + 1; + result = (width > 0); // check for valid value + } + return result; + } + + /** get automatically computed Region of Interest (ROI) window + * + ** @param left_pos x-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param top_pos y-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param width width in pixels of the rectangular ROI (minimum: 1) + * @param height height in pixels of the rectangular ROI (minimum: 1) + * @param columns number of columns (width) of the associated image + * @param rows number of rows (height) of the associated image + * @param frame index of the frame to be used for the calculation + * @param voiCenter reference to storage area for window center value + * @param voiWidth reference to storage area for window width value + * + ** @return status, true if successful, false otherwise + */ + virtual int getRoiWindow(const unsigned long left_pos, + const unsigned long top_pos, + const unsigned long width, + const unsigned long height, + const unsigned long columns, + const unsigned long rows, + const unsigned long frame, + double &voiCenter, + double &voiWidth) + { + int result = 0; + if ((Data != NULL) && (left_pos < columns) && (top_pos < rows)) + { + T *p = Data + (columns * rows * frame) + (top_pos * columns) + left_pos; + const unsigned long right_pos = (left_pos + width < columns) ? left_pos + width : columns; + const unsigned long bottom = (top_pos + height < rows) ? top_pos + height : rows; + const unsigned long skip_x = left_pos + (columns - right_pos); + unsigned long x; + unsigned long y; + T value = 0; + T min = *p; // get first pixel as initial value for min ... + T max = min; // ... and max + for (y = top_pos; y < bottom; ++y) + { + for (x = left_pos; x < right_pos; ++x) + { + value = *(p++); + if (value < min) + min = value; + else if (value > max) + max = value; + } + p += skip_x; // skip rest of current line and beginning of next + } + /* suppl. 33: "A Window Center of 2^n-1 and a Window Width of 2^n + selects the range of input values from 0 to 2^n-1." + */ + voiCenter = (OFstatic_cast(double, min) + OFstatic_cast(double, max) + 1) / 2; // type cast to avoid overflows ! + voiWidth = OFstatic_cast(double, max) - OFstatic_cast(double, min) + 1; + result = (width > 0); // check for valid value + } + return result; + } + + /** get automatically computed histogram window + * + ** @param thresh ignore certain percentage of pixels at lower and upper boundaries + * @param center reference to storage area for window center value + * @param width reference to storage area for window width value + * + ** @return status, true if successful, false otherwise + */ + int getHistogramWindow(const double thresh, // could be optimized if necessary (see diinpxt.h)! + double ¢er, + double &width) + { + if ((Data != NULL) && (MinValue[0] < MaxValue[0])) + { + const Uint32 count = OFstatic_cast(Uint32, MaxValue[0] - MinValue[0] + 1); + Uint32 *quant = new Uint32[count]; + if (quant != NULL) + { + unsigned long i; + OFBitmanipTemplate::zeroMem(quant, count); // initialize array + for (i = 0; i < Count; ++i) + { + if ((Data[i] >= MinValue[0]) && (Data[i] <= MaxValue[0])) // only for stability ! + ++quant[OFstatic_cast(Uint32, Data[i] - MinValue[0])]; // count values +#ifdef DEBUG + else + DCMIMGLE_WARN("invalid value (" << Data[i] << ") in DiMonoPixelTemplate::getHistogramWindow()"); +#endif + } + const Uint32 threshvalue = OFstatic_cast(Uint32, thresh * OFstatic_cast(double, Count)); + Uint32 t = 0; + i = 0; + while ((i < count) && (t < threshvalue)) + t += quant[i++]; + const T minvalue = (i < count) ? OFstatic_cast(T, MinValue[0] + i) : 0; + t = 0; + i = count; + while ((i > 0) && (t < threshvalue)) + t += quant[--i]; + const T maxvalue = (i > 0) ? OFstatic_cast(T, MinValue[0] + i) : 0; + delete[] quant; + if (minvalue < maxvalue) + { + /* suppl. 33: "A Window Center of 2^n-1 and a Window Width of 2^n + selects the range of input values from 0 to 2^n-1." + */ + center = (OFstatic_cast(double, minvalue) + OFstatic_cast(double, maxvalue) + 1) / 2; + width = OFstatic_cast(double, maxvalue) - OFstatic_cast(double, minvalue) + 1; + return (width > 0); + } + } + } + return 0; + } + + + protected: + + /** constructor + * + ** @param pixel pointer to intermediate pixel data (not necessarily monochrome) + * @param modality pointer to object managing modality transform + */ + DiMonoPixelTemplate(const DiPixel *pixel, + DiMonoModality *modality) + : DiMonoPixel(pixel, modality), + Data(NULL) + { + MinValue[0] = 0; + MinValue[1] = 0; + MaxValue[0] = 0; + MaxValue[1] = 0; + } + + /** constructor + * + ** @param pixel pointer to intermediate monochrome pixel data + * @param count number of pixels + */ + DiMonoPixelTemplate(const DiMonoPixel *pixel, + const unsigned long count) + : DiMonoPixel(pixel, count), + Data(NULL) + { + MinValue[0] = 0; + MinValue[1] = 0; + MaxValue[0] = 0; + MaxValue[1] = 0; + } + + /** determine minimum and maximum pixel values + * + ** @param minvalue starting global minimum value (0 = invalid) + * @param maxvalue starting global maximum value (0 = invalid) + * @param mode calculate global min/max if 0x1 bit is set (default), + * calculate next min/max if 0x2 bit is set + */ + void determineMinMax(T minvalue = 0, + T maxvalue = 0, + const int mode = 0x1) + { + if (Data != NULL) + { + if (mode & 0x1) + { + if ((minvalue == 0) && (maxvalue == 0)) + { + DCMIMGLE_DEBUG("determining global minimum and maximum pixel values for monochrome image"); + T *p = Data; + T value = *p; + unsigned long i; + minvalue = value; + maxvalue = value; + for (i = Count; i > 1; --i) // could be optimized if necessary (see diinpxt.h) ! + { + value = *(++p); + if (value < minvalue) + minvalue = value; + else if (value > maxvalue) + maxvalue = value; + } + } + MinValue[0] = minvalue; // global minimum + MaxValue[0] = maxvalue; // global maximum + MinValue[1] = 0; // invalidate value + MaxValue[1] = 0; + } else { + minvalue = MinValue[0]; + maxvalue = MaxValue[0]; + } + if (mode & 0x2) + { + DCMIMGLE_DEBUG("determining next minimum and maximum pixel values for monochrome image"); + T *p = Data; + T value; + int firstmin = 1; + int firstmax = 1; + unsigned long i; + for (i = Count; i != 0; --i) // could be optimized if necessary (see diinpxt.h) ! + { + value = *(p++); + if ((value > minvalue) && ((value < MinValue[1]) || firstmin)) + { + MinValue[1] = value; + firstmin = 0; + } + if ((value < maxvalue) && ((value > MaxValue[1]) || firstmax)) + { + MaxValue[1] = value; + firstmax = 0; + } + } + } + } + } + + /// pointer to pixel data + T *Data; + + + private: + + /// minimum pixel values (0 = global, 1 = ignoring global) + T MinValue[2]; + /// maximum pixel values + T MaxValue[2]; + + // --- declarations to avoid compiler warnings + + DiMonoPixelTemplate(const DiMonoPixelTemplate &); + DiMonoPixelTemplate &operator=(const DiMonoPixelTemplate &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimorot.h b/dcmimgle/include/dcmtk/dcmimgle/dimorot.h new file mode 100644 index 00000000..c4969569 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimorot.h @@ -0,0 +1,112 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeRotateTemplate (Header) + * + */ + + +#ifndef DIMOROT_H +#define DIMOROT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dimopxt.h" +#include "dcmtk/dcmimgle/dirotat.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to rotate monochrome images (on pixel data level). + * by steps of 90 degrees + */ +template +class DiMonoRotateTemplate + : public DiMonoPixelTemplate, + protected DiRotateTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param src_cols width of clipping area + * @param src_rows height of clipping area + * @param dest_cols width of destination image (scaled image) + * @param dest_rows height of destination image + * @param frames number of frames + * @param degree angle by which the pixel data should be rotated + */ + DiMonoRotateTemplate(const DiMonoPixel *pixel, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const Uint32 frames, + const int degree) + : DiMonoPixelTemplate(pixel, OFstatic_cast(unsigned long, dest_cols) * OFstatic_cast(unsigned long, dest_rows) * frames), + DiRotateTemplate(1, src_cols, src_rows, dest_cols, dest_rows, frames) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if (pixel->getCount() == OFstatic_cast(unsigned long, src_cols) * OFstatic_cast(unsigned long, src_rows) * frames) + rotate(OFstatic_cast(const T *, pixel->getData()), degree); + else { + DCMIMGLE_WARN("could not rotate image ... corrupted data"); + } + } + } + + /** destructor + */ + ~DiMonoRotateTemplate() + { + } + + + private: + + /** rotate pixel data + * + ** @param pixel pointer to pixel data to be rotated + * @param degree angle by which the pixel data should be rotated + */ + inline void rotate(const T *pixel, + const int degree) + { + if (pixel != NULL) + { + this->Data = new T[DiMonoPixelTemplate::getCount()]; + if (this->Data != NULL) + { + if (degree == 90) + this->rotateRight(&pixel, &(this->Data)); + else if (degree == 180) + this->rotateTopDown(&pixel, &(this->Data)); + else if (degree == 270) + this->rotateLeft(&pixel, &(this->Data)); + } + } + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dimosct.h b/dcmimgle/include/dcmtk/dcmimgle/dimosct.h new file mode 100644 index 00000000..a437b818 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dimosct.h @@ -0,0 +1,127 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeScaleTemplate (Header) + * + */ + + +#ifndef DIMOSCT_H +#define DIMOSCT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dimopxt.h" +#include "dcmtk/dcmimgle/discalet.h" +#include "dcmtk/dcmimgle/didispfn.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to scale monochrome images (on pixel data level). + */ +template +class DiMonoScaleTemplate + : public DiMonoPixelTemplate, + protected DiScaleTemplate +{ + + public: + + /** constructor + * + ** @param pixel pointer to intermediate pixel representation + * @param columns width of source image + * @param rows height of source image + * @param left_pos left coordinate of clipping area + * @param top_pos top coordinate of clipping area + * @param src_cols width of clipping area + * @param src_rows height of clipping area + * @param dest_cols width of destination image (scaled image) + * @param dest_rows height of destination image + * @param frames number of frames + * @param bits number of bits per plane/pixel + * @param interpolate use of interpolation when scaling + * @param pvalue value possibly used for regions outside the image boundaries + */ + DiMonoScaleTemplate(const DiMonoPixel *pixel, + const Uint16 columns, + const Uint16 rows, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const Uint32 frames, + const int bits, + const int interpolate, + const Uint16 pvalue) + : DiMonoPixelTemplate(pixel, OFstatic_cast(unsigned long, dest_cols) * OFstatic_cast(unsigned long, dest_rows) * frames), + DiScaleTemplate(1, columns, rows, left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, frames, bits) + { + if ((pixel != NULL) && (pixel->getCount() > 0)) + { + if (pixel->getCount() == OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames) + { + scale(OFstatic_cast(const T *, pixel->getData()), pixel->getBits(), interpolate, pvalue); + this->determineMinMax(); + } else { + DCMIMGLE_WARN("could not scale image ... corrupted data"); + } + } + } + + /** destructor + */ + virtual ~DiMonoScaleTemplate() + { + } + + + private: + + /** scale pixel data + * + ** @param pixel pointer to pixel data to be scaled + * @param bits bit depth of pixel data + * @param interpolate use of interpolation when scaling + * @param pvalue value possibly used for regions outside the image boundaries + */ + inline void scale(const T *pixel, + const unsigned int bits, + const int interpolate, + const Uint16 pvalue) + { + if (pixel != NULL) + { + this->Data = new T[this->getCount()]; + if (this->Data != NULL) + { + const T value = OFstatic_cast(T, OFstatic_cast(double, DicomImageClass::maxval(bits)) * + OFstatic_cast(double, pvalue) / OFstatic_cast(double, DicomImageClass::maxval(WIDTH_OF_PVALUES))); + this->scaleData(&pixel, &this->Data, interpolate, value); + } + } + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diobjcou.h b/dcmimgle/include/dcmtk/dcmimgle/diobjcou.h new file mode 100644 index 00000000..9275f660 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diobjcou.h @@ -0,0 +1,119 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomObjectCounter (Header) + * + */ + + +#ifndef DIOBJCOU_H +#define DIOBJCOU_H + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_THREADS +#include "dcmtk/ofstd/ofthread.h" +#endif + +#include "dcmtk/dcmimgle/didefine.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to count number of instances (objects created from a certain class). + * used to manage more than one reference to an object in a secure way. + */ +class DCMTK_DCMIMGLE_EXPORT DiObjectCounter +{ + + public: + + /** add a reference. + * Increase the internal counter by 1. + */ + inline void addReference() + { +#ifdef WITH_THREADS + theMutex.lock(); +#endif + ++Counter; +#ifdef WITH_THREADS + theMutex.unlock(); +#endif + } + + /** remove a reference. + * Decrease the internal counter by 1 and delete the object only if the counter is zero. + */ + inline void removeReference() + { +#ifdef WITH_THREADS + theMutex.lock(); +#endif + if (--Counter == 0) + { +#ifdef WITH_THREADS + theMutex.unlock(); +#endif + delete this; +#ifdef WITH_THREADS + } else { + theMutex.unlock(); +#endif + } + } + + + protected: + + /** constructor. + * Internal counter is initialized with 1. + */ + DiObjectCounter() + : Counter(1) +#ifdef WITH_THREADS + ,theMutex() +#endif + { + } + + /** destructor + */ + virtual ~DiObjectCounter() + { + } + + + private: + + /// internal counter + unsigned long Counter; + +#ifdef WITH_THREADS + /** if compiled for multi-thread operation, the Mutex protecting + * access to the value of this object. + * @remark this member is only available if DCMTK is compiled with thread + * support enabled. + */ + OFMutex theMutex; +#endif +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diovdat.h b/dcmimgle/include/dcmtk/dcmimgle/diovdat.h new file mode 100644 index 00000000..3b884c93 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diovdat.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlayData (Header) + * + */ + + +#ifndef DIOVDAT_H +#define DIOVDAT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diobjcou.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiOverlay; +class DiOverlayPlane; + + +/*-------------------------------* + * declaration of helper class * + *-------------------------------*/ + +/** Class to handle overlay pixel data + */ +class DCMTK_DCMIMGLE_EXPORT DiOverlayData + : public DiObjectCounter +{ + + friend class DiOverlay; + + public: + + /** constructor + * + ** @param entries number of array entries + * @param count number of valid overlay planes + */ + DiOverlayData(unsigned int entries, + unsigned int count = 0); + + /** destructor + */ + virtual ~DiOverlayData(); + + + private: + + /// number of (valid) overlay planes + unsigned int Count; + /// number of array entries (allocated memory) + unsigned int ArrayEntries; + + /// pointer to an array of planes + DiOverlayPlane **Planes; + /// pointer to overlay data (if scaled, flipped or rotated) + Uint16 *DataBuffer; + + // --- declarations to avoid compiler warnings + + DiOverlayData(const DiOverlayData &); + DiOverlayData &operator=(const DiOverlayData &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diovlay.h b/dcmimgle/include/dcmtk/dcmimgle/diovlay.h new file mode 100644 index 00000000..e0f9c2bb --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diovlay.h @@ -0,0 +1,477 @@ +/* + * + * Copyright (C) 1996-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlay (Header) + * + */ + + +#ifndef DIOVLAY_H +#define DIOVLAY_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/diobjcou.h" +#include "dcmtk/dcmimgle/diovdat.h" +#include "dcmtk/dcmimgle/diovpln.h" +#include "dcmtk/dcmimgle/diutils.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiDocument; + +class DcmOverlayData; +class DcmLongString; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to handle a set of overlay planes + */ +class DCMTK_DCMIMGLE_EXPORT DiOverlay + : public DiObjectCounter +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param alloc bits allocated for image pixel data + * @param stored bits stored for image pixel data + * @param high high bit for image pixel data + */ + DiOverlay(const DiDocument *docu = NULL, + const Uint16 alloc = 0, + const Uint16 stored = 0, + const Uint16 high = 0); + + /** constructor, clip/scale + * + ** @param overlay pointer to reference overlay object + * @param left_pos x-coordinate of new overlay origin (offset for all planes) + * @param top_pos y-coordinate of new overlay origin (offset for all planes) + * @param xfactor scaling factor in x-direction + * @param yfactor scaling factor in y-direction + */ + DiOverlay(const DiOverlay *overlay, + const signed long left_pos, + const signed long top_pos, + const double xfactor, + const double yfactor); + + /** constructor, flip + * + ** @param overlay pointer to reference overlay object + * @param horz flip horizontally if true + * @param vert flip vertically if true + * @param columns width of the surrounding image + * @param rows height of the surrounding image + */ + DiOverlay(const DiOverlay *overlay, + const int horz, + const int vert, + const Uint16 columns, + const Uint16 rows); + + /** constructor, rotate + * + ** @param overlay pointer to reference overlay object + * @param degree angle by which the overlay planes should be rotated + * @param columns width of the surrounding image + * @param rows height of the surrounding image + */ + DiOverlay(const DiOverlay *overlay, + const int degree, + const Uint16 columns, + const Uint16 rows); + + /** destructor + */ + virtual ~DiOverlay(); + + /** check whether specified plane is currently visible (not hidden) + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * + ** @return true if plane is visible, false otherwise + */ + int isPlaneVisible(unsigned int plane); + + /** make specified plane visible + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * + ** @return status, true if successful, false otherwise + */ + int showPlane(unsigned int plane); + + /** make specified plane visible and set parameters + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * @param fore foreground color for overlay plane (in percent: 0.0-1.0) + * @param thresh threshold value for overlay plane (0.0-1.0) + * @param mode new overlay mode (EMO_Default for stored mode) + * + ** @return status, true if successful, false otherwise + */ + int showPlane(unsigned int plane, + const double fore, + const double thresh, + const EM_Overlay mode); + + /** make specified plane visible and set p-value. + * Only applicable for bitmap shutters. + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * @param pvalue p-value to be used for the overlay plane (0..65535) + * + ** @return status, true if successful, false otherwise + */ + int showPlane(unsigned int plane, + const Uint16 pvalue); + + /** make all planes visible + * + ** @return status, true if successful, false otherwise + */ + int showAllPlanes(); + + /** make all planes visible + * + ** @param fore foreground color for overlay planes (in percent: 0.0-1.0) + * @param thresh threshold value for overlay planes (in percent: 0.0-1.0) + * @param mode new overlay mode (EMO_Default for stored mode) + * + ** @return status, true if successful, false otherwise + */ + int showAllPlanes(const double fore, + const double thresh, + const EM_Overlay mode); + + /** make specified plane invisible + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * + ** @return status, true if successful, false otherwise + */ + int hidePlane(unsigned int plane); + + /** make all planes invisible + * + ** @return status, true if successful, false otherwise + */ + int hideAllPlanes(); + + /** move plane to a new place + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * @param left_pos new x-coordinate of the overlay plane origin + * @param top_pos new y-coordinate of the overlay plane origin + * + ** @return status, true if successful, false otherwise + */ + int placePlane(unsigned int plane, + const signed int left_pos, + const signed int top_pos); + + /** get group number of specified plane + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * + ** @return group number (0x6000-0x60ff) if successful, 0 otherwise + */ + unsigned int getPlaneGroupNumber(unsigned int plane) const; + + /** get label of specified plane + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * + ** @return plane label if successful, NULL otherwise + */ + const char *getPlaneLabel(unsigned int plane) const; + + /** get description of specified plane + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * + ** @return plane description if successful, NULL otherwise + */ + const char *getPlaneDescription(unsigned int plane) const; + + /** get overlay mode of specified plane + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * + ** @return overlay mode if successful, EMO_Default otherwise + */ + EM_Overlay getPlaneMode(unsigned int plane) const; + + /** get number of overlay planes + * + ** @return number of overlay planes + */ + inline unsigned int getCount() const + { + return (Data != NULL) ? Data->Count : 0; + } + + /** get current x-coordinate of overlay origin. + * This value is added to the origin of all overlay planes. + * + ** @return x-coordinate of overlay origin + */ + inline signed long getLeft() const + { + return Left; + } + + /** get current y-coordinate of overlay origin. + * This value is added to the origin of all overlay planes. + * + ** @return y-coordinate of overlay origin + */ + inline signed long getTop() const + { + return Top; + } + + /** check whether there are any overlay planes embedded in the pixel data + * + ** @return true if there are embedded planes, false otherwise + */ + int hasEmbeddedData() const; + + /** add plane to list of additional overlay planes + * + ** @param group group number of plane to be added (0x6000-0x60ff). + * If group number already exists in the list of additional planes + * the old one is replaced. If the number exists in the list of + * planes stored in the image dataset the new plane hides it. + * @param left_pos x-coordinate of the plane origin + * @param top_pos y-coordinate of the plane origin + * @param columns width of the overlay plane (in pixels) + * @param rows height of the overlay plane + * @param data element where the plane data is stored + * @param label element where the plane label is stored + * @param description element where the plane description is stored + * @param mode overlay plane mode + * + ** @return status, true if successful, false otherwise + */ + int addPlane(const unsigned int group, + const signed int left_pos, + const signed int top_pos, + const unsigned int columns, + const unsigned int rows, + const DcmOverlayData &data, + const DcmLongString &label, + const DcmLongString &description, + const EM_Overlay mode); + + + /** remove specified plane from list of additional overlay planes + * + ** @param group group number of plane to be removed (0x6000-0x60ff) + * + ** @return status, true if successful, false otherwise + */ + int removePlane(const unsigned int group); + + inline DiOverlayPlane *getPlane(const unsigned int plane) const + { + return ((Data != NULL) && (Data->Planes != NULL) && (plane < Data->Count)) ? Data->Planes[plane] : OFstatic_cast(DiOverlayPlane *, NULL); + } + + /** check whether specified plane exists + * + ** @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * @param visible flag indicating whether plane should be visible or not (default: 0 = ignore) + * + ** @return status, true if such a plane exists, false otherwise + */ + inline int hasPlane(unsigned int plane, + const int visible = 0) const + { + return (convertToPlaneNumber(plane, AdditionalPlanes) > 1) && (!visible || Data->Planes[plane]->isVisible()); + } + + /** get overlay plane data as an array of 1/8/16 bit values. + * Memory isn't handled internally and must therefore be deleted from calling program. + * + ** @param frame number of frame + * @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * @param left_pos get x-coordinate of the plane origin + * @param top_pos get y-coordinate of the plane origin + * @param width get width of the overlay plane (in pixels) + * @param height get height of the overlay plane + * @param mode get overlay plane mode + * @param columns width of the surrounding image + * @param rows height of the surrounding image + * @param bits number of bits (stored) in the resulting array, default: 8 + * @param fore foreground color used for the plane (default: 0xff = white, for 8 bits) + * @param back transparent background color (default: 0x00 = black) + * + ** @return pointer to pixel data if successful, NULL otherwise + */ + void *getPlaneData(const unsigned long frame, + unsigned int plane, + unsigned int &left_pos, + unsigned int &top_pos, + unsigned int &width, + unsigned int &height, + EM_Overlay &mode, + const Uint16 columns, + const Uint16 rows, + const int bits = 8, + const Uint16 fore = 0xff, + const Uint16 back = 0x0); + + /** get overlay plane data as an array of 1/8/16 bit values. + * Memory isn't handled internally and must therefore be deleted from calling program. + * + ** @param frame number of frame + * @param plane index of plane (starting from 0) or group number (0x6000-0x60ff) + * @param width get width of the overlay plane (in pixels) + * @param height get height of the overlay plane + * @param bits number of bits (stored) in the resulting array, default: 8 + * @param fore foreground color used for the plane (default: 0xff = white, for 8 bits) + * @param back transparent background color (default: 0x00 = black) + * + ** @return pointer to pixel data if successful, NULL otherwise + */ + void *getFullPlaneData(const unsigned long frame, + unsigned int plane, + unsigned int &width, + unsigned int &height, + const int bits = 8, + const Uint16 fore = 0xff, + const Uint16 back = 0x0); + + /** create overlay plane data in (6xxx,3000) format. + * (1 bit allocated and stored, foreground color is 1, background color is 0, + * data is 16 bit padded - even length) + * Memory isn't handled internally and must therefore be deleted from calling program. + * + ** @param buffer stores pointer to overlay data (memory is allocated internally) + * @param plane number (0..15) or group number (0x60nn) of overlay plane + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param frames returns number of frames (multiple overlay frames possible!) + * + ** @return number of bytes allocated for the 'buffer' if successful, 0 otherwise + */ + unsigned long create6xxx3000PlaneData(Uint8 *&buffer, + unsigned int plane, + unsigned int &width, + unsigned int &height, + unsigned long &frames); + + /// constant defining the maximum number of overlay planes (16) + static const unsigned int MaxOverlayCount; + /// constant defining the group number of the first overlay plane (0x6000) + static const unsigned int FirstOverlayGroup; + + + protected: + + /** initialize new overlay managing object + * + ** @param overlay reference object used as a template + * + ** @return pointer to a new array of pixel data + */ + Uint16 *Init(const DiOverlay *overlay); + + /** convert given plane or group number to a valid plane number + * + ** @param plane plane or group number to be converted + * @param mode true or false, see return value + * + ** @return status, true if successful, false otherwise. + * (1 = additional plane with the specified group number would be new, + * 2 = additional plane with the specified group number already exists, + * 3 = 'plane' is the number of a valid plane - only if 'mode' us false) + */ + int convertToPlaneNumber(unsigned int &plane, + const int mode) const; + + /** convert five plane number to corresponding group number + * + ** @param plane index of plane (0..15) + * + ** @return group number + */ + unsigned int convertToGroupNumber(const unsigned int plane) const + { + return FirstOverlayGroup + 2 * plane; + } + + /** check whether given group number is valid. + * Valid means that the number is even and between 0x6000 and 0x60ff. + * + ** @param group group number to be checked + * + ** @return status, true if valid, false otherwise + */ + int isValidGroupNumber(const unsigned int group) const; + + /** check whether the specified plane is valid. and determine maximum resolution + * and number of frames which are common for all overlay planes so far. + * + ** @param plane index of plane (0..15) + * @param mode if true the maximum number of frames is determined, otherwise not + * + ** @return status, true if successful, false otherwise + */ + int checkPlane(const unsigned int plane, + const int mode = 1); + + + private: + + /// left offset to all planes + signed long Left; + /// top offset to all planes + signed long Top; + /// maximum width of all planes + Uint16 Width; + /// maximum height of all planes + Uint16 Height; + /// maximum number of frames + unsigned long Frames; + + /// status, if true planes are added later with addPlane() + int AdditionalPlanes; + + /// points to overlay data (provides shared data) + DiOverlayData *Data; + + // --- declarations to avoid compiler warnings + + DiOverlay(const DiOverlay &); + DiOverlay &operator=(const DiOverlay &); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diovlimg.h b/dcmimgle/include/dcmtk/dcmimgle/diovlimg.h new file mode 100644 index 00000000..1f4a8135 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diovlimg.h @@ -0,0 +1,57 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlayImage (Header) + * + */ + + +#ifndef DIOVLIMG_H +#define DIOVLIMG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimo2img.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for standalone overlay images + */ +class DCMTK_DCMIMGLE_EXPORT DiOverlayImage + : public DiMono2Image +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param status current image status + */ + DiOverlayImage(const DiDocument *docu, + const EI_Status status); + + /** destructor + */ + virtual ~DiOverlayImage(); +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diovpln.h b/dcmimgle/include/dcmtk/dcmimgle/diovpln.h new file mode 100644 index 00000000..dcc674ac --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diovpln.h @@ -0,0 +1,561 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlayPlane (Header) + * + */ + + +#ifndef DIOVPLN_H +#define DIOVPLN_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/diutils.h" + +#define INCLUDE_CSTDDEF +#include "dcmtk/ofstd/ofstdinc.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DcmOverlayData; +class DcmLongString; + +class DiDocument; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class to handle a single overlay plane + */ +class DCMTK_DCMIMGLE_EXPORT DiOverlayPlane +{ + + public: + + /** constructor + * + ** @param docu pointer to dataset (encapsulated) + * @param group group number of the overlay plane + * @param alloc value for bits allocated of the surrounding image + * @param stored value for bits stored of the surrounding image + * @param high value for high bit of the surrounding image + */ + DiOverlayPlane(const DiDocument *docu, + const unsigned int group, + Uint16 alloc, + const Uint16 stored, + const Uint16 high); + + /** constructor, additional + * + ** @param group group number of the overlay plane + * @param left_pos x-coordinate of the plane origin + * @param top_pos y-coordinate of the plane origin + * @param columns width of the overlay plane + * @param rows height of the overlay plane + * @param data element containing the plane data + * @param label element containing the plane label + * @param description element containing the plane description + * @param mode overlay plane mode + */ + DiOverlayPlane(const unsigned int group, + const Sint16 left_pos, + const Sint16 top_pos, + const Uint16 columns, + const Uint16 rows, + const DcmOverlayData &data, + const DcmLongString &label, + const DcmLongString &description, + const EM_Overlay mode); + + /** constructor, copy + * + ** @param plane reference overlay plane to be copied + * @param bit position of the plane bit + * @param data pointer to buffer for plane data + * @param temp temporary buffer used to extract plane information + * @param width width of the array where the plane is stored + * @param height height of the array where the plane is stored + * @param columns width of the overlay plane + * @param rows height of the overlay plane + */ + DiOverlayPlane(DiOverlayPlane *plane, + const unsigned int bit, + const Uint16 *data, + Uint16 *temp, + const Uint16 width, + const Uint16 height, + const Uint16 columns, + const Uint16 rows); + + /** destructor + */ + ~DiOverlayPlane(); + + /** get x-coordinate of overlay plane origin + * + ** @param left_pos offset to be subtracted from the actual value (optional) + * + ** @return x-coordinate of overlay plane origin + */ + inline Sint16 getLeft(const Sint32 left_pos = 0) const + { + return OFstatic_cast(Sint16, OFstatic_cast(Sint32, Left) - left_pos); + } + + /** get y-coordinate of overlay plane origin + * + ** @param top_pos offset to be subtracted from the actual value (optional) + * + ** @return y-coordinate of overlay plane origin + */ + inline Sint16 getTop(const Sint32 top_pos = 0) const + { + return OFstatic_cast(Sint16, OFstatic_cast(Sint32, Top) - top_pos); + } + + /** get width of overlay plane + * + ** @return width of overlay plane + */ + inline Uint16 getWidth() const + { + return Width; + } + + /** get height of overlay plane + * + ** @return height of overlay plane + */ + inline Uint16 getHeight() const + { + return Height; + } + + /** get right border of overlay plane origin + * + ** @param left_pos offset to be subtracted from the actual value (optional). + * + ** @return right border of overlay plane origin. Negative values are set to 0. + */ + inline Uint16 getRight(const Sint32 left_pos = 0) const + { + return (OFstatic_cast(Sint32, Left) + OFstatic_cast(Sint32, Width) - left_pos > 0) ? + OFstatic_cast(Uint16, OFstatic_cast(Sint32, Left) + OFstatic_cast(Sint32, Width) - left_pos) : 0; + } + + /** get bottom border of overlay plane origin + * + ** @param top_pos offset to be subtracted from the actual value (optional). + * + ** @return bottom border of overlay plane origin. Negative values are set to 0. + */ + inline Uint16 getBottom(const Sint32 top_pos = 0) const + { + return (OFstatic_cast(Sint32, Top) + OFstatic_cast(Sint32, Height) - top_pos > 0) ? + OFstatic_cast(Uint16, OFstatic_cast(Sint32, Top) + OFstatic_cast(Sint32, Height) - top_pos) : 0; + } + + /** check whether overlay plane is valid + * + ** @return true if plane is valid, false otherwise + */ + inline int isValid() const + { + return Valid; + } + + /** check whether overlay plane is visible + * + ** @return true if plane is visible, false otherwise + */ + inline int isVisible() const + { + return Visible; + } + + /** make overlay plane visible + */ + inline void show() + { + Visible = 1; + } + + /** make overlay plane invisible + */ + inline void hide() + { + Visible = 0; + } + + /** move overlay plane to a new place + * + ** @param left_pos x-coordinate of the new plane origin (maybe negative) + * @param top_pos y-coordinate of the new plane origin (maybe negative) + */ + void place(const signed int left_pos, + const signed int top_pos); + + /** set scaling factor in x- and y-direction + * + ** @param xfactor scaling factor in x-direction + * @param yfactor scaling factor in y-direction + */ + void setScaling(const double xfactor, + const double yfactor); + + /** set flipping + * + ** @param horz flip horizontally if true + * @param vert flip vertically if true + * @param columns width of surrounding image (incl. origin offset) + * @param rows height of surrounding image (incl. origin offset) + */ + void setFlipping(const int horz, + const int vert, + const signed long columns, + const signed long rows); + + /** set rotation + * + ** @param degree angle by which the plane should be rotated + * @param left_pos x-coordinate of the origin for all overlay planes + * @param top_pos y-coordinate of the origin for all overlay planes + * @param columns width of surrounding image (already rotated) + * @param rows height of surrounding image (already rotated) + */ + void setRotation(const int degree, + const signed long left_pos, + const signed long top_pos, + const Uint16 columns, + const Uint16 rows); + + /** make overlay plane visible and set parameters + * + ** @param fore foreground color of the plane (in percent: 0.0-1.0) + * @param thresh threshold value for 'threshold replace' (0.0-1.0) + * @param mode new overlay plane mode (EMO_Default for stored mode) + */ + void show(const double fore, + const double thresh, + const EM_Overlay mode); + + /** make overlay plane visible and set p-value. + * Only applicable for bitmap shutters. + * + ** @param pvalue p-value to be used for the overlay plane (0..65535) + * + ** @return status, true if successful, false otherwise + */ + int show(const Uint16 pvalue); + + /** get number of frames + * + ** @return number of frames + */ + inline unsigned long getNumberOfFrames() const + { + return NumberOfFrames; + } + + /** get foreground color of the plane + * + ** @return foreground color (in percent: 0.0-1.0) + */ + inline double getForeground() const + { + return Foreground; + } + + /** get threshold value of the plane + * + ** @return threshold value (in percent: 0.0-1.0) + */ + inline double getThreshold() const + { + return Threshold; + } + + /** get p-value of the plane. + * Only valid for bitmap shutters. + * + ** @return p-value (0..65535) + */ + inline Uint16 getPValue() const + { + return PValue; + } + + /** get overlay plane mode + * + ** @return overlay plane mode + */ + inline EM_Overlay getMode() const + { + return Mode; + } + + /** check whether overlay plane is embedded in the pixel data + * + ** @return true if plane is embedded, false otherwise + */ + inline int isEmbedded() const + { + return EmbeddedData; + } + + /** get label of overlay plane + * + ** @return label if successful, NULL otherwise + */ + const char *getLabel() const + { + return (Label.empty()) ? OFstatic_cast(const char *, NULL) : Label.c_str(); + } + + /** get description of overlay plane + * + ** @return description if successful, NULL otherwise + */ + const char *getDescription() const + { + return (Description.empty()) ? OFstatic_cast(const char *, NULL) : Description.c_str(); + } + + /** get group number of overlay plane + * + ** @return group number (0x6000-0x60ff) + */ + Uint16 getGroupNumber() const + { + return GroupNumber; + } + + /** get overlay plane data as an array of 1/8/16 bit values. + * Overlay plane is clipped to the area specified by the four min/max coordinates. + * Memory isn't handled internally and must therefore be deleted from calling program. + * + ** @param frame number of frame + * @param xmin x-coordinate of the top left hand corner + * @param ymin y-coordinate of the top left hand corner + * @param xmax x-coordinate of the bottom right hand corner + * @param ymax y-coordinate of the bottom right hand corner + * @param bits number of bits (stored) in the resulting array + * @param fore foreground color used for the plane (0x00-0xff) + * @param back transparent background color (0x00-0xff) + * + ** @return pointer to pixel data if successful, NULL otherwise + */ + void *getData(const unsigned long frame, + const Uint16 xmin, + const Uint16 ymin, + const Uint16 xmax, + const Uint16 ymax, + const int bits, + const Uint16 fore, + const Uint16 back); + + /** create overlay plane data in (6xxx,3000) format. + * (1 bit allocated and stored, foreground color is 1, background color is 0, + * data is 16 bit padded - even length) + * Memory isn't handled internally and must therefore be deleted from calling program. + * + ** @param buffer stores pointer to overlay data (memory is allocated internally) + * @param width returns width of overlay plane (in pixels) + * @param height returns height of overlay plane (in pixels) + * @param frames returns number of frames (multiple overlay frames possible!) + * + ** @return number of bytes allocated for the 'buffer' if successful, 0 otherwise + */ + unsigned long create6xxx3000Data(Uint8 *&buffer, + unsigned int &width, + unsigned int &height, + unsigned long &frames); + + /** reset internal 'cursor' to the beginning of the specified frame + * + ** @param frame number of current frame + * + ** @return status, true if successful, false otherwise + */ + inline int reset(const unsigned long frame); + + /** get value of the current overlay plane bit and move 'cursor' to the next position + * + ** @return true if plane bit is set, false otherwise + */ + inline int getNextBit(); + + /** set internal 'cursor' to a specific position + * + ** @param x new x-coordinate to start from + * @param y new y-coordinate to start from + */ + inline void setStart(const Uint16 x, + const Uint16 y); + + + protected: + + /// number of frames + Uint32 NumberOfFrames; + /// number of starting frame + Uint16 ImageFrameOrigin; + /// first frame to be processed (from DicomImage constructor) + Uint32 FirstFrame; + + /// y-coordinate of overlay plane's origin + Sint16 Top; + /// x-coordinate of overlay plane's origin + Sint16 Left; + /// visible height + Uint16 Height; + /// visible width + Uint16 Width; + /// number of (stored) rows + Uint16 Rows; + /// number of (stored) columns + Uint16 Columns; + /// number of allocated bits per pixel + Uint16 BitsAllocated; + /// position of overlay plane bit + Uint16 BitPosition; + + /// "color" of overlay plane (in percent: '0.0' = dark, '1.0' = bright) + double Foreground; + /// threshold value used for "threshold replace" + double Threshold; + /// P-value used for bitmap shutters + Uint16 PValue; + + /// current overlay mode + EM_Overlay Mode; + /// default (stored) overlay mode + EM_Overlay DefaultMode; + + /// label of overlay plane + OFString Label; + /// textual description of overlay plane + OFString Description; + + /// group number of overlay plane + Uint16 GroupNumber; + + /// validity status + int Valid; + /// visibility status + int Visible; + + + private: + + /// current bit position + unsigned long BitPos; + /// starting bit position of current frame + unsigned long StartBitPos; + + /// x-coordinate of first pixel in surrounding memory buffer + unsigned int StartLeft; + /// y-coordinate of first pixel in surrounding memory buffer + unsigned int StartTop; + + /// true, if overlay data in embedded in pixel data + int EmbeddedData; + + /// pointer to current element of 'Data' + const Uint16 *Ptr; + /// pointer to starting element of current frame + const Uint16 *StartPtr; + /// pointer to overlay data (standalone) or pixel data (embedded) + const Uint16 *Data; + + // --- declarations to avoid compiler warnings + + DiOverlayPlane(const DiOverlayPlane &); + DiOverlayPlane &operator=(const DiOverlayPlane &); +}; + + +/********************************************************************/ + + +inline int DiOverlayPlane::reset(const unsigned long frame) +{ + int result = 0; + if (Valid && (Data != NULL)) + { + const Uint32 frameNumber = OFstatic_cast(Uint32, FirstFrame + frame); + DCMIMGLE_TRACE("reset overlay plane in group 0x" << STD_NAMESPACE hex << GroupNumber << " to start position"); + DCMIMGLE_TRACE(" frameNumber: " << frameNumber << " (" << FirstFrame << "+" << frame + << "), ImageFrameOrigin: " << ImageFrameOrigin << ", NumberOfFrames: " << NumberOfFrames); + if ((frameNumber >= ImageFrameOrigin) && (frameNumber < ImageFrameOrigin + NumberOfFrames)) + { + const unsigned long bits = (OFstatic_cast(unsigned long, StartLeft) + OFstatic_cast(unsigned long, StartTop) * + OFstatic_cast(unsigned long, Columns) + (frameNumber - ImageFrameOrigin) * OFstatic_cast(unsigned long, Rows) * + OFstatic_cast(unsigned long, Columns)) * OFstatic_cast(unsigned long, BitsAllocated); + StartBitPos = BitPos = OFstatic_cast(unsigned long, BitPosition) + bits; + DCMIMGLE_TRACE(" StartLeft: " << StartLeft << ", StartTop: " << StartTop << ", Columns: " << Columns << ", Rows: " << Rows); + DCMIMGLE_TRACE(" StartBitPos: " << StartBitPos << ", BitPosition: " << BitPosition << ", BitsAllocated: " << BitsAllocated << ", bits: " << bits); + /* distinguish between embedded and separate overlay data */ + if (BitsAllocated == 16) + StartPtr = Ptr = Data + (bits >> 4); + else + StartPtr = Data; + result = (getRight() > 0) && (getBottom() > 0); + } else + DCMIMGLE_TRACE(" -> overlay plane does not apply to this frame"); + } + return result; +} + + +inline int DiOverlayPlane::getNextBit() +{ + int result; + if (BitsAllocated == 16) // optimization + result = OFstatic_cast(int, *(Ptr++) & (1 << BitPosition)); + else + { + Ptr = StartPtr + (BitPos >> 4); // div 16 + result = OFstatic_cast(int, *Ptr & (1 << (BitPos & 0xf))); // mod 16 + BitPos += BitsAllocated; // next bit + } + return result; +} + + +inline void DiOverlayPlane::setStart(const Uint16 x, + const Uint16 y) +{ + if (BitsAllocated == 16) + Ptr = StartPtr + OFstatic_cast(unsigned long, y - Top) * OFstatic_cast(unsigned long, Columns) + + OFstatic_cast(unsigned long, x - Left); + else + BitPos = StartBitPos + (OFstatic_cast(unsigned long, y - Top) * OFstatic_cast(unsigned long, Columns) + + OFstatic_cast(unsigned long, x - Left)) * OFstatic_cast(unsigned long, BitsAllocated); +} + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dipixel.h b/dcmimgle/include/dcmtk/dcmimgle/dipixel.h new file mode 100644 index 00000000..7439e9ba --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dipixel.h @@ -0,0 +1,122 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomPixel (Header) + * + */ + + +#ifndef DIPIXEL_H +#define DIPIXEL_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diutils.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Abstract base class to handle pixel data + */ +class DCMTK_DCMIMGLE_EXPORT DiPixel +{ + + public: + + /** constructor + * + ** @param count number of pixels stored in the buffer + * @param inputCount number of pixels read from 'PixelData' attribute + */ + DiPixel(const unsigned long count, + const unsigned long inputCount = 0) + : Count(count), + InputCount(inputCount) + { + } + + /** destructor + */ + virtual ~DiPixel() + { + } + + /** get integer representation (abstract) + * + ** @return integer representation of the internally stored pixel data + */ + virtual EP_Representation getRepresentation() const = 0; + + /** get number of planes (abstract). + * + ** @return number of planes (e.g. 1 for monochrome and 3 for color images) + */ + virtual int getPlanes() const = 0; + + /** get pointer to pixel data (abstract). + * NB: See implemented method in derived class for details. + * + ** @return pointer to pixel data + */ + virtual const void *getData() const = 0; + + /** get pointer to pixel data (abstract). + * NB: See implemented method in derived class for details. + * + ** @return pointer to pixel data + */ + virtual void *getDataPtr() = 0; + + /** get pointer to array of pixel data (abstract). + * The number of planes in the returned array can be determined using 'getPlanes()'. + * + ** @return pointer to array of pixel data + */ + virtual void *getDataArrayPtr() = 0; + + /** get number of pixels + * + ** @return number of pixels + */ + inline unsigned long getCount() const + { + return Count; + } + + /** get number of pixels stored in the 'PixelData' element + * + ** @return number pixels read from the input buffer + */ + inline unsigned long getInputCount() const + { + return InputCount; + } + + + protected: + + /// number of pixels + /*const*/ unsigned long Count; + + /// number of pixels in the input buffer + unsigned long InputCount; +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diplugin.h b/dcmimgle/include/dcmtk/dcmimgle/diplugin.h new file mode 100644 index 00000000..a68dfd53 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diplugin.h @@ -0,0 +1,77 @@ +/* + * + * Copyright (C) 2001-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: Provides abstract interface to plugable image output formats + * + */ + + +#ifndef DIPLUGIN_H +#define DIPLUGIN_H + +#include "dcmtk/config/osconfig.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiImage; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** abstract interface to plugable image output formats. + * This is an abstract base class used as an interface to support multiple + * plugable image output formats for the dcmimle/dcmimage library. An example + * implementation can be found in dcmjpeg/libsrc/dipijpeg.cc (JPEG plugin). + */ +class DCMTK_DCMIMGLE_EXPORT DiPluginFormat +{ + + public: + + /** destructor (virtual) + */ + virtual ~DiPluginFormat() {} + + /** write given image to a file stream (abstract) + * + ** @param image pointer to DICOM image object to be written + * @param stream stream to which the image is written (open in binary mode!) + * @param frame index of frame used for output (default: first frame = 0) + * + ** @return true if successful, false otherwise + */ + virtual int write(DiImage *image, + FILE *stream, + const unsigned long frame = 0) const = 0; + + protected: + + /** constructor (protected) + */ + DiPluginFormat() {} +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dipxrept.h b/dcmimgle/include/dcmtk/dcmimgle/dipxrept.h new file mode 100644 index 00000000..ae7db613 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dipxrept.h @@ -0,0 +1,161 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomPixelRepresentationTemplate (Header) + * + */ + + +#ifndef DIPXREPT_H +#define DIPXREPT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diutils.h" + +#ifndef DCMTK_EXPLICIT_SPECIALIZATION +#ifdef HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION +#define DCMTK_EXPLICIT_SPECIALIZATION template<> +#else +#define DCMTK_EXPLICIT_SPECIALIZATION +#endif +#endif + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to determine pixel representation. + * Size of basic structure, sign-extension + */ +template +class DiPixelRepresentationTemplate +{ + + public: + + /// default constructor + DiPixelRepresentationTemplate() {} + + /// destructor + virtual ~DiPixelRepresentationTemplate() {} + + /** check whether template type T is signed or not + * + ** @return true if signed, false otherwise + */ + inline int isSigned() const; + + protected: + + /** determine integer representation for template type T + * + ** @return integer representation + */ + virtual inline EP_Representation getRepresentation() const; +}; + + +/********************************************************************/ + + +DCMTK_EXPLICIT_SPECIALIZATION +inline EP_Representation DiPixelRepresentationTemplate::getRepresentation() const +{ + return EPR_Uint8; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline EP_Representation DiPixelRepresentationTemplate::getRepresentation() const +{ + return EPR_Sint8; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline EP_Representation DiPixelRepresentationTemplate::getRepresentation() const +{ + return EPR_Uint16; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline EP_Representation DiPixelRepresentationTemplate::getRepresentation() const +{ + return EPR_Sint16; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline EP_Representation DiPixelRepresentationTemplate::getRepresentation() const +{ + return EPR_Uint32; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline EP_Representation DiPixelRepresentationTemplate::getRepresentation() const +{ + return EPR_Sint32; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline int DiPixelRepresentationTemplate::isSigned() const +{ + return 0; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline int DiPixelRepresentationTemplate::isSigned() const +{ + return 0; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline int DiPixelRepresentationTemplate::isSigned() const +{ + return 0; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline int DiPixelRepresentationTemplate::isSigned() const +{ + return 1; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline int DiPixelRepresentationTemplate::isSigned() const +{ + return 1; +} + + +DCMTK_EXPLICIT_SPECIALIZATION +inline int DiPixelRepresentationTemplate::isSigned() const +{ + return 1; +} + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diregbas.h b/dcmimgle/include/dcmtk/dcmimgle/diregbas.h new file mode 100644 index 00000000..a957331e --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diregbas.h @@ -0,0 +1,96 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomRegisterBase (Header) + * + */ + + +#ifndef DIREGBAS_H +#define DIREGBAS_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diutils.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiImage; +class DiColorImage; +class DiMonoPixel; +class DiDocument; +class DiRegisterBase; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Abstract base class to register additional libraries + */ +class DCMTK_DCMIMGLE_EXPORT DiRegisterBase +{ + + public: + + /** constructor, default + */ + DiRegisterBase() + { + } + + /** destructor + */ + virtual ~DiRegisterBase() + { + } + + /** create color image representation (abstract) + * + ** @param docu pointer to dataset (encapsulated) + * @param status image status + * @param photo photometric interpretation + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiImage *createImage(const DiDocument *docu, + const EI_Status status, + const EP_Interpretation photo) = 0; + + /** create monochrome pixel data of color image (abstract) + * + ** @param image pointer to color image + * @param red coefficient by which the red component is weighted + * @param green coefficient by which the green component is weighted + * @param blue coefficient by which the blue component is weighted + * + ** @return pointer to new DiImage object (NULL if an error occurred) + */ + virtual DiMonoPixel *createMonoImageData(const DiColorImage *image, + const double red, + const double green, + const double blue) = 0; + + /// global pointer to registered 'dcmimage' library + static DiRegisterBase *Pointer; +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/dirotat.h b/dcmimgle/include/dcmtk/dcmimgle/dirotat.h new file mode 100644 index 00000000..c6ea743b --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/dirotat.h @@ -0,0 +1,347 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomRotateTemplate (Header) + * + */ + + +#ifndef DIROTAT_H +#define DIROTAT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/dipixel.h" +#include "dcmtk/dcmimgle/ditranst.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to rotate images (on pixel data level). + * by steps of 90 degrees + */ +template +class DiRotateTemplate + : public DiTransTemplate +{ + + public: + + /** constructor. + * This method is used to rotate an image and store the result in the same storage area. + * + ** @param pixel pointer to object where the pixel data are stored + * @param src_cols original width of the image + * @param src_rows original height of the image + * @param dest_cols new width of the image + * @param dest_rows new height of the image + * @param frames number of frames + * @param degree angle by which the image should be rotated + */ + DiRotateTemplate(DiPixel *pixel, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const Uint32 frames, + const int degree) + : DiTransTemplate(0, src_cols, src_rows, dest_cols, dest_rows, frames) + { + if (pixel != NULL) + { + this->Planes = pixel->getPlanes(); + if ((pixel->getCount() > 0) && (this->Planes > 0) && + (pixel->getCount() == OFstatic_cast(unsigned long, src_cols) * OFstatic_cast(unsigned long, src_rows) * frames)) + { + if (degree == 90) + rotateRight(OFstatic_cast(T **, pixel->getDataArrayPtr())); + else if (degree == 180) + rotateTopDown(OFstatic_cast(T **, pixel->getDataArrayPtr())); + else if (degree == 270) + rotateLeft(OFstatic_cast(T **, pixel->getDataArrayPtr())); + } else { + DCMIMGLE_WARN("could not rotate image ... corrupted data"); + } + } + } + + /** constructor. + * This method is used to perform only the preparation and to start rotation later with method 'rotateData()' + * + ** @param planes number of planes (1 or 3) + * @param src_cols original width of the image + * @param src_rows original height of the image + * @param dest_cols new width of the image + * @param dest_rows new height of the image + * @param frames number of frames + */ + DiRotateTemplate(const int planes, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const Uint32 frames) + : DiTransTemplate(planes, src_cols, src_rows, dest_cols, dest_rows, frames) + { + } + + /** destructor + */ + virtual ~DiRotateTemplate() + { + } + + /** choose algorithm depending on rotation angle + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + * @param degree angle by which the image should be rotated + */ + inline void rotateData(const T *src[], + T *dest[], + const int degree) + { + if (degree == 90) + rotateRight(src, dest); + else if (degree == 180) + rotateTopDown(src, dest); + else if (degree == 270) + rotateLeft(src, dest); + else + this->copyPixel(src, dest); + } + + + protected: + + /** rotate source image left and store result in destination image + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + inline void rotateLeft(const T *src[], + T *dest[]) + { + if ((src != NULL) && (dest != NULL)) + { + Uint16 x; + Uint16 y; + const T *p; + T *q; + T *r; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + p = src[j]; + r = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + r += count; + for (x = this->Dest_X; x != 0; --x) + { + q = r - x; + for (y = this->Dest_Y; y != 0; --y) + { + *q = *p++; + q -= this->Dest_X; + } + } + } + } + } + } + + /** rotate source image right and store result in destination image + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + inline void rotateRight(const T *src[], + T *dest[]) + { + if ((src != NULL) && (dest != NULL)) + { + Uint16 x; + Uint16 y; + const T *p; + T *q; + T *r; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + p = src[j]; + r = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + for (x = this->Dest_X; x != 0; --x) + { + q = r + x - 1; + for (y = this->Dest_Y; y != 0; --y) + { + *q = *p++; + q += this->Dest_X; + } + } + r += count; + } + } + } + } + + /** rotate source image top-down and store result in destination image + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + inline void rotateTopDown(const T *src[], + T *dest[]) + { + if ((src != NULL) && (dest != NULL)) + { + unsigned long i; + const T *p; + T *q; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + p = src[j]; + q = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + q += count; + for (i = count; i != 0; --i) + *--q = *p++; + q += count; + } + } + } + } + + private: + + /** rotate image left and store result in the same storage area + * + ** @param data array of pointers to source/destination image pixels + */ + inline void rotateLeft(T *data[]) + { + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + T *temp = new T[count]; + if (temp != NULL) + { + Uint16 x; + Uint16 y; + const T *p; + T *q; + T *r; + for (int j = 0; j < this->Planes; ++j) + { + r = data[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + OFBitmanipTemplate::copyMem(OFstatic_cast(const T *, r), temp, count); // create temporary copy of current frame + p = temp; + r += count; + for (x = this->Dest_X; x != 0; --x) + { + q = r - x; + for (y = this->Dest_Y; y != 0; --y) + { + *q = *p++; + q -= this->Dest_X; + } + } + } + } + delete[] temp; + } + } + + /** rotate image right and store result in the same storage area + * + ** @param data array of pointers to source/destination image pixels + */ + inline void rotateRight(T *data[]) + { + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + T *temp = new T[count]; + if (temp != NULL) + { + Uint16 x; + Uint16 y; + const T *p; + T *q; + T *r; + for (int j = 0; j < this->Planes; ++j) + { + r = data[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + OFBitmanipTemplate::copyMem(OFstatic_cast(const T *, r), temp, count); // create temporary copy of current frame + p = temp; + for (x = this->Dest_X; x != 0; --x) + { + q = r + x - 1; + for (y = this->Dest_Y; y != 0; --y) + { + *q = *p++; + q += this->Dest_X; + } + } + r += count; + } + } + delete[] temp; + } + } + + /** rotate image top-down and store result in the same storage area + * + ** @param data array of pointers to source/destination image pixels + */ + inline void rotateTopDown(T *data[]) + { + unsigned long i; + T *p; + T *q; + T t; + T *s; + const unsigned long count = OFstatic_cast(unsigned long, this->Dest_X) * OFstatic_cast(unsigned long, this->Dest_Y); + for (int j = 0; j < this->Planes; ++j) + { + s = data[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + p = s; + q = s + count; + for (i = count / 2; i != 0; --i) + { + t = *p; + *p++ = *--q; + *q = t; + } + s += count; + } + } + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/discalet.h b/dcmimgle/include/dcmtk/dcmimgle/discalet.h new file mode 100644 index 00000000..3611ffdc --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/discalet.h @@ -0,0 +1,1239 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomScaleTemplates (Header) + * + */ + + +#ifndef DISCALET_H +#define DISCALET_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/ditranst.h" +#include "dcmtk/dcmimgle/dipxrept.h" + + +/*---------------------* + * macro definitions * + *---------------------*/ + +#define SCALE_FACTOR 4096 +#define HALFSCALE_FACTOR 2048 + + +/*--------------------* + * helper functions * + *--------------------*/ + +// help function to set scaling values +static inline void setScaleValues(Uint16 data[], + const Uint16 min, + const Uint16 max) +{ + Uint16 remainder = max % min; + Uint16 step0 = max / min; + Uint16 step1 = max / min; + if (remainder > OFstatic_cast(Uint16, min / 2)) + { + remainder = min - remainder; + ++step0; + } else + ++step1; + const double count = OFstatic_cast(double, min) / (OFstatic_cast(double, remainder) + 1); + Uint16 i; + double c = count; + for (i = 0; i < min; ++i) + { + if ((i >= OFstatic_cast(Uint16, c)) && (remainder > 0)) + { + --remainder; + c += count; + data[i] = step1; + } + else + data[i] = step0; + } +} + +// cubic value interpolation using Catmull-Rom formula. +// the interpolated pixel lies between the second and the third original pixels +static inline double cubicValue(const double v1, + const double v2, + const double v3, + const double v4, + const double dD, + const double minVal, + const double maxVal) +{ + double dVal = 0.5 * ((((-v1 + 3 * v2 - 3 * v3 + v4) * dD + (2 * v1 - 5 * v2 + 4 * v3 - v4)) * dD + (-v1 + v3)) * dD + (v2 + v2)); + return (dVal < minVal) ? minVal : ((dVal > maxVal) ? maxVal : dVal); +} + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to scale images (on pixel data level). + * with and without interpolation + */ +template +class DiScaleTemplate + : public DiTransTemplate +{ + + public: + + /** constructor, scale clipping area. + * + ** @param planes number of planes (1 or 3) + * @param columns width of source image + * @param rows height of source image + * @param left_pos left coordinate of clipping area + * @param top_pos top coordinate of clipping area + * @param src_cols width of clipping area + * @param src_rows height of clipping area + * @param dest_cols width of destination image (scaled image) + * @param dest_rows height of destination image + * @param frames number of frames + * @param bits number of bits per plane/pixel + */ + DiScaleTemplate(const int planes, + const Uint16 columns, /* resolution of source image */ + const Uint16 rows, + const signed long left_pos, /* origin of clipping area */ + const signed long top_pos, + const Uint16 src_cols, /* extension of clipping area */ + const Uint16 src_rows, + const Uint16 dest_cols, /* extension of destination image */ + const Uint16 dest_rows, + const Uint32 frames, /* number of frames */ + const int bits = 0) + : DiTransTemplate(planes, src_cols, src_rows, dest_cols, dest_rows, frames, bits), + Left(left_pos), + Top(top_pos), + Columns(columns), + Rows(rows) + { + } + + /** constructor, scale whole image. + * + ** @param planes number of planes (1 or 3) + * @param src_cols width of source image + * @param src_rows height of source image + * @param dest_cols width of destination image (scaled image) + * @param dest_rows height of destination image + * @param frames number of frames + * @param bits number of bits per plane/pixel + */ + DiScaleTemplate(const int planes, + const Uint16 src_cols, /* resolution of source image */ + const Uint16 src_rows, + const Uint16 dest_cols, /* resolution of destination image */ + const Uint16 dest_rows, + const Uint32 frames, /* number of frames */ + const int bits = 0) + : DiTransTemplate(planes, src_cols, src_rows, dest_cols, dest_rows, frames, bits), + Left(0), + Top(0), + Columns(src_cols), + Rows(src_rows) + { + } + + /** destructor + */ + virtual ~DiScaleTemplate() + { + } + + /** check whether template type T is signed or not + * + ** @return true if signed, false otherwise + */ + inline int isSigned() const + { + const DiPixelRepresentationTemplate rep; + return rep.isSigned(); + } + + /** choose scaling/clipping algorithm depending on specified parameters. + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + * @param interpolate preferred interpolation algorithm (0 = no interpolation, 1 = pbmplus algorithm, + * 2 = c't algorithm, 3 = bilinear magnification, 4 = bicubic magnification) + * @param value value to be set outside the image boundaries (used for clipping, default: 0) + */ + void scaleData(const T *src[], + T *dest[], + const int interpolate, + const T value = 0) + { + if ((src != NULL) && (dest != NULL)) + { + DCMIMGLE_TRACE("Col/Rows: " << Columns << " " << Rows << OFendl + << "Left/Top: " << Left << " " << Top << OFendl + << "Src X/Y: " << this->Src_X << " " << this->Src_Y << OFendl + << "Dest X/Y: " << this->Dest_X << " " << this->Dest_Y); + if ((Left + OFstatic_cast(signed long, this->Src_X) <= 0) || (Top + OFstatic_cast(signed long, this->Src_Y) <= 0) || + (Left >= OFstatic_cast(signed long, Columns)) || (Top >= OFstatic_cast(signed long, Rows))) + { // no image to be displayed + DCMIMGLE_DEBUG("clipping area is fully outside the image boundaries"); + this->fillPixel(dest, value); // ... fill bitmap + } + else if ((this->Src_X == this->Dest_X) && (this->Src_Y == this->Dest_Y)) // no scaling + { + if ((Left == 0) && (Top == 0) && (Columns == this->Src_X) && (Rows == this->Src_Y)) + this->copyPixel(src, dest); // copying + else if ((Left >= 0) && (OFstatic_cast(Uint16, Left + this->Src_X) <= Columns) && + (Top >= 0) && (OFstatic_cast(Uint16, Top + this->Src_Y) <= Rows)) + clipPixel(src, dest); // clipping + else + clipBorderPixel(src, dest, value); // clipping (with border) + } + else if ((interpolate == 1) && (this->Bits <= MAX_INTERPOLATION_BITS)) + interpolatePixel(src, dest); // interpolation (pbmplus) + else if ((interpolate == 4) && (this->Dest_X >= this->Src_X) && (this->Dest_Y >= this->Src_Y) && + (this->Src_X >= 3) && (this->Src_Y >= 3)) + bicubicPixel(src, dest); // bicubic magnification + else if ((interpolate >= 3) && (this->Dest_X >= this->Src_X) && (this->Dest_Y >= this->Src_Y) && + (this->Src_X >= 2) && (this->Src_Y >= 2)) + bilinearPixel(src, dest); // bilinear magnification + else if ((interpolate >= 1) && (this->Dest_X >= this->Src_X) && (this->Dest_Y >= this->Src_Y)) + expandPixel(src, dest); // interpolated expansion (c't) + else if ((interpolate >= 1) && (this->Src_X >= this->Dest_X) && (this->Src_Y >= this->Dest_Y)) + reducePixel(src, dest); // interpolated reduction (c't) + else if ((interpolate >= 1) && (this->Bits <= MAX_INTERPOLATION_BITS)) + interpolatePixel(src, dest); // interpolation (pbmplus), fallback + else if ((this->Dest_X % this->Src_X == 0) && (this->Dest_Y % this->Src_Y == 0)) + replicatePixel(src, dest); // replication + else if ((this->Src_X % this->Dest_X == 0) && (this->Src_Y % this->Dest_Y == 0)) + suppressPixel(src, dest); // suppression + else + scalePixel(src, dest); // general scaling + } + } + + protected: + + /// left coordinate of clipping area + const signed long Left; + /// top coordinate of clipping area + const signed long Top; + /// width of source image + const Uint16 Columns; + /// height of source image + const Uint16 Rows; + + + private: + + /** clip image to specified area (only inside image boundaries). + * This is an optimization of the more general method clipBorderPixel(). + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void clipPixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using clip image to specified area algorithm"); + const unsigned long x_feed = Columns - this->Src_X; + const unsigned long y_feed = OFstatic_cast(unsigned long, Rows - this->Src_Y) * OFstatic_cast(unsigned long, Columns); + Uint16 x; + Uint16 y; + const T *p; + T *q; + for (int j = 0; j < this->Planes; ++j) + { + p = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + q = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + for (y = this->Dest_Y; y != 0; --y) + { + for (x = this->Dest_X; x != 0; --x) + *(q++) = *(p++); + p += x_feed; + } + p += y_feed; + } + } + } + + /** clip image to specified area and add a border if necessary + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + * @param value value to be set outside the image boundaries + */ + void clipBorderPixel(const T *src[], + T *dest[], + const T value) + { + DCMIMGLE_DEBUG("using clip image to specified area and add border algorithm"); + const Uint16 s_left = (Left > 0) ? OFstatic_cast(Uint16, Left) : 0; + const Uint16 s_top = (Top > 0) ? OFstatic_cast(Uint16, Top) : 0; + const Uint16 d_left = (Left < 0 ? OFstatic_cast(Uint16, -Left) : 0); + const Uint16 d_top = (Top < 0) ? OFstatic_cast(Uint16, -Top) : 0; + const Uint16 d_right = (OFstatic_cast(unsigned long, this->Src_X) + OFstatic_cast(unsigned long, s_left) < + OFstatic_cast(unsigned long, Columns) + OFstatic_cast(unsigned long, d_left)) ? + (this->Src_X - 1) : (Columns + d_left - s_left - 1); + const Uint16 d_bottom = (OFstatic_cast(unsigned long, this->Src_Y) + OFstatic_cast(unsigned long, s_top) < + OFstatic_cast(unsigned long, Rows) + OFstatic_cast(unsigned long, d_top)) ? + (this->Src_Y - 1) : (Rows + d_top - s_top - 1); + const Uint16 x_count = d_right - d_left + 1; + const Uint16 y_count = d_bottom - d_top + 1; + const unsigned long s_start = OFstatic_cast(unsigned long, s_top) * OFstatic_cast(unsigned long, Columns) + s_left; + const unsigned long x_feed = Columns - x_count; + const unsigned long y_feed = OFstatic_cast(unsigned long, Rows - y_count) * Columns; + const unsigned long t_feed = OFstatic_cast(unsigned long, d_top) * OFstatic_cast(unsigned long, this->Src_X); + const unsigned long b_feed = OFstatic_cast(unsigned long, this->Src_Y - d_bottom - 1) * OFstatic_cast(unsigned long, this->Src_X); + + /* + * The approach is to divide the destination image in up to four areas outside the source image + * plus one area for the source image. The for and while loops are scanning linearly over the + * destination image and setting the appropriate value depending on the current area. This is + * different from most of the other algorithms in this toolkit where the source image is scanned + * linearly. + */ + Uint16 x; + Uint16 y; + unsigned long i; + const T *p; + T *q; + for (int j = 0; j < this->Planes; ++j) + { + p = src[j] + s_start; + q = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + for (i = t_feed; i != 0; --i) // top + *(q++) = value; + for (y = y_count; y != 0; --y) // middle part: + { + x = 0; + while (x < d_left) // - left + { + *(q++) = value; + ++x; + } + while (x <= d_right) // - middle + { + *(q++) = *(p++); + ++x; + } + while (x < this->Src_X) // - right + { + *(q++) = value; + ++x; + } + p += x_feed; + } + for (i = b_feed; i != 0; --i) // bottom + *(q++) = value; + p += y_feed; + } + } + } + + /** enlarge image by an integer factor. + * Pixels are replicated independently in both directions. + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void replicatePixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using replicate pixel scaling algorithm without interpolation"); + const Uint16 x_factor = this->Dest_X / this->Src_X; + const Uint16 y_factor = this->Dest_Y / this->Src_Y; + const unsigned long x_feed = Columns; + const unsigned long y_feed = OFstatic_cast(unsigned long, Rows - this->Src_Y) * OFstatic_cast(unsigned long, Columns); + const T *sp; + Uint16 x; + Uint16 y; + Uint16 dx; + Uint16 dy; + const T *p; + T *q; + T value; + for (int j = 0; j < this->Planes; ++j) + { + sp = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + q = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + for (y = this->Src_Y; y != 0; --y) + { + for (dy = y_factor; dy != 0; --dy) + { + for (x = this->Src_X, p = sp; x != 0; --x) + { + value = *(p++); + for (dx = x_factor; dx != 0; --dx) + *(q++) = value; + } + } + sp += x_feed; + } + sp += y_feed; + } + } + } + + /** shrink image by an integer divisor. + * Pixels are suppressed independently in both directions. + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void suppressPixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using suppress pixel scaling algorithm without interpolation"); + const unsigned int x_divisor = this->Src_X / this->Dest_X; + const unsigned long x_feed = OFstatic_cast(unsigned long, this->Src_Y / this->Dest_Y) * OFstatic_cast(unsigned long, Columns) - this->Src_X; + const unsigned long y_feed = OFstatic_cast(unsigned long, Rows - this->Src_Y) * OFstatic_cast(unsigned long, Columns); + Uint16 x; + Uint16 y; + const T *p; + T *q; + for (int j = 0; j < this->Planes; ++j) + { + p = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + q = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + for (y = this->Dest_Y; y != 0; --y) + { + for (x = this->Dest_X; x != 0; --x) + { + *(q++) = *p; + p += x_divisor; + } + p += x_feed; + } + p += y_feed; + } + } + } + + /** free scaling method without interpolation. + * This algorithm is necessary for overlays (1 bpp). + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void scalePixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using free scaling algorithm without interpolation"); + const Uint16 xmin = (this->Dest_X < this->Src_X) ? this->Dest_X : this->Src_X; // minimum width + const Uint16 ymin = (this->Dest_Y < this->Src_Y) ? this->Dest_Y : this->Src_Y; // minimum height + Uint16 *x_step = new Uint16[xmin]; + Uint16 *y_step = new Uint16[ymin]; + Uint16 *x_fact = new Uint16[xmin]; + Uint16 *y_fact = new Uint16[ymin]; + + /* + * Approach: If one pixel line has to be added or removed it is taken from the middle of the image (1/2). + * For two lines it is at 1/3 and 2/3 of the image and so on. It sounds easy but it was a hard job ;-) + */ + + if ((x_step != NULL) && (y_step != NULL) && (x_fact != NULL) && (y_fact != NULL)) + { + Uint16 x; + Uint16 y; + if (this->Dest_X < this->Src_X) + setScaleValues(x_step, this->Dest_X, this->Src_X); + else if (this->Dest_X > this->Src_X) + setScaleValues(x_fact, this->Src_X, this->Dest_X); + if (this->Dest_X <= this->Src_X) + OFBitmanipTemplate::setMem(x_fact, 1, xmin); // initialize with default values + if (this->Dest_X >= this->Src_X) + OFBitmanipTemplate::setMem(x_step, 1, xmin); // initialize with default values + x_step[xmin - 1] += Columns - this->Src_X; // skip to next line + if (this->Dest_Y < this->Src_Y) + setScaleValues(y_step, this->Dest_Y, this->Src_Y); + else if (this->Dest_Y > this->Src_Y) + setScaleValues(y_fact, this->Src_Y, this->Dest_Y); + if (this->Dest_Y <= this->Src_Y) + OFBitmanipTemplate::setMem(y_fact, 1, ymin); // initialize with default values + if (this->Dest_Y >= this->Src_Y) + OFBitmanipTemplate::setMem(y_step, 1, ymin); // initialize with default values + y_step[ymin - 1] += Rows - this->Src_Y; // skip to next frame + const T *sp; + Uint16 dx; + Uint16 dy; + const T *p; + T *q; + T value; + for (int j = 0; j < this->Planes; ++j) + { + sp = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + q = dest[j]; + for (unsigned long f = 0; f < this->Frames; ++f) + { + for (y = 0; y < ymin; ++y) + { + for (dy = 0; dy < y_fact[y]; ++dy) + { + for (x = 0, p = sp; x < xmin; ++x) + { + value = *p; + for (dx = 0; dx < x_fact[x]; ++dx) + *(q++) = value; + p += x_step[x]; + } + } + sp += OFstatic_cast(unsigned long, y_step[y]) * OFstatic_cast(unsigned long, Columns); + } + } + } + } + delete[] x_step; + delete[] y_step; + delete[] x_fact; + delete[] y_fact; + } + + + /** free scaling method with interpolation + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void interpolatePixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using scaling algorithm with interpolation from pbmplus toolkit"); + if ((this->Src_X != Columns) || (this->Src_Y != Rows)) + { + DCMIMGLE_ERROR("interpolated scaling and clipping at the same time not implemented ... ignoring clipping region"); + this->Src_X = Columns; // temporarily removed 'const' for 'Src_X' in class 'DiTransTemplate' + this->Src_Y = Rows; // ... 'Src_Y' ... + } + + /* + * based on scaling algorithm from "Extended Portable Bitmap Toolkit" (pbmplus10dec91) + * (adapted to be used with signed pixel representation, inverse images - mono1, + * various bit depths, multi-frame and multi-plane/color images) + */ + + Uint16 x; + Uint16 y; + const T *p; + T *q; + const T *sp = NULL; // initialization avoids compiler warning + const T *fp; + T *sq; + + const unsigned long sxscale = OFstatic_cast(unsigned long, (OFstatic_cast(double, this->Dest_X) / OFstatic_cast(double, this->Src_X)) * SCALE_FACTOR); + const unsigned long syscale = OFstatic_cast(unsigned long, (OFstatic_cast(double, this->Dest_Y) / OFstatic_cast(double, this->Src_Y)) * SCALE_FACTOR); + const signed long maxvalue = DicomImageClass::maxval(this->Bits - isSigned()); + + T *xtemp = new T[this->Src_X]; + signed long *xvalue = new signed long[this->Src_X]; + + if ((xtemp == NULL) || (xvalue == NULL)) + { + DCMIMGLE_ERROR("can't allocate temporary buffers for interpolation scaling"); + this->clearPixel(dest); + } else { + for (int j = 0; j < this->Planes; ++j) + { + fp = src[j]; + sq = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + for (x = 0; x < this->Src_X; ++x) + xvalue[x] = HALFSCALE_FACTOR; + unsigned long yfill = SCALE_FACTOR; + unsigned long yleft = syscale; + int yneed = 1; + int ysrc = 0; + for (y = 0; y < this->Dest_Y; ++y) + { + if (this->Src_Y == this->Dest_Y) + { + sp = fp; + for (x = this->Src_X, p = sp, q = xtemp; x != 0; --x) + *(q++) = *(p++); + fp += this->Src_X; + } + else + { + while (yleft < yfill) + { + if (yneed && (ysrc < OFstatic_cast(int, this->Src_Y))) + { + sp = fp; + fp += this->Src_X; + ++ysrc; + } + for (x = 0, p = sp; x < this->Src_X; ++x) + xvalue[x] += yleft * OFstatic_cast(signed long, *(p++)); + yfill -= yleft; + yleft = syscale; + yneed = 1; + } + if (yneed && (ysrc < OFstatic_cast(int, this->Src_Y))) + { + sp = fp; + fp += this->Src_X; + ++ysrc; + yneed = 0; + } + signed long v; + for (x = 0, p = sp, q = xtemp; x < this->Src_X; ++x) + { + v = xvalue[x] + yfill * OFstatic_cast(signed long, *(p++)); + v /= SCALE_FACTOR; + *(q++) = OFstatic_cast(T, (v > maxvalue) ? maxvalue : v); + xvalue[x] = HALFSCALE_FACTOR; + } + yleft -= yfill; + if (yleft == 0) + { + yleft = syscale; + yneed = 1; + } + yfill = SCALE_FACTOR; + } + if (this->Src_X == this->Dest_X) + { + for (x = this->Dest_X, p = xtemp, q = sq; x != 0; --x) + *(q++) = *(p++); + sq += this->Dest_X; + } + else + { + signed long v = HALFSCALE_FACTOR; + unsigned long xfill = SCALE_FACTOR; + unsigned long xleft; + int xneed = 0; + q = sq; + for (x = 0, p = xtemp; x < this->Src_X; ++x, ++p) + { + xleft = sxscale; + while (xleft >= xfill) + { + if (xneed) + { + ++q; + v = HALFSCALE_FACTOR; + } + v += xfill * OFstatic_cast(signed long, *p); + v /= SCALE_FACTOR; + *q = OFstatic_cast(T, (v > maxvalue) ? maxvalue : v); + xleft -= xfill; + xfill = SCALE_FACTOR; + xneed = 1; + } + if (xleft > 0) + { + if (xneed) + { + ++q; + v = HALFSCALE_FACTOR; + xneed = 0; + } + v += xleft * OFstatic_cast(signed long, *p); + xfill -= xleft; + } + } + if (xfill > 0) + v += xfill * OFstatic_cast(signed long, *(--p)); + if (!xneed) + { + v /= SCALE_FACTOR; + *q = OFstatic_cast(T, (v > maxvalue) ? maxvalue : v); + } + sq += this->Dest_X; + } + } + } + } + } + delete[] xtemp; + delete[] xvalue; + } + + + /** free scaling method with interpolation (only for magnification) + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void expandPixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using expand pixel scaling algorithm with interpolation from c't magazine"); + const double x_factor = OFstatic_cast(double, this->Src_X) / OFstatic_cast(double, this->Dest_X); + const double y_factor = OFstatic_cast(double, this->Src_Y) / OFstatic_cast(double, this->Dest_Y); + const unsigned long f_size = OFstatic_cast(unsigned long, Rows) * OFstatic_cast(unsigned long, Columns); + const T *sp; + double bx, ex; + double by, ey; + int bxi, exi; + int byi, eyi; + unsigned long offset; + double value, sum; + double x_part, y_part; + double l_factor, r_factor; + double t_factor, b_factor; + int xi; + int yi; + Uint16 x; + Uint16 y; + const T *p; + T *q; + + /* + * based on scaling algorithm from "c't - Magazin fuer Computertechnik" (c't 11/94) + * (adapted to be used with signed pixel representation, inverse images - mono1, + * various bit depths, multi-frame and multi-plane/color images, combined clipping/scaling) + */ + + for (int j = 0; j < this->Planes; ++j) + { + sp = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + q = dest[j]; + for (unsigned long f = 0; f < this->Frames; ++f) + { + for (y = 0; y < this->Dest_Y; ++y) + { + by = y_factor * OFstatic_cast(double, y); + ey = y_factor * (OFstatic_cast(double, y) + 1.0); + if (ey > this->Src_Y) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" limiting value of 'ey' to 'Src_Y': " << ey << " -> " << this->Src_Y); +#endif + // see reducePixel() + ey = this->Src_Y; + } + byi = OFstatic_cast(int, by); + eyi = OFstatic_cast(int, ey); + if (OFstatic_cast(double, eyi) == ey) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" decreasing value of 'eyi' by 1: " << eyi << " -> " << (eyi - 1)); +#endif + --eyi; + } + y_part = OFstatic_cast(double, eyi) / y_factor; + b_factor = y_part - OFstatic_cast(double, y); + t_factor = (OFstatic_cast(double, y) + 1.0) - y_part; + for (x = 0; x < this->Dest_X; ++x) + { + value = 0; + bx = x_factor * OFstatic_cast(double, x); + ex = x_factor * (OFstatic_cast(double, x) + 1.0); + if (ex > this->Src_X) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" limiting value of 'ex' to 'Src_X': " << ex << " -> " << this->Src_X); +#endif + // see reducePixel() + ex = this->Src_X; + } + bxi = OFstatic_cast(int, bx); + exi = OFstatic_cast(int, ex); + if (OFstatic_cast(double, exi) == ex) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" decreasing value of 'exi' by 1: " << exi << " -> " << (exi - 1)); +#endif + --exi; + } + x_part = OFstatic_cast(double, exi) / x_factor; + l_factor = x_part - OFstatic_cast(double, x); + r_factor = (OFstatic_cast(double, x) + 1.0) - x_part; + offset = OFstatic_cast(unsigned long, byi) * OFstatic_cast(unsigned long, Columns); + for (yi = byi; yi <= eyi; ++yi) + { + p = sp + offset + bxi; + for (xi = bxi; xi <= exi; ++xi) + { + sum = OFstatic_cast(double, *(p++)); + if (bxi != exi) + { + if (xi == bxi) + sum *= l_factor; + else + sum *= r_factor; + } + if (byi != eyi) + { + if (yi == byi) + sum *= b_factor; + else + sum *= t_factor; + } + value += sum; + } + offset += Columns; + } + *(q++) = OFstatic_cast(T, value + 0.5); + } + } + sp += f_size; + } + } + } + + + /** free scaling method with interpolation (only for reduction) + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void reducePixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using reduce pixel scaling algorithm with interpolation from c't magazine"); + const double x_factor = OFstatic_cast(double, this->Src_X) / OFstatic_cast(double, this->Dest_X); + const double y_factor = OFstatic_cast(double, this->Src_Y) / OFstatic_cast(double, this->Dest_Y); + const double xy_factor = x_factor * y_factor; + const unsigned long f_size = OFstatic_cast(unsigned long, Rows) * OFstatic_cast(unsigned long, Columns); + const T *sp; + double bx, ex; + double by, ey; + int bxi, exi; + int byi, eyi; + unsigned long offset; + double value, sum; + double l_factor, r_factor; + double t_factor, b_factor; + int xi; + int yi; + Uint16 x; + Uint16 y; + const T *p; + T *q; + + /* + * based on scaling algorithm from "c't - Magazin fuer Computertechnik" (c't 11/94) + * (adapted to be used with signed pixel representation, inverse images - mono1, + * various bit depths, multi-frame and multi-plane/color images, combined clipping/scaling) + */ + + for (int j = 0; j < this->Planes; ++j) + { + sp = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + q = dest[j]; + for (unsigned long f = 0; f < this->Frames; ++f) + { + for (y = 0; y < this->Dest_Y; ++y) + { + by = y_factor * OFstatic_cast(double, y); + ey = y_factor * (OFstatic_cast(double, y) + 1.0); + if (ey > this->Src_Y) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" limiting value of 'ey' to 'Src_Y': " << ey << " -> " << this->Src_Y); +#endif + // yes, this can happen due to rounding, e.g. double(943) / double(471) * double(471) + // is something like 943.00000000000011368683772161602974 and then, the eyi == ey check + // fails to bring eyi back into range! + ey = this->Src_Y; + } + byi = OFstatic_cast(int, by); + eyi = OFstatic_cast(int, ey); + if (OFstatic_cast(double, eyi) == ey) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" decreasing value of 'eyi' by 1: " << eyi << " -> " << (eyi - 1)); +#endif + --eyi; + } + b_factor = 1 + OFstatic_cast(double, byi) - by; + t_factor = ey - OFstatic_cast(double, eyi); + for (x = 0; x < this->Dest_X; ++x) + { + value = 0; + bx = x_factor * OFstatic_cast(double, x); + ex = x_factor * (OFstatic_cast(double, x) + 1.0); + if (ex > this->Src_X) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" limiting value of 'ex' to 'Src_X': " << ex << " -> " << this->Src_X); +#endif + // see above comment + ex = this->Src_X; + } + bxi = OFstatic_cast(int, bx); + exi = OFstatic_cast(int, ex); + if (OFstatic_cast(double, exi) == ex) + { +#ifdef DEBUG // this output is only useful for debugging purposes + DCMIMGLE_TRACE(" decreasing value of 'exi' by 1: " << exi << " -> " << (exi - 1)); +#endif + --exi; + } + l_factor = 1 + OFstatic_cast(double, bxi) - bx; + r_factor = ex - OFstatic_cast(double, exi); + offset = OFstatic_cast(unsigned long, byi) * OFstatic_cast(unsigned long, Columns); + for (yi = byi; yi <= eyi; ++yi) + { + p = sp + offset + bxi; + for (xi = bxi; xi <= exi; ++xi) + { + sum = OFstatic_cast(double, *(p++)) / xy_factor; + if (xi == bxi) + sum *= l_factor; + else if (xi == exi) + sum *= r_factor; + if (yi == byi) + sum *= b_factor; + else if (yi == eyi) + sum *= t_factor; + value += sum; + } + offset += Columns; + } + *(q++) = OFstatic_cast(T, value + 0.5); + } + } + sp += f_size; + } + } + } + + /** bilinear interpolation method (only for magnification) + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void bilinearPixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using magnification algorithm with bilinear interpolation contributed by Eduard Stanescu"); + const double x_factor = OFstatic_cast(double, this->Src_X) / OFstatic_cast(double, this->Dest_X); + const double y_factor = OFstatic_cast(double, this->Src_Y) / OFstatic_cast(double, this->Dest_Y); + const unsigned long f_size = OFstatic_cast(unsigned long, Rows) * OFstatic_cast(unsigned long, Columns); + const unsigned long l_offset = OFstatic_cast(unsigned long, this->Src_Y - 1) * OFstatic_cast(unsigned long, this->Dest_X); + Uint16 x; + Uint16 y; + T *pD; + T *pCurrTemp; + const T *pCurrSrc; + Uint16 nSrcIndex; + double dOff; + T *pT; + const T *pS; + const T *pF; + + // buffer used for storing temporarily the interpolated lines + T *pTemp = new T[OFstatic_cast(unsigned long, this->Src_Y) * OFstatic_cast(unsigned long, this->Dest_X)]; + if (pTemp == NULL) + { + DCMIMGLE_ERROR("can't allocate temporary buffer for interpolation scaling"); + this->clearPixel(dest); + } else { + + /* + * based on scaling algorithm contributed by Eduard Stanescu + * (adapted to be used with signed pixel representation, inverse images - mono1, + * various bit depths, multi-frame multi-plane/color images, combined clipping/scaling) + */ + + for (int j = 0; j < this->Planes; ++j) + { + pF = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + pD = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + pT = pCurrTemp = pTemp; + pS = pCurrSrc = pF; + // first, interpolate the columns: + // column 0, just copy the source data column 0 + for (y = this->Src_Y; y != 0; --y) + { + *(pCurrTemp) = *(pCurrSrc); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + pCurrSrc = pS; + nSrcIndex = 0; + // column 1 to column Dest_X - 1 + for (x = 1; x < this->Dest_X - 1; ++x) + { + pCurrTemp = ++pT; + dOff = x * x_factor - nSrcIndex; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (y = 0; y < this->Src_Y; ++y) + { + // use floating points in order to avoid possible integer overflow + const double v1 = OFstatic_cast(double, *(pCurrSrc)); + const double v2 = OFstatic_cast(double, *(pCurrSrc + 1)); + *(pCurrTemp) = OFstatic_cast(T, v1 + (v2 - v1) * dOff); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + // don't go beyond the source data + if ((nSrcIndex < this->Src_X - 2) && (x * x_factor >= nSrcIndex + 1)) + { + pS++; + nSrcIndex++; + } + pCurrSrc = pS; + } + pCurrTemp = ++pT; + // last column, just copy the source data column Src_X + for (y = this->Src_Y; y != 0; --y) + { + *(pCurrTemp) = *(pCurrSrc); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + // now the columns are interpolated in temp buffer, so interpolate the lines + pT = pCurrTemp = pTemp; + // line 0, just copy the temp buffer line 0 + for (x = this->Dest_X; x != 0; --x) + *(pD++) = *(pCurrTemp++); + nSrcIndex = 0; + pCurrTemp = pTemp; + for (y = 1; y < this->Dest_Y - 1; ++y) + { + dOff = y * y_factor - nSrcIndex; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (x = this->Dest_X; x != 0; --x) + { + // use floating points in order to avoid possible integer overflow + const double v1 = OFstatic_cast(double, *(pCurrTemp)); + const double v2 = OFstatic_cast(double, *(pCurrTemp + this->Dest_X)); + *(pD++) = OFstatic_cast(T, v1 + (v2 - v1) * dOff); + pCurrTemp++; + } + // don't go beyond the source data + if ((nSrcIndex < this->Src_Y - 2) && (y * y_factor >= nSrcIndex + 1)) + { + pT += this->Dest_X; + nSrcIndex++; + } + pCurrTemp = pT; + } + // the last line, just copy the temp buffer line Src_X + pCurrTemp = pTemp + l_offset; + for (x = this->Dest_X; x != 0; --x) + *(pD++) = *(pCurrTemp++); + // skip to next frame + pF += f_size; + } + } + } + delete[] pTemp; + } + + /** bicubic interpolation method (only for magnification) + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + void bicubicPixel(const T *src[], + T *dest[]) + { + DCMIMGLE_DEBUG("using magnification algorithm with bicubic interpolation contributed by Eduard Stanescu"); + const double minVal = (isSigned()) ? -OFstatic_cast(double, DicomImageClass::maxval(this->Bits - 1, 0)) : 0.0; + const double maxVal = OFstatic_cast(double, DicomImageClass::maxval(this->Bits - isSigned())); + const double x_factor = OFstatic_cast(double, this->Src_X) / OFstatic_cast(double, this->Dest_X); + const double y_factor = OFstatic_cast(double, this->Src_Y) / OFstatic_cast(double, this->Dest_Y); + const Uint16 xDelta = OFstatic_cast(Uint16, 1 / x_factor); + const Uint16 yDelta = OFstatic_cast(Uint16, 1 / y_factor); + const unsigned long f_size = OFstatic_cast(unsigned long, Rows) * OFstatic_cast(unsigned long, Columns); + const unsigned long l_offset = OFstatic_cast(unsigned long, this->Src_Y - 1) * OFstatic_cast(unsigned long, this->Dest_X); + Uint16 x; + Uint16 y; + T *pD; + T *pCurrTemp; + const T *pCurrSrc; + Uint16 nSrcIndex; + double dOff; + T *pT; + const T *pS; + const T *pF; + + // buffer used for storing temporarily the interpolated lines + T *pTemp = pT = pCurrTemp = new T[OFstatic_cast(unsigned long, this->Src_Y) * OFstatic_cast(unsigned long, this->Dest_X)]; + if (pTemp == NULL) + { + DCMIMGLE_ERROR("can't allocate temporary buffer for interpolation scaling"); + this->clearPixel(dest); + } else { + + /* + * based on scaling algorithm contributed by Eduard Stanescu + * (adapted to be used with signed pixel representation, inverse images - mono1, + * various bit depths, multi-frame multi-plane/color images, combined clipping/scaling) + */ + + for (int j = 0; j < this->Planes; ++j) + { + pF = src[j] + OFstatic_cast(unsigned long, Top) * OFstatic_cast(unsigned long, Columns) + Left; + pD = dest[j]; + for (unsigned long f = this->Frames; f != 0; --f) + { + pT = pCurrTemp = pTemp; + pS = pCurrSrc = pF; + // first, interpolate the columns: + // column 0, just copy the source data column 0 + for (y = this->Src_Y; y != 0; --y) + { + *(pCurrTemp) = *(pCurrSrc); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + pCurrSrc = pS; + // for the next few columns, linear interpolation + for (x = 1; x < xDelta + 1; ++x) + { + pCurrSrc = pS; + pCurrTemp = ++pT; + dOff = x * x_factor; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (y = this->Src_Y; y != 0; --y) + { + *(pCurrTemp) = OFstatic_cast(T, *(pCurrSrc) + (*(pCurrSrc + 1) - *(pCurrSrc)) * dOff); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + } + nSrcIndex = 1; + pCurrSrc = ++pS; + // the majority of the columns + for (x = xDelta + 1; x < this->Dest_X - 2 * xDelta; ++x) + { + pCurrTemp = ++pT; + dOff = x * x_factor - nSrcIndex; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (y = this->Src_Y; y != 0; --y) + { + *(pCurrTemp) = OFstatic_cast(T, cubicValue(*(pCurrSrc - 1), *(pCurrSrc), *(pCurrSrc + 1), *(pCurrSrc + 2), dOff, minVal, maxVal)); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + // don't go beyond the source data + if ((nSrcIndex < this->Src_X - 3) && (x * x_factor >= nSrcIndex + 1)) + { + pS++; + nSrcIndex++; + } + pCurrSrc = pS; + } + // last few columns except the very last one, linear interpolation + for (x = this->Dest_X - 2 * xDelta; x < this->Dest_X - 1; ++x) + { + pCurrTemp = ++pT; + dOff = x * x_factor - nSrcIndex; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (y = this->Src_Y; y != 0; --y) + { + *(pCurrTemp) = OFstatic_cast(T, *(pCurrSrc) + (*(pCurrSrc + 1) - *(pCurrSrc)) * dOff); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + // don't go beyond the source data + if ((nSrcIndex < this->Src_X - 2) && (x * x_factor >= nSrcIndex + 1)) + { + pS++; + nSrcIndex++; + } + pCurrSrc = pS; + } + // last column, just copy the source data column Src_X + pCurrTemp = pTemp + this->Dest_X - 1; + pCurrSrc = pF + this->Src_X - 1; + for (y = this->Src_Y; y != 0; --y) + { + *(pCurrTemp) = *(pCurrSrc); + pCurrSrc += Columns; + pCurrTemp += this->Dest_X; + } + // now the columns are interpolated in temp buffer, so interpolate the lines + pT = pCurrTemp = pTemp; + // line 0, just copy the temp buffer line 0 + for (x = this->Dest_X; x != 0; --x) + *(pD++) = *(pCurrTemp++); + // for the next few lines, linear interpolation between line 0 and 1 of the temp buffer + for (y = 1; y < yDelta + 1; ++y) + { + pCurrTemp = pTemp; + dOff = y * y_factor; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (x = this->Dest_X; x != 0; --x) + { + *(pD++) = OFstatic_cast(T, *(pCurrTemp) + (*(pCurrTemp + this->Dest_X) - *(pCurrTemp)) * dOff); + pCurrTemp++; + } + } + nSrcIndex = 1; + pCurrTemp = pT = pTemp + this->Dest_X; + for (y = yDelta + 1; y < this->Dest_Y - yDelta - 1; ++y) + { + dOff = y * y_factor - nSrcIndex; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (x = this->Dest_X; x != 0; --x) + { + *(pD++) = OFstatic_cast(T, cubicValue(*(pCurrTemp - this->Dest_X),*(pCurrTemp), *(pCurrTemp + this->Dest_X), + *(pCurrTemp + this->Dest_X + this->Dest_X), dOff, minVal, maxVal)); + pCurrTemp++; + } + // don't go beyond the source data + if ((nSrcIndex < this->Src_Y - 3) && (y * y_factor >= nSrcIndex + 1)) + { + pT += this->Dest_X; + nSrcIndex++; + } + pCurrTemp = pT; + } + // the last few lines except the very last one, linear interpolation in between the second last and the last lines + pCurrTemp = pT = pTemp + OFstatic_cast(unsigned long, this->Src_Y - 2) * OFstatic_cast(unsigned long, this->Dest_X); + for (y = this->Dest_Y - yDelta - 1; y < this->Dest_Y - 1; ++y) + { + dOff = y * y_factor - nSrcIndex; + dOff = (1.0 < dOff) ? 1.0 : dOff; + for (x = this->Dest_X; x != 0; --x) + { + *(pD++) = OFstatic_cast(T, *(pCurrTemp) + (*(pCurrTemp + this->Dest_X) - *(pCurrTemp)) * dOff); + pCurrTemp++; + } + pCurrTemp = pT; + } + // the the last line, just copy the temp buffer line Src_X + pCurrTemp = pTemp + l_offset; + for (x = this->Dest_X; x != 0; --x) + *(pD++) = *(pCurrTemp++); + // skip to next frame + pF += f_size; + } + } + } + delete[] pTemp; + } +}; + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/displint.h b/dcmimgle/include/dcmtk/dcmimgle/displint.h new file mode 100644 index 00000000..1888e3ca --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/displint.h @@ -0,0 +1,187 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DiCubicSpline Function/Interpolation (Header/Implementation) + * + */ + + +#ifndef DISPLINT_H +#define DISPLINT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcast.h" + +#define INCLUDE_CSTDDEF /* For NULL */ +#include "dcmtk/ofstd/ofstdinc.h" + + +/*--------------------* + * macro definition * + *--------------------*/ + +// SunCC 4.x does not support default values for template types :-/ +#define T3_ double + + +/*------------------* + * template class * + *------------------*/ + +/** Template class for cubic spline interpolation + */ +template +class DiCubicSpline +{ + + public: + + /** calculate spline function for given points. + * T1 = type of x coordinates + * T2 = type of y coordinates + * T3_ = type of y coordinates of the spline function + * + ** @param x array with x coordinates of given points + * @param y array with y coordinates of given points + * @param n number of entries in array (= points) + * @param y2 array used to store the resulting spline function (used for CubicSplineInterpolation) + * @param yp1 first derivative of the interpolating function at point 1 + * @param ypn first derivative of the interpolating function at point n + * + ** @return true if successful, false otherwise + */ + static int Function(const T1 *x, + const T2 *y, + const unsigned int n, + T3_ *y2, + const T3_ yp1 = 1.0e30, + const T3_ ypn = 1.0e30) + { + if ((x != NULL) && (y != NULL) && (n > 0) && (y2 != NULL)) + { + T3_ *u = new T3_[n]; // temporary vector + if (u != NULL) + { + unsigned int i; + T3_ p, qn, sig, un; + if (yp1 > 0.99e30) // ignore value for first derivative at point 1 + y2[0] = u[0] = 0.0; + else + { + y2[0] = -0.5; + u[0] = (3.0 / (OFstatic_cast(T3_, x[1]) - OFstatic_cast(T3_, x[0]))) * + ((OFstatic_cast(T3_, y[1]) - OFstatic_cast(T3_, y[0])) / + (OFstatic_cast(T3_, x[1]) - OFstatic_cast(T3_, x[0])) - yp1); + } + for (i = 1; i < n - 1; ++i) + { + sig = (OFstatic_cast(T3_, x[i]) - OFstatic_cast(T3_, x[i - 1])) / + (OFstatic_cast(T3_, x[i + 1]) - OFstatic_cast(T3_, x[i - 1])); + p = sig * y2[i - 1] + 2.0; + y2[i] = (sig - 1.0) / p; + u[i] = (OFstatic_cast(T3_, y[i + 1]) - OFstatic_cast(T3_, y[i])) / + (OFstatic_cast(T3_, x[i + 1]) - OFstatic_cast(T3_, x[i])) - + (OFstatic_cast(T3_, y[i]) - OFstatic_cast(T3_, y[i - 1])) / + (OFstatic_cast(T3_, x[i]) - OFstatic_cast(T3_, x[i - 1])); + u[i] = (6.0 * u[i] / (OFstatic_cast(T3_, x[i + 1]) - + OFstatic_cast(T3_, x[i - 1])) - sig * u[i - 1]) / p; + } + if (ypn > 0.99e30) // ignore value for first derivative at point 1 + qn = un = 0.0; + else + { + qn = 0.5; + un = (3.0 / (OFstatic_cast(T3_, x[n - 1]) - OFstatic_cast(T3_, x[n - 2]))) * + (ypn - (OFstatic_cast(T3_, y[n - 1]) - OFstatic_cast(T3_, y[n - 2])) / + (OFstatic_cast(T3_, x[n - 1]) - OFstatic_cast(T3_, x[n - 2]))); + } + y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0); + for (i = n - 1; i > 0; --i) + y2[i - 1] = y2[i - 1] * y2[i] + u[i - 1]; + delete[] u; + return 1; + } + } + return 0; + } + + + /** perform cubic spline interpolation for given points. + * T1 = type of x coordinates + * T2 = type of y coordinates + * T3_ = type of y coordinates of the spline function + * + ** @param xa array with x coordinates of given points + * @param ya array with y coordinates of given points + * @param y2a array used to store the resulting spline function (calculated by CubicSplineFunction) + * @param na number of entries in above arrays (xa, ya and y2a) + * @param x array with x coordinates of points to be interpolated + * @param y array used to store interpolated values + * @param n number of entries in above array (x and y) + * + ** @return true if successful, false otherwise + */ + static int Interpolation(const T1 *xa, + const T2 *ya, + const T3_ *y2a, + const unsigned int na, + const T1 *x, + T2 *y, + const unsigned int n) + { + if ((xa != NULL) && (ya != NULL) && (y2a != NULL) && (na > 0) && (x != NULL) && (y != NULL) && (n > 0)) + { + unsigned int k, i; + unsigned int klo = 0; + unsigned int khi = na - 1; + T3_ h, b, a; + for (i = 0; i < n; ++i) + { + if ((xa[klo] > x[i]) || (xa[khi] < x[i])) // optimization + { + klo = 0; + khi = na - 1; + } + while (khi - klo > 1) // search right place in the table, if necessary + { + k = (khi + klo) >> 1; + if (xa[k] > x[i]) + khi = k; + else + klo = k; + } + if (xa[khi] == x[i]) // optimization: use known values + y[i] = ya[khi]; + else + { + h = OFstatic_cast(T3_, xa[khi]) - OFstatic_cast(T3_, xa[klo]); + if (h == 0.0) // bad xa input, values must be distinct ! + return 0; + a = (OFstatic_cast(T3_, xa[khi]) - OFstatic_cast(T3_, x[i])) / h; + b = (OFstatic_cast(T3_, x[i]) - OFstatic_cast(T3_, xa[klo])) / h; + y[i] = OFstatic_cast(T2, a * OFstatic_cast(T3_, ya[klo]) + b * OFstatic_cast(T3_, ya[khi]) + + ((a * a * a - a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0); + } + } + return 1; + } + return 0; + } +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/ditranst.h b/dcmimgle/include/dcmtk/dcmimgle/ditranst.h new file mode 100644 index 00000000..fd29ea6f --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/ditranst.h @@ -0,0 +1,138 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomTransTemplate (Header) + * + */ + + +#ifndef DITRANST_H +#define DITRANST_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/ofstd/ofbmanip.h" + +#include "dcmtk/dcmimgle/diutils.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class building the base for other transformations. + * (e.g. scaling, flipping) + */ +template +class DiTransTemplate +{ + + protected: + + /** constructor + * + ** @param planes number of planes + * @param src_x width of source image + * @param src_y height of source image + * @param dest_x width of destination image (after transformation) + * @param dest_y height of destination image + * @param frames number of frames + * @param bits number of bits per plane/pixel (optional) + */ + DiTransTemplate(const int planes, + const Uint16 src_x, + const Uint16 src_y, + const Uint16 dest_x, + const Uint16 dest_y, + const Uint32 frames, + const int bits = 0) + : Planes(planes), + Src_X(src_x), + Src_Y(src_y), + Dest_X(dest_x), + Dest_Y(dest_y), + Frames(frames), + Bits(((bits < 1) || (bits > OFstatic_cast(int, bitsof(T)))) ? OFstatic_cast(int, bitsof(T)) : bits) + { + } + + /** destructor + */ + virtual ~DiTransTemplate() + { + } + + /** copy pixel data + * + ** @param src array of pointers to source image pixels + * @param dest array of pointers to destination image pixels + */ + inline void copyPixel(const T *src[], + T *dest[]) + { + const unsigned long count = OFstatic_cast(unsigned long, Dest_X) * OFstatic_cast(unsigned long, Dest_Y) * Frames; + for (int j = 0; j < Planes; ++j) + OFBitmanipTemplate::copyMem(src[j], dest[j], count); + } + + /** fill pixel data with specified value + * + ** @param dest array of pointers to destination image pixels + * @param value value to be filled in destination array + */ + inline void fillPixel(T *dest[], + const T value) + { + const unsigned long count = OFstatic_cast(unsigned long, Dest_X) * OFstatic_cast(unsigned long, Dest_Y) * Frames; + for (int j = 0; j < Planes; ++j) + OFBitmanipTemplate::setMem(dest[j], value, count); + } + + /** clear pixel data (set values to 0) + * + ** @param dest array of pointers to destination image pixels + */ + inline void clearPixel(T *dest[]) + { + const unsigned long count = OFstatic_cast(unsigned long, Dest_X) * OFstatic_cast(unsigned long, Dest_Y) * Frames; + for (int j = 0; j < Planes; ++j) + OFBitmanipTemplate::zeroMem(dest[j], count); + } + + + /// number of planes + /*const*/ int Planes; // allow later changing to avoid warnings on Irix + + /// width of source image + /*const*/ Uint16 Src_X; // add 'const' when interpolated scaling with clipping is fully implemented + /// height of source image + /*const*/ Uint16 Src_Y; // ... dito ... + /// width of destination image + const Uint16 Dest_X; + /// height of destination image + const Uint16 Dest_Y; + + /// number of frames + const Uint32 Frames; + /// number of bits per plane/pixel + const int Bits; +}; + + +#endif diff --git a/dcmimgle/include/dcmtk/dcmimgle/diutils.h b/dcmimgle/include/dcmtk/dcmimgle/diutils.h new file mode 100644 index 00000000..47f4ce87 --- /dev/null +++ b/dcmimgle/include/dcmtk/dcmimgle/diutils.h @@ -0,0 +1,466 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: Utilities (Header) + * + */ + + +#ifndef DIUTILS_H +#define DIUTILS_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/oflog/oflog.h" + +#include "dcmtk/dcmimgle/didefine.h" + +extern DCMTK_DCMIMGLE_EXPORT OFLogger DCM_dcmimgleLogger; + +#define DCMIMGLE_TRACE(msg) OFLOG_TRACE(DCM_dcmimgleLogger, msg) +#define DCMIMGLE_DEBUG(msg) OFLOG_DEBUG(DCM_dcmimgleLogger, msg) +#define DCMIMGLE_INFO(msg) OFLOG_INFO(DCM_dcmimgleLogger, msg) +#define DCMIMGLE_WARN(msg) OFLOG_WARN(DCM_dcmimgleLogger, msg) +#define DCMIMGLE_ERROR(msg) OFLOG_ERROR(DCM_dcmimgleLogger, msg) +#define DCMIMGLE_FATAL(msg) OFLOG_FATAL(DCM_dcmimgleLogger, msg) + + +// include this file in doxygen documentation + +/** @file diutils.h + * @brief type definitions, constants and helper functions for the dcmimgle/dcmimage module + */ + + +/*---------------------* + * const definitions * + *---------------------*/ + +/** @name configuration flags + */ + +//@{ + +/// compatibility with old ACR-NEMA images +const unsigned long CIF_AcrNemaCompatibility = 0x0000001; + +/// accept wrong palette attribute tags +const unsigned long CIF_WrongPaletteAttributeTags = 0x0000002; + +/// element pixel data may be detached if it is no longer needed by DicomImage +const unsigned long CIF_MayDetachPixelData = 0x0000004; + +/// use presentation state instead of 'built-in' LUTs & overlays +const unsigned long CIF_UsePresentationState = 0x0000008; + +/// don't convert YCbCr (Full and Full 4:2:2) color images to RGB +const unsigned long CIF_KeepYCbCrColorModel = 0x0000010; + +/// take responsibility for the given external DICOM dataset, i.e. delete it on destruction +const unsigned long CIF_TakeOverExternalDataset = 0x0000020; + +/// ignore modality transformation (rescale slope/intercept or LUT) stored in the dataset +const unsigned long CIF_IgnoreModalityTransformation = 0x0000040; + +/// ignore third value of the modality LUT descriptor, determine bit depth automatically +const unsigned long CIF_IgnoreModalityLutBitDepth = 0x0000080; + +/// check third value of the LUT descriptor, compare with with expected bit depth based on LUT data +const unsigned long CIF_CheckLutBitDepth = 0x0000100; + +/// use absolute (possible) pixel range for determining the internal representation (monochrome only) +const unsigned long CIF_UseAbsolutePixelRange = 0x0000200; + +/// use partial access to pixel data, i.e. without decompressing or loading a complete multi-frame image. +/// Please note that the use of this flag can cause another copy of the pixel data to be created in memory, +/// e.g. in case the pixel data element value has already been loaded or decompressed completely in memory. +const unsigned long CIF_UsePartialAccessToPixelData = 0x0000400; + +/// always decompress complete pixel data when processing an image, i.e. even if partial access is used +const unsigned long CIF_DecompressCompletePixelData = 0x0000800; + +/// never access embedded overlays since this requires to load and uncompress the complete pixel data +const unsigned long CIF_NeverAccessEmbeddedOverlays = 0x0001000; +//@} + + +// / true color color mode (for monochrome images only) +const int MI_PastelColor = -1; + + +/*--------------------* + * type definitions * + *--------------------*/ + +/** constants for photometric interpretation + */ +enum EP_Interpretation +{ + /// unknown, undefined, invalid + EPI_Unknown, + /// no element value available + EPI_Missing, + /// monochrome 1 + EPI_Monochrome1, + /// monochrome 2 + EPI_Monochrome2, + /// palette color + EPI_PaletteColor, + /// RGB color + EPI_RGB, + /// HSV color (retired) + EPI_HSV, + /// ARGB color (retired) + EPI_ARGB, + /// CMYK color (retired) + EPI_CMYK, + /// YCbCr full + EPI_YBR_Full, + /// YCbCr full 4:2:2 + EPI_YBR_Full_422, + /// YCbCr partial 4:2:2 + EPI_YBR_Partial_422 +}; + + +/** structure for photometric string and related constant + */ +struct DCMTK_DCMIMGLE_EXPORT SP_Interpretation +{ + /// string (name of the color model without spaces and underscores) + const char *Name; + /// defined term according to the DICOM standard + const char *DefinedTerm; + /// integer constant + EP_Interpretation Type; +}; + + +/** structure for BMP bitmap file header + */ +struct DCMTK_DCMIMGLE_EXPORT SB_BitmapFileHeader +{ + /// signature, must always be 'BM' + char bfType[2]; + /// file size in bytes + Uint32 bfSize; + /// reserved, should be '0' + Uint16 bfReserved1; + /// reserved, should be '0' + Uint16 bfReserved2; + /// offset from the beginning of the file to the bitmap data (in bytes) + Uint32 bfOffBits; +}; + + +/** structure for BMP bitmap info header + */ +struct DCMTK_DCMIMGLE_EXPORT SB_BitmapInfoHeader +{ + /// size of the BitmapInfoHeader, usually '40' + Uint32 biSize; + /// width of the image (in pixels) + Sint32 biWidth; + /// height of the image (in pixels) + Sint32 biHeight; + /// number of planes, usually '1' + Uint16 biPlanes; + /// bits per pixel, supported values: 8 = color palette with 256 entries, 24 = true color + Uint16 biBitCount; + /// type of compression, support value: 0 = BI_RGB, no compression + Uint32 biCompression; + /// size of the image data (in bytes), might be set to '0' if image is uncompressed + Uint32 biSizeImage; + /// horizontal resolution: pixels/meter, usually set to '0' + Sint32 biXPelsPerMeter; + /// vertical resolution: pixels/meter, usually set to '0' + Sint32 biYPelsPerMeter; + /// number of actually used colors, if '0' the number of colors is calculated using 'biBitCount' + Uint32 biClrUsed; + /// number of important colors, '0' means all + Uint32 biClrImportant; +}; + + +/** internal representation of pixel data + */ +enum EP_Representation +{ + /// unsigned 8 bit integer + EPR_Uint8, EPR_MinUnsigned = EPR_Uint8, + /// signed 8 bit integer + EPR_Sint8, EPR_MinSigned = EPR_Sint8, + /// unsigned 16 bit integer + EPR_Uint16, + /// signed 16 bit integer + EPR_Sint16, + /// unsigned 32 bit integer + EPR_Uint32, EPR_MaxUnsigned = EPR_Uint32, + /// signed 32 bit integer + EPR_Sint32, EPR_MaxSigned = EPR_Sint32 +}; + + +/** image status code + */ +enum EI_Status +{ + /// normal, no error + EIS_Normal, + /// data dictionary not found + EIS_NoDataDictionary, + /// invalid dataset/file + EIS_InvalidDocument, + /// mandatory attribute missing + EIS_MissingAttribute, + /// invalid value for an important attribute + EIS_InvalidValue, + /// specified value for an attribute not supported + EIS_NotSupportedValue, + /// memory exhausted etc. + EIS_MemoryFailure, + /// invalid image, internal error + EIS_InvalidImage, + /// other error + EIS_OtherError +}; + + +/** overlay modes. + * This mode is used to define how to display an overlay plane. + */ +enum EM_Overlay +{ + /// default mode, as stored in the dataset + EMO_Default, + /// replace mode + EMO_Replace, + /// graphics overlay + EMO_Graphic = EMO_Replace, + /// threshold replace + EMO_ThresholdReplace, + /// complement + EMO_Complement, + /// invert the overlay bitmap + EMO_InvertBitmap, + /// region of interest (ROI) + EMO_RegionOfInterest, + /// bitmap shutter, used for GSPS objects + EMO_BitmapShutter +}; + + +/** VOI LUT functions + */ +enum EF_VoiLutFunction +{ + /// default function (not explicitly set) + EFV_Default, + /// function LINEAR + EFV_Linear, + /// function SIGMOID + EFV_Sigmoid +}; + + +/** presentation LUT shapes + */ +enum ES_PresentationLut +{ + /// default shape (not explicitly set) + ESP_Default, + /// shape IDENTITY + ESP_Identity, + /// shape INVERSE + ESP_Inverse, + /// shape LIN OD + ESP_LinOD +}; + + +/** polarity + */ +enum EP_Polarity +{ + /// NORMAL + EPP_Normal, + /// REVERSE (opposite polarity) + EPP_Reverse +}; + + +/** bits per table entry modes. + * Specifies whether the given value in the LUT descriptor is used. + */ +enum EL_BitsPerTableEntry +{ + /// use given value + ELM_UseValue, + /// ignore given value, use auto detection + ELM_IgnoreValue, + /// check whether given value is consistent with LUT data + ELM_CheckValue +}; + +/** type of VOI LUT transformation to apply. + * Specifies which VOI LUT transformation should be applied to an image. + */ +enum EW_WindowType +{ + /// use given value + EWT_none, + /// use the n-th VOI window from the image file + EWT_window_from_file, + /// use the n-th VOI look up table from the image file + EWT_voi_lut_from_file, + /// compute VOI window using min-max algorithm + EWT_window_minmax, + /// compute VOI window using min-max algorithm ignoring extremes + EWT_window_minmax_n, + /// compute VOI window using min-max algorithm applied to region of interest + EWT_window_minmax_roi, + /// compute VOI window using Histogram algorithm, ignoring n percent + EWT_window_histogram, + /// compute VOI window using center and width + EWT_window_center_width +}; + +/*----------------------------* + * constant initializations * + *----------------------------*/ + +const SP_Interpretation PhotometricInterpretationNames[] = +{ + {"MONOCHROME1", "MONOCHROME1", EPI_Monochrome1}, + {"MONOCHROME2", "MONOCHROME2", EPI_Monochrome2}, + {"PALETTECOLOR", "PALETTE COLOR", EPI_PaletteColor}, // space deleted to simplify detection + {"RGB", "RGB", EPI_RGB}, + {"HSV", "HSV", EPI_HSV}, + {"ARGB", "ARGB", EPI_ARGB}, + {"CMYK", "CMYK", EPI_CMYK}, + {"YBRFULL", "YBR_FULL", EPI_YBR_Full}, // underscore deleted to simplify detection + {"YBRFULL422", "YBR_FULL_422", EPI_YBR_Full_422}, // underscores deleted to simplify detection + {"YBRPARTIAL422", "YBR_PARTIAL_422", EPI_YBR_Partial_422}, // underscores deleted to simplify detection + {NULL, NULL, EPI_Unknown} +}; + + +/*---------------------* + * macro definitions * + *---------------------*/ + +#define MAX_UINT Uint32 +#define MAX_SINT Sint32 + +#define MAX_BITS 32 +#define MAX_BITS_TYPE Uint32 +#define MAX_RAWPPM_BITS 8 +#define MAX_INTERPOLATION_BITS 16 + +#define bitsof(expr) (sizeof(expr) << 3) + + +/*----------------------* + * class declarations * + *----------------------*/ + +/** Class comprising several global functions and constants. + * introduced to avoid problems with naming convention + */ +class DCMTK_DCMIMGLE_EXPORT DicomImageClass +{ + + public: + + /** calculate maximum value which could be stored in the specified number of bits + * + ** @param mv_bits number of bits + * @param mv_pos value subtracted from the maximum value (0 or 1) + * + ** @return maximum value + */ + static inline unsigned long maxval(const int mv_bits, + const unsigned long mv_pos = 1) + { + return (mv_bits < MAX_BITS) ? + (OFstatic_cast(unsigned long, 1) << mv_bits) - mv_pos : OFstatic_cast(MAX_BITS_TYPE, -1); + } + + /** calculate number of bits which are necessary to store the specified value + * + ** @param tb_value value to be stored + * @param tb_pos value subtracted from the value (0 or 1) before converting + * + ** @return number of bits + */ + static inline unsigned int tobits(unsigned long tb_value, + const unsigned long tb_pos = 1) + { + if (tb_value > 0) + tb_value -= tb_pos; + unsigned int tb_bits = 0; + while (tb_value > 0) + { + ++tb_bits; + tb_value >>= 1; + } + return tb_bits; + } + + /** calculate number of bits which are necessary to store the specified value range + * + ** @param minvalue minimum value to be stored + * @param maxvalue maximum value to be stored + * + ** @return number of bits + */ + static unsigned int rangeToBits(double minvalue, + double maxvalue); + + /** determine whether integer representation is signed or unsigned + * + ** @param repres integer representation (enum) to be checked + * + ** @return true if representation is signed, false if unsigned + */ + static int isRepresentationSigned(EP_Representation repres); + + /** determine number of bits used for a particular integer representation + * + ** @param repres integer representation (enum) to be checked + * + ** @return number of bits + */ + static unsigned int getRepresentationBits(EP_Representation repres); + + /** determine integer representation which is necessary to store values in the specified range + * + ** @param minvalue minimum value to be stored + * @param maxvalue maximum value to be stored + * + ** @return integer representation (enum) + */ + static EP_Representation determineRepresentation(double minvalue, + double maxvalue); + +}; + + +#endif diff --git a/dcmimgle/libsrc/CMakeLists.txt b/dcmimgle/libsrc/CMakeLists.txt new file mode 100644 index 00000000..2d264806 --- /dev/null +++ b/dcmimgle/libsrc/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmimgle dcmimage dibaslut diciefn dicielut didislut didispfn didocu digsdfn digsdlut diimage diinpx diluptab dimo1img dimo2img dimoimg dimoimg3 dimoimg4 dimoimg5 dimomod dimoopx dimopx diovdat diovlay diovlimg diovpln diutils) + +DCMTK_TARGET_LINK_MODULES(dcmimgle ofstd oflog dcmdata) diff --git a/dcmimgle/libsrc/Makefile.dep b/dcmimgle/libsrc/Makefile.dep new file mode 100644 index 00000000..579c54fb --- /dev/null +++ b/dcmimgle/libsrc/Makefile.dep @@ -0,0 +1,1492 @@ +dcmimage.o: dcmimage.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmimgle/dcmimage.h ../include/dcmtk/dcmimgle/dimoimg.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimgle/diovlimg.h \ + ../include/dcmtk/dcmimgle/dimo2img.h \ + ../include/dcmtk/dcmimgle/dimo1img.h ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmimgle/diregbas.h \ + ../include/dcmtk/dcmimgle/diplugin.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h +dibaslut.o: dibaslut.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h +diciefn.o: diciefn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/diciefn.h ../include/dcmtk/dcmimgle/didispfn.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimgle/dicielut.h \ + ../include/dcmtk/dcmimgle/didislut.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +dicielut.o: dicielut.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/dicielut.h \ + ../include/dcmtk/dcmimgle/didislut.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h +didislut.o: didislut.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/didislut.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h +didispfn.o: didispfn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmimgle/didispfn.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimgle/displint.h \ + ../include/dcmtk/dcmimgle/dicrvfit.h \ + ../include/dcmtk/dcmimgle/didislut.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +didocu.o: didocu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmimgle/didocu.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diutils.h +digsdfn.o: digsdfn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/digsdfn.h ../include/dcmtk/dcmimgle/didispfn.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimgle/displint.h \ + ../include/dcmtk/dcmimgle/digsdlut.h \ + ../include/dcmtk/dcmimgle/didislut.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +digsdlut.o: digsdlut.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/digsdlut.h \ + ../include/dcmtk/dcmimgle/didislut.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimgle/displint.h +diimage.o: diimage.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/diinpxt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmimgle/dipxrept.h +diinpx.o: diinpx.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h +diluptab.o: diluptab.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimgle/diobjcou.h ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h +dimo1img.o: dimo1img.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/dimo1img.h ../include/dcmtk/dcmimgle/dimoimg.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h +dimo2img.o: dimo2img.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/dimo2img.h ../include/dcmtk/dcmimgle/dimoimg.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h +dimoimg.o: dimoimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmimgle/dimoimg.h ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimgle/dimo2img.h \ + ../include/dcmtk/dcmimgle/dimoipxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \ + ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimocpt.h \ + ../include/dcmtk/dcmimgle/dimosct.h ../include/dcmtk/dcmimgle/discalet.h \ + ../include/dcmtk/dcmimgle/ditranst.h ../include/dcmtk/dcmimgle/dimoflt.h \ + ../include/dcmtk/dcmimgle/diflipt.h ../include/dcmtk/dcmimgle/dimorot.h \ + ../include/dcmtk/dcmimgle/dirotat.h ../include/dcmtk/dcmimgle/dimoopxt.h \ + ../include/dcmtk/dcmimgle/didislut.h ../include/dcmtk/dcmimgle/digsdfn.h \ + ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmimgle/diregbas.h +dimoimg3.o: dimoimg3.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/dimoimg.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimgle/dimoipxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \ + ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopxt.h \ + ../include/dcmtk/dcmimgle/didislut.h +dimoimg4.o: dimoimg4.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/dimoimg.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimgle/dimoipxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \ + ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopxt.h \ + ../include/dcmtk/dcmimgle/didislut.h +dimoimg5.o: dimoimg5.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/dimoimg.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmimgle/dimoipxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \ + ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopxt.h \ + ../include/dcmtk/dcmimgle/didislut.h +dimomod.o: dimomod.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmimgle/diobjcou.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmimgle/diinpx.h +dimoopx.o: dimoopx.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/dimoopx.h ../include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/dimopx.h \ + ../include/dcmtk/dcmimgle/dipixel.h ../include/dcmtk/dcmimgle/dimomod.h \ + ../include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../include/dcmtk/dcmimgle/diobjcou.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h +dimopx.o: dimopx.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmimgle/dimopx.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../include/dcmtk/dcmimgle/dipixel.h ../include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/dimomod.h \ + ../include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/dibaslut.h \ + ../include/dcmtk/dcmimgle/diobjcou.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopx.h +diovdat.o: diovdat.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h +diovlay.o: diovlay.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/discalet.h \ + ../include/dcmtk/dcmimgle/ditranst.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/dipxrept.h ../include/dcmtk/dcmimgle/diflipt.h \ + ../include/dcmtk/dcmimgle/dipixel.h ../include/dcmtk/dcmimgle/dirotat.h \ + ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h +diovlimg.o: diovlimg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/diovlimg.h \ + ../include/dcmtk/dcmimgle/dimo2img.h ../include/dcmtk/dcmimgle/dimoimg.h \ + ../include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/dimopx.h ../include/dcmtk/dcmimgle/dipixel.h \ + ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \ + ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmimgle/didispfn.h ../include/dcmtk/dcmimgle/dimopxt.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/dipxrept.h ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h +diovpln.o: diovpln.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmimgle/diovpln.h ../include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/didocu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmimgle/diobjcou.h +diutils.o: diutils.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmimgle/diutils.h ../include/dcmtk/dcmimgle/didefine.h diff --git a/dcmimgle/libsrc/Makefile.in b/dcmimgle/libsrc/Makefile.in new file mode 100644 index 00000000..b48c9e3f --- /dev/null +++ b/dcmimgle/libsrc/Makefile.in @@ -0,0 +1,57 @@ +# +# Makefile for dcmimgle/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include +LOCALDEFS = + +# Special defines for the Library, define them in LOCALDEFS +# REVERSE_OVERLAY_ORIGIN_ORDER +# swap order of overlay origin coordinates + +objs = dcmimage.o didocu.o diimage.o diinpx.o diutils.o \ + dimoimg.o dimoimg3.o dimoimg4.o dimoimg5.o \ + dimo1img.o dimo2img.o dimomod.o dimopx.o dimoopx.o \ + diovlay.o diovdat.o diovpln.o diovlimg.o dibaslut.o diluptab.o \ + didispfn.o didislut.o digsdfn.o digsdlut.o diciefn.o dicielut.o +library = libdcmimgle.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmimgle/libsrc/dcmimage.cc b/dcmimgle/libsrc/dcmimage.cc new file mode 100644 index 00000000..182ef40b --- /dev/null +++ b/dcmimgle/libsrc/dcmimage.cc @@ -0,0 +1,795 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomImage-Interface (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcdict.h" + +#include "dcmtk/dcmimgle/dcmimage.h" +#include "dcmtk/dcmimgle/diovlimg.h" +#include "dcmtk/dcmimgle/dimo1img.h" +#include "dcmtk/dcmimgle/dimo2img.h" +#include "dcmtk/dcmimgle/didocu.h" +#include "dcmtk/dcmimgle/diregbas.h" +#include "dcmtk/dcmimgle/diplugin.h" +#include "dcmtk/dcmdata/dcdicent.h" /* needed by MSVC5 */ + +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#ifndef FILENAME_MAX +#define FILENAME_MAX 255 +#endif + + +/*------------------* + * initialization * + *------------------*/ + +DiRegisterBase *DiRegisterBase::Pointer = NULL; + + +/*----------------* + * constructors * + *----------------*/ + +// --- create 'DicomImage' from 'filename', for valid 'flags' see 'diutils.h' + +DicomImage::DicomImage(const char *filename, + const unsigned long flags, + const unsigned long fstart, + const unsigned long fcount) + : ImageStatus(EIS_Normal), + PhotometricInterpretation(EPI_Unknown), + Document(NULL), + Image(NULL) +{ + if (checkDataDictionary()) // valid 'dicom.dic' found ? + { + Document = new DiDocument(filename, flags | CIF_MayDetachPixelData, fstart, fcount); + Init(); + } +} + + +// --- create 'DicomImage' from valid 'DicomObject' with transfer syntax 'xfer' + +DicomImage::DicomImage(DcmObject *object, + const E_TransferSyntax xfer, + const unsigned long flags, + const unsigned long fstart, + const unsigned long fcount) + : ImageStatus(EIS_Normal), + PhotometricInterpretation(EPI_Unknown), + Document(NULL), + Image(NULL) +{ + if (checkDataDictionary()) // valid 'dicom.dic' found ? + { + Document = new DiDocument(object, xfer, flags, fstart, fcount); + Init(); + } +} + + +// --- create 'DicomImage' from valid 'DicomObject' with given rescale 'slope' and 'intercept' + +DicomImage::DicomImage(DcmObject *object, + const E_TransferSyntax xfer, + const double slope, + const double intercept, + const unsigned long flags, + const unsigned long fstart, + const unsigned long fcount) + : ImageStatus(EIS_Normal), + PhotometricInterpretation(EPI_Unknown), + Document(NULL), + Image(NULL) +{ + if (checkDataDictionary()) // valid 'dicom.dic' found ? + { + Document = new DiDocument(object, xfer, flags, fstart, fcount); + if ((Document != NULL) && (Document->good())) + { + PhotometricInterpretation = EPI_Monochrome2; // default for presentation states + Image = new DiMono2Image(Document, ImageStatus, slope, intercept); + } + } +} + + +// --- create 'DicomImage' from valid 'DicomObject' with given modality LUT (specified by 'data' and 'descriptor') + +DicomImage::DicomImage(DcmObject *object, + E_TransferSyntax xfer, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation, + const unsigned long flags, + const unsigned long fstart, + const unsigned long fcount) + : ImageStatus(EIS_Normal), + PhotometricInterpretation(EPI_Unknown), + Document(NULL), + Image(NULL) +{ + if (checkDataDictionary()) // valid 'dicom.dic' found ? + { + Document = new DiDocument(object, xfer, flags, fstart, fcount); + if ((Document != NULL) && (Document->good())) + { + PhotometricInterpretation = EPI_Monochrome2; // default for presentation states + Image = new DiMono2Image(Document, ImageStatus, data, descriptor, explanation); + } + } +} + + +// --- protected: create 'DicomImage' from source with different image data and photometric interpretation + +DicomImage::DicomImage(const DicomImage *dicom, + DiImage *image, + const EP_Interpretation interpret) + : ImageStatus(dicom->ImageStatus), + PhotometricInterpretation(dicom->PhotometricInterpretation), + Document(dicom->Document), // necessary, ever used ?? + Image(image) +{ + if (interpret != EPI_Unknown) + PhotometricInterpretation = interpret; + if (Document != NULL) + Document->addReference(); // 'Document' is only referenced not copied ! +} + + +/*--------------* + * destructor * + *--------------*/ + +DicomImage::~DicomImage() +{ + delete Image; + if (Document != NULL) + Document->removeReference(); // only delete if object is no longer referenced +} + + +/*********************************************************************/ + +// --- initialize 'DicomImage' object (same procedure for every 'real' constructor) + +void DicomImage::Init() +{ + if ((Document != NULL) && (Document->good())) + { + const char *str; + if (hasSOPclassUID(UID_RETIRED_StandaloneOverlayStorage)) + { + PhotometricInterpretation = EPI_Monochrome2; // standalone overlays are handled like monochrome + Image = new DiOverlayImage(Document, ImageStatus); // images without pixel data + } + else if (Document->getFlags() & CIF_UsePresentationState) + { + PhotometricInterpretation = EPI_Monochrome2; // default for presentation states + Image = new DiMono2Image(Document, ImageStatus); + } + else if (strlen(str = Document->getPhotometricInterpretation()) > 0) + { + const SP_Interpretation *pin = PhotometricInterpretationNames; + char *cstr = new char[strlen(str) + 1]; + if (cstr != NULL) + { + char *q = cstr; + unsigned char c; + for (const char *p = str; *p != 0; p++) // remove invalid chars + { + c = OFstatic_cast(unsigned char, *p); + if (isalpha(c)) + *(q++) = toupper(c); + else if (isdigit(c)) + *(q++) = c; + } + *q = '\0'; // end of C string + while ((pin->Name != NULL) && (strcmp(pin->Name, cstr) != 0)) + ++pin; + delete[] cstr; + } else { + DCMIMGLE_WARN("can't create filtered version of 'PhotometricInterpretation' (" << str << ")"); + cstr = OFconst_cast(char *, str); // just reference the original string + while ((pin->DefinedTerm != NULL) && (strcmp(pin->DefinedTerm, cstr) != 0)) + ++pin; + } + PhotometricInterpretation = pin->Type; // unknown if last entry + switch (PhotometricInterpretation) + { + case EPI_Monochrome1: // create 'Image' depending on color model + Image = new DiMono1Image(Document, ImageStatus); + break; + case EPI_Monochrome2: + Image = new DiMono2Image(Document, ImageStatus); + break; + default: // unknown or unsupported color model + if (DiRegisterBase::Pointer != NULL) + Image = DiRegisterBase::Pointer->createImage(Document, ImageStatus, PhotometricInterpretation); + if (Image == NULL) + { + if (PhotometricInterpretation == EPI_Unknown) + { + ImageStatus = EIS_InvalidValue; + DCMIMGLE_ERROR("invalid value for 'PhotometricInterpretation' (" << str << ")"); + } else { + ImageStatus = EIS_NotSupportedValue; + DCMIMGLE_ERROR("unsupported value for 'PhotometricInterpretation' (" << str << ")"); + } + } + } + } + else if (Document->getFlags() & CIF_AcrNemaCompatibility) // ACR-NEMA has no 'photometric interpretation' + { + PhotometricInterpretation = EPI_Monochrome2; + Image = new DiMono2Image(Document, ImageStatus); + } else { + ImageStatus = EIS_MissingAttribute; + PhotometricInterpretation = EPI_Missing; + if (Document->getPixelData() != NULL) + DCMIMGLE_ERROR("mandatory attribute 'PhotometricInterpretation' is missing or can't be determined"); + } + } + else + ImageStatus = EIS_InvalidDocument; +} + + +// --- check whether the loadable 'DataDictionary' is present/loaded + +int DicomImage::checkDataDictionary() +{ + if (!dcmDataDict.isDictionaryLoaded()) + { + ImageStatus = EIS_NoDataDictionary; + DCMIMGLE_ERROR("can't load data dictionary"); + } + return ImageStatus == EIS_Normal; +} + + +/*********************************************************************/ + + +const char *DicomImage::getString(const EI_Status status) +{ + switch (status) + { + case EIS_Normal: + return "Status OK"; + case EIS_NoDataDictionary: + return "No data dictionary"; + case EIS_InvalidDocument: + return "Invalid DICOM document"; + case EIS_MissingAttribute: + return "Missing attribute"; + case EIS_InvalidValue: + return "Invalid element value"; + case EIS_NotSupportedValue: + return "Unsupported element value"; + case EIS_MemoryFailure: + return "Out of memory"; + case EIS_InvalidImage: + return "Invalid DICOM image"; + case EIS_OtherError: + default: + return "Unspecified"; + } +} + + +const char *DicomImage::getString(const EP_Interpretation interpret) +{ + const SP_Interpretation *pin = PhotometricInterpretationNames; + while ((pin->DefinedTerm != NULL) && (pin->Type != interpret)) + ++pin; + return pin->DefinedTerm; +} + + +// --- return unique 'SOPclassUID' string + +const char *DicomImage::getSOPclassUID() const +{ + if (Document != NULL) + { + const char *str; + if (Document->getValue(DCM_SOPClassUID, str)) + return str; + } + return NULL; +} + + +// --- return 'true' (1) if 'Document' has the same 'SOPclassUID' as given in parameter 'uid' + +int DicomImage::hasSOPclassUID(const char *uid) const +{ + const char *str = getSOPclassUID(); + return (str != NULL) && (strcmp(str, uid) == 0); +} + + +// --- create new 'DicomImage' with 'fcount' frames starting with frame 'fstart' + +DicomImage *DicomImage::createDicomImage(unsigned long fstart, + unsigned long fcount) const +{ + if ((Image != NULL) && (fstart < getFrameCount())) + { + if ((fcount == 0) || (fstart + fcount > getFrameCount())) + fcount = getFrameCount() - fstart; + DiImage *image = Image->createImage(fstart, fcount); + if (image != NULL) + { + DicomImage *dicom = new DicomImage(this, image); + return dicom; + } + } + return NULL; +} + + +// --- create scaled to given size ('width' and 'height') image, memory isn't handled internally ! +// --- if one dimension ist '0' the other is automatically adjusted (with respect to pixel aspect ratio) + +DicomImage *DicomImage::createScaledImage(const unsigned long width, + const unsigned long height, + const int interpolate, + int aspect) const +{ + return createScaledImage(0, 0, getWidth(), getHeight(), width, height, interpolate, aspect); +} + + +// --- create scaled with given factors ('xfactor' and 'yfactor') image, memory isn't handled internally ! + +DicomImage *DicomImage::createScaledImage(const double xfactor, + const double yfactor, + const int interpolate, + const int aspect) const +{ + return createScaledImage(0, 0, getWidth(), getHeight(), OFstatic_cast(unsigned long, xfactor * getWidth()), + OFstatic_cast(unsigned long, yfactor * getHeight()), interpolate, aspect); +} + + +// --- clip & scale + +DicomImage *DicomImage::createScaledImage(const signed long left_pos, + const signed long top_pos, + unsigned long clip_width, + unsigned long clip_height, + unsigned long scale_width, + unsigned long scale_height, + const int interpolate, + int aspect, + const Uint16 pvalue) const +{ + const unsigned long gw = getWidth(); + const unsigned long gh = getHeight(); + if ((Image != NULL) && (gw > 0) && (gh > 0)) + { + if ((clip_width == 0) && (left_pos < OFstatic_cast(signed long, gw))) // set 'width' if parameter is missing + clip_width = gw - left_pos; + if ((clip_height == 0) && (top_pos < OFstatic_cast(signed long, gh))) // same for 'height' + clip_height = gh - top_pos; + if ((scale_width == 0) && (scale_height == 0)) + { + scale_width = clip_width; // auto-set width/height + scale_height = clip_height; + } + else if ((clip_width > 0) && (clip_height > 0)) + { + if (aspect) // maintain pixel aspect ratio + { + if (scale_width == 0) + scale_width = OFstatic_cast(unsigned long, getWidthHeightRatio() * OFstatic_cast(double, scale_height * clip_width) / clip_height); + else if (scale_height == 0) + scale_height = OFstatic_cast(unsigned long, getHeightWidthRatio() * OFstatic_cast(double, scale_width * clip_height) / clip_width); + else + aspect = 0; // ignore pixel aspect ratio + } + else // ignore pixel aspect ratio + { + if (scale_width == 0) + scale_width = OFstatic_cast(unsigned long, OFstatic_cast(double, scale_height * clip_width) / clip_height); + else if (scale_height == 0) + scale_height = OFstatic_cast(unsigned long, OFstatic_cast(double, scale_width * clip_height) / clip_width); + } + } + const unsigned long maxvalue = DicomImageClass::maxval(bitsof(Uint16)); + if (scale_width > maxvalue) + scale_width = maxvalue; // limit 'width' to maximum value (65535) + if (scale_height > maxvalue) + scale_height = maxvalue; // same for 'height' + + /* need to limit clipping region ... !? */ + + if (((left_pos < 0) || (OFstatic_cast(unsigned long, left_pos + clip_width) > gw) || + (top_pos < 0) || (OFstatic_cast(unsigned long, top_pos + clip_height) > gh)) && + ((clip_width != scale_width) || (clip_height != scale_height))) + { + DCMIMGLE_ERROR("combined clipping & scaling outside image boundaries not yet supported"); + } + else if ((scale_width > 0) && (scale_height > 0)) + { + DiImage *image = Image->createScale(left_pos, top_pos, clip_width, clip_height, scale_width, scale_height, + interpolate, aspect, pvalue); + if (image != NULL) + { + DicomImage *dicom = new DicomImage(this, image); + return dicom; + } + } + } + return NULL; +} + + +// --- clip & scale + +DicomImage *DicomImage::createScaledImage(const signed long left_pos, + const signed long top_pos, + unsigned long width, + unsigned long height, + const double xfactor, + const double yfactor, + const int interpolate, + const int aspect, + const Uint16 pvalue) const +{ + if ((xfactor >= 0) && (yfactor >= 0)) + { + const unsigned long gw = getWidth(); + const unsigned long gh = getHeight(); + if ((width == 0) && (left_pos < OFstatic_cast(signed long, gw))) // set 'width' if parameter is missing (0) + width = gw - left_pos; + if ((height == 0) && (top_pos < OFstatic_cast(signed long, gh))) // same for 'height' + height = gh - top_pos; + return createScaledImage(left_pos, top_pos, width, height, OFstatic_cast(unsigned long, xfactor * width), + OFstatic_cast(unsigned long, yfactor * height), interpolate, aspect, pvalue); + } + return NULL; +} + + +// --- create clipped to given box ('left_pos', 'top_pos' and 'width', 'height') image, +// ---- memory isn't handled internally! 'width' and 'height' are optional + +DicomImage *DicomImage::createClippedImage(const signed long left_pos, + const signed long top_pos, + unsigned long width, + unsigned long height, + const Uint16 pvalue) const +{ + return createScaledImage(left_pos, top_pos, width, height, OFstatic_cast(unsigned long, 0), + OFstatic_cast(unsigned long, 0), 0, 0, pvalue); +} + + +// --- flip image (horizontal: x > 1 and/or vertical y > 1) + +int DicomImage::flipImage(int horz, + int vert) const +{ + if ((Image != NULL) && (horz || vert)) + { + if (getWidth() <= 1) + horz = 0; + if (getHeight() <= 1) + vert = 0; + if (horz || vert) + return Image->flip(horz, vert); + else + return 2; + } + return 0; +} + + +// --- create flipped image (horizontal: x > 1 and/or vertical y > 1), memory isn't handled internally ! + +DicomImage *DicomImage::createFlippedImage(int horz, + int vert) const +{ + if ((Image != NULL) && (horz || vert)) + { + if (getWidth() <= 1) // can't flip horizontally + horz = 0; + if (getHeight() <= 1) // can't flip vertically + vert = 0; + DiImage *image; + if (horz || vert) // flip at least one axis + image = Image->createFlip(horz, vert); + else // copy image + image = Image->createImage(0, getFrameCount()); + if (image != NULL) + { + DicomImage *dicom = new DicomImage(this, image); + return dicom; + } + } + return NULL; +} + + +// -- normalize given 'degree' value to 0, 90, 180, 270 + +int DicomImage::normalizeDegreeValue(signed int °ree) const +{ + switch (degree) + { + case 0: + case 360: + case -360: + degree = 0; + return 1; + case 90: + case -270: + degree = 90; + return 1; + case 180: + case -180: + degree = 180; + return 1; + case 270: + case -90: + degree = 270; + return 1; + default: + return 0; + } +} + + +// --- rotate image by given 'degree' + +int DicomImage::rotateImage(signed int degree) const +{ + if ((Image != NULL) && normalizeDegreeValue(degree)) + { + if ((degree == 0) || (getWidth() * getHeight() <= 1)) // nothing to do + return 2; + else + return Image->rotate(OFstatic_cast(int, degree)); + } + return 0; +} + + +// --- create by given 'degree' rotated image, memory isn't handled internally ! + +DicomImage *DicomImage::createRotatedImage(signed int degree) const +{ + if ((Image != NULL) && normalizeDegreeValue(degree)) + { + DiImage *image = Image->createRotate(OFstatic_cast(int, degree)); + if (image != NULL) + { + DicomImage *dicom = new DicomImage(this, image); + return dicom; + } + } + return NULL; +} + + +// --- create color-image to mono-image with given 'red', 'green' and 'blue' coefficients converted image, memory ... ! + +DicomImage *DicomImage::createMonochromeImage(const double red, + const double green, + const double blue) const +{ + if (Image != NULL) + { + DiImage *image = Image->createMono(red, green, blue); // create monochrome image data + if (image != NULL) + { + DicomImage *dicom = new DicomImage(this, image, EPI_Monochrome2); + return dicom; + } + } + return NULL; +} + + +// --- create monochrome output image of specified frame (incl. windowing) + +DicomImage *DicomImage::createMonoOutputImage(const unsigned long frame, + const int bits) +{ + if ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) + { + DiImage *image = Image->getMonoImagePtr()->createOutputImage(frame, bits); + if (image != NULL) + { + DicomImage *dicom = new DicomImage(this, image, EPI_Monochrome2); + return dicom; + } + } + return NULL; +} + + +/*********************************************************************/ + + +// --- write 'frame' of image data to 'filename' with 'bits' depth + +int DicomImage::writePPM(const char *filename, + const int bits, + const unsigned long frame) +{ + if ((filename != NULL) && (Image != NULL)) + { + char fname[FILENAME_MAX + 1]; + if (sprintf(fname, filename, frame) >= 0) // replace '%d' etc. with frame number + filename = fname; + FILE *stream = fopen(filename, "w"); // open text file for writing + int ok = writePPM(stream, bits, frame); + fclose(stream); + return ok; + } + return 0; +} + + +// --- same for C++ 'ostream' + +int DicomImage::writePPM(STD_NAMESPACE ostream& stream, + const int bits, + const unsigned long frame) +{ + if ((stream.good()) && (Image != NULL)) + return Image->writePPM(stream, frame, Image->getBits(bits)); + return 0; +} + + +// --- same for C 'FILE' + +int DicomImage::writePPM(FILE *stream, + const int bits, + const unsigned long frame) +{ + if ((stream != NULL) && (Image != NULL)) + return Image->writePPM(stream, frame, Image->getBits(bits)); + return 0; +} + + +// --- same for RAW PPM (binary form of PPM with a maximum of 8 bits depth) + +int DicomImage::writeRawPPM(const char *filename, + const int bits, + const unsigned long frame) +{ + if ((filename != NULL) && (Image != NULL) && (Image->getBits(bits) <= MAX_RAWPPM_BITS)) + { + char fname[FILENAME_MAX + 1]; + if (sprintf(fname, filename, frame) >= 0) // replace '%d' etc. with frame number + filename = fname; + FILE *stream = fopen(filename, "wb"); // open binary file for writing + if (stream != NULL) + { + int ok = Image->writeRawPPM(stream, frame, Image->getBits(bits)); + fclose(stream); + return ok; + } + } + return 0; +} + +// --- same for C 'FILE' + +int DicomImage::writeRawPPM(FILE *stream, + const int bits, + const unsigned long frame) +{ + if ((stream != NULL) && (Image != NULL)) + return Image->writeRawPPM(stream, frame, Image->getBits(bits)); + return 0; +} + + +// --- write 'frame' of image data to 'filename' with 'bits' depth in BMP format + +int DicomImage::writeBMP(const char *filename, + const int bits, + const unsigned long frame) +{ + if ((filename != NULL) && (Image != NULL) && + ((bits == 0) || ((bits == 8) && isMonochrome()) || (bits == 24) || (bits == 32))) + { + char fname[FILENAME_MAX + 1]; + if (sprintf(fname, filename, frame) >= 0) // replace '%d' etc. with frame number + filename = fname; + FILE *stream = fopen(filename, "wb"); // open binary file for writing + if (stream != NULL) + { + int ok = Image->writeBMP(stream, frame, bits); + fclose(stream); + return ok; + } + } + return 0; +} + + +// --- same for open C 'FILE' in BMP format + +int DicomImage::writeBMP(FILE *stream, + const int bits, + const unsigned long frame) +{ + if ((stream != NULL) && (Image != NULL) && + ((bits == 0) || ((bits == 8) && isMonochrome()) || (bits == 24) || (bits == 32))) + { + return Image->writeBMP(stream, frame, bits); + } + return 0; +} + + +// --- write 'frame' of image data to 'filename' plugable image format + +int DicomImage::writePluginFormat(const DiPluginFormat *plugin, + const char *filename, + const unsigned long frame) +{ + if ((plugin != NULL) && (filename != NULL) && (Image != NULL)) + { + char fname[FILENAME_MAX + 1]; + if (sprintf(fname, filename, frame) >= 0) // replace '%d' etc. with frame number + filename = fname; + FILE *stream = fopen(filename, "wb"); // open binary file for writing + if (stream != NULL) + { + int ok = plugin->write(Image, stream, frame); + fclose(stream); + return ok; + } + } + return 0; +} + + +// --- same for open C 'FILE' in plugable image format + +int DicomImage::writePluginFormat(const DiPluginFormat *plugin, + FILE *stream, + const unsigned long frame) +{ + if ((plugin != NULL) && (stream != NULL) && (Image != NULL)) + return plugin->write(Image, stream, frame); + return 0; +} diff --git a/dcmimgle/libsrc/dibaslut.cc b/dcmimgle/libsrc/dibaslut.cc new file mode 100644 index 00000000..415ed964 --- /dev/null +++ b/dcmimgle/libsrc/dibaslut.cc @@ -0,0 +1,102 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomBaseLUT (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dibaslut.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiBaseLUT::DiBaseLUT(const Uint32 count, + const Uint16 bits) + : Count(count), + FirstEntry(0), + Bits(bits), + MinValue(0), + MaxValue(0), + Valid(0), + Explanation(), + Data(NULL), + DataBuffer(NULL) +{ +} + + +DiBaseLUT::DiBaseLUT(Uint16 *buffer, + const Uint32 count, + const Uint16 bits) + : Count(count), + FirstEntry(0), + Bits(bits), + MinValue(0), + MaxValue(0), + Valid(0), + Explanation(), + Data(buffer), + DataBuffer(buffer) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiBaseLUT::~DiBaseLUT() +{ + delete[] DataBuffer; +} + + +/********************************************************************/ + + +OFBool DiBaseLUT::operator==(const DiBaseLUT &lut) +{ + return (compare(&lut) == 0); +} + + +int DiBaseLUT::compare(const DiBaseLUT *lut) +{ + int result = 1; // invalid LUT (1) + if (Valid && (lut != NULL) && lut->isValid()) + { + result = 2; // descriptor differs (2) + if ((Count == lut->getCount()) && (FirstEntry == lut->getFirstEntry()) && (Bits == lut->getBits())) + { // special case: if Count == 0 LUT data is equal + Uint32 i = Count; // ... but normally not Valid ! + if ((MinValue == lut->getMinValue()) && (MaxValue == lut->getMaxValue())) + { // additional check for better performance + const Uint16 *p = Data; + const Uint16 *q = lut->getData(); + while ((i != 0) && (*(p++) == *(q++))) + --i; + } + result = (i != 0) ? 3 : 0; // check whether data is equal (0) + } + } + return result; +} diff --git a/dcmimgle/libsrc/diciefn.cc b/dcmimgle/libsrc/diciefn.cc new file mode 100644 index 00000000..688df221 --- /dev/null +++ b/dcmimgle/libsrc/diciefn.cc @@ -0,0 +1,241 @@ +/* + * + * Copyright (C) 1998-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomCIELABFunction (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diciefn.h" +#include "dcmtk/ofstd/ofstream.h" + +#define INCLUDE_CMATH +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiCIELABFunction::DiCIELABFunction(const char *filename, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(filename, deviceType, ord) +{ + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY file ... ignoring"); + } +} + + +DiCIELABFunction::DiCIELABFunction(const double *val_tab, // UNTESTED !! + const unsigned long count, + const Uint16 max, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(val_tab, count, max, deviceType, ord) +{ + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY values ... ignoring"); + } +} + + +DiCIELABFunction::DiCIELABFunction(const Uint16 *ddl_tab, // UNTESTED !! + const double *val_tab, + const unsigned long count, + const Uint16 max, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(ddl_tab, val_tab, count, max, deviceType, ord) +{ + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY values ... ignoring"); + } +} + + +DiCIELABFunction::DiCIELABFunction(const double val_min, + const double val_max, + const unsigned long count, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(val_min, val_max, count, deviceType, ord) +{ + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY values ... ignoring"); + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiCIELABFunction::~DiCIELABFunction() +{ +} + + +/********************************************************************/ + + +DiDisplayLUT *DiCIELABFunction::getDisplayLUT(unsigned long count) +{ + DiDisplayLUT *lut = NULL; + if (count <= MAX_TABLE_ENTRY_COUNT) + { + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + /* hardcopy: values are in optical density, first convert them to luminance */ + double *tmp_tab = convertODtoLumTable(LODValue, ValueCount, OFFalse /*useAmb*/); + if (tmp_tab != NULL) + { + checkMinMaxDensity(); + /* create new CIELAB LUT */ + lut = new DiCIELABLUT(count, MaxDDLValue, DDLValue, tmp_tab, ValueCount, + convertODtoLum(MaxValue, OFFalse /*useAmb*/), convertODtoLum(MinValue, OFFalse /*useAmb*/), + getMinLuminanceValue(), getMaxLuminanceValue(), AmbientLight, (DeviceType == EDT_Scanner)); + /* delete temporary table */ + delete[] tmp_tab; + } + } else { + /* softcopy: values are already in luminance */ + lut = new DiCIELABLUT(count, MaxDDLValue, DDLValue, LODValue, ValueCount, + MinValue, MaxValue, -1 /*Lmin*/, -1 /*Lmax*/, AmbientLight, (DeviceType == EDT_Camera)); + } + } + return lut; +} + + +int DiCIELABFunction::writeCurveData(const char *filename, + const OFBool mode) +{ + if ((filename != NULL) && (strlen(filename) > 0)) + { + STD_NAMESPACE ofstream file(filename); + if (file) + { + const OFBool inverseLUT = (DeviceType == EDT_Scanner) || (DeviceType == EDT_Camera); + /* comment header */ + file << "# Display function : CIELAB" << OFendl; + if (DeviceType == EDT_Printer) + file << "# Type of output device : Printer (hardcopy)" << OFendl; + else if (DeviceType == EDT_Scanner) + file << "# Type of output device : Scanner (hardcopy)" << OFendl; + else if (DeviceType == EDT_Camera) + file << "# Type of output device : Camera (softcopy)" << OFendl; + else + file << "# Type of output device : Monitor (softcopy)" << OFendl; + file << "# Digital driving levels : " << ValueCount << OFendl; + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + file << "# Illumination [cd/m^2] : " << Illumination << OFendl; + file << "# Ambient light [cd/m^2] : " << AmbientLight << OFendl; + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + const double min_lum = getMinLuminanceValue(); + const double max_lum = getMaxLuminanceValue(); + file << "# Luminance w/o [cd/m^2] : " << convertODtoLum(MaxValue, OFFalse /*useAmb*/) << " - " + << convertODtoLum(MinValue, OFFalse /*useAmb*/); + if ((min_lum >= 0) || (max_lum >= 0)) + { + file << " (Lmin = "; + if (min_lum >= 0) + file << min_lum; + else + file << "n/s"; + file << ", Lmax = "; + if (max_lum >= 0) + file << max_lum; + else + file << "n/s"; + file << ")"; + } + file << OFendl; + file << "# Optical density [OD] : " << MinValue << " - " << MaxValue; + if ((MinDensity >= 0) || (MaxDensity >= 0)) + { + file << " (Dmin = "; + if (MinDensity >= 0) + file << MinDensity; + else + file << "n/s"; + file << ", Dmax = "; + if (MaxDensity >= 0) + file << MaxDensity; + else + file << "n/s"; + file << ")"; + } + file << OFendl; + } else + file << "# Luminance w/o [cd/m^2] : " << MinValue << " - " << MaxValue << OFendl; + file << "# Interpolation method : "; + if (getPolynomialOrder() > 0) + file << "Curve fitting algorithm with order " << getPolynomialOrder() << OFendl << OFendl; + else + file << "Cubic spline interpolation" << OFendl << OFendl; + /* print headings of the table */ + if (mode) + { + file << "# NB: values for CC, CIELAB and PSC"; + if (inverseLUT) + file << "'"; // add ' to PSC + file << " are specified in cd/m^2" << OFendl << OFendl; + file << "DDL\tCC\tCIELAB\tPSC"; + if (inverseLUT) + file << "'"; // add ' to PSC + file << OFendl; + } else { + file << "# NB: values for CC and CIELAB are specified in cd/m^2" << OFendl << OFendl; + file << "DDL\tCIELAB" << OFendl; + } + /* create CIELAB LUT and write curve data to file */ + DiCIELABLUT *lut = NULL; + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + /* hardcopy: values are in optical density, first convert them to luminance */ + double *tmp_tab = convertODtoLumTable(LODValue, ValueCount, OFFalse /*useAmb*/); + if (tmp_tab != NULL) + { + checkMinMaxDensity(); + lut = new DiCIELABLUT(ValueCount, MaxDDLValue, DDLValue, tmp_tab, ValueCount, + convertODtoLum(MaxValue, OFFalse /*useAmb*/), convertODtoLum(MinValue, OFFalse /*useAmb*/), + getMinLuminanceValue(), getMaxLuminanceValue(), AmbientLight, inverseLUT, &file, mode); + /* delete temporary table */ + delete[] tmp_tab; + } + } else { + /* softcopy: values are already in luminance */ + lut = new DiCIELABLUT(ValueCount, MaxDDLValue, DDLValue, LODValue, ValueCount, + MinValue, MaxValue, -1 /*Lmin*/, -1 /*Lmax*/, AmbientLight, inverseLUT, &file, mode); + } + int status = (lut != NULL) && (lut->isValid()); + delete lut; + return status; + } + } + return 0; +} diff --git a/dcmimgle/libsrc/dicielut.cc b/dcmimgle/libsrc/dicielut.cc new file mode 100644 index 00000000..243b3591 --- /dev/null +++ b/dcmimgle/libsrc/dicielut.cc @@ -0,0 +1,198 @@ +/* + * + * Copyright (C) 1999-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomCIELABLUT (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dicielut.h" + +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiCIELABLUT::DiCIELABLUT(const unsigned long count, + const Uint16 max, + const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double val_min, + const double val_max, + const double lum_min, + const double lum_max, + const double amb, + const OFBool inverse, + STD_NAMESPACE ostream *stream, + const OFBool printMode) + : DiDisplayLUT(count, max, amb /*, 'illum' not used*/) +{ + if ((Count > 0) && (Bits > 0)) + { + DCMIMGLE_DEBUG("new CIELAB LUT with " << Bits << " bits output and " << Count << " entries created"); + if (val_min >= val_max) + { + DCMIMGLE_ERROR("invalid value range for CIELAB LUT creation (" << val_min << " - " << val_max << ")"); + } + /* create the lookup table */ + Valid = createLUT(ddl_tab, val_tab, ddl_cnt, val_min, val_max, lum_min, lum_max, + inverse, stream, printMode); + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiCIELABLUT::~DiCIELABLUT() +{ +} + + +/********************************************************************/ + + +int DiCIELABLUT::createLUT(const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double val_min, + const double val_max, + const double lum_min, + const double lum_max, + const OFBool inverse, + STD_NAMESPACE ostream *stream, + const OFBool printMode) +{ + int status = 0; + if ((ddl_tab != NULL) && (val_tab != NULL) && (ddl_cnt > 0) && (val_max > 0) && (val_min < val_max)) + { + const unsigned long cin_ctn = (inverse) ? ddl_cnt : Count; // number of points to be interpolated + double *cielab = new double[cin_ctn]; + if (cielab != NULL) + { + unsigned long i; + double llin = 0; + double cub = 0; + const double amb = getAmbientLightValue(); + /* check whether Lmin or Lmax is set */ + const double min = (lum_min < 0) ? val_min + amb : lum_min /*includes 'amb'*/; + const double max = (lum_max < 0) ? val_max + amb : lum_max /*includes 'amb'*/; + const double lmin = min / max; + const double hmin = (lmin > 0.008856) ? 116.0 * pow(lmin, 1.0 / 3.0) - 16 : 903.3 * lmin; + const double lfac = (100.0 - hmin) / (OFstatic_cast(double, cin_ctn - 1) * 903.3); + const double loff = hmin / 903.3; + const double cfac = (100.0 - hmin) / (OFstatic_cast(double, cin_ctn - 1) * 116.0); + const double coff = (16.0 + hmin) / 116.0; + for (i = 0; i < cin_ctn; ++i) // compute CIELAB function + { + llin = OFstatic_cast(double, i) * lfac + loff; + cub = OFstatic_cast(double, i) * cfac + coff; + cielab[i] = ((llin > 0.008856) ? cub * cub * cub : llin) * max; + } + DataBuffer = new Uint16[Count]; + if (DataBuffer != NULL) // create look-up table + { + Uint16 *q = DataBuffer; + unsigned long j = 0; + /* check whether to apply the inverse transformation */ + if (inverse) + { + double v; + const double factor = OFstatic_cast(double, ddl_cnt - 1) / OFstatic_cast(double, Count - 1); + /* convert from DDL */ + for (i = 0; i < Count; ++i) + { + v = val_tab[OFstatic_cast(int, i * factor)] + amb; // need to scale index to range of value table + while ((j + 1 < ddl_cnt) && (cielab[j] < v)) // search for closest index, assuming monotony + ++j; + if ((j > 0) && (fabs(cielab[j - 1] - v) < fabs(cielab[j] - v))) + --j; + *(q++) = ddl_tab[j]; + } + } else { + /* initial DDL boundaries */ + unsigned long ddl_min = 0; + unsigned long ddl_max= ddl_cnt - 1; + /* check whether minimum luminance is specified */ + if (lum_min >= 0) + { + j = ddl_min; + /* determine corresponding minimum DDL value */ + while ((j < ddl_max) && (val_tab[j] + amb < lum_min)) + ++j; + ddl_min = j; + } + /* check whether maximum luminance is specified */ + if (lum_max >= 0) + { + j = ddl_max; + /* determine corresponding maximum DDL value */ + while ((j > ddl_min) && (val_tab[j] + amb > lum_max)) + --j; + ddl_max = j; + } + j = ddl_min; + const double *r = cielab; + /* convert to DDL */ + for (i = Count; i != 0; --i, ++r) + { + while ((j < ddl_max) && (val_tab[j] + amb < *r)) // search for closest index, assuming monotony + ++j; + if ((j > 0) && (fabs(val_tab[j - 1] + amb - *r) < fabs(val_tab[j] + amb - *r))) + --j; + *(q++) = ddl_tab[j]; + } + } + Data = DataBuffer; + if (stream != NULL) // write curve data to file + { + if (Count == ddl_cnt) // check whether CIELAB LUT fits exactly to DISPLAY file + { + for (i = 0; i < ddl_cnt; ++i) + { + (*stream) << ddl_tab[i]; // DDL + stream->setf(STD_NAMESPACE ios::fixed, STD_NAMESPACE ios::floatfield); + if (printMode) + (*stream) << "\t" << val_tab[i] + amb; // CC + (*stream) << "\t" << cielab[i]; // CIELAB + if (printMode) + { + if (inverse) + (*stream) << "\t" << cielab[Data[i]]; // PSC' + else + (*stream) << "\t" << val_tab[Data[i]] + amb; // PSC + } + (*stream) << OFendl; + } + } else { + DCMIMGLE_WARN("can't write curve data, wrong DISPLAY file or CIELAB LUT"); + } + } + status = 1; + } + } + delete[] cielab; + } + return status; +} diff --git a/dcmimgle/libsrc/didislut.cc b/dcmimgle/libsrc/didislut.cc new file mode 100644 index 00000000..26b334ee --- /dev/null +++ b/dcmimgle/libsrc/didislut.cc @@ -0,0 +1,49 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomDisplayLUT (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/didislut.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiDisplayLUT::DiDisplayLUT(const unsigned long count, + const Uint16 max, + const double amb, + const double illum) + : DiBaseLUT(count, DicomImageClass::tobits(max, 0)), + AmbientLight((amb > 0) ? amb : 0), + Illumination((illum > 0) ? illum : 0) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiDisplayLUT::~DiDisplayLUT() +{ +} diff --git a/dcmimgle/libsrc/didispfn.cc b/dcmimgle/libsrc/didispfn.cc new file mode 100644 index 00000000..e1b956b1 --- /dev/null +++ b/dcmimgle/libsrc/didispfn.cc @@ -0,0 +1,675 @@ +/* + * + * Copyright (C) 1999-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomDisplayFunction (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/dcmimgle/didispfn.h" +#include "dcmtk/dcmimgle/displint.h" +#include "dcmtk/dcmimgle/dicrvfit.h" +#include "dcmtk/dcmimgle/didislut.h" +#include "dcmtk/ofstd/ofstream.h" + +#define INCLUDE_CCTYPE +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + + +/*----------------------------* + * constant initializations * + *----------------------------*/ + +const int DiDisplayFunction::MinBits = 2; +const int DiDisplayFunction::MaxBits = 16; + + +/*----------------* + * constructors * + *----------------*/ + +DiDisplayFunction::DiDisplayFunction(const char *filename, + const E_DeviceType deviceType, + const signed int ord) + : Valid(0), + DeviceType(deviceType), + ValueCount(0), + MaxDDLValue(0), + Order(0), + AmbientLight(0), + Illumination(0), + MinDensity(-1), + MaxDensity(-1), + DDLValue(NULL), + LODValue(NULL), + MinValue(0), + MaxValue(0) +{ + OFBitmanipTemplate::zeroMem(LookupTable, MAX_NUMBER_OF_TABLES); + if (readConfigFile(filename)) + { + /* overwrite file setting for polynomial order */ + if (ord >= 0) + Order = ord; + Valid = createSortedTable(DDLValue, LODValue) && calculateMinMax() && interpolateValues(); + } +} + + +DiDisplayFunction::DiDisplayFunction(const double *val_tab, // UNTESTED !! + const unsigned long count, + const Uint16 max, + const E_DeviceType deviceType, + const signed int ord) + : Valid(0), + DeviceType(deviceType), + ValueCount(count), + MaxDDLValue(max), + Order(ord), + AmbientLight(0), + Illumination(0), + MinDensity(-1), + MaxDensity(-1), + DDLValue(NULL), + LODValue(NULL), + MinValue(0), + MaxValue(0) +{ + OFBitmanipTemplate::zeroMem(LookupTable, MAX_NUMBER_OF_TABLES); + /* check number of entries */ + if ((ValueCount > 0) && (ValueCount == OFstatic_cast(unsigned long, MaxDDLValue) + 1)) + { + /* copy value table */ + DDLValue = new Uint16[ValueCount]; + LODValue = new double[ValueCount]; + if ((DDLValue != NULL) && (LODValue != NULL)) + { + unsigned int i; + for (i = 0; i <= MaxDDLValue; ++i) + { + DDLValue[i] = OFstatic_cast(Uint16, i); // set DDL values + LODValue[i] = val_tab[i]; // copy table + } + Valid = calculateMinMax(); + } + } +} + + +DiDisplayFunction::DiDisplayFunction(const Uint16 *ddl_tab, // UNTESTED !! + const double *val_tab, + const unsigned long count, + const Uint16 max, + const E_DeviceType deviceType, + const signed int ord) + : Valid(0), + DeviceType(deviceType), + ValueCount(count), + MaxDDLValue(max), + Order(ord), + AmbientLight(0), + Illumination(0), + MinDensity(-1), + MaxDensity(-1), + DDLValue(NULL), + LODValue(NULL), + MinValue(0), + MaxValue(0) +{ + OFBitmanipTemplate::zeroMem(LookupTable, MAX_NUMBER_OF_TABLES); + /* check for maximum number of entries */ + if (ValueCount <= MAX_TABLE_ENTRY_COUNT) + Valid = createSortedTable(ddl_tab, val_tab) && calculateMinMax() && interpolateValues(); +} + + +DiDisplayFunction::DiDisplayFunction(const double val_min, + const double val_max, + const unsigned long count, + const E_DeviceType deviceType, + const signed int ord) + : Valid(0), + DeviceType(deviceType), + ValueCount(count), + MaxDDLValue(0), + Order(ord), + AmbientLight(0), + Illumination(0), + MinDensity(-1), + MaxDensity(-1), + DDLValue(NULL), + LODValue(NULL), + MinValue(val_min), + MaxValue(val_max) +{ + OFBitmanipTemplate::zeroMem(LookupTable, MAX_NUMBER_OF_TABLES); + /* check parameters */ + if ((ValueCount > 1) && (ValueCount <= MAX_TABLE_ENTRY_COUNT) && (MinValue < MaxValue)) + { + /* create value tables */ + MaxDDLValue = OFstatic_cast(Uint16, count - 1); + DDLValue = new Uint16[ValueCount]; + LODValue = new double[ValueCount]; + if ((DDLValue != NULL) && (LODValue != NULL)) + { + Uint16 i; + const double min = ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) ? val_max : val_min; + const double max = ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) ? val_min : val_max; + const double val = (max - min) / OFstatic_cast(double, MaxDDLValue); + DDLValue[0] = 0; + LODValue[0] = min; + for (i = 1; i < MaxDDLValue; ++i) + { + DDLValue[i] = i; // set DDL values + LODValue[i] = LODValue[i - 1] + val; // compute luminance/OD value + } + DDLValue[MaxDDLValue] = MaxDDLValue; + LODValue[MaxDDLValue] = max; + Valid = 1; + } + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiDisplayFunction::~DiDisplayFunction() +{ + delete[] DDLValue; + delete[] LODValue; + int i; + for (i = 0; i < MAX_NUMBER_OF_TABLES; ++i) + delete LookupTable[i]; +} + + +/********************************************************************/ + + +double DiDisplayFunction::getValueforDDL(const Uint16 ddl) const +{ + if ((LODValue != NULL) && (ddl < ValueCount)) + return LODValue[ddl]; + return -1; +} + + +Uint16 DiDisplayFunction::getDDLforValue(const double value) const +{ + if ((LODValue != NULL) && (ValueCount > 0)) + { + unsigned long j = 0; + /* search for closest index, assuming monotony */ + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + /* hardcopy device: descending values */ + while ((j + 1 < ValueCount) && (LODValue[j] > value)) + ++j; + } else { + /* softcopy device: ascending values */ + while ((j + 1 < ValueCount) && (LODValue[j] < value)) + ++j; + } + /* check which value is closer, the upper or the lower */ + if ((j > 0) && (fabs(LODValue[j - 1] - value) < fabs(LODValue[j] - value))) + --j; + return OFstatic_cast(Uint16, j); + } + return 0; +} + + +const DiDisplayLUT *DiDisplayFunction::getLookupTable(const int bits, + unsigned long count) +{ + if (Valid && (bits >= MinBits) && (bits <= MaxBits)) + { + const int idx = bits - MinBits; + /* automatically compute number of entries */ + if (count == 0) + count = DicomImageClass::maxval(bits, 0); + /* check whether existing LUT is still valid */ + if ((LookupTable[idx] != NULL) && ((count != LookupTable[idx]->getCount()) || + (AmbientLight != LookupTable[idx]->getAmbientLightValue()) || + (Illumination != LookupTable[idx]->getIlluminationValue()))) + { + delete LookupTable[idx]; + LookupTable[idx] = NULL; + } + if (LookupTable[idx] == NULL) // first calculation of this LUT + LookupTable[idx] = getDisplayLUT(count); + return LookupTable[idx]; + } + return NULL; +} + + +int DiDisplayFunction::deleteLookupTable(const int bits) +{ + if (bits == 0) + { + /* delete all LUTs */ + int i; + for (i = 0; i < MAX_NUMBER_OF_TABLES; ++i) + { + delete LookupTable[i]; + LookupTable[i] = NULL; + } + return 1; + } + else if ((bits >= MinBits) && (bits <= MaxBits)) + { + /* delete the specified LUT */ + const int idx = bits - MinBits; + if (LookupTable[idx] != NULL) + { + delete LookupTable[idx]; + LookupTable[idx] = NULL; + return 1; + } + return 2; + } + return 0; +} + + +int DiDisplayFunction::setAmbientLightValue(const double value) +{ + if (value >= 0) + { + AmbientLight = value; + return 1; + } + return 0; +} + + +int DiDisplayFunction::setIlluminationValue(const double value) +{ + if (value >= 0) + { + Illumination = value; + return 1; + } + return 0; +} + + +int DiDisplayFunction::setMinDensityValue(const double value) +{ + MinDensity = value; + return (value < 0) ? 2 : 1; +} + + +int DiDisplayFunction::setMaxDensityValue(const double value) +{ + MaxDensity = value; + return (value < 0) ? 2 : 1; +} + + +/********************************************************************/ + + +int DiDisplayFunction::readConfigFile(const char *filename) +{ + if ((filename != NULL) && (strlen(filename) > 0)) + { + STD_NAMESPACE ifstream file(filename, OFopenmode_in_nocreate); + if (file) + { + char c; + while (file.get(c)) + { + if (c == '#') // comment character + { + while (file.get(c) && (c != '\n') && (c != '\r')); // skip comments + } + else if (!isspace(OFstatic_cast(unsigned char, c))) // skip whitespaces + { + file.putback(c); + if (MaxDDLValue == 0) // read maxvalue + { + char str[4]; + file.get(str, sizeof(str)); + if (strcmp(str, "max") == 0) // check for key word: max + { + file >> MaxDDLValue; + if (MaxDDLValue > 0) + { + DDLValue = new Uint16[OFstatic_cast(unsigned long, MaxDDLValue) + 1]; + LODValue = new double[OFstatic_cast(unsigned long, MaxDDLValue) + 1]; + if ((DDLValue == NULL) || (LODValue == NULL)) + return 0; + } else { + DCMIMGLE_ERROR("invalid or missing value for maximum DDL value in DISPLAY file"); + return 0; // abort + } + } else { + DCMIMGLE_ERROR("missing keyword 'max' for maximum DDL value in DISPLAY file"); + return 0; // abort + } + } + else if ((AmbientLight == 0.0) && (c == 'a')) // read ambient light value (optional) + { + char str[4]; + file.get(str, sizeof(str)); + if (strcmp(str, "amb") == 0) // check for key word: amb + { + file >> AmbientLight; + if (AmbientLight < 0) + { + DCMIMGLE_WARN("invalid value for ambient light in DISPLAY file ... ignoring"); + AmbientLight = 0; + } + } else { + DCMIMGLE_ERROR("invalid DISPLAY file ... ignoring"); + return 0; // abort + } + } + else if ((Illumination == 0.0) && (c == 'l')) // read ambient light value (optional) + { + char str[4]; + file.get(str, sizeof(str)); + if (strcmp(str, "lum") == 0) // check for key word: lum + { + file >> Illumination; + if (Illumination < 0) + { + DCMIMGLE_WARN("invalid value for illumination in DISPLAY file ... ignoring"); + Illumination = 0; + } + } else { + DCMIMGLE_ERROR("invalid DISPLAY file ... ignoring"); + return 0; // abort + } + } + else if ((Order == 0) && (c == 'o')) // read polynomial order (optional) + { + char str[4]; + file.get(str, sizeof(str)); + if (strcmp(str, "ord") == 0) // check for key word: ord + { + file >> Order; + if (Order < 0) + { + DCMIMGLE_WARN("invalid value for polynomial order in DISPLAY file ... ignoring"); + Order = 0; + } + } else { + DCMIMGLE_ERROR("invalid DISPLAY file ... ignoring"); + return 0; // abort + } + } else { + if (ValueCount <= OFstatic_cast(unsigned long, MaxDDLValue)) + { + file >> DDLValue[ValueCount]; // read DDL value + file >> LODValue[ValueCount]; // read luminance/OD value + if (file.fail()) + { + DCMIMGLE_WARN("missing luminance/OD value in DISPLAY file ... ignoring last entry"); + } + else if (DDLValue[ValueCount] > MaxDDLValue) + { + DCMIMGLE_WARN("DDL value (" << DDLValue[ValueCount] << ") exceeds maximum value (" + << MaxDDLValue << ") in DISPLAY file ... ignoring value"); + } else + ++ValueCount; + } else { + DCMIMGLE_WARN("too many values in DISPLAY file ... ignoring last line(s)"); + return 2; + } + } + } + } + if ((MaxDDLValue > 0) && (ValueCount > 0)) + return ((DDLValue != NULL) && (LODValue != NULL)); + else { + DCMIMGLE_WARN("invalid DISPLAY file ... ignoring"); + } + } else { + DCMIMGLE_WARN("can't open DISPLAY file ... ignoring"); + } + } + return 0; +} + + +int DiDisplayFunction::createSortedTable(const Uint16 *ddl_tab, + const double *val_tab) +{ + int status = 0; + Uint16 *old_ddl = DDLValue; + double *old_val = LODValue; + if ((ValueCount > 0) && (ddl_tab != NULL) && (val_tab != NULL)) + { + const unsigned long count = OFstatic_cast(unsigned long, MaxDDLValue) + 1; + DDLValue = new Uint16[ValueCount]; + LODValue = new double[ValueCount]; + Sint32 *sort_tab = new Sint32[count]; // auxilliary array (temporary) + if ((DDLValue != NULL) && (LODValue != NULL) && (sort_tab != NULL)) + { + OFBitmanipTemplate::setMem(sort_tab, -1, count); // initialize array + unsigned long i; + for (i = 0; i < ValueCount; ++i) + { + if (ddl_tab[i] <= MaxDDLValue) // calculate sort table + sort_tab[ddl_tab[i]] = i; + } + ValueCount = 0; + for (i = 0; i <= MaxDDLValue; ++i) // sort ascending + { + if (sort_tab[i] >= 0) + { + DDLValue[ValueCount] = ddl_tab[sort_tab[i]]; + LODValue[ValueCount] = (val_tab[sort_tab[i]] > 0) ? val_tab[sort_tab[i]] : 0; + ++ValueCount; // re-count to ignore values exceeding max + } + } + i = 1; + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + /* hardcopy device: check for monotonous descending OD values */ + while ((i < ValueCount) && (LODValue[i - 1] >= LODValue[i])) + ++i; + if (i < ValueCount) + { + DCMIMGLE_WARN("OD values (ordered by DDLs) don't descend monotonously"); + } + } else { + /* softcopy device: check for monotonous ascending luminance values */ + while ((i < ValueCount) && (LODValue[i - 1] <= LODValue[i])) + ++i; + if (i < ValueCount) + { + DCMIMGLE_WARN("luminance values (ordered by DDLs) don't ascend monotonously"); + } + } + status = (ValueCount > 0); + } + delete[] sort_tab; + } + delete[] old_ddl; + delete[] old_val; + return status; +} + + +int DiDisplayFunction::interpolateValues() +{ + if (ValueCount <= OFstatic_cast(unsigned long, MaxDDLValue)) // interpolation necessary ? + { + int status = 0; + if (Order > 0) + { + /* use polynomial curve fitting */ + double *coeff = new double[Order + 1]; + /* compute coefficients */ + if ((coeff != NULL) && DiCurveFitting::calculateCoefficients(DDLValue, LODValue, + OFstatic_cast(unsigned int, ValueCount), Order, coeff)) + { + /* delete old data arrays */ + delete[] DDLValue; + delete[] LODValue; + /* create new data arrays */ + ValueCount = OFstatic_cast(unsigned long, MaxDDLValue) + 1; + DDLValue = new Uint16[ValueCount]; + LODValue = new double[ValueCount]; + if ((DDLValue != NULL) && (LODValue != NULL)) + { + /* set x values linearly */ + unsigned int i; + for (i = 0; i <= MaxDDLValue; ++i) + DDLValue[i] = OFstatic_cast(Uint16, i); + /* compute new y values */ + status = DiCurveFitting::calculateValues(0, MaxDDLValue, LODValue, + OFstatic_cast(unsigned int, ValueCount), Order, coeff); + } + } + delete[] coeff; + } else { + /* use cubic spline interpolation */ + double *spline = new double[ValueCount]; + if ((spline != NULL) && + DiCubicSpline::Function(DDLValue, LODValue, OFstatic_cast(unsigned int, ValueCount), spline)) + { + /* save old values */ + const unsigned long count = ValueCount; + Uint16 *old_ddl = DDLValue; + double *old_val = LODValue; + /* create new data arrays */ + ValueCount = OFstatic_cast(unsigned long, MaxDDLValue) + 1; + DDLValue = new Uint16[ValueCount]; + LODValue = new double[ValueCount]; + if ((DDLValue != NULL) && (LODValue != NULL)) + { + /* set x values linearly */ + unsigned int i; + for (i = 0; i <= MaxDDLValue; ++i) + DDLValue[i] = OFstatic_cast(Uint16, i); + /* compute new y values */ + status = DiCubicSpline::Interpolation(old_ddl, old_val, spline, + OFstatic_cast(unsigned int, count), DDLValue, LODValue, OFstatic_cast(unsigned int, ValueCount)); + } + /* delete old data arrays */ + delete[] old_ddl; + delete[] old_val; + } + delete[] spline; + } + return status; + } + return 2; +} + + +int DiDisplayFunction::calculateMinMax() +{ + if ((LODValue != NULL) && (ValueCount > 0)) + { + MinValue = LODValue[0]; + MaxValue = LODValue[0]; + unsigned long i; + for (i = 1; i < ValueCount; ++i) + { + if (LODValue[i] < MinValue) + MinValue = LODValue[i]; + if (LODValue[i] > MaxValue) + MaxValue = LODValue[i]; + } + return 1; + } + return 0; +} + + +int DiDisplayFunction::checkMinMaxDensity() const +{ + if ((MinDensity >= 0) && (MaxDensity >= 0) && (MinDensity >= MaxDensity)) + { + DCMIMGLE_WARN("invalid optical density range (Dmin = " << MinDensity << ", Dmax = " << MaxDensity << ")"); + return 0; + } + return 1; +} + + +double DiDisplayFunction::getMinLuminanceValue() const +{ + /* Dmax = -1 means unspecified */ + return (MaxDensity < 0) ? -1 : convertODtoLum(MaxDensity); +} + + +double DiDisplayFunction::getMaxLuminanceValue() const +{ + /* Dmin = -1 means unspecified */ + return (MinDensity < 0) ? -1 : convertODtoLum(MinDensity); +} + + +double *DiDisplayFunction::convertODtoLumTable(const double *od_tab, + const unsigned long count, + const OFBool useAmb) +{ + double *lum_tab = NULL; + if ((od_tab != NULL) && (count > 0)) + { + /* create a new table for the luminance values */ + lum_tab = new double[count]; + if (lum_tab != NULL) + { + /* compute luminance values from optical density */ + unsigned int i; + if (useAmb) + { + for (i = 0; i < count; ++i) + lum_tab[i] = AmbientLight + Illumination * pow(OFstatic_cast(double, 10), -od_tab[i]); + } else { + /* ambient light is added later */ + for (i = 0; i < count; ++i) + lum_tab[i] = Illumination * pow(OFstatic_cast(double, 10), -od_tab[i]); + } + } + } + return lum_tab; +} + + +double DiDisplayFunction::convertODtoLum(const double value, + const OFBool useAmb) const +{ + return (useAmb) ? convertODtoLum(value, AmbientLight, Illumination) : + convertODtoLum(value, 0, Illumination); +} + + +double DiDisplayFunction::convertODtoLum(const double value, + const double ambient, + const double illum) +{ + /* formula from DICOM PS3.14: L = La + L0 * 10^-D */ + return (value >= 0) && (ambient >= 0) && (illum >= 0) ? + ambient + illum * pow(OFstatic_cast(double, 10), -value) : -1 /*invalid*/; +} diff --git a/dcmimgle/libsrc/didocu.cc b/dcmimgle/libsrc/didocu.cc new file mode 100644 index 00000000..8738a611 --- /dev/null +++ b/dcmimgle/libsrc/didocu.cc @@ -0,0 +1,444 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomDocument (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/ofstd/ofstring.h" + +#include "dcmtk/dcmimgle/didocu.h" +#include "dcmtk/dcmimgle/diutils.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiDocument::DiDocument(const char *filename, + const unsigned long flags, + const unsigned long fstart, + const unsigned long fcount) + : Object(NULL), + FileFormat(new DcmFileFormat()), + PixelData(NULL), + Xfer(EXS_Unknown), + FrameStart(fstart), + FrameCount(fcount), + Flags(flags), + PhotometricInterpretation() +{ + if (FileFormat) + { + if (FileFormat->loadFile(filename).bad()) + { + DCMIMGLE_ERROR("can't read file '" << filename << "'"); + delete FileFormat; + FileFormat = NULL; + } else { + Object = FileFormat->getDataset(); + if (Object != NULL) + { + Xfer = OFstatic_cast(DcmDataset *, Object)->getOriginalXfer(); + convertPixelData(); + } + } + } +} + + +DiDocument::DiDocument(DcmObject *object, + const E_TransferSyntax xfer, + const unsigned long flags, + const unsigned long fstart, + const unsigned long fcount) + : Object(NULL), + FileFormat(NULL), + PixelData(NULL), + Xfer(xfer), + FrameStart(fstart), + FrameCount(fcount), + Flags(flags), + PhotometricInterpretation() +{ + if (object != NULL) + { + const DcmEVR classType = object->ident(); + // check whether given DICOM object has a valid type + if (classType == EVR_fileFormat) + { + // store reference to DICOM file format to be deleted on object destruction + if (Flags & CIF_TakeOverExternalDataset) + FileFormat = OFstatic_cast(DcmFileFormat *, object); + Object = OFstatic_cast(DcmFileFormat *, object)->getDataset(); + } + else if ((classType == EVR_dataset) || (classType == EVR_item)) + Object = object; + else + DCMIMGLE_ERROR("invalid DICOM object passed to constructor (wrong class)"); + if (Object != NULL) + { + // try to determine the transfer syntax from the given object + if (Xfer == EXS_Unknown) + { + // check type before casting the object + if (Object->ident() == EVR_dataset) + Xfer = OFstatic_cast(DcmDataset *, Object)->getOriginalXfer(); + else // could only be an item + DCMIMGLE_WARN("can't determine original transfer syntax from given DICOM object"); + } + convertPixelData(); + } + } +} + + +void DiDocument::convertPixelData() +{ + DcmStack pstack; + OFCondition status; + DcmXfer xfer(Xfer); + DCMIMGLE_DEBUG("transfer syntax of DICOM dataset: " << xfer.getXferName() << " (" << xfer.getXferID() << ")"); + // only search on main dataset level + if (search(DCM_PixelData, pstack)) + { + DcmObject *pobject = pstack.top(); + if (pobject != NULL) + { + // check for correct class before type casting + if (pobject->ident() == EVR_PixelData) + { + PixelData = OFstatic_cast(DcmPixelData *, pobject); + // check for a special (faulty) case where the original pixel data is uncompressed and + // the transfer syntax of the dataset refers to encapsulated format (i.e. compression) + if (Object->ident() == EVR_dataset) + { + E_TransferSyntax repType = EXS_Unknown; + const DcmRepresentationParameter *repParam = NULL; + PixelData->getOriginalRepresentationKey(repType, repParam); + if (xfer.isEncapsulated() && !DcmXfer(repType).isEncapsulated()) + { + DCMIMGLE_WARN("pixel data is stored in uncompressed format, although " + << "the transfer syntax of the dataset refers to encapsulated format"); + } + } + // convert pixel data to uncompressed format (if required) + if ((Flags & CIF_DecompressCompletePixelData) || !(Flags & CIF_UsePartialAccessToPixelData)) + { + pstack.clear(); + // push reference to DICOM dataset on the stack (required for decompression process) + pstack.push(Object); + // dummy stack entry + pstack.push(PixelData); + status = PixelData->chooseRepresentation(EXS_LittleEndianExplicit, NULL, pstack); + if (status.good()) + { + // set transfer syntax to unencapsulated/uncompressed + if (xfer.isEncapsulated()) + { + Xfer = EXS_LittleEndianExplicit; + DCMIMGLE_DEBUG("decompressed complete pixel data in memory: " << PixelData->getLength(Xfer) << " bytes"); + } + } else { + DCMIMGLE_ERROR("can't change to unencapsulated representation for pixel data"); + DCMIMGLE_DEBUG("DcmPixelData::chooseRepresentation() returned: " << status.text()); + } + } + // determine color model of the decompressed image + status = PixelData->getDecompressedColorModel(OFstatic_cast(DcmItem *, Object), PhotometricInterpretation); + if (status.bad()) + { + DCMIMGLE_ERROR("can't determine 'PhotometricInterpretation' of decompressed image"); + DCMIMGLE_DEBUG("DcmPixelData::getDecompressedColorModel() returned: " << status.text()); + } + } else { + DCMIMGLE_ERROR("invalid pixel data in DICOM dataset (wrong class)"); + DCMIMGLE_DEBUG("found PixelData " << DCM_PixelData << " as an instance of the class for VR '" + << OFSTRING_GUARD(DcmVR(pobject->ident()).getVRName()) << "' instead of '" + << OFSTRING_GUARD(DcmVR(EVR_PixelData).getVRName()) << "'"); + } + } else + DCMIMGLE_ERROR("invalid pixel data in DICOM dataset"); + } else + DCMIMGLE_ERROR("no pixel data found in DICOM dataset"); +} + + +/*--------------* + * destructor * + *--------------*/ + +DiDocument::~DiDocument() +{ + // DICOM image loaded from file: delete file format (and data set) + if (FileFormat != NULL) + delete FileFormat; + // DICOM image loaded from external data set: only delete if flag is set + else if (Flags & CIF_TakeOverExternalDataset) + delete Object; +} + + +/********************************************************************/ + + +DcmElement *DiDocument::search(const DcmTagKey &tag, + DcmObject *obj) const +{ + DcmStack stack; + if (obj == NULL) + obj = Object; + // only search on main dataset level + if ((obj != NULL) && (obj->search(tag, stack, ESM_fromHere, OFFalse /* searchIntoSub */) == EC_Normal) && + (stack.top()->getLength(Xfer) > 0)) + { + return OFstatic_cast(DcmElement *, stack.top()); + } + return NULL; +} + + +/********************************************************************/ + + +int DiDocument::search(const DcmTagKey &tag, + DcmStack &pstack) const +{ + if (pstack.empty()) + pstack.push(Object); + DcmObject *obj = pstack.top(); + if ((obj != NULL) && (obj->search(tag, pstack, ESM_fromHere, OFFalse /* searchIntoSub */) == EC_Normal) && + (pstack.top()->getLength(Xfer) > 0)) + return 1; + return 0; +} + + +/********************************************************************/ + + +unsigned long DiDocument::getVM(const DcmTagKey &tag) const +{ + DcmElement *elem = search(tag); + if (elem != NULL) + return elem->getVM(); + return 0; +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + Uint16 &returnVal, + const unsigned long pos, + DcmItem *item, + const OFBool allowSigned) const +{ + return getElemValue(search(tag, item), returnVal, pos, allowSigned); +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + Sint16 &returnVal, + const unsigned long pos, + DcmItem *item) const +{ + DcmElement *elem = search(tag, item); + if (elem != NULL) + { + if (elem->getSint16(returnVal, pos).good()) + return elem->getVM(); + } + return 0; +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + Uint32 &returnVal, + const unsigned long pos, + DcmItem *item) const +{ + DcmElement *elem = search(tag, item); + if (elem != NULL) + { + if (elem->getUint32(returnVal, pos).good()) + return elem->getVM(); + } + return 0; +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + Sint32 &returnVal, + const unsigned long pos, + DcmItem *item) const +{ + DcmElement *elem = search(tag, item); + if (elem != NULL) + { + if (elem->getSint32(returnVal, pos).good()) + return elem->getVM(); + } + return 0; +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + double &returnVal, + const unsigned long pos, + DcmItem *item) const +{ + DcmElement *elem = search(tag, item); + if (elem != NULL) + { + if (elem->getFloat64(returnVal, pos).good()) + return elem->getVM(); + } + return 0; +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + const Uint16 *&returnVal, + DcmItem *item) const +{ + DcmElement *elem = search(tag, item); + if (elem != NULL) + { + Uint16 *val; + if (elem->getUint16Array(val).good()) + { + returnVal = val; + const DcmEVR vr = elem->getVR(); + if ((vr == EVR_OB) || (vr == EVR_OW) || (vr == EVR_lt)) + return elem->getLength(Xfer) / sizeof(Uint16); + return elem->getVM(); + } + } + return 0; +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + const char *&returnVal, + DcmItem *item) const +{ + return getElemValue(search(tag, item), returnVal); +} + + +unsigned long DiDocument::getValue(const DcmTagKey &tag, + OFString &returnVal, + const unsigned long pos, + DcmItem *item) const +{ + return getElemValue(search(tag, item), returnVal, pos); +} + + +unsigned long DiDocument::getSequence(const DcmTagKey &tag, + DcmSequenceOfItems *&seq, + DcmItem *item) const +{ + DcmElement *elem = search(tag, item); + if ((elem != NULL) && (elem->ident() == EVR_SQ)) + return (seq = OFstatic_cast(DcmSequenceOfItems *, elem))->card(); + return 0; +} + + +unsigned long DiDocument::getElemValue(const DcmElement *elem, + Uint16 &returnVal, + const unsigned long pos, + const OFBool allowSigned) +{ + if (elem != NULL) + { + // remove 'const' to use non-const methods + if (OFconst_cast(DcmElement *, elem)->getUint16(returnVal, pos).good()) + return OFconst_cast(DcmElement *, elem)->getVM(); + else if (allowSigned) + { + // try to retrieve signed value ... + Sint16 value = 0; + if (OFconst_cast(DcmElement *, elem)->getSint16(value, pos).good()) + { + // ... and cast to unsigned type + returnVal = OFstatic_cast(Uint16, value); + DCMIMGLE_TRACE("retrieved signed value (" << value << ") at position " << pos + << " from element " << OFconst_cast(DcmElement *, elem)->getTag() + << ", VR=" << DcmVR(OFconst_cast(DcmElement *, elem)->getVR()).getVRName() + << ", VM=" << OFconst_cast(DcmElement *, elem)->getVM()); + return OFconst_cast(DcmElement *, elem)->getVM(); + } + } + } + return 0; +} + + +unsigned long DiDocument::getElemValue(const DcmElement *elem, + const Uint16 *&returnVal) +{ + if (elem != NULL) + { + Uint16 *val; + // remove 'const' to use non-const methods + if (OFconst_cast(DcmElement *, elem)->getUint16Array(val).good()) + { + returnVal = val; + const DcmEVR vr = OFconst_cast(DcmElement *, elem)->getVR(); + if ((vr == EVR_OW) || (vr == EVR_lt)) + return OFconst_cast(DcmElement *, elem)->getLength(/*Xfer*/) / sizeof(Uint16); + return OFconst_cast(DcmElement *, elem)->getVM(); + } + } + return 0; +} + + +unsigned long DiDocument::getElemValue(const DcmElement *elem, + const char *&returnVal) +{ + if (elem != NULL) + { + char *val; + // remove 'const' to use non-const methods + if (OFconst_cast(DcmElement *, elem)->getString(val).good()) + { + returnVal = val; + return OFconst_cast(DcmElement *, elem)->getVM(); + } + } + return 0; +} + + +unsigned long DiDocument::getElemValue(const DcmElement *elem, + OFString &returnVal, + const unsigned long pos) +{ + if (elem != NULL) + { + // remove 'const' to use non-const methods + if (OFconst_cast(DcmElement *, elem)->getOFString(returnVal, pos).good()) + return OFconst_cast(DcmElement *, elem)->getVM(); + } + return 0; +} diff --git a/dcmimgle/libsrc/digsdfn.cc b/dcmimgle/libsrc/digsdfn.cc new file mode 100644 index 00000000..3e2a7ccf --- /dev/null +++ b/dcmimgle/libsrc/digsdfn.cc @@ -0,0 +1,430 @@ +/* + * + * Copyright (C) 1999-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomGSDFunction (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/digsdfn.h" +#include "dcmtk/dcmimgle/displint.h" +#include "dcmtk/dcmimgle/digsdlut.h" + +#include "dcmtk/ofstd/ofstream.h" + +#define INCLUDE_CMATH +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +/*----------------------------* + * constant initializations * + *----------------------------*/ + +const unsigned int DiGSDFunction::GSDFCount = 1023; + + +/*----------------* + * constructors * + *----------------*/ + +DiGSDFunction::DiGSDFunction(const char *filename, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(filename, deviceType, ord), + JNDMin(0), + JNDMax(0), + GSDFValue(NULL), + GSDFSpline(NULL) +{ + if (Valid) + Valid = calculateGSDF() && calculateGSDFSpline() && calculateJNDBoundaries(); + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY file ... ignoring"); + } +} + + +DiGSDFunction::DiGSDFunction(const double *val_tab, // UNTESTED !! + const unsigned long count, + const Uint16 max, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(val_tab, count, max, deviceType, ord), + JNDMin(0), + JNDMax(0), + GSDFValue(NULL), + GSDFSpline(NULL) +{ + if (Valid) + Valid = calculateGSDF() && calculateGSDFSpline() && calculateJNDBoundaries(); + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY values ... ignoring"); + } +} + + +DiGSDFunction::DiGSDFunction(const Uint16 *ddl_tab, // UNTESTED !! + const double *val_tab, + const unsigned long count, + const Uint16 max, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(ddl_tab, val_tab, count, max, deviceType, ord), + JNDMin(0), + JNDMax(0), + GSDFValue(NULL), + GSDFSpline(NULL) +{ + if (Valid) + Valid = calculateGSDF() && calculateGSDFSpline() && calculateJNDBoundaries(); + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY values ... ignoring"); + } +} + + +DiGSDFunction::DiGSDFunction(const double val_min, + const double val_max, + const unsigned long count, + const E_DeviceType deviceType, + const signed int ord) + : DiDisplayFunction(val_min, val_max, count, deviceType, ord), + JNDMin(0), + JNDMax(0), + GSDFValue(NULL), + GSDFSpline(NULL) +{ + if (Valid) + Valid = calculateGSDF() && calculateGSDFSpline() && calculateJNDBoundaries(); + if (!Valid) + { + DCMIMGLE_ERROR("invalid DISPLAY values ... ignoring"); + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiGSDFunction::~DiGSDFunction() +{ + delete[] GSDFValue; + delete[] GSDFSpline; +} + + +/********************************************************************/ + + +DiDisplayLUT *DiGSDFunction::getDisplayLUT(unsigned long count) +{ + DiDisplayLUT *lut = NULL; + if (count <= MAX_TABLE_ENTRY_COUNT) + { + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + /* hardcopy: values are in optical density, first convert them to luminance */ + double *tmp_tab = convertODtoLumTable(LODValue, ValueCount, OFFalse /*useAmb*/); + if (tmp_tab != NULL) + { + checkMinMaxDensity(); + /* create new GSDF LUT */ + lut = new DiGSDFLUT(count, MaxDDLValue, DDLValue, tmp_tab, ValueCount, + GSDFValue, GSDFSpline, GSDFCount, JNDMin, JNDMax, getMinLuminanceValue(), + getMaxLuminanceValue(), AmbientLight, Illumination, (DeviceType == EDT_Scanner)); + /* delete temporary table */ + delete[] tmp_tab; + } + } else { + /* softcopy: values are already in luminance */ + lut = new DiGSDFLUT(count, MaxDDLValue, DDLValue, LODValue, ValueCount, + GSDFValue, GSDFSpline, GSDFCount, JNDMin, JNDMax, -1 /*Lmin*/, -1 /*Lmax*/, + AmbientLight, Illumination, (DeviceType == EDT_Camera)); + } + } + return lut; +} + + +int DiGSDFunction::writeCurveData(const char *filename, + const OFBool mode) +{ + if ((filename != NULL) && (strlen(filename) > 0)) + { + STD_NAMESPACE ofstream file(filename); + if (file) + { + const OFBool inverseLUT = (DeviceType == EDT_Scanner) || (DeviceType == EDT_Camera); + /* comment header */ + file << "# Display function : GSDF (DICOM Part 14)" << OFendl; + if (DeviceType == EDT_Printer) + file << "# Type of output device : Printer (hardcopy)" << OFendl; + else if (DeviceType == EDT_Scanner) + file << "# Type of output device : Scanner (hardcopy)" << OFendl; + else if (DeviceType == EDT_Camera) + file << "# Type of output device : Camera (softcopy)" << OFendl; + else + file << "# Type of output device : Monitor (softcopy)" << OFendl; + file << "# Digital driving levels : " << ValueCount << OFendl; + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + file << "# Illumination [cd/m^2] : " << Illumination << OFendl; + file << "# Ambient light [cd/m^2] : " << AmbientLight << OFendl; + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + const double min_lum = getMinLuminanceValue(); + const double max_lum = getMaxLuminanceValue(); + file << "# Luminance w/o [cd/m^2] : " << convertODtoLum(MaxValue, OFFalse /*useAmb*/) << " - " + << convertODtoLum(MinValue, OFFalse /*useAmb*/); + if ((min_lum >= 0) || (max_lum >= 0)) + { + file << " (Lmin = "; + if (min_lum >= 0) + file << min_lum; + else + file << "n/s"; + file << ", Lmax = "; + if (max_lum >= 0) + file << max_lum; + else + file << "n/s"; + file << ")"; + } + file << OFendl; + file << "# Optical density [OD] : " << MinValue << " - " << MaxValue; + if ((MinDensity >= 0) || (MaxDensity >= 0)) + { + file << " (Dmin = "; + if (MinDensity >= 0) + file << MinDensity; + else + file << "n/s"; + file << ", Dmax = "; + if (MaxDensity >= 0) + file << MaxDensity; + else + file << "n/s"; + file << ")"; + } + file << OFendl; + } else + file << "# Luminance w/o [cd/m^2] : " << MinValue << " - " << MaxValue << OFendl; + file << "# Barten JND index range : " << JNDMin << " - " << JNDMax << " (" << (JNDMax - JNDMin) << ")" << OFendl; + file << "# Interpolation method : "; + if (getPolynomialOrder() > 0) + file << "Curve fitting algorithm with order " << getPolynomialOrder() << OFendl << OFendl; + else + file << "Cubic spline interpolation" << OFendl << OFendl; + /* print headings of the table */ + if (mode) + { + file << "# NB: values for CC, GSDF and PSC"; + if (inverseLUT) + file << "'"; // add ' to PSC + file << " are specified in cd/m^2" << OFendl << OFendl; + file << "DDL\tCC\tGSDF\tPSC"; + if (inverseLUT) + file << "'"; // add ' to PSC + file << OFendl; + } else { + file << "# NB: values for CC and GSDF are specified in cd/m^2" << OFendl << OFendl; + file << "DDL\tGSDF" << OFendl; + } + /* create GSDF LUT and write curve data to file */ + DiGSDFLUT *lut = NULL; + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + /* hardcopy: values are in optical density, first convert them to luminance */ + double *tmp_tab = convertODtoLumTable(LODValue, ValueCount, OFFalse /*useAmb*/); + if (tmp_tab != NULL) + { + checkMinMaxDensity(); + lut = new DiGSDFLUT(ValueCount, MaxDDLValue, DDLValue, tmp_tab, ValueCount, + GSDFValue, GSDFSpline, GSDFCount, JNDMin, JNDMax, getMinLuminanceValue(), + getMaxLuminanceValue(), AmbientLight, Illumination, inverseLUT, &file, mode); + /* delete temporary table */ + delete[] tmp_tab; + } + } else { + /* softcopy: values are already in luminance */ + lut = new DiGSDFLUT(ValueCount, MaxDDLValue, DDLValue, LODValue, ValueCount, + GSDFValue, GSDFSpline, GSDFCount, JNDMin, JNDMax, -1 /*Lmin*/, -1 /*Lmax*/, + AmbientLight, Illumination, inverseLUT, &file, mode); + } + int status = (lut != NULL) && (lut->isValid()); + delete lut; + return status; + } + } + return 0; +} + + +int DiGSDFunction::setAmbientLightValue(const double value) +{ + int status = DiDisplayFunction::setAmbientLightValue(value); + if (status) + Valid = calculateJNDBoundaries(); // check validity + return status; +} + + +int DiGSDFunction::setIlluminationValue(const double value) +{ + int status = DiDisplayFunction::setIlluminationValue(value); + if (status && ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner))) + Valid = calculateJNDBoundaries(); // check validity + return status; +} + + +int DiGSDFunction::setMinDensityValue(const double value) +{ + int status = DiDisplayFunction::setMinDensityValue(value); + if (status && (DeviceType == EDT_Printer)) + Valid = calculateJNDBoundaries(); // check validity + return status; +} + + +int DiGSDFunction::setMaxDensityValue(const double value) +{ + int status = DiDisplayFunction::setMaxDensityValue(value); + if (status && (DeviceType == EDT_Printer)) + Valid = calculateJNDBoundaries(); // check validity + return status; +} + + +/********************************************************************/ + + +int DiGSDFunction::calculateGSDF() +{ + GSDFValue = new double[GSDFCount]; + if (GSDFValue != NULL) + { + /* + * algorithm taken from DICOM part 14: Grayscale Standard Display Function (GSDF) + */ + const double a = -1.3011877; + const double b = -2.5840191e-2; + const double c = 8.0242636e-2; + const double d = -1.0320229e-1; + const double e = 1.3646699e-1; + const double f = 2.8745620e-2; + const double g = -2.5468404e-2; + const double h = -3.1978977e-3; + const double k = 1.2992634e-4; + const double m = 1.3635334e-3; + unsigned int i; + double ln; + double ln2; + double ln3; + double ln4; + for (i = 0; i < GSDFCount; ++i) + { + ln = log(OFstatic_cast(double, i + 1)); + ln2 = ln * ln; + ln3 = ln2 * ln; + ln4 = ln3 * ln; + GSDFValue[i] = pow(OFstatic_cast(double, 10), (a + c*ln + e*ln2 + g*ln3 + m*ln4) / (1 + b*ln + d*ln2 + f*ln3 + h*ln4 + k*(ln4*ln))); + } + return 1; + } + return 0; +} + + +int DiGSDFunction::calculateGSDFSpline() +{ + int status = 0; + if ((GSDFValue != NULL) && (GSDFCount > 0)) + { + GSDFSpline = new double[GSDFCount]; + unsigned int *jidx = new unsigned int[GSDFCount]; + if ((GSDFSpline != NULL) && (jidx != NULL)) + { + unsigned int i; + unsigned int *p = jidx; + for (i = 1; i <= GSDFCount; ++i) + *(p++) = i; + status = DiCubicSpline::Function(jidx, GSDFValue, GSDFCount, GSDFSpline); + } + delete[] jidx; + } + return status; +} + + +int DiGSDFunction::calculateJNDBoundaries() +{ + if ((LODValue != NULL) && (ValueCount > 0)) + { + if ((DeviceType == EDT_Printer) || (DeviceType == EDT_Scanner)) + { + /* hardcopy device (printer/scanner), values are in OD */ + if (MaxDensity < 0) + JNDMin = getJNDIndex(convertODtoLum(MaxValue)); + else // max density specified + JNDMin = getJNDIndex(convertODtoLum(MaxDensity)); + if (MinDensity < 0) + JNDMax = getJNDIndex(convertODtoLum(MinValue)); + else // min density specified + JNDMax = getJNDIndex(convertODtoLum(MinDensity)); + } else { + /* softcopy device (monitor/camera), values are in cd/m^2 */ + JNDMin = getJNDIndex(MinValue + AmbientLight); + JNDMax = getJNDIndex(MaxValue + AmbientLight); + } + return (JNDMin >= 0) && (JNDMax >= 0); + } + return 0; +} + + +double DiGSDFunction::getJNDIndex(const double lum) +{ + if (lum > 0.0) + { + /* + * algorithm taken from DICOM part 14: Grayscale Standard Display Function (GSDF) + */ + const double a = 71.498068; + const double b = 94.593053; + const double c = 41.912053; + const double d = 9.8247004; + const double e = 0.28175407; + const double f = -1.1878455; + const double g = -0.18014349; + const double h = 0.14710899; + const double i = -0.017046845; + double lg10[8]; + lg10[0] = log10(lum); + unsigned int j; + for (j = 0; j < 7; ++j) // reduce number of multiplications + lg10[j + 1] = lg10[j] * lg10[0]; + return a + b*lg10[0] + c*lg10[1] + d*lg10[2] + e*lg10[3] + f*lg10[4] + g*lg10[5] + h*lg10[6] + i*lg10[7]; + } + return -1; +} diff --git a/dcmimgle/libsrc/digsdlut.cc b/dcmimgle/libsrc/digsdlut.cc new file mode 100644 index 00000000..60afd587 --- /dev/null +++ b/dcmimgle/libsrc/digsdlut.cc @@ -0,0 +1,218 @@ +/* + * + * Copyright (C) 1999-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomGSDFLUT (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/digsdlut.h" +#include "dcmtk/dcmimgle/displint.h" + +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiGSDFLUT::DiGSDFLUT(const unsigned long count, + const Uint16 max, + const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double *gsdf_tab, + const double *gsdf_spl, + const unsigned int gsdf_cnt, + const double jnd_min, + const double jnd_max, + const double lum_min, + const double lum_max, + const double amb, + const double illum, + const OFBool inverse, + STD_NAMESPACE ostream *stream, + const OFBool printMode) + : DiDisplayLUT(count, max, amb, illum) +{ + if ((Count > 0) && (Bits > 0)) + { + DCMIMGLE_DEBUG("new GSDF LUT with " << Bits << " bits output and " << Count << " entries created"); + if (jnd_min >= jnd_max) + { + DCMIMGLE_ERROR("invalid JND range for GSDF LUT creation (" << jnd_min << " - " << jnd_max << ")"); + } + /* create the lookup table */ + Valid = createLUT(ddl_tab, val_tab, ddl_cnt, gsdf_tab, gsdf_spl, gsdf_cnt, + jnd_min, jnd_max, lum_min, lum_max, inverse, stream, printMode); + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiGSDFLUT::~DiGSDFLUT() +{ +} + + +/********************************************************************/ + + +int DiGSDFLUT::createLUT(const Uint16 *ddl_tab, + const double *val_tab, + const unsigned long ddl_cnt, + const double *gsdf_tab, + const double *gsdf_spl, + const unsigned int gsdf_cnt, + const double jnd_min, + const double jnd_max, + const double lum_min, + const double lum_max, + const OFBool inverse, + STD_NAMESPACE ostream *stream, + const OFBool printMode) +{ + /* check for valid parameters */ + if ((ddl_tab != NULL) && (val_tab != NULL) && (ddl_cnt > 0) && (gsdf_tab != NULL) && (gsdf_spl != NULL) && + (gsdf_cnt > 0) && (jnd_min < jnd_max)) + { + int status = 0; + const unsigned long gin_ctn = (inverse) ? ddl_cnt : Count; // number of points to be interpolated + double *jidx = new double[gin_ctn]; + if (jidx != NULL) + { + const double dist = (jnd_max - jnd_min) / (gin_ctn - 1); // distance between two entries + unsigned long i; + double *s = jidx; + double value = jnd_min; // first value is fixed ! + for (i = gin_ctn; i > 1; --i) // initialize scaled JND index array + { + *(s++) = value; + value += dist; // add step by step ... + } + *s = jnd_max; // last value is fixed ! + double *jnd_idx = new double[gsdf_cnt]; + if (jnd_idx != NULL) + { + s = jnd_idx; + for (i = 0; i < gsdf_cnt; ++i) // initialize JND index array + *(s++) = i + 1; + double *gsdf = new double[gin_ctn]; // interpolated GSDF + if (gsdf != NULL) + { + if (DiCubicSpline::Interpolation(jnd_idx, gsdf_tab, gsdf_spl, gsdf_cnt, jidx, gsdf, + OFstatic_cast(unsigned int, gin_ctn))) + { + DataBuffer = new Uint16[Count]; + if (DataBuffer != NULL) + { + const double amb = getAmbientLightValue(); + Uint16 *q = DataBuffer; + unsigned long j = 0; + /* check whether to apply the inverse transformation */ + if (inverse) + { + double v; + const double factor = OFstatic_cast(double, ddl_cnt - 1) / OFstatic_cast(double, Count - 1); + /* convert DDL to P-Value */ + for (i = 0; i < Count; ++i) + { + v = val_tab[OFstatic_cast(int, i * factor)] + amb; // need to scale index to range of value table + while ((j + 1 < ddl_cnt) && (gsdf[j] < v)) // search for closest index, assuming monotony + ++j; + if ((j > 0) && (fabs(gsdf[j - 1] - v) < fabs(gsdf[j] - v))) + --j; + *(q++) = ddl_tab[j]; + } + } else { + /* initial DDL boundaries */ + unsigned long ddl_min = 0; + unsigned long ddl_max= ddl_cnt - 1; + /* check whether minimum luminance is specified */ + if (lum_min >= 0) + { + j = ddl_min; + /* determine corresponding minimum DDL value */ + while ((j < ddl_max) && (val_tab[j] + amb < lum_min)) + ++j; + ddl_min = j; + } + /* check whether maximum luminance is specified */ + if (lum_max >= 0) + { + j = ddl_max; + /* determine corresponding maximum DDL value */ + while ((j > ddl_min) && (val_tab[j] + amb > lum_max)) + --j; + ddl_max = j; + } + j = ddl_min; + const double *r = gsdf; + /* convert P-Value to DDL */ + for (i = Count; i != 0; --i, ++r) + { + while ((j < ddl_max) && (val_tab[j] + amb < *r)) // search for closest index, assuming monotony + ++j; + if ((j > 0) && (fabs(val_tab[j - 1] + amb - *r) < fabs(val_tab[j] + amb - *r))) + --j; + *(q++) = ddl_tab[j]; + } + } + Data = DataBuffer; + if (stream != NULL) // write curve data to file + { + if (Count == ddl_cnt) // check whether GSDF LUT fits exactly to DISPLAY file + { + for (i = 0; i < ddl_cnt; ++i) + { + (*stream) << ddl_tab[i]; // DDL + stream->setf(STD_NAMESPACE ios::fixed, STD_NAMESPACE ios::floatfield); + if (printMode) + (*stream) << "\t" << val_tab[i] + amb; // CC + (*stream) << "\t" << gsdf[i]; // GSDF + if (printMode) + { + if (inverse) + (*stream) << "\t" << gsdf[Data[i]]; // PSC' + else + (*stream) << "\t" << val_tab[Data[i]] + amb; // PSC + } + (*stream) << OFendl; + } + } else { + DCMIMGLE_WARN("can't write curve data, wrong DISPLAY file or GSDF LUT"); + } + } + status = 1; + } + } + } + delete[] gsdf; + } + delete[] jnd_idx; + } + delete[] jidx; + return status; + } + return 0; +} diff --git a/dcmimgle/libsrc/diimage.cc b/dcmimgle/libsrc/diimage.cc new file mode 100644 index 00000000..ee7cfc3b --- /dev/null +++ b/dcmimgle/libsrc/diimage.cc @@ -0,0 +1,889 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcswap.h" +#include "dcmtk/dcmdata/dcuid.h" + +#include "dcmtk/dcmimgle/diimage.h" +#include "dcmtk/dcmimgle/diinpxt.h" +#include "dcmtk/dcmimgle/didocu.h" +#include "dcmtk/dcmimgle/diutils.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiImage::DiImage(const DiDocument *docu, + const EI_Status status, + const int spp) + : ImageStatus(status), + Document(docu), + FirstFrame(0), + NumberOfFrames(0), + TotalNumberOfFrames(0), + RepresentativeFrame(0), + FrameTime(0), + Rows(0), + Columns(0), + PixelWidth(1), + PixelHeight(1), + BitsAllocated(0), + BitsStored(0), + HighBit(0), + BitsPerSample(0), + SamplesPerPixel(spp), + Polarity(EPP_Normal), + hasSignedRepresentation(0), + hasPixelSpacing(0), + hasImagerPixelSpacing(0), + hasNominalScannedPixelSpacing(0), + hasPixelAspectRatio(0), + isOriginal(1), + InputData(NULL), + FileCache(), + CurrentFragment(0) +{ + if ((Document != NULL) && (ImageStatus == EIS_Normal)) + { + Sint32 sl = 0; + if (Document->getValue(DCM_NumberOfFrames, sl)) + { + if (sl < 1) + { + DCMIMGLE_WARN("invalid value for 'NumberOfFrames' (" << sl << ") ... assuming 1"); + NumberOfFrames = 1; + } else + NumberOfFrames = OFstatic_cast(Uint32, sl); + } else + NumberOfFrames = 1; + Uint16 us = 0; + if (Document->getValue(DCM_RepresentativeFrameNumber, us)) + { + if (us <= FirstFrame) + { + DCMIMGLE_WARN("invalid value for 'RepresentativeFrameNumber' (" << us << ") ... assuming first frame"); + RepresentativeFrame = FirstFrame; + } + else if (us > NumberOfFrames) + { + DCMIMGLE_WARN("invalid value for 'RepresentativeFrameNumber' (" << us << ") ... assuming last frame"); + RepresentativeFrame = NumberOfFrames - 1; + } + else + RepresentativeFrame = us - 1; + } + double ds = 0.0; + if (Document->getValue(DCM_FrameTime, ds)) + { + if (ds <= 0) + DCMIMGLE_WARN("invalid value for 'FrameTime' (" << ds << ") ... ignoring"); + else + FrameTime = ds; + } + FirstFrame = (docu->getFrameStart() < NumberOfFrames) ? docu->getFrameStart() : NumberOfFrames - 1; + /* store total number of frames in the dataset */ + TotalNumberOfFrames = NumberOfFrames; + /* restrict to actually processed/loaded number of frames */ + NumberOfFrames -= FirstFrame; + if ((docu->getFrameCount() > 0) && (NumberOfFrames > docu->getFrameCount())) + NumberOfFrames = docu->getFrameCount(); + /* start from first processed frame (might still exceed number of loaded frames) */ + RepresentativeFrame -= FirstFrame; + int ok = (Document->getValue(DCM_Rows, Rows) > 0); + if (!ok) + DCMIMGLE_ERROR("mandatory attribute 'Rows' is missing"); + if (Document->getValue(DCM_Columns, Columns) == 0) + { + ok = 0; + DCMIMGLE_ERROR("mandatory attribute 'Columns' is missing"); + } + /* check whether to proceed */ + if (!ok || ((Rows > 0) && (Columns > 0))) + { + ok &= (Document->getValue(DCM_BitsAllocated, BitsAllocated) > 0); + ok &= (Document->getValue(DCM_BitsStored, BitsStored) > 0); + if (((Document->getValue(DCM_HighBit, HighBit) == 0) || ((HighBit == 0) && (BitsStored > 1))) && ok) + { + HighBit = BitsStored - 1; + DCMIMGLE_WARN("missing value for 'HighBit' ... assuming " << HighBit); + } + BitsPerSample = BitsStored; + if (Document->getValue(DCM_PixelRepresentation, us) > 0) + { + hasSignedRepresentation = (us == 1); + if ((us != 0) && (us != 1)) + DCMIMGLE_WARN("invalid value for 'PixelRepresentation' (" << us << ") ... assuming 'unsigned' (0)"); + } else { + ok = 0; + /* pixel representation is mandatory, the error status is set below */ + DCMIMGLE_ERROR("mandatory attribute 'PixelRepresentation' is missing"); + } + if (!(Document->getFlags() & CIF_UsePresentationState)) + { + /* check whether pixels are non-square (start with pixel spacing attribute) */ + hasPixelSpacing = (Document->getValue(DCM_PixelSpacing, PixelHeight, 0) > 0); + if (hasPixelSpacing) + { + if (Document->getValue(DCM_PixelSpacing, PixelWidth, 1) < 2) + DCMIMGLE_WARN("missing second value for 'PixelSpacing' ... assuming 'Width' = " << PixelWidth); + } else { + /* then check for functional groups sequence */ + DcmSequenceOfItems *seq = NULL; + if (docu->getSequence(DCM_SharedFunctionalGroupsSequence, seq)) + { + DcmItem *item = seq->getItem(0); + if ((item != NULL) && docu->getSequence(DCM_PixelMeasuresSequence, seq, item)) + { + item = seq->getItem(0); + if (item != NULL) + { + hasPixelSpacing = (docu->getValue(DCM_PixelSpacing, PixelHeight, 0, item) > 0); + if (hasPixelSpacing) + { + DCMIMGLE_DEBUG("found 'PixelSpacing' in 'SharedFunctionalGroupsSequence'"); + if (docu->getValue(DCM_PixelSpacing, PixelWidth, 1, item) < 2) + DCMIMGLE_WARN("missing second value for 'PixelSpacing' ... assuming 'Width' = " << PixelWidth); + } + } + } + } + } + /* if there is no pixel spacing, check for various other attributes */ + if (!hasPixelSpacing) + { + hasImagerPixelSpacing = (Document->getValue(DCM_ImagerPixelSpacing, PixelHeight, 0) > 0); + if (hasImagerPixelSpacing) + { + if (Document->getValue(DCM_ImagerPixelSpacing, PixelWidth, 1) < 2) + DCMIMGLE_WARN("missing second value for 'ImagerPixelSpacing' ... assuming 'Width' = " << PixelWidth); + } else { + hasNominalScannedPixelSpacing = (Document->getValue(DCM_NominalScannedPixelSpacing, PixelHeight, 0) > 0); + if (hasNominalScannedPixelSpacing) + { + if (Document->getValue(DCM_NominalScannedPixelSpacing, PixelWidth, 1) < 2) + DCMIMGLE_WARN("missing second value for 'NominalScannedPixelSpacing' ... assuming 'Width' = " << PixelWidth); + } else { + Sint32 sl2; + hasPixelAspectRatio = (Document->getValue(DCM_PixelAspectRatio, sl2, 0) > 0); + if (hasPixelAspectRatio) + { + PixelHeight = sl2; + if (Document->getValue(DCM_PixelAspectRatio, sl2, 1) < 2) + DCMIMGLE_WARN("missing second value for 'PixelAspectRatio' ... assuming 'Width' = " << PixelWidth); + else + PixelWidth = sl2; + } else { + PixelWidth = 1; + PixelHeight = 1; + } + } + } + } + checkPixelExtension(); + } + if (ok && (Document->getPixelData() != NULL)) + { + // convert pixel data (if present) + convertPixelData(); + } else { + ImageStatus = EIS_MissingAttribute; + DCMIMGLE_ERROR("one or more mandatory attributes are missing in image pixel module"); + } + } else { + ImageStatus = EIS_InvalidValue; + DCMIMGLE_ERROR("invalid value for 'Rows' (" << Rows << ") and/or 'Columns' (" << Columns << ")"); + } + } else { + ImageStatus = EIS_InvalidDocument; + DCMIMGLE_ERROR("this DICOM document is invalid"); + } +} + + +DiImage::DiImage(const DiDocument *docu, + const EI_Status status) + : ImageStatus(status), + Document(docu), + FirstFrame(0), + NumberOfFrames(0), + TotalNumberOfFrames(0), + RepresentativeFrame(0), + FrameTime(0), + Rows(0), + Columns(0), + PixelWidth(1), + PixelHeight(1), + BitsAllocated(0), + BitsStored(0), + HighBit(0), + BitsPerSample(0), + SamplesPerPixel(0), + Polarity(EPP_Normal), + hasSignedRepresentation(0), + hasPixelSpacing(0), + hasImagerPixelSpacing(0), + hasNominalScannedPixelSpacing(0), + hasPixelAspectRatio(0), + isOriginal(1), + InputData(NULL), + FileCache(), + CurrentFragment(0) +{ +} + + +DiImage::DiImage(const DiImage *image, + const unsigned long fstart, + const unsigned long fcount) + : ImageStatus(image->ImageStatus), + Document(image->Document), + FirstFrame(image->FirstFrame + fstart), + NumberOfFrames(fcount), + TotalNumberOfFrames(image->TotalNumberOfFrames), + RepresentativeFrame(image->RepresentativeFrame), + FrameTime(image->FrameTime), + Rows(image->Rows), + Columns(image->Columns), + PixelWidth(image->PixelWidth), + PixelHeight(image->PixelHeight), + BitsAllocated(image->BitsAllocated), + BitsStored(image->BitsStored), + HighBit(image->HighBit), + BitsPerSample(image->BitsPerSample), + SamplesPerPixel(image->SamplesPerPixel), + Polarity(image->Polarity), + hasSignedRepresentation(image->hasSignedRepresentation), + hasPixelSpacing(image->hasPixelSpacing), + hasImagerPixelSpacing(image->hasImagerPixelSpacing), + hasNominalScannedPixelSpacing(image->hasNominalScannedPixelSpacing), + hasPixelAspectRatio(image->hasPixelAspectRatio), + isOriginal(0), + InputData(NULL), + FileCache(), + CurrentFragment(0) +{ +} + + +/* constructor: image scaled */ + +DiImage::DiImage(const DiImage *image, + const Uint16 columns, + const Uint16 rows, + const int aspect) + : ImageStatus(image->ImageStatus), + Document(image->Document), + FirstFrame(image->FirstFrame), + NumberOfFrames(image->NumberOfFrames), + TotalNumberOfFrames(image->TotalNumberOfFrames), + RepresentativeFrame(image->RepresentativeFrame), + FrameTime(image->FrameTime), + Rows(rows), + Columns(columns), + PixelWidth(1), + PixelHeight(1), + BitsAllocated(image->BitsAllocated), + BitsStored(image->BitsStored), + HighBit(image->HighBit), + BitsPerSample(image->BitsPerSample), + SamplesPerPixel(image->SamplesPerPixel), + Polarity(image->Polarity), + hasSignedRepresentation(image->hasSignedRepresentation), + hasPixelSpacing(0), + hasImagerPixelSpacing(0), + hasNominalScannedPixelSpacing(0), + hasPixelAspectRatio(0), + isOriginal(0), + InputData(NULL), + FileCache(), + CurrentFragment(0) +{ + /* we do not check for "division by zero", this is already done somewhere else */ + const double xfactor = OFstatic_cast(double, Columns) / OFstatic_cast(double, image->Columns); + const double yfactor = OFstatic_cast(double, Rows) / OFstatic_cast(double, image->Rows); + /* re-compute pixel width and height */ + if (image->hasPixelSpacing) + { + hasPixelSpacing = image->hasPixelSpacing; + PixelWidth = image->PixelWidth / xfactor; + PixelHeight = image->PixelHeight / yfactor; + } + else if (image->hasImagerPixelSpacing) + { + /* never change ImagerPixelSpacing, use PixelSpacing instead */ + hasImagerPixelSpacing = 0; + hasPixelSpacing = 1; + PixelWidth = image->PixelWidth / xfactor; + PixelHeight = image->PixelHeight / yfactor; + } + else if (image->hasNominalScannedPixelSpacing) + { + /* never change NominalScannedPixelSpacing, use PixelSpacing instead */ + hasNominalScannedPixelSpacing = 0; + hasPixelSpacing = 1; + PixelWidth = image->PixelWidth / xfactor; + PixelHeight = image->PixelHeight / yfactor; + } + else if (image->hasPixelAspectRatio && !aspect /*recognize pixel aspect ratio*/) + { + hasPixelAspectRatio = image->hasPixelAspectRatio; + PixelWidth = image->PixelWidth * xfactor; + PixelHeight = image->PixelHeight * yfactor; + /* do not store pixel aspect ratio for square pixels */ + if (PixelWidth == PixelHeight) + hasPixelAspectRatio = 0; + } +} + + +DiImage::DiImage(const DiImage *image, + const int degree) + : ImageStatus(image->ImageStatus), + Document(image->Document), + FirstFrame(image->FirstFrame), + NumberOfFrames(image->NumberOfFrames), + TotalNumberOfFrames(image->TotalNumberOfFrames), + RepresentativeFrame(image->RepresentativeFrame), + FrameTime(image->FrameTime), + Rows(((degree == 90) ||(degree == 270)) ? image->Columns : image->Rows), + Columns(((degree == 90) ||(degree == 270)) ? image->Rows : image->Columns), + PixelWidth(((degree == 90) ||(degree == 270)) ? image->PixelHeight : image->PixelWidth), + PixelHeight(((degree == 90) ||(degree == 270)) ? image-> PixelWidth : image->PixelHeight), + BitsAllocated(image->BitsAllocated), + BitsStored(image->BitsStored), + HighBit(image->HighBit), + BitsPerSample(image->BitsPerSample), + SamplesPerPixel(image->SamplesPerPixel), + Polarity(image->Polarity), + hasSignedRepresentation(image->hasSignedRepresentation), + hasPixelSpacing(image->hasPixelSpacing), + hasImagerPixelSpacing(image->hasImagerPixelSpacing), + hasNominalScannedPixelSpacing(image->hasNominalScannedPixelSpacing), + hasPixelAspectRatio(image->hasPixelAspectRatio), + isOriginal(0), + InputData(NULL), + FileCache(), + CurrentFragment(0) +{ +} + + +DiImage::DiImage(const DiImage *image, + const unsigned long frame, + const int stored, + const int alloc) + : ImageStatus(image->ImageStatus), + Document(image->Document), + FirstFrame(frame), + NumberOfFrames(1), + TotalNumberOfFrames(image->TotalNumberOfFrames), + RepresentativeFrame(0), + FrameTime(0), + Rows(image->Rows), + Columns(image->Columns), + PixelWidth(image->PixelWidth), + PixelHeight(image->PixelHeight), + BitsAllocated(alloc), + BitsStored(stored), + HighBit(stored - 1), + BitsPerSample(image->BitsPerSample), + SamplesPerPixel(image->SamplesPerPixel), + Polarity(image->Polarity), + hasSignedRepresentation(0), + hasPixelSpacing(image->hasPixelSpacing), + hasImagerPixelSpacing(image->hasImagerPixelSpacing), + hasNominalScannedPixelSpacing(image->hasNominalScannedPixelSpacing), + hasPixelAspectRatio(image->hasPixelAspectRatio), + isOriginal(0), + InputData(NULL), + FileCache(), + CurrentFragment(0) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiImage::~DiImage() +{ + delete InputData; +} + + +/*********************************************************************/ + + +int DiImage::processNextFrames(const unsigned long fcount) +{ + if ((ImageStatus == EIS_Normal) && (Document != NULL) && isOriginal) + { + if ((Document->getFlags() & CIF_UsePartialAccessToPixelData) && (Document->getPixelData() != NULL)) + { + // check whether there are still any frames to be processed + if (FirstFrame + NumberOfFrames < TotalNumberOfFrames) + { + FirstFrame += NumberOfFrames; + if (fcount > 0) + NumberOfFrames = fcount; + if (FirstFrame + NumberOfFrames > TotalNumberOfFrames) + NumberOfFrames = TotalNumberOfFrames - FirstFrame; + // free memory of previously processed frames + deleteInputData(); + // create new input data representation + convertPixelData(); + return (ImageStatus == EIS_Normal); + } + } + } + return 0; +} + + +/********************************************************************/ + + +int DiImage::rotate(const int degree) +{ + if ((degree == 90) || (degree == 270)) + { + Uint16 us = Rows; // swap image width and height + Rows = Columns; + Columns = us; + double db = PixelWidth; // swap pixel width and height + PixelWidth = PixelHeight; + PixelHeight = db; + return 1; + } + return 0; +} + + +/********************************************************************/ + + +void DiImage::deleteInputData() +{ + delete InputData; + InputData = NULL; +} + + +void DiImage::checkPixelExtension() +{ + if (hasPixelSpacing || hasImagerPixelSpacing || hasNominalScannedPixelSpacing || hasPixelAspectRatio) + { + if (PixelHeight == 0) + { + DCMIMGLE_WARN("invalid value for 'PixelHeight' (" << PixelHeight << ") ... assuming 1"); + /* according to the standard, a value of 0 would be valid in case number of rows is 1 */ + PixelHeight = 1; + } + else if (PixelHeight < 0) + { + DCMIMGLE_WARN("negative value for 'PixelHeight' (" << PixelHeight << ") ... assuming " << -PixelHeight); + PixelHeight = -PixelHeight; + } + if (PixelWidth == 0) + { + DCMIMGLE_WARN("invalid value for 'PixelWidth' (" << PixelWidth << ") ... assuming 1"); + /* according to the standard, a value of 0 would be valid in case number of columns is 1 */ + PixelWidth = 1; + } + else if (PixelWidth < 0) + { + DCMIMGLE_WARN("negative value for 'PixelWidth' (" << PixelWidth << ") ... assuming " << -PixelWidth); + PixelWidth = -PixelWidth; + } + } +} + + +void DiImage::convertPixelData() +{ + // pointer is already checked for not being NULL + DcmPixelData *pixel = Document->getPixelData(); + const DcmEVR evr = pixel->getVR(); + const OFBool compressed = Document->isCompressed(); + const char *xferUID = DcmXfer(Document->getTransferSyntax()).getXferID(); + const char *xferName = dcmFindNameOfUID(xferUID); + // output some useful information, e.g. for tracing purposes + DCMIMGLE_TRACE("Pixel Data VR: " << DcmVR(evr).getVRName() << ", " << (compressed ? "Compressed" : "Uncompressed") + << " (" << ((xferName != NULL) ? xferName : xferUID) << ")"); + DCMIMGLE_TRACE("First frame: " << FirstFrame << ", Number of frames: " << NumberOfFrames + << ", Total number of frames: " << TotalNumberOfFrames); + DCMIMGLE_TRACE("Columns: " << Columns << ", Rows: " << Rows << ", Samples per Pixel: " << SamplesPerPixel + << ", Photometric Interpretation: " << Document->getPhotometricInterpretation()); + DCMIMGLE_TRACE("Bits Allocated: " << BitsAllocated << ", Bits Stored: " << BitsStored << ", High Bit: " << HighBit + << ", " << (hasSignedRepresentation ? "Signed" : "Unsigned") << " integer"); + /* check for valid/supported pixel data encoding */ + if ((evr == EVR_OW) || ((evr == EVR_OB) && (compressed || (BitsAllocated <= 16)))) + { + const unsigned long fsize = OFstatic_cast(unsigned long, Rows) * OFstatic_cast(unsigned long, Columns) * + OFstatic_cast(unsigned long, SamplesPerPixel); + if ((BitsAllocated < 1) || (BitsStored < 1) || (BitsAllocated < BitsStored) || + (BitsStored > OFstatic_cast(Uint16, HighBit + 1))) + { + ImageStatus = EIS_InvalidValue; + DCMIMGLE_ERROR("invalid values for 'BitsAllocated' (" << BitsAllocated << "), " + << "'BitsStored' (" << BitsStored << ") and/or 'HighBit' (" << HighBit << ")"); + return; + } + else if ((evr == EVR_OB) && (BitsStored <= 8)) + { + // report a warning message on this standard violation + if (!compressed && (BitsAllocated > 8)) + DCMIMGLE_WARN("invalid value for 'BitsAllocated' (" << BitsAllocated << "), > 8 for OB encoded uncompressed 'PixelData'"); + if (hasSignedRepresentation) + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + else + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + } + else if ((evr == EVR_OB) && (BitsStored <= 16)) + { + // report a warning message on this standard violation + if (!compressed && (BitsAllocated > 8)) + DCMIMGLE_WARN("invalid value for 'BitsAllocated' (" << BitsAllocated << "), > 8 for OB encoded uncompressed 'PixelData'"); + if (hasSignedRepresentation) + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + else + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + } + else if ((evr == EVR_OB) && compressed && (BitsStored <= 32)) + { + if (hasSignedRepresentation) + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + else + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + } + else if (BitsStored <= 8) + { + if (hasSignedRepresentation) + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + else + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + } + else if (BitsStored <= 16) + { + if (hasSignedRepresentation) + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + else + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + } + else if (BitsStored <= 32) + { + if (hasSignedRepresentation) + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + else + InputData = new DiInputPixelTemplate(Document, BitsAllocated, BitsStored, HighBit, FirstFrame, NumberOfFrames, fsize, &FileCache, CurrentFragment); + } + else /* BitsStored > 32 !! */ + { + ImageStatus = EIS_NotSupportedValue; + DCMIMGLE_ERROR("invalid value for 'BitsStored' (" << BitsStored << ") ... exceeds " << MAX_BITS << " bit"); + return; + } + if (InputData == NULL) + { + ImageStatus = EIS_MemoryFailure; + DCMIMGLE_ERROR("can't allocate memory for input-representation"); + } + else if (InputData->getData() == NULL) + { + ImageStatus = EIS_InvalidImage; + DCMIMGLE_ERROR("can't convert input pixel data"); + } + else if (InputData->getPixelStart() >= InputData->getCount()) + { + ImageStatus = EIS_InvalidValue; + DCMIMGLE_ERROR("start offset (" << InputData->getPixelStart() << ") exceeds number of pixels stored (" + << InputData->getCount() << ")"); + } + } + else + { + ImageStatus = EIS_NotSupportedValue; + DCMIMGLE_ERROR("'PixelData' has a value representation other than OB (with 'BitsAllocated' <= 16) or OW"); + } +} + + +int DiImage::detachPixelData() +{ + if ((Document != NULL) && isOriginal) + { + if (Document->getFlags() & CIF_MayDetachPixelData) + { + /* do not detach if partial access is enabled */ + if (!(Document->getFlags() & CIF_UsePartialAccessToPixelData) || (FirstFrame + NumberOfFrames >= TotalNumberOfFrames)) + { + DcmPixelData *pixel = Document->getPixelData(); + if (pixel != NULL) + { + DCMIMGLE_DEBUG("detach pixel data"); + /* clear pixel data value */ + pixel->putUint16Array(NULL, 0); + return 1; + } + } else + DCMIMGLE_DEBUG("do not detach pixel data because of partial access"); + } + } + return 0; +} + + +int DiImage::setColumnRowRatio(const double ratio) +{ + hasPixelAspectRatio = 1; + hasPixelSpacing = hasImagerPixelSpacing = hasNominalScannedPixelSpacing = 0; + PixelWidth = ratio; + PixelHeight = 1; + checkPixelExtension(); + return 1; +} + + +int DiImage::setRowColumnRatio(const double ratio) +{ + hasPixelAspectRatio = 1; + hasPixelSpacing = hasImagerPixelSpacing = hasNominalScannedPixelSpacing = 0; + PixelWidth = 1; + PixelHeight = ratio; + checkPixelExtension(); + return 1; +} + + +int DiImage::setPolarity(const EP_Polarity polarity) +{ + if (polarity != Polarity) + { + Polarity = polarity; + return 1; + } + return 2; +} + + +void DiImage::updateImagePixelModuleAttributes(DcmItem &dataset) +{ + /* remove outdated attributes from the dataset */ + delete dataset.remove(DCM_SmallestImagePixelValue); + delete dataset.remove(DCM_LargestImagePixelValue); +/* + delete dataset.remove(DCM_PixelPaddingValue); + delete dataset.remove(DCM_PixelPaddingRangeLimit); + delete dataset.remove(DCM_SmallestPixelValueInSeries); + delete dataset.remove(DCM_LargestPixelValueInSeries); +*/ + /* update PixelAspectRatio & Co. */ + char buffer[32]; + OFStandard::ftoa(buffer, 15, PixelHeight, OFStandard::ftoa_format_f); + OFStandard::strlcat(buffer, "\\", 32); + OFStandard::ftoa(strchr(buffer, 0), 15, PixelWidth, OFStandard::ftoa_format_f); + + if (hasPixelSpacing) + dataset.putAndInsertString(DCM_PixelSpacing, buffer); + else + delete dataset.remove(DCM_PixelSpacing); + /* check for square pixels */ + if (hasPixelAspectRatio && (PixelWidth != PixelHeight)) + dataset.putAndInsertString(DCM_PixelAspectRatio, buffer); + else + delete dataset.remove(DCM_PixelAspectRatio); +} + + +// --- write given frame of the current image to DICOM dataset + +int DiImage::writeFrameToDataset(DcmItem &dataset, + const unsigned long frame, + const int bits, + const int planar) +{ + int result = 0; + const int bitsStored = getBits(bits); + /* get output pixel data */ + const void *pixel = getOutputData(frame, bitsStored, planar); + if (pixel != NULL) + { + char buffer[32]; + unsigned long count; + /* write color model dependent attributes */ + if ((getInternalColorModel() == EPI_Monochrome1) || (getInternalColorModel() == EPI_Monochrome2)) + { + /* monochrome image */ + count = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + dataset.putAndInsertString(DCM_PhotometricInterpretation, "MONOCHROME2"); + dataset.putAndInsertUint16(DCM_SamplesPerPixel, 1); + } else { + /* color image */ + count = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows) * 3 /*samples per pixel*/; + if (getInternalColorModel() == EPI_YBR_Full) + dataset.putAndInsertString(DCM_PhotometricInterpretation, "YBR_FULL"); + else + dataset.putAndInsertString(DCM_PhotometricInterpretation, "RGB"); + dataset.putAndInsertUint16(DCM_PlanarConfiguration, planar != 0); + dataset.putAndInsertUint16(DCM_SamplesPerPixel, 3); + } + /* write remaining attributes */ + dataset.putAndInsertUint16(DCM_Columns, Columns); + dataset.putAndInsertUint16(DCM_Rows, Rows); + dataset.putAndInsertString(DCM_NumberOfFrames, "1"); + if (bitsStored <= 8) + dataset.putAndInsertUint16(DCM_BitsAllocated, 8); + else if (bitsStored <= 16) + dataset.putAndInsertUint16(DCM_BitsAllocated, 16); + else + dataset.putAndInsertUint16(DCM_BitsAllocated, 32); + dataset.putAndInsertUint16(DCM_BitsStored, bitsStored); + dataset.putAndInsertUint16(DCM_HighBit, bitsStored - 1); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 0); + /* handle VOI transformations */ + if (dataset.tagExists(DCM_WindowCenter) || + dataset.tagExists(DCM_WindowWidth) || + dataset.tagExists(DCM_VOILUTSequence)) + { + delete dataset.remove(DCM_VOILUTSequence); + sprintf(buffer, "%lu", DicomImageClass::maxval(bitsStored, 0) / 2); + dataset.putAndInsertString(DCM_WindowCenter, buffer); + sprintf(buffer, "%lu", DicomImageClass::maxval(bitsStored, 0)); + dataset.putAndInsertString(DCM_WindowWidth, buffer); + } + delete dataset.remove(DCM_WindowCenterWidthExplanation); + /* write pixel data (OB or OW) */ + if (bitsStored <= 8) + dataset.putAndInsertUint8Array(DCM_PixelData, OFstatic_cast(Uint8 *, OFconst_cast(void *, pixel)), count); + else if (bitsStored <= 16) + dataset.putAndInsertUint16Array(DCM_PixelData, OFstatic_cast(Uint16 *, OFconst_cast(void *, pixel)), count); + else + dataset.putAndInsertUint16Array(DCM_PixelData, OFstatic_cast(Uint16 *, OFconst_cast(void *, pixel)), count * 2 /*double-words*/); + /* update other DICOM attributes */ + updateImagePixelModuleAttributes(dataset); + result = 1; + } + return result; +} + + +int DiImage::writeBMP(FILE *stream, + const unsigned long frame, + const int bits) +{ + int result = 0; + if ((stream != NULL) && ((bits == 8) || (bits == 24) || (bits == 32))) + { + /* create device independent bitmap: palette (8) or truecolor (24/32) */ + void *data = NULL; + const unsigned long bytes = createDIB(data, 0, frame, bits, 1 /*upsideDown*/); + if ((data != NULL) && (bytes > 0)) + { + /* number of bytes */ + SB_BitmapFileHeader fileHeader; + SB_BitmapInfoHeader infoHeader; + Uint32 *palette = (bits == 8) ? new Uint32[256] : OFstatic_cast(Uint32 *, NULL); + /* fill bitmap file header with data */ + fileHeader.bfType[0] = 'B'; + fileHeader.bfType[1] = 'M'; + fileHeader.bfSize = 14 /*sizeof(SB_BitmapFileHeader)*/ + 40 /*sizeof(SB_BitmapInfoHeader)*/ + bytes; + fileHeader.bfReserved1 = 0; + fileHeader.bfReserved2 = 0; + fileHeader.bfOffBits = 14 /*sizeof(SB_BitmapFileHeader)*/ + 40 /*sizeof(SB_BitmapInfoHeader)*/; + /* fill bitmap info header with data */ + infoHeader.biSize = 40 /*sizeof(SB_BitmapInfoHeader)*/; + infoHeader.biWidth = Columns; + infoHeader.biHeight = Rows; + infoHeader.biPlanes = 1; + infoHeader.biBitCount = bits; + infoHeader.biCompression = 0; + infoHeader.biSizeImage = 0; + infoHeader.biXPelsPerMeter = 0; + infoHeader.biYPelsPerMeter = 0; + infoHeader.biClrUsed = 0; + infoHeader.biClrImportant = 0; + /* create and fill color palette */ + if (palette != NULL) + { + /* add palette size */ + fileHeader.bfSize += 256 * 4; + fileHeader.bfOffBits += 256 * 4; + /* fill palette entries with gray values */ + for (Uint32 i = 0; i < 256; ++i) + palette[i] = (i << 16) | (i << 8) | i; + } + /* swap bytes if necessary */ + if (gLocalByteOrder != EBO_LittleEndian) + { + /* other data elements are always '0' and, therefore, can remain as they are */ + swap4Bytes(OFreinterpret_cast(Uint8 *, &fileHeader.bfSize)); + swap4Bytes(OFreinterpret_cast(Uint8 *, &fileHeader.bfOffBits)); + swap4Bytes(OFreinterpret_cast(Uint8 *, &infoHeader.biSize)); + swap4Bytes(OFreinterpret_cast(Uint8 *, &infoHeader.biWidth)); + swap4Bytes(OFreinterpret_cast(Uint8 *, &infoHeader.biHeight)); + swap2Bytes(OFreinterpret_cast(Uint8 *, &infoHeader.biPlanes)); + swap2Bytes(OFreinterpret_cast(Uint8 *, &infoHeader.biBitCount)); + if (palette != NULL) + swapBytes(OFreinterpret_cast(Uint8 *, palette), 256 * 4 /*byteLength*/, 4 /*valWidth*/); + } + /* write bitmap file header: do not write the struct because of 32-bit alignment */ + int ok = (fwrite(&fileHeader.bfType, sizeof(fileHeader.bfType), 1, stream) == 1); + ok &= (fwrite(&fileHeader.bfSize, sizeof(fileHeader.bfSize), 1, stream) == 1); + ok &= (fwrite(&fileHeader.bfReserved1, sizeof(fileHeader.bfReserved1), 1, stream) == 1); + ok &= (fwrite(&fileHeader.bfReserved2, sizeof(fileHeader.bfReserved2), 1, stream) == 1); + ok &= (fwrite(&fileHeader.bfOffBits, sizeof(fileHeader.bfOffBits), 1, stream) == 1); + /* write bitmap info header: do not write the struct because of 32-bit alignment */ + ok &= (fwrite(&infoHeader.biSize, sizeof(infoHeader.biSize), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biWidth, sizeof(infoHeader.biWidth), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biHeight, sizeof(infoHeader.biHeight), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biPlanes, sizeof(infoHeader.biPlanes), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biBitCount, sizeof(infoHeader.biBitCount), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biCompression, sizeof(infoHeader.biCompression), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biSizeImage, sizeof(infoHeader.biSizeImage), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biXPelsPerMeter, sizeof(infoHeader.biXPelsPerMeter), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biYPelsPerMeter, sizeof(infoHeader.biYPelsPerMeter), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biClrUsed, sizeof(infoHeader.biClrUsed), 1, stream) == 1); + ok &= (fwrite(&infoHeader.biClrImportant, sizeof(infoHeader.biClrImportant), 1, stream) == 1); + /* write color palette (if applicable) */ + if (palette != NULL) + ok &= (fwrite(palette, 4, 256, stream) == 256); + /* write pixel data */ + ok &= (fwrite(data, 1, OFstatic_cast(size_t, bytes), stream) == OFstatic_cast(size_t, bytes)); + /* delete color palette */ + delete[] palette; + if (ok) + result = 1; + } + /* delete pixel data */ + delete OFstatic_cast(char *, data); // type cast necessary to avoid compiler warnings using gcc >2.95 + } + return result; +} diff --git a/dcmimgle/libsrc/diinpx.cc b/dcmimgle/libsrc/diinpx.cc new file mode 100644 index 00000000..f0bf2bf8 --- /dev/null +++ b/dcmimgle/libsrc/diinpx.cc @@ -0,0 +1,56 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomInputPixel (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diinpx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiInputPixel::DiInputPixel(const unsigned int bits, + const unsigned long first, + const unsigned long number, + const unsigned long fsize) + : Count(0), + Bits(bits), + FirstFrame(first), + NumberOfFrames(number), + FrameSize(fsize), + PixelStart(first * fsize), + PixelCount(number * fsize), + ComputedCount(number * fsize), + AbsMinimum(0), + AbsMaximum(0) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiInputPixel::~DiInputPixel() +{ +} diff --git a/dcmimgle/libsrc/diluptab.cc b/dcmimgle/libsrc/diluptab.cc new file mode 100644 index 00000000..d6ded5c3 --- /dev/null +++ b/dcmimgle/libsrc/diluptab.cc @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomLookupTable (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvrus.h" + +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/diluptab.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiLookupTable::DiLookupTable(const DiDocument *docu, + const DcmTagKey &descriptor, + const DcmTagKey &data, + const DcmTagKey &explanation, + const EL_BitsPerTableEntry descripMode, + EI_Status *status) + : DiBaseLUT(), + OriginalBitsAllocated(16), + OriginalData(NULL) +{ + if (docu != NULL) + Init(docu, NULL, descriptor, data, explanation, descripMode, status); +} + + +DiLookupTable::DiLookupTable(const DiDocument *docu, + const DcmTagKey &sequence, + const DcmTagKey &descriptor, + const DcmTagKey &data, + const DcmTagKey &explanation, + const EL_BitsPerTableEntry descripMode, + const unsigned long pos, + unsigned long *card) + : DiBaseLUT(), + OriginalBitsAllocated(16), + OriginalData(NULL) +{ + if (docu != NULL) + { + DcmSequenceOfItems *seq = NULL; + const unsigned long count = docu->getSequence(sequence, seq); + /* store number of items in the optional return variable */ + if (card != NULL) + *card = count; + if ((seq != NULL) && (pos < count)) + { + DcmItem *item = seq->getItem(pos); + Init(docu, item, descriptor, data, explanation, descripMode); + } + } +} + + +DiLookupTable::DiLookupTable(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation, + const EL_BitsPerTableEntry descripMode, + const signed long first, + EI_Status *status) + : DiBaseLUT(), + OriginalBitsAllocated(16), + OriginalData(NULL) +{ + Uint16 us = 0; + const DcmElement *descElem = OFreinterpret_cast(const DcmElement *, &descriptor); + if (DiDocument::getElemValue(descElem, us, 0, OFTrue /*allowSigned*/) >= 3) // number of LUT entries + { + Count = (us == 0) ? MAX_TABLE_ENTRY_COUNT : us; // see DICOM supplement 5: "0" => 65536 + DiDocument::getElemValue(descElem, FirstEntry, 1, OFTrue /*allowSigned*/); // can be SS or US (will be typecasted later) + if ((first >= 0) && (FirstEntry != OFstatic_cast(Uint16, first))) + { + DCMIMGLE_WARN("invalid value for 'FirstInputValueMapped' in lookup table (" + << FirstEntry << ") ... assuming " << first); + FirstEntry = OFstatic_cast(Uint16, first); + } + DiDocument::getElemValue(descElem, us, 2, OFTrue /*allowSigned*/); // bits per entry (only informational) + unsigned long count = DiDocument::getElemValue(OFreinterpret_cast(const DcmElement *, &data), Data); + OriginalData = OFstatic_cast(void *, OFconst_cast(Uint16 *, Data)); // store pointer to original data + if (explanation != NULL) + DiDocument::getElemValue(OFreinterpret_cast(const DcmElement *, explanation), Explanation); // explanation (free form text) + checkTable(count, us, descripMode, status); + } else { + if (status != NULL) + { + *status = EIS_MissingAttribute; + DCMIMGLE_ERROR("incomplete or missing 'LookupTableDescriptor' " << descriptor.getTag()); + } else { + DCMIMGLE_WARN("incomplete or missing 'LookupTableDescriptor' " << descriptor.getTag() + << " ... ignoring LUT"); + } + } +} + + +DiLookupTable::DiLookupTable(Uint16 *buffer, + const Uint32 count, + const Uint16 bits) + : DiBaseLUT(buffer, count, bits), + OriginalBitsAllocated(16), + OriginalData(buffer) +{ + checkTable(count, bits); +} + + +/*--------------* + * destructor * + *--------------*/ + +DiLookupTable::~DiLookupTable() +{ +} + + +/********************************************************************/ + + +void DiLookupTable::Init(const DiDocument *docu, + DcmItem *item, + const DcmTagKey &descriptor, + const DcmTagKey &data, + const DcmTagKey &explanation, + const EL_BitsPerTableEntry descripMode, + EI_Status *status) +{ + Uint16 us = 0; + if (docu->getValue(descriptor, us, 0, item, OFTrue /*allowSigned*/) >= 3) // number of LUT entries + { + Count = (us == 0) ? MAX_TABLE_ENTRY_COUNT : us; // see DICOM supplement 5: "0" => 65536 + docu->getValue(descriptor, FirstEntry, 1, item, OFTrue /*allowSigned*/); // can be SS or US (will be typecasted later) + docu->getValue(descriptor, us, 2, item, OFTrue /*allowSigned*/); // bits per entry (only informational) + unsigned long count = docu->getValue(data, Data, item); + OriginalData = OFstatic_cast(void *, OFconst_cast(Uint16 *, Data)); // store pointer to original data + if (explanation != DCM_UndefinedTagKey) + docu->getValue(explanation, Explanation, 0 /*vm pos*/, item); // explanation (free form text) + checkTable(count, us, descripMode, status); + } else { + if (status != NULL) + { + *status = EIS_MissingAttribute; + DCMIMGLE_ERROR("incomplete or missing 'LookupTableDescriptor' " << descriptor); + } else { + DCMIMGLE_WARN("incomplete or missing 'LookupTableDescriptor' " << descriptor + << " ... ignoring LUT"); + } + } +} + + +void DiLookupTable::checkTable(unsigned long count, + Uint16 bits, + const EL_BitsPerTableEntry descripMode, + EI_Status *status) +{ + if (count > 0) // valid LUT + { + unsigned long i; + if (count > MAX_TABLE_ENTRY_COUNT) // cut LUT length to maximum + count = MAX_TABLE_ENTRY_COUNT; + if (count != Count) // length of LUT differs from number of LUT entries + { + if (count == ((Count + 1) >> 1)) // bits allocated 8, ignore padding + { + OriginalBitsAllocated = 8; + DCMIMGLE_DEBUG("lookup table uses 8 bits allocated ... converting to 16 bits"); + DataBuffer = new Uint16[Count]; // create new LUT + if ((DataBuffer != NULL) && (Data != NULL)) + { + const Uint8 *p = OFreinterpret_cast(const Uint8 *, Data); + Uint16 *q = DataBuffer; + if (gLocalByteOrder == EBO_BigEndian) // local machine has big endian byte ordering + { + DCMIMGLE_DEBUG("local machine has big endian byte ordering ... swapping 8 bit LUT entries"); + for (i = count; i != 0; --i) // copy 8 bit entries to new 16 bit LUT (swap hi/lo byte) + { + *(q++) = *(p + 1); // copy low byte ... + *(q++) = *p; // ... and then high byte + p += 2; // jump to next hi/lo byte pair + } + } else { // local machine has little endian byte ordering (or unknown) + for (i = Count; i != 0; --i) + *(q++) = *(p++); // copy 8 bit entries to new 16 bit LUT + } + } + Data = DataBuffer; + } else { + DCMIMGLE_WARN("invalid value for 'NumberOfTableEntries' (" << Count << ") ... assuming " << count); + Count = count; + } + } + MinValue = OFstatic_cast(Uint16, DicomImageClass::maxval(MAX_TABLE_ENTRY_SIZE)); // set minimum to maximum value + const Uint16 *p = Data; + Uint16 value; + if (DataBuffer != NULL) // LUT entries have been copied 8 -> 16 bits + { + for (i = Count; i != 0; --i) + { + value = *(p++); + if (value < MinValue) // get global minimum + MinValue = value; + if (value > MaxValue) // get global maximum + MaxValue = value; + } + checkBits(bits, 8, 0, descripMode); // set 'Bits' + } else { + int cmp = 0; + for (i = Count; i != 0; --i) + { + value = *(p++); + if (((value >> 8) != 0) && (value & 0xff) != (value >> 8)) // lo-byte not equal to hi-byte and ... + cmp = 1; + if (value < MinValue) // get global minimum + MinValue = value; + if (value > MaxValue) // get global maximum + MaxValue = value; + } + if (cmp == 0) // lo-byte is always equal to hi-byte + checkBits(bits, MIN_TABLE_ENTRY_SIZE, MAX_TABLE_ENTRY_SIZE, descripMode); // set 'Bits' + else + checkBits(bits, MAX_TABLE_ENTRY_SIZE, MIN_TABLE_ENTRY_SIZE, descripMode); + } + Uint16 mask = OFstatic_cast(Uint16, DicomImageClass::maxval(Bits)); // mask lo-byte (8) or full word (16) + if (((MinValue & mask) != MinValue) || ((MaxValue & mask) != MaxValue)) + { // mask table entries and copy them to new LUT + MinValue &= mask; + MaxValue &= mask; + if (DataBuffer == NULL) + DataBuffer = new Uint16[Count]; // create new LUT + if (DataBuffer != NULL) + { + p = Data; + Uint16 *q = DataBuffer; + for (i = Count; i != 0; --i) + *(q++) = *(p++) & mask; + } + Data = DataBuffer; + } + Valid = (Data != NULL); // lookup table is valid + } else { + if (status != NULL) + { + *status = EIS_InvalidValue; + DCMIMGLE_ERROR("empty 'LookupTableData' attribute"); + } else { + DCMIMGLE_WARN("empty 'LookupTableData' attribute ... ignoring LUT"); + } + } +} + + +/********************************************************************/ + + +void DiLookupTable::checkBits(const Uint16 bits, + const Uint16 rightBits, + const Uint16 wrongBits, + const EL_BitsPerTableEntry descripMode) +{ + /* is stored bit depth out of range? */ + if ((descripMode == ELM_IgnoreValue) || (bits < MIN_TABLE_ENTRY_SIZE) || (bits > MAX_TABLE_ENTRY_SIZE)) + { + /* check whether correct bit depth can be determined automatically */ + Bits = (MaxValue > 0) ? DicomImageClass::tobits(MaxValue, 0) : bits; + /* check bit depth (again) for valid range */ + if (Bits < MIN_TABLE_ENTRY_SIZE) + Bits = MIN_TABLE_ENTRY_SIZE; + else if (Bits > MAX_TABLE_ENTRY_SIZE) + Bits = MAX_TABLE_ENTRY_SIZE; + /* check whether value has changed? */ + if (bits != Bits) + { + if (descripMode == ELM_IgnoreValue) + { + DCMIMGLE_INFO("ignoring value for 'BitsPerTableEntry' (" << bits << ") ... using " << Bits << " instead"); + } else { + DCMIMGLE_WARN("unsuitable value for 'BitsPerTableEntry' (" << bits << ") ... valid range " + << MIN_TABLE_ENTRY_SIZE << "-" << MAX_TABLE_ENTRY_SIZE << ", using " << Bits); + } + } + } + else if ((descripMode == ELM_CheckValue) && (bits == wrongBits)) + { + DCMIMGLE_WARN("unsuitable value for 'BitsPerTableEntry' (" << bits << ") ... assuming " << rightBits); + Bits = rightBits; + } else { + /* assuming that the descriptor value is correct! */ + Bits = bits; + } +} + + +int DiLookupTable::invertTable(const int flag) +{ + int result = 0; + if ((Data != NULL) && (Count > 0) && (flag & 0x3)) + { + Uint32 i; + if (flag & 0x2) + { + if (OriginalData != NULL) + { + if (OriginalBitsAllocated == 8) + { + if (Bits <= 8) + { + const Uint8 *p = OFconst_cast(const Uint8 *, OFstatic_cast(Uint8 *, OriginalData)); + Uint8 *q = OFstatic_cast(Uint8 *, OriginalData); + const Uint8 max = OFstatic_cast(Uint8, DicomImageClass::maxval(Bits)); + for (i = Count; i != 0; --i) + *(q++) = max - *(p++); + result |= 0x2; + } + } else { + const Uint16 *p = OFconst_cast(const Uint16 *, OFstatic_cast(Uint16 *, OriginalData)); + Uint16 *q = OFstatic_cast(Uint16 *, OriginalData); + const Uint16 max = OFstatic_cast(Uint16, DicomImageClass::maxval(Bits)); + for (i = Count; i != 0; --i) + *(q++) = max - *(p++); + result |= 0x2; + } + } + } + if (flag & 0x1) + { + if (DataBuffer != NULL) + { + const Uint16 *p = OFconst_cast(const Uint16 *, DataBuffer); + Uint16 *q = DataBuffer; + const Uint16 max = OFstatic_cast(Uint16, DicomImageClass::maxval(Bits)); + for (i = Count; i != 0; --i) + *(q++) = max - *(p++); + result |= 0x1; + } + else if (!(flag & 0x2)) + { + DataBuffer = new Uint16[Count]; + if (DataBuffer != NULL) + { + const Uint16 *p = Data; + Uint16 *q = DataBuffer; + const Uint16 max = OFstatic_cast(Uint16, DicomImageClass::maxval(Bits)); + for (i = Count; i != 0; --i) + *(q++) = max - *(p++); + Data = DataBuffer; + result |= 0x1; + } + } + } + } + return result; +} + + +int DiLookupTable::mirrorTable(const int flag) +{ + int result = 0; + if ((Data != NULL) && (Count > 0) && (flag & 0x3)) + { + Uint32 i; + if (flag & 0x2) + { + if (OriginalData != NULL) + { + if (OriginalBitsAllocated == 8) + { + if (Bits <= 8) + { + Uint8 *p = OFstatic_cast(Uint8 *, OriginalData) + (Count - 1); + Uint8 *q = OFstatic_cast(Uint8 *, OriginalData); + Uint8 val; + const unsigned long mid = Count / 2; + for (i = mid; i != 0; --i) + { + val = *q; + *(q++) = *p; + *(p--) = val; + } + result |= 0x2; + } + } else { + Uint16 *p = OFstatic_cast(Uint16 *, OriginalData) + (Count - 1); + Uint16 *q = OFstatic_cast(Uint16 *, OriginalData); + Uint16 val; + const unsigned long mid = Count / 2; + for (i = mid; i != 0; --i) + { + val = *q; + *(q++) = *p; + *(p--) = val; + } + result |= 0x2; + } + } + } + if (flag & 0x1) + { + if (DataBuffer != NULL) + { + Uint16 *p = DataBuffer + (Count - 1); + Uint16 *q = DataBuffer; + Uint16 val; + const unsigned long mid = Count / 2; + for (i = mid; i != 0; --i) + { + val = *q; + *(q++) = *p; + *(p--) = val; + } + result |= 0x1; + } + else if (!(flag & 0x2)) + { + DataBuffer = new Uint16[Count]; + if (DataBuffer != NULL) + { + Uint16 *p = OFconst_cast(Uint16 *, Data) + (Count - 1); + Uint16 *q = DataBuffer; + Uint16 val; + const unsigned long mid = Count / 2; + for (i = mid; i != 0; --i) + { + val = *q; + *(q++) = *p; + *(p--) = val; + } + Data = DataBuffer; + result |= 0x1; + } + } + } + } + return result; +} + + +DiLookupTable *DiLookupTable::createInverseLUT() const +{ + DiLookupTable *lut = NULL; + if (Valid) + { + const Uint32 count = DicomImageClass::maxval(Bits, 0); + const Uint16 bits = DicomImageClass::tobits(Count + FirstEntry); + Uint16 *data = new Uint16[count]; + Uint8 *valid = new Uint8[count]; + if ((data != NULL) && (valid != NULL)) + { + OFBitmanipTemplate::zeroMem(valid, count); // initialize array + Uint32 i; + for (i = 0; i < Count; ++i) // 'copy' values to new array + { + if (!valid[Data[i]]) + data[Data[i]] = OFstatic_cast(Uint16, i + FirstEntry); + valid[Data[i]] = 1; + } + Uint32 last = 0; + i = 0; + while (i < count) // fill gaps with valid values + { + if (valid[i]) // skip valid values + last = i; + else + { + Uint32 j = i + 1; + while ((j < count) && !valid[j]) // find next valid value + ++j; + if (valid[last]) // check for starting conditions + { + const Uint32 mid = (j < count) ? (i + j) / 2 : count; + while (i < mid) + { // fill first half with 'left' value + data[i] = data[last]; + ++i; + } + } + if ((j < count) && valid[j]) + { + while (i < j) // fill second half with 'right' value + { + data[i] = data[j]; + ++i; + } + last = j; + } + } + ++i; + } + lut = new DiLookupTable(data, count, bits); // create new LUT + } + delete[] valid; + } + return lut; +} + + +int DiLookupTable::compareLUT(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor) +{ + int result = 1; + DiBaseLUT *lut = new DiLookupTable(data, descriptor); + if (lut != NULL) + result = compare(lut); + delete lut; + return result; +} + + +OFBool DiLookupTable::operator==(const DiBaseLUT &lut) +{ + return (compare(&lut) == 0); +} + + +OFBool DiLookupTable::operator==(const DiLookupTable &lut) +{ + return (compare(OFstatic_cast(const DiBaseLUT *, &lut)) == 0); +} diff --git a/dcmimgle/libsrc/dimo1img.cc b/dcmimgle/libsrc/dimo1img.cc new file mode 100644 index 00000000..613b067c --- /dev/null +++ b/dcmimgle/libsrc/dimo1img.cc @@ -0,0 +1,154 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochrome1Image (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimgle/dimo1img.h" +#include "dcmtk/dcmimgle/diutils.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiMono1Image::DiMono1Image(const DiDocument *docu, + const EI_Status status) + : DiMonoImage(docu, status) +{ +} + + +DiMono1Image::DiMono1Image(const DiMonoImage *image, + const unsigned long fstart, + const unsigned long fcount) + : DiMonoImage(image, fstart, fcount) +{ +} + + +DiMono1Image::DiMono1Image(const DiMonoImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate, + const int aspect, + const Uint16 pvalue) + : DiMonoImage(image, left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, interpolate, aspect, pvalue) +{ +} + + +DiMono1Image::DiMono1Image(const DiMonoImage *image, + const int horz, + const int vert) + : DiMonoImage(image, horz, vert) +{ +} + + +DiMono1Image::DiMono1Image(const DiMonoImage *image, + const int degree) + : DiMonoImage(image, degree) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiMono1Image::~DiMono1Image() +{ +} + + +/*********************************************************************/ + + +const void *DiMono1Image::getOutputData(const unsigned long frame, + const int bits, + const int planar) +{ + return DiMonoImage::getData(NULL, 0, frame, bits, planar, 1); +} + + +int DiMono1Image::getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar) +{ + return (DiMonoImage::getData(buffer, size, frame, bits, planar, 1) != NULL); +} + + +DiImage *DiMono1Image::createImage(const unsigned long fstart, + const unsigned long fcount) const +{ + DiImage *image = new DiMono1Image(this, fstart, fcount); + return image; +} + + +DiImage *DiMono1Image::createScale(const signed long left_pos, + const signed long top_pos, + const unsigned long src_cols, + const unsigned long src_rows, + const unsigned long dest_cols, + const unsigned long dest_rows, + const int interpolate, + const int aspect, + const Uint16 pvalue) const +{ + DiImage *image = new DiMono1Image(this, left_pos, top_pos, OFstatic_cast(Uint16, src_cols), + OFstatic_cast(Uint16, src_rows), OFstatic_cast(Uint16, dest_cols), OFstatic_cast(Uint16, dest_rows), + interpolate, aspect, pvalue); + return image; +} + + +DiImage *DiMono1Image::createFlip(const int horz, + const int vert) const +{ + DiImage *image = new DiMono1Image(this, horz, vert); + return image; +} + + +DiImage *DiMono1Image::createRotate(const int degree) const +{ + DiImage *image = new DiMono1Image(this, degree); + return image; +} + + +DiImage *DiMono1Image::createMono(const double, + const double, + const double) const +{ + return createImage(0, 0); +} diff --git a/dcmimgle/libsrc/dimo2img.cc b/dcmimgle/libsrc/dimo2img.cc new file mode 100644 index 00000000..ed88fbf8 --- /dev/null +++ b/dcmimgle/libsrc/dimo2img.cc @@ -0,0 +1,200 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochrome2Image (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimgle/dimo2img.h" +#include "dcmtk/dcmimgle/diutils.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiMono2Image::DiMono2Image(const DiDocument *docu, + const EI_Status status) + : DiMonoImage(docu, status) +{ +} + + +DiMono2Image::DiMono2Image(const DiDocument *docu, + const EI_Status status, + const double slope, + const double intercept) + : DiMonoImage(docu, status, slope, intercept) +{ +} + + +DiMono2Image::DiMono2Image(const DiDocument *docu, + const EI_Status status, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation) + : DiMonoImage(docu, status, data, descriptor, explanation) +{ +} + + +DiMono2Image::DiMono2Image(const DiDocument *docu, + const EI_Status status, + const char dummy) + : DiMonoImage(docu, status, dummy) +{ +} + + +DiMono2Image::DiMono2Image(const DiMonoImage *image, + const unsigned long fstart, + const unsigned long fcount) + : DiMonoImage(image, fstart, fcount) +{ +} + + +DiMono2Image::DiMono2Image(const DiColorImage *image, + const double red, + const double green, + const double blue) + : DiMonoImage(image, red, green, blue) +{ +} + + +DiMono2Image::DiMono2Image(const DiMonoImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate, + const int aspect, + const Uint16 pvalue) + : DiMonoImage(image, left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, interpolate, aspect, pvalue) +{ +} + + +DiMono2Image::DiMono2Image(const DiMonoImage *image, + const int horz, + const int vert) + : DiMonoImage(image, horz, vert) +{ +} + + +DiMono2Image::DiMono2Image(const DiMonoImage *image, + const int degree) + : DiMonoImage(image, degree) +{ +} + + +DiMono2Image::DiMono2Image(const DiMonoImage *image, + DiMonoOutputPixel *pixel, + const unsigned long frame, + const int stored, + const int alloc) + : DiMonoImage(image, pixel, frame, stored, alloc) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiMono2Image::~DiMono2Image() +{ +} + + +/*********************************************************************/ + + +const void *DiMono2Image::getOutputData(const unsigned long frame, + const int bits, + const int planar) +{ + return DiMonoImage::getData(NULL, 0, frame, bits, planar, 0); +} + + +int DiMono2Image::getOutputData(void *buffer, + const unsigned long size, + const unsigned long frame, + const int bits, + const int planar) +{ + return (DiMonoImage::getData(buffer, size, frame, bits, planar, 0) != NULL); +} + + +DiImage *DiMono2Image::createImage(const unsigned long fstart, + const unsigned long fcount) const +{ + DiImage *image = new DiMono2Image(this, fstart, fcount); + return image; +} + + +DiImage *DiMono2Image::createScale(const signed long left_pos, + const signed long top_pos, + const unsigned long src_cols, + const unsigned long src_rows, + const unsigned long dest_cols, + const unsigned long dest_rows, + const int interpolate, + const int aspect, + const Uint16 pvalue) const +{ + DiImage *image = new DiMono2Image(this, left_pos, top_pos, OFstatic_cast(Uint16, src_cols), + OFstatic_cast(Uint16, src_rows), OFstatic_cast(Uint16, dest_cols), OFstatic_cast(Uint16, dest_rows), + interpolate, aspect, pvalue); + return image; +} + + +DiImage *DiMono2Image::createFlip(const int horz, + const int vert) const +{ + DiImage *image = new DiMono2Image(this, horz, vert); + return image; +} + + +DiImage *DiMono2Image::createRotate(const int degree) const +{ + DiImage *image = new DiMono2Image(this, degree); + return image; +} + + +DiImage *DiMono2Image::createMono(const double, + const double, + const double) const +{ + return createImage(0, 0); +} diff --git a/dcmimgle/libsrc/dimoimg.cc b/dcmimgle/libsrc/dimoimg.cc new file mode 100644 index 00000000..808483d6 --- /dev/null +++ b/dcmimgle/libsrc/dimoimg.cc @@ -0,0 +1,2170 @@ +/* + * + * Copyright (C) 1996-2019 OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +#include "dcmtk/dcmimgle/dimoimg.h" +#include "dcmtk/dcmimgle/dimo2img.h" +#include "dcmtk/dcmimgle/dimoipxt.h" +#include "dcmtk/dcmimgle/dimocpt.h" +#include "dcmtk/dcmimgle/dimosct.h" +#include "dcmtk/dcmimgle/dimoflt.h" +#include "dcmtk/dcmimgle/dimorot.h" +#include "dcmtk/dcmimgle/dimoopxt.h" +#include "dcmtk/dcmimgle/digsdfn.h" +#include "dcmtk/dcmimgle/didocu.h" +#include "dcmtk/dcmimgle/diutils.h" +#include "dcmtk/dcmimgle/diregbas.h" + +#define INCLUDE_CMATH +#define INCLUDE_CINTTYPES +#include "dcmtk/ofstd/ofstdinc.h" + + +/*---------------------* + * const definitions * + *---------------------*/ + +const unsigned int Default_MinDensity = 20; +const unsigned int Default_MaxDensity = 300; +const unsigned int Default_Reflection = 10; +const unsigned int Default_Illumination = 2000; + + +/*----------------* + * constructors * + *----------------*/ + +/* + * standard constructor to create mono-image + */ + +DiMonoImage::DiMonoImage(const DiDocument *docu, + const EI_Status status) + : DiImage(docu, status, 1), + WindowCenter(0), + WindowWidth(0), + WindowCount(0), + VoiLutCount(0), + ValidWindow(0), + VoiExplanation(), + VoiLutFunction(EFV_Default), + PresLutShape(ESP_Default), + MinDensity(Default_MinDensity), + MaxDensity(Default_MaxDensity), + Reflection(Default_Reflection), + Illumination(Default_Illumination), + VoiLutData(NULL), + PresLutData(NULL), + InterData(NULL), + DisplayFunction(NULL), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + if (Document->getFlags() & CIF_UsePresentationState) + PresLutShape = ESP_Identity; + DiMonoModality *modality = new DiMonoModality(Document, InputData); + Init(modality); + } +} + + +DiMonoImage::DiMonoImage(const DiDocument *docu, + const EI_Status status, + const double slope, + const double intercept) + : DiImage(docu, status, 1), + WindowCenter(0), + WindowWidth(0), + WindowCount(0), + VoiLutCount(0), + ValidWindow(0), + VoiExplanation(), + VoiLutFunction(EFV_Default), + PresLutShape(ESP_Default), + MinDensity(Default_MinDensity), + MaxDensity(Default_MaxDensity), + Reflection(Default_Reflection), + Illumination(Default_Illumination), + VoiLutData(NULL), + PresLutData(NULL), + InterData(NULL), + DisplayFunction(NULL), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + if (Document->getFlags() & CIF_UsePresentationState) + PresLutShape = ESP_Identity; + DiMonoModality *modality = new DiMonoModality(Document, InputData, slope, intercept); + Init(modality); + } +} + + +DiMonoImage::DiMonoImage(const DiDocument *docu, + const EI_Status status, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation) + : DiImage(docu, status, 1), + WindowCenter(0), + WindowWidth(0), + WindowCount(0), + VoiLutCount(0), + ValidWindow(0), + VoiExplanation(), + VoiLutFunction(EFV_Default), + PresLutShape(ESP_Default), + MinDensity(Default_MinDensity), + MaxDensity(Default_MaxDensity), + Reflection(Default_Reflection), + Illumination(Default_Illumination), + VoiLutData(NULL), + PresLutData(NULL), + InterData(NULL), + DisplayFunction(NULL), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if ((Document != NULL) && (InputData != NULL) && (ImageStatus == EIS_Normal)) + { + if (Document->getFlags() & CIF_UsePresentationState) + PresLutShape = ESP_Identity; + DiMonoModality *modality = new DiMonoModality(Document, InputData, data, descriptor, explanation); + Init(modality); + } +} + + +/* + * kind of copy-constructor, 'dummy' is necessary to differ from the above "standard"-constructor + */ + +DiMonoImage::DiMonoImage(const DiDocument *docu, + const EI_Status status, + const char /*dummy*/) + : DiImage(docu, status/*, dummy*/), + WindowCenter(0), + WindowWidth(0), + WindowCount(0), + VoiLutCount(0), + ValidWindow(0), + VoiExplanation(), + VoiLutFunction(EFV_Default), + PresLutShape(ESP_Default), + MinDensity(Default_MinDensity), + MaxDensity(Default_MaxDensity), + Reflection(Default_Reflection), + Illumination(Default_Illumination), + VoiLutData(NULL), + PresLutData(NULL), + InterData(NULL), + DisplayFunction(NULL), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; +} + + +/* + * create image copy of specified frame range + */ + +DiMonoImage::DiMonoImage(const DiMonoImage *image, + const unsigned long fstart, + const unsigned long fcount) + : DiImage(image, fstart, fcount), + WindowCenter(image->WindowCenter), + WindowWidth(image->WindowWidth), + WindowCount(image->WindowCount), + VoiLutCount(image->VoiLutCount), + ValidWindow(image->ValidWindow), + VoiExplanation(image->VoiExplanation), + VoiLutFunction(image->VoiLutFunction), + PresLutShape(image->PresLutShape), + MinDensity(image->MinDensity), + MaxDensity(image->MaxDensity), + Reflection(image->Reflection), + Illumination(image->Illumination), + VoiLutData(image->VoiLutData), + PresLutData(image->PresLutData), + InterData(NULL), + DisplayFunction(image->DisplayFunction), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = image->Overlays[0]; + Overlays[1] = image->Overlays[1]; + if (image->InterData != NULL) + { + const unsigned long fsize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Sint8: + InterData = new DiMonoCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Uint16: + InterData = new DiMonoCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Sint16: + InterData = new DiMonoCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Uint32: + InterData = new DiMonoCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + case EPR_Sint32: + InterData = new DiMonoCopyTemplate(image->InterData, fstart, fcount, fsize); + break; + } + } + checkInterData(); + for (int i = 0; i < 2; ++i) + { + if (Overlays[i] != NULL) + Overlays[i]->addReference(); + } + if (VoiLutData != NULL) + VoiLutData->addReference(); + if (PresLutData != NULL) + PresLutData->addReference(); +} + + +/* + * convert color-image to mono-image with given 'red', 'green' and 'blue' coefficients + */ + +DiMonoImage::DiMonoImage(const DiColorImage *image, + const double red, + const double green, + const double blue) + : DiImage(OFreinterpret_cast(const DiImage *, image)), + WindowCenter(0), + WindowWidth(0), + WindowCount(0), + VoiLutCount(0), + ValidWindow(0), + VoiExplanation(), + VoiLutFunction(EFV_Default), + PresLutShape(ESP_Default), + MinDensity(Default_MinDensity), + MaxDensity(Default_MaxDensity), + Reflection(Default_Reflection), + Illumination(Default_Illumination), + VoiLutData(NULL), + PresLutData(NULL), + InterData(NULL), + DisplayFunction(NULL), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if ((Document != NULL) && (Document->getFlags() & CIF_UsePresentationState)) + PresLutShape = ESP_Identity; + if (DiRegisterBase::Pointer != NULL) + InterData = DiRegisterBase::Pointer->createMonoImageData(image, red, green, blue); + if ((InterData == NULL) || (InterData->getData() == NULL)) + ImageStatus = EIS_InvalidImage; +} + + +/* + * scale 'image' to size given by 'columns' and 'rows', 'interpolate' always if parameter is true + */ + +DiMonoImage::DiMonoImage(const DiMonoImage *image, + const signed long left_pos, + const signed long top_pos, + const Uint16 src_cols, + const Uint16 src_rows, + const Uint16 dest_cols, + const Uint16 dest_rows, + const int interpolate, + const int aspect, + const Uint16 pvalue) + : DiImage(image, dest_cols, dest_rows, aspect), + WindowCenter(image->WindowCenter), + WindowWidth(image->WindowWidth), + WindowCount(image->WindowCount), + VoiLutCount(image->VoiLutCount), + ValidWindow(image->ValidWindow), + VoiExplanation(image->VoiExplanation), + VoiLutFunction(image->VoiLutFunction), + PresLutShape(image->PresLutShape), + MinDensity(image->MinDensity), + MaxDensity(image->MaxDensity), + Reflection(image->Reflection), + Illumination(image->Illumination), + VoiLutData(image->VoiLutData), + PresLutData(image->PresLutData), + InterData(NULL), + DisplayFunction(image->DisplayFunction), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if (image->InterData != NULL) + { + const unsigned int bits = image->InterData->getBits(); + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoScaleTemplate(image->InterData, image->Columns, image->Rows, + left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, + bits, interpolate, pvalue); + break; + case EPR_Sint8: + InterData = new DiMonoScaleTemplate(image->InterData, image->Columns, image->Rows, + left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, + bits, interpolate, pvalue); + break; + case EPR_Uint16: + InterData = new DiMonoScaleTemplate(image->InterData, image->Columns, image->Rows, + left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, + bits, interpolate, pvalue); + break; + case EPR_Sint16: + InterData = new DiMonoScaleTemplate(image->InterData, image->Columns, image->Rows, + left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, + bits, interpolate, pvalue); + break; + case EPR_Uint32: + InterData = new DiMonoScaleTemplate(image->InterData, image->Columns, image->Rows, + left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, + bits, interpolate, pvalue); + break; + case EPR_Sint32: + InterData = new DiMonoScaleTemplate(image->InterData, image->Columns, image->Rows, + left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, NumberOfFrames, + bits, interpolate, pvalue); + break; + } + } + if (checkInterData(0)) + { + for (int i = 0; i < 2; ++i) + { + if ((image->Overlays[i] != NULL) && (image->Overlays[i]->getCount() > 0)) + { + Overlays[i] = new DiOverlay(image->Overlays[i], left_pos, top_pos, + OFstatic_cast(double, dest_cols) / OFstatic_cast(double, src_cols), + OFstatic_cast(double, dest_rows) / OFstatic_cast(double, src_rows)); + } + } + } + if (VoiLutData != NULL) + VoiLutData->addReference(); + if (PresLutData != NULL) + PresLutData->addReference(); +} + + +/* + * flip + */ + +DiMonoImage::DiMonoImage(const DiMonoImage *image, + const int horz, + const int vert) + : DiImage(image), + WindowCenter(image->WindowCenter), + WindowWidth(image->WindowWidth), + WindowCount(image->WindowCount), + VoiLutCount(image->VoiLutCount), + ValidWindow(image->ValidWindow), + VoiExplanation(image->VoiExplanation), + VoiLutFunction(image->VoiLutFunction), + PresLutShape(image->PresLutShape), + MinDensity(image->MinDensity), + MaxDensity(image->MaxDensity), + Reflection(image->Reflection), + Illumination(image->Illumination), + VoiLutData(image->VoiLutData), + PresLutData(image->PresLutData), + InterData(NULL), + DisplayFunction(image->DisplayFunction), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if (image->InterData != NULL) + { + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + case EPR_Sint8: + InterData = new DiMonoFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + case EPR_Uint16: + InterData = new DiMonoFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + case EPR_Sint16: + InterData = new DiMonoFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + case EPR_Uint32: + InterData = new DiMonoFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + case EPR_Sint32: + InterData = new DiMonoFlipTemplate(image->InterData, Columns, Rows, NumberOfFrames, horz, vert); + break; + } + } + if (checkInterData(0)) + { + for (int i = 0; i < 2; ++i) + { + if ((image->Overlays[i] != NULL) && (image->Overlays[i]->getCount() > 0)) + Overlays[i] = new DiOverlay(image->Overlays[i], horz, vert, Columns, Rows); + } + } + if (VoiLutData != NULL) + VoiLutData->addReference(); + if (PresLutData != NULL) + PresLutData->addReference(); +} + + +/* + * rotate + */ + +DiMonoImage::DiMonoImage(const DiMonoImage *image, + const int degree) + : DiImage(image, degree), + WindowCenter(image->WindowCenter), + WindowWidth(image->WindowWidth), + WindowCount(image->WindowCount), + VoiLutCount(image->VoiLutCount), + ValidWindow(image->ValidWindow), + VoiExplanation(image->VoiExplanation), + VoiLutFunction(image->VoiLutFunction), + PresLutShape(image->PresLutShape), + MinDensity(image->MinDensity), + MaxDensity(image->MaxDensity), + Reflection(image->Reflection), + Illumination(image->Illumination), + VoiLutData(image->VoiLutData), + PresLutData(image->PresLutData), + InterData(NULL), + DisplayFunction(image->DisplayFunction), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if (image->InterData != NULL) + { + switch (image->InterData->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + case EPR_Sint8: + InterData = new DiMonoRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + case EPR_Uint16: + InterData = new DiMonoRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + case EPR_Sint16: + InterData = new DiMonoRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + case EPR_Uint32: + InterData = new DiMonoRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + case EPR_Sint32: + InterData = new DiMonoRotateTemplate(image->InterData, image->Columns, image->Rows, Columns, Rows, + NumberOfFrames, degree); + break; + } + } + if (checkInterData(0)) + { + for (int i = 0; i < 2; ++i) + { + if ((image->Overlays[i] != NULL) && (image->Overlays[i]->getCount() > 0)) + Overlays[i] = new DiOverlay(image->Overlays[i], degree, Columns, Rows); + } + } + if (VoiLutData != NULL) + VoiLutData->addReference(); + if (PresLutData != NULL) + PresLutData->addReference(); +} + + +/* + * this implementation is necessary to avoid linker errors on NeXTSTEP (gcc 2.5.8) + */ + +DiMonoImage::DiMonoImage(const DiMonoImage &) + : DiImage(NULL), + WindowCenter(0), + WindowWidth(0), + WindowCount(0), + VoiLutCount(0), + ValidWindow(0), + VoiExplanation(), + VoiLutFunction(EFV_Default), + PresLutShape(ESP_Default), + MinDensity(Default_MinDensity), + MaxDensity(Default_MaxDensity), + Reflection(Default_Reflection), + Illumination(Default_Illumination), + VoiLutData(NULL), + PresLutData(NULL), + InterData(NULL), + DisplayFunction(NULL), + OutputData(NULL), + OverlayData(NULL) +{ + DCMIMGLE_FATAL("using unimplemented copy constructor in class DiMonoImage ... aborting"); + abort(); +} + + +/* + * createMonoOutputImage + */ + +DiMonoImage::DiMonoImage(const DiMonoImage *image, + DiMonoOutputPixel *pixel, + const unsigned long frame, + const int stored, + const int alloc) + : DiImage(image, frame, stored, alloc), + WindowCenter(0), + WindowWidth(0), + WindowCount(0), + VoiLutCount(0), + ValidWindow(0), + VoiExplanation(), + VoiLutFunction(EFV_Default), + PresLutShape(ESP_Default), + MinDensity(Default_MinDensity), + MaxDensity(Default_MaxDensity), + Reflection(Default_Reflection), + Illumination(Default_Illumination), + VoiLutData(NULL), + PresLutData(NULL), + InterData(NULL), + DisplayFunction(NULL), + OutputData(NULL), + OverlayData(NULL) +{ + Overlays[0] = NULL; + Overlays[1] = NULL; + if ((Document != NULL) && (Document->getFlags() & CIF_UsePresentationState)) + PresLutShape = ESP_Identity; + if (pixel->getData() != NULL) + { + DiMonoModality *modality = new DiMonoModality(stored); + switch (pixel->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoPixelTemplate(pixel, modality); + break; + case EPR_Uint16: + InterData = new DiMonoPixelTemplate(pixel, modality); + break; + case EPR_Uint32: + InterData = new DiMonoPixelTemplate(pixel, modality); + break; + default: + break; + } + } + checkInterData(0); +} + + +/*--------------* + * destructor * + *--------------*/ + +DiMonoImage::~DiMonoImage() +{ + delete InterData; + delete OutputData; + delete OFstatic_cast(char *, OverlayData); // type cast necessary to avoid compiler warnings using gcc 2.95 + if (VoiLutData != NULL) + VoiLutData->removeReference(); // only delete if object is no longer referenced + if (PresLutData != NULL) + PresLutData->removeReference(); + for (int i = 0; i < 2; ++i) + { + if (Overlays[i] != NULL) + Overlays[i]->removeReference(); + } +} + + +/*********************************************************************/ + + +int DiMonoImage::processNextFrames(const unsigned long fcount) +{ + if (DiImage::processNextFrames(fcount)) + { + if (InterData != NULL) + { + /* do not create a new object but reference the existing one */ + DiMonoModality *modality = InterData->addReferenceToModality(); + delete InterData; + InterData = NULL; + Init(modality, OFTrue /* reuse */); + return (ImageStatus == EIS_Normal); + } + } + return 0; +} + +/*********************************************************************/ + + +void DiMonoImage::Init(DiMonoModality *modality, + const OFBool reuse) +{ + if (modality != NULL) + { + /* only create new overlay object if none exists */ + if (Overlays[0] == NULL) + { + Overlays[0] = new DiOverlay(Document, BitsAllocated, BitsStored, HighBit); + if ((Overlays[0] != NULL) && !(Document->getFlags() & CIF_UsePresentationState)) + Overlays[0]->showAllPlanes(); // default: show all overlays with stored modes + if ((Overlays[0] == NULL) || (Overlays[0]->getCount() == 0) || (!Overlays[0]->hasEmbeddedData())) + detachPixelData(); // no longer needed, save memory + } + switch (InputData->getRepresentation()) + { + case EPR_Uint8: + InitUint8(modality); + break; + case EPR_Sint8: + InitSint8(modality); + break; + case EPR_Uint16: + InitUint16(modality); + break; + case EPR_Sint16: + InitSint16(modality); + break; + case EPR_Uint32: + InitUint32(modality); + break; + case EPR_Sint32: + InitSint32(modality); + break; + } + deleteInputData(); // no longer needed, save memory + if (modality->getBits() > 0) + BitsPerSample = modality->getBits(); // get bit depth of internal representation + if (checkInterData()) + { + /* get grayscale related attributes (if desired) */ + if (!reuse && !(Document->getFlags() & CIF_UsePresentationState)) + { + /* VOI windows */ + WindowCount = Document->getVM(DCM_WindowCenter); + const unsigned long count = Document->getVM(DCM_WindowWidth); + if (count < WindowCount) // determine number of VOI windows + WindowCount = count; + /* VOI LUT */ + DcmSequenceOfItems *seq = NULL; + VoiLutCount = Document->getSequence(DCM_VOILUTSequence, seq); + /* VOI LUT Function */ + OFString str; + if (Document->getValue(DCM_VOILUTFunction, str)) + { + if (str == "LINEAR") + VoiLutFunction = EFV_Linear; + else if (str == "SIGMOID") + VoiLutFunction = EFV_Sigmoid; + else + DCMIMGLE_WARN("unknown value for 'VOILUTFunction' (" << str << ") ... ignoring"); + } + /* Presentation LUT Shape */ + if (Document->getValue(DCM_PresentationLUTShape, str)) + { + if (str == "IDENTITY") + PresLutShape = ESP_Identity; + else if (str == "INVERSE") + PresLutShape = ESP_Inverse; + else + DCMIMGLE_WARN("unknown value for 'PresentationLUTShape' (" << str << ") ... ignoring"); + } + } + } + } else + detachPixelData(); +} + + +void DiMonoImage::InitUint8(DiMonoModality *modality) +{ + if (modality != NULL) + { + switch (modality->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + } + } +} + + +void DiMonoImage::InitSint8(DiMonoModality *modality) +{ + if (modality != NULL) + { + switch (modality->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + } + } +} + +void DiMonoImage::InitUint16(DiMonoModality *modality) +{ + if (modality != NULL) + { + switch (modality->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + } + } +} + + +void DiMonoImage::InitSint16(DiMonoModality *modality) +{ + if (modality != NULL) + { + switch (modality->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + } + } +} + + +void DiMonoImage::InitUint32(DiMonoModality *modality) +{ + if (modality != NULL) + { + switch (modality->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + } + } +} + + +void DiMonoImage::InitSint32(DiMonoModality *modality) +{ + if (modality != NULL) + { + switch (modality->getRepresentation()) + { + case EPR_Uint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint8: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint16: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Uint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + case EPR_Sint32: + InterData = new DiMonoInputPixelTemplate(InputData, modality); + break; + } + } +} + +/*********************************************************************/ + + +int DiMonoImage::checkInterData(const int mode) +{ + if (InterData == NULL) + { + if (ImageStatus == EIS_Normal) + { + ImageStatus = EIS_MemoryFailure; + DCMIMGLE_ERROR("can't allocate memory for inter-representation"); + } else + ImageStatus = EIS_InvalidImage; + } + else if (InterData->getData() == NULL) + ImageStatus = EIS_InvalidImage; + else if (mode && (ImageStatus == EIS_Normal) && isOriginal /* do not check derived images */) + { + const unsigned long count = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows) * NumberOfFrames; + if ((InterData->getInputCount() != count) && ((InterData->getInputCount() >> 1) != ((count + 1) >> 1))) + { + DCMIMGLE_WARN("computed (" << count << ") and stored (" << InterData->getInputCount() << ") pixel count differ"); + } + } + return (ImageStatus == EIS_Normal); +} + + +void DiMonoImage::deleteOutputData() +{ + delete OutputData; + OutputData = NULL; +} + + +unsigned long DiMonoImage::getOutputDataSize(const int bits) const +{ + unsigned long result = 0; + if ((ImageStatus == EIS_Normal) && (((bits > 0) && (bits <= MAX_BITS)) || (bits == MI_PastelColor))) + { + int samples = 1; + int bytesPerPixel = 1; + if (bits == MI_PastelColor) // use true color pastel mode + samples = 3; + else if (bits > 16) + bytesPerPixel = 4; + else if (bits > 8) + bytesPerPixel = 2; + /* compute number of bytes required to store a rendered frame */ + result = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows) * samples * bytesPerPixel; + } + return result; +} + + +const void *DiMonoImage::getOutputPlane(const int) const +{ + if (OutputData != NULL) + return OutputData->getData(); // monochrome images don't have multiple planes + return NULL; +} + + +void DiMonoImage::deleteOverlayData() +{ + delete OFstatic_cast(char *, OverlayData); // type cast necessary to avoid compiler warnings using gcc 2.95 + OverlayData = NULL; +} + + +/*********************************************************************/ + + +int DiMonoImage::getMinMaxValues(double &min, + double &max, + const int mode) const +{ + if (InterData != NULL) + { + if (mode) + { + min = InterData->getAbsMinimum(); + max = InterData->getAbsMaximum(); + return 1; + } + return InterData->getMinMaxValues(min, max); + } + return 0; +} + + +int DiMonoImage::setDisplayFunction(DiDisplayFunction *display) +{ + DisplayFunction = display; + return (DisplayFunction != NULL) && (DisplayFunction->isValid()); +} + + +int DiMonoImage::setNoDisplayFunction() +{ + if (DisplayFunction != NULL) + { + DisplayFunction = NULL; + return 1; + } + return 2; +} + + +int DiMonoImage::convertPValueToDDL(const Uint16 pvalue, + Uint16 &ddl, + const int bits) +{ + const unsigned long maxvalue = DicomImageClass::maxval(bits); + if ((DisplayFunction != NULL) && (DisplayFunction->isValid()) && (DisplayFunction->getMaxDDLValue() == maxvalue)) + { + const DiDisplayLUT *dlut = DisplayFunction->getLookupTable(WIDTH_OF_PVALUES); + if ((dlut != NULL) && (dlut->isValid())) + { + ddl = dlut->getValue(pvalue); // perform display transformation + return 1; + } + } + if ((bits >= 1) && (bits <= WIDTH_OF_PVALUES)) // no display function: perform linear scaling + { + ddl = OFstatic_cast(Uint16, OFstatic_cast(double, maxvalue) * OFstatic_cast(double, pvalue) / + OFstatic_cast(double, DicomImageClass::maxval(WIDTH_OF_PVALUES))); + return 2; + } + return 0; +} + + +int DiMonoImage::setNoVoiTransformation() +{ + int old = 2; + if (VoiLutData != NULL) + { + if (VoiLutData->isValid()) + old = 1; + VoiLutData->removeReference(); + } + VoiLutData = NULL; + VoiExplanation = ""; + if (ValidWindow) + old = 1; + ValidWindow = 0; + return old; +} + + +int DiMonoImage::setMinMaxWindow(const int idx) +{ + if (InterData != NULL) + { + double center; + double width; + if (InterData->getMinMaxWindow(idx != 0, center, width)) + return setWindow(center, width, "Min-Max Window"); + } + return 0; +} + + +int DiMonoImage::setRoiWindow(const unsigned long left_pos, + const unsigned long top_pos, + const unsigned long width, + const unsigned long height, + const unsigned long frame) +{ + if ((InterData != NULL) && (frame < NumberOfFrames)) + { + double voiCenter; + double voiWidth; + if (InterData->getRoiWindow(left_pos, top_pos, width, height, Columns, Rows, frame, voiCenter, voiWidth)) + return setWindow(voiCenter, voiWidth, "ROI Window"); + } + return 0; +} + + +int DiMonoImage::setHistogramWindow(const double thresh) +{ + if (InterData != NULL) + { + double center; + double width; + if (InterData->getHistogramWindow(thresh, center, width)) + return setWindow(center, width, "Histogram Window"); + } + return 0; +} + + +int DiMonoImage::setWindow(const unsigned long pos) +{ + if (!(Document->getFlags() & CIF_UsePresentationState)) + { + double center; + double width; + WindowCount = Document->getValue(DCM_WindowCenter, center, pos); + unsigned long count = Document->getValue(DCM_WindowWidth, width, pos); + if (count < WindowCount) + WindowCount = count; + if (pos < WindowCount) + { + /* save return value to be used later (setWindow clears the explanation string!) */ + const int result = setWindow(center, width); + /* get the stored explanation string */ + Document->getValue(DCM_WindowCenterWidthExplanation, VoiExplanation, pos); + return result; + } + } + return 0; +} + + +int DiMonoImage::setWindow(const double center, + const double width, + const char *explanation) +{ + if (VoiLutData != NULL) + VoiLutData->removeReference(); + VoiLutData = NULL; + if (explanation != NULL) + VoiExplanation = explanation; + else + VoiExplanation = ""; + if (width < 1) // not valid, according to supplement 33 + return ValidWindow = 0; + else if (!ValidWindow || (center != WindowCenter) || (width != WindowWidth)) + { + WindowCenter = center; + WindowWidth = width; + return ValidWindow = 1; + } + return 2; // window is unchanged (and valid) +} + + +int DiMonoImage::getWindow(double ¢er, double &width) +{ + if (ValidWindow) + { + center = WindowCenter; + width = WindowWidth; + return 1; + } + return 0; +} + + +EF_VoiLutFunction DiMonoImage::getVoiLutFunction() const +{ + return VoiLutFunction; +} + + +int DiMonoImage::setVoiLutFunction(const EF_VoiLutFunction function) +{ + if (function != VoiLutFunction) + { + VoiLutFunction = function; + return 1; + } + return 2; +} + + +int DiMonoImage::setVoiLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation, + const EL_BitsPerTableEntry descripMode) +{ + if (VoiLutData != NULL) + VoiLutData->removeReference(); + VoiLutData = new DiLookupTable(data, descriptor, explanation, descripMode); + if (VoiLutData != NULL) + { + VoiExplanation = OFSTRING_GUARD(VoiLutData->getExplanation()); + return VoiLutData->isValid(); + } + VoiExplanation = ""; + return 0; +} + + +int DiMonoImage::setVoiLut(const unsigned long pos, + const EL_BitsPerTableEntry descripMode) +{ + if (!(Document->getFlags() & CIF_UsePresentationState)) + { + if (VoiLutData != NULL) + VoiLutData->removeReference(); + VoiLutData = new DiLookupTable(Document, DCM_VOILUTSequence, DCM_LUTDescriptor, DCM_LUTData, + DCM_LUTExplanation, descripMode, pos, &VoiLutCount); + if (VoiLutData != NULL) + { + VoiExplanation = OFSTRING_GUARD(VoiLutData->getExplanation()); + return VoiLutData->isValid(); + } + VoiExplanation = ""; + } + return 0; +} + + +const char *DiMonoImage::getVoiWindowExplanation(const unsigned long pos, + OFString &explanation) const +{ + const char *result = NULL; + /* get the stored explanation string */ + if (Document->getValue(DCM_WindowCenterWidthExplanation, explanation, pos) > 0) + result = explanation.c_str(); + return result; +} + + +const char *DiMonoImage::getVoiLutExplanation(const unsigned long pos, + OFString &explanation) const +{ + const char *result = NULL; + /* get the given sequence item ... */ + DcmSequenceOfItems *seq = NULL; + if ((pos < Document->getSequence(DCM_VOILUTSequence, seq)) && (seq != NULL)) + { + /* ... and then the stored explanation string */ + if (Document->getValue(DCM_LUTExplanation, explanation, 0 /*vm pos*/, seq->getItem(pos)) > 0) + result = explanation.c_str(); + } + return result; +} + + +int DiMonoImage::setHardcopyParameters(const unsigned int min, + const unsigned int max, + const unsigned int reflect, + const unsigned int illumin) +{ + int result = 0; + if (min < max) + { + result = 2; + if (min != MinDensity) + { + MinDensity = min; + result = 1; + } + if (max != MaxDensity) + { + MaxDensity = max; + result = 1; + } + if (reflect != Reflection) + { + Reflection = reflect; + result = 1; + } + if (illumin != Illumination) + { + Illumination = illumin; + result = 1; + } + if ((result == 1) && (PresLutShape == ESP_LinOD) && (PresLutData != NULL)) + { + PresLutData->removeReference(); // look-up table no longer valid + PresLutData = NULL; + } + } + return result; +} + + +ES_PresentationLut DiMonoImage::getPresentationLutShape() const +{ + return (PresLutData != NULL) ? ESP_Default : PresLutShape; +} + + +int DiMonoImage::setPresentationLutShape(const ES_PresentationLut shape) +{ + if (PresLutData != NULL) + PresLutData->removeReference(); + PresLutData = NULL; + if (shape != PresLutShape) + { + PresLutShape = shape; + return 1; + } + return 2; +} + + +int DiMonoImage::setPresentationLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation, + const EL_BitsPerTableEntry descripMode) +{ + if (PresLutData != NULL) + PresLutData->removeReference(); + PresLutData = new DiLookupTable(data, descriptor, explanation, descripMode, 0); + if (PresLutData != NULL) + { + PresLutShape = ESP_Default; + return PresLutData->isValid(); + } + return 0; +} + + +int DiMonoImage::setInversePresentationLut(const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const EL_BitsPerTableEntry descripMode) +{ + int status = 0; + if (PresLutData != NULL) + PresLutData->removeReference(); + PresLutData = NULL; + DiLookupTable *lut = new DiLookupTable(data, descriptor, NULL, descripMode, 0); + if ((lut != NULL) && (lut->isValid())) + { + PresLutData = lut->createInverseLUT(); + if (PresLutData != NULL) + status = PresLutData->isValid(); + } + delete lut; + return status; +} + + +int DiMonoImage::addOverlay(const unsigned int group, + const signed int left_pos, + const signed int top_pos, + const unsigned int columns, + const unsigned int rows, + const DcmOverlayData &data, + const DcmLongString &label, + const DcmLongString &description, + const EM_Overlay mode) +{ + if (Overlays[1] == NULL) + Overlays[1] = new DiOverlay(); + if (Overlays[1] != NULL) + return Overlays[1]->addPlane(group, left_pos, top_pos, columns, rows, data, label, description, mode); + return 0; +} + + +int DiMonoImage::removeAllOverlays() +{ + if (Overlays[1] != NULL) + { + delete Overlays[1]; + Overlays[1] = NULL; + return 1; + } + return 2; +} + + +int DiMonoImage::flip(const int horz, + const int vert) +{ + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + case EPR_Sint8: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + case EPR_Uint16: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + case EPR_Sint16: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + case EPR_Uint32: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + case EPR_Sint32: + { + DiFlipTemplate dummy(InterData, Columns, Rows, NumberOfFrames, horz, vert); + } + break; + } + for (int i = 0; i < 2; ++i) + { + if ((Overlays[i] != NULL) && (Overlays[i]->getCount() > 0)) + { + DiOverlay *old = Overlays[i]; + Overlays[i] = new DiOverlay(old, horz, vert, Columns, Rows); + old->removeReference(); + } + } + return 1; +} + + +int DiMonoImage::rotate(const int degree) +{ + const Uint16 old_cols = Columns; // save old values + const Uint16 old_rows = Rows; + DiImage::rotate(degree); // swap width and height if necessary + if ((Columns > 1) && (Rows > 1)) // re-interpret pixel data for cols = 1 or rows = 1 + { + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, NumberOfFrames, degree); + } + break; + case EPR_Sint8: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, NumberOfFrames, degree); + } + break; + case EPR_Uint16: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, NumberOfFrames, degree); + } + break; + case EPR_Sint16: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, NumberOfFrames, degree); + } + break; + case EPR_Uint32: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, NumberOfFrames, degree); + } + break; + case EPR_Sint32: + { + DiRotateTemplate dummy(InterData, old_cols, old_rows, Columns, Rows, NumberOfFrames, degree); + } + break; + } + } + for (int i = 0; i < 2; ++i) + { + if ((Overlays[i] != NULL) && (Overlays[i]->getCount() > 0)) + { + DiOverlay *old = Overlays[i]; + Overlays[i] = new DiOverlay(old, degree, Columns, Rows); + old->removeReference(); + } + } + return 1; +} + + +/*********************************************************************/ + + +/* + * create output data of 'frame' with depth of 'bits' and min/max values depending on 'negative' (support mono1/2) + */ + +const void *DiMonoImage::getData(void *buffer, + const unsigned long size, + const unsigned long frame, + int bits, + const int /*planar*/, /* not yet supported, needed for pastel color images !! */ + const int negative) +{ + if ((InterData != NULL) && (ImageStatus == EIS_Normal) && (frame < NumberOfFrames) && + (((bits > 0) && (bits <= MAX_BITS)) || (bits == MI_PastelColor))) + { + if ((buffer == NULL) || (size >= getOutputDataSize(bits))) + { + deleteOutputData(); // delete old image data + if (!ValidWindow) + WindowWidth = -1; // negative width means no window, saves additional parameter ;) + Uint32 low; + Uint32 high; + if ((PresLutData == NULL) && + ((PresLutShape == ESP_Inverse) || (negative && (PresLutShape == ESP_Default)))) + { + low = DicomImageClass::maxval(bits); // inverse/negative: white to black + high = 0; + } else { + low = 0; // normal/positive: black to white + high = DicomImageClass::maxval(bits); + } + if ((PresLutData == NULL) && (PresLutShape == ESP_LinOD)) + { + if (!createLinODPresentationLut(4096, 16)) // create presentation LUT converting linOD data (on demand) + { + DCMIMGLE_WARN("could not create presentation LUT for LinOD conversion ... ignoring presentation LUT shape LinOD"); + } + } + if (Polarity == EPP_Reverse) // swap high and low value + { + Uint32 temp = low; + low = high; + high = temp; + } + DiDisplayFunction *disp = DisplayFunction; + if ((disp != NULL) && (disp->isValid()) && (disp->getMaxDDLValue() != DicomImageClass::maxval(bits))) + { + DCMIMGLE_WARN("selected display function doesn't fit to requested output depth (" << bits + << ") ... ignoring display transformation"); + disp = NULL; + } + const int samples = (bits == MI_PastelColor) ? 3 : 1; + switch (InterData->getRepresentation()) + { + case EPR_Uint8: + getDataUint8(buffer, disp, samples, frame, bits, low, high); + break; + case EPR_Sint8: + getDataSint8(buffer, disp, samples, frame, bits, low, high); + break; + case EPR_Uint16: + getDataUint16(buffer, disp, samples, frame, bits, low, high); + break; + case EPR_Sint16: + getDataSint16(buffer, disp, samples, frame, bits, low, high); + break; + case EPR_Uint32: + getDataUint32(buffer, disp, samples, frame, bits, low, high); + break; + case EPR_Sint32: + getDataSint32(buffer, disp, samples, frame, bits, low, high); + break; + } + if (OutputData == NULL) + { + ImageStatus = EIS_MemoryFailure; + DCMIMGLE_ERROR("can't allocate memory for output-representation"); + } + else + return OutputData->getData(); // points to beginning of output data + } else { + DCMIMGLE_ERROR("given output buffer is too small (only " << size << " bytes)"); + } + } + return NULL; +} + + +/* + * create 1/8/16-bit (bi-level) bitmap with overlay 'plane' data + */ + +const void *DiMonoImage::getOverlayData(const unsigned long frame, + const unsigned int plane, + unsigned int &left_pos, + unsigned int &top_pos, + unsigned int &width, + unsigned int &height, + EM_Overlay &mode, + const unsigned int idx, + const int bits, + const Uint16 fore, + const Uint16 back) +{ + if ((ImageStatus == EIS_Normal) && (bits > 0) && (bits <= 16) && (fore != back)) + { + int start = 1; // default: additional overlay planes hide dataset planes + int end = 0; + if (idx < 2) // specified index of overlay group + start = end = idx; + for (int i = start; i >= end; --i) // start searching with additional overlay planes + { + if ((Overlays[i] != NULL) && (Overlays[i]->hasPlane(plane))) + { + deleteOverlayData(); + OverlayData = Overlays[i]->getPlaneData(frame, plane, left_pos, top_pos, width, height, + mode, Columns, Rows, bits, fore, back); + return OFstatic_cast(const void *, OverlayData); + } + } + } + return NULL; +} + + +/* + * create 1/8/16-bit (bi-level) bitmap with overlay 'plane' data + */ + +const void *DiMonoImage::getFullOverlayData(const unsigned long frame, + const unsigned int plane, + unsigned int &width, + unsigned int &height, + const unsigned int idx, + const int bits, + const Uint16 fore, + const Uint16 back) +{ + if ((ImageStatus == EIS_Normal) && (bits > 0) && (bits <= 16) && (fore != back)) + { + if ((idx < 2) && (Overlays[idx] != NULL) && (Overlays[idx]->hasPlane(plane))) + { + deleteOverlayData(); + OverlayData = Overlays[idx]->getFullPlaneData(frame, plane, width, height, bits, fore, back); + return OFstatic_cast(const void *, OverlayData); + } + } + return NULL; +} + + +/* + * create 1-bit (bi-level) bitmap with overlay 'plane' data + * as required for the (6xxx,3000) OverlayData format + */ + +unsigned long DiMonoImage::create6xxx3000OverlayData(Uint8 *&buffer, + const unsigned int plane, + unsigned int &width, + unsigned int &height, + unsigned long &frames, + const unsigned int idx) +{ + if (ImageStatus == EIS_Normal) + { + if ((idx < 2) && (Overlays[idx] != NULL) && (Overlays[idx]->hasPlane(plane))) + return Overlays[idx]->create6xxx3000PlaneData(buffer, plane, width, height, frames); + } + return 0; +} + + +/* + * create 8-bit palette/monochrome or 24/32-bit true color device independent bitmap (DIB) as needed by MS-Windows + */ + +unsigned long DiMonoImage::createDIB(void *&data, + const unsigned long size, + const unsigned long frame, + const int bits, + const int upsideDown, + const int padding) +{ + unsigned long bytes = 0; + if (size == 0) + data = NULL; + if ((bits == 8) || (bits == 24) || (bits == 32)) + { + getOutputData(frame, 8); // create output data with 8 bit depth + if ((OutputData != NULL) && (OutputData->getData() != NULL)) + { + const signed long nextRow = (upsideDown) ? -2 * OFstatic_cast(signed long, Columns) : 0; + const Uint8 *p = OFstatic_cast(const Uint8 *, OutputData->getData()) + ((upsideDown) ? + OFstatic_cast(unsigned long, Rows - 1) * OFstatic_cast(unsigned long, Columns) : 0); + if (bits == 8) // -- for idx color model (byte) + { + // each line has to start at 32-bit-address, if 'padding' is true + const int gap = (padding) ? (4 - (Columns & 0x3)) & 0x3 : 0; + const unsigned long count = OFstatic_cast(unsigned long, Columns + gap) * OFstatic_cast(unsigned long, Rows); + if ((gap > 0) || (nextRow != 0) || (data != NULL)) + { + if ((data == NULL) || (size >= count)) + { + if (data == NULL) + data = new Uint8[count]; // allocated memory buffer + if (data != NULL) + { + Uint8 *q = OFstatic_cast(Uint8 *, data); + Uint16 x; + Uint16 y; + for (y = Rows; y != 0; --y) + { + for (x = Columns; x != 0; --x) + *(q++) = *(p++); // store gray value + p += nextRow; // jump (backwards) to next row + q += gap; // skip gap at the end of each line (32-bit boundary) + } + bytes = count; + } + } + } else { // data already aligned and correctly oriented + data = OutputData->getDataPtr(); + OutputData->removeDataReference(); // remove reference to internal memory + bytes = count; + } + } + else if (bits == 24) // -- for direct color model (24 bits/pixel) + { + const unsigned long col3 = OFstatic_cast(unsigned long, Columns) * 3; + // each line has to start at 32-bit-address, if 'padding' is true + const int gap = (padding) ? OFstatic_cast(int, (4 - (col3 & 0x3)) & 0x3) : 0; + const unsigned long count = (col3 + gap) * OFstatic_cast(unsigned long, Rows); + if ((data == NULL) || (size >= count)) + { + if (data == NULL) + data = new Uint8[count]; // allocated memory buffer + if (data != NULL) + { + Uint8 *q = OFstatic_cast(Uint8 *, data); + Uint8 value; + Uint16 x; + Uint16 y; + int j; + for (y = Rows; y != 0; --y) + { + for (x = Columns; x != 0; --x) + { + value = *(p++); // store gray value + for (j = 3; j != 0; --j) + *(q++) = value; // copy to the three RGB-planes + } + p += nextRow; // jump (backwards) to next row + q += gap; // skip gap at the end of each line (32-bit boundary) + } + bytes = count; + } + } + } + else if (bits == 32) // -- for direct color model (32 bits/pixel) + { + const unsigned long count = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + if ((data == NULL) || (size >= count * 4)) + { + if (data == NULL) + data = new Uint32[count]; // allocated memory buffer + if (data != NULL) + { + Uint32 *q = OFstatic_cast(Uint32 *, data); + Uint32 value; + Uint16 x; + Uint16 y; + for (y = Rows; y != 0; --y) + { + for (x = Columns; x != 0; --x) + { + value = *(p++); // store gray value + *(q++) = (value << 16) | + (value << 8) | + value; // copy to the three RGB-planes + } + p += nextRow; // jump (backwards) to next row + } + bytes = count * 4; + } + } + } + } + deleteOutputData(); // output data is no longer needed + } + return bytes; +} + + +/* + * create 8-bit palette/monochrome or 32-bit true color bitmap as needed for Java/AWT + */ + +unsigned long DiMonoImage::createAWTBitmap(void *&data, + const unsigned long frame, + const int bits) +{ + data = NULL; + unsigned long bytes = 0; + if (bits == 8) // for idx color model (byte) + { + getOutputData(frame, 8); // create output data with 8 bit depth + if ((OutputData != NULL) && (OutputData->getData() != NULL)) + { + bytes = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + data = OutputData->getDataPtr(); + OutputData = NULL; // remove reference to internal memory + } + } + else if (bits == 32) // for direct color model (long int) + { + getOutputData(frame, 8); // create output data with 8 bit depth + if ((OutputData != NULL) && (OutputData->getData() != NULL)) + { + const unsigned long count = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows); + data = new Uint32[count]; + if (data != NULL) + { + const Uint8 *p = OFstatic_cast(const Uint8 *, OutputData->getData()); + Uint32 *q = OFstatic_cast(Uint32 *, data); + Uint32 value; + unsigned long i; + for (i = count; i != 0; --i) + { + value = *(p++); // store gray value + *(q++) = (value << 24) | + (value << 16) | + (value << 8); // copy to the three RGB-planes + } + bytes = count * 4; + } + } + deleteOutputData(); // output data is no longer needed + } + return bytes; +} + + +/* + * create packed bitmap (e.g. 12 bit for DICOM printers), currently restricted to 12/16 bit + */ + +void *DiMonoImage::createPackedBitmap(const void *buffer, + const unsigned long size, + const unsigned long count, + const int alloc, // number of bits allocated in buffer + const int stored) // number of bits stored in buffer +{ + if ((buffer != NULL) && (size > 0) && (alloc > 0) && (stored > 0) && (stored < alloc)) + { + if ((alloc == 16) && (stored == 12)) + { + /* need to split 'size' in order to avoid integer overflow for large pixel data */ + const unsigned long size_1 = size / alloc; + const unsigned long size_2 = size % alloc; +// # old code: if ((size * 8 + alloc - 1) / alloc == count) + if (8 * size_1 + (8 * size_2 + alloc - 1) / alloc == count) + { + Uint16 *data = NULL; + data = new Uint16[((count + 1) * stored - 1) / 16]; // create new memory buffer + if (data != NULL) + { + const Uint16 *p = OFstatic_cast(const Uint16 *, buffer); + Uint16 *q = data; + unsigned long i; + Uint16 value1; + Uint16 value2; + for (i = 0; i < count - 3; i += 4) // make 3 items out of 4 + { + value1 = *(p++); + value2 = *(p++); + *(q++) = OFstatic_cast(Uint16, (value1 & 0x0fff) | (value2 << 12)); + value1 = *(p++); + *(q++) = OFstatic_cast(Uint16, ((value2 >> 4) & 0x00ff) | (value1 << 8)); + value2 = *(p++); + *(q++) = OFstatic_cast(Uint16, ((value1 >> 8) & 0x000f) | (value2 << 4)); + } + switch (count - i) // add remaining pixels + { + case 1: // add 1 pixel + *(q++) = OFstatic_cast(Uint16, *(p++) & 0x0fff); + break; + case 2: // add 2 pixels + value1 = *(p++); + value2 = *(p++); + *(q++) = OFstatic_cast(Uint16, (value1 & 0x0fff) | (value2 << 12)); + *(q++) = OFstatic_cast(Uint16, (value2 >> 4) & 0x00ff); + break; + case 3: // add 3 pixels + value1 = *(p++); + value2 = *(p++); + *(q++) = OFstatic_cast(Uint16, (value1 & 0x0fff) | (value2 << 12)); + value1 = *(p++); + *(q++) = OFstatic_cast(Uint16, ((value2 >> 4) & 0x00ff) | (value1 << 8)); + *(q++) = OFstatic_cast(Uint16, (value1 >> 8) & 0x000f); + break; + default: // add no pixel + ; + } + return OFstatic_cast(void *, data); + } + } + } + } + return NULL; +} + + +DiImage *DiMonoImage::createOutputImage(const unsigned long frame, + const int bits) +{ + getOutputData(frame, bits); + if ((OutputData != NULL) && (OutputData->getData() != NULL)) + { + + DiImage *image = new DiMono2Image(this, OutputData, frame, bits, OFstatic_cast(int, OutputData->getItemSize() * 8)); + if (image != NULL) + OutputData->removeDataReference(); // output data is now handled by new mono image + return image; + } + return NULL; +} + + +int DiMonoImage::createLinODPresentationLut(const unsigned long count, const int bits) +{ + if ((PresLutData == NULL) && (MinDensity < MaxDensity) && + (count > 1) && (count <= MAX_TABLE_ENTRY_COUNT) && + (bits > 0) && (bits <= MAX_TABLE_ENTRY_SIZE)) + { + Uint16 *data = new Uint16[count]; + if (data != NULL) + { + const double l0 = OFstatic_cast(double, Illumination); + const double la = OFstatic_cast(double, Reflection); + const double dmin = OFstatic_cast(double, MinDensity) / 100; + const double dmax = OFstatic_cast(double, MaxDensity) / 100; + const double lmin = la + l0 * pow(OFstatic_cast(double, 10), -dmax); + const double lmax = la + l0 * pow(OFstatic_cast(double, 10), -dmin); + const double jmin = DiGSDFunction::getJNDIndex(lmin); + const double jmax = DiGSDFunction::getJNDIndex(lmax); + const double factor = OFstatic_cast(double, DicomImageClass::maxval(bits)) / (jmax - jmin); + const double density = (dmax - dmin) / OFstatic_cast(double, count - 1); + Uint16 *p = data; + for (unsigned long i = 0; i < count; ++i) + { + *(p++) = OFstatic_cast(Uint16, (DiGSDFunction::getJNDIndex(la + l0 * + pow(OFstatic_cast(double, 10), -(dmin + OFstatic_cast(double, i) * density))) - jmin) * factor); + } + PresLutData = new DiLookupTable(data, count, bits); + return (PresLutData != NULL) && (PresLutData->isValid()); + } + } + return 0; +} + + +/*********************************************************************/ + +void DiMonoImage::updateImagePixelModuleAttributes(DcmItem &dataset) +{ + DiImage::updateImagePixelModuleAttributes(dataset); + /* replace any modality transformation in the dataset */ + if (dataset.tagExists(DCM_RescaleIntercept) || + dataset.tagExists(DCM_RescaleSlope) || + dataset.tagExists(DCM_ModalityLUTSequence)) + { + dataset.putAndInsertString(DCM_RescaleIntercept, "0"); + dataset.putAndInsertString(DCM_RescaleSlope, "1"); + delete dataset.remove(DCM_ModalityLUTSequence); + } + /* remove embedded overlay planes */ + for (Uint16 grp = 0x6000; grp < 0x601f; grp += 2) + { + if (!dataset.tagExists(DcmTagKey(grp, DCM_OverlayData.getElement()))) + { + delete dataset.remove(DcmTagKey(grp, 0x0000)); // group length + delete dataset.remove(DcmTagKey(grp, DCM_OverlayRows.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlayColumns.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_RETIRED_OverlayPlanes.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_NumberOfFramesInOverlay.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlayDescription.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlayType.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlaySubtype.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlayOrigin.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_ImageFrameOrigin.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_RETIRED_OverlayPlaneOrigin.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlayBitsAllocated.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlayBitPosition.getElement())); + delete dataset.remove(DcmTagKey(grp, DCM_OverlayLabel.getElement())); + } + } +} + + +// --- write current image to DICOM dataset + +int DiMonoImage::writeImageToDataset(DcmItem &dataset, + const int mode, + const int /*planar*/) +{ + int result = 0; + if (InterData != NULL) + { + const void *pixel = InterData->getData(); + const unsigned long count = InterData->getCount(); + const EP_Representation repres = InterData->getRepresentation(); + if ((BitsPerSample > 0) && (pixel != NULL) && (count > 0)) + { + char numBuf[20]; + unsigned int bits = BitsPerSample; + /* only 'used' pixel data */ + if (!mode) + { + double minValue, maxValue; + InterData->getMinMaxValues(minValue, maxValue); + if (minValue < maxValue) + bits = DicomImageClass::rangeToBits(minValue, maxValue); + else + bits = 1; + } + /* check determined bits stored value */ + const unsigned int repBits = DicomImageClass::getRepresentationBits(repres); + if (bits > repBits) + bits = repBits; + /* set color model */ + if (getInternalColorModel() == EPI_Monochrome1) + dataset.putAndInsertString(DCM_PhotometricInterpretation, "MONOCHROME1"); + else + dataset.putAndInsertString(DCM_PhotometricInterpretation, "MONOCHROME2"); + /* set image resolution */ + dataset.putAndInsertUint16(DCM_Columns, Columns); + dataset.putAndInsertUint16(DCM_Rows, Rows); +#ifdef PRIu32 + sprintf(numBuf, "%" PRIu32, NumberOfFrames); +#elif SIZEOF_LONG == 8 + sprintf(numBuf, "%u", NumberOfFrames); +#else + sprintf(numBuf, "%lu", NumberOfFrames); +#endif + dataset.putAndInsertString(DCM_NumberOfFrames, numBuf); + dataset.putAndInsertUint16(DCM_SamplesPerPixel, 1); + /* set pixel encoding and data */ + switch (repres) + { + case EPR_Uint8: + dataset.putAndInsertUint16(DCM_BitsAllocated, 8); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 0); + dataset.putAndInsertUint8Array(DCM_PixelData, OFstatic_cast(const Uint8 *, pixel), count); + break; + case EPR_Sint8: + dataset.putAndInsertUint16(DCM_BitsAllocated, 8); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 1); + dataset.putAndInsertUint8Array(DCM_PixelData, OFstatic_cast(const Uint8 *, pixel), count); + break; + case EPR_Uint16: + dataset.putAndInsertUint16(DCM_BitsAllocated, 16); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 0); + dataset.putAndInsertUint16Array(DCM_PixelData, OFstatic_cast(const Uint16 *, pixel), count); + break; + case EPR_Sint16: + dataset.putAndInsertUint16(DCM_BitsAllocated, 16); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 1); + dataset.putAndInsertUint16Array(DCM_PixelData, OFstatic_cast(const Uint16 *, pixel), count); + break; + case EPR_Uint32: + dataset.putAndInsertUint16(DCM_BitsAllocated, 32); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 0); + dataset.putAndInsertUint16Array(DCM_PixelData, OFstatic_cast(const Uint16 *, pixel), count * 2 /*double-words*/); + break; + case EPR_Sint32: + dataset.putAndInsertUint16(DCM_BitsAllocated, 32); + dataset.putAndInsertUint16(DCM_PixelRepresentation, 1); + dataset.putAndInsertUint16Array(DCM_PixelData, OFstatic_cast(const Uint16 *, pixel), count * 2 /*double-words*/); + break; + } + dataset.putAndInsertUint16(DCM_BitsStored, bits); + dataset.putAndInsertUint16(DCM_HighBit, bits - 1); + /* update other DICOM attributes */ + updateImagePixelModuleAttributes(dataset); + result = 1; + } + } + return result; +} + + +/* + * write output data of 'frame' with depth of 'bits' to C++-output 'stream' (format is PGM - portable gray map) + */ + +int DiMonoImage::writePPM(STD_NAMESPACE ostream& stream, + const unsigned long frame, + const int bits) +{ + getOutputData(frame, bits); + if (OutputData != NULL) + { + if (bits == MI_PastelColor) + { + stream << "P3" << OFendl; + stream << Columns << " " << Rows << OFendl; + stream << "255" << OFendl; + } else { + stream << "P2" << OFendl; + stream << Columns << " " << Rows << OFendl; + stream << DicomImageClass::maxval(bits) << OFendl; + } + int ok = OutputData->writePPM(stream); + deleteOutputData(); + return ok; + } + return 0; +} + + +/* + * write output data of 'frame' with depth of 'bits' to C-file 'stream' (format is PGM - portable gray map) + */ + +int DiMonoImage::writePPM(FILE *stream, + const unsigned long frame, + const int bits) +{ + if (stream != NULL) + { + getOutputData(frame, bits); + if (OutputData != NULL) + { + if (bits == MI_PastelColor) + fprintf(stream, "P3\n%u %u\n255\n", Columns, Rows); + else + fprintf(stream, "P2\n%u %u\n%lu\n", Columns, Rows, DicomImageClass::maxval(bits)); + int ok = OutputData->writePPM(stream); + deleteOutputData(); + return ok; + } + } + return 0; +} + + +/* + * write output data of 'frame' with depth of 'bits' (max. 8) to C-file 'stream' (format is RAW-PGM - binary PGM) + */ + +int DiMonoImage::writeRawPPM(FILE *stream, + const unsigned long frame, + const int bits) +{ + if ((stream != NULL) && (bits <= MAX_RAWPPM_BITS)) + { + getOutputData(frame, bits); + if ((OutputData != NULL) && (OutputData->getData() != NULL)) + { + if (bits == MI_PastelColor) + fprintf(stream, "P6\n%u %u\n255\n", Columns, Rows); + else + fprintf(stream, "P5\n%u %u\n%lu\n", Columns, Rows, DicomImageClass::maxval(bits)); + const size_t count = OFstatic_cast(size_t, OutputData->getCount()); + int ok = (fwrite(OutputData->getData(), OutputData->getItemSize(), count, stream) == count) ? 1 : 0; + deleteOutputData(); + return ok; + } + } + return 0; +} + + +/* + * write output data of 'frame' with depth of 'bits' (8, 24 or 32) to C-file 'stream' (format is BMP) + */ + +int DiMonoImage::writeBMP(FILE *stream, + const unsigned long frame, + const int bits) +{ + if ((bits == 0) || (bits == 8) || (bits == 24) || (bits == 32)) + return DiImage::writeBMP(stream, frame, (bits == 0) ? 8 : bits); + return 0; +} diff --git a/dcmimgle/libsrc/dimoimg3.cc b/dcmimgle/libsrc/dimoimg3.cc new file mode 100644 index 00000000..1a8da650 --- /dev/null +++ b/dcmimgle/libsrc/dimoimg3.cc @@ -0,0 +1,84 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeImage (Source, getData 8 bit) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimoimg.h" +#include "dcmtk/dcmimgle/dimoipxt.h" +#include "dcmtk/dcmimgle/dimoopxt.h" +#include "dcmtk/dcmimgle/diutils.h" + + +void DiMonoImage::getDataUint8(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high) +{ + if (InterData != NULL) + { + if (InterData->isPotentiallySigned()) + { + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + } else { + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + } + } +} + + +void DiMonoImage::getDataSint8(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high) +{ + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); +} diff --git a/dcmimgle/libsrc/dimoimg4.cc b/dcmimgle/libsrc/dimoimg4.cc new file mode 100644 index 00000000..ed3b8063 --- /dev/null +++ b/dcmimgle/libsrc/dimoimg4.cc @@ -0,0 +1,84 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeImage (Source, getData 16 bit) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimoimg.h" +#include "dcmtk/dcmimgle/dimoipxt.h" +#include "dcmtk/dcmimgle/dimoopxt.h" +#include "dcmtk/dcmimgle/diutils.h" + + +void DiMonoImage::getDataUint16(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high) +{ + if (InterData != NULL) + { + if (InterData->isPotentiallySigned()) + { + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + } else { + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + } + } +} + + +void DiMonoImage::getDataSint16(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high) +{ + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); +} diff --git a/dcmimgle/libsrc/dimoimg5.cc b/dcmimgle/libsrc/dimoimg5.cc new file mode 100644 index 00000000..7e416ae9 --- /dev/null +++ b/dcmimgle/libsrc/dimoimg5.cc @@ -0,0 +1,84 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeImage (Source, getData 32 bit) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimoimg.h" +#include "dcmtk/dcmimgle/dimoipxt.h" +#include "dcmtk/dcmimgle/dimoopxt.h" +#include "dcmtk/dcmimgle/diutils.h" + + +void DiMonoImage::getDataUint32(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high) +{ + if (InterData != NULL) + { + if (InterData->isPotentiallySigned()) + { + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + } else { + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + } + } +} + + +void DiMonoImage::getDataSint32(void *buffer, + DiDisplayFunction *disp, + const int samples, + const unsigned long frame, + const int bits, + const Uint32 low, + const Uint32 high) +{ + if (bits <= 8) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames, samples > 1); + else if (bits <= 16) + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); + else + OutputData = new DiMonoOutputPixelTemplate(buffer, InterData, Overlays, VoiLutData, PresLutData, + disp, VoiLutFunction, WindowCenter, WindowWidth, low, high, Columns, Rows, frame, NumberOfFrames); +} diff --git a/dcmimgle/libsrc/dimomod.cc b/dcmimgle/libsrc/dimomod.cc new file mode 100644 index 00000000..e3a95ddc --- /dev/null +++ b/dcmimgle/libsrc/dimomod.cc @@ -0,0 +1,321 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromeModality (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" + +#include "dcmtk/dcmimgle/dimomod.h" +#include "dcmtk/dcmimgle/didocu.h" +#include "dcmtk/dcmimgle/diinpx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiMonoModality::DiMonoModality(const DiDocument *docu, + DiInputPixel *pixel) + : Representation(EPR_MaxSigned), + MinValue(0), + MaxValue(0), + Bits(0), + UsedBits(0), + AbsMinimum(0), + AbsMaximum(0), + RescaleIntercept(0), + RescaleSlope(0), + LookupTable(0), + Rescaling(0), + TableData(NULL) +{ + if (Init(docu, pixel)) + { + if (docu->getFlags() & CIF_IgnoreModalityTransformation) // ignore modality LUT and rescaling + { + DCMIMGLE_INFO("configuration flag set ... ignoring possible modality transform"); + } + else if (!(docu->getFlags() & CIF_UsePresentationState)) // ignore modality LUT and rescaling + { + const char *sopClassUID = NULL; // check for XA and XRF image (ignore MLUT) + if (!docu->getValue(DCM_SOPClassUID, sopClassUID) || (sopClassUID == NULL)) + sopClassUID = ""; + if ((strcmp(sopClassUID, UID_XRayAngiographicImageStorage) == 0) || + (strcmp(sopClassUID, UID_XRayRadiofluoroscopicImageStorage) == 0) || + (strcmp(sopClassUID, UID_RETIRED_XRayAngiographicBiPlaneImageStorage) == 0)) + { + /* David Clunie in comp.protocols.dicom (2000-12-13): + "Modality LUTs in XA and XRF objects are totally screwy and + do not follow the normal rules. [...] A Modality LUT may be + included with the image to allow it to be scaled back to its + proportional value to X-Ray beam intensity. In other words, + for the objects that use this module (XA and XRF), the + Modality LUT is used BACKWARDS. It is used to convert stored + pixels to X-Ray beam intensity space, but it is NOT APPLIED + to stored pixels for the purpose of display (or more + specifically prior to application of the VOI LUT Module + attributes to the stored pixel data)." + */ + DCMIMGLE_INFO("processing XA or XRF image ... ignoring possible modality transform"); + } else { + EL_BitsPerTableEntry descMode = ELM_UseValue; // first search on main level + if (docu->getFlags() & CIF_IgnoreModalityLutBitDepth) + descMode = ELM_IgnoreValue; + else if (docu->getFlags() & CIF_CheckLutBitDepth) + descMode = ELM_CheckValue; + TableData = new DiLookupTable(docu, DCM_ModalityLUTSequence, DCM_LUTDescriptor, DCM_LUTData, + DCM_LUTExplanation, descMode); + checkTable(); + if (LookupTable) + DCMIMGLE_DEBUG("found modality LUT on main dataset level"); + Rescaling = (docu->getValue(DCM_RescaleIntercept, RescaleIntercept) > 0); + Rescaling &= (docu->getValue(DCM_RescaleSlope, RescaleSlope) > 0); + if (Rescaling) + DCMIMGLE_DEBUG("found 'RescaleSlope/Intercept' on main dataset level"); + else if (!LookupTable) // then check for functional groups sequence + { + DcmSequenceOfItems *seq = NULL; + if (docu->getSequence(DCM_SharedFunctionalGroupsSequence, seq)) + { + DcmItem *item = seq->getItem(0); + if ((item != NULL) && docu->getSequence(DCM_PixelValueTransformationSequence, seq, item)) + { + item = seq->getItem(0); + if (item != NULL) + { + Rescaling = (docu->getValue(DCM_RescaleIntercept, RescaleIntercept, 0, item) > 0); + Rescaling &= (docu->getValue(DCM_RescaleSlope, RescaleSlope, 0, item) > 0); + if (Rescaling) + DCMIMGLE_DEBUG("found 'RescaleSlope/Intercept' in 'SharedFunctionalGroupsSequence'"); + } + } + } + } + checkRescaling(pixel); + if (Rescaling || LookupTable) // check for possibly inappropriate use of MLUT + { + /* David Clunie in comp.protocols.dicom (2012-10-28): + "By the way, in general, it can be difficult to decide + whether or not to apply the conceptual Modality LUT + step before windowing, even if it is specified by + Rescale Slope/Intercept values rather than an actual + LUT. For example, in MR images to which Philips has + added the rescale values, these should not be applied + before their window values; likewise in PET images, + especially those with GML Units and rescale values to + SUV (small decimal numbers), the window values are + historically usually in stored pixel values rather than + SUVs. + Making the correct decision may require comparing the + range of possible rescaled output values (across the + domain of possible input stored pixel values) with the + specific window values, to see if the latter "make + sense". + */ + if (strcmp(sopClassUID, UID_MRImageStorage) == 0) + DCMIMGLE_WARN("processing MR image ... applying modality transform may create unexpected result"); + else if (strcmp(sopClassUID, UID_PositronEmissionTomographyImageStorage) == 0) + DCMIMGLE_WARN("processing PET image ... applying modality transform may create unexpected result"); + else if (strcmp(sopClassUID, UID_RTDoseStorage) == 0) + DCMIMGLE_WARN("processing RTDOSE object ... applying modality transform may create unexpected result"); + } + } + } + determineRepresentation(docu); + } +} + + +DiMonoModality::DiMonoModality(const DiDocument *docu, + DiInputPixel *pixel, + const double slope, + const double intercept) + : Representation(EPR_MaxSigned), + MinValue(0), + MaxValue(0), + Bits(0), + UsedBits(0), + AbsMinimum(0), + AbsMaximum(0), + RescaleIntercept(intercept), + RescaleSlope(slope), + LookupTable(0), + Rescaling(0), + TableData(NULL) +{ + if (Init(docu, pixel)) + { + Rescaling = 1; + checkRescaling(pixel); + determineRepresentation(docu); + } +} + + +DiMonoModality::DiMonoModality(const DiDocument *docu, + DiInputPixel *pixel, + const DcmUnsignedShort &data, + const DcmUnsignedShort &descriptor, + const DcmLongString *explanation) + : Representation(EPR_MaxSigned), + MinValue(0), + MaxValue(0), + Bits(0), + UsedBits(0), + AbsMinimum(0), + AbsMaximum(0), + RescaleIntercept(0), + RescaleSlope(0), + LookupTable(0), + Rescaling(0), + TableData(NULL) +{ + if (Init(docu, pixel)) + { + EL_BitsPerTableEntry descMode = ELM_UseValue; + if (docu->getFlags() & CIF_IgnoreModalityLutBitDepth) + descMode = ELM_IgnoreValue; + else if (docu->getFlags() & CIF_CheckLutBitDepth) + descMode = ELM_CheckValue; + TableData = new DiLookupTable(data, descriptor, explanation, descMode); + checkTable(); + determineRepresentation(docu); + } +} + + +DiMonoModality::DiMonoModality(const int bits) + : Representation(EPR_MaxSigned), + MinValue(0), + MaxValue(0), + Bits(bits), + UsedBits(0), + AbsMinimum(0), + AbsMaximum(DicomImageClass::maxval(bits)), + RescaleIntercept(0), + RescaleSlope(0), + LookupTable(0), + Rescaling(0), + TableData(NULL) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiMonoModality::~DiMonoModality() +{ + delete TableData; +} + + +/*********************************************************************/ + + +int DiMonoModality::Init(const DiDocument *docu, + DiInputPixel *pixel) +{ + if ((docu != NULL) && (pixel != NULL)) + { + pixel->determineMinMax(); + MinValue = pixel->getMinValue(1 /* selected range of pixels only */); + MaxValue = pixel->getMaxValue(1 /* selected range of pixels only */); + Bits = pixel->getBits(); + AbsMinimum = pixel->getAbsMinimum(); + AbsMaximum = pixel->getAbsMaximum(); + Uint16 us; + if (docu->getValue(DCM_SamplesPerPixel, us) > 0) + { + if (us != 1) + DCMIMGLE_WARN("invalid value for 'SamplesPerPixel' (" << us << ") ... assuming 1"); + } else + DCMIMGLE_WARN("missing value for 'SamplesPerPixel' ... assuming 1"); + return 1; + } + return 0; +} + + +void DiMonoModality::checkTable() +{ + if (TableData != NULL) + { + LookupTable = TableData->isValid(); + if (LookupTable) + { + MinValue = TableData->getMinValue(); + MaxValue = TableData->getMaxValue(); + Bits = TableData->getBits(); + AbsMinimum = 0; + AbsMaximum = DicomImageClass::maxval(Bits); + } + } +} + + +void DiMonoModality::checkRescaling(const DiInputPixel *pixel) +{ + if (Rescaling) + { + if (LookupTable) + { + DCMIMGLE_WARN("redundant values for 'RescaleSlope/Intercept' ... using modality LUT transformation"); + Rescaling = 0; + } else { + if (RescaleSlope == 0) + { + DCMIMGLE_WARN("invalid value for 'RescaleSlope' (" << RescaleSlope << ") ... ignoring modality transformation"); + Rescaling = 0; + } else { + if (RescaleSlope < 0) // negative slope value + { + const double temp = MinValue; + MinValue = MaxValue * RescaleSlope + RescaleIntercept; + MaxValue = temp * RescaleSlope + RescaleIntercept; + AbsMinimum = pixel->getAbsMaximum() * RescaleSlope + RescaleIntercept; + AbsMaximum = pixel->getAbsMinimum() * RescaleSlope + RescaleIntercept; + } else { // positive slope value + MinValue = MinValue * RescaleSlope + RescaleIntercept; + MaxValue = MaxValue * RescaleSlope + RescaleIntercept; + AbsMinimum = pixel->getAbsMinimum() * RescaleSlope + RescaleIntercept; + AbsMaximum = pixel->getAbsMaximum() * RescaleSlope + RescaleIntercept; + } + Bits = DicomImageClass::rangeToBits(AbsMinimum, AbsMaximum); + } + } + } +} + + +void DiMonoModality::determineRepresentation(const DiDocument *docu) +{ + UsedBits = DicomImageClass::rangeToBits(MinValue, MaxValue); + if ((docu != NULL) && (docu->getFlags() & CIF_UseAbsolutePixelRange)) + Representation = DicomImageClass::determineRepresentation(AbsMinimum, AbsMaximum); + else + Representation = DicomImageClass::determineRepresentation(MinValue, MaxValue); + DCMIMGLE_TRACE("internal representation for monochrome images: " + << DicomImageClass::getRepresentationBits(Representation) << " bits (" + << (DicomImageClass::isRepresentationSigned(Representation) ? "signed" : "unsigned") << ")"); +} diff --git a/dcmimgle/libsrc/dimoopx.cc b/dcmimgle/libsrc/dimoopx.cc new file mode 100644 index 00000000..8fe27693 --- /dev/null +++ b/dcmimgle/libsrc/dimoopx.cc @@ -0,0 +1,76 @@ +/* + * + * Copyright (C) 1996-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonoOutputPixel (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimoopx.h" +#include "dcmtk/dcmimgle/dimopx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiMonoOutputPixel::DiMonoOutputPixel(const DiMonoPixel *pixel, + const unsigned long size, + const unsigned long frame, + const unsigned long max) + : Count(0), + FrameSize(size), + UsedValues(NULL), + MaxValue(max) +{ + if (pixel != NULL) + { + if (pixel->getCount() > frame * size) + Count = pixel->getCount() - frame * size; // number of pixels remaining for this 'frame' + } + if (Count > FrameSize) + Count = FrameSize; // cut off at frame 'size' +} + + +/*--------------* + * destructor * + *--------------*/ + +DiMonoOutputPixel::~DiMonoOutputPixel() +{ + delete[] UsedValues; +} + + +/**********************************/ + + +int DiMonoOutputPixel::isUnused(const unsigned long value) +{ + if (UsedValues == NULL) + determineUsedValues(); // create on demand + if (UsedValues != NULL) + { + if (value <= MaxValue) + return OFstatic_cast(int, UsedValues[value] == 0); + return 2; // out of range + } + return 0; +} diff --git a/dcmimgle/libsrc/dimopx.cc b/dcmimgle/libsrc/dimopx.cc new file mode 100644 index 00000000..2ac2eddb --- /dev/null +++ b/dcmimgle/libsrc/dimopx.cc @@ -0,0 +1,96 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomMonochromePixel (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/dimopx.h" +#include "dcmtk/dcmimgle/dimomod.h" +#include "dcmtk/dcmimgle/diinpx.h" +#include "dcmtk/dcmimgle/dimoopx.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiMonoPixel::DiMonoPixel(const unsigned long count) + : DiPixel(count), + Modality(NULL) +{ +} + + +DiMonoPixel::DiMonoPixel(const DiInputPixel *pixel, + DiMonoModality *modality) + : DiPixel((pixel != NULL) ? pixel->getComputedCount() : 0, + (pixel != NULL) ? pixel->getPixelCount() : 0), + Modality(modality) +{ +} + + +DiMonoPixel::DiMonoPixel(const DiPixel *pixel, + DiMonoModality *modality) + : DiPixel(pixel->getCount(), pixel->getInputCount()), + Modality(modality) +{ +} + + +DiMonoPixel::DiMonoPixel(const DiMonoPixel *pixel, + const unsigned long count) + : DiPixel(count, pixel->getInputCount()), + Modality(pixel->Modality) +{ + if (Modality != NULL) + Modality->addReference(); +} + + +DiMonoPixel::DiMonoPixel(DiMonoOutputPixel *pixel, + DiMonoModality *modality) + : DiPixel(pixel->getCount()), + Modality(modality) +{ +} + + +/*--------------* + * destructor * + *--------------*/ + +DiMonoPixel::~DiMonoPixel() +{ + if (Modality != NULL) + Modality->removeReference(); +} + + +/*********************************************************************/ + + +DiMonoModality *DiMonoPixel::addReferenceToModality() +{ + if (Modality != NULL) + Modality->addReference(); + return Modality; +} diff --git a/dcmimgle/libsrc/diovdat.cc b/dcmimgle/libsrc/diovdat.cc new file mode 100644 index 00000000..da760c08 --- /dev/null +++ b/dcmimgle/libsrc/diovdat.cc @@ -0,0 +1,66 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlayData (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimgle/diovlay.h" +#include "dcmtk/dcmimgle/diovpln.h" + +#include "dcmtk/ofstd/ofbmanip.h" + + +/*---------------* + * constructor * + *---------------*/ + +DiOverlayData::DiOverlayData(unsigned int entries, + unsigned int count) + : Count(count), + ArrayEntries(entries), + Planes(NULL), + DataBuffer(NULL) +{ + if ((entries > 0) && (entries <= DiOverlay::MaxOverlayCount)) + { + Planes = new DiOverlayPlane *[entries]; + if (Planes != NULL) + OFBitmanipTemplate::zeroMem(Planes, entries); + } +} + + +/*---------------* + * destructors * + *---------------*/ + +DiOverlayData::~DiOverlayData() +{ + if (Planes != NULL) + { + unsigned int i; + for (i = 0; i < ArrayEntries; ++i) + delete Planes[i]; + } + delete[] Planes; + delete[] DataBuffer; +} diff --git a/dcmimgle/libsrc/diovlay.cc b/dcmimgle/libsrc/diovlay.cc new file mode 100644 index 00000000..fce44fe0 --- /dev/null +++ b/dcmimgle/libsrc/diovlay.cc @@ -0,0 +1,599 @@ +/* + * + * Copyright (C) 1996-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlay (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimgle/diovlay.h" +#include "dcmtk/dcmimgle/diovdat.h" +#include "dcmtk/dcmimgle/diovpln.h" +#include "dcmtk/dcmimgle/discalet.h" +#include "dcmtk/dcmimgle/diflipt.h" +#include "dcmtk/dcmimgle/dirotat.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------------------* + * constant initializations * + *----------------------------*/ + +const unsigned int DiOverlay::MaxOverlayCount = 16; +const unsigned int DiOverlay::FirstOverlayGroup = 0x6000; + + +/*----------------* + * constructors * + *----------------*/ + +DiOverlay::DiOverlay(const DiDocument *docu, + const Uint16 alloc, + const Uint16 stored, + const Uint16 high) + : Left(0), + Top(0), + Width(0), + Height(0), + Frames(0), + AdditionalPlanes(docu == NULL), // planes are added later + Data(NULL) +{ + Data = new DiOverlayData(MaxOverlayCount); // can't determine number of overlays :-( + if ((docu != NULL) && (Data != NULL) && (Data->Planes != NULL)) + { + unsigned int i; + for (i = 0; i < MaxOverlayCount; ++i) + { + Data->Planes[Data->Count] = new DiOverlayPlane(docu, convertToGroupNumber(i), alloc, stored, high); + if (Data->Planes[Data->Count] != NULL) + { + if (checkPlane(Data->Count)) + ++(Data->Count); + else { + delete Data->Planes[Data->Count]; + Data->Planes[Data->Count] = NULL; + } + } + } + } +} + + +// --- scale/clip overlay + +DiOverlay::DiOverlay(const DiOverlay *overlay, + const signed long left_pos, + const signed long top_pos, + const double xfactor, + const double yfactor) + : Left(left_pos), + Top(top_pos), + Width(OFstatic_cast(Uint16, xfactor * overlay->Width)), + Height(OFstatic_cast(Uint16, yfactor * overlay->Height)), + Frames(overlay->Frames), + AdditionalPlanes(overlay->AdditionalPlanes), + Data(NULL) +{ + Uint16 *temp = Init(overlay); + if (temp != NULL) + { + unsigned int i; + for (i = 0; i < Data->ArrayEntries; ++i) + { + if (Data->Planes[i] != NULL) + Data->Planes[i]->setScaling(xfactor, yfactor); + } + DiScaleTemplate scale(1, overlay->Width, overlay->Height, Width, Height, Frames); + scale.scaleData(OFconst_cast(const Uint16 **, &temp), &(Data->DataBuffer), 0); + if (temp != overlay->Data->DataBuffer) + delete[] temp; + } +} + + +// --- flip overlay + +DiOverlay::DiOverlay(const DiOverlay *overlay, + const int horz, + const int vert, + const Uint16 columns, // width of surrounding image + const Uint16 rows) + : Left((horz) ? 0 : overlay->Left), + Top((vert) ? 0 : overlay->Top), + Width(overlay->Width), + Height(overlay->Height), + Frames(overlay->Frames), + AdditionalPlanes(overlay->AdditionalPlanes), + Data(NULL) +{ + Uint16 *temp = Init(overlay); + if (temp != NULL) + { + DiFlipTemplate flip(1, Width, Height, Frames); + flip.flipData(OFconst_cast(const Uint16 **, &temp), &(Data->DataBuffer), horz, vert); + if (temp != overlay->Data->DataBuffer) + delete[] temp; + unsigned int i; + for (i = 0; i < Data->ArrayEntries; ++i) + { + if (Data->Planes[i] != NULL) + { + Data->Planes[i]->setFlipping(horz, vert, OFstatic_cast(signed long, columns) + overlay->Left, + OFstatic_cast(signed long, rows) + overlay->Top); + } + } + } +} + + +// --- rotate overlay + +DiOverlay::DiOverlay(const DiOverlay *overlay, + const int degree, + const Uint16 columns, // width of surrounding image (already rotated) + const Uint16 rows) + : Left(0), + Top(0), + Width(((degree == 90) || (degree == 270)) ? overlay->Height : overlay->Width), + Height(((degree == 90) || (degree == 270)) ? overlay->Width : overlay->Height), + Frames(overlay->Frames), + AdditionalPlanes(overlay->AdditionalPlanes), + Data(NULL) +{ + Uint16 *temp = Init(overlay); + if (temp != NULL) + { + DiRotateTemplate rotate(1, overlay->Width, overlay->Height, Width, Height, Frames); + rotate.rotateData(OFconst_cast(const Uint16 **, &temp), &(Data->DataBuffer), degree); + if (temp != overlay->Data->DataBuffer) + delete[] temp; + unsigned int i; + for (i = 0; i < Data->ArrayEntries; ++i) + { + if (Data->Planes[i] != NULL) + Data->Planes[i]->setRotation(degree, overlay->Left, overlay->Top, columns, rows); + } + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiOverlay::~DiOverlay() +{ + if (Data != NULL) + Data->removeReference(); +} + + +/********************************************************************/ + + +Uint16 *DiOverlay::Init(const DiOverlay *overlay) +{ + if ((overlay != NULL) && (overlay->Data != NULL) && (overlay->Data->Count > 0)) + { + if (AdditionalPlanes) + Data = new DiOverlayData(overlay->Data->ArrayEntries); // use same array size + else + Data = new DiOverlayData(overlay->Data->Count); // shrink array size to minimal size + const unsigned long count = OFstatic_cast(unsigned long, overlay->Width) * + OFstatic_cast(unsigned long, overlay->Height) * overlay->Frames; + if ((Data != NULL) && (Data->Planes != NULL) && (count > 0)) + { + const unsigned long bufSize = OFstatic_cast(unsigned long, Width) * + OFstatic_cast(unsigned long, Height) * Frames; + if (bufSize > 0) // avoid invalid buffer + { + Data->DataBuffer = new Uint16[bufSize]; + if (Data->DataBuffer != NULL) + { + unsigned int i; + Uint16 *temp = NULL; + if (overlay->Data->DataBuffer == NULL) // no data buffer + { + temp = new Uint16[count]; // create temporary buffer + if (temp != NULL) + OFBitmanipTemplate::zeroMem(temp, count); + } + for (i = 0; i < Data->ArrayEntries; ++i) + { + if ((overlay->Data->Planes[i] != NULL) /*&& (overlay->Data->Planes[i]->isValid())*/) + { + Data->Planes[i] = new DiOverlayPlane(overlay->Data->Planes[i], i, Data->DataBuffer, temp, + overlay->Width, overlay->Height, Width, Height); + ++(Data->Count); // increase number of valid planes + } + } + if (Data->Count != overlay->Data->Count) // assertion! + { + DCMIMGLE_WARN("different number of overlay planes for converted and original image"); + } + if (overlay->Data->DataBuffer != NULL) // existing data buffer + temp = overlay->Data->DataBuffer; // point to input buffer + return temp; + } + } else { + DCMIMGLE_DEBUG("skipping overlay planes for converted image ... calculated buffer size is 0"); + } + } + } + return NULL; +} + + +int DiOverlay::convertToPlaneNumber(unsigned int &plane, + const int mode) const +{ + if ((Data != NULL) && (Data->Planes != NULL)) + { + if (isValidGroupNumber(plane)) + { + if (AdditionalPlanes) + { + plane = (plane - FirstOverlayGroup) >> 1; // plane = (group - 0x6000) / 2 + if (Data->Planes[plane] != NULL) + return 2; // plane already exists + return 1; // ... is new + } else { + unsigned int i; + for (i = 0; i < Data->Count; ++i) + { + if ((Data->Planes[i] != NULL) && (Data->Planes[i]->getGroupNumber() == plane)) + { + plane = i; // plane number + return 2; + } + } + } + } else if (!mode && (plane < Data->Count) && (Data->Planes[plane] != NULL)) // valid plane number? + return 3; + } + return 0; +} + + +int DiOverlay::isValidGroupNumber(const unsigned int group) const +{ + return (group >= convertToGroupNumber(0)) && (group <= convertToGroupNumber(MaxOverlayCount - 1)) && !(group & 1); +} + + +int DiOverlay::checkPlane(const unsigned int plane, + const int mode) +{ + if ((Data != NULL) && (Data->Planes != NULL) && (plane < MaxOverlayCount) && (Data->Planes[plane] != NULL)) + { + if (Data->Planes[plane]->isValid()) + { + if (Data->Planes[plane]->getWidth() > Width) // determine maximum width + Width = Data->Planes[plane]->getWidth(); + if (Data->Planes[plane]->getHeight() > Height) // determine maximum height + Height = Data->Planes[plane]->getHeight(); + if (mode && (Data->Planes[plane]->getNumberOfFrames() > Frames)) // determine maximum frames + Frames = Data->Planes[plane]->getNumberOfFrames(); + return 1; + } + } + return 0; +} + + +int DiOverlay::isPlaneVisible(unsigned int plane) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + return Data->Planes[plane]->isVisible(); + return 0; +} + + +int DiOverlay::showPlane(unsigned int plane) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + { + if (Data->Planes[plane]->isVisible()) + return 2; + Data->Planes[plane]->show(); + return 1; + } + return 0; +} + + +int DiOverlay::showPlane(unsigned int plane, + const double fore, + const double tresh, + const EM_Overlay mode) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + { + Data->Planes[plane]->show(fore, tresh, mode); + return 1; + } + return 0; +} + + +int DiOverlay::showPlane(unsigned int plane, + const Uint16 pvalue) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + return Data->Planes[plane]->show(pvalue); + return 0; +} + + +int DiOverlay::showAllPlanes() +{ + if ((Data != NULL) && (Data->Planes != NULL)) + { + unsigned int i; + for (i = 0; i < Data->ArrayEntries; ++i) + { + if (Data->Planes[i] != NULL) + Data->Planes[i]->show(); + } + if (Data->Count > 0) + return 1; + return 2; + } + return 0; +} + + +int DiOverlay::showAllPlanes(const double fore, + const double tresh, + const EM_Overlay mode) +{ + if ((Data != NULL) && (Data->Planes != NULL)) + { + unsigned int i; + for (i = 0; i < Data->ArrayEntries; ++i) + { + if ((Data->Planes[i] != NULL)) + Data->Planes[i]->show(fore, tresh, mode); + } + if (Data->Count > 0) + return 1; + return 2; + } + return 0; +} + + +int DiOverlay::hidePlane(unsigned int plane) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + { + if (!Data->Planes[plane]->isVisible()) + return 2; + Data->Planes[plane]->hide(); + return 1; + } + return 0; +} + + +int DiOverlay::hideAllPlanes() +{ + if ((Data != NULL) && (Data->Planes != NULL)) + { + unsigned int i; + for (i = 0; i < Data->ArrayEntries; ++i) + { + if (Data->Planes[i] != NULL) + Data->Planes[i]->hide(); + } + if (Data->Count > 0) + return 1; + return 2; + } + return 0; +} + + +int DiOverlay::placePlane(unsigned int plane, + const signed int left_pos, + const signed int top_pos) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + { + if ((Data->Planes[plane]->getLeft() == left_pos) && (Data->Planes[plane]->getTop() == top_pos)) + return 2; + Data->Planes[plane]->place(left_pos, top_pos); + return 1; + } + return 0; +} + + +unsigned int DiOverlay::getPlaneGroupNumber(unsigned int plane) const +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + return Data->Planes[plane]->getGroupNumber(); + return 0; +} + + +const char *DiOverlay::getPlaneLabel(unsigned int plane) const +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + return Data->Planes[plane]->getLabel(); + return NULL; +} + + +const char *DiOverlay::getPlaneDescription(unsigned int plane) const +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + return Data->Planes[plane]->getDescription(); + return NULL; +} + + +EM_Overlay DiOverlay::getPlaneMode(unsigned int plane) const +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) + return Data->Planes[plane]->getMode(); + return EMO_Default; +} + + +int DiOverlay::hasEmbeddedData() const +{ + if ((Data != NULL) && (Data->Planes != NULL)) + { + unsigned int i; + for (i = 0; i < Data->ArrayEntries; ++i) + { + if ((Data->Planes[i] != NULL) && (Data->Planes[i]->isEmbedded())) + return 1; + } + } + return 0; +} + + +int DiOverlay::addPlane(const unsigned int group, + const signed int left_pos, + const signed int top_pos, + const unsigned int columns, + const unsigned int rows, + const DcmOverlayData &data, + const DcmLongString &label, + const DcmLongString &description, + const EM_Overlay mode) +{ + int status = 0; + if (AdditionalPlanes && isValidGroupNumber(group)) + { + unsigned int plane = group; + status = convertToPlaneNumber(plane, AdditionalPlanes); + if ((status != 0) && (plane < Data->ArrayEntries)) + { + if (status == 1) // add new plane + ++(Data->Count); + else if (status == 2) // group number already exists + delete Data->Planes[plane]; + Data->Planes[plane] = new DiOverlayPlane(group, left_pos, top_pos, columns, rows, data, label, description, mode); + if (checkPlane(plane, 0)) + { + if (Data->Planes[plane]->getNumberOfFrames() > Frames) // set maximum number of frames + Frames = Data->Planes[plane]->getNumberOfFrames(); + } else { + delete Data->Planes[plane]; // remove invalid plane + Data->Planes[plane] = NULL; + if (status == 1) + --(Data->Count); // decrease number of planes + status = 0; + } + } + } + return status; +} + + +int DiOverlay::removePlane(const unsigned int group) +{ + unsigned int plane = group; + if (AdditionalPlanes && (convertToPlaneNumber(plane, AdditionalPlanes) > 1)) + { + delete Data->Planes[plane]; // remove invalid plane + Data->Planes[plane] = NULL; + --(Data->Count); // decrease number of planes + return 1; + } + return 0; +} + + +void *DiOverlay::getPlaneData(const unsigned long frame, + unsigned int plane, + unsigned int &left_pos, + unsigned int &top_pos, + unsigned int &width, + unsigned int &height, + EM_Overlay &mode, + const Uint16 columns, + const Uint16 rows, + const int bits, + const Uint16 fore, + const Uint16 back) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) // plane does exist + { + DiOverlayPlane *op = Data->Planes[plane]; + if ((op != NULL) && op->isValid()) + { + const Uint16 xmin = (op->getLeft(Left) > 0) ? op->getLeft(Left) : 0; + const Uint16 ymin = (op->getTop(Top) > 0) ? op->getTop(Top) : 0; + const Uint16 xmax = (op->getRight(Left) < columns) ? op->getRight(Left) : columns; + const Uint16 ymax = (op->getBottom(Top) < rows) ? op->getBottom(Top) : rows; + left_pos = xmin; + top_pos = ymin; + width = xmax - xmin; + height = ymax - ymin; + mode = op->getMode(); + return op->getData(frame, xmin, ymin, xmax, ymax, bits, fore, back); + } + } + return NULL; +} + + +void *DiOverlay::getFullPlaneData(const unsigned long frame, + unsigned int plane, + unsigned int &width, + unsigned int &height, + const int bits, + const Uint16 fore, + const Uint16 back) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) // plane does exist + { + DiOverlayPlane *op = Data->Planes[plane]; + if ((op != NULL) && op->isValid()) + { + width = op->getWidth(); + height = op->getHeight(); + return op->getData(frame, 0, 0, width, height, bits, fore, back); + } + } + return NULL; +} + + +unsigned long DiOverlay::create6xxx3000PlaneData(Uint8 *&buffer, + unsigned int plane, + unsigned int &width, + unsigned int &height, + unsigned long &frames) +{ + if (convertToPlaneNumber(plane, AdditionalPlanes) > 1) // plane does exist + { + DiOverlayPlane *op = Data->Planes[plane]; + if ((op != NULL) && op->isValid()) + return op->create6xxx3000Data(buffer, width, height, frames); + } + return 0; +} diff --git a/dcmimgle/libsrc/diovlimg.cc b/dcmimgle/libsrc/diovlimg.cc new file mode 100644 index 00000000..9f95de78 --- /dev/null +++ b/dcmimgle/libsrc/diovlimg.cc @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 1996-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlayImage (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" + +#include "dcmtk/dcmimgle/diovlimg.h" +#include "dcmtk/dcmimgle/dimopxt.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiOverlayImage::DiOverlayImage(const DiDocument *docu, + const EI_Status status) + : DiMono2Image(docu, status, 0) +{ + if (Document != NULL) + { + Overlays[0] = new DiOverlay(Document); + if (Overlays[0] != NULL) + { + BitsPerSample = 1; + unsigned int i; + DiOverlayPlane *plane; + for (i = 0; i < Overlays[0]->getCount(); ++i) + { + plane = Overlays[0]->getPlane(i); + if (plane != NULL) + { + plane->show(); + if (plane->getNumberOfFrames() > NumberOfFrames) + NumberOfFrames = plane->getNumberOfFrames(); + if (plane->getRight() > Columns) // determine image's width and height + Columns = plane->getRight(); + if (plane->getBottom() > Rows) + Rows = plane->getBottom(); + } + } + if ((Rows > 0) && (Columns > 0)) + { + InterData = new DiMonoPixelTemplate(OFstatic_cast(unsigned long, Rows) * + OFstatic_cast(unsigned long, Columns) * NumberOfFrames); + if (InterData == NULL) + { + ImageStatus = EIS_MemoryFailure; + DCMIMGLE_ERROR("can't allocate memory for inter-representation"); + } + else if (InterData->getData() == NULL) + ImageStatus = EIS_InvalidImage; + } + else + { + ImageStatus = EIS_InvalidValue; + DCMIMGLE_ERROR("invalid value for 'Rows' (" << Rows << ") and/or 'Columns' (" << Columns << ")"); + } + } + } + else + { + ImageStatus = EIS_InvalidDocument; + DCMIMGLE_ERROR("this DICOM document is invalid"); + } +} + + +/*--------------* + * destructor * + *--------------*/ + +DiOverlayImage::~DiOverlayImage() +{ +} diff --git a/dcmimgle/libsrc/diovpln.cc b/dcmimgle/libsrc/diovpln.cc new file mode 100644 index 00000000..d982f7cb --- /dev/null +++ b/dcmimgle/libsrc/diovpln.cc @@ -0,0 +1,612 @@ +/* + * + * Copyright (C) 1996-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: DicomOverlayPlane (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmdata/dcpixel.h" +#include "dcmtk/ofstd/ofbmanip.h" +#include "dcmtk/ofstd/ofutil.h" + +#include "dcmtk/dcmimgle/diovpln.h" +#include "dcmtk/dcmimgle/didocu.h" + + +/*----------------* + * constructors * + *----------------*/ + +DiOverlayPlane::DiOverlayPlane(const DiDocument *docu, + const unsigned int group, + Uint16 alloc, + const Uint16 stored, + const Uint16 high) + : NumberOfFrames(0), + ImageFrameOrigin(0), + FirstFrame(0), + Top(0), + Left(0), + Height(0), + Width(0), + Rows(0), + Columns(0), + BitsAllocated(0), + BitPosition(0), + Foreground(1), + Threshold(1), + PValue(0), + Mode(EMO_Graphic), + DefaultMode(EMO_Graphic), + Label(), + Description(), + GroupNumber(group), + Valid(0), + Visible(0), + BitPos(0), + StartBitPos(0), + StartLeft(0), + StartTop(0), + EmbeddedData(0), + Ptr(NULL), + StartPtr(NULL), + Data(NULL) +{ + if (docu != NULL) + { + /* determine first frame to be processed */ + FirstFrame = docu->getFrameStart(); + /* specifiy overlay group number */ + DcmTagKey tag(group, DCM_OverlayRows.getElement() /* dummy */); + /* get descriptive data */ + tag.setElement(DCM_OverlayLabel.getElement()); + docu->getValue(tag, Label); + tag.setElement(DCM_OverlayDescription.getElement()); + docu->getValue(tag, Description); + /* get overlay type */ + tag.setElement(DCM_OverlayType.getElement()); + const char *str; + if ((docu->getValue(tag, str) > 0) && (str != NULL) && (strcmp(str, "R") == 0)) + DefaultMode = Mode = EMO_RegionOfInterest; + Sint32 sl = 0; + /* multi-frame overlays */ + tag.setElement(DCM_NumberOfFramesInOverlay.getElement()); + docu->getValue(tag, sl); + NumberOfFrames = (sl < 1) ? 1 : OFstatic_cast(Uint32, sl); + tag.setElement(DCM_ImageFrameOrigin.getElement()); + docu->getValue(tag, ImageFrameOrigin); + if (ImageFrameOrigin > 0) // image frame origin is numbered from 1 + --ImageFrameOrigin; + tag.setElement(DCM_OverlayOrigin.getElement()); +#ifdef REVERSE_OVERLAY_ORIGIN_ORDER + Valid = (docu->getValue(tag, Left, 0) > 0); + if (Valid) + { + DCMIMGLE_DEBUG("processing overlay plane in group 0x" << STD_NAMESPACE hex << group); + if (docu->getValue(tag, Top, 1) < 2) + DCMIMGLE_WARN("missing second value for 'OverlayOrigin' ... assuming 'Top' = " << Top); + } +#else + Valid = (docu->getValue(tag, Top, 0) > 0); + if (Valid) + { + DCMIMGLE_DEBUG("processing overlay plane in group 0x" << STD_NAMESPACE hex << group); + if (docu->getValue(tag, Left, 1) < 2) + DCMIMGLE_WARN("missing second value for 'OverlayOrigin' ... assuming 'Left' = " << Left); + } +#endif + /* overlay origin is numbered from 1 */ + --Top; + --Left; + /* check overlay resolution */ + tag.setElement(DCM_OverlayRows.getElement()); + Valid &= (docu->getValue(tag, Rows) > 0); + Height = Rows; + tag.setElement(DCM_OverlayColumns.getElement()); + Valid &= (docu->getValue(tag, Columns) > 0); + Width = Columns; + /* check overlay encoding */ + tag.setElement(DCM_OverlayBitsAllocated.getElement()); + Valid &= (docu->getValue(tag, BitsAllocated) > 0); + tag.setElement(DCM_OverlayBitPosition.getElement()); + Valid &= (docu->getValue(tag, BitPosition) > 0); + tag.setElement(DCM_OverlayData.getElement()); + /* final validity checks */ + if (Valid) + { + /* separate overlay data? */ + unsigned long length = docu->getValue(tag, Data) * 2 /* bytes */; + if (length == 0) + { + if (!(docu->getFlags() & CIF_NeverAccessEmbeddedOverlays)) + { + if (!docu->isCompressed()) + { + /* if not, check for embedded overlay data */ + DcmPixelData *pixelData = docu->getPixelData(); + if (pixelData != NULL) + { + ImageFrameOrigin = 0; // see supplement 4 + const OFBool loaded = pixelData->valueLoaded(); + if (pixelData->getUint16Array(OFconst_cast(Uint16 *&, Data)).good()) + { + length = pixelData->getLength(docu->getTransferSyntax()); + EmbeddedData = (Data != NULL); + if (!loaded) + DCMIMGLE_DEBUG("loaded complete pixel data into memory for embedded overlay data: " << length << " bytes"); + } + } + } else + DCMIMGLE_ERROR("embedded overlay data cannot be accessed since pixel data is still compressed"); + } else + DCMIMGLE_WARN("ignoring possibly embedded overlay data by configuration"); + } else + alloc = 1; // separately stored overlay data + /* check for correct value of BitsAllocated */ + if (BitsAllocated != alloc) // see correction proposal 87 + { + DCMIMGLE_WARN("invalid value for 'OverlayBitsAllocated' (" << BitsAllocated << ") ... assuming " << alloc); + BitsAllocated = alloc; + } + /* check for correct value of BitPosition */ + if (BitPosition >= BitsAllocated) + { + DCMIMGLE_WARN("invalid value for 'OverlayBitPosition' (" << BitPosition << ") ... assuming " << (BitsAllocated - 1)); + BitPosition = BitsAllocated - 1; + } + if (EmbeddedData && (BitPosition <= high) && (BitPosition + stored > high)) + { + DCMIMGLE_WARN("invalid value for 'OverlayBitPosition' (" << BitPosition << "), refers to bit position within stored pixel value"); + Data = NULL; // invalid plane + } + /* expected length of overlay data */ + const unsigned long expLen = (OFstatic_cast(unsigned long, NumberOfFrames) * OFstatic_cast(unsigned long, Rows) * + OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, BitsAllocated) + 7) / 8; + if ((Data != NULL) && ((length == 0) || (length < expLen))) + { + DCMIMGLE_ERROR("overlay data length is too short, " << expLen << " bytes expected but " << length << " bytes found"); + Valid = 0; + Data = NULL; + } else + Valid = (Data != NULL); + } + if (Valid) + { + /* report that this group contains a valid overlay plane */ + DCMIMGLE_TRACE("overlay plane in group 0x" << STD_NAMESPACE hex << group << " is present and can be processed"); + } else { + /* report that this group does not contain a valid overlay plane */ + DCMIMGLE_TRACE("overlay plane in group 0x" << STD_NAMESPACE hex << group << " is missing or incomplete"); + } + } +} + + +DiOverlayPlane::DiOverlayPlane(const unsigned int group, + const Sint16 left_pos, + const Sint16 top_pos, + const Uint16 columns, + const Uint16 rows, + const DcmOverlayData &data, + const DcmLongString &label, + const DcmLongString &description, + const EM_Overlay mode) + : NumberOfFrames(1), + ImageFrameOrigin(0), + FirstFrame(0), + Top(top_pos), + Left(left_pos), + Height(rows), + Width(columns), + Rows(rows), + Columns(columns), + BitsAllocated(1), + BitPosition(0), + Foreground(1), + Threshold(1), + PValue(0), + Mode(mode), + DefaultMode(mode), + Label(), + Description(), + GroupNumber(group), + Valid(0), + Visible((mode == EMO_BitmapShutter) ? 1 : 0), + BitPos(0), + StartBitPos(0), + StartLeft(0), + StartTop(0), + EmbeddedData(0), + Ptr(NULL), + StartPtr(NULL), + Data(NULL) +{ + DiDocument::getElemValue(OFreinterpret_cast(const DcmElement *, &label), Label); + DiDocument::getElemValue(OFreinterpret_cast(const DcmElement *, &description), Description); + if ((Columns > 0) && (Rows > 0)) + { + const unsigned long length = DiDocument::getElemValue(OFreinterpret_cast(const DcmElement *, &data), Data) * 2 /* Bytes */; + /* expected length of overlay data */ + const unsigned long expLen = (OFstatic_cast(unsigned long, Rows) * OFstatic_cast(unsigned long, Columns) + 7) / 8; + if ((length == 0) || (length < expLen)) + { + DCMIMGLE_ERROR("overlay data length is too short, " << expLen << " bytes expected but " << length << " bytes found"); + /* Valid = 0; => This is the default. */ + Data = NULL; + } else + Valid = (Data != NULL); + } + --Top; // overlay origin is numbered from 1 + --Left; +} + + +DiOverlayPlane::DiOverlayPlane(DiOverlayPlane *plane, + const unsigned int bit, + const Uint16 *data, + Uint16 *temp, + const Uint16 width, + const Uint16 height, + const Uint16 columns, + const Uint16 rows) + : NumberOfFrames(plane->NumberOfFrames), + ImageFrameOrigin(plane->ImageFrameOrigin), + FirstFrame(plane->FirstFrame), + Top(plane->Top), + Left(plane->Left), + Height(plane->Height), + Width(plane->Width), + Rows(rows), + Columns(columns), + BitsAllocated(16), + BitPosition(bit), + Foreground(plane->Foreground), + Threshold(plane->Threshold), + PValue(0), + Mode(plane->Mode), + DefaultMode(plane->DefaultMode), + Label(plane->Label), + Description(plane->Description), + GroupNumber(plane->GroupNumber), + Valid(0), + Visible(plane->Visible), + BitPos(0), + StartBitPos(0), + StartLeft(plane->StartLeft), + StartTop(plane->StartTop), + EmbeddedData(0), + Ptr(NULL), + StartPtr(NULL), + Data(data) +{ + if (temp != NULL) + { + Uint16 x; + Uint16 y; + Uint16 *q = temp; + const Uint16 mask = 1 << bit; + const Uint16 skip_x = width - plane->Columns; + const unsigned long skip_f = OFstatic_cast(unsigned long, height - plane->Rows) * OFstatic_cast(unsigned long, width); + for (unsigned long f = 0; f < NumberOfFrames; ++f) + { + if (plane->reset(f + ImageFrameOrigin)) + { + for (y = 0; y < plane->Rows; ++y) + { + for (x = 0; x < plane->Columns; ++x, ++q) + { + if (plane->getNextBit()) + *q |= mask; // set corresponding bit + else + *q &= ~mask; // unset ... bit + } + q += skip_x; // skip to next line start + } + q += skip_f; // skip to next frame start + } + } + } + Valid = (Data != NULL); +} + + +/*--------------* + * destructor * + *--------------*/ + +DiOverlayPlane::~DiOverlayPlane() +{ +} + + +/********************************************************************/ + + +void *DiOverlayPlane::getData(const unsigned long frame, + const Uint16 xmin, + const Uint16 ymin, + const Uint16 xmax, + const Uint16 ymax, + const int bits, + const Uint16 fore, + const Uint16 back) +{ + const unsigned long count = OFstatic_cast(unsigned long, xmax - xmin) * OFstatic_cast(unsigned long, ymax - ymin); + if (Valid && (count > 0)) + { + const Uint16 mask = OFstatic_cast(Uint16, DicomImageClass::maxval(bits)); + if (bits == 1) + { + const unsigned long count8 = (count + 7) / 8; // round value: 8 bit padding + Uint8 *data = new Uint8[count8]; + if (data != NULL) + { + if ((fore & mask) != (back & mask)) + { + OFBitmanipTemplate::setMem(data, 0x0, count8); + Uint16 x; + Uint16 y; + Uint8 value = 0; + Uint8 *q = data; + int bit = 0; + if (reset(frame + ImageFrameOrigin)) + { + for (y = ymin; y < ymax; ++y) + { + setStart(xmin, y); + for (x = xmin; x < xmax; ++x) + { + if (getNextBit()) + { + if (fore) + value |= (1 << bit); + } else if (back) + value |= (1 << bit); + if (bit == 7) + { + *(q++) = value; + value = 0; + bit = 0; + } else { + ++bit; + } + } + } + if (bit != 0) + *(q++) = value; + } + } else { + OFBitmanipTemplate::setMem(data, (fore) ? 0xff : 0x0, count8); + } + } + return OFstatic_cast(void *, data); + } + else if ((bits > 1) && (bits <= 8)) + { + Uint8 *data = new Uint8[count]; + if (data != NULL) + { + const Uint8 fore8 = OFstatic_cast(Uint8, fore & mask); + const Uint8 back8 = OFstatic_cast(Uint8, back & mask); + OFBitmanipTemplate::setMem(data, back8, count); + if (fore8 != back8) // optimization + { + Uint16 x; + Uint16 y; + Uint8 *q = data; + if (reset(frame + ImageFrameOrigin)) + { + for (y = ymin; y < ymax; ++y) + { + setStart(xmin, y); + for (x = xmin; x < xmax; ++x, ++q) + { + if (getNextBit()) + *q = fore8; // set pixel value (default: 0xff) + } + } + } + } + } + return OFstatic_cast(void *, data); + } + else if ((bits > 8) && (bits <= 16)) + { + Uint16 *data = new Uint16[count]; + if (data != NULL) + { + const Uint16 fore16 = fore & mask; + const Uint16 back16 = back & mask; + OFBitmanipTemplate::setMem(data, back16, count); + if (fore16 != back16) // optimization + { + Uint16 x; + Uint16 y; + Uint16 *q = data; + if (reset(frame + ImageFrameOrigin)) + { + for (y = ymin; y < ymax; ++y) + { + setStart(xmin, y); + for (x = xmin; x < xmax; ++x, ++q) + { + if (getNextBit()) + *q = fore16; // set pixel value (default: 0xff) + } + } + } + } + } + return OFstatic_cast(void *, data); + } + } + return NULL; +} + + +unsigned long DiOverlayPlane::create6xxx3000Data(Uint8 *&buffer, + unsigned int &width, + unsigned int &height, + unsigned long &frames) +{ + buffer = NULL; + width = Width; + height = Height; + frames = NumberOfFrames; + const unsigned long count = OFstatic_cast(unsigned long, Width) * OFstatic_cast(unsigned long, Height) * NumberOfFrames; + if (Valid && (count > 0)) + { + const unsigned long count8 = ((count + 15) / 16) * 2; // round value: 16 bit padding + buffer = new Uint8[count8]; + if (buffer != NULL) + { + OFBitmanipTemplate::setMem(buffer, 0x0, count8); + Uint16 x; + Uint16 y; + Uint8 value = 0; + Uint8 *q = buffer; + int bit = 0; + for (unsigned long f = 0; f < NumberOfFrames; ++f) + { + if (reset(f + ImageFrameOrigin)) + { + for (y = 0; y < Height; ++y) + { + for (x = 0; x < Width; ++x) + { + if (getNextBit()) + value |= (1 << bit); + if (bit == 7) + { + *(q++) = value; + value = 0; + bit = 0; + } else { + ++bit; + } + } + } + } + if (bit != 0) + *(q++) = value; + } + return count8; // number of bytes + } + } + return 0; +} + + +void DiOverlayPlane::show(const double fore, + const double thresh, + const EM_Overlay mode) +{ + Foreground = (fore < 0) ? 0 : (fore > 1) ? 1 : fore; + Threshold = (thresh < 0) ? 0 : (thresh > 1) ? 1 : thresh; + Mode = (mode == EMO_Default) ? DefaultMode : mode; + Visible = 1; +} + + +int DiOverlayPlane::show(const Uint16 pvalue) +{ + if (Mode == EMO_BitmapShutter) + { + PValue = pvalue; + Visible = 1; + return 1; + } + return 0; +} + + +void DiOverlayPlane::place(const signed int left_pos, + const signed int top_pos) +{ + Left = OFstatic_cast(Sint16, left_pos); + Top = OFstatic_cast(Sint16, top_pos); +} + + +void DiOverlayPlane::setScaling(const double xfactor, + const double yfactor) +{ + Left = OFstatic_cast(Sint16, xfactor * Left); + Top = OFstatic_cast(Sint16, yfactor * Top); + Width = OFstatic_cast(Uint16, xfactor * Width); + Height = OFstatic_cast(Uint16, yfactor * Height); + StartLeft = OFstatic_cast(unsigned int, xfactor * StartLeft); + StartTop = OFstatic_cast(unsigned int, yfactor * StartTop); +} + + +void DiOverlayPlane::setFlipping(const int horz, + const int vert, + const signed long columns, + const signed long rows) +{ + if (horz) + { + Left = OFstatic_cast(Sint16, columns - Width - Left); + StartLeft = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Columns) - Width - StartLeft); + } + if (vert) + { + Top = OFstatic_cast(Sint16, rows - Height - Top); + StartTop = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Rows) - Height - StartTop); + } +} + + +void DiOverlayPlane::setRotation(const int degree, + const signed long left_pos, + const signed long top_pos, + const Uint16 columns, + const Uint16 rows) +{ + if (degree == 180) // equal to v/h flip + setFlipping(1, 1, left_pos + columns, top_pos + rows); + else if ((degree == 90) || (degree == 270)) + { + OFswap(Width, Height); // swap visible width/height +/* + OFswap(Columns, Rows); // swap stored columns/rows -> already done in the constructor ! +*/ + if (degree == 90) // rotate right + { + const Sint16 ss = Left; + const unsigned int ui = StartLeft; + Left = OFstatic_cast(Sint16, OFstatic_cast(signed long, columns) - Width - Top + top_pos); + StartLeft = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Columns) - Width - StartTop); + Top = OFstatic_cast(Sint16, ss - left_pos); + StartTop = ui; + } else { // rotate left + const Sint16 ss = Left; + const unsigned int ui = StartLeft; + Left = OFstatic_cast(Sint16, Top - top_pos); + StartLeft = StartTop; + Top = OFstatic_cast(Sint16, OFstatic_cast(signed long, rows) - Height - ss + left_pos); + StartTop = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Rows) - Height - ui); + } + } +} diff --git a/dcmimgle/libsrc/diutils.cc b/dcmimgle/libsrc/diutils.cc new file mode 100644 index 00000000..584cb7a4 --- /dev/null +++ b/dcmimgle/libsrc/diutils.cc @@ -0,0 +1,138 @@ +/* + * + * Copyright (C) 1996-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Joerg Riesmeier + * + * Purpose: Utilities (Source) + * + */ + + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/ofstd/ofstream.h" + +#include "dcmtk/dcmimgle/diutils.h" + +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + + +/*--------------------* + * global variables * + *--------------------*/ + +OFLogger DCM_dcmimgleLogger = OFLog::getLogger("dcmtk.dcmimgle"); + + +/*------------------------* + * function definitions * + *------------------------*/ + +unsigned int DicomImageClass::rangeToBits(double minvalue, + double maxvalue) +{ + /* assertion: min < max ! */ + if (minvalue > maxvalue) + { + const double temp = minvalue; + minvalue = maxvalue; + maxvalue = temp; + } + /* signed data? */ + if (minvalue < 0) + { + if (fabs(minvalue) > fabs(maxvalue)) + return tobits(OFstatic_cast(unsigned long, fabs(minvalue)), 1) + 1; + else /* 'minvalue' is negative, 'maxvalue' is positive */ + return tobits(OFstatic_cast(unsigned long, fabs(maxvalue)), 0) + 1; + } + return tobits(OFstatic_cast(unsigned long, maxvalue), 0); +} + + +int DicomImageClass::isRepresentationSigned(EP_Representation repres) +{ + /* determine whether integer representation is signed or unsigned */ + return (repres == EPR_Sint8) || (repres == EPR_Sint16) || (repres == EPR_Sint32); +} + + +unsigned int DicomImageClass::getRepresentationBits(EP_Representation repres) +{ + unsigned int bits = 0; + /* determine number of bits for specified representation */ + switch (repres) + { + case EPR_Uint8: + case EPR_Sint8: + bits = 8; + break; + case EPR_Uint16: + case EPR_Sint16: + bits = 16; + break; + case EPR_Uint32: + case EPR_Sint32: + bits = 32; + break; + } + return bits; +} + + +EP_Representation DicomImageClass::determineRepresentation(double minvalue, + double maxvalue) +{ + if (minvalue > maxvalue) /* assertion: min < max ! */ + { + const double temp = minvalue; + minvalue = maxvalue; + maxvalue = temp; + } + if (minvalue < 0) /* signed */ + { + if ((-minvalue <= maxval(7, 0)) && (maxvalue <= maxval(7))) + return EPR_Sint8; + if ((-minvalue <= maxval(15, 0)) && (maxvalue <= maxval(15))) + return EPR_Sint16; +#ifdef DEBUG + if (-minvalue > maxval(MAX_BITS - 1, 0)) + { + DCMIMGLE_WARN("minimum pixel value (" << minvalue << ") exceeds signed " << MAX_BITS + << " bit " << "representation after modality transformation"); + } + if (maxvalue > maxval(MAX_BITS - 1)) + { + DCMIMGLE_WARN("maximum pixel value (" << maxvalue << ") exceeds signed " << MAX_BITS + << " bit " << "representation after modality transformation"); + } +#endif + return EPR_Sint32; + } + if (maxvalue <= maxval(8)) + return EPR_Uint8; + if (maxvalue <= maxval(16)) + return EPR_Uint16; +#ifdef DEBUG + if (maxvalue > maxval(MAX_BITS)) + { + DCMIMGLE_WARN("maximum pixel value (" << maxvalue << ") exceeds unsigned " << MAX_BITS + << " bit " << "representation after modality transformation"); + } +#endif + return EPR_Uint32; +} diff --git a/dcmimgle/tests/Makefile.in b/dcmimgle/tests/Makefile.in new file mode 100644 index 00000000..f6382936 --- /dev/null +++ b/dcmimgle/tests/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmimgle/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +check: + +check-exhaustive: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) + +dependencies: diff --git a/dcmiod/CMakeLists.txt b/dcmiod/CMakeLists.txt new file mode 100644 index 00000000..046eb789 --- /dev/null +++ b/dcmiod/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmiod) + +# declare include directories which hold for all subdirectories +include_directories("${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc include tests) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmiod/Makefile.in b/dcmiod/Makefile.in new file mode 100644 index 00000000..6ca53d80 --- /dev/null +++ b/dcmiod/Makefile.in @@ -0,0 +1,85 @@ +# +# Makefile for dcmiod +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all tests-all + +install: install-doc install-support + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmiod/configure b/dcmiod/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmiod/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmiod/data/Makefile.in b/dcmiod/data/Makefile.in new file mode 100644 index 00000000..24749772 --- /dev/null +++ b/dcmiod/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmiod/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmiod/docs/Makefile.in b/dcmiod/docs/Makefile.in new file mode 100644 index 00000000..f4ba0bbc --- /dev/null +++ b/dcmiod/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmiod/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmiod/docs/dcmiod.dox b/dcmiod/docs/dcmiod.dox new file mode 100644 index 00000000..515f452b --- /dev/null +++ b/dcmiod/docs/dcmiod.dox @@ -0,0 +1,23 @@ +/*! + +\page mod_dcmiod dcmiod: a library for working with information objects and modules + +This module contains classes that represent DICOM IOD (Information Object +Definitions) from part 3 of the DICOM Standard, including their modules and the +elements contained therein. They should ease reading, modifying and writing +IODs by offering an explicit API for this purpose. The requirements regarding +existence of elements and their values are pre-configured and can be adapted +during runtime. + +The main classes are (in alphabetical order): +\li \b DcmIODCommon +\li \b DcmIODImage +\li \b IODFoRModule +\li \b IODGeneralImageModule +\li \b IODGeneralSeriesModule +\li \b IODGeneralStudyModule +\li \b IODImagePixelModule +\li \b IODPatientModule +\li \b IODSOPCommonModule + +*/ diff --git a/dcmiod/etc/Makefile.in b/dcmiod/etc/Makefile.in new file mode 100644 index 00000000..86ad5f60 --- /dev/null +++ b/dcmiod/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmiod/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmiod/include/CMakeLists.txt b/dcmiod/include/CMakeLists.txt new file mode 100644 index 00000000..9ee1b5e5 --- /dev/null +++ b/dcmiod/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmiod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmiod/include/Makefile.in b/dcmiod/include/Makefile.in new file mode 100644 index 00000000..40cbb39a --- /dev/null +++ b/dcmiod/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmiod/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmiod + for file in dcmtk/dcmiod/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmiod ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmiod/include/dcmtk/dcmiod/cielabutil.h b/dcmiod/include/dcmtk/dcmiod/cielabutil.h new file mode 100644 index 00000000..c956527a --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/cielabutil.h @@ -0,0 +1,212 @@ +/* + * + * Copyright (C) 2016-2018, Pascal Getreuer, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Pascal Getreuer, Michael Onken + * + * Purpose: Static helper functionality for CIE<->RGB color conversions + * + */ + +#ifndef CIELABUTIL_H +#define CIELABUTIL_H + +#include "dcmtk/config/osconfig.h" +#define INCLUDE_CMATH // for pow() function +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/dcmiod/ioddef.h" + + +/** Class supporting color space conversions from and to CIELab. In some IODs + * DICOM stores CIELab color values which must often be converted to RGB for + * display or other purposes. This is supported by the functions dicomLab2RGB() + * and rgb2DicomLab(). The CIELab value range in DICOM is [0,65535] for all + * three values. The RGB value range in this class is [0;1]. Further functions + * are available in order to convert between RGB, "normal" CIELab value range + * as well as CIEXYZ. The class uses double floating point precision for + * calculations. + */ +class DCMTK_DCMIOD_EXPORT IODCIELabUtil +{ +public: + + /// D65 standard lightpoint X component for conversion from CIEXYZ to CIELab + static const double D65_WHITEPOINT_X; + /// D65 standard lightpoint Y component for conversion from CIEXYZ to CIELab + static const double D65_WHITEPOINT_Y; + /// D65 standard lightpoint Z component for conversion from CIEXYZ to CIELab + static const double D65_WHITEPOINT_Z; + + /** Convert CIELab color representation as found in DICOM to sRGB value + * representation. See DICOM part 3 for details. + * @param R Output sRGB "R" component (red) with 0 <= R <= 1 + * @param G Output sRGB "G" component (green) with 0 <= G <= 1 + * @param B Output sRGB "R" component (blue) with 0 <= B <= 1 + * @param LDicom Input DICOM CIELab luminance component with 0 <= L <= 65535 + * @param aDicom Input DICOM CIELab "a" component (red<->green) with 0 <= a <= 65535 + * @param bDicom Input DICOM CIELab "b" component (blue<->yellow) with 0 <= a <= 65535 + */ + static void dicomLab2RGB(double& R, double& G, double& B, double LDicom, double aDicom, double bDicom); + + /** Convert sRGB color representation to CIELab color representation as found + * in DICOM. See DICOM part 3 for details. + * @param LDicom Output CIELab luminance component with 0 <= L <= 65535 as found + * in DICOM + * @param aDicom Output CIELab "a" component (red<->green) with 0 <= a <= 65535 + * as found in DICOM + * @param bDicom Output CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 + * as found in DICOM + * @param R Input sRGB "R" component (red) with 0 <= R <= 1 + * @param G Input sRGB "G" component (green) with 0 <= G <= 1 + * @param B Input sRGB "R" component (blue) with 0 <= B <= 1 + * + */ + static void rgb2DicomLab(double& LDicom, double& aDicom, double& bDicom, double R, double G, double B); + + /** Convert CIELab color representation as found in DICOM to CIELab + * representation. See DICOM part 3 for details. + * @param L Output CIELab luminance component with 0 <= L <= 100 + * @param a Output CIELab "a" component (red<->green) with -127 <= a <= 128 + * @param b Output CIELab "b" component (blue<->yellow) with -127 <= b <= 128 + * @param LDicom Input CIELab luminance component with 0 <= L <= 65535 as found + * in DICOM + * @param aDicom Input CIELab "a" component (red<->green) with 0 <= a <= 65535 + * as found in DICOM + * @param bDicom Input CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 + * as found in DICOM + */ + static void dicomlab2Lab(double& L, double& a, double& b, double LDicom, double aDicom, double bDicom); + + /** Convert CIELab color representation to CIELab color representation found + * in DICOM. See DICOM part 3 for details. + * @param LDicom Output CIELab luminance component with 0 <= L <= 65535 as found + * in DICOM + * @param aDicom Output CIELab "a" component (red<->green) with 0 <= a <= 65535 + * as found in DICOM + * @param bDicom Output CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 + * as found in DICOM + * @param L Input CIELab luminance component with 0 <= L <= 100 + * @param a Input CIELab "a" component (red<->green) with -127 <= a <= 128 + * @param b Input CIELab "b" component (blue<->yellow) with -127 <= b <= 128 + * + */ + static void lab2DicomLab(double& LDicom, double& aDicom, double& bDicom, double L, double a, double b); + + /** Convert sRGB color representation to CIELab representation + * @param L Output CIELab luminance component with 0 <= L <= 100 + * @param a Output CIELab "a" component (red<->green) with -127 <= a <= 128 + * @param b Output CIELab "b" component (blue<->yellow) with -127 <= b <= 128 + * @param R Input sRGB "R" component (red) with 0 <= R <= 1 + * @param G Input sRGB "G" component (green) with 0 <= G <= 1 + * @param B Input sRGB "R" component (blue) with 0 <= B <= 1 + */ + static void rgb2Lab(double& L, double& a, double& b, double R, double G, double B); + + /** Convert sRGB color representation to CIE XYZ representation + * @param X Output CIELab XYZ "X" component with 0 <= X <= 1 + * @param Y Output CIELab XYZ "Y" component with 0 <= Y <= 1 + * @param Z Output CIELab XYZ "Z" component with 0 <= Z <= 1 + * @param R Input sRGB "R" component (red) with 0 <= R <= 1 + * @param G Input sRGB "G" component (green) with 0 <= G <= 1 + * @param B Input sRGB "R" component (blue) with 0 <= B <= 1 + */ + static void rgb2Xyz(double& X, double& Y, double& Z, double R, double G, double B); + + + /** Convert CIELAB XYZ color representation to CIELab representation + * @param L Output CIELab luminance component with 0 <= L <= 100 + * @param a Output CIELab "a" component (red<->green) with -127 <= a <= 128 + * @param b Output CIELab "b" component (blue<->yellow) with -127 <= b <= 128 + * @param X Input CIELab XYZ "X" component with 0 <= X <= 1 + * @param Y Input CIELab XYZ "Y" component with 0 <= Y <= 1 + * @param Z Input CIELab XYZ "Z" component with 0 <= Z <= 1 + */ + static void xyz2Lab(double& L, double& a, double& b, double X, double Y, double Z); + + /** Convert CIELab color representation to sRGB representation + * @param R Output sRGB "R" component (red) with 0 <= R <= 1 + * @param G Output sRGB "G" component (green) with 0 <= G <= 1 + * @param B Output sRGB "R" component (blue) with 0 <= B <= 1 + * @param L Input CIELab luminance component with 0 <= L <= 100 + * @param a Input CIELab "a" component (red<->green) with -127 <= a <= 128 + * @param b Input CIELab "b" component (blue<->yellow) with -127 <= b <= 128 + */ + static void lab2Rgb(double& R, double& G, double& B, double L, double a, double b); + + /** Convert CIELab color representation to CIE XYZ representation + * @param X Output CIELab XYZ "X" component with 0 <= X <= 1 + * @param Y Output CIELab XYZ "Y" component with 0 <= Y <= 1 + * @param Z Output CIELab XYZ "Z" component with 0 <= Z <= 1 + * @param L Input CIELab luminance component with 0 <= L <= 100 + * @param a Input CIELab "a" component (red<->green) with -127 <= a <= 128 + * @param b Input CIELab "b" component (blue<->yellow) with -127 <= b <= 128 + */ + static void lab2Xyz(double& X, double& Y, double& Z, double L, double a, double b); + + /** Convert CIE XYZ color representation to sRGB representation + * @param R Output sRGB "R" component (red) with 0 <= R <= 1 + * @param G Output sRGB "G" component (green) with 0 <= G <= 1 + * @param B Output sRGB "R" component (blue) with 0 <= B <= 1 + * @param X Output CIELab XYZ "X" component with 0 <= X <= 1 + * @param Y Output CIELab XYZ "Y" component with 0 <= Y <= 1 + * @param Z Output CIELab XYZ "Z" component with 0 <= Z <= 1 + */ + static void xyz2Rgb(double& R, double& G, double& B, double X, double Y, double Z); + +protected: + + /** Perform sRGB gamma correction, transforms R to R' + * @param n The value to correct + * @return The gamma-corrected value + */ + static double gammaCorrection(double n); + + /** Perform inverse sRGB gamma correction, transforms R' to R + * @param n The value to invert + * @return The gamma-inverted value + */ + static double invGammaCorrection(double n); + + /** CIE L*a*b* f function (used to convert XYZ to L*a*b*) + * @param n value to convert + * @return The converted value + */ + static double labf(double n); + + /** CIE L*a*b* inverse f function + * @param n The value to compute the inverse for + * @return The resulting inverse + */ + static double labfInv(double n); + + /** Get the minimum of two numbers + * @param a First number + * @param b Second number + * @return The minimum of a, b. a if a and b are equal. + */ + static double min2(double a, double b); + + /** Get the minimum of three numbers + * @param a First number + * @param b Second number + * @param c Third number + * @return The minimum of a, b and c. If a value occurs more than once, + * then preference order then a is preferred if possible, b + * otherwise + */ + static double min3(double a, double b, double c); + +}; + +#endif // CIELABUTIL_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodcommn.h b/dcmiod/include/dcmtk/dcmiod/iodcommn.h new file mode 100644 index 00000000..5b5739d5 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodcommn.h @@ -0,0 +1,270 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class representing IODs by exposing common DICOM module attributes + * + */ + +#ifndef IODCOMMN_H +#define IODCOMMN_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modpatient.h" +#include "dcmtk/dcmiod/modpatientstudy.h" +#include "dcmtk/dcmiod/modgeneralstudy.h" +#include "dcmtk/dcmiod/modequipment.h" +#include "dcmtk/dcmiod/modgeneralseries.h" +#include "dcmtk/dcmiod/modfor.h" +#include "dcmtk/dcmiod/modsopcommon.h" +#include "dcmtk/dcmiod/modcommoninstanceref.h" + +/** Interface class to those modules and data attributes are common for many + * DICOM IODs. The class offers a dedicated API for getting and settings those + * attributes. Modules included: Patient Module, General Study Module, General + * Equipment Module, General Series Module, Frame of Reference Module, SOP + * Common Module. + */ +class DCMTK_DCMIOD_EXPORT DcmIODCommon +{ + +public: + + /** Constructor + */ + DcmIODCommon(); + + /** Copy Constructor + * @param rhs The object to copy from + */ + DcmIODCommon(const DcmIODCommon& rhs); + + /** Get rules handled by this IOD + * @return The rules + */ + OFshared_ptr getRules(); + + /** Get item managed by this IOD + * @return The item + */ + OFshared_ptr getData(); + + /** Get Patient Module + * @return Reference to Patient Module + */ + IODPatientModule& getPatient(); + + /** Get Patient Study Module + * @return Reference to Patient Study Module + */ + IODPatientStudyModule& getPatientStudy(); + + /** Get General Study Module + * @return Reference to General Study Module + */ + IODGeneralStudyModule& getStudy(); + + /** Get General Equipment Module + * @return Reference to General Equipment Module + */ + IODGeneralEquipmentModule& getEquipment(); + + /** Get Series Module + * @return Reference to General Series Module + */ + IODGeneralSeriesModule& getSeries(); + + /** Get Frame of Reference Module + * @return Reference to Frame of Reference Module + */ + IODFoRModule& getFrameOfReference(); + + /** Get SOP Common Module + * @return Reference to SOP Common Module + */ + IODSOPCommonModule& getSOPCommon(); + + /** Get Common Instance Reference Module + * @return Common Instance Reference Module + */ + IODCommonInstanceReferenceModule& getCommonInstanceReference(); + + /** Destructor + */ + virtual ~DcmIODCommon(); + + /** Clear (removes) all attributes handled by the modules of this IOD. + * IOD Rules are not reset. + */ + virtual void clearData(); + + /** Create new study. + * After generating a new Study Instance UID the method createNewSeries() is + * called, i.e.\ also a new Series Instance UID and SOP instance UID are + * generated. This is a requirement of the DICOM standard. All other + * study-related attributes from the study-level modules managed by this class + * are cleared (as well as Series and Instance level attributes). + * @param clearEquipment If OFTrue (default), also the equipment information is + * cleared (General Equipment Module)) + */ + virtual void createNewStudy(const OFBool clearEquipment = OFTrue); + + /** Create a new series. + * After generating a new Series Instance UID the method + * createNewSOPInstance() is called, i.e.\ Series-related attributes managed + * by the series-level modules of this class are cleared, as well as + * instance-level data. + * @param clearFoR If OFTrue (default), also the frame of reference is + * cleared (FoR Module) + */ + virtual void createNewSeries(const OFBool clearFoR = OFTrue); + + /** Create a new SOP instance. + * Generate a new SOP Instance UID and set the Instance Creation Date/Time + * to the current date and time. + * It could be used explicitly from the calling application if a new UID + * should be created (this is the case if the Study Instance UID or Series + * Instance UID has changed as well as any other attribute on the instance + * level, e.g.\ image pixel data). Also clears other instance related data. + */ + virtual void createNewSOPInstance(); + + /** Make sure that the IOD contains a SOP Instance, Series Instance and Study + * Instance UID. They are created if empty. Invalid UIDs are corrected if + * desired. + * @param correctInvalid If OFTrue, invalid instance UIDs will be replaced + * by new ones + */ + virtual void ensureInstanceUIDs(const OFBool correctInvalid = OFFalse); + + /** Read data into this class. + * Please note that the current content is also deleted if the reading + * process fails. If the log stream is set and valid the reason for any + * error might be obtained from the error/warning output. The reading + * process will ignore missing attributes or values as possible in order + * to read as as much as possible. + * @param dataset DICOM dataset from which the document should be read + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** Import common module attributes from dataset but only read Patient, Study, + * Series and/or Frame of Reference level portions. The current content + * is not deleted before reading. If the log stream is set and valid the + * reason for any error might be obtained from the error/warning output. + * @param dataset Reference to DICOM dataset from which the document + * should be read + * @param readPatient Read Patient-level information if OFTrue + * @param readStudy Read Study-level information if OFTrue, including + * equipment module + * @param readFoR Read Frame of Reference information if OFTrue. See + * also readSeries parameter. + * @param readSeries Read Series-level information if OFTrue, always + * includes Frame of Reference, i.e.\ readFoR is + * considered to be OFTrue + * @param takeOverCharset If OFTrue (default), Specific Character Set is + * taken over from imported dataset. If it's not + * present or empty (invalid), the attribute will + * not be present in this class either. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition importHierarchy(DcmItem& dataset, + const OFBool readPatient, + const OFBool readStudy, + const OFBool readFoR = OFFalse, + const OFBool readSeries = OFFalse, + const OFBool takeOverCharset = OFTrue); + + /** CAUTION: Parameter order (readFoR and readSeries) changed compared to the + * old import() function. + * Import common module attributes from DICOM file but only read Patient, Study, + * Series and/or Frame of Reference level portions. The current content + * is not deleted before reading. If the log stream is set and valid the + * reason for any error might be obtained from the error/warning output. + * @param filename The filename to read from. + * @param readPatient Read Patient-level information if OFTrue + * @param readStudy Read Study-level information if OFTrue, including + * equipment module + * @param readFoR Read Frame of Reference information if OFTrue. See + * also readSeries parameter. + * @param readSeries Read Series-level information if OFTrue, always + * includes Frame of Reference, i.e.\ readFoR is + * considered to be OFTrue + * @param takeOverCharset If OFTrue (default), Specific Character Set is + * taken over from imported dataset. If it's not + * present or empty (invalid), the attribute will + * not be present in this class either. + * @return EC_Normal if reading was successful (i.e.\ if any information could + * be read), otherwise an error is returned + */ + virtual OFCondition importHierarchy(const OFString& filename, + const OFBool readPatient, + const OFBool readStudy, + const OFBool readFoR = OFFalse, + const OFBool readSeries = OFFalse, + const OFBool takeOverCharset = OFTrue); + + /** Write the attributes managed by this class to DICOM dataset. + * @param dataset Reference to DICOM dataset to which the current document + * should be written. The dataset is not cleared + * before writing to it. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + +private: + + /** Copy assignment disabled + */ + DcmIODCommon& operator=(const DcmIODCommon&); + + /// The data hold by this class (shared with modules below) + OFshared_ptr m_Item; + + /// The rules hold by this class (shared with modules below) + OFshared_ptr m_Rules; + + /// Patient Module + IODPatientModule m_Patient; + + /// Patient Study Module + IODPatientStudyModule m_PatientStudy; + + /// General Study Module + IODGeneralStudyModule m_Study; + + /// General Equipment Module + IODGeneralEquipmentModule m_Equipment; + + /// General Series Module + IODGeneralSeriesModule m_Series; + + /// Frame of Reference Module + IODFoRModule m_FrameOfReference; + + /// SOP Common Module + IODSOPCommonModule m_SOPCommon; + + /// Common Instance Reference Module + IODCommonInstanceReferenceModule m_CommonInstanceReferenceModule; + + /// Collects all modules of this class for convenience (iteration) + OFVector m_Modules; +}; + +#endif // IODCOMMN_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h b/dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h new file mode 100644 index 00000000..8646e96f --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h @@ -0,0 +1,478 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Content Item Macro + * + */ + +#ifndef IODCONTENTITEMMACRO_H +#define IODCONTENTITEMMACRO_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmiod/iodtypes.h" + +/** Class representing the Content Item Macro: + * + * ValueType: (CS, 1, 1) + * ConceptNameCodeSequence: (SQ, 1, 1) + * DateTime: (DT, 1, 1C) + * Date: (DA, 1, 1C) + * Time: (TM, 1, 1C) + * PersonName: (PN, 1, 1C) + * UID: (UI, 1, 1C) + * TextValue: (UT, 1, 1C) + * ConceptCodeSequence: (SQ, 1, 1C) + * NumericValue: (DS, 1-n, 1C) + * FloatingPointValue: (FD, 1-n, 1C) + * RationalNumeratorValue: (SL, 1-n, 1C) + * RationalDenominatorValue: (UL, 1-n, 1C) + * MeasurementUnitsCodeSequence: (SQ, 1, 1C) + * ReferencedSOPSequence: (SQ, 1, 1C) + */ +class DCMTK_DCMIOD_EXPORT ContentItemMacro : public IODComponent +{ +public: + + enum ValueType + { + // Value is empty and not provided + VT_EMPTY, + // Value is provided but not known to the implementation + VT_UNKNOWN, + VT_DATE, + VT_TIME, + VT_DATETIME, + VT_PNAME, + VT_UIDREF, + VT_TEXT, + VT_CODE, + VT_NUMERIC, + VT_COMPOSITE, + VT_IMAGE + }; + + /** Class representing an item within the Content Item Macro's Referenced + * SOP Sequence + */ + class DCMTK_DCMIOD_EXPORT ReferencedSOPSequenceItem : public IODComponent + { + public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + ReferencedSOPSequenceItem(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + ReferencedSOPSequenceItem(IODComponent* parent = NULL); + + /** Copy Constructor, performs deep copy + * @param rhs The parent of the IOD component (NULL if none or unknown) + */ + ReferencedSOPSequenceItem(const ReferencedSOPSequenceItem& rhs); + + /** Virtual Destructor + */ + virtual ~ReferencedSOPSequenceItem(); + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of macro + * @return Name of the component ("ReferencedSOPSequenceItem") + */ + virtual OFString getName() const; + + /** Get SOPInstanceReferenceMacro + * @return a reference to the included SOPInstanceReferenceMacro + */ + virtual SOPInstanceReferenceMacro& getSOPInstanceReferenceMacro(); + + /** Get ReferencedFrameNumber + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedFrameNumber(OFString &value, + const signed long pos = 0) const; + + /** Get ReferencedSegmentNumber + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedSegmentNumber(Uint16 &value, + const signed long pos = 0) const; + + /** Set ReferencedFrameNumber + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferencedFrameNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set ReferencedSegmentNumber + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (US) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferencedSegmentNumber(const Uint16 value, + const OFBool checkValue = OFTrue); + + protected: + + /// The name of this item ("ReferencedSOPSequenceItem") + static const OFString m_ComponentName; + + /// SOP Instance Reference Macro + SOPInstanceReferenceMacro m_SOPInstanceReferenceMacro; + }; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + ContentItemMacro(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + ContentItemMacro(); + + /** Destructor + */ + virtual ~ContentItemMacro(); + + ContentItemMacro(const ContentItemMacro& rhs); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("ContentItemMacro") + * @return Name of the module ("ContentItemMacro") + */ + virtual OFString getName() const; + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Get ValueType + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getValueType(OFString &value, + const signed long pos = 0) const; + + /** Get ValueType + * @param value Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getValueType(ValueType &value) const; + + /** Get reference to the ConceptNameCodeSequence + * @return a reference to the ConceptNameCodeSequence + */ + virtual CodeSequenceMacro* getConceptNameCodeSequence(); + + /** Get a reference to the entire ConceptNameCodeSequence, including items + * exceeding the value multiplicity restriction of "1" + * @return a reference to the entire ConceptNameCodeSequence + */ + virtual OFVector& getEntireConceptNameCodeSequence(); + + /** Get DateTime + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateTime(OFString &value, + const signed long pos = 0) const; + + /** Get Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDate(OFString &value, + const signed long pos = 0) const; + + /** Get Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTime(OFString &value, + const signed long pos = 0) const; + + /** Get PersonName + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPersonName(OFString &value, + const signed long pos = 0) const; + + /** Get UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUID(OFString &value, + const signed long pos = 0) const; + + /** Get TextValue + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTextValue(OFString &value, + const signed long pos = 0) const; + + /** Get reference to the ConceptCodeSequence + * @return a reference to the ConceptCodeSequence + */ + virtual CodeSequenceMacro* getConceptCodeSequence(); + + /** Get a reference to the entire ConceptCodeSequence, including items + * exceeding the value multiplicity restriction of "1" + * @return a reference to the entire ConceptCodeSequence + */ + virtual OFVector& getEntireConceptCodeSequence(); + + /** Get NumericValue + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumericValue(OFString &value, + const signed long pos = 0) const; + + /** Get FloatingPointValue + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloatingPointValue(Float64 &value, + const signed long pos = 0) const; + + /** Get RationalNumeratorValue + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRationalNumeratorValue(Sint32 &value, + const signed long pos = 0) const; + + /** Get RationalDenominatorValue + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRationalDenominatorValue(Uint32 &value, + const signed long pos = 0) const; + + /** Get reference to the MeasurementUnitsCodeSequence + * @return a reference to the MeasurementUnitsCodeSequence + */ + virtual CodeSequenceMacro* getMeasurementUnitsCodeSequence(); + + /** Get a reference to the entire MeasurementUnitsCodeSequence, including items + * exceeding the value multiplicity restriction of "1" + * @return a reference to the entire MeasurementUnitsCodeSequence + */ + virtual OFVector& getEntireMeasurementUnitsCodeSequence(); + + /** Get reference to the ReferencedSOPSequence + * @return a reference to the ReferencedSOPSequence + */ + virtual ReferencedSOPSequenceItem* getReferencedSOPSequence(); + + /** Get a reference to the entire ReferencedSOPSequence, including items + * exceeding the value multiplicity restriction of "1" + * @return a reference to the entire ReferencedSOPSequence + */ + virtual OFVector& getEntireReferencedSOPSequence(); + + /** Set ValueType + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setValueType(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set ValueType + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Does nothing, here for consistency with + * other set() functions. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setValueType(const ValueType value, + const OFBool checkValue = OFTrue); + + /** Set DateTime + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateTime(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Date + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDate(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Time + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTime(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set PersonName + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPersonName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set TextValue + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTextValue(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set NumericValue + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNumericValue(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set FloatingPointValue + * @param value Value to be set (single value only) or "" for no value + * @param pos Index of the value to be set (starting from 0) + * @param checkValue Check 'value' for conformance with VR (FD) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFloatingPointValue(const Float64 value, + const unsigned long pos = 0, + const OFBool checkValue = OFTrue); + + /** Set RationalNumeratorValue + * @param value Value to be set (single value only) or "" for no value + * @param pos Index of the value to be set (starting from 0) + * @param checkValue Check 'value' for conformance with VR (SL) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRationalNumeratorValue(const Sint32 value, + const unsigned long pos = 0, + const OFBool checkValue = OFTrue); + + /** Set RationalDenominatorValue + * @param value Value to be set (single value only) or "" for no value + * @param pos Index of the value to be set (starting from 0) + * @param checkValue Check 'value' for conformance with VR (UL) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRationalDenominatorValue(const Uint32 value, + const unsigned long pos = 0, + const OFBool checkValue = OFTrue); + + virtual OFString toString(); + +protected: + + /// The name of this module ("ContentItemMacro") + static const OFString m_ModuleName; + + /// ConceptNameCodeSequence + OFVector m_ConceptNameCodeSequence; + + /// ConceptCodeSequence + OFVector m_ConceptCodeSequence; + + /// MeasurementUnitsCodeSequence + OFVector m_MeasurementUnitsCodeSequence; + + /// ReferencedSOPSequence + OFVector m_ReferencedSOPSequence; +}; + +#endif // IODCONTENTITEMMACRO_H diff --git a/dcmiod/include/dcmtk/dcmiod/ioddef.h b/dcmiod/include/dcmtk/dcmiod/ioddef.h new file mode 100644 index 00000000..1989579d --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/ioddef.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Contains preprocessor definitions for dcmiod module + * + */ + + +#ifndef IODDEF_H +#define IODDEF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofdefine.h" + + +// Make sure DLL exports work for this module + +#ifdef dcmiod_EXPORTS +#define DCMTK_DCMIOD_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMIOD_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif // IODDEF_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodimage.h b/dcmiod/include/dcmtk/dcmiod/iodimage.h new file mode 100644 index 00000000..2444edd9 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodimage.h @@ -0,0 +1,312 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class repres. image IOD by exposing common image IOD attributes + * + */ + +#ifndef IODIMAGE_H +#define IODIMAGE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofutil.h" +#include "dcmtk/ofstd/ofvriant.h" +#include "dcmtk/dcmiod/iodcommn.h" +#include "dcmtk/dcmiod/modgeneralimage.h" +#include "dcmtk/dcmiod/modimagepixelvariant.h" + +class IODDoubleFloatingPointImagePixelModule; +class IODFloatingPointImagePixelModule; +template +class IODImagePixelModule; + +/** Class for managing common image IOD attributes. At the moment support for + * the palette-related attributes and the smallest/largest image pixel value + * attributes is still missing. Also, pixel data must be handled separately. + * However, pixel-data related attributes are provided by the Image Pixel + * Module, the Floating Point Image Pixel Module or the Double Floating Point + * Image Pixel Module, based on the provided template parameter. + * Modules supported on top of DcmIODCommon: General Image Module and + * Image Pixel Module. + */ +#ifdef HAVE_CXX11 +template +struct DcmIODImageHasType +: std::false_type {}; + +template +struct DcmIODImageHasType +: std::true_type {}; + +template +struct DcmIODImageHasType +: DcmIODImageHasType::type {}; + +template +#else +template +#endif +class DcmIODImage : public DcmIODCommon +{ + +public: + + /** typedef for old compilers that do not define the type 'DcmIODImage' in + * derived classes. + */ + typedef DcmIODImage IODImage; + + /** A good comment would be nice, but I have nothing in mind + */ +#ifdef HAVE_CXX11 + using IODImagePixelModuleType = IODImagePixelVariant; +#else + typedef IODImagePixelVariant IODImagePixelModuleType; +#endif + + /** Constructor, creates new DcmIODImage instance with integer-based pixel data. + */ + DcmIODImage() + : DcmIODCommon() + , m_GeneralImage(getData(), getRules()) + , m_ImagePixel() + { + + } + + /** Constructor, constructs new DcmIODImage instance with integer, float or + * double based Image Pixel Module (i. e. Image Pixel Module, Floating Point + * Image Pixel Module or the Double Floating Point Image Pixel Module), based + * on the provided Image Pixel module type. + */ + template + DcmIODImage(OFin_place_type_t(ImagePixel)) + : DcmIODCommon() + , m_GeneralImage(getData(), getRules()) + , m_ImagePixel(ImagePixel(getData(), getRules())) + { + + } + + /** Virtual Destructor + */ + virtual ~DcmIODImage() + { + + } + + /** Get General Image Module + * @return Reference to General Image Module + */ + IODGeneralImageModule& getGeneralImage() + { + return m_GeneralImage; + } + + /** Get Image Pixel Module (variant) + * @return Reference to Image Pixel Module + */ + IODImagePixelModuleType& getImagePixel() + { + return m_ImagePixel; + } + + /** Clear (removes) all attributes handled by the modules of this IOD. + * IOD Rules are not reset. + */ + virtual void clearData() + { + DcmIODCommon::clearData(); + m_GeneralImage.clearData(); + m_ImagePixel.clearData(); + } + + /** Read common image module attributes (all those handled by this class) + * from given item. Reads attributes from base class DcmIODCommon before. + * The current content is deleted even if the reading process fails. + * If the log stream is set and valid the reason for any error might be + * obtained from the error/warning output. + * @param dataset Reference to DICOM dataset from which the document + * should be read + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset) + { + // re-initialize object + clearData(); + + // read from base classes + DcmIODCommon::read(dataset); + m_GeneralImage.read(dataset, OFTrue /* clear old data */); + + return readFloatingPointDoubleImagePixel(dataset); + } + + /** Write current common image module's attributes to DICOM dataset. Also + * writes attributes of base class DcmIODCommon afterwards. + * @param dataset Reference to DICOM dataset to which the current data + * should be written. The dataset is not cleared before writing + * to it! + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset) + { + OFCondition result = EC_Normal; + + // Write base class attributes to dataset + result = DcmIODCommon::write(dataset); + + // Write extra modules to dataset + if (result.good()) + result = m_GeneralImage.write(dataset); + if (result.good()) + result = m_ImagePixel.write(dataset); + + return result; + } + +private: + + template +#ifdef HAVE_CXX11 + typename std::enable_if::value,OFCondition>::type +#else + OFTypename OFenable_if + < + (OFvariadic_find_type::value != -1), + OFCondition + >::type +#endif + readFloatingPointDoubleImagePixel(DcmItem& dataset) + { + if (dataset.tagExists(DCM_DoubleFloatPixelData)) + return OFget(&(m_ImagePixel = T(getData(),getRules())))->read(dataset); + return readFloatingPointImagePixel(dataset); + } + + template +#ifdef HAVE_CXX11 + typename std::enable_if::value,OFCondition>::type +#else + OFTypename OFenable_if + < + (OFvariadic_find_type::value == -1), + OFCondition + >::type +#endif + readFloatingPointDoubleImagePixel(DcmItem& dataset) + { + return readFloatingPointImagePixel(dataset); + } + + template +#ifdef HAVE_CXX11 + typename std::enable_if::value,OFCondition>::type +#else + OFTypename OFenable_if + < + (OFvariadic_find_type::value != -1), + OFCondition + >::type +#endif + readFloatingPointImagePixel(DcmItem& dataset) + { + if (dataset.tagExists(DCM_FloatPixelData)) + return OFget(&(m_ImagePixel = T(getData(),getRules())))->read(dataset); + return readIntegerImagePixel(dataset); + } + + template +#ifdef HAVE_CXX11 + typename std::enable_if::value,OFCondition>::type +#else + OFTypename OFenable_if + < + (OFvariadic_find_type::value == -1), + OFCondition + >::type +#endif + readFloatingPointImagePixel(DcmItem& dataset) + { + return readIntegerImagePixel(dataset); + } + + OFCondition readIntegerImagePixel(DcmItem& dataset) + { + Uint16 allocated, representation; + if + ( + dataset.tagExists(DCM_PixelData) && + dataset.findAndGetUint16(DCM_BitsAllocated, allocated).good() && + dataset.findAndGetUint16(DCM_PixelRepresentation, representation).good() + ) + switch ((allocated > 8 ? 2 : 0) | (representation ? 1 : 0)) + { + case 0: + return readImagePixel(dataset); + case 1: + return readImagePixel(dataset); + case 2: + return readImagePixel(dataset); + case 3: + return readImagePixel(dataset); + default: + break; + } + return IOD_EC_InvalidPixelData; + } + + template +#ifdef HAVE_CXX11 + typename std::enable_if,Types...>::value,OFCondition>::type +#else + OFTypename OFenable_if + < + (OFvariadic_find_type,OFVARIADIC_TEMPLATE_PARAMETER_PACK(T)>::value != -1), + OFCondition + >::type +#endif + readImagePixel(DcmItem& dataset) + { + return OFget >(&(m_ImagePixel = IODImagePixelModule(getData(),getRules())))->read(dataset); + } + + template +#ifdef HAVE_CXX11 + typename std::enable_if,Types...>::value,OFCondition>::type +#else + OFTypename OFenable_if + < + (OFvariadic_find_type,OFVARIADIC_TEMPLATE_PARAMETER_PACK(T)>::value == -1), + OFCondition + >::type +#endif + readImagePixel(DcmItem& dataset) + { + // Avoid compiler warning about unused parameter + OFstatic_cast(void, dataset); + return IOD_EC_InvalidPixelData; + } + + /// General Image Module + IODGeneralImageModule m_GeneralImage; + + /// Image Pixel Module + IODImagePixelModuleType m_ImagePixel; +}; + +#endif // IODIMAGE_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodmacro.h b/dcmiod/include/dcmtk/dcmiod/iodmacro.h new file mode 100644 index 00000000..4430c2cd --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodmacro.h @@ -0,0 +1,1368 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Collection of classes representing DICOM IOD macros + * + */ + +#ifndef IODMACRO_H +#define IODMACRO_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dctk.h" // For VR classes, i.e. DcmCodeString etc. +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing a Code Sequence Macro + */ +class DCMTK_DCMIOD_EXPORT CodeSequenceMacro : public IODComponent +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + CodeSequenceMacro(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + CodeSequenceMacro(IODComponent* parent = NULL); + + /** Copy Constructor, performs deep copy + * @param rhs The parent of the IOD component (NULL if none or unknown) + */ + CodeSequenceMacro(const CodeSequenceMacro& rhs); + + /** Convenience constructor to set initial values + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + * @param codeValue The code value + * @param codingSchemeDesignator The coding scheme designator + * @param codeMeaning The code meaning + * @param codingSchemeVersion The coding scheme version (might be empty if + * coding scheme is unique) + */ + CodeSequenceMacro(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent, + const OFString& codeValue, + const OFString& codingSchemeDesignator, + const OFString& codeMeaning, + const OFString& codingSchemeVersion = ""); + + /** Convenience constructor to set initial values + * @param codeValue The code value + * @param codingSchemeDesignator The coding scheme designator + * @param codeMeaning The code meaning + * @param codingSchemeVersion The coding scheme version (might be empty if + * coding scheme is unique) + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + CodeSequenceMacro(const OFString& codeValue, + const OFString& codingSchemeDesignator, + const OFString& codeMeaning, + const OFString& codingSchemeVersion = "", + IODComponent* parent = NULL); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of macro + * @return Name of the component ("CodeSequenceMacro") + */ + virtual OFString getName() const; + + /** Virtual Destructor + */ + virtual ~CodeSequenceMacro(); + + /** Get Code Value + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCodeValue(OFString &value, + const signed long pos = 0); + + /** Get Coding Scheme Designator + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCodingSchemeDesignator(OFString &value, + const signed long pos = 0); + + /** Get Coding Scheme Version + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCodingSchemeVersion(OFString &value, + const signed long pos = 0); + + /** Get Code Meaning + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCodeMeaning(OFString &value, + const signed long pos = 0); + + /** Returns whether code is empty, i.e. no component of the Code Sequence Macro + * is set. This can be used in order to find out whether someone actually + * wanted to fill in a valid code as opposed of leaving it unset. + * @return OFTrue if no component of this class is set, OFFalse otherwise. + */ + virtual OFBool empty(); + + /** Set Code Value + * @param value The value to set + * @param checkValue If OFTrue, VM and VR of value are checked + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setCodeValue(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Coding Scheme Designator + * @param value The value to set + * @param checkValue If OFTrue, VM and VR of value are checked + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setCodingSchemeDesignator(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Coding Scheme Version + * @param value The value to set + * @param checkValue If OFTrue, VM and VR of value are checked + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setCodingSchemeVersion(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Code Meaning + * @param value The value to set + * @param checkValue If OFTrue, VM and VR of value are checked + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setCodeMeaning(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set all values in this class conveniently + * @param value Code Value to set + * @param scheme Coding Scheme Designator to set + * @param meaning Code Meaning to set + * @param schemeVersion The Coding Scheme Designator version to set + * (optional) + * @param checkValue If OFTrue, VM and VR of values is checked + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition set(const OFString &value, + const OFString &scheme, + const OFString &meaning, + const OFString &schemeVersion = "", + const OFBool checkValue = OFTrue); + + virtual OFString toString(); + +}; + + +/** Code with Modifier(s). Represents the combination of a Code Sequence Macro + * that is amended by a Modifier Code Sequence with one or more items. The + * VM and requirement type of the Modifier Code Sequence can be configured, as + * well as the tag of the sequence holding the modifiers (default: Modifier + * Code Sequence). Overall, the class reads and write the following structure + * from an item: + * + * Coding Scheme Designator, 1, 1C + * Coding Scheme Version, 1, 1C + * Code Value, 1, 1C + * Code Meaning, 1, 1C + * Modifier Code Sequence, VM, requirement type + * > Code Sequence Macro + * + * Note that the Code Sequence Macro does not support Long Code Value and + * URN Code Value, so that Coding Scheme Designator and Code Value are + * handled as type 1 (and not 1C as denoted now in the standard and above). + */ +class DCMTK_DCMIOD_EXPORT CodeWithModifiers : public CodeSequenceMacro +{ + +public: + + /** Constructor + * @param modifierType Denotes type of Modifier Code Sequence (i.e. 1, 1C, + * 2, 2C or 3) + * @param modifierVM Denotes how many items are allowed in the Modifier Code + * Sequence + * @param modifierSeq Tag of the sequence that holds the modifier codes. + * The default is the Modifier Code Sequence. + */ + CodeWithModifiers(const OFString& modifierType, + const OFString& modifierVM = "1-n", + const DcmTagKey& modifierSeq = DCM_ModifierCodeSequence); + + /** Copy constructor, performs deep copy. + * @param rhs The component to be copied from + */ + CodeWithModifiers(const CodeWithModifiers& rhs); + + /** Assignment operator, performs deep copy. + * @param rhs The component to be assigned from + * @return Reference to this object + */ + CodeWithModifiers& operator=(const CodeWithModifiers& rhs); + + /** Virtual Destructor, frees memory + */ + virtual ~CodeWithModifiers(); + + /** Clear all attributes from the data that are handled by this component. + * An attribute is considered belonging to the module if there are rules + * marked as belonging to this module via the rule's module name. + */ + void clearData(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get rules handled by this module + * @return The rules + */ + OFshared_ptr getRules() + { + return m_Rules; + } + + /** Get name of component + * @return Name of the component + */ + virtual OFString getName() const; + + /** Get modifier code denoted by index + * @param index Index of modifier code to get (first modifier = 0) + * @return Code if modifier with index exists, NULL otherwise + */ + virtual CodeSequenceMacro* getModifier(const size_t index = 0); + + /** Adds modifier code + * @param modifier The code to be added + * @return EC_Normal if adding was successful, error otherwise + */ + virtual OFCondition addModifier(const CodeSequenceMacro& modifier); + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Check whether this component's data satisfies the underlying + * rules + * @param quiet If OFTrue, not error / warning messages will be produced. Only + * the returned error code will indicate error or OK. Per default, + * logging output is produced (OFFalse). + * @result EC_Normal if rules are satisfied, error otherwise + */ + virtual OFCondition check(const OFBool quiet = OFFalse); + + /** Comparison operator for IOD Components + * @param rhs The right hand side of the comparison + * @return 0, if the given object is equal to this object, other value otherwise + */ + virtual int compare(const IODComponent& rhs) const; + +private: + + /// Private undefined default constructor + CodeWithModifiers(); + + /// Items of Modifier Code Sequence + OFVector m_Modifiers; + + /// Type 1,2,3,1C or 2C + OFString m_ModifierType; + + /// 1, 1-n, 2-2n, ... + OFString m_ModifierVM; + + /// The sequence tag key that contains the modifier codes + DcmTagKey m_CodeModifierSeq; +}; + + + +/** Class implementing the SOP Instance Reference Macro + */ +class DCMTK_DCMIOD_EXPORT SOPInstanceReferenceMacro : public IODComponent +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + SOPInstanceReferenceMacro(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + SOPInstanceReferenceMacro(IODComponent* parent = NULL); + + /** Virtual Destructor + */ + virtual ~SOPInstanceReferenceMacro(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of macro + * @return Name of the module ("SOPInstanceReferenceMacro") + */ + virtual OFString getName() const; + + /** Get Referenced SOP Class UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedSOPClassUID(OFString &value, + const signed long pos = 0); + /** Get Referenced SOP Instance UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedSOPInstanceUID(OFString &value, + const signed long pos = 0); + /** Set Referenced SOP Class UID + * @param value The value to set + * @param checkValue If OFTrue, the value is checked regarding VM and VR + * @return EC_Normal, if successful, error otherwise + */ + virtual OFCondition setReferencedSOPClassUID(const OFString& value, + const OFBool checkValue = OFTrue); + /** Set Referenced SOP Instance UID + * @param value The value to set + * @param checkValue If OFTrue, the value is checked regarding VM and VR + * @return EC_Normal, if successful, error otherwise + */ + virtual OFCondition setReferencedSOPInstanceUID(const OFString& value, + const OFBool checkValue = OFTrue); +}; + + +/** Class representing the Series and Instance Reference Macro + */ +class DCMTK_DCMIOD_EXPORT IODSeriesAndInstanceReferenceMacro : public IODComponent +{ + +public: + + // Forward declaration + class ReferencedSeriesItem; + + /** Constructor + * @param data The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + IODSeriesAndInstanceReferenceMacro(OFshared_ptr data, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent component of this class (if applicable, might + * be NULL) + */ + IODSeriesAndInstanceReferenceMacro(IODComponent* parent = NULL); + + /** Virtual Destructor + */ + virtual ~IODSeriesAndInstanceReferenceMacro(); + + /** Read Series and Instance Reference Macro from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data is deleted before + * reading (default) + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write Series and Instance Reference Macro to given item + * @param destination The item to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Get name of module ("SeriesAndInstanceReferenceMacro") + * @return Name of the module ("SeriesAndInstanceReferenceMacro") + */ + virtual OFString getName() const; + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Clear (removes) all attributes handled by the modules of this component. + * Rules are not reset. + */ + virtual void clearData(); + + /** Return reference to list of Referenced Series items + * @return Reference to list of Reference Series Items + */ + OFVector& getReferencedSeriesItems(); + +private: + + /// Vector with all items of the Referenced Series Sequence + OFVector m_ReferencedSeriesItems; + + /// Name of this component ("SeriesAndInstanceReferenceMacro") + static const OFString m_ComponentName; + +}; + + +/** Class representing Items from the Referenced Series Sequence: + * + * [Referenced Series Sequence: (SQ, VM 1-n, Type 1C)] + * > Series Instance UID: (UI, 1, 1) + * > Referenced Instance Sequence: (SQ, 1-n, 1) + * >> SOP Instance Reference Macro + * + */ +class DCMTK_DCMIOD_EXPORT IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem : public IODComponent +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + ReferencedSeriesItem(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent component of this class (if applicable, might + * be NULL) + */ + ReferencedSeriesItem(IODComponent* parent = NULL); + + /** Destructor + */ + virtual ~ReferencedSeriesItem(); + + /** Clear (removes) all attributes handled by the modules of this component. + * Rules are not reset. + */ + virtual void clearData(); + + /** Read Referenced Series Sequence item data from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data is cleared before reading + * @return EC_Normal if data could be read successfully, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write this Referenced Series Sequence item data to given item + * @param destination The item to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values. + */ + virtual void resetRules(); + + /** Get name of module ("SeriesAndInstanceReferenceMacro") + * @return Name of the module ("SeriesAndInstanceReferenceMacro") + */ + virtual OFString getName() const; + + /** Get Series Instance UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** Set Series Instance UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR and VM if enabled + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString& value, + const OFBool checkValue = OFTrue); + + virtual OFCondition addReference(const OFString& sopClassUID, + const OFString& sopInstanceUID); + + /** Get content of the Referenced Instance Sequence + * @return Reference to the Referenced Instance Sequence content + */ + virtual OFVector& getReferencedInstanceItems(); + +private: + + /// The name of this component ("SeriesAndInstanceReferenceMacro") + static const OFString m_ComponentName; + + /// Vector containing the data of all items of the Referenced Instance Sequence + OFVector m_ReferencedInstanceSequence; +}; + + +/** Class representing the Image SOP Instance Reference Macro + */ +class DCMTK_DCMIOD_EXPORT ImageSOPInstanceReferenceMacro : public SOPInstanceReferenceMacro +{ + +public: + + /** Constructor + */ + ImageSOPInstanceReferenceMacro(); + + /** Virtual Destructor + */ + virtual ~ImageSOPInstanceReferenceMacro(); + + /** Creates an ImageSOPInstanceReferenceMacro object without frame/segment + * reference from required information. + * @param sopClassUID The SOP Class UID of the reference + * @param sopInstanceUID The SOP Instance UID of the reference + * @param result Returns the resulting object if successful, NULL otherwise + * @return EC_Normal if creation was successful, error code otherwise + */ + static OFCondition create(const OFString& sopClassUID, + const OFString& sopInstanceUID, + ImageSOPInstanceReferenceMacro*& result); + + /** Creates an ImageSOPInstanceReferenceMacro object with frame or segment + * references from required information. + * @param sopClassUID The SOP Class UID of the reference + * @param sopInstanceUID The SOP Instance UID of the reference + * @param refFramesOrSegments Reference to specific frames of an image or + * segments of a Segmentation object. The decision (image or + * segmentation) is based on the SOP Class; in case it is the + * Segmentation Storage SOP Class, the parameter is interpreted + * as segment references, otherwise as frame references. If this + * parameter is provided empty, then no frame/segment reference is + * set at all. + * @param result Returns the resulting object if successful, NULL otherwise + * @return EC_Normal if creation was successful, error code otherwise + */ + static OFCondition create(const OFString& sopClassUID, + const OFString& sopInstanceUID, + const OFVector& refFramesOrSegments, + ImageSOPInstanceReferenceMacro*& result); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type + * @param rhs The right hand side of the comparison + * @return 0 If the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the rhs object, or all compared components match + * but the rhs component is shorter. Also returned if rhs cannot be + * casted to DcmAttributeTag. + * 1 if either the value of the first component that does not match + * is greater in the rhs object, or all compared components match + * but the rhs component is longer. + */ + virtual int compare(const IODComponent& rhs) const; + + /** Clear data + */ + virtual void clear(); + + /** Read Image SOP Instance Reference Macro from given item + * @param source The item to read from + * @param clearOldData If OFTrue (default), old data is cleared before reading + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write Image SOP Instance Reference Macrom to given item + * @param item The item to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Get Referenced Frame Number + * @param values Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedFrameNumber(OFVector &values); + + /** Get Referenced Segment Number + * @param values Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedSegmentNumber(OFVector &values); + + /** Set Referenced Frame Number + * @param values The frame numbers that shoule be referenced + * @param checkValue If OFTrue (default) the given values will be checked + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition setReferencedFrameNumber(const OFVector& values, + const OFBool checkValue = OFTrue); + /** Add a Referenced Frame Number + * @param value The frame number to add + * @param checkValue If OFTrue, consistency checks are performed (as possible) + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition addReferencedFrameNumber(const Uint16& value, + const OFBool checkValue = OFTrue); + /** Set the Referenced Segment Numbers + * @param values The segment numbers to add + * @param checkValue If OFTrue, consistency checks are performed (as possible) + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition setReferencedSegmentNumber(const OFVector& values, + const OFBool checkValue = OFTrue); + + /** Add a Referenced Segment Number + * @param value The segment number to add + * @param checkValue If OFTrue, consistency checks are performed (as possible) + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition addReferencedSegmentNumber(const Uint16& value, + const OFBool checkValue = OFTrue); + +private: + + // DICOM attributes. + // The comments for each attribute describe "Name: (VR, VM, Type)". + // See DICOM standard for further reference. + + /// Referenced Frame Number: (IS, 1-n, 1C) + DcmIntegerString ReferencedFrameNumber; + + /// Referenced Segment Number: (US, 1-n, 1C) + DcmUnsignedShort ReferencedSegmentNumber; + +}; + + +/** Class representing the Primary Anatomic Structure Macro + */ +typedef CodeWithModifiers PrimaryAnatomicStructureMacro; + +/** Class representing the General Anatomy Mandatory or Optional Macro + */ +class DCMTK_DCMIOD_EXPORT GeneralAnatomyMacro +{ + +public: + + /** Constructor + * @param type Type of Anatomic Region Sequence. Permitted values: If 1, + * the class represents the "General Anatomy Mandatory Macro", if + * type 2 then it behaves like the "General Anatomy Required Macro", + * and type 3 like the "General Anatomy Optional Macro". Other values + * are interpreted as type 3 (optional). + */ + GeneralAnatomyMacro(const OFString& type); + + /** Copy constructor, creates deep copy. + * @param rhs The macro to copy from + */ + GeneralAnatomyMacro(const GeneralAnatomyMacro& rhs); + + /** Virtual destructor + */ + virtual ~GeneralAnatomyMacro(); + + /** Clear (removes) all attributes handled by the modules of this component. + */ + virtual void clearData(); + + /** Check whether this component's data satisfies the underlying + * rules + * @param quiet If OFTrue, not error / warning messages will be produced. + * Only the returned error code will indicate error or OK. Per + * default, logging output is produced (OFFalse). + * @result EC_Normal if rules are satisfied, error otherwise + */ + virtual OFCondition check(const OFBool quiet = OFFalse); + + /** Return Anatomic Region + * @return Reference to Anatomic Region Code + */ + virtual CodeSequenceMacro& getAnatomicRegion(); + + /** Return Anatomic Region Modifier Codes + * @return Reference to Anatomic Region Modifier codes + */ + virtual OFVector& getAnatomicRegionModifier(); + + /** Return anatomic structure + * @return Reference to anatomic structure macro + */ + virtual PrimaryAnatomicStructureMacro& getPrimaryAnatomicStructure(); + + /** Reads Anatomic Region Sequence and Primary Anatomic Structure Macro from + * given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data is cleared before reading, + * otherwise it is kept/overwritten. + * @return EC_Normal if no error, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write Anatomic Region Sequence and Primary Anatomic Structure Macro to + * given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Assignment operator (performs deep copy) + * @param rhs The macro to copy from + * @return Reference to "this" object + */ + GeneralAnatomyMacro& operator=(const GeneralAnatomyMacro &rhs); + + /** Comparison operator that compares the normalized value of this object + * with a given object of the same type, i.e.\ the elements within both + * objects (this and rhs parameter) are compared by value. + * @param rhs the right hand side of the comparison + * @return 0 if the object values are equal. + * -1 if either the value of the first component that does not match + * is lower in the rhs object, or all compared components match + * but the rhs component is shorter. + * 1 if either the value of the first component that does not match + * is greater in the rhs object, or all compared components match + * but the rhs component is longer. + */ + virtual int compare(const GeneralAnatomyMacro& rhs) const; + +private: + + /// Type (1,2,3) of Anatomic Region Sequence. + OFString m_Type; + + /// Anatomic Region Sequence (SQ, 1, 1) (Code Sequence Macro within item of + /// Anatomic Region Sequence)) + CodeSequenceMacro m_AnatomicRegion; + + /// Anatomic Region Modifier Macro (within item of Anatomic Region Sequence) + OFVector m_AnatomicRegionModifier; + + /// Primary Anatomic Structure Macro (on the same level as Anatomic + /// Region Sequence) + PrimaryAnatomicStructureMacro m_PrimaryAnatomicStructure; +}; + + +/** Class representing the Algorithm Identification Macro + */ +class DCMTK_DCMIOD_EXPORT AlgorithmIdentificationMacro +{ + +public: + + /** Constructor + */ + AlgorithmIdentificationMacro(); + + /** Virtual destructor + */ + virtual ~AlgorithmIdentificationMacro(); + + /** Clear (removes) all attributes handled by the modules of this component. + */ + virtual void clearData(); + + /** Perform consistency checks + * @param quiet If OFTrue, not error / warning messages will be produced. + * Only the returned error code will indicate error or OK. Per + * default, logging output is produced (OFFalse). + * @result EC_Normal if rules are satisfied, error otherwise + */ + virtual OFCondition check(const OFBool quiet = OFFalse); + + /** Return Algorithm Family Code + * @return Reference to algorithm family code + */ + virtual CodeSequenceMacro& getAlgorithmFamilyCode(); + + /** Get Algorithm Name Code + * @return Algorithm Name Code + */ + virtual CodeSequenceMacro& getAlgorithmNameCode(); + + /** Get Algorithm Name + * @param value Reference variable to store the value to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getAlgorithmName(OFString& value, + const signed long pos = 0); + + /** Get Algorithm Version + * @param value Reference variable to store the value to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getAlgorithmVersion(OFString& value, + const signed long pos = 0); + + /** Get Algorithm Parameters + * @param value Reference variable to store the value to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getAlgorithmParameters(OFString& value, + const signed long pos = 0); + /** Get Algorithm Source + * @param value Reference variable to store the value to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getAlgorithmSource(OFString& value, + const signed long pos = 0); + + /** Set Algorithm Name + * @param value The value to be set + * @param checkValue If OFTrue, the given value is checked + * @return EC_Normal, if value could be set, error otherwise + */ + virtual OFCondition setAlgorithmName(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Algorithm Version + * @param value The value to be set + * @param checkValue If OFTrue, the given value is checked + * @return EC_Normal, if value could be set, error otherwise + */ + virtual OFCondition setAlgorithmVersion(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Algorithm Parameters + * @param value The value to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal, if value could be set, error otherwise + */ + virtual OFCondition setAlgorithmParameters(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Algorithm Source + * @param value The value to be set + * @param checkValue If OFTrue, the given value is checked + * @return EC_Normal, if value could be set, error otherwise + */ + virtual OFCondition setAlgorithmSource(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Reads this macro from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data is cleared before reading, + * otherwise it is kept/overwritten + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write this macro to given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + +private: + + /// Code Sequence Macro from Algorithm Family Code Sequence (single item), + /// (SQ, VM 1, Type 1) + CodeSequenceMacro m_AlgorithmFamilyCode; + + /// Code Sequence Macro from Algorithm Name Code Sequence (single item) + /// (SQ, VM 1, Type 3) + CodeSequenceMacro m_AlgorithmNameCode; + + /// Algorithm Name: (LO, VM 1, Typ 1) + DcmLongString m_AlgorithmName; + + /// Algorithm Version: (LO, VM 1, Typ 1) + DcmLongString m_AlgorithmVersion; + + /// Algorithm Parameters: (LT, VM 1, Typ 3) + DcmLongText m_AlgorithmParameters; + + /// Algorithm Source: (LO, VM 1, Typ 3) + DcmLongString m_AlgorithmSource; +}; + + +/** Content Identification Macro + */ +class DCMTK_DCMIOD_EXPORT ContentIdentificationMacro +{ + +public: + + /** Class representing an Alternate Content Description item + */ + class DCMTK_DCMIOD_EXPORT AlternateContentDescriptionItem + { + public: + + /** Constructor + */ + AlternateContentDescriptionItem(); + + /** Virtual destructor + */ + virtual ~AlternateContentDescriptionItem(); + + /** Clear (removes) all attributes handled by the modules of this component. + */ + virtual void clearData(); + + /** Get Content Description + * @param value Reference variable to store the value to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition getContentDescription(OFString& value, + const signed long pos = 0); + /** Get Language Code + * @return Reference to the language code + */ + virtual CodeSequenceMacro& getLanguageCode(); + + /** Set Content Description + * @param value The value to set + * @param checkValue If OFTrue, consistency check is performed + * @result EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setContentDescription(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Read Alternate Content Description Sequence item from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data is cleared before reading, + * otherwise it is kept/overwritten + * @result EC_Normal, if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write alternate content description item to given item + * @param item The item to write to + * @result EC_Normal, if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + private: + + /// Content Description: (LO, VM 1, Type 1) + DcmLongString m_ContentDescription; + + /// Item of Language Code Sequence: (SQ, VM 1, Type 1) + CodeSequenceMacro m_LanguageCode; + }; + + /** Constructor + */ + ContentIdentificationMacro(); + + /** Constructor initializing basic data + * @param instanceNumber Instance Number + * @param contentLabel Content Label + * @param contentDescription Content Description, may be empty + * @param contentCreatorName Content Creator's Name, may be empty + */ + ContentIdentificationMacro(const OFString& instanceNumber, + const OFString& contentLabel, + const OFString& contentDescription, + const OFString& contentCreatorName); + + /** Copy constructor + * @param rhs The macro to copy from (deep copy) + */ + ContentIdentificationMacro(const ContentIdentificationMacro& rhs); + + /** Create Content Identification Macro with minimally required data. + * @param instanceNumber Instance Number + * @param contentLabel Content Label + * @param contentDescription Content Description, may be empty + * @param contentCreatorName Content Creator's Name, may be empty + * @param result Returns created macro if successful, NULL otherwise + * @return EC_Normal if creation was successful, error otherwise + */ + static OFCondition create(const OFString& instanceNumber, + const OFString& contentLabel, + const OFString& contentDescription, + const OFString& contentCreatorName, + ContentIdentificationMacro*& result); + + /** Assignment operator (deep copy) + * @param rhs The macro to copy from + * @return Reference to "this" object + */ + ContentIdentificationMacro& operator=(const ContentIdentificationMacro& rhs); + + /** Virtual destructor + */ + virtual ~ContentIdentificationMacro(); + + /** Get rules for this data structure + * @return Reference to the rules + */ + virtual IODRules& getIODRules(); + + /** Clear (removes) all attributes handled by the modules of this component. + */ + virtual void clearData(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of macro + * @return Name of the module ("ContentIdentificationMacro") + */ + virtual OFString getName() const; + + + /** Check whether this component's data satisfies the underlying + * rules + * @param quiet If OFTrue, not error / warning messages will be produced. + * Only the returned error code will indicate error or OK. Per + * default, logging output is produced (OFFalse). + * @result EC_Normal if rules are satisfied, error otherwise + */ + virtual OFCondition check(const OFBool quiet = OFFalse); + + /** Get Instance Number + * @param value Variable to store the result to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getInstanceNumber(OFString& value, + const signed long pos = 0) const; + + /** Get Content Label + * @param value Variable to store the result to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getContentLabel(OFString& value, + const signed long pos = 0) const; + + /** Get Content Description + * @param value Variable to store the result to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getContentDescription(OFString& value, + const signed long pos = 0) const; + + /** Get Alternate Content Description items + * @return Reference to the items + */ + virtual OFVector& getAlternateContentDescription(); + + /** Get Content Creator Name + * @param value Variable to store the result to + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getContentCreatorName(OFString& value, + const signed long pos = 0) const; + + /** Get Content Creator Identification Code + * @return Reference to code + */ + virtual CodeSequenceMacro& getContentCreatorIdentificationCode(); + + /** Set Instance Number + * @param value Value to be set + * @param checkValue If OFTrue, value is checked for validity + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setInstanceNumber(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Content Label + * @param value Value to be set + * @param checkValue If OFTrue, value is checked for validity + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setContentLabel(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Content Description + * @param value Value to be set + * @param checkValue If OFTrue, value is checked for validity + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setContentDescription(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Content Creator Name + * @param value Value to be set + * @param checkValue If OFTrue, value is checked for validity + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setContentCreatorName(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Reads Content Identification Macro from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data is cleared before reading, otherwise + * it is kept/overwritten + * @return EC_Normal if reading was successful, an error code otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write Content Identification Macro to given item + * @param item The item to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + +private: + + // Instance Number: (IS, VM 1, Type 1) + DcmIntegerString m_InstanceNumber; + + /// Content Label: (CS, VM 1, Type 1) + DcmCodeString m_ContentLabel; + + /// Content Description: (LO, VM 1, Type 1) + DcmLongString m_ContentDescription; + + // Alternate Content Description Sequence (VM 1-n, Type 3) + OFVector m_AlternateContentDescription; + + /// Content Creator's Name: (LO, VM 1, Type 2) + DcmPersonName m_ContentCreatorName; + + /// Content Creator's Identification Code Sequence + CodeSequenceMacro m_ContentCreatorIdentificationCode; + + /// IOD rules for this data structure + IODRules m_IODRules; +}; + + +/** Class representing the HL7 V2 Hierarchic Designator Macro + */ +class DCMTK_DCMIOD_EXPORT HL7HierarchicDesignatorMacro : public IODComponent +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + HL7HierarchicDesignatorMacro(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + HL7HierarchicDesignatorMacro(IODComponent* parent = NULL); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of macro + * @return Name of the module ("HL7HierarchicDesignatorMacro") + */ + virtual OFString getName() const; + + /** Get Local Namespace Entity ID + * @param value Variable to store the result to + * @param pos The index (0..VM) of the value to get + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getLocalNamespaceEntityID(OFString& value, + const signed long pos = 0) const; + + /** Get Universal Entity ID + * @param value Variable to store the result to + * @param pos The index (0..VM) of the value to get + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getUniversalEntityID(OFString& value, + const signed long pos = 0) const; + + /** Get Universal Entity ID Type + * @param value Variable to store the result to + * @param pos The index (0..VM) of the value to get + * @return EC_Normal if value could be get, error otherwise + */ + virtual OFCondition getUniversalEntityIDType(OFString& value, + const signed long pos = 0) const; + + /** Set Local Namespace Entity ID + * @param value Value to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setLocalNamespaceEntityID(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Universal Entity ID + * @param value Value to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setUniversalEntityID(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Universal Entity ID Type + * @param value Value to be set + * @param checkValue If OFTrue, value is checked for validity + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setUniversalEntityIDType(const OFString& value, + const OFBool checkValue = OFTrue); +}; + +/** Class representing the Mandatory View and Slice Progression Direction Macro + */ + +class DCMTK_DCMIOD_EXPORT MandatoryViewAndSliceProgressionDirectionMacro : public IODComponent +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set where this classes rules are added to. If NULL, + * the class creates an empty rule set. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + MandatoryViewAndSliceProgressionDirectionMacro(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + MandatoryViewAndSliceProgressionDirectionMacro(IODComponent* parent = NULL); + + /** Clear (removes) all attributes handled by the modules of this component. + */ + virtual void clearData(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of macro + * @return Name of the module ("MandatoryViewAndSliceProgressionDirectionMacro") + */ + virtual OFString getName() const; + + /** Read Mandatory View and Slice Progression Direction Macro from given item + * @param source The item to read from + * @param clearOldData If OFTrue (default), old data is cleared + * before reading + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write Mandatory View and Slice Progression Direction Macro to given item + * @param item The item to write to + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Get View Code + * @return Reference to code + */ + virtual CodeSequenceMacro& getViewCode(); + + /** Get View Modifier Code + * @return Reference to code + */ + virtual OFVector& getViewModifierCode(); + + +protected: + + /// View Code Sequence (SQ, VM 1, type 1) + CodeSequenceMacro m_ViewCodeSequence; + + /// View Modifier Code Sequence (SQ, VM 1-n, type 2C) + OFVector m_ViewModifierCode; +}; + +#endif // IODMACRO_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodreferences.h b/dcmiod/include/dcmtk/dcmiod/iodreferences.h new file mode 100644 index 00000000..5d037e2f --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodreferences.h @@ -0,0 +1,364 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing SOP references as used in different modules + * + */ + +#ifndef IODREFERENCES_H +#define IODREFERENCES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmiod/ioddef.h" + +// Forward declaration +class DcmItem; + +/** Class that represents a reference to another DICOM objects. DICOM uses + * different types of references for different purposes: Sometimes only SOP + * Class UID and SOP Instance UID are required, sometimes also Series and + * Study Instance UIDs. Also, in different IOD modules and macros DICOM uses + * different attributes to store those references in objects. Sometimes the + * same references are even required in different structures within the same + * object. + * This class can carry identifiers for Patient, Study, Series and Instance + * level and can be passed around in order to write them as required into + * the attribute structures needed by a specific DIOCM IOD, module or macro. + */ +class DCMTK_DCMIOD_EXPORT IODReference +{ + public: + /// The maximum DICOM entity level that this reference refers to. This is + /// mostly used in order to check whether a reference is complete or not. + enum MAX_LEVEL + { + /// Instance Level + LEVEL_INSTANCE, + /// Series Level + LEVEL_SERIES, + /// Study level + LEVEL_STUDY, + /// Patient level + LEVEL_PATIENT + }; + + /// Type of reference + enum TYPE + { + /// Generic (or unknown) + GENERIC, + /// Reference to an image object, see also class IODImageReference + IMAGE, + /// Reference to a segmentation object, see also class IDOSegmentationReference + SEGMENT + }; + + /** Constructor, creates empty reference, default level is "STUDY" + */ + IODReference(); + + /** Constructor, creates empty reference with specified level + * @param level The reference level + */ + IODReference(const MAX_LEVEL level); + + /** Destructor + */ + virtual ~IODReference(); + + /** Create (deep) clone copy of this reference + * @return Returns eep copy of this reference or NULL in case of error + */ + virtual IODReference* clone() const; + + /** Get type of reference. Base class always returns "GENERIC" + * @return Returns "GENERIC" type + */ + virtual TYPE getType() const {return GENERIC; } + + /** Check whether this reference is valid, i.e. complete related to its + * level. Also in case of UIDs it is checked whether they conform to the + * UI Value Representation definition. + * @return EC_Normal if reference is valid, error otherwise + */ + virtual OFCondition check() const; + + /** Returns reference as a one line string. Mostly useful for debugging. + * @return Reference as a string. + */ + virtual OFString toString() const; + + /** Initializes this reference from given file, i.e. extracts all identifiers + * up to the level defined for this reference. + * @param filename The file to read from + * @return Returns OFTrue if reference could be read, otherwise OFFalse + */ + virtual OFBool readFromFile(const OFString& filename); + + /** Initializes this reference from given item, i.e. extracts all identifiers + * up to the level defined for this reference. + * @param item The item to read from + * @return Returns OFTrue if reference could be read, otherwise OFFalse + */ + virtual OFBool readFromItem(DcmItem& item); + + /** Clear all reference data + */ + virtual void clear(); + + /// Patient ID + OFString m_PatientID; + + /// Study Instance UID + OFString m_StudyInstanceUID; + + /// Series Instance UID + OFString m_SeriesInstanceUID; + + /// SOP Class UID + OFString m_SOPClassUID; + + /// SOP Instance UID + OFString m_SOPInstanceUID; + + /// Maximum level this reference refers to. E.g. for level SERIES, only + /// Series, SOP Instance and SOP Class UID must be provided. However, + // setting the Patient ID too does not harm. + MAX_LEVEL m_Level; +}; + + +/** Class representing a reference to an image. Compared to IODReference, this + * class also allows to provide references to specific frames + */ +class DCMTK_DCMIOD_EXPORT IODImageReference : public IODReference +{ + public: + + /** Default constructor, uses level STUDY + */ + IODImageReference(); + + /** Constructor allowing to set reference level. + * @param level The maximum level this reference should deal with + */ + IODImageReference(const MAX_LEVEL level); + + /** Convenience constructor setting reference data including frame numbers + * @param patientID Patient ID + * @param studyUID Study Instance UID + * @param seriesUID Series Instance UID + * @param sopInstanceUID SOP Instance UID + * @param sopClassUID SOP Class UID + * @param refFrameNumbers Referenced Frame Numbers + */ + IODImageReference(const OFString& patientID, + const OFString& studyUID, + const OFString& seriesUID, + const OFString& sopInstanceUID, + const OFString& sopClassUID, + const OFVector& refFrameNumbers); + + /** Convenience constructor setting reference data without frame numbers + * @param patientID Patient ID + * @param studyUID Study Instance UID + * @param seriesUID Series Instance UID + * @param sopInstanceUID SOP Instance UID + * @param sopClassUID SOP Class UID + */ + IODImageReference(const OFString& patientID, + const OFString& studyUID, + const OFString& seriesUID, + const OFString& sopInstanceUID, + const OFString& sopClassUID); + + /** Get (deep) clone copy of this reference + * @return Returns deep copy of this reference, or NULL in case of error + */ + virtual IODReference* clone() const; + + /** Get type (always returns IMAGE type) + * @return Returns IMAGE type + */ + virtual TYPE getType() const {return IMAGE; } + + // Avoid overridden virtual function warning, i.e. tell the compiler that + // we want to have both functions to be polymorph and available to the user. + using IODReference::readFromFile; + + /** Initialize reference from given file + * @param filename The file to read from + * @param frameNumbers The frame numbers to reference. It is not checked + * (so far) whether the referenced image file actually contains + * such frames. First frame is denoted by 1. + * @return OFTrue if initialization was successful, OFFalse otherwise + */ + virtual OFBool readFromFile(const OFString& filename, + const OFVector frameNumbers); + /** Destructor + */ + virtual ~IODImageReference() {} + + /** Clear reference data + */ + virtual void clear(); + + /// Referenced frame numbers + OFVector m_ReferencedFrameNumber; +}; + + +/** Class representing a reference to a Segmentation. Compared to IODReference, + * this class also allows to provide references to specific segments by + * referencing the value of their Segment Number attribute. + */ +class DCMTK_DCMIOD_EXPORT IODSegmentationReference : public IODReference +{ + public: + + /** Constructor allowing to set reference level. + * @param level The maximum level this reference should deal with + */ + IODSegmentationReference(const MAX_LEVEL level); + + /** Default constructor, uses level STUDY + */ + IODSegmentationReference(); + + /** Get (deep) clone copy of this reference + * @return Returns deep copy of this reference, or NULL in case of error + */ + virtual IODReference* clone() const; + + /** Get type (always returns SEGMENT type) + * @return Returns SEGMENT type + */ + virtual TYPE getType() const {return SEGMENT; } + + // Avoid overridden virtual function warning, i.e. tell the compiler that + // we want to have both functions to be polymorph and available to the user. + using IODReference::readFromFile; + + /** Initialize reference from given file + * @param filename The file to read from + * @param segmentNumbers The segment numbers to reference. It is not + * checked (so far) whether the referenced image file actually + * contains such Segment Numbers. First segment is 1. + * @return OFTrue if initialization was successful, OFFalse otherwise + */ + virtual OFBool readFromFile(const OFString& filename, + const OFVector segmentNumbers); + + /** Destructor + */ + virtual ~IODSegmentationReference() {} + + /** Clear reference data + */ + virtual void clear(); + + /// Referenced Segment Numbers + OFVector m_ReferencedSegmentNumber; +}; + + +/** Class that holds a set of IODReference instances (or its sub classes) and + * offers helper functionality to read and write such references + */ +class DCMTK_DCMIOD_EXPORT IODReferences +{ + + public: + + /** Default constructor + */ + IODReferences(); + + /** Copy constructor, performs deep copy of provided references + * @param rhs The references to assign + */ + IODReferences(const IODReferences& rhs); + + /** Assignment operator, copies all provided references + */ + IODReferences& operator=(const IODReferences& rhs); + + /** Destructor, frees memory + */ + virtual ~IODReferences(); + + /** Initialize references by reading the Referenced Instance Sequence as + * used in the Tractography Results Module + * @param source The item to read from, must contain the Referenced + * Instance Sequence + * @return EC_Normal if all references could be read, IOD_EC_InvalidReference + * if no reference could be read, and IOD_EC_ReferencesOmitted if + * at least one reference could be read but at least one had also + * to be skipped. + */ + virtual OFCondition readTractographyReferencedInstanceSequence(DcmItem& source); + + /** Write references to Referenced Instance Sequence as used in the + * Tractography Results Module + * @param item The item to write to + * @return EC_Normal if all references could be written, error code + * otherwise + */ + virtual OFCondition writeTractographyReferencedInstanceSequence(DcmItem& item); + + /** Add reference to this set of references + * @param ref The reference to add (ownership is taken if adding is + * successful + * @return OFTrue if adding is successful, OFFalse otherwise + */ + virtual OFBool add(IODReference* ref); + + /** Initialize references from set of DICOM files. If a file could not be + * used, it is skipped. All references found by this method are added on + * top of existing ones, i.e. any existing data is not cleared by thi + * method. + * @param dcmFiles The DICOM file names to read + * @param maxLevel The maximum level to extract + * @return Returns number of references (successful files) that could be + * added + */ + virtual size_t addFromFiles(const OFVector& dcmFiles, + const IODReference::MAX_LEVEL maxLevel = IODReference::LEVEL_STUDY); + + /** Access references of this set (readonly) + * @return Returns references managed by this class + */ + const OFVector& get() const; + + /** Returns number of references managed by this class + * @return Returns number of references + */ + virtual size_t size() const; + + /** Clears all references + */ + virtual void clearData(); + + private: + + /// Set of references managed by this class + OFVector m_References; +}; + + +#endif // IODREFERENCES_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodrules.h b/dcmiod/include/dcmtk/dcmiod/iodrules.h new file mode 100644 index 00000000..0babf72a --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodrules.h @@ -0,0 +1,257 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing attribute rules as found in DICOM modules + * + */ + +#ifndef IODRULES_H +#define IODRULES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmdata/dctagkey.h" +#include "dcmtk/dcmiod/iodtypes.h" + +#define INCLUDE_OSTREAM // for debugging +#include "dcmtk/ofstd/ofstdinc.h" + + +class DcmItem; +class DcmTagKey; +class DcmElement; +class IODRule; + + +/** Class representing rules for a set of DICOM attributes, e.g.\ for + * all attributes of a module, macro or the like. At the moment + * attributes within sequences are not yet supported. + */ +class DCMTK_DCMIOD_EXPORT IODRules +{ + +public: + + /// iterator type to iterate over rule set + typedef OFMap::iterator iterator; + + /// const iterator type to iterate over rule set + typedef OFMap::const_iterator const_iterator; + + /** Constructor + */ + IODRules(); + + /** Returns deep copy of this object + * @return Deep copy of "this" object + */ + IODRules* clone(); + + /** Return iterator to first rule + * @return Iterator to the first rule + */ + iterator begin(); + + /** Return iterator to last rule + * @return Iterator to the last rule + */ + iterator end(); + + /** Adds rule to this rule set + * @param rule The rule to add (ownership is transferred to this class) + * @param overwriteExisting If OFTrue (default), an existing rule for the + * same attribute (tag) is overwritten, otherwise the rule is not + * taken over (and ownership stays with caller) + * @return OFTrue if rule could be added, error otherwise + */ + virtual OFBool addRule(IODRule* rule, + const OFBool overwriteExisting = OFFalse); + + /** Delete rule by given tag key + * @param key Tag of the attribute rule to be deleted + * @return OFTrue if a rule could be found and deleted, OFFalse otherwise + */ + virtual OFBool deleteRule(const DcmTagKey key); + + /** Get all rules that are marked belonging to a specific module + * @param moduleName The module name (e.g.\ "PatientModule") + * @return Vector with pointers to all the rules belonging to given module + */ + const OFVector getByModule(const OFString& moduleName); + + /** Get a rule by its tag + * @param key The tag to find the rule for + * @return The rule, if found, NULL otherwise + */ + IODRule* getByTag(const DcmTagKey& key) const; + + /** Clear all rules + */ + virtual void clear(); + + /** Dump rules to stream, useful for debugging + * @param out The stream to dump to + */ + virtual void dump(STD_NAMESPACE ostream &out); + + /** Destructor + */ + virtual ~IODRules(); + +private: + + /// Map that holds all rules, accessible by their tag key + OFMap m_Rules; +}; + + +/** Class representing a single rule, that refers to a single attribute. + * Each rule is uniquely identified by the attribute's tag key and includes + * information on the Value Multiplicity (VM) of the attribute, its type + * (1, 1C, 2,...), the module (e.g.\ "PatientModule") or structure (e.g. + * "CodeSequenceMacro") it belongs to, a default value and its private + * creator if it is a private attribute. On top, the Information Entity + * according to the DICOM Model of the Real World can be stored, e.g. + * "Patient" for the "PatientModule". + */ +class DCMTK_DCMIOD_EXPORT IODRule +{ +public: + + /** Constructor to create a new attribute rule + * @param key The tag key of the attribute + * @param VM The VM of the attribute (notation like in DICOM part 6, + * e.g.\ "1-n"), for sequences the number of items allowed. + * @param type The "IOD type" of the attribute. + * Allowed values "1", "1C", "2", "2C" and "3" + * @param module The module or "component" this attribute belongs to + * @param ie The Information Entity the module belongs to + * @param defaultValue The default value (default: empty) + * @param privateCreator The private creator of the attribute if attribute + * (default: No private creator) + */ + IODRule(const DcmTagKey& key, + const OFString& VM, + const OFString& type, + const OFString& module, + const DcmIODTypes::IOD_IE ie, + const OFString& defaultValue = "", + const OFString& privateCreator = ""); + + /** Return deep copy of this object + * @return Deep copy of "this" object + */ + IODRule* clone(); + + /** Get tag key of the attribute rule + * @return The tag key of the rule + */ + virtual DcmTagKey getTagKey() const; + + /** Get private creator of the related attribute + * @return The private creator of the attribute + */ + virtual OFString getPrivateCreator() const; + + /** The requirement type of the attribute (1, 1C, 2, 2C or 3) + * @return The requirement type of the attribute + */ + virtual OFString getType() const; + + /** The VM of the attribute as noted in the DICOM standard part 6, + * e.g.\ "1-n" or "2". For Sequences (VR SQ) whose VM is always 1 by the + * standard, this denotes the number of items permitted. + * @return The VM (or number of items permitted) + */ + virtual OFString getVM() const; + + /** Get module (or component name) the related attribute belongs to + * @return The module or component name (e.g.\ "PatientModule" or + * "CodeSequenceMacro") + */ + virtual OFString getModule() const; + + /** Get default value of this attribute + * @return The default value (might be empty) + */ + virtual OFString getDefaultValue() const; + + /** Get Information Entity the related attribute belongs to + * @return The Information Entity (might be empty) + */ + virtual DcmIODTypes::IOD_IE getIE() const; + + virtual OFBool setPrivateCreator(const OFString& val); + + virtual OFBool setType(const OFString& val); + + virtual OFBool setVM(const OFString& val); + + virtual OFBool setModule(const OFString& val); + + virtual OFBool setDefaultValue(const OFString& val); + + /** Check whether the given item fulfills the requirements of + * this rule, i.e.\ the related attribute is checked within the + * given item + * @param item The item to check the attribute in + * @param quiet If OFTrue, no error or warning messages will be produced + * but only the return code will indicate OK or error. + * @return EC_Normal if this rule is fulfilled, error otherwise + */ + virtual OFCondition check(DcmItem& item, + const OFBool quiet = OFFalse); + + /** Virtual Destructor + */ + virtual ~IODRule(); + +private: + + /// Private undefined default constructor + IODRule(); + + /// Private undefined copy constructor + IODRule(const IODRule& rhs); + + /// Tag key + DcmTagKey m_Key; + + /// VM, see DcmElement::checkVM() for permitted values (e.g.\ "1-n") + OFString m_VM; + + /// Requirement type: 1, 1C, 2, 2C or 3 + OFString m_Type; + + /// Module (e.g.\ "PatientModule" or "component name", e.g.\ "CodeSequenceMacro" + OFString m_Module; + + /// The Information Entity the related attribute belongs to according to the + /// DICOM Model of the Real World, e.g.\ "Patient" for the attribute + /// "Patient Name" + DcmIODTypes::IOD_IE m_IE; + + /// Default value for attribute + OFString m_DefaultValue; + + /// Private Creator (if private attribute) + OFString m_PrivateCreator; +}; + +#endif // IODRULES_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodtypes.h b/dcmiod/include/dcmtk/dcmiod/iodtypes.h new file mode 100644 index 00000000..d282ace9 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodtypes.h @@ -0,0 +1,143 @@ +/* + * + * Copyright (C) 2015-2019, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing common types needed by dcmiod module + * + */ + +#ifndef IODTYPES_H +#define IODTYPES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmiod/ioddef.h" +#include "dcmtk/dcmiod/cielabutil.h" + +// ---------------------------------------------------------------------------- +// Define the loggers for this module +// ---------------------------------------------------------------------------- + +extern DCMTK_DCMIOD_EXPORT OFLogger DCM_dcmiodLogger; + +#define DCMIOD_TRACE(msg) OFLOG_TRACE(DCM_dcmiodLogger, msg) +#define DCMIOD_DEBUG(msg) OFLOG_DEBUG(DCM_dcmiodLogger, msg) +#define DCMIOD_INFO(msg) OFLOG_INFO(DCM_dcmiodLogger, msg) +#define DCMIOD_WARN(msg) OFLOG_WARN(DCM_dcmiodLogger, msg) +#define DCMIOD_ERROR(msg) OFLOG_ERROR(DCM_dcmiodLogger, msg) +#define DCMIOD_FATAL(msg) OFLOG_FATAL(DCM_dcmiodLogger, msg) + + +// ---------------------------------------------------------------------------- +// Error constants +// ---------------------------------------------------------------------------- + +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_WrongSOPClass; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_MissingAttribute; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_MissingSequenceData; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_InvalidDimensions; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_CannotInsertFrame; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_InvalidPixelData; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_InvalidObject; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_CannotDecompress; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_NoSuchRule; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_InvalidLaterality; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_InvalidElementValue; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_InvalidReference; +extern DCMTK_DCMIOD_EXPORT const OFConditionConst IOD_EC_ReferencesOmitted; + + +/** Class that wraps some constant definitions in the context of IODs + */ +class DCMTK_DCMIOD_EXPORT DcmIODTypes +{ + +public: + + /** Struct representing a single frame + */ + struct Frame + { + /// Array for the pixel data bytes + Uint8* pixData; + /// Number of pixel data bytes (i.e.\ Bits Allocated) + size_t length; + /// Destructor, frees memory + ~Frame() {delete[] pixData;pixData = NULL;} + }; + + /** IOD Information Entities (incomplete list, extended as needed) + */ + enum IOD_IE + { + /// Undefined Information Entity (i.e.\ no value set) + IE_UNDEFINED, + /// Patient Entity + IE_PATIENT, + /// Study Entity + IE_STUDY, + /// Series Entity + IE_SERIES, + /// Frame of Reference Entity + IE_FOR, + /// Equipment Entity + IE_EQUIPMENT, + /// Image Entity + IE_IMAGE, + //// Meta Entity: Instance covering image, waveform, etc. + IE_INSTANCE + }; + + /** Enumerated values for attribute "Laterality" + */ + enum IOD_LATERALITY + { + /// Undefined (e.g.\ value not set) + LATERALITY_UNDEFINED, + /// Left body part + LATERALITY_L, + /// Right body part + LATERALITY_R + }; + + /** Enhanced US Image Module: Image Type (first value) + */ + enum IOD_ENHUSIMAGETYPE + { + /// Unknown + IMAGETYPE_UNKNOWN, + /// ORIGINAL + IMAGETYPE_ORIGINAL, + /// DERIVED + IMAGETYPE_DERIVED + }; + + +private: + + /** Private undefined default constructor + */ + DcmIODTypes() {}; + + /** Private undefined destructor + */ + ~DcmIODTypes() {}; + +}; + + +#endif // IODTYPES_H diff --git a/dcmiod/include/dcmtk/dcmiod/iodutil.h b/dcmiod/include/dcmtk/dcmiod/iodutil.h new file mode 100644 index 00000000..ae0098c2 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/iodutil.h @@ -0,0 +1,949 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Static helper functionality for dcmiod module + * + */ + +#ifndef IODUTIL_H +#define IODUTIL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftraits.h" // for OFremove_pointer +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcdatutl.h" +#include "dcmtk/ofstd/ofdate.h" +#include "dcmtk/ofstd/oftime.h" +#include "dcmtk/dcmiod/ioddef.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/iodtypes.h" + +/** Class with helper functions used within the dcmiod module (and beyond) + */ +class DCMTK_DCMIOD_EXPORT DcmIODUtil +{ + +public: + + /** Get element from dataset and check it for correct value multiplicity + * and type. + * @param dataset DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also + * (be 'const'.) + * @param delem DICOM element used to store the value (always creates + * a copy of the dataset element's value) + * @param vm Value multiplicity (according to the data dictionary) to be + * checked for. (See DcmElement::checkVM() for a list of valid + * values.) Interpreted as cardinality (number of items) for + * sequence attributes. + * @param type Value type (valid value: "1", "1C", "2", something else + * which is not checked) + * @param moduleName Optional module name to be printed (NULL: no module + * printed at all) + * @return EC_Normal if element could be retrieved and value is correct, + * an error code otherwise + */ + static OFCondition getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement &delem, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL); + + /** Get element from dataset and check it for correct value multiplicity and + * type. + * @param dataset DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also + * be 'const') + * @param tagKey Tag key of the element to get + * @param delem DICOM element that is set to a copy of the dataset's + * orinal element + * @param vm Value multiplicity (according to the data dictionary) to be + * checked for. (See DcmElement::checkVM() for a list of valid + * values.) Interpreted as cardinality (number of items) for + * sequence attributes. + * @param type Value type (valid value: "1", "1C", "2", something else + * which is not checked) + * @param moduleName Optional module name to be printed (NULL: no module + * printed at all) + * @return EC_Normal if element could be retrieved and value is correct, an + * error code otherwise + */ + static OFCondition getAndCheckElementFromDataset(DcmItem &dataset, + const DcmTagKey& tagKey, + DcmElement*& delem, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL); + + /** Get element from dataset and check it for correct value multiplicity + * and type. + * @param dataset DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also + * be 'const'.) + * @param delem DICOM element used to store the value (always creates + * a copy of the value from the original element) + * @param rule Rule describing parameters to be checked on element + * @return EC_Normal if element could be retrieved and value is correct, an + * error code otherwise + */ + static OFCondition getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement &delem, + const IODRule* rule); + + /** Get element from dataset and check it for correct value multiplicity + * and type. + * @param dataset DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also + * be 'const') + * @param delem DICOM element that is set to a copy of the dataset's + * orinal element + * @param rule Rule describing parameters to be checked on element. + * @return EC_Normal if element could be retrieved and value is correct, an + * error code otherwise + */ + static OFCondition getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement*& delem, + const IODRule* rule); + + /** Get current date in DICOM 'DA' format (YYYYMMDD) + * @param dateString String used to store the current date. + * (empty string if current date could not be retrieved) + * @return Resulting character string + */ + static const OFString& currentDate(OFString &dateString); + + /** Get current time in DICOM 'TM' format (HHMMSS) + * The optional UTC notation (e.g.\ +0100) is currently not supported. + * @param timeString String used to store the current time + * (empty string if current time could not be retrieved) + * @return Resulting character string, empty if time could not be retrieved + */ + static const OFString& currentTime(OFString &timeString); + + /** Copy given element to the dataset + * The element is only added if 'result' is EC_Normal. A copy of the given + * element is created, i.e.\ the caller is responsible for deleting the + * original element handed to this function (if desired). + * @param result Reference to status variable (checked before adding and + * updated afterwards!) + * @param dataset Reference to DICOM dataset to which the element should + * be added + * @param delem Reference to DICOM element which should be added; a + * copy is created so caller is responsible for deleting delem (if + * desired). + * @param vm Value multiplicity (according to the data dictionary) to be + * checked for. (See DcmElement::checkVM() for a list of valid + * values.). Interpreted as cardinality (number of items) for + * sequence attributes. + * @param type Value type (valid value: "1", "2" or something else which + * is not checked) + * @param moduleName Optional module name to be printed (NULL: no module + * printed at all) + * @return Current value of 'result', EC_Normal if successful, + * an error code otherwise + */ + static OFCondition copyElementToDataset(OFCondition &result, + DcmItem &dataset, + const DcmElement &delem, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL); + + /** Copy given element to the dataset. The element is only added if 'result' + * is EC_Normal. + * @param result reference to status variable (checked before adding and + * updated afterwards!) + * @param dataset reference to DICOM dataset to which the element + * should be added + * @param delem reference to DICOM element which should be added; the value + * is copied from the original dataset's element + * @param rule Rule describing parameters to be checked on element. + * @return Current value of 'result', EC_Normal if successful, an error code + * otherwise + */ + static OFCondition copyElementToDataset(OFCondition &result, + DcmItem &dataset, + const DcmElement &delem, + const IODRule* rule); + + /** Add given element to the dataset + * The element is only added if 'result' is EC_Normal and the 'delem' + * pointer is not NULL. + * @param result Reference to status variable (checked before adding and + * updated afterwards!) + * @param dataset Reference to DICOM dataset to which the element should + * be added + * @param delem Pointer to DICOM element which should be added. The element + * is always consumed by this function, i.e.\ insertion was successful + * and therefore ownership is transferred to the dataset, or the + * element is deleted from memory if it could not be inserted. + * @param rule Rule describing parameters to be checked on element. + * @return Current value of 'result', EC_Normal if successful, an error code otherwise + */ + static OFCondition addElementToDataset(OFCondition &result, + DcmItem &dataset, + DcmElement *delem, + const IODRule* rule); + + /** Check element value for correct value multiplicity and type. + * @param delem Pointer to DICOM element to be checked (might be NULL) + * @param tagKey DICOM tag of the DICOM element the parameter 'delem' points to + * @param vm Value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type Value type (valid value: "1", "1C", "2", something else) + * @param searchCond Optional flag indicating the status of a previous 'search' function call + * @param moduleName Optional module name to be printed (default: "IOD" if NULL) + * @param logLevel The log level to log errors to + * @return EC_Normal if element value is correct, error otherwise + */ + static OFCondition checkElementValue(const DcmElement *delem, + const DcmTagKey &tagKey, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond = EC_Normal, + const char *moduleName = NULL, + const dcmtk::log4cplus::LogLevel logLevel = dcmtk::log4cplus::WARN_LOG_LEVEL); + + /** Check element value for correct value multiplicity and type. + * @param delem DICOM element to be checked + * @param vm Value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type Value type (valid value: "1", "1C", "2", something else) + * @param searchCond Optional flag indicating the status of a previous 'search' function call + * @param moduleName Optional module name to be printed (default: "IOD" if NULL) + * @param logLevel The log level to log errors to + * @return EC_Normal if element value is correct, error otherwise + */ + static OFCondition checkElementValue(const DcmElement &delem, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond = EC_Normal, + const char *moduleName = NULL, + const dcmtk::log4cplus::LogLevel logLevel = dcmtk::log4cplus::WARN_LOG_LEVEL); + + /** Get string value from element + * @param delem DICOM element from which the string value should be retrieved + * @param stringValue Reference to variable in which the result should be stored. + * (This parameter is automatically cleared if an error occurs.) + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getStringValueFromElement(const DcmElement &delem, + OFString &stringValue, + const signed long pos); + + /** Get string value from item + * @param key The tag key of the attribute whose value should be retrieved + * @param item The item to search the attribute in + * @param result Reference to variable in which the result should be stored. + * (This parameter is automatically cleared if an error occurs.) + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getStringValueFromItem(const DcmTagKey& key, + DcmItem& item, + OFString& result, + const signed long& pos); + + /** Get Float64 value from item + * @param key The tag key of the attribute whose value should be retrieved + * @param item The item to search the attribute in + * @param result Reference to variable in which the result should be stored. + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getFloat64ValueFromItem(const DcmTagKey& key, + DcmItem& item, + Float64& result, + const unsigned long& pos); + + /** Get Float64 values from item + * @param key The tag key of the attribute whose value should be retrieved + * @param item The item to search the attribute in + * @param result Reference to variable in which the result should be stored. + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getFloat64ValuesFromItem(const DcmTagKey& key, + DcmItem& item, + OFVector& result); + + /** Get Float64 value from element + * @param delem The element whose value should be retrieved + * @param result Reference to variable in which the result should be stored. + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getFloat64ValueFromElement(const DcmElement &delem, + Float64& result, + const unsigned long pos); + + /** Get Float64 values from element + * @param delem The element to get the value from + * @param result Reference to variable in which the result should be stored. + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition getFloat64ValuesFromElement(const DcmElement &delem, + OFVector& result); + + /** Set a DcmElement's content from Uint16 vector + * @param delem DICOM element to be filled + * @param values Vector use as a source for the values + * @param vm Value multiplicity (according to the data dictionary) to be + * checked for. (See DcmElement::checkVM() for a list of + * valid values.) + * @param check If OFTrue, then it is checked whether number of values + * conforms to the value provided by the vm parameter. + * @return Dtatus, EC_Normal if successful, an error code otherwise + */ + static OFCondition setUint16ValuesOnElement(DcmElement &delem, + const OFVector& values, + const OFString& vm, + const OFBool check); + + /** Get Uint16 values from DcmElement + * @param delem DICOM element to read from + * @param values Vector used as destination for the values + * @return Status EC_Normal if successful, an error code otherwise + */ + static OFCondition getUint16ValuesFromElement(DcmElement &delem, + OFVector& values); + + /** Returns single item from given sequence. Returns error number of items + * is 0 or more than 1. + * @param seq Sequence to read from. + * @param item The resulting item, NULL in case of error + * @param checkKey If given it is checked whether the given seq parameter + * matches the tag key provided in the checkKey parameter. If + * not, an error is returned. + * @return Status EC_Normal if successful, an error code otherwise + */ + static OFCondition getAndCheckSingleItem(DcmSequenceOfItems& seq, + DcmItem*& item, + const DcmTagKey& checkKey = DCM_UndefinedTagKey); + + /** Copies Uint8 values from given element to destination container + * (must support push_back() method). + * @param elem the element to read from. If NULL, an error is returned. + * @param destination the container to store the Uint8 values to + * @return EC_Normal if successful, an error code otherwise + */ + template + static OFCondition copyFromUint8Array(DcmElement* elem, + Container& destination) + { + if (elem == NULL) + return EC_IllegalParameter; + + size_t numValues = elem->getNumberOfValues(); + OFCondition result; + for (size_t count = 0; (count < numValues) && result.good(); count ++) + { + Uint8 value; + result = elem->getUint8(value, OFstatic_cast(unsigned long, count)); + if ( result.good() ) + { + destination.push_back(value); + } + } + if ( result.bad() ) + { + destination.clear(); + } + return result; + } + + /** Check whether SOP class UID matches the expected value + * @param item Item to read from. NULL value causes error return value. + * @param desiredSOPClass The value that is expected + * @param valueFound The value actually found (empty if no value could + * be retrieved) + * @return EC_Normal if value could be found and equals expected value, + * EC_TagNotFound if SOP Class UID is not found in dataset, + * EC_InvalidValue if SOP class differs from expected value. + */ + static OFCondition checkSOPClass(DcmItem* item, + const OFString& desiredSOPClass, + OFString& valueFound); + + /** Check whether given tag is a sequence tag + * @param key the tag key to be checked + * @param privateCreator The private creator to check for if tag is private + * @return OFTrue if given tag is a sequence tag, OFFalse otherwise + */ + static OFBool isSequenceTag(const DcmTagKey& key, + const OFString& privateCreator = ""); + + /** Reads items from DICOM sequence into container by creating a dedicated + * container item for each DICOM item. The container must support + * push_back(T) function and the container's element type T must support + * the read(DcmItem*) function. + * @param source The source sequence to read items from + * @param seqKey The sequence's tag key that is expected + * @param destination The destination container to read into + * @param cardinality Expected number of items. + * See DcmElement::checkVM() for a list of valid values. + * @param type The sequence type as noted in part 3 of the DICOM standard, + * i.e.\ "1,1C,2,2C or 3". + * @param module Name of the module/macro this sequence is contained in. Used + * for error messages and can also be left empty. + * @return EC_Normal if successful, an error code otherwise + */ + template + static OFCondition readSubSequence(DcmSequenceOfItems* source, + const DcmTagKey& seqKey, + Container& destination, + const OFString& cardinality, + const OFString& type, + const OFString& module) + { + OFCondition result; + OFCondition exists = EC_Normal; + if (!source) + exists = EC_TagNotFound; + + /* Check sequence and report errors as warnings, read anyway */ + checkElementValue(source, seqKey, cardinality, type, exists, module.c_str()); + if (source) + { + DcmItem *item = OFstatic_cast(DcmItem*, source->nextInContainer(NULL)); + size_t count = 0; + while (item != NULL) + { + if (item != NULL) + { + // define the element type + typedef typename OFremove_pointer::type Element; + Element *newElem = new Element(); + // read into container item (clears old data first) + if ( newElem != NULL) + { + result = (newElem)->read(*item, OFFalse /* no need to delete anything */); + if ( result.good() ) + { + destination.push_back(newElem); + } + else + { + delete newElem; + DCMIOD_WARN("Could not read item #" << count << " from " << DcmTag(source->getTag()).getTagName() << " (skipping item): " << result.text()); + } + } + else + { + DCMIOD_ERROR("Could not store data from item #" << count << " from " << DcmTag(source->getTag()).getTagName() << " (skipping item): Memory exhausted?"); + } + } + else + { + DCMIOD_WARN("Could not get item #" << count << " from " << DcmTag(source->getTag()).getTagName() << " (malformed data or internal error), skipping item"); + } + item = OFstatic_cast(DcmItem*, source->nextInContainer(item)); + count++; + } + } + else + { + result = EC_IllegalParameter; + } + return result; + } + + + /** Reads DICOM sequence into container by creating a dedicated container element + * for each DICOM item. The container must support push_back(T) function + * and the container's element type T must support the read(DcmItem*) function. + * @param source The source DICOM item read the sequence from + * @param seqKey The tag key of the sequence to be read + * @param destination The destination container to read into + * @param cardinality Expected number of items. + * See DcmElement::checkVM() for a list of valid values. + * @param type The sequence type as noted in part 3 of the DICOM standard, + * i.e.\ "1,1C,2,2C or 3". + * @param module Name of the module/macro this sequence is contained in. Used + * for error messages and can also be left empty. + * @return status EC_Normal if successful, an error code otherwise + */ + template + static OFCondition readSubSequence(DcmItem& source, + const DcmTagKey& seqKey, + Container& destination, + const OFString& cardinality, + const OFString& type, + const OFString& module) + { + OFCondition result; + DcmSequenceOfItems *seq = NULL; + + /* Get sequence and read it */ + source.findAndGetSequence(seqKey, seq); + result = readSubSequence(seq, seqKey, destination, cardinality, type, module ); + return result; + } + + + /** Reads DICOM sequence into container by creating a dedicated container + * element for each DICOM item. The container must support the + * push_back(T) function and the container's element type T must support + * the read(DcmItem*) function. + * @param source The source DICOM item read the sequence from + * @param seqKey The tag key of the sequence to be read + * @param destination The destination container to read into + * @param rule The rule for reading this sequence. If NULL, an error is returned. + * @return EC_Normal if successful, an error code otherwise + */ + template + static OFCondition readSubSequence(DcmItem& source, + const DcmTagKey& seqKey, + Container& destination, + IODRule *rule) + { + if (rule == NULL) + { + DCMIOD_ERROR("Cannot read sequence " << seqKey << " (no rule supplied)"); + return IOD_EC_NoSuchRule; + } + return readSubSequence(source, seqKey, destination, rule->getVM(), rule->getType(), rule->getModule()); + } + + + /** Reads single DICOM item from a specific sequence into a destination class. + * The container must support the read(DcmItem) function. If a single item + * (i.e.\ the first item of the specified sequence) cannot be read, an error + * is returned. + * @param source The source DICOM item read the sequence from + * @param seqKey The tag key of the sequence to be read + * @param destination The destination container to read into + * See DcmElement::checkVM() for a list of valid values. + * @param type The sequence type as noted in part 3 of the DICOM standard, + * i.e.\ "1,1C,2,2C or 3". + * @param module Name of the module/macro this sequence is contained in. + * Used for error messages and can also be left empty. + * @return EC_Normal if successful, an error code otherwise + */ + template + static OFCondition readSingleItem(DcmItem& source, + const DcmTagKey& seqKey, + Container& destination, + const OFString& type, + const OFString& module) + { + OFCondition result; + /* Check sequence, reports cardinality and type errors as warnings */ + checkSubSequence(result, source, seqKey, "1", type, module, dcmtk::log4cplus::WARN_LOG_LEVEL); + + /* Try to read sequence into internal data (ignore errors as much as possible) */ + DcmItem* item = NULL; + result = source.findAndGetSequenceItem(seqKey, item, 0); + if (item != NULL) + { + // read into Container (clears old data first) + result = destination.read(*item, OFTrue /* clear old data */); + } + return result; + } + + /** Reads single DICOM item from a specific sequence into a destination class. + * The container must support the read(DcmItem) function. If a single item + * (i.e.\ the first item of the specified sequence) cannot be read, an error + * is returned. + * @param source The source DICOM item read the sequence from + * @param seqKey The tag key of the sequence to be read + * @param destination The destination container to read into + * See DcmElement::checkVM() for a list of valid values. + * @param rule The rule (for the sequence) used for reading. + * @return EC_Normal if successful, an error code otherwise. If the rule + * equlas NULL, then nothing is read at all and an error is returned + * (IOD_EC_NoSuchRule), but no error is reported to the logger. + */ + template + static OFCondition readSingleItem(DcmItem& source, + const DcmTagKey& seqKey, + Container& destination, + IODRule *rule = NULL) + { + if (rule == NULL) + { + DCMIOD_DEBUG("Will not read sequence " << seqKey << ": No rule supplied"); + return IOD_EC_NoSuchRule; + } + + return readSingleItem(source, seqKey, destination, rule->getType(), rule->getModule()); + } + + /** Write given container into a DICOM sequence that is created within the + * given item. The sequence is created from scratch, i.e.\ any old sequence + * (and its items) will be overwritten. + * @param result If writing is successful, result will contain EC_Normal. + * Otherwise an error code is set. + * @param seqKey The tag key of the sequence to be write + * @param source The source container to read from. Must support the + * write(DcmItem*) function. + * @param destination The DICOM destination item to write the sequence to + * See DcmElement::checkVM() for a list of valid values. + * @param cardinality Expected number of items (i.e.\ expected number of + * elements in source container). See DcmElement::checkVM() for a + * list of valid values. + * @param type The sequence type as noted in part 3 of the DICOM standard, + * i.e.\ "1,1C,2,2C or 3". + * @param module Name of the module/macro this sequence is contained in. Used + * for error messages and can also be left empty. + */ + template + static void writeSubSequence(OFCondition& result, + const DcmTagKey& seqKey, + Container& source, + DcmItem& destination, + const OFString& cardinality, + const OFString& type, + const OFString& module) + { + if ( result.good() ) + { + // Delete old data + destination.findAndDeleteElement(seqKey); + + // If we have meaningful data, write it + OFBool haveData = source.size() > 0; + if (haveData) + { + destination.insertEmptyElement(seqKey); + Uint32 count = 0; + typename Container::iterator it = source.begin(); + while ( it != source.end() && result.good() ) + { + if ( (*it) != NULL) + { + DcmItem *localItem = NULL; + // If item is NULL result.bad() is always true. + result = destination.findOrCreateSequenceItem(seqKey, localItem, -2 /* append new */); + if ( result.good() ) + { + result = (*it)->write(*localItem); + if ( result.bad() ) + { + destination.findAndDeleteSequenceItem(seqKey, -1 /* last */); + DCMIOD_ERROR("Could not write item #" << count << " in " << DcmTag(seqKey).getTagName() << ": " << result.text()); + } + } + else + { + DCMIOD_ERROR("Could not insert item data #" << count << " of " << DcmTag(seqKey).getTagName() << " (internal error), ignoring"); + } + } + else + { + DCMIOD_ERROR("Found uninitialized container item (NULL value) for sequence " << DcmTag(seqKey).getTagName() << " (internal error, skipping)"); + } + count++; + it++; + } + } + // If we do not have data, create empty sequence if type 2 + else if (type == "2") + { + destination.insertEmptyElement(seqKey); + } + + // Check result + checkSubSequence(result, destination, seqKey, cardinality, type, module, dcmtk::log4cplus::ERROR_LOG_LEVEL); + + // Clean up if we did not have success */ + if (result.bad()) + { + destination.findAndDeleteElement(seqKey); + } + } + } + + /** Write given container into a DICOM sequence that is created within the given item. + * The container. The sequence is created from scratch, i.e.\ any old sequence + * (and its items) will be overwritten. + * @param result If writing is successful, result will contain EC_Normal. Otherwise + * an error code is set. + * @param seqKey The tag key of the sequence to be write + * @param source The source container to read from. Must support the write(DcmItem*) + * function. + * @param destination The DICOM destination item to write the sequence to + * @param rule Rule describing the requirements for this sequence. If NULL + * an error is returned (IOD_EC_NoSuchRule), but no error error is reported + * to the logger. + */ + template + static void writeSubSequence(OFCondition& result, + const DcmTagKey& seqKey, + Container& source, + DcmItem& destination, + IODRule* rule) + { + if ( result.good() ) + { + if (rule == NULL) + { + DCMIOD_DEBUG("Will not write sequence " << seqKey << ": No rule supplied"); + result = IOD_EC_NoSuchRule; + } + else + { + writeSubSequence(result, rule->getTagKey(), source, destination, rule->getVM(), rule->getType(), rule->getModule()); + } + } + } + + + /** Writes given container into a DICOM item of a specific sequence. The + * sequence is created from scratch so that any old information will be lost. + * @param result If writing is successful, result will contain EC_Normal. + * Otherwise an error code is set. + * @param seqKey The tag key of the sequence to be written + * @param source The source container to read from. Must support the write(DcmItem*) + * function. + * @param destination The DICOM item that should hold the sequence + * (with a single item) in the end. + * @param type The sequence type as noted in part 3 of the DICOM standard, + * i.e.\ "1,1C,2,2C or 3". + * @param module Name of the module/macro this sequence is contained in. + * Used for error messages and can also be left empty. + */ + template + static void writeSingleItem(OFCondition& result, + const DcmTagKey& seqKey, + Container& source, + DcmItem& destination, + const OFString& type, + const OFString& module) + { + if ( result.good() ) + { + // Delete old data + destination.findAndDeleteElement(seqKey); + + /* If we have data, write it */ + OFCondition haveData = source.check(OFTrue /* Be quiet */); + if (haveData.good()) + { + DcmItem *localItem = NULL; + // If item is NULL result.bad() is always true. + result = destination.findOrCreateSequenceItem(seqKey, localItem, 0); + if ( result.good() ) + { + result = source.write(*localItem); + // It can happen that check() returns OK but no elements have to be + // written at all (e.g.\ if it contains only type 3 attributes). In that + // case a sequence with a single empty item is written which must be removed + // afterwards. + if (result.good() && (localItem->card() == 0) ) + { + destination.findAndDeleteElement(seqKey); + } + } + } + /* If we do not have data, insert empty for type 2 */ + else if (type == "2") + { + destination.insertEmptyElement(seqKey); + } + else if (type == "1C") + { + DCMIOD_TRACE("Skipping type 1C sequence " << seqKey << ": No data or incomplete data available"); + } + else if (type == "3") + { + DCMIOD_TRACE("Skipping type 3 sequence " << seqKey << ": No data or incomplete data available"); + } + /* Check outcome */ + checkSubSequence(result, destination, seqKey, "1", type, module, dcmtk::log4cplus::ERROR_LOG_LEVEL); + } + } + + /** Writes given container into a DICOM item of a specific sequence. + * The sequence is created from scratch so that any old information + * will be lost. + * @param result If writing is successful, result will contain EC_Normal. + * Otherwise an error code is set. + * @param seqKey The tag key of the sequence to be written + * @param source The source container to read from. Must support the + * write(DcmItem*) function. + * @param destination The DICOM item that should hold the sequence + * (with a single item) in the end. + * @param rule The rule for writing the given sequence + */ + template + static void writeSingleItem(OFCondition& result, + const DcmTagKey& seqKey, + Container& source, + DcmItem& destination, + IODRule *rule) + { + if (result.good()) + { + if (rule == NULL) + { + DCMIOD_ERROR("Cannot write sequence " << seqKey << " (no rule supplied)"); + result = EC_CannotCheck; + } + else + { + writeSingleItem(result, seqKey, source, destination, rule->getType(), rule->getModule()); + } + } + } + + + /** Check whether a given sequence exists in a given item and whether it conforms to + * to its requirement type + * @param result If sequence is valid, result is set to EC_Normal, otherwise + * to an error. + * @param surroundingItem The item that should contain the given sequence. + * @param seqKey The sequence to look for + * @param cardinality Expected number of items (i.e.\ expected number of + * elements in source container). See DcmElement::checkVM() for a + * list of valid values. + * @param type The sequence type as noted in part 3 of the DICOM standard, + * i.e.\ "1,1C,2,2C or 3". + * @param module Name of the module/macro this sequence is contained in. + * Used for error messages and can also be left empty. + * @param logLevel The log level to write errors to + */ + static void checkSubSequence(OFCondition& result, + DcmItem& surroundingItem, + const DcmTagKey& seqKey, + const OFString& cardinality, + const OFString& type, + const OFString& module, + const dcmtk::log4cplus::LogLevel logLevel); + + /** Deletes all elements from given container and calls "delete" on each + * of them to clear memory. + * @param container The container that should be cleared. Must contain + * pointers to objects that are allocated on the heap. + */ + template + static void freeContainer(Container& container) + { + typename Container::iterator it = container.begin(); + while (it != container.end()) + { + delete *it; + it++; + } + container.clear(); + } + + /** Clones and copies all elements from source to destination container by + * copy constructing all elements. + * @param src The container that should be copied. Must contain pointers + * to objects that are allocated on the heap, and that are + * copy-constructible + * @param dst The container to copy the cloned elements to. + */ + template + static void copyContainer(const Container& src, Container& dst) + { + typedef typename OFremove_pointer::type Element; + typename Container::const_iterator it = src.begin(); + while (it != src.end()) + { + if (*it != NULL) + { + Element *elem = new Element(**it); + dst.push_back ( elem ); + } + else + { + DCMIOD_ERROR("Could not copy element while copying container: Element is NULL, skipping"); + } + it++; + } + } + + + template + static OFCondition setContentDateAndTimeNow(ModuleType& module) + { + OFDate date; + date.setCurrentDate(); + OFString tempstr; + date.getISOFormattedDate(tempstr, OFFalse /* no delimiters */); + OFCondition result = module.setContentDate(tempstr); + if (result.good()) + { + OFTime time; + time.setCurrentTime(); + time.getISOFormattedTime(tempstr, OFTrue /* include seconds */, OFFalse, OFFalse, OFFalse); + result = module.setContentTime(tempstr); + } + return result; + } + + + /** Function that takes a string representation of a tag key and + * converts it to a tag key instance if possible + * @param keyString String of the format "(gggg,eeee)" + * @return The tag key if it could be parsed, DCM_UndefinedTagKey is returned + * instead (0xffff,0xffff) + */ + static const DcmTagKey parseTagKey(const OFString& keyString); + + /** Decompress given dataset if possible. Decompression codecs have to be + * registered beforehand. + * @param dset The dataset to decompress + * @return EC_Normal if decompression works, error otherwise + */ + static OFCondition decompress(DcmDataset& dset); + + /** Create new Unique Identifier (UID) + * @param level 0: instance level, 1: Series level, >=2: Study level. + * Calling always with level=0 is not an error but will result + * in unique values, too. + * @return The UID created. + */ + static OFString createUID(const Uint8 level = 0); + + /** Print warning if more than 2147483647 frames are present. This is the maximum + * number since the Number of Frames attribute has a VR of IS which allows + * a maximum of 2^31-1. + * The method returns the number of frames that can be used, i.e. either + * 2147483647 if the maximum is exceeded, otherwise the actual number + * of frames. + * @param numFramesPresent The number of frames actually present + * @param warning The message to be printed if Number of Frames + * is larger than 2147483647. + * @return Number of frames that can be safely used. + */ + static Uint32 limitMaxFrames(const size_t numFramesPresent, + const OFString& warning); + +private: + + // We only have static functions so we do not need an instance of + // this class so far. + + /** Undefined default constructor (only static functions) + */ + DcmIODUtil(); + + /** Undefined destructor + */ + ~DcmIODUtil(); +}; + +#endif // IODUTIL_H diff --git a/dcmiod/include/dcmtk/dcmiod/modacquisitioncontext.h b/dcmiod/include/dcmtk/dcmiod/modacquisitioncontext.h new file mode 100644 index 00000000..77a34e1d --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modacquisitioncontext.h @@ -0,0 +1,74 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Acquisition Context Module + * + */ + +#ifndef MODACQUISITIONCONTEXT_H +#define MODACQUISITIONCONTEXT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Acquisition Context Module. At the moment + * only an empty Acquisition Context Sequence is supported, so this + * class servers more as a placeholder at the moment. + * + * Acquisition Context Sequence: (SQ, 1-n, 2) + * + */ +class DCMTK_DCMIOD_EXPORT IODAcquisitionContextModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set where this classes rules are added to. If NULL, the + * class creates an empty rule set. + */ + IODAcquisitionContextModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODAcquisitionContextModule(); + + /** Destructor + */ + virtual ~IODAcquisitionContextModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("AcquisitionContextModule") + * @return Name of the module ("AcquisitionContextModule") + */ + virtual OFString getName() const; + +private: + + /// The name of this module ("AcquisitionContextModule") + static const OFString m_ModuleName; +}; + +#endif // MODACQUISITIONCONTEXT_H diff --git a/dcmiod/include/dcmtk/dcmiod/modbase.h b/dcmiod/include/dcmtk/dcmiod/modbase.h new file mode 100644 index 00000000..2270c177 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modbase.h @@ -0,0 +1,255 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Abstract base class for IOD Modules or other attribute collections + * + */ + +#ifndef MODBASE_H +#define MODBASE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmiod/ioddef.h" +#include "dcmtk/dcmiod/iodrules.h" + +/** Class for managing sets of dicom attributes (e.g.\ macros and modules). + * The data is hold in a container (DcmItem) that can be shared with other + * components, i.e.\ different modules that hold their data in a common + * container. In order to know which attributes in the container should be + * actually handled by a component, the component also has a set of rules, which + * can also be shared between different components (e.g.\ all modules of an IOD + * can share the same set of rules). For each attribute there is one rule in + * the rule set, denoting the requirement type (1,2,3,1C,2C), the VM, and + * besides others also the name of the component that the attribute belongs + * to (e.g.\ "PatientModule"). Since the component knows its own name, it can + * decide which attributes in the data container it is responsible for. + * This class is meant to support nested substructures but so far only writes + * attributes on a single level (including sequences). Also, in this context + * the class carries a parent relationship which is not used at the moment. + */ +class DCMTK_DCMIOD_EXPORT IODComponent +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * an empty rule set. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + IODComponent(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor, creates rules and item from scratch. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + IODComponent(IODComponent* parent = NULL); + + /** Assignment operator, copies contained item and rule set from rhs to + * "this" attribute set. Performs deep copy, i.e.\ the contained item + * and the rule set are copied. The parent component is set to NULL. + * @param rhs The IODComponent to be assigned + * @return Reference to this module + */ + IODComponent& operator=(const IODComponent& rhs); + + /** Copy constructor, copies reference to contained item and + * rule set to "this" attribute set. + * @param rhs The component to be assigned + */ + IODComponent(const IODComponent& rhs); + + /** Virtual Destructor + */ + virtual ~IODComponent(); + + /** Clear all attributes from the data that are handled by this module. + * An attribute is considered belonging to the module if there are rules + * marked as belonging to this module via the rule's module name. + */ + void clearData(); + + /** Set missing values by inventing "default values". Automatically + * called during write() in IODComponent; does nothing in this base + * class implementation but can be overwritten by derived classes if + * default values are desired. + */ + virtual void inventMissing(); + + /** Resets rules to their original values + */ + virtual void resetRules() =0; + + /** Get rules handled by this module + * @return The rules + */ + OFshared_ptr getRules() + { + return m_Rules; + } + + /** Make component optional by turning all attributes requirement types of it + * to type 3. In order to reset to the attribute's original types, + * resetRules() can be used. + */ + virtual void makeOptional(); + + /** Get name of component + * @return Name of the module + */ + virtual OFString getName() const =0; + + /** Get the data handled by this module + * @return The item containing the data of this module + */ + DcmItem& getData() + { + return *m_Item; + } + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Check whether this component's data satisfies the underlying + * rules + * @param quiet If OFTrue, not error / warning messages will be produced. Only + * the returned error code will indicate error or OK. Per default, + * logging output is produced (OFFalse). + * @result EC_Normal if rules are satisfied, error otherwise + */ + virtual OFCondition check(const OFBool quiet = OFFalse); + + /** Comparison operator for IOD Components + * @param rhs The right hand side of the comparison + * @return 0, if the given object is equal to this object, other value otherwise + */ + virtual int compare(const IODComponent& rhs) const; + + /** Static helper function that reads attributes from given + * item into destination item, as determined by the provided + * rules and component name. The rules are only applied when reading + * from the source (which may result in warning messages on the logger), + * but if they could be found they are taken over into the destination + * item no matter whether the element validates against the rule. + * @param source The item to read from + * @param rules The rules that provide the attributes and requirements + * for these attributes + * @param destination The destination to write to + * @param componentName The name of the module/component to write + * @result EC_Normal if reading was successful, error otherwise + */ + static OFCondition read(DcmItem& source, + IODRules& rules, + DcmItem& destination, + const OFString& componentName); + + /** Static helper function that writes attributes from given + * item into destination item, as determined by the provided + * rules and component name. The rules are only applied when writing + * to the destination (which may result in warning messages on the logger, + * and the whole call returning with an error). During reading from the + * source item the elements read are not validated against the rules. + * @param source The item to read from + * @param rules The rules that provide the attributes and requirements + * for these attributes + * @param destination The destination to write to + * @param componentName The name of the module/component to write + * @result EC_Normal if reading was successful, error otherwise + */ + static OFCondition write(DcmItem& source, + IODRules& rules, + DcmItem& destination, + const OFString& componentName); + +protected: + + /// Shared pointer to the data handled by this class. The item may contain + /// more attributes than this class is actually responsible for + OFshared_ptr m_Item; + + /// Rules describing the attributes governed by this class + OFshared_ptr m_Rules; + + /// The parent component (may be NULL) of this class + IODComponent* m_Parent; + +}; + + +/** The class IODModule is an IODComponent without parent component since + * a module does always belong to the top level dataset. + * Also, different from IODComponents, modules usually share data and + * rules. This is taken into account in the assignment operator and + * copy constructor which only create a shallow copy, i.e. modules + * share the same data and rules afterwards. + */ +class DCMTK_DCMIOD_EXPORT IODModule : public IODComponent +{ +public: + + /** Constructor. Similar to the one of IODComponent but no parent + * can be defined since a module is always at top level. + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * an empty rule set. + */ + IODModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor. Creates new empty data container and new empty + * ruleset. No parent component is defined (since a module is always + * on top level. + */ + IODModule(); + + /** Copy constructor, creates shallow copy + * @param rhs The module to copy from + */ + IODModule(const IODModule& rhs); + + /** Assignment operator, creates shallow copy + * @param rhs The module to copy from + * @return Returns reference to this object + */ + IODModule& operator=(const IODModule& rhs); + + /** Desctructor + */ + ~IODModule() {}; +}; + +#endif //MODBASE_H + diff --git a/dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h b/dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h new file mode 100644 index 00000000..23dccbab --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h @@ -0,0 +1,244 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Common Instance Reference Module + * + */ + +#ifndef MODCOMMONINSTANCEREF_H +#define MODCOMMONINSTANCEREF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmiod/iodreferences.h" + + +/** Class representing the Common Instance Reference Module: + * + * Referenced Series Sequence: (SQ, VM 1-n, Type 1C) + * > Series Instance UID: (UI, 1, 1) + * > Referenced Instance Sequence: (SQ, 1-n, 1) + * >> SOP Instance Reference Macro + * Studies Containing Other Referenced Instances Sequence: (SQ, 1-n, 1C) + * > Study Instance UID (UI, 1, 1) + * > Series and Instance Reference Macro + * + * Thus the Common Instance Reference Module lists references to other SOP + * instances and divides them between those instances that are in the same + * study, and those that are inside another study. + */ +class DCMTK_DCMIOD_EXPORT IODCommonInstanceReferenceModule : public IODModule +{ + +public: + + // Forward declaration (class defined later in this file) + class StudiesOtherInstancesItem; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODCommonInstanceReferenceModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODCommonInstanceReferenceModule(); + + /** Clears all data belonging to this module (rules are kept) + */ + virtual void clearData(); + + /** Destructor + */ + virtual ~IODCommonInstanceReferenceModule(); + + /** Add references + * @param references The references to be added + * @param studyInstanceUID The Study Instance UID of "this" object instance. + * It's used to decide whether the provided instances (with their + * own Study Instance UIDs) will go into the Referenced Series Sequence + * or into the Studies Containing Other Referenced Instances Sequence. + * If it is left empty, then the method tries to find "this" instances + * Study Instance UID in the internal item container which may be shared + * with other modules and thus may already provide the Study Instance + * UID (e.g. via General Study Module). + * @param clearOldData Delete any old references if OFTrue, otherwise keep them + * @result EC_Normal if successful, error otherwise + */ + virtual size_t addReferences(const IODReferences& references, + const OFString& studyInstanceUID = "", + const OFBool clearOldData = OFTrue); + + /** Read data of this module from given source item + * @param source The item to read from + * @param clearOldData If OFTrue, old data is cleared before reading, otherwise + * it is overwriten/amended. + * @result EC_Normal if successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write data of this module into given destination item + * @param destination The item to write to + * @result EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("CommonInstanceReferenceModule") + * @return Name of the module ("CommonInstanceReferenceModule") + */ + virtual OFString getName() const; + + /** Return reference to list of Referenced Series items + * @return Reference to list of Reference Series Items + */ + OFVector& getReferencedSeriesItems(); + + /** Return reference to content of Studies Containing Other Referenced Instances Sequence + * @return Reference to content of Studies Containing Other Referenced Instances Sequence + */ + OFVector& getStudiesContainingOtherReferences(); + +protected: + + virtual OFCondition addSeriesReference( + OFVector& container, + const IODReference& ref); + +private: + + void freeMemory(); + + /// Vector with all items of the Referenced Series Sequence + OFVector m_ReferenceSeriesItems; + + /// Name of this component ("CommonInstanceReferenceModule") + static const OFString m_ComponentName; + + /// Items of Studies Containing Other Referenced Instances Sequence + OFVector m_StudiesContainingOtherReferencedInstancesSequence; +}; + + +/** Class representing items from the Studies Containing Other Referenced Instances Sequence, + * as used within the Common Instance Reference Module + * + * Studies Containing Other Referenced Instances Sequence: (SQ, 1-n, 1C) + * > Study Instance UID (UI, 1, 1) + * > Series and Instance Reference Macro + * + */ +class DCMTK_DCMIOD_EXPORT IODCommonInstanceReferenceModule::StudiesOtherInstancesItem : public IODComponent +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + StudiesOtherInstancesItem(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent = NULL); + + /** Constructor + * @param parent The parent component of this module, might be NULL + */ + StudiesOtherInstancesItem(IODComponent* parent = NULL); + + /** Destructor + */ + virtual ~StudiesOtherInstancesItem(); + + /** Clear (removes) all attributes handled by the modules of this component. + * Rules are not reset. + */ + virtual void clearData(); + + /** Read data from source item into this module + * @param source The item to read from + * @param clearOldData If OFTrue, old data is cleared first, otherwise it is + * overwritten/amended + * @result EC_Normal if successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write this module's data into given destination item + * @param destination Item to write to + * @result EC_Normal if successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("StudiesContainingOtherReferencedInstancesSequence") + * @return Name of the module ("StudiesContainingOtherReferencedInstancesSequence") + */ + virtual OFString getName() const; + + /** Get Study Instance UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** Set Study Instance UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString& value, + const OFBool checkValue = OFTrue); + + + /** Get Series And Instance Reference Macro + * @return Reference to the Series And Instance Reference Macro structure + */ + virtual IODSeriesAndInstanceReferenceMacro& getReferencedSeriesAndInstanceReferences(); + +private: + + /// The name of this component ("StudiesContainingOtherReferencedInstancesSequence") + static const OFString m_ComponentName; + + /// The Series and Instance Reference Macro used in this item + IODSeriesAndInstanceReferenceMacro m_ReferencedSeriesAndInstance; +}; + + +#endif // MODCOMMONINSTANCEREF_H diff --git a/dcmiod/include/dcmtk/dcmiod/modenhequipment.h b/dcmiod/include/dcmtk/dcmiod/modenhequipment.h new file mode 100644 index 00000000..7721d3c1 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modenhequipment.h @@ -0,0 +1,203 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Enhanced General Equipment Module + * + */ + +#ifndef MODENHEQUIPMENT_H +#define MODENHEQUIPMENT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/ioddef.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Enhanced Equipment Module: + * + * Manufacturer: (LO, 1, 1) + * Manufacturer's Model Name: (LO, 1, 1) + * Device Serial Number: (LO, 1, 1) + * Software Version(s): (LO, 1-n, 1) + */ +class DCMTK_DCMIOD_EXPORT IODEnhGeneralEquipmentModule : public IODModule +{ + +public: + + /** Convenient struct containing all information required for setting + * enhanced equipment information (for use by external code) + */ + struct DCMTK_DCMIOD_EXPORT EquipmentInfo + { + + /** Default Constructor + */ + EquipmentInfo() : + m_Manufacturer(), + m_ManufacturerModelName(), + m_DeviceSerialNumber(), + m_SoftwareVersions() {} + + /** Convenience Constructor setting all values + * @param manufacturer Manufacturer + * @param manufacturerModelName Manufacturer's model name + * @param deviceSerialNumber Serial number + * @param softwareVersions Software versions + */ + EquipmentInfo(const OFString& manufacturer, + const OFString& manufacturerModelName, + const OFString& deviceSerialNumber, + const OFString& softwareVersions) : + m_Manufacturer(manufacturer), + m_ManufacturerModelName(manufacturerModelName), + m_DeviceSerialNumber(deviceSerialNumber), + m_SoftwareVersions(softwareVersions) {} + + /** Perform simple check whether all equipment data is filled in. Does not + * check VR or VM (will be checked in write() routine, though) + * @return OFTrue if data is complete, OFFalse otherwise + */ + OFBool isDataComplete() const + { + if (m_Manufacturer.empty() || m_ManufacturerModelName.empty() || m_DeviceSerialNumber.empty() || m_SoftwareVersions.empty()) + { + return OFFalse; + } + return OFTrue; + } + + /// Manufacturer (VM 1) + OFString m_Manufacturer; + + /// Manufacturer's Model Name (VM 1) + OFString m_ManufacturerModelName; + + /// Device Serial Number (VM 1) + OFString m_DeviceSerialNumber; + + /// Software Version(s) (VM 1-n) + OFString m_SoftwareVersions; + }; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the class + * creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODEnhGeneralEquipmentModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODEnhGeneralEquipmentModule(); + + /** Destructor + */ + virtual ~IODEnhGeneralEquipmentModule(); + + static OFCondition create(const EquipmentInfo& info, + IODEnhGeneralEquipmentModule* equipment); + + /** Resets rules to their original values. + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("EnhancedEquipmentModule") + */ + virtual OFString getName() const; + + /** Get Manufacturer + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, + const signed long pos = 0) const; + + /** Get Manufacturer's Model Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, + const signed long pos = 0) const; + + /** Get Device Serial Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, + const signed long pos = 0) const; + + /** Get Software Version(s) + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, + const signed long pos = 0) const; + + /** Set Manufacturer + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Manufacturer's Model Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Device Serial Number + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Software Version(s) + * @param value Value to be set (possibly multi-valued) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set all equipment information at once + * @param info The equipment information to be set. + * @return EC_Normal if values could be set, error otherwise + */ + virtual OFCondition set(const EquipmentInfo& info); + +private: + + /// Name of the module ("EnhancedEquipmentModule") + OFString m_ModuleName; +}; + + +#endif // MODENHEQUIPMENT_H diff --git a/dcmiod/include/dcmtk/dcmiod/modenhusimage.h b/dcmiod/include/dcmtk/dcmiod/modenhusimage.h new file mode 100644 index 00000000..37401913 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modenhusimage.h @@ -0,0 +1,593 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Enhanced US Image Module + * + */ + +#ifndef MODENHUSIMAGE_H +#define MODENHUSIMAGE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmiod/iodmacro.h" + +/** Class representing the Enhanced US Image Module: + * + * Image Type: (CS, 2 as defined in part 3, 1) + * Samples Per Pixel: (US, 1, 1) + * Photometric Interpretation (CS, 1, 1) + * Rows: (US, 1, 1) + * Columns: (US, 1, 1) + * Bits Allocated: (US, 1, 1) + * Bits Stored: (US, 1, 1) + * High Bit: (US, 1, 1) + * Pixel Representation: (US, 1, 1) + * Dimension Organization Type (CS, 1, 1) + * Acquisition DateTime (DT, 1, 1) + * Acquisition Duration (FD, 1, 1) + * Pixel Spacing (DS, 2, 1) + * Position Measuring Device Used (CS, 1, 1C) + * Lossy Image Compression: (CS, 1, 1) + * Lossy Image Compression Ratio: (DS, 1-n, 1C) + * Lossy Image Compression Method: (CS, 1-n, 1C) + * Presentation LUT Shape: (CS, 1, 1) + * Rescale Slope: (DS, 1, 1) + * Rescale Intercept: (DS, 1, 1) + * Mandatory View And Slice Progression Macro (type 1) + * Burned In Annotation: (CS, 1, 1) + * Recognizable Visual Features: (CS, 1, 3) + * Transducer Scan Pattern Code Sequence: (SQ, 1, 1) + * Transducer Geometry Code Sequence: (SQ, 1, 1) + * Transducer Beam Steering Code Sequence: (SQ, 1, 1) + * Transducer Application Code Sequence: (SQ, 1, 1) + * Processing Function: (LO, 1, 3) + * Mechanical Index: (DS, 1, 1) + * Bone Thermal Index: (DS, 1, 1) + * Cranial Thermal Index: (DS, 1, 1) + * Soft Tissue Thermal Index: (DS, 1, 1) + * Depth(s) of Focus: (FD, 1-n, 1) + * Depth(s) of Scan Field: (IS, 1, 1) + */ +class DCMTK_DCMIOD_EXPORT IODEnhUSImageModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set where this classes rules are added to. If NULL, the + * class creates an empty rule set. + */ + IODEnhUSImageModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODEnhUSImageModule(); + + /** Destructor + */ + virtual ~IODEnhUSImageModule(); + + /** Resets rules to their original values. + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("EnhancedUSImageModule") + */ + virtual OFString getName() const; + + /** Read attributes from given item into this class. Overwrites + * fucntion of base class IODComponent. + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item. Overwrites + * function of base class IODComponent. + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Get Image Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageType(OFString &value, + const signed long pos = 0); + + /** Get Samples Per Pixel + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSamplesPerPixel(Uint16& value, + const unsigned long pos = 0); + + /** Get Photometric Interpretation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhotometricInterpretation(OFString& value, + const signed long pos = 0); + + /** Get Rows + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRows(Uint16& value, + const unsigned long pos = 0); + + /** Get Columns + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getColumns(Uint16& value, + const unsigned long pos = 0); + /** Get Bits Allocated + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsAllocated(Uint16& value, + const unsigned long pos = 0); + + /** Get Bits Stored + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsStored(Uint16& value, + const unsigned long pos = 0); + + /** Get High Bit + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getHighBit(Uint16& value, + const unsigned long pos = 0); + + /** Get Pixel Representation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelRepresentation(Uint16& value, + const unsigned long pos = 0); + + /** Get Dimension Organization Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDimensionOrganizationType(OFString& value, + const signed long pos = 0); + + /** Get Acquisition DateTime + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDateTime(OFString& value, + const signed long pos = 0); + + /** Get Acquisition Duration + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDuration(Float64& value, + const unsigned long pos = 0); + + /** Get Pixel Spacing + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelSpacing(Float64& value, + const unsigned long pos = 0); + + /** Get Position Measuring Device + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPositionMeasuringDevice(OFString& value, + const signed long pos = 0); + + /** Get Lossy Image Compression + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompression(OFString& value, + const signed long pos = 0); + + /** Get Lossy Image Compression Ratio + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(Float64& value, + const unsigned long pos = 0); + + /** Get Lossy Image Compression Method + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionMethod(OFString& value, + const signed long pos = 0); + + /** Get Presentation LUT Shape + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPresentationLUTShape(OFString& value, + const signed long pos = 0); + /** Get Rescale Slope + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleSlope(Float64& value, + const unsigned long pos = 0); + /** Get Rescale Intercept + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleIntercept(OFString& value, + const signed long pos = 0); + + /** Get Burned-In Annotation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBurnedInAnnotation(OFString& value, + const signed long pos = 0); + /** Get Recognizable Visual Features + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRecognizableVisibleFeatures(OFString& value, + const signed long pos = 0); + /** Get Mandatory View And Slice Progression Direction + * @return Reference to Mandatory View And Slice Progression Direction + */ + virtual MandatoryViewAndSliceProgressionDirectionMacro& getMandatoryViewAndSliceProgressionDirection(); + + /** Get Anatomy + * @return Reference to Anatomy + */ + virtual GeneralAnatomyMacro& getAnatomy(); + + /** Get Transducer Scan Pattern + * @return Reference to Transducer Scan Pattern + */ + virtual CodeSequenceMacro& getTransducerScanPattern(); + + /** Get Transducer Geometry Code + * @return Reference to Transducer Geometry + */ + virtual CodeSequenceMacro& getTransducerGeometry(); + + /** Get Transducer Beam Steering + * @return Reference to Transducer Beam Steering + */ + virtual OFVector& getTransducerBeamSteering(); + + /** Get Transducer Application + * @return Reference to Transducer Application + */ + virtual CodeSequenceMacro& getTransducerApplication(); + + /** Get Processing Function + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getProcessingFunction(OFString& value, + const signed long pos = 0); + /** Get Mechanical Index + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMechanicalIndex(Float64& value, + const unsigned long pos = 0); + + /** Get Bone Thermal Index + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBoneThermalIndex(Float64& value, + const unsigned long pos = 0); + + /** Get Cranial Thermal Index + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCranialThermalIndex(Float64& value, + const unsigned long pos = 0); + + /** Get Soft Tissue Thermal Index + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all values + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftTissueThermalIndex(Float64& value, + const unsigned long pos = 0); + + /** Get Depth(s) of Focus + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDepthsOfFocus(Float64& value, + const unsigned long pos = 0); + + /** Get Depth(s) of Scan Field + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDepthsOfScanField(Float64& value, + const unsigned long pos = 0); + + /** Set Image Type. Image Type contains up to four values. Value 3 and 4 are + * optional and can be left empty if desired. The values in their order + * of occurrence are: + * 1) Pixel Data Characteristics: Either ORIGINAL or DERIVED + * 2) Patient Examination Characteristics: Fixed to "PRIMARY", thus cannot be + * influenced through this function. + * 3) Image Flavor: Defined Terms listed in the standard + * 4) Derived Pixel Contrast: Defined Terms listed in the standard + * @param pixelDataChar Value 1 of Image Type + * @param imageFlavor Value 3 of Image Type + * @param derivedPixelContrast Value 4 of Image Type + * @param checkValue If OFTrue, the value is checked for conformance. + * @return EC_Normal if setting was successful, error otherwise. + */ + virtual OFCondition setImageType(const DcmIODTypes::IOD_ENHUSIMAGETYPE pixelDataChar, + const OFString& imageFlavor = "", + const OFString& derivedPixelContrast = "", + const OFBool checkValue = OFTrue); + + /** Set Rows + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRows(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Columns + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setColumns(const Uint16 value, + const OFBool checkValue = OFTrue); + /** Set Bits Allocated + * @param value Value to be set, permitted values: 8 or 16 + * @param checkValue Check 'value' for conformance if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsAllocated(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Bits Stored + * @param value Value to be set, permitted values: 8 or 16 + * @param checkValue Check 'value' for conformance if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsStored(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set High Bit + * @param value Value to be set, permitted values: 7 or 15 + * @param checkValue Check 'value' for conformance if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setHighBit(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Dimension Organization Type + * @param value Value to be set, permitted values: "3D" or "3D_TEMPORAL" + * @param checkValue Check 'value' for conformance if enabled, including VR (CS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDimensionOrganizationType(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Acquisition DateTime + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (DT) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDateTime(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Acquisition Duration + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDuration(const Float64 value, + const OFBool checkValue = OFTrue); + + /** Set Pixel Spacing + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (DS) and VM (2) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelSpacing(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Position Measuring Device + * @param value Value to be set, permitted values: "RIGID" or "FREEHAND" + * @param checkValue Check 'value' for conformance if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPositionMeasuringDevice(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression + * @param value Value to be set, permitted values: "00" (not lossy compressed) or "01" (lossy compressed) + * @param checkValue Check 'value' for conformance if enabled, including VR (CS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompression(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression Ratio + * @param value Value to be set, including VR (DS) and VM (1-n) + * @param checkValue Check 'value' for conformance if enabled, including VR (DS) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionRatio(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression Method + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (CS) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionMethod(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Recognizable Visual Features + * @param value Value to be set, permitted values: "YES" or "NO" + * @param checkValue Check 'value' for conformance if enabled, including VR (CS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecognizableVisibleFeatures(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Processing Funcion + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (LO) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setProcessingFunction(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Mechanical Index + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (DS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMechanicalIndex(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Bone Thermal Index + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (DS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBoneThermalIndex(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Cranial Thermal Index + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (DS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCranialThermalIndex(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Soft Tissue Thermal Index + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (DS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftTissueThermalIndex(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Depth(s) of Focus + * @param value Value to be set + * @param pos Index of the value to set (0..vm-1) + * @param checkValue Check 'value'. Not evaluated (here for consistency with + * other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDepthsOfFocus(const Float64 value, + const unsigned long pos, + const OFBool checkValue = OFTrue); + + /** Set Depth(s) of Focus (convenience function) + * @param values Value(s) to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency with + * other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDepthsOfFocus(const OFVector& values, + const OFBool checkValue = OFTrue); + + /** Set Depth(s) of Scan Field + * @param value Value to be set + * @param checkValue Check 'value' for conformance if enabled, including VR (IS) and VM (1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDepthsOfScanField(const OFString& value, + const OFBool checkValue = OFTrue); + + +private: + + /// This module's name ("EnhancedUSImageModule") + static const OFString m_ModuleName; + + /// Mandatory View and Slice Progression Direction + MandatoryViewAndSliceProgressionDirectionMacro m_MandatoryViewAndSliceProgressionDirection; + + /// General Anatomy Mandatory Macro + GeneralAnatomyMacro m_Anatomy; + + /// Item of Transducer Scan Pattern Code Sequence + CodeSequenceMacro m_TransducerScanPattern; + + /// Item of Transducer Geometry Code Sequence + CodeSequenceMacro m_TransducerGeometry; + + /// Item of Transducer Beam Steering Code Sequence + OFVector m_TransducerBeamSteering; + + /// Item of Transducer Application Code Sequence + CodeSequenceMacro m_TransducerApplication; +}; + +#endif // MODENHUSIMAGE_H diff --git a/dcmiod/include/dcmtk/dcmiod/modenhusseries.h b/dcmiod/include/dcmtk/dcmiod/modenhusseries.h new file mode 100644 index 00000000..cfeaccb7 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modenhusseries.h @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Enhanced US Series Module + * + */ + +#ifndef MODENHUSSERIES_H +#define MODENHUSSERIES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/ofstd/ofoption.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Enhanced Ultrasound Series Module: + * + * Notation: "Attribute name: (VR, VM, Requirement Type)" + * Modality: (CS, 1, 1) + * Referenced Performed Procedure Step Sequence: (SQ, 1, 1C) + * > SOP Instance Reference Macro + * Performed Protocol Code Sequence: (SQ, 1, 1C) + * > Code Sequence Macro + * Not yet explicitly supported: + * ---------------------------------------------- + * > Protocol Context Sequence: (SQ, 1-n, 3) + * >> Content Item Macro + * >> Content Item Modifier Sequence: (SQ, 1-n, 3) + * >>> Content Item Macro + * ---------------------------------------------- + * Performed Protocol Type: (CS, 1, 1C) + */ +class DCMTK_DCMIOD_EXPORT IODEnhancedUSSeriesModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODEnhancedUSSeriesModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODEnhancedUSSeriesModule(); + + /** Destructor + */ + virtual ~IODEnhancedUSSeriesModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("EnhancedUSSeriesModule") + * @return Name of the module ("EnhancedUSSeriesModule") + */ + virtual OFString getName() const; + + /** Read data into this module from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data in this module is cleared first (default: OFTrue) + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write this module to given item + * @param destination The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Get Modality, always returns "US" + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, + const signed long pos = 0) const; + + + /** Get Referenced Performed Procedure Step + * @return Reference to the Referenced Performed Procedure Step information + */ + virtual SOPInstanceReferenceMacro& getReferencedPPS(); + + /** Get Performed Protocol Code + * @return Reference to the Performed Protocol information + */ + virtual CodeSequenceMacro& getPerformedProtocolCode(); + + /** Get Performed Protocol Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProtocolType(OFString &value, + const signed long pos = 0) const; + +private: + + /// The name of this module ("EnhancedUSSeriesModule") + static const OFString m_ModuleName; + + /// Referenced Performed Procedure Step Sequence + SOPInstanceReferenceMacro m_ReferencedPerformedProcedureStep; + + /// Performed Protocol Code Sequence (so far, without optional data) + CodeSequenceMacro m_PerformedProtocolCode; +}; + +#endif // MODENHUSSERIES_H diff --git a/dcmiod/include/dcmtk/dcmiod/modequipment.h b/dcmiod/include/dcmtk/dcmiod/modequipment.h new file mode 100644 index 00000000..77e72d7e --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modequipment.h @@ -0,0 +1,256 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Equipment Module + * + */ + +#ifndef MODEQUIPMENT_H +#define MODEQUIPMENT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/ioddef.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the General Equipment Module: + * + * Manufacturer: (LO, 1, 2) + * Institution Name: (LO, 1, 3) + * Institution Address: (ST, 1, 3) + * Station Name: (SH, 1, 3) + * Institutional Department Name: (LO, 1, 3) + * Manufacturer's Model Name: (LO, 1, 3) + * Device Serial Number: (LO, 1, 3) + * Software Version(s): (LO, 1-n, 3) + */ +class DCMTK_DCMIOD_EXPORT IODGeneralEquipmentModule : public IODModule +{ + +public: + + /** Convenient struct containing commonly used equipment information + * (for use by external code) + */ + struct DCMTK_DCMIOD_EXPORT EquipmentInfo + { + + /** Default Constructor + */ + EquipmentInfo() : + m_Manufacturer(), + m_ManufacturerModelName(), + m_DeviceSerialNumber(), + m_SoftwareVersions() {} + + /** Convenience Constructor setting commonly used values + * @param manufacturer Manufacturer + * @param manufacturerModelName Manufacturer's model name + * @param deviceSerialNumber Serial number + * @param softwareVersions Software versions + */ + EquipmentInfo(const OFString& manufacturer, + const OFString& manufacturerModelName, + const OFString& deviceSerialNumber, + const OFString& softwareVersions) : + m_Manufacturer(manufacturer), + m_ManufacturerModelName(manufacturerModelName), + m_DeviceSerialNumber(deviceSerialNumber), + m_SoftwareVersions(softwareVersions) {} + + /// Manufacturer (VM 1) + OFString m_Manufacturer; + + /// Manufacturer's Model Name (VM 1) + OFString m_ManufacturerModelName; + + /// Device Serial Number (VM 1) + OFString m_DeviceSerialNumber; + + /// Software Version(s) (VM 1-n) + OFString m_SoftwareVersions; + }; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the class + * creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODGeneralEquipmentModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODGeneralEquipmentModule(); + + /** Destructor + */ + virtual ~IODGeneralEquipmentModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("GeneralEquipmentModule") + */ + virtual OFString getName() const; + + /** Get Manufacturer + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, + const signed long pos = 0) const; + + /** Get Institution Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, + const signed long pos = 0) const; + + /** Get Institution Address + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, + const signed long pos = 0) const; + + /** Get Station Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, + const signed long pos = 0) const; + + /** Get Institutional Department Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, + const signed long pos = 0) const; + /** Get Manufacturer's Model Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, + const signed long pos = 0) const; + + /** Get Device Serial Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, + const signed long pos = 0) const; + + /** Get Software Version(s) + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, + const signed long pos = 0) const; + + /** Set Manufacturer + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Institution Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Institution Address + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Station Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (SH) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Institutional Department Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstutionalDepartmentName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Manufacturer's Model Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Device Serial Number + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Software Version(s) + * @param value Value to be set (possibly multi-valued) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1-n) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /// Name of the module ("GeneralEquipmentModule") + OFString m_ModuleName; +}; + + +#endif // MODEQUIPMENT_H diff --git a/dcmiod/include/dcmtk/dcmiod/modfloatingpointimagepixel.h b/dcmiod/include/dcmtk/dcmiod/modfloatingpointimagepixel.h new file mode 100644 index 00000000..05072287 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modfloatingpointimagepixel.h @@ -0,0 +1,246 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Floating Point and Double Floating Point Image Pixel Module + * + */ + +#ifndef MODFLOATINGPOINTIMAGEPIXEL_H +#define MODFLOATINGPOINTIMAGEPIXEL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modimagepixelbase.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +/** Class representing Floating Point Image Pixel Module: + * + * Samples Per Pixel: (US, 1, 1) + * Photometric Interpretation (CS, 1, 1) + * Rows: (US, 1, 1) + * Columns: (US, 1, 1) + * Bits Allocated: (US, 1 1) + * Pixel Aspect Ratio: (IS, 2, 1C) + * Float Pixel Padding Value: (FL, 1, 3) + * Float Pixel Padding Range Limit: (FL, 1, 1C) + */ +class DCMTK_DCMIOD_EXPORT IODFloatingPointImagePixelModule : public IODImagePixelBase +{ + +public: + + /// Data type of pixels + typedef Float32 value_type; + + static const DcmTagKey pixel_data_tag; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODFloatingPointImagePixelModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODFloatingPointImagePixelModule(); + + /** Destructor + */ + virtual ~IODFloatingPointImagePixelModule(); + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("FloatingPointImagePixelModule") + */ + virtual OFString getName() const; + + /** Get pixel data type, always returns DataType::FLOAT for this class. + * @return The data type of the pixel data + */ + virtual DataType getDataType() const; + + /** Get Float Pixel Padding Value + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloatPixelPaddingValue(Float32& value, + const signed long pos = 0); + + /** Get Float Pixel Padding Range Limit + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFloatPixelPaddingRangeLimit(Float32& value, + const signed long pos = 0); + + /** Set Float Pixel Pixel Padding Value + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (FL) and consistency + * with other attributes if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFloatPixelPaddingValue(const Float32 value, + const OFBool checkValue = OFTrue); + + /** Set Float Pixel Padding Range Limit + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (FL) and consistency + * with other attributes if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFloatPixelPaddingRangeLimit(const Float32 value, + const OFBool checkValue = OFTrue); + +private: + + /// This module's name ("FloatingPointImagePixelModule") + static const OFString m_ModuleName; + +}; + + +/** Class representing Double Floating Point Image Pixel Module: + * + * Samples Per Pixel: (US, 1, 1) + * Photometric Interpretation (CS, 1, 1) + * Rows: (US, 1, 1) + * Columns: (US, 1, 1) + * Bits Allocated: (US, 1 1) + * Pixel Aspect Ratio: (IS, 2, 1C) + * Double Float Pixel Padding Value: (FD, 1, 3) + * Double Float Pixel Padding Range Limit: (FD, 1, 1C) + */ +class DCMTK_DCMIOD_EXPORT IODDoubleFloatingPointImagePixelModule: public IODImagePixelBase +{ + +public: + + /// Data type of pixels + typedef Float64 value_type; + + static const DcmTagKey pixel_data_tag; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODDoubleFloatingPointImagePixelModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODDoubleFloatingPointImagePixelModule(); + + /** Destructor + */ + virtual ~IODDoubleFloatingPointImagePixelModule(); + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("DoubleFloatingPointImagePixelModule") + */ + virtual OFString getName() const; + + /** Get pixel data type, always returns DataType::DOUBLE for this class. + * @return The data type of the pixel data + */ + virtual DataType getDataType() const; + + /** Get Double Float Pixel Padding Value + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoubleFloatPixelPaddingValue(Float64& value, + const signed long pos = 0); + + /** Get Double Float Pixel Padding Range Limit + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoubleFloatPixelPaddingRangeLimit(Float64& value, + const signed long pos = 0); + + /** Set Double Float Pixel Pixel Padding Value + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (FD) and consistency + * with other attributes if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoubleFloatPixelPaddingValue(const Float64 value, + const OFBool checkValue = OFTrue); + + /** Set Double Float Pixel Padding Range Limit + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (FD) and consistency + * with other attributes if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoubleFloatPixelPaddingRangeLimit(const Float64 value, + const OFBool checkValue = OFTrue); + +private: + + /// This module's name ("DoubleFloatingPointImagePixelModule") + static const OFString m_ModuleName; + +}; + +#endif // MODFLOATINGPOINTIMAGEPIXEL_H diff --git a/dcmiod/include/dcmtk/dcmiod/modfor.h b/dcmiod/include/dcmtk/dcmiod/modfor.h new file mode 100644 index 00000000..76d7519f --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modfor.h @@ -0,0 +1,115 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Frame of Reference Module + * + */ + +#ifndef MODFOR_H +#define MODFOR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Frame of Reference Module: + * + * Frame of Reference: (UI, 1, 1) + * Position Reference Indicator: (LO, 2, 1) + * + */ +class DCMTK_DCMIOD_EXPORT IODFoRModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODFoRModule(OFshared_ptr item, + OFshared_ptr rules); + /** Constructor + */ + IODFoRModule(); + + /** Destructor + */ + virtual ~IODFoRModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("FrameOfReferenceModule") + */ + virtual OFString getName() const; + + /** Get Frame of Reference UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceUID(OFString &value, + const signed long pos = 0) const; + + /** Get Position Reference Indicator + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPositionReferenceIndicator(OFString &value, + const signed long pos = 0) const; + + /** Set Frame of Reference UID + * @param value Value to be set (single value only). If an empty string is passed, + * the value "1" is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Position Reference Indicator + * @param value Value to be set (single value only). If an empty string is passed, + * the value "1" is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPositionReferenceIndicator(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Make sure that the module contains a Frame of Reference Instance UID, i.e.\ + * a new one is created if empty. An invalid UID is corrected if desired. + * @param correctInvalid Correct invalid UID if OFTrue, otherwise do nothing + * + */ + void ensureFrameOfReferenceUID(const OFBool correctInvalid = OFFalse); + + +private: + + /// Module name "FrameOfReferenceModule" + static const OFString m_ModuleName; + +}; + +#endif // MODFOR_H diff --git a/dcmiod/include/dcmtk/dcmiod/modgeneralimage.h b/dcmiod/include/dcmtk/dcmiod/modgeneralimage.h new file mode 100644 index 00000000..7cb3402f --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modgeneralimage.h @@ -0,0 +1,361 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Image Module + * + */ + +#ifndef MODGENERALIMAGE_H +#define MODGENERALIMAGE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + + +/** Class representing the General Image Module: + * + * Instance Number: (IS, 1, 2) + * Patient Orientation: (CS, 2, 2) + * Content Date: (DA, 1, 2C) + * Content Time: (TM, 1, 2C) + * Image Type: (CS, 1, 2-n) + * Acquisition Number (IS, 1, 3) + * Acquisition Date (DA, 1, 3) + * Acquisition Time (TM, 1, 3) + * Acquisition Date Time (DT, 1, 3) + * Image Comments (LT, 1, 3) + * Burned In Annotation (CS, 1, 3) + * Recognizable Visual Features (CS, 1, 3) + * Lossy Image Compression (CS, 1, 3) + * Lossy Image Compression Ratio (DS, 1, 3) + * Lossy Image Compression Method (CS, 1-n, 3) + * Presentation LUT Shape (CS, 1, 3) + * Irradiation Event UID (CS, 1-n, 3) + * + */ +class DCMTK_DCMIOD_EXPORT IODGeneralImageModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODGeneralImageModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODGeneralImageModule(); + + /** Destructor + */ + virtual ~IODGeneralImageModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("GeneralImageModule") + */ + virtual OFString getName() const; + + /** Get Instance Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, + const signed long pos = 0); + + /** Get Patient Orientation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientOrientation(OFString &value, + const signed long pos = 0); + + /** Get Content Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentDate(OFString &value, + const signed long pos = 0); + + /** Get Content Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentTime(OFString &value, + const signed long pos = 0); + + /** Get Image Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageType(OFString &value, + const signed long pos = 0); + + /** Get Acquisition Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionNumber(OFString &value, + const signed long pos = 0); + + /** Get Acquisition Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDate(OFString &value, + const signed long pos = 0); + + /** Get Acquisition Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionTime(OFString &value, + const signed long pos = 0); + + /** Get Acquisition Date Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDateTime(OFString &value, + const signed long pos = 0); + + /** Get Image Comments + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageComments(OFString &value, + const signed long pos = 0); + + /** Get Burned In Annotation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBurnedInAnnotation(OFString &value, + const signed long pos = 0); + + /** Get Recognizable Visual Features + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRecognizableVisualFeatures(OFString &value, + const signed long pos = 0); + + /** Get Lossy Image Compression + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompression(OFString &value, + const signed long pos = 0); + + /** Get Lossy Image Compression + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(OFString &value, + const signed long pos = 0); + + /** Get Lossy Image Compression Method + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionMethod(OFString &value, + const signed long pos = 0); + + /** Get Presentation LUT Shape + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPresentationLUTShape(OFString &value, + const signed long pos = 0); + + /** Get Irridation Event UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIrradiationEventUID(OFString &value, + const signed long pos = 0); + + /** Set Instance Number + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient Orientation + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (2) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientOrientation(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Content Date + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentDate(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Content Time + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentTime(const OFString &value, + const OFBool checkValue = OFTrue); + + + /** Set Image Type + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (2-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageType(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Acquisition Number + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Acquisition Date + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDate(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Acquisition Time + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionTime(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Acquisition Date Time + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDateTime(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Image Comments + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageComments(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Burned In Annotation + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBurnedInAnnotation(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Recognizable Visual Features + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecognizableVisualFeatures(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompression(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression Ratio + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionRatio(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression method + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionMethod(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Presentation LUT Shape + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPresentationLUTShape(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Irradiation Event UID + * @param value Value to be set (single value only). + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIrradiationEventUID(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /// The module's name ("GeneralIamgeModule") + static const OFString m_ModuleName; +}; + +#endif // MODGENERALIMAGE_H diff --git a/dcmiod/include/dcmtk/dcmiod/modgeneralseries.h b/dcmiod/include/dcmtk/dcmiod/modgeneralseries.h new file mode 100644 index 00000000..38d16535 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modgeneralseries.h @@ -0,0 +1,323 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Series Module + * + */ + +#ifndef MODGENERALSERIES_H +#define MODGENERALSERIES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmiod/ioddef.h" +#include "dcmtk/dcmiod/iodmacro.h" + +/** Class representing the General Series Module: + * + * Modality: (CS, 1, 1) + * Series Instance Number: (UI, 1, 1) + * Series Number: (IS, 1, 2) + * Laterality: (CS, 1, 2C) + * Series Date: (DA, 1, 3) + * Series Time: (TM, 1, 3) + * Performing Physician's Name: (PN, 1, 3) + * Protocol Name: (LO, 1, 3) + * Series Description: (LO, 1, 3) + * Operators' Name: (PN, 1-n, 3) + * Body Part Examined: (CS, 1, 3) + * Patient Position: (CS, 1, 2C) + */ +class DCMTK_DCMIOD_EXPORT IODGeneralSeriesModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODGeneralSeriesModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODGeneralSeriesModule(); + + /** Destructor + */ + virtual ~IODGeneralSeriesModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Set missing values by inventing "default values". Automatically + * called during write() by IODComponent. + */ + virtual void inventMissing(); + + /** Get name of module + * @return Name of the module ("GeneralSeriesModule") + */ + virtual OFString getName() const; + + /** Make sure that the module contains a Series Instance UID, i.e.\ a new one + * is created if empty. An invalid UID is corrected if desired. + * @param correctInvalid Correct invalid UID if OFTrue, otherwise do nothing + */ + virtual void ensureInstanceUID(const OFBool correctInvalid = OFFalse); + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Get Modality + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, + const signed long pos = 0) const; + + /** Get series instance UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** Get Series Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, + const signed long pos = 0) const; + + /** Get Laterality + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLaterality(OFString &value, + const signed long pos = 0) const; + + /** Get Series Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, + const signed long pos = 0) const; + + /** Get Series Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, + const signed long pos = 0) const; + + /** Get Performing Physician's Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformingPhysicianName(OFString &value, + const signed long pos = 0) const; + + /** Get Protocol Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getProtocolName(OFString &value, + const signed long pos = 0) const; + + /** Get Series Description + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, + const signed long pos = 0) const; + + /** Get Operators' Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, + const signed long pos = 0) const; + + /** Get Body Part Examined + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBodyPartExamined(OFString &value, + const signed long pos = 0) const; + + /** Get Patient Position + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientPosition(OFString &value, + const signed long pos = 0) const; + + /** Get reference to Referenced Performed Procedure Step + * @return Reference to PPS + */ + virtual SOPInstanceReferenceMacro& getReferencedPPS(); + + /** Set Modality + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Series Instance UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Series Number + * @param value Value to be set (single value only). If an empty string is, + * passed, the value "1" is set when displaying or writing the document + * since the corresponding DICOM attribute is mandatory. + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Laterality + * @param value Value to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLaterality(const DcmIODTypes::IOD_LATERALITY value, + const OFBool checkValue = OFTrue); + + /** Set Series Date + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DA) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Series Time + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Performing Physician Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformingPhysicianName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Protocol Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setProtocolName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Series Description + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Operators' Name + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1-n) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Body Part Examined + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBodyPartExamined(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient Position + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientPosition(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /// The name of this module ("GeneralSeriesModule") + static const OFString m_ModuleName; + + /// Referenced Performed Procedure Step Sequence + SOPInstanceReferenceMacro m_ReferencedPPS; + +}; + +#endif // MODGENERALSERIES_H diff --git a/dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h b/dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h new file mode 100644 index 00000000..70d289cd --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h @@ -0,0 +1,245 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Study Module + * + */ + +#ifndef MODGENERALSTUDY_H +#define MODGENERALSTUDY_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmiod/iodmacro.h" + +/** Class representing the General Study Module: + * Notation is "Attribute Name: (VR, VM, Type)" + * + * Study Instance UID: (UI, 1, 1) + * Study Date: (DA, 1, 2) + * Study Time: (TM, 1, 2) + * Referring Physician's Name: (PN, 1, 2) + * Study ID: (SH, 1, 2) + * Accession Number: (SH, 1, 2) + * Study Description: (LO, 1, 3) + * Issuer of Accession Number Sequence: (SQ, 1, 3) + * Procedure Code Sequence: (SQ, 1-n, 3) + * Reason for Performed Procedure Code Sequence: (SQ, 1-n, 3) + */ +class DCMTK_DCMIOD_EXPORT IODGeneralStudyModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODGeneralStudyModule(OFshared_ptr item, + OFshared_ptr rules); + /** Constructor + */ + IODGeneralStudyModule(); + + /** Destructor + */ + virtual ~IODGeneralStudyModule(); + + /** Set missing values by inventing "default values". Automatically + * called during write() by IODComponent. + */ + virtual void inventMissing(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("GeneralStudyModule") + */ + virtual OFString getName() const; + + /** Clear (removes) all attributes handled by the modules of this component. + * Rules are not reset. + */ + virtual void clearData(); + + /** Read data into this module from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data in this module is cleared first (default: OFTrue) + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write this module to given item + * @param destination The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Make sure that the module contains a Study Instance UID, i.e.\ a new one + * is created if empty. An invalid UID is corrected if desired. + * @param correctInvalid Correct invalid UID if OFTrue, otherwise do nothing + */ + virtual void ensureInstanceUID(const OFBool correctInvalid = OFFalse); + + /** Get Study Instance UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** Get Study Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, + const signed long pos = 0) const; + + /** Get Study Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, + const signed long pos = 0) const; + + /** Get Referring Physician's Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, + const signed long pos = 0) const; + + /** Get Study ID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, + const signed long pos = 0) const; + + /** Get Accession Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, + const signed long pos = 0) const; + + /** Get Study Description + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, + const signed long pos = 0) const; + + /** Get reference to content of Issuer of Accession Number Sequence + * @return Reference to single item of Issuer of Accession Number Sequence + */ + virtual HL7HierarchicDesignatorMacro& getIssuerOfAccesionNumber(); + + /** Get reference to content of Procedure Code Sequence + * @return Reference to items of Procedure Code Sequence + */ + virtual OFVector& getProcedureCodeSequence(); + + /** Get reference to content of Reason for Performed Procedure Code Sequence + * @return Reference to items of Procedure Code Sequence + */ + virtual OFVector& getReasonForPerformedProcedureCodeSequence(); + + /** Set Study Instance UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Study Date + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, + const OFBool checkValue = OFTrue); + + /** set study time + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, + const OFBool checkValue = OFTrue); + /** Set Referring Physician's Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Study ID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Accession Number + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Study Description + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /// Name of this module ("GeneralStudyModule") + static const OFString m_ModuleName; + + /// Issuer of Accession Number Sequence + HL7HierarchicDesignatorMacro m_IssuerOfAccessionNumberSequence; + + /// Procedure Code Sequence + OFVector m_ProcedureCodeSequence; + + /// Reason for Performed Procedure Code Sequence + OFVector m_ReasonForPerformedProcedureCodeSequence; + +}; + +#endif // MODGENERALSTUDY_H diff --git a/dcmiod/include/dcmtk/dcmiod/modhelp.h b/dcmiod/include/dcmtk/dcmiod/modhelp.h new file mode 100644 index 00000000..5853f506 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modhelp.h @@ -0,0 +1,210 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken, Andriy Fedorov + * + * Purpose: Helper functions for copying common modules between datasets + * + */ + +#ifndef MODHELP_H +#define MODHELP_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oftypes.h" + +#include "dcmtk/dcmiod/ioddef.h" +// forward declarations +class DcmTagKey; +class DcmItem; + + +/** This class contains helper functions that permit copying common modules + * from DICOM standard part 3 between DICOM datasets. + * @note The attribute lists per module are taken from the final text version + * of DICOM 2013. + */ +class DCMTK_DCMIOD_EXPORT DcmModuleHelpers { + + protected: + + /// Generic copy module helper method. + template + static inline void copyModule(const DcmTagKey (&tags)[N], + DcmItem& src, DcmItem& dest); + + /// List of tags within the Patient Module + static const DcmTagKey patientModuleTags[]; + + /// List of tags within the Clinical Trial Subject Module + static const DcmTagKey clinicalTrialSubjectModuleTags[]; + + /// List of tags within the General Study Module + static const DcmTagKey generalStudyModuleTags[]; + + /// List of tags within the Patient Study Module + static const DcmTagKey patientStudyModuleTags[]; + + /// List of tags within the Clinical Trial Study Module + static const DcmTagKey clinicalTrialStudyModuleTags[]; + + /// List of tags within the General Series Module + static const DcmTagKey generalSeriesModuleTags[]; + + /// List of tags within the Clinical Trial Series Module + static const DcmTagKey clinicalTrialSeriesModuleTags[]; + + /// List of tags within the General Equipment Module + static const DcmTagKey generalEquipmentModuleTags[]; + + /// List of tags within the Frame of Reference Module + static const DcmTagKey frameOfReferenceModuleTags[]; + + /// List of tags within the SOP Common Module, excluding Digital Signatures + /// Macro, i.e.\ MAC Parameters Sequence and Digital Signatures Sequence + static const DcmTagKey sopCommonModuleTags[]; + + /// List of tags within the General Image Module + static const DcmTagKey generalImageModuleTags[]; + + public: + + /** Copy element defined by tag from source item to destination item. + * No in-depth search is performed but only the main level is searched + * for the given tag. If the tag is not found, the destination item + * is not touched at all. + * @param tag Tag key of the element to be copied + * @param src Item that serves as a source for copying the element. + * In typical image objects, this will be the main dataset. + * @param dest Item that serves as a destination for inserting the + * copied element, if found. + */ + static void copyElement(const DcmTagKey& tag, DcmItem& src, DcmItem& dest); + + /** Copy Patient Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyPatientModule(DcmItem& src, DcmItem& dest); + + /** Copy Clinical Trial Subject Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyClinicalTrialSubjectModule(DcmItem& src, DcmItem& dest); + + /** Copy General Study Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyGeneralStudyModule(DcmItem& src, DcmItem& dest); + + /** Copy Patient Study Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyPatientStudyModule(DcmItem& src, DcmItem& dest); + + /** Copy Clinical Trial Study Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyClinicalTrialStudyModule(DcmItem& src, DcmItem& dest); + + /** Copy General Series Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyGeneralSeriesModule(DcmItem& src, DcmItem& dest); + + /** Copy Clinical Trial Series Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyClinicalTrialSeriesModule(DcmItem& src, DcmItem& dest); + + /** Copy General Equipment Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyGeneralEquipmentModule(DcmItem& src, DcmItem& dest); + + /** Copy Frame of Reference Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copyFrameOfReferenceModule(DcmItem& src, DcmItem& dest); + + /** Copy SOP Common Module attributes. + * Excludes: Digital Signatures Macro, i.e.\ MAC Parameters Sequence and + * Digital Signatures Sequence. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + * destination item. + */ + static void copySOPCommonModule(DcmItem& src, DcmItem& dest); + + /** Copy General Image Module attributes. + * @param src Item to copy module from. Only the main level is searched, + * i.e.\ no in-depth search is performed on the various tags. + * @param dest Item to copy module to. An element not found within + * the source item will neither be created in the destination + * item, nor will any existing value be touched in the + + * destination item. + */ + static void copyGeneralImageModule(DcmItem& src, DcmItem& dest); +}; + +#endif // MODHELP_H diff --git a/dcmiod/include/dcmtk/dcmiod/modimagepixel.h b/dcmiod/include/dcmtk/dcmiod/modimagepixel.h new file mode 100644 index 00000000..281edf59 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modimagepixel.h @@ -0,0 +1,215 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Image Pixel Module + * + */ + +#ifndef MODIMAGEPIXEL_H +#define MODIMAGEPIXEL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modimagepixelbase.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +/** Class representing the Image Pixel Module: + * + * Samples Per Pixel: (US, 1, 1) + * Photometric Interpretation (CS, 1, 1) + * Rows: (US, 1, 1) + * Columns: (US, 1, 1) + * Bits Allocated: (US, 1, 1) + * Bits Stored: (US, 1, 1) + * High Bit: (US, 1, 1) + * Pixel Representation: (US, 1, 1) + * Pixel Data is left out for now + * Planar Configuration: (US, 1, 1C) + * Pixel Aspect Ratio: (IS, 2, 1C) + * ICC Profile: (OB, 1, 3) + */ +template +class DCMTK_DCMIOD_EXPORT IODImagePixelModule : public IODImagePixelBase +{ + +public: + + /// Data type of pixels + typedef T value_type; + + static const DcmTagKey pixel_data_tag; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODImagePixelModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODImagePixelModule(); + + /** Destructor + */ + virtual ~IODImagePixelModule(); + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("ImagePixelModule") + */ + virtual OFString getName() const; + + /** Get pixel data type, always returns DataType::INTEGER for this class. + * @return The data type of the pixel data + */ + virtual DataType getDataType() const; + + /** Get Bits Stored + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsStored(Uint16& value, + const signed long pos = 0); + + /** Get High Bit + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getHighBit(Uint16& value, + const signed long pos = 0); + + /** Get Pixel Representation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelRepresentation(Uint16& value, + const signed long pos = 0); + + /** Get Planar Configuration + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPlanarConfiguration(Uint16& value, + const signed long pos = 0); + + /** Get ICC Profile + * @param values Reference to variable in which the values should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getICCProfile(OFVector& values); + + /** Set Samples per Pixel + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (US) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSamplesPerPixel(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Photometric Interpretation + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhotometricInterpretation(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Bits Allocated + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsAllocated(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Bits Stored + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsStored(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set High Bit + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setHighBit(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Pixel Representation + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (US) and consistency + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelRepresentation(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Planar Configuration + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value' for conformance with VR (US) and consistency + * with other attributes if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPlanarConfiguration(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set ICC Profile + * @param values Reference to variable in which the values should be stored + * @param length Length of array provided in values parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setICCProfile(const Uint8* values, + const size_t length); + +private: + + /// This module's name ("ImagePixelModule") + static const OFString m_ModuleName; + +}; + +#endif // MODIMAGEPIXEL_H diff --git a/dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h b/dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h new file mode 100644 index 00000000..7455e020 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h @@ -0,0 +1,168 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Base class for Image Pixel Module and related (e.g. Ploating Point) + * + */ + +#ifndef MODIMAGEPIXELBASE_H +#define MODIMAGEPIXELBASE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Base class for deriving Image Pixel Module, Floating Point Image Pixel + * Module and Double Floating Point Image Pixel (and maybe more later) + */ +class DCMTK_DCMIOD_EXPORT IODImagePixelBase : public IODModule +{ + +public: + + enum DataType + { + DATA_TYPE_UNKNOWN, + DATA_TYPE_FLOAT, + DATA_TYPE_DOUBLE, + DATA_TYPE_INTEGER + }; + + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODImagePixelBase(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODImagePixelBase(); + + /** Destructor + */ + virtual ~IODImagePixelBase(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("ImagePixelModule") + */ + virtual OFString getName() const; + + /** Get pixel data type + * @return The data type of the pixel data + */ + virtual DataType getDataType() const = 0; + + // ------------------------------------------------------------------------- + // Getters for all attribute that appear in all Image Pixel Modules + // ------------------------------------------------------------------------- + + /** Get Samples per Pixel + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSamplesPerPixel(Uint16 &value, + const signed long pos = 0); + + /** Get Photometric Interpretation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhotometricInterpretation(OFString&value, + const signed long pos = 0); + + /** Get Rows + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRows(Uint16& value, + const signed long pos = 0); + + /** Get Columns + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getColumns(Uint16& value, + const signed long pos = 0); + + /** Get Bits Allocated + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsAllocated(Uint16& value, + const signed long pos = 0); + + /** Get Pixel Aspect Ratio + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelAspectRatio(Uint16& value, + const signed long pos = 0); + + // ------------------------------------------------------------------------- + // Setters for all attribute that appear in all Image Pixel Modules and which + // do not have fixed values in sub classes. + // ------------------------------------------------------------------------- + + /** Set Rows + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRows(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Columns + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setColumns(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Pixel Aspect Ratio + * @param verticalPixelSize The vertical pixel size (no unit) + * @param horizontalPixelSize The horizontal pixel size (no unit) + * @param checkValue Check 'value' for conformance with VR (IS) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelAspectRatio(const OFString& verticalPixelSize, + const OFString& horizontalPixelSize, + const OFBool checkValue = OFTrue); + +private: + + /// This module's name ("ImagePixelBase") + static const OFString m_ModuleName; + +}; + +#endif // MODIMAGEPIXELBASE_H diff --git a/dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h b/dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h new file mode 100644 index 00000000..c4adb545 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h @@ -0,0 +1,281 @@ +/* + * + * Copyright (C) 2016-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Base class for Image Pixel Module and related (e.g. Ploating Point) + * + */ + +#ifndef MODIMAGEPIXELVARIANT_H +#define MODIMAGEPIXELVARIANT_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofvriant.h" +#include "dcmtk/dcmiod/modimagepixelbase.h" + + +/** Visitor for returning base class of given Image Pixel Module + */ +struct IODImagePixelVariantBaseVisitor +{ + + /** Returns NULL since given argument is no pixel module at all + * @return OFnullptr + */ + IODImagePixelBase* operator()( OFmonostate& ) + { + return OFnullptr; + } + + /** Returns the base class pointer of all pixel modules + * @param base IODImagePixelBase pointer to given class instance + * @return OFnullptr + */ + IODImagePixelBase* operator()( IODImagePixelBase& base ) + { + return &base; + } +}; + +/** Class representing different pixel modules from the DICOM standard: + * The class Image Pixel Module, the Floating Point Image Pixel module + * and the Double Floating Point Image Pixel module + */ +#ifdef HAVE_CXX11 +template +class IODImagePixelVariant +: public OFvariant +#else +template +class IODImagePixelVariant +: public OFvariant +#endif +{ + +public: + + /** Constructor + */ + IODImagePixelVariant() + : IODImagePixelVariant::variant() + { + + } + + /** Constructor, constructs pixel module based on given type + */ + template + IODImagePixelVariant(const T& t) + : IODImagePixelVariant::variant(t) + { + + } + + /** Destructor + */ + ~IODImagePixelVariant() + { + + } + + /** Get name of module + * @return Name of the actual module (e.g. "ImagePixelModule") + */ + OFString getName() const + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getName(); + return OFString(); + } + + /** Get pixel data type + * @return The data type of the pixel data + */ + IODImagePixelBase::DataType getDataType() const + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getDataType(); + return IODImagePixelBase::DATA_TYPE_UNKNOWN; + } + + /** Clear data (base class version) + */ + void clearData() + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + pBase->clearData(); + } + + // ------------------------------------------------------------------------- + // Getters for all attribute that appear in all Image Pixel Modules + // ------------------------------------------------------------------------- + + /** Get Samples per Pixel + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getSamplesPerPixel(Uint16 &value, + const signed long pos = 0) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getSamplesPerPixel(value, pos); + return IOD_EC_InvalidPixelData; + } + + /** Get Photometric Interpretation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getPhotometricInterpretation(OFString&value, + const signed long pos = 0) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getPhotometricInterpretation(value, pos); + return IOD_EC_InvalidPixelData; + } + + /** Get Rows + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getRows(Uint16& value, + const signed long pos = 0) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getRows(value, pos); + return IOD_EC_InvalidPixelData; + } + + /** Get Columns + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getColumns(Uint16& value, + const signed long pos = 0) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getColumns(value, pos); + return IOD_EC_InvalidPixelData; + } + + /** Get Bits Allocated + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getBitsAllocated(Uint16& value, + const signed long pos = 0) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getBitsAllocated(value, pos); + return IOD_EC_InvalidPixelData; + } + + /** Get Pixel Aspect Ratio + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getPixelAspectRatio(Uint16& value, + const signed long pos = 0) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->getPixelAspectRatio(value, pos); + return IOD_EC_InvalidPixelData; + } + + // ------------------------------------------------------------------------- + // Setters for all attribute that appear in all Image Pixel Modules and which + // do not have fixed values in sub classes. + // ------------------------------------------------------------------------- + + /** Set Rows + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition setRows(const Uint16 value, + const OFBool checkValue = OFTrue) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->setRows(value, checkValue); + return IOD_EC_InvalidPixelData; + + } + + /** Set Columns + * @param value Reference to variable in which the value should be stored + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition setColumns(const Uint16 value, + const OFBool checkValue = OFTrue) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->setColumns(value, checkValue); + return IOD_EC_InvalidPixelData; + + } + + /** Set Pixel Aspect Ratio + * @param verticalPixelSize The vertical pixel size (no unit) + * @param horizontalPixelSize The horizontal pixel size (no unit) + * @param checkValue Check 'value' for conformance with VR (IS) + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition setPixelAspectRatio(const OFString& verticalPixelSize, + const OFString& horizontalPixelSize, + const OFBool checkValue = OFTrue) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->setPixelAspectRatio(verticalPixelSize, horizontalPixelSize, checkValue); + return IOD_EC_InvalidPixelData; + + } + + /** Write pixel module base class data to given item + * @param dataset The item to write to (usually dataset level) + * @return EC_Normal if successful, error otherwise + */ + OFCondition write(DcmItem& dataset) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->write(dataset); + return IOD_EC_InvalidPixelData; + + } + + /** Read pixel module base class data from given item + * @param dataset The item to read from (usually dataset level) + * @return EC_Normal if successful, error otherwise + */ + OFCondition read(DcmItem& dataset) + { + if (IODImagePixelBase* pBase = OFvisit(IODImagePixelVariantBaseVisitor(), *this)) + return pBase->read(dataset); + return IOD_EC_InvalidPixelData; + } + +}; + +#endif // MODIMAGEPIXELBASE_H diff --git a/dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h b/dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h new file mode 100644 index 00000000..83ff45ed --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h @@ -0,0 +1,386 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Multi-Frame Dimension Module + * + */ + +#ifndef MODMULTIFRAMEDIMENSION_H +#define MODMULTIFRAMEDIMENSION_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Multi-Frame Dimension Module: + * + * Dimension Organization Sequence: (SQ, VM 1-n, Type 1) + * > Dimension Organization UID: (UI, 1, 1) + * Dimension Organization Type: (CS, 1, 1) + * Dimension Index Sequence: (SQ, 1-n, 1) + * > Dimension Index Pointer (AT, 1, 1) + * > Dimension Index Private Creator (LO, 1, 1C) + * > Functional Group Pointer (AT, 1, 1C) + * > Functional Group Private Creator (LO, 1, 1C) + * > Dimension Organization UID (UI, 1, 1C) + * > Dimension Description Label (LO, 1, 3) + * + * The Dimension Organization UIDs within the Dimension Organization Sequence + * cannot be set explicitly. Instead the sequence is populated from the data + * found within the Dimension Index Sequence. + */ +class DCMTK_DCMIOD_EXPORT IODMultiframeDimensionModule : public IODModule +{ + +public: + + /** Helper class representing an item within the Dimension Index Sequence, + * i.e.\ a single dimension description + */ + class DimensionOrganizationItem : public IODComponent + { + + public: + + /** Constructor + * @param data The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + DimensionOrganizationItem(OFshared_ptr data, + OFshared_ptr rules, + IODComponent* parent); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + DimensionOrganizationItem(IODComponent* parent = NULL); + + /** Destructor + */ + virtual ~DimensionOrganizationItem(); + + /** Get name of module ("DimensionIndexPointerSequence") + * @return Name of the module ("DimensionIndexPointerSequence") + */ + virtual OFString getName() const; + + /** Resets rules of this module to their original values + */ + virtual void resetRules(); + + /** Get Dimension Organization UID + * @param value Reference to variable in which the value should be + * stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDimensionOrganizationUID(OFString &value, + const signed long pos = 0) const; + + /** Set Dimension Organization UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDimensionOrganizationUID(const OFString& value, + const OFBool checkValue = OFTrue); + }; + + /** Class representing a Dimension Index Pointer Sequence Item + * managed by the Multi-frame Dimension Module + */ + class DimensionIndexItem : public IODComponent + { + + public: + + /** Constructor + * @param data The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + DimensionIndexItem(OFshared_ptr data, + OFshared_ptr rules, + IODComponent* parent); + + /** Constructor + * @param parent The parent of the IOD component (NULL if none or unknown) + */ + DimensionIndexItem(IODComponent* parent = NULL); + + /** Destructor + */ + virtual ~DimensionIndexItem(); + + /** Get name of module ("DimensionIndexSequence") + * @return Name of the module ("[parent.]DimensionIndexSequence") + */ + virtual OFString getName() const; + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get Dimension Index Pointer + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDimensionIndexPointer(DcmTagKey &value, + const signed long pos = 0) const; + + /** Get Dimension Index Private Creator + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDimensionIndexPrivateCreator(OFString& value, + const signed long pos = 0) const; + + /** Get Functional Group Pointer + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFunctionalGroupPointer(DcmTagKey &value, + const signed long pos = 0) const; + + /** Get Functional Group Private Creator + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFunctionalGroupPrivateCreator(OFString &value, + const signed long pos = 0) const; + + /** Get Dimension Organization UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDimensionOrganizationUID(OFString &value, + const signed long pos = 0) const; + + /** Get Dimension Description Label + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDimensionDescriptionLabel(OFString &value, + const signed long pos = 0) const; + + /** Set Dimension Index Pointer + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDimensionIndexPointer(const DcmTagKey&value, + const OFBool checkValue = OFTrue); + + /** Set Dimension Index Private Creator + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDimensionIndexPrivateCreator(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Dimension Index Functional Group Pointer + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFunctionalGroupPointer(const DcmTagKey& value, + const OFBool checkValue = OFTrue); + + /** Set Dimension Index Functional Group Private Creator + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value. Not evaluated (here for consistency + * with other setter functions). + * + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFunctionalGroupPrivateCreator(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Dimension Organization UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR and VM if enabled + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDimensionOrganizationUID(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Dimension Description Label + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR and VM if enabled + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDimensionDescriptionLabel(const OFString& value, + const OFBool checkValue = OFTrue); + }; + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODMultiframeDimensionModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODMultiframeDimensionModule(); + + /** Destructor + */ + virtual ~IODMultiframeDimensionModule(); + + /** Convenience method to add Dimension Index. + * @param dimensionIndexPointer The Dimension Index Pointer attribute + * @param dimensionOrganizationUID The Dimension Organization UID of the dimension organization + * the pointer refers to. If UID does not exist yet (in the Dimension + * Organization Sequence, it is created there automatically). + * @param functionalGroupPointer The functional group where the pointer attribute can be found + * @param dimensionDescriptionLabel The description label of this dimension (optional) + * @param dimensionIndexPrivateCreator The private creator of the Dimension Index Pointer + * attribute. Required if dimensionIndexPointer points to a private attribute tag. + * @param functionalGroupPrivateCreator The private creator of the functional group. Required + * if functionalGroupPointer points to a private attribute tag. + * @return EC_Normal if index could be added, error otherwise (basic parameter checking) + * + */ + virtual OFCondition addDimensionIndex(const DcmTagKey& dimensionIndexPointer, + const OFString& dimensionOrganizationUID, + const DcmTagKey& functionalGroupPointer, + const OFString& dimensionDescriptionLabel = "", + const OFString& dimensionIndexPrivateCreator = "", + const OFString& functionalGroupPrivateCreator = ""); + + /** Clear (removes) all attributes handled by the modules of this component. + * Rules are not reset. + */ + virtual void clearData(); + + /** Read data into this module from given item + * @param source The item to read from + * @param clearOldData If OFTrue, old data in this module is cleared first (default: OFTrue) + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write this module to given item + * @param destination The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Resets rules to their original values. + */ + virtual void resetRules(); + + /** Get name of module ("MultiframeDimensionModule") + * @return Name of the module ("MultiframeDimensionModule") + */ + virtual OFString getName() const; + + /** Get Dimension Organization Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDimensionOrganizationType(OFString &value, + const signed long pos = 0) const; + + /** Set Dimension Organization Type (Defined Terms as of DICOM 2014a "3D" and "3D_TEMPORAL") + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR and VM if enabled + * @return status EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDimensionOrganizationType(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Get content of the Dimension Index Sequence + * @return Reference to the Dimension Index Pointer Sequence + */ + virtual OFVector& getDimensionIndexSequence(); + + /** Get content of the Dimension Organization Sequence + * @return Reference to the Dimension Organization Sequence + */ + virtual OFVector& getDimensionOrganizationSequence(); + + + /** Check dimensions for consistency with functional groups. Note that one can provide + * an item that provides the dataset containing the functional groups to check against. + * This item must contain on main level the Shared and Per-frame Functional Group + * Sequence. If no item is given (NULL pointer) it is tried to find these sequences + * within "this" object which works in the case that this class was initialized with + * an existing item (or the fg data was inserted in another way afterwards). + * @param fgItem The item containing functional group information + * @return EC_Normal, if consistency is fine, error otherwise + */ + virtual OFCondition checkDimensions(DcmItem* fgItem = NULL); + + /** Get specific index pointer element from per-frame functional group + * sequence. Prints out error messages if index does not exist or + * index location information provided by parameters is incomplete or invalid + * @param perFrameFG An instance of the Per-Frame Functional Group Sequence that + * should be searched + * @param fgPointer The tag key of the functional group the value resides in + * @param indexPointer The tag of the dimension value inside the functional group + * @param fgPrivateCreator The private creator of the fgPointer tag key. Only required + * if fgPointer is a private tag key (odd element number) + * @param privateCreator The private creator of the indexPointer tag key. Only required + * if indexPointer is a private tag key (odd element number) + * @return The element pointed to. If element could not be located, NULL is returned. + */ + virtual DcmElement* getIndexElement(DcmSequenceOfItems* perFrameFG, + const DcmTagKey& fgPointer, + const DcmTagKey& indexPointer, + const OFString& fgPrivateCreator, + const OFString& privateCreator); + +protected: + + /** Go over Dimension Index Pointers and extract Dimension Organization UIDs for + * Dimension Organization Sequence. + */ + void createDimensionOrganizationData(); + +private: + + /// This module's name (MultiframeDimensionModule) + static const OFString m_ModuleName; + + /// Vector with all items of the Dimension Index Pointer Sequence + OFVector m_DimensionIndexSequence; + + /// Vector with all items of the Dimension Organization Sequence + OFVector m_DimensionOrganizationSequence; +}; + +#endif // MODMULTIFRAMEDIMENSION_H diff --git a/dcmiod/include/dcmtk/dcmiod/modmultiframefg.h b/dcmiod/include/dcmtk/dcmiod/modmultiframefg.h new file mode 100644 index 00000000..213db6d8 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modmultiframefg.h @@ -0,0 +1,292 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Multi-frame Functional Groups Module + * + */ + +#ifndef MODMULTIFRAMEFG_H +#define MODMULTIFRAMEFG_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/ioddef.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class managing the data from the Multi-Frame Functional Group Module. The + * actual functional groups are not included and can be interfaced by the + * FGInterface class in module "dcmfg". + */ +class DCMTK_DCMIOD_EXPORT IODMultiFrameFGModule : public IODModule +{ + +public: + + // Forward declaration + class ConcatenationInfo; + + /** Constructor + * @param data The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODMultiFrameFGModule(OFshared_ptr data, + OFshared_ptr rules); + + /** Constructor + */ + IODMultiFrameFGModule(); + + /** Virtual destructor + */ + virtual ~IODMultiFrameFGModule(); + + /** Get name of the module ("MultiframeFunctionalGroupsModule") + * @return Name of the module ("MultiframeFunctionalGroupsModule") + */ + virtual OFString getName() const; + + /** Reset attribute rules to their default values + */ + virtual void resetRules(); + + // -- getters -- + + /** Get Instance Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, + const unsigned int pos = 0); + + /** Get Content Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentDate(OFString &value, + const signed long pos = 0); + + /** Get Content Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentTime(OFString &value, + const signed long pos = 0); + + /** Get Number of Frames + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFrames(Sint32 &value, + const unsigned int pos = 0); + + /** Get Representative Frame Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRepresentativeFrameNumber(Uint16 &value, + const unsigned int pos = 0); + + /** Get Concatenation Information + * @return Reference to the concatenation information + */ + virtual ConcatenationInfo& getConcatenationInfo(); + + // -- setters -- + + /** Set Instance Number + * @param value Value to be stored + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Content Date + * @param value Value to be stored + * @param checkValue Check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentDate(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Content Time + * @param value Value to be stored + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentTime(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Number of Frames + * @param value Value to be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNumberOfFrames(const Uint32 value); + + /** Set Representative Frame Number + * @param value Value to be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRepresentativeFrameNumber(const Uint16 value); + + /** Set concatenation information + * @param concatenationInfo The concatenation info to set + * @return EC_Normal if successful, error otherwise + */ + virtual OFCondition setConcatenationInfo(const ConcatenationInfo& concatenationInfo); + + /** Helper class encapsulating concatenation information, including + * Concatenation Frame Offset Number, + * Concatenation UID, + * SOP Instance UID of Concatenation Source, + * In-concatenation Number, + * In-concatenation Total Number + */ + class DCMTK_DCMIOD_EXPORT ConcatenationInfo : public IODComponent + { + + public: + + /** Constructor + * @param data The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set where this classes rules are added to. If NULL, the + * class creates an empty rule set. + */ + ConcatenationInfo(OFshared_ptr data, + OFshared_ptr rules); + + /** Constructor + * @param parent The parent component of this class (if applicable, might be NULL) + */ + ConcatenationInfo(IODComponent* parent = NULL); + + /** Virtual destructor + */ + virtual ~ConcatenationInfo(); + + /** Resets attribute rules to their default values + */ + virtual void resetRules(); + + /** Get name of this component ("ConcatenationInfo") + */ + virtual OFString getName() const; + + // -- getters -- + + /** Get Concatenation Frame Offset Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getConcatenationFrameOffsetNumber(Uint32& value, + const unsigned int pos); + + /** Get Concatenation UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getConcatenationUID(OFString& value, + const signed long pos); + + /** Get SOP Instance UID of Concatenation Source + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getSOPInstanceUIDOfConcatenationSource(OFString& value, + const signed long pos); + + /** Get Concatenation Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getInConcatenationNumber(Uint16& value, + const unsigned int pos); + + /** Get Concatenation Total Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getInConcatenationTotalNumber(Uint16& value, + const unsigned int pos); + + // -- setters -- + + /** Set Concatenation Frame Offset Number + * @param value Value to be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConcatenationFrameOffsetNumber(const Uint32 value); + + /** Set Concatenation UID + * @param value Value to be stored + * @param checkValue If OFTrue, the value is checked for conformance + * (VR = UID and VM = 1). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConcatenationUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set SOP Instance UID of Concatenation Source + * @param value Value to be stored + * @param checkValue If OFTrue, the value is checked for conformance + * (VR = UID and VM = 1). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUIDOfConcatenationSource(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set In-concatenation Number + * @param value Value to be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInConcatenationNumber(const Uint16 value); + + /** Set In-concatenation Total Number + * @param value Value to be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInConcatenationTotalNumber(const Uint16 value); + + }; // ConcatenationInfoClass + + +private: + + /// Concatenation Information + ConcatenationInfo m_ConcatenationInfo; + + /// Module name ("MultiframeFunctionalGroupsModule" + static const OFString m_ModuleName; +}; + +#endif // MODMULTIFRAMEFG_H diff --git a/dcmiod/include/dcmtk/dcmiod/modpatient.h b/dcmiod/include/dcmtk/dcmiod/modpatient.h new file mode 100644 index 00000000..3e9422cc --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modpatient.h @@ -0,0 +1,141 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Patient Module + * + */ + +#ifndef MODPATIENT_H +#define MODPATIENT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Patient Module: + * + * Patient's Name: (PN, 1, 2) + * Patient ID: (LO, 1, 2) + * Patient's Birth Date: (DA, 1, 2) + * Patient's Sex: (CS, 1, 2) + */ +class DCMTK_DCMIOD_EXPORT IODPatientModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODPatientModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODPatientModule(); + + /** Destructor + */ + virtual ~IODPatientModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("PatientModule") + * @return Name of the module ("PatientModule") + */ + virtual OFString getName() const; + + /** Get Patient's Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, + const signed long pos = 0) const; + + /** Get Patient ID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, + const signed long pos = 0) const; + + /** Get Patient's Birth Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, + const signed long pos = 0) const; + + /** Get Patient's Sex + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, + const signed long pos = 0) const; + + + /** Set Patient's Name + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient ID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient's Birth Date + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient's Sex + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /// The name of this module ("PatientModule") + static const OFString m_ModuleName; +}; + +#endif // MODPATIENT_H diff --git a/dcmiod/include/dcmtk/dcmiod/modpatientstudy.h b/dcmiod/include/dcmtk/dcmiod/modpatientstudy.h new file mode 100644 index 00000000..11181e26 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modpatientstudy.h @@ -0,0 +1,145 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Patient Study Module + * + */ + +#ifndef MODPATIENTSTUDY_H +#define MODPATIENTSTUDY_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofoption.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Patient Study Module: + * + * Admitting Diagnoses Description: (LO, 1-n, 3) + * Patient's Age: (AS, 1, 3) + * Patient's Size: (DS, 1, 3) + * Patient's Weight: (DS,1, 3) + */ +class DCMTK_DCMIOD_EXPORT IODPatientStudyModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODPatientStudyModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODPatientStudyModule(); + + /** Destructor + */ + virtual ~IODPatientStudyModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("PatientStudyModule") + * @return Name of the module ("PatientStudyModule") + */ + virtual OFString getName() const; + + /** Get Admitting Diagnoses Description + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString& value, + const signed long pos = 0) const; + + /** Get Patient's Age (string as defined by VR "AS", see DICOM part 5) + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, + const signed long pos = 0) const; + + /** Get Patient's Weight (in kilograms) + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, + const unsigned long pos = 0) const; + + /** Get Patient's Size (in meters) + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, + const unsigned long pos = 0) const; + + /** Set Admitting Diagnoses Description + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1-n) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient's Age (formatted as defined by VR "AS", see part 5 of the standard) + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (AS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient's Size (in meters) + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Patient's Weight (in kilograms) + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /// The name of this module ("PatientStudyModule") + static const OFString m_ModuleName; +}; + +#endif // MODPATIENT_H diff --git a/dcmiod/include/dcmtk/dcmiod/modsegmentationseries.h b/dcmiod/include/dcmtk/dcmiod/modsegmentationseries.h new file mode 100644 index 00000000..901825d2 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modsegmentationseries.h @@ -0,0 +1,141 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Segmentation Series Module + * + */ + +#ifndef MODSEGMENTATIONSERIES_H +#define MODSEGMENTATIONSERIES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Segmentation Series Module: + * + * Modality: (CS, 1, 1) + * Series Number: (IS, 1, 2) + * ReferencedPerformedProcedureStepSequence: (SQ, 1, 1C) + * -> Referenced SOP Class UID: (UI, 1, 1) + * -> Referenced SOP Instance UID: (UI, 1, 1) + */ +class DCMTK_DCMIOD_EXPORT IODSegmentationSeriesModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODSegmentationSeriesModule(OFshared_ptr item, + OFshared_ptr rules); + /** Constructor + */ + IODSegmentationSeriesModule(); + + /** Destructor + */ + virtual ~IODSegmentationSeriesModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of this module + * @return Name of the module ("SegmentationSeriesModule") + */ + virtual OFString getName() const; + + /** Get Modality (always returns "SEG") + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, + const signed long pos = 0) const; + + /** Get Series Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, + const signed long pos = 0) const; + + /** Get Referenced PPS SOP Class UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPPSSOPClassUID(OFString &value, + const signed long pos = 0) const; + + /** Get Referenced PPS SOP Instance UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPPSSOPInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** Set Series Number + * @param value Value to be set (single value only). If an empty string is passed, + * the value "1" is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Referenced PPS SOP Class UID + * @param value Value to be set (single value only). If an empty string is passed, + * the value "1" is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPPSSOPClassUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Referenced PPS SOP Instance UID + * @param value Value to be set (single value only). If an empty string is passed, + * the value "1" is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPPSSOPInstanceUID(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + + /// Name of this module ("SegmentationSeriesModule") + static const OFString m_ModuleName; + +}; + +#endif // MODSEGMENTATIONSERIES_H diff --git a/dcmiod/include/dcmtk/dcmiod/modsopcommon.h b/dcmiod/include/dcmtk/dcmiod/modsopcommon.h new file mode 100644 index 00000000..ef99908c --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modsopcommon.h @@ -0,0 +1,211 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the SOP Common Module + * + */ + +#ifndef MODSOPCOMMON_H +#define MODSOPCOMMON_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmiod/modbase.h" + + +/** Class representing the SOP Common Module. Supported Attributes: + * + * SOP Class UID: (UI, 1, 1) + * SOP Instance UID: (UI, 1, 1) + * Specific Character Set: (CS, 1-n, 1C) + * Instance Creation Date: (DA, 1, 3) + * Instance Creation Time: (TM, 1, 3) + * Instance Creator UID: (UI, 1, 3) + * Timezone Offset from UTC: (SH, 1, 3) + * + */ +class DCMTK_DCMIOD_EXPORT IODSOPCommonModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODSOPCommonModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODSOPCommonModule(); + + /** Destructor + */ + virtual ~IODSOPCommonModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Set missing values by inventing "default values". Automatically + * called during write() by IODComponent. + */ + virtual void inventMissing(); + + /** Get name of module + * @return Name of the module ("SOPCommonModule") + */ + virtual OFString getName() const; + + /** Make sure that the module contains a SOP Instance UID, i.e.\ a new one + * is created if empty. An invalid UID is corrected if desired. + * @param correctInvalid Correct invalid UID if OFTrue, otherwise do nothing + */ + virtual void ensureInstanceUID(const OFBool correctInvalid = OFFalse); + + /** Get SOP Class UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, + const signed long pos = 0) const; + + /** Get SOP Instance UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** Get Instance Creator UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, + const signed long pos = 0) const; + + /** Get Timeho e Offset from UTC + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, + const signed long pos = 0) const; + + /** Get Specific Character Set + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, + const signed long pos = 0) const; + + /** Get Instance Creation Date + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, + const signed long pos = 0) const; + + /** Get Instance Creation Time + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, + const signed long pos = 0) const; + + /** Set SOP Instance UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set SOP Class UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UI) and + * VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Specific Character Set. The internal enumerated value is set accordingly. + * Please note that code extensions techniques are not supported. Therefore, only + * a single value can be passed. + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Instance Creation Date + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, + const OFBool checkValue = OFTrue); + /** Set Instance Creation Date + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (TM) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Instance Creator UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UID) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Timezone Offset From UTC + * @param value Value to be set (single value only) or "" for no value. + * Encoded as an ASCII string in the format “&ZZXX”. The components of this + * string, from left to right, are & = “+” or “-”, and ZZ = Hours and + * XX = Minutes of offset. + * @param checkValue Check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ virtual OFCondition setTimeZoneOffsetFromUTC(const OFString &value, + const OFBool checkValue = OFTrue) const; + +private: + + /// Name of this module ("SOPCommonModule") + static const OFString m_ModuleName; + +}; + +#endif // MODSOPCOMMON_H diff --git a/dcmiod/include/dcmtk/dcmiod/modsynchronisation.h b/dcmiod/include/dcmtk/dcmiod/modsynchronisation.h new file mode 100644 index 00000000..7a46b007 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modsynchronisation.h @@ -0,0 +1,235 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Synchronization Module + * + */ + +#ifndef MODSYNCHRONIZATION_H +#define MODSYNCHRONIZATION_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofoption.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Synchronization Module: + * + * Synchronization Frame of Reference UID: (UI, 1, 1) + * Synchronization Trigger: (CS, 1, 1) + * Trigger Source or Type: (LO, 1, 3) + * Synchronization Channel: (US, 2, 1C) + * Acquisition Time Synchronized: (CS, 1, 1) + * Time Source: (SH, 1, 3) + * Time Distribution Protocol: (CS, 1, 3) + * NTP Source Address (LO, 1, 3) + */ +class DCMTK_DCMIOD_EXPORT IODSynchronizationModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODSynchronizationModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODSynchronizationModule(); + + /** Destructor + */ + virtual ~IODSynchronizationModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("SynchronizationModule") + */ + virtual OFString getName() const; + + /** Get Synchronization Frame of Reference UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSynchronizationFrameOfReferenceUID(OFString& value, + const signed long pos = 0) const; + + /** Get Synchronization Trigger + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSynchronizationTrigger(OFString& value, + const signed long pos = 0) const; + + /** Get Trigger Source or Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTriggerSourceOrType(OFString& value, + const signed long pos = 0) const; + + /** Get Synchronization Channel + * @param value Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSynchronizationChannel(OFVector& value) const; + + /** Get Acquisition Time Synchronized + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionTimeSynchronized(OFString& value, + const signed long pos = 0) const; + + /** Get Time Source + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeSource(OFString& value, + const signed long pos = 0) const; + + /** Get Time Distribution Protocol + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeDistributionProtocol(OFString& value, + const signed long pos = 0) const; + + /** Get NTP Source Address + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNTPSourceAddress(OFString& value, + const signed long pos = 0) const; + + /** Set Synchronization Frame of Reference UID + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSynchronizationFrameofReferenceUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Synchronization Trigger + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSynchronizationTrigger(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Trigger Source or Type + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTriggerSourceOrType(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Synchronization Channel + * @param value Value to be set + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSynchronizationChannel(const OFPair &value, + const OFBool checkValue = OFTrue); + + /** Set Acquisition Time Synchronized + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionTimeSynchronized(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Time Source + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (SH) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeSource(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Time Distribution Protocol + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeDistributionProtocol(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set NTP Source Address + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNTPSourceAddress(const OFString &value, + const OFBool checkValue = OFTrue); + +protected: + + /** Check whether given string is a valid value for attribute + * Acquisition Time Synchronized + * @param value The value to check + * @return OFTrue if value is valid for this attribute, OFFalse otherwise + */ + virtual OFBool isValidAcquisitionTimeSynchronized(const OFString& value); + + /** Check whether given string is a valid value for attribute + * Time Distribution Protocol + * @param value The value to check + * @return OFTrue if value is valid for this attribute, OFFalse otherwise + */ + virtual OFBool isValidTimeDistributionProtocol(const OFString& value); + + /** Check whether given string is a valid value for attribute + * Synchronization Trigger + * @param value The value to check + * @return OFTrue if value is valid for this attribute, OFFalse otherwise + */ + virtual OFBool isValidSynchronizationTrigger(const OFString& value); + +private: + + /// Module name "SynchronizationModule" + static const OFString m_ModuleName; + +}; + +#endif // MODSYNCHRONIZATION_H diff --git a/dcmiod/include/dcmtk/dcmiod/modusfor.h b/dcmiod/include/dcmtk/dcmiod/modusfor.h new file mode 100644 index 00000000..5cde7646 --- /dev/null +++ b/dcmiod/include/dcmtk/dcmiod/modusfor.h @@ -0,0 +1,229 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class managing the Ultrasound Frame of Reference Module + * + */ + +#ifndef MODUSFOR_H +#define MODUSFOR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofoption.h" +#include "dcmtk/dcmiod/modbase.h" + +/** Class representing the Frame of Reference Module: + * + * Volume Frame of Reference UID: (UI, 1, 1) + * Ultrasound Acquisition Geometry: (CS, 1, 1) + * Apex Position: (FD, 3, 1C) + * Volume to Transducer Relationship: (CS, 1, 1C) + * Volume to Transducer Mapping Matrix: (FD, 16, 1) + * Patient Frame of Reference Source: (CS, 1, 1C) + * Table Frame of Reference UID: (UI, 1, 1C) + * Volume to Table Mapping Matrix: (FD, 16, 1C) + * + */ +class DCMTK_DCMIOD_EXPORT IODUSFoRModule : public IODModule +{ + +public: + + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + IODUSFoRModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + IODUSFoRModule(); + + /** Destructor + */ + virtual ~IODUSFoRModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module + * @return Name of the module ("UltrasoundFrameOfReferenceModule") + */ + virtual OFString getName() const; + + /** Get Volume Frame of Reference UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumeFrameOfReferenceUID(OFString& value, + const signed long pos = 0) const; + + /** Get Position Reference Indicator + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUltrasoundAcquisitionGeometry(OFString& value, + const signed long pos = 0) const; + + /** Get Apex Position + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getApexPosition(Float64& value, + const unsigned long pos = 0) const; + + /** Get Apex Position + * @param value Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getApexPosition(OFVector& value); + + /** Get Volume to Transducer Relationship + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumetoTransducerRelationship(OFString& value, + const signed long pos = 0); + + /** Get Volume to Table Mapping Matrix + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumetoTransducerMappingMatrix(Float64& value, + const signed long pos = 0) const; + + /** Get Volume to Table Mapping Matrix + * @param value Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumetoTransducerMappingMatrix(OFVector& value); + + /** Get Patient Frame of Reference Source + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientFrameofReferenceSource(OFString& value, + const signed long pos = 0); + + /** Get Table Frame of Reference UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableFrameofReferenceUID(OFString& value, + const signed long pos = 0); + + /** Get Volume to Table Mapping Matrix + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumetoTableMappingMatrix(Float64& value, + const signed long pos = 0) const; + + /** Get Volume to Table Mapping Matrix + * @param value Reference to variable in which the value should be stored + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVolumetoTableMappingMatrix(OFVector& value); + + /** Set Volume Frame Of Reference UID + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVolumeFrameOfReferenceUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Ultrasound Acquisition Geometry + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setUltrasoundAcquisitionGeometry(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Apex Position + * @param xValue xValue to be set + * @param yValue yValue to be set + * @param zValue zValue to be set + * @param checkValue Does nothing at the moment + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setApexPosition(const Float64& xValue, + const Float64& yValue, + const Float64& zValue, + const OFBool checkValue = OFTrue); + + /** Set Volume to Transducer Relationship + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVolumetoTransducerRelationship(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Volume to Transducer Mapping Matrix + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (FD) and VM (16) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVolumetoTransducerMappingMatrix(const OFVector& value, + const OFBool checkValue = OFTrue); + + /** Set Patient Frame of Reference Source + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientFrameOfReferenceSource(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Table Frame of Reference UID + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableFrameofReferenceUID(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Volume to Table Mapping Matrix + * @param value Value to be set + * @param checkValue Check 'value' for conformance with VR (FD) and VM (16) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVolumeToTableMappingMatrix(const OFVector& value, + const OFBool checkValue = OFTrue); + +private: + + /// Module name "UltrasoundFrameOfReferenceModule" + static const OFString m_ModuleName; + +}; + +#endif // MODUSFOR_H diff --git a/dcmiod/libsrc/CMakeLists.txt b/dcmiod/libsrc/CMakeLists.txt new file mode 100644 index 00000000..0f6cf425 --- /dev/null +++ b/dcmiod/libsrc/CMakeLists.txt @@ -0,0 +1,36 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmiod + cielabutil + iodcontentitemmacro + iodcommn + iodmacro + iodrules + iodreferences + iodutil + iodtypes + modacquisitioncontext + modbase + modcommoninstanceref + modenhequipment + modenhusimage + modenhusseries + modequipment + modfloatingpointimagepixel + modfor + modgeneralimage + modgeneralseries + modgeneralstudy + modhelp + modimagepixel + modimagepixelbase + modmultiframefg + modmultiframedimension + modpatient + modpatientstudy + modsegmentationseries + modsopcommon + modsynchronization + modusfor) + +DCMTK_TARGET_LINK_MODULES(dcmiod dcmdata ofstd oflog) + diff --git a/dcmiod/libsrc/Makefile.dep b/dcmiod/libsrc/Makefile.dep new file mode 100644 index 00000000..a7cbbde6 --- /dev/null +++ b/dcmiod/libsrc/Makefile.dep @@ -0,0 +1,2725 @@ +cielabutil.o: cielabutil.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/cielabutil.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmiod/ioddef.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h +iodcommn.o: iodcommn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/iodcommn.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modpatient.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../include/dcmtk/dcmiod/modgeneralstudy.h \ + ../include/dcmtk/dcmiod/iodmacro.h \ + ../include/dcmtk/dcmiod/modequipment.h \ + ../include/dcmtk/dcmiod/modgeneralseries.h \ + ../include/dcmtk/dcmiod/modfor.h ../include/dcmtk/dcmiod/modsopcommon.h \ + ../include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../include/dcmtk/dcmiod/iodreferences.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +iodcontentitemmacro.o: iodcontentitemmacro.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/iodcontentitemmacro.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +iodmacro.o: iodmacro.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/iodmacro.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodrules.h ../include/dcmtk/dcmiod/iodtypes.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +iodreferences.o: iodreferences.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/iodreferences.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h +iodrules.o: iodrules.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h +iodtypes.o: iodtypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +iodutil.o: iodutil.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +modacquisitioncontext.o: modacquisitioncontext.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modacquisitioncontext.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodrules.h ../include/dcmtk/dcmiod/iodtypes.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modbase.o: modbase.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +modcommoninstanceref.o: modcommoninstanceref.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodrules.h ../include/dcmtk/dcmiod/iodtypes.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/iodmacro.h \ + ../include/dcmtk/dcmiod/iodreferences.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modenhequipment.o: modenhequipment.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modenhequipment.h \ + ../include/dcmtk/dcmiod/ioddef.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/modbase.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modenhusimage.o: modenhusimage.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modenhusimage.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modenhusseries.o: modenhusseries.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modenhusseries.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modequipment.o: modequipment.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modequipment.h ../include/dcmtk/dcmiod/ioddef.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/modbase.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modfloatingpointimagepixel.o: modfloatingpointimagepixel.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modfloatingpointimagepixel.h \ + ../include/dcmtk/dcmiod/modimagepixelbase.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modfor.o: modfor.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modfor.h ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modgeneralimage.o: modgeneralimage.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modgeneralimage.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modgeneralseries.o: modgeneralseries.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modgeneralseries.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modgeneralstudy.o: modgeneralstudy.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modgeneralstudy.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modhelp.o: modhelp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modhelp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmiod/ioddef.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +modimagepixel.o: modimagepixel.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modimagepixel.h \ + ../include/dcmtk/dcmiod/modimagepixelbase.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modimagepixelbase.o: modimagepixelbase.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modimagepixelbase.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modmultiframedimension.o: modmultiframedimension.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modmultiframedimension.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpath.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modmultiframefg.o: modmultiframefg.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modmultiframefg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/ioddef.h \ + ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/modbase.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modpatient.o: modpatient.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modpatient.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodrules.h ../include/dcmtk/dcmiod/iodtypes.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modpatientstudy.o: modpatientstudy.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/iodrules.h ../include/dcmtk/dcmiod/iodtypes.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modsegmentationseries.o: modsegmentationseries.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modsegmentationseries.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/modbase.h ../include/dcmtk/dcmiod/ioddef.h \ + ../include/dcmtk/dcmiod/iodrules.h ../include/dcmtk/dcmiod/iodtypes.h \ + ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modsopcommon.o: modsopcommon.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modsopcommon.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +modsynchronization.o: modsynchronization.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modsynchronisation.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +modusfor.o: modusfor.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmiod/modusfor.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h diff --git a/dcmiod/libsrc/Makefile.in b/dcmiod/libsrc/Makefile.in new file mode 100644 index 00000000..64eb2668 --- /dev/null +++ b/dcmiod/libsrc/Makefile.in @@ -0,0 +1,58 @@ +# +# Makefile for dcmiod/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include + +LOCALDEFS = + +objs = cielabutil.o iodcommn.o iodcontentitemmacro.o iodmacro.o iodreferences.o iodrules.o \ + iodtypes.o iodutil.o modacquisitioncontext.o modbase.o modcommoninstanceref.o \ + modenhequipment.o modenhusimage.o modenhusseries.o modequipment.o \ + modfloatingpointimagepixel.o modfor.o modgeneralimage.o modgeneralseries.o \ + modgeneralstudy.o modhelp.o modimagepixelbase.o modimagepixel.o modmultiframedimension.o \ + modmultiframefg.o modpatient.o modpatientstudy.o modsegmentationseries.o modsopcommon.o \ + modsynchronization.o modusfor.o + + +library = libdcmiod.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmiod/libsrc/cielabutil.cc b/dcmiod/libsrc/cielabutil.cc new file mode 100644 index 00000000..fa4f3154 --- /dev/null +++ b/dcmiod/libsrc/cielabutil.cc @@ -0,0 +1,214 @@ +/* + * + * Copyright (C) 2005-2018, Pascal Getreuer + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Pascal Getreuer, Michael Onken + * + * Purpose: Static helper functionality for CIE<->RGB color conversions + * + */ +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/cielabutil.h" +#define INCLUDE_CMATH // for pow() function +#include "dcmtk/ofstd/ofstdinc.h" + +// workaround for SunPro not defining these C functions in the global namespace +#ifdef __sun +using STD_NAMESPACE pow; +#endif + +// Initialize white points of D65 light point (CIELab standard white point) +const double IODCIELabUtil::D65_WHITEPOINT_X = 0.950456; +const double IODCIELabUtil::D65_WHITEPOINT_Y = 1.0; +const double IODCIELabUtil::D65_WHITEPOINT_Z = 1.088754; + + +void IODCIELabUtil::dicomLab2RGB(double& R, double& G, double& B, double LDicom, double aDicom, double bDicom) +{ + double L, a, b; + dicomlab2Lab(L, a, b, LDicom, aDicom, bDicom); + lab2Rgb(R, G, B, L, a, b); +} + + +void IODCIELabUtil::rgb2DicomLab(double& LDicom, double& aDicom, double& bDicom, double R, double G, double B) +{ + double L, a, b; + rgb2Lab(L, a, b, R, G, B); + lab2DicomLab(LDicom, aDicom, bDicom, L, a, b); +} + + +void IODCIELabUtil::dicomlab2Lab(double& L, double& a, double& b, double LDicom, double aDicom, double bDicom) +{ + L = ((LDicom * 100.0) / 65535.0); // results in 0 <= L <= 100 + a = ((aDicom * 255.0) / 65535.0) - 128; // results in -128 <= a <= 127 + b = ((bDicom * 255.0) / 65535.0) - 128; // results in -128 <= b <= 127 +} + + +void IODCIELabUtil::lab2DicomLab(double& LDicom, double& aDicom, double& bDicom, double L, double a, double b) +{ + LDicom = L * 65535.0 / 100.0; // results in 0 <= L <= 65535 + aDicom = (a + 128) * 65535.0 / 255.0; // results in 0 <= a <= 65535 + bDicom = (b + 128) * 65535.0 / 255.0; // results in 0 <= b <= 65535 +} + + +void IODCIELabUtil::rgb2Lab(double& L, double& a, double& b, double R, double G, double B) +{ + double X, Y, Z; + rgb2Xyz(X, Y, Z, R, G, B); + xyz2Lab(L, a, b, X, Y, Z); +} + + +double IODCIELabUtil::gammaCorrection(double n) +{ + if ((n) <= 0.0031306684425005883) + { + return 12.92 * (n); + } + else + { + return (1.055*pow((n), 0.416666666666666667) - 0.055); + } +} + + +double IODCIELabUtil::invGammaCorrection(double n) +{ + if ((n) <= 0.0404482362771076) + { + return ((n) / 12.92); + } + else + { + return ( pow(((n) + 0.055)/1.055, 2.4) ); + } +} + + +void IODCIELabUtil::rgb2Xyz(double& X, double& Y, double& Z, double R, double G, double B) +{ + R = invGammaCorrection(R); + G = invGammaCorrection(G); + B = invGammaCorrection(B); + X = OFstatic_cast(double, (0.4123955889674142161*R + 0.3575834307637148171*G + 0.1804926473817015735*B)); + Y = OFstatic_cast(double, (0.2125862307855955516*R + 0.7151703037034108499*G + 0.07220049864333622685*B)); + Z = OFstatic_cast(double, (0.01929721549174694484*R + 0.1191838645808485318*G + 0.9504971251315797660*B)); +} + + +void IODCIELabUtil::xyz2Lab(double& L, double& a, double& b, double X, double Y, double Z) +{ + X /= D65_WHITEPOINT_X; + Y /= D65_WHITEPOINT_Y; + Z /= D65_WHITEPOINT_Z; + X = labf(X); + Y = labf(Y); + Z = labf(Z); + L = 116*Y - 16; + a = 500*(X - Y); + b = 200*(Y - Z); +} + + +void IODCIELabUtil::lab2Rgb(double& R, double& G, double& B, double L, double a, double b) +{ + double X, Y, Z; + lab2Xyz(X, Y, Z, L, a, b); + xyz2Rgb(R, G, B, X, Y, Z); +} + + +void IODCIELabUtil::lab2Xyz(double& X, double& Y, double& Z, double L, double a, double b) +{ + L = (L + 16)/116; + a = L + a/500; + b = L - b/200; + X = D65_WHITEPOINT_X * labfInv(a); + Y = D65_WHITEPOINT_Y * labfInv(L); + Z = D65_WHITEPOINT_Z * labfInv(b); +} + + +void IODCIELabUtil::xyz2Rgb(double& R, double& G, double& B, double X, double Y, double Z) +{ + double R1, B1, G1, Min; + + R1 = OFstatic_cast(double, ( 3.2406*X - 1.5372*Y - 0.4986*Z)); + G1 = OFstatic_cast(double, (-0.9689*X + 1.8758*Y + 0.0415*Z)); + B1 = OFstatic_cast(double, ( 0.0557*X - 0.2040*Y + 1.0570*Z)); + + Min = min3(R1, G1, B1); + + /* Force nonnegative values so that gamma correction is well-defined. */ + if(Min < 0) + { + R1 -= Min; + G1 -= Min; + B1 -= Min; + } + + /* Transform from RGB to R'G'B' */ + R = gammaCorrection(R1); + G = gammaCorrection(G1); + B = gammaCorrection(B1); +} + + +double IODCIELabUtil::labf(double n) +{ + if (n >= 8.85645167903563082e-3) + { + return ( pow(n, 0.333333333333333) ); + } + else + { + return ( (841.0/108.0)*(n) + (4.0/29.0) ); + } +} + + +double IODCIELabUtil::labfInv(double n) +{ + if ( (n) >= 0.206896551724137931 ) + { + return (n)*(n)*(n); + } + else + { + return (108.0/841.0)*((n) - (4.0/29.0)); + } +} + + +double IODCIELabUtil::min2(double a, double b) +{ + if (a <= b) + return a; + else + return b; +} + + +double IODCIELabUtil::min3(double a, double b, double c) +{ + if (a <= b) + return min2(a,c); + else + return min2(b,c); +} diff --git a/dcmiod/libsrc/iodcommn.cc b/dcmiod/libsrc/iodcommn.cc new file mode 100644 index 00000000..06fc3112 --- /dev/null +++ b/dcmiod/libsrc/iodcommn.cc @@ -0,0 +1,317 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class representing IODs by exposing common DICOM module attributes + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/iodcommn.h" +#include "dcmtk/dcmdata/dctypes.h" // logger +#include "dcmtk/dcmiod/iodutil.h" + + +DcmIODCommon::DcmIODCommon() +: m_Item(new DcmItem()), + m_Rules(new IODRules), + m_Patient(m_Item, m_Rules), + m_PatientStudy(m_Item, m_Rules), + m_Study(m_Item, m_Rules), + m_Equipment(m_Item, m_Rules), + m_Series(m_Item, m_Rules), + m_FrameOfReference(m_Item, m_Rules), + m_SOPCommon(m_Item, m_Rules), + m_CommonInstanceReferenceModule(m_Item, m_Rules), + m_Modules() +{ + // Set initial values for a new SOP instance + ensureInstanceUIDs(OFFalse); + // push this first so Specific Character Set will be written in the beginning + m_Modules.push_back(&m_SOPCommon); + m_Modules.push_back(&m_Patient); + m_Modules.push_back(&m_PatientStudy); + m_Modules.push_back(&m_Study); + m_Modules.push_back(&m_Equipment); + m_Modules.push_back(&m_Series); + m_Modules.push_back(&m_FrameOfReference); + m_Modules.push_back(&m_CommonInstanceReferenceModule); +} + + +DcmIODCommon::DcmIODCommon(const DcmIODCommon& rhs) +: m_Item(rhs.m_Item), + m_Rules(rhs.m_Rules), + m_Patient(m_Item, m_Rules), + m_PatientStudy(m_Item, m_Rules), + m_Study(m_Item, m_Rules), + m_Equipment(m_Item, m_Rules), + m_Series(m_Item, m_Rules), + m_FrameOfReference(m_Item, m_Rules), + m_SOPCommon(m_Item, m_Rules), + m_CommonInstanceReferenceModule(m_Item, m_Rules), + m_Modules() +{ + // Set initial values for a new SOP instance + ensureInstanceUIDs(OFFalse); + // push this first so Specific Character Set will be written in the beginning + m_Modules.push_back(&m_SOPCommon); + m_Modules.push_back(&m_Patient); + m_Modules.push_back(&m_PatientStudy); + m_Modules.push_back(&m_Study); + m_Modules.push_back(&m_Equipment); + m_Modules.push_back(&m_Series); + m_Modules.push_back(&m_FrameOfReference); + m_Modules.push_back(&m_CommonInstanceReferenceModule); +} + + +DcmIODCommon::~DcmIODCommon() +{ +} + + +void DcmIODCommon::clearData() +{ + // TODO +// OFVector::iterator it = m_Modules.begin(); +// while (it != m_Modules.end()) +// { +// (*it)->clearData(); +// it++; +// } +} + + +IODPatientModule& DcmIODCommon::getPatient() +{ + return m_Patient; +} + + +IODPatientStudyModule& DcmIODCommon::getPatientStudy() +{ + return m_PatientStudy; +} + + +IODGeneralStudyModule& DcmIODCommon::getStudy() +{ + return m_Study; +} + + +IODGeneralEquipmentModule& DcmIODCommon::getEquipment() +{ + return m_Equipment; +} + + +IODGeneralSeriesModule& DcmIODCommon::getSeries() +{ + return m_Series; +} + + +IODFoRModule& DcmIODCommon::getFrameOfReference() +{ + return m_FrameOfReference; +} + + +IODSOPCommonModule& DcmIODCommon::getSOPCommon() +{ + return m_SOPCommon; +} + + +IODCommonInstanceReferenceModule& DcmIODCommon::getCommonInstanceReference() +{ + return m_CommonInstanceReferenceModule; +} + + + +OFshared_ptr DcmIODCommon::getRules() +{ + return m_Rules; +} + + +OFshared_ptr DcmIODCommon::getData() +{ + return m_Item; +} + + +OFCondition DcmIODCommon::read(DcmItem &dataset) +{ + /* re-initialize object */ + DcmIODCommon::clearData(); + + OFVector::iterator it = m_Modules.begin(); + while ( it != m_Modules.end() ) + { + (*it)->read(dataset, OFTrue /* clear old data */); + it++; + } + + // we do not report errors here (only logger output) + return EC_Normal; +} + + +OFCondition DcmIODCommon::importHierarchy(DcmItem& dataset, + const OFBool readPatient, + const OFBool readStudy, + const OFBool readFoR, + const OFBool readSeries, + const OFBool takeOverCharset) +{ + if (readPatient) + { + m_Patient.read(dataset, OFFalse /* do not clear old data */); + } + + if (readStudy) + { + m_Study.read(dataset, OFFalse /* do not clear old data */); + m_Equipment.read(dataset, OFFalse /* do not clear old data */); + m_PatientStudy.read(dataset, OFFalse /* do not clear old data */); + } + + if (readSeries) + { + m_Series.read(dataset, OFFalse /* do not clear old data */); + m_FrameOfReference.read(dataset, OFFalse /* do not clear old data */); + } + + if (readFoR) + { + m_FrameOfReference.read(dataset, OFFalse /* do not clear old data */); + } + + // Take over character set from the dataset imported, if desired + if (takeOverCharset) + { + OFString charset; + dataset.findAndGetOFStringArray(DCM_SpecificCharacterSet, charset); + if (!charset.empty()) + { + DCMIOD_DEBUG("Taking over Specific Character Set " << charset << " on import"); + OFCondition result = m_SOPCommon.setSpecificCharacterSet(charset); + if (result.bad()) + { + DCMIOD_ERROR("Could not set Specific Character Set " << charset << " on import: " << result.text()); + } + } + else + { + DCMIOD_DEBUG("Taking over Default Specific Character Set (ASCII) on import"); + m_SOPCommon.getData().findAndDeleteElement(DCM_SpecificCharacterSet); + } + } + + return EC_Normal; +} + + +OFCondition DcmIODCommon::importHierarchy(const OFString& filename, + const OFBool readPatient, + const OFBool readStudy, + const OFBool readFoR, + const OFBool readSeries, + const OFBool takeOverCharset) +{ + DcmFileFormat dcmff; + OFCondition result = dcmff.loadFile(filename.c_str()); + if ( result.good() ) + { + DcmDataset *dset = dcmff.getDataset(); + if (dset != NULL) + { + result = importHierarchy(*dset, readPatient, readStudy, readFoR, readSeries, takeOverCharset); + } + else + { + DCMIOD_ERROR("Unable to get dataset from file for copying patient, study, series and/or frame of reference information"); + result = EC_IllegalCall; + } + } + return result; +} + + +void DcmIODCommon::ensureInstanceUIDs(const OFBool correctInvalid) +{ + m_Study.ensureInstanceUID(correctInvalid); + m_Series.ensureInstanceUID(correctInvalid); + m_SOPCommon.ensureInstanceUID(correctInvalid); +} + + +OFCondition DcmIODCommon::write(DcmItem &dataset) +{ + OFCondition result; + + OFVector::iterator it = m_Modules.begin(); + while ( (it != m_Modules.end() && result.good()) ) + { + result = (*it)->write(dataset); + it++; + } + return result; +} + + +void DcmIODCommon::createNewStudy(const OFBool clearEquipment) +{ + // clear all study-related attributes + m_Study.clearData(); + m_PatientStudy.clearData(); + if (clearEquipment) + m_Equipment.clearData(); + // make sure we have a valid Study Instance UID + m_Study.ensureInstanceUID(); + + // reset series- and instance related attributes + createNewSeries(); +} + + +void DcmIODCommon::createNewSeries(const OFBool clearFoR) +{ + // clear all series-related attributes + m_Series.clearData(); + // create new Series Instance UID + m_Series.ensureInstanceUID(); + + // clear frame of reference-related attributes if desired + if (clearFoR) + m_FrameOfReference.clearData(); + + /* also creates new series (since UID is empty) */ + createNewSOPInstance(); +} + + +void DcmIODCommon::createNewSOPInstance() +{ + m_SOPCommon.clearData(); + m_SOPCommon.ensureInstanceUID(); +} + + diff --git a/dcmiod/libsrc/iodcontentitemmacro.cc b/dcmiod/libsrc/iodcontentitemmacro.cc new file mode 100644 index 00000000..a96793cb --- /dev/null +++ b/dcmiod/libsrc/iodcontentitemmacro.cc @@ -0,0 +1,815 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Content Item Macro + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" + +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmiod/iodcontentitemmacro.h" + +const OFString ContentItemMacro::ReferencedSOPSequenceItem::m_ComponentName = "ReferencedSOPSequenceItem"; + + +ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent) +: IODComponent(item, rules, parent), + m_SOPInstanceReferenceMacro() +{ + // reset element rules + resetRules(); +} + + +ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(IODComponent* parent) +: IODComponent(parent), + m_SOPInstanceReferenceMacro() +{ + // reset element rules + resetRules(); +} + + +ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(const ReferencedSOPSequenceItem& rhs) +: IODComponent(rhs), + m_SOPInstanceReferenceMacro() +{ +} + + +ContentItemMacro::ReferencedSOPSequenceItem::~ReferencedSOPSequenceItem() +{ + // nothing to do +} + + +OFString ContentItemMacro::ReferencedSOPSequenceItem::getName() const +{ + return m_ComponentName; +} + + +void ContentItemMacro::ReferencedSOPSequenceItem::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_ReferencedFrameNumber, "1-n","1C", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedSegmentNumber, "1-n","1C", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue); +} + + +OFCondition ContentItemMacro::ReferencedSOPSequenceItem::read( + DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, OFFalse /* data already cleared */); + return EC_Normal; +} + + +OFCondition ContentItemMacro::ReferencedSOPSequenceItem::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + result = IODComponent::write(destination); + + return result; +} + + +SOPInstanceReferenceMacro& ContentItemMacro::ReferencedSOPSequenceItem::getSOPInstanceReferenceMacro() +{ + return m_SOPInstanceReferenceMacro; +} + + +OFCondition ContentItemMacro::ReferencedSOPSequenceItem::getReferencedFrameNumber( + OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ReferencedFrameNumber, *m_Item, value, pos); +} + + +OFCondition ContentItemMacro::ReferencedSOPSequenceItem::getReferencedSegmentNumber( + Uint16 &value, + const signed long pos) const +{ + return m_Item->findAndGetUint16(DCM_ReferencedSegmentNumber, value, pos); +} + + +OFCondition ContentItemMacro::ReferencedSOPSequenceItem::setReferencedFrameNumber( + const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ReferencedFrameNumber, value); + return result; +} + + +OFCondition ContentItemMacro::ReferencedSOPSequenceItem::setReferencedSegmentNumber( + const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertUint16(DCM_ReferencedSegmentNumber, value); +} + + +const OFString ContentItemMacro::m_ModuleName = "ContentItemMacro"; + + +ContentItemMacro::ContentItemMacro() +: IODComponent(), + m_ConceptNameCodeSequence(), + m_ConceptCodeSequence(), + m_MeasurementUnitsCodeSequence(), + m_ReferencedSOPSequence() +{ + resetRules(); +} + + +ContentItemMacro::ContentItemMacro(OFshared_ptr item, + OFshared_ptr rules) +: IODComponent(item, rules), + m_ConceptNameCodeSequence(), + m_ConceptCodeSequence(), + m_MeasurementUnitsCodeSequence(), + m_ReferencedSOPSequence() +{ + // reset element rules + resetRules(); +} + + +ContentItemMacro::ContentItemMacro(const ContentItemMacro& rhs) +: IODComponent(rhs), + m_ConceptNameCodeSequence(), + m_ConceptCodeSequence(), + m_MeasurementUnitsCodeSequence(), + m_ReferencedSOPSequence() +{ + if (this == &rhs) + return; + + OFVector::const_iterator it = rhs.m_ConceptCodeSequence.begin(); + while (it != rhs.m_ConceptCodeSequence.end()) + { + CodeSequenceMacro* macro = new CodeSequenceMacro(**it); + m_ConceptCodeSequence.push_back(macro); + it++; + } + + it = rhs.m_ConceptNameCodeSequence.begin(); + while (it != rhs.m_ConceptNameCodeSequence.end()) + { + CodeSequenceMacro* macro = new CodeSequenceMacro(**it); + m_ConceptNameCodeSequence.push_back(macro); + it++; + } + + it = rhs.m_MeasurementUnitsCodeSequence.begin(); + while (it != rhs.m_MeasurementUnitsCodeSequence.end()) + { + CodeSequenceMacro* macro = new CodeSequenceMacro(**it); + m_MeasurementUnitsCodeSequence.push_back(macro); + it++; + } + + OFVector::const_iterator m = rhs.m_ReferencedSOPSequence.begin(); + while (m != rhs.m_ReferencedSOPSequence.end()) + { + ReferencedSOPSequenceItem* item = new ReferencedSOPSequenceItem(**m); + m_ReferencedSOPSequence.push_back(item); + m++; + } + +} + + +ContentItemMacro::~ContentItemMacro() +{ + DcmIODUtil::freeContainer(m_ConceptNameCodeSequence); + DcmIODUtil::freeContainer(m_ConceptCodeSequence); + DcmIODUtil::freeContainer(m_MeasurementUnitsCodeSequence); + DcmIODUtil::freeContainer(m_ReferencedSOPSequence); +} + + +OFString ContentItemMacro::getName() const +{ + return m_ModuleName; +} + + +void ContentItemMacro::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_ValueType, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ConceptNameCodeSequence, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_DateTime, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_Date, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_Time, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_PersonName, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_UID, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_TextValue, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ConceptCodeSequence, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_NumericValue, "1-n","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_FloatingPointValue, "1-n","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_RationalNumeratorValue, "1-n","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_RationalDenominatorValue, "1-n","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_MeasurementUnitsCodeSequence, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedSOPSequence, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); +} + + +OFCondition ContentItemMacro::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, OFFalse /* data already cleared */); + DcmIODUtil::readSubSequence(source, DCM_ConceptNameCodeSequence, m_ConceptNameCodeSequence, m_Rules->getByTag(DCM_ConceptNameCodeSequence)); + DcmIODUtil::readSubSequence(source, DCM_ConceptCodeSequence, m_ConceptCodeSequence, m_Rules->getByTag(DCM_ConceptCodeSequence)); + DcmIODUtil::readSubSequence(source, DCM_MeasurementUnitsCodeSequence, m_MeasurementUnitsCodeSequence, m_Rules->getByTag(DCM_MeasurementUnitsCodeSequence)); + DcmIODUtil::readSubSequence(source, DCM_ReferencedSOPSequence, m_ReferencedSOPSequence, m_Rules->getByTag(DCM_ReferencedSOPSequence)); + + return EC_Normal; +} + + +OFCondition ContentItemMacro::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + if(CodeSequenceMacro* pConceptNameCodeSequence = getConceptNameCodeSequence()) + DcmIODUtil::writeSingleItem(result, DCM_ConceptNameCodeSequence, *pConceptNameCodeSequence, *m_Item, m_Rules->getByTag(DCM_ConceptNameCodeSequence)); + if(CodeSequenceMacro* pConceptCodeSequence = getConceptCodeSequence()) + DcmIODUtil::writeSingleItem(result, DCM_ConceptCodeSequence, *pConceptCodeSequence, *m_Item, m_Rules->getByTag(DCM_ConceptCodeSequence)); + if(CodeSequenceMacro* pMeasurementUnitsCodeSequence = getMeasurementUnitsCodeSequence()) + DcmIODUtil::writeSingleItem(result, DCM_MeasurementUnitsCodeSequence, *pMeasurementUnitsCodeSequence, *m_Item, m_Rules->getByTag(DCM_MeasurementUnitsCodeSequence)); + if(ReferencedSOPSequenceItem* pReferencedSOPSequence = getReferencedSOPSequence()) + DcmIODUtil::writeSingleItem(result, DCM_ReferencedSOPSequence, *pReferencedSOPSequence, *m_Item, m_Rules->getByTag(DCM_ReferencedSOPSequence)); + + if (result.good()) + { + result = IODComponent::write(destination); + } + + return result; +} + + +OFCondition ContentItemMacro::getValueType(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ValueType, *m_Item, value, pos); +} + + +OFCondition ContentItemMacro::getValueType(ValueType& value) const +{ + OFString str; + OFCondition result = DcmIODUtil::getStringValueFromItem(DCM_ValueType, *m_Item, str, 0); + if (result == EC_Normal) + { + if (!str.empty()) + { + if (str == "DATE") + value = VT_DATE; + else if (str == "TIME") + value = VT_TIME; + else if (str == "DATETIME") + value = VT_DATETIME; + else if (str == "PNAME") + value = VT_PNAME; + else if (str == "UIDREF") + value = VT_UIDREF; + else if (str == "TEXT") + value = VT_TEXT; + else if (str == "CODE") + value = VT_CODE; + else if (str == "NUMERIC") + value = VT_NUMERIC; + else if (str == "COMPOSITE") + value = VT_COMPOSITE; + else if (str == "IMAGE") + value = VT_IMAGE; + else + value = VT_UNKNOWN; + } + else + { + value = VT_EMPTY; + } + } + else if (result == EC_TagNotFound) + { + value = VT_EMPTY; + } + else + { + DCMIOD_ERROR("Unexpected error, could not get Value Type: " << result.text()); + value = VT_UNKNOWN; + } + return result; +} + + +CodeSequenceMacro* ContentItemMacro::getConceptNameCodeSequence() +{ + return m_ConceptNameCodeSequence.empty() ? OFnullptr : *m_ConceptNameCodeSequence.begin(); +} + +OFVector& ContentItemMacro::getEntireConceptNameCodeSequence() +{ + return m_ConceptNameCodeSequence; +} + + +OFCondition ContentItemMacro::getDateTime(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DateTime, *m_Item, value, pos); +} + + +OFCondition ContentItemMacro::getDate(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Date, *m_Item, value, pos); +} + + +OFCondition ContentItemMacro::getTime(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Time, *m_Item, value, pos); +} + + +OFCondition ContentItemMacro::getPersonName(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PersonName, *m_Item, value, pos); +} + + +OFCondition ContentItemMacro::getUID(OFString &value, + const signed long pos) const +{ + return m_Item->findAndGetOFString(DCM_UID, value, pos); +} + + +OFCondition ContentItemMacro::getTextValue(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_TextValue, *m_Item, value, pos); +} + + +CodeSequenceMacro* ContentItemMacro::getConceptCodeSequence() +{ + return m_ConceptCodeSequence.empty() ? OFnullptr : *m_ConceptCodeSequence.begin(); +} + +OFVector& ContentItemMacro::getEntireConceptCodeSequence() +{ + return m_ConceptCodeSequence; +} + + +OFCondition ContentItemMacro::getNumericValue(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_NumericValue, *m_Item, value, pos); +} + + +OFCondition ContentItemMacro::getFloatingPointValue(Float64 &value, + const signed long pos) const +{ + return m_Item->findAndGetFloat64(DCM_FloatingPointValue, value, pos); +} + + +OFCondition ContentItemMacro::getRationalNumeratorValue(Sint32 &value, + const signed long pos) const +{ + return m_Item->findAndGetSint32(DCM_RationalNumeratorValue, value, pos); +} + + +OFCondition ContentItemMacro::getRationalDenominatorValue(Uint32 &value, + const signed long pos) const +{ + return m_Item->findAndGetUint32(DCM_RationalDenominatorValue, value, pos); +} + + +CodeSequenceMacro* ContentItemMacro::getMeasurementUnitsCodeSequence() +{ + return m_MeasurementUnitsCodeSequence.empty() ? OFnullptr : *m_MeasurementUnitsCodeSequence.begin(); +} + +OFVector& ContentItemMacro::getEntireMeasurementUnitsCodeSequence() +{ + return m_MeasurementUnitsCodeSequence; +} + + +ContentItemMacro::ReferencedSOPSequenceItem* ContentItemMacro::getReferencedSOPSequence() +{ + return m_ReferencedSOPSequence.empty() ? OFnullptr : *m_ReferencedSOPSequence.begin(); +} + +OFVector& ContentItemMacro::getEntireReferencedSOPSequence() +{ + return m_ReferencedSOPSequence; +} + + +OFCondition ContentItemMacro::setValueType(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, value); + return result; +} + + +OFCondition ContentItemMacro::setValueType(const ContentItemMacro::ValueType value, + const OFBool checkValue) +{ + (void)checkValue; + OFCondition result; + switch (value) + { + case VT_DATE: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "DATE"); + break; + } + case VT_TIME: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "TIME"); + break; + } + case VT_DATETIME: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "DATETIME"); + break; + } + case VT_PNAME: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "PNAME"); + break; + } + case VT_UIDREF: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "UIDREF"); + break; + } + case VT_TEXT: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "TEXT"); + break; + } + case VT_CODE: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "CODE"); + break; + } + case VT_NUMERIC: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "NUMERIC"); + break; + } + case VT_COMPOSITE: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "COMPOSITE"); + break; + } + case VT_IMAGE: + { + result = m_Item->putAndInsertOFStringArray(DCM_ValueType, "IMAGE"); + break; + } + default: + { + result = IOD_EC_InvalidElementValue; + } + } + return result; +} + + + +OFCondition ContentItemMacro::setDateTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DateTime, value); + return result; +} + + +OFCondition ContentItemMacro::setDate(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_Date, value); + return result; +} + + +OFCondition ContentItemMacro::setTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_Time, value); + return result; +} + + +OFCondition ContentItemMacro::setPersonName(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PersonName, value); + return result; +} + + +OFCondition ContentItemMacro::setUID(const OFString &value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertOFStringArray(DCM_UID, value); +} + + +OFCondition ContentItemMacro::setTextValue(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_TextValue, value); + return result; +} + + +OFCondition ContentItemMacro::setNumericValue(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_NumericValue, value); + return result; +} + + +OFCondition ContentItemMacro::setFloatingPointValue(const Float64 value, + const unsigned long pos, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat64(DCM_FloatingPointValue, value, pos); +} + + +OFCondition ContentItemMacro::setRationalNumeratorValue(const Sint32 value, + const unsigned long pos, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertSint32(DCM_RationalNumeratorValue, value, pos); +} + + +OFCondition ContentItemMacro::setRationalDenominatorValue(const Uint32 value, + const unsigned long pos, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertUint32(DCM_RationalDenominatorValue, value, pos); +} + + +OFString ContentItemMacro::toString() +{ + ValueType vt; + getValueType(vt); + OFStringStream oss; + if (getConceptNameCodeSequence()) + { + oss << getConceptNameCodeSequence()->toString() << ": "; + } + else + { + oss << ": "; + } + switch (vt) + { + case VT_CODE: + oss << "CODE: " << getConceptCodeSequence()->toString(); + break; + case VT_COMPOSITE: + { + OFString sopClass, sopInstance, frameNumber; + if (getReferencedSOPSequence()) + { + getReferencedSOPSequence()->getSOPInstanceReferenceMacro().getReferencedSOPClassUID(sopClass); + getReferencedSOPSequence()->getSOPInstanceReferenceMacro().getReferencedSOPClassUID(sopInstance); + getReferencedSOPSequence()->getReferencedFrameNumber(frameNumber); + oss << "COMPOSITE: " << sopClass << " / " << sopInstance; + if (!frameNumber.empty()) + { + oss << " / Frames: " << frameNumber; + } + Uint16 val,pos; + val = pos = 0; + if (getReferencedSOPSequence()->getReferencedSegmentNumber(val, pos).good()) + { + oss << " / Segments: "; + while (getReferencedSOPSequence()->getReferencedSegmentNumber(val, pos).good()) + { + oss << val << " "; + pos++; + } + } + } + else + { + oss << "COMPOSITE: "; + } + break; + } + case VT_DATE: + { + OFString date; + getDate(date); + oss << "DATE: " << date; + break; + } + case VT_DATETIME: + { + OFString datetime; + getDateTime(datetime); + oss << "DATETIME: " << datetime; + break; + } + case VT_IMAGE: + { + OFString sopClass, sopInstance, frameNumber; + if (getReferencedSOPSequence()) + { + getReferencedSOPSequence()->getSOPInstanceReferenceMacro().getReferencedSOPClassUID(sopClass); + getReferencedSOPSequence()->getSOPInstanceReferenceMacro().getReferencedSOPClassUID(sopInstance); + getReferencedSOPSequence()->getReferencedFrameNumber(frameNumber); + oss << "IMAGE: " << sopClass << " / " << sopInstance; + if (!frameNumber.empty()) + { + oss << " / Frames: " << frameNumber; + } + } + else + { + oss << "IMAGE: "; + } + break; + } + case VT_NUMERIC: + { + OFString val; + getNumericValue(val); + oss << "NUMERIC: " << val; + if (getMeasurementUnitsCodeSequence()) + { + oss << ", Units: " << getMeasurementUnitsCodeSequence()->toString() << ")"; + } + Uint16 pos =0; + Float64 fl64 = 0; + if (getFloatingPointValue(fl64, pos).good()) + { + oss << ", Float value(s): " ; + do + { + oss << val << " "; + pos++; + } while (getFloatingPointValue(fl64, pos).good()); + } + else + { + oss << ", Float value(s): "; + } + pos = 0; + Sint32 si32 = 0; + if (getRationalNumeratorValue(si32, pos).good()) + { + oss << ", Numerator value(s): " ; + do + { + oss << val << " "; + pos++; + } while (getRationalNumeratorValue(si32, pos).good()); + } + pos = 0; + Uint32 ui32 = 0; + if (getRationalDenominatorValue(ui32, pos).good()) + { + oss << ", Denominator value(s): " ; + do + { + oss << val << " "; + pos++; + } while (getRationalDenominatorValue(ui32, pos).good()); + } + + break; + } + case VT_PNAME: + { + OFString val; + getPersonName(val); + oss << "PNAME: " << val; + break; + } + case VT_TEXT: + { + OFString val; + getTextValue(val); + oss << "TEXT: " << val; + break; + } + case VT_TIME: + { + OFString val; + getTime(val); + oss << "TIME: " << val; + break; + } + case VT_UIDREF: + { + OFString val; + getUID(val); + oss << "UIDREF: " << val; + break; + } + case VT_EMPTY: + { + oss << ""; + break; + } + case VT_UNKNOWN: + { + OFString val; + getValueType(val); + oss << ""; + break; + } + default: + { + oss << ""; + } + } + OFSTRINGSTREAM_GETOFSTRING(oss, val); + return val; +} + diff --git a/dcmiod/libsrc/iodmacro.cc b/dcmiod/libsrc/iodmacro.cc new file mode 100644 index 00000000..e171bfd1 --- /dev/null +++ b/dcmiod/libsrc/iodmacro.cc @@ -0,0 +1,1886 @@ +/* + * + * Copyright (C) 2015-2019, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Collection of classes representing DICOM IOD macros + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmiod/iodutil.h" // for static IOD helpers +#include "dcmtk/ofstd/ofstream.h" + + +// --------------------------- Code Sequence Macro --------------------------- + + +// -- Code Sequence Macro + +CodeSequenceMacro::CodeSequenceMacro(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent) + : IODComponent(item, rules, parent) +{ + // reset element rules + resetRules(); +} + + +CodeSequenceMacro::CodeSequenceMacro(IODComponent* parent) : IODComponent(parent) +{ + // reset element rules + resetRules(); +} + + +CodeSequenceMacro::CodeSequenceMacro(const CodeSequenceMacro& rhs) +: IODComponent(rhs) +{ +} + + + +CodeSequenceMacro::~CodeSequenceMacro() +{ + // nothing to do +} + + +CodeSequenceMacro::CodeSequenceMacro(const OFString& codeValue, + const OFString& codingSchemeDesignator, + const OFString& codeMeaning, + const OFString& codingSchemeVersion, + IODComponent* parent) +: IODComponent(parent) +{ + // reset element rules + resetRules(); + setCodeValue(codeValue); + setCodeMeaning(codeMeaning); + setCodingSchemeDesignator(codingSchemeDesignator); + if (!codingSchemeVersion.empty()) + { + setCodingSchemeVersion(codingSchemeVersion); + } +} + +CodeSequenceMacro::CodeSequenceMacro(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules, + IODComponent* parent, + const OFString& codeValue, + const OFString& codingSchemeDesignator, + const OFString& codeMeaning, + const OFString& codingSchemeVersion) +: IODComponent(item, rules, parent) +{ + // reset element rules + resetRules(); + setCodeValue(codeValue); + setCodeMeaning(codeMeaning); + setCodingSchemeDesignator(codingSchemeDesignator); + if (!codingSchemeVersion.empty()) + { + setCodingSchemeVersion(codingSchemeVersion); + } +} + + +OFString CodeSequenceMacro::getName() const +{ + return "CodeSequenceMacro"; +} + + +void CodeSequenceMacro::resetRules() +{ + m_Rules->addRule(new IODRule(DCM_CodeValue, "1", "1", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue /*overwrite old rule*/); + m_Rules->addRule(new IODRule(DCM_CodingSchemeDesignator, "1", "1", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue /*overwrite old rule*/); + m_Rules->addRule(new IODRule(DCM_CodingSchemeVersion, "1", "1C", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue /*overwrite old rule*/); + m_Rules->addRule(new IODRule(DCM_CodeMeaning, "1", "1", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue /*overwrite old rule*/); +} + + +// -- get dicom attributes -- + +OFCondition CodeSequenceMacro::getCodeValue(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_CodeValue, *m_Item, value, pos); +} + + +OFCondition CodeSequenceMacro::getCodingSchemeDesignator(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_CodingSchemeDesignator, *m_Item, value, pos); +} + + +OFCondition CodeSequenceMacro::getCodingSchemeVersion(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_CodingSchemeVersion, *m_Item, value, pos); + +} + + +OFCondition CodeSequenceMacro::getCodeMeaning(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_CodeMeaning, *m_Item, value, pos); +} + + +OFBool CodeSequenceMacro::empty() +{ + OFString val; + getCodeValue(val); + if (val.empty()) + { + getCodingSchemeDesignator(val); + if (val.empty()) + { + getCodingSchemeVersion(val); + if (val.empty()) + { + getCodingSchemeDesignator(val); + if (val.empty()) + { + return OFTrue; + } + } + } + } + return OFFalse; +} + + +// -- set dicom attributes -- + +OFCondition CodeSequenceMacro::setCodeValue(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_CodeValue, value); + return result; +} + +OFCondition CodeSequenceMacro::setCodingSchemeDesignator(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_CodingSchemeDesignator, value); + return result; +} + +OFCondition CodeSequenceMacro::setCodingSchemeVersion(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1C") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_CodingSchemeVersion, value); + return result; +} + +OFCondition CodeSequenceMacro::setCodeMeaning(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_CodeMeaning, value); + return result; +} + + +OFCondition CodeSequenceMacro::set(const OFString& value, + const OFString& scheme, + const OFString& meaning, + const OFString& schemeVersion, + const OFBool checkValue) +{ + if (checkValue) + { + if (value.empty() || scheme.empty() || meaning.empty() ) + { + DCMIOD_ERROR("Could not set code since Code Value, Coding Scheme Designator and Code Meaning must have non-empty values"); + return IOD_EC_InvalidElementValue; + } + } + OFCondition result = setCodeValue(value, checkValue); + if (result.good()) result = setCodingSchemeDesignator(scheme, checkValue); + if (result.good()) result = setCodeMeaning(meaning, checkValue); + if (result.good() && !schemeVersion.empty()) result = setCodingSchemeVersion(schemeVersion, checkValue); + return result; +} + + +// ---------------------- CodeWithModifiers---------------------- + +CodeWithModifiers::CodeWithModifiers(const OFString& modifierType, + const OFString& modifierVM, + const DcmTagKey& modifierSeq) +: CodeSequenceMacro(), + m_Modifiers(), + m_ModifierType(modifierType), + m_ModifierVM(modifierVM), + m_CodeModifierSeq(modifierSeq) +{ + resetRules(); +} + + +CodeWithModifiers::CodeWithModifiers(const CodeWithModifiers& rhs) +: CodeSequenceMacro(rhs), + m_Modifiers(), + m_ModifierType(), + m_ModifierVM(), + m_CodeModifierSeq() +{ + if (&rhs == this) + return; + + *this = rhs; +} + + +CodeWithModifiers& CodeWithModifiers::operator=(const CodeWithModifiers& rhs) +{ + if (&rhs == this) + return *this; + + CodeSequenceMacro::operator=(rhs); + + const CodeWithModifiers* r = OFstatic_cast(const CodeWithModifiers*, &rhs); + if (r) + { + OFVector::const_iterator it = r->m_Modifiers.begin(); + while ((it != r->m_Modifiers.end())) + { + m_Modifiers.push_back(new CodeSequenceMacro(*it)); + it++; + } + } + + return *this; +} + + +OFCondition CodeWithModifiers::check(const OFBool quiet) +{ + OFCondition result = CodeSequenceMacro::check(quiet); + if (result.good()) + { + OFVector::iterator it = m_Modifiers.begin(); + while (result.good() && (it != m_Modifiers.end())) + { + result = (*it)->check(quiet); + it++; + } + } + if (result.bad()) + { + if (!quiet) + { + DCMIOD_ERROR("Invalid code in Code Sequence Macro or its modifiers"); + } + } + return result; +} + + +void CodeWithModifiers::clearData() +{ + CodeSequenceMacro::clearData(); + DcmIODUtil::freeContainer(m_Modifiers); +} + + +int CodeWithModifiers::compare(const IODComponent& rhs) const +{ + const CodeWithModifiers* r = OFstatic_cast(const CodeWithModifiers*, &rhs); + if (!r) + return -1; + + if (m_Modifiers.size() < r->m_Modifiers.size()) + return -1; + else if (m_Modifiers.size() > r->m_Modifiers.size()) + return 1; + + int result = IODComponent::compare(*r); + if (result == 0) + { + for (size_t n = 0; (n < m_Modifiers.size()) && (result == 0); n++) + { + result = m_Modifiers[n]->compare(*r->m_Modifiers[n]); + } + } + return result; +} + + +OFString CodeWithModifiers::getName() const +{ + return "CodeWithModifiers"; +} + + +OFCondition CodeWithModifiers::addModifier(const CodeSequenceMacro& modifier) +{ + OFCondition result = OFconst_cast(CodeSequenceMacro*, &modifier)->check(); + if (result.good()) + { + m_Modifiers.push_back(new CodeSequenceMacro(modifier)); + } + return result; +} + + +CodeSequenceMacro* CodeWithModifiers::getModifier(const size_t index) +{ + if (index + 1 > m_Modifiers.size()) + return NULL; + else + return m_Modifiers[index]; +} + + +OFCondition CodeWithModifiers::read(DcmItem& source, + const OFBool clearOldData) +{ + OFCondition result = CodeSequenceMacro::read(source, clearOldData); + if (result.good() && clearOldData) + { + DcmIODUtil::freeContainer(m_Modifiers); + } + if (result.good()) + { + result = DcmIODUtil::readSubSequence(source, m_CodeModifierSeq, m_Modifiers, getRules()->getByTag(m_CodeModifierSeq)); + } + return result; +} + + +void CodeWithModifiers::resetRules() +{ + CodeSequenceMacro::resetRules(); + m_Rules->addRule(new IODRule(m_CodeModifierSeq, m_ModifierVM, m_ModifierType, getName(), DcmIODTypes::IE_UNDEFINED)); +} + + +OFCondition CodeWithModifiers::write(DcmItem& destination) +{ + OFCondition result; + DcmIODUtil::writeSubSequence(result, m_CodeModifierSeq, m_Modifiers, getData(), getRules()->getByTag(m_CodeModifierSeq)); + if (result.good()) + { + result = CodeSequenceMacro::write(destination); + } + return result; +} + + +CodeWithModifiers::~CodeWithModifiers() +{ + DcmIODUtil::freeContainer(m_Modifiers); +} + + +OFString CodeSequenceMacro::toString() +{ + OFString d,m,v; + getCodeValue(v); + getCodeMeaning(m); + getCodingSchemeDesignator(d); + OFStringStream oss; + oss << "(" << d << "," << v << "," << m << ")"; + OFSTRINGSTREAM_GETOFSTRING(oss, msg); + return msg; + +} + + +// ---------------------- SeriesAndInstanceReferenceMacro---------------------- + +const OFString IODSeriesAndInstanceReferenceMacro::m_ComponentName = "SeriesAndInstanceReferenceMacro"; +const OFString IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::m_ComponentName = "SeriesAndInstanceReferenceMacro"; + +IODSeriesAndInstanceReferenceMacro::IODSeriesAndInstanceReferenceMacro(OFshared_ptr< DcmItem > data, + OFshared_ptr< IODRules > rules, + IODComponent* parent) : + IODComponent(data, rules, parent), + m_ReferencedSeriesItems() +{ + // reset element rules + resetRules(); +} + + +IODSeriesAndInstanceReferenceMacro::IODSeriesAndInstanceReferenceMacro(IODComponent* parent) : + IODComponent(parent), + m_ReferencedSeriesItems() +{ + // reset element rules + resetRules(); +} + + +OFString IODSeriesAndInstanceReferenceMacro::getName() const +{ + return m_ComponentName; +} + + +OFCondition IODSeriesAndInstanceReferenceMacro::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + DcmIODUtil::readSubSequence >(source, DCM_ReferencedSeriesSequence, m_ReferencedSeriesItems, m_Rules->getByTag(DCM_ReferencedSeriesSequence)); + return EC_Normal; +} + + +OFCondition IODSeriesAndInstanceReferenceMacro::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + DcmIODUtil::writeSubSequence >(result, DCM_ReferencedSeriesSequence, m_ReferencedSeriesItems, destination, m_Rules->getByTag(DCM_ReferencedSeriesSequence)); + + return result; +} + + +void IODSeriesAndInstanceReferenceMacro::clearData() +{ + DcmIODUtil::freeContainer(m_ReferencedSeriesItems); +} + + +void IODSeriesAndInstanceReferenceMacro::resetRules() +{ + m_Rules->addRule(new IODRule(DCM_ReferencedSeriesSequence, "1-n", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFVector< IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem* >& IODSeriesAndInstanceReferenceMacro::getReferencedSeriesItems() +{ + return m_ReferencedSeriesItems; +} + + +IODSeriesAndInstanceReferenceMacro::~IODSeriesAndInstanceReferenceMacro() +{ + DcmIODUtil::freeContainer(m_ReferencedSeriesItems); +} + + +IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::ReferencedSeriesItem(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules, + IODComponent* parent) +: IODComponent(item, rules, parent), + m_ReferencedInstanceSequence() +{ + // reset element rules + resetRules(); +} + + +IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::ReferencedSeriesItem(IODComponent* parent) +: IODComponent(parent), + m_ReferencedInstanceSequence() +{ + // reset element rules + resetRules(); +} + + +IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::~ReferencedSeriesItem() +{ + clearData(); +} + + +OFString IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::getName() const +{ + return m_ComponentName; +} + + +void IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::clearData() +{ + DcmIODUtil::freeContainer(m_ReferencedInstanceSequence); + IODComponent::clearData(); +} + + + +OFCondition IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, clearOldData); + DcmIODUtil::readSubSequence(source, DCM_ReferencedInstanceSequence, m_ReferencedInstanceSequence, m_Rules->getByTag(DCM_ReferencedInstanceSequence)); + return EC_Normal; +} + + +OFCondition IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + DcmIODUtil::writeSubSequence >(result, DCM_ReferencedInstanceSequence, m_ReferencedInstanceSequence, *m_Item, m_Rules->getByTag(DCM_ReferencedInstanceSequence)); + result = IODComponent::write(destination); + + return result; +} + + +void IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::resetRules() +{ + // Parameters for Rule are tag, VM, type (1,1C,2,2C,3), module name and logical IOD level + m_Rules->addRule(new IODRule(DCM_SeriesInstanceUID, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedInstanceSequence, "1-n", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFVector< SOPInstanceReferenceMacro* >& IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::getReferencedInstanceItems() +{ + return m_ReferencedInstanceSequence; +} + + +OFCondition IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::getSeriesInstanceUID(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesInstanceUID, *m_Item, value, pos); +} + + +OFCondition IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::setSeriesInstanceUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesInstanceUID, value); + return result; +} + +OFCondition IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::addReference( + const OFString& sopClassUID, + const OFString& sopInstanceUID) +{ + OFVector::iterator instance = m_ReferencedInstanceSequence.begin(); + while (instance != m_ReferencedInstanceSequence.end()) + { + OFString c,i; + (*instance)->getReferencedSOPClassUID(c); + (*instance)->getReferencedSOPInstanceUID(i); + if ( i == sopInstanceUID) + { + DCMIOD_DEBUG("Skipping doubled instance reference when adding to Series and Instance Reference Macro"); + return EC_Normal; + } + else + { + instance++; + } + } + // We get here in case that we do not have this reference, add new one + SOPInstanceReferenceMacro* macro = new SOPInstanceReferenceMacro(); + if (!macro) + { + return EC_MemoryExhausted; + } + OFCondition result = macro->setReferencedSOPClassUID(sopClassUID); + if (result.good()) result = macro->setReferencedSOPInstanceUID(sopInstanceUID); + if (result.good()) + { + m_ReferencedInstanceSequence.push_back(macro); + } + else + { + delete macro; + result = IOD_EC_InvalidElementValue; + } + return result; +} + + +// ---------------------- SOPInstanceReferenceMacro ---------------------- + + +SOPInstanceReferenceMacro::SOPInstanceReferenceMacro(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules, + IODComponent* parent) +: IODComponent(item, rules, parent) +{ + // reset element rules + resetRules(); +} + + +SOPInstanceReferenceMacro::SOPInstanceReferenceMacro(IODComponent* parent) +: IODComponent(parent) +{ + // reset element rules + resetRules(); +} + + +SOPInstanceReferenceMacro::~SOPInstanceReferenceMacro() +{ + // nothing to do +} + + +OFString SOPInstanceReferenceMacro::getName() const +{ + return "SOPInstanceReferenceMacro"; +} + + +void SOPInstanceReferenceMacro::resetRules() +{ + // Parameters for Rule are tag, VM, type (1,1C,2,2C,3), module name and logical IOD level + m_Rules->addRule(new IODRule(DCM_ReferencedSOPClassUID, "1", "1", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedSOPInstanceUID, "1", "1", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue); +} + + +// -- get dicom attributes -- + +OFCondition SOPInstanceReferenceMacro::getReferencedSOPClassUID(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ReferencedSOPClassUID, *m_Item, value, pos); +} + +OFCondition SOPInstanceReferenceMacro::getReferencedSOPInstanceUID(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ReferencedSOPInstanceUID, *m_Item, value, pos); +} + +// -- set dicom attributes -- + +OFCondition SOPInstanceReferenceMacro::setReferencedSOPClassUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, value); + return result; +} + + +OFCondition SOPInstanceReferenceMacro::setReferencedSOPInstanceUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, value); + return result; +} + + +// ---------------------- ImageSOPInstanceReferenceMacro ---------------------- + + +ImageSOPInstanceReferenceMacro::ImageSOPInstanceReferenceMacro() + : ReferencedFrameNumber(DCM_ReferencedFrameNumber), + ReferencedSegmentNumber(DCM_ReferencedSegmentNumber) +{ + +} + + +OFCondition ImageSOPInstanceReferenceMacro::create(const OFString& sopClassUID, + const OFString& sopInstanceUID, + ImageSOPInstanceReferenceMacro*& result) +{ + result = new ImageSOPInstanceReferenceMacro(); + if (!result) + return EC_MemoryExhausted; + + OFCondition cond = result->setReferencedSOPClassUID(sopClassUID); + if (cond.good()) + { + cond = result->setReferencedSOPInstanceUID(sopInstanceUID); + } + if (cond.bad()) + { + delete result; + result = NULL; + } + return cond; +} + + +OFCondition ImageSOPInstanceReferenceMacro::create(const OFString& sopClassUID, + const OFString& sopInstanceUID, + const OFVector< Uint16 >& refFramesOrSegments, + ImageSOPInstanceReferenceMacro*& result) +{ + OFCondition cond = create(sopClassUID, sopInstanceUID, result); + if (cond.good()) + { + if (!refFramesOrSegments.empty()) + { + if (sopClassUID == UID_SegmentationStorage) + { + cond = result->setReferencedSegmentNumber(refFramesOrSegments); + } + else + { + cond = result->setReferencedFrameNumber(refFramesOrSegments); + } + } + if (cond.bad()) + { + delete result; + result = NULL; + } + } + return cond; +} + + +ImageSOPInstanceReferenceMacro::~ImageSOPInstanceReferenceMacro() +{ +} + +int ImageSOPInstanceReferenceMacro::compare(const IODComponent& rhs) const +{ + const ImageSOPInstanceReferenceMacro *macro = OFstatic_cast(const ImageSOPInstanceReferenceMacro*, &rhs); + if (macro == NULL) return -1; + int result = ReferencedFrameNumber.compare(macro->ReferencedFrameNumber); + if (result == 0) ReferencedSegmentNumber.compare(macro->ReferencedSegmentNumber); + if (result == 0) return SOPInstanceReferenceMacro::compare(rhs); + return result; +} + +void ImageSOPInstanceReferenceMacro::clear() +{ + SOPInstanceReferenceMacro::clearData(); + ReferencedFrameNumber.clear(); + ReferencedSegmentNumber.clear(); +} + + +OFCondition ImageSOPInstanceReferenceMacro::read(DcmItem& source, + const OFBool clearOldData) +{ + /* re-initialize object */ + if (clearOldData) + clear(); + + OFCondition result = SOPInstanceReferenceMacro::read(source, clearOldData); + + DcmIODUtil::getAndCheckElementFromDataset(source, ReferencedFrameNumber, "1-n", "1C", "ImageSOPInstanceReferenceMacro"); + DcmIODUtil::getAndCheckElementFromDataset(source, ReferencedSegmentNumber, "1-n", "1C", "ImageSOPInstanceReferenceMacro"); + + return result; +} + + +OFCondition ImageSOPInstanceReferenceMacro::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + /* copy all elements to dataset */ + DcmIODUtil::copyElementToDataset(result, item, ReferencedFrameNumber, "1-n" /* VM */, "1C" /* Type */, "ImageSOPInstanceReferenceMacro"); + DcmIODUtil::copyElementToDataset(result, item, ReferencedSegmentNumber, "1-n", "1C", "ImageSOPInstanceReferenceMacro"); + + if ( result.good() ) + result = SOPInstanceReferenceMacro::write(item); + + return result; +} + +// -- get dicom attributes -- + +OFCondition ImageSOPInstanceReferenceMacro::getReferencedFrameNumber(OFVector &values) +{ + // cast away const since underlying dcmdata routine is not const... + DcmIntegerString *is = OFconst_cast(DcmIntegerString*, &ReferencedFrameNumber); + for (size_t n = 0; n < is->getNumberOfValues(); n++) + { + Sint32 sint = 0; + is->getSint32(sint, OFstatic_cast(unsigned long, n)); + if (sint < 0) + { + DCMIOD_WARN("Invalid Referenced Frame Number in Image SOP Instance Reference Macro: " << sint); + return EC_CorruptedData; + } + values.push_back(OFstatic_cast(Uint16, sint)); + } + return EC_Normal; +} + + +OFCondition ImageSOPInstanceReferenceMacro::getReferencedSegmentNumber(OFVector &values) +{ + // cast away const since underlying dcmdata routine is not const... + DcmUnsignedShort *us = OFconst_cast(DcmUnsignedShort*, &ReferencedSegmentNumber); + return DcmIODUtil::getUint16ValuesFromElement(*us, values); +} + +// -- set dicom attributes -- + + +OFCondition ImageSOPInstanceReferenceMacro::setReferencedFrameNumber(const OFVector& values, + const OFBool checkValue) +{ + return DcmIODUtil::setUint16ValuesOnElement(ReferencedFrameNumber, values, "1-n", checkValue); +} + + +OFCondition ImageSOPInstanceReferenceMacro::addReferencedFrameNumber(const Uint16& value, + const OFBool checkValue) +{ + (void)checkValue; + OFString val; + ReferencedFrameNumber.getOFStringArray(val); + if (ReferencedFrameNumber.getNumberOfValues() > 0) + { + val += "\\"; + } + char buf[10]; + sprintf(buf, "%u", value); + val += buf; + return ReferencedFrameNumber.putOFStringArray(val); +} + + + +OFCondition ImageSOPInstanceReferenceMacro::setReferencedSegmentNumber(const OFVector& values, + const OFBool checkValue) +{ + return DcmIODUtil::setUint16ValuesOnElement(ReferencedSegmentNumber, values, "1-n", checkValue); +} + + +OFCondition ImageSOPInstanceReferenceMacro::addReferencedSegmentNumber(const Uint16& value, + const OFBool checkValue) +{ + (void)checkValue; + const unsigned long count = ReferencedSegmentNumber.getNumberOfValues(); + return ReferencedSegmentNumber.putUint16(value, count /* starts with 0, so add new value at the end */); + +} + + +// ---------------------- GeneralAnatomyMacro ---------------------- + + +GeneralAnatomyMacro::GeneralAnatomyMacro(const OFString& type) : + m_Type(type), + m_AnatomicRegion(), + m_AnatomicRegionModifier(), + m_PrimaryAnatomicStructure("3" /* Modifier in Primary Anatomic Structure is always optional */, "1", DCM_PrimaryAnatomicStructureModifierSequence) +{ + m_Type = type; +} + + +GeneralAnatomyMacro::GeneralAnatomyMacro(const GeneralAnatomyMacro& rhs) +: m_Type(rhs.m_Type), + m_AnatomicRegion(), + m_AnatomicRegionModifier(), + m_PrimaryAnatomicStructure("3" /* Modifier in Primary Anatomic Structure is always optional */, "1", DCM_PrimaryAnatomicStructureModifierSequence) +{ + *this = rhs; +} + + +GeneralAnatomyMacro& GeneralAnatomyMacro::operator=(const GeneralAnatomyMacro& rhs) +{ + if (this != &rhs) + { + clearData(); + m_Type = rhs.m_Type; + m_AnatomicRegion = rhs.m_AnatomicRegion; + m_PrimaryAnatomicStructure = rhs.m_PrimaryAnatomicStructure; + + OFVector::const_iterator it = rhs.m_AnatomicRegionModifier.begin(); + while ( it != rhs.m_AnatomicRegionModifier.end() ) + { + m_AnatomicRegionModifier.push_back( new CodeSequenceMacro(**it) ); + it++; + } + } + return *this; +} + + +GeneralAnatomyMacro::~GeneralAnatomyMacro() +{ + clearData(); +} + + +void GeneralAnatomyMacro::clearData() +{ + // m_Type stays the same + m_AnatomicRegion.clearData(); + DcmIODUtil::freeContainer(m_AnatomicRegionModifier); + m_PrimaryAnatomicStructure.clearData(); +} + + +OFCondition GeneralAnatomyMacro::check(const OFBool quiet) +{ + OFCondition result = m_AnatomicRegion.check(quiet); + if (result.bad()) + return result; + + OFVector::iterator it = m_AnatomicRegionModifier.begin(); + while (it != m_AnatomicRegionModifier.begin()) + { + result = (*it)->check(quiet); + if (result.bad()) return result; + it++; + } + // Primary Anatomic Structure is optional (type 3), so only check if + // user intended to fill in something. + if (!m_PrimaryAnatomicStructure.empty()) + { + result = m_PrimaryAnatomicStructure.check(quiet); + } + return result; +} + + +CodeSequenceMacro& GeneralAnatomyMacro::getAnatomicRegion() +{ + return m_AnatomicRegion; +} + + +OFVector& GeneralAnatomyMacro::getAnatomicRegionModifier() +{ + return m_AnatomicRegionModifier; +} + + +PrimaryAnatomicStructureMacro& GeneralAnatomyMacro::getPrimaryAnatomicStructure() +{ + return m_PrimaryAnatomicStructure; +} + + +// Reads Anatomic Region Sequence and Primary Anatomic Structure Macro from given item +OFCondition GeneralAnatomyMacro::read(DcmItem& source, + const OFBool clearOldData) +{ + OFCondition result = EC_Normal; + + /* re-initialize object */ + if (clearOldData) + clearData(); + + /* read Anatomic Region Sequence item into Code Sequence Macro */ + DcmIODUtil::readSingleItem(source, DCM_AnatomicRegionSequence, m_AnatomicRegion, m_Type, "GeneralAnatomyMacro"); + + /* read Primary Anatomic Structure Macro (main level, i.e.\ original item) */ + DcmIODUtil::readSingleItem(source, DCM_PrimaryAnatomicStructureSequence, m_PrimaryAnatomicStructure, "3", "GeneralAnatomyMacro"); + + /* Get the single item from Anatomic Region Sequence and read modifier if found */ + DcmItem* localItem = NULL; + if ( source.findAndGetSequenceItem(DCM_AnatomicRegionSequence, localItem).bad() ) + { + return result; + } + + /* read Anatomic Region Modifier Sequence from */ + DcmIODUtil::readSubSequence > + ( *localItem, /* item of Anatomic Region Sequence */ + DCM_AnatomicRegionModifierSequence, + m_AnatomicRegionModifier, + "1-n", + "3", + "GeneralAnatomyMacro" ); + + return result; +} + + +/// Write Anatomic Region Sequence from given item +OFCondition GeneralAnatomyMacro::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + + /* delete old data */ + item.findAndDeleteElement(DCM_AnatomicRegionSequence); + item.findAndDeleteElement(DCM_PrimaryAnatomicStructureSequence); + + /* Write sub structures */ + DcmIODUtil::writeSingleItem(result, DCM_AnatomicRegionSequence, m_AnatomicRegion, item, m_Type, "GeneralAnatomyMacro"); + if (result.good()) + { + DcmItem* seqItem = NULL; + result = item.findAndGetSequenceItem(DCM_AnatomicRegionSequence, seqItem, 0); + if (result.good()) + { + DcmIODUtil::writeSubSequence > + ( result, + DCM_AnatomicRegionModifierSequence, + m_AnatomicRegionModifier, + *seqItem, + "1-n", + "3", + "GeneralAnatomyMacro"); + } + } + DcmIODUtil::writeSingleItem(result, DCM_PrimaryAnatomicStructureSequence, m_PrimaryAnatomicStructure, item, "3", "GeneralAnatomyMacro"); + return result; +} + + +int GeneralAnatomyMacro::compare(const GeneralAnatomyMacro& rhs) const +{ + int result = m_AnatomicRegion.compare(rhs.m_AnatomicRegion); + if (result == 0) + { + if (m_AnatomicRegionModifier.size() > rhs.m_AnatomicRegionModifier.size()) + { + return 1; + } + else if (m_AnatomicRegionModifier.size() < rhs.m_AnatomicRegionModifier.size()) + { + return -1; + } + + for (size_t m = 0; m < m_AnatomicRegionModifier.size(); m++) + { + rhs.m_AnatomicRegionModifier[m]; + result = m_AnatomicRegionModifier[m]->compare( *(rhs.m_AnatomicRegionModifier[m]) ); + if (result != 0) + { + return result; + } + } + result = m_PrimaryAnatomicStructure.compare(rhs.m_PrimaryAnatomicStructure); + } + return result; +} + + +// ---------------------- AlgorithmIdentificationMacro ---------------------- + + +AlgorithmIdentificationMacro::AlgorithmIdentificationMacro() : + m_AlgorithmFamilyCode(), + m_AlgorithmNameCode(), + m_AlgorithmName(DCM_AlgorithmName), + m_AlgorithmVersion(DCM_AlgorithmVersion), + m_AlgorithmParameters(DCM_AlgorithmParameters), + m_AlgorithmSource(DCM_AlgorithmSource) +{ + +} +// +AlgorithmIdentificationMacro::~AlgorithmIdentificationMacro() +{ + clearData(); +} + + +void AlgorithmIdentificationMacro::clearData() +{ + m_AlgorithmFamilyCode.clearData(); + m_AlgorithmNameCode.clearData(); + m_AlgorithmName.clear(); + m_AlgorithmVersion.clear(); + m_AlgorithmParameters.clear(); + m_AlgorithmSource.clear(); +} + + +OFCondition AlgorithmIdentificationMacro::check(const OFBool quiet) +{ + OFCondition result; + result = m_AlgorithmFamilyCode.check(quiet); + if ( result.good() ) + { + if ( m_AlgorithmName.isEmpty() || m_AlgorithmVersion.isEmpty() ) + { + result = EC_MissingValue; + } + } + return result; +} + + + +CodeSequenceMacro& AlgorithmIdentificationMacro::getAlgorithmFamilyCode() +{ + return m_AlgorithmFamilyCode; +} + + +CodeSequenceMacro& AlgorithmIdentificationMacro::getAlgorithmNameCode() +{ + return m_AlgorithmNameCode; +} + + +OFCondition AlgorithmIdentificationMacro::getAlgorithmName(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_AlgorithmName, value, pos); +} + + +OFCondition AlgorithmIdentificationMacro::getAlgorithmVersion(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_AlgorithmVersion, value, pos); +} + + +OFCondition AlgorithmIdentificationMacro::getAlgorithmParameters(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_AlgorithmParameters, value, pos); +} + + +OFCondition AlgorithmIdentificationMacro::getAlgorithmSource(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_AlgorithmSource, value, pos); +} + + +OFCondition AlgorithmIdentificationMacro::setAlgorithmName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_AlgorithmName.putOFStringArray(value); + return result; +} + + +OFCondition AlgorithmIdentificationMacro::setAlgorithmVersion(const OFString& value, + const OFBool checkValue) + +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_AlgorithmVersion.putOFStringArray(value); + return result; +} + + +OFCondition AlgorithmIdentificationMacro::setAlgorithmParameters(const OFString& value, + const OFBool checkValue) +{ + (void)checkValue; + return m_AlgorithmParameters.putOFStringArray(value); +} + + +OFCondition AlgorithmIdentificationMacro::setAlgorithmSource(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_AlgorithmSource.putOFStringArray(value); + return result; +} + + +/// Reads Anatomic Region Sequence and Primary Anatomic Structure Macro from given item +OFCondition AlgorithmIdentificationMacro::read(DcmItem& source, + const OFBool clearOldData) +{ + OFCondition result; + + if (clearOldData) + clearData(); + + DcmIODUtil::readSingleItem + ( + source, + DCM_AlgorithmFamilyCodeSequence, + m_AlgorithmFamilyCode, + "1", + "AlgorithmIdentificationMacro" + ); + + DcmIODUtil::readSingleItem + ( + source, + DCM_AlgorithmNameCodeSequence, + m_AlgorithmNameCode, + "3", + "AlgorithmIdentificationMacro"); + + DcmIODUtil::getAndCheckElementFromDataset(source, m_AlgorithmName, "1", "1", "AlgorithmIdentificationMacro"); + DcmIODUtil::getAndCheckElementFromDataset(source, m_AlgorithmVersion, "1", "1", "AlgorithmIdentificationMacro"); + DcmIODUtil::getAndCheckElementFromDataset(source, m_AlgorithmParameters, "1", "3", "AlgorithmIdentificationMacro"); + DcmIODUtil::getAndCheckElementFromDataset(source, m_AlgorithmSource, "1", "3", "AlgorithmIdentificationMacro"); + + return result; +} + + +OFCondition AlgorithmIdentificationMacro::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + + // write to item + DcmIODUtil::copyElementToDataset(result, item, m_AlgorithmName, "1", "1", "AlgorithmIdentificationMacro"); + DcmIODUtil::copyElementToDataset(result, item, m_AlgorithmVersion, "1", "1", "AlgorithmIdentificationMacro"); + DcmIODUtil::copyElementToDataset(result, item, m_AlgorithmParameters, "1", "3", "AlgorithmIdentificationMacro"); + DcmIODUtil::copyElementToDataset(result, item, m_AlgorithmSource, "1", "3", "AlgorithmIdentificationMacro"); + + DcmIODUtil::writeSingleItem + ( result, + DCM_AlgorithmFamilyCodeSequence, + m_AlgorithmFamilyCode, + item, + "1", + "AlgorithmIdentificationMacro" + ); + + DcmIODUtil::writeSingleItem + ( result, + DCM_AlgorithmNameCodeSequence, + m_AlgorithmNameCode, + item, + "3", + "AlgorithmIdentificationMacro" + ); + + return result; +} + + +// ---------------------- ContentIdentificationMacro ---------------------- + +ContentIdentificationMacro::ContentIdentificationMacro() : + m_InstanceNumber(DCM_InstanceNumber), + m_ContentLabel(DCM_ContentLabel), + m_ContentDescription(DCM_ContentDescription), + m_AlternateContentDescription(), + m_ContentCreatorName(DCM_ContentCreatorName), + m_ContentCreatorIdentificationCode(), + m_IODRules() +{ + resetRules(); +} + + +ContentIdentificationMacro::ContentIdentificationMacro(const OFString& instanceNumber, + const OFString& contentLabel, + const OFString& contentDescription, + const OFString& contentCreatorName) : + m_InstanceNumber(DCM_InstanceNumber), + m_ContentLabel(DCM_ContentLabel), + m_ContentDescription(DCM_ContentDescription), + m_AlternateContentDescription(), + m_ContentCreatorName(DCM_ContentCreatorName), + m_ContentCreatorIdentificationCode(), + m_IODRules() +{ + resetRules(); + setInstanceNumber(instanceNumber); + setContentLabel(contentLabel); + setContentDescription(contentDescription); + setContentCreatorName(contentCreatorName); +} + + +void ContentIdentificationMacro::resetRules() +{ + m_IODRules.addRule(new IODRule(DCM_InstanceNumber, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_IODRules.addRule(new IODRule(DCM_ContentLabel, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_IODRules.addRule(new IODRule(DCM_ContentDescription, "1", "2", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_IODRules.addRule(new IODRule(DCM_ContentCreatorName, "1", "2", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_IODRules.addRule(new IODRule(DCM_AlternateContentDescriptionSequence, "1-n", "3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_IODRules.addRule(new IODRule(DCM_ContentCreatorIdentificationCodeSequence, "1", "3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFString ContentIdentificationMacro::getName() const +{ + return "ContentIdentificationMacro"; +} + + +IODRules& ContentIdentificationMacro::getIODRules() +{ + return m_IODRules; +} + + +ContentIdentificationMacro::ContentIdentificationMacro(const ContentIdentificationMacro& rhs) : + m_InstanceNumber(DCM_InstanceNumber), + m_ContentLabel(DCM_ContentLabel), + m_ContentDescription(DCM_ContentDescription), + m_AlternateContentDescription(), + m_ContentCreatorName(DCM_ContentCreatorName), + m_ContentCreatorIdentificationCode(), + m_IODRules() +{ + if (&rhs != this) + { + resetRules(); + m_InstanceNumber = rhs.m_InstanceNumber; + m_ContentLabel = rhs.m_ContentLabel; + m_ContentDescription = rhs.m_ContentDescription; + m_ContentCreatorName = rhs.m_ContentCreatorName; + m_ContentCreatorIdentificationCode = rhs.m_ContentCreatorIdentificationCode; + /* perform deep vector copy */ + OFVector::const_iterator it = rhs.m_AlternateContentDescription.begin(); + while (it != rhs.m_AlternateContentDescription.end()) + { + m_AlternateContentDescription.push_back(new AlternateContentDescriptionItem(**it)); + it++; + } + } +} + + +OFCondition ContentIdentificationMacro::create(const OFString& instanceNumber, + const OFString& contentLabel, + const OFString& contentDescription, + const OFString& contentCreatorName, + ContentIdentificationMacro*& result) +{ + result = new ContentIdentificationMacro(); + if (!result) + return EC_MemoryExhausted; + OFCondition cond = result->setInstanceNumber(instanceNumber); + if (cond.good()) + { + cond = result->setContentLabel(contentLabel); + } + if (cond.good()) + { + cond = result->setContentDescription(contentDescription); + } + if (cond.good()) + { + cond = result->setContentCreatorName(contentCreatorName); + } + if (cond.good()) + { + cond = result->check(); + } + if (cond.bad()) + { + delete result; + result = NULL; + } + return cond; +} + + + +ContentIdentificationMacro& ContentIdentificationMacro::operator=(const ContentIdentificationMacro& rhs) +{ + if (&rhs != this) + { + this->clearData(); + m_InstanceNumber = rhs.m_InstanceNumber; + m_ContentLabel = rhs.m_ContentLabel; + m_ContentDescription = rhs.m_ContentDescription; + m_ContentCreatorName = rhs.m_ContentCreatorName; + m_ContentCreatorIdentificationCode = rhs.m_ContentCreatorIdentificationCode; + /* perform deep vector copy */ + OFVector::const_iterator it = rhs.m_AlternateContentDescription.begin(); + while (it != rhs.m_AlternateContentDescription.end()) + { + AlternateContentDescriptionItem* newItem = new AlternateContentDescriptionItem(); + *newItem = **it; + m_AlternateContentDescription.push_back(newItem); + it++; + } + } + return *this; +} + + +ContentIdentificationMacro::~ContentIdentificationMacro() +{ + clearData(); +} + + +void ContentIdentificationMacro::clearData() +{ + m_InstanceNumber.clear(); + m_ContentLabel.clear(); + m_ContentDescription.clear(); + DcmIODUtil::freeContainer(m_AlternateContentDescription); + m_ContentCreatorName.clear(); + m_ContentCreatorIdentificationCode.clearData(); +} + + +OFCondition ContentIdentificationMacro::check(const OFBool quiet) +{ + (void)quiet; + OFCondition result; + OFBool failure = m_ContentLabel.isEmpty() || m_InstanceNumber.isEmpty(); + if (!failure) + { + if (!m_AlternateContentDescription.empty()) // type 3 + { + OFVector::iterator it = m_AlternateContentDescription.begin(); + while ( it != m_AlternateContentDescription.end() && !failure) + { + OFString str; + (*it)->getContentDescription(str).good(); // type 1 + failure = str.empty(); + if (!failure) + { + OFString meaning, value, designator; + (*it)->getLanguageCode().getCodeMeaning(meaning); + (*it)->getLanguageCode().getCodeValue(value); + (*it)->getLanguageCode().getCodeValue(designator); + failure = meaning.empty() || value.empty() || designator.empty(); + } + it++; + } + } + } + if ( failure ) + result = EC_IllegalParameter; + return result; +} + + + +OFCondition ContentIdentificationMacro::getInstanceNumber(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_InstanceNumber, value, pos); +} + + + +OFCondition ContentIdentificationMacro::getContentLabel(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_ContentLabel, value, pos); +} + + +OFCondition ContentIdentificationMacro::getContentDescription(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_ContentDescription, value, pos); +} + + +OFCondition ContentIdentificationMacro::getContentCreatorName(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromElement(m_ContentCreatorName, value, pos); +} + + +CodeSequenceMacro& ContentIdentificationMacro::getContentCreatorIdentificationCode() +{ + return m_ContentCreatorIdentificationCode; +} + + +OFVector& ContentIdentificationMacro::getAlternateContentDescription() +{ + return m_AlternateContentDescription; +} + + +OFCondition ContentIdentificationMacro::setInstanceNumber(const OFString& value, + const OFBool checkValue) +{ + OFCondition result; + if (checkValue) + { + result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + } + if (result.good()) + { + result = m_InstanceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition ContentIdentificationMacro::setContentLabel(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, m_IODRules.getByTag(DCM_ContentLabel)->getVM()) : EC_Normal; + if (result.good()) + result = m_ContentLabel.putOFStringArray(value); + return result; +} + + +OFCondition ContentIdentificationMacro::setContentDescription(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, m_IODRules.getByTag(DCM_ContentDescription)->getVM()) : EC_Normal; + if (result.good()) + result = m_ContentDescription.putOFStringArray(value); + return result; +} + + +OFCondition ContentIdentificationMacro::setContentCreatorName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmPersonName::checkStringValue(value, m_IODRules.getByTag(DCM_ContentCreatorName)->getVM()) : EC_Normal; + if (result.good()) + result = m_ContentCreatorName.putOFStringArray(value); + return result; +} + + +OFCondition ContentIdentificationMacro::read(DcmItem& source, + const OFBool clearOldData) +{ + OFCondition result; + + if (clearOldData) + clearData(); + + /* flat elements */ + + DcmIODUtil::getAndCheckElementFromDataset(source, m_InstanceNumber, m_IODRules.getByTag(DCM_InstanceNumber)); + DcmIODUtil::getAndCheckElementFromDataset(source, m_ContentLabel, m_IODRules.getByTag(DCM_ContentLabel)); + DcmIODUtil::getAndCheckElementFromDataset(source, m_ContentDescription, m_IODRules.getByTag(DCM_ContentDescription)); + DcmIODUtil::getAndCheckElementFromDataset(source, m_ContentCreatorName, m_IODRules.getByTag(DCM_ContentCreatorName)); + + /* sub sequences */ + IODRule *rule = m_IODRules.getByTag(DCM_AlternateContentDescriptionSequence); + DcmIODUtil::readSubSequence > + ( source, + DCM_AlternateContentDescriptionSequence, + m_AlternateContentDescription, + rule->getVM(), + rule->getType(), + "ContentIdentificationMacro" ); + + rule = m_IODRules.getByTag(DCM_ContentCreatorIdentificationCodeSequence); + DcmIODUtil::readSingleItem + ( + source, + DCM_ContentCreatorIdentificationCodeSequence, + m_ContentCreatorIdentificationCode, + rule->getType(), + "ContentIdentificationMacro"); + + return result; +} + + +OFCondition ContentIdentificationMacro::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + + /* flat elements */ + DcmIODUtil::copyElementToDataset(result, item, m_InstanceNumber, m_IODRules.getByTag(DCM_InstanceNumber)); + DcmIODUtil::copyElementToDataset(result, item, m_ContentLabel, m_IODRules.getByTag(DCM_ContentLabel)); + DcmIODUtil::copyElementToDataset(result, item, m_ContentDescription, m_IODRules.getByTag(DCM_ContentDescription)); + DcmIODUtil::copyElementToDataset(result, item, m_ContentCreatorName, m_IODRules.getByTag(DCM_ContentCreatorName)); + + IODRule *rule = m_IODRules.getByTag(DCM_ContentCreatorIdentificationCodeSequence); + DcmIODUtil::writeSingleItem + ( + result, + DCM_ContentCreatorIdentificationCodeSequence, + m_ContentCreatorIdentificationCode, + item, + rule->getType(), + "ContentIdentificationMacro" + ); + + rule = m_IODRules.getByTag(DCM_AlternateContentDescriptionSequence); + DcmIODUtil::writeSubSequence< OFVector > + ( + result, + DCM_AlternateContentDescriptionSequence, + m_AlternateContentDescription, + item, + rule->getVM(), + rule->getType(), + "ContentIdentificationMacro" + ); + + return result; + +} + + +// ---------------- ContentIdentificationMacro::AlternateContentDescriptionItem ----------------- + +ContentIdentificationMacro::AlternateContentDescriptionItem::AlternateContentDescriptionItem() + : m_ContentDescription(DCM_ContentDescription), + m_LanguageCode() +{ + // nothing to do +} + + +ContentIdentificationMacro::AlternateContentDescriptionItem::~AlternateContentDescriptionItem() +{ + m_LanguageCode.clearData(); +} + + +void ContentIdentificationMacro::AlternateContentDescriptionItem::clearData() +{ + m_ContentDescription.clear(); + m_LanguageCode.clearData(); +} + + +OFCondition ContentIdentificationMacro::AlternateContentDescriptionItem::read(DcmItem& source, + const OFBool clearOldData) +{ + OFCondition result; + if (clearOldData) + clearData(); + + DcmIODUtil::getAndCheckElementFromDataset(source, m_ContentDescription, "1", "1", "ContentIdentificationMacro"); + DcmIODUtil::readSingleItem + ( + source, + DCM_LanguageCodeSequence, + m_LanguageCode, + "1", + "ContentIdentificationMacro" + ); + + return result; +} + + +OFCondition ContentIdentificationMacro::AlternateContentDescriptionItem::getContentDescription(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromElement(m_ContentDescription, value, pos); +} + + + +CodeSequenceMacro& ContentIdentificationMacro::AlternateContentDescriptionItem::getLanguageCode() +{ + return m_LanguageCode; +} + + + +OFCondition ContentIdentificationMacro::AlternateContentDescriptionItem::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + // write to item + DcmIODUtil::copyElementToDataset(result, item, m_ContentDescription, "1", "1", "ContentIdentificationMacro"); + DcmIODUtil::writeSingleItem + ( result, + DCM_LanguageCodeSequence, + m_LanguageCode, + item, + "1", + "ContentIdentificationMacro" + ); + return result; +} + + +OFCondition ContentIdentificationMacro::AlternateContentDescriptionItem::setContentDescription(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_ContentDescription.putOFStringArray(value); + return result; +} + + +// -------------------- HL7HierarchicDesignatorMacro -------------------- + + +HL7HierarchicDesignatorMacro::HL7HierarchicDesignatorMacro(IODComponent* parent) +: IODComponent(parent) +{ + // reset element rules + resetRules(); +} + +HL7HierarchicDesignatorMacro::HL7HierarchicDesignatorMacro(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules, + IODComponent* parent) +: IODComponent(item, rules, parent) +{ + // reset element rules + resetRules(); +} + + +OFCondition HL7HierarchicDesignatorMacro::getUniversalEntityID(OFString& value, const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_UniversalEntityID, *m_Item, value, pos); +} + + +OFCondition HL7HierarchicDesignatorMacro::getLocalNamespaceEntityID(OFString& value, const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_LocalNamespaceEntityID, *m_Item, value, pos); +} + + +OFCondition HL7HierarchicDesignatorMacro::getUniversalEntityIDType(OFString& value, const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_UniversalEntityIDType, *m_Item, value, pos); +} + + +OFString HL7HierarchicDesignatorMacro::getName() const +{ + return "HL7HierarchicDesignatorMacro"; +} + + +void HL7HierarchicDesignatorMacro::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_UniversalEntityID, "1","1C", "getName()", DcmIODTypes::IE_UNDEFINED), OFTrue); + m_Rules->addRule(new IODRule(DCM_LocalNamespaceEntityID, "1","1C", "getName()", DcmIODTypes::IE_UNDEFINED), OFTrue); + m_Rules->addRule(new IODRule(DCM_UniversalEntityIDType, "1","1C", "getName()", DcmIODTypes::IE_UNDEFINED), OFTrue); +} + + +OFCondition HL7HierarchicDesignatorMacro::setLocalNamespaceEntityID(const OFString& value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertOFStringArray(DCM_LocalNamespaceEntityID,value); +} + + +OFCondition HL7HierarchicDesignatorMacro::setUniversalEntityID(const OFString& value, + const OFBool checkValue) +{ + (void) checkValue; + return m_Item->putAndInsertOFStringArray(DCM_UniversalEntityID,value); +} + + +OFCondition HL7HierarchicDesignatorMacro::setUniversalEntityIDType(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_UniversalEntityID,value); + return result; +} + + +// -------------------- Mandatory View and Slice Progression Direction Macro -------------------- + + +MandatoryViewAndSliceProgressionDirectionMacro::MandatoryViewAndSliceProgressionDirectionMacro(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules, + IODComponent* parent) +: IODComponent(item, rules, parent), + m_ViewCodeSequence(), + m_ViewModifierCode() +{ + resetRules(); +} + + + +MandatoryViewAndSliceProgressionDirectionMacro::MandatoryViewAndSliceProgressionDirectionMacro(IODComponent* parent) +: IODComponent(parent), + m_ViewCodeSequence(), + m_ViewModifierCode() +{ + resetRules(); +} + + +OFString MandatoryViewAndSliceProgressionDirectionMacro::getName() const +{ + return "MandatoryViewAndSliceProgressionDirectionMacro"; +} + + +void MandatoryViewAndSliceProgressionDirectionMacro::resetRules() +{ + m_Rules->addRule(new IODRule(DCM_ViewCodeSequence, "1","1", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue); + m_Rules->addRule(new IODRule(DCM_ViewModifierCodeSequence, "1-n","2C", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue); + m_Rules->addRule(new IODRule(DCM_SliceProgressionDirection, "1","1C", getName(), DcmIODTypes::IE_UNDEFINED), OFTrue); +} + + +void MandatoryViewAndSliceProgressionDirectionMacro::clearData() +{ + DcmIODUtil::freeContainer(m_ViewModifierCode); + m_ViewCodeSequence.clearData(); + IODComponent::clearData(); +} + + +OFCondition MandatoryViewAndSliceProgressionDirectionMacro::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + { + m_ViewCodeSequence.clearData(); + DcmIODUtil::freeContainer(m_ViewModifierCode); + } + OFCondition result = EC_Normal; + DcmIODUtil::readSingleItem(source, DCM_ViewCodeSequence, m_ViewCodeSequence, m_Rules->getByTag(DCM_ViewCodeSequence)); + DcmIODUtil::readSubSequence(source, DCM_ViewCodeSequence, m_ViewModifierCode, m_Rules->getByTag(DCM_ViewCodeSequence)); + IODComponent::read(source, clearOldData); + return EC_Normal; +} + + +OFCondition MandatoryViewAndSliceProgressionDirectionMacro::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + DcmIODUtil::writeSingleItem(result, DCM_ViewCodeSequence, m_ViewCodeSequence, *m_Item, m_Rules->getByTag(DCM_ViewCodeSequence)); + DcmIODUtil::writeSubSequence(result, DCM_ViewCodeSequence, m_ViewModifierCode, *m_Item, m_Rules->getByTag(DCM_ViewModifierCodeSequence)); + if (result.good()) result = IODComponent::write(item); + return result; +} + + +CodeSequenceMacro& MandatoryViewAndSliceProgressionDirectionMacro::getViewCode() +{ + return m_ViewCodeSequence; +} + + +OFVector< CodeSequenceMacro* >& MandatoryViewAndSliceProgressionDirectionMacro::getViewModifierCode() +{ + return m_ViewModifierCode; +} diff --git a/dcmiod/libsrc/iodreferences.cc b/dcmiod/libsrc/iodreferences.cc new file mode 100644 index 00000000..bf57c13f --- /dev/null +++ b/dcmiod/libsrc/iodreferences.cc @@ -0,0 +1,552 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing SOP references as used in different modules + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodtypes.h" +#include "dcmtk/dcmiod/iodreferences.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmdata/dcerror.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcfilefo.h" + + +// ------------------- class IODReference ------------------------------- + +IODReference::IODReference(const IODReference::MAX_LEVEL level) +: m_PatientID(), + m_StudyInstanceUID(), + m_SeriesInstanceUID(), + m_SOPClassUID(), + m_SOPInstanceUID(), + m_Level(level) +{ +} + + +IODReference::IODReference() +: m_PatientID(), + m_StudyInstanceUID(), + m_SeriesInstanceUID(), + m_SOPClassUID(), + m_SOPInstanceUID(), + m_Level(LEVEL_STUDY) +{ +} + +IODReference::~IODReference() +{ + // nothing to do +} + + + +void IODReference::clear() +{ + m_StudyInstanceUID.clear(); + m_SeriesInstanceUID.clear(); + m_SOPClassUID.clear(); + m_SOPInstanceUID.clear(); +} + + +OFBool IODReferences::add(IODReference* ref) +{ + if (ref->check().good()) + { + m_References.push_back(ref); + return OFTrue; + } + return OFFalse; +} + + +OFBool IODReference::readFromItem(DcmItem& item) +{ + if (m_Level >= LEVEL_PATIENT) + { + item.findAndGetOFString(DCM_PatientID, m_PatientID); + } + if (m_Level >= LEVEL_STUDY) + { + item.findAndGetOFString(DCM_StudyInstanceUID, m_StudyInstanceUID); + } + if (m_Level >= LEVEL_SERIES) + { + item.findAndGetOFString(DCM_SeriesInstanceUID, m_SeriesInstanceUID); + } + if (m_Level >= LEVEL_INSTANCE) + { + item.findAndGetOFString(DCM_SOPClassUID, m_SOPClassUID); + item.findAndGetOFString(DCM_SOPInstanceUID, m_SOPInstanceUID); + } + return check().good(); +} + + +OFBool IODReference::readFromFile(const OFString& filename) +{ + clear(); + DcmFileFormat ff; + OFCondition result = ff.loadFile(filename.c_str()); + if (result.good()) + { + DcmDataset* dset = ff.getDataset(); + return readFromItem(*dset); + } + return OFFalse; +} + + +OFCondition IODReferences::readTractographyReferencedInstanceSequence(DcmItem& source) +{ + size_t omitted = 0; + size_t added = 0; + DcmSequenceOfItems *seq = NULL; + OFCondition result = source.findAndGetSequence(DCM_ReferencedInstanceSequence, seq); + if (result.good()) + { + DcmItem* item = NULL; + item = OFstatic_cast(DcmItem*, seq->nextInContainer(item)); + while ( (item != NULL) && result.good() ) + { + IODImageReference* ref = new IODImageReference(IODReference::LEVEL_INSTANCE); + if (!ref) + { + return EC_MemoryExhausted; + } + item->findAndGetOFString(DCM_ReferencedSOPClassUID, ref->m_SOPClassUID); + item->findAndGetOFString(DCM_ReferencedSOPInstanceUID, ref->m_SOPInstanceUID); + // if present, copy referenced frame numbers + DcmElement* elem = NULL; + if (item->findAndGetElement(DCM_ReferencedFrameNumber, elem).good()) + { + unsigned long vm = elem->getNumberOfValues(); + for (unsigned long f = 0; f < vm; f++) + { + Sint32 val = 0; + if (elem->getSint32(val, f).good()) + { + if (val >= 0) + ref->m_ReferencedFrameNumber.push_back( OFstatic_cast(Uint32, val) ); + else + { + DCMIOD_WARN("Referenced Frame Number must be > 0 but is " << val << ", omitting frame reference"); + } + } + else + { + DCMIOD_WARN("Cannot get Referenced Frame Number from position #" << f << " omitting frame reference"); + } + } + } + result = ref->check(); + if (result.good()) + { + added++; + m_References.push_back(ref); + } + else + { + DCMIOD_WARN("Could not read Image reference (invalid?): " << (*ref).toString()); + omitted++; + delete ref; + ref = NULL; + } + item = OFstatic_cast(DcmItem*, seq->nextInContainer(item)); + } + } + if ( (omitted > 0) && (added > 0) ) + { + return IOD_EC_ReferencesOmitted; + } + else if (omitted > 0) + { + return IOD_EC_InvalidReference; + } + return EC_Normal; +} + + + +OFCondition IODReferences::writeTractographyReferencedInstanceSequence(DcmItem& item) +{ + OFVector::iterator it = m_References.begin(); + item.findAndDeleteElement(DCM_ReferencedInstanceSequence); + DcmItem *seqItem = NULL; + size_t numItem = 0; + OFCondition result; + while ( (it != m_References.end() && result.good()) ) + { + if (result.good()) + { + result = item.findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, seqItem, OFstatic_cast(long, numItem)); + numItem++; + } + if (result.good()) + { + result = seqItem->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, (*it)->m_SOPClassUID); + } + if (result.good()) result = seqItem->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, (*it)->m_SOPInstanceUID); + if (result.good()) + { + if ( (*it)->getType() == IODReference::IMAGE ) + { + if (result.good()) + { + IODImageReference* ref = OFstatic_cast(IODImageReference*, *it); + if (ref && !ref->m_ReferencedFrameNumber.empty()) + { + OFStringStream oss; + for (size_t f = 0; f < ref->m_ReferencedFrameNumber.size(); f++) + { + oss << ref->m_ReferencedFrameNumber[f] << "\\"; + } + OFSTRINGSTREAM_GETOFSTRING(oss, frameRefs) + // Insert all references into Referenced Frame Number attribute. + // Remove superfluous "\" at the end of the string. + result = seqItem->putAndInsertOFStringArray(DCM_ReferencedFrameNumber, frameRefs.substr(0, frameRefs.size() - 1)); + } + } + } + } + it++; + } + if (result.bad()) + { + item.findAndDeleteElement(DCM_ReferencedInstanceSequence); + } + return result; +} + + +OFString IODReference::toString() const +{ + char buf[400]; + sprintf(buf, "Study/Series/SOPClass/SOPInstance UIDs: %s/%s/%s/%s", m_StudyInstanceUID.c_str(), m_SeriesInstanceUID.c_str(), m_SOPClassUID.c_str(), m_SOPInstanceUID.c_str()); + return buf; +} + + +OFCondition IODReference::check() const +{ + OFCondition result; + if (m_Level >= LEVEL_PATIENT) + { + if (!m_PatientID.empty()) + { + result = DcmLongString::checkStringValue(m_PatientID); + } + else + { + result = IOD_EC_InvalidElementValue; + } + } + if (result.good() && (m_Level >= LEVEL_STUDY)) + { + if (!m_StudyInstanceUID.empty()) + { + result= DcmUniqueIdentifier::checkStringValue(m_StudyInstanceUID, "1"); + } + else + { + result = IOD_EC_InvalidElementValue; + } + } + if (result.good() && (m_Level >= LEVEL_SERIES)) + { + if (!m_SeriesInstanceUID.empty()) + { + result = DcmUniqueIdentifier::checkStringValue(m_SeriesInstanceUID, "1"); + } + else + { + result = IOD_EC_InvalidElementValue; + } + } + if (result.good() && (m_Level >= LEVEL_INSTANCE)) + { + if (!m_SOPClassUID.empty()) + { + result = DcmUniqueIdentifier::checkStringValue(m_SOPClassUID, "1"); + } + else + { + result = IOD_EC_InvalidElementValue; + } + } + if (result.good() && (m_Level >= LEVEL_INSTANCE)) + { + if (!m_SOPInstanceUID.empty()) + { + result = DcmUniqueIdentifier::checkStringValue(m_SOPInstanceUID, "1"); + } + else + { + result = IOD_EC_InvalidElementValue; + } + } + return result; +} + + +IODReference* IODReference::clone() const +{ + IODReference* ref = new IODReference(); + if (ref) + { + ref->m_PatientID = m_PatientID; + ref->m_StudyInstanceUID = m_StudyInstanceUID; + ref->m_SeriesInstanceUID = m_SeriesInstanceUID; + ref->m_SOPClassUID = m_SOPClassUID; + ref->m_SOPInstanceUID = m_SOPInstanceUID; + ref->m_Level = m_Level; + } + return ref; +} + + +// ------------------- class IODImageReference ------------------------------- + + +IODImageReference::IODImageReference(const IODReference::MAX_LEVEL level) +: IODReference(level), + m_ReferencedFrameNumber() +{ +} + +IODImageReference::IODImageReference() +: IODReference(LEVEL_INSTANCE), + m_ReferencedFrameNumber() +{ + +} + + +IODImageReference::IODImageReference(const OFString& patientID, + const OFString& studyUID, + const OFString& seriesUID, + const OFString& sopInstanceUID, + const OFString& sopClassUID, + const OFVector& refFrameNumbers) +: IODReference(LEVEL_INSTANCE), + m_ReferencedFrameNumber(refFrameNumbers) +{ + m_PatientID = patientID; + m_StudyInstanceUID = studyUID; + m_SeriesInstanceUID = seriesUID; + m_SOPInstanceUID = sopInstanceUID; + m_SOPClassUID = sopClassUID; +} + + +IODImageReference::IODImageReference(const OFString& patientID, + const OFString& studyUID, + const OFString& seriesUID, + const OFString& sopInstanceUID, + const OFString& sopClassUID) +: m_ReferencedFrameNumber() +{ + m_PatientID = patientID; + m_StudyInstanceUID = studyUID; + m_SeriesInstanceUID = seriesUID; + m_SOPInstanceUID = sopInstanceUID; + m_SOPClassUID = sopClassUID; +} + + + +IODReference* IODImageReference::clone() const +{ + IODImageReference* ref = new IODImageReference(m_Level); + if (ref) + { + *(OFstatic_cast(IODReference*, ref)) = *this; + ref->m_ReferencedFrameNumber = m_ReferencedFrameNumber; + } + return ref; +} + + +void IODImageReference::clear() +{ + IODReference::clear(); + m_ReferencedFrameNumber.clear(); +} + + +OFBool IODImageReference::readFromFile(const OFString& filename, + const OFVector< Uint32 > frameNumbers) +{ + clear(); + DcmFileFormat ff; + OFCondition result = ff.loadFile(filename.c_str()); + if (result.good()) + { + if ( readFromItem( *ff.getDataset() ) ) + { + m_ReferencedFrameNumber = frameNumbers; + return OFTrue; + } + } + return OFFalse; +} + + +// ------------------ class IODSegmentationReference --------------------------- + +IODSegmentationReference::IODSegmentationReference(const IODReference::MAX_LEVEL level) +: IODReference(level), + m_ReferencedSegmentNumber() +{ +} + + +IODSegmentationReference::IODSegmentationReference() +: IODReference(LEVEL_INSTANCE), + m_ReferencedSegmentNumber() +{ + +} + + +IODReference* IODSegmentationReference::clone() const +{ + IODSegmentationReference* ref = new IODSegmentationReference(m_Level); + if (ref) + { + *(OFstatic_cast(IODReference*, ref)) = *this; + ref->m_ReferencedSegmentNumber = m_ReferencedSegmentNumber; + } + return ref; +} + + +OFBool IODSegmentationReference::readFromFile(const OFString& filename, + const OFVector< Uint16 > segmentNumbers) +{ + clear(); + DcmFileFormat ff; + OFCondition result = ff.loadFile(filename.c_str()); + if (result.good()) + { + if ( readFromItem(*ff.getDataset()) ) + { + m_ReferencedSegmentNumber = segmentNumbers; + return OFTrue; + } + } + return OFFalse; +} + + +void IODSegmentationReference::clear() +{ + IODReference::clear(); + m_ReferencedSegmentNumber.clear(); +} + + + +IODReferences::IODReferences() +: m_References() +{ + // nothing to do +} + + +IODReferences::~IODReferences() +{ + DcmIODUtil::freeContainer(m_References); +} + + +IODReferences::IODReferences(const IODReferences& rhs) +: m_References() +{ + *this = rhs; +} + + +IODReferences & IODReferences::operator=(const IODReferences& rhs) +{ + if (&rhs == this) + return *this; + + OFVector::const_iterator ref = rhs.m_References.begin(); + while (ref != rhs.m_References.end()) + { + m_References.push_back( (*ref)->clone()); + ref++; + } + return *this; +} + + + +const OFVector& IODReferences::get() const +{ + return m_References; +} + + +size_t IODReferences::size() const +{ + return m_References.size(); +} + + +size_t IODReferences::addFromFiles(const OFVector< OFString >& dcmFiles, + const IODReference::MAX_LEVEL level) +{ + if (dcmFiles.empty()) + { + return 0; + } + + OFCondition result; + OFVector::const_iterator it = dcmFiles.begin(); + size_t count = 0; + while (it != dcmFiles.end()) + { + IODReference* ref = new IODReference(level); + if (ref && ref->readFromFile(*it)) + { + m_References.push_back(ref); + count++; + } + else + { + DCMIOD_WARN("Could not add references from file " << (*it) << " (skipping)"); + delete ref; + } + it++; + } + return count; +} + + +void IODReferences::clearData() +{ + DcmIODUtil::freeContainer(m_References); +} diff --git a/dcmiod/libsrc/iodrules.cc b/dcmiod/libsrc/iodrules.cc new file mode 100644 index 00000000..d9df261c --- /dev/null +++ b/dcmiod/libsrc/iodrules.cc @@ -0,0 +1,364 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing attribute rules as found in DICOM modules + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/iodtypes.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/dctagkey.h" + + +IODRules::IODRules() : +m_Rules() +{ + // nothing to do +} + + +IODRules* IODRules::clone() +{ + IODRules *newRules = new IODRules(); + if (newRules) + { + OFMap::iterator it = m_Rules.begin(); + while (it != m_Rules.end()) + { + if (it->second) + { + IODRule* newRule = it->second->clone(); + if (newRule) + { + newRules->addRule(newRule); + } + else + { + DCMIOD_WARN("Cannot create new IODRule, memory exhausted?"); + } + } + else + { + DCMIOD_WARN("Found NULL IODRule, cannot clone"); + } + it++; + } + } + else + { + DCMIOD_WARN("Cannot create new IODRules, memory exhausted?"); + } + return newRules; +} + + +IODRule* IODRules::getByTag(const DcmTagKey& key) const +{ + IODRules::const_iterator it = m_Rules.find(key); + if ( it != m_Rules.end() ) + return (*it).second; + else + return NULL; +} + + +IODRules::iterator IODRules::begin() +{ + return m_Rules.begin(); +} + +IODRules::iterator IODRules::end() +{ + return m_Rules.end(); +} + + +void IODRules::clear() +{ + + while (m_Rules.size() > 0) + { + IODRules::iterator it = m_Rules.begin(); + IODRule* rule = (*it).second; + m_Rules.erase(it); + delete rule; + rule = NULL; + } +} + +OFBool IODRules::addRule(IODRule* rule, + const OFBool overwriteExisting) +{ + if (rule == NULL) + { + DCMIOD_ERROR("Cannot add IOD rule: NULL pointer"); + return OFFalse; + } + DcmTagKey key = rule->getTagKey(); + iterator it = m_Rules.find(key); + if ( it != m_Rules.end() ) + { + if (overwriteExisting) + { + delete (*it).second; + (*it).second = rule; + } + else + { + DCMIOD_DEBUG("IOD rule for tag " << key << " not inserted (already existing and overwriting disabled)"); + return OFFalse; + } + } + else + { + m_Rules.insert( OFMake_pair ( key, rule) ); + } + return OFTrue; +} + + +const OFVector< IODRule* > IODRules::getByModule(const OFString& moduleName) +{ + OFVector result; + IODRules::iterator it = m_Rules.begin(); + while (it != m_Rules.end()) + { + if ( (*it).second->getModule() == moduleName ) + { + result.push_back((*it).second); + } + it++; + } + return result; +} + + +OFBool IODRules::deleteRule(const DcmTagKey key) +{ + IODRules::iterator it = m_Rules.find(key); + if ( it != m_Rules.end() ) + { + IODRule* rule = (*it).second; + m_Rules.erase(it); + delete rule; + return OFTrue; + } + return OFFalse; +} + + +void IODRules::dump(STD_NAMESPACE ostream &out) +{ + IODRules::iterator it = m_Rules.begin(); + while ( it != m_Rules.end() ) + { + out << (*it).first << ": Type \"" << (*it).second->getType() << "\", VM \"" << (*it).second->getType() << "\"" << OFendl; + it++; + } +} + + +IODRules::~IODRules() +{ + clear(); +} + + + +IODRule::IODRule(const DcmTagKey& key, + const OFString& VM, + const OFString& type, + const OFString& module, + const DcmIODTypes::IOD_IE ie, + const OFString& defaultValue, + const OFString& privateCreator) +: m_Key(key), +m_VM(VM), +m_Type(type), +m_Module(module), +m_IE(ie), +m_DefaultValue(defaultValue), +m_PrivateCreator(privateCreator) +{ + // nothing else to do +} + + +IODRule::~IODRule() +{ + // nothing to do +} + + +IODRule* IODRule::clone() +{ + return new IODRule(m_Key, m_VM, m_Type, m_Module, m_IE, m_DefaultValue, m_PrivateCreator); +} + + + +OFString IODRule::getPrivateCreator() const +{ + return m_PrivateCreator; +} + + +DcmTagKey IODRule::getTagKey() const +{ + return m_Key; +} + + + +OFString IODRule::getModule() const +{ + return m_Module; +} + + +OFString IODRule::getType() const +{ + return m_Type; +} + + +OFString IODRule::getVM() const +{ + return m_VM; +} + + +OFString IODRule::getDefaultValue() const +{ + return m_DefaultValue; +} + + +DcmIODTypes::IOD_IE IODRule::getIE() const +{ + return m_IE; +} + + +OFBool IODRule::setType(const OFString& val) +{ + if ( (val != "1") && (val != "1C") && (val != "2") && (val != "2C") && (val != "3") ) + { + return OFFalse; + } + m_Type = val; + return OFTrue; +} + + +OFBool IODRule::setModule(const OFString& val) +{ + if (val.empty()) + { + return OFFalse; + } + m_Module = val; + return OFTrue; +} + + + +OFBool IODRule::setPrivateCreator(const OFString& val) +{ + if (val.empty()) + { + return OFFalse; + } + m_PrivateCreator = val; + return OFTrue; +} + + +OFBool IODRule::setDefaultValue(const OFString& val) +{ + if (val.empty()) + { + return OFFalse; + } + m_DefaultValue = val; + return OFTrue; +} + + +OFBool IODRule::setVM(const OFString& val) +{ + // One could check whether this is a valid VM string... + m_VM = val; + return OFTrue; +} + + +OFCondition IODRule::check(DcmItem& item, + const OFBool quiet) +{ + OFCondition result; + const OFString tagName = DcmTag(m_Key).getTagName(); + DcmElement *elem = NULL; + OFCondition searchCond = item.findAndGetElement(m_Key, elem, OFFalse /* only this level */); + /* NB: type 1C and 2C cannot be checked, assuming to be optional */ + if (((m_Type == "1") || (m_Type== "2")) && searchCond.bad()) + { + if (!quiet) DCMIOD_WARN(tagName << " " << m_Key << " absent in " << m_Module << " (type " << m_Type << ")"); + result = EC_MissingAttribute; + } + else if ((elem == NULL) || elem->isEmpty(OFTrue /*normalize*/)) + { + /* however, type 1C should never be present with empty value */ + if (((m_Type == "1") || (m_Type == "1C")) && searchCond.good()) + { + if (!quiet) DCMIOD_WARN(tagName << " " << m_Key << " empty in " << m_Module << " (type " << m_Type << ")"); + result = EC_MissingValue; + } + } else { + const OFCondition checkResult = elem->checkValue(m_VM, OFTrue /*oldFormat*/); + if (checkResult == EC_InvalidCharacter) + { + if (!quiet) DCMIOD_WARN(tagName << " " << m_Key << " contains invalid character(s) in " << m_Module); + result = checkResult; + } + else if (checkResult == EC_ValueRepresentationViolated) + { + if (!quiet) DCMIOD_WARN(tagName << " " << m_Key << " violates VR definition in " << m_Module); + result = checkResult; + } + else if (checkResult == EC_ValueMultiplicityViolated) + { + const OFString vmText = (elem->getVR() == EVR_SQ) ? " #items" : " VM"; + if (!quiet) DCMIOD_WARN(tagName << " " << m_Key << vmText << " != " << m_VM << " in " << m_Module); + result = checkResult; + } + else if (checkResult == EC_MaximumLengthViolated) + { + if (!quiet) DCMIOD_WARN(tagName << " " << m_Key << " violates maximum VR length in " << m_Module); + result = checkResult; + } + else if (checkResult.bad()) + { + if (!quiet) DCMIOD_DEBUG("INTERNAL ERROR while checking value of " << tagName << " " << m_Key << " in " << m_Module); + result = EC_InternalError; + } + } + return result; +} diff --git a/dcmiod/libsrc/iodtypes.cc b/dcmiod/libsrc/iodtypes.cc new file mode 100644 index 00000000..74dc4d9e --- /dev/null +++ b/dcmiod/libsrc/iodtypes.cc @@ -0,0 +1,46 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing attribute rules as found in DICOM modules + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodtypes.h" +#include "dcmtk/dcmdata/dcerror.h" + +OFLogger DCM_dcmiodLogger = OFLog::getLogger("dcmtk.dcmiod"); + + +/*---------------------------------* + * constant definitions + *---------------------------------*/ + +// conditions +makeOFConditionConst(IOD_EC_WrongSOPClass, OFM_dcmiod, 1, OF_error, "Wrong SOP Class"); +makeOFConditionConst(IOD_EC_MissingAttribute, OFM_dcmiod, 2, OF_error, "Missing Attribute(s)"); +makeOFConditionConst(IOD_EC_MissingSequenceData, OFM_dcmiod, 3, OF_error, "Missing Sequence Data"); +makeOFConditionConst(IOD_EC_InvalidDimensions, OFM_dcmiod, 4, OF_error, "Invalid dimension information"); +makeOFConditionConst(IOD_EC_CannotInsertFrame, OFM_dcmiod, 5, OF_error, "Cannot insert frame"); +makeOFConditionConst(IOD_EC_InvalidPixelData, OFM_dcmiod, 6, OF_error, "Invalid Pixel Data"); +makeOFConditionConst(IOD_EC_InvalidObject, OFM_dcmiod, 7, OF_error, "Invalid Object"); +makeOFConditionConst(IOD_EC_CannotDecompress, OFM_dcmiod, 8, OF_error, "Cannot decompress"); +makeOFConditionConst(IOD_EC_NoSuchRule, OFM_dcmiod, 9, OF_error, "No such IOD rule"); +makeOFConditionConst(IOD_EC_InvalidLaterality, OFM_dcmiod, 10, OF_error, "Invalid value for 'Laterality' (only 'L' or 'R' permitted)"); +makeOFConditionConst(IOD_EC_InvalidElementValue, OFM_dcmiod, 11, OF_error, "Value not allowed for element"); +makeOFConditionConst(IOD_EC_InvalidReference, OFM_dcmiod, 12, OF_error, "One or more invalid SOP references"); +makeOFConditionConst(IOD_EC_ReferencesOmitted, OFM_dcmiod, 13, OF_error, "One or more SOP references have been omitted"); diff --git a/dcmiod/libsrc/iodutil.cc b/dcmiod/libsrc/iodutil.cc new file mode 100644 index 00000000..b951f8aa --- /dev/null +++ b/dcmiod/libsrc/iodutil.cc @@ -0,0 +1,617 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Static helper functionality for dcmiod module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctypes.h" // logger +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmiod/iodrules.h" + +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dcdicent.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcitem.h" + + +// --- static helpers --- + +OFCondition DcmIODUtil::getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement &delem, + const OFString &vm, + const OFString &type, + const char *moduleName) +{ + DcmStack stack; + const DcmTagKey tagKey = delem.getTag(); + OFCondition result = dataset.search(tagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + if (result.good()) + { + /* copy object from search stack */ + result = delem.copyFrom(*stack.top()); + /* we need a reference to the original element in order to determine the SpecificCharacterSet */ + checkElementValue(OFstatic_cast(DcmElement *, stack.top()), tagKey, vm, type, result, moduleName, dcmtk::log4cplus::WARN_LOG_LEVEL); + } + /* the element could not be found in the dataset */ + else + { + checkElementValue(delem, vm, type, result, moduleName, dcmtk::log4cplus::WARN_LOG_LEVEL); + } + return result; +} + + +OFCondition DcmIODUtil::getAndCheckElementFromDataset(DcmItem &dataset, + const DcmTagKey& tagKey, + DcmElement*& delem, + const OFString &vm, + const OFString &type, + const char *moduleName) +{ + if (delem) + return EC_IllegalParameter; + + DcmStack stack; + OFCondition result = dataset.search(tagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + if (result.good()) + { + /* copy object from search stack */ + delem = OFstatic_cast ( DcmElement*, stack.top()->clone() ); + /* we need a reference to the original element in order to determine the SpecificCharacterSet */ + checkElementValue(OFstatic_cast(DcmElement *, stack.top()), tagKey, vm, type, result, moduleName, dcmtk::log4cplus::WARN_LOG_LEVEL); + } + /* the element could not be found in the dataset */ + else + checkElementValue(delem, tagKey, vm, type, result, moduleName, dcmtk::log4cplus::WARN_LOG_LEVEL); + + return result; +} + + + +OFCondition DcmIODUtil::getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement &delem, + const IODRule* rule) +{ + if (rule == NULL) + return EC_CannotCheck; + + return getAndCheckElementFromDataset(dataset, delem, rule->getVM(), rule->getType(), rule->getModule().c_str()); +} + + +OFCondition DcmIODUtil::getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement*& delem, + const IODRule* rule) +{ + if (rule == NULL) + return EC_CannotCheck; + + return getAndCheckElementFromDataset(dataset, rule->getTagKey(), delem, rule->getVM(), rule->getType(), rule->getModule().c_str()); +} + + + +OFCondition DcmIODUtil::copyElementToDataset(OFCondition &result, + DcmItem &dataset, + const DcmElement &delem, + const IODRule* rule) +{ + if (rule == NULL) + return EC_CannotCheck; + + if (result.bad()) + return result; + + // addElementToDataset() consumes element, so create a copy + DcmElement * copy = OFstatic_cast(DcmElement*, delem.clone()); + if (!copy) + return EC_MemoryExhausted; + + return addElementToDataset(result, dataset, copy, rule); +} + + +OFCondition DcmIODUtil::copyElementToDataset(OFCondition &result, + DcmItem &dataset, + const DcmElement &delem, + const OFString &vm, + const OFString &type, + const char *moduleName) +{ + // Create temporary rule (in order to avoid code-copying) + IODRule rule(delem.getTag(), vm, type, moduleName, DcmIODTypes::IE_UNDEFINED); + return copyElementToDataset(result, dataset, delem, &rule); +} + + +OFCondition DcmIODUtil::addElementToDataset(OFCondition &result, + DcmItem &dataset, + DcmElement *delem, + const IODRule* rule) +{ + OFBool insertionOK = OFFalse; + if (result.good()) + { + if (rule != NULL) + { + // Create empty type 2 element if required + OFString type = rule->getType(); + if (delem == NULL) + { + if (type == "2") + { + delem = DcmItem::newDicomElement(rule->getTagKey()); + if (delem == NULL) + { + result = EC_MemoryExhausted; + return result; + }; + } else if (type != "1") + { + // Not type 1 or type 2 means the is type 1C, 2C or 3. For those it is + // fine to not insert anything + return EC_Normal; + } + else + { + // type 1 is missing + DCMIOD_ERROR(DcmTag(rule->getTagKey()).getTagName() << " " << rule->getTagKey() << " absent in " << rule->getModule() << " (type " << rule->getType() << ")"); + result = IOD_EC_MissingAttribute; + return result; + } + } + // At this point, we certainly have an element. Check its value (empty ok for type 2) + if ((type == "2") || !delem->isEmpty()) + { + // Insert non-empty element or empty "type 2" element. First, perform the insertion, and then + // check the value. This is (at least) required for checking the character set of string values which + // relies on the element context, i.e. the surrounding item or dataset. + result = dataset.insert(delem, OFTrue /*replaceOld*/); + if (result.good()) + { + result = checkElementValue(*delem, rule->getVM(), type, result, rule->getModule().c_str(), dcmtk::log4cplus::ERROR_LOG_LEVEL); + } + if (result.good()) + { + insertionOK = OFTrue; + } + // remove element if value is invalid + else + { + dataset.remove(delem); + } + } + else if (type == "1") + { + // Empty element value not allowed for "type 1" + result = EC_InvalidValue; + checkElementValue(*delem, rule->getVM(), type, result, rule->getModule().c_str(), dcmtk::log4cplus::ERROR_LOG_LEVEL); + } + } + else + { + // No rule, no checks + result = EC_CannotCheck; + } + } + if (!insertionOK) + { + // Delete element since dataset did not take over ownership + delete delem; + } + + return result; +} + + +const OFString& DcmIODUtil::currentDate(OFString &dateString) +{ + if (DcmDate::getCurrentDate(dateString).bad()) + { + dateString = ""; + } + return dateString; +} + + +const OFString& DcmIODUtil::currentTime(OFString &timeString) +{ + if (DcmTime::getCurrentTime(timeString, OFTrue /*seconds*/, OFFalse /*fraction*/).bad()) + { + timeString = ""; + } + return timeString; +} + + +OFCondition DcmIODUtil::checkElementValue(const DcmElement *delem, + const DcmTagKey &tagKey, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond, + const char *moduleName, + const dcmtk::log4cplus::LogLevel logLevel) +{ + OFCondition result = EC_Normal; + const OFString tagName = DcmTag(tagKey).getTagName(); + const OFString module = (moduleName == NULL) ? "IOD" : moduleName; + OFOStringStream error; + /* NB: type 1C and 2C cannot be checked, assuming to be optional */ + if (((type == "1") || (type == "2")) && searchCond.bad()) + { + error << tagName << " " << tagKey << " absent in " << module << " (type " << type << ")"; + result = IOD_EC_MissingAttribute; + } + else if ((delem == NULL) || OFconst_cast(DcmElement*, delem)->isEmpty(OFTrue /*normalize*/)) // cast away constness of delem; value modification can happen (eg. to remove padding) + { + /* however, type 1C should never be present with empty value */ + if (((type == "1") || (type == "1C")) && searchCond.good()) + { + error << tagName << " " << tagKey << " empty in " << module << " (type " << type << ")"; + result = EC_MissingValue; + } + } else { + result = OFconst_cast(DcmElement*, delem)->checkValue(vm, OFTrue /*oldFormat*/); // cast away constness of delem; value modification can happen (eg. to remove padding) + if (result == EC_InvalidCharacter) + { + error << tagName << " " << tagKey << " contains invalid character(s) in " << module; + } + else if (result == EC_ValueRepresentationViolated) + { + error << tagName << " " << tagKey << " violates VR definition in " << module; + } + else if (result == EC_ValueMultiplicityViolated) + { + const OFString vmText = (delem->getVR() == EVR_SQ) ? " #items" : " VM"; + error << tagName << " " << tagKey << vmText << " != " << vm << " in " << module; + } + else if (result == EC_MaximumLengthViolated) + { + error << tagName << " " << tagKey << " violates maximum VR length in " << module; + } + else if (result.bad()) + { + error << "INTERNAL ERROR while checking value of " << tagName << " " << tagKey << " in " << module; + result = EC_Normal; + } + } + OFSTRINGSTREAM_GETSTR(error, tmpString) + if (strlen(tmpString) > 0) + { + switch (logLevel) + { + case dcmtk::log4cplus::TRACE_LOG_LEVEL: DCMIOD_TRACE(tmpString); break; + case dcmtk::log4cplus::DEBUG_LOG_LEVEL: DCMIOD_DEBUG(tmpString); break; + case dcmtk::log4cplus::WARN_LOG_LEVEL : DCMIOD_WARN(tmpString); break; + case dcmtk::log4cplus::INFO_LOG_LEVEL : DCMIOD_INFO(tmpString); break; + case dcmtk::log4cplus::ERROR_LOG_LEVEL : DCMIOD_ERROR(tmpString); break; + case dcmtk::log4cplus::FATAL_LOG_LEVEL: DCMIOD_FATAL(tmpString); break; + default: DCMIOD_WARN(tmpString);; + } + } + OFSTRINGSTREAM_FREESTR(tmpString) + return result; +} + + +OFCondition DcmIODUtil::checkElementValue(const DcmElement &delem, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond, + const char *moduleName, + const dcmtk::log4cplus::LogLevel logLevel) +{ + /* call the real function */ + return checkElementValue(&delem, delem.getTag(), vm, type, searchCond, moduleName, logLevel); +} + + +OFCondition DcmIODUtil::getStringValueFromElement(const DcmElement &delem, + OFString &stringValue, + const signed long pos) +{ + OFCondition result = EC_Normal; + // cast away constness of delem; value modification can happen (eg. to remove padding) + if (pos < 0) + result = OFconst_cast(DcmElement &, delem).getOFStringArray(stringValue); + else + result = OFconst_cast(DcmElement &, delem).getOFString(stringValue, OFstatic_cast(unsigned long, pos)); + if (result.bad()) + stringValue.clear(); + return result; +} + + +OFCondition DcmIODUtil::getFloat64ValueFromElement(const DcmElement& delem, + Float64& result, + const unsigned long pos) +{ + return OFconst_cast(DcmElement &, delem).getFloat64(result, OFstatic_cast(unsigned long, pos)); +} + + +OFCondition DcmIODUtil::getFloat64ValuesFromElement(const DcmElement& delem, + OFVector& result) +{ + Float64* floats = NULL; + OFCondition cond = OFconst_cast(DcmElement &, delem).getFloat64Array(floats); + if (cond.good()) + { + size_t vm = OFconst_cast(DcmElement &, delem).getNumberOfValues(); + for (size_t n = 0; n < vm; n++) + { + result.push_back(floats[n]); + } + } + return cond; +} + + +OFCondition DcmIODUtil::getStringValueFromItem(const DcmTagKey& key, + DcmItem& item, + OFString& result, + const signed long& pos) +{ + DcmElement *elem = NULL; + item.findAndGetElement(key, elem); + if (elem != NULL) + return DcmIODUtil::getStringValueFromElement(*elem, result, pos); + else + return EC_TagNotFound; +} + + +OFCondition DcmIODUtil::getFloat64ValueFromItem(const DcmTagKey& key, + DcmItem& item, + Float64& result, + const unsigned long& pos) +{ + DcmElement *elem = NULL; + OFCondition cond = item.findAndGetElement(key, elem); + if (elem != NULL) + { + cond = DcmIODUtil::getFloat64ValueFromElement(*elem, result, pos); + } + return cond; +} + + +OFCondition DcmIODUtil::getFloat64ValuesFromItem(const DcmTagKey& key, + DcmItem& item, + OFVector& result) +{ + DcmElement *elem = NULL; + OFCondition cond = item.findAndGetElement(key, elem); + if (elem != NULL) + { + cond = DcmIODUtil::getFloat64ValuesFromElement(*elem, result); + } + return cond; +} + + +OFCondition DcmIODUtil::setUint16ValuesOnElement(DcmElement &delem, + const OFVector& values, + const OFString& vm, + const OFBool check) +{ + OFCondition result; + OFVector::const_iterator it = values.begin(); + for (size_t count=0; count < values.size(); count++ ) + { + result = delem.putUint16( (*it) ); + if ( result.bad() ) + { + DCMIOD_WARN(delem.getTag().getXTag() << ": Setting value " << " #" << count << " to \" " << *it << "\" not possible"); + } + else if (check) + { + result = DcmElement::checkVM(OFstatic_cast(unsigned long, values.size()), vm); + } + it++; + } + return result; +} + + +OFCondition DcmIODUtil::getUint16ValuesFromElement(DcmElement &delem, + OFVector& values) +{ + OFCondition result; + const size_t count = delem.getNumberOfValues(); + values.reserve(count); + for (size_t i = 0; i < count; i++) + { + Uint16 val; + result = delem.getUint16(val, OFstatic_cast(unsigned long, i)); + if (result.bad()) + { + DCMIOD_WARN(delem.getTag().getXTag() << ": Getting value " << " #" << i << " not possible"); + break; + } + values.push_back(val); + } + return result; +} + + +void DcmIODUtil::checkSubSequence(OFCondition& result, + DcmItem& surroundingItem, + const DcmTagKey& seqKey, + const OFString& cardinality, + const OFString& type, + const OFString& module, + const dcmtk::log4cplus::LogLevel logLevel) +{ + OFCondition exists = EC_Normal; + /* check result */ + if ( result.good() ) + { + DcmSequenceOfItems *seq = NULL; + exists = surroundingItem.findAndGetSequence(seqKey, seq); + result = DcmIODUtil::checkElementValue(seq, seqKey, cardinality, type, exists, module.c_str(), logLevel); + } +} + + +OFCondition DcmIODUtil::getAndCheckSingleItem(DcmSequenceOfItems& seq, + DcmItem*& item, + const DcmTagKey& checkKey) +{ + item = NULL; + const OFString tagName = OFconst_cast(DcmTag*, &seq.getTag())->getTagName(); // getTagName is not const... + if (checkKey != DCM_UndefinedTagKey) + { + if (seq.getTag().getXTag() != checkKey) + { + DCMIOD_ERROR("Expected sequence " << checkKey << " but got " << &seq.getTag() << "(" << tagName << ")"); + return EC_ItemNotFound; + } + } + + // get actual tag name and cardinality + const unsigned long card = seq.card(); + if (card != 1) + { + if (card > 1) + { + DCMIOD_WARN("Only single item allowed in " << tagName << ", ignoring " << card -1 << " other items"); + } + else // card = 0 + { + DCMIOD_WARN("Cannot read from sequence " << tagName << ": No item found"); + return EC_ItemNotFound; + } + } + // get item and return it + item = seq.getItem(0); + if (item == NULL) + { + DCMIOD_ERROR("Cannot read item from " << tagName << ": No item found (internal error)"); + return EC_CorruptedData; + } + return EC_Normal; +} + + +OFCondition DcmIODUtil::checkSOPClass(DcmItem* item, + const OFString& desiredSOPClass, + OFString& valueFound) +{ + valueFound.clear(); + if ( (item == NULL) || (item->card() == 0) ) + { + DCMIOD_TRACE("Cannot check SOP Class UID: Dataset not present or empty"); + return EC_IllegalParameter; + } + OFCondition result = item->findAndGetOFString(DCM_SOPClassUID, valueFound); + if ( result.bad() ) + { + DCMIOD_TRACE("No SOP Class UID in file, giving up"); + return EC_TagNotFound; + } + if (valueFound != desiredSOPClass) + { + DCMIOD_TRACE("File is not of SOP Class " << desiredSOPClass << ", but instead SOP Class is " << dcmFindNameOfUID(valueFound.c_str(), valueFound.c_str()) ); + return EC_InvalidValue; + } + return EC_Normal; +} + + +OFBool DcmIODUtil::isSequenceTag(const DcmTagKey& key, + const OFString& privateCreator) +{ + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dictRef = NULL; + if (privateCreator.empty()) + dictRef = globalDataDict.findEntry(key, NULL); + else + dictRef = globalDataDict.findEntry(key, privateCreator.c_str()); + DcmVR vr; + if (dictRef) + { + vr = dictRef->getVR(); + } + dcmDataDict.rdunlock(); + if (vr.getEVR() == EVR_SQ) + return OFTrue; + return OFFalse; +} + + +const DcmTagKey DcmIODUtil::parseTagKey(const OFString& keyString) +{ + unsigned int g, e; + DcmTagKey resultKey = DCM_UndefinedTagKey; + if (sscanf(keyString.c_str(), "(%x,%x)", &g, &e) == 2) + { + resultKey.set(OFstatic_cast(Uint16, g), OFstatic_cast(Uint16, e)); + } + return resultKey; +} + + +OFCondition DcmIODUtil::decompress(DcmDataset& dset) +{ + DcmXfer xfer = dset.getOriginalXfer(); + if (xfer.isEncapsulated()) + { + if (EC_Normal != dset.chooseRepresentation(EXS_LittleEndianExplicit, NULL)) + { + DCMIOD_ERROR("No conversion to uncompressed transfer syntax possible!"); + return IOD_EC_CannotDecompress; + } + } + + return EC_Normal; +} + + +OFString DcmIODUtil::createUID(const Uint8 level) +{ + char uid[100]; + switch (level) + { + case 0: dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT); break; + case 1: dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT); break; + case 2: dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT); break; + default: dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT); + } + return uid; +} + + +Uint32 DcmIODUtil::limitMaxFrames(const size_t numFramesPresent, + const OFString& warning) +{ + if (numFramesPresent > 2147483647) + { + DCMIOD_WARN(warning); + return 2147483647; + } + return OFstatic_cast(Uint16, numFramesPresent); +} diff --git a/dcmiod/libsrc/modacquisitioncontext.cc b/dcmiod/libsrc/modacquisitioncontext.cc new file mode 100644 index 00000000..ceedbb2f --- /dev/null +++ b/dcmiod/libsrc/modacquisitioncontext.cc @@ -0,0 +1,67 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Acquisition Context Module + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modacquisitioncontext.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODAcquisitionContextModule::m_ModuleName = "AcquisitionContextModule"; + + +IODAcquisitionContextModule::IODAcquisitionContextModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +IODAcquisitionContextModule::IODAcquisitionContextModule() +: IODModule() +{ + // reset element rules + resetRules(); +} + + +OFString IODAcquisitionContextModule::getName() const +{ + return m_ModuleName; +} + + +void IODAcquisitionContextModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_AcquisitionContextSequence, "1-n","2", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +IODAcquisitionContextModule::~IODAcquisitionContextModule() +{ +} + + +// --- get attributes (C++ string) --- + +// --- set attributes --- diff --git a/dcmiod/libsrc/modbase.cc b/dcmiod/libsrc/modbase.cc new file mode 100644 index 00000000..9ecde195 --- /dev/null +++ b/dcmiod/libsrc/modbase.cc @@ -0,0 +1,291 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Abstract base class for IOD Modules or other attribute collections + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +IODComponent::IODComponent(const IODComponent& rhs) +: m_Item(OFstatic_cast(DcmItem*, rhs.m_Item->clone())) +, m_Rules(rhs.m_Rules->clone()) +, m_Parent(OFnullptr) +{ + +} + + +IODComponent::IODComponent(OFshared_ptr item, + OFshared_ptr rules, + IODComponent* parent) +: m_Item(item), + m_Rules(rules), + m_Parent(parent) +{ + if (!m_Item) + m_Item.reset(new DcmItem()); + + if (!m_Rules) + m_Rules.reset(new IODRules()); +} + + +IODComponent::IODComponent(IODComponent* parent) +: m_Item(), + m_Rules(), + m_Parent(parent) +{ + m_Item.reset(new DcmItem()); + m_Rules.reset(new IODRules()); +} + + +IODComponent::~IODComponent() +{ + // Nothing to do for shared pointers +} + + +IODComponent& IODComponent::operator=(const IODComponent& rhs) +{ + if (&rhs != this) + { + m_Item.reset(OFstatic_cast(DcmItem*, rhs.m_Item->clone())); + m_Rules.reset(rhs.m_Rules->clone()); + m_Parent = OFnullptr; + } + return *this; +} + + +void IODComponent::inventMissing() +{ + // Try to fill in missing type 1 information + OFVector writeRules = m_Rules->getByModule(getName()); + OFVector::iterator rule = writeRules.begin(); + while (rule != writeRules.end()) + { + OFString val = (*rule)->getDefaultValue() ; + // We have a default value + if ( val.length() != 0 ) + { + // Check if element is not set + DcmElement *elem = NULL; + if ( getData().findAndGetElement( (*rule)->getTagKey(), elem ).bad() ) + { + elem = DcmItem::newDicomElement((*rule)->getTagKey()); + if (elem == NULL) + { + DCMIOD_ERROR("Could not allocate element " << (*rule)->getTagKey()); + } + else + { + elem->putString(val.c_str()); + m_Item->insert(elem); + } + } + else if (elem->getLength() == 0) + { + elem->putString(val.c_str()); + } + } + rule++; + } +} + + +void IODComponent::clearData() +{ + OFVector modRules = m_Rules->getByModule(getName()); + OFVector::iterator rule = modRules.begin(); + while (rule != modRules.end()) + { + m_Item->findAndDeleteElement( (*rule)->getTagKey() ); + rule++; + } +} + + +void IODComponent::makeOptional() +{ + OFVector modRules = m_Rules->getByModule(getName()); + OFVector::iterator rule = modRules.begin(); + while (rule != modRules.end()) + { + (*rule)->setType("3"); + rule++; + } +} + + +OFCondition IODComponent::read(DcmItem& source, + const OFBool clearOldData) +{ + // Debug + DCMIOD_DEBUG("Reading component: " << getName()); + + // Clear old data if desired + if (clearOldData) + { + clearData(); + } + + // Do actual reading + read(source, *m_Rules, *m_Item, getName()); + // We do not report errors here (only logger output) + return EC_Normal; +} + + +OFCondition IODComponent::write(DcmItem& destination) +{ + // Debug + DCMIOD_DEBUG("Writing component: " << getName()); + + // Invent missing values + inventMissing(); + + // Start writing + OFCondition result = EC_Normal; + result = write(*m_Item, *m_Rules, destination, getName()); + return result; +} + + +int IODComponent::compare(const IODComponent& rhs) const +{ + return this->m_Item.get()->compare( *(rhs.m_Item.get()) ) ; +} + + +OFCondition IODComponent::check(const OFBool quiet) +{ + OFCondition result; + IODRules::iterator it = m_Rules->begin(); + while (it != m_Rules->end()) + { + result = (*it).second->check(*m_Item, quiet); + if (result.bad()) + break; + else + it++; + } + return result; +} + + +// static helper +OFCondition IODComponent::read(DcmItem& source, + IODRules& rules, + DcmItem& destination, + const OFString& componentName) +{ + OFVector modRules = rules.getByModule(componentName); + OFVector::iterator rule = modRules.begin(); + while (rule != modRules.end()) + { + // We do not read/copy sequences but only check them since they are not + // handled within this component + OFBool isSequence = ( DcmTag( (*rule)->getTagKey()).getEVR() == EVR_SQ); + if (isSequence) + { + DcmElement *elem = NULL; + OFCondition cond = source.findAndGetElement( (*rule)->getTagKey(), elem); + DcmIODUtil::checkElementValue(elem, (*rule)->getTagKey(), (*rule)->getVM(), (*rule)->getType(), cond, (*rule)->getModule().c_str(), dcmtk::log4cplus::WARN_LOG_LEVEL); + } + else // Normal attributes are checked and copied over into this IOD component + { + DcmElement* elem = NULL; + DcmIODUtil::getAndCheckElementFromDataset(source, elem, *rule); + if (elem != NULL) + { + OFCondition result = destination.insert(elem, OFTrue); + if (result.bad()) + { + DCMIOD_ERROR("Cannot insert element with tag: " << (*rule)->getTagKey()); + delete elem; + } + } + } + rule++; + } + return EC_Normal; +} + + +// static helper +OFCondition IODComponent::write(DcmItem& source, + IODRules& rules, + DcmItem& destination, + const OFString& componentName) +{ + OFCondition result = EC_Normal; + + OFVector writeRules = rules.getByModule(componentName); + OFVector::iterator rule = writeRules.begin(); + while (rule != writeRules.end()) + { + DcmElement* elem = NULL; + source.findAndGetElement( (*rule)->getTagKey(), elem, OFFalse /* only this level */, OFTrue /* create copy*/); + DcmIODUtil::addElementToDataset(result, destination, elem, *rule); + rule++; + } + + return result; +} + + +// -------- IODModule -------------- + +IODModule::IODModule(): IODComponent() +{ + // nothing to do, IODComponent does the work +} + + +IODModule::IODModule(const IODModule& rhs) +: IODComponent(rhs.m_Item, rhs.m_Rules, rhs.m_Parent) +{ + +} + + +IODModule::IODModule(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules) +: IODComponent(item, rules, NULL /* No parent for modules */) +{ + // nothing to do, IODComponent does the work +} + + +IODModule& IODModule::operator=(const IODModule& rhs) +{ + if (this != &rhs) + { + m_Item = rhs.m_Item; + m_Rules = rhs.m_Rules; + m_Parent = rhs.m_Parent; + } + return *this; +} diff --git a/dcmiod/libsrc/modcommoninstanceref.cc b/dcmiod/libsrc/modcommoninstanceref.cc new file mode 100644 index 00000000..baeba898 --- /dev/null +++ b/dcmiod/libsrc/modcommoninstanceref.cc @@ -0,0 +1,357 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Common Instance Reference Module + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modcommoninstanceref.h" +#include "dcmtk/dcmiod/iodutil.h" // for static helpers + +const OFString IODCommonInstanceReferenceModule::m_ComponentName = "CommonInstanceReferenceModule"; +const OFString IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::m_ComponentName = "StudiesContainingOtherReferencedInstancesSequence"; + + +IODCommonInstanceReferenceModule::IODCommonInstanceReferenceModule(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules) +: IODModule(item, rules), + m_ReferenceSeriesItems(), + m_StudiesContainingOtherReferencedInstancesSequence() +{ + resetRules(); +} + + +IODCommonInstanceReferenceModule::IODCommonInstanceReferenceModule() +: IODModule(), + m_ReferenceSeriesItems(), + m_StudiesContainingOtherReferencedInstancesSequence() +{ + resetRules(); +} + + +IODCommonInstanceReferenceModule::~IODCommonInstanceReferenceModule() +{ + freeMemory(); +} + + +OFString IODCommonInstanceReferenceModule::getName() const +{ + return m_ComponentName; +} + + +OFVector< IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem* >& IODCommonInstanceReferenceModule::getReferencedSeriesItems() +{ + return m_ReferenceSeriesItems; +} + + +OFVector & IODCommonInstanceReferenceModule::getStudiesContainingOtherReferences() +{ + return m_StudiesContainingOtherReferencedInstancesSequence; +} + + +void IODCommonInstanceReferenceModule::clearData() +{ + freeMemory(); +} + + +OFCondition IODCommonInstanceReferenceModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + DcmIODUtil::readSubSequence(source, DCM_ReferencedSeriesSequence, m_ReferenceSeriesItems, m_Rules->getByTag(DCM_ReferencedSeriesSequence)); + DcmIODUtil::readSubSequence(source, + DCM_StudiesContainingOtherReferencedInstancesSequence, + m_StudiesContainingOtherReferencedInstancesSequence, + m_Rules->getByTag(DCM_StudiesContainingOtherReferencedInstancesSequence)); + + return EC_Normal; +} + + +OFCondition IODCommonInstanceReferenceModule::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + DcmIODUtil::writeSubSequence >(result, DCM_ReferencedSeriesSequence, m_ReferenceSeriesItems, *m_Item, m_Rules->getByTag(DCM_ReferencedSeriesSequence)); + DcmIODUtil::writeSubSequence >(result, + DCM_StudiesContainingOtherReferencedInstancesSequence, + m_StudiesContainingOtherReferencedInstancesSequence, + *m_Item, + m_Rules->getByTag(DCM_StudiesContainingOtherReferencedInstancesSequence)); + if (result.good()) result = IODModule::write(destination); + return result; +} + + +size_t IODCommonInstanceReferenceModule::addReferences( + const IODReferences& references, + const OFString& studyInstanceUID, + const OFBool clearOldData) +{ + if (clearOldData) + { + clearData(); + } + OFString ourStudy = studyInstanceUID; + if (ourStudy.empty()) + { + m_Item->findAndGetOFString(DCM_StudyInstanceUID, ourStudy); + if (ourStudy.empty()) + { + DCMIOD_ERROR("Could not add references: No Study Instance UID specified for \"this\" object"); + return 0; + } + } + + const OFVector refs = references.get(); + OFVector::const_iterator ref = refs.begin(); + size_t count = 0; + while (ref != refs.end()) + { + OFCondition result; + // If reference belongs into "this" study, add it to Referenced Series Sequence + OFString refStudy = (*ref)->m_StudyInstanceUID; + if ( refStudy == ourStudy ) + { + result = addSeriesReference(m_ReferenceSeriesItems, **ref); + } + else + { + // Reference lies outside of "this" study, put it into Studies Containing + // Other Referenced Instances Sequence + OFVector::iterator it = m_StudiesContainingOtherReferencedInstancesSequence.begin(); + while (it != m_StudiesContainingOtherReferencedInstancesSequence.end()) + { + OFString studyEntry; + (*it)->getStudyInstanceUID(studyEntry); + if (studyEntry == refStudy) + { + result = addSeriesReference( + (*it)->getReferencedSeriesAndInstanceReferences().getReferencedSeriesItems(), + **ref); + break; + } + else + { + it++; + } + } + // We did not find an entry for this study, add new one + if (it == m_StudiesContainingOtherReferencedInstancesSequence.end()) + { + StudiesOtherInstancesItem* newItem = new StudiesOtherInstancesItem(); + if (newItem) + { + result = newItem->setStudyInstanceUID(refStudy); + if (result.good()) + { + result = addSeriesReference(newItem->getReferencedSeriesAndInstanceReferences().getReferencedSeriesItems(), **ref); + } + if (result.good()) + { + m_StudiesContainingOtherReferencedInstancesSequence.push_back(newItem); + } + else + { + delete newItem; + } + } + else + { + DCMIOD_ERROR("Memory exhausted while adding references to Common Instance Reference Module"); + return count; + } + } + } + if (result.good()) + { + count++; + } + ref++; + } + return count; +} + + +void IODCommonInstanceReferenceModule::resetRules() +{ + // Parameters for Rule are tag, VM, type (1,1C,2,2C,3), module name and logical IOD level + m_Rules->addRule(new IODRule(DCM_ReferencedSeriesSequence, "1-n", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_StudiesContainingOtherReferencedInstancesSequence, "1-n", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFCondition IODCommonInstanceReferenceModule::addSeriesReference( + OFVector& container, + const IODReference& ref) +{ + OFCondition result; + OFVector::iterator series = container.begin(); + while ( series != container.end() ) + { + OFString s; + (*series)->getSeriesInstanceUID(s); + if (s == ref.m_SeriesInstanceUID) + { + // There is already an entry for this series + result = (*series)->addReference(ref.m_SOPClassUID, ref.m_SOPInstanceUID); + if (result.good()) + { + return EC_Normal; + } + else + { + DCMIOD_ERROR("Could not add reference to Common Instance Reference Module: " << ref.toString()); + return IOD_EC_InvalidElementValue; + } + } + series++; + } + // If we do not have such a series Referenced Series Sequence, add it + if (series == container.end()) + { + IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem* newseries = new IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem(); + if (!newseries) + { + return EC_MemoryExhausted; + } + result = newseries->setSeriesInstanceUID( ref.m_SeriesInstanceUID); + if (result.good()) result = newseries->addReference(ref.m_SOPClassUID, ref.m_SOPInstanceUID); + if (result.good()) + { + container.push_back(newseries); + } + else + { + DCMIOD_ERROR("Could not add reference to Common Instance Reference Module: " << ref.toString()); + } + } + return result; +} + + +// -- IODCommonInstanceReferenceModule::StudiesOtherInstancesItem -- + + +IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::StudiesOtherInstancesItem(OFshared_ptr< DcmItem > item, + OFshared_ptr< IODRules > rules, + IODComponent* parent) +: IODComponent(item, rules, parent), + m_ReferencedSeriesAndInstance() +{ + // reset element rules + resetRules(); +} + + +IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::StudiesOtherInstancesItem(IODComponent* parent) +: IODComponent(parent), + m_ReferencedSeriesAndInstance() +{ + // reset element rules + resetRules(); +} + + +IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::~StudiesOtherInstancesItem() +{ + clearData(); +} + + + +OFString IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::getName() const +{ + return m_ComponentName; +} + + +void IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::clearData() +{ + m_ReferencedSeriesAndInstance.clearData(); + IODComponent::clearData(); +} + + +OFCondition IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, clearOldData); + m_ReferencedSeriesAndInstance.read(source, clearOldData); + return EC_Normal; +} + + +OFCondition IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + result = IODComponent::write(destination); + + if (result.good()) result = m_ReferencedSeriesAndInstance.write(destination); + + return result; +} + + +void IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::resetRules() +{ + // Parameters for Rule are tag, VM, type (1,1C,2,2C,3), module name and logical IOD level + m_Rules->addRule(new IODRule(DCM_StudyInstanceUID, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +IODSeriesAndInstanceReferenceMacro& IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::getReferencedSeriesAndInstanceReferences() +{ + return m_ReferencedSeriesAndInstance; +} + + +OFCondition IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::getStudyInstanceUID(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StudyInstanceUID, *m_Item, value, pos); +} + + +OFCondition IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::setStudyInstanceUID(const OFString& value, + const bool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_StudyInstanceUID, value); + return result; +} + + +void IODCommonInstanceReferenceModule::freeMemory() +{ + DcmIODUtil::freeContainer(m_StudiesContainingOtherReferencedInstancesSequence); + DcmIODUtil::freeContainer(m_ReferenceSeriesItems); +} diff --git a/dcmiod/libsrc/modenhequipment.cc b/dcmiod/libsrc/modenhequipment.cc new file mode 100644 index 00000000..6c834cdb --- /dev/null +++ b/dcmiod/libsrc/modenhequipment.cc @@ -0,0 +1,161 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Enhanced General Equipment Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modenhequipment.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrst.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmiod/iodutil.h" + +IODEnhGeneralEquipmentModule::IODEnhGeneralEquipmentModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules), + m_ModuleName("EnhancedGeneralEquipmentModule") +{ + // reset element rules + resetRules(); +} + + +IODEnhGeneralEquipmentModule::IODEnhGeneralEquipmentModule() +: IODModule(), + m_ModuleName("EnhancedGeneralEquipmentModule") +{ + resetRules(); +} + + +OFCondition IODEnhGeneralEquipmentModule::create(const IODEnhGeneralEquipmentModule::EquipmentInfo& info, + IODEnhGeneralEquipmentModule* equipment) +{ + equipment = new IODEnhGeneralEquipmentModule(); + if (!equipment) + { + return EC_MemoryExhausted; + } + return equipment->set(info); +} + + +void IODEnhGeneralEquipmentModule::resetRules() +{ + m_Rules->addRule(new IODRule(DCM_Manufacturer, "1", "1", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_ManufacturerModelName, "1", "1", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_DeviceSerialNumber, "1", "1", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_SoftwareVersions, "1-n", "1", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); +} + + +IODEnhGeneralEquipmentModule::~IODEnhGeneralEquipmentModule() +{ + // Nothing to do +} + + +OFString IODEnhGeneralEquipmentModule::getName() const +{ + return m_ModuleName; +} + + +OFCondition IODEnhGeneralEquipmentModule::getDeviceSerialNumber(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DeviceSerialNumber, *m_Item, value, pos); +} + + +OFCondition IODEnhGeneralEquipmentModule::getManufacturer(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Manufacturer, *m_Item, value, pos); +} + + +OFCondition IODEnhGeneralEquipmentModule::getManufacturerModelName(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ManufacturerModelName, *m_Item, value, pos); +} + + +OFCondition IODEnhGeneralEquipmentModule::getSoftwareVersions(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SoftwareVersions, *m_Item, value, pos); +} + + +OFCondition IODEnhGeneralEquipmentModule::setDeviceSerialNumber(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DeviceSerialNumber, value); + return result; +} + + +OFCondition IODEnhGeneralEquipmentModule::setManufacturer(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_Manufacturer, value); + return result; +} + + +OFCondition IODEnhGeneralEquipmentModule::setManufacturerModelName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ManufacturerModelName, value); + return result; + +} + + +OFCondition IODEnhGeneralEquipmentModule::setSoftwareVersions(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SoftwareVersions, value); + return result; +} + + +OFCondition IODEnhGeneralEquipmentModule::set(const IODEnhGeneralEquipmentModule::EquipmentInfo& info) +{ + if (info.m_DeviceSerialNumber.empty() || info.m_Manufacturer.empty() || + info.m_ManufacturerModelName.empty() || info.m_SoftwareVersions.empty()) + return IOD_EC_InvalidElementValue; + + OFCondition result = setManufacturer(info.m_Manufacturer); + if (result.good()) result = setManufacturerModelName(info.m_ManufacturerModelName); + if (result.good()) result = setDeviceSerialNumber(info.m_DeviceSerialNumber); + if (result.good()) result = setSoftwareVersions(info.m_SoftwareVersions); + return result; +} diff --git a/dcmiod/libsrc/modenhusimage.cc b/dcmiod/libsrc/modenhusimage.cc new file mode 100644 index 00000000..7cb42a78 --- /dev/null +++ b/dcmiod/libsrc/modenhusimage.cc @@ -0,0 +1,670 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Enhanced US Image Module + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modenhusimage.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODEnhUSImageModule::m_ModuleName = "EnhancedUSImageModule"; + + +IODEnhUSImageModule::IODEnhUSImageModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules), + m_MandatoryViewAndSliceProgressionDirection(), + m_Anatomy("1" /* mandatory version */), + m_TransducerScanPattern(), + m_TransducerGeometry(), + m_TransducerBeamSteering(), + m_TransducerApplication() +{ + // reset element rules + resetRules(); +} + + +IODEnhUSImageModule::IODEnhUSImageModule() +: IODModule(), + m_MandatoryViewAndSliceProgressionDirection(), + m_Anatomy("1" /* mandatory version */), + m_TransducerScanPattern(), + m_TransducerGeometry(), + m_TransducerBeamSteering(), + m_TransducerApplication() +{ + // reset element rules + resetRules(); +} + + +OFString IODEnhUSImageModule::getName() const +{ + return m_ModuleName; +} + + +void IODEnhUSImageModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_ImageType, "4","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_SamplesPerPixel, "1","1" ,getName(), DcmIODTypes::IE_IMAGE, "1"), OFTrue); + m_Rules->addRule(new IODRule(DCM_PhotometricInterpretation, "1","1" ,getName(), DcmIODTypes::IE_IMAGE, "MONOCHROME2"), OFTrue); + m_Rules->addRule(new IODRule(DCM_Rows, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_Columns, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsAllocated, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsStored, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_HighBit, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PixelRepresentation, "1","1" ,getName(), DcmIODTypes::IE_IMAGE, "0"), OFTrue); + m_Rules->addRule(new IODRule(DCM_DimensionOrganizationType, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_AcquisitionDateTime, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_AcquisitionDuration, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PixelSpacing, "2","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PositionMeasuringDeviceUsed, "1","1C" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompression, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompressionRatio, "1-n","1C" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompressionMethod, "1-n","1C" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PresentationLUTShape, "1","1" ,getName(), DcmIODTypes::IE_IMAGE, "IDENTITY"), OFTrue); + m_Rules->addRule(new IODRule(DCM_RescaleSlope, "1","1" ,getName(), DcmIODTypes::IE_IMAGE, "1"), OFTrue); + m_Rules->addRule(new IODRule(DCM_RescaleIntercept, "1","1" ,getName(), DcmIODTypes::IE_IMAGE, "0"), OFTrue); + m_Rules->addRule(new IODRule(DCM_BurnedInAnnotation, "1","1" ,getName(), DcmIODTypes::IE_IMAGE, "NO"), OFTrue); + m_Rules->addRule(new IODRule(DCM_RecognizableVisualFeatures, "1","3" ,getName(), DcmIODTypes::IE_IMAGE, "NO"), OFTrue); + m_Rules->addRule(new IODRule(DCM_TransducerScanPatternCodeSequence, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_TransducerGeometryCodeSequence, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_TransducerBeamSteeringCodeSequence, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_TransducerApplicationCodeSequence, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ProcessingFunction, "1","3" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_MechanicalIndex, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BoneThermalIndex, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_CranialThermalIndex, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_SoftTissueThermalIndex, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DepthsOfFocus, "1-n","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DepthOfScanField, "1","1" ,getName(), DcmIODTypes::IE_IMAGE), OFTrue); +} + + +IODEnhUSImageModule::~IODEnhUSImageModule() +{ + DcmIODUtil::freeContainer(m_TransducerBeamSteering); +} + + +OFCondition IODEnhUSImageModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + { + DcmIODUtil::freeContainer(m_TransducerBeamSteering); + } + m_MandatoryViewAndSliceProgressionDirection.read(source, clearOldData); + m_Anatomy.read(source, clearOldData); + DcmIODUtil::readSingleItem(source, DCM_TransducerApplicationCodeSequence, m_TransducerApplication, m_Rules->getByTag(DCM_TransducerApplicationCodeSequence)); + DcmIODUtil::readSingleItem(source, DCM_TransducerGeometryCodeSequence, m_TransducerGeometry, m_Rules->getByTag(DCM_TransducerGeometryCodeSequence)); + DcmIODUtil::readSingleItem(source, DCM_TransducerScanPatternCodeSequence, m_TransducerGeometry, m_Rules->getByTag(DCM_TransducerScanPatternCodeSequence)); + DcmIODUtil::readSubSequence(source, DCM_TransducerBeamSteeringCodeSequence, m_TransducerBeamSteering, m_Rules->getByTag(DCM_TransducerBeamSteeringCodeSequence)); + IODComponent::read(source, clearOldData); + return EC_Normal; +} + + + +OFCondition IODEnhUSImageModule::write(DcmItem& destination) +{ + OFCondition result; + + // Copy sequences to source (which then will be later copied to destination by IODComponent::write() + result = m_MandatoryViewAndSliceProgressionDirection.write(destination); + if (result.good()) result = m_Anatomy.write(destination); + DcmIODUtil::writeSingleItem(result, DCM_TransducerScanPatternCodeSequence, m_TransducerScanPattern, *m_Item, m_Rules->getByTag(DCM_TransducerScanPatternCodeSequence)); + DcmIODUtil::writeSingleItem(result, DCM_TransducerGeometryCodeSequence, m_TransducerGeometry, *m_Item, m_Rules->getByTag(DCM_TransducerGeometryCodeSequence)); + DcmIODUtil::writeSingleItem(result, DCM_TransducerApplicationCodeSequence, m_TransducerApplication, *m_Item, m_Rules->getByTag(DCM_TransducerApplicationCodeSequence)); + DcmIODUtil::writeSubSequence(result, DCM_TransducerBeamSteeringCodeSequence, m_TransducerBeamSteering, *m_Item, m_Rules->getByTag(DCM_TransducerBeamSteeringCodeSequence)); + if (result.good()) result = IODComponent::write(destination); + return result; +} + + +// --- get attributes (C++ string) --- + + +OFCondition IODEnhUSImageModule::getImageType(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ImageType, *m_Item, value, pos); +} + + + +OFCondition IODEnhUSImageModule::getSamplesPerPixel(Uint16& value, + const unsigned long pos) +{ + return m_Item->findAndGetUint16(DCM_SamplesPerPixel, value, pos); +} + + + +OFCondition IODEnhUSImageModule::getPhotometricInterpretation(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_PhotometricInterpretation, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getRows(Uint16& value, + const unsigned long pos) +{ + return m_Item->findAndGetUint16(DCM_Rows, value, pos); +} + + + +OFCondition IODEnhUSImageModule::getColumns(Uint16& value, + const unsigned long pos) +{ + return m_Item->findAndGetUint16(DCM_Columns, value, pos); +} + + +OFCondition IODEnhUSImageModule::getBitsAllocated(Uint16& value, + const unsigned long pos) +{ + return m_Item->findAndGetUint16(DCM_BitsAllocated, value, pos); +} + + +OFCondition IODEnhUSImageModule::getBitsStored(Uint16& value, + const unsigned long pos) +{ + return m_Item->findAndGetUint16(DCM_BitsStored, value, pos); +} + + +OFCondition IODEnhUSImageModule::getHighBit(Uint16& value, + const unsigned long pos) +{ + return m_Item->findAndGetUint16(DCM_HighBit, value, pos); +} + + +OFCondition IODEnhUSImageModule::getPixelRepresentation(Uint16& value, + const unsigned long pos) +{ + return m_Item->findAndGetUint16(DCM_PixelRepresentation, value, pos); +} + + +OFCondition IODEnhUSImageModule::getDimensionOrganizationType(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_DimensionOrganizationType, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getAcquisitionDateTime(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_AcquisitionDateTime, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getAcquisitionDuration(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_AcquisitionDuration, value, pos); +} + + +OFCondition IODEnhUSImageModule::getPixelSpacing(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_PixelSpacing, value, pos); +} + + +OFCondition IODEnhUSImageModule::getPositionMeasuringDevice(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_PositionMeasuringDeviceUsed, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getLossyImageCompression(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompression, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getLossyImageCompressionRatio(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_LossyImageCompressionRatio, value, pos); +} + + +OFCondition IODEnhUSImageModule::getLossyImageCompressionMethod(OFString& value, const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompressionMethod, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getPresentationLUTShape(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_PresentationLUTShape, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getRescaleSlope(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_RescaleSlope, value, pos); +} + + +OFCondition IODEnhUSImageModule::getRescaleIntercept(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_RescaleSlope, *m_Item, value, pos); +} + + +GeneralAnatomyMacro& IODEnhUSImageModule::getAnatomy() +{ + return m_Anatomy; +} + + +MandatoryViewAndSliceProgressionDirectionMacro& IODEnhUSImageModule::getMandatoryViewAndSliceProgressionDirection() +{ + return m_MandatoryViewAndSliceProgressionDirection; +} + + +OFCondition IODEnhUSImageModule::getBurnedInAnnotation(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_BurnedInAnnotation, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getRecognizableVisibleFeatures(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_RecognizableVisualFeatures, *m_Item, value, pos); +} + + +CodeSequenceMacro& IODEnhUSImageModule::getTransducerScanPattern() +{ + return m_TransducerScanPattern; +} + + +CodeSequenceMacro& IODEnhUSImageModule::getTransducerGeometry() +{ + return m_TransducerGeometry; +} + + +OFVector& IODEnhUSImageModule::getTransducerBeamSteering() +{ + return m_TransducerBeamSteering; +} + + +CodeSequenceMacro& IODEnhUSImageModule::getTransducerApplication() +{ + return m_TransducerApplication; +} + + +OFCondition IODEnhUSImageModule::getProcessingFunction(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ProcessingFunction, *m_Item, value, pos); +} + + +OFCondition IODEnhUSImageModule::getMechanicalIndex(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_MechanicalIndex, value, pos); +} + + +OFCondition IODEnhUSImageModule::getBoneThermalIndex(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_BoneThermalIndex, value, pos); +} + + +OFCondition IODEnhUSImageModule::getCranialThermalIndex(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_CranialThermalIndex, value, pos); +} + + +OFCondition IODEnhUSImageModule::getSoftTissueThermalIndex(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_SoftTissueThermalIndex, value, pos); +} + + +OFCondition IODEnhUSImageModule::getDepthsOfFocus(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_DepthsOfFocus, value, pos); +} + + +OFCondition IODEnhUSImageModule::getDepthsOfScanField(Float64& value, + const unsigned long pos) +{ + return m_Item->findAndGetFloat64(DCM_DepthsOfFocus, value, pos); +} + + +// --- set attributes --- + + +OFCondition IODEnhUSImageModule::setImageType(const DcmIODTypes::IOD_ENHUSIMAGETYPE pixelDataChar, + const OFString& imageFlavor, + const OFString& derivedPixelContrast, + const OFBool checkValue) +{ + OFString value; + switch (pixelDataChar) + { + case(DcmIODTypes::IMAGETYPE_ORIGINAL): value = "ORIGINAL\\PRIMARY\\"; break; + case(DcmIODTypes::IMAGETYPE_DERIVED) : value = "DERIVED\\PRIMARY\\"; break; + default: return IOD_EC_InvalidElementValue; + } + value += imageFlavor; + value += "\\"; + value += derivedPixelContrast; + + OFCondition result; + if (checkValue) + { + result = DcmCodeString::checkStringValue(value, "2"); + } + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_ImageType, value); + } + return result; +} + + +OFCondition IODEnhUSImageModule::setRows(const Uint16 value, + const bool checkValue) +{ + if (checkValue && (value == 0)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_Rows, value); +} + + +OFCondition IODEnhUSImageModule::setColumns(const Uint16 value, + const bool checkValue) +{ + if (checkValue && (value == 0)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_Columns, value); +} + + +OFCondition IODEnhUSImageModule::setBitsAllocated(const Uint16 value, + const bool checkValue) +{ + if (checkValue && (value != 8) && (value != 16)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_BitsAllocated, value); +} + + +OFCondition IODEnhUSImageModule::setBitsStored(const Uint16 value, + const bool checkValue) +{ + if (checkValue && (value != 8) && (value != 16)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_BitsStored, value); +} + + +OFCondition IODEnhUSImageModule::setHighBit(const Uint16 value, + const bool checkValue) +{ + if (checkValue && (value != 7) && (value != 15)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_HighBit, value); +} + + +OFCondition IODEnhUSImageModule::setDimensionOrganizationType(const OFString& value, + const bool checkValue) +{ + OFCondition result; + if (checkValue) + { + if ( (value != "3D") && (value != "3D_TEMPORAL") ) + return IOD_EC_InvalidElementValue; + } + return m_Item->putAndInsertOFStringArray(DCM_DimensionOrganizationType, value); +} + + +OFCondition IODEnhUSImageModule::setAcquisitionDateTime(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_AcquisitionDateTime, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setAcquisitionDuration(const Float64 value, + const OFBool) +{ + return m_Item->putAndInsertFloat64(DCM_AcquisitionDuration, value); +} + + +OFCondition IODEnhUSImageModule::setPixelSpacing(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PixelSpacing, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setPositionMeasuringDevice(const OFString& value, + const OFBool checkValue) +{ + OFCondition result; + if (checkValue) + { + result = DcmCodeString::checkStringValue(value, "1"); + if (result.good()) + { + if ( (value != "RIGID") && (value != "FREEHAND") ) + result = IOD_EC_InvalidElementValue; + } + } + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PositionMeasuringDeviceUsed, value); + + return result; +} + + +OFCondition IODEnhUSImageModule::setLossyImageCompression(const OFString& value, + const OFBool checkValue) +{ + if (checkValue) + { + if ( (value != "00") && (value != "01") ) + return IOD_EC_InvalidElementValue; + } + + return m_Item->putAndInsertOFStringArray(DCM_LossyImageCompression, value); +} + + + +OFCondition IODEnhUSImageModule::setLossyImageCompressionMethod(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompressionMethod, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setLossyImageCompressionRatio(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompressionRatio, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setRecognizableVisibleFeatures(const OFString& value, + const OFBool checkValue) +{ + if (checkValue) + { + if ( (value != "NO" ) && (value != "YES") ) + return IOD_EC_InvalidElementValue; + } + return m_Item->putAndInsertOFStringArray(DCM_RecognizableVisualFeatures, value); +} + + +OFCondition IODEnhUSImageModule::setProcessingFunction(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ProcessingFunction, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setMechanicalIndex(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_MechanicalIndex, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setBoneThermalIndex(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_BoneThermalIndex, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setCranialThermalIndex(const OFString& value, + const bool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_CranialThermalIndex, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setSoftTissueThermalIndex(const OFString& value, + const bool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SoftTissueThermalIndex, value); + return result; +} + + +OFCondition IODEnhUSImageModule::setDepthsOfFocus(const Float64 value, + const long unsigned int pos, + const bool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat64(DCM_DepthsOfFocus, value, pos); +} + + +OFCondition IODEnhUSImageModule::setDepthsOfFocus(const OFVector< Float64 >& values, + const bool checkValue) +{ + (void)checkValue; + DcmElement* elem = DcmItem::newDicomElement(DCM_DepthsOfFocus); + if (!elem) + return EC_MemoryExhausted; + + OFCondition result; + OFVector::const_iterator it = values.begin(); + while ((it != values.end()) && result.good()) + { + result = elem->putFloat64(*it); + it++; + } + if (result.bad()) + { + delete elem; + } + else + { + result = m_Item->insert(elem); + } + return result; +} + + +OFCondition IODEnhUSImageModule::setDepthsOfScanField(const OFString& value, + const bool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DepthOfScanField, value); + return result; +} diff --git a/dcmiod/libsrc/modenhusseries.cc b/dcmiod/libsrc/modenhusseries.cc new file mode 100644 index 00000000..932bf440 --- /dev/null +++ b/dcmiod/libsrc/modenhusseries.cc @@ -0,0 +1,120 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Enhanced US Series Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modenhusseries.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODEnhancedUSSeriesModule::m_ModuleName = "EnhancedUSSeries"; + + +IODEnhancedUSSeriesModule::IODEnhancedUSSeriesModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules), + m_ReferencedPerformedProcedureStep(), + m_PerformedProtocolCode() +{ + // reset element rules + resetRules(); +} + + +IODEnhancedUSSeriesModule::IODEnhancedUSSeriesModule() +: IODModule(), + m_ReferencedPerformedProcedureStep(), + m_PerformedProtocolCode() +{ + // reset element rules + resetRules(); +} + + +OFString IODEnhancedUSSeriesModule::getName() const +{ + return m_ModuleName; +} + + +void IODEnhancedUSSeriesModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_Modality, "1","1", getName(), DcmIODTypes::IE_SERIES, "US"), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedPerformedProcedureStepSequence, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_PerformedProtocolCodeSequence, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); +} + + +OFCondition IODEnhancedUSSeriesModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, OFFalse /* data already cleared */); + + DcmIODUtil::readSingleItem(source, DCM_ReferencedPerformedProcedureStepSequence, m_ReferencedPerformedProcedureStep, m_Rules->getByTag(DCM_ReferencedPerformedProcedureStepSequence)); + DcmIODUtil::readSingleItem(source, DCM_PerformedProtocolCodeSequence, m_PerformedProtocolCode, m_Rules->getByTag(DCM_PerformedProtocolCodeSequence)); + + return EC_Normal; +} + + +OFCondition IODEnhancedUSSeriesModule::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + result = IODComponent::write(destination); + DcmIODUtil::writeSingleItem(result, DCM_ReferencedPerformedProcedureStepSequence, m_ReferencedPerformedProcedureStep, destination, m_Rules->getByTag(DCM_ReferencedPerformedProcedureStepSequence)); + DcmIODUtil::writeSingleItem(result, DCM_PerformedProtocolCodeSequence, m_PerformedProtocolCode, destination, m_Rules->getByTag(DCM_PerformedProtocolCodeSequence)); + + return result; +} + + +IODEnhancedUSSeriesModule::~IODEnhancedUSSeriesModule() +{ +} + + +OFCondition IODEnhancedUSSeriesModule::getModality(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Modality, *m_Item, value, pos); +} + + +CodeSequenceMacro& IODEnhancedUSSeriesModule::getPerformedProtocolCode() +{ + return m_PerformedProtocolCode; +} + + +SOPInstanceReferenceMacro& IODEnhancedUSSeriesModule::getReferencedPPS() +{ + return m_ReferencedPerformedProcedureStep; +} + + +OFCondition IODEnhancedUSSeriesModule::getPerformedProtocolType(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PerformedProtocolType, *m_Item, value, pos); +} diff --git a/dcmiod/libsrc/modequipment.cc b/dcmiod/libsrc/modequipment.cc new file mode 100644 index 00000000..eadd5275 --- /dev/null +++ b/dcmiod/libsrc/modequipment.cc @@ -0,0 +1,206 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Equipment Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modequipment.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrst.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmiod/iodutil.h" + +IODGeneralEquipmentModule::IODGeneralEquipmentModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules), + m_ModuleName("GeneralEquipmentModule") +{ + // reset element rules + resetRules(); +} + + +IODGeneralEquipmentModule::IODGeneralEquipmentModule() +: IODModule(), + m_ModuleName("GeneralEquipmentModule") +{ + resetRules(); +} + + +void IODGeneralEquipmentModule::resetRules() +{ + + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_Manufacturer, "1", "2", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_InstitutionName, "1", "3", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_InstitutionAddress, "1", "3", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_StationName, "1", "3", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_InstitutionalDepartmentName, "1", "3", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_ManufacturerModelName, "1", "3", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_DeviceSerialNumber, "1", "3", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_SoftwareVersions, "1-n", "3", getName(), DcmIODTypes::IE_EQUIPMENT), OFTrue); +} + + +IODGeneralEquipmentModule::~IODGeneralEquipmentModule() +{ +} + + +OFString IODGeneralEquipmentModule::getName() const +{ + return m_ModuleName; +} + + +OFCondition IODGeneralEquipmentModule::getDeviceSerialNumber(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DeviceSerialNumber, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::getManufacturer(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Manufacturer, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::getInstitutionName(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_InstitutionName, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::getInstitutionAddress(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_InstitutionAddress, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::getStationName(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StationName, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::getInstitutionalDepartmentName(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StationName, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::getManufacturerModelName(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ManufacturerModelName, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::getSoftwareVersions(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SoftwareVersions, *m_Item, value, pos); +} + + +OFCondition IODGeneralEquipmentModule::setDeviceSerialNumber(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DeviceSerialNumber, value); + return result; +} + + +OFCondition IODGeneralEquipmentModule::setManufacturer(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_Manufacturer, value); + return result; +} + + +OFCondition IODGeneralEquipmentModule::setInstitutionName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_InstitutionName, value); + return result; +} + + +OFCondition IODGeneralEquipmentModule::setInstitutionAddress(const OFString& value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertOFStringArray(DCM_InstitutionAddress, value); +} + + +OFCondition IODGeneralEquipmentModule::setStationName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_StationName, value); + return result; +} + + +OFCondition IODGeneralEquipmentModule::setInstutionalDepartmentName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_InstitutionalDepartmentName, value); + return result; +} + + +OFCondition IODGeneralEquipmentModule::setManufacturerModelName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ManufacturerModelName, value); + return result; + +} + + +OFCondition IODGeneralEquipmentModule::setSoftwareVersions(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SoftwareVersions, value); + return result; +} diff --git a/dcmiod/libsrc/modfloatingpointimagepixel.cc b/dcmiod/libsrc/modfloatingpointimagepixel.cc new file mode 100644 index 00000000..d5e1494e --- /dev/null +++ b/dcmiod/libsrc/modfloatingpointimagepixel.cc @@ -0,0 +1,260 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Floating Point and Double Floating Point Image Pixel Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modfloatingpointimagepixel.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrfl.h" +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODFloatingPointImagePixelModule::m_ModuleName = "FloatingPointImagePixelModule"; +const DcmTagKey IODFloatingPointImagePixelModule::pixel_data_tag = DCM_FloatPixelData; +const DcmTagKey IODDoubleFloatingPointImagePixelModule::pixel_data_tag = DCM_DoubleFloatPixelData; + + +IODFloatingPointImagePixelModule::IODFloatingPointImagePixelModule(OFshared_ptr item, + OFshared_ptr rules) +: IODImagePixelBase(item, rules) +{ + // reset element rules + resetRules(); + getData().putAndInsertUint16(DCM_BitsAllocated, 32); + getData().putAndInsertUint16(DCM_SamplesPerPixel, 1); + getData().putAndInsertUint16(DCM_PixelRepresentation, 1); + getData().putAndInsertOFStringArray(DCM_PhotometricInterpretation, "MONOCHROME2"); +} + + +OFString IODFloatingPointImagePixelModule::getName() const +{ + return m_ModuleName; +} + + +IODFloatingPointImagePixelModule::IODFloatingPointImagePixelModule() +: IODImagePixelBase() +{ + resetRules(); +} + + +IODFloatingPointImagePixelModule::~IODFloatingPointImagePixelModule() +{ + // nothing to do +} + + +void IODFloatingPointImagePixelModule::resetRules() +{ + // Parameters this module is responsible for. + m_Rules->addRule(new IODRule(DCM_SamplesPerPixel, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PhotometricInterpretation, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_Rows, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_Columns, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsAllocated, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PixelAspectRatio, "2", "1C", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_FloatPixelPaddingValue, "1", "3", m_ModuleName, DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_FloatPixelPaddingRangeLimit, "1", "1C", m_ModuleName, DcmIODTypes::IE_IMAGE), OFTrue); +} + + +OFCondition IODFloatingPointImagePixelModule::read(DcmItem& source, + const OFBool clearOldData) +{ + // Read common attributes + IODImagePixelBase::read(source, clearOldData); + // Read extra attributes of Floating Point Image Pixel Module + IODModule::read(source, clearOldData); + return EC_Normal; +} + + +OFCondition IODFloatingPointImagePixelModule::write(DcmItem& destination) +{ + // Write Photometric Interpretation fixed value for Floating Point Image Pixel Module + OFCondition result = m_Item->putAndInsertOFStringArray(DCM_PhotometricInterpretation, "MONOCHROME2"); + // Write common attributes + if (result.good()) + { + result = IODImagePixelBase::write(destination); + } + // Write extra attributes of Floating Poing Image Pixel Module + if (result.good()) + { + result = IODModule::write(destination); + } + return result; +} + + +IODImagePixelBase::DataType IODFloatingPointImagePixelModule::getDataType() const +{ + return IODImagePixelBase::DATA_TYPE_FLOAT; +} + + +OFCondition IODFloatingPointImagePixelModule::getFloatPixelPaddingValue(Float32& value, + const long pos) +{ + return m_Item->findAndGetFloat32(DCM_FloatPixelPaddingValue, value, pos); +} + + +OFCondition IODFloatingPointImagePixelModule::getFloatPixelPaddingRangeLimit(Float32& value, + const long pos) +{ + return m_Item->findAndGetFloat32(DCM_FloatPixelPaddingRangeLimit, value, pos); +} + + +OFCondition IODFloatingPointImagePixelModule::setFloatPixelPaddingValue(const Float32 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat32(DCM_FloatPixelPaddingValue, value); +} + + +OFCondition IODFloatingPointImagePixelModule::setFloatPixelPaddingRangeLimit(const Float32 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat32(DCM_FloatPixelPaddingRangeLimit, value); +} + +// ---------------- Double Floating Point Image Pixel Module ------------------ + +const OFString IODDoubleFloatingPointImagePixelModule::m_ModuleName = "DoubleFloatingPointImagePixelModule"; + + +IODDoubleFloatingPointImagePixelModule::IODDoubleFloatingPointImagePixelModule(OFshared_ptr item, + OFshared_ptr rules) +: IODImagePixelBase(item, rules) +{ + // reset element rules + resetRules(); + + getData().putAndInsertUint16(DCM_BitsAllocated, 64); + getData().putAndInsertUint16(DCM_SamplesPerPixel, 1); + getData().putAndInsertUint16(DCM_PixelRepresentation, 1); + getData().putAndInsertOFStringArray(DCM_PhotometricInterpretation, "MONOCHROME2"); +} + + +OFString IODDoubleFloatingPointImagePixelModule::getName() const +{ + return m_ModuleName; +} + + +IODDoubleFloatingPointImagePixelModule::IODDoubleFloatingPointImagePixelModule() +: IODImagePixelBase() +{ + resetRules(); +} + + +IODDoubleFloatingPointImagePixelModule::~IODDoubleFloatingPointImagePixelModule() +{ + // nothing to do +} + + +void IODDoubleFloatingPointImagePixelModule::resetRules() +{ + // Parameters are tag, VM, type. Overwrite old rules if any. + // Take over responsibility for Photometric Interpretation since we want to write + // "MONOCHROME2" as a fixed value. + m_Rules->addRule(new IODRule(DCM_SamplesPerPixel, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PhotometricInterpretation, "1", "1", getName(), DcmIODTypes::IE_IMAGE, "MONOCHROME2"), OFTrue); + m_Rules->addRule(new IODRule(DCM_Rows, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_Columns, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsAllocated, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PixelAspectRatio, "2", "1C", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DoubleFloatPixelPaddingValue, "1", "3", m_ModuleName, DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DoubleFloatPixelPaddingRangeLimit, "1", "1C", m_ModuleName, DcmIODTypes::IE_IMAGE), OFTrue); +} + + +OFCondition IODDoubleFloatingPointImagePixelModule::read(DcmItem& source, + const OFBool clearOldData) +{ + // Read common attributes + IODImagePixelBase::read(source, clearOldData); + // Read extra attributes of Floating Point Image Pixel Module + IODModule::read(source, clearOldData); + return EC_Normal; +} + + +OFCondition IODDoubleFloatingPointImagePixelModule::write(DcmItem& destination) +{ + // Write Photometric Interpretation fixed value for Floating Point Image Pixel Module + OFCondition result = m_Item->putAndInsertOFStringArray(DCM_PhotometricInterpretation, "MONOCHROME2"); + // Write common attributes + if (result.good()) + { + result = IODImagePixelBase::write(destination); + } + // Write extra attributes of Floating Poing Image Pixel Module + if (result.good()) + { + result = IODModule::write(destination); + } + return result; +} + + +IODImagePixelBase::DataType IODDoubleFloatingPointImagePixelModule::getDataType() const +{ + return IODImagePixelBase::DATA_TYPE_DOUBLE; +} + + +OFCondition IODDoubleFloatingPointImagePixelModule::getDoubleFloatPixelPaddingValue(Float64& value, + const long pos) +{ + return m_Item->findAndGetFloat64(DCM_FloatPixelPaddingValue, value, pos); +} + + +OFCondition IODDoubleFloatingPointImagePixelModule::getDoubleFloatPixelPaddingRangeLimit(Float64& value, + const long pos) +{ + return m_Item->findAndGetFloat64(DCM_DoubleFloatPixelPaddingRangeLimit, value, pos); +} + + +OFCondition IODDoubleFloatingPointImagePixelModule::setDoubleFloatPixelPaddingValue(const Float64 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat64(DCM_DoubleFloatPixelPaddingValue, value); +} + + +OFCondition IODDoubleFloatingPointImagePixelModule::setDoubleFloatPixelPaddingRangeLimit(const Float64 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertFloat64(DCM_DoubleFloatPixelPaddingRangeLimit, value); +} diff --git a/dcmiod/libsrc/modfor.cc b/dcmiod/libsrc/modfor.cc new file mode 100644 index 00000000..3e331666 --- /dev/null +++ b/dcmiod/libsrc/modfor.cc @@ -0,0 +1,119 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Frame of Reference Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modfor.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODFoRModule::m_ModuleName = "FrameOfReferenceModule"; + + +IODFoRModule::IODFoRModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +IODFoRModule::IODFoRModule() +: IODModule() +{ + resetRules(); +} + + +void IODFoRModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_FrameOfReferenceUID, "1","1", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_PositionReferenceIndicator, "1","2", getName(), DcmIODTypes::IE_FOR), OFTrue); +} + + +OFString IODFoRModule::getName() const +{ + return m_ModuleName; +} + + +IODFoRModule::~IODFoRModule() +{ + // Nothing to do +} + + +OFCondition IODFoRModule::getFrameOfReferenceUID(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_FrameOfReferenceUID, *m_Item, value, pos); +} + + +OFCondition IODFoRModule::getPositionReferenceIndicator(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PositionReferenceIndicator, *m_Item, value, pos); +} + + +OFCondition IODFoRModule::setFrameOfReferenceUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_FrameOfReferenceUID, value); + return result; +} + + +OFCondition IODFoRModule::setPositionReferenceIndicator(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PositionReferenceIndicator, value); + return result; +} + + +void IODFoRModule::ensureFrameOfReferenceUID(const OFBool correctInvalid) +{ + OFString uidstr; + + // Create new Frame of Reference instance UID if required + if (getFrameOfReferenceUID(uidstr).bad() || uidstr.empty() ) + { + setFrameOfReferenceUID(DcmIODUtil::createUID(1 /* Series Level */)); + } + else if (!uidstr.empty() && correctInvalid) + { + if (DcmUniqueIdentifier::checkStringValue(uidstr, "1").bad()) + { + setFrameOfReferenceUID(DcmIODUtil::createUID(1 /* Series Level */)); + } + } +} + diff --git a/dcmiod/libsrc/modgeneralimage.cc b/dcmiod/libsrc/modgeneralimage.cc new file mode 100644 index 00000000..3b71561d --- /dev/null +++ b/dcmiod/libsrc/modgeneralimage.cc @@ -0,0 +1,377 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Image Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modgeneralimage.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrlt.h" + + +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODGeneralImageModule::m_ModuleName = "GeneralImageModule"; + + +IODGeneralImageModule::IODGeneralImageModule( OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +IODGeneralImageModule::IODGeneralImageModule() +: IODModule() +{ + resetRules(); +} + + +IODGeneralImageModule::~IODGeneralImageModule() +{ +} + + +void IODGeneralImageModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_InstanceNumber, "1", "2", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientOrientation, "2", "2C", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ContentDate, "1", "2C", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ContentTime, "1", "2C", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ImageType, "2-n", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_AcquisitionNumber, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_AcquisitionDate, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_AcquisitionTime, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_AcquisitionDateTime, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ImageComments, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BurnedInAnnotation, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_RecognizableVisualFeatures, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompression, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompressionRatio, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompressionMethod, "1-n", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PresentationLUTShape, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_IrradiationEventUID, "1-n", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); +} + + +OFString IODGeneralImageModule::getName() const +{ + return "GeneralImageModule"; +} + + + +OFCondition IODGeneralImageModule::getInstanceNumber(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_InstanceNumber, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getPatientOrientation(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientOrientation, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getContentDate(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ContentDate, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getContentTime(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ContentTime, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getImageType(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ImageType, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getAcquisitionNumber(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_AcquisitionNumber, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getAcquisitionDate(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_AcquisitionDate, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getAcquisitionTime(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_AcquisitionTime, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getAcquisitionDateTime(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_AcquisitionDateTime, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getImageComments(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ImageComments, *m_Item, value, pos); +} + +OFCondition IODGeneralImageModule::getBurnedInAnnotation(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_BurnedInAnnotation, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getRecognizableVisualFeatures(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_RecognizableVisualFeatures, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getLossyImageCompression(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompression, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getLossyImageCompressionRatio(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompressionRatio, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getLossyImageCompressionMethod(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompressionMethod, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getPresentationLUTShape(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_PresentationLUTShape, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::getIrradiationEventUID(OFString &value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_IrradiationEventUID, *m_Item, value, pos); +} + + +OFCondition IODGeneralImageModule::setInstanceNumber(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_InstanceNumber, value); + return result; +} + + +OFCondition IODGeneralImageModule::setPatientOrientation(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientOrientation, value); + return result; +} + + +OFCondition IODGeneralImageModule::setContentDate(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ContentDate, value); + return result; +} + + +OFCondition IODGeneralImageModule::setContentTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ContentTime, value); + return result; +} + + +OFCondition IODGeneralImageModule::setImageType(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "2-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ImageType, value); + return result; +} + + +OFCondition IODGeneralImageModule::setAcquisitionNumber(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_AcquisitionNumber, value); + return result; +} + + +OFCondition IODGeneralImageModule::setAcquisitionDate(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_AcquisitionDate, value); + return result; +} + + +OFCondition IODGeneralImageModule::setAcquisitionTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_AcquisitionTime, value); + return result; +} + + +OFCondition IODGeneralImageModule::setAcquisitionDateTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_AcquisitionDateTime, value); + return result; +} + + +OFCondition IODGeneralImageModule::setImageComments(const OFString &value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertOFStringArray(DCM_ImageComments, value); +} + + +OFCondition IODGeneralImageModule::setBurnedInAnnotation(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_BurnedInAnnotation, value); + return result; +} + + + +OFCondition IODGeneralImageModule::setRecognizableVisualFeatures(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_RecognizableVisualFeatures, value); + return result; +} + + + +OFCondition IODGeneralImageModule::setLossyImageCompression(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompression, value); + return result; +} + + + +OFCondition IODGeneralImageModule::setLossyImageCompressionRatio(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompressionRatio, value); + return result; +} + + +OFCondition IODGeneralImageModule::setLossyImageCompressionMethod(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompressionMethod, value); + return result; +} + + +OFCondition IODGeneralImageModule::setPresentationLUTShape(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PresentationLUTShape, value); + return result; +} + + +OFCondition IODGeneralImageModule::setIrradiationEventUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_IrradiationEventUID, value); + return result; +} diff --git a/dcmiod/libsrc/modgeneralseries.cc b/dcmiod/libsrc/modgeneralseries.cc new file mode 100644 index 00000000..8849fd19 --- /dev/null +++ b/dcmiod/libsrc/modgeneralseries.cc @@ -0,0 +1,351 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Series Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modgeneralseries.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrpn.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODGeneralSeriesModule::m_ModuleName = "GeneralSeriesModule"; + + +IODGeneralSeriesModule::IODGeneralSeriesModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules), + m_ReferencedPPS() +{ + // reset element rules + resetRules(); +} + + +IODGeneralSeriesModule::IODGeneralSeriesModule() +: IODModule(), + m_ReferencedPPS() +{ + resetRules(); +} + + +OFString IODGeneralSeriesModule::getName() const +{ + return m_ModuleName; +} + + +void IODGeneralSeriesModule::inventMissing() +{ + // Series Instance UID + ensureInstanceUID(); + + // Default handler + IODComponent::inventMissing(); +} + + +void IODGeneralSeriesModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_Modality, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_SeriesInstanceUID, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_SeriesNumber, "1","2", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_Laterality, "1","2C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_SeriesDate, "1","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_SeriesTime, "1","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_PerformingPhysicianName, "1","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ProtocolName, "1","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_SeriesDescription, "1","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_OperatorsName, "1-n","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_BodyPartExamined, "1","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientPosition, "1","2C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedPerformedProcedureStepSequence, "1","3", getName(), DcmIODTypes::IE_SERIES), OFTrue); +} + + +OFCondition IODGeneralSeriesModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, OFFalse /* data already cleared */); + DcmIODUtil::readSingleItem(source, DCM_ReferencedPerformedProcedureStepSequence, m_ReferencedPPS, m_Rules->getByTag(DCM_ReferencedPerformedProcedureStepSequence)); + + return EC_Normal; +} + + +OFCondition IODGeneralSeriesModule::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + result = IODComponent::write(destination); + DcmIODUtil::writeSingleItem(result, DCM_ReferencedPerformedProcedureStepSequence, m_ReferencedPPS, destination, m_Rules->getByTag(DCM_ReferencedPerformedProcedureStepSequence)); + + return result; +} + + +void IODGeneralSeriesModule::ensureInstanceUID(const OFBool correctInvalid) +{ + OFString uidstr; + + /* create new sop instance UID if required */ + if (getSeriesInstanceUID(uidstr).bad() || uidstr.empty() ) + { + setSeriesInstanceUID(DcmIODUtil::createUID(1 /* Series Level */)); + } + else if (!uidstr.empty() && correctInvalid) + { + if (DcmUniqueIdentifier::checkStringValue(uidstr, "1").bad()) + { + setSeriesInstanceUID(DcmIODUtil::createUID(1 /* Series Level */)); } + } +} + + +IODGeneralSeriesModule::~IODGeneralSeriesModule() +{ +} + + +OFCondition IODGeneralSeriesModule::getModality(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Modality, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getSeriesInstanceUID(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesInstanceUID, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getSeriesNumber(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesNumber, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getLaterality(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Laterality, *m_Item, value, pos); +} + + + +OFCondition IODGeneralSeriesModule::getSeriesDate(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesDate, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getSeriesTime(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesTime, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getPerformingPhysicianName(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PerformingPhysicianName, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getProtocolName(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ProtocolName, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getSeriesDescription(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesDescription, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getOperatorsName(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_OperatorsName, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getBodyPartExamined(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_BodyPartExamined, *m_Item, value, pos); +} + + +OFCondition IODGeneralSeriesModule::getPatientPosition(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientPosition, *m_Item, value, pos); +} + + +SOPInstanceReferenceMacro& IODGeneralSeriesModule::getReferencedPPS() +{ + return m_ReferencedPPS; +} + + +OFCondition IODGeneralSeriesModule::setModality(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_Modality, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setSeriesInstanceUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesInstanceUID, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setSeriesNumber(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesNumber, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setLaterality(const DcmIODTypes::IOD_LATERALITY laterality, + const OFBool checkValue) +{ + (void)checkValue; + OFCondition result; + switch(laterality) + { + case DcmIODTypes::LATERALITY_L: result = m_Item->putAndInsertOFStringArray(DCM_Laterality, "L"); break; + case DcmIODTypes::LATERALITY_R: result = m_Item->putAndInsertOFStringArray(DCM_Laterality, "R"); break; + case DcmIODTypes::LATERALITY_UNDEFINED: + default: result = IOD_EC_InvalidLaterality; + } + return result; +} + + +OFCondition IODGeneralSeriesModule::setSeriesDate(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesDate, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setSeriesTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesTime, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setPerformingPhysicianName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PerformingPhysicianName, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setProtocolName(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ProtocolName, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setSeriesDescription(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesDescription, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setOperatorsName(const OFString& value, const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_OperatorsName, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setBodyPartExamined(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_BodyPartExamined, value); + return result; +} + + +OFCondition IODGeneralSeriesModule::setPatientPosition(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientPosition, value); + return result; +} diff --git a/dcmiod/libsrc/modgeneralstudy.cc b/dcmiod/libsrc/modgeneralstudy.cc new file mode 100644 index 00000000..e5102b4d --- /dev/null +++ b/dcmiod/libsrc/modgeneralstudy.cc @@ -0,0 +1,297 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the General Study Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modgeneralstudy.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcvrpn.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODGeneralStudyModule::m_ModuleName = "GeneralStudyModule"; + + +IODGeneralStudyModule::IODGeneralStudyModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules), + m_IssuerOfAccessionNumberSequence(), + m_ProcedureCodeSequence(), + m_ReasonForPerformedProcedureCodeSequence() +{ + // reset element rules + resetRules(); +} + + +IODGeneralStudyModule::IODGeneralStudyModule() +: IODModule(), + m_IssuerOfAccessionNumberSequence(), + m_ProcedureCodeSequence(), + m_ReasonForPerformedProcedureCodeSequence() +{ + resetRules(); +} + + +void IODGeneralStudyModule::inventMissing() +{ + // Study Instance UID + ensureInstanceUID(); + + IODComponent::inventMissing(); +} + + +void IODGeneralStudyModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_StudyInstanceUID, "1","1", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_StudyDate, "1","2", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_StudyTime, "1","2", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferringPhysicianName, "1","2", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_StudyID, "1","2", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_AccessionNumber, "1","2", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_StudyDescription, "1","3", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_IssuerOfAccessionNumberSequence, "1","3", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_ProcedureCodeSequence, "1-n","3", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReasonForPerformedProcedureCodeSequence, "1-n","3", getName(), DcmIODTypes::IE_STUDY), OFTrue); +} + + +OFString IODGeneralStudyModule::getName() const +{ + return m_ModuleName; +} + + +void IODGeneralStudyModule::clearData() +{ + m_IssuerOfAccessionNumberSequence.clearData(); + DcmIODUtil::freeContainer(m_ProcedureCodeSequence); + DcmIODUtil::freeContainer(m_ReasonForPerformedProcedureCodeSequence); +} + + +OFCondition IODGeneralStudyModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + { + clearData(); + } + + IODComponent::read(source, OFFalse /* data already cleared above */); + + DcmIODUtil::readSingleItem(source, DCM_IssuerOfAccessionNumberSequence, m_IssuerOfAccessionNumberSequence, m_Rules->getByTag(DCM_IssuerOfAccessionNumberSequence)); + DcmIODUtil::readSubSequence(source, DCM_ProcedureCodeSequence, m_ProcedureCodeSequence, m_Rules->getByTag(DCM_ProcedureCodeSequence)); + DcmIODUtil::readSubSequence(source, DCM_ReasonForPerformedProcedureCodeSequence, m_ReasonForPerformedProcedureCodeSequence, m_Rules->getByTag(DCM_ReasonForPerformedProcedureCodeSequence)); + + return EC_Normal; +} + + +OFCondition IODGeneralStudyModule::write(DcmItem& destination) +{ + OFCondition result; + DcmIODUtil::writeSingleItem(result, DCM_IssuerOfAccessionNumberSequence, m_IssuerOfAccessionNumberSequence, *m_Item, m_Rules->getByTag(DCM_IssuerOfAccessionNumberSequence)); + DcmIODUtil::writeSubSequence(result, DCM_ProcedureCodeSequence, m_ProcedureCodeSequence, *m_Item, m_Rules->getByTag(DCM_ProcedureCodeSequence)); + DcmIODUtil::writeSubSequence(result, DCM_ReasonForPerformedProcedureCodeSequence, m_ReasonForPerformedProcedureCodeSequence, *m_Item, m_Rules->getByTag(DCM_ReasonForPerformedProcedureCodeSequence)); + + if (result.good()) result = IODComponent::write(destination); + + return result; +} + + + + +IODGeneralStudyModule::~IODGeneralStudyModule() +{ + DcmIODUtil::freeContainer(m_ProcedureCodeSequence); + DcmIODUtil::freeContainer(m_ReasonForPerformedProcedureCodeSequence); +} + + +void IODGeneralStudyModule::ensureInstanceUID(const OFBool correctInvalid) +{ + OFString uidstr; + + /* create new sop instance UID if required */ + if (getStudyInstanceUID(uidstr).bad() || uidstr.empty() ) + { + setStudyInstanceUID(DcmIODUtil::createUID(2 /* Study Level */)); + } + else if (!uidstr.empty() && correctInvalid) + { + if (DcmUniqueIdentifier::checkStringValue(uidstr, "1").bad()) + { + setStudyInstanceUID(DcmIODUtil::createUID(2 /* Study Level */)); + } + } +} + + +// --- get attributes (C++ string) --- + +OFCondition IODGeneralStudyModule::getStudyInstanceUID(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StudyInstanceUID, *m_Item, value, pos); +} + + +OFCondition IODGeneralStudyModule::getReferringPhysicianName(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ReferringPhysicianName, *m_Item, value, pos); +} + + +OFCondition IODGeneralStudyModule::getStudyDescription(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StudyDescription, *m_Item, value, pos); +} + + +OFCondition IODGeneralStudyModule::getStudyDate(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StudyDate, *m_Item, value, pos); + +} + + +OFCondition IODGeneralStudyModule::getStudyTime(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StudyTime, *m_Item, value, pos); +} + + +OFCondition IODGeneralStudyModule::getStudyID(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_StudyID, *m_Item, value, pos); +} + + +OFCondition IODGeneralStudyModule::getAccessionNumber(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_AccessionNumber, *m_Item, value, pos); +} + + +HL7HierarchicDesignatorMacro& IODGeneralStudyModule::getIssuerOfAccesionNumber() +{ + return m_IssuerOfAccessionNumberSequence; +} + + +OFVector< CodeSequenceMacro* >& IODGeneralStudyModule::getProcedureCodeSequence() +{ + return m_ProcedureCodeSequence; +} + + +OFVector< CodeSequenceMacro* >& IODGeneralStudyModule::getReasonForPerformedProcedureCodeSequence() +{ + return m_ReasonForPerformedProcedureCodeSequence; +} + + +// --- set attributes --- + +OFCondition IODGeneralStudyModule::setReferringPhysicianName(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ReferringPhysicianName,value); + return result; +} + + +OFCondition IODGeneralStudyModule::setStudyDescription(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_StudyDescription,value); + return result; +} + + +OFCondition IODGeneralStudyModule::setStudyInstanceUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_StudyInstanceUID,value); + return result; +} + + +OFCondition IODGeneralStudyModule::setStudyDate(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_StudyDate, value); + return result; +} + + +OFCondition IODGeneralStudyModule::setStudyTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_StudyTime,value); + return result; +} + + +OFCondition IODGeneralStudyModule::setStudyID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_StudyID, value); + return result; +} + + +OFCondition IODGeneralStudyModule::setAccessionNumber(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_AccessionNumber, value); + return result; +} + diff --git a/dcmiod/libsrc/modhelp.cc b/dcmiod/libsrc/modhelp.cc new file mode 100644 index 00000000..44ee4231 --- /dev/null +++ b/dcmiod/libsrc/modhelp.cc @@ -0,0 +1,345 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Helper functions for copying common modules between datasets + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modhelp.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +// List of tags within the Patient Module +const DcmTagKey DcmModuleHelpers::patientModuleTags[] = +{ + DCM_PatientName, + DCM_PatientID, + // Macro IssuerOfPatientIDMacro + DCM_IssuerOfPatientID, + DCM_IssuerOfPatientIDQualifiersSequence, + // EndMacro IssuerOfPatientIDMacro + DCM_PatientBirthDate, + DCM_PatientSex, + DCM_QualityControlSubject, + DCM_ReferencedPatientSequence, + DCM_PatientBirthTime, + DCM_RETIRED_OtherPatientIDs, + DCM_OtherPatientIDsSequence, + DCM_OtherPatientNames, + DCM_EthnicGroup, + DCM_PatientComments, + DCM_PatientSpeciesDescription, + DCM_PatientSpeciesCodeSequence, + DCM_PatientBreedDescription, + DCM_PatientBreedCodeSequence, + DCM_BreedRegistrationSequence, + DCM_ResponsiblePerson, + DCM_ResponsiblePersonRole, + DCM_ResponsibleOrganization, + DCM_PatientIdentityRemoved, + DCM_DeidentificationMethod, + DCM_DeidentificationMethodCodeSequence +}; + +// List of tags within the Clinical Trial Subject Module +const DcmTagKey DcmModuleHelpers::clinicalTrialSubjectModuleTags[] = +{ + DCM_ClinicalTrialSponsorName, + DCM_ClinicalTrialProtocolID, + DCM_ClinicalTrialProtocolName, + DCM_ClinicalTrialSiteID, + DCM_ClinicalTrialSiteName, + DCM_ClinicalTrialSubjectID, + DCM_ClinicalTrialSubjectReadingID, + DCM_ClinicalTrialProtocolEthicsCommitteeName, + DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber +}; + +// List of tags within the General Study Module +const DcmTagKey DcmModuleHelpers::generalStudyModuleTags[] = +{ + DCM_StudyInstanceUID, + DCM_StudyDate, + DCM_StudyTime, + DCM_ReferringPhysicianName, + DCM_ReferringPhysicianIdentificationSequence, + DCM_StudyID, + DCM_AccessionNumber, + DCM_IssuerOfAccessionNumberSequence, + DCM_StudyDescription, + DCM_PhysiciansOfRecord, + DCM_PhysiciansOfRecordIdentificationSequence, + DCM_NameOfPhysiciansReadingStudy, + DCM_PhysiciansReadingStudyIdentificationSequence, + DCM_RequestingServiceCodeSequence, + DCM_ReferencedStudySequence, + DCM_ProcedureCodeSequence, + DCM_ReasonForPerformedProcedureCodeSequence +}; + +// List of tags within the Patient Study Module +const DcmTagKey DcmModuleHelpers::patientStudyModuleTags[] = +{ + DCM_AdmittingDiagnosesDescription, + DCM_AdmittingDiagnosesCodeSequence, + DCM_PatientAge, + DCM_PatientSize, + DCM_PatientWeight, + DCM_PatientSizeCodeSequence, + DCM_Occupation, + DCM_AdditionalPatientHistory, + DCM_AdmissionID, + DCM_IssuerOfAdmissionIDSequence, + DCM_ServiceEpisodeID, + DCM_IssuerOfServiceEpisodeIDSequence, + DCM_ServiceEpisodeDescription, + DCM_PatientSexNeutered +}; + +// List of tags within the Clinical Trial Study Module +const DcmTagKey DcmModuleHelpers::clinicalTrialStudyModuleTags[] = +{ + DCM_ClinicalTrialTimePointID, + DCM_ClinicalTrialTimePointDescription, + DCM_ConsentForClinicalTrialUseSequence +}; + +// List of tags within the General Series Module +const DcmTagKey DcmModuleHelpers::generalSeriesModuleTags[] = +{ + DCM_Modality, + DCM_SeriesInstanceUID, + DCM_SeriesNumber, + DCM_Laterality, + DCM_SeriesDate, + DCM_SeriesTime, + DCM_PerformingPhysicianName, + DCM_PerformingPhysicianIdentificationSequence, + DCM_ProtocolName, + DCM_SeriesDescription, + DCM_SeriesDescriptionCodeSequence, + DCM_OperatorsName, + DCM_OperatorIdentificationSequence, + DCM_ReferencedPerformedProcedureStepSequence, + DCM_RelatedSeriesSequence, + DCM_BodyPartExamined, + DCM_PatientPosition, + DCM_SmallestPixelValueInSeries, + DCM_LargestPixelValueInSeries, + DCM_RequestAttributesSequence, + // Macro PerformedProcedureStepSummaryMacro + DCM_PerformedProcedureStepID, + DCM_PerformedProcedureStepStartDate, + DCM_PerformedProcedureStepStartTime, + DCM_PerformedProcedureStepEndDate, + DCM_PerformedProcedureStepEndTime, + DCM_PerformedProcedureStepDescription, + DCM_PerformedProtocolCodeSequence, + DCM_CommentsOnThePerformedProcedureStep, + // EndMacro PerformedProcedureStepSummaryMacro + DCM_AnatomicalOrientationType +}; + +// List of tags within the Clinical Trial Series Module +const DcmTagKey DcmModuleHelpers::clinicalTrialSeriesModuleTags[] = +{ + DCM_ClinicalTrialCoordinatingCenterName, + DCM_ClinicalTrialSeriesID, + DCM_ClinicalTrialSeriesDescription +}; + +// List of tags within the General Equipment Module +const DcmTagKey DcmModuleHelpers::generalEquipmentModuleTags[] = +{ + DCM_Manufacturer, + DCM_InstitutionName, + DCM_InstitutionAddress, + DCM_StationName, + DCM_InstitutionalDepartmentName, + DCM_ManufacturerModelName, + DCM_DeviceSerialNumber, + DCM_SoftwareVersions, + DCM_GantryID, + DCM_SpatialResolution, + DCM_DateOfLastCalibration, + DCM_TimeOfLastCalibration, + DCM_PixelPaddingValue +}; + +// List of tags within the Frame of Reference Module +const DcmTagKey DcmModuleHelpers::frameOfReferenceModuleTags[] = +{ + DCM_FrameOfReferenceUID, + DCM_PositionReferenceIndicator +}; + +// List of tags within the SOP Common Module, excluding Digital Signatures Macro +const DcmTagKey DcmModuleHelpers::sopCommonModuleTags[] = +{ + DCM_SOPClassUID, + DCM_SOPInstanceUID, + DCM_SpecificCharacterSet, + DCM_InstanceCreationDate, + DCM_InstanceCreationTime, + DCM_InstanceCoercionDateTime, + DCM_InstanceCreatorUID, + DCM_RelatedGeneralSOPClassUID, + DCM_OriginalSpecializedSOPClassUID, + DCM_CodingSchemeIdentificationSequence, + DCM_TimezoneOffsetFromUTC, + DCM_ContributingEquipmentSequence, + DCM_InstanceNumber, + DCM_SOPInstanceStatus, + DCM_SOPAuthorizationDateTime, + DCM_SOPAuthorizationComment, + DCM_AuthorizationEquipmentCertificationNumber, + // Macro DigitalSignaturesMacro + //DCM_MACParametersSequence, + //DCM_DigitalSignaturesSequence, + // EndMacro DigitalSignaturesMacro + DCM_EncryptedAttributesSequence, + DCM_OriginalAttributesSequence, + DCM_HL7StructuredDocumentReferenceSequence, + DCM_LongitudinalTemporalInformationModified, + DCM_QueryRetrieveView, + DCM_ConversionSourceAttributesSequence +}; + +// List of tags within the General Image Module +const DcmTagKey DcmModuleHelpers::generalImageModuleTags[] = +{ + DCM_InstanceNumber, + DCM_PatientOrientation, + DCM_ContentDate, + DCM_ContentTime, + DCM_ImageType, + DCM_AcquisitionNumber, + DCM_AcquisitionDate, + DCM_AcquisitionTime, + DCM_AcquisitionDateTime, + DCM_ReferencedImageSequence, + DCM_DerivationDescription, + DCM_DerivationCodeSequence, + DCM_SourceImageSequence, + DCM_ReferencedInstanceSequence, + DCM_ImagesInAcquisition, + DCM_ImageComments, + DCM_QualityControlImage, + DCM_BurnedInAnnotation, + DCM_RecognizableVisualFeatures, + DCM_LossyImageCompression, + DCM_LossyImageCompressionRatio, + DCM_LossyImageCompressionMethod, + DCM_IconImageSequence, + DCM_PresentationLUTShape, + DCM_IrradiationEventUID, + DCM_RealWorldValueMappingSequence +}; + + +void DcmModuleHelpers::copyElement(const DcmTagKey& tag, DcmItem& src, DcmItem& dest) +{ + DcmElement *delem; + OFCondition cond; + // get (deep) copy of element + cond = src.findAndGetElement(tag, delem, OFFalse /*searchIntoSub*/, OFTrue /*createCopy*/); + if (cond.good()) + { + // and insert into destination item + cond = dest.insert(delem, OFTrue); + if (cond.bad()) + { + // we do not expect any errors here, so report it + DCMDATA_ERROR("Could not insert element with tag " << tag << " into item: " << cond.text()); + } + } +} + +template +inline void DcmModuleHelpers::copyModule( const DcmTagKey (&tags)[N], DcmItem& src, DcmItem& dest ) +{ + for (const DcmTagKey* it = tags, * const end = tags + N; it != end; ++it) + DcmModuleHelpers::copyElement(*it, src, dest); +} + + +void DcmModuleHelpers::copyPatientModule(DcmItem& src, DcmItem& dest) +{ + copyModule(patientModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyClinicalTrialSubjectModule(DcmItem& src, DcmItem& dest) +{ + copyModule(clinicalTrialSubjectModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyGeneralStudyModule(DcmItem& src, DcmItem& dest) +{ + copyModule(generalStudyModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyPatientStudyModule(DcmItem& src, DcmItem& dest) +{ + copyModule(patientStudyModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyClinicalTrialStudyModule(DcmItem& src, DcmItem& dest) +{ + copyModule(clinicalTrialStudyModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyGeneralSeriesModule(DcmItem& src, DcmItem& dest) +{ + copyModule(generalSeriesModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyClinicalTrialSeriesModule(DcmItem& src, DcmItem& dest) +{ + copyModule(clinicalTrialSeriesModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyGeneralEquipmentModule(DcmItem& src, DcmItem& dest) +{ + copyModule(generalEquipmentModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyFrameOfReferenceModule(DcmItem& src, DcmItem& dest) +{ + copyModule(frameOfReferenceModuleTags, src, dest); +} + + +void DcmModuleHelpers::copySOPCommonModule(DcmItem& src, DcmItem& dest) +{ + copyModule(sopCommonModuleTags, src, dest); +} + + +void DcmModuleHelpers::copyGeneralImageModule(DcmItem& src, DcmItem& dest) +{ + copyModule(generalImageModuleTags, src, dest); +} diff --git a/dcmiod/libsrc/modimagepixel.cc b/dcmiod/libsrc/modimagepixel.cc new file mode 100644 index 00000000..8d0b7b20 --- /dev/null +++ b/dcmiod/libsrc/modimagepixel.cc @@ -0,0 +1,264 @@ +/* + * + * Copyright (C) 2016-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Image Pixel Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modimagepixel.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmiod/iodutil.h" + +template +const OFString IODImagePixelModule::m_ModuleName = "ImagePixelModule"; +template +const DcmTagKey IODImagePixelModule::pixel_data_tag = DCM_PixelData; + +template +IODImagePixelModule::IODImagePixelModule(OFshared_ptr item, + OFshared_ptr rules) +: IODImagePixelBase(item, rules) +{ + // reset element rules + resetRules(); +} + +template +OFString IODImagePixelModule::getName() const +{ + return m_ModuleName; +} + +template +IODImagePixelModule::IODImagePixelModule() +: IODImagePixelBase() +{ + resetRules(); +} + +template +IODImagePixelModule::~IODImagePixelModule() +{ +} + +template +void IODImagePixelModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_SamplesPerPixel, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PhotometricInterpretation, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_Rows, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_Columns, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsAllocated, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsStored, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_HighBit, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PixelRepresentation, "1", "1", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PlanarConfiguration, "1", "1C", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_PixelAspectRatio, "2", "1C", getName(), DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ICCProfile, "1", "3", getName(), DcmIODTypes::IE_IMAGE), OFTrue); +} + +template +OFCondition IODImagePixelModule::read(DcmItem& source, + const OFBool clearOldData) +{ + // Read common attributes + IODImagePixelBase::read(source, clearOldData); + // Read extra attributes of Image Pixel Module + IODModule::read(source, clearOldData); + return EC_Normal; +} + +template +OFCondition IODImagePixelModule::write(DcmItem& destination) +{ + // Write common attributes + OFCondition result = IODImagePixelBase::write(destination); + // Write extra attributes of Image Pixel Module + if (result.good()) + { + IODModule::write(destination); + } + return result; +} + +template +IODImagePixelBase::DataType IODImagePixelModule::getDataType() const +{ + return IODImagePixelBase::DATA_TYPE_INTEGER; +} + +template +OFCondition IODImagePixelModule::getBitsStored(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_BitsStored, value, pos); +} + +template +OFCondition IODImagePixelModule::getHighBit(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_HighBit, value, pos); +} + +template +OFCondition IODImagePixelModule::getPixelRepresentation(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_PixelRepresentation, value, pos); +} + +template +OFCondition IODImagePixelModule::getPlanarConfiguration(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_PlanarConfiguration, value, pos); +} + +template +OFCondition IODImagePixelModule::getICCProfile(OFVector& values) +{ + DcmElement* elem = NULL; + OFCondition result = m_Item->findAndGetElement(DCM_ICCProfile, elem); + if (result.good()) + { + DcmOtherByteOtherWord* ob = OFstatic_cast(DcmOtherByteOtherWord*, elem); + if (ob) + return DcmIODUtil::copyFromUint8Array > (ob, values); + else + return EC_InternalError; + } + else + return EC_TagNotFound; +} + +template +OFCondition IODImagePixelModule::setSamplesPerPixel(const Uint16 value, + const OFBool checkValue) +{ + OFCondition result = EC_Normal; + + // only values 1, 3 and 4 (retired) are permitted + if (checkValue) + { + if ( (value == 0) || (value == 2) || (value > 4) ) + { + DCMIOD_ERROR("Value " << value << " not permitted for attribute Samples Per Pixel"); + result = EC_InvalidValue; + } + else if (value == 4) + { + DCMIOD_WARN("Value " << value << " is retired for attribute Samples Per Pixel"); + } + } + + if (result.good() ) + result = m_Item->putAndInsertUint16(DCM_SamplesPerPixel, value); + + return result; +} + +template +OFCondition IODImagePixelModule::setPhotometricInterpretation(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PhotometricInterpretation, value); + return result; +} + +template +OFCondition IODImagePixelModule::setBitsAllocated(const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertUint16(DCM_BitsAllocated, value); +} + +template +OFCondition IODImagePixelModule::setBitsStored(const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertUint16(DCM_BitsStored, value); +} + +template +OFCondition IODImagePixelModule::setHighBit(const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertUint16(DCM_HighBit, value); +} + +template +OFCondition IODImagePixelModule::setPixelRepresentation(const Uint16 value, + const OFBool checkValue) +{ + OFCondition result = EC_Normal; + if (checkValue) + { + if ( (value != 0) && (value != 1) ) + { + DCMIOD_ERROR("Value " << value << " not permitted for attribute Pixel Representation"); + result = EC_InvalidValue; + } + } + if ( result.good() ) + { + result = m_Item->putAndInsertUint16(DCM_PixelRepresentation, value); + } + return result; +} + +template +OFCondition IODImagePixelModule::setPlanarConfiguration(const Uint16 value, + const OFBool checkValue) +{ + OFCondition result = EC_Normal; + if (checkValue) + { + if ( (value != 0) && (value != 1) ) + { + DCMIOD_ERROR("Value " << value << " not permitted for attribute Planar Configuration"); + result = EC_InvalidValue; + } + } + if ( result.good() ) + { + result = m_Item->putAndInsertUint16(DCM_PlanarConfiguration, value); + } + return result; +} + +template +OFCondition IODImagePixelModule::setICCProfile(const Uint8* values, + const size_t length) +{ + return m_Item->putAndInsertUint8Array(DCM_ICCProfile, values, OFstatic_cast(unsigned long, length)); +} + +template class IODImagePixelModule; +template class IODImagePixelModule; +template class IODImagePixelModule; +template class IODImagePixelModule; diff --git a/dcmiod/libsrc/modimagepixelbase.cc b/dcmiod/libsrc/modimagepixelbase.cc new file mode 100644 index 00000000..f35725e5 --- /dev/null +++ b/dcmiod/libsrc/modimagepixelbase.cc @@ -0,0 +1,138 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Base class for Image Pixel Module and related (e.g. Ploating Point) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modimagepixelbase.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODImagePixelBase::m_ModuleName = "ImagePixelBase"; + + +IODImagePixelBase::IODImagePixelBase(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +OFString IODImagePixelBase::getName() const +{ + return m_ModuleName; +} + + +IODImagePixelBase::IODImagePixelBase() +: IODModule() +{ + resetRules(); +} + + +IODImagePixelBase::~IODImagePixelBase() +{ +} + + +void IODImagePixelBase::resetRules() +{ + // all rules in sub classes +} + + +OFCondition IODImagePixelBase::getSamplesPerPixel(Uint16 &value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_SamplesPerPixel, value, pos); +} + + +OFCondition IODImagePixelBase::getPhotometricInterpretation(OFString&value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_PhotometricInterpretation, *m_Item, value, pos); +} + + +OFCondition IODImagePixelBase::getRows(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_Rows, value, pos); +} + + +OFCondition IODImagePixelBase::getColumns(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_Columns, value, pos); +} + + +OFCondition IODImagePixelBase::getBitsAllocated(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_BitsAllocated, value, pos); +} + + +OFCondition IODImagePixelBase::getPixelAspectRatio(Uint16& value, + const signed long pos) +{ + return m_Item->findAndGetUint16(DCM_PixelAspectRatio, value, pos); +} + + +OFCondition IODImagePixelBase::setRows(const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertUint16(DCM_Rows, value); +} + + +OFCondition IODImagePixelBase::setColumns(const Uint16 value, + const OFBool checkValue) +{ + (void)checkValue; + return m_Item->putAndInsertUint16(DCM_Columns, value); +} + + +OFCondition IODImagePixelBase::setPixelAspectRatio(const OFString& verticalPixelSize, + const OFString& horizontalPixelSize, + const OFBool checkValue) +{ + OFString concat = verticalPixelSize; + concat += "\\"; concat += horizontalPixelSize; + OFCondition cond; + if (checkValue) + { + cond = DcmIntegerString::checkStringValue(concat, "2"); + // check for unsignedness, too? + } + if (cond.good()) m_Item->putAndInsertOFStringArray(DCM_PixelAspectRatio, concat); + return cond; +} diff --git a/dcmiod/libsrc/modmultiframedimension.cc b/dcmiod/libsrc/modmultiframedimension.cc new file mode 100644 index 00000000..906cafcd --- /dev/null +++ b/dcmiod/libsrc/modmultiframedimension.cc @@ -0,0 +1,649 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Multi-frame Functional Groups Module + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modmultiframedimension.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcpath.h" // for private tag reservation checking +#include "dcmtk/dcmiod/iodutil.h" // for static helpers + +const OFString IODMultiframeDimensionModule::m_ModuleName = "MultiframeDimensionModule"; + + +IODMultiframeDimensionModule::IODMultiframeDimensionModule(OFshared_ptr data, + OFshared_ptr rules) : + IODModule(data, rules), + m_DimensionIndexSequence(), + m_DimensionOrganizationSequence() +{ + // reset element rules + resetRules(); +} + + +IODMultiframeDimensionModule::IODMultiframeDimensionModule() +: IODModule(), + m_DimensionIndexSequence(), + m_DimensionOrganizationSequence() +{ + resetRules(); +} + + +OFCondition IODMultiframeDimensionModule::addDimensionIndex(const DcmTagKey& dimensionIndexPointer, + const OFString& dimensionOrganizationUID, + const DcmTagKey& functionalGroupPointer, + const OFString& dimensionDescriptionLabel, + const OFString& dimensionIndexPrivateCreator, + const OFString& functionalGroupPrivateCreator) +{ + if ( (dimensionIndexPointer.isPrivate() && dimensionIndexPrivateCreator.empty()) || + (functionalGroupPointer.isPrivate() && functionalGroupPrivateCreator.empty()) ) + { + DCMIOD_ERROR("Cannot add private Dimension Index without private creator"); + return IOD_EC_MissingAttribute; + } + + if (dimensionOrganizationUID.empty()) + { + DCMIOD_ERROR("Cannot add Dimension Index without Dimension Organization UID"); + return IOD_EC_MissingAttribute; + } + + // Add Dimension Organization by its UID if such organization does not exist yet + OFVector::iterator it = m_DimensionOrganizationSequence.begin(); + while (it != m_DimensionOrganizationSequence.end()) + { + OFString val; + (*it)->getDimensionOrganizationUID(val); + if (val == dimensionOrganizationUID) + { + break; + } + it++; + } + OFCondition result; + if (it == m_DimensionOrganizationSequence.end()) + { + DimensionOrganizationItem* item = new DimensionOrganizationItem; + if (item == NULL) + { + return EC_MemoryExhausted; + } + result = item->setDimensionOrganizationUID(dimensionOrganizationUID); + if (result.bad()) + return result; + m_DimensionOrganizationSequence.push_back(item); + } + + // Create dimension and add it to this object + DimensionIndexItem* dim = new DimensionIndexItem(); + if (!dim) + return EC_MemoryExhausted; + + result = dim->setDimensionOrganizationUID(dimensionOrganizationUID); + if (result.good()) result = dim->setFunctionalGroupPointer(functionalGroupPointer); + if (result.good()) result = dim->setDimensionIndexPointer(dimensionIndexPointer); + if (result.good() && !dimensionIndexPrivateCreator.empty()) dim->setDimensionIndexPrivateCreator(dimensionIndexPrivateCreator); + if (result.good() && !functionalGroupPrivateCreator.empty()) dim->setFunctionalGroupPrivateCreator(functionalGroupPrivateCreator); + if (result.good() && !dimensionDescriptionLabel.empty()) dim->setDimensionDescriptionLabel(dimensionDescriptionLabel); + if (result.bad()) + { + DCMIOD_ERROR("Could not add Dimension Index: Invalid data values"); + delete dim; + } + m_DimensionIndexSequence.push_back(dim); + + return result; +} + + +OFString IODMultiframeDimensionModule::getName() const +{ + return m_ModuleName; +} + + +void IODMultiframeDimensionModule::clearData() +{ + DcmIODUtil::freeContainer(m_DimensionIndexSequence); + IODComponent::clearData(); +} + + + +OFCondition IODMultiframeDimensionModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, OFFalse /* data already cleared above */); + + DcmIODUtil::readSubSequence(source, DCM_DimensionIndexSequence, m_DimensionIndexSequence, m_Rules->getByTag(DCM_DimensionIndexSequence)); + DcmIODUtil::readSubSequence(source, DCM_DimensionOrganizationSequence, m_DimensionOrganizationSequence, m_Rules->getByTag(DCM_DimensionOrganizationSequence)); + + return EC_Normal; +} + + +OFCondition IODMultiframeDimensionModule::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + // Re-create dimension organization data + createDimensionOrganizationData(); + DcmIODUtil::writeSubSequence >(result, DCM_DimensionOrganizationSequence, m_DimensionOrganizationSequence, *m_Item, m_Rules->getByTag(DCM_DimensionOrganizationSequence)); + + DcmIODUtil::writeSubSequence >(result, DCM_DimensionIndexSequence, m_DimensionIndexSequence, *m_Item, m_Rules->getByTag(DCM_DimensionIndexSequence)); + + result = IODComponent::write(destination); + return result; +} + + +void IODMultiframeDimensionModule::resetRules() +{ + // Parameters for Rule are tag, VM, type (1,1C,2,2C,3), module name and logical IOD level + m_Rules->addRule(new IODRule(DCM_DimensionOrganizationSequence, "1-n", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DimensionOrganizationType, "1", "3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DimensionIndexSequence, "1-n", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFCondition IODMultiframeDimensionModule::checkDimensions(DcmItem* fgItem) +{ + if (fgItem == NULL) + { + fgItem = &getData(); + } + + DcmSequenceOfItems *perFrame = NULL; + if (fgItem->findAndGetSequence(DCM_PerFrameFunctionalGroupsSequence, perFrame).bad()) + { + DCMIOD_WARN("Will not check dimension consistency with functional groups (no per-frame functional groups found)"); + } + + OFCondition result; + OFVector::iterator dim = m_DimensionIndexSequence.begin(); + size_t errors = 0; + size_t dimNo = 1; + while (dim != m_DimensionIndexSequence.end()) + { + DcmTagKey indexPointer; + result = (*dim)->getDimensionIndexPointer(indexPointer); + if (result.bad()) + { + DCMIOD_ERROR("Dimension " << dimNo << " does not provide a dimension index pointer"); + errors++; + } + OFString uid; + result = (*dim)->getDimensionOrganizationUID(uid); + if (result.bad()) + { + DCMIOD_ERROR("Dimension " << dimNo << " does not provide a dimension organization UID"); + errors++; + } + DcmTagKey fgPointer; + result = (*dim)->getFunctionalGroupPointer(fgPointer); + if (result.bad()) + { + DCMIOD_ERROR("Dimension " << dimNo << " does not provide a functional group pointer"); + errors++; + } + OFString privateCreator; + if (indexPointer.isPrivate() && (indexPointer != DCM_UndefinedTagKey) ) + { + result = (*dim)->getDimensionIndexPrivateCreator(privateCreator); + if (result.bad()) + { + DCMIOD_ERROR("Dimension " << dimNo << " has private index pointer " << indexPointer << " but private creator is not set"); + errors++; + } + } + OFString privateFGCreator; + if (fgPointer.isPrivate() && (fgPointer != DCM_UndefinedTagKey)) + { + result = (*dim)->getFunctionalGroupPrivateCreator(privateFGCreator); + if (result.bad()) + { + DCMIOD_ERROR("Dimension " << dimNo << " has private fg group pointer " << fgPointer << " but private creator is not set"); + errors++; + } + } + + if (perFrame && (fgPointer != DCM_UndefinedTagKey) && (indexPointer != DCM_UndefinedTagKey) ) + { + if (!getIndexElement(perFrame, fgPointer, indexPointer, privateFGCreator, privateCreator)) + { + errors++; + } + } + + dim++; + } + + if (errors > 0) + return IOD_EC_InvalidDimensions; + else + return EC_Normal; +} + + +DcmElement* IODMultiframeDimensionModule::getIndexElement(DcmSequenceOfItems *perFrameFG, + const DcmTagKey& fgPointer, + const DcmTagKey& indexPointer, + const OFString& fgPrivateCreator, + const OFString& privateCreator) +{ + if (perFrameFG == NULL) + { + DCMIOD_ERROR("Cannot get Dimension Index: No per-frame functional groups are provided"); + return NULL; // nothing to do + } + + size_t numFrames = perFrameFG->card(); + OFCondition result; + DcmElement *returnValue = NULL; + for (size_t count = 0; count < numFrames; count++) + { + DcmItem* item = perFrameFG->getItem(OFstatic_cast(unsigned long, count)); + if (item != NULL) + { + // Check for the functional group mentioned in dimension + DcmSequenceOfItems *fgSequence = NULL; + if (item->findAndGetSequence(fgPointer, fgSequence).good()) + { + // Check private reservation for fg if necessary + if (fgPointer.isPrivate()) + { + result = DcmPathProcessor::checkPrivateTagReservation(item, fgPointer, fgPrivateCreator); + if (result.bad()) + { + DCMIOD_ERROR("Cannot get Dimension Index for frame " << count << ": " << result.text()); + } + } + // Check whether actual fg information exists (single item in related fg sequence) + DcmItem *fgItem = fgSequence->getItem(0); + if (fgItem != NULL) + { + if (fgItem->findAndGetElement(indexPointer, returnValue).good()) + { + if (returnValue->getTag().isPrivate()) + { + if (!privateCreator.empty()) + { + result = DcmPathProcessor::checkPrivateTagReservation(fgItem, indexPointer, privateCreator); + if (result.bad()) + { + DCMIOD_ERROR("Cannot get Dimension Index for frame " << count << ": " << result.text()); + } + } + else + { + DCMIOD_ERROR("Cannot get Dimension Index since fg " << fgPointer << " misses reservation for frame " << count << ": " << result.text()); + } + } + } + else + { + DCMIOD_ERROR("Cannot get Dimension Index since fg " << fgPointer << " does not contain index pointer attribute " << indexPointer << " for frame " << count); + } + } + else + { + DCMIOD_ERROR("Cannot get Dimension Index since fg " << fgPointer << " does have any data for frame " << count); + } + } + else + { + DCMIOD_ERROR("Cannot get Dimension Index since fg " << fgPointer << " does not exist for frame " << count); + } + } + else + { + DCMIOD_ERROR("Cannot get Dimension Index: since no per-frame functional group for frame " << count << " exists"); + } + } + + return returnValue; +} + + + +void IODMultiframeDimensionModule::createDimensionOrganizationData() +{ + // Clear old data + DcmIODUtil::freeContainer(m_DimensionOrganizationSequence); + // Collect dimensions from all Dimension Index Pointers + OFVector::iterator item = m_DimensionIndexSequence.begin(); + while (item != m_DimensionIndexSequence.end()) + { + OFCondition result; + // Make sure every UID is only added once + OFBool isNew = OFTrue; + OFString existinguid, newuid; + (*item)->getDimensionOrganizationUID(newuid); + OFVector::iterator existing = m_DimensionOrganizationSequence.begin(); + while (existing != m_DimensionOrganizationSequence.end()) + { + (*existing)->getDimensionOrganizationUID(existinguid); + if (existinguid == newuid) + { + isNew = OFFalse; + break; + } + existing++; + } + if (isNew) + { + DimensionOrganizationItem* uidItem = new DimensionOrganizationItem(); + if (!uidItem) + { + DCMIOD_ERROR("Memory Exhausted while collecting Dimension Organziation UIDs"); + return; + } + result = uidItem->setDimensionOrganizationUID(newuid); + if (result.good()) + { + m_DimensionOrganizationSequence.push_back(uidItem); + } + else + { + DCMIOD_ERROR("Could not set Dimension Organization UID " << newuid << ": " << result.text()); + delete uidItem; + return; + } + } + item++; + } +} + + +OFCondition IODMultiframeDimensionModule::getDimensionOrganizationType(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DimensionOrganizationType, *m_Item, value, pos); +} + + +OFCondition IODMultiframeDimensionModule::setDimensionOrganizationType(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DimensionOrganizationType, value); + return result; +} + + +OFVector< IODMultiframeDimensionModule::DimensionIndexItem* >& IODMultiframeDimensionModule::getDimensionIndexSequence() +{ + return m_DimensionIndexSequence; +} + +OFVector< IODMultiframeDimensionModule::DimensionOrganizationItem* >& IODMultiframeDimensionModule::getDimensionOrganizationSequence() +{ + return m_DimensionOrganizationSequence; +} + +IODMultiframeDimensionModule::~IODMultiframeDimensionModule() +{ + DcmIODUtil::freeContainer(m_DimensionIndexSequence); + DcmIODUtil::freeContainer(m_DimensionOrganizationSequence); +} + + +IODMultiframeDimensionModule::DimensionIndexItem::DimensionIndexItem(OFshared_ptr data, + OFshared_ptr rules, + IODComponent* parent) +: IODComponent(data, rules, parent) +{ + // reset element rules + resetRules(); +} + +IODMultiframeDimensionModule::DimensionIndexItem::DimensionIndexItem(IODComponent* parent): +IODComponent(parent) +{ + // reset element rules + resetRules(); +} + + +IODMultiframeDimensionModule::DimensionIndexItem::~DimensionIndexItem() +{ + // Nothing to do +} + + +void IODMultiframeDimensionModule::DimensionIndexItem::resetRules() +{ + // Concatenation attributes + m_Rules->addRule(new IODRule(DCM_DimensionIndexPointer, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DimensionIndexPrivateCreator, "1", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_FunctionalGroupPointer, "1", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_FunctionalGroupPrivateCreator, "1", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DimensionOrganizationUID, "1", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_DimensionDescriptionLabel, "1", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFString IODMultiframeDimensionModule::DimensionIndexItem::getName() const +{ + return "DimensionIndexSequence"; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::getDimensionDescriptionLabel(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DimensionDescriptionLabel, *m_Item, value, pos); +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::getDimensionIndexPointer(DcmTagKey& value, + const long signed int pos) const +{ + OFString tagstr; + DcmIODUtil::getStringValueFromItem(DCM_DimensionIndexPointer, *m_Item, tagstr, pos); + value = DcmIODUtil::parseTagKey(tagstr); + if (value == DCM_UndefinedTagKey) + return EC_TagNotFound; + else + return EC_Normal; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::getDimensionIndexPrivateCreator(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DimensionIndexPrivateCreator, *m_Item, value, pos); +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::getDimensionOrganizationUID(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DimensionOrganizationUID, *m_Item, value, pos); +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::getFunctionalGroupPointer(DcmTagKey& value, + const long signed int pos) const +{ + OFString tagstr; + DcmIODUtil::getStringValueFromItem(DCM_FunctionalGroupPointer, *m_Item, tagstr, pos); + value = DcmIODUtil::parseTagKey(tagstr); + if (value == DCM_UndefinedTagKey) + return EC_TagNotFound; + else + return EC_Normal; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::getFunctionalGroupPrivateCreator(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_FunctionalGroupPrivateCreator, *m_Item, value, pos); +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::setDimensionDescriptionLabel(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DimensionDescriptionLabel, value); + return result; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::setFunctionalGroupPointer(const DcmTagKey& value, + const OFBool checkValue) +{ + (void)checkValue; + if (value == DCM_UndefinedTagKey) + return EC_IllegalParameter; + + DcmAttributeTag *elem = OFstatic_cast(DcmAttributeTag*, DcmItem::newDicomElement(DCM_FunctionalGroupPointer)); + if (elem == NULL) + return EC_InternalError; + + OFCondition result; + Uint16 *attrTagArray; + result = elem->putTagVal(value); + if (result.good()) result = elem->getUint16Array(attrTagArray); + if (result.good()) result = m_Item->putAndInsertUint16Array(DCM_FunctionalGroupPointer, attrTagArray, 1); + delete elem; + + return result; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::setFunctionalGroupPrivateCreator(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_FunctionalGroupPrivateCreator, value); + return result; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::setDimensionIndexPointer(const DcmTagKey& value, + const OFBool checkValue) +{ + (void)checkValue; + if (value == DCM_UndefinedTagKey) + return EC_IllegalParameter; + + DcmAttributeTag *elem = OFstatic_cast(DcmAttributeTag*, DcmItem::newDicomElement(DCM_DimensionIndexPointer)); + if (elem == NULL) + return EC_InternalError; + + OFCondition result; + Uint16 *attrTagArray; + result = elem->putTagVal(value); + if (result.good()) result = elem->getUint16Array(attrTagArray); + if (result.good()) result = m_Item->putAndInsertUint16Array(DCM_DimensionIndexPointer, attrTagArray, 1); + delete elem; + + return result; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::setDimensionIndexPrivateCreator(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DimensionIndexPrivateCreator, value); + return result; +} + + +OFCondition IODMultiframeDimensionModule::DimensionIndexItem::setDimensionOrganizationUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DimensionOrganizationUID, value); + return result; +} + + + +// -- Dimension Organization Sequence Item -- + +IODMultiframeDimensionModule::DimensionOrganizationItem::DimensionOrganizationItem(OFshared_ptr data, + OFshared_ptr rules, + IODComponent* parent) +: IODComponent(data, rules, parent) +{ + // reset element rules + resetRules(); +} + +IODMultiframeDimensionModule::DimensionOrganizationItem::DimensionOrganizationItem(IODComponent* parent) +: IODComponent(parent) +{ + // reset element rules + resetRules(); +} + + +IODMultiframeDimensionModule::DimensionOrganizationItem::~DimensionOrganizationItem() +{ + // Nothing to do +} + + +void IODMultiframeDimensionModule::DimensionOrganizationItem::resetRules() +{ + // Concatenation attributes + m_Rules->addRule(new IODRule(DCM_DimensionOrganizationUID, "1", "1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFString IODMultiframeDimensionModule::DimensionOrganizationItem::getName() const +{ + return "DimensionOrganizationSequence"; +} + +OFCondition IODMultiframeDimensionModule::DimensionOrganizationItem::getDimensionOrganizationUID(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_DimensionOrganizationUID, *m_Item, value, pos); +} + + +OFCondition IODMultiframeDimensionModule::DimensionOrganizationItem::setDimensionOrganizationUID(const OFString& value, const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_DimensionOrganizationUID, value); + return result; +} diff --git a/dcmiod/libsrc/modmultiframefg.cc b/dcmiod/libsrc/modmultiframefg.cc new file mode 100644 index 00000000..b706fb94 --- /dev/null +++ b/dcmiod/libsrc/modmultiframefg.cc @@ -0,0 +1,290 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Multi-frame Functional Groups Module + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modmultiframefg.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmiod/iodutil.h" // for static helpers + +const OFString IODMultiFrameFGModule::m_ModuleName = "MultiframeFunctionalGroupsModule"; + + +IODMultiFrameFGModule::IODMultiFrameFGModule(OFshared_ptr data, + OFshared_ptr rules) +: IODModule(data, rules), + m_ConcatenationInfo(data, rules) +{ + // reset element rules + resetRules(); +} + + +OFString IODMultiFrameFGModule::getName() const +{ + return m_ModuleName; +} + + +IODMultiFrameFGModule::IODMultiFrameFGModule() +: IODModule(), + m_ConcatenationInfo() +{ + resetRules(); +} + + +void IODMultiFrameFGModule::resetRules() +{ + m_Rules->addRule(new IODRule(DCM_InstanceNumber, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ContentDate, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ContentTime, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_NumberOfFrames, "1", "1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_RepresentativeFrameNumber, "1", "3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_ConcatenationInfo.resetRules(); +} + + +IODMultiFrameFGModule::~IODMultiFrameFGModule() +{ +} + + +IODMultiFrameFGModule::ConcatenationInfo& IODMultiFrameFGModule::getConcatenationInfo() +{ + return m_ConcatenationInfo; +} + + +OFCondition IODMultiFrameFGModule::getInstanceNumber(Sint32& value, + const unsigned int pos) +{ + return m_Item->findAndGetSint32(DCM_InstanceNumber, value, pos); +} + + +OFCondition IODMultiFrameFGModule::getContentDate(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ContentDate, *m_Item, value, pos); +} + + +OFCondition IODMultiFrameFGModule::getContentTime(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ContentTime, *m_Item, value, pos); +} + + +OFCondition IODMultiFrameFGModule::getNumberOfFrames(Sint32& value, + const unsigned int pos) +{ + return m_Item->findAndGetSint32(DCM_NumberOfFrames, value, pos); +} + + +OFCondition IODMultiFrameFGModule::getRepresentativeFrameNumber(Uint16& value, + const unsigned int pos) +{ + return m_Item->findAndGetUint16(DCM_RepresentativeFrameNumber, value, pos); +} + + +// -- setters -- + + +OFCondition IODMultiFrameFGModule::setConcatenationInfo(const IODMultiFrameFGModule::ConcatenationInfo& concatenationInfo) +{ + m_ConcatenationInfo = concatenationInfo; + return EC_Normal; +} + + +OFCondition IODMultiFrameFGModule::setInstanceNumber(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_InstanceNumber, value); + return result; +} + + +OFCondition IODMultiFrameFGModule::setContentDate(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ContentDate, value); + return result; +} + + +OFCondition IODMultiFrameFGModule::setContentTime(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = result = m_Item->putAndInsertOFStringArray(DCM_ContentTime, value); + return result; +} + + +OFCondition IODMultiFrameFGModule::setNumberOfFrames(const Uint32 value) +{ + if (value > 2147483647) + { + DCMIOD_ERROR("Cannot set Number of Frames to " << value << ": Maximum permitted value is 2147483647"); + return EC_InvalidValue; + } + OFCondition result; + OFStringStream oss; + oss << value; + OFSTRINGSTREAM_GETSTR(oss,tempstr); + result = m_Item->putAndInsertOFStringArray(DCM_NumberOfFrames, tempstr); + OFSTRINGSTREAM_FREESTR(tmpstr); + return result; +} + + +OFCondition IODMultiFrameFGModule::setRepresentativeFrameNumber(const Uint16 value) +{ + return m_Item->putAndInsertUint16(DCM_RepresentativeFrameNumber, value); +} + + +IODMultiFrameFGModule::ConcatenationInfo::ConcatenationInfo(OFshared_ptr data, + OFshared_ptr rules) +: IODComponent(data, rules) +{ + + // reset element rules + resetRules(); +} + + +IODMultiFrameFGModule::ConcatenationInfo::ConcatenationInfo(IODComponent* parent) +: IODComponent(parent) +{ + // reset element rules + resetRules(); +} + + +IODMultiFrameFGModule::ConcatenationInfo::~ConcatenationInfo() +{ + // Nothing to do +} + + +OFString IODMultiFrameFGModule::ConcatenationInfo::getName() const +{ + return m_ModuleName; +} + + +void IODMultiFrameFGModule::ConcatenationInfo::resetRules() +{ + // Concatenation attributes + m_Rules->addRule(new IODRule(DCM_ConcatenationFrameOffsetNumber, "1", "1C", m_ModuleName, DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_ConcatenationUID, "1", "1C", m_ModuleName, DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_SOPInstanceUIDOfConcatenationSource, "1", "1C", m_ModuleName, DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_InConcatenationNumber, "1", "1C", m_ModuleName, DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_InConcatenationTotalNumber, "1", "3", m_ModuleName, DcmIODTypes::IE_INSTANCE), OFTrue); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::getConcatenationFrameOffsetNumber(Uint32& value, + const unsigned int pos) +{ + return m_Item->findAndGetUint32(DCM_ConcatenationFrameOffsetNumber, value, pos); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::getConcatenationUID(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_ConcatenationUID, *m_Item, value, pos); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::getSOPInstanceUIDOfConcatenationSource(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_SOPInstanceUIDOfConcatenationSource, *m_Item, value, pos); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::getInConcatenationNumber(Uint16& value, + const unsigned int pos) +{ + return m_Item->findAndGetUint16(DCM_InConcatenationNumber, value, pos); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::getInConcatenationTotalNumber(Uint16& value, + const unsigned int pos) +{ + return m_Item->findAndGetUint16(DCM_InConcatenationTotalNumber, value, pos); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::setConcatenationFrameOffsetNumber(const Uint32 value) +{ + return m_Item->putAndInsertUint32(DCM_ConcatenationFrameOffsetNumber, value); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::setConcatenationUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ConcatenationUID, value); + return result; + +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::setSOPInstanceUIDOfConcatenationSource(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SOPInstanceUIDOfConcatenationSource, value); + return result; + +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::setInConcatenationNumber(const Uint16 value) +{ + return m_Item->putAndInsertUint16(DCM_InConcatenationNumber, value); +} + + +OFCondition IODMultiFrameFGModule::ConcatenationInfo::setInConcatenationTotalNumber(const Uint16 value) +{ + return m_Item->putAndInsertUint16(DCM_InConcatenationTotalNumber, value); +} diff --git a/dcmiod/libsrc/modpatient.cc b/dcmiod/libsrc/modpatient.cc new file mode 100644 index 00000000..48013f5a --- /dev/null +++ b/dcmiod/libsrc/modpatient.cc @@ -0,0 +1,136 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Patient Module + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modpatient.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODPatientModule::m_ModuleName = "PatientModule"; + + +IODPatientModule::IODPatientModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +OFString IODPatientModule::getName() const +{ + return m_ModuleName; +} + + +IODPatientModule::IODPatientModule() +: IODModule() +{ + resetRules(); +} + + +void IODPatientModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_PatientName, "1","2",getName(), DcmIODTypes::IE_PATIENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientID, "1","2", getName(), DcmIODTypes::IE_PATIENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientBirthDate, "1","2", getName(), DcmIODTypes::IE_PATIENT), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientSex, "1","2", getName(), DcmIODTypes::IE_PATIENT), OFTrue); +} + + +IODPatientModule::~IODPatientModule() +{ +} + + +// --- get attributes (C++ string) --- + + +OFCondition IODPatientModule::getPatientName(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientName, *m_Item, value, pos); +} + + +OFCondition IODPatientModule::getPatientBirthDate(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientBirthDate, *m_Item, value, pos); +} + + +OFCondition IODPatientModule::getPatientSex(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientSex, *m_Item, value, pos); +} + +OFCondition IODPatientModule::getPatientID(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientID, *m_Item, value, pos); +} + +// --- set attributes --- + +OFCondition IODPatientModule::setPatientName(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientName, value); + return result; +} + + +OFCondition IODPatientModule::setPatientID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientID, value); + return result; +} + + +OFCondition IODPatientModule::setPatientBirthDate(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientBirthDate, value); + return result; +} + + +OFCondition IODPatientModule::setPatientSex(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientSex, value); + return result; +} + diff --git a/dcmiod/libsrc/modpatientstudy.cc b/dcmiod/libsrc/modpatientstudy.cc new file mode 100644 index 00000000..d87b22c9 --- /dev/null +++ b/dcmiod/libsrc/modpatientstudy.cc @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Patient Study Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modpatientstudy.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODPatientStudyModule::m_ModuleName = "PatientStudyModule"; + + +IODPatientStudyModule::IODPatientStudyModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + resetRules(); +} + + +OFString IODPatientStudyModule::getName() const +{ + return m_ModuleName; +} + + +IODPatientStudyModule::IODPatientStudyModule() +: IODModule() +{ + resetRules(); +} + + +void IODPatientStudyModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_AdmittingDiagnosesDescription, "1-n","3",getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientAge, "1","3", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientSize, "1","3", getName(), DcmIODTypes::IE_STUDY), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientWeight, "1","3", getName(), DcmIODTypes::IE_STUDY), OFTrue); +} + + +IODPatientStudyModule::~IODPatientStudyModule() +{ +} + + +// --- get attributes (C++ string) --- + +OFCondition IODPatientStudyModule::getAdmittingDiagnosesDescription(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_AdmittingDiagnosesDescription, *m_Item, value, pos); +} + + +OFCondition IODPatientStudyModule::getPatientAge(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientAge, *m_Item, value, pos); +} + + +OFCondition IODPatientStudyModule::getPatientWeight(Float64& value, + const unsigned long pos) const +{ + return DcmIODUtil::getFloat64ValueFromItem(DCM_PatientWeight, *m_Item, value, pos); +} + + +OFCondition IODPatientStudyModule::getPatientSize(Float64& value, + const unsigned long pos) const +{ + return DcmIODUtil::getFloat64ValueFromItem(DCM_PatientSize, *m_Item, value, pos); +} + + +// --- set attributes --- + + +OFCondition IODPatientStudyModule::setAdmittingDiagnosesDescription(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_AdmittingDiagnosesDescription, value); + return result; +} + +OFCondition IODPatientStudyModule::setPatientAge(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientAge, value); + return result; +} + + +OFCondition IODPatientStudyModule::setPatientSize(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientSize, value); + return result; +} + + +OFCondition IODPatientStudyModule::setPatientWeight(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientWeight, value); + return result; +} diff --git a/dcmiod/libsrc/modsegmentationseries.cc b/dcmiod/libsrc/modsegmentationseries.cc new file mode 100644 index 00000000..4019fd11 --- /dev/null +++ b/dcmiod/libsrc/modsegmentationseries.cc @@ -0,0 +1,147 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Segmentation Series Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modsegmentationseries.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODSegmentationSeriesModule::m_ModuleName = "SegmentationSeriesModule"; + + +IODSegmentationSeriesModule::IODSegmentationSeriesModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +IODSegmentationSeriesModule::IODSegmentationSeriesModule() +: IODModule() +{ + resetRules(); +} + + +IODSegmentationSeriesModule::~IODSegmentationSeriesModule() +{ +} + + +OFString IODSegmentationSeriesModule::getName() const +{ + return m_ModuleName; +} + + +void IODSegmentationSeriesModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_Modality, "1","1", getName(), DcmIODTypes::IE_SERIES, "SEG"), OFTrue); + m_Rules->addRule(new IODRule(DCM_SeriesNumber, "1","1", getName(), DcmIODTypes::IE_SERIES, "1"), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedSOPClassUID, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedSOPInstanceUID, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); +} + + +OFCondition IODSegmentationSeriesModule::getModality(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Modality, *m_Item, value, pos); +} + + +OFCondition IODSegmentationSeriesModule::getSeriesNumber(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesNumber, *m_Item, value, pos); +} + + +OFCondition IODSegmentationSeriesModule::getPPSSOPClassUID(OFString &value, + const signed long pos) const +{ + DcmItem *localItem = NULL; + OFCondition result = m_Item->findAndGetSequenceItem(DCM_ReferencedPerformedProcedureStepSequence, localItem, 0); + if (result.good()) + { + result = DcmIODUtil::getStringValueFromItem(DCM_ReferencedSOPClassUID, *localItem, value, pos); + } + return result; +} + + +OFCondition IODSegmentationSeriesModule::getPPSSOPInstanceUID(OFString &value, + const signed long pos) const +{ + DcmItem *localItem = NULL; + OFCondition result = m_Item->findAndGetSequenceItem(DCM_ReferencedPerformedProcedureStepSequence, localItem, 0); + if (result.good()) + { + result = DcmIODUtil::getStringValueFromItem(DCM_ReferencedSOPInstanceUID, *localItem, value, pos); + } + return result; +} + + +OFCondition IODSegmentationSeriesModule::setSeriesNumber(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesNumber, value); + return result; +} + + +OFCondition IODSegmentationSeriesModule::setPPSSOPClassUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + DcmItem *localItem = NULL; + result = m_Item->findOrCreateSequenceItem(DCM_ReferencedPerformedProcedureStepSequence, localItem, 0); + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, value); + } + } + return result; +} + + +OFCondition IODSegmentationSeriesModule::setPPSSOPInstanceUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + DcmItem *localItem = NULL; + result = m_Item->findOrCreateSequenceItem(DCM_ReferencedPerformedProcedureStepSequence, localItem, 0); + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, value); + } + } + return result; +} diff --git a/dcmiod/libsrc/modsopcommon.cc b/dcmiod/libsrc/modsopcommon.cc new file mode 100644 index 00000000..9ea9f074 --- /dev/null +++ b/dcmiod/libsrc/modsopcommon.cc @@ -0,0 +1,246 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the SOP Common Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modsopcommon.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmiod/iodutil.h" + +const OFString IODSOPCommonModule::m_ModuleName = "SOPCommonModule"; + + +IODSOPCommonModule::IODSOPCommonModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +IODSOPCommonModule::IODSOPCommonModule() +: IODModule() +{ + resetRules(); +} + + +void IODSOPCommonModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_SOPClassUID, "1","1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_SOPInstanceUID, "1","1", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_SpecificCharacterSet, "1-n","1C", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_InstanceCreationDate, "1","3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_InstanceCreationTime, "1","3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_InstanceCreatorUID, "1","3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + m_Rules->addRule(new IODRule(DCM_TimezoneOffsetFromUTC, "1","3", getName(), DcmIODTypes::IE_INSTANCE), OFTrue); + +} + + +OFString IODSOPCommonModule::getName() const +{ + return m_ModuleName; +} + + + +void IODSOPCommonModule::inventMissing() +{ + // SOP Instance UID + ensureInstanceUID(); + + // All other attributes + IODComponent::inventMissing(); +} + + +IODSOPCommonModule::~IODSOPCommonModule() +{ +} + + +void IODSOPCommonModule::ensureInstanceUID(const OFBool correctInvalid) +{ + OFString uidstr; + + /* create new sop instance UID if required */ + if (getSOPInstanceUID(uidstr).bad() || uidstr.empty() ) + { + setSOPInstanceUID(DcmIODUtil::createUID(0 /* Instance Level */)); + } + else if (!uidstr.empty() && correctInvalid) + { + if (DcmUniqueIdentifier::checkStringValue(uidstr, "1").bad()) + { + setSOPInstanceUID(DcmIODUtil::createUID(0 /* Instance Level */)); } + } +} + + + +OFCondition IODSOPCommonModule::getSpecificCharacterSet(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SpecificCharacterSet, *m_Item, value, pos); +} + + +OFCondition IODSOPCommonModule::getSOPInstanceUID(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SOPInstanceUID, *m_Item, value, pos); +} + + +OFCondition IODSOPCommonModule::getSOPClassUID(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SOPClassUID, *m_Item, value, pos); +} + + +OFCondition IODSOPCommonModule::getInstanceCreationDate(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_InstanceCreationDate, *m_Item, value, pos); +} + + +OFCondition IODSOPCommonModule::getInstanceCreationTime(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_InstanceCreationTime, *m_Item, value, pos); +} + + +OFCondition IODSOPCommonModule::getInstanceCreatorUID(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_InstanceCreatorUID, *m_Item, value, pos); +} + + +OFCondition IODSOPCommonModule::getTimezoneOffsetFromUTC(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_TimezoneOffsetFromUTC, *m_Item, value, pos); +} + + + +OFCondition IODSOPCommonModule::setSpecificCharacterSet(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_SpecificCharacterSet, value); + } + return result; +} + + +OFCondition IODSOPCommonModule::setSOPClassUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_SOPClassUID, value); + } + return result; +} + + +OFCondition IODSOPCommonModule::setSOPInstanceUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_SOPInstanceUID, value); + } + return result; +} + + +OFCondition IODSOPCommonModule::setInstanceCreationDate(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_InstanceCreationDate, value); + } + return result; +} + + +OFCondition IODSOPCommonModule::setInstanceCreationTime(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_InstanceCreationTime, value); + } + return result; +} + + +OFCondition IODSOPCommonModule::setInstanceCreatorUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_InstanceCreatorUID, value); + } + return result; +} + + +OFCondition IODSOPCommonModule::setTimeZoneOffsetFromUTC(const OFString& value, + const OFBool checkValue) const +{ + OFCondition result; + if (checkValue) + { + result = DcmShortString::checkStringValue(value, "1"); + if (result.good()) + { + if (value.length() != 5) result = IOD_EC_InvalidElementValue; + } + } + if (result.good()) + { + result = m_Item->putAndInsertOFStringArray(DCM_TimezoneOffsetFromUTC, value); + } + return result; +} diff --git a/dcmiod/libsrc/modsynchronization.cc b/dcmiod/libsrc/modsynchronization.cc new file mode 100644 index 00000000..4d496e3b --- /dev/null +++ b/dcmiod/libsrc/modsynchronization.cc @@ -0,0 +1,248 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Synchronization Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modsynchronisation.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + + +const OFString IODSynchronizationModule::m_ModuleName = "SynchronizationModule"; + + +IODSynchronizationModule::IODSynchronizationModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +IODSynchronizationModule::IODSynchronizationModule() +: IODModule() +{ + resetRules(); +} + + +void IODSynchronizationModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_SynchronizationFrameOfReferenceUID, "1","1", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_SynchronizationTrigger, "1","1", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_TriggerSourceOrType, "1","3", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_SynchronizationChannel, "2","1C", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_AcquisitionTimeSynchronized, "1","1", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_TimeSource, "1","3", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_TimeDistributionProtocol, "1","3", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_NTPSourceAddress, "1","3", getName(), DcmIODTypes::IE_FOR), OFTrue); +} + + + +OFString IODSynchronizationModule::getName() const +{ + return m_ModuleName; +} + + +IODSynchronizationModule::~IODSynchronizationModule() +{ +} + + +OFCondition IODSynchronizationModule::getSynchronizationFrameOfReferenceUID(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SynchronizationFrameOfReferenceUID, *m_Item, value, pos); +} + + + +OFCondition IODSynchronizationModule::getSynchronizationTrigger(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SynchronizationTrigger, *m_Item, value, pos); +} + + +OFCondition IODSynchronizationModule::getTriggerSourceOrType(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_TriggerSourceOrType, *m_Item, value, pos); +} + + +OFCondition IODSynchronizationModule::getSynchronizationChannel(OFVector& value) const +{ + DcmElement *elem = NULL; + OFCondition result = m_Item->findAndGetElement(DCM_SynchronizationChannel, elem); + if (elem) + { + result = DcmIODUtil::getUint16ValuesFromElement(*elem, value); + } + return result; +} + + +OFCondition IODSynchronizationModule::getAcquisitionTimeSynchronized(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_AcquisitionTimeSynchronized, *m_Item, value, pos); +} + + +OFCondition IODSynchronizationModule::getTimeSource(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_TimeSource, *m_Item, value, pos); +} + + +OFCondition IODSynchronizationModule::getTimeDistributionProtocol(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_TimeDistributionProtocol, *m_Item, value, pos); +} + + +OFCondition IODSynchronizationModule::getNTPSourceAddress(OFString& value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_NTPSourceAddress, *m_Item, value, pos); +} + + +OFCondition IODSynchronizationModule::setSynchronizationFrameofReferenceUID(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SynchronizationFrameOfReferenceUID, value); + return result; +} + + +OFCondition IODSynchronizationModule::setSynchronizationTrigger(const OFString &value, + const OFBool checkValue) +{ + if (checkValue && !isValidSynchronizationTrigger(value)) + { + DCMIOD_ERROR("Synchronization Trigger does not allow value " << value << " (enumerated values)"); + return IOD_EC_InvalidElementValue; + } + return m_Item->putAndInsertOFStringArray(DCM_SynchronizationTrigger, value); +} + + +OFCondition IODSynchronizationModule::setTriggerSourceOrType(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_TriggerSourceOrType, value); + return result; +} + + +OFCondition IODSynchronizationModule::setSynchronizationChannel(const OFPair &value, + const OFBool checkValue) +{ + (void)checkValue; + OFCondition result = m_Item->putAndInsertUint16(DCM_SynchronizationChannel, value.first, 0); + if (result.good()) + { + result = m_Item->putAndInsertUint16(DCM_SynchronizationChannel, value.second, 0); + } + return result; +} + + +OFCondition IODSynchronizationModule::setAcquisitionTimeSynchronized(const OFString &value, + const OFBool checkValue) +{ + if (checkValue && !isValidAcquisitionTimeSynchronized(value)) + { + DCMIOD_ERROR("Acquisition Time Synchronized must only allows values 'Y' and 'N' (enumerated values)"); + return IOD_EC_InvalidElementValue; + } + return m_Item->putAndInsertOFStringArray(DCM_AcquisitionTimeSynchronized, value); +} + + +OFCondition IODSynchronizationModule::setTimeSource(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_TimeSource, value); + return result; +} + + +OFCondition IODSynchronizationModule::setTimeDistributionProtocol(const OFString &value, + const OFBool checkValue) +{ + if (checkValue && !isValidTimeDistributionProtocol(value)) + { + DCMIOD_ERROR("Time Distribution Protocol does not allow value " << value << " (enumerated values)"); + return IOD_EC_InvalidElementValue; + } + return m_Item->putAndInsertOFStringArray(DCM_TimeDistributionProtocol, value); +} + + + +OFCondition IODSynchronizationModule::setNTPSourceAddress(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_NTPSourceAddress, value); + return result; +} + + + +OFBool IODSynchronizationModule::isValidAcquisitionTimeSynchronized(const OFString& value) +{ + return ( (value == "Y") || (value == "N") ); + +} + + +OFBool IODSynchronizationModule::isValidTimeDistributionProtocol(const OFString& value) +{ + return ( (value == "NTP") || (value == "IRIG") || (value == "GPS") || (value == "SNTP") || (value == "PTP") ); +} + + +OFBool IODSynchronizationModule::isValidSynchronizationTrigger(const OFString& value) +{ + return ( (value == "SOURCE") || (value == "EXTERNAL") || (value == "PASSTHRU") || (value == "NO TRIGGER") ); +} + diff --git a/dcmiod/libsrc/modusfor.cc b/dcmiod/libsrc/modusfor.cc new file mode 100644 index 00000000..9058d5d6 --- /dev/null +++ b/dcmiod/libsrc/modusfor.cc @@ -0,0 +1,274 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Class for managing the Ultrasound Frame of Reference Module + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmiod/modusfor.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmiod/iodutil.h" + + +const OFString IODUSFoRModule::m_ModuleName = "UltrasoundFrameOfReferenceModule"; + + +IODUSFoRModule::IODUSFoRModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + + +IODUSFoRModule::IODUSFoRModule() +: IODModule() +{ + resetRules(); +} + + +void IODUSFoRModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_VolumeFrameOfReferenceUID, "1","1", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_UltrasoundAcquisitionGeometry, "1","1", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_ApexPosition, "3","1C", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_VolumeToTransducerRelationship, "1","1C", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_VolumeToTransducerMappingMatrix, "16","1", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_PatientFrameOfReferenceSource, "1","1C", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_TableFrameOfReferenceUID, "1","1C", getName(), DcmIODTypes::IE_FOR), OFTrue); + m_Rules->addRule(new IODRule(DCM_VolumeToTableMappingMatrix, "16","1C", getName(), DcmIODTypes::IE_FOR), OFTrue); +} + + +OFString IODUSFoRModule::getName() const +{ + return m_ModuleName; +} + + +IODUSFoRModule::~IODUSFoRModule() +{ + // Nothing to do +} + + +OFCondition IODUSFoRModule::getVolumeFrameOfReferenceUID(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_VolumeFrameOfReferenceUID, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getUltrasoundAcquisitionGeometry(OFString& value, + const long signed int pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_UltrasoundAcquisitionGeometry, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getApexPosition(OFVector& value) +{ + return DcmIODUtil::getFloat64ValuesFromItem(DCM_ApexPosition, *m_Item, value); +} + + +OFCondition IODUSFoRModule::getApexPosition(Float64& value, + const long unsigned int pos) const +{ + return DcmIODUtil::getFloat64ValueFromItem(DCM_ApexPosition, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getVolumetoTransducerRelationship(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_UltrasoundAcquisitionGeometry, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getVolumetoTransducerMappingMatrix(Float64& value, + const signed long pos) const +{ + return DcmIODUtil::getFloat64ValueFromItem(DCM_VolumeToTransducerMappingMatrix, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getVolumetoTransducerMappingMatrix(OFVector< Float64 >& value) +{ + return DcmIODUtil::getFloat64ValuesFromItem(DCM_VolumeToTransducerMappingMatrix, *m_Item, value); +} + + +OFCondition IODUSFoRModule::getPatientFrameofReferenceSource(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_PatientFrameOfReferenceSource, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getTableFrameofReferenceUID(OFString& value, + const long signed int pos) +{ + return DcmIODUtil::getStringValueFromItem(DCM_TableFrameOfReferenceUID, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getVolumetoTableMappingMatrix(Float64& value, + const long signed int pos) const +{ + return DcmIODUtil::getFloat64ValueFromItem(DCM_VolumeToTableMappingMatrix, *m_Item, value, pos); +} + + +OFCondition IODUSFoRModule::getVolumetoTableMappingMatrix(OFVector< Float64 >& value) +{ + return DcmIODUtil::getFloat64ValuesFromItem(DCM_VolumeToTableMappingMatrix, *m_Item, value); +} + + +OFCondition IODUSFoRModule::setVolumeFrameOfReferenceUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_VolumeFrameOfReferenceUID, value); + return result; +} + + +OFCondition IODUSFoRModule::setUltrasoundAcquisitionGeometry(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_UltrasoundAcquisitionGeometry, value); + return result; +} + + +OFCondition IODUSFoRModule::setApexPosition(const Float64& xValue, + const Float64& yValue, + const Float64& zValue, + const OFBool) +{ + + DcmElement *elem = DcmItem::newDicomElement(DCM_ApexPosition); + + + OFCondition result = elem->putFloat64(xValue, 0); + if (result.good()) result = elem->putFloat64(yValue, 1); + if (result.good()) result = elem->putFloat64(zValue, 2); + m_Item->insert(elem); + + return result; +} + + +OFCondition IODUSFoRModule::setVolumetoTransducerRelationship(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_VolumeToTransducerRelationship, value); + return result; +} + + +OFCondition IODUSFoRModule::setVolumetoTransducerMappingMatrix(const OFVector< Float64 >& value, + const OFBool checkValue) +{ + size_t vm = value.size(); + if ( checkValue && (vm != 16) ) + { + return EC_ValueMultiplicityViolated; + } + + OFCondition result; + + DcmElement* elem = NULL; + result = DcmItem::newDicomElement(elem, DCM_VolumeToTransducerMappingMatrix); + if (result.good()) + { + for (size_t n = 0; result.good() && n < vm; n++) + { + result = elem->putFloat64(value[n], OFstatic_cast(unsigned long, n)); + } + } + if (result.good()) + { + result = m_Item->insert(elem); + if (result.bad()) delete elem; + } + return result; +} + + +OFCondition IODUSFoRModule::setPatientFrameOfReferenceSource(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PatientFrameOfReferenceSource, value); + return result; +} + + +OFCondition IODUSFoRModule::setTableFrameofReferenceUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_TableFrameOfReferenceUID, value); + return result; +} + + +OFCondition IODUSFoRModule::setVolumeToTableMappingMatrix(const OFVector< Float64 >& value, + const OFBool checkValue) +{ + size_t vm = value.size(); + if ( checkValue && (vm != 16) ) + { + return EC_ValueMultiplicityViolated; + } + + OFCondition result; + + DcmElement* elem = NULL; + result = DcmItem::newDicomElement(elem, DCM_VolumeToTableMappingMatrix); + if (result.good()) + { + for (size_t n = 0; result.good() && (n < vm); n++) + { + result = elem->putFloat64(value[n], OFstatic_cast(unsigned long, n)); + } + } + if (result.good()) + { + result = m_Item->insert(elem); + if (result.bad()) delete elem; + } + return result; +} diff --git a/dcmiod/tests/CMakeLists.txt b/dcmiod/tests/CMakeLists.txt new file mode 100644 index 00000000..1ebae734 --- /dev/null +++ b/dcmiod/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +# declare executables +DCMTK_ADD_EXECUTABLE(dcmiod_tests tests tcielabutil timagepixel) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(dcmiod_tests dcmiod dcmdata oflog ofstd) + +# This macro parses tests.cc and registers all tests +DCMTK_ADD_TESTS(dcmiod) diff --git a/dcmiod/tests/Makefile.dep b/dcmiod/tests/Makefile.dep new file mode 100644 index 00000000..e1438836 --- /dev/null +++ b/dcmiod/tests/Makefile.dep @@ -0,0 +1,251 @@ +tcielabutil.o: tcielabutil.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h \ + ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/ioddef.h +tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +timagepixel.o: timagepixel.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmiod/iodimage.h \ + ../../ofstd/include/dcmtk/ofstd/ofvriant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/variant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/helpers.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../ofstd/include/dcmtk/ofstd/ofdiag.h \ + ../../ofstd/include/dcmtk/ofstd/diag/push.def \ + ../../ofstd/include/dcmtk/ofstd/diag/cnvrsn.def \ + ../../ofstd/include/dcmtk/ofstd/diag/vsprfw.def \ + ../../ofstd/include/dcmtk/ofstd/diag/pop.def \ + ../include/dcmtk/dcmiod/iodcommn.h ../include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmiod/iodtypes.h ../include/dcmtk/dcmiod/ioddef.h \ + ../include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmiod/modpatient.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../include/dcmtk/dcmiod/modgeneralstudy.h \ + ../include/dcmtk/dcmiod/iodmacro.h \ + ../include/dcmtk/dcmiod/modequipment.h \ + ../include/dcmtk/dcmiod/modgeneralseries.h \ + ../include/dcmtk/dcmiod/modfor.h ../include/dcmtk/dcmiod/modsopcommon.h \ + ../include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../include/dcmtk/dcmiod/iodreferences.h \ + ../include/dcmtk/dcmiod/modgeneralimage.h \ + ../include/dcmtk/dcmiod/modimagepixelvariant.h \ + ../include/dcmtk/dcmiod/modimagepixelbase.h \ + ../include/dcmtk/dcmiod/modimagepixel.h \ + ../include/dcmtk/dcmiod/modfloatingpointimagepixel.h diff --git a/dcmiod/tests/Makefile.in b/dcmiod/tests/Makefile.in new file mode 100644 index 00000000..4b8699bb --- /dev/null +++ b/dcmiod/tests/Makefile.in @@ -0,0 +1,57 @@ +# +# Makefile for dcmiod/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmioddir = $(top_srcdir)/../dcmiod + +LOCALINCLUDES = -I$(dcmioddir)/include -I$(dcmdatadir)/include -I$(oflogdir)/include \ + -I$(ofstddir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(dcmioddir)/libsrc -L$(dcmdatadir)/libsrc \ + -L$(oflogdir)/libsrc -L$(ofstddir)/libsrc +LOCALLIBS = -ldcmiod -ldcmdata -loflog -lofstd \ + $(TIFFLIBS) $(PNGLIBS) $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +test_objs = tests.o tcielabutil.o timagepixel.o +objs = tests.o $(test_objs) +progs = tests + + +all: $(progs) + +tests: $(test_objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $(test_objs) $(LOCALLIBS) $(LIBS) + +install: all + + +check: tests + ./tests + +check-exhaustive: tests + ./tests -x + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmiod/tests/tcielabutil.cc b/dcmiod/tests/tcielabutil.cc new file mode 100644 index 00000000..8cbab8c7 --- /dev/null +++ b/dcmiod/tests/tcielabutil.cc @@ -0,0 +1,128 @@ +/* + * + * Copyright (C) 2017-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: Tests for dcmiod's color conversion functionalities + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/ofstd/ofrand.h" +#include "dcmtk/dcmiod/cielabutil.h" + + +OFTEST(dcmiod_tcielabutil) +{ + // Result variables for testing + double r1, r2, r3; + r1=r2=r3 = 0.0; + + // Test RGB -> CIELab conversion with medium values + IODCIELabUtil::rgb2Lab(r1, r2, r3 /* L,a,b */, 0.5, 0.5, 0.5); + OFCHECK( fabs(53.388 - r1) < 0.001 ); + OFCHECK( fabs(0.006 - r2) < 0.001 ); + OFCHECK( fabs(-0.010 - r3) < 0.001 ); + + // Test RGB -> CIEXYZ conversion with medium values + r1=r2=r3 = 0; + IODCIELabUtil::rgb2Xyz(r1, r2, r3 /* X,Y,Z */, 0.5, 0.5, 0.5); + OFCHECK( fabs(0.203 - r1) < 0.001 ); + OFCHECK( fabs(0.214 - r2) < 0.001 ); + OFCHECK( fabs(0.233 - r3) < 0.001 ); + + // Test RGB -> CIELab conversion with minimum value + r1=r2=r3 = 0; + IODCIELabUtil::rgb2Lab(r1, r2, r3 /* L,a,b */, 0, 0, 0); + OFCHECK( fabs(0 - r1) < 0.001 ); + OFCHECK( fabs(0 - r2) < 0.001 ); + OFCHECK( fabs(0 - r3) < 0.001 ); + + // Test RGB -> XYZ conversion with minimum values + r1=r2=r3 = 0; + IODCIELabUtil::rgb2Xyz(r1, r2, r3 /* X,Y,Z */, 0, 0, 0); + OFCHECK( fabs(0 - r1) < 0.001 ); + OFCHECK( fabs(0 - r2) < 0.001 ); + OFCHECK( fabs(0 - r3) < 0.001 ); + + // Test DICOM CIELab to "normalized" CIELab conversion with maximum values + r1=r2=r3 = 0; + IODCIELabUtil::dicomlab2Lab(r1, r2, r3, 65535, 65535, 65535 ); + OFCHECK( fabs(100 - r1) < 0.001 ); + OFCHECK( fabs(127 - r2) < 0.001 ); + OFCHECK( fabs(127 - r3) < 0.001 ); + + // Test DICOM CIELab to "normalized" CIELab conversion with minimum values + r1=r2=r3 = 0; + IODCIELabUtil::dicomlab2Lab(r1, r2, r3, 0, 0, 0 ); + OFCHECK( fabs(0 - r1) < 0.001 ); + OFCHECK( fabs(-128 - r2) < 0.001 ); + OFCHECK( fabs(-128 - r3) < 0.001 ); + + // Convert between colorspaces back and forth and check whether deviation after + // roundtrip is less than around 1 promille + + // Initialize random numbers + OFRandom rnd; + + // We do 1000 runs + for (size_t numRun = 0; numRun< 1000; numRun++) + { + // i1, i2, i3: Input for conversion + // r1, r2, r3: Results of conversion + // o1, o2, o3: Output of inverse conversion (should equal i1, i2, i3) + double i1, i2, i3, o1, o2, o3; + i1 = i2 = i3 = r1 = r2 = r3 = o1 = o2 = o3 = 0.0; + + // Roundtrip RGB -> CIELab -> RGB + i1 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1); + i2 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1); + i3 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1); + IODCIELabUtil::rgb2Lab(r1, r2, r3, i1, i2, i3); + IODCIELabUtil::lab2Rgb(o1, o2, o3, r1, r2, r3); + OFCHECK( fabs(i1 - o1) < 0.001 ); + OFCHECK( fabs(i2 - o2) < 0.001 ); + OFCHECK( fabs(i3 - o3) < 0.001 ); + + // Roundtrip CIELab -> DICOM CIELab -> CIELab + i1 = i2 = i3 = r1 = r2 = r3 = o1 = o2 = o3 = 0.0; + i1 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1) * 100.0; + i2 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1) * 255.0 - 128; + i3 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1) * 255.0 - 128; + IODCIELabUtil::lab2DicomLab(r1, r2, r3, i1, i2, i3); + IODCIELabUtil::dicomlab2Lab(o1, o2, o3, r1, r2, r3); + OFCHECK( fabs(i1 - o1) < 0.001 ); + OFCHECK( fabs(i2 - o2) < 0.001 ); + OFCHECK( fabs(i3 - o3) < 0.001 ); + + // Roundtrip RGB -> CIEXYZ -> CIELab -> dicomCIELab -> RGB + i1 = i2 = i3 = r1 = r2 = r3 = o1 = o2 = o3 = 0.0; + i1 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1); + i2 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1); + i3 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1); + IODCIELabUtil::rgb2Xyz(r1, r2, r3, i1, i2, i3); + IODCIELabUtil::xyz2Lab(o1, o2, o3, r1, r2, r3); + IODCIELabUtil::lab2DicomLab(r1, r2, r3, o1, o2, o3); + IODCIELabUtil::dicomLab2RGB(o1, o2, o3, r1, r2, r3); + + OFCHECK( fabs(i1 - o1) < 0.001 ); + OFCHECK( fabs(i2 - o2) < 0.001 ); + OFCHECK( fabs(i3 - o3) < 0.001 ); + + } +} diff --git a/dcmiod/tests/tests.cc b/dcmiod/tests/tests.cc new file mode 100644 index 00000000..c1528a9c --- /dev/null +++ b/dcmiod/tests/tests.cc @@ -0,0 +1,27 @@ +/* + * + * Copyright (C) 2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Michael Onken + * + * Purpose: main test program + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftest.h" + +OFTEST_REGISTER(dcmiod_tcielabutil); +OFTEST_REGISTER(dcmiod_imagepixel); +OFTEST_MAIN("dcmiod") diff --git a/dcmiod/tests/timagepixel.cc b/dcmiod/tests/timagepixel.cc new file mode 100644 index 00000000..2c4ed75f --- /dev/null +++ b/dcmiod/tests/timagepixel.cc @@ -0,0 +1,34 @@ +/* + * + * Copyright (C) 2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmiod + * + * Author: Jan Schlamelcher + * + * Purpose: Tests for dcmiod's color conversion functionalities + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmiod/iodimage.h" +#include "dcmtk/dcmiod/modimagepixel.h" +#include "dcmtk/dcmiod/modfloatingpointimagepixel.h" + +OFTEST(dcmiod_imagepixel) +{ + DcmIODImage,IODFloatingPointImagePixelModule> image1; + DcmIODImage,IODImagePixelModule,IODDoubleFloatingPointImagePixelModule> image2( OFin_place > ); +} diff --git a/dcmjpeg/CMakeLists.txt b/dcmjpeg/CMakeLists.txt new file mode 100644 index 00000000..0e995bf8 --- /dev/null +++ b/dcmjpeg/CMakeLists.txt @@ -0,0 +1,7 @@ +# declare project +project(dcmjpeg) + +# recurse into subdirectories +foreach(SUBDIR libsrc libijg8 libijg12 libijg16 apps include) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmjpeg/Makefile.in b/dcmjpeg/Makefile.in new file mode 100644 index 00000000..3d09954b --- /dev/null +++ b/dcmjpeg/Makefile.in @@ -0,0 +1,112 @@ +# +# Makefile for dcmjpeg +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libijg8 && $(MAKE) ARCH="$(ARCH)" all) + (cd libijg12 && $(MAKE) ARCH="$(ARCH)" all) + (cd libijg16 && $(MAKE) ARCH="$(ARCH)" all) + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libijg8 && $(MAKE) ARCH="$(ARCH)" install) + (cd libijg12 && $(MAKE) ARCH="$(ARCH)" install) + (cd libijg16 && $(MAKE) ARCH="$(ARCH)" install) + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libijg8 && $(MAKE) clean) + (cd libijg12 && $(MAKE) clean) + (cd libijg16 && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libijg8 && $(MAKE) distclean) + (cd libijg12 && $(MAKE) distclean) + (cd libijg16 && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libijg8 && touch $(DEP) && $(MAKE) dependencies) + (cd libijg12 && touch $(DEP) && $(MAKE) dependencies) + (cd libijg16 && touch $(DEP) && $(MAKE) dependencies) + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) +# (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmjpeg/apps/CMakeLists.txt b/dcmjpeg/apps/CMakeLists.txt new file mode 100644 index 00000000..294a96f8 --- /dev/null +++ b/dcmjpeg/apps/CMakeLists.txt @@ -0,0 +1,12 @@ +# declare additional include directories +include_directories("${dcmjpeg_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR}) + +# declare executables +foreach(PROGRAM dcmcjpeg dcmdjpeg dcmj2pnm dcmmkdir) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcmcjpeg dcmdjpeg dcmj2pnm dcmmkdir) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmjpeg ijg8 ijg12 ijg16 dcmimage dcmimgle dcmdata oflog ofstd) +endforeach() diff --git a/dcmjpeg/apps/Makefile.dep b/dcmjpeg/apps/Makefile.dep new file mode 100644 index 00000000..50e8a3a0 --- /dev/null +++ b/dcmjpeg/apps/Makefile.dep @@ -0,0 +1,534 @@ +dcmcjpeg.o: dcmcjpeg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmjpeg/djdecode.h ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djencode.h \ + ../include/dcmtk/dcmjpeg/djrplol.h ../include/dcmtk/dcmjpeg/djrploss.h \ + ../include/dcmtk/dcmjpeg/dipijpeg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../../dcmimage/include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimage/include/dcmtk/dcmimage/dicdefin.h +dcmdjpeg.o: dcmdjpeg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmjpeg/djdecode.h ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/dipijpeg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h +dcmj2pnm.o: dcmj2pnm.cc ../../dcmimage/apps/dcm2pnm.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcrledrg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/digsdfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diciefn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dicielut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didislut.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimage/include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimage/include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmjpeg/djdecode.h ../include/dcmtk/dcmjpeg/djutils.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/dipijpeg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../../dcmimage/include/dcmtk/dcmimage/dipitiff.h \ + ../../dcmimage/include/dcmtk/dcmimage/dipipng.h +dcmmkdir.o: dcmmkdir.cc ../../dcmdata/apps/dcmgpdir.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcddirif.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimage/include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimage/include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcrledrg.h \ + ../include/dcmtk/dcmjpeg/djdecode.h ../include/dcmtk/dcmjpeg/djutils.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/dipijpeg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../include/dcmtk/dcmjpeg/ddpiimpl.h diff --git a/dcmjpeg/apps/Makefile.in b/dcmjpeg/apps/Makefile.in new file mode 100644 index 00000000..136d83f2 --- /dev/null +++ b/dcmjpeg/apps/Makefile.in @@ -0,0 +1,90 @@ +# +# Makefile for dcmjpeg/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +ofstddir =$(top_srcdir)/../ofstd +ofstdinc = -I$(ofstddir)/include +ofstdlibdir = -L$(ofstddir)/libsrc +ofstdlib = -lofstd + +oflogdir = $(top_srcdir)/../oflog +ofloginc = -I$(oflogdir)/include +ofloglibdir = -L$(oflogdir)/libsrc +ofloglib = -loflog + +dcmdatadir = $(top_srcdir)/../dcmdata +dcmdatainc = -I$(dcmdatadir)/include +dcmdatalibdir = -L$(dcmdatadir)/libsrc +dcmdatalib = -ldcmdata + +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmimgleinc = -I$(dcmimgledir)/include +dcmimglelibdir = -L$(dcmimgledir)/libsrc +dcmimglelib = -ldcmimgle + +dcmimagedir = $(top_srcdir)/../dcmimage +dcmimageinc = -I$(dcmimagedir)/include +dcmimagelibdir = -L$(dcmimagedir)/libsrc +dcmimagelib = -ldcmimage + +dcmjpegdir = $(top_srcdir)/../dcmjpeg +dcmjpeginc = -I$(dcmjpegdir)/include +dcmjpeglibdir = -L$(dcmjpegdir)/libsrc -L$(dcmjpegdir)/libijg8 -L$(dcmjpegdir)/libijg12 \ + -L$(dcmjpegdir)/libijg16 +dcmjpeglib = -ldcmjpeg -lijg8 -lijg12 -lijg16 + +LOCALINCLUDES = $(dcmjpeginc) $(ofstdinc) $(ofloginc) $(dcmdatainc) $(dcmimageinc) \ + $(dcmimgleinc) +LIBDIRS = -L$(top_srcdir)/libsrc $(dcmjpeglibdir) $(dcmimagelibdir) $(dcmimglelibdir) \ + $(dcmdatalibdir) $(ofloglibdir) $(ofstdlibdir) +LOCALLIBS = $(dcmjpeglib) $(dcmimagelib) $(dcmimglelib) $(dcmdatalib) $(ofloglib) \ + $(ofstdlib) $(TIFFLIBS) $(PNGLIBS) $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +objs = dcmdjpeg.o dcmcjpeg.o dcmj2pnm.o dcmmkdir.o +progs = dcmdjpeg dcmcjpeg dcmj2pnm dcmmkdir + + +all: $(progs) + +dcmdjpeg: dcmdjpeg.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmcjpeg: dcmcjpeg.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmj2pnm: dcmj2pnm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmmkdir: dcmmkdir.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmjpeg/apps/dcmcjpeg.cc b/dcmjpeg/apps/dcmcjpeg.cc new file mode 100644 index 00000000..baf6fcbf --- /dev/null +++ b/dcmjpeg/apps/dcmcjpeg.cc @@ -0,0 +1,746 @@ +/* + * + * Copyright (C) 2001-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: Compress DICOM file + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmjpeg/djdecode.h" /* for dcmjpeg decoders */ +#include "dcmtk/dcmjpeg/djencode.h" /* for dcmjpeg encoders */ +#include "dcmtk/dcmjpeg/djrplol.h" /* for DJ_RPLossless */ +#include "dcmtk/dcmjpeg/djrploss.h" /* for DJ_RPLossy */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmcjpeg" + +static OFLogger dcmcjpegLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +#define SHORTCOL 4 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + OFBool opt_acceptWrongPaletteTags = OFFalse; + OFBool opt_acrNemaCompatibility = OFFalse; + + + // JPEG options + E_TransferSyntax opt_oxfer = EXS_JPEGProcess14SV1; + OFCmdUnsignedInt opt_selection_value = 6; + OFCmdUnsignedInt opt_point_transform = 0; + OFCmdUnsignedInt opt_quality = 90; + OFBool opt_huffmanOptimize = OFTrue; + OFCmdUnsignedInt opt_smoothing = 0; + int opt_compressedBits = 0; // 0=auto, 8/12/16=force + E_CompressionColorSpaceConversion opt_compCSconversion = ECC_lossyYCbCr; + E_DecompressionColorSpaceConversion opt_decompCSconversion = EDC_photometricInterpretation; + OFBool opt_predictor6WorkaroundEnable = OFFalse; + OFBool opt_cornellWorkaroundEnable = OFFalse; + OFBool opt_forceSingleFragmentPerFrame = OFFalse; + E_SubSampling opt_sampleFactors = ESS_422; + OFBool opt_useYBR422 = OFTrue; + OFCmdUnsignedInt opt_fragmentSize = 0; // 0=unlimited + OFBool opt_createOffsetTable = OFTrue; + int opt_windowType = 0; /* default: no windowing; 1=Wi, 2=Wl, 3=Wm, 4=Wh, 5=Ww, 6=Wn, 7=Wr */ + OFCmdUnsignedInt opt_windowParameter = 0; + OFCmdFloat opt_windowCenter=0.0, opt_windowWidth=0.0; + E_UIDCreation opt_uidcreation = EUC_default; + OFBool opt_secondarycapture = OFFalse; + OFCmdUnsignedInt opt_roiLeft = 0, opt_roiTop = 0, opt_roiWidth = 0, opt_roiHeight = 0; + OFBool opt_usePixelValues = OFTrue; + OFBool opt_useModalityRescale = OFFalse; + OFBool opt_trueLossless = OFTrue; + OFBool opt_lossless = OFTrue; + OFBool lossless = OFTrue; /* see opt_oxfer */ + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encode DICOM file to JPEG transfer syntax", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + cmd.addSubGroup("compatibility (ignored by +tl):"); + cmd.addOption("--accept-acr-nema", "+Ma", "accept ACR-NEMA images without photometric\ninterpretation"); + cmd.addOption("--accept-palettes", "+Mp", "accept incorrect palette attribute tags\n(0028,111x) and (0028,121x)"); + + cmd.addGroup("JPEG encoding options:"); + cmd.addSubGroup("JPEG process:"); + cmd.addOption("--encode-lossless-sv1", "+e1", "encode lossless sv1 (default)"); + cmd.addOption("--encode-lossless", "+el", "encode lossless"); + cmd.addOption("--encode-baseline", "+eb", "encode baseline"); + cmd.addOption("--encode-extended", "+ee", "encode extended sequential"); + cmd.addOption("--encode-spectral", "+es", "encode spectral selection"); + cmd.addOption("--encode-progressive", "+ep", "encode progressive"); + + cmd.addSubGroup("lossless JPEG codec selection:"); + cmd.addOption("--true-lossless", "+tl", "true lossless codec (default)"); + cmd.addOption("--pseudo-lossless", "+pl", "old pseudo-lossless codec"); + + cmd.addSubGroup("lossless JPEG representation:"); + cmd.addOption("--selection-value", "+sv", 1, "[sv]: integer (1..7, default: 6)", + "use selection value sv\nonly with --encode-lossless"); + cmd.addOption("--point-transform", "+pt", 1, "[pt]: integer (0..15, default: 0)", + "use point transform pt"); + + cmd.addSubGroup("lossy JPEG representation:"); + cmd.addOption("--quality", "+q", 1, "[q]: integer (0..100, default: 90)", + "use quality factor q"); + cmd.addOption("--smooth", "+sm", 1, "[s]: integer (0..100, default: 0)", + "use smoothing factor s"); + cmd.addSubGroup("other JPEG options:"); + cmd.addOption("--huffman-optimize", "+ho", "optimize huffman tables (default)"); + cmd.addOption("--huffman-standard", "-ho", "use standard huffman tables if 8 bits/sample"); + + cmd.addSubGroup("compressed bits per sample (always +ba with +tl):"); + cmd.addOption("--bits-auto", "+ba", "choose bits/sample automatically (default)"); + cmd.addOption("--bits-force-8", "+be", "force 8 bits/sample"); + cmd.addOption("--bits-force-12", "+bt", "force 12 bits/sample (not with baseline)"); + cmd.addOption("--bits-force-16", "+bs", "force 16 bits/sample (lossless only)"); + + cmd.addSubGroup("compression color space conversion (overridden by +tl):"); + cmd.addOption("--color-ybr", "+cy", "use YCbCr for color images if lossy (default)"); + cmd.addOption("--color-rgb", "+cr", "use RGB for color images if lossy"); + cmd.addOption("--monochrome", "+cm", "convert color images to monochrome"); + + cmd.addSubGroup("decompr. color space conversion (if input is compressed; always +cn with +tl):"); + cmd.addOption("--conv-photometric", "+cp", "convert if YCbCr photometric interpr. (default)"); + cmd.addOption("--conv-lossy", "+cl", "convert YCbCr to RGB if lossy JPEG"); + cmd.addOption("--conv-guess", "+cg", "convert to RGB if YCbCr is guessed by library"); + cmd.addOption("--conv-guess-lossy", "+cgl", "convert to RGB if lossy JPEG and YCbCr is\nguessed by the underlying JPEG library"); + cmd.addOption("--conv-always", "+ca", "always convert YCbCr to RGB"); + cmd.addOption("--conv-never", "+cn", "never convert color space"); + + cmd.addSubGroup("decompr. workaround options for incorrect encodings (if input is compressed):"); + cmd.addOption("--workaround-pred6", "+w6", "enable workaround for JPEG lossless images\nwith overflow in predictor 6"); + cmd.addOption("--workaround-incpl", "+wi", "enable workaround for incomplete JPEG data"); + cmd.addOption("--workaround-cornell", "+wc", "enable workaround for 16-bit JPEG lossless\nCornell images with Huffman table overflow"); + + cmd.addSubGroup("YCbCr component subsampling (lossy JPEG only):"); + cmd.addOption("--sample-422", "+s2", "4:2:2 subsampling with YBR_FULL_422 (default)"); + + cmd.addSubGroup("non-standard YCbCr component subsampling (lossy JPEG only):"); + cmd.addOption("--nonstd-444", "+s4", "4:4:4 sampling with YBR_FULL"); + cmd.addOption("--nonstd-422-full", "+n2", "4:2:2 subsampling with YBR_FULL"); + cmd.addOption("--nonstd-411-full", "+n1", "4:1:1 subsampling with YBR_FULL"); + cmd.addOption("--nonstd-411", "+np", "4:1:1 subsampling with YBR_FULL_422"); + + cmd.addGroup("encapsulated pixel data encoding options:"); + cmd.addSubGroup("pixel data fragmentation:"); + cmd.addOption("--fragment-per-frame", "+ff", "encode each frame as one fragment (default)"); + cmd.addOption("--fragment-size", "+fs", 1, "[s]ize: integer", + "limit fragment size to s kbytes"); + cmd.addSubGroup("basic offset table encoding:"); + cmd.addOption("--offset-table-create", "+ot", "create offset table (default)"); + cmd.addOption("--offset-table-empty", "-ot", "leave offset table empty"); + + cmd.addSubGroup("VOI windowing for monochrome images (not with +tl):"); + cmd.addOption("--no-windowing", "-W", "no VOI windowing (default)"); + cmd.addOption("--use-window", "+Wi", 1, "[n]umber: integer", + "use the n-th VOI window from image file"); + cmd.addOption("--use-voi-lut", "+Wl", 1, "[n]umber: integer", + "use the n-th VOI look up table from image file"); + cmd.addOption("--min-max-window", "+Wm", "compute VOI window using min-max algorithm"); + cmd.addOption("--min-max-window-n", "+Wn", "compute VOI window using min-max algorithm,\nignoring extreme values"); + cmd.addOption("--roi-min-max-window", "+Wr", 4, "[l]eft [t]op [w]idth [h]eight: integer", + "compute ROI window using min-max algorithm,\nregion of interest is specified by l,t,w,h"); + cmd.addOption("--histogram-window", "+Wh", 1, "[n]umber: integer", + "compute VOI window using Histogram algorithm,\nignoring n percent"); + cmd.addOption("--set-window", "+Ww", 2, "[c]enter [w]idth: float", + "compute VOI window using center c and width w"); + + cmd.addSubGroup("pixel scaling for monochrome images (-W; ignored by +tl):"); + cmd.addOption("--scaling-pixel", "+sp", "scale using min/max pixel value (default)"); + cmd.addOption("--scaling-range", "+sr", "scale using min/max range"); + + cmd.addSubGroup("rescale slope/intercept encoding for monochrome (-W; ignored by +tl):"); + cmd.addOption("--rescale-identity", "+ri", "encode identity modality rescale (default)\nNever used for CT images"); + cmd.addOption("--rescale-map", "+rm", "use modality rescale to scale pixel range\nNever used for XA/RF/XA Biplane images"); + + cmd.addSubGroup("SOP Class UID:"); + cmd.addOption("--class-default", "+cd", "keep SOP Class UID (default)"); + cmd.addOption("--class-sc", "+cs", "convert to Secondary Capture Image\n(implies --uid-always)"); + + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-default", "+ud", "assign new UID if lossy compression (default)"); + cmd.addOption("--uid-always", "+ua", "always assign new UID"); + cmd.addOption("--uid-never", "+un", "never assign new UID"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding:"); + cmd.addOption("--padding-retain", "-p=", "do not change padding (default)"); + cmd.addOption("--padding-off", "-p", "no padding"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* options */ + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--accept-acr-nema")) + opt_acrNemaCompatibility = OFTrue; + if (cmd.findOption("--accept-palettes")) + opt_acceptWrongPaletteTags = OFTrue; + + // JPEG options + + cmd.beginOptionBlock(); + if (cmd.findOption("--encode-lossless-sv1")) + { + opt_oxfer = EXS_JPEGProcess14SV1; + opt_lossless = OFTrue; + } + if (cmd.findOption("--encode-lossless")) + { + opt_oxfer = EXS_JPEGProcess14; + opt_lossless = OFTrue; + } + if (cmd.findOption("--encode-baseline")) + { + opt_oxfer = EXS_JPEGProcess1; + opt_lossless = OFFalse; + } + if (cmd.findOption("--encode-extended")) + { + opt_oxfer = EXS_JPEGProcess2_4; + opt_lossless = OFFalse; + } + if (cmd.findOption("--encode-spectral")) + { + opt_oxfer = EXS_JPEGProcess6_8; + opt_lossless = OFFalse; + } + if (cmd.findOption("--encode-progressive")) + { + opt_oxfer = EXS_JPEGProcess10_12; + opt_lossless = OFFalse; + } + cmd.endOptionBlock(); + + // check for JPEG lossless output transfer syntaxes + lossless = (opt_oxfer == EXS_JPEGProcess14SV1) || (opt_oxfer == EXS_JPEGProcess14); + + cmd.beginOptionBlock(); + if (cmd.findOption("--true-lossless")) + { + // true lossless explicitely requested but selected TS denotes lossy process + app.checkDependence("--true-lossless", "--encode-lossless-sv1 or --encode-lossless", lossless); + opt_trueLossless = OFTrue; + } + if (cmd.findOption("--pseudo-lossless")) + { + // pseudo lossless explicitely requested but selected TS denotes lossy process + app.checkDependence("--pseudo-lossless", "--encode-lossless-sv1 or --encode-lossless", lossless); + opt_trueLossless = OFFalse; + } + cmd.endOptionBlock(); + + // disable true lossless mode since we are not encoding with JPEG lossless + if (!lossless) opt_trueLossless = OFFalse; + + if (cmd.findOption("--selection-value")) + { + app.checkDependence("--selection-value", "--encode-lossless", opt_oxfer == EXS_JPEGProcess14); + app.checkValue(cmd.getValueAndCheckMinMax(opt_selection_value, OFstatic_cast(OFCmdUnsignedInt, 1), OFstatic_cast(OFCmdUnsignedInt, 7))); + } + + if (cmd.findOption("--point-transform")) + { + app.checkDependence("--point-transform", "lossless JPEG", lossless); + app.checkValue(cmd.getValueAndCheckMinMax(opt_point_transform, OFstatic_cast(OFCmdUnsignedInt, 0), OFstatic_cast(OFCmdUnsignedInt, 15))); + } + + if (cmd.findOption("--quality")) + { + app.checkDependence("--quality", "lossy JPEG", !lossless); + app.checkValue(cmd.getValueAndCheckMinMax(opt_quality, OFstatic_cast(OFCmdUnsignedInt, 0), OFstatic_cast(OFCmdUnsignedInt, 100))); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--huffman-optimize")) opt_huffmanOptimize = OFTrue; + if (cmd.findOption("--huffman-standard")) opt_huffmanOptimize = OFFalse; + cmd.endOptionBlock(); + + if (cmd.findOption("--smooth")) + { + app.checkConflict("--smooth", "--true-lossless", opt_trueLossless); + app.checkValue(cmd.getValueAndCheckMinMax(opt_smoothing, OFstatic_cast(OFCmdUnsignedInt, 0), OFstatic_cast(OFCmdUnsignedInt, 100))); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--bits-auto")) + { + opt_compressedBits = 0; + } + if (cmd.findOption("--bits-force-8")) + { + app.checkConflict("--bits-force-8", "--true-lossless", opt_trueLossless); + opt_compressedBits = 8; + } + if (cmd.findOption("--bits-force-12")) + { + app.checkConflict("--bits-force-12", "--true-lossless", opt_trueLossless); + app.checkConflict("--bits-force-12", "--encode-baseline", opt_oxfer == EXS_JPEGProcess1); + opt_compressedBits = 12; + } + if (cmd.findOption("--bits-force-16")) + { + app.checkConflict("--bits-force-16", "--true-lossless", opt_trueLossless); + app.checkConflict("--bits-force-16", "--encode-baseline", opt_oxfer == EXS_JPEGProcess1); + app.checkConflict("--bits-force-16", "--encode-extended", opt_oxfer == EXS_JPEGProcess2_4); + app.checkConflict("--bits-force-16", "--encode-spectral", opt_oxfer == EXS_JPEGProcess6_8); + app.checkConflict("--bits-force-16", "--encode-progressive", opt_oxfer == EXS_JPEGProcess10_12); + opt_compressedBits = 16; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--color-ybr")) + { + opt_compCSconversion = ECC_lossyYCbCr; + } + if (cmd.findOption("--color-rgb")) + { + app.checkConflict("--color-rgb", "--true-lossless", opt_trueLossless); + opt_compCSconversion = ECC_lossyRGB; + } + if (cmd.findOption("--monochrome")) + { + app.checkConflict("--monochrome", "--true-lossless", opt_trueLossless); + opt_compCSconversion = ECC_monochrome; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--conv-photometric")) + { + opt_decompCSconversion = EDC_photometricInterpretation; + } + if (cmd.findOption("--conv-lossy")) + { + app.checkConflict("--conv-lossy", "--true-lossless", opt_trueLossless); + opt_decompCSconversion = EDC_lossyOnly; + } + if (cmd.findOption("--conv-guess")) + { + app.checkConflict("--conv-guess", "--true-lossless", opt_trueLossless); + opt_decompCSconversion = EDC_guess; + } + if (cmd.findOption("--conv-guess-lossy")) + { + app.checkConflict("--conv-guess-lossy", "--true-lossless", opt_trueLossless); + opt_decompCSconversion = EDC_guessLossyOnly; + } + if (cmd.findOption("--conv-always")) + { + app.checkConflict("--conv-always", "--true-lossless", opt_trueLossless); + opt_decompCSconversion = EDC_always; + } + if (cmd.findOption("--conv-never")) opt_decompCSconversion = EDC_never; + cmd.endOptionBlock(); + if (opt_trueLossless) opt_decompCSconversion = EDC_never; + + if (cmd.findOption("--workaround-pred6")) opt_predictor6WorkaroundEnable = OFTrue; + if (cmd.findOption("--workaround-incpl")) opt_forceSingleFragmentPerFrame = OFTrue; + if (cmd.findOption("--workaround-cornell")) opt_cornellWorkaroundEnable = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--nonstd-444")) + { + app.checkConflict("--nonstd-444", "--true-lossless", opt_trueLossless); + app.checkConflict("--nonstd-444", "--pseudo-lossless", opt_lossless); + opt_sampleFactors = ESS_444; + opt_useYBR422 = OFFalse; + } + if (cmd.findOption("--sample-422")) + { + app.checkConflict("--sample-422", "--true-lossless", opt_trueLossless); + app.checkConflict("--sample-422", "--pseudo-lossless", opt_lossless); + opt_sampleFactors = ESS_422; + opt_useYBR422 = OFTrue; + } + if (cmd.findOption("--nonstd-422-full")) + { + app.checkConflict("--nonstd-422-full", "--true-lossless", opt_trueLossless); + app.checkConflict("--nonstd-422-full", "--pseudo-lossless", opt_lossless); + opt_sampleFactors = ESS_422; + opt_useYBR422 = OFFalse; + } + if (cmd.findOption("--nonstd-411-full")) + { + app.checkConflict("--nonstd-411-full", "--true-lossless", opt_trueLossless); + app.checkConflict("--nonstd-411-full", "--pseudo-lossless", opt_lossless); + opt_sampleFactors = ESS_411; + opt_useYBR422 = OFFalse; + } + if (cmd.findOption("--nonstd-411")) + { + app.checkConflict("--nonstd-411", "--true-lossless", opt_trueLossless); + app.checkConflict("--nonstd-411", "--pseudo-lossless", opt_lossless); + opt_sampleFactors = ESS_411; + opt_useYBR422 = OFTrue; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--fragment-per-frame")) opt_fragmentSize = 0; + if (cmd.findOption("--fragment-size")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_fragmentSize, OFstatic_cast(OFCmdUnsignedInt, 1))); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--offset-table-create")) opt_createOffsetTable = OFTrue; + if (cmd.findOption("--offset-table-empty")) opt_createOffsetTable = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-windowing")) opt_windowType = 0; + if (cmd.findOption("--use-window")) + { + app.checkConflict("--use-window", "--true-lossless", opt_trueLossless); + opt_windowType = 1; + app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1)); + } + if (cmd.findOption("--use-voi-lut")) + { + app.checkConflict("--use-voi-lut", "--true-lossless", opt_trueLossless); + opt_windowType = 2; + app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1)); + } + if (cmd.findOption("--min-max-window")) + { + app.checkConflict("--min-max-window", "--true-lossless", opt_trueLossless); + opt_windowType = 3; + } + if (cmd.findOption("--min-max-window-n")) + { + app.checkConflict("--min-max-window-n", "--true-lossless", opt_trueLossless); + opt_windowType = 6; + } + if (cmd.findOption("--roi-min-max-window")) + { + app.checkConflict("--roi-min-max-window", "--true-lossless", opt_trueLossless); + opt_windowType = 7; + app.checkValue(cmd.getValue(opt_roiLeft)); + app.checkValue(cmd.getValue(opt_roiTop)); + app.checkValue(cmd.getValueAndCheckMin(opt_roiWidth, 1)); + app.checkValue(cmd.getValueAndCheckMin(opt_roiHeight, 1)); + } + if (cmd.findOption("--histogram-window")) + { + app.checkConflict("--histogram-window", "--true-lossless", opt_trueLossless); + opt_windowType = 4; + app.checkValue(cmd.getValueAndCheckMinMax(opt_windowParameter, 0, 100)); + } + if (cmd.findOption("--set-window")) + { + app.checkConflict("--set-window", "--true-lossless", opt_trueLossless); + opt_windowType = 5; + app.checkValue(cmd.getValue(opt_windowCenter)); + app.checkValue(cmd.getValueAndCheckMin(opt_windowWidth, 1.0)); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--scaling-pixel")) opt_usePixelValues = OFTrue; + if (cmd.findOption("--scaling-range")) opt_usePixelValues = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--rescale-identity")) opt_useModalityRescale = OFFalse; + if (cmd.findOption("--rescale-map")) opt_useModalityRescale = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--class-default")) opt_secondarycapture = OFFalse; + if (cmd.findOption("--class-sc")) opt_secondarycapture = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-default")) opt_uidcreation = EUC_default; + if (cmd.findOption("--uid-always")) opt_uidcreation = EUC_always; + if (cmd.findOption("--uid-never")) opt_uidcreation = EUC_never; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) opt_opadenc = EPD_noChange; + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmcjpegLogger, rcsid << OFendl); + + // register global decompression codecs + DJDecoderRegistration::registerCodecs( + opt_decompCSconversion, + opt_uidcreation, + EPC_default, + opt_predictor6WorkaroundEnable, + opt_cornellWorkaroundEnable, + opt_forceSingleFragmentPerFrame); + + // register global compression codecs + DJEncoderRegistration::registerCodecs( + opt_compCSconversion, + opt_uidcreation, + opt_huffmanOptimize, + OFstatic_cast(int, opt_smoothing), + opt_compressedBits, + OFstatic_cast(Uint32, opt_fragmentSize), + opt_createOffsetTable, + opt_sampleFactors, + opt_useYBR422, + opt_secondarycapture, + OFstatic_cast(Uint32, opt_windowType), + OFstatic_cast(Uint32, opt_windowParameter), + opt_windowCenter, + opt_windowWidth, + OFstatic_cast(Uint32, opt_roiLeft), + OFstatic_cast(Uint32, opt_roiTop), + OFstatic_cast(Uint32, opt_roiWidth), + OFstatic_cast(Uint32, opt_roiHeight), + opt_usePixelValues, + opt_useModalityRescale, + opt_acceptWrongPaletteTags, + opt_acrNemaCompatibility, + opt_trueLossless); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmcjpegLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open inputfile + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmcjpegLogger, "invalid filename: "); + return 1; + } + + OFLOG_INFO(dcmcjpegLogger, "reading input file " << opt_ifname); + + DcmFileFormat fileformat; + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (error.bad()) + { + OFLOG_FATAL(dcmcjpegLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + DcmDataset *dataset = fileformat.getDataset(); + + DcmXfer original_xfer(dataset->getOriginalXfer()); + if (original_xfer.isEncapsulated()) + { + OFLOG_INFO(dcmcjpegLogger, "DICOM file is already compressed, converting to uncompressed transfer syntax first"); + if (EC_Normal != dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL)) + { + OFLOG_FATAL(dcmcjpegLogger, "no conversion from compressed original to uncompressed transfer syntax possible!"); + return 1; + } + } + + OFString sopClass; + if (fileformat.getMetaInfo()->findAndGetOFString(DCM_MediaStorageSOPClassUID, sopClass).good()) + { + /* check for DICOMDIR files */ + if (sopClass == UID_MediaStorageDirectoryStorage) + { + OFLOG_FATAL(dcmcjpegLogger, "DICOMDIR files (Media Storage Directory Storage SOP Class) cannot be compressed!"); + return 1; + } + } + + OFLOG_INFO(dcmcjpegLogger, "Convert DICOM file to compressed transfer syntax"); + + DcmXfer opt_oxferSyn(opt_oxfer); + + // create representation parameters for lossy and lossless + DJ_RPLossless rp_lossless(OFstatic_cast(int, opt_selection_value), OFstatic_cast(int, opt_point_transform)); + DJ_RPLossy rp_lossy(OFstatic_cast(int, opt_quality)); + + const DcmRepresentationParameter *rp = &rp_lossy; + if (lossless) + rp = &rp_lossless; + + if (dataset->chooseRepresentation(opt_oxfer, rp).good() && dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_INFO(dcmcjpegLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written"); + } else { + OFLOG_FATAL(dcmcjpegLogger, "no conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return 1; + } + + OFLOG_INFO(dcmcjpegLogger, "creating output file " << opt_ofname); + + fileformat.loadAllDataIntoMemory(); + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, + opt_opadenc, OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), EWM_updateMeta); + + if (error.bad()) + { + OFLOG_FATAL(dcmcjpegLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmcjpegLogger, "conversion successful"); + + // deregister global codecs + DJDecoderRegistration::cleanup(); + DJEncoderRegistration::cleanup(); + + return 0; +} diff --git a/dcmjpeg/apps/dcmdjpeg.cc b/dcmjpeg/apps/dcmdjpeg.cc new file mode 100644 index 00000000..b43ee65a --- /dev/null +++ b/dcmjpeg/apps/dcmdjpeg.cc @@ -0,0 +1,348 @@ +/* + * + * Copyright (C) 2001-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: Decompress DICOM file + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmjpeg/djdecode.h" /* for dcmjpeg decoders */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmdjpeg" + +static OFLogger dcmdjpegLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +#define SHORTCOL 4 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + E_FileReadMode opt_readMode = ERM_autoDetect; + E_FileWriteMode opt_writeMode = EWM_fileformat; + E_TransferSyntax opt_oxfer = EXS_LittleEndianExplicit; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + E_TransferSyntax opt_ixfer = EXS_Unknown; + + // JPEG parameters + E_DecompressionColorSpaceConversion opt_decompCSconversion = EDC_photometricInterpretation; + E_UIDCreation opt_uidcreation = EUC_default; + E_PlanarConfiguration opt_planarconfig = EPC_default; + OFBool opt_predictor6WorkaroundEnable = OFFalse; + OFBool opt_cornellWorkaroundEnable = OFFalse; + OFBool opt_forceSingleFragmentPerFrame = OFFalse; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Decode JPEG-compressed DICOM file", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("color space conversion:"); + cmd.addOption("--conv-photometric", "+cp", "convert if YCbCr photometric interpr. (default)"); + cmd.addOption("--conv-lossy", "+cl", "convert YCbCr to RGB if lossy JPEG"); + cmd.addOption("--conv-guess", "+cg", "convert to RGB if YCbCr is guessed by library"); + cmd.addOption("--conv-guess-lossy", "+cgl", "convert to RGB if lossy JPEG and YCbCr is\nguessed by the underlying JPEG library"); + cmd.addOption("--conv-always", "+ca", "always convert YCbCr to RGB"); + cmd.addOption("--conv-never", "+cn", "never convert YCbCr to RGB"); + + cmd.addSubGroup("planar configuration:"); + cmd.addOption("--planar-auto", "+pa", "automatically determine planar configuration\nfrom SOP class and color space (default)"); + cmd.addOption("--color-by-pixel", "+px", "always store color-by-pixel"); + cmd.addOption("--color-by-plane", "+pl", "always store color-by-plane"); + + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-default", "+ud", "keep same SOP Instance UID (default)"); + cmd.addOption("--uid-always", "+ua", "always assign new UID"); + + cmd.addSubGroup("workaround options for incorrect JPEG encodings:"); + cmd.addOption("--workaround-pred6", "+w6", "enable workaround for JPEG lossless images\nwith overflow in predictor 6"); + cmd.addOption("--workaround-incpl", "+wi", "enable workaround for incomplete JPEG data"); + cmd.addOption("--workaround-cornell", "+wc", "enable workaround for 16-bit JPEG lossless\nCornell images with Huffman table overflow"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian (default)"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* options */ + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--planar-auto")) opt_planarconfig = EPC_default; + if (cmd.findOption("--color-by-pixel")) opt_planarconfig = EPC_colorByPixel; + if (cmd.findOption("--color-by-plane")) opt_planarconfig = EPC_colorByPlane; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--conv-photometric")) opt_decompCSconversion = EDC_photometricInterpretation; + if (cmd.findOption("--conv-lossy")) opt_decompCSconversion = EDC_lossyOnly; + if (cmd.findOption("--conv-guess")) opt_decompCSconversion = EDC_guess; + if (cmd.findOption("--conv-guess-lossy")) opt_decompCSconversion = EDC_guessLossyOnly; + if (cmd.findOption("--conv-always")) opt_decompCSconversion = EDC_always; + if (cmd.findOption("--conv-never")) opt_decompCSconversion = EDC_never; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-default")) opt_uidcreation = EUC_default; + if (cmd.findOption("--uid-always")) opt_uidcreation = EUC_always; + cmd.endOptionBlock(); + + if (cmd.findOption("--workaround-pred6")) opt_predictor6WorkaroundEnable = OFTrue; + if (cmd.findOption("--workaround-incpl")) opt_forceSingleFragmentPerFrame = OFTrue; + if (cmd.findOption("--workaround-cornell")) opt_cornellWorkaroundEnable = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) + { + opt_readMode = ERM_autoDetect; + opt_ixfer = EXS_Unknown; + } + if (cmd.findOption("--read-file-only")) + { + opt_readMode = ERM_fileOnly; + opt_ixfer = EXS_Unknown; + } + if (cmd.findOption("--read-dataset")) + { + opt_readMode = ERM_dataset; + + // we don't know the real transfer syntax of the dataset, but this does + // not matter. As long as the content of encapsulated pixel sequences is + // some kind of JPEG bitstream supported by the underlying library, the + // decompression will work. So we simply choose one of the lossless + // transfer syntaxes, because these support all bit depths up to 16. + opt_ixfer = EXS_JPEGProcess14; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_opadenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmdjpegLogger, rcsid << OFendl); + + // register global decompression codecs + DJDecoderRegistration::registerCodecs( + opt_decompCSconversion, + opt_uidcreation, + opt_planarconfig, + opt_predictor6WorkaroundEnable, + opt_cornellWorkaroundEnable, + opt_forceSingleFragmentPerFrame); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmdjpegLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open inputfile + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmdjpegLogger, "invalid filename: "); + return 1; + } + + OFCondition error = EC_Normal; + + DcmFileFormat fileformat; + + OFLOG_INFO(dcmdjpegLogger, "reading input file " << opt_ifname); + + error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (error.bad()) + { + OFLOG_FATAL(dcmdjpegLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + DcmDataset *dataset = fileformat.getDataset(); + + OFLOG_INFO(dcmdjpegLogger, "decompressing file"); + + DcmXfer opt_oxferSyn(opt_oxfer); + DcmXfer original_xfer(dataset->getOriginalXfer()); + + error = dataset->chooseRepresentation(opt_oxfer, NULL); + if (error.bad()) + { + OFLOG_FATAL(dcmdjpegLogger, error.text() << ": decompressing file: " << opt_ifname); + if (error == EJ_UnsupportedColorConversion) + OFLOG_FATAL(dcmdjpegLogger, "Try --conv-never to disable color space conversion"); + else if (error == EC_CannotChangeRepresentation) + OFLOG_FATAL(dcmdjpegLogger, "Input transfer syntax " << original_xfer.getXferName() << " not supported"); + return 1; + } + + if (! dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_FATAL(dcmdjpegLogger, "no conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible"); + return 1; + } + + OFLOG_INFO(dcmdjpegLogger, "creating output file " << opt_ofname); + + // update file meta information with new SOP Instance UID + if ((opt_uidcreation == EUC_always) && (opt_writeMode == EWM_fileformat)) + opt_writeMode = EWM_updateMeta; + + fileformat.loadAllDataIntoMemory(); + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, + opt_opadenc, OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + if (error != EC_Normal) + { + OFLOG_FATAL(dcmdjpegLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmdjpegLogger, "conversion successful"); + + // deregister global decompression codecs + DJDecoderRegistration::cleanup(); + + return 0; +} diff --git a/dcmjpeg/apps/dcmj2pnm.cc b/dcmjpeg/apps/dcmj2pnm.cc new file mode 100644 index 00000000..69ee1b0a --- /dev/null +++ b/dcmjpeg/apps/dcmj2pnm.cc @@ -0,0 +1,27 @@ +/* + * + * Copyright (C) 2001-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Authors: Joerg Riesmeier + * + * Purpose: Convert DICOM Images to PPM or PGM using the dcmimage/dcmjpeg library. + * + */ + + +// compile "dcm2pnm" with dcmjpeg support +#define BUILD_DCM2PNM_AS_DCMJ2PNM + +// include full implementation of "dcm2pnm" +#include "../../dcmimage/apps/dcm2pnm.cc" diff --git a/dcmjpeg/apps/dcmmkdir.cc b/dcmjpeg/apps/dcmmkdir.cc new file mode 100644 index 00000000..d8a3514f --- /dev/null +++ b/dcmjpeg/apps/dcmmkdir.cc @@ -0,0 +1,47 @@ +/* + * + * Copyright (C) 2001-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Authors: Joerg Riesmeier + * + * Make a DICOMDIR according to the DICOM Part 11 Media Storage Application + * Profiles. Currently supports the following profiles: + * - General Purpose CD-R Interchange (STD-GEN-CD) + * - General Purpose Interchange on DVD-RAM Media (STD-GEN-DVD-RAM) + * - General Purpose DVD with Compression Interchange (STD-GEN-DVD-JPEG/J2K) + * - General Purpose USB and Flash Memory with Compression Interchange (STD-GEN-USB/MMC/CF/SD-JPEG/J2K) + * - General Purpose MIME Interchange (STD-GEN-MIME) + * - DVD Interchange with MPEG2 MP@ML (STD-DVD-MPEG2-MPML) + * - Basic Cardiac X-Ray Angiographic Studies on CD-R Media (STD-XABC-CD) + * - 1024 X-Ray Angiographic Studies on CD-R Media (STD-XA1K-CD) + * - 1024 X-Ray Angiographic Studies on DVD Media (STD-XA1K-DVD) + * - Dental Radiograph Interchange (STD-DEN-CD) + * - CT/MR Studies on various Media (STD-CTMR-xxxx) + * - Ultrasound Single Frame for Image Display (STD-US-ID-SF-xxxx) + * - Ultrasound Single Frame with Spatial Calibration (STD-US-SC-SF-xxxx) + * - Ultrasound Single Frame with Combined Calibration (STD-US-CC-SF-xxxx) + * - Ultrasound Single & Multi-Frame for Image Display (STD-US-ID-MF-xxxx) + * - Ultrasound Single & Multi-Frame with Spatial Calibration (STD-US-SC-MF-xxxx) + * - Ultrasound Single & Multi-Frame with Combined Calibration (STD-US-CC-MF-xxxx) + * - 12-lead ECG Interchange on Diskette (STD-WVFM-ECG-FD) + * - Hemodynamic Waveform Interchange on Diskette (STD-WVFM-HD-FD) + * + */ + + +// compile "dcmgpdir" with dcmjpeg support +#define BUILD_DCMGPDIR_AS_DCMMKDIR + +// include full implementation of "dcmgpdir" +#include "../../dcmdata/apps/dcmgpdir.cc" diff --git a/dcmjpeg/configure b/dcmjpeg/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmjpeg/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmjpeg/data/Makefile.in b/dcmjpeg/data/Makefile.in new file mode 100644 index 00000000..78e447e8 --- /dev/null +++ b/dcmjpeg/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmjpeg/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpeg/docs/Makefile.in b/dcmjpeg/docs/Makefile.in new file mode 100644 index 00000000..7bd104a8 --- /dev/null +++ b/dcmjpeg/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmjpeg/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpeg/docs/dcmcjpeg.man b/dcmjpeg/docs/dcmcjpeg.man new file mode 100644 index 00000000..b23852af --- /dev/null +++ b/dcmjpeg/docs/dcmcjpeg.man @@ -0,0 +1,706 @@ +/*! + +\if MANPAGES +\page dcmcjpeg Encode DICOM file to JPEG transfer syntax +\else +\page dcmcjpeg dcmcjpeg: Encode DICOM file to JPEG transfer syntax +\endif + +\section dcmcjpeg_synopsis SYNOPSIS + +\verbatim +dcmcjpeg [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmcjpeg_description DESCRIPTION + +The \b dcmcjpeg utility reads an uncompressed DICOM image (\e dcmfile-in), +performs a JPEG compression (i. e. conversion to an encapsulated DICOM transfer +syntax) and writes the converted image to an output file (\e dcmfile-out). + +\section dcmcjpeg_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmcjpeg_options OPTIONS + +\subsection dcmcjpeg_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmcjpeg_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS + +compatibility (ignored by +tl): + + +Ma --accept-acr-nema + accept ACR-NEMA images without photometric interpretation + + # Enables compatibility for old ACR-NEMA images without photometric + # information (only pseudo lossless encoder) + + +Mp --accept-palettes + accept incorrect palette attribute tags (0028,111x) and + (0028,121x) + + # If enabled, incorrect palette attribute tags are accepted + # (only pseudo lossless encoder) +\endverbatim + +\subsection dcmcjpeg_JPEG_encoding_options JPEG encoding options +\verbatim +JPEG process: + + +e1 --encode-lossless-sv1 + encode lossless sv1 (default) + + # This option selects the JPEG Lossless, Non-Hierarchical, First-Order + # Prediction (Process 14 Selection Value 1) Transfer Syntax for + # Lossless JPEG Image Compression. + + +el --encode-lossless + encode lossless + + # This option selects the JPEG Lossless, Non-Hierarchical (Process 14) + # Transfer Syntax for Lossless JPEG Image Compression. + + +eb --encode-baseline + encode baseline + + # This option selects the JPEG Baseline (Process 1) Transfer Syntax + # for Lossy JPEG 8 Bit Image Compression. + + +ee --encode-extended + encode extended sequential + + # This option selects the JPEG Extended (Process 2 & 4) Transfer + # Syntax for Lossy JPEG Image Compression. + + +es --encode-spectral + encode spectral selection + + # This option selects the JPEG Spectral Selection, Non-Hierarchical + # (Process 6 & 8) Transfer Syntax for Lossy JPEG Image Compression. + + +ep --encode-progressive + encode progressive + + # This option selects the JPEG Full Progression, Non-Hierarchical + # (Process 10 & 12) Transfer Syntax for Lossy JPEG Image Compression. + +lossless JPEG codec selection: + + +tl --true-lossless + true lossless codec (default) + + # This option selects an encoder, that guarantees truely lossless + # image compression. See NOTES for further information. + + +pl --pseudo-lossless + old pseudo-lossless codec + + # Old encoder, that uses lossless compression algorithms, but can + # cause lossy images because of internal color space transformations + # etc. Higher compression ratio than --true-lossless in most cases. + +lossless JPEG representation: + + +sv --selection-value [sv]: integer (1..7, default: 6) + use selection value sv only with --encode-lossless + + # This option selects the selection value for lossless JPEG. + + +pt --point-transform [pt]: integer (0..15, default: 0) + use point transform pt + + # This option selects the point transform for lossless JPEG. + # WARNING: Using this option with a value other than zero causes + # a loss of precision, i. e. makes the compression "lossy". + +lossy JPEG representation: + + +q --quality [q]: integer (0..100, default: 90) + use quality factor q + + # This option selects the quality factor used to determine the + # quantization table inside the JPEG compressor, which affects + # compression ratio and image quality in lossy JPEG. + # See documentation of the Independent JPEG Group for details. + + +sm --smooth [s]: integer (0..100, default: 0) + use smoothing factor s + + # This option enables a smoothing (low-pass filter) of the image data + # prior to compression. Increases the compression ratio at the expense + # of image quality. + +other JPEG options: + + +ho --huffman-optimize + optimize huffman tables (default) + + # This option enables an optimization of the huffman tables during + # image compression. It results in a slightly smaller image at a small + # increase of CPU time. Always on if bits/sample is larger than 8. + + -ho --huffman-standard + use standard huffman tables if 8 bits/sample + + # This option disables an optimization of the huffman tables during + # image compression. + +compressed bits per sample (always +ba with +tl): + + +ba --bits-auto + choose bits/sample automatically (default) + + +be --bits-force-8 + force 8 bits/sample + + +bt --bits-force-12 + force 12 bits/sample (not with baseline) + + +bs --bits-force-16 + force 16 bits/sample (lossless only) + +compression color space conversion (overridden by +tl): + + +cy --color-ybr + use YCbCr for color images if lossy (default) + + # This option enables a transformation of the color space to YCbCr + # prior to image compression for color images in lossy JPEG. + + +cr --color-rgb + use RGB for color images if lossy + + # This option prevents the transformation of the color space to YCbCr + # prior to image compression for color images in lossy JPEG. It causes + # lossy image compression in the RGB color space which is not + # recommendable. + + +cm --monochrome + convert color images to monochrome + + # This option forces a conversion of color images to monochrome + # prior to compression. + +decompression color space conversion +(if input is compressed; always +cn with +tl): + + +cp --conv-photometric + convert if YCbCr photometric interpretation (default) + + # This option describes the behavior of dcmcjpeg when a compressed + # image is read and decompressed prior to re-compression. If the + # compressed image uses YBR_FULL or YBR_FULL_422 photometric + # interpretation, it is converted to RGB during decompression. + + +cl --conv-lossy + convert YCbCr to RGB if lossy JPEG + + # If the compressed image is encoded in lossy JPEG, assume YCbCr + # color model and convert to RGB. + + +cg --conv-guess + convert to RGB if YCbCr is guessed by library + + # If the underlying JPEG library "guesses" the color space of the + # compressed image to be YCbCr, convert to RGB. + + +cgl --conv-guess-lossy + convert to RGB if lossy JPEG and YCbCr is + guessed by the underlying JPEG library + + # If the compressed image is encoded in lossy JPEG and the underlying + # JPEG library "guesses" the color space to be YCbCr, convert to RGB. + + +ca --conv-always + always convert YCbCr to RGB + + # If the compressed image is a color image, assume YCbCr color model + # and convert to RGB. + + +cn --conv-never + never convert color space + + # Never convert color space during decompression. + +decompr. workaround options for incorrect encodings (if input is compressed): + + +w6 --workaround-pred6 + enable workaround for JPEG lossless images + with overflow in predictor 6 + + # DICOM images with 16 bits/pixel have been observed "in the wild" + # that are compressed with lossless JPEG and need special handling + # because the encoder produced an 16-bit integer overflow in predictor + # 6, which needs to be compensated (reproduced) during decompression. + # This flag enables a correct decompression of such faulty images, but + # at the same time will cause an incorrect decompression of correctly + # compressed images. Use with care. + + +wi --workaround-incpl + enable workaround for incomplete JPEG data + + # This option causes dcmjpeg to ignore incomplete JPEG data + # at the end of a compressed fragment and to start decompressing + # the next frame from the next fragment (if any). This permits + # images with incomplete JPEG data to be decoded. + + +wc --workaround-cornell + enable workaround for 16-bit JPEG lossless + Cornell images with Huffman table overflow + + # One of the first open-source implementations of lossless JPEG + # compression, the "Cornell" library, has a well-known bug that leads + # to invalid values in the Huffmann table when images with 16 bit/sample + # are compressed. This flag enables a workaround that permits such + # images to be decoded correctly. + +YCbCr component subsampling (lossy JPEG only): + + +s2 --sample-422 + 4:2:2 subsampling with YBR_FULL_422 (default) + + # This option enables a 4:2:2 color component subsampling for + # compression in the YCbCr color space. The DICOM photometric + # interpretation is encoded as YBR_FULL_422. + +non-standard YCbCr component subsampling (not with +tl): + + +s4 --nonstd-444 + 4:4:4 sampling with YBR_FULL + + # This option disables color component subsampling for compression in + # the YCbCr color space. The DICOM photometric interpretation is + # encoded as YBR_FULL, which violates DICOM rules for lossy JPEG. + + +n2 --nonstd-422-full + 4:2:2 subsampling with YBR_FULL + + # This option enables a 4:2:2 color component subsampling for + # compression in the YCbCr color space. The DICOM photometric + # interpretation is encoded as YBR_FULL, which violates DICOM rules. + + +n1 --nonstd-411-full + 4:1:1 subsampling with YBR_FULL + + # This option enables a 4:1:1 color component subsampling for + # compression in the YCbCr color space. The DICOM photometric + # interpretation is encoded as YBR_FULL, which violates DICOM rules. + + +np --nonstd-411 + 4:1:1 subsampling with YBR_FULL_422 + + # This option enables a 4:1:1 color component subsampling for + # compression in the YCbCr color space. The DICOM photometric + # interpretation is encoded as YBR_FULL_422, which violates DICOM rules. +\endverbatim + +\subsection dcmcjpeg_enc_pix_data_encoding_opt encapsulated pixel data encoding options: +\verbatim +encapsulated pixel data fragmentation: + + +ff --fragment-per-frame + encode each frame as one fragment (default) + + # This option causes the creation of one compressed fragment for each + # frame (recommended). + + +fs --fragment-size [s]ize: integer + limit fragment size to s kbytes + + # This option limits the fragment size which may cause the creation of + # multiple fragments per frame. + +basic offset table encoding: + + +ot --offset-table-create + create offset table (default) + + # This option causes the creation of a valid offset table for the + # compressed JPEG fragments. + + -ot --offset-table-empty + leave offset table empty + + # This option causes the creation of an empty offset table + # for the compressed JPEG fragments. + +VOI windowing for monochrome images (not with +tl): + + -W --no-windowing + no VOI windowing (default) + + # No window level/width is "burned" into monochrome images prior to + # compression. See notes below on pixel scaling and rescale slope + # and intercept encoding. + + +Wi --use-window [n]umber: integer + use the n-th VOI window from image file + + # Apply the n-th window center/width encoded in the image data prior + # to compression. + + +Wl --use-voi-lut [n]umber: integer + use the n-th VOI look up table from image file + + # Apply the n-th VOI LUT encoded in the image data prior + # to compression. + + +Wm --min-max-window + compute VOI window using min-max algorithm + + # Compute and apply a window center and width that covers the + # range from the smallest to the largest occurring pixel value. + + +Wn --min-max-window-n + compute VOI window using min-max algorithm, + ignoring extreme values + + # Compute and apply a window center and width that covers the + # range from the second smallest to the second largest occurring + # pixel value. This is useful if the background is set to an + # artificial black (padding value) or if white overlays are burned + # into the image data which should not be considered for the window + # computation. + + +Wr --roi-min-max-window [l]eft [t]op [w]idth [h]eight: integer + compute ROI window using min-max algorithm, + region of interest is specified by l,t,w,h + + # This option works like --min-max-window but only considers the given + # region of interest inside the image. + + +Wh --histogram-window [n]umber: integer + compute VOI window using Histogram algorithm, + ignoring n percent + + # Compute a histogram of the image data and apply window center + # and width such than n% of the image data are ignored for the window + # computation + + +Ww --set-window [c]enter [w]idth: float + compute VOI window using center c and width w + + # Apply the given window center/width prior to compression. + +pixel scaling for monochrome images (--no-windowing; ignored by +tl): + + +sp --scaling-pixel + scale using min/max pixel value (default) + + # Monochrome image pixel values are always scaled to make use of the + # pixel range available with the selected JPEG process as good as + # possible. This option selects a scaling based on the minimum and + # maximum pixel value occurring in the image. This often leads to + # significantly better image quality, but may cause different + # compressed images within one series to have different values for + # rescale slope and intercept, which is a problem if a presentation + # state for one series is to be created. + + +sr --scaling-range + scale using min/max range + + # This options selects a scaling based on the pixel range as defined + # by the stored bits, pixel representation and modality transform, + # without consideration of the minimum and maximum value really + # used within the image. + +rescale slope/intercept encoding for monochrome (-W; ignored by +tl): + + +ri --rescale-identity + encode identity modality rescale (default) + Never used for CT images + + # This options prevents the creation of a modality transformation + # other than an identity transformation (which is required for + # many DICOM IODs). Window center/width settings encoded + # in the image are adapted, VOI LUTs are removed. + + +rm --rescale-map + use modality rescale to scale pixel range + Never used for XA/RF/XA Biplane images + + # This option causes the creation of a modality rescale slope and + # intercept that maps the decompressed image data back to their + # original range. This keeps all VOI transformations valid but + # requires that the DICOM IOD supports a modality rescale slope + # and intercept transformation other than identity. + +SOP Class UID: + + +cd --class-default + keep SOP Class UID (default) + + # Keep the SOP Class UID of the source image. + + +cs --class-sc + convert to Secondary Capture Image (implies --uid-always) + + # Convert the image to Secondary Capture. In addition to the SOP + # Class UID, all attributes required for a valid secondary capture + # image are added. A new SOP instance UID is always assigned. + +SOP Instance UID: + + +ud --uid-default + assign new UID if lossy compression (default) + + # Assigns a new SOP instance UID if the compression is lossy. + + +ua --uid-always + always assign new UID + + # Unconditionally assigns a new SOP instance UID. + + +un --uid-never + never assign new UID + + # Never assigns a new SOP instance UID. +\endverbatim + +\subsection dcmcjpeg_output_options output options +\verbatim +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding: + + -p= --padding-retain + do not change padding (default) + + -p --padding-off + no padding + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section dcmcjpeg_notes NOTES + +The \b dcmcjpeg utility compresses DICOM images of all SOP classes. It +processes all Pixel Data (7fe0,0010) elements in the dataset, i.e. compression +is also performed on an icon image. Special handling has been implemented for +CT images (where the modality transformation is required to create Hounsfield +units) and the XA/RF/Biplane SOP classes (where the modality transformation has +"inversed" semantics). However, \b dcmcjpeg does not attempt to ensure that the +compressed image still complies with all restrictions of the object's IOD. + +A few examples: + +\li MR images are required to have BitsAllocated=16. +\li NM Images can only be encoded with MONOCHROME2 or PALETTE COLOR photometric + interpretation but not with RGB or YBR_FULL (which effectively prevents + compression). +\li Hardcopy Color images must have RGB color model which is a problem if lossy + compression is to be performed. + +The user is responsible for making sure that the compressed images he creates +are compliant with the DICOM standard. If in question, the \b dcmcjpeg utility +allows one to convert an image to secondary capture - this SOP class does not +pose restrictions as the ones mentioned above. + +With version DCMTK 3.5.4 a new encoder for truly lossless JPEG compression was +added (\e --true-lossless). Compared to the old (\e --pseudo-lossless) encoder, +that creates slightly lossy images caused from internal color space conversions, +windowing etc., there are a some issues to consider: + +\li Only source images with Bits Allocated 8 or 16 are supported +\li Options for color space conversions, windowing or pixel scaling are + ignored or overridden +\li Photometric Interpretations YBR_FULL_422, YBR_PARTIAL_422, YBR_PARTIAL_420, + YBR_ICT, YBR_RCT are not supported +\li The encoder changes automatically Planar Configuration from 1 to 0 if + necessary +\li The compression ratio can be lower than in \e --pseudo-lossless mode + +However, when using the new encoder (default), you can be sure, that +compression does not affect image quality. + +In order to be on the safe side, the Lossy Compression Flag is always set to +"01" and a new SOP instance UID is assigned (by default) for the old +pseudo-lossless encoder. The output of the old and new lossless encoder can +also be distinguished by the Derivation Description in the resulting DICOM +image, which contains the term "Lossless JPEG compression" for the new and +"Pseudo-Lossless JPEG compression" for the old encoder. + +\section dcmcjpeg_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmcjpeg supports the following transfer syntaxes for input +(\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +JPEGProcess1TransferSyntax 1.2.840.10008.1.2.4.50 +JPEGProcess2_4TransferSyntax 1.2.840.10008.1.2.4.51 +JPEGProcess6_8TransferSyntax 1.2.840.10008.1.2.4.53 +JPEGProcess10_12TransferSyntax 1.2.840.10008.1.2.4.55 +JPEGProcess14TransferSyntax 1.2.840.10008.1.2.4.57 +JPEGProcess14SV1TransferSyntax 1.2.840.10008.1.2.4.70 +\endverbatim + +(*) if compiled with zlib support enabled + +\b dcmcjpeg supports the following transfer syntaxes for output +(\e dcmfile-out): + +\verbatim +JPEGProcess1TransferSyntax 1.2.840.10008.1.2.4.50 +JPEGProcess2_4TransferSyntax 1.2.840.10008.1.2.4.51 +JPEGProcess6_8TransferSyntax 1.2.840.10008.1.2.4.53 +JPEGProcess10_12TransferSyntax 1.2.840.10008.1.2.4.55 +JPEGProcess14TransferSyntax 1.2.840.10008.1.2.4.57 +JPEGProcess14SV1TransferSyntax 1.2.840.10008.1.2.4.70 +\endverbatim + +\section dcmcjpeg_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmcjpeg_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmcjpeg_environment ENVIRONMENT + +The \b dcmcjpeg utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmcjpeg_see_also SEE ALSO + +dcmdjpeg(1) + +\section dcmcjpeg_copyright COPYRIGHT + +Copyright (C) 2001-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmjpeg/docs/dcmdjpeg.man b/dcmjpeg/docs/dcmdjpeg.man new file mode 100644 index 00000000..57906cb2 --- /dev/null +++ b/dcmjpeg/docs/dcmdjpeg.man @@ -0,0 +1,349 @@ +/*! + +\if MANPAGES +\page dcmdjpeg Decode JPEG-compressed DICOM file +\else +\page dcmdjpeg dcmdjpeg: Decode JPEG-compressed DICOM file +\endif + +\section dcmdjpeg_synopsis SYNOPSIS + +\verbatim +dcmdjpeg [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmdjpeg_description DESCRIPTION + +The \b dcmdjpeg utility reads a JPEG-compressed DICOM image (\e dcmfile-in), +decompresses the JPEG data (i. e. conversion to a native DICOM transfer syntax) +and writes the converted image to an output file (\e dcmfile-out). + +\section dcmdjpeg_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmdjpeg_options OPTIONS + +\subsection dcmdjpeg_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmdjpeg_input_options input options + +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + + # This option allows one to decompress JPEG compressed DICOM objects that + # have been stored as dataset without meta-header. Such a thing should + # not exist since the transfer syntax cannot be reliably determined, + # without meta-header but unfortunately it does. +\endverbatim + +\subsection dcmdjpeg_processing_options processing options + +\verbatim +color space conversion: + + +cp --conv-photometric + convert if YCbCr photometric interpretation (default) + + # If the compressed image uses YBR_FULL or YBR_FULL_422 photometric + # interpretation, convert to RGB during decompression. + + +cl --conv-lossy + convert YCbCr to RGB if lossy JPEG + + # If the compressed image is encoded in lossy JPEG, assume YCbCr + # color model and convert to RGB. + + +cg --conv-guess + convert to RGB if YCbCr is guessed by library + + # If the underlying JPEG library "guesses" the color space of the + # compressed image to be YCbCr, convert to RGB. + + +cgl --conv-guess-lossy + convert to RGB if lossy JPEG and YCbCr is + guessed by the underlying JPEG library + + # If the compressed image is encoded in lossy JPEG and the underlying + # JPEG library "guesses" the color space to be YCbCr, convert to RGB. + + +ca --conv-always + always convert YCbCr to RGB + + # If the compressed image is a color image, assume YCbCr color model + # and convert to RGB. + + +cn --conv-never + never convert YCbCr to RGB + + # Never convert color space from YCbCr to RGB during decompression. + # Note that a conversion from YBR_FULL_422 to YBR_FULL will still take + # place if the source images has been compressed with subsampling. + +planar configuration: + + +pa --planar-auto + automatically determine planar configuration + from SOP class and color space (default) + + # If the compressed image is a color image, store in color-by-plane + # planar configuration if required by the SOP class and photometric + # interpretation. Hardcopy Color images are always stored color-by- + # plane, and the revised Ultrasound image objects are stored color-by- + # plane if the color model is YBR_FULL. Everything else is stored + # color-by-pixel. + + +px --color-by-pixel + always store color-by-pixel + + # If the compressed image is a color image, store in color-by-pixel + # planar configuration. + + +pl --color-by-plane + always store color-by-plane + + # If the compressed image is a color image, store in color-by-plane + # planar configuration. + +SOP Instance UID: + + +ud --uid-default + keep same SOP Instance UID (default) + + # Never assigns a new SOP instance UID. + + +ua --uid-always + always assign new UID + + # Always assigns a new SOP instance UID. + +workaround options for incorrect JPEG encodings: + + +w6 --workaround-pred6 + enable workaround for JPEG lossless images + with overflow in predictor 6 + + # DICOM images with 16 bits/pixel have been observed "in the wild" + # that are compressed with lossless JPEG and need special handling + # because the encoder produced an 16-bit integer overflow in predictor + # 6, which needs to be compensated (reproduced) during decompression. + # This flag enables a correct decompression of such faulty images, but + # at the same time will cause an incorrect decompression of correctly + # compressed images. Use with care. + + +wi --workaround-incpl + enable workaround for incomplete JPEG data + + # This option causes dcmjpeg to ignore incomplete JPEG data + # at the end of a compressed fragment and to start decompressing + # the next frame from the next fragment (if any). This permits + # images with incomplete JPEG data to be decoded. + + +wc --workaround-cornell + enable workaround for 16-bit JPEG lossless + Cornell images with Huffman table overflow + + # One of the first open-source implementations of lossless JPEG + # compression, the "Cornell" library, has a well-known bug that leads + # to invalid values in the Huffmann table when images with 16 bit/sample + # are compressed. This flag enables a workaround that permits such + # images to be decoded correctly. + +\endverbatim + +\subsection dcmdjpeg_output_options output options + +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +te --write-xfer-little + write with explicit VR little endian (default) + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section dcmdjpeg_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmdjpeg supports the following transfer syntaxes for input +(\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +JPEGProcess1TransferSyntax 1.2.840.10008.1.2.4.50 +JPEGProcess2_4TransferSyntax 1.2.840.10008.1.2.4.51 +JPEGProcess6_8TransferSyntax 1.2.840.10008.1.2.4.53 +JPEGProcess10_12TransferSyntax 1.2.840.10008.1.2.4.55 +JPEGProcess14TransferSyntax 1.2.840.10008.1.2.4.57 +JPEGProcess14SV1TransferSyntax 1.2.840.10008.1.2.4.70 +\endverbatim + +(*) if compiled with zlib support enabled + +\b dcmdjpeg supports the following transfer syntaxes for output +(\e dcmfile-out): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +\section dcmdjpeg_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmdjpeg_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmdjpeg_environment ENVIRONMENT + +The \b dcmdjpeg utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmdjpeg_see_also SEE ALSO + +dcmcjpeg(1) + +\section dcmdjpeg_copyright COPYRIGHT + +Copyright (C) 2001-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmjpeg/docs/dcmj2pnm.man b/dcmjpeg/docs/dcmj2pnm.man new file mode 100644 index 00000000..7804b8bc --- /dev/null +++ b/dcmjpeg/docs/dcmj2pnm.man @@ -0,0 +1,579 @@ +/*! + +\if MANPAGES +\page dcmj2pnm Convert DICOM images to PGM/PPM, PNG, TIFF, JPEG or BMP +\else +\page dcmj2pnm dcmj2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF, JPEG or BMP +\endif + +\section dcmj2pnm_synopsis SYNOPSIS + +\verbatim +dcmj2pnm [options] dcmfile-in [bitmap-out] +\endverbatim + +\section dcmj2pnm_description DESCRIPTION + +The \b dcmj2pnm utility reads a DICOM image, converts the pixel data according +to the selected image processing options and writes back an image in the +well-known PGM/PPM (portable gray map / portable pix map), PNG, TIFF, JPEG +(Joint Photographic Experts Group) or Windows BMP format. This utility +supports uncompressed as well as JPEG and RLE compressed DICOM images. + +\section dcmj2pnm_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +bitmap-out output filename to be written (default: stdout) +\endverbatim + +\section dcmj2pnm_options OPTIONS + +\subsection dcmj2pnm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmj2pnm_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmj2pnm_image_processing_options image processing options +\verbatim +frame selection: + + +F --frame [n]umber: integer + select specified frame (default: 1) + + +Fr --frame-range [n]umber [c]ount: integer + select c frames beginning with frame n + + +Fa --all-frames + select all frames + +rotation: + + +Rl --rotate-left + rotate image left (-90 degrees) + + +Rr --rotate-right + rotate image right (+90 degrees) + + +Rtd --rotate-top-down + rotate image top-down (180 degrees) + +flipping: + + +Lh --flip-horizontally + flip image horizontally + + +Lv --flip-vertically + flip image vertically + + +Lhv --flip-both-axes + flip image horizontally and vertically + +scaling: + + +a --recognize-aspect + recognize pixel aspect ratio (default) + + -a --ignore-aspect + ignore pixel aspect ratio when scaling + + +i --interpolate [n]umber of algorithm: integer + use interpolation when scaling (1..4, default: 1) + + -i --no-interpolation + no interpolation when scaling + + -S --no-scaling + no scaling, ignore pixel aspect ratio (default) + + +Sxf --scale-x-factor [f]actor: float + scale x axis by factor, auto-compute y axis + + +Syf --scale-y-factor [f]actor: float + scale y axis by factor, auto-compute x axis + + +Sxv --scale-x-size [n]umber: integer + scale x axis to n pixels, auto-compute y axis + + +Syv --scale-y-size [n]umber: integer + scale y axis to n pixels, auto-compute x axis + +color space conversion (JPEG compressed images only): + + +cp --conv-photometric + convert if YCbCr photometric interpretation (default) + + +cl --conv-lossy + convert YCbCr to RGB if lossy JPEG + + +cg --conv-guess + convert to RGB if YCbCr is guessed by library + + +cgl --conv-guess-lossy + convert to RGB if lossy JPEG and YCbCr is + guessed by the underlying JPEG library + + +ca --conv-always + always convert YCbCr to RGB + + +cn --conv-never + never convert color space + +workaround options for incorrect encodings (JPEG compressed images only): + + +w6 --workaround-pred6 + enable workaround for JPEG lossless images + with overflow in predictor 6 + + # DICOM images with 16 bits/pixel have been observed "in the wild" + # that are compressed with lossless JPEG and need special handling + # because the encoder produced an 16-bit integer overflow in predictor + # 6, which needs to be compensated (reproduced) during decompression. + # This flag enables a correct decompression of such faulty images, but + # at the same time will cause an incorrect decompression of correctly + # compressed images. Use with care. + + +wi --workaround-incpl + enable workaround for incomplete JPEG data + + # This option causes dcmj2pnm to ignore incomplete JPEG data + # at the end of a compressed fragment and to start decompressing + # the next frame from the next fragment (if any). This permits + # images with incomplete JPEG data to be decoded. + + +wc --workaround-cornell + enable workaround for 16-bit JPEG lossless + Cornell images with Huffman table overflow + + # One of the first open-source implementations of lossless JPEG + # compression, the "Cornell" library, has a well-known bug that leads + # to invalid values in the Huffmann table when images with 16 bit/sample + # are compressed. This flag enables a workaround that permits such + # images to be decoded correctly. + +modality LUT transformation: + + -M --no-modality + ignore stored modality LUT transformation + + +M --use-modality + use modality LUT transformation (default) + +VOI LUT transformation: + + -W --no-windowing + no VOI windowing (default) + + +Wi --use-window [n]umber: integer + use the n-th VOI window from image file + + +Wl --use-voi-lut [n]umber: integer + use the n-th VOI look up table from image file + + +Wm --min-max-window + compute VOI window using min-max algorithm + + +Wn --min-max-window-n + compute VOI window using min-max algorithm, + ignoring extreme values + + +Wr --roi-min-max-window [l]eft [t]op [w]idth [h]eight: integer + compute ROI window using min-max algorithm, + region of interest is specified by l,t,w,h + + +Wh --histogram-window [n]umber: integer + compute VOI window using Histogram algorithm, + ignoring n percent + + +Ww --set-window [c]enter [w]idth: float + compute VOI window using center c and width w + + +Wfl --linear-function + set VOI LUT function to LINEAR + + +Wfs --sigmoid-function + set VOI LUT function to SIGMOID + +presentation LUT transformation: + + +Pid --identity-shape + set presentation LUT shape to IDENTITY + + +Piv --inverse-shape + set presentation LUT shape to INVERSE + + +Pod --lin-od-shape + set presentation LUT shape to LIN OD + +overlay: + + -O --no-overlays + do not display overlays + + +O --display-overlay [n]umber: integer + display overlay n (0..16, 0=all, default: +O 0) + + +Omr --ovl-replace + use overlay mode "Replace" + (default for Graphic overlays) + + +Omt --ovl-threshold + use overlay mode "Threshold Replace" + + +Omc --ovl-complement + use overlay mode "Complement" + + +Omv --ovl-invert + use overlay mode "Invert Bitmap" + + +Omi --ovl-roi + use overlay mode "Region of Interest" + (default for ROI overlays) + + +Osf --set-foreground [d]ensity: float + set overlay foreground density (0..1, default: 1) + + +Ost --set-threshold [d]ensity: float + set overlay threshold density (0..1, default: 0.5) + +display LUT transformation: + + +Dm --monitor-file [f]ilename: string + calibrate output according to monitor characteristics + defined in f + + +Dp --printer-file [f]ilename: string + calibrate output according to printer characteristics + defined in f + + +Da --ambient-light [a]mbient light: float + ambient light value (cd/m^2, default: file f) + + +Di --illumination [i]llumination: float + illumination value (cd/m^2, default: file f) + + +Dn --min-density [m]inimum optical density: float + Dmin value (default: off, only with +Dp) + + +Dx --max-density [m]aximum optical density: float + Dmax value (default: off, only with +Dp) + + +Dg --gsd-function + use GSDF for calibration (default for +Dm/+Dp) + + +Dc --cielab-function + use CIELAB function for calibration + +compatibility: + + +Ma --accept-acr-nema + accept ACR-NEMA images without photometric + interpretation + + +Mp --accept-palettes + accept incorrect palette attribute tags + (0028,111x) and (0028,121x) + + +Mc --check-lut-depth + check 3rd value of the LUT descriptor, compare + with expected bit depth based on LUT data + + +Mm --ignore-mlut-depth + ignore 3rd value of the modality LUT descriptor, + determine bits per table entry automatically + + +Mv --ignore-vlut-depth + ignore 3rd value of the VOI LUT descriptor, + determine bits per table entry automatically + +TIFF format: + + +Tl --compr-lzw + LZW compression (default) + + +Tr --compr-rle + RLE compression + + +Tn --compr-none + uncompressed + + +Pd --predictor-default + no LZW predictor (default) + + +Pn --predictor-none + LZW predictor 1 (no prediction) + + +Ph --predictor-horz + LZW predictor 2 (horizontal differencing) + + +Rs --rows-per-strip [r]ows: integer (default: 0) + rows per strip, default 8K per strip + +PNG format: + + +il --interlace + create interlaced file (default) + + -il --nointerlace + create non-interlaced file + + +mf --meta-file + create PNG file meta information (default) + + -mf --meta-none + no PNG file meta information + +JPEG format: + + +Jq --compr-quality [q]uality: integer (0..100, default: 90) + quality value for compression (in percent) + + +Js4 --sample-444 + 4:4:4 sampling (no subsampling) + + +Js2 --sample-422 + 4:2:2 subsampling (horizontal subsampling of + chroma components, default) + + +Js1 --sample-411 + 4:1:1 subsampling (horizontal and vertical + subsampling of chroma components) + +other transformations: + + +G --grayscale + convert to grayscale if necessary + + +P --change-polarity + change polarity (invert pixel output) + + +C --clip-region [l]eft [t]op [w]idth [h]eight: integer + clip image region (l, t, w, h) +\endverbatim + +\subsection dcmj2pnm_output_options output options +\verbatim +general: + + -im --image-info + print image details (requires verbose mode) + + -o --no-output + do not create any output (useful with -im) + +filename generation (only with --frame-range or --all-frames): + + +Fc --use-frame-counter + use 0-based counter for filenames (default) + + +Fn --use-frame-number + use absolute frame number for filenames + +image format: + + +op --write-raw-pnm + write 8-bit binary PGM/PPM (default for files) + + +opb --write-8-bit-pnm + write 8-bit ASCII PGM/PPM (default for stdout) + + +opw --write-16-bit-pnm + write 16-bit ASCII PGM/PPM + + +opn --write-n-bit-pnm [n]umber: integer + write n-bit ASCII PGM/PPM (1..32) + + +ob --write-bmp + write 8-bit (monochrome) or 24-bit (color) BMP + + +obp --write-8-bit-bmp + write 8-bit palette BMP (monochrome only) + + +obt --write-24-bit-bmp + write 24-bit truecolor BMP + + +obr --write-32-bit-bmp + write 32-bit truecolor BMP + + +ot --write-tiff + write 8-bit (monochrome) or 24-bit (color) TIFF + + +on --write-png + write 8-bit (monochrome) or 24-bit (color) PNG + + +on2 --write-16-bit-png + write 16-bit (monochrome) or 48-bit (color) PNG + + +oj --write-jpeg + write 8-bit lossy JPEG (baseline) +\endverbatim + +\section dcmj2pnm_notes NOTES + +The following preferred interpolation algorithms can be selected using the +\e --interpolate option: + +\li 1 = free scaling algorithm with interpolation from pbmplus toolkit +\li 2 = free scaling algorithm with interpolation from c't magazine +\li 3 = magnification algorithm with bilinear interpolation from Eduard Stanescu +\li 4 = magnification algorithm with bicubic interpolation from Eduard Stanescu + +The \e --write-tiff option is only available when DCMTK has been configured +and compiled with support for the external \b libtiff TIFF library. The +availability of the TIFF compression options depends on the \b libtiff +configuration. In particular, the patented LZW algorithm may not be +available. + +The \e --write-png option is only available when DCMTK has been configured +and compiled with support for the external \b libpng PNG library. Option +\e --interlace enables progressive image view while loading the PNG file. +Only a few applications take care of the meta info (TEXT) in a PNG file. + +\section dcmj2pnm_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmj2pnm supports the following transfer syntaxes for input (\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +JPEGProcess1TransferSyntax 1.2.840.10008.1.2.4.50 +JPEGProcess2_4TransferSyntax 1.2.840.10008.1.2.4.51 +JPEGProcess6_8TransferSyntax 1.2.840.10008.1.2.4.53 +JPEGProcess10_12TransferSyntax 1.2.840.10008.1.2.4.55 +JPEGProcess14TransferSyntax 1.2.840.10008.1.2.4.57 +JPEGProcess14SV1TransferSyntax 1.2.840.10008.1.2.4.70 +RLELosslessTransferSyntax 1.2.840.10008.1.2.5 +\endverbatim + +(*) if compiled with zlib support enabled + +\section dcmj2pnm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmj2pnm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmj2pnm_environment ENVIRONMENT + +The \b dcmj2pnm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmj2pnm_files FILES + +\/camera.lut - sample characteristics file of a camera +\n\/monitor.lut - sample characteristics file of a monitor +\n\/printer.lut - sample characteristics file of a printer +\n\/scanner.lut - sample characteristics file of a scanner + +\section dcmj2pnm_see_also SEE ALSO + +dcm2pnm(1), img2dcm(1) + +\section dcmj2pnm_copyright COPYRIGHT + +Copyright (C) 2001-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmjpeg/docs/dcmjpeg.dox b/dcmjpeg/docs/dcmjpeg.dox new file mode 100644 index 00000000..147d3d09 --- /dev/null +++ b/dcmjpeg/docs/dcmjpeg.dox @@ -0,0 +1,73 @@ +/*! + +\page mod_dcmjpeg dcmjpeg: a compression/decompression library and utility apps + +This module contains classes that convert between uncompressed and JPEG +compressed representations (transfer syntaxes) of a DICOM image object. +Both lossless and lossy JPEG processes are supported. This module implements +a family of codecs that are derived from class DcmCodec and can be registered +in the codec list maintained in module dcmdata. + +The main interface classes are: +\li \b DJEncoderRegistration +\li \b DJDecoderRegistration +\li \b DJCodecEncoder +\li \b DJCodecDecoder + +\section Tools + +This module contains the following command line tools: +\li \ref dcmcjpeg +\li \ref dcmdjpeg +\li \ref dcmj2pnm +\li \ref dcmmkdir + +\section Examples + +The following example shows how to compress a DICOM image file with lossless JPEG: + +\code +DJEncoderRegistration::registerCodecs(); // register JPEG codecs +DcmFileFormat fileformat; +if (fileformat.loadFile("test.dcm").good()) +{ + DcmDataset *dataset = fileformat.getDataset(); + DcmItem *metaInfo = fileformat.getMetaInfo(); + DJ_RPLossless params; // codec parameters, we use the defaults + + // this causes the lossless JPEG version of the dataset to be created + if (dataset->chooseRepresentation(EXS_JPEGProcess14SV1, ¶ms).good() && + dataset->canWriteXfer(EXS_JPEGProcess14SV1)) + { + // force the meta-header UIDs to be re-generated when storing the file + // since the UIDs in the data set may have changed + delete metaInfo->remove(DCM_MediaStorageSOPClassUID); + delete metaInfo->remove(DCM_MediaStorageSOPInstanceUID); + + // store in lossless JPEG format + fileformat.saveFile("test_jpeg.dcm", EXS_JPEGProcess14SV1); + } +} +DJEncoderRegistration::cleanup(); // deregister JPEG codecs +\endcode + +The following example shows how to decompress a JPEG-compressed DICOM image file: + +\code +DJDecoderRegistration::registerCodecs(); // register JPEG codecs +DcmFileFormat fileformat; +if (fileformat.loadFile("test_jpeg.dcm").good()) +{ + DcmDataset *dataset = fileformat.getDataset(); + + // decompress data set if compressed + if (dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL).good() && + dataset->canWriteXfer(EXS_LittleEndianExplicit)) + { + fileformat.saveFile("test_decompressed.dcm", EXS_LittleEndianExplicit); + } +} +DJDecoderRegistration::cleanup(); // deregister JPEG codecs +\endcode + +*/ diff --git a/dcmjpeg/docs/dcmmkdir.man b/dcmjpeg/docs/dcmmkdir.man new file mode 100644 index 00000000..fce3a138 --- /dev/null +++ b/dcmjpeg/docs/dcmmkdir.man @@ -0,0 +1,482 @@ +/*! + +\if MANPAGES +\page dcmmkdir Create a DICOMDIR file +\else +\page dcmmkdir dcmmkdir: Create a DICOMDIR file +\endif + +\section dcmmkdir_synopsis SYNOPSIS + +\verbatim +dcmmkdir [options] [dcmfile-in...] +\endverbatim + +\section dcmmkdir_description DESCRIPTION + +The \b dcmmkdir utility creates a \e DICOMDIR file from the specified +referenced DICOM files according to the DICOM Part 11 Media Storage Application +Profiles. + +Currently the following profiles are supported (others might be added later): + +\li General Purpose CD-R Interchange (STD-GEN-CD) +\li General Purpose Interchange on DVD-RAM Media (STD-GEN-DVD-RAM) +\li General Purpose DVD Interchange with JPEG (STD-GEN-DVD-JPEG) +\li General Purpose DVD Interchange with JPEG 2000 (STD-GEN-DVD-J2K) +\li General Purpose BD Interchange with JPEG (STD-GEN-BD-JPEG) +\li General Purpose BD Interchange with JPEG 2000 (STD-GEN-BD-J2K) +\li General Purpose BD Interchange with MPEG2 MP\@ML (STD-GEN-BD-MPEG2-MPML) +\li General Purpose BD Interchange with MPEG2 MP\@HL (STD-GEN-BD-MPEG2-MPHL) +\li General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.1 + (STD-GEN-BD-MPEG4-HPLV41) +\li General Purpose BD Interchange with MPEG-4 AVC/H.264 BD-Compatible + HiP\@Level4.1 (STD-GEN-BD-MPEG4-HPLV41BD) +\li General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.2 for 2D + video (STD-GEN-BD-MPEG4-HPLV42-2D) +\li General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP\@Level4.2 for 3D + video (STD-GEN-BD-MPEG4-HPLV42-3D) +\li General Purpose BD Interchange with MPEG-4 AVC/H.264 Stereo HiP\@Level4.2 + (STD-GEN-BD-MPEG4-SHPLV42) +\li General Purpose USB and Flash Memory Interchange with JPEG + (STD-GEN-USB/MMC/CF/SD-JPEG) +\li General Purpose USB and Flash Memory Interchange with JPEG 2000 + (STD-GEN-USB/MMC/CF/SD-J2K) +\li General Purpose MIME Interchange (STD-GEN-MIME) +\li DVD Interchange with MPEG2 MP\@ML (STD-DVD-MPEG2-MPML) +\li Basic Cardiac X-Ray Angiographic Studies on CD-R Media (STD-XABC-CD) +\li 1024 X-Ray Angiographic Studies on CD-R Media (STD-XA1K-CD) +\li 1024 X-Ray Angiographic Studies on DVD Media (STD-XA1K-DVD) +\li Dental Radiograph Interchange (STD-DEN-CD) +\li CT/MR Studies on various Media (STD-CTMR-xxxx) +\li Ultrasound Single Frame for Image Display (STD-US-ID-SF-xxxx) +\li Ultrasound Single Frame with Spatial Calibration (STD-US-SC-SF-xxxx) +\li Ultrasound Single Frame with Combined Calibration (STD-US-CC-SF-xxxx) +\li Ultrasound Single & Multi-Frame for Image Display (STD-US-ID-MF-xxxx) +\li Ultrasound Single & Multi-Frame with Spatial Calibration + (STD-US-SC-MF-xxxx) +\li Ultrasound Single & Multi-Frame with Combined Calibration + (STD-US-CC-MF-xxxx) +\li 12-lead ECG Interchange on Diskette (STD-WVFM-ECG-FD) +\li Hemodynamic Waveform Interchange on Diskette (STD-WVFM-HD-FD) + +This tool extends \b dcmgpdir which can only create General Purpose \e DICOMDIR +files. The default behavior of \b dcmmkdir (with \e --general-purpose) is +equivalent to that of \b dcmgpdir. + +\section dcmmkdir_parameters PARAMETERS + +\verbatim +dcmfile-in referenced DICOM file (or directory to be scanned) +\endverbatim + +\section dcmmkdir_options OPTIONS +\subsection dcmmkdir_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmmkdir_input_options input options +\verbatim +DICOMDIR identifiers: + + +F --fileset-id [i]d: string + use specific file-set ID + (default: DCMTK_MEDIA_DEMO, "" for none) + + +R --descriptor [f]ilename: string + add a file-set descriptor file ID + (e.g. README, default: no descriptor) + + +C --char-set [c]harset: string + add a specific character set for descriptor + (default: "ISO_IR 100" if descriptor present) + +reading: + + +id --input-directory [d]irectory: string + read referenced DICOM files from directory d + (default for --recurse: current directory) + + -m --keep-filenames + expect filenames to be in DICOM format (default) + + +m --map-filenames + map to DICOM filenames (lowercase->uppercase, + and remove trailing period) + + -r --no-recurse + do not recurse within directories (default) + + +r --recurse + recurse within filesystem directories + + +p --pattern [p]attern: string (only with --recurse) + pattern for filename matching (wildcards) + + # possibly not available on all systems +\endverbatim + +\subsection dcmmkdir_processing_options processing options +\verbatim +consistency check: + + -W --no-consistency-check + do not check files for consistency + + +W --warn-inconsist-files + warn about inconsistent files (default) + + -a --abort-inconsist-file + abort on first inconsistent file + +type 1 attributes: + + -I --strict + exit with error if DICOMDIR type 1 attributes + are missing in DICOM file (default) + + +I --invent + invent DICOMDIR type 1 attributes if missing in DICOM file + + +Ipi --invent-patient-id + invent new PatientID in case of inconsistent + PatientName attributes + +other checks: + + +Nrs --allow-retired-sop + allow retired SOP classes defined in previous editions + of the DICOM standard + + -Nxc --no-xfer-check + do not reject images with non-standard transfer syntax + (just warn) + + -Nec --no-encoding-check + do not reject images with non-standard pixel encoding + (just warn) + + -Nrc --no-resolution-check + do not reject images with non-standard spatial resolution + (just warn) + +icon images: + + +X --add-icon-image + add monochrome icon image on IMAGE level + (default for cardiac profiles) + + -Xs --icon-image-size [s]ize: integer (1..128) + width and height of the icon image (in pixel) + (fixed: 128 for XA, 64 for CT/MR profile) + + -Xi --icon-file-prefix [p]refix: string + use PGM image 'prefix'+'dcmfile-in' as icon + (default: create icon from DICOM image) + + -Xd --default-icon [f]ilename: string + use specified PGM image if icon cannot be + created automatically (default: black image) +\endverbatim + +\subsection dcmmkdir_output_options output options +\verbatim +DICOMDIR file: + + +D --output-file [f]ilename: string + generate specific DICOMDIR file + (default: DICOMDIR in current directory) + +profiles: + + -Pgp --general-purpose + General Purpose Interchange on CD-R or DVD-RAM Media + (STD-GEN-CD/DVD-RAM, default) + + -Pdv --general-dvd-jpeg + General Purpose DVD Interchange with JPEG + (STD-GEN-DVD-JPEG) + + -Pd2 --general-dvd-j2k + General Purpose DVD Interchange with JPEG 2000 + (STD-GEN-DVD-J2K) + + -Pbd --general-bd-jpeg + General Purpose BD Interchange with JPEG + (STD-GEN-BD-JPEG) + + -Pb2 --general-bd-j2k + General Purpose BD Interchange with JPEG 2000 + (STD-GEN-BD-J2K) + + -Pbm --general-bd-mpeg2-mpml + General Purpose BD Interchange with MPEG2 MP@ML + (STD-GEN-BD-MPEG2-MPML) + + -Pbh --general-bd-mpeg2-mphl + General Purpose BD Interchange with MPEG2 MP@HL + (STD-GEN-BD-MPEG2-MPHL) + + -Pba --general-bd-mpeg4-hp + General Purpose BD Interchange with MPEG-4 AVC/H.264 + HiP@Level4.1 (STD-GEN-BD-MPEG4-HPLV41) + + -Pbb --general-bd-mpeg4-hpbd + General Purpose BD Interchange with MPEG-4 AVC/H.264 + BD-Compatible HiP@Level4.1 (STD-GEN-BD-MPEG4-HPLV41BD) + + --general-bd-mpeg4-hp2d + General Purpose BD Interchange with MPEG-4 AVC/H.264 + HiP@Level4.2 for 2D video (STD-GEN-BD-MPEG4-HPLV42-2D) + + --general-bd-mpeg4-hp3d + General Purpose BD Interchange with MPEG-4 AVC/H.264 + HiP@Level4.2 for 3D video (STD-GEN-BD-MPEG4-HPLV42-3D) + + --general-bd-mpeg4-hpst + General Purpose BD Interchange with MPEG-4 AVC/H.264 + Stereo HiP@Level4.2 (STD-GEN-BD-MPEG4-SHPLV42) + + -Pfl --usb-and-flash-jpeg + General Purpose USB/Flash Memory Interchange with JPEG + (STD-GEN-USB/MMC/CF/SD-JPEG) + + -Pf2 --usb-and-flash-j2k + General Purpose USB/Flash Memory Interchange with JPEG 2000 + (STD-GEN-USB/MMC/CF/SD-J2K) + + -Pmi --general-mime + General Purpose MIME Interchange (STD-GEN-MIME) + + -Pmp --mpeg2-mpml-dvd + DVD Interchange with MPEG2 Main Profile @ Main Level + (STD-DVD-MPEG2-MPML) + + -Pbc --basic-cardiac + Basic Cardiac X-Ray Angiographic Studies on CD-R Media + (STD-XABC-CD) + + -Pxa --xray-angiographic + 1024 X-Ray Angiographic Studies on CD-R Media + (STD-XA1K-CD) + + -Pxd --xray-angiographic-dvd + 1024 X-Ray Angiographic Studies on DVD Media + (STD-XA1K-DVD) + + -Pde --dental-radiograph + Dental Radiograph Interchange (STD-DEN-CD) + + -Pcm --ct-and-mr + CT/MR Studies (STD-CTMR-xxxx) + + -Pus --ultrasound-id-sf + Ultrasound Single Frame for Image Display + (STD-US-ID-SF-xxxx) + + --ultrasound-sc-sf + Ultrasound Single Frame with Spatial Calibration + (STD-US-SC-SF-xxxx) + + --ultrasound-cc-sf + Ultrasound Single Frame with Combined Calibration + (STD-US-CC-SF-xxxx) + + -Pum --ultrasound-id-mf + Ultrasound Single & Multi-Frame for Image Display + (STD-US-ID-MF-xxxx) + + --ultrasound-sc-mf + Ultrasound Single & Multi-Frame with Spatial Calibration + (STD-UD-SC-MF-xxxx) + + --ultrasound-cc-mf + Ultrasound Single & Multi-Frame with Combined Calibration + (STD-UD-CC-MF-xxxx) + + -Pec --12-lead-ecg + 12-lead ECG Interchange on Diskette + (STD-WVFM-ECG-FD) + + -Phd --hemodynamic-waveform + Hemodynamic Waveform Interchange on Diskette + (STD-WVFM-HD-FD) + +writing: + + -A --replace + replace existing DICOMDIR (default) + + +A --append + append to existing DICOMDIR + + +U --update + update existing DICOMDIR + + -w --discard + do not write out DICOMDIR + +backup: + + --create-backup + create a backup of existing DICOMDIR (default) + + -nb --no-backup + do not create a backup of existing DICOMDIR + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + -g --group-length-remove + write without group length elements (default) + + +g --group-length-create + write with group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths +\endverbatim + +\section dcmmkdir_notes NOTES + +All files specified on the command line (or discovered by recursively examining +the contents of directories with the \e +r option) are first evaluated for +their compatibility with the specified Media Storage Application Profile (Part +11). Only appropriate files encoded using one of the allowed Transfer Syntaxes +will be accepted. Files having invalid filenames will be rejected (the rules +can be relaxed via the \e +m option). Files missing required attributes will +be rejected (the \e +I option can relax this behavior). + +A \e DICOMDIR file will only be constructed if all files have passed initial +tests. + +The \b dcmmkdir utility also allows one to append new entries to and to update +existing entries in a \e DICOMDIR file. Using option \e +A new entries are +only appended to the DICOMDIR, i.e. existing records like the ones for PATIENT +information are not updated. Using option \e +U also existing records are +updated according to the information found in the referenced DICOM files. +Please note that this update process might be slower than just appending new +entries. However, it makes sure that additional information that is required +for the selected application profile is also added to existing records. + +The support for icon images is currently restricted to monochrome images. +This might change in the future. Till then, color images are automatically +converted to grayscale mode. The icon size is 128*128 pixels for the cardiac +profiles (as required by the DICOM standard) and 64*64 for all others. + +\subsection dcmmkdir_scanning_directories Scanning Directories + +Adding files from directories is possible by using option \e --recurse. If no +further command line parameters are given, the directory specified by option +\e --input-directory (default: current directory) is scanned for files. If +parameters are given, they can either specify a file or directory name; the +input directory is always prepended. If the files in the provided directories +should be selected according to a specific name pattern (e.g. using wildcard +matching), option \e --pattern has to be used. Please note that this file +pattern only applies to the files within the scanned directories, and, if any +other patterns are specified on the command line outside the +\e --input-directory option (e.g. in order to select further files), these do +not apply to the specified directories. + +\section dcmmkdir_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmmkdir_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmmkdir_environment ENVIRONMENT + +The \b dcmmkdir utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmmkdir_see_also SEE ALSO + +dcmgpdir(1) + +\section dcmmkdir_copyright COPYRIGHT + +Copyright (C) 2001-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmjpeg/docs/ijg_filelist.txt b/dcmjpeg/docs/ijg_filelist.txt new file mode 100644 index 00000000..9ba88e00 --- /dev/null +++ b/dcmjpeg/docs/ijg_filelist.txt @@ -0,0 +1,239 @@ +IJG JPEG LIBRARY: FILE LIST + +Copyright (C) 1994-1997, Thomas G. Lane. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +Here is a road map to the files in the IJG JPEG distribution. The +distribution includes the JPEG library proper, plus two application +programs ("cjpeg" and "djpeg") which use the library to convert JPEG +files to and from some other popular image formats. A third application +"jpegtran" uses the library to do lossless conversion between different +variants of JPEG. There are also two stand-alone applications, +"rdjpgcom" and "wrjpgcom". + + +THE JPEG LIBRARY +================ + +Include files: + +jpeglib.h JPEG library's exported data and function declarations. +jconfig.h Configuration declarations. Note: this file is not present + in the distribution; it is generated during installation. +jmorecfg.h Additional configuration declarations; need not be changed + for a standard installation. +jerror.h Declares JPEG library's error and trace message codes. +jinclude.h Central include file used by all IJG .c files to reference + system include files. +jpegint.h JPEG library's internal data structures. +jlossls.h JPEG library's lossless codec data structures. +jlossy.h JPEG library's lossy codec structures. +jchuff.h Private declarations for Huffman encoder modules. +jdhuff.h Private declarations for Huffman decoder modules. +jdct.h Private declarations for forward & reverse DCT subsystems. +jmemsys.h Private declarations for memory management subsystem. +jversion.h Version information. + +Applications using the library should include jpeglib.h (which in turn +includes jconfig.h and jmorecfg.h). Optionally, jerror.h may be included +if the application needs to reference individual JPEG error codes. The +other include files are intended for internal use and would not normally +be included by an application program. (cjpeg/djpeg/etc do use jinclude.h, +since its function is to improve portability of the whole IJG distribution. +Most other applications will directly include the system include files they +want, and hence won't need jinclude.h.) + + +C source code files: + +These files contain most of the functions intended to be called directly by +an application program: + +jcapimin.c Application program interface: core routines for compression. +jcapistd.c Application program interface: standard compression. +jdapimin.c Application program interface: core routines for decompression. +jdapistd.c Application program interface: standard decompression. +jcomapi.c Application program interface routines common to compression + and decompression. +jcparam.c Compression parameter setting helper routines. +jctrans.c API and library routines for transcoding compression. +jdtrans.c API and library routines for transcoding decompression. + +Compression side of the library: + +jcinit.c Initialization: determines which other modules to use. +jcmaster.c Master control: setup and inter-pass sequencing logic. +jcmainct.c Main buffer controller (preprocessor => JPEG compressor). +jchuff.c Codec-independent Huffman entropy encoding routines. +jcprepct.c Preprocessor buffer controller. +jccolor.c Color space conversion. +jcsample.c Downsampling. +jcmarker.c JPEG marker writing. +jdatadst.c Data destination manager for stdio output. + +Lossy (DCT) codec: + +jlossy.c Lossy compressor proper. +jccoefct.c Buffer controller for DCT coefficient buffer. +jcdctmgr.c DCT manager (DCT implementation selection & control). +jfdctint.c Forward DCT using slow-but-accurate integer method. +jfdctfst.c Forward DCT using faster, less accurate integer method. +jfdctflt.c Forward DCT using floating-point arithmetic. +jcshuff.c Huffman entropy coding for sequential JPEG. +jcphuff.c Huffman entropy coding for progressive JPEG. + +Lossless (spatial) codec: + +jclossls.c Lossless compressor proper. +jcdiffct.c Buffer controller for difference buffer. +jcscale.c Point transformation. +jcpred.c Sample predictor and differencer. +jclhuff.c Huffman entropy encoding for lossless JPEG. + +Decompression side of the library: + +jdmaster.c Master control: determines which other modules to use. +jdinput.c Input controller: controls input processing modules. +jdmainct.c Main buffer controller (JPEG decompressor => postprocessor). +jdhuff.c Codec-independent Huffman entropy decoding routines. +jdpostct.c Postprocessor buffer controller. +jdmarker.c JPEG marker reading. +jdsample.c Upsampling. +jdcolor.c Color space conversion. +jdmerge.c Merged upsampling/color conversion (faster, lower quality). +jquant1.c One-pass color quantization using a fixed-spacing colormap. +jquant2.c Two-pass color quantization using a custom-generated colormap. + Also handles one-pass quantization to an externally given map. +jdatasrc.c Data source manager for stdio input. + +Lossy (DCT) codec: + +jdlossy.c Lossy decompressor proper. +jdcoefct.c Buffer controller for DCT coefficient buffer. +jdshuff.c Huffman entropy decoding for sequential JPEG. +jdphuff.c Huffman entropy decoding for progressive JPEG. +jddctmgr.c IDCT manager (IDCT implementation selection & control). +jidctint.c Inverse DCT using slow-but-accurate integer method. +jidctfst.c Inverse DCT using faster, less accurate integer method. +jidctflt.c Inverse DCT using floating-point arithmetic. +jidctred.c Inverse DCTs with reduced-size outputs. + +Lossless (spatial) codec: + +jdlossls.c Lossless decompressor proper. +jddiffct.c Buffer controller for difference buffers. +jdlhuff.c Huffman entropy decoding for lossless JPEG. +jdpred.c Sample predictor and undifferencer. +jdscale.c Point transformation, sample size scaling. + +Support files for both compression and decompression: + +jerror.c Standard error handling routines (application replaceable). +jmemmgr.c System-independent (more or less) memory management code. +jcodec.c Codec-independent utility routines. +jutils.c Miscellaneous utility routines. + +jmemmgr.c relies on a system-dependent memory management module. The IJG +distribution includes the following implementations of the system-dependent +module: + +jmemnobs.c "No backing store": assumes adequate virtual memory exists. +jmemansi.c Makes temporary files with ANSI-standard routine tmpfile(). +jmemname.c Makes temporary files with program-generated file names. +jmemdos.c Custom implementation for MS-DOS (16-bit environment only): + can use extended and expanded memory as well as temp files. +jmemmac.c Custom implementation for Apple Macintosh. + +Exactly one of the system-dependent modules should be configured into an +installed JPEG library (see install.doc for hints about which one to use). +On unusual systems you may find it worthwhile to make a special +system-dependent memory manager. + + +Non-C source code files: + +jmemdosa.asm 80x86 assembly code support for jmemdos.c; used only in + MS-DOS-specific configurations of the JPEG library. + + +CJPEG/DJPEG/JPEGTRAN +==================== + +Include files: + +cdjpeg.h Declarations shared by cjpeg/djpeg/jpegtran modules. +cderror.h Additional error and trace message codes for cjpeg et al. +transupp.h Declarations for jpegtran support routines in transupp.c. + +C source code files: + +cjpeg.c Main program for cjpeg. +djpeg.c Main program for djpeg. +jpegtran.c Main program for jpegtran. +cdjpeg.c Utility routines used by all three programs. +rdcolmap.c Code to read a colormap file for djpeg's "-map" switch. +rdswitch.c Code to process some of cjpeg's more complex switches. + Also used by jpegtran. +transupp.c Support code for jpegtran: lossless image manipulations. + +Image file reader modules for cjpeg: + +rdbmp.c BMP file input. +rdgif.c GIF file input (now just a stub). +rdppm.c PPM/PGM file input. +rdrle.c Utah RLE file input. +rdtarga.c Targa file input. + +Image file writer modules for djpeg: + +wrbmp.c BMP file output. +wrgif.c GIF file output (a mere shadow of its former self). +wrppm.c PPM/PGM file output. +wrrle.c Utah RLE file output. +wrtarga.c Targa file output. + + +RDJPGCOM/WRJPGCOM +================= + +C source code files: + +rdjpgcom.c Stand-alone rdjpgcom application. +wrjpgcom.c Stand-alone wrjpgcom application. + +These programs do not depend on the IJG library. They do use +jconfig.h and jinclude.h, only to improve portability. + + +ADDITIONAL FILES +================ + +Documentation (see README for a guide to the documentation files): + +README Master documentation file. +*.doc Other documentation files. +*.1 Documentation in Unix man page format. +change.log Version-to-version change highlights. +example.c Sample code for calling JPEG library. + +Configuration/installation files and programs (see install.doc for more info): + +configure Unix shell script to perform automatic configuration. +ltconfig Support scripts for configure (from GNU libtool). +ltmain.sh +config.guess +config.sub +install-sh Install shell script for those Unix systems lacking one. +ckconfig.c Program to generate jconfig.h on non-Unix systems. +jconfig.doc Template for making jconfig.h by hand. +makefile.* Sample makefiles for particular systems. +jconfig.* Sample jconfig.h for particular systems. +ansi2knr.c De-ANSIfier for pre-ANSI C compilers (courtesy of + L. Peter Deutsch and Aladdin Enterprises). + +Test files (see install.doc for test procedure): + +test*.* Source and comparison files for confidence test. + These are binary image files, NOT text files. diff --git a/dcmjpeg/docs/ijg_libjpeg.txt b/dcmjpeg/docs/ijg_libjpeg.txt new file mode 100644 index 00000000..20ce7b48 --- /dev/null +++ b/dcmjpeg/docs/ijg_libjpeg.txt @@ -0,0 +1,3011 @@ +USING THE IJG JPEG LIBRARY + +Copyright (C) 1994-1998, Thomas G. Lane. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +This file describes how to use the IJG JPEG library within an application +program. Read it if you want to write a program that uses the library. + +The file example.c provides heavily commented skeleton code for calling the +JPEG library. Also see jpeglib.h (the include file to be used by application +programs) for full details about data structures and function parameter lists. +The library source code, of course, is the ultimate reference. + +Note that there have been *major* changes from the application interface +presented by IJG version 4 and earlier versions. The old design had several +inherent limitations, and it had accumulated a lot of cruft as we added +features while trying to minimize application-interface changes. We have +sacrificed backward compatibility in the version 5 rewrite, but we think the +improvements justify this. + + +TABLE OF CONTENTS +----------------- + +Overview: + Functions provided by the library + Outline of typical usage +Basic library usage: + Data formats + Compression details + Decompression details + Mechanics of usage: include files, linking, etc +Advanced features: + Compression parameter selection + Decompression parameter selection + Special color spaces + Error handling + Compressed data handling (source and destination managers) + I/O suspension + Progressive JPEG support + Buffered-image mode + Abbreviated datastreams and multiple images + Special markers + Raw (downsampled) image data + Really raw data: DCT coefficients + Progress monitoring + Memory management + Memory usage + Library compile-time options + Portability considerations + Notes for MS-DOS implementors + +You should read at least the overview and basic usage sections before trying +to program with the library. The sections on advanced features can be read +if and when you need them. + + +OVERVIEW +======== + +Functions provided by the library +--------------------------------- + +The IJG JPEG library provides C code to read and write JPEG-compressed image +files. The surrounding application program receives or supplies image data a +scanline at a time, using a straightforward uncompressed image format. All +details of color conversion and other preprocessing/postprocessing can be +handled by the library. + +The library includes a substantial amount of code that is not covered by the +JPEG standard but is necessary for typical applications of JPEG. These +functions preprocess the image before JPEG compression or postprocess it after +decompression. They include colorspace conversion, downsampling/upsampling, +and color quantization. The application indirectly selects use of this code +by specifying the format in which it wishes to supply or receive image data. +For example, if colormapped output is requested, then the decompression +library automatically invokes color quantization. + +A wide range of quality vs. speed tradeoffs are possible in JPEG processing, +and even more so in decompression postprocessing. The decompression library +provides multiple implementations that cover most of the useful tradeoffs, +ranging from very-high-quality down to fast-preview operation. On the +compression side we have generally not provided low-quality choices, since +compression is normally less time-critical. It should be understood that the +low-quality modes may not meet the JPEG standard's accuracy requirements; +nonetheless, they are useful for viewers. + +A word about functions *not* provided by the library. We handle a subset of +the ISO JPEG standard; most baseline, extended-sequential, and progressive +JPEG processes are supported. (Our subset includes all features now in common +use.) Unsupported ISO options include: + * Hierarchical storage + * Arithmetic entropy coding (unsupported for legal reasons) + * DNL marker + * Nonintegral subsampling ratios +We support both 8- and 12-bit data precision, but this is a compile-time +choice rather than a run-time choice; hence it is difficult to use both +precisions in a single application. + +By itself, the library handles only interchange JPEG datastreams --- in +particular the widely used JFIF file format. The library can be used by +surrounding code to process interchange or abbreviated JPEG datastreams that +are embedded in more complex file formats. (For example, this library is +used by the free LIBTIFF library to support JPEG compression in TIFF.) + + +Outline of typical usage +------------------------ + +The rough outline of a JPEG compression operation is: + + Allocate and initialize a JPEG compression object + Specify the destination for the compressed data (eg, a file) + Set parameters for compression, including image size & colorspace + jpeg_start_compress(...); + while (scan lines remain to be written) + jpeg_write_scanlines(...); + jpeg_finish_compress(...); + Release the JPEG compression object + +A JPEG compression object holds parameters and working state for the JPEG +library. We make creation/destruction of the object separate from starting +or finishing compression of an image; the same object can be re-used for a +series of image compression operations. This makes it easy to re-use the +same parameter settings for a sequence of images. Re-use of a JPEG object +also has important implications for processing abbreviated JPEG datastreams, +as discussed later. + +The image data to be compressed is supplied to jpeg_write_scanlines() from +in-memory buffers. If the application is doing file-to-file compression, +reading image data from the source file is the application's responsibility. +The library emits compressed data by calling a "data destination manager", +which typically will write the data into a file; but the application can +provide its own destination manager to do something else. + +Similarly, the rough outline of a JPEG decompression operation is: + + Allocate and initialize a JPEG decompression object + Specify the source of the compressed data (eg, a file) + Call jpeg_read_header() to obtain image info + Set parameters for decompression + jpeg_start_decompress(...); + while (scan lines remain to be read) + jpeg_read_scanlines(...); + jpeg_finish_decompress(...); + Release the JPEG decompression object + +This is comparable to the compression outline except that reading the +datastream header is a separate step. This is helpful because information +about the image's size, colorspace, etc is available when the application +selects decompression parameters. For example, the application can choose an +output scaling ratio that will fit the image into the available screen size. + +The decompression library obtains compressed data by calling a data source +manager, which typically will read the data from a file; but other behaviors +can be obtained with a custom source manager. Decompressed data is delivered +into in-memory buffers passed to jpeg_read_scanlines(). + +It is possible to abort an incomplete compression or decompression operation +by calling jpeg_abort(); or, if you do not need to retain the JPEG object, +simply release it by calling jpeg_destroy(). + +JPEG compression and decompression objects are two separate struct types. +However, they share some common fields, and certain routines such as +jpeg_destroy() can work on either type of object. + +The JPEG library has no static variables: all state is in the compression +or decompression object. Therefore it is possible to process multiple +compression and decompression operations concurrently, using multiple JPEG +objects. + +Both compression and decompression can be done in an incremental memory-to- +memory fashion, if suitable source/destination managers are used. See the +section on "I/O suspension" for more details. + + +BASIC LIBRARY USAGE +=================== + +Data formats +------------ + +Before diving into procedural details, it is helpful to understand the +image data format that the JPEG library expects or returns. + +The standard input image format is a rectangular array of pixels, with each +pixel having the same number of "component" or "sample" values (color +channels). You must specify how many components there are and the colorspace +interpretation of the components. Most applications will use RGB data +(three components per pixel) or grayscale data (one component per pixel). +PLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE. +A remarkable number of people manage to miss this, only to find that their +programs don't work with grayscale JPEG files. + +There is no provision for colormapped input. JPEG files are always full-color +or full grayscale (or sometimes another colorspace such as CMYK). You can +feed in a colormapped image by expanding it to full-color format. However +JPEG often doesn't work very well with source data that has been colormapped, +because of dithering noise. This is discussed in more detail in the JPEG FAQ +and the other references mentioned in the README file. + +Pixels are stored by scanlines, with each scanline running from left to +right. The component values for each pixel are adjacent in the row; for +example, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color. Each scanline is an +array of data type JSAMPLE --- which is typically "unsigned char", unless +you've changed jmorecfg.h. (You can also change the RGB pixel layout, say +to B,G,R order, by modifying jmorecfg.h. But see the restrictions listed in +that file before doing so.) + +A 2-D array of pixels is formed by making a list of pointers to the starts of +scanlines; so the scanlines need not be physically adjacent in memory. Even +if you process just one scanline at a time, you must make a one-element +pointer array to conform to this structure. Pointers to JSAMPLE rows are of +type JSAMPROW, and the pointer to the pointer array is of type JSAMPARRAY. + +The library accepts or supplies one or more complete scanlines per call. +It is not possible to process part of a row at a time. Scanlines are always +processed top-to-bottom. You can process an entire image in one call if you +have it all in memory, but usually it's simplest to process one scanline at +a time. + +For best results, source data values should have the precision specified by +BITS_IN_JSAMPLE (normally 8 bits). For instance, if you choose to compress +data that's only 6 bits/channel, you should left-justify each value in a +byte before passing it to the compressor. If you need to compress data +that has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 12. +(See "Library compile-time options", later.) + + +The data format returned by the decompressor is the same in all details, +except that colormapped output is supported. (Again, a JPEG file is never +colormapped. But you can ask the decompressor to perform on-the-fly color +quantization to deliver colormapped output.) If you request colormapped +output then the returned data array contains a single JSAMPLE per pixel; +its value is an index into a color map. The color map is represented as +a 2-D JSAMPARRAY in which each row holds the values of one color component, +that is, colormap[i][j] is the value of the i'th color component for pixel +value (map index) j. Note that since the colormap indexes are stored in +JSAMPLEs, the maximum number of colors is limited by the size of JSAMPLE +(ie, at most 256 colors for an 8-bit JPEG library). + + +Compression details +------------------- + +Here we revisit the JPEG compression outline given in the overview. + +1. Allocate and initialize a JPEG compression object. + +A JPEG compression object is a "struct jpeg_compress_struct". (It also has +a bunch of subsidiary structures which are allocated via malloc(), but the +application doesn't control those directly.) This struct can be just a local +variable in the calling routine, if a single routine is going to execute the +whole JPEG compression sequence. Otherwise it can be static or allocated +from malloc(). + +You will also need a structure representing a JPEG error handler. The part +of this that the library cares about is a "struct jpeg_error_mgr". If you +are providing your own error handler, you'll typically want to embed the +jpeg_error_mgr struct in a larger structure; this is discussed later under +"Error handling". For now we'll assume you are just using the default error +handler. The default error handler will print JPEG error/warning messages +on stderr, and it will call exit() if a fatal error occurs. + +You must initialize the error handler structure, store a pointer to it into +the JPEG object's "err" field, and then call jpeg_create_compress() to +initialize the rest of the JPEG object. + +Typical code for this step, if you are using the default error handler, is + + struct jpeg_compress_struct cinfo; + struct jpeg_error_mgr jerr; + ... + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_compress(&cinfo); + +jpeg_create_compress allocates a small amount of memory, so it could fail +if you are out of memory. In that case it will exit via the error handler; +that's why the error handler must be initialized first. + + +2. Specify the destination for the compressed data (eg, a file). + +As previously mentioned, the JPEG library delivers compressed data to a +"data destination" module. The library includes one data destination +module which knows how to write to a stdio stream. You can use your own +destination module if you want to do something else, as discussed later. + +If you use the standard destination module, you must open the target stdio +stream beforehand. Typical code for this step looks like: + + FILE * outfile; + ... + if ((outfile = fopen(filename, "wb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + exit(1); + } + jpeg_stdio_dest(&cinfo, outfile); + +where the last line invokes the standard destination module. + +WARNING: it is critical that the binary compressed data be delivered to the +output file unchanged. On non-Unix systems the stdio library may perform +newline translation or otherwise corrupt binary data. To suppress this +behavior, you may need to use a "b" option to fopen (as shown above), or use +setmode() or another routine to put the stdio stream in binary mode. See +cjpeg.c and djpeg.c for code that has been found to work on many systems. + +You can select the data destination after setting other parameters (step 3), +if that's more convenient. You may not change the destination between +calling jpeg_start_compress() and jpeg_finish_compress(). + + +3. Set parameters for compression, including image size & colorspace. + +You must supply information about the source image by setting the following +fields in the JPEG object (cinfo structure): + + image_width Width of image, in pixels + image_height Height of image, in pixels + input_components Number of color channels (samples per pixel) + in_color_space Color space of source image + +The image dimensions are, hopefully, obvious. JPEG supports image dimensions +of 1 to 64K pixels in either direction. The input color space is typically +RGB or grayscale, and input_components is 3 or 1 accordingly. (See "Special +color spaces", later, for more info.) The in_color_space field must be +assigned one of the J_COLOR_SPACE enum constants, typically JCS_RGB or +JCS_GRAYSCALE. + +JPEG has a large number of compression parameters that determine how the +image is encoded. Most applications don't need or want to know about all +these parameters. You can set all the parameters to reasonable defaults by +calling jpeg_set_defaults(); then, if there are particular values you want +to change, you can do so after that. The "Compression parameter selection" +section tells about all the parameters. + +You must set in_color_space correctly before calling jpeg_set_defaults(), +because the defaults depend on the source image colorspace. However the +other three source image parameters need not be valid until you call +jpeg_start_compress(). There's no harm in calling jpeg_set_defaults() more +than once, if that happens to be convenient. + +Typical code for a 24-bit RGB source image is + + cinfo.image_width = Width; /* image width and height, in pixels */ + cinfo.image_height = Height; + cinfo.input_components = 3; /* # of color components per pixel */ + cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ + + jpeg_set_defaults(&cinfo); + /* Make optional parameter settings here */ + + +4. jpeg_start_compress(...); + +After you have established the data destination and set all the necessary +source image info and other parameters, call jpeg_start_compress() to begin +a compression cycle. This will initialize internal state, allocate working +storage, and emit the first few bytes of the JPEG datastream header. + +Typical code: + + jpeg_start_compress(&cinfo, TRUE); + +The "TRUE" parameter ensures that a complete JPEG interchange datastream +will be written. This is appropriate in most cases. If you think you might +want to use an abbreviated datastream, read the section on abbreviated +datastreams, below. + +Once you have called jpeg_start_compress(), you may not alter any JPEG +parameters or other fields of the JPEG object until you have completed +the compression cycle. + + +5. while (scan lines remain to be written) + jpeg_write_scanlines(...); + +Now write all the required image data by calling jpeg_write_scanlines() +one or more times. You can pass one or more scanlines in each call, up +to the total image height. In most applications it is convenient to pass +just one or a few scanlines at a time. The expected format for the passed +data is discussed under "Data formats", above. + +Image data should be written in top-to-bottom scanline order. The JPEG spec +contains some weasel wording about how top and bottom are application-defined +terms (a curious interpretation of the English language...) but if you want +your files to be compatible with everyone else's, you WILL use top-to-bottom +order. If the source data must be read in bottom-to-top order, you can use +the JPEG library's virtual array mechanism to invert the data efficiently. +Examples of this can be found in the sample application cjpeg. + +The library maintains a count of the number of scanlines written so far +in the next_scanline field of the JPEG object. Usually you can just use +this variable as the loop counter, so that the loop test looks like +"while (cinfo.next_scanline < cinfo.image_height)". + +Code for this step depends heavily on the way that you store the source data. +example.c shows the following code for the case of a full-size 2-D source +array containing 3-byte RGB pixels: + + JSAMPROW row_pointer[1]; /* pointer to a single row */ + int row_stride; /* physical row width in buffer */ + + row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */ + + while (cinfo.next_scanline < cinfo.image_height) { + row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride]; + jpeg_write_scanlines(&cinfo, row_pointer, 1); + } + +jpeg_write_scanlines() returns the number of scanlines actually written. +This will normally be equal to the number passed in, so you can usually +ignore the return value. It is different in just two cases: + * If you try to write more scanlines than the declared image height, + the additional scanlines are ignored. + * If you use a suspending data destination manager, output buffer overrun + will cause the compressor to return before accepting all the passed lines. + This feature is discussed under "I/O suspension", below. The normal + stdio destination manager will NOT cause this to happen. +In any case, the return value is the same as the change in the value of +next_scanline. + + +6. jpeg_finish_compress(...); + +After all the image data has been written, call jpeg_finish_compress() to +complete the compression cycle. This step is ESSENTIAL to ensure that the +last bufferload of data is written to the data destination. +jpeg_finish_compress() also releases working memory associated with the JPEG +object. + +Typical code: + + jpeg_finish_compress(&cinfo); + +If using the stdio destination manager, don't forget to close the output +stdio stream (if necessary) afterwards. + +If you have requested a multi-pass operating mode, such as Huffman code +optimization, jpeg_finish_compress() will perform the additional passes using +data buffered by the first pass. In this case jpeg_finish_compress() may take +quite a while to complete. With the default compression parameters, this will +not happen. + +It is an error to call jpeg_finish_compress() before writing the necessary +total number of scanlines. If you wish to abort compression, call +jpeg_abort() as discussed below. + +After completing a compression cycle, you may dispose of the JPEG object +as discussed next, or you may use it to compress another image. In that case +return to step 2, 3, or 4 as appropriate. If you do not change the +destination manager, the new datastream will be written to the same target. +If you do not change any JPEG parameters, the new datastream will be written +with the same parameters as before. Note that you can change the input image +dimensions freely between cycles, but if you change the input colorspace, you +should call jpeg_set_defaults() to adjust for the new colorspace; and then +you'll need to repeat all of step 3. + + +7. Release the JPEG compression object. + +When you are done with a JPEG compression object, destroy it by calling +jpeg_destroy_compress(). This will free all subsidiary memory (regardless of +the previous state of the object). Or you can call jpeg_destroy(), which +works for either compression or decompression objects --- this may be more +convenient if you are sharing code between compression and decompression +cases. (Actually, these routines are equivalent except for the declared type +of the passed pointer. To avoid gripes from ANSI C compilers, jpeg_destroy() +should be passed a j_common_ptr.) + +If you allocated the jpeg_compress_struct structure from malloc(), freeing +it is your responsibility --- jpeg_destroy() won't. Ditto for the error +handler structure. + +Typical code: + + jpeg_destroy_compress(&cinfo); + + +8. Aborting. + +If you decide to abort a compression cycle before finishing, you can clean up +in either of two ways: + +* If you don't need the JPEG object any more, just call + jpeg_destroy_compress() or jpeg_destroy() to release memory. This is + legitimate at any point after calling jpeg_create_compress() --- in fact, + it's safe even if jpeg_create_compress() fails. + +* If you want to re-use the JPEG object, call jpeg_abort_compress(), or call + jpeg_abort() which works on both compression and decompression objects. + This will return the object to an idle state, releasing any working memory. + jpeg_abort() is allowed at any time after successful object creation. + +Note that cleaning up the data destination, if required, is your +responsibility; neither of these routines will call term_destination(). +(See "Compressed data handling", below, for more about that.) + +jpeg_destroy() and jpeg_abort() are the only safe calls to make on a JPEG +object that has reported an error by calling error_exit (see "Error handling" +for more info). The internal state of such an object is likely to be out of +whack. Either of these two routines will return the object to a known state. + + +Decompression details +--------------------- + +Here we revisit the JPEG decompression outline given in the overview. + +1. Allocate and initialize a JPEG decompression object. + +This is just like initialization for compression, as discussed above, +except that the object is a "struct jpeg_decompress_struct" and you +call jpeg_create_decompress(). Error handling is exactly the same. + +Typical code: + + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + ... + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_decompress(&cinfo); + +(Both here and in the IJG code, we usually use variable name "cinfo" for +both compression and decompression objects.) + + +2. Specify the source of the compressed data (eg, a file). + +As previously mentioned, the JPEG library reads compressed data from a "data +source" module. The library includes one data source module which knows how +to read from a stdio stream. You can use your own source module if you want +to do something else, as discussed later. + +If you use the standard source module, you must open the source stdio stream +beforehand. Typical code for this step looks like: + + FILE * infile; + ... + if ((infile = fopen(filename, "rb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + exit(1); + } + jpeg_stdio_src(&cinfo, infile); + +where the last line invokes the standard source module. + +WARNING: it is critical that the binary compressed data be read unchanged. +On non-Unix systems the stdio library may perform newline translation or +otherwise corrupt binary data. To suppress this behavior, you may need to use +a "b" option to fopen (as shown above), or use setmode() or another routine to +put the stdio stream in binary mode. See cjpeg.c and djpeg.c for code that +has been found to work on many systems. + +You may not change the data source between calling jpeg_read_header() and +jpeg_finish_decompress(). If you wish to read a series of JPEG images from +a single source file, you should repeat the jpeg_read_header() to +jpeg_finish_decompress() sequence without reinitializing either the JPEG +object or the data source module; this prevents buffered input data from +being discarded. + + +3. Call jpeg_read_header() to obtain image info. + +Typical code for this step is just + + jpeg_read_header(&cinfo, TRUE); + +This will read the source datastream header markers, up to the beginning +of the compressed data proper. On return, the image dimensions and other +info have been stored in the JPEG object. The application may wish to +consult this information before selecting decompression parameters. + +More complex code is necessary if + * A suspending data source is used --- in that case jpeg_read_header() + may return before it has read all the header data. See "I/O suspension", + below. The normal stdio source manager will NOT cause this to happen. + * Abbreviated JPEG files are to be processed --- see the section on + abbreviated datastreams. Standard applications that deal only in + interchange JPEG files need not be concerned with this case either. + +It is permissible to stop at this point if you just wanted to find out the +image dimensions and other header info for a JPEG file. In that case, +call jpeg_destroy() when you are done with the JPEG object, or call +jpeg_abort() to return it to an idle state before selecting a new data +source and reading another header. + + +4. Set parameters for decompression. + +jpeg_read_header() sets appropriate default decompression parameters based on +the properties of the image (in particular, its colorspace). However, you +may well want to alter these defaults before beginning the decompression. +For example, the default is to produce full color output from a color file. +If you want colormapped output you must ask for it. Other options allow the +returned image to be scaled and allow various speed/quality tradeoffs to be +selected. "Decompression parameter selection", below, gives details. + +If the defaults are appropriate, nothing need be done at this step. + +Note that all default values are set by each call to jpeg_read_header(). +If you reuse a decompression object, you cannot expect your parameter +settings to be preserved across cycles, as you can for compression. +You must set desired parameter values each time. + + +5. jpeg_start_decompress(...); + +Once the parameter values are satisfactory, call jpeg_start_decompress() to +begin decompression. This will initialize internal state, allocate working +memory, and prepare for returning data. + +Typical code is just + + jpeg_start_decompress(&cinfo); + +If you have requested a multi-pass operating mode, such as 2-pass color +quantization, jpeg_start_decompress() will do everything needed before data +output can begin. In this case jpeg_start_decompress() may take quite a while +to complete. With a single-scan (non progressive) JPEG file and default +decompression parameters, this will not happen; jpeg_start_decompress() will +return quickly. + +After this call, the final output image dimensions, including any requested +scaling, are available in the JPEG object; so is the selected colormap, if +colormapped output has been requested. Useful fields include + + output_width image width and height, as scaled + output_height + out_color_components # of color components in out_color_space + output_components # of color components returned per pixel + colormap the selected colormap, if any + actual_number_of_colors number of entries in colormap + +output_components is 1 (a colormap index) when quantizing colors; otherwise it +equals out_color_components. It is the number of JSAMPLE values that will be +emitted per pixel in the output arrays. + +Typically you will need to allocate data buffers to hold the incoming image. +You will need output_width * output_components JSAMPLEs per scanline in your +output buffer, and a total of output_height scanlines will be returned. + +Note: if you are using the JPEG library's internal memory manager to allocate +data buffers (as djpeg does), then the manager's protocol requires that you +request large buffers *before* calling jpeg_start_decompress(). This is a +little tricky since the output_XXX fields are not normally valid then. You +can make them valid by calling jpeg_calc_output_dimensions() after setting the +relevant parameters (scaling, output color space, and quantization flag). + + +6. while (scan lines remain to be read) + jpeg_read_scanlines(...); + +Now you can read the decompressed image data by calling jpeg_read_scanlines() +one or more times. At each call, you pass in the maximum number of scanlines +to be read (ie, the height of your working buffer); jpeg_read_scanlines() +will return up to that many lines. The return value is the number of lines +actually read. The format of the returned data is discussed under "Data +formats", above. Don't forget that grayscale and color JPEGs will return +different data formats! + +Image data is returned in top-to-bottom scanline order. If you must write +out the image in bottom-to-top order, you can use the JPEG library's virtual +array mechanism to invert the data efficiently. Examples of this can be +found in the sample application djpeg. + +The library maintains a count of the number of scanlines returned so far +in the output_scanline field of the JPEG object. Usually you can just use +this variable as the loop counter, so that the loop test looks like +"while (cinfo.output_scanline < cinfo.output_height)". (Note that the test +should NOT be against image_height, unless you never use scaling. The +image_height field is the height of the original unscaled image.) +The return value always equals the change in the value of output_scanline. + +If you don't use a suspending data source, it is safe to assume that +jpeg_read_scanlines() reads at least one scanline per call, until the +bottom of the image has been reached. + +If you use a buffer larger than one scanline, it is NOT safe to assume that +jpeg_read_scanlines() fills it. (The current implementation returns only a +few scanlines per call, no matter how large a buffer you pass.) So you must +always provide a loop that calls jpeg_read_scanlines() repeatedly until the +whole image has been read. + + +7. jpeg_finish_decompress(...); + +After all the image data has been read, call jpeg_finish_decompress() to +complete the decompression cycle. This causes working memory associated +with the JPEG object to be released. + +Typical code: + + jpeg_finish_decompress(&cinfo); + +If using the stdio source manager, don't forget to close the source stdio +stream if necessary. + +It is an error to call jpeg_finish_decompress() before reading the correct +total number of scanlines. If you wish to abort decompression, call +jpeg_abort() as discussed below. + +After completing a decompression cycle, you may dispose of the JPEG object as +discussed next, or you may use it to decompress another image. In that case +return to step 2 or 3 as appropriate. If you do not change the source +manager, the next image will be read from the same source. + + +8. Release the JPEG decompression object. + +When you are done with a JPEG decompression object, destroy it by calling +jpeg_destroy_decompress() or jpeg_destroy(). The previous discussion of +destroying compression objects applies here too. + +Typical code: + + jpeg_destroy_decompress(&cinfo); + + +9. Aborting. + +You can abort a decompression cycle by calling jpeg_destroy_decompress() or +jpeg_destroy() if you don't need the JPEG object any more, or +jpeg_abort_decompress() or jpeg_abort() if you want to reuse the object. +The previous discussion of aborting compression cycles applies here too. + + +Mechanics of usage: include files, linking, etc +----------------------------------------------- + +Applications using the JPEG library should include the header file jpeglib.h +to obtain declarations of data types and routines. Before including +jpeglib.h, include system headers that define at least the typedefs FILE and +size_t. On ANSI-conforming systems, including is sufficient; on +older Unix systems, you may need to define size_t. + +If the application needs to refer to individual JPEG library error codes, also +include jerror.h to define those symbols. + +jpeglib.h indirectly includes the files jconfig.h and jmorecfg.h. If you are +installing the JPEG header files in a system directory, you will want to +install all four files: jpeglib.h, jerror.h, jconfig.h, jmorecfg.h. + +The most convenient way to include the JPEG code into your executable program +is to prepare a library file ("libjpeg.a", or a corresponding name on non-Unix +machines) and reference it at your link step. If you use only half of the +library (only compression or only decompression), only that much code will be +included from the library, unless your linker is hopelessly brain-damaged. +The supplied makefiles build libjpeg.a automatically (see install.doc). + +While you can build the JPEG library as a shared library if the whim strikes +you, we don't really recommend it. The trouble with shared libraries is that +at some point you'll probably try to substitute a new version of the library +without recompiling the calling applications. That generally doesn't work +because the parameter struct declarations usually change with each new +version. In other words, the library's API is *not* guaranteed binary +compatible across versions; we only try to ensure source-code compatibility. +(In hindsight, it might have been smarter to hide the parameter structs from +applications and introduce a ton of access functions instead. Too late now, +however.) + +On some systems your application may need to set up a signal handler to ensure +that temporary files are deleted if the program is interrupted. This is most +critical if you are on MS-DOS and use the jmemdos.c memory manager back end; +it will try to grab extended memory for temp files, and that space will NOT be +freed automatically. See cjpeg.c or djpeg.c for an example signal handler. + +It may be worth pointing out that the core JPEG library does not actually +require the stdio library: only the default source/destination managers and +error handler need it. You can use the library in a stdio-less environment +if you replace those modules and use jmemnobs.c (or another memory manager of +your own devising). More info about the minimum system library requirements +may be found in jinclude.h. + + +ADVANCED FEATURES +================= + +Compression parameter selection +------------------------------- + +This section describes all the optional parameters you can set for JPEG +compression, as well as the "helper" routines provided to assist in this +task. Proper setting of some parameters requires detailed understanding +of the JPEG standard; if you don't know what a parameter is for, it's best +not to mess with it! See REFERENCES in the README file for pointers to +more info about JPEG. + +It's a good idea to call jpeg_set_defaults() first, even if you plan to set +all the parameters; that way your code is more likely to work with future JPEG +libraries that have additional parameters. For the same reason, we recommend +you use a helper routine where one is provided, in preference to twiddling +cinfo fields directly. + +The helper routines are: + +jpeg_set_defaults (j_compress_ptr cinfo) + This routine sets all JPEG parameters to reasonable defaults, using + only the input image's color space (field in_color_space, which must + already be set in cinfo). Many applications will only need to use + this routine and perhaps jpeg_set_quality(). + +jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) + Sets the JPEG file's colorspace (field jpeg_color_space) as specified, + and sets other color-space-dependent parameters appropriately. See + "Special color spaces", below, before using this. A large number of + parameters, including all per-component parameters, are set by this + routine; if you want to twiddle individual parameters you should call + jpeg_set_colorspace() before rather than after. + +jpeg_default_colorspace (j_compress_ptr cinfo) + Selects an appropriate JPEG colorspace based on cinfo->in_color_space, + and calls jpeg_set_colorspace(). This is actually a subroutine of + jpeg_set_defaults(). It's broken out in case you want to change + just the colorspace-dependent JPEG parameters. + +jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) + Constructs JPEG quantization tables appropriate for the indicated + quality setting. The quality value is expressed on the 0..100 scale + recommended by IJG (cjpeg's "-quality" switch uses this routine). + Note that the exact mapping from quality values to tables may change + in future IJG releases as more is learned about DCT quantization. + If the force_baseline parameter is TRUE, then the quantization table + entries are constrained to the range 1..255 for full JPEG baseline + compatibility. In the current implementation, this only makes a + difference for quality settings below 25, and it effectively prevents + very small/low quality files from being generated. The IJG decoder + is capable of reading the non-baseline files generated at low quality + settings when force_baseline is FALSE, but other decoders may not be. + +jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, + boolean force_baseline) + Same as jpeg_set_quality() except that the generated tables are the + sample tables given in the JPEC spec section K.1, multiplied by the + specified scale factor (which is expressed as a percentage; thus + scale_factor = 100 reproduces the spec's tables). Note that larger + scale factors give lower quality. This entry point is useful for + conforming to the Adobe PostScript DCT conventions, but we do not + recommend linear scaling as a user-visible quality scale otherwise. + force_baseline again constrains the computed table entries to 1..255. + +int jpeg_quality_scaling (int quality) + Converts a value on the IJG-recommended quality scale to a linear + scaling percentage. Note that this routine may change or go away + in future releases --- IJG may choose to adopt a scaling method that + can't be expressed as a simple scalar multiplier, in which case the + premise of this routine collapses. Caveat user. + +jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, boolean force_baseline) + Allows an arbitrary quantization table to be created. which_tbl + indicates which table slot to fill. basic_table points to an array + of 64 unsigned ints given in normal array order. These values are + multiplied by scale_factor/100 and then clamped to the range 1..65535 + (or to 1..255 if force_baseline is TRUE). + CAUTION: prior to library version 6a, jpeg_add_quant_table expected + the basic table to be given in JPEG zigzag order. If you need to + write code that works with either older or newer versions of this + routine, you must check the library version number. Something like + "#if JPEG_LIB_VERSION >= 61" is the right test. + +jpeg_simple_progression (j_compress_ptr cinfo) + Generates a default scan script for writing a progressive-JPEG file. + This is the recommended method of creating a progressive file, + unless you want to make a custom scan sequence. You must ensure that + the JPEG color space is set correctly before calling this routine. + +jpeg_simple_lossless (j_compress_ptr cinfo, int predictor, int point_transform) + Generates a default scan script for writing a lossless-JPEG file. + This is the recommended method of creating a lossless file, + unless you want to make a custom scan sequence. You must ensure that + the JPEG color space is set correctly before calling this routine. + + +Compression parameters (cinfo fields) include: + +J_DCT_METHOD dct_method + Selects the algorithm used for the DCT step. Choices are: + JDCT_ISLOW: slow but accurate integer algorithm + JDCT_IFAST: faster, less accurate integer method + JDCT_FLOAT: floating-point method + JDCT_DEFAULT: default method (normally JDCT_ISLOW) + JDCT_FASTEST: fastest method (normally JDCT_IFAST) + The FLOAT method is very slightly more accurate than the ISLOW method, + but may give different results on different machines due to varying + roundoff behavior. The integer methods should give the same results + on all machines. On machines with sufficiently fast FP hardware, the + floating-point method may also be the fastest. The IFAST method is + considerably less accurate than the other two; its use is not + recommended if high quality is a concern. JDCT_DEFAULT and + JDCT_FASTEST are macros configurable by each installation. + +J_COLOR_SPACE jpeg_color_space +int num_components + The JPEG color space and corresponding number of components; see + "Special color spaces", below, for more info. We recommend using + jpeg_set_color_space() if you want to change these. + +boolean optimize_coding + TRUE causes the compressor to compute optimal Huffman coding tables + for the image. This requires an extra pass over the data and + therefore costs a good deal of space and time. The default is + FALSE, which tells the compressor to use the supplied or default + Huffman tables. In most cases optimal tables save only a few percent + of file size compared to the default tables. Note that when this is + TRUE, you need not supply Huffman tables at all, and any you do + supply will be overwritten. + +unsigned int restart_interval +int restart_in_rows + To emit restart markers in the JPEG file, set one of these nonzero. + Set restart_interval to specify the exact interval in MCU blocks. + Set restart_in_rows to specify the interval in MCU rows. (If + restart_in_rows is not 0, then restart_interval is set after the + image width in MCUs is computed.) Defaults are zero (no restarts). + One restart marker per MCU row is often a good choice. + NOTE: the overhead of restart markers is higher in grayscale JPEG + files than in color files, and MUCH higher in progressive JPEGs. + If you use restarts, you may want to use larger intervals in those + cases. + +const jpeg_scan_info * scan_info +int num_scans + By default, scan_info is NULL; this causes the compressor to write a + single-scan sequential JPEG file. If not NULL, scan_info points to + an array of scan definition records of length num_scans. The + compressor will then write a JPEG file having one scan for each scan + definition record. This is used to generate noninterleaved or + progressive JPEG files. The library checks that the scan array + defines a valid JPEG scan sequence. (jpeg_simple_progression creates + a suitable scan definition array for progressive JPEG.) This is + discussed further under "Progressive JPEG support". + +int smoothing_factor + If non-zero, the input image is smoothed; the value should be 1 for + minimal smoothing to 100 for maximum smoothing. Consult jcsample.c + for details of the smoothing algorithm. The default is zero. + +boolean write_JFIF_header + If TRUE, a JFIF APP0 marker is emitted. jpeg_set_defaults() and + jpeg_set_colorspace() set this TRUE if a JFIF-legal JPEG color space + (ie, YCbCr or grayscale) is selected, otherwise FALSE. + +UINT8 JFIF_major_version +UINT8 JFIF_minor_version + The version number to be written into the JFIF marker. + jpeg_set_defaults() initializes the version to 1.01 (major=minor=1). + You should set it to 1.02 (major=1, minor=2) if you plan to write + any JFIF 1.02 extension markers. + +UINT8 density_unit +UINT16 X_density +UINT16 Y_density + The resolution information to be written into the JFIF marker; + not used otherwise. density_unit may be 0 for unknown, + 1 for dots/inch, or 2 for dots/cm. The default values are 0,1,1 + indicating square pixels of unknown size. + +boolean write_Adobe_marker + If TRUE, an Adobe APP14 marker is emitted. jpeg_set_defaults() and + jpeg_set_colorspace() set this TRUE if JPEG color space RGB, CMYK, + or YCCK is selected, otherwise FALSE. It is generally a bad idea + to set both write_JFIF_header and write_Adobe_marker. In fact, + you probably shouldn't change the default settings at all --- the + default behavior ensures that the JPEG file's color space can be + recognized by the decoder. + +JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS] + Pointers to coefficient quantization tables, one per table slot, + or NULL if no table is defined for a slot. Usually these should + be set via one of the above helper routines; jpeg_add_quant_table() + is general enough to define any quantization table. The other + routines will set up table slot 0 for luminance quality and table + slot 1 for chrominance. + +JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS] +JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS] + Pointers to Huffman coding tables, one per table slot, or NULL if + no table is defined for a slot. Slots 0 and 1 are filled with the + JPEG sample tables by jpeg_set_defaults(). If you need to allocate + more table structures, jpeg_alloc_huff_table() may be used. + Note that optimal Huffman tables can be computed for an image + by setting optimize_coding, as discussed above; there's seldom + any need to mess with providing your own Huffman tables. + +There are some additional cinfo fields which are not documented here +because you currently can't change them; for example, you can't set +arith_code TRUE because arithmetic coding is unsupported. + + +Per-component parameters are stored in the struct cinfo.comp_info[i] for +component number i. Note that components here refer to components of the +JPEG color space, *not* the source image color space. A suitably large +comp_info[] array is allocated by jpeg_set_defaults(); if you choose not +to use that routine, it's up to you to allocate the array. + +int component_id + The one-byte identifier code to be recorded in the JPEG file for + this component. For the standard color spaces, we recommend you + leave the default values alone. + +int h_samp_factor +int v_samp_factor + Horizontal and vertical sampling factors for the component; must + be 1..4 according to the JPEG standard. Note that larger sampling + factors indicate a higher-resolution component; many people find + this behavior quite unintuitive. The default values are 2,2 for + luminance components and 1,1 for chrominance components, except + for grayscale where 1,1 is used. + +int quant_tbl_no + Quantization table number for component. The default value is + 0 for luminance components and 1 for chrominance components. + +int dc_tbl_no +int ac_tbl_no + DC and AC entropy coding table numbers. The default values are + 0 for luminance components and 1 for chrominance components. + +int component_index + Must equal the component's index in comp_info[]. (Beginning in + release v6, the compressor library will fill this in automatically; + you don't have to.) + + +Decompression parameter selection +--------------------------------- + +Decompression parameter selection is somewhat simpler than compression +parameter selection, since all of the JPEG internal parameters are +recorded in the source file and need not be supplied by the application. +(Unless you are working with abbreviated files, in which case see +"Abbreviated datastreams", below.) Decompression parameters control +the postprocessing done on the image to deliver it in a format suitable +for the application's use. Many of the parameters control speed/quality +tradeoffs, in which faster decompression may be obtained at the price of +a poorer-quality image. The defaults select the highest quality (slowest) +processing. + +The following fields in the JPEG object are set by jpeg_read_header() and +may be useful to the application in choosing decompression parameters: + +JDIMENSION image_width Width and height of image +JDIMENSION image_height +int num_components Number of color components +J_COLOR_SPACE jpeg_color_space Colorspace of image +boolean saw_JFIF_marker TRUE if a JFIF APP0 marker was seen + UINT8 JFIF_major_version Version information from JFIF marker + UINT8 JFIF_minor_version + UINT8 density_unit Resolution data from JFIF marker + UINT16 X_density + UINT16 Y_density +boolean saw_Adobe_marker TRUE if an Adobe APP14 marker was seen + UINT8 Adobe_transform Color transform code from Adobe marker + +The JPEG color space, unfortunately, is something of a guess since the JPEG +standard proper does not provide a way to record it. In practice most files +adhere to the JFIF or Adobe conventions, and the decoder will recognize these +correctly. See "Special color spaces", below, for more info. + + +The decompression parameters that determine the basic properties of the +returned image are: + +J_COLOR_SPACE out_color_space + Output color space. jpeg_read_header() sets an appropriate default + based on jpeg_color_space; typically it will be RGB or grayscale. + The application can change this field to request output in a different + colorspace. For example, set it to JCS_GRAYSCALE to get grayscale + output from a color file. (This is useful for previewing: grayscale + output is faster than full color since the color components need not + be processed.) Note that not all possible color space transforms are + currently implemented; you may need to extend jdcolor.c if you want an + unusual conversion. + +unsigned int scale_num, scale_denom + Scale the image by the fraction scale_num/scale_denom. Default is + 1/1, or no scaling. Currently, the only supported scaling ratios + are 1/1, 1/2, 1/4, and 1/8. (The library design allows for arbitrary + scaling ratios but this is not likely to be implemented any time soon.) + Smaller scaling ratios permit significantly faster decoding since + fewer pixels need be processed and a simpler IDCT method can be used. + +boolean quantize_colors + If set TRUE, colormapped output will be delivered. Default is FALSE, + meaning that full-color output will be delivered. + +The next three parameters are relevant only if quantize_colors is TRUE. + +int desired_number_of_colors + Maximum number of colors to use in generating a library-supplied color + map (the actual number of colors is returned in a different field). + Default 256. Ignored when the application supplies its own color map. + +boolean two_pass_quantize + If TRUE, an extra pass over the image is made to select a custom color + map for the image. This usually looks a lot better than the one-size- + fits-all colormap that is used otherwise. Default is TRUE. Ignored + when the application supplies its own color map. + +J_DITHER_MODE dither_mode + Selects color dithering method. Supported values are: + JDITHER_NONE no dithering: fast, very low quality + JDITHER_ORDERED ordered dither: moderate speed and quality + JDITHER_FS Floyd-Steinberg dither: slow, high quality + Default is JDITHER_FS. (At present, ordered dither is implemented + only in the single-pass, standard-colormap case. If you ask for + ordered dither when two_pass_quantize is TRUE or when you supply + an external color map, you'll get F-S dithering.) + +When quantize_colors is TRUE, the target color map is described by the next +two fields. colormap is set to NULL by jpeg_read_header(). The application +can supply a color map by setting colormap non-NULL and setting +actual_number_of_colors to the map size. Otherwise, jpeg_start_decompress() +selects a suitable color map and sets these two fields itself. +[Implementation restriction: at present, an externally supplied colormap is +only accepted for 3-component output color spaces.] + +JSAMPARRAY colormap + The color map, represented as a 2-D pixel array of out_color_components + rows and actual_number_of_colors columns. Ignored if not quantizing. + CAUTION: if the JPEG library creates its own colormap, the storage + pointed to by this field is released by jpeg_finish_decompress(). + Copy the colormap somewhere else first, if you want to save it. + +int actual_number_of_colors + The number of colors in the color map. + +Additional decompression parameters that the application may set include: + +J_DCT_METHOD dct_method + Selects the algorithm used for the DCT step. Choices are the same + as described above for compression. + +boolean do_fancy_upsampling + If TRUE, do careful upsampling of chroma components. If FALSE, + a faster but sloppier method is used. Default is TRUE. The visual + impact of the sloppier method is often very small. + +boolean do_block_smoothing + If TRUE, interblock smoothing is applied in early stages of decoding + progressive JPEG files; if FALSE, not. Default is TRUE. Early + progression stages look "fuzzy" with smoothing, "blocky" without. + In any case, block smoothing ceases to be applied after the first few + AC coefficients are known to full accuracy, so it is relevant only + when using buffered-image mode for progressive images. + +boolean enable_1pass_quant +boolean enable_external_quant +boolean enable_2pass_quant + These are significant only in buffered-image mode, which is + described in its own section below. + + +The output image dimensions are given by the following fields. These are +computed from the source image dimensions and the decompression parameters +by jpeg_start_decompress(). You can also call jpeg_calc_output_dimensions() +to obtain the values that will result from the current parameter settings. +This can be useful if you are trying to pick a scaling ratio that will get +close to a desired target size. It's also important if you are using the +JPEG library's memory manager to allocate output buffer space, because you +are supposed to request such buffers *before* jpeg_start_decompress(). + +JDIMENSION output_width Actual dimensions of output image. +JDIMENSION output_height +int out_color_components Number of color components in out_color_space. +int output_components Number of color components returned. +int rec_outbuf_height Recommended height of scanline buffer. + +When quantizing colors, output_components is 1, indicating a single color map +index per pixel. Otherwise it equals out_color_components. The output arrays +are required to be output_width * output_components JSAMPLEs wide. + +rec_outbuf_height is the recommended minimum height (in scanlines) of the +buffer passed to jpeg_read_scanlines(). If the buffer is smaller, the +library will still work, but time will be wasted due to unnecessary data +copying. In high-quality modes, rec_outbuf_height is always 1, but some +faster, lower-quality modes set it to larger values (typically 2 to 4). +If you are going to ask for a high-speed processing mode, you may as well +go to the trouble of honoring rec_outbuf_height so as to avoid data copying. +(An output buffer larger than rec_outbuf_height lines is OK, but won't +provide any material speed improvement over that height.) + + +Special color spaces +-------------------- + +The JPEG standard itself is "color blind" and doesn't specify any particular +color space. It is customary to convert color data to a luminance/chrominance +color space before compressing, since this permits greater compression. The +existing de-facto JPEG file format standards specify YCbCr or grayscale data +(JFIF), or grayscale, RGB, YCbCr, CMYK, or YCCK (Adobe). For special +applications such as multispectral images, other color spaces can be used, +but it must be understood that such files will be unportable. + +The JPEG library can handle the most common colorspace conversions (namely +RGB <=> YCbCr and CMYK <=> YCCK). It can also deal with data of an unknown +color space, passing it through without conversion. If you deal extensively +with an unusual color space, you can easily extend the library to understand +additional color spaces and perform appropriate conversions. + +For compression, the source data's color space is specified by field +in_color_space. This is transformed to the JPEG file's color space given +by jpeg_color_space. jpeg_set_defaults() chooses a reasonable JPEG color +space depending on in_color_space, but you can override this by calling +jpeg_set_colorspace(). Of course you must select a supported transformation. +jccolor.c currently supports the following transformations: + RGB => YCbCr + RGB => GRAYSCALE + YCbCr => GRAYSCALE + CMYK => YCCK +plus the null transforms: GRAYSCALE => GRAYSCALE, RGB => RGB, +YCbCr => YCbCr, CMYK => CMYK, YCCK => YCCK, and UNKNOWN => UNKNOWN. + +The de-facto file format standards (JFIF and Adobe) specify APPn markers that +indicate the color space of the JPEG file. It is important to ensure that +these are written correctly, or omitted if the JPEG file's color space is not +one of the ones supported by the de-facto standards. jpeg_set_colorspace() +will set the compression parameters to include or omit the APPn markers +properly, so long as it is told the truth about the JPEG color space. +For example, if you are writing some random 3-component color space without +conversion, don't try to fake out the library by setting in_color_space and +jpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN. You may want to write an +APPn marker of your own devising to identify the colorspace --- see "Special +markers", below. + +When told that the color space is UNKNOWN, the library will default to using +luminance-quality compression parameters for all color components. You may +well want to change these parameters. See the source code for +jpeg_set_colorspace(), in jcparam.c, for details. + +For decompression, the JPEG file's color space is given in jpeg_color_space, +and this is transformed to the output color space out_color_space. +jpeg_read_header's setting of jpeg_color_space can be relied on if the file +conforms to JFIF or Adobe conventions, but otherwise it is no better than a +guess. If you know the JPEG file's color space for certain, you can override +jpeg_read_header's guess by setting jpeg_color_space. jpeg_read_header also +selects a default output color space based on (its guess of) jpeg_color_space; +set out_color_space to override this. Again, you must select a supported +transformation. jdcolor.c currently supports + YCbCr => GRAYSCALE + YCbCr => RGB + GRAYSCALE => RGB + YCCK => CMYK +as well as the null transforms. (Since GRAYSCALE=>RGB is provided, an +application can force grayscale JPEGs to look like color JPEGs if it only +wants to handle one case.) + +The two-pass color quantizer, jquant2.c, is specialized to handle RGB data +(it weights distances appropriately for RGB colors). You'll need to modify +the code if you want to use it for non-RGB output color spaces. Note that +jquant2.c is used to map to an application-supplied colormap as well as for +the normal two-pass colormap selection process. + +CAUTION: it appears that Adobe Photoshop writes inverted data in CMYK JPEG +files: 0 represents 100% ink coverage, rather than 0% ink as you'd expect. +This is arguably a bug in Photoshop, but if you need to work with Photoshop +CMYK files, you will have to deal with it in your application. We cannot +"fix" this in the library by inverting the data during the CMYK<=>YCCK +transform, because that would break other applications, notably Ghostscript. +Photoshop versions prior to 3.0 write EPS files containing JPEG-encoded CMYK +data in the same inverted-YCCK representation used in bare JPEG files, but +the surrounding PostScript code performs an inversion using the PS image +operator. I am told that Photoshop 3.0 will write uninverted YCCK in +EPS/JPEG files, and will omit the PS-level inversion. (But the data +polarity used in bare JPEG files will not change in 3.0.) In either case, +the JPEG library must not invert the data itself, or else Ghostscript would +read these EPS files incorrectly. + + +Error handling +-------------- + +When the default error handler is used, any error detected inside the JPEG +routines will cause a message to be printed on stderr, followed by exit(). +You can supply your own error handling routines to override this behavior +and to control the treatment of nonfatal warnings and trace/debug messages. +The file example.c illustrates the most common case, which is to have the +application regain control after an error rather than exiting. + +The JPEG library never writes any message directly; it always goes through +the error handling routines. Three classes of messages are recognized: + * Fatal errors: the library cannot continue. + * Warnings: the library can continue, but the data is corrupt, and a + damaged output image is likely to result. + * Trace/informational messages. These come with a trace level indicating + the importance of the message; you can control the verbosity of the + program by adjusting the maximum trace level that will be displayed. + +You may, if you wish, simply replace the entire JPEG error handling module +(jerror.c) with your own code. However, you can avoid code duplication by +only replacing some of the routines depending on the behavior you need. +This is accomplished by calling jpeg_std_error() as usual, but then overriding +some of the method pointers in the jpeg_error_mgr struct, as illustrated by +example.c. + +All of the error handling routines will receive a pointer to the JPEG object +(a j_common_ptr which points to either a jpeg_compress_struct or a +jpeg_decompress_struct; if you need to tell which, test the is_decompressor +field). This struct includes a pointer to the error manager struct in its +"err" field. Frequently, custom error handler routines will need to access +additional data which is not known to the JPEG library or the standard error +handler. The most convenient way to do this is to embed either the JPEG +object or the jpeg_error_mgr struct in a larger structure that contains +additional fields; then casting the passed pointer provides access to the +additional fields. Again, see example.c for one way to do it. (Beginning +with IJG version 6b, there is also a void pointer "client_data" in each +JPEG object, which the application can also use to find related data. +The library does not touch client_data at all.) + +The individual methods that you might wish to override are: + +error_exit (j_common_ptr cinfo) + Receives control for a fatal error. Information sufficient to + generate the error message has been stored in cinfo->err; call + output_message to display it. Control must NOT return to the caller; + generally this routine will exit() or longjmp() somewhere. + Typically you would override this routine to get rid of the exit() + default behavior. Note that if you continue processing, you should + clean up the JPEG object with jpeg_abort() or jpeg_destroy(). + +output_message (j_common_ptr cinfo) + Actual output of any JPEG message. Override this to send messages + somewhere other than stderr. Note that this method does not know + how to generate a message, only where to send it. + +format_message (j_common_ptr cinfo, char * buffer) + Constructs a readable error message string based on the error info + stored in cinfo->err. This method is called by output_message. Few + applications should need to override this method. One possible + reason for doing so is to implement dynamic switching of error message + language. + +emit_message (j_common_ptr cinfo, int msg_level) + Decide whether or not to emit a warning or trace message; if so, + calls output_message. The main reason for overriding this method + would be to abort on warnings. msg_level is -1 for warnings, + 0 and up for trace messages. + +Only error_exit() and emit_message() are called from the rest of the JPEG +library; the other two are internal to the error handler. + +The actual message texts are stored in an array of strings which is pointed to +by the field err->jpeg_message_table. The messages are numbered from 0 to +err->last_jpeg_message, and it is these code numbers that are used in the +JPEG library code. You could replace the message texts (for instance, with +messages in French or German) by changing the message table pointer. See +jerror.h for the default texts. CAUTION: this table will almost certainly +change or grow from one library version to the next. + +It may be useful for an application to add its own message texts that are +handled by the same mechanism. The error handler supports a second "add-on" +message table for this purpose. To define an addon table, set the pointer +err->addon_message_table and the message numbers err->first_addon_message and +err->last_addon_message. If you number the addon messages beginning at 1000 +or so, you won't have to worry about conflicts with the library's built-in +messages. See the sample applications cjpeg/djpeg for an example of using +addon messages (the addon messages are defined in cderror.h). + +Actual invocation of the error handler is done via macros defined in jerror.h: + ERREXITn(...) for fatal errors + WARNMSn(...) for corrupt-data warnings + TRACEMSn(...) for trace and informational messages. +These macros store the message code and any additional parameters into the +error handler struct, then invoke the error_exit() or emit_message() method. +The variants of each macro are for varying numbers of additional parameters. +The additional parameters are inserted into the generated message using +standard printf() format codes. + +See jerror.h and jerror.c for further details. + + +Compressed data handling (source and destination managers) +---------------------------------------------------------- + +The JPEG compression library sends its compressed data to a "destination +manager" module. The default destination manager just writes the data to a +stdio stream, but you can provide your own manager to do something else. +Similarly, the decompression library calls a "source manager" to obtain the +compressed data; you can provide your own source manager if you want the data +to come from somewhere other than a stdio stream. + +In both cases, compressed data is processed a bufferload at a time: the +destination or source manager provides a work buffer, and the library invokes +the manager only when the buffer is filled or emptied. (You could define a +one-character buffer to force the manager to be invoked for each byte, but +that would be rather inefficient.) The buffer's size and location are +controlled by the manager, not by the library. For example, if you desired to +decompress a JPEG datastream that was all in memory, you could just make the +buffer pointer and length point to the original data in memory. Then the +buffer-reload procedure would be invoked only if the decompressor ran off the +end of the datastream, which would indicate an erroneous datastream. + +The work buffer is defined as an array of datatype JOCTET, which is generally +"char" or "unsigned char". On a machine where char is not exactly 8 bits +wide, you must define JOCTET as a wider data type and then modify the data +source and destination modules to transcribe the work arrays into 8-bit units +on external storage. + +A data destination manager struct contains a pointer and count defining the +next byte to write in the work buffer and the remaining free space: + + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + +The library increments the pointer and decrements the count until the buffer +is filled. The manager's empty_output_buffer method must reset the pointer +and count. The manager is expected to remember the buffer's starting address +and total size in private fields not visible to the library. + +A data destination manager provides three methods: + +init_destination (j_compress_ptr cinfo) + Initialize destination. This is called by jpeg_start_compress() + before any data is actually written. It must initialize + next_output_byte and free_in_buffer. free_in_buffer must be + initialized to a positive value. + +empty_output_buffer (j_compress_ptr cinfo) + This is called whenever the buffer has filled (free_in_buffer + reaches zero). In typical applications, it should write out the + *entire* buffer (use the saved start address and buffer length; + ignore the current state of next_output_byte and free_in_buffer). + Then reset the pointer & count to the start of the buffer, and + return TRUE indicating that the buffer has been dumped. + free_in_buffer must be set to a positive value when TRUE is + returned. A FALSE return should only be used when I/O suspension is + desired (this operating mode is discussed in the next section). + +term_destination (j_compress_ptr cinfo) + Terminate destination --- called by jpeg_finish_compress() after all + data has been written. In most applications, this must flush any + data remaining in the buffer. Use either next_output_byte or + free_in_buffer to determine how much data is in the buffer. + +term_destination() is NOT called by jpeg_abort() or jpeg_destroy(). If you +want the destination manager to be cleaned up during an abort, you must do it +yourself. + +You will also need code to create a jpeg_destination_mgr struct, fill in its +method pointers, and insert a pointer to the struct into the "dest" field of +the JPEG compression object. This can be done in-line in your setup code if +you like, but it's probably cleaner to provide a separate routine similar to +the jpeg_stdio_dest() routine of the supplied destination manager. + +Decompression source managers follow a parallel design, but with some +additional frammishes. The source manager struct contains a pointer and count +defining the next byte to read from the work buffer and the number of bytes +remaining: + + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + +The library increments the pointer and decrements the count until the buffer +is emptied. The manager's fill_input_buffer method must reset the pointer and +count. In most applications, the manager must remember the buffer's starting +address and total size in private fields not visible to the library. + +A data source manager provides five methods: + +init_source (j_decompress_ptr cinfo) + Initialize source. This is called by jpeg_read_header() before any + data is actually read. Unlike init_destination(), it may leave + bytes_in_buffer set to 0 (in which case a fill_input_buffer() call + will occur immediately). + +fill_input_buffer (j_decompress_ptr cinfo) + This is called whenever bytes_in_buffer has reached zero and more + data is wanted. In typical applications, it should read fresh data + into the buffer (ignoring the current state of next_input_byte and + bytes_in_buffer), reset the pointer & count to the start of the + buffer, and return TRUE indicating that the buffer has been reloaded. + It is not necessary to fill the buffer entirely, only to obtain at + least one more byte. bytes_in_buffer MUST be set to a positive value + if TRUE is returned. A FALSE return should only be used when I/O + suspension is desired (this mode is discussed in the next section). + +skip_input_data (j_decompress_ptr cinfo, long num_bytes) + Skip num_bytes worth of data. The buffer pointer and count should + be advanced over num_bytes input bytes, refilling the buffer as + needed. This is used to skip over a potentially large amount of + uninteresting data (such as an APPn marker). In some applications + it may be possible to optimize away the reading of the skipped data, + but it's not clear that being smart is worth much trouble; large + skips are uncommon. bytes_in_buffer may be zero on return. + A zero or negative skip count should be treated as a no-op. + +resync_to_restart (j_decompress_ptr cinfo, int desired) + This routine is called only when the decompressor has failed to find + a restart (RSTn) marker where one is expected. Its mission is to + find a suitable point for resuming decompression. For most + applications, we recommend that you just use the default resync + procedure, jpeg_resync_to_restart(). However, if you are able to back + up in the input data stream, or if you have a-priori knowledge about + the likely location of restart markers, you may be able to do better. + Read the read_restart_marker() and jpeg_resync_to_restart() routines + in jdmarker.c if you think you'd like to implement your own resync + procedure. + +term_source (j_decompress_ptr cinfo) + Terminate source --- called by jpeg_finish_decompress() after all + data has been read. Often a no-op. + +For both fill_input_buffer() and skip_input_data(), there is no such thing +as an EOF return. If the end of the file has been reached, the routine has +a choice of exiting via ERREXIT() or inserting fake data into the buffer. +In most cases, generating a warning message and inserting a fake EOI marker +is the best course of action --- this will allow the decompressor to output +however much of the image is there. In pathological cases, the decompressor +may swallow the EOI and again demand data ... just keep feeding it fake EOIs. +jdatasrc.c illustrates the recommended error recovery behavior. + +term_source() is NOT called by jpeg_abort() or jpeg_destroy(). If you want +the source manager to be cleaned up during an abort, you must do it yourself. + +You will also need code to create a jpeg_source_mgr struct, fill in its method +pointers, and insert a pointer to the struct into the "src" field of the JPEG +decompression object. This can be done in-line in your setup code if you +like, but it's probably cleaner to provide a separate routine similar to the +jpeg_stdio_src() routine of the supplied source manager. + +For more information, consult the stdio source and destination managers +in jdatasrc.c and jdatadst.c. + + +I/O suspension +-------------- + +Some applications need to use the JPEG library as an incremental memory-to- +memory filter: when the compressed data buffer is filled or emptied, they want +control to return to the outer loop, rather than expecting that the buffer can +be emptied or reloaded within the data source/destination manager subroutine. +The library supports this need by providing an "I/O suspension" mode, which we +describe in this section. + +The I/O suspension mode is not a panacea: nothing is guaranteed about the +maximum amount of time spent in any one call to the library, so it will not +eliminate response-time problems in single-threaded applications. If you +need guaranteed response time, we suggest you "bite the bullet" and implement +a real multi-tasking capability. + +To use I/O suspension, cooperation is needed between the calling application +and the data source or destination manager; you will always need a custom +source/destination manager. (Please read the previous section if you haven't +already.) The basic idea is that the empty_output_buffer() or +fill_input_buffer() routine is a no-op, merely returning FALSE to indicate +that it has done nothing. Upon seeing this, the JPEG library suspends +operation and returns to its caller. The surrounding application is +responsible for emptying or refilling the work buffer before calling the +JPEG library again. + +Compression suspension: + +For compression suspension, use an empty_output_buffer() routine that returns +FALSE; typically it will not do anything else. This will cause the +compressor to return to the caller of jpeg_write_scanlines(), with the return +value indicating that not all the supplied scanlines have been accepted. +The application must make more room in the output buffer, adjust the output +buffer pointer/count appropriately, and then call jpeg_write_scanlines() +again, pointing to the first unconsumed scanline. + +When forced to suspend, the compressor will backtrack to a convenient stopping +point (usually the start of the current MCU); it will regenerate some output +data when restarted. Therefore, although empty_output_buffer() is only +called when the buffer is filled, you should NOT write out the entire buffer +after a suspension. Write only the data up to the current position of +next_output_byte/free_in_buffer. The data beyond that point will be +regenerated after resumption. + +Because of the backtracking behavior, a good-size output buffer is essential +for efficiency; you don't want the compressor to suspend often. (In fact, an +overly small buffer could lead to infinite looping, if a single MCU required +more data than would fit in the buffer.) We recommend a buffer of at least +several Kbytes. You may want to insert explicit code to ensure that you don't +call jpeg_write_scanlines() unless there is a reasonable amount of space in +the output buffer; in other words, flush the buffer before trying to compress +more data. + +The compressor does not allow suspension while it is trying to write JPEG +markers at the beginning and end of the file. This means that: + * At the beginning of a compression operation, there must be enough free + space in the output buffer to hold the header markers (typically 600 or + so bytes). The recommended buffer size is bigger than this anyway, so + this is not a problem as long as you start with an empty buffer. However, + this restriction might catch you if you insert large special markers, such + as a JFIF thumbnail image, without flushing the buffer afterwards. + * When you call jpeg_finish_compress(), there must be enough space in the + output buffer to emit any buffered data and the final EOI marker. In the + current implementation, half a dozen bytes should suffice for this, but + for safety's sake we recommend ensuring that at least 100 bytes are free + before calling jpeg_finish_compress(). + +A more significant restriction is that jpeg_finish_compress() cannot suspend. +This means you cannot use suspension with multi-pass operating modes, namely +Huffman code optimization and multiple-scan output. Those modes write the +whole file during jpeg_finish_compress(), which will certainly result in +buffer overrun. (Note that this restriction applies only to compression, +not decompression. The decompressor supports input suspension in all of its +operating modes.) + +Decompression suspension: + +For decompression suspension, use a fill_input_buffer() routine that simply +returns FALSE (except perhaps during error recovery, as discussed below). +This will cause the decompressor to return to its caller with an indication +that suspension has occurred. This can happen at four places: + * jpeg_read_header(): will return JPEG_SUSPENDED. + * jpeg_start_decompress(): will return FALSE, rather than its usual TRUE. + * jpeg_read_scanlines(): will return the number of scanlines already + completed (possibly 0). + * jpeg_finish_decompress(): will return FALSE, rather than its usual TRUE. +The surrounding application must recognize these cases, load more data into +the input buffer, and repeat the call. In the case of jpeg_read_scanlines(), +increment the passed pointers past any scanlines successfully read. + +Just as with compression, the decompressor will typically backtrack to a +convenient restart point before suspending. When fill_input_buffer() is +called, next_input_byte/bytes_in_buffer point to the current restart point, +which is where the decompressor will backtrack to if FALSE is returned. +The data beyond that position must NOT be discarded if you suspend; it needs +to be re-read upon resumption. In most implementations, you'll need to shift +this data down to the start of your work buffer and then load more data after +it. Again, this behavior means that a several-Kbyte work buffer is essential +for decent performance; furthermore, you should load a reasonable amount of +new data before resuming decompression. (If you loaded, say, only one new +byte each time around, you could waste a LOT of cycles.) + +The skip_input_data() source manager routine requires special care in a +suspension scenario. This routine is NOT granted the ability to suspend the +decompressor; it can decrement bytes_in_buffer to zero, but no more. If the +requested skip distance exceeds the amount of data currently in the input +buffer, then skip_input_data() must set bytes_in_buffer to zero and record the +additional skip distance somewhere else. The decompressor will immediately +call fill_input_buffer(), which should return FALSE, which will cause a +suspension return. The surrounding application must then arrange to discard +the recorded number of bytes before it resumes loading the input buffer. +(Yes, this design is rather baroque, but it avoids complexity in the far more +common case where a non-suspending source manager is used.) + +If the input data has been exhausted, we recommend that you emit a warning +and insert dummy EOI markers just as a non-suspending data source manager +would do. This can be handled either in the surrounding application logic or +within fill_input_buffer(); the latter is probably more efficient. If +fill_input_buffer() knows that no more data is available, it can set the +pointer/count to point to a dummy EOI marker and then return TRUE just as +though it had read more data in a non-suspending situation. + +The decompressor does not attempt to suspend within standard JPEG markers; +instead it will backtrack to the start of the marker and reprocess the whole +marker next time. Hence the input buffer must be large enough to hold the +longest standard marker in the file. Standard JPEG markers should normally +not exceed a few hundred bytes each (DHT tables are typically the longest). +We recommend at least a 2K buffer for performance reasons, which is much +larger than any correct marker is likely to be. For robustness against +damaged marker length counts, you may wish to insert a test in your +application for the case that the input buffer is completely full and yet +the decoder has suspended without consuming any data --- otherwise, if this +situation did occur, it would lead to an endless loop. (The library can't +provide this test since it has no idea whether "the buffer is full", or +even whether there is a fixed-size input buffer.) + +The input buffer would need to be 64K to allow for arbitrary COM or APPn +markers, but these are handled specially: they are either saved into allocated +memory, or skipped over by calling skip_input_data(). In the former case, +suspension is handled correctly, and in the latter case, the problem of +buffer overrun is placed on skip_input_data's shoulders, as explained above. +Note that if you provide your own marker handling routine for large markers, +you should consider how to deal with buffer overflow. + +Multiple-buffer management: + +In some applications it is desirable to store the compressed data in a linked +list of buffer areas, so as to avoid data copying. This can be handled by +having empty_output_buffer() or fill_input_buffer() set the pointer and count +to reference the next available buffer; FALSE is returned only if no more +buffers are available. Although seemingly straightforward, there is a +pitfall in this approach: the backtrack that occurs when FALSE is returned +could back up into an earlier buffer. For example, when fill_input_buffer() +is called, the current pointer & count indicate the backtrack restart point. +Since fill_input_buffer() will set the pointer and count to refer to a new +buffer, the restart position must be saved somewhere else. Suppose a second +call to fill_input_buffer() occurs in the same library call, and no +additional input data is available, so fill_input_buffer must return FALSE. +If the JPEG library has not moved the pointer/count forward in the current +buffer, then *the correct restart point is the saved position in the prior +buffer*. Prior buffers may be discarded only after the library establishes +a restart point within a later buffer. Similar remarks apply for output into +a chain of buffers. + +The library will never attempt to backtrack over a skip_input_data() call, +so any skipped data can be permanently discarded. You still have to deal +with the case of skipping not-yet-received data, however. + +It's much simpler to use only a single buffer; when fill_input_buffer() is +called, move any unconsumed data (beyond the current pointer/count) down to +the beginning of this buffer and then load new data into the remaining buffer +space. This approach requires a little more data copying but is far easier +to get right. + + +Progressive JPEG support +------------------------ + +Progressive JPEG rearranges the stored data into a series of scans of +increasing quality. In situations where a JPEG file is transmitted across a +slow communications link, a decoder can generate a low-quality image very +quickly from the first scan, then gradually improve the displayed quality as +more scans are received. The final image after all scans are complete is +identical to that of a regular (sequential) JPEG file of the same quality +setting. Progressive JPEG files are often slightly smaller than equivalent +sequential JPEG files, but the possibility of incremental display is the main +reason for using progressive JPEG. + +The IJG encoder library generates progressive JPEG files when given a +suitable "scan script" defining how to divide the data into scans. +Creation of progressive JPEG files is otherwise transparent to the encoder. +Progressive JPEG files can also be read transparently by the decoder library. +If the decoding application simply uses the library as defined above, it +will receive a final decoded image without any indication that the file was +progressive. Of course, this approach does not allow incremental display. +To perform incremental display, an application needs to use the decoder +library's "buffered-image" mode, in which it receives a decoded image +multiple times. + +Each displayed scan requires about as much work to decode as a full JPEG +image of the same size, so the decoder must be fairly fast in relation to the +data transmission rate in order to make incremental display useful. However, +it is possible to skip displaying the image and simply add the incoming bits +to the decoder's coefficient buffer. This is fast because only Huffman +decoding need be done, not IDCT, upsampling, colorspace conversion, etc. +The IJG decoder library allows the application to switch dynamically between +displaying the image and simply absorbing the incoming bits. A properly +coded application can automatically adapt the number of display passes to +suit the time available as the image is received. Also, a final +higher-quality display cycle can be performed from the buffered data after +the end of the file is reached. + +Progressive compression: + +To create a progressive JPEG file (or a multiple-scan sequential JPEG file), +set the scan_info cinfo field to point to an array of scan descriptors, and +perform compression as usual. Instead of constructing your own scan list, +you can call the jpeg_simple_progression() helper routine to create a +recommended progression sequence; this method should be used by all +applications that don't want to get involved in the nitty-gritty of +progressive scan sequence design. (If you want to provide user control of +scan sequences, you may wish to borrow the scan script reading code found +in rdswitch.c, so that you can read scan script files just like cjpeg's.) +When scan_info is not NULL, the compression library will store DCT'd data +into a buffer array as jpeg_write_scanlines() is called, and will emit all +the requested scans during jpeg_finish_compress(). This implies that +multiple-scan output cannot be created with a suspending data destination +manager, since jpeg_finish_compress() does not support suspension. We +should also note that the compressor currently forces Huffman optimization +mode when creating a progressive JPEG file, because the default Huffman +tables are unsuitable for progressive files. + +Progressive decompression: + +When buffered-image mode is not used, the decoder library will read all of +a multi-scan file during jpeg_start_decompress(), so that it can provide a +final decoded image. (Here "multi-scan" means either progressive or +multi-scan sequential.) This makes multi-scan files transparent to the +decoding application. However, existing applications that used suspending +input with version 5 of the IJG library will need to be modified to check +for a suspension return from jpeg_start_decompress(). + +To perform incremental display, an application must use the library's +buffered-image mode. This is described in the next section. + + +Buffered-image mode +------------------- + +In buffered-image mode, the library stores the partially decoded image in a +coefficient buffer, from which it can be read out as many times as desired. +This mode is typically used for incremental display of progressive JPEG files, +but it can be used with any JPEG file. Each scan of a progressive JPEG file +adds more data (more detail) to the buffered image. The application can +display in lockstep with the source file (one display pass per input scan), +or it can allow input processing to outrun display processing. By making +input and display processing run independently, it is possible for the +application to adapt progressive display to a wide range of data transmission +rates. + +The basic control flow for buffered-image decoding is + + jpeg_create_decompress() + set data source + jpeg_read_header() + set overall decompression parameters + cinfo.buffered_image = TRUE; /* select buffered-image mode */ + jpeg_start_decompress() + for (each output pass) { + adjust output decompression parameters if required + jpeg_start_output() /* start a new output pass */ + for (all scanlines in image) { + jpeg_read_scanlines() + display scanlines + } + jpeg_finish_output() /* terminate output pass */ + } + jpeg_finish_decompress() + jpeg_destroy_decompress() + +This differs from ordinary unbuffered decoding in that there is an additional +level of looping. The application can choose how many output passes to make +and how to display each pass. + +The simplest approach to displaying progressive images is to do one display +pass for each scan appearing in the input file. In this case the outer loop +condition is typically + while (! jpeg_input_complete(&cinfo)) +and the start-output call should read + jpeg_start_output(&cinfo, cinfo.input_scan_number); +The second parameter to jpeg_start_output() indicates which scan of the input +file is to be displayed; the scans are numbered starting at 1 for this +purpose. (You can use a loop counter starting at 1 if you like, but using +the library's input scan counter is easier.) The library automatically reads +data as necessary to complete each requested scan, and jpeg_finish_output() +advances to the next scan or end-of-image marker (hence input_scan_number +will be incremented by the time control arrives back at jpeg_start_output()). +With this technique, data is read from the input file only as needed, and +input and output processing run in lockstep. + +After reading the final scan and reaching the end of the input file, the +buffered image remains available; it can be read additional times by +repeating the jpeg_start_output()/jpeg_read_scanlines()/jpeg_finish_output() +sequence. For example, a useful technique is to use fast one-pass color +quantization for display passes made while the image is arriving, followed by +a final display pass using two-pass quantization for highest quality. This +is done by changing the library parameters before the final output pass. +Changing parameters between passes is discussed in detail below. + +In general the last scan of a progressive file cannot be recognized as such +until after it is read, so a post-input display pass is the best approach if +you want special processing in the final pass. + +When done with the image, be sure to call jpeg_finish_decompress() to release +the buffered image (or just use jpeg_destroy_decompress()). + +If input data arrives faster than it can be displayed, the application can +cause the library to decode input data in advance of what's needed to produce +output. This is done by calling the routine jpeg_consume_input(). +The return value is one of the following: + JPEG_REACHED_SOS: reached an SOS marker (the start of a new scan) + JPEG_REACHED_EOI: reached the EOI marker (end of image) + JPEG_ROW_COMPLETED: completed reading one MCU row of compressed data + JPEG_SCAN_COMPLETED: completed reading last MCU row of current scan + JPEG_SUSPENDED: suspended before completing any of the above +(JPEG_SUSPENDED can occur only if a suspending data source is used.) This +routine can be called at any time after initializing the JPEG object. It +reads some additional data and returns when one of the indicated significant +events occurs. (If called after the EOI marker is reached, it will +immediately return JPEG_REACHED_EOI without attempting to read more data.) + +The library's output processing will automatically call jpeg_consume_input() +whenever the output processing overtakes the input; thus, simple lockstep +display requires no direct calls to jpeg_consume_input(). But by adding +calls to jpeg_consume_input(), you can absorb data in advance of what is +being displayed. This has two benefits: + * You can limit buildup of unprocessed data in your input buffer. + * You can eliminate extra display passes by paying attention to the + state of the library's input processing. + +The first of these benefits only requires interspersing calls to +jpeg_consume_input() with your display operations and any other processing +you may be doing. To avoid wasting cycles due to backtracking, it's best to +call jpeg_consume_input() only after a hundred or so new bytes have arrived. +This is discussed further under "I/O suspension", above. (Note: the JPEG +library currently is not thread-safe. You must not call jpeg_consume_input() +from one thread of control if a different library routine is working on the +same JPEG object in another thread.) + +When input arrives fast enough that more than one new scan is available +before you start a new output pass, you may as well skip the output pass +corresponding to the completed scan. This occurs for free if you pass +cinfo.input_scan_number as the target scan number to jpeg_start_output(). +The input_scan_number field is simply the index of the scan currently being +consumed by the input processor. You can ensure that this is up-to-date by +emptying the input buffer just before calling jpeg_start_output(): call +jpeg_consume_input() repeatedly until it returns JPEG_SUSPENDED or +JPEG_REACHED_EOI. + +The target scan number passed to jpeg_start_output() is saved in the +cinfo.output_scan_number field. The library's output processing calls +jpeg_consume_input() whenever the current input scan number and row within +that scan is less than or equal to the current output scan number and row. +Thus, input processing can "get ahead" of the output processing but is not +allowed to "fall behind". You can achieve several different effects by +manipulating this interlock rule. For example, if you pass a target scan +number greater than the current input scan number, the output processor will +wait until that scan starts to arrive before producing any output. (To avoid +an infinite loop, the target scan number is automatically reset to the last +scan number when the end of image is reached. Thus, if you specify a large +target scan number, the library will just absorb the entire input file and +then perform an output pass. This is effectively the same as what +jpeg_start_decompress() does when you don't select buffered-image mode.) +When you pass a target scan number equal to the current input scan number, +the image is displayed no faster than the current input scan arrives. The +final possibility is to pass a target scan number less than the current input +scan number; this disables the input/output interlock and causes the output +processor to simply display whatever it finds in the image buffer, without +waiting for input. (However, the library will not accept a target scan +number less than one, so you can't avoid waiting for the first scan.) + +When data is arriving faster than the output display processing can advance +through the image, jpeg_consume_input() will store data into the buffered +image beyond the point at which the output processing is reading data out +again. If the input arrives fast enough, it may "wrap around" the buffer to +the point where the input is more than one whole scan ahead of the output. +If the output processing simply proceeds through its display pass without +paying attention to the input, the effect seen on-screen is that the lower +part of the image is one or more scans better in quality than the upper part. +Then, when the next output scan is started, you have a choice of what target +scan number to use. The recommended choice is to use the current input scan +number at that time, which implies that you've skipped the output scans +corresponding to the input scans that were completed while you processed the +previous output scan. In this way, the decoder automatically adapts its +speed to the arriving data, by skipping output scans as necessary to keep up +with the arriving data. + +When using this strategy, you'll want to be sure that you perform a final +output pass after receiving all the data; otherwise your last display may not +be full quality across the whole screen. So the right outer loop logic is +something like this: + do { + absorb any waiting input by calling jpeg_consume_input() + final_pass = jpeg_input_complete(&cinfo); + adjust output decompression parameters if required + jpeg_start_output(&cinfo, cinfo.input_scan_number); + ... + jpeg_finish_output() + } while (! final_pass); +rather than quitting as soon as jpeg_input_complete() returns TRUE. This +arrangement makes it simple to use higher-quality decoding parameters +for the final pass. But if you don't want to use special parameters for +the final pass, the right loop logic is like this: + for (;;) { + absorb any waiting input by calling jpeg_consume_input() + jpeg_start_output(&cinfo, cinfo.input_scan_number); + ... + jpeg_finish_output() + if (jpeg_input_complete(&cinfo) && + cinfo.input_scan_number == cinfo.output_scan_number) + break; + } +In this case you don't need to know in advance whether an output pass is to +be the last one, so it's not necessary to have reached EOF before starting +the final output pass; rather, what you want to test is whether the output +pass was performed in sync with the final input scan. This form of the loop +will avoid an extra output pass whenever the decoder is able (or nearly able) +to keep up with the incoming data. + +When the data transmission speed is high, you might begin a display pass, +then find that much or all of the file has arrived before you can complete +the pass. (You can detect this by noting the JPEG_REACHED_EOI return code +from jpeg_consume_input(), or equivalently by testing jpeg_input_complete().) +In this situation you may wish to abort the current display pass and start a +new one using the newly arrived information. To do so, just call +jpeg_finish_output() and then start a new pass with jpeg_start_output(). + +A variant strategy is to abort and restart display if more than one complete +scan arrives during an output pass; this can be detected by noting +JPEG_REACHED_SOS returns and/or examining cinfo.input_scan_number. This +idea should be employed with caution, however, since the display process +might never get to the bottom of the image before being aborted, resulting +in the lower part of the screen being several passes worse than the upper. +In most cases it's probably best to abort an output pass only if the whole +file has arrived and you want to begin the final output pass immediately. + +When receiving data across a communication link, we recommend always using +the current input scan number for the output target scan number; if a +higher-quality final pass is to be done, it should be started (aborting any +incomplete output pass) as soon as the end of file is received. However, +many other strategies are possible. For example, the application can examine +the parameters of the current input scan and decide whether to display it or +not. If the scan contains only chroma data, one might choose not to use it +as the target scan, expecting that the scan will be small and will arrive +quickly. To skip to the next scan, call jpeg_consume_input() until it +returns JPEG_REACHED_SOS or JPEG_REACHED_EOI. Or just use the next higher +number as the target scan for jpeg_start_output(); but that method doesn't +let you inspect the next scan's parameters before deciding to display it. + + +In buffered-image mode, jpeg_start_decompress() never performs input and +thus never suspends. An application that uses input suspension with +buffered-image mode must be prepared for suspension returns from these +routines: +* jpeg_start_output() performs input only if you request 2-pass quantization + and the target scan isn't fully read yet. (This is discussed below.) +* jpeg_read_scanlines(), as always, returns the number of scanlines that it + was able to produce before suspending. +* jpeg_finish_output() will read any markers following the target scan, + up to the end of the file or the SOS marker that begins another scan. + (But it reads no input if jpeg_consume_input() has already reached the + end of the file or a SOS marker beyond the target output scan.) +* jpeg_finish_decompress() will read until the end of file, and thus can + suspend if the end hasn't already been reached (as can be tested by + calling jpeg_input_complete()). +jpeg_start_output(), jpeg_finish_output(), and jpeg_finish_decompress() +all return TRUE if they completed their tasks, FALSE if they had to suspend. +In the event of a FALSE return, the application must load more input data +and repeat the call. Applications that use non-suspending data sources need +not check the return values of these three routines. + + +It is possible to change decoding parameters between output passes in the +buffered-image mode. The decoder library currently supports only very +limited changes of parameters. ONLY THE FOLLOWING parameter changes are +allowed after jpeg_start_decompress() is called: +* dct_method can be changed before each call to jpeg_start_output(). + For example, one could use a fast DCT method for early scans, changing + to a higher quality method for the final scan. +* dither_mode can be changed before each call to jpeg_start_output(); + of course this has no impact if not using color quantization. Typically + one would use ordered dither for initial passes, then switch to + Floyd-Steinberg dither for the final pass. Caution: changing dither mode + can cause more memory to be allocated by the library. Although the amount + of memory involved is not large (a scanline or so), it may cause the + initial max_memory_to_use specification to be exceeded, which in the worst + case would result in an out-of-memory failure. +* do_block_smoothing can be changed before each call to jpeg_start_output(). + This setting is relevant only when decoding a progressive JPEG image. + During the first DC-only scan, block smoothing provides a very "fuzzy" look + instead of the very "blocky" look seen without it; which is better seems a + matter of personal taste. But block smoothing is nearly always a win + during later stages, especially when decoding a successive-approximation + image: smoothing helps to hide the slight blockiness that otherwise shows + up on smooth gradients until the lowest coefficient bits are sent. +* Color quantization mode can be changed under the rules described below. + You *cannot* change between full-color and quantized output (because that + would alter the required I/O buffer sizes), but you can change which + quantization method is used. + +When generating color-quantized output, changing quantization method is a +very useful way of switching between high-speed and high-quality display. +The library allows you to change among its three quantization methods: +1. Single-pass quantization to a fixed color cube. + Selected by cinfo.two_pass_quantize = FALSE and cinfo.colormap = NULL. +2. Single-pass quantization to an application-supplied colormap. + Selected by setting cinfo.colormap to point to the colormap (the value of + two_pass_quantize is ignored); also set cinfo.actual_number_of_colors. +3. Two-pass quantization to a colormap chosen specifically for the image. + Selected by cinfo.two_pass_quantize = TRUE and cinfo.colormap = NULL. + (This is the default setting selected by jpeg_read_header, but it is + probably NOT what you want for the first pass of progressive display!) +These methods offer successively better quality and lesser speed. However, +only the first method is available for quantizing in non-RGB color spaces. + +IMPORTANT: because the different quantizer methods have very different +working-storage requirements, the library requires you to indicate which +one(s) you intend to use before you call jpeg_start_decompress(). (If we did +not require this, the max_memory_to_use setting would be a complete fiction.) +You do this by setting one or more of these three cinfo fields to TRUE: + enable_1pass_quant Fixed color cube colormap + enable_external_quant Externally-supplied colormap + enable_2pass_quant Two-pass custom colormap +All three are initialized FALSE by jpeg_read_header(). But +jpeg_start_decompress() automatically sets TRUE the one selected by the +current two_pass_quantize and colormap settings, so you only need to set the +enable flags for any other quantization methods you plan to change to later. + +After setting the enable flags correctly at jpeg_start_decompress() time, you +can change to any enabled quantization method by setting two_pass_quantize +and colormap properly just before calling jpeg_start_output(). The following +special rules apply: +1. You must explicitly set cinfo.colormap to NULL when switching to 1-pass + or 2-pass mode from a different mode, or when you want the 2-pass + quantizer to be re-run to generate a new colormap. +2. To switch to an external colormap, or to change to a different external + colormap than was used on the prior pass, you must call + jpeg_new_colormap() after setting cinfo.colormap. +NOTE: if you want to use the same colormap as was used in the prior pass, +you should not do either of these things. This will save some nontrivial +switchover costs. +(These requirements exist because cinfo.colormap will always be non-NULL +after completing a prior output pass, since both the 1-pass and 2-pass +quantizers set it to point to their output colormaps. Thus you have to +do one of these two things to notify the library that something has changed. +Yup, it's a bit klugy, but it's necessary to do it this way for backwards +compatibility.) + +Note that in buffered-image mode, the library generates any requested colormap +during jpeg_start_output(), not during jpeg_start_decompress(). + +When using two-pass quantization, jpeg_start_output() makes a pass over the +buffered image to determine the optimum color map; it therefore may take a +significant amount of time, whereas ordinarily it does little work. The +progress monitor hook is called during this pass, if defined. It is also +important to realize that if the specified target scan number is greater than +or equal to the current input scan number, jpeg_start_output() will attempt +to consume input as it makes this pass. If you use a suspending data source, +you need to check for a FALSE return from jpeg_start_output() under these +conditions. The combination of 2-pass quantization and a not-yet-fully-read +target scan is the only case in which jpeg_start_output() will consume input. + + +Application authors who support buffered-image mode may be tempted to use it +for all JPEG images, even single-scan ones. This will work, but it is +inefficient: there is no need to create an image-sized coefficient buffer for +single-scan images. Requesting buffered-image mode for such an image wastes +memory. Worse, it can cost time on large images, since the buffered data has +to be swapped out or written to a temporary file. If you are concerned about +maximum performance on baseline JPEG files, you should use buffered-image +mode only when the incoming file actually has multiple scans. This can be +tested by calling jpeg_has_multiple_scans(), which will return a correct +result at any time after jpeg_read_header() completes. + +It is also worth noting that when you use jpeg_consume_input() to let input +processing get ahead of output processing, the resulting pattern of access to +the coefficient buffer is quite nonsequential. It's best to use the memory +manager jmemnobs.c if you can (ie, if you have enough real or virtual main +memory). If not, at least make sure that max_memory_to_use is set as high as +possible. If the JPEG memory manager has to use a temporary file, you will +probably see a lot of disk traffic and poor performance. (This could be +improved with additional work on the memory manager, but we haven't gotten +around to it yet.) + +In some applications it may be convenient to use jpeg_consume_input() for all +input processing, including reading the initial markers; that is, you may +wish to call jpeg_consume_input() instead of jpeg_read_header() during +startup. This works, but note that you must check for JPEG_REACHED_SOS and +JPEG_REACHED_EOI return codes as the equivalent of jpeg_read_header's codes. +Once the first SOS marker has been reached, you must call +jpeg_start_decompress() before jpeg_consume_input() will consume more input; +it'll just keep returning JPEG_REACHED_SOS until you do. If you read a +tables-only file this way, jpeg_consume_input() will return JPEG_REACHED_EOI +without ever returning JPEG_REACHED_SOS; be sure to check for this case. +If this happens, the decompressor will not read any more input until you call +jpeg_abort() to reset it. It is OK to call jpeg_consume_input() even when not +using buffered-image mode, but in that case it's basically a no-op after the +initial markers have been read: it will just return JPEG_SUSPENDED. + + +Abbreviated datastreams and multiple images +------------------------------------------- + +A JPEG compression or decompression object can be reused to process multiple +images. This saves a small amount of time per image by eliminating the +"create" and "destroy" operations, but that isn't the real purpose of the +feature. Rather, reuse of an object provides support for abbreviated JPEG +datastreams. Object reuse can also simplify processing a series of images in +a single input or output file. This section explains these features. + +A JPEG file normally contains several hundred bytes worth of quantization +and Huffman tables. In a situation where many images will be stored or +transmitted with identical tables, this may represent an annoying overhead. +The JPEG standard therefore permits tables to be omitted. The standard +defines three classes of JPEG datastreams: + * "Interchange" datastreams contain an image and all tables needed to decode + the image. These are the usual kind of JPEG file. + * "Abbreviated image" datastreams contain an image, but are missing some or + all of the tables needed to decode that image. + * "Abbreviated table specification" (henceforth "tables-only") datastreams + contain only table specifications. +To decode an abbreviated image, it is necessary to load the missing table(s) +into the decoder beforehand. This can be accomplished by reading a separate +tables-only file. A variant scheme uses a series of images in which the first +image is an interchange (complete) datastream, while subsequent ones are +abbreviated and rely on the tables loaded by the first image. It is assumed +that once the decoder has read a table, it will remember that table until a +new definition for the same table number is encountered. + +It is the application designer's responsibility to figure out how to associate +the correct tables with an abbreviated image. While abbreviated datastreams +can be useful in a closed environment, their use is strongly discouraged in +any situation where data exchange with other applications might be needed. +Caveat designer. + +The JPEG library provides support for reading and writing any combination of +tables-only datastreams and abbreviated images. In both compression and +decompression objects, a quantization or Huffman table will be retained for +the lifetime of the object, unless it is overwritten by a new table definition. + + +To create abbreviated image datastreams, it is only necessary to tell the +compressor not to emit some or all of the tables it is using. Each +quantization and Huffman table struct contains a boolean field "sent_table", +which normally is initialized to FALSE. For each table used by the image, the +header-writing process emits the table and sets sent_table = TRUE unless it is +already TRUE. (In normal usage, this prevents outputting the same table +definition multiple times, as would otherwise occur because the chroma +components typically share tables.) Thus, setting this field to TRUE before +calling jpeg_start_compress() will prevent the table from being written at +all. + +If you want to create a "pure" abbreviated image file containing no tables, +just call "jpeg_suppress_tables(&cinfo, TRUE)" after constructing all the +tables. If you want to emit some but not all tables, you'll need to set the +individual sent_table fields directly. + +To create an abbreviated image, you must also call jpeg_start_compress() +with a second parameter of FALSE, not TRUE. Otherwise jpeg_start_compress() +will force all the sent_table fields to FALSE. (This is a safety feature to +prevent abbreviated images from being created accidentally.) + +To create a tables-only file, perform the same parameter setup that you +normally would, but instead of calling jpeg_start_compress() and so on, call +jpeg_write_tables(&cinfo). This will write an abbreviated datastream +containing only SOI, DQT and/or DHT markers, and EOI. All the quantization +and Huffman tables that are currently defined in the compression object will +be emitted unless their sent_tables flag is already TRUE, and then all the +sent_tables flags will be set TRUE. + +A sure-fire way to create matching tables-only and abbreviated image files +is to proceed as follows: + + create JPEG compression object + set JPEG parameters + set destination to tables-only file + jpeg_write_tables(&cinfo); + set destination to image file + jpeg_start_compress(&cinfo, FALSE); + write data... + jpeg_finish_compress(&cinfo); + +Since the JPEG parameters are not altered between writing the table file and +the abbreviated image file, the same tables are sure to be used. Of course, +you can repeat the jpeg_start_compress() ... jpeg_finish_compress() sequence +many times to produce many abbreviated image files matching the table file. + +You cannot suppress output of the computed Huffman tables when Huffman +optimization is selected. (If you could, there'd be no way to decode the +image...) Generally, you don't want to set optimize_coding = TRUE when +you are trying to produce abbreviated files. + +In some cases you might want to compress an image using tables which are +not stored in the application, but are defined in an interchange or +tables-only file readable by the application. This can be done by setting up +a JPEG decompression object to read the specification file, then copying the +tables into your compression object. See jpeg_copy_critical_parameters() +for an example of copying quantization tables. + + +To read abbreviated image files, you simply need to load the proper tables +into the decompression object before trying to read the abbreviated image. +If the proper tables are stored in the application program, you can just +allocate the table structs and fill in their contents directly. For example, +to load a fixed quantization table into table slot "n": + + if (cinfo.quant_tbl_ptrs[n] == NULL) + cinfo.quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) &cinfo); + quant_ptr = cinfo.quant_tbl_ptrs[n]; /* quant_ptr is JQUANT_TBL* */ + for (i = 0; i < 64; i++) { + /* Qtable[] is desired quantization table, in natural array order */ + quant_ptr->quantval[i] = Qtable[i]; + } + +Code to load a fixed Huffman table is typically (for AC table "n"): + + if (cinfo.ac_huff_tbl_ptrs[n] == NULL) + cinfo.ac_huff_tbl_ptrs[n] = jpeg_alloc_huff_table((j_common_ptr) &cinfo); + huff_ptr = cinfo.ac_huff_tbl_ptrs[n]; /* huff_ptr is JHUFF_TBL* */ + for (i = 1; i <= 16; i++) { + /* counts[i] is number of Huffman codes of length i bits, i=1..16 */ + huff_ptr->bits[i] = counts[i]; + } + for (i = 0; i < 256; i++) { + /* symbols[] is the list of Huffman symbols, in code-length order */ + huff_ptr->huffval[i] = symbols[i]; + } + +(Note that trying to set cinfo.quant_tbl_ptrs[n] to point directly at a +constant JQUANT_TBL object is not safe. If the incoming file happened to +contain a quantization table definition, your master table would get +overwritten! Instead allocate a working table copy and copy the master table +into it, as illustrated above. Ditto for Huffman tables, of course.) + +You might want to read the tables from a tables-only file, rather than +hard-wiring them into your application. The jpeg_read_header() call is +sufficient to read a tables-only file. You must pass a second parameter of +FALSE to indicate that you do not require an image to be present. Thus, the +typical scenario is + + create JPEG decompression object + set source to tables-only file + jpeg_read_header(&cinfo, FALSE); + set source to abbreviated image file + jpeg_read_header(&cinfo, TRUE); + set decompression parameters + jpeg_start_decompress(&cinfo); + read data... + jpeg_finish_decompress(&cinfo); + +In some cases, you may want to read a file without knowing whether it contains +an image or just tables. In that case, pass FALSE and check the return value +from jpeg_read_header(): it will be JPEG_HEADER_OK if an image was found, +JPEG_HEADER_TABLES_ONLY if only tables were found. (A third return value, +JPEG_SUSPENDED, is possible when using a suspending data source manager.) +Note that jpeg_read_header() will not complain if you read an abbreviated +image for which you haven't loaded the missing tables; the missing-table check +occurs later, in jpeg_start_decompress(). + + +It is possible to read a series of images from a single source file by +repeating the jpeg_read_header() ... jpeg_finish_decompress() sequence, +without releasing/recreating the JPEG object or the data source module. +(If you did reinitialize, any partial bufferload left in the data source +buffer at the end of one image would be discarded, causing you to lose the +start of the next image.) When you use this method, stored tables are +automatically carried forward, so some of the images can be abbreviated images +that depend on tables from earlier images. + +If you intend to write a series of images into a single destination file, +you might want to make a specialized data destination module that doesn't +flush the output buffer at term_destination() time. This would speed things +up by some trifling amount. Of course, you'd need to remember to flush the +buffer after the last image. You can make the later images be abbreviated +ones by passing FALSE to jpeg_start_compress(). + + +Special markers +--------------- + +Some applications may need to insert or extract special data in the JPEG +datastream. The JPEG standard provides marker types "COM" (comment) and +"APP0" through "APP15" (application) to hold application-specific data. +Unfortunately, the use of these markers is not specified by the standard. +COM markers are fairly widely used to hold user-supplied text. The JFIF file +format spec uses APP0 markers with specified initial strings to hold certain +data. Adobe applications use APP14 markers beginning with the string "Adobe" +for miscellaneous data. Other APPn markers are rarely seen, but might +contain almost anything. + +If you wish to store user-supplied text, we recommend you use COM markers +and place readable 7-bit ASCII text in them. Newline conventions are not +standardized --- expect to find LF (Unix style), CR/LF (DOS style), or CR +(Mac style). A robust COM reader should be able to cope with random binary +garbage, including nulls, since some applications generate COM markers +containing non-ASCII junk. (But yours should not be one of them.) + +For program-supplied data, use an APPn marker, and be sure to begin it with an +identifying string so that you can tell whether the marker is actually yours. +It's probably best to avoid using APP0 or APP14 for any private markers. +(NOTE: the upcoming SPIFF standard will use APP8 markers; we recommend you +not use APP8 markers for any private purposes, either.) + +Keep in mind that at most 65533 bytes can be put into one marker, but you +can have as many markers as you like. + +By default, the IJG compression library will write a JFIF APP0 marker if the +selected JPEG colorspace is grayscale or YCbCr, or an Adobe APP14 marker if +the selected colorspace is RGB, CMYK, or YCCK. You can disable this, but +we don't recommend it. The decompression library will recognize JFIF and +Adobe markers and will set the JPEG colorspace properly when one is found. + + +You can write special markers immediately following the datastream header by +calling jpeg_write_marker() after jpeg_start_compress() and before the first +call to jpeg_write_scanlines(). When you do this, the markers appear after +the SOI and the JFIF APP0 and Adobe APP14 markers (if written), but before +all else. Specify the marker type parameter as "JPEG_COM" for COM or +"JPEG_APP0 + n" for APPn. (Actually, jpeg_write_marker will let you write +any marker type, but we don't recommend writing any other kinds of marker.) +For example, to write a user comment string pointed to by comment_text: + jpeg_write_marker(cinfo, JPEG_COM, comment_text, strlen(comment_text)); + +If it's not convenient to store all the marker data in memory at once, +you can instead call jpeg_write_m_header() followed by multiple calls to +jpeg_write_m_byte(). If you do it this way, it's your responsibility to +call jpeg_write_m_byte() exactly the number of times given in the length +parameter to jpeg_write_m_header(). (This method lets you empty the +output buffer partway through a marker, which might be important when +using a suspending data destination module. In any case, if you are using +a suspending destination, you should flush its buffer after inserting +any special markers. See "I/O suspension".) + +Or, if you prefer to synthesize the marker byte sequence yourself, +you can just cram it straight into the data destination module. + +If you are writing JFIF 1.02 extension markers (thumbnail images), don't +forget to set cinfo.JFIF_minor_version = 2 so that the encoder will write the +correct JFIF version number in the JFIF header marker. The library's default +is to write version 1.01, but that's wrong if you insert any 1.02 extension +markers. (We could probably get away with just defaulting to 1.02, but there +used to be broken decoders that would complain about unknown minor version +numbers. To reduce compatibility risks it's safest not to write 1.02 unless +you are actually using 1.02 extensions.) + + +When reading, two methods of handling special markers are available: +1. You can ask the library to save the contents of COM and/or APPn markers +into memory, and then examine them at your leisure afterwards. +2. You can supply your own routine to process COM and/or APPn markers +on-the-fly as they are read. +The first method is simpler to use, especially if you are using a suspending +data source; writing a marker processor that copes with input suspension is +not easy (consider what happens if the marker is longer than your available +input buffer). However, the second method conserves memory since the marker +data need not be kept around after it's been processed. + +For either method, you'd normally set up marker handling after creating a +decompression object and before calling jpeg_read_header(), because the +markers of interest will typically be near the head of the file and so will +be scanned by jpeg_read_header. Once you've established a marker handling +method, it will be used for the life of that decompression object +(potentially many datastreams), unless you change it. Marker handling is +determined separately for COM markers and for each APPn marker code. + + +To save the contents of special markers in memory, call + jpeg_save_markers(cinfo, marker_code, length_limit) +where marker_code is the marker type to save, JPEG_COM or JPEG_APP0+n. +(To arrange to save all the special marker types, you need to call this +routine 17 times, for COM and APP0-APP15.) If the incoming marker is longer +than length_limit data bytes, only length_limit bytes will be saved; this +parameter allows you to avoid chewing up memory when you only need to see the +first few bytes of a potentially large marker. If you want to save all the +data, set length_limit to 0xFFFF; that is enough since marker lengths are only +16 bits. As a special case, setting length_limit to 0 prevents that marker +type from being saved at all. (That is the default behavior, in fact.) + +After jpeg_read_header() completes, you can examine the special markers by +following the cinfo->marker_list pointer chain. All the special markers in +the file appear in this list, in order of their occurrence in the file (but +omitting any markers of types you didn't ask for). Both the original data +length and the saved data length are recorded for each list entry; the latter +will not exceed length_limit for the particular marker type. Note that these +lengths exclude the marker length word, whereas the stored representation +within the JPEG file includes it. (Hence the maximum data length is really +only 65533.) + +It is possible that additional special markers appear in the file beyond the +SOS marker at which jpeg_read_header stops; if so, the marker list will be +extended during reading of the rest of the file. This is not expected to be +common, however. If you are short on memory you may want to reset the length +limit to zero for all marker types after finishing jpeg_read_header, to +ensure that the max_memory_to_use setting cannot be exceeded due to addition +of later markers. + +The marker list remains stored until you call jpeg_finish_decompress or +jpeg_abort, at which point the memory is freed and the list is set to empty. +(jpeg_destroy also releases the storage, of course.) + +Note that the library is internally interested in APP0 and APP14 markers; +if you try to set a small nonzero length limit on these types, the library +will silently force the length up to the minimum it wants. (But you can set +a zero length limit to prevent them from being saved at all.) Also, in a +16-bit environment, the maximum length limit may be constrained to less than +65533 by malloc() limitations. It is therefore best not to assume that the +effective length limit is exactly what you set it to be. + + +If you want to supply your own marker-reading routine, you do it by calling +jpeg_set_marker_processor(). A marker processor routine must have the +signature + boolean jpeg_marker_parser_method (j_decompress_ptr cinfo) +Although the marker code is not explicitly passed, the routine can find it +in cinfo->unread_marker. At the time of call, the marker proper has been +read from the data source module. The processor routine is responsible for +reading the marker length word and the remaining parameter bytes, if any. +Return TRUE to indicate success. (FALSE should be returned only if you are +using a suspending data source and it tells you to suspend. See the standard +marker processors in jdmarker.c for appropriate coding methods if you need to +use a suspending data source.) + +If you override the default APP0 or APP14 processors, it is up to you to +recognize JFIF and Adobe markers if you want colorspace recognition to occur +properly. We recommend copying and extending the default processors if you +want to do that. (A better idea is to save these marker types for later +examination by calling jpeg_save_markers(); that method doesn't interfere +with the library's own processing of these markers.) + +jpeg_set_marker_processor() and jpeg_save_markers() are mutually exclusive +--- if you call one it overrides any previous call to the other, for the +particular marker type specified. + +A simple example of an external COM processor can be found in djpeg.c. +Also, see jpegtran.c for an example of using jpeg_save_markers. + + +Raw (downsampled) image data +---------------------------- + +Some applications need to supply already-downsampled image data to the JPEG +compressor, or to receive raw downsampled data from the decompressor. The +library supports this requirement by allowing the application to write or +read raw data, bypassing the normal preprocessing or postprocessing steps. +The interface is different from the standard one and is somewhat harder to +use. If your interest is merely in bypassing color conversion, we recommend +that you use the standard interface and simply set jpeg_color_space = +in_color_space (or jpeg_color_space = out_color_space for decompression). +The mechanism described in this section is necessary only to supply or +receive downsampled image data, in which not all components have the same +dimensions. + + +To compress raw data, you must supply the data in the colorspace to be used +in the JPEG file (please read the earlier section on Special color spaces) +and downsampled to the sampling factors specified in the JPEG parameters. +You must supply the data in the format used internally by the JPEG library, +namely a JSAMPIMAGE array. This is an array of pointers to two-dimensional +arrays, each of type JSAMPARRAY. Each 2-D array holds the values for one +color component. This structure is necessary since the components are of +different sizes. If the image dimensions are not a multiple of the MCU size, +you must also pad the data correctly (usually, this is done by replicating +the last column and/or row). The data must be padded to a multiple of a DCT +block in each component: that is, each downsampled row must contain a +multiple of 8 valid samples, and there must be a multiple of 8 sample rows +for each component. (For applications such as conversion of digital TV +images, the standard image size is usually a multiple of the DCT block size, +so that no padding need actually be done.) + +The procedure for compression of raw data is basically the same as normal +compression, except that you call jpeg_write_raw_data() in place of +jpeg_write_scanlines(). Before calling jpeg_start_compress(), you must do +the following: + * Set cinfo->raw_data_in to TRUE. (It is set FALSE by jpeg_set_defaults().) + This notifies the library that you will be supplying raw data. + * Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace() + call is a good idea. Note that since color conversion is bypassed, + in_color_space is ignored, except that jpeg_set_defaults() uses it to + choose the default jpeg_color_space setting. + * Ensure the sampling factors, cinfo->comp_info[i].h_samp_factor and + cinfo->comp_info[i].v_samp_factor, are correct. Since these indicate the + dimensions of the data you are supplying, it's wise to set them + explicitly, rather than assuming the library's defaults are what you want. + +To pass raw data to the library, call jpeg_write_raw_data() in place of +jpeg_write_scanlines(). The two routines work similarly except that +jpeg_write_raw_data takes a JSAMPIMAGE data array rather than JSAMPARRAY. +The scanlines count passed to and returned from jpeg_write_raw_data is +measured in terms of the component with the largest v_samp_factor. + +jpeg_write_raw_data() processes one MCU row per call, which is to say +v_samp_factor*DCTSIZE sample rows of each component. The passed num_lines +value must be at least max_v_samp_factor*DCTSIZE, and the return value will +be exactly that amount (or possibly some multiple of that amount, in future +library versions). This is true even on the last call at the bottom of the +image; don't forget to pad your data as necessary. + +The required dimensions of the supplied data can be computed for each +component as + cinfo->comp_info[i].width_in_blocks*DCTSIZE samples per row + cinfo->comp_info[i].height_in_blocks*DCTSIZE rows in image +after jpeg_start_compress() has initialized those fields. If the valid data +is smaller than this, it must be padded appropriately. For some sampling +factors and image sizes, additional dummy DCT blocks are inserted to make +the image a multiple of the MCU dimensions. The library creates such dummy +blocks itself; it does not read them from your supplied data. Therefore you +need never pad by more than DCTSIZE samples. An example may help here. +Assume 2h2v downsampling of YCbCr data, that is + cinfo->comp_info[0].h_samp_factor = 2 for Y + cinfo->comp_info[0].v_samp_factor = 2 + cinfo->comp_info[1].h_samp_factor = 1 for Cb + cinfo->comp_info[1].v_samp_factor = 1 + cinfo->comp_info[2].h_samp_factor = 1 for Cr + cinfo->comp_info[2].v_samp_factor = 1 +and suppose that the nominal image dimensions (cinfo->image_width and +cinfo->image_height) are 101x101 pixels. Then jpeg_start_compress() will +compute downsampled_width = 101 and width_in_blocks = 13 for Y, +downsampled_width = 51 and width_in_blocks = 7 for Cb and Cr (and the same +for the height fields). You must pad the Y data to at least 13*8 = 104 +columns and rows, the Cb/Cr data to at least 7*8 = 56 columns and rows. The +MCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16 +scanlines on each call to jpeg_write_raw_data(), which is to say 16 actual +sample rows of Y and 8 each of Cb and Cr. A total of 7 MCU rows are needed, +so you must pass a total of 7*16 = 112 "scanlines". The last DCT block row +of Y data is dummy, so it doesn't matter what you pass for it in the data +arrays, but the scanlines count must total up to 112 so that all of the Cb +and Cr data gets passed. + +Output suspension is supported with raw-data compression: if the data +destination module suspends, jpeg_write_raw_data() will return 0. +In this case the same data rows must be passed again on the next call. + + +Decompression with raw data output implies bypassing all postprocessing: +you cannot ask for rescaling or color quantization, for instance. More +seriously, you must deal with the color space and sampling factors present in +the incoming file. If your application only handles, say, 2h1v YCbCr data, +you must check for and fail on other color spaces or other sampling factors. +The library will not convert to a different color space for you. + +To obtain raw data output, set cinfo->raw_data_out = TRUE before +jpeg_start_decompress() (it is set FALSE by jpeg_read_header()). Be sure to +verify that the color space and sampling factors are ones you can handle. +Then call jpeg_read_raw_data() in place of jpeg_read_scanlines(). The +decompression process is otherwise the same as usual. + +jpeg_read_raw_data() returns one MCU row per call, and thus you must pass a +buffer of at least max_v_samp_factor*DCTSIZE scanlines (scanline counting is +the same as for raw-data compression). The buffer you pass must be large +enough to hold the actual data plus padding to DCT-block boundaries. As with +compression, any entirely dummy DCT blocks are not processed so you need not +allocate space for them, but the total scanline count includes them. The +above example of computing buffer dimensions for raw-data compression is +equally valid for decompression. + +Input suspension is supported with raw-data decompression: if the data source +module suspends, jpeg_read_raw_data() will return 0. You can also use +buffered-image mode to read raw data in multiple passes. + + +Really raw data: DCT coefficients +--------------------------------- + +It is possible to read or write the contents of a JPEG file as raw DCT +coefficients. This facility is mainly intended for use in lossless +transcoding between different JPEG file formats. Other possible applications +include lossless cropping of a JPEG image, lossless reassembly of a +multi-strip or multi-tile TIFF/JPEG file into a single JPEG datastream, etc. + +To read the contents of a JPEG file as DCT coefficients, open the file and do +jpeg_read_header() as usual. But instead of calling jpeg_start_decompress() +and jpeg_read_scanlines(), call jpeg_read_coefficients(). This will read the +entire image into a set of virtual coefficient-block arrays, one array per +component. The return value is a pointer to an array of virtual-array +descriptors. Each virtual array can be accessed directly using the JPEG +memory manager's access_virt_barray method (see Memory management, below, +and also read structure.doc's discussion of virtual array handling). Or, +for simple transcoding to a different JPEG file format, the array list can +just be handed directly to jpeg_write_coefficients(). + +Each block in the block arrays contains quantized coefficient values in +normal array order (not JPEG zigzag order). The block arrays contain only +DCT blocks containing real data; any entirely-dummy blocks added to fill out +interleaved MCUs at the right or bottom edges of the image are discarded +during reading and are not stored in the block arrays. (The size of each +block array can be determined from the width_in_blocks and height_in_blocks +fields of the component's comp_info entry.) This is also the data format +expected by jpeg_write_coefficients(). + +When you are done using the virtual arrays, call jpeg_finish_decompress() +to release the array storage and return the decompression object to an idle +state; or just call jpeg_destroy() if you don't need to reuse the object. + +If you use a suspending data source, jpeg_read_coefficients() will return +NULL if it is forced to suspend; a non-NULL return value indicates successful +completion. You need not test for a NULL return value when using a +non-suspending data source. + +It is also possible to call jpeg_read_coefficients() to obtain access to the +decoder's coefficient arrays during a normal decode cycle in buffered-image +mode. This frammish might be useful for progressively displaying an incoming +image and then re-encoding it without loss. To do this, decode in buffered- +image mode as discussed previously, then call jpeg_read_coefficients() after +the last jpeg_finish_output() call. The arrays will be available for your use +until you call jpeg_finish_decompress(). + + +To write the contents of a JPEG file as DCT coefficients, you must provide +the DCT coefficients stored in virtual block arrays. You can either pass +block arrays read from an input JPEG file by jpeg_read_coefficients(), or +allocate virtual arrays from the JPEG compression object and fill them +yourself. In either case, jpeg_write_coefficients() is substituted for +jpeg_start_compress() and jpeg_write_scanlines(). Thus the sequence is + * Create compression object + * Set all compression parameters as necessary + * Request virtual arrays if needed + * jpeg_write_coefficients() + * jpeg_finish_compress() + * Destroy or re-use compression object +jpeg_write_coefficients() is passed a pointer to an array of virtual block +array descriptors; the number of arrays is equal to cinfo.num_components. + +The virtual arrays need only have been requested, not realized, before +jpeg_write_coefficients() is called. A side-effect of +jpeg_write_coefficients() is to realize any virtual arrays that have been +requested from the compression object's memory manager. Thus, when obtaining +the virtual arrays from the compression object, you should fill the arrays +after calling jpeg_write_coefficients(). The data is actually written out +when you call jpeg_finish_compress(); jpeg_write_coefficients() only writes +the file header. + +When writing raw DCT coefficients, it is crucial that the JPEG quantization +tables and sampling factors match the way the data was encoded, or the +resulting file will be invalid. For transcoding from an existing JPEG file, +we recommend using jpeg_copy_critical_parameters(). This routine initializes +all the compression parameters to default values (like jpeg_set_defaults()), +then copies the critical information from a source decompression object. +The decompression object should have just been used to read the entire +JPEG input file --- that is, it should be awaiting jpeg_finish_decompress(). + +jpeg_write_coefficients() marks all tables stored in the compression object +as needing to be written to the output file (thus, it acts like +jpeg_start_compress(cinfo, TRUE)). This is for safety's sake, to avoid +emitting abbreviated JPEG files by accident. If you really want to emit an +abbreviated JPEG file, call jpeg_suppress_tables(), or set the tables' +individual sent_table flags, between calling jpeg_write_coefficients() and +jpeg_finish_compress(). + + +Progress monitoring +------------------- + +Some applications may need to regain control from the JPEG library every so +often. The typical use of this feature is to produce a percent-done bar or +other progress display. (For a simple example, see cjpeg.c or djpeg.c.) +Although you do get control back frequently during the data-transferring pass +(the jpeg_read_scanlines or jpeg_write_scanlines loop), any additional passes +will occur inside jpeg_finish_compress or jpeg_start_decompress; those +routines may take a long time to execute, and you don't get control back +until they are done. + +You can define a progress-monitor routine which will be called periodically +by the library. No guarantees are made about how often this call will occur, +so we don't recommend you use it for mouse tracking or anything like that. +At present, a call will occur once per MCU row, scanline, or sample row +group, whichever unit is convenient for the current processing mode; so the +wider the image, the longer the time between calls. During the data +transferring pass, only one call occurs per call of jpeg_read_scanlines or +jpeg_write_scanlines, so don't pass a large number of scanlines at once if +you want fine resolution in the progress count. (If you really need to use +the callback mechanism for time-critical tasks like mouse tracking, you could +insert additional calls inside some of the library's inner loops.) + +To establish a progress-monitor callback, create a struct jpeg_progress_mgr, +fill in its progress_monitor field with a pointer to your callback routine, +and set cinfo->progress to point to the struct. The callback will be called +whenever cinfo->progress is non-NULL. (This pointer is set to NULL by +jpeg_create_compress or jpeg_create_decompress; the library will not change +it thereafter. So if you allocate dynamic storage for the progress struct, +make sure it will live as long as the JPEG object does. Allocating from the +JPEG memory manager with lifetime JPOOL_PERMANENT will work nicely.) You +can use the same callback routine for both compression and decompression. + +The jpeg_progress_mgr struct contains four fields which are set by the library: + long pass_counter; /* work units completed in this pass */ + long pass_limit; /* total number of work units in this pass */ + int completed_passes; /* passes completed so far */ + int total_passes; /* total number of passes expected */ +During any one pass, pass_counter increases from 0 up to (not including) +pass_limit; the step size is usually but not necessarily 1. The pass_limit +value may change from one pass to another. The expected total number of +passes is in total_passes, and the number of passes already completed is in +completed_passes. Thus the fraction of work completed may be estimated as + completed_passes + (pass_counter/pass_limit) + -------------------------------------------- + total_passes +ignoring the fact that the passes may not be equal amounts of work. + +When decompressing, pass_limit can even change within a pass, because it +depends on the number of scans in the JPEG file, which isn't always known in +advance. The computed fraction-of-work-done may jump suddenly (if the library +discovers it has overestimated the number of scans) or even decrease (in the +opposite case). It is not wise to put great faith in the work estimate. + +When using the decompressor's buffered-image mode, the progress monitor work +estimate is likely to be completely unhelpful, because the library has no way +to know how many output passes will be demanded of it. Currently, the library +sets total_passes based on the assumption that there will be one more output +pass if the input file end hasn't yet been read (jpeg_input_complete() isn't +TRUE), but no more output passes if the file end has been reached when the +output pass is started. This means that total_passes will rise as additional +output passes are requested. If you have a way of determining the input file +size, estimating progress based on the fraction of the file that's been read +will probably be more useful than using the library's value. + + +Memory management +----------------- + +This section covers some key facts about the JPEG library's built-in memory +manager. For more info, please read structure.doc's section about the memory +manager, and consult the source code if necessary. + +All memory and temporary file allocation within the library is done via the +memory manager. If necessary, you can replace the "back end" of the memory +manager to control allocation yourself (for example, if you don't want the +library to use malloc() and free() for some reason). + +Some data is allocated "permanently" and will not be freed until the JPEG +object is destroyed. Most data is allocated "per image" and is freed by +jpeg_finish_compress, jpeg_finish_decompress, or jpeg_abort. You can call the +memory manager yourself to allocate structures that will automatically be +freed at these times. Typical code for this is + ptr = (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, size); +Use JPOOL_PERMANENT to get storage that lasts as long as the JPEG object. +Use alloc_large instead of alloc_small for anything bigger than a few Kbytes. +There are also alloc_sarray and alloc_barray routines that automatically +build 2-D sample or block arrays. + +The library's minimum space requirements to process an image depend on the +image's width, but not on its height, because the library ordinarily works +with "strip" buffers that are as wide as the image but just a few rows high. +Some operating modes (eg, two-pass color quantization) require full-image +buffers. Such buffers are treated as "virtual arrays": only the current strip +need be in memory, and the rest can be swapped out to a temporary file. + +If you use the simplest memory manager back end (jmemnobs.c), then no +temporary files are used; virtual arrays are simply malloc()'d. Images bigger +than memory can be processed only if your system supports virtual memory. +The other memory manager back ends support temporary files of various flavors +and thus work in machines without virtual memory. They may also be useful on +Unix machines if you need to process images that exceed available swap space. + +When using temporary files, the library will make the in-memory buffers for +its virtual arrays just big enough to stay within a "maximum memory" setting. +Your application can set this limit by setting cinfo->mem->max_memory_to_use +after creating the JPEG object. (Of course, there is still a minimum size for +the buffers, so the max-memory setting is effective only if it is bigger than +the minimum space needed.) If you allocate any large structures yourself, you +must allocate them before jpeg_start_compress() or jpeg_start_decompress() in +order to have them counted against the max memory limit. Also keep in mind +that space allocated with alloc_small() is ignored, on the assumption that +it's too small to be worth worrying about; so a reasonable safety margin +should be left when setting max_memory_to_use. + +If you use the jmemname.c or jmemdos.c memory manager back end, it is +important to clean up the JPEG object properly to ensure that the temporary +files get deleted. (This is especially crucial with jmemdos.c, where the +"temporary files" may be extended-memory segments; if they are not freed, +DOS will require a reboot to recover the memory.) Thus, with these memory +managers, it's a good idea to provide a signal handler that will trap any +early exit from your program. The handler should call either jpeg_abort() +or jpeg_destroy() for any active JPEG objects. A handler is not needed with +jmemnobs.c, and shouldn't be necessary with jmemansi.c or jmemmac.c either, +since the C library is supposed to take care of deleting files made with +tmpfile(). + + +Memory usage +------------ + +Working memory requirements while performing compression or decompression +depend on image dimensions, image characteristics (such as colorspace and +JPEG process), and operating mode (application-selected options). + +As of v6b, the decompressor requires: + 1. About 24K in more-or-less-fixed-size data. This varies a bit depending + on operating mode and image characteristics (particularly color vs. + grayscale), but it doesn't depend on image dimensions. + 2. Strip buffers (of size proportional to the image width) for IDCT and + upsampling results. The worst case for commonly used sampling factors + is about 34 bytes * width in pixels for a color image. A grayscale image + only needs about 8 bytes per pixel column. + 3. A full-image DCT coefficient buffer is needed to decode a multi-scan JPEG + file (including progressive JPEGs), or whenever you select buffered-image + mode. This takes 2 bytes/coefficient. At typical 2x2 sampling, that's + 3 bytes per pixel for a color image. Worst case (1x1 sampling) requires + 6 bytes/pixel. For grayscale, figure 2 bytes/pixel. + 4. To perform 2-pass color quantization, the decompressor also needs a + 128K color lookup table and a full-image pixel buffer (3 bytes/pixel). +This does not count any memory allocated by the application, such as a +buffer to hold the final output image. + +The above figures are valid for 8-bit JPEG data precision and a machine with +32-bit ints. For 12-bit JPEG data, double the size of the strip buffers and +quantization pixel buffer. The "fixed-size" data will be somewhat smaller +with 16-bit ints, larger with 64-bit ints. Also, CMYK or other unusual +color spaces will require different amounts of space. + +The full-image coefficient and pixel buffers, if needed at all, do not +have to be fully RAM resident; you can have the library use temporary +files instead when the total memory usage would exceed a limit you set. +(But if your OS supports virtual memory, it's probably better to just use +jmemnobs and let the OS do the swapping.) + +The compressor's memory requirements are similar, except that it has no need +for color quantization. Also, it needs a full-image DCT coefficient buffer +if Huffman-table optimization is asked for, even if progressive mode is not +requested. + +If you need more detailed information about memory usage in a particular +situation, you can enable the MEM_STATS code in jmemmgr.c. + + +Library compile-time options +---------------------------- + +A number of compile-time options are available by modifying jmorecfg.h. + +The JPEG standard provides for both the baseline 8-bit DCT process and +a 12-bit DCT process. The IJG code supports 12-bit lossy JPEG if you define +BITS_IN_JSAMPLE as 12 rather than 8. Note that this causes JSAMPLE to be +larger than a char, so it affects the surrounding application's image data. +The sample applications cjpeg and djpeg can support 12-bit mode only for PPM +and GIF file formats; you must disable the other file formats to compile a +12-bit cjpeg or djpeg. (install.doc has more information about that.) +At present, a 12-bit library can handle *only* 12-bit images, not both +precisions. (If you need to include both 8- and 12-bit libraries in a single +application, you could probably do it by defining NEED_SHORT_EXTERNAL_NAMES +for just one of the copies. You'd have to access the 8-bit and 12-bit copies +from separate application source files. This is untested ... if you try it, +we'd like to hear whether it works!) + +Note that a 12-bit library always compresses in Huffman optimization mode, +in order to generate valid Huffman tables. This is necessary because our +default Huffman tables only cover 8-bit data. If you need to output 12-bit +files in one pass, you'll have to supply suitable default Huffman tables. +You may also want to supply your own DCT quantization tables; the existing +quality-scaling code has been developed for 8-bit use, and probably doesn't +generate especially good tables for 12-bit. + +The maximum number of components (color channels) in the image is determined +by MAX_COMPONENTS. The JPEG standard allows up to 255 components, but we +expect that few applications will need more than four or so. + +On machines with unusual data type sizes, you may be able to improve +performance or reduce memory space by tweaking the various typedefs in +jmorecfg.h. In particular, on some RISC CPUs, access to arrays of "short"s +is quite slow; consider trading memory for speed by making JCOEF, INT16, and +UINT16 be "int" or "unsigned int". UINT8 is also a candidate to become int. +You probably don't want to make JSAMPLE be int unless you have lots of memory +to burn. + +You can reduce the size of the library by compiling out various optional +functions. To do this, undefine xxx_SUPPORTED symbols as necessary. + +You can also save a few K by not having text error messages in the library; +the standard error message table occupies about 5Kb. This is particularly +reasonable for embedded applications where there's no good way to display +a message anyway. To do this, remove the creation of the message table +(jpeg_std_message_table[]) from jerror.c, and alter format_message to do +something reasonable without it. You could output the numeric value of the +message code number, for example. If you do this, you can also save a couple +more K by modifying the TRACEMSn() macros in jerror.h to expand to nothing; +you don't need trace capability anyway, right? + + +Portability considerations +-------------------------- + +The JPEG library has been written to be extremely portable; the sample +applications cjpeg and djpeg are slightly less so. This section summarizes +the design goals in this area. (If you encounter any bugs that cause the +library to be less portable than is claimed here, we'd appreciate hearing +about them.) + +The code works fine on ANSI C, C++, and pre-ANSI C compilers, using any of +the popular system include file setups, and some not-so-popular ones too. +See install.doc for configuration procedures. + +The code is not dependent on the exact sizes of the C data types. As +distributed, we make the assumptions that + char is at least 8 bits wide + short is at least 16 bits wide + int is at least 16 bits wide + long is at least 32 bits wide +(These are the minimum requirements of the ANSI C standard.) Wider types will +work fine, although memory may be used inefficiently if char is much larger +than 8 bits or short is much bigger than 16 bits. The code should work +equally well with 16- or 32-bit ints. + +In a system where these assumptions are not met, you may be able to make the +code work by modifying the typedefs in jmorecfg.h. However, you will probably +have difficulty if int is less than 16 bits wide, since references to plain +int abound in the code. + +char can be either signed or unsigned, although the code runs faster if an +unsigned char type is available. If char is wider than 8 bits, you will need +to redefine JOCTET and/or provide custom data source/destination managers so +that JOCTET represents exactly 8 bits of data on external storage. + +The JPEG library proper does not assume ASCII representation of characters. +But some of the image file I/O modules in cjpeg/djpeg do have ASCII +dependencies in file-header manipulation; so does cjpeg's select_file_type() +routine. + +The JPEG library does not rely heavily on the C library. In particular, C +stdio is used only by the data source/destination modules and the error +handler, all of which are application-replaceable. (cjpeg/djpeg are more +heavily dependent on stdio.) malloc and free are called only from the memory +manager "back end" module, so you can use a different memory allocator by +replacing that one file. + +The code generally assumes that C names must be unique in the first 15 +characters. However, global function names can be made unique in the +first 6 characters by defining NEED_SHORT_EXTERNAL_NAMES. + +More info about porting the code may be gleaned by reading jconfig.doc, +jmorecfg.h, and jinclude.h. + + +Notes for MS-DOS implementors +----------------------------- + +The IJG code is designed to work efficiently in 80x86 "small" or "medium" +memory models (i.e., data pointers are 16 bits unless explicitly declared +"far"; code pointers can be either size). You may be able to use small +model to compile cjpeg or djpeg by itself, but you will probably have to use +medium model for any larger application. This won't make much difference in +performance. You *will* take a noticeable performance hit if you use a +large-data memory model (perhaps 10%-25%), and you should avoid "huge" model +if at all possible. + +The JPEG library typically needs 2Kb-3Kb of stack space. It will also +malloc about 20K-30K of near heap space while executing (and lots of far +heap, but that doesn't count in this calculation). This figure will vary +depending on selected operating mode, and to a lesser extent on image size. +There is also about 5Kb-6Kb of constant data which will be allocated in the +near data segment (about 4Kb of this is the error message table). +Thus you have perhaps 20K available for other modules' static data and near +heap space before you need to go to a larger memory model. The C library's +static data will account for several K of this, but that still leaves a good +deal for your needs. (If you are tight on space, you could reduce the sizes +of the I/O buffers allocated by jdatasrc.c and jdatadst.c, say from 4K to +1K. Another possibility is to move the error message table to far memory; +this should be doable with only localized hacking on jerror.c.) + +About 2K of the near heap space is "permanent" memory that will not be +released until you destroy the JPEG object. This is only an issue if you +save a JPEG object between compression or decompression operations. + +Far data space may also be a tight resource when you are dealing with large +images. The most memory-intensive case is decompression with two-pass color +quantization, or single-pass quantization to an externally supplied color +map. This requires a 128Kb color lookup table plus strip buffers amounting +to about 40 bytes per column for typical sampling ratios (eg, about 25600 +bytes for a 640-pixel-wide image). You may not be able to process wide +images if you have large data structures of your own. + +Of course, all of these concerns vanish if you use a 32-bit flat-memory-model +compiler, such as DJGPP or Watcom C. We highly recommend flat model if you +can use it; the JPEG library is significantly faster in flat model. diff --git a/dcmjpeg/docs/ijg_readme.txt b/dcmjpeg/docs/ijg_readme.txt new file mode 100644 index 00000000..24235947 --- /dev/null +++ b/dcmjpeg/docs/ijg_readme.txt @@ -0,0 +1,385 @@ +The Independent JPEG Group's JPEG software +========================================== + +README for release 6b of 27-Mar-1998 +==================================== + +This distribution contains the sixth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. + +Serious users of this software (particularly those incorporating it into +larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to +our electronic mailing list. Mailing list members are notified of updates +and have a chance to participate in technical discussions, etc. + +This software is the work of Tom Lane, Philip Gladstone, Jim Boucher, +Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, +Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG +Group. + +IJG is not affiliated with the official ISO JPEG standards committee. + + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +RELATED SOFTWARE Other stuff you should get. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + install.doc How to configure and install the IJG software. + usage.doc Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + *.1 Unix-style man pages for programs (same info as usage.doc). + wizard.doc Advanced usage instructions for JPEG wizards only. + change.log Version-to-version change highlights. +Programmer and internal documentation: + libjpeg.doc How to use the JPEG library in your own programs. + example.c Sample code for calling the JPEG library. + structure.doc Overview of the JPEG library's internal structure. + filelist.doc Road map of IJG files. + coderules.doc Coding style rules --- please read if you contribute code. + +Please read at least the files install.doc and usage.doc. Useful information +can also be found in the JPEG FAQ (Frequently Asked Questions) article. See +ARCHIVE LOCATIONS below to find out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + + +OVERVIEW +======== + +This package contains C software to implement JPEG image compression and +decompression. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and gray-scale images. JPEG is intended for compressing +"real-world" scenes; line drawings, cartoons and other non-realistic images +are not its strong suit. JPEG is lossy, meaning that the output image is not +exactly identical to the input image. Hence you must not use JPEG if you +have to have identical output bits. However, on typical photographic images, +very good compression levels can be obtained with no visible change, and +remarkably high compression levels are possible if you can tolerate a +low-quality image. For more details, see the references, or just experiment +with various compression settings. + +This software implements JPEG baseline, extended-sequential, progressive +and lossless compression processes. Provision is made for supporting all +variants of these processes, although some uncommon parameter settings aren't +implemented yet. For legal reasons, we are not distributing code for the +arithmetic-coding variants of JPEG; see LEGAL ISSUES. We have made no +provision for supporting the hierarchical processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats or +colormapped displays. These extra functions can be compiled out of the +library if not required for a particular application. We have also included +"jpegtran", a utility for lossless transcoding between different JPEG +processes, and "rdjpgcom" and "wrjpgcom", two simple applications for +inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-1998, Thomas G. Lane. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, +sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. +ansi2knr.c is NOT covered by the above copyright and conditions, but instead +by the usual distribution terms of the Free Software Foundation; principally, +that you must include source code if you redistribute it. (See the file +ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part +of any program generated from the IJG code, this does not limit you more than +the foregoing paragraphs do. + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltconfig, ltmain.sh). Another support script, install-sh, is copyright +by M.I.T. but is also freely distributable. + +It appears that the arithmetic coding option of the JPEG spec is covered by +patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot +legally be used without obtaining one or more licenses. For this reason, +support for arithmetic coding has been removed from the free JPEG software. +(Since arithmetic coding provides only a marginal gain over the unpatented +Huffman mode, it is unlikely that very many implementations will support it.) +So far as we are aware, there are no patent restrictions on the remaining +code. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent, GIF reading support has +been removed altogether, and the GIF writer has been simplified to produce +"uncompressed GIFs". This technique does not use the LZW algorithm; the +resulting GIF files are larger than usual, but are readable by all standard +GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + + +REFERENCES +========== + +We highly recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PostScript file containing a revised version of Wallace's article is +available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best full description of JPEG is the textbook "JPEG Still Image Data +Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published +by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp. +The book includes the complete text of the ISO JPEG standards (DIS 10918-1 +and draft DIS 10918-2). This is by far the most complete exposition of JPEG +in existence, and we highly recommend it. + +The JPEG standard itself is not available electronically; you must order a +paper copy through ISO or ITU. (Unless you feel a need to own a certified +official copy, we recommend buying the Pennebaker and Mitchell book instead; +it's much cheaper and includes a great deal of useful explanatory material.) +In the USA, copies of the standard may be ordered from ANSI Sales at (212) +642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI +doesn't take credit card orders, but Global does.) It's not cheap: as of +1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7% +shipping/handling. The standard is divided into two parts, Part 1 being the +actual specification, while Part 2 covers compliance testing methods. Part 1 +is titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. + +Some extensions to the original JPEG standard are defined in JPEG Part 3, +a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84. IJG +currently does not support any Part 3 extensions. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details we follow the "JFIF" conventions, revision +1.02. A copy of the JFIF spec is available from: + Literature Department + C-Cube Microsystems, Inc. + 1778 McCarthy Blvd. + Milpitas, CA 95035 + phone (408) 944-6300, fax (408) 944-6314 +A PostScript version of this document is available by FTP at +ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz. There is also a plain text +version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing +the figures. + +The TIFF 6.0 file format specification can be obtained by FTP from +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 +(Compression tag 7). Copies of this Note can be obtained from ftp.sgi.com or +from ftp://ftp.uu.net/graphics/jpeg/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. libtiff is available +from ftp://ftp.sgi.com/graphics/tiff/. + + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is ftp.uu.net (Internet +address 192.48.96.9). The most recent released version can always be found +there in directory graphics/jpeg. This particular version will be archived +as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. If you don't have +direct Internet access, UUNET's archives are also available via UUCP; contact +help@uunet.uu.net for information on retrieving files that way. + +Numerous Internet sites maintain copies of the UUNET files. However, only +ftp.uu.net is guaranteed to have the latest official version. + +You can also obtain this software in DOS-compatible "zip" archive format from +the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or +on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12 +"JPEG Tools". Again, these versions may sometimes lag behind the ftp.uu.net +release. + +The JPEG FAQ (Frequently Asked Questions) article is a useful source of +general information about JPEG. It is updated constantly and therefore is +not included in this distribution. The FAQ is posted every two weeks to +Usenet newsgroups comp.graphics.misc, news.answers, and other groups. +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ +and other news.answers archive sites, including the official news.answers +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. +If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu +with body + send usenet/news.answers/jpeg-faq/part1 + send usenet/news.answers/jpeg-faq/part2 + + +RELATED SOFTWARE +================ + +Numerous viewing and image manipulation programs now support JPEG. (Quite a +few of them use this library to do so.) The JPEG FAQ described above lists +some of the more popular free and shareware viewers, and tells where to +obtain them on Internet. + +If you are on a Unix machine, we highly recommend Jef Poskanzer's free +PBMPLUS software, which provides many useful operations on PPM-format image +files. In particular, it can convert PPM images to and from a wide range of +other formats, thus making cjpeg/djpeg considerably more useful. The latest +version is distributed by the NetPBM group, and is available from numerous +sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/. +Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is; +you are likely to have difficulty making it work on any non-Unix machine. + +A different free JPEG implementation, written by the PVRG group at Stanford, +is available from ftp://havefun.stanford.edu/pub/jpeg/. This program +is designed for research and experimentation rather than production use; +it is slower, harder to use, and less portable than the IJG code, but it +is easier to read and modify. Also, the PVRG code supports lossless JPEG, +which we do not. (On the other hand, it doesn't do progressive JPEG.) + + +FILE FORMAT WARS +================ + +Some JPEG programs produce files that are not compatible with our library. +The root of the problem is that the ISO JPEG committee failed to specify a +concrete file format. Some vendors "filled in the blanks" on their own, +creating proprietary formats that no one else could read. (For example, none +of the early commercial JPEG implementations for the Macintosh were able to +exchange compressed files.) + +The file format we have adopted is called JFIF (see REFERENCES). This format +has been agreed to by a number of major commercial JPEG vendors, and it has +become the de facto standard. JFIF is a minimal or "low end" representation. +We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF +Technical Note #2) for "high end" applications that need to record a lot of +additional data about an image. TIFF/JPEG is fairly new and not yet widely +supported, unfortunately. + +The upcoming JPEG Part 3 standard defines a file format called SPIFF. +SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should +be able to read the most common variant of SPIFF. SPIFF has some technical +advantages over JFIF, but its major claim to fame is simply that it is an +official standard rather than an informal one. At this point it is unclear +whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto +standard. IJG intends to support SPIFF once the standard is frozen, but we +have not decided whether it should become our default output format or not. +(In any case, our decoder will remain capable of reading JFIF indefinitely.) + +Various proprietary file formats incorporating JPEG compression also exist. +We have little or no sympathy for the existence of these formats. Indeed, +one of the original reasons for developing this free software was to help +force convergence on common, open format standards for JPEG files. Don't +use a proprietary file format! + + +TO DO +===== + +The major thrust for v7 will probably be improvement of visual quality. +The current method for scaling the quantization tables is known not to be +very good at low Q values. We also intend to investigate block boundary +smoothing, "poor man's variable quantization", and other means of improving +quality-vs-file-size performance without sacrificing compatibility. + +In future versions, we are considering supporting some of the upcoming JPEG +Part 3 extensions --- principally, variable quantization and the SPIFF file +format. + +As always, speeding things up is of great interest. + +Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net. diff --git a/dcmjpeg/docs/ijg_structure.txt b/dcmjpeg/docs/ijg_structure.txt new file mode 100644 index 00000000..3d62accf --- /dev/null +++ b/dcmjpeg/docs/ijg_structure.txt @@ -0,0 +1,1042 @@ +IJG JPEG LIBRARY: SYSTEM ARCHITECTURE + +Copyright (C) 1991-1995, Thomas G. Lane. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +This file provides an overview of the architecture of the IJG JPEG software; +that is, the functions of the various modules in the system and the interfaces +between modules. For more precise details about any data structure or calling +convention, see the include files and comments in the source code. + +We assume that the reader is already somewhat familiar with the JPEG standard. +The README file includes references for learning about JPEG. The file +libjpeg.doc describes the library from the viewpoint of an application +programmer using the library; it's best to read that file before this one. +Also, the file coderules.doc describes the coding style conventions we use. + +In this document, JPEG-specific terminology follows the JPEG standard: + A "component" means a color channel, e.g., Red or Luminance. + A "sample" is a single component value (i.e., one number in the image data). + A "coefficient" is a frequency coefficient (a DCT transform output number). + A "block" is an 8x8 group of samples or coefficients. + A "data unit" is an abstract data type which is either a block for lossy + (DCT-based) codecs or a sample for lossless (predictive) codecs. + An "MCU" (minimum coded unit) is an interleaved set of data units of size + determined by the sampling factors, or a single data unit in a + noninterleaved scan. +We do not use the terms "pixel" and "sample" interchangeably. When we say +pixel, we mean an element of the full-size image, while a sample is an element +of the downsampled image. Thus the number of samples may vary across +components while the number of pixels does not. (This terminology is not used +rigorously throughout the code, but it is used in places where confusion would +otherwise result.) + + +*** System features *** + +The IJG distribution contains two parts: + * A subroutine library for JPEG compression and decompression. + * cjpeg/djpeg, two sample applications that use the library to transform + JFIF JPEG files to and from several other image formats. +cjpeg/djpeg are of no great intellectual complexity: they merely add a simple +command-line user interface and I/O routines for several uncompressed image +formats. This document concentrates on the library itself. + +We desire the library to be capable of supporting all JPEG baseline, extended +sequential, and progressive DCT processes, as well as the lossless (spatial) +process. Hierarchical processes are not supported. + +Within these limits, any set of compression parameters allowed by the JPEG +spec should be readable for decompression. (We can be more restrictive about +what formats we can generate.) Although the system design allows for all +parameter values, some uncommon settings are not yet implemented and may +never be; nonintegral sampling ratios are the prime example. Furthermore, +we treat 8-bit vs. 12-bit data precision as a compile-time switch, not a +run-time option, because most machines can store 8-bit pixels much more +compactly than 12-bit. + +For legal reasons, JPEG arithmetic coding is not currently supported, but +extending the library to include it would be straightforward. + +By itself, the library handles only interchange JPEG datastreams --- in +particular the widely used JFIF file format. The library can be used by +surrounding code to process interchange or abbreviated JPEG datastreams that +are embedded in more complex file formats. (For example, libtiff uses this +library to implement JPEG compression within the TIFF file format.) + +The library includes a substantial amount of code that is not covered by the +JPEG standard but is necessary for typical applications of JPEG. These +functions preprocess the image before JPEG compression or postprocess it after +decompression. They include colorspace conversion, downsampling/upsampling, +and color quantization. This code can be omitted if not needed. + +A wide range of quality vs. speed tradeoffs are possible in JPEG processing, +and even more so in decompression postprocessing. The decompression library +provides multiple implementations that cover most of the useful tradeoffs, +ranging from very-high-quality down to fast-preview operation. On the +compression side we have generally not provided low-quality choices, since +compression is normally less time-critical. It should be understood that the +low-quality modes may not meet the JPEG standard's accuracy requirements; +nonetheless, they are useful for viewers. + + +*** Portability issues *** + +Portability is an essential requirement for the library. The key portability +issues that show up at the level of system architecture are: + +1. Memory usage. We want the code to be able to run on PC-class machines +with limited memory. Images should therefore be processed sequentially (in +strips), to avoid holding the whole image in memory at once. Where a +full-image buffer is necessary, we should be able to use either virtual memory +or temporary files. + +2. Near/far pointer distinction. To run efficiently on 80x86 machines, the +code should distinguish "small" objects (kept in near data space) from +"large" ones (kept in far data space). This is an annoying restriction, but +fortunately it does not impact code quality for less brain-damaged machines, +and the source code clutter turns out to be minimal with sufficient use of +pointer typedefs. + +3. Data precision. We assume that "char" is at least 8 bits, "short" and +"int" at least 16, "long" at least 32. The code will work fine with larger +data sizes, although memory may be used inefficiently in some cases. However, +the JPEG compressed datastream must ultimately appear on external storage as a +sequence of 8-bit bytes if it is to conform to the standard. This may pose a +problem on machines where char is wider than 8 bits. The library represents +compressed data as an array of values of typedef JOCTET. If no data type +exactly 8 bits wide is available, custom data source and data destination +modules must be written to unpack and pack the chosen JOCTET datatype into +8-bit external representation. + + +*** System overview *** + +The compressor and decompressor are each divided into two main sections: +the JPEG compressor or decompressor proper, and the preprocessing or +postprocessing functions. The interface between these two sections is the +image data that the official JPEG spec regards as its input or output: this +data is in the colorspace to be used for compression, and it is downsampled +to the sampling factors to be used. The preprocessing and postprocessing +steps are responsible for converting a normal image representation to or from +this form. (Those few applications that want to deal with YCbCr downsampled +data can skip the preprocessing or postprocessing step.) + +Looking more closely, the compressor library contains the following main +elements: + + Preprocessing: + * Color space conversion (e.g., RGB to YCbCr). + * Edge expansion and downsampling. Optionally, this step can do simple + smoothing --- this is often helpful for low-quality source data. + Lossy JPEG proper: + * MCU assembly, DCT, quantization. + * Entropy coding (sequential or progressive, Huffman or arithmetic). + Lossless JPEG proper: + * Point transform. + * Prediction, differencing. + * Entropy coding (Huffman or arithmetic) + +In addition to these modules we need overall control, marker generation, +and support code (memory management & error handling). There is also a +module responsible for physically writing the output data --- typically +this is just an interface to fwrite(), but some applications may need to +do something else with the data. + +The decompressor library contains the following main elements: + + Lossy JPEG proper: + * Entropy decoding (sequential or progressive, Huffman or arithmetic). + * Dequantization, inverse DCT, MCU disassembly. + Lossless JPEG proper: + * Entropy decoding (Huffman or arithmetic). + * Prediction, undifferencing. + * Point transform, sample size scaling. + Postprocessing: + * Upsampling. Optionally, this step may be able to do more general + rescaling of the image. + * Color space conversion (e.g., YCbCr to RGB). This step may also + provide gamma adjustment [ currently it does not ]. + * Optional color quantization (e.g., reduction to 256 colors). + * Optional color precision reduction (e.g., 24-bit to 15-bit color). + [This feature is not currently implemented.] + +We also need overall control, marker parsing, and a data source module. +The support code (memory management & error handling) can be shared with +the compression half of the library. + +There may be several implementations of each of these elements, particularly +in the decompressor, where a wide range of speed/quality tradeoffs is very +useful. It must be understood that some of the best speedups involve +merging adjacent steps in the pipeline. For example, upsampling, color space +conversion, and color quantization might all be done at once when using a +low-quality ordered-dither technique. The system architecture is designed to +allow such merging where appropriate. + + +Note: it is convenient to regard edge expansion (padding to block boundaries) +as a preprocessing/postprocessing function, even though the JPEG spec includes +it in compression/decompression. We do this because downsampling/upsampling +can be simplified a little if they work on padded data: it's not necessary to +have special cases at the right and bottom edges. Therefore the interface +buffer is always an integral number of blocks wide and high, and we expect +compression preprocessing to pad the source data properly. Padding will occur +only to the next block (8-sample) boundary. In an interleaved-scan situation, +additional dummy blocks may be used to fill out MCUs, but the MCU assembly and +disassembly logic will create or discard these blocks internally. (This is +advantageous for speed reasons, since we avoid DCTing the dummy blocks. +It also permits a small reduction in file size, because the compressor can +choose dummy block contents so as to minimize their size in compressed form. +Finally, it makes the interface buffer specification independent of whether +the file is actually interleaved or not.) Applications that wish to deal +directly with the downsampled data must provide similar buffering and padding +for odd-sized images. + + +*** Poor man's object-oriented programming *** + +It should be clear by now that we have a lot of quasi-independent processing +steps, many of which have several possible behaviors. To avoid cluttering the +code with lots of switch statements, we use a simple form of object-style +programming to separate out the different possibilities. + +For example, two different color quantization algorithms could be implemented +as two separate modules that present the same external interface; at runtime, +the calling code will access the proper module indirectly through an "object". + +We can get the limited features we need while staying within portable C. +The basic tool is a function pointer. An "object" is just a struct +containing one or more function pointer fields, each of which corresponds to +a method name in real object-oriented languages. During initialization we +fill in the function pointers with references to whichever module we have +determined we need to use in this run. Then invocation of the module is done +by indirecting through a function pointer; on most machines this is no more +expensive than a switch statement, which would be the only other way of +making the required run-time choice. The really significant benefit, of +course, is keeping the source code clean and well structured. + +We can also arrange to have private storage that varies between different +implementations of the same kind of object. We do this by making all the +module-specific object structs be separately allocated entities, which will +be accessed via pointers in the master compression or decompression struct. +The "public" fields or methods for a given kind of object are specified by +a commonly known struct. But a module's initialization code can allocate +a larger struct that contains the common struct as its first member, plus +additional private fields. With appropriate pointer casting, the module's +internal functions can access these private fields. (For a simple example, +see jdatadst.c, which implements the external interface specified by struct +jpeg_destination_mgr, but adds extra fields.) + +(Of course this would all be a lot easier if we were using C++, but we are +not yet prepared to assume that everyone has a C++ compiler.) + +An important benefit of this scheme is that it is easy to provide multiple +versions of any method, each tuned to a particular case. While a lot of +precalculation might be done to select an optimal implementation of a method, +the cost per invocation is constant. For example, the upsampling step might +have a "generic" method, plus one or more "hardwired" methods for the most +popular sampling factors; the hardwired methods would be faster because they'd +use straight-line code instead of for-loops. The cost to determine which +method to use is paid only once, at startup, and the selection criteria are +hidden from the callers of the method. + +This plan differs a little bit from usual object-oriented structures, in that +only one instance of each object class will exist during execution. The +reason for having the class structure is that on different runs we may create +different instances (choose to execute different modules). You can think of +the term "method" as denoting the common interface presented by a particular +set of interchangeable functions, and "object" as denoting a group of related +methods, or the total shared interface behavior of a group of modules. + + +*** Overall control structure *** + +We previously mentioned the need for overall control logic in the compression +and decompression libraries. In IJG implementations prior to v5, overall +control was mostly provided by "pipeline control" modules, which proved to be +large, unwieldy, and hard to understand. To improve the situation, the +control logic has been subdivided into multiple modules. The control modules +consist of: + +1. Master control for module selection and initialization. This has two +responsibilities: + + 1A. Startup initialization at the beginning of image processing. + The individual processing modules to be used in this run are selected + and given initialization calls. + + 1B. Per-pass control. This determines how many passes will be performed + and calls each active processing module to configure itself + appropriately at the beginning of each pass. End-of-pass processing, + where necessary, is also invoked from the master control module. + + Method selection is partially distributed, in that a particular processing + module may contain several possible implementations of a particular method, + which it will select among when given its initialization call. The master + control code need only be concerned with decisions that affect more than + one module. + +2. Data buffering control. A separate control module exists for each + inter-processing-step data buffer. This module is responsible for + invoking the processing steps that write or read that data buffer. + +Each buffer controller sees the world as follows: + +input data => processing step A => buffer => processing step B => output data + | | | + ------------------ controller ------------------ + +The controller knows the dataflow requirements of steps A and B: how much data +they want to accept in one chunk and how much they output in one chunk. Its +function is to manage its buffer and call A and B at the proper times. + +A data buffer control module may itself be viewed as a processing step by a +higher-level control module; thus the control modules form a binary tree with +elementary processing steps at the leaves of the tree. + +The control modules are objects. A considerable amount of flexibility can +be had by replacing implementations of a control module. For example: +* Merging of adjacent steps in the pipeline is done by replacing a control + module and its pair of processing-step modules with a single processing- + step module. (Hence the possible merges are determined by the tree of + control modules.) +* In some processing modes, a given interstep buffer need only be a "strip" + buffer large enough to accommodate the desired data chunk sizes. In other + modes, a full-image buffer is needed and several passes are required. + The control module determines which kind of buffer is used and manipulates + virtual array buffers as needed. One or both processing steps may be + unaware of the multi-pass behavior. + +In theory, we might be able to make all of the data buffer controllers +interchangeable and provide just one set of implementations for all. In +practice, each one contains considerable special-case processing for its +particular job. The buffer controller concept should be regarded as an +overall system structuring principle, not as a complete description of the +task performed by any one controller. + + +*** Codec object structure *** + +As noted above, this library supports both the lossy (DCT-based) and lossless +JPEG processes. Because these processes have little in common with one another +(and their implementations share very little code), we need to provide a way to +isloate the underlying JPEG process from the rest of the library. This is +accomplished by introducing an abstract "codec object" which acts a generic +interface to the JPEG (de)compressor proper. + +Using the power of the object-oriented scheme described above, we build the +lossy and lossless modules as two separate implementations of the codec object. +Switching between lossy and lossless processes then becomes as trivial as +assigning the appropriate method pointers during initialization of the library. + + +*** Compression object structure *** + +Here is a sketch of the logical structure of the JPEG compression library: + + |-- Colorspace conversion + |-- Preprocessing controller --| + | |-- Downsampling + | +Main controller --| + | /--> Lossy codec + | / + |-- Compression codec < *OR* + \ + \--> Lossless codec + + +where the lossy codec looks like: + + |-- Forward DCT, quantize +<-- Coefficient controller --| + |-- Entropy encoding + + +and the lossless codec looks like: + + |-- Point transformation + | +<-- Difference controller --|-- Prediction, differencing + | + |-- Lossless entropy encoding + + +This sketch also describes the flow of control (subroutine calls) during +typical image data processing. Each of the components shown in the diagram is +an "object" which may have several different implementations available. One +or more source code files contain the actual implementation(s) of each object. + +The objects shown above are: + +* Main controller: buffer controller for the subsampled-data buffer, which + holds the preprocessed input data. This controller invokes preprocessing to + fill the subsampled-data buffer, and JPEG compression to empty it. There is + usually no need for a full-image buffer here; a strip buffer is adequate. + +* Preprocessing controller: buffer controller for the downsampling input data + buffer, which lies between colorspace conversion and downsampling. Note + that a unified conversion/downsampling module would probably replace this + controller entirely. + +* Colorspace conversion: converts application image data into the desired + JPEG color space; also changes the data from pixel-interleaved layout to + separate component planes. Processes one pixel row at a time. + +* Downsampling: performs reduction of chroma components as required. + Optionally may perform pixel-level smoothing as well. Processes a "row + group" at a time, where a row group is defined as Vmax pixel rows of each + component before downsampling, and Vk sample rows afterwards (remember Vk + differs across components). Some downsampling or smoothing algorithms may + require context rows above and below the current row group; the + preprocessing controller is responsible for supplying these rows via proper + buffering. The downsampler is responsible for edge expansion at the right + edge (i.e., extending each sample row to a multiple of 8 samples); but the + preprocessing controller is responsible for vertical edge expansion (i.e., + duplicating the bottom sample row as needed to make a multiple of 8 rows). + +* Coefficient controller: buffer controller for the DCT-coefficient data. + This controller handles MCU assembly, including insertion of dummy DCT + blocks when needed at the right or bottom edge. When performing + Huffman-code optimization or emitting a multiscan JPEG file, this + controller is responsible for buffering the full image. The equivalent of + one fully interleaved MCU row of subsampled data is processed per call, + even when the JPEG file is noninterleaved. + +* Forward DCT and quantization: Perform DCT, quantize, and emit coefficients. + Works on one or more DCT blocks at a time. (Note: the coefficients are now + emitted in normal array order, which the entropy encoder is expected to + convert to zigzag order as necessary. Prior versions of the IJG code did + the conversion to zigzag order within the quantization step.) + +* Entropy encoding: Perform Huffman or arithmetic entropy coding and emit the + coded data to the data destination module. Works on one MCU per call. + For progressive JPEG, the same DCT blocks are fed to the entropy coder + during each pass, and the coder must emit the appropriate subset of + coefficients. + +* Difference controller: buffer controller for the spatial difference data. + When emitting a multiscan JPEG file, this controller is responsible for + buffering the full image. The equivalent of one fully interleaved MCU row + of subsampled data is processed per call, even when the JPEG file is + noninterleaved. + +* Point transformation: Scale the data down by the point transformation + parameter. + +* Prediction and differencing: Calculate the predictor and subtract it + from the input. Works on one scanline per call. The difference + controller supplies the prior scanline which is used for prediction. + +* Lossless entropy encoding: Perform Huffman or arithmetic entropy coding and + emit the coded data to the data destination module. This module handles MCU + assembly. Works on one MCU-row per call. + +In addition to the above objects, the compression library includes these +objects: + +* Master control: determines the number of passes required, controls overall + and per-pass initialization of the other modules. + +* Marker writing: generates JPEG markers (except for RSTn, which is emitted + by the entropy encoder when needed). + +* Data destination manager: writes the output JPEG datastream to its final + destination (e.g., a file). The destination manager supplied with the + library knows how to write to a stdio stream; for other behaviors, the + surrounding application may provide its own destination manager. + +* Memory manager: allocates and releases memory, controls virtual arrays + (with backing store management, where required). + +* Error handler: performs formatting and output of error and trace messages; + determines handling of nonfatal errors. The surrounding application may + override some or all of this object's methods to change error handling. + +* Progress monitor: supports output of "percent-done" progress reports. + This object represents an optional callback to the surrounding application: + if wanted, it must be supplied by the application. + +The error handler, destination manager, and progress monitor objects are +defined as separate objects in order to simplify application-specific +customization of the JPEG library. A surrounding application may override +individual methods or supply its own all-new implementation of one of these +objects. The object interfaces for these objects are therefore treated as +part of the application interface of the library, whereas the other objects +are internal to the library. + +The error handler and memory manager are shared by JPEG compression and +decompression; the progress monitor, if used, may be shared as well. + + +*** Decompression object structure *** + +Here is a sketch of the logical structure of the JPEG decompression library: + + /--> Lossy codec + / + |-- Decompression codec < *OR* + | \ + | \--> Lossless codec +Main controller --| + | + | |-- Upsampling + |-- Postprocessing controller --| |-- Colorspace conversion + |-- Color quantization + |-- Color precision reduction + + +where the lossy codec looks like: + + |-- Entropy decoding +<-- Coefficient controller --| + |-- Dequantize, Inverse DCT + + +and the lossless codec looks like: + + |-- Lossless entropy decoding + | +<-- Difference controller --|-- Prediction, undifferencing + | + |-- Point transformation, sample size scaling + + +As before, this diagram also represents typical control flow. The objects +shown are: + +* Main controller: buffer controller for the subsampled-data buffer, which + holds the output of JPEG decompression proper. This controller's primary + task is to feed the postprocessing procedure. Some upsampling algorithms + may require context rows above and below the current row group; when this + is true, the main controller is responsible for managing its buffer so as + to make context rows available. In the current design, the main buffer is + always a strip buffer; a full-image buffer is never required. + +* Coefficient controller: buffer controller for the DCT-coefficient data. + This controller handles MCU disassembly, including deletion of any dummy + DCT blocks at the right or bottom edge. When reading a multiscan JPEG + file, this controller is responsible for buffering the full image. + (Buffering DCT coefficients, rather than samples, is necessary to support + progressive JPEG.) The equivalent of one fully interleaved MCU row of + subsampled data is processed per call, even when the source JPEG file is + noninterleaved. + +* Entropy decoding: Read coded data from the data source module and perform + Huffman or arithmetic entropy decoding. Works on one MCU per call. + For progressive JPEG decoding, the coefficient controller supplies the prior + coefficients of each MCU (initially all zeroes), which the entropy decoder + modifies in each scan. + +* Dequantization and inverse DCT: like it says. Note that the coefficients + buffered by the coefficient controller have NOT been dequantized; we + merge dequantization and inverse DCT into a single step for speed reasons. + When scaled-down output is asked for, simplified DCT algorithms may be used + that emit only 1x1, 2x2, or 4x4 samples per DCT block, not the full 8x8. + Works on one DCT block at a time. + +* Difference controller: buffer controller for the spatial difference data. + When reading a multiscan JPEG file, this controller is responsible for + buffering the full image. The equivalent of one fully interleaved MCU row + is processed per call, even when the source JPEG file is noninterleaved. + +* Lossless entropy decoding: Read coded data from the data source module and + perform Huffman or arithmetic entropy decoding. Works on one MCU-row per + call. + +* Prediction and undifferencing: Calculate the predictor and add it to the + decoded difference. Works on one scanline per call. The difference + controller supplies the prior scanline which is used for prediction. + +* Point transform and sample size scaling: Scale the data up by the point + transformation parameter and scale it down to fit into the compiled-in + sample size. + +* Postprocessing controller: buffer controller for the color quantization + input buffer, when quantization is in use. (Without quantization, this + controller just calls the upsampler.) For two-pass quantization, this + controller is responsible for buffering the full-image data. + +* Upsampling: restores chroma components to full size. (May support more + general output rescaling, too. Note that if undersized DCT outputs have + been emitted by the DCT module, this module must adjust so that properly + sized outputs are created.) Works on one row group at a time. This module + also calls the color conversion module, so its top level is effectively a + buffer controller for the upsampling->color conversion buffer. However, in + all but the highest-quality operating modes, upsampling and color + conversion are likely to be merged into a single step. + +* Colorspace conversion: convert from JPEG color space to output color space, + and change data layout from separate component planes to pixel-interleaved. + Works on one pixel row at a time. + +* Color quantization: reduce the data to colormapped form, using either an + externally specified colormap or an internally generated one. This module + is not used for full-color output. Works on one pixel row at a time; may + require two passes to generate a color map. Note that the output will + always be a single component representing colormap indexes. In the current + design, the output values are JSAMPLEs, so an 8-bit compilation cannot + quantize to more than 256 colors. This is unlikely to be a problem in + practice. + +* Color reduction: this module handles color precision reduction, e.g., + generating 15-bit color (5 bits/primary) from JPEG's 24-bit output. + Not quite clear yet how this should be handled... should we merge it with + colorspace conversion??? + +Note that some high-speed operating modes might condense the entire +postprocessing sequence to a single module (upsample, color convert, and +quantize in one step). + +In addition to the above objects, the decompression library includes these +objects: + +* Master control: determines the number of passes required, controls overall + and per-pass initialization of the other modules. This is subdivided into + input and output control: jdinput.c controls only input-side processing, + while jdmaster.c handles overall initialization and output-side control. + +* Marker reading: decodes JPEG markers (except for RSTn). + +* Data source manager: supplies the input JPEG datastream. The source + manager supplied with the library knows how to read from a stdio stream; + for other behaviors, the surrounding application may provide its own source + manager. + +* Memory manager: same as for compression library. + +* Error handler: same as for compression library. + +* Progress monitor: same as for compression library. + +As with compression, the data source manager, error handler, and progress +monitor are candidates for replacement by a surrounding application. + + +*** Decompression input and output separation *** + +To support efficient incremental display of progressive JPEG files, the +decompressor is divided into two sections that can run independently: + +1. Data input includes marker parsing, entropy decoding, and input into the + coefficient controller's DCT coefficient buffer. Note that this + processing is relatively cheap and fast. + +2. Data output reads from the DCT coefficient buffer and performs the IDCT + and all postprocessing steps. + +For a progressive JPEG file, the data input processing is allowed to get +arbitrarily far ahead of the data output processing. (This occurs only +if the application calls jpeg_consume_input(); otherwise input and output +run in lockstep, since the input section is called only when the output +section needs more data.) In this way the application can avoid making +extra display passes when data is arriving faster than the display pass +can run. Furthermore, it is possible to abort an output pass without +losing anything, since the coefficient buffer is read-only as far as the +output section is concerned. See libjpeg.doc for more detail. + +A full-image coefficient array is only created if the JPEG file has multiple +scans (or if the application specifies buffered-image mode anyway). When +reading a single-scan file, the coefficient controller normally creates only +a one-MCU buffer, so input and output processing must run in lockstep in this +case. jpeg_consume_input() is effectively a no-op in this situation. + +The main impact of dividing the decompressor in this fashion is that we must +be very careful with shared variables in the cinfo data structure. Each +variable that can change during the course of decompression must be +classified as belonging to data input or data output, and each section must +look only at its own variables. For example, the data output section may not +depend on any of the variables that describe the current scan in the JPEG +file, because these may change as the data input section advances into a new +scan. + +The progress monitor is (somewhat arbitrarily) defined to treat input of the +file as one pass when buffered-image mode is not used, and to ignore data +input work completely when buffered-image mode is used. Note that the +library has no reliable way to predict the number of passes when dealing +with a progressive JPEG file, nor can it predict the number of output passes +in buffered-image mode. So the work estimate is inherently bogus anyway. + +No comparable division is currently made in the compression library, because +there isn't any real need for it. + + +*** Data formats *** + +Arrays of pixel sample values use the following data structure: + + typedef something JSAMPLE; a pixel component value, 0..MAXJSAMPLE + typedef JSAMPLE *JSAMPROW; ptr to a row of samples + typedef JSAMPROW *JSAMPARRAY; ptr to a list of rows + typedef JSAMPARRAY *JSAMPIMAGE; ptr to a list of color-component arrays + +The basic element type JSAMPLE will typically be one of unsigned char, +(signed) char, or short. Short will be used if samples wider than 8 bits are +to be supported (this is a compile-time option). Otherwise, unsigned char is +used if possible. If the compiler only supports signed chars, then it is +necessary to mask off the value when reading. Thus, all reads of JSAMPLE +values must be coded as "GETJSAMPLE(value)", where the macro will be defined +as "((value) & 0xFF)" on signed-char machines and "((int) (value))" elsewhere. + +With these conventions, JSAMPLE values can be assumed to be >= 0. This helps +simplify correct rounding during downsampling, etc. The JPEG standard's +specification that sample values run from -128..127 is accommodated by +subtracting 128 just as the sample value is copied into the source array for +the DCT step (this will be an array of signed ints). Similarly, during +decompression the output of the IDCT step will be immediately shifted back to +0..255. (NB: different values are required when 12-bit samples are in use. +The code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be +defined as 255 and 128 respectively in an 8-bit implementation, and as 4095 +and 2048 in a 12-bit implementation.) + +We use a pointer per row, rather than a two-dimensional JSAMPLE array. This +choice costs only a small amount of memory and has several benefits: +* Code using the data structure doesn't need to know the allocated width of + the rows. This simplifies edge expansion/compression, since we can work + in an array that's wider than the logical picture width. +* Indexing doesn't require multiplication; this is a performance win on many + machines. +* Arrays with more than 64K total elements can be supported even on machines + where malloc() cannot allocate chunks larger than 64K. +* The rows forming a component array may be allocated at different times + without extra copying. This trick allows some speedups in smoothing steps + that need access to the previous and next rows. + +Note that each color component is stored in a separate array; we don't use the +traditional layout in which the components of a pixel are stored together. +This simplifies coding of modules that work on each component independently, +because they don't need to know how many components there are. Furthermore, +we can read or write each component to a temporary file independently, which +is helpful when dealing with noninterleaved JPEG files. + +In general, a specific sample value is accessed by code such as + GETJSAMPLE(image[colorcomponent][row][col]) +where col is measured from the image left edge, but row is measured from the +first sample row currently in memory. Either of the first two indexings can +be precomputed by copying the relevant pointer. + + +Since most image-processing applications prefer to work on images in which +the components of a pixel are stored together, the data passed to or from the +surrounding application uses the traditional convention: a single pixel is +represented by N consecutive JSAMPLE values, and an image row is an array of +(# of color components)*(image width) JSAMPLEs. One or more rows of data can +be represented by a pointer of type JSAMPARRAY in this scheme. This scheme is +converted to component-wise storage inside the JPEG library. (Applications +that want to skip JPEG preprocessing or postprocessing will have to contend +with component-wise storage.) + + +Arrays of DCT-coefficient values use the following data structure: + + typedef short JCOEF; a 16-bit signed integer + typedef JCOEF JBLOCK[DCTSIZE2]; an 8x8 block of coefficients + typedef JBLOCK *JBLOCKROW; ptr to one horizontal row of 8x8 blocks + typedef JBLOCKROW *JBLOCKARRAY; ptr to a list of such rows + typedef JBLOCKARRAY *JBLOCKIMAGE; ptr to a list of color component arrays + +The underlying type is at least a 16-bit signed integer; while "short" is big +enough on all machines of interest, on some machines it is preferable to use +"int" for speed reasons, despite the storage cost. Coefficients are grouped +into 8x8 blocks (but we always use #defines DCTSIZE and DCTSIZE2 rather than +"8" and "64"). + +The contents of a coefficient block may be in either "natural" or zigzagged +order, and may be true values or divided by the quantization coefficients, +depending on where the block is in the processing pipeline. In the current +library, coefficient blocks are kept in natural order everywhere; the entropy +codecs zigzag or dezigzag the data as it is written or read. The blocks +contain quantized coefficients everywhere outside the DCT/IDCT subsystems. +(This latter decision may need to be revisited to support variable +quantization a la JPEG Part 3.) + +Notice that the allocation unit is now a row of 8x8 blocks, corresponding to +eight rows of samples. Otherwise the structure is much the same as for +samples, and for the same reasons. + +On machines where malloc() can't handle a request bigger than 64Kb, this data +structure limits us to rows of less than 512 JBLOCKs, or a picture width of +4000+ pixels. This seems an acceptable restriction. + + +On 80x86 machines, the bottom-level pointer types (JSAMPROW and JBLOCKROW) +must be declared as "far" pointers, but the upper levels can be "near" +(implying that the pointer lists are allocated in the DS segment). +We use a #define symbol FAR, which expands to the "far" keyword when +compiling on 80x86 machines and to nothing elsewhere. + + +*** Suspendable processing *** + +In some applications it is desirable to use the JPEG library as an +incremental, memory-to-memory filter. In this situation the data source or +destination may be a limited-size buffer, and we can't rely on being able to +empty or refill the buffer at arbitrary times. Instead the application would +like to have control return from the library at buffer overflow/underrun, and +then resume compression or decompression at a later time. + +This scenario is supported for simple cases. (For anything more complex, we +recommend that the application "bite the bullet" and develop real multitasking +capability.) The libjpeg.doc file goes into more detail about the usage and +limitations of this capability; here we address the implications for library +structure. + +The essence of the problem is that the entropy codec (coder or decoder) must +be prepared to stop at arbitrary times. In turn, the controllers that call +the entropy codec must be able to stop before having produced or consumed all +the data that they normally would handle in one call. That part is reasonably +straightforward: we make the controller call interfaces include "progress +counters" which indicate the number of data chunks successfully processed, and +we require callers to test the counter rather than just assume all of the data +was processed. + +Rather than trying to restart at an arbitrary point, the current Huffman +codecs are designed to restart at the beginning of the current MCU after a +suspension due to buffer overflow/underrun. At the start of each call, the +codec's internal state is loaded from permanent storage (in the JPEG object +structures) into local variables. On successful completion of the MCU, the +permanent state is updated. (This copying is not very expensive, and may even +lead to *improved* performance if the local variables can be registerized.) +If a suspension occurs, the codec simply returns without updating the state, +thus effectively reverting to the start of the MCU. Note that this implies +leaving some data unprocessed in the source/destination buffer (ie, the +compressed partial MCU). The data source/destination module interfaces are +specified so as to make this possible. This also implies that the data buffer +must be large enough to hold a worst-case compressed MCU; a couple thousand +bytes should be enough. + +In a successive-approximation AC refinement scan, the progressive Huffman +decoder has to be able to undo assignments of newly nonzero coefficients if it +suspends before the MCU is complete, since decoding requires distinguishing +previously-zero and previously-nonzero coefficients. This is a bit tedious +but probably won't have much effect on performance. Other variants of Huffman +decoding need not worry about this, since they will just store the same values +again if forced to repeat the MCU. + +This approach would probably not work for an arithmetic codec, since its +modifiable state is quite large and couldn't be copied cheaply. Instead it +would have to suspend and resume exactly at the point of the buffer end. + +The JPEG marker reader is designed to cope with suspension at an arbitrary +point. It does so by backing up to the start of the marker parameter segment, +so the data buffer must be big enough to hold the largest marker of interest. +Again, a couple KB should be adequate. (A special "skip" convention is used +to bypass COM and APPn markers, so these can be larger than the buffer size +without causing problems; otherwise a 64K buffer would be needed in the worst +case.) + +The JPEG marker writer currently does *not* cope with suspension. I feel that +this is not necessary; it is much easier simply to require the application to +ensure there is enough buffer space before starting. (An empty 2K buffer is +more than sufficient for the header markers; and ensuring there are a dozen or +two bytes available before calling jpeg_finish_compress() will suffice for the +trailer.) This would not work for writing multi-scan JPEG files, but +we simply do not intend to support that capability with suspension. + + +*** Memory manager services *** + +The JPEG library's memory manager controls allocation and deallocation of +memory, and it manages large "virtual" data arrays on machines where the +operating system does not provide virtual memory. Note that the same +memory manager serves both compression and decompression operations. + +In all cases, allocated objects are tied to a particular compression or +decompression master record, and they will be released when that master +record is destroyed. + +The memory manager does not provide explicit deallocation of objects. +Instead, objects are created in "pools" of free storage, and a whole pool +can be freed at once. This approach helps prevent storage-leak bugs, and +it speeds up operations whenever malloc/free are slow (as they often are). +The pools can be regarded as lifetime identifiers for objects. Two +pools/lifetimes are defined: + * JPOOL_PERMANENT lasts until master record is destroyed + * JPOOL_IMAGE lasts until done with image (JPEG datastream) +Permanent lifetime is used for parameters and tables that should be carried +across from one datastream to another; this includes all application-visible +parameters. Image lifetime is used for everything else. (A third lifetime, +JPOOL_PASS = one processing pass, was originally planned. However it was +dropped as not being worthwhile. The actual usage patterns are such that the +peak memory usage would be about the same anyway; and having per-pass storage +substantially complicates the virtual memory allocation rules --- see below.) + +The memory manager deals with three kinds of object: +1. "Small" objects. Typically these require no more than 10K-20K total. +2. "Large" objects. These may require tens to hundreds of K depending on + image size. Semantically they behave the same as small objects, but we + distinguish them for two reasons: + * On MS-DOS machines, large objects are referenced by FAR pointers, + small objects by NEAR pointers. + * Pool allocation heuristics may differ for large and small objects. + Note that individual "large" objects cannot exceed the size allowed by + type size_t, which may be 64K or less on some machines. +3. "Virtual" objects. These are large 2-D arrays of JSAMPLEs or JBLOCKs + (typically large enough for the entire image being processed). The + memory manager provides stripwise access to these arrays. On machines + without virtual memory, the rest of the array may be swapped out to a + temporary file. + +(Note: JSAMPARRAY and JBLOCKARRAY data structures are a combination of large +objects for the data proper and small objects for the row pointers. For +convenience and speed, the memory manager provides single routines to create +these structures. Similarly, virtual arrays include a small control block +and a JSAMPARRAY or JBLOCKARRAY working buffer, all created with one call.) + +In the present implementation, virtual arrays are only permitted to have image +lifespan. (Permanent lifespan would not be reasonable, and pass lifespan is +not very useful since a virtual array's raison d'etre is to store data for +multiple passes through the image.) We also expect that only "small" objects +will be given permanent lifespan, though this restriction is not required by +the memory manager. + +In a non-virtual-memory machine, some performance benefit can be gained by +making the in-memory buffers for virtual arrays be as large as possible. +(For small images, the buffers might fit entirely in memory, so blind +swapping would be very wasteful.) The memory manager will adjust the height +of the buffers to fit within a prespecified maximum memory usage. In order +to do this in a reasonably optimal fashion, the manager needs to allocate all +of the virtual arrays at once. Therefore, there isn't a one-step allocation +routine for virtual arrays; instead, there is a "request" routine that simply +allocates the control block, and a "realize" routine (called just once) that +determines space allocation and creates all of the actual buffers. The +realize routine must allow for space occupied by non-virtual large objects. +(We don't bother to factor in the space needed for small objects, on the +grounds that it isn't worth the trouble.) + +To support all this, we establish the following protocol for doing business +with the memory manager: + 1. Modules must request virtual arrays (which may have only image lifespan) + during the initial setup phase, i.e., in their jinit_xxx routines. + 2. All "large" objects (including JSAMPARRAYs and JBLOCKARRAYs) must also be + allocated during initial setup. + 3. realize_virt_arrays will be called at the completion of initial setup. + The above conventions ensure that sufficient information is available + for it to choose a good size for virtual array buffers. +Small objects of any lifespan may be allocated at any time. We expect that +the total space used for small objects will be small enough to be negligible +in the realize_virt_arrays computation. + +In a virtual-memory machine, we simply pretend that the available space is +infinite, thus causing realize_virt_arrays to decide that it can allocate all +the virtual arrays as full-size in-memory buffers. The overhead of the +virtual-array access protocol is very small when no swapping occurs. + +A virtual array can be specified to be "pre-zeroed"; when this flag is set, +never-yet-written sections of the array are set to zero before being made +available to the caller. If this flag is not set, never-written sections +of the array contain garbage. (This feature exists primarily because the +equivalent logic would otherwise be needed in jdcoefct.c for progressive +JPEG mode; we may as well make it available for possible other uses.) + +The first write pass on a virtual array is required to occur in top-to-bottom +order; read passes, as well as any write passes after the first one, may +access the array in any order. This restriction exists partly to simplify +the virtual array control logic, and partly because some file systems may not +support seeking beyond the current end-of-file in a temporary file. The main +implication of this restriction is that rearrangement of rows (such as +converting top-to-bottom data order to bottom-to-top) must be handled while +reading data out of the virtual array, not while putting it in. + + +*** Memory manager internal structure *** + +To isolate system dependencies as much as possible, we have broken the +memory manager into two parts. There is a reasonably system-independent +"front end" (jmemmgr.c) and a "back end" that contains only the code +likely to change across systems. All of the memory management methods +outlined above are implemented by the front end. The back end provides +the following routines for use by the front end (none of these routines +are known to the rest of the JPEG code): + +jpeg_mem_init, jpeg_mem_term system-dependent initialization/shutdown + +jpeg_get_small, jpeg_free_small interface to malloc and free library routines + (or their equivalents) + +jpeg_get_large, jpeg_free_large interface to FAR malloc/free in MSDOS machines; + else usually the same as + jpeg_get_small/jpeg_free_small + +jpeg_mem_available estimate available memory + +jpeg_open_backing_store create a backing-store object + +read_backing_store, manipulate a backing-store object +write_backing_store, +close_backing_store + +On some systems there will be more than one type of backing-store object +(specifically, in MS-DOS a backing store file might be an area of extended +memory as well as a disk file). jpeg_open_backing_store is responsible for +choosing how to implement a given object. The read/write/close routines +are method pointers in the structure that describes a given object; this +lets them be different for different object types. + +It may be necessary to ensure that backing store objects are explicitly +released upon abnormal program termination. For example, MS-DOS won't free +extended memory by itself. To support this, we will expect the main program +or surrounding application to arrange to call self_destruct (typically via +jpeg_destroy) upon abnormal termination. This may require a SIGINT signal +handler or equivalent. We don't want to have the back end module install its +own signal handler, because that would pre-empt the surrounding application's +ability to control signal handling. + +The IJG distribution includes several memory manager back end implementations. +Usually the same back end should be suitable for all applications on a given +system, but it is possible for an application to supply its own back end at +need. + + +*** Implications of DNL marker *** + +Some JPEG files may use a DNL marker to postpone definition of the image +height (this would be useful for a fax-like scanner's output, for instance). +In these files the SOF marker claims the image height is 0, and you only +find out the true image height at the end of the first scan. + +We could read these files as follows: +1. Upon seeing zero image height, replace it by 65535 (the maximum allowed). +2. When the DNL is found, update the image height in the global image + descriptor. +This implies that control modules must avoid making copies of the image +height, and must re-test for termination after each MCU row. This would +be easy enough to do. + +In cases where image-size data structures are allocated, this approach will +result in very inefficient use of virtual memory or much-larger-than-necessary +temporary files. This seems acceptable for something that probably won't be a +mainstream usage. People might have to forgo use of memory-hogging options +(such as two-pass color quantization or noninterleaved JPEG files) if they +want efficient conversion of such files. (One could improve efficiency by +demanding a user-supplied upper bound for the height, less than 65536; in most +cases it could be much less.) + +The standard also permits the SOF marker to overestimate the image height, +with a DNL to give the true, smaller height at the end of the first scan. +This would solve the space problems if the overestimate wasn't too great. +However, it implies that you don't even know whether DNL will be used. + +This leads to a couple of very serious objections: +1. Testing for a DNL marker must occur in the inner loop of the decompressor's + Huffman decoder; this implies a speed penalty whether the feature is used + or not. +2. There is no way to hide the last-minute change in image height from an + application using the decoder. Thus *every* application using the IJG + library would suffer a complexity penalty whether it cared about DNL or + not. +We currently do not support DNL because of these problems. + +A different approach is to insist that DNL-using files be preprocessed by a +separate program that reads ahead to the DNL, then goes back and fixes the SOF +marker. This is a much simpler solution and is probably far more efficient. +Even if one wants piped input, buffering the first scan of the JPEG file needs +a lot smaller temp file than is implied by the maximum-height method. For +this approach we'd simply treat DNL as a no-op in the decompressor (at most, +check that it matches the SOF image height). + +We will not worry about making the compressor capable of outputting DNL. +Something similar to the first scheme above could be applied if anyone ever +wants to make that work. diff --git a/dcmjpeg/etc/Makefile.in b/dcmjpeg/etc/Makefile.in new file mode 100644 index 00000000..0a04313b --- /dev/null +++ b/dcmjpeg/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmjpeg/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpeg/include/CMakeLists.txt b/dcmjpeg/include/CMakeLists.txt new file mode 100644 index 00000000..1036689c --- /dev/null +++ b/dcmjpeg/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmjpeg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmjpeg/include/Makefile.in b/dcmjpeg/include/Makefile.in new file mode 100644 index 00000000..bf855808 --- /dev/null +++ b/dcmjpeg/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmjpeg/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmjpeg + for file in dcmtk/dcmjpeg/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmjpeg ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/ddpiimpl.h b/dcmjpeg/include/dcmtk/dcmjpeg/ddpiimpl.h new file mode 100644 index 00000000..0fa877d0 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/ddpiimpl.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2003-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of DICOMDIR image support (plugin) + * + */ + + +#ifndef DDPIIMPL_H +#define DDPIIMPL_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmdata/dcddirif.h" + +#include "dcmtk/dcmjpeg/djdefine.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of the plugable image support for the DICOMDIR class + */ +class DCMTK_DCMJPEG_EXPORT DicomDirImageImplementation + : public DicomDirImagePlugin +{ + public: + + /** constructor + */ + DicomDirImageImplementation(); + + /** destructor + */ + virtual ~DicomDirImageImplementation(); + + /** scale given pixel data (monochrome only). + * The destination pixel data array needs to be allocated by the caller. + * @param srcData source pixel data (byte array) + * @param srcWidth width of the source pixel data (in pixels) + * @param srcHeight height of the source pixel data (in pixels) + * @param dstData destination pixel data (resulting byte array, not NULL) + * @param dstWidth width of the scaled pixel data (in pixels) + * @param dstHeight height of the scaled pixel data (in pixels) + * @return OFTrue if successful, OFFalse otherwise + */ + virtual OFBool scaleData(const Uint8 *srcData, + const unsigned int srcWidth, + const unsigned int srcHeight, + Uint8 *dstData, + const unsigned int dstWidth, + const unsigned int dstHeight) const; + + /** get scaled pixel data from DICOM image. + * The resulting scaled image (pixel array) is always monochrome. + * The resulting pixel data array needs to be allocated by the caller. + * @param dataset DICOM dataset in which the DICOM image is stored + * @param pixel resulting pixel data array (not NULL) + * @param count number of pixels allocated for the resulting array + * @param frame index of the frame to be scaled (1..n) + * @param width width of the scaled image (in pixels) + * @param height height of the scaled image (in pixels) + * @param decompressAll always decompress complete pixel data if true + * @return OFTrue if successful, OFFalse otherwise + */ + virtual OFBool scaleImage(DcmItem *dataset, + Uint8 *pixel, + const unsigned long count, + const unsigned long frame, + const unsigned int width, + const unsigned int height, + const OFBool decompressAll = OFFalse) const; +}; + + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/dipijpeg.h b/dcmjpeg/include/dcmtk/dcmjpeg/dipijpeg.h new file mode 100644 index 00000000..1e624dcc --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/dipijpeg.h @@ -0,0 +1,104 @@ +/* + * + * Copyright (C) 2001-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Joerg Riesmeier + * + * Purpose: Implements JPEG interface for plugable image formats + * + */ + + +#ifndef DIPIJPEG_H +#define DIPIJPEG_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/dcmimgle/diplugin.h" +#include "dcmtk/dcmjpeg/djutils.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DiImage; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of a JPEG plugin for the dcmimgle/dcmimage library + */ +class DCMTK_DCMJPEG_EXPORT DiJPEGPlugin + : public DiPluginFormat +{ + + public: + + /** constructor + */ + DiJPEGPlugin(); + + /** destructor + */ + virtual ~DiJPEGPlugin(); + + /** write given image to a file stream (JPEG format) + * @param image pointer to DICOM image object to be written + * @param stream stream to which the image is written (open in binary mode!) + * @param frame index of frame used for output (default: first frame = 0) + * @return true if successful, false otherwise + */ + virtual int write(DiImage *image, + FILE *stream, + const unsigned long frame = 0) const; + + /** set quality value for JPEG compression + * @param quality quality value (0..100, in percent) + */ + void setQuality(const unsigned int quality); + + /** set (sub) sampling for JPEG compression. + * Only used for color images. ESS_444 means no sub-sampling, ESS_422 horizontal + * subsampling of chroma components and ESS_422 horizontal and vertical subsampling + * of chroma components. + * @param sampling sampling (valid values: ESS_444, ESS_422 or ESS_411) + */ + void setSampling(const E_SubSampling sampling); + + /** callback function used to report IJG warning messages and the like. + * Should not be called by user code directly. + * @param arg opaque pointer to JPEG compress structure + */ + void outputMessage(void *arg) const; + + /** get version information of the TIFF library. + * Typical output format: "IJG, Version 6b 27-Mar-1998 (modified)" + * @return name and version number of the TIFF library + */ + static OFString getLibraryVersionString(); + + + private: + + /// quality value (0..100, in percent), default: 75 + unsigned int Quality; + /// (sub) sampling: ESS_444, ESS_422 (default), ESS_411 + E_SubSampling Sampling; +}; + + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djcodecd.h b/dcmjpeg/include/dcmtk/dcmjpeg/djcodecd.h new file mode 100644 index 00000000..4a747ce9 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djcodecd.h @@ -0,0 +1,272 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: abstract codec class for JPEG decoders. + * + */ + +#ifndef DJCODECD_H +#define DJCODECD_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */ +#include "dcmtk/dcmjpeg/djutils.h" /* for enums */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ + + +class DataInterface; +class DJEncoder; +class DcmDataset; +class DcmItem; +class DJCodecParameter; +class DJDecoder; + +/** abstract codec class for JPEG decoders. + * This abstract class contains most of the application logic + * needed for a dcmdata codec object that implements a JPEG decoder + * using the DJDecoder interface to the underlying JPEG implementation. + * This class only supports decompression, it neither implements + * encoding nor transcoding. + */ +class DCMTK_DCMJPEG_EXPORT DJCodecDecoder : public DcmCodec +{ +public: + + /// default constructor + DJCodecDecoder(); + + /// destructor + virtual ~DJCodecDecoder(); + + /** decompresses the given pixel sequence and + * stores the result in the given uncompressedPixelData element. + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param pixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const; + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decodeFrame( + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const; + + /** transcodes (re-compresses) the given compressed DICOM image and stores + * the result in the given toPixSeq element. + * @param fromRepType current transfer syntax of the compressed image + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * fromPixSeq, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + const DcmCodecParameter * cp, + DcmStack & objStack) const; + + /** checks if this codec is able to convert from the + * given current transfer syntax to the given new + * transfer syntax + * @param oldRepType current transfer syntax + * @param newRepType desired new transfer syntax + * @return true if transformation is supported by this codec, false otherwise. + */ + virtual OFBool canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const; + + /** determine color model of the decompressed image + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const; + + /** returns the transfer syntax that this particular codec + * is able to decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const = 0; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const = 0; + +private: + + /** creates an instance of the compression library to be used for decoding. + * @param toRepParam representation parameter passed to decode() + * @param cp codec parameter passed to decode() + * @param bitsPerSample bits per sample for the image data + * @param isYBR flag indicating whether DICOM photometric interpretation is YCbCr + * @return pointer to newly allocated decoder object + */ + virtual DJDecoder *createDecoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const = 0; + + // static private helper methods + + /** scans the given block of JPEG data for a Start of Frame marker + * and returns the number of bits per pixel stored in the + * Start of Frame block. + * @param data pointer to array, must not be NULL + * @param fragmentLength size of array + * @return bit depth of JPEG data, 0 if no SOF marker found or parse error + */ + static Uint8 scanJpegDataForBitDepth( + const Uint8 *data, + const Uint32 fragmentLength); + + /** reads two bytes from the given array + * of little endian 16-bit values and returns + * the value as Uint16 in local byte order. + * @param data pointer to array, must not be NULL, must at least 2 bytes large + * @return Uint16 read from array + */ + static Uint16 readUint16(const Uint8 *data); + + /** converts an RGB or YBR frame with 8 bits/sample from + * color-by-pixel to color-by-plane planar configuration. + * @param imageFrame pointer to image frame, must contain + * at least 3*columns*rows bytes of pixel data. + * @param columns columns + * @param rows rows + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition createPlanarConfigurationByte( + Uint8 *imageFrame, + Uint16 columns, + Uint16 rows); + + /** converts an RGB or YBR frame with 16 bits/sample from + * color-by-pixel to color-by-plane planar configuration. + * @param imageFrame pointer to image frame, must contain + * at least 3*columns*rows words of pixel data. + * @param columns columns + * @param rows rows + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition createPlanarConfigurationWord( + Uint16 *imageFrame, + Uint16 columns, + Uint16 rows); + + /** examines if a given image requires color-by-plane planar configuration + * depending on SOP Class UID (DICOM IOD) and photometric interpretation. + * All SOP classes defined in the 2003 edition of the DICOM standard or earlier + * are handled correctly. + * @param sopClassUID SOP Class UID + * @param photometricInterpretation decompressed photometric interpretation + * @return true if color-by-plane is required, false otherwise. + */ + static OFBool requiresPlanarConfiguration( + const char *sopClassUID, + EP_Interpretation photometricInterpretation); +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djcodece.h b/dcmjpeg/include/dcmtk/dcmjpeg/djcodece.h new file mode 100644 index 00000000..9fda0226 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djcodece.h @@ -0,0 +1,384 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: abstract codec class for JPEG encoders. + * + */ + +#ifndef DJCODEC_H +#define DJCODEC_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */ +#include "dcmtk/dcmjpeg/djutils.h" /* for enums */ +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ + +class DataInterface; +class DJEncoder; +class DcmDataset; +class DJCodecParameter; +class DJDecoder; +class DcmItem; +class DcmPixelItem; +class DicomImage; +class DcmTagKey; + + +/** abstract codec class for JPEG encoders. + * This abstract class contains most of the application logic + * needed for a dcmdata codec object that implements a JPEG encoder + * using the DJEncoder interface to the underlying JPEG implementation. + * This class only supports compression, it neither implements + * decoding nor transcoding. + */ +class DCMTK_DCMJPEG_EXPORT DJCodecEncoder : public DcmCodec +{ +public: + + /// default constructor + DJCodecEncoder(); + + /// destructor + virtual ~DJCodecEncoder(); + + /** decompresses the given pixel sequence and + * stores the result in the given uncompressedPixelData element. + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param pixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const; + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decodeFrame( + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const; + + /** transcodes (re-compresses) the given compressed DICOM image and stores + * the result in the given toPixSeq element. + * @param fromRepType current transfer syntax of the compressed image + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * fromPixSeq, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + const DcmCodecParameter * cp, + DcmStack & objStack) const; + + /** checks if this codec is able to convert from the + * given current transfer syntax to the given new + * transfer syntax + * @param oldRepType current transfer syntax + * @param newRepType desired new transfer syntax + * @return true if transformation is supported by this codec, false otherwise. + */ + virtual OFBool canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const; + + /** determine color model of the decompressed image + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const; + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const = 0; + +protected: + + /** format compression ratio as string and append to given string object. + * @param arg string to append to + * @param ratio compression ratio + */ + static void appendCompressionRatio(OFString& arg, double ratio); + + /** toggles Planar Configuration of 8-bit pixel data from "by pixel" to + * "by plane" and vice versa. + * @param pixelData - [in/out] Original pixel data (input), contains + * pixel data with toggled Planar configuration after + * returning (output). + * @param numValues - [in] The number of 8 bit values in pixelData + * @param samplesPerPixel - [in] Number of components for one pixel + * @param oldPlanarConfig - [in] The old Planar Configuration, that should + * be toggled. 0 means "by pixel", 1 "by color" + * @return EC_Normal, if conversion was successful; error else + */ + static OFCondition togglePlanarConfiguration8( + Uint8 *pixelData, + const size_t numValues, + const Uint16 samplesPerPixel, + const Uint16 oldPlanarConfig); + + /** toggles Planar Configuration of 16-bit pixel data from "by pixel" to + * "by plane" and vice versa. + * @param pixelData - [in/out] Original pixel data (input), contains + * pixel data with toggled Planar configuration after + * returning (output). + * @param numValues - [in] The number of 16 bit values in pixelData + * @param samplesPerPixel - [in] Number of components for one pixel + * @param oldPlanarConfig - [in] The old Planar Configuration, that should + * be toggled. 0 means "by pixel", 1 "by color" + * @return EC_Normal, if conversion was successful; error else + */ + static OFCondition togglePlanarConfiguration16( + Uint16 *pixelData, + const size_t numValues, + const Uint16 samplesPerPixel, + const Uint16 oldPlanarConfig); + +private: + + /** compresses the given uncompressed DICOM color image and stores + * the result in the given pixSeq element. + * @param YBRmode true if the source image has YBR_FULL or YBR_FULL_422 + * photometric interpretation and can thus be compressed without color + * space conversion. + * @param dataset DICOM dataset containing the pixel data as well as + * descriptive attributes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param compressionRatio compression ratio returned in this parameter + * if successful. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encodeColorImage( + OFBool YBRmode, + DcmItem *dataset, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DJCodecParameter *cp, + double& compressionRatio) const; + + /** compresses the given uncompressed monochrome DICOM image and stores + * the result in the given pixSeq element. + * @param dataset DICOM dataset containing the pixel data as well as + * descriptive attributes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param compressionRatio compression ratio returned in this parameter + * if successful. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encodeMonochromeImage( + DcmItem *dataset, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DJCodecParameter *cp, + double& compressionRatio) const; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. No colorspace + * conversions, modality or windowing transformations are applied + * to guarantee, that the quality of the source image is fully preserved. + * @param toRepParam - [in] representation parameter describing the desired + * @param pixSeq - [out] compressed pixel sequence (pointer to new DcmPixelSequence + * object allocated on heap) returned in this parameter upon success + * @param cp - [in] codec parameters for this codec + * @param objStack - [in/out] stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encodeTrueLossless( + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const; + + /** create Lossy Image Compression and Lossy Image Compression Ratio. + * @param dataset dataset to be modified + * @param ratio image compression ratio > 1. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition updateLossyCompressionRatio(DcmItem *dataset, double ratio) const; + + /** create Derivation Description. + * @param dataset dataset to be modified + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition updateDerivationDescription( + DcmItem *dataset, + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio) const; + + /** for all overlay groups create (60xx,3000) Overlay Data. + * @param dataset dataset to be modified + * @param image DicomImage object for this dataset + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition adjustOverlays(DcmItem *dataset, DicomImage& image) const; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const = 0; + + /** creates 'derivation description' string after encoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @param derivation description returned in this + * parameter which is initially empty + */ + virtual void createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const = 0; + + /** creates an instance of the compression library to be used + * for encoding/decoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample for the image data + * @return pointer to newly allocated codec object + */ + virtual DJEncoder *createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const = 0; + + /** modifies all VOI window center/width settings in the image. + * Modifications are based on the pixel value mapping + * f(x) = (x+voiOffset)*voiFactor + * @param dataset dataset to be updated + * @param voiOffset offset to be added to each pixel + * @param voiFactor factor to be multiplied + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition correctVOIWindows(DcmItem *dataset, double voiOffset, double voiFactor); + + OFCondition updatePlanarConfiguration( + DcmItem *item, + const Uint16 newPlanConf) const; +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h b/dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h new file mode 100644 index 00000000..fee96fdc --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h @@ -0,0 +1,433 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: codec parameter class for dcmjpeg codecs + * + */ + +#ifndef DJCPARAM_H +#define DJCPARAM_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */ +#include "dcmtk/dcmjpeg/djutils.h" /* for enums */ + +/** codec parameter for IJG codecs + */ +class DCMTK_DCMJPEG_EXPORT DJCodecParameter: public DcmCodecParameter +{ +public: + + /** constructor. + * @param pCompressionCSConversion color conversion mode for compression + * @param pDecompressionCSConversion color conversion mode for decompression + * @param pCreateSOPInstanceUID mode for SOP Instance UID creation + * @param pPlanarConfiguration flag describing how planar configuration of + * decompressed color images should be handled + * @param predictor6WorkaroundEnable enable workaround for buggy lossless compressed images with + * overflow in predictor 6 for images with 16 bits/pixel + * @param cornellWorkaroundEnable enable workaround for buggy Cornell lossless compressed images with + * Huffman table overflow + * @param pForceSingleFragmentPerFrame while decompressing a multiframe image, + * assume one fragment per frame even if the JPEG data for some frame is incomplete + * @param pOptimizeHuffman perform huffman table optimization for 8 bits/pixel compression? + * @param pSmoothingFactor smoothing factor for image compression, 0..100 + * @param pForcedBitDepth forced bit depth for image compression, 0 (auto) or 8/12/16 + * @param pFragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @param pCreateOffsetTable create offset table during image compression? + * @param pSampleFactors subsampling mode for color image compression + * @param pWriteYBR422 flag indicating whether a compressed YBR color stream should + * be marked as YBR_FULL or YBR_FULL_422 on DICOM level + * @param pConvertToSC flag indicating whether image should be converted to + * Secondary Capture upon compression + * @param pWindowType mode for VOI transformation of monochrome images + * @param pWindowParameter parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6 + * @param pVoiCenter VOI window center for mode 5 + * @param pVoiWidth VOI window width for mode 5 + * @param pRoiLeft Region of Interest left corner for for VOI transform of monochrome images, mode 7 + * @param pRoiTop Region of Interest upper corner for for VOI transform of monochrome images, mode 7 + * @param pRoiWidth Region of Interest width for for VOI transform of monochrome images, mode 7 + * @param pRoiHeight Region of Interest height for for VOI transform of monochrome images, mode 7 + * @param pUsePixelValues check smallest and largest pixel value and optimize compression, mode 0 only + * @param pUseModalityRescale create Rescale Slope/Intercept to scale back to original pixel range, mode 0 only + * @param pAcceptWrongPaletteTags accept wrong palette attribute tags (only "pseudo lossless" encoder) + * @param pAcrNemaCompatibility accept old ACR-NEMA images without photometric interpretation + * (only "pseudo" lossless encoder) + * @param pTrueLosslessMode Enables true lossless compression (replaces old "pseudo lossless" encoder) + */ + DJCodecParameter( + E_CompressionColorSpaceConversion pCompressionCSConversion, + E_DecompressionColorSpaceConversion pDecompressionCSConversion, + E_UIDCreation pCreateSOPInstanceUID, + E_PlanarConfiguration pPlanarConfiguration, + OFBool predictor6WorkaroundEnable = OFFalse, + OFBool cornellWorkaroundEnable = OFFalse, + OFBool pForceSingleFragmentPerFrame = OFFalse, + OFBool pOptimizeHuffman = OFFalse, + int pSmoothingFactor = 0, + int pForcedBitDepth = 0, + Uint32 pFragmentSize = 0, + OFBool pCreateOffsetTable = OFTrue, + E_SubSampling pSampleFactors = ESS_444, + OFBool pWriteYBR422 = OFFalse, + OFBool pConvertToSC = OFFalse, + size_t pWindowType = 0, + size_t pWindowParameter = 0, + double pVoiCenter = 0.0, + double pVoiWidth = 0.0, + size_t pRoiLeft = 0, + size_t pRoiTop = 0, + size_t pRoiWidth = 0, + size_t pRoiHeight = 0, + OFBool pUsePixelValues = OFTrue, + OFBool pUseModalityRescale = OFFalse, + OFBool pAcceptWrongPaletteTags = OFFalse, + OFBool pAcrNemaCompatibility = OFFalse, + OFBool pTrueLosslessMode = OFTrue); + + /// copy constructor + DJCodecParameter(const DJCodecParameter& arg); + + /// destructor + virtual ~DJCodecParameter(); + + /** this methods creates a copy of type DcmCodecParameter * + * it must be overweritten in every subclass. + * @return copy of this object + */ + virtual DcmCodecParameter *clone() const; + + /** returns the class name as string. + * can be used as poor man's RTTI replacement. + */ + virtual const char *className() const; + + /** returns huffman table optimization flag for 8 bits/pixel compression + * @return huffman table optimization flag for 8 bits/pixel compression + */ + OFBool getOptimizeHuffmanCoding() const + { + return optimizeHuffman; + } + + /** returns smoothing factor for image compression, 0..100 + * @return smoothing factor for image compression, 0..100 + */ + int getSmoothingFactor() const + { + return smoothingFactor; + } + + /** returns forced bit depth for image compression, 0 (auto) or 8/12/16 + * @return forced bit depth for image compression + */ + int getForcedBitDepth() const + { + return forcedBitDepth; + } + + /** returns maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @returnmaximum fragment size for compression + */ + Uint32 getFragmentSize() const + { + return fragmentSize; + } + + /** returns offset table creation flag + * @return offset table creation flag + */ + OFBool getCreateOffsetTable() const + { + return createOffsetTable; + } + + /** returns subsampling mode for color image compression + * @return subsampling mode for color image compression + */ + E_SubSampling getSampleFactors() const + { + return sampleFactors; + } + + /** returns flag indicating whether a compressed YBR color stream should be marked + * as YBR_FULL or YBR_FULL_422 on DICOM level + * @return YBR422 flag + */ + OFBool getWriteYBR422() const + { + return writeYBR422; + } + + /** returns secondary capture conversion flag + * @return secondary capture conversion flag + */ + OFBool getConvertToSC() const + { + return convertToSC; + } + + /** returns mode for SOP Instance UID creation + * @return mode for SOP Instance UID creation + */ + E_UIDCreation getUIDCreation() const + { + return uidCreation; + } + + /** returns mode for VOI transformation of monochrome images. + * @return mode for VOI transformation of monochrome images + */ + size_t getWindowType() const + { + return windowType; + } + + /** returns parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4, 6 + * @return parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4, 6 + */ + size_t getWindowParameter() const + { + return windowParameter; + } + + /** returns VOI window center and width for VOI mode 5 + * @param center VOI center returned in this parameter + * @param width VOI width returned in this parameter + */ + void getVOIWindow(double& center, double& width) const + { + center = voiCenter; + width = voiWidth; + } + + /** returns ROI coordinates for VOI mode 7 + * @param left_pos ROI left edge returned in this parameter + * @param top_pos ROI top edge returned in this parameter + * @param width ROI width returned in this parameter + * @param height ROI height returned in this parameter + */ + void getROI( + size_t& left_pos, + size_t& top_pos, + size_t& width, + size_t& height) const + { + left_pos = roiLeft; + top_pos = roiTop; + width = roiWidth; + height = roiHeight; + } + + /** returns planar configuration flag + * @return planar configuration flag + */ + E_PlanarConfiguration getPlanarConfiguration() const + { + return planarConfiguration; + } + + /** returns color conversion mode for compression + * @return color conversion mode for compression + */ + E_CompressionColorSpaceConversion getCompressionColorSpaceConversion() const + { + return compressionCSConversion; + } + + /** returns color conversion mode for compression + * @return color conversion mode for compression + */ + E_DecompressionColorSpaceConversion getDecompressionColorSpaceConversion() const + { + return decompressionCSConversion; + } + + /** returns flag indicating if compression to be optimized for real pixel values + * @return flag indicating if compression to be optimized for real pixel values + */ + OFBool getUsePixelValues() const + { + return usePixelValues; + } + + /** returns flag indicating if compression should compute Rescale Slope/Intercept + * @return flag indicating if compression should compute Rescale Slope/Intercept + */ + OFBool getUseModalityRescale() const + { + return useModalityRescale; + } + + /** Returns flag indicating if incorrect palette attribute tags should be accepted + * @return flag indicating if incorrect palette attribute tags should be accepted + */ + OFBool getAcceptWrongPaletteTags() const + { + return acceptWrongPaletteTags; + } + + /** Returns flag indicating if compatibility to old ACR-NEMA images without + * photometric interpretation is enabled. + * @return flag indicating if ACR-NEMA compatibility is enabled + */ + + OFBool getAcrNemaCompatibility() const + { + return acrNemaCompatibility; + } + + /** returns flag indicating if real lossless mode is enabled + * @return flag indicating if real lossless mode is enabled + */ + OFBool getTrueLosslessMode() const + { + return trueLosslessMode; + } + + /** returns flag indicating whether the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled + * @return flag indicating whether the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled + */ + OFBool predictor6WorkaroundEnabled() const + { + return predictor6WorkaroundEnabled_; + } + + /** returns flag indicating whether the workaround for buggy Cornell JPEG lossless images with Huffman table overflow is enabled + * @return flag indicating whether the workaround for buggy Cornell JPEG lossless images with Huffman table overflow is enabled + */ + OFBool cornellWorkaroundEnabled() const + { + return cornellWorkaroundEnabled_; + } + + /** returns flag indicating whether one fragment per frame should be enforced while decoding + * @return flag indicating whether one fragment per frame should be enforced while decoding + */ + OFBool getForceSingleFragmentPerFrame() const + { + return forceSingleFragmentPerFrame; + } + +private: + + /// private undefined copy assignment operator + DJCodecParameter& operator=(const DJCodecParameter&); + + /// color conversion mode for compression + E_CompressionColorSpaceConversion compressionCSConversion; + + /// color conversion mode for decompression + E_DecompressionColorSpaceConversion decompressionCSConversion; + + /// flag describing how planar configuration of decompressed color images should be handled + E_PlanarConfiguration planarConfiguration; + + /// perform huffman table optimization for 8 bits/pixel compression? + OFBool optimizeHuffman; + + /// smoothing factor for image compression, 0..100 + int smoothingFactor; + + /// forced bit depth for image compression, 0 (auto) or 8/12/16 + int forcedBitDepth; + + /// maximum fragment size (in kbytes) for compression, 0 for unlimited. + Uint32 fragmentSize; + + /// create offset table during image compression + OFBool createOffsetTable; + + /// subsampling mode for color image compression + E_SubSampling sampleFactors; + + /** flag indicating whether a compressed YBR color stream should be marked + * as YBR_FULL or YBR_FULL_422 on DICOM level + */ + OFBool writeYBR422; + + /// flag indicating whether image should be converted to Secondary Capture upon compression + OFBool convertToSC; + + /// mode for SOP Instance UID creation + E_UIDCreation uidCreation; + + /** mode for VOI transformation of monochrome images. possible values: + 0: no VOI transformation (default). See also variables + usePixelValues (default) or useModalityRescale denoting two + further variables tweaking compression behaviour. + 1: use the n-th VOI window from the image file (see variable windowType) + 2: use the n-th VOI look up table from the image file (see variable windowType) + 3: compute VOI window using min-max algorithm + 4: compute VOI window using Histogram algorithm, ignoring n percent + 5: compute VOI window using center r and width s + 6: compute VOI window using min-max algorithm ignoring extremes + 7: compute region of interest VOI window + */ + size_t windowType; + + /// parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6 + size_t windowParameter; + + /// VOI window center for mode 5 + double voiCenter; + + /// VOI window width for mode 5 + double voiWidth; + + /// Region of Interest left corner for for VOI transform of monochrome images, mode 7 + size_t roiLeft; + + /// Region of Interest upper corner for for VOI transform of monochrome images, mode 7 + size_t roiTop; + + /// Region of Interest width for for VOI transform of monochrome images, mode 7 + size_t roiWidth; + + /// Region of Interest height for for VOI transform of monochrome images, mode 7 + size_t roiHeight; + + /// Check smallest and largest pixel value and optimize compression, mode 0 only + OFBool usePixelValues; + + /// Create Rescale Slope/Intercept to scale back to original pixel range, mode 0 only + OFBool useModalityRescale; + + /// Accept wrong palette attribute tags + OFBool acceptWrongPaletteTags; + + /// Compatibility with old ACR-NEMA images without photometric interpretation + OFBool acrNemaCompatibility; + + /// True losless mode, replaces old "pseudo" lossless encoders, when true (default) + OFBool trueLosslessMode; + + /// flag indicating that the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled + OFBool predictor6WorkaroundEnabled_; + + /// flag indicating that the workaround for buggy Cornell JPEG lossless images with huffman table overflow is enabled + OFBool cornellWorkaroundEnabled_; + + /** flag indicating that while decompressing a multiframe image one fragment per frame + * should be assumed even if the JPEG data for some frame is incomplete + */ + OFBool forceSingleFragmentPerFrame; + +}; + + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdecabs.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdecabs.h new file mode 100644 index 00000000..3049e704 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdecabs.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: abstract base class for decompression classes + * + */ + +#ifndef DJDECABS_H +#define DJDECABS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmjpeg/djutils.h" /* for enums */ +#include "dcmtk/dcmimgle/diutils.h" /* for EP_Interpretation */ + +/** abstract base class for decompression classes. + * Implementations of this class must support suspended decompression + * in which compressed data for one frame is fed block by block + * into the decompression routine, see description below. + */ +class DCMTK_DCMJPEG_EXPORT DJDecoder +{ +public: + + /// default constructor + DJDecoder() + { + } + + /// destructor + virtual ~DJDecoder() + { + } + + /** initializes internal object structures. + * Must be called before a new frame is decompressed. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition init() = 0; + + /** suspended decompression routine. Decompresses a JPEG frame + * until finished or out of data. Can be called with new data + * until a frame is complete. + * @param compressedFrameBuffer pointer to compressed input data, must not be NULL + * @param compressedFrameBufferSize size of buffer, in bytes + * @param uncompressedFrameBuffer pointer to uncompressed output data, must not be NULL. + * This buffer must not change between multiple decode() calls for a single frame. + * @param uncompressedFrameBufferSize size of buffer, in words??? + * Buffer must be large enough to contain a complete frame. + * @param isSigned OFTrue, if uncompressed pixel data is signed, OFFalse otherwise + * @return EC_Normal if successful, EC_Suspend if more data is needed, an error code otherwise. + */ + virtual OFCondition decode( + Uint8 *compressedFrameBuffer, + Uint32 compressedFrameBufferSize, + Uint8 *uncompressedFrameBuffer, + Uint32 uncompressedFrameBufferSize, + OFBool isSigned) = 0; + + /** returns the number of bytes per sample that will be written when decoding. + */ + virtual Uint16 bytesPerSample() const = 0; + + /** after successful compression, + * returns the color model of the decompressed image + */ + virtual EP_Interpretation getDecompressedColorModel() const = 0; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdecbas.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdecbas.h new file mode 100644 index 00000000..3809f6aa --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdecbas.h @@ -0,0 +1,69 @@ +/* + * + * Copyright (C) 1997-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Baseline (lossy, 8-bit) + * + */ + +#ifndef DJDECBAS_H +#define DJDECBAS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodecd.h" /* for class DJCodecDecoder */ + +/** Decoder class for JPEG Baseline (lossy, 8-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJDecoderBaseline : public DJCodecDecoder +{ +public: + + /// default constructor + DJDecoderBaseline(); + + /// destructor + virtual ~DJDecoderBaseline(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + +private: + + /** creates an instance of the compression library to be used for decoding. + * @param toRepParam representation parameter passed to decode() + * @param cp codec parameter passed to decode() + * @param bitsPerSample bits per sample for the image data + * @param isYBR flag indicating whether DICOM photometric interpretation is YCbCr + * @return pointer to newly allocated decoder object + */ + virtual DJDecoder *createDecoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdecext.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdecext.h new file mode 100644 index 00000000..8d48e1ac --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdecext.h @@ -0,0 +1,70 @@ +/* + * + * Copyright (C) 1997-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Extended Sequential (lossy, 8/12-bit) + * + */ + +#ifndef DJDECEXT_H +#define DJDECEXT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodecd.h" /* for class DJCodecDecoder */ + + +/** Decoder class for JPEG Extended Sequential (lossy, 8/12-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJDecoderExtended : public DJCodecDecoder +{ +public: + + /// default constructor + DJDecoderExtended(); + + /// destructor + virtual ~DJDecoderExtended(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + +private: + + /** creates an instance of the compression library to be used for decoding. + * @param toRepParam representation parameter passed to decode() + * @param cp codec parameter passed to decode() + * @param bitsPerSample bits per sample for the image data + * @param isYBR flag indicating whether DICOM photometric interpretation is YCbCr + * @return pointer to newly allocated decoder object + */ + virtual DJDecoder *createDecoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdeclol.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdeclol.h new file mode 100644 index 00000000..780c4cd8 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdeclol.h @@ -0,0 +1,70 @@ +/* + * + * Copyright (C) 1997-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Lossless (8/12/16-bit) + * + */ + +#ifndef DJDECLOL_H +#define DJDECLOL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodecd.h" /* for class DJCodecDecoder */ + + +/** Decoder class for JPEG Lossless (8/12/16-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJDecoderLossless : public DJCodecDecoder +{ +public: + + /// default constructor + DJDecoderLossless(); + + /// destructor + virtual ~DJDecoderLossless(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + +private: + + /** creates an instance of the compression library to be used for decoding. + * @param toRepParam representation parameter passed to decode() + * @param cp codec parameter passed to decode() + * @param bitsPerSample bits per sample for the image data + * @param isYBR flag indicating whether DICOM photometric interpretation is YCbCr + * @return pointer to newly allocated decoder object + */ + virtual DJDecoder *createDecoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h new file mode 100644 index 00000000..d2d5c791 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h @@ -0,0 +1,99 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers decoders for all supported JPEG processes. + * + */ + +#ifndef DJDECODE_H +#define DJDECODE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmjpeg/djutils.h" + +class DJCodecParameter; +class DJDecoderBaseline; +class DJDecoderExtended; +class DJDecoderLossless; +class DJDecoderP14SV1; +class DJDecoderProgressive; +class DJDecoderSpectralSelection; + +/** singleton class that registers decoders for all supported JPEG processes. + */ +class DCMTK_DCMJPEG_EXPORT DJDecoderRegistration +{ +public: + /** registers decoders for all supported JPEG processes. + * If already registered, call is ignored unless cleanup() has + * been performed before. + * @param pCreateSOPInstanceUID flag indicating whether or not + * a new SOP Instance UID should be assigned upon decompression. + * @param pPlanarConfiguration flag indicating how planar configuration + * of color images should be encoded upon decompression. + * @param predictor6WorkaroundEnable enable workaround for buggy lossless compressed images with + * overflow in predictor 6 for images with 16 bits/pixel + * @param cornellWorkaroundEnable enable workaround for buggy Cornell lossless compressed images with + * Huffman table overflow + * @param pForceSingleFragmentPerFrame while decompressing a multiframe image, + * assume one fragment per frame even if the JPEG data for some frame is incomplete + */ + static void registerCodecs( + E_DecompressionColorSpaceConversion pDecompressionCSConversion = EDC_photometricInterpretation, + E_UIDCreation pCreateSOPInstanceUID = EUC_default, + E_PlanarConfiguration pPlanarConfiguration = EPC_default, + OFBool predictor6WorkaroundEnable = OFFalse, + OFBool cornellWorkaroundEnable = OFFalse, + OFBool pForceSingleFragmentPerFrame = OFFalse); + + /** deregisters decoders. + * Attention: Must not be called while other threads might still use + * the registered codecs, e.g. because they are currently decoding + * DICOM data sets through dcmdata. + */ + static void cleanup(); + +private: + + /// flag indicating whether the decoders are already registered. + static OFBool registered; + + /// pointer to codec parameter shared by all decoders + static DJCodecParameter *cp; + + /// pointer to decoder for baseline JPEG + static DJDecoderBaseline *decbas; + + /// pointer to decoder for extended JPEG + static DJDecoderExtended *decext; + + /// pointer to decoder for spectral selection JPEG + static DJDecoderSpectralSelection *decsps; + + /// pointer to decoder for progressive JPEG + static DJDecoderProgressive *decpro; + + /// pointer to decoder for lossless SV1 JPEG + static DJDecoderP14SV1 *decsv1; + + /// pointer to decoder for lossless JPEG + static DJDecoderLossless *declol; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdecpro.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdecpro.h new file mode 100644 index 00000000..f4cfdf49 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdecpro.h @@ -0,0 +1,70 @@ +/* + * + * Copyright (C) 1997-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Progressive (lossy, 8/12-bit) + * + */ + +#ifndef DJDECPRO_H +#define DJDECPRO_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodecd.h" /* for class DJCodecDecoder */ + + +/** Decoder class for JPEG Progressive (lossy, 8/12-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJDecoderProgressive : public DJCodecDecoder +{ +public: + + /// default constructor + DJDecoderProgressive(); + + /// destructor + virtual ~DJDecoderProgressive(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + +private: + + /** creates an instance of the compression library to be used for decoding. + * @param toRepParam representation parameter passed to decode() + * @param cp codec parameter passed to decode() + * @param bitsPerSample bits per sample for the image data + * @param isYBR flag indicating whether DICOM photometric interpretation is YCbCr + * @return pointer to newly allocated decoder object + */ + virtual DJDecoder *createDecoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdecsps.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdecsps.h new file mode 100644 index 00000000..22b51282 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdecsps.h @@ -0,0 +1,70 @@ +/* + * + * Copyright (C) 1997-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: Codec class for decoding JPEG Spectral Selection (lossy, 8/12-bit) + * + */ + +#ifndef DJDECSPS_H +#define DJDECSPS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodecd.h" /* for class DJCodecDecoder */ + + +/** Decoder class for JPEG Spectral Selection (lossy, 8/12-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJDecoderSpectralSelection : public DJCodecDecoder +{ +public: + + /// default constructor + DJDecoderSpectralSelection(); + + /// destructor + virtual ~DJDecoderSpectralSelection(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + +private: + + /** creates an instance of the compression library to be used for decoding. + * @param toRepParam representation parameter passed to decode() + * @param cp codec parameter passed to decode() + * @param bitsPerSample bits per sample for the image data + * @param isYBR flag indicating whether DICOM photometric interpretation is YCbCr + * @return pointer to newly allocated decoder object + */ + virtual DJDecoder *createDecoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdecsv1.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdecsv1.h new file mode 100644 index 00000000..87dba511 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdecsv1.h @@ -0,0 +1,70 @@ +/* + * + * Copyright (C) 1997-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Lossless Selection Value 1 (8/12/16-bit) + * + */ + +#ifndef DJDECSV1_H +#define DJDECSV1_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodecd.h" /* for class DJCodecDecoder */ + + +/** Decoder class for JPEG Lossless Selection Value 1 (8/12/16-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJDecoderP14SV1: public DJCodecDecoder +{ +public: + + /// default constructor + DJDecoderP14SV1(); + + /// destructor + virtual ~DJDecoderP14SV1(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + +private: + + /** creates an instance of the compression library to be used for decoding. + * @param toRepParam representation parameter passed to decode() + * @param cp codec parameter passed to decode() + * @param bitsPerSample bits per sample for the image data + * @param isYBR flag indicating whether DICOM photometric interpretation is YCbCr + * @return pointer to newly allocated decoder object + */ + virtual DJDecoder *createDecoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdefine.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdefine.h new file mode 100644 index 00000000..4b6fcc0a --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdefine.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DJDEFINE_H +#define DJDEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmjpeg_EXPORTS +#define DCMTK_DCMJPEG_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMJPEG_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdijg12.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdijg12.h new file mode 100644 index 00000000..4db55277 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdijg12.h @@ -0,0 +1,128 @@ +/* + * + * Copyright (C) 1997-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: decompression routines of the IJG JPEG library configured for 12 bits/sample. + * + */ + +#ifndef DJDIJG12_H +#define DJDIJG12_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecabs.h" /* for class DJDecoder */ + +extern "C" +{ + struct jpeg_decompress_struct; +} + +class DJCodecParameter; + +/** this class encapsulates the decompression routines of the + * IJG JPEG library configured for 12 bits/sample. + */ +class DCMTK_DCMJPEG_EXPORT DJDecompressIJG12Bit : public DJDecoder +{ +public: + + /** constructor + * @param cp codec parameters + * @param isYBR flag indicating if DICOM photometric interpretation is YCbCr + */ + DJDecompressIJG12Bit(const DJCodecParameter& cp, OFBool isYBR); + + /// destructor + virtual ~DJDecompressIJG12Bit(); + + /** initializes internal object structures. + * Must be called before a new frame is decompressed. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition init(); + + /** suspended decompression routine. Decompresses a JPEG frame + * until finished or out of data. Can be called with new data + * until a frame is complete. + * @param compressedFrameBuffer pointer to compressed input data, must not be NULL + * @param compressedFrameBufferSize size of buffer, in bytes + * @param uncompressedFrameBuffer pointer to uncompressed output data, must not be NULL. + * This buffer must not change between multiple decode() calls for a single frame. + * @param uncompressedFrameBufferSize size of buffer, in bytes (!) + * Buffer must be large enough to contain a complete frame. + * @param isSigned OFTrue, if uncompressed pixel data is signed, OFFalse otherwise + * @return EC_Normal if successful, EC_Suspend if more data is needed, an error code otherwise. + */ + virtual OFCondition decode( + Uint8 *compressedFrameBuffer, + Uint32 compressedFrameBufferSize, + Uint8 *uncompressedFrameBuffer, + Uint32 uncompressedFrameBufferSize, + OFBool isSigned); + + /** returns the number of bytes per sample that will be written when decoding. + */ + virtual Uint16 bytesPerSample() const + { + return OFstatic_cast(Uint16, sizeof(Uint16)); + } + + /** after successful compression, + * returns the color model of the decompressed image + */ + virtual EP_Interpretation getDecompressedColorModel() const + { + return decompressedColorModel; + } + + /** callback function used to report warning messages and the like. + * Should not be called by user code directly. + * @param msg_level -1 for warnings, 0 and above for trace messages + */ + virtual void emitMessage(int msg_level) const; + +private: + + /// private undefined copy constructor + DJDecompressIJG12Bit(const DJDecompressIJG12Bit&); + + /// private undefined copy assignment operator + DJDecompressIJG12Bit& operator=(const DJDecompressIJG12Bit&); + + /// cleans up cinfo structure, called from destructor and error handlers + void cleanup(); + + /// codec parameters + const DJCodecParameter *cparam; + + /// decompression structure + jpeg_decompress_struct *cinfo; + + /// position of last suspend + int suspension; + + /// temporary storage for row buffer during suspension + void *jsampBuffer; + + /// Flag indicating if DICOM photometric interpretation is YCbCr + OFBool dicomPhotometricInterpretationIsYCbCr; + + /// color model after decompression + EP_Interpretation decompressedColorModel; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdijg16.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdijg16.h new file mode 100644 index 00000000..356f78ba --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdijg16.h @@ -0,0 +1,128 @@ +/* + * + * Copyright (C) 1997-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: decompression routines of the IJG JPEG library configured for 16 bits/sample. + * + */ + +#ifndef DJDIJG16_H +#define DJDIJG16_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecabs.h" /* for class DJDecoder */ + +extern "C" +{ + struct jpeg_decompress_struct; +} + +class DJCodecParameter; + +/** this class encapsulates the decompression routines of the + * IJG JPEG library configured for 16 bits/sample. + */ +class DCMTK_DCMJPEG_EXPORT DJDecompressIJG16Bit : public DJDecoder +{ +public: + + /** constructor + * @param cp codec parameters + * @param isYBR flag indicating if DICOM photometric interpretation is YCbCr + */ + DJDecompressIJG16Bit(const DJCodecParameter& cp, OFBool isYBR); + + /// destructor + virtual ~DJDecompressIJG16Bit(); + + /** initializes internal object structures. + * Must be called before a new frame is decompressed. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition init(); + + /** suspended decompression routine. Decompresses a JPEG frame + * until finished or out of data. Can be called with new data + * until a frame is complete. + * @param compressedFrameBuffer pointer to compressed input data, must not be NULL + * @param compressedFrameBufferSize size of buffer, in bytes + * @param uncompressedFrameBuffer pointer to uncompressed output data, must not be NULL. + * This buffer must not change between multiple decode() calls for a single frame. + * @param uncompressedFrameBufferSize size of buffer, in bytes (!) + * Buffer must be large enough to contain a complete frame. + * @param isSigned OFTrue, if uncompressed pixel data is signed, OFFalse otherwise + * @return EC_Normal if successful, EC_Suspend if more data is needed, an error code otherwise. + */ + virtual OFCondition decode( + Uint8 *compressedFrameBuffer, + Uint32 compressedFrameBufferSize, + Uint8 *uncompressedFrameBuffer, + Uint32 uncompressedFrameBufferSize, + OFBool isSigned); + + /** returns the number of bytes per sample that will be written when decoding. + */ + virtual Uint16 bytesPerSample() const + { + return OFstatic_cast(Uint16, sizeof(Uint16)); + } + + /** after successful compression, + * returns the color model of the decompressed image + */ + virtual EP_Interpretation getDecompressedColorModel() const + { + return decompressedColorModel; + } + + /** callback function used to report warning messages and the like. + * Should not be called by user code directly. + * @param msg_level -1 for warnings, 0 and above for trace messages + */ + virtual void emitMessage(int msg_level) const; + +private: + + /// private undefined copy constructor + DJDecompressIJG16Bit(const DJDecompressIJG16Bit&); + + /// private undefined copy assignment operator + DJDecompressIJG16Bit& operator=(const DJDecompressIJG16Bit&); + + /// cleans up cinfo structure, called from destructor and error handlers + void cleanup(); + + /// codec parameters + const DJCodecParameter *cparam; + + /// decompression structure + jpeg_decompress_struct *cinfo; + + /// position of last suspend + int suspension; + + /// temporary storage for row buffer during suspension + void *jsampBuffer; + + /// Flag indicating if DICOM photometric interpretation is YCbCr + OFBool dicomPhotometricInterpretationIsYCbCr; + + /// color model after decompression + EP_Interpretation decompressedColorModel; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djdijg8.h b/dcmjpeg/include/dcmtk/dcmjpeg/djdijg8.h new file mode 100644 index 00000000..8c8ef6dc --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djdijg8.h @@ -0,0 +1,128 @@ +/* + * + * Copyright (C) 1997-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: decompression routines of the IJG JPEG library configured for 8 bits/sample. + * + */ + +#ifndef DJDIJG8_H +#define DJDIJG8_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecabs.h" /* for class DJDecoder */ + +extern "C" +{ + struct jpeg_decompress_struct; +} + +class DJCodecParameter; + +/** this class encapsulates the decompression routines of the + * IJG JPEG library configured for 8 bits/sample. + */ +class DCMTK_DCMJPEG_EXPORT DJDecompressIJG8Bit : public DJDecoder +{ +public: + + /** constructor + * @param cp codec parameters + * @param isYBR flag indicating if DICOM photometric interpretation is YCbCr + */ + DJDecompressIJG8Bit(const DJCodecParameter& cp, OFBool isYBR); + + /// destructor + virtual ~DJDecompressIJG8Bit(); + + /** initializes internal object structures. + * Must be called before a new frame is decompressed. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition init(); + + /** suspended decompression routine. Decompresses a JPEG frame + * until finished or out of data. Can be called with new data + * until a frame is complete. + * @param compressedFrameBuffer pointer to compressed input data, must not be NULL + * @param compressedFrameBufferSize size of buffer, in bytes + * @param uncompressedFrameBuffer pointer to uncompressed output data, must not be NULL. + * This buffer must not change between multiple decode() calls for a single frame. + * @param uncompressedFrameBufferSize size of buffer, in bytes (!) + * Buffer must be large enough to contain a complete frame. + * @param isSigned OFTrue, if uncompressed pixel data is signed, OFFalse otherwise + * @return EC_Normal if successful, EC_Suspend if more data is needed, an error code otherwise. + */ + virtual OFCondition decode( + Uint8 *compressedFrameBuffer, + Uint32 compressedFrameBufferSize, + Uint8 *uncompressedFrameBuffer, + Uint32 uncompressedFrameBufferSize, + OFBool isSigned); + + /** returns the number of bytes per sample that will be written when decoding. + */ + virtual Uint16 bytesPerSample() const + { + return OFstatic_cast(Uint16, sizeof(Uint8)); + } + + /** after successful compression, + * returns the color model of the decompressed image + */ + virtual EP_Interpretation getDecompressedColorModel() const + { + return decompressedColorModel; + } + + /** callback function used to report warning messages and the like. + * Should not be called by user code directly. + * @param msg_level -1 for warnings, 0 and above for trace messages + */ + virtual void emitMessage(int msg_level) const; + +private: + + /// private undefined copy constructor + DJDecompressIJG8Bit(const DJDecompressIJG8Bit&); + + /// private undefined copy assignment operator + DJDecompressIJG8Bit& operator=(const DJDecompressIJG8Bit&); + + /// cleans up cinfo structure, called from destructor and error handlers + void cleanup(); + + /// codec parameters + const DJCodecParameter *cparam; + + /// decompression structure + jpeg_decompress_struct *cinfo; + + /// position of last suspend + int suspension; + + /// temporary storage for row buffer during suspension + void *jsampBuffer; + + /// Flag indicating if DICOM photometric interpretation is YCbCr + OFBool dicomPhotometricInterpretationIsYCbCr; + + /// color model after decompression + EP_Interpretation decompressedColorModel; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djeijg12.h b/dcmjpeg/include/dcmtk/dcmjpeg/djeijg12.h new file mode 100644 index 00000000..ae9cf7ef --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djeijg12.h @@ -0,0 +1,173 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: compression routines of the IJG JPEG library configured for 12 bits/sample. + * + */ + +#ifndef DJEIJG12_H +#define DJEIJG12_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/dcmjpeg/djencabs.h" + +extern "C" +{ + struct jpeg_compress_struct; + typedef struct jpeg_compress_struct * j_compress_ptr; + struct jpeg_decompress_struct; + typedef struct jpeg_decompress_struct * j_decompress_ptr; +} + +class DJCodecParameter; + + +/** this class encapsulates the compression routines of the + * IJG JPEG library configured for 12 bits/sample. + */ +class DCMTK_DCMJPEG_EXPORT DJCompressIJG12Bit: public DJEncoder +{ +public: + + /** constructor for lossy JPEG + * @param cp codec parameters + * @param mode mode of operation + * @param quality compression quality + */ + DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality); + + /** constructor for lossless JPEG + * @param cp codec parameters + * @param prediction predictor + * @param ptrans point transform + */ + DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans); + + /// destructor + virtual ~DJCompressIJG12Bit(); + + /** single frame compression routine for 16-bit raw pixel data. + * May only be called if bytesPerSample() == 2. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint16 *image_buffer, + Uint8 *&to, + Uint32 &length); + + /** single frame compression routine for 8-bit raw pixel data. + * May only be called if bytesPerSample() == 1. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint8 *image_buffer, + Uint8 *&to, + Uint32 &length); + + /** returns the number of bytes per sample that will be expected when encoding. + */ + virtual Uint16 bytesPerSample() const { return 2; } + + /** returns the number of bits per sample that will be expected when encoding. + */ + virtual Uint16 bitsPerSample() const { return 12; } + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + void initDestination(jpeg_compress_struct *cinfo); + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + int emptyOutputBuffer(jpeg_compress_struct *cinfo); + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + void termDestination(jpeg_compress_struct *cinfo); + + /** callback function used to report warning messages and the like. + * Should not be called by user code directly. + * @param arg opaque pointer to JPEG compress structure + * @param msg_level -1 for warnings, 0 and above for trace messages + */ + virtual void emitMessage(void *arg, int msg_level) const; + +private: + + /// private undefined copy constructor + DJCompressIJG12Bit(const DJCompressIJG12Bit&); + + /// private undefined copy assignment operator + DJCompressIJG12Bit& operator=(const DJCompressIJG12Bit&); + + /// cleans up pixelDataList, called from destructor and error handlers + void cleanup(); + + /// codec parameters + const DJCodecParameter *cparam; + + /// for lossy compression, defines compression quality factor + Uint8 quality; + + /// for lossless compression, defines selection value + int psv; + + /// for lossless compression, defines point transform + int pt; + + /// enum for mode of operation (baseline, sequential, progressive etc.) + EJ_Mode modeofOperation; + + /// list of compressed pixel data blocks + OFList pixelDataList; + + /// filled number of bytes in last block in pixelDataList + size_t bytesInLastBlock; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djeijg16.h b/dcmjpeg/include/dcmtk/dcmjpeg/djeijg16.h new file mode 100644 index 00000000..901dc981 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djeijg16.h @@ -0,0 +1,163 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: compression routines of the IJG JPEG library configured for 16 bits/sample. + * + */ + +#ifndef DJEIJG16_H +#define DJEIJG16_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/dcmjpeg/djencabs.h" + +extern "C" +{ + struct jpeg_compress_struct; + typedef struct jpeg_compress_struct * j_compress_ptr; + struct jpeg_decompress_struct; + typedef struct jpeg_decompress_struct * j_decompress_ptr; +} + +class DJCodecParameter; + + +/** this class encapsulates the compression routines of the + * IJG JPEG library configured for 16 bits/sample. + */ +class DCMTK_DCMJPEG_EXPORT DJCompressIJG16Bit: public DJEncoder +{ +public: + + /** constructor for lossless JPEG + * @param cp codec parameters + * @param prediction predictor + * @param ptrans point transform + */ + DJCompressIJG16Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans); + + /// destructor + virtual ~DJCompressIJG16Bit(); + + /** single frame compression routine for 16-bit raw pixel data. + * May only be called if bytesPerSample() == 2. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint16 *image_buffer, + Uint8 *&to, + Uint32 &length); + + /** single frame compression routine for 8-bit raw pixel data. + * May only be called if bytesPerSample() == 1. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint8 *image_buffer, + Uint8 *&to, + Uint32 &length); + + /** returns the number of bytes per sample that will be expected when encoding. + */ + virtual Uint16 bytesPerSample() const { return 2; } + + /** returns the number of bits per sample that will be expected when encoding. + */ + virtual Uint16 bitsPerSample() const { return 16; } + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + void initDestination(jpeg_compress_struct *cinfo); + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + int emptyOutputBuffer(jpeg_compress_struct *cinfo); + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + void termDestination(jpeg_compress_struct *cinfo); + + /** callback function used to report warning messages and the like. + * Should not be called by user code directly. + * @param arg opaque pointer to JPEG compress structure + * @param msg_level -1 for warnings, 0 and above for trace messages + */ + virtual void emitMessage(void *arg, int msg_level) const; + +private: + + /// private undefined copy constructor + DJCompressIJG16Bit(const DJCompressIJG16Bit&); + + /// private undefined copy assignment operator + DJCompressIJG16Bit& operator=(const DJCompressIJG16Bit&); + + /// cleans up pixelDataList, called from destructor and error handlers + void cleanup(); + + /// codec parameters + const DJCodecParameter *cparam; + + /// for lossless compression, defines selection value + int psv; + + /// for lossless compression, defines point transform + int pt; + + /// enum for mode of operation (baseline, sequential, progressive etc.) + EJ_Mode modeofOperation; + + /// list of compressed pixel data blocks + OFList pixelDataList; + + /// filled number of bytes in last block in pixelDataList + size_t bytesInLastBlock; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djeijg8.h b/dcmjpeg/include/dcmtk/dcmjpeg/djeijg8.h new file mode 100644 index 00000000..0e78f964 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djeijg8.h @@ -0,0 +1,169 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: compression routines of the IJG JPEG library configured for 8 bits/sample. + * + */ + +#ifndef DJEIJG8_H +#define DJEIJG8_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/dcmjpeg/djencabs.h" + +extern "C" +{ + struct jpeg_compress_struct; +} + +class DJCodecParameter; + +/** this class encapsulates the compression routines of the + * IJG JPEG library configured for 8 bits/sample. + */ +class DCMTK_DCMJPEG_EXPORT DJCompressIJG8Bit: public DJEncoder +{ +public: + + /** constructor for lossy JPEG + * @param cp codec parameters + * @param mode mode of operation + * @param quality compression quality + */ + DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality); + + /** constructor for lossless JPEG + * @param cp codec parameters + * @param prediction predictor + * @param ptrans point transform + */ + DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans); + + /// destructor + virtual ~DJCompressIJG8Bit(); + + /** single frame compression routine for 16-bit raw pixel data. + * May only be called if bytesPerSample() == 2. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint16 *image_buffer, + Uint8 *&to, + Uint32 &length); + + /** single frame compression routine for 8-bit raw pixel data. + * May only be called if bytesPerSample() == 1. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint8 *image_buffer, + Uint8 *&to, + Uint32 &length); + + /** returns the number of bytes per sample that will be expected when encoding. + */ + virtual Uint16 bytesPerSample() const { return 1; } + + /** returns the number of bits per sample that will be expected when encoding. + */ + virtual Uint16 bitsPerSample() const { return 8; } + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + void initDestination(jpeg_compress_struct *cinfo); + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + int emptyOutputBuffer(jpeg_compress_struct *cinfo); + + /** callback for IJG compress destination manager. + * Internal use only, not to be called by client code. + * @param cinfo pointer to compress info + */ + void termDestination(jpeg_compress_struct *cinfo); + + /** callback function used to report warning messages and the like. + * Should not be called by user code directly. + * @param arg opaque pointer to JPEG compress structure + * @param msg_level -1 for warnings, 0 and above for trace messages + */ + virtual void emitMessage(void *arg, int msg_level) const; + +private: + + /// private undefined copy constructor + DJCompressIJG8Bit(const DJCompressIJG8Bit&); + + /// private undefined copy assignment operator + DJCompressIJG8Bit& operator=(const DJCompressIJG8Bit&); + + /// cleans up pixelDataList, called from destructor and error handlers + void cleanup(); + + /// codec parameters + const DJCodecParameter *cparam; + + /// for lossy compression, defines compression quality factor + Uint8 quality; + + /// for lossless compression, defines selection value + int psv; + + /// for lossless compression, defines point transform + int pt; + + /// enum for mode of operation (baseline, sequential, progressive etc.) + EJ_Mode modeofOperation; + + /// list of compressed pixel data blocks + OFList pixelDataList; + + /// filled number of bytes in last block in pixelDataList + size_t bytesInLastBlock; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djencabs.h b/dcmjpeg/include/dcmtk/dcmjpeg/djencabs.h new file mode 100644 index 00000000..368de929 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djencabs.h @@ -0,0 +1,99 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: abstract base class for compression classes + * + */ + +#ifndef DJENCABS_H +#define DJENCABS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmimgle/diutils.h" /* for EP_Interpretation */ +#include "dcmtk/dcmjpeg/djutils.h" /* for enums */ + +/** abstract base class for compression classes. + */ +class DCMTK_DCMJPEG_EXPORT DJEncoder +{ +public: + + /// default constructor + DJEncoder() + { + } + + /// destructor + virtual ~DJEncoder() + { + } + + /** single frame compression routine for 16-bit raw pixel data. + * May only be called if bytesPerSample() == 2. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint16 *image_buffer, + Uint8 *&to, + Uint32 &length) = 0; + + /** single frame compression routine for 8-bit raw pixel data. + * May only be called if bytesPerSample() == 1. + * @param columns columns of frame + * @param rows rows of frame + * @param interpr photometric interpretation of input frame + * @param samplesPerPixel samples per pixel of input frame + * @param image_buffer pointer to frame buffer + * @param to compressed frame returned in this parameter upon success + * @param length length of compressed frame (in bytes) returned in this parameter + * upon success; length guaranteed to be always even. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation interpr, + Uint16 samplesPerPixel, + Uint8 *image_buffer, + Uint8 *&to, + Uint32 &length) = 0; + + /** returns the number of bytes per sample that will be expected when encoding. + */ + virtual Uint16 bytesPerSample() const = 0; + + /** returns the number of bits per sample that will be expected when encoding. + */ + virtual Uint16 bitsPerSample() const = 0; + +}; + + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djencbas.h b/dcmjpeg/include/dcmtk/dcmjpeg/djencbas.h new file mode 100644 index 00000000..83f10dc7 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djencbas.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Baseline (lossy, 8-bit) + * + */ + +#ifndef DJENCBAS_H +#define DJENCBAS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodece.h" /* for class DJCodecEncoder */ + + +/** Encoder class for JPEG Baseline (lossy, 8-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJEncoderBaseline : public DJCodecEncoder +{ +public: + + /// default constructor + DJEncoderBaseline(); + + /// destructor + virtual ~DJEncoderBaseline(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + +private: + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + + /** creates 'derivation description' string after encoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @param imageComments image comments returned in this + * parameter which is initially empty + */ + virtual void createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const; + + /** creates an instance of the compression library to be used + * for encoding/decoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample for the image data + * @return pointer to newly allocated codec object + */ + virtual DJEncoder *createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djencext.h b/dcmjpeg/include/dcmtk/dcmjpeg/djencext.h new file mode 100644 index 00000000..d0a614fd --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djencext.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Extended Sequential (lossy, 8/12-bit) + * + */ + +#ifndef DJENCEXT_H +#define DJENCEXT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodece.h" /* for class DJCodecEncoder */ + + +/** Encoder class for JPEG Extended Sequential (lossy, 8/12-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJEncoderExtended : public DJCodecEncoder +{ +public: + + /// default constructor + DJEncoderExtended(); + + /// destructor + virtual ~DJEncoderExtended(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + +private: + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + + /** creates 'derivation description' string after encoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @param imageComments image comments returned in this + * parameter which is initially empty + */ + virtual void createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const; + + /** creates an instance of the compression library to be used + * for encoding/decoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample for the image data + * @return pointer to newly allocated codec object + */ + virtual DJEncoder *createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djenclol.h b/dcmjpeg/include/dcmtk/dcmjpeg/djenclol.h new file mode 100644 index 00000000..2dc86e8f --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djenclol.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Lossless (8/12/16-bit) + * + */ + +#ifndef DJENCLOL_H +#define DJENCLOL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodece.h" /* for class DJCodecEncoder */ + + +/** Encoder class for JPEG Lossless (8/12/16-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJEncoderLossless : public DJCodecEncoder +{ +public: + + /// default constructor + DJEncoderLossless(); + + /// destructor + virtual ~DJEncoderLossless(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + +private: + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + + /** creates 'derivation description' string after encoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @param imageComments image comments returned in this + * parameter which is initially empty + */ + virtual void createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const; + + /** creates an instance of the compression library to be used + * for encoding/decoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample for the image data + * @return pointer to newly allocated codec object + */ + virtual DJEncoder *createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djencode.h b/dcmjpeg/include/dcmtk/dcmjpeg/djencode.h new file mode 100644 index 00000000..27d2371d --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djencode.h @@ -0,0 +1,134 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers encoders for all supported JPEG processes. + * + */ + +#ifndef DJENCODE_H +#define DJENCODE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmjpeg/djutils.h" +#include "dcmtk/dcmdata/dctypes.h" /* for Uint32 */ + +class DJCodecParameter; +class DJEncoderBaseline; +class DJEncoderExtended; +class DJEncoderLossless; +class DJEncoderP14SV1; +class DJEncoderProgressive; +class DJEncoderSpectralSelection; + +/** singleton class that registers encoders for all supported JPEG processes. + */ +class DCMTK_DCMJPEG_EXPORT DJEncoderRegistration +{ +public: + + /** registers encoders for all supported JPEG processes. + * If already registered, call is ignored unless cleanup() has + * been performed before. + * @param pCompressionCSConversion color conversion mode for compression + * @param pCreateSOPInstanceUID mode for SOP Instance UID creation + * @param pOptimizeHuffman perform huffman table optimization for 8 bits/pixel compression? + * @param pSmoothingFactor smoothing factor for image compression, 0..100 + * @param pForcedBitDepth forced bit depth for image compression, 0 (auto) or 8/12/16 + * @param pFragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @param pCreateOffsetTable create offset table during image compression? + * @param pSampleFactors subsampling mode for lossy YCbCr color image compression + * @param pWriteYBR422 flag indicating whether a compressed YBR color stream should + * be marked as YBR_FULL_422 (if true) or YBR_FULL (if false) on DICOM level + * @param pConvertToSC flag indicating whether image should be converted to + * Secondary Capture upon compression + * @param pWindowType mode for VOI transformation of monochrome images + * @param pWindowParameter parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6 + * @param pVoiCenter VOI window center for mode 5 + * @param pVoiWidth VOI window width for mode 5 + * @param pRoiLeft Region of Interest left corner for for VOI transform of monochrome images, mode 7 + * @param pRoiTop Region of Interest upper corner for for VOI transform of monochrome images, mode 7 + * @param pRoiWidth Region of Interest width for for VOI transform of monochrome images, mode 7 + * @param pRoiHeight Region of Interest height for for VOI transform of monochrome images, mode 7 + * @param pUsePixelValues Check smallest and largest pixel value and optimize compression, mode 0 only + * @param pUseModalityRescale Create Rescale Slope/Intercept to scale back + * to original pixel range, mode 0 only + * @param pAcceptWrongPaletteTags Accept wrong palette attribute tags (only "pseudo lossless" encoder) + * @param pAcrNemaCompatibility Accept old ACR-NEMA images without photometric interpretation (only "pseudo lossless" encoder) + * @param pRealLossless Enables true lossless compression (replaces old "pseudo" lossless encoders) + */ + static void registerCodecs( + E_CompressionColorSpaceConversion pCompressionCSConversion = ECC_lossyYCbCr, + E_UIDCreation pCreateSOPInstanceUID = EUC_default, + OFBool pOptimizeHuffman = OFFalse, + int pSmoothingFactor = 0, + int pForcedBitDepth = 0, + Uint32 pFragmentSize = 0, + OFBool pCreateOffsetTable = OFTrue, + E_SubSampling pSampleFactors = ESS_422, + OFBool pWriteYBR422 = OFTrue, + OFBool pConvertToSC = OFFalse, + unsigned long pWindowType = 0, + unsigned long pWindowParameter = 0, + double pVoiCenter = 0.0, + double pVoiWidth = 0.0, + unsigned long pRoiLeft = 0, + unsigned long pRoiTop = 0, + unsigned long pRoiWidth = 0, + unsigned long pRoiHeight = 0, + OFBool pUsePixelValues = OFTrue, + OFBool pUseModalityRescale = OFFalse, + OFBool pAcceptWrongPaletteTags = OFFalse, + OFBool pAcrNemaCompatibility = OFFalse, + OFBool pRealLossless = OFTrue); + + /** deregisters encoders. + * Attention: Must not be called while other threads might still use + * the registered codecs, e.g. because they are currently encoding + * DICOM data sets through dcmdata. + */ + static void cleanup(); + +private: + + /// flag indicating whether the encoders are already registered. + static OFBool registered; + + /// pointer to codec parameter shared by all encoders + static DJCodecParameter *cp; + + /// pointer to encoder for baseline JPEG + static DJEncoderBaseline *encbas; + + /// pointer to encoder for extended JPEG + static DJEncoderExtended *encext; + + /// pointer to encoder for spectral selection JPEG + static DJEncoderSpectralSelection *encsps; + + /// pointer to encoder for progressive JPEG + static DJEncoderProgressive *encpro; + + /// pointer to encoder for lossless SV1 JPEG + static DJEncoderP14SV1 *encsv1; + + /// pointer to encoder for lossless JPEG + static DJEncoderLossless *enclol; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djencpro.h b/dcmjpeg/include/dcmtk/dcmjpeg/djencpro.h new file mode 100644 index 00000000..b385c824 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djencpro.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Progressive (lossy, 8/12-bit) + * + */ + +#ifndef DJENCPRO_H +#define DJENCPRO_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodece.h" /* for class DJCodecEncoder */ + + +/** Encoder class for JPEG Progressive (lossy, 8/12-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJEncoderProgressive : public DJCodecEncoder +{ +public: + + /// default constructor + DJEncoderProgressive(); + + /// destructor + virtual ~DJEncoderProgressive(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + +private: + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + + /** creates 'derivation description' string after encoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @param imageComments image comments returned in this + * parameter which is initially empty + */ + virtual void createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const; + + /** creates an instance of the compression library to be used + * for encoding/decoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample for the image data + * @return pointer to newly allocated codec object + */ + virtual DJEncoder *createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djencsps.h b/dcmjpeg/include/dcmtk/dcmjpeg/djencsps.h new file mode 100644 index 00000000..de07fd78 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djencsps.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: Codec class for encoding JPEG Spectral Selection (lossy, 8/12-bit) + * + */ + +#ifndef DJENCSPS_H +#define DJENCSPS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodece.h" /* for class DJCodecEncoder */ + + +/** Encoder class for JPEG Spectral Selection (lossy, 8/12-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJEncoderSpectralSelection : public DJCodecEncoder +{ +public: + + /// default constructor + DJEncoderSpectralSelection(); + + /// destructor + virtual ~DJEncoderSpectralSelection(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + +private: + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + + /** creates 'derivation description' string after encoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @param imageComments image comments returned in this + * parameter which is initially empty + */ + virtual void createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const; + + /** creates an instance of the compression library to be used + * for encoding/decoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample for the image data + * @return pointer to newly allocated codec object + */ + virtual DJEncoder *createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djencsv1.h b/dcmjpeg/include/dcmtk/dcmjpeg/djencsv1.h new file mode 100644 index 00000000..e0e91fbf --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djencsv1.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Lossless Selection Value 1 (8/12/16-bit) + * + */ + +#ifndef DJENCSV1_H +#define DJENCSV1_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodece.h" /* for class DJCodecEncoder */ + + +/** Encoder class for JPEG Lossless Selection Value 1 (8/12/16-bit) + */ +class DCMTK_DCMJPEG_EXPORT DJEncoderP14SV1: public DJCodecEncoder +{ +public: + + /// default constructor + DJEncoderP14SV1(); + + /// destructor + virtual ~DJEncoderP14SV1(); + + /** returns the transfer syntax that this particular codec + * is able to encode and decode. + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; + +private: + + /** returns true if the transfer syntax supported by this + * codec is lossless. + * @return lossless flag + */ + virtual OFBool isLosslessProcess() const; + + /** creates 'derivation description' string after encoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample of the original image data prior to compression + * @param ratio image compression ratio. This is not the "quality factor" + * but the real effective ratio between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @param imageComments image comments returned in this + * parameter which is initially empty + */ + virtual void createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const; + + /** creates an instance of the compression library to be used + * for encoding/decoding. + * @param toRepParam representation parameter passed to encode() + * @param cp codec parameter passed to encode() + * @param bitsPerSample bits per sample for the image data + * @return pointer to newly allocated codec object + */ + virtual DJEncoder *createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const; + +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djrplol.h b/dcmjpeg/include/dcmtk/dcmjpeg/djrplol.h new file mode 100644 index 00000000..199ea2b7 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djrplol.h @@ -0,0 +1,90 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: representation parameter for lossless JPEG + * + */ + +#ifndef DJRPLOL_H +#define DJRPLOL_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcpixel.h" /* for class DcmRepresentationParameter */ +#include "dcmtk/dcmjpeg/djdefine.h" + +/** representation parameter for lossless JPEG + */ +class DCMTK_DCMJPEG_EXPORT DJ_RPLossless : public DcmRepresentationParameter +{ +public: + + /** constructor + * @param aPrediction prediction value + * @param aPt point transform value + */ + DJ_RPLossless(int aPrediction=1, int aPt=0); + + /// copy constructor + DJ_RPLossless(const DJ_RPLossless& arg); + + /// destructor + virtual ~DJ_RPLossless(); + + /** this methods creates a copy of type DcmRepresentationParameter * + * it must be overweritten in every subclass. + * @return copy of this object + */ + virtual DcmRepresentationParameter *clone() const; + + /** returns the class name as string. + * can be used in operator== as poor man's RTTI replacement. + */ + virtual const char *className() const; + + /** compares an object to another DcmRepresentationParameter. + * Implementation must make sure that classes are comparable. + * @param arg representation parameter to compare with + * @return true if equal, false otherwise. + */ + virtual OFBool operator==(const DcmRepresentationParameter &arg) const; + + /** returns the prediction value + * @return prediction value + */ + int getPrediction() const + { + return prediction; + } + + /** returns the point transform + * @return point transform + */ + int getPointTransformation() const + { + return pt; + } + +private: + + /// prediction value + int prediction; + + /// point transform value + int pt; +}; + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djrploss.h b/dcmjpeg/include/dcmtk/dcmjpeg/djrploss.h new file mode 100644 index 00000000..eebd6e83 --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djrploss.h @@ -0,0 +1,80 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: representation parameter for lossy JPEG + * + */ + +#ifndef DJRPLOSS_H +#define DJRPLOSS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcpixel.h" /* for class DcmRepresentationParameter */ +#include "dcmtk/dcmjpeg/djdefine.h" + +/** representation parameter for lossy JPEG + */ +class DCMTK_DCMJPEG_EXPORT DJ_RPLossy: public DcmRepresentationParameter +{ +public: + + /** constructor + * @param aQuality quality factor + */ + DJ_RPLossy(int aQuality=90); + + /// copy constructor + DJ_RPLossy(const DJ_RPLossy& arg); + + /// destructor + virtual ~DJ_RPLossy(); + + /** this methods creates a copy of type DcmRepresentationParameter * + * it must be overweritten in every subclass. + * @return copy of this object + */ + virtual DcmRepresentationParameter *clone() const; + + /** returns the class name as string. + * can be used in operator== as poor man's RTTI replacement. + */ + virtual const char *className() const; + + /** compares an object to another DcmRepresentationParameter. + * Implementation must make sure that classes are comparable. + * @param arg representation parameter to compare with + * @return true if equal, false otherwise. + */ + virtual OFBool operator==(const DcmRepresentationParameter &arg) const; + + /** returns the compression quality factor + * @return compression quality factor + */ + int getQuality() const + { + return quality; + } + +private: + + /// compression quality factor + int quality; + +}; + + +#endif diff --git a/dcmjpeg/include/dcmtk/dcmjpeg/djutils.h b/dcmjpeg/include/dcmtk/dcmjpeg/djutils.h new file mode 100644 index 00000000..0a2426eb --- /dev/null +++ b/dcmjpeg/include/dcmtk/dcmjpeg/djutils.h @@ -0,0 +1,235 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: enumerations, error constants and helper functions for dcmjpeg + * + */ + +#ifndef DJUTILS_H +#define DJUTILS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcond.h" /* for class OFCondition */ +#include "dcmtk/dcmimgle/diutils.h" /* for EP_Interpretation */ +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmjpeg/djdefine.h" + + +// global definitions for logging mechanism provided by the oflog module + +extern DCMTK_DCMJPEG_EXPORT OFLogger DCM_dcmjpegLogger; + +#define DCMJPEG_TRACE(msg) OFLOG_TRACE(DCM_dcmjpegLogger, msg) +#define DCMJPEG_DEBUG(msg) OFLOG_DEBUG(DCM_dcmjpegLogger, msg) +#define DCMJPEG_INFO(msg) OFLOG_INFO(DCM_dcmjpegLogger, msg) +#define DCMJPEG_WARN(msg) OFLOG_WARN(DCM_dcmjpegLogger, msg) +#define DCMJPEG_ERROR(msg) OFLOG_ERROR(DCM_dcmjpegLogger, msg) +#define DCMJPEG_FATAL(msg) OFLOG_FATAL(DCM_dcmjpegLogger, msg) + + +// include this file in doxygen documentation + +/** @file djutils.h + * @brief type definitions and constants for the dcmjpeg module + */ + + +// forward declarations + +class DcmItem; + + +/** describes the different modes of operation of a JPEG codec + */ +enum EJ_Mode +{ + /// JPEG baseline + EJM_baseline, + + /// JPEG extended sequential + EJM_sequential, + + /// JPEG spectral selection + EJM_spectralSelection, + + /// JPEG full progression + EJM_progressive, + + /// JPEG lossless + EJM_lossless +}; + +/** describes the different types of component sub-sampling + * to be used with lossy image compression. + */ +enum E_SubSampling +{ + /// 4:4:4 sampling (no subsampling) + ESS_444, + /// 4:2:2 sampling (horizontal subsampling of chroma components) + ESS_422, + /// 4:1:1 sampling (horizontal and vertical subsampling of chroma components) + ESS_411 +}; + +/** describes the condition under which a compressed or decompressed image + * receives a new SOP instance UID. + */ +enum E_UIDCreation +{ + /** Upon compression, assign new SOP instance UID if compression is lossy. + * Upon decompression never assign new SOP instance UID. + */ + EUC_default, + + /// always assign new SOP instance UID on compression and decompression + EUC_always, + + /// never assign new SOP instance UID + EUC_never +}; + +/** describes how the decoder should handle planar configuration of + * decompressed color images. + */ +enum E_PlanarConfiguration +{ + /** automatically determine whether color-by-plane is required from + * the SOP Class UID and decompressed photometric interpretation + */ + EPC_default, + + /// always create color-by-pixel planar configuration + EPC_colorByPixel, + + /// always create color-by-plane planar configuration + EPC_colorByPlane +}; + +/** describes how color space conversion should be handled + * during the conversion of an uncompressed DICOM image to + * a JPEG-compressed image + */ +enum E_CompressionColorSpaceConversion +{ + /** encode color images in YCbCr if lossy JPEG. + * If lossless JPEG, images are encoded as RGB unless the source + * image is YCbCr in which case no color conversion is performed. + */ + ECC_lossyYCbCr, + + /** encode color images in RGB unless the source + * image is YCbCr in which case no color conversion is performed. + */ + ECC_lossyRGB, + + /** convert color images to monochrome before compressing + */ + ECC_monochrome +}; + +/** describes how color space conversion should be handled + * during the conversion of a JPEG-compressed DICOM image to + * an uncompressed image + */ +enum E_DecompressionColorSpaceConversion +{ + /** perform color space conversion from YCbCr to RGB if + * DICOM photometric interpretation indicates YCbCr. + */ + EDC_photometricInterpretation, + + /** always perform color space conversion from YCbCr to + * RGB if JPEG data is color image and compression is lossy. + */ + EDC_lossyOnly, + + /** always perform color space conversion from YCbCr to + * RGB if JPEG data is color image. + */ + EDC_always, + + /** never perform any color space conversion. + */ + EDC_never, + + /** perform color space conversion from YCbCr to RGB if + * JPEG data is color image, compression is lossy, and + * the underlying JPEG library "guesses" the color space + * to be YCbCr. + */ + EDC_guessLossyOnly, + + /** perform color space conversion from YCbCr to RGB if + * JPEG data is color image, and the underlying JPEG + * library "guesses" the color space to be YCbCr. + */ + EDC_guess +}; + + +// CONDITION CONSTANTS + +/// IJG codec suspension return +extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_Suspension; +/// Buffer for decompressed image (8 bits/sample) too small +extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_IJG8_FrameBufferTooSmall; +/// Buffer for decompressed image (12 bits/sample) too small +extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_IJG12_FrameBufferTooSmall; +/// Buffer for decompressed image (16 bits/sample) too small +extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_IJG16_FrameBufferTooSmall; +/// Codec does not support this PhotometricInterpretation +extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_UnsupportedPhotometricInterpretation; +/// Codec does not support this kind of color conversion +extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_UnsupportedColorConversion; +/// Codec does not support this kind of bit depth +extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_UnsupportedBitDepth; + +// reserved condition codes for IJG error messages +const unsigned short EJCode_IJG8_Compression = 0x0100; +const unsigned short EJCode_IJG8_Decompression = 0x0101; +const unsigned short EJCode_IJG12_Compression = 0x0102; +const unsigned short EJCode_IJG12_Decompression = 0x0103; +const unsigned short EJCode_IJG16_Compression = 0x0104; +const unsigned short EJCode_IJG16_Decompression = 0x0105; + +/** helper class with static methods used from different dcmjpeg classes + * (in particular from the encoder and the decoder part). + */ +class DCMTK_DCMJPEG_EXPORT DcmJpegHelper +{ +public: + + /** helper function that locates the photometric interpretation attribute + * in a DICOM dataset and returns a parsed value. + * @param item the dataset in which the element is searched + * @return photometric interpretation enum, EPI_Unknown if unknown string or attribute missing + */ + static EP_Interpretation getPhotometricInterpretation(DcmItem *item); + + /** adjusts the padding of a JPEG bitstream in the buffer that has odd length, + * such that the End of Image (EOI) marker ends on an even byte boundary. + * @param buffer pointer to buffer containing compressed JPEG bitstream + * @param bufSize number of bytes used for the JPEG bitstream (including pad byte) + */ + static void fixPadding( + Uint8 *buffer, + Uint32 bufSize); + +}; + +#endif diff --git a/dcmjpeg/libijg12/CMakeLists.txt b/dcmjpeg/libijg12/CMakeLists.txt new file mode 100644 index 00000000..6fe1a2b1 --- /dev/null +++ b/dcmjpeg/libijg12/CMakeLists.txt @@ -0,0 +1,2 @@ +# create library from source files +DCMTK_ADD_LIBRARY(ijg12 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils) diff --git a/dcmjpeg/libijg12/Makefile.dep b/dcmjpeg/libijg12/Makefile.dep new file mode 100644 index 00000000..61366d2b --- /dev/null +++ b/dcmjpeg/libijg12/Makefile.dep @@ -0,0 +1,227 @@ +jaricom.o: jaricom.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcapimin.o: jcapimin.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcapistd.o: jcapistd.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcarith.o: jcarith.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jccoefct.o: jccoefct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h +jccolor.o: jccolor.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcdctmgr.o: jcdctmgr.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jdct12.h +jcdiffct.o: jcdiffct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jchuff.o: jchuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jchuff12.h +jcinit.o: jcinit.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jclhuff.o: jclhuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h jchuff12.h +jclossls.o: jclossls.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jclossy.o: jclossy.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h +jcmainct.o: jcmainct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcmarker.o: jcmarker.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcmaster.o: jcmaster.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h +jcodec.o: jcodec.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jlossls12.h +jcomapi.o: jcomapi.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcparam.o: jcparam.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcphuff.o: jcphuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jchuff12.h +jcpred.o: jcpred.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jcprepct.o: jcprepct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcsample.o: jcsample.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jcscale.o: jcscale.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jcshuff.o: jcshuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jchuff12.h +jctrans.o: jctrans.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h +jdapimin.o: jdapimin.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdapistd.o: jdapistd.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdarith.o: jdarith.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdatadst.o: jdatadst.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jerror12.h +jdatasrc.o: jdatasrc.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jerror12.h +jdcoefct.o: jdcoefct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h +jdcolor.o: jdcolor.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jddctmgr.o: jddctmgr.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jdct12.h +jddiffct.o: jddiffct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jdhuff.o: jdhuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jlossls12.h jdhuff12.h +jdinput.o: jdinput.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdlhuff.o: jdlhuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h jdhuff12.h +jdlossls.o: jdlossls.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jdlossy.o: jdlossy.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h +jdmainct.o: jdmainct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdmarker.o: jdmarker.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdmaster.o: jdmaster.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdmerge.o: jdmerge.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdphuff.o: jdphuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jdhuff12.h +jdpostct.o: jdpostct.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdpred.o: jdpred.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jdsample.o: jdsample.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jdscale.o: jdscale.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossls12.h +jdshuff.o: jdshuff.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h jdhuff12.h +jdtrans.o: jdtrans.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jlossy12.h +jerror.o: jerror.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jversion12.h jerror12.h +jfdctflt.o: jfdctflt.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jdct12.h +jfdctfst.o: jfdctfst.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jdct12.h +jfdctint.o: jfdctint.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jdct12.h +jidctflt.o: jidctflt.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jdct12.h +jidctfst.o: jidctfst.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jdct12.h +jidctint.o: jidctint.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jdct12.h +jidctred.o: jidctred.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jdct12.h +jmemmgr.o: jmemmgr.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jmemsys12.h +jmemnobs.o: jmemnobs.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h \ + jmemsys12.h +jquant1.o: jquant1.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jquant2.o: jquant2.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h +jutils.o: jutils.c jinclude12.h jconfig12.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib12.h jmorecfg12.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint12.h jerror12.h diff --git a/dcmjpeg/libijg12/Makefile.in b/dcmjpeg/libijg12/Makefile.in new file mode 100644 index 00000000..3d07f014 --- /dev/null +++ b/dcmjpeg/libijg12/Makefile.in @@ -0,0 +1,59 @@ +# +# Makefile for dcmjpeg/libijg12 +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd + +LOCALINCLUDES = -I$(ofstddir)/include +LOCALDEFS = -DWITH_ARITHMETIC_PATCH + +objs = jcomapi.o jcodec.o jutils.o jerror.o jmemmgr.o \ + jmemnobs.o jcapimin.o jcapistd.o jctrans.o jcparam.o \ + jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o \ + jcprepct.o jclossls.o jclossy.o jccoefct.o jccolor.o \ + jcsample.o jchuff.o jcphuff.o jcshuff.o jclhuff.o \ + jcpred.o jcscale.o jcdiffct.o jcdctmgr.o jfdctfst.o \ + jfdctflt.o jfdctint.o jdapimin.o jdapistd.o jdtrans.o \ + jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdlossls.o \ + jdlossy.o jdhuff.o jdlhuff.o jdphuff.o jdshuff.o \ + jdpred.o jdscale.o jddiffct.o jdmainct.o jdcoefct.o \ + jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o \ + jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o \ + jdmerge.o jcarith.o jdarith.o jaricom.o +library = libijg12.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.c > $(DEP) + +include $(DEP) diff --git a/dcmjpeg/libijg12/jaricom.c b/dcmjpeg/libijg12/jaricom.c new file mode 100644 index 00000000..207e692f --- /dev/null +++ b/dcmjpeg/libijg12/jaricom.c @@ -0,0 +1,15 @@ +/* + * jaricom.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy codec tables. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + +IJG_INT32 jaritab[1]; /* dummy table */ diff --git a/dcmjpeg/libijg12/jcapimin.c b/dcmjpeg/libijg12/jcapimin.c new file mode 100644 index 00000000..23441a92 --- /dev/null +++ b/dcmjpeg/libijg12/jcapimin.c @@ -0,0 +1,280 @@ +/* + * jcapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-compression case or the transcoding-only + * case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jcapistd.c. But also see jcparam.c for + * parameter-setup helper routines, jcomapi.c for routines shared by + * compression and decompression, and jctrans.c for the transcoding case. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Initialization of a JPEG compression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_compress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_compress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = FALSE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->dest = NULL; + + cinfo->comp_info = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) + cinfo->quant_tbl_ptrs[i] = NULL; + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + cinfo->script_space = NULL; + + cinfo->input_gamma = 1.0; /* in case application forgets */ + + /* OK, I'm ready */ + cinfo->global_state = CSTATE_START; +} + + +/* + * Destruction of a JPEG compression object + */ + +GLOBAL(void) +jpeg_destroy_compress (j_compress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG compression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_compress (j_compress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Forcibly suppress or un-suppress all quantization and Huffman tables. + * Marks all currently defined tables as already written (if suppress) + * or not written (if !suppress). This will control whether they get emitted + * by a subsequent jpeg_start_compress call. + * + * This routine is exported for use by applications that want to produce + * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but + * since it is called by jpeg_start_compress, we put it here --- otherwise + * jcparam.o would be linked whether the application used it or not. + */ + +GLOBAL(void) +jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress) +{ + int i; + JQUANT_TBL * qtbl; + JHUFF_TBL * htbl; + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL) + qtbl->sent_table = suppress; + } + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + } +} + + +/* + * Finish JPEG compression. + * + * If a multipass operating mode was selected, this may do a great deal of + * work including most of the actual output. + */ + +GLOBAL(void) +jpeg_finish_compress (j_compress_ptr cinfo) +{ + JDIMENSION iMCU_row; + + if (cinfo->global_state == CSTATE_SCANNING || + cinfo->global_state == CSTATE_RAW_OK) { + /* Terminate first pass */ + if (cinfo->next_scanline < cinfo->image_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_pass) (cinfo); + } else if (cinfo->global_state != CSTATE_WRCOEFS) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any remaining passes */ + while (! cinfo->master->is_last_pass) { + (*cinfo->master->prepare_for_pass) (cinfo); + for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) { + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) iMCU_row; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* We bypass the main controller and invoke coef controller directly; + * all work is being done from the coefficient buffer. + */ + if (! (*cinfo->codec->compress_data) (cinfo, (JSAMPIMAGE) NULL)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } + (*cinfo->master->finish_pass) (cinfo); + } + /* Write EOI, do final cleanup */ + (*cinfo->marker->write_file_trailer) (cinfo); + (*cinfo->dest->term_destination) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); +} + + +/* + * Write a special marker. + * This is only recommended for writing COM or APPn markers. + * Must be called after jpeg_start_compress() and before + * first call to jpeg_write_scanlines() or jpeg_write_raw_data(). + */ + +GLOBAL(void) +jpeg_write_marker (j_compress_ptr cinfo, int marker, + const JOCTET *dataptr, unsigned int datalen) +{ + JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val)); + + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); + write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */ + while (datalen--) { + (*write_marker_byte) (cinfo, *dataptr); + dataptr++; + } +} + +/* Same, but piecemeal. */ + +GLOBAL(void) +jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +{ + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); +} + +GLOBAL(void) +jpeg_write_m_byte (j_compress_ptr cinfo, int val) +{ + (*cinfo->marker->write_marker_byte) (cinfo, val); +} + + +/* + * Alternate compression function: just write an abbreviated table file. + * Before calling this, all parameters and a data destination must be set up. + * + * To produce a pair of files containing abbreviated tables and abbreviated + * image data, one would proceed as follows: + * + * initialize JPEG object + * set JPEG parameters + * set destination to table file + * jpeg_write_tables(cinfo); + * set destination to image file + * jpeg_start_compress(cinfo, FALSE); + * write data... + * jpeg_finish_compress(cinfo); + * + * jpeg_write_tables has the side effect of marking all tables written + * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress + * will not re-emit the tables unless it is passed write_all_tables=TRUE. + */ + +GLOBAL(void) +jpeg_write_tables (j_compress_ptr cinfo) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Initialize the marker writer ... bit of a crock to do it here. */ + jinit_marker_writer(cinfo); + /* Write them tables! */ + (*cinfo->marker->write_tables_only) (cinfo); + /* And clean up. */ + (*cinfo->dest->term_destination) (cinfo); + /* + * In library releases up through v6a, we called jpeg_abort() here to free + * any working memory allocated by the destination manager and marker + * writer. Some applications had a problem with that: they allocated space + * of their own from the library memory manager, and didn't want it to go + * away during write_tables. So now we do nothing. This will cause a + * memory leak if an app calls write_tables repeatedly without doing a full + * compression cycle or otherwise resetting the JPEG object. However, that + * seems less bad than unexpectedly freeing memory in the normal case. + * An app that prefers the old behavior can call jpeg_abort for itself after + * each call to jpeg_write_tables(). + */ +} diff --git a/dcmjpeg/libijg12/jcapistd.c b/dcmjpeg/libijg12/jcapistd.c new file mode 100644 index 00000000..d47c06d4 --- /dev/null +++ b/dcmjpeg/libijg12/jcapistd.c @@ -0,0 +1,161 @@ +/* + * jcapistd.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-compression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_compress, it will end up linking in the entire compressor. + * We thus must separate this file from jcapimin.c to avoid linking the + * whole compression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Compression initialization. + * Before calling this, all parameters and a data destination must be set up. + * + * We require a write_all_tables parameter as a failsafe check when writing + * multiple datastreams from the same compression object. Since prior runs + * will have left all the tables marked sent_table=TRUE, a subsequent run + * would emit an abbreviated stream (no tables) by default. This may be what + * is wanted, but for safety's sake it should not be the default behavior: + * programmers should have to make a deliberate choice to emit abbreviated + * images. Therefore the documentation and examples should encourage people + * to pass write_all_tables=TRUE; then it will take active thought to do the + * wrong thing. + */ + +GLOBAL(void) +jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (write_all_tables) + jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + jinit_compress_master(cinfo); + /* Set up for the first pass */ + (*cinfo->master->prepare_for_pass) (cinfo); + /* Ready for application to drive first pass through jpeg_write_scanlines + * or jpeg_write_raw_data. + */ + cinfo->next_scanline = 0; + cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING); +} + + +/* + * Write some scanlines of data to the JPEG compressor. + * + * The return value will be the number of lines actually written. + * This should be less than the supplied num_lines only in case that + * the data destination module has requested suspension of the compressor, + * or if more than image_height scanlines are passed in. + * + * Note: we warn about excess calls to jpeg_write_scanlines() since + * this likely signals an application programmer error. However, + * excess scanlines passed in the last valid call are *silently* ignored, + * so that the application need not adjust num_lines for end-of-image + * when using a multiple-scanline buffer. + */ + +GLOBAL(JDIMENSION) +jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION num_lines) +{ + JDIMENSION row_ctr, rows_left; + + if (cinfo->global_state != CSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_scanlines. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_scanlines. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Ignore any extra scanlines at bottom of image. */ + rows_left = cinfo->image_height - cinfo->next_scanline; + if (num_lines > rows_left) + num_lines = rows_left; + + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); + cinfo->next_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to write raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION num_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != CSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_raw_data. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_raw_data. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Verify that at least one iMCU row has been passed. */ + lines_per_iMCU_row = (JDIMENSION)(cinfo->max_v_samp_factor * cinfo->data_unit); + if (num_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Directly compress the row. */ + if (! (*cinfo->codec->compress_data) (cinfo, data)) { + /* If compressor did not consume the whole row, suspend processing. */ + return 0; + } + + /* OK, we processed one iMCU row. */ + cinfo->next_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} diff --git a/dcmjpeg/libijg12/jcarith.c b/dcmjpeg/libijg12/jcarith.c new file mode 100644 index 00000000..f5283dbf --- /dev/null +++ b/dcmjpeg/libijg12/jcarith.c @@ -0,0 +1,26 @@ +/* + * jcarith.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy encoding routines. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Module initialization routine for arithmetic entropy encoding. + */ +GLOBAL(void) +jinit_arith_encoder (j_compress_ptr cinfo); + +GLOBAL(void) +jinit_arith_encoder (j_compress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +} diff --git a/dcmjpeg/libijg12/jccoefct.c b/dcmjpeg/libijg12/jccoefct.c new file mode 100644 index 00000000..c07be212 --- /dev/null +++ b/dcmjpeg/libijg12/jccoefct.c @@ -0,0 +1,454 @@ +/* + * jccoefct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for compression. + * This controller is the top level of the JPEG compressor proper. + * The coefficient buffer lies between forward-DCT and entropy encoding steps. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ + + +/* We use a full-image coefficient buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the DCT + * step is run during the first pass, and subsequent passes need only read + * the buffered coefficients. + */ +#ifdef ENTROPY_OPT_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#else +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#endif +#endif + + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* For single-pass compression, it's sufficient to buffer just one MCU + * (although this may prove a bit slow in practice). We allocate a + * workspace of C_MAX_DATA_UNITS_IN_MCU coefficient blocks, and reuse it for + * each MCU constructed and sent. (On 80x86, the workspace is FAR even + * though it's not really very big; this is to keep the module interfaces + * unchanged when a large coefficient buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays. + */ + JBLOCKROW MCU_buffer[C_MAX_DATA_UNITS_IN_MCU]; + + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +} c_coef_controller; + +typedef c_coef_controller * c_coef_ptr; + + +/* Forward declarations */ +METHODDEF(boolean) compress_data + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#ifdef FULL_COEF_BUFFER_SUPPORTED +METHODDEF(boolean) compress_first_pass + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(boolean) compress_output + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (coef->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_data; + break; +#ifdef FULL_COEF_BUFFER_SUPPORTED + case JBUF_SAVE_AND_PASS: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_output; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data in the single-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(boolean) +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, bi, ci, yindex, yoffset, blockcnt; + JDIMENSION ypos, xpos; + jpeg_component_info *compptr; + + /* Loop to write as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Determine where data comes from in input_buf and do the DCT thing. + * Each call on forward_DCT processes a horizontal row of DCT blocks + * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks + * sequentially. Dummy blocks at the right or bottom edge are filled in + * specially. The data in them does not matter for image reconstruction, + * so we fill them with values that will encode to the smallest amount of + * data, viz: all zeroes in the AC entries, DC entries equal to previous + * block's DC value. (Thanks to Thomas Kinsman for this idea.) + */ + blkn = 0; + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + xpos = MCU_col_num * (JDIMENSION)compptr->MCU_sample_width; + ypos = (JDIMENSION)(yoffset * DCTSIZE); /* ypos == (yoffset+yindex) * DCTSIZE */ + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + (*lossyc->fdct_forward_DCT) (cinfo, compptr, + input_buf[compptr->component_index], + coef->MCU_buffer[blkn], + ypos, xpos, (JDIMENSION) blockcnt); + if (blockcnt < compptr->MCU_width) { + /* Create some dummy blocks at the right edge of the image. */ + jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt], + (size_t)(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK)); + for (bi = blockcnt; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0]; + } + } + } else { + /* Create a row of dummy blocks at the bottom of the image. */ + jzero_far((void FAR *) coef->MCU_buffer[blkn], + (size_t)compptr->MCU_width * SIZEOF(JBLOCK)); + for (bi = 0; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0]; + } + } + blkn += compptr->MCU_width; + ypos += DCTSIZE; + } + } + /* Try to write the MCU. In event of a suspension failure, we will + * re-DCT the MCU on restart (a bit inefficient, could be fixed...) + */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +#ifdef FULL_COEF_BUFFER_SUPPORTED + +/* + * Process some data in the first pass of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * This amount of data is read from the source buffer, DCT'd and quantized, + * and saved into the virtual arrays. We also generate suitable dummy blocks + * as needed at the right and lower edges. (The dummy blocks are constructed + * in the virtual arrays, which have been padded appropriately.) This makes + * it possible for subsequent passes not to worry about real vs. dummy blocks. + * + * We must also emit the data to the entropy encoder. This is conveniently + * done by calling compress_output() after we've loaded the current strip + * of the virtual arrays. + * + * NB: input_buf contains a plane for each component in image. All + * components are DCT'd and loaded into the virtual arrays in this pass. + * However, it may be that only a subset of the components are emitted to + * the entropy encoder during this first pass; be careful about looking + * at the scan-dependent variables (MCU dimensions, etc). + */ + +METHODDEF(boolean) +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION blocks_across, MCUs_across, MCUindex; + int bi, ci, h_samp_factor, block_row, block_rows, ndummy; + JCOEF lastDC; + jpeg_component_info *compptr; + JBLOCKARRAY buffer; + JBLOCKROW thisblockrow, lastblockrow; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + coef->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, TRUE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (coef->iMCU_row_num < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + blocks_across = (JDIMENSION)compptr->width_in_data_units; + h_samp_factor = compptr->h_samp_factor; + /* Count number of dummy blocks to be added at the right margin. */ + ndummy = (int)blocks_across % h_samp_factor; + if (ndummy > 0) + ndummy = h_samp_factor - ndummy; + /* Perform DCT for all non-dummy blocks in this iMCU row. Each call + * on forward_DCT processes a complete horizontal row of DCT blocks. + */ + for (block_row = 0; block_row < block_rows; block_row++) { + thisblockrow = buffer[block_row]; + (*lossyc->fdct_forward_DCT) (cinfo, compptr, + input_buf[ci], thisblockrow, + (JDIMENSION) (block_row * DCTSIZE), + (JDIMENSION) 0, blocks_across); + if (ndummy > 0) { + /* Create dummy blocks at the right edge of the image. */ + thisblockrow += blocks_across; /* => first dummy block */ + jzero_far((void FAR *) thisblockrow, (size_t)ndummy * SIZEOF(JBLOCK)); + lastDC = thisblockrow[-1][0]; + for (bi = 0; bi < ndummy; bi++) { + thisblockrow[bi][0] = lastDC; + } + } + } + /* If at end of image, create dummy block rows as needed. + * The tricky part here is that within each MCU, we want the DC values + * of the dummy blocks to match the last real block's DC value. + * This squeezes a few more bytes out of the resulting file... + */ + if (coef->iMCU_row_num == last_iMCU_row) { + blocks_across += (JDIMENSION)ndummy; /* include lower right corner */ + MCUs_across = blocks_across / (JDIMENSION)h_samp_factor; + for (block_row = block_rows; block_row < compptr->v_samp_factor; + block_row++) { + thisblockrow = buffer[block_row]; + lastblockrow = buffer[block_row-1]; + jzero_far((void FAR *) thisblockrow, + (size_t) (blocks_across * SIZEOF(JBLOCK))); + for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) { + lastDC = lastblockrow[h_samp_factor-1][0]; + for (bi = 0; bi < h_samp_factor; bi++) { + thisblockrow[bi][0] = lastDC; + } + thisblockrow += h_samp_factor; /* advance to next MCU in row */ + lastblockrow += h_samp_factor; + } + } + } + } + /* NB: compress_output will increment iMCU_row_num if successful. + * A suspension return will result in redoing all the work above next time. + */ + + /* Emit data to the entropy encoder, sharing code with subsequent passes */ + return compress_output(cinfo, input_buf); +} + + +/* + * Process some data in subsequent passes of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. + * NB: during first pass, this is safe only because the buffers will + * already be aligned properly, so jmemmgr.c won't need to do any I/O. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to write the MCU. */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + +#endif /* FULL_COEF_BUFFER_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef; + + coef = (c_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_coef_controller)); + lossyc->coef_private = (struct jpeg_c_coef_controller *) coef; + lossyc->coef_start_pass = start_pass_coef; + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef FULL_COEF_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + int ci; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_DATA_UNITS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + coef->whole_image[0] = NULL; /* flag for no virtual arrays */ + } +} diff --git a/dcmjpeg/libijg12/jccolor.c b/dcmjpeg/libijg12/jccolor.c new file mode 100644 index 00000000..6e1f8496 --- /dev/null +++ b/dcmjpeg/libijg12/jccolor.c @@ -0,0 +1,459 @@ +/* + * jccolor.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_converter pub; /* public fields */ + + /* Private state for RGB->YCC conversion */ + IJG_INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ +} my_color_converter; + +typedef my_color_converter * my_cconvert_ptr; + + +/**************** RGB -> YCbCr conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE + * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2, + * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and + * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0) + * were not represented exactly. Now we sacrifice exact representation of + * maximum red and maximum blue in order to get exact grayscales. + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times R,G,B for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included + * in the tables to save adding them separately in the inner loop. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define CBCR_OFFSET ((IJG_INT32) CENTERJSAMPLE << SCALEBITS) +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L< Y section */ +#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */ +#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */ +#define R_CB_OFF (3*(MAXJSAMPLE+1)) +#define G_CB_OFF (4*(MAXJSAMPLE+1)) +#define B_CB_OFF (5*(MAXJSAMPLE+1)) +#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */ +#define G_CR_OFF (6*(MAXJSAMPLE+1)) +#define B_CR_OFF (7*(MAXJSAMPLE+1)) +#define TABLE_SIZE (8*(MAXJSAMPLE+1)) + + +/* + * Initialize for RGB->YCC colorspace conversion. + */ + +METHODDEF(void) +rgb_ycc_start (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + IJG_INT32 * rgb_ycc_tab; + IJG_INT32 i; + + /* Allocate and fill in the conversion tables. */ + cconvert->rgb_ycc_tab = rgb_ycc_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (TABLE_SIZE * SIZEOF(IJG_INT32))); + + for (i = 0; i <= MAXJSAMPLE; i++) { + rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; + rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; + rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; + rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i; + rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i; + /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr. + * This ensures that the maximum output will round to MAXJSAMPLE + * not MAXJSAMPLE+1, and thus that we don't have to range-limit. + */ + rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +/* B=>Cb and R=>Cr tables are the same + rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +*/ + rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i; + rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i; + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * + * Note that we change from the application's interleaved-pixel format + * to our internal noninterleaved, one-plane-per-component format. + * The input buffer is therefore three times as wide as the output buffer. + * + * A starting row offset is provided only for the output buffer. The caller + * can easily adjust the passed input_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +rgb_ycc_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + inptr += RGB_PIXELSIZE; + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + } + } +} + + +/**************** Cases other than RGB -> YCbCr **************/ + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles RGB->grayscale conversion, which is the same + * as the RGB->Y portion of RGB->YCbCr. + * We assume rgb_ycc_start has been called (we only use the Y tables). + */ + +METHODDEF(void) +rgb_gray_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + inptr += RGB_PIXELSIZE; + /* Y */ + outptr[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles Adobe-style CMYK->YCCK conversion, + * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same + * conversion as above, while passing K (black) unchanged. + * We assume rgb_ycc_start has been called. + */ + +METHODDEF(void) +cmyk_ycck_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2, outptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + outptr3 = output_buf[3][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = MAXJSAMPLE - GETJSAMPLE(inptr[0]); + g = MAXJSAMPLE - GETJSAMPLE(inptr[1]); + b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); + /* K passes through as-is */ + outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ + inptr += 4; + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles grayscale output with no conversion. + * The source can be either plain grayscale or YCbCr (since Y == gray). + */ + +METHODDEF(void) +grayscale_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + int instride = cinfo->input_components; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ + inptr += instride; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles multi-component colorspaces without conversion. + * We assume input_components == num_components. + */ + +METHODDEF(void) +null_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + register int ci; + int nc = cinfo->num_components; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + /* It seems fastest to make a separate pass for each component. */ + for (ci = 0; ci < nc; ci++) { + inptr = *input_buf; + outptr = output_buf[ci][output_row]; + for (col = 0; col < num_cols; col++) { + outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */ + inptr += nc; + } + } + input_buf++; + output_row++; + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +null_method (j_compress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for input colorspace conversion. + */ + +GLOBAL(void) +jinit_color_converter (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_converter)); + cinfo->cconvert = (struct jpeg_color_converter *) cconvert; + /* set start_pass to null method until we find out differently */ + cconvert->pub.start_pass = null_method; + + /* Make sure input_components agrees with in_color_space */ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + if (cinfo->input_components != 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_RGB: +#if RGB_PIXELSIZE != 3 + if (cinfo->input_components != RGB_PIXELSIZE) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; +#endif /* else share code with YCbCr */ + + case JCS_YCbCr: + if (cinfo->input_components != 3) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->input_components != 4) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->input_components < 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + } + + /* Check num_components, set conversion method based on requested space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_GRAYSCALE) + cconvert->pub.color_convert = grayscale_convert; + else if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_gray_convert; + } else if (cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = grayscale_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_ycc_convert; + } else if (cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = cmyk_ycck_convert; + } else if (cinfo->in_color_space == JCS_YCCK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: /* allow null conversion of JCS_UNKNOWN */ + if (cinfo->jpeg_color_space != cinfo->in_color_space || + cinfo->num_components != cinfo->input_components) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + cconvert->pub.color_convert = null_convert; + break; + } +} diff --git a/dcmjpeg/libijg12/jcdctmgr.c b/dcmjpeg/libijg12/jcdctmgr.c new file mode 100644 index 00000000..8ff7cae9 --- /dev/null +++ b/dcmjpeg/libijg12/jcdctmgr.c @@ -0,0 +1,390 @@ +/* + * jcdctmgr.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the forward-DCT management logic. + * This code selects a particular DCT implementation to be used, + * and it performs related housekeeping chores including coefficient + * quantization. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ +#include "jdct12.h" /* Private declarations for DCT subsystem */ + + +/* Private subobject for this module */ + +typedef struct { + /* Pointer to the DCT routine actually in use */ + forward_DCT_method_ptr do_dct; + + /* The actual post-DCT divisors --- not identical to the quant table + * entries, because of scaling (especially for an unnormalized DCT). + * Each table is given in normal array order. + */ + DCTELEM * divisors[NUM_QUANT_TBLS]; + +#ifdef DCT_FLOAT_SUPPORTED + /* Same as above for the floating-point case. */ + float_DCT_method_ptr do_float_dct; + FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; +#endif +} fdct_controller; + +typedef fdct_controller * fdct_ptr; + + +/* + * Initialize for a processing pass. + * Verify that all referenced Q-tables are present, and set up + * the divisor table for each one. + * In the current implementation, DCT of all components is done during + * the first pass, even if only some components will be output in the + * first scan. Hence all components should be examined here. + */ + +METHODDEF(void) +start_pass_fdctmgr (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + int ci, qtblno, i; + jpeg_component_info *compptr; + JQUANT_TBL * qtbl; + DCTELEM * dtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + qtblno = compptr->quant_tbl_no; + /* Make sure specified quantization table is present */ + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + qtbl = cinfo->quant_tbl_ptrs[qtblno]; + /* Compute divisors for this quant table */ + /* We may do this more than once for same table, but it's not a big deal */ + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + /* For LL&M IDCT method, divisors are equal to raw quantization + * coefficients multiplied by 8 (to counteract scaling). + */ + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; + } + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + */ +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = (DCTELEM) + DESCALE(MULTIPLY16V16((IJG_INT32) qtbl->quantval[i], + (IJG_INT32) aanscales[i]), + CONST_BITS-3); + } + } + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + * What's actually stored is 1/divisor so that the inner loop can + * use a multiplication rather than a division. + */ + FAST_FLOAT * fdtbl; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + if (fdct->float_divisors[qtblno] == NULL) { + fdct->float_divisors[qtblno] = (FAST_FLOAT *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(FAST_FLOAT)); + } + fdtbl = fdct->float_divisors[qtblno]; + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fdtbl[i] = (FAST_FLOAT) + (1.0 / (((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col] * 8.0))); + i++; + } + } + } + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Perform forward DCT on one or more blocks of a component. + * + * The input samples are taken from the sample_data[] array starting at + * position start_row/start_col, and moving to the right for any additional + * blocks. The quantized coefficients are returned in coef_blocks[]. + */ + +METHODDEF(void) +forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for integer DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + forward_DCT_method_ptr do_dct = fdct->do_dct; + DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; + DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { + /* Load data into workspace, applying unsigned->signed conversion */ + { register DCTELEM *workspaceptr; + register JSAMPROW elemptr; + register int elemr; + + workspaceptr = workspace; + for (elemr = 0; elemr < DCTSIZE; elemr++) { + elemptr = sample_data[elemr] + start_col; +#if DCTSIZE == 8 /* unroll the inner loop */ + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; +#else + { register int elemc; + for (elemc = DCTSIZE; elemc > 0; elemc--) { + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + } + } +#endif + } + } + + /* Perform the DCT */ + (*do_dct) (workspace); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register DCTELEM temp, qval; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + qval = divisors[i]; + temp = workspace[i]; + /* Divide the coefficient value by qval, ensuring proper rounding. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * + * In most files, at least half of the output values will be zero + * (at default quantization settings, more like three-quarters...) + * so we should ensure that this case is fast. On many machines, + * a comparison is enough cheaper than a divide to make a special test + * a win. Since both inputs will be nonnegative, we need only test + * for a < b to discover whether a/b is 0. + * If your machine's division is fast enough, define FAST_DIVIDE. + */ +#ifdef FAST_DIVIDE +#define DIVIDE_BY(a,b) a /= b +#else +#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 +#endif + if (temp < 0) { + temp = -temp; + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + temp = -temp; + } else { + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + } + output_ptr[i] = (JCOEF) temp; + } + } + } +} + + +#ifdef DCT_FLOAT_SUPPORTED + +METHODDEF(void) +forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for floating-point DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + float_DCT_method_ptr do_dct = fdct->do_float_dct; + FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; + FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { + /* Load data into workspace, applying unsigned->signed conversion */ + { register FAST_FLOAT *workspaceptr; + register JSAMPROW elemptr; + register int elemr; + + workspaceptr = workspace; + for (elemr = 0; elemr < DCTSIZE; elemr++) { + elemptr = sample_data[elemr] + start_col; +#if DCTSIZE == 8 /* unroll the inner loop */ + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); +#else + { register int elemc; + for (elemc = DCTSIZE; elemc > 0; elemc--) { + *workspaceptr++ = (FAST_FLOAT) + (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + } + } +#endif + } + } + + /* Perform the DCT */ + (*do_dct) (workspace); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register FAST_FLOAT temp; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + /* Apply the quantization and scaling factor */ + temp = workspace[i] * divisors[i]; + /* Round to nearest integer. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * The maximum coefficient size is +-16K (for 12-bit data), so this + * code should work for either 16-bit or 32-bit ints. + */ + output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384); + } + } + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ + + +/* + * Initialize FDCT manager. + */ + +GLOBAL(void) +jinit_forward_dct (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct; + int i; + + fdct = (fdct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(fdct_controller)); + lossyc->fdct_private = (struct jpeg_forward_dct *) fdct; + lossyc->fdct_start_pass = start_pass_fdctmgr; + + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + lossyc->fdct_forward_DCT = forward_DCT; + fdct->do_dct = jpeg_fdct_islow; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + lossyc->fdct_forward_DCT = forward_DCT; + fdct->do_dct = jpeg_fdct_ifast; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + lossyc->fdct_forward_DCT = forward_DCT_float; + fdct->do_float_dct = jpeg_fdct_float; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + + /* Mark divisor tables unallocated */ + for (i = 0; i < NUM_QUANT_TBLS; i++) { + fdct->divisors[i] = NULL; +#ifdef DCT_FLOAT_SUPPORTED + fdct->float_divisors[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg12/jcdiffct.c b/dcmjpeg/libijg12/jcdiffct.c new file mode 100644 index 00000000..25b75834 --- /dev/null +++ b/dcmjpeg/libijg12/jcdiffct.c @@ -0,0 +1,406 @@ +/* + * jcdiffct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the difference buffer controller for compression. + * This controller is the top level of the lossless JPEG compressor proper. + * The difference buffer lies between prediction/differencing and entropy + * encoding. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* We use a full-image sample buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the + * full-image buffer is filled during the first pass, and the scaling, + * prediction and differencing steps are run during subsequent passes. + */ +#ifdef ENTROPY_OPT_SUPPORTED +#define FULL_SAMP_BUFFER_SUPPORTED +#else +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define FULL_SAMP_BUFFER_SUPPORTED +#endif +#endif + + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + JSAMPROW cur_row[MAX_COMPONENTS]; /* row of point transformed samples */ + JSAMPROW prev_row[MAX_COMPONENTS]; /* previous row of Pt'd samples */ + JDIFFARRAY diff_buf[MAX_COMPONENTS]; /* iMCU row of differences */ + + /* In multi-pass modes, we need a virtual sample array for each component. */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +} c_diff_controller; + +typedef c_diff_controller * c_diff_ptr; + + +/* Forward declarations */ +METHODDEF(boolean) compress_data + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#ifdef FULL_SAMP_BUFFER_SUPPORTED +METHODDEF(boolean) compress_first_pass + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(boolean) compress_output + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + diff->MCU_rows_per_iMCU_row = 1; + } else { + if (diff->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + diff->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + diff->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + diff->mcu_ctr = 0; + diff->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_diff (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + + diff->iMCU_row_num = 0; + start_iMCU_row(cinfo); + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (diff->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_data; + break; +#ifdef FULL_SAMP_BUFFER_SUPPORTED + case JBUF_SAVE_AND_PASS: + if (diff->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (diff->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_output; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +#define SWAP_ROWS(rowa,rowb) {JSAMPROW temp; temp=rowa; rowa=rowb; rowb=temp;} + +/* + * Process some data in the single-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the image. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(boolean) +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_count; /* number of MCUs encoded */ + /* JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; */ + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int comp, ci, yoffset, samp_row, samp_rows, samps_across; + jpeg_component_info *compptr; + + /* Loop to write as much as one whole iMCU row */ + for (yoffset = diff->MCU_vert_offset; yoffset < diff->MCU_rows_per_iMCU_row; + yoffset++) { + + MCU_col_num = diff->mcu_ctr; + + /* Scale and predict each scanline of the MCU-row separately. + * + * Note: We only do this if we are at the start of a MCU-row, ie, + * we don't want to reprocess a row suspended by the output. + */ + if (MCU_col_num == 0) { + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + if (diff->iMCU_row_num < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + else { + /* Fill dummy difference rows at the bottom edge with zeros, which + * will encode to the smallest amount of data. + */ + for (samp_row = samp_rows; samp_row < compptr->v_samp_factor; + samp_row++) + MEMZERO(diff->diff_buf[ci][samp_row], + (size_t)jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor) * SIZEOF(JDIFF)); + } + } + samps_across = (int)compptr->width_in_data_units; + + for (samp_row = 0; samp_row < samp_rows; samp_row++) { + (*losslsc->scaler_scale) (cinfo, + input_buf[ci][samp_row], + diff->cur_row[ci], (JDIMENSION)samps_across); + (*losslsc->predict_difference[ci]) (cinfo, ci, + diff->cur_row[ci], + diff->prev_row[ci], + diff->diff_buf[ci][samp_row], + (JDIMENSION)samps_across); + SWAP_ROWS(diff->cur_row[ci], diff->prev_row[ci]); + } + } + } + + /* Try to write the MCU-row (or remaining portion of suspended MCU-row). */ + MCU_count = + (*losslsc->entropy_encode_mcus) (cinfo, + diff->diff_buf, (JDIMENSION)yoffset, MCU_col_num, + (JDIMENSION)cinfo->MCUs_per_row - MCU_col_num); + if (MCU_count != cinfo->MCUs_per_row - MCU_col_num) { + /* Suspension forced; update state counters and exit */ + diff->MCU_vert_offset = yoffset; + diff->mcu_ctr += MCU_col_num; + return FALSE; + } + + /* Completed an MCU row, but perhaps not an iMCU row */ + diff->mcu_ctr = 0; + } + + /* Completed the iMCU row, advance counters for next one */ + diff->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +#ifdef FULL_SAMP_BUFFER_SUPPORTED + +/* + * Process some data in the first pass of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the image. + * This amount of data is read from the source buffer and saved into the + * virtual arrays. + * + * We must also emit the data to the compressor. This is conveniently + * done by calling compress_output() after we've loaded the current strip + * of the virtual arrays. + * + * NB: input_buf contains a plane for each component in image. All components + * are loaded into the virtual arrays in this pass. However, it may be that + * only a subset of the components are emitted to the compressor during + * this first pass; be careful about looking at the scan-dependent variables + * (MCU dimensions, etc). + */ + +METHODDEF(boolean) +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION samps_across; + int ci, samp_row, samp_rows; + JSAMPARRAY buffer[MAX_COMPONENTS]; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffers for this component. */ + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + diff->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + + /* Count non-dummy sample rows in this iMCU row. */ + if (diff->iMCU_row_num < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + } + samps_across = compptr->width_in_data_units; + + /* Perform point transform scaling and prediction/differencing for all + * non-dummy rows in this iMCU row. Each call on these functions + * process a complete row of samples. + */ + for (samp_row = 0; samp_row < samp_rows; samp_row++) { + MEMCOPY(buffer[ci][samp_row], input_buf[ci][samp_row], + samps_across * SIZEOF(JSAMPLE)); + } + } + + /* NB: compress_output will increment iMCU_row_num if successful. + * A suspension return will result in redoing all the work above next time. + */ + + /* Emit data to the compressor, sharing code with subsequent passes */ + return compress_output(cinfo, input_buf); +} + + +/* + * Process some data in subsequent passes of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the compressor. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */ + /* JDIMENSION MCU_count; */ /* number of MCUs encoded */ + int comp, ci /* , yoffset */ ; + JSAMPARRAY buffer[MAX_COMPONENTS]; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. + * NB: during first pass, this is safe only because the buffers will + * already be aligned properly, so jmemmgr.c won't need to do any I/O. + */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + diff->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + return compress_data(cinfo, buffer); +} + +#endif /* FULL_SAMP_BUFFER_SUPPORTED */ + + +/* + * Initialize difference buffer controller. + */ + +GLOBAL(void) +jinit_c_diff_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff; + int ci, row; + jpeg_component_info *compptr; + + diff = (c_diff_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_diff_controller)); + losslsc->diff_private = (void *) diff; + losslsc->diff_start_pass = start_pass_diff; + + /* Create the prediction row buffers. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->cur_row[ci] = *(*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) 1); + diff->prev_row[ci] = *(*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) 1); + } + + /* Create the difference buffer. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->diff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + /* Prefill difference rows with zeros. We do this because only actual + * data is placed in the buffers during prediction/differencing, leaving + * any dummy differences at the right edge as zeros, which will encode + * to the smallest amount of data. + */ + for (row = 0; row < compptr->v_samp_factor; row++) + MEMZERO(diff->diff_buf[ci][row], + (size_t)jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor) * SIZEOF(JDIFF)); + } + + /* Create the sample buffer. */ + if (need_full_buffer) { +#ifdef FULL_SAMP_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor differences in each direction. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else + diff->whole_image[0] = NULL; /* flag for no virtual arrays */ +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jchuff.c b/dcmjpeg/libijg12/jchuff.c new file mode 100644 index 00000000..1f318cf5 --- /dev/null +++ b/dcmjpeg/libijg12/jchuff.c @@ -0,0 +1,274 @@ +/* + * jchuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines which are shared + * by the sequential, progressive and lossless decoders. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jchuff12.h" /* Declarations shared with jc*huff.c */ + + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +GLOBAL(void) +jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, + c_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + c_derived_tbl *dtbl; + int p, i, l, lastp, si, maxsymbol; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (c_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_derived_tbl)); + dtbl = *pdtbl; + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + lastp = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + * BUG FIX: Comparison must be >, not >= + */ + if (((IJG_INT32) code) > (((IJG_INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure C.3: generate encoding tables */ + /* These are code and size indexed by symbol value */ + + /* Set all codeless symbols to have code length 0; + * this lets us detect duplicate VAL entries here, and later + * allows emit_bits to detect any attempt to emit such symbols. + */ + MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi)); + + /* This is also a convenient place to check for out-of-range + * and duplicated VAL entries. We allow 0..255 for AC symbols + * but only 0..16 for DC. (We could constrain them further + * based on data depth and mode, but this seems enough.) + */ + maxsymbol = isDC ? 16 : 255; + + for (p = 0; p < lastp; p++) { + i = htbl->huffval[p]; + if (i < 0 || i > maxsymbol || dtbl->ehufsi[i]) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + dtbl->ehufco[i] = huffcode[p]; + dtbl->ehufsi[i] = huffsize[p]; + } +} + + +/* + * Generate the best Huffman code table for the given counts, fill htbl. + * + * The JPEG standard requires that no symbol be assigned a codeword of all + * one bits (so that padding bits added at the end of a compressed segment + * can't look like a valid code). Because of the canonical ordering of + * codewords, this just means that there must be an unused slot in the + * longest codeword length category. Section K.2 of the JPEG spec suggests + * reserving such a slot by pretending that symbol 256 is a valid symbol + * with count 1. In theory that's not optimal; giving it count zero but + * including it in the symbol set anyway should give a better Huffman code. + * But the theoretically better code actually seems to come out worse in + * practice, because it produces more all-ones bytes (which incur stuffed + * zero bytes in the final file). In any case the difference is tiny. + * + * The JPEG standard requires Huffman codes to be no more than 16 bits long. + * If some symbols have a very small but nonzero probability, the Huffman tree + * must be adjusted to meet the code length restriction. We currently use + * the adjustment method suggested in JPEG section K.2. This method is *not* + * optimal; it may not choose the best possible limited-length code. But + * typically only very-low-frequency symbols will be given less-than-optimal + * lengths, so the code is almost optimal. Experimental comparisons against + * an optimal limited-length-code algorithm indicate that the difference is + * microscopic --- usually less than a hundredth of a percent of total size. + * So the extra complexity of an optimal algorithm doesn't seem worthwhile. + */ + +GLOBAL(void) +jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) +{ +#define MAX_CLEN 32 /* assumed maximum initial code length */ + UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ + int codesize[257]; /* codesize[k] = code length of symbol k */ + int others[257]; /* next symbol in current branch of tree */ + int c1, c2; + int p, i, j; + long v; + + /* This algorithm is explained in section K.2 of the JPEG standard */ + + MEMZERO(bits, SIZEOF(bits)); + MEMZERO(codesize, SIZEOF(codesize)); + for (i = 0; i < 257; i++) + others[i] = -1; /* init links to empty */ + + freq[256] = 1; /* make sure 256 has a nonzero count */ + /* Including the pseudo-symbol 256 in the Huffman procedure guarantees + * that no real symbol is given code-value of all ones, because 256 + * will be placed last in the largest codeword category. + */ + + /* Huffman's basic algorithm to assign optimal code lengths to symbols */ + + for (;;) { + /* Find the smallest nonzero frequency, set c1 = its symbol */ + /* In case of ties, take the larger symbol number */ + c1 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v) { + v = freq[i]; + c1 = i; + } + } + + /* Find the next smallest nonzero frequency, set c2 = its symbol */ + /* In case of ties, take the larger symbol number */ + c2 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v && i != c1) { + v = freq[i]; + c2 = i; + } + } + + /* Done if we've merged everything into one frequency */ + if (c2 < 0) + break; + + /* Else merge the two counts/trees */ + freq[c1] += freq[c2]; + freq[c2] = 0; + + /* Increment the codesize of everything in c1's tree branch */ + codesize[c1]++; + while (others[c1] >= 0) { + c1 = others[c1]; + codesize[c1]++; + } + + others[c1] = c2; /* chain c2 onto c1's tree branch */ + + /* Increment the codesize of everything in c2's tree branch */ + codesize[c2]++; + while (others[c2] >= 0) { + c2 = others[c2]; + codesize[c2]++; + } + } + + /* Now count the number of symbols of each code length */ + for (i = 0; i <= 256; i++) { + if (codesize[i]) { + /* The JPEG standard seems to think that this can't happen, */ + /* but I'm paranoid... */ + if (codesize[i] > MAX_CLEN) + ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW); + + bits[codesize[i]]++; + } + } + + /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure + * Huffman procedure assigned any such lengths, we must adjust the coding. + * Here is what the JPEG spec says about how this next bit works: + * Since symbols are paired for the longest Huffman code, the symbols are + * removed from this length category two at a time. The prefix for the pair + * (which is one bit shorter) is allocated to one of the pair; then, + * skipping the BITS entry for that prefix length, a code word from the next + * shortest nonzero BITS entry is converted into a prefix for two code words + * one bit longer. + */ + + for (i = MAX_CLEN; i > 16; i--) { + while (bits[i] > 0) { + j = i - 2; /* find length of new prefix to be used */ + while (bits[j] == 0) + j--; + + bits[i] = (UINT8)(bits[i] - 2); /* remove two symbols */ + bits[i-1]++; /* one goes in this length */ + bits[j+1] = (UINT8)(bits[j+1] + 2); /* two new symbols in this length */ + bits[j]--; /* symbol of this length is now a prefix */ + } + } + + /* Remove the count for the pseudo-symbol 256 from the largest codelength */ + while (bits[i] == 0) /* find largest codelength still in use */ + i--; + bits[i]--; + + /* Return final symbol counts (only for lengths 0..16) */ + MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); + + /* Return a list of the symbols sorted by code length */ + /* It's not real clear to me why we don't need to consider the codelength + * changes made above, but the JPEG spec seems to think this works. + */ + p = 0; + for (i = 1; i <= MAX_CLEN; i++) { + for (j = 0; j <= 255; j++) { + if (codesize[j] == i) { + htbl->huffval[p] = (UINT8) j; + p++; + } + } + } + + /* Set sent_table FALSE so updated table will be written to JPEG file. */ + htbl->sent_table = FALSE; +} diff --git a/dcmjpeg/libijg12/jchuff12.h b/dcmjpeg/libijg12/jchuff12.h new file mode 100644 index 00000000..addfb3ff --- /dev/null +++ b/dcmjpeg/libijg12/jchuff12.h @@ -0,0 +1,54 @@ +/* + * jchuff.h + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains declarations for Huffman entropy encoding routines + * that are shared between the sequential encoder (jchuff.c) and the + * progressive encoder (jcphuff.c). No other modules need to see these. + */ + +/* The legal range of a DCT coefficient is + * -1024 .. +1023 for 8-bit data; + * -16384 .. +16383 for 12-bit data. + * Hence the magnitude should always fit in 10 or 14 bits respectively. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MAX_COEF_BITS 10 +#else +#define MAX_COEF_BITS 14 +#endif + +/* The legal range of a spatial difference is + * -32767 .. +32768. + * Hence the magnitude should always fit in 16 bits. + */ + +#define MAX_DIFF_BITS 16 + +/* Derived data constructed for each Huffman table */ + +typedef struct { + unsigned int ehufco[256]; /* code for each symbol */ + char ehufsi[256]; /* length of code for each symbol */ + /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ +} c_derived_tbl; + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_make_c_derived_tbl jpeg12_make_c_derived_tbl +#define jpeg_gen_optimal_table jpeg12_gen_optimal_table +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Expand a Huffman table definition into the derived format */ +EXTERN(void) jpeg_make_c_derived_tbl + JPP((j_compress_ptr cinfo, boolean isDC, int tblno, + c_derived_tbl ** pdtbl)); + +/* Generate an optimal table definition given the specified counts */ +EXTERN(void) jpeg_gen_optimal_table + JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])); diff --git a/dcmjpeg/libijg12/jcinit.c b/dcmjpeg/libijg12/jcinit.c new file mode 100644 index 00000000..b2953380 --- /dev/null +++ b/dcmjpeg/libijg12/jcinit.c @@ -0,0 +1,57 @@ +/* + * jcinit.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains initialization logic for the JPEG compressor. + * This routine is in charge of selecting the modules to be executed and + * making an initialization call to each one. + * + * Logically, this code belongs in jcmaster.c. It's split out because + * linking this routine implies linking the entire compression library. + * For a transcoding-only application, we want to be able to use jcmaster.c + * without linking in the whole library. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Master selection of compression modules. + * This is done once at the start of processing an image. We determine + * which modules will be used and give them appropriate initialization calls. + */ + +GLOBAL(void) +jinit_compress_master (j_compress_ptr cinfo) +{ + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, FALSE /* full compression */); + + /* Initialize compression codec */ + jinit_c_codec(cinfo); + + /* Preprocessing */ + if (! cinfo->raw_data_in) { + jinit_color_converter(cinfo); + jinit_downsampler(cinfo); + jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); + } + + jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} diff --git a/dcmjpeg/libijg12/jclhuff.c b/dcmjpeg/libijg12/jclhuff.c new file mode 100644 index 00000000..5689a5ce --- /dev/null +++ b/dcmjpeg/libijg12/jclhuff.c @@ -0,0 +1,601 @@ +/* + * jclhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for lossless JPEG. + * + * Much of the complexity here has to do with supporting output suspension. + * If the data destination module demands suspension, we want to be able to + * back up to the start of the current MCU. To do this, we copy state + * variables into local working storage, and update them back to the + * permanent JPEG objects only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" /* Private declarations for lossless codec */ +#include "jchuff12.h" /* Declarations shared with jc*huff.c */ + + +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#define ASSIGN_STATE(dest,src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits) +#endif + + +typedef struct { + int ci, yoffset, MCU_width; +} lhe_input_ptr_info; + + +typedef struct { + savable_state saved; /* Bit buffer at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Pointers to derived tables to be used for each data unit within an MCU */ + c_derived_tbl * cur_tbls[C_MAX_DATA_UNITS_IN_MCU]; + +#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ + long * count_ptrs[NUM_HUFF_TBLS]; + + /* Pointers to stats tables to be used for each data unit within an MCU */ + long * cur_counts[C_MAX_DATA_UNITS_IN_MCU]; +#endif + + /* Pointers to the proper input difference row for each group of data units + * within an MCU. For each component, there are Vi groups of Hi data units. + */ + JDIFFROW input_ptr[C_MAX_DATA_UNITS_IN_MCU]; + + /* Number of input pointers in use for the current MCU. This is the sum + * of all Vi in the MCU. + */ + int num_input_ptrs; + + /* Information used for positioning the input pointers within the input + * difference rows. + */ + lhe_input_ptr_info input_ptr_info[C_MAX_DATA_UNITS_IN_MCU]; + + /* Index of the proper input pointer for each data unit within an MCU */ + int input_ptr_index[C_MAX_DATA_UNITS_IN_MCU]; + +} lhuff_entropy_encoder; + +typedef lhuff_entropy_encoder * lhuff_entropy_ptr; + +/* Working state while writing an MCU. + * This struct contains all the fields that are needed by subroutines. + */ + +typedef struct { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ +} working_state; + + +/* Forward declarations */ +METHODDEF(JDIMENSION) encode_mcus_huff (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU); +METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); +#ifdef ENTROPY_OPT_SUPPORTED +METHODDEF(JDIMENSION) encode_mcus_gather (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU); +METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); +#endif + + +/* + * Initialize for a Huffman-compressed scan. + * If gather_statistics is TRUE, we do not output anything during the scan, + * just count the Huffman symbols used and generate Huffman code tables. + */ + +METHODDEF(void) +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + int ci, dctbl, sampn, ptrn, yoffset, xoffset; + jpeg_component_info * compptr; + + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + losslsc->entropy_encode_mcus = encode_mcus_gather; + losslsc->pub.entropy_finish_pass = finish_pass_gather; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + losslsc->entropy_encode_mcus = encode_mcus_huff; + losslsc->pub.entropy_finish_pass = finish_pass_huff; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + /* Check for invalid table indexes */ + /* (make_c_derived_tbl does this in the other path) */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->count_ptrs[dctbl] == NULL) + entropy->count_ptrs[dctbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->count_ptrs[dctbl], 257 * SIZEOF(long)); +#endif + } else { + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, + & entropy->derived_tbls[dctbl]); + } + } + + /* Precalculate encoding info for each sample in an MCU of this scan */ + for (sampn = 0, ptrn = 0; sampn < cinfo->data_units_in_MCU;) { + compptr = cinfo->cur_comp_info[cinfo->MCU_membership[sampn]]; + ci = compptr->component_index; + /* ci = cinfo->MCU_membership[sampn]; + compptr = cinfo->cur_comp_info[ci];*/ + for (yoffset = 0; yoffset < compptr->MCU_height; yoffset++, ptrn++) { + /* Precalculate the setup info for each input pointer */ + entropy->input_ptr_info[ptrn].ci = ci; + entropy->input_ptr_info[ptrn].yoffset = yoffset; + entropy->input_ptr_info[ptrn].MCU_width = compptr->MCU_width; + for (xoffset = 0; xoffset < compptr->MCU_width; xoffset++, sampn++) { + /* Precalculate the input pointer index for each sample */ + entropy->input_ptr_index[sampn] = ptrn; + /* Precalculate which tables to use for each sample */ + entropy->cur_tbls[sampn] = entropy->derived_tbls[compptr->dc_tbl_no]; + entropy->cur_counts[sampn] = entropy->count_ptrs[compptr->dc_tbl_no]; + } + } + } + entropy->num_input_ptrs = ptrn; + + /* Initialize bit buffer to empty */ + entropy->saved.put_buffer = 0; + entropy->saved.put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file */ + +/* Emit a byte, taking 'action' if must suspend. */ +#define emit_byte(state,val,action) \ + { *(state)->next_output_byte++ = (JOCTET) (val); \ + if (--(state)->free_in_buffer == 0) \ + if (! dump_buffer(state)) \ + { action; } } + + +LOCAL(boolean) +dump_buffer (working_state * state) +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +{ + struct jpeg_destination_mgr * dest = state->cinfo->dest; + + if (! (*dest->empty_output_buffer) (state->cinfo)) + return FALSE; + /* After a successful buffer dump, must reset buffer pointers */ + state->next_output_byte = dest->next_output_byte; + state->free_in_buffer = dest->free_in_buffer; + return TRUE; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(boolean) +emit_bits (working_state * state, unsigned int code, int size) +/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = state->cur.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); + + put_buffer &= (((IJG_INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(state, c, return FALSE); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(state, 0, return FALSE); + } + put_buffer <<= 8; + put_bits -= 8; + } + + state->cur.put_buffer = put_buffer; /* update state variables */ + state->cur.put_bits = put_bits; + + return TRUE; +} + + +LOCAL(boolean) +flush_bits (working_state * state) +{ + if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ + return FALSE; + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ + state->cur.put_bits = 0; + return TRUE; +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(boolean) +emit_restart (working_state * state, int restart_num) +{ + /* int ci; */ + + if (! flush_bits(state)) + return FALSE; + + emit_byte(state, 0xFF, return FALSE); + emit_byte(state, JPEG_RST0 + restart_num, return FALSE); + + /* The restart counter is not updated until we successfully write the MCU. */ + + return TRUE; +} + + +/* + * Encode and output one nMCU's worth of Huffman-compressed differences. + */ + +METHODDEF(JDIMENSION) +encode_mcus_huff (j_compress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, + JDIMENSION nMCU) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + working_state state; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + /* jpeg_component_info * compptr; */ + + /* Load up working state */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! emit_restart(&state, entropy->next_restart_num)) + return 0; + } + + /* Set input pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_input_ptrs; ptrn++) { + ci = entropy->input_ptr_info[ptrn].ci; + yoffset = entropy->input_ptr_info[ptrn].yoffset; + MCU_width = entropy->input_ptr_info[ptrn].MCU_width; + entropy->input_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (size_t)yoffset] + MCU_col_num * (size_t)MCU_width; + } + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + register int temp, temp2 /* , temp3 */ ; + register int nbits; + c_derived_tbl *dctbl = entropy->cur_tbls[sampn]; + + /* Encode the difference per section H.1.2.2 */ + + /* Input the sample difference */ + temp = *entropy->input_ptr[entropy->input_ptr_index[sampn]]++; + + if (temp & 0x8000) { /* instead of temp < 0 */ + temp = (-temp) & 0x7FFF; /* absolute value, mod 2^16 */ + if (temp == 0) /* special case: magnitude = 32768 */ + temp2 = temp = 0x8000; + temp2 = ~ temp; /* one's complement of magnitude */ + } else { + temp &= 0x7FFF; /* abs value mod 2^16 */ + temp2 = temp; /* magnitude */ + } + + /* Find the number of bits needed for the magnitude of the difference */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range difference values. + */ + if (nbits > MAX_DIFF_BITS) + ERREXIT(cinfo, JERR_BAD_DIFF); + + /* Emit the Huffman-coded symbol for the number of bits */ + if (! emit_bits(&state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) + return mcu_num; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits && /* emit_bits rejects calls with size 0 */ + nbits != 16) /* special case: no bits should be emitted */ + if (! emit_bits(&state, (unsigned int) temp2, nbits)) + return mcu_num; + } + + /* Completed MCU, so update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + } + + return nMCU; +} + + +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + working_state state; + + /* Load up working state ... flush_bits needs it */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Flush out the last data */ + if (! flush_bits(&state)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); +} + + +/* + * Huffman coding optimization. + * + * We first scan the supplied data and count the number of uses of each symbol + * that is to be Huffman-coded. (This process MUST agree with the code above.) + * Then we build a Huffman coding tree for the observed counts. + * Symbols which are not needed at all for the particular image are not + * assigned any code, which saves space in the DHT marker as well as in + * the compressed data. + */ + +#ifdef ENTROPY_OPT_SUPPORTED + +/* + * Trial-encode one nMCU's worth of Huffman-compressed differences. + * No data is actually output, so no suspension return is possible. + */ + +METHODDEF(JDIMENSION) +encode_mcus_gather (j_compress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, + JDIMENSION nMCU) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + /* jpeg_component_info * compptr; */ + + /* Take care of restart intervals if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + /* Update restart state */ + entropy->restarts_to_go = cinfo->restart_interval; + } + entropy->restarts_to_go--; + } + + /* Set input pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_input_ptrs; ptrn++) { + ci = entropy->input_ptr_info[ptrn].ci; + yoffset = entropy->input_ptr_info[ptrn].yoffset; + MCU_width = entropy->input_ptr_info[ptrn].MCU_width; + entropy->input_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (size_t)yoffset] + MCU_col_num * (size_t)MCU_width; + } + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + register int temp; + register int nbits; + /* c_derived_tbl *dctbl = entropy->cur_tbls[sampn]; */ + long * counts = entropy->cur_counts[sampn]; + + /* Encode the difference per section H.1.2.2 */ + + /* Input the sample difference */ + temp = *entropy->input_ptr[entropy->input_ptr_index[sampn]]++; + + if (temp & 0x8000) { /* instead of temp < 0 */ + temp = (-temp) & 0x7FFF; /* absolute value, mod 2^16 */ + if (temp == 0) /* special case: magnitude = 32768 */ + temp = 0x8000; + } else + temp &= 0x7FFF; /* abs value mod 2^16 */ + + /* Find the number of bits needed for the magnitude of the difference */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range difference values. + */ + if (nbits > MAX_DIFF_BITS) + ERREXIT(cinfo, JERR_BAD_DIFF); + + /* Count the Huffman symbol for the number of bits */ + counts[nbits]++; + } + } + + return nMCU; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + int ci, dctbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did_dc[NUM_HUFF_TBLS]; + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did_dc, SIZEOF(did_dc)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + if (! did_dc[dctbl]) { + htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[dctbl]); + did_dc[dctbl] = TRUE; + } + } +} + + +#endif /* ENTROPY_OPT_SUPPORTED */ + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_lhuff_encoder (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy; + int i; + + entropy = (lhuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(lhuff_entropy_encoder)); + losslsc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + losslsc->pub.entropy_start_pass = start_pass_huff; + losslsc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; +#ifdef ENTROPY_OPT_SUPPORTED + entropy->count_ptrs[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg12/jclossls.c b/dcmjpeg/libijg12/jclossls.c new file mode 100644 index 00000000..a4394bcf --- /dev/null +++ b/dcmjpeg/libijg12/jclossls.c @@ -0,0 +1,82 @@ +/* + * jclossls.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossless JPEG compressor. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" + + +#ifdef C_LOSSLESS_SUPPORTED + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + (*losslsc->scaler_start_pass) (cinfo); + (*losslsc->predict_start_pass) (cinfo); + (*losslsc->diff_start_pass) (cinfo, pass_mode); +} + + +/* + * Initialize the lossless compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossless_c_codec(j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc; + + /* Create subobject in permanent pool */ + losslsc = (j_lossless_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossless_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) losslsc; + + /* Initialize sub-modules */ + + /* Scaler */ + jinit_c_scaler(cinfo); + + /* Differencer */ + jinit_differencer(cinfo); + + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + jinit_lhuff_encoder(cinfo); + } + + /* Need a full-image difference buffer in any multi-pass mode. */ + jinit_c_diff_controller(cinfo, + (boolean) (cinfo->num_scans > 1 || + cinfo->optimize_coding)); + + /* Initialize method pointers. + * + * Note: entropy_start_pass and entropy_finish_pass are assigned in + * jclhuff.c and compress_data is assigned in jcdiffct.c. + */ + losslsc->pub.start_pass = start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jclossy.c b/dcmjpeg/libijg12/jclossy.c new file mode 100644 index 00000000..08272cd9 --- /dev/null +++ b/dcmjpeg/libijg12/jclossy.c @@ -0,0 +1,76 @@ +/* + * jclossy.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossy JPEG compressor. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + + (*lossyc->fdct_start_pass) (cinfo); + (*lossyc->coef_start_pass) (cinfo, pass_mode); +} + + +/* + * Initialize the lossy compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossy_c_codec (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc; + + /* Create subobject in permanent pool */ + lossyc = (j_lossy_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) lossyc; + + /* Initialize sub-modules */ + + /* Forward DCT */ + jinit_forward_dct(cinfo); + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + jinit_phuff_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_encoder(cinfo); + } + + /* Need a full-image coefficient buffer in any multi-pass mode. */ + jinit_c_coef_controller(cinfo, + (boolean) (cinfo->num_scans > 1 || + cinfo->optimize_coding)); + + /* Initialize method pointers. + * + * Note: entropy_start_pass and entropy_finish_pass are assigned in + * jcshuff.c or jcphuff.c and compress_data is assigned in jccoefct.c. + */ + lossyc->pub.start_pass = start_pass; +} diff --git a/dcmjpeg/libijg12/jcmainct.c b/dcmjpeg/libijg12/jcmainct.c new file mode 100644 index 00000000..b9866560 --- /dev/null +++ b/dcmjpeg/libijg12/jcmainct.c @@ -0,0 +1,296 @@ +/* + * jcmainct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for compression. + * The main buffer lies between the pre-processor and the JPEG + * compressor proper; it holds downsampled data in the JPEG colorspace. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Note: currently, there is no operating mode in which a full-image buffer + * is needed at this step. If there were, that mode could not be used with + * "raw data" input, since this module is bypassed in that case. However, + * we've left the code here for possible use in special applications. + */ +#undef FULL_MAIN_BUFFER_SUPPORTED + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_main_controller pub; /* public fields */ + + JDIMENSION cur_iMCU_row; /* number of current iMCU row */ + JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */ + boolean suspended; /* remember if we suspended output */ + J_BUF_MODE pass_mode; /* current operating mode */ + + /* If using just a strip buffer, this points to the entire set of buffers + * (we allocate one for each component). In the full-image case, this + * points to the currently accessible strips of the virtual arrays. + */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* If using full-image storage, this array holds pointers to virtual-array + * control blocks for each component. Unused if not full-image storage. + */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +#endif +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#ifdef FULL_MAIN_BUFFER_SUPPORTED +METHODDEF(void) process_data_buffer_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + /* Do nothing in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + mymain->cur_iMCU_row = 0; /* initialize counters */ + mymain->rowgroup_ctr = 0; + mymain->suspended = FALSE; + mymain->pass_mode = pass_mode; /* save mode for use by process_data */ + + switch (pass_mode) { + case JBUF_PASS_THRU: +#ifdef FULL_MAIN_BUFFER_SUPPORTED + if (mymain->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + mymain->pub.process_data = process_data_simple_main; + break; +#ifdef FULL_MAIN_BUFFER_SUPPORTED + case JBUF_SAVE_SOURCE: + case JBUF_CRANK_DEST: + case JBUF_SAVE_AND_PASS: + if (mymain->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + mymain->pub.process_data = process_data_buffer_main; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This routine handles the simple pass-through mode, + * where we have only a strip buffer. + */ + +METHODDEF(void) +process_data_simple_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); + + while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Read input data if we haven't filled the main buffer yet */ + if (mymain->rowgroup_ctr < data_unit) + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mymain->buffer, &mymain->rowgroup_ctr, + (JDIMENSION) data_unit); + + /* If we don't have a full iMCU row buffered, return to application for + * more data. Note that preprocessor will always pad to fill the iMCU row + * at the bottom of the image. + */ + if (mymain->rowgroup_ctr != data_unit) + return; + + /* Send the completed row to the compressor */ + if (! (*cinfo->codec->compress_data) (cinfo, mymain->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mymain->suspended) { + (*in_row_ctr)--; + mymain->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mymain->suspended) { + (*in_row_ctr)++; + mymain->suspended = FALSE; + } + mymain->rowgroup_ctr = 0; + mymain->cur_iMCU_row++; + } +} + + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + +/* + * Process some data. + * This routine handles all of the modes that use a full-size buffer. + */ + +METHODDEF(void) +process_data_buffer_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci; + jpeg_component_info *compptr; + boolean writing = (mymain->pass_mode != JBUF_CRANK_DEST); + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); + + while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Realign the virtual buffers if at the start of an iMCU row. */ + if (mymain->rowgroup_ctr == 0) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, mymain->whole_image[ci], + mymain->cur_iMCU_row * (compptr->v_samp_factor * data_unit), + (JDIMENSION) (compptr->v_samp_factor * data_unit), writing); + } + /* In a read pass, pretend we just read some source data. */ + if (! writing) { + *in_row_ctr += cinfo->max_v_samp_factor * data_unit; + mymain->rowgroup_ctr = data_unit; + } + } + + /* If a write pass, read input data until the current iMCU row is full. */ + /* Note: preprocessor will pad if necessary to fill the last iMCU row. */ + if (writing) { + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mymain->buffer, &mymain->rowgroup_ctr, + (JDIMENSION) data_unit); + /* Return to application if we need more data to fill the iMCU row. */ + if (mymain->rowgroup_ctr < data_unit) + return; + } + + /* Emit data, unless this is a sink-only pass. */ + if (mymain->pass_mode != JBUF_SAVE_SOURCE) { + if (! (*cinfo->codec->compress_data) (cinfo, mymain->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mymain->suspended) { + (*in_row_ctr)--; + mymain->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mymain->suspended) { + (*in_row_ctr)++; + mymain->suspended = FALSE; + } + } + + /* If get here, we are done with this iMCU row. Mark buffer empty. */ + mymain->rowgroup_ctr = 0; + mymain->cur_iMCU_row++; + } +} + +#endif /* FULL_MAIN_BUFFER_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mymain; + int ci; + jpeg_component_info *compptr; + int data_unit = cinfo->data_unit; + + mymain = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = (struct jpeg_c_main_controller *) mymain; + mymain->pub.start_pass = start_pass_main; + + /* We don't need to create a buffer in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + /* Create the buffer. It holds downsampled data, so each component + * may be of a different size. + */ + if (need_full_buffer) { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component */ + /* Note we pad the bottom to a multiple of the iMCU height */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + compptr->width_in_data_units * data_unit, + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor) * data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + mymain->whole_image[0] = NULL; /* flag for no virtual arrays */ +#endif + /* Allocate a strip buffer for each component */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_data_units * (JDIMENSION)data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); + } + } +} diff --git a/dcmjpeg/libijg12/jcmarker.c b/dcmjpeg/libijg12/jcmarker.c new file mode 100644 index 00000000..deb05963 --- /dev/null +++ b/dcmjpeg/libijg12/jcmarker.c @@ -0,0 +1,680 @@ +/* + * jcmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write JPEG datastream markers. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_writer pub; /* public fields */ + + unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */ +} my_marker_writer; + +typedef my_marker_writer * my_marker_ptr; + + +/* + * Basic output routines. + * + * Note that we do not support suspension while writing a marker. + * Therefore, an application using suspension must ensure that there is + * enough buffer space for the initial markers (typ. 600-700 bytes) before + * calling jpeg_start_compress, and enough space to write the trailing EOI + * (a few bytes) before calling jpeg_finish_compress. Multipass compression + * modes are not supported at all with suspension, so those two are the only + * points where markers will be written. + */ + +LOCAL(void) +emit_byte (j_compress_ptr cinfo, int val) +/* Emit a byte */ +{ + struct jpeg_destination_mgr * dest = cinfo->dest; + + *(dest->next_output_byte)++ = (JOCTET) val; + if (--dest->free_in_buffer == 0) { + if (! (*dest->empty_output_buffer) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } +} + + +LOCAL(void) +emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark) +/* Emit a marker code */ +{ + emit_byte(cinfo, 0xFF); + emit_byte(cinfo, (int) mark); +} + + +LOCAL(void) +emit_2bytes (j_compress_ptr cinfo, int value) +/* Emit a 2-byte integer; these are always MSB first in JPEG files */ +{ + emit_byte(cinfo, (value >> 8) & 0xFF); + emit_byte(cinfo, value & 0xFF); +} + + +/* + * Routines to write specific marker types. + */ + +LOCAL(int) +emit_dqt (j_compress_ptr cinfo, int idx) +/* Emit a DQT marker */ +/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ +{ + JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[idx]; + int prec; + int i; + + if (qtbl == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, idx); + + prec = 0; + for (i = 0; i < DCTSIZE2; i++) { + if (qtbl->quantval[i] > 255) + prec = 1; + } + + if (! qtbl->sent_table) { + emit_marker(cinfo, M_DQT); + + emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2); + + emit_byte(cinfo, idx + (prec<<4)); + + for (i = 0; i < DCTSIZE2; i++) { + /* The table entries must be emitted in zigzag order. */ + unsigned int qval = qtbl->quantval[jpeg_natural_order[i]]; + if (prec) + emit_byte(cinfo, (int) (qval >> 8)); + emit_byte(cinfo, (int) (qval & 0xFF)); + } + + qtbl->sent_table = TRUE; + } + + return prec; +} + + +LOCAL(void) +emit_dht (j_compress_ptr cinfo, int idx, boolean is_ac) +/* Emit a DHT marker */ +{ + JHUFF_TBL * htbl; + int length, i; + + if (is_ac) { + htbl = cinfo->ac_huff_tbl_ptrs[idx]; + idx += 0x10; /* output index has AC bit set */ + } else { + htbl = cinfo->dc_huff_tbl_ptrs[idx]; + } + + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, idx); + + if (! htbl->sent_table) { + emit_marker(cinfo, M_DHT); + + length = 0; + for (i = 1; i <= 16; i++) + length += htbl->bits[i]; + + emit_2bytes(cinfo, length + 2 + 1 + 16); + emit_byte(cinfo, idx); + + for (i = 1; i <= 16; i++) + emit_byte(cinfo, htbl->bits[i]); + + for (i = 0; i < length; i++) + emit_byte(cinfo, htbl->huffval[i]); + + htbl->sent_table = TRUE; + } +} + + +LOCAL(void) +emit_dac (j_compress_ptr cinfo) +/* Emit a DAC marker */ +/* Since the useful info is so small, we want to emit all the tables in */ +/* one DAC marker. Therefore this routine does its own scan of the table. */ +{ +#ifdef C_ARITH_CODING_SUPPORTED + char dc_in_use[NUM_ARITH_TBLS]; + char ac_in_use[NUM_ARITH_TBLS]; + int length, i; + jpeg_component_info *compptr; + + for (i = 0; i < NUM_ARITH_TBLS; i++) + dc_in_use[i] = ac_in_use[i] = 0; + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + dc_in_use[compptr->dc_tbl_no] = 1; + ac_in_use[compptr->ac_tbl_no] = 1; + } + + length = 0; + for (i = 0; i < NUM_ARITH_TBLS; i++) + length += dc_in_use[i] + ac_in_use[i]; + + emit_marker(cinfo, M_DAC); + + emit_2bytes(cinfo, length*2 + 2); + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + if (dc_in_use[i]) { + emit_byte(cinfo, i); + emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); + } + if (ac_in_use[i]) { + emit_byte(cinfo, i + 0x10); + emit_byte(cinfo, cinfo->arith_ac_K[i]); + } + } +#endif /* C_ARITH_CODING_SUPPORTED */ +} + + +LOCAL(void) +emit_dri (j_compress_ptr cinfo) +/* Emit a DRI marker */ +{ + emit_marker(cinfo, M_DRI); + + emit_2bytes(cinfo, 4); /* fixed length */ + + emit_2bytes(cinfo, (int) cinfo->restart_interval); +} + + +LOCAL(void) +emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) +/* Emit a SOF marker */ +{ + int ci; + jpeg_component_info *compptr; + + emit_marker(cinfo, code); + + emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ + + /* Make sure image isn't bigger than SOF field can handle */ + if ((long) cinfo->image_height > 65535L || + (long) cinfo->image_width > 65535L) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535); + + emit_byte(cinfo, cinfo->data_precision); + emit_2bytes(cinfo, (int) cinfo->image_height); + emit_2bytes(cinfo, (int) cinfo->image_width); + + emit_byte(cinfo, cinfo->num_components); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + emit_byte(cinfo, compptr->component_id); + emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor); + emit_byte(cinfo, compptr->quant_tbl_no); + } +} + + +LOCAL(void) +emit_sos (j_compress_ptr cinfo) +/* Emit a SOS marker */ +{ + int i, td, ta; + jpeg_component_info *compptr; + + emit_marker(cinfo, M_SOS); + + emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ + + emit_byte(cinfo, cinfo->comps_in_scan); + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + emit_byte(cinfo, compptr->component_id); + td = compptr->dc_tbl_no; + ta = compptr->ac_tbl_no; + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Progressive mode: only DC or only AC tables are used in one scan; + * furthermore, Huffman coding of DC refinement uses no table at all. + * We emit 0 for unused field(s); this is recommended by the P&M text + * but does not seem to be specified in the standard. + */ + if (cinfo->Ss == 0) { + ta = 0; /* DC scan */ + if (cinfo->Ah != 0 && !cinfo->arith_code) + td = 0; /* no DC table either */ + } else { + td = 0; /* AC scan */ + } + } + emit_byte(cinfo, (td << 4) + ta); + } + + emit_byte(cinfo, cinfo->Ss); + emit_byte(cinfo, cinfo->Se); + emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al); +} + + +LOCAL(void) +emit_jfif_app0 (j_compress_ptr cinfo) +/* Emit a JFIF-compliant APP0 marker */ +{ + /* + * Length of APP0 block (2 bytes) + * Block ID (4 bytes - ASCII "JFIF") + * Zero byte (1 byte to terminate the ID string) + * Version Major, Minor (2 bytes - major first) + * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) + * Xdpu (2 bytes - dots per unit horizontal) + * Ydpu (2 bytes - dots per unit vertical) + * Thumbnail X size (1 byte) + * Thumbnail Y size (1 byte) + */ + + emit_marker(cinfo, M_APP0); + + emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ + + emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0x49); + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0); + emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */ + emit_byte(cinfo, cinfo->JFIF_minor_version); + emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */ + emit_2bytes(cinfo, (int) cinfo->X_density); + emit_2bytes(cinfo, (int) cinfo->Y_density); + emit_byte(cinfo, 0); /* No thumbnail image */ + emit_byte(cinfo, 0); +} + + +LOCAL(void) +emit_adobe_app14 (j_compress_ptr cinfo) +/* Emit an Adobe APP14 marker */ +{ + /* + * Length of APP14 block (2 bytes) + * Block ID (5 bytes - ASCII "Adobe") + * Version Number (2 bytes - currently 100) + * Flags0 (2 bytes - currently 0) + * Flags1 (2 bytes - currently 0) + * Color transform (1 byte) + * + * Although Adobe TN 5116 mentions Version = 101, all the Adobe files + * now in circulation seem to use Version = 100, so that's what we write. + * + * We write the color transform byte as 1 if the JPEG color space is + * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with + * whether the encoder performed a transformation, which is pretty useless. + */ + + emit_marker(cinfo, M_APP14); + + emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */ + + emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */ + emit_byte(cinfo, 0x64); + emit_byte(cinfo, 0x6F); + emit_byte(cinfo, 0x62); + emit_byte(cinfo, 0x65); + emit_2bytes(cinfo, 100); /* Version */ + emit_2bytes(cinfo, 0); /* Flags0 */ + emit_2bytes(cinfo, 0); /* Flags1 */ + switch (cinfo->jpeg_color_space) { + case JCS_YCbCr: + emit_byte(cinfo, 1); /* Color transform = 1 */ + break; + case JCS_YCCK: + emit_byte(cinfo, 2); /* Color transform = 2 */ + break; + default: + emit_byte(cinfo, 0); /* Color transform = 0 */ + break; + } +} + + +/* + * These routines allow writing an arbitrary marker with parameters. + * The only intended use is to emit COM or APPn markers after calling + * write_file_header and before calling write_frame_header. + * Other uses are not guaranteed to produce desirable results. + * Counting the parameter bytes properly is the caller's responsibility. + */ + +METHODDEF(void) +write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +/* Emit an arbitrary marker header */ +{ + if (datalen > (unsigned int) 65533) /* safety check */ + ERREXIT(cinfo, JERR_BAD_LENGTH); + + emit_marker(cinfo, (JPEG_MARKER) marker); + + emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */ +} + +METHODDEF(void) +write_marker_byte (j_compress_ptr cinfo, int val) +/* Emit one byte of marker parameters following write_marker_header */ +{ + emit_byte(cinfo, val); +} + + +/* + * Write datastream header. + * This consists of an SOI and optional APPn markers. + * We recommend use of the JFIF marker, but not the Adobe marker, + * when using YCbCr or grayscale data. The JFIF marker should NOT + * be used for any other JPEG colorspace. The Adobe marker is helpful + * to distinguish RGB, CMYK, and YCCK colorspaces. + * Note that an application can write additional header markers after + * jpeg_start_compress returns. + */ + +METHODDEF(void) +write_file_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + emit_marker(cinfo, M_SOI); /* first the SOI */ + + /* SOI is defined to reset restart interval to 0 */ + marker->last_restart_interval = 0; + + if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */ + emit_jfif_app0(cinfo); + if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */ + emit_adobe_app14(cinfo); +} + + +/* + * Write frame header. + * This consists of DQT and SOFn markers. + * Note that we do not emit the SOF until we have emitted the DQT(s). + * This avoids compatibility problems with incorrect implementations that + * try to error-check the quant table numbers as soon as they see the SOF. + */ + +METHODDEF(void) +write_frame_header (j_compress_ptr cinfo) +{ + int ci, prec; + boolean is_baseline; + jpeg_component_info *compptr; + + prec = 0; + if (cinfo->process != JPROC_LOSSLESS) { + /* Emit DQT for each quantization table. + * Note that emit_dqt() suppresses any duplicate tables. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prec += emit_dqt(cinfo, compptr->quant_tbl_no); + } + /* now prec is nonzero iff there are any 16-bit quant tables. */ + } + + /* Check for a non-baseline specification. + * Note we assume that Huffman table numbers won't be changed later. + */ + if (cinfo->arith_code || cinfo->process != JPROC_SEQUENTIAL || + cinfo->data_precision != 8) { + is_baseline = FALSE; + } else { + is_baseline = TRUE; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1) + is_baseline = FALSE; + } + if (prec && is_baseline) { + is_baseline = FALSE; + /* If it's baseline except for quantizer size, warn the user */ + TRACEMS(cinfo, 0, JTRC_16BIT_TABLES); + } + } + + /* Emit the proper SOF marker */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + if (cinfo->process == JPROC_PROGRESSIVE) + emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */ + else if (cinfo->process == JPROC_LOSSLESS) + emit_sof(cinfo, M_SOF11); /* SOF code for lossless arithmetic */ + else + emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */ +#else + emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */ +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) + emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */ + else if (cinfo->process == JPROC_LOSSLESS) + emit_sof(cinfo, M_SOF3); /* SOF code for lossless Huffman */ + else if (is_baseline) + emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */ + else + emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ + } +} + + +/* + * Write scan header. + * This consists of DHT or DAC markers, optional DRI, and SOS. + * Compressed data will be written following the SOS. + */ + +METHODDEF(void) +write_scan_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + int i; + jpeg_component_info *compptr; + + if (cinfo->arith_code) { + /* Emit arith conditioning info. We may have some duplication + * if the file has multiple scans, but it's so small it's hardly + * worth worrying about. + */ + emit_dac(cinfo); + } else { + /* Emit Huffman tables. + * Note that emit_dht() suppresses any duplicate tables. + */ + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Progressive mode: only DC or only AC tables are used in one scan */ + if (cinfo->Ss == 0) { + if (cinfo->Ah == 0) /* DC needs no table for refinement scan */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + } else { + emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + } + } else if (cinfo->process == JPROC_LOSSLESS) { + /* Lossless mode: only DC tables are used */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + } else { + /* Sequential mode: need both DC and AC tables */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + } + } + } + + /* Emit DRI if required --- note that DRI value could change for each scan. + * We avoid wasting space with unnecessary DRIs, however. + */ + if (cinfo->restart_interval != marker->last_restart_interval) { + emit_dri(cinfo); + marker->last_restart_interval = cinfo->restart_interval; + } + + emit_sos(cinfo); +} + + +/* + * Write datastream trailer. + */ + +METHODDEF(void) +write_file_trailer (j_compress_ptr cinfo) +{ + emit_marker(cinfo, M_EOI); +} + + +/* + * Write an abbreviated table-specification datastream. + * This consists of SOI, DQT and DHT tables, and EOI. + * Any table that is defined and not marked sent_table = TRUE will be + * emitted. Note that all tables will be marked sent_table = TRUE at exit. + */ + +METHODDEF(void) +write_tables_only (j_compress_ptr cinfo) +{ + int i; + + emit_marker(cinfo, M_SOI); + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if (cinfo->quant_tbl_ptrs[i] != NULL) + (void) emit_dqt(cinfo, i); + } + + if (! cinfo->arith_code) { + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if (cinfo->dc_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, FALSE); + if (cinfo->ac_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, TRUE); + } + } + + emit_marker(cinfo, M_EOI); +} + + +/* + * Initialize the marker writer module. + */ + +GLOBAL(void) +jinit_marker_writer (j_compress_ptr cinfo) +{ + my_marker_ptr marker; + + /* Create the subobject */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_marker_writer)); + cinfo->marker = (struct jpeg_marker_writer *) marker; + /* Initialize method pointers */ + marker->pub.write_file_header = write_file_header; + marker->pub.write_frame_header = write_frame_header; + marker->pub.write_scan_header = write_scan_header; + marker->pub.write_file_trailer = write_file_trailer; + marker->pub.write_tables_only = write_tables_only; + marker->pub.write_marker_header = write_marker_header; + marker->pub.write_marker_byte = write_marker_byte; + /* Initialize private state */ + marker->last_restart_interval = 0; +} diff --git a/dcmjpeg/libijg12/jcmaster.c b/dcmjpeg/libijg12/jcmaster.c new file mode 100644 index 00000000..de524a9b --- /dev/null +++ b/dcmjpeg/libijg12/jcmaster.c @@ -0,0 +1,657 @@ +/* + * jcmaster.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG compressor. + * These routines are concerned with parameter validation, initial setup, + * and inter-pass control (determining the number of passes and the work + * to be done in each pass). + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ + + +/* Private state */ + +typedef enum { + main_pass, /* input data, also do first output step */ + huff_opt_pass, /* Huffman code optimization pass */ + output_pass /* data output pass */ +} c_pass_type; + +typedef struct { + struct jpeg_comp_master pub; /* public fields */ + + c_pass_type pass_type; /* the type of the current pass */ + + int pass_number; /* # of passes completed */ + int total_passes; /* total # of passes needed */ + + int scan_number; /* current index in scan_info[] */ +} my_comp_master; + +typedef my_comp_master * my_master_ptr; + + +/* + * Support routines that do various essential calculations. + */ + +LOCAL(void) +initial_setup (j_compress_ptr cinfo) +/* Do computations that are needed before master selection phase */ +{ + int ci; + jpeg_component_info *compptr; + long samplesperrow; + JDIMENSION jd_samplesperrow; + int data_unit = cinfo->data_unit; + + /* Sanity check on image dimensions */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 + || cinfo->num_components <= 0 || cinfo->input_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + /* Width of an input scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Fill in the correct component_index value; don't rely on application */ + compptr->component_index = ci; + /* For compression, we never do any codec-based processing. */ + compptr->codec_data_unit = data_unit; + /* Size in data units */ + compptr->width_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * data_unit)); + compptr->height_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * data_unit)); + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) cinfo->max_h_samp_factor); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) cinfo->max_v_samp_factor); + /* Mark component needed (this flag isn't actually used for compression) */ + compptr->component_needed = TRUE; + } + + /* Compute number of fully interleaved MCU rows (number of times that + * main controller will call coefficient controller). + */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*data_unit)); +} + +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define NEED_SCAN_SCRIPT +#else +#ifdef C_LOSSLESS_SUPPORTED +#define NEED_SCAN_SCRIPT +#endif +#endif + +#ifdef NEED_SCAN_SCRIPT + +LOCAL(void) +validate_script (j_compress_ptr cinfo) +/* Verify that the scan script in cinfo->scan_info[] is valid; also + * determine whether it uses progressive JPEG, and set cinfo->process. + */ +{ + const jpeg_scan_info * scanptr; + int scanno, ncomps, ci, coefi, thisi; + int Ss, Se, Ah, Al; + boolean component_sent[MAX_COMPONENTS]; +#ifdef C_PROGRESSIVE_SUPPORTED + int * last_bitpos_ptr; + int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; + /* -1 until that coefficient has been seen; then last Al for it */ +#endif + + if (cinfo->num_scans <= 0) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0); + +#ifndef C_MULTISCAN_FILES_SUPPORTED + if (cinfo->num_scans > 1) + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + + scanptr = cinfo->scan_info; + if (cinfo->lossless) { +#ifdef C_LOSSLESS_SUPPORTED + cinfo->process = JPROC_LOSSLESS; + for (ci = 0; ci < cinfo->num_components; ci++) + component_sent[ci] = FALSE; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1; + * for progressive JPEG, no scan can have this. + */ + else if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) { +#ifdef C_PROGRESSIVE_SUPPORTED + cinfo->process = JPROC_PROGRESSIVE; + last_bitpos_ptr = & last_bitpos[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (coefi = 0; coefi < DCTSIZE2; coefi++) + *last_bitpos_ptr++ = -1; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + for (ci = 0; ci < cinfo->num_components; ci++) + component_sent[ci] = FALSE; + } + + for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) { + /* Validate component indexes */ + ncomps = scanptr->comps_in_scan; + if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN); + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (thisi < 0 || thisi >= cinfo->num_components) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + /* Components must appear in SOF order within each scan */ + if (ci > 0 && thisi <= scanptr->component_index[ci-1]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + } + /* Validate progression parameters */ + Ss = scanptr->Ss; + Se = scanptr->Se; + Ah = scanptr->Ah; + Al = scanptr->Al; + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef C_LOSSLESS_SUPPORTED + /* The JPEG spec simply gives the range 0..15 for Al (Pt), but that + * seems wrong: the upper bound ought to depend on data precision. + * Perhaps they really meant 0..N-1 for N-bit precision, which is what + * we allow here. + */ + if (Ss < 1 || Ss > 7 || /* predictor selector */ + Se != 0 || Ah != 0 || + Al < 0 || Al >= cinfo->data_precision) /* point transform */ + ERREXIT1(cinfo, JERR_BAD_LOSSLESS_SCRIPT, scanno); + /* Make sure components are not sent twice */ + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (component_sent[thisi]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + component_sent[thisi] = TRUE; + } +#endif + } else if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that + * seems wrong: the upper bound ought to depend on data precision. + * Perhaps they really meant 0..N+1 for N-bit precision. + * Here we allow 0..10 for 8-bit data; Al larger than 10 results in + * out-of-range reconstructed DC values during the first DC scan, + * which might cause problems for some decoders. + */ +#if BITS_IN_JSAMPLE == 8 +#define MAX_AH_AL 10 +#else +#define MAX_AH_AL 13 +#endif + if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 || + Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + if (Ss == 0) { + if (Se != 0) /* DC and AC together not OK */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + if (ncomps != 1) /* AC scans must be for only one component */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + for (ci = 0; ci < ncomps; ci++) { + last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0]; + if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + for (coefi = Ss; coefi <= Se; coefi++) { + if (last_bitpos_ptr[coefi] < 0) { + /* first scan of this coefficient */ + if (Ah != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + /* not first scan */ + if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + last_bitpos_ptr[coefi] = Al; + } + } +#endif + } else { + /* For sequential JPEG, all progression parameters must be these: */ + if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + /* Make sure components are not sent twice */ + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (component_sent[thisi]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + component_sent[thisi] = TRUE; + } + } + } + + /* Now verify that everything got sent. */ + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* For progressive mode, we only check that at least some DC data + * got sent for each component; the spec does not require that all bits + * of all coefficients be transmitted. Would it be wiser to enforce + * transmission of all coefficient bits?? + */ + for (ci = 0; ci < cinfo->num_components; ci++) { + if (last_bitpos[ci][0] < 0) + ERREXIT(cinfo, JERR_MISSING_DATA); + } +#endif + } else { + for (ci = 0; ci < cinfo->num_components; ci++) { + if (! component_sent[ci]) + ERREXIT(cinfo, JERR_MISSING_DATA); + } + } +} + +#endif /* NEED_SCAN_SCRIPT */ + + +LOCAL(void) +select_scan_parameters (j_compress_ptr cinfo) +/* Set up the scan parameters for the current scan */ +{ + int ci; + +#ifdef NEED_SCAN_SCRIPT + if (cinfo->scan_info != NULL) { + /* Prepare for current scan --- the script is already validated */ + my_master_ptr master = (my_master_ptr) cinfo->master; + const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number; + + cinfo->comps_in_scan = scanptr->comps_in_scan; + for (ci = 0; ci < scanptr->comps_in_scan; ci++) { + cinfo->cur_comp_info[ci] = + &cinfo->comp_info[scanptr->component_index[ci]]; + } + cinfo->Ss = scanptr->Ss; + cinfo->Se = scanptr->Se; + cinfo->Ah = scanptr->Ah; + cinfo->Al = scanptr->Al; + } else +#endif + { + /* Prepare for single sequential-JPEG scan containing all components */ + if (cinfo->num_components > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPS_IN_SCAN); + cinfo->comps_in_scan = cinfo->num_components; + for (ci = 0; ci < cinfo->num_components; ci++) { + cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci]; + } + if (cinfo->lossless) { +#ifdef C_LOSSLESS_SUPPORTED + /* If we fall through to here, the user specified lossless, but did not + * provide a scan script. + */ + ERREXIT(cinfo, JERR_NO_LOSSLESS_SCRIPT); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + cinfo->Ss = 0; + cinfo->Se = DCTSIZE2-1; + cinfo->Ah = 0; + cinfo->Al = 0; + } + } +} + + +LOCAL(void) +per_scan_setup (j_compress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + int data_unit = cinfo->data_unit; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_data_units; + cinfo->MCU_rows_in_scan = compptr->height_in_data_units; + + /* For noninterleaved scan, always one block per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_data_units = 1; + compptr->MCU_sample_width = data_unit; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of block rows present in the last iMCU row. + */ + tmp = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->data_units_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, + (long) (cinfo->max_h_samp_factor*data_unit)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*data_unit)); + + cinfo->data_units_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of blocks of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_data_units = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * data_unit; + /* Figure number of non-dummy blocks in last MCU column & row */ + tmp = (int)compptr->width_in_data_units % compptr->MCU_width; + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int)compptr->height_in_data_units % compptr->MCU_height; + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_data_units; + if (cinfo->data_units_in_MCU + mcublks > C_MAX_DATA_UNITS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->data_units_in_MCU++] = ci; + } + } + + } + + /* Convert restart specified in rows to actual MCU count. */ + /* Note that count must fit in 16 bits, so we provide limiting. */ + if (cinfo->restart_in_rows > 0) { + long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row; + cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L); + } +} + + +/* + * Per-pass setup. + * This is called at the beginning of each pass. We determine which modules + * will be active during this pass and give them appropriate start_pass calls. + * We also set is_last_pass to indicate whether any more passes will be + * required. + */ + +METHODDEF(void) +prepare_for_pass (j_compress_ptr cinfo) +{ + /* j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; */ + my_master_ptr master = (my_master_ptr) cinfo->master; + + switch (master->pass_type) { + case main_pass: + /* Initial pass: will collect input data, and do either Huffman + * optimization or data output for the first scan. + */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + if (! cinfo->raw_data_in) { + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->downsample->start_pass) (cinfo); + (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU); + } + (*cinfo->codec->entropy_start_pass) (cinfo, cinfo->optimize_coding); + (*cinfo->codec->start_pass) (cinfo, + (master->total_passes > 1 ? + JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + if (cinfo->optimize_coding) { + /* No immediate data output; postpone writing frame/scan headers */ + master->pub.call_pass_startup = FALSE; + } else { + /* Will write frame/scan headers at first jpeg_write_scanlines call */ + master->pub.call_pass_startup = TRUE; + } + break; +#ifdef ENTROPY_OPT_SUPPORTED + case huff_opt_pass: + /* Do Huffman optimization for a scan after the first one. */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); +#ifdef WITH_ARITHMETIC_PATCH + if ((*cinfo->codec->need_optimization_pass) (cinfo)) { +#else + if ((*cinfo->codec->need_optimization_pass) (cinfo) || cinfo->arith_code) { +#endif + (*cinfo->codec->entropy_start_pass) (cinfo, TRUE); + (*cinfo->codec->start_pass) (cinfo, JBUF_CRANK_DEST); + master->pub.call_pass_startup = FALSE; + break; + } + /* Special case: Huffman DC refinement scans need no Huffman table + * and therefore we can skip the optimization pass for them. + */ + master->pass_type = output_pass; + master->pass_number++; + /*FALLTHROUGH*/ +#endif + case output_pass: + /* Do a data-output pass. */ + /* We need not repeat per-scan setup if prior optimization pass did it. */ + if (! cinfo->optimize_coding) { + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + } + (*cinfo->codec->entropy_start_pass) (cinfo, FALSE); + (*cinfo->codec->start_pass) (cinfo, JBUF_CRANK_DEST); + /* We emit frame/scan headers now */ + if (master->scan_number == 0) + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); + master->pub.call_pass_startup = FALSE; + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + } + + master->pub.is_last_pass = (master->pass_number == master->total_passes-1); + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->total_passes; + } +} + + +/* + * Special start-of-pass hook. + * This is called by jpeg_write_scanlines if call_pass_startup is TRUE. + * In single-pass processing, we need this hook because we don't want to + * write frame/scan headers during jpeg_start_compress; we want to let the + * application write COM markers etc. between jpeg_start_compress and the + * jpeg_write_scanlines loop. + * In multi-pass processing, this routine is not used. + */ + +METHODDEF(void) +pass_startup (j_compress_ptr cinfo) +{ + cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */ + + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); +} + + +/* + * Finish up at end of pass. + */ + +METHODDEF(void) +finish_pass_master (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* The entropy coder always needs an end-of-pass call, + * either to analyze statistics or to flush its output buffer. + */ + (*lossyc->pub.entropy_finish_pass) (cinfo); + + /* Update state for next pass */ + switch (master->pass_type) { + case main_pass: + /* next pass is either output of scan 0 (after optimization) + * or output of scan 1 (if no optimization). + */ + master->pass_type = output_pass; + if (! cinfo->optimize_coding) + master->scan_number++; + break; + case huff_opt_pass: + /* next pass is always output of current scan */ + master->pass_type = output_pass; + break; + case output_pass: + /* next pass is either optimization or output of next scan */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + master->scan_number++; + break; + } + + master->pass_number++; +} + + +/* + * Initialize master compression control. + */ + +GLOBAL(void) +jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_comp_master)); + cinfo->master = (struct jpeg_comp_master *) master; + master->pub.prepare_for_pass = prepare_for_pass; + master->pub.pass_startup = pass_startup; + master->pub.finish_pass = finish_pass_master; + master->pub.is_last_pass = FALSE; + + cinfo->data_unit = cinfo->lossless ? 1 : DCTSIZE; + + /* Validate parameters, determine derived values */ + initial_setup(cinfo); + + if (cinfo->scan_info != NULL) { +#ifdef NEED_SCAN_SCRIPT + validate_script(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + cinfo->num_scans = 1; + } + +#ifdef WITH_ARITHMETIC_PATCH + if ((cinfo->arith_code == 0) && + (cinfo->process == JPROC_PROGRESSIVE || /* TEMPORARY HACK ??? */ + cinfo->process == JPROC_LOSSLESS)) +#else + if (cinfo->process == JPROC_PROGRESSIVE || /* TEMPORARY HACK ??? */ + cinfo->process == JPROC_LOSSLESS) +#endif + cinfo->optimize_coding = TRUE; /* assume default tables no good for + * progressive mode or lossless mode */ + + /* Initialize my private state */ + if (transcode_only) { + /* no main pass in transcoding */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + else + master->pass_type = output_pass; + } else { + /* for normal compression, first pass is always this type: */ + master->pass_type = main_pass; + } + master->scan_number = 0; + master->pass_number = 0; + if (cinfo->optimize_coding) + master->total_passes = cinfo->num_scans * 2; + else + master->total_passes = cinfo->num_scans; +} diff --git a/dcmjpeg/libijg12/jcodec.c b/dcmjpeg/libijg12/jcodec.c new file mode 100644 index 00000000..e3b70297 --- /dev/null +++ b/dcmjpeg/libijg12/jcodec.c @@ -0,0 +1,53 @@ +/* + * jcodec.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains utility functions for the JPEG codec(s). + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" +#include "jlossls12.h" + + +/* + * Initialize the compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_c_codec (j_compress_ptr cinfo) +{ + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef C_LOSSLESS_SUPPORTED + jinit_lossless_c_codec(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_lossy_c_codec(cinfo); +} + + +/* + * Initialize the decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_d_codec (j_decompress_ptr cinfo) +{ + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef D_LOSSLESS_SUPPORTED + jinit_lossless_d_codec(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_lossy_d_codec(cinfo); +} diff --git a/dcmjpeg/libijg12/jcomapi.c b/dcmjpeg/libijg12/jcomapi.c new file mode 100644 index 00000000..090bc85b --- /dev/null +++ b/dcmjpeg/libijg12/jcomapi.c @@ -0,0 +1,106 @@ +/* + * jcomapi.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface routines that are used for both + * compression and decompression. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Abort processing of a JPEG compression or decompression operation, + * but don't destroy the object itself. + * + * For this, we merely clean up all the nonpermanent memory pools. + * Note that temp files (virtual arrays) are not allowed to belong to + * the permanent pool, so we will be able to close all temp files here. + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_abort (j_common_ptr cinfo) +{ + int pool; + + /* Do nothing if called on a not-initialized or destroyed JPEG object. */ + if (cinfo->mem == NULL) + return; + + /* Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) { + (*cinfo->mem->free_pool) (cinfo, pool); + } + + /* Reset overall state for possible reuse of object */ + if (cinfo->is_decompressor) { + cinfo->global_state = DSTATE_START; + /* Try to keep application from accessing now-deleted marker list. + * A bit kludgy to do it here, but this is the most central place. + */ + ((j_decompress_ptr) cinfo)->marker_list = NULL; + } else { + cinfo->global_state = CSTATE_START; + } +} + + +/* + * Destruction of a JPEG object. + * + * Everything gets deallocated except the master jpeg_compress_struct itself + * and the error manager struct. Both of these are supplied by the application + * and must be freed, if necessary, by the application. (Often they are on + * the stack and so don't need to be freed anyway.) + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_destroy (j_common_ptr cinfo) +{ + /* We need only tell the memory manager to release everything. */ + /* NB: mem pointer is NULL if memory mgr failed to initialize. */ + if (cinfo->mem != NULL) + (*cinfo->mem->self_destruct) (cinfo); + cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ + cinfo->global_state = 0; /* mark it destroyed */ +} + + +/* + * Convenience routines for allocating quantization and Huffman tables. + * (Would jutils.c be a more reasonable place to put these?) + */ + +GLOBAL(JQUANT_TBL *) +jpeg_alloc_quant_table (j_common_ptr cinfo) +{ + JQUANT_TBL *tbl; + + tbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} + + +GLOBAL(JHUFF_TBL *) +jpeg_alloc_huff_table (j_common_ptr cinfo) +{ + JHUFF_TBL *tbl; + + tbl = (JHUFF_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} diff --git a/dcmjpeg/libijg12/jconfig12.h b/dcmjpeg/libijg12/jconfig12.h new file mode 100644 index 00000000..4dd87d61 --- /dev/null +++ b/dcmjpeg/libijg12/jconfig12.h @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: + * this file derives the preprocessor symbols required to compile + * the IJG library from the central DCMTK configuration file osconfig.h + * + */ + +#include "dcmtk/config/osconfig.h" + +/* We assume ANSI C and don't support DOS, + * so the following settings need not be tested + */ +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +#undef NEED_FAR_POINTERS +#undef INCOMPLETE_TYPES_BROKEN + +/* the following settings are derived from osconfig.h */ + +#ifndef HAVE_C_CONST +#define const +#endif + +#ifdef C_CHAR_UNSIGNED +#define CHAR_IS_UNSIGNED +#endif + +#ifdef HAVE_STRINGS_H +#ifndef HAVE_STRING_H +#define NEED_BSD_STRINGS +#endif +#endif + +#ifdef HAVE_SYS_TYPES_H +#define NEED_SYS_TYPES_H +#endif + +/* must always be defined for our implementation */ +#define NEED_SHORT_EXTERNAL_NAMES + +#ifdef JPEG_INTERNALS + +#ifdef C_RIGHTSHIFT_UNSIGNED +#define RIGHT_SHIFT_IS_UNSIGNED +#endif + +#define INLINE C_INLINE + +/* These are for configuring the JPEG memory manager. */ +#undef DEFAULT_MAX_MEM +#undef NO_MKTEMP + +/* We don't want to use getenv which is thread unsafe on some platforms */ +#define NO_GETENV + +#endif /* JPEG_INTERNALS */ diff --git a/dcmjpeg/libijg12/jcparam.c b/dcmjpeg/libijg12/jcparam.c new file mode 100644 index 00000000..974ddef3 --- /dev/null +++ b/dcmjpeg/libijg12/jcparam.c @@ -0,0 +1,687 @@ +/* + * jcparam.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains optional default-setting code for the JPEG compressor. + * Applications do not have to use this file, but those that don't use it + * must know a lot more about the innards of the JPEG code. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Quantization table setup routines + */ + +GLOBAL(void) +jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, boolean force_baseline) +/* Define a quantization table equal to the basic_table times + * a scale factor (given as a percentage). + * If force_baseline is TRUE, the computed quantization table entries + * are limited to 1..255 for JPEG baseline compatibility. + */ +{ + JQUANT_TBL ** qtblptr; + int i; + long temp; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl); + + qtblptr = & cinfo->quant_tbl_ptrs[which_tbl]; + + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo); + + for (i = 0; i < DCTSIZE2; i++) { + temp = ((long) basic_table[i] * scale_factor + 50L) / 100L; + /* limit the values to the valid range */ + if (temp <= 0L) temp = 1L; + if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */ + if (force_baseline && temp > 255L) + temp = 255L; /* limit to baseline range if requested */ + (*qtblptr)->quantval[i] = (UINT16) temp; + } + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*qtblptr)->sent_table = FALSE; +} + + +GLOBAL(void) +jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, + boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables + * and a straight percentage-scaling quality scale. In most cases it's better + * to use jpeg_set_quality (below); this entry point is provided for + * applications that insist on a linear percentage scaling. + */ +{ + /* These are the sample quantization tables given in JPEG spec section K.1. + * The spec says that the values given produce "good" quality, and + * when divided by 2, "very good" quality. + */ + static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 56, 68, 109, 103, 77, + 24, 35, 55, 64, 81, 104, 113, 92, + 49, 64, 78, 87, 103, 121, 120, 101, + 72, 92, 95, 98, 112, 100, 103, 99 + }; + static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 + }; + + /* Set up two quantization tables using the specified scaling */ + jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl, + scale_factor, force_baseline); + jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, + scale_factor, force_baseline); +} + + +GLOBAL(int) +jpeg_quality_scaling (int quality) +/* Convert a user-specified quality rating to a percentage scaling factor + * for an underlying quantization table, using our recommended scaling curve. + * The input 'quality' factor should be 0 (terrible) to 100 (very good). + */ +{ + /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */ + if (quality <= 0) quality = 1; + if (quality > 100) quality = 100; + + /* The basic table is used as-is (scaling 100) for a quality of 50. + * Qualities 50..100 are converted to scaling percentage 200 - 2*Q; + * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table + * to make all the table entries 1 (hence, minimum quantization loss). + * Qualities 1..50 are converted to scaling percentage 5000/Q. + */ + if (quality < 50) + quality = 5000 / quality; + else + quality = 200 - quality*2; + + return quality; +} + + +GLOBAL(void) +jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables. + * This is the standard quality-adjusting entry point for typical user + * interfaces; only those who want detailed control over quantization tables + * would use the preceding three routines directly. + */ +{ + /* Convert user 0-100 rating to percentage scaling */ + quality = jpeg_quality_scaling(quality); + + /* Set up standard quality tables */ + jpeg_set_linear_quality(cinfo, quality, force_baseline); +} + + +/* + * Huffman table setup routines + */ + +LOCAL(void) +add_huff_table (j_compress_ptr cinfo, + JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val) +/* Define a Huffman table */ +{ + int nsymbols, len; + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + /* Copy the number-of-symbols-of-each-code-length counts */ + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + + /* Validate the counts. We do this here mainly so we can copy the right + * number of symbols from the val[] array, without risking marching off + * the end of memory. jchuff.c will do a more thorough test later. + */ + nsymbols = 0; + for (len = 1; len <= 16; len++) + nsymbols += bits[len]; + if (nsymbols < 1 || nsymbols > 256) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + MEMCOPY((*htblptr)->huffval, val, (size_t)nsymbols * SIZEOF(UINT8)); + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*htblptr)->sent_table = FALSE; +} + + +LOCAL(void) +std_huff_tables (j_compress_ptr cinfo) +/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ +/* IMPORTANT: these are only valid for 8-bit data precision! */ +{ + static const UINT8 bits_dc_luminance[17] = + { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_luminance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_dc_chrominance[17] = + { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_chrominance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_ac_luminance[17] = + { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; + static const UINT8 val_ac_luminance[] = + { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, + 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, + 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, + 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, + 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, + 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, + 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, + 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, + 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + static const UINT8 bits_ac_chrominance[17] = + { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; + static const UINT8 val_ac_chrominance[] = + { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, + 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, + 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, + 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, + 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, + 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, + 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, + 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, + 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], + bits_dc_luminance, val_dc_luminance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], + bits_ac_luminance, val_ac_luminance); + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], + bits_dc_chrominance, val_dc_chrominance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], + bits_ac_chrominance, val_ac_chrominance); +} + + +/* + * Default parameter setup for compression. + * + * Applications that don't choose to use this routine must do their + * own setup of all these parameters. Alternately, you can call this + * to establish defaults and then alter parameters selectively. This + * is the recommended approach since, if we add any new parameters, + * your code will still work (they'll be set to reasonable defaults). + */ + +GLOBAL(void) +jpeg_set_defaults (j_compress_ptr cinfo) +{ + int i; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Allocate comp_info array large enough for maximum component count. + * Array is made permanent in case application wants to compress + * multiple images at same param settings. + */ + if (cinfo->comp_info == NULL) + cinfo->comp_info = (jpeg_component_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + MAX_COMPONENTS * SIZEOF(jpeg_component_info)); + + /* Initialize everything not dependent on the color space */ + + cinfo->lossless = FALSE; + cinfo->data_precision = BITS_IN_JSAMPLE; + /* Set up two quantization tables using default quality of 75 */ + jpeg_set_quality(cinfo, 75, TRUE); + /* Set up two Huffman tables */ + std_huff_tables(cinfo); + + /* Initialize default arithmetic coding conditioning */ + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + + /* Default is no multiple-scan output */ + cinfo->scan_info = NULL; + cinfo->num_scans = 0; + + /* Expect normal source image, not raw downsampled data */ + cinfo->raw_data_in = FALSE; + + /* Use Huffman coding, not arithmetic coding, by default */ + cinfo->arith_code = FALSE; + + /* By default, don't do extra passes to optimize entropy coding */ + cinfo->optimize_coding = FALSE; + /* The standard Huffman tables are only valid for 8-bit data precision. + * If the precision is higher, force optimization on so that usable + * tables will be computed. This test can be removed if default tables + * are supplied that are valid for the desired precision. + */ + if (cinfo->data_precision > 8) + cinfo->optimize_coding = TRUE; + + /* By default, use the simpler non-cosited sampling alignment */ + cinfo->CCIR601_sampling = FALSE; + + /* No input smoothing */ + cinfo->smoothing_factor = 0; + + /* DCT algorithm preference */ + cinfo->dct_method = JDCT_DEFAULT; + + /* No restart markers */ + cinfo->restart_interval = 0; + cinfo->restart_in_rows = 0; + + /* Fill in default JFIF marker parameters. Note that whether the marker + * will actually be written is determined by jpeg_set_colorspace. + * + * By default, the library emits JFIF version code 1.01. + * An application that wants to emit JFIF 1.02 extension markers should set + * JFIF_minor_version to 2. We could probably get away with just defaulting + * to 1.02, but there may still be some decoders in use that will complain + * about that; saying 1.01 should minimize compatibility problems. + */ + cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; /* Pixel size is unknown by default */ + cinfo->X_density = 1; /* Pixel aspect ratio is square by default */ + cinfo->Y_density = 1; + + /* Choose JPEG colorspace based on input space, set defaults accordingly */ + + jpeg_default_colorspace(cinfo); +} + + +/* + * Select an appropriate JPEG colorspace for in_color_space. + */ + +GLOBAL(void) +jpeg_default_colorspace (j_compress_ptr cinfo) +{ + if (cinfo->lossless) + jpeg_set_colorspace(cinfo, cinfo->in_color_space); + else { /* lossy */ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); + break; + case JCS_RGB: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_YCbCr: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_CMYK: + jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */ + break; + case JCS_YCCK: + jpeg_set_colorspace(cinfo, JCS_YCCK); + break; + case JCS_UNKNOWN: + jpeg_set_colorspace(cinfo, JCS_UNKNOWN); + break; + default: + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + } + } +} + + +/* + * Set the JPEG colorspace, and choose colorspace-dependent default values. + */ + +GLOBAL(void) +jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) +{ + jpeg_component_info * compptr; + int ci; + +#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \ + (compptr = &cinfo->comp_info[index], \ + compptr->component_id = (id), \ + compptr->h_samp_factor = (hsamp), \ + compptr->v_samp_factor = (vsamp), \ + compptr->quant_tbl_no = (quant), \ + compptr->dc_tbl_no = (dctbl), \ + compptr->ac_tbl_no = (actbl) ) + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* For all colorspaces, we use Q and Huff tables 0 for luminance components, + * tables 1 for chrominance components. + */ + + cinfo->jpeg_color_space = colorspace; + + cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */ + cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */ + + switch (colorspace) { + case JCS_GRAYSCALE: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 1; + /* JFIF specifies component ID 1 */ + SET_COMP(0, 1, 1,1, 0, 0,0); + break; + case JCS_RGB: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ + cinfo->num_components = 3; + SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0); + SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0); + SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0); + break; + case JCS_YCbCr: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 3; + /* JFIF specifies component IDs 1,2,3 */ + if (cinfo->lossless) { + SET_COMP(0, 1, 1,1, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + } else { /* lossy */ + /* We default to 2x2 subsamples of chrominance */ + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + } + break; + case JCS_CMYK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */ + cinfo->num_components = 4; + SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0); + SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0); + SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0); + SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0); + break; + case JCS_YCCK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */ + cinfo->num_components = 4; + if (cinfo->lossless) { + SET_COMP(0, 1, 1,1, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(3, 4, 1,1, 0, 0,0); + } else { /* lossy */ + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(3, 4, 2,2, 0, 0,0); + } + break; + case JCS_UNKNOWN: + cinfo->num_components = cinfo->input_components; + if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + for (ci = 0; ci < cinfo->num_components; ci++) { + SET_COMP(ci, ci, 1,1, 0, 0,0); + } + break; + default: + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + } +} + + +#ifdef C_PROGRESSIVE_SUPPORTED + +LOCAL(jpeg_scan_info *) +fill_scans (jpeg_scan_info * scanptr, int ncomps, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for each component */ +{ + int ci; + + for (ci = 0; ci < ncomps; ci++) { + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } + return scanptr; +} + + +LOCAL(jpeg_scan_info *) +fill_a_scan (jpeg_scan_info * scanptr, int ci, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for specified component */ +{ + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + return scanptr; +} + +LOCAL(jpeg_scan_info *) +fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al) +/* Support routine: generate interleaved DC scan if possible, else N scans */ +{ + int ci; + + if (ncomps <= MAX_COMPS_IN_SCAN) { + /* Single interleaved DC scan */ + scanptr->comps_in_scan = ncomps; + for (ci = 0; ci < ncomps; ci++) + scanptr->component_index[ci] = ci; + scanptr->Ss = scanptr->Se = 0; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } else { + /* Noninterleaved DC scan for each component */ + scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al); + } + return scanptr; +} + + +/* + * Create a recommended progressive-JPEG script. + * cinfo->num_components and cinfo->jpeg_color_space must be correct. + */ + +GLOBAL(void) +jpeg_simple_progression (j_compress_ptr cinfo) +{ + int ncomps = cinfo->num_components; + int nscans; + jpeg_scan_info * scanptr; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Figure space needed for script. Calculation must match code below! */ + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + nscans = 10; + } else { + /* All-purpose script for other color spaces. */ + if (ncomps > MAX_COMPS_IN_SCAN) + nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */ + else + nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */ + } + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_progression is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space, and we allocate + * enough space to handle YCbCr even if initially asked for grayscale. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { + cinfo->script_space_size = MAX(nscans, 10); + cinfo->script_space = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + (size_t)cinfo->script_space_size * SIZEOF(jpeg_scan_info)); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + /* Initial DC scan */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + /* Initial AC scan: get some luma data out in a hurry */ + scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2); + /* Chroma data is too small to be worth expending many scans on */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1); + /* Complete spectral selection for luma AC */ + scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2); + /* Refine next bit of luma AC */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1); + /* Finish DC successive approximation */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + /* Finish AC successive approximation */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0); + /* Luma bottom bit comes last since it's usually largest scan */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0); + } else { + /* All-purpose script for other color spaces. */ + /* Successive approximation first pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2); + scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2); + /* Successive approximation second pass */ + scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1); + /* Successive approximation final pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0); + } +} + +#endif /* C_PROGRESSIVE_SUPPORTED */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* + * Create a single-entry lossless-JPEG script containing all components. + * cinfo->num_components must be correct. + */ + +GLOBAL(void) +jpeg_simple_lossless (j_compress_ptr cinfo, int predictor, int point_transform) +{ + int ncomps = cinfo->num_components; + int nscans = 1; + int ci; + jpeg_scan_info * scanptr; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + cinfo->lossless = TRUE; + + /* Set jpeg_color_space. */ + jpeg_default_colorspace(cinfo); + + /* Check to ensure that all components will fit in one scan. */ + if (cinfo->num_components > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPS_IN_SCAN); + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_lossless is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { + cinfo->script_space_size = nscans; + cinfo->script_space = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + (size_t)cinfo->script_space_size * SIZEOF(jpeg_scan_info)); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + /* Fill the script. */ + scanptr->comps_in_scan = ncomps; + for (ci = 0; ci < (int)ncomps; ci++) + scanptr->component_index[ci] = ci; + scanptr->Ss = predictor; + scanptr->Se = 0; + scanptr->Ah = 0; + scanptr->Al = point_transform; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jcphuff.c b/dcmjpeg/libijg12/jcphuff.c new file mode 100644 index 00000000..487958d6 --- /dev/null +++ b/dcmjpeg/libijg12/jcphuff.c @@ -0,0 +1,848 @@ +/* + * jcphuff.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for progressive JPEG. + * + * We do not support output suspension in this module, since the library + * currently does not allow multiple-scan files to be written with output + * suspension. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ +#include "jchuff12.h" /* Declarations shared with jc*huff.c */ + +#ifdef C_PROGRESSIVE_SUPPORTED + +/* Expanded entropy encoder object for progressive Huffman encoding. */ + +typedef struct { + /* Mode flag: TRUE for optimization, FALSE for actual data output */ + boolean gather_statistics; + + /* Bit-level coding status. + * next_output_byte/free_in_buffer are local copies of cinfo->dest fields. + */ + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ + j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */ + + /* Coding status for DC components */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ + + /* Coding status for AC components */ + int ac_tbl_no; /* the table number of the single component */ + unsigned int EOBRUN; /* run length of EOBs */ + unsigned int BE; /* # of buffered correction bits before MCU */ + char * bit_buffer; /* buffer for correction bits (1 per char) */ + /* packing correction bits tightly would save some space but cost time... */ + + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan). + * Since any one scan codes only DC or only AC, we only need one set + * of tables, not one for DC and one for AC. + */ + c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Statistics tables for optimization; again, one set is enough */ + long * count_ptrs[NUM_HUFF_TBLS]; +} phuff_entropy_encoder; + +typedef phuff_entropy_encoder * phuff_entropy_ptr; + +/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit + * buffer can hold. Larger sizes may slightly improve compression, but + * 1000 is already well into the realm of overkill. + * The minimum safe size is 64 bits. + */ + +#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */ + +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than IJG_INT32. + * We assume that int right shift is unsigned if IJG_INT32 right shift is, + * which should be safe. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS int ishift_temp; +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +/* Forward declarations */ +METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo)); +METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo)); + + +/* + * Initialize for a Huffman-compressed scan using progressive JPEG. + */ + +METHODDEF(void) +start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + boolean is_DC_band; + int ci, tbl; + jpeg_component_info * compptr; + + entropy->cinfo = cinfo; + entropy->gather_statistics = gather_statistics; + + is_DC_band = (cinfo->Ss == 0); + + /* We assume jcmaster.c already validated the scan parameters. */ + + /* Select execution routines */ + if (cinfo->Ah == 0) { + if (is_DC_band) + lossyc->entropy_encode_mcu = encode_mcu_DC_first; + else + lossyc->entropy_encode_mcu = encode_mcu_AC_first; + } else { + if (is_DC_band) + lossyc->entropy_encode_mcu = encode_mcu_DC_refine; + else { + lossyc->entropy_encode_mcu = encode_mcu_AC_refine; + /* AC refinement needs a correction bit buffer */ + if (entropy->bit_buffer == NULL) + entropy->bit_buffer = (char *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + MAX_CORR_BITS * SIZEOF(char)); + } + } + if (gather_statistics) + lossyc->pub.entropy_finish_pass = finish_pass_gather_phuff; + else + lossyc->pub.entropy_finish_pass = finish_pass_phuff; + + /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1 + * for AC coefficients. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Initialize DC predictions to 0 */ + entropy->last_dc_val[ci] = 0; + /* Get table index */ + if (is_DC_band) { + if (cinfo->Ah != 0) /* DC refinement needs no table */ + continue; + tbl = compptr->dc_tbl_no; + } else { + entropy->ac_tbl_no = tbl = compptr->ac_tbl_no; + } + if (gather_statistics) { + /* Check for invalid table index */ + /* (make_c_derived_tbl does this in the other path) */ + if (tbl < 0 || tbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->count_ptrs[tbl] == NULL) + entropy->count_ptrs[tbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long)); + } else { + /* Compute derived values for Huffman table */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl, + & entropy->derived_tbls[tbl]); + } + } + + /* Initialize AC stuff */ + entropy->EOBRUN = 0; + entropy->BE = 0; + + /* Initialize bit buffer to empty */ + entropy->put_buffer = 0; + entropy->put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file. + * NB: these must be called only when actually outputting, + * that is, entropy->gather_statistics == FALSE. + */ + +/* Emit a byte */ +#define emit_byte(entropy,val) \ + { *(entropy)->next_output_byte++ = (JOCTET) (val); \ + if (--(entropy)->free_in_buffer == 0) \ + dump_buffer(entropy); } + + +LOCAL(void) +dump_buffer (phuff_entropy_ptr entropy) +/* Empty the output buffer; we do not support suspension in this module. */ +{ + struct jpeg_destination_mgr * dest = entropy->cinfo->dest; + + if (! (*dest->empty_output_buffer) (entropy->cinfo)) + ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND); + /* After a successful buffer dump, must reset buffer pointers */ + entropy->next_output_byte = dest->next_output_byte; + entropy->free_in_buffer = dest->free_in_buffer; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(void) +emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) +/* Emit some bits, unless we are in gather mode */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = entropy->put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + if (entropy->gather_statistics) + return; /* do nothing if we're only getting stats */ + + put_buffer &= (((IJG_INT32) 1)<put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(entropy, c); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(entropy, 0); + } + put_buffer <<= 8; + put_bits -= 8; + } + + entropy->put_buffer = put_buffer; /* update variables */ + entropy->put_bits = put_bits; +} + + +LOCAL(void) +flush_bits (phuff_entropy_ptr entropy) +{ + emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */ + entropy->put_buffer = 0; /* and reset bit-buffer to empty */ + entropy->put_bits = 0; +} + + +/* + * Emit (or just count) a Huffman symbol. + */ + +INLINE +LOCAL(void) +emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol) +{ + if (entropy->gather_statistics) + entropy->count_ptrs[tbl_no][symbol]++; + else { + c_derived_tbl * tbl = entropy->derived_tbls[tbl_no]; + emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]); + } +} + + +/* + * Emit bits from a correction bit buffer. + */ + +LOCAL(void) +emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart, + unsigned int nbits) +{ + if (entropy->gather_statistics) + return; /* no real work */ + + while (nbits > 0) { + emit_bits(entropy, (unsigned int) (*bufstart), 1); + bufstart++; + nbits--; + } +} + + +/* + * Emit any pending EOBRUN symbol. + */ + +LOCAL(void) +emit_eobrun (phuff_entropy_ptr entropy) +{ + register int temp, nbits; + + if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */ + temp = (int)entropy->EOBRUN; + nbits = 0; + while ((temp >>= 1)) + nbits++; + /* safety check: shouldn't happen given limited correction-bit buffer */ + if (nbits > 14) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4); + if (nbits) + emit_bits(entropy, entropy->EOBRUN, nbits); + + entropy->EOBRUN = 0; + + /* Emit any buffered correction bits */ + emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE); + entropy->BE = 0; + } +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(void) +emit_restart (phuff_entropy_ptr entropy, int restart_num) +{ + int ci; + + emit_eobrun(entropy); + + if (! entropy->gather_statistics) { + flush_bits(entropy); + emit_byte(entropy, 0xFF); + emit_byte(entropy, JPEG_RST0 + restart_num); + } + + if (entropy->cinfo->Ss == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++) + entropy->last_dc_val[ci] = 0; + } else { + /* Re-initialize all AC-related fields to 0 */ + entropy->EOBRUN = 0; + entropy->BE = 0; + } +} + + +/* + * MCU encoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp, temp2; + register int nbits; + int blkn, ci; + int Al = cinfo->Al; + JBLOCKROW block; + jpeg_component_info * compptr; + ISHIFT_TEMPS + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + + /* Compute the DC value after the required point transform by Al. + * This is simply an arithmetic right shift. + */ + temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al); + + /* DC differences are figured on the point-transformed values. */ + temp = temp2 - entropy->last_dc_val[ci]; + entropy->last_dc_val[ci] = temp2; + + /* Encode the DC coefficient difference per section G.1.2.1 */ + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit the Huffman-coded symbol for the number of bits */ + emit_symbol(entropy, compptr->dc_tbl_no, nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + emit_bits(entropy, (unsigned int) temp2, nbits); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp, temp2; + register int nbits; + register int r, k; + int Se = cinfo->Se; + int Al = cinfo->Al; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */ + + r = 0; /* r = run length of zeros */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = (*block)[jpeg_natural_order[k]]) == 0) { + r++; + continue; + } + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value; so the code is + * interwoven with finding the abs value (temp) and output bits (temp2). + */ + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + /* For a negative coef, want temp2 = bitwise complement of abs(coef) */ + temp2 = ~temp; + } else { + temp >>= Al; /* apply the point transform */ + temp2 = temp; + } + /* Watch out for case that nonzero coef is zero after point transform */ + if (temp == 0) { + r++; + continue; + } + + /* Emit any pending EOBRUN */ + if (entropy->EOBRUN > 0) + emit_eobrun(entropy); + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + emit_bits(entropy, (unsigned int) temp2, nbits); + + r = 0; /* reset zero run length */ + } + + if (r > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + if (entropy->EOBRUN == 0x7FFF) + emit_eobrun(entropy); /* force it out to avoid overflow */ + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp; + int blkn; + int Al = cinfo->Al; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* We simply emit the Al'th bit of the DC coefficient value. */ + temp = (*block)[0]; + emit_bits(entropy, (unsigned int) (temp >> Al), 1); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp; + register int r, k; + int EOB; + char *BR_buffer; + unsigned int BR; + int Se = cinfo->Se; + int Al = cinfo->Al; + JBLOCKROW block; + int absvalues[DCTSIZE2]; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* It is convenient to make a pre-pass to determine the transformed + * coefficients' absolute values and the EOB position. + */ + EOB = 0; + for (k = cinfo->Ss; k <= Se; k++) { + temp = (*block)[jpeg_natural_order[k]]; + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value. + */ + if (temp < 0) + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + absvalues[k] = temp; /* save abs value for main pass */ + if (temp == 1) + EOB = k; /* EOB = index of last newly-nonzero coef */ + } + + /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */ + + r = 0; /* r = run length of zeros */ + BR = 0; /* BR = count of buffered bits added now */ + BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = absvalues[k]) == 0) { + r++; + continue; + } + + /* Emit any required ZRLs, but not if they can be folded into EOB */ + while (r > 15 && k <= EOB) { + /* emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + /* Emit ZRL */ + emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + /* Emit buffered correction bits that must be associated with ZRL */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + } + + /* If the coef was previously nonzero, it only needs a correction bit. + * NOTE: a straight translation of the spec's figure G.7 would suggest + * that we also need to test r > 15. But if r > 15, we can only get here + * if k > EOB, which implies that this coefficient is not 1. + */ + if (temp > 1) { + /* The correction bit is the next bit of the absolute value. */ + BR_buffer[BR++] = (char) (temp & 1); + continue; + } + + /* Emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1); + + /* Emit output bit for newly-nonzero coef */ + temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1; + emit_bits(entropy, (unsigned int) temp, 1); + + /* Emit buffered correction bits that must be associated with this code */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + r = 0; /* reset zero run length */ + } + + if (r > 0 || BR > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + entropy->BE += BR; /* concat my correction bits to older ones */ + /* We force out the EOB if we risk either: + * 1. overflow of the EOB counter; + * 2. overflow of the correction bit buffer during the next MCU. + */ + if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1)) + emit_eobrun(entropy); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * Finish up at the end of a Huffman-compressed progressive scan. + */ + +METHODDEF(void) +finish_pass_phuff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Flush out any buffered data */ + emit_eobrun(entropy); + flush_bits(entropy); + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather_phuff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + boolean is_DC_band; + int ci, tbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did[NUM_HUFF_TBLS]; + + /* Flush out buffered data (all we care about is counting the EOB symbol) */ + emit_eobrun(entropy); + + is_DC_band = (cinfo->Ss == 0); + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did, SIZEOF(did)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + if (is_DC_band) { + if (cinfo->Ah != 0) /* DC refinement needs no table */ + continue; + tbl = compptr->dc_tbl_no; + } else { + tbl = compptr->ac_tbl_no; + } + if (! did[tbl]) { + if (is_DC_band) + htblptr = & cinfo->dc_huff_tbl_ptrs[tbl]; + else + htblptr = & cinfo->ac_huff_tbl_ptrs[tbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]); + did[tbl] = TRUE; + } + } +} + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return (cinfo->Ss != 0 || cinfo->Ah == 0); +} + + +/* + * Module initialization routine for progressive Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_phuff_encoder (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy; + int i; + + entropy = (phuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(phuff_entropy_encoder)); + lossyc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + lossyc->pub.entropy_start_pass = start_pass_phuff; + lossyc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + entropy->count_ptrs[i] = NULL; + } + entropy->bit_buffer = NULL; /* needed only in AC refinement scan */ +} + +#endif /* C_PROGRESSIVE_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jcpred.c b/dcmjpeg/libijg12/jcpred.c new file mode 100644 index 00000000..5e467ece --- /dev/null +++ b/dcmjpeg/libijg12/jcpred.c @@ -0,0 +1,314 @@ +/* + * jcpred.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample differencing for lossless JPEG. + * + * In order to avoid paying the performance penalty of having to check the + * predictor being used and the row being processed for each call of the + * undifferencer, and to promote optimization, we have separate differencing + * functions for each case. + * + * We are able to avoid duplicating source code by implementing the predictors + * and differencers as macros. Each of the differencing functions are + * simply wrappers around a DIFFERENCE macro with the appropriate PREDICTOR + * macro passed as an argument. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* Private predictor object */ + +typedef struct { + /* MCU-rows left in the restart interval for each component */ + unsigned int restart_rows_to_go[MAX_COMPONENTS]; +} c_predictor; + +typedef c_predictor * c_pred_ptr; + +/* Forward declarations */ +LOCAL(void) reset_predictor + JPP((j_compress_ptr cinfo, int ci)); +METHODDEF(void) start_pass + JPP((j_compress_ptr cinfo)); + + +/* Predictor for the first column of the first row: 2^(P-Pt-1) */ +#define INITIAL_PREDICTORx (1 << (cinfo->data_precision - cinfo->Al - 1)) + +/* Predictor for the first column of the remaining rows: Rb */ +#define INITIAL_PREDICTOR2 GETJSAMPLE(prev_row[0]) + + +/* + * 1-Dimensional differencer routine. + * + * This macro implements the 1-D horizontal predictor (1). INITIAL_PREDICTOR + * is used as the special case predictor for the first column, which must be + * either INITIAL_PREDICTOR2 or INITIAL_PREDICTORx. The remaining samples + * use PREDICTOR1. + */ + +#define DIFFERENCE_1D(INITIAL_PREDICTOR) \ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; \ + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; \ + boolean restart = FALSE; \ + unsigned int xindex; \ + int samp, Ra; \ + \ + samp = GETJSAMPLE(input_buf[0]); \ + diff_buf[0] = samp - INITIAL_PREDICTOR; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Ra = samp; \ + samp = GETJSAMPLE(input_buf[xindex]); \ + diff_buf[xindex] = samp - PREDICTOR1; \ + } \ + \ + /* Account for restart interval (no-op if not using restarts) */ \ + if (cinfo->restart_interval) { \ + if (--(pred->restart_rows_to_go[ci]) == 0) { \ + reset_predictor(cinfo, ci); \ + restart = TRUE; \ + } \ + } + + +/* + * 2-Dimensional differencer routine. + * + * This macro implements the 2-D horizontal predictors (#2-7). PREDICTOR2 is + * used as the special case predictor for the first column. The remaining + * samples use PREDICTOR, which is a function of Ra, Rb, Rc. + * + * Because prev_row and output_buf may point to the same storage area (in an + * interleaved image with Vi=1, for example), we must take care to buffer Rb/Rc + * before writing the current reconstructed sample value into output_buf. + */ + +#define DIFFERENCE_2D(PREDICTOR) \ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; \ + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; \ + unsigned int xindex; \ + int samp, Ra, Rb, Rc; \ + \ + Rb = GETJSAMPLE(prev_row[0]); \ + samp = GETJSAMPLE(input_buf[0]); \ + diff_buf[0] = samp - PREDICTOR2; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Rc = Rb; \ + Rb = GETJSAMPLE(prev_row[xindex]); \ + Ra = samp; \ + samp = GETJSAMPLE(input_buf[xindex]); \ + diff_buf[xindex] = samp - PREDICTOR; \ + } \ + \ + /* Account for restart interval (no-op if not using restarts) */ \ + if (cinfo->restart_interval) { \ + if (--pred->restart_rows_to_go[ci] == 0) \ + reset_predictor(cinfo, ci); \ + } + +#define JPEG_UNUSED(x) ((void)x) + +/* + * Differencers for the all rows but the first in a scan or restart interval. + * The first sample in the row is differenced using the vertical + * predictor (2). The rest of the samples are differenced using the + * predictor specified in the scan header. + */ + +METHODDEF(void) +jpeg_difference1(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_1D(INITIAL_PREDICTOR2); + JPEG_UNUSED(restart); +} + +METHODDEF(void) +jpeg_difference2(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR2); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference3(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR3); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference4(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR4); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference5(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR5); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference6(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR6); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference7(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR7); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + + +/* + * Differencer for the first row in a scan or restart interval. The first + * sample in the row is differenced using the special predictor constant + * x=2^(P-Pt-1). The rest of the samples are differenced using the + * 1-D horizontal predictor (1). + */ + +METHODDEF(void) +jpeg_difference_first_row(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_1D(INITIAL_PREDICTORx); + + /* + * Now that we have differenced the first row, we want to use the + * differencer which corresponds to the predictor specified in the + * scan header. + * + * Note that we don't to do this if we have just reset the predictor + * for a new restart interval. + */ + if (!restart) { + switch (cinfo->Ss) { + case 1: + losslsc->predict_difference[ci] = jpeg_difference1; + break; + case 2: + losslsc->predict_difference[ci] = jpeg_difference2; + break; + case 3: + losslsc->predict_difference[ci] = jpeg_difference3; + break; + case 4: + losslsc->predict_difference[ci] = jpeg_difference4; + break; + case 5: + losslsc->predict_difference[ci] = jpeg_difference5; + break; + case 6: + losslsc->predict_difference[ci] = jpeg_difference6; + break; + case 7: + losslsc->predict_difference[ci] = jpeg_difference7; + break; + } + } +} + +/* + * Reset predictor at the start of a pass or restart interval. + */ + +LOCAL(void) +reset_predictor (j_compress_ptr cinfo, int ci) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; + + /* Initialize restart counter */ + pred->restart_rows_to_go[ci] = + cinfo->restart_interval / cinfo->MCUs_per_row; + + /* Set difference function to first row function */ + losslsc->predict_difference[ci] = jpeg_difference_first_row; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo) +{ + /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */ + /* c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; */ + int ci; + + /* Check that the restart interval is an integer multiple of the number + * of MCU in an MCU-row. + */ + if (cinfo->restart_interval % cinfo->MCUs_per_row != 0) + ERREXIT2(cinfo, JERR_BAD_RESTART, + (int)cinfo->restart_interval, (int)cinfo->MCUs_per_row); + + /* Set predictors for start of pass */ + for (ci = 0; ci < cinfo->num_components; ci++) + reset_predictor(cinfo, ci); +} + + +/* + * Module initialization routine for the differencer. + */ + +GLOBAL(void) +jinit_differencer (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_pred_ptr pred; + + pred = (c_pred_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_predictor)); + losslsc->pred_private = (void *) pred; + losslsc->predict_start_pass = start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg12/jcprepct.c b/dcmjpeg/libijg12/jcprepct.c new file mode 100644 index 00000000..36c5f88a --- /dev/null +++ b/dcmjpeg/libijg12/jcprepct.c @@ -0,0 +1,354 @@ +/* + * jcprepct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the compression preprocessing controller. + * This controller manages the color conversion, downsampling, + * and edge expansion steps. + * + * Most of the complexity here is associated with buffering input rows + * as required by the downsampler. See the comments at the head of + * jcsample.c for the downsampler's needs. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* At present, jcsample.c can request context rows only for smoothing. + * In the future, we might also need context rows for CCIR601 sampling + * or other more-complex downsampling procedures. The code to support + * context rows should be compiled only if needed. + */ +#ifdef INPUT_SMOOTHING_SUPPORTED +#define CONTEXT_ROWS_SUPPORTED +#endif + + +/* + * For the simple (no-context-row) case, we just need to buffer one + * row group's worth of pixels for the downsampling step. At the bottom of + * the image, we pad to a full row group by replicating the last pixel row. + * The downsampler's last output row is then replicated if needed to pad + * out to a full iMCU row. + * + * When providing context rows, we must buffer three row groups' worth of + * pixels. Three row groups are physically allocated, but the row pointer + * arrays are made five row groups high, with the extra pointers above and + * below "wrapping around" to point to the last and first real row groups. + * This allows the downsampler to access the proper context rows. + * At the top and bottom of the image, we create dummy context rows by + * copying the first or last real pixel row. This copying could be avoided + * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the + * trouble on the compression side. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_prep_controller pub; /* public fields */ + + /* Downsampling input buffer. This buffer holds color-converted data + * until we have enough to do a downsample step. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + JDIMENSION rows_to_go; /* counts rows remaining in source image */ + int next_buf_row; /* index of next row to store in color_buf */ + +#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */ + int this_row_group; /* starting row index of group to process */ + int next_buf_stop; /* downsample when we reach this index */ +#endif +} my_prep_controller; + +typedef my_prep_controller * my_prep_ptr; + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + + if (pass_mode != JBUF_PASS_THRU) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Initialize total-height counter for detecting bottom of image */ + prep->rows_to_go = cinfo->image_height; + /* Mark the conversion buffer empty */ + prep->next_buf_row = 0; +#ifdef CONTEXT_ROWS_SUPPORTED + /* Preset additional state variables for context mode. + * These aren't used in non-context mode, so we needn't test which mode. + */ + prep->this_row_group = 0; + /* Set next_buf_stop to stop after two row groups have been read in. */ + prep->next_buf_stop = 2 * cinfo->max_v_samp_factor; +#endif +} + + +/* + * Expand an image vertically from height input_rows to height output_rows, + * by duplicating the bottom row. + */ + +LOCAL(void) +expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols, + int input_rows, int output_rows) +{ + register int row; + + for (row = input_rows; row < output_rows; row++) { + jcopy_sample_rows(image_data, input_rows-1, image_data, row, + 1, num_cols); + } +} + + +/* + * Process some data in the simple no-context case. + * + * Preprocessor output data is counted in "row groups". A row group + * is defined to be v_samp_factor sample rows of each component. + * Downsampling will produce this much data from each max_v_samp_factor + * input rows. + */ + +METHODDEF(void) +pre_process_data (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + JDIMENSION inrows; + jpeg_component_info * compptr; + + while (*in_row_ctr < in_rows_avail && + *out_row_group_ctr < out_row_groups_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = cinfo->max_v_samp_factor - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + *in_row_ctr += (JDIMENSION)numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= (JDIMENSION)numrows; + /* If at bottom of image, pad to fill the conversion buffer. */ + if (prep->rows_to_go == 0 && + prep->next_buf_row < cinfo->max_v_samp_factor) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, cinfo->max_v_samp_factor); + } + prep->next_buf_row = cinfo->max_v_samp_factor; + } + /* If we've filled the conversion buffer, empty it. */ + if (prep->next_buf_row == cinfo->max_v_samp_factor) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, (JDIMENSION) 0, + output_buf, *out_row_group_ctr); + prep->next_buf_row = 0; + (*out_row_group_ctr)++; + } + /* If at bottom of image, pad the output to a full iMCU height. + * Note we assume the caller is providing a one-iMCU-height output buffer! + */ + if (prep->rows_to_go == 0 && + *out_row_group_ctr < out_row_groups_avail) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + expand_bottom_edge(output_buf[ci], + compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit, + (int)*out_row_group_ctr * compptr->v_samp_factor, + (int)out_row_groups_avail * compptr->v_samp_factor); + } + *out_row_group_ctr = out_row_groups_avail; + break; /* can exit outer loop without test */ + } + } +} + + +#ifdef CONTEXT_ROWS_SUPPORTED + +/* + * Process some data in the context case. + */ + +METHODDEF(void) +pre_process_context (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + int buf_height = cinfo->max_v_samp_factor * 3; + JDIMENSION inrows; + + while (*out_row_group_ctr < out_row_groups_avail) { + if (*in_row_ctr < in_rows_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = prep->next_buf_stop - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + /* Pad at top of image, if first time through */ + if (prep->rows_to_go == cinfo->image_height) { + for (ci = 0; ci < cinfo->num_components; ci++) { + int row; + for (row = 1; row <= cinfo->max_v_samp_factor; row++) { + jcopy_sample_rows(prep->color_buf[ci], 0, + prep->color_buf[ci], -row, + 1, cinfo->image_width); + } + } + } + *in_row_ctr += (JDIMENSION)numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= (JDIMENSION)numrows; + } else { + /* Return for more data, unless we are at the bottom of the image. */ + if (prep->rows_to_go != 0) + break; + /* When at bottom of image, pad to fill the conversion buffer. */ + if (prep->next_buf_row < prep->next_buf_stop) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, prep->next_buf_stop); + } + prep->next_buf_row = prep->next_buf_stop; + } + } + /* If we've gotten enough data, downsample a row group. */ + if (prep->next_buf_row == prep->next_buf_stop) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, + (JDIMENSION) prep->this_row_group, + output_buf, *out_row_group_ctr); + (*out_row_group_ctr)++; + /* Advance pointers with wraparound as necessary. */ + prep->this_row_group += cinfo->max_v_samp_factor; + if (prep->this_row_group >= buf_height) + prep->this_row_group = 0; + if (prep->next_buf_row >= buf_height) + prep->next_buf_row = 0; + prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor; + } + } +} + + +/* + * Create the wrapped-around downsampling input buffer needed for context mode. + */ + +LOCAL(void) +create_context_buffer (j_compress_ptr cinfo) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int rgroup_height = cinfo->max_v_samp_factor; + int ci, i; + jpeg_component_info * compptr; + JSAMPARRAY true_buffer, fake_buffer; + + /* Grab enough space for fake row pointers for all the components; + * we need five row groups' worth of pointers for each component. + */ + fake_buffer = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)(cinfo->num_components * 5 * rgroup_height) * + SIZEOF(JSAMPROW)); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate the actual buffer space (3 row groups) for this component. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + true_buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_data_units * cinfo->data_unit * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) (3 * rgroup_height)); + /* Copy true buffer row pointers into the middle of the fake row array */ + MEMCOPY(fake_buffer + rgroup_height, true_buffer, + 3 * (size_t)rgroup_height * SIZEOF(JSAMPROW)); + /* Fill in the above and below wraparound pointers */ + for (i = 0; i < rgroup_height; i++) { + fake_buffer[i] = true_buffer[2 * rgroup_height + i]; + fake_buffer[4 * rgroup_height + i] = true_buffer[i]; + } + prep->color_buf[ci] = fake_buffer + rgroup_height; + fake_buffer += 5 * rgroup_height; /* point to space for next component */ + } +} + +#endif /* CONTEXT_ROWS_SUPPORTED */ + + +/* + * Initialize preprocessing controller. + */ + +GLOBAL(void) +jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_prep_ptr prep; + int ci; + jpeg_component_info * compptr; + + if (need_full_buffer) /* safety check */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + prep = (my_prep_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_prep_controller)); + cinfo->prep = (struct jpeg_c_prep_controller *) prep; + prep->pub.start_pass = start_pass_prep; + + /* Allocate the color conversion buffer. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + if (cinfo->downsample->need_context_rows) { + /* Set up to provide context rows */ +#ifdef CONTEXT_ROWS_SUPPORTED + prep->pub.pre_process_data = pre_process_context; + create_context_buffer(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* No context, just make it tall enough for one row group */ + prep->pub.pre_process_data = pre_process_data; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prep->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_data_units * cinfo->data_unit * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/dcmjpeg/libijg12/jcsample.c b/dcmjpeg/libijg12/jcsample.c new file mode 100644 index 00000000..4785e1c1 --- /dev/null +++ b/dcmjpeg/libijg12/jcsample.c @@ -0,0 +1,519 @@ +/* + * jcsample.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains downsampling routines. + * + * Downsampling input data is counted in "row groups". A row group + * is defined to be max_v_samp_factor pixel rows of each component, + * from which the downsampler produces v_samp_factor sample rows. + * A single row group is processed in each call to the downsampler module. + * + * The downsampler is responsible for edge-expansion of its output data + * to fill an integral number of DCT blocks horizontally. The source buffer + * may be modified if it is helpful for this purpose (the source buffer is + * allocated wide enough to correspond to the desired output width). + * The caller (the prep controller) is responsible for vertical padding. + * + * The downsampler may request "context rows" by setting need_context_rows + * during startup. In this case, the input arrays will contain at least + * one row group's worth of pixels above and below the passed-in data; + * the caller will create dummy rows at image top and bottom by replicating + * the first or last real pixel row. + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + * + * The downsampling algorithm used here is a simple average of the source + * pixels covered by the output pixel. The hi-falutin sampling literature + * refers to this as a "box filter". In general the characteristics of a box + * filter are not very good, but for the specific cases we normally use (1:1 + * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not + * nearly so bad. If you intend to use other sampling ratios, you'd be well + * advised to improve this code. + * + * A simple input-smoothing capability is provided. This is mainly intended + * for cleaning up color-dithered GIF input files (if you find it inadequate, + * we suggest using an external filtering program such as pnmconvol). When + * enabled, each input pixel P is replaced by a weighted sum of itself and its + * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF, + * where SF = (smoothing_factor / 1024). + * Currently, smoothing is only supported for 2h2v sampling factors. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Pointer to routine to downsample a single component */ +typedef JMETHOD(void, downsample1_ptr, + (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data)); + +/* Private subobject */ + +typedef struct { + struct jpeg_downsampler pub; /* public fields */ + + /* Downsampling method pointers, one per component */ + downsample1_ptr methods[MAX_COMPONENTS]; +} my_downsampler; + +typedef my_downsampler * my_downsample_ptr; + + +/* + * Initialize for a downsampling pass. + */ + +METHODDEF(void) +start_pass_downsample (j_compress_ptr cinfo) +{ + /* no work for now */ +} + + +/* + * Expand a component horizontally from width input_cols to width output_cols, + * by duplicating the rightmost samples. + */ + +LOCAL(void) +expand_right_edge (JSAMPARRAY image_data, int num_rows, + JDIMENSION input_cols, JDIMENSION output_cols) +{ + register JSAMPROW ptr; + register JSAMPLE pixval; + register int count; + int row; + int numcols = (int) (output_cols - input_cols); + + if (numcols > 0) { + for (row = 0; row < num_rows; row++) { + ptr = image_data[row] + input_cols; + pixval = ptr[-1]; /* don't need GETJSAMPLE() here */ + for (count = numcols; count > 0; count--) + *ptr++ = pixval; + } + } +} + + +/* + * Do downsampling for a whole row group (all components). + * + * In this version we simply downsample each component independently. + */ + +METHODDEF(void) +sep_downsample (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, JDIMENSION out_row_group_index) +{ + my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample; + int ci; + jpeg_component_info * compptr; + JSAMPARRAY in_ptr, out_ptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + in_ptr = input_buf[ci] + in_row_index; + out_ptr = output_buf[ci] + (out_row_group_index * (JDIMENSION)compptr->v_samp_factor); + (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr); + } +} + + +/* + * Downsample pixel values of a single component. + * One row group is processed per call. + * This version handles arbitrary integral sampling ratios, without smoothing. + * Note that this version is not actually used for customary sampling ratios. + */ + +METHODDEF(void) +int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v; + JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */ + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + JSAMPROW inptr, outptr; + IJG_INT32 outvalue; + + h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; + v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; + numpix = h_expand * v_expand; + numpix2 = numpix/2; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * (JDIMENSION)h_expand); + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + for (outcol = 0, outcol_h = 0; outcol < output_cols; + outcol++, outcol_h += (JDIMENSION)h_expand) { + outvalue = 0; + for (v = 0; v < v_expand; v++) { + inptr = input_data[inrow+v] + outcol_h; + for (h = 0; h < h_expand; h++) { + outvalue += (IJG_INT32) GETJSAMPLE(*inptr++); + } + } + *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); + } + inrow += v_expand; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * without smoothing. + */ + +METHODDEF(void) +fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + /* Copy the data */ + jcopy_sample_rows(input_data, 0, output_data, 0, + cinfo->max_v_samp_factor, cinfo->image_width); + /* Edge-expand */ + expand_right_edge(output_data, cinfo->max_v_samp_factor, + cinfo->image_width, compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit); +} + + +/* + * Downsample pixel values of a single component. + * This version handles the common case of 2:1 horizontal and 1:1 vertical, + * without smoothing. + * + * A note about the "bias" calculations: when rounding fractional values to + * integer, we do not want to always round 0.5 up to the next integer. + * If we did that, we'd introduce a noticeable bias towards larger values. + * Instead, this code is arranged so that 0.5 will be rounded up or down at + * alternate pixel locations (a simple ordered dither pattern). + */ + +METHODDEF(void) +h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int outrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr = input_data[outrow]; + bias = 0; /* bias = 0,1,0,1,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + + bias) >> 1); + bias ^= 1; /* 0=>1, 1=>0 */ + inptr += 2; + } + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * without smoothing. + */ + +METHODDEF(void) +h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr0, inptr1, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + bias = 1; /* bias = 1,2,1,2,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + + bias) >> 2); + bias ^= 3; /* 1=>2, 2=>1 */ + inptr0 += 2; inptr1 += 2; + } + inrow += 2; + } +} + + +#ifdef INPUT_SMOOTHING_SUPPORTED + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr; + IJG_INT32 membersum, neighsum, memberscale, neighscale; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols * 2); + + /* We don't bother to form the individual "smoothed" input pixel values; + * we can directly compute the output which is the average of the four + * smoothed values. Each of the four member pixels contributes a fraction + * (1-8*SF) to its own smoothed image and a fraction SF to each of the three + * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final + * output. The four corner-adjacent neighbor pixels contribute a fraction + * SF to just one smoothed pixel, or SF/4 to the final output; while the + * eight edge-adjacent neighbors contribute SF to each of two smoothed + * pixels, or SF/2 overall. In order to use integer arithmetic, these + * factors are scaled by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */ + neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */ + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + above_ptr = input_data[inrow-1]; + below_ptr = input_data[inrow+2]; + + /* Special case for first column: pretend column -1 is same as column 0 */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]); + neighsum += neighsum; + neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + /* sum of pixels directly mapped to this output element */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + /* sum of edge-neighbor pixels */ + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]); + /* The edge-neighbors count twice as much as corner-neighbors */ + neighsum += neighsum; + /* Add in the corner-neighbors */ + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]); + /* form final output scaled up by 2^16 */ + membersum = membersum * memberscale + neighsum * neighscale; + /* round, descale and output it */ + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]); + neighsum += neighsum; + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + inrow += 2; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int outrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr, above_ptr, below_ptr, outptr; + IJG_INT32 membersum, neighsum, memberscale, neighscale; + int colsum, lastcolsum, nextcolsum; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols); + + /* Each of the eight neighbor pixels contributes a fraction SF to the + * smoothed pixel, while the main pixel contributes (1-8*SF). In order + * to use integer arithmetic, these factors are multiplied by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */ + neighscale = cinfo->smoothing_factor * 64; /* scaled SF */ + + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr = input_data[outrow]; + above_ptr = input_data[outrow-1]; + below_ptr = input_data[outrow+1]; + + /* Special case for first column */ + colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) + + GETJSAMPLE(*inptr); + membersum = GETJSAMPLE(*inptr++); + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = colsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + membersum = GETJSAMPLE(*inptr++); + above_ptr++; below_ptr++; + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + colsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + } +} + +#endif /* INPUT_SMOOTHING_SUPPORTED */ + + +/* + * Module initialization routine for downsampling. + * Note that we must select a routine for each component. + */ + +GLOBAL(void) +jinit_downsampler (j_compress_ptr cinfo) +{ + my_downsample_ptr downsample; + int ci; + jpeg_component_info * compptr; + boolean smoothok = TRUE; + + downsample = (my_downsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_downsampler)); + cinfo->downsample = (struct jpeg_downsampler *) downsample; + downsample->pub.start_pass = start_pass_downsample; + downsample->pub.downsample = sep_downsample; + downsample->pub.need_context_rows = FALSE; + + if (cinfo->CCIR601_sampling) + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* Verify we can handle the sampling factors, and set up method pointers */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor == cinfo->max_h_samp_factor && + compptr->v_samp_factor == cinfo->max_v_samp_factor) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = fullsize_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = fullsize_downsample; + } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && + compptr->v_samp_factor == cinfo->max_v_samp_factor) { + smoothok = FALSE; + downsample->methods[ci] = h2v1_downsample; + } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && + compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = h2v2_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = h2v2_downsample; + } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && + (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { + smoothok = FALSE; + downsample->methods[ci] = int_downsample; + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + } + +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor && !smoothok) + TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL); +#endif +} diff --git a/dcmjpeg/libijg12/jcscale.c b/dcmjpeg/libijg12/jcscale.c new file mode 100644 index 00000000..44456e0e --- /dev/null +++ b/dcmjpeg/libijg12/jcscale.c @@ -0,0 +1,63 @@ +/* + * jcscale.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample downscaling by 2^Pt for lossless JPEG. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +METHODDEF(void) +simple_downscale(j_compress_ptr cinfo, + const JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width) +{ + /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */ + unsigned int xindex; + SHIFT_TEMPS + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) RIGHT_SHIFT(GETJSAMPLE(input_buf[xindex]), + cinfo->Al); +} + + +METHODDEF(void) +noscale(j_compress_ptr cinfo, + JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width) +{ + MEMCOPY(output_buf, input_buf, width * SIZEOF(JSAMPLE)); + return; +} + + +METHODDEF(void) +scaler_start_pass (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + /* Set scaler function based on Pt */ + if (cinfo->Al) + losslsc->scaler_scale = simple_downscale; + else + losslsc->scaler_scale = noscale; +} + + +GLOBAL(void) +jinit_c_scaler (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + losslsc->scaler_start_pass = scaler_start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jcshuff.c b/dcmjpeg/libijg12/jcshuff.c new file mode 100644 index 00000000..14bf7dba --- /dev/null +++ b/dcmjpeg/libijg12/jcshuff.c @@ -0,0 +1,661 @@ +/* + * jcshuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for sequential JPEG. + * + * Much of the complexity here has to do with supporting output suspension. + * If the data destination module demands suspension, we want to be able to + * back up to the start of the current MCU. To do this, we copy state + * variables into local working storage, and update them back to the + * permanent JPEG objects only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ +#include "jchuff12.h" /* Declarations shared with jc*huff.c */ + + +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + savable_state saved; /* Bit buffer & DC state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + +#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ + long * dc_count_ptrs[NUM_HUFF_TBLS]; + long * ac_count_ptrs[NUM_HUFF_TBLS]; +#endif +} shuff_entropy_encoder; + +typedef shuff_entropy_encoder * shuff_entropy_ptr; + +/* Working state while writing an MCU. + * This struct contains all the fields that are needed by subroutines. + */ + +typedef struct { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ +} working_state; + + +/* Forward declarations */ +METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); +#ifdef ENTROPY_OPT_SUPPORTED +METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); +#endif + + +/* + * Initialize for a Huffman-compressed scan. + * If gather_statistics is TRUE, we do not output anything during the scan, + * just count the Huffman symbols used and generate Huffman code tables. + */ + +METHODDEF(void) +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int ci, dctbl, actbl; + jpeg_component_info * compptr; + + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + lossyc->entropy_encode_mcu = encode_mcu_gather; + lossyc->pub.entropy_finish_pass = finish_pass_gather; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + lossyc->entropy_encode_mcu = encode_mcu_huff; + lossyc->pub.entropy_finish_pass = finish_pass_huff; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + /* Check for invalid table indexes */ + /* (make_c_derived_tbl does this in the other path) */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + if (actbl < 0 || actbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->dc_count_ptrs[dctbl] == NULL) + entropy->dc_count_ptrs[dctbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long)); + if (entropy->ac_count_ptrs[actbl] == NULL) + entropy->ac_count_ptrs[actbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long)); +#endif + } else { + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, + & entropy->dc_derived_tbls[dctbl]); + jpeg_make_c_derived_tbl(cinfo, FALSE, actbl, + & entropy->ac_derived_tbls[actbl]); + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Initialize bit buffer to empty */ + entropy->saved.put_buffer = 0; + entropy->saved.put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file */ + +/* Emit a byte, taking 'action' if must suspend. */ +#define emit_byte(state,val,action) \ + { *(state)->next_output_byte++ = (JOCTET) (val); \ + if (--(state)->free_in_buffer == 0) \ + if (! dump_buffer(state)) \ + { action; } } + + +LOCAL(boolean) +dump_buffer (working_state * state) +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +{ + struct jpeg_destination_mgr * dest = state->cinfo->dest; + + if (! (*dest->empty_output_buffer) (state->cinfo)) + return FALSE; + /* After a successful buffer dump, must reset buffer pointers */ + state->next_output_byte = dest->next_output_byte; + state->free_in_buffer = dest->free_in_buffer; + return TRUE; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(boolean) +emit_bits (working_state * state, unsigned int code, int size) +/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = state->cur.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); + + put_buffer &= (((IJG_INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(state, c, return FALSE); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(state, 0, return FALSE); + } + put_buffer <<= 8; + put_bits -= 8; + } + + state->cur.put_buffer = put_buffer; /* update state variables */ + state->cur.put_bits = put_bits; + + return TRUE; +} + + +LOCAL(boolean) +flush_bits (working_state * state) +{ + if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ + return FALSE; + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ + state->cur.put_bits = 0; + return TRUE; +} + + +/* Encode a single block's worth of coefficients */ + +LOCAL(boolean) +encode_one_block (working_state * state, const JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl) +{ + register int temp, temp2; + register int nbits; + register int k, r, i; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = temp2 = block[0] - last_dc_val; + + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit the Huffman-coded symbol for the number of bits */ + if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + if (! emit_bits(state, (unsigned int) temp2, nbits)) + return FALSE; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k < DCTSIZE2; k++) { + if ((temp = block[jpeg_natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) + return FALSE; + r -= 16; + } + + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit Huffman symbol for run length / number of bits */ + i = (r << 4) + nbits; + if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (! emit_bits(state, (unsigned int) temp2, nbits)) + return FALSE; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0])) + return FALSE; + + return TRUE; +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(boolean) +emit_restart (working_state * state, int restart_num) +{ + int ci; + + if (! flush_bits(state)) + return FALSE; + + emit_byte(state, 0xFF, return FALSE); + emit_byte(state, JPEG_RST0 + restart_num, return FALSE); + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < state->cinfo->comps_in_scan; ci++) + state->cur.last_dc_val[ci] = 0; + + /* The restart counter is not updated until we successfully write the MCU. */ + + return TRUE; +} + + +/* + * Encode and output one MCU's worth of Huffman-compressed coefficients. + */ + +METHODDEF(boolean) +encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + working_state state; + int blkn, ci; + jpeg_component_info * compptr; + + /* Load up working state */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! emit_restart(&state, entropy->next_restart_num)) + return FALSE; + } + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + if (! encode_one_block(&state, + MCU_data[blkn][0], state.cur.last_dc_val[ci], + entropy->dc_derived_tbls[compptr->dc_tbl_no], + entropy->ac_derived_tbls[compptr->ac_tbl_no])) + return FALSE; + /* Update last_dc_val */ + state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + /* Completed MCU, so update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + working_state state; + + /* Load up working state ... flush_bits needs it */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Flush out the last data */ + if (! flush_bits(&state)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); +} + + +/* + * Huffman coding optimization. + * + * We first scan the supplied data and count the number of uses of each symbol + * that is to be Huffman-coded. (This process MUST agree with the code above.) + * Then we build a Huffman coding tree for the observed counts. + * Symbols which are not needed at all for the particular image are not + * assigned any code, which saves space in the DHT marker as well as in + * the compressed data. + */ + +#ifdef ENTROPY_OPT_SUPPORTED + + +/* Process a single block's worth of coefficients */ + +LOCAL(void) +htest_one_block (j_compress_ptr cinfo, const JCOEFPTR block, int last_dc_val, + long dc_counts[], long ac_counts[]) +{ + register int temp; + register int nbits; + register int k, r; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = block[0] - last_dc_val; + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count the Huffman symbol for the number of bits */ + dc_counts[nbits]++; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k < DCTSIZE2; k++) { + if ((temp = block[jpeg_natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + ac_counts[0xF0]++; + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count Huffman symbol for run length / number of bits */ + ac_counts[(r << 4) + nbits]++; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + ac_counts[0]++; +} + + +/* + * Trial-encode one MCU's worth of Huffman-compressed coefficients. + * No data is actually output, so no suspension return is possible. + */ + +METHODDEF(boolean) +encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int blkn, ci; + jpeg_component_info * compptr; + + /* Take care of restart intervals if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Update restart state */ + entropy->restarts_to_go = cinfo->restart_interval; + } + entropy->restarts_to_go--; + } + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], + entropy->dc_count_ptrs[compptr->dc_tbl_no], + entropy->ac_count_ptrs[compptr->ac_tbl_no]); + entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + return TRUE; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int ci, dctbl, actbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did_dc[NUM_HUFF_TBLS]; + boolean did_ac[NUM_HUFF_TBLS]; + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did_dc, SIZEOF(did_dc)); + MEMZERO(did_ac, SIZEOF(did_ac)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + if (! did_dc[dctbl]) { + htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); + did_dc[dctbl] = TRUE; + } + if (! did_ac[actbl]) { + htblptr = & cinfo->ac_huff_tbl_ptrs[actbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]); + did_ac[actbl] = TRUE; + } + } +} + + +#endif /* ENTROPY_OPT_SUPPORTED */ + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_shuff_encoder (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy; + int i; + + entropy = (shuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(shuff_entropy_encoder)); + lossyc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + lossyc->pub.entropy_start_pass = start_pass_huff; + lossyc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; +#ifdef ENTROPY_OPT_SUPPORTED + entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg12/jctrans.c b/dcmjpeg/libijg12/jctrans.c new file mode 100644 index 00000000..711482de --- /dev/null +++ b/dcmjpeg/libijg12/jctrans.c @@ -0,0 +1,424 @@ +/* + * jctrans.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding compression, + * that is, writing raw DCT coefficient arrays to an output JPEG file. + * The routines in jcapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ + + +/* Forward declarations */ +LOCAL(void) transencode_master_selection + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); +LOCAL(void) transencode_codec + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); +LOCAL(void) transencode_coef_controller + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); + + +/* + * Compression initialization for writing raw-coefficient data. + * Before calling this, all parameters and a data destination must be set up. + * Call jpeg_finish_compress() to actually write the data. + * + * The number of passed virtual arrays must match cinfo->num_components. + * Note that the virtual arrays need not be filled or even realized at + * the time write_coefficients is called; indeed, if the virtual arrays + * were requested from this compression object's memory manager, they + * typically will be realized during this routine and filled afterwards. + */ + +GLOBAL(void) +jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Mark all tables to be written */ + jpeg_suppress_tables(cinfo, FALSE); + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + transencode_master_selection(cinfo, coef_arrays); + /* Wait for jpeg_finish_compress() call */ + cinfo->next_scanline = 0; /* so jpeg_write_marker works */ + cinfo->global_state = CSTATE_WRCOEFS; +} + + +/* + * Initialize the compression object with default parameters, + * then copy from the source object all parameters needed for lossless + * transcoding. Parameters that can be varied without loss (such as + * scan script and Huffman optimization) are left in their default states. + */ + +GLOBAL(void) +jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, + j_compress_ptr dstinfo) +{ + JQUANT_TBL ** qtblptr; + jpeg_component_info *incomp, *outcomp; + JQUANT_TBL *c_quant, *slot_quant; + int tblno, ci, coefi; + + /* Safety check to ensure start_compress not called yet. */ + if (dstinfo->global_state != CSTATE_START) + ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state); + /* Copy fundamental image dimensions */ + dstinfo->image_width = srcinfo->image_width; + dstinfo->image_height = srcinfo->image_height; + dstinfo->input_components = srcinfo->num_components; + dstinfo->in_color_space = srcinfo->jpeg_color_space; + /* Initialize all parameters to default values */ + jpeg_set_defaults(dstinfo); + /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. + * Fix it to get the right header markers for the image colorspace. + */ + jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); + dstinfo->data_precision = srcinfo->data_precision; + dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; + /* Copy the source's quantization tables. */ + for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { + if (srcinfo->quant_tbl_ptrs[tblno] != NULL) { + qtblptr = & dstinfo->quant_tbl_ptrs[tblno]; + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo); + MEMCOPY((*qtblptr)->quantval, + srcinfo->quant_tbl_ptrs[tblno]->quantval, + SIZEOF((*qtblptr)->quantval)); + (*qtblptr)->sent_table = FALSE; + } + } + /* Copy the source's per-component info. + * Note we assume jpeg_set_defaults has allocated the dest comp_info array. + */ + dstinfo->num_components = srcinfo->num_components; + if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS) + ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components, + MAX_COMPONENTS); + for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info; + ci < dstinfo->num_components; ci++, incomp++, outcomp++) { + outcomp->component_id = incomp->component_id; + outcomp->h_samp_factor = incomp->h_samp_factor; + outcomp->v_samp_factor = incomp->v_samp_factor; + outcomp->quant_tbl_no = incomp->quant_tbl_no; + /* Make sure saved quantization table for component matches the qtable + * slot. If not, the input file re-used this qtable slot. + * IJG encoder currently cannot duplicate this. + */ + tblno = outcomp->quant_tbl_no; + if (tblno < 0 || tblno >= NUM_QUANT_TBLS || + srcinfo->quant_tbl_ptrs[tblno] == NULL) + ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno); + slot_quant = srcinfo->quant_tbl_ptrs[tblno]; + c_quant = incomp->quant_table; + if (c_quant != NULL) { + for (coefi = 0; coefi < DCTSIZE2; coefi++) { + if (c_quant->quantval[coefi] != slot_quant->quantval[coefi]) + ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno); + } + } + /* Note: we do not copy the source's Huffman table assignments; + * instead we rely on jpeg_set_colorspace to have made a suitable choice. + */ + } + /* Also copy JFIF version and resolution information, if available. + * Strictly speaking this isn't "critical" info, but it's nearly + * always appropriate to copy it if available. In particular, + * if the application chooses to copy JFIF 1.02 extension markers from + * the source file, we need to copy the version to make sure we don't + * emit a file that has 1.02 extensions but a claimed version of 1.01. + * We will *not*, however, copy version info from mislabeled "2.01" files. + */ + if (srcinfo->saw_JFIF_marker) { + if (srcinfo->JFIF_major_version == 1) { + dstinfo->JFIF_major_version = srcinfo->JFIF_major_version; + dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version; + } + dstinfo->density_unit = srcinfo->density_unit; + dstinfo->X_density = srcinfo->X_density; + dstinfo->Y_density = srcinfo->Y_density; + } +} + + +/* + * Master selection of compression modules for transcoding. + * This substitutes for jcinit.c's initialization of the full compressor. + */ + +LOCAL(void) +transencode_master_selection (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + cinfo->data_unit = DCTSIZE; + /* Although we don't actually use input_components for transcoding, + * jcmaster.c's initial_setup will complain if input_components is 0. + */ + cinfo->input_components = 1; + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, TRUE /* transcode only */); + + /* We need a special compression codec. */ + transencode_codec(cinfo, coef_arrays); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI, JFIF) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} + + +/* + * The rest of this file is a special implementation of the coefficient + * buffer controller. This is similar to jccoefct.c, but it handles only + * output from presupplied virtual arrays. Furthermore, we generate any + * dummy padding blocks on-the-fly rather than expecting them to be present + * in the arrays. + */ + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* Virtual block array for each component. */ + jvirt_barray_ptr * whole_image; + + /* Workspace for constructing dummy blocks at right/bottom edges. */ + JBLOCKROW dummy_buffer[C_MAX_DATA_UNITS_IN_MCU]; +} c_coef_controller; + +typedef c_coef_controller * c_coef_ptr; + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + if (pass_mode != JBUF_CRANK_DEST) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); +} + + +/* + * Process some data. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, blockcnt; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW MCU_buffer[C_MAX_DATA_UNITS_IN_MCU]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * (JDIMENSION) compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yindex+yoffset < compptr->last_row_height) { + /* Fill in pointers to real blocks in this row */ + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < blockcnt; xindex++) + MCU_buffer[blkn++] = buffer_ptr++; + } else { + /* At bottom of image, need a whole row of dummy blocks */ + xindex = 0; + } + /* Fill in any dummy blocks needed in this row. + * Dummy blocks are filled in the same way as in jccoefct.c: + * all zeroes in the AC entries, DC entries equal to previous + * block's DC value. The init routine has already zeroed the + * AC entries, so we need only set the DC entries correctly. + */ + for (; xindex < compptr->MCU_width; xindex++) { + MCU_buffer[blkn] = coef->dummy_buffer[blkn]; + MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0]; + blkn++; + } + } + } + /* Try to write the MCU. */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +/* + * Initialize coefficient buffer controller. + * + * Each passed coefficient array must be the right size for that + * coefficient: width_in_data_units wide and height_in_data_units high, + * with unitheight at least v_samp_factor. + */ + +LOCAL(void) +transencode_coef_controller (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef; + JBLOCKROW buffer; + int i; + + coef = (c_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_coef_controller)); + lossyc->coef_private = (struct jpeg_c_coef_controller *) coef; + + /* Save pointer to virtual arrays */ + coef->whole_image = coef_arrays; + + /* Allocate and pre-zero space for dummy DCT blocks. */ + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + jzero_far((void FAR *) buffer, C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_DATA_UNITS_IN_MCU; i++) { + coef->dummy_buffer[i] = buffer + i; + } +} + + +/* + * Initialize the transencoer codec. + * This is called only once, during master selection. + */ + +LOCAL(void) +transencode_codec (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + j_lossy_c_ptr lossyc; + + /* Create subobject in permanent pool */ + lossyc = (j_lossy_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) lossyc; + + /* Initialize sub-modules */ + + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + jinit_phuff_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_encoder(cinfo); + } + + /* We need a special coefficient buffer controller. */ + transencode_coef_controller(cinfo, coef_arrays); + + /* Initialize method pointers */ + lossyc->pub.start_pass = start_pass_coef; + lossyc->pub.compress_data = compress_output; +} diff --git a/dcmjpeg/libijg12/jdapimin.c b/dcmjpeg/libijg12/jdapimin.c new file mode 100644 index 00000000..ee8cfa14 --- /dev/null +++ b/dcmjpeg/libijg12/jdapimin.c @@ -0,0 +1,401 @@ +/* + * jdapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-decompression case or the + * transcoding-only case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jdapistd.c. But also see jcomapi.c for routines + * shared by compression and decompression, and jdtrans.c for the transcoding + * case. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Initialization of a JPEG decompression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_decompress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = TRUE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->src = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) + cinfo->quant_tbl_ptrs[i] = NULL; + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + /* Initialize marker processor so application can override methods + * for COM, APPn markers before calling jpeg_read_header. + */ + cinfo->marker_list = NULL; + jinit_marker_reader(cinfo); + + /* And initialize the overall input controller. */ + jinit_input_controller(cinfo); + + /* OK, I'm ready */ + cinfo->global_state = DSTATE_START; +} + + +/* + * Destruction of a JPEG decompression object + */ + +GLOBAL(void) +jpeg_destroy_decompress (j_decompress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG decompression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_decompress (j_decompress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Set default decompression parameters. + */ + +LOCAL(void) +default_decompress_parms (j_decompress_ptr cinfo) +{ + /* Guess the input colorspace, and set output colorspace accordingly. */ + /* (Wish JPEG committee had provided a real way to specify this...) */ + /* Note application may override our guesses. */ + switch (cinfo->num_components) { + case 1: + cinfo->jpeg_color_space = JCS_GRAYSCALE; + cinfo->out_color_space = JCS_GRAYSCALE; + break; + + case 3: + if (cinfo->saw_JFIF_marker) { + cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ + } else if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_RGB; + break; + case 1: + cinfo->jpeg_color_space = JCS_YCbCr; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + break; + } + } else { + /* Saw no special markers, try to guess from the component IDs */ + int cid0 = cinfo->comp_info[0].component_id; + int cid1 = cinfo->comp_info[1].component_id; + int cid2 = cinfo->comp_info[2].component_id; + + if (cid0 == 1 && cid1 == 2 && cid2 == 3) + cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ + else if (cid0 == 82 && cid1 == 71 && cid2 == 66) + cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ + else { + if (cinfo->process == JPROC_LOSSLESS) { + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_LOSSLESS_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_RGB; /* assume it's RGB */ + } + else { /* Lossy processes */ + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_LOSSY_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + } + } + } + /* Always guess RGB is proper output colorspace. */ + cinfo->out_color_space = JCS_RGB; + break; + + case 4: + if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_CMYK; + break; + case 2: + cinfo->jpeg_color_space = JCS_YCCK; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ + break; + } + } else { + /* No special markers, assume straight CMYK. */ + cinfo->jpeg_color_space = JCS_CMYK; + } + cinfo->out_color_space = JCS_CMYK; + break; + + default: + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->out_color_space = JCS_UNKNOWN; + break; + } + + /* Set defaults for other decompression parameters. */ + cinfo->scale_num = 1; /* 1:1 scaling */ + cinfo->scale_denom = 1; + cinfo->output_gamma = 1.0; + cinfo->buffered_image = FALSE; + cinfo->raw_data_out = FALSE; + cinfo->dct_method = JDCT_DEFAULT; + cinfo->do_fancy_upsampling = TRUE; + cinfo->do_block_smoothing = TRUE; + cinfo->quantize_colors = FALSE; + /* We set these in case application only sets quantize_colors. */ + cinfo->dither_mode = JDITHER_FS; +#ifdef QUANT_2PASS_SUPPORTED + cinfo->two_pass_quantize = TRUE; +#else + cinfo->two_pass_quantize = FALSE; +#endif + cinfo->desired_number_of_colors = 256; + cinfo->colormap = NULL; + /* Initialize for no mode change in buffered-image mode. */ + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; +} + + +/* + * Decompression startup: read start of JPEG datastream to see what's there. + * Need only initialize JPEG object and supply a data source before calling. + * + * This routine will read as far as the first SOS marker (ie, actual start of + * compressed data), and will save all tables and parameters in the JPEG + * object. It will also initialize the decompression parameters to default + * values, and finally return JPEG_HEADER_OK. On return, the application may + * adjust the decompression parameters and then call jpeg_start_decompress. + * (Or, if the application only wanted to determine the image parameters, + * the data need not be decompressed. In that case, call jpeg_abort or + * jpeg_destroy to release any temporary space.) + * If an abbreviated (tables only) datastream is presented, the routine will + * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then + * re-use the JPEG object to read the abbreviated image datastream(s). + * It is unnecessary (but OK) to call jpeg_abort in this case. + * The JPEG_SUSPENDED return code only occurs if the data source module + * requests suspension of the decompressor. In this case the application + * should load more source data and then re-call jpeg_read_header to resume + * processing. + * If a non-suspending data source is used and require_image is TRUE, then the + * return code need not be inspected since only JPEG_HEADER_OK is possible. + * + * This routine is now just a front end to jpeg_consume_input, with some + * extra error checking. + */ + +GLOBAL(int) +jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) +{ + int retcode; + + if (cinfo->global_state != DSTATE_START && + cinfo->global_state != DSTATE_INHEADER) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + retcode = jpeg_consume_input(cinfo); + + switch (retcode) { + case JPEG_REACHED_SOS: + retcode = JPEG_HEADER_OK; + break; + case JPEG_REACHED_EOI: + if (require_image) /* Complain if application wanted an image */ + ERREXIT(cinfo, JERR_NO_IMAGE); + /* Reset to start state; it would be safer to require the application to + * call jpeg_abort, but we can't change it now for compatibility reasons. + * A side effect is to free any temporary memory (there shouldn't be any). + */ + jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */ + retcode = JPEG_HEADER_TABLES_ONLY; + break; + case JPEG_SUSPENDED: + /* no work */ + break; + } + + return retcode; +} + + +/* + * Consume data in advance of what the decompressor requires. + * This can be called at any time once the decompressor object has + * been created and a data source has been set up. + * + * This routine is essentially a state machine that handles a couple + * of critical state-transition actions, namely initial setup and + * transition from header scanning to ready-for-start_decompress. + * All the actual input is done via the input controller's consume_input + * method. + */ + +GLOBAL(int) +jpeg_consume_input (j_decompress_ptr cinfo) +{ + int retcode = JPEG_SUSPENDED; + + /* NB: every possible DSTATE value should be listed in this switch */ + switch (cinfo->global_state) { + case DSTATE_START: + /* Start-of-datastream actions: reset appropriate modules */ + (*cinfo->inputctl->reset_input_controller) (cinfo); + /* Initialize application's data source module */ + (*cinfo->src->init_source) (cinfo); + cinfo->global_state = DSTATE_INHEADER; + /*FALLTHROUGH*/ + case DSTATE_INHEADER: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ + /* Set up default parameters based on header data */ + default_decompress_parms(cinfo); + /* Set global state: ready for start_decompress */ + cinfo->global_state = DSTATE_READY; + } + break; + case DSTATE_READY: + /* Can't advance past first SOS until start_decompress is called */ + retcode = JPEG_REACHED_SOS; + break; + case DSTATE_PRELOAD: + case DSTATE_PRESCAN: + case DSTATE_SCANNING: + case DSTATE_RAW_OK: + case DSTATE_BUFIMAGE: + case DSTATE_BUFPOST: + case DSTATE_STOPPING: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + break; + default: + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + return retcode; +} + + +/* + * Have we finished reading the input file? + */ + +GLOBAL(boolean) +jpeg_input_complete (j_decompress_ptr cinfo) +{ + /* Check for valid jpeg object */ + if (cinfo->global_state < DSTATE_START || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->eoi_reached; +} + + +/* + * Is there more than one scan? + */ + +GLOBAL(boolean) +jpeg_has_multiple_scans (j_decompress_ptr cinfo) +{ + /* Only valid after jpeg_read_header completes */ + if (cinfo->global_state < DSTATE_READY || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->has_multiple_scans; +} + + +/* + * Finish JPEG decompression. + * + * This will normally just verify the file trailer and release temp storage. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_decompress (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) { + /* Terminate final pass of non-buffered mode */ + if (cinfo->output_scanline < cinfo->output_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state == DSTATE_BUFIMAGE) { + /* Finishing after a buffered-image operation */ + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state != DSTATE_STOPPING) { + /* STOPPING = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read until EOI */ + while (! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + /* Do final cleanup */ + (*cinfo->src->term_source) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); + return TRUE; +} diff --git a/dcmjpeg/libijg12/jdapistd.c b/dcmjpeg/libijg12/jdapistd.c new file mode 100644 index 00000000..faa2dd7d --- /dev/null +++ b/dcmjpeg/libijg12/jdapistd.c @@ -0,0 +1,275 @@ +/* + * jdapistd.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-decompression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_decompress, it will end up linking in the entire decompressor. + * We thus must separate this file from jdapimin.c to avoid linking the + * whole decompression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Forward declarations */ +LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo)); + + +/* + * Decompression initialization. + * jpeg_read_header must be completed before calling this. + * + * If a multipass operating mode was selected, this will do all but the + * last pass, and thus may take a great deal of time. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_start_decompress (j_decompress_ptr cinfo) +{ + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize master control, select active modules */ + jinit_master_decompress(cinfo); + if (cinfo->buffered_image) { + /* No more work here; expecting jpeg_start_output next */ + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; + } + cinfo->global_state = DSTATE_PRELOAD; + } + if (cinfo->global_state == DSTATE_PRELOAD) { + /* If file has multiple scans, absorb them all into the coef buffer */ + if (cinfo->inputctl->has_multiple_scans) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return FALSE; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* jdmaster underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + } + cinfo->output_scan_number = cinfo->input_scan_number; + } else if (cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any dummy output passes, and set up for the final pass */ + return output_pass_setup(cinfo); +} + + +/* + * Set up for an output pass, and perform any dummy pass(es) needed. + * Common subroutine for jpeg_start_decompress and jpeg_start_output. + * Entry: global_state = DSTATE_PRESCAN only if previously suspended. + * Exit: If done, returns TRUE and sets global_state for proper output mode. + * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. + */ + +LOCAL(boolean) +output_pass_setup (j_decompress_ptr cinfo) +{ + if (cinfo->global_state != DSTATE_PRESCAN) { + /* First call: do pass setup */ + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; + cinfo->global_state = DSTATE_PRESCAN; + } + /* Loop over any required dummy passes */ + while (cinfo->master->is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Crank through the dummy pass */ + while (cinfo->output_scanline < cinfo->output_height) { + JDIMENSION last_scanline; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* Process some data */ + last_scanline = cinfo->output_scanline; + (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL, + &cinfo->output_scanline, (JDIMENSION) 0); + if (cinfo->output_scanline == last_scanline) + return FALSE; /* No progress made, must suspend */ + } + /* Finish up dummy pass, and set up for another one */ + (*cinfo->master->finish_output_pass) (cinfo); + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } + /* Ready for application to drive output pass through + * jpeg_read_scanlines or jpeg_read_raw_data. + */ + cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING; + return TRUE; +} + + +/* + * Read some scanlines of data from the JPEG decompressor. + * + * The return value will be the number of lines actually read. + * This may be less than the number requested in several cases, + * including bottom of image, data source suspension, and operating + * modes that emit multiple scanlines at a time. + * + * Note: we warn about excess calls to jpeg_read_scanlines() since + * this likely signals an application programmer error. However, + * an oversize buffer (max_lines > scanlines remaining) is not an error. + */ + +GLOBAL(JDIMENSION) +jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION max_lines) +{ + JDIMENSION row_ctr; + + if (cinfo->global_state != DSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Process some data */ + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines); + cinfo->output_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to read raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION max_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != DSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Verify that at least one iMCU row can be returned. */ + lines_per_iMCU_row = (JDIMENSION)(cinfo->max_v_samp_factor * cinfo->min_codec_data_unit); + if (max_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Decompress directly into user's buffer. */ + if (! (*cinfo->codec->decompress_data) (cinfo, data)) + return 0; /* suspension forced, can do nothing more */ + + /* OK, we processed one iMCU row. */ + cinfo->output_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} + + +/* Additional entry points for buffered-image mode. */ + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Initialize for an output pass in buffered-image mode. + */ + +GLOBAL(boolean) +jpeg_start_output (j_decompress_ptr cinfo, int scan_number) +{ + if (cinfo->global_state != DSTATE_BUFIMAGE && + cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Limit scan number to valid range */ + if (scan_number <= 0) + scan_number = 1; + if (cinfo->inputctl->eoi_reached && + scan_number > cinfo->input_scan_number) + scan_number = cinfo->input_scan_number; + cinfo->output_scan_number = scan_number; + /* Perform any dummy output passes, and set up for the real pass */ + return output_pass_setup(cinfo); +} + + +/* + * Finish up after an output pass in buffered-image mode. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_output (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) { + /* Terminate this pass. */ + /* We do not require the whole pass to have been completed. */ + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_BUFPOST; + } else if (cinfo->global_state != DSTATE_BUFPOST) { + /* BUFPOST = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read markers looking for SOS or EOI */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jdarith.c b/dcmjpeg/libijg12/jdarith.c new file mode 100644 index 00000000..b7e6f090 --- /dev/null +++ b/dcmjpeg/libijg12/jdarith.c @@ -0,0 +1,26 @@ +/* + * jdarith.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy decoding routines. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * Module initialization routine for arithmetic entropy decoding. + */ +GLOBAL(void) +jinit_arith_decoder (j_decompress_ptr cinfo); + +GLOBAL(void) +jinit_arith_decoder (j_decompress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +} diff --git a/dcmjpeg/libijg12/jdatadst.c b/dcmjpeg/libijg12/jdatadst.c new file mode 100644 index 00000000..0db49910 --- /dev/null +++ b/dcmjpeg/libijg12/jdatadst.c @@ -0,0 +1,151 @@ +/* + * jdatadst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains compression data destination routines for the case of + * emitting JPEG data to a file (or any stdio stream). While these routines + * are sufficient for most applications, some will want to use a different + * destination manager. + * IMPORTANT: we assume that fwrite() will correctly transcribe an array of + * JOCTETs into 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jerror12.h" + + +/* Expanded data destination object for stdio output */ + +typedef struct { + struct jpeg_destination_mgr pub; /* public fields */ + + FILE * outfile; /* target stream */ + JOCTET * buffer; /* start of buffer */ +} my_destination_mgr; + +typedef my_destination_mgr * my_dest_ptr; + +#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ + + +/* + * Initialize destination --- called by jpeg_start_compress + * before any data is actually written. + */ + +METHODDEF(void) +init_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + /* Allocate the output buffer --- it will be released when done with image */ + dest->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; +} + + +/* + * Empty the output buffer --- called whenever buffer fills up. + * + * In typical applications, this should write the entire output buffer + * (ignoring the current state of next_output_byte & free_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been dumped. + * + * In applications that need to be able to suspend compression due to output + * overrun, a FALSE return indicates that the buffer cannot be emptied now. + * In this situation, the compressor will return to its caller (possibly with + * an indication that it has not accepted all the supplied scanlines). The + * application should resume compression after it has made more room in the + * output buffer. Note that there are substantial restrictions on the use of + * suspension --- see the documentation. + * + * When suspending, the compressor will back up to a convenient restart point + * (typically the start of the current MCU). next_output_byte & free_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point will be regenerated after resumption, so do not + * write it out when emptying the buffer externally. + */ + +METHODDEF(boolean) +empty_output_buffer (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) != + (size_t) OUTPUT_BUF_SIZE) + ERREXIT(cinfo, JERR_FILE_WRITE); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; + + return TRUE; +} + + +/* + * Terminate destination --- called by jpeg_finish_compress + * after all data has been written. Usually needs to flush buffer. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; + + /* Write any data remaining in the buffer */ + if (datacount > 0) { + if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount) + ERREXIT(cinfo, JERR_FILE_WRITE); + } + fflush(dest->outfile); + /* Make sure we wrote the output file OK */ + if (ferror(dest->outfile)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * Prepare for output to a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing compression. + */ + +GLOBAL(void) +jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) +{ + my_dest_ptr dest; + + /* The destination object is made permanent so that multiple JPEG images + * can be written to the same file without re-executing jpeg_stdio_dest. + * This makes it dangerous to use this manager and a different destination + * manager serially with the same JPEG object, because their private object + * sizes may be different. Caveat programmer. + */ + if (cinfo->dest == NULL) { /* first time for this JPEG object? */ + cinfo->dest = (struct jpeg_destination_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_destination_mgr)); + } + + dest = (my_dest_ptr) cinfo->dest; + dest->pub.init_destination = init_destination; + dest->pub.empty_output_buffer = empty_output_buffer; + dest->pub.term_destination = term_destination; + dest->outfile = outfile; +} diff --git a/dcmjpeg/libijg12/jdatasrc.c b/dcmjpeg/libijg12/jdatasrc.c new file mode 100644 index 00000000..f4d03dbb --- /dev/null +++ b/dcmjpeg/libijg12/jdatasrc.c @@ -0,0 +1,212 @@ +/* + * jdatasrc.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains decompression data source routines for the case of + * reading JPEG data from a file (or any stdio stream). While these routines + * are sufficient for most applications, some will want to use a different + * source manager. + * IMPORTANT: we assume that fread() will correctly transcribe an array of + * JOCTETs from 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jerror12.h" + + +/* Expanded data source object for stdio input */ + +typedef struct { + struct jpeg_source_mgr pub; /* public fields */ + + FILE * infile; /* source stream */ + JOCTET * buffer; /* start of buffer */ + boolean start_of_file; /* have we gotten any data yet? */ +} my_source_mgr; + +typedef my_source_mgr * my_src_ptr; + +#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ + + +/* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ + +METHODDEF(void) +init_source (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_file = TRUE; +} + + +/* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. + */ + +METHODDEF(boolean) +fill_input_buffer (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + size_t nbytes; + + nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE); + + if (nbytes <= 0) { + if (src->start_of_file) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_file = FALSE; + + return TRUE; +} + + +/* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ + +METHODDEF(void) +skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) { + while (num_bytes > (long) src->pub.bytes_in_buffer) { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } +} + + +/* + * An additional method that can be provided by data source modules is the + * resync_to_restart method for error recovery in the presence of RST markers. + * For the moment, this source module just uses the default resync method + * provided by the JPEG library. That method assumes that no backtracking + * is possible. + */ + + +/* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Prepare for input from a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + +GLOBAL(void) +jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) +{ + my_src_ptr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling jpeg_stdio_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_source_mgr)); + src = (my_src_ptr) cinfo->src; + src->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + INPUT_BUF_SIZE * SIZEOF(JOCTET)); + } + + src = (my_src_ptr) cinfo->src; + src->pub.init_source = init_source; + src->pub.fill_input_buffer = fill_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = term_source; + src->infile = infile; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} diff --git a/dcmjpeg/libijg12/jdcoefct.c b/dcmjpeg/libijg12/jdcoefct.c new file mode 100644 index 00000000..7e4208d2 --- /dev/null +++ b/dcmjpeg/libijg12/jdcoefct.c @@ -0,0 +1,743 @@ +/* + * jdcoefct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for decompression. + * This controller is the top level of the lossy JPEG decompressor proper. + * The coefficient buffer lies between entropy decoding and inverse-DCT steps. + * + * In buffered-image mode, this controller is the interface between + * input-oriented processing and output-oriented processing. + * Also, the input side (only) is used when reading a file for transcoding. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" + +/* Block smoothing is only applicable for progressive JPEG, so: */ +#ifndef D_PROGRESSIVE_SUPPORTED +#undef BLOCK_SMOOTHING_SUPPORTED +#endif + +/* Private buffer controller object */ + +typedef struct { + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + /* In single-pass modes, it's sufficient to buffer just one MCU. + * We allocate a workspace of D_MAX_DATA_UNITS_IN_MCU coefficient blocks, + * and let the entropy decoder write into that workspace each time. + * (On 80x86, the workspace is FAR even though it's not really very big; + * this is to keep the module interfaces unchanged when a large coefficient + * buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays; it is used only by the input side. + */ + JBLOCKROW MCU_buffer[D_MAX_DATA_UNITS_IN_MCU]; + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +#endif + +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* When doing block smoothing, we latch coefficient Al values here */ + int * coef_bits_latch; +#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ +#endif +} d_coef_controller; + +typedef d_coef_controller * d_coef_ptr; + +/* Forward declarations */ +METHODDEF(int) decompress_onepass + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#ifdef D_MULTISCAN_FILES_SUPPORTED +METHODDEF(int) decompress_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif +#ifdef BLOCK_SMOOTHING_SUPPORTED +LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo)); +METHODDEF(int) decompress_smooth_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->MCU_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + cinfo->input_iMCU_row = 0; + start_iMCU_row(cinfo); +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ +#ifdef BLOCK_SMOOTHING_SUPPORTED + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + /* d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; */ + + /* If multipass, check to see whether to use block smoothing on this pass */ + if (lossyd->coef_arrays != NULL) { + if (cinfo->do_block_smoothing && smoothing_ok(cinfo)) + lossyd->pub.decompress_data = decompress_smooth_data; + else + lossyd->pub.decompress_data = decompress_data; + } +#endif + cinfo->output_iMCU_row = 0; +} + + +/* + * Decompress and return some data in the single-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Input and output must run in lockstep since we have only a one-MCU buffer. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(int) +decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, useful_width; + JSAMPARRAY output_ptr; + JDIMENSION start_col, output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Loop to process as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */ + jzero_far((void FAR *) coef->MCU_buffer[0], + (size_t)cinfo->data_units_in_MCU * SIZEOF(JBLOCK)); + if (! (*lossyd->entropy_decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + /* Determine where data should go in output_buf and do the IDCT thing. + * We skip dummy blocks at the right and bottom edges (but blkn gets + * incremented past them!). Note the inner loop relies on having + * allocated the MCU_buffer[] blocks sequentially. + */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) { + blkn += compptr->MCU_data_units; + continue; + } + inverse_DCT = lossyd->inverse_DCT[compptr->component_index]; + useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + output_ptr = output_buf[compptr->component_index] + + yoffset * compptr->codec_data_unit; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_sample_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (cinfo->input_iMCU_row < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + output_col = start_col; + for (xindex = 0; xindex < useful_width; xindex++) { + (*inverse_DCT) (cinfo, compptr, + (JCOEFPTR) coef->MCU_buffer[blkn+xindex], + output_ptr, output_col); + output_col += (JDIMENSION)compptr->codec_data_unit; + } + } + blkn += compptr->MCU_width; + output_ptr += compptr->codec_data_unit; + } + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + cinfo->output_iMCU_row++; + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Dummy consume-input routine for single-pass operation. + */ + +METHODDEF(int) +dummy_consume_data (j_decompress_ptr cinfo) +{ + return JPEG_SUSPENDED; /* Always indicate nothing was done */ +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Consume input data and store it in the full-image coefficient buffer. + * We read as much as one fully interleaved MCU row ("iMCU" row) per call, + * ie, v_samp_factor block rows for each component in the scan. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + */ + +METHODDEF(int) +consume_data (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + cinfo->input_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + /* Note: entropy decoder expects buffer to be zeroed, + * but this is handled automatically by the memory manager + * because we requested a pre-zeroed array. + */ + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to fetch the MCU. */ + if (! (*lossyd->entropy_decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Decompress and return some data in the multi-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image. + */ + +METHODDEF(int) +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num; + int ci, block_row, block_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number < cinfo->output_scan_number || + (cinfo->input_scan_number == cinfo->output_scan_number && + cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + cinfo->output_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + inverse_DCT = lossyd->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + output_col = 0; + for (block_num = 0; block_num < compptr->width_in_data_units; block_num++) { + (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr, + output_ptr, output_col); + buffer_ptr++; + output_col += (JDIMENSION)compptr->codec_data_unit; + } + output_ptr += compptr->codec_data_unit; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +#ifdef BLOCK_SMOOTHING_SUPPORTED + +/* + * This code applies interblock smoothing as described by section K.8 + * of the JPEG standard: the first 5 AC coefficients are estimated from + * the DC values of a DCT block and its 8 neighboring blocks. + * We apply smoothing only for progressive JPEG decoding, and only if + * the coefficients it can estimate are not yet known to full precision. + */ + +/* Natural-order array positions of the first 5 zigzag-order coefficients */ +#define Q01_POS 1 +#define Q10_POS 8 +#define Q20_POS 16 +#define Q11_POS 9 +#define Q02_POS 2 + +/* + * Determine whether block smoothing is applicable and safe. + * We also latch the current states of the coef_bits[] entries for the + * AC coefficients; otherwise, if the input side of the decompressor + * advances into a new scan, we might think the coefficients are known + * more accurately than they really are. + */ + +LOCAL(boolean) +smoothing_ok (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + boolean smoothing_useful = FALSE; + int ci, coefi; + jpeg_component_info *compptr; + JQUANT_TBL * qtable; + int * coef_bits; + int * coef_bits_latch; + + if ((! (cinfo->process == JPROC_PROGRESSIVE)) || cinfo->coef_bits == NULL) + return FALSE; + + /* Allocate latch area if not already done */ + if (coef->coef_bits_latch == NULL) + coef->coef_bits_latch = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * + (SAVED_COEFS * SIZEOF(int))); + coef_bits_latch = coef->coef_bits_latch; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* All components' quantization values must already be latched. */ + if ((qtable = compptr->quant_table) == NULL) + return FALSE; + /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */ + if (qtable->quantval[0] == 0 || + qtable->quantval[Q01_POS] == 0 || + qtable->quantval[Q10_POS] == 0 || + qtable->quantval[Q20_POS] == 0 || + qtable->quantval[Q11_POS] == 0 || + qtable->quantval[Q02_POS] == 0) + return FALSE; + /* DC values must be at least partly known for all components. */ + coef_bits = cinfo->coef_bits[ci]; + if (coef_bits[0] < 0) + return FALSE; + /* Block smoothing is helpful if some AC coefficients remain inaccurate. */ + for (coefi = 1; coefi <= 5; coefi++) { + coef_bits_latch[coefi] = coef_bits[coefi]; + if (coef_bits[coefi] != 0) + smoothing_useful = TRUE; + } + coef_bits_latch += SAVED_COEFS; + } + + return smoothing_useful; +} + + +/* + * Variant of decompress_data for use when doing block smoothing. + */ + +METHODDEF(int) +decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num, last_block_column; + int ci, block_row, block_rows, access_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr, prev_block_row, next_block_row; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + boolean first_row, last_row; + JBLOCK workspace; + int *coef_bits; + JQUANT_TBL *quanttbl; + IJG_INT32 Q00,Q01,Q02,Q10,Q11,Q20, num; + int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9; + int Al, pred; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if (cinfo->input_scan_number == cinfo->output_scan_number) { + /* If input is working on current scan, we ordinarily want it to + * have completed the current row. But if input scan is DC, + * we want it to keep one row ahead so that next block row's DC + * values are up to date. + */ + JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0; + if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta) + break; + } + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) { + block_rows = compptr->v_samp_factor; + access_rows = block_rows * 2; /* this and next iMCU row */ + last_row = FALSE; + } else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + access_rows = block_rows; /* this iMCU row only */ + last_row = TRUE; + } + /* Align the virtual buffer for this component. */ + if (cinfo->output_iMCU_row > 0) { + access_rows += compptr->v_samp_factor; /* prior iMCU row too */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (cinfo->output_iMCU_row - 1) * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) access_rows, FALSE); + buffer += compptr->v_samp_factor; /* point to current iMCU row */ + first_row = FALSE; + } else { + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE); + first_row = TRUE; + } + /* Fetch component-dependent info */ + coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS); + quanttbl = compptr->quant_table; + Q00 = quanttbl->quantval[0]; + Q01 = quanttbl->quantval[Q01_POS]; + Q10 = quanttbl->quantval[Q10_POS]; + Q20 = quanttbl->quantval[Q20_POS]; + Q11 = quanttbl->quantval[Q11_POS]; + Q02 = quanttbl->quantval[Q02_POS]; + inverse_DCT = lossyd->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + if (first_row && block_row == 0) + prev_block_row = buffer_ptr; + else + prev_block_row = buffer[block_row-1]; + if (last_row && block_row == block_rows-1) + next_block_row = buffer_ptr; + else + next_block_row = buffer[block_row+1]; + /* We fetch the surrounding DC values using a sliding-register approach. + * Initialize all nine here so as to do the right thing on narrow pics. + */ + DC1 = DC2 = DC3 = (int) prev_block_row[0][0]; + DC4 = DC5 = DC6 = (int) buffer_ptr[0][0]; + DC7 = DC8 = DC9 = (int) next_block_row[0][0]; + output_col = 0; + last_block_column = compptr->width_in_data_units - 1; + for (block_num = 0; block_num <= last_block_column; block_num++) { + /* Fetch current DCT block into workspace so we can modify it. */ + jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1); + /* Update DC values */ + if (block_num < last_block_column) { + DC3 = (int) prev_block_row[1][0]; + DC6 = (int) buffer_ptr[1][0]; + DC9 = (int) next_block_row[1][0]; + } + /* Compute coefficient estimates per K.8. + * An estimate is applied only if coefficient is still zero, + * and is not known to be fully accurate. + */ + /* AC01 */ + if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { + num = 36 * Q00 * (DC4 - DC6); + if (num >= 0) { + pred = (int) (((Q01<<7) + num) / (Q01<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q10<<7) + num) / (Q10<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q20<<7) + num) / (Q20<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q11<<7) + num) / (Q11<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q02<<7) + num) / (Q02<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<codec_data_unit; + } + output_ptr += compptr->codec_data_unit; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* BLOCK_SMOOTHING_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef; + + coef = (d_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_coef_controller)); + lossyd->coef_private = (void *) coef; + lossyd->coef_start_input_pass = start_input_pass; + lossyd->coef_start_output_pass = start_output_pass; +#ifdef BLOCK_SMOOTHING_SUPPORTED + coef->coef_bits_latch = NULL; +#endif + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + /* Note we ask for a pre-zeroed array. */ + int ci, access_rows; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + access_rows = compptr->v_samp_factor; +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* If block smoothing could be used, need a bigger window */ + if (cinfo->process == JPROC_PROGRESSIVE) + access_rows *= 3; +#endif + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) access_rows); + } + lossyd->pub.consume_data = consume_data; + lossyd->pub.decompress_data = decompress_data; + lossyd->coef_arrays = coef->whole_image; /* link to virtual arrays */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + D_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < D_MAX_DATA_UNITS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + lossyd->pub.consume_data = dummy_consume_data; + lossyd->pub.decompress_data = decompress_onepass; + lossyd->coef_arrays = NULL; /* flag for no virtual arrays */ + } +} diff --git a/dcmjpeg/libijg12/jdcolor.c b/dcmjpeg/libijg12/jdcolor.c new file mode 100644 index 00000000..4ab46e4e --- /dev/null +++ b/dcmjpeg/libijg12/jdcolor.c @@ -0,0 +1,413 @@ +/* + * jdcolor.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains output colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_deconverter pub; /* public fields */ + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + IJG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + IJG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ +} my_color_deconverter; + +typedef my_color_deconverter * my_cconvert_ptr; + + +/**************** YCbCr -> RGB conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb + * where Cb and Cr represent the incoming values less CENTERJSAMPLE. + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * Notice that Y, being an integral input, does not contribute any fraction + * so it need not participate in the rounding. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times Cb and Cr for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The Cr=>R and Cb=>B values can be rounded to integers in advance; the + * values for the G calculation are left scaled up, since we must add them + * together before rounding. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L<RGB colorspace conversion. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + int i; + IJG_INT32 x; +#if BITS_IN_JSAMPLE == 16 + /* no need for temporaries */ +#else + SHIFT_TEMPS +#endif + + cconvert->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cr_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + cconvert->Cb_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + +#if BITS_IN_JSAMPLE == 16 + /* Bug fix 2001-11-06 by Eichelberg: The integer routines below + produce an overflow when used with MAXJSAMPLE == 65535. + Use floating point calculation instead. */ + + /* Cr=>R value is nearest int to 1.40200 * x */ + cconvert->Cr_r_tab[i] = (int)(1.40200 * (double)x + 0.5); + /* Cb=>B value is nearest int to 1.77200 * x */ + cconvert->Cb_b_tab[i] = (int)(1.77200 * (double)x + 0.5); +#else + /* Cr=>R value is nearest int to 1.40200 * x */ + cconvert->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + cconvert->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); +#endif + + /* Cr=>G value is scaled-up -0.71414 * x */ + cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Convert some rows of samples to the output colorspace. + * + * Note that we change from noninterleaved, one-plane-per-component format + * to interleaved-pixel format. The output buffer is therefore three times + * as wide as the input buffer. + * A starting row offset is provided only for the input buffer. The caller + * can easily adjust the passed output_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +ycc_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register IJG_INT32 * Crgtab = cconvert->Cr_g_tab; + register IJG_INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; + outptr[RGB_GREEN] = range_limit[y + + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS))]; + outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/**************** Cases other than YCbCr -> RGB **************/ + + +/* + * Color conversion for no colorspace change: just copy the data, + * converting from separate-planes to interleaved representation. + */ + +METHODDEF(void) +null_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW inptr, outptr; + register JDIMENSION count; + register int num_components = cinfo->num_components; + JDIMENSION num_cols = cinfo->output_width; + int ci; + + while (--num_rows >= 0) { + for (ci = 0; ci < num_components; ci++) { + inptr = input_buf[ci][input_row]; + outptr = output_buf[0] + ci; + for (count = num_cols; count > 0; count--) { + *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ + outptr += num_components; + } + } + input_row++; + output_buf++; + } +} + + +/* + * Color conversion for grayscale: just copy the data. + * This also works for YCbCr -> grayscale conversion, in which + * we just copy the Y (luminance) component and ignore chrominance. + */ + +METHODDEF(void) +grayscale_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0, + num_rows, cinfo->output_width); +} + + +/* + * Convert grayscale to RGB: just duplicate the graylevel three times. + * This is provided to support applications that don't want to cope + * with grayscale as a separate case. + */ + +METHODDEF(void) +gray_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW inptr, outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr = input_buf[0][input_row++]; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + /* We can dispense with GETJSAMPLE() here */ + outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Adobe-style YCCK->CMYK conversion. + * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same + * conversion as above, while passing K (black) unchanged. + * We assume build_ycc_rgb_table has been called. + */ + +METHODDEF(void) +ycck_cmyk_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2, inptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register IJG_INT32 * Crgtab = cconvert->Cr_g_tab; + register IJG_INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + inptr3 = input_buf[3][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */ + outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */ + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS)))]; + outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */ + /* K passes through unchanged */ + outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */ + outptr += 4; + } + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +start_pass_dcolor (j_decompress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for output colorspace conversion. + */ + +GLOBAL(void) +jinit_color_deconverter (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + int ci; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_deconverter)); + cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert; + cconvert->pub.start_pass = start_pass_dcolor; + + /* Make sure num_components agrees with jpeg_color_space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_RGB: + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->num_components < 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + } + + /* Set out_color_components and conversion method based on requested space. + * Also clear the component_needed flags for any unused components, + * so that earlier pipeline stages can avoid useless computation. + */ + + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + if (cinfo->jpeg_color_space == JCS_GRAYSCALE || + cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = grayscale_convert; + /* For color->grayscale conversion, only the Y (0) component is needed */ + for (ci = 1; ci < cinfo->num_components; ci++) + cinfo->comp_info[ci].component_needed = FALSE; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + cinfo->out_color_components = RGB_PIXELSIZE; + if (cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = ycc_rgb_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) { + cconvert->pub.color_convert = gray_rgb_convert; + } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) { + cconvert->pub.color_convert = null_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + cinfo->out_color_components = 4; + if (cinfo->jpeg_color_space == JCS_YCCK) { + cconvert->pub.color_convert = ycck_cmyk_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_CMYK) { + cconvert->pub.color_convert = null_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: + /* Permit null conversion to same output space */ + if (cinfo->out_color_space == cinfo->jpeg_color_space) { + cinfo->out_color_components = cinfo->num_components; + cconvert->pub.color_convert = null_convert; + } else /* unsupported non-null conversion */ + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + + if (cinfo->quantize_colors) + cinfo->output_components = 1; /* single colormapped output component */ + else + cinfo->output_components = cinfo->out_color_components; +} diff --git a/dcmjpeg/libijg12/jdct12.h b/dcmjpeg/libijg12/jdct12.h new file mode 100644 index 00000000..4eb9b0aa --- /dev/null +++ b/dcmjpeg/libijg12/jdct12.h @@ -0,0 +1,176 @@ +/* + * jdct.h + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the forward and + * inverse DCT modules. These declarations are private to the DCT managers + * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. + * The individual DCT algorithms are kept in separate files to ease + * machine-dependent tuning (e.g., assembly coding). + */ + + +/* + * A forward DCT routine is given a pointer to a work area of type DCTELEM[]; + * the DCT is to be performed in-place in that buffer. Type DCTELEM is int + * for 8-bit samples, IJG_INT32 for 12-bit samples. (NOTE: Floating-point DCT + * implementations use an array of type FAST_FLOAT, instead.) + * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE). + * The DCT outputs are returned scaled up by a factor of 8; they therefore + * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This + * convention improves accuracy in integer implementations and saves some + * work in floating-point ones. + * Quantization of the output coefficients is done by jcdctmgr.c. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef int DCTELEM; /* 16 or 32 bits is fine */ +#else +typedef IJG_INT32 DCTELEM; /* must have 32 bits */ +#endif + +typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data)); +typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data)); + + +/* + * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer + * to an output sample array. The routine must dequantize the input data as + * well as perform the IDCT; for dequantization, it uses the multiplier table + * pointed to by compptr->dct_table. The output data is to be placed into the + * sample array starting at a specified column. (Any row offset needed will + * be applied to the array pointer before it is passed to the IDCT code.) + * Note that the number of samples emitted by the IDCT routine is + * DCT_scaled_size * DCT_scaled_size. + */ + +/* typedef inverse_DCT_method_ptr is declared in jpegint.h */ + +/* + * Each IDCT routine has its own ideas about the best dct_table element type. + */ + +typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ +#if BITS_IN_JSAMPLE == 8 +typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ +#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ +#else +typedef IJG_INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ +#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ +#endif +typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ + + +/* + * Each IDCT routine is responsible for range-limiting its results and + * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could + * be quite far out of range if the input data is corrupt, so a bulletproof + * range-limiting step is required. We use a mask-and-table-lookup method + * to do the combined operations quickly. See the comments with + * prepare_range_limit_table (in jdmaster.c) for more info. + */ + +#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) + +#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_fdct_islow jpeg12_fdct_islow +#define jpeg_fdct_ifast jpeg12_fdct_ifast +#define jpeg_fdct_float jpeg12_fdct_float +#define jpeg_idct_islow jpeg12_idct_islow +#define jpeg_idct_ifast jpeg12_idct_ifast +#define jpeg_idct_float jpeg12_idct_float +#define jpeg_idct_4x4 jpeg12_idct_4x4 +#define jpeg_idct_2x2 jpeg12_idct_2x2 +#define jpeg_idct_1x1 jpeg12_idct_1x1 +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Extern declarations for the forward and inverse DCT routines. */ + +EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data)); +EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data)); +EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data)); + +EXTERN(void) jpeg_idct_islow + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_ifast + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_float + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_4x4 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_2x2 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_1x1 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + const JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); + + +/* + * Macros for handling fixed-point arithmetic; these are used by many + * but not all of the DCT/IDCT modules. + * + * All values are expected to be of type IJG_INT32. + * Fractional constants are scaled left by CONST_BITS bits. + * CONST_BITS is defined within each module using these macros, + * and may differ from one module to the next. + */ + +#define ONE ((IJG_INT32) 1) +#define CONST_SCALE (ONE << CONST_BITS) + +/* Convert a positive real constant to an integer scaled by CONST_SCALE. + * Caution: some C compilers fail to reduce "FIX(constant)" at compile time, + * thus causing a lot of useless floating-point operations at run time. + */ + +#define FIX(x) ((IJG_INT32) ((x) * CONST_SCALE + 0.5)) + +/* Descale and correctly round an IJG_INT32 value that's scaled by N bits. + * We assume RIGHT_SHIFT rounds towards minus infinity, so adding + * the fudge factor is correct for either sign of X. + */ + +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * This macro is used only when the two inputs will actually be no more than + * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a + * full 32x32 multiply. This provides a useful speedup on many machines. + * Unfortunately there is no way to specify a 16x16->32 multiply portably + * in C, but some C compilers will do the right thing if you provide the + * correct combination of casts. + */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) +#endif +#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((IJG_INT32) (const))) +#endif + +#ifndef MULTIPLY16C16 /* default definition */ +#define MULTIPLY16C16(var,const) ((var) * (const)) +#endif + +/* Same except both inputs are variables. */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2))) +#endif + +#ifndef MULTIPLY16V16 /* default definition */ +#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) +#endif diff --git a/dcmjpeg/libijg12/jddctmgr.c b/dcmjpeg/libijg12/jddctmgr.c new file mode 100644 index 00000000..4b7cc6cf --- /dev/null +++ b/dcmjpeg/libijg12/jddctmgr.c @@ -0,0 +1,270 @@ +/* + * jddctmgr.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the inverse-DCT management logic. + * This code selects a particular IDCT implementation to be used, + * and it performs related housekeeping chores. No code in this file + * is executed per IDCT step, only during output pass setup. + * + * Note that the IDCT routines are responsible for performing coefficient + * dequantization as well as the IDCT proper. This module sets up the + * dequantization multiplier table needed by the IDCT routine. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy subsystem */ +#include "jdct12.h" /* Private declarations for DCT subsystem */ + + +/* + * The decompressor input side (jdinput.c) saves away the appropriate + * quantization table for each component at the start of the first scan + * involving that component. (This is necessary in order to correctly + * decode files that reuse Q-table slots.) + * When we are ready to make an output pass, the saved Q-table is converted + * to a multiplier table that will actually be used by the IDCT routine. + * The multiplier table contents are IDCT-method-dependent. To support + * application changes in IDCT method between scans, we can remake the + * multiplier tables if necessary. + * In buffered-image mode, the first output pass may occur before any data + * has been seen for some components, and thus before their Q-tables have + * been saved away. To handle this case, multiplier tables are preset + * to zeroes; the result of the IDCT will be a neutral gray level. + */ + + +/* Private subobject for this module */ + +typedef struct { + /* This array contains the IDCT method code that each multiplier table + * is currently set up for, or -1 if it's not yet set up. + * The actual multiplier tables are pointed to by dct_table in the + * per-component comp_info structures. + */ + int cur_method[MAX_COMPONENTS]; +} idct_controller; + +typedef idct_controller * idct_ptr; + + +/* Allocated multiplier tables: big enough for any supported variant */ + +typedef union { + ISLOW_MULT_TYPE islow_array[DCTSIZE2]; +#ifdef DCT_IFAST_SUPPORTED + IFAST_MULT_TYPE ifast_array[DCTSIZE2]; +#endif +#ifdef DCT_FLOAT_SUPPORTED + FLOAT_MULT_TYPE float_array[DCTSIZE2]; +#endif +} multiplier_table; + + +/* The current scaled-IDCT routines require ISLOW-style multiplier tables, + * so be sure to compile that code if either ISLOW or SCALING is requested. + */ +#ifdef DCT_ISLOW_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#else +#ifdef IDCT_SCALING_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#endif +#endif + + +/* + * Prepare for an output pass. + * Here we select the proper IDCT routine for each component and build + * a matching multiplier table. + */ + +METHODDEF(void) +start_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + idct_ptr idct = (idct_ptr) lossyd->idct_private; + int ci, i; + jpeg_component_info *compptr; + int method = 0; + inverse_DCT_method_ptr method_ptr = NULL; + JQUANT_TBL * qtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Select the proper IDCT routine for this component's scaling */ + switch (compptr->codec_data_unit) { +#ifdef IDCT_SCALING_SUPPORTED + case 1: + method_ptr = jpeg_idct_1x1; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; + case 2: + method_ptr = jpeg_idct_2x2; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; + case 4: + method_ptr = jpeg_idct_4x4; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; +#endif + case DCTSIZE: + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + method_ptr = jpeg_idct_islow; + method = JDCT_ISLOW; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + method_ptr = jpeg_idct_ifast; + method = JDCT_IFAST; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + method_ptr = jpeg_idct_float; + method = JDCT_FLOAT; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + break; + default: + ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->codec_data_unit); + break; + } + lossyd->inverse_DCT[ci] = method_ptr; + /* Create multiplier table from quant table. + * However, we can skip this if the component is uninteresting + * or if we already built the table. Also, if no quant table + * has yet been saved for the component, we leave the + * multiplier table all-zero; we'll be reading zeroes from the + * coefficient controller's buffer anyway. + */ + if (! compptr->component_needed || idct->cur_method[ci] == method) + continue; + qtbl = compptr->quant_table; + if (qtbl == NULL) /* happens if no data yet for component */ + continue; + idct->cur_method[ci] = method; + switch (method) { +#ifdef PROVIDE_ISLOW_TABLES + case JDCT_ISLOW: + { + /* For LL&M IDCT method, multipliers are equal to raw quantization + * coefficients, but are stored as ints to ensure access efficiency. + */ + ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; + for (i = 0; i < DCTSIZE2; i++) { + ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; + } + } + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * For integer operation, the multiplier table is to be scaled by + * IFAST_SCALE_BITS. + */ + IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + for (i = 0; i < DCTSIZE2; i++) { + ifmtbl[i] = (IFAST_MULT_TYPE) + DESCALE(MULTIPLY16V16((IJG_INT32) qtbl->quantval[i], + (IJG_INT32) aanscales[i]), + CONST_BITS-IFAST_SCALE_BITS); + } + } + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + */ + FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fmtbl[i] = (FLOAT_MULT_TYPE) + ((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col]); + i++; + } + } + } + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Initialize IDCT manager. + */ + +GLOBAL(void) +jinit_inverse_dct (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + idct_ptr idct; + int ci; + jpeg_component_info *compptr; + + idct = (idct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(idct_controller)); + lossyd->idct_private = (void *) idct; + lossyd->idct_start_pass = start_pass; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate and pre-zero a multiplier table for each component */ + compptr->dct_table = + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(multiplier_table)); + MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); + /* Mark multiplier table not yet set up for any method */ + idct->cur_method[ci] = -1; + } +} diff --git a/dcmjpeg/libijg12/jddiffct.c b/dcmjpeg/libijg12/jddiffct.c new file mode 100644 index 00000000..cac77fbd --- /dev/null +++ b/dcmjpeg/libijg12/jddiffct.c @@ -0,0 +1,399 @@ +/* + * jddiffct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the [un]difference buffer controller for decompression. + * This controller is the top level of the lossless JPEG decompressor proper. + * The difference buffer lies between the entropy decoding and + * prediction/undifferencing steps. The undifference buffer lies between the + * prediction/undifferencing and scaling steps. + * + * In buffered-image mode, this controller is the interface between + * input-oriented processing and output-oriented processing. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" + + +#ifdef D_LOSSLESS_SUPPORTED + +/* Private buffer controller object */ + +typedef struct { + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + unsigned int restart_rows_to_go; /* MCU-rows left in this restart interval */ + unsigned int MCU_vert_offset; /* counts MCU rows within iMCU row */ + unsigned int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + JDIFFARRAY diff_buf[MAX_COMPONENTS]; /* iMCU row of differences */ + JDIFFARRAY undiff_buf[MAX_COMPONENTS]; /* iMCU row of undiff'd samples */ + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual sample array for each component. */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +#endif +} d_diff_controller; + +typedef d_diff_controller * d_diff_ptr; + +/* Forward declarations */ +METHODDEF(int) decompress_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#ifdef D_MULTISCAN_FILES_SUPPORTED +METHODDEF(int) output_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + diff->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + diff->MCU_rows_per_iMCU_row = (JDIMENSION)cinfo->cur_comp_info[0]->v_samp_factor; + else + diff->MCU_rows_per_iMCU_row = (JDIMENSION)cinfo->cur_comp_info[0]->last_row_height; + } + + diff->MCU_ctr = 0; + diff->MCU_vert_offset = 0; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + /* Check that the restart interval is an integer multiple of the number + * of MCU in an MCU-row. + */ + if (cinfo->restart_interval % cinfo->MCUs_per_row != 0) + ERREXIT2(cinfo, JERR_BAD_RESTART, + (int)cinfo->restart_interval, (int)cinfo->MCUs_per_row); + + /* Initialize restart counter */ + diff->restart_rows_to_go = cinfo->restart_interval / cinfo->MCUs_per_row; + + cinfo->input_iMCU_row = 0; + start_iMCU_row(cinfo); +} + + +/* + * Check for a restart marker & resynchronize decoder, undifferencer. + * Returns FALSE if must suspend. + */ + +METHODDEF(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + if (! (*losslsd->entropy_process_restart) (cinfo)) + return FALSE; + + (*losslsd->predict_process_restart) (cinfo); + + /* Reset restart counter */ + diff->restart_rows_to_go = cinfo->restart_interval / cinfo->MCUs_per_row; + + return TRUE; +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ + cinfo->output_iMCU_row = 0; +} + + +/* + * Decompress and return some data in the supplied buffer. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Input and output must run in lockstep since we have only a one-MCU buffer. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(int) +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_count; /* number of MCUs decoded */ + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int comp, ci, row, prev_row; + unsigned int yoffset; + jpeg_component_info *compptr; + + /* Loop to process as much as one whole iMCU row */ + for (yoffset = diff->MCU_vert_offset; yoffset < diff->MCU_rows_per_iMCU_row; + yoffset++) { + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (diff->restart_rows_to_go == 0) + if (! process_restart(cinfo)) + return JPEG_SUSPENDED; + } + + MCU_col_num = diff->MCU_ctr; + /* Try to fetch an MCU-row (or remaining portion of suspended MCU-row). */ + MCU_count = + (*losslsd->entropy_decode_mcus) (cinfo, + diff->diff_buf, yoffset, MCU_col_num, + cinfo->MCUs_per_row - MCU_col_num); + if (MCU_count != cinfo->MCUs_per_row - MCU_col_num) { + /* Suspension forced; update state counters and exit */ + diff->MCU_vert_offset = yoffset; + diff->MCU_ctr += MCU_count; + return JPEG_SUSPENDED; + } + + /* Account for restart interval (no-op if not using restarts) */ + diff->restart_rows_to_go--; + + /* Completed an MCU row, but perhaps not an iMCU row */ + diff->MCU_ctr = 0; + } + + /* + * Undifference and scale each scanline of the disassembled MCU-row + * separately. We do not process dummy samples at the end of a scanline + * or dummy rows at the end of the image. + */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + for (row = 0, prev_row = compptr->v_samp_factor - 1; + row < (cinfo->input_iMCU_row == last_iMCU_row ? + compptr->last_row_height : compptr->v_samp_factor); + prev_row = row, row++) { + (*losslsd->predict_undifference[ci]) (cinfo, ci, + diff->diff_buf[ci][row], + diff->undiff_buf[ci][prev_row], + diff->undiff_buf[ci][row], + compptr->width_in_data_units); + (*losslsd->scaler_scale) (cinfo, diff->undiff_buf[ci][row], + output_buf[ci][row], + compptr->width_in_data_units); + } + } + + /* Completed the iMCU row, advance counters for next one. + * + * NB: output_data will increment output_iMCU_row. + * This counter is not needed for the single-pass case + * or the input side of the multi-pass case. + */ + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Dummy consume-input routine for single-pass operation. + */ + +METHODDEF(int) +dummy_consume_data (j_decompress_ptr cinfo) +{ + return JPEG_SUSPENDED; /* Always indicate nothing was done */ +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Consume input data and store it in the full-image sample buffer. + * We read as much as one fully interleaved MCU row ("iMCU" row) per call, + * ie, v_samp_factor rows for each component in the scan. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + */ + +METHODDEF(int) +consume_data (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */ + /* JDIMENSION MCU_count; */ /* number of MCUs decoded */ + /* JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; */ + int comp, ci /* , yoffset, row, prev_row */; + JSAMPARRAY buffer[MAX_COMPS_IN_SCAN]; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + cinfo->input_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + } + + return decompress_data(cinfo, buffer); +} + + +/* + * Output some data from the full-image buffer sample in the multi-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image. + */ + +METHODDEF(int) +output_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int ci, samp_rows, row; + JSAMPARRAY buffer; + jpeg_component_info *compptr; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number < cinfo->output_scan_number || + (cinfo->input_scan_number == cinfo->output_scan_number && + cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + cinfo->output_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + + if (cinfo->output_iMCU_row < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + } + + for (row = 0; row < samp_rows; row++) { + MEMCOPY(output_buf[ci][row], buffer[row], + compptr->width_in_data_units * SIZEOF(JSAMPLE)); + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +/* + * Initialize difference buffer controller. + */ + +GLOBAL(void) +jinit_d_diff_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff; + int ci; + jpeg_component_info *compptr; + + diff = (d_diff_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_diff_controller)); + losslsd->diff_private = (void *) diff; + losslsd->diff_start_input_pass = start_input_pass; + losslsd->pub.start_output_pass = start_output_pass; + + /* Create the [un]difference buffers. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->diff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + diff->undiff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } + + if (need_full_buffer) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* Allocate a full-image virtual array for each component. */ + int access_rows; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + access_rows = compptr->v_samp_factor; + diff->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) access_rows); + } + losslsd->pub.consume_data = consume_data; + losslsd->pub.decompress_data = output_data; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + losslsd->pub.consume_data = dummy_consume_data; + losslsd->pub.decompress_data = decompress_data; + diff->whole_image[0] = NULL; /* flag for no virtual arrays */ + } +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jdhuff.c b/dcmjpeg/libijg12/jdhuff.c new file mode 100644 index 00000000..d2c98c81 --- /dev/null +++ b/dcmjpeg/libijg12/jdhuff.c @@ -0,0 +1,316 @@ +/* + * jdhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines which are shared + * by the sequential, progressive and lossless decoders. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ +#include "jlossls12.h" /* Private declarations for lossless codec */ +#include "jdhuff12.h" /* Declarations shared with jd*huff.c */ + + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +GLOBAL(void) +jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, + d_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + d_derived_tbl *dtbl; + int p, i, l, si, numsymbols; + int lookbits, ctr; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (d_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_derived_tbl)); + dtbl = *pdtbl; + dtbl->pub = htbl; /* fill in back link */ + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + numsymbols = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + * BUG FIX: Comparison must be >, not >= + */ + if (((IJG_INT32) code) > (((IJG_INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure F.15: generate decoding tables for bit-sequential decoding */ + + p = 0; + for (l = 1; l <= 16; l++) { + if (htbl->bits[l]) { + /* valoffset[l] = huffval[] index of 1st symbol of code length l, + * minus the minimum code of length l + */ + dtbl->valoffset[l] = (IJG_INT32) p - (IJG_INT32) huffcode[p]; + p += htbl->bits[l]; + dtbl->maxcode[l] = (IJG_INT32)huffcode[p-1]; /* maximum code of length l */ + } else { + dtbl->maxcode[l] = -1; /* -1 if no codes of this length */ + } + } + dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */ + + /* Compute lookahead tables to speed up decoding. + * First we set all the table entries to 0, indicating "too long"; + * then we iterate through the Huffman codes that are short enough and + * fill in all the entries that correspond to bit sequences starting + * with that code. + */ + + MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits)); + + p = 0; + for (l = 1; l <= HUFF_LOOKAHEAD; l++) { + for (i = 1; i <= (int) htbl->bits[l]; i++, p++) { + /* l = current code's length, p = its index in huffcode[] & huffval[]. */ + /* Generate left-justified code followed by all possible bit sequences */ + lookbits = (int)huffcode[p] << (HUFF_LOOKAHEAD-l); + for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) { + dtbl->look_nbits[lookbits] = l; + dtbl->look_sym[lookbits] = htbl->huffval[p]; + lookbits++; + } + } + } + + /* Validate symbols as being reasonable. + * For AC tables, we make no check, but accept all byte values 0..255. + * For DC tables, we require the symbols to be in range 0..16. + * (Tighter bounds could be applied depending on the data depth and mode, + * but this is sufficient to ensure safe decoding.) + */ + if (isDC) { + for (i = 0; i < numsymbols; i++) { + int sym = htbl->huffval[i]; + if (sym < 0 || sym > 16) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + } + } +} + + +/* + * Out-of-line code for bit fetching. + * See jdhuff.h for info about usage. + * Note: current values of get_buffer and bits_left are passed as parameters, + * but are returned in the corresponding fields of the state struct. + * + * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width + * of get_buffer to be used. (On machines with wider words, an even larger + * buffer could be used.) However, on some machines 32-bit shifts are + * quite slow and take time proportional to the number of places shifted. + * (This is true with most PC compilers, for instance.) In this case it may + * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the + * average shift distance at the cost of more calls to jpeg_fill_bit_buffer. + */ + +#ifdef SLOW_SHIFT_32 +#define MIN_GET_BITS 15 /* minimum allowable value */ +#else +#define MIN_GET_BITS (BIT_BUF_SIZE-7) +#endif + + +GLOBAL(boolean) +jpeg_fill_bit_buffer (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + int nbits) +/* Load up the bit buffer to a depth of at least nbits */ +{ + /* Copy heavily used state fields into locals (hopefully registers) */ + register const JOCTET * next_input_byte = state->next_input_byte; + register size_t bytes_in_buffer = state->bytes_in_buffer; + j_decompress_ptr cinfo = state->cinfo; + + /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */ + /* (It is assumed that no request will be for more than that many bits.) */ + /* We fail to do so only if we hit a marker or are forced to suspend. */ + + if (cinfo->unread_marker == 0) { /* cannot advance past a marker */ + while (bits_left < MIN_GET_BITS) { + register int c; + + /* Attempt to read a byte */ + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + + /* If it's 0xFF, check and discard stuffed zero byte */ + if (c == 0xFF) { + /* Loop here to discard any padding FF's on terminating marker, + * so that we can save a valid unread_marker value. NOTE: we will + * accept multiple FF's followed by a 0 as meaning a single FF data + * byte. This data pattern is not valid according to the standard. + */ + do { + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + } while (c == 0xFF); + + if (c == 0) { + /* Found FF/00, which represents an FF data byte */ + c = 0xFF; + } else { + /* Oops, it's actually a marker indicating end of compressed data. + * Save the marker code for later use. + * Fine point: it might appear that we should save the marker into + * bitread working state, not straight into permanent state. But + * once we have hit a marker, we cannot need to suspend within the + * current MCU, because we will read no more bytes from the data + * source. So it is OK to update permanent state right away. + */ + cinfo->unread_marker = c; + /* See if we need to insert some fake zero bits. */ + goto no_more_bytes; + } + } + + /* OK, load c into get_buffer */ + get_buffer = (get_buffer << 8) | c; + bits_left += 8; + } /* end while */ + } else { + no_more_bytes: + /* We get here if we've read the marker that terminates the compressed + * data segment. There should be enough bits in the buffer register + * to satisfy the request; if so, no problem. + */ + if (nbits > bits_left) { + /* Uh-oh. Report corrupted data to user and stuff zeroes into + * the data stream, so that we can produce some kind of image. + * We use a nonvolatile flag to ensure that only one warning message + * appears per data segment. + */ + huffd_common_ptr huffd; + if (cinfo->process == JPROC_LOSSLESS) + huffd = (huffd_common_ptr) ((j_lossless_d_ptr) cinfo->codec)->entropy_private; + else + huffd = (huffd_common_ptr) ((j_lossy_d_ptr) cinfo->codec)->entropy_private; + if (! huffd->insufficient_data) { + WARNMS(cinfo, JWRN_HIT_MARKER); + huffd->insufficient_data = TRUE; + } + /* Fill the buffer with zero bits */ + get_buffer <<= MIN_GET_BITS - bits_left; + bits_left = MIN_GET_BITS; + } + } + + /* Unload the local registers */ + state->next_input_byte = next_input_byte; + state->bytes_in_buffer = bytes_in_buffer; + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + return TRUE; +} + + +/* + * Out-of-line code for Huffman code decoding. + * See jdhuff.h for info about usage. + */ + +GLOBAL(int) +jpeg_huff_decode (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + d_derived_tbl * htbl, int min_bits) +{ + register int l = min_bits; + register IJG_INT32 code; + + /* HUFF_DECODE has determined that the code is at least min_bits */ + /* bits long, so fetch that many bits in one swoop. */ + + CHECK_BIT_BUFFER(*state, l, return -1); + code = GET_BITS(l); + + /* Collect the rest of the Huffman code one bit at a time. */ + /* This is per Figure F.16 in the JPEG spec. */ + + while (code > htbl->maxcode[l]) { + code <<= 1; + CHECK_BIT_BUFFER(*state, 1, return -1); + code |= GET_BITS(1); + l++; + } + + /* Unload the local registers */ + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + /* With garbage input we may reach the sentinel value l = 17. */ + + if (l > 16) { + WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE); + return 0; /* fake a zero as the safest result */ + } + + return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ]; +} diff --git a/dcmjpeg/libijg12/jdhuff12.h b/dcmjpeg/libijg12/jdhuff12.h new file mode 100644 index 00000000..b84c0921 --- /dev/null +++ b/dcmjpeg/libijg12/jdhuff12.h @@ -0,0 +1,229 @@ +/* + * jdhuff.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains declarations for Huffman entropy decoding routines + * that are shared between the sequential decoder (jdhuff.c), the + * progressive decoder (jdphuff.c) and the lossless decoder (jdlhuff.c). + * No other modules need to see these. + */ + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_make_d_derived_tbl jpeg12_make_d_derived_tbl +#define jpeg_fill_bit_buffer jpeg12_fill_bit_buffer +#define jpeg_huff_decode jpeg12_huff_decode +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Derived data constructed for each Huffman table */ + +#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */ + +typedef struct { + /* Basic tables: (element [0] of each array is unused) */ + IJG_INT32 maxcode[18]; /* largest code of length k (-1 if none) */ + /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */ + IJG_INT32 valoffset[17]; /* huffval[] offset for codes of length k */ + /* valoffset[k] = huffval[] index of 1st symbol of code length k, less + * the smallest code of length k; so given a code of length k, the + * corresponding symbol is huffval[code + valoffset[k]] + */ + + /* Link to public Huffman table (needed only in jpeg_huff_decode) */ + JHUFF_TBL *pub; + + /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of + * the input data stream. If the next Huffman code is no more + * than HUFF_LOOKAHEAD bits long, we can obtain its length and + * the corresponding symbol directly from these tables. + */ + int look_nbits[1< 32 bits on your machine, and shifting/masking longs is + * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE + * appropriately should be a win. Unfortunately we can't define the size + * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8) + * because not all machines measure sizeof in 8-bit bytes. + */ + +typedef struct { /* Bitreading state saved across MCUs */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ +} bitread_perm_state; + +typedef struct { /* Bitreading working state within an MCU */ + /* Current data source location */ + /* We need a copy, rather than munging the original, in case of suspension */ + const JOCTET * next_input_byte; /* => next byte to read from source */ + size_t bytes_in_buffer; /* # of bytes remaining in source buffer */ + /* Bit input buffer --- note these values are kept in register variables, + * not in this struct, inside the inner loops. + */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ + /* Pointer needed by jpeg_fill_bit_buffer. */ + j_decompress_ptr cinfo; /* back link to decompress master record */ +} bitread_working_state; + +/* Macros to declare and load/save bitread local variables. */ +#define BITREAD_STATE_VARS \ + register bit_buf_type get_buffer; \ + register int bits_left; \ + bitread_working_state br_state + +#define BITREAD_LOAD_STATE(cinfop,permstate) \ + br_state.cinfo = cinfop; \ + br_state.next_input_byte = cinfop->src->next_input_byte; \ + br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ + get_buffer = permstate.get_buffer; \ + bits_left = permstate.bits_left; + +#define BITREAD_SAVE_STATE(cinfop,permstate) \ + cinfop->src->next_input_byte = br_state.next_input_byte; \ + cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ + permstate.get_buffer = get_buffer; \ + permstate.bits_left = bits_left + +/* + * These macros provide the in-line portion of bit fetching. + * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer + * before using GET_BITS, PEEK_BITS, or DROP_BITS. + * The variables get_buffer and bits_left are assumed to be locals, + * but the state struct might not be (jpeg_huff_decode needs this). + * CHECK_BIT_BUFFER(state,n,action); + * Ensure there are N bits in get_buffer; if suspend, take action. + * val = GET_BITS(n); + * Fetch next N bits. + * val = PEEK_BITS(n); + * Fetch next N bits without removing them from the buffer. + * DROP_BITS(n); + * Discard next N bits. + * The value N should be a simple variable, not an expression, because it + * is evaluated multiple times. + */ + +#define CHECK_BIT_BUFFER(state,nbits,action) \ + { if (bits_left < (nbits)) { \ + if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \ + { action; } \ + get_buffer = (state).get_buffer; bits_left = (state).bits_left; } } + +#define GET_BITS(nbits) \ + (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1)) + +#define PEEK_BITS(nbits) \ + (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1)) + +#define DROP_BITS(nbits) \ + (bits_left -= (nbits)) + +/* Load up the bit buffer to a depth of at least nbits */ +EXTERN(boolean) jpeg_fill_bit_buffer + JPP((bitread_working_state * state, register bit_buf_type get_buffer, + register int bits_left, int nbits)); + + +/* + * Code for extracting next Huffman-coded symbol from input bit stream. + * Again, this is time-critical and we make the main paths be macros. + * + * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits + * without looping. Usually, more than 95% of the Huffman codes will be 8 + * or fewer bits long. The few overlength codes are handled with a loop, + * which need not be inline code. + * + * Notes about the HUFF_DECODE macro: + * 1. Near the end of the data segment, we may fail to get enough bits + * for a lookahead. In that case, we do it the hard way. + * 2. If the lookahead table contains no entry, the next code must be + * more than HUFF_LOOKAHEAD bits long. + * 3. jpeg_huff_decode returns -1 if forced to suspend. + */ + +#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \ +{ register int nb, look; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + nb = 1; goto slowlabel; \ + } \ + } \ + look = PEEK_BITS(HUFF_LOOKAHEAD); \ + if ((nb = htbl->look_nbits[look]) != 0) { \ + DROP_BITS(nb); \ + result = htbl->look_sym[look]; \ + } else { \ + nb = HUFF_LOOKAHEAD+1; \ +slowlabel: \ + if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \ + { failaction; } \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + } \ +} + +/* Out-of-line case for Huffman code fetching */ +EXTERN(int) jpeg_huff_decode + JPP((bitread_working_state * state, register bit_buf_type get_buffer, + register int bits_left, d_derived_tbl * htbl, int min_bits)); + + +/* Common fields between sequential, progressive and lossless Huffman entropy + * decoder master structs. + */ + +#define huffd_common_fields \ + boolean insufficient_data; /* set TRUE after emmitting warning */ \ + /* These fields are loaded into local variables at start of each MCU. \ + * In case of suspension, we exit WITHOUT updating them. \ + */ \ + bitread_perm_state bitstate /* Bit buffer at start of MCU */ + +/* Routines that are to be used by any or all of the entropy decoders are + * declared to receive a pointer to this structure. There are no actual + * instances of huffd_common_struct, only of shuff_entropy_decoder, + * phuff_entropy_decoder and lhuff_entropy_decoder. + */ +struct huffd_common_struct { + huffd_common_fields; /* Fields common to all decoder struct types */ + /* Additional fields follow in an actual shuff_entropy_decoder, + * phuff_entropy_decoder or lhuff_entropy_decoder struct. All four structs + * must agree on these initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct huffd_common_struct * huffd_common_ptr; diff --git a/dcmjpeg/libijg12/jdinput.c b/dcmjpeg/libijg12/jdinput.c new file mode 100644 index 00000000..02aab71c --- /dev/null +++ b/dcmjpeg/libijg12/jdinput.c @@ -0,0 +1,347 @@ +/* + * jdinput.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input control logic for the JPEG decompressor. + * These routines are concerned with controlling the decompressor's input + * processing (marker reading and coefficient/difference decoding). + * The actual input reading is done in jdmarker.c, jdhuff.c, jdphuff.c, + * and jdlhuff.c. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Private state */ + +typedef struct { + struct jpeg_input_controller pub; /* public fields */ + + boolean inheaders; /* TRUE until first SOS is reached */ +} my_input_controller; + +typedef my_input_controller * my_inputctl_ptr; + + +/* Forward declarations */ +METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo)); + + +/* + * Routines to calculate various quantities related to the size of the image. + */ + +LOCAL(void) +initial_setup (j_decompress_ptr cinfo) +/* Called once, when first SOS marker is reached */ +{ + int ci; + jpeg_component_info *compptr; + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + if (cinfo->process == JPROC_LOSSLESS) { + /* If precision > compiled-in value, we must downscale */ + if (cinfo->data_precision > BITS_IN_JSAMPLE) + WARNMS2(cinfo, JWRN_MUST_DOWNSCALE, + cinfo->data_precision, BITS_IN_JSAMPLE); + } + else { /* Lossy processes */ + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + } + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* We initialize codec_data_unit and min_codec_data_unit to data_unit. + * In the full decompressor, this will be overridden by jdmaster.c; + * but in the transcoder, jdmaster.c is not used, so we must do it here. + */ + cinfo->min_codec_data_unit = cinfo->data_unit; + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->codec_data_unit = cinfo->data_unit; + /* Size in data units */ + compptr->width_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * cinfo->data_unit)); + compptr->height_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * cinfo->data_unit)); + /* downsampled_width and downsampled_height will also be overridden by + * jdmaster.c if we are doing full decompression. The transcoder library + * doesn't use these values, but the calling application might. + */ + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) cinfo->max_h_samp_factor); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) cinfo->max_v_samp_factor); + /* Mark component needed, until color conversion says otherwise */ + compptr->component_needed = TRUE; + /* Mark no quantization table yet saved for component */ + compptr->quant_table = NULL; + } + + /* Compute number of fully interleaved MCU rows. */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*cinfo->data_unit)); + + /* Decide whether file contains multiple scans */ + if (cinfo->comps_in_scan < cinfo->num_components || + cinfo->process == JPROC_PROGRESSIVE) + cinfo->inputctl->has_multiple_scans = TRUE; + else + cinfo->inputctl->has_multiple_scans = FALSE; +} + + +LOCAL(void) +per_scan_setup (j_decompress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_data_units; + cinfo->MCU_rows_in_scan = compptr->height_in_data_units; + + /* For noninterleaved scan, always one data unit per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_data_units = 1; + compptr->MCU_sample_width = compptr->codec_data_unit; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of data unit rows present in the last iMCU row. + */ + tmp = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->data_units_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, + (long) (cinfo->max_h_samp_factor*cinfo->data_unit)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*cinfo->data_unit)); + + cinfo->data_units_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of data units of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_data_units = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * compptr->codec_data_unit; + /* Figure number of non-dummy data units in last MCU column & row */ + tmp = (int)compptr->width_in_data_units % compptr->MCU_width; + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int)compptr->height_in_data_units % compptr->MCU_height; + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_data_units; + if (cinfo->data_units_in_MCU + mcublks > D_MAX_DATA_UNITS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->data_units_in_MCU++] = ci; + } + } + + } +} + + +/* + * Initialize the input modules to read a scan of compressed data. + * The first call to this is done by jdmaster.c after initializing + * the entire decompressor (during jpeg_start_decompress). + * Subsequent calls come from consume_markers, below. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + per_scan_setup(cinfo); + (*cinfo->codec->start_input_pass) (cinfo); + cinfo->inputctl->consume_input = cinfo->codec->consume_data; +} + + +/* + * Finish up after inputting a compressed-data scan. + * This is called by the coefficient controller after it's read all + * the expected data of the scan. + */ + +METHODDEF(void) +finish_input_pass (j_decompress_ptr cinfo) +{ + cinfo->inputctl->consume_input = consume_markers; +} + + +/* + * Read JPEG markers before, between, or after compressed-data scans. + * Change state as necessary when a new scan is reached. + * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + * + * The consume_input method pointer points either here or to the + * coefficient controller's consume_data routine, depending on whether + * we are reading a compressed data segment or inter-segment markers. + */ + +METHODDEF(int) +consume_markers (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + int val; + + if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */ + return JPEG_REACHED_EOI; + + val = (*cinfo->marker->read_markers) (cinfo); + + switch (val) { + case JPEG_REACHED_SOS: /* Found SOS */ + if (inputctl->inheaders) { /* 1st SOS */ + initial_setup(cinfo); + /* + * Initialize the decompression codec. We need to do this here so that + * any codec-specific fields and function pointers are available to + * the rest of the library. + */ + jinit_d_codec(cinfo); + inputctl->inheaders = FALSE; + /* Note: start_input_pass must be called by jdmaster.c + * before any more input can be consumed. jdapimin.c is + * responsible for enforcing this sequencing. + */ + } else { /* 2nd or later SOS marker */ + if (! inputctl->pub.has_multiple_scans) + ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */ + start_input_pass(cinfo); + } + break; + case JPEG_REACHED_EOI: /* Found EOI */ + inputctl->pub.eoi_reached = TRUE; + if (inputctl->inheaders) { /* Tables-only datastream, apparently */ + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_NO_SOS); + } else { + /* Prevent infinite loop in coef ctlr's decompress_data routine + * if user set output_scan_number larger than number of scans. + */ + if (cinfo->output_scan_number > cinfo->input_scan_number) + cinfo->output_scan_number = cinfo->input_scan_number; + } + break; + case JPEG_SUSPENDED: + break; + } + + return val; +} + + +/* + * Reset state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + + inputctl->pub.consume_input = consume_markers; + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = TRUE; + /* Reset other modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->marker->reset_marker_reader) (cinfo); + /* Reset progression state -- would be cleaner if entropy decoder did this */ + cinfo->coef_bits = NULL; +} + + +/* + * Initialize the input controller module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl; + + /* Create subobject in permanent pool */ + inputctl = (my_inputctl_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_input_controller)); + cinfo->inputctl = (struct jpeg_input_controller *) inputctl; + /* Initialize method pointers */ + inputctl->pub.consume_input = consume_markers; + inputctl->pub.reset_input_controller = reset_input_controller; + inputctl->pub.start_input_pass = start_input_pass; + inputctl->pub.finish_input_pass = finish_input_pass; + /* Initialize state: can't use reset_input_controller since we don't + * want to try to reset other modules yet. + */ + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = TRUE; +} diff --git a/dcmjpeg/libijg12/jdlhuff.c b/dcmjpeg/libijg12/jdlhuff.c new file mode 100644 index 00000000..007e5597 --- /dev/null +++ b/dcmjpeg/libijg12/jdlhuff.c @@ -0,0 +1,296 @@ +/* + * jdlhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for lossless JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" /* Private declarations for lossless codec */ +#include "jdhuff12.h" /* Declarations shared with jd*huff.c */ + + +#ifdef D_LOSSLESS_SUPPORTED + +typedef struct { + int ci, yoffset, MCU_width; +} lhd_output_ptr_info; + +/* + * Private entropy decoder object for lossless Huffman decoding. + */ + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Precalculated info set up by start_pass for use in decode_mcus: */ + + /* Pointers to derived tables to be used for each data unit within an MCU */ + d_derived_tbl * cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + + /* Pointers to the proper output difference row for each group of data units + * within an MCU. For each component, there are Vi groups of Hi data units. + */ + JDIFFROW output_ptr[D_MAX_DATA_UNITS_IN_MCU]; + + /* Number of output pointers in use for the current MCU. This is the sum + * of all Vi in the MCU. + */ + int num_output_ptrs; + + /* Information used for positioning the output pointers within the output + * difference rows. + */ + lhd_output_ptr_info output_ptr_info[D_MAX_DATA_UNITS_IN_MCU]; + + /* Index of the proper output pointer for each data unit within an MCU */ + int output_ptr_index[D_MAX_DATA_UNITS_IN_MCU]; + +} lhuff_entropy_decoder; + +typedef lhuff_entropy_decoder * lhuff_entropy_ptr; + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_lhuff_decoder (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + int ci, dctbl, sampn, ptrn, yoffset, xoffset; + jpeg_component_info * compptr; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + /* Make sure requested tables are present */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS || + cinfo->dc_huff_tbl_ptrs[dctbl] == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, + & entropy->derived_tbls[dctbl]); + } + + /* Precalculate decoding info for each sample in an MCU of this scan */ + for (sampn = 0, ptrn = 0; sampn < cinfo->data_units_in_MCU;) { + compptr = cinfo->cur_comp_info[cinfo->MCU_membership[sampn]]; + ci = compptr->component_index; + for (yoffset = 0; yoffset < compptr->MCU_height; yoffset++, ptrn++) { + /* Precalculate the setup info for each output pointer */ + entropy->output_ptr_info[ptrn].ci = ci; + entropy->output_ptr_info[ptrn].yoffset = yoffset; + entropy->output_ptr_info[ptrn].MCU_width = compptr->MCU_width; + for (xoffset = 0; xoffset < compptr->MCU_width; xoffset++, sampn++) { + /* Precalculate the output pointer index for each sample */ + entropy->output_ptr_index[sampn] = ptrn; + /* Precalculate which table to use for each sample */ + entropy->cur_tbls[sampn] = entropy->derived_tbls[compptr->dc_tbl_no]; + } + } + } + entropy->num_output_ptrs = ptrn; + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +METHODDEF(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + /* int ci; */ + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)entropy->bitstate.bits_left / 8; + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Decode and return nMCU's worth of Huffman-compressed differences. + * Each MCU is also disassembled and placed accordingly in diff_buf. + * + * MCU_col_num specifies the column of the first MCU being requested within + * the MCU-row. This tells us where to position the output row pointers in + * diff_buf. + * + * Returns the number of MCUs decoded. This may be less than nMCU if data + * source requested suspension. In that case no changes have been made to + * permanent state. (Exception: some output differences may already have + * been assigned. This is harmless for this module, since we'll just + * re-assign them on the next call.) + */ + +METHODDEF(JDIMENSION) +decode_mcus (j_decompress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, JDIMENSION nMCU) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + BITREAD_STATE_VARS; + + /* Set output pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_output_ptrs; ptrn++) { + ci = entropy->output_ptr_info[ptrn].ci; + yoffset = entropy->output_ptr_info[ptrn].yoffset; + MCU_width = entropy->output_ptr_info[ptrn].MCU_width; + entropy->output_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (JDIMENSION)yoffset] + MCU_col_num * (JDIMENSION)MCU_width; + } + + /* + * If we've run out of data, zero out the buffers and return. + * By resetting the undifferencer, the output samples will be CENTERJSAMPLE. + * + * NB: We should find a way to do this without interacting with the + * undifferencer module directly. + */ + if (entropy->insufficient_data) { + for (ptrn = 0; ptrn < entropy->num_output_ptrs; ptrn++) + jzero_far((void FAR *) entropy->output_ptr[ptrn], + nMCU * (size_t)entropy->output_ptr_info[ptrn].MCU_width * SIZEOF(JDIFF)); + + (*losslsd->predict_process_restart) (cinfo); + } + + else { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + + /* Outer loop handles the number of MCU requested */ + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + d_derived_tbl * dctbl = entropy->cur_tbls[sampn]; + register int s, r; + + /* Section H.2.2: decode the sample difference */ + HUFF_DECODE(s, br_state, dctbl, return mcu_num, label1); + if (s) { + if (s == 16) /* special case: always output 32768 */ + s = 32768; + else { /* normal case: fetch subsequent bits */ + CHECK_BIT_BUFFER(br_state, s, return mcu_num); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + } + + /* Output the sample difference */ + *entropy->output_ptr[entropy->output_ptr_index[sampn]]++ = (JDIFF) s; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + } + } + + return nMCU; +} + + +/* + * Module initialization routine for lossless Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_lhuff_decoder (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy; + int i; + + entropy = (lhuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(lhuff_entropy_decoder)); + losslsd->entropy_private = (void *) entropy; + losslsd->entropy_start_pass = start_pass_lhuff_decoder; + losslsd->entropy_process_restart = process_restart; + losslsd->entropy_decode_mcus = decode_mcus; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + } +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jdlossls.c b/dcmjpeg/libijg12/jdlossls.c new file mode 100644 index 00000000..7ae65667 --- /dev/null +++ b/dcmjpeg/libijg12/jdlossls.c @@ -0,0 +1,98 @@ +/* + * jdlossls.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossless JPEG decompressor. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" + + +#ifdef D_LOSSLESS_SUPPORTED + +/* + * Compute output image dimensions and related values. + */ + +METHODDEF(void) +calc_output_dimensions (j_decompress_ptr cinfo) +{ + /* Hardwire it to "no scaling" */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + /* jdinput.c has already initialized codec_data_unit to 1, + * and has computed unscaled downsampled_width and downsampled_height. + */ +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + (*losslsd->entropy_start_pass) (cinfo); + (*losslsd->predict_start_pass) (cinfo); + (*losslsd->scaler_start_pass) (cinfo); + (*losslsd->diff_start_input_pass) (cinfo); +} + + +/* + * Initialize the lossless decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossless_d_codec(j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd; + boolean use_c_buffer; + + /* Create subobject in permanent pool */ + losslsd = (j_lossless_d_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossless_d_codec)); + cinfo->codec = (struct jpeg_d_codec *) losslsd; + + /* Initialize sub-modules */ + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + jinit_lhuff_decoder(cinfo); + } + + /* Undifferencer */ + jinit_undifferencer(cinfo); + + /* Scaler */ + jinit_d_scaler(cinfo); + + use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; + jinit_d_diff_controller(cinfo, use_c_buffer); + + /* Initialize method pointers. + * + * Note: consume_data, start_output_pass and decompress_data are + * assigned in jddiffct.c. + */ + losslsd->pub.calc_output_dimensions = calc_output_dimensions; + losslsd->pub.start_input_pass = start_input_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jdlossy.c b/dcmjpeg/libijg12/jdlossy.c new file mode 100644 index 00000000..4d7bd50f --- /dev/null +++ b/dcmjpeg/libijg12/jdlossy.c @@ -0,0 +1,232 @@ +/* + * jdlossy.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossy JPEG decompressor. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" + + +/* + * Compute output image dimensions and related values. + */ + +METHODDEF(void) +calc_output_dimensions (j_decompress_ptr cinfo) +{ +#ifdef IDCT_SCALING_SUPPORTED + int ci; + jpeg_component_info *compptr; + + /* Compute actual output image dimensions and DCT scaling choices. */ + if (cinfo->scale_num * 8 <= cinfo->scale_denom) { + /* Provide 1/8 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 8L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 8L); + cinfo->min_codec_data_unit = 1; + } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) { + /* Provide 1/4 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 4L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 4L); + cinfo->min_codec_data_unit = 2; + } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) { + /* Provide 1/2 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 2L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 2L); + cinfo->min_codec_data_unit = 4; + } else { + /* Provide 1/1 scaling */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + cinfo->min_codec_data_unit = DCTSIZE; + } + /* In selecting the actual DCT scaling for each component, we try to + * scale up the chroma components via IDCT scaling rather than upsampling. + * This saves time if the upsampler gets to use 1:1 scaling. + * Note this code assumes that the supported DCT scalings are powers of 2. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + int ssize = cinfo->min_codec_data_unit; + while (ssize < DCTSIZE && + (compptr->h_samp_factor * ssize * 2 <= + cinfo->max_h_samp_factor * cinfo->min_codec_data_unit) && + (compptr->v_samp_factor * ssize * 2 <= + cinfo->max_v_samp_factor * cinfo->min_codec_data_unit)) { + ssize = ssize * 2; + } + compptr->codec_data_unit = ssize; + } + + /* Recompute downsampled dimensions of components; + * application needs to know these if using raw downsampled data. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Size in samples, after IDCT scaling */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * + (long) (compptr->h_samp_factor * compptr->codec_data_unit), + (long) (cinfo->max_h_samp_factor * DCTSIZE)); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * + (long) (compptr->v_samp_factor * compptr->codec_data_unit), + (long) (cinfo->max_v_samp_factor * DCTSIZE)); + } + +#else /* !IDCT_SCALING_SUPPORTED */ + + /* Hardwire it to "no scaling" */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + /* jdinput.c has already initialized codec_data_unit to DCTSIZE, + * and has computed unscaled downsampled_width and downsampled_height. + */ + +#endif /* IDCT_SCALING_SUPPORTED */ +} + + +/* + * Save away a copy of the Q-table referenced by each component present + * in the current scan, unless already saved during a prior scan. + * + * In a multiple-scan JPEG file, the encoder could assign different components + * the same Q-table slot number, but change table definitions between scans + * so that each component uses a different Q-table. (The IJG encoder is not + * currently capable of doing this, but other encoders might.) Since we want + * to be able to dequantize all the components at the end of the file, this + * means that we have to save away the table actually used for each component. + * We do this by copying the table at the start of the first scan containing + * the component. + * The JPEG spec prohibits the encoder from changing the contents of a Q-table + * slot between scans of a component using that slot. If the encoder does so + * anyway, this decoder will simply use the Q-table values that were current + * at the start of the first scan for the component. + * + * The decompressor output side looks only at the saved quant tables, + * not at the current Q-table slots. + */ + +LOCAL(void) +latch_quant_tables (j_decompress_ptr cinfo) +{ + int ci, qtblno; + jpeg_component_info *compptr; + JQUANT_TBL * qtbl; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* No work if we already saved Q-table for this component */ + if (compptr->quant_table != NULL) + continue; + /* Make sure specified quantization table is present */ + qtblno = compptr->quant_tbl_no; + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + /* OK, save away the quantization table */ + qtbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(JQUANT_TBL)); + MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL)); + compptr->quant_table = qtbl; + } +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + + latch_quant_tables(cinfo); + (*lossyd->entropy_start_pass) (cinfo); + (*lossyd->coef_start_input_pass) (cinfo); +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + + (*lossyd->idct_start_pass) (cinfo); + (*lossyd->coef_start_output_pass) (cinfo); +} + +/* + * Initialize the lossy decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossy_d_codec (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd; + boolean use_c_buffer; + + /* Create subobject in permanent pool */ + lossyd = (j_lossy_d_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_d_codec)); + cinfo->codec = (struct jpeg_d_codec *) lossyd; + + /* Initialize sub-modules */ + + /* Inverse DCT */ + jinit_inverse_dct(cinfo); + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef D_PROGRESSIVE_SUPPORTED + jinit_phuff_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_decoder(cinfo); + } + + use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; + jinit_d_coef_controller(cinfo, use_c_buffer); + + /* Initialize method pointers. + * + * Note: consume_data and decompress_data are assigned in jdcoefct.c. + */ + lossyd->pub.calc_output_dimensions = calc_output_dimensions; + lossyd->pub.start_input_pass = start_input_pass; + lossyd->pub.start_output_pass = start_output_pass; +} + + + + diff --git a/dcmjpeg/libijg12/jdmainct.c b/dcmjpeg/libijg12/jdmainct.c new file mode 100644 index 00000000..f58a68c4 --- /dev/null +++ b/dcmjpeg/libijg12/jdmainct.c @@ -0,0 +1,512 @@ +/* + * jdmainct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for decompression. + * The main buffer lies between the JPEG decompressor proper and the + * post-processor; it holds downsampled data in the JPEG colorspace. + * + * Note that this code is bypassed in raw-data mode, since the application + * supplies the equivalent of the main buffer in that case. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * In the current system design, the main buffer need never be a full-image + * buffer; any full-height buffers will be found inside the coefficient or + * postprocessing controllers. Nonetheless, the main controller is not + * trivial. Its responsibility is to provide context rows for upsampling/ + * rescaling, and doing this in an efficient fashion is a bit tricky. + * + * Postprocessor input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * codec_data_unit / min_codec_data_unit) + * sample rows of each component. (We require codec_data_unit values to be + * chosen such that these numbers are integers. In practice codec_data_unit + * values will likely be powers of two, so we actually have the stronger + * condition that codec_data_unit / min_codec_data_unit is an integer.) + * Upsampling will typically produce max_v_samp_factor pixel rows from each + * row group (times any additional scale factor that the upsampler is + * applying). + * + * The decompression codec will deliver data to us one iMCU row at a time; + * each iMCU row contains v_samp_factor * codec_data_unit sample rows, or + * exactly min_codec_data_unit row groups. (This amount of data corresponds + * to one row of MCUs when the image is fully interleaved.) Note that the + * number of sample rows varies across components, but the number of row + * groups does not. Some garbage sample rows may be included in the last iMCU + * row at the bottom of the image. + * + * Depending on the vertical scaling algorithm used, the upsampler may need + * access to the sample row(s) above and below its current input row group. + * The upsampler is required to set need_context_rows TRUE at global selection + * time if so. When need_context_rows is FALSE, this controller can simply + * obtain one iMCU row at a time from the coefficient controller and dole it + * out as row groups to the postprocessor. + * + * When need_context_rows is TRUE, this controller guarantees that the buffer + * passed to postprocessing contains at least one row group's worth of samples + * above and below the row group(s) being processed. Note that the context + * rows "above" the first passed row group appear at negative row offsets in + * the passed buffer. At the top and bottom of the image, the required + * context rows are manufactured by duplicating the first or last real sample + * row; this avoids having special cases in the upsampling inner loops. + * + * The amount of context is fixed at one row group just because that's a + * convenient number for this controller to work with. The existing + * upsamplers really only need one sample row of context. An upsampler + * supporting arbitrary output rescaling might wish for more than one row + * group of context when shrinking the image; tough, we don't handle that. + * (This is justified by the assumption that downsizing will be handled mostly + * by adjusting the codec_data_unit values, so that the actual scale factor at + * the upsample step needn't be much less than one.) + * + * To provide the desired context, we have to retain the last two row groups + * of one iMCU row while reading in the next iMCU row. (The last row group + * can't be processed until we have another row group for its below-context, + * and so we have to save the next-to-last group too for its above-context.) + * We could do this most simply by copying data around in our buffer, but + * that'd be very slow. We can avoid copying any data by creating a rather + * strange pointer structure. Here's how it works. We allocate a workspace + * consisting of M+2 row groups (where M = min_codec_data_unit is the number + * of row groups per iMCU row). We create two sets of redundant pointers to + * the workspace. Labeling the physical row groups 0 to M+1, the synthesized + * pointer lists look like this: + * M+1 M-1 + * master pointer --> 0 master pointer --> 0 + * 1 1 + * ... ... + * M-3 M-3 + * M-2 M + * M-1 M+1 + * M M-2 + * M+1 M-1 + * 0 0 + * We read alternate iMCU rows using each master pointer; thus the last two + * row groups of the previous iMCU row remain un-overwritten in the workspace. + * The pointer lists are set up so that the required context rows appear to + * be adjacent to the proper places when we pass the pointer lists to the + * upsampler. + * + * The above pictures describe the normal state of the pointer lists. + * At top and bottom of the image, we diddle the pointer lists to duplicate + * the first or last sample row as necessary (this is cheaper than copying + * sample rows around). + * + * This scheme breaks down if M < 2, ie, min_codec_data_unit is 1. In that + * situation each iMCU row provides only one row group so the buffering logic + * must be different (eg, we must read two iMCU rows before we can emit the + * first row group). For now, we simply do not support providing context + * rows when min_codec_data_unit is 1. That combination seems unlikely to + * be worth providing --- if someone wants a 1/8th-size preview, they probably + * want it quick and dirty, so a context-free upsampler is sufficient. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_main_controller pub; /* public fields */ + + /* Pointer to allocated workspace (M or M+2 row groups). */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + + boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ + JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ + + /* Remaining fields are only used in the context case. */ + + /* These are the master pointers to the funny-order pointer lists. */ + JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ + + int whichptr; /* indicates which pointer set is now in use */ + int context_state; /* process_data state machine status */ + JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ + JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + +/* context_state values: */ +#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ +#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ +#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +METHODDEF(void) process_data_context_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) process_data_crank_post + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#endif + + +LOCAL(void) +alloc_funny_pointers (j_decompress_ptr cinfo) +/* Allocate space for the funny pointer lists. + * This is done only once, not once per pass. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + /* Get top-level space for component array pointers. + * We alloc both arrays with one call to save a few cycles. + */ + mymain->xbuffer[0] = (JSAMPIMAGE) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); + mymain->xbuffer[1] = mymain->xbuffer[0] + cinfo->num_components; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + /* Get space for pointer lists --- M+4 row groups in each list. + * We alloc both pointer lists with one call to save a few cycles. + */ + xbuf = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 2 * (size_t)(rgroup * (M + 4)) * SIZEOF(JSAMPROW)); + xbuf += rgroup; /* want one row group at negative offsets */ + mymain->xbuffer[0][ci] = xbuf; + xbuf += rgroup * (M + 4); + mymain->xbuffer[1][ci] = xbuf; + } +} + + +LOCAL(void) +make_funny_pointers (j_decompress_ptr cinfo) +/* Create the funny pointer lists discussed in the comments above. + * The actual workspace is already allocated (in main->buffer), + * and the space for the pointer lists is allocated too. + * This routine just fills in the curiously ordered lists. + * This will be repeated at the beginning of each pass. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY buf, xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + xbuf0 = mymain->xbuffer[0][ci]; + xbuf1 = mymain->xbuffer[1][ci]; + /* First copy the workspace pointers as-is */ + buf = mymain->buffer[ci]; + for (i = 0; i < rgroup * (M + 2); i++) { + xbuf0[i] = xbuf1[i] = buf[i]; + } + /* In the second list, put the last four row groups in swapped order */ + for (i = 0; i < rgroup * 2; i++) { + xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i]; + xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i]; + } + /* The wraparound pointers at top and bottom will be filled later + * (see set_wraparound_pointers, below). Initially we want the "above" + * pointers to duplicate the first actual data line. This only needs + * to happen in xbuffer[0]. + */ + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[0]; + } + } +} + + +LOCAL(void) +set_wraparound_pointers (j_decompress_ptr cinfo) +/* Set up the "wraparound" pointers at top and bottom of the pointer lists. + * This changes the pointer list state from top-of-image to the normal state. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + xbuf0 = mymain->xbuffer[0][ci]; + xbuf1 = mymain->xbuffer[1][ci]; + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; + xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; + xbuf0[rgroup*(M+2) + i] = xbuf0[i]; + xbuf1[rgroup*(M+2) + i] = xbuf1[i]; + } + } +} + + +LOCAL(void) +set_bottom_pointers (j_decompress_ptr cinfo) +/* Change the pointer lists to duplicate the last sample row at the bottom + * of the image. whichptr indicates which xbuffer holds the final iMCU row. + * Also sets rowgroups_avail to indicate number of nondummy row groups in row. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup, iMCUheight, rows_left; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Count sample rows in one iMCU row and in one row group */ + iMCUheight = compptr->v_samp_factor * compptr->codec_data_unit; + rgroup = iMCUheight / cinfo->min_codec_data_unit; + /* Count nondummy sample rows remaining for this component */ + rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight); + if (rows_left == 0) rows_left = iMCUheight; + /* Count nondummy row groups. Should get same answer for each component, + * so we need only do it once. + */ + if (ci == 0) { + mymain->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); + } + /* Duplicate the last real sample row rgroup*2 times; this pads out the + * last partial rowgroup and ensures at least one full rowgroup of context. + */ + xbuf = mymain->xbuffer[mymain->whichptr][ci]; + for (i = 0; i < rgroup * 2; i++) { + xbuf[rows_left + i] = xbuf[rows_left-1]; + } + } +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->upsample->need_context_rows) { + mymain->pub.process_data = process_data_context_main; + make_funny_pointers(cinfo); /* Create the xbuffer[] lists */ + mymain->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ + mymain->context_state = CTX_PREPARE_FOR_IMCU; + mymain->iMCU_row_ctr = 0; + } else { + /* Simple case with no context needed */ + mymain->pub.process_data = process_data_simple_main; + } + mymain->buffer_full = FALSE; /* Mark buffer empty */ + mymain->rowgroup_ctr = 0; + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_CRANK_DEST: + /* For last pass of 2-pass quantization, just crank the postprocessor */ + mymain->pub.process_data = process_data_crank_post; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This handles the simple case where no context is required. + */ + +METHODDEF(void) +process_data_simple_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + JDIMENSION rowgroups_avail; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mymain->buffer_full) { + if (! (*cinfo->codec->decompress_data) (cinfo, mymain->buffer)) + return; /* suspension forced, can do nothing more */ + mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + } + + /* There are always min_codec_data_unit row groups in an iMCU row. */ + rowgroups_avail = (JDIMENSION) cinfo->min_codec_data_unit; + /* Note: at the bottom of the image, we may pass extra garbage row groups + * to the postprocessor. The postprocessor has to check for bottom + * of image anyway (at row resolution), so no point in us doing it too. + */ + + /* Feed the postprocessor */ + (*cinfo->post->post_process_data) (cinfo, mymain->buffer, + &mymain->rowgroup_ctr, rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + + /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ + if (mymain->rowgroup_ctr >= rowgroups_avail) { + mymain->buffer_full = FALSE; + mymain->rowgroup_ctr = 0; + } +} + + +/* + * Process some data. + * This handles the case where context rows must be provided. + */ + +METHODDEF(void) +process_data_context_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mymain->buffer_full) { + if (! (*cinfo->codec->decompress_data) (cinfo, + mymain->xbuffer[mymain->whichptr])) + return; /* suspension forced, can do nothing more */ + mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + mymain->iMCU_row_ctr++; /* count rows received */ + } + + /* Postprocessor typically will not swallow all the input data it is handed + * in one call (due to filling the output buffer first). Must be prepared + * to exit and restart. This switch lets us keep track of how far we got. + * Note that each case falls through to the next on successful completion. + */ + switch (mymain->context_state) { + case CTX_POSTPONED_ROW: + /* Call postprocessor using previously set pointers for postponed row */ + (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr], + &mymain->rowgroup_ctr, mymain->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mymain->rowgroup_ctr < mymain->rowgroups_avail) + return; /* Need to suspend */ + mymain->context_state = CTX_PREPARE_FOR_IMCU; + if (*out_row_ctr >= out_rows_avail) + return; /* Postprocessor exactly filled output buf */ + /*FALLTHROUGH*/ + case CTX_PREPARE_FOR_IMCU: + /* Prepare to process first M-1 row groups of this iMCU row */ + mymain->rowgroup_ctr = 0; + mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1); + /* Check for bottom of image: if so, tweak pointers to "duplicate" + * the last sample row, and adjust rowgroups_avail to ignore padding rows. + */ + if (mymain->iMCU_row_ctr == cinfo->total_iMCU_rows) + set_bottom_pointers(cinfo); + mymain->context_state = CTX_PROCESS_IMCU; + /*FALLTHROUGH*/ + case CTX_PROCESS_IMCU: + /* Call postprocessor using previously set pointers */ + (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr], + &mymain->rowgroup_ctr, mymain->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mymain->rowgroup_ctr < mymain->rowgroups_avail) + return; /* Need to suspend */ + /* After the first iMCU, change wraparound pointers to normal state */ + if (mymain->iMCU_row_ctr == 1) + set_wraparound_pointers(cinfo); + /* Prepare to load new iMCU row using other xbuffer list */ + mymain->whichptr ^= 1; /* 0=>1 or 1=>0 */ + mymain->buffer_full = FALSE; + /* Still need to process last row group of this iMCU row, */ + /* which is saved at index M+1 of the other xbuffer */ + mymain->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1); + mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2); + mymain->context_state = CTX_POSTPONED_ROW; + } +} + + +/* + * Process some data. + * Final pass of two-pass quantization: just call the postprocessor. + * Source data will be the postprocessor controller's internal buffer. + */ + +#ifdef QUANT_2PASS_SUPPORTED + +METHODDEF(void) +process_data_crank_post (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL, + (JDIMENSION *) NULL, (JDIMENSION) 0, + output_buf, out_row_ctr, out_rows_avail); +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mymain; + int ci, rgroup, ngroups; + jpeg_component_info *compptr; + + mymain = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = (struct jpeg_d_main_controller *) mymain; + mymain->pub.start_pass = start_pass_main; + + if (need_full_buffer) /* shouldn't happen */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Allocate the workspace. + * ngroups is the number of row groups we need. + */ + if (cinfo->upsample->need_context_rows) { + if (cinfo->min_codec_data_unit < 2) /* unsupported, see comments above */ + ERREXIT(cinfo, JERR_NOTIMPL); + alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ + ngroups = cinfo->min_codec_data_unit + 2; + } else { + ngroups = cinfo->min_codec_data_unit; + } + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + mymain->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_data_units * (JDIMENSION) compptr->codec_data_unit, + (JDIMENSION) (rgroup * ngroups)); + } +} diff --git a/dcmjpeg/libijg12/jdmarker.c b/dcmjpeg/libijg12/jdmarker.c new file mode 100644 index 00000000..355835c7 --- /dev/null +++ b/dcmjpeg/libijg12/jdmarker.c @@ -0,0 +1,1370 @@ +/* + * jdmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to decode JPEG datastream markers. + * Most of the complexity arises from our desire to support input + * suspension: if not all of the data for a marker is available, + * we must exit back to the application. On resumption, we reprocess + * the marker. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_reader pub; /* public fields */ + + /* Application-overridable marker processing methods */ + jpeg_marker_parser_method process_COM; + jpeg_marker_parser_method process_APPn[16]; + + /* Limit on marker data length to save for each marker type */ + unsigned int length_limit_COM; + unsigned int length_limit_APPn[16]; + + /* Status of COM/APPn marker saving */ + jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */ + unsigned int bytes_read; /* data bytes read so far in marker */ + /* Note: cur_marker is not linked into marker_list until it's all read. */ +} my_marker_reader; + +typedef my_marker_reader * my_marker_ptr; + + +/* + * Macros for fetching data from the data source module. + * + * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect + * the current restart point; we update them only when we have reached a + * suitable place to restart if a suspension occurs. + */ + +/* Declare and initialize local copies of input pointer/count */ +#define INPUT_VARS(cinfo) \ + struct jpeg_source_mgr * datasrc = (cinfo)->src; \ + const JOCTET * next_input_byte = datasrc->next_input_byte; \ + size_t bytes_in_buffer = datasrc->bytes_in_buffer + +/* Unload the local copies --- do this only at a restart boundary */ +#define INPUT_SYNC(cinfo) \ + ( datasrc->next_input_byte = next_input_byte, \ + datasrc->bytes_in_buffer = bytes_in_buffer ) + +/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */ +#define INPUT_RELOAD(cinfo) \ + ( next_input_byte = datasrc->next_input_byte, \ + bytes_in_buffer = datasrc->bytes_in_buffer ) + +/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available. + * Note we do *not* do INPUT_SYNC before calling fill_input_buffer, + * but we must reload the local copies after a successful fill. + */ +#define MAKE_BYTE_AVAIL(cinfo,action) \ + if (bytes_in_buffer == 0) { \ + if (! (*datasrc->fill_input_buffer) (cinfo)) \ + { action; } \ + INPUT_RELOAD(cinfo); \ + } + +/* Read a byte into variable V. + * If must suspend, take the specified action (typically "return FALSE"). + */ +#define INPUT_BYTE(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = GETJOCTET(*next_input_byte++); ) + +/* As above, but read two bytes interpreted as an unsigned 16-bit integer. + * V should be declared unsigned int or perhaps IJG_INT32. + */ +#define INPUT_2BYTES(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ + MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V += GETJOCTET(*next_input_byte++); ) + + +/* + * Routines to process JPEG markers. + * + * Entry condition: JPEG marker itself has been read and its code saved + * in cinfo->unread_marker; input restart point is just after the marker. + * + * Exit: if return TRUE, have read and processed any parameters, and have + * updated the restart point to point after the parameters. + * If return FALSE, was forced to suspend before reaching end of + * marker parameters; restart point has not been moved. Same routine + * will be called again after application supplies more input data. + * + * This approach to suspension assumes that all of a marker's parameters + * can fit into a single input bufferload. This should hold for "normal" + * markers. Some COM/APPn markers might have large parameter segments + * that might not fit. If we are simply dropping such a marker, we use + * skip_input_data to get past it, and thereby put the problem on the + * source manager's shoulders. If we are saving the marker's contents + * into memory, we use a slightly different convention: when forced to + * suspend, the marker processor updates the restart point to the end of + * what it's consumed (ie, the end of the buffer) before returning FALSE. + * On resumption, cinfo->unread_marker still contains the marker code, + * but the data source will point to the next chunk of marker data. + * The marker processor must retain internal state to deal with this. + * + * Note that we don't bother to avoid duplicate trace messages if a + * suspension occurs within marker parameters. Other side effects + * require more care. + */ + + +LOCAL(boolean) +get_soi (j_decompress_ptr cinfo) +/* Process an SOI marker */ +{ + int i; + + TRACEMS(cinfo, 1, JTRC_SOI); + + if (cinfo->marker->saw_SOI) + ERREXIT(cinfo, JERR_SOI_DUPLICATE); + + /* Reset all parameters that are defined to be reset by SOI */ + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + cinfo->restart_interval = 0; + + /* Set initial assumptions for colorspace etc */ + + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ + + cinfo->saw_JFIF_marker = FALSE; + cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; + cinfo->X_density = 1; + cinfo->Y_density = 1; + cinfo->saw_Adobe_marker = FALSE; + cinfo->Adobe_transform = 0; + + cinfo->marker->saw_SOI = TRUE; + + return TRUE; +} + + +LOCAL(boolean) +get_sof (j_decompress_ptr cinfo, J_CODEC_PROCESS process, boolean is_arith, + int data_unit) +/* Process a SOFn marker */ +{ + IJG_INT32 length; + int c, ci; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + cinfo->data_unit = data_unit; + cinfo->process = process; + cinfo->arith_code = is_arith; + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE); + INPUT_BYTE(cinfo, cinfo->num_components, return FALSE); + + length -= 8; + + TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker, + (int) cinfo->image_width, (int) cinfo->image_height, + cinfo->num_components); + + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_DUPLICATE); + + /* We don't support files in which the image height is initially specified */ + /* as 0 and is later redefined by DNL. As long as we have to check that, */ + /* might as well have a general sanity check. */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 + || cinfo->num_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + if (length != (cinfo->num_components * 3)) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + if (cinfo->comp_info == NULL) /* do only once, even if suspend */ + cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * SIZEOF(jpeg_component_info)); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->component_index = ci; + INPUT_BYTE(cinfo, compptr->component_id, return FALSE); + INPUT_BYTE(cinfo, c, return FALSE); + compptr->h_samp_factor = (c >> 4) & 15; + compptr->v_samp_factor = (c ) & 15; + INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); + + TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, + compptr->component_id, compptr->h_samp_factor, + compptr->v_samp_factor, compptr->quant_tbl_no); + } + + cinfo->marker->saw_SOF = TRUE; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_sos (j_decompress_ptr cinfo) +/* Process a SOS marker */ +{ + IJG_INT32 length; + int i, ci, n, c, cc; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + if (! cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOS_NO_SOF); + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */ + + TRACEMS1(cinfo, 1, JTRC_SOS, n); + + if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + cinfo->comps_in_scan = n; + + /* Collect the component-spec parameters */ + + for (i = 0; i < n; i++) { + INPUT_BYTE(cinfo, cc, return FALSE); + INPUT_BYTE(cinfo, c, return FALSE); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (cc == compptr->component_id) + goto id_found; + } + + ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); + + id_found: + + cinfo->cur_comp_info[i] = compptr; + compptr->dc_tbl_no = (c >> 4) & 15; + compptr->ac_tbl_no = (c ) & 15; + + TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, + compptr->dc_tbl_no, compptr->ac_tbl_no); + } + + /* Collect the additional scan parameters Ss, Se, Ah/Al. */ + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ss = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Se = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ah = (c >> 4) & 15; + cinfo->Al = (c ) & 15; + + TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se, + cinfo->Ah, cinfo->Al); + + /* Prepare to scan data & restart markers */ + cinfo->marker->next_restart_num = 0; + + /* Count another SOS marker */ + cinfo->input_scan_number++; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +#ifdef D_ARITH_CODING_SUPPORTED + +LOCAL(boolean) +get_dac (j_decompress_ptr cinfo) +/* Process a DAC marker */ +{ + IJG_INT32 length; + int idx, val; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + INPUT_BYTE(cinfo, idx, return FALSE); + INPUT_BYTE(cinfo, val, return FALSE); + + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_DAC, idx, val); + + if (idx < 0 || idx >= (2*NUM_ARITH_TBLS)) + ERREXIT1(cinfo, JERR_DAC_INDEX, idx); + + if (idx >= NUM_ARITH_TBLS) { /* define AC table */ + cinfo->arith_ac_K[idx-NUM_ARITH_TBLS] = (UINT8) val; + } else { /* define DC table */ + cinfo->arith_dc_L[idx] = (UINT8) (val & 0x0F); + cinfo->arith_dc_U[idx] = (UINT8) (val >> 4); + if (cinfo->arith_dc_L[idx] > cinfo->arith_dc_U[idx]) + ERREXIT1(cinfo, JERR_DAC_VALUE, val); + } + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + +#else /* ! D_ARITH_CODING_SUPPORTED */ + +#define get_dac(cinfo) skip_variable(cinfo) + +#endif /* D_ARITH_CODING_SUPPORTED */ + + +LOCAL(boolean) +get_dht (j_decompress_ptr cinfo) +/* Process a DHT marker */ +{ + IJG_INT32 length; + UINT8 bits[17]; + UINT8 huffval[256]; + int i, idx, count; + JHUFF_TBL **htblptr; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 16) { + INPUT_BYTE(cinfo, idx, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DHT, idx); + + bits[0] = 0; + count = 0; + for (i = 1; i <= 16; i++) { + INPUT_BYTE(cinfo, bits[i], return FALSE); + count += bits[i]; + } + + length -= 1 + 16; + + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[1], bits[2], bits[3], bits[4], + bits[5], bits[6], bits[7], bits[8]); + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[9], bits[10], bits[11], bits[12], + bits[13], bits[14], bits[15], bits[16]); + + /* Here we just do minimal validation of the counts to avoid walking + * off the end of our table space. jdhuff.c will check more carefully. + */ + if (count > 256 || ((IJG_INT32) count) > length) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + for (i = 0; i < count; i++) + INPUT_BYTE(cinfo, huffval[i], return FALSE); + + length -= count; + + if (idx & 0x10) { /* AC table definition */ + idx -= 0x10; + htblptr = &cinfo->ac_huff_tbl_ptrs[idx]; + } else { /* DC table definition */ + htblptr = &cinfo->dc_huff_tbl_ptrs[idx]; + } + + if (idx < 0 || idx >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_DHT_INDEX, idx); + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dqt (j_decompress_ptr cinfo) +/* Process a DQT marker */ +{ + IJG_INT32 length; + int n, i, prec; + unsigned int tmp; + JQUANT_TBL *quant_ptr; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + INPUT_BYTE(cinfo, n, return FALSE); + prec = n >> 4; + n &= 0x0F; + + TRACEMS2(cinfo, 1, JTRC_DQT, n, prec); + + if (n >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, n); + + if (cinfo->quant_tbl_ptrs[n] == NULL) + cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); + quant_ptr = cinfo->quant_tbl_ptrs[n]; + + for (i = 0; i < DCTSIZE2; i++) { + if (prec) + INPUT_2BYTES(cinfo, tmp, return FALSE); + else + INPUT_BYTE(cinfo, tmp, return FALSE); + /* We convert the zigzag-order table to natural array order. */ + quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp; + } + + if (cinfo->err->trace_level >= 2) { + for (i = 0; i < DCTSIZE2; i += 8) { + TRACEMS8(cinfo, 2, JTRC_QUANTVALS, + quant_ptr->quantval[i], quant_ptr->quantval[i+1], + quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], + quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], + quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); + } + } + + length -= DCTSIZE2+1; + if (prec) length -= DCTSIZE2; + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dri (j_decompress_ptr cinfo) +/* Process a DRI marker */ +{ + IJG_INT32 length; + unsigned int tmp; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + + if (length != 4) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_2BYTES(cinfo, tmp, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DRI, (int)tmp); + + cinfo->restart_interval = tmp; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Routines for processing APPn and COM markers. + * These are either saved in memory or discarded, per application request. + * APP0 and APP14 are specially checked to see if they are + * JFIF and Adobe markers, respectively. + */ + +#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */ +#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */ +#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */ + + +LOCAL(void) +examine_app0 (j_decompress_ptr cinfo, const JOCTET FAR * data, + unsigned int datalen, IJG_INT32 remaining) +/* Examine first few bytes from an APP0. + * Take appropriate action if it is a JFIF marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + IJG_INT32 totallen = (IJG_INT32) datalen + remaining; + + if (datalen >= APP0_DATA_LEN && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x49 && + GETJOCTET(data[3]) == 0x46 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF APP0 marker: save info */ + cinfo->saw_JFIF_marker = TRUE; + cinfo->JFIF_major_version = GETJOCTET(data[5]); + cinfo->JFIF_minor_version = GETJOCTET(data[6]); + cinfo->density_unit = GETJOCTET(data[7]); + cinfo->X_density = (UINT16)((GETJOCTET(data[8]) << 8) + GETJOCTET(data[9])); + cinfo->Y_density = (UINT16)((GETJOCTET(data[10]) << 8) + GETJOCTET(data[11])); + /* Check version. + * Major version must be 1, anything else signals an incompatible change. + * (We used to treat this as an error, but now it's a nonfatal warning, + * because some bozo at Hijaak couldn't read the spec.) + * Minor version should be 0..2, but process anyway if newer. + */ + if (cinfo->JFIF_major_version != 1) + WARNMS2(cinfo, JWRN_JFIF_MAJOR, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version); + /* Generate trace messages */ + TRACEMS5(cinfo, 1, JTRC_JFIF, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version, + cinfo->X_density, cinfo->Y_density, cinfo->density_unit); + /* Validate thumbnail dimensions and issue appropriate messages */ + if (GETJOCTET(data[12]) | GETJOCTET(data[13])) + TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, + GETJOCTET(data[12]), GETJOCTET(data[13])); + totallen -= APP0_DATA_LEN; + if (totallen != + ((IJG_INT32)GETJOCTET(data[12]) * (IJG_INT32)GETJOCTET(data[13]) * (IJG_INT32) 3)) + TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen); + } else if (datalen >= 6 && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x58 && + GETJOCTET(data[3]) == 0x58 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF "JFXX" extension APP0 marker */ + /* The library doesn't actually do anything with these, + * but we try to produce a helpful trace message. + */ + switch (GETJOCTET(data[5])) { + case 0x10: + TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen); + break; + case 0x11: + TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen); + break; + case 0x13: + TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen); + break; + default: + TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, + GETJOCTET(data[5]), (int) totallen); + break; + } + } else { + /* Start of APP0 does not match "JFIF" or "JFXX", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen); + } +} + + +LOCAL(void) +examine_app14 (j_decompress_ptr cinfo, const JOCTET FAR * data, + unsigned int datalen, IJG_INT32 remaining) +/* Examine first few bytes from an APP14. + * Take appropriate action if it is an Adobe marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + unsigned int version, flags0, flags1, transform; + + if (datalen >= APP14_DATA_LEN && + GETJOCTET(data[0]) == 0x41 && + GETJOCTET(data[1]) == 0x64 && + GETJOCTET(data[2]) == 0x6F && + GETJOCTET(data[3]) == 0x62 && + GETJOCTET(data[4]) == 0x65) { + /* Found Adobe APP14 marker */ + version = (unsigned int)((GETJOCTET(data[5]) << 8) + GETJOCTET(data[6])); + flags0 = (unsigned int)((GETJOCTET(data[7]) << 8) + GETJOCTET(data[8])); + flags1 = (unsigned int)((GETJOCTET(data[9]) << 8) + GETJOCTET(data[10])); + transform = GETJOCTET(data[11]); + TRACEMS4(cinfo, 1, JTRC_ADOBE, (int)version, (int)flags0, (int)flags1, (int)transform); + cinfo->saw_Adobe_marker = TRUE; + cinfo->Adobe_transform = (UINT8) transform; + } else { + /* Start of APP14 does not match "Adobe", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining)); + } +} + + +METHODDEF(boolean) +get_interesting_appn (j_decompress_ptr cinfo) +/* Process an APP0 or APP14 marker without saving it */ +{ + IJG_INT32 length; + JOCTET b[APPN_DATA_LEN]; + unsigned int i, numtoread; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + /* get the interesting part of the marker data */ + if (length >= APPN_DATA_LEN) + numtoread = APPN_DATA_LEN; + else if (length > 0) + numtoread = (unsigned int) length; + else + numtoread = 0; + for (i = 0; i < numtoread; i++) + INPUT_BYTE(cinfo, b[i], return FALSE); + length -= numtoread; + + /* process it */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + case M_APP14: + examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + default: + /* can't get here unless jpeg_save_markers chooses wrong processor */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +#ifdef SAVE_MARKERS_SUPPORTED + +METHODDEF(boolean) +save_marker (j_decompress_ptr cinfo) +/* Save an APPn or COM marker into the marker list */ +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + jpeg_saved_marker_ptr cur_marker = marker->cur_marker; + unsigned int bytes_read, data_length; + JOCTET FAR * data; + IJG_INT32 length = 0; + INPUT_VARS(cinfo); + + if (cur_marker == NULL) { + /* begin reading a marker */ + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + if (length >= 0) { /* watch out for bogus length word */ + /* figure out how much we want to save */ + unsigned int limit; + if (cinfo->unread_marker == (int) M_COM) + limit = marker->length_limit_COM; + else + limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0]; + if ((unsigned int) length < limit) + limit = (unsigned int) length; + /* allocate and initialize the marker item */ + cur_marker = (jpeg_saved_marker_ptr) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(struct jpeg_marker_struct) + limit); + cur_marker->next = NULL; + cur_marker->marker = (UINT8) cinfo->unread_marker; + cur_marker->original_length = (unsigned int) length; + cur_marker->data_length = limit; + /* data area is just beyond the jpeg_marker_struct */ + data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1); + marker->cur_marker = cur_marker; + marker->bytes_read = 0; + bytes_read = 0; + data_length = limit; + } else { + /* deal with bogus length word */ + bytes_read = data_length = 0; + data = NULL; + } + } else { + /* resume reading a marker */ + bytes_read = marker->bytes_read; + data_length = cur_marker->data_length; + data = cur_marker->data + bytes_read; + } + + while (bytes_read < data_length) { + INPUT_SYNC(cinfo); /* move the restart point to here */ + marker->bytes_read = bytes_read; + /* If there's not at least one byte in buffer, suspend */ + MAKE_BYTE_AVAIL(cinfo, return FALSE); + /* Copy bytes with reasonable rapidity */ + while (bytes_read < data_length && bytes_in_buffer > 0) { + *data++ = *next_input_byte++; + bytes_in_buffer--; + bytes_read++; + } + } + + /* Done reading what we want to read */ + if (cur_marker != NULL) { /* will be NULL if bogus length word */ + /* Add new marker to end of list */ + if (cinfo->marker_list == NULL) { + cinfo->marker_list = cur_marker; + } else { + jpeg_saved_marker_ptr prev = cinfo->marker_list; + while (prev->next != NULL) + prev = prev->next; + prev->next = cur_marker; + } + /* Reset pointer & calc remaining data length */ + data = cur_marker->data; + length = cur_marker->original_length - data_length; + } + /* Reset to initial state for next marker */ + marker->cur_marker = NULL; + + /* Process the marker if interesting; else just make a generic trace msg */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, data, data_length, length); + break; + case M_APP14: + examine_app14(cinfo, data, data_length, length); + break; + default: + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, + (int) (data_length + length)); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +METHODDEF(boolean) +skip_variable (j_decompress_ptr cinfo) +/* Skip over an unknown or uninteresting variable-length marker */ +{ + IJG_INT32 length; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); + + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +/* + * Find the next JPEG marker, save it in cinfo->unread_marker. + * Returns FALSE if had to suspend before reaching a marker; + * in that case cinfo->unread_marker is unchanged. + * + * Note that the result might not be a valid marker code, + * but it will never be 0 or FF. + */ + +LOCAL(boolean) +next_marker (j_decompress_ptr cinfo) +{ + int c; + INPUT_VARS(cinfo); + + for (;;) { + INPUT_BYTE(cinfo, c, return FALSE); + /* Skip any non-FF bytes. + * This may look a bit inefficient, but it will not occur in a valid file. + * We sync after each discarded byte so that a suspending data source + * can discard the byte from its buffer. + */ + while (c != 0xFF) { + cinfo->marker->discarded_bytes++; + INPUT_SYNC(cinfo); + INPUT_BYTE(cinfo, c, return FALSE); + } + /* This loop swallows any duplicate FF bytes. Extra FFs are legal as + * pad bytes, so don't count them in discarded_bytes. We assume there + * will not be so many consecutive FF bytes as to overflow a suspending + * data source's input buffer. + */ + do { + INPUT_BYTE(cinfo, c, return FALSE); + } while (c == 0xFF); + if (c != 0) + break; /* found a valid marker, exit loop */ + /* Reach here if we found a stuffed-zero data sequence (FF/00). + * Discard it and loop back to try again. + */ + cinfo->marker->discarded_bytes += 2; + INPUT_SYNC(cinfo); + } + + if (cinfo->marker->discarded_bytes != 0) { + WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, (int)cinfo->marker->discarded_bytes, c); + cinfo->marker->discarded_bytes = 0; + } + + cinfo->unread_marker = c; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +first_marker (j_decompress_ptr cinfo) +/* Like next_marker, but used to obtain the initial SOI marker. */ +/* For this marker, we do not allow preceding garbage or fill; otherwise, + * we might well scan an entire input file before realizing it ain't JPEG. + * If an application wants to process non-JFIF files, it must seek to the + * SOI before calling the JPEG library. + */ +{ + int c, c2; + INPUT_VARS(cinfo); + + INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c2, return FALSE); + if (c != 0xFF || c2 != (int) M_SOI) + ERREXIT2(cinfo, JERR_NO_SOI, c, c2); + + cinfo->unread_marker = c2; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Read markers until SOS or EOI. + * + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + */ + +METHODDEF(int) +read_markers (j_decompress_ptr cinfo) +{ + /* Outer loop repeats once for each marker. */ + for (;;) { + /* Collect the marker proper, unless we already did. */ + /* NB: first_marker() enforces the requirement that SOI appear first. */ + if (cinfo->unread_marker == 0) { + if (! cinfo->marker->saw_SOI) { + if (! first_marker(cinfo)) + return JPEG_SUSPENDED; + } else { + if (! next_marker(cinfo)) + return JPEG_SUSPENDED; + } + } + /* At this point cinfo->unread_marker contains the marker code and the + * input point is just past the marker proper, but before any parameters. + * A suspension will cause us to return with this state still true. + */ + switch (cinfo->unread_marker) { + case M_SOI: + if (! get_soi(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_SOF0: /* Baseline */ + case M_SOF1: /* Extended sequential, Huffman */ + if (! get_sof(cinfo, JPROC_SEQUENTIAL, FALSE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF2: /* Progressive, Huffman */ + if (! get_sof(cinfo, JPROC_PROGRESSIVE, FALSE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF3: /* Lossless, Huffman */ + if (! get_sof(cinfo, JPROC_LOSSLESS, FALSE, 1)) + return JPEG_SUSPENDED; + break; + + case M_SOF9: /* Extended sequential, arithmetic */ + if (! get_sof(cinfo, JPROC_SEQUENTIAL, TRUE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF10: /* Progressive, arithmetic */ + if (! get_sof(cinfo, JPROC_PROGRESSIVE, TRUE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF11: /* Lossless, arithmetic */ + if (! get_sof(cinfo, JPROC_LOSSLESS, TRUE, 1)) + return JPEG_SUSPENDED; + break; + + /* Currently unsupported SOFn types */ + case M_SOF5: /* Differential sequential, Huffman */ + case M_SOF6: /* Differential progressive, Huffman */ + case M_SOF7: /* Differential lossless, Huffman */ + case M_JPG: /* Reserved for JPEG extensions */ + case M_SOF13: /* Differential sequential, arithmetic */ + case M_SOF14: /* Differential progressive, arithmetic */ + case M_SOF15: /* Differential lossless, arithmetic */ + ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker); + break; + + case M_SOS: + if (! get_sos(cinfo)) + return JPEG_SUSPENDED; + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_SOS; + + case M_EOI: + TRACEMS(cinfo, 1, JTRC_EOI); + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_EOI; + + case M_DAC: + if (! get_dac(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DHT: + if (! get_dht(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DQT: + if (! get_dqt(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DRI: + if (! get_dri(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_APP0: + case M_APP1: + case M_APP2: + case M_APP3: + case M_APP4: + case M_APP5: + case M_APP6: + case M_APP7: + case M_APP8: + case M_APP9: + case M_APP10: + case M_APP11: + case M_APP12: + case M_APP13: + case M_APP14: + case M_APP15: + if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[ + cinfo->unread_marker - (int) M_APP0]) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_COM: + if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_RST0: /* these are all parameterless */ + case M_RST1: + case M_RST2: + case M_RST3: + case M_RST4: + case M_RST5: + case M_RST6: + case M_RST7: + case M_TEM: + TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker); + break; + + case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ + if (! skip_variable(cinfo)) + return JPEG_SUSPENDED; + break; + + default: /* must be DHP, EXP, JPGn, or RESn */ + /* For now, we treat the reserved markers as fatal errors since they are + * likely to be used to signal incompatible JPEG Part 3 extensions. + * Once the JPEG 3 version-number marker is well defined, this code + * ought to change! + */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + /* Successfully processed marker, so reset state variable */ + cinfo->unread_marker = 0; + } /* end loop */ +} + + +/* + * Read a restart marker, which is expected to appear next in the datastream; + * if the marker is not there, take appropriate recovery action. + * Returns FALSE if suspension is required. + * + * This is called by the entropy decoder after it has read an appropriate + * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder + * has already read a marker from the data source. Under normal conditions + * cinfo->unread_marker will be reset to 0 before returning; if not reset, + * it holds a marker which the decoder will be unable to read past. + */ + +METHODDEF(boolean) +read_restart_marker (j_decompress_ptr cinfo) +{ + /* Obtain a marker unless we already did. */ + /* Note that next_marker will complain if it skips any data. */ + if (cinfo->unread_marker == 0) { + if (! next_marker(cinfo)) + return FALSE; + } + + if (cinfo->unread_marker == + ((int) M_RST0 + cinfo->marker->next_restart_num)) { + /* Normal case --- swallow the marker and let entropy decoder continue */ + TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num); + cinfo->unread_marker = 0; + } else { + /* Uh-oh, the restart markers have been messed up. */ + /* Let the data source manager determine how to resync. */ + if (! (*cinfo->src->resync_to_restart) (cinfo, + cinfo->marker->next_restart_num)) + return FALSE; + } + + /* Update next-restart state */ + cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7; + + return TRUE; +} + + +/* + * This is the default resync_to_restart method for data source managers + * to use if they don't have any better approach. Some data source managers + * may be able to back up, or may have additional knowledge about the data + * which permits a more intelligent recovery strategy; such managers would + * presumably supply their own resync method. + * + * read_restart_marker calls resync_to_restart if it finds a marker other than + * the restart marker it was expecting. (This code is *not* used unless + * a nonzero restart interval has been declared.) cinfo->unread_marker is + * the marker code actually found (might be anything, except 0 or FF). + * The desired restart marker number (0..7) is passed as a parameter. + * This routine is supposed to apply whatever error recovery strategy seems + * appropriate in order to position the input stream to the next data segment. + * Note that cinfo->unread_marker is treated as a marker appearing before + * the current data-source input point; usually it should be reset to zero + * before returning. + * Returns FALSE if suspension is required. + * + * This implementation is substantially constrained by wanting to treat the + * input as a data stream; this means we can't back up. Therefore, we have + * only the following actions to work with: + * 1. Simply discard the marker and let the entropy decoder resume at next + * byte of file. + * 2. Read forward until we find another marker, discarding intervening + * data. (In theory we could look ahead within the current bufferload, + * without having to discard data if we don't find the desired marker. + * This idea is not implemented here, in part because it makes behavior + * dependent on buffer size and chance buffer-boundary positions.) + * 3. Leave the marker unread (by failing to zero cinfo->unread_marker). + * This will cause the entropy decoder to process an empty data segment, + * inserting dummy zeroes, and then we will reprocess the marker. + * + * #2 is appropriate if we think the desired marker lies ahead, while #3 is + * appropriate if the found marker is a future restart marker (indicating + * that we have missed the desired restart marker, probably because it got + * corrupted). + * We apply #2 or #3 if the found marker is a restart marker no more than + * two counts behind or ahead of the expected one. We also apply #2 if the + * found marker is not a legal JPEG marker code (it's certainly bogus data). + * If the found marker is a restart marker more than 2 counts away, we do #1 + * (too much risk that the marker is erroneous; with luck we will be able to + * resync at some future point). + * For any valid non-restart JPEG marker, we apply #3. This keeps us from + * overrunning the end of a scan. An implementation limited to single-scan + * files might find it better to apply #2 for markers other than EOI, since + * any other marker would have to be bogus data in that case. + */ + +GLOBAL(boolean) +jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) +{ + int marker = cinfo->unread_marker; + int action = 1; + + /* Always put up a warning. */ + WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); + + /* Outer loop handles repeated decision after scanning forward. */ + for (;;) { + if (marker < (int) M_SOF0) + action = 2; /* invalid marker */ + else if (marker < (int) M_RST0 || marker > (int) M_RST7) + action = 3; /* valid non-restart marker */ + else { + if (marker == ((int) M_RST0 + ((desired+1) & 7)) || + marker == ((int) M_RST0 + ((desired+2) & 7))) + action = 3; /* one of the next two expected restarts */ + else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || + marker == ((int) M_RST0 + ((desired-2) & 7))) + action = 2; /* a prior restart, so advance */ + else + action = 1; /* desired restart or too far away */ + } + TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action); + switch (action) { + case 1: + /* Discard marker and let entropy decoder resume processing. */ + cinfo->unread_marker = 0; + return TRUE; + case 2: + /* Scan to the next marker, and repeat the decision loop. */ + if (! next_marker(cinfo)) + return FALSE; + marker = cinfo->unread_marker; + break; + case 3: + /* Return without advancing past this marker. */ + /* Entropy decoder will be forced to process an empty segment. */ + return TRUE; + } + } /* end loop */ +} + + +/* + * Reset marker processing state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + cinfo->comp_info = NULL; /* until allocated by get_sof */ + cinfo->input_scan_number = 0; /* no SOS seen yet */ + cinfo->unread_marker = 0; /* no pending marker */ + marker->pub.saw_SOI = FALSE; /* set internal state too */ + marker->pub.saw_SOF = FALSE; + marker->pub.discarded_bytes = 0; + marker->cur_marker = NULL; +} + + +/* + * Initialize the marker reader module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker; + int i; + + /* Create subobject in permanent pool */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_marker_reader)); + cinfo->marker = (struct jpeg_marker_reader *) marker; + /* Initialize public method pointers */ + marker->pub.reset_marker_reader = reset_marker_reader; + marker->pub.read_markers = read_markers; + marker->pub.read_restart_marker = read_restart_marker; + /* Initialize COM/APPn processing. + * By default, we examine and then discard APP0 and APP14, + * but simply discard COM and all other APPn. + */ + marker->process_COM = skip_variable; + marker->length_limit_COM = 0; + for (i = 0; i < 16; i++) { + marker->process_APPn[i] = skip_variable; + marker->length_limit_APPn[i] = 0; + } + marker->process_APPn[0] = get_interesting_appn; + marker->process_APPn[14] = get_interesting_appn; + /* Reset marker processing state */ + reset_marker_reader(cinfo); +} + + +/* + * Control saving of COM and APPn markers into marker_list. + */ + +#ifdef SAVE_MARKERS_SUPPORTED + +GLOBAL(void) +jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + long maxlength; + jpeg_marker_parser_method processor; + + /* Length limit mustn't be larger than what we can allocate + * (should only be a concern in a 16-bit environment). + */ + maxlength = cinfo->mem->max_alloc_chunk - (long)SIZEOF(struct jpeg_marker_struct); + if (((long) length_limit) > maxlength) + length_limit = (unsigned int) maxlength; + + /* Choose processor routine to use. + * APP0/APP14 have special requirements. + */ + if (length_limit) { + processor = save_marker; + /* If saving APP0/APP14, save at least enough for our internal use. */ + if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN) + length_limit = APP0_DATA_LEN; + else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN) + length_limit = APP14_DATA_LEN; + } else { + processor = skip_variable; + /* If discarding APP0/APP14, use our regular on-the-fly processor. */ + if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14) + processor = get_interesting_appn; + } + + if (marker_code == (int) M_COM) { + marker->process_COM = processor; + marker->length_limit_COM = length_limit; + } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) { + marker->process_APPn[marker_code - (int) M_APP0] = processor; + marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit; + } else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +/* + * Install a special processing method for COM or APPn markers. + */ + +GLOBAL(void) +jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + if (marker_code == (int) M_COM) + marker->process_COM = routine; + else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) + marker->process_APPn[marker_code - (int) M_APP0] = routine; + else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} diff --git a/dcmjpeg/libijg12/jdmaster.c b/dcmjpeg/libijg12/jdmaster.c new file mode 100644 index 00000000..b7a8936c --- /dev/null +++ b/dcmjpeg/libijg12/jdmaster.c @@ -0,0 +1,460 @@ +/* + * jdmaster.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG decompressor. + * These routines are concerned with selecting the modules to be executed + * and with determining the number of passes and the work to be done in each + * pass. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Private state */ + +typedef struct { + struct jpeg_decomp_master pub; /* public fields */ + + int pass_number; /* # of passes completed */ + + boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ + + /* Saved references to initialized quantizer modules, + * in case we need to switch modes. + */ + struct jpeg_color_quantizer * quantizer_1pass; + struct jpeg_color_quantizer * quantizer_2pass; +} my_decomp_master; + +typedef my_decomp_master * my_master_ptr; + + +/* + * Determine whether merged upsample/color conversion should be used. + * CRUCIAL: this must match the actual capabilities of jdmerge.c! + */ + +LOCAL(boolean) +use_merged_upsample (j_decompress_ptr cinfo) +{ +#ifdef UPSAMPLE_MERGING_SUPPORTED + /* Merging is the equivalent of plain box-filter upsampling */ + if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) + return FALSE; + /* jdmerge.c only supports YCC=>RGB color conversion */ + if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || + cinfo->out_color_space != JCS_RGB || + cinfo->out_color_components != RGB_PIXELSIZE) + return FALSE; + /* and it only handles 2h1v or 2h2v sampling ratios */ + if (cinfo->comp_info[0].h_samp_factor != 2 || + cinfo->comp_info[1].h_samp_factor != 1 || + cinfo->comp_info[2].h_samp_factor != 1 || + cinfo->comp_info[0].v_samp_factor > 2 || + cinfo->comp_info[1].v_samp_factor != 1 || + cinfo->comp_info[2].v_samp_factor != 1) + return FALSE; + /* furthermore, it doesn't work if each component has been + processed differently */ + if (cinfo->comp_info[0].codec_data_unit != cinfo->min_codec_data_unit || + cinfo->comp_info[1].codec_data_unit != cinfo->min_codec_data_unit || + cinfo->comp_info[2].codec_data_unit != cinfo->min_codec_data_unit) + return FALSE; + /* ??? also need to test for upsample-time rescaling, when & if supported */ + return TRUE; /* by golly, it'll work... */ +#else + return FALSE; +#endif +} + + +/* + * Compute output image dimensions and related values. + * NOTE: this is exported for possible use by application. + * Hence it mustn't do anything that can't be done twice. + * Also note that it may be called before the master module is initialized! + */ + +GLOBAL(void) +jpeg_calc_output_dimensions (j_decompress_ptr cinfo) +/* Do computations that are needed before master selection phase */ +{ + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_READY) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->codec->calc_output_dimensions) (cinfo); + + /* Report number of components in selected colorspace. */ + /* Probably this should be in the color conversion module... */ + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + break; + case JCS_RGB: +#if RGB_PIXELSIZE != 3 + cinfo->out_color_components = RGB_PIXELSIZE; + break; +#endif /* else share code with YCbCr */ + case JCS_YCbCr: + cinfo->out_color_components = 3; + break; + case JCS_CMYK: + case JCS_YCCK: + cinfo->out_color_components = 4; + break; + default: /* else must be same colorspace as in file */ + cinfo->out_color_components = cinfo->num_components; + break; + } + cinfo->output_components = (cinfo->quantize_colors ? 1 : + cinfo->out_color_components); + + /* See if upsampler will want to emit more than one row at a time */ + if (use_merged_upsample(cinfo)) + cinfo->rec_outbuf_height = cinfo->max_v_samp_factor; + else + cinfo->rec_outbuf_height = 1; +} + + +/* + * Several decompression processes need to range-limit values to the range + * 0..MAXJSAMPLE; the input value may fall somewhat outside this range + * due to noise introduced by quantization, roundoff error, etc. These + * processes are inner loops and need to be as fast as possible. On most + * machines, particularly CPUs with pipelines or instruction prefetch, + * a (subscript-check-less) C table lookup + * x = sample_range_limit[x]; + * is faster than explicit tests + * if (x < 0) x = 0; + * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; + * These processes all use a common table prepared by the routine below. + * + * For most steps we can mathematically guarantee that the initial value + * of x is within MAXJSAMPLE+1 of the legal range, so a table running from + * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial + * limiting step (just after the IDCT), a wildly out-of-range value is + * possible if the input data is corrupt. To avoid any chance of indexing + * off the end of memory and getting a bad-pointer trap, we perform the + * post-IDCT limiting thus: + * x = range_limit[x & MASK]; + * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit + * samples. Under normal circumstances this is more than enough range and + * a correct output will be generated; with bogus input data the mask will + * cause wraparound, and we will safely generate a bogus-but-in-range output. + * For the post-IDCT step, we want to convert the data from signed to unsigned + * representation by adding CENTERJSAMPLE at the same time that we limit it. + * So the post-IDCT limiting table ends up looking like this: + * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE, + * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0,1,...,CENTERJSAMPLE-1 + * Negative inputs select values from the upper half of the table after + * masking. + * + * We can save some space by overlapping the start of the post-IDCT table + * with the simpler range limiting table. The post-IDCT table begins at + * sample_range_limit + CENTERJSAMPLE. + * + * Note that the table is allocated in near data space on PCs; it's small + * enough and used often enough to justify this. + */ + +LOCAL(void) +prepare_range_limit_table (j_decompress_ptr cinfo) +/* Allocate and fill in the sample_range_limit table */ +{ + JSAMPLE * table; + int i; + + table = (JSAMPLE *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ + cinfo->sample_range_limit = table; + /* First segment of "simple" table: limit[x] = 0 for x < 0 */ + MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + /* Main part of "simple" table: limit[x] = x */ + for (i = 0; i <= MAXJSAMPLE; i++) + table[i] = (JSAMPLE) i; + table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ + /* End of simple table, rest of first half of post-IDCT table */ + for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) + table[i] = MAXJSAMPLE; + /* Second half of post-IDCT table */ + MEMZERO(table + (2 * (MAXJSAMPLE+1)), + (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), + cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE)); +} + + +/* + * Master selection of decompression modules. + * This is done once at jpeg_start_decompress time. We determine + * which modules will be used and give them appropriate initialization calls. + * We also initialize the decompressor input side to begin consuming data. + * + * Since jpeg_read_header has finished, we know what is in the SOF + * and (first) SOS markers. We also have all the application parameter + * settings. + */ + +LOCAL(void) +master_selection (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + long samplesperrow; + JDIMENSION jd_samplesperrow; + + /* Initialize dimensions and other stuff */ + jpeg_calc_output_dimensions(cinfo); + prepare_range_limit_table(cinfo); + + /* Width of an output scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* Initialize my private state */ + master->pass_number = 0; + master->using_merged_upsample = use_merged_upsample(cinfo); + + /* Color quantizer selection */ + master->quantizer_1pass = NULL; + master->quantizer_2pass = NULL; + /* No mode changes if not using buffered-image mode. */ + if (! cinfo->quantize_colors || ! cinfo->buffered_image) { + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + } + if (cinfo->quantize_colors) { + if (cinfo->raw_data_out) + ERREXIT(cinfo, JERR_NOTIMPL); + /* 2-pass quantizer only works in 3-component color space. */ + if (cinfo->out_color_components != 3) { + cinfo->enable_1pass_quant = TRUE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + cinfo->colormap = NULL; + } else if (cinfo->colormap != NULL) { + cinfo->enable_external_quant = TRUE; + } else if (cinfo->two_pass_quantize) { + cinfo->enable_2pass_quant = TRUE; + } else { + cinfo->enable_1pass_quant = TRUE; + } + + if (cinfo->enable_1pass_quant) { +#ifdef QUANT_1PASS_SUPPORTED + jinit_1pass_quantizer(cinfo); + master->quantizer_1pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + + /* We use the 2-pass code to map to external colormaps. */ + if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) { +#ifdef QUANT_2PASS_SUPPORTED + jinit_2pass_quantizer(cinfo); + master->quantizer_2pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + /* If both quantizers are initialized, the 2-pass one is left active; + * this is necessary for starting with quantization to an external map. + */ + } + + /* Post-processing: in particular, color conversion first */ + if (! cinfo->raw_data_out) { + if (master->using_merged_upsample) { +#ifdef UPSAMPLE_MERGING_SUPPORTED + jinit_merged_upsampler(cinfo); /* does color conversion too */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + jinit_color_deconverter(cinfo); + jinit_upsampler(cinfo); + } + jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant); + } + + /* Initialize principal buffer controllers. */ + if (! cinfo->raw_data_out) + jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* If jpeg_start_decompress will read the whole file, initialize + * progress monitoring appropriately. The input step is counted + * as one pass. + */ + if (cinfo->progress != NULL && ! cinfo->buffered_image && + cinfo->inputctl->has_multiple_scans) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2); + /* Count the input pass as done */ + master->pass_number++; + } +#endif /* D_MULTISCAN_FILES_SUPPORTED */ +} + + +/* + * Per-pass setup. + * This is called at the beginning of each output pass. We determine which + * modules will be active during this pass and give them appropriate + * start_pass calls. We also set is_dummy_pass to indicate whether this + * is a "real" output pass or a dummy pass for color quantization. + * (In the latter case, jdapistd.c will crank the pass to completion.) + */ + +METHODDEF(void) +prepare_for_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (master->pub.is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Final pass of 2-pass quantization */ + master->pub.is_dummy_pass = FALSE; + (*cinfo->cquantize->start_pass) (cinfo, FALSE); + (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); + (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + if (cinfo->quantize_colors && cinfo->colormap == NULL) { + /* Select new quantization method */ + if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) { + cinfo->cquantize = master->quantizer_2pass; + master->pub.is_dummy_pass = TRUE; + } else if (cinfo->enable_1pass_quant) { + cinfo->cquantize = master->quantizer_1pass; + } else { + ERREXIT(cinfo, JERR_MODE_CHANGE); + } + } + (*cinfo->codec->start_output_pass) (cinfo); + if (! cinfo->raw_data_out) { + if (! master->using_merged_upsample) + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->upsample->start_pass) (cinfo); + if (cinfo->quantize_colors) + (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass); + (*cinfo->post->start_pass) (cinfo, + (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + } + } + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->pass_number + + (master->pub.is_dummy_pass ? 2 : 1); + /* In buffered-image mode, we assume one more output pass if EOI not + * yet reached, but no more passes if EOI has been reached. + */ + if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) { + cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1); + } + } +} + + +/* + * Finish up at end of an output pass. + */ + +METHODDEF(void) +finish_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (cinfo->quantize_colors) + (*cinfo->cquantize->finish_pass) (cinfo); + master->pass_number++; +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Switch to a new external colormap between output passes. + */ + +GLOBAL(void) +jpeg_new_colormap (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_BUFIMAGE) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (cinfo->quantize_colors && cinfo->enable_external_quant && + cinfo->colormap != NULL) { + /* Select 2-pass quantizer for external colormap use */ + cinfo->cquantize = master->quantizer_2pass; + /* Notify quantizer of colormap change */ + (*cinfo->cquantize->new_color_map) (cinfo); + master->pub.is_dummy_pass = FALSE; /* just in case */ + } else + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +/* + * Initialize master decompression control and select active modules. + * This is performed at the start of jpeg_start_decompress. + */ + +GLOBAL(void) +jinit_master_decompress (j_decompress_ptr cinfo) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_decomp_master)); + cinfo->master = (struct jpeg_decomp_master *) master; + master->pub.prepare_for_output_pass = prepare_for_output_pass; + master->pub.finish_output_pass = finish_output_pass; + + master->pub.is_dummy_pass = FALSE; + + master_selection(cinfo); +} diff --git a/dcmjpeg/libijg12/jdmerge.c b/dcmjpeg/libijg12/jdmerge.c new file mode 100644 index 00000000..4a827fd3 --- /dev/null +++ b/dcmjpeg/libijg12/jdmerge.c @@ -0,0 +1,400 @@ +/* + * jdmerge.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains code for merged upsampling/color conversion. + * + * This file combines functions from jdsample.c and jdcolor.c; + * read those files first to understand what's going on. + * + * When the chroma components are to be upsampled by simple replication + * (ie, box filtering), we can save some work in color conversion by + * calculating all the output pixels corresponding to a pair of chroma + * samples at one time. In the conversion equations + * R = Y + K1 * Cr + * G = Y + K2 * Cb + K3 * Cr + * B = Y + K4 * Cb + * only the Y term varies among the group of pixels corresponding to a pair + * of chroma samples, so the rest of the terms can be calculated just once. + * At typical sampling ratios, this eliminates half or three-quarters of the + * multiplications needed for color conversion. + * + * This file currently provides implementations for the following cases: + * YCbCr => RGB color conversion only. + * Sampling ratios of 2h1v or 2h2v. + * No scaling needed at upsample time. + * Corner-aligned (non-CCIR601) sampling alignment. + * Other special cases could be added, but in most applications these are + * the only common cases. (For uncommon cases we fall back on the more + * general code in jdsample.c and jdcolor.c.) + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + +#ifdef UPSAMPLE_MERGING_SUPPORTED + + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Pointer to routine to do actual upsampling/conversion of one row group */ + JMETHOD(void, upmethod, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf)); + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + IJG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + IJG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + + /* For 2:1 vertical sampling, we produce two output rows at a time. + * We need a "spare" row buffer to hold the second output row if the + * application provides just a one-row buffer; we also use the spare + * to discard the dummy last row if the image height is odd. + */ + JSAMPROW spare_row; + boolean spare_full; /* T if spare buffer is occupied */ + + JDIMENSION out_row_width; /* samples per output row */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L<RGB colorspace conversion. + * This is taken directly from jdcolor.c; see that file for more info. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int i; + IJG_INT32 x; + SHIFT_TEMPS + + upsample->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cr_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + upsample->Cb_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + /* Cr=>R value is nearest int to 1.40200 * x */ + upsample->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + upsample->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -0.71414 * x */ + upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_merged_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the spare buffer empty */ + upsample->spare_full = FALSE; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * The control routine just handles the row buffering considerations. + */ + +METHODDEF(void) +merged_2v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 2:1 vertical sampling case: may need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPROW work_ptrs[2]; + JDIMENSION num_rows; /* number of rows returned to caller */ + + if (upsample->spare_full) { + /* If we have a spare row saved from a previous cycle, just return it. */ + jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0, + 1, upsample->out_row_width); + num_rows = 1; + upsample->spare_full = FALSE; + } else { + /* Figure number of rows to return to caller. */ + num_rows = 2; + /* Not more than the distance to the end of the image. */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + /* Create output pointer array for upsampler. */ + work_ptrs[0] = output_buf[*out_row_ctr]; + if (num_rows > 1) { + work_ptrs[1] = output_buf[*out_row_ctr + 1]; + } else { + work_ptrs[1] = upsample->spare_row; + upsample->spare_full = TRUE; + } + /* Now do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); + } + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (! upsample->spare_full) + (*in_row_group_ctr)++; +} + + +METHODDEF(void) +merged_1v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 1:1 vertical sampling case: much easier, never need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Just do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, + output_buf + *out_row_ctr); + /* Adjust counts */ + (*out_row_ctr)++; + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by the control routines to do + * the actual upsampling/conversion. One row group is processed per call. + * + * Note: since we may be writing directly into application-supplied buffers, + * we have to be honest about the output width; we can't assume the buffer + * has been rounded up to an even width. + */ + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. + */ + +METHODDEF(void) +h2v1_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr; + JSAMPROW inptr0, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + IJG_INT32 * Crgtab = upsample->Cr_g_tab; + IJG_INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr0 = input_buf[0][in_row_group_ctr]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr = output_buf[0]; + /* Loop for each pair of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 2 Y values and emit 2 pixels */ + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr0); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. + */ + +METHODDEF(void) +h2v2_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr0, outptr1; + JSAMPROW inptr00, inptr01, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + IJG_INT32 * Crgtab = upsample->Cr_g_tab; + IJG_INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr00 = input_buf[0][in_row_group_ctr*2]; + inptr01 = input_buf[0][in_row_group_ctr*2 + 1]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr0 = output_buf[0]; + outptr1 = output_buf[1]; + /* Loop for each group of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 4 Y values and emit 4 pixels */ + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr00); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + y = GETJSAMPLE(*inptr01); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Module initialization routine for merged upsampling/color conversion. + * + * NB: this is called under the conditions determined by use_merged_upsample() + * in jdmaster.c. That routine MUST correspond to the actual capabilities + * of this module; no safety checks are made here. + */ + +GLOBAL(void) +jinit_merged_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_merged_upsample; + upsample->pub.need_context_rows = FALSE; + + upsample->out_row_width = cinfo->output_width * (JDIMENSION)cinfo->out_color_components; + + if (cinfo->max_v_samp_factor == 2) { + upsample->pub.upsample = merged_2v_upsample; + upsample->upmethod = h2v2_merged_upsample; + /* Allocate a spare row buffer */ + upsample->spare_row = (JSAMPROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE))); + } else { + upsample->pub.upsample = merged_1v_upsample; + upsample->upmethod = h2v1_merged_upsample; + /* No spare row needed */ + upsample->spare_row = NULL; + } + + build_ycc_rgb_table(cinfo); +} + +#endif /* UPSAMPLE_MERGING_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jdphuff.c b/dcmjpeg/libijg12/jdphuff.c new file mode 100644 index 00000000..5adbbaf0 --- /dev/null +++ b/dcmjpeg/libijg12/jdphuff.c @@ -0,0 +1,686 @@ +/* + * jdphuff.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for progressive JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy subsystem */ +#include "jdhuff12.h" /* Declarations shared with jd*huff.c */ + + +#ifdef D_PROGRESSIVE_SUPPORTED + +/* + * Private entropy decoder object for progressive Huffman decoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + unsigned int EOBRUN; /* remaining EOBs in EOBRUN */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).EOBRUN = (src).EOBRUN, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* These fields are loaded into local variables at start of each MCU. + * In case of suspension, we exit WITHOUT updating them. + */ + savable_state saved; /* Other state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */ +} phuff_entropy_decoder; + +typedef phuff_entropy_decoder * phuff_entropy_ptr; + +/* Forward declarations */ +METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_phuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + boolean is_DC_band, bad; + int ci, coefi, tbl; + int *coef_bit_ptr; + jpeg_component_info * compptr; + + is_DC_band = (cinfo->Ss == 0); + + /* Validate scan parameters */ + bad = FALSE; + if (is_DC_band) { + if (cinfo->Se != 0) + bad = TRUE; + } else { + /* need not check Ss/Se < 0 since they came from unsigned bytes */ + if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2) + bad = TRUE; + /* AC scans may have only one component */ + if (cinfo->comps_in_scan != 1) + bad = TRUE; + } + if (cinfo->Ah != 0) { + /* Successive approximation refinement scan: must have Al = Ah-1. */ + if (cinfo->Al != cinfo->Ah-1) + bad = TRUE; + } + if (cinfo->Al > 13) /* need not check for < 0 */ + bad = TRUE; + /* Arguably the maximum Al value should be less than 13 for 8-bit precision, + * but the spec doesn't say so, and we try to be liberal about what we + * accept. Note: large Al values could result in out-of-range DC + * coefficients during early scans, leading to bizarre displays due to + * overflows in the IDCT math. But we won't crash. + */ + if (bad) + ERREXIT4(cinfo, JERR_BAD_PROGRESSION, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + /* Update progression status, and verify that scan order is legal. + * Note that inter-scan inconsistencies are treated as warnings + * not fatal errors ... not clear if this is right way to behave. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + int cindex = cinfo->cur_comp_info[ci]->component_index; + coef_bit_ptr = & cinfo->coef_bits[cindex][0]; + if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */ + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0); + for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) { + int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi]; + if (cinfo->Ah != expected) + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi); + coef_bit_ptr[coefi] = cinfo->Al; + } + } + + /* Select MCU decoding routine */ + if (cinfo->Ah == 0) { + if (is_DC_band) + lossyd->entropy_decode_mcu = decode_mcu_DC_first; + else + lossyd->entropy_decode_mcu = decode_mcu_AC_first; + } else { + if (is_DC_band) + lossyd->entropy_decode_mcu = decode_mcu_DC_refine; + else + lossyd->entropy_decode_mcu = decode_mcu_AC_refine; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Make sure requested tables are present, and compute derived tables. + * We may build same derived table more than once, but it's not expensive. + */ + if (is_DC_band) { + if (cinfo->Ah == 0) { /* DC refinement needs no table */ + tbl = compptr->dc_tbl_no; + jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, + & entropy->derived_tbls[tbl]); + } + } else { + tbl = compptr->ac_tbl_no; + jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, + & entropy->derived_tbls[tbl]); + /* remember the single active table */ + entropy->ac_derived_tbl = entropy->derived_tbls[tbl]; + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; + + /* Initialize private state variables */ + entropy->saved.EOBRUN = 0; + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +LOCAL(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int ci; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)(entropy->bitstate.bits_left / 8); + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Re-init EOB run count, too */ + entropy->saved.EOBRUN = 0; + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Huffman MCU decoding. + * Each of these routines decodes and returns one MCU's worth of + * Huffman-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER. + * + * We return FALSE if data source requested suspension. In that case no + * changes have been made to permanent state. (Exception: some output + * coefficients may already have been assigned. This is harmless for + * spectral selection, since we'll just re-assign them on the next call. + * Successive approximation AC refinement has to be more careful, however.) + */ + +/* + * MCU decoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Al = cinfo->Al; + register int s, r; + int blkn, ci; + JBLOCKROW block; + BITREAD_STATE_VARS; + savable_state state; + d_derived_tbl * tbl; + jpeg_component_info * compptr; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + tbl = entropy->derived_tbls[compptr->dc_tbl_no]; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + HUFF_DECODE(s, br_state, tbl, return FALSE, label1); + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + + /* Convert DC difference to actual value, update last_dc_val */ + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */ + (*block)[0] = (JCOEF) (s << Al); + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Se = cinfo->Se; + int Al = cinfo->Al; + register int s, k, r; + unsigned int EOBRUN; + JBLOCKROW block; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state. + * We can avoid loading/saving bitread state if in an EOB run. + */ + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + + if (EOBRUN > 0) /* if it's a band of zeroes... */ + EOBRUN--; /* ...process it now (we do nothing) */ + else { + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + for (k = cinfo->Ss; k <= Se; k++) { + HUFF_DECODE(s, br_state, tbl, return FALSE, label2); + r = s >> 4; + s &= 15; + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Scale and output coefficient in natural (dezigzagged) order */ + (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al); + } else { + if (r == 15) { /* ZRL */ + k += 15; /* skip 15 zeroes in band */ + } else { /* EOBr, run length is 2^r + appended bits */ + EOBRUN = (unsigned int)(1 << r); + if (r) { /* EOBr, r > 0 */ + CHECK_BIT_BUFFER(br_state, r, return FALSE); + r = GET_BITS(r); + EOBRUN += (unsigned int)r; + } + EOBRUN--; /* this band is processed at this moment */ + break; /* force end-of-band */ + } + } + } + + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + } + + /* Completed MCU, so update state */ + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + int blkn; + JBLOCKROW block; + BITREAD_STATE_VARS; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* Not worth the cycles to check insufficient_data here, + * since we will not change the data anyway if we read zeroes. + */ + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* Encoded data is simply the next bit of the two's-complement DC value */ + CHECK_BIT_BUFFER(br_state, 1, return FALSE); + if (GET_BITS(1)) + (*block)[0] |= (JCOEF)p1; + /* Note: since we use |=, repeating the assignment later is safe */ + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Se = cinfo->Se; + int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + + /* Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ + int m1 = (int)((~0U) << cinfo->Al); /* -1 in the bit position being coded */ + + register int s, k, r; + unsigned int EOBRUN; + JBLOCKROW block; + JCOEFPTR thiscoef; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + int num_newnz; + int newnz_pos[DCTSIZE2]; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, don't modify the MCU. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + /* If we are forced to suspend, we must undo the assignments to any newly + * nonzero coefficients in the block, because otherwise we'd get confused + * next time about which coefficients were already nonzero. + * But we need not undo addition of bits to already-nonzero coefficients; + * instead, we can test the current bit to see if we already did it. + */ + num_newnz = 0; + + /* initialize coefficient loop counter to start of band */ + k = cinfo->Ss; + + if (EOBRUN == 0) { + for (; k <= Se; k++) { + HUFF_DECODE(s, br_state, tbl, goto undoit, label3); + r = s >> 4; + s &= 15; + if (s) { + if (s != 1) /* size of new coef should always be 1 */ + WARNMS(cinfo, JWRN_HUFF_BAD_CODE); + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) + s = p1; /* newly nonzero coef is positive */ + else + s = m1; /* newly nonzero coef is negative */ + } else { + if (r != 15) { + EOBRUN = (unsigned int)(1 << r); /* EOBr, run length is 2^r + appended bits */ + if (r) { + CHECK_BIT_BUFFER(br_state, r, goto undoit); + r = GET_BITS(r); + EOBRUN += (unsigned int)r; + } + break; /* rest of block is handled by EOB logic */ + } + /* note s = 0 for processing ZRL */ + } + /* Advance over already-nonzero coefs and r still-zero coefs, + * appending correction bits to the nonzeroes. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + do { + thiscoef = *block + jpeg_natural_order[k]; + if (*thiscoef != 0) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already set it */ + if (*thiscoef >= 0) + *thiscoef = (JCOEF)(*thiscoef + p1); + else + *thiscoef = (JCOEF)(*thiscoef + m1); + } + } + } else { + if (--r < 0) + break; /* reached target zero coefficient */ + } + k++; + } while (k <= Se); + if (s) { + int pos = jpeg_natural_order[k]; + /* Output newly nonzero coefficient */ + (*block)[pos] = (JCOEF) s; + /* Remember its position in case we have to suspend */ + newnz_pos[num_newnz++] = pos; + } + } + } + + if (EOBRUN > 0) { + /* Scan any remaining coefficient positions after the end-of-band + * (the last newly nonzero coefficient, if any). Append a correction + * bit to each already-nonzero coefficient. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + for (; k <= Se; k++) { + thiscoef = *block + jpeg_natural_order[k]; + if (*thiscoef != 0) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */ + if (*thiscoef >= 0) + *thiscoef = (JCOEF)(*thiscoef + p1); + else + *thiscoef = (JCOEF)(*thiscoef + m1); + } + } + } + } + /* Count one block completed in EOB run */ + EOBRUN--; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; + +undoit: + /* Re-zero any output coefficients that we made newly nonzero */ + while (num_newnz > 0) + (*block)[newnz_pos[--num_newnz]] = 0; + + return FALSE; +} + + +/* + * Module initialization routine for progressive Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_phuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy; + int *coef_bit_ptr; + int ci, i; + + entropy = (phuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(phuff_entropy_decoder)); + lossyd->entropy_private = (void *) entropy; + lossyd->entropy_start_pass = start_pass_phuff_decoder; + + /* Mark derived tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + } + + /* Create progression status table */ + cinfo->coef_bits = (int (*)[DCTSIZE2]) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components*DCTSIZE2*SIZEOF(int)); + coef_bit_ptr = & cinfo->coef_bits[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (i = 0; i < DCTSIZE2; i++) + *coef_bit_ptr++ = -1; +} + +#endif /* D_PROGRESSIVE_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jdpostct.c b/dcmjpeg/libijg12/jdpostct.c new file mode 100644 index 00000000..c7f214be --- /dev/null +++ b/dcmjpeg/libijg12/jdpostct.c @@ -0,0 +1,290 @@ +/* + * jdpostct.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the decompression postprocessing controller. + * This controller manages the upsampling, color conversion, and color + * quantization/reduction steps; specifically, it controls the buffering + * between upsample/color conversion and color quantization/reduction. + * + * If no color quantization/reduction is required, then this module has no + * work to do, and it just hands off to the upsample/color conversion code. + * An integrated upsample/convert/quantize process would replace this module + * entirely. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_post_controller pub; /* public fields */ + + /* Color quantization source buffer: this holds output data from + * the upsample/color conversion step to be passed to the quantizer. + * For two-pass color quantization, we need a full-image buffer; + * for one-pass operation, a strip buffer is sufficient. + */ + jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */ + JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */ + JDIMENSION strip_height; /* buffer size in rows */ + /* for two-pass mode only: */ + JDIMENSION starting_row; /* row # of first row in current strip */ + JDIMENSION next_row; /* index of next row to fill/empty in strip */ +} my_post_controller; + +typedef my_post_controller * my_post_ptr; + + +/* Forward declarations */ +METHODDEF(void) post_process_1pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) post_process_prepass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +METHODDEF(void) post_process_2pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->quantize_colors) { + /* Single-pass processing with color quantization. */ + post->pub.post_process_data = post_process_1pass; + /* We could be doing buffered-image output before starting a 2-pass + * color quantization; in that case, jinit_d_post_controller did not + * allocate a strip buffer. Use the virtual-array buffer as workspace. + */ + if (post->buffer == NULL) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + (JDIMENSION) 0, post->strip_height, TRUE); + } + } else { + /* For single-pass processing without color quantization, + * I have no work to do; just call the upsampler directly. + */ + post->pub.post_process_data = cinfo->upsample->upsample; + } + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_SAVE_AND_PASS: + /* First pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_prepass; + break; + case JBUF_CRANK_DEST: + /* Second pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_2pass; + break; +#endif /* QUANT_2PASS_SUPPORTED */ + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } + post->starting_row = post->next_row = 0; +} + + +/* + * Process some data in the one-pass (strip buffer) case. + * This is used for color precision reduction as well as one-pass quantization. + */ + +METHODDEF(void) +post_process_1pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Fill the buffer, but not more than what we can dump out in one go. */ + /* Note we rely on the upsampler to detect bottom of image. */ + max_rows = out_rows_avail - *out_row_ctr; + if (max_rows > post->strip_height) + max_rows = post->strip_height; + num_rows = 0; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &num_rows, max_rows); + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer, output_buf + *out_row_ctr, (int) num_rows); + *out_row_ctr += num_rows; +} + + +#ifdef QUANT_2PASS_SUPPORTED + +/* + * Process some data in the first pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_prepass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION old_next_row, num_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, TRUE); + } + + /* Upsample some data (up to a strip height's worth). */ + old_next_row = post->next_row; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &post->next_row, post->strip_height); + + /* Allow quantizer to scan new data. No data is emitted, */ + /* but we advance out_row_ctr so outer loop can tell when we're done. */ + if (post->next_row > old_next_row) { + num_rows = post->next_row - old_next_row; + (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row, + (JSAMPARRAY) NULL, (int) num_rows); + *out_row_ctr += num_rows; + } + + /* Advance if we filled the strip. */ + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + + +/* + * Process some data in the second pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_2pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, FALSE); + } + + /* Determine number of rows to emit. */ + num_rows = post->strip_height - post->next_row; /* available in strip */ + max_rows = out_rows_avail - *out_row_ctr; /* available in output area */ + if (num_rows > max_rows) + num_rows = max_rows; + /* We have to check bottom of image here, can't depend on upsampler. */ + max_rows = cinfo->output_height - post->starting_row; + if (num_rows > max_rows) + num_rows = max_rows; + + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer + post->next_row, output_buf + *out_row_ctr, + (int) num_rows); + *out_row_ctr += num_rows; + + /* Advance if we filled the strip. */ + post->next_row += num_rows; + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize postprocessing controller. + */ + +GLOBAL(void) +jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_post_ptr post; + + post = (my_post_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_post_controller)); + cinfo->post = (struct jpeg_d_post_controller *) post; + post->pub.start_pass = start_pass_dpost; + post->whole_image = NULL; /* flag for no virtual arrays */ + post->buffer = NULL; /* flag for no strip buffer */ + + /* Create the quantization buffer, if needed */ + if (cinfo->quantize_colors) { + /* The buffer strip height is max_v_samp_factor, which is typically + * an efficient number of rows for upsampling to return. + * (In the presence of output rescaling, we might want to be smarter?) + */ + post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor; + if (need_full_buffer) { + /* Two-pass color quantization: need full-image storage. */ + /* We round up the number of rows to a multiple of the strip height. */ +#ifdef QUANT_2PASS_SUPPORTED + post->whole_image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + cinfo->output_width * (JDIMENSION)cinfo->out_color_components, + (JDIMENSION) jround_up((long) cinfo->output_height, + (long) post->strip_height), + post->strip_height); +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + /* One-pass color quantization: just make a strip buffer. */ + post->buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width * (JDIMENSION)cinfo->out_color_components, + post->strip_height); + } + } +} diff --git a/dcmjpeg/libijg12/jdpred.c b/dcmjpeg/libijg12/jdpred.c new file mode 100644 index 00000000..7aa46a35 --- /dev/null +++ b/dcmjpeg/libijg12/jdpred.c @@ -0,0 +1,263 @@ +/* + * jdpred.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample undifferencing (reconstruction) for lossless JPEG. + * + * In order to avoid paying the performance penalty of having to check the + * predictor being used and the row being processed for each call of the + * undifferencer, and to promote optimization, we have separate undifferencing + * functions for each case. + * + * We are able to avoid duplicating source code by implementing the predictors + * and undifferencers as macros. Each of the undifferencing functions are + * simply wrappers around an UNDIFFERENCE macro with the appropriate PREDICTOR + * macro passed as an argument. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" /* Private declarations for lossless codec */ + + +#ifdef D_LOSSLESS_SUPPORTED + +/* Predictor for the first column of the first row: 2^(P-Pt-1) */ +#define INITIAL_PREDICTORx (1 << (cinfo->data_precision - cinfo->Al - 1)) + +/* Predictor for the first column of the remaining rows: Rb */ +#define INITIAL_PREDICTOR2 GETJSAMPLE(prev_row[0]) + + +/* + * 1-Dimensional undifferencer routine. + * + * This macro implements the 1-D horizontal predictor (1). INITIAL_PREDICTOR + * is used as the special case predictor for the first column, which must be + * either INITIAL_PREDICTOR2 or INITIAL_PREDICTORx. The remaining samples + * use PREDICTOR1. + * + * The reconstructed sample is supposed to be calculated modulo 2^16, so we + * logically AND the result with 0xFFFF. +*/ + +#define UNDIFFERENCE_1D(INITIAL_PREDICTOR) \ + unsigned int xindex; \ + int Ra; \ + \ + Ra = (diff_buf[0] + INITIAL_PREDICTOR) & 0xFFFF; \ + undiff_buf[0] = Ra; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Ra = (diff_buf[xindex] + PREDICTOR1) & 0xFFFF; \ + undiff_buf[xindex] = Ra; \ + } + +/* + * 2-Dimensional undifferencer routine. + * + * This macro implements the 2-D horizontal predictors (#2-7). PREDICTOR2 is + * used as the special case predictor for the first column. The remaining + * samples use PREDICTOR, which is a function of Ra, Rb, Rc. + * + * Because prev_row and output_buf may point to the same storage area (in an + * interleaved image with Vi=1, for example), we must take care to buffer Rb/Rc + * before writing the current reconstructed sample value into output_buf. + * + * The reconstructed sample is supposed to be calculated modulo 2^16, so we + * logically AND the result with 0xFFFF. + */ + +#define UNDIFFERENCE_2D(PREDICTOR) \ + unsigned int xindex; \ + int Ra, Rb, Rc; \ + \ + Rb = GETJSAMPLE(prev_row[0]); \ + Ra = (diff_buf[0] + PREDICTOR2) & 0xFFFF; \ + undiff_buf[0] = Ra; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Rc = Rb; \ + Rb = GETJSAMPLE(prev_row[xindex]); \ + Ra = (diff_buf[xindex] + PREDICTOR) & 0xFFFF; \ + undiff_buf[xindex] = Ra; \ + } + +#define JPEG_UNUSED(x) ((void)x) + +/* + * Undifferencers for the all rows but the first in a scan or restart interval. + * The first sample in the row is undifferenced using the vertical + * predictor (2). The rest of the samples are undifferenced using the + * predictor specified in the scan header. + */ + +METHODDEF(void) +jpeg_undifference1(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_1D(INITIAL_PREDICTOR2); +} + +METHODDEF(void) +jpeg_undifference2(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR2); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference3(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR3); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference4(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR4); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference5(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR5); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference6(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR6); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference7(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR7); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + + +/* + * Undifferencer for the first row in a scan or restart interval. The first + * sample in the row is undifferenced using the special predictor constant + * x=2^(P-Pt-1). The rest of the samples are undifferenced using the + * 1-D horizontal predictor (1). + */ + +METHODDEF(void) +jpeg_undifference_first_row(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + UNDIFFERENCE_1D(INITIAL_PREDICTORx); + + /* + * Now that we have undifferenced the first row, we want to use the + * undifferencer which corresponds to the predictor specified in the + * scan header. + */ + switch (cinfo->Ss) { + case 1: + losslsd->predict_undifference[comp_index] = jpeg_undifference1; + break; + case 2: + losslsd->predict_undifference[comp_index] = jpeg_undifference2; + break; + case 3: + losslsd->predict_undifference[comp_index] = jpeg_undifference3; + break; + case 4: + losslsd->predict_undifference[comp_index] = jpeg_undifference4; + break; + case 5: + losslsd->predict_undifference[comp_index] = jpeg_undifference5; + break; + case 6: + losslsd->predict_undifference[comp_index] = jpeg_undifference6; + break; + case 7: + losslsd->predict_undifference[comp_index] = jpeg_undifference7; + break; + } +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +predict_start_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + int ci; + + /* Check that the scan parameters Ss, Se, Ah, Al are OK for lossless JPEG. + * + * Ss is the predictor selection value (psv). Legal values for sequential + * lossless JPEG are: 1 <= psv <= 7. + * + * Se and Ah are not used and should be zero. + * + * Al specifies the point transform (Pt). Legal values are: 0 <= Pt <= 15. + */ + if (cinfo->Ss < 1 || cinfo->Ss > 7 || + cinfo->Se != 0 || cinfo->Ah != 0 || + cinfo->Al > 15) /* need not check for < 0 */ + ERREXIT4(cinfo, JERR_BAD_LOSSLESS, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + + /* Set undifference functions to first row function */ + for (ci = 0; ci < cinfo->num_components; ci++) + losslsd->predict_undifference[ci] = jpeg_undifference_first_row; +} + + +/* + * Module initialization routine for the undifferencer. + */ + +GLOBAL(void) +jinit_undifferencer (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + losslsd->predict_start_pass = predict_start_pass; + losslsd->predict_process_restart = predict_start_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg12/jdsample.c b/dcmjpeg/libijg12/jdsample.c new file mode 100644 index 00000000..6e8e7ea6 --- /dev/null +++ b/dcmjpeg/libijg12/jdsample.c @@ -0,0 +1,478 @@ +/* + * jdsample.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains upsampling routines. + * + * Upsampling input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * codec_data_unit / min_codec_data_unit) + * sample rows of each component. Upsampling will normally produce + * max_v_samp_factor pixel rows from each row group (but this could vary + * if the upsampler is applying a scale factor of its own). + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* Pointer to routine to upsample a single component */ +typedef JMETHOD(void, upsample1_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Color conversion buffer. When using separate upsampling and color + * conversion steps, this buffer holds one upsampled row group until it + * has been color converted and output. + * Note: we do not allocate any storage for component(s) which are full-size, + * ie do not need rescaling. The corresponding entry of color_buf[] is + * simply set to point to the input data array, thereby avoiding copying. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + /* Per-component upsampling method pointers */ + upsample1_ptr methods[MAX_COMPONENTS]; + + int next_row_out; /* counts rows emitted from color_buf */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ + + /* Height of an input row group for each component. */ + int rowgroup_height[MAX_COMPONENTS]; + + /* These arrays save pixel expansion factors so that int_expand need not + * recompute them each time. They are unused for other upsampling methods. + */ + UINT8 h_expand[MAX_COMPONENTS]; + UINT8 v_expand[MAX_COMPONENTS]; +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the conversion buffer empty */ + upsample->next_row_out = cinfo->max_v_samp_factor; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * In this version we upsample each component independently. + * We upsample one row group into the conversion buffer, then apply + * color conversion a row at a time. + */ + +METHODDEF(void) +sep_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int ci; + jpeg_component_info * compptr; + JDIMENSION num_rows; + + /* Fill the conversion buffer, if it's empty */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Invoke per-component upsample method. Notice we pass a POINTER + * to color_buf[ci], so that fullsize_upsample can change it. + */ + (*upsample->methods[ci]) (cinfo, compptr, + input_buf[ci] + (*in_row_group_ctr * (JDIMENSION)upsample->rowgroup_height[ci]), + upsample->color_buf + ci); + } + upsample->next_row_out = 0; + } + + /* Color-convert and emit rows */ + + /* How many we have in the buffer: */ + num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out); + /* Not more than the distance to the end of the image. Need this test + * in case the image height is not a multiple of max_v_samp_factor: + */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + + (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf, + (JDIMENSION) upsample->next_row_out, + output_buf + *out_row_ctr, + (int) num_rows); + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + upsample->next_row_out += (int)num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by sep_upsample to upsample pixel values + * of a single component. One row group is processed per call. + */ + + +/* + * For full-size components, we just make color_buf[ci] point at the + * input buffer, and thus avoid copying any data. Note that this is + * safe only because sep_upsample doesn't declare the input row group + * "consumed" until we are done color converting and emitting it. + */ + +METHODDEF(void) +fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = input_data; +} + + +/* + * This is a no-op version used for "uninteresting" components. + * These components will not be referenced by color conversion. + */ + +METHODDEF(void) +noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = NULL; /* safety check */ +} + + +/* + * This version handles any integral sampling ratios. + * This is not used for typical JPEG files, so it need not be fast. + * Nor, for that matter, is it particularly accurate: the algorithm is + * simple replication of the input pixel onto the corresponding output + * pixels. The hi-falutin sampling literature refers to this as a + * "box filter". A box filter tends to introduce visible artifacts, + * so if you are actually going to use 3:1 or 4:1 sampling ratios + * you would be well advised to improve this code. + */ + +METHODDEF(void) +int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + register int h; + JSAMPROW outend; + int h_expand, v_expand; + int inrow, outrow; + + h_expand = upsample->h_expand[compptr->component_index]; + v_expand = upsample->v_expand[compptr->component_index]; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + /* Generate one output row with proper horizontal expansion */ + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + for (h = h_expand; h > 0; h--) { + *outptr++ = invalue; + } + } + /* Generate any additional output rows by duplicating the first one */ + if (v_expand > 1) { + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + v_expand-1, cinfo->output_width); + } + inrow++; + outrow += v_expand; + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 1:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int inrow; + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 2:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int inrow, outrow; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + 1, cinfo->output_width); + inrow++; + outrow += 2; + } +} + + +/* + * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical. + * + * The upsampling algorithm is linear interpolation between pixel centers, + * also known as a "triangle filter". This is a good compromise between + * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 + * of the way between input pixel centers. + * + * A note about the "bias" calculations: when rounding fractional values to + * integer, we do not want to always round 0.5 up to the next integer. + * If we did that, we'd introduce a noticeable bias towards larger values. + * Instead, this code is arranged so that 0.5 will be rounded up or down at + * alternate pixel locations (a simple ordered dither pattern). + */ + +METHODDEF(void) +h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register int invalue; + register JDIMENSION colctr; + int inrow; + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + /* Special case for first column */ + invalue = GETJSAMPLE(*inptr++); + *outptr++ = (JSAMPLE) invalue; + *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2); + + for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { + /* General case: 3/4 * nearer pixel + 1/4 * further pixel */ + invalue = GETJSAMPLE(*inptr++) * 3; + *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2); + *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2); + } + + /* Special case for last column */ + invalue = GETJSAMPLE(*inptr); + *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2); + *outptr++ = (JSAMPLE) invalue; + } +} + + +/* + * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical. + * Again a triangle filter; see comments for h2v1 case, above. + * + * It is OK for us to reference the adjacent input rows because we demanded + * context from the main buffer controller (see initialization code). + */ + +METHODDEF(void) +h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr0, inptr1, outptr; +#if BITS_IN_JSAMPLE == 8 + register int thiscolsum, lastcolsum, nextcolsum; +#else + register IJG_INT32 thiscolsum, lastcolsum, nextcolsum; +#endif + register JDIMENSION colctr; + int inrow, outrow, v; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + for (v = 0; v < 2; v++) { + /* inptr0 points to nearest input row, inptr1 points to next nearest */ + inptr0 = input_data[inrow]; + if (v == 0) /* next nearest is row above */ + inptr1 = input_data[inrow-1]; + else /* next nearest is row below */ + inptr1 = input_data[inrow+1]; + outptr = output_data[outrow++]; + + /* Special case for first column */ + thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); + lastcolsum = thiscolsum; thiscolsum = nextcolsum; + + for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { + /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */ + /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */ + nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); + lastcolsum = thiscolsum; thiscolsum = nextcolsum; + } + + /* Special case for last column */ + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4); + } + inrow++; + } +} + + +/* + * Module initialization routine for upsampling. + */ + +GLOBAL(void) +jinit_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + int ci; + jpeg_component_info * compptr; + boolean need_buffer, do_fancy; + int h_in_group, v_in_group, h_out_group, v_out_group; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_upsample; + upsample->pub.upsample = sep_upsample; + upsample->pub.need_context_rows = FALSE; /* until we find out differently */ + + if (cinfo->CCIR601_sampling) /* this isn't supported */ + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* jdmainct.c doesn't support context rows when min_codec_data_unit = 1, + * so don't ask for it. + */ + do_fancy = cinfo->do_fancy_upsampling && cinfo->min_codec_data_unit > 1; + + /* Verify we can handle the sampling factors, select per-component methods, + * and create storage as needed. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Compute size of an "input group" after IDCT scaling. This many samples + * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. + */ + h_in_group = (compptr->h_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; + v_in_group = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; + h_out_group = cinfo->max_h_samp_factor; + v_out_group = cinfo->max_v_samp_factor; + upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ + need_buffer = TRUE; + if (! compptr->component_needed) { + /* Don't bother to upsample an uninteresting component. */ + upsample->methods[ci] = noop_upsample; + need_buffer = FALSE; + } else if (h_in_group == h_out_group && v_in_group == v_out_group) { + /* Fullsize components can be processed without any work. */ + upsample->methods[ci] = fullsize_upsample; + need_buffer = FALSE; + } else if (h_in_group * 2 == h_out_group && + v_in_group == v_out_group) { + /* Special cases for 2h1v upsampling */ + if (do_fancy && compptr->downsampled_width > 2) + upsample->methods[ci] = h2v1_fancy_upsample; + else + upsample->methods[ci] = h2v1_upsample; + } else if (h_in_group * 2 == h_out_group && + v_in_group * 2 == v_out_group) { + /* Special cases for 2h2v upsampling */ + if (do_fancy && compptr->downsampled_width > 2) { + upsample->methods[ci] = h2v2_fancy_upsample; + upsample->pub.need_context_rows = TRUE; + } else + upsample->methods[ci] = h2v2_upsample; + } else if ((h_out_group % h_in_group) == 0 && + (v_out_group % v_in_group) == 0) { + /* Generic integral-factors upsampling method */ + upsample->methods[ci] = int_upsample; + upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); + upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + if (need_buffer) { + upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) cinfo->output_width, + (long) cinfo->max_h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/dcmjpeg/libijg12/jdscale.c b/dcmjpeg/libijg12/jdscale.c new file mode 100644 index 00000000..0c9d5a2d --- /dev/null +++ b/dcmjpeg/libijg12/jdscale.c @@ -0,0 +1,119 @@ +/* + * jdscale.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample scaling for lossless JPEG. This is a + * combination of upscaling the undifferenced sample by 2^Pt and downscaling + * the sample to fit into JSAMPLE. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossls12.h" /* Private declarations for lossless codec */ + + +#ifdef D_LOSSLESS_SUPPORTED + +/* + * Private scaler object for lossless decoding. + */ + +typedef struct { + int scale_factor; +} scaler; + +typedef scaler * scaler_ptr; + + +/* + * Scalers for packing sample differences into JSAMPLEs. + */ + +METHODDEF(void) +simple_upscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int scale_factor = scale->scale_factor; + unsigned int xindex; + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) (diff_buf[xindex] << scale_factor); +} + +METHODDEF(void) +simple_downscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int scale_factor = scale->scale_factor; + unsigned int xindex; + SHIFT_TEMPS + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) RIGHT_SHIFT(diff_buf[xindex], scale_factor); +} + +METHODDEF(void) +noscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + unsigned int xindex; + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) diff_buf[xindex]; +} + + +METHODDEF(void) +scaler_start_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int downscale; + + /* + * Downscale by the difference in the input vs. output precision. If the + * output precision >= input precision, then do not downscale. + */ + downscale = BITS_IN_JSAMPLE < cinfo->data_precision ? + cinfo->data_precision - BITS_IN_JSAMPLE : 0; + + scale->scale_factor = cinfo->Al - downscale; + + /* Set scale functions based on scale_factor (positive = left shift) */ + if (scale->scale_factor > 0) + losslsd->scaler_scale = simple_upscale; + else if (scale->scale_factor < 0) { + scale->scale_factor = -scale->scale_factor; + losslsd->scaler_scale = simple_downscale; + } + else + losslsd->scaler_scale = noscale; +} + + +GLOBAL(void) +jinit_d_scaler (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale; + + scale = (scaler_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(scaler)); + losslsd->scaler_private = (void *) scale; + losslsd->scaler_start_pass = scaler_start_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg12/jdshuff.c b/dcmjpeg/libijg12/jdshuff.c new file mode 100644 index 00000000..79fbfdbc --- /dev/null +++ b/dcmjpeg/libijg12/jdshuff.c @@ -0,0 +1,365 @@ +/* + * jdshuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for sequential JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" /* Private declarations for lossy codec */ +#include "jdhuff12.h" /* Declarations shared with jd*huff.c */ + + +/* + * Private entropy decoder object for Huffman decoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* These fields are loaded into local variables at start of each MCU. + * In case of suspension, we exit WITHOUT updating them. + */ + savable_state saved; /* Other state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + + /* Precalculated info set up by start_pass for use in decode_mcu: */ + + /* Pointers to derived tables to be used for each block within an MCU */ + d_derived_tbl * dc_cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + d_derived_tbl * ac_cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + /* Whether we care about the DC and AC coefficient values for each block */ + boolean dc_needed[D_MAX_DATA_UNITS_IN_MCU]; + boolean ac_needed[D_MAX_DATA_UNITS_IN_MCU]; +} shuff_entropy_decoder; + +typedef shuff_entropy_decoder * shuff_entropy_ptr; + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_huff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int ci, blkn, dctbl, actbl; + jpeg_component_info * compptr; + + /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. + * This ought to be an error condition, but we make it a warning because + * there are some baseline files out there with all zeroes in these bytes. + */ + if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 || + cinfo->Ah != 0 || cinfo->Al != 0) + WARNMS(cinfo, JWRN_NOT_SEQUENTIAL); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, + & entropy->dc_derived_tbls[dctbl]); + jpeg_make_d_derived_tbl(cinfo, FALSE, actbl, + & entropy->ac_derived_tbls[actbl]); + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Precalculate decoding info for each block in an MCU of this scan */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + /* Precalculate which table to use for each block */ + entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no]; + entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no]; + /* Decide whether we really care about the coefficient values */ + if (compptr->component_needed) { + entropy->dc_needed[blkn] = TRUE; + /* we don't need the ACs if producing a 1/8th-size image */ + entropy->ac_needed[blkn] = (compptr->codec_data_unit > 1); + } else { + entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE; + } + } + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +LOCAL(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int ci; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)(entropy->bitstate.bits_left / 8); + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Decode and return one MCU's worth of Huffman-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER. + * (Wholesale zeroing is usually a little faster than retail...) + * + * Returns FALSE if data source requested suspension. In that case no + * changes have been made to permanent state. (Exception: some output + * coefficients may already have been assigned. This is harmless for + * this module, since we'll just re-assign them on the next call.) + */ + +METHODDEF(boolean) +decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int blkn; + BITREAD_STATE_VARS; + savable_state state; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + JBLOCKROW block = MCU_data[blkn]; + d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; + d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; + register int s, k, r; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + HUFF_DECODE(s, br_state, dctbl, return FALSE, label1); + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + + if (entropy->dc_needed[blkn]) { + /* Convert DC difference to actual value, update last_dc_val */ + int ci = cinfo->MCU_membership[blkn]; + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */ + (*block)[0] = (JCOEF) s; + } + + if (entropy->ac_needed[blkn]) { + + /* Section F.2.2.2: decode the AC coefficients */ + /* Since zeroes are skipped, output area must be cleared beforehand */ + for (k = 1; k < DCTSIZE2; k++) { + HUFF_DECODE(s, br_state, actbl, return FALSE, label2); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Output coefficient in natural (dezigzagged) order. + * Note: the extra entries in jpeg_natural_order[] will save us + * if k >= DCTSIZE2, which could happen if the data is corrupted. + */ + (*block)[jpeg_natural_order[k]] = (JCOEF) s; + } else { + if (r != 15) + break; + k += 15; + } + } + + } else { + + /* Section F.2.2.2: decode the AC coefficients */ + /* In this path we just discard the values */ + for (k = 1; k < DCTSIZE2; k++) { + HUFF_DECODE(s, br_state, actbl, return FALSE, label3); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + DROP_BITS(s); + } else { + if (r != 15) + break; + k += 15; + } + } + + } + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_shuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy; + int i; + + entropy = (shuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(shuff_entropy_decoder)); + lossyd->entropy_private = (void *) entropy; + lossyd->entropy_start_pass = start_pass_huff_decoder; + lossyd->entropy_decode_mcu = decode_mcu; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; + } +} diff --git a/dcmjpeg/libijg12/jdtrans.c b/dcmjpeg/libijg12/jdtrans.c new file mode 100644 index 00000000..ef40d86f --- /dev/null +++ b/dcmjpeg/libijg12/jdtrans.c @@ -0,0 +1,138 @@ +/* + * jdtrans.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding decompression, + * that is, reading raw DCT coefficient arrays from an input JPEG file. + * The routines in jdapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jlossy12.h" + + +/* Forward declarations */ +LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo)); + + +/* + * Read the coefficient arrays from a JPEG file. + * jpeg_read_header must be completed before calling this. + * + * The entire image is read into a set of virtual coefficient-block arrays, + * one per component. The return value is a pointer to the array of + * virtual-array descriptors. These can be manipulated directly via the + * JPEG memory manager, or handed off to jpeg_write_coefficients(). + * To release the memory occupied by the virtual arrays, call + * jpeg_finish_decompress() when done with the data. + * + * An alternative usage is to simply obtain access to the coefficient arrays + * during a buffered-image-mode decompression operation. This is allowed + * after any jpeg_finish_output() call. The arrays can be accessed until + * jpeg_finish_decompress() is called. (Note that any call to the library + * may reposition the arrays, so don't rely on access_virt_barray() results + * to stay valid across library calls.) + * + * Returns NULL if suspended. This case need be checked only if + * a suspending data source is used. + */ + +GLOBAL(jvirt_barray_ptr *) +jpeg_read_coefficients (j_decompress_ptr cinfo) +{ + /* j_lossy_d_ptr decomp; */ + + /* Can't read coefficients from lossless streams */ + if (cinfo->process == JPROC_LOSSLESS) { + ERREXIT(cinfo, JERR_CANT_TRANSCODE); + return NULL; + } + + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize active modules */ + transdecode_master_selection(cinfo); + cinfo->global_state = DSTATE_RDCOEFS; + } + if (cinfo->global_state == DSTATE_RDCOEFS) { + /* Absorb whole file into the coef buffer */ + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return NULL; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* startup underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } + /* Set state so that jpeg_finish_decompress does the right thing */ + cinfo->global_state = DSTATE_STOPPING; + } + /* At this point we should be in state DSTATE_STOPPING if being used + * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access + * to the coefficients during a full buffered-image-mode decompression. + */ + if ((cinfo->global_state == DSTATE_STOPPING || + cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) { + return ((j_lossy_d_ptr) cinfo->codec)->coef_arrays; + } + /* Oops, improper usage */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return NULL; /* keep compiler happy */ +} + + +/* + * Master selection of decompression modules for transcoding. + * This substitutes for jdmaster.c's initialization of the full decompressor. + */ + +LOCAL(void) +transdecode_master_selection (j_decompress_ptr cinfo) +{ + /* This is effectively a buffered-image operation. */ + cinfo->buffered_image = TRUE; + + /* Initialize decompression codec */ + jinit_d_codec(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + + /* Initialize progress monitoring. */ + if (cinfo->progress != NULL) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else if (cinfo->inputctl->has_multiple_scans) { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } else { + nscans = 1; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = 1; + } +} diff --git a/dcmjpeg/libijg12/jerror.c b/dcmjpeg/libijg12/jerror.c new file mode 100644 index 00000000..da5c14db --- /dev/null +++ b/dcmjpeg/libijg12/jerror.c @@ -0,0 +1,253 @@ +/* + * jerror.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains simple error-reporting and trace-message routines. + * These are suitable for Unix-like systems and others where writing to + * stderr is the right thing to do. Many applications will want to replace + * some or all of these routines. + * + * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile, + * you get a Windows-specific hack to display error messages in a dialog box. + * It ain't much, but it beats dropping error messages into the bit bucket, + * which is what happens to output to stderr under most Windows C compilers. + * + * These routines are used by both the compression and decompression code. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jversion12.h" +#include "jerror12.h" + +#ifdef USE_WINDOWS_MESSAGEBOX +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#ifndef EXIT_FAILURE /* define exit() codes if not provided */ +#define EXIT_FAILURE 1 +#endif + + +/* + * Create the message string table. + * We do this from the master message list in jerror.h by re-reading + * jerror.h with a suitable definition for macro JMESSAGE. + * The message table is made an external symbol just in case any applications + * want to refer to it directly. + */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_std_message_table jpeg12_std_message_table +#endif + +#define JMESSAGE(code,string) string , + +const char * const jpeg_std_message_table[] = { +#include "jerror12.h" + NULL +}; + + +/* + * Error exit handler: must not return to caller. + * + * Applications may override this if they want to get control back after + * an error. Typically one would longjmp somewhere instead of exiting. + * The setjmp buffer can be made a private field within an expanded error + * handler object. Note that the info needed to generate an error message + * is stored in the error object, so you can generate the message now or + * later, at your convenience. + * You should make sure that the JPEG object is cleaned up (with jpeg_abort + * or jpeg_destroy) at some point. + */ + +METHODDEF(void) +error_exit (j_common_ptr cinfo) +{ + /* Always display the message */ + (*cinfo->err->output_message) (cinfo); + + /* Let the memory manager delete any temp files before we die */ + jpeg_destroy(cinfo); + + exit(EXIT_FAILURE); +} + + +/* + * Actual output of an error or trace message. + * Applications may override this method to send JPEG messages somewhere + * other than stderr. + * + * On Windows, printing to stderr is generally completely useless, + * so we provide optional code to produce an error-dialog popup. + * Most Windows applications will still prefer to override this routine, + * but if they don't, it'll do something at least marginally useful. + * + * NOTE: to use the library in an environment that doesn't support the + * C stdio library, you may have to delete the call to fprintf() entirely, + * not just not use this routine. + */ + +METHODDEF(void) +output_message (j_common_ptr cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + + /* Create the message */ + (*cinfo->err->format_message) (cinfo, buffer); + +#ifdef USE_WINDOWS_MESSAGEBOX + /* Display it in a message dialog box */ + MessageBox(GetActiveWindow(), buffer, "JPEG Library Error", + MB_OK | MB_ICONERROR); +#else + /* Send it to stderr, adding a newline */ + fprintf(stderr, "%s\n", buffer); +#endif +} + + +/* + * Decide whether to emit a trace or warning message. + * msg_level is one of: + * -1: recoverable corrupt-data warning, may want to abort. + * 0: important advisory messages (always display to user). + * 1: first level of tracing detail. + * 2,3,...: successively more detailed tracing messages. + * An application might override this method if it wanted to abort on warnings + * or change the policy about which messages to display. + */ + +METHODDEF(void) +emit_message (j_common_ptr cinfo, int msg_level) +{ + struct jpeg_error_mgr * err = cinfo->err; + + if (msg_level < 0) { + /* It's a warning message. Since corrupt files may generate many warnings, + * the policy implemented here is to show only the first warning, + * unless trace_level >= 3. + */ + if (err->num_warnings == 0 || err->trace_level >= 3) + (*err->output_message) (cinfo); + /* Always count warnings in num_warnings. */ + err->num_warnings++; + } else { + /* It's a trace message. Show it if trace_level >= msg_level. */ + if (err->trace_level >= msg_level) + (*err->output_message) (cinfo); + } +} + + +/* + * Format a message string for the most recent JPEG error or message. + * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX + * characters. Note that no '\n' character is added to the string. + * Few applications should need to override this method. + */ + +METHODDEF(void) +format_message (j_common_ptr cinfo, char * buffer) +{ + struct jpeg_error_mgr * err = cinfo->err; + int msg_code = err->msg_code; + const char * msgtext = NULL; + const char * msgptr; + char ch; + boolean isstring; + + /* Look up message string in proper table */ + if (msg_code > 0 && msg_code <= err->last_jpeg_message) { + msgtext = err->jpeg_message_table[msg_code]; + } else if (err->addon_message_table != NULL && + msg_code >= err->first_addon_message && + msg_code <= err->last_addon_message) { + msgtext = err->addon_message_table[msg_code - err->first_addon_message]; + } + + /* Defend against bogus message number */ + if (msgtext == NULL) { + err->msg_parm.i[0] = msg_code; + msgtext = err->jpeg_message_table[0]; + } + + /* Check for string parameter, as indicated by %s in the message text */ + isstring = FALSE; + msgptr = msgtext; + while ((ch = *msgptr++) != '\0') { + if (ch == '%') { + if (*msgptr == 's') isstring = TRUE; + break; + } + } + + /* Format the message into the passed buffer */ + if (isstring) + sprintf(buffer, msgtext, err->msg_parm.s); + else + sprintf(buffer, msgtext, + err->msg_parm.i[0], err->msg_parm.i[1], + err->msg_parm.i[2], err->msg_parm.i[3], + err->msg_parm.i[4], err->msg_parm.i[5], + err->msg_parm.i[6], err->msg_parm.i[7]); +} + + +/* + * Reset error state variables at start of a new image. + * This is called during compression startup to reset trace/error + * processing to default state, without losing any application-specific + * method pointers. An application might possibly want to override + * this method if it has additional error processing state. + */ + +METHODDEF(void) +reset_error_mgr (j_common_ptr cinfo) +{ + cinfo->err->num_warnings = 0; + /* trace_level is not reset since it is an application-supplied parameter */ + cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */ +} + + +/* + * Fill in the standard error-handling methods in a jpeg_error_mgr object. + * Typical call is: + * struct jpeg_compress_struct cinfo; + * struct jpeg_error_mgr err; + * + * cinfo.err = jpeg_std_error(&err); + * after which the application may override some of the methods. + */ + +GLOBAL(struct jpeg_error_mgr *) +jpeg_std_error (struct jpeg_error_mgr * err) +{ + err->error_exit = error_exit; + err->emit_message = emit_message; + err->output_message = output_message; + err->format_message = format_message; + err->reset_error_mgr = reset_error_mgr; + + err->trace_level = 0; /* default = no tracing */ + err->num_warnings = 0; /* no warnings emitted yet */ + err->msg_code = 0; /* may be useful as a flag for "no error" */ + + /* Initialize message table pointers */ + err->jpeg_message_table = jpeg_std_message_table; + err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; + + err->addon_message_table = NULL; + err->first_addon_message = 0; /* for safety */ + err->last_addon_message = 0; + + return err; +} diff --git a/dcmjpeg/libijg12/jerror12.h b/dcmjpeg/libijg12/jerror12.h new file mode 100644 index 00000000..d90bd1c1 --- /dev/null +++ b/dcmjpeg/libijg12/jerror12.h @@ -0,0 +1,310 @@ +/* + * jerror.h + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the error and message codes for the JPEG library. + * Edit this file to add new codes, or to translate the message strings to + * some other language. + * A set of error-reporting macros are defined too. Some applications using + * the JPEG library may wish to include this file to get the error codes + * and/or the macros. + */ + +/* + * To define the enum list of message codes, include this file without + * defining macro JMESSAGE. To create a message string table, include it + * again with a suitable JMESSAGE definition (see jerror.c for an example). + */ +#ifndef JMESSAGE +#ifndef JERROR_H +/* First time through, define the enum list */ +#define JMAKE_ENUM_LIST +#else +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ +#define JMESSAGE(code,string) +#endif /* JERROR_H */ +#endif /* JMESSAGE */ + +#ifdef JMAKE_ENUM_LIST + +typedef enum { + +#define JMESSAGE(code,string) code , + +#endif /* JMAKE_ENUM_LIST */ + +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ + +/* For maintenance convenience, list is alphabetical by message code name */ +JMESSAGE(JERR_ARITH_NOTIMPL, + "Sorry, there are legal restrictions on arithmetic coding") +JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") +JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") +JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") +JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") +JMESSAGE(JERR_BAD_DIFF, "spatial difference out of range") +JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") +JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") +JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") +JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") +JMESSAGE(JERR_BAD_LIB_VERSION, + "Wrong JPEG library version: library is %d, caller expects %d") +JMESSAGE(JERR_BAD_LOSSLESS, + "Invalid lossless parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_LOSSLESS_SCRIPT, + "Invalid lossless parameters at scan script entry %d") +JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") +JMESSAGE(JERR_BAD_PROGRESSION, + "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_PROG_SCRIPT, + "Invalid progressive parameters at scan script entry %d") +JMESSAGE(JERR_BAD_RESTART, "Invalid restart interval: %d, must be an integer multiple of the number of MCUs in an MCU_row (%d)") +JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") +JMESSAGE(JERR_BAD_STRUCT_SIZE, + "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") +JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") +JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") +JMESSAGE(JERR_CANT_TRANSCODE, + "Cannot transcode to/from lossless JPEG datastreams") +JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") +JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") +JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") +JMESSAGE(JERR_EMS_READ, "Read from EMS failed") +JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") +JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") +JMESSAGE(JERR_FILE_READ, "Input file read error") +JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") +JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") +JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") +JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, + "Cannot transcode due to multiple use of quantization table %d") +JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") +JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") +JMESSAGE(JERR_NOTIMPL, "Not implemented yet") +JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") +#ifdef WITH_ARITHMETIC_PATCH +JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") +#endif +JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") +JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") +JMESSAGE(JERR_NO_LOSSLESS_SCRIPT, "Lossless encoding was requested but no scan script was supplied") +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") +JMESSAGE(JERR_QUANT_COMPONENTS, + "Cannot quantize more than %d color components") +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") +JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") +JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") +JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") +JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") +JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") +JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") +JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") +JMESSAGE(JERR_TFILE_WRITE, + "Write failed on temporary file --- out of disk space?") +JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") +JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") +JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") +JMESSAGE(JERR_XMS_READ, "Read from XMS failed") +JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") +JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) +JMESSAGE(JMSG_VERSION, JVERSION) +JMESSAGE(JTRC_16BIT_TABLES, + "Caution: quantization tables are too coarse for baseline JPEG") +JMESSAGE(JTRC_ADOBE, + "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") +JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") +JMESSAGE(JTRC_DRI, "Define Restart Interval %u") +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") +JMESSAGE(JTRC_EOI, "End Of Image") +JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, + "Warning: thumbnail image size does not match data length %u") +JMESSAGE(JTRC_JFIF_EXTENSION, + "JFIF extension marker: type 0x%02x, length %u") +JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") +JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") +JMESSAGE(JTRC_RST, "RST%d") +JMESSAGE(JTRC_SMOOTH_NOTIMPL, + "Smoothing not supported with nonstandard sampling ratios") +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") +JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") +JMESSAGE(JTRC_SOI, "Start of Image") +JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") +JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") +JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") +JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") +JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") +JMESSAGE(JTRC_THUMB_JPEG, + "JFIF extension marker: JPEG-compressed thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_PALETTE, + "JFIF extension marker: palette thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_RGB, + "JFIF extension marker: RGB thumbnail image, length %u") +JMESSAGE(JTRC_UNKNOWN_LOSSLESS_IDS, + "Unrecognized component IDs %d %d %d, assuming RGB") +JMESSAGE(JTRC_UNKNOWN_LOSSY_IDS, + "Unrecognized component IDs %d %d %d, assuming YCbCr") +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") +#ifdef WITH_ARITHMETIC_PATCH +JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") +#endif +JMESSAGE(JWRN_BOGUS_PROGRESSION, + "Inconsistent progression sequence for component %d coefficient %d") +JMESSAGE(JWRN_EXTRANEOUS_DATA, + "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") +JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") +JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") +JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") +JMESSAGE(JWRN_MUST_DOWNSCALE, + "Must downscale data from %d bits to %d") +JMESSAGE(JWRN_MUST_RESYNC, + "Corrupt JPEG data: found marker 0x%02x instead of RST%d") +JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") +JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") + +#ifdef JMAKE_ENUM_LIST + + JMSG_LASTMSGCODE +} J_MESSAGE_CODE; + +#undef JMAKE_ENUM_LIST +#endif /* JMAKE_ENUM_LIST */ + +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ +#undef JMESSAGE + + +#ifndef JERROR_H +#define JERROR_H + +/* Macros to simplify using the error and trace message stuff */ +/* The first parameter is either type of cinfo pointer */ + +/* Fatal errors (print message and exit) */ +#define ERREXIT(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT3(cinfo,code,p1,p2,p3) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXITS(cinfo,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) + +#define MAKESTMT(stuff) do { stuff } while (0) + +/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ +#define WARNMS(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) + +/* Informational/debugging messages */ +#define TRACEMS(cinfo,lvl,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS1(cinfo,lvl,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS2(cinfo,lvl,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMSS(cinfo,lvl,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) + +#endif /* JERROR_H */ diff --git a/dcmjpeg/libijg12/jfdctflt.c b/dcmjpeg/libijg12/jfdctflt.c new file mode 100644 index 00000000..e3557a73 --- /dev/null +++ b/dcmjpeg/libijg12/jfdctflt.c @@ -0,0 +1,168 @@ +/* + * jfdctflt.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * forward DCT (Discrete Cosine Transform). + * + * This implementation should be more accurate than either of the integer + * DCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jdct12.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_float (FAST_FLOAT * data) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z1, z2, z3, z4, z5, z11, z13; + FAST_FLOAT *dataptr; + int ctr; + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = tmp10 + tmp11; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jfdctfst.c b/dcmjpeg/libijg12/jfdctfst.c new file mode 100644 index 00000000..8a69b7cc --- /dev/null +++ b/dcmjpeg/libijg12/jfdctfst.c @@ -0,0 +1,224 @@ +/* + * jfdctfst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jdct12.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jfdctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * Again to save a few shifts, the intermediate results between pass 1 and + * pass 2 are not upscaled, but are represented only to integral precision. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#define CONST_BITS 8 + + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_0_382683433 ((IJG_INT32) 98) /* FIX(0.382683433) */ +#define FIX_0_541196100 ((IJG_INT32) 139) /* FIX(0.541196100) */ +#define FIX_0_707106781 ((IJG_INT32) 181) /* FIX(0.707106781) */ +#define FIX_1_306562965 ((IJG_INT32) 334) /* FIX(1.306562965) */ +#else +#define FIX_0_382683433 FIX(0.382683433) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_707106781 FIX(0.707106781) +#define FIX_1_306562965 FIX(1.306562965) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an IJG_INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_ifast (DCTELEM * data) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z1, z2, z3, z4, z5, z11, z13; + DCTELEM *dataptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = tmp10 + tmp11; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jfdctint.c b/dcmjpeg/libijg12/jfdctint.c new file mode 100644 index 00000000..c9d90859 --- /dev/null +++ b/dcmjpeg/libijg12/jfdctint.c @@ -0,0 +1,283 @@ +/* + * jfdctint.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jdct12.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D DCT step produces outputs which are a factor of sqrt(N) + * larger than the true DCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D DCT, + * because the y0 and y4 outputs need not be divided by sqrt(N). + * In the IJG code, this factor of 8 is removed by the quantization step + * (in jcdctmgr.c), NOT in this module. + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (For 12-bit sample data, the intermediate + * array is IJG_INT32 anyway.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((IJG_INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((IJG_INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((IJG_INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((IJG_INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((IJG_INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((IJG_INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((IJG_INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((IJG_INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_islow (DCTELEM * data) +{ + IJG_INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + IJG_INT32 tmp10, tmp11, tmp12, tmp13; + IJG_INT32 z1, z2, z3, z4, z5; + DCTELEM *dataptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), + CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), + CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jidctflt.c b/dcmjpeg/libijg12/jidctflt.c new file mode 100644 index 00000000..972a1264 --- /dev/null +++ b/dcmjpeg/libijg12/jidctflt.c @@ -0,0 +1,242 @@ +/* + * jidctflt.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * This implementation should be more accurate than either of the integer + * IDCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jdct12.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a float result. + */ + +#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z5, z10, z11, z12, z13; + JCOEFPTR inptr; + FLOAT_MULT_TYPE * quantptr; + FAST_FLOAT * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ + tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + wsptr[DCTSIZE*0] = tmp0 + tmp7; + wsptr[DCTSIZE*7] = tmp0 - tmp7; + wsptr[DCTSIZE*1] = tmp1 + tmp6; + wsptr[DCTSIZE*6] = tmp1 - tmp6; + wsptr[DCTSIZE*2] = tmp2 + tmp5; + wsptr[DCTSIZE*5] = tmp2 - tmp5; + wsptr[DCTSIZE*4] = tmp3 + tmp4; + wsptr[DCTSIZE*3] = tmp3 - tmp4; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * And testing floats for zero is relatively expensive, so we don't bother. + */ + + /* Even part */ + + tmp10 = wsptr[0] + wsptr[4]; + tmp11 = wsptr[0] - wsptr[4]; + + tmp13 = wsptr[2] + wsptr[6]; + tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = wsptr[5] + wsptr[3]; + z10 = wsptr[5] - wsptr[3]; + z11 = wsptr[1] + wsptr[7]; + z12 = wsptr[1] - wsptr[7]; + + tmp7 = z11 + z13; + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ + tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + /* Final output stage: scale down by a factor of 8 and range-limit */ + + outptr[0] = range_limit[(int) DESCALE((IJG_INT32) (tmp0 + tmp7), 3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) DESCALE((IJG_INT32) (tmp0 - tmp7), 3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE((IJG_INT32) (tmp1 + tmp6), 3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) DESCALE((IJG_INT32) (tmp1 - tmp6), 3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE((IJG_INT32) (tmp2 + tmp5), 3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) DESCALE((IJG_INT32) (tmp2 - tmp5), 3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) DESCALE((IJG_INT32) (tmp3 + tmp4), 3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE((IJG_INT32) (tmp3 - tmp4), 3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jidctfst.c b/dcmjpeg/libijg12/jidctfst.c new file mode 100644 index 00000000..17997950 --- /dev/null +++ b/dcmjpeg/libijg12/jidctfst.c @@ -0,0 +1,368 @@ +/* + * jidctfst.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jdct12.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jidctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * The dequantized coefficients are not integers because the AA&N scaling + * factors have been incorporated. We represent them scaled up by PASS1_BITS, + * so that the first and second IDCT rounds have the same input scaling. + * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to + * avoid a descaling shift; this compromises accuracy rather drastically + * for small quantization table entries, but it saves a lot of shifts. + * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway, + * so we use a much larger scaling factor to preserve accuracy. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 8 +#define PASS1_BITS 2 +#else +#define CONST_BITS 8 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_1_082392200 ((IJG_INT32) 277) /* FIX(1.082392200) */ +#define FIX_1_414213562 ((IJG_INT32) 362) /* FIX(1.414213562) */ +#define FIX_1_847759065 ((IJG_INT32) 473) /* FIX(1.847759065) */ +#define FIX_2_613125930 ((IJG_INT32) 669) /* FIX(2.613125930) */ +#else +#define FIX_1_082392200 FIX(1.082392200) +#define FIX_1_414213562 FIX(1.414213562) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_2_613125930 FIX(2.613125930) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an IJG_INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a DCTELEM result. For 8-bit data a 16x16->16 + * multiplication will do. For 12-bit data, the multiplier table is + * declared IJG_INT32, so a 32-bit multiply will be used. + */ + +#if BITS_IN_JSAMPLE == 8 +#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval)) +#else +#define DEQUANTIZE(coef,quantval) \ + DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS) +#endif + + +/* Like DESCALE, but applies to a DCTELEM and produces an int. + * We assume that int right shift is unsigned if IJG_INT32 right shift is. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS DCTELEM ishift_temp; +#if BITS_IN_JSAMPLE == 8 +#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */ +#else +#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */ +#endif +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +#ifdef USE_ACCURATE_ROUNDING +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n)) +#else +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n)) +#endif + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z5, z10, z11, z12, z13; + JCOEFPTR inptr; + IFAST_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS /* for DESCALE */ + ISHIFT_TEMPS /* for IDESCALE */ + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (IFAST_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); + wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); + wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); + wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); + wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5); + wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); + wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); + wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); + tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); + + tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); + tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562) + - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; + z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; + z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; + z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + /* Final output stage: scale down by a factor of 8 and range-limit */ + + outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jidctint.c b/dcmjpeg/libijg12/jidctint.c new file mode 100644 index 00000000..83a77213 --- /dev/null +++ b/dcmjpeg/libijg12/jidctint.c @@ -0,0 +1,389 @@ +/* + * jidctint.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jdct12.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D IDCT step produces outputs which are a factor of sqrt(N) + * larger than the true IDCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D IDCT, + * because the y0 and y4 inputs need not be divided by sqrt(N). + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (To scale up 12-bit sample data further, an + * intermediate IJG_INT32 array would be needed.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((IJG_INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((IJG_INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((IJG_INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((IJG_INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((IJG_INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((IJG_INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((IJG_INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((IJG_INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce an int result. In this module, both inputs and result + * are 16 bits or less, so either int or short multiply will work. + */ + +#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp1, tmp2, tmp3; + IJG_INT32 tmp10, tmp11, tmp12, tmp13; + IJG_INT32 z1, z2, z3, z4, z5; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (IJG_INT32) wsptr[2]; + z3 = (IJG_INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((IJG_INT32) wsptr[0] + (IJG_INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((IJG_INT32) wsptr[0] - (IJG_INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (IJG_INT32) wsptr[7]; + tmp1 = (IJG_INT32) wsptr[5]; + tmp2 = (IJG_INT32) wsptr[3]; + tmp3 = (IJG_INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jidctred.c b/dcmjpeg/libijg12/jidctred.c new file mode 100644 index 00000000..03898b0c --- /dev/null +++ b/dcmjpeg/libijg12/jidctred.c @@ -0,0 +1,398 @@ +/* + * jidctred.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains inverse-DCT routines that produce reduced-size output: + * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block. + * + * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M) + * algorithm used in jidctint.c. We simply replace each 8-to-8 1-D IDCT step + * with an 8-to-4 step that produces the four averages of two adjacent outputs + * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output). + * These steps were derived by computing the corresponding values at the end + * of the normal LL&M code, then simplifying as much as possible. + * + * 1x1 is trivial: just take the DC coefficient divided by 8. + * + * See jidctint.c for additional comments. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jdct12.h" /* Private declarations for DCT subsystem */ + +#ifdef IDCT_SCALING_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling is the same as in jidctint.c. */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_211164243 ((IJG_INT32) 1730) /* FIX(0.211164243) */ +#define FIX_0_509795579 ((IJG_INT32) 4176) /* FIX(0.509795579) */ +#define FIX_0_601344887 ((IJG_INT32) 4926) /* FIX(0.601344887) */ +#define FIX_0_720959822 ((IJG_INT32) 5906) /* FIX(0.720959822) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_850430095 ((IJG_INT32) 6967) /* FIX(0.850430095) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_061594337 ((IJG_INT32) 8697) /* FIX(1.061594337) */ +#define FIX_1_272758580 ((IJG_INT32) 10426) /* FIX(1.272758580) */ +#define FIX_1_451774981 ((IJG_INT32) 11893) /* FIX(1.451774981) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_2_172734803 ((IJG_INT32) 17799) /* FIX(2.172734803) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_624509785 ((IJG_INT32) 29692) /* FIX(3.624509785) */ +#else +#define FIX_0_211164243 FIX(0.211164243) +#define FIX_0_509795579 FIX(0.509795579) +#define FIX_0_601344887 FIX(0.601344887) +#define FIX_0_720959822 FIX(0.720959822) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_850430095 FIX(0.850430095) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_061594337 FIX(1.061594337) +#define FIX_1_272758580 FIX(1.272758580) +#define FIX_1_451774981 FIX(1.451774981) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_2_172734803 FIX(2.172734803) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_624509785 FIX(3.624509785) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce an int result. In this module, both inputs and result + * are 16 bits or less, so either int or short multiply will work. + */ + +#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 4x4 output block. + */ + +GLOBAL(void) +jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp2, tmp10, tmp12; + IJG_INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE*4]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { + /* Don't bother to process column 4, because second pass won't use it */ + if (ctr == DCTSIZE-4) + continue; + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 && + inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { + /* AC terms all zero; we need not examine term 4 for 4x4 output */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= (CONST_BITS+1); + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ + + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ + + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ + + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ + + tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ + + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ + + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ + + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ + + /* Final output stage */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1); + } + + /* Pass 2: process 4 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++) { + outptr = output_buf[ctr] + output_col; + /* It's not clear whether a zero row test is worthwhile here ... */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp0 = ((IJG_INT32) wsptr[0]) << (CONST_BITS+1); + + tmp2 = MULTIPLY((IJG_INT32) wsptr[2], FIX_1_847759065) + + MULTIPLY((IJG_INT32) wsptr[6], - FIX_0_765366865); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + /* Odd part */ + + z1 = (IJG_INT32) wsptr[7]; + z2 = (IJG_INT32) wsptr[5]; + z3 = (IJG_INT32) wsptr[3]; + z4 = (IJG_INT32) wsptr[1]; + + tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ + + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ + + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ + + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ + + tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ + + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ + + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ + + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 2x2 output block. + */ + +GLOBAL(void) +jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp10, z1; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE*2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { + /* Don't bother to process columns 2,4,6 */ + if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6) + continue; + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) { + /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + + continue; + } + + /* Even part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp10 = z1 << (CONST_BITS+2); + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ + + /* Final output stage */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2); + } + + /* Pass 2: process 2 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 2; ctr++) { + outptr = output_buf[ctr] + output_col; + /* It's not clear whether a zero row test is worthwhile here ... */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp10 = ((IJG_INT32) wsptr[0]) << (CONST_BITS+2); + + /* Odd part */ + + tmp0 = MULTIPLY((IJG_INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */ + + MULTIPLY((IJG_INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */ + + MULTIPLY((IJG_INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */ + + MULTIPLY((IJG_INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3+2) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3+2) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 1x1 output block. + */ + +GLOBAL(void) +jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + const JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + int dcval; + ISLOW_MULT_TYPE * quantptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + SHIFT_TEMPS + + /* We hardly need an inverse DCT routine for this: just take the + * average pixel value, which is one-eighth of the DC coefficient. + */ + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + dcval = DEQUANTIZE(coef_block[0], quantptr[0]); + dcval = (int) DESCALE((IJG_INT32) dcval, 3); + + output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; +} + +#endif /* IDCT_SCALING_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jinclude12.h b/dcmjpeg/libijg12/jinclude12.h new file mode 100644 index 00000000..f9ac222b --- /dev/null +++ b/dcmjpeg/libijg12/jinclude12.h @@ -0,0 +1,91 @@ +/* + * jinclude.h + * + * Copyright (C) 1991-1994, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file exists to provide a single place to fix any problems with + * including the wrong system include files. (Common problems are taken + * care of by the standard jconfig symbols, but on really weird systems + * you may have to edit this file.) + * + * NOTE: this file is NOT intended to be included by applications using the + * JPEG library. Most applications need only include jpeglib.h. + */ + + +/* Include auto-config file to find out which system include files we need. */ + +#include "jconfig12.h" /* auto configuration options */ +#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ + +/* + * We need the NULL macro and size_t typedef. + * On an ANSI-conforming system it is sufficient to include . + * Otherwise, we get them from or ; we may have to + * pull in as well. + * Note that the core JPEG library does not require ; + * only the default error handler and data source/destination modules do. + * But we must pull it in because of the references to FILE in jpeglib.h. + * You can remove those references if you want to compile without . + */ + +#ifdef HAVE_STDDEF_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef NEED_SYS_TYPES_H +#include +#endif + +#include + +/* + * We need memory copying and zeroing functions, plus strncpy(). + * ANSI and System V implementations declare these in . + * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). + * Some systems may declare memset and memcpy in . + * + * NOTE: we assume the size parameters to these functions are of type size_t. + * Change the casts in these macros if not! + */ + +#ifdef NEED_BSD_STRINGS + +#include +#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) +#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) + +#else /* not BSD, assume ANSI/SysV string lib */ + +#include +#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) +#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) + +#endif + +/* + * In ANSI C, and indeed any rational implementation, size_t is also the + * type returned by sizeof(). However, it seems there are some irrational + * implementations out there, in which sizeof() returns an int even though + * size_t is defined as long or unsigned long. To ensure consistent results + * we always use this SIZEOF() macro in place of using sizeof() directly. + */ + +#define SIZEOF(object) ((size_t) sizeof(object)) + +/* + * The modules that use fread() and fwrite() always invoke them through + * these macros. On some systems you may need to twiddle the argument casts. + * CAUTION: argument order is different from underlying functions! + */ + +#define JFREAD(file,buf,sizeofbuf) \ + ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) +#define JFWRITE(file,buf,sizeofbuf) \ + ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/dcmjpeg/libijg12/jlossls12.h b/dcmjpeg/libijg12/jlossls12.h new file mode 100644 index 00000000..547b02ea --- /dev/null +++ b/dcmjpeg/libijg12/jlossls12.h @@ -0,0 +1,151 @@ +/* + * jlossls.h + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the lossless JPEG + * codec modules. + */ + +#ifndef JLOSSLS_H +#define JLOSSLS_H + + +/* + * Table H.1: Predictors for lossless coding. + */ + +#define PREDICTOR1 Ra +#define PREDICTOR2 Rb +#define PREDICTOR3 Rc +#define PREDICTOR4 (int) ((IJG_INT32) Ra + (IJG_INT32) Rb - (IJG_INT32) Rc) +#define PREDICTOR5 (int) ((IJG_INT32) Ra + RIGHT_SHIFT((IJG_INT32) Rb - (IJG_INT32) Rc, 1)) +#define PREDICTOR6 (int) ((IJG_INT32) Rb + RIGHT_SHIFT((IJG_INT32) Ra - (IJG_INT32) Rc, 1)) +#define PREDICTOR7 (int) RIGHT_SHIFT((IJG_INT32) Ra + (IJG_INT32) Rb, 1) + + +typedef JMETHOD(void, predict_difference_method_ptr, + (j_compress_ptr cinfo, int ci, + JSAMPROW input_buf, JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width)); + +typedef JMETHOD(void, scaler_method_ptr, + (j_compress_ptr cinfo, int ci, + JSAMPROW input_buf, JSAMPROW output_buf, + JDIMENSION width)); + +/* Lossless-specific compression codec (compressor proper) */ +typedef struct { + struct jpeg_c_codec pub; /* public fields */ + + + /* Difference buffer control */ + JMETHOD(void, diff_start_pass, (j_compress_ptr cinfo, + J_BUF_MODE pass_mode)); + + /* Pointer to data which is private to diff controller */ + void *diff_private; + + + /* Entropy encoding */ + JMETHOD(JDIMENSION, entropy_encode_mcus, (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Prediction, differencing */ + JMETHOD(void, predict_start_pass, (j_compress_ptr cinfo)); + + /* It is useful to allow each component to have a separate diff method. */ + predict_difference_method_ptr predict_difference[MAX_COMPONENTS]; + + /* Pointer to data which is private to predictor module */ + void *pred_private; + + /* Sample scaling */ + JMETHOD(void, scaler_start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, scaler_scale, (j_compress_ptr cinfo, + JSAMPROW input_buf, JSAMPROW output_buf, + JDIMENSION width)); + + /* Pointer to data which is private to scaler module */ + void *scaler_private; + +} jpeg_lossless_c_codec; + +typedef jpeg_lossless_c_codec * j_lossless_c_ptr; + + +typedef JMETHOD(void, predict_undifference_method_ptr, + (j_decompress_ptr cinfo, int comp_index, + JDIFFROW diff_buf, JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width)); + +/* Lossless-specific decompression codec (decompressor proper) */ +typedef struct { + struct jpeg_d_codec pub; /* public fields */ + + + /* Difference buffer control */ + JMETHOD(void, diff_start_input_pass, (j_decompress_ptr cinfo)); + + /* Pointer to data which is private to diff controller */ + void *diff_private; + + + /* Entropy decoding */ + JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(boolean, entropy_process_restart, (j_decompress_ptr cinfo)); + JMETHOD(JDIMENSION, entropy_decode_mcus, (j_decompress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Prediction, undifferencing */ + JMETHOD(void, predict_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, predict_process_restart, (j_decompress_ptr cinfo)); + + /* It is useful to allow each component to have a separate undiff method. */ + predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS]; + + /* Pointer to data which is private to predictor module */ + void *pred_private; + + /* Sample scaling */ + JMETHOD(void, scaler_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, scaler_scale, (j_decompress_ptr cinfo, + JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width)); + + /* Pointer to data which is private to scaler module */ + void *scaler_private; + +} jpeg_lossless_d_codec; + +typedef jpeg_lossless_d_codec * j_lossless_d_ptr; + + +/* Compression module initialization routines */ +EXTERN(void) jinit_lossless_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_lhuff_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_differencer JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_scaler JPP((j_compress_ptr cinfo)); +/* Decompression module initialization routines */ +EXTERN(void) jinit_lossless_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_lhuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_undifferencer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_scaler JPP((j_decompress_ptr cinfo)); + +#endif /* JLOSSLS_H */ diff --git a/dcmjpeg/libijg12/jlossy12.h b/dcmjpeg/libijg12/jlossy12.h new file mode 100644 index 00000000..ad4d62b3 --- /dev/null +++ b/dcmjpeg/libijg12/jlossy12.h @@ -0,0 +1,120 @@ +/* + * jlossy.h + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the lossy (DCT-based) + * JPEG codec modules. + */ + +#ifndef JLOSSY_H +#define JLOSSY_H + + +/* Lossy-specific compression codec (compressor proper) */ +typedef struct { + struct jpeg_c_codec pub; /* public fields */ + + + /* Coefficient buffer control */ + JMETHOD(void, coef_start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + /* JMETHOD(boolean, coef_compress_data, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf));*/ + + /* Pointer to data which is private to coef module */ + void *coef_private; + + + /* Forward DCT (also controls coefficient quantization) */ + JMETHOD(void, fdct_start_pass, (j_compress_ptr cinfo)); + /* perhaps this should be an array??? */ + JMETHOD(void, fdct_forward_DCT, (j_compress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks)); + + /* Pointer to data which is private to fdct module */ + void *fdct_private; + + + /* Entropy encoding */ + JMETHOD(boolean, entropy_encode_mcu, (j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + +} jpeg_lossy_c_codec; + +typedef jpeg_lossy_c_codec * j_lossy_c_ptr; + + + +typedef JMETHOD(void, inverse_DCT_method_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col)); + +/* Lossy-specific decompression codec (decompressor proper) */ +typedef struct { + struct jpeg_d_codec pub; /* public fields */ + + + /* Coefficient buffer control */ + JMETHOD(void, coef_start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, coef_start_output_pass, (j_decompress_ptr cinfo)); + + /* Pointer to array of coefficient virtual arrays, or NULL if none */ + jvirt_barray_ptr *coef_arrays; + + /* Pointer to data which is private to coef module */ + void *coef_private; + + + /* Entropy decoding */ + JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(boolean, entropy_decode_mcu, (j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); + + /* This is here to share code between baseline and progressive decoders; */ + /* other modules probably should not use it */ + boolean entropy_insufficient_data; /* set TRUE after emitting warning */ + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Inverse DCT (also performs dequantization) */ + JMETHOD(void, idct_start_pass, (j_decompress_ptr cinfo)); + + /* It is useful to allow each component to have a separate IDCT method. */ + inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; + + /* Pointer to data which is private to idct module */ + void *idct_private; + +} jpeg_lossy_d_codec; + +typedef jpeg_lossy_d_codec * j_lossy_d_ptr; + + +/* Compression module initialization routines */ +EXTERN(void) jinit_lossy_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_shuff_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo)); + +/* Decompression module initialization routines */ +EXTERN(void) jinit_lossy_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_shuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); + +#endif /* JLOSSY_H */ diff --git a/dcmjpeg/libijg12/jmemmgr.c b/dcmjpeg/libijg12/jmemmgr.c new file mode 100644 index 00000000..1ba53460 --- /dev/null +++ b/dcmjpeg/libijg12/jmemmgr.c @@ -0,0 +1,1174 @@ +/* + * jmemmgr.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the JPEG system-independent memory management + * routines. This code is usable across a wide variety of machines; most + * of the system dependencies have been isolated in a separate file. + * The major functions provided here are: + * * pool-based allocation and freeing of memory; + * * policy decisions about how to divide available memory among the + * virtual arrays; + * * control logic for swapping virtual arrays between main memory and + * backing storage. + * The separate system-dependent file provides the actual backing-storage + * access code, and it contains the policy decision about how much total + * main memory to use. + * This file is system-dependent in the sense that some of its functions + * are unnecessary in some systems. For example, if there is enough virtual + * memory so that backing storage will never be used, much of the virtual + * array control logic could be removed. (Of course, if you have that much + * memory then you shouldn't care about a little bit of unused code...) + */ + +#define JPEG_INTERNALS +#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */ +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jmemsys12.h" /* import the system-dependent declarations */ + +#ifndef NO_GETENV +#ifndef HAVE_STDLIB_H /* should declare getenv() */ +extern char * getenv JPP((const char * name)); +#endif +#endif + + +/* + * Some important notes: + * The allocation routines provided here must never return NULL. + * They should exit to error_exit if unsuccessful. + * + * It's not a good idea to try to merge the sarray, barray and darray + * routines, even though they are textually almost the same, because + * samples are usually stored as bytes while coefficients and differenced + * are shorts or ints. Thus, in machines where byte pointers have a + * different representation from word pointers, the resulting machine + * code could not be the same. + */ + + +/* + * Many machines require storage alignment: longs must start on 4-byte + * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc() + * always returns pointers that are multiples of the worst-case alignment + * requirement, and we had better do so too. + * There isn't any really portable way to determine the worst-case alignment + * requirement. This module assumes that the alignment requirement is + * multiples of sizeof(ALIGN_TYPE). + * By default, we define ALIGN_TYPE as double. This is necessary on some + * workstations (where doubles really do need 8-byte alignment) and will work + * fine on nearly everything. If your machine has lesser alignment needs, + * you can save a few bytes by making ALIGN_TYPE smaller. + * The only place I know of where this will NOT work is certain Macintosh + * 680x0 compilers that define double as a 10-byte IEEE extended float. + * Doing 10-byte alignment is counterproductive because longwords won't be + * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have + * such a compiler. + */ + +#ifndef ALIGN_TYPE /* so can override from jconfig.h */ +#define ALIGN_TYPE double +#endif + + +/* + * We allocate objects from "pools", where each pool is gotten with a single + * request to jpeg_get_small() or jpeg_get_large(). There is no per-object + * overhead within a pool, except for alignment padding. Each pool has a + * header with a link to the next pool of the same class. + * Small and large pool headers are identical except that the latter's + * link pointer must be FAR on 80x86 machines. + * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE + * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple + * of the alignment requirement of ALIGN_TYPE. + */ + +typedef union small_pool_struct * small_pool_ptr; + +typedef union small_pool_struct { + struct { + small_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} small_pool_hdr; + +typedef union large_pool_struct FAR * large_pool_ptr; + +typedef union large_pool_struct { + struct { + large_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} large_pool_hdr; + + +/* + * Here is the full definition of a memory manager object. + */ + +typedef struct { + struct jpeg_memory_mgr pub; /* public fields */ + + /* Each pool identifier (lifetime class) names a linked list of pools. */ + small_pool_ptr small_list[JPOOL_NUMPOOLS]; + large_pool_ptr large_list[JPOOL_NUMPOOLS]; + + /* Since we only have one lifetime class of virtual arrays, only one + * linked list is necessary (for each datatype). Note that the virtual + * array control blocks being linked together are actually stored somewhere + * in the small-pool list. + */ + jvirt_sarray_ptr virt_sarray_list; + jvirt_barray_ptr virt_barray_list; + + /* This counts total space obtained from jpeg_get_small/large */ + long total_space_allocated; + + /* alloc_sarray and alloc_barray set this value for use by virtual + * array routines. + */ + JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */ +} my_memory_mgr; + +typedef my_memory_mgr * my_mem_ptr; + + +/* + * The control blocks for virtual arrays. + * Note that these blocks are allocated in the "small" pool area. + * System-dependent info for the associated backing store (if any) is hidden + * inside the backing_store_info struct. + */ + +struct jvirt_sarray_control { + JSAMPARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION samplesperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_sarray_ptr next; /* link to next virtual sarray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + +struct jvirt_barray_control { + JBLOCKARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION blocksperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_barray_ptr next; /* link to next virtual barray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + + +#ifdef MEM_STATS /* optional extra stuff for statistics */ + +LOCAL(void) +print_mem_stats (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + + /* Since this is only a debugging stub, we can cheat a little by using + * fprintf directly rather than going through the trace message code. + * This is helpful because message parm array can't handle longs. + */ + fprintf(stderr, "Freeing pool %d, total space = %ld\n", + pool_id, mem->total_space_allocated); + + for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL; + lhdr_ptr = lhdr_ptr->hdr.next) { + fprintf(stderr, " Large chunk used %ld\n", + (long) lhdr_ptr->hdr.bytes_used); + } + + for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL; + shdr_ptr = shdr_ptr->hdr.next) { + fprintf(stderr, " Small chunk used %ld free %ld\n", + (long) shdr_ptr->hdr.bytes_used, + (long) shdr_ptr->hdr.bytes_left); + } +} + +#endif /* MEM_STATS */ + + +LOCAL(void) +out_of_memory (j_common_ptr cinfo, int which) +/* Report an out-of-memory error and stop execution */ +/* If we compiled MEM_STATS support, report alloc requests before dying */ +{ +#ifdef MEM_STATS + cinfo->err->trace_level = 2; /* force self_destruct to report stats */ +#endif + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which); +} + + +/* + * Allocation of "small" objects. + * + * For these, we use pooled storage. When a new pool must be created, + * we try to get enough space for the current request plus a "slop" factor, + * where the slop will be the amount of leftover space in the new pool. + * The speed vs. space tradeoff is largely determined by the slop values. + * A different slop value is provided for each pool class (lifetime), + * and we also distinguish the first pool of a class from later ones. + * NOTE: the values given work fairly well on both 16- and 32-bit-int + * machines, but may be too small if longs are 64 bits or more. + */ + +static const size_t first_pool_slop[JPOOL_NUMPOOLS] = +{ + 1600, /* first PERMANENT pool */ + 16000 /* first IMAGE pool */ +}; + +static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = +{ + 0, /* additional PERMANENT pools */ + 5000 /* additional IMAGE pools */ +}; + +#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */ + + +METHODDEF(void *) +alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "small" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr hdr_ptr, prev_hdr_ptr; + char * data_ptr; + size_t odd_bytes, min_request, slop; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))) + out_of_memory(cinfo, 1); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* See if space is available in any existing pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + prev_hdr_ptr = NULL; + hdr_ptr = mem->small_list[pool_id]; + while (hdr_ptr != NULL) { + if (hdr_ptr->hdr.bytes_left >= sizeofobject) + break; /* found pool with enough space */ + prev_hdr_ptr = hdr_ptr; + hdr_ptr = hdr_ptr->hdr.next; + } + + /* Time to make a new pool? */ + if (hdr_ptr == NULL) { + /* min_request is what we need now, slop is what will be leftover */ + min_request = sizeofobject + SIZEOF(small_pool_hdr); + if (prev_hdr_ptr == NULL) /* first pool in class? */ + slop = first_pool_slop[pool_id]; + else + slop = extra_pool_slop[pool_id]; + /* Don't ask for more than MAX_ALLOC_CHUNK */ + if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request)) + slop = (size_t) (MAX_ALLOC_CHUNK-min_request); + /* Try to get space, if fail reduce slop and try again */ + for (;;) { + hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop); + if (hdr_ptr != NULL) + break; + slop /= 2; + if (slop < MIN_SLOP) /* give up when it gets real small */ + out_of_memory(cinfo, 2); /* jpeg_get_small failed */ + } + mem->total_space_allocated += (long)(min_request + slop); + /* Success, initialize the new pool header and add to end of list */ + hdr_ptr->hdr.next = NULL; + hdr_ptr->hdr.bytes_used = 0; + hdr_ptr->hdr.bytes_left = sizeofobject + slop; + if (prev_hdr_ptr == NULL) /* first pool in class? */ + mem->small_list[pool_id] = hdr_ptr; + else + prev_hdr_ptr->hdr.next = hdr_ptr; + } + + /* OK, allocate the object from the current pool */ + data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */ + data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */ + hdr_ptr->hdr.bytes_used += sizeofobject; + hdr_ptr->hdr.bytes_left -= sizeofobject; + + return (void *) data_ptr; +} + + +/* + * Allocation of "large" objects. + * + * The external semantics of these are the same as "small" objects, + * except that FAR pointers are used on 80x86. However the pool + * management heuristics are quite different. We assume that each + * request is large enough that it may as well be passed directly to + * jpeg_get_large; the pool management just links everything together + * so that we can free it all on demand. + * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY + * structures. The routines that create these structures (see below) + * deliberately bunch rows together to ensure a large request size. + */ + +METHODDEF(void FAR *) +alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "large" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + large_pool_ptr hdr_ptr; + size_t odd_bytes; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr))) + out_of_memory(cinfo, 3); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* Always make a new pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject + + SIZEOF(large_pool_hdr)); + if (hdr_ptr == NULL) + out_of_memory(cinfo, 4); /* jpeg_get_large failed */ + mem->total_space_allocated += (long)(sizeofobject + SIZEOF(large_pool_hdr)); + + /* Success, initialize the new pool header and add to list */ + hdr_ptr->hdr.next = mem->large_list[pool_id]; + /* We maintain space counts in each pool header for statistical purposes, + * even though they are not needed for allocation. + */ + hdr_ptr->hdr.bytes_used = sizeofobject; + hdr_ptr->hdr.bytes_left = 0; + mem->large_list[pool_id] = hdr_ptr; + + return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */ +} + + +/* + * Creation of 2-D sample arrays. + * The pointers are in near heap, the samples themselves in FAR heap. + * + * To minimize allocation overhead and to allow I/O of large contiguous + * blocks, we allocate the sample rows in groups of as many rows as possible + * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request. + * NB: the virtual array control routines, later in this file, know about + * this chunking of rows. The rowsperchunk value is left in the mem manager + * object so that it can be saved away if this sarray is the workspace for + * a virtual array. + */ + +METHODDEF(JSAMPARRAY) +alloc_sarray (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, JDIMENSION numrows) +/* Allocate a 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JSAMPARRAY result; + JSAMPROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) samplesperrow * SIZEOF(JSAMPLE)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JSAMPARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JSAMPROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JSAMPROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow + * SIZEOF(JSAMPLE))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += samplesperrow; + } + } + + return result; +} + + +/* + * Creation of 2-D coefficient-block arrays. + * This is essentially the same as the code for sample arrays, above. + */ + +METHODDEF(JBLOCKARRAY) +alloc_barray (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, JDIMENSION numrows) +/* Allocate a 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JBLOCKARRAY result; + JBLOCKROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) blocksperrow * SIZEOF(JBLOCK)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JBLOCKARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JBLOCKROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JBLOCKROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow + * SIZEOF(JBLOCK))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += blocksperrow; + } + } + + return result; +} + + +#ifdef NEED_DARRAY + +/* + * Creation of 2-D difference arrays. + * This is essentially the same as the code for sample arrays, above. + */ + +METHODDEF(JDIFFARRAY) +alloc_darray (j_common_ptr cinfo, int pool_id, + JDIMENSION diffsperrow, JDIMENSION numrows) +/* Allocate a 2-D difference array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JDIFFARRAY result; + JDIFFROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) diffsperrow * SIZEOF(JDIFF)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JDIFFARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JDIFFROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JDIFFROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) diffsperrow + * SIZEOF(JDIFF))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += diffsperrow; + } + } + + return result; +} + +#endif + + +/* + * About virtual array management: + * + * The above "normal" array routines are only used to allocate strip buffers + * (as wide as the image, but just a few rows high). Full-image-sized buffers + * are handled as "virtual" arrays. The array is still accessed a strip at a + * time, but the memory manager must save the whole array for repeated + * accesses. The intended implementation is that there is a strip buffer in + * memory (as high as is possible given the desired memory limit), plus a + * backing file that holds the rest of the array. + * + * The request_virt_array routines are told the total size of the image and + * the maximum number of rows that will be accessed at once. The in-memory + * buffer must be at least as large as the maxaccess value. + * + * The request routines create control blocks but not the in-memory buffers. + * That is postponed until realize_virt_arrays is called. At that time the + * total amount of space needed is known (approximately, anyway), so free + * memory can be divided up fairly. + * + * The access_virt_array routines are responsible for making a specific strip + * area accessible (after reading or writing the backing file, if necessary). + * Note that the access routines are told whether the caller intends to modify + * the accessed strip; during a read-only pass this saves having to rewrite + * data to disk. The access routines are also responsible for pre-zeroing + * any newly accessed rows, if pre-zeroing was requested. + * + * In current usage, the access requests are usually for nonoverlapping + * strips; that is, successive access start_row numbers differ by exactly + * num_rows = maxaccess. This means we can get good performance with simple + * buffer dump/reload logic, by making the in-memory buffer be a multiple + * of the access height; then there will never be accesses across bufferload + * boundaries. The code will still work with overlapping access requests, + * but it doesn't handle bufferload overlaps very efficiently. + */ + + +METHODDEF(jvirt_sarray_ptr) +request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION samplesperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_sarray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_sarray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->samplesperrow = samplesperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_sarray_list; /* add to list of virtual arrays */ + mem->virt_sarray_list = result; + + return result; +} + + +METHODDEF(jvirt_barray_ptr) +request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION blocksperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_barray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_barray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->blocksperrow = blocksperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_barray_list; /* add to list of virtual arrays */ + mem->virt_barray_list = result; + + return result; +} + + +METHODDEF(void) +realize_virt_arrays (j_common_ptr cinfo) +/* Allocate the in-memory buffers for any unrealized virtual arrays */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + size_t space_per_minheight, maximum_space, avail_mem; + size_t minheights, max_minheights; + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + /* Compute the minimum space needed (maxaccess rows in each buffer) + * and the maximum space needed (full image height in each buffer). + * These may be of use to the system-dependent jpeg_mem_available routine. + */ + space_per_minheight = 0; + maximum_space = 0; + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += sptr->maxaccess * + sptr->samplesperrow * SIZEOF(JSAMPLE); + maximum_space += sptr->rows_in_array * + sptr->samplesperrow * SIZEOF(JSAMPLE); + } + } + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += bptr->maxaccess * + bptr->blocksperrow * SIZEOF(JBLOCK); + maximum_space += bptr->rows_in_array * + bptr->blocksperrow * SIZEOF(JBLOCK); + } + } + + if (space_per_minheight <= 0) + return; /* no unrealized arrays, no work */ + + /* Determine amount of memory to actually use; this is system-dependent. */ + avail_mem = (size_t)jpeg_mem_available(cinfo, (long)space_per_minheight, (long)maximum_space, + mem->total_space_allocated); + + /* If the maximum space needed is available, make all the buffers full + * height; otherwise parcel it out with the same number of minheights + * in each buffer. + */ + if (avail_mem >= maximum_space) + max_minheights = 1000000000L; + else { + max_minheights = avail_mem / space_per_minheight; + /* If there doesn't seem to be enough space, try to get the minimum + * anyway. This allows a "stub" implementation of jpeg_mem_available(). + */ + if (max_minheights <= 0) + max_minheights = 1; + } + + /* Allocate the in-memory buffers and initialize backing store as needed. */ + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = (size_t)((sptr->rows_in_array - 1L) / sptr->maxaccess + 1L); + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + sptr->rows_in_mem = sptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + sptr->rows_in_mem = (JDIMENSION)max_minheights * sptr->maxaccess; + jpeg_open_backing_store(cinfo, & sptr->b_s_info, + (long) sptr->rows_in_array * + (long) sptr->samplesperrow * + (long) SIZEOF(JSAMPLE)); + sptr->b_s_open = TRUE; + } + sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE, + sptr->samplesperrow, sptr->rows_in_mem); + sptr->rowsperchunk = mem->last_rowsperchunk; + sptr->cur_start_row = 0; + sptr->first_undef_row = 0; + sptr->dirty = FALSE; + } + } + + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = (size_t)((bptr->rows_in_array - 1L) / bptr->maxaccess + 1L); + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + bptr->rows_in_mem = bptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + bptr->rows_in_mem = (JDIMENSION)max_minheights * bptr->maxaccess; + jpeg_open_backing_store(cinfo, & bptr->b_s_info, + (long) bptr->rows_in_array * + (long) bptr->blocksperrow * + (long) SIZEOF(JBLOCK)); + bptr->b_s_open = TRUE; + } + bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE, + bptr->blocksperrow, bptr->rows_in_mem); + bptr->rowsperchunk = mem->last_rowsperchunk; + bptr->cur_start_row = 0; + bptr->first_undef_row = 0; + bptr->dirty = FALSE; + } + } +} + + +LOCAL(void) +do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual sample array */ +{ + size_t bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = ptr->samplesperrow * SIZEOF(JSAMPLE); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = ptr->cur_start_row + i; + rows = MIN(rows, ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + file_offset += byte_count; + } +} + + +LOCAL(void) +do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual coefficient-block array */ +{ + size_t bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = ptr->blocksperrow * SIZEOF(JBLOCK); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = ptr->cur_start_row + i; + rows = MIN(rows, ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + file_offset += byte_count; + } +} + + +METHODDEF(JSAMPARRAY) +access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual sample array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_sarray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_sarray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +METHODDEF(JBLOCKARRAY) +access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual block array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_barray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_barray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +/* + * Release all objects belonging to a specified pool. + */ + +METHODDEF(void) +free_pool (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + size_t space_freed; + + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + +#ifdef MEM_STATS + if (cinfo->err->trace_level > 1) + print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */ +#endif + + /* If freeing IMAGE pool, close any virtual arrays first */ + if (pool_id == JPOOL_IMAGE) { + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->b_s_open) { /* there may be no backing store */ + sptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info); + } + } + mem->virt_sarray_list = NULL; + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->b_s_open) { /* there may be no backing store */ + bptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info); + } + } + mem->virt_barray_list = NULL; + } + + /* Release large objects */ + lhdr_ptr = mem->large_list[pool_id]; + mem->large_list[pool_id] = NULL; + + while (lhdr_ptr != NULL) { + large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next; + space_freed = lhdr_ptr->hdr.bytes_used + + lhdr_ptr->hdr.bytes_left + + SIZEOF(large_pool_hdr); + jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed); + mem->total_space_allocated -= (long)space_freed; + lhdr_ptr = next_lhdr_ptr; + } + + /* Release small objects */ + shdr_ptr = mem->small_list[pool_id]; + mem->small_list[pool_id] = NULL; + + while (shdr_ptr != NULL) { + small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next; + space_freed = shdr_ptr->hdr.bytes_used + + shdr_ptr->hdr.bytes_left + + SIZEOF(small_pool_hdr); + jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed); + mem->total_space_allocated -= (long)space_freed; + shdr_ptr = next_shdr_ptr; + } +} + + +/* + * Close up shop entirely. + * Note that this cannot be called unless cinfo->mem is non-NULL. + */ + +METHODDEF(void) +self_destruct (j_common_ptr cinfo) +{ + int pool; + + /* Close all backing store, release all memory. + * Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + free_pool(cinfo, pool); + } + + /* Release the memory manager control block too. */ + jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr)); + cinfo->mem = NULL; /* ensures I will be called only once */ + + jpeg_mem_term(cinfo); /* system-dependent cleanup */ +} + + +/* + * Memory manager initialization. + * When this is called, only the error manager pointer is valid in cinfo! + */ + +GLOBAL(void) +jinit_memory_mgr (j_common_ptr cinfo) +{ + my_mem_ptr mem; + long max_to_use; + int pool; + size_t test_mac; + + cinfo->mem = NULL; /* for safety if init fails */ + + /* Check for configuration errors. + * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably + * doesn't reflect any real hardware alignment requirement. + * The test is a little tricky: for X>0, X and X-1 have no one-bits + * in common if and only if X is a power of 2, ie has only one one-bit. + * Some compilers may give an "unreachable code" warning here; ignore it. + */ + if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0) + ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE); + /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be + * a multiple of SIZEOF(ALIGN_TYPE). + * Again, an "unreachable code" warning may be ignored here. + * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK. + */ + test_mac = (size_t) MAX_ALLOC_CHUNK; + if ((long) test_mac != MAX_ALLOC_CHUNK || + (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) + ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); + + max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */ + + /* Attempt to allocate memory manager's control block */ + mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr)); + + if (mem == NULL) { + jpeg_mem_term(cinfo); /* system-dependent cleanup */ + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0); + } + + /* OK, fill in the method pointers */ + mem->pub.alloc_small = alloc_small; + mem->pub.alloc_large = alloc_large; + mem->pub.alloc_sarray = alloc_sarray; + mem->pub.alloc_barray = alloc_barray; +#ifdef NEED_DARRAY + mem->pub.alloc_darray = alloc_darray; +#endif + mem->pub.request_virt_sarray = request_virt_sarray; + mem->pub.request_virt_barray = request_virt_barray; + mem->pub.realize_virt_arrays = realize_virt_arrays; + mem->pub.access_virt_sarray = access_virt_sarray; + mem->pub.access_virt_barray = access_virt_barray; + mem->pub.free_pool = free_pool; + mem->pub.self_destruct = self_destruct; + + /* Make MAX_ALLOC_CHUNK accessible to other modules */ + mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK; + + /* Initialize working state */ + mem->pub.max_memory_to_use = max_to_use; + + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + mem->small_list[pool] = NULL; + mem->large_list[pool] = NULL; + } + mem->virt_sarray_list = NULL; + mem->virt_barray_list = NULL; + + mem->total_space_allocated = SIZEOF(my_memory_mgr); + + /* Declare ourselves open for business */ + cinfo->mem = & mem->pub; + + /* Check for an environment variable JPEGMEM; if found, override the + * default max_memory setting from jpeg_mem_init. Note that the + * surrounding application may again override this value. + * If your system doesn't support getenv(), define NO_GETENV to disable + * this feature. + */ +#ifndef NO_GETENV + { char * memenv; + + if ((memenv = getenv("JPEGMEM")) != NULL) { + char ch = 'x'; + + if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) { + if (ch == 'm' || ch == 'M') + max_to_use *= 1000L; + mem->pub.max_memory_to_use = max_to_use * 1000L; + } + } + } +#endif + +} diff --git a/dcmjpeg/libijg12/jmemnobs.c b/dcmjpeg/libijg12/jmemnobs.c new file mode 100644 index 00000000..248d84db --- /dev/null +++ b/dcmjpeg/libijg12/jmemnobs.c @@ -0,0 +1,109 @@ +/* + * jmemnobs.c + * + * Copyright (C) 1992-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides a really simple implementation of the system- + * dependent portion of the JPEG memory manager. This implementation + * assumes that no backing-store files are needed: all required space + * can be obtained from malloc(). + * This is very portable in the sense that it'll compile on almost anything, + * but you'd better have lots of main memory (or virtual memory) if you want + * to process big images. + * Note that the max_memory_to_use option is ignored by this implementation. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" +#include "jmemsys12.h" /* import the system-dependent declarations */ + +#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +#endif + + +/* + * Memory allocation and freeing are controlled by the regular library + * routines malloc() and free(). + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * "Large" objects are treated the same as "small" ones. + * NB: although we include FAR keywords in the routine declarations, + * this file won't actually work in 80x86 small/medium model; at least, + * you probably won't be able to process useful-size images in only 64KB. + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * This routine computes the total memory space available for allocation. + * Here we always say, "we got all you want bud!" + */ + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + return max_bytes_needed; +} + + +/* + * Backing store (temporary file) management. + * Since jpeg_mem_available always promised the moon, + * this should never be called and we can just error out. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + ERREXIT(cinfo, JERR_NO_BACKING_STORE); +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. Here, there isn't any. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + return 0; /* just set max_memory_to_use to 0 */ +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* no work */ +} diff --git a/dcmjpeg/libijg12/jmemsys12.h b/dcmjpeg/libijg12/jmemsys12.h new file mode 100644 index 00000000..0e8daca4 --- /dev/null +++ b/dcmjpeg/libijg12/jmemsys12.h @@ -0,0 +1,198 @@ +/* + * jmemsys.h + * + * Copyright (C) 1992-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file defines the interface between the system-independent + * and system-dependent portions of the JPEG memory manager. No other + * modules need include it. (The system-independent portion is jmemmgr.c; + * there are several different versions of the system-dependent portion.) + * + * This file works as-is for the system-dependent memory managers supplied + * in the IJG distribution. You may need to modify it if you write a + * custom memory manager. If system-dependent changes are needed in + * this file, the best method is to #ifdef them based on a configuration + * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR + * and USE_MAC_MEMMGR. + */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_get_small jpeg12_get_small +#define jpeg_free_small jpeg12_free_small +#define jpeg_get_large jpeg12_get_large +#define jpeg_free_large jpeg12_free_large +#define jpeg_mem_available jpeg12_mem_available +#define jpeg_open_backing_store jpeg12_open_backing_store +#define jpeg_mem_init jpeg12_mem_init +#define jpeg_mem_term jpeg12_mem_term +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* + * These two functions are used to allocate and release small chunks of + * memory. (Typically the total amount requested through jpeg_get_small is + * no more than 20K or so; this will be requested in chunks of a few K each.) + * Behavior should be the same as for the standard library functions malloc + * and free; in particular, jpeg_get_small must return NULL on failure. + * On most systems, these ARE malloc and free. jpeg_free_small is passed the + * size of the object being freed, just in case it's needed. + * On an 80x86 machine using small-data memory model, these manage near heap. + */ + +EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject)); +EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object, + size_t sizeofobject)); + +/* + * These two functions are used to allocate and release large chunks of + * memory (up to the total free space designated by jpeg_mem_available). + * The interface is the same as above, except that on an 80x86 machine, + * far pointers are used. On most other machines these are identical to + * the jpeg_get/free_small routines; but we keep them separate anyway, + * in case a different allocation strategy is desirable for large chunks. + */ + +EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo, + size_t sizeofobject)); +EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object, + size_t sizeofobject)); + +/* + * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may + * be requested in a single call to jpeg_get_large (and jpeg_get_small for that + * matter, but that case should never come into play). This macro is needed + * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. + * On those machines, we expect that jconfig.h will provide a proper value. + * On machines with 32-bit flat address spaces, any large constant may be used. + * + * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type + * size_t and will be a multiple of sizeof(align_type). + */ + +#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */ +#define MAX_ALLOC_CHUNK 1000000000L +#endif + +/* + * This routine computes the total space still available for allocation by + * jpeg_get_large. If more space than this is needed, backing store will be + * used. NOTE: any memory already allocated must not be counted. + * + * There is a minimum space requirement, corresponding to the minimum + * feasible buffer sizes; jmemmgr.c will request that much space even if + * jpeg_mem_available returns zero. The maximum space needed, enough to hold + * all working storage in memory, is also passed in case it is useful. + * Finally, the total space already allocated is passed. If no better + * method is available, cinfo->mem->max_memory_to_use - already_allocated + * is often a suitable calculation. + * + * It is OK for jpeg_mem_available to underestimate the space available + * (that'll just lead to more backing-store access than is really necessary). + * However, an overestimate will lead to failure. Hence it's wise to subtract + * a slop factor from the true available space. 5% should be enough. + * + * On machines with lots of virtual memory, any large constant may be returned. + * Conversely, zero may be returned to always use the minimum amount of memory. + */ + +EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo, + long min_bytes_needed, + long max_bytes_needed, + long already_allocated)); + + +/* + * This structure holds whatever state is needed to access a single + * backing-store object. The read/write/close method pointers are called + * by jmemmgr.c to manipulate the backing-store object; all other fields + * are private to the system-dependent backing store routines. + */ + +#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ + + +#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */ + +typedef unsigned short XMSH; /* type of extended-memory handles */ +typedef unsigned short EMSH; /* type of expanded-memory handles */ + +typedef union { + short file_handle; /* DOS file handle if it's a temp file */ + XMSH xms_handle; /* handle if it's a chunk of XMS */ + EMSH ems_handle; /* handle if it's a chunk of EMS */ +} handle_union; + +#endif /* USE_MSDOS_MEMMGR */ + +#ifdef USE_MAC_MEMMGR /* Mac-specific junk */ +#include +#endif /* USE_MAC_MEMMGR */ + + +typedef struct backing_store_struct * backing_store_ptr; + +typedef struct backing_store_struct { + /* Methods for reading/writing/closing this backing-store object */ + JMETHOD(void, read_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, write_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, close_backing_store, (j_common_ptr cinfo, + backing_store_ptr info)); + + /* Private fields for system-dependent backing-store management */ +#ifdef USE_MSDOS_MEMMGR + /* For the MS-DOS manager (jmemdos.c), we need: */ + handle_union handle; /* reference to backing-store storage object */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else +#ifdef USE_MAC_MEMMGR + /* For the Mac manager (jmemmac.c), we need: */ + short temp_file; /* file reference number to temp file */ + FSSpec tempSpec; /* the FSSpec for the temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else + /* For a typical implementation with temp files, we need: */ + FILE * temp_file; /* stdio reference to temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ +#endif +#endif +} backing_store_info; + + +/* + * Initial opening of a backing-store object. This must fill in the + * read/write/close pointers in the object. The read/write routines + * may take an error exit if the specified maximum file size is exceeded. + * (If jpeg_mem_available always returns a large value, this routine can + * just take an error exit.) + */ + +EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo, + backing_store_ptr info, + long total_bytes_needed)); + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. jpeg_mem_init will be called before anything is + * allocated (and, therefore, nothing in cinfo is of use except the error + * manager pointer). It should return a suitable default value for + * max_memory_to_use; this may subsequently be overridden by the surrounding + * application. (Note that max_memory_to_use is only important if + * jpeg_mem_available chooses to consult it ... no one else will.) + * jpeg_mem_term may assume that all requested memory has been freed and that + * all opened backing-store objects have been closed. + */ + +EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo)); diff --git a/dcmjpeg/libijg12/jmorecfg12.h b/dcmjpeg/libijg12/jmorecfg12.h new file mode 100644 index 00000000..00873e79 --- /dev/null +++ b/dcmjpeg/libijg12/jmorecfg12.h @@ -0,0 +1,407 @@ +/* + * jmorecfg.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains additional configuration options that customize the + * JPEG software for special applications or support machine-dependent + * optimizations. Most users will not need to touch this file. + */ + + +#include "dcmtk/ofstd/ofexport.h" /* for DCMTK_DECL_EXPORT */ + +#ifdef ijg12_EXPORTS +#define DCMTK_IJG12_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_IJG12_EXPORT DCMTK_DECL_IMPORT +#endif + + +/* + * Define BITS_IN_JSAMPLE as either + * 8 for 8-bit sample values (the usual setting) + * 12 for 12-bit sample values + * Only 8 and 12 are legal data precisions for lossy JPEG according to the + * JPEG standard, and the IJG code does not support anything else! + * We do not support run-time selection of data precision, sorry. + */ + +#define BITS_IN_JSAMPLE 12 /* use 8 or 12 (or 16 for lossless) */ + + +/* + * Maximum number of components (color channels) allowed in JPEG image. + * To meet the letter of the JPEG spec, set this to 255. However, darn + * few applications need more than 4 channels (maybe 5 for CMYK + alpha + * mask). We recommend 10 as a reasonable compromise; use 4 if you are + * really short on memory. (Each allowed component costs a hundred or so + * bytes of storage, whether actually used in an image or not.) + */ + +#define MAX_COMPONENTS 10 /* maximum number of image components */ + + +/* + * Basic data types. + * You may need to change these if you have a machine with unusual data + * type sizes; for example, "char" not 8 bits, "short" not 16 bits, + * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, + * but it had better be at least 16. + */ + +/* Representation of a single sample (pixel element value). + * We frequently allocate large arrays of these, so it's important to keep + * them small. But if you have memory to burn and access to char or short + * arrays is very slow on your hardware, you might want to change these. + */ + +#if BITS_IN_JSAMPLE == 8 +/* JSAMPLE should be the smallest type that will hold the values 0..255. + * You can use a signed char by having GETJSAMPLE mask it with 0xFF. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JSAMPLE; +#ifdef CHAR_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + +#define MAXJSAMPLE 255 +#define CENTERJSAMPLE 128 + +#endif /* BITS_IN_JSAMPLE == 8 */ + + +#if BITS_IN_JSAMPLE == 12 +/* JSAMPLE should be the smallest type that will hold the values 0..4095. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 4095 +#define CENTERJSAMPLE 2048 + +#endif /* BITS_IN_JSAMPLE == 12 */ + + +#if BITS_IN_JSAMPLE == 16 +/* JSAMPLE should be the smallest type that will hold the values 0..65535. + * You can use a signed short by having GETJSAMPLE mask it with 0xFFFF. + */ + +#ifdef HAVE_UNSIGNED_SHORT + +typedef unsigned short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_SHORT */ + +typedef short JSAMPLE; +#ifdef SHORT_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFFFF) +#endif /* SHORT_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_SHORT */ + +#define MAXJSAMPLE 65535 +#define CENTERJSAMPLE 32768 + +#endif /* BITS_IN_JSAMPLE == 16 */ + + +/* Representation of a DCT frequency coefficient. + * This should be a signed value of at least 16 bits; "short" is usually OK. + * Again, we allocate large arrays of these, but you can change to int + * if you have memory to burn and "short" is really slow. + */ + +typedef short JCOEF; + + +/* Representation of a spatial difference value. + * This should be a signed value of at least 16 bits; int is usually OK. + */ + +typedef int JDIFF; + + +/* Compressed datastreams are represented as arrays of JOCTET. + * These must be EXACTLY 8 bits wide, at least once they are written to + * external storage. Note that when using the stdio data source/destination + * managers, this is also the data type passed to fread/fwrite. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JOCTET; +#define GETJOCTET(value) (value) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JOCTET; +#ifdef CHAR_IS_UNSIGNED +#define GETJOCTET(value) (value) +#else +#define GETJOCTET(value) ((value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + + +/* These typedefs are used for various table entries and so forth. + * They must be at least as wide as specified; but making them too big + * won't cost a huge amount of memory, so we don't provide special + * extraction code like we did for JSAMPLE. (In other words, these + * typedefs live at a different point on the speed/space tradeoff curve.) + */ + +/* UINT8 must hold at least the values 0..255. */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char UINT8; +#else /* not HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char UINT8; +#else /* not CHAR_IS_UNSIGNED */ +typedef short UINT8; +#endif /* CHAR_IS_UNSIGNED */ +#endif /* HAVE_UNSIGNED_CHAR */ + +/* UINT16 must hold at least the values 0..65535. */ + +#ifdef HAVE_UNSIGNED_SHORT +typedef unsigned short UINT16; +#else /* not HAVE_UNSIGNED_SHORT */ +typedef unsigned int UINT16; +#endif /* HAVE_UNSIGNED_SHORT */ + +/* INT16 must hold at least the values -32768..32767. */ + +#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ +typedef short INT16; +#endif + +/* IJG_INT32 must hold at least signed 32-bit values. */ +typedef long IJG_INT32; + +/* Datatype used for image dimensions. The JPEG standard only supports + * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore + * "unsigned int" is sufficient on all machines. However, if you need to + * handle larger images and you don't mind deviating from the spec, you + * can change this datatype. + */ + +typedef unsigned int JDIMENSION; + +#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ + + +/* These macros are used in all function definitions and extern declarations. + * You could modify them if you need to change function linkage conventions; + * in particular, you'll need to do that to make the library a Windows DLL. + * Another application is to make all functions global for use with debuggers + * or code profilers that require it. + */ + +/* a function called through method pointers: */ +#define METHODDEF(type) static type +/* a function used only in its module: */ +#define LOCAL(type) static type +/* a function referenced thru EXTERNs: */ +#define GLOBAL(type) type +/* a reference to a GLOBAL function: */ +#define EXTERN(type) extern DCMTK_IJG12_EXPORT type + + +/* This macro is used to declare a "method", that is, a function pointer. + * We want to supply prototype parameters if the compiler can cope. + * Note that the arglist parameter must be parenthesized! + * Again, you can customize this if you need special linkage keywords. + */ + +#ifdef HAVE_PROTOTYPES +#define JMETHOD(type,methodname,arglist) type (*methodname) arglist +#else +#define JMETHOD(type,methodname,arglist) type (*methodname) () +#endif + + +/* Here is the pseudo-keyword for declaring pointers that must be "far" + * on 80x86 machines. Most of the specialized coding for 80x86 is handled + * by just saying "FAR *" where such a pointer is needed. In a few places + * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. + */ + +#undef FAR +#ifdef NEED_FAR_POINTERS +#define FAR far +#else +#define FAR +#endif + + +/* + * On a few systems, type boolean and/or its values FALSE, TRUE may appear + * in standard header files. Or you may have conflicts with application- + * specific header files that you want to include together with these files. + * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. + */ + +#ifndef HAVE_BOOLEAN +typedef int boolean; +#endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif + + +/* + * The remaining options affect code selection within the JPEG library, + * but they don't need to be visible to most applications using the library. + * To minimize application namespace pollution, the symbols won't be + * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. + */ + +#ifdef JPEG_INTERNALS +#define JPEG_INTERNAL_OPTIONS +#endif + +#ifdef JPEG_INTERNAL_OPTIONS + + +/* + * These defines indicate whether to include various optional functions. + * Undefining some of these symbols will produce a smaller but less capable + * library. Note that you can leave certain source files out of the + * compilation/linking process if you've #undef'd the corresponding symbols. + * (You may HAVE to do that if your compiler doesn't like null source files.) + */ + +/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ + +/* Capability options common to encoder and decoder: */ + +#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ +#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ +#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ + +/* Encoder capability options: */ + +#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */ +#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ +/* Note: if you selected 12-bit data precision, it is dangerous to turn off + * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit + * precision, so jcshuff.c normally uses entropy optimization to compute + * usable tables for higher precision. If you don't want to do optimization, + * you'll have to supply different default Huffman tables. + * The exact same statements apply for progressive and lossless JPEG: + * the default tables don't work for progressive mode or lossless mode. + * (This may get fixed, however.) + */ +#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ + +/* Decoder capability options: */ + +#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */ +#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ +#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ +#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ +#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ +#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ +#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ +#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ + +/* more capability options later, no doubt */ + + +/* + * Ordering of RGB data in scanlines passed to or from the application. + * If your application wants to deal with data in the order B,G,R, just + * change these macros. You can also deal with formats such as R,G,B,X + * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing + * the offsets will also change the order in which colormap data is organized. + * RESTRICTIONS: + * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. + * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not + * useful if you are using JPEG color spaces other than YCbCr or grayscale. + * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE + * is not 3 (they don't understand about dummy color components!). So you + * can't use color quantization if you change that value. + */ + +#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ +#define RGB_GREEN 1 /* Offset of Green */ +#define RGB_BLUE 2 /* Offset of Blue */ +#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ + + +/* Definitions for speed-related optimizations. */ + + +/* If your compiler supports inline functions, define INLINE + * as the inline keyword; otherwise define it as empty. + */ + +#ifndef INLINE +#ifdef __GNUC__ /* for instance, GNU C knows about inline */ +#define INLINE __inline__ +#endif +#ifndef INLINE +#define INLINE /* default is to define it as empty */ +#endif +#endif + + +/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying + * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER + * as short on such a machine. MULTIPLIER must be at least 16 bits wide. + */ + +#ifndef MULTIPLIER +#define MULTIPLIER int /* type for fastest integer multiply */ +#endif + + +/* FAST_FLOAT should be either float or double, whichever is done faster + * by your compiler. (Note that this type is only used in the floating point + * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) + * Typically, float is faster in ANSI C compilers, while double is faster in + * pre-ANSI compilers (because they insist on converting to double anyway). + * The code below therefore chooses float if we have ANSI-style prototypes. + */ + +#ifndef FAST_FLOAT +#ifdef HAVE_PROTOTYPES +#define FAST_FLOAT float +#else +#define FAST_FLOAT double +#endif +#endif + +#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/dcmjpeg/libijg12/jpegint12.h b/dcmjpeg/libijg12/jpegint12.h new file mode 100644 index 00000000..d47b3264 --- /dev/null +++ b/dcmjpeg/libijg12/jpegint12.h @@ -0,0 +1,373 @@ +/* + * jpegint.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides common declarations for the various JPEG modules. + * These declarations are considered internal to the JPEG library; most + * applications using the library shouldn't need to include this file. + */ + + +/* Declarations for both compression & decompression */ + +typedef enum { /* Operating modes for buffer controllers */ + JBUF_PASS_THRU, /* Plain stripwise operation */ + /* Remaining modes require a full-image buffer to have been created */ + JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ + JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ + JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ +} J_BUF_MODE; + +/* Values of global_state field (jdapi.c has some dependencies on ordering!) */ +#define CSTATE_START 100 /* after create_compress */ +#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ +#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ +#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ +#define DSTATE_START 200 /* after create_decompress */ +#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ +#define DSTATE_READY 202 /* found SOS, ready for start_decompress */ +#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ +#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ +#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ +#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ +#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ +#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ +#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ +#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ + + +/* Declarations for compression modules */ + +/* Master control module */ +struct jpeg_comp_master { + JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo)); + JMETHOD(void, pass_startup, (j_compress_ptr cinfo)); + JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean call_pass_startup; /* True if pass_startup must be called */ + boolean is_last_pass; /* True during last pass */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_c_main_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail)); +}; + +/* Compression preprocessing (downsampling input buffer control) */ +struct jpeg_c_prep_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, pre_process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, + JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail)); +}; + +/* Compression codec (compressor proper) */ +struct jpeg_c_codec { + JMETHOD(void, entropy_start_pass, (j_compress_ptr cinfo, + boolean gather_statistics)); + JMETHOD(void, entropy_finish_pass, (j_compress_ptr cinfo)); + JMETHOD(boolean, need_optimization_pass, (j_compress_ptr cinfo)); + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(boolean, compress_data, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf)); +}; + +/* Colorspace conversion */ +struct jpeg_color_converter { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, color_convert, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows)); +}; + +/* Downsampling */ +struct jpeg_downsampler { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, downsample, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, + JDIMENSION out_row_group_index)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Marker writing */ +struct jpeg_marker_writer { + JMETHOD(void, write_file_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_frame_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_scan_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo)); + JMETHOD(void, write_tables_only, (j_compress_ptr cinfo)); + /* These routines are exported to allow insertion of extra markers */ + /* Probably only COM and APPn markers should be written this way */ + JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker, + unsigned int datalen)); + JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val)); +}; + + +/* Declarations for decompression modules */ + +/* Master control module */ +struct jpeg_decomp_master { + JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ +}; + +/* Input control module */ +struct jpeg_input_controller { + JMETHOD(int, consume_input, (j_decompress_ptr cinfo)); + JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo)); + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean has_multiple_scans; /* True if file has multiple scans */ + boolean eoi_reached; /* True when EOI has been consumed */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_d_main_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Decompression codec (decompressor proper) */ +struct jpeg_d_codec { + JMETHOD(void, calc_output_dimensions, (j_decompress_ptr cinfo)); + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, consume_data, (j_decompress_ptr cinfo)); + JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, decompress_data, (j_decompress_ptr cinfo, + JSAMPIMAGE output_buf)); +}; + +/* Decompression postprocessing (color quantization buffer control) */ +struct jpeg_d_post_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, post_process_data, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Marker reading & parsing */ +struct jpeg_marker_reader { + JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo)); + /* Read markers until SOS or EOI. + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + */ + JMETHOD(int, read_markers, (j_decompress_ptr cinfo)); + /* Read a restart marker --- exported for use by entropy decoder only */ + jpeg_marker_parser_method read_restart_marker; + + /* State of marker reader --- nominally internal, but applications + * supplying COM or APPn handlers might like to know the state. + */ + boolean saw_SOI; /* found SOI? */ + boolean saw_SOF; /* found SOF? */ + int next_restart_num; /* next restart number expected (0-7) */ + unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ +}; + +/* Upsampling (note that upsampler must also call color converter) */ +struct jpeg_upsampler { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, upsample, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Colorspace conversion */ +struct jpeg_color_deconverter { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, color_convert, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows)); +}; + +/* Color quantization or color precision reduction */ +struct jpeg_color_quantizer { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan)); + JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, + int num_rows)); + JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); +}; + + +/* Miscellaneous useful macros */ + +#undef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#undef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + + +/* We assume that right shift corresponds to signed division by 2 with + * rounding towards minus infinity. This is correct for typical "arithmetic + * shift" instructions that shift in copies of the sign bit. But some + * C compilers implement >> with an unsigned shift. For these machines you + * must define RIGHT_SHIFT_IS_UNSIGNED. + * RIGHT_SHIFT provides a proper signed right shift of an IJG_INT32 quantity. + * It is only applied with constant shift counts. SHIFT_TEMPS must be + * included in the variables of any routine using RIGHT_SHIFT. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define SHIFT_TEMPS IJG_INT32 shift_temp; +#define RIGHT_SHIFT(x,shft) \ + ((shift_temp = (x)) < 0 ? \ + (shift_temp >> (shft)) | ((~((IJG_INT32) 0)) << (32-(shft))) : \ + (shift_temp >> (shft))) +#else +#define SHIFT_TEMPS +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jinit_c_codec jinit12_c_codec +#define jinit_c_diff_controller jinit12_c_diff_controller +#define jinit_lossy_c_codec jinit12_lossy_c_codec +#define jinit_lossless_c_codec jinit12_lossless_c_codec +#define jinit_compress_master jinit12_compress_master +#define jinit_c_master_control jinit12_c_master_control +#define jinit_c_main_controller jinit12_c_main_controller +#define jinit_c_prep_controller jinit12_c_prep_controller +#define jinit_c_coef_controller jinit12_c_coef_controller +#define jinit_color_converter jinit12_color_converter +#define jinit_downsampler jinit12_downsampler +#define jinit_forward_dct jinit12_forward_dct +#define jinit_shuff_encoder jinit12_shuff_encoder +#define jinit_phuff_encoder jinit12_phuff_encoder +#ifdef WITH_ARITHMETIC_PATCH +#define jinit_arith_encoder jinit12_arith_encoder +#endif +#define jinit_marker_writer jinit12_marker_writer +#define jinit_d_codec jinit12_d_codec +#define jinit_lossy_d_codec jinit12_lossy_d_codec +#define jinit_lossless_d_codec jinit12_lossless_d_codec +#define jinit_master_decompress jinit12_master_decompress +#define jinit_d_main_controller jinit12_d_main_controller +#define jinit_d_coef_controller jinit12_d_coef_controller +#define jinit_d_diff_controller jinit12_d_diff_controller +#define jinit_d_post_controller jinit12_d_post_controller +#define jinit_input_controller jinit12_input_controller +#define jinit_marker_reader jinit12_marker_reader +#define jinit_shuff_decoder jinit12_shuff_decoder +#define jinit_phuff_decoder jinit12_phuff_decoder +#ifdef WITH_ARITHMETIC_PATCH +#define jinit_arith_decoder jinit12_arith_decoder +#endif +#define jinit_lhuff_decoder jinit12_lhuff_decoder +#define jinit_undifferencer jinit12_undifferencer +#define jinit_d_scaler jinit12_d_scaler +#define jinit_inverse_dct jinit12_inverse_dct +#define jinit_upsampler jinit12_upsampler +#define jinit_color_deconverter jinit12_color_deconverter +#define jinit_1pass_quantizer jinit12_1pass_quantizer +#define jinit_2pass_quantizer jinit12_2pass_quantizer +#define jinit_merged_upsampler jinit12_merged_upsampler +#define jinit_memory_mgr jinit12_memory_mgr +#define jdiv_round_up jdiv12_round_up +#define jround_up jround12_up +#define jcopy_sample_rows jcopy12_sample_rows +#define jcopy_block_row jcopy12_block_row +#define jzero_far jzero12_far +#define jpeg_zigzag_order jpeg12_zigzag_order +#define jpeg_natural_order jpeg12_natural_order +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Compression module initialization routines */ +EXTERN(void) jinit_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_diff_controller JPP((j_compress_ptr cinfo, boolean need_full_buffer)); +EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo, + boolean transcode_only)); +EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_compressor JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); +#ifdef WITH_ARITHMETIC_PATCH +EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo)); +#endif +/* Decompression module initialization routines */ +EXTERN(void) jinit_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_diff_controller JPP((j_decompress_ptr cinfo, boolean need_full_buffer)); +EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_decompressor JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); +#ifdef WITH_ARITHMETIC_PATCH +EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo)); +#endif +EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo)); +/* Memory manager initialization */ +EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo)); + +/* Utility routines in jutils.c */ +EXTERN(long) jdiv_round_up JPP((long a, long b)); +EXTERN(long) jround_up JPP((long a, long b)); +EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols)); +EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks)); +EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero)); +/* Constant tables in jutils.c */ +#if 0 /* This table is not actually needed in v6a */ +extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ +#endif +extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ + +/* Suppress undefined-structure complaints if necessary. */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +#endif +#endif /* INCOMPLETE_TYPES_BROKEN */ diff --git a/dcmjpeg/libijg12/jpeglib12.h b/dcmjpeg/libijg12/jpeglib12.h new file mode 100644 index 00000000..040cef4e --- /dev/null +++ b/dcmjpeg/libijg12/jpeglib12.h @@ -0,0 +1,1211 @@ +/* + * jpeglib.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the application interface for the JPEG library. + * Most applications using the library need only include this file, + * and perhaps jerror.h if they want to know the exact error codes. + */ + +#ifndef JPEGLIB_H +#define JPEGLIB_H + +/* + * First we include the configuration files that record how this + * installation of the JPEG library is set up. jconfig.h can be + * generated automatically for many systems. jmorecfg.h contains + * manual configuration options that most people need not worry about. + */ + +#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ +#include "jconfig12.h" /* widely used configuration options */ +#endif +#include "jmorecfg12.h" /* seldom changed options */ + + +/* Version ID for the JPEG library. + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". + */ + +#define JPEG_LIB_VERSION 62 /* Version 6b */ + + +/* Various constants determining the sizes of things. + * All of these are specified by the JPEG standard, so don't change them + * if you want to be compatible. + */ + +#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ +#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ +#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ +#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ +#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ +#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ +#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ +/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; + * the PostScript DCT filter can emit files with many more than 10 data units + * per MCU. + * If you happen to run across such a file, you can up D_MAX_DATA_UNITS_IN_MCU + * to handle it. We even let you do this from the jconfig.h file. However, + * we strongly discourage changing C_MAX_DATA_UNITS_IN_MCU; just because Adobe + * sometimes emits noncompliant files doesn't mean you should too. + */ +#define C_MAX_DATA_UNITS_IN_MCU 10 /* compressor's limit on data units/MCU */ +#ifndef D_MAX_DATA_UNITS_IN_MCU +#define D_MAX_DATA_UNITS_IN_MCU 10 /* decompressor's limit on data units/MCU */ +#endif + + +/* Data structures for images (arrays of samples and of DCT coefficients). + * On 80x86 machines, the image arrays are too big for near pointers, + * but the pointer arrays can fit in near memory. + */ + +typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ +typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ +typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ + +typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ +typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ +typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ +typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ + +typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ + +typedef JDIFF FAR *JDIFFROW; /* pointer to one row of difference values */ +typedef JDIFFROW *JDIFFARRAY; /* ptr to some rows (a 2-D diff array) */ +typedef JDIFFARRAY *JDIFFIMAGE; /* a 3-D diff array: top index is color */ + + +/* Types for JPEG compression parameters and working tables. */ + + +/* DCT coefficient quantization tables. */ + +typedef struct { + /* This array gives the coefficient quantizers in natural array order + * (not the zigzag order in which they are stored in a JPEG DQT marker). + * CAUTION: IJG versions prior to v6a kept this array in zigzag order. + */ + UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JQUANT_TBL; + + +/* Huffman coding tables. */ + +typedef struct { + /* These two fields directly represent the contents of a JPEG DHT marker */ + UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ + /* length k bits; bits[0] is unused */ + UINT8 huffval[256]; /* The symbols, in order of incr code length */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JHUFF_TBL; + + +/* Basic info about one component (color channel). */ + +typedef struct { + /* These values are fixed over the whole image. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOF marker. */ + int component_id; /* identifier for this component (0..255) */ + int component_index; /* its index in SOF or cinfo->comp_info[] */ + int h_samp_factor; /* horizontal sampling factor (1..4) */ + int v_samp_factor; /* vertical sampling factor (1..4) */ + int quant_tbl_no; /* quantization table selector (0..3) */ + /* These values may vary between scans. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOS marker. */ + /* The decompressor output side may not use these variables. */ + int dc_tbl_no; /* DC entropy table selector (0..3) */ + int ac_tbl_no; /* AC entropy table selector (0..3) */ + + /* Remaining fields should be treated as private by applications. */ + + /* These values are computed during compression or decompression startup: */ + /* Component's size in data units. + * Any dummy data units added to complete an MCU are not counted; therefore + * these values do not depend on whether a scan is interleaved or not. + */ + JDIMENSION width_in_data_units; + JDIMENSION height_in_data_units; + /* Size of a data unit in/output by the codec (in samples). Always + * data_unit for compression. For decompression this is the size of the + * output from one data_unit, reflecting any processing performed by the + * codec. For example, in the DCT-based codec, scaling may be applied + * during the IDCT step. Values of 1,2,4,8 are likely to be supported. + * Note that different components may have different codec_data_unit sizes. + */ + int codec_data_unit; + /* The downsampled dimensions are the component's actual, unpadded number + * of samples at the main buffer (preprocessing/compression interface), thus + * downsampled_width = ceil(image_width * Hi/Hmax) + * and similarly for height. For decompression, codec-based processing is + * included (ie, IDCT scaling), so + * downsampled_width = ceil(image_width * Hi/Hmax * codec_data_unit/data_unit) + */ + JDIMENSION downsampled_width; /* actual width in samples */ + JDIMENSION downsampled_height; /* actual height in samples */ + /* This flag is used only for decompression. In cases where some of the + * components will be ignored (eg grayscale output from YCbCr image), + * we can skip most computations for the unused components. + */ + boolean component_needed; /* do we need the value of this component? */ + + /* These values are computed before starting a scan of the component. */ + /* The decompressor output side may not use these variables. */ + int MCU_width; /* number of data units per MCU, horizontally */ + int MCU_height; /* number of data units per MCU, vertically */ + int MCU_data_units; /* MCU_width * MCU_height */ + int MCU_sample_width; /* MCU width in samples, MCU_width*codec_data_unit */ + int last_col_width; /* # of non-dummy data_units across in last MCU */ + int last_row_height; /* # of non-dummy data_units down in last MCU */ + + /* Saved quantization table for component; NULL if none yet saved. + * See jdinput.c comments about the need for this information. + * This field is currently used only for decompression. + */ + JQUANT_TBL * quant_table; + + /* Private per-component storage for DCT or IDCT subsystem. */ + void * dct_table; +} jpeg_component_info; + + +/* The script for encoding a multiple-scan file is an array of these: */ + +typedef struct { + int comps_in_scan; /* number of components encoded in this scan */ + int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ + int Ss, Se; /* progressive JPEG spectral selection parms + lossless JPEG predictor select parm (Ss) */ + int Ah, Al; /* progressive JPEG successive approx. parms + lossless JPEG point transform parm (Al) */ +} jpeg_scan_info; + +/* The decompressor can save APPn and COM markers in a list of these: */ + +typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; + +struct jpeg_marker_struct { + jpeg_saved_marker_ptr next; /* next in list, or NULL */ + UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ + unsigned int original_length; /* # bytes of data in the file */ + unsigned int data_length; /* # bytes of data saved at data[] */ + JOCTET FAR * data; /* the data contained in the marker */ + /* the marker length word is not counted in data_length or original_length */ +}; + +/* Known codec processes. */ + +typedef enum { + JPROC_SEQUENTIAL, /* baseline/extended sequential DCT */ + JPROC_PROGRESSIVE, /* progressive DCT */ + JPROC_LOSSLESS /* lossless (sequential) */ +} J_CODEC_PROCESS; + +/* Known color spaces. */ + +typedef enum { + JCS_UNKNOWN, /* error/unspecified */ + JCS_GRAYSCALE, /* monochrome */ + JCS_RGB, /* red/green/blue */ + JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ + JCS_CMYK, /* C/M/Y/K */ + JCS_YCCK /* Y/Cb/Cr/K */ +} J_COLOR_SPACE; + +/* DCT/IDCT algorithm options. */ + +typedef enum { + JDCT_ISLOW, /* slow but accurate integer algorithm */ + JDCT_IFAST, /* faster, less accurate integer method */ + JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ +} J_DCT_METHOD; + +#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ +#define JDCT_DEFAULT JDCT_ISLOW +#endif +#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ +#define JDCT_FASTEST JDCT_IFAST +#endif + +/* Dithering options for decompression. */ + +typedef enum { + JDITHER_NONE, /* no dithering */ + JDITHER_ORDERED, /* simple ordered dither */ + JDITHER_FS /* Floyd-Steinberg error diffusion dither */ +} J_DITHER_MODE; + + +/* Common fields between JPEG compression and decompression master structs. */ + +#define jpeg_common_fields \ + struct jpeg_error_mgr * err; /* Error handler module */\ + struct jpeg_memory_mgr * mem; /* Memory manager module */\ + struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ + void * client_data; /* Available for use by application */\ + boolean is_decompressor; /* So common code can tell which is which */\ + int global_state /* For checking call sequence validity */ + +/* Routines that are to be used by both halves of the library are declared + * to receive a pointer to this structure. There are no actual instances of + * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. + */ +struct jpeg_common_struct { + jpeg_common_fields; /* Fields common to both master struct types */ + /* Additional fields follow in an actual jpeg_compress_struct or + * jpeg_decompress_struct. All three structs must agree on these + * initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct jpeg_common_struct * j_common_ptr; +typedef struct jpeg_compress_struct * j_compress_ptr; +typedef struct jpeg_decompress_struct * j_decompress_ptr; + + +/* Master record for a compression instance */ + +struct jpeg_compress_struct { + jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ + + /* Destination for compressed data */ + struct jpeg_destination_mgr * dest; + + /* Description of source image --- these fields must be filled in by + * outer application before starting compression. in_color_space must + * be correct before you can even call jpeg_set_defaults(). + */ + + JDIMENSION image_width; /* input image width */ + JDIMENSION image_height; /* input image height */ + int input_components; /* # of color components in input image */ + J_COLOR_SPACE in_color_space; /* colorspace of input image */ + + double input_gamma; /* image gamma of input image */ + + /* Compression parameters --- these fields must be set before calling + * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to + * initialize everything to reasonable defaults, then changing anything + * the application specifically wants to change. That way you won't get + * burnt when new parameters are added. Also note that there are several + * helper routines to simplify changing parameters. + */ + + boolean lossless; /* TRUE=lossless encoding, FALSE=lossy */ + + int data_precision; /* bits of precision in image data */ + + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + int num_scans; /* # of entries in scan_info array */ + const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ + /* The default value of scan_info is NULL, which causes a single-scan + * sequential JPEG file to be emitted. To create a multi-scan file, + * set num_scans and scan_info to point to an array of scan definitions. + */ + + boolean raw_data_in; /* TRUE=caller supplies downsampled data */ + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + int smoothing_factor; /* 1..100, or 0 for no input smoothing */ + J_DCT_METHOD dct_method; /* DCT algorithm selector */ + + /* The restart interval can be specified in absolute MCUs by setting + * restart_interval, or in MCU rows by setting restart_in_rows + * (in which case the correct restart_interval will be figured + * for each scan). + */ + unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ + int restart_in_rows; /* if > 0, MCU rows per restart interval */ + + /* Parameters controlling emission of special markers. */ + + boolean write_JFIF_header; /* should a JFIF marker be written? */ + UINT8 JFIF_major_version; /* What to write for the JFIF version number */ + UINT8 JFIF_minor_version; + /* These three values are not used by the JPEG code, merely copied */ + /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ + /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ + /* ratio is defined by X_density/Y_density even when density_unit=0. */ + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean write_Adobe_marker; /* should an Adobe marker be written? */ + + /* State variable: index of next scanline to be written to + * jpeg_write_scanlines(). Application may use this to control its + * processing loop, e.g., "while (next_scanline < image_height)". + */ + + JDIMENSION next_scanline; /* 0 .. image_height-1 */ + + /* Remaining fields are known throughout compressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during compression startup + */ + int data_unit; /* size of data unit in samples */ + J_CODEC_PROCESS process; /* encoding process of JPEG image */ + + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to codec */ + /* The codec receives data in units of MCU rows as defined for fully + * interleaved scans (whether the JPEG file is interleaved or not). + * There are v_samp_factor * data_unit sample rows of each component in an + * "iMCU" (interleaved MCU) row. + */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int data_units_in_MCU; /* # of data units per MCU */ + int MCU_membership[C_MAX_DATA_UNITS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th block in an MCU */ + + int Ss, Se, Ah, Al; /* progressive/lossless JPEG parameters for scan */ + + /* + * Links to compression subobjects (methods and private variables of modules) + */ + struct jpeg_comp_master * master; + struct jpeg_c_main_controller * main; + struct jpeg_c_prep_controller * prep; + struct jpeg_c_codec * codec; + struct jpeg_marker_writer * marker; + struct jpeg_color_converter * cconvert; + struct jpeg_downsampler * downsample; + jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ + int script_space_size; + + /* force the use of an extended sequential SOF1 marker even when a + * SOF0 marker could be used, to comply with DICOM CP 1447. + * This is only needed for 8 bits/sample. */ + boolean force_extended_sequential_marker; +}; + + +/* Master record for a decompression instance */ + +struct jpeg_decompress_struct { + jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ + + /* Source of compressed data */ + struct jpeg_source_mgr * src; + + /* Basic description of image --- filled in by jpeg_read_header(). */ + /* Application may inspect these values to decide how to process image. */ + + JDIMENSION image_width; /* nominal image width (from SOF marker) */ + JDIMENSION image_height; /* nominal image height */ + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + /* Decompression processing parameters --- these fields must be set before + * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes + * them to default values. + */ + + J_COLOR_SPACE out_color_space; /* colorspace for output */ + + unsigned int scale_num, scale_denom; /* fraction by which to scale image */ + + double output_gamma; /* image gamma wanted in output */ + + boolean buffered_image; /* TRUE=multiple output passes */ + boolean raw_data_out; /* TRUE=downsampled data wanted */ + + J_DCT_METHOD dct_method; /* IDCT algorithm selector */ + boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ + boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ + + boolean quantize_colors; /* TRUE=colormapped output wanted */ + /* the following are ignored if not quantize_colors: */ + J_DITHER_MODE dither_mode; /* type of color dithering to use */ + boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ + int desired_number_of_colors; /* max # colors to use in created colormap */ + /* these are significant only in buffered-image mode: */ + boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ + boolean enable_external_quant;/* enable future use of external colormap */ + boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ + + /* Description of actual output image that will be returned to application. + * These fields are computed by jpeg_start_decompress(). + * You can also use jpeg_calc_output_dimensions() to determine these values + * in advance of calling jpeg_start_decompress(). + */ + + JDIMENSION output_width; /* scaled image width */ + JDIMENSION output_height; /* scaled image height */ + int out_color_components; /* # of color components in out_color_space */ + int output_components; /* # of color components returned */ + /* output_components is 1 (a colormap index) when quantizing colors; + * otherwise it equals out_color_components. + */ + int rec_outbuf_height; /* min recommended height of scanline buffer */ + /* If the buffer passed to jpeg_read_scanlines() is less than this many rows + * high, space and time will be wasted due to unnecessary data copying. + * Usually rec_outbuf_height will be 1 or 2, at most 4. + */ + + /* When quantizing colors, the output colormap is described by these fields. + * The application can supply a colormap by setting colormap non-NULL before + * calling jpeg_start_decompress; otherwise a colormap is created during + * jpeg_start_decompress or jpeg_start_output. + * The map has out_color_components rows and actual_number_of_colors columns. + */ + int actual_number_of_colors; /* number of entries in use */ + JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ + + /* State variables: these variables indicate the progress of decompression. + * The application may examine these but must not modify them. + */ + + /* Row index of next scanline to be read from jpeg_read_scanlines(). + * Application may use this to control its processing loop, e.g., + * "while (output_scanline < output_height)". + */ + JDIMENSION output_scanline; /* 0 .. output_height-1 */ + + /* Current input scan number and number of iMCU rows completed in scan. + * These indicate the progress of the decompressor input side. + */ + int input_scan_number; /* Number of SOS markers seen so far */ + JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ + + /* The "output scan number" is the notional scan being displayed by the + * output side. The decompressor will not allow output scan/row number + * to get ahead of input scan/row, but it can fall arbitrarily far behind. + */ + int output_scan_number; /* Nominal scan number being displayed */ + JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ + + /* Current progression status. coef_bits[c][i] indicates the precision + * with which component c's DCT coefficient i (in zigzag order) is known. + * It is -1 when no data has yet been received, otherwise it is the point + * transform (shift) value for the most recent scan of the coefficient + * (thus, 0 at completion of the progression). + * This pointer is NULL when reading a non-progressive file. + */ + int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ + + /* Internal JPEG parameters --- the application usually need not look at + * these fields. Note that the decompressor output side may not use + * any parameters that can change between scans. + */ + + /* Quantization and Huffman tables are carried forward across input + * datastreams when processing abbreviated JPEG datastreams. + */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + /* These parameters are never carried across datastreams, since they + * are given in SOF/SOS markers or defined to be reset by SOI. + */ + + int data_precision; /* bits of precision in image data */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ + + /* These fields record data obtained from optional markers recognized by + * the JPEG library. + */ + boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ + /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ + UINT8 JFIF_major_version; /* JFIF version number */ + UINT8 JFIF_minor_version; + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ + UINT8 Adobe_transform; /* Color transform code from Adobe marker */ + + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + + /* Aside from the specific data retained from APPn markers known to the + * library, the uninterpreted contents of any or all APPn and COM markers + * can be saved in a list for examination by the application. + */ + jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ + + /* Remaining fields are known throughout decompressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during decompression startup + */ + int data_unit; /* size of data unit in samples */ + J_CODEC_PROCESS process; /* decoding process of JPEG image */ + + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + int min_codec_data_unit; /* smallest codec_data_unit of any component */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ + /* The codec's input and output progress is measured in units of "iMCU" + * (interleaved MCU) rows. These are the same as MCU rows in fully + * interleaved JPEG scans, but are used whether the scan is interleaved + * or not. We define an iMCU row as v_samp_factor data_unit rows of each + * component. Therefore, the codec output contains + * v_samp_factor*codec_data_unit sample rows of a component per iMCU row. + */ + + JSAMPLE * sample_range_limit; /* table for fast range-limiting */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + * Note that the decompressor output side must not use these fields. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int data_units_in_MCU; /* # of data _units per MCU */ + int MCU_membership[D_MAX_DATA_UNITS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th data unit in an MCU */ + + int Ss, Se, Ah, Al; /* progressive/lossless JPEG parms for scan */ + + /* This field is shared between entropy decoder and marker parser. + * It is either zero or the code of a JPEG marker that has been + * read from the data source, but has not yet been processed. + */ + int unread_marker; + + /* + * Links to decompression subobjects (methods, private variables of modules) + */ + struct jpeg_decomp_master * master; + struct jpeg_d_main_controller * main; + struct jpeg_d_codec * codec; + struct jpeg_d_post_controller * post; + struct jpeg_input_controller * inputctl; + struct jpeg_marker_reader * marker; + struct jpeg_upsampler * upsample; + struct jpeg_color_deconverter * cconvert; + struct jpeg_color_quantizer * cquantize; + + /* Options that enable or disable various workarounds */ + unsigned int workaround_options; +}; + + +/* "Object" declarations for JPEG modules that may be supplied or called + * directly by the surrounding application. + * As with all objects in the JPEG library, these structs only define the + * publicly visible methods and state variables of a module. Additional + * private fields may exist after the public ones. + */ + + +/* Error handler object */ + +struct jpeg_error_mgr { + /* Error exit handler: does not return to caller */ + JMETHOD(void, error_exit, (j_common_ptr cinfo)); + /* Conditionally emit a trace or warning message */ + JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); + /* Routine that actually outputs a trace or error message */ + JMETHOD(void, output_message, (j_common_ptr cinfo)); + /* Format a message string for the most recent JPEG error or message */ + JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); +#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ + /* Reset error state variables at start of a new image */ + JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); + + /* The message ID code and any parameters are saved here. + * A message can have one string parameter or up to 8 int parameters. + */ + int msg_code; +#define JMSG_STR_PARM_MAX 80 + union { + int i[8]; + char s[JMSG_STR_PARM_MAX]; + } msg_parm; + + /* Standard state variables for error facility */ + + int trace_level; /* max msg_level that will be displayed */ + + /* For recoverable corrupt-data errors, we emit a warning message, + * but keep going unless emit_message chooses to abort. emit_message + * should count warnings in num_warnings. The surrounding application + * can check for bad data by seeing if num_warnings is nonzero at the + * end of processing. + */ + long num_warnings; /* number of corrupt-data warnings */ + + /* These fields point to the table(s) of error message strings. + * An application can change the table pointer to switch to a different + * message list (typically, to change the language in which errors are + * reported). Some applications may wish to add additional error codes + * that will be handled by the JPEG library error mechanism; the second + * table pointer is used for this purpose. + * + * First table includes all errors generated by JPEG library itself. + * Error code 0 is reserved for a "no such error string" message. + */ + const char * const * jpeg_message_table; /* Library errors */ + int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ + /* Second table can be added by application (see cjpeg/djpeg for example). + * It contains strings numbered first_addon_message..last_addon_message. + */ + const char * const * addon_message_table; /* Non-library errors */ + int first_addon_message; /* code for first string in addon table */ + int last_addon_message; /* code for last string in addon table */ +}; + + +/* Progress monitor object */ + +struct jpeg_progress_mgr { + JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); + + long pass_counter; /* work units completed in this pass */ + long pass_limit; /* total number of work units in this pass */ + int completed_passes; /* passes completed so far */ + int total_passes; /* total number of passes expected */ +}; + + +/* Data destination object for compression */ + +struct jpeg_destination_mgr { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + + JMETHOD(void, init_destination, (j_compress_ptr cinfo)); + JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); + JMETHOD(void, term_destination, (j_compress_ptr cinfo)); +}; + + +/* Data source object for decompression */ + +struct jpeg_source_mgr { + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + + JMETHOD(void, init_source, (j_decompress_ptr cinfo)); + JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); + JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); + JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); + JMETHOD(void, term_source, (j_decompress_ptr cinfo)); +}; + + +/* Memory manager object. + * Allocates "small" objects (a few K total), "large" objects (tens of K), + * and "really big" objects (virtual arrays with backing store if needed). + * The memory manager does not allow individual objects to be freed; rather, + * each created object is assigned to a pool, and whole pools can be freed + * at once. This is faster and more convenient than remembering exactly what + * to free, especially where malloc()/free() are not too speedy. + * NB: alloc routines never return NULL. They exit to error_exit if not + * successful. + */ + +#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ +#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ +#define JPOOL_NUMPOOLS 2 + +typedef struct jvirt_sarray_control * jvirt_sarray_ptr; +typedef struct jvirt_barray_control * jvirt_barray_ptr; + + +#ifdef C_LOSSLESS_SUPPORTED +#define NEED_DARRAY +#else +#ifdef D_LOSSLESS_SUPPORTED +#define NEED_DARRAY +#endif +#endif + +struct jpeg_memory_mgr { + /* Method pointers */ + JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, + JDIMENSION numrows)); + JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, + JDIMENSION numrows)); +#ifdef NEED_DARRAY + JMETHOD(JDIFFARRAY, alloc_darray, (j_common_ptr cinfo, int pool_id, + JDIMENSION diffsperrow, + JDIMENSION numrows)); +#endif + JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION samplesperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION blocksperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); + JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, + jvirt_sarray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, + jvirt_barray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); + JMETHOD(void, self_destruct, (j_common_ptr cinfo)); + + /* Limit on memory allocation for this JPEG object. (Note that this is + * merely advisory, not a guaranteed maximum; it only affects the space + * used for virtual-array buffers.) May be changed by outer application + * after creating the JPEG object. + */ + long max_memory_to_use; + + /* Maximum allocation request accepted by alloc_large. */ + long max_alloc_chunk; +}; + + +/* Routine signature for application-supplied marker processing methods. + * Need not pass marker code since it is stored in cinfo->unread_marker. + */ +typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); + + +/* Declarations for routines called by application. + * The JPP macro hides prototype parameters from compilers that can't cope. + * Note JPP requires double parentheses. + */ + +#ifdef HAVE_PROTOTYPES +#define JPP(arglist) arglist +#else +#define JPP(arglist) () +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. + * We shorten external names to be unique in the first six letters, which + * is good enough for all known systems. + * (If your compiler itself needs names to be unique in less than 15 + * characters, you are out of luck. Get a better compiler.) + */ + +/* MAKE SURE THAT ALL FUNCTIONS DECLARED GLOBAL() ARE RE-DEFINED HERE! */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jcopy_block_row jcopy12_block_row +#define jcopy_sample_rows jcopy12_sample_rows +#define jdiv_round_up jdiv12_round_up +#define jinit_1pass_quantizer jinit12_1pass_quantizer +#define jinit_2pass_quantizer jinit12_2pass_quantizer +#define jinit_arith_decoder jinit12_arith_decoder +#define jinit_arith_encoder jinit12_arith_encoder +#define jinit_c_codec jinit12_c_codec +#define jinit_c_coef_controller jinit12_c_coef_controller +#define jinit_c_diff_controller jinit12_c_diff_controller +#define jinit_c_main_controller jinit12_c_main_controller +#define jinit_c_master_control jinit12_c_master_control +#define jinit_c_prep_controller jinit12_c_prep_controller +#define jinit_c_scaler jinit12_c_scaler +#define jinit_color_converter jinit12_color_converter +#define jinit_color_deconverter jinit12_color_deconverter +#define jinit_compress_master jinit12_compress_master +#define jinit_d_codec jinit12_d_codec +#define jinit_d_coef_controller jinit12_d_coef_controller +#define jinit_d_diff_controller jinit12_d_diff_controller +#define jinit_d_main_controller jinit12_d_main_controller +#define jinit_d_post_controller jinit12_d_post_controller +#define jinit_d_post_controller jinit12_d_post_controller +#define jinit_d_scaler jinit12_d_scaler +#define jinit_differencer jinit12_differencer +#define jinit_downsampler jinit12_downsampler +#define jinit_forward_dct jinit12_forward_dct +#define jinit_input_controller jinit12_input_controller +#define jinit_inverse_dct jinit12_inverse_dct +#define jinit_lhuff_decoder jinit12_lhuff_decoder +#define jinit_lhuff_encoder jinit12_lhuff_encoder +#define jinit_lossless_c_codec jinit12_lossless_c_codec +#define jinit_lossless_d_codec jinit12_lossless_d_codec +#define jinit_lossy_c_codec jinit12_lossy_c_codec +#define jinit_lossy_d_codec jinit12_lossy_d_codec +#define jinit_marker_reader jinit12_marker_reader +#define jinit_marker_writer jinit12_marker_writer +#define jinit_master_decompress jinit12_master_decompress +#define jinit_memory_mgr jinit12_memory_mgr +#define jinit_merged_upsampler jinit12_merged_upsampler +#define jinit_phuff_decoder jinit12_phuff_decoder +#define jinit_phuff_encoder jinit12_phuff_encoder +#define jinit_shuff_decoder jinit12_shuff_decoder +#define jinit_shuff_encoder jinit12_shuff_encoder +#define jinit_undifferencer jinit12_undifferencer +#define jinit_upsampler jinit12_upsampler +#define jpeg_CreateCompress jpeg12_CreateCompress +#define jpeg_CreateDecompress jpeg12_CreateDecompress +#define jpeg_abort jpeg12_abort +#define jpeg_abort_compress jpeg12_abort_compress +#define jpeg_abort_decompress jpeg12_abort_decompress +#define jpeg_add_quant_table jpeg12_add_quant_table +#define jpeg_alloc_huff_table jpeg12_alloc_huff_table +#define jpeg_alloc_quant_table jpeg12_alloc_quant_table +#define jpeg_calc_output_dimensions jpeg12_calc_output_dimensions +#define jpeg_consume_input jpeg12_consume_input +#define jpeg_copy_critical_parameters jpeg12_copy_critical_parameters +#define jpeg_default_colorspace jpeg12_default_colorspace +#define jpeg_destroy jpeg12_destroy +#define jpeg_destroy_compress jpeg12_destroy_compress +#define jpeg_destroy_decompress jpeg12_destroy_decompress +#define jpeg_fdct_float jpeg12_fdct_float +#define jpeg_fdct_ifast jpeg12_fdct_ifast +#define jpeg_fdct_islow jpeg12_fdct_islow +#define jpeg_fill_bit_buffer jpeg12_fill_bit_buffer +#define jpeg_finish_compress jpeg12_finish_compress +#define jpeg_finish_decompress jpeg12_finish_decompress +#define jpeg_finish_output jpeg12_finish_output +#define jpeg_free_large jpeg12_free_large +#define jpeg_free_small jpeg12_free_small +#define jpeg_gen_optimal_table jpeg12_gen_optimal_table +#define jpeg_get_large jpeg12_get_large +#define jpeg_get_small jpeg12_get_small +#define jpeg_has_multiple_scans jpeg12_has_multiple_scans +#define jpeg_huff_decode jpeg12_huff_decode +#define jpeg_idct_1x1 jpeg12_idct_1x1 +#define jpeg_idct_2x2 jpeg12_idct_2x2 +#define jpeg_idct_4x4 jpeg12_idct_4x4 +#define jpeg_idct_float jpeg12_idct_float +#define jpeg_idct_ifast jpeg12_idct_ifast +#define jpeg_idct_islow jpeg12_idct_islow +#define jpeg_input_complete jpeg12_input_complete +#define jpeg_make_c_derived_tbl jpeg12_make_c_derived_tbl +#define jpeg_make_d_derived_tbl jpeg12_make_d_derived_tbl +#define jpeg_mem_available jpeg12_mem_available +#define jpeg_mem_init jpeg12_mem_init +#define jpeg_mem_term jpeg12_mem_term +#define jpeg_new_colormap jpeg12_new_colormap +#define jpeg_open_backing_store jpeg12_open_backing_store +#define jpeg_quality_scaling jpeg12_quality_scaling +#define jpeg_read_coefficients jpeg12_read_coefficients +#define jpeg_read_header jpeg12_read_header +#define jpeg_read_raw_data jpeg12_read_raw_data +#define jpeg_read_scanlines jpeg12_read_scanlines +#define jpeg_resync_to_restart jpeg12_resync_to_restart +#define jpeg_save_markers jpeg12_save_markers +#define jpeg_set_colorspace jpeg12_set_colorspace +#define jpeg_set_defaults jpeg12_set_defaults +#define jpeg_set_linear_quality jpeg12_set_linear_quality +#define jpeg_set_marker_processor jpeg12_set_marker_processor +#define jpeg_set_quality jpeg12_set_quality +#define jpeg_simple_lossless jpeg12_simple_lossless +#define jpeg_simple_progression jpeg12_simple_progression +#define jpeg_start_compress jpeg12_start_compress +#define jpeg_start_decompress jpeg12_start_decompress +#define jpeg_start_output jpeg12_start_output +#define jpeg_std_error jpeg12_std_error +#define jpeg_stdio_dest jpeg12_stdio_dest +#define jpeg_stdio_src jpeg12_stdio_src +#define jpeg_suppress_tables jpeg12_suppress_tables +#define jpeg_write_coefficients jpeg12_write_coefficients +#define jpeg_write_m_byte jpeg12_write_m_byte +#define jpeg_write_m_header jpeg12_write_m_header +#define jpeg_write_marker jpeg12_write_marker +#define jpeg_write_raw_data jpeg12_write_raw_data +#define jpeg_write_scanlines jpeg12_write_scanlines +#define jpeg_write_tables jpeg12_write_tables +#define jround_up jround12_up +#define jzero_far jzero12_far +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Default error-management setup */ +EXTERN(struct jpeg_error_mgr *) jpeg_std_error + JPP((struct jpeg_error_mgr * err)); + +/* Initialization of JPEG compression objects. + * jpeg_create_compress() and jpeg_create_decompress() are the exported + * names that applications should call. These expand to calls on + * jpeg_CreateCompress and jpeg_CreateDecompress with additional information + * passed for version mismatch checking. + * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. + */ +#define jpeg_create_compress(cinfo) \ + jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_compress_struct)) +#define jpeg_create_decompress(cinfo) \ + jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_decompress_struct)) +EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, + int version, size_t structsize)); +EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, + int version, size_t structsize)); +/* Destruction of JPEG compression objects */ +EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); + +/* Standard data source and destination managers: stdio streams. */ +/* Caller is responsible for opening the file before and closing after. */ +EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); +EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); + +/* Default parameter setup for compression */ +EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); +/* Compression parameter setup aids */ +EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, + J_COLOR_SPACE colorspace)); +EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, + boolean force_baseline)); +EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, + int scale_factor, + boolean force_baseline)); +EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, + boolean force_baseline)); +EXTERN(int) jpeg_quality_scaling JPP((int quality)); +EXTERN(void) jpeg_simple_lossless JPP((j_compress_ptr cinfo, + int predictor, int point_transform)); +EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, + boolean suppress)); +EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); +EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); + +/* Main entry points for compression */ +EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, + boolean write_all_tables)); +EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION num_lines)); +EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); + +/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION num_lines)); + +/* Write a special marker. See libjpeg.doc concerning safe usage. */ +EXTERN(void) jpeg_write_marker + JPP((j_compress_ptr cinfo, int marker, + const JOCTET * dataptr, unsigned int datalen)); +/* Same, but piecemeal. */ +EXTERN(void) jpeg_write_m_header + JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); +EXTERN(void) jpeg_write_m_byte + JPP((j_compress_ptr cinfo, int val)); + +/* Alternate compression function: just write an abbreviated table file */ +EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); + +/* Decompression startup: read start of JPEG datastream to see what's there */ +EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, + boolean require_image)); +/* Return value is one of: */ +#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ +#define JPEG_HEADER_OK 1 /* Found valid image datastream */ +#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ +/* If you pass require_image = TRUE (normal case), you need not check for + * a TABLES_ONLY return code; an abbreviated file will cause an error exit. + * JPEG_SUSPENDED is only possible if you use a data source module that can + * give a suspension return (the stdio source module doesn't). + */ + +/* Main entry points for decompression */ +EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION max_lines)); +EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); + +/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION max_lines)); + +/* Additional entry points for buffered-image mode. */ +EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, + int scan_number)); +EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); +EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); +/* Return value is one of: */ +/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ +#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ +#define JPEG_REACHED_EOI 2 /* Reached end of image */ +#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ +#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ + +/* Precalculate output dimensions for current decompression parameters. */ +EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); + +/* Control saving of COM and APPn markers into marker_list. */ +EXTERN(void) jpeg_save_markers + JPP((j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit)); + +/* Install a special processing method for COM or APPn markers. */ +EXTERN(void) jpeg_set_marker_processor + JPP((j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine)); + +/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ +EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays)); +EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, + j_compress_ptr dstinfo)); + +/* If you choose to abort compression or decompression before completing + * jpeg_finish_(de)compress, then you need to clean up to release memory, + * temporary files, etc. You can just call jpeg_destroy_(de)compress + * if you're done with the JPEG object, but if you want to clean it up and + * reuse it, call this: + */ +EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); + +/* Generic versions of jpeg_abort and jpeg_destroy that work on either + * flavor of JPEG object. These may be more convenient in some places. + */ +EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); + +/* Default restart-marker-resync procedure for use by data source modules */ +EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, + int desired)); + + +/* These marker codes are exported since applications and data source modules + * are likely to want to use them. + */ + +#define JPEG_RST0 0xD0 /* RST0 marker code */ +#define JPEG_EOI 0xD9 /* EOI marker code */ +#define JPEG_APP0 0xE0 /* APP0 marker code */ +#define JPEG_COM 0xFE /* COM marker code */ + + +/* If we have a brain-damaged compiler that emits warnings (or worse, errors) + * for structure definitions that are never filled in, keep it quiet by + * supplying dummy definitions for the various substructures. + */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +struct jpeg_comp_master { long dummy; }; +struct jpeg_c_main_controller { long dummy; }; +struct jpeg_c_prep_controller { long dummy; }; +struct jpeg_c_coef_controller { long dummy; }; +struct jpeg_marker_writer { long dummy; }; +struct jpeg_color_converter { long dummy; }; +struct jpeg_downsampler { long dummy; }; +struct jpeg_forward_dct { long dummy; }; +struct jpeg_entropy_encoder { long dummy; }; +struct jpeg_decomp_master { long dummy; }; +struct jpeg_d_main_controller { long dummy; }; +struct jpeg_d_coef_controller { long dummy; }; +struct jpeg_d_post_controller { long dummy; }; +struct jpeg_input_controller { long dummy; }; +struct jpeg_marker_reader { long dummy; }; +struct jpeg_entropy_decoder { long dummy; }; +struct jpeg_inverse_dct { long dummy; }; +struct jpeg_upsampler { long dummy; }; +struct jpeg_color_deconverter { long dummy; }; +struct jpeg_color_quantizer { long dummy; }; +#endif /* JPEG_INTERNALS */ +#endif /* INCOMPLETE_TYPES_BROKEN */ + + +/* + * The JPEG library modules define JPEG_INTERNALS before including this file. + * The internal structure declarations are read only when that is true. + * Applications using the library should not include jpegint.h, but may wish + * to include jerror.h. + */ + +#ifdef JPEG_INTERNALS +#include "jpegint12.h" /* fetch private declarations */ +#include "jerror12.h" /* fetch error codes too */ +#endif + +#endif /* JPEGLIB_H */ diff --git a/dcmjpeg/libijg12/jquant1.c b/dcmjpeg/libijg12/jquant1.c new file mode 100644 index 00000000..e3433473 --- /dev/null +++ b/dcmjpeg/libijg12/jquant1.c @@ -0,0 +1,856 @@ +/* + * jquant1.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 1-pass color quantization (color mapping) routines. + * These routines provide mapping to a fixed color map using equally spaced + * color values. Optional Floyd-Steinberg or ordered dithering is available. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + +#ifdef QUANT_1PASS_SUPPORTED + + +/* + * The main purpose of 1-pass quantization is to provide a fast, if not very + * high quality, colormapped output capability. A 2-pass quantizer usually + * gives better visual quality; however, for quantized grayscale output this + * quantizer is perfectly adequate. Dithering is highly recommended with this + * quantizer, though you can turn it off if you really want to. + * + * In 1-pass quantization the colormap must be chosen in advance of seeing the + * image. We use a map consisting of all combinations of Ncolors[i] color + * values for the i'th component. The Ncolors[] values are chosen so that + * their product, the total number of colors, is no more than that requested. + * (In most cases, the product will be somewhat less.) + * + * Since the colormap is orthogonal, the representative value for each color + * component can be determined without considering the other components; + * then these indexes can be combined into a colormap index by a standard + * N-dimensional-array-subscript calculation. Most of the arithmetic involved + * can be precalculated and stored in the lookup table colorindex[]. + * colorindex[i][j] maps pixel value j in component i to the nearest + * representative value (grid plane) for that component; this index is + * multiplied by the array stride for component i, so that the + * index of the colormap entry closest to a given pixel value is just + * sum( colorindex[component-number][pixel-component-value] ) + * Aside from being fast, this scheme allows for variable spacing between + * representative values with no additional lookup cost. + * + * If gamma correction has been applied in color conversion, it might be wise + * to adjust the color grid spacing so that the representative colors are + * equidistant in linear space. At this writing, gamma correction is not + * implemented by jdcolor, so nothing is done here. + */ + + +/* Declarations for ordered dithering. + * + * We use a standard 16x16 ordered dither array. The basic concept of ordered + * dithering is described in many references, for instance Dale Schumacher's + * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991). + * In place of Schumacher's comparisons against a "threshold" value, we add a + * "dither" value to the input pixel and then round the result to the nearest + * output value. The dither value is equivalent to (0.5 - threshold) times + * the distance between output values. For ordered dithering, we assume that + * the output colors are equally spaced; if not, results will probably be + * worse, since the dither may be too much or too little at a given point. + * + * The normal calculation would be to form pixel value + dither, range-limit + * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual. + * We can skip the separate range-limiting step by extending the colorindex + * table in both directions. + */ + +#define ODITHER_SIZE 16 /* dimension of dither matrix */ +/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */ +#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */ +#define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */ + +typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]; +typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE]; + +static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { + /* Bayer's order-4 dither array. Generated by the code given in + * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I. + * The values in this array must range from 0 to ODITHER_CELLS-1. + */ + { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }, + { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 }, + { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 }, + { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 }, + { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 }, + { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 }, + { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 }, + { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 }, + { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 }, + { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 }, + { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 }, + { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 }, + { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 }, + { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 }, + { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 }, + { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 } +}; + + +/* Declarations for Floyd-Steinberg dithering. + * + * Errors are accumulated into the array fserrors[], at a resolution of + * 1/16th of a pixel count. The error at a given pixel is propagated + * to its not-yet-processed neighbors using the standard F-S fractions, + * ... (here) 7/16 + * 3/16 5/16 1/16 + * We work left-to-right on even rows, right-to-left on odd rows. + * + * We can get away with a single array (holding one row's worth of errors) + * by using it to store the current row's errors at pixel columns not yet + * processed, but the next row's errors at columns already processed. We + * need only a few extra variables to hold the errors immediately around the + * current column. (If we are lucky, those variables are in registers, but + * even if not, they're probably cheaper to access than array elements are.) + * + * The fserrors[] array is indexed [component#][position]. + * We provide (#columns + 2) entries per component; the extra entry at each + * end saves us from special-casing the first and last pixels. + * + * Note: on a wide image, we might not have enough room in a PC's near data + * segment to hold the error array; so it is allocated with alloc_large. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef INT16 FSERROR; /* 16 bits should be enough */ +typedef int LOCFSERROR; /* use 'int' for calculation temps */ +#else +typedef IJG_INT32 FSERROR; /* may need more than 16 bits */ +typedef IJG_INT32 LOCFSERROR; /* be sure calculation temps are big enough */ +#endif + +typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */ + + +/* Private subobject */ + +#define MAX_Q_COMPS 4 /* max components I can handle */ + +typedef struct { + struct jpeg_color_quantizer pub; /* public fields */ + + /* Initially allocated colormap is saved here */ + JSAMPARRAY sv_colormap; /* The color map as a 2-D pixel array */ + int sv_actual; /* number of entries in use */ + + JSAMPARRAY colorindex; /* Precomputed mapping for speed */ + /* colorindex[i][j] = index of color closest to pixel value j in component i, + * premultiplied as described above. Since colormap indexes must fit into + * JSAMPLEs, the entries of this array will too. + */ + boolean is_padded; /* is the colorindex padded for odither? */ + + int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */ + + /* Variables for ordered dithering */ + int row_index; /* cur row's vertical index in dither matrix */ + ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */ + + /* Variables for Floyd-Steinberg dithering */ + FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ + boolean on_odd_row; /* flag to remember which row we are on */ +} my_cquantizer; + +typedef my_cquantizer * my_cquantize_ptr; + + +/* + * Policy-making subroutines for create_colormap and create_colorindex. + * These routines determine the colormap to be used. The rest of the module + * only assumes that the colormap is orthogonal. + * + * * select_ncolors decides how to divvy up the available colors + * among the components. + * * output_value defines the set of representative values for a component. + * * largest_input_value defines the mapping from input values to + * representative values for a component. + * Note that the latter two routines may impose different policies for + * different components, though this is not currently done. + */ + + +LOCAL(int) +select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) +/* Determine allocation of desired colors to components, */ +/* and fill in Ncolors[] array to indicate choice. */ +/* Return value is total number of colors (product of Ncolors[] values). */ +{ + int nc = cinfo->out_color_components; /* number of color components */ + int max_colors = cinfo->desired_number_of_colors; + int total_colors, iroot, i, j; + boolean changed; + long temp; + static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }; + + /* We can allocate at least the nc'th root of max_colors per component. */ + /* Compute floor(nc'th root of max_colors). */ + iroot = 1; + do { + iroot++; + temp = iroot; /* set temp = iroot ** nc */ + for (i = 1; i < nc; i++) + temp *= iroot; + } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */ + iroot--; /* now iroot = floor(root) */ + + /* Must have at least 2 color values per component */ + if (iroot < 2) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp); + + /* Initialize to iroot color values for each component */ + total_colors = 1; + for (i = 0; i < nc; i++) { + Ncolors[i] = iroot; + total_colors *= iroot; + } + /* We may be able to increment the count for one or more components without + * exceeding max_colors, though we know not all can be incremented. + * Sometimes, the first component can be incremented more than once! + * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.) + * In RGB colorspace, try to increment G first, then R, then B. + */ + do { + changed = FALSE; + for (i = 0; i < nc; i++) { + j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); + /* calculate new total_colors if Ncolors[j] is incremented */ + temp = total_colors / Ncolors[j]; + temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */ + if (temp > (long) max_colors) + break; /* won't fit, done with this pass */ + Ncolors[j]++; /* OK, apply the increment */ + total_colors = (int) temp; + changed = TRUE; + } + } while (changed); + + return total_colors; +} + + +LOCAL(int) +output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return j'th output value, where j will range from 0 to maxj */ +/* The output values must fall in 0..MAXJSAMPLE in increasing order */ +{ + /* We always provide values 0 and MAXJSAMPLE for each component; + * any additional values are equally spaced between these limits. + * (Forcing the upper and lower values to the limits ensures that + * dithering can't produce a color outside the selected gamut.) + */ + return (int) (((IJG_INT32) j * MAXJSAMPLE + maxj/2) / maxj); +} + + +LOCAL(int) +largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return largest input value that should map to j'th output value */ +/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ +{ + /* Breakpoints are halfway between values returned by output_value */ + return (int) (((IJG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); +} + + +/* + * Create the colormap. + */ + +LOCAL(void) +create_colormap (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colormap; /* Created colormap */ + int total_colors; /* Number of distinct output colors */ + int i,j,k, nci, blksize, blkdist, ptr, val; + + /* Select number of colors for each component */ + total_colors = select_ncolors(cinfo, cquantize->Ncolors); + + /* Report selected color counts */ + if (cinfo->out_color_components == 3) + TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS, + total_colors, cquantize->Ncolors[0], + cquantize->Ncolors[1], cquantize->Ncolors[2]); + else + TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors); + + /* Allocate and fill in the colormap. */ + /* The colors are ordered in the map in standard row-major order, */ + /* i.e. rightmost (highest-indexed) color changes most rapidly. */ + + colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + /* blkdist is distance between groups of identical entries for a component */ + blkdist = total_colors; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colormap entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blkdist / nci; + for (j = 0; j < nci; j++) { + /* Compute j'th output value (out of nci) for component */ + val = output_value(cinfo, i, j, nci-1); + /* Fill in all colormap entries that have this value of this component */ + for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) { + /* fill in blksize entries beginning at ptr */ + for (k = 0; k < blksize; k++) + colormap[i][ptr+k] = (JSAMPLE) val; + } + } + blkdist = blksize; /* blksize of this color is blkdist of next */ + } + + /* Save the colormap in private storage, + * where it will survive color quantization mode changes. + */ + cquantize->sv_colormap = colormap; + cquantize->sv_actual = total_colors; +} + + +/* + * Create the color index table. + */ + +LOCAL(void) +create_colorindex (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPROW indexptr; + int i,j,k, nci, blksize, val, pad; + + /* For ordered dither, we pad the color index tables by MAXJSAMPLE in + * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE). + * This is not necessary in the other dithering modes. However, we + * flag whether it was done in case user changes dithering mode. + */ + if (cinfo->dither_mode == JDITHER_ORDERED) { + pad = MAXJSAMPLE*2; + cquantize->is_padded = TRUE; + } else { + pad = 0; + cquantize->is_padded = FALSE; + } + + cquantize->colorindex = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (MAXJSAMPLE+1 + pad), + (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + blksize = cquantize->sv_actual; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colorindex entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blksize / nci; + + /* adjust colorindex pointers to provide padding at negative indexes. */ + if (pad) + cquantize->colorindex[i] += MAXJSAMPLE; + + /* in loop, val = index of current output value, */ + /* and k = largest j that maps to current val */ + indexptr = cquantize->colorindex[i]; + val = 0; + k = largest_input_value(cinfo, i, 0, nci-1); + for (j = 0; j <= MAXJSAMPLE; j++) { + while (j > k) /* advance val if past boundary */ + k = largest_input_value(cinfo, i, ++val, nci-1); + /* premultiply so that no multiplication needed in main processing */ + indexptr[j] = (JSAMPLE) (val * blksize); + } + /* Pad at both ends if necessary */ + if (pad) + for (j = 1; j <= MAXJSAMPLE; j++) { + indexptr[-j] = indexptr[0]; + indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE]; + } + } +} + + +/* + * Create an ordered-dither array for a component having ncolors + * distinct output values. + */ + +LOCAL(ODITHER_MATRIX_PTR) +make_odither_array (j_decompress_ptr cinfo, int ncolors) +{ + ODITHER_MATRIX_PTR odither; + int j,k; + IJG_INT32 num,den; + + odither = (ODITHER_MATRIX_PTR) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(ODITHER_MATRIX)); + /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1). + * Hence the dither value for the matrix cell with fill order f + * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1). + * On 16-bit-int machine, be careful to avoid overflow. + */ + den = 2 * ODITHER_CELLS * ((IJG_INT32) (ncolors - 1)); + for (j = 0; j < ODITHER_SIZE; j++) { + for (k = 0; k < ODITHER_SIZE; k++) { + num = ((IJG_INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) + * MAXJSAMPLE; + /* Ensure round towards zero despite C's lack of consistency + * about rounding negative values in integer division... + */ + odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den); + } + } + return odither; +} + + +/* + * Create the ordered-dither tables. + * Components having the same number of representative colors may + * share a dither table. + */ + +LOCAL(void) +create_odither_tables (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + ODITHER_MATRIX_PTR odither; + int i, j, nci; + + for (i = 0; i < cinfo->out_color_components; i++) { + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + odither = NULL; /* search for matching prior component */ + for (j = 0; j < i; j++) { + if (nci == cquantize->Ncolors[j]) { + odither = cquantize->odither[j]; + break; + } + } + if (odither == NULL) /* need a new table? */ + odither = make_odither_array(cinfo, nci); + cquantize->odither[i] = odither; + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colorindex = cquantize->colorindex; + register int pixcode, ci; + register JSAMPROW ptrin, ptrout; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + register int nc = cinfo->out_color_components; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = 0; + for (ci = 0; ci < nc; ci++) { + pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]); + } + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW ptrin, ptrout; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]); + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + int * dither; /* points to active row of dither matrix */ + int row_index, col_index; /* current indexes into dither matrix */ + int nc = cinfo->out_color_components; + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + jzero_far((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + row_index = cquantize->row_index; + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + colorindex_ci = cquantize->colorindex[ci]; + dither = cquantize->odither[ci][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE, + * select output value, accumulate into output code for this pixel. + * Range-limiting need not be done explicitly, as we have extended + * the colorindex table to produce the right answers for out-of-range + * inputs. The maximum dither is +- MAXJSAMPLE; this sets the + * required amount of padding. + */ + *output_ptr = (JSAMPLE)(*output_ptr + colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]]); + input_ptr += nc; + output_ptr++; + col_index = (col_index + 1) & ODITHER_MASK; + } + } + /* Advance row index for next row */ + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int * dither0; /* points to active row of dither matrix */ + int * dither1; + int * dither2; + int row_index, col_index; /* current indexes into dither matrix */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + row_index = cquantize->row_index; + input_ptr = input_buf[row]; + output_ptr = output_buf[row]; + dither0 = cquantize->odither[0][row_index]; + dither1 = cquantize->odither[1][row_index]; + dither2 = cquantize->odither[2][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + + dither0[col_index]]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + + dither1[col_index]]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + + dither2[col_index]]); + *output_ptr++ = (JSAMPLE) pixcode; + col_index = (col_index + 1) & ODITHER_MASK; + } + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register LOCFSERROR cur; /* current error or pixel value */ + LOCFSERROR belowerr; /* error for pixel below cur */ + LOCFSERROR bpreverr; /* error for below/prev col */ + LOCFSERROR bnexterr; /* error for below/next col */ + LOCFSERROR delta; + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + JSAMPROW colormap_ci; + int pixcode; + int nc = cinfo->out_color_components; + int dir; /* 1 for left-to-right, -1 for right-to-left */ + int dirnc; /* dir * nc */ + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + jzero_far((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + input_ptr += (width-1) * (JDIMENSION)nc; /* so point to rightmost pixel */ + output_ptr += width-1; + dir = -1; + dirnc = -nc; + errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */ + } else { + /* work left to right in this row */ + dir = 1; + dirnc = nc; + errorptr = cquantize->fserrors[ci]; /* => entry before first column */ + } + colorindex_ci = cquantize->colorindex[ci]; + colormap_ci = cquantize->sv_colormap[ci]; + /* Preset error values: no error propagated to first pixel from left */ + cur = 0; + /* and no error propagated to row below yet */ + belowerr = bpreverr = 0; + + for (col = width; col > 0; col--) { + /* cur holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4); + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE; this sets the required size + * of the range_limit array. + */ + cur += GETJSAMPLE(*input_ptr); + cur = GETJSAMPLE(range_limit[cur]); + /* Select output value, accumulate into output code for this pixel */ + pixcode = GETJSAMPLE(colorindex_ci[cur]); + *output_ptr = (JSAMPLE)(*output_ptr + pixcode); + /* Compute actual representation error at this pixel */ + /* Note: we can do this even though we don't have the final */ + /* pixel code, because the colormap is orthogonal. */ + cur -= GETJSAMPLE(colormap_ci[pixcode]); + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + bnexterr = cur; + delta = cur * 2; + cur += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr + cur); + cur += delta; /* form error * 5 */ + bpreverr = belowerr + cur; + belowerr = bnexterr; + cur += delta; /* form error * 7 */ + /* At this point cur contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + input_ptr += dirnc; /* advance input ptr to next column */ + output_ptr += dir; /* advance output ptr to next column */ + errorptr += dir; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error value into the + * final fserrors[] entry. Note we need not unload belowerr because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */ + } + cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE); + } +} + + +/* + * Allocate workspace for Floyd-Steinberg errors. + */ + +LOCAL(void) +alloc_fs_workspace (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) { + cquantize->fserrors[i] = (FSERRPTR) + (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + } +} + + +/* + * Initialize for one-pass color quantization. + */ + +METHODDEF(void) +start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + /* Install my colormap. */ + cinfo->colormap = cquantize->sv_colormap; + cinfo->actual_number_of_colors = cquantize->sv_actual; + + /* Initialize for desired dithering mode. */ + switch (cinfo->dither_mode) { + case JDITHER_NONE: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = color_quantize3; + else + cquantize->pub.color_quantize = color_quantize; + break; + case JDITHER_ORDERED: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = quantize3_ord_dither; + else + cquantize->pub.color_quantize = quantize_ord_dither; + cquantize->row_index = 0; /* initialize state for ordered dither */ + /* If user changed to ordered dither from another mode, + * we must recreate the color index table with padding. + * This will cost extra space, but probably isn't very likely. + */ + if (! cquantize->is_padded) + create_colorindex(cinfo); + /* Create ordered-dither tables if we didn't already. */ + if (cquantize->odither[0] == NULL) + create_odither_tables(cinfo); + break; + case JDITHER_FS: + cquantize->pub.color_quantize = quantize_fs_dither; + cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */ + /* Allocate Floyd-Steinberg workspace if didn't already. */ + if (cquantize->fserrors[0] == NULL) + alloc_fs_workspace(cinfo); + /* Initialize the propagated errors to zero. */ + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) + jzero_far((void FAR *) cquantize->fserrors[i], arraysize); + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } +} + + +/* + * Finish up at the end of the pass. + */ + +METHODDEF(void) +finish_pass_1_quant (j_decompress_ptr cinfo) +{ + /* no work in 1-pass case */ +} + + +/* + * Switch to a new external colormap between output passes. + * Shouldn't get to this module! + */ + +METHODDEF(void) +new_color_map_1_quant (j_decompress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + + +/* + * Module initialization routine for 1-pass color quantization. + */ + +GLOBAL(void) +jinit_1pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_1_quant; + cquantize->pub.finish_pass = finish_pass_1_quant; + cquantize->pub.new_color_map = new_color_map_1_quant; + cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */ + cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */ + + /* Make sure my internal arrays won't overflow */ + if (cinfo->out_color_components > MAX_Q_COMPS) + ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1)) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1); + + /* Create the colormap and color index table. */ + create_colormap(cinfo); + create_colorindex(cinfo); + + /* Allocate Floyd-Steinberg workspace now if requested. + * We do this now since it is FAR storage and may affect the memory + * manager's space calculations. If the user changes to FS dither + * mode in a later pass, we will allocate the space then, and will + * possibly overrun the max_memory_to_use setting. + */ + if (cinfo->dither_mode == JDITHER_FS) + alloc_fs_workspace(cinfo); +} + +#endif /* QUANT_1PASS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jquant2.c b/dcmjpeg/libijg12/jquant2.c new file mode 100644 index 00000000..761f518f --- /dev/null +++ b/dcmjpeg/libijg12/jquant2.c @@ -0,0 +1,1310 @@ +/* + * jquant2.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 2-pass color quantization (color mapping) routines. + * These routines provide selection of a custom color map for an image, + * followed by mapping of the image to that color map, with optional + * Floyd-Steinberg dithering. + * It is also possible to use just the second pass to map to an arbitrary + * externally-given color map. + * + * Note: ordered dithering is not supported, since there isn't any fast + * way to compute intercolor distances; it's unclear that ordered dither's + * fundamental assumptions even hold with an irregularly spaced color map. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + +#ifdef QUANT_2PASS_SUPPORTED + + +/* + * This module implements the well-known Heckbert paradigm for color + * quantization. Most of the ideas used here can be traced back to + * Heckbert's seminal paper + * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", + * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. + * + * In the first pass over the image, we accumulate a histogram showing the + * usage count of each possible color. To keep the histogram to a reasonable + * size, we reduce the precision of the input; typical practice is to retain + * 5 or 6 bits per color, so that 8 or 4 different input values are counted + * in the same histogram cell. + * + * Next, the color-selection step begins with a box representing the whole + * color space, and repeatedly splits the "largest" remaining box until we + * have as many boxes as desired colors. Then the mean color in each + * remaining box becomes one of the possible output colors. + * + * The second pass over the image maps each input pixel to the closest output + * color (optionally after applying a Floyd-Steinberg dithering correction). + * This mapping is logically trivial, but making it go fast enough requires + * considerable care. + * + * Heckbert-style quantizers vary a good deal in their policies for choosing + * the "largest" box and deciding where to cut it. The particular policies + * used here have proved out well in experimental comparisons, but better ones + * may yet be found. + * + * In earlier versions of the IJG code, this module quantized in YCbCr color + * space, processing the raw upsampled data without a color conversion step. + * This allowed the color conversion math to be done only once per colormap + * entry, not once per pixel. However, that optimization precluded other + * useful optimizations (such as merging color conversion with upsampling) + * and it also interfered with desired capabilities such as quantizing to an + * externally-supplied colormap. We have therefore abandoned that approach. + * The present code works in the post-conversion color space, typically RGB. + * + * To improve the visual quality of the results, we actually work in scaled + * RGB space, giving G distances more weight than R, and R in turn more than + * B. To do everything in integer math, we must use integer scale factors. + * The 2/3/1 scale factors used here correspond loosely to the relative + * weights of the colors in the NTSC grayscale equation. + * If you want to use this code to quantize a non-RGB color space, you'll + * probably need to change these scale factors. + */ + +#define R_SCALE 2 /* scale R distances by this much */ +#define G_SCALE 3 /* scale G distances by this much */ +#define B_SCALE 1 /* and B by this much */ + +/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined + * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B + * and B,G,R orders. If you define some other weird order in jmorecfg.h, + * you'll get compile errors until you extend this logic. In that case + * you'll probably want to tweak the histogram sizes too. + */ + +#if RGB_RED == 0 +#define C0_SCALE R_SCALE +#endif +#if RGB_BLUE == 0 +#define C0_SCALE B_SCALE +#endif +#if RGB_GREEN == 1 +#define C1_SCALE G_SCALE +#endif +#if RGB_RED == 2 +#define C2_SCALE R_SCALE +#endif +#if RGB_BLUE == 2 +#define C2_SCALE B_SCALE +#endif + + +/* + * First we have the histogram data structure and routines for creating it. + * + * The number of bits of precision can be adjusted by changing these symbols. + * We recommend keeping 6 bits for G and 5 each for R and B. + * If you have plenty of memory and cycles, 6 bits all around gives marginally + * better results; if you are short of memory, 5 bits all around will save + * some space but degrade the results. + * To maintain a fully accurate histogram, we'd need to allocate a "long" + * (preferably unsigned long) for each cell. In practice this is overkill; + * we can get by with 16 bits per cell. Few of the cell counts will overflow, + * and clamping those that do overflow to the maximum value will give close- + * enough results. This reduces the recommended histogram size from 256Kb + * to 128Kb, which is a useful savings on PC-class machines. + * (In the second pass the histogram space is re-used for pixel mapping data; + * in that capacity, each cell must be able to store zero to the number of + * desired colors. 16 bits/cell is plenty for that too.) + * Since the JPEG code is intended to run in small memory model on 80x86 + * machines, we can't just allocate the histogram in one chunk. Instead + * of a true 3-D array, we use a row of pointers to 2-D arrays. Each + * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and + * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that + * on 80x86 machines, the pointer row is in near memory but the actual + * arrays are in far memory (same arrangement as we use for image arrays). + */ + +#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ + +/* These will do the right thing for either R,G,B or B,G,R color order, + * but you may not like the results for other color orders. + */ +#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ +#define HIST_C1_BITS 6 /* bits of precision in G histogram */ +#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ + +/* Number of elements along histogram axes. */ +#define HIST_C0_ELEMS (1<cquantize; + register JSAMPROW ptr; + register histptr histp; + register hist3d histogram = cquantize->histogram; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptr = input_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the histogram */ + histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT] + [GETJSAMPLE(ptr[1]) >> C1_SHIFT] + [GETJSAMPLE(ptr[2]) >> C2_SHIFT]; + /* increment, check for overflow and undo increment if so. */ + if (++(*histp) <= 0) + (*histp)--; + ptr += 3; + } + } +} + + +/* + * Next we have the really interesting routines: selection of a colormap + * given the completed histogram. + * These routines work with a list of "boxes", each representing a rectangular + * subset of the input color space (to histogram precision). + */ + +typedef struct { + /* The bounds of the box (inclusive); expressed as histogram indexes */ + int c0min, c0max; + int c1min, c1max; + int c2min, c2max; + /* The volume (actually 2-norm) of the box */ + IJG_INT32 volume; + /* The number of nonzero histogram cells within this box */ + long colorcount; +} box; + +typedef box * boxptr; + + +LOCAL(boxptr) +find_biggest_color_pop (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest color population */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register long maxc = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->colorcount > maxc && boxp->volume > 0) { + which = boxp; + maxc = boxp->colorcount; + } + } + return which; +} + + +LOCAL(boxptr) +find_biggest_volume (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest (scaled) volume */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register IJG_INT32 maxv = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->volume > maxv) { + which = boxp; + maxv = boxp->volume; + } + } + return which; +} + + +LOCAL(void) +update_box (j_decompress_ptr cinfo, boxptr boxp) +/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ +/* and recompute its volume and population */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + IJG_INT32 dist0,dist1,dist2; + long ccount; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + if (c0max > c0min) + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0min = c0min = c0; + goto have_c0min; + } + } + have_c0min: + if (c0max > c0min) + for (c0 = c0max; c0 >= c0min; c0--) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0max = c0max = c0; + goto have_c0max; + } + } + have_c0max: + if (c1max > c1min) + for (c1 = c1min; c1 <= c1max; c1++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1min = c1min = c1; + goto have_c1min; + } + } + have_c1min: + if (c1max > c1min) + for (c1 = c1max; c1 >= c1min; c1--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1max = c1max = c1; + goto have_c1max; + } + } + have_c1max: + if (c2max > c2min) + for (c2 = c2min; c2 <= c2max; c2++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2min = c2min = c2; + goto have_c2min; + } + } + have_c2min: + if (c2max > c2min) + for (c2 = c2max; c2 >= c2min; c2--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2max = c2max = c2; + goto have_c2max; + } + } + have_c2max: + + /* Update box volume. + * We use 2-norm rather than real volume here; this biases the method + * against making long narrow boxes, and it has the side benefit that + * a box is splittable iff norm > 0. + * Since the differences are expressed in histogram-cell units, + * we have to shift back to JSAMPLE units to get consistent distances; + * after which, we scale according to the selected distance scale factors. + */ + dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; + dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; + dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; + boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2; + + /* Now scan remaining volume of box and compute population */ + ccount = 0; + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++, histp++) + if (*histp != 0) { + ccount++; + } + } + boxp->colorcount = ccount; +} + + +LOCAL(int) +median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, + int desired_colors) +/* Repeatedly select and split the largest box until we have enough boxes */ +{ + int n,lb; + int c0,c1,c2,cmax; + register boxptr b1,b2; + + while (numboxes < desired_colors) { + /* Select box to split. + * Current algorithm: by population for first half, then by volume. + */ + if (numboxes*2 <= desired_colors) { + b1 = find_biggest_color_pop(boxlist, numboxes); + } else { + b1 = find_biggest_volume(boxlist, numboxes); + } + if (b1 == NULL) /* no splittable boxes left! */ + break; + b2 = &boxlist[numboxes]; /* where new box will go */ + /* Copy the color bounds to the new box. */ + b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; + b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; + /* Choose which axis to split the box on. + * Current algorithm: longest scaled axis. + * See notes in update_box about scaling distances. + */ + c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; + c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; + c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; + /* We want to break any ties in favor of green, then red, blue last. + * This code does the right thing for R,G,B or B,G,R color orders only. + */ +#if RGB_RED == 0 + cmax = c1; n = 1; + if (c0 > cmax) { cmax = c0; n = 0; } + if (c2 > cmax) { n = 2; } +#else + cmax = c1; n = 1; + if (c2 > cmax) { cmax = c2; n = 2; } + if (c0 > cmax) { n = 0; } +#endif + /* Choose split point along selected axis, and update box bounds. + * Current algorithm: split at halfway point. + * (Since the box has been shrunk to minimum volume, + * any split will produce two nonempty subboxes.) + * Note that lb value is max for lower box, so must be < old max. + */ + switch (n) { + case 0: + lb = (b1->c0max + b1->c0min) / 2; + b1->c0max = lb; + b2->c0min = lb+1; + break; + case 1: + lb = (b1->c1max + b1->c1min) / 2; + b1->c1max = lb; + b2->c1min = lb+1; + break; + case 2: + lb = (b1->c2max + b1->c2min) / 2; + b1->c2max = lb; + b2->c2min = lb+1; + break; + } + /* Update stats for boxes */ + update_box(cinfo, b1); + update_box(cinfo, b2); + numboxes++; + } + return numboxes; +} + + +LOCAL(void) +compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) +/* Compute representative color for a box, put it in colormap[icolor] */ +{ + /* Current algorithm: mean weighted by pixels (not colors) */ + /* Note it is important to get the rounding correct! */ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + long count; + long total = 0; + long c0total = 0; + long c1total = 0; + long c2total = 0; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) { + if ((count = *histp++) != 0) { + total += count; + c0total += ((c0 << C0_SHIFT) + ((1<>1)) * count; + c1total += ((c1 << C1_SHIFT) + ((1<>1)) * count; + c2total += ((c2 << C2_SHIFT) + ((1<>1)) * count; + } + } + } + + cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); + cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); + cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); +} + + +LOCAL(void) +select_colors (j_decompress_ptr cinfo, int desired_colors) +/* Master routine for color selection */ +{ + boxptr boxlist; + int numboxes; + int i; + + /* Allocate workspace for box list */ + boxlist = (boxptr) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (size_t)desired_colors * SIZEOF(box)); + /* Initialize one box containing whole space */ + numboxes = 1; + boxlist[0].c0min = 0; + boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; + boxlist[0].c1min = 0; + boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; + boxlist[0].c2min = 0; + boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; + /* Shrink it to actually-used volume and set its statistics */ + update_box(cinfo, & boxlist[0]); + /* Perform median-cut to produce final box list */ + numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors); + /* Compute the representative color for each box, fill colormap */ + for (i = 0; i < numboxes; i++) + compute_color(cinfo, & boxlist[i], i); + cinfo->actual_number_of_colors = numboxes; + TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes); +} + + +/* + * These routines are concerned with the time-critical task of mapping input + * colors to the nearest color in the selected colormap. + * + * We re-use the histogram space as an "inverse color map", essentially a + * cache for the results of nearest-color searches. All colors within a + * histogram cell will be mapped to the same colormap entry, namely the one + * closest to the cell's center. This may not be quite the closest entry to + * the actual input color, but it's almost as good. A zero in the cache + * indicates we haven't found the nearest color for that cell yet; the array + * is cleared to zeroes before starting the mapping pass. When we find the + * nearest color for a cell, its colormap index plus one is recorded in the + * cache for future use. The pass2 scanning routines call fill_inverse_cmap + * when they need to use an unfilled entry in the cache. + * + * Our method of efficiently finding nearest colors is based on the "locally + * sorted search" idea described by Heckbert and on the incremental distance + * calculation described by Spencer W. Thomas in chapter III.1 of Graphics + * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that + * the distances from a given colormap entry to each cell of the histogram can + * be computed quickly using an incremental method: the differences between + * distances to adjacent cells themselves differ by a constant. This allows a + * fairly fast implementation of the "brute force" approach of computing the + * distance from every colormap entry to every histogram cell. Unfortunately, + * it needs a work array to hold the best-distance-so-far for each histogram + * cell (because the inner loop has to be over cells, not colormap entries). + * The work array elements have to be IJG_INT32s, so the work array would need + * 256Kb at our recommended precision. This is not feasible in DOS machines. + * + * To get around these problems, we apply Thomas' method to compute the + * nearest colors for only the cells within a small subbox of the histogram. + * The work array need be only as big as the subbox, so the memory usage + * problem is solved. Furthermore, we need not fill subboxes that are never + * referenced in pass2; many images use only part of the color gamut, so a + * fair amount of work is saved. An additional advantage of this + * approach is that we can apply Heckbert's locality criterion to quickly + * eliminate colormap entries that are far away from the subbox; typically + * three-fourths of the colormap entries are rejected by Heckbert's criterion, + * and we need not compute their distances to individual cells in the subbox. + * The speed of this approach is heavily influenced by the subbox size: too + * small means too much overhead, too big loses because Heckbert's criterion + * can't eliminate as many colormap entries. Empirically the best subbox + * size seems to be about 1/512th of the histogram (1/8th in each direction). + * + * Thomas' article also describes a refined method which is asymptotically + * faster than the brute-force method, but it is also far more complex and + * cannot efficiently be applied to small subboxes. It is therefore not + * useful for programs intended to be portable to DOS machines. On machines + * with plenty of memory, filling the whole histogram in one shot with Thomas' + * refined method might be faster than the present code --- but then again, + * it might not be any faster, and it's certainly more complicated. + */ + + +/* log2(histogram cells in update box) for each axis; this can be adjusted */ +#define BOX_C0_LOG (HIST_C0_BITS-3) +#define BOX_C1_LOG (HIST_C1_BITS-3) +#define BOX_C2_LOG (HIST_C2_BITS-3) + +#define BOX_C0_ELEMS (1<actual_number_of_colors; + int maxc0, maxc1, maxc2; + int centerc0, centerc1, centerc2; + int i, x, ncolors; + IJG_INT32 minmaxdist, min_dist, max_dist, tdist; + IJG_INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ + + /* Compute true coordinates of update box's upper corner and center. + * Actually we compute the coordinates of the center of the upper-corner + * histogram cell, which are the upper bounds of the volume we care about. + * Note that since ">>" rounds down, the "center" values may be closer to + * min than to max; hence comparisons to them must be "<=", not "<". + */ + maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); + centerc0 = (minc0 + maxc0) >> 1; + maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); + centerc1 = (minc1 + maxc1) >> 1; + maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); + centerc2 = (minc2 + maxc2) >> 1; + + /* For each color in colormap, find: + * 1. its minimum squared-distance to any point in the update box + * (zero if color is within update box); + * 2. its maximum squared-distance to any point in the update box. + * Both of these can be found by considering only the corners of the box. + * We save the minimum distance for each color in mindist[]; + * only the smallest maximum distance is of interest. + */ + minmaxdist = 0x7FFFFFFFL; + + for (i = 0; i < numcolors; i++) { + /* We compute the squared-c0-distance term, then add in the other two. */ + x = GETJSAMPLE(cinfo->colormap[0][i]); + if (x < minc0) { + tdist = (x - minc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else if (x > maxc0) { + tdist = (x - maxc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + min_dist = 0; + if (x <= centerc0) { + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[1][i]); + if (x < minc1) { + tdist = (x - minc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc1) { + tdist = (x - maxc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc1) { + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[2][i]); + if (x < minc2) { + tdist = (x - minc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc2) { + tdist = (x - maxc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc2) { + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } + } + + mindist[i] = min_dist; /* save away the results */ + if (max_dist < minmaxdist) + minmaxdist = max_dist; + } + + /* Now we know that no cell in the update box is more than minmaxdist + * away from some colormap entry. Therefore, only colors that are + * within minmaxdist of some part of the box need be considered. + */ + ncolors = 0; + for (i = 0; i < numcolors; i++) { + if (mindist[i] <= minmaxdist) + colorlist[ncolors++] = (JSAMPLE) i; + } + return ncolors; +} + + +LOCAL(void) +find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, + int numcolors, const JSAMPLE colorlist[], JSAMPLE bestcolor[]) +/* Find the closest colormap entry for each cell in the update box, + * given the list of candidate colors prepared by find_nearby_colors. + * Return the indexes of the closest entries in the bestcolor[] array. + * This routine uses Thomas' incremental distance calculation method to + * find the distance from a colormap entry to successive cells in the box. + */ +{ + int ic0, ic1, ic2; + int i, icolor; + register IJG_INT32 * bptr; /* pointer into bestdist[] array */ + JSAMPLE * cptr; /* pointer into bestcolor[] array */ + IJG_INT32 dist0, dist1; /* initial distance values */ + register IJG_INT32 dist2; /* current distance in inner loop */ + IJG_INT32 xx0, xx1; /* distance increments */ + register IJG_INT32 xx2; + IJG_INT32 inc0, inc1, inc2; /* initial values for increments */ + /* This array holds the distance to the nearest-so-far color for each cell */ + IJG_INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Initialize best-distance for each cell of the update box */ + bptr = bestdist; + for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--) + *bptr++ = 0x7FFFFFFFL; + + /* For each color selected by find_nearby_colors, + * compute its distance to the center of each cell in the box. + * If that's less than best-so-far, update best distance and color number. + */ + + /* Nominal steps between cell centers ("x" in Thomas article) */ +#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) +#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) +#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) + + for (i = 0; i < numcolors; i++) { + icolor = GETJSAMPLE(colorlist[i]); + /* Compute (square of) distance from minc0/c1/c2 to this color */ + inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE; + dist0 = inc0*inc0; + inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE; + dist0 += inc1*inc1; + inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE; + dist0 += inc2*inc2; + /* Form the initial difference increments */ + inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; + inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; + inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; + /* Now loop over all cells in box, updating distance per Thomas method */ + bptr = bestdist; + cptr = bestcolor; + xx0 = inc0; + for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) { + dist1 = dist0; + xx1 = inc1; + for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) { + dist2 = dist1; + xx2 = inc2; + for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) { + if (dist2 < *bptr) { + *bptr = dist2; + *cptr = (JSAMPLE) icolor; + } + dist2 += xx2; + xx2 += 2 * STEP_C2 * STEP_C2; + bptr++; + cptr++; + } + dist1 += xx1; + xx1 += 2 * STEP_C1 * STEP_C1; + } + dist0 += xx0; + xx0 += 2 * STEP_C0 * STEP_C0; + } + } +} + + +LOCAL(void) +fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) +/* Fill the inverse-colormap entries in the update box that contains */ +/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ +/* we can fill as many others as we wish.) */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int minc0, minc1, minc2; /* lower left corner of update box */ + int ic0, ic1, ic2; + register JSAMPLE * cptr; /* pointer into bestcolor[] array */ + register histptr cachep; /* pointer into main cache array */ + /* This array lists the candidate colormap indexes. */ + JSAMPLE colorlist[MAXNUMCOLORS]; + int numcolors; /* number of candidate colors */ + /* This array holds the actually closest colormap index for each cell. */ + JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Convert cell coordinates to update box ID */ + c0 >>= BOX_C0_LOG; + c1 >>= BOX_C1_LOG; + c2 >>= BOX_C2_LOG; + + /* Compute true coordinates of update box's origin corner. + * Actually we compute the coordinates of the center of the corner + * histogram cell, which are the lower bounds of the volume we care about. + */ + minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); + minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); + minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); + + /* Determine which colormap entries are close enough to be candidates + * for the nearest entry to some cell in the update box. + */ + numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist); + + /* Determine the actually nearest colors. */ + find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist, + bestcolor); + + /* Save the best color numbers (plus 1) in the main cache array */ + c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ + c1 <<= BOX_C1_LOG; + c2 <<= BOX_C2_LOG; + cptr = bestcolor; + for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) { + for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) { + cachep = & histogram[c0+ic0][c1+ic1][c2]; + for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) { + *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1); + } + } + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +pass2_no_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register JSAMPROW inptr, outptr; + register histptr cachep; + register int c0, c1, c2; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the cache */ + c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT; + c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT; + c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT; + cachep = & histogram[c0][c1][c2]; + /* If we have not seen this color before, find nearest colormap entry */ + /* and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, c0,c1,c2); + /* Now emit the colormap index for this cell */ + *outptr++ = (JSAMPLE) (*cachep - 1); + } + } +} + + +METHODDEF(void) +pass2_fs_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ + LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ + LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + JSAMPROW inptr; /* => current input pixel */ + JSAMPROW outptr; /* => current output pixel */ + histptr cachep; + int dir; /* +1 or -1 depending on direction */ + int dir3; /* 3*dir, for advancing inptr & errorptr */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + int *error_limit = cquantize->error_limiter; + JSAMPROW colormap0 = cinfo->colormap[0]; + JSAMPROW colormap1 = cinfo->colormap[1]; + JSAMPROW colormap2 = cinfo->colormap[2]; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + inptr += (width-1) * 3; /* so point to rightmost pixel */ + outptr += width-1; + dir = -1; + dir3 = -3; + errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */ + cquantize->on_odd_row = FALSE; /* flip for next time */ + } else { + /* work left to right in this row */ + dir = 1; + dir3 = 3; + errorptr = cquantize->fserrors; /* => entry before first real column */ + cquantize->on_odd_row = TRUE; /* flip for next time */ + } + /* Preset error values: no error propagated to first pixel from left */ + cur0 = cur1 = cur2 = 0; + /* and no error propagated to row below yet */ + belowerr0 = belowerr1 = belowerr2 = 0; + bpreverr0 = bpreverr1 = bpreverr2 = 0; + + for (col = width; col > 0; col--) { + /* curN holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4); + cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4); + cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4); + /* Limit the error using transfer function set by init_error_limit. + * See comments with init_error_limit for rationale. + */ + cur0 = error_limit[cur0]; + cur1 = error_limit[cur1]; + cur2 = error_limit[cur2]; + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE (or less with error limiting); + * this sets the required size of the range_limit array. + */ + cur0 += GETJSAMPLE(inptr[0]); + cur1 += GETJSAMPLE(inptr[1]); + cur2 += GETJSAMPLE(inptr[2]); + cur0 = GETJSAMPLE(range_limit[cur0]); + cur1 = GETJSAMPLE(range_limit[cur1]); + cur2 = GETJSAMPLE(range_limit[cur2]); + /* Index into the cache with adjusted pixel value */ + cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT]; + /* If we have not seen this color before, find nearest colormap */ + /* entry and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, (int)(cur0>>C0_SHIFT),(int)(cur1>>C1_SHIFT),(int)(cur2>>C2_SHIFT)); + /* Now emit the colormap index for this cell */ + { register int pixcode = *cachep - 1; + *outptr = (JSAMPLE) pixcode; + /* Compute representation error for this pixel */ + cur0 -= GETJSAMPLE(colormap0[pixcode]); + cur1 -= GETJSAMPLE(colormap1[pixcode]); + cur2 -= GETJSAMPLE(colormap2[pixcode]); + } + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + { register LOCFSERROR bnexterr, delta; + + bnexterr = cur0; /* Process component 0 */ + delta = cur0 * 2; + cur0 += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr0 + cur0); + cur0 += delta; /* form error * 5 */ + bpreverr0 = belowerr0 + cur0; + belowerr0 = bnexterr; + cur0 += delta; /* form error * 7 */ + bnexterr = cur1; /* Process component 1 */ + delta = cur1 * 2; + cur1 += delta; /* form error * 3 */ + errorptr[1] = (FSERROR) (bpreverr1 + cur1); + cur1 += delta; /* form error * 5 */ + bpreverr1 = belowerr1 + cur1; + belowerr1 = bnexterr; + cur1 += delta; /* form error * 7 */ + bnexterr = cur2; /* Process component 2 */ + delta = cur2 * 2; + cur2 += delta; /* form error * 3 */ + errorptr[2] = (FSERROR) (bpreverr2 + cur2); + cur2 += delta; /* form error * 5 */ + bpreverr2 = belowerr2 + cur2; + belowerr2 = bnexterr; + cur2 += delta; /* form error * 7 */ + } + /* At this point curN contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + inptr += dir3; /* Advance pixel pointers to next column */ + outptr += dir; + errorptr += dir3; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error values into the + * final fserrors[] entry. Note we need not unload belowerrN because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ + errorptr[1] = (FSERROR) bpreverr1; + errorptr[2] = (FSERROR) bpreverr2; + } +} + + +/* + * Initialize the error-limiting transfer function (lookup table). + * The raw F-S error computation can potentially compute error values of up to + * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be + * much less, otherwise obviously wrong pixels will be created. (Typical + * effects include weird fringes at color-area boundaries, isolated bright + * pixels in a dark area, etc.) The standard advice for avoiding this problem + * is to ensure that the "corners" of the color cube are allocated as output + * colors; then repeated errors in the same direction cannot cause cascading + * error buildup. However, that only prevents the error from getting + * completely out of hand; Aaron Giles reports that error limiting improves + * the results even with corner colors allocated. + * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty + * well, but the smoother transfer function used below is even better. Thanks + * to Aaron Giles for this idea. + */ + +LOCAL(void) +init_error_limit (j_decompress_ptr cinfo) +/* Allocate and fill in the error_limiter table */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + int * table; + int in, out; + + table = (int *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int)); + table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ + cquantize->error_limiter = table; + +#define STEPSIZE ((MAXJSAMPLE+1)/16) + /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ + out = 0; + for (in = 0; in < STEPSIZE; in++, out++) { + table[in] = out; table[-in] = -out; + } + /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ + for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) { + table[in] = out; table[-in] = -out; + } + /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ + for (; in <= MAXJSAMPLE; in++) { + table[in] = out; table[-in] = -out; + } +#undef STEPSIZE +} + + +/* + * Finish up at the end of each pass. + */ + +METHODDEF(void) +finish_pass1 (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Select the representative colors and fill in cinfo->colormap */ + cinfo->colormap = cquantize->sv_colormap; + select_colors(cinfo, cquantize->desired); + /* Force next pass to zero the color index table */ + cquantize->needs_zeroed = TRUE; +} + + +METHODDEF(void) +finish_pass2 (j_decompress_ptr cinfo) +{ + /* no work */ +} + + +/* + * Initialize for each processing pass. + */ + +METHODDEF(void) +start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int i; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + if (is_pre_scan) { + /* Set up method pointers */ + cquantize->pub.color_quantize = prescan_quantize; + cquantize->pub.finish_pass = finish_pass1; + cquantize->needs_zeroed = TRUE; /* Always zero histogram */ + } else { + /* Set up method pointers */ + if (cinfo->dither_mode == JDITHER_FS) + cquantize->pub.color_quantize = pass2_fs_dither; + else + cquantize->pub.color_quantize = pass2_no_dither; + cquantize->pub.finish_pass = finish_pass2; + + /* Make sure color count is acceptable */ + i = cinfo->actual_number_of_colors; + if (i < 1) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1); + if (i > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + + if (cinfo->dither_mode == JDITHER_FS) { + size_t arraysize = (size_t) ((cinfo->output_width + 2) * + (3 * SIZEOF(FSERROR))); + /* Allocate Floyd-Steinberg workspace if we didn't already. */ + if (cquantize->fserrors == NULL) + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + /* Initialize the propagated errors to zero. */ + jzero_far((void FAR *) cquantize->fserrors, arraysize); + /* Make the error-limit table if we didn't already. */ + if (cquantize->error_limiter == NULL) + init_error_limit(cinfo); + cquantize->on_odd_row = FALSE; + } + + } + /* Zero the histogram or inverse color map, if necessary */ + if (cquantize->needs_zeroed) { + for (i = 0; i < HIST_C0_ELEMS; i++) { + jzero_far((void FAR *) histogram[i], + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = FALSE; + } +} + + +/* + * Switch to a new external colormap between output passes. + */ + +METHODDEF(void) +new_color_map_2_quant (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Reset the inverse color map */ + cquantize->needs_zeroed = TRUE; +} + + +/* + * Module initialization routine for 2-pass color quantization. + */ + +GLOBAL(void) +jinit_2pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + int i; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_2_quant; + cquantize->pub.new_color_map = new_color_map_2_quant; + cquantize->fserrors = NULL; /* flag optional arrays not allocated */ + cquantize->error_limiter = NULL; + + /* Make sure jdmaster didn't give me a case I can't handle */ + if (cinfo->out_color_components != 3) + ERREXIT(cinfo, JERR_NOTIMPL); + + /* Allocate the histogram/inverse colormap storage */ + cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d)); + for (i = 0; i < HIST_C0_ELEMS; i++) { + cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ + + /* Allocate storage for the completed colormap, if required. + * We do this now since it is FAR storage and may affect + * the memory manager's space calculations. + */ + if (cinfo->enable_2pass_quant) { + /* Make sure color count is acceptable */ + int desired = cinfo->desired_number_of_colors; + /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */ + if (desired < 8) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (desired > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + cquantize->sv_colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3); + cquantize->desired = desired; + } else + cquantize->sv_colormap = NULL; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + /* Allocate Floyd-Steinberg workspace if necessary. + * This isn't really needed until pass 2, but again it is FAR storage. + * Although we will cope with a later change in dither_mode, + * we do not promise to honor max_memory_to_use if dither_mode changes. + */ + if (cinfo->dither_mode == JDITHER_FS) { + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR)))); + /* Might as well create the error-limiting table too. */ + init_error_limit(cinfo); + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ diff --git a/dcmjpeg/libijg12/jutils.c b/dcmjpeg/libijg12/jutils.c new file mode 100644 index 00000000..8eaa8e97 --- /dev/null +++ b/dcmjpeg/libijg12/jutils.c @@ -0,0 +1,179 @@ +/* + * jutils.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains tables and miscellaneous utility routines needed + * for both compression and decompression. + * Note we prefix all global names with "j" to minimize conflicts with + * a surrounding application. + */ + +#define JPEG_INTERNALS +#include "jinclude12.h" +#include "jpeglib12.h" + + +/* + * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element + * of a DCT block read in natural order (left to right, top to bottom). + */ + +#if 0 /* This table is not actually needed in v6a */ + +const int jpeg_zigzag_order[DCTSIZE2] = { + 0, 1, 5, 6, 14, 15, 27, 28, + 2, 4, 7, 13, 16, 26, 29, 42, + 3, 8, 12, 17, 25, 30, 41, 43, + 9, 11, 18, 24, 31, 40, 44, 53, + 10, 19, 23, 32, 39, 45, 52, 54, + 20, 22, 33, 38, 46, 51, 55, 60, + 21, 34, 37, 47, 50, 56, 59, 61, + 35, 36, 48, 49, 57, 58, 62, 63 +}; + +#endif + +/* + * jpeg_natural_order[i] is the natural-order position of the i'th element + * of zigzag order. + * + * When reading corrupted data, the Huffman decoders could attempt + * to reference an entry beyond the end of this array (if the decoded + * zero run length reaches past the end of the block). To prevent + * wild stores without adding an inner-loop test, we put some extra + * "63"s after the real entries. This will cause the extra coefficient + * to be stored in location 63 of the block, not somewhere random. + * The worst case would be a run-length of 15, which means we need 16 + * fake entries. + */ + +const int jpeg_natural_order[DCTSIZE2+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + + +/* + * Arithmetic utilities + */ + +GLOBAL(long) +jdiv_round_up (long a, long b) +/* Compute a/b rounded up to next integer, ie, ceil(a/b) */ +/* Assumes a >= 0, b > 0 */ +{ + return (a + b - 1L) / b; +} + + +GLOBAL(long) +jround_up (long a, long b) +/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */ +/* Assumes a >= 0, b > 0 */ +{ + a += b - 1L; + return a - (a % b); +} + + +/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays + * and coefficient-block arrays. This won't work on 80x86 because the arrays + * are FAR and we're assuming a small-pointer memory model. However, some + * DOS compilers provide far-pointer versions of memcpy() and memset() even + * in the small-model libraries. These will be used if USE_FMEM is defined. + * Otherwise, the routines below do it the hard way. (The performance cost + * is not all that great, because these routines aren't very heavily used.) + */ + +#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ +#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) +#define FMEMZERO(target,size) MEMZERO(target,size) +#else /* 80x86 case, define if we can */ +#ifdef USE_FMEM +#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size)) +#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size)) +#endif +#endif + + +GLOBAL(void) +jcopy_sample_rows (JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols) +/* Copy some rows of samples from one place to another. + * num_rows rows are copied from input_array[source_row++] + * to output_array[dest_row++]; these areas may overlap for duplication. + * The source and destination arrays must be at least as wide as num_cols. + */ +{ + register JSAMPROW inptr, outptr; +#ifdef FMEMCOPY + register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); +#else + register JDIMENSION count; +#endif + register int row; + + input_array += source_row; + output_array += dest_row; + + for (row = num_rows; row > 0; row--) { + inptr = *input_array++; + outptr = *output_array++; +#ifdef FMEMCOPY + FMEMCOPY(outptr, inptr, count); +#else + for (count = num_cols; count > 0; count--) + *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ +#endif + } +} + + +GLOBAL(void) +jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks) +/* Copy a row of coefficient blocks from one place to another. */ +{ +#ifdef FMEMCOPY + FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); +#else + register JCOEFPTR inptr, outptr; + register long count; + + inptr = (JCOEFPTR) input_row; + outptr = (JCOEFPTR) output_row; + for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) { + *outptr++ = *inptr++; + } +#endif +} + + +GLOBAL(void) +jzero_far (void FAR * target, size_t bytestozero) +/* Zero out a chunk of FAR memory. */ +/* This might be sample-array data, block-array data, or alloc_large data. */ +{ +#ifdef FMEMZERO + FMEMZERO(target, bytestozero); +#else + register char FAR * ptr = (char FAR *) target; + register size_t count; + + for (count = bytestozero; count > 0; count--) { + *ptr++ = 0; + } +#endif +} diff --git a/dcmjpeg/libijg12/jversion12.h b/dcmjpeg/libijg12/jversion12.h new file mode 100644 index 00000000..6472c58d --- /dev/null +++ b/dcmjpeg/libijg12/jversion12.h @@ -0,0 +1,14 @@ +/* + * jversion.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains software version identification. + */ + + +#define JVERSION "6b 27-Mar-1998" + +#define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" diff --git a/dcmjpeg/libijg16/CMakeLists.txt b/dcmjpeg/libijg16/CMakeLists.txt new file mode 100644 index 00000000..ad532fe6 --- /dev/null +++ b/dcmjpeg/libijg16/CMakeLists.txt @@ -0,0 +1,2 @@ +# create library from source files +DCMTK_ADD_LIBRARY(ijg16 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils) diff --git a/dcmjpeg/libijg16/Makefile.dep b/dcmjpeg/libijg16/Makefile.dep new file mode 100644 index 00000000..06b54e40 --- /dev/null +++ b/dcmjpeg/libijg16/Makefile.dep @@ -0,0 +1,227 @@ +jaricom.o: jaricom.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcapimin.o: jcapimin.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcapistd.o: jcapistd.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcarith.o: jcarith.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jccoefct.o: jccoefct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h +jccolor.o: jccolor.c ../../config/include/dcmtk/config/osconfig.h \ + jinclude16.h jconfig16.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcdctmgr.o: jcdctmgr.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jdct16.h +jcdiffct.o: jcdiffct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jchuff.o: jchuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jchuff16.h +jcinit.o: jcinit.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jclhuff.o: jclhuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h jchuff16.h +jclossls.o: jclossls.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jclossy.o: jclossy.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h +jcmainct.o: jcmainct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcmarker.o: jcmarker.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcmaster.o: jcmaster.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h +jcodec.o: jcodec.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jlossls16.h +jcomapi.o: jcomapi.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcparam.o: jcparam.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcphuff.o: jcphuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jchuff16.h +jcpred.o: jcpred.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jcprepct.o: jcprepct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcsample.o: jcsample.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jcscale.o: jcscale.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jcshuff.o: jcshuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jchuff16.h +jctrans.o: jctrans.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h +jdapimin.o: jdapimin.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdapistd.o: jdapistd.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdarith.o: jdarith.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdatadst.o: jdatadst.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jerror16.h +jdatasrc.o: jdatasrc.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jerror16.h +jdcoefct.o: jdcoefct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h +jdcolor.o: jdcolor.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jddctmgr.o: jddctmgr.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jdct16.h +jddiffct.o: jddiffct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jdhuff.o: jdhuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jlossls16.h jdhuff16.h +jdinput.o: jdinput.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdlhuff.o: jdlhuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h jdhuff16.h +jdlossls.o: jdlossls.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jdlossy.o: jdlossy.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h +jdmainct.o: jdmainct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdmarker.o: jdmarker.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdmaster.o: jdmaster.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdmerge.o: jdmerge.c ../../config/include/dcmtk/config/osconfig.h \ + jinclude16.h jconfig16.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdphuff.o: jdphuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jdhuff16.h +jdpostct.o: jdpostct.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdpred.o: jdpred.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jdsample.o: jdsample.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jdscale.o: jdscale.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossls16.h +jdshuff.o: jdshuff.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h jdhuff16.h +jdtrans.o: jdtrans.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jlossy16.h +jerror.o: jerror.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jversion16.h jerror16.h +jfdctflt.o: jfdctflt.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jdct16.h +jfdctfst.o: jfdctfst.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jdct16.h +jfdctint.o: jfdctint.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jdct16.h +jidctflt.o: jidctflt.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jdct16.h +jidctfst.o: jidctfst.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jdct16.h +jidctint.o: jidctint.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jdct16.h +jidctred.o: jidctred.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jdct16.h +jmemmgr.o: jmemmgr.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jmemsys16.h +jmemnobs.o: jmemnobs.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \ + jmemsys16.h +jquant1.o: jquant1.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jquant2.o: jquant2.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h +jutils.o: jutils.c jinclude16.h jconfig16.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h diff --git a/dcmjpeg/libijg16/Makefile.in b/dcmjpeg/libijg16/Makefile.in new file mode 100644 index 00000000..58085f03 --- /dev/null +++ b/dcmjpeg/libijg16/Makefile.in @@ -0,0 +1,59 @@ +# +# Makefile for dcmjpeg/libijg16 +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd + +LOCALINCLUDES = -I$(ofstddir)/include +LOCALDEFS = -DWITH_ARITHMETIC_PATCH + +objs = jcomapi.o jcodec.o jutils.o jerror.o jmemmgr.o \ + jmemnobs.o jcapimin.o jcapistd.o jctrans.o jcparam.o \ + jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o \ + jcprepct.o jclossls.o jclossy.o jccoefct.o jccolor.o \ + jcsample.o jchuff.o jcphuff.o jcshuff.o jclhuff.o \ + jcpred.o jcscale.o jcdiffct.o jcdctmgr.o jfdctfst.o \ + jfdctflt.o jfdctint.o jdapimin.o jdapistd.o jdtrans.o \ + jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdlossls.o \ + jdlossy.o jdhuff.o jdlhuff.o jdphuff.o jdshuff.o \ + jdpred.o jdscale.o jddiffct.o jdmainct.o jdcoefct.o \ + jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o \ + jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o \ + jdmerge.o jcarith.o jdarith.o jaricom.o +library = libijg16.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.c > $(DEP) + +include $(DEP) diff --git a/dcmjpeg/libijg16/jaricom.c b/dcmjpeg/libijg16/jaricom.c new file mode 100644 index 00000000..77d4fdc0 --- /dev/null +++ b/dcmjpeg/libijg16/jaricom.c @@ -0,0 +1,15 @@ +/* + * jaricom.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy codec tables. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + +IJG_INT32 jaritab[1]; /* dummy table */ diff --git a/dcmjpeg/libijg16/jcapimin.c b/dcmjpeg/libijg16/jcapimin.c new file mode 100644 index 00000000..8cc77371 --- /dev/null +++ b/dcmjpeg/libijg16/jcapimin.c @@ -0,0 +1,280 @@ +/* + * jcapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-compression case or the transcoding-only + * case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jcapistd.c. But also see jcparam.c for + * parameter-setup helper routines, jcomapi.c for routines shared by + * compression and decompression, and jctrans.c for the transcoding case. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Initialization of a JPEG compression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_compress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_compress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = FALSE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->dest = NULL; + + cinfo->comp_info = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) + cinfo->quant_tbl_ptrs[i] = NULL; + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + cinfo->script_space = NULL; + + cinfo->input_gamma = 1.0; /* in case application forgets */ + + /* OK, I'm ready */ + cinfo->global_state = CSTATE_START; +} + + +/* + * Destruction of a JPEG compression object + */ + +GLOBAL(void) +jpeg_destroy_compress (j_compress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG compression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_compress (j_compress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Forcibly suppress or un-suppress all quantization and Huffman tables. + * Marks all currently defined tables as already written (if suppress) + * or not written (if !suppress). This will control whether they get emitted + * by a subsequent jpeg_start_compress call. + * + * This routine is exported for use by applications that want to produce + * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but + * since it is called by jpeg_start_compress, we put it here --- otherwise + * jcparam.o would be linked whether the application used it or not. + */ + +GLOBAL(void) +jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress) +{ + int i; + JQUANT_TBL * qtbl; + JHUFF_TBL * htbl; + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL) + qtbl->sent_table = suppress; + } + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + } +} + + +/* + * Finish JPEG compression. + * + * If a multipass operating mode was selected, this may do a great deal of + * work including most of the actual output. + */ + +GLOBAL(void) +jpeg_finish_compress (j_compress_ptr cinfo) +{ + JDIMENSION iMCU_row; + + if (cinfo->global_state == CSTATE_SCANNING || + cinfo->global_state == CSTATE_RAW_OK) { + /* Terminate first pass */ + if (cinfo->next_scanline < cinfo->image_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_pass) (cinfo); + } else if (cinfo->global_state != CSTATE_WRCOEFS) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any remaining passes */ + while (! cinfo->master->is_last_pass) { + (*cinfo->master->prepare_for_pass) (cinfo); + for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) { + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) iMCU_row; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* We bypass the main controller and invoke coef controller directly; + * all work is being done from the coefficient buffer. + */ + if (! (*cinfo->codec->compress_data) (cinfo, (JSAMPIMAGE) NULL)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } + (*cinfo->master->finish_pass) (cinfo); + } + /* Write EOI, do final cleanup */ + (*cinfo->marker->write_file_trailer) (cinfo); + (*cinfo->dest->term_destination) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); +} + + +/* + * Write a special marker. + * This is only recommended for writing COM or APPn markers. + * Must be called after jpeg_start_compress() and before + * first call to jpeg_write_scanlines() or jpeg_write_raw_data(). + */ + +GLOBAL(void) +jpeg_write_marker (j_compress_ptr cinfo, int marker, + const JOCTET *dataptr, unsigned int datalen) +{ + JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val)); + + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); + write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */ + while (datalen--) { + (*write_marker_byte) (cinfo, *dataptr); + dataptr++; + } +} + +/* Same, but piecemeal. */ + +GLOBAL(void) +jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +{ + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); +} + +GLOBAL(void) +jpeg_write_m_byte (j_compress_ptr cinfo, int val) +{ + (*cinfo->marker->write_marker_byte) (cinfo, val); +} + + +/* + * Alternate compression function: just write an abbreviated table file. + * Before calling this, all parameters and a data destination must be set up. + * + * To produce a pair of files containing abbreviated tables and abbreviated + * image data, one would proceed as follows: + * + * initialize JPEG object + * set JPEG parameters + * set destination to table file + * jpeg_write_tables(cinfo); + * set destination to image file + * jpeg_start_compress(cinfo, FALSE); + * write data... + * jpeg_finish_compress(cinfo); + * + * jpeg_write_tables has the side effect of marking all tables written + * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress + * will not re-emit the tables unless it is passed write_all_tables=TRUE. + */ + +GLOBAL(void) +jpeg_write_tables (j_compress_ptr cinfo) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Initialize the marker writer ... bit of a crock to do it here. */ + jinit_marker_writer(cinfo); + /* Write them tables! */ + (*cinfo->marker->write_tables_only) (cinfo); + /* And clean up. */ + (*cinfo->dest->term_destination) (cinfo); + /* + * In library releases up through v6a, we called jpeg_abort() here to free + * any working memory allocated by the destination manager and marker + * writer. Some applications had a problem with that: they allocated space + * of their own from the library memory manager, and didn't want it to go + * away during write_tables. So now we do nothing. This will cause a + * memory leak if an app calls write_tables repeatedly without doing a full + * compression cycle or otherwise resetting the JPEG object. However, that + * seems less bad than unexpectedly freeing memory in the normal case. + * An app that prefers the old behavior can call jpeg_abort for itself after + * each call to jpeg_write_tables(). + */ +} diff --git a/dcmjpeg/libijg16/jcapistd.c b/dcmjpeg/libijg16/jcapistd.c new file mode 100644 index 00000000..a8e49a87 --- /dev/null +++ b/dcmjpeg/libijg16/jcapistd.c @@ -0,0 +1,161 @@ +/* + * jcapistd.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-compression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_compress, it will end up linking in the entire compressor. + * We thus must separate this file from jcapimin.c to avoid linking the + * whole compression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Compression initialization. + * Before calling this, all parameters and a data destination must be set up. + * + * We require a write_all_tables parameter as a failsafe check when writing + * multiple datastreams from the same compression object. Since prior runs + * will have left all the tables marked sent_table=TRUE, a subsequent run + * would emit an abbreviated stream (no tables) by default. This may be what + * is wanted, but for safety's sake it should not be the default behavior: + * programmers should have to make a deliberate choice to emit abbreviated + * images. Therefore the documentation and examples should encourage people + * to pass write_all_tables=TRUE; then it will take active thought to do the + * wrong thing. + */ + +GLOBAL(void) +jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (write_all_tables) + jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + jinit_compress_master(cinfo); + /* Set up for the first pass */ + (*cinfo->master->prepare_for_pass) (cinfo); + /* Ready for application to drive first pass through jpeg_write_scanlines + * or jpeg_write_raw_data. + */ + cinfo->next_scanline = 0; + cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING); +} + + +/* + * Write some scanlines of data to the JPEG compressor. + * + * The return value will be the number of lines actually written. + * This should be less than the supplied num_lines only in case that + * the data destination module has requested suspension of the compressor, + * or if more than image_height scanlines are passed in. + * + * Note: we warn about excess calls to jpeg_write_scanlines() since + * this likely signals an application programmer error. However, + * excess scanlines passed in the last valid call are *silently* ignored, + * so that the application need not adjust num_lines for end-of-image + * when using a multiple-scanline buffer. + */ + +GLOBAL(JDIMENSION) +jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION num_lines) +{ + JDIMENSION row_ctr, rows_left; + + if (cinfo->global_state != CSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_scanlines. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_scanlines. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Ignore any extra scanlines at bottom of image. */ + rows_left = cinfo->image_height - cinfo->next_scanline; + if (num_lines > rows_left) + num_lines = rows_left; + + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); + cinfo->next_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to write raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION num_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != CSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_raw_data. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_raw_data. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Verify that at least one iMCU row has been passed. */ + lines_per_iMCU_row = (JDIMENSION)(cinfo->max_v_samp_factor * cinfo->data_unit); + if (num_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Directly compress the row. */ + if (! (*cinfo->codec->compress_data) (cinfo, data)) { + /* If compressor did not consume the whole row, suspend processing. */ + return 0; + } + + /* OK, we processed one iMCU row. */ + cinfo->next_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} diff --git a/dcmjpeg/libijg16/jcarith.c b/dcmjpeg/libijg16/jcarith.c new file mode 100644 index 00000000..79109fd1 --- /dev/null +++ b/dcmjpeg/libijg16/jcarith.c @@ -0,0 +1,26 @@ +/* + * jcarith.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy encoding routines. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Module initialization routine for arithmetic entropy encoding. + */ +GLOBAL(void) +jinit_arith_encoder (j_compress_ptr cinfo); + +GLOBAL(void) +jinit_arith_encoder (j_compress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +} diff --git a/dcmjpeg/libijg16/jccoefct.c b/dcmjpeg/libijg16/jccoefct.c new file mode 100644 index 00000000..77f28d38 --- /dev/null +++ b/dcmjpeg/libijg16/jccoefct.c @@ -0,0 +1,454 @@ +/* + * jccoefct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for compression. + * This controller is the top level of the JPEG compressor proper. + * The coefficient buffer lies between forward-DCT and entropy encoding steps. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ + + +/* We use a full-image coefficient buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the DCT + * step is run during the first pass, and subsequent passes need only read + * the buffered coefficients. + */ +#ifdef ENTROPY_OPT_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#else +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#endif +#endif + + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* For single-pass compression, it's sufficient to buffer just one MCU + * (although this may prove a bit slow in practice). We allocate a + * workspace of C_MAX_DATA_UNITS_IN_MCU coefficient blocks, and reuse it for + * each MCU constructed and sent. (On 80x86, the workspace is FAR even + * though it's not really very big; this is to keep the module interfaces + * unchanged when a large coefficient buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays. + */ + JBLOCKROW MCU_buffer[C_MAX_DATA_UNITS_IN_MCU]; + + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +} c_coef_controller; + +typedef c_coef_controller * c_coef_ptr; + + +/* Forward declarations */ +METHODDEF(boolean) compress_data + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#ifdef FULL_COEF_BUFFER_SUPPORTED +METHODDEF(boolean) compress_first_pass + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(boolean) compress_output + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (coef->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_data; + break; +#ifdef FULL_COEF_BUFFER_SUPPORTED + case JBUF_SAVE_AND_PASS: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_output; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data in the single-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(boolean) +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, bi, ci, yindex, yoffset, blockcnt; + JDIMENSION ypos, xpos; + jpeg_component_info *compptr; + + /* Loop to write as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Determine where data comes from in input_buf and do the DCT thing. + * Each call on forward_DCT processes a horizontal row of DCT blocks + * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks + * sequentially. Dummy blocks at the right or bottom edge are filled in + * specially. The data in them does not matter for image reconstruction, + * so we fill them with values that will encode to the smallest amount of + * data, viz: all zeroes in the AC entries, DC entries equal to previous + * block's DC value. (Thanks to Thomas Kinsman for this idea.) + */ + blkn = 0; + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + xpos = MCU_col_num * (JDIMENSION)compptr->MCU_sample_width; + ypos = (JDIMENSION)(yoffset * DCTSIZE); /* ypos == (yoffset+yindex) * DCTSIZE */ + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + (*lossyc->fdct_forward_DCT) (cinfo, compptr, + input_buf[compptr->component_index], + coef->MCU_buffer[blkn], + ypos, xpos, (JDIMENSION) blockcnt); + if (blockcnt < compptr->MCU_width) { + /* Create some dummy blocks at the right edge of the image. */ + jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt], + (size_t)(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK)); + for (bi = blockcnt; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0]; + } + } + } else { + /* Create a row of dummy blocks at the bottom of the image. */ + jzero_far((void FAR *) coef->MCU_buffer[blkn], + (size_t)compptr->MCU_width * SIZEOF(JBLOCK)); + for (bi = 0; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0]; + } + } + blkn += compptr->MCU_width; + ypos += DCTSIZE; + } + } + /* Try to write the MCU. In event of a suspension failure, we will + * re-DCT the MCU on restart (a bit inefficient, could be fixed...) + */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +#ifdef FULL_COEF_BUFFER_SUPPORTED + +/* + * Process some data in the first pass of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * This amount of data is read from the source buffer, DCT'd and quantized, + * and saved into the virtual arrays. We also generate suitable dummy blocks + * as needed at the right and lower edges. (The dummy blocks are constructed + * in the virtual arrays, which have been padded appropriately.) This makes + * it possible for subsequent passes not to worry about real vs. dummy blocks. + * + * We must also emit the data to the entropy encoder. This is conveniently + * done by calling compress_output() after we've loaded the current strip + * of the virtual arrays. + * + * NB: input_buf contains a plane for each component in image. All + * components are DCT'd and loaded into the virtual arrays in this pass. + * However, it may be that only a subset of the components are emitted to + * the entropy encoder during this first pass; be careful about looking + * at the scan-dependent variables (MCU dimensions, etc). + */ + +METHODDEF(boolean) +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION blocks_across, MCUs_across, MCUindex; + int bi, ci, h_samp_factor, block_row, block_rows, ndummy; + JCOEF lastDC; + jpeg_component_info *compptr; + JBLOCKARRAY buffer; + JBLOCKROW thisblockrow, lastblockrow; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + coef->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, TRUE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (coef->iMCU_row_num < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + blocks_across = (JDIMENSION)compptr->width_in_data_units; + h_samp_factor = compptr->h_samp_factor; + /* Count number of dummy blocks to be added at the right margin. */ + ndummy = (int)blocks_across % h_samp_factor; + if (ndummy > 0) + ndummy = h_samp_factor - ndummy; + /* Perform DCT for all non-dummy blocks in this iMCU row. Each call + * on forward_DCT processes a complete horizontal row of DCT blocks. + */ + for (block_row = 0; block_row < block_rows; block_row++) { + thisblockrow = buffer[block_row]; + (*lossyc->fdct_forward_DCT) (cinfo, compptr, + input_buf[ci], thisblockrow, + (JDIMENSION) (block_row * DCTSIZE), + (JDIMENSION) 0, blocks_across); + if (ndummy > 0) { + /* Create dummy blocks at the right edge of the image. */ + thisblockrow += blocks_across; /* => first dummy block */ + jzero_far((void FAR *) thisblockrow, (size_t)ndummy * SIZEOF(JBLOCK)); + lastDC = thisblockrow[-1][0]; + for (bi = 0; bi < ndummy; bi++) { + thisblockrow[bi][0] = lastDC; + } + } + } + /* If at end of image, create dummy block rows as needed. + * The tricky part here is that within each MCU, we want the DC values + * of the dummy blocks to match the last real block's DC value. + * This squeezes a few more bytes out of the resulting file... + */ + if (coef->iMCU_row_num == last_iMCU_row) { + blocks_across += (JDIMENSION)ndummy; /* include lower right corner */ + MCUs_across = blocks_across / (JDIMENSION)h_samp_factor; + for (block_row = block_rows; block_row < compptr->v_samp_factor; + block_row++) { + thisblockrow = buffer[block_row]; + lastblockrow = buffer[block_row-1]; + jzero_far((void FAR *) thisblockrow, + (size_t) (blocks_across * SIZEOF(JBLOCK))); + for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) { + lastDC = lastblockrow[h_samp_factor-1][0]; + for (bi = 0; bi < h_samp_factor; bi++) { + thisblockrow[bi][0] = lastDC; + } + thisblockrow += h_samp_factor; /* advance to next MCU in row */ + lastblockrow += h_samp_factor; + } + } + } + } + /* NB: compress_output will increment iMCU_row_num if successful. + * A suspension return will result in redoing all the work above next time. + */ + + /* Emit data to the entropy encoder, sharing code with subsequent passes */ + return compress_output(cinfo, input_buf); +} + + +/* + * Process some data in subsequent passes of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. + * NB: during first pass, this is safe only because the buffers will + * already be aligned properly, so jmemmgr.c won't need to do any I/O. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to write the MCU. */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + +#endif /* FULL_COEF_BUFFER_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef; + + coef = (c_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_coef_controller)); + lossyc->coef_private = (struct jpeg_c_coef_controller *) coef; + lossyc->coef_start_pass = start_pass_coef; + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef FULL_COEF_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + int ci; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_DATA_UNITS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + coef->whole_image[0] = NULL; /* flag for no virtual arrays */ + } +} diff --git a/dcmjpeg/libijg16/jccolor.c b/dcmjpeg/libijg16/jccolor.c new file mode 100644 index 00000000..6b5ad733 --- /dev/null +++ b/dcmjpeg/libijg16/jccolor.c @@ -0,0 +1,488 @@ +/* + * jccolor.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "dcmtk/config/osconfig.h" +#include "jinclude16.h" +#include "jpeglib16.h" + +/* check if we have a 64-bit integer type */ +#if SIZEOF_LONG == 8 +typedef long jccolor_sint64; +#elif defined(_WIN32) +typedef __int64 jccolor_sint64; +#elif defined(HAVE_LONG_LONG) +typedef long long jccolor_sint64; +#elif defined (HAVE_LONGLONG) +typedef longlong jccolor_sint64; +#else +#define JCCOLOR_NO_SINT64 +#endif + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_converter pub; /* public fields */ + + /* Private state for RGB->YCC conversion */ + IJG_INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ +} my_color_converter; + +typedef my_color_converter * my_cconvert_ptr; + + +/**************** RGB -> YCbCr conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE + * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2, + * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and + * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0) + * were not represented exactly. Now we sacrifice exact representation of + * maximum red and maximum blue in order to get exact grayscales. + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times R,G,B for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included + * in the tables to save adding them separately in the inner loop. + */ + +/* + * SCALEBITS has been changed from 16 to 15 in this particular file. + * The problem is that for 16-bit images SCALEBITS=16 leads to an + * IJG_INT32 integer overflow in rgb_ycc_start(). + * SCALEBITS=15 avoids the overflow at the expense of precision + * and possibly a slight increase in CPU time. + * WARNING: This modification has not really been tested since + * we're never actually converting 16-bit images from RGB to YCC: + * 16-bit per pixel is used with lossless JPEG only, and we don't convert + * RGB to YCC in lossless mode. + */ +#define SCALEBITS 15 +#define CBCR_OFFSET ((IJG_INT32) CENTERJSAMPLE << SCALEBITS) +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L< Y section */ +#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */ +#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */ +#define R_CB_OFF (3*(MAXJSAMPLE+1)) +#define G_CB_OFF (4*(MAXJSAMPLE+1)) +#define B_CB_OFF (5*(MAXJSAMPLE+1)) +#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */ +#define G_CR_OFF (6*(MAXJSAMPLE+1)) +#define B_CR_OFF (7*(MAXJSAMPLE+1)) +#define TABLE_SIZE (8*(MAXJSAMPLE+1)) + + +/* + * Initialize for RGB->YCC colorspace conversion. + */ + +METHODDEF(void) +rgb_ycc_start (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + IJG_INT32 * rgb_ycc_tab; + IJG_INT32 i; + + /* Allocate and fill in the conversion tables. */ + cconvert->rgb_ycc_tab = rgb_ycc_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (TABLE_SIZE * SIZEOF(IJG_INT32))); + + for (i = 0; i <= MAXJSAMPLE; i++) { + rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; + rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; + rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; + rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i; + rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i; + /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr. + * This ensures that the maximum output will round to MAXJSAMPLE + * not MAXJSAMPLE+1, and thus that we don't have to range-limit. + */ +#ifdef JCCOLOR_NO_SINT64 + rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +#else + rgb_ycc_tab[i+B_CB_OFF] = (IJG_INT32) ((jccolor_sint64) FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1); +#endif +/* B=>Cb and R=>Cr tables are the same + rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +*/ + rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i; + rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i; + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * + * Note that we change from the application's interleaved-pixel format + * to our internal noninterleaved, one-plane-per-component format. + * The input buffer is therefore three times as wide as the output buffer. + * + * A starting row offset is provided only for the output buffer. The caller + * can easily adjust the passed input_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +rgb_ycc_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + inptr += RGB_PIXELSIZE; + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + } + } +} + + +/**************** Cases other than RGB -> YCbCr **************/ + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles RGB->grayscale conversion, which is the same + * as the RGB->Y portion of RGB->YCbCr. + * We assume rgb_ycc_start has been called (we only use the Y tables). + */ + +METHODDEF(void) +rgb_gray_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + inptr += RGB_PIXELSIZE; + /* Y */ + outptr[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles Adobe-style CMYK->YCCK conversion, + * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same + * conversion as above, while passing K (black) unchanged. + * We assume rgb_ycc_start has been called. + */ + +METHODDEF(void) +cmyk_ycck_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2, outptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + outptr3 = output_buf[3][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = MAXJSAMPLE - GETJSAMPLE(inptr[0]); + g = MAXJSAMPLE - GETJSAMPLE(inptr[1]); + b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); + /* K passes through as-is */ + outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ + inptr += 4; + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles grayscale output with no conversion. + * The source can be either plain grayscale or YCbCr (since Y == gray). + */ + +METHODDEF(void) +grayscale_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + int instride = cinfo->input_components; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ + inptr += instride; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles multi-component colorspaces without conversion. + * We assume input_components == num_components. + */ + +METHODDEF(void) +null_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + register int ci; + int nc = cinfo->num_components; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + /* It seems fastest to make a separate pass for each component. */ + for (ci = 0; ci < nc; ci++) { + inptr = *input_buf; + outptr = output_buf[ci][output_row]; + for (col = 0; col < num_cols; col++) { + outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */ + inptr += nc; + } + } + input_buf++; + output_row++; + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +null_method (j_compress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for input colorspace conversion. + */ + +GLOBAL(void) +jinit_color_converter (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_converter)); + cinfo->cconvert = (struct jpeg_color_converter *) cconvert; + /* set start_pass to null method until we find out differently */ + cconvert->pub.start_pass = null_method; + + /* Make sure input_components agrees with in_color_space */ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + if (cinfo->input_components != 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_RGB: +#if RGB_PIXELSIZE != 3 + if (cinfo->input_components != RGB_PIXELSIZE) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; +#endif /* else share code with YCbCr */ + + case JCS_YCbCr: + if (cinfo->input_components != 3) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->input_components != 4) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->input_components < 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + } + + /* Check num_components, set conversion method based on requested space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_GRAYSCALE) + cconvert->pub.color_convert = grayscale_convert; + else if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_gray_convert; + } else if (cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = grayscale_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_ycc_convert; + } else if (cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = cmyk_ycck_convert; + } else if (cinfo->in_color_space == JCS_YCCK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: /* allow null conversion of JCS_UNKNOWN */ + if (cinfo->jpeg_color_space != cinfo->in_color_space || + cinfo->num_components != cinfo->input_components) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + cconvert->pub.color_convert = null_convert; + break; + } +} diff --git a/dcmjpeg/libijg16/jcdctmgr.c b/dcmjpeg/libijg16/jcdctmgr.c new file mode 100644 index 00000000..4211d611 --- /dev/null +++ b/dcmjpeg/libijg16/jcdctmgr.c @@ -0,0 +1,390 @@ +/* + * jcdctmgr.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the forward-DCT management logic. + * This code selects a particular DCT implementation to be used, + * and it performs related housekeeping chores including coefficient + * quantization. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ +#include "jdct16.h" /* Private declarations for DCT subsystem */ + + +/* Private subobject for this module */ + +typedef struct { + /* Pointer to the DCT routine actually in use */ + forward_DCT_method_ptr do_dct; + + /* The actual post-DCT divisors --- not identical to the quant table + * entries, because of scaling (especially for an unnormalized DCT). + * Each table is given in normal array order. + */ + DCTELEM * divisors[NUM_QUANT_TBLS]; + +#ifdef DCT_FLOAT_SUPPORTED + /* Same as above for the floating-point case. */ + float_DCT_method_ptr do_float_dct; + FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; +#endif +} fdct_controller; + +typedef fdct_controller * fdct_ptr; + + +/* + * Initialize for a processing pass. + * Verify that all referenced Q-tables are present, and set up + * the divisor table for each one. + * In the current implementation, DCT of all components is done during + * the first pass, even if only some components will be output in the + * first scan. Hence all components should be examined here. + */ + +METHODDEF(void) +start_pass_fdctmgr (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + int ci, qtblno, i; + jpeg_component_info *compptr; + JQUANT_TBL * qtbl; + DCTELEM * dtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + qtblno = compptr->quant_tbl_no; + /* Make sure specified quantization table is present */ + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + qtbl = cinfo->quant_tbl_ptrs[qtblno]; + /* Compute divisors for this quant table */ + /* We may do this more than once for same table, but it's not a big deal */ + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + /* For LL&M IDCT method, divisors are equal to raw quantization + * coefficients multiplied by 8 (to counteract scaling). + */ + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; + } + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + */ +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = (DCTELEM) + DESCALE(MULTIPLY16V16((IJG_INT32) qtbl->quantval[i], + (IJG_INT32) aanscales[i]), + CONST_BITS-3); + } + } + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + * What's actually stored is 1/divisor so that the inner loop can + * use a multiplication rather than a division. + */ + FAST_FLOAT * fdtbl; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + if (fdct->float_divisors[qtblno] == NULL) { + fdct->float_divisors[qtblno] = (FAST_FLOAT *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(FAST_FLOAT)); + } + fdtbl = fdct->float_divisors[qtblno]; + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fdtbl[i] = (FAST_FLOAT) + (1.0 / (((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col] * 8.0))); + i++; + } + } + } + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Perform forward DCT on one or more blocks of a component. + * + * The input samples are taken from the sample_data[] array starting at + * position start_row/start_col, and moving to the right for any additional + * blocks. The quantized coefficients are returned in coef_blocks[]. + */ + +METHODDEF(void) +forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for integer DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + forward_DCT_method_ptr do_dct = fdct->do_dct; + DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; + DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { + /* Load data into workspace, applying unsigned->signed conversion */ + { register DCTELEM *workspaceptr; + register JSAMPROW elemptr; + register int elemr; + + workspaceptr = workspace; + for (elemr = 0; elemr < DCTSIZE; elemr++) { + elemptr = sample_data[elemr] + start_col; +#if DCTSIZE == 8 /* unroll the inner loop */ + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; +#else + { register int elemc; + for (elemc = DCTSIZE; elemc > 0; elemc--) { + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + } + } +#endif + } + } + + /* Perform the DCT */ + (*do_dct) (workspace); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register DCTELEM temp, qval; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + qval = divisors[i]; + temp = workspace[i]; + /* Divide the coefficient value by qval, ensuring proper rounding. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * + * In most files, at least half of the output values will be zero + * (at default quantization settings, more like three-quarters...) + * so we should ensure that this case is fast. On many machines, + * a comparison is enough cheaper than a divide to make a special test + * a win. Since both inputs will be nonnegative, we need only test + * for a < b to discover whether a/b is 0. + * If your machine's division is fast enough, define FAST_DIVIDE. + */ +#ifdef FAST_DIVIDE +#define DIVIDE_BY(a,b) a /= b +#else +#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 +#endif + if (temp < 0) { + temp = -temp; + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + temp = -temp; + } else { + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + } + output_ptr[i] = (JCOEF) temp; + } + } + } +} + + +#ifdef DCT_FLOAT_SUPPORTED + +METHODDEF(void) +forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for floating-point DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + float_DCT_method_ptr do_dct = fdct->do_float_dct; + FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; + FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { + /* Load data into workspace, applying unsigned->signed conversion */ + { register FAST_FLOAT *workspaceptr; + register JSAMPROW elemptr; + register int elemr; + + workspaceptr = workspace; + for (elemr = 0; elemr < DCTSIZE; elemr++) { + elemptr = sample_data[elemr] + start_col; +#if DCTSIZE == 8 /* unroll the inner loop */ + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); +#else + { register int elemc; + for (elemc = DCTSIZE; elemc > 0; elemc--) { + *workspaceptr++ = (FAST_FLOAT) + (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + } + } +#endif + } + } + + /* Perform the DCT */ + (*do_dct) (workspace); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register FAST_FLOAT temp; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + /* Apply the quantization and scaling factor */ + temp = workspace[i] * divisors[i]; + /* Round to nearest integer. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * The maximum coefficient size is +-16K (for 12-bit data), so this + * code should work for either 16-bit or 32-bit ints. + */ + output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384); + } + } + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ + + +/* + * Initialize FDCT manager. + */ + +GLOBAL(void) +jinit_forward_dct (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct; + int i; + + fdct = (fdct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(fdct_controller)); + lossyc->fdct_private = (struct jpeg_forward_dct *) fdct; + lossyc->fdct_start_pass = start_pass_fdctmgr; + + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + lossyc->fdct_forward_DCT = forward_DCT; + fdct->do_dct = jpeg_fdct_islow; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + lossyc->fdct_forward_DCT = forward_DCT; + fdct->do_dct = jpeg_fdct_ifast; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + lossyc->fdct_forward_DCT = forward_DCT_float; + fdct->do_float_dct = jpeg_fdct_float; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + + /* Mark divisor tables unallocated */ + for (i = 0; i < NUM_QUANT_TBLS; i++) { + fdct->divisors[i] = NULL; +#ifdef DCT_FLOAT_SUPPORTED + fdct->float_divisors[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg16/jcdiffct.c b/dcmjpeg/libijg16/jcdiffct.c new file mode 100644 index 00000000..b0eebd10 --- /dev/null +++ b/dcmjpeg/libijg16/jcdiffct.c @@ -0,0 +1,406 @@ +/* + * jcdiffct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the difference buffer controller for compression. + * This controller is the top level of the lossless JPEG compressor proper. + * The difference buffer lies between prediction/differencing and entropy + * encoding. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* We use a full-image sample buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the + * full-image buffer is filled during the first pass, and the scaling, + * prediction and differencing steps are run during subsequent passes. + */ +#ifdef ENTROPY_OPT_SUPPORTED +#define FULL_SAMP_BUFFER_SUPPORTED +#else +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define FULL_SAMP_BUFFER_SUPPORTED +#endif +#endif + + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + JSAMPROW cur_row[MAX_COMPONENTS]; /* row of point transformed samples */ + JSAMPROW prev_row[MAX_COMPONENTS]; /* previous row of Pt'd samples */ + JDIFFARRAY diff_buf[MAX_COMPONENTS]; /* iMCU row of differences */ + + /* In multi-pass modes, we need a virtual sample array for each component. */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +} c_diff_controller; + +typedef c_diff_controller * c_diff_ptr; + + +/* Forward declarations */ +METHODDEF(boolean) compress_data + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#ifdef FULL_SAMP_BUFFER_SUPPORTED +METHODDEF(boolean) compress_first_pass + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(boolean) compress_output + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + diff->MCU_rows_per_iMCU_row = 1; + } else { + if (diff->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + diff->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + diff->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + diff->mcu_ctr = 0; + diff->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_diff (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + + diff->iMCU_row_num = 0; + start_iMCU_row(cinfo); + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (diff->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_data; + break; +#ifdef FULL_SAMP_BUFFER_SUPPORTED + case JBUF_SAVE_AND_PASS: + if (diff->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (diff->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_output; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +#define SWAP_ROWS(rowa,rowb) {JSAMPROW temp; temp=rowa; rowa=rowb; rowb=temp;} + +/* + * Process some data in the single-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the image. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(boolean) +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_count; /* number of MCUs encoded */ + /* JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; */ + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int comp, ci, yoffset, samp_row, samp_rows, samps_across; + jpeg_component_info *compptr; + + /* Loop to write as much as one whole iMCU row */ + for (yoffset = diff->MCU_vert_offset; yoffset < diff->MCU_rows_per_iMCU_row; + yoffset++) { + + MCU_col_num = diff->mcu_ctr; + + /* Scale and predict each scanline of the MCU-row separately. + * + * Note: We only do this if we are at the start of a MCU-row, ie, + * we don't want to reprocess a row suspended by the output. + */ + if (MCU_col_num == 0) { + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + if (diff->iMCU_row_num < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + else { + /* Fill dummy difference rows at the bottom edge with zeros, which + * will encode to the smallest amount of data. + */ + for (samp_row = samp_rows; samp_row < compptr->v_samp_factor; + samp_row++) + MEMZERO(diff->diff_buf[ci][samp_row], + (size_t)jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor) * SIZEOF(JDIFF)); + } + } + samps_across = (int)compptr->width_in_data_units; + + for (samp_row = 0; samp_row < samp_rows; samp_row++) { + (*losslsc->scaler_scale) (cinfo, + input_buf[ci][samp_row], + diff->cur_row[ci], (JDIMENSION)samps_across); + (*losslsc->predict_difference[ci]) (cinfo, ci, + diff->cur_row[ci], + diff->prev_row[ci], + diff->diff_buf[ci][samp_row], + (JDIMENSION)samps_across); + SWAP_ROWS(diff->cur_row[ci], diff->prev_row[ci]); + } + } + } + + /* Try to write the MCU-row (or remaining portion of suspended MCU-row). */ + MCU_count = + (*losslsc->entropy_encode_mcus) (cinfo, + diff->diff_buf, (JDIMENSION)yoffset, MCU_col_num, + (JDIMENSION)cinfo->MCUs_per_row - MCU_col_num); + if (MCU_count != cinfo->MCUs_per_row - MCU_col_num) { + /* Suspension forced; update state counters and exit */ + diff->MCU_vert_offset = yoffset; + diff->mcu_ctr += MCU_col_num; + return FALSE; + } + + /* Completed an MCU row, but perhaps not an iMCU row */ + diff->mcu_ctr = 0; + } + + /* Completed the iMCU row, advance counters for next one */ + diff->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +#ifdef FULL_SAMP_BUFFER_SUPPORTED + +/* + * Process some data in the first pass of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the image. + * This amount of data is read from the source buffer and saved into the + * virtual arrays. + * + * We must also emit the data to the compressor. This is conveniently + * done by calling compress_output() after we've loaded the current strip + * of the virtual arrays. + * + * NB: input_buf contains a plane for each component in image. All components + * are loaded into the virtual arrays in this pass. However, it may be that + * only a subset of the components are emitted to the compressor during + * this first pass; be careful about looking at the scan-dependent variables + * (MCU dimensions, etc). + */ + +METHODDEF(boolean) +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION samps_across; + int ci, samp_row, samp_rows; + JSAMPARRAY buffer[MAX_COMPONENTS]; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffers for this component. */ + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + diff->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + + /* Count non-dummy sample rows in this iMCU row. */ + if (diff->iMCU_row_num < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + } + samps_across = compptr->width_in_data_units; + + /* Perform point transform scaling and prediction/differencing for all + * non-dummy rows in this iMCU row. Each call on these functions + * process a complete row of samples. + */ + for (samp_row = 0; samp_row < samp_rows; samp_row++) { + MEMCOPY(buffer[ci][samp_row], input_buf[ci][samp_row], + samps_across * SIZEOF(JSAMPLE)); + } + } + + /* NB: compress_output will increment iMCU_row_num if successful. + * A suspension return will result in redoing all the work above next time. + */ + + /* Emit data to the compressor, sharing code with subsequent passes */ + return compress_output(cinfo, input_buf); +} + + +/* + * Process some data in subsequent passes of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the compressor. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */ + /* JDIMENSION MCU_count; */ /* number of MCUs encoded */ + int comp, ci /* , yoffset */ ; + JSAMPARRAY buffer[MAX_COMPONENTS]; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. + * NB: during first pass, this is safe only because the buffers will + * already be aligned properly, so jmemmgr.c won't need to do any I/O. + */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + diff->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + return compress_data(cinfo, buffer); +} + +#endif /* FULL_SAMP_BUFFER_SUPPORTED */ + + +/* + * Initialize difference buffer controller. + */ + +GLOBAL(void) +jinit_c_diff_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff; + int ci, row; + jpeg_component_info *compptr; + + diff = (c_diff_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_diff_controller)); + losslsc->diff_private = (void *) diff; + losslsc->diff_start_pass = start_pass_diff; + + /* Create the prediction row buffers. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->cur_row[ci] = *(*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) 1); + diff->prev_row[ci] = *(*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) 1); + } + + /* Create the difference buffer. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->diff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + /* Prefill difference rows with zeros. We do this because only actual + * data is placed in the buffers during prediction/differencing, leaving + * any dummy differences at the right edge as zeros, which will encode + * to the smallest amount of data. + */ + for (row = 0; row < compptr->v_samp_factor; row++) + MEMZERO(diff->diff_buf[ci][row], + (size_t)jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor) * SIZEOF(JDIFF)); + } + + /* Create the sample buffer. */ + if (need_full_buffer) { +#ifdef FULL_SAMP_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor differences in each direction. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else + diff->whole_image[0] = NULL; /* flag for no virtual arrays */ +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jchuff.c b/dcmjpeg/libijg16/jchuff.c new file mode 100644 index 00000000..7c2f8d2a --- /dev/null +++ b/dcmjpeg/libijg16/jchuff.c @@ -0,0 +1,274 @@ +/* + * jchuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines which are shared + * by the sequential, progressive and lossless decoders. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jchuff16.h" /* Declarations shared with jc*huff.c */ + + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +GLOBAL(void) +jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, + c_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + c_derived_tbl *dtbl; + int p, i, l, lastp, si, maxsymbol; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (c_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_derived_tbl)); + dtbl = *pdtbl; + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + lastp = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + * BUG FIX: Comparison must be >, not >= + */ + if (((IJG_INT32) code) > (((IJG_INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure C.3: generate encoding tables */ + /* These are code and size indexed by symbol value */ + + /* Set all codeless symbols to have code length 0; + * this lets us detect duplicate VAL entries here, and later + * allows emit_bits to detect any attempt to emit such symbols. + */ + MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi)); + + /* This is also a convenient place to check for out-of-range + * and duplicated VAL entries. We allow 0..255 for AC symbols + * but only 0..16 for DC. (We could constrain them further + * based on data depth and mode, but this seems enough.) + */ + maxsymbol = isDC ? 16 : 255; + + for (p = 0; p < lastp; p++) { + i = htbl->huffval[p]; + if (i < 0 || i > maxsymbol || dtbl->ehufsi[i]) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + dtbl->ehufco[i] = huffcode[p]; + dtbl->ehufsi[i] = huffsize[p]; + } +} + + +/* + * Generate the best Huffman code table for the given counts, fill htbl. + * + * The JPEG standard requires that no symbol be assigned a codeword of all + * one bits (so that padding bits added at the end of a compressed segment + * can't look like a valid code). Because of the canonical ordering of + * codewords, this just means that there must be an unused slot in the + * longest codeword length category. Section K.2 of the JPEG spec suggests + * reserving such a slot by pretending that symbol 256 is a valid symbol + * with count 1. In theory that's not optimal; giving it count zero but + * including it in the symbol set anyway should give a better Huffman code. + * But the theoretically better code actually seems to come out worse in + * practice, because it produces more all-ones bytes (which incur stuffed + * zero bytes in the final file). In any case the difference is tiny. + * + * The JPEG standard requires Huffman codes to be no more than 16 bits long. + * If some symbols have a very small but nonzero probability, the Huffman tree + * must be adjusted to meet the code length restriction. We currently use + * the adjustment method suggested in JPEG section K.2. This method is *not* + * optimal; it may not choose the best possible limited-length code. But + * typically only very-low-frequency symbols will be given less-than-optimal + * lengths, so the code is almost optimal. Experimental comparisons against + * an optimal limited-length-code algorithm indicate that the difference is + * microscopic --- usually less than a hundredth of a percent of total size. + * So the extra complexity of an optimal algorithm doesn't seem worthwhile. + */ + +GLOBAL(void) +jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) +{ +#define MAX_CLEN 32 /* assumed maximum initial code length */ + UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ + int codesize[257]; /* codesize[k] = code length of symbol k */ + int others[257]; /* next symbol in current branch of tree */ + int c1, c2; + int p, i, j; + long v; + + /* This algorithm is explained in section K.2 of the JPEG standard */ + + MEMZERO(bits, SIZEOF(bits)); + MEMZERO(codesize, SIZEOF(codesize)); + for (i = 0; i < 257; i++) + others[i] = -1; /* init links to empty */ + + freq[256] = 1; /* make sure 256 has a nonzero count */ + /* Including the pseudo-symbol 256 in the Huffman procedure guarantees + * that no real symbol is given code-value of all ones, because 256 + * will be placed last in the largest codeword category. + */ + + /* Huffman's basic algorithm to assign optimal code lengths to symbols */ + + for (;;) { + /* Find the smallest nonzero frequency, set c1 = its symbol */ + /* In case of ties, take the larger symbol number */ + c1 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v) { + v = freq[i]; + c1 = i; + } + } + + /* Find the next smallest nonzero frequency, set c2 = its symbol */ + /* In case of ties, take the larger symbol number */ + c2 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v && i != c1) { + v = freq[i]; + c2 = i; + } + } + + /* Done if we've merged everything into one frequency */ + if (c2 < 0) + break; + + /* Else merge the two counts/trees */ + freq[c1] += freq[c2]; + freq[c2] = 0; + + /* Increment the codesize of everything in c1's tree branch */ + codesize[c1]++; + while (others[c1] >= 0) { + c1 = others[c1]; + codesize[c1]++; + } + + others[c1] = c2; /* chain c2 onto c1's tree branch */ + + /* Increment the codesize of everything in c2's tree branch */ + codesize[c2]++; + while (others[c2] >= 0) { + c2 = others[c2]; + codesize[c2]++; + } + } + + /* Now count the number of symbols of each code length */ + for (i = 0; i <= 256; i++) { + if (codesize[i]) { + /* The JPEG standard seems to think that this can't happen, */ + /* but I'm paranoid... */ + if (codesize[i] > MAX_CLEN) + ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW); + + bits[codesize[i]]++; + } + } + + /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure + * Huffman procedure assigned any such lengths, we must adjust the coding. + * Here is what the JPEG spec says about how this next bit works: + * Since symbols are paired for the longest Huffman code, the symbols are + * removed from this length category two at a time. The prefix for the pair + * (which is one bit shorter) is allocated to one of the pair; then, + * skipping the BITS entry for that prefix length, a code word from the next + * shortest nonzero BITS entry is converted into a prefix for two code words + * one bit longer. + */ + + for (i = MAX_CLEN; i > 16; i--) { + while (bits[i] > 0) { + j = i - 2; /* find length of new prefix to be used */ + while (bits[j] == 0) + j--; + + bits[i] = (UINT8)(bits[i] - 2); /* remove two symbols */ + bits[i-1]++; /* one goes in this length */ + bits[j+1] = (UINT8)(bits[j+1] + 2); /* two new symbols in this length */ + bits[j]--; /* symbol of this length is now a prefix */ + } + } + + /* Remove the count for the pseudo-symbol 256 from the largest codelength */ + while (bits[i] == 0) /* find largest codelength still in use */ + i--; + bits[i]--; + + /* Return final symbol counts (only for lengths 0..16) */ + MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); + + /* Return a list of the symbols sorted by code length */ + /* It's not real clear to me why we don't need to consider the codelength + * changes made above, but the JPEG spec seems to think this works. + */ + p = 0; + for (i = 1; i <= MAX_CLEN; i++) { + for (j = 0; j <= 255; j++) { + if (codesize[j] == i) { + htbl->huffval[p] = (UINT8) j; + p++; + } + } + } + + /* Set sent_table FALSE so updated table will be written to JPEG file. */ + htbl->sent_table = FALSE; +} diff --git a/dcmjpeg/libijg16/jchuff16.h b/dcmjpeg/libijg16/jchuff16.h new file mode 100644 index 00000000..ae20505f --- /dev/null +++ b/dcmjpeg/libijg16/jchuff16.h @@ -0,0 +1,54 @@ +/* + * jchuff.h + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains declarations for Huffman entropy encoding routines + * that are shared between the sequential encoder (jchuff.c) and the + * progressive encoder (jcphuff.c). No other modules need to see these. + */ + +/* The legal range of a DCT coefficient is + * -1024 .. +1023 for 8-bit data; + * -16384 .. +16383 for 12-bit data. + * Hence the magnitude should always fit in 10 or 14 bits respectively. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MAX_COEF_BITS 10 +#else +#define MAX_COEF_BITS 14 +#endif + +/* The legal range of a spatial difference is + * -32767 .. +32768. + * Hence the magnitude should always fit in 16 bits. + */ + +#define MAX_DIFF_BITS 16 + +/* Derived data constructed for each Huffman table */ + +typedef struct { + unsigned int ehufco[256]; /* code for each symbol */ + char ehufsi[256]; /* length of code for each symbol */ + /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ +} c_derived_tbl; + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_make_c_derived_tbl jpeg16_make_c_derived_tbl +#define jpeg_gen_optimal_table jpeg16_gen_optimal_table +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Expand a Huffman table definition into the derived format */ +EXTERN(void) jpeg_make_c_derived_tbl + JPP((j_compress_ptr cinfo, boolean isDC, int tblno, + c_derived_tbl ** pdtbl)); + +/* Generate an optimal table definition given the specified counts */ +EXTERN(void) jpeg_gen_optimal_table + JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])); diff --git a/dcmjpeg/libijg16/jcinit.c b/dcmjpeg/libijg16/jcinit.c new file mode 100644 index 00000000..93fe7021 --- /dev/null +++ b/dcmjpeg/libijg16/jcinit.c @@ -0,0 +1,57 @@ +/* + * jcinit.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains initialization logic for the JPEG compressor. + * This routine is in charge of selecting the modules to be executed and + * making an initialization call to each one. + * + * Logically, this code belongs in jcmaster.c. It's split out because + * linking this routine implies linking the entire compression library. + * For a transcoding-only application, we want to be able to use jcmaster.c + * without linking in the whole library. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Master selection of compression modules. + * This is done once at the start of processing an image. We determine + * which modules will be used and give them appropriate initialization calls. + */ + +GLOBAL(void) +jinit_compress_master (j_compress_ptr cinfo) +{ + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, FALSE /* full compression */); + + /* Initialize compression codec */ + jinit_c_codec(cinfo); + + /* Preprocessing */ + if (! cinfo->raw_data_in) { + jinit_color_converter(cinfo); + jinit_downsampler(cinfo); + jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); + } + + jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} diff --git a/dcmjpeg/libijg16/jclhuff.c b/dcmjpeg/libijg16/jclhuff.c new file mode 100644 index 00000000..93554b20 --- /dev/null +++ b/dcmjpeg/libijg16/jclhuff.c @@ -0,0 +1,601 @@ +/* + * jclhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for lossless JPEG. + * + * Much of the complexity here has to do with supporting output suspension. + * If the data destination module demands suspension, we want to be able to + * back up to the start of the current MCU. To do this, we copy state + * variables into local working storage, and update them back to the + * permanent JPEG objects only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" /* Private declarations for lossless codec */ +#include "jchuff16.h" /* Declarations shared with jc*huff.c */ + + +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#define ASSIGN_STATE(dest,src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits) +#endif + + +typedef struct { + int ci, yoffset, MCU_width; +} lhe_input_ptr_info; + + +typedef struct { + savable_state saved; /* Bit buffer at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Pointers to derived tables to be used for each data unit within an MCU */ + c_derived_tbl * cur_tbls[C_MAX_DATA_UNITS_IN_MCU]; + +#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ + long * count_ptrs[NUM_HUFF_TBLS]; + + /* Pointers to stats tables to be used for each data unit within an MCU */ + long * cur_counts[C_MAX_DATA_UNITS_IN_MCU]; +#endif + + /* Pointers to the proper input difference row for each group of data units + * within an MCU. For each component, there are Vi groups of Hi data units. + */ + JDIFFROW input_ptr[C_MAX_DATA_UNITS_IN_MCU]; + + /* Number of input pointers in use for the current MCU. This is the sum + * of all Vi in the MCU. + */ + int num_input_ptrs; + + /* Information used for positioning the input pointers within the input + * difference rows. + */ + lhe_input_ptr_info input_ptr_info[C_MAX_DATA_UNITS_IN_MCU]; + + /* Index of the proper input pointer for each data unit within an MCU */ + int input_ptr_index[C_MAX_DATA_UNITS_IN_MCU]; + +} lhuff_entropy_encoder; + +typedef lhuff_entropy_encoder * lhuff_entropy_ptr; + +/* Working state while writing an MCU. + * This struct contains all the fields that are needed by subroutines. + */ + +typedef struct { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ +} working_state; + + +/* Forward declarations */ +METHODDEF(JDIMENSION) encode_mcus_huff (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU); +METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); +#ifdef ENTROPY_OPT_SUPPORTED +METHODDEF(JDIMENSION) encode_mcus_gather (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU); +METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); +#endif + + +/* + * Initialize for a Huffman-compressed scan. + * If gather_statistics is TRUE, we do not output anything during the scan, + * just count the Huffman symbols used and generate Huffman code tables. + */ + +METHODDEF(void) +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + int ci, dctbl, sampn, ptrn, yoffset, xoffset; + jpeg_component_info * compptr; + + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + losslsc->entropy_encode_mcus = encode_mcus_gather; + losslsc->pub.entropy_finish_pass = finish_pass_gather; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + losslsc->entropy_encode_mcus = encode_mcus_huff; + losslsc->pub.entropy_finish_pass = finish_pass_huff; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + /* Check for invalid table indexes */ + /* (make_c_derived_tbl does this in the other path) */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->count_ptrs[dctbl] == NULL) + entropy->count_ptrs[dctbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->count_ptrs[dctbl], 257 * SIZEOF(long)); +#endif + } else { + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, + & entropy->derived_tbls[dctbl]); + } + } + + /* Precalculate encoding info for each sample in an MCU of this scan */ + for (sampn = 0, ptrn = 0; sampn < cinfo->data_units_in_MCU;) { + compptr = cinfo->cur_comp_info[cinfo->MCU_membership[sampn]]; + ci = compptr->component_index; + /* ci = cinfo->MCU_membership[sampn]; + compptr = cinfo->cur_comp_info[ci];*/ + for (yoffset = 0; yoffset < compptr->MCU_height; yoffset++, ptrn++) { + /* Precalculate the setup info for each input pointer */ + entropy->input_ptr_info[ptrn].ci = ci; + entropy->input_ptr_info[ptrn].yoffset = yoffset; + entropy->input_ptr_info[ptrn].MCU_width = compptr->MCU_width; + for (xoffset = 0; xoffset < compptr->MCU_width; xoffset++, sampn++) { + /* Precalculate the input pointer index for each sample */ + entropy->input_ptr_index[sampn] = ptrn; + /* Precalculate which tables to use for each sample */ + entropy->cur_tbls[sampn] = entropy->derived_tbls[compptr->dc_tbl_no]; + entropy->cur_counts[sampn] = entropy->count_ptrs[compptr->dc_tbl_no]; + } + } + } + entropy->num_input_ptrs = ptrn; + + /* Initialize bit buffer to empty */ + entropy->saved.put_buffer = 0; + entropy->saved.put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file */ + +/* Emit a byte, taking 'action' if must suspend. */ +#define emit_byte(state,val,action) \ + { *(state)->next_output_byte++ = (JOCTET) (val); \ + if (--(state)->free_in_buffer == 0) \ + if (! dump_buffer(state)) \ + { action; } } + + +LOCAL(boolean) +dump_buffer (working_state * state) +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +{ + struct jpeg_destination_mgr * dest = state->cinfo->dest; + + if (! (*dest->empty_output_buffer) (state->cinfo)) + return FALSE; + /* After a successful buffer dump, must reset buffer pointers */ + state->next_output_byte = dest->next_output_byte; + state->free_in_buffer = dest->free_in_buffer; + return TRUE; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(boolean) +emit_bits (working_state * state, unsigned int code, int size) +/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = state->cur.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); + + put_buffer &= (((IJG_INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(state, c, return FALSE); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(state, 0, return FALSE); + } + put_buffer <<= 8; + put_bits -= 8; + } + + state->cur.put_buffer = put_buffer; /* update state variables */ + state->cur.put_bits = put_bits; + + return TRUE; +} + + +LOCAL(boolean) +flush_bits (working_state * state) +{ + if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ + return FALSE; + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ + state->cur.put_bits = 0; + return TRUE; +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(boolean) +emit_restart (working_state * state, int restart_num) +{ + /* int ci; */ + + if (! flush_bits(state)) + return FALSE; + + emit_byte(state, 0xFF, return FALSE); + emit_byte(state, JPEG_RST0 + restart_num, return FALSE); + + /* The restart counter is not updated until we successfully write the MCU. */ + + return TRUE; +} + + +/* + * Encode and output one nMCU's worth of Huffman-compressed differences. + */ + +METHODDEF(JDIMENSION) +encode_mcus_huff (j_compress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, + JDIMENSION nMCU) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + working_state state; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + /* jpeg_component_info * compptr; */ + + /* Load up working state */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! emit_restart(&state, entropy->next_restart_num)) + return 0; + } + + /* Set input pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_input_ptrs; ptrn++) { + ci = entropy->input_ptr_info[ptrn].ci; + yoffset = entropy->input_ptr_info[ptrn].yoffset; + MCU_width = entropy->input_ptr_info[ptrn].MCU_width; + entropy->input_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (size_t)yoffset] + MCU_col_num * (size_t)MCU_width; + } + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + register int temp, temp2 /* , temp3 */ ; + register int nbits; + c_derived_tbl *dctbl = entropy->cur_tbls[sampn]; + + /* Encode the difference per section H.1.2.2 */ + + /* Input the sample difference */ + temp = *entropy->input_ptr[entropy->input_ptr_index[sampn]]++; + + if (temp & 0x8000) { /* instead of temp < 0 */ + temp = (-temp) & 0x7FFF; /* absolute value, mod 2^16 */ + if (temp == 0) /* special case: magnitude = 32768 */ + temp2 = temp = 0x8000; + temp2 = ~ temp; /* one's complement of magnitude */ + } else { + temp &= 0x7FFF; /* abs value mod 2^16 */ + temp2 = temp; /* magnitude */ + } + + /* Find the number of bits needed for the magnitude of the difference */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range difference values. + */ + if (nbits > MAX_DIFF_BITS) + ERREXIT(cinfo, JERR_BAD_DIFF); + + /* Emit the Huffman-coded symbol for the number of bits */ + if (! emit_bits(&state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) + return mcu_num; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits && /* emit_bits rejects calls with size 0 */ + nbits != 16) /* special case: no bits should be emitted */ + if (! emit_bits(&state, (unsigned int) temp2, nbits)) + return mcu_num; + } + + /* Completed MCU, so update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + } + + return nMCU; +} + + +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + working_state state; + + /* Load up working state ... flush_bits needs it */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Flush out the last data */ + if (! flush_bits(&state)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); +} + + +/* + * Huffman coding optimization. + * + * We first scan the supplied data and count the number of uses of each symbol + * that is to be Huffman-coded. (This process MUST agree with the code above.) + * Then we build a Huffman coding tree for the observed counts. + * Symbols which are not needed at all for the particular image are not + * assigned any code, which saves space in the DHT marker as well as in + * the compressed data. + */ + +#ifdef ENTROPY_OPT_SUPPORTED + +/* + * Trial-encode one nMCU's worth of Huffman-compressed differences. + * No data is actually output, so no suspension return is possible. + */ + +METHODDEF(JDIMENSION) +encode_mcus_gather (j_compress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, + JDIMENSION nMCU) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + /* jpeg_component_info * compptr; */ + + /* Take care of restart intervals if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + /* Update restart state */ + entropy->restarts_to_go = cinfo->restart_interval; + } + entropy->restarts_to_go--; + } + + /* Set input pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_input_ptrs; ptrn++) { + ci = entropy->input_ptr_info[ptrn].ci; + yoffset = entropy->input_ptr_info[ptrn].yoffset; + MCU_width = entropy->input_ptr_info[ptrn].MCU_width; + entropy->input_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (size_t)yoffset] + MCU_col_num * (size_t)MCU_width; + } + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + register int temp; + register int nbits; + /* c_derived_tbl *dctbl = entropy->cur_tbls[sampn]; */ + long * counts = entropy->cur_counts[sampn]; + + /* Encode the difference per section H.1.2.2 */ + + /* Input the sample difference */ + temp = *entropy->input_ptr[entropy->input_ptr_index[sampn]]++; + + if (temp & 0x8000) { /* instead of temp < 0 */ + temp = (-temp) & 0x7FFF; /* absolute value, mod 2^16 */ + if (temp == 0) /* special case: magnitude = 32768 */ + temp = 0x8000; + } else + temp &= 0x7FFF; /* abs value mod 2^16 */ + + /* Find the number of bits needed for the magnitude of the difference */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range difference values. + */ + if (nbits > MAX_DIFF_BITS) + ERREXIT(cinfo, JERR_BAD_DIFF); + + /* Count the Huffman symbol for the number of bits */ + counts[nbits]++; + } + } + + return nMCU; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + int ci, dctbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did_dc[NUM_HUFF_TBLS]; + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did_dc, SIZEOF(did_dc)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + if (! did_dc[dctbl]) { + htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[dctbl]); + did_dc[dctbl] = TRUE; + } + } +} + + +#endif /* ENTROPY_OPT_SUPPORTED */ + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_lhuff_encoder (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy; + int i; + + entropy = (lhuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(lhuff_entropy_encoder)); + losslsc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + losslsc->pub.entropy_start_pass = start_pass_huff; + losslsc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; +#ifdef ENTROPY_OPT_SUPPORTED + entropy->count_ptrs[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg16/jclossls.c b/dcmjpeg/libijg16/jclossls.c new file mode 100644 index 00000000..0ccc72cb --- /dev/null +++ b/dcmjpeg/libijg16/jclossls.c @@ -0,0 +1,82 @@ +/* + * jclossls.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossless JPEG compressor. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" + + +#ifdef C_LOSSLESS_SUPPORTED + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + (*losslsc->scaler_start_pass) (cinfo); + (*losslsc->predict_start_pass) (cinfo); + (*losslsc->diff_start_pass) (cinfo, pass_mode); +} + + +/* + * Initialize the lossless compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossless_c_codec(j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc; + + /* Create subobject in permanent pool */ + losslsc = (j_lossless_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossless_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) losslsc; + + /* Initialize sub-modules */ + + /* Scaler */ + jinit_c_scaler(cinfo); + + /* Differencer */ + jinit_differencer(cinfo); + + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + jinit_lhuff_encoder(cinfo); + } + + /* Need a full-image difference buffer in any multi-pass mode. */ + jinit_c_diff_controller(cinfo, + (boolean) (cinfo->num_scans > 1 || + cinfo->optimize_coding)); + + /* Initialize method pointers. + * + * Note: entropy_start_pass and entropy_finish_pass are assigned in + * jclhuff.c and compress_data is assigned in jcdiffct.c. + */ + losslsc->pub.start_pass = start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jclossy.c b/dcmjpeg/libijg16/jclossy.c new file mode 100644 index 00000000..2602f8be --- /dev/null +++ b/dcmjpeg/libijg16/jclossy.c @@ -0,0 +1,76 @@ +/* + * jclossy.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossy JPEG compressor. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + + (*lossyc->fdct_start_pass) (cinfo); + (*lossyc->coef_start_pass) (cinfo, pass_mode); +} + + +/* + * Initialize the lossy compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossy_c_codec (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc; + + /* Create subobject in permanent pool */ + lossyc = (j_lossy_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) lossyc; + + /* Initialize sub-modules */ + + /* Forward DCT */ + jinit_forward_dct(cinfo); + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + jinit_phuff_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_encoder(cinfo); + } + + /* Need a full-image coefficient buffer in any multi-pass mode. */ + jinit_c_coef_controller(cinfo, + (boolean) (cinfo->num_scans > 1 || + cinfo->optimize_coding)); + + /* Initialize method pointers. + * + * Note: entropy_start_pass and entropy_finish_pass are assigned in + * jcshuff.c or jcphuff.c and compress_data is assigned in jccoefct.c. + */ + lossyc->pub.start_pass = start_pass; +} diff --git a/dcmjpeg/libijg16/jcmainct.c b/dcmjpeg/libijg16/jcmainct.c new file mode 100644 index 00000000..0a360aad --- /dev/null +++ b/dcmjpeg/libijg16/jcmainct.c @@ -0,0 +1,296 @@ +/* + * jcmainct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for compression. + * The main buffer lies between the pre-processor and the JPEG + * compressor proper; it holds downsampled data in the JPEG colorspace. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Note: currently, there is no operating mode in which a full-image buffer + * is needed at this step. If there were, that mode could not be used with + * "raw data" input, since this module is bypassed in that case. However, + * we've left the code here for possible use in special applications. + */ +#undef FULL_MAIN_BUFFER_SUPPORTED + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_main_controller pub; /* public fields */ + + JDIMENSION cur_iMCU_row; /* number of current iMCU row */ + JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */ + boolean suspended; /* remember if we suspended output */ + J_BUF_MODE pass_mode; /* current operating mode */ + + /* If using just a strip buffer, this points to the entire set of buffers + * (we allocate one for each component). In the full-image case, this + * points to the currently accessible strips of the virtual arrays. + */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* If using full-image storage, this array holds pointers to virtual-array + * control blocks for each component. Unused if not full-image storage. + */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +#endif +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#ifdef FULL_MAIN_BUFFER_SUPPORTED +METHODDEF(void) process_data_buffer_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + /* Do nothing in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + mymain->cur_iMCU_row = 0; /* initialize counters */ + mymain->rowgroup_ctr = 0; + mymain->suspended = FALSE; + mymain->pass_mode = pass_mode; /* save mode for use by process_data */ + + switch (pass_mode) { + case JBUF_PASS_THRU: +#ifdef FULL_MAIN_BUFFER_SUPPORTED + if (mymain->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + mymain->pub.process_data = process_data_simple_main; + break; +#ifdef FULL_MAIN_BUFFER_SUPPORTED + case JBUF_SAVE_SOURCE: + case JBUF_CRANK_DEST: + case JBUF_SAVE_AND_PASS: + if (mymain->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + mymain->pub.process_data = process_data_buffer_main; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This routine handles the simple pass-through mode, + * where we have only a strip buffer. + */ + +METHODDEF(void) +process_data_simple_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); + + while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Read input data if we haven't filled the main buffer yet */ + if (mymain->rowgroup_ctr < data_unit) + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mymain->buffer, &mymain->rowgroup_ctr, + (JDIMENSION) data_unit); + + /* If we don't have a full iMCU row buffered, return to application for + * more data. Note that preprocessor will always pad to fill the iMCU row + * at the bottom of the image. + */ + if (mymain->rowgroup_ctr != data_unit) + return; + + /* Send the completed row to the compressor */ + if (! (*cinfo->codec->compress_data) (cinfo, mymain->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mymain->suspended) { + (*in_row_ctr)--; + mymain->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mymain->suspended) { + (*in_row_ctr)++; + mymain->suspended = FALSE; + } + mymain->rowgroup_ctr = 0; + mymain->cur_iMCU_row++; + } +} + + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + +/* + * Process some data. + * This routine handles all of the modes that use a full-size buffer. + */ + +METHODDEF(void) +process_data_buffer_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci; + jpeg_component_info *compptr; + boolean writing = (mymain->pass_mode != JBUF_CRANK_DEST); + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); + + while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Realign the virtual buffers if at the start of an iMCU row. */ + if (mymain->rowgroup_ctr == 0) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, mymain->whole_image[ci], + mymain->cur_iMCU_row * (compptr->v_samp_factor * data_unit), + (JDIMENSION) (compptr->v_samp_factor * data_unit), writing); + } + /* In a read pass, pretend we just read some source data. */ + if (! writing) { + *in_row_ctr += cinfo->max_v_samp_factor * data_unit; + mymain->rowgroup_ctr = data_unit; + } + } + + /* If a write pass, read input data until the current iMCU row is full. */ + /* Note: preprocessor will pad if necessary to fill the last iMCU row. */ + if (writing) { + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mymain->buffer, &mymain->rowgroup_ctr, + (JDIMENSION) data_unit); + /* Return to application if we need more data to fill the iMCU row. */ + if (mymain->rowgroup_ctr < data_unit) + return; + } + + /* Emit data, unless this is a sink-only pass. */ + if (mymain->pass_mode != JBUF_SAVE_SOURCE) { + if (! (*cinfo->codec->compress_data) (cinfo, mymain->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mymain->suspended) { + (*in_row_ctr)--; + mymain->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mymain->suspended) { + (*in_row_ctr)++; + mymain->suspended = FALSE; + } + } + + /* If get here, we are done with this iMCU row. Mark buffer empty. */ + mymain->rowgroup_ctr = 0; + mymain->cur_iMCU_row++; + } +} + +#endif /* FULL_MAIN_BUFFER_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mymain; + int ci; + jpeg_component_info *compptr; + int data_unit = cinfo->data_unit; + + mymain = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = (struct jpeg_c_main_controller *) mymain; + mymain->pub.start_pass = start_pass_main; + + /* We don't need to create a buffer in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + /* Create the buffer. It holds downsampled data, so each component + * may be of a different size. + */ + if (need_full_buffer) { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component */ + /* Note we pad the bottom to a multiple of the iMCU height */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + compptr->width_in_data_units * data_unit, + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor) * data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + mymain->whole_image[0] = NULL; /* flag for no virtual arrays */ +#endif + /* Allocate a strip buffer for each component */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_data_units * (JDIMENSION)data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); + } + } +} diff --git a/dcmjpeg/libijg16/jcmarker.c b/dcmjpeg/libijg16/jcmarker.c new file mode 100644 index 00000000..2432ca9d --- /dev/null +++ b/dcmjpeg/libijg16/jcmarker.c @@ -0,0 +1,680 @@ +/* + * jcmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write JPEG datastream markers. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_writer pub; /* public fields */ + + unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */ +} my_marker_writer; + +typedef my_marker_writer * my_marker_ptr; + + +/* + * Basic output routines. + * + * Note that we do not support suspension while writing a marker. + * Therefore, an application using suspension must ensure that there is + * enough buffer space for the initial markers (typ. 600-700 bytes) before + * calling jpeg_start_compress, and enough space to write the trailing EOI + * (a few bytes) before calling jpeg_finish_compress. Multipass compression + * modes are not supported at all with suspension, so those two are the only + * points where markers will be written. + */ + +LOCAL(void) +emit_byte (j_compress_ptr cinfo, int val) +/* Emit a byte */ +{ + struct jpeg_destination_mgr * dest = cinfo->dest; + + *(dest->next_output_byte)++ = (JOCTET) val; + if (--dest->free_in_buffer == 0) { + if (! (*dest->empty_output_buffer) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } +} + + +LOCAL(void) +emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark) +/* Emit a marker code */ +{ + emit_byte(cinfo, 0xFF); + emit_byte(cinfo, (int) mark); +} + + +LOCAL(void) +emit_2bytes (j_compress_ptr cinfo, int value) +/* Emit a 2-byte integer; these are always MSB first in JPEG files */ +{ + emit_byte(cinfo, (value >> 8) & 0xFF); + emit_byte(cinfo, value & 0xFF); +} + + +/* + * Routines to write specific marker types. + */ + +LOCAL(int) +emit_dqt (j_compress_ptr cinfo, int idx) +/* Emit a DQT marker */ +/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ +{ + JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[idx]; + int prec; + int i; + + if (qtbl == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, idx); + + prec = 0; + for (i = 0; i < DCTSIZE2; i++) { + if (qtbl->quantval[i] > 255) + prec = 1; + } + + if (! qtbl->sent_table) { + emit_marker(cinfo, M_DQT); + + emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2); + + emit_byte(cinfo, idx + (prec<<4)); + + for (i = 0; i < DCTSIZE2; i++) { + /* The table entries must be emitted in zigzag order. */ + unsigned int qval = qtbl->quantval[jpeg_natural_order[i]]; + if (prec) + emit_byte(cinfo, (int) (qval >> 8)); + emit_byte(cinfo, (int) (qval & 0xFF)); + } + + qtbl->sent_table = TRUE; + } + + return prec; +} + + +LOCAL(void) +emit_dht (j_compress_ptr cinfo, int idx, boolean is_ac) +/* Emit a DHT marker */ +{ + JHUFF_TBL * htbl; + int length, i; + + if (is_ac) { + htbl = cinfo->ac_huff_tbl_ptrs[idx]; + idx += 0x10; /* output index has AC bit set */ + } else { + htbl = cinfo->dc_huff_tbl_ptrs[idx]; + } + + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, idx); + + if (! htbl->sent_table) { + emit_marker(cinfo, M_DHT); + + length = 0; + for (i = 1; i <= 16; i++) + length += htbl->bits[i]; + + emit_2bytes(cinfo, length + 2 + 1 + 16); + emit_byte(cinfo, idx); + + for (i = 1; i <= 16; i++) + emit_byte(cinfo, htbl->bits[i]); + + for (i = 0; i < length; i++) + emit_byte(cinfo, htbl->huffval[i]); + + htbl->sent_table = TRUE; + } +} + + +LOCAL(void) +emit_dac (j_compress_ptr cinfo) +/* Emit a DAC marker */ +/* Since the useful info is so small, we want to emit all the tables in */ +/* one DAC marker. Therefore this routine does its own scan of the table. */ +{ +#ifdef C_ARITH_CODING_SUPPORTED + char dc_in_use[NUM_ARITH_TBLS]; + char ac_in_use[NUM_ARITH_TBLS]; + int length, i; + jpeg_component_info *compptr; + + for (i = 0; i < NUM_ARITH_TBLS; i++) + dc_in_use[i] = ac_in_use[i] = 0; + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + dc_in_use[compptr->dc_tbl_no] = 1; + ac_in_use[compptr->ac_tbl_no] = 1; + } + + length = 0; + for (i = 0; i < NUM_ARITH_TBLS; i++) + length += dc_in_use[i] + ac_in_use[i]; + + emit_marker(cinfo, M_DAC); + + emit_2bytes(cinfo, length*2 + 2); + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + if (dc_in_use[i]) { + emit_byte(cinfo, i); + emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); + } + if (ac_in_use[i]) { + emit_byte(cinfo, i + 0x10); + emit_byte(cinfo, cinfo->arith_ac_K[i]); + } + } +#endif /* C_ARITH_CODING_SUPPORTED */ +} + + +LOCAL(void) +emit_dri (j_compress_ptr cinfo) +/* Emit a DRI marker */ +{ + emit_marker(cinfo, M_DRI); + + emit_2bytes(cinfo, 4); /* fixed length */ + + emit_2bytes(cinfo, (int) cinfo->restart_interval); +} + + +LOCAL(void) +emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) +/* Emit a SOF marker */ +{ + int ci; + jpeg_component_info *compptr; + + emit_marker(cinfo, code); + + emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ + + /* Make sure image isn't bigger than SOF field can handle */ + if ((long) cinfo->image_height > 65535L || + (long) cinfo->image_width > 65535L) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535); + + emit_byte(cinfo, cinfo->data_precision); + emit_2bytes(cinfo, (int) cinfo->image_height); + emit_2bytes(cinfo, (int) cinfo->image_width); + + emit_byte(cinfo, cinfo->num_components); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + emit_byte(cinfo, compptr->component_id); + emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor); + emit_byte(cinfo, compptr->quant_tbl_no); + } +} + + +LOCAL(void) +emit_sos (j_compress_ptr cinfo) +/* Emit a SOS marker */ +{ + int i, td, ta; + jpeg_component_info *compptr; + + emit_marker(cinfo, M_SOS); + + emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ + + emit_byte(cinfo, cinfo->comps_in_scan); + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + emit_byte(cinfo, compptr->component_id); + td = compptr->dc_tbl_no; + ta = compptr->ac_tbl_no; + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Progressive mode: only DC or only AC tables are used in one scan; + * furthermore, Huffman coding of DC refinement uses no table at all. + * We emit 0 for unused field(s); this is recommended by the P&M text + * but does not seem to be specified in the standard. + */ + if (cinfo->Ss == 0) { + ta = 0; /* DC scan */ + if (cinfo->Ah != 0 && !cinfo->arith_code) + td = 0; /* no DC table either */ + } else { + td = 0; /* AC scan */ + } + } + emit_byte(cinfo, (td << 4) + ta); + } + + emit_byte(cinfo, cinfo->Ss); + emit_byte(cinfo, cinfo->Se); + emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al); +} + + +LOCAL(void) +emit_jfif_app0 (j_compress_ptr cinfo) +/* Emit a JFIF-compliant APP0 marker */ +{ + /* + * Length of APP0 block (2 bytes) + * Block ID (4 bytes - ASCII "JFIF") + * Zero byte (1 byte to terminate the ID string) + * Version Major, Minor (2 bytes - major first) + * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) + * Xdpu (2 bytes - dots per unit horizontal) + * Ydpu (2 bytes - dots per unit vertical) + * Thumbnail X size (1 byte) + * Thumbnail Y size (1 byte) + */ + + emit_marker(cinfo, M_APP0); + + emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ + + emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0x49); + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0); + emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */ + emit_byte(cinfo, cinfo->JFIF_minor_version); + emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */ + emit_2bytes(cinfo, (int) cinfo->X_density); + emit_2bytes(cinfo, (int) cinfo->Y_density); + emit_byte(cinfo, 0); /* No thumbnail image */ + emit_byte(cinfo, 0); +} + + +LOCAL(void) +emit_adobe_app14 (j_compress_ptr cinfo) +/* Emit an Adobe APP14 marker */ +{ + /* + * Length of APP14 block (2 bytes) + * Block ID (5 bytes - ASCII "Adobe") + * Version Number (2 bytes - currently 100) + * Flags0 (2 bytes - currently 0) + * Flags1 (2 bytes - currently 0) + * Color transform (1 byte) + * + * Although Adobe TN 5116 mentions Version = 101, all the Adobe files + * now in circulation seem to use Version = 100, so that's what we write. + * + * We write the color transform byte as 1 if the JPEG color space is + * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with + * whether the encoder performed a transformation, which is pretty useless. + */ + + emit_marker(cinfo, M_APP14); + + emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */ + + emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */ + emit_byte(cinfo, 0x64); + emit_byte(cinfo, 0x6F); + emit_byte(cinfo, 0x62); + emit_byte(cinfo, 0x65); + emit_2bytes(cinfo, 100); /* Version */ + emit_2bytes(cinfo, 0); /* Flags0 */ + emit_2bytes(cinfo, 0); /* Flags1 */ + switch (cinfo->jpeg_color_space) { + case JCS_YCbCr: + emit_byte(cinfo, 1); /* Color transform = 1 */ + break; + case JCS_YCCK: + emit_byte(cinfo, 2); /* Color transform = 2 */ + break; + default: + emit_byte(cinfo, 0); /* Color transform = 0 */ + break; + } +} + + +/* + * These routines allow writing an arbitrary marker with parameters. + * The only intended use is to emit COM or APPn markers after calling + * write_file_header and before calling write_frame_header. + * Other uses are not guaranteed to produce desirable results. + * Counting the parameter bytes properly is the caller's responsibility. + */ + +METHODDEF(void) +write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +/* Emit an arbitrary marker header */ +{ + if (datalen > (unsigned int) 65533) /* safety check */ + ERREXIT(cinfo, JERR_BAD_LENGTH); + + emit_marker(cinfo, (JPEG_MARKER) marker); + + emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */ +} + +METHODDEF(void) +write_marker_byte (j_compress_ptr cinfo, int val) +/* Emit one byte of marker parameters following write_marker_header */ +{ + emit_byte(cinfo, val); +} + + +/* + * Write datastream header. + * This consists of an SOI and optional APPn markers. + * We recommend use of the JFIF marker, but not the Adobe marker, + * when using YCbCr or grayscale data. The JFIF marker should NOT + * be used for any other JPEG colorspace. The Adobe marker is helpful + * to distinguish RGB, CMYK, and YCCK colorspaces. + * Note that an application can write additional header markers after + * jpeg_start_compress returns. + */ + +METHODDEF(void) +write_file_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + emit_marker(cinfo, M_SOI); /* first the SOI */ + + /* SOI is defined to reset restart interval to 0 */ + marker->last_restart_interval = 0; + + if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */ + emit_jfif_app0(cinfo); + if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */ + emit_adobe_app14(cinfo); +} + + +/* + * Write frame header. + * This consists of DQT and SOFn markers. + * Note that we do not emit the SOF until we have emitted the DQT(s). + * This avoids compatibility problems with incorrect implementations that + * try to error-check the quant table numbers as soon as they see the SOF. + */ + +METHODDEF(void) +write_frame_header (j_compress_ptr cinfo) +{ + int ci, prec; + boolean is_baseline; + jpeg_component_info *compptr; + + prec = 0; + if (cinfo->process != JPROC_LOSSLESS) { + /* Emit DQT for each quantization table. + * Note that emit_dqt() suppresses any duplicate tables. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prec += emit_dqt(cinfo, compptr->quant_tbl_no); + } + /* now prec is nonzero iff there are any 16-bit quant tables. */ + } + + /* Check for a non-baseline specification. + * Note we assume that Huffman table numbers won't be changed later. + */ + if (cinfo->arith_code || cinfo->process != JPROC_SEQUENTIAL || + cinfo->data_precision != 8) { + is_baseline = FALSE; + } else { + is_baseline = TRUE; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1) + is_baseline = FALSE; + } + if (prec && is_baseline) { + is_baseline = FALSE; + /* If it's baseline except for quantizer size, warn the user */ + TRACEMS(cinfo, 0, JTRC_16BIT_TABLES); + } + } + + /* Emit the proper SOF marker */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + if (cinfo->process == JPROC_PROGRESSIVE) + emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */ + else if (cinfo->process == JPROC_LOSSLESS) + emit_sof(cinfo, M_SOF11); /* SOF code for lossless arithmetic */ + else + emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */ +#else + emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */ +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) + emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */ + else if (cinfo->process == JPROC_LOSSLESS) + emit_sof(cinfo, M_SOF3); /* SOF code for lossless Huffman */ + else if (is_baseline) + emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */ + else + emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ + } +} + + +/* + * Write scan header. + * This consists of DHT or DAC markers, optional DRI, and SOS. + * Compressed data will be written following the SOS. + */ + +METHODDEF(void) +write_scan_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + int i; + jpeg_component_info *compptr; + + if (cinfo->arith_code) { + /* Emit arith conditioning info. We may have some duplication + * if the file has multiple scans, but it's so small it's hardly + * worth worrying about. + */ + emit_dac(cinfo); + } else { + /* Emit Huffman tables. + * Note that emit_dht() suppresses any duplicate tables. + */ + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Progressive mode: only DC or only AC tables are used in one scan */ + if (cinfo->Ss == 0) { + if (cinfo->Ah == 0) /* DC needs no table for refinement scan */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + } else { + emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + } + } else if (cinfo->process == JPROC_LOSSLESS) { + /* Lossless mode: only DC tables are used */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + } else { + /* Sequential mode: need both DC and AC tables */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + } + } + } + + /* Emit DRI if required --- note that DRI value could change for each scan. + * We avoid wasting space with unnecessary DRIs, however. + */ + if (cinfo->restart_interval != marker->last_restart_interval) { + emit_dri(cinfo); + marker->last_restart_interval = cinfo->restart_interval; + } + + emit_sos(cinfo); +} + + +/* + * Write datastream trailer. + */ + +METHODDEF(void) +write_file_trailer (j_compress_ptr cinfo) +{ + emit_marker(cinfo, M_EOI); +} + + +/* + * Write an abbreviated table-specification datastream. + * This consists of SOI, DQT and DHT tables, and EOI. + * Any table that is defined and not marked sent_table = TRUE will be + * emitted. Note that all tables will be marked sent_table = TRUE at exit. + */ + +METHODDEF(void) +write_tables_only (j_compress_ptr cinfo) +{ + int i; + + emit_marker(cinfo, M_SOI); + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if (cinfo->quant_tbl_ptrs[i] != NULL) + (void) emit_dqt(cinfo, i); + } + + if (! cinfo->arith_code) { + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if (cinfo->dc_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, FALSE); + if (cinfo->ac_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, TRUE); + } + } + + emit_marker(cinfo, M_EOI); +} + + +/* + * Initialize the marker writer module. + */ + +GLOBAL(void) +jinit_marker_writer (j_compress_ptr cinfo) +{ + my_marker_ptr marker; + + /* Create the subobject */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_marker_writer)); + cinfo->marker = (struct jpeg_marker_writer *) marker; + /* Initialize method pointers */ + marker->pub.write_file_header = write_file_header; + marker->pub.write_frame_header = write_frame_header; + marker->pub.write_scan_header = write_scan_header; + marker->pub.write_file_trailer = write_file_trailer; + marker->pub.write_tables_only = write_tables_only; + marker->pub.write_marker_header = write_marker_header; + marker->pub.write_marker_byte = write_marker_byte; + /* Initialize private state */ + marker->last_restart_interval = 0; +} diff --git a/dcmjpeg/libijg16/jcmaster.c b/dcmjpeg/libijg16/jcmaster.c new file mode 100644 index 00000000..4df9b58c --- /dev/null +++ b/dcmjpeg/libijg16/jcmaster.c @@ -0,0 +1,657 @@ +/* + * jcmaster.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG compressor. + * These routines are concerned with parameter validation, initial setup, + * and inter-pass control (determining the number of passes and the work + * to be done in each pass). + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ + + +/* Private state */ + +typedef enum { + main_pass, /* input data, also do first output step */ + huff_opt_pass, /* Huffman code optimization pass */ + output_pass /* data output pass */ +} c_pass_type; + +typedef struct { + struct jpeg_comp_master pub; /* public fields */ + + c_pass_type pass_type; /* the type of the current pass */ + + int pass_number; /* # of passes completed */ + int total_passes; /* total # of passes needed */ + + int scan_number; /* current index in scan_info[] */ +} my_comp_master; + +typedef my_comp_master * my_master_ptr; + + +/* + * Support routines that do various essential calculations. + */ + +LOCAL(void) +initial_setup (j_compress_ptr cinfo) +/* Do computations that are needed before master selection phase */ +{ + int ci; + jpeg_component_info *compptr; + long samplesperrow; + JDIMENSION jd_samplesperrow; + int data_unit = cinfo->data_unit; + + /* Sanity check on image dimensions */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 + || cinfo->num_components <= 0 || cinfo->input_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + /* Width of an input scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Fill in the correct component_index value; don't rely on application */ + compptr->component_index = ci; + /* For compression, we never do any codec-based processing. */ + compptr->codec_data_unit = data_unit; + /* Size in data units */ + compptr->width_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * data_unit)); + compptr->height_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * data_unit)); + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) cinfo->max_h_samp_factor); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) cinfo->max_v_samp_factor); + /* Mark component needed (this flag isn't actually used for compression) */ + compptr->component_needed = TRUE; + } + + /* Compute number of fully interleaved MCU rows (number of times that + * main controller will call coefficient controller). + */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*data_unit)); +} + +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define NEED_SCAN_SCRIPT +#else +#ifdef C_LOSSLESS_SUPPORTED +#define NEED_SCAN_SCRIPT +#endif +#endif + +#ifdef NEED_SCAN_SCRIPT + +LOCAL(void) +validate_script (j_compress_ptr cinfo) +/* Verify that the scan script in cinfo->scan_info[] is valid; also + * determine whether it uses progressive JPEG, and set cinfo->process. + */ +{ + const jpeg_scan_info * scanptr; + int scanno, ncomps, ci, coefi, thisi; + int Ss, Se, Ah, Al; + boolean component_sent[MAX_COMPONENTS]; +#ifdef C_PROGRESSIVE_SUPPORTED + int * last_bitpos_ptr; + int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; + /* -1 until that coefficient has been seen; then last Al for it */ +#endif + + if (cinfo->num_scans <= 0) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0); + +#ifndef C_MULTISCAN_FILES_SUPPORTED + if (cinfo->num_scans > 1) + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + + scanptr = cinfo->scan_info; + if (cinfo->lossless) { +#ifdef C_LOSSLESS_SUPPORTED + cinfo->process = JPROC_LOSSLESS; + for (ci = 0; ci < cinfo->num_components; ci++) + component_sent[ci] = FALSE; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1; + * for progressive JPEG, no scan can have this. + */ + else if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) { +#ifdef C_PROGRESSIVE_SUPPORTED + cinfo->process = JPROC_PROGRESSIVE; + last_bitpos_ptr = & last_bitpos[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (coefi = 0; coefi < DCTSIZE2; coefi++) + *last_bitpos_ptr++ = -1; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + for (ci = 0; ci < cinfo->num_components; ci++) + component_sent[ci] = FALSE; + } + + for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) { + /* Validate component indexes */ + ncomps = scanptr->comps_in_scan; + if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN); + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (thisi < 0 || thisi >= cinfo->num_components) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + /* Components must appear in SOF order within each scan */ + if (ci > 0 && thisi <= scanptr->component_index[ci-1]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + } + /* Validate progression parameters */ + Ss = scanptr->Ss; + Se = scanptr->Se; + Ah = scanptr->Ah; + Al = scanptr->Al; + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef C_LOSSLESS_SUPPORTED + /* The JPEG spec simply gives the range 0..15 for Al (Pt), but that + * seems wrong: the upper bound ought to depend on data precision. + * Perhaps they really meant 0..N-1 for N-bit precision, which is what + * we allow here. + */ + if (Ss < 1 || Ss > 7 || /* predictor selector */ + Se != 0 || Ah != 0 || + Al < 0 || Al >= cinfo->data_precision) /* point transform */ + ERREXIT1(cinfo, JERR_BAD_LOSSLESS_SCRIPT, scanno); + /* Make sure components are not sent twice */ + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (component_sent[thisi]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + component_sent[thisi] = TRUE; + } +#endif + } else if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that + * seems wrong: the upper bound ought to depend on data precision. + * Perhaps they really meant 0..N+1 for N-bit precision. + * Here we allow 0..10 for 8-bit data; Al larger than 10 results in + * out-of-range reconstructed DC values during the first DC scan, + * which might cause problems for some decoders. + */ +#if BITS_IN_JSAMPLE == 8 +#define MAX_AH_AL 10 +#else +#define MAX_AH_AL 13 +#endif + if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 || + Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + if (Ss == 0) { + if (Se != 0) /* DC and AC together not OK */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + if (ncomps != 1) /* AC scans must be for only one component */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + for (ci = 0; ci < ncomps; ci++) { + last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0]; + if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + for (coefi = Ss; coefi <= Se; coefi++) { + if (last_bitpos_ptr[coefi] < 0) { + /* first scan of this coefficient */ + if (Ah != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + /* not first scan */ + if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + last_bitpos_ptr[coefi] = Al; + } + } +#endif + } else { + /* For sequential JPEG, all progression parameters must be these: */ + if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + /* Make sure components are not sent twice */ + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (component_sent[thisi]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + component_sent[thisi] = TRUE; + } + } + } + + /* Now verify that everything got sent. */ + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* For progressive mode, we only check that at least some DC data + * got sent for each component; the spec does not require that all bits + * of all coefficients be transmitted. Would it be wiser to enforce + * transmission of all coefficient bits?? + */ + for (ci = 0; ci < cinfo->num_components; ci++) { + if (last_bitpos[ci][0] < 0) + ERREXIT(cinfo, JERR_MISSING_DATA); + } +#endif + } else { + for (ci = 0; ci < cinfo->num_components; ci++) { + if (! component_sent[ci]) + ERREXIT(cinfo, JERR_MISSING_DATA); + } + } +} + +#endif /* NEED_SCAN_SCRIPT */ + + +LOCAL(void) +select_scan_parameters (j_compress_ptr cinfo) +/* Set up the scan parameters for the current scan */ +{ + int ci; + +#ifdef NEED_SCAN_SCRIPT + if (cinfo->scan_info != NULL) { + /* Prepare for current scan --- the script is already validated */ + my_master_ptr master = (my_master_ptr) cinfo->master; + const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number; + + cinfo->comps_in_scan = scanptr->comps_in_scan; + for (ci = 0; ci < scanptr->comps_in_scan; ci++) { + cinfo->cur_comp_info[ci] = + &cinfo->comp_info[scanptr->component_index[ci]]; + } + cinfo->Ss = scanptr->Ss; + cinfo->Se = scanptr->Se; + cinfo->Ah = scanptr->Ah; + cinfo->Al = scanptr->Al; + } else +#endif + { + /* Prepare for single sequential-JPEG scan containing all components */ + if (cinfo->num_components > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPS_IN_SCAN); + cinfo->comps_in_scan = cinfo->num_components; + for (ci = 0; ci < cinfo->num_components; ci++) { + cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci]; + } + if (cinfo->lossless) { +#ifdef C_LOSSLESS_SUPPORTED + /* If we fall through to here, the user specified lossless, but did not + * provide a scan script. + */ + ERREXIT(cinfo, JERR_NO_LOSSLESS_SCRIPT); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + cinfo->Ss = 0; + cinfo->Se = DCTSIZE2-1; + cinfo->Ah = 0; + cinfo->Al = 0; + } + } +} + + +LOCAL(void) +per_scan_setup (j_compress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + int data_unit = cinfo->data_unit; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_data_units; + cinfo->MCU_rows_in_scan = compptr->height_in_data_units; + + /* For noninterleaved scan, always one block per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_data_units = 1; + compptr->MCU_sample_width = data_unit; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of block rows present in the last iMCU row. + */ + tmp = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->data_units_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, + (long) (cinfo->max_h_samp_factor*data_unit)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*data_unit)); + + cinfo->data_units_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of blocks of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_data_units = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * data_unit; + /* Figure number of non-dummy blocks in last MCU column & row */ + tmp = (int)compptr->width_in_data_units % compptr->MCU_width; + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int)compptr->height_in_data_units % compptr->MCU_height; + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_data_units; + if (cinfo->data_units_in_MCU + mcublks > C_MAX_DATA_UNITS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->data_units_in_MCU++] = ci; + } + } + + } + + /* Convert restart specified in rows to actual MCU count. */ + /* Note that count must fit in 16 bits, so we provide limiting. */ + if (cinfo->restart_in_rows > 0) { + long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row; + cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L); + } +} + + +/* + * Per-pass setup. + * This is called at the beginning of each pass. We determine which modules + * will be active during this pass and give them appropriate start_pass calls. + * We also set is_last_pass to indicate whether any more passes will be + * required. + */ + +METHODDEF(void) +prepare_for_pass (j_compress_ptr cinfo) +{ + /* j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; */ + my_master_ptr master = (my_master_ptr) cinfo->master; + + switch (master->pass_type) { + case main_pass: + /* Initial pass: will collect input data, and do either Huffman + * optimization or data output for the first scan. + */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + if (! cinfo->raw_data_in) { + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->downsample->start_pass) (cinfo); + (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU); + } + (*cinfo->codec->entropy_start_pass) (cinfo, cinfo->optimize_coding); + (*cinfo->codec->start_pass) (cinfo, + (master->total_passes > 1 ? + JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + if (cinfo->optimize_coding) { + /* No immediate data output; postpone writing frame/scan headers */ + master->pub.call_pass_startup = FALSE; + } else { + /* Will write frame/scan headers at first jpeg_write_scanlines call */ + master->pub.call_pass_startup = TRUE; + } + break; +#ifdef ENTROPY_OPT_SUPPORTED + case huff_opt_pass: + /* Do Huffman optimization for a scan after the first one. */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); +#ifdef WITH_ARITHMETIC_PATCH + if ((*cinfo->codec->need_optimization_pass) (cinfo)) { +#else + if ((*cinfo->codec->need_optimization_pass) (cinfo) || cinfo->arith_code) { +#endif + (*cinfo->codec->entropy_start_pass) (cinfo, TRUE); + (*cinfo->codec->start_pass) (cinfo, JBUF_CRANK_DEST); + master->pub.call_pass_startup = FALSE; + break; + } + /* Special case: Huffman DC refinement scans need no Huffman table + * and therefore we can skip the optimization pass for them. + */ + master->pass_type = output_pass; + master->pass_number++; + /*FALLTHROUGH*/ +#endif + case output_pass: + /* Do a data-output pass. */ + /* We need not repeat per-scan setup if prior optimization pass did it. */ + if (! cinfo->optimize_coding) { + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + } + (*cinfo->codec->entropy_start_pass) (cinfo, FALSE); + (*cinfo->codec->start_pass) (cinfo, JBUF_CRANK_DEST); + /* We emit frame/scan headers now */ + if (master->scan_number == 0) + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); + master->pub.call_pass_startup = FALSE; + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + } + + master->pub.is_last_pass = (master->pass_number == master->total_passes-1); + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->total_passes; + } +} + + +/* + * Special start-of-pass hook. + * This is called by jpeg_write_scanlines if call_pass_startup is TRUE. + * In single-pass processing, we need this hook because we don't want to + * write frame/scan headers during jpeg_start_compress; we want to let the + * application write COM markers etc. between jpeg_start_compress and the + * jpeg_write_scanlines loop. + * In multi-pass processing, this routine is not used. + */ + +METHODDEF(void) +pass_startup (j_compress_ptr cinfo) +{ + cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */ + + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); +} + + +/* + * Finish up at end of pass. + */ + +METHODDEF(void) +finish_pass_master (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* The entropy coder always needs an end-of-pass call, + * either to analyze statistics or to flush its output buffer. + */ + (*lossyc->pub.entropy_finish_pass) (cinfo); + + /* Update state for next pass */ + switch (master->pass_type) { + case main_pass: + /* next pass is either output of scan 0 (after optimization) + * or output of scan 1 (if no optimization). + */ + master->pass_type = output_pass; + if (! cinfo->optimize_coding) + master->scan_number++; + break; + case huff_opt_pass: + /* next pass is always output of current scan */ + master->pass_type = output_pass; + break; + case output_pass: + /* next pass is either optimization or output of next scan */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + master->scan_number++; + break; + } + + master->pass_number++; +} + + +/* + * Initialize master compression control. + */ + +GLOBAL(void) +jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_comp_master)); + cinfo->master = (struct jpeg_comp_master *) master; + master->pub.prepare_for_pass = prepare_for_pass; + master->pub.pass_startup = pass_startup; + master->pub.finish_pass = finish_pass_master; + master->pub.is_last_pass = FALSE; + + cinfo->data_unit = cinfo->lossless ? 1 : DCTSIZE; + + /* Validate parameters, determine derived values */ + initial_setup(cinfo); + + if (cinfo->scan_info != NULL) { +#ifdef NEED_SCAN_SCRIPT + validate_script(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + cinfo->num_scans = 1; + } + +#ifdef WITH_ARITHMETIC_PATCH + if ((cinfo->arith_code == 0) && + (cinfo->process == JPROC_PROGRESSIVE || /* TEMPORARY HACK ??? */ + cinfo->process == JPROC_LOSSLESS)) +#else + if (cinfo->process == JPROC_PROGRESSIVE || /* TEMPORARY HACK ??? */ + cinfo->process == JPROC_LOSSLESS) +#endif + cinfo->optimize_coding = TRUE; /* assume default tables no good for + * progressive mode or lossless mode */ + + /* Initialize my private state */ + if (transcode_only) { + /* no main pass in transcoding */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + else + master->pass_type = output_pass; + } else { + /* for normal compression, first pass is always this type: */ + master->pass_type = main_pass; + } + master->scan_number = 0; + master->pass_number = 0; + if (cinfo->optimize_coding) + master->total_passes = cinfo->num_scans * 2; + else + master->total_passes = cinfo->num_scans; +} diff --git a/dcmjpeg/libijg16/jcodec.c b/dcmjpeg/libijg16/jcodec.c new file mode 100644 index 00000000..5fbc9fc1 --- /dev/null +++ b/dcmjpeg/libijg16/jcodec.c @@ -0,0 +1,53 @@ +/* + * jcodec.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains utility functions for the JPEG codec(s). + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" +#include "jlossls16.h" + + +/* + * Initialize the compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_c_codec (j_compress_ptr cinfo) +{ + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef C_LOSSLESS_SUPPORTED + jinit_lossless_c_codec(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_lossy_c_codec(cinfo); +} + + +/* + * Initialize the decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_d_codec (j_decompress_ptr cinfo) +{ + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef D_LOSSLESS_SUPPORTED + jinit_lossless_d_codec(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_lossy_d_codec(cinfo); +} diff --git a/dcmjpeg/libijg16/jcomapi.c b/dcmjpeg/libijg16/jcomapi.c new file mode 100644 index 00000000..872c8469 --- /dev/null +++ b/dcmjpeg/libijg16/jcomapi.c @@ -0,0 +1,106 @@ +/* + * jcomapi.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface routines that are used for both + * compression and decompression. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Abort processing of a JPEG compression or decompression operation, + * but don't destroy the object itself. + * + * For this, we merely clean up all the nonpermanent memory pools. + * Note that temp files (virtual arrays) are not allowed to belong to + * the permanent pool, so we will be able to close all temp files here. + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_abort (j_common_ptr cinfo) +{ + int pool; + + /* Do nothing if called on a not-initialized or destroyed JPEG object. */ + if (cinfo->mem == NULL) + return; + + /* Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) { + (*cinfo->mem->free_pool) (cinfo, pool); + } + + /* Reset overall state for possible reuse of object */ + if (cinfo->is_decompressor) { + cinfo->global_state = DSTATE_START; + /* Try to keep application from accessing now-deleted marker list. + * A bit kludgy to do it here, but this is the most central place. + */ + ((j_decompress_ptr) cinfo)->marker_list = NULL; + } else { + cinfo->global_state = CSTATE_START; + } +} + + +/* + * Destruction of a JPEG object. + * + * Everything gets deallocated except the master jpeg_compress_struct itself + * and the error manager struct. Both of these are supplied by the application + * and must be freed, if necessary, by the application. (Often they are on + * the stack and so don't need to be freed anyway.) + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_destroy (j_common_ptr cinfo) +{ + /* We need only tell the memory manager to release everything. */ + /* NB: mem pointer is NULL if memory mgr failed to initialize. */ + if (cinfo->mem != NULL) + (*cinfo->mem->self_destruct) (cinfo); + cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ + cinfo->global_state = 0; /* mark it destroyed */ +} + + +/* + * Convenience routines for allocating quantization and Huffman tables. + * (Would jutils.c be a more reasonable place to put these?) + */ + +GLOBAL(JQUANT_TBL *) +jpeg_alloc_quant_table (j_common_ptr cinfo) +{ + JQUANT_TBL *tbl; + + tbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} + + +GLOBAL(JHUFF_TBL *) +jpeg_alloc_huff_table (j_common_ptr cinfo) +{ + JHUFF_TBL *tbl; + + tbl = (JHUFF_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} diff --git a/dcmjpeg/libijg16/jconfig16.h b/dcmjpeg/libijg16/jconfig16.h new file mode 100644 index 00000000..4dd87d61 --- /dev/null +++ b/dcmjpeg/libijg16/jconfig16.h @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: + * this file derives the preprocessor symbols required to compile + * the IJG library from the central DCMTK configuration file osconfig.h + * + */ + +#include "dcmtk/config/osconfig.h" + +/* We assume ANSI C and don't support DOS, + * so the following settings need not be tested + */ +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +#undef NEED_FAR_POINTERS +#undef INCOMPLETE_TYPES_BROKEN + +/* the following settings are derived from osconfig.h */ + +#ifndef HAVE_C_CONST +#define const +#endif + +#ifdef C_CHAR_UNSIGNED +#define CHAR_IS_UNSIGNED +#endif + +#ifdef HAVE_STRINGS_H +#ifndef HAVE_STRING_H +#define NEED_BSD_STRINGS +#endif +#endif + +#ifdef HAVE_SYS_TYPES_H +#define NEED_SYS_TYPES_H +#endif + +/* must always be defined for our implementation */ +#define NEED_SHORT_EXTERNAL_NAMES + +#ifdef JPEG_INTERNALS + +#ifdef C_RIGHTSHIFT_UNSIGNED +#define RIGHT_SHIFT_IS_UNSIGNED +#endif + +#define INLINE C_INLINE + +/* These are for configuring the JPEG memory manager. */ +#undef DEFAULT_MAX_MEM +#undef NO_MKTEMP + +/* We don't want to use getenv which is thread unsafe on some platforms */ +#define NO_GETENV + +#endif /* JPEG_INTERNALS */ diff --git a/dcmjpeg/libijg16/jcparam.c b/dcmjpeg/libijg16/jcparam.c new file mode 100644 index 00000000..28c1dabf --- /dev/null +++ b/dcmjpeg/libijg16/jcparam.c @@ -0,0 +1,687 @@ +/* + * jcparam.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains optional default-setting code for the JPEG compressor. + * Applications do not have to use this file, but those that don't use it + * must know a lot more about the innards of the JPEG code. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Quantization table setup routines + */ + +GLOBAL(void) +jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, boolean force_baseline) +/* Define a quantization table equal to the basic_table times + * a scale factor (given as a percentage). + * If force_baseline is TRUE, the computed quantization table entries + * are limited to 1..255 for JPEG baseline compatibility. + */ +{ + JQUANT_TBL ** qtblptr; + int i; + long temp; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl); + + qtblptr = & cinfo->quant_tbl_ptrs[which_tbl]; + + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo); + + for (i = 0; i < DCTSIZE2; i++) { + temp = ((long) basic_table[i] * scale_factor + 50L) / 100L; + /* limit the values to the valid range */ + if (temp <= 0L) temp = 1L; + if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */ + if (force_baseline && temp > 255L) + temp = 255L; /* limit to baseline range if requested */ + (*qtblptr)->quantval[i] = (UINT16) temp; + } + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*qtblptr)->sent_table = FALSE; +} + + +GLOBAL(void) +jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, + boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables + * and a straight percentage-scaling quality scale. In most cases it's better + * to use jpeg_set_quality (below); this entry point is provided for + * applications that insist on a linear percentage scaling. + */ +{ + /* These are the sample quantization tables given in JPEG spec section K.1. + * The spec says that the values given produce "good" quality, and + * when divided by 2, "very good" quality. + */ + static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 56, 68, 109, 103, 77, + 24, 35, 55, 64, 81, 104, 113, 92, + 49, 64, 78, 87, 103, 121, 120, 101, + 72, 92, 95, 98, 112, 100, 103, 99 + }; + static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 + }; + + /* Set up two quantization tables using the specified scaling */ + jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl, + scale_factor, force_baseline); + jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, + scale_factor, force_baseline); +} + + +GLOBAL(int) +jpeg_quality_scaling (int quality) +/* Convert a user-specified quality rating to a percentage scaling factor + * for an underlying quantization table, using our recommended scaling curve. + * The input 'quality' factor should be 0 (terrible) to 100 (very good). + */ +{ + /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */ + if (quality <= 0) quality = 1; + if (quality > 100) quality = 100; + + /* The basic table is used as-is (scaling 100) for a quality of 50. + * Qualities 50..100 are converted to scaling percentage 200 - 2*Q; + * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table + * to make all the table entries 1 (hence, minimum quantization loss). + * Qualities 1..50 are converted to scaling percentage 5000/Q. + */ + if (quality < 50) + quality = 5000 / quality; + else + quality = 200 - quality*2; + + return quality; +} + + +GLOBAL(void) +jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables. + * This is the standard quality-adjusting entry point for typical user + * interfaces; only those who want detailed control over quantization tables + * would use the preceding three routines directly. + */ +{ + /* Convert user 0-100 rating to percentage scaling */ + quality = jpeg_quality_scaling(quality); + + /* Set up standard quality tables */ + jpeg_set_linear_quality(cinfo, quality, force_baseline); +} + + +/* + * Huffman table setup routines + */ + +LOCAL(void) +add_huff_table (j_compress_ptr cinfo, + JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val) +/* Define a Huffman table */ +{ + int nsymbols, len; + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + /* Copy the number-of-symbols-of-each-code-length counts */ + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + + /* Validate the counts. We do this here mainly so we can copy the right + * number of symbols from the val[] array, without risking marching off + * the end of memory. jchuff.c will do a more thorough test later. + */ + nsymbols = 0; + for (len = 1; len <= 16; len++) + nsymbols += bits[len]; + if (nsymbols < 1 || nsymbols > 256) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + MEMCOPY((*htblptr)->huffval, val, (size_t)nsymbols * SIZEOF(UINT8)); + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*htblptr)->sent_table = FALSE; +} + + +LOCAL(void) +std_huff_tables (j_compress_ptr cinfo) +/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ +/* IMPORTANT: these are only valid for 8-bit data precision! */ +{ + static const UINT8 bits_dc_luminance[17] = + { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_luminance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_dc_chrominance[17] = + { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_chrominance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_ac_luminance[17] = + { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; + static const UINT8 val_ac_luminance[] = + { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, + 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, + 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, + 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, + 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, + 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, + 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, + 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, + 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + static const UINT8 bits_ac_chrominance[17] = + { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; + static const UINT8 val_ac_chrominance[] = + { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, + 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, + 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, + 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, + 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, + 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, + 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, + 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, + 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], + bits_dc_luminance, val_dc_luminance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], + bits_ac_luminance, val_ac_luminance); + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], + bits_dc_chrominance, val_dc_chrominance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], + bits_ac_chrominance, val_ac_chrominance); +} + + +/* + * Default parameter setup for compression. + * + * Applications that don't choose to use this routine must do their + * own setup of all these parameters. Alternately, you can call this + * to establish defaults and then alter parameters selectively. This + * is the recommended approach since, if we add any new parameters, + * your code will still work (they'll be set to reasonable defaults). + */ + +GLOBAL(void) +jpeg_set_defaults (j_compress_ptr cinfo) +{ + int i; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Allocate comp_info array large enough for maximum component count. + * Array is made permanent in case application wants to compress + * multiple images at same param settings. + */ + if (cinfo->comp_info == NULL) + cinfo->comp_info = (jpeg_component_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + MAX_COMPONENTS * SIZEOF(jpeg_component_info)); + + /* Initialize everything not dependent on the color space */ + + cinfo->lossless = FALSE; + cinfo->data_precision = BITS_IN_JSAMPLE; + /* Set up two quantization tables using default quality of 75 */ + jpeg_set_quality(cinfo, 75, TRUE); + /* Set up two Huffman tables */ + std_huff_tables(cinfo); + + /* Initialize default arithmetic coding conditioning */ + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + + /* Default is no multiple-scan output */ + cinfo->scan_info = NULL; + cinfo->num_scans = 0; + + /* Expect normal source image, not raw downsampled data */ + cinfo->raw_data_in = FALSE; + + /* Use Huffman coding, not arithmetic coding, by default */ + cinfo->arith_code = FALSE; + + /* By default, don't do extra passes to optimize entropy coding */ + cinfo->optimize_coding = FALSE; + /* The standard Huffman tables are only valid for 8-bit data precision. + * If the precision is higher, force optimization on so that usable + * tables will be computed. This test can be removed if default tables + * are supplied that are valid for the desired precision. + */ + if (cinfo->data_precision > 8) + cinfo->optimize_coding = TRUE; + + /* By default, use the simpler non-cosited sampling alignment */ + cinfo->CCIR601_sampling = FALSE; + + /* No input smoothing */ + cinfo->smoothing_factor = 0; + + /* DCT algorithm preference */ + cinfo->dct_method = JDCT_DEFAULT; + + /* No restart markers */ + cinfo->restart_interval = 0; + cinfo->restart_in_rows = 0; + + /* Fill in default JFIF marker parameters. Note that whether the marker + * will actually be written is determined by jpeg_set_colorspace. + * + * By default, the library emits JFIF version code 1.01. + * An application that wants to emit JFIF 1.02 extension markers should set + * JFIF_minor_version to 2. We could probably get away with just defaulting + * to 1.02, but there may still be some decoders in use that will complain + * about that; saying 1.01 should minimize compatibility problems. + */ + cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; /* Pixel size is unknown by default */ + cinfo->X_density = 1; /* Pixel aspect ratio is square by default */ + cinfo->Y_density = 1; + + /* Choose JPEG colorspace based on input space, set defaults accordingly */ + + jpeg_default_colorspace(cinfo); +} + + +/* + * Select an appropriate JPEG colorspace for in_color_space. + */ + +GLOBAL(void) +jpeg_default_colorspace (j_compress_ptr cinfo) +{ + if (cinfo->lossless) + jpeg_set_colorspace(cinfo, cinfo->in_color_space); + else { /* lossy */ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); + break; + case JCS_RGB: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_YCbCr: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_CMYK: + jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */ + break; + case JCS_YCCK: + jpeg_set_colorspace(cinfo, JCS_YCCK); + break; + case JCS_UNKNOWN: + jpeg_set_colorspace(cinfo, JCS_UNKNOWN); + break; + default: + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + } + } +} + + +/* + * Set the JPEG colorspace, and choose colorspace-dependent default values. + */ + +GLOBAL(void) +jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) +{ + jpeg_component_info * compptr; + int ci; + +#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \ + (compptr = &cinfo->comp_info[index], \ + compptr->component_id = (id), \ + compptr->h_samp_factor = (hsamp), \ + compptr->v_samp_factor = (vsamp), \ + compptr->quant_tbl_no = (quant), \ + compptr->dc_tbl_no = (dctbl), \ + compptr->ac_tbl_no = (actbl) ) + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* For all colorspaces, we use Q and Huff tables 0 for luminance components, + * tables 1 for chrominance components. + */ + + cinfo->jpeg_color_space = colorspace; + + cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */ + cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */ + + switch (colorspace) { + case JCS_GRAYSCALE: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 1; + /* JFIF specifies component ID 1 */ + SET_COMP(0, 1, 1,1, 0, 0,0); + break; + case JCS_RGB: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ + cinfo->num_components = 3; + SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0); + SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0); + SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0); + break; + case JCS_YCbCr: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 3; + /* JFIF specifies component IDs 1,2,3 */ + if (cinfo->lossless) { + SET_COMP(0, 1, 1,1, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + } else { /* lossy */ + /* We default to 2x2 subsamples of chrominance */ + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + } + break; + case JCS_CMYK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */ + cinfo->num_components = 4; + SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0); + SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0); + SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0); + SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0); + break; + case JCS_YCCK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */ + cinfo->num_components = 4; + if (cinfo->lossless) { + SET_COMP(0, 1, 1,1, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(3, 4, 1,1, 0, 0,0); + } else { /* lossy */ + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(3, 4, 2,2, 0, 0,0); + } + break; + case JCS_UNKNOWN: + cinfo->num_components = cinfo->input_components; + if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + for (ci = 0; ci < cinfo->num_components; ci++) { + SET_COMP(ci, ci, 1,1, 0, 0,0); + } + break; + default: + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + } +} + + +#ifdef C_PROGRESSIVE_SUPPORTED + +LOCAL(jpeg_scan_info *) +fill_scans (jpeg_scan_info * scanptr, int ncomps, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for each component */ +{ + int ci; + + for (ci = 0; ci < ncomps; ci++) { + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } + return scanptr; +} + + +LOCAL(jpeg_scan_info *) +fill_a_scan (jpeg_scan_info * scanptr, int ci, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for specified component */ +{ + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + return scanptr; +} + +LOCAL(jpeg_scan_info *) +fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al) +/* Support routine: generate interleaved DC scan if possible, else N scans */ +{ + int ci; + + if (ncomps <= MAX_COMPS_IN_SCAN) { + /* Single interleaved DC scan */ + scanptr->comps_in_scan = ncomps; + for (ci = 0; ci < ncomps; ci++) + scanptr->component_index[ci] = ci; + scanptr->Ss = scanptr->Se = 0; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } else { + /* Noninterleaved DC scan for each component */ + scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al); + } + return scanptr; +} + + +/* + * Create a recommended progressive-JPEG script. + * cinfo->num_components and cinfo->jpeg_color_space must be correct. + */ + +GLOBAL(void) +jpeg_simple_progression (j_compress_ptr cinfo) +{ + int ncomps = cinfo->num_components; + int nscans; + jpeg_scan_info * scanptr; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Figure space needed for script. Calculation must match code below! */ + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + nscans = 10; + } else { + /* All-purpose script for other color spaces. */ + if (ncomps > MAX_COMPS_IN_SCAN) + nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */ + else + nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */ + } + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_progression is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space, and we allocate + * enough space to handle YCbCr even if initially asked for grayscale. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { + cinfo->script_space_size = MAX(nscans, 10); + cinfo->script_space = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + (size_t)cinfo->script_space_size * SIZEOF(jpeg_scan_info)); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + /* Initial DC scan */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + /* Initial AC scan: get some luma data out in a hurry */ + scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2); + /* Chroma data is too small to be worth expending many scans on */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1); + /* Complete spectral selection for luma AC */ + scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2); + /* Refine next bit of luma AC */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1); + /* Finish DC successive approximation */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + /* Finish AC successive approximation */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0); + /* Luma bottom bit comes last since it's usually largest scan */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0); + } else { + /* All-purpose script for other color spaces. */ + /* Successive approximation first pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2); + scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2); + /* Successive approximation second pass */ + scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1); + /* Successive approximation final pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0); + } +} + +#endif /* C_PROGRESSIVE_SUPPORTED */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* + * Create a single-entry lossless-JPEG script containing all components. + * cinfo->num_components must be correct. + */ + +GLOBAL(void) +jpeg_simple_lossless (j_compress_ptr cinfo, int predictor, int point_transform) +{ + int ncomps = cinfo->num_components; + int nscans = 1; + int ci; + jpeg_scan_info * scanptr; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + cinfo->lossless = TRUE; + + /* Set jpeg_color_space. */ + jpeg_default_colorspace(cinfo); + + /* Check to ensure that all components will fit in one scan. */ + if (cinfo->num_components > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPS_IN_SCAN); + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_lossless is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { + cinfo->script_space_size = nscans; + cinfo->script_space = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + (size_t)cinfo->script_space_size * SIZEOF(jpeg_scan_info)); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + /* Fill the script. */ + scanptr->comps_in_scan = ncomps; + for (ci = 0; ci < (int)ncomps; ci++) + scanptr->component_index[ci] = ci; + scanptr->Ss = predictor; + scanptr->Se = 0; + scanptr->Ah = 0; + scanptr->Al = point_transform; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jcphuff.c b/dcmjpeg/libijg16/jcphuff.c new file mode 100644 index 00000000..a2bfab47 --- /dev/null +++ b/dcmjpeg/libijg16/jcphuff.c @@ -0,0 +1,848 @@ +/* + * jcphuff.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for progressive JPEG. + * + * We do not support output suspension in this module, since the library + * currently does not allow multiple-scan files to be written with output + * suspension. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ +#include "jchuff16.h" /* Declarations shared with jc*huff.c */ + +#ifdef C_PROGRESSIVE_SUPPORTED + +/* Expanded entropy encoder object for progressive Huffman encoding. */ + +typedef struct { + /* Mode flag: TRUE for optimization, FALSE for actual data output */ + boolean gather_statistics; + + /* Bit-level coding status. + * next_output_byte/free_in_buffer are local copies of cinfo->dest fields. + */ + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ + j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */ + + /* Coding status for DC components */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ + + /* Coding status for AC components */ + int ac_tbl_no; /* the table number of the single component */ + unsigned int EOBRUN; /* run length of EOBs */ + unsigned int BE; /* # of buffered correction bits before MCU */ + char * bit_buffer; /* buffer for correction bits (1 per char) */ + /* packing correction bits tightly would save some space but cost time... */ + + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan). + * Since any one scan codes only DC or only AC, we only need one set + * of tables, not one for DC and one for AC. + */ + c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Statistics tables for optimization; again, one set is enough */ + long * count_ptrs[NUM_HUFF_TBLS]; +} phuff_entropy_encoder; + +typedef phuff_entropy_encoder * phuff_entropy_ptr; + +/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit + * buffer can hold. Larger sizes may slightly improve compression, but + * 1000 is already well into the realm of overkill. + * The minimum safe size is 64 bits. + */ + +#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */ + +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than IJG_INT32. + * We assume that int right shift is unsigned if IJG_INT32 right shift is, + * which should be safe. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS int ishift_temp; +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +/* Forward declarations */ +METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo)); +METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo)); + + +/* + * Initialize for a Huffman-compressed scan using progressive JPEG. + */ + +METHODDEF(void) +start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + boolean is_DC_band; + int ci, tbl; + jpeg_component_info * compptr; + + entropy->cinfo = cinfo; + entropy->gather_statistics = gather_statistics; + + is_DC_band = (cinfo->Ss == 0); + + /* We assume jcmaster.c already validated the scan parameters. */ + + /* Select execution routines */ + if (cinfo->Ah == 0) { + if (is_DC_band) + lossyc->entropy_encode_mcu = encode_mcu_DC_first; + else + lossyc->entropy_encode_mcu = encode_mcu_AC_first; + } else { + if (is_DC_band) + lossyc->entropy_encode_mcu = encode_mcu_DC_refine; + else { + lossyc->entropy_encode_mcu = encode_mcu_AC_refine; + /* AC refinement needs a correction bit buffer */ + if (entropy->bit_buffer == NULL) + entropy->bit_buffer = (char *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + MAX_CORR_BITS * SIZEOF(char)); + } + } + if (gather_statistics) + lossyc->pub.entropy_finish_pass = finish_pass_gather_phuff; + else + lossyc->pub.entropy_finish_pass = finish_pass_phuff; + + /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1 + * for AC coefficients. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Initialize DC predictions to 0 */ + entropy->last_dc_val[ci] = 0; + /* Get table index */ + if (is_DC_band) { + if (cinfo->Ah != 0) /* DC refinement needs no table */ + continue; + tbl = compptr->dc_tbl_no; + } else { + entropy->ac_tbl_no = tbl = compptr->ac_tbl_no; + } + if (gather_statistics) { + /* Check for invalid table index */ + /* (make_c_derived_tbl does this in the other path) */ + if (tbl < 0 || tbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->count_ptrs[tbl] == NULL) + entropy->count_ptrs[tbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long)); + } else { + /* Compute derived values for Huffman table */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl, + & entropy->derived_tbls[tbl]); + } + } + + /* Initialize AC stuff */ + entropy->EOBRUN = 0; + entropy->BE = 0; + + /* Initialize bit buffer to empty */ + entropy->put_buffer = 0; + entropy->put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file. + * NB: these must be called only when actually outputting, + * that is, entropy->gather_statistics == FALSE. + */ + +/* Emit a byte */ +#define emit_byte(entropy,val) \ + { *(entropy)->next_output_byte++ = (JOCTET) (val); \ + if (--(entropy)->free_in_buffer == 0) \ + dump_buffer(entropy); } + + +LOCAL(void) +dump_buffer (phuff_entropy_ptr entropy) +/* Empty the output buffer; we do not support suspension in this module. */ +{ + struct jpeg_destination_mgr * dest = entropy->cinfo->dest; + + if (! (*dest->empty_output_buffer) (entropy->cinfo)) + ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND); + /* After a successful buffer dump, must reset buffer pointers */ + entropy->next_output_byte = dest->next_output_byte; + entropy->free_in_buffer = dest->free_in_buffer; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(void) +emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) +/* Emit some bits, unless we are in gather mode */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = entropy->put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + if (entropy->gather_statistics) + return; /* do nothing if we're only getting stats */ + + put_buffer &= (((IJG_INT32) 1)<put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(entropy, c); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(entropy, 0); + } + put_buffer <<= 8; + put_bits -= 8; + } + + entropy->put_buffer = put_buffer; /* update variables */ + entropy->put_bits = put_bits; +} + + +LOCAL(void) +flush_bits (phuff_entropy_ptr entropy) +{ + emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */ + entropy->put_buffer = 0; /* and reset bit-buffer to empty */ + entropy->put_bits = 0; +} + + +/* + * Emit (or just count) a Huffman symbol. + */ + +INLINE +LOCAL(void) +emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol) +{ + if (entropy->gather_statistics) + entropy->count_ptrs[tbl_no][symbol]++; + else { + c_derived_tbl * tbl = entropy->derived_tbls[tbl_no]; + emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]); + } +} + + +/* + * Emit bits from a correction bit buffer. + */ + +LOCAL(void) +emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart, + unsigned int nbits) +{ + if (entropy->gather_statistics) + return; /* no real work */ + + while (nbits > 0) { + emit_bits(entropy, (unsigned int) (*bufstart), 1); + bufstart++; + nbits--; + } +} + + +/* + * Emit any pending EOBRUN symbol. + */ + +LOCAL(void) +emit_eobrun (phuff_entropy_ptr entropy) +{ + register int temp, nbits; + + if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */ + temp = (int)entropy->EOBRUN; + nbits = 0; + while ((temp >>= 1)) + nbits++; + /* safety check: shouldn't happen given limited correction-bit buffer */ + if (nbits > 14) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4); + if (nbits) + emit_bits(entropy, entropy->EOBRUN, nbits); + + entropy->EOBRUN = 0; + + /* Emit any buffered correction bits */ + emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE); + entropy->BE = 0; + } +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(void) +emit_restart (phuff_entropy_ptr entropy, int restart_num) +{ + int ci; + + emit_eobrun(entropy); + + if (! entropy->gather_statistics) { + flush_bits(entropy); + emit_byte(entropy, 0xFF); + emit_byte(entropy, JPEG_RST0 + restart_num); + } + + if (entropy->cinfo->Ss == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++) + entropy->last_dc_val[ci] = 0; + } else { + /* Re-initialize all AC-related fields to 0 */ + entropy->EOBRUN = 0; + entropy->BE = 0; + } +} + + +/* + * MCU encoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp, temp2; + register int nbits; + int blkn, ci; + int Al = cinfo->Al; + JBLOCKROW block; + jpeg_component_info * compptr; + ISHIFT_TEMPS + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + + /* Compute the DC value after the required point transform by Al. + * This is simply an arithmetic right shift. + */ + temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al); + + /* DC differences are figured on the point-transformed values. */ + temp = temp2 - entropy->last_dc_val[ci]; + entropy->last_dc_val[ci] = temp2; + + /* Encode the DC coefficient difference per section G.1.2.1 */ + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit the Huffman-coded symbol for the number of bits */ + emit_symbol(entropy, compptr->dc_tbl_no, nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + emit_bits(entropy, (unsigned int) temp2, nbits); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp, temp2; + register int nbits; + register int r, k; + int Se = cinfo->Se; + int Al = cinfo->Al; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */ + + r = 0; /* r = run length of zeros */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = (*block)[jpeg_natural_order[k]]) == 0) { + r++; + continue; + } + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value; so the code is + * interwoven with finding the abs value (temp) and output bits (temp2). + */ + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + /* For a negative coef, want temp2 = bitwise complement of abs(coef) */ + temp2 = ~temp; + } else { + temp >>= Al; /* apply the point transform */ + temp2 = temp; + } + /* Watch out for case that nonzero coef is zero after point transform */ + if (temp == 0) { + r++; + continue; + } + + /* Emit any pending EOBRUN */ + if (entropy->EOBRUN > 0) + emit_eobrun(entropy); + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + emit_bits(entropy, (unsigned int) temp2, nbits); + + r = 0; /* reset zero run length */ + } + + if (r > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + if (entropy->EOBRUN == 0x7FFF) + emit_eobrun(entropy); /* force it out to avoid overflow */ + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp; + int blkn; + int Al = cinfo->Al; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* We simply emit the Al'th bit of the DC coefficient value. */ + temp = (*block)[0]; + emit_bits(entropy, (unsigned int) (temp >> Al), 1); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp; + register int r, k; + int EOB; + char *BR_buffer; + unsigned int BR; + int Se = cinfo->Se; + int Al = cinfo->Al; + JBLOCKROW block; + int absvalues[DCTSIZE2]; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* It is convenient to make a pre-pass to determine the transformed + * coefficients' absolute values and the EOB position. + */ + EOB = 0; + for (k = cinfo->Ss; k <= Se; k++) { + temp = (*block)[jpeg_natural_order[k]]; + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value. + */ + if (temp < 0) + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + absvalues[k] = temp; /* save abs value for main pass */ + if (temp == 1) + EOB = k; /* EOB = index of last newly-nonzero coef */ + } + + /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */ + + r = 0; /* r = run length of zeros */ + BR = 0; /* BR = count of buffered bits added now */ + BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = absvalues[k]) == 0) { + r++; + continue; + } + + /* Emit any required ZRLs, but not if they can be folded into EOB */ + while (r > 15 && k <= EOB) { + /* emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + /* Emit ZRL */ + emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + /* Emit buffered correction bits that must be associated with ZRL */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + } + + /* If the coef was previously nonzero, it only needs a correction bit. + * NOTE: a straight translation of the spec's figure G.7 would suggest + * that we also need to test r > 15. But if r > 15, we can only get here + * if k > EOB, which implies that this coefficient is not 1. + */ + if (temp > 1) { + /* The correction bit is the next bit of the absolute value. */ + BR_buffer[BR++] = (char) (temp & 1); + continue; + } + + /* Emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1); + + /* Emit output bit for newly-nonzero coef */ + temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1; + emit_bits(entropy, (unsigned int) temp, 1); + + /* Emit buffered correction bits that must be associated with this code */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + r = 0; /* reset zero run length */ + } + + if (r > 0 || BR > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + entropy->BE += BR; /* concat my correction bits to older ones */ + /* We force out the EOB if we risk either: + * 1. overflow of the EOB counter; + * 2. overflow of the correction bit buffer during the next MCU. + */ + if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1)) + emit_eobrun(entropy); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * Finish up at the end of a Huffman-compressed progressive scan. + */ + +METHODDEF(void) +finish_pass_phuff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Flush out any buffered data */ + emit_eobrun(entropy); + flush_bits(entropy); + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather_phuff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + boolean is_DC_band; + int ci, tbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did[NUM_HUFF_TBLS]; + + /* Flush out buffered data (all we care about is counting the EOB symbol) */ + emit_eobrun(entropy); + + is_DC_band = (cinfo->Ss == 0); + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did, SIZEOF(did)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + if (is_DC_band) { + if (cinfo->Ah != 0) /* DC refinement needs no table */ + continue; + tbl = compptr->dc_tbl_no; + } else { + tbl = compptr->ac_tbl_no; + } + if (! did[tbl]) { + if (is_DC_band) + htblptr = & cinfo->dc_huff_tbl_ptrs[tbl]; + else + htblptr = & cinfo->ac_huff_tbl_ptrs[tbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]); + did[tbl] = TRUE; + } + } +} + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return (cinfo->Ss != 0 || cinfo->Ah == 0); +} + + +/* + * Module initialization routine for progressive Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_phuff_encoder (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy; + int i; + + entropy = (phuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(phuff_entropy_encoder)); + lossyc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + lossyc->pub.entropy_start_pass = start_pass_phuff; + lossyc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + entropy->count_ptrs[i] = NULL; + } + entropy->bit_buffer = NULL; /* needed only in AC refinement scan */ +} + +#endif /* C_PROGRESSIVE_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jcpred.c b/dcmjpeg/libijg16/jcpred.c new file mode 100644 index 00000000..3778db94 --- /dev/null +++ b/dcmjpeg/libijg16/jcpred.c @@ -0,0 +1,314 @@ +/* + * jcpred.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample differencing for lossless JPEG. + * + * In order to avoid paying the performance penalty of having to check the + * predictor being used and the row being processed for each call of the + * undifferencer, and to promote optimization, we have separate differencing + * functions for each case. + * + * We are able to avoid duplicating source code by implementing the predictors + * and differencers as macros. Each of the differencing functions are + * simply wrappers around a DIFFERENCE macro with the appropriate PREDICTOR + * macro passed as an argument. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* Private predictor object */ + +typedef struct { + /* MCU-rows left in the restart interval for each component */ + unsigned int restart_rows_to_go[MAX_COMPONENTS]; +} c_predictor; + +typedef c_predictor * c_pred_ptr; + +/* Forward declarations */ +LOCAL(void) reset_predictor + JPP((j_compress_ptr cinfo, int ci)); +METHODDEF(void) start_pass + JPP((j_compress_ptr cinfo)); + + +/* Predictor for the first column of the first row: 2^(P-Pt-1) */ +#define INITIAL_PREDICTORx (1 << (cinfo->data_precision - cinfo->Al - 1)) + +/* Predictor for the first column of the remaining rows: Rb */ +#define INITIAL_PREDICTOR2 GETJSAMPLE(prev_row[0]) + + +/* + * 1-Dimensional differencer routine. + * + * This macro implements the 1-D horizontal predictor (1). INITIAL_PREDICTOR + * is used as the special case predictor for the first column, which must be + * either INITIAL_PREDICTOR2 or INITIAL_PREDICTORx. The remaining samples + * use PREDICTOR1. + */ + +#define DIFFERENCE_1D(INITIAL_PREDICTOR) \ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; \ + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; \ + boolean restart = FALSE; \ + unsigned int xindex; \ + int samp, Ra; \ + \ + samp = GETJSAMPLE(input_buf[0]); \ + diff_buf[0] = samp - INITIAL_PREDICTOR; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Ra = samp; \ + samp = GETJSAMPLE(input_buf[xindex]); \ + diff_buf[xindex] = samp - PREDICTOR1; \ + } \ + \ + /* Account for restart interval (no-op if not using restarts) */ \ + if (cinfo->restart_interval) { \ + if (--(pred->restart_rows_to_go[ci]) == 0) { \ + reset_predictor(cinfo, ci); \ + restart = TRUE; \ + } \ + } + + +/* + * 2-Dimensional differencer routine. + * + * This macro implements the 2-D horizontal predictors (#2-7). PREDICTOR2 is + * used as the special case predictor for the first column. The remaining + * samples use PREDICTOR, which is a function of Ra, Rb, Rc. + * + * Because prev_row and output_buf may point to the same storage area (in an + * interleaved image with Vi=1, for example), we must take care to buffer Rb/Rc + * before writing the current reconstructed sample value into output_buf. + */ + +#define DIFFERENCE_2D(PREDICTOR) \ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; \ + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; \ + unsigned int xindex; \ + int samp, Ra, Rb, Rc; \ + \ + Rb = GETJSAMPLE(prev_row[0]); \ + samp = GETJSAMPLE(input_buf[0]); \ + diff_buf[0] = samp - PREDICTOR2; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Rc = Rb; \ + Rb = GETJSAMPLE(prev_row[xindex]); \ + Ra = samp; \ + samp = GETJSAMPLE(input_buf[xindex]); \ + diff_buf[xindex] = samp - PREDICTOR; \ + } \ + \ + /* Account for restart interval (no-op if not using restarts) */ \ + if (cinfo->restart_interval) { \ + if (--pred->restart_rows_to_go[ci] == 0) \ + reset_predictor(cinfo, ci); \ + } + +#define JPEG_UNUSED(x) ((void)x) + +/* + * Differencers for the all rows but the first in a scan or restart interval. + * The first sample in the row is differenced using the vertical + * predictor (2). The rest of the samples are differenced using the + * predictor specified in the scan header. + */ + +METHODDEF(void) +jpeg_difference1(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_1D(INITIAL_PREDICTOR2); + JPEG_UNUSED(restart); +} + +METHODDEF(void) +jpeg_difference2(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR2); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference3(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR3); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference4(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR4); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference5(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR5); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference6(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR6); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference7(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR7); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + + +/* + * Differencer for the first row in a scan or restart interval. The first + * sample in the row is differenced using the special predictor constant + * x=2^(P-Pt-1). The rest of the samples are differenced using the + * 1-D horizontal predictor (1). + */ + +METHODDEF(void) +jpeg_difference_first_row(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_1D(INITIAL_PREDICTORx); + + /* + * Now that we have differenced the first row, we want to use the + * differencer which corresponds to the predictor specified in the + * scan header. + * + * Note that we don't to do this if we have just reset the predictor + * for a new restart interval. + */ + if (!restart) { + switch (cinfo->Ss) { + case 1: + losslsc->predict_difference[ci] = jpeg_difference1; + break; + case 2: + losslsc->predict_difference[ci] = jpeg_difference2; + break; + case 3: + losslsc->predict_difference[ci] = jpeg_difference3; + break; + case 4: + losslsc->predict_difference[ci] = jpeg_difference4; + break; + case 5: + losslsc->predict_difference[ci] = jpeg_difference5; + break; + case 6: + losslsc->predict_difference[ci] = jpeg_difference6; + break; + case 7: + losslsc->predict_difference[ci] = jpeg_difference7; + break; + } + } +} + +/* + * Reset predictor at the start of a pass or restart interval. + */ + +LOCAL(void) +reset_predictor (j_compress_ptr cinfo, int ci) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; + + /* Initialize restart counter */ + pred->restart_rows_to_go[ci] = + cinfo->restart_interval / cinfo->MCUs_per_row; + + /* Set difference function to first row function */ + losslsc->predict_difference[ci] = jpeg_difference_first_row; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo) +{ + /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */ + /* c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; */ + int ci; + + /* Check that the restart interval is an integer multiple of the number + * of MCU in an MCU-row. + */ + if (cinfo->restart_interval % cinfo->MCUs_per_row != 0) + ERREXIT2(cinfo, JERR_BAD_RESTART, + (int)cinfo->restart_interval, (int)cinfo->MCUs_per_row); + + /* Set predictors for start of pass */ + for (ci = 0; ci < cinfo->num_components; ci++) + reset_predictor(cinfo, ci); +} + + +/* + * Module initialization routine for the differencer. + */ + +GLOBAL(void) +jinit_differencer (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_pred_ptr pred; + + pred = (c_pred_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_predictor)); + losslsc->pred_private = (void *) pred; + losslsc->predict_start_pass = start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg16/jcprepct.c b/dcmjpeg/libijg16/jcprepct.c new file mode 100644 index 00000000..6ff73f67 --- /dev/null +++ b/dcmjpeg/libijg16/jcprepct.c @@ -0,0 +1,354 @@ +/* + * jcprepct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the compression preprocessing controller. + * This controller manages the color conversion, downsampling, + * and edge expansion steps. + * + * Most of the complexity here is associated with buffering input rows + * as required by the downsampler. See the comments at the head of + * jcsample.c for the downsampler's needs. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* At present, jcsample.c can request context rows only for smoothing. + * In the future, we might also need context rows for CCIR601 sampling + * or other more-complex downsampling procedures. The code to support + * context rows should be compiled only if needed. + */ +#ifdef INPUT_SMOOTHING_SUPPORTED +#define CONTEXT_ROWS_SUPPORTED +#endif + + +/* + * For the simple (no-context-row) case, we just need to buffer one + * row group's worth of pixels for the downsampling step. At the bottom of + * the image, we pad to a full row group by replicating the last pixel row. + * The downsampler's last output row is then replicated if needed to pad + * out to a full iMCU row. + * + * When providing context rows, we must buffer three row groups' worth of + * pixels. Three row groups are physically allocated, but the row pointer + * arrays are made five row groups high, with the extra pointers above and + * below "wrapping around" to point to the last and first real row groups. + * This allows the downsampler to access the proper context rows. + * At the top and bottom of the image, we create dummy context rows by + * copying the first or last real pixel row. This copying could be avoided + * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the + * trouble on the compression side. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_prep_controller pub; /* public fields */ + + /* Downsampling input buffer. This buffer holds color-converted data + * until we have enough to do a downsample step. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + JDIMENSION rows_to_go; /* counts rows remaining in source image */ + int next_buf_row; /* index of next row to store in color_buf */ + +#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */ + int this_row_group; /* starting row index of group to process */ + int next_buf_stop; /* downsample when we reach this index */ +#endif +} my_prep_controller; + +typedef my_prep_controller * my_prep_ptr; + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + + if (pass_mode != JBUF_PASS_THRU) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Initialize total-height counter for detecting bottom of image */ + prep->rows_to_go = cinfo->image_height; + /* Mark the conversion buffer empty */ + prep->next_buf_row = 0; +#ifdef CONTEXT_ROWS_SUPPORTED + /* Preset additional state variables for context mode. + * These aren't used in non-context mode, so we needn't test which mode. + */ + prep->this_row_group = 0; + /* Set next_buf_stop to stop after two row groups have been read in. */ + prep->next_buf_stop = 2 * cinfo->max_v_samp_factor; +#endif +} + + +/* + * Expand an image vertically from height input_rows to height output_rows, + * by duplicating the bottom row. + */ + +LOCAL(void) +expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols, + int input_rows, int output_rows) +{ + register int row; + + for (row = input_rows; row < output_rows; row++) { + jcopy_sample_rows(image_data, input_rows-1, image_data, row, + 1, num_cols); + } +} + + +/* + * Process some data in the simple no-context case. + * + * Preprocessor output data is counted in "row groups". A row group + * is defined to be v_samp_factor sample rows of each component. + * Downsampling will produce this much data from each max_v_samp_factor + * input rows. + */ + +METHODDEF(void) +pre_process_data (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + JDIMENSION inrows; + jpeg_component_info * compptr; + + while (*in_row_ctr < in_rows_avail && + *out_row_group_ctr < out_row_groups_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = cinfo->max_v_samp_factor - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + *in_row_ctr += (JDIMENSION)numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= (JDIMENSION)numrows; + /* If at bottom of image, pad to fill the conversion buffer. */ + if (prep->rows_to_go == 0 && + prep->next_buf_row < cinfo->max_v_samp_factor) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, cinfo->max_v_samp_factor); + } + prep->next_buf_row = cinfo->max_v_samp_factor; + } + /* If we've filled the conversion buffer, empty it. */ + if (prep->next_buf_row == cinfo->max_v_samp_factor) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, (JDIMENSION) 0, + output_buf, *out_row_group_ctr); + prep->next_buf_row = 0; + (*out_row_group_ctr)++; + } + /* If at bottom of image, pad the output to a full iMCU height. + * Note we assume the caller is providing a one-iMCU-height output buffer! + */ + if (prep->rows_to_go == 0 && + *out_row_group_ctr < out_row_groups_avail) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + expand_bottom_edge(output_buf[ci], + compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit, + (int)*out_row_group_ctr * compptr->v_samp_factor, + (int)out_row_groups_avail * compptr->v_samp_factor); + } + *out_row_group_ctr = out_row_groups_avail; + break; /* can exit outer loop without test */ + } + } +} + + +#ifdef CONTEXT_ROWS_SUPPORTED + +/* + * Process some data in the context case. + */ + +METHODDEF(void) +pre_process_context (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + int buf_height = cinfo->max_v_samp_factor * 3; + JDIMENSION inrows; + + while (*out_row_group_ctr < out_row_groups_avail) { + if (*in_row_ctr < in_rows_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = prep->next_buf_stop - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + /* Pad at top of image, if first time through */ + if (prep->rows_to_go == cinfo->image_height) { + for (ci = 0; ci < cinfo->num_components; ci++) { + int row; + for (row = 1; row <= cinfo->max_v_samp_factor; row++) { + jcopy_sample_rows(prep->color_buf[ci], 0, + prep->color_buf[ci], -row, + 1, cinfo->image_width); + } + } + } + *in_row_ctr += (JDIMENSION)numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= (JDIMENSION)numrows; + } else { + /* Return for more data, unless we are at the bottom of the image. */ + if (prep->rows_to_go != 0) + break; + /* When at bottom of image, pad to fill the conversion buffer. */ + if (prep->next_buf_row < prep->next_buf_stop) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, prep->next_buf_stop); + } + prep->next_buf_row = prep->next_buf_stop; + } + } + /* If we've gotten enough data, downsample a row group. */ + if (prep->next_buf_row == prep->next_buf_stop) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, + (JDIMENSION) prep->this_row_group, + output_buf, *out_row_group_ctr); + (*out_row_group_ctr)++; + /* Advance pointers with wraparound as necessary. */ + prep->this_row_group += cinfo->max_v_samp_factor; + if (prep->this_row_group >= buf_height) + prep->this_row_group = 0; + if (prep->next_buf_row >= buf_height) + prep->next_buf_row = 0; + prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor; + } + } +} + + +/* + * Create the wrapped-around downsampling input buffer needed for context mode. + */ + +LOCAL(void) +create_context_buffer (j_compress_ptr cinfo) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int rgroup_height = cinfo->max_v_samp_factor; + int ci, i; + jpeg_component_info * compptr; + JSAMPARRAY true_buffer, fake_buffer; + + /* Grab enough space for fake row pointers for all the components; + * we need five row groups' worth of pointers for each component. + */ + fake_buffer = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)(cinfo->num_components * 5 * rgroup_height) * + SIZEOF(JSAMPROW)); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate the actual buffer space (3 row groups) for this component. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + true_buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_data_units * cinfo->data_unit * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) (3 * rgroup_height)); + /* Copy true buffer row pointers into the middle of the fake row array */ + MEMCOPY(fake_buffer + rgroup_height, true_buffer, + 3 * (size_t)rgroup_height * SIZEOF(JSAMPROW)); + /* Fill in the above and below wraparound pointers */ + for (i = 0; i < rgroup_height; i++) { + fake_buffer[i] = true_buffer[2 * rgroup_height + i]; + fake_buffer[4 * rgroup_height + i] = true_buffer[i]; + } + prep->color_buf[ci] = fake_buffer + rgroup_height; + fake_buffer += 5 * rgroup_height; /* point to space for next component */ + } +} + +#endif /* CONTEXT_ROWS_SUPPORTED */ + + +/* + * Initialize preprocessing controller. + */ + +GLOBAL(void) +jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_prep_ptr prep; + int ci; + jpeg_component_info * compptr; + + if (need_full_buffer) /* safety check */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + prep = (my_prep_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_prep_controller)); + cinfo->prep = (struct jpeg_c_prep_controller *) prep; + prep->pub.start_pass = start_pass_prep; + + /* Allocate the color conversion buffer. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + if (cinfo->downsample->need_context_rows) { + /* Set up to provide context rows */ +#ifdef CONTEXT_ROWS_SUPPORTED + prep->pub.pre_process_data = pre_process_context; + create_context_buffer(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* No context, just make it tall enough for one row group */ + prep->pub.pre_process_data = pre_process_data; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prep->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_data_units * cinfo->data_unit * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/dcmjpeg/libijg16/jcsample.c b/dcmjpeg/libijg16/jcsample.c new file mode 100644 index 00000000..80766490 --- /dev/null +++ b/dcmjpeg/libijg16/jcsample.c @@ -0,0 +1,519 @@ +/* + * jcsample.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains downsampling routines. + * + * Downsampling input data is counted in "row groups". A row group + * is defined to be max_v_samp_factor pixel rows of each component, + * from which the downsampler produces v_samp_factor sample rows. + * A single row group is processed in each call to the downsampler module. + * + * The downsampler is responsible for edge-expansion of its output data + * to fill an integral number of DCT blocks horizontally. The source buffer + * may be modified if it is helpful for this purpose (the source buffer is + * allocated wide enough to correspond to the desired output width). + * The caller (the prep controller) is responsible for vertical padding. + * + * The downsampler may request "context rows" by setting need_context_rows + * during startup. In this case, the input arrays will contain at least + * one row group's worth of pixels above and below the passed-in data; + * the caller will create dummy rows at image top and bottom by replicating + * the first or last real pixel row. + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + * + * The downsampling algorithm used here is a simple average of the source + * pixels covered by the output pixel. The hi-falutin sampling literature + * refers to this as a "box filter". In general the characteristics of a box + * filter are not very good, but for the specific cases we normally use (1:1 + * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not + * nearly so bad. If you intend to use other sampling ratios, you'd be well + * advised to improve this code. + * + * A simple input-smoothing capability is provided. This is mainly intended + * for cleaning up color-dithered GIF input files (if you find it inadequate, + * we suggest using an external filtering program such as pnmconvol). When + * enabled, each input pixel P is replaced by a weighted sum of itself and its + * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF, + * where SF = (smoothing_factor / 1024). + * Currently, smoothing is only supported for 2h2v sampling factors. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Pointer to routine to downsample a single component */ +typedef JMETHOD(void, downsample1_ptr, + (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data)); + +/* Private subobject */ + +typedef struct { + struct jpeg_downsampler pub; /* public fields */ + + /* Downsampling method pointers, one per component */ + downsample1_ptr methods[MAX_COMPONENTS]; +} my_downsampler; + +typedef my_downsampler * my_downsample_ptr; + + +/* + * Initialize for a downsampling pass. + */ + +METHODDEF(void) +start_pass_downsample (j_compress_ptr cinfo) +{ + /* no work for now */ +} + + +/* + * Expand a component horizontally from width input_cols to width output_cols, + * by duplicating the rightmost samples. + */ + +LOCAL(void) +expand_right_edge (JSAMPARRAY image_data, int num_rows, + JDIMENSION input_cols, JDIMENSION output_cols) +{ + register JSAMPROW ptr; + register JSAMPLE pixval; + register int count; + int row; + int numcols = (int) (output_cols - input_cols); + + if (numcols > 0) { + for (row = 0; row < num_rows; row++) { + ptr = image_data[row] + input_cols; + pixval = ptr[-1]; /* don't need GETJSAMPLE() here */ + for (count = numcols; count > 0; count--) + *ptr++ = pixval; + } + } +} + + +/* + * Do downsampling for a whole row group (all components). + * + * In this version we simply downsample each component independently. + */ + +METHODDEF(void) +sep_downsample (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, JDIMENSION out_row_group_index) +{ + my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample; + int ci; + jpeg_component_info * compptr; + JSAMPARRAY in_ptr, out_ptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + in_ptr = input_buf[ci] + in_row_index; + out_ptr = output_buf[ci] + (out_row_group_index * (JDIMENSION)compptr->v_samp_factor); + (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr); + } +} + + +/* + * Downsample pixel values of a single component. + * One row group is processed per call. + * This version handles arbitrary integral sampling ratios, without smoothing. + * Note that this version is not actually used for customary sampling ratios. + */ + +METHODDEF(void) +int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v; + JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */ + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + JSAMPROW inptr, outptr; + IJG_INT32 outvalue; + + h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; + v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; + numpix = h_expand * v_expand; + numpix2 = numpix/2; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * (JDIMENSION)h_expand); + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + for (outcol = 0, outcol_h = 0; outcol < output_cols; + outcol++, outcol_h += (JDIMENSION)h_expand) { + outvalue = 0; + for (v = 0; v < v_expand; v++) { + inptr = input_data[inrow+v] + outcol_h; + for (h = 0; h < h_expand; h++) { + outvalue += (IJG_INT32) GETJSAMPLE(*inptr++); + } + } + *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); + } + inrow += v_expand; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * without smoothing. + */ + +METHODDEF(void) +fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + /* Copy the data */ + jcopy_sample_rows(input_data, 0, output_data, 0, + cinfo->max_v_samp_factor, cinfo->image_width); + /* Edge-expand */ + expand_right_edge(output_data, cinfo->max_v_samp_factor, + cinfo->image_width, compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit); +} + + +/* + * Downsample pixel values of a single component. + * This version handles the common case of 2:1 horizontal and 1:1 vertical, + * without smoothing. + * + * A note about the "bias" calculations: when rounding fractional values to + * integer, we do not want to always round 0.5 up to the next integer. + * If we did that, we'd introduce a noticeable bias towards larger values. + * Instead, this code is arranged so that 0.5 will be rounded up or down at + * alternate pixel locations (a simple ordered dither pattern). + */ + +METHODDEF(void) +h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int outrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr = input_data[outrow]; + bias = 0; /* bias = 0,1,0,1,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + + bias) >> 1); + bias ^= 1; /* 0=>1, 1=>0 */ + inptr += 2; + } + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * without smoothing. + */ + +METHODDEF(void) +h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr0, inptr1, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + bias = 1; /* bias = 1,2,1,2,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + + bias) >> 2); + bias ^= 3; /* 1=>2, 2=>1 */ + inptr0 += 2; inptr1 += 2; + } + inrow += 2; + } +} + + +#ifdef INPUT_SMOOTHING_SUPPORTED + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr; + IJG_INT32 membersum, neighsum, memberscale, neighscale; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols * 2); + + /* We don't bother to form the individual "smoothed" input pixel values; + * we can directly compute the output which is the average of the four + * smoothed values. Each of the four member pixels contributes a fraction + * (1-8*SF) to its own smoothed image and a fraction SF to each of the three + * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final + * output. The four corner-adjacent neighbor pixels contribute a fraction + * SF to just one smoothed pixel, or SF/4 to the final output; while the + * eight edge-adjacent neighbors contribute SF to each of two smoothed + * pixels, or SF/2 overall. In order to use integer arithmetic, these + * factors are scaled by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */ + neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */ + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + above_ptr = input_data[inrow-1]; + below_ptr = input_data[inrow+2]; + + /* Special case for first column: pretend column -1 is same as column 0 */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]); + neighsum += neighsum; + neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + /* sum of pixels directly mapped to this output element */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + /* sum of edge-neighbor pixels */ + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]); + /* The edge-neighbors count twice as much as corner-neighbors */ + neighsum += neighsum; + /* Add in the corner-neighbors */ + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]); + /* form final output scaled up by 2^16 */ + membersum = membersum * memberscale + neighsum * neighscale; + /* round, descale and output it */ + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]); + neighsum += neighsum; + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + inrow += 2; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int outrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr, above_ptr, below_ptr, outptr; + IJG_INT32 membersum, neighsum, memberscale, neighscale; + int colsum, lastcolsum, nextcolsum; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols); + + /* Each of the eight neighbor pixels contributes a fraction SF to the + * smoothed pixel, while the main pixel contributes (1-8*SF). In order + * to use integer arithmetic, these factors are multiplied by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */ + neighscale = cinfo->smoothing_factor * 64; /* scaled SF */ + + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr = input_data[outrow]; + above_ptr = input_data[outrow-1]; + below_ptr = input_data[outrow+1]; + + /* Special case for first column */ + colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) + + GETJSAMPLE(*inptr); + membersum = GETJSAMPLE(*inptr++); + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = colsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + membersum = GETJSAMPLE(*inptr++); + above_ptr++; below_ptr++; + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + colsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + } +} + +#endif /* INPUT_SMOOTHING_SUPPORTED */ + + +/* + * Module initialization routine for downsampling. + * Note that we must select a routine for each component. + */ + +GLOBAL(void) +jinit_downsampler (j_compress_ptr cinfo) +{ + my_downsample_ptr downsample; + int ci; + jpeg_component_info * compptr; + boolean smoothok = TRUE; + + downsample = (my_downsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_downsampler)); + cinfo->downsample = (struct jpeg_downsampler *) downsample; + downsample->pub.start_pass = start_pass_downsample; + downsample->pub.downsample = sep_downsample; + downsample->pub.need_context_rows = FALSE; + + if (cinfo->CCIR601_sampling) + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* Verify we can handle the sampling factors, and set up method pointers */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor == cinfo->max_h_samp_factor && + compptr->v_samp_factor == cinfo->max_v_samp_factor) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = fullsize_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = fullsize_downsample; + } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && + compptr->v_samp_factor == cinfo->max_v_samp_factor) { + smoothok = FALSE; + downsample->methods[ci] = h2v1_downsample; + } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && + compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = h2v2_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = h2v2_downsample; + } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && + (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { + smoothok = FALSE; + downsample->methods[ci] = int_downsample; + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + } + +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor && !smoothok) + TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL); +#endif +} diff --git a/dcmjpeg/libijg16/jcscale.c b/dcmjpeg/libijg16/jcscale.c new file mode 100644 index 00000000..e2547ef8 --- /dev/null +++ b/dcmjpeg/libijg16/jcscale.c @@ -0,0 +1,63 @@ +/* + * jcscale.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample downscaling by 2^Pt for lossless JPEG. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +METHODDEF(void) +simple_downscale(j_compress_ptr cinfo, + const JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width) +{ + /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */ + unsigned int xindex; + SHIFT_TEMPS + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) RIGHT_SHIFT(GETJSAMPLE(input_buf[xindex]), + cinfo->Al); +} + + +METHODDEF(void) +noscale(j_compress_ptr cinfo, + JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width) +{ + MEMCOPY(output_buf, input_buf, width * SIZEOF(JSAMPLE)); + return; +} + + +METHODDEF(void) +scaler_start_pass (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + /* Set scaler function based on Pt */ + if (cinfo->Al) + losslsc->scaler_scale = simple_downscale; + else + losslsc->scaler_scale = noscale; +} + + +GLOBAL(void) +jinit_c_scaler (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + losslsc->scaler_start_pass = scaler_start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jcshuff.c b/dcmjpeg/libijg16/jcshuff.c new file mode 100644 index 00000000..a948c37e --- /dev/null +++ b/dcmjpeg/libijg16/jcshuff.c @@ -0,0 +1,661 @@ +/* + * jcshuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for sequential JPEG. + * + * Much of the complexity here has to do with supporting output suspension. + * If the data destination module demands suspension, we want to be able to + * back up to the start of the current MCU. To do this, we copy state + * variables into local working storage, and update them back to the + * permanent JPEG objects only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ +#include "jchuff16.h" /* Declarations shared with jc*huff.c */ + + +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + savable_state saved; /* Bit buffer & DC state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + +#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ + long * dc_count_ptrs[NUM_HUFF_TBLS]; + long * ac_count_ptrs[NUM_HUFF_TBLS]; +#endif +} shuff_entropy_encoder; + +typedef shuff_entropy_encoder * shuff_entropy_ptr; + +/* Working state while writing an MCU. + * This struct contains all the fields that are needed by subroutines. + */ + +typedef struct { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ +} working_state; + + +/* Forward declarations */ +METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); +#ifdef ENTROPY_OPT_SUPPORTED +METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); +#endif + + +/* + * Initialize for a Huffman-compressed scan. + * If gather_statistics is TRUE, we do not output anything during the scan, + * just count the Huffman symbols used and generate Huffman code tables. + */ + +METHODDEF(void) +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int ci, dctbl, actbl; + jpeg_component_info * compptr; + + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + lossyc->entropy_encode_mcu = encode_mcu_gather; + lossyc->pub.entropy_finish_pass = finish_pass_gather; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + lossyc->entropy_encode_mcu = encode_mcu_huff; + lossyc->pub.entropy_finish_pass = finish_pass_huff; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + /* Check for invalid table indexes */ + /* (make_c_derived_tbl does this in the other path) */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + if (actbl < 0 || actbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->dc_count_ptrs[dctbl] == NULL) + entropy->dc_count_ptrs[dctbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long)); + if (entropy->ac_count_ptrs[actbl] == NULL) + entropy->ac_count_ptrs[actbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long)); +#endif + } else { + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, + & entropy->dc_derived_tbls[dctbl]); + jpeg_make_c_derived_tbl(cinfo, FALSE, actbl, + & entropy->ac_derived_tbls[actbl]); + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Initialize bit buffer to empty */ + entropy->saved.put_buffer = 0; + entropy->saved.put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file */ + +/* Emit a byte, taking 'action' if must suspend. */ +#define emit_byte(state,val,action) \ + { *(state)->next_output_byte++ = (JOCTET) (val); \ + if (--(state)->free_in_buffer == 0) \ + if (! dump_buffer(state)) \ + { action; } } + + +LOCAL(boolean) +dump_buffer (working_state * state) +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +{ + struct jpeg_destination_mgr * dest = state->cinfo->dest; + + if (! (*dest->empty_output_buffer) (state->cinfo)) + return FALSE; + /* After a successful buffer dump, must reset buffer pointers */ + state->next_output_byte = dest->next_output_byte; + state->free_in_buffer = dest->free_in_buffer; + return TRUE; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(boolean) +emit_bits (working_state * state, unsigned int code, int size) +/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = state->cur.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); + + put_buffer &= (((IJG_INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(state, c, return FALSE); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(state, 0, return FALSE); + } + put_buffer <<= 8; + put_bits -= 8; + } + + state->cur.put_buffer = put_buffer; /* update state variables */ + state->cur.put_bits = put_bits; + + return TRUE; +} + + +LOCAL(boolean) +flush_bits (working_state * state) +{ + if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ + return FALSE; + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ + state->cur.put_bits = 0; + return TRUE; +} + + +/* Encode a single block's worth of coefficients */ + +LOCAL(boolean) +encode_one_block (working_state * state, const JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl) +{ + register int temp, temp2; + register int nbits; + register int k, r, i; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = temp2 = block[0] - last_dc_val; + + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit the Huffman-coded symbol for the number of bits */ + if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + if (! emit_bits(state, (unsigned int) temp2, nbits)) + return FALSE; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k < DCTSIZE2; k++) { + if ((temp = block[jpeg_natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) + return FALSE; + r -= 16; + } + + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit Huffman symbol for run length / number of bits */ + i = (r << 4) + nbits; + if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (! emit_bits(state, (unsigned int) temp2, nbits)) + return FALSE; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0])) + return FALSE; + + return TRUE; +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(boolean) +emit_restart (working_state * state, int restart_num) +{ + int ci; + + if (! flush_bits(state)) + return FALSE; + + emit_byte(state, 0xFF, return FALSE); + emit_byte(state, JPEG_RST0 + restart_num, return FALSE); + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < state->cinfo->comps_in_scan; ci++) + state->cur.last_dc_val[ci] = 0; + + /* The restart counter is not updated until we successfully write the MCU. */ + + return TRUE; +} + + +/* + * Encode and output one MCU's worth of Huffman-compressed coefficients. + */ + +METHODDEF(boolean) +encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + working_state state; + int blkn, ci; + jpeg_component_info * compptr; + + /* Load up working state */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! emit_restart(&state, entropy->next_restart_num)) + return FALSE; + } + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + if (! encode_one_block(&state, + MCU_data[blkn][0], state.cur.last_dc_val[ci], + entropy->dc_derived_tbls[compptr->dc_tbl_no], + entropy->ac_derived_tbls[compptr->ac_tbl_no])) + return FALSE; + /* Update last_dc_val */ + state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + /* Completed MCU, so update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + working_state state; + + /* Load up working state ... flush_bits needs it */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Flush out the last data */ + if (! flush_bits(&state)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); +} + + +/* + * Huffman coding optimization. + * + * We first scan the supplied data and count the number of uses of each symbol + * that is to be Huffman-coded. (This process MUST agree with the code above.) + * Then we build a Huffman coding tree for the observed counts. + * Symbols which are not needed at all for the particular image are not + * assigned any code, which saves space in the DHT marker as well as in + * the compressed data. + */ + +#ifdef ENTROPY_OPT_SUPPORTED + + +/* Process a single block's worth of coefficients */ + +LOCAL(void) +htest_one_block (j_compress_ptr cinfo, const JCOEFPTR block, int last_dc_val, + long dc_counts[], long ac_counts[]) +{ + register int temp; + register int nbits; + register int k, r; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = block[0] - last_dc_val; + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count the Huffman symbol for the number of bits */ + dc_counts[nbits]++; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k < DCTSIZE2; k++) { + if ((temp = block[jpeg_natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + ac_counts[0xF0]++; + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count Huffman symbol for run length / number of bits */ + ac_counts[(r << 4) + nbits]++; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + ac_counts[0]++; +} + + +/* + * Trial-encode one MCU's worth of Huffman-compressed coefficients. + * No data is actually output, so no suspension return is possible. + */ + +METHODDEF(boolean) +encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int blkn, ci; + jpeg_component_info * compptr; + + /* Take care of restart intervals if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Update restart state */ + entropy->restarts_to_go = cinfo->restart_interval; + } + entropy->restarts_to_go--; + } + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], + entropy->dc_count_ptrs[compptr->dc_tbl_no], + entropy->ac_count_ptrs[compptr->ac_tbl_no]); + entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + return TRUE; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int ci, dctbl, actbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did_dc[NUM_HUFF_TBLS]; + boolean did_ac[NUM_HUFF_TBLS]; + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did_dc, SIZEOF(did_dc)); + MEMZERO(did_ac, SIZEOF(did_ac)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + if (! did_dc[dctbl]) { + htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); + did_dc[dctbl] = TRUE; + } + if (! did_ac[actbl]) { + htblptr = & cinfo->ac_huff_tbl_ptrs[actbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]); + did_ac[actbl] = TRUE; + } + } +} + + +#endif /* ENTROPY_OPT_SUPPORTED */ + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_shuff_encoder (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy; + int i; + + entropy = (shuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(shuff_entropy_encoder)); + lossyc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + lossyc->pub.entropy_start_pass = start_pass_huff; + lossyc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; +#ifdef ENTROPY_OPT_SUPPORTED + entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg16/jctrans.c b/dcmjpeg/libijg16/jctrans.c new file mode 100644 index 00000000..046a704b --- /dev/null +++ b/dcmjpeg/libijg16/jctrans.c @@ -0,0 +1,424 @@ +/* + * jctrans.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding compression, + * that is, writing raw DCT coefficient arrays to an output JPEG file. + * The routines in jcapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ + + +/* Forward declarations */ +LOCAL(void) transencode_master_selection + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); +LOCAL(void) transencode_codec + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); +LOCAL(void) transencode_coef_controller + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); + + +/* + * Compression initialization for writing raw-coefficient data. + * Before calling this, all parameters and a data destination must be set up. + * Call jpeg_finish_compress() to actually write the data. + * + * The number of passed virtual arrays must match cinfo->num_components. + * Note that the virtual arrays need not be filled or even realized at + * the time write_coefficients is called; indeed, if the virtual arrays + * were requested from this compression object's memory manager, they + * typically will be realized during this routine and filled afterwards. + */ + +GLOBAL(void) +jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Mark all tables to be written */ + jpeg_suppress_tables(cinfo, FALSE); + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + transencode_master_selection(cinfo, coef_arrays); + /* Wait for jpeg_finish_compress() call */ + cinfo->next_scanline = 0; /* so jpeg_write_marker works */ + cinfo->global_state = CSTATE_WRCOEFS; +} + + +/* + * Initialize the compression object with default parameters, + * then copy from the source object all parameters needed for lossless + * transcoding. Parameters that can be varied without loss (such as + * scan script and Huffman optimization) are left in their default states. + */ + +GLOBAL(void) +jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, + j_compress_ptr dstinfo) +{ + JQUANT_TBL ** qtblptr; + jpeg_component_info *incomp, *outcomp; + JQUANT_TBL *c_quant, *slot_quant; + int tblno, ci, coefi; + + /* Safety check to ensure start_compress not called yet. */ + if (dstinfo->global_state != CSTATE_START) + ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state); + /* Copy fundamental image dimensions */ + dstinfo->image_width = srcinfo->image_width; + dstinfo->image_height = srcinfo->image_height; + dstinfo->input_components = srcinfo->num_components; + dstinfo->in_color_space = srcinfo->jpeg_color_space; + /* Initialize all parameters to default values */ + jpeg_set_defaults(dstinfo); + /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. + * Fix it to get the right header markers for the image colorspace. + */ + jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); + dstinfo->data_precision = srcinfo->data_precision; + dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; + /* Copy the source's quantization tables. */ + for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { + if (srcinfo->quant_tbl_ptrs[tblno] != NULL) { + qtblptr = & dstinfo->quant_tbl_ptrs[tblno]; + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo); + MEMCOPY((*qtblptr)->quantval, + srcinfo->quant_tbl_ptrs[tblno]->quantval, + SIZEOF((*qtblptr)->quantval)); + (*qtblptr)->sent_table = FALSE; + } + } + /* Copy the source's per-component info. + * Note we assume jpeg_set_defaults has allocated the dest comp_info array. + */ + dstinfo->num_components = srcinfo->num_components; + if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS) + ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components, + MAX_COMPONENTS); + for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info; + ci < dstinfo->num_components; ci++, incomp++, outcomp++) { + outcomp->component_id = incomp->component_id; + outcomp->h_samp_factor = incomp->h_samp_factor; + outcomp->v_samp_factor = incomp->v_samp_factor; + outcomp->quant_tbl_no = incomp->quant_tbl_no; + /* Make sure saved quantization table for component matches the qtable + * slot. If not, the input file re-used this qtable slot. + * IJG encoder currently cannot duplicate this. + */ + tblno = outcomp->quant_tbl_no; + if (tblno < 0 || tblno >= NUM_QUANT_TBLS || + srcinfo->quant_tbl_ptrs[tblno] == NULL) + ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno); + slot_quant = srcinfo->quant_tbl_ptrs[tblno]; + c_quant = incomp->quant_table; + if (c_quant != NULL) { + for (coefi = 0; coefi < DCTSIZE2; coefi++) { + if (c_quant->quantval[coefi] != slot_quant->quantval[coefi]) + ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno); + } + } + /* Note: we do not copy the source's Huffman table assignments; + * instead we rely on jpeg_set_colorspace to have made a suitable choice. + */ + } + /* Also copy JFIF version and resolution information, if available. + * Strictly speaking this isn't "critical" info, but it's nearly + * always appropriate to copy it if available. In particular, + * if the application chooses to copy JFIF 1.02 extension markers from + * the source file, we need to copy the version to make sure we don't + * emit a file that has 1.02 extensions but a claimed version of 1.01. + * We will *not*, however, copy version info from mislabeled "2.01" files. + */ + if (srcinfo->saw_JFIF_marker) { + if (srcinfo->JFIF_major_version == 1) { + dstinfo->JFIF_major_version = srcinfo->JFIF_major_version; + dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version; + } + dstinfo->density_unit = srcinfo->density_unit; + dstinfo->X_density = srcinfo->X_density; + dstinfo->Y_density = srcinfo->Y_density; + } +} + + +/* + * Master selection of compression modules for transcoding. + * This substitutes for jcinit.c's initialization of the full compressor. + */ + +LOCAL(void) +transencode_master_selection (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + cinfo->data_unit = DCTSIZE; + /* Although we don't actually use input_components for transcoding, + * jcmaster.c's initial_setup will complain if input_components is 0. + */ + cinfo->input_components = 1; + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, TRUE /* transcode only */); + + /* We need a special compression codec. */ + transencode_codec(cinfo, coef_arrays); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI, JFIF) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} + + +/* + * The rest of this file is a special implementation of the coefficient + * buffer controller. This is similar to jccoefct.c, but it handles only + * output from presupplied virtual arrays. Furthermore, we generate any + * dummy padding blocks on-the-fly rather than expecting them to be present + * in the arrays. + */ + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* Virtual block array for each component. */ + jvirt_barray_ptr * whole_image; + + /* Workspace for constructing dummy blocks at right/bottom edges. */ + JBLOCKROW dummy_buffer[C_MAX_DATA_UNITS_IN_MCU]; +} c_coef_controller; + +typedef c_coef_controller * c_coef_ptr; + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + if (pass_mode != JBUF_CRANK_DEST) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); +} + + +/* + * Process some data. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, blockcnt; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW MCU_buffer[C_MAX_DATA_UNITS_IN_MCU]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * (JDIMENSION) compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yindex+yoffset < compptr->last_row_height) { + /* Fill in pointers to real blocks in this row */ + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < blockcnt; xindex++) + MCU_buffer[blkn++] = buffer_ptr++; + } else { + /* At bottom of image, need a whole row of dummy blocks */ + xindex = 0; + } + /* Fill in any dummy blocks needed in this row. + * Dummy blocks are filled in the same way as in jccoefct.c: + * all zeroes in the AC entries, DC entries equal to previous + * block's DC value. The init routine has already zeroed the + * AC entries, so we need only set the DC entries correctly. + */ + for (; xindex < compptr->MCU_width; xindex++) { + MCU_buffer[blkn] = coef->dummy_buffer[blkn]; + MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0]; + blkn++; + } + } + } + /* Try to write the MCU. */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +/* + * Initialize coefficient buffer controller. + * + * Each passed coefficient array must be the right size for that + * coefficient: width_in_data_units wide and height_in_data_units high, + * with unitheight at least v_samp_factor. + */ + +LOCAL(void) +transencode_coef_controller (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef; + JBLOCKROW buffer; + int i; + + coef = (c_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_coef_controller)); + lossyc->coef_private = (struct jpeg_c_coef_controller *) coef; + + /* Save pointer to virtual arrays */ + coef->whole_image = coef_arrays; + + /* Allocate and pre-zero space for dummy DCT blocks. */ + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + jzero_far((void FAR *) buffer, C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_DATA_UNITS_IN_MCU; i++) { + coef->dummy_buffer[i] = buffer + i; + } +} + + +/* + * Initialize the transencoer codec. + * This is called only once, during master selection. + */ + +LOCAL(void) +transencode_codec (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + j_lossy_c_ptr lossyc; + + /* Create subobject in permanent pool */ + lossyc = (j_lossy_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) lossyc; + + /* Initialize sub-modules */ + + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + jinit_phuff_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_encoder(cinfo); + } + + /* We need a special coefficient buffer controller. */ + transencode_coef_controller(cinfo, coef_arrays); + + /* Initialize method pointers */ + lossyc->pub.start_pass = start_pass_coef; + lossyc->pub.compress_data = compress_output; +} diff --git a/dcmjpeg/libijg16/jdapimin.c b/dcmjpeg/libijg16/jdapimin.c new file mode 100644 index 00000000..c123e9f6 --- /dev/null +++ b/dcmjpeg/libijg16/jdapimin.c @@ -0,0 +1,401 @@ +/* + * jdapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-decompression case or the + * transcoding-only case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jdapistd.c. But also see jcomapi.c for routines + * shared by compression and decompression, and jdtrans.c for the transcoding + * case. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Initialization of a JPEG decompression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_decompress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = TRUE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->src = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) + cinfo->quant_tbl_ptrs[i] = NULL; + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + /* Initialize marker processor so application can override methods + * for COM, APPn markers before calling jpeg_read_header. + */ + cinfo->marker_list = NULL; + jinit_marker_reader(cinfo); + + /* And initialize the overall input controller. */ + jinit_input_controller(cinfo); + + /* OK, I'm ready */ + cinfo->global_state = DSTATE_START; +} + + +/* + * Destruction of a JPEG decompression object + */ + +GLOBAL(void) +jpeg_destroy_decompress (j_decompress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG decompression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_decompress (j_decompress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Set default decompression parameters. + */ + +LOCAL(void) +default_decompress_parms (j_decompress_ptr cinfo) +{ + /* Guess the input colorspace, and set output colorspace accordingly. */ + /* (Wish JPEG committee had provided a real way to specify this...) */ + /* Note application may override our guesses. */ + switch (cinfo->num_components) { + case 1: + cinfo->jpeg_color_space = JCS_GRAYSCALE; + cinfo->out_color_space = JCS_GRAYSCALE; + break; + + case 3: + if (cinfo->saw_JFIF_marker) { + cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ + } else if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_RGB; + break; + case 1: + cinfo->jpeg_color_space = JCS_YCbCr; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + break; + } + } else { + /* Saw no special markers, try to guess from the component IDs */ + int cid0 = cinfo->comp_info[0].component_id; + int cid1 = cinfo->comp_info[1].component_id; + int cid2 = cinfo->comp_info[2].component_id; + + if (cid0 == 1 && cid1 == 2 && cid2 == 3) + cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ + else if (cid0 == 82 && cid1 == 71 && cid2 == 66) + cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ + else { + if (cinfo->process == JPROC_LOSSLESS) { + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_LOSSLESS_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_RGB; /* assume it's RGB */ + } + else { /* Lossy processes */ + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_LOSSY_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + } + } + } + /* Always guess RGB is proper output colorspace. */ + cinfo->out_color_space = JCS_RGB; + break; + + case 4: + if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_CMYK; + break; + case 2: + cinfo->jpeg_color_space = JCS_YCCK; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ + break; + } + } else { + /* No special markers, assume straight CMYK. */ + cinfo->jpeg_color_space = JCS_CMYK; + } + cinfo->out_color_space = JCS_CMYK; + break; + + default: + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->out_color_space = JCS_UNKNOWN; + break; + } + + /* Set defaults for other decompression parameters. */ + cinfo->scale_num = 1; /* 1:1 scaling */ + cinfo->scale_denom = 1; + cinfo->output_gamma = 1.0; + cinfo->buffered_image = FALSE; + cinfo->raw_data_out = FALSE; + cinfo->dct_method = JDCT_DEFAULT; + cinfo->do_fancy_upsampling = TRUE; + cinfo->do_block_smoothing = TRUE; + cinfo->quantize_colors = FALSE; + /* We set these in case application only sets quantize_colors. */ + cinfo->dither_mode = JDITHER_FS; +#ifdef QUANT_2PASS_SUPPORTED + cinfo->two_pass_quantize = TRUE; +#else + cinfo->two_pass_quantize = FALSE; +#endif + cinfo->desired_number_of_colors = 256; + cinfo->colormap = NULL; + /* Initialize for no mode change in buffered-image mode. */ + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; +} + + +/* + * Decompression startup: read start of JPEG datastream to see what's there. + * Need only initialize JPEG object and supply a data source before calling. + * + * This routine will read as far as the first SOS marker (ie, actual start of + * compressed data), and will save all tables and parameters in the JPEG + * object. It will also initialize the decompression parameters to default + * values, and finally return JPEG_HEADER_OK. On return, the application may + * adjust the decompression parameters and then call jpeg_start_decompress. + * (Or, if the application only wanted to determine the image parameters, + * the data need not be decompressed. In that case, call jpeg_abort or + * jpeg_destroy to release any temporary space.) + * If an abbreviated (tables only) datastream is presented, the routine will + * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then + * re-use the JPEG object to read the abbreviated image datastream(s). + * It is unnecessary (but OK) to call jpeg_abort in this case. + * The JPEG_SUSPENDED return code only occurs if the data source module + * requests suspension of the decompressor. In this case the application + * should load more source data and then re-call jpeg_read_header to resume + * processing. + * If a non-suspending data source is used and require_image is TRUE, then the + * return code need not be inspected since only JPEG_HEADER_OK is possible. + * + * This routine is now just a front end to jpeg_consume_input, with some + * extra error checking. + */ + +GLOBAL(int) +jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) +{ + int retcode; + + if (cinfo->global_state != DSTATE_START && + cinfo->global_state != DSTATE_INHEADER) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + retcode = jpeg_consume_input(cinfo); + + switch (retcode) { + case JPEG_REACHED_SOS: + retcode = JPEG_HEADER_OK; + break; + case JPEG_REACHED_EOI: + if (require_image) /* Complain if application wanted an image */ + ERREXIT(cinfo, JERR_NO_IMAGE); + /* Reset to start state; it would be safer to require the application to + * call jpeg_abort, but we can't change it now for compatibility reasons. + * A side effect is to free any temporary memory (there shouldn't be any). + */ + jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */ + retcode = JPEG_HEADER_TABLES_ONLY; + break; + case JPEG_SUSPENDED: + /* no work */ + break; + } + + return retcode; +} + + +/* + * Consume data in advance of what the decompressor requires. + * This can be called at any time once the decompressor object has + * been created and a data source has been set up. + * + * This routine is essentially a state machine that handles a couple + * of critical state-transition actions, namely initial setup and + * transition from header scanning to ready-for-start_decompress. + * All the actual input is done via the input controller's consume_input + * method. + */ + +GLOBAL(int) +jpeg_consume_input (j_decompress_ptr cinfo) +{ + int retcode = JPEG_SUSPENDED; + + /* NB: every possible DSTATE value should be listed in this switch */ + switch (cinfo->global_state) { + case DSTATE_START: + /* Start-of-datastream actions: reset appropriate modules */ + (*cinfo->inputctl->reset_input_controller) (cinfo); + /* Initialize application's data source module */ + (*cinfo->src->init_source) (cinfo); + cinfo->global_state = DSTATE_INHEADER; + /*FALLTHROUGH*/ + case DSTATE_INHEADER: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ + /* Set up default parameters based on header data */ + default_decompress_parms(cinfo); + /* Set global state: ready for start_decompress */ + cinfo->global_state = DSTATE_READY; + } + break; + case DSTATE_READY: + /* Can't advance past first SOS until start_decompress is called */ + retcode = JPEG_REACHED_SOS; + break; + case DSTATE_PRELOAD: + case DSTATE_PRESCAN: + case DSTATE_SCANNING: + case DSTATE_RAW_OK: + case DSTATE_BUFIMAGE: + case DSTATE_BUFPOST: + case DSTATE_STOPPING: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + break; + default: + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + return retcode; +} + + +/* + * Have we finished reading the input file? + */ + +GLOBAL(boolean) +jpeg_input_complete (j_decompress_ptr cinfo) +{ + /* Check for valid jpeg object */ + if (cinfo->global_state < DSTATE_START || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->eoi_reached; +} + + +/* + * Is there more than one scan? + */ + +GLOBAL(boolean) +jpeg_has_multiple_scans (j_decompress_ptr cinfo) +{ + /* Only valid after jpeg_read_header completes */ + if (cinfo->global_state < DSTATE_READY || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->has_multiple_scans; +} + + +/* + * Finish JPEG decompression. + * + * This will normally just verify the file trailer and release temp storage. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_decompress (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) { + /* Terminate final pass of non-buffered mode */ + if (cinfo->output_scanline < cinfo->output_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state == DSTATE_BUFIMAGE) { + /* Finishing after a buffered-image operation */ + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state != DSTATE_STOPPING) { + /* STOPPING = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read until EOI */ + while (! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + /* Do final cleanup */ + (*cinfo->src->term_source) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); + return TRUE; +} diff --git a/dcmjpeg/libijg16/jdapistd.c b/dcmjpeg/libijg16/jdapistd.c new file mode 100644 index 00000000..961eb438 --- /dev/null +++ b/dcmjpeg/libijg16/jdapistd.c @@ -0,0 +1,275 @@ +/* + * jdapistd.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-decompression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_decompress, it will end up linking in the entire decompressor. + * We thus must separate this file from jdapimin.c to avoid linking the + * whole decompression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Forward declarations */ +LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo)); + + +/* + * Decompression initialization. + * jpeg_read_header must be completed before calling this. + * + * If a multipass operating mode was selected, this will do all but the + * last pass, and thus may take a great deal of time. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_start_decompress (j_decompress_ptr cinfo) +{ + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize master control, select active modules */ + jinit_master_decompress(cinfo); + if (cinfo->buffered_image) { + /* No more work here; expecting jpeg_start_output next */ + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; + } + cinfo->global_state = DSTATE_PRELOAD; + } + if (cinfo->global_state == DSTATE_PRELOAD) { + /* If file has multiple scans, absorb them all into the coef buffer */ + if (cinfo->inputctl->has_multiple_scans) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return FALSE; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* jdmaster underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + } + cinfo->output_scan_number = cinfo->input_scan_number; + } else if (cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any dummy output passes, and set up for the final pass */ + return output_pass_setup(cinfo); +} + + +/* + * Set up for an output pass, and perform any dummy pass(es) needed. + * Common subroutine for jpeg_start_decompress and jpeg_start_output. + * Entry: global_state = DSTATE_PRESCAN only if previously suspended. + * Exit: If done, returns TRUE and sets global_state for proper output mode. + * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. + */ + +LOCAL(boolean) +output_pass_setup (j_decompress_ptr cinfo) +{ + if (cinfo->global_state != DSTATE_PRESCAN) { + /* First call: do pass setup */ + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; + cinfo->global_state = DSTATE_PRESCAN; + } + /* Loop over any required dummy passes */ + while (cinfo->master->is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Crank through the dummy pass */ + while (cinfo->output_scanline < cinfo->output_height) { + JDIMENSION last_scanline; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* Process some data */ + last_scanline = cinfo->output_scanline; + (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL, + &cinfo->output_scanline, (JDIMENSION) 0); + if (cinfo->output_scanline == last_scanline) + return FALSE; /* No progress made, must suspend */ + } + /* Finish up dummy pass, and set up for another one */ + (*cinfo->master->finish_output_pass) (cinfo); + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } + /* Ready for application to drive output pass through + * jpeg_read_scanlines or jpeg_read_raw_data. + */ + cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING; + return TRUE; +} + + +/* + * Read some scanlines of data from the JPEG decompressor. + * + * The return value will be the number of lines actually read. + * This may be less than the number requested in several cases, + * including bottom of image, data source suspension, and operating + * modes that emit multiple scanlines at a time. + * + * Note: we warn about excess calls to jpeg_read_scanlines() since + * this likely signals an application programmer error. However, + * an oversize buffer (max_lines > scanlines remaining) is not an error. + */ + +GLOBAL(JDIMENSION) +jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION max_lines) +{ + JDIMENSION row_ctr; + + if (cinfo->global_state != DSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Process some data */ + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines); + cinfo->output_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to read raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION max_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != DSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Verify that at least one iMCU row can be returned. */ + lines_per_iMCU_row = (JDIMENSION)(cinfo->max_v_samp_factor * cinfo->min_codec_data_unit); + if (max_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Decompress directly into user's buffer. */ + if (! (*cinfo->codec->decompress_data) (cinfo, data)) + return 0; /* suspension forced, can do nothing more */ + + /* OK, we processed one iMCU row. */ + cinfo->output_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} + + +/* Additional entry points for buffered-image mode. */ + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Initialize for an output pass in buffered-image mode. + */ + +GLOBAL(boolean) +jpeg_start_output (j_decompress_ptr cinfo, int scan_number) +{ + if (cinfo->global_state != DSTATE_BUFIMAGE && + cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Limit scan number to valid range */ + if (scan_number <= 0) + scan_number = 1; + if (cinfo->inputctl->eoi_reached && + scan_number > cinfo->input_scan_number) + scan_number = cinfo->input_scan_number; + cinfo->output_scan_number = scan_number; + /* Perform any dummy output passes, and set up for the real pass */ + return output_pass_setup(cinfo); +} + + +/* + * Finish up after an output pass in buffered-image mode. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_output (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) { + /* Terminate this pass. */ + /* We do not require the whole pass to have been completed. */ + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_BUFPOST; + } else if (cinfo->global_state != DSTATE_BUFPOST) { + /* BUFPOST = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read markers looking for SOS or EOI */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jdarith.c b/dcmjpeg/libijg16/jdarith.c new file mode 100644 index 00000000..8bacb66a --- /dev/null +++ b/dcmjpeg/libijg16/jdarith.c @@ -0,0 +1,26 @@ +/* + * jdarith.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy decoding routines. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * Module initialization routine for arithmetic entropy decoding. + */ +GLOBAL(void) +jinit_arith_decoder (j_decompress_ptr cinfo); + +GLOBAL(void) +jinit_arith_decoder (j_decompress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +} diff --git a/dcmjpeg/libijg16/jdatadst.c b/dcmjpeg/libijg16/jdatadst.c new file mode 100644 index 00000000..d429d07c --- /dev/null +++ b/dcmjpeg/libijg16/jdatadst.c @@ -0,0 +1,151 @@ +/* + * jdatadst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains compression data destination routines for the case of + * emitting JPEG data to a file (or any stdio stream). While these routines + * are sufficient for most applications, some will want to use a different + * destination manager. + * IMPORTANT: we assume that fwrite() will correctly transcribe an array of + * JOCTETs into 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jerror16.h" + + +/* Expanded data destination object for stdio output */ + +typedef struct { + struct jpeg_destination_mgr pub; /* public fields */ + + FILE * outfile; /* target stream */ + JOCTET * buffer; /* start of buffer */ +} my_destination_mgr; + +typedef my_destination_mgr * my_dest_ptr; + +#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ + + +/* + * Initialize destination --- called by jpeg_start_compress + * before any data is actually written. + */ + +METHODDEF(void) +init_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + /* Allocate the output buffer --- it will be released when done with image */ + dest->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; +} + + +/* + * Empty the output buffer --- called whenever buffer fills up. + * + * In typical applications, this should write the entire output buffer + * (ignoring the current state of next_output_byte & free_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been dumped. + * + * In applications that need to be able to suspend compression due to output + * overrun, a FALSE return indicates that the buffer cannot be emptied now. + * In this situation, the compressor will return to its caller (possibly with + * an indication that it has not accepted all the supplied scanlines). The + * application should resume compression after it has made more room in the + * output buffer. Note that there are substantial restrictions on the use of + * suspension --- see the documentation. + * + * When suspending, the compressor will back up to a convenient restart point + * (typically the start of the current MCU). next_output_byte & free_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point will be regenerated after resumption, so do not + * write it out when emptying the buffer externally. + */ + +METHODDEF(boolean) +empty_output_buffer (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) != + (size_t) OUTPUT_BUF_SIZE) + ERREXIT(cinfo, JERR_FILE_WRITE); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; + + return TRUE; +} + + +/* + * Terminate destination --- called by jpeg_finish_compress + * after all data has been written. Usually needs to flush buffer. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; + + /* Write any data remaining in the buffer */ + if (datacount > 0) { + if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount) + ERREXIT(cinfo, JERR_FILE_WRITE); + } + fflush(dest->outfile); + /* Make sure we wrote the output file OK */ + if (ferror(dest->outfile)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * Prepare for output to a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing compression. + */ + +GLOBAL(void) +jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) +{ + my_dest_ptr dest; + + /* The destination object is made permanent so that multiple JPEG images + * can be written to the same file without re-executing jpeg_stdio_dest. + * This makes it dangerous to use this manager and a different destination + * manager serially with the same JPEG object, because their private object + * sizes may be different. Caveat programmer. + */ + if (cinfo->dest == NULL) { /* first time for this JPEG object? */ + cinfo->dest = (struct jpeg_destination_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_destination_mgr)); + } + + dest = (my_dest_ptr) cinfo->dest; + dest->pub.init_destination = init_destination; + dest->pub.empty_output_buffer = empty_output_buffer; + dest->pub.term_destination = term_destination; + dest->outfile = outfile; +} diff --git a/dcmjpeg/libijg16/jdatasrc.c b/dcmjpeg/libijg16/jdatasrc.c new file mode 100644 index 00000000..99f8d13a --- /dev/null +++ b/dcmjpeg/libijg16/jdatasrc.c @@ -0,0 +1,212 @@ +/* + * jdatasrc.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains decompression data source routines for the case of + * reading JPEG data from a file (or any stdio stream). While these routines + * are sufficient for most applications, some will want to use a different + * source manager. + * IMPORTANT: we assume that fread() will correctly transcribe an array of + * JOCTETs from 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jerror16.h" + + +/* Expanded data source object for stdio input */ + +typedef struct { + struct jpeg_source_mgr pub; /* public fields */ + + FILE * infile; /* source stream */ + JOCTET * buffer; /* start of buffer */ + boolean start_of_file; /* have we gotten any data yet? */ +} my_source_mgr; + +typedef my_source_mgr * my_src_ptr; + +#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ + + +/* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ + +METHODDEF(void) +init_source (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_file = TRUE; +} + + +/* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. + */ + +METHODDEF(boolean) +fill_input_buffer (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + size_t nbytes; + + nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE); + + if (nbytes <= 0) { + if (src->start_of_file) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_file = FALSE; + + return TRUE; +} + + +/* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ + +METHODDEF(void) +skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) { + while (num_bytes > (long) src->pub.bytes_in_buffer) { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } +} + + +/* + * An additional method that can be provided by data source modules is the + * resync_to_restart method for error recovery in the presence of RST markers. + * For the moment, this source module just uses the default resync method + * provided by the JPEG library. That method assumes that no backtracking + * is possible. + */ + + +/* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Prepare for input from a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + +GLOBAL(void) +jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) +{ + my_src_ptr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling jpeg_stdio_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_source_mgr)); + src = (my_src_ptr) cinfo->src; + src->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + INPUT_BUF_SIZE * SIZEOF(JOCTET)); + } + + src = (my_src_ptr) cinfo->src; + src->pub.init_source = init_source; + src->pub.fill_input_buffer = fill_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = term_source; + src->infile = infile; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} diff --git a/dcmjpeg/libijg16/jdcoefct.c b/dcmjpeg/libijg16/jdcoefct.c new file mode 100644 index 00000000..332b4982 --- /dev/null +++ b/dcmjpeg/libijg16/jdcoefct.c @@ -0,0 +1,743 @@ +/* + * jdcoefct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for decompression. + * This controller is the top level of the lossy JPEG decompressor proper. + * The coefficient buffer lies between entropy decoding and inverse-DCT steps. + * + * In buffered-image mode, this controller is the interface between + * input-oriented processing and output-oriented processing. + * Also, the input side (only) is used when reading a file for transcoding. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" + +/* Block smoothing is only applicable for progressive JPEG, so: */ +#ifndef D_PROGRESSIVE_SUPPORTED +#undef BLOCK_SMOOTHING_SUPPORTED +#endif + +/* Private buffer controller object */ + +typedef struct { + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + /* In single-pass modes, it's sufficient to buffer just one MCU. + * We allocate a workspace of D_MAX_DATA_UNITS_IN_MCU coefficient blocks, + * and let the entropy decoder write into that workspace each time. + * (On 80x86, the workspace is FAR even though it's not really very big; + * this is to keep the module interfaces unchanged when a large coefficient + * buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays; it is used only by the input side. + */ + JBLOCKROW MCU_buffer[D_MAX_DATA_UNITS_IN_MCU]; + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +#endif + +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* When doing block smoothing, we latch coefficient Al values here */ + int * coef_bits_latch; +#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ +#endif +} d_coef_controller; + +typedef d_coef_controller * d_coef_ptr; + +/* Forward declarations */ +METHODDEF(int) decompress_onepass + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#ifdef D_MULTISCAN_FILES_SUPPORTED +METHODDEF(int) decompress_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif +#ifdef BLOCK_SMOOTHING_SUPPORTED +LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo)); +METHODDEF(int) decompress_smooth_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->MCU_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + cinfo->input_iMCU_row = 0; + start_iMCU_row(cinfo); +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ +#ifdef BLOCK_SMOOTHING_SUPPORTED + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + /* d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; */ + + /* If multipass, check to see whether to use block smoothing on this pass */ + if (lossyd->coef_arrays != NULL) { + if (cinfo->do_block_smoothing && smoothing_ok(cinfo)) + lossyd->pub.decompress_data = decompress_smooth_data; + else + lossyd->pub.decompress_data = decompress_data; + } +#endif + cinfo->output_iMCU_row = 0; +} + + +/* + * Decompress and return some data in the single-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Input and output must run in lockstep since we have only a one-MCU buffer. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(int) +decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, useful_width; + JSAMPARRAY output_ptr; + JDIMENSION start_col, output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Loop to process as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */ + jzero_far((void FAR *) coef->MCU_buffer[0], + (size_t)cinfo->data_units_in_MCU * SIZEOF(JBLOCK)); + if (! (*lossyd->entropy_decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + /* Determine where data should go in output_buf and do the IDCT thing. + * We skip dummy blocks at the right and bottom edges (but blkn gets + * incremented past them!). Note the inner loop relies on having + * allocated the MCU_buffer[] blocks sequentially. + */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) { + blkn += compptr->MCU_data_units; + continue; + } + inverse_DCT = lossyd->inverse_DCT[compptr->component_index]; + useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + output_ptr = output_buf[compptr->component_index] + + yoffset * compptr->codec_data_unit; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_sample_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (cinfo->input_iMCU_row < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + output_col = start_col; + for (xindex = 0; xindex < useful_width; xindex++) { + (*inverse_DCT) (cinfo, compptr, + (JCOEFPTR) coef->MCU_buffer[blkn+xindex], + output_ptr, output_col); + output_col += (JDIMENSION)compptr->codec_data_unit; + } + } + blkn += compptr->MCU_width; + output_ptr += compptr->codec_data_unit; + } + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + cinfo->output_iMCU_row++; + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Dummy consume-input routine for single-pass operation. + */ + +METHODDEF(int) +dummy_consume_data (j_decompress_ptr cinfo) +{ + return JPEG_SUSPENDED; /* Always indicate nothing was done */ +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Consume input data and store it in the full-image coefficient buffer. + * We read as much as one fully interleaved MCU row ("iMCU" row) per call, + * ie, v_samp_factor block rows for each component in the scan. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + */ + +METHODDEF(int) +consume_data (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + cinfo->input_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + /* Note: entropy decoder expects buffer to be zeroed, + * but this is handled automatically by the memory manager + * because we requested a pre-zeroed array. + */ + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to fetch the MCU. */ + if (! (*lossyd->entropy_decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Decompress and return some data in the multi-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image. + */ + +METHODDEF(int) +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num; + int ci, block_row, block_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number < cinfo->output_scan_number || + (cinfo->input_scan_number == cinfo->output_scan_number && + cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + cinfo->output_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + inverse_DCT = lossyd->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + output_col = 0; + for (block_num = 0; block_num < compptr->width_in_data_units; block_num++) { + (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr, + output_ptr, output_col); + buffer_ptr++; + output_col += (JDIMENSION)compptr->codec_data_unit; + } + output_ptr += compptr->codec_data_unit; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +#ifdef BLOCK_SMOOTHING_SUPPORTED + +/* + * This code applies interblock smoothing as described by section K.8 + * of the JPEG standard: the first 5 AC coefficients are estimated from + * the DC values of a DCT block and its 8 neighboring blocks. + * We apply smoothing only for progressive JPEG decoding, and only if + * the coefficients it can estimate are not yet known to full precision. + */ + +/* Natural-order array positions of the first 5 zigzag-order coefficients */ +#define Q01_POS 1 +#define Q10_POS 8 +#define Q20_POS 16 +#define Q11_POS 9 +#define Q02_POS 2 + +/* + * Determine whether block smoothing is applicable and safe. + * We also latch the current states of the coef_bits[] entries for the + * AC coefficients; otherwise, if the input side of the decompressor + * advances into a new scan, we might think the coefficients are known + * more accurately than they really are. + */ + +LOCAL(boolean) +smoothing_ok (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + boolean smoothing_useful = FALSE; + int ci, coefi; + jpeg_component_info *compptr; + JQUANT_TBL * qtable; + int * coef_bits; + int * coef_bits_latch; + + if ((! (cinfo->process == JPROC_PROGRESSIVE)) || cinfo->coef_bits == NULL) + return FALSE; + + /* Allocate latch area if not already done */ + if (coef->coef_bits_latch == NULL) + coef->coef_bits_latch = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * + (SAVED_COEFS * SIZEOF(int))); + coef_bits_latch = coef->coef_bits_latch; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* All components' quantization values must already be latched. */ + if ((qtable = compptr->quant_table) == NULL) + return FALSE; + /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */ + if (qtable->quantval[0] == 0 || + qtable->quantval[Q01_POS] == 0 || + qtable->quantval[Q10_POS] == 0 || + qtable->quantval[Q20_POS] == 0 || + qtable->quantval[Q11_POS] == 0 || + qtable->quantval[Q02_POS] == 0) + return FALSE; + /* DC values must be at least partly known for all components. */ + coef_bits = cinfo->coef_bits[ci]; + if (coef_bits[0] < 0) + return FALSE; + /* Block smoothing is helpful if some AC coefficients remain inaccurate. */ + for (coefi = 1; coefi <= 5; coefi++) { + coef_bits_latch[coefi] = coef_bits[coefi]; + if (coef_bits[coefi] != 0) + smoothing_useful = TRUE; + } + coef_bits_latch += SAVED_COEFS; + } + + return smoothing_useful; +} + + +/* + * Variant of decompress_data for use when doing block smoothing. + */ + +METHODDEF(int) +decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num, last_block_column; + int ci, block_row, block_rows, access_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr, prev_block_row, next_block_row; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + boolean first_row, last_row; + JBLOCK workspace; + int *coef_bits; + JQUANT_TBL *quanttbl; + IJG_INT32 Q00,Q01,Q02,Q10,Q11,Q20, num; + int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9; + int Al, pred; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if (cinfo->input_scan_number == cinfo->output_scan_number) { + /* If input is working on current scan, we ordinarily want it to + * have completed the current row. But if input scan is DC, + * we want it to keep one row ahead so that next block row's DC + * values are up to date. + */ + JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0; + if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta) + break; + } + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) { + block_rows = compptr->v_samp_factor; + access_rows = block_rows * 2; /* this and next iMCU row */ + last_row = FALSE; + } else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + access_rows = block_rows; /* this iMCU row only */ + last_row = TRUE; + } + /* Align the virtual buffer for this component. */ + if (cinfo->output_iMCU_row > 0) { + access_rows += compptr->v_samp_factor; /* prior iMCU row too */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (cinfo->output_iMCU_row - 1) * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) access_rows, FALSE); + buffer += compptr->v_samp_factor; /* point to current iMCU row */ + first_row = FALSE; + } else { + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE); + first_row = TRUE; + } + /* Fetch component-dependent info */ + coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS); + quanttbl = compptr->quant_table; + Q00 = quanttbl->quantval[0]; + Q01 = quanttbl->quantval[Q01_POS]; + Q10 = quanttbl->quantval[Q10_POS]; + Q20 = quanttbl->quantval[Q20_POS]; + Q11 = quanttbl->quantval[Q11_POS]; + Q02 = quanttbl->quantval[Q02_POS]; + inverse_DCT = lossyd->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + if (first_row && block_row == 0) + prev_block_row = buffer_ptr; + else + prev_block_row = buffer[block_row-1]; + if (last_row && block_row == block_rows-1) + next_block_row = buffer_ptr; + else + next_block_row = buffer[block_row+1]; + /* We fetch the surrounding DC values using a sliding-register approach. + * Initialize all nine here so as to do the right thing on narrow pics. + */ + DC1 = DC2 = DC3 = (int) prev_block_row[0][0]; + DC4 = DC5 = DC6 = (int) buffer_ptr[0][0]; + DC7 = DC8 = DC9 = (int) next_block_row[0][0]; + output_col = 0; + last_block_column = compptr->width_in_data_units - 1; + for (block_num = 0; block_num <= last_block_column; block_num++) { + /* Fetch current DCT block into workspace so we can modify it. */ + jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1); + /* Update DC values */ + if (block_num < last_block_column) { + DC3 = (int) prev_block_row[1][0]; + DC6 = (int) buffer_ptr[1][0]; + DC9 = (int) next_block_row[1][0]; + } + /* Compute coefficient estimates per K.8. + * An estimate is applied only if coefficient is still zero, + * and is not known to be fully accurate. + */ + /* AC01 */ + if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { + num = 36 * Q00 * (DC4 - DC6); + if (num >= 0) { + pred = (int) (((Q01<<7) + num) / (Q01<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q10<<7) + num) / (Q10<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q20<<7) + num) / (Q20<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q11<<7) + num) / (Q11<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q02<<7) + num) / (Q02<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<codec_data_unit; + } + output_ptr += compptr->codec_data_unit; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* BLOCK_SMOOTHING_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef; + + coef = (d_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_coef_controller)); + lossyd->coef_private = (void *) coef; + lossyd->coef_start_input_pass = start_input_pass; + lossyd->coef_start_output_pass = start_output_pass; +#ifdef BLOCK_SMOOTHING_SUPPORTED + coef->coef_bits_latch = NULL; +#endif + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + /* Note we ask for a pre-zeroed array. */ + int ci, access_rows; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + access_rows = compptr->v_samp_factor; +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* If block smoothing could be used, need a bigger window */ + if (cinfo->process == JPROC_PROGRESSIVE) + access_rows *= 3; +#endif + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) access_rows); + } + lossyd->pub.consume_data = consume_data; + lossyd->pub.decompress_data = decompress_data; + lossyd->coef_arrays = coef->whole_image; /* link to virtual arrays */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + D_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < D_MAX_DATA_UNITS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + lossyd->pub.consume_data = dummy_consume_data; + lossyd->pub.decompress_data = decompress_onepass; + lossyd->coef_arrays = NULL; /* flag for no virtual arrays */ + } +} diff --git a/dcmjpeg/libijg16/jdcolor.c b/dcmjpeg/libijg16/jdcolor.c new file mode 100644 index 00000000..c9814eea --- /dev/null +++ b/dcmjpeg/libijg16/jdcolor.c @@ -0,0 +1,413 @@ +/* + * jdcolor.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains output colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_deconverter pub; /* public fields */ + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + IJG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + IJG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ +} my_color_deconverter; + +typedef my_color_deconverter * my_cconvert_ptr; + + +/**************** YCbCr -> RGB conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb + * where Cb and Cr represent the incoming values less CENTERJSAMPLE. + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * Notice that Y, being an integral input, does not contribute any fraction + * so it need not participate in the rounding. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times Cb and Cr for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The Cr=>R and Cb=>B values can be rounded to integers in advance; the + * values for the G calculation are left scaled up, since we must add them + * together before rounding. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L<RGB colorspace conversion. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + int i; + IJG_INT32 x; +#if BITS_IN_JSAMPLE == 16 + /* no need for temporaries */ +#else + SHIFT_TEMPS +#endif + + cconvert->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cr_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + cconvert->Cb_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + +#if BITS_IN_JSAMPLE == 16 + /* Bug fix 2001-11-06 by Eichelberg: The integer routines below + produce an overflow when used with MAXJSAMPLE == 65535. + Use floating point calculation instead. */ + + /* Cr=>R value is nearest int to 1.40200 * x */ + cconvert->Cr_r_tab[i] = (int)(1.40200 * (double)x + 0.5); + /* Cb=>B value is nearest int to 1.77200 * x */ + cconvert->Cb_b_tab[i] = (int)(1.77200 * (double)x + 0.5); +#else + /* Cr=>R value is nearest int to 1.40200 * x */ + cconvert->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + cconvert->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); +#endif + + /* Cr=>G value is scaled-up -0.71414 * x */ + cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Convert some rows of samples to the output colorspace. + * + * Note that we change from noninterleaved, one-plane-per-component format + * to interleaved-pixel format. The output buffer is therefore three times + * as wide as the input buffer. + * A starting row offset is provided only for the input buffer. The caller + * can easily adjust the passed output_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +ycc_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register IJG_INT32 * Crgtab = cconvert->Cr_g_tab; + register IJG_INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; + outptr[RGB_GREEN] = range_limit[y + + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS))]; + outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/**************** Cases other than YCbCr -> RGB **************/ + + +/* + * Color conversion for no colorspace change: just copy the data, + * converting from separate-planes to interleaved representation. + */ + +METHODDEF(void) +null_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW inptr, outptr; + register JDIMENSION count; + register int num_components = cinfo->num_components; + JDIMENSION num_cols = cinfo->output_width; + int ci; + + while (--num_rows >= 0) { + for (ci = 0; ci < num_components; ci++) { + inptr = input_buf[ci][input_row]; + outptr = output_buf[0] + ci; + for (count = num_cols; count > 0; count--) { + *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ + outptr += num_components; + } + } + input_row++; + output_buf++; + } +} + + +/* + * Color conversion for grayscale: just copy the data. + * This also works for YCbCr -> grayscale conversion, in which + * we just copy the Y (luminance) component and ignore chrominance. + */ + +METHODDEF(void) +grayscale_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0, + num_rows, cinfo->output_width); +} + + +/* + * Convert grayscale to RGB: just duplicate the graylevel three times. + * This is provided to support applications that don't want to cope + * with grayscale as a separate case. + */ + +METHODDEF(void) +gray_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW inptr, outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr = input_buf[0][input_row++]; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + /* We can dispense with GETJSAMPLE() here */ + outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Adobe-style YCCK->CMYK conversion. + * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same + * conversion as above, while passing K (black) unchanged. + * We assume build_ycc_rgb_table has been called. + */ + +METHODDEF(void) +ycck_cmyk_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2, inptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register IJG_INT32 * Crgtab = cconvert->Cr_g_tab; + register IJG_INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + inptr3 = input_buf[3][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */ + outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */ + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS)))]; + outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */ + /* K passes through unchanged */ + outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */ + outptr += 4; + } + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +start_pass_dcolor (j_decompress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for output colorspace conversion. + */ + +GLOBAL(void) +jinit_color_deconverter (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + int ci; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_deconverter)); + cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert; + cconvert->pub.start_pass = start_pass_dcolor; + + /* Make sure num_components agrees with jpeg_color_space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_RGB: + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->num_components < 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + } + + /* Set out_color_components and conversion method based on requested space. + * Also clear the component_needed flags for any unused components, + * so that earlier pipeline stages can avoid useless computation. + */ + + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + if (cinfo->jpeg_color_space == JCS_GRAYSCALE || + cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = grayscale_convert; + /* For color->grayscale conversion, only the Y (0) component is needed */ + for (ci = 1; ci < cinfo->num_components; ci++) + cinfo->comp_info[ci].component_needed = FALSE; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + cinfo->out_color_components = RGB_PIXELSIZE; + if (cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = ycc_rgb_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) { + cconvert->pub.color_convert = gray_rgb_convert; + } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) { + cconvert->pub.color_convert = null_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + cinfo->out_color_components = 4; + if (cinfo->jpeg_color_space == JCS_YCCK) { + cconvert->pub.color_convert = ycck_cmyk_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_CMYK) { + cconvert->pub.color_convert = null_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: + /* Permit null conversion to same output space */ + if (cinfo->out_color_space == cinfo->jpeg_color_space) { + cinfo->out_color_components = cinfo->num_components; + cconvert->pub.color_convert = null_convert; + } else /* unsupported non-null conversion */ + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + + if (cinfo->quantize_colors) + cinfo->output_components = 1; /* single colormapped output component */ + else + cinfo->output_components = cinfo->out_color_components; +} diff --git a/dcmjpeg/libijg16/jdct16.h b/dcmjpeg/libijg16/jdct16.h new file mode 100644 index 00000000..447f331a --- /dev/null +++ b/dcmjpeg/libijg16/jdct16.h @@ -0,0 +1,176 @@ +/* + * jdct.h + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the forward and + * inverse DCT modules. These declarations are private to the DCT managers + * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. + * The individual DCT algorithms are kept in separate files to ease + * machine-dependent tuning (e.g., assembly coding). + */ + + +/* + * A forward DCT routine is given a pointer to a work area of type DCTELEM[]; + * the DCT is to be performed in-place in that buffer. Type DCTELEM is int + * for 8-bit samples, IJG_INT32 for 12-bit samples. (NOTE: Floating-point DCT + * implementations use an array of type FAST_FLOAT, instead.) + * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE). + * The DCT outputs are returned scaled up by a factor of 8; they therefore + * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This + * convention improves accuracy in integer implementations and saves some + * work in floating-point ones. + * Quantization of the output coefficients is done by jcdctmgr.c. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef int DCTELEM; /* 16 or 32 bits is fine */ +#else +typedef IJG_INT32 DCTELEM; /* must have 32 bits */ +#endif + +typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data)); +typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data)); + + +/* + * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer + * to an output sample array. The routine must dequantize the input data as + * well as perform the IDCT; for dequantization, it uses the multiplier table + * pointed to by compptr->dct_table. The output data is to be placed into the + * sample array starting at a specified column. (Any row offset needed will + * be applied to the array pointer before it is passed to the IDCT code.) + * Note that the number of samples emitted by the IDCT routine is + * DCT_scaled_size * DCT_scaled_size. + */ + +/* typedef inverse_DCT_method_ptr is declared in jpegint.h */ + +/* + * Each IDCT routine has its own ideas about the best dct_table element type. + */ + +typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ +#if BITS_IN_JSAMPLE == 8 +typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ +#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ +#else +typedef IJG_INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ +#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ +#endif +typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ + + +/* + * Each IDCT routine is responsible for range-limiting its results and + * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could + * be quite far out of range if the input data is corrupt, so a bulletproof + * range-limiting step is required. We use a mask-and-table-lookup method + * to do the combined operations quickly. See the comments with + * prepare_range_limit_table (in jdmaster.c) for more info. + */ + +#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) + +#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_fdct_islow jpeg16_fdct_islow +#define jpeg_fdct_ifast jpeg16_fdct_ifast +#define jpeg_fdct_float jpeg16_fdct_float +#define jpeg_idct_islow jpeg16_idct_islow +#define jpeg_idct_ifast jpeg16_idct_ifast +#define jpeg_idct_float jpeg16_idct_float +#define jpeg_idct_4x4 jpeg16_idct_4x4 +#define jpeg_idct_2x2 jpeg16_idct_2x2 +#define jpeg_idct_1x1 jpeg16_idct_1x1 +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Extern declarations for the forward and inverse DCT routines. */ + +EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data)); +EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data)); +EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data)); + +EXTERN(void) jpeg_idct_islow + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_ifast + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_float + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_4x4 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_2x2 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_1x1 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + const JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); + + +/* + * Macros for handling fixed-point arithmetic; these are used by many + * but not all of the DCT/IDCT modules. + * + * All values are expected to be of type IJG_INT32. + * Fractional constants are scaled left by CONST_BITS bits. + * CONST_BITS is defined within each module using these macros, + * and may differ from one module to the next. + */ + +#define ONE ((IJG_INT32) 1) +#define CONST_SCALE (ONE << CONST_BITS) + +/* Convert a positive real constant to an integer scaled by CONST_SCALE. + * Caution: some C compilers fail to reduce "FIX(constant)" at compile time, + * thus causing a lot of useless floating-point operations at run time. + */ + +#define FIX(x) ((IJG_INT32) ((x) * CONST_SCALE + 0.5)) + +/* Descale and correctly round an IJG_INT32 value that's scaled by N bits. + * We assume RIGHT_SHIFT rounds towards minus infinity, so adding + * the fudge factor is correct for either sign of X. + */ + +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * This macro is used only when the two inputs will actually be no more than + * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a + * full 32x32 multiply. This provides a useful speedup on many machines. + * Unfortunately there is no way to specify a 16x16->32 multiply portably + * in C, but some C compilers will do the right thing if you provide the + * correct combination of casts. + */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) +#endif +#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((IJG_INT32) (const))) +#endif + +#ifndef MULTIPLY16C16 /* default definition */ +#define MULTIPLY16C16(var,const) ((var) * (const)) +#endif + +/* Same except both inputs are variables. */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2))) +#endif + +#ifndef MULTIPLY16V16 /* default definition */ +#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) +#endif diff --git a/dcmjpeg/libijg16/jddctmgr.c b/dcmjpeg/libijg16/jddctmgr.c new file mode 100644 index 00000000..081c5741 --- /dev/null +++ b/dcmjpeg/libijg16/jddctmgr.c @@ -0,0 +1,270 @@ +/* + * jddctmgr.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the inverse-DCT management logic. + * This code selects a particular IDCT implementation to be used, + * and it performs related housekeeping chores. No code in this file + * is executed per IDCT step, only during output pass setup. + * + * Note that the IDCT routines are responsible for performing coefficient + * dequantization as well as the IDCT proper. This module sets up the + * dequantization multiplier table needed by the IDCT routine. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy subsystem */ +#include "jdct16.h" /* Private declarations for DCT subsystem */ + + +/* + * The decompressor input side (jdinput.c) saves away the appropriate + * quantization table for each component at the start of the first scan + * involving that component. (This is necessary in order to correctly + * decode files that reuse Q-table slots.) + * When we are ready to make an output pass, the saved Q-table is converted + * to a multiplier table that will actually be used by the IDCT routine. + * The multiplier table contents are IDCT-method-dependent. To support + * application changes in IDCT method between scans, we can remake the + * multiplier tables if necessary. + * In buffered-image mode, the first output pass may occur before any data + * has been seen for some components, and thus before their Q-tables have + * been saved away. To handle this case, multiplier tables are preset + * to zeroes; the result of the IDCT will be a neutral gray level. + */ + + +/* Private subobject for this module */ + +typedef struct { + /* This array contains the IDCT method code that each multiplier table + * is currently set up for, or -1 if it's not yet set up. + * The actual multiplier tables are pointed to by dct_table in the + * per-component comp_info structures. + */ + int cur_method[MAX_COMPONENTS]; +} idct_controller; + +typedef idct_controller * idct_ptr; + + +/* Allocated multiplier tables: big enough for any supported variant */ + +typedef union { + ISLOW_MULT_TYPE islow_array[DCTSIZE2]; +#ifdef DCT_IFAST_SUPPORTED + IFAST_MULT_TYPE ifast_array[DCTSIZE2]; +#endif +#ifdef DCT_FLOAT_SUPPORTED + FLOAT_MULT_TYPE float_array[DCTSIZE2]; +#endif +} multiplier_table; + + +/* The current scaled-IDCT routines require ISLOW-style multiplier tables, + * so be sure to compile that code if either ISLOW or SCALING is requested. + */ +#ifdef DCT_ISLOW_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#else +#ifdef IDCT_SCALING_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#endif +#endif + + +/* + * Prepare for an output pass. + * Here we select the proper IDCT routine for each component and build + * a matching multiplier table. + */ + +METHODDEF(void) +start_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + idct_ptr idct = (idct_ptr) lossyd->idct_private; + int ci, i; + jpeg_component_info *compptr; + int method = 0; + inverse_DCT_method_ptr method_ptr = NULL; + JQUANT_TBL * qtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Select the proper IDCT routine for this component's scaling */ + switch (compptr->codec_data_unit) { +#ifdef IDCT_SCALING_SUPPORTED + case 1: + method_ptr = jpeg_idct_1x1; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; + case 2: + method_ptr = jpeg_idct_2x2; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; + case 4: + method_ptr = jpeg_idct_4x4; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; +#endif + case DCTSIZE: + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + method_ptr = jpeg_idct_islow; + method = JDCT_ISLOW; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + method_ptr = jpeg_idct_ifast; + method = JDCT_IFAST; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + method_ptr = jpeg_idct_float; + method = JDCT_FLOAT; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + break; + default: + ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->codec_data_unit); + break; + } + lossyd->inverse_DCT[ci] = method_ptr; + /* Create multiplier table from quant table. + * However, we can skip this if the component is uninteresting + * or if we already built the table. Also, if no quant table + * has yet been saved for the component, we leave the + * multiplier table all-zero; we'll be reading zeroes from the + * coefficient controller's buffer anyway. + */ + if (! compptr->component_needed || idct->cur_method[ci] == method) + continue; + qtbl = compptr->quant_table; + if (qtbl == NULL) /* happens if no data yet for component */ + continue; + idct->cur_method[ci] = method; + switch (method) { +#ifdef PROVIDE_ISLOW_TABLES + case JDCT_ISLOW: + { + /* For LL&M IDCT method, multipliers are equal to raw quantization + * coefficients, but are stored as ints to ensure access efficiency. + */ + ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; + for (i = 0; i < DCTSIZE2; i++) { + ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; + } + } + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * For integer operation, the multiplier table is to be scaled by + * IFAST_SCALE_BITS. + */ + IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + for (i = 0; i < DCTSIZE2; i++) { + ifmtbl[i] = (IFAST_MULT_TYPE) + DESCALE(MULTIPLY16V16((IJG_INT32) qtbl->quantval[i], + (IJG_INT32) aanscales[i]), + CONST_BITS-IFAST_SCALE_BITS); + } + } + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + */ + FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fmtbl[i] = (FLOAT_MULT_TYPE) + ((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col]); + i++; + } + } + } + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Initialize IDCT manager. + */ + +GLOBAL(void) +jinit_inverse_dct (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + idct_ptr idct; + int ci; + jpeg_component_info *compptr; + + idct = (idct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(idct_controller)); + lossyd->idct_private = (void *) idct; + lossyd->idct_start_pass = start_pass; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate and pre-zero a multiplier table for each component */ + compptr->dct_table = + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(multiplier_table)); + MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); + /* Mark multiplier table not yet set up for any method */ + idct->cur_method[ci] = -1; + } +} diff --git a/dcmjpeg/libijg16/jddiffct.c b/dcmjpeg/libijg16/jddiffct.c new file mode 100644 index 00000000..63d13ea6 --- /dev/null +++ b/dcmjpeg/libijg16/jddiffct.c @@ -0,0 +1,399 @@ +/* + * jddiffct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the [un]difference buffer controller for decompression. + * This controller is the top level of the lossless JPEG decompressor proper. + * The difference buffer lies between the entropy decoding and + * prediction/undifferencing steps. The undifference buffer lies between the + * prediction/undifferencing and scaling steps. + * + * In buffered-image mode, this controller is the interface between + * input-oriented processing and output-oriented processing. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" + + +#ifdef D_LOSSLESS_SUPPORTED + +/* Private buffer controller object */ + +typedef struct { + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + unsigned int restart_rows_to_go; /* MCU-rows left in this restart interval */ + unsigned int MCU_vert_offset; /* counts MCU rows within iMCU row */ + unsigned int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + JDIFFARRAY diff_buf[MAX_COMPONENTS]; /* iMCU row of differences */ + JDIFFARRAY undiff_buf[MAX_COMPONENTS]; /* iMCU row of undiff'd samples */ + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual sample array for each component. */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +#endif +} d_diff_controller; + +typedef d_diff_controller * d_diff_ptr; + +/* Forward declarations */ +METHODDEF(int) decompress_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#ifdef D_MULTISCAN_FILES_SUPPORTED +METHODDEF(int) output_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + diff->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + diff->MCU_rows_per_iMCU_row = (JDIMENSION)cinfo->cur_comp_info[0]->v_samp_factor; + else + diff->MCU_rows_per_iMCU_row = (JDIMENSION)cinfo->cur_comp_info[0]->last_row_height; + } + + diff->MCU_ctr = 0; + diff->MCU_vert_offset = 0; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + /* Check that the restart interval is an integer multiple of the number + * of MCU in an MCU-row. + */ + if (cinfo->restart_interval % cinfo->MCUs_per_row != 0) + ERREXIT2(cinfo, JERR_BAD_RESTART, + (int)cinfo->restart_interval, (int)cinfo->MCUs_per_row); + + /* Initialize restart counter */ + diff->restart_rows_to_go = cinfo->restart_interval / cinfo->MCUs_per_row; + + cinfo->input_iMCU_row = 0; + start_iMCU_row(cinfo); +} + + +/* + * Check for a restart marker & resynchronize decoder, undifferencer. + * Returns FALSE if must suspend. + */ + +METHODDEF(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + if (! (*losslsd->entropy_process_restart) (cinfo)) + return FALSE; + + (*losslsd->predict_process_restart) (cinfo); + + /* Reset restart counter */ + diff->restart_rows_to_go = cinfo->restart_interval / cinfo->MCUs_per_row; + + return TRUE; +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ + cinfo->output_iMCU_row = 0; +} + + +/* + * Decompress and return some data in the supplied buffer. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Input and output must run in lockstep since we have only a one-MCU buffer. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(int) +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_count; /* number of MCUs decoded */ + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int comp, ci, row, prev_row; + unsigned int yoffset; + jpeg_component_info *compptr; + + /* Loop to process as much as one whole iMCU row */ + for (yoffset = diff->MCU_vert_offset; yoffset < diff->MCU_rows_per_iMCU_row; + yoffset++) { + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (diff->restart_rows_to_go == 0) + if (! process_restart(cinfo)) + return JPEG_SUSPENDED; + } + + MCU_col_num = diff->MCU_ctr; + /* Try to fetch an MCU-row (or remaining portion of suspended MCU-row). */ + MCU_count = + (*losslsd->entropy_decode_mcus) (cinfo, + diff->diff_buf, yoffset, MCU_col_num, + cinfo->MCUs_per_row - MCU_col_num); + if (MCU_count != cinfo->MCUs_per_row - MCU_col_num) { + /* Suspension forced; update state counters and exit */ + diff->MCU_vert_offset = yoffset; + diff->MCU_ctr += MCU_count; + return JPEG_SUSPENDED; + } + + /* Account for restart interval (no-op if not using restarts) */ + diff->restart_rows_to_go--; + + /* Completed an MCU row, but perhaps not an iMCU row */ + diff->MCU_ctr = 0; + } + + /* + * Undifference and scale each scanline of the disassembled MCU-row + * separately. We do not process dummy samples at the end of a scanline + * or dummy rows at the end of the image. + */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + for (row = 0, prev_row = compptr->v_samp_factor - 1; + row < (cinfo->input_iMCU_row == last_iMCU_row ? + compptr->last_row_height : compptr->v_samp_factor); + prev_row = row, row++) { + (*losslsd->predict_undifference[ci]) (cinfo, ci, + diff->diff_buf[ci][row], + diff->undiff_buf[ci][prev_row], + diff->undiff_buf[ci][row], + compptr->width_in_data_units); + (*losslsd->scaler_scale) (cinfo, diff->undiff_buf[ci][row], + output_buf[ci][row], + compptr->width_in_data_units); + } + } + + /* Completed the iMCU row, advance counters for next one. + * + * NB: output_data will increment output_iMCU_row. + * This counter is not needed for the single-pass case + * or the input side of the multi-pass case. + */ + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Dummy consume-input routine for single-pass operation. + */ + +METHODDEF(int) +dummy_consume_data (j_decompress_ptr cinfo) +{ + return JPEG_SUSPENDED; /* Always indicate nothing was done */ +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Consume input data and store it in the full-image sample buffer. + * We read as much as one fully interleaved MCU row ("iMCU" row) per call, + * ie, v_samp_factor rows for each component in the scan. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + */ + +METHODDEF(int) +consume_data (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */ + /* JDIMENSION MCU_count; */ /* number of MCUs decoded */ + /* JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; */ + int comp, ci /* , yoffset, row, prev_row */; + JSAMPARRAY buffer[MAX_COMPS_IN_SCAN]; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + cinfo->input_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + } + + return decompress_data(cinfo, buffer); +} + + +/* + * Output some data from the full-image buffer sample in the multi-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image. + */ + +METHODDEF(int) +output_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int ci, samp_rows, row; + JSAMPARRAY buffer; + jpeg_component_info *compptr; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number < cinfo->output_scan_number || + (cinfo->input_scan_number == cinfo->output_scan_number && + cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + cinfo->output_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + + if (cinfo->output_iMCU_row < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + } + + for (row = 0; row < samp_rows; row++) { + MEMCOPY(output_buf[ci][row], buffer[row], + compptr->width_in_data_units * SIZEOF(JSAMPLE)); + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +/* + * Initialize difference buffer controller. + */ + +GLOBAL(void) +jinit_d_diff_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff; + int ci; + jpeg_component_info *compptr; + + diff = (d_diff_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_diff_controller)); + losslsd->diff_private = (void *) diff; + losslsd->diff_start_input_pass = start_input_pass; + losslsd->pub.start_output_pass = start_output_pass; + + /* Create the [un]difference buffers. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->diff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + diff->undiff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } + + if (need_full_buffer) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* Allocate a full-image virtual array for each component. */ + int access_rows; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + access_rows = compptr->v_samp_factor; + diff->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) access_rows); + } + losslsd->pub.consume_data = consume_data; + losslsd->pub.decompress_data = output_data; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + losslsd->pub.consume_data = dummy_consume_data; + losslsd->pub.decompress_data = decompress_data; + diff->whole_image[0] = NULL; /* flag for no virtual arrays */ + } +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jdhuff.c b/dcmjpeg/libijg16/jdhuff.c new file mode 100644 index 00000000..f83bacaf --- /dev/null +++ b/dcmjpeg/libijg16/jdhuff.c @@ -0,0 +1,325 @@ +/* + * jdhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines which are shared + * by the sequential, progressive and lossless decoders. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ +#include "jlossls16.h" /* Private declarations for lossless codec */ +#include "jdhuff16.h" /* Declarations shared with jd*huff.c */ + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +GLOBAL(void) +jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, + d_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + d_derived_tbl *dtbl; + int p, i, l, si, numsymbols; + int lookbits, ctr; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (d_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_derived_tbl)); + dtbl = *pdtbl; + dtbl->pub = htbl; /* fill in back link */ + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + numsymbols = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + * BUG FIX: Comparison must be >, not >= + */ + if (((IJG_INT32) code) > (((IJG_INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure F.15: generate decoding tables for bit-sequential decoding */ + + p = 0; + for (l = 1; l <= 16; l++) { + if (htbl->bits[l]) { + /* valoffset[l] = huffval[] index of 1st symbol of code length l, + * minus the minimum code of length l + */ + dtbl->valoffset[l] = (IJG_INT32) p - (IJG_INT32) huffcode[p]; + p += htbl->bits[l]; + dtbl->maxcode[l] = (IJG_INT32)huffcode[p-1]; /* maximum code of length l */ + } else { + dtbl->maxcode[l] = -1; /* -1 if no codes of this length */ + } + } + dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */ + + /* Compute lookahead tables to speed up decoding. + * First we set all the table entries to 0, indicating "too long"; + * then we iterate through the Huffman codes that are short enough and + * fill in all the entries that correspond to bit sequences starting + * with that code. + */ + + MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits)); + + p = 0; + for (l = 1; l <= HUFF_LOOKAHEAD; l++) { + for (i = 1; i <= (int) htbl->bits[l]; i++, p++) { + /* l = current code's length, p = its index in huffcode[] & huffval[]. */ + /* Generate left-justified code followed by all possible bit sequences */ + lookbits = (int)huffcode[p] << (HUFF_LOOKAHEAD-l); + for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) { + dtbl->look_nbits[lookbits] = l; + dtbl->look_sym[lookbits] = htbl->huffval[p]; + lookbits++; + } + } + } + + /* Validate symbols as being reasonable. + * For AC tables, we make no check, but accept all byte values 0..255. + * For DC tables, we require the symbols to be in range 0..16. + * (Tighter bounds could be applied depending on the data depth and mode, + * but this is sufficient to ensure safe decoding.) + */ + if (isDC) { + for (i = 0; i < numsymbols; i++) { + int sym = htbl->huffval[i]; + if (sym < 0 || sym > 16) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + } + } +} + + +/* + * Out-of-line code for bit fetching. + * See jdhuff.h for info about usage. + * Note: current values of get_buffer and bits_left are passed as parameters, + * but are returned in the corresponding fields of the state struct. + * + * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width + * of get_buffer to be used. (On machines with wider words, an even larger + * buffer could be used.) However, on some machines 32-bit shifts are + * quite slow and take time proportional to the number of places shifted. + * (This is true with most PC compilers, for instance.) In this case it may + * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the + * average shift distance at the cost of more calls to jpeg_fill_bit_buffer. + */ + +#ifdef SLOW_SHIFT_32 +#define MIN_GET_BITS 15 /* minimum allowable value */ +#else +#define MIN_GET_BITS (BIT_BUF_SIZE-7) +#endif + + +GLOBAL(boolean) +jpeg_fill_bit_buffer (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + int nbits) +/* Load up the bit buffer to a depth of at least nbits */ +{ + /* Copy heavily used state fields into locals (hopefully registers) */ + register const JOCTET * next_input_byte = state->next_input_byte; + register size_t bytes_in_buffer = state->bytes_in_buffer; + j_decompress_ptr cinfo = state->cinfo; + + /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */ + /* (It is assumed that no request will be for more than that many bits.) */ + /* We fail to do so only if we hit a marker or are forced to suspend. */ + + if (cinfo->unread_marker == 0) { /* cannot advance past a marker */ + while (bits_left < MIN_GET_BITS) { + register int c; + + /* Attempt to read a byte */ + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + + /* If it's 0xFF, check and discard stuffed zero byte */ + if (c == 0xFF) { + /* Loop here to discard any padding FF's on terminating marker, + * so that we can save a valid unread_marker value. NOTE: we will + * accept multiple FF's followed by a 0 as meaning a single FF data + * byte. This data pattern is not valid according to the standard. + */ + do { + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + } while (c == 0xFF); + + if (c == 0) { + /* Found FF/00, which represents an FF data byte */ + c = 0xFF; + } else { + /* Oops, it's actually a marker indicating end of compressed data. + * Save the marker code for later use. + * Fine point: it might appear that we should save the marker into + * bitread working state, not straight into permanent state. But + * once we have hit a marker, we cannot need to suspend within the + * current MCU, because we will read no more bytes from the data + * source. So it is OK to update permanent state right away. + */ + cinfo->unread_marker = c; + /* See if we need to insert some fake zero bits. */ + goto no_more_bytes; + } + } + + /* OK, load c into get_buffer */ + get_buffer = (get_buffer << 8) | c; + bits_left += 8; + } /* end while */ + } else { + no_more_bytes: + /* We get here if we've read the marker that terminates the compressed + * data segment. There should be enough bits in the buffer register + * to satisfy the request; if so, no problem. + */ + if (nbits > bits_left) { + /* Uh-oh. Report corrupted data to user and stuff zeroes into + * the data stream, so that we can produce some kind of image. + * We use a nonvolatile flag to ensure that only one warning message + * appears per data segment. + */ + huffd_common_ptr huffd; + if (cinfo->process == JPROC_LOSSLESS) + huffd = (huffd_common_ptr) ((j_lossless_d_ptr) cinfo->codec)->entropy_private; + else + huffd = (huffd_common_ptr) ((j_lossy_d_ptr) cinfo->codec)->entropy_private; + if (! huffd->insufficient_data) { + WARNMS(cinfo, JWRN_HIT_MARKER); + huffd->insufficient_data = TRUE; + } + /* Fill the buffer with zero bits */ + get_buffer <<= MIN_GET_BITS - bits_left; + bits_left = MIN_GET_BITS; + } + } + + /* Unload the local registers */ + state->next_input_byte = next_input_byte; + state->bytes_in_buffer = bytes_in_buffer; + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + return TRUE; +} + + +/* + * Out-of-line code for Huffman code decoding. + * See jdhuff.h for info about usage. + */ + +GLOBAL(int) +jpeg_huff_decode (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + d_derived_tbl * htbl, int min_bits, boolean enable_cornell_workaround) +{ + register int l = min_bits; + register IJG_INT32 code; + + /* HUFF_DECODE has determined that the code is at least min_bits */ + /* bits long, so fetch that many bits in one swoop. */ + + CHECK_BIT_BUFFER(*state, l, return -1); + code = GET_BITS(l); + + /* Collect the rest of the Huffman code one bit at a time. */ + /* This is per Figure F.16 in the JPEG spec. */ + + while (code > htbl->maxcode[l]) { + code <<= 1; + CHECK_BIT_BUFFER(*state, 1, return -1); + code |= GET_BITS(1); + l++; + } + + /* Unload the local registers */ + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + /* With garbage input we may reach the sentinel value l = 17. */ + + if (l > 16) { + WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE); + if (enable_cornell_workaround) + { + if (l == 17) + return 17; /* this is the result of the buggy Cornell encoder */ + else + return 0; /* fake a zero as the safest result */ + } + else + { + return 0; /* fake a zero as the safest result */ + } + } + + return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ]; +} diff --git a/dcmjpeg/libijg16/jdhuff16.h b/dcmjpeg/libijg16/jdhuff16.h new file mode 100644 index 00000000..ad63671e --- /dev/null +++ b/dcmjpeg/libijg16/jdhuff16.h @@ -0,0 +1,229 @@ +/* + * jdhuff.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains declarations for Huffman entropy decoding routines + * that are shared between the sequential decoder (jdhuff.c), the + * progressive decoder (jdphuff.c) and the lossless decoder (jdlhuff.c). + * No other modules need to see these. + */ + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_make_d_derived_tbl jpeg16_make_d_derived_tbl +#define jpeg_fill_bit_buffer jpeg16_fill_bit_buffer +#define jpeg_huff_decode jpeg16_huff_decode +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Derived data constructed for each Huffman table */ + +#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */ + +typedef struct { + /* Basic tables: (element [0] of each array is unused) */ + IJG_INT32 maxcode[18]; /* largest code of length k (-1 if none) */ + /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */ + IJG_INT32 valoffset[17]; /* huffval[] offset for codes of length k */ + /* valoffset[k] = huffval[] index of 1st symbol of code length k, less + * the smallest code of length k; so given a code of length k, the + * corresponding symbol is huffval[code + valoffset[k]] + */ + + /* Link to public Huffman table (needed only in jpeg_huff_decode) */ + JHUFF_TBL *pub; + + /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of + * the input data stream. If the next Huffman code is no more + * than HUFF_LOOKAHEAD bits long, we can obtain its length and + * the corresponding symbol directly from these tables. + */ + int look_nbits[1< 32 bits on your machine, and shifting/masking longs is + * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE + * appropriately should be a win. Unfortunately we can't define the size + * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8) + * because not all machines measure sizeof in 8-bit bytes. + */ + +typedef struct { /* Bitreading state saved across MCUs */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ +} bitread_perm_state; + +typedef struct { /* Bitreading working state within an MCU */ + /* Current data source location */ + /* We need a copy, rather than munging the original, in case of suspension */ + const JOCTET * next_input_byte; /* => next byte to read from source */ + size_t bytes_in_buffer; /* # of bytes remaining in source buffer */ + /* Bit input buffer --- note these values are kept in register variables, + * not in this struct, inside the inner loops. + */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ + /* Pointer needed by jpeg_fill_bit_buffer. */ + j_decompress_ptr cinfo; /* back link to decompress master record */ +} bitread_working_state; + +/* Macros to declare and load/save bitread local variables. */ +#define BITREAD_STATE_VARS \ + register bit_buf_type get_buffer; \ + register int bits_left; \ + bitread_working_state br_state + +#define BITREAD_LOAD_STATE(cinfop,permstate) \ + br_state.cinfo = cinfop; \ + br_state.next_input_byte = cinfop->src->next_input_byte; \ + br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ + get_buffer = permstate.get_buffer; \ + bits_left = permstate.bits_left; + +#define BITREAD_SAVE_STATE(cinfop,permstate) \ + cinfop->src->next_input_byte = br_state.next_input_byte; \ + cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ + permstate.get_buffer = get_buffer; \ + permstate.bits_left = bits_left + +/* + * These macros provide the in-line portion of bit fetching. + * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer + * before using GET_BITS, PEEK_BITS, or DROP_BITS. + * The variables get_buffer and bits_left are assumed to be locals, + * but the state struct might not be (jpeg_huff_decode needs this). + * CHECK_BIT_BUFFER(state,n,action); + * Ensure there are N bits in get_buffer; if suspend, take action. + * val = GET_BITS(n); + * Fetch next N bits. + * val = PEEK_BITS(n); + * Fetch next N bits without removing them from the buffer. + * DROP_BITS(n); + * Discard next N bits. + * The value N should be a simple variable, not an expression, because it + * is evaluated multiple times. + */ + +#define CHECK_BIT_BUFFER(state,nbits,action) \ + { if (bits_left < (nbits)) { \ + if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \ + { action; } \ + get_buffer = (state).get_buffer; bits_left = (state).bits_left; } } + +#define GET_BITS(nbits) \ + (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1)) + +#define PEEK_BITS(nbits) \ + (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1)) + +#define DROP_BITS(nbits) \ + (bits_left -= (nbits)) + +/* Load up the bit buffer to a depth of at least nbits */ +EXTERN(boolean) jpeg_fill_bit_buffer + JPP((bitread_working_state * state, register bit_buf_type get_buffer, + register int bits_left, int nbits)); + + +/* + * Code for extracting next Huffman-coded symbol from input bit stream. + * Again, this is time-critical and we make the main paths be macros. + * + * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits + * without looping. Usually, more than 95% of the Huffman codes will be 8 + * or fewer bits long. The few overlength codes are handled with a loop, + * which need not be inline code. + * + * Notes about the HUFF_DECODE macro: + * 1. Near the end of the data segment, we may fail to get enough bits + * for a lookahead. In that case, we do it the hard way. + * 2. If the lookahead table contains no entry, the next code must be + * more than HUFF_LOOKAHEAD bits long. + * 3. jpeg_huff_decode returns -1 if forced to suspend. + */ + +#define HUFF_DECODE(result,state,htbl,failaction,slowlabel,cornell_workaround) \ +{ register int nb, look; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + nb = 1; goto slowlabel; \ + } \ + } \ + look = PEEK_BITS(HUFF_LOOKAHEAD); \ + if ((nb = htbl->look_nbits[look]) != 0) { \ + DROP_BITS(nb); \ + result = htbl->look_sym[look]; \ + } else { \ + nb = HUFF_LOOKAHEAD+1; \ +slowlabel: \ + if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb,cornell_workaround)) < 0) \ + { failaction; } \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + } \ +} + +/* Out-of-line case for Huffman code fetching */ +EXTERN(int) jpeg_huff_decode + JPP((bitread_working_state * state, register bit_buf_type get_buffer, + register int bits_left, d_derived_tbl * htbl, int min_bits, boolean enable_cornell_workaround)); + + +/* Common fields between sequential, progressive and lossless Huffman entropy + * decoder master structs. + */ + +#define huffd_common_fields \ + boolean insufficient_data; /* set TRUE after emmitting warning */ \ + /* These fields are loaded into local variables at start of each MCU. \ + * In case of suspension, we exit WITHOUT updating them. \ + */ \ + bitread_perm_state bitstate /* Bit buffer at start of MCU */ + +/* Routines that are to be used by any or all of the entropy decoders are + * declared to receive a pointer to this structure. There are no actual + * instances of huffd_common_struct, only of shuff_entropy_decoder, + * phuff_entropy_decoder and lhuff_entropy_decoder. + */ +struct huffd_common_struct { + huffd_common_fields; /* Fields common to all decoder struct types */ + /* Additional fields follow in an actual shuff_entropy_decoder, + * phuff_entropy_decoder or lhuff_entropy_decoder struct. All four structs + * must agree on these initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct huffd_common_struct * huffd_common_ptr; diff --git a/dcmjpeg/libijg16/jdinput.c b/dcmjpeg/libijg16/jdinput.c new file mode 100644 index 00000000..9de18b7d --- /dev/null +++ b/dcmjpeg/libijg16/jdinput.c @@ -0,0 +1,347 @@ +/* + * jdinput.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input control logic for the JPEG decompressor. + * These routines are concerned with controlling the decompressor's input + * processing (marker reading and coefficient/difference decoding). + * The actual input reading is done in jdmarker.c, jdhuff.c, jdphuff.c, + * and jdlhuff.c. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Private state */ + +typedef struct { + struct jpeg_input_controller pub; /* public fields */ + + boolean inheaders; /* TRUE until first SOS is reached */ +} my_input_controller; + +typedef my_input_controller * my_inputctl_ptr; + + +/* Forward declarations */ +METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo)); + + +/* + * Routines to calculate various quantities related to the size of the image. + */ + +LOCAL(void) +initial_setup (j_decompress_ptr cinfo) +/* Called once, when first SOS marker is reached */ +{ + int ci; + jpeg_component_info *compptr; + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + if (cinfo->process == JPROC_LOSSLESS) { + /* If precision > compiled-in value, we must downscale */ + if (cinfo->data_precision > BITS_IN_JSAMPLE) + WARNMS2(cinfo, JWRN_MUST_DOWNSCALE, + cinfo->data_precision, BITS_IN_JSAMPLE); + } + else { /* Lossy processes */ + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + } + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* We initialize codec_data_unit and min_codec_data_unit to data_unit. + * In the full decompressor, this will be overridden by jdmaster.c; + * but in the transcoder, jdmaster.c is not used, so we must do it here. + */ + cinfo->min_codec_data_unit = cinfo->data_unit; + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->codec_data_unit = cinfo->data_unit; + /* Size in data units */ + compptr->width_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * cinfo->data_unit)); + compptr->height_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * cinfo->data_unit)); + /* downsampled_width and downsampled_height will also be overridden by + * jdmaster.c if we are doing full decompression. The transcoder library + * doesn't use these values, but the calling application might. + */ + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) cinfo->max_h_samp_factor); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) cinfo->max_v_samp_factor); + /* Mark component needed, until color conversion says otherwise */ + compptr->component_needed = TRUE; + /* Mark no quantization table yet saved for component */ + compptr->quant_table = NULL; + } + + /* Compute number of fully interleaved MCU rows. */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*cinfo->data_unit)); + + /* Decide whether file contains multiple scans */ + if (cinfo->comps_in_scan < cinfo->num_components || + cinfo->process == JPROC_PROGRESSIVE) + cinfo->inputctl->has_multiple_scans = TRUE; + else + cinfo->inputctl->has_multiple_scans = FALSE; +} + + +LOCAL(void) +per_scan_setup (j_decompress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_data_units; + cinfo->MCU_rows_in_scan = compptr->height_in_data_units; + + /* For noninterleaved scan, always one data unit per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_data_units = 1; + compptr->MCU_sample_width = compptr->codec_data_unit; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of data unit rows present in the last iMCU row. + */ + tmp = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->data_units_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, + (long) (cinfo->max_h_samp_factor*cinfo->data_unit)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*cinfo->data_unit)); + + cinfo->data_units_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of data units of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_data_units = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * compptr->codec_data_unit; + /* Figure number of non-dummy data units in last MCU column & row */ + tmp = (int)compptr->width_in_data_units % compptr->MCU_width; + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int)compptr->height_in_data_units % compptr->MCU_height; + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_data_units; + if (cinfo->data_units_in_MCU + mcublks > D_MAX_DATA_UNITS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->data_units_in_MCU++] = ci; + } + } + + } +} + + +/* + * Initialize the input modules to read a scan of compressed data. + * The first call to this is done by jdmaster.c after initializing + * the entire decompressor (during jpeg_start_decompress). + * Subsequent calls come from consume_markers, below. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + per_scan_setup(cinfo); + (*cinfo->codec->start_input_pass) (cinfo); + cinfo->inputctl->consume_input = cinfo->codec->consume_data; +} + + +/* + * Finish up after inputting a compressed-data scan. + * This is called by the coefficient controller after it's read all + * the expected data of the scan. + */ + +METHODDEF(void) +finish_input_pass (j_decompress_ptr cinfo) +{ + cinfo->inputctl->consume_input = consume_markers; +} + + +/* + * Read JPEG markers before, between, or after compressed-data scans. + * Change state as necessary when a new scan is reached. + * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + * + * The consume_input method pointer points either here or to the + * coefficient controller's consume_data routine, depending on whether + * we are reading a compressed data segment or inter-segment markers. + */ + +METHODDEF(int) +consume_markers (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + int val; + + if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */ + return JPEG_REACHED_EOI; + + val = (*cinfo->marker->read_markers) (cinfo); + + switch (val) { + case JPEG_REACHED_SOS: /* Found SOS */ + if (inputctl->inheaders) { /* 1st SOS */ + initial_setup(cinfo); + /* + * Initialize the decompression codec. We need to do this here so that + * any codec-specific fields and function pointers are available to + * the rest of the library. + */ + jinit_d_codec(cinfo); + inputctl->inheaders = FALSE; + /* Note: start_input_pass must be called by jdmaster.c + * before any more input can be consumed. jdapimin.c is + * responsible for enforcing this sequencing. + */ + } else { /* 2nd or later SOS marker */ + if (! inputctl->pub.has_multiple_scans) + ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */ + start_input_pass(cinfo); + } + break; + case JPEG_REACHED_EOI: /* Found EOI */ + inputctl->pub.eoi_reached = TRUE; + if (inputctl->inheaders) { /* Tables-only datastream, apparently */ + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_NO_SOS); + } else { + /* Prevent infinite loop in coef ctlr's decompress_data routine + * if user set output_scan_number larger than number of scans. + */ + if (cinfo->output_scan_number > cinfo->input_scan_number) + cinfo->output_scan_number = cinfo->input_scan_number; + } + break; + case JPEG_SUSPENDED: + break; + } + + return val; +} + + +/* + * Reset state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + + inputctl->pub.consume_input = consume_markers; + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = TRUE; + /* Reset other modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->marker->reset_marker_reader) (cinfo); + /* Reset progression state -- would be cleaner if entropy decoder did this */ + cinfo->coef_bits = NULL; +} + + +/* + * Initialize the input controller module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl; + + /* Create subobject in permanent pool */ + inputctl = (my_inputctl_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_input_controller)); + cinfo->inputctl = (struct jpeg_input_controller *) inputctl; + /* Initialize method pointers */ + inputctl->pub.consume_input = consume_markers; + inputctl->pub.reset_input_controller = reset_input_controller; + inputctl->pub.start_input_pass = start_input_pass; + inputctl->pub.finish_input_pass = finish_input_pass; + /* Initialize state: can't use reset_input_controller since we don't + * want to try to reset other modules yet. + */ + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = TRUE; +} diff --git a/dcmjpeg/libijg16/jdlhuff.c b/dcmjpeg/libijg16/jdlhuff.c new file mode 100644 index 00000000..b9cfb434 --- /dev/null +++ b/dcmjpeg/libijg16/jdlhuff.c @@ -0,0 +1,326 @@ +/* + * jdlhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for lossless JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" /* Private declarations for lossless codec */ +#include "jdhuff16.h" /* Declarations shared with jd*huff.c */ + +#ifdef D_LOSSLESS_SUPPORTED + +typedef struct { + int ci, yoffset, MCU_width; +} lhd_output_ptr_info; + +/* + * Private entropy decoder object for lossless Huffman decoding. + */ + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Precalculated info set up by start_pass for use in decode_mcus: */ + + /* Pointers to derived tables to be used for each data unit within an MCU */ + d_derived_tbl * cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + + /* Pointers to the proper output difference row for each group of data units + * within an MCU. For each component, there are Vi groups of Hi data units. + */ + JDIFFROW output_ptr[D_MAX_DATA_UNITS_IN_MCU]; + + /* Number of output pointers in use for the current MCU. This is the sum + * of all Vi in the MCU. + */ + int num_output_ptrs; + + /* Information used for positioning the output pointers within the output + * difference rows. + */ + lhd_output_ptr_info output_ptr_info[D_MAX_DATA_UNITS_IN_MCU]; + + /* Index of the proper output pointer for each data unit within an MCU */ + int output_ptr_index[D_MAX_DATA_UNITS_IN_MCU]; + +} lhuff_entropy_decoder; + +typedef lhuff_entropy_decoder * lhuff_entropy_ptr; + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_lhuff_decoder (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + int ci, dctbl, sampn, ptrn, yoffset, xoffset; + jpeg_component_info * compptr; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + /* Make sure requested tables are present */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS || + cinfo->dc_huff_tbl_ptrs[dctbl] == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, + & entropy->derived_tbls[dctbl]); + } + + /* Precalculate decoding info for each sample in an MCU of this scan */ + for (sampn = 0, ptrn = 0; sampn < cinfo->data_units_in_MCU;) { + compptr = cinfo->cur_comp_info[cinfo->MCU_membership[sampn]]; + ci = compptr->component_index; + for (yoffset = 0; yoffset < compptr->MCU_height; yoffset++, ptrn++) { + /* Precalculate the setup info for each output pointer */ + entropy->output_ptr_info[ptrn].ci = ci; + entropy->output_ptr_info[ptrn].yoffset = yoffset; + entropy->output_ptr_info[ptrn].MCU_width = compptr->MCU_width; + for (xoffset = 0; xoffset < compptr->MCU_width; xoffset++, sampn++) { + /* Precalculate the output pointer index for each sample */ + entropy->output_ptr_index[sampn] = ptrn; + /* Precalculate which table to use for each sample */ + entropy->cur_tbls[sampn] = entropy->derived_tbls[compptr->dc_tbl_no]; + } + } + } + entropy->num_output_ptrs = ptrn; + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +/* We should only need 16 entries in this array, the 17th one is for + * invalid Cornell images with the Huffman table overflow bug + */ +static const int extend_test[17] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + * + * We should only need 16 entries in this array, the 17th one is for + * invalid Cornell images with the Huffman table overflow bug + */ +static const int extend_offset[17] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1, (int)((~0U)<<16) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +METHODDEF(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + /* int ci; */ + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)entropy->bitstate.bits_left / 8; + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Decode and return nMCU's worth of Huffman-compressed differences. + * Each MCU is also disassembled and placed accordingly in diff_buf. + * + * MCU_col_num specifies the column of the first MCU being requested within + * the MCU-row. This tells us where to position the output row pointers in + * diff_buf. + * + * Returns the number of MCUs decoded. This may be less than nMCU if data + * source requested suspension. In that case no changes have been made to + * permanent state. (Exception: some output differences may already have + * been assigned. This is harmless for this module, since we'll just + * re-assign them on the next call.) + */ + +METHODDEF(JDIMENSION) +decode_mcus (j_decompress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, JDIMENSION nMCU) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + BITREAD_STATE_VARS; + boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0; + + /* Set output pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_output_ptrs; ptrn++) { + ci = entropy->output_ptr_info[ptrn].ci; + yoffset = entropy->output_ptr_info[ptrn].yoffset; + MCU_width = entropy->output_ptr_info[ptrn].MCU_width; + entropy->output_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (JDIMENSION)yoffset] + MCU_col_num * (JDIMENSION)MCU_width; + } + + /* + * If we've run out of data, zero out the buffers and return. + * By resetting the undifferencer, the output samples will be CENTERJSAMPLE. + * + * NB: We should find a way to do this without interacting with the + * undifferencer module directly. + */ + if (entropy->insufficient_data) { + for (ptrn = 0; ptrn < entropy->num_output_ptrs; ptrn++) + jzero_far((void FAR *) entropy->output_ptr[ptrn], + nMCU * (size_t)entropy->output_ptr_info[ptrn].MCU_width * SIZEOF(JDIFF)); + + (*losslsd->predict_process_restart) (cinfo); + } + + else { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + + /* Outer loop handles the number of MCU requested */ + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + d_derived_tbl * dctbl = entropy->cur_tbls[sampn]; + register int s, r; + + /* Section H.2.2: decode the sample difference */ + HUFF_DECODE(s, br_state, dctbl, return mcu_num, label1, cornell_workaround); + if (s) { + if (cornell_workaround) + { + if ((s == 16) && (bits_left < 16)) { /* standard case: always output 32768 */ + s = 32768; + } + else if (s >= 16) { /* there are enough bits available, so check ... */ + r = PEEK_BITS(16); + s = HUFF_EXTEND(r, 16); + if ((s & 0xffff) == 0x8000) { /* special case: handle buggy Cornell encoder */ + DROP_BITS(16); + } else { /* standard case: always output 32768 */ + if (s == 0x7fff) + DROP_BITS(16); + s = 32768; + } + } else { /* normal case: fetch subsequent bits */ + CHECK_BIT_BUFFER(br_state, s, return mcu_num); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + } + else + { + if (s == 16) /* special case: always output 32768 */ + s = 32768; + else { /* normal case: fetch subsequent bits */ + CHECK_BIT_BUFFER(br_state, s, return mcu_num); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + } + } + + /* Output the sample difference */ + *entropy->output_ptr[entropy->output_ptr_index[sampn]]++ = (JDIFF) s; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + } + } + + return nMCU; +} + + +/* + * Module initialization routine for lossless Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_lhuff_decoder (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy; + int i; + + entropy = (lhuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(lhuff_entropy_decoder)); + losslsd->entropy_private = (void *) entropy; + losslsd->entropy_start_pass = start_pass_lhuff_decoder; + losslsd->entropy_process_restart = process_restart; + losslsd->entropy_decode_mcus = decode_mcus; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + } +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jdlossls.c b/dcmjpeg/libijg16/jdlossls.c new file mode 100644 index 00000000..b311afaa --- /dev/null +++ b/dcmjpeg/libijg16/jdlossls.c @@ -0,0 +1,98 @@ +/* + * jdlossls.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossless JPEG decompressor. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" + + +#ifdef D_LOSSLESS_SUPPORTED + +/* + * Compute output image dimensions and related values. + */ + +METHODDEF(void) +calc_output_dimensions (j_decompress_ptr cinfo) +{ + /* Hardwire it to "no scaling" */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + /* jdinput.c has already initialized codec_data_unit to 1, + * and has computed unscaled downsampled_width and downsampled_height. + */ +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + (*losslsd->entropy_start_pass) (cinfo); + (*losslsd->predict_start_pass) (cinfo); + (*losslsd->scaler_start_pass) (cinfo); + (*losslsd->diff_start_input_pass) (cinfo); +} + + +/* + * Initialize the lossless decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossless_d_codec(j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd; + boolean use_c_buffer; + + /* Create subobject in permanent pool */ + losslsd = (j_lossless_d_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossless_d_codec)); + cinfo->codec = (struct jpeg_d_codec *) losslsd; + + /* Initialize sub-modules */ + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + jinit_lhuff_decoder(cinfo); + } + + /* Undifferencer */ + jinit_undifferencer(cinfo); + + /* Scaler */ + jinit_d_scaler(cinfo); + + use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; + jinit_d_diff_controller(cinfo, use_c_buffer); + + /* Initialize method pointers. + * + * Note: consume_data, start_output_pass and decompress_data are + * assigned in jddiffct.c. + */ + losslsd->pub.calc_output_dimensions = calc_output_dimensions; + losslsd->pub.start_input_pass = start_input_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jdlossy.c b/dcmjpeg/libijg16/jdlossy.c new file mode 100644 index 00000000..a410e049 --- /dev/null +++ b/dcmjpeg/libijg16/jdlossy.c @@ -0,0 +1,232 @@ +/* + * jdlossy.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossy JPEG decompressor. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" + + +/* + * Compute output image dimensions and related values. + */ + +METHODDEF(void) +calc_output_dimensions (j_decompress_ptr cinfo) +{ +#ifdef IDCT_SCALING_SUPPORTED + int ci; + jpeg_component_info *compptr; + + /* Compute actual output image dimensions and DCT scaling choices. */ + if (cinfo->scale_num * 8 <= cinfo->scale_denom) { + /* Provide 1/8 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 8L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 8L); + cinfo->min_codec_data_unit = 1; + } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) { + /* Provide 1/4 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 4L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 4L); + cinfo->min_codec_data_unit = 2; + } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) { + /* Provide 1/2 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 2L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 2L); + cinfo->min_codec_data_unit = 4; + } else { + /* Provide 1/1 scaling */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + cinfo->min_codec_data_unit = DCTSIZE; + } + /* In selecting the actual DCT scaling for each component, we try to + * scale up the chroma components via IDCT scaling rather than upsampling. + * This saves time if the upsampler gets to use 1:1 scaling. + * Note this code assumes that the supported DCT scalings are powers of 2. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + int ssize = cinfo->min_codec_data_unit; + while (ssize < DCTSIZE && + (compptr->h_samp_factor * ssize * 2 <= + cinfo->max_h_samp_factor * cinfo->min_codec_data_unit) && + (compptr->v_samp_factor * ssize * 2 <= + cinfo->max_v_samp_factor * cinfo->min_codec_data_unit)) { + ssize = ssize * 2; + } + compptr->codec_data_unit = ssize; + } + + /* Recompute downsampled dimensions of components; + * application needs to know these if using raw downsampled data. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Size in samples, after IDCT scaling */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * + (long) (compptr->h_samp_factor * compptr->codec_data_unit), + (long) (cinfo->max_h_samp_factor * DCTSIZE)); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * + (long) (compptr->v_samp_factor * compptr->codec_data_unit), + (long) (cinfo->max_v_samp_factor * DCTSIZE)); + } + +#else /* !IDCT_SCALING_SUPPORTED */ + + /* Hardwire it to "no scaling" */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + /* jdinput.c has already initialized codec_data_unit to DCTSIZE, + * and has computed unscaled downsampled_width and downsampled_height. + */ + +#endif /* IDCT_SCALING_SUPPORTED */ +} + + +/* + * Save away a copy of the Q-table referenced by each component present + * in the current scan, unless already saved during a prior scan. + * + * In a multiple-scan JPEG file, the encoder could assign different components + * the same Q-table slot number, but change table definitions between scans + * so that each component uses a different Q-table. (The IJG encoder is not + * currently capable of doing this, but other encoders might.) Since we want + * to be able to dequantize all the components at the end of the file, this + * means that we have to save away the table actually used for each component. + * We do this by copying the table at the start of the first scan containing + * the component. + * The JPEG spec prohibits the encoder from changing the contents of a Q-table + * slot between scans of a component using that slot. If the encoder does so + * anyway, this decoder will simply use the Q-table values that were current + * at the start of the first scan for the component. + * + * The decompressor output side looks only at the saved quant tables, + * not at the current Q-table slots. + */ + +LOCAL(void) +latch_quant_tables (j_decompress_ptr cinfo) +{ + int ci, qtblno; + jpeg_component_info *compptr; + JQUANT_TBL * qtbl; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* No work if we already saved Q-table for this component */ + if (compptr->quant_table != NULL) + continue; + /* Make sure specified quantization table is present */ + qtblno = compptr->quant_tbl_no; + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + /* OK, save away the quantization table */ + qtbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(JQUANT_TBL)); + MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL)); + compptr->quant_table = qtbl; + } +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + + latch_quant_tables(cinfo); + (*lossyd->entropy_start_pass) (cinfo); + (*lossyd->coef_start_input_pass) (cinfo); +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + + (*lossyd->idct_start_pass) (cinfo); + (*lossyd->coef_start_output_pass) (cinfo); +} + +/* + * Initialize the lossy decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossy_d_codec (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd; + boolean use_c_buffer; + + /* Create subobject in permanent pool */ + lossyd = (j_lossy_d_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_d_codec)); + cinfo->codec = (struct jpeg_d_codec *) lossyd; + + /* Initialize sub-modules */ + + /* Inverse DCT */ + jinit_inverse_dct(cinfo); + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef D_PROGRESSIVE_SUPPORTED + jinit_phuff_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_decoder(cinfo); + } + + use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; + jinit_d_coef_controller(cinfo, use_c_buffer); + + /* Initialize method pointers. + * + * Note: consume_data and decompress_data are assigned in jdcoefct.c. + */ + lossyd->pub.calc_output_dimensions = calc_output_dimensions; + lossyd->pub.start_input_pass = start_input_pass; + lossyd->pub.start_output_pass = start_output_pass; +} + + + + diff --git a/dcmjpeg/libijg16/jdmainct.c b/dcmjpeg/libijg16/jdmainct.c new file mode 100644 index 00000000..78329021 --- /dev/null +++ b/dcmjpeg/libijg16/jdmainct.c @@ -0,0 +1,512 @@ +/* + * jdmainct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for decompression. + * The main buffer lies between the JPEG decompressor proper and the + * post-processor; it holds downsampled data in the JPEG colorspace. + * + * Note that this code is bypassed in raw-data mode, since the application + * supplies the equivalent of the main buffer in that case. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * In the current system design, the main buffer need never be a full-image + * buffer; any full-height buffers will be found inside the coefficient or + * postprocessing controllers. Nonetheless, the main controller is not + * trivial. Its responsibility is to provide context rows for upsampling/ + * rescaling, and doing this in an efficient fashion is a bit tricky. + * + * Postprocessor input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * codec_data_unit / min_codec_data_unit) + * sample rows of each component. (We require codec_data_unit values to be + * chosen such that these numbers are integers. In practice codec_data_unit + * values will likely be powers of two, so we actually have the stronger + * condition that codec_data_unit / min_codec_data_unit is an integer.) + * Upsampling will typically produce max_v_samp_factor pixel rows from each + * row group (times any additional scale factor that the upsampler is + * applying). + * + * The decompression codec will deliver data to us one iMCU row at a time; + * each iMCU row contains v_samp_factor * codec_data_unit sample rows, or + * exactly min_codec_data_unit row groups. (This amount of data corresponds + * to one row of MCUs when the image is fully interleaved.) Note that the + * number of sample rows varies across components, but the number of row + * groups does not. Some garbage sample rows may be included in the last iMCU + * row at the bottom of the image. + * + * Depending on the vertical scaling algorithm used, the upsampler may need + * access to the sample row(s) above and below its current input row group. + * The upsampler is required to set need_context_rows TRUE at global selection + * time if so. When need_context_rows is FALSE, this controller can simply + * obtain one iMCU row at a time from the coefficient controller and dole it + * out as row groups to the postprocessor. + * + * When need_context_rows is TRUE, this controller guarantees that the buffer + * passed to postprocessing contains at least one row group's worth of samples + * above and below the row group(s) being processed. Note that the context + * rows "above" the first passed row group appear at negative row offsets in + * the passed buffer. At the top and bottom of the image, the required + * context rows are manufactured by duplicating the first or last real sample + * row; this avoids having special cases in the upsampling inner loops. + * + * The amount of context is fixed at one row group just because that's a + * convenient number for this controller to work with. The existing + * upsamplers really only need one sample row of context. An upsampler + * supporting arbitrary output rescaling might wish for more than one row + * group of context when shrinking the image; tough, we don't handle that. + * (This is justified by the assumption that downsizing will be handled mostly + * by adjusting the codec_data_unit values, so that the actual scale factor at + * the upsample step needn't be much less than one.) + * + * To provide the desired context, we have to retain the last two row groups + * of one iMCU row while reading in the next iMCU row. (The last row group + * can't be processed until we have another row group for its below-context, + * and so we have to save the next-to-last group too for its above-context.) + * We could do this most simply by copying data around in our buffer, but + * that'd be very slow. We can avoid copying any data by creating a rather + * strange pointer structure. Here's how it works. We allocate a workspace + * consisting of M+2 row groups (where M = min_codec_data_unit is the number + * of row groups per iMCU row). We create two sets of redundant pointers to + * the workspace. Labeling the physical row groups 0 to M+1, the synthesized + * pointer lists look like this: + * M+1 M-1 + * master pointer --> 0 master pointer --> 0 + * 1 1 + * ... ... + * M-3 M-3 + * M-2 M + * M-1 M+1 + * M M-2 + * M+1 M-1 + * 0 0 + * We read alternate iMCU rows using each master pointer; thus the last two + * row groups of the previous iMCU row remain un-overwritten in the workspace. + * The pointer lists are set up so that the required context rows appear to + * be adjacent to the proper places when we pass the pointer lists to the + * upsampler. + * + * The above pictures describe the normal state of the pointer lists. + * At top and bottom of the image, we diddle the pointer lists to duplicate + * the first or last sample row as necessary (this is cheaper than copying + * sample rows around). + * + * This scheme breaks down if M < 2, ie, min_codec_data_unit is 1. In that + * situation each iMCU row provides only one row group so the buffering logic + * must be different (eg, we must read two iMCU rows before we can emit the + * first row group). For now, we simply do not support providing context + * rows when min_codec_data_unit is 1. That combination seems unlikely to + * be worth providing --- if someone wants a 1/8th-size preview, they probably + * want it quick and dirty, so a context-free upsampler is sufficient. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_main_controller pub; /* public fields */ + + /* Pointer to allocated workspace (M or M+2 row groups). */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + + boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ + JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ + + /* Remaining fields are only used in the context case. */ + + /* These are the master pointers to the funny-order pointer lists. */ + JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ + + int whichptr; /* indicates which pointer set is now in use */ + int context_state; /* process_data state machine status */ + JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ + JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + +/* context_state values: */ +#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ +#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ +#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +METHODDEF(void) process_data_context_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) process_data_crank_post + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#endif + + +LOCAL(void) +alloc_funny_pointers (j_decompress_ptr cinfo) +/* Allocate space for the funny pointer lists. + * This is done only once, not once per pass. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + /* Get top-level space for component array pointers. + * We alloc both arrays with one call to save a few cycles. + */ + mymain->xbuffer[0] = (JSAMPIMAGE) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); + mymain->xbuffer[1] = mymain->xbuffer[0] + cinfo->num_components; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + /* Get space for pointer lists --- M+4 row groups in each list. + * We alloc both pointer lists with one call to save a few cycles. + */ + xbuf = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 2 * (size_t)(rgroup * (M + 4)) * SIZEOF(JSAMPROW)); + xbuf += rgroup; /* want one row group at negative offsets */ + mymain->xbuffer[0][ci] = xbuf; + xbuf += rgroup * (M + 4); + mymain->xbuffer[1][ci] = xbuf; + } +} + + +LOCAL(void) +make_funny_pointers (j_decompress_ptr cinfo) +/* Create the funny pointer lists discussed in the comments above. + * The actual workspace is already allocated (in main->buffer), + * and the space for the pointer lists is allocated too. + * This routine just fills in the curiously ordered lists. + * This will be repeated at the beginning of each pass. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY buf, xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + xbuf0 = mymain->xbuffer[0][ci]; + xbuf1 = mymain->xbuffer[1][ci]; + /* First copy the workspace pointers as-is */ + buf = mymain->buffer[ci]; + for (i = 0; i < rgroup * (M + 2); i++) { + xbuf0[i] = xbuf1[i] = buf[i]; + } + /* In the second list, put the last four row groups in swapped order */ + for (i = 0; i < rgroup * 2; i++) { + xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i]; + xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i]; + } + /* The wraparound pointers at top and bottom will be filled later + * (see set_wraparound_pointers, below). Initially we want the "above" + * pointers to duplicate the first actual data line. This only needs + * to happen in xbuffer[0]. + */ + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[0]; + } + } +} + + +LOCAL(void) +set_wraparound_pointers (j_decompress_ptr cinfo) +/* Set up the "wraparound" pointers at top and bottom of the pointer lists. + * This changes the pointer list state from top-of-image to the normal state. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + xbuf0 = mymain->xbuffer[0][ci]; + xbuf1 = mymain->xbuffer[1][ci]; + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; + xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; + xbuf0[rgroup*(M+2) + i] = xbuf0[i]; + xbuf1[rgroup*(M+2) + i] = xbuf1[i]; + } + } +} + + +LOCAL(void) +set_bottom_pointers (j_decompress_ptr cinfo) +/* Change the pointer lists to duplicate the last sample row at the bottom + * of the image. whichptr indicates which xbuffer holds the final iMCU row. + * Also sets rowgroups_avail to indicate number of nondummy row groups in row. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup, iMCUheight, rows_left; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Count sample rows in one iMCU row and in one row group */ + iMCUheight = compptr->v_samp_factor * compptr->codec_data_unit; + rgroup = iMCUheight / cinfo->min_codec_data_unit; + /* Count nondummy sample rows remaining for this component */ + rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight); + if (rows_left == 0) rows_left = iMCUheight; + /* Count nondummy row groups. Should get same answer for each component, + * so we need only do it once. + */ + if (ci == 0) { + mymain->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); + } + /* Duplicate the last real sample row rgroup*2 times; this pads out the + * last partial rowgroup and ensures at least one full rowgroup of context. + */ + xbuf = mymain->xbuffer[mymain->whichptr][ci]; + for (i = 0; i < rgroup * 2; i++) { + xbuf[rows_left + i] = xbuf[rows_left-1]; + } + } +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->upsample->need_context_rows) { + mymain->pub.process_data = process_data_context_main; + make_funny_pointers(cinfo); /* Create the xbuffer[] lists */ + mymain->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ + mymain->context_state = CTX_PREPARE_FOR_IMCU; + mymain->iMCU_row_ctr = 0; + } else { + /* Simple case with no context needed */ + mymain->pub.process_data = process_data_simple_main; + } + mymain->buffer_full = FALSE; /* Mark buffer empty */ + mymain->rowgroup_ctr = 0; + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_CRANK_DEST: + /* For last pass of 2-pass quantization, just crank the postprocessor */ + mymain->pub.process_data = process_data_crank_post; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This handles the simple case where no context is required. + */ + +METHODDEF(void) +process_data_simple_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + JDIMENSION rowgroups_avail; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mymain->buffer_full) { + if (! (*cinfo->codec->decompress_data) (cinfo, mymain->buffer)) + return; /* suspension forced, can do nothing more */ + mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + } + + /* There are always min_codec_data_unit row groups in an iMCU row. */ + rowgroups_avail = (JDIMENSION) cinfo->min_codec_data_unit; + /* Note: at the bottom of the image, we may pass extra garbage row groups + * to the postprocessor. The postprocessor has to check for bottom + * of image anyway (at row resolution), so no point in us doing it too. + */ + + /* Feed the postprocessor */ + (*cinfo->post->post_process_data) (cinfo, mymain->buffer, + &mymain->rowgroup_ctr, rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + + /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ + if (mymain->rowgroup_ctr >= rowgroups_avail) { + mymain->buffer_full = FALSE; + mymain->rowgroup_ctr = 0; + } +} + + +/* + * Process some data. + * This handles the case where context rows must be provided. + */ + +METHODDEF(void) +process_data_context_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mymain->buffer_full) { + if (! (*cinfo->codec->decompress_data) (cinfo, + mymain->xbuffer[mymain->whichptr])) + return; /* suspension forced, can do nothing more */ + mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + mymain->iMCU_row_ctr++; /* count rows received */ + } + + /* Postprocessor typically will not swallow all the input data it is handed + * in one call (due to filling the output buffer first). Must be prepared + * to exit and restart. This switch lets us keep track of how far we got. + * Note that each case falls through to the next on successful completion. + */ + switch (mymain->context_state) { + case CTX_POSTPONED_ROW: + /* Call postprocessor using previously set pointers for postponed row */ + (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr], + &mymain->rowgroup_ctr, mymain->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mymain->rowgroup_ctr < mymain->rowgroups_avail) + return; /* Need to suspend */ + mymain->context_state = CTX_PREPARE_FOR_IMCU; + if (*out_row_ctr >= out_rows_avail) + return; /* Postprocessor exactly filled output buf */ + /*FALLTHROUGH*/ + case CTX_PREPARE_FOR_IMCU: + /* Prepare to process first M-1 row groups of this iMCU row */ + mymain->rowgroup_ctr = 0; + mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1); + /* Check for bottom of image: if so, tweak pointers to "duplicate" + * the last sample row, and adjust rowgroups_avail to ignore padding rows. + */ + if (mymain->iMCU_row_ctr == cinfo->total_iMCU_rows) + set_bottom_pointers(cinfo); + mymain->context_state = CTX_PROCESS_IMCU; + /*FALLTHROUGH*/ + case CTX_PROCESS_IMCU: + /* Call postprocessor using previously set pointers */ + (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr], + &mymain->rowgroup_ctr, mymain->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mymain->rowgroup_ctr < mymain->rowgroups_avail) + return; /* Need to suspend */ + /* After the first iMCU, change wraparound pointers to normal state */ + if (mymain->iMCU_row_ctr == 1) + set_wraparound_pointers(cinfo); + /* Prepare to load new iMCU row using other xbuffer list */ + mymain->whichptr ^= 1; /* 0=>1 or 1=>0 */ + mymain->buffer_full = FALSE; + /* Still need to process last row group of this iMCU row, */ + /* which is saved at index M+1 of the other xbuffer */ + mymain->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1); + mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2); + mymain->context_state = CTX_POSTPONED_ROW; + } +} + + +/* + * Process some data. + * Final pass of two-pass quantization: just call the postprocessor. + * Source data will be the postprocessor controller's internal buffer. + */ + +#ifdef QUANT_2PASS_SUPPORTED + +METHODDEF(void) +process_data_crank_post (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL, + (JDIMENSION *) NULL, (JDIMENSION) 0, + output_buf, out_row_ctr, out_rows_avail); +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mymain; + int ci, rgroup, ngroups; + jpeg_component_info *compptr; + + mymain = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = (struct jpeg_d_main_controller *) mymain; + mymain->pub.start_pass = start_pass_main; + + if (need_full_buffer) /* shouldn't happen */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Allocate the workspace. + * ngroups is the number of row groups we need. + */ + if (cinfo->upsample->need_context_rows) { + if (cinfo->min_codec_data_unit < 2) /* unsupported, see comments above */ + ERREXIT(cinfo, JERR_NOTIMPL); + alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ + ngroups = cinfo->min_codec_data_unit + 2; + } else { + ngroups = cinfo->min_codec_data_unit; + } + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + mymain->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_data_units * (JDIMENSION) compptr->codec_data_unit, + (JDIMENSION) (rgroup * ngroups)); + } +} diff --git a/dcmjpeg/libijg16/jdmarker.c b/dcmjpeg/libijg16/jdmarker.c new file mode 100644 index 00000000..f2b6188e --- /dev/null +++ b/dcmjpeg/libijg16/jdmarker.c @@ -0,0 +1,1370 @@ +/* + * jdmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to decode JPEG datastream markers. + * Most of the complexity arises from our desire to support input + * suspension: if not all of the data for a marker is available, + * we must exit back to the application. On resumption, we reprocess + * the marker. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_reader pub; /* public fields */ + + /* Application-overridable marker processing methods */ + jpeg_marker_parser_method process_COM; + jpeg_marker_parser_method process_APPn[16]; + + /* Limit on marker data length to save for each marker type */ + unsigned int length_limit_COM; + unsigned int length_limit_APPn[16]; + + /* Status of COM/APPn marker saving */ + jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */ + unsigned int bytes_read; /* data bytes read so far in marker */ + /* Note: cur_marker is not linked into marker_list until it's all read. */ +} my_marker_reader; + +typedef my_marker_reader * my_marker_ptr; + + +/* + * Macros for fetching data from the data source module. + * + * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect + * the current restart point; we update them only when we have reached a + * suitable place to restart if a suspension occurs. + */ + +/* Declare and initialize local copies of input pointer/count */ +#define INPUT_VARS(cinfo) \ + struct jpeg_source_mgr * datasrc = (cinfo)->src; \ + const JOCTET * next_input_byte = datasrc->next_input_byte; \ + size_t bytes_in_buffer = datasrc->bytes_in_buffer + +/* Unload the local copies --- do this only at a restart boundary */ +#define INPUT_SYNC(cinfo) \ + ( datasrc->next_input_byte = next_input_byte, \ + datasrc->bytes_in_buffer = bytes_in_buffer ) + +/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */ +#define INPUT_RELOAD(cinfo) \ + ( next_input_byte = datasrc->next_input_byte, \ + bytes_in_buffer = datasrc->bytes_in_buffer ) + +/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available. + * Note we do *not* do INPUT_SYNC before calling fill_input_buffer, + * but we must reload the local copies after a successful fill. + */ +#define MAKE_BYTE_AVAIL(cinfo,action) \ + if (bytes_in_buffer == 0) { \ + if (! (*datasrc->fill_input_buffer) (cinfo)) \ + { action; } \ + INPUT_RELOAD(cinfo); \ + } + +/* Read a byte into variable V. + * If must suspend, take the specified action (typically "return FALSE"). + */ +#define INPUT_BYTE(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = GETJOCTET(*next_input_byte++); ) + +/* As above, but read two bytes interpreted as an unsigned 16-bit integer. + * V should be declared unsigned int or perhaps IJG_INT32. + */ +#define INPUT_2BYTES(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ + MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V += GETJOCTET(*next_input_byte++); ) + + +/* + * Routines to process JPEG markers. + * + * Entry condition: JPEG marker itself has been read and its code saved + * in cinfo->unread_marker; input restart point is just after the marker. + * + * Exit: if return TRUE, have read and processed any parameters, and have + * updated the restart point to point after the parameters. + * If return FALSE, was forced to suspend before reaching end of + * marker parameters; restart point has not been moved. Same routine + * will be called again after application supplies more input data. + * + * This approach to suspension assumes that all of a marker's parameters + * can fit into a single input bufferload. This should hold for "normal" + * markers. Some COM/APPn markers might have large parameter segments + * that might not fit. If we are simply dropping such a marker, we use + * skip_input_data to get past it, and thereby put the problem on the + * source manager's shoulders. If we are saving the marker's contents + * into memory, we use a slightly different convention: when forced to + * suspend, the marker processor updates the restart point to the end of + * what it's consumed (ie, the end of the buffer) before returning FALSE. + * On resumption, cinfo->unread_marker still contains the marker code, + * but the data source will point to the next chunk of marker data. + * The marker processor must retain internal state to deal with this. + * + * Note that we don't bother to avoid duplicate trace messages if a + * suspension occurs within marker parameters. Other side effects + * require more care. + */ + + +LOCAL(boolean) +get_soi (j_decompress_ptr cinfo) +/* Process an SOI marker */ +{ + int i; + + TRACEMS(cinfo, 1, JTRC_SOI); + + if (cinfo->marker->saw_SOI) + ERREXIT(cinfo, JERR_SOI_DUPLICATE); + + /* Reset all parameters that are defined to be reset by SOI */ + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + cinfo->restart_interval = 0; + + /* Set initial assumptions for colorspace etc */ + + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ + + cinfo->saw_JFIF_marker = FALSE; + cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; + cinfo->X_density = 1; + cinfo->Y_density = 1; + cinfo->saw_Adobe_marker = FALSE; + cinfo->Adobe_transform = 0; + + cinfo->marker->saw_SOI = TRUE; + + return TRUE; +} + + +LOCAL(boolean) +get_sof (j_decompress_ptr cinfo, J_CODEC_PROCESS process, boolean is_arith, + int data_unit) +/* Process a SOFn marker */ +{ + IJG_INT32 length; + int c, ci; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + cinfo->data_unit = data_unit; + cinfo->process = process; + cinfo->arith_code = is_arith; + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE); + INPUT_BYTE(cinfo, cinfo->num_components, return FALSE); + + length -= 8; + + TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker, + (int) cinfo->image_width, (int) cinfo->image_height, + cinfo->num_components); + + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_DUPLICATE); + + /* We don't support files in which the image height is initially specified */ + /* as 0 and is later redefined by DNL. As long as we have to check that, */ + /* might as well have a general sanity check. */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 + || cinfo->num_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + if (length != (cinfo->num_components * 3)) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + if (cinfo->comp_info == NULL) /* do only once, even if suspend */ + cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * SIZEOF(jpeg_component_info)); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->component_index = ci; + INPUT_BYTE(cinfo, compptr->component_id, return FALSE); + INPUT_BYTE(cinfo, c, return FALSE); + compptr->h_samp_factor = (c >> 4) & 15; + compptr->v_samp_factor = (c ) & 15; + INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); + + TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, + compptr->component_id, compptr->h_samp_factor, + compptr->v_samp_factor, compptr->quant_tbl_no); + } + + cinfo->marker->saw_SOF = TRUE; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_sos (j_decompress_ptr cinfo) +/* Process a SOS marker */ +{ + IJG_INT32 length; + int i, ci, n, c, cc; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + if (! cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOS_NO_SOF); + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */ + + TRACEMS1(cinfo, 1, JTRC_SOS, n); + + if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + cinfo->comps_in_scan = n; + + /* Collect the component-spec parameters */ + + for (i = 0; i < n; i++) { + INPUT_BYTE(cinfo, cc, return FALSE); + INPUT_BYTE(cinfo, c, return FALSE); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (cc == compptr->component_id) + goto id_found; + } + + ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); + + id_found: + + cinfo->cur_comp_info[i] = compptr; + compptr->dc_tbl_no = (c >> 4) & 15; + compptr->ac_tbl_no = (c ) & 15; + + TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, + compptr->dc_tbl_no, compptr->ac_tbl_no); + } + + /* Collect the additional scan parameters Ss, Se, Ah/Al. */ + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ss = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Se = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ah = (c >> 4) & 15; + cinfo->Al = (c ) & 15; + + TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se, + cinfo->Ah, cinfo->Al); + + /* Prepare to scan data & restart markers */ + cinfo->marker->next_restart_num = 0; + + /* Count another SOS marker */ + cinfo->input_scan_number++; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +#ifdef D_ARITH_CODING_SUPPORTED + +LOCAL(boolean) +get_dac (j_decompress_ptr cinfo) +/* Process a DAC marker */ +{ + IJG_INT32 length; + int idx, val; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + INPUT_BYTE(cinfo, idx, return FALSE); + INPUT_BYTE(cinfo, val, return FALSE); + + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_DAC, idx, val); + + if (idx < 0 || idx >= (2*NUM_ARITH_TBLS)) + ERREXIT1(cinfo, JERR_DAC_INDEX, idx); + + if (idx >= NUM_ARITH_TBLS) { /* define AC table */ + cinfo->arith_ac_K[idx-NUM_ARITH_TBLS] = (UINT8) val; + } else { /* define DC table */ + cinfo->arith_dc_L[idx] = (UINT8) (val & 0x0F); + cinfo->arith_dc_U[idx] = (UINT8) (val >> 4); + if (cinfo->arith_dc_L[idx] > cinfo->arith_dc_U[idx]) + ERREXIT1(cinfo, JERR_DAC_VALUE, val); + } + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + +#else /* ! D_ARITH_CODING_SUPPORTED */ + +#define get_dac(cinfo) skip_variable(cinfo) + +#endif /* D_ARITH_CODING_SUPPORTED */ + + +LOCAL(boolean) +get_dht (j_decompress_ptr cinfo) +/* Process a DHT marker */ +{ + IJG_INT32 length; + UINT8 bits[17]; + UINT8 huffval[256]; + int i, idx, count; + JHUFF_TBL **htblptr; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 16) { + INPUT_BYTE(cinfo, idx, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DHT, idx); + + bits[0] = 0; + count = 0; + for (i = 1; i <= 16; i++) { + INPUT_BYTE(cinfo, bits[i], return FALSE); + count += bits[i]; + } + + length -= 1 + 16; + + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[1], bits[2], bits[3], bits[4], + bits[5], bits[6], bits[7], bits[8]); + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[9], bits[10], bits[11], bits[12], + bits[13], bits[14], bits[15], bits[16]); + + /* Here we just do minimal validation of the counts to avoid walking + * off the end of our table space. jdhuff.c will check more carefully. + */ + if (count > 256 || ((IJG_INT32) count) > length) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + for (i = 0; i < count; i++) + INPUT_BYTE(cinfo, huffval[i], return FALSE); + + length -= count; + + if (idx & 0x10) { /* AC table definition */ + idx -= 0x10; + htblptr = &cinfo->ac_huff_tbl_ptrs[idx]; + } else { /* DC table definition */ + htblptr = &cinfo->dc_huff_tbl_ptrs[idx]; + } + + if (idx < 0 || idx >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_DHT_INDEX, idx); + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dqt (j_decompress_ptr cinfo) +/* Process a DQT marker */ +{ + IJG_INT32 length; + int n, i, prec; + unsigned int tmp; + JQUANT_TBL *quant_ptr; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + INPUT_BYTE(cinfo, n, return FALSE); + prec = n >> 4; + n &= 0x0F; + + TRACEMS2(cinfo, 1, JTRC_DQT, n, prec); + + if (n >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, n); + + if (cinfo->quant_tbl_ptrs[n] == NULL) + cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); + quant_ptr = cinfo->quant_tbl_ptrs[n]; + + for (i = 0; i < DCTSIZE2; i++) { + if (prec) + INPUT_2BYTES(cinfo, tmp, return FALSE); + else + INPUT_BYTE(cinfo, tmp, return FALSE); + /* We convert the zigzag-order table to natural array order. */ + quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp; + } + + if (cinfo->err->trace_level >= 2) { + for (i = 0; i < DCTSIZE2; i += 8) { + TRACEMS8(cinfo, 2, JTRC_QUANTVALS, + quant_ptr->quantval[i], quant_ptr->quantval[i+1], + quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], + quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], + quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); + } + } + + length -= DCTSIZE2+1; + if (prec) length -= DCTSIZE2; + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dri (j_decompress_ptr cinfo) +/* Process a DRI marker */ +{ + IJG_INT32 length; + unsigned int tmp; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + + if (length != 4) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_2BYTES(cinfo, tmp, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DRI, (int)tmp); + + cinfo->restart_interval = tmp; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Routines for processing APPn and COM markers. + * These are either saved in memory or discarded, per application request. + * APP0 and APP14 are specially checked to see if they are + * JFIF and Adobe markers, respectively. + */ + +#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */ +#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */ +#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */ + + +LOCAL(void) +examine_app0 (j_decompress_ptr cinfo, const JOCTET FAR * data, + unsigned int datalen, IJG_INT32 remaining) +/* Examine first few bytes from an APP0. + * Take appropriate action if it is a JFIF marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + IJG_INT32 totallen = (IJG_INT32) datalen + remaining; + + if (datalen >= APP0_DATA_LEN && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x49 && + GETJOCTET(data[3]) == 0x46 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF APP0 marker: save info */ + cinfo->saw_JFIF_marker = TRUE; + cinfo->JFIF_major_version = GETJOCTET(data[5]); + cinfo->JFIF_minor_version = GETJOCTET(data[6]); + cinfo->density_unit = GETJOCTET(data[7]); + cinfo->X_density = (UINT16)((GETJOCTET(data[8]) << 8) + GETJOCTET(data[9])); + cinfo->Y_density = (UINT16)((GETJOCTET(data[10]) << 8) + GETJOCTET(data[11])); + /* Check version. + * Major version must be 1, anything else signals an incompatible change. + * (We used to treat this as an error, but now it's a nonfatal warning, + * because some bozo at Hijaak couldn't read the spec.) + * Minor version should be 0..2, but process anyway if newer. + */ + if (cinfo->JFIF_major_version != 1) + WARNMS2(cinfo, JWRN_JFIF_MAJOR, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version); + /* Generate trace messages */ + TRACEMS5(cinfo, 1, JTRC_JFIF, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version, + cinfo->X_density, cinfo->Y_density, cinfo->density_unit); + /* Validate thumbnail dimensions and issue appropriate messages */ + if (GETJOCTET(data[12]) | GETJOCTET(data[13])) + TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, + GETJOCTET(data[12]), GETJOCTET(data[13])); + totallen -= APP0_DATA_LEN; + if (totallen != + ((IJG_INT32)GETJOCTET(data[12]) * (IJG_INT32)GETJOCTET(data[13]) * (IJG_INT32) 3)) + TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen); + } else if (datalen >= 6 && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x58 && + GETJOCTET(data[3]) == 0x58 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF "JFXX" extension APP0 marker */ + /* The library doesn't actually do anything with these, + * but we try to produce a helpful trace message. + */ + switch (GETJOCTET(data[5])) { + case 0x10: + TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen); + break; + case 0x11: + TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen); + break; + case 0x13: + TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen); + break; + default: + TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, + GETJOCTET(data[5]), (int) totallen); + break; + } + } else { + /* Start of APP0 does not match "JFIF" or "JFXX", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen); + } +} + + +LOCAL(void) +examine_app14 (j_decompress_ptr cinfo, const JOCTET FAR * data, + unsigned int datalen, IJG_INT32 remaining) +/* Examine first few bytes from an APP14. + * Take appropriate action if it is an Adobe marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + unsigned int version, flags0, flags1, transform; + + if (datalen >= APP14_DATA_LEN && + GETJOCTET(data[0]) == 0x41 && + GETJOCTET(data[1]) == 0x64 && + GETJOCTET(data[2]) == 0x6F && + GETJOCTET(data[3]) == 0x62 && + GETJOCTET(data[4]) == 0x65) { + /* Found Adobe APP14 marker */ + version = (unsigned int)((GETJOCTET(data[5]) << 8) + GETJOCTET(data[6])); + flags0 = (unsigned int)((GETJOCTET(data[7]) << 8) + GETJOCTET(data[8])); + flags1 = (unsigned int)((GETJOCTET(data[9]) << 8) + GETJOCTET(data[10])); + transform = GETJOCTET(data[11]); + TRACEMS4(cinfo, 1, JTRC_ADOBE, (int)version, (int)flags0, (int)flags1, (int)transform); + cinfo->saw_Adobe_marker = TRUE; + cinfo->Adobe_transform = (UINT8) transform; + } else { + /* Start of APP14 does not match "Adobe", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining)); + } +} + + +METHODDEF(boolean) +get_interesting_appn (j_decompress_ptr cinfo) +/* Process an APP0 or APP14 marker without saving it */ +{ + IJG_INT32 length; + JOCTET b[APPN_DATA_LEN]; + unsigned int i, numtoread; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + /* get the interesting part of the marker data */ + if (length >= APPN_DATA_LEN) + numtoread = APPN_DATA_LEN; + else if (length > 0) + numtoread = (unsigned int) length; + else + numtoread = 0; + for (i = 0; i < numtoread; i++) + INPUT_BYTE(cinfo, b[i], return FALSE); + length -= numtoread; + + /* process it */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + case M_APP14: + examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + default: + /* can't get here unless jpeg_save_markers chooses wrong processor */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +#ifdef SAVE_MARKERS_SUPPORTED + +METHODDEF(boolean) +save_marker (j_decompress_ptr cinfo) +/* Save an APPn or COM marker into the marker list */ +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + jpeg_saved_marker_ptr cur_marker = marker->cur_marker; + unsigned int bytes_read, data_length; + JOCTET FAR * data; + IJG_INT32 length = 0; + INPUT_VARS(cinfo); + + if (cur_marker == NULL) { + /* begin reading a marker */ + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + if (length >= 0) { /* watch out for bogus length word */ + /* figure out how much we want to save */ + unsigned int limit; + if (cinfo->unread_marker == (int) M_COM) + limit = marker->length_limit_COM; + else + limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0]; + if ((unsigned int) length < limit) + limit = (unsigned int) length; + /* allocate and initialize the marker item */ + cur_marker = (jpeg_saved_marker_ptr) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(struct jpeg_marker_struct) + limit); + cur_marker->next = NULL; + cur_marker->marker = (UINT8) cinfo->unread_marker; + cur_marker->original_length = (unsigned int) length; + cur_marker->data_length = limit; + /* data area is just beyond the jpeg_marker_struct */ + data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1); + marker->cur_marker = cur_marker; + marker->bytes_read = 0; + bytes_read = 0; + data_length = limit; + } else { + /* deal with bogus length word */ + bytes_read = data_length = 0; + data = NULL; + } + } else { + /* resume reading a marker */ + bytes_read = marker->bytes_read; + data_length = cur_marker->data_length; + data = cur_marker->data + bytes_read; + } + + while (bytes_read < data_length) { + INPUT_SYNC(cinfo); /* move the restart point to here */ + marker->bytes_read = bytes_read; + /* If there's not at least one byte in buffer, suspend */ + MAKE_BYTE_AVAIL(cinfo, return FALSE); + /* Copy bytes with reasonable rapidity */ + while (bytes_read < data_length && bytes_in_buffer > 0) { + *data++ = *next_input_byte++; + bytes_in_buffer--; + bytes_read++; + } + } + + /* Done reading what we want to read */ + if (cur_marker != NULL) { /* will be NULL if bogus length word */ + /* Add new marker to end of list */ + if (cinfo->marker_list == NULL) { + cinfo->marker_list = cur_marker; + } else { + jpeg_saved_marker_ptr prev = cinfo->marker_list; + while (prev->next != NULL) + prev = prev->next; + prev->next = cur_marker; + } + /* Reset pointer & calc remaining data length */ + data = cur_marker->data; + length = cur_marker->original_length - data_length; + } + /* Reset to initial state for next marker */ + marker->cur_marker = NULL; + + /* Process the marker if interesting; else just make a generic trace msg */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, data, data_length, length); + break; + case M_APP14: + examine_app14(cinfo, data, data_length, length); + break; + default: + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, + (int) (data_length + length)); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +METHODDEF(boolean) +skip_variable (j_decompress_ptr cinfo) +/* Skip over an unknown or uninteresting variable-length marker */ +{ + IJG_INT32 length; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); + + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +/* + * Find the next JPEG marker, save it in cinfo->unread_marker. + * Returns FALSE if had to suspend before reaching a marker; + * in that case cinfo->unread_marker is unchanged. + * + * Note that the result might not be a valid marker code, + * but it will never be 0 or FF. + */ + +LOCAL(boolean) +next_marker (j_decompress_ptr cinfo) +{ + int c; + INPUT_VARS(cinfo); + + for (;;) { + INPUT_BYTE(cinfo, c, return FALSE); + /* Skip any non-FF bytes. + * This may look a bit inefficient, but it will not occur in a valid file. + * We sync after each discarded byte so that a suspending data source + * can discard the byte from its buffer. + */ + while (c != 0xFF) { + cinfo->marker->discarded_bytes++; + INPUT_SYNC(cinfo); + INPUT_BYTE(cinfo, c, return FALSE); + } + /* This loop swallows any duplicate FF bytes. Extra FFs are legal as + * pad bytes, so don't count them in discarded_bytes. We assume there + * will not be so many consecutive FF bytes as to overflow a suspending + * data source's input buffer. + */ + do { + INPUT_BYTE(cinfo, c, return FALSE); + } while (c == 0xFF); + if (c != 0) + break; /* found a valid marker, exit loop */ + /* Reach here if we found a stuffed-zero data sequence (FF/00). + * Discard it and loop back to try again. + */ + cinfo->marker->discarded_bytes += 2; + INPUT_SYNC(cinfo); + } + + if (cinfo->marker->discarded_bytes != 0) { + WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, (int)cinfo->marker->discarded_bytes, c); + cinfo->marker->discarded_bytes = 0; + } + + cinfo->unread_marker = c; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +first_marker (j_decompress_ptr cinfo) +/* Like next_marker, but used to obtain the initial SOI marker. */ +/* For this marker, we do not allow preceding garbage or fill; otherwise, + * we might well scan an entire input file before realizing it ain't JPEG. + * If an application wants to process non-JFIF files, it must seek to the + * SOI before calling the JPEG library. + */ +{ + int c, c2; + INPUT_VARS(cinfo); + + INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c2, return FALSE); + if (c != 0xFF || c2 != (int) M_SOI) + ERREXIT2(cinfo, JERR_NO_SOI, c, c2); + + cinfo->unread_marker = c2; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Read markers until SOS or EOI. + * + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + */ + +METHODDEF(int) +read_markers (j_decompress_ptr cinfo) +{ + /* Outer loop repeats once for each marker. */ + for (;;) { + /* Collect the marker proper, unless we already did. */ + /* NB: first_marker() enforces the requirement that SOI appear first. */ + if (cinfo->unread_marker == 0) { + if (! cinfo->marker->saw_SOI) { + if (! first_marker(cinfo)) + return JPEG_SUSPENDED; + } else { + if (! next_marker(cinfo)) + return JPEG_SUSPENDED; + } + } + /* At this point cinfo->unread_marker contains the marker code and the + * input point is just past the marker proper, but before any parameters. + * A suspension will cause us to return with this state still true. + */ + switch (cinfo->unread_marker) { + case M_SOI: + if (! get_soi(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_SOF0: /* Baseline */ + case M_SOF1: /* Extended sequential, Huffman */ + if (! get_sof(cinfo, JPROC_SEQUENTIAL, FALSE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF2: /* Progressive, Huffman */ + if (! get_sof(cinfo, JPROC_PROGRESSIVE, FALSE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF3: /* Lossless, Huffman */ + if (! get_sof(cinfo, JPROC_LOSSLESS, FALSE, 1)) + return JPEG_SUSPENDED; + break; + + case M_SOF9: /* Extended sequential, arithmetic */ + if (! get_sof(cinfo, JPROC_SEQUENTIAL, TRUE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF10: /* Progressive, arithmetic */ + if (! get_sof(cinfo, JPROC_PROGRESSIVE, TRUE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF11: /* Lossless, arithmetic */ + if (! get_sof(cinfo, JPROC_LOSSLESS, TRUE, 1)) + return JPEG_SUSPENDED; + break; + + /* Currently unsupported SOFn types */ + case M_SOF5: /* Differential sequential, Huffman */ + case M_SOF6: /* Differential progressive, Huffman */ + case M_SOF7: /* Differential lossless, Huffman */ + case M_JPG: /* Reserved for JPEG extensions */ + case M_SOF13: /* Differential sequential, arithmetic */ + case M_SOF14: /* Differential progressive, arithmetic */ + case M_SOF15: /* Differential lossless, arithmetic */ + ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker); + break; + + case M_SOS: + if (! get_sos(cinfo)) + return JPEG_SUSPENDED; + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_SOS; + + case M_EOI: + TRACEMS(cinfo, 1, JTRC_EOI); + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_EOI; + + case M_DAC: + if (! get_dac(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DHT: + if (! get_dht(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DQT: + if (! get_dqt(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DRI: + if (! get_dri(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_APP0: + case M_APP1: + case M_APP2: + case M_APP3: + case M_APP4: + case M_APP5: + case M_APP6: + case M_APP7: + case M_APP8: + case M_APP9: + case M_APP10: + case M_APP11: + case M_APP12: + case M_APP13: + case M_APP14: + case M_APP15: + if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[ + cinfo->unread_marker - (int) M_APP0]) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_COM: + if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_RST0: /* these are all parameterless */ + case M_RST1: + case M_RST2: + case M_RST3: + case M_RST4: + case M_RST5: + case M_RST6: + case M_RST7: + case M_TEM: + TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker); + break; + + case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ + if (! skip_variable(cinfo)) + return JPEG_SUSPENDED; + break; + + default: /* must be DHP, EXP, JPGn, or RESn */ + /* For now, we treat the reserved markers as fatal errors since they are + * likely to be used to signal incompatible JPEG Part 3 extensions. + * Once the JPEG 3 version-number marker is well defined, this code + * ought to change! + */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + /* Successfully processed marker, so reset state variable */ + cinfo->unread_marker = 0; + } /* end loop */ +} + + +/* + * Read a restart marker, which is expected to appear next in the datastream; + * if the marker is not there, take appropriate recovery action. + * Returns FALSE if suspension is required. + * + * This is called by the entropy decoder after it has read an appropriate + * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder + * has already read a marker from the data source. Under normal conditions + * cinfo->unread_marker will be reset to 0 before returning; if not reset, + * it holds a marker which the decoder will be unable to read past. + */ + +METHODDEF(boolean) +read_restart_marker (j_decompress_ptr cinfo) +{ + /* Obtain a marker unless we already did. */ + /* Note that next_marker will complain if it skips any data. */ + if (cinfo->unread_marker == 0) { + if (! next_marker(cinfo)) + return FALSE; + } + + if (cinfo->unread_marker == + ((int) M_RST0 + cinfo->marker->next_restart_num)) { + /* Normal case --- swallow the marker and let entropy decoder continue */ + TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num); + cinfo->unread_marker = 0; + } else { + /* Uh-oh, the restart markers have been messed up. */ + /* Let the data source manager determine how to resync. */ + if (! (*cinfo->src->resync_to_restart) (cinfo, + cinfo->marker->next_restart_num)) + return FALSE; + } + + /* Update next-restart state */ + cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7; + + return TRUE; +} + + +/* + * This is the default resync_to_restart method for data source managers + * to use if they don't have any better approach. Some data source managers + * may be able to back up, or may have additional knowledge about the data + * which permits a more intelligent recovery strategy; such managers would + * presumably supply their own resync method. + * + * read_restart_marker calls resync_to_restart if it finds a marker other than + * the restart marker it was expecting. (This code is *not* used unless + * a nonzero restart interval has been declared.) cinfo->unread_marker is + * the marker code actually found (might be anything, except 0 or FF). + * The desired restart marker number (0..7) is passed as a parameter. + * This routine is supposed to apply whatever error recovery strategy seems + * appropriate in order to position the input stream to the next data segment. + * Note that cinfo->unread_marker is treated as a marker appearing before + * the current data-source input point; usually it should be reset to zero + * before returning. + * Returns FALSE if suspension is required. + * + * This implementation is substantially constrained by wanting to treat the + * input as a data stream; this means we can't back up. Therefore, we have + * only the following actions to work with: + * 1. Simply discard the marker and let the entropy decoder resume at next + * byte of file. + * 2. Read forward until we find another marker, discarding intervening + * data. (In theory we could look ahead within the current bufferload, + * without having to discard data if we don't find the desired marker. + * This idea is not implemented here, in part because it makes behavior + * dependent on buffer size and chance buffer-boundary positions.) + * 3. Leave the marker unread (by failing to zero cinfo->unread_marker). + * This will cause the entropy decoder to process an empty data segment, + * inserting dummy zeroes, and then we will reprocess the marker. + * + * #2 is appropriate if we think the desired marker lies ahead, while #3 is + * appropriate if the found marker is a future restart marker (indicating + * that we have missed the desired restart marker, probably because it got + * corrupted). + * We apply #2 or #3 if the found marker is a restart marker no more than + * two counts behind or ahead of the expected one. We also apply #2 if the + * found marker is not a legal JPEG marker code (it's certainly bogus data). + * If the found marker is a restart marker more than 2 counts away, we do #1 + * (too much risk that the marker is erroneous; with luck we will be able to + * resync at some future point). + * For any valid non-restart JPEG marker, we apply #3. This keeps us from + * overrunning the end of a scan. An implementation limited to single-scan + * files might find it better to apply #2 for markers other than EOI, since + * any other marker would have to be bogus data in that case. + */ + +GLOBAL(boolean) +jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) +{ + int marker = cinfo->unread_marker; + int action = 1; + + /* Always put up a warning. */ + WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); + + /* Outer loop handles repeated decision after scanning forward. */ + for (;;) { + if (marker < (int) M_SOF0) + action = 2; /* invalid marker */ + else if (marker < (int) M_RST0 || marker > (int) M_RST7) + action = 3; /* valid non-restart marker */ + else { + if (marker == ((int) M_RST0 + ((desired+1) & 7)) || + marker == ((int) M_RST0 + ((desired+2) & 7))) + action = 3; /* one of the next two expected restarts */ + else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || + marker == ((int) M_RST0 + ((desired-2) & 7))) + action = 2; /* a prior restart, so advance */ + else + action = 1; /* desired restart or too far away */ + } + TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action); + switch (action) { + case 1: + /* Discard marker and let entropy decoder resume processing. */ + cinfo->unread_marker = 0; + return TRUE; + case 2: + /* Scan to the next marker, and repeat the decision loop. */ + if (! next_marker(cinfo)) + return FALSE; + marker = cinfo->unread_marker; + break; + case 3: + /* Return without advancing past this marker. */ + /* Entropy decoder will be forced to process an empty segment. */ + return TRUE; + } + } /* end loop */ +} + + +/* + * Reset marker processing state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + cinfo->comp_info = NULL; /* until allocated by get_sof */ + cinfo->input_scan_number = 0; /* no SOS seen yet */ + cinfo->unread_marker = 0; /* no pending marker */ + marker->pub.saw_SOI = FALSE; /* set internal state too */ + marker->pub.saw_SOF = FALSE; + marker->pub.discarded_bytes = 0; + marker->cur_marker = NULL; +} + + +/* + * Initialize the marker reader module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker; + int i; + + /* Create subobject in permanent pool */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_marker_reader)); + cinfo->marker = (struct jpeg_marker_reader *) marker; + /* Initialize public method pointers */ + marker->pub.reset_marker_reader = reset_marker_reader; + marker->pub.read_markers = read_markers; + marker->pub.read_restart_marker = read_restart_marker; + /* Initialize COM/APPn processing. + * By default, we examine and then discard APP0 and APP14, + * but simply discard COM and all other APPn. + */ + marker->process_COM = skip_variable; + marker->length_limit_COM = 0; + for (i = 0; i < 16; i++) { + marker->process_APPn[i] = skip_variable; + marker->length_limit_APPn[i] = 0; + } + marker->process_APPn[0] = get_interesting_appn; + marker->process_APPn[14] = get_interesting_appn; + /* Reset marker processing state */ + reset_marker_reader(cinfo); +} + + +/* + * Control saving of COM and APPn markers into marker_list. + */ + +#ifdef SAVE_MARKERS_SUPPORTED + +GLOBAL(void) +jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + long maxlength; + jpeg_marker_parser_method processor; + + /* Length limit mustn't be larger than what we can allocate + * (should only be a concern in a 16-bit environment). + */ + maxlength = cinfo->mem->max_alloc_chunk - (long)SIZEOF(struct jpeg_marker_struct); + if (((long) length_limit) > maxlength) + length_limit = (unsigned int) maxlength; + + /* Choose processor routine to use. + * APP0/APP14 have special requirements. + */ + if (length_limit) { + processor = save_marker; + /* If saving APP0/APP14, save at least enough for our internal use. */ + if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN) + length_limit = APP0_DATA_LEN; + else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN) + length_limit = APP14_DATA_LEN; + } else { + processor = skip_variable; + /* If discarding APP0/APP14, use our regular on-the-fly processor. */ + if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14) + processor = get_interesting_appn; + } + + if (marker_code == (int) M_COM) { + marker->process_COM = processor; + marker->length_limit_COM = length_limit; + } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) { + marker->process_APPn[marker_code - (int) M_APP0] = processor; + marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit; + } else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +/* + * Install a special processing method for COM or APPn markers. + */ + +GLOBAL(void) +jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + if (marker_code == (int) M_COM) + marker->process_COM = routine; + else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) + marker->process_APPn[marker_code - (int) M_APP0] = routine; + else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} diff --git a/dcmjpeg/libijg16/jdmaster.c b/dcmjpeg/libijg16/jdmaster.c new file mode 100644 index 00000000..970ae0e7 --- /dev/null +++ b/dcmjpeg/libijg16/jdmaster.c @@ -0,0 +1,460 @@ +/* + * jdmaster.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG decompressor. + * These routines are concerned with selecting the modules to be executed + * and with determining the number of passes and the work to be done in each + * pass. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Private state */ + +typedef struct { + struct jpeg_decomp_master pub; /* public fields */ + + int pass_number; /* # of passes completed */ + + boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ + + /* Saved references to initialized quantizer modules, + * in case we need to switch modes. + */ + struct jpeg_color_quantizer * quantizer_1pass; + struct jpeg_color_quantizer * quantizer_2pass; +} my_decomp_master; + +typedef my_decomp_master * my_master_ptr; + + +/* + * Determine whether merged upsample/color conversion should be used. + * CRUCIAL: this must match the actual capabilities of jdmerge.c! + */ + +LOCAL(boolean) +use_merged_upsample (j_decompress_ptr cinfo) +{ +#ifdef UPSAMPLE_MERGING_SUPPORTED + /* Merging is the equivalent of plain box-filter upsampling */ + if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) + return FALSE; + /* jdmerge.c only supports YCC=>RGB color conversion */ + if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || + cinfo->out_color_space != JCS_RGB || + cinfo->out_color_components != RGB_PIXELSIZE) + return FALSE; + /* and it only handles 2h1v or 2h2v sampling ratios */ + if (cinfo->comp_info[0].h_samp_factor != 2 || + cinfo->comp_info[1].h_samp_factor != 1 || + cinfo->comp_info[2].h_samp_factor != 1 || + cinfo->comp_info[0].v_samp_factor > 2 || + cinfo->comp_info[1].v_samp_factor != 1 || + cinfo->comp_info[2].v_samp_factor != 1) + return FALSE; + /* furthermore, it doesn't work if each component has been + processed differently */ + if (cinfo->comp_info[0].codec_data_unit != cinfo->min_codec_data_unit || + cinfo->comp_info[1].codec_data_unit != cinfo->min_codec_data_unit || + cinfo->comp_info[2].codec_data_unit != cinfo->min_codec_data_unit) + return FALSE; + /* ??? also need to test for upsample-time rescaling, when & if supported */ + return TRUE; /* by golly, it'll work... */ +#else + return FALSE; +#endif +} + + +/* + * Compute output image dimensions and related values. + * NOTE: this is exported for possible use by application. + * Hence it mustn't do anything that can't be done twice. + * Also note that it may be called before the master module is initialized! + */ + +GLOBAL(void) +jpeg_calc_output_dimensions (j_decompress_ptr cinfo) +/* Do computations that are needed before master selection phase */ +{ + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_READY) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->codec->calc_output_dimensions) (cinfo); + + /* Report number of components in selected colorspace. */ + /* Probably this should be in the color conversion module... */ + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + break; + case JCS_RGB: +#if RGB_PIXELSIZE != 3 + cinfo->out_color_components = RGB_PIXELSIZE; + break; +#endif /* else share code with YCbCr */ + case JCS_YCbCr: + cinfo->out_color_components = 3; + break; + case JCS_CMYK: + case JCS_YCCK: + cinfo->out_color_components = 4; + break; + default: /* else must be same colorspace as in file */ + cinfo->out_color_components = cinfo->num_components; + break; + } + cinfo->output_components = (cinfo->quantize_colors ? 1 : + cinfo->out_color_components); + + /* See if upsampler will want to emit more than one row at a time */ + if (use_merged_upsample(cinfo)) + cinfo->rec_outbuf_height = cinfo->max_v_samp_factor; + else + cinfo->rec_outbuf_height = 1; +} + + +/* + * Several decompression processes need to range-limit values to the range + * 0..MAXJSAMPLE; the input value may fall somewhat outside this range + * due to noise introduced by quantization, roundoff error, etc. These + * processes are inner loops and need to be as fast as possible. On most + * machines, particularly CPUs with pipelines or instruction prefetch, + * a (subscript-check-less) C table lookup + * x = sample_range_limit[x]; + * is faster than explicit tests + * if (x < 0) x = 0; + * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; + * These processes all use a common table prepared by the routine below. + * + * For most steps we can mathematically guarantee that the initial value + * of x is within MAXJSAMPLE+1 of the legal range, so a table running from + * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial + * limiting step (just after the IDCT), a wildly out-of-range value is + * possible if the input data is corrupt. To avoid any chance of indexing + * off the end of memory and getting a bad-pointer trap, we perform the + * post-IDCT limiting thus: + * x = range_limit[x & MASK]; + * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit + * samples. Under normal circumstances this is more than enough range and + * a correct output will be generated; with bogus input data the mask will + * cause wraparound, and we will safely generate a bogus-but-in-range output. + * For the post-IDCT step, we want to convert the data from signed to unsigned + * representation by adding CENTERJSAMPLE at the same time that we limit it. + * So the post-IDCT limiting table ends up looking like this: + * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE, + * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0,1,...,CENTERJSAMPLE-1 + * Negative inputs select values from the upper half of the table after + * masking. + * + * We can save some space by overlapping the start of the post-IDCT table + * with the simpler range limiting table. The post-IDCT table begins at + * sample_range_limit + CENTERJSAMPLE. + * + * Note that the table is allocated in near data space on PCs; it's small + * enough and used often enough to justify this. + */ + +LOCAL(void) +prepare_range_limit_table (j_decompress_ptr cinfo) +/* Allocate and fill in the sample_range_limit table */ +{ + JSAMPLE * table; + int i; + + table = (JSAMPLE *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ + cinfo->sample_range_limit = table; + /* First segment of "simple" table: limit[x] = 0 for x < 0 */ + MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + /* Main part of "simple" table: limit[x] = x */ + for (i = 0; i <= MAXJSAMPLE; i++) + table[i] = (JSAMPLE) i; + table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ + /* End of simple table, rest of first half of post-IDCT table */ + for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) + table[i] = MAXJSAMPLE; + /* Second half of post-IDCT table */ + MEMZERO(table + (2 * (MAXJSAMPLE+1)), + (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), + cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE)); +} + + +/* + * Master selection of decompression modules. + * This is done once at jpeg_start_decompress time. We determine + * which modules will be used and give them appropriate initialization calls. + * We also initialize the decompressor input side to begin consuming data. + * + * Since jpeg_read_header has finished, we know what is in the SOF + * and (first) SOS markers. We also have all the application parameter + * settings. + */ + +LOCAL(void) +master_selection (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + long samplesperrow; + JDIMENSION jd_samplesperrow; + + /* Initialize dimensions and other stuff */ + jpeg_calc_output_dimensions(cinfo); + prepare_range_limit_table(cinfo); + + /* Width of an output scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* Initialize my private state */ + master->pass_number = 0; + master->using_merged_upsample = use_merged_upsample(cinfo); + + /* Color quantizer selection */ + master->quantizer_1pass = NULL; + master->quantizer_2pass = NULL; + /* No mode changes if not using buffered-image mode. */ + if (! cinfo->quantize_colors || ! cinfo->buffered_image) { + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + } + if (cinfo->quantize_colors) { + if (cinfo->raw_data_out) + ERREXIT(cinfo, JERR_NOTIMPL); + /* 2-pass quantizer only works in 3-component color space. */ + if (cinfo->out_color_components != 3) { + cinfo->enable_1pass_quant = TRUE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + cinfo->colormap = NULL; + } else if (cinfo->colormap != NULL) { + cinfo->enable_external_quant = TRUE; + } else if (cinfo->two_pass_quantize) { + cinfo->enable_2pass_quant = TRUE; + } else { + cinfo->enable_1pass_quant = TRUE; + } + + if (cinfo->enable_1pass_quant) { +#ifdef QUANT_1PASS_SUPPORTED + jinit_1pass_quantizer(cinfo); + master->quantizer_1pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + + /* We use the 2-pass code to map to external colormaps. */ + if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) { +#ifdef QUANT_2PASS_SUPPORTED + jinit_2pass_quantizer(cinfo); + master->quantizer_2pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + /* If both quantizers are initialized, the 2-pass one is left active; + * this is necessary for starting with quantization to an external map. + */ + } + + /* Post-processing: in particular, color conversion first */ + if (! cinfo->raw_data_out) { + if (master->using_merged_upsample) { +#ifdef UPSAMPLE_MERGING_SUPPORTED + jinit_merged_upsampler(cinfo); /* does color conversion too */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + jinit_color_deconverter(cinfo); + jinit_upsampler(cinfo); + } + jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant); + } + + /* Initialize principal buffer controllers. */ + if (! cinfo->raw_data_out) + jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* If jpeg_start_decompress will read the whole file, initialize + * progress monitoring appropriately. The input step is counted + * as one pass. + */ + if (cinfo->progress != NULL && ! cinfo->buffered_image && + cinfo->inputctl->has_multiple_scans) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2); + /* Count the input pass as done */ + master->pass_number++; + } +#endif /* D_MULTISCAN_FILES_SUPPORTED */ +} + + +/* + * Per-pass setup. + * This is called at the beginning of each output pass. We determine which + * modules will be active during this pass and give them appropriate + * start_pass calls. We also set is_dummy_pass to indicate whether this + * is a "real" output pass or a dummy pass for color quantization. + * (In the latter case, jdapistd.c will crank the pass to completion.) + */ + +METHODDEF(void) +prepare_for_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (master->pub.is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Final pass of 2-pass quantization */ + master->pub.is_dummy_pass = FALSE; + (*cinfo->cquantize->start_pass) (cinfo, FALSE); + (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); + (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + if (cinfo->quantize_colors && cinfo->colormap == NULL) { + /* Select new quantization method */ + if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) { + cinfo->cquantize = master->quantizer_2pass; + master->pub.is_dummy_pass = TRUE; + } else if (cinfo->enable_1pass_quant) { + cinfo->cquantize = master->quantizer_1pass; + } else { + ERREXIT(cinfo, JERR_MODE_CHANGE); + } + } + (*cinfo->codec->start_output_pass) (cinfo); + if (! cinfo->raw_data_out) { + if (! master->using_merged_upsample) + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->upsample->start_pass) (cinfo); + if (cinfo->quantize_colors) + (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass); + (*cinfo->post->start_pass) (cinfo, + (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + } + } + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->pass_number + + (master->pub.is_dummy_pass ? 2 : 1); + /* In buffered-image mode, we assume one more output pass if EOI not + * yet reached, but no more passes if EOI has been reached. + */ + if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) { + cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1); + } + } +} + + +/* + * Finish up at end of an output pass. + */ + +METHODDEF(void) +finish_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (cinfo->quantize_colors) + (*cinfo->cquantize->finish_pass) (cinfo); + master->pass_number++; +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Switch to a new external colormap between output passes. + */ + +GLOBAL(void) +jpeg_new_colormap (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_BUFIMAGE) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (cinfo->quantize_colors && cinfo->enable_external_quant && + cinfo->colormap != NULL) { + /* Select 2-pass quantizer for external colormap use */ + cinfo->cquantize = master->quantizer_2pass; + /* Notify quantizer of colormap change */ + (*cinfo->cquantize->new_color_map) (cinfo); + master->pub.is_dummy_pass = FALSE; /* just in case */ + } else + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +/* + * Initialize master decompression control and select active modules. + * This is performed at the start of jpeg_start_decompress. + */ + +GLOBAL(void) +jinit_master_decompress (j_decompress_ptr cinfo) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_decomp_master)); + cinfo->master = (struct jpeg_decomp_master *) master; + master->pub.prepare_for_output_pass = prepare_for_output_pass; + master->pub.finish_output_pass = finish_output_pass; + + master->pub.is_dummy_pass = FALSE; + + master_selection(cinfo); +} diff --git a/dcmjpeg/libijg16/jdmerge.c b/dcmjpeg/libijg16/jdmerge.c new file mode 100644 index 00000000..84875e7c --- /dev/null +++ b/dcmjpeg/libijg16/jdmerge.c @@ -0,0 +1,423 @@ +/* + * jdmerge.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains code for merged upsampling/color conversion. + * + * This file combines functions from jdsample.c and jdcolor.c; + * read those files first to understand what's going on. + * + * When the chroma components are to be upsampled by simple replication + * (ie, box filtering), we can save some work in color conversion by + * calculating all the output pixels corresponding to a pair of chroma + * samples at one time. In the conversion equations + * R = Y + K1 * Cr + * G = Y + K2 * Cb + K3 * Cr + * B = Y + K4 * Cb + * only the Y term varies among the group of pixels corresponding to a pair + * of chroma samples, so the rest of the terms can be calculated just once. + * At typical sampling ratios, this eliminates half or three-quarters of the + * multiplications needed for color conversion. + * + * This file currently provides implementations for the following cases: + * YCbCr => RGB color conversion only. + * Sampling ratios of 2h1v or 2h2v. + * No scaling needed at upsample time. + * Corner-aligned (non-CCIR601) sampling alignment. + * Other special cases could be added, but in most applications these are + * the only common cases. (For uncommon cases we fall back on the more + * general code in jdsample.c and jdcolor.c.) + */ + +#define JPEG_INTERNALS +#include "dcmtk/config/osconfig.h" +#include "jinclude16.h" +#include "jpeglib16.h" + +/* check if we have a 64-bit integer type */ +#if SIZEOF_LONG == 8 +typedef long jdmerge_sint64; +#elif defined(_WIN32) +typedef __int64 jdmerge_sint64; +#elif defined(HAVE_LONG_LONG) +typedef long long jdmerge_sint64; +#elif defined (HAVE_LONGLONG) +typedef longlong jdmerge_sint64; +#else +#define JDMERGE_NO_SINT64 +#endif + +#ifdef UPSAMPLE_MERGING_SUPPORTED + + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Pointer to routine to do actual upsampling/conversion of one row group */ + JMETHOD(void, upmethod, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf)); + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + IJG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + IJG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + + /* For 2:1 vertical sampling, we produce two output rows at a time. + * We need a "spare" row buffer to hold the second output row if the + * application provides just a one-row buffer; we also use the spare + * to discard the dummy last row if the image height is odd. + */ + JSAMPROW spare_row; + boolean spare_full; /* T if spare buffer is occupied */ + + JDIMENSION out_row_width; /* samples per output row */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L<RGB colorspace conversion. + * This is taken directly from jdcolor.c; see that file for more info. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int i; + IJG_INT32 x; + SHIFT_TEMPS + + upsample->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cr_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + upsample->Cb_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ +#ifdef JDMERGE_NO_SINT64 + /* Cr=>R value is nearest int to 1.40200 * x */ + upsample->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + upsample->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); +#else + /* Cr=>R value is nearest int to 1.40200 * x */ + upsample->Cr_r_tab[i] = (int) + RIGHT_SHIFT((jdmerge_sint64) FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + upsample->Cb_b_tab[i] = (int) + RIGHT_SHIFT((jdmerge_sint64) FIX(1.77200) * x + ONE_HALF, SCALEBITS); +#endif + /* Cr=>G value is scaled-up -0.71414 * x */ + upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_merged_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the spare buffer empty */ + upsample->spare_full = FALSE; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * The control routine just handles the row buffering considerations. + */ + +METHODDEF(void) +merged_2v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 2:1 vertical sampling case: may need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPROW work_ptrs[2]; + JDIMENSION num_rows; /* number of rows returned to caller */ + + if (upsample->spare_full) { + /* If we have a spare row saved from a previous cycle, just return it. */ + jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0, + 1, upsample->out_row_width); + num_rows = 1; + upsample->spare_full = FALSE; + } else { + /* Figure number of rows to return to caller. */ + num_rows = 2; + /* Not more than the distance to the end of the image. */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + /* Create output pointer array for upsampler. */ + work_ptrs[0] = output_buf[*out_row_ctr]; + if (num_rows > 1) { + work_ptrs[1] = output_buf[*out_row_ctr + 1]; + } else { + work_ptrs[1] = upsample->spare_row; + upsample->spare_full = TRUE; + } + /* Now do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); + } + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (! upsample->spare_full) + (*in_row_group_ctr)++; +} + + +METHODDEF(void) +merged_1v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 1:1 vertical sampling case: much easier, never need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Just do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, + output_buf + *out_row_ctr); + /* Adjust counts */ + (*out_row_ctr)++; + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by the control routines to do + * the actual upsampling/conversion. One row group is processed per call. + * + * Note: since we may be writing directly into application-supplied buffers, + * we have to be honest about the output width; we can't assume the buffer + * has been rounded up to an even width. + */ + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. + */ + +METHODDEF(void) +h2v1_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr; + JSAMPROW inptr0, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + IJG_INT32 * Crgtab = upsample->Cr_g_tab; + IJG_INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr0 = input_buf[0][in_row_group_ctr]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr = output_buf[0]; + /* Loop for each pair of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 2 Y values and emit 2 pixels */ + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr0); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. + */ + +METHODDEF(void) +h2v2_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr0, outptr1; + JSAMPROW inptr00, inptr01, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + IJG_INT32 * Crgtab = upsample->Cr_g_tab; + IJG_INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr00 = input_buf[0][in_row_group_ctr*2]; + inptr01 = input_buf[0][in_row_group_ctr*2 + 1]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr0 = output_buf[0]; + outptr1 = output_buf[1]; + /* Loop for each group of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 4 Y values and emit 4 pixels */ + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr00); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + y = GETJSAMPLE(*inptr01); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Module initialization routine for merged upsampling/color conversion. + * + * NB: this is called under the conditions determined by use_merged_upsample() + * in jdmaster.c. That routine MUST correspond to the actual capabilities + * of this module; no safety checks are made here. + */ + +GLOBAL(void) +jinit_merged_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_merged_upsample; + upsample->pub.need_context_rows = FALSE; + + upsample->out_row_width = cinfo->output_width * (JDIMENSION)cinfo->out_color_components; + + if (cinfo->max_v_samp_factor == 2) { + upsample->pub.upsample = merged_2v_upsample; + upsample->upmethod = h2v2_merged_upsample; + /* Allocate a spare row buffer */ + upsample->spare_row = (JSAMPROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE))); + } else { + upsample->pub.upsample = merged_1v_upsample; + upsample->upmethod = h2v1_merged_upsample; + /* No spare row needed */ + upsample->spare_row = NULL; + } + + build_ycc_rgb_table(cinfo); +} + +#endif /* UPSAMPLE_MERGING_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jdphuff.c b/dcmjpeg/libijg16/jdphuff.c new file mode 100644 index 00000000..2750a67d --- /dev/null +++ b/dcmjpeg/libijg16/jdphuff.c @@ -0,0 +1,689 @@ +/* + * jdphuff.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for progressive JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy subsystem */ +#include "jdhuff16.h" /* Declarations shared with jd*huff.c */ + + +#ifdef D_PROGRESSIVE_SUPPORTED + +/* + * Private entropy decoder object for progressive Huffman decoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + unsigned int EOBRUN; /* remaining EOBs in EOBRUN */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).EOBRUN = (src).EOBRUN, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* These fields are loaded into local variables at start of each MCU. + * In case of suspension, we exit WITHOUT updating them. + */ + savable_state saved; /* Other state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */ +} phuff_entropy_decoder; + +typedef phuff_entropy_decoder * phuff_entropy_ptr; + +/* Forward declarations */ +METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_phuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + boolean is_DC_band, bad; + int ci, coefi, tbl; + int *coef_bit_ptr; + jpeg_component_info * compptr; + + is_DC_band = (cinfo->Ss == 0); + + /* Validate scan parameters */ + bad = FALSE; + if (is_DC_band) { + if (cinfo->Se != 0) + bad = TRUE; + } else { + /* need not check Ss/Se < 0 since they came from unsigned bytes */ + if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2) + bad = TRUE; + /* AC scans may have only one component */ + if (cinfo->comps_in_scan != 1) + bad = TRUE; + } + if (cinfo->Ah != 0) { + /* Successive approximation refinement scan: must have Al = Ah-1. */ + if (cinfo->Al != cinfo->Ah-1) + bad = TRUE; + } + if (cinfo->Al > 13) /* need not check for < 0 */ + bad = TRUE; + /* Arguably the maximum Al value should be less than 13 for 8-bit precision, + * but the spec doesn't say so, and we try to be liberal about what we + * accept. Note: large Al values could result in out-of-range DC + * coefficients during early scans, leading to bizarre displays due to + * overflows in the IDCT math. But we won't crash. + */ + if (bad) + ERREXIT4(cinfo, JERR_BAD_PROGRESSION, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + /* Update progression status, and verify that scan order is legal. + * Note that inter-scan inconsistencies are treated as warnings + * not fatal errors ... not clear if this is right way to behave. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + int cindex = cinfo->cur_comp_info[ci]->component_index; + coef_bit_ptr = & cinfo->coef_bits[cindex][0]; + if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */ + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0); + for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) { + int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi]; + if (cinfo->Ah != expected) + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi); + coef_bit_ptr[coefi] = cinfo->Al; + } + } + + /* Select MCU decoding routine */ + if (cinfo->Ah == 0) { + if (is_DC_band) + lossyd->entropy_decode_mcu = decode_mcu_DC_first; + else + lossyd->entropy_decode_mcu = decode_mcu_AC_first; + } else { + if (is_DC_band) + lossyd->entropy_decode_mcu = decode_mcu_DC_refine; + else + lossyd->entropy_decode_mcu = decode_mcu_AC_refine; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Make sure requested tables are present, and compute derived tables. + * We may build same derived table more than once, but it's not expensive. + */ + if (is_DC_band) { + if (cinfo->Ah == 0) { /* DC refinement needs no table */ + tbl = compptr->dc_tbl_no; + jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, + & entropy->derived_tbls[tbl]); + } + } else { + tbl = compptr->ac_tbl_no; + jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, + & entropy->derived_tbls[tbl]); + /* remember the single active table */ + entropy->ac_derived_tbl = entropy->derived_tbls[tbl]; + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; + + /* Initialize private state variables */ + entropy->saved.EOBRUN = 0; + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +LOCAL(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int ci; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)(entropy->bitstate.bits_left / 8); + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Re-init EOB run count, too */ + entropy->saved.EOBRUN = 0; + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Huffman MCU decoding. + * Each of these routines decodes and returns one MCU's worth of + * Huffman-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER. + * + * We return FALSE if data source requested suspension. In that case no + * changes have been made to permanent state. (Exception: some output + * coefficients may already have been assigned. This is harmless for + * spectral selection, since we'll just re-assign them on the next call. + * Successive approximation AC refinement has to be more careful, however.) + */ + +/* + * MCU decoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Al = cinfo->Al; + register int s, r; + int blkn, ci; + JBLOCKROW block; + BITREAD_STATE_VARS; + savable_state state; + d_derived_tbl * tbl; + jpeg_component_info * compptr; + boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + tbl = entropy->derived_tbls[compptr->dc_tbl_no]; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + HUFF_DECODE(s, br_state, tbl, return FALSE, label1, cornell_workaround); + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + + /* Convert DC difference to actual value, update last_dc_val */ + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */ + (*block)[0] = (JCOEF) (s << Al); + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Se = cinfo->Se; + int Al = cinfo->Al; + register int s, k, r; + unsigned int EOBRUN; + JBLOCKROW block; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state. + * We can avoid loading/saving bitread state if in an EOB run. + */ + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + + if (EOBRUN > 0) /* if it's a band of zeroes... */ + EOBRUN--; /* ...process it now (we do nothing) */ + else { + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + for (k = cinfo->Ss; k <= Se; k++) { + HUFF_DECODE(s, br_state, tbl, return FALSE, label2, cornell_workaround); + r = s >> 4; + s &= 15; + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Scale and output coefficient in natural (dezigzagged) order */ + (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al); + } else { + if (r == 15) { /* ZRL */ + k += 15; /* skip 15 zeroes in band */ + } else { /* EOBr, run length is 2^r + appended bits */ + EOBRUN = (unsigned int)(1 << r); + if (r) { /* EOBr, r > 0 */ + CHECK_BIT_BUFFER(br_state, r, return FALSE); + r = GET_BITS(r); + EOBRUN += (unsigned int)r; + } + EOBRUN--; /* this band is processed at this moment */ + break; /* force end-of-band */ + } + } + } + + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + } + + /* Completed MCU, so update state */ + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + int blkn; + JBLOCKROW block; + BITREAD_STATE_VARS; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* Not worth the cycles to check insufficient_data here, + * since we will not change the data anyway if we read zeroes. + */ + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* Encoded data is simply the next bit of the two's-complement DC value */ + CHECK_BIT_BUFFER(br_state, 1, return FALSE); + if (GET_BITS(1)) + (*block)[0] |= (JCOEF)p1; + /* Note: since we use |=, repeating the assignment later is safe */ + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Se = cinfo->Se; + int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0; + + /* Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ + int m1 = (int)((~0U) << cinfo->Al); /* -1 in the bit position being coded */ + + register int s, k, r; + unsigned int EOBRUN; + JBLOCKROW block; + JCOEFPTR thiscoef; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + int num_newnz; + int newnz_pos[DCTSIZE2]; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, don't modify the MCU. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + /* If we are forced to suspend, we must undo the assignments to any newly + * nonzero coefficients in the block, because otherwise we'd get confused + * next time about which coefficients were already nonzero. + * But we need not undo addition of bits to already-nonzero coefficients; + * instead, we can test the current bit to see if we already did it. + */ + num_newnz = 0; + + /* initialize coefficient loop counter to start of band */ + k = cinfo->Ss; + + if (EOBRUN == 0) { + for (; k <= Se; k++) { + HUFF_DECODE(s, br_state, tbl, goto undoit, label3, cornell_workaround); + r = s >> 4; + s &= 15; + if (s) { + if (s != 1) /* size of new coef should always be 1 */ + WARNMS(cinfo, JWRN_HUFF_BAD_CODE); + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) + s = p1; /* newly nonzero coef is positive */ + else + s = m1; /* newly nonzero coef is negative */ + } else { + if (r != 15) { + EOBRUN = (unsigned int)(1 << r); /* EOBr, run length is 2^r + appended bits */ + if (r) { + CHECK_BIT_BUFFER(br_state, r, goto undoit); + r = GET_BITS(r); + EOBRUN += (unsigned int)r; + } + break; /* rest of block is handled by EOB logic */ + } + /* note s = 0 for processing ZRL */ + } + /* Advance over already-nonzero coefs and r still-zero coefs, + * appending correction bits to the nonzeroes. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + do { + thiscoef = *block + jpeg_natural_order[k]; + if (*thiscoef != 0) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already set it */ + if (*thiscoef >= 0) + *thiscoef = (JCOEF)(*thiscoef + p1); + else + *thiscoef = (JCOEF)(*thiscoef + m1); + } + } + } else { + if (--r < 0) + break; /* reached target zero coefficient */ + } + k++; + } while (k <= Se); + if (s) { + int pos = jpeg_natural_order[k]; + /* Output newly nonzero coefficient */ + (*block)[pos] = (JCOEF) s; + /* Remember its position in case we have to suspend */ + newnz_pos[num_newnz++] = pos; + } + } + } + + if (EOBRUN > 0) { + /* Scan any remaining coefficient positions after the end-of-band + * (the last newly nonzero coefficient, if any). Append a correction + * bit to each already-nonzero coefficient. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + for (; k <= Se; k++) { + thiscoef = *block + jpeg_natural_order[k]; + if (*thiscoef != 0) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */ + if (*thiscoef >= 0) + *thiscoef = (JCOEF)(*thiscoef + p1); + else + *thiscoef = (JCOEF)(*thiscoef + m1); + } + } + } + } + /* Count one block completed in EOB run */ + EOBRUN--; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; + +undoit: + /* Re-zero any output coefficients that we made newly nonzero */ + while (num_newnz > 0) + (*block)[newnz_pos[--num_newnz]] = 0; + + return FALSE; +} + + +/* + * Module initialization routine for progressive Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_phuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy; + int *coef_bit_ptr; + int ci, i; + + entropy = (phuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(phuff_entropy_decoder)); + lossyd->entropy_private = (void *) entropy; + lossyd->entropy_start_pass = start_pass_phuff_decoder; + + /* Mark derived tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + } + + /* Create progression status table */ + cinfo->coef_bits = (int (*)[DCTSIZE2]) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components*DCTSIZE2*SIZEOF(int)); + coef_bit_ptr = & cinfo->coef_bits[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (i = 0; i < DCTSIZE2; i++) + *coef_bit_ptr++ = -1; +} + +#endif /* D_PROGRESSIVE_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jdpostct.c b/dcmjpeg/libijg16/jdpostct.c new file mode 100644 index 00000000..01c2b630 --- /dev/null +++ b/dcmjpeg/libijg16/jdpostct.c @@ -0,0 +1,290 @@ +/* + * jdpostct.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the decompression postprocessing controller. + * This controller manages the upsampling, color conversion, and color + * quantization/reduction steps; specifically, it controls the buffering + * between upsample/color conversion and color quantization/reduction. + * + * If no color quantization/reduction is required, then this module has no + * work to do, and it just hands off to the upsample/color conversion code. + * An integrated upsample/convert/quantize process would replace this module + * entirely. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_post_controller pub; /* public fields */ + + /* Color quantization source buffer: this holds output data from + * the upsample/color conversion step to be passed to the quantizer. + * For two-pass color quantization, we need a full-image buffer; + * for one-pass operation, a strip buffer is sufficient. + */ + jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */ + JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */ + JDIMENSION strip_height; /* buffer size in rows */ + /* for two-pass mode only: */ + JDIMENSION starting_row; /* row # of first row in current strip */ + JDIMENSION next_row; /* index of next row to fill/empty in strip */ +} my_post_controller; + +typedef my_post_controller * my_post_ptr; + + +/* Forward declarations */ +METHODDEF(void) post_process_1pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) post_process_prepass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +METHODDEF(void) post_process_2pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->quantize_colors) { + /* Single-pass processing with color quantization. */ + post->pub.post_process_data = post_process_1pass; + /* We could be doing buffered-image output before starting a 2-pass + * color quantization; in that case, jinit_d_post_controller did not + * allocate a strip buffer. Use the virtual-array buffer as workspace. + */ + if (post->buffer == NULL) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + (JDIMENSION) 0, post->strip_height, TRUE); + } + } else { + /* For single-pass processing without color quantization, + * I have no work to do; just call the upsampler directly. + */ + post->pub.post_process_data = cinfo->upsample->upsample; + } + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_SAVE_AND_PASS: + /* First pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_prepass; + break; + case JBUF_CRANK_DEST: + /* Second pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_2pass; + break; +#endif /* QUANT_2PASS_SUPPORTED */ + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } + post->starting_row = post->next_row = 0; +} + + +/* + * Process some data in the one-pass (strip buffer) case. + * This is used for color precision reduction as well as one-pass quantization. + */ + +METHODDEF(void) +post_process_1pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Fill the buffer, but not more than what we can dump out in one go. */ + /* Note we rely on the upsampler to detect bottom of image. */ + max_rows = out_rows_avail - *out_row_ctr; + if (max_rows > post->strip_height) + max_rows = post->strip_height; + num_rows = 0; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &num_rows, max_rows); + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer, output_buf + *out_row_ctr, (int) num_rows); + *out_row_ctr += num_rows; +} + + +#ifdef QUANT_2PASS_SUPPORTED + +/* + * Process some data in the first pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_prepass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION old_next_row, num_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, TRUE); + } + + /* Upsample some data (up to a strip height's worth). */ + old_next_row = post->next_row; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &post->next_row, post->strip_height); + + /* Allow quantizer to scan new data. No data is emitted, */ + /* but we advance out_row_ctr so outer loop can tell when we're done. */ + if (post->next_row > old_next_row) { + num_rows = post->next_row - old_next_row; + (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row, + (JSAMPARRAY) NULL, (int) num_rows); + *out_row_ctr += num_rows; + } + + /* Advance if we filled the strip. */ + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + + +/* + * Process some data in the second pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_2pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, FALSE); + } + + /* Determine number of rows to emit. */ + num_rows = post->strip_height - post->next_row; /* available in strip */ + max_rows = out_rows_avail - *out_row_ctr; /* available in output area */ + if (num_rows > max_rows) + num_rows = max_rows; + /* We have to check bottom of image here, can't depend on upsampler. */ + max_rows = cinfo->output_height - post->starting_row; + if (num_rows > max_rows) + num_rows = max_rows; + + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer + post->next_row, output_buf + *out_row_ctr, + (int) num_rows); + *out_row_ctr += num_rows; + + /* Advance if we filled the strip. */ + post->next_row += num_rows; + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize postprocessing controller. + */ + +GLOBAL(void) +jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_post_ptr post; + + post = (my_post_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_post_controller)); + cinfo->post = (struct jpeg_d_post_controller *) post; + post->pub.start_pass = start_pass_dpost; + post->whole_image = NULL; /* flag for no virtual arrays */ + post->buffer = NULL; /* flag for no strip buffer */ + + /* Create the quantization buffer, if needed */ + if (cinfo->quantize_colors) { + /* The buffer strip height is max_v_samp_factor, which is typically + * an efficient number of rows for upsampling to return. + * (In the presence of output rescaling, we might want to be smarter?) + */ + post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor; + if (need_full_buffer) { + /* Two-pass color quantization: need full-image storage. */ + /* We round up the number of rows to a multiple of the strip height. */ +#ifdef QUANT_2PASS_SUPPORTED + post->whole_image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + cinfo->output_width * (JDIMENSION)cinfo->out_color_components, + (JDIMENSION) jround_up((long) cinfo->output_height, + (long) post->strip_height), + post->strip_height); +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + /* One-pass color quantization: just make a strip buffer. */ + post->buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width * (JDIMENSION)cinfo->out_color_components, + post->strip_height); + } + } +} diff --git a/dcmjpeg/libijg16/jdpred.c b/dcmjpeg/libijg16/jdpred.c new file mode 100644 index 00000000..245a61e3 --- /dev/null +++ b/dcmjpeg/libijg16/jdpred.c @@ -0,0 +1,326 @@ +/* + * jdpred.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample undifferencing (reconstruction) for lossless JPEG. + * + * In order to avoid paying the performance penalty of having to check the + * predictor being used and the row being processed for each call of the + * undifferencer, and to promote optimization, we have separate undifferencing + * functions for each case. + * + * We are able to avoid duplicating source code by implementing the predictors + * and undifferencers as macros. Each of the undifferencing functions are + * simply wrappers around an UNDIFFERENCE macro with the appropriate PREDICTOR + * macro passed as an argument. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" /* Private declarations for lossless codec */ + + +#ifdef D_LOSSLESS_SUPPORTED + +/* Predictor for the first column of the first row: 2^(P-Pt-1) */ +#define INITIAL_PREDICTORx (1 << (cinfo->data_precision - cinfo->Al - 1)) + +/* Predictor for the first column of the remaining rows: Rb */ +#define INITIAL_PREDICTOR2 GETJSAMPLE(prev_row[0]) + + +/* + * 1-Dimensional undifferencer routine. + * + * This macro implements the 1-D horizontal predictor (1). INITIAL_PREDICTOR + * is used as the special case predictor for the first column, which must be + * either INITIAL_PREDICTOR2 or INITIAL_PREDICTORx. The remaining samples + * use PREDICTOR1. + * + * The reconstructed sample is supposed to be calculated modulo 2^16, so we + * logically AND the result with 0xFFFF. +*/ + +#define UNDIFFERENCE_1D(INITIAL_PREDICTOR) \ + unsigned int xindex; \ + int Ra; \ + \ + Ra = (diff_buf[0] + INITIAL_PREDICTOR) & 0xFFFF; \ + undiff_buf[0] = Ra; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Ra = (diff_buf[xindex] + PREDICTOR1) & 0xFFFF; \ + undiff_buf[xindex] = Ra; \ + } + +/* + * 2-Dimensional undifferencer routine. + * + * This macro implements the 2-D horizontal predictors (#2-7). PREDICTOR2 is + * used as the special case predictor for the first column. The remaining + * samples use PREDICTOR, which is a function of Ra, Rb, Rc. + * + * Because prev_row and output_buf may point to the same storage area (in an + * interleaved image with Vi=1, for example), we must take care to buffer Rb/Rc + * before writing the current reconstructed sample value into output_buf. + * + * The reconstructed sample is supposed to be calculated modulo 2^16, so we + * logically AND the result with 0xFFFF. + */ + +#define UNDIFFERENCE_2D(PREDICTOR) \ + unsigned int xindex; \ + int Ra, Rb, Rc; \ + \ + Rb = GETJSAMPLE(prev_row[0]); \ + Ra = (diff_buf[0] + PREDICTOR2) & 0xFFFF; \ + undiff_buf[0] = Ra; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Rc = Rb; \ + Rb = GETJSAMPLE(prev_row[xindex]); \ + Ra = (diff_buf[xindex] + PREDICTOR) & 0xFFFF; \ + undiff_buf[xindex] = Ra; \ + } + +#define JPEG_UNUSED(x) ((void)x) + +/* + * Undifferencers for the all rows but the first in a scan or restart interval. + * The first sample in the row is undifferenced using the vertical + * predictor (2). The rest of the samples are undifferenced using the + * predictor specified in the scan header. + */ + +METHODDEF(void) +jpeg_undifference1(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_1D(INITIAL_PREDICTOR2); +} + +METHODDEF(void) +jpeg_undifference2(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR2); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference3(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR3); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference4a(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR4A); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference4(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR4); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference5(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR5); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference5a(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR5A); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference6(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR6); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference6a(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR6A); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference7(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR7); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference7a(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR7A); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + + +/* + * Undifferencer for the first row in a scan or restart interval. The first + * sample in the row is undifferenced using the special predictor constant + * x=2^(P-Pt-1). The rest of the samples are undifferenced using the + * 1-D horizontal predictor (1). + */ + +METHODDEF(void) +jpeg_undifference_first_row(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + UNDIFFERENCE_1D(INITIAL_PREDICTORx); + + /* + * Now that we have undifferenced the first row, we want to use the + * undifferencer which corresponds to the predictor specified in the + * scan header. + */ + switch (cinfo->Ss) { + case 1: + losslsd->predict_undifference[comp_index] = jpeg_undifference1; + break; + case 2: + losslsd->predict_undifference[comp_index] = jpeg_undifference2; + break; + case 3: + losslsd->predict_undifference[comp_index] = jpeg_undifference3; + break; + case 4: + /* DCMTK specific code that is only needed in the 16-bit library. + * Enables workaround for faulty images with integer overflow in predictor 6. + */ + if (cinfo->workaround_options & WORKAROUND_PREDICTOR6OVERFLOW) + losslsd->predict_undifference[comp_index] = jpeg_undifference4a; + else losslsd->predict_undifference[comp_index] = jpeg_undifference4; + break; + case 5: + /* DCMTK specific code that is only needed in the 16-bit library. + * Enables workaround for faulty images with integer overflow in predictor 6. + */ + if (cinfo->workaround_options & WORKAROUND_PREDICTOR6OVERFLOW) + losslsd->predict_undifference[comp_index] = jpeg_undifference5a; + else losslsd->predict_undifference[comp_index] = jpeg_undifference5; + break; + case 6: + /* DCMTK specific code that is only needed in the 16-bit library. + * Enables workaround for faulty images with integer overflow in predictor 6. + */ + if (cinfo->workaround_options & WORKAROUND_PREDICTOR6OVERFLOW) + losslsd->predict_undifference[comp_index] = jpeg_undifference6a; + else losslsd->predict_undifference[comp_index] = jpeg_undifference6; + break; + case 7: + /* DCMTK specific code that is only needed in the 16-bit library. + * Enables workaround for faulty images with integer overflow in predictor 6. + */ + if (cinfo->workaround_options & WORKAROUND_PREDICTOR6OVERFLOW) + losslsd->predict_undifference[comp_index] = jpeg_undifference7a; + else losslsd->predict_undifference[comp_index] = jpeg_undifference7; + break; + } +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +predict_start_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + int ci; + + /* Check that the scan parameters Ss, Se, Ah, Al are OK for lossless JPEG. + * + * Ss is the predictor selection value (psv). Legal values for sequential + * lossless JPEG are: 1 <= psv <= 7. + * + * Se and Ah are not used and should be zero. + * + * Al specifies the point transform (Pt). Legal values are: 0 <= Pt <= 15. + */ + if (cinfo->Ss < 1 || cinfo->Ss > 7 || + cinfo->Se != 0 || cinfo->Ah != 0 || + cinfo->Al > 15) /* need not check for < 0 */ + ERREXIT4(cinfo, JERR_BAD_LOSSLESS, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + + /* Set undifference functions to first row function */ + for (ci = 0; ci < cinfo->num_components; ci++) + losslsd->predict_undifference[ci] = jpeg_undifference_first_row; +} + + +/* + * Module initialization routine for the undifferencer. + */ + +GLOBAL(void) +jinit_undifferencer (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + losslsd->predict_start_pass = predict_start_pass; + losslsd->predict_process_restart = predict_start_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg16/jdsample.c b/dcmjpeg/libijg16/jdsample.c new file mode 100644 index 00000000..cd3b60fa --- /dev/null +++ b/dcmjpeg/libijg16/jdsample.c @@ -0,0 +1,478 @@ +/* + * jdsample.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains upsampling routines. + * + * Upsampling input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * codec_data_unit / min_codec_data_unit) + * sample rows of each component. Upsampling will normally produce + * max_v_samp_factor pixel rows from each row group (but this could vary + * if the upsampler is applying a scale factor of its own). + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* Pointer to routine to upsample a single component */ +typedef JMETHOD(void, upsample1_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Color conversion buffer. When using separate upsampling and color + * conversion steps, this buffer holds one upsampled row group until it + * has been color converted and output. + * Note: we do not allocate any storage for component(s) which are full-size, + * ie do not need rescaling. The corresponding entry of color_buf[] is + * simply set to point to the input data array, thereby avoiding copying. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + /* Per-component upsampling method pointers */ + upsample1_ptr methods[MAX_COMPONENTS]; + + int next_row_out; /* counts rows emitted from color_buf */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ + + /* Height of an input row group for each component. */ + int rowgroup_height[MAX_COMPONENTS]; + + /* These arrays save pixel expansion factors so that int_expand need not + * recompute them each time. They are unused for other upsampling methods. + */ + UINT8 h_expand[MAX_COMPONENTS]; + UINT8 v_expand[MAX_COMPONENTS]; +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the conversion buffer empty */ + upsample->next_row_out = cinfo->max_v_samp_factor; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * In this version we upsample each component independently. + * We upsample one row group into the conversion buffer, then apply + * color conversion a row at a time. + */ + +METHODDEF(void) +sep_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int ci; + jpeg_component_info * compptr; + JDIMENSION num_rows; + + /* Fill the conversion buffer, if it's empty */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Invoke per-component upsample method. Notice we pass a POINTER + * to color_buf[ci], so that fullsize_upsample can change it. + */ + (*upsample->methods[ci]) (cinfo, compptr, + input_buf[ci] + (*in_row_group_ctr * (JDIMENSION)upsample->rowgroup_height[ci]), + upsample->color_buf + ci); + } + upsample->next_row_out = 0; + } + + /* Color-convert and emit rows */ + + /* How many we have in the buffer: */ + num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out); + /* Not more than the distance to the end of the image. Need this test + * in case the image height is not a multiple of max_v_samp_factor: + */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + + (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf, + (JDIMENSION) upsample->next_row_out, + output_buf + *out_row_ctr, + (int) num_rows); + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + upsample->next_row_out += (int)num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by sep_upsample to upsample pixel values + * of a single component. One row group is processed per call. + */ + + +/* + * For full-size components, we just make color_buf[ci] point at the + * input buffer, and thus avoid copying any data. Note that this is + * safe only because sep_upsample doesn't declare the input row group + * "consumed" until we are done color converting and emitting it. + */ + +METHODDEF(void) +fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = input_data; +} + + +/* + * This is a no-op version used for "uninteresting" components. + * These components will not be referenced by color conversion. + */ + +METHODDEF(void) +noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = NULL; /* safety check */ +} + + +/* + * This version handles any integral sampling ratios. + * This is not used for typical JPEG files, so it need not be fast. + * Nor, for that matter, is it particularly accurate: the algorithm is + * simple replication of the input pixel onto the corresponding output + * pixels. The hi-falutin sampling literature refers to this as a + * "box filter". A box filter tends to introduce visible artifacts, + * so if you are actually going to use 3:1 or 4:1 sampling ratios + * you would be well advised to improve this code. + */ + +METHODDEF(void) +int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + register int h; + JSAMPROW outend; + int h_expand, v_expand; + int inrow, outrow; + + h_expand = upsample->h_expand[compptr->component_index]; + v_expand = upsample->v_expand[compptr->component_index]; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + /* Generate one output row with proper horizontal expansion */ + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + for (h = h_expand; h > 0; h--) { + *outptr++ = invalue; + } + } + /* Generate any additional output rows by duplicating the first one */ + if (v_expand > 1) { + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + v_expand-1, cinfo->output_width); + } + inrow++; + outrow += v_expand; + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 1:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int inrow; + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 2:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int inrow, outrow; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + 1, cinfo->output_width); + inrow++; + outrow += 2; + } +} + + +/* + * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical. + * + * The upsampling algorithm is linear interpolation between pixel centers, + * also known as a "triangle filter". This is a good compromise between + * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 + * of the way between input pixel centers. + * + * A note about the "bias" calculations: when rounding fractional values to + * integer, we do not want to always round 0.5 up to the next integer. + * If we did that, we'd introduce a noticeable bias towards larger values. + * Instead, this code is arranged so that 0.5 will be rounded up or down at + * alternate pixel locations (a simple ordered dither pattern). + */ + +METHODDEF(void) +h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register int invalue; + register JDIMENSION colctr; + int inrow; + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + /* Special case for first column */ + invalue = GETJSAMPLE(*inptr++); + *outptr++ = (JSAMPLE) invalue; + *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2); + + for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { + /* General case: 3/4 * nearer pixel + 1/4 * further pixel */ + invalue = GETJSAMPLE(*inptr++) * 3; + *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2); + *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2); + } + + /* Special case for last column */ + invalue = GETJSAMPLE(*inptr); + *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2); + *outptr++ = (JSAMPLE) invalue; + } +} + + +/* + * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical. + * Again a triangle filter; see comments for h2v1 case, above. + * + * It is OK for us to reference the adjacent input rows because we demanded + * context from the main buffer controller (see initialization code). + */ + +METHODDEF(void) +h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr0, inptr1, outptr; +#if BITS_IN_JSAMPLE == 8 + register int thiscolsum, lastcolsum, nextcolsum; +#else + register IJG_INT32 thiscolsum, lastcolsum, nextcolsum; +#endif + register JDIMENSION colctr; + int inrow, outrow, v; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + for (v = 0; v < 2; v++) { + /* inptr0 points to nearest input row, inptr1 points to next nearest */ + inptr0 = input_data[inrow]; + if (v == 0) /* next nearest is row above */ + inptr1 = input_data[inrow-1]; + else /* next nearest is row below */ + inptr1 = input_data[inrow+1]; + outptr = output_data[outrow++]; + + /* Special case for first column */ + thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); + lastcolsum = thiscolsum; thiscolsum = nextcolsum; + + for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { + /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */ + /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */ + nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); + lastcolsum = thiscolsum; thiscolsum = nextcolsum; + } + + /* Special case for last column */ + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4); + } + inrow++; + } +} + + +/* + * Module initialization routine for upsampling. + */ + +GLOBAL(void) +jinit_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + int ci; + jpeg_component_info * compptr; + boolean need_buffer, do_fancy; + int h_in_group, v_in_group, h_out_group, v_out_group; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_upsample; + upsample->pub.upsample = sep_upsample; + upsample->pub.need_context_rows = FALSE; /* until we find out differently */ + + if (cinfo->CCIR601_sampling) /* this isn't supported */ + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* jdmainct.c doesn't support context rows when min_codec_data_unit = 1, + * so don't ask for it. + */ + do_fancy = cinfo->do_fancy_upsampling && cinfo->min_codec_data_unit > 1; + + /* Verify we can handle the sampling factors, select per-component methods, + * and create storage as needed. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Compute size of an "input group" after IDCT scaling. This many samples + * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. + */ + h_in_group = (compptr->h_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; + v_in_group = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; + h_out_group = cinfo->max_h_samp_factor; + v_out_group = cinfo->max_v_samp_factor; + upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ + need_buffer = TRUE; + if (! compptr->component_needed) { + /* Don't bother to upsample an uninteresting component. */ + upsample->methods[ci] = noop_upsample; + need_buffer = FALSE; + } else if (h_in_group == h_out_group && v_in_group == v_out_group) { + /* Fullsize components can be processed without any work. */ + upsample->methods[ci] = fullsize_upsample; + need_buffer = FALSE; + } else if (h_in_group * 2 == h_out_group && + v_in_group == v_out_group) { + /* Special cases for 2h1v upsampling */ + if (do_fancy && compptr->downsampled_width > 2) + upsample->methods[ci] = h2v1_fancy_upsample; + else + upsample->methods[ci] = h2v1_upsample; + } else if (h_in_group * 2 == h_out_group && + v_in_group * 2 == v_out_group) { + /* Special cases for 2h2v upsampling */ + if (do_fancy && compptr->downsampled_width > 2) { + upsample->methods[ci] = h2v2_fancy_upsample; + upsample->pub.need_context_rows = TRUE; + } else + upsample->methods[ci] = h2v2_upsample; + } else if ((h_out_group % h_in_group) == 0 && + (v_out_group % v_in_group) == 0) { + /* Generic integral-factors upsampling method */ + upsample->methods[ci] = int_upsample; + upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); + upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + if (need_buffer) { + upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) cinfo->output_width, + (long) cinfo->max_h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/dcmjpeg/libijg16/jdscale.c b/dcmjpeg/libijg16/jdscale.c new file mode 100644 index 00000000..306c4092 --- /dev/null +++ b/dcmjpeg/libijg16/jdscale.c @@ -0,0 +1,119 @@ +/* + * jdscale.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample scaling for lossless JPEG. This is a + * combination of upscaling the undifferenced sample by 2^Pt and downscaling + * the sample to fit into JSAMPLE. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossls16.h" /* Private declarations for lossless codec */ + + +#ifdef D_LOSSLESS_SUPPORTED + +/* + * Private scaler object for lossless decoding. + */ + +typedef struct { + int scale_factor; +} scaler; + +typedef scaler * scaler_ptr; + + +/* + * Scalers for packing sample differences into JSAMPLEs. + */ + +METHODDEF(void) +simple_upscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int scale_factor = scale->scale_factor; + unsigned int xindex; + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) (diff_buf[xindex] << scale_factor); +} + +METHODDEF(void) +simple_downscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int scale_factor = scale->scale_factor; + unsigned int xindex; + SHIFT_TEMPS + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) RIGHT_SHIFT(diff_buf[xindex], scale_factor); +} + +METHODDEF(void) +noscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + unsigned int xindex; + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) diff_buf[xindex]; +} + + +METHODDEF(void) +scaler_start_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int downscale; + + /* + * Downscale by the difference in the input vs. output precision. If the + * output precision >= input precision, then do not downscale. + */ + downscale = BITS_IN_JSAMPLE < cinfo->data_precision ? + cinfo->data_precision - BITS_IN_JSAMPLE : 0; + + scale->scale_factor = cinfo->Al - downscale; + + /* Set scaler functions based on scale_factor (positive = left shift) */ + if (scale->scale_factor > 0) + losslsd->scaler_scale = simple_upscale; + else if (scale->scale_factor < 0) { + scale->scale_factor = -scale->scale_factor; + losslsd->scaler_scale = simple_downscale; + } + else + losslsd->scaler_scale = noscale; +} + + +GLOBAL(void) +jinit_d_scaler (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale; + + scale = (scaler_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(scaler)); + losslsd->scaler_private = (void *) scale; + losslsd->scaler_start_pass = scaler_start_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg16/jdshuff.c b/dcmjpeg/libijg16/jdshuff.c new file mode 100644 index 00000000..1e029594 --- /dev/null +++ b/dcmjpeg/libijg16/jdshuff.c @@ -0,0 +1,366 @@ +/* + * jdshuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for sequential JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" /* Private declarations for lossy codec */ +#include "jdhuff16.h" /* Declarations shared with jd*huff.c */ + + +/* + * Private entropy decoder object for Huffman decoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* These fields are loaded into local variables at start of each MCU. + * In case of suspension, we exit WITHOUT updating them. + */ + savable_state saved; /* Other state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + + /* Precalculated info set up by start_pass for use in decode_mcu: */ + + /* Pointers to derived tables to be used for each block within an MCU */ + d_derived_tbl * dc_cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + d_derived_tbl * ac_cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + /* Whether we care about the DC and AC coefficient values for each block */ + boolean dc_needed[D_MAX_DATA_UNITS_IN_MCU]; + boolean ac_needed[D_MAX_DATA_UNITS_IN_MCU]; +} shuff_entropy_decoder; + +typedef shuff_entropy_decoder * shuff_entropy_ptr; + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_huff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int ci, blkn, dctbl, actbl; + jpeg_component_info * compptr; + + /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. + * This ought to be an error condition, but we make it a warning because + * there are some baseline files out there with all zeroes in these bytes. + */ + if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 || + cinfo->Ah != 0 || cinfo->Al != 0) + WARNMS(cinfo, JWRN_NOT_SEQUENTIAL); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, + & entropy->dc_derived_tbls[dctbl]); + jpeg_make_d_derived_tbl(cinfo, FALSE, actbl, + & entropy->ac_derived_tbls[actbl]); + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Precalculate decoding info for each block in an MCU of this scan */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + /* Precalculate which table to use for each block */ + entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no]; + entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no]; + /* Decide whether we really care about the coefficient values */ + if (compptr->component_needed) { + entropy->dc_needed[blkn] = TRUE; + /* we don't need the ACs if producing a 1/8th-size image */ + entropy->ac_needed[blkn] = (compptr->codec_data_unit > 1); + } else { + entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE; + } + } + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +LOCAL(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int ci; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)(entropy->bitstate.bits_left / 8); + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Decode and return one MCU's worth of Huffman-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER. + * (Wholesale zeroing is usually a little faster than retail...) + * + * Returns FALSE if data source requested suspension. In that case no + * changes have been made to permanent state. (Exception: some output + * coefficients may already have been assigned. This is harmless for + * this module, since we'll just re-assign them on the next call.) + */ + +METHODDEF(boolean) +decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int blkn; + BITREAD_STATE_VARS; + savable_state state; + boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + JBLOCKROW block = MCU_data[blkn]; + d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; + d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; + register int s, k, r; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + HUFF_DECODE(s, br_state, dctbl, return FALSE, label1, cornell_workaround); + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + + if (entropy->dc_needed[blkn]) { + /* Convert DC difference to actual value, update last_dc_val */ + int ci = cinfo->MCU_membership[blkn]; + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */ + (*block)[0] = (JCOEF) s; + } + + if (entropy->ac_needed[blkn]) { + + /* Section F.2.2.2: decode the AC coefficients */ + /* Since zeroes are skipped, output area must be cleared beforehand */ + for (k = 1; k < DCTSIZE2; k++) { + HUFF_DECODE(s, br_state, actbl, return FALSE, label2, cornell_workaround); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Output coefficient in natural (dezigzagged) order. + * Note: the extra entries in jpeg_natural_order[] will save us + * if k >= DCTSIZE2, which could happen if the data is corrupted. + */ + (*block)[jpeg_natural_order[k]] = (JCOEF) s; + } else { + if (r != 15) + break; + k += 15; + } + } + + } else { + + /* Section F.2.2.2: decode the AC coefficients */ + /* In this path we just discard the values */ + for (k = 1; k < DCTSIZE2; k++) { + HUFF_DECODE(s, br_state, actbl, return FALSE, label3, cornell_workaround); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + DROP_BITS(s); + } else { + if (r != 15) + break; + k += 15; + } + } + + } + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_shuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy; + int i; + + entropy = (shuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(shuff_entropy_decoder)); + lossyd->entropy_private = (void *) entropy; + lossyd->entropy_start_pass = start_pass_huff_decoder; + lossyd->entropy_decode_mcu = decode_mcu; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; + } +} diff --git a/dcmjpeg/libijg16/jdtrans.c b/dcmjpeg/libijg16/jdtrans.c new file mode 100644 index 00000000..b4527f1f --- /dev/null +++ b/dcmjpeg/libijg16/jdtrans.c @@ -0,0 +1,138 @@ +/* + * jdtrans.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding decompression, + * that is, reading raw DCT coefficient arrays from an input JPEG file. + * The routines in jdapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jlossy16.h" + + +/* Forward declarations */ +LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo)); + + +/* + * Read the coefficient arrays from a JPEG file. + * jpeg_read_header must be completed before calling this. + * + * The entire image is read into a set of virtual coefficient-block arrays, + * one per component. The return value is a pointer to the array of + * virtual-array descriptors. These can be manipulated directly via the + * JPEG memory manager, or handed off to jpeg_write_coefficients(). + * To release the memory occupied by the virtual arrays, call + * jpeg_finish_decompress() when done with the data. + * + * An alternative usage is to simply obtain access to the coefficient arrays + * during a buffered-image-mode decompression operation. This is allowed + * after any jpeg_finish_output() call. The arrays can be accessed until + * jpeg_finish_decompress() is called. (Note that any call to the library + * may reposition the arrays, so don't rely on access_virt_barray() results + * to stay valid across library calls.) + * + * Returns NULL if suspended. This case need be checked only if + * a suspending data source is used. + */ + +GLOBAL(jvirt_barray_ptr *) +jpeg_read_coefficients (j_decompress_ptr cinfo) +{ + /* j_lossy_d_ptr decomp; */ + + /* Can't read coefficients from lossless streams */ + if (cinfo->process == JPROC_LOSSLESS) { + ERREXIT(cinfo, JERR_CANT_TRANSCODE); + return NULL; + } + + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize active modules */ + transdecode_master_selection(cinfo); + cinfo->global_state = DSTATE_RDCOEFS; + } + if (cinfo->global_state == DSTATE_RDCOEFS) { + /* Absorb whole file into the coef buffer */ + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return NULL; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* startup underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } + /* Set state so that jpeg_finish_decompress does the right thing */ + cinfo->global_state = DSTATE_STOPPING; + } + /* At this point we should be in state DSTATE_STOPPING if being used + * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access + * to the coefficients during a full buffered-image-mode decompression. + */ + if ((cinfo->global_state == DSTATE_STOPPING || + cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) { + return ((j_lossy_d_ptr) cinfo->codec)->coef_arrays; + } + /* Oops, improper usage */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return NULL; /* keep compiler happy */ +} + + +/* + * Master selection of decompression modules for transcoding. + * This substitutes for jdmaster.c's initialization of the full decompressor. + */ + +LOCAL(void) +transdecode_master_selection (j_decompress_ptr cinfo) +{ + /* This is effectively a buffered-image operation. */ + cinfo->buffered_image = TRUE; + + /* Initialize decompression codec */ + jinit_d_codec(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + + /* Initialize progress monitoring. */ + if (cinfo->progress != NULL) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else if (cinfo->inputctl->has_multiple_scans) { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } else { + nscans = 1; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = 1; + } +} diff --git a/dcmjpeg/libijg16/jerror.c b/dcmjpeg/libijg16/jerror.c new file mode 100644 index 00000000..6b2f29df --- /dev/null +++ b/dcmjpeg/libijg16/jerror.c @@ -0,0 +1,253 @@ +/* + * jerror.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains simple error-reporting and trace-message routines. + * These are suitable for Unix-like systems and others where writing to + * stderr is the right thing to do. Many applications will want to replace + * some or all of these routines. + * + * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile, + * you get a Windows-specific hack to display error messages in a dialog box. + * It ain't much, but it beats dropping error messages into the bit bucket, + * which is what happens to output to stderr under most Windows C compilers. + * + * These routines are used by both the compression and decompression code. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jversion16.h" +#include "jerror16.h" + +#ifdef USE_WINDOWS_MESSAGEBOX +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#ifndef EXIT_FAILURE /* define exit() codes if not provided */ +#define EXIT_FAILURE 1 +#endif + + +/* + * Create the message string table. + * We do this from the master message list in jerror.h by re-reading + * jerror.h with a suitable definition for macro JMESSAGE. + * The message table is made an external symbol just in case any applications + * want to refer to it directly. + */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_std_message_table jpeg16_std_message_table +#endif + +#define JMESSAGE(code,string) string , + +const char * const jpeg_std_message_table[] = { +#include "jerror16.h" + NULL +}; + + +/* + * Error exit handler: must not return to caller. + * + * Applications may override this if they want to get control back after + * an error. Typically one would longjmp somewhere instead of exiting. + * The setjmp buffer can be made a private field within an expanded error + * handler object. Note that the info needed to generate an error message + * is stored in the error object, so you can generate the message now or + * later, at your convenience. + * You should make sure that the JPEG object is cleaned up (with jpeg_abort + * or jpeg_destroy) at some point. + */ + +METHODDEF(void) +error_exit (j_common_ptr cinfo) +{ + /* Always display the message */ + (*cinfo->err->output_message) (cinfo); + + /* Let the memory manager delete any temp files before we die */ + jpeg_destroy(cinfo); + + exit(EXIT_FAILURE); +} + + +/* + * Actual output of an error or trace message. + * Applications may override this method to send JPEG messages somewhere + * other than stderr. + * + * On Windows, printing to stderr is generally completely useless, + * so we provide optional code to produce an error-dialog popup. + * Most Windows applications will still prefer to override this routine, + * but if they don't, it'll do something at least marginally useful. + * + * NOTE: to use the library in an environment that doesn't support the + * C stdio library, you may have to delete the call to fprintf() entirely, + * not just not use this routine. + */ + +METHODDEF(void) +output_message (j_common_ptr cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + + /* Create the message */ + (*cinfo->err->format_message) (cinfo, buffer); + +#ifdef USE_WINDOWS_MESSAGEBOX + /* Display it in a message dialog box */ + MessageBox(GetActiveWindow(), buffer, "JPEG Library Error", + MB_OK | MB_ICONERROR); +#else + /* Send it to stderr, adding a newline */ + fprintf(stderr, "%s\n", buffer); +#endif +} + + +/* + * Decide whether to emit a trace or warning message. + * msg_level is one of: + * -1: recoverable corrupt-data warning, may want to abort. + * 0: important advisory messages (always display to user). + * 1: first level of tracing detail. + * 2,3,...: successively more detailed tracing messages. + * An application might override this method if it wanted to abort on warnings + * or change the policy about which messages to display. + */ + +METHODDEF(void) +emit_message (j_common_ptr cinfo, int msg_level) +{ + struct jpeg_error_mgr * err = cinfo->err; + + if (msg_level < 0) { + /* It's a warning message. Since corrupt files may generate many warnings, + * the policy implemented here is to show only the first warning, + * unless trace_level >= 3. + */ + if (err->num_warnings == 0 || err->trace_level >= 3) + (*err->output_message) (cinfo); + /* Always count warnings in num_warnings. */ + err->num_warnings++; + } else { + /* It's a trace message. Show it if trace_level >= msg_level. */ + if (err->trace_level >= msg_level) + (*err->output_message) (cinfo); + } +} + + +/* + * Format a message string for the most recent JPEG error or message. + * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX + * characters. Note that no '\n' character is added to the string. + * Few applications should need to override this method. + */ + +METHODDEF(void) +format_message (j_common_ptr cinfo, char * buffer) +{ + struct jpeg_error_mgr * err = cinfo->err; + int msg_code = err->msg_code; + const char * msgtext = NULL; + const char * msgptr; + char ch; + boolean isstring; + + /* Look up message string in proper table */ + if (msg_code > 0 && msg_code <= err->last_jpeg_message) { + msgtext = err->jpeg_message_table[msg_code]; + } else if (err->addon_message_table != NULL && + msg_code >= err->first_addon_message && + msg_code <= err->last_addon_message) { + msgtext = err->addon_message_table[msg_code - err->first_addon_message]; + } + + /* Defend against bogus message number */ + if (msgtext == NULL) { + err->msg_parm.i[0] = msg_code; + msgtext = err->jpeg_message_table[0]; + } + + /* Check for string parameter, as indicated by %s in the message text */ + isstring = FALSE; + msgptr = msgtext; + while ((ch = *msgptr++) != '\0') { + if (ch == '%') { + if (*msgptr == 's') isstring = TRUE; + break; + } + } + + /* Format the message into the passed buffer */ + if (isstring) + sprintf(buffer, msgtext, err->msg_parm.s); + else + sprintf(buffer, msgtext, + err->msg_parm.i[0], err->msg_parm.i[1], + err->msg_parm.i[2], err->msg_parm.i[3], + err->msg_parm.i[4], err->msg_parm.i[5], + err->msg_parm.i[6], err->msg_parm.i[7]); +} + + +/* + * Reset error state variables at start of a new image. + * This is called during compression startup to reset trace/error + * processing to default state, without losing any application-specific + * method pointers. An application might possibly want to override + * this method if it has additional error processing state. + */ + +METHODDEF(void) +reset_error_mgr (j_common_ptr cinfo) +{ + cinfo->err->num_warnings = 0; + /* trace_level is not reset since it is an application-supplied parameter */ + cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */ +} + + +/* + * Fill in the standard error-handling methods in a jpeg_error_mgr object. + * Typical call is: + * struct jpeg_compress_struct cinfo; + * struct jpeg_error_mgr err; + * + * cinfo.err = jpeg_std_error(&err); + * after which the application may override some of the methods. + */ + +GLOBAL(struct jpeg_error_mgr *) +jpeg_std_error (struct jpeg_error_mgr * err) +{ + err->error_exit = error_exit; + err->emit_message = emit_message; + err->output_message = output_message; + err->format_message = format_message; + err->reset_error_mgr = reset_error_mgr; + + err->trace_level = 0; /* default = no tracing */ + err->num_warnings = 0; /* no warnings emitted yet */ + err->msg_code = 0; /* may be useful as a flag for "no error" */ + + /* Initialize message table pointers */ + err->jpeg_message_table = jpeg_std_message_table; + err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; + + err->addon_message_table = NULL; + err->first_addon_message = 0; /* for safety */ + err->last_addon_message = 0; + + return err; +} diff --git a/dcmjpeg/libijg16/jerror16.h b/dcmjpeg/libijg16/jerror16.h new file mode 100644 index 00000000..d90bd1c1 --- /dev/null +++ b/dcmjpeg/libijg16/jerror16.h @@ -0,0 +1,310 @@ +/* + * jerror.h + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the error and message codes for the JPEG library. + * Edit this file to add new codes, or to translate the message strings to + * some other language. + * A set of error-reporting macros are defined too. Some applications using + * the JPEG library may wish to include this file to get the error codes + * and/or the macros. + */ + +/* + * To define the enum list of message codes, include this file without + * defining macro JMESSAGE. To create a message string table, include it + * again with a suitable JMESSAGE definition (see jerror.c for an example). + */ +#ifndef JMESSAGE +#ifndef JERROR_H +/* First time through, define the enum list */ +#define JMAKE_ENUM_LIST +#else +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ +#define JMESSAGE(code,string) +#endif /* JERROR_H */ +#endif /* JMESSAGE */ + +#ifdef JMAKE_ENUM_LIST + +typedef enum { + +#define JMESSAGE(code,string) code , + +#endif /* JMAKE_ENUM_LIST */ + +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ + +/* For maintenance convenience, list is alphabetical by message code name */ +JMESSAGE(JERR_ARITH_NOTIMPL, + "Sorry, there are legal restrictions on arithmetic coding") +JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") +JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") +JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") +JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") +JMESSAGE(JERR_BAD_DIFF, "spatial difference out of range") +JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") +JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") +JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") +JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") +JMESSAGE(JERR_BAD_LIB_VERSION, + "Wrong JPEG library version: library is %d, caller expects %d") +JMESSAGE(JERR_BAD_LOSSLESS, + "Invalid lossless parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_LOSSLESS_SCRIPT, + "Invalid lossless parameters at scan script entry %d") +JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") +JMESSAGE(JERR_BAD_PROGRESSION, + "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_PROG_SCRIPT, + "Invalid progressive parameters at scan script entry %d") +JMESSAGE(JERR_BAD_RESTART, "Invalid restart interval: %d, must be an integer multiple of the number of MCUs in an MCU_row (%d)") +JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") +JMESSAGE(JERR_BAD_STRUCT_SIZE, + "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") +JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") +JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") +JMESSAGE(JERR_CANT_TRANSCODE, + "Cannot transcode to/from lossless JPEG datastreams") +JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") +JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") +JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") +JMESSAGE(JERR_EMS_READ, "Read from EMS failed") +JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") +JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") +JMESSAGE(JERR_FILE_READ, "Input file read error") +JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") +JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") +JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") +JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, + "Cannot transcode due to multiple use of quantization table %d") +JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") +JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") +JMESSAGE(JERR_NOTIMPL, "Not implemented yet") +JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") +#ifdef WITH_ARITHMETIC_PATCH +JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") +#endif +JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") +JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") +JMESSAGE(JERR_NO_LOSSLESS_SCRIPT, "Lossless encoding was requested but no scan script was supplied") +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") +JMESSAGE(JERR_QUANT_COMPONENTS, + "Cannot quantize more than %d color components") +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") +JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") +JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") +JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") +JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") +JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") +JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") +JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") +JMESSAGE(JERR_TFILE_WRITE, + "Write failed on temporary file --- out of disk space?") +JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") +JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") +JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") +JMESSAGE(JERR_XMS_READ, "Read from XMS failed") +JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") +JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) +JMESSAGE(JMSG_VERSION, JVERSION) +JMESSAGE(JTRC_16BIT_TABLES, + "Caution: quantization tables are too coarse for baseline JPEG") +JMESSAGE(JTRC_ADOBE, + "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") +JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") +JMESSAGE(JTRC_DRI, "Define Restart Interval %u") +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") +JMESSAGE(JTRC_EOI, "End Of Image") +JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, + "Warning: thumbnail image size does not match data length %u") +JMESSAGE(JTRC_JFIF_EXTENSION, + "JFIF extension marker: type 0x%02x, length %u") +JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") +JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") +JMESSAGE(JTRC_RST, "RST%d") +JMESSAGE(JTRC_SMOOTH_NOTIMPL, + "Smoothing not supported with nonstandard sampling ratios") +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") +JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") +JMESSAGE(JTRC_SOI, "Start of Image") +JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") +JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") +JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") +JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") +JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") +JMESSAGE(JTRC_THUMB_JPEG, + "JFIF extension marker: JPEG-compressed thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_PALETTE, + "JFIF extension marker: palette thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_RGB, + "JFIF extension marker: RGB thumbnail image, length %u") +JMESSAGE(JTRC_UNKNOWN_LOSSLESS_IDS, + "Unrecognized component IDs %d %d %d, assuming RGB") +JMESSAGE(JTRC_UNKNOWN_LOSSY_IDS, + "Unrecognized component IDs %d %d %d, assuming YCbCr") +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") +#ifdef WITH_ARITHMETIC_PATCH +JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") +#endif +JMESSAGE(JWRN_BOGUS_PROGRESSION, + "Inconsistent progression sequence for component %d coefficient %d") +JMESSAGE(JWRN_EXTRANEOUS_DATA, + "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") +JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") +JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") +JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") +JMESSAGE(JWRN_MUST_DOWNSCALE, + "Must downscale data from %d bits to %d") +JMESSAGE(JWRN_MUST_RESYNC, + "Corrupt JPEG data: found marker 0x%02x instead of RST%d") +JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") +JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") + +#ifdef JMAKE_ENUM_LIST + + JMSG_LASTMSGCODE +} J_MESSAGE_CODE; + +#undef JMAKE_ENUM_LIST +#endif /* JMAKE_ENUM_LIST */ + +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ +#undef JMESSAGE + + +#ifndef JERROR_H +#define JERROR_H + +/* Macros to simplify using the error and trace message stuff */ +/* The first parameter is either type of cinfo pointer */ + +/* Fatal errors (print message and exit) */ +#define ERREXIT(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT3(cinfo,code,p1,p2,p3) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXITS(cinfo,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) + +#define MAKESTMT(stuff) do { stuff } while (0) + +/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ +#define WARNMS(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) + +/* Informational/debugging messages */ +#define TRACEMS(cinfo,lvl,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS1(cinfo,lvl,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS2(cinfo,lvl,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMSS(cinfo,lvl,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) + +#endif /* JERROR_H */ diff --git a/dcmjpeg/libijg16/jfdctflt.c b/dcmjpeg/libijg16/jfdctflt.c new file mode 100644 index 00000000..113ed25e --- /dev/null +++ b/dcmjpeg/libijg16/jfdctflt.c @@ -0,0 +1,168 @@ +/* + * jfdctflt.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * forward DCT (Discrete Cosine Transform). + * + * This implementation should be more accurate than either of the integer + * DCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jdct16.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_float (FAST_FLOAT * data) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z1, z2, z3, z4, z5, z11, z13; + FAST_FLOAT *dataptr; + int ctr; + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = tmp10 + tmp11; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jfdctfst.c b/dcmjpeg/libijg16/jfdctfst.c new file mode 100644 index 00000000..88a12d5a --- /dev/null +++ b/dcmjpeg/libijg16/jfdctfst.c @@ -0,0 +1,224 @@ +/* + * jfdctfst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jdct16.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jfdctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * Again to save a few shifts, the intermediate results between pass 1 and + * pass 2 are not upscaled, but are represented only to integral precision. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#define CONST_BITS 8 + + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_0_382683433 ((IJG_INT32) 98) /* FIX(0.382683433) */ +#define FIX_0_541196100 ((IJG_INT32) 139) /* FIX(0.541196100) */ +#define FIX_0_707106781 ((IJG_INT32) 181) /* FIX(0.707106781) */ +#define FIX_1_306562965 ((IJG_INT32) 334) /* FIX(1.306562965) */ +#else +#define FIX_0_382683433 FIX(0.382683433) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_707106781 FIX(0.707106781) +#define FIX_1_306562965 FIX(1.306562965) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an IJG_INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_ifast (DCTELEM * data) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z1, z2, z3, z4, z5, z11, z13; + DCTELEM *dataptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = tmp10 + tmp11; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jfdctint.c b/dcmjpeg/libijg16/jfdctint.c new file mode 100644 index 00000000..12d9ab25 --- /dev/null +++ b/dcmjpeg/libijg16/jfdctint.c @@ -0,0 +1,283 @@ +/* + * jfdctint.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jdct16.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D DCT step produces outputs which are a factor of sqrt(N) + * larger than the true DCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D DCT, + * because the y0 and y4 outputs need not be divided by sqrt(N). + * In the IJG code, this factor of 8 is removed by the quantization step + * (in jcdctmgr.c), NOT in this module. + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (For 12-bit sample data, the intermediate + * array is IJG_INT32 anyway.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((IJG_INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((IJG_INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((IJG_INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((IJG_INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((IJG_INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((IJG_INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((IJG_INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((IJG_INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_islow (DCTELEM * data) +{ + IJG_INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + IJG_INT32 tmp10, tmp11, tmp12, tmp13; + IJG_INT32 z1, z2, z3, z4, z5; + DCTELEM *dataptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), + CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), + CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jidctflt.c b/dcmjpeg/libijg16/jidctflt.c new file mode 100644 index 00000000..64326cf4 --- /dev/null +++ b/dcmjpeg/libijg16/jidctflt.c @@ -0,0 +1,242 @@ +/* + * jidctflt.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * This implementation should be more accurate than either of the integer + * IDCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jdct16.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a float result. + */ + +#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z5, z10, z11, z12, z13; + JCOEFPTR inptr; + FLOAT_MULT_TYPE * quantptr; + FAST_FLOAT * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ + tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + wsptr[DCTSIZE*0] = tmp0 + tmp7; + wsptr[DCTSIZE*7] = tmp0 - tmp7; + wsptr[DCTSIZE*1] = tmp1 + tmp6; + wsptr[DCTSIZE*6] = tmp1 - tmp6; + wsptr[DCTSIZE*2] = tmp2 + tmp5; + wsptr[DCTSIZE*5] = tmp2 - tmp5; + wsptr[DCTSIZE*4] = tmp3 + tmp4; + wsptr[DCTSIZE*3] = tmp3 - tmp4; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * And testing floats for zero is relatively expensive, so we don't bother. + */ + + /* Even part */ + + tmp10 = wsptr[0] + wsptr[4]; + tmp11 = wsptr[0] - wsptr[4]; + + tmp13 = wsptr[2] + wsptr[6]; + tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = wsptr[5] + wsptr[3]; + z10 = wsptr[5] - wsptr[3]; + z11 = wsptr[1] + wsptr[7]; + z12 = wsptr[1] - wsptr[7]; + + tmp7 = z11 + z13; + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ + tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + /* Final output stage: scale down by a factor of 8 and range-limit */ + + outptr[0] = range_limit[(int) DESCALE((IJG_INT32) (tmp0 + tmp7), 3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) DESCALE((IJG_INT32) (tmp0 - tmp7), 3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE((IJG_INT32) (tmp1 + tmp6), 3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) DESCALE((IJG_INT32) (tmp1 - tmp6), 3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE((IJG_INT32) (tmp2 + tmp5), 3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) DESCALE((IJG_INT32) (tmp2 - tmp5), 3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) DESCALE((IJG_INT32) (tmp3 + tmp4), 3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE((IJG_INT32) (tmp3 - tmp4), 3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jidctfst.c b/dcmjpeg/libijg16/jidctfst.c new file mode 100644 index 00000000..239d3b05 --- /dev/null +++ b/dcmjpeg/libijg16/jidctfst.c @@ -0,0 +1,368 @@ +/* + * jidctfst.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jdct16.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jidctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * The dequantized coefficients are not integers because the AA&N scaling + * factors have been incorporated. We represent them scaled up by PASS1_BITS, + * so that the first and second IDCT rounds have the same input scaling. + * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to + * avoid a descaling shift; this compromises accuracy rather drastically + * for small quantization table entries, but it saves a lot of shifts. + * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway, + * so we use a much larger scaling factor to preserve accuracy. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 8 +#define PASS1_BITS 2 +#else +#define CONST_BITS 8 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_1_082392200 ((IJG_INT32) 277) /* FIX(1.082392200) */ +#define FIX_1_414213562 ((IJG_INT32) 362) /* FIX(1.414213562) */ +#define FIX_1_847759065 ((IJG_INT32) 473) /* FIX(1.847759065) */ +#define FIX_2_613125930 ((IJG_INT32) 669) /* FIX(2.613125930) */ +#else +#define FIX_1_082392200 FIX(1.082392200) +#define FIX_1_414213562 FIX(1.414213562) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_2_613125930 FIX(2.613125930) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an IJG_INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a DCTELEM result. For 8-bit data a 16x16->16 + * multiplication will do. For 12-bit data, the multiplier table is + * declared IJG_INT32, so a 32-bit multiply will be used. + */ + +#if BITS_IN_JSAMPLE == 8 +#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval)) +#else +#define DEQUANTIZE(coef,quantval) \ + DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS) +#endif + + +/* Like DESCALE, but applies to a DCTELEM and produces an int. + * We assume that int right shift is unsigned if IJG_INT32 right shift is. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS DCTELEM ishift_temp; +#if BITS_IN_JSAMPLE == 8 +#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */ +#else +#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */ +#endif +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +#ifdef USE_ACCURATE_ROUNDING +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n)) +#else +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n)) +#endif + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z5, z10, z11, z12, z13; + JCOEFPTR inptr; + IFAST_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS /* for DESCALE */ + ISHIFT_TEMPS /* for IDESCALE */ + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (IFAST_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); + wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); + wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); + wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); + wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5); + wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); + wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); + wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); + tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); + + tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); + tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562) + - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; + z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; + z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; + z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + /* Final output stage: scale down by a factor of 8 and range-limit */ + + outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jidctint.c b/dcmjpeg/libijg16/jidctint.c new file mode 100644 index 00000000..25785d8d --- /dev/null +++ b/dcmjpeg/libijg16/jidctint.c @@ -0,0 +1,389 @@ +/* + * jidctint.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jdct16.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D IDCT step produces outputs which are a factor of sqrt(N) + * larger than the true IDCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D IDCT, + * because the y0 and y4 inputs need not be divided by sqrt(N). + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (To scale up 12-bit sample data further, an + * intermediate IJG_INT32 array would be needed.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((IJG_INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((IJG_INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((IJG_INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((IJG_INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((IJG_INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((IJG_INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((IJG_INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((IJG_INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce an int result. In this module, both inputs and result + * are 16 bits or less, so either int or short multiply will work. + */ + +#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp1, tmp2, tmp3; + IJG_INT32 tmp10, tmp11, tmp12, tmp13; + IJG_INT32 z1, z2, z3, z4, z5; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (IJG_INT32) wsptr[2]; + z3 = (IJG_INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((IJG_INT32) wsptr[0] + (IJG_INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((IJG_INT32) wsptr[0] - (IJG_INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (IJG_INT32) wsptr[7]; + tmp1 = (IJG_INT32) wsptr[5]; + tmp2 = (IJG_INT32) wsptr[3]; + tmp3 = (IJG_INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jidctred.c b/dcmjpeg/libijg16/jidctred.c new file mode 100644 index 00000000..5c48a036 --- /dev/null +++ b/dcmjpeg/libijg16/jidctred.c @@ -0,0 +1,398 @@ +/* + * jidctred.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains inverse-DCT routines that produce reduced-size output: + * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block. + * + * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M) + * algorithm used in jidctint.c. We simply replace each 8-to-8 1-D IDCT step + * with an 8-to-4 step that produces the four averages of two adjacent outputs + * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output). + * These steps were derived by computing the corresponding values at the end + * of the normal LL&M code, then simplifying as much as possible. + * + * 1x1 is trivial: just take the DC coefficient divided by 8. + * + * See jidctint.c for additional comments. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jdct16.h" /* Private declarations for DCT subsystem */ + +#ifdef IDCT_SCALING_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling is the same as in jidctint.c. */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_211164243 ((IJG_INT32) 1730) /* FIX(0.211164243) */ +#define FIX_0_509795579 ((IJG_INT32) 4176) /* FIX(0.509795579) */ +#define FIX_0_601344887 ((IJG_INT32) 4926) /* FIX(0.601344887) */ +#define FIX_0_720959822 ((IJG_INT32) 5906) /* FIX(0.720959822) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_850430095 ((IJG_INT32) 6967) /* FIX(0.850430095) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_061594337 ((IJG_INT32) 8697) /* FIX(1.061594337) */ +#define FIX_1_272758580 ((IJG_INT32) 10426) /* FIX(1.272758580) */ +#define FIX_1_451774981 ((IJG_INT32) 11893) /* FIX(1.451774981) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_2_172734803 ((IJG_INT32) 17799) /* FIX(2.172734803) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_624509785 ((IJG_INT32) 29692) /* FIX(3.624509785) */ +#else +#define FIX_0_211164243 FIX(0.211164243) +#define FIX_0_509795579 FIX(0.509795579) +#define FIX_0_601344887 FIX(0.601344887) +#define FIX_0_720959822 FIX(0.720959822) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_850430095 FIX(0.850430095) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_061594337 FIX(1.061594337) +#define FIX_1_272758580 FIX(1.272758580) +#define FIX_1_451774981 FIX(1.451774981) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_2_172734803 FIX(2.172734803) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_624509785 FIX(3.624509785) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce an int result. In this module, both inputs and result + * are 16 bits or less, so either int or short multiply will work. + */ + +#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 4x4 output block. + */ + +GLOBAL(void) +jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp2, tmp10, tmp12; + IJG_INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE*4]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { + /* Don't bother to process column 4, because second pass won't use it */ + if (ctr == DCTSIZE-4) + continue; + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 && + inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { + /* AC terms all zero; we need not examine term 4 for 4x4 output */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= (CONST_BITS+1); + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ + + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ + + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ + + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ + + tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ + + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ + + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ + + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ + + /* Final output stage */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1); + } + + /* Pass 2: process 4 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++) { + outptr = output_buf[ctr] + output_col; + /* It's not clear whether a zero row test is worthwhile here ... */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp0 = ((IJG_INT32) wsptr[0]) << (CONST_BITS+1); + + tmp2 = MULTIPLY((IJG_INT32) wsptr[2], FIX_1_847759065) + + MULTIPLY((IJG_INT32) wsptr[6], - FIX_0_765366865); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + /* Odd part */ + + z1 = (IJG_INT32) wsptr[7]; + z2 = (IJG_INT32) wsptr[5]; + z3 = (IJG_INT32) wsptr[3]; + z4 = (IJG_INT32) wsptr[1]; + + tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ + + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ + + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ + + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ + + tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ + + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ + + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ + + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 2x2 output block. + */ + +GLOBAL(void) +jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp10, z1; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE*2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { + /* Don't bother to process columns 2,4,6 */ + if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6) + continue; + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) { + /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + + continue; + } + + /* Even part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp10 = z1 << (CONST_BITS+2); + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ + + /* Final output stage */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2); + } + + /* Pass 2: process 2 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 2; ctr++) { + outptr = output_buf[ctr] + output_col; + /* It's not clear whether a zero row test is worthwhile here ... */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp10 = ((IJG_INT32) wsptr[0]) << (CONST_BITS+2); + + /* Odd part */ + + tmp0 = MULTIPLY((IJG_INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */ + + MULTIPLY((IJG_INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */ + + MULTIPLY((IJG_INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */ + + MULTIPLY((IJG_INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3+2) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3+2) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 1x1 output block. + */ + +GLOBAL(void) +jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + const JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + int dcval; + ISLOW_MULT_TYPE * quantptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + SHIFT_TEMPS + + /* We hardly need an inverse DCT routine for this: just take the + * average pixel value, which is one-eighth of the DC coefficient. + */ + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + dcval = DEQUANTIZE(coef_block[0], quantptr[0]); + dcval = (int) DESCALE((IJG_INT32) dcval, 3); + + output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; +} + +#endif /* IDCT_SCALING_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jinclude16.h b/dcmjpeg/libijg16/jinclude16.h new file mode 100644 index 00000000..d15f5512 --- /dev/null +++ b/dcmjpeg/libijg16/jinclude16.h @@ -0,0 +1,91 @@ +/* + * jinclude.h + * + * Copyright (C) 1991-1994, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file exists to provide a single place to fix any problems with + * including the wrong system include files. (Common problems are taken + * care of by the standard jconfig symbols, but on really weird systems + * you may have to edit this file.) + * + * NOTE: this file is NOT intended to be included by applications using the + * JPEG library. Most applications need only include jpeglib.h. + */ + + +/* Include auto-config file to find out which system include files we need. */ + +#include "jconfig16.h" /* auto configuration options */ +#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ + +/* + * We need the NULL macro and size_t typedef. + * On an ANSI-conforming system it is sufficient to include . + * Otherwise, we get them from or ; we may have to + * pull in as well. + * Note that the core JPEG library does not require ; + * only the default error handler and data source/destination modules do. + * But we must pull it in because of the references to FILE in jpeglib.h. + * You can remove those references if you want to compile without . + */ + +#ifdef HAVE_STDDEF_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef NEED_SYS_TYPES_H +#include +#endif + +#include + +/* + * We need memory copying and zeroing functions, plus strncpy(). + * ANSI and System V implementations declare these in . + * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). + * Some systems may declare memset and memcpy in . + * + * NOTE: we assume the size parameters to these functions are of type size_t. + * Change the casts in these macros if not! + */ + +#ifdef NEED_BSD_STRINGS + +#include +#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) +#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) + +#else /* not BSD, assume ANSI/SysV string lib */ + +#include +#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) +#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) + +#endif + +/* + * In ANSI C, and indeed any rational implementation, size_t is also the + * type returned by sizeof(). However, it seems there are some irrational + * implementations out there, in which sizeof() returns an int even though + * size_t is defined as long or unsigned long. To ensure consistent results + * we always use this SIZEOF() macro in place of using sizeof() directly. + */ + +#define SIZEOF(object) ((size_t) sizeof(object)) + +/* + * The modules that use fread() and fwrite() always invoke them through + * these macros. On some systems you may need to twiddle the argument casts. + * CAUTION: argument order is different from underlying functions! + */ + +#define JFREAD(file,buf,sizeofbuf) \ + ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) +#define JFWRITE(file,buf,sizeofbuf) \ + ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/dcmjpeg/libijg16/jlossls16.h b/dcmjpeg/libijg16/jlossls16.h new file mode 100644 index 00000000..a3b69593 --- /dev/null +++ b/dcmjpeg/libijg16/jlossls16.h @@ -0,0 +1,159 @@ +/* + * jlossls.h + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the lossless JPEG + * codec modules. + */ + +#ifndef JLOSSLS_H +#define JLOSSLS_H + + +/* + * Table H.1: Predictors for lossless coding. + */ + +#define PREDICTOR1 Ra +#define PREDICTOR2 Rb +#define PREDICTOR3 Rc +#define PREDICTOR4 (int) ((IJG_INT32) Ra + (IJG_INT32) Rb - (IJG_INT32) Rc) +#define PREDICTOR5 (int) ((IJG_INT32) Ra + RIGHT_SHIFT((IJG_INT32) Rb - (IJG_INT32) Rc, 1)) +#define PREDICTOR6 (int) ((IJG_INT32) Rb + RIGHT_SHIFT((IJG_INT32) Ra - (IJG_INT32) Rc, 1)) +#define PREDICTOR7 (int) RIGHT_SHIFT((IJG_INT32) Ra + (IJG_INT32) Rb, 1) + +/* This is a set of incorrect predictors that cause overflows for images with 16 bits/pixel. + * There is a known implementation of JPEG lossless that creates such incorrect images, + * and we need these predictors to be able to correctly decode such incorrect images. + */ +#define PREDICTOR4A (int) ((INT16) Ra + (INT16) Rb - (INT16) Rc) +#define PREDICTOR5A (int) ((INT16) Ra + RIGHT_SHIFT((INT16) Rb - (INT16) Rc, 1)) +#define PREDICTOR6A (int) ((INT16) Rb + RIGHT_SHIFT((INT16) Ra - (INT16) Rc, 1)) +#define PREDICTOR7A (int) RIGHT_SHIFT((INT16) Ra + (INT16) Rb, 1) + +typedef JMETHOD(void, predict_difference_method_ptr, + (j_compress_ptr cinfo, int ci, + JSAMPROW input_buf, JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width)); + +typedef JMETHOD(void, scaler_method_ptr, + (j_compress_ptr cinfo, int ci, + JSAMPROW input_buf, JSAMPROW output_buf, + JDIMENSION width)); + +/* Lossless-specific compression codec (compressor proper) */ +typedef struct { + struct jpeg_c_codec pub; /* public fields */ + + + /* Difference buffer control */ + JMETHOD(void, diff_start_pass, (j_compress_ptr cinfo, + J_BUF_MODE pass_mode)); + + /* Pointer to data which is private to diff controller */ + void *diff_private; + + + /* Entropy encoding */ + JMETHOD(JDIMENSION, entropy_encode_mcus, (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Prediction, differencing */ + JMETHOD(void, predict_start_pass, (j_compress_ptr cinfo)); + + /* It is useful to allow each component to have a separate diff method. */ + predict_difference_method_ptr predict_difference[MAX_COMPONENTS]; + + /* Pointer to data which is private to predictor module */ + void *pred_private; + + /* Sample scaling */ + JMETHOD(void, scaler_start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, scaler_scale, (j_compress_ptr cinfo, + JSAMPROW input_buf, JSAMPROW output_buf, + JDIMENSION width)); + + /* Pointer to data which is private to scaler module */ + void *scaler_private; + +} jpeg_lossless_c_codec; + +typedef jpeg_lossless_c_codec * j_lossless_c_ptr; + + +typedef JMETHOD(void, predict_undifference_method_ptr, + (j_decompress_ptr cinfo, int comp_index, + JDIFFROW diff_buf, JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width)); + +/* Lossless-specific decompression codec (decompressor proper) */ +typedef struct { + struct jpeg_d_codec pub; /* public fields */ + + + /* Difference buffer control */ + JMETHOD(void, diff_start_input_pass, (j_decompress_ptr cinfo)); + + /* Pointer to data which is private to diff controller */ + void *diff_private; + + + /* Entropy decoding */ + JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(boolean, entropy_process_restart, (j_decompress_ptr cinfo)); + JMETHOD(JDIMENSION, entropy_decode_mcus, (j_decompress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Prediction, undifferencing */ + JMETHOD(void, predict_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, predict_process_restart, (j_decompress_ptr cinfo)); + + /* It is useful to allow each component to have a separate undiff method. */ + predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS]; + + /* Pointer to data which is private to predictor module */ + void *pred_private; + + /* Sample scaling */ + JMETHOD(void, scaler_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, scaler_scale, (j_decompress_ptr cinfo, + JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width)); + + /* Pointer to data which is private to scaler module */ + void *scaler_private; + +} jpeg_lossless_d_codec; + +typedef jpeg_lossless_d_codec * j_lossless_d_ptr; + + +/* Compression module initialization routines */ +EXTERN(void) jinit_lossless_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_lhuff_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_differencer JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_scaler JPP((j_compress_ptr cinfo)); +/* Decompression module initialization routines */ +EXTERN(void) jinit_lossless_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_lhuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_undifferencer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_scaler JPP((j_decompress_ptr cinfo)); + +#endif /* JLOSSLS_H */ diff --git a/dcmjpeg/libijg16/jlossy16.h b/dcmjpeg/libijg16/jlossy16.h new file mode 100644 index 00000000..ad4d62b3 --- /dev/null +++ b/dcmjpeg/libijg16/jlossy16.h @@ -0,0 +1,120 @@ +/* + * jlossy.h + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the lossy (DCT-based) + * JPEG codec modules. + */ + +#ifndef JLOSSY_H +#define JLOSSY_H + + +/* Lossy-specific compression codec (compressor proper) */ +typedef struct { + struct jpeg_c_codec pub; /* public fields */ + + + /* Coefficient buffer control */ + JMETHOD(void, coef_start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + /* JMETHOD(boolean, coef_compress_data, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf));*/ + + /* Pointer to data which is private to coef module */ + void *coef_private; + + + /* Forward DCT (also controls coefficient quantization) */ + JMETHOD(void, fdct_start_pass, (j_compress_ptr cinfo)); + /* perhaps this should be an array??? */ + JMETHOD(void, fdct_forward_DCT, (j_compress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks)); + + /* Pointer to data which is private to fdct module */ + void *fdct_private; + + + /* Entropy encoding */ + JMETHOD(boolean, entropy_encode_mcu, (j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + +} jpeg_lossy_c_codec; + +typedef jpeg_lossy_c_codec * j_lossy_c_ptr; + + + +typedef JMETHOD(void, inverse_DCT_method_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col)); + +/* Lossy-specific decompression codec (decompressor proper) */ +typedef struct { + struct jpeg_d_codec pub; /* public fields */ + + + /* Coefficient buffer control */ + JMETHOD(void, coef_start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, coef_start_output_pass, (j_decompress_ptr cinfo)); + + /* Pointer to array of coefficient virtual arrays, or NULL if none */ + jvirt_barray_ptr *coef_arrays; + + /* Pointer to data which is private to coef module */ + void *coef_private; + + + /* Entropy decoding */ + JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(boolean, entropy_decode_mcu, (j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); + + /* This is here to share code between baseline and progressive decoders; */ + /* other modules probably should not use it */ + boolean entropy_insufficient_data; /* set TRUE after emitting warning */ + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Inverse DCT (also performs dequantization) */ + JMETHOD(void, idct_start_pass, (j_decompress_ptr cinfo)); + + /* It is useful to allow each component to have a separate IDCT method. */ + inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; + + /* Pointer to data which is private to idct module */ + void *idct_private; + +} jpeg_lossy_d_codec; + +typedef jpeg_lossy_d_codec * j_lossy_d_ptr; + + +/* Compression module initialization routines */ +EXTERN(void) jinit_lossy_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_shuff_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo)); + +/* Decompression module initialization routines */ +EXTERN(void) jinit_lossy_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_shuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); + +#endif /* JLOSSY_H */ diff --git a/dcmjpeg/libijg16/jmemmgr.c b/dcmjpeg/libijg16/jmemmgr.c new file mode 100644 index 00000000..9267fc1f --- /dev/null +++ b/dcmjpeg/libijg16/jmemmgr.c @@ -0,0 +1,1174 @@ +/* + * jmemmgr.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the JPEG system-independent memory management + * routines. This code is usable across a wide variety of machines; most + * of the system dependencies have been isolated in a separate file. + * The major functions provided here are: + * * pool-based allocation and freeing of memory; + * * policy decisions about how to divide available memory among the + * virtual arrays; + * * control logic for swapping virtual arrays between main memory and + * backing storage. + * The separate system-dependent file provides the actual backing-storage + * access code, and it contains the policy decision about how much total + * main memory to use. + * This file is system-dependent in the sense that some of its functions + * are unnecessary in some systems. For example, if there is enough virtual + * memory so that backing storage will never be used, much of the virtual + * array control logic could be removed. (Of course, if you have that much + * memory then you shouldn't care about a little bit of unused code...) + */ + +#define JPEG_INTERNALS +#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */ +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jmemsys16.h" /* import the system-dependent declarations */ + +#ifndef NO_GETENV +#ifndef HAVE_STDLIB_H /* should declare getenv() */ +extern char * getenv JPP((const char * name)); +#endif +#endif + + +/* + * Some important notes: + * The allocation routines provided here must never return NULL. + * They should exit to error_exit if unsuccessful. + * + * It's not a good idea to try to merge the sarray, barray and darray + * routines, even though they are textually almost the same, because + * samples are usually stored as bytes while coefficients and differenced + * are shorts or ints. Thus, in machines where byte pointers have a + * different representation from word pointers, the resulting machine + * code could not be the same. + */ + + +/* + * Many machines require storage alignment: longs must start on 4-byte + * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc() + * always returns pointers that are multiples of the worst-case alignment + * requirement, and we had better do so too. + * There isn't any really portable way to determine the worst-case alignment + * requirement. This module assumes that the alignment requirement is + * multiples of sizeof(ALIGN_TYPE). + * By default, we define ALIGN_TYPE as double. This is necessary on some + * workstations (where doubles really do need 8-byte alignment) and will work + * fine on nearly everything. If your machine has lesser alignment needs, + * you can save a few bytes by making ALIGN_TYPE smaller. + * The only place I know of where this will NOT work is certain Macintosh + * 680x0 compilers that define double as a 10-byte IEEE extended float. + * Doing 10-byte alignment is counterproductive because longwords won't be + * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have + * such a compiler. + */ + +#ifndef ALIGN_TYPE /* so can override from jconfig.h */ +#define ALIGN_TYPE double +#endif + + +/* + * We allocate objects from "pools", where each pool is gotten with a single + * request to jpeg_get_small() or jpeg_get_large(). There is no per-object + * overhead within a pool, except for alignment padding. Each pool has a + * header with a link to the next pool of the same class. + * Small and large pool headers are identical except that the latter's + * link pointer must be FAR on 80x86 machines. + * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE + * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple + * of the alignment requirement of ALIGN_TYPE. + */ + +typedef union small_pool_struct * small_pool_ptr; + +typedef union small_pool_struct { + struct { + small_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} small_pool_hdr; + +typedef union large_pool_struct FAR * large_pool_ptr; + +typedef union large_pool_struct { + struct { + large_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} large_pool_hdr; + + +/* + * Here is the full definition of a memory manager object. + */ + +typedef struct { + struct jpeg_memory_mgr pub; /* public fields */ + + /* Each pool identifier (lifetime class) names a linked list of pools. */ + small_pool_ptr small_list[JPOOL_NUMPOOLS]; + large_pool_ptr large_list[JPOOL_NUMPOOLS]; + + /* Since we only have one lifetime class of virtual arrays, only one + * linked list is necessary (for each datatype). Note that the virtual + * array control blocks being linked together are actually stored somewhere + * in the small-pool list. + */ + jvirt_sarray_ptr virt_sarray_list; + jvirt_barray_ptr virt_barray_list; + + /* This counts total space obtained from jpeg_get_small/large */ + long total_space_allocated; + + /* alloc_sarray and alloc_barray set this value for use by virtual + * array routines. + */ + JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */ +} my_memory_mgr; + +typedef my_memory_mgr * my_mem_ptr; + + +/* + * The control blocks for virtual arrays. + * Note that these blocks are allocated in the "small" pool area. + * System-dependent info for the associated backing store (if any) is hidden + * inside the backing_store_info struct. + */ + +struct jvirt_sarray_control { + JSAMPARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION samplesperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_sarray_ptr next; /* link to next virtual sarray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + +struct jvirt_barray_control { + JBLOCKARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION blocksperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_barray_ptr next; /* link to next virtual barray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + + +#ifdef MEM_STATS /* optional extra stuff for statistics */ + +LOCAL(void) +print_mem_stats (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + + /* Since this is only a debugging stub, we can cheat a little by using + * fprintf directly rather than going through the trace message code. + * This is helpful because message parm array can't handle longs. + */ + fprintf(stderr, "Freeing pool %d, total space = %ld\n", + pool_id, mem->total_space_allocated); + + for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL; + lhdr_ptr = lhdr_ptr->hdr.next) { + fprintf(stderr, " Large chunk used %ld\n", + (long) lhdr_ptr->hdr.bytes_used); + } + + for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL; + shdr_ptr = shdr_ptr->hdr.next) { + fprintf(stderr, " Small chunk used %ld free %ld\n", + (long) shdr_ptr->hdr.bytes_used, + (long) shdr_ptr->hdr.bytes_left); + } +} + +#endif /* MEM_STATS */ + + +LOCAL(void) +out_of_memory (j_common_ptr cinfo, int which) +/* Report an out-of-memory error and stop execution */ +/* If we compiled MEM_STATS support, report alloc requests before dying */ +{ +#ifdef MEM_STATS + cinfo->err->trace_level = 2; /* force self_destruct to report stats */ +#endif + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which); +} + + +/* + * Allocation of "small" objects. + * + * For these, we use pooled storage. When a new pool must be created, + * we try to get enough space for the current request plus a "slop" factor, + * where the slop will be the amount of leftover space in the new pool. + * The speed vs. space tradeoff is largely determined by the slop values. + * A different slop value is provided for each pool class (lifetime), + * and we also distinguish the first pool of a class from later ones. + * NOTE: the values given work fairly well on both 16- and 32-bit-int + * machines, but may be too small if longs are 64 bits or more. + */ + +static const size_t first_pool_slop[JPOOL_NUMPOOLS] = +{ + 1600, /* first PERMANENT pool */ + 16000 /* first IMAGE pool */ +}; + +static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = +{ + 0, /* additional PERMANENT pools */ + 5000 /* additional IMAGE pools */ +}; + +#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */ + + +METHODDEF(void *) +alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "small" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr hdr_ptr, prev_hdr_ptr; + char * data_ptr; + size_t odd_bytes, min_request, slop; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))) + out_of_memory(cinfo, 1); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* See if space is available in any existing pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + prev_hdr_ptr = NULL; + hdr_ptr = mem->small_list[pool_id]; + while (hdr_ptr != NULL) { + if (hdr_ptr->hdr.bytes_left >= sizeofobject) + break; /* found pool with enough space */ + prev_hdr_ptr = hdr_ptr; + hdr_ptr = hdr_ptr->hdr.next; + } + + /* Time to make a new pool? */ + if (hdr_ptr == NULL) { + /* min_request is what we need now, slop is what will be leftover */ + min_request = sizeofobject + SIZEOF(small_pool_hdr); + if (prev_hdr_ptr == NULL) /* first pool in class? */ + slop = first_pool_slop[pool_id]; + else + slop = extra_pool_slop[pool_id]; + /* Don't ask for more than MAX_ALLOC_CHUNK */ + if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request)) + slop = (size_t) (MAX_ALLOC_CHUNK-min_request); + /* Try to get space, if fail reduce slop and try again */ + for (;;) { + hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop); + if (hdr_ptr != NULL) + break; + slop /= 2; + if (slop < MIN_SLOP) /* give up when it gets real small */ + out_of_memory(cinfo, 2); /* jpeg_get_small failed */ + } + mem->total_space_allocated += (long)(min_request + slop); + /* Success, initialize the new pool header and add to end of list */ + hdr_ptr->hdr.next = NULL; + hdr_ptr->hdr.bytes_used = 0; + hdr_ptr->hdr.bytes_left = sizeofobject + slop; + if (prev_hdr_ptr == NULL) /* first pool in class? */ + mem->small_list[pool_id] = hdr_ptr; + else + prev_hdr_ptr->hdr.next = hdr_ptr; + } + + /* OK, allocate the object from the current pool */ + data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */ + data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */ + hdr_ptr->hdr.bytes_used += sizeofobject; + hdr_ptr->hdr.bytes_left -= sizeofobject; + + return (void *) data_ptr; +} + + +/* + * Allocation of "large" objects. + * + * The external semantics of these are the same as "small" objects, + * except that FAR pointers are used on 80x86. However the pool + * management heuristics are quite different. We assume that each + * request is large enough that it may as well be passed directly to + * jpeg_get_large; the pool management just links everything together + * so that we can free it all on demand. + * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY + * structures. The routines that create these structures (see below) + * deliberately bunch rows together to ensure a large request size. + */ + +METHODDEF(void FAR *) +alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "large" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + large_pool_ptr hdr_ptr; + size_t odd_bytes; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr))) + out_of_memory(cinfo, 3); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* Always make a new pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject + + SIZEOF(large_pool_hdr)); + if (hdr_ptr == NULL) + out_of_memory(cinfo, 4); /* jpeg_get_large failed */ + mem->total_space_allocated += (long)(sizeofobject + SIZEOF(large_pool_hdr)); + + /* Success, initialize the new pool header and add to list */ + hdr_ptr->hdr.next = mem->large_list[pool_id]; + /* We maintain space counts in each pool header for statistical purposes, + * even though they are not needed for allocation. + */ + hdr_ptr->hdr.bytes_used = sizeofobject; + hdr_ptr->hdr.bytes_left = 0; + mem->large_list[pool_id] = hdr_ptr; + + return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */ +} + + +/* + * Creation of 2-D sample arrays. + * The pointers are in near heap, the samples themselves in FAR heap. + * + * To minimize allocation overhead and to allow I/O of large contiguous + * blocks, we allocate the sample rows in groups of as many rows as possible + * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request. + * NB: the virtual array control routines, later in this file, know about + * this chunking of rows. The rowsperchunk value is left in the mem manager + * object so that it can be saved away if this sarray is the workspace for + * a virtual array. + */ + +METHODDEF(JSAMPARRAY) +alloc_sarray (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, JDIMENSION numrows) +/* Allocate a 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JSAMPARRAY result; + JSAMPROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) samplesperrow * SIZEOF(JSAMPLE)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JSAMPARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JSAMPROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JSAMPROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow + * SIZEOF(JSAMPLE))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += samplesperrow; + } + } + + return result; +} + + +/* + * Creation of 2-D coefficient-block arrays. + * This is essentially the same as the code for sample arrays, above. + */ + +METHODDEF(JBLOCKARRAY) +alloc_barray (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, JDIMENSION numrows) +/* Allocate a 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JBLOCKARRAY result; + JBLOCKROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) blocksperrow * SIZEOF(JBLOCK)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JBLOCKARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JBLOCKROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JBLOCKROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow + * SIZEOF(JBLOCK))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += blocksperrow; + } + } + + return result; +} + + +#ifdef NEED_DARRAY + +/* + * Creation of 2-D difference arrays. + * This is essentially the same as the code for sample arrays, above. + */ + +METHODDEF(JDIFFARRAY) +alloc_darray (j_common_ptr cinfo, int pool_id, + JDIMENSION diffsperrow, JDIMENSION numrows) +/* Allocate a 2-D difference array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JDIFFARRAY result; + JDIFFROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) diffsperrow * SIZEOF(JDIFF)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JDIFFARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JDIFFROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JDIFFROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) diffsperrow + * SIZEOF(JDIFF))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += diffsperrow; + } + } + + return result; +} + +#endif + + +/* + * About virtual array management: + * + * The above "normal" array routines are only used to allocate strip buffers + * (as wide as the image, but just a few rows high). Full-image-sized buffers + * are handled as "virtual" arrays. The array is still accessed a strip at a + * time, but the memory manager must save the whole array for repeated + * accesses. The intended implementation is that there is a strip buffer in + * memory (as high as is possible given the desired memory limit), plus a + * backing file that holds the rest of the array. + * + * The request_virt_array routines are told the total size of the image and + * the maximum number of rows that will be accessed at once. The in-memory + * buffer must be at least as large as the maxaccess value. + * + * The request routines create control blocks but not the in-memory buffers. + * That is postponed until realize_virt_arrays is called. At that time the + * total amount of space needed is known (approximately, anyway), so free + * memory can be divided up fairly. + * + * The access_virt_array routines are responsible for making a specific strip + * area accessible (after reading or writing the backing file, if necessary). + * Note that the access routines are told whether the caller intends to modify + * the accessed strip; during a read-only pass this saves having to rewrite + * data to disk. The access routines are also responsible for pre-zeroing + * any newly accessed rows, if pre-zeroing was requested. + * + * In current usage, the access requests are usually for nonoverlapping + * strips; that is, successive access start_row numbers differ by exactly + * num_rows = maxaccess. This means we can get good performance with simple + * buffer dump/reload logic, by making the in-memory buffer be a multiple + * of the access height; then there will never be accesses across bufferload + * boundaries. The code will still work with overlapping access requests, + * but it doesn't handle bufferload overlaps very efficiently. + */ + + +METHODDEF(jvirt_sarray_ptr) +request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION samplesperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_sarray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_sarray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->samplesperrow = samplesperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_sarray_list; /* add to list of virtual arrays */ + mem->virt_sarray_list = result; + + return result; +} + + +METHODDEF(jvirt_barray_ptr) +request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION blocksperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_barray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_barray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->blocksperrow = blocksperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_barray_list; /* add to list of virtual arrays */ + mem->virt_barray_list = result; + + return result; +} + + +METHODDEF(void) +realize_virt_arrays (j_common_ptr cinfo) +/* Allocate the in-memory buffers for any unrealized virtual arrays */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + size_t space_per_minheight, maximum_space, avail_mem; + size_t minheights, max_minheights; + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + /* Compute the minimum space needed (maxaccess rows in each buffer) + * and the maximum space needed (full image height in each buffer). + * These may be of use to the system-dependent jpeg_mem_available routine. + */ + space_per_minheight = 0; + maximum_space = 0; + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += sptr->maxaccess * + sptr->samplesperrow * SIZEOF(JSAMPLE); + maximum_space += sptr->rows_in_array * + sptr->samplesperrow * SIZEOF(JSAMPLE); + } + } + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += bptr->maxaccess * + bptr->blocksperrow * SIZEOF(JBLOCK); + maximum_space += bptr->rows_in_array * + bptr->blocksperrow * SIZEOF(JBLOCK); + } + } + + if (space_per_minheight <= 0) + return; /* no unrealized arrays, no work */ + + /* Determine amount of memory to actually use; this is system-dependent. */ + avail_mem = (size_t)jpeg_mem_available(cinfo, (long)space_per_minheight, (long)maximum_space, + mem->total_space_allocated); + + /* If the maximum space needed is available, make all the buffers full + * height; otherwise parcel it out with the same number of minheights + * in each buffer. + */ + if (avail_mem >= maximum_space) + max_minheights = 1000000000L; + else { + max_minheights = avail_mem / space_per_minheight; + /* If there doesn't seem to be enough space, try to get the minimum + * anyway. This allows a "stub" implementation of jpeg_mem_available(). + */ + if (max_minheights <= 0) + max_minheights = 1; + } + + /* Allocate the in-memory buffers and initialize backing store as needed. */ + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = (size_t)((sptr->rows_in_array - 1L) / sptr->maxaccess + 1L); + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + sptr->rows_in_mem = sptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + sptr->rows_in_mem = (JDIMENSION)max_minheights * sptr->maxaccess; + jpeg_open_backing_store(cinfo, & sptr->b_s_info, + (long) sptr->rows_in_array * + (long) sptr->samplesperrow * + (long) SIZEOF(JSAMPLE)); + sptr->b_s_open = TRUE; + } + sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE, + sptr->samplesperrow, sptr->rows_in_mem); + sptr->rowsperchunk = mem->last_rowsperchunk; + sptr->cur_start_row = 0; + sptr->first_undef_row = 0; + sptr->dirty = FALSE; + } + } + + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = (size_t)((bptr->rows_in_array - 1L) / bptr->maxaccess + 1L); + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + bptr->rows_in_mem = bptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + bptr->rows_in_mem = (JDIMENSION)max_minheights * bptr->maxaccess; + jpeg_open_backing_store(cinfo, & bptr->b_s_info, + (long) bptr->rows_in_array * + (long) bptr->blocksperrow * + (long) SIZEOF(JBLOCK)); + bptr->b_s_open = TRUE; + } + bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE, + bptr->blocksperrow, bptr->rows_in_mem); + bptr->rowsperchunk = mem->last_rowsperchunk; + bptr->cur_start_row = 0; + bptr->first_undef_row = 0; + bptr->dirty = FALSE; + } + } +} + + +LOCAL(void) +do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual sample array */ +{ + size_t bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = ptr->samplesperrow * SIZEOF(JSAMPLE); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = ptr->cur_start_row + i; + rows = MIN(rows, ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + file_offset += byte_count; + } +} + + +LOCAL(void) +do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual coefficient-block array */ +{ + size_t bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = ptr->blocksperrow * SIZEOF(JBLOCK); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = ptr->cur_start_row + i; + rows = MIN(rows, ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + file_offset += byte_count; + } +} + + +METHODDEF(JSAMPARRAY) +access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual sample array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_sarray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_sarray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +METHODDEF(JBLOCKARRAY) +access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual block array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_barray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_barray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +/* + * Release all objects belonging to a specified pool. + */ + +METHODDEF(void) +free_pool (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + size_t space_freed; + + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + +#ifdef MEM_STATS + if (cinfo->err->trace_level > 1) + print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */ +#endif + + /* If freeing IMAGE pool, close any virtual arrays first */ + if (pool_id == JPOOL_IMAGE) { + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->b_s_open) { /* there may be no backing store */ + sptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info); + } + } + mem->virt_sarray_list = NULL; + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->b_s_open) { /* there may be no backing store */ + bptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info); + } + } + mem->virt_barray_list = NULL; + } + + /* Release large objects */ + lhdr_ptr = mem->large_list[pool_id]; + mem->large_list[pool_id] = NULL; + + while (lhdr_ptr != NULL) { + large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next; + space_freed = lhdr_ptr->hdr.bytes_used + + lhdr_ptr->hdr.bytes_left + + SIZEOF(large_pool_hdr); + jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed); + mem->total_space_allocated -= (long)space_freed; + lhdr_ptr = next_lhdr_ptr; + } + + /* Release small objects */ + shdr_ptr = mem->small_list[pool_id]; + mem->small_list[pool_id] = NULL; + + while (shdr_ptr != NULL) { + small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next; + space_freed = shdr_ptr->hdr.bytes_used + + shdr_ptr->hdr.bytes_left + + SIZEOF(small_pool_hdr); + jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed); + mem->total_space_allocated -= (long)space_freed; + shdr_ptr = next_shdr_ptr; + } +} + + +/* + * Close up shop entirely. + * Note that this cannot be called unless cinfo->mem is non-NULL. + */ + +METHODDEF(void) +self_destruct (j_common_ptr cinfo) +{ + int pool; + + /* Close all backing store, release all memory. + * Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + free_pool(cinfo, pool); + } + + /* Release the memory manager control block too. */ + jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr)); + cinfo->mem = NULL; /* ensures I will be called only once */ + + jpeg_mem_term(cinfo); /* system-dependent cleanup */ +} + + +/* + * Memory manager initialization. + * When this is called, only the error manager pointer is valid in cinfo! + */ + +GLOBAL(void) +jinit_memory_mgr (j_common_ptr cinfo) +{ + my_mem_ptr mem; + long max_to_use; + int pool; + size_t test_mac; + + cinfo->mem = NULL; /* for safety if init fails */ + + /* Check for configuration errors. + * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably + * doesn't reflect any real hardware alignment requirement. + * The test is a little tricky: for X>0, X and X-1 have no one-bits + * in common if and only if X is a power of 2, ie has only one one-bit. + * Some compilers may give an "unreachable code" warning here; ignore it. + */ + if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0) + ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE); + /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be + * a multiple of SIZEOF(ALIGN_TYPE). + * Again, an "unreachable code" warning may be ignored here. + * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK. + */ + test_mac = (size_t) MAX_ALLOC_CHUNK; + if ((long) test_mac != MAX_ALLOC_CHUNK || + (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) + ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); + + max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */ + + /* Attempt to allocate memory manager's control block */ + mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr)); + + if (mem == NULL) { + jpeg_mem_term(cinfo); /* system-dependent cleanup */ + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0); + } + + /* OK, fill in the method pointers */ + mem->pub.alloc_small = alloc_small; + mem->pub.alloc_large = alloc_large; + mem->pub.alloc_sarray = alloc_sarray; + mem->pub.alloc_barray = alloc_barray; +#ifdef NEED_DARRAY + mem->pub.alloc_darray = alloc_darray; +#endif + mem->pub.request_virt_sarray = request_virt_sarray; + mem->pub.request_virt_barray = request_virt_barray; + mem->pub.realize_virt_arrays = realize_virt_arrays; + mem->pub.access_virt_sarray = access_virt_sarray; + mem->pub.access_virt_barray = access_virt_barray; + mem->pub.free_pool = free_pool; + mem->pub.self_destruct = self_destruct; + + /* Make MAX_ALLOC_CHUNK accessible to other modules */ + mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK; + + /* Initialize working state */ + mem->pub.max_memory_to_use = max_to_use; + + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + mem->small_list[pool] = NULL; + mem->large_list[pool] = NULL; + } + mem->virt_sarray_list = NULL; + mem->virt_barray_list = NULL; + + mem->total_space_allocated = SIZEOF(my_memory_mgr); + + /* Declare ourselves open for business */ + cinfo->mem = & mem->pub; + + /* Check for an environment variable JPEGMEM; if found, override the + * default max_memory setting from jpeg_mem_init. Note that the + * surrounding application may again override this value. + * If your system doesn't support getenv(), define NO_GETENV to disable + * this feature. + */ +#ifndef NO_GETENV + { char * memenv; + + if ((memenv = getenv("JPEGMEM")) != NULL) { + char ch = 'x'; + + if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) { + if (ch == 'm' || ch == 'M') + max_to_use *= 1000L; + mem->pub.max_memory_to_use = max_to_use * 1000L; + } + } + } +#endif + +} diff --git a/dcmjpeg/libijg16/jmemnobs.c b/dcmjpeg/libijg16/jmemnobs.c new file mode 100644 index 00000000..6fa0e579 --- /dev/null +++ b/dcmjpeg/libijg16/jmemnobs.c @@ -0,0 +1,109 @@ +/* + * jmemnobs.c + * + * Copyright (C) 1992-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides a really simple implementation of the system- + * dependent portion of the JPEG memory manager. This implementation + * assumes that no backing-store files are needed: all required space + * can be obtained from malloc(). + * This is very portable in the sense that it'll compile on almost anything, + * but you'd better have lots of main memory (or virtual memory) if you want + * to process big images. + * Note that the max_memory_to_use option is ignored by this implementation. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" +#include "jmemsys16.h" /* import the system-dependent declarations */ + +#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +#endif + + +/* + * Memory allocation and freeing are controlled by the regular library + * routines malloc() and free(). + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * "Large" objects are treated the same as "small" ones. + * NB: although we include FAR keywords in the routine declarations, + * this file won't actually work in 80x86 small/medium model; at least, + * you probably won't be able to process useful-size images in only 64KB. + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * This routine computes the total memory space available for allocation. + * Here we always say, "we got all you want bud!" + */ + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + return max_bytes_needed; +} + + +/* + * Backing store (temporary file) management. + * Since jpeg_mem_available always promised the moon, + * this should never be called and we can just error out. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + ERREXIT(cinfo, JERR_NO_BACKING_STORE); +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. Here, there isn't any. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + return 0; /* just set max_memory_to_use to 0 */ +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* no work */ +} diff --git a/dcmjpeg/libijg16/jmemsys16.h b/dcmjpeg/libijg16/jmemsys16.h new file mode 100644 index 00000000..3a7a215e --- /dev/null +++ b/dcmjpeg/libijg16/jmemsys16.h @@ -0,0 +1,198 @@ +/* + * jmemsys.h + * + * Copyright (C) 1992-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file defines the interface between the system-independent + * and system-dependent portions of the JPEG memory manager. No other + * modules need include it. (The system-independent portion is jmemmgr.c; + * there are several different versions of the system-dependent portion.) + * + * This file works as-is for the system-dependent memory managers supplied + * in the IJG distribution. You may need to modify it if you write a + * custom memory manager. If system-dependent changes are needed in + * this file, the best method is to #ifdef them based on a configuration + * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR + * and USE_MAC_MEMMGR. + */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_get_small jpeg16_get_small +#define jpeg_free_small jpeg16_free_small +#define jpeg_get_large jpeg16_get_large +#define jpeg_free_large jpeg16_free_large +#define jpeg_mem_available jpeg16_mem_available +#define jpeg_open_backing_store jpeg16_open_backing_store +#define jpeg_mem_init jpeg16_mem_init +#define jpeg_mem_term jpeg16_mem_term +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* + * These two functions are used to allocate and release small chunks of + * memory. (Typically the total amount requested through jpeg_get_small is + * no more than 20K or so; this will be requested in chunks of a few K each.) + * Behavior should be the same as for the standard library functions malloc + * and free; in particular, jpeg_get_small must return NULL on failure. + * On most systems, these ARE malloc and free. jpeg_free_small is passed the + * size of the object being freed, just in case it's needed. + * On an 80x86 machine using small-data memory model, these manage near heap. + */ + +EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject)); +EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object, + size_t sizeofobject)); + +/* + * These two functions are used to allocate and release large chunks of + * memory (up to the total free space designated by jpeg_mem_available). + * The interface is the same as above, except that on an 80x86 machine, + * far pointers are used. On most other machines these are identical to + * the jpeg_get/free_small routines; but we keep them separate anyway, + * in case a different allocation strategy is desirable for large chunks. + */ + +EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo, + size_t sizeofobject)); +EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object, + size_t sizeofobject)); + +/* + * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may + * be requested in a single call to jpeg_get_large (and jpeg_get_small for that + * matter, but that case should never come into play). This macro is needed + * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. + * On those machines, we expect that jconfig.h will provide a proper value. + * On machines with 32-bit flat address spaces, any large constant may be used. + * + * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type + * size_t and will be a multiple of sizeof(align_type). + */ + +#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */ +#define MAX_ALLOC_CHUNK 1000000000L +#endif + +/* + * This routine computes the total space still available for allocation by + * jpeg_get_large. If more space than this is needed, backing store will be + * used. NOTE: any memory already allocated must not be counted. + * + * There is a minimum space requirement, corresponding to the minimum + * feasible buffer sizes; jmemmgr.c will request that much space even if + * jpeg_mem_available returns zero. The maximum space needed, enough to hold + * all working storage in memory, is also passed in case it is useful. + * Finally, the total space already allocated is passed. If no better + * method is available, cinfo->mem->max_memory_to_use - already_allocated + * is often a suitable calculation. + * + * It is OK for jpeg_mem_available to underestimate the space available + * (that'll just lead to more backing-store access than is really necessary). + * However, an overestimate will lead to failure. Hence it's wise to subtract + * a slop factor from the true available space. 5% should be enough. + * + * On machines with lots of virtual memory, any large constant may be returned. + * Conversely, zero may be returned to always use the minimum amount of memory. + */ + +EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo, + long min_bytes_needed, + long max_bytes_needed, + long already_allocated)); + + +/* + * This structure holds whatever state is needed to access a single + * backing-store object. The read/write/close method pointers are called + * by jmemmgr.c to manipulate the backing-store object; all other fields + * are private to the system-dependent backing store routines. + */ + +#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ + + +#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */ + +typedef unsigned short XMSH; /* type of extended-memory handles */ +typedef unsigned short EMSH; /* type of expanded-memory handles */ + +typedef union { + short file_handle; /* DOS file handle if it's a temp file */ + XMSH xms_handle; /* handle if it's a chunk of XMS */ + EMSH ems_handle; /* handle if it's a chunk of EMS */ +} handle_union; + +#endif /* USE_MSDOS_MEMMGR */ + +#ifdef USE_MAC_MEMMGR /* Mac-specific junk */ +#include +#endif /* USE_MAC_MEMMGR */ + + +typedef struct backing_store_struct * backing_store_ptr; + +typedef struct backing_store_struct { + /* Methods for reading/writing/closing this backing-store object */ + JMETHOD(void, read_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, write_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, close_backing_store, (j_common_ptr cinfo, + backing_store_ptr info)); + + /* Private fields for system-dependent backing-store management */ +#ifdef USE_MSDOS_MEMMGR + /* For the MS-DOS manager (jmemdos.c), we need: */ + handle_union handle; /* reference to backing-store storage object */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else +#ifdef USE_MAC_MEMMGR + /* For the Mac manager (jmemmac.c), we need: */ + short temp_file; /* file reference number to temp file */ + FSSpec tempSpec; /* the FSSpec for the temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else + /* For a typical implementation with temp files, we need: */ + FILE * temp_file; /* stdio reference to temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ +#endif +#endif +} backing_store_info; + + +/* + * Initial opening of a backing-store object. This must fill in the + * read/write/close pointers in the object. The read/write routines + * may take an error exit if the specified maximum file size is exceeded. + * (If jpeg_mem_available always returns a large value, this routine can + * just take an error exit.) + */ + +EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo, + backing_store_ptr info, + long total_bytes_needed)); + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. jpeg_mem_init will be called before anything is + * allocated (and, therefore, nothing in cinfo is of use except the error + * manager pointer). It should return a suitable default value for + * max_memory_to_use; this may subsequently be overridden by the surrounding + * application. (Note that max_memory_to_use is only important if + * jpeg_mem_available chooses to consult it ... no one else will.) + * jpeg_mem_term may assume that all requested memory has been freed and that + * all opened backing-store objects have been closed. + */ + +EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo)); diff --git a/dcmjpeg/libijg16/jmorecfg16.h b/dcmjpeg/libijg16/jmorecfg16.h new file mode 100644 index 00000000..bde21574 --- /dev/null +++ b/dcmjpeg/libijg16/jmorecfg16.h @@ -0,0 +1,407 @@ +/* + * jmorecfg.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains additional configuration options that customize the + * JPEG software for special applications or support machine-dependent + * optimizations. Most users will not need to touch this file. + */ + + +#include "dcmtk/ofstd/ofexport.h" /* for DCMTK_DECL_EXPORT */ + +#ifdef ijg16_EXPORTS +#define DCMTK_IJG16_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_IJG16_EXPORT DCMTK_DECL_IMPORT +#endif + + +/* + * Define BITS_IN_JSAMPLE as either + * 8 for 8-bit sample values (the usual setting) + * 12 for 12-bit sample values + * Only 8 and 12 are legal data precisions for lossy JPEG according to the + * JPEG standard, and the IJG code does not support anything else! + * We do not support run-time selection of data precision, sorry. + */ + +#define BITS_IN_JSAMPLE 16 /* use 8 or 12 (or 16 for lossless) */ + + +/* + * Maximum number of components (color channels) allowed in JPEG image. + * To meet the letter of the JPEG spec, set this to 255. However, darn + * few applications need more than 4 channels (maybe 5 for CMYK + alpha + * mask). We recommend 10 as a reasonable compromise; use 4 if you are + * really short on memory. (Each allowed component costs a hundred or so + * bytes of storage, whether actually used in an image or not.) + */ + +#define MAX_COMPONENTS 10 /* maximum number of image components */ + + +/* + * Basic data types. + * You may need to change these if you have a machine with unusual data + * type sizes; for example, "char" not 8 bits, "short" not 16 bits, + * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, + * but it had better be at least 16. + */ + +/* Representation of a single sample (pixel element value). + * We frequently allocate large arrays of these, so it's important to keep + * them small. But if you have memory to burn and access to char or short + * arrays is very slow on your hardware, you might want to change these. + */ + +#if BITS_IN_JSAMPLE == 8 +/* JSAMPLE should be the smallest type that will hold the values 0..255. + * You can use a signed char by having GETJSAMPLE mask it with 0xFF. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JSAMPLE; +#ifdef CHAR_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + +#define MAXJSAMPLE 255 +#define CENTERJSAMPLE 128 + +#endif /* BITS_IN_JSAMPLE == 8 */ + + +#if BITS_IN_JSAMPLE == 12 +/* JSAMPLE should be the smallest type that will hold the values 0..4095. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 4095 +#define CENTERJSAMPLE 2048 + +#endif /* BITS_IN_JSAMPLE == 12 */ + + +#if BITS_IN_JSAMPLE == 16 +/* JSAMPLE should be the smallest type that will hold the values 0..65535. + * You can use a signed short by having GETJSAMPLE mask it with 0xFFFF. + */ + +#ifdef HAVE_UNSIGNED_SHORT + +typedef unsigned short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_SHORT */ + +typedef short JSAMPLE; +#ifdef SHORT_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFFFF) +#endif /* SHORT_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_SHORT */ + +#define MAXJSAMPLE 65535 +#define CENTERJSAMPLE 32768 + +#endif /* BITS_IN_JSAMPLE == 16 */ + + +/* Representation of a DCT frequency coefficient. + * This should be a signed value of at least 16 bits; "short" is usually OK. + * Again, we allocate large arrays of these, but you can change to int + * if you have memory to burn and "short" is really slow. + */ + +typedef short JCOEF; + + +/* Representation of a spatial difference value. + * This should be a signed value of at least 16 bits; int is usually OK. + */ + +typedef int JDIFF; + + +/* Compressed datastreams are represented as arrays of JOCTET. + * These must be EXACTLY 8 bits wide, at least once they are written to + * external storage. Note that when using the stdio data source/destination + * managers, this is also the data type passed to fread/fwrite. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JOCTET; +#define GETJOCTET(value) (value) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JOCTET; +#ifdef CHAR_IS_UNSIGNED +#define GETJOCTET(value) (value) +#else +#define GETJOCTET(value) ((value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + + +/* These typedefs are used for various table entries and so forth. + * They must be at least as wide as specified; but making them too big + * won't cost a huge amount of memory, so we don't provide special + * extraction code like we did for JSAMPLE. (In other words, these + * typedefs live at a different point on the speed/space tradeoff curve.) + */ + +/* UINT8 must hold at least the values 0..255. */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char UINT8; +#else /* not HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char UINT8; +#else /* not CHAR_IS_UNSIGNED */ +typedef short UINT8; +#endif /* CHAR_IS_UNSIGNED */ +#endif /* HAVE_UNSIGNED_CHAR */ + +/* UINT16 must hold at least the values 0..65535. */ + +#ifdef HAVE_UNSIGNED_SHORT +typedef unsigned short UINT16; +#else /* not HAVE_UNSIGNED_SHORT */ +typedef unsigned int UINT16; +#endif /* HAVE_UNSIGNED_SHORT */ + +/* INT16 must hold at least the values -32768..32767. */ + +#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ +typedef short INT16; +#endif + +/* IJG_INT32 must hold at least signed 32-bit values. */ +typedef long IJG_INT32; + +/* Datatype used for image dimensions. The JPEG standard only supports + * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore + * "unsigned int" is sufficient on all machines. However, if you need to + * handle larger images and you don't mind deviating from the spec, you + * can change this datatype. + */ + +typedef unsigned int JDIMENSION; + +#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ + + +/* These macros are used in all function definitions and extern declarations. + * You could modify them if you need to change function linkage conventions; + * in particular, you'll need to do that to make the library a Windows DLL. + * Another application is to make all functions global for use with debuggers + * or code profilers that require it. + */ + +/* a function called through method pointers: */ +#define METHODDEF(type) static type +/* a function used only in its module: */ +#define LOCAL(type) static type +/* a function referenced thru EXTERNs: */ +#define GLOBAL(type) type +/* a reference to a GLOBAL function: */ +#define EXTERN(type) extern DCMTK_IJG16_EXPORT type + + +/* This macro is used to declare a "method", that is, a function pointer. + * We want to supply prototype parameters if the compiler can cope. + * Note that the arglist parameter must be parenthesized! + * Again, you can customize this if you need special linkage keywords. + */ + +#ifdef HAVE_PROTOTYPES +#define JMETHOD(type,methodname,arglist) type (*methodname) arglist +#else +#define JMETHOD(type,methodname,arglist) type (*methodname) () +#endif + + +/* Here is the pseudo-keyword for declaring pointers that must be "far" + * on 80x86 machines. Most of the specialized coding for 80x86 is handled + * by just saying "FAR *" where such a pointer is needed. In a few places + * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. + */ + +#undef FAR +#ifdef NEED_FAR_POINTERS +#define FAR far +#else +#define FAR +#endif + + +/* + * On a few systems, type boolean and/or its values FALSE, TRUE may appear + * in standard header files. Or you may have conflicts with application- + * specific header files that you want to include together with these files. + * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. + */ + +#ifndef HAVE_BOOLEAN +typedef int boolean; +#endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif + + +/* + * The remaining options affect code selection within the JPEG library, + * but they don't need to be visible to most applications using the library. + * To minimize application namespace pollution, the symbols won't be + * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. + */ + +#ifdef JPEG_INTERNALS +#define JPEG_INTERNAL_OPTIONS +#endif + +#ifdef JPEG_INTERNAL_OPTIONS + + +/* + * These defines indicate whether to include various optional functions. + * Undefining some of these symbols will produce a smaller but less capable + * library. Note that you can leave certain source files out of the + * compilation/linking process if you've #undef'd the corresponding symbols. + * (You may HAVE to do that if your compiler doesn't like null source files.) + */ + +/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ + +/* Capability options common to encoder and decoder: */ + +#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ +#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ +#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ + +/* Encoder capability options: */ + +#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */ +#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ +/* Note: if you selected 12-bit data precision, it is dangerous to turn off + * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit + * precision, so jcshuff.c normally uses entropy optimization to compute + * usable tables for higher precision. If you don't want to do optimization, + * you'll have to supply different default Huffman tables. + * The exact same statements apply for progressive and lossless JPEG: + * the default tables don't work for progressive mode or lossless mode. + * (This may get fixed, however.) + */ +#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ + +/* Decoder capability options: */ + +#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */ +#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ +#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ +#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ +#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ +#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ +#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ +#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ + +/* more capability options later, no doubt */ + + +/* + * Ordering of RGB data in scanlines passed to or from the application. + * If your application wants to deal with data in the order B,G,R, just + * change these macros. You can also deal with formats such as R,G,B,X + * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing + * the offsets will also change the order in which colormap data is organized. + * RESTRICTIONS: + * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. + * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not + * useful if you are using JPEG color spaces other than YCbCr or grayscale. + * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE + * is not 3 (they don't understand about dummy color components!). So you + * can't use color quantization if you change that value. + */ + +#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ +#define RGB_GREEN 1 /* Offset of Green */ +#define RGB_BLUE 2 /* Offset of Blue */ +#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ + + +/* Definitions for speed-related optimizations. */ + + +/* If your compiler supports inline functions, define INLINE + * as the inline keyword; otherwise define it as empty. + */ + +#ifndef INLINE +#ifdef __GNUC__ /* for instance, GNU C knows about inline */ +#define INLINE __inline__ +#endif +#ifndef INLINE +#define INLINE /* default is to define it as empty */ +#endif +#endif + + +/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying + * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER + * as short on such a machine. MULTIPLIER must be at least 16 bits wide. + */ + +#ifndef MULTIPLIER +#define MULTIPLIER int /* type for fastest integer multiply */ +#endif + + +/* FAST_FLOAT should be either float or double, whichever is done faster + * by your compiler. (Note that this type is only used in the floating point + * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) + * Typically, float is faster in ANSI C compilers, while double is faster in + * pre-ANSI compilers (because they insist on converting to double anyway). + * The code below therefore chooses float if we have ANSI-style prototypes. + */ + +#ifndef FAST_FLOAT +#ifdef HAVE_PROTOTYPES +#define FAST_FLOAT float +#else +#define FAST_FLOAT double +#endif +#endif + +#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/dcmjpeg/libijg16/jpegint16.h b/dcmjpeg/libijg16/jpegint16.h new file mode 100644 index 00000000..c50fa8a4 --- /dev/null +++ b/dcmjpeg/libijg16/jpegint16.h @@ -0,0 +1,373 @@ +/* + * jpegint.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides common declarations for the various JPEG modules. + * These declarations are considered internal to the JPEG library; most + * applications using the library shouldn't need to include this file. + */ + + +/* Declarations for both compression & decompression */ + +typedef enum { /* Operating modes for buffer controllers */ + JBUF_PASS_THRU, /* Plain stripwise operation */ + /* Remaining modes require a full-image buffer to have been created */ + JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ + JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ + JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ +} J_BUF_MODE; + +/* Values of global_state field (jdapi.c has some dependencies on ordering!) */ +#define CSTATE_START 100 /* after create_compress */ +#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ +#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ +#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ +#define DSTATE_START 200 /* after create_decompress */ +#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ +#define DSTATE_READY 202 /* found SOS, ready for start_decompress */ +#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ +#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ +#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ +#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ +#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ +#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ +#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ +#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ + + +/* Declarations for compression modules */ + +/* Master control module */ +struct jpeg_comp_master { + JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo)); + JMETHOD(void, pass_startup, (j_compress_ptr cinfo)); + JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean call_pass_startup; /* True if pass_startup must be called */ + boolean is_last_pass; /* True during last pass */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_c_main_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail)); +}; + +/* Compression preprocessing (downsampling input buffer control) */ +struct jpeg_c_prep_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, pre_process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, + JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail)); +}; + +/* Compression codec (compressor proper) */ +struct jpeg_c_codec { + JMETHOD(void, entropy_start_pass, (j_compress_ptr cinfo, + boolean gather_statistics)); + JMETHOD(void, entropy_finish_pass, (j_compress_ptr cinfo)); + JMETHOD(boolean, need_optimization_pass, (j_compress_ptr cinfo)); + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(boolean, compress_data, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf)); +}; + +/* Colorspace conversion */ +struct jpeg_color_converter { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, color_convert, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows)); +}; + +/* Downsampling */ +struct jpeg_downsampler { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, downsample, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, + JDIMENSION out_row_group_index)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Marker writing */ +struct jpeg_marker_writer { + JMETHOD(void, write_file_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_frame_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_scan_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo)); + JMETHOD(void, write_tables_only, (j_compress_ptr cinfo)); + /* These routines are exported to allow insertion of extra markers */ + /* Probably only COM and APPn markers should be written this way */ + JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker, + unsigned int datalen)); + JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val)); +}; + + +/* Declarations for decompression modules */ + +/* Master control module */ +struct jpeg_decomp_master { + JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ +}; + +/* Input control module */ +struct jpeg_input_controller { + JMETHOD(int, consume_input, (j_decompress_ptr cinfo)); + JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo)); + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean has_multiple_scans; /* True if file has multiple scans */ + boolean eoi_reached; /* True when EOI has been consumed */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_d_main_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Decompression codec (decompressor proper) */ +struct jpeg_d_codec { + JMETHOD(void, calc_output_dimensions, (j_decompress_ptr cinfo)); + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, consume_data, (j_decompress_ptr cinfo)); + JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, decompress_data, (j_decompress_ptr cinfo, + JSAMPIMAGE output_buf)); +}; + +/* Decompression postprocessing (color quantization buffer control) */ +struct jpeg_d_post_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, post_process_data, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Marker reading & parsing */ +struct jpeg_marker_reader { + JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo)); + /* Read markers until SOS or EOI. + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + */ + JMETHOD(int, read_markers, (j_decompress_ptr cinfo)); + /* Read a restart marker --- exported for use by entropy decoder only */ + jpeg_marker_parser_method read_restart_marker; + + /* State of marker reader --- nominally internal, but applications + * supplying COM or APPn handlers might like to know the state. + */ + boolean saw_SOI; /* found SOI? */ + boolean saw_SOF; /* found SOF? */ + int next_restart_num; /* next restart number expected (0-7) */ + unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ +}; + +/* Upsampling (note that upsampler must also call color converter) */ +struct jpeg_upsampler { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, upsample, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Colorspace conversion */ +struct jpeg_color_deconverter { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, color_convert, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows)); +}; + +/* Color quantization or color precision reduction */ +struct jpeg_color_quantizer { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan)); + JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, + int num_rows)); + JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); +}; + + +/* Miscellaneous useful macros */ + +#undef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#undef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + + +/* We assume that right shift corresponds to signed division by 2 with + * rounding towards minus infinity. This is correct for typical "arithmetic + * shift" instructions that shift in copies of the sign bit. But some + * C compilers implement >> with an unsigned shift. For these machines you + * must define RIGHT_SHIFT_IS_UNSIGNED. + * RIGHT_SHIFT provides a proper signed right shift of an IJG_INT32 quantity. + * It is only applied with constant shift counts. SHIFT_TEMPS must be + * included in the variables of any routine using RIGHT_SHIFT. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define SHIFT_TEMPS IJG_INT32 shift_temp; +#define RIGHT_SHIFT(x,shft) \ + ((shift_temp = (x)) < 0 ? \ + (shift_temp >> (shft)) | ((~((IJG_INT32) 0)) << (32-(shft))) : \ + (shift_temp >> (shft))) +#else +#define SHIFT_TEMPS +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jinit_c_codec jinit16_c_codec +#define jinit_c_diff_controller jinit16_c_diff_controller +#define jinit_lossy_c_codec jinit16_lossy_c_codec +#define jinit_lossless_c_codec jinit16_lossless_c_codec +#define jinit_compress_master jinit16_compress_master +#define jinit_c_master_control jinit16_c_master_control +#define jinit_c_main_controller jinit16_c_main_controller +#define jinit_c_prep_controller jinit16_c_prep_controller +#define jinit_c_coef_controller jinit16_c_coef_controller +#define jinit_color_converter jinit16_color_converter +#define jinit_downsampler jinit16_downsampler +#define jinit_forward_dct jinit16_forward_dct +#define jinit_shuff_encoder jinit16_shuff_encoder +#define jinit_phuff_encoder jinit16_phuff_encoder +#ifdef WITH_ARITHMETIC_PATCH +#define jinit_arith_encoder jinit16_arith_encoder +#endif +#define jinit_marker_writer jinit16_marker_writer +#define jinit_d_codec jinit16_d_codec +#define jinit_lossy_d_codec jinit16_lossy_d_codec +#define jinit_lossless_d_codec jinit16_lossless_d_codec +#define jinit_master_decompress jinit16_master_decompress +#define jinit_d_main_controller jinit16_d_main_controller +#define jinit_d_coef_controller jinit16_d_coef_controller +#define jinit_d_diff_controller jinit16_d_diff_controller +#define jinit_d_post_controller jinit16_d_post_controller +#define jinit_input_controller jinit16_input_controller +#define jinit_marker_reader jinit16_marker_reader +#define jinit_shuff_decoder jinit16_shuff_decoder +#define jinit_phuff_decoder jinit16_phuff_decoder +#ifdef WITH_ARITHMETIC_PATCH +#define jinit_arith_decoder jinit16_arith_decoder +#endif +#define jinit_lhuff_decoder jinit16_lhuff_decoder +#define jinit_undifferencer jinit16_undifferencer +#define jinit_d_scaler jinit16_d_scaler +#define jinit_inverse_dct jinit16_inverse_dct +#define jinit_upsampler jinit16_upsampler +#define jinit_color_deconverter jinit16_color_deconverter +#define jinit_1pass_quantizer jinit16_1pass_quantizer +#define jinit_2pass_quantizer jinit16_2pass_quantizer +#define jinit_merged_upsampler jinit16_merged_upsampler +#define jinit_memory_mgr jinit16_memory_mgr +#define jdiv_round_up jdiv16_round_up +#define jround_up jround16_up +#define jcopy_sample_rows jcopy16_sample_rows +#define jcopy_block_row jcopy16_block_row +#define jzero_far jzero16_far +#define jpeg_zigzag_order jpeg16_zigzag_order +#define jpeg_natural_order jpeg16_natural_order +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Compression module initialization routines */ +EXTERN(void) jinit_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_diff_controller JPP((j_compress_ptr cinfo, boolean need_full_buffer)); +EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo, + boolean transcode_only)); +EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_compressor JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); +#ifdef WITH_ARITHMETIC_PATCH +EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo)); +#endif +/* Decompression module initialization routines */ +EXTERN(void) jinit_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_diff_controller JPP((j_decompress_ptr cinfo, boolean need_full_buffer)); +EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_decompressor JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); +#ifdef WITH_ARITHMETIC_PATCH +EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo)); +#endif +EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo)); +/* Memory manager initialization */ +EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo)); + +/* Utility routines in jutils.c */ +EXTERN(long) jdiv_round_up JPP((long a, long b)); +EXTERN(long) jround_up JPP((long a, long b)); +EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols)); +EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks)); +EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero)); +/* Constant tables in jutils.c */ +#if 0 /* This table is not actually needed in v6a */ +extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ +#endif +extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ + +/* Suppress undefined-structure complaints if necessary. */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +#endif +#endif /* INCOMPLETE_TYPES_BROKEN */ diff --git a/dcmjpeg/libijg16/jpeglib16.h b/dcmjpeg/libijg16/jpeglib16.h new file mode 100644 index 00000000..1fcc033a --- /dev/null +++ b/dcmjpeg/libijg16/jpeglib16.h @@ -0,0 +1,1214 @@ +/* + * jpeglib.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the application interface for the JPEG library. + * Most applications using the library need only include this file, + * and perhaps jerror.h if they want to know the exact error codes. + */ + +#ifndef JPEGLIB_H +#define JPEGLIB_H + +/* + * First we include the configuration files that record how this + * installation of the JPEG library is set up. jconfig.h can be + * generated automatically for many systems. jmorecfg.h contains + * manual configuration options that most people need not worry about. + */ + +#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ +#include "jconfig16.h" /* widely used configuration options */ +#endif +#include "jmorecfg16.h" /* seldom changed options */ + + +/* Version ID for the JPEG library. + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". + */ + +#define JPEG_LIB_VERSION 62 /* Version 6b */ + + +/* Various constants determining the sizes of things. + * All of these are specified by the JPEG standard, so don't change them + * if you want to be compatible. + */ + +#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ +#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ +#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ +#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ +#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ +#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ +#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ +/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; + * the PostScript DCT filter can emit files with many more than 10 data units + * per MCU. + * If you happen to run across such a file, you can up D_MAX_DATA_UNITS_IN_MCU + * to handle it. We even let you do this from the jconfig.h file. However, + * we strongly discourage changing C_MAX_DATA_UNITS_IN_MCU; just because Adobe + * sometimes emits noncompliant files doesn't mean you should too. + */ +#define C_MAX_DATA_UNITS_IN_MCU 10 /* compressor's limit on data units/MCU */ +#ifndef D_MAX_DATA_UNITS_IN_MCU +#define D_MAX_DATA_UNITS_IN_MCU 10 /* decompressor's limit on data units/MCU */ +#endif + + +/* Data structures for images (arrays of samples and of DCT coefficients). + * On 80x86 machines, the image arrays are too big for near pointers, + * but the pointer arrays can fit in near memory. + */ + +typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ +typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ +typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ + +typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ +typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ +typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ +typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ + +typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ + +typedef JDIFF FAR *JDIFFROW; /* pointer to one row of difference values */ +typedef JDIFFROW *JDIFFARRAY; /* ptr to some rows (a 2-D diff array) */ +typedef JDIFFARRAY *JDIFFIMAGE; /* a 3-D diff array: top index is color */ + + +/* Types for JPEG compression parameters and working tables. */ + + +/* DCT coefficient quantization tables. */ + +typedef struct { + /* This array gives the coefficient quantizers in natural array order + * (not the zigzag order in which they are stored in a JPEG DQT marker). + * CAUTION: IJG versions prior to v6a kept this array in zigzag order. + */ + UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JQUANT_TBL; + + +/* Huffman coding tables. */ + +typedef struct { + /* These two fields directly represent the contents of a JPEG DHT marker */ + UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ + /* length k bits; bits[0] is unused */ + UINT8 huffval[256]; /* The symbols, in order of incr code length */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JHUFF_TBL; + + +/* Basic info about one component (color channel). */ + +typedef struct { + /* These values are fixed over the whole image. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOF marker. */ + int component_id; /* identifier for this component (0..255) */ + int component_index; /* its index in SOF or cinfo->comp_info[] */ + int h_samp_factor; /* horizontal sampling factor (1..4) */ + int v_samp_factor; /* vertical sampling factor (1..4) */ + int quant_tbl_no; /* quantization table selector (0..3) */ + /* These values may vary between scans. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOS marker. */ + /* The decompressor output side may not use these variables. */ + int dc_tbl_no; /* DC entropy table selector (0..3) */ + int ac_tbl_no; /* AC entropy table selector (0..3) */ + + /* Remaining fields should be treated as private by applications. */ + + /* These values are computed during compression or decompression startup: */ + /* Component's size in data units. + * Any dummy data units added to complete an MCU are not counted; therefore + * these values do not depend on whether a scan is interleaved or not. + */ + JDIMENSION width_in_data_units; + JDIMENSION height_in_data_units; + /* Size of a data unit in/output by the codec (in samples). Always + * data_unit for compression. For decompression this is the size of the + * output from one data_unit, reflecting any processing performed by the + * codec. For example, in the DCT-based codec, scaling may be applied + * during the IDCT step. Values of 1,2,4,8 are likely to be supported. + * Note that different components may have different codec_data_unit sizes. + */ + int codec_data_unit; + /* The downsampled dimensions are the component's actual, unpadded number + * of samples at the main buffer (preprocessing/compression interface), thus + * downsampled_width = ceil(image_width * Hi/Hmax) + * and similarly for height. For decompression, codec-based processing is + * included (ie, IDCT scaling), so + * downsampled_width = ceil(image_width * Hi/Hmax * codec_data_unit/data_unit) + */ + JDIMENSION downsampled_width; /* actual width in samples */ + JDIMENSION downsampled_height; /* actual height in samples */ + /* This flag is used only for decompression. In cases where some of the + * components will be ignored (eg grayscale output from YCbCr image), + * we can skip most computations for the unused components. + */ + boolean component_needed; /* do we need the value of this component? */ + + /* These values are computed before starting a scan of the component. */ + /* The decompressor output side may not use these variables. */ + int MCU_width; /* number of data units per MCU, horizontally */ + int MCU_height; /* number of data units per MCU, vertically */ + int MCU_data_units; /* MCU_width * MCU_height */ + int MCU_sample_width; /* MCU width in samples, MCU_width*codec_data_unit */ + int last_col_width; /* # of non-dummy data_units across in last MCU */ + int last_row_height; /* # of non-dummy data_units down in last MCU */ + + /* Saved quantization table for component; NULL if none yet saved. + * See jdinput.c comments about the need for this information. + * This field is currently used only for decompression. + */ + JQUANT_TBL * quant_table; + + /* Private per-component storage for DCT or IDCT subsystem. */ + void * dct_table; +} jpeg_component_info; + + +/* The script for encoding a multiple-scan file is an array of these: */ + +typedef struct { + int comps_in_scan; /* number of components encoded in this scan */ + int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ + int Ss, Se; /* progressive JPEG spectral selection parms + lossless JPEG predictor select parm (Ss) */ + int Ah, Al; /* progressive JPEG successive approx. parms + lossless JPEG point transform parm (Al) */ +} jpeg_scan_info; + +/* The decompressor can save APPn and COM markers in a list of these: */ + +typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; + +struct jpeg_marker_struct { + jpeg_saved_marker_ptr next; /* next in list, or NULL */ + UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ + unsigned int original_length; /* # bytes of data in the file */ + unsigned int data_length; /* # bytes of data saved at data[] */ + JOCTET FAR * data; /* the data contained in the marker */ + /* the marker length word is not counted in data_length or original_length */ +}; + +/* Known codec processes. */ + +typedef enum { + JPROC_SEQUENTIAL, /* baseline/extended sequential DCT */ + JPROC_PROGRESSIVE, /* progressive DCT */ + JPROC_LOSSLESS /* lossless (sequential) */ +} J_CODEC_PROCESS; + +/* Known color spaces. */ + +typedef enum { + JCS_UNKNOWN, /* error/unspecified */ + JCS_GRAYSCALE, /* monochrome */ + JCS_RGB, /* red/green/blue */ + JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ + JCS_CMYK, /* C/M/Y/K */ + JCS_YCCK /* Y/Cb/Cr/K */ +} J_COLOR_SPACE; + +/* DCT/IDCT algorithm options. */ + +typedef enum { + JDCT_ISLOW, /* slow but accurate integer algorithm */ + JDCT_IFAST, /* faster, less accurate integer method */ + JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ +} J_DCT_METHOD; + +#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ +#define JDCT_DEFAULT JDCT_ISLOW +#endif +#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ +#define JDCT_FASTEST JDCT_IFAST +#endif + +/* Dithering options for decompression. */ + +typedef enum { + JDITHER_NONE, /* no dithering */ + JDITHER_ORDERED, /* simple ordered dither */ + JDITHER_FS /* Floyd-Steinberg error diffusion dither */ +} J_DITHER_MODE; + + +/* Common fields between JPEG compression and decompression master structs. */ + +#define jpeg_common_fields \ + struct jpeg_error_mgr * err; /* Error handler module */\ + struct jpeg_memory_mgr * mem; /* Memory manager module */\ + struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ + void * client_data; /* Available for use by application */\ + boolean is_decompressor; /* So common code can tell which is which */\ + int global_state /* For checking call sequence validity */ + +/* Routines that are to be used by both halves of the library are declared + * to receive a pointer to this structure. There are no actual instances of + * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. + */ +struct jpeg_common_struct { + jpeg_common_fields; /* Fields common to both master struct types */ + /* Additional fields follow in an actual jpeg_compress_struct or + * jpeg_decompress_struct. All three structs must agree on these + * initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct jpeg_common_struct * j_common_ptr; +typedef struct jpeg_compress_struct * j_compress_ptr; +typedef struct jpeg_decompress_struct * j_decompress_ptr; + + +/* Master record for a compression instance */ + +struct jpeg_compress_struct { + jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ + + /* Destination for compressed data */ + struct jpeg_destination_mgr * dest; + + /* Description of source image --- these fields must be filled in by + * outer application before starting compression. in_color_space must + * be correct before you can even call jpeg_set_defaults(). + */ + + JDIMENSION image_width; /* input image width */ + JDIMENSION image_height; /* input image height */ + int input_components; /* # of color components in input image */ + J_COLOR_SPACE in_color_space; /* colorspace of input image */ + + double input_gamma; /* image gamma of input image */ + + /* Compression parameters --- these fields must be set before calling + * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to + * initialize everything to reasonable defaults, then changing anything + * the application specifically wants to change. That way you won't get + * burnt when new parameters are added. Also note that there are several + * helper routines to simplify changing parameters. + */ + + boolean lossless; /* TRUE=lossless encoding, FALSE=lossy */ + + int data_precision; /* bits of precision in image data */ + + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + int num_scans; /* # of entries in scan_info array */ + const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ + /* The default value of scan_info is NULL, which causes a single-scan + * sequential JPEG file to be emitted. To create a multi-scan file, + * set num_scans and scan_info to point to an array of scan definitions. + */ + + boolean raw_data_in; /* TRUE=caller supplies downsampled data */ + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + int smoothing_factor; /* 1..100, or 0 for no input smoothing */ + J_DCT_METHOD dct_method; /* DCT algorithm selector */ + + /* The restart interval can be specified in absolute MCUs by setting + * restart_interval, or in MCU rows by setting restart_in_rows + * (in which case the correct restart_interval will be figured + * for each scan). + */ + unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ + int restart_in_rows; /* if > 0, MCU rows per restart interval */ + + /* Parameters controlling emission of special markers. */ + + boolean write_JFIF_header; /* should a JFIF marker be written? */ + UINT8 JFIF_major_version; /* What to write for the JFIF version number */ + UINT8 JFIF_minor_version; + /* These three values are not used by the JPEG code, merely copied */ + /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ + /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ + /* ratio is defined by X_density/Y_density even when density_unit=0. */ + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean write_Adobe_marker; /* should an Adobe marker be written? */ + + /* State variable: index of next scanline to be written to + * jpeg_write_scanlines(). Application may use this to control its + * processing loop, e.g., "while (next_scanline < image_height)". + */ + + JDIMENSION next_scanline; /* 0 .. image_height-1 */ + + /* Remaining fields are known throughout compressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during compression startup + */ + int data_unit; /* size of data unit in samples */ + J_CODEC_PROCESS process; /* encoding process of JPEG image */ + + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to codec */ + /* The codec receives data in units of MCU rows as defined for fully + * interleaved scans (whether the JPEG file is interleaved or not). + * There are v_samp_factor * data_unit sample rows of each component in an + * "iMCU" (interleaved MCU) row. + */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int data_units_in_MCU; /* # of data units per MCU */ + int MCU_membership[C_MAX_DATA_UNITS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th block in an MCU */ + + int Ss, Se, Ah, Al; /* progressive/lossless JPEG parameters for scan */ + + /* + * Links to compression subobjects (methods and private variables of modules) + */ + struct jpeg_comp_master * master; + struct jpeg_c_main_controller * main; + struct jpeg_c_prep_controller * prep; + struct jpeg_c_codec * codec; + struct jpeg_marker_writer * marker; + struct jpeg_color_converter * cconvert; + struct jpeg_downsampler * downsample; + jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ + int script_space_size; + + /* force the use of an extended sequential SOF1 marker even when a + * SOF0 marker could be used, to comply with DICOM CP 1447. + * This is only needed for 8 bits/sample. */ + boolean force_extended_sequential_marker; +}; + + +/* Master record for a decompression instance */ + +struct jpeg_decompress_struct { + jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ + + /* Source of compressed data */ + struct jpeg_source_mgr * src; + + /* Basic description of image --- filled in by jpeg_read_header(). */ + /* Application may inspect these values to decide how to process image. */ + + JDIMENSION image_width; /* nominal image width (from SOF marker) */ + JDIMENSION image_height; /* nominal image height */ + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + /* Decompression processing parameters --- these fields must be set before + * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes + * them to default values. + */ + + J_COLOR_SPACE out_color_space; /* colorspace for output */ + + unsigned int scale_num, scale_denom; /* fraction by which to scale image */ + + double output_gamma; /* image gamma wanted in output */ + + boolean buffered_image; /* TRUE=multiple output passes */ + boolean raw_data_out; /* TRUE=downsampled data wanted */ + + J_DCT_METHOD dct_method; /* IDCT algorithm selector */ + boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ + boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ + + boolean quantize_colors; /* TRUE=colormapped output wanted */ + /* the following are ignored if not quantize_colors: */ + J_DITHER_MODE dither_mode; /* type of color dithering to use */ + boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ + int desired_number_of_colors; /* max # colors to use in created colormap */ + /* these are significant only in buffered-image mode: */ + boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ + boolean enable_external_quant;/* enable future use of external colormap */ + boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ + + /* Description of actual output image that will be returned to application. + * These fields are computed by jpeg_start_decompress(). + * You can also use jpeg_calc_output_dimensions() to determine these values + * in advance of calling jpeg_start_decompress(). + */ + + JDIMENSION output_width; /* scaled image width */ + JDIMENSION output_height; /* scaled image height */ + int out_color_components; /* # of color components in out_color_space */ + int output_components; /* # of color components returned */ + /* output_components is 1 (a colormap index) when quantizing colors; + * otherwise it equals out_color_components. + */ + int rec_outbuf_height; /* min recommended height of scanline buffer */ + /* If the buffer passed to jpeg_read_scanlines() is less than this many rows + * high, space and time will be wasted due to unnecessary data copying. + * Usually rec_outbuf_height will be 1 or 2, at most 4. + */ + + /* When quantizing colors, the output colormap is described by these fields. + * The application can supply a colormap by setting colormap non-NULL before + * calling jpeg_start_decompress; otherwise a colormap is created during + * jpeg_start_decompress or jpeg_start_output. + * The map has out_color_components rows and actual_number_of_colors columns. + */ + int actual_number_of_colors; /* number of entries in use */ + JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ + + /* State variables: these variables indicate the progress of decompression. + * The application may examine these but must not modify them. + */ + + /* Row index of next scanline to be read from jpeg_read_scanlines(). + * Application may use this to control its processing loop, e.g., + * "while (output_scanline < output_height)". + */ + JDIMENSION output_scanline; /* 0 .. output_height-1 */ + + /* Current input scan number and number of iMCU rows completed in scan. + * These indicate the progress of the decompressor input side. + */ + int input_scan_number; /* Number of SOS markers seen so far */ + JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ + + /* The "output scan number" is the notional scan being displayed by the + * output side. The decompressor will not allow output scan/row number + * to get ahead of input scan/row, but it can fall arbitrarily far behind. + */ + int output_scan_number; /* Nominal scan number being displayed */ + JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ + + /* Current progression status. coef_bits[c][i] indicates the precision + * with which component c's DCT coefficient i (in zigzag order) is known. + * It is -1 when no data has yet been received, otherwise it is the point + * transform (shift) value for the most recent scan of the coefficient + * (thus, 0 at completion of the progression). + * This pointer is NULL when reading a non-progressive file. + */ + int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ + + /* Internal JPEG parameters --- the application usually need not look at + * these fields. Note that the decompressor output side may not use + * any parameters that can change between scans. + */ + + /* Quantization and Huffman tables are carried forward across input + * datastreams when processing abbreviated JPEG datastreams. + */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + /* These parameters are never carried across datastreams, since they + * are given in SOF/SOS markers or defined to be reset by SOI. + */ + + int data_precision; /* bits of precision in image data */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ + + /* These fields record data obtained from optional markers recognized by + * the JPEG library. + */ + boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ + /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ + UINT8 JFIF_major_version; /* JFIF version number */ + UINT8 JFIF_minor_version; + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ + UINT8 Adobe_transform; /* Color transform code from Adobe marker */ + + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + + /* Aside from the specific data retained from APPn markers known to the + * library, the uninterpreted contents of any or all APPn and COM markers + * can be saved in a list for examination by the application. + */ + jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ + + /* Remaining fields are known throughout decompressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during decompression startup + */ + int data_unit; /* size of data unit in samples */ + J_CODEC_PROCESS process; /* decoding process of JPEG image */ + + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + int min_codec_data_unit; /* smallest codec_data_unit of any component */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ + /* The codec's input and output progress is measured in units of "iMCU" + * (interleaved MCU) rows. These are the same as MCU rows in fully + * interleaved JPEG scans, but are used whether the scan is interleaved + * or not. We define an iMCU row as v_samp_factor data_unit rows of each + * component. Therefore, the codec output contains + * v_samp_factor*codec_data_unit sample rows of a component per iMCU row. + */ + + JSAMPLE * sample_range_limit; /* table for fast range-limiting */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + * Note that the decompressor output side must not use these fields. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int data_units_in_MCU; /* # of data _units per MCU */ + int MCU_membership[D_MAX_DATA_UNITS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th data unit in an MCU */ + + int Ss, Se, Ah, Al; /* progressive/lossless JPEG parms for scan */ + + /* This field is shared between entropy decoder and marker parser. + * It is either zero or the code of a JPEG marker that has been + * read from the data source, but has not yet been processed. + */ + int unread_marker; + + /* + * Links to decompression subobjects (methods, private variables of modules) + */ + struct jpeg_decomp_master * master; + struct jpeg_d_main_controller * main; + struct jpeg_d_codec * codec; + struct jpeg_d_post_controller * post; + struct jpeg_input_controller * inputctl; + struct jpeg_marker_reader * marker; + struct jpeg_upsampler * upsample; + struct jpeg_color_deconverter * cconvert; + struct jpeg_color_quantizer * cquantize; + + /* Options that enable or disable various workarounds */ + unsigned int workaround_options; +}; + +/* constants for workaround_options in struct jpeg_decompress_struct */ +#define WORKAROUND_PREDICTOR6OVERFLOW 1 +#define WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER 2 + +/* "Object" declarations for JPEG modules that may be supplied or called + * directly by the surrounding application. + * As with all objects in the JPEG library, these structs only define the + * publicly visible methods and state variables of a module. Additional + * private fields may exist after the public ones. + */ + + +/* Error handler object */ + +struct jpeg_error_mgr { + /* Error exit handler: does not return to caller */ + JMETHOD(void, error_exit, (j_common_ptr cinfo)); + /* Conditionally emit a trace or warning message */ + JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); + /* Routine that actually outputs a trace or error message */ + JMETHOD(void, output_message, (j_common_ptr cinfo)); + /* Format a message string for the most recent JPEG error or message */ + JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); +#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ + /* Reset error state variables at start of a new image */ + JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); + + /* The message ID code and any parameters are saved here. + * A message can have one string parameter or up to 8 int parameters. + */ + int msg_code; +#define JMSG_STR_PARM_MAX 80 + union { + int i[8]; + char s[JMSG_STR_PARM_MAX]; + } msg_parm; + + /* Standard state variables for error facility */ + + int trace_level; /* max msg_level that will be displayed */ + + /* For recoverable corrupt-data errors, we emit a warning message, + * but keep going unless emit_message chooses to abort. emit_message + * should count warnings in num_warnings. The surrounding application + * can check for bad data by seeing if num_warnings is nonzero at the + * end of processing. + */ + long num_warnings; /* number of corrupt-data warnings */ + + /* These fields point to the table(s) of error message strings. + * An application can change the table pointer to switch to a different + * message list (typically, to change the language in which errors are + * reported). Some applications may wish to add additional error codes + * that will be handled by the JPEG library error mechanism; the second + * table pointer is used for this purpose. + * + * First table includes all errors generated by JPEG library itself. + * Error code 0 is reserved for a "no such error string" message. + */ + const char * const * jpeg_message_table; /* Library errors */ + int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ + /* Second table can be added by application (see cjpeg/djpeg for example). + * It contains strings numbered first_addon_message..last_addon_message. + */ + const char * const * addon_message_table; /* Non-library errors */ + int first_addon_message; /* code for first string in addon table */ + int last_addon_message; /* code for last string in addon table */ +}; + + +/* Progress monitor object */ + +struct jpeg_progress_mgr { + JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); + + long pass_counter; /* work units completed in this pass */ + long pass_limit; /* total number of work units in this pass */ + int completed_passes; /* passes completed so far */ + int total_passes; /* total number of passes expected */ +}; + + +/* Data destination object for compression */ + +struct jpeg_destination_mgr { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + + JMETHOD(void, init_destination, (j_compress_ptr cinfo)); + JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); + JMETHOD(void, term_destination, (j_compress_ptr cinfo)); +}; + + +/* Data source object for decompression */ + +struct jpeg_source_mgr { + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + + JMETHOD(void, init_source, (j_decompress_ptr cinfo)); + JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); + JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); + JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); + JMETHOD(void, term_source, (j_decompress_ptr cinfo)); +}; + + +/* Memory manager object. + * Allocates "small" objects (a few K total), "large" objects (tens of K), + * and "really big" objects (virtual arrays with backing store if needed). + * The memory manager does not allow individual objects to be freed; rather, + * each created object is assigned to a pool, and whole pools can be freed + * at once. This is faster and more convenient than remembering exactly what + * to free, especially where malloc()/free() are not too speedy. + * NB: alloc routines never return NULL. They exit to error_exit if not + * successful. + */ + +#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ +#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ +#define JPOOL_NUMPOOLS 2 + +typedef struct jvirt_sarray_control * jvirt_sarray_ptr; +typedef struct jvirt_barray_control * jvirt_barray_ptr; + + +#ifdef C_LOSSLESS_SUPPORTED +#define NEED_DARRAY +#else +#ifdef D_LOSSLESS_SUPPORTED +#define NEED_DARRAY +#endif +#endif + +struct jpeg_memory_mgr { + /* Method pointers */ + JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, + JDIMENSION numrows)); + JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, + JDIMENSION numrows)); +#ifdef NEED_DARRAY + JMETHOD(JDIFFARRAY, alloc_darray, (j_common_ptr cinfo, int pool_id, + JDIMENSION diffsperrow, + JDIMENSION numrows)); +#endif + JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION samplesperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION blocksperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); + JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, + jvirt_sarray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, + jvirt_barray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); + JMETHOD(void, self_destruct, (j_common_ptr cinfo)); + + /* Limit on memory allocation for this JPEG object. (Note that this is + * merely advisory, not a guaranteed maximum; it only affects the space + * used for virtual-array buffers.) May be changed by outer application + * after creating the JPEG object. + */ + long max_memory_to_use; + + /* Maximum allocation request accepted by alloc_large. */ + long max_alloc_chunk; +}; + + +/* Routine signature for application-supplied marker processing methods. + * Need not pass marker code since it is stored in cinfo->unread_marker. + */ +typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); + + +/* Declarations for routines called by application. + * The JPP macro hides prototype parameters from compilers that can't cope. + * Note JPP requires double parentheses. + */ + +#ifdef HAVE_PROTOTYPES +#define JPP(arglist) arglist +#else +#define JPP(arglist) () +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. + * We shorten external names to be unique in the first six letters, which + * is good enough for all known systems. + * (If your compiler itself needs names to be unique in less than 15 + * characters, you are out of luck. Get a better compiler.) + */ + +/* MAKE SURE THAT ALL FUNCTIONS DECLARED GLOBAL() ARE RE-DEFINED HERE! */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jcopy_block_row jcopy16_block_row +#define jcopy_sample_rows jcopy16_sample_rows +#define jdiv_round_up jdiv16_round_up +#define jinit_1pass_quantizer jinit16_1pass_quantizer +#define jinit_2pass_quantizer jinit16_2pass_quantizer +#define jinit_arith_decoder jinit16_arith_decoder +#define jinit_arith_encoder jinit16_arith_encoder +#define jinit_c_codec jinit16_c_codec +#define jinit_c_coef_controller jinit16_c_coef_controller +#define jinit_c_diff_controller jinit16_c_diff_controller +#define jinit_c_main_controller jinit16_c_main_controller +#define jinit_c_master_control jinit16_c_master_control +#define jinit_c_prep_controller jinit16_c_prep_controller +#define jinit_c_scaler jinit16_c_scaler +#define jinit_color_converter jinit16_color_converter +#define jinit_color_deconverter jinit16_color_deconverter +#define jinit_compress_master jinit16_compress_master +#define jinit_d_codec jinit16_d_codec +#define jinit_d_coef_controller jinit16_d_coef_controller +#define jinit_d_diff_controller jinit16_d_diff_controller +#define jinit_d_main_controller jinit16_d_main_controller +#define jinit_d_post_controller jinit16_d_post_controller +#define jinit_d_post_controller jinit16_d_post_controller +#define jinit_d_scaler jinit16_d_scaler +#define jinit_differencer jinit16_differencer +#define jinit_downsampler jinit16_downsampler +#define jinit_forward_dct jinit16_forward_dct +#define jinit_input_controller jinit16_input_controller +#define jinit_inverse_dct jinit16_inverse_dct +#define jinit_lhuff_decoder jinit16_lhuff_decoder +#define jinit_lhuff_encoder jinit16_lhuff_encoder +#define jinit_lossless_c_codec jinit16_lossless_c_codec +#define jinit_lossless_d_codec jinit16_lossless_d_codec +#define jinit_lossy_c_codec jinit16_lossy_c_codec +#define jinit_lossy_d_codec jinit16_lossy_d_codec +#define jinit_marker_reader jinit16_marker_reader +#define jinit_marker_writer jinit16_marker_writer +#define jinit_master_decompress jinit16_master_decompress +#define jinit_memory_mgr jinit16_memory_mgr +#define jinit_merged_upsampler jinit16_merged_upsampler +#define jinit_phuff_decoder jinit16_phuff_decoder +#define jinit_phuff_encoder jinit16_phuff_encoder +#define jinit_shuff_decoder jinit16_shuff_decoder +#define jinit_shuff_encoder jinit16_shuff_encoder +#define jinit_undifferencer jinit16_undifferencer +#define jinit_upsampler jinit16_upsampler +#define jpeg_CreateCompress jpeg16_CreateCompress +#define jpeg_CreateDecompress jpeg16_CreateDecompress +#define jpeg_abort jpeg16_abort +#define jpeg_abort_compress jpeg16_abort_compress +#define jpeg_abort_decompress jpeg16_abort_decompress +#define jpeg_add_quant_table jpeg16_add_quant_table +#define jpeg_alloc_huff_table jpeg16_alloc_huff_table +#define jpeg_alloc_quant_table jpeg16_alloc_quant_table +#define jpeg_calc_output_dimensions jpeg16_calc_output_dimensions +#define jpeg_consume_input jpeg16_consume_input +#define jpeg_copy_critical_parameters jpeg16_copy_critical_parameters +#define jpeg_default_colorspace jpeg16_default_colorspace +#define jpeg_destroy jpeg16_destroy +#define jpeg_destroy_compress jpeg16_destroy_compress +#define jpeg_destroy_decompress jpeg16_destroy_decompress +#define jpeg_fdct_float jpeg16_fdct_float +#define jpeg_fdct_ifast jpeg16_fdct_ifast +#define jpeg_fdct_islow jpeg16_fdct_islow +#define jpeg_fill_bit_buffer jpeg16_fill_bit_buffer +#define jpeg_finish_compress jpeg16_finish_compress +#define jpeg_finish_decompress jpeg16_finish_decompress +#define jpeg_finish_output jpeg16_finish_output +#define jpeg_free_large jpeg16_free_large +#define jpeg_free_small jpeg16_free_small +#define jpeg_gen_optimal_table jpeg16_gen_optimal_table +#define jpeg_get_large jpeg16_get_large +#define jpeg_get_small jpeg16_get_small +#define jpeg_has_multiple_scans jpeg16_has_multiple_scans +#define jpeg_huff_decode jpeg16_huff_decode +#define jpeg_idct_1x1 jpeg16_idct_1x1 +#define jpeg_idct_2x2 jpeg16_idct_2x2 +#define jpeg_idct_4x4 jpeg16_idct_4x4 +#define jpeg_idct_float jpeg16_idct_float +#define jpeg_idct_ifast jpeg16_idct_ifast +#define jpeg_idct_islow jpeg16_idct_islow +#define jpeg_input_complete jpeg16_input_complete +#define jpeg_make_c_derived_tbl jpeg16_make_c_derived_tbl +#define jpeg_make_d_derived_tbl jpeg16_make_d_derived_tbl +#define jpeg_mem_available jpeg16_mem_available +#define jpeg_mem_init jpeg16_mem_init +#define jpeg_mem_term jpeg16_mem_term +#define jpeg_new_colormap jpeg16_new_colormap +#define jpeg_open_backing_store jpeg16_open_backing_store +#define jpeg_quality_scaling jpeg16_quality_scaling +#define jpeg_read_coefficients jpeg16_read_coefficients +#define jpeg_read_header jpeg16_read_header +#define jpeg_read_raw_data jpeg16_read_raw_data +#define jpeg_read_scanlines jpeg16_read_scanlines +#define jpeg_resync_to_restart jpeg16_resync_to_restart +#define jpeg_save_markers jpeg16_save_markers +#define jpeg_set_colorspace jpeg16_set_colorspace +#define jpeg_set_defaults jpeg16_set_defaults +#define jpeg_set_linear_quality jpeg16_set_linear_quality +#define jpeg_set_marker_processor jpeg16_set_marker_processor +#define jpeg_set_quality jpeg16_set_quality +#define jpeg_simple_lossless jpeg16_simple_lossless +#define jpeg_simple_progression jpeg16_simple_progression +#define jpeg_start_compress jpeg16_start_compress +#define jpeg_start_decompress jpeg16_start_decompress +#define jpeg_start_output jpeg16_start_output +#define jpeg_std_error jpeg16_std_error +#define jpeg_stdio_dest jpeg16_stdio_dest +#define jpeg_stdio_src jpeg16_stdio_src +#define jpeg_suppress_tables jpeg16_suppress_tables +#define jpeg_write_coefficients jpeg16_write_coefficients +#define jpeg_write_m_byte jpeg16_write_m_byte +#define jpeg_write_m_header jpeg16_write_m_header +#define jpeg_write_marker jpeg16_write_marker +#define jpeg_write_raw_data jpeg16_write_raw_data +#define jpeg_write_scanlines jpeg16_write_scanlines +#define jpeg_write_tables jpeg16_write_tables +#define jround_up jround16_up +#define jzero_far jzero16_far +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Default error-management setup */ +EXTERN(struct jpeg_error_mgr *) jpeg_std_error + JPP((struct jpeg_error_mgr * err)); + +/* Initialization of JPEG compression objects. + * jpeg_create_compress() and jpeg_create_decompress() are the exported + * names that applications should call. These expand to calls on + * jpeg_CreateCompress and jpeg_CreateDecompress with additional information + * passed for version mismatch checking. + * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. + */ +#define jpeg_create_compress(cinfo) \ + jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_compress_struct)) +#define jpeg_create_decompress(cinfo) \ + jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_decompress_struct)) +EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, + int version, size_t structsize)); +EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, + int version, size_t structsize)); +/* Destruction of JPEG compression objects */ +EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); + +/* Standard data source and destination managers: stdio streams. */ +/* Caller is responsible for opening the file before and closing after. */ +EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); +EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); + +/* Default parameter setup for compression */ +EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); +/* Compression parameter setup aids */ +EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, + J_COLOR_SPACE colorspace)); +EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, + boolean force_baseline)); +EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, + int scale_factor, + boolean force_baseline)); +EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, + boolean force_baseline)); +EXTERN(int) jpeg_quality_scaling JPP((int quality)); +EXTERN(void) jpeg_simple_lossless JPP((j_compress_ptr cinfo, + int predictor, int point_transform)); +EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, + boolean suppress)); +EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); +EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); + +/* Main entry points for compression */ +EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, + boolean write_all_tables)); +EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION num_lines)); +EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); + +/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION num_lines)); + +/* Write a special marker. See libjpeg.doc concerning safe usage. */ +EXTERN(void) jpeg_write_marker + JPP((j_compress_ptr cinfo, int marker, + const JOCTET * dataptr, unsigned int datalen)); +/* Same, but piecemeal. */ +EXTERN(void) jpeg_write_m_header + JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); +EXTERN(void) jpeg_write_m_byte + JPP((j_compress_ptr cinfo, int val)); + +/* Alternate compression function: just write an abbreviated table file */ +EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); + +/* Decompression startup: read start of JPEG datastream to see what's there */ +EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, + boolean require_image)); +/* Return value is one of: */ +#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ +#define JPEG_HEADER_OK 1 /* Found valid image datastream */ +#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ +/* If you pass require_image = TRUE (normal case), you need not check for + * a TABLES_ONLY return code; an abbreviated file will cause an error exit. + * JPEG_SUSPENDED is only possible if you use a data source module that can + * give a suspension return (the stdio source module doesn't). + */ + +/* Main entry points for decompression */ +EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION max_lines)); +EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); + +/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION max_lines)); + +/* Additional entry points for buffered-image mode. */ +EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, + int scan_number)); +EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); +EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); +/* Return value is one of: */ +/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ +#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ +#define JPEG_REACHED_EOI 2 /* Reached end of image */ +#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ +#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ + +/* Precalculate output dimensions for current decompression parameters. */ +EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); + +/* Control saving of COM and APPn markers into marker_list. */ +EXTERN(void) jpeg_save_markers + JPP((j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit)); + +/* Install a special processing method for COM or APPn markers. */ +EXTERN(void) jpeg_set_marker_processor + JPP((j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine)); + +/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ +EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays)); +EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, + j_compress_ptr dstinfo)); + +/* If you choose to abort compression or decompression before completing + * jpeg_finish_(de)compress, then you need to clean up to release memory, + * temporary files, etc. You can just call jpeg_destroy_(de)compress + * if you're done with the JPEG object, but if you want to clean it up and + * reuse it, call this: + */ +EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); + +/* Generic versions of jpeg_abort and jpeg_destroy that work on either + * flavor of JPEG object. These may be more convenient in some places. + */ +EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); + +/* Default restart-marker-resync procedure for use by data source modules */ +EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, + int desired)); + + +/* These marker codes are exported since applications and data source modules + * are likely to want to use them. + */ + +#define JPEG_RST0 0xD0 /* RST0 marker code */ +#define JPEG_EOI 0xD9 /* EOI marker code */ +#define JPEG_APP0 0xE0 /* APP0 marker code */ +#define JPEG_COM 0xFE /* COM marker code */ + + +/* If we have a brain-damaged compiler that emits warnings (or worse, errors) + * for structure definitions that are never filled in, keep it quiet by + * supplying dummy definitions for the various substructures. + */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +struct jpeg_comp_master { long dummy; }; +struct jpeg_c_main_controller { long dummy; }; +struct jpeg_c_prep_controller { long dummy; }; +struct jpeg_c_coef_controller { long dummy; }; +struct jpeg_marker_writer { long dummy; }; +struct jpeg_color_converter { long dummy; }; +struct jpeg_downsampler { long dummy; }; +struct jpeg_forward_dct { long dummy; }; +struct jpeg_entropy_encoder { long dummy; }; +struct jpeg_decomp_master { long dummy; }; +struct jpeg_d_main_controller { long dummy; }; +struct jpeg_d_coef_controller { long dummy; }; +struct jpeg_d_post_controller { long dummy; }; +struct jpeg_input_controller { long dummy; }; +struct jpeg_marker_reader { long dummy; }; +struct jpeg_entropy_decoder { long dummy; }; +struct jpeg_inverse_dct { long dummy; }; +struct jpeg_upsampler { long dummy; }; +struct jpeg_color_deconverter { long dummy; }; +struct jpeg_color_quantizer { long dummy; }; +#endif /* JPEG_INTERNALS */ +#endif /* INCOMPLETE_TYPES_BROKEN */ + + +/* + * The JPEG library modules define JPEG_INTERNALS before including this file. + * The internal structure declarations are read only when that is true. + * Applications using the library should not include jpegint.h, but may wish + * to include jerror.h. + */ + +#ifdef JPEG_INTERNALS +#include "jpegint16.h" /* fetch private declarations */ +#include "jerror16.h" /* fetch error codes too */ +#endif + +#endif /* JPEGLIB_H */ diff --git a/dcmjpeg/libijg16/jquant1.c b/dcmjpeg/libijg16/jquant1.c new file mode 100644 index 00000000..4077fbb5 --- /dev/null +++ b/dcmjpeg/libijg16/jquant1.c @@ -0,0 +1,856 @@ +/* + * jquant1.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 1-pass color quantization (color mapping) routines. + * These routines provide mapping to a fixed color map using equally spaced + * color values. Optional Floyd-Steinberg or ordered dithering is available. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + +#ifdef QUANT_1PASS_SUPPORTED + + +/* + * The main purpose of 1-pass quantization is to provide a fast, if not very + * high quality, colormapped output capability. A 2-pass quantizer usually + * gives better visual quality; however, for quantized grayscale output this + * quantizer is perfectly adequate. Dithering is highly recommended with this + * quantizer, though you can turn it off if you really want to. + * + * In 1-pass quantization the colormap must be chosen in advance of seeing the + * image. We use a map consisting of all combinations of Ncolors[i] color + * values for the i'th component. The Ncolors[] values are chosen so that + * their product, the total number of colors, is no more than that requested. + * (In most cases, the product will be somewhat less.) + * + * Since the colormap is orthogonal, the representative value for each color + * component can be determined without considering the other components; + * then these indexes can be combined into a colormap index by a standard + * N-dimensional-array-subscript calculation. Most of the arithmetic involved + * can be precalculated and stored in the lookup table colorindex[]. + * colorindex[i][j] maps pixel value j in component i to the nearest + * representative value (grid plane) for that component; this index is + * multiplied by the array stride for component i, so that the + * index of the colormap entry closest to a given pixel value is just + * sum( colorindex[component-number][pixel-component-value] ) + * Aside from being fast, this scheme allows for variable spacing between + * representative values with no additional lookup cost. + * + * If gamma correction has been applied in color conversion, it might be wise + * to adjust the color grid spacing so that the representative colors are + * equidistant in linear space. At this writing, gamma correction is not + * implemented by jdcolor, so nothing is done here. + */ + + +/* Declarations for ordered dithering. + * + * We use a standard 16x16 ordered dither array. The basic concept of ordered + * dithering is described in many references, for instance Dale Schumacher's + * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991). + * In place of Schumacher's comparisons against a "threshold" value, we add a + * "dither" value to the input pixel and then round the result to the nearest + * output value. The dither value is equivalent to (0.5 - threshold) times + * the distance between output values. For ordered dithering, we assume that + * the output colors are equally spaced; if not, results will probably be + * worse, since the dither may be too much or too little at a given point. + * + * The normal calculation would be to form pixel value + dither, range-limit + * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual. + * We can skip the separate range-limiting step by extending the colorindex + * table in both directions. + */ + +#define ODITHER_SIZE 16 /* dimension of dither matrix */ +/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */ +#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */ +#define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */ + +typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]; +typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE]; + +static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { + /* Bayer's order-4 dither array. Generated by the code given in + * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I. + * The values in this array must range from 0 to ODITHER_CELLS-1. + */ + { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }, + { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 }, + { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 }, + { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 }, + { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 }, + { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 }, + { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 }, + { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 }, + { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 }, + { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 }, + { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 }, + { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 }, + { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 }, + { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 }, + { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 }, + { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 } +}; + + +/* Declarations for Floyd-Steinberg dithering. + * + * Errors are accumulated into the array fserrors[], at a resolution of + * 1/16th of a pixel count. The error at a given pixel is propagated + * to its not-yet-processed neighbors using the standard F-S fractions, + * ... (here) 7/16 + * 3/16 5/16 1/16 + * We work left-to-right on even rows, right-to-left on odd rows. + * + * We can get away with a single array (holding one row's worth of errors) + * by using it to store the current row's errors at pixel columns not yet + * processed, but the next row's errors at columns already processed. We + * need only a few extra variables to hold the errors immediately around the + * current column. (If we are lucky, those variables are in registers, but + * even if not, they're probably cheaper to access than array elements are.) + * + * The fserrors[] array is indexed [component#][position]. + * We provide (#columns + 2) entries per component; the extra entry at each + * end saves us from special-casing the first and last pixels. + * + * Note: on a wide image, we might not have enough room in a PC's near data + * segment to hold the error array; so it is allocated with alloc_large. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef INT16 FSERROR; /* 16 bits should be enough */ +typedef int LOCFSERROR; /* use 'int' for calculation temps */ +#else +typedef IJG_INT32 FSERROR; /* may need more than 16 bits */ +typedef IJG_INT32 LOCFSERROR; /* be sure calculation temps are big enough */ +#endif + +typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */ + + +/* Private subobject */ + +#define MAX_Q_COMPS 4 /* max components I can handle */ + +typedef struct { + struct jpeg_color_quantizer pub; /* public fields */ + + /* Initially allocated colormap is saved here */ + JSAMPARRAY sv_colormap; /* The color map as a 2-D pixel array */ + int sv_actual; /* number of entries in use */ + + JSAMPARRAY colorindex; /* Precomputed mapping for speed */ + /* colorindex[i][j] = index of color closest to pixel value j in component i, + * premultiplied as described above. Since colormap indexes must fit into + * JSAMPLEs, the entries of this array will too. + */ + boolean is_padded; /* is the colorindex padded for odither? */ + + int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */ + + /* Variables for ordered dithering */ + int row_index; /* cur row's vertical index in dither matrix */ + ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */ + + /* Variables for Floyd-Steinberg dithering */ + FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ + boolean on_odd_row; /* flag to remember which row we are on */ +} my_cquantizer; + +typedef my_cquantizer * my_cquantize_ptr; + + +/* + * Policy-making subroutines for create_colormap and create_colorindex. + * These routines determine the colormap to be used. The rest of the module + * only assumes that the colormap is orthogonal. + * + * * select_ncolors decides how to divvy up the available colors + * among the components. + * * output_value defines the set of representative values for a component. + * * largest_input_value defines the mapping from input values to + * representative values for a component. + * Note that the latter two routines may impose different policies for + * different components, though this is not currently done. + */ + + +LOCAL(int) +select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) +/* Determine allocation of desired colors to components, */ +/* and fill in Ncolors[] array to indicate choice. */ +/* Return value is total number of colors (product of Ncolors[] values). */ +{ + int nc = cinfo->out_color_components; /* number of color components */ + int max_colors = cinfo->desired_number_of_colors; + int total_colors, iroot, i, j; + boolean changed; + long temp; + static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }; + + /* We can allocate at least the nc'th root of max_colors per component. */ + /* Compute floor(nc'th root of max_colors). */ + iroot = 1; + do { + iroot++; + temp = iroot; /* set temp = iroot ** nc */ + for (i = 1; i < nc; i++) + temp *= iroot; + } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */ + iroot--; /* now iroot = floor(root) */ + + /* Must have at least 2 color values per component */ + if (iroot < 2) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp); + + /* Initialize to iroot color values for each component */ + total_colors = 1; + for (i = 0; i < nc; i++) { + Ncolors[i] = iroot; + total_colors *= iroot; + } + /* We may be able to increment the count for one or more components without + * exceeding max_colors, though we know not all can be incremented. + * Sometimes, the first component can be incremented more than once! + * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.) + * In RGB colorspace, try to increment G first, then R, then B. + */ + do { + changed = FALSE; + for (i = 0; i < nc; i++) { + j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); + /* calculate new total_colors if Ncolors[j] is incremented */ + temp = total_colors / Ncolors[j]; + temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */ + if (temp > (long) max_colors) + break; /* won't fit, done with this pass */ + Ncolors[j]++; /* OK, apply the increment */ + total_colors = (int) temp; + changed = TRUE; + } + } while (changed); + + return total_colors; +} + + +LOCAL(int) +output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return j'th output value, where j will range from 0 to maxj */ +/* The output values must fall in 0..MAXJSAMPLE in increasing order */ +{ + /* We always provide values 0 and MAXJSAMPLE for each component; + * any additional values are equally spaced between these limits. + * (Forcing the upper and lower values to the limits ensures that + * dithering can't produce a color outside the selected gamut.) + */ + return (int) (((IJG_INT32) j * MAXJSAMPLE + maxj/2) / maxj); +} + + +LOCAL(int) +largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return largest input value that should map to j'th output value */ +/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ +{ + /* Breakpoints are halfway between values returned by output_value */ + return (int) (((IJG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); +} + + +/* + * Create the colormap. + */ + +LOCAL(void) +create_colormap (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colormap; /* Created colormap */ + int total_colors; /* Number of distinct output colors */ + int i,j,k, nci, blksize, blkdist, ptr, val; + + /* Select number of colors for each component */ + total_colors = select_ncolors(cinfo, cquantize->Ncolors); + + /* Report selected color counts */ + if (cinfo->out_color_components == 3) + TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS, + total_colors, cquantize->Ncolors[0], + cquantize->Ncolors[1], cquantize->Ncolors[2]); + else + TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors); + + /* Allocate and fill in the colormap. */ + /* The colors are ordered in the map in standard row-major order, */ + /* i.e. rightmost (highest-indexed) color changes most rapidly. */ + + colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + /* blkdist is distance between groups of identical entries for a component */ + blkdist = total_colors; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colormap entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blkdist / nci; + for (j = 0; j < nci; j++) { + /* Compute j'th output value (out of nci) for component */ + val = output_value(cinfo, i, j, nci-1); + /* Fill in all colormap entries that have this value of this component */ + for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) { + /* fill in blksize entries beginning at ptr */ + for (k = 0; k < blksize; k++) + colormap[i][ptr+k] = (JSAMPLE) val; + } + } + blkdist = blksize; /* blksize of this color is blkdist of next */ + } + + /* Save the colormap in private storage, + * where it will survive color quantization mode changes. + */ + cquantize->sv_colormap = colormap; + cquantize->sv_actual = total_colors; +} + + +/* + * Create the color index table. + */ + +LOCAL(void) +create_colorindex (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPROW indexptr; + int i,j,k, nci, blksize, val, pad; + + /* For ordered dither, we pad the color index tables by MAXJSAMPLE in + * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE). + * This is not necessary in the other dithering modes. However, we + * flag whether it was done in case user changes dithering mode. + */ + if (cinfo->dither_mode == JDITHER_ORDERED) { + pad = MAXJSAMPLE*2; + cquantize->is_padded = TRUE; + } else { + pad = 0; + cquantize->is_padded = FALSE; + } + + cquantize->colorindex = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (MAXJSAMPLE+1 + pad), + (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + blksize = cquantize->sv_actual; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colorindex entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blksize / nci; + + /* adjust colorindex pointers to provide padding at negative indexes. */ + if (pad) + cquantize->colorindex[i] += MAXJSAMPLE; + + /* in loop, val = index of current output value, */ + /* and k = largest j that maps to current val */ + indexptr = cquantize->colorindex[i]; + val = 0; + k = largest_input_value(cinfo, i, 0, nci-1); + for (j = 0; j <= MAXJSAMPLE; j++) { + while (j > k) /* advance val if past boundary */ + k = largest_input_value(cinfo, i, ++val, nci-1); + /* premultiply so that no multiplication needed in main processing */ + indexptr[j] = (JSAMPLE) (val * blksize); + } + /* Pad at both ends if necessary */ + if (pad) + for (j = 1; j <= MAXJSAMPLE; j++) { + indexptr[-j] = indexptr[0]; + indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE]; + } + } +} + + +/* + * Create an ordered-dither array for a component having ncolors + * distinct output values. + */ + +LOCAL(ODITHER_MATRIX_PTR) +make_odither_array (j_decompress_ptr cinfo, int ncolors) +{ + ODITHER_MATRIX_PTR odither; + int j,k; + IJG_INT32 num,den; + + odither = (ODITHER_MATRIX_PTR) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(ODITHER_MATRIX)); + /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1). + * Hence the dither value for the matrix cell with fill order f + * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1). + * On 16-bit-int machine, be careful to avoid overflow. + */ + den = 2 * ODITHER_CELLS * ((IJG_INT32) (ncolors - 1)); + for (j = 0; j < ODITHER_SIZE; j++) { + for (k = 0; k < ODITHER_SIZE; k++) { + num = ((IJG_INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) + * MAXJSAMPLE; + /* Ensure round towards zero despite C's lack of consistency + * about rounding negative values in integer division... + */ + odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den); + } + } + return odither; +} + + +/* + * Create the ordered-dither tables. + * Components having the same number of representative colors may + * share a dither table. + */ + +LOCAL(void) +create_odither_tables (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + ODITHER_MATRIX_PTR odither; + int i, j, nci; + + for (i = 0; i < cinfo->out_color_components; i++) { + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + odither = NULL; /* search for matching prior component */ + for (j = 0; j < i; j++) { + if (nci == cquantize->Ncolors[j]) { + odither = cquantize->odither[j]; + break; + } + } + if (odither == NULL) /* need a new table? */ + odither = make_odither_array(cinfo, nci); + cquantize->odither[i] = odither; + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colorindex = cquantize->colorindex; + register int pixcode, ci; + register JSAMPROW ptrin, ptrout; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + register int nc = cinfo->out_color_components; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = 0; + for (ci = 0; ci < nc; ci++) { + pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]); + } + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW ptrin, ptrout; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]); + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + int * dither; /* points to active row of dither matrix */ + int row_index, col_index; /* current indexes into dither matrix */ + int nc = cinfo->out_color_components; + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + jzero_far((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + row_index = cquantize->row_index; + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + colorindex_ci = cquantize->colorindex[ci]; + dither = cquantize->odither[ci][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE, + * select output value, accumulate into output code for this pixel. + * Range-limiting need not be done explicitly, as we have extended + * the colorindex table to produce the right answers for out-of-range + * inputs. The maximum dither is +- MAXJSAMPLE; this sets the + * required amount of padding. + */ + *output_ptr = (JSAMPLE)(*output_ptr + colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]]); + input_ptr += nc; + output_ptr++; + col_index = (col_index + 1) & ODITHER_MASK; + } + } + /* Advance row index for next row */ + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int * dither0; /* points to active row of dither matrix */ + int * dither1; + int * dither2; + int row_index, col_index; /* current indexes into dither matrix */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + row_index = cquantize->row_index; + input_ptr = input_buf[row]; + output_ptr = output_buf[row]; + dither0 = cquantize->odither[0][row_index]; + dither1 = cquantize->odither[1][row_index]; + dither2 = cquantize->odither[2][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + + dither0[col_index]]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + + dither1[col_index]]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + + dither2[col_index]]); + *output_ptr++ = (JSAMPLE) pixcode; + col_index = (col_index + 1) & ODITHER_MASK; + } + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register LOCFSERROR cur; /* current error or pixel value */ + LOCFSERROR belowerr; /* error for pixel below cur */ + LOCFSERROR bpreverr; /* error for below/prev col */ + LOCFSERROR bnexterr; /* error for below/next col */ + LOCFSERROR delta; + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + JSAMPROW colormap_ci; + int pixcode; + int nc = cinfo->out_color_components; + int dir; /* 1 for left-to-right, -1 for right-to-left */ + int dirnc; /* dir * nc */ + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + jzero_far((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + input_ptr += (width-1) * (JDIMENSION)nc; /* so point to rightmost pixel */ + output_ptr += width-1; + dir = -1; + dirnc = -nc; + errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */ + } else { + /* work left to right in this row */ + dir = 1; + dirnc = nc; + errorptr = cquantize->fserrors[ci]; /* => entry before first column */ + } + colorindex_ci = cquantize->colorindex[ci]; + colormap_ci = cquantize->sv_colormap[ci]; + /* Preset error values: no error propagated to first pixel from left */ + cur = 0; + /* and no error propagated to row below yet */ + belowerr = bpreverr = 0; + + for (col = width; col > 0; col--) { + /* cur holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4); + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE; this sets the required size + * of the range_limit array. + */ + cur += GETJSAMPLE(*input_ptr); + cur = GETJSAMPLE(range_limit[cur]); + /* Select output value, accumulate into output code for this pixel */ + pixcode = GETJSAMPLE(colorindex_ci[cur]); + *output_ptr = (JSAMPLE)(*output_ptr + pixcode); + /* Compute actual representation error at this pixel */ + /* Note: we can do this even though we don't have the final */ + /* pixel code, because the colormap is orthogonal. */ + cur -= GETJSAMPLE(colormap_ci[pixcode]); + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + bnexterr = cur; + delta = cur * 2; + cur += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr + cur); + cur += delta; /* form error * 5 */ + bpreverr = belowerr + cur; + belowerr = bnexterr; + cur += delta; /* form error * 7 */ + /* At this point cur contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + input_ptr += dirnc; /* advance input ptr to next column */ + output_ptr += dir; /* advance output ptr to next column */ + errorptr += dir; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error value into the + * final fserrors[] entry. Note we need not unload belowerr because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */ + } + cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE); + } +} + + +/* + * Allocate workspace for Floyd-Steinberg errors. + */ + +LOCAL(void) +alloc_fs_workspace (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) { + cquantize->fserrors[i] = (FSERRPTR) + (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + } +} + + +/* + * Initialize for one-pass color quantization. + */ + +METHODDEF(void) +start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + /* Install my colormap. */ + cinfo->colormap = cquantize->sv_colormap; + cinfo->actual_number_of_colors = cquantize->sv_actual; + + /* Initialize for desired dithering mode. */ + switch (cinfo->dither_mode) { + case JDITHER_NONE: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = color_quantize3; + else + cquantize->pub.color_quantize = color_quantize; + break; + case JDITHER_ORDERED: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = quantize3_ord_dither; + else + cquantize->pub.color_quantize = quantize_ord_dither; + cquantize->row_index = 0; /* initialize state for ordered dither */ + /* If user changed to ordered dither from another mode, + * we must recreate the color index table with padding. + * This will cost extra space, but probably isn't very likely. + */ + if (! cquantize->is_padded) + create_colorindex(cinfo); + /* Create ordered-dither tables if we didn't already. */ + if (cquantize->odither[0] == NULL) + create_odither_tables(cinfo); + break; + case JDITHER_FS: + cquantize->pub.color_quantize = quantize_fs_dither; + cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */ + /* Allocate Floyd-Steinberg workspace if didn't already. */ + if (cquantize->fserrors[0] == NULL) + alloc_fs_workspace(cinfo); + /* Initialize the propagated errors to zero. */ + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) + jzero_far((void FAR *) cquantize->fserrors[i], arraysize); + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } +} + + +/* + * Finish up at the end of the pass. + */ + +METHODDEF(void) +finish_pass_1_quant (j_decompress_ptr cinfo) +{ + /* no work in 1-pass case */ +} + + +/* + * Switch to a new external colormap between output passes. + * Shouldn't get to this module! + */ + +METHODDEF(void) +new_color_map_1_quant (j_decompress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + + +/* + * Module initialization routine for 1-pass color quantization. + */ + +GLOBAL(void) +jinit_1pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_1_quant; + cquantize->pub.finish_pass = finish_pass_1_quant; + cquantize->pub.new_color_map = new_color_map_1_quant; + cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */ + cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */ + + /* Make sure my internal arrays won't overflow */ + if (cinfo->out_color_components > MAX_Q_COMPS) + ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1)) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1); + + /* Create the colormap and color index table. */ + create_colormap(cinfo); + create_colorindex(cinfo); + + /* Allocate Floyd-Steinberg workspace now if requested. + * We do this now since it is FAR storage and may affect the memory + * manager's space calculations. If the user changes to FS dither + * mode in a later pass, we will allocate the space then, and will + * possibly overrun the max_memory_to_use setting. + */ + if (cinfo->dither_mode == JDITHER_FS) + alloc_fs_workspace(cinfo); +} + +#endif /* QUANT_1PASS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jquant2.c b/dcmjpeg/libijg16/jquant2.c new file mode 100644 index 00000000..f62a992c --- /dev/null +++ b/dcmjpeg/libijg16/jquant2.c @@ -0,0 +1,1310 @@ +/* + * jquant2.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 2-pass color quantization (color mapping) routines. + * These routines provide selection of a custom color map for an image, + * followed by mapping of the image to that color map, with optional + * Floyd-Steinberg dithering. + * It is also possible to use just the second pass to map to an arbitrary + * externally-given color map. + * + * Note: ordered dithering is not supported, since there isn't any fast + * way to compute intercolor distances; it's unclear that ordered dither's + * fundamental assumptions even hold with an irregularly spaced color map. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + +#ifdef QUANT_2PASS_SUPPORTED + + +/* + * This module implements the well-known Heckbert paradigm for color + * quantization. Most of the ideas used here can be traced back to + * Heckbert's seminal paper + * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", + * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. + * + * In the first pass over the image, we accumulate a histogram showing the + * usage count of each possible color. To keep the histogram to a reasonable + * size, we reduce the precision of the input; typical practice is to retain + * 5 or 6 bits per color, so that 8 or 4 different input values are counted + * in the same histogram cell. + * + * Next, the color-selection step begins with a box representing the whole + * color space, and repeatedly splits the "largest" remaining box until we + * have as many boxes as desired colors. Then the mean color in each + * remaining box becomes one of the possible output colors. + * + * The second pass over the image maps each input pixel to the closest output + * color (optionally after applying a Floyd-Steinberg dithering correction). + * This mapping is logically trivial, but making it go fast enough requires + * considerable care. + * + * Heckbert-style quantizers vary a good deal in their policies for choosing + * the "largest" box and deciding where to cut it. The particular policies + * used here have proved out well in experimental comparisons, but better ones + * may yet be found. + * + * In earlier versions of the IJG code, this module quantized in YCbCr color + * space, processing the raw upsampled data without a color conversion step. + * This allowed the color conversion math to be done only once per colormap + * entry, not once per pixel. However, that optimization precluded other + * useful optimizations (such as merging color conversion with upsampling) + * and it also interfered with desired capabilities such as quantizing to an + * externally-supplied colormap. We have therefore abandoned that approach. + * The present code works in the post-conversion color space, typically RGB. + * + * To improve the visual quality of the results, we actually work in scaled + * RGB space, giving G distances more weight than R, and R in turn more than + * B. To do everything in integer math, we must use integer scale factors. + * The 2/3/1 scale factors used here correspond loosely to the relative + * weights of the colors in the NTSC grayscale equation. + * If you want to use this code to quantize a non-RGB color space, you'll + * probably need to change these scale factors. + */ + +#define R_SCALE 2 /* scale R distances by this much */ +#define G_SCALE 3 /* scale G distances by this much */ +#define B_SCALE 1 /* and B by this much */ + +/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined + * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B + * and B,G,R orders. If you define some other weird order in jmorecfg.h, + * you'll get compile errors until you extend this logic. In that case + * you'll probably want to tweak the histogram sizes too. + */ + +#if RGB_RED == 0 +#define C0_SCALE R_SCALE +#endif +#if RGB_BLUE == 0 +#define C0_SCALE B_SCALE +#endif +#if RGB_GREEN == 1 +#define C1_SCALE G_SCALE +#endif +#if RGB_RED == 2 +#define C2_SCALE R_SCALE +#endif +#if RGB_BLUE == 2 +#define C2_SCALE B_SCALE +#endif + + +/* + * First we have the histogram data structure and routines for creating it. + * + * The number of bits of precision can be adjusted by changing these symbols. + * We recommend keeping 6 bits for G and 5 each for R and B. + * If you have plenty of memory and cycles, 6 bits all around gives marginally + * better results; if you are short of memory, 5 bits all around will save + * some space but degrade the results. + * To maintain a fully accurate histogram, we'd need to allocate a "long" + * (preferably unsigned long) for each cell. In practice this is overkill; + * we can get by with 16 bits per cell. Few of the cell counts will overflow, + * and clamping those that do overflow to the maximum value will give close- + * enough results. This reduces the recommended histogram size from 256Kb + * to 128Kb, which is a useful savings on PC-class machines. + * (In the second pass the histogram space is re-used for pixel mapping data; + * in that capacity, each cell must be able to store zero to the number of + * desired colors. 16 bits/cell is plenty for that too.) + * Since the JPEG code is intended to run in small memory model on 80x86 + * machines, we can't just allocate the histogram in one chunk. Instead + * of a true 3-D array, we use a row of pointers to 2-D arrays. Each + * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and + * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that + * on 80x86 machines, the pointer row is in near memory but the actual + * arrays are in far memory (same arrangement as we use for image arrays). + */ + +#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ + +/* These will do the right thing for either R,G,B or B,G,R color order, + * but you may not like the results for other color orders. + */ +#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ +#define HIST_C1_BITS 6 /* bits of precision in G histogram */ +#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ + +/* Number of elements along histogram axes. */ +#define HIST_C0_ELEMS (1<cquantize; + register JSAMPROW ptr; + register histptr histp; + register hist3d histogram = cquantize->histogram; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptr = input_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the histogram */ + histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT] + [GETJSAMPLE(ptr[1]) >> C1_SHIFT] + [GETJSAMPLE(ptr[2]) >> C2_SHIFT]; + /* increment, check for overflow and undo increment if so. */ + if (++(*histp) <= 0) + (*histp)--; + ptr += 3; + } + } +} + + +/* + * Next we have the really interesting routines: selection of a colormap + * given the completed histogram. + * These routines work with a list of "boxes", each representing a rectangular + * subset of the input color space (to histogram precision). + */ + +typedef struct { + /* The bounds of the box (inclusive); expressed as histogram indexes */ + int c0min, c0max; + int c1min, c1max; + int c2min, c2max; + /* The volume (actually 2-norm) of the box */ + IJG_INT32 volume; + /* The number of nonzero histogram cells within this box */ + long colorcount; +} box; + +typedef box * boxptr; + + +LOCAL(boxptr) +find_biggest_color_pop (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest color population */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register long maxc = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->colorcount > maxc && boxp->volume > 0) { + which = boxp; + maxc = boxp->colorcount; + } + } + return which; +} + + +LOCAL(boxptr) +find_biggest_volume (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest (scaled) volume */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register IJG_INT32 maxv = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->volume > maxv) { + which = boxp; + maxv = boxp->volume; + } + } + return which; +} + + +LOCAL(void) +update_box (j_decompress_ptr cinfo, boxptr boxp) +/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ +/* and recompute its volume and population */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + IJG_INT32 dist0,dist1,dist2; + long ccount; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + if (c0max > c0min) + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0min = c0min = c0; + goto have_c0min; + } + } + have_c0min: + if (c0max > c0min) + for (c0 = c0max; c0 >= c0min; c0--) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0max = c0max = c0; + goto have_c0max; + } + } + have_c0max: + if (c1max > c1min) + for (c1 = c1min; c1 <= c1max; c1++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1min = c1min = c1; + goto have_c1min; + } + } + have_c1min: + if (c1max > c1min) + for (c1 = c1max; c1 >= c1min; c1--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1max = c1max = c1; + goto have_c1max; + } + } + have_c1max: + if (c2max > c2min) + for (c2 = c2min; c2 <= c2max; c2++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2min = c2min = c2; + goto have_c2min; + } + } + have_c2min: + if (c2max > c2min) + for (c2 = c2max; c2 >= c2min; c2--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2max = c2max = c2; + goto have_c2max; + } + } + have_c2max: + + /* Update box volume. + * We use 2-norm rather than real volume here; this biases the method + * against making long narrow boxes, and it has the side benefit that + * a box is splittable iff norm > 0. + * Since the differences are expressed in histogram-cell units, + * we have to shift back to JSAMPLE units to get consistent distances; + * after which, we scale according to the selected distance scale factors. + */ + dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; + dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; + dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; + boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2; + + /* Now scan remaining volume of box and compute population */ + ccount = 0; + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++, histp++) + if (*histp != 0) { + ccount++; + } + } + boxp->colorcount = ccount; +} + + +LOCAL(int) +median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, + int desired_colors) +/* Repeatedly select and split the largest box until we have enough boxes */ +{ + int n,lb; + int c0,c1,c2,cmax; + register boxptr b1,b2; + + while (numboxes < desired_colors) { + /* Select box to split. + * Current algorithm: by population for first half, then by volume. + */ + if (numboxes*2 <= desired_colors) { + b1 = find_biggest_color_pop(boxlist, numboxes); + } else { + b1 = find_biggest_volume(boxlist, numboxes); + } + if (b1 == NULL) /* no splittable boxes left! */ + break; + b2 = &boxlist[numboxes]; /* where new box will go */ + /* Copy the color bounds to the new box. */ + b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; + b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; + /* Choose which axis to split the box on. + * Current algorithm: longest scaled axis. + * See notes in update_box about scaling distances. + */ + c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; + c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; + c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; + /* We want to break any ties in favor of green, then red, blue last. + * This code does the right thing for R,G,B or B,G,R color orders only. + */ +#if RGB_RED == 0 + cmax = c1; n = 1; + if (c0 > cmax) { cmax = c0; n = 0; } + if (c2 > cmax) { n = 2; } +#else + cmax = c1; n = 1; + if (c2 > cmax) { cmax = c2; n = 2; } + if (c0 > cmax) { n = 0; } +#endif + /* Choose split point along selected axis, and update box bounds. + * Current algorithm: split at halfway point. + * (Since the box has been shrunk to minimum volume, + * any split will produce two nonempty subboxes.) + * Note that lb value is max for lower box, so must be < old max. + */ + switch (n) { + case 0: + lb = (b1->c0max + b1->c0min) / 2; + b1->c0max = lb; + b2->c0min = lb+1; + break; + case 1: + lb = (b1->c1max + b1->c1min) / 2; + b1->c1max = lb; + b2->c1min = lb+1; + break; + case 2: + lb = (b1->c2max + b1->c2min) / 2; + b1->c2max = lb; + b2->c2min = lb+1; + break; + } + /* Update stats for boxes */ + update_box(cinfo, b1); + update_box(cinfo, b2); + numboxes++; + } + return numboxes; +} + + +LOCAL(void) +compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) +/* Compute representative color for a box, put it in colormap[icolor] */ +{ + /* Current algorithm: mean weighted by pixels (not colors) */ + /* Note it is important to get the rounding correct! */ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + long count; + long total = 0; + long c0total = 0; + long c1total = 0; + long c2total = 0; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) { + if ((count = *histp++) != 0) { + total += count; + c0total += ((c0 << C0_SHIFT) + ((1<>1)) * count; + c1total += ((c1 << C1_SHIFT) + ((1<>1)) * count; + c2total += ((c2 << C2_SHIFT) + ((1<>1)) * count; + } + } + } + + cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); + cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); + cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); +} + + +LOCAL(void) +select_colors (j_decompress_ptr cinfo, int desired_colors) +/* Master routine for color selection */ +{ + boxptr boxlist; + int numboxes; + int i; + + /* Allocate workspace for box list */ + boxlist = (boxptr) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (size_t)desired_colors * SIZEOF(box)); + /* Initialize one box containing whole space */ + numboxes = 1; + boxlist[0].c0min = 0; + boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; + boxlist[0].c1min = 0; + boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; + boxlist[0].c2min = 0; + boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; + /* Shrink it to actually-used volume and set its statistics */ + update_box(cinfo, & boxlist[0]); + /* Perform median-cut to produce final box list */ + numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors); + /* Compute the representative color for each box, fill colormap */ + for (i = 0; i < numboxes; i++) + compute_color(cinfo, & boxlist[i], i); + cinfo->actual_number_of_colors = numboxes; + TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes); +} + + +/* + * These routines are concerned with the time-critical task of mapping input + * colors to the nearest color in the selected colormap. + * + * We re-use the histogram space as an "inverse color map", essentially a + * cache for the results of nearest-color searches. All colors within a + * histogram cell will be mapped to the same colormap entry, namely the one + * closest to the cell's center. This may not be quite the closest entry to + * the actual input color, but it's almost as good. A zero in the cache + * indicates we haven't found the nearest color for that cell yet; the array + * is cleared to zeroes before starting the mapping pass. When we find the + * nearest color for a cell, its colormap index plus one is recorded in the + * cache for future use. The pass2 scanning routines call fill_inverse_cmap + * when they need to use an unfilled entry in the cache. + * + * Our method of efficiently finding nearest colors is based on the "locally + * sorted search" idea described by Heckbert and on the incremental distance + * calculation described by Spencer W. Thomas in chapter III.1 of Graphics + * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that + * the distances from a given colormap entry to each cell of the histogram can + * be computed quickly using an incremental method: the differences between + * distances to adjacent cells themselves differ by a constant. This allows a + * fairly fast implementation of the "brute force" approach of computing the + * distance from every colormap entry to every histogram cell. Unfortunately, + * it needs a work array to hold the best-distance-so-far for each histogram + * cell (because the inner loop has to be over cells, not colormap entries). + * The work array elements have to be IJG_INT32s, so the work array would need + * 256Kb at our recommended precision. This is not feasible in DOS machines. + * + * To get around these problems, we apply Thomas' method to compute the + * nearest colors for only the cells within a small subbox of the histogram. + * The work array need be only as big as the subbox, so the memory usage + * problem is solved. Furthermore, we need not fill subboxes that are never + * referenced in pass2; many images use only part of the color gamut, so a + * fair amount of work is saved. An additional advantage of this + * approach is that we can apply Heckbert's locality criterion to quickly + * eliminate colormap entries that are far away from the subbox; typically + * three-fourths of the colormap entries are rejected by Heckbert's criterion, + * and we need not compute their distances to individual cells in the subbox. + * The speed of this approach is heavily influenced by the subbox size: too + * small means too much overhead, too big loses because Heckbert's criterion + * can't eliminate as many colormap entries. Empirically the best subbox + * size seems to be about 1/512th of the histogram (1/8th in each direction). + * + * Thomas' article also describes a refined method which is asymptotically + * faster than the brute-force method, but it is also far more complex and + * cannot efficiently be applied to small subboxes. It is therefore not + * useful for programs intended to be portable to DOS machines. On machines + * with plenty of memory, filling the whole histogram in one shot with Thomas' + * refined method might be faster than the present code --- but then again, + * it might not be any faster, and it's certainly more complicated. + */ + + +/* log2(histogram cells in update box) for each axis; this can be adjusted */ +#define BOX_C0_LOG (HIST_C0_BITS-3) +#define BOX_C1_LOG (HIST_C1_BITS-3) +#define BOX_C2_LOG (HIST_C2_BITS-3) + +#define BOX_C0_ELEMS (1<actual_number_of_colors; + int maxc0, maxc1, maxc2; + int centerc0, centerc1, centerc2; + int i, x, ncolors; + IJG_INT32 minmaxdist, min_dist, max_dist, tdist; + IJG_INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ + + /* Compute true coordinates of update box's upper corner and center. + * Actually we compute the coordinates of the center of the upper-corner + * histogram cell, which are the upper bounds of the volume we care about. + * Note that since ">>" rounds down, the "center" values may be closer to + * min than to max; hence comparisons to them must be "<=", not "<". + */ + maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); + centerc0 = (minc0 + maxc0) >> 1; + maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); + centerc1 = (minc1 + maxc1) >> 1; + maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); + centerc2 = (minc2 + maxc2) >> 1; + + /* For each color in colormap, find: + * 1. its minimum squared-distance to any point in the update box + * (zero if color is within update box); + * 2. its maximum squared-distance to any point in the update box. + * Both of these can be found by considering only the corners of the box. + * We save the minimum distance for each color in mindist[]; + * only the smallest maximum distance is of interest. + */ + minmaxdist = 0x7FFFFFFFL; + + for (i = 0; i < numcolors; i++) { + /* We compute the squared-c0-distance term, then add in the other two. */ + x = GETJSAMPLE(cinfo->colormap[0][i]); + if (x < minc0) { + tdist = (x - minc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else if (x > maxc0) { + tdist = (x - maxc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + min_dist = 0; + if (x <= centerc0) { + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[1][i]); + if (x < minc1) { + tdist = (x - minc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc1) { + tdist = (x - maxc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc1) { + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[2][i]); + if (x < minc2) { + tdist = (x - minc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc2) { + tdist = (x - maxc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc2) { + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } + } + + mindist[i] = min_dist; /* save away the results */ + if (max_dist < minmaxdist) + minmaxdist = max_dist; + } + + /* Now we know that no cell in the update box is more than minmaxdist + * away from some colormap entry. Therefore, only colors that are + * within minmaxdist of some part of the box need be considered. + */ + ncolors = 0; + for (i = 0; i < numcolors; i++) { + if (mindist[i] <= minmaxdist) + colorlist[ncolors++] = (JSAMPLE) i; + } + return ncolors; +} + + +LOCAL(void) +find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, + int numcolors, const JSAMPLE colorlist[], JSAMPLE bestcolor[]) +/* Find the closest colormap entry for each cell in the update box, + * given the list of candidate colors prepared by find_nearby_colors. + * Return the indexes of the closest entries in the bestcolor[] array. + * This routine uses Thomas' incremental distance calculation method to + * find the distance from a colormap entry to successive cells in the box. + */ +{ + int ic0, ic1, ic2; + int i, icolor; + register IJG_INT32 * bptr; /* pointer into bestdist[] array */ + JSAMPLE * cptr; /* pointer into bestcolor[] array */ + IJG_INT32 dist0, dist1; /* initial distance values */ + register IJG_INT32 dist2; /* current distance in inner loop */ + IJG_INT32 xx0, xx1; /* distance increments */ + register IJG_INT32 xx2; + IJG_INT32 inc0, inc1, inc2; /* initial values for increments */ + /* This array holds the distance to the nearest-so-far color for each cell */ + IJG_INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Initialize best-distance for each cell of the update box */ + bptr = bestdist; + for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--) + *bptr++ = 0x7FFFFFFFL; + + /* For each color selected by find_nearby_colors, + * compute its distance to the center of each cell in the box. + * If that's less than best-so-far, update best distance and color number. + */ + + /* Nominal steps between cell centers ("x" in Thomas article) */ +#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) +#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) +#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) + + for (i = 0; i < numcolors; i++) { + icolor = GETJSAMPLE(colorlist[i]); + /* Compute (square of) distance from minc0/c1/c2 to this color */ + inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE; + dist0 = inc0*inc0; + inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE; + dist0 += inc1*inc1; + inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE; + dist0 += inc2*inc2; + /* Form the initial difference increments */ + inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; + inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; + inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; + /* Now loop over all cells in box, updating distance per Thomas method */ + bptr = bestdist; + cptr = bestcolor; + xx0 = inc0; + for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) { + dist1 = dist0; + xx1 = inc1; + for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) { + dist2 = dist1; + xx2 = inc2; + for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) { + if (dist2 < *bptr) { + *bptr = dist2; + *cptr = (JSAMPLE) icolor; + } + dist2 += xx2; + xx2 += 2 * STEP_C2 * STEP_C2; + bptr++; + cptr++; + } + dist1 += xx1; + xx1 += 2 * STEP_C1 * STEP_C1; + } + dist0 += xx0; + xx0 += 2 * STEP_C0 * STEP_C0; + } + } +} + + +LOCAL(void) +fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) +/* Fill the inverse-colormap entries in the update box that contains */ +/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ +/* we can fill as many others as we wish.) */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int minc0, minc1, minc2; /* lower left corner of update box */ + int ic0, ic1, ic2; + register JSAMPLE * cptr; /* pointer into bestcolor[] array */ + register histptr cachep; /* pointer into main cache array */ + /* This array lists the candidate colormap indexes. */ + JSAMPLE colorlist[MAXNUMCOLORS]; + int numcolors; /* number of candidate colors */ + /* This array holds the actually closest colormap index for each cell. */ + JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Convert cell coordinates to update box ID */ + c0 >>= BOX_C0_LOG; + c1 >>= BOX_C1_LOG; + c2 >>= BOX_C2_LOG; + + /* Compute true coordinates of update box's origin corner. + * Actually we compute the coordinates of the center of the corner + * histogram cell, which are the lower bounds of the volume we care about. + */ + minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); + minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); + minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); + + /* Determine which colormap entries are close enough to be candidates + * for the nearest entry to some cell in the update box. + */ + numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist); + + /* Determine the actually nearest colors. */ + find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist, + bestcolor); + + /* Save the best color numbers (plus 1) in the main cache array */ + c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ + c1 <<= BOX_C1_LOG; + c2 <<= BOX_C2_LOG; + cptr = bestcolor; + for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) { + for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) { + cachep = & histogram[c0+ic0][c1+ic1][c2]; + for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) { + *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1); + } + } + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +pass2_no_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register JSAMPROW inptr, outptr; + register histptr cachep; + register int c0, c1, c2; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the cache */ + c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT; + c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT; + c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT; + cachep = & histogram[c0][c1][c2]; + /* If we have not seen this color before, find nearest colormap entry */ + /* and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, c0,c1,c2); + /* Now emit the colormap index for this cell */ + *outptr++ = (JSAMPLE) (*cachep - 1); + } + } +} + + +METHODDEF(void) +pass2_fs_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ + LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ + LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + JSAMPROW inptr; /* => current input pixel */ + JSAMPROW outptr; /* => current output pixel */ + histptr cachep; + int dir; /* +1 or -1 depending on direction */ + int dir3; /* 3*dir, for advancing inptr & errorptr */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + int *error_limit = cquantize->error_limiter; + JSAMPROW colormap0 = cinfo->colormap[0]; + JSAMPROW colormap1 = cinfo->colormap[1]; + JSAMPROW colormap2 = cinfo->colormap[2]; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + inptr += (width-1) * 3; /* so point to rightmost pixel */ + outptr += width-1; + dir = -1; + dir3 = -3; + errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */ + cquantize->on_odd_row = FALSE; /* flip for next time */ + } else { + /* work left to right in this row */ + dir = 1; + dir3 = 3; + errorptr = cquantize->fserrors; /* => entry before first real column */ + cquantize->on_odd_row = TRUE; /* flip for next time */ + } + /* Preset error values: no error propagated to first pixel from left */ + cur0 = cur1 = cur2 = 0; + /* and no error propagated to row below yet */ + belowerr0 = belowerr1 = belowerr2 = 0; + bpreverr0 = bpreverr1 = bpreverr2 = 0; + + for (col = width; col > 0; col--) { + /* curN holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4); + cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4); + cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4); + /* Limit the error using transfer function set by init_error_limit. + * See comments with init_error_limit for rationale. + */ + cur0 = error_limit[cur0]; + cur1 = error_limit[cur1]; + cur2 = error_limit[cur2]; + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE (or less with error limiting); + * this sets the required size of the range_limit array. + */ + cur0 += GETJSAMPLE(inptr[0]); + cur1 += GETJSAMPLE(inptr[1]); + cur2 += GETJSAMPLE(inptr[2]); + cur0 = GETJSAMPLE(range_limit[cur0]); + cur1 = GETJSAMPLE(range_limit[cur1]); + cur2 = GETJSAMPLE(range_limit[cur2]); + /* Index into the cache with adjusted pixel value */ + cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT]; + /* If we have not seen this color before, find nearest colormap */ + /* entry and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, (int)(cur0>>C0_SHIFT),(int)(cur1>>C1_SHIFT),(int)(cur2>>C2_SHIFT)); + /* Now emit the colormap index for this cell */ + { register int pixcode = *cachep - 1; + *outptr = (JSAMPLE) pixcode; + /* Compute representation error for this pixel */ + cur0 -= GETJSAMPLE(colormap0[pixcode]); + cur1 -= GETJSAMPLE(colormap1[pixcode]); + cur2 -= GETJSAMPLE(colormap2[pixcode]); + } + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + { register LOCFSERROR bnexterr, delta; + + bnexterr = cur0; /* Process component 0 */ + delta = cur0 * 2; + cur0 += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr0 + cur0); + cur0 += delta; /* form error * 5 */ + bpreverr0 = belowerr0 + cur0; + belowerr0 = bnexterr; + cur0 += delta; /* form error * 7 */ + bnexterr = cur1; /* Process component 1 */ + delta = cur1 * 2; + cur1 += delta; /* form error * 3 */ + errorptr[1] = (FSERROR) (bpreverr1 + cur1); + cur1 += delta; /* form error * 5 */ + bpreverr1 = belowerr1 + cur1; + belowerr1 = bnexterr; + cur1 += delta; /* form error * 7 */ + bnexterr = cur2; /* Process component 2 */ + delta = cur2 * 2; + cur2 += delta; /* form error * 3 */ + errorptr[2] = (FSERROR) (bpreverr2 + cur2); + cur2 += delta; /* form error * 5 */ + bpreverr2 = belowerr2 + cur2; + belowerr2 = bnexterr; + cur2 += delta; /* form error * 7 */ + } + /* At this point curN contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + inptr += dir3; /* Advance pixel pointers to next column */ + outptr += dir; + errorptr += dir3; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error values into the + * final fserrors[] entry. Note we need not unload belowerrN because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ + errorptr[1] = (FSERROR) bpreverr1; + errorptr[2] = (FSERROR) bpreverr2; + } +} + + +/* + * Initialize the error-limiting transfer function (lookup table). + * The raw F-S error computation can potentially compute error values of up to + * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be + * much less, otherwise obviously wrong pixels will be created. (Typical + * effects include weird fringes at color-area boundaries, isolated bright + * pixels in a dark area, etc.) The standard advice for avoiding this problem + * is to ensure that the "corners" of the color cube are allocated as output + * colors; then repeated errors in the same direction cannot cause cascading + * error buildup. However, that only prevents the error from getting + * completely out of hand; Aaron Giles reports that error limiting improves + * the results even with corner colors allocated. + * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty + * well, but the smoother transfer function used below is even better. Thanks + * to Aaron Giles for this idea. + */ + +LOCAL(void) +init_error_limit (j_decompress_ptr cinfo) +/* Allocate and fill in the error_limiter table */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + int * table; + int in, out; + + table = (int *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int)); + table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ + cquantize->error_limiter = table; + +#define STEPSIZE ((MAXJSAMPLE+1)/16) + /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ + out = 0; + for (in = 0; in < STEPSIZE; in++, out++) { + table[in] = out; table[-in] = -out; + } + /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ + for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) { + table[in] = out; table[-in] = -out; + } + /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ + for (; in <= MAXJSAMPLE; in++) { + table[in] = out; table[-in] = -out; + } +#undef STEPSIZE +} + + +/* + * Finish up at the end of each pass. + */ + +METHODDEF(void) +finish_pass1 (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Select the representative colors and fill in cinfo->colormap */ + cinfo->colormap = cquantize->sv_colormap; + select_colors(cinfo, cquantize->desired); + /* Force next pass to zero the color index table */ + cquantize->needs_zeroed = TRUE; +} + + +METHODDEF(void) +finish_pass2 (j_decompress_ptr cinfo) +{ + /* no work */ +} + + +/* + * Initialize for each processing pass. + */ + +METHODDEF(void) +start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int i; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + if (is_pre_scan) { + /* Set up method pointers */ + cquantize->pub.color_quantize = prescan_quantize; + cquantize->pub.finish_pass = finish_pass1; + cquantize->needs_zeroed = TRUE; /* Always zero histogram */ + } else { + /* Set up method pointers */ + if (cinfo->dither_mode == JDITHER_FS) + cquantize->pub.color_quantize = pass2_fs_dither; + else + cquantize->pub.color_quantize = pass2_no_dither; + cquantize->pub.finish_pass = finish_pass2; + + /* Make sure color count is acceptable */ + i = cinfo->actual_number_of_colors; + if (i < 1) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1); + if (i > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + + if (cinfo->dither_mode == JDITHER_FS) { + size_t arraysize = (size_t) ((cinfo->output_width + 2) * + (3 * SIZEOF(FSERROR))); + /* Allocate Floyd-Steinberg workspace if we didn't already. */ + if (cquantize->fserrors == NULL) + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + /* Initialize the propagated errors to zero. */ + jzero_far((void FAR *) cquantize->fserrors, arraysize); + /* Make the error-limit table if we didn't already. */ + if (cquantize->error_limiter == NULL) + init_error_limit(cinfo); + cquantize->on_odd_row = FALSE; + } + + } + /* Zero the histogram or inverse color map, if necessary */ + if (cquantize->needs_zeroed) { + for (i = 0; i < HIST_C0_ELEMS; i++) { + jzero_far((void FAR *) histogram[i], + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = FALSE; + } +} + + +/* + * Switch to a new external colormap between output passes. + */ + +METHODDEF(void) +new_color_map_2_quant (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Reset the inverse color map */ + cquantize->needs_zeroed = TRUE; +} + + +/* + * Module initialization routine for 2-pass color quantization. + */ + +GLOBAL(void) +jinit_2pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + int i; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_2_quant; + cquantize->pub.new_color_map = new_color_map_2_quant; + cquantize->fserrors = NULL; /* flag optional arrays not allocated */ + cquantize->error_limiter = NULL; + + /* Make sure jdmaster didn't give me a case I can't handle */ + if (cinfo->out_color_components != 3) + ERREXIT(cinfo, JERR_NOTIMPL); + + /* Allocate the histogram/inverse colormap storage */ + cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d)); + for (i = 0; i < HIST_C0_ELEMS; i++) { + cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ + + /* Allocate storage for the completed colormap, if required. + * We do this now since it is FAR storage and may affect + * the memory manager's space calculations. + */ + if (cinfo->enable_2pass_quant) { + /* Make sure color count is acceptable */ + int desired = cinfo->desired_number_of_colors; + /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */ + if (desired < 8) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (desired > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + cquantize->sv_colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3); + cquantize->desired = desired; + } else + cquantize->sv_colormap = NULL; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + /* Allocate Floyd-Steinberg workspace if necessary. + * This isn't really needed until pass 2, but again it is FAR storage. + * Although we will cope with a later change in dither_mode, + * we do not promise to honor max_memory_to_use if dither_mode changes. + */ + if (cinfo->dither_mode == JDITHER_FS) { + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR)))); + /* Might as well create the error-limiting table too. */ + init_error_limit(cinfo); + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ diff --git a/dcmjpeg/libijg16/jutils.c b/dcmjpeg/libijg16/jutils.c new file mode 100644 index 00000000..68de76fc --- /dev/null +++ b/dcmjpeg/libijg16/jutils.c @@ -0,0 +1,179 @@ +/* + * jutils.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains tables and miscellaneous utility routines needed + * for both compression and decompression. + * Note we prefix all global names with "j" to minimize conflicts with + * a surrounding application. + */ + +#define JPEG_INTERNALS +#include "jinclude16.h" +#include "jpeglib16.h" + + +/* + * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element + * of a DCT block read in natural order (left to right, top to bottom). + */ + +#if 0 /* This table is not actually needed in v6a */ + +const int jpeg_zigzag_order[DCTSIZE2] = { + 0, 1, 5, 6, 14, 15, 27, 28, + 2, 4, 7, 13, 16, 26, 29, 42, + 3, 8, 12, 17, 25, 30, 41, 43, + 9, 11, 18, 24, 31, 40, 44, 53, + 10, 19, 23, 32, 39, 45, 52, 54, + 20, 22, 33, 38, 46, 51, 55, 60, + 21, 34, 37, 47, 50, 56, 59, 61, + 35, 36, 48, 49, 57, 58, 62, 63 +}; + +#endif + +/* + * jpeg_natural_order[i] is the natural-order position of the i'th element + * of zigzag order. + * + * When reading corrupted data, the Huffman decoders could attempt + * to reference an entry beyond the end of this array (if the decoded + * zero run length reaches past the end of the block). To prevent + * wild stores without adding an inner-loop test, we put some extra + * "63"s after the real entries. This will cause the extra coefficient + * to be stored in location 63 of the block, not somewhere random. + * The worst case would be a run-length of 15, which means we need 16 + * fake entries. + */ + +const int jpeg_natural_order[DCTSIZE2+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + + +/* + * Arithmetic utilities + */ + +GLOBAL(long) +jdiv_round_up (long a, long b) +/* Compute a/b rounded up to next integer, ie, ceil(a/b) */ +/* Assumes a >= 0, b > 0 */ +{ + return (a + b - 1L) / b; +} + + +GLOBAL(long) +jround_up (long a, long b) +/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */ +/* Assumes a >= 0, b > 0 */ +{ + a += b - 1L; + return a - (a % b); +} + + +/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays + * and coefficient-block arrays. This won't work on 80x86 because the arrays + * are FAR and we're assuming a small-pointer memory model. However, some + * DOS compilers provide far-pointer versions of memcpy() and memset() even + * in the small-model libraries. These will be used if USE_FMEM is defined. + * Otherwise, the routines below do it the hard way. (The performance cost + * is not all that great, because these routines aren't very heavily used.) + */ + +#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ +#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) +#define FMEMZERO(target,size) MEMZERO(target,size) +#else /* 80x86 case, define if we can */ +#ifdef USE_FMEM +#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size)) +#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size)) +#endif +#endif + + +GLOBAL(void) +jcopy_sample_rows (JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols) +/* Copy some rows of samples from one place to another. + * num_rows rows are copied from input_array[source_row++] + * to output_array[dest_row++]; these areas may overlap for duplication. + * The source and destination arrays must be at least as wide as num_cols. + */ +{ + register JSAMPROW inptr, outptr; +#ifdef FMEMCOPY + register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); +#else + register JDIMENSION count; +#endif + register int row; + + input_array += source_row; + output_array += dest_row; + + for (row = num_rows; row > 0; row--) { + inptr = *input_array++; + outptr = *output_array++; +#ifdef FMEMCOPY + FMEMCOPY(outptr, inptr, count); +#else + for (count = num_cols; count > 0; count--) + *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ +#endif + } +} + + +GLOBAL(void) +jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks) +/* Copy a row of coefficient blocks from one place to another. */ +{ +#ifdef FMEMCOPY + FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); +#else + register JCOEFPTR inptr, outptr; + register long count; + + inptr = (JCOEFPTR) input_row; + outptr = (JCOEFPTR) output_row; + for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) { + *outptr++ = *inptr++; + } +#endif +} + + +GLOBAL(void) +jzero_far (void FAR * target, size_t bytestozero) +/* Zero out a chunk of FAR memory. */ +/* This might be sample-array data, block-array data, or alloc_large data. */ +{ +#ifdef FMEMZERO + FMEMZERO(target, bytestozero); +#else + register char FAR * ptr = (char FAR *) target; + register size_t count; + + for (count = bytestozero; count > 0; count--) { + *ptr++ = 0; + } +#endif +} diff --git a/dcmjpeg/libijg16/jversion16.h b/dcmjpeg/libijg16/jversion16.h new file mode 100644 index 00000000..6472c58d --- /dev/null +++ b/dcmjpeg/libijg16/jversion16.h @@ -0,0 +1,14 @@ +/* + * jversion.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains software version identification. + */ + + +#define JVERSION "6b 27-Mar-1998" + +#define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" diff --git a/dcmjpeg/libijg8/CMakeLists.txt b/dcmjpeg/libijg8/CMakeLists.txt new file mode 100644 index 00000000..e3f8f683 --- /dev/null +++ b/dcmjpeg/libijg8/CMakeLists.txt @@ -0,0 +1,2 @@ +# create library from source files +DCMTK_ADD_LIBRARY(ijg8 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils) diff --git a/dcmjpeg/libijg8/Makefile.dep b/dcmjpeg/libijg8/Makefile.dep new file mode 100644 index 00000000..b4576e5d --- /dev/null +++ b/dcmjpeg/libijg8/Makefile.dep @@ -0,0 +1,220 @@ +jaricom.o: jaricom.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcapimin.o: jcapimin.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcapistd.o: jcapistd.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcarith.o: jcarith.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jccoefct.o: jccoefct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h +jccolor.o: jccolor.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcdctmgr.o: jcdctmgr.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jdct8.h +jcdiffct.o: jcdiffct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jchuff.o: jchuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jchuff8.h +jcinit.o: jcinit.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jclhuff.o: jclhuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h jchuff8.h +jclossls.o: jclossls.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jclossy.o: jclossy.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h +jcmainct.o: jcmainct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcmarker.o: jcmarker.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcmaster.o: jcmaster.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h +jcodec.o: jcodec.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jlossls8.h +jcomapi.o: jcomapi.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcparam.o: jcparam.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcphuff.o: jcphuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jchuff8.h +jcpred.o: jcpred.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jcprepct.o: jcprepct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcsample.o: jcsample.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jcscale.o: jcscale.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jcshuff.o: jcshuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jchuff8.h +jctrans.o: jctrans.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h +jdapimin.o: jdapimin.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdapistd.o: jdapistd.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdarith.o: jdarith.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdatadst.o: jdatadst.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jerror8.h +jdatasrc.o: jdatasrc.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jerror8.h +jdcoefct.o: jdcoefct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h +jdcolor.o: jdcolor.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jddctmgr.o: jddctmgr.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jdct8.h +jddiffct.o: jddiffct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jdhuff.o: jdhuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jlossls8.h jdhuff8.h +jdinput.o: jdinput.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdlhuff.o: jdlhuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h jdhuff8.h +jdlossls.o: jdlossls.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jdlossy.o: jdlossy.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h +jdmainct.o: jdmainct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdmarker.o: jdmarker.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdmaster.o: jdmaster.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdmerge.o: jdmerge.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdphuff.o: jdphuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jdhuff8.h +jdpostct.o: jdpostct.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdpred.o: jdpred.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jdsample.o: jdsample.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jdscale.o: jdscale.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossls8.h +jdshuff.o: jdshuff.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h jdhuff8.h +jdtrans.o: jdtrans.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jlossy8.h +jerror.o: jerror.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jversion8.h jerror8.h +jfdctflt.o: jfdctflt.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h jdct8.h +jfdctfst.o: jfdctfst.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h jdct8.h +jfdctint.o: jfdctint.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h jdct8.h +jidctflt.o: jidctflt.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h jdct8.h +jidctfst.o: jidctfst.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h jdct8.h +jidctint.o: jidctint.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h jdct8.h +jidctred.o: jidctred.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h jdct8.h +jmemmgr.o: jmemmgr.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jmemsys8.h +jmemnobs.o: jmemnobs.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h \ + jmemsys8.h +jquant1.o: jquant1.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jquant2.o: jquant2.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h +jutils.o: jutils.c jinclude8.h jconfig8.h \ + ../../config/include/dcmtk/config/osconfig.h jpeglib8.h jmorecfg8.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint8.h jerror8.h diff --git a/dcmjpeg/libijg8/Makefile.in b/dcmjpeg/libijg8/Makefile.in new file mode 100644 index 00000000..58d52da3 --- /dev/null +++ b/dcmjpeg/libijg8/Makefile.in @@ -0,0 +1,59 @@ +# +# Makefile for dcmjpeg/libijg8 +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd + +LOCALINCLUDES = -I$(ofstddir)/include +LOCALDEFS = -DWITH_ARITHMETIC_PATCH + +objs = jcomapi.o jcodec.o jutils.o jerror.o jmemmgr.o \ + jmemnobs.o jcapimin.o jcapistd.o jctrans.o jcparam.o \ + jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o \ + jcprepct.o jclossls.o jclossy.o jccoefct.o jccolor.o \ + jcsample.o jchuff.o jcphuff.o jcshuff.o jclhuff.o \ + jcpred.o jcscale.o jcdiffct.o jcdctmgr.o jfdctfst.o \ + jfdctflt.o jfdctint.o jdapimin.o jdapistd.o jdtrans.o \ + jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdlossls.o \ + jdlossy.o jdhuff.o jdlhuff.o jdphuff.o jdshuff.o \ + jdpred.o jdscale.o jddiffct.o jdmainct.o jdcoefct.o \ + jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o \ + jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o \ + jdmerge.o jcarith.o jdarith.o jaricom.o +library = libijg8.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.c > $(DEP) + +include $(DEP) diff --git a/dcmjpeg/libijg8/jaricom.c b/dcmjpeg/libijg8/jaricom.c new file mode 100644 index 00000000..12df3113 --- /dev/null +++ b/dcmjpeg/libijg8/jaricom.c @@ -0,0 +1,15 @@ +/* + * jaricom.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy codec tables. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + +IJG_INT32 jaritab[1]; /* dummy table */ diff --git a/dcmjpeg/libijg8/jcapimin.c b/dcmjpeg/libijg8/jcapimin.c new file mode 100644 index 00000000..6076289e --- /dev/null +++ b/dcmjpeg/libijg8/jcapimin.c @@ -0,0 +1,282 @@ +/* + * jcapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-compression case or the transcoding-only + * case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jcapistd.c. But also see jcparam.c for + * parameter-setup helper routines, jcomapi.c for routines shared by + * compression and decompression, and jctrans.c for the transcoding case. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Initialization of a JPEG compression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_compress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_compress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = FALSE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->dest = NULL; + + cinfo->comp_info = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) + cinfo->quant_tbl_ptrs[i] = NULL; + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + cinfo->script_space = NULL; + + cinfo->input_gamma = 1.0; /* in case application forgets */ + + cinfo->force_extended_sequential_marker = FALSE; + + /* OK, I'm ready */ + cinfo->global_state = CSTATE_START; +} + + +/* + * Destruction of a JPEG compression object + */ + +GLOBAL(void) +jpeg_destroy_compress (j_compress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG compression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_compress (j_compress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Forcibly suppress or un-suppress all quantization and Huffman tables. + * Marks all currently defined tables as already written (if suppress) + * or not written (if !suppress). This will control whether they get emitted + * by a subsequent jpeg_start_compress call. + * + * This routine is exported for use by applications that want to produce + * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but + * since it is called by jpeg_start_compress, we put it here --- otherwise + * jcparam.o would be linked whether the application used it or not. + */ + +GLOBAL(void) +jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress) +{ + int i; + JQUANT_TBL * qtbl; + JHUFF_TBL * htbl; + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL) + qtbl->sent_table = suppress; + } + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + } +} + + +/* + * Finish JPEG compression. + * + * If a multipass operating mode was selected, this may do a great deal of + * work including most of the actual output. + */ + +GLOBAL(void) +jpeg_finish_compress (j_compress_ptr cinfo) +{ + JDIMENSION iMCU_row; + + if (cinfo->global_state == CSTATE_SCANNING || + cinfo->global_state == CSTATE_RAW_OK) { + /* Terminate first pass */ + if (cinfo->next_scanline < cinfo->image_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_pass) (cinfo); + } else if (cinfo->global_state != CSTATE_WRCOEFS) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any remaining passes */ + while (! cinfo->master->is_last_pass) { + (*cinfo->master->prepare_for_pass) (cinfo); + for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) { + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) iMCU_row; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* We bypass the main controller and invoke coef controller directly; + * all work is being done from the coefficient buffer. + */ + if (! (*cinfo->codec->compress_data) (cinfo, (JSAMPIMAGE) NULL)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } + (*cinfo->master->finish_pass) (cinfo); + } + /* Write EOI, do final cleanup */ + (*cinfo->marker->write_file_trailer) (cinfo); + (*cinfo->dest->term_destination) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); +} + + +/* + * Write a special marker. + * This is only recommended for writing COM or APPn markers. + * Must be called after jpeg_start_compress() and before + * first call to jpeg_write_scanlines() or jpeg_write_raw_data(). + */ + +GLOBAL(void) +jpeg_write_marker (j_compress_ptr cinfo, int marker, + const JOCTET *dataptr, unsigned int datalen) +{ + JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val)); + + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); + write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */ + while (datalen--) { + (*write_marker_byte) (cinfo, *dataptr); + dataptr++; + } +} + +/* Same, but piecemeal. */ + +GLOBAL(void) +jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +{ + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); +} + +GLOBAL(void) +jpeg_write_m_byte (j_compress_ptr cinfo, int val) +{ + (*cinfo->marker->write_marker_byte) (cinfo, val); +} + + +/* + * Alternate compression function: just write an abbreviated table file. + * Before calling this, all parameters and a data destination must be set up. + * + * To produce a pair of files containing abbreviated tables and abbreviated + * image data, one would proceed as follows: + * + * initialize JPEG object + * set JPEG parameters + * set destination to table file + * jpeg_write_tables(cinfo); + * set destination to image file + * jpeg_start_compress(cinfo, FALSE); + * write data... + * jpeg_finish_compress(cinfo); + * + * jpeg_write_tables has the side effect of marking all tables written + * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress + * will not re-emit the tables unless it is passed write_all_tables=TRUE. + */ + +GLOBAL(void) +jpeg_write_tables (j_compress_ptr cinfo) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Initialize the marker writer ... bit of a crock to do it here. */ + jinit_marker_writer(cinfo); + /* Write them tables! */ + (*cinfo->marker->write_tables_only) (cinfo); + /* And clean up. */ + (*cinfo->dest->term_destination) (cinfo); + /* + * In library releases up through v6a, we called jpeg_abort() here to free + * any working memory allocated by the destination manager and marker + * writer. Some applications had a problem with that: they allocated space + * of their own from the library memory manager, and didn't want it to go + * away during write_tables. So now we do nothing. This will cause a + * memory leak if an app calls write_tables repeatedly without doing a full + * compression cycle or otherwise resetting the JPEG object. However, that + * seems less bad than unexpectedly freeing memory in the normal case. + * An app that prefers the old behavior can call jpeg_abort for itself after + * each call to jpeg_write_tables(). + */ +} diff --git a/dcmjpeg/libijg8/jcapistd.c b/dcmjpeg/libijg8/jcapistd.c new file mode 100644 index 00000000..4ab80015 --- /dev/null +++ b/dcmjpeg/libijg8/jcapistd.c @@ -0,0 +1,161 @@ +/* + * jcapistd.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-compression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_compress, it will end up linking in the entire compressor. + * We thus must separate this file from jcapimin.c to avoid linking the + * whole compression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Compression initialization. + * Before calling this, all parameters and a data destination must be set up. + * + * We require a write_all_tables parameter as a failsafe check when writing + * multiple datastreams from the same compression object. Since prior runs + * will have left all the tables marked sent_table=TRUE, a subsequent run + * would emit an abbreviated stream (no tables) by default. This may be what + * is wanted, but for safety's sake it should not be the default behavior: + * programmers should have to make a deliberate choice to emit abbreviated + * images. Therefore the documentation and examples should encourage people + * to pass write_all_tables=TRUE; then it will take active thought to do the + * wrong thing. + */ + +GLOBAL(void) +jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (write_all_tables) + jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + jinit_compress_master(cinfo); + /* Set up for the first pass */ + (*cinfo->master->prepare_for_pass) (cinfo); + /* Ready for application to drive first pass through jpeg_write_scanlines + * or jpeg_write_raw_data. + */ + cinfo->next_scanline = 0; + cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING); +} + + +/* + * Write some scanlines of data to the JPEG compressor. + * + * The return value will be the number of lines actually written. + * This should be less than the supplied num_lines only in case that + * the data destination module has requested suspension of the compressor, + * or if more than image_height scanlines are passed in. + * + * Note: we warn about excess calls to jpeg_write_scanlines() since + * this likely signals an application programmer error. However, + * excess scanlines passed in the last valid call are *silently* ignored, + * so that the application need not adjust num_lines for end-of-image + * when using a multiple-scanline buffer. + */ + +GLOBAL(JDIMENSION) +jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION num_lines) +{ + JDIMENSION row_ctr, rows_left; + + if (cinfo->global_state != CSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_scanlines. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_scanlines. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Ignore any extra scanlines at bottom of image. */ + rows_left = cinfo->image_height - cinfo->next_scanline; + if (num_lines > rows_left) + num_lines = rows_left; + + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); + cinfo->next_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to write raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION num_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != CSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_raw_data. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_raw_data. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Verify that at least one iMCU row has been passed. */ + lines_per_iMCU_row = (JDIMENSION)(cinfo->max_v_samp_factor * cinfo->data_unit); + if (num_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Directly compress the row. */ + if (! (*cinfo->codec->compress_data) (cinfo, data)) { + /* If compressor did not consume the whole row, suspend processing. */ + return 0; + } + + /* OK, we processed one iMCU row. */ + cinfo->next_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} diff --git a/dcmjpeg/libijg8/jcarith.c b/dcmjpeg/libijg8/jcarith.c new file mode 100644 index 00000000..13dcc3f3 --- /dev/null +++ b/dcmjpeg/libijg8/jcarith.c @@ -0,0 +1,26 @@ +/* + * jcarith.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy encoding routines. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Module initialization routine for arithmetic entropy encoding. + */ +GLOBAL(void) +jinit_arith_encoder (j_compress_ptr cinfo); + +GLOBAL(void) +jinit_arith_encoder (j_compress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +} diff --git a/dcmjpeg/libijg8/jccoefct.c b/dcmjpeg/libijg8/jccoefct.c new file mode 100644 index 00000000..88b13a27 --- /dev/null +++ b/dcmjpeg/libijg8/jccoefct.c @@ -0,0 +1,454 @@ +/* + * jccoefct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for compression. + * This controller is the top level of the JPEG compressor proper. + * The coefficient buffer lies between forward-DCT and entropy encoding steps. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ + + +/* We use a full-image coefficient buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the DCT + * step is run during the first pass, and subsequent passes need only read + * the buffered coefficients. + */ +#ifdef ENTROPY_OPT_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#else +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#endif +#endif + + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* For single-pass compression, it's sufficient to buffer just one MCU + * (although this may prove a bit slow in practice). We allocate a + * workspace of C_MAX_DATA_UNITS_IN_MCU coefficient blocks, and reuse it for + * each MCU constructed and sent. (On 80x86, the workspace is FAR even + * though it's not really very big; this is to keep the module interfaces + * unchanged when a large coefficient buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays. + */ + JBLOCKROW MCU_buffer[C_MAX_DATA_UNITS_IN_MCU]; + + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +} c_coef_controller; + +typedef c_coef_controller * c_coef_ptr; + + +/* Forward declarations */ +METHODDEF(boolean) compress_data + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#ifdef FULL_COEF_BUFFER_SUPPORTED +METHODDEF(boolean) compress_first_pass + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(boolean) compress_output + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (coef->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_data; + break; +#ifdef FULL_COEF_BUFFER_SUPPORTED + case JBUF_SAVE_AND_PASS: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + lossyc->pub.compress_data = compress_output; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data in the single-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(boolean) +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, bi, ci, yindex, yoffset, blockcnt; + JDIMENSION ypos, xpos; + jpeg_component_info *compptr; + + /* Loop to write as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Determine where data comes from in input_buf and do the DCT thing. + * Each call on forward_DCT processes a horizontal row of DCT blocks + * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks + * sequentially. Dummy blocks at the right or bottom edge are filled in + * specially. The data in them does not matter for image reconstruction, + * so we fill them with values that will encode to the smallest amount of + * data, viz: all zeroes in the AC entries, DC entries equal to previous + * block's DC value. (Thanks to Thomas Kinsman for this idea.) + */ + blkn = 0; + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + xpos = MCU_col_num * (JDIMENSION)compptr->MCU_sample_width; + ypos = (JDIMENSION)(yoffset * DCTSIZE); /* ypos == (yoffset+yindex) * DCTSIZE */ + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + (*lossyc->fdct_forward_DCT) (cinfo, compptr, + input_buf[compptr->component_index], + coef->MCU_buffer[blkn], + ypos, xpos, (JDIMENSION) blockcnt); + if (blockcnt < compptr->MCU_width) { + /* Create some dummy blocks at the right edge of the image. */ + jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt], + (size_t)(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK)); + for (bi = blockcnt; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0]; + } + } + } else { + /* Create a row of dummy blocks at the bottom of the image. */ + jzero_far((void FAR *) coef->MCU_buffer[blkn], + (size_t)compptr->MCU_width * SIZEOF(JBLOCK)); + for (bi = 0; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0]; + } + } + blkn += compptr->MCU_width; + ypos += DCTSIZE; + } + } + /* Try to write the MCU. In event of a suspension failure, we will + * re-DCT the MCU on restart (a bit inefficient, could be fixed...) + */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +#ifdef FULL_COEF_BUFFER_SUPPORTED + +/* + * Process some data in the first pass of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * This amount of data is read from the source buffer, DCT'd and quantized, + * and saved into the virtual arrays. We also generate suitable dummy blocks + * as needed at the right and lower edges. (The dummy blocks are constructed + * in the virtual arrays, which have been padded appropriately.) This makes + * it possible for subsequent passes not to worry about real vs. dummy blocks. + * + * We must also emit the data to the entropy encoder. This is conveniently + * done by calling compress_output() after we've loaded the current strip + * of the virtual arrays. + * + * NB: input_buf contains a plane for each component in image. All + * components are DCT'd and loaded into the virtual arrays in this pass. + * However, it may be that only a subset of the components are emitted to + * the entropy encoder during this first pass; be careful about looking + * at the scan-dependent variables (MCU dimensions, etc). + */ + +METHODDEF(boolean) +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION blocks_across, MCUs_across, MCUindex; + int bi, ci, h_samp_factor, block_row, block_rows, ndummy; + JCOEF lastDC; + jpeg_component_info *compptr; + JBLOCKARRAY buffer; + JBLOCKROW thisblockrow, lastblockrow; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + coef->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, TRUE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (coef->iMCU_row_num < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + blocks_across = (JDIMENSION)compptr->width_in_data_units; + h_samp_factor = compptr->h_samp_factor; + /* Count number of dummy blocks to be added at the right margin. */ + ndummy = (int)blocks_across % h_samp_factor; + if (ndummy > 0) + ndummy = h_samp_factor - ndummy; + /* Perform DCT for all non-dummy blocks in this iMCU row. Each call + * on forward_DCT processes a complete horizontal row of DCT blocks. + */ + for (block_row = 0; block_row < block_rows; block_row++) { + thisblockrow = buffer[block_row]; + (*lossyc->fdct_forward_DCT) (cinfo, compptr, + input_buf[ci], thisblockrow, + (JDIMENSION) (block_row * DCTSIZE), + (JDIMENSION) 0, blocks_across); + if (ndummy > 0) { + /* Create dummy blocks at the right edge of the image. */ + thisblockrow += blocks_across; /* => first dummy block */ + jzero_far((void FAR *) thisblockrow, (size_t)ndummy * SIZEOF(JBLOCK)); + lastDC = thisblockrow[-1][0]; + for (bi = 0; bi < ndummy; bi++) { + thisblockrow[bi][0] = lastDC; + } + } + } + /* If at end of image, create dummy block rows as needed. + * The tricky part here is that within each MCU, we want the DC values + * of the dummy blocks to match the last real block's DC value. + * This squeezes a few more bytes out of the resulting file... + */ + if (coef->iMCU_row_num == last_iMCU_row) { + blocks_across += (JDIMENSION)ndummy; /* include lower right corner */ + MCUs_across = blocks_across / (JDIMENSION)h_samp_factor; + for (block_row = block_rows; block_row < compptr->v_samp_factor; + block_row++) { + thisblockrow = buffer[block_row]; + lastblockrow = buffer[block_row-1]; + jzero_far((void FAR *) thisblockrow, + (size_t) (blocks_across * SIZEOF(JBLOCK))); + for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) { + lastDC = lastblockrow[h_samp_factor-1][0]; + for (bi = 0; bi < h_samp_factor; bi++) { + thisblockrow[bi][0] = lastDC; + } + thisblockrow += h_samp_factor; /* advance to next MCU in row */ + lastblockrow += h_samp_factor; + } + } + } + } + /* NB: compress_output will increment iMCU_row_num if successful. + * A suspension return will result in redoing all the work above next time. + */ + + /* Emit data to the entropy encoder, sharing code with subsequent passes */ + return compress_output(cinfo, input_buf); +} + + +/* + * Process some data in subsequent passes of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. + * NB: during first pass, this is safe only because the buffers will + * already be aligned properly, so jmemmgr.c won't need to do any I/O. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to write the MCU. */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + +#endif /* FULL_COEF_BUFFER_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef; + + coef = (c_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_coef_controller)); + lossyc->coef_private = (struct jpeg_c_coef_controller *) coef; + lossyc->coef_start_pass = start_pass_coef; + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef FULL_COEF_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + int ci; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_DATA_UNITS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + coef->whole_image[0] = NULL; /* flag for no virtual arrays */ + } +} diff --git a/dcmjpeg/libijg8/jccolor.c b/dcmjpeg/libijg8/jccolor.c new file mode 100644 index 00000000..a72fb445 --- /dev/null +++ b/dcmjpeg/libijg8/jccolor.c @@ -0,0 +1,459 @@ +/* + * jccolor.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_converter pub; /* public fields */ + + /* Private state for RGB->YCC conversion */ + IJG_INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ +} my_color_converter; + +typedef my_color_converter * my_cconvert_ptr; + + +/**************** RGB -> YCbCr conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE + * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2, + * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and + * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0) + * were not represented exactly. Now we sacrifice exact representation of + * maximum red and maximum blue in order to get exact grayscales. + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times R,G,B for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included + * in the tables to save adding them separately in the inner loop. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define CBCR_OFFSET ((IJG_INT32) CENTERJSAMPLE << SCALEBITS) +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L< Y section */ +#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */ +#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */ +#define R_CB_OFF (3*(MAXJSAMPLE+1)) +#define G_CB_OFF (4*(MAXJSAMPLE+1)) +#define B_CB_OFF (5*(MAXJSAMPLE+1)) +#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */ +#define G_CR_OFF (6*(MAXJSAMPLE+1)) +#define B_CR_OFF (7*(MAXJSAMPLE+1)) +#define TABLE_SIZE (8*(MAXJSAMPLE+1)) + + +/* + * Initialize for RGB->YCC colorspace conversion. + */ + +METHODDEF(void) +rgb_ycc_start (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + IJG_INT32 * rgb_ycc_tab; + IJG_INT32 i; + + /* Allocate and fill in the conversion tables. */ + cconvert->rgb_ycc_tab = rgb_ycc_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (TABLE_SIZE * SIZEOF(IJG_INT32))); + + for (i = 0; i <= MAXJSAMPLE; i++) { + rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; + rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; + rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; + rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i; + rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i; + /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr. + * This ensures that the maximum output will round to MAXJSAMPLE + * not MAXJSAMPLE+1, and thus that we don't have to range-limit. + */ + rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +/* B=>Cb and R=>Cr tables are the same + rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +*/ + rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i; + rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i; + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * + * Note that we change from the application's interleaved-pixel format + * to our internal noninterleaved, one-plane-per-component format. + * The input buffer is therefore three times as wide as the output buffer. + * + * A starting row offset is provided only for the output buffer. The caller + * can easily adjust the passed input_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +rgb_ycc_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + inptr += RGB_PIXELSIZE; + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + } + } +} + + +/**************** Cases other than RGB -> YCbCr **************/ + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles RGB->grayscale conversion, which is the same + * as the RGB->Y portion of RGB->YCbCr. + * We assume rgb_ycc_start has been called (we only use the Y tables). + */ + +METHODDEF(void) +rgb_gray_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + inptr += RGB_PIXELSIZE; + /* Y */ + outptr[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles Adobe-style CMYK->YCCK conversion, + * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same + * conversion as above, while passing K (black) unchanged. + * We assume rgb_ycc_start has been called. + */ + +METHODDEF(void) +cmyk_ycck_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int r, g, b; + register IJG_INT32 * ctab = cconvert->rgb_ycc_tab; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2, outptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + outptr3 = output_buf[3][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = MAXJSAMPLE - GETJSAMPLE(inptr[0]); + g = MAXJSAMPLE - GETJSAMPLE(inptr[1]); + b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); + /* K passes through as-is */ + outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ + inptr += 4; + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles grayscale output with no conversion. + * The source can be either plain grayscale or YCbCr (since Y == gray). + */ + +METHODDEF(void) +grayscale_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + int instride = cinfo->input_components; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ + inptr += instride; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles multi-component colorspaces without conversion. + * We assume input_components == num_components. + */ + +METHODDEF(void) +null_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + register int ci; + int nc = cinfo->num_components; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + /* It seems fastest to make a separate pass for each component. */ + for (ci = 0; ci < nc; ci++) { + inptr = *input_buf; + outptr = output_buf[ci][output_row]; + for (col = 0; col < num_cols; col++) { + outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */ + inptr += nc; + } + } + input_buf++; + output_row++; + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +null_method (j_compress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for input colorspace conversion. + */ + +GLOBAL(void) +jinit_color_converter (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_converter)); + cinfo->cconvert = (struct jpeg_color_converter *) cconvert; + /* set start_pass to null method until we find out differently */ + cconvert->pub.start_pass = null_method; + + /* Make sure input_components agrees with in_color_space */ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + if (cinfo->input_components != 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_RGB: +#if RGB_PIXELSIZE != 3 + if (cinfo->input_components != RGB_PIXELSIZE) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; +#endif /* else share code with YCbCr */ + + case JCS_YCbCr: + if (cinfo->input_components != 3) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->input_components != 4) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->input_components < 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + } + + /* Check num_components, set conversion method based on requested space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_GRAYSCALE) + cconvert->pub.color_convert = grayscale_convert; + else if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_gray_convert; + } else if (cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = grayscale_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_ycc_convert; + } else if (cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = cmyk_ycck_convert; + } else if (cinfo->in_color_space == JCS_YCCK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: /* allow null conversion of JCS_UNKNOWN */ + if (cinfo->jpeg_color_space != cinfo->in_color_space || + cinfo->num_components != cinfo->input_components) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + cconvert->pub.color_convert = null_convert; + break; + } +} diff --git a/dcmjpeg/libijg8/jcdctmgr.c b/dcmjpeg/libijg8/jcdctmgr.c new file mode 100644 index 00000000..0e65a30e --- /dev/null +++ b/dcmjpeg/libijg8/jcdctmgr.c @@ -0,0 +1,390 @@ +/* + * jcdctmgr.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the forward-DCT management logic. + * This code selects a particular DCT implementation to be used, + * and it performs related housekeeping chores including coefficient + * quantization. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ +#include "jdct8.h" /* Private declarations for DCT subsystem */ + + +/* Private subobject for this module */ + +typedef struct { + /* Pointer to the DCT routine actually in use */ + forward_DCT_method_ptr do_dct; + + /* The actual post-DCT divisors --- not identical to the quant table + * entries, because of scaling (especially for an unnormalized DCT). + * Each table is given in normal array order. + */ + DCTELEM * divisors[NUM_QUANT_TBLS]; + +#ifdef DCT_FLOAT_SUPPORTED + /* Same as above for the floating-point case. */ + float_DCT_method_ptr do_float_dct; + FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; +#endif +} fdct_controller; + +typedef fdct_controller * fdct_ptr; + + +/* + * Initialize for a processing pass. + * Verify that all referenced Q-tables are present, and set up + * the divisor table for each one. + * In the current implementation, DCT of all components is done during + * the first pass, even if only some components will be output in the + * first scan. Hence all components should be examined here. + */ + +METHODDEF(void) +start_pass_fdctmgr (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + int ci, qtblno, i; + jpeg_component_info *compptr; + JQUANT_TBL * qtbl; + DCTELEM * dtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + qtblno = compptr->quant_tbl_no; + /* Make sure specified quantization table is present */ + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + qtbl = cinfo->quant_tbl_ptrs[qtblno]; + /* Compute divisors for this quant table */ + /* We may do this more than once for same table, but it's not a big deal */ + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + /* For LL&M IDCT method, divisors are equal to raw quantization + * coefficients multiplied by 8 (to counteract scaling). + */ + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; + } + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + */ +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = (DCTELEM) + DESCALE(MULTIPLY16V16((IJG_INT32) qtbl->quantval[i], + (IJG_INT32) aanscales[i]), + CONST_BITS-3); + } + } + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + * What's actually stored is 1/divisor so that the inner loop can + * use a multiplication rather than a division. + */ + FAST_FLOAT * fdtbl; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + if (fdct->float_divisors[qtblno] == NULL) { + fdct->float_divisors[qtblno] = (FAST_FLOAT *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(FAST_FLOAT)); + } + fdtbl = fdct->float_divisors[qtblno]; + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fdtbl[i] = (FAST_FLOAT) + (1.0 / (((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col] * 8.0))); + i++; + } + } + } + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Perform forward DCT on one or more blocks of a component. + * + * The input samples are taken from the sample_data[] array starting at + * position start_row/start_col, and moving to the right for any additional + * blocks. The quantized coefficients are returned in coef_blocks[]. + */ + +METHODDEF(void) +forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for integer DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + forward_DCT_method_ptr do_dct = fdct->do_dct; + DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; + DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { + /* Load data into workspace, applying unsigned->signed conversion */ + { register DCTELEM *workspaceptr; + register JSAMPROW elemptr; + register int elemr; + + workspaceptr = workspace; + for (elemr = 0; elemr < DCTSIZE; elemr++) { + elemptr = sample_data[elemr] + start_col; +#if DCTSIZE == 8 /* unroll the inner loop */ + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; +#else + { register int elemc; + for (elemc = DCTSIZE; elemc > 0; elemc--) { + *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; + } + } +#endif + } + } + + /* Perform the DCT */ + (*do_dct) (workspace); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register DCTELEM temp, qval; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + qval = divisors[i]; + temp = workspace[i]; + /* Divide the coefficient value by qval, ensuring proper rounding. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * + * In most files, at least half of the output values will be zero + * (at default quantization settings, more like three-quarters...) + * so we should ensure that this case is fast. On many machines, + * a comparison is enough cheaper than a divide to make a special test + * a win. Since both inputs will be nonnegative, we need only test + * for a < b to discover whether a/b is 0. + * If your machine's division is fast enough, define FAST_DIVIDE. + */ +#ifdef FAST_DIVIDE +#define DIVIDE_BY(a,b) a /= b +#else +#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 +#endif + if (temp < 0) { + temp = -temp; + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + temp = -temp; + } else { + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + } + output_ptr[i] = (JCOEF) temp; + } + } + } +} + + +#ifdef DCT_FLOAT_SUPPORTED + +METHODDEF(void) +forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for floating-point DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; + float_DCT_method_ptr do_dct = fdct->do_float_dct; + FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; + FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { + /* Load data into workspace, applying unsigned->signed conversion */ + { register FAST_FLOAT *workspaceptr; + register JSAMPROW elemptr; + register int elemr; + + workspaceptr = workspace; + for (elemr = 0; elemr < DCTSIZE; elemr++) { + elemptr = sample_data[elemr] + start_col; +#if DCTSIZE == 8 /* unroll the inner loop */ + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); +#else + { register int elemc; + for (elemc = DCTSIZE; elemc > 0; elemc--) { + *workspaceptr++ = (FAST_FLOAT) + (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); + } + } +#endif + } + } + + /* Perform the DCT */ + (*do_dct) (workspace); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register FAST_FLOAT temp; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + /* Apply the quantization and scaling factor */ + temp = workspace[i] * divisors[i]; + /* Round to nearest integer. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * The maximum coefficient size is +-16K (for 12-bit data), so this + * code should work for either 16-bit or 32-bit ints. + */ + output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384); + } + } + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ + + +/* + * Initialize FDCT manager. + */ + +GLOBAL(void) +jinit_forward_dct (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + fdct_ptr fdct; + int i; + + fdct = (fdct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(fdct_controller)); + lossyc->fdct_private = (struct jpeg_forward_dct *) fdct; + lossyc->fdct_start_pass = start_pass_fdctmgr; + + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + lossyc->fdct_forward_DCT = forward_DCT; + fdct->do_dct = jpeg_fdct_islow; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + lossyc->fdct_forward_DCT = forward_DCT; + fdct->do_dct = jpeg_fdct_ifast; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + lossyc->fdct_forward_DCT = forward_DCT_float; + fdct->do_float_dct = jpeg_fdct_float; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + + /* Mark divisor tables unallocated */ + for (i = 0; i < NUM_QUANT_TBLS; i++) { + fdct->divisors[i] = NULL; +#ifdef DCT_FLOAT_SUPPORTED + fdct->float_divisors[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg8/jcdiffct.c b/dcmjpeg/libijg8/jcdiffct.c new file mode 100644 index 00000000..07bd8427 --- /dev/null +++ b/dcmjpeg/libijg8/jcdiffct.c @@ -0,0 +1,406 @@ +/* + * jcdiffct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the difference buffer controller for compression. + * This controller is the top level of the lossless JPEG compressor proper. + * The difference buffer lies between prediction/differencing and entropy + * encoding. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* We use a full-image sample buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the + * full-image buffer is filled during the first pass, and the scaling, + * prediction and differencing steps are run during subsequent passes. + */ +#ifdef ENTROPY_OPT_SUPPORTED +#define FULL_SAMP_BUFFER_SUPPORTED +#else +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define FULL_SAMP_BUFFER_SUPPORTED +#endif +#endif + + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + JSAMPROW cur_row[MAX_COMPONENTS]; /* row of point transformed samples */ + JSAMPROW prev_row[MAX_COMPONENTS]; /* previous row of Pt'd samples */ + JDIFFARRAY diff_buf[MAX_COMPONENTS]; /* iMCU row of differences */ + + /* In multi-pass modes, we need a virtual sample array for each component. */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +} c_diff_controller; + +typedef c_diff_controller * c_diff_ptr; + + +/* Forward declarations */ +METHODDEF(boolean) compress_data + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#ifdef FULL_SAMP_BUFFER_SUPPORTED +METHODDEF(boolean) compress_first_pass + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(boolean) compress_output + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + diff->MCU_rows_per_iMCU_row = 1; + } else { + if (diff->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + diff->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + diff->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + diff->mcu_ctr = 0; + diff->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_diff (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + + diff->iMCU_row_num = 0; + start_iMCU_row(cinfo); + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (diff->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_data; + break; +#ifdef FULL_SAMP_BUFFER_SUPPORTED + case JBUF_SAVE_AND_PASS: + if (diff->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (diff->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + losslsc->pub.compress_data = compress_output; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +#define SWAP_ROWS(rowa,rowb) {JSAMPROW temp; temp=rowa; rowa=rowb; rowb=temp;} + +/* + * Process some data in the single-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the image. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(boolean) +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_count; /* number of MCUs encoded */ + /* JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; */ + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int comp, ci, yoffset, samp_row, samp_rows, samps_across; + jpeg_component_info *compptr; + + /* Loop to write as much as one whole iMCU row */ + for (yoffset = diff->MCU_vert_offset; yoffset < diff->MCU_rows_per_iMCU_row; + yoffset++) { + + MCU_col_num = diff->mcu_ctr; + + /* Scale and predict each scanline of the MCU-row separately. + * + * Note: We only do this if we are at the start of a MCU-row, ie, + * we don't want to reprocess a row suspended by the output. + */ + if (MCU_col_num == 0) { + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + if (diff->iMCU_row_num < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + else { + /* Fill dummy difference rows at the bottom edge with zeros, which + * will encode to the smallest amount of data. + */ + for (samp_row = samp_rows; samp_row < compptr->v_samp_factor; + samp_row++) + MEMZERO(diff->diff_buf[ci][samp_row], + (size_t)jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor) * SIZEOF(JDIFF)); + } + } + samps_across = (int)compptr->width_in_data_units; + + for (samp_row = 0; samp_row < samp_rows; samp_row++) { + (*losslsc->scaler_scale) (cinfo, + input_buf[ci][samp_row], + diff->cur_row[ci], (JDIMENSION)samps_across); + (*losslsc->predict_difference[ci]) (cinfo, ci, + diff->cur_row[ci], + diff->prev_row[ci], + diff->diff_buf[ci][samp_row], + (JDIMENSION)samps_across); + SWAP_ROWS(diff->cur_row[ci], diff->prev_row[ci]); + } + } + } + + /* Try to write the MCU-row (or remaining portion of suspended MCU-row). */ + MCU_count = + (*losslsc->entropy_encode_mcus) (cinfo, + diff->diff_buf, (JDIMENSION)yoffset, MCU_col_num, + (JDIMENSION)cinfo->MCUs_per_row - MCU_col_num); + if (MCU_count != cinfo->MCUs_per_row - MCU_col_num) { + /* Suspension forced; update state counters and exit */ + diff->MCU_vert_offset = yoffset; + diff->mcu_ctr += MCU_col_num; + return FALSE; + } + + /* Completed an MCU row, but perhaps not an iMCU row */ + diff->mcu_ctr = 0; + } + + /* Completed the iMCU row, advance counters for next one */ + diff->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +#ifdef FULL_SAMP_BUFFER_SUPPORTED + +/* + * Process some data in the first pass of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the image. + * This amount of data is read from the source buffer and saved into the + * virtual arrays. + * + * We must also emit the data to the compressor. This is conveniently + * done by calling compress_output() after we've loaded the current strip + * of the virtual arrays. + * + * NB: input_buf contains a plane for each component in image. All components + * are loaded into the virtual arrays in this pass. However, it may be that + * only a subset of the components are emitted to the compressor during + * this first pass; be careful about looking at the scan-dependent variables + * (MCU dimensions, etc). + */ + +METHODDEF(boolean) +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION samps_across; + int ci, samp_row, samp_rows; + JSAMPARRAY buffer[MAX_COMPONENTS]; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffers for this component. */ + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + diff->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + + /* Count non-dummy sample rows in this iMCU row. */ + if (diff->iMCU_row_num < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + } + samps_across = compptr->width_in_data_units; + + /* Perform point transform scaling and prediction/differencing for all + * non-dummy rows in this iMCU row. Each call on these functions + * process a complete row of samples. + */ + for (samp_row = 0; samp_row < samp_rows; samp_row++) { + MEMCOPY(buffer[ci][samp_row], input_buf[ci][samp_row], + samps_across * SIZEOF(JSAMPLE)); + } + } + + /* NB: compress_output will increment iMCU_row_num if successful. + * A suspension return will result in redoing all the work above next time. + */ + + /* Emit data to the compressor, sharing code with subsequent passes */ + return compress_output(cinfo, input_buf); +} + + +/* + * Process some data in subsequent passes of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the compressor. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private; + /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */ + /* JDIMENSION MCU_count; */ /* number of MCUs encoded */ + int comp, ci /* , yoffset */ ; + JSAMPARRAY buffer[MAX_COMPONENTS]; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. + * NB: during first pass, this is safe only because the buffers will + * already be aligned properly, so jmemmgr.c won't need to do any I/O. + */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + diff->iMCU_row_num * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + return compress_data(cinfo, buffer); +} + +#endif /* FULL_SAMP_BUFFER_SUPPORTED */ + + +/* + * Initialize difference buffer controller. + */ + +GLOBAL(void) +jinit_c_diff_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_diff_ptr diff; + int ci, row; + jpeg_component_info *compptr; + + diff = (c_diff_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_diff_controller)); + losslsc->diff_private = (void *) diff; + losslsc->diff_start_pass = start_pass_diff; + + /* Create the prediction row buffers. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->cur_row[ci] = *(*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) 1); + diff->prev_row[ci] = *(*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) 1); + } + + /* Create the difference buffer. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->diff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + /* Prefill difference rows with zeros. We do this because only actual + * data is placed in the buffers during prediction/differencing, leaving + * any dummy differences at the right edge as zeros, which will encode + * to the smallest amount of data. + */ + for (row = 0; row < compptr->v_samp_factor; row++) + MEMZERO(diff->diff_buf[ci][row], + (size_t)jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor) * SIZEOF(JDIFF)); + } + + /* Create the sample buffer. */ + if (need_full_buffer) { +#ifdef FULL_SAMP_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor differences in each direction. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else + diff->whole_image[0] = NULL; /* flag for no virtual arrays */ +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jchuff.c b/dcmjpeg/libijg8/jchuff.c new file mode 100644 index 00000000..d741785a --- /dev/null +++ b/dcmjpeg/libijg8/jchuff.c @@ -0,0 +1,274 @@ +/* + * jchuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines which are shared + * by the sequential, progressive and lossless decoders. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jchuff8.h" /* Declarations shared with jc*huff.c */ + + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +GLOBAL(void) +jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, + c_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + c_derived_tbl *dtbl; + int p, i, l, lastp, si, maxsymbol; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (c_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_derived_tbl)); + dtbl = *pdtbl; + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + lastp = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + * BUG FIX: Comparison must be >, not >= + */ + if (((IJG_INT32) code) > (((IJG_INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure C.3: generate encoding tables */ + /* These are code and size indexed by symbol value */ + + /* Set all codeless symbols to have code length 0; + * this lets us detect duplicate VAL entries here, and later + * allows emit_bits to detect any attempt to emit such symbols. + */ + MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi)); + + /* This is also a convenient place to check for out-of-range + * and duplicated VAL entries. We allow 0..255 for AC symbols + * but only 0..16 for DC. (We could constrain them further + * based on data depth and mode, but this seems enough.) + */ + maxsymbol = isDC ? 16 : 255; + + for (p = 0; p < lastp; p++) { + i = htbl->huffval[p]; + if (i < 0 || i > maxsymbol || dtbl->ehufsi[i]) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + dtbl->ehufco[i] = huffcode[p]; + dtbl->ehufsi[i] = huffsize[p]; + } +} + + +/* + * Generate the best Huffman code table for the given counts, fill htbl. + * + * The JPEG standard requires that no symbol be assigned a codeword of all + * one bits (so that padding bits added at the end of a compressed segment + * can't look like a valid code). Because of the canonical ordering of + * codewords, this just means that there must be an unused slot in the + * longest codeword length category. Section K.2 of the JPEG spec suggests + * reserving such a slot by pretending that symbol 256 is a valid symbol + * with count 1. In theory that's not optimal; giving it count zero but + * including it in the symbol set anyway should give a better Huffman code. + * But the theoretically better code actually seems to come out worse in + * practice, because it produces more all-ones bytes (which incur stuffed + * zero bytes in the final file). In any case the difference is tiny. + * + * The JPEG standard requires Huffman codes to be no more than 16 bits long. + * If some symbols have a very small but nonzero probability, the Huffman tree + * must be adjusted to meet the code length restriction. We currently use + * the adjustment method suggested in JPEG section K.2. This method is *not* + * optimal; it may not choose the best possible limited-length code. But + * typically only very-low-frequency symbols will be given less-than-optimal + * lengths, so the code is almost optimal. Experimental comparisons against + * an optimal limited-length-code algorithm indicate that the difference is + * microscopic --- usually less than a hundredth of a percent of total size. + * So the extra complexity of an optimal algorithm doesn't seem worthwhile. + */ + +GLOBAL(void) +jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) +{ +#define MAX_CLEN 32 /* assumed maximum initial code length */ + UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ + int codesize[257]; /* codesize[k] = code length of symbol k */ + int others[257]; /* next symbol in current branch of tree */ + int c1, c2; + int p, i, j; + long v; + + /* This algorithm is explained in section K.2 of the JPEG standard */ + + MEMZERO(bits, SIZEOF(bits)); + MEMZERO(codesize, SIZEOF(codesize)); + for (i = 0; i < 257; i++) + others[i] = -1; /* init links to empty */ + + freq[256] = 1; /* make sure 256 has a nonzero count */ + /* Including the pseudo-symbol 256 in the Huffman procedure guarantees + * that no real symbol is given code-value of all ones, because 256 + * will be placed last in the largest codeword category. + */ + + /* Huffman's basic algorithm to assign optimal code lengths to symbols */ + + for (;;) { + /* Find the smallest nonzero frequency, set c1 = its symbol */ + /* In case of ties, take the larger symbol number */ + c1 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v) { + v = freq[i]; + c1 = i; + } + } + + /* Find the next smallest nonzero frequency, set c2 = its symbol */ + /* In case of ties, take the larger symbol number */ + c2 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v && i != c1) { + v = freq[i]; + c2 = i; + } + } + + /* Done if we've merged everything into one frequency */ + if (c2 < 0) + break; + + /* Else merge the two counts/trees */ + freq[c1] += freq[c2]; + freq[c2] = 0; + + /* Increment the codesize of everything in c1's tree branch */ + codesize[c1]++; + while (others[c1] >= 0) { + c1 = others[c1]; + codesize[c1]++; + } + + others[c1] = c2; /* chain c2 onto c1's tree branch */ + + /* Increment the codesize of everything in c2's tree branch */ + codesize[c2]++; + while (others[c2] >= 0) { + c2 = others[c2]; + codesize[c2]++; + } + } + + /* Now count the number of symbols of each code length */ + for (i = 0; i <= 256; i++) { + if (codesize[i]) { + /* The JPEG standard seems to think that this can't happen, */ + /* but I'm paranoid... */ + if (codesize[i] > MAX_CLEN) + ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW); + + bits[codesize[i]]++; + } + } + + /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure + * Huffman procedure assigned any such lengths, we must adjust the coding. + * Here is what the JPEG spec says about how this next bit works: + * Since symbols are paired for the longest Huffman code, the symbols are + * removed from this length category two at a time. The prefix for the pair + * (which is one bit shorter) is allocated to one of the pair; then, + * skipping the BITS entry for that prefix length, a code word from the next + * shortest nonzero BITS entry is converted into a prefix for two code words + * one bit longer. + */ + + for (i = MAX_CLEN; i > 16; i--) { + while (bits[i] > 0) { + j = i - 2; /* find length of new prefix to be used */ + while (bits[j] == 0) + j--; + + bits[i] = (UINT8)(bits[i] - 2); /* remove two symbols */ + bits[i-1]++; /* one goes in this length */ + bits[j+1] = (UINT8)(bits[j+1] + 2); /* two new symbols in this length */ + bits[j]--; /* symbol of this length is now a prefix */ + } + } + + /* Remove the count for the pseudo-symbol 256 from the largest codelength */ + while (bits[i] == 0) /* find largest codelength still in use */ + i--; + bits[i]--; + + /* Return final symbol counts (only for lengths 0..16) */ + MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); + + /* Return a list of the symbols sorted by code length */ + /* It's not real clear to me why we don't need to consider the codelength + * changes made above, but the JPEG spec seems to think this works. + */ + p = 0; + for (i = 1; i <= MAX_CLEN; i++) { + for (j = 0; j <= 255; j++) { + if (codesize[j] == i) { + htbl->huffval[p] = (UINT8) j; + p++; + } + } + } + + /* Set sent_table FALSE so updated table will be written to JPEG file. */ + htbl->sent_table = FALSE; +} diff --git a/dcmjpeg/libijg8/jchuff8.h b/dcmjpeg/libijg8/jchuff8.h new file mode 100644 index 00000000..cb088c26 --- /dev/null +++ b/dcmjpeg/libijg8/jchuff8.h @@ -0,0 +1,54 @@ +/* + * jchuff.h + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains declarations for Huffman entropy encoding routines + * that are shared between the sequential encoder (jchuff.c) and the + * progressive encoder (jcphuff.c). No other modules need to see these. + */ + +/* The legal range of a DCT coefficient is + * -1024 .. +1023 for 8-bit data; + * -16384 .. +16383 for 12-bit data. + * Hence the magnitude should always fit in 10 or 14 bits respectively. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MAX_COEF_BITS 10 +#else +#define MAX_COEF_BITS 14 +#endif + +/* The legal range of a spatial difference is + * -32767 .. +32768. + * Hence the magnitude should always fit in 16 bits. + */ + +#define MAX_DIFF_BITS 16 + +/* Derived data constructed for each Huffman table */ + +typedef struct { + unsigned int ehufco[256]; /* code for each symbol */ + char ehufsi[256]; /* length of code for each symbol */ + /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ +} c_derived_tbl; + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_make_c_derived_tbl jpeg8_make_c_derived_tbl +#define jpeg_gen_optimal_table jpeg8_gen_optimal_table +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Expand a Huffman table definition into the derived format */ +EXTERN(void) jpeg_make_c_derived_tbl + JPP((j_compress_ptr cinfo, boolean isDC, int tblno, + c_derived_tbl ** pdtbl)); + +/* Generate an optimal table definition given the specified counts */ +EXTERN(void) jpeg_gen_optimal_table + JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])); diff --git a/dcmjpeg/libijg8/jcinit.c b/dcmjpeg/libijg8/jcinit.c new file mode 100644 index 00000000..4df06d65 --- /dev/null +++ b/dcmjpeg/libijg8/jcinit.c @@ -0,0 +1,57 @@ +/* + * jcinit.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains initialization logic for the JPEG compressor. + * This routine is in charge of selecting the modules to be executed and + * making an initialization call to each one. + * + * Logically, this code belongs in jcmaster.c. It's split out because + * linking this routine implies linking the entire compression library. + * For a transcoding-only application, we want to be able to use jcmaster.c + * without linking in the whole library. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Master selection of compression modules. + * This is done once at the start of processing an image. We determine + * which modules will be used and give them appropriate initialization calls. + */ + +GLOBAL(void) +jinit_compress_master (j_compress_ptr cinfo) +{ + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, FALSE /* full compression */); + + /* Initialize compression codec */ + jinit_c_codec(cinfo); + + /* Preprocessing */ + if (! cinfo->raw_data_in) { + jinit_color_converter(cinfo); + jinit_downsampler(cinfo); + jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); + } + + jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} diff --git a/dcmjpeg/libijg8/jclhuff.c b/dcmjpeg/libijg8/jclhuff.c new file mode 100644 index 00000000..d53a626e --- /dev/null +++ b/dcmjpeg/libijg8/jclhuff.c @@ -0,0 +1,601 @@ +/* + * jclhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for lossless JPEG. + * + * Much of the complexity here has to do with supporting output suspension. + * If the data destination module demands suspension, we want to be able to + * back up to the start of the current MCU. To do this, we copy state + * variables into local working storage, and update them back to the + * permanent JPEG objects only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" /* Private declarations for lossless codec */ +#include "jchuff8.h" /* Declarations shared with jc*huff.c */ + + +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#define ASSIGN_STATE(dest,src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits) +#endif + + +typedef struct { + int ci, yoffset, MCU_width; +} lhe_input_ptr_info; + + +typedef struct { + savable_state saved; /* Bit buffer at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Pointers to derived tables to be used for each data unit within an MCU */ + c_derived_tbl * cur_tbls[C_MAX_DATA_UNITS_IN_MCU]; + +#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ + long * count_ptrs[NUM_HUFF_TBLS]; + + /* Pointers to stats tables to be used for each data unit within an MCU */ + long * cur_counts[C_MAX_DATA_UNITS_IN_MCU]; +#endif + + /* Pointers to the proper input difference row for each group of data units + * within an MCU. For each component, there are Vi groups of Hi data units. + */ + JDIFFROW input_ptr[C_MAX_DATA_UNITS_IN_MCU]; + + /* Number of input pointers in use for the current MCU. This is the sum + * of all Vi in the MCU. + */ + int num_input_ptrs; + + /* Information used for positioning the input pointers within the input + * difference rows. + */ + lhe_input_ptr_info input_ptr_info[C_MAX_DATA_UNITS_IN_MCU]; + + /* Index of the proper input pointer for each data unit within an MCU */ + int input_ptr_index[C_MAX_DATA_UNITS_IN_MCU]; + +} lhuff_entropy_encoder; + +typedef lhuff_entropy_encoder * lhuff_entropy_ptr; + +/* Working state while writing an MCU. + * This struct contains all the fields that are needed by subroutines. + */ + +typedef struct { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ +} working_state; + + +/* Forward declarations */ +METHODDEF(JDIMENSION) encode_mcus_huff (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU); +METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); +#ifdef ENTROPY_OPT_SUPPORTED +METHODDEF(JDIMENSION) encode_mcus_gather (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU); +METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); +#endif + + +/* + * Initialize for a Huffman-compressed scan. + * If gather_statistics is TRUE, we do not output anything during the scan, + * just count the Huffman symbols used and generate Huffman code tables. + */ + +METHODDEF(void) +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + int ci, dctbl, sampn, ptrn, yoffset, xoffset; + jpeg_component_info * compptr; + + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + losslsc->entropy_encode_mcus = encode_mcus_gather; + losslsc->pub.entropy_finish_pass = finish_pass_gather; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + losslsc->entropy_encode_mcus = encode_mcus_huff; + losslsc->pub.entropy_finish_pass = finish_pass_huff; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + /* Check for invalid table indexes */ + /* (make_c_derived_tbl does this in the other path) */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->count_ptrs[dctbl] == NULL) + entropy->count_ptrs[dctbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->count_ptrs[dctbl], 257 * SIZEOF(long)); +#endif + } else { + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, + & entropy->derived_tbls[dctbl]); + } + } + + /* Precalculate encoding info for each sample in an MCU of this scan */ + for (sampn = 0, ptrn = 0; sampn < cinfo->data_units_in_MCU;) { + compptr = cinfo->cur_comp_info[cinfo->MCU_membership[sampn]]; + ci = compptr->component_index; + /* ci = cinfo->MCU_membership[sampn]; + compptr = cinfo->cur_comp_info[ci];*/ + for (yoffset = 0; yoffset < compptr->MCU_height; yoffset++, ptrn++) { + /* Precalculate the setup info for each input pointer */ + entropy->input_ptr_info[ptrn].ci = ci; + entropy->input_ptr_info[ptrn].yoffset = yoffset; + entropy->input_ptr_info[ptrn].MCU_width = compptr->MCU_width; + for (xoffset = 0; xoffset < compptr->MCU_width; xoffset++, sampn++) { + /* Precalculate the input pointer index for each sample */ + entropy->input_ptr_index[sampn] = ptrn; + /* Precalculate which tables to use for each sample */ + entropy->cur_tbls[sampn] = entropy->derived_tbls[compptr->dc_tbl_no]; + entropy->cur_counts[sampn] = entropy->count_ptrs[compptr->dc_tbl_no]; + } + } + } + entropy->num_input_ptrs = ptrn; + + /* Initialize bit buffer to empty */ + entropy->saved.put_buffer = 0; + entropy->saved.put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file */ + +/* Emit a byte, taking 'action' if must suspend. */ +#define emit_byte(state,val,action) \ + { *(state)->next_output_byte++ = (JOCTET) (val); \ + if (--(state)->free_in_buffer == 0) \ + if (! dump_buffer(state)) \ + { action; } } + + +LOCAL(boolean) +dump_buffer (working_state * state) +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +{ + struct jpeg_destination_mgr * dest = state->cinfo->dest; + + if (! (*dest->empty_output_buffer) (state->cinfo)) + return FALSE; + /* After a successful buffer dump, must reset buffer pointers */ + state->next_output_byte = dest->next_output_byte; + state->free_in_buffer = dest->free_in_buffer; + return TRUE; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(boolean) +emit_bits (working_state * state, unsigned int code, int size) +/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = state->cur.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); + + put_buffer &= (((IJG_INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(state, c, return FALSE); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(state, 0, return FALSE); + } + put_buffer <<= 8; + put_bits -= 8; + } + + state->cur.put_buffer = put_buffer; /* update state variables */ + state->cur.put_bits = put_bits; + + return TRUE; +} + + +LOCAL(boolean) +flush_bits (working_state * state) +{ + if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ + return FALSE; + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ + state->cur.put_bits = 0; + return TRUE; +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(boolean) +emit_restart (working_state * state, int restart_num) +{ + /* int ci; */ + + if (! flush_bits(state)) + return FALSE; + + emit_byte(state, 0xFF, return FALSE); + emit_byte(state, JPEG_RST0 + restart_num, return FALSE); + + /* The restart counter is not updated until we successfully write the MCU. */ + + return TRUE; +} + + +/* + * Encode and output one nMCU's worth of Huffman-compressed differences. + */ + +METHODDEF(JDIMENSION) +encode_mcus_huff (j_compress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, + JDIMENSION nMCU) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + working_state state; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + /* jpeg_component_info * compptr; */ + + /* Load up working state */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! emit_restart(&state, entropy->next_restart_num)) + return 0; + } + + /* Set input pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_input_ptrs; ptrn++) { + ci = entropy->input_ptr_info[ptrn].ci; + yoffset = entropy->input_ptr_info[ptrn].yoffset; + MCU_width = entropy->input_ptr_info[ptrn].MCU_width; + entropy->input_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (size_t)yoffset] + MCU_col_num * (size_t)MCU_width; + } + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + register int temp, temp2 /* , temp3 */ ; + register int nbits; + c_derived_tbl *dctbl = entropy->cur_tbls[sampn]; + + /* Encode the difference per section H.1.2.2 */ + + /* Input the sample difference */ + temp = *entropy->input_ptr[entropy->input_ptr_index[sampn]]++; + + if (temp & 0x8000) { /* instead of temp < 0 */ + temp = (-temp) & 0x7FFF; /* absolute value, mod 2^16 */ + if (temp == 0) /* special case: magnitude = 32768 */ + temp2 = temp = 0x8000; + temp2 = ~ temp; /* one's complement of magnitude */ + } else { + temp &= 0x7FFF; /* abs value mod 2^16 */ + temp2 = temp; /* magnitude */ + } + + /* Find the number of bits needed for the magnitude of the difference */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range difference values. + */ + if (nbits > MAX_DIFF_BITS) + ERREXIT(cinfo, JERR_BAD_DIFF); + + /* Emit the Huffman-coded symbol for the number of bits */ + if (! emit_bits(&state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) + return mcu_num; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits && /* emit_bits rejects calls with size 0 */ + nbits != 16) /* special case: no bits should be emitted */ + if (! emit_bits(&state, (unsigned int) temp2, nbits)) + return mcu_num; + } + + /* Completed MCU, so update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + } + + return nMCU; +} + + +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + working_state state; + + /* Load up working state ... flush_bits needs it */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Flush out the last data */ + if (! flush_bits(&state)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); +} + + +/* + * Huffman coding optimization. + * + * We first scan the supplied data and count the number of uses of each symbol + * that is to be Huffman-coded. (This process MUST agree with the code above.) + * Then we build a Huffman coding tree for the observed counts. + * Symbols which are not needed at all for the particular image are not + * assigned any code, which saves space in the DHT marker as well as in + * the compressed data. + */ + +#ifdef ENTROPY_OPT_SUPPORTED + +/* + * Trial-encode one nMCU's worth of Huffman-compressed differences. + * No data is actually output, so no suspension return is possible. + */ + +METHODDEF(JDIMENSION) +encode_mcus_gather (j_compress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, + JDIMENSION nMCU) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + /* jpeg_component_info * compptr; */ + + /* Take care of restart intervals if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + /* Update restart state */ + entropy->restarts_to_go = cinfo->restart_interval; + } + entropy->restarts_to_go--; + } + + /* Set input pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_input_ptrs; ptrn++) { + ci = entropy->input_ptr_info[ptrn].ci; + yoffset = entropy->input_ptr_info[ptrn].yoffset; + MCU_width = entropy->input_ptr_info[ptrn].MCU_width; + entropy->input_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (size_t)yoffset] + MCU_col_num * (size_t)MCU_width; + } + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + register int temp; + register int nbits; + /* c_derived_tbl *dctbl = entropy->cur_tbls[sampn]; */ + long * counts = entropy->cur_counts[sampn]; + + /* Encode the difference per section H.1.2.2 */ + + /* Input the sample difference */ + temp = *entropy->input_ptr[entropy->input_ptr_index[sampn]]++; + + if (temp & 0x8000) { /* instead of temp < 0 */ + temp = (-temp) & 0x7FFF; /* absolute value, mod 2^16 */ + if (temp == 0) /* special case: magnitude = 32768 */ + temp = 0x8000; + } else + temp &= 0x7FFF; /* abs value mod 2^16 */ + + /* Find the number of bits needed for the magnitude of the difference */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range difference values. + */ + if (nbits > MAX_DIFF_BITS) + ERREXIT(cinfo, JERR_BAD_DIFF); + + /* Count the Huffman symbol for the number of bits */ + counts[nbits]++; + } + } + + return nMCU; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsc->entropy_private; + int ci, dctbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did_dc[NUM_HUFF_TBLS]; + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did_dc, SIZEOF(did_dc)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + if (! did_dc[dctbl]) { + htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[dctbl]); + did_dc[dctbl] = TRUE; + } + } +} + + +#endif /* ENTROPY_OPT_SUPPORTED */ + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_lhuff_encoder (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + lhuff_entropy_ptr entropy; + int i; + + entropy = (lhuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(lhuff_entropy_encoder)); + losslsc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + losslsc->pub.entropy_start_pass = start_pass_huff; + losslsc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; +#ifdef ENTROPY_OPT_SUPPORTED + entropy->count_ptrs[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg8/jclossls.c b/dcmjpeg/libijg8/jclossls.c new file mode 100644 index 00000000..0b534c1e --- /dev/null +++ b/dcmjpeg/libijg8/jclossls.c @@ -0,0 +1,82 @@ +/* + * jclossls.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossless JPEG compressor. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" + + +#ifdef C_LOSSLESS_SUPPORTED + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + (*losslsc->scaler_start_pass) (cinfo); + (*losslsc->predict_start_pass) (cinfo); + (*losslsc->diff_start_pass) (cinfo, pass_mode); +} + + +/* + * Initialize the lossless compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossless_c_codec(j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc; + + /* Create subobject in permanent pool */ + losslsc = (j_lossless_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossless_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) losslsc; + + /* Initialize sub-modules */ + + /* Scaler */ + jinit_c_scaler(cinfo); + + /* Differencer */ + jinit_differencer(cinfo); + + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + jinit_lhuff_encoder(cinfo); + } + + /* Need a full-image difference buffer in any multi-pass mode. */ + jinit_c_diff_controller(cinfo, + (boolean) (cinfo->num_scans > 1 || + cinfo->optimize_coding)); + + /* Initialize method pointers. + * + * Note: entropy_start_pass and entropy_finish_pass are assigned in + * jclhuff.c and compress_data is assigned in jcdiffct.c. + */ + losslsc->pub.start_pass = start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jclossy.c b/dcmjpeg/libijg8/jclossy.c new file mode 100644 index 00000000..5d1c30c3 --- /dev/null +++ b/dcmjpeg/libijg8/jclossy.c @@ -0,0 +1,80 @@ +/* + * jclossy.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossy JPEG compressor. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + + (*lossyc->fdct_start_pass) (cinfo); + (*lossyc->coef_start_pass) (cinfo, pass_mode); +} + + +/* + * Initialize the lossy compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossy_c_codec (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc; + + /* Create subobject in permanent pool */ + lossyc = (j_lossy_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) lossyc; + + /* Initialize sub-modules */ + + /* Forward DCT */ + jinit_forward_dct(cinfo); + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + jinit_phuff_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_encoder(cinfo); + } + + /* Need a full-image coefficient buffer in any multi-pass mode. */ + jinit_c_coef_controller(cinfo, + (boolean) (cinfo->num_scans > 1 || + cinfo->optimize_coding)); + + /* Initialize method pointers. + * + * Note: entropy_start_pass and entropy_finish_pass are assigned in + * jcshuff.c or jcphuff.c and compress_data is assigned in jccoefct.c. + */ + lossyc->pub.start_pass = start_pass; +} diff --git a/dcmjpeg/libijg8/jcmainct.c b/dcmjpeg/libijg8/jcmainct.c new file mode 100644 index 00000000..64c95740 --- /dev/null +++ b/dcmjpeg/libijg8/jcmainct.c @@ -0,0 +1,296 @@ +/* + * jcmainct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for compression. + * The main buffer lies between the pre-processor and the JPEG + * compressor proper; it holds downsampled data in the JPEG colorspace. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Note: currently, there is no operating mode in which a full-image buffer + * is needed at this step. If there were, that mode could not be used with + * "raw data" input, since this module is bypassed in that case. However, + * we've left the code here for possible use in special applications. + */ +#undef FULL_MAIN_BUFFER_SUPPORTED + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_main_controller pub; /* public fields */ + + JDIMENSION cur_iMCU_row; /* number of current iMCU row */ + JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */ + boolean suspended; /* remember if we suspended output */ + J_BUF_MODE pass_mode; /* current operating mode */ + + /* If using just a strip buffer, this points to the entire set of buffers + * (we allocate one for each component). In the full-image case, this + * points to the currently accessible strips of the virtual arrays. + */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* If using full-image storage, this array holds pointers to virtual-array + * control blocks for each component. Unused if not full-image storage. + */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +#endif +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#ifdef FULL_MAIN_BUFFER_SUPPORTED +METHODDEF(void) process_data_buffer_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + /* Do nothing in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + mymain->cur_iMCU_row = 0; /* initialize counters */ + mymain->rowgroup_ctr = 0; + mymain->suspended = FALSE; + mymain->pass_mode = pass_mode; /* save mode for use by process_data */ + + switch (pass_mode) { + case JBUF_PASS_THRU: +#ifdef FULL_MAIN_BUFFER_SUPPORTED + if (mymain->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + mymain->pub.process_data = process_data_simple_main; + break; +#ifdef FULL_MAIN_BUFFER_SUPPORTED + case JBUF_SAVE_SOURCE: + case JBUF_CRANK_DEST: + case JBUF_SAVE_AND_PASS: + if (mymain->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + mymain->pub.process_data = process_data_buffer_main; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This routine handles the simple pass-through mode, + * where we have only a strip buffer. + */ + +METHODDEF(void) +process_data_simple_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); + + while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Read input data if we haven't filled the main buffer yet */ + if (mymain->rowgroup_ctr < data_unit) + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mymain->buffer, &mymain->rowgroup_ctr, + (JDIMENSION) data_unit); + + /* If we don't have a full iMCU row buffered, return to application for + * more data. Note that preprocessor will always pad to fill the iMCU row + * at the bottom of the image. + */ + if (mymain->rowgroup_ctr != data_unit) + return; + + /* Send the completed row to the compressor */ + if (! (*cinfo->codec->compress_data) (cinfo, mymain->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mymain->suspended) { + (*in_row_ctr)--; + mymain->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mymain->suspended) { + (*in_row_ctr)++; + mymain->suspended = FALSE; + } + mymain->rowgroup_ctr = 0; + mymain->cur_iMCU_row++; + } +} + + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + +/* + * Process some data. + * This routine handles all of the modes that use a full-size buffer. + */ + +METHODDEF(void) +process_data_buffer_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci; + jpeg_component_info *compptr; + boolean writing = (mymain->pass_mode != JBUF_CRANK_DEST); + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); + + while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Realign the virtual buffers if at the start of an iMCU row. */ + if (mymain->rowgroup_ctr == 0) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, mymain->whole_image[ci], + mymain->cur_iMCU_row * (compptr->v_samp_factor * data_unit), + (JDIMENSION) (compptr->v_samp_factor * data_unit), writing); + } + /* In a read pass, pretend we just read some source data. */ + if (! writing) { + *in_row_ctr += cinfo->max_v_samp_factor * data_unit; + mymain->rowgroup_ctr = data_unit; + } + } + + /* If a write pass, read input data until the current iMCU row is full. */ + /* Note: preprocessor will pad if necessary to fill the last iMCU row. */ + if (writing) { + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mymain->buffer, &mymain->rowgroup_ctr, + (JDIMENSION) data_unit); + /* Return to application if we need more data to fill the iMCU row. */ + if (mymain->rowgroup_ctr < data_unit) + return; + } + + /* Emit data, unless this is a sink-only pass. */ + if (mymain->pass_mode != JBUF_SAVE_SOURCE) { + if (! (*cinfo->codec->compress_data) (cinfo, mymain->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mymain->suspended) { + (*in_row_ctr)--; + mymain->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mymain->suspended) { + (*in_row_ctr)++; + mymain->suspended = FALSE; + } + } + + /* If get here, we are done with this iMCU row. Mark buffer empty. */ + mymain->rowgroup_ctr = 0; + mymain->cur_iMCU_row++; + } +} + +#endif /* FULL_MAIN_BUFFER_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mymain; + int ci; + jpeg_component_info *compptr; + int data_unit = cinfo->data_unit; + + mymain = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = (struct jpeg_c_main_controller *) mymain; + mymain->pub.start_pass = start_pass_main; + + /* We don't need to create a buffer in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + /* Create the buffer. It holds downsampled data, so each component + * may be of a different size. + */ + if (need_full_buffer) { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component */ + /* Note we pad the bottom to a multiple of the iMCU height */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + compptr->width_in_data_units * data_unit, + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor) * data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + mymain->whole_image[0] = NULL; /* flag for no virtual arrays */ +#endif + /* Allocate a strip buffer for each component */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mymain->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_data_units * (JDIMENSION)data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); + } + } +} diff --git a/dcmjpeg/libijg8/jcmarker.c b/dcmjpeg/libijg8/jcmarker.c new file mode 100644 index 00000000..05ee5f05 --- /dev/null +++ b/dcmjpeg/libijg8/jcmarker.c @@ -0,0 +1,680 @@ +/* + * jcmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write JPEG datastream markers. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_writer pub; /* public fields */ + + unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */ +} my_marker_writer; + +typedef my_marker_writer * my_marker_ptr; + + +/* + * Basic output routines. + * + * Note that we do not support suspension while writing a marker. + * Therefore, an application using suspension must ensure that there is + * enough buffer space for the initial markers (typ. 600-700 bytes) before + * calling jpeg_start_compress, and enough space to write the trailing EOI + * (a few bytes) before calling jpeg_finish_compress. Multipass compression + * modes are not supported at all with suspension, so those two are the only + * points where markers will be written. + */ + +LOCAL(void) +emit_byte (j_compress_ptr cinfo, int val) +/* Emit a byte */ +{ + struct jpeg_destination_mgr * dest = cinfo->dest; + + *(dest->next_output_byte)++ = (JOCTET) val; + if (--dest->free_in_buffer == 0) { + if (! (*dest->empty_output_buffer) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } +} + + +LOCAL(void) +emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark) +/* Emit a marker code */ +{ + emit_byte(cinfo, 0xFF); + emit_byte(cinfo, (int) mark); +} + + +LOCAL(void) +emit_2bytes (j_compress_ptr cinfo, int value) +/* Emit a 2-byte integer; these are always MSB first in JPEG files */ +{ + emit_byte(cinfo, (value >> 8) & 0xFF); + emit_byte(cinfo, value & 0xFF); +} + + +/* + * Routines to write specific marker types. + */ + +LOCAL(int) +emit_dqt (j_compress_ptr cinfo, int idx) +/* Emit a DQT marker */ +/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ +{ + JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[idx]; + int prec; + int i; + + if (qtbl == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, idx); + + prec = 0; + for (i = 0; i < DCTSIZE2; i++) { + if (qtbl->quantval[i] > 255) + prec = 1; + } + + if (! qtbl->sent_table) { + emit_marker(cinfo, M_DQT); + + emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2); + + emit_byte(cinfo, idx + (prec<<4)); + + for (i = 0; i < DCTSIZE2; i++) { + /* The table entries must be emitted in zigzag order. */ + unsigned int qval = qtbl->quantval[jpeg_natural_order[i]]; + if (prec) + emit_byte(cinfo, (int) (qval >> 8)); + emit_byte(cinfo, (int) (qval & 0xFF)); + } + + qtbl->sent_table = TRUE; + } + + return prec; +} + + +LOCAL(void) +emit_dht (j_compress_ptr cinfo, int idx, boolean is_ac) +/* Emit a DHT marker */ +{ + JHUFF_TBL * htbl; + int length, i; + + if (is_ac) { + htbl = cinfo->ac_huff_tbl_ptrs[idx]; + idx += 0x10; /* output index has AC bit set */ + } else { + htbl = cinfo->dc_huff_tbl_ptrs[idx]; + } + + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, idx); + + if (! htbl->sent_table) { + emit_marker(cinfo, M_DHT); + + length = 0; + for (i = 1; i <= 16; i++) + length += htbl->bits[i]; + + emit_2bytes(cinfo, length + 2 + 1 + 16); + emit_byte(cinfo, idx); + + for (i = 1; i <= 16; i++) + emit_byte(cinfo, htbl->bits[i]); + + for (i = 0; i < length; i++) + emit_byte(cinfo, htbl->huffval[i]); + + htbl->sent_table = TRUE; + } +} + + +LOCAL(void) +emit_dac (j_compress_ptr cinfo) +/* Emit a DAC marker */ +/* Since the useful info is so small, we want to emit all the tables in */ +/* one DAC marker. Therefore this routine does its own scan of the table. */ +{ +#ifdef C_ARITH_CODING_SUPPORTED + char dc_in_use[NUM_ARITH_TBLS]; + char ac_in_use[NUM_ARITH_TBLS]; + int length, i; + jpeg_component_info *compptr; + + for (i = 0; i < NUM_ARITH_TBLS; i++) + dc_in_use[i] = ac_in_use[i] = 0; + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + dc_in_use[compptr->dc_tbl_no] = 1; + ac_in_use[compptr->ac_tbl_no] = 1; + } + + length = 0; + for (i = 0; i < NUM_ARITH_TBLS; i++) + length += dc_in_use[i] + ac_in_use[i]; + + emit_marker(cinfo, M_DAC); + + emit_2bytes(cinfo, length*2 + 2); + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + if (dc_in_use[i]) { + emit_byte(cinfo, i); + emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); + } + if (ac_in_use[i]) { + emit_byte(cinfo, i + 0x10); + emit_byte(cinfo, cinfo->arith_ac_K[i]); + } + } +#endif /* C_ARITH_CODING_SUPPORTED */ +} + + +LOCAL(void) +emit_dri (j_compress_ptr cinfo) +/* Emit a DRI marker */ +{ + emit_marker(cinfo, M_DRI); + + emit_2bytes(cinfo, 4); /* fixed length */ + + emit_2bytes(cinfo, (int) cinfo->restart_interval); +} + + +LOCAL(void) +emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) +/* Emit a SOF marker */ +{ + int ci; + jpeg_component_info *compptr; + + emit_marker(cinfo, code); + + emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ + + /* Make sure image isn't bigger than SOF field can handle */ + if ((long) cinfo->image_height > 65535L || + (long) cinfo->image_width > 65535L) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535); + + emit_byte(cinfo, cinfo->data_precision); + emit_2bytes(cinfo, (int) cinfo->image_height); + emit_2bytes(cinfo, (int) cinfo->image_width); + + emit_byte(cinfo, cinfo->num_components); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + emit_byte(cinfo, compptr->component_id); + emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor); + emit_byte(cinfo, compptr->quant_tbl_no); + } +} + + +LOCAL(void) +emit_sos (j_compress_ptr cinfo) +/* Emit a SOS marker */ +{ + int i, td, ta; + jpeg_component_info *compptr; + + emit_marker(cinfo, M_SOS); + + emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ + + emit_byte(cinfo, cinfo->comps_in_scan); + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + emit_byte(cinfo, compptr->component_id); + td = compptr->dc_tbl_no; + ta = compptr->ac_tbl_no; + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Progressive mode: only DC or only AC tables are used in one scan; + * furthermore, Huffman coding of DC refinement uses no table at all. + * We emit 0 for unused field(s); this is recommended by the P&M text + * but does not seem to be specified in the standard. + */ + if (cinfo->Ss == 0) { + ta = 0; /* DC scan */ + if (cinfo->Ah != 0 && !cinfo->arith_code) + td = 0; /* no DC table either */ + } else { + td = 0; /* AC scan */ + } + } + emit_byte(cinfo, (td << 4) + ta); + } + + emit_byte(cinfo, cinfo->Ss); + emit_byte(cinfo, cinfo->Se); + emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al); +} + + +LOCAL(void) +emit_jfif_app0 (j_compress_ptr cinfo) +/* Emit a JFIF-compliant APP0 marker */ +{ + /* + * Length of APP0 block (2 bytes) + * Block ID (4 bytes - ASCII "JFIF") + * Zero byte (1 byte to terminate the ID string) + * Version Major, Minor (2 bytes - major first) + * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) + * Xdpu (2 bytes - dots per unit horizontal) + * Ydpu (2 bytes - dots per unit vertical) + * Thumbnail X size (1 byte) + * Thumbnail Y size (1 byte) + */ + + emit_marker(cinfo, M_APP0); + + emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ + + emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0x49); + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0); + emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */ + emit_byte(cinfo, cinfo->JFIF_minor_version); + emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */ + emit_2bytes(cinfo, (int) cinfo->X_density); + emit_2bytes(cinfo, (int) cinfo->Y_density); + emit_byte(cinfo, 0); /* No thumbnail image */ + emit_byte(cinfo, 0); +} + + +LOCAL(void) +emit_adobe_app14 (j_compress_ptr cinfo) +/* Emit an Adobe APP14 marker */ +{ + /* + * Length of APP14 block (2 bytes) + * Block ID (5 bytes - ASCII "Adobe") + * Version Number (2 bytes - currently 100) + * Flags0 (2 bytes - currently 0) + * Flags1 (2 bytes - currently 0) + * Color transform (1 byte) + * + * Although Adobe TN 5116 mentions Version = 101, all the Adobe files + * now in circulation seem to use Version = 100, so that's what we write. + * + * We write the color transform byte as 1 if the JPEG color space is + * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with + * whether the encoder performed a transformation, which is pretty useless. + */ + + emit_marker(cinfo, M_APP14); + + emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */ + + emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */ + emit_byte(cinfo, 0x64); + emit_byte(cinfo, 0x6F); + emit_byte(cinfo, 0x62); + emit_byte(cinfo, 0x65); + emit_2bytes(cinfo, 100); /* Version */ + emit_2bytes(cinfo, 0); /* Flags0 */ + emit_2bytes(cinfo, 0); /* Flags1 */ + switch (cinfo->jpeg_color_space) { + case JCS_YCbCr: + emit_byte(cinfo, 1); /* Color transform = 1 */ + break; + case JCS_YCCK: + emit_byte(cinfo, 2); /* Color transform = 2 */ + break; + default: + emit_byte(cinfo, 0); /* Color transform = 0 */ + break; + } +} + + +/* + * These routines allow writing an arbitrary marker with parameters. + * The only intended use is to emit COM or APPn markers after calling + * write_file_header and before calling write_frame_header. + * Other uses are not guaranteed to produce desirable results. + * Counting the parameter bytes properly is the caller's responsibility. + */ + +METHODDEF(void) +write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +/* Emit an arbitrary marker header */ +{ + if (datalen > (unsigned int) 65533) /* safety check */ + ERREXIT(cinfo, JERR_BAD_LENGTH); + + emit_marker(cinfo, (JPEG_MARKER) marker); + + emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */ +} + +METHODDEF(void) +write_marker_byte (j_compress_ptr cinfo, int val) +/* Emit one byte of marker parameters following write_marker_header */ +{ + emit_byte(cinfo, val); +} + + +/* + * Write datastream header. + * This consists of an SOI and optional APPn markers. + * We recommend use of the JFIF marker, but not the Adobe marker, + * when using YCbCr or grayscale data. The JFIF marker should NOT + * be used for any other JPEG colorspace. The Adobe marker is helpful + * to distinguish RGB, CMYK, and YCCK colorspaces. + * Note that an application can write additional header markers after + * jpeg_start_compress returns. + */ + +METHODDEF(void) +write_file_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + emit_marker(cinfo, M_SOI); /* first the SOI */ + + /* SOI is defined to reset restart interval to 0 */ + marker->last_restart_interval = 0; + + if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */ + emit_jfif_app0(cinfo); + if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */ + emit_adobe_app14(cinfo); +} + + +/* + * Write frame header. + * This consists of DQT and SOFn markers. + * Note that we do not emit the SOF until we have emitted the DQT(s). + * This avoids compatibility problems with incorrect implementations that + * try to error-check the quant table numbers as soon as they see the SOF. + */ + +METHODDEF(void) +write_frame_header (j_compress_ptr cinfo) +{ + int ci, prec; + boolean is_baseline; + jpeg_component_info *compptr; + + prec = 0; + if (cinfo->process != JPROC_LOSSLESS) { + /* Emit DQT for each quantization table. + * Note that emit_dqt() suppresses any duplicate tables. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prec += emit_dqt(cinfo, compptr->quant_tbl_no); + } + /* now prec is nonzero iff there are any 16-bit quant tables. */ + } + + /* Check for a non-baseline specification. + * Note we assume that Huffman table numbers won't be changed later. + */ + if (cinfo->arith_code || cinfo->process != JPROC_SEQUENTIAL || + cinfo->data_precision != 8) { + is_baseline = FALSE; + } else { + is_baseline = TRUE; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1) + is_baseline = FALSE; + } + if (prec && is_baseline) { + is_baseline = FALSE; + /* If it's baseline except for quantizer size, warn the user */ + TRACEMS(cinfo, 0, JTRC_16BIT_TABLES); + } + } + + /* Emit the proper SOF marker */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + if (cinfo->process == JPROC_PROGRESSIVE) + emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */ + else if (cinfo->process == JPROC_LOSSLESS) + emit_sof(cinfo, M_SOF11); /* SOF code for lossless arithmetic */ + else + emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */ +#else + emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */ +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) + emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */ + else if (cinfo->process == JPROC_LOSSLESS) + emit_sof(cinfo, M_SOF3); /* SOF code for lossless Huffman */ + else if (is_baseline && (!cinfo->force_extended_sequential_marker)) + emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */ + else + emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ + } +} + + +/* + * Write scan header. + * This consists of DHT or DAC markers, optional DRI, and SOS. + * Compressed data will be written following the SOS. + */ + +METHODDEF(void) +write_scan_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + int i; + jpeg_component_info *compptr; + + if (cinfo->arith_code) { + /* Emit arith conditioning info. We may have some duplication + * if the file has multiple scans, but it's so small it's hardly + * worth worrying about. + */ + emit_dac(cinfo); + } else { + /* Emit Huffman tables. + * Note that emit_dht() suppresses any duplicate tables. + */ + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Progressive mode: only DC or only AC tables are used in one scan */ + if (cinfo->Ss == 0) { + if (cinfo->Ah == 0) /* DC needs no table for refinement scan */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + } else { + emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + } + } else if (cinfo->process == JPROC_LOSSLESS) { + /* Lossless mode: only DC tables are used */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + } else { + /* Sequential mode: need both DC and AC tables */ + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + } + } + } + + /* Emit DRI if required --- note that DRI value could change for each scan. + * We avoid wasting space with unnecessary DRIs, however. + */ + if (cinfo->restart_interval != marker->last_restart_interval) { + emit_dri(cinfo); + marker->last_restart_interval = cinfo->restart_interval; + } + + emit_sos(cinfo); +} + + +/* + * Write datastream trailer. + */ + +METHODDEF(void) +write_file_trailer (j_compress_ptr cinfo) +{ + emit_marker(cinfo, M_EOI); +} + + +/* + * Write an abbreviated table-specification datastream. + * This consists of SOI, DQT and DHT tables, and EOI. + * Any table that is defined and not marked sent_table = TRUE will be + * emitted. Note that all tables will be marked sent_table = TRUE at exit. + */ + +METHODDEF(void) +write_tables_only (j_compress_ptr cinfo) +{ + int i; + + emit_marker(cinfo, M_SOI); + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if (cinfo->quant_tbl_ptrs[i] != NULL) + (void) emit_dqt(cinfo, i); + } + + if (! cinfo->arith_code) { + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if (cinfo->dc_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, FALSE); + if (cinfo->ac_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, TRUE); + } + } + + emit_marker(cinfo, M_EOI); +} + + +/* + * Initialize the marker writer module. + */ + +GLOBAL(void) +jinit_marker_writer (j_compress_ptr cinfo) +{ + my_marker_ptr marker; + + /* Create the subobject */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_marker_writer)); + cinfo->marker = (struct jpeg_marker_writer *) marker; + /* Initialize method pointers */ + marker->pub.write_file_header = write_file_header; + marker->pub.write_frame_header = write_frame_header; + marker->pub.write_scan_header = write_scan_header; + marker->pub.write_file_trailer = write_file_trailer; + marker->pub.write_tables_only = write_tables_only; + marker->pub.write_marker_header = write_marker_header; + marker->pub.write_marker_byte = write_marker_byte; + /* Initialize private state */ + marker->last_restart_interval = 0; +} diff --git a/dcmjpeg/libijg8/jcmaster.c b/dcmjpeg/libijg8/jcmaster.c new file mode 100644 index 00000000..a1bf1b16 --- /dev/null +++ b/dcmjpeg/libijg8/jcmaster.c @@ -0,0 +1,657 @@ +/* + * jcmaster.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG compressor. + * These routines are concerned with parameter validation, initial setup, + * and inter-pass control (determining the number of passes and the work + * to be done in each pass). + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ + + +/* Private state */ + +typedef enum { + main_pass, /* input data, also do first output step */ + huff_opt_pass, /* Huffman code optimization pass */ + output_pass /* data output pass */ +} c_pass_type; + +typedef struct { + struct jpeg_comp_master pub; /* public fields */ + + c_pass_type pass_type; /* the type of the current pass */ + + int pass_number; /* # of passes completed */ + int total_passes; /* total # of passes needed */ + + int scan_number; /* current index in scan_info[] */ +} my_comp_master; + +typedef my_comp_master * my_master_ptr; + + +/* + * Support routines that do various essential calculations. + */ + +LOCAL(void) +initial_setup (j_compress_ptr cinfo) +/* Do computations that are needed before master selection phase */ +{ + int ci; + jpeg_component_info *compptr; + long samplesperrow; + JDIMENSION jd_samplesperrow; + int data_unit = cinfo->data_unit; + + /* Sanity check on image dimensions */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 + || cinfo->num_components <= 0 || cinfo->input_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + /* Width of an input scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Fill in the correct component_index value; don't rely on application */ + compptr->component_index = ci; + /* For compression, we never do any codec-based processing. */ + compptr->codec_data_unit = data_unit; + /* Size in data units */ + compptr->width_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * data_unit)); + compptr->height_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * data_unit)); + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) cinfo->max_h_samp_factor); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) cinfo->max_v_samp_factor); + /* Mark component needed (this flag isn't actually used for compression) */ + compptr->component_needed = TRUE; + } + + /* Compute number of fully interleaved MCU rows (number of times that + * main controller will call coefficient controller). + */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*data_unit)); +} + +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define NEED_SCAN_SCRIPT +#else +#ifdef C_LOSSLESS_SUPPORTED +#define NEED_SCAN_SCRIPT +#endif +#endif + +#ifdef NEED_SCAN_SCRIPT + +LOCAL(void) +validate_script (j_compress_ptr cinfo) +/* Verify that the scan script in cinfo->scan_info[] is valid; also + * determine whether it uses progressive JPEG, and set cinfo->process. + */ +{ + const jpeg_scan_info * scanptr; + int scanno, ncomps, ci, coefi, thisi; + int Ss, Se, Ah, Al; + boolean component_sent[MAX_COMPONENTS]; +#ifdef C_PROGRESSIVE_SUPPORTED + int * last_bitpos_ptr; + int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; + /* -1 until that coefficient has been seen; then last Al for it */ +#endif + + if (cinfo->num_scans <= 0) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0); + +#ifndef C_MULTISCAN_FILES_SUPPORTED + if (cinfo->num_scans > 1) + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + + scanptr = cinfo->scan_info; + if (cinfo->lossless) { +#ifdef C_LOSSLESS_SUPPORTED + cinfo->process = JPROC_LOSSLESS; + for (ci = 0; ci < cinfo->num_components; ci++) + component_sent[ci] = FALSE; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1; + * for progressive JPEG, no scan can have this. + */ + else if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) { +#ifdef C_PROGRESSIVE_SUPPORTED + cinfo->process = JPROC_PROGRESSIVE; + last_bitpos_ptr = & last_bitpos[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (coefi = 0; coefi < DCTSIZE2; coefi++) + *last_bitpos_ptr++ = -1; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + for (ci = 0; ci < cinfo->num_components; ci++) + component_sent[ci] = FALSE; + } + + for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) { + /* Validate component indexes */ + ncomps = scanptr->comps_in_scan; + if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN); + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (thisi < 0 || thisi >= cinfo->num_components) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + /* Components must appear in SOF order within each scan */ + if (ci > 0 && thisi <= scanptr->component_index[ci-1]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + } + /* Validate progression parameters */ + Ss = scanptr->Ss; + Se = scanptr->Se; + Ah = scanptr->Ah; + Al = scanptr->Al; + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef C_LOSSLESS_SUPPORTED + /* The JPEG spec simply gives the range 0..15 for Al (Pt), but that + * seems wrong: the upper bound ought to depend on data precision. + * Perhaps they really meant 0..N-1 for N-bit precision, which is what + * we allow here. + */ + if (Ss < 1 || Ss > 7 || /* predictor selector */ + Se != 0 || Ah != 0 || + Al < 0 || Al >= cinfo->data_precision) /* point transform */ + ERREXIT1(cinfo, JERR_BAD_LOSSLESS_SCRIPT, scanno); + /* Make sure components are not sent twice */ + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (component_sent[thisi]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + component_sent[thisi] = TRUE; + } +#endif + } else if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that + * seems wrong: the upper bound ought to depend on data precision. + * Perhaps they really meant 0..N+1 for N-bit precision. + * Here we allow 0..10 for 8-bit data; Al larger than 10 results in + * out-of-range reconstructed DC values during the first DC scan, + * which might cause problems for some decoders. + */ +#if BITS_IN_JSAMPLE == 8 +#define MAX_AH_AL 10 +#else +#define MAX_AH_AL 13 +#endif + if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 || + Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + if (Ss == 0) { + if (Se != 0) /* DC and AC together not OK */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + if (ncomps != 1) /* AC scans must be for only one component */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + for (ci = 0; ci < ncomps; ci++) { + last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0]; + if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + for (coefi = Ss; coefi <= Se; coefi++) { + if (last_bitpos_ptr[coefi] < 0) { + /* first scan of this coefficient */ + if (Ah != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + /* not first scan */ + if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + last_bitpos_ptr[coefi] = Al; + } + } +#endif + } else { + /* For sequential JPEG, all progression parameters must be these: */ + if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + /* Make sure components are not sent twice */ + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (component_sent[thisi]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + component_sent[thisi] = TRUE; + } + } + } + + /* Now verify that everything got sent. */ + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* For progressive mode, we only check that at least some DC data + * got sent for each component; the spec does not require that all bits + * of all coefficients be transmitted. Would it be wiser to enforce + * transmission of all coefficient bits?? + */ + for (ci = 0; ci < cinfo->num_components; ci++) { + if (last_bitpos[ci][0] < 0) + ERREXIT(cinfo, JERR_MISSING_DATA); + } +#endif + } else { + for (ci = 0; ci < cinfo->num_components; ci++) { + if (! component_sent[ci]) + ERREXIT(cinfo, JERR_MISSING_DATA); + } + } +} + +#endif /* NEED_SCAN_SCRIPT */ + + +LOCAL(void) +select_scan_parameters (j_compress_ptr cinfo) +/* Set up the scan parameters for the current scan */ +{ + int ci; + +#ifdef NEED_SCAN_SCRIPT + if (cinfo->scan_info != NULL) { + /* Prepare for current scan --- the script is already validated */ + my_master_ptr master = (my_master_ptr) cinfo->master; + const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number; + + cinfo->comps_in_scan = scanptr->comps_in_scan; + for (ci = 0; ci < scanptr->comps_in_scan; ci++) { + cinfo->cur_comp_info[ci] = + &cinfo->comp_info[scanptr->component_index[ci]]; + } + cinfo->Ss = scanptr->Ss; + cinfo->Se = scanptr->Se; + cinfo->Ah = scanptr->Ah; + cinfo->Al = scanptr->Al; + } else +#endif + { + /* Prepare for single sequential-JPEG scan containing all components */ + if (cinfo->num_components > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPS_IN_SCAN); + cinfo->comps_in_scan = cinfo->num_components; + for (ci = 0; ci < cinfo->num_components; ci++) { + cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci]; + } + if (cinfo->lossless) { +#ifdef C_LOSSLESS_SUPPORTED + /* If we fall through to here, the user specified lossless, but did not + * provide a scan script. + */ + ERREXIT(cinfo, JERR_NO_LOSSLESS_SCRIPT); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + cinfo->Ss = 0; + cinfo->Se = DCTSIZE2-1; + cinfo->Ah = 0; + cinfo->Al = 0; + } + } +} + + +LOCAL(void) +per_scan_setup (j_compress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + int data_unit = cinfo->data_unit; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_data_units; + cinfo->MCU_rows_in_scan = compptr->height_in_data_units; + + /* For noninterleaved scan, always one block per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_data_units = 1; + compptr->MCU_sample_width = data_unit; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of block rows present in the last iMCU row. + */ + tmp = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->data_units_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, + (long) (cinfo->max_h_samp_factor*data_unit)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*data_unit)); + + cinfo->data_units_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of blocks of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_data_units = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * data_unit; + /* Figure number of non-dummy blocks in last MCU column & row */ + tmp = (int)compptr->width_in_data_units % compptr->MCU_width; + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int)compptr->height_in_data_units % compptr->MCU_height; + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_data_units; + if (cinfo->data_units_in_MCU + mcublks > C_MAX_DATA_UNITS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->data_units_in_MCU++] = ci; + } + } + + } + + /* Convert restart specified in rows to actual MCU count. */ + /* Note that count must fit in 16 bits, so we provide limiting. */ + if (cinfo->restart_in_rows > 0) { + long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row; + cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L); + } +} + + +/* + * Per-pass setup. + * This is called at the beginning of each pass. We determine which modules + * will be active during this pass and give them appropriate start_pass calls. + * We also set is_last_pass to indicate whether any more passes will be + * required. + */ + +METHODDEF(void) +prepare_for_pass (j_compress_ptr cinfo) +{ + /* j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; */ + my_master_ptr master = (my_master_ptr) cinfo->master; + + switch (master->pass_type) { + case main_pass: + /* Initial pass: will collect input data, and do either Huffman + * optimization or data output for the first scan. + */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + if (! cinfo->raw_data_in) { + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->downsample->start_pass) (cinfo); + (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU); + } + (*cinfo->codec->entropy_start_pass) (cinfo, cinfo->optimize_coding); + (*cinfo->codec->start_pass) (cinfo, + (master->total_passes > 1 ? + JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + if (cinfo->optimize_coding) { + /* No immediate data output; postpone writing frame/scan headers */ + master->pub.call_pass_startup = FALSE; + } else { + /* Will write frame/scan headers at first jpeg_write_scanlines call */ + master->pub.call_pass_startup = TRUE; + } + break; +#ifdef ENTROPY_OPT_SUPPORTED + case huff_opt_pass: + /* Do Huffman optimization for a scan after the first one. */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); +#ifdef WITH_ARITHMETIC_PATCH + if ((*cinfo->codec->need_optimization_pass) (cinfo)) { +#else + if ((*cinfo->codec->need_optimization_pass) (cinfo) || cinfo->arith_code) { +#endif + (*cinfo->codec->entropy_start_pass) (cinfo, TRUE); + (*cinfo->codec->start_pass) (cinfo, JBUF_CRANK_DEST); + master->pub.call_pass_startup = FALSE; + break; + } + /* Special case: Huffman DC refinement scans need no Huffman table + * and therefore we can skip the optimization pass for them. + */ + master->pass_type = output_pass; + master->pass_number++; + /*FALLTHROUGH*/ +#endif + case output_pass: + /* Do a data-output pass. */ + /* We need not repeat per-scan setup if prior optimization pass did it. */ + if (! cinfo->optimize_coding) { + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + } + (*cinfo->codec->entropy_start_pass) (cinfo, FALSE); + (*cinfo->codec->start_pass) (cinfo, JBUF_CRANK_DEST); + /* We emit frame/scan headers now */ + if (master->scan_number == 0) + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); + master->pub.call_pass_startup = FALSE; + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + } + + master->pub.is_last_pass = (master->pass_number == master->total_passes-1); + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->total_passes; + } +} + + +/* + * Special start-of-pass hook. + * This is called by jpeg_write_scanlines if call_pass_startup is TRUE. + * In single-pass processing, we need this hook because we don't want to + * write frame/scan headers during jpeg_start_compress; we want to let the + * application write COM markers etc. between jpeg_start_compress and the + * jpeg_write_scanlines loop. + * In multi-pass processing, this routine is not used. + */ + +METHODDEF(void) +pass_startup (j_compress_ptr cinfo) +{ + cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */ + + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); +} + + +/* + * Finish up at end of pass. + */ + +METHODDEF(void) +finish_pass_master (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* The entropy coder always needs an end-of-pass call, + * either to analyze statistics or to flush its output buffer. + */ + (*lossyc->pub.entropy_finish_pass) (cinfo); + + /* Update state for next pass */ + switch (master->pass_type) { + case main_pass: + /* next pass is either output of scan 0 (after optimization) + * or output of scan 1 (if no optimization). + */ + master->pass_type = output_pass; + if (! cinfo->optimize_coding) + master->scan_number++; + break; + case huff_opt_pass: + /* next pass is always output of current scan */ + master->pass_type = output_pass; + break; + case output_pass: + /* next pass is either optimization or output of next scan */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + master->scan_number++; + break; + } + + master->pass_number++; +} + + +/* + * Initialize master compression control. + */ + +GLOBAL(void) +jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_comp_master)); + cinfo->master = (struct jpeg_comp_master *) master; + master->pub.prepare_for_pass = prepare_for_pass; + master->pub.pass_startup = pass_startup; + master->pub.finish_pass = finish_pass_master; + master->pub.is_last_pass = FALSE; + + cinfo->data_unit = cinfo->lossless ? 1 : DCTSIZE; + + /* Validate parameters, determine derived values */ + initial_setup(cinfo); + + if (cinfo->scan_info != NULL) { +#ifdef NEED_SCAN_SCRIPT + validate_script(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->process = JPROC_SEQUENTIAL; + cinfo->num_scans = 1; + } + +#ifdef WITH_ARITHMETIC_PATCH + if ((cinfo->arith_code == 0) && + (cinfo->process == JPROC_PROGRESSIVE || /* TEMPORARY HACK ??? */ + cinfo->process == JPROC_LOSSLESS)) +#else + if (cinfo->process == JPROC_PROGRESSIVE || /* TEMPORARY HACK ??? */ + cinfo->process == JPROC_LOSSLESS) +#endif + cinfo->optimize_coding = TRUE; /* assume default tables no good for + * progressive mode or lossless mode */ + + /* Initialize my private state */ + if (transcode_only) { + /* no main pass in transcoding */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + else + master->pass_type = output_pass; + } else { + /* for normal compression, first pass is always this type: */ + master->pass_type = main_pass; + } + master->scan_number = 0; + master->pass_number = 0; + if (cinfo->optimize_coding) + master->total_passes = cinfo->num_scans * 2; + else + master->total_passes = cinfo->num_scans; +} diff --git a/dcmjpeg/libijg8/jcodec.c b/dcmjpeg/libijg8/jcodec.c new file mode 100644 index 00000000..be0069d5 --- /dev/null +++ b/dcmjpeg/libijg8/jcodec.c @@ -0,0 +1,53 @@ +/* + * jcodec.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains utility functions for the JPEG codec(s). + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" +#include "jlossls8.h" + + +/* + * Initialize the compression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_c_codec (j_compress_ptr cinfo) +{ + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef C_LOSSLESS_SUPPORTED + jinit_lossless_c_codec(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_lossy_c_codec(cinfo); +} + + +/* + * Initialize the decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_d_codec (j_decompress_ptr cinfo) +{ + if (cinfo->process == JPROC_LOSSLESS) { +#ifdef D_LOSSLESS_SUPPORTED + jinit_lossless_d_codec(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_lossy_d_codec(cinfo); +} diff --git a/dcmjpeg/libijg8/jcomapi.c b/dcmjpeg/libijg8/jcomapi.c new file mode 100644 index 00000000..c86bda49 --- /dev/null +++ b/dcmjpeg/libijg8/jcomapi.c @@ -0,0 +1,106 @@ +/* + * jcomapi.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface routines that are used for both + * compression and decompression. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Abort processing of a JPEG compression or decompression operation, + * but don't destroy the object itself. + * + * For this, we merely clean up all the nonpermanent memory pools. + * Note that temp files (virtual arrays) are not allowed to belong to + * the permanent pool, so we will be able to close all temp files here. + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_abort (j_common_ptr cinfo) +{ + int pool; + + /* Do nothing if called on a not-initialized or destroyed JPEG object. */ + if (cinfo->mem == NULL) + return; + + /* Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) { + (*cinfo->mem->free_pool) (cinfo, pool); + } + + /* Reset overall state for possible reuse of object */ + if (cinfo->is_decompressor) { + cinfo->global_state = DSTATE_START; + /* Try to keep application from accessing now-deleted marker list. + * A bit kludgy to do it here, but this is the most central place. + */ + ((j_decompress_ptr) cinfo)->marker_list = NULL; + } else { + cinfo->global_state = CSTATE_START; + } +} + + +/* + * Destruction of a JPEG object. + * + * Everything gets deallocated except the master jpeg_compress_struct itself + * and the error manager struct. Both of these are supplied by the application + * and must be freed, if necessary, by the application. (Often they are on + * the stack and so don't need to be freed anyway.) + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_destroy (j_common_ptr cinfo) +{ + /* We need only tell the memory manager to release everything. */ + /* NB: mem pointer is NULL if memory mgr failed to initialize. */ + if (cinfo->mem != NULL) + (*cinfo->mem->self_destruct) (cinfo); + cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ + cinfo->global_state = 0; /* mark it destroyed */ +} + + +/* + * Convenience routines for allocating quantization and Huffman tables. + * (Would jutils.c be a more reasonable place to put these?) + */ + +GLOBAL(JQUANT_TBL *) +jpeg_alloc_quant_table (j_common_ptr cinfo) +{ + JQUANT_TBL *tbl; + + tbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} + + +GLOBAL(JHUFF_TBL *) +jpeg_alloc_huff_table (j_common_ptr cinfo) +{ + JHUFF_TBL *tbl; + + tbl = (JHUFF_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} diff --git a/dcmjpeg/libijg8/jconfig8.h b/dcmjpeg/libijg8/jconfig8.h new file mode 100644 index 00000000..4dd87d61 --- /dev/null +++ b/dcmjpeg/libijg8/jconfig8.h @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: + * this file derives the preprocessor symbols required to compile + * the IJG library from the central DCMTK configuration file osconfig.h + * + */ + +#include "dcmtk/config/osconfig.h" + +/* We assume ANSI C and don't support DOS, + * so the following settings need not be tested + */ +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +#undef NEED_FAR_POINTERS +#undef INCOMPLETE_TYPES_BROKEN + +/* the following settings are derived from osconfig.h */ + +#ifndef HAVE_C_CONST +#define const +#endif + +#ifdef C_CHAR_UNSIGNED +#define CHAR_IS_UNSIGNED +#endif + +#ifdef HAVE_STRINGS_H +#ifndef HAVE_STRING_H +#define NEED_BSD_STRINGS +#endif +#endif + +#ifdef HAVE_SYS_TYPES_H +#define NEED_SYS_TYPES_H +#endif + +/* must always be defined for our implementation */ +#define NEED_SHORT_EXTERNAL_NAMES + +#ifdef JPEG_INTERNALS + +#ifdef C_RIGHTSHIFT_UNSIGNED +#define RIGHT_SHIFT_IS_UNSIGNED +#endif + +#define INLINE C_INLINE + +/* These are for configuring the JPEG memory manager. */ +#undef DEFAULT_MAX_MEM +#undef NO_MKTEMP + +/* We don't want to use getenv which is thread unsafe on some platforms */ +#define NO_GETENV + +#endif /* JPEG_INTERNALS */ diff --git a/dcmjpeg/libijg8/jcparam.c b/dcmjpeg/libijg8/jcparam.c new file mode 100644 index 00000000..d1279d0b --- /dev/null +++ b/dcmjpeg/libijg8/jcparam.c @@ -0,0 +1,687 @@ +/* + * jcparam.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains optional default-setting code for the JPEG compressor. + * Applications do not have to use this file, but those that don't use it + * must know a lot more about the innards of the JPEG code. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Quantization table setup routines + */ + +GLOBAL(void) +jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, boolean force_baseline) +/* Define a quantization table equal to the basic_table times + * a scale factor (given as a percentage). + * If force_baseline is TRUE, the computed quantization table entries + * are limited to 1..255 for JPEG baseline compatibility. + */ +{ + JQUANT_TBL ** qtblptr; + int i; + long temp; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl); + + qtblptr = & cinfo->quant_tbl_ptrs[which_tbl]; + + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo); + + for (i = 0; i < DCTSIZE2; i++) { + temp = ((long) basic_table[i] * scale_factor + 50L) / 100L; + /* limit the values to the valid range */ + if (temp <= 0L) temp = 1L; + if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */ + if (force_baseline && temp > 255L) + temp = 255L; /* limit to baseline range if requested */ + (*qtblptr)->quantval[i] = (UINT16) temp; + } + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*qtblptr)->sent_table = FALSE; +} + + +GLOBAL(void) +jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, + boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables + * and a straight percentage-scaling quality scale. In most cases it's better + * to use jpeg_set_quality (below); this entry point is provided for + * applications that insist on a linear percentage scaling. + */ +{ + /* These are the sample quantization tables given in JPEG spec section K.1. + * The spec says that the values given produce "good" quality, and + * when divided by 2, "very good" quality. + */ + static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 56, 68, 109, 103, 77, + 24, 35, 55, 64, 81, 104, 113, 92, + 49, 64, 78, 87, 103, 121, 120, 101, + 72, 92, 95, 98, 112, 100, 103, 99 + }; + static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 + }; + + /* Set up two quantization tables using the specified scaling */ + jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl, + scale_factor, force_baseline); + jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, + scale_factor, force_baseline); +} + + +GLOBAL(int) +jpeg_quality_scaling (int quality) +/* Convert a user-specified quality rating to a percentage scaling factor + * for an underlying quantization table, using our recommended scaling curve. + * The input 'quality' factor should be 0 (terrible) to 100 (very good). + */ +{ + /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */ + if (quality <= 0) quality = 1; + if (quality > 100) quality = 100; + + /* The basic table is used as-is (scaling 100) for a quality of 50. + * Qualities 50..100 are converted to scaling percentage 200 - 2*Q; + * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table + * to make all the table entries 1 (hence, minimum quantization loss). + * Qualities 1..50 are converted to scaling percentage 5000/Q. + */ + if (quality < 50) + quality = 5000 / quality; + else + quality = 200 - quality*2; + + return quality; +} + + +GLOBAL(void) +jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables. + * This is the standard quality-adjusting entry point for typical user + * interfaces; only those who want detailed control over quantization tables + * would use the preceding three routines directly. + */ +{ + /* Convert user 0-100 rating to percentage scaling */ + quality = jpeg_quality_scaling(quality); + + /* Set up standard quality tables */ + jpeg_set_linear_quality(cinfo, quality, force_baseline); +} + + +/* + * Huffman table setup routines + */ + +LOCAL(void) +add_huff_table (j_compress_ptr cinfo, + JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val) +/* Define a Huffman table */ +{ + int nsymbols, len; + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + /* Copy the number-of-symbols-of-each-code-length counts */ + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + + /* Validate the counts. We do this here mainly so we can copy the right + * number of symbols from the val[] array, without risking marching off + * the end of memory. jchuff.c will do a more thorough test later. + */ + nsymbols = 0; + for (len = 1; len <= 16; len++) + nsymbols += bits[len]; + if (nsymbols < 1 || nsymbols > 256) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + MEMCOPY((*htblptr)->huffval, val, (size_t)nsymbols * SIZEOF(UINT8)); + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*htblptr)->sent_table = FALSE; +} + + +LOCAL(void) +std_huff_tables (j_compress_ptr cinfo) +/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ +/* IMPORTANT: these are only valid for 8-bit data precision! */ +{ + static const UINT8 bits_dc_luminance[17] = + { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_luminance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_dc_chrominance[17] = + { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_chrominance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_ac_luminance[17] = + { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; + static const UINT8 val_ac_luminance[] = + { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, + 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, + 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, + 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, + 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, + 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, + 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, + 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, + 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + static const UINT8 bits_ac_chrominance[17] = + { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; + static const UINT8 val_ac_chrominance[] = + { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, + 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, + 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, + 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, + 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, + 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, + 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, + 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, + 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], + bits_dc_luminance, val_dc_luminance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], + bits_ac_luminance, val_ac_luminance); + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], + bits_dc_chrominance, val_dc_chrominance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], + bits_ac_chrominance, val_ac_chrominance); +} + + +/* + * Default parameter setup for compression. + * + * Applications that don't choose to use this routine must do their + * own setup of all these parameters. Alternately, you can call this + * to establish defaults and then alter parameters selectively. This + * is the recommended approach since, if we add any new parameters, + * your code will still work (they'll be set to reasonable defaults). + */ + +GLOBAL(void) +jpeg_set_defaults (j_compress_ptr cinfo) +{ + int i; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Allocate comp_info array large enough for maximum component count. + * Array is made permanent in case application wants to compress + * multiple images at same param settings. + */ + if (cinfo->comp_info == NULL) + cinfo->comp_info = (jpeg_component_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + MAX_COMPONENTS * SIZEOF(jpeg_component_info)); + + /* Initialize everything not dependent on the color space */ + + cinfo->lossless = FALSE; + cinfo->data_precision = BITS_IN_JSAMPLE; + /* Set up two quantization tables using default quality of 75 */ + jpeg_set_quality(cinfo, 75, TRUE); + /* Set up two Huffman tables */ + std_huff_tables(cinfo); + + /* Initialize default arithmetic coding conditioning */ + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + + /* Default is no multiple-scan output */ + cinfo->scan_info = NULL; + cinfo->num_scans = 0; + + /* Expect normal source image, not raw downsampled data */ + cinfo->raw_data_in = FALSE; + + /* Use Huffman coding, not arithmetic coding, by default */ + cinfo->arith_code = FALSE; + + /* By default, don't do extra passes to optimize entropy coding */ + cinfo->optimize_coding = FALSE; + /* The standard Huffman tables are only valid for 8-bit data precision. + * If the precision is higher, force optimization on so that usable + * tables will be computed. This test can be removed if default tables + * are supplied that are valid for the desired precision. + */ + if (cinfo->data_precision > 8) + cinfo->optimize_coding = TRUE; + + /* By default, use the simpler non-cosited sampling alignment */ + cinfo->CCIR601_sampling = FALSE; + + /* No input smoothing */ + cinfo->smoothing_factor = 0; + + /* DCT algorithm preference */ + cinfo->dct_method = JDCT_DEFAULT; + + /* No restart markers */ + cinfo->restart_interval = 0; + cinfo->restart_in_rows = 0; + + /* Fill in default JFIF marker parameters. Note that whether the marker + * will actually be written is determined by jpeg_set_colorspace. + * + * By default, the library emits JFIF version code 1.01. + * An application that wants to emit JFIF 1.02 extension markers should set + * JFIF_minor_version to 2. We could probably get away with just defaulting + * to 1.02, but there may still be some decoders in use that will complain + * about that; saying 1.01 should minimize compatibility problems. + */ + cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; /* Pixel size is unknown by default */ + cinfo->X_density = 1; /* Pixel aspect ratio is square by default */ + cinfo->Y_density = 1; + + /* Choose JPEG colorspace based on input space, set defaults accordingly */ + + jpeg_default_colorspace(cinfo); +} + + +/* + * Select an appropriate JPEG colorspace for in_color_space. + */ + +GLOBAL(void) +jpeg_default_colorspace (j_compress_ptr cinfo) +{ + if (cinfo->lossless) + jpeg_set_colorspace(cinfo, cinfo->in_color_space); + else { /* lossy */ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); + break; + case JCS_RGB: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_YCbCr: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_CMYK: + jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */ + break; + case JCS_YCCK: + jpeg_set_colorspace(cinfo, JCS_YCCK); + break; + case JCS_UNKNOWN: + jpeg_set_colorspace(cinfo, JCS_UNKNOWN); + break; + default: + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + } + } +} + + +/* + * Set the JPEG colorspace, and choose colorspace-dependent default values. + */ + +GLOBAL(void) +jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) +{ + jpeg_component_info * compptr; + int ci; + +#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \ + (compptr = &cinfo->comp_info[index], \ + compptr->component_id = (id), \ + compptr->h_samp_factor = (hsamp), \ + compptr->v_samp_factor = (vsamp), \ + compptr->quant_tbl_no = (quant), \ + compptr->dc_tbl_no = (dctbl), \ + compptr->ac_tbl_no = (actbl) ) + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* For all colorspaces, we use Q and Huff tables 0 for luminance components, + * tables 1 for chrominance components. + */ + + cinfo->jpeg_color_space = colorspace; + + cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */ + cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */ + + switch (colorspace) { + case JCS_GRAYSCALE: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 1; + /* JFIF specifies component ID 1 */ + SET_COMP(0, 1, 1,1, 0, 0,0); + break; + case JCS_RGB: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ + cinfo->num_components = 3; + SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0); + SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0); + SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0); + break; + case JCS_YCbCr: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 3; + /* JFIF specifies component IDs 1,2,3 */ + if (cinfo->lossless) { + SET_COMP(0, 1, 1,1, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + } else { /* lossy */ + /* We default to 2x2 subsamples of chrominance */ + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + } + break; + case JCS_CMYK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */ + cinfo->num_components = 4; + SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0); + SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0); + SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0); + SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0); + break; + case JCS_YCCK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */ + cinfo->num_components = 4; + if (cinfo->lossless) { + SET_COMP(0, 1, 1,1, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(3, 4, 1,1, 0, 0,0); + } else { /* lossy */ + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(3, 4, 2,2, 0, 0,0); + } + break; + case JCS_UNKNOWN: + cinfo->num_components = cinfo->input_components; + if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + for (ci = 0; ci < cinfo->num_components; ci++) { + SET_COMP(ci, ci, 1,1, 0, 0,0); + } + break; + default: + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + } +} + + +#ifdef C_PROGRESSIVE_SUPPORTED + +LOCAL(jpeg_scan_info *) +fill_scans (jpeg_scan_info * scanptr, int ncomps, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for each component */ +{ + int ci; + + for (ci = 0; ci < ncomps; ci++) { + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } + return scanptr; +} + + +LOCAL(jpeg_scan_info *) +fill_a_scan (jpeg_scan_info * scanptr, int ci, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for specified component */ +{ + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + return scanptr; +} + +LOCAL(jpeg_scan_info *) +fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al) +/* Support routine: generate interleaved DC scan if possible, else N scans */ +{ + int ci; + + if (ncomps <= MAX_COMPS_IN_SCAN) { + /* Single interleaved DC scan */ + scanptr->comps_in_scan = ncomps; + for (ci = 0; ci < ncomps; ci++) + scanptr->component_index[ci] = ci; + scanptr->Ss = scanptr->Se = 0; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } else { + /* Noninterleaved DC scan for each component */ + scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al); + } + return scanptr; +} + + +/* + * Create a recommended progressive-JPEG script. + * cinfo->num_components and cinfo->jpeg_color_space must be correct. + */ + +GLOBAL(void) +jpeg_simple_progression (j_compress_ptr cinfo) +{ + int ncomps = cinfo->num_components; + int nscans; + jpeg_scan_info * scanptr; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Figure space needed for script. Calculation must match code below! */ + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + nscans = 10; + } else { + /* All-purpose script for other color spaces. */ + if (ncomps > MAX_COMPS_IN_SCAN) + nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */ + else + nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */ + } + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_progression is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space, and we allocate + * enough space to handle YCbCr even if initially asked for grayscale. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { + cinfo->script_space_size = MAX(nscans, 10); + cinfo->script_space = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + (size_t)cinfo->script_space_size * SIZEOF(jpeg_scan_info)); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + /* Initial DC scan */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + /* Initial AC scan: get some luma data out in a hurry */ + scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2); + /* Chroma data is too small to be worth expending many scans on */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1); + /* Complete spectral selection for luma AC */ + scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2); + /* Refine next bit of luma AC */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1); + /* Finish DC successive approximation */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + /* Finish AC successive approximation */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0); + /* Luma bottom bit comes last since it's usually largest scan */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0); + } else { + /* All-purpose script for other color spaces. */ + /* Successive approximation first pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2); + scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2); + /* Successive approximation second pass */ + scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1); + /* Successive approximation final pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0); + } +} + +#endif /* C_PROGRESSIVE_SUPPORTED */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* + * Create a single-entry lossless-JPEG script containing all components. + * cinfo->num_components must be correct. + */ + +GLOBAL(void) +jpeg_simple_lossless (j_compress_ptr cinfo, int predictor, int point_transform) +{ + int ncomps = cinfo->num_components; + int nscans = 1; + int ci; + jpeg_scan_info * scanptr; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + cinfo->lossless = TRUE; + + /* Set jpeg_color_space. */ + jpeg_default_colorspace(cinfo); + + /* Check to ensure that all components will fit in one scan. */ + if (cinfo->num_components > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPS_IN_SCAN); + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_lossless is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { + cinfo->script_space_size = nscans; + cinfo->script_space = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + (size_t)cinfo->script_space_size * SIZEOF(jpeg_scan_info)); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + /* Fill the script. */ + scanptr->comps_in_scan = ncomps; + for (ci = 0; ci < (int)ncomps; ci++) + scanptr->component_index[ci] = ci; + scanptr->Ss = predictor; + scanptr->Se = 0; + scanptr->Ah = 0; + scanptr->Al = point_transform; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jcphuff.c b/dcmjpeg/libijg8/jcphuff.c new file mode 100644 index 00000000..1bf2edeb --- /dev/null +++ b/dcmjpeg/libijg8/jcphuff.c @@ -0,0 +1,848 @@ +/* + * jcphuff.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for progressive JPEG. + * + * We do not support output suspension in this module, since the library + * currently does not allow multiple-scan files to be written with output + * suspension. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ +#include "jchuff8.h" /* Declarations shared with jc*huff.c */ + +#ifdef C_PROGRESSIVE_SUPPORTED + +/* Expanded entropy encoder object for progressive Huffman encoding. */ + +typedef struct { + /* Mode flag: TRUE for optimization, FALSE for actual data output */ + boolean gather_statistics; + + /* Bit-level coding status. + * next_output_byte/free_in_buffer are local copies of cinfo->dest fields. + */ + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ + j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */ + + /* Coding status for DC components */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ + + /* Coding status for AC components */ + int ac_tbl_no; /* the table number of the single component */ + unsigned int EOBRUN; /* run length of EOBs */ + unsigned int BE; /* # of buffered correction bits before MCU */ + char * bit_buffer; /* buffer for correction bits (1 per char) */ + /* packing correction bits tightly would save some space but cost time... */ + + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan). + * Since any one scan codes only DC or only AC, we only need one set + * of tables, not one for DC and one for AC. + */ + c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Statistics tables for optimization; again, one set is enough */ + long * count_ptrs[NUM_HUFF_TBLS]; +} phuff_entropy_encoder; + +typedef phuff_entropy_encoder * phuff_entropy_ptr; + +/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit + * buffer can hold. Larger sizes may slightly improve compression, but + * 1000 is already well into the realm of overkill. + * The minimum safe size is 64 bits. + */ + +#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */ + +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than IJG_INT32. + * We assume that int right shift is unsigned if IJG_INT32 right shift is, + * which should be safe. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS int ishift_temp; +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +/* Forward declarations */ +METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo)); +METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo)); + + +/* + * Initialize for a Huffman-compressed scan using progressive JPEG. + */ + +METHODDEF(void) +start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + boolean is_DC_band; + int ci, tbl; + jpeg_component_info * compptr; + + entropy->cinfo = cinfo; + entropy->gather_statistics = gather_statistics; + + is_DC_band = (cinfo->Ss == 0); + + /* We assume jcmaster.c already validated the scan parameters. */ + + /* Select execution routines */ + if (cinfo->Ah == 0) { + if (is_DC_band) + lossyc->entropy_encode_mcu = encode_mcu_DC_first; + else + lossyc->entropy_encode_mcu = encode_mcu_AC_first; + } else { + if (is_DC_band) + lossyc->entropy_encode_mcu = encode_mcu_DC_refine; + else { + lossyc->entropy_encode_mcu = encode_mcu_AC_refine; + /* AC refinement needs a correction bit buffer */ + if (entropy->bit_buffer == NULL) + entropy->bit_buffer = (char *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + MAX_CORR_BITS * SIZEOF(char)); + } + } + if (gather_statistics) + lossyc->pub.entropy_finish_pass = finish_pass_gather_phuff; + else + lossyc->pub.entropy_finish_pass = finish_pass_phuff; + + /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1 + * for AC coefficients. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Initialize DC predictions to 0 */ + entropy->last_dc_val[ci] = 0; + /* Get table index */ + if (is_DC_band) { + if (cinfo->Ah != 0) /* DC refinement needs no table */ + continue; + tbl = compptr->dc_tbl_no; + } else { + entropy->ac_tbl_no = tbl = compptr->ac_tbl_no; + } + if (gather_statistics) { + /* Check for invalid table index */ + /* (make_c_derived_tbl does this in the other path) */ + if (tbl < 0 || tbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->count_ptrs[tbl] == NULL) + entropy->count_ptrs[tbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long)); + } else { + /* Compute derived values for Huffman table */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl, + & entropy->derived_tbls[tbl]); + } + } + + /* Initialize AC stuff */ + entropy->EOBRUN = 0; + entropy->BE = 0; + + /* Initialize bit buffer to empty */ + entropy->put_buffer = 0; + entropy->put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file. + * NB: these must be called only when actually outputting, + * that is, entropy->gather_statistics == FALSE. + */ + +/* Emit a byte */ +#define emit_byte(entropy,val) \ + { *(entropy)->next_output_byte++ = (JOCTET) (val); \ + if (--(entropy)->free_in_buffer == 0) \ + dump_buffer(entropy); } + + +LOCAL(void) +dump_buffer (phuff_entropy_ptr entropy) +/* Empty the output buffer; we do not support suspension in this module. */ +{ + struct jpeg_destination_mgr * dest = entropy->cinfo->dest; + + if (! (*dest->empty_output_buffer) (entropy->cinfo)) + ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND); + /* After a successful buffer dump, must reset buffer pointers */ + entropy->next_output_byte = dest->next_output_byte; + entropy->free_in_buffer = dest->free_in_buffer; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(void) +emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) +/* Emit some bits, unless we are in gather mode */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = entropy->put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + if (entropy->gather_statistics) + return; /* do nothing if we're only getting stats */ + + put_buffer &= (((IJG_INT32) 1)<put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(entropy, c); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(entropy, 0); + } + put_buffer <<= 8; + put_bits -= 8; + } + + entropy->put_buffer = put_buffer; /* update variables */ + entropy->put_bits = put_bits; +} + + +LOCAL(void) +flush_bits (phuff_entropy_ptr entropy) +{ + emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */ + entropy->put_buffer = 0; /* and reset bit-buffer to empty */ + entropy->put_bits = 0; +} + + +/* + * Emit (or just count) a Huffman symbol. + */ + +INLINE +LOCAL(void) +emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol) +{ + if (entropy->gather_statistics) + entropy->count_ptrs[tbl_no][symbol]++; + else { + c_derived_tbl * tbl = entropy->derived_tbls[tbl_no]; + emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]); + } +} + + +/* + * Emit bits from a correction bit buffer. + */ + +LOCAL(void) +emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart, + unsigned int nbits) +{ + if (entropy->gather_statistics) + return; /* no real work */ + + while (nbits > 0) { + emit_bits(entropy, (unsigned int) (*bufstart), 1); + bufstart++; + nbits--; + } +} + + +/* + * Emit any pending EOBRUN symbol. + */ + +LOCAL(void) +emit_eobrun (phuff_entropy_ptr entropy) +{ + register int temp, nbits; + + if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */ + temp = (int)entropy->EOBRUN; + nbits = 0; + while ((temp >>= 1)) + nbits++; + /* safety check: shouldn't happen given limited correction-bit buffer */ + if (nbits > 14) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4); + if (nbits) + emit_bits(entropy, entropy->EOBRUN, nbits); + + entropy->EOBRUN = 0; + + /* Emit any buffered correction bits */ + emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE); + entropy->BE = 0; + } +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(void) +emit_restart (phuff_entropy_ptr entropy, int restart_num) +{ + int ci; + + emit_eobrun(entropy); + + if (! entropy->gather_statistics) { + flush_bits(entropy); + emit_byte(entropy, 0xFF); + emit_byte(entropy, JPEG_RST0 + restart_num); + } + + if (entropy->cinfo->Ss == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++) + entropy->last_dc_val[ci] = 0; + } else { + /* Re-initialize all AC-related fields to 0 */ + entropy->EOBRUN = 0; + entropy->BE = 0; + } +} + + +/* + * MCU encoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp, temp2; + register int nbits; + int blkn, ci; + int Al = cinfo->Al; + JBLOCKROW block; + jpeg_component_info * compptr; + ISHIFT_TEMPS + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + + /* Compute the DC value after the required point transform by Al. + * This is simply an arithmetic right shift. + */ + temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al); + + /* DC differences are figured on the point-transformed values. */ + temp = temp2 - entropy->last_dc_val[ci]; + entropy->last_dc_val[ci] = temp2; + + /* Encode the DC coefficient difference per section G.1.2.1 */ + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit the Huffman-coded symbol for the number of bits */ + emit_symbol(entropy, compptr->dc_tbl_no, nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + emit_bits(entropy, (unsigned int) temp2, nbits); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp, temp2; + register int nbits; + register int r, k; + int Se = cinfo->Se; + int Al = cinfo->Al; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */ + + r = 0; /* r = run length of zeros */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = (*block)[jpeg_natural_order[k]]) == 0) { + r++; + continue; + } + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value; so the code is + * interwoven with finding the abs value (temp) and output bits (temp2). + */ + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + /* For a negative coef, want temp2 = bitwise complement of abs(coef) */ + temp2 = ~temp; + } else { + temp >>= Al; /* apply the point transform */ + temp2 = temp; + } + /* Watch out for case that nonzero coef is zero after point transform */ + if (temp == 0) { + r++; + continue; + } + + /* Emit any pending EOBRUN */ + if (entropy->EOBRUN > 0) + emit_eobrun(entropy); + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + emit_bits(entropy, (unsigned int) temp2, nbits); + + r = 0; /* reset zero run length */ + } + + if (r > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + if (entropy->EOBRUN == 0x7FFF) + emit_eobrun(entropy); /* force it out to avoid overflow */ + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp; + int blkn; + int Al = cinfo->Al; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* We simply emit the Al'th bit of the DC coefficient value. */ + temp = (*block)[0]; + emit_bits(entropy, (unsigned int) (temp >> Al), 1); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + register int temp; + register int r, k; + int EOB; + char *BR_buffer; + unsigned int BR; + int Se = cinfo->Se; + int Al = cinfo->Al; + JBLOCKROW block; + int absvalues[DCTSIZE2]; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart(entropy, entropy->next_restart_num); + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* It is convenient to make a pre-pass to determine the transformed + * coefficients' absolute values and the EOB position. + */ + EOB = 0; + for (k = cinfo->Ss; k <= Se; k++) { + temp = (*block)[jpeg_natural_order[k]]; + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value. + */ + if (temp < 0) + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + absvalues[k] = temp; /* save abs value for main pass */ + if (temp == 1) + EOB = k; /* EOB = index of last newly-nonzero coef */ + } + + /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */ + + r = 0; /* r = run length of zeros */ + BR = 0; /* BR = count of buffered bits added now */ + BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = absvalues[k]) == 0) { + r++; + continue; + } + + /* Emit any required ZRLs, but not if they can be folded into EOB */ + while (r > 15 && k <= EOB) { + /* emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + /* Emit ZRL */ + emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + /* Emit buffered correction bits that must be associated with ZRL */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + } + + /* If the coef was previously nonzero, it only needs a correction bit. + * NOTE: a straight translation of the spec's figure G.7 would suggest + * that we also need to test r > 15. But if r > 15, we can only get here + * if k > EOB, which implies that this coefficient is not 1. + */ + if (temp > 1) { + /* The correction bit is the next bit of the absolute value. */ + BR_buffer[BR++] = (char) (temp & 1); + continue; + } + + /* Emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1); + + /* Emit output bit for newly-nonzero coef */ + temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1; + emit_bits(entropy, (unsigned int) temp, 1); + + /* Emit buffered correction bits that must be associated with this code */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + r = 0; /* reset zero run length */ + } + + if (r > 0 || BR > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + entropy->BE += BR; /* concat my correction bits to older ones */ + /* We force out the EOB if we risk either: + * 1. overflow of the EOB counter; + * 2. overflow of the correction bit buffer during the next MCU. + */ + if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1)) + emit_eobrun(entropy); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * Finish up at the end of a Huffman-compressed progressive scan. + */ + +METHODDEF(void) +finish_pass_phuff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Flush out any buffered data */ + emit_eobrun(entropy); + flush_bits(entropy); + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather_phuff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private; + boolean is_DC_band; + int ci, tbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did[NUM_HUFF_TBLS]; + + /* Flush out buffered data (all we care about is counting the EOB symbol) */ + emit_eobrun(entropy); + + is_DC_band = (cinfo->Ss == 0); + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did, SIZEOF(did)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + if (is_DC_band) { + if (cinfo->Ah != 0) /* DC refinement needs no table */ + continue; + tbl = compptr->dc_tbl_no; + } else { + tbl = compptr->ac_tbl_no; + } + if (! did[tbl]) { + if (is_DC_band) + htblptr = & cinfo->dc_huff_tbl_ptrs[tbl]; + else + htblptr = & cinfo->ac_huff_tbl_ptrs[tbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]); + did[tbl] = TRUE; + } + } +} + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return (cinfo->Ss != 0 || cinfo->Ah == 0); +} + + +/* + * Module initialization routine for progressive Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_phuff_encoder (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + phuff_entropy_ptr entropy; + int i; + + entropy = (phuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(phuff_entropy_encoder)); + lossyc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + lossyc->pub.entropy_start_pass = start_pass_phuff; + lossyc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + entropy->count_ptrs[i] = NULL; + } + entropy->bit_buffer = NULL; /* needed only in AC refinement scan */ +} + +#endif /* C_PROGRESSIVE_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jcpred.c b/dcmjpeg/libijg8/jcpred.c new file mode 100644 index 00000000..030e10c5 --- /dev/null +++ b/dcmjpeg/libijg8/jcpred.c @@ -0,0 +1,314 @@ +/* + * jcpred.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample differencing for lossless JPEG. + * + * In order to avoid paying the performance penalty of having to check the + * predictor being used and the row being processed for each call of the + * undifferencer, and to promote optimization, we have separate differencing + * functions for each case. + * + * We are able to avoid duplicating source code by implementing the predictors + * and differencers as macros. Each of the differencing functions are + * simply wrappers around a DIFFERENCE macro with the appropriate PREDICTOR + * macro passed as an argument. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +/* Private predictor object */ + +typedef struct { + /* MCU-rows left in the restart interval for each component */ + unsigned int restart_rows_to_go[MAX_COMPONENTS]; +} c_predictor; + +typedef c_predictor * c_pred_ptr; + +/* Forward declarations */ +LOCAL(void) reset_predictor + JPP((j_compress_ptr cinfo, int ci)); +METHODDEF(void) start_pass + JPP((j_compress_ptr cinfo)); + + +/* Predictor for the first column of the first row: 2^(P-Pt-1) */ +#define INITIAL_PREDICTORx (1 << (cinfo->data_precision - cinfo->Al - 1)) + +/* Predictor for the first column of the remaining rows: Rb */ +#define INITIAL_PREDICTOR2 GETJSAMPLE(prev_row[0]) + + +/* + * 1-Dimensional differencer routine. + * + * This macro implements the 1-D horizontal predictor (1). INITIAL_PREDICTOR + * is used as the special case predictor for the first column, which must be + * either INITIAL_PREDICTOR2 or INITIAL_PREDICTORx. The remaining samples + * use PREDICTOR1. + */ + +#define DIFFERENCE_1D(INITIAL_PREDICTOR) \ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; \ + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; \ + boolean restart = FALSE; \ + unsigned int xindex; \ + int samp, Ra; \ + \ + samp = GETJSAMPLE(input_buf[0]); \ + diff_buf[0] = samp - INITIAL_PREDICTOR; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Ra = samp; \ + samp = GETJSAMPLE(input_buf[xindex]); \ + diff_buf[xindex] = samp - PREDICTOR1; \ + } \ + \ + /* Account for restart interval (no-op if not using restarts) */ \ + if (cinfo->restart_interval) { \ + if (--(pred->restart_rows_to_go[ci]) == 0) { \ + reset_predictor(cinfo, ci); \ + restart = TRUE; \ + } \ + } + + +/* + * 2-Dimensional differencer routine. + * + * This macro implements the 2-D horizontal predictors (#2-7). PREDICTOR2 is + * used as the special case predictor for the first column. The remaining + * samples use PREDICTOR, which is a function of Ra, Rb, Rc. + * + * Because prev_row and output_buf may point to the same storage area (in an + * interleaved image with Vi=1, for example), we must take care to buffer Rb/Rc + * before writing the current reconstructed sample value into output_buf. + */ + +#define DIFFERENCE_2D(PREDICTOR) \ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; \ + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; \ + unsigned int xindex; \ + int samp, Ra, Rb, Rc; \ + \ + Rb = GETJSAMPLE(prev_row[0]); \ + samp = GETJSAMPLE(input_buf[0]); \ + diff_buf[0] = samp - PREDICTOR2; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Rc = Rb; \ + Rb = GETJSAMPLE(prev_row[xindex]); \ + Ra = samp; \ + samp = GETJSAMPLE(input_buf[xindex]); \ + diff_buf[xindex] = samp - PREDICTOR; \ + } \ + \ + /* Account for restart interval (no-op if not using restarts) */ \ + if (cinfo->restart_interval) { \ + if (--pred->restart_rows_to_go[ci] == 0) \ + reset_predictor(cinfo, ci); \ + } + +#define JPEG_UNUSED(x) ((void)x) + +/* + * Differencers for the all rows but the first in a scan or restart interval. + * The first sample in the row is differenced using the vertical + * predictor (2). The rest of the samples are differenced using the + * predictor specified in the scan header. + */ + +METHODDEF(void) +jpeg_difference1(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_1D(INITIAL_PREDICTOR2); + JPEG_UNUSED(restart); +} + +METHODDEF(void) +jpeg_difference2(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR2); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference3(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR3); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference4(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_2D(PREDICTOR4); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference5(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR5); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference6(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR6); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + +METHODDEF(void) +jpeg_difference7(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, const JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + DIFFERENCE_2D(PREDICTOR7); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Ra); +} + + +/* + * Differencer for the first row in a scan or restart interval. The first + * sample in the row is differenced using the special predictor constant + * x=2^(P-Pt-1). The rest of the samples are differenced using the + * 1-D horizontal predictor (1). + */ + +METHODDEF(void) +jpeg_difference_first_row(j_compress_ptr cinfo, int ci, + const JSAMPROW input_buf, JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width) +{ + DIFFERENCE_1D(INITIAL_PREDICTORx); + + /* + * Now that we have differenced the first row, we want to use the + * differencer which corresponds to the predictor specified in the + * scan header. + * + * Note that we don't to do this if we have just reset the predictor + * for a new restart interval. + */ + if (!restart) { + switch (cinfo->Ss) { + case 1: + losslsc->predict_difference[ci] = jpeg_difference1; + break; + case 2: + losslsc->predict_difference[ci] = jpeg_difference2; + break; + case 3: + losslsc->predict_difference[ci] = jpeg_difference3; + break; + case 4: + losslsc->predict_difference[ci] = jpeg_difference4; + break; + case 5: + losslsc->predict_difference[ci] = jpeg_difference5; + break; + case 6: + losslsc->predict_difference[ci] = jpeg_difference6; + break; + case 7: + losslsc->predict_difference[ci] = jpeg_difference7; + break; + } + } +} + +/* + * Reset predictor at the start of a pass or restart interval. + */ + +LOCAL(void) +reset_predictor (j_compress_ptr cinfo, int ci) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; + + /* Initialize restart counter */ + pred->restart_rows_to_go[ci] = + cinfo->restart_interval / cinfo->MCUs_per_row; + + /* Set difference function to first row function */ + losslsc->predict_difference[ci] = jpeg_difference_first_row; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo) +{ + /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */ + /* c_pred_ptr pred = (c_pred_ptr) losslsc->pred_private; */ + int ci; + + /* Check that the restart interval is an integer multiple of the number + * of MCU in an MCU-row. + */ + if (cinfo->restart_interval % cinfo->MCUs_per_row != 0) + ERREXIT2(cinfo, JERR_BAD_RESTART, + (int)cinfo->restart_interval, (int)cinfo->MCUs_per_row); + + /* Set predictors for start of pass */ + for (ci = 0; ci < cinfo->num_components; ci++) + reset_predictor(cinfo, ci); +} + + +/* + * Module initialization routine for the differencer. + */ + +GLOBAL(void) +jinit_differencer (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + c_pred_ptr pred; + + pred = (c_pred_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_predictor)); + losslsc->pred_private = (void *) pred; + losslsc->predict_start_pass = start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg8/jcprepct.c b/dcmjpeg/libijg8/jcprepct.c new file mode 100644 index 00000000..bb8834ff --- /dev/null +++ b/dcmjpeg/libijg8/jcprepct.c @@ -0,0 +1,354 @@ +/* + * jcprepct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the compression preprocessing controller. + * This controller manages the color conversion, downsampling, + * and edge expansion steps. + * + * Most of the complexity here is associated with buffering input rows + * as required by the downsampler. See the comments at the head of + * jcsample.c for the downsampler's needs. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* At present, jcsample.c can request context rows only for smoothing. + * In the future, we might also need context rows for CCIR601 sampling + * or other more-complex downsampling procedures. The code to support + * context rows should be compiled only if needed. + */ +#ifdef INPUT_SMOOTHING_SUPPORTED +#define CONTEXT_ROWS_SUPPORTED +#endif + + +/* + * For the simple (no-context-row) case, we just need to buffer one + * row group's worth of pixels for the downsampling step. At the bottom of + * the image, we pad to a full row group by replicating the last pixel row. + * The downsampler's last output row is then replicated if needed to pad + * out to a full iMCU row. + * + * When providing context rows, we must buffer three row groups' worth of + * pixels. Three row groups are physically allocated, but the row pointer + * arrays are made five row groups high, with the extra pointers above and + * below "wrapping around" to point to the last and first real row groups. + * This allows the downsampler to access the proper context rows. + * At the top and bottom of the image, we create dummy context rows by + * copying the first or last real pixel row. This copying could be avoided + * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the + * trouble on the compression side. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_prep_controller pub; /* public fields */ + + /* Downsampling input buffer. This buffer holds color-converted data + * until we have enough to do a downsample step. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + JDIMENSION rows_to_go; /* counts rows remaining in source image */ + int next_buf_row; /* index of next row to store in color_buf */ + +#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */ + int this_row_group; /* starting row index of group to process */ + int next_buf_stop; /* downsample when we reach this index */ +#endif +} my_prep_controller; + +typedef my_prep_controller * my_prep_ptr; + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + + if (pass_mode != JBUF_PASS_THRU) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Initialize total-height counter for detecting bottom of image */ + prep->rows_to_go = cinfo->image_height; + /* Mark the conversion buffer empty */ + prep->next_buf_row = 0; +#ifdef CONTEXT_ROWS_SUPPORTED + /* Preset additional state variables for context mode. + * These aren't used in non-context mode, so we needn't test which mode. + */ + prep->this_row_group = 0; + /* Set next_buf_stop to stop after two row groups have been read in. */ + prep->next_buf_stop = 2 * cinfo->max_v_samp_factor; +#endif +} + + +/* + * Expand an image vertically from height input_rows to height output_rows, + * by duplicating the bottom row. + */ + +LOCAL(void) +expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols, + int input_rows, int output_rows) +{ + register int row; + + for (row = input_rows; row < output_rows; row++) { + jcopy_sample_rows(image_data, input_rows-1, image_data, row, + 1, num_cols); + } +} + + +/* + * Process some data in the simple no-context case. + * + * Preprocessor output data is counted in "row groups". A row group + * is defined to be v_samp_factor sample rows of each component. + * Downsampling will produce this much data from each max_v_samp_factor + * input rows. + */ + +METHODDEF(void) +pre_process_data (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + JDIMENSION inrows; + jpeg_component_info * compptr; + + while (*in_row_ctr < in_rows_avail && + *out_row_group_ctr < out_row_groups_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = cinfo->max_v_samp_factor - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + *in_row_ctr += (JDIMENSION)numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= (JDIMENSION)numrows; + /* If at bottom of image, pad to fill the conversion buffer. */ + if (prep->rows_to_go == 0 && + prep->next_buf_row < cinfo->max_v_samp_factor) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, cinfo->max_v_samp_factor); + } + prep->next_buf_row = cinfo->max_v_samp_factor; + } + /* If we've filled the conversion buffer, empty it. */ + if (prep->next_buf_row == cinfo->max_v_samp_factor) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, (JDIMENSION) 0, + output_buf, *out_row_group_ctr); + prep->next_buf_row = 0; + (*out_row_group_ctr)++; + } + /* If at bottom of image, pad the output to a full iMCU height. + * Note we assume the caller is providing a one-iMCU-height output buffer! + */ + if (prep->rows_to_go == 0 && + *out_row_group_ctr < out_row_groups_avail) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + expand_bottom_edge(output_buf[ci], + compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit, + (int)*out_row_group_ctr * compptr->v_samp_factor, + (int)out_row_groups_avail * compptr->v_samp_factor); + } + *out_row_group_ctr = out_row_groups_avail; + break; /* can exit outer loop without test */ + } + } +} + + +#ifdef CONTEXT_ROWS_SUPPORTED + +/* + * Process some data in the context case. + */ + +METHODDEF(void) +pre_process_context (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + int buf_height = cinfo->max_v_samp_factor * 3; + JDIMENSION inrows; + + while (*out_row_group_ctr < out_row_groups_avail) { + if (*in_row_ctr < in_rows_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = prep->next_buf_stop - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + /* Pad at top of image, if first time through */ + if (prep->rows_to_go == cinfo->image_height) { + for (ci = 0; ci < cinfo->num_components; ci++) { + int row; + for (row = 1; row <= cinfo->max_v_samp_factor; row++) { + jcopy_sample_rows(prep->color_buf[ci], 0, + prep->color_buf[ci], -row, + 1, cinfo->image_width); + } + } + } + *in_row_ctr += (JDIMENSION)numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= (JDIMENSION)numrows; + } else { + /* Return for more data, unless we are at the bottom of the image. */ + if (prep->rows_to_go != 0) + break; + /* When at bottom of image, pad to fill the conversion buffer. */ + if (prep->next_buf_row < prep->next_buf_stop) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, prep->next_buf_stop); + } + prep->next_buf_row = prep->next_buf_stop; + } + } + /* If we've gotten enough data, downsample a row group. */ + if (prep->next_buf_row == prep->next_buf_stop) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, + (JDIMENSION) prep->this_row_group, + output_buf, *out_row_group_ctr); + (*out_row_group_ctr)++; + /* Advance pointers with wraparound as necessary. */ + prep->this_row_group += cinfo->max_v_samp_factor; + if (prep->this_row_group >= buf_height) + prep->this_row_group = 0; + if (prep->next_buf_row >= buf_height) + prep->next_buf_row = 0; + prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor; + } + } +} + + +/* + * Create the wrapped-around downsampling input buffer needed for context mode. + */ + +LOCAL(void) +create_context_buffer (j_compress_ptr cinfo) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int rgroup_height = cinfo->max_v_samp_factor; + int ci, i; + jpeg_component_info * compptr; + JSAMPARRAY true_buffer, fake_buffer; + + /* Grab enough space for fake row pointers for all the components; + * we need five row groups' worth of pointers for each component. + */ + fake_buffer = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)(cinfo->num_components * 5 * rgroup_height) * + SIZEOF(JSAMPROW)); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate the actual buffer space (3 row groups) for this component. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + true_buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_data_units * cinfo->data_unit * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) (3 * rgroup_height)); + /* Copy true buffer row pointers into the middle of the fake row array */ + MEMCOPY(fake_buffer + rgroup_height, true_buffer, + 3 * (size_t)rgroup_height * SIZEOF(JSAMPROW)); + /* Fill in the above and below wraparound pointers */ + for (i = 0; i < rgroup_height; i++) { + fake_buffer[i] = true_buffer[2 * rgroup_height + i]; + fake_buffer[4 * rgroup_height + i] = true_buffer[i]; + } + prep->color_buf[ci] = fake_buffer + rgroup_height; + fake_buffer += 5 * rgroup_height; /* point to space for next component */ + } +} + +#endif /* CONTEXT_ROWS_SUPPORTED */ + + +/* + * Initialize preprocessing controller. + */ + +GLOBAL(void) +jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_prep_ptr prep; + int ci; + jpeg_component_info * compptr; + + if (need_full_buffer) /* safety check */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + prep = (my_prep_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_prep_controller)); + cinfo->prep = (struct jpeg_c_prep_controller *) prep; + prep->pub.start_pass = start_pass_prep; + + /* Allocate the color conversion buffer. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + if (cinfo->downsample->need_context_rows) { + /* Set up to provide context rows */ +#ifdef CONTEXT_ROWS_SUPPORTED + prep->pub.pre_process_data = pre_process_context; + create_context_buffer(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* No context, just make it tall enough for one row group */ + prep->pub.pre_process_data = pre_process_data; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prep->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_data_units * cinfo->data_unit * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/dcmjpeg/libijg8/jcsample.c b/dcmjpeg/libijg8/jcsample.c new file mode 100644 index 00000000..0ba08333 --- /dev/null +++ b/dcmjpeg/libijg8/jcsample.c @@ -0,0 +1,519 @@ +/* + * jcsample.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains downsampling routines. + * + * Downsampling input data is counted in "row groups". A row group + * is defined to be max_v_samp_factor pixel rows of each component, + * from which the downsampler produces v_samp_factor sample rows. + * A single row group is processed in each call to the downsampler module. + * + * The downsampler is responsible for edge-expansion of its output data + * to fill an integral number of DCT blocks horizontally. The source buffer + * may be modified if it is helpful for this purpose (the source buffer is + * allocated wide enough to correspond to the desired output width). + * The caller (the prep controller) is responsible for vertical padding. + * + * The downsampler may request "context rows" by setting need_context_rows + * during startup. In this case, the input arrays will contain at least + * one row group's worth of pixels above and below the passed-in data; + * the caller will create dummy rows at image top and bottom by replicating + * the first or last real pixel row. + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + * + * The downsampling algorithm used here is a simple average of the source + * pixels covered by the output pixel. The hi-falutin sampling literature + * refers to this as a "box filter". In general the characteristics of a box + * filter are not very good, but for the specific cases we normally use (1:1 + * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not + * nearly so bad. If you intend to use other sampling ratios, you'd be well + * advised to improve this code. + * + * A simple input-smoothing capability is provided. This is mainly intended + * for cleaning up color-dithered GIF input files (if you find it inadequate, + * we suggest using an external filtering program such as pnmconvol). When + * enabled, each input pixel P is replaced by a weighted sum of itself and its + * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF, + * where SF = (smoothing_factor / 1024). + * Currently, smoothing is only supported for 2h2v sampling factors. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Pointer to routine to downsample a single component */ +typedef JMETHOD(void, downsample1_ptr, + (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data)); + +/* Private subobject */ + +typedef struct { + struct jpeg_downsampler pub; /* public fields */ + + /* Downsampling method pointers, one per component */ + downsample1_ptr methods[MAX_COMPONENTS]; +} my_downsampler; + +typedef my_downsampler * my_downsample_ptr; + + +/* + * Initialize for a downsampling pass. + */ + +METHODDEF(void) +start_pass_downsample (j_compress_ptr cinfo) +{ + /* no work for now */ +} + + +/* + * Expand a component horizontally from width input_cols to width output_cols, + * by duplicating the rightmost samples. + */ + +LOCAL(void) +expand_right_edge (JSAMPARRAY image_data, int num_rows, + JDIMENSION input_cols, JDIMENSION output_cols) +{ + register JSAMPROW ptr; + register JSAMPLE pixval; + register int count; + int row; + int numcols = (int) (output_cols - input_cols); + + if (numcols > 0) { + for (row = 0; row < num_rows; row++) { + ptr = image_data[row] + input_cols; + pixval = ptr[-1]; /* don't need GETJSAMPLE() here */ + for (count = numcols; count > 0; count--) + *ptr++ = pixval; + } + } +} + + +/* + * Do downsampling for a whole row group (all components). + * + * In this version we simply downsample each component independently. + */ + +METHODDEF(void) +sep_downsample (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, JDIMENSION out_row_group_index) +{ + my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample; + int ci; + jpeg_component_info * compptr; + JSAMPARRAY in_ptr, out_ptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + in_ptr = input_buf[ci] + in_row_index; + out_ptr = output_buf[ci] + (out_row_group_index * (JDIMENSION)compptr->v_samp_factor); + (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr); + } +} + + +/* + * Downsample pixel values of a single component. + * One row group is processed per call. + * This version handles arbitrary integral sampling ratios, without smoothing. + * Note that this version is not actually used for customary sampling ratios. + */ + +METHODDEF(void) +int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v; + JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */ + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + JSAMPROW inptr, outptr; + IJG_INT32 outvalue; + + h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; + v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; + numpix = h_expand * v_expand; + numpix2 = numpix/2; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * (JDIMENSION)h_expand); + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + for (outcol = 0, outcol_h = 0; outcol < output_cols; + outcol++, outcol_h += (JDIMENSION)h_expand) { + outvalue = 0; + for (v = 0; v < v_expand; v++) { + inptr = input_data[inrow+v] + outcol_h; + for (h = 0; h < h_expand; h++) { + outvalue += (IJG_INT32) GETJSAMPLE(*inptr++); + } + } + *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); + } + inrow += v_expand; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * without smoothing. + */ + +METHODDEF(void) +fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + /* Copy the data */ + jcopy_sample_rows(input_data, 0, output_data, 0, + cinfo->max_v_samp_factor, cinfo->image_width); + /* Edge-expand */ + expand_right_edge(output_data, cinfo->max_v_samp_factor, + cinfo->image_width, compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit); +} + + +/* + * Downsample pixel values of a single component. + * This version handles the common case of 2:1 horizontal and 1:1 vertical, + * without smoothing. + * + * A note about the "bias" calculations: when rounding fractional values to + * integer, we do not want to always round 0.5 up to the next integer. + * If we did that, we'd introduce a noticeable bias towards larger values. + * Instead, this code is arranged so that 0.5 will be rounded up or down at + * alternate pixel locations (a simple ordered dither pattern). + */ + +METHODDEF(void) +h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int outrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr = input_data[outrow]; + bias = 0; /* bias = 0,1,0,1,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + + bias) >> 1); + bias ^= 1; /* 0=>1, 1=>0 */ + inptr += 2; + } + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * without smoothing. + */ + +METHODDEF(void) +h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr0, inptr1, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + bias = 1; /* bias = 1,2,1,2,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + + bias) >> 2); + bias ^= 3; /* 1=>2, 2=>1 */ + inptr0 += 2; inptr1 += 2; + } + inrow += 2; + } +} + + +#ifdef INPUT_SMOOTHING_SUPPORTED + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr; + IJG_INT32 membersum, neighsum, memberscale, neighscale; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols * 2); + + /* We don't bother to form the individual "smoothed" input pixel values; + * we can directly compute the output which is the average of the four + * smoothed values. Each of the four member pixels contributes a fraction + * (1-8*SF) to its own smoothed image and a fraction SF to each of the three + * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final + * output. The four corner-adjacent neighbor pixels contribute a fraction + * SF to just one smoothed pixel, or SF/4 to the final output; while the + * eight edge-adjacent neighbors contribute SF to each of two smoothed + * pixels, or SF/2 overall. In order to use integer arithmetic, these + * factors are scaled by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */ + neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */ + + inrow = 0; + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + above_ptr = input_data[inrow-1]; + below_ptr = input_data[inrow+2]; + + /* Special case for first column: pretend column -1 is same as column 0 */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]); + neighsum += neighsum; + neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + /* sum of pixels directly mapped to this output element */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + /* sum of edge-neighbor pixels */ + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]); + /* The edge-neighbors count twice as much as corner-neighbors */ + neighsum += neighsum; + /* Add in the corner-neighbors */ + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]); + /* form final output scaled up by 2^16 */ + membersum = membersum * memberscale + neighsum * neighscale; + /* round, descale and output it */ + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]); + neighsum += neighsum; + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + inrow += 2; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int outrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_data_units * (JDIMENSION)cinfo->data_unit; + register JSAMPROW inptr, above_ptr, below_ptr, outptr; + IJG_INT32 membersum, neighsum, memberscale, neighscale; + int colsum, lastcolsum, nextcolsum; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols); + + /* Each of the eight neighbor pixels contributes a fraction SF to the + * smoothed pixel, while the main pixel contributes (1-8*SF). In order + * to use integer arithmetic, these factors are multiplied by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */ + neighscale = cinfo->smoothing_factor * 64; /* scaled SF */ + + for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr = input_data[outrow]; + above_ptr = input_data[outrow-1]; + below_ptr = input_data[outrow+1]; + + /* Special case for first column */ + colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) + + GETJSAMPLE(*inptr); + membersum = GETJSAMPLE(*inptr++); + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = colsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + membersum = GETJSAMPLE(*inptr++); + above_ptr++; below_ptr++; + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + colsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + } +} + +#endif /* INPUT_SMOOTHING_SUPPORTED */ + + +/* + * Module initialization routine for downsampling. + * Note that we must select a routine for each component. + */ + +GLOBAL(void) +jinit_downsampler (j_compress_ptr cinfo) +{ + my_downsample_ptr downsample; + int ci; + jpeg_component_info * compptr; + boolean smoothok = TRUE; + + downsample = (my_downsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_downsampler)); + cinfo->downsample = (struct jpeg_downsampler *) downsample; + downsample->pub.start_pass = start_pass_downsample; + downsample->pub.downsample = sep_downsample; + downsample->pub.need_context_rows = FALSE; + + if (cinfo->CCIR601_sampling) + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* Verify we can handle the sampling factors, and set up method pointers */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor == cinfo->max_h_samp_factor && + compptr->v_samp_factor == cinfo->max_v_samp_factor) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = fullsize_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = fullsize_downsample; + } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && + compptr->v_samp_factor == cinfo->max_v_samp_factor) { + smoothok = FALSE; + downsample->methods[ci] = h2v1_downsample; + } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && + compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = h2v2_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = h2v2_downsample; + } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && + (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { + smoothok = FALSE; + downsample->methods[ci] = int_downsample; + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + } + +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor && !smoothok) + TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL); +#endif +} diff --git a/dcmjpeg/libijg8/jcscale.c b/dcmjpeg/libijg8/jcscale.c new file mode 100644 index 00000000..62dc88ed --- /dev/null +++ b/dcmjpeg/libijg8/jcscale.c @@ -0,0 +1,63 @@ +/* + * jcscale.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample downscaling by 2^Pt for lossless JPEG. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" /* Private declarations for lossless codec */ + + +#ifdef C_LOSSLESS_SUPPORTED + +METHODDEF(void) +simple_downscale(j_compress_ptr cinfo, + const JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width) +{ + /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */ + unsigned int xindex; + SHIFT_TEMPS + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) RIGHT_SHIFT(GETJSAMPLE(input_buf[xindex]), + cinfo->Al); +} + + +METHODDEF(void) +noscale(j_compress_ptr cinfo, + JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width) +{ + MEMCOPY(output_buf, input_buf, width * SIZEOF(JSAMPLE)); + return; +} + + +METHODDEF(void) +scaler_start_pass (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + /* Set scaler function based on Pt */ + if (cinfo->Al) + losslsc->scaler_scale = simple_downscale; + else + losslsc->scaler_scale = noscale; +} + + +GLOBAL(void) +jinit_c_scaler (j_compress_ptr cinfo) +{ + j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; + + losslsc->scaler_start_pass = scaler_start_pass; +} + +#endif /* C_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jcshuff.c b/dcmjpeg/libijg8/jcshuff.c new file mode 100644 index 00000000..b933f455 --- /dev/null +++ b/dcmjpeg/libijg8/jcshuff.c @@ -0,0 +1,661 @@ +/* + * jcshuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines for sequential JPEG. + * + * Much of the complexity here has to do with supporting output suspension. + * If the data destination module demands suspension, we want to be able to + * back up to the start of the current MCU. To do this, we copy state + * variables into local working storage, and update them back to the + * permanent JPEG objects only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ +#include "jchuff8.h" /* Declarations shared with jc*huff.c */ + + +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + IJG_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + savable_state saved; /* Bit buffer & DC state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + +#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ + long * dc_count_ptrs[NUM_HUFF_TBLS]; + long * ac_count_ptrs[NUM_HUFF_TBLS]; +#endif +} shuff_entropy_encoder; + +typedef shuff_entropy_encoder * shuff_entropy_ptr; + +/* Working state while writing an MCU. + * This struct contains all the fields that are needed by subroutines. + */ + +typedef struct { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ +} working_state; + + +/* Forward declarations */ +METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); +#ifdef ENTROPY_OPT_SUPPORTED +METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); +#endif + + +/* + * Initialize for a Huffman-compressed scan. + * If gather_statistics is TRUE, we do not output anything during the scan, + * just count the Huffman symbols used and generate Huffman code tables. + */ + +METHODDEF(void) +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int ci, dctbl, actbl; + jpeg_component_info * compptr; + + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + lossyc->entropy_encode_mcu = encode_mcu_gather; + lossyc->pub.entropy_finish_pass = finish_pass_gather; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + lossyc->entropy_encode_mcu = encode_mcu_huff; + lossyc->pub.entropy_finish_pass = finish_pass_huff; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + if (gather_statistics) { +#ifdef ENTROPY_OPT_SUPPORTED + /* Check for invalid table indexes */ + /* (make_c_derived_tbl does this in the other path) */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + if (actbl < 0 || actbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->dc_count_ptrs[dctbl] == NULL) + entropy->dc_count_ptrs[dctbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long)); + if (entropy->ac_count_ptrs[actbl] == NULL) + entropy->ac_count_ptrs[actbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long)); +#endif + } else { + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, + & entropy->dc_derived_tbls[dctbl]); + jpeg_make_c_derived_tbl(cinfo, FALSE, actbl, + & entropy->ac_derived_tbls[actbl]); + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Initialize bit buffer to empty */ + entropy->saved.put_buffer = 0; + entropy->saved.put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* Outputting bytes to the file */ + +/* Emit a byte, taking 'action' if must suspend. */ +#define emit_byte(state,val,action) \ + { *(state)->next_output_byte++ = (JOCTET) (val); \ + if (--(state)->free_in_buffer == 0) \ + if (! dump_buffer(state)) \ + { action; } } + + +LOCAL(boolean) +dump_buffer (working_state * state) +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +{ + struct jpeg_destination_mgr * dest = state->cinfo->dest; + + if (! (*dest->empty_output_buffer) (state->cinfo)) + return FALSE; + /* After a successful buffer dump, must reset buffer pointers */ + state->next_output_byte = dest->next_output_byte; + state->free_in_buffer = dest->free_in_buffer; + return TRUE; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(boolean) +emit_bits (working_state * state, unsigned int code, int size) +/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register IJG_INT32 put_buffer = (IJG_INT32) code; + register int put_bits = state->cur.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); + + put_buffer &= (((IJG_INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte(state, c, return FALSE); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte(state, 0, return FALSE); + } + put_buffer <<= 8; + put_bits -= 8; + } + + state->cur.put_buffer = put_buffer; /* update state variables */ + state->cur.put_bits = put_bits; + + return TRUE; +} + + +LOCAL(boolean) +flush_bits (working_state * state) +{ + if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ + return FALSE; + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ + state->cur.put_bits = 0; + return TRUE; +} + + +/* Encode a single block's worth of coefficients */ + +LOCAL(boolean) +encode_one_block (working_state * state, const JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl) +{ + register int temp, temp2; + register int nbits; + register int k, r, i; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = temp2 = block[0] - last_dc_val; + + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit the Huffman-coded symbol for the number of bits */ + if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + if (! emit_bits(state, (unsigned int) temp2, nbits)) + return FALSE; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k < DCTSIZE2; k++) { + if ((temp = block[jpeg_natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) + return FALSE; + r -= 16; + } + + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit Huffman symbol for run length / number of bits */ + i = (r << 4) + nbits; + if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (! emit_bits(state, (unsigned int) temp2, nbits)) + return FALSE; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0])) + return FALSE; + + return TRUE; +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(boolean) +emit_restart (working_state * state, int restart_num) +{ + int ci; + + if (! flush_bits(state)) + return FALSE; + + emit_byte(state, 0xFF, return FALSE); + emit_byte(state, JPEG_RST0 + restart_num, return FALSE); + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < state->cinfo->comps_in_scan; ci++) + state->cur.last_dc_val[ci] = 0; + + /* The restart counter is not updated until we successfully write the MCU. */ + + return TRUE; +} + + +/* + * Encode and output one MCU's worth of Huffman-compressed coefficients. + */ + +METHODDEF(boolean) +encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + working_state state; + int blkn, ci; + jpeg_component_info * compptr; + + /* Load up working state */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! emit_restart(&state, entropy->next_restart_num)) + return FALSE; + } + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + if (! encode_one_block(&state, + MCU_data[blkn][0], state.cur.last_dc_val[ci], + entropy->dc_derived_tbls[compptr->dc_tbl_no], + entropy->ac_derived_tbls[compptr->ac_tbl_no])) + return FALSE; + /* Update last_dc_val */ + state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + /* Completed MCU, so update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + working_state state; + + /* Load up working state ... flush_bits needs it */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Flush out the last data */ + if (! flush_bits(&state)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); +} + + +/* + * Huffman coding optimization. + * + * We first scan the supplied data and count the number of uses of each symbol + * that is to be Huffman-coded. (This process MUST agree with the code above.) + * Then we build a Huffman coding tree for the observed counts. + * Symbols which are not needed at all for the particular image are not + * assigned any code, which saves space in the DHT marker as well as in + * the compressed data. + */ + +#ifdef ENTROPY_OPT_SUPPORTED + + +/* Process a single block's worth of coefficients */ + +LOCAL(void) +htest_one_block (j_compress_ptr cinfo, const JCOEFPTR block, int last_dc_val, + long dc_counts[], long ac_counts[]) +{ + register int temp; + register int nbits; + register int k, r; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = block[0] - last_dc_val; + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count the Huffman symbol for the number of bits */ + dc_counts[nbits]++; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k < DCTSIZE2; k++) { + if ((temp = block[jpeg_natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + ac_counts[0xF0]++; + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count Huffman symbol for run length / number of bits */ + ac_counts[(r << 4) + nbits]++; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + ac_counts[0]++; +} + + +/* + * Trial-encode one MCU's worth of Huffman-compressed coefficients. + * No data is actually output, so no suspension return is possible. + */ + +METHODDEF(boolean) +encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int blkn, ci; + jpeg_component_info * compptr; + + /* Take care of restart intervals if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Update restart state */ + entropy->restarts_to_go = cinfo->restart_interval; + } + entropy->restarts_to_go--; + } + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], + entropy->dc_count_ptrs[compptr->dc_tbl_no], + entropy->ac_count_ptrs[compptr->ac_tbl_no]); + entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + return TRUE; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyc->entropy_private; + int ci, dctbl, actbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did_dc[NUM_HUFF_TBLS]; + boolean did_ac[NUM_HUFF_TBLS]; + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + MEMZERO(did_dc, SIZEOF(did_dc)); + MEMZERO(did_ac, SIZEOF(did_ac)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + if (! did_dc[dctbl]) { + htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); + did_dc[dctbl] = TRUE; + } + if (! did_ac[actbl]) { + htblptr = & cinfo->ac_huff_tbl_ptrs[actbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]); + did_ac[actbl] = TRUE; + } + } +} + + +#endif /* ENTROPY_OPT_SUPPORTED */ + + +METHODDEF(boolean) +need_optimization_pass (j_compress_ptr cinfo) +{ + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_shuff_encoder (j_compress_ptr cinfo) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + shuff_entropy_ptr entropy; + int i; + + entropy = (shuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(shuff_entropy_encoder)); + lossyc->entropy_private = (struct jpeg_entropy_encoder *) entropy; + lossyc->pub.entropy_start_pass = start_pass_huff; + lossyc->pub.need_optimization_pass = need_optimization_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; +#ifdef ENTROPY_OPT_SUPPORTED + entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; +#endif + } +} diff --git a/dcmjpeg/libijg8/jctrans.c b/dcmjpeg/libijg8/jctrans.c new file mode 100644 index 00000000..902401b1 --- /dev/null +++ b/dcmjpeg/libijg8/jctrans.c @@ -0,0 +1,424 @@ +/* + * jctrans.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding compression, + * that is, writing raw DCT coefficient arrays to an output JPEG file. + * The routines in jcapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ + + +/* Forward declarations */ +LOCAL(void) transencode_master_selection + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); +LOCAL(void) transencode_codec + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); +LOCAL(void) transencode_coef_controller + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); + + +/* + * Compression initialization for writing raw-coefficient data. + * Before calling this, all parameters and a data destination must be set up. + * Call jpeg_finish_compress() to actually write the data. + * + * The number of passed virtual arrays must match cinfo->num_components. + * Note that the virtual arrays need not be filled or even realized at + * the time write_coefficients is called; indeed, if the virtual arrays + * were requested from this compression object's memory manager, they + * typically will be realized during this routine and filled afterwards. + */ + +GLOBAL(void) +jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Mark all tables to be written */ + jpeg_suppress_tables(cinfo, FALSE); + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + transencode_master_selection(cinfo, coef_arrays); + /* Wait for jpeg_finish_compress() call */ + cinfo->next_scanline = 0; /* so jpeg_write_marker works */ + cinfo->global_state = CSTATE_WRCOEFS; +} + + +/* + * Initialize the compression object with default parameters, + * then copy from the source object all parameters needed for lossless + * transcoding. Parameters that can be varied without loss (such as + * scan script and Huffman optimization) are left in their default states. + */ + +GLOBAL(void) +jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, + j_compress_ptr dstinfo) +{ + JQUANT_TBL ** qtblptr; + jpeg_component_info *incomp, *outcomp; + JQUANT_TBL *c_quant, *slot_quant; + int tblno, ci, coefi; + + /* Safety check to ensure start_compress not called yet. */ + if (dstinfo->global_state != CSTATE_START) + ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state); + /* Copy fundamental image dimensions */ + dstinfo->image_width = srcinfo->image_width; + dstinfo->image_height = srcinfo->image_height; + dstinfo->input_components = srcinfo->num_components; + dstinfo->in_color_space = srcinfo->jpeg_color_space; + /* Initialize all parameters to default values */ + jpeg_set_defaults(dstinfo); + /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. + * Fix it to get the right header markers for the image colorspace. + */ + jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); + dstinfo->data_precision = srcinfo->data_precision; + dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; + /* Copy the source's quantization tables. */ + for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { + if (srcinfo->quant_tbl_ptrs[tblno] != NULL) { + qtblptr = & dstinfo->quant_tbl_ptrs[tblno]; + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo); + MEMCOPY((*qtblptr)->quantval, + srcinfo->quant_tbl_ptrs[tblno]->quantval, + SIZEOF((*qtblptr)->quantval)); + (*qtblptr)->sent_table = FALSE; + } + } + /* Copy the source's per-component info. + * Note we assume jpeg_set_defaults has allocated the dest comp_info array. + */ + dstinfo->num_components = srcinfo->num_components; + if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS) + ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components, + MAX_COMPONENTS); + for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info; + ci < dstinfo->num_components; ci++, incomp++, outcomp++) { + outcomp->component_id = incomp->component_id; + outcomp->h_samp_factor = incomp->h_samp_factor; + outcomp->v_samp_factor = incomp->v_samp_factor; + outcomp->quant_tbl_no = incomp->quant_tbl_no; + /* Make sure saved quantization table for component matches the qtable + * slot. If not, the input file re-used this qtable slot. + * IJG encoder currently cannot duplicate this. + */ + tblno = outcomp->quant_tbl_no; + if (tblno < 0 || tblno >= NUM_QUANT_TBLS || + srcinfo->quant_tbl_ptrs[tblno] == NULL) + ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno); + slot_quant = srcinfo->quant_tbl_ptrs[tblno]; + c_quant = incomp->quant_table; + if (c_quant != NULL) { + for (coefi = 0; coefi < DCTSIZE2; coefi++) { + if (c_quant->quantval[coefi] != slot_quant->quantval[coefi]) + ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno); + } + } + /* Note: we do not copy the source's Huffman table assignments; + * instead we rely on jpeg_set_colorspace to have made a suitable choice. + */ + } + /* Also copy JFIF version and resolution information, if available. + * Strictly speaking this isn't "critical" info, but it's nearly + * always appropriate to copy it if available. In particular, + * if the application chooses to copy JFIF 1.02 extension markers from + * the source file, we need to copy the version to make sure we don't + * emit a file that has 1.02 extensions but a claimed version of 1.01. + * We will *not*, however, copy version info from mislabeled "2.01" files. + */ + if (srcinfo->saw_JFIF_marker) { + if (srcinfo->JFIF_major_version == 1) { + dstinfo->JFIF_major_version = srcinfo->JFIF_major_version; + dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version; + } + dstinfo->density_unit = srcinfo->density_unit; + dstinfo->X_density = srcinfo->X_density; + dstinfo->Y_density = srcinfo->Y_density; + } +} + + +/* + * Master selection of compression modules for transcoding. + * This substitutes for jcinit.c's initialization of the full compressor. + */ + +LOCAL(void) +transencode_master_selection (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + cinfo->data_unit = DCTSIZE; + /* Although we don't actually use input_components for transcoding, + * jcmaster.c's initial_setup will complain if input_components is 0. + */ + cinfo->input_components = 1; + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, TRUE /* transcode only */); + + /* We need a special compression codec. */ + transencode_codec(cinfo, coef_arrays); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI, JFIF) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} + + +/* + * The rest of this file is a special implementation of the coefficient + * buffer controller. This is similar to jccoefct.c, but it handles only + * output from presupplied virtual arrays. Furthermore, we generate any + * dummy padding blocks on-the-fly rather than expecting them to be present + * in the arrays. + */ + +/* Private buffer controller object */ + +typedef struct { + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* Virtual block array for each component. */ + jvirt_barray_ptr * whole_image; + + /* Workspace for constructing dummy blocks at right/bottom edges. */ + JBLOCKROW dummy_buffer[C_MAX_DATA_UNITS_IN_MCU]; +} c_coef_controller; + +typedef c_coef_controller * c_coef_ptr; + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + + if (pass_mode != JBUF_CRANK_DEST) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); +} + + +/* + * Process some data. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, blockcnt; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW MCU_buffer[C_MAX_DATA_UNITS_IN_MCU]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * (JDIMENSION) compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yindex+yoffset < compptr->last_row_height) { + /* Fill in pointers to real blocks in this row */ + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < blockcnt; xindex++) + MCU_buffer[blkn++] = buffer_ptr++; + } else { + /* At bottom of image, need a whole row of dummy blocks */ + xindex = 0; + } + /* Fill in any dummy blocks needed in this row. + * Dummy blocks are filled in the same way as in jccoefct.c: + * all zeroes in the AC entries, DC entries equal to previous + * block's DC value. The init routine has already zeroed the + * AC entries, so we need only set the DC entries correctly. + */ + for (; xindex < compptr->MCU_width; xindex++) { + MCU_buffer[blkn] = coef->dummy_buffer[blkn]; + MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0]; + blkn++; + } + } + } + /* Try to write the MCU. */ + if (! (*lossyc->entropy_encode_mcu) (cinfo, MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +/* + * Initialize coefficient buffer controller. + * + * Each passed coefficient array must be the right size for that + * coefficient: width_in_data_units wide and height_in_data_units high, + * with unitheight at least v_samp_factor. + */ + +LOCAL(void) +transencode_coef_controller (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; + c_coef_ptr coef; + JBLOCKROW buffer; + int i; + + coef = (c_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_coef_controller)); + lossyc->coef_private = (struct jpeg_c_coef_controller *) coef; + + /* Save pointer to virtual arrays */ + coef->whole_image = coef_arrays; + + /* Allocate and pre-zero space for dummy DCT blocks. */ + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + jzero_far((void FAR *) buffer, C_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_DATA_UNITS_IN_MCU; i++) { + coef->dummy_buffer[i] = buffer + i; + } +} + + +/* + * Initialize the transencoer codec. + * This is called only once, during master selection. + */ + +LOCAL(void) +transencode_codec (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + j_lossy_c_ptr lossyc; + + /* Create subobject in permanent pool */ + lossyc = (j_lossy_c_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_c_codec)); + cinfo->codec = (struct jpeg_c_codec *) lossyc; + + /* Initialize sub-modules */ + + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef C_PROGRESSIVE_SUPPORTED + jinit_phuff_encoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_encoder(cinfo); + } + + /* We need a special coefficient buffer controller. */ + transencode_coef_controller(cinfo, coef_arrays); + + /* Initialize method pointers */ + lossyc->pub.start_pass = start_pass_coef; + lossyc->pub.compress_data = compress_output; +} diff --git a/dcmjpeg/libijg8/jdapimin.c b/dcmjpeg/libijg8/jdapimin.c new file mode 100644 index 00000000..3935c324 --- /dev/null +++ b/dcmjpeg/libijg8/jdapimin.c @@ -0,0 +1,401 @@ +/* + * jdapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-decompression case or the + * transcoding-only case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jdapistd.c. But also see jcomapi.c for routines + * shared by compression and decompression, and jdtrans.c for the transcoding + * case. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Initialization of a JPEG decompression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_decompress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = TRUE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->src = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) + cinfo->quant_tbl_ptrs[i] = NULL; + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + /* Initialize marker processor so application can override methods + * for COM, APPn markers before calling jpeg_read_header. + */ + cinfo->marker_list = NULL; + jinit_marker_reader(cinfo); + + /* And initialize the overall input controller. */ + jinit_input_controller(cinfo); + + /* OK, I'm ready */ + cinfo->global_state = DSTATE_START; +} + + +/* + * Destruction of a JPEG decompression object + */ + +GLOBAL(void) +jpeg_destroy_decompress (j_decompress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG decompression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_decompress (j_decompress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Set default decompression parameters. + */ + +LOCAL(void) +default_decompress_parms (j_decompress_ptr cinfo) +{ + /* Guess the input colorspace, and set output colorspace accordingly. */ + /* (Wish JPEG committee had provided a real way to specify this...) */ + /* Note application may override our guesses. */ + switch (cinfo->num_components) { + case 1: + cinfo->jpeg_color_space = JCS_GRAYSCALE; + cinfo->out_color_space = JCS_GRAYSCALE; + break; + + case 3: + if (cinfo->saw_JFIF_marker) { + cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ + } else if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_RGB; + break; + case 1: + cinfo->jpeg_color_space = JCS_YCbCr; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + break; + } + } else { + /* Saw no special markers, try to guess from the component IDs */ + int cid0 = cinfo->comp_info[0].component_id; + int cid1 = cinfo->comp_info[1].component_id; + int cid2 = cinfo->comp_info[2].component_id; + + if (cid0 == 1 && cid1 == 2 && cid2 == 3) + cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ + else if (cid0 == 82 && cid1 == 71 && cid2 == 66) + cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ + else { + if (cinfo->process == JPROC_LOSSLESS) { + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_LOSSLESS_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_RGB; /* assume it's RGB */ + } + else { /* Lossy processes */ + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_LOSSY_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + } + } + } + /* Always guess RGB is proper output colorspace. */ + cinfo->out_color_space = JCS_RGB; + break; + + case 4: + if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_CMYK; + break; + case 2: + cinfo->jpeg_color_space = JCS_YCCK; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ + break; + } + } else { + /* No special markers, assume straight CMYK. */ + cinfo->jpeg_color_space = JCS_CMYK; + } + cinfo->out_color_space = JCS_CMYK; + break; + + default: + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->out_color_space = JCS_UNKNOWN; + break; + } + + /* Set defaults for other decompression parameters. */ + cinfo->scale_num = 1; /* 1:1 scaling */ + cinfo->scale_denom = 1; + cinfo->output_gamma = 1.0; + cinfo->buffered_image = FALSE; + cinfo->raw_data_out = FALSE; + cinfo->dct_method = JDCT_DEFAULT; + cinfo->do_fancy_upsampling = TRUE; + cinfo->do_block_smoothing = TRUE; + cinfo->quantize_colors = FALSE; + /* We set these in case application only sets quantize_colors. */ + cinfo->dither_mode = JDITHER_FS; +#ifdef QUANT_2PASS_SUPPORTED + cinfo->two_pass_quantize = TRUE; +#else + cinfo->two_pass_quantize = FALSE; +#endif + cinfo->desired_number_of_colors = 256; + cinfo->colormap = NULL; + /* Initialize for no mode change in buffered-image mode. */ + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; +} + + +/* + * Decompression startup: read start of JPEG datastream to see what's there. + * Need only initialize JPEG object and supply a data source before calling. + * + * This routine will read as far as the first SOS marker (ie, actual start of + * compressed data), and will save all tables and parameters in the JPEG + * object. It will also initialize the decompression parameters to default + * values, and finally return JPEG_HEADER_OK. On return, the application may + * adjust the decompression parameters and then call jpeg_start_decompress. + * (Or, if the application only wanted to determine the image parameters, + * the data need not be decompressed. In that case, call jpeg_abort or + * jpeg_destroy to release any temporary space.) + * If an abbreviated (tables only) datastream is presented, the routine will + * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then + * re-use the JPEG object to read the abbreviated image datastream(s). + * It is unnecessary (but OK) to call jpeg_abort in this case. + * The JPEG_SUSPENDED return code only occurs if the data source module + * requests suspension of the decompressor. In this case the application + * should load more source data and then re-call jpeg_read_header to resume + * processing. + * If a non-suspending data source is used and require_image is TRUE, then the + * return code need not be inspected since only JPEG_HEADER_OK is possible. + * + * This routine is now just a front end to jpeg_consume_input, with some + * extra error checking. + */ + +GLOBAL(int) +jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) +{ + int retcode; + + if (cinfo->global_state != DSTATE_START && + cinfo->global_state != DSTATE_INHEADER) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + retcode = jpeg_consume_input(cinfo); + + switch (retcode) { + case JPEG_REACHED_SOS: + retcode = JPEG_HEADER_OK; + break; + case JPEG_REACHED_EOI: + if (require_image) /* Complain if application wanted an image */ + ERREXIT(cinfo, JERR_NO_IMAGE); + /* Reset to start state; it would be safer to require the application to + * call jpeg_abort, but we can't change it now for compatibility reasons. + * A side effect is to free any temporary memory (there shouldn't be any). + */ + jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */ + retcode = JPEG_HEADER_TABLES_ONLY; + break; + case JPEG_SUSPENDED: + /* no work */ + break; + } + + return retcode; +} + + +/* + * Consume data in advance of what the decompressor requires. + * This can be called at any time once the decompressor object has + * been created and a data source has been set up. + * + * This routine is essentially a state machine that handles a couple + * of critical state-transition actions, namely initial setup and + * transition from header scanning to ready-for-start_decompress. + * All the actual input is done via the input controller's consume_input + * method. + */ + +GLOBAL(int) +jpeg_consume_input (j_decompress_ptr cinfo) +{ + int retcode = JPEG_SUSPENDED; + + /* NB: every possible DSTATE value should be listed in this switch */ + switch (cinfo->global_state) { + case DSTATE_START: + /* Start-of-datastream actions: reset appropriate modules */ + (*cinfo->inputctl->reset_input_controller) (cinfo); + /* Initialize application's data source module */ + (*cinfo->src->init_source) (cinfo); + cinfo->global_state = DSTATE_INHEADER; + /*FALLTHROUGH*/ + case DSTATE_INHEADER: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ + /* Set up default parameters based on header data */ + default_decompress_parms(cinfo); + /* Set global state: ready for start_decompress */ + cinfo->global_state = DSTATE_READY; + } + break; + case DSTATE_READY: + /* Can't advance past first SOS until start_decompress is called */ + retcode = JPEG_REACHED_SOS; + break; + case DSTATE_PRELOAD: + case DSTATE_PRESCAN: + case DSTATE_SCANNING: + case DSTATE_RAW_OK: + case DSTATE_BUFIMAGE: + case DSTATE_BUFPOST: + case DSTATE_STOPPING: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + break; + default: + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + return retcode; +} + + +/* + * Have we finished reading the input file? + */ + +GLOBAL(boolean) +jpeg_input_complete (j_decompress_ptr cinfo) +{ + /* Check for valid jpeg object */ + if (cinfo->global_state < DSTATE_START || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->eoi_reached; +} + + +/* + * Is there more than one scan? + */ + +GLOBAL(boolean) +jpeg_has_multiple_scans (j_decompress_ptr cinfo) +{ + /* Only valid after jpeg_read_header completes */ + if (cinfo->global_state < DSTATE_READY || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->has_multiple_scans; +} + + +/* + * Finish JPEG decompression. + * + * This will normally just verify the file trailer and release temp storage. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_decompress (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) { + /* Terminate final pass of non-buffered mode */ + if (cinfo->output_scanline < cinfo->output_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state == DSTATE_BUFIMAGE) { + /* Finishing after a buffered-image operation */ + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state != DSTATE_STOPPING) { + /* STOPPING = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read until EOI */ + while (! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + /* Do final cleanup */ + (*cinfo->src->term_source) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); + return TRUE; +} diff --git a/dcmjpeg/libijg8/jdapistd.c b/dcmjpeg/libijg8/jdapistd.c new file mode 100644 index 00000000..1b6d8c51 --- /dev/null +++ b/dcmjpeg/libijg8/jdapistd.c @@ -0,0 +1,275 @@ +/* + * jdapistd.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-decompression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_decompress, it will end up linking in the entire decompressor. + * We thus must separate this file from jdapimin.c to avoid linking the + * whole decompression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Forward declarations */ +LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo)); + + +/* + * Decompression initialization. + * jpeg_read_header must be completed before calling this. + * + * If a multipass operating mode was selected, this will do all but the + * last pass, and thus may take a great deal of time. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_start_decompress (j_decompress_ptr cinfo) +{ + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize master control, select active modules */ + jinit_master_decompress(cinfo); + if (cinfo->buffered_image) { + /* No more work here; expecting jpeg_start_output next */ + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; + } + cinfo->global_state = DSTATE_PRELOAD; + } + if (cinfo->global_state == DSTATE_PRELOAD) { + /* If file has multiple scans, absorb them all into the coef buffer */ + if (cinfo->inputctl->has_multiple_scans) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return FALSE; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* jdmaster underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + } + cinfo->output_scan_number = cinfo->input_scan_number; + } else if (cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any dummy output passes, and set up for the final pass */ + return output_pass_setup(cinfo); +} + + +/* + * Set up for an output pass, and perform any dummy pass(es) needed. + * Common subroutine for jpeg_start_decompress and jpeg_start_output. + * Entry: global_state = DSTATE_PRESCAN only if previously suspended. + * Exit: If done, returns TRUE and sets global_state for proper output mode. + * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. + */ + +LOCAL(boolean) +output_pass_setup (j_decompress_ptr cinfo) +{ + if (cinfo->global_state != DSTATE_PRESCAN) { + /* First call: do pass setup */ + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; + cinfo->global_state = DSTATE_PRESCAN; + } + /* Loop over any required dummy passes */ + while (cinfo->master->is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Crank through the dummy pass */ + while (cinfo->output_scanline < cinfo->output_height) { + JDIMENSION last_scanline; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* Process some data */ + last_scanline = cinfo->output_scanline; + (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL, + &cinfo->output_scanline, (JDIMENSION) 0); + if (cinfo->output_scanline == last_scanline) + return FALSE; /* No progress made, must suspend */ + } + /* Finish up dummy pass, and set up for another one */ + (*cinfo->master->finish_output_pass) (cinfo); + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } + /* Ready for application to drive output pass through + * jpeg_read_scanlines or jpeg_read_raw_data. + */ + cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING; + return TRUE; +} + + +/* + * Read some scanlines of data from the JPEG decompressor. + * + * The return value will be the number of lines actually read. + * This may be less than the number requested in several cases, + * including bottom of image, data source suspension, and operating + * modes that emit multiple scanlines at a time. + * + * Note: we warn about excess calls to jpeg_read_scanlines() since + * this likely signals an application programmer error. However, + * an oversize buffer (max_lines > scanlines remaining) is not an error. + */ + +GLOBAL(JDIMENSION) +jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION max_lines) +{ + JDIMENSION row_ctr; + + if (cinfo->global_state != DSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Process some data */ + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines); + cinfo->output_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to read raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION max_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != DSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Verify that at least one iMCU row can be returned. */ + lines_per_iMCU_row = (JDIMENSION)(cinfo->max_v_samp_factor * cinfo->min_codec_data_unit); + if (max_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Decompress directly into user's buffer. */ + if (! (*cinfo->codec->decompress_data) (cinfo, data)) + return 0; /* suspension forced, can do nothing more */ + + /* OK, we processed one iMCU row. */ + cinfo->output_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} + + +/* Additional entry points for buffered-image mode. */ + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Initialize for an output pass in buffered-image mode. + */ + +GLOBAL(boolean) +jpeg_start_output (j_decompress_ptr cinfo, int scan_number) +{ + if (cinfo->global_state != DSTATE_BUFIMAGE && + cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Limit scan number to valid range */ + if (scan_number <= 0) + scan_number = 1; + if (cinfo->inputctl->eoi_reached && + scan_number > cinfo->input_scan_number) + scan_number = cinfo->input_scan_number; + cinfo->output_scan_number = scan_number; + /* Perform any dummy output passes, and set up for the real pass */ + return output_pass_setup(cinfo); +} + + +/* + * Finish up after an output pass in buffered-image mode. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_output (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) { + /* Terminate this pass. */ + /* We do not require the whole pass to have been completed. */ + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_BUFPOST; + } else if (cinfo->global_state != DSTATE_BUFPOST) { + /* BUFPOST = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read markers looking for SOS or EOI */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jdarith.c b/dcmjpeg/libijg8/jdarith.c new file mode 100644 index 00000000..8146e723 --- /dev/null +++ b/dcmjpeg/libijg8/jdarith.c @@ -0,0 +1,26 @@ +/* + * jdarith.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file holds place for arithmetic entropy decoding routines. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * Module initialization routine for arithmetic entropy decoding. + */ +GLOBAL(void) +jinit_arith_decoder (j_decompress_ptr cinfo); + +GLOBAL(void) +jinit_arith_decoder (j_decompress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +} diff --git a/dcmjpeg/libijg8/jdatadst.c b/dcmjpeg/libijg8/jdatadst.c new file mode 100644 index 00000000..7a9274d7 --- /dev/null +++ b/dcmjpeg/libijg8/jdatadst.c @@ -0,0 +1,151 @@ +/* + * jdatadst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains compression data destination routines for the case of + * emitting JPEG data to a file (or any stdio stream). While these routines + * are sufficient for most applications, some will want to use a different + * destination manager. + * IMPORTANT: we assume that fwrite() will correctly transcribe an array of + * JOCTETs into 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jerror8.h" + + +/* Expanded data destination object for stdio output */ + +typedef struct { + struct jpeg_destination_mgr pub; /* public fields */ + + FILE * outfile; /* target stream */ + JOCTET * buffer; /* start of buffer */ +} my_destination_mgr; + +typedef my_destination_mgr * my_dest_ptr; + +#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ + + +/* + * Initialize destination --- called by jpeg_start_compress + * before any data is actually written. + */ + +METHODDEF(void) +init_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + /* Allocate the output buffer --- it will be released when done with image */ + dest->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; +} + + +/* + * Empty the output buffer --- called whenever buffer fills up. + * + * In typical applications, this should write the entire output buffer + * (ignoring the current state of next_output_byte & free_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been dumped. + * + * In applications that need to be able to suspend compression due to output + * overrun, a FALSE return indicates that the buffer cannot be emptied now. + * In this situation, the compressor will return to its caller (possibly with + * an indication that it has not accepted all the supplied scanlines). The + * application should resume compression after it has made more room in the + * output buffer. Note that there are substantial restrictions on the use of + * suspension --- see the documentation. + * + * When suspending, the compressor will back up to a convenient restart point + * (typically the start of the current MCU). next_output_byte & free_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point will be regenerated after resumption, so do not + * write it out when emptying the buffer externally. + */ + +METHODDEF(boolean) +empty_output_buffer (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) != + (size_t) OUTPUT_BUF_SIZE) + ERREXIT(cinfo, JERR_FILE_WRITE); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; + + return TRUE; +} + + +/* + * Terminate destination --- called by jpeg_finish_compress + * after all data has been written. Usually needs to flush buffer. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; + + /* Write any data remaining in the buffer */ + if (datacount > 0) { + if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount) + ERREXIT(cinfo, JERR_FILE_WRITE); + } + fflush(dest->outfile); + /* Make sure we wrote the output file OK */ + if (ferror(dest->outfile)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * Prepare for output to a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing compression. + */ + +GLOBAL(void) +jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) +{ + my_dest_ptr dest; + + /* The destination object is made permanent so that multiple JPEG images + * can be written to the same file without re-executing jpeg_stdio_dest. + * This makes it dangerous to use this manager and a different destination + * manager serially with the same JPEG object, because their private object + * sizes may be different. Caveat programmer. + */ + if (cinfo->dest == NULL) { /* first time for this JPEG object? */ + cinfo->dest = (struct jpeg_destination_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_destination_mgr)); + } + + dest = (my_dest_ptr) cinfo->dest; + dest->pub.init_destination = init_destination; + dest->pub.empty_output_buffer = empty_output_buffer; + dest->pub.term_destination = term_destination; + dest->outfile = outfile; +} diff --git a/dcmjpeg/libijg8/jdatasrc.c b/dcmjpeg/libijg8/jdatasrc.c new file mode 100644 index 00000000..7296ff8f --- /dev/null +++ b/dcmjpeg/libijg8/jdatasrc.c @@ -0,0 +1,212 @@ +/* + * jdatasrc.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains decompression data source routines for the case of + * reading JPEG data from a file (or any stdio stream). While these routines + * are sufficient for most applications, some will want to use a different + * source manager. + * IMPORTANT: we assume that fread() will correctly transcribe an array of + * JOCTETs from 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jerror8.h" + + +/* Expanded data source object for stdio input */ + +typedef struct { + struct jpeg_source_mgr pub; /* public fields */ + + FILE * infile; /* source stream */ + JOCTET * buffer; /* start of buffer */ + boolean start_of_file; /* have we gotten any data yet? */ +} my_source_mgr; + +typedef my_source_mgr * my_src_ptr; + +#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ + + +/* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ + +METHODDEF(void) +init_source (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_file = TRUE; +} + + +/* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. + */ + +METHODDEF(boolean) +fill_input_buffer (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + size_t nbytes; + + nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE); + + if (nbytes <= 0) { + if (src->start_of_file) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_file = FALSE; + + return TRUE; +} + + +/* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ + +METHODDEF(void) +skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) { + while (num_bytes > (long) src->pub.bytes_in_buffer) { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } +} + + +/* + * An additional method that can be provided by data source modules is the + * resync_to_restart method for error recovery in the presence of RST markers. + * For the moment, this source module just uses the default resync method + * provided by the JPEG library. That method assumes that no backtracking + * is possible. + */ + + +/* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Prepare for input from a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + +GLOBAL(void) +jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) +{ + my_src_ptr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling jpeg_stdio_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_source_mgr)); + src = (my_src_ptr) cinfo->src; + src->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + INPUT_BUF_SIZE * SIZEOF(JOCTET)); + } + + src = (my_src_ptr) cinfo->src; + src->pub.init_source = init_source; + src->pub.fill_input_buffer = fill_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = term_source; + src->infile = infile; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} diff --git a/dcmjpeg/libijg8/jdcoefct.c b/dcmjpeg/libijg8/jdcoefct.c new file mode 100644 index 00000000..d950446d --- /dev/null +++ b/dcmjpeg/libijg8/jdcoefct.c @@ -0,0 +1,743 @@ +/* + * jdcoefct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for decompression. + * This controller is the top level of the lossy JPEG decompressor proper. + * The coefficient buffer lies between entropy decoding and inverse-DCT steps. + * + * In buffered-image mode, this controller is the interface between + * input-oriented processing and output-oriented processing. + * Also, the input side (only) is used when reading a file for transcoding. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" + +/* Block smoothing is only applicable for progressive JPEG, so: */ +#ifndef D_PROGRESSIVE_SUPPORTED +#undef BLOCK_SMOOTHING_SUPPORTED +#endif + +/* Private buffer controller object */ + +typedef struct { + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + /* In single-pass modes, it's sufficient to buffer just one MCU. + * We allocate a workspace of D_MAX_DATA_UNITS_IN_MCU coefficient blocks, + * and let the entropy decoder write into that workspace each time. + * (On 80x86, the workspace is FAR even though it's not really very big; + * this is to keep the module interfaces unchanged when a large coefficient + * buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays; it is used only by the input side. + */ + JBLOCKROW MCU_buffer[D_MAX_DATA_UNITS_IN_MCU]; + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +#endif + +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* When doing block smoothing, we latch coefficient Al values here */ + int * coef_bits_latch; +#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ +#endif +} d_coef_controller; + +typedef d_coef_controller * d_coef_ptr; + +/* Forward declarations */ +METHODDEF(int) decompress_onepass + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#ifdef D_MULTISCAN_FILES_SUPPORTED +METHODDEF(int) decompress_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif +#ifdef BLOCK_SMOOTHING_SUPPORTED +LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo)); +METHODDEF(int) decompress_smooth_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->MCU_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + cinfo->input_iMCU_row = 0; + start_iMCU_row(cinfo); +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ +#ifdef BLOCK_SMOOTHING_SUPPORTED + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + /* d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; */ + + /* If multipass, check to see whether to use block smoothing on this pass */ + if (lossyd->coef_arrays != NULL) { + if (cinfo->do_block_smoothing && smoothing_ok(cinfo)) + lossyd->pub.decompress_data = decompress_smooth_data; + else + lossyd->pub.decompress_data = decompress_data; + } +#endif + cinfo->output_iMCU_row = 0; +} + + +/* + * Decompress and return some data in the single-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Input and output must run in lockstep since we have only a one-MCU buffer. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(int) +decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, useful_width; + JSAMPARRAY output_ptr; + JDIMENSION start_col, output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Loop to process as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */ + jzero_far((void FAR *) coef->MCU_buffer[0], + (size_t)cinfo->data_units_in_MCU * SIZEOF(JBLOCK)); + if (! (*lossyd->entropy_decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + /* Determine where data should go in output_buf and do the IDCT thing. + * We skip dummy blocks at the right and bottom edges (but blkn gets + * incremented past them!). Note the inner loop relies on having + * allocated the MCU_buffer[] blocks sequentially. + */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) { + blkn += compptr->MCU_data_units; + continue; + } + inverse_DCT = lossyd->inverse_DCT[compptr->component_index]; + useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + output_ptr = output_buf[compptr->component_index] + + yoffset * compptr->codec_data_unit; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_sample_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (cinfo->input_iMCU_row < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + output_col = start_col; + for (xindex = 0; xindex < useful_width; xindex++) { + (*inverse_DCT) (cinfo, compptr, + (JCOEFPTR) coef->MCU_buffer[blkn+xindex], + output_ptr, output_col); + output_col += (JDIMENSION)compptr->codec_data_unit; + } + } + blkn += compptr->MCU_width; + output_ptr += compptr->codec_data_unit; + } + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + cinfo->output_iMCU_row++; + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Dummy consume-input routine for single-pass operation. + */ + +METHODDEF(int) +dummy_consume_data (j_decompress_ptr cinfo) +{ + return JPEG_SUSPENDED; /* Always indicate nothing was done */ +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Consume input data and store it in the full-image coefficient buffer. + * We read as much as one fully interleaved MCU row ("iMCU" row) per call, + * ie, v_samp_factor block rows for each component in the scan. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + */ + +METHODDEF(int) +consume_data (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + cinfo->input_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + /* Note: entropy decoder expects buffer to be zeroed, + * but this is handled automatically by the memory manager + * because we requested a pre-zeroed array. + */ + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * (JDIMENSION)compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to fetch the MCU. */ + if (! (*lossyd->entropy_decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Decompress and return some data in the multi-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image. + */ + +METHODDEF(int) +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num; + int ci, block_row, block_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number < cinfo->output_scan_number || + (cinfo->input_scan_number == cinfo->output_scan_number && + cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + cinfo->output_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + inverse_DCT = lossyd->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + output_col = 0; + for (block_num = 0; block_num < compptr->width_in_data_units; block_num++) { + (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr, + output_ptr, output_col); + buffer_ptr++; + output_col += (JDIMENSION)compptr->codec_data_unit; + } + output_ptr += compptr->codec_data_unit; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +#ifdef BLOCK_SMOOTHING_SUPPORTED + +/* + * This code applies interblock smoothing as described by section K.8 + * of the JPEG standard: the first 5 AC coefficients are estimated from + * the DC values of a DCT block and its 8 neighboring blocks. + * We apply smoothing only for progressive JPEG decoding, and only if + * the coefficients it can estimate are not yet known to full precision. + */ + +/* Natural-order array positions of the first 5 zigzag-order coefficients */ +#define Q01_POS 1 +#define Q10_POS 8 +#define Q20_POS 16 +#define Q11_POS 9 +#define Q02_POS 2 + +/* + * Determine whether block smoothing is applicable and safe. + * We also latch the current states of the coef_bits[] entries for the + * AC coefficients; otherwise, if the input side of the decompressor + * advances into a new scan, we might think the coefficients are known + * more accurately than they really are. + */ + +LOCAL(boolean) +smoothing_ok (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + boolean smoothing_useful = FALSE; + int ci, coefi; + jpeg_component_info *compptr; + JQUANT_TBL * qtable; + int * coef_bits; + int * coef_bits_latch; + + if ((! (cinfo->process == JPROC_PROGRESSIVE)) || cinfo->coef_bits == NULL) + return FALSE; + + /* Allocate latch area if not already done */ + if (coef->coef_bits_latch == NULL) + coef->coef_bits_latch = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * + (SAVED_COEFS * SIZEOF(int))); + coef_bits_latch = coef->coef_bits_latch; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* All components' quantization values must already be latched. */ + if ((qtable = compptr->quant_table) == NULL) + return FALSE; + /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */ + if (qtable->quantval[0] == 0 || + qtable->quantval[Q01_POS] == 0 || + qtable->quantval[Q10_POS] == 0 || + qtable->quantval[Q20_POS] == 0 || + qtable->quantval[Q11_POS] == 0 || + qtable->quantval[Q02_POS] == 0) + return FALSE; + /* DC values must be at least partly known for all components. */ + coef_bits = cinfo->coef_bits[ci]; + if (coef_bits[0] < 0) + return FALSE; + /* Block smoothing is helpful if some AC coefficients remain inaccurate. */ + for (coefi = 1; coefi <= 5; coefi++) { + coef_bits_latch[coefi] = coef_bits[coefi]; + if (coef_bits[coefi] != 0) + smoothing_useful = TRUE; + } + coef_bits_latch += SAVED_COEFS; + } + + return smoothing_useful; +} + + +/* + * Variant of decompress_data for use when doing block smoothing. + */ + +METHODDEF(int) +decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef = (d_coef_ptr) lossyd->coef_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num, last_block_column; + int ci, block_row, block_rows, access_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr, prev_block_row, next_block_row; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + boolean first_row, last_row; + JBLOCK workspace; + int *coef_bits; + JQUANT_TBL *quanttbl; + IJG_INT32 Q00,Q01,Q02,Q10,Q11,Q20, num; + int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9; + int Al, pred; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if (cinfo->input_scan_number == cinfo->output_scan_number) { + /* If input is working on current scan, we ordinarily want it to + * have completed the current row. But if input scan is DC, + * we want it to keep one row ahead so that next block row's DC + * values are up to date. + */ + JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0; + if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta) + break; + } + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) { + block_rows = compptr->v_samp_factor; + access_rows = block_rows * 2; /* this and next iMCU row */ + last_row = FALSE; + } else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (block_rows == 0) block_rows = compptr->v_samp_factor; + access_rows = block_rows; /* this iMCU row only */ + last_row = TRUE; + } + /* Align the virtual buffer for this component. */ + if (cinfo->output_iMCU_row > 0) { + access_rows += compptr->v_samp_factor; /* prior iMCU row too */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (cinfo->output_iMCU_row - 1) * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) access_rows, FALSE); + buffer += compptr->v_samp_factor; /* point to current iMCU row */ + first_row = FALSE; + } else { + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE); + first_row = TRUE; + } + /* Fetch component-dependent info */ + coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS); + quanttbl = compptr->quant_table; + Q00 = quanttbl->quantval[0]; + Q01 = quanttbl->quantval[Q01_POS]; + Q10 = quanttbl->quantval[Q10_POS]; + Q20 = quanttbl->quantval[Q20_POS]; + Q11 = quanttbl->quantval[Q11_POS]; + Q02 = quanttbl->quantval[Q02_POS]; + inverse_DCT = lossyd->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + if (first_row && block_row == 0) + prev_block_row = buffer_ptr; + else + prev_block_row = buffer[block_row-1]; + if (last_row && block_row == block_rows-1) + next_block_row = buffer_ptr; + else + next_block_row = buffer[block_row+1]; + /* We fetch the surrounding DC values using a sliding-register approach. + * Initialize all nine here so as to do the right thing on narrow pics. + */ + DC1 = DC2 = DC3 = (int) prev_block_row[0][0]; + DC4 = DC5 = DC6 = (int) buffer_ptr[0][0]; + DC7 = DC8 = DC9 = (int) next_block_row[0][0]; + output_col = 0; + last_block_column = compptr->width_in_data_units - 1; + for (block_num = 0; block_num <= last_block_column; block_num++) { + /* Fetch current DCT block into workspace so we can modify it. */ + jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1); + /* Update DC values */ + if (block_num < last_block_column) { + DC3 = (int) prev_block_row[1][0]; + DC6 = (int) buffer_ptr[1][0]; + DC9 = (int) next_block_row[1][0]; + } + /* Compute coefficient estimates per K.8. + * An estimate is applied only if coefficient is still zero, + * and is not known to be fully accurate. + */ + /* AC01 */ + if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { + num = 36 * Q00 * (DC4 - DC6); + if (num >= 0) { + pred = (int) (((Q01<<7) + num) / (Q01<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q10<<7) + num) / (Q10<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q20<<7) + num) / (Q20<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q11<<7) + num) / (Q11<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q02<<7) + num) / (Q02<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<codec_data_unit; + } + output_ptr += compptr->codec_data_unit; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* BLOCK_SMOOTHING_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + d_coef_ptr coef; + + coef = (d_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_coef_controller)); + lossyd->coef_private = (void *) coef; + lossyd->coef_start_input_pass = start_input_pass; + lossyd->coef_start_output_pass = start_output_pass; +#ifdef BLOCK_SMOOTHING_SUPPORTED + coef->coef_bits_latch = NULL; +#endif + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + /* Note we ask for a pre-zeroed array. */ + int ci, access_rows; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + access_rows = compptr->v_samp_factor; +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* If block smoothing could be used, need a bigger window */ + if (cinfo->process == JPROC_PROGRESSIVE) + access_rows *= 3; +#endif + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) access_rows); + } + lossyd->pub.consume_data = consume_data; + lossyd->pub.decompress_data = decompress_data; + lossyd->coef_arrays = coef->whole_image; /* link to virtual arrays */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + D_MAX_DATA_UNITS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < D_MAX_DATA_UNITS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + lossyd->pub.consume_data = dummy_consume_data; + lossyd->pub.decompress_data = decompress_onepass; + lossyd->coef_arrays = NULL; /* flag for no virtual arrays */ + } +} diff --git a/dcmjpeg/libijg8/jdcolor.c b/dcmjpeg/libijg8/jdcolor.c new file mode 100644 index 00000000..91a679ce --- /dev/null +++ b/dcmjpeg/libijg8/jdcolor.c @@ -0,0 +1,413 @@ +/* + * jdcolor.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains output colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_deconverter pub; /* public fields */ + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + IJG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + IJG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ +} my_color_deconverter; + +typedef my_color_deconverter * my_cconvert_ptr; + + +/**************** YCbCr -> RGB conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb + * where Cb and Cr represent the incoming values less CENTERJSAMPLE. + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * Notice that Y, being an integral input, does not contribute any fraction + * so it need not participate in the rounding. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times Cb and Cr for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The Cr=>R and Cb=>B values can be rounded to integers in advance; the + * values for the G calculation are left scaled up, since we must add them + * together before rounding. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L<RGB colorspace conversion. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + int i; + IJG_INT32 x; +#if BITS_IN_JSAMPLE == 16 + /* no need for temporaries */ +#else + SHIFT_TEMPS +#endif + + cconvert->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cr_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + cconvert->Cb_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + +#if BITS_IN_JSAMPLE == 16 + /* Bug fix 2001-11-06 by Eichelberg: The integer routines below + produce an overflow when used with MAXJSAMPLE == 65535. + Use floating point calculation instead. */ + + /* Cr=>R value is nearest int to 1.40200 * x */ + cconvert->Cr_r_tab[i] = (int)(1.40200 * (double)x + 0.5); + /* Cb=>B value is nearest int to 1.77200 * x */ + cconvert->Cb_b_tab[i] = (int)(1.77200 * (double)x + 0.5); +#else + /* Cr=>R value is nearest int to 1.40200 * x */ + cconvert->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + cconvert->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); +#endif + + /* Cr=>G value is scaled-up -0.71414 * x */ + cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Convert some rows of samples to the output colorspace. + * + * Note that we change from noninterleaved, one-plane-per-component format + * to interleaved-pixel format. The output buffer is therefore three times + * as wide as the input buffer. + * A starting row offset is provided only for the input buffer. The caller + * can easily adjust the passed output_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +ycc_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register IJG_INT32 * Crgtab = cconvert->Cr_g_tab; + register IJG_INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; + outptr[RGB_GREEN] = range_limit[y + + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS))]; + outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/**************** Cases other than YCbCr -> RGB **************/ + + +/* + * Color conversion for no colorspace change: just copy the data, + * converting from separate-planes to interleaved representation. + */ + +METHODDEF(void) +null_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW inptr, outptr; + register JDIMENSION count; + register int num_components = cinfo->num_components; + JDIMENSION num_cols = cinfo->output_width; + int ci; + + while (--num_rows >= 0) { + for (ci = 0; ci < num_components; ci++) { + inptr = input_buf[ci][input_row]; + outptr = output_buf[0] + ci; + for (count = num_cols; count > 0; count--) { + *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ + outptr += num_components; + } + } + input_row++; + output_buf++; + } +} + + +/* + * Color conversion for grayscale: just copy the data. + * This also works for YCbCr -> grayscale conversion, in which + * we just copy the Y (luminance) component and ignore chrominance. + */ + +METHODDEF(void) +grayscale_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0, + num_rows, cinfo->output_width); +} + + +/* + * Convert grayscale to RGB: just duplicate the graylevel three times. + * This is provided to support applications that don't want to cope + * with grayscale as a separate case. + */ + +METHODDEF(void) +gray_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW inptr, outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr = input_buf[0][input_row++]; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + /* We can dispense with GETJSAMPLE() here */ + outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Adobe-style YCCK->CMYK conversion. + * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same + * conversion as above, while passing K (black) unchanged. + * We assume build_ycc_rgb_table has been called. + */ + +METHODDEF(void) +ycck_cmyk_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2, inptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register IJG_INT32 * Crgtab = cconvert->Cr_g_tab; + register IJG_INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + inptr3 = input_buf[3][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */ + outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */ + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS)))]; + outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */ + /* K passes through unchanged */ + outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */ + outptr += 4; + } + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +start_pass_dcolor (j_decompress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for output colorspace conversion. + */ + +GLOBAL(void) +jinit_color_deconverter (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + int ci; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_deconverter)); + cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert; + cconvert->pub.start_pass = start_pass_dcolor; + + /* Make sure num_components agrees with jpeg_color_space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_RGB: + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->num_components < 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + } + + /* Set out_color_components and conversion method based on requested space. + * Also clear the component_needed flags for any unused components, + * so that earlier pipeline stages can avoid useless computation. + */ + + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + if (cinfo->jpeg_color_space == JCS_GRAYSCALE || + cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = grayscale_convert; + /* For color->grayscale conversion, only the Y (0) component is needed */ + for (ci = 1; ci < cinfo->num_components; ci++) + cinfo->comp_info[ci].component_needed = FALSE; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + cinfo->out_color_components = RGB_PIXELSIZE; + if (cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = ycc_rgb_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) { + cconvert->pub.color_convert = gray_rgb_convert; + } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) { + cconvert->pub.color_convert = null_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + cinfo->out_color_components = 4; + if (cinfo->jpeg_color_space == JCS_YCCK) { + cconvert->pub.color_convert = ycck_cmyk_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_CMYK) { + cconvert->pub.color_convert = null_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: + /* Permit null conversion to same output space */ + if (cinfo->out_color_space == cinfo->jpeg_color_space) { + cinfo->out_color_components = cinfo->num_components; + cconvert->pub.color_convert = null_convert; + } else /* unsupported non-null conversion */ + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + + if (cinfo->quantize_colors) + cinfo->output_components = 1; /* single colormapped output component */ + else + cinfo->output_components = cinfo->out_color_components; +} diff --git a/dcmjpeg/libijg8/jdct8.h b/dcmjpeg/libijg8/jdct8.h new file mode 100644 index 00000000..c509bfb9 --- /dev/null +++ b/dcmjpeg/libijg8/jdct8.h @@ -0,0 +1,176 @@ +/* + * jdct.h + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the forward and + * inverse DCT modules. These declarations are private to the DCT managers + * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. + * The individual DCT algorithms are kept in separate files to ease + * machine-dependent tuning (e.g., assembly coding). + */ + + +/* + * A forward DCT routine is given a pointer to a work area of type DCTELEM[]; + * the DCT is to be performed in-place in that buffer. Type DCTELEM is int + * for 8-bit samples, IJG_INT32 for 12-bit samples. (NOTE: Floating-point DCT + * implementations use an array of type FAST_FLOAT, instead.) + * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE). + * The DCT outputs are returned scaled up by a factor of 8; they therefore + * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This + * convention improves accuracy in integer implementations and saves some + * work in floating-point ones. + * Quantization of the output coefficients is done by jcdctmgr.c. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef int DCTELEM; /* 16 or 32 bits is fine */ +#else +typedef IJG_INT32 DCTELEM; /* must have 32 bits */ +#endif + +typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data)); +typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data)); + + +/* + * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer + * to an output sample array. The routine must dequantize the input data as + * well as perform the IDCT; for dequantization, it uses the multiplier table + * pointed to by compptr->dct_table. The output data is to be placed into the + * sample array starting at a specified column. (Any row offset needed will + * be applied to the array pointer before it is passed to the IDCT code.) + * Note that the number of samples emitted by the IDCT routine is + * DCT_scaled_size * DCT_scaled_size. + */ + +/* typedef inverse_DCT_method_ptr is declared in jpegint.h */ + +/* + * Each IDCT routine has its own ideas about the best dct_table element type. + */ + +typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ +#if BITS_IN_JSAMPLE == 8 +typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ +#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ +#else +typedef IJG_INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ +#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ +#endif +typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ + + +/* + * Each IDCT routine is responsible for range-limiting its results and + * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could + * be quite far out of range if the input data is corrupt, so a bulletproof + * range-limiting step is required. We use a mask-and-table-lookup method + * to do the combined operations quickly. See the comments with + * prepare_range_limit_table (in jdmaster.c) for more info. + */ + +#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) + +#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_fdct_islow jpeg8_fdct_islow +#define jpeg_fdct_ifast jpeg8_fdct_ifast +#define jpeg_fdct_float jpeg8_fdct_float +#define jpeg_idct_islow jpeg8_idct_islow +#define jpeg_idct_ifast jpeg8_idct_ifast +#define jpeg_idct_float jpeg8_idct_float +#define jpeg_idct_4x4 jpeg8_idct_4x4 +#define jpeg_idct_2x2 jpeg8_idct_2x2 +#define jpeg_idct_1x1 jpeg8_idct_1x1 +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Extern declarations for the forward and inverse DCT routines. */ + +EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data)); +EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data)); +EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data)); + +EXTERN(void) jpeg_idct_islow + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_ifast + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_float + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_4x4 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_2x2 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_1x1 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + const JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); + + +/* + * Macros for handling fixed-point arithmetic; these are used by many + * but not all of the DCT/IDCT modules. + * + * All values are expected to be of type IJG_INT32. + * Fractional constants are scaled left by CONST_BITS bits. + * CONST_BITS is defined within each module using these macros, + * and may differ from one module to the next. + */ + +#define ONE ((IJG_INT32) 1) +#define CONST_SCALE (ONE << CONST_BITS) + +/* Convert a positive real constant to an integer scaled by CONST_SCALE. + * Caution: some C compilers fail to reduce "FIX(constant)" at compile time, + * thus causing a lot of useless floating-point operations at run time. + */ + +#define FIX(x) ((IJG_INT32) ((x) * CONST_SCALE + 0.5)) + +/* Descale and correctly round an IJG_INT32 value that's scaled by N bits. + * We assume RIGHT_SHIFT rounds towards minus infinity, so adding + * the fudge factor is correct for either sign of X. + */ + +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * This macro is used only when the two inputs will actually be no more than + * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a + * full 32x32 multiply. This provides a useful speedup on many machines. + * Unfortunately there is no way to specify a 16x16->32 multiply portably + * in C, but some C compilers will do the right thing if you provide the + * correct combination of casts. + */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) +#endif +#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((IJG_INT32) (const))) +#endif + +#ifndef MULTIPLY16C16 /* default definition */ +#define MULTIPLY16C16(var,const) ((var) * (const)) +#endif + +/* Same except both inputs are variables. */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2))) +#endif + +#ifndef MULTIPLY16V16 /* default definition */ +#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) +#endif diff --git a/dcmjpeg/libijg8/jddctmgr.c b/dcmjpeg/libijg8/jddctmgr.c new file mode 100644 index 00000000..ac053ffa --- /dev/null +++ b/dcmjpeg/libijg8/jddctmgr.c @@ -0,0 +1,270 @@ +/* + * jddctmgr.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the inverse-DCT management logic. + * This code selects a particular IDCT implementation to be used, + * and it performs related housekeeping chores. No code in this file + * is executed per IDCT step, only during output pass setup. + * + * Note that the IDCT routines are responsible for performing coefficient + * dequantization as well as the IDCT proper. This module sets up the + * dequantization multiplier table needed by the IDCT routine. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy subsystem */ +#include "jdct8.h" /* Private declarations for DCT subsystem */ + + +/* + * The decompressor input side (jdinput.c) saves away the appropriate + * quantization table for each component at the start of the first scan + * involving that component. (This is necessary in order to correctly + * decode files that reuse Q-table slots.) + * When we are ready to make an output pass, the saved Q-table is converted + * to a multiplier table that will actually be used by the IDCT routine. + * The multiplier table contents are IDCT-method-dependent. To support + * application changes in IDCT method between scans, we can remake the + * multiplier tables if necessary. + * In buffered-image mode, the first output pass may occur before any data + * has been seen for some components, and thus before their Q-tables have + * been saved away. To handle this case, multiplier tables are preset + * to zeroes; the result of the IDCT will be a neutral gray level. + */ + + +/* Private subobject for this module */ + +typedef struct { + /* This array contains the IDCT method code that each multiplier table + * is currently set up for, or -1 if it's not yet set up. + * The actual multiplier tables are pointed to by dct_table in the + * per-component comp_info structures. + */ + int cur_method[MAX_COMPONENTS]; +} idct_controller; + +typedef idct_controller * idct_ptr; + + +/* Allocated multiplier tables: big enough for any supported variant */ + +typedef union { + ISLOW_MULT_TYPE islow_array[DCTSIZE2]; +#ifdef DCT_IFAST_SUPPORTED + IFAST_MULT_TYPE ifast_array[DCTSIZE2]; +#endif +#ifdef DCT_FLOAT_SUPPORTED + FLOAT_MULT_TYPE float_array[DCTSIZE2]; +#endif +} multiplier_table; + + +/* The current scaled-IDCT routines require ISLOW-style multiplier tables, + * so be sure to compile that code if either ISLOW or SCALING is requested. + */ +#ifdef DCT_ISLOW_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#else +#ifdef IDCT_SCALING_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#endif +#endif + + +/* + * Prepare for an output pass. + * Here we select the proper IDCT routine for each component and build + * a matching multiplier table. + */ + +METHODDEF(void) +start_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + idct_ptr idct = (idct_ptr) lossyd->idct_private; + int ci, i; + jpeg_component_info *compptr; + int method = 0; + inverse_DCT_method_ptr method_ptr = NULL; + JQUANT_TBL * qtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Select the proper IDCT routine for this component's scaling */ + switch (compptr->codec_data_unit) { +#ifdef IDCT_SCALING_SUPPORTED + case 1: + method_ptr = jpeg_idct_1x1; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; + case 2: + method_ptr = jpeg_idct_2x2; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; + case 4: + method_ptr = jpeg_idct_4x4; + method = JDCT_ISLOW; /* jidctred uses islow-style table */ + break; +#endif + case DCTSIZE: + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + method_ptr = jpeg_idct_islow; + method = JDCT_ISLOW; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + method_ptr = jpeg_idct_ifast; + method = JDCT_IFAST; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + method_ptr = jpeg_idct_float; + method = JDCT_FLOAT; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + break; + default: + ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->codec_data_unit); + break; + } + lossyd->inverse_DCT[ci] = method_ptr; + /* Create multiplier table from quant table. + * However, we can skip this if the component is uninteresting + * or if we already built the table. Also, if no quant table + * has yet been saved for the component, we leave the + * multiplier table all-zero; we'll be reading zeroes from the + * coefficient controller's buffer anyway. + */ + if (! compptr->component_needed || idct->cur_method[ci] == method) + continue; + qtbl = compptr->quant_table; + if (qtbl == NULL) /* happens if no data yet for component */ + continue; + idct->cur_method[ci] = method; + switch (method) { +#ifdef PROVIDE_ISLOW_TABLES + case JDCT_ISLOW: + { + /* For LL&M IDCT method, multipliers are equal to raw quantization + * coefficients, but are stored as ints to ensure access efficiency. + */ + ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; + for (i = 0; i < DCTSIZE2; i++) { + ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; + } + } + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * For integer operation, the multiplier table is to be scaled by + * IFAST_SCALE_BITS. + */ + IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + for (i = 0; i < DCTSIZE2; i++) { + ifmtbl[i] = (IFAST_MULT_TYPE) + DESCALE(MULTIPLY16V16((IJG_INT32) qtbl->quantval[i], + (IJG_INT32) aanscales[i]), + CONST_BITS-IFAST_SCALE_BITS); + } + } + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + */ + FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fmtbl[i] = (FLOAT_MULT_TYPE) + ((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col]); + i++; + } + } + } + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Initialize IDCT manager. + */ + +GLOBAL(void) +jinit_inverse_dct (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + idct_ptr idct; + int ci; + jpeg_component_info *compptr; + + idct = (idct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(idct_controller)); + lossyd->idct_private = (void *) idct; + lossyd->idct_start_pass = start_pass; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate and pre-zero a multiplier table for each component */ + compptr->dct_table = + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(multiplier_table)); + MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); + /* Mark multiplier table not yet set up for any method */ + idct->cur_method[ci] = -1; + } +} diff --git a/dcmjpeg/libijg8/jddiffct.c b/dcmjpeg/libijg8/jddiffct.c new file mode 100644 index 00000000..3988c82d --- /dev/null +++ b/dcmjpeg/libijg8/jddiffct.c @@ -0,0 +1,399 @@ +/* + * jddiffct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the [un]difference buffer controller for decompression. + * This controller is the top level of the lossless JPEG decompressor proper. + * The difference buffer lies between the entropy decoding and + * prediction/undifferencing steps. The undifference buffer lies between the + * prediction/undifferencing and scaling steps. + * + * In buffered-image mode, this controller is the interface between + * input-oriented processing and output-oriented processing. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" + + +#ifdef D_LOSSLESS_SUPPORTED + +/* Private buffer controller object */ + +typedef struct { + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + unsigned int restart_rows_to_go; /* MCU-rows left in this restart interval */ + unsigned int MCU_vert_offset; /* counts MCU rows within iMCU row */ + unsigned int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + JDIFFARRAY diff_buf[MAX_COMPONENTS]; /* iMCU row of differences */ + JDIFFARRAY undiff_buf[MAX_COMPONENTS]; /* iMCU row of undiff'd samples */ + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual sample array for each component. */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +#endif +} d_diff_controller; + +typedef d_diff_controller * d_diff_ptr; + +/* Forward declarations */ +METHODDEF(int) decompress_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#ifdef D_MULTISCAN_FILES_SUPPORTED +METHODDEF(int) output_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + diff->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + diff->MCU_rows_per_iMCU_row = (JDIMENSION)cinfo->cur_comp_info[0]->v_samp_factor; + else + diff->MCU_rows_per_iMCU_row = (JDIMENSION)cinfo->cur_comp_info[0]->last_row_height; + } + + diff->MCU_ctr = 0; + diff->MCU_vert_offset = 0; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + /* Check that the restart interval is an integer multiple of the number + * of MCU in an MCU-row. + */ + if (cinfo->restart_interval % cinfo->MCUs_per_row != 0) + ERREXIT2(cinfo, JERR_BAD_RESTART, + (int)cinfo->restart_interval, (int)cinfo->MCUs_per_row); + + /* Initialize restart counter */ + diff->restart_rows_to_go = cinfo->restart_interval / cinfo->MCUs_per_row; + + cinfo->input_iMCU_row = 0; + start_iMCU_row(cinfo); +} + + +/* + * Check for a restart marker & resynchronize decoder, undifferencer. + * Returns FALSE if must suspend. + */ + +METHODDEF(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + + if (! (*losslsd->entropy_process_restart) (cinfo)) + return FALSE; + + (*losslsd->predict_process_restart) (cinfo); + + /* Reset restart counter */ + diff->restart_rows_to_go = cinfo->restart_interval / cinfo->MCUs_per_row; + + return TRUE; +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ + cinfo->output_iMCU_row = 0; +} + + +/* + * Decompress and return some data in the supplied buffer. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Input and output must run in lockstep since we have only a one-MCU buffer. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(int) +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_count; /* number of MCUs decoded */ + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int comp, ci, row, prev_row; + unsigned int yoffset; + jpeg_component_info *compptr; + + /* Loop to process as much as one whole iMCU row */ + for (yoffset = diff->MCU_vert_offset; yoffset < diff->MCU_rows_per_iMCU_row; + yoffset++) { + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (diff->restart_rows_to_go == 0) + if (! process_restart(cinfo)) + return JPEG_SUSPENDED; + } + + MCU_col_num = diff->MCU_ctr; + /* Try to fetch an MCU-row (or remaining portion of suspended MCU-row). */ + MCU_count = + (*losslsd->entropy_decode_mcus) (cinfo, + diff->diff_buf, yoffset, MCU_col_num, + cinfo->MCUs_per_row - MCU_col_num); + if (MCU_count != cinfo->MCUs_per_row - MCU_col_num) { + /* Suspension forced; update state counters and exit */ + diff->MCU_vert_offset = yoffset; + diff->MCU_ctr += MCU_count; + return JPEG_SUSPENDED; + } + + /* Account for restart interval (no-op if not using restarts) */ + diff->restart_rows_to_go--; + + /* Completed an MCU row, but perhaps not an iMCU row */ + diff->MCU_ctr = 0; + } + + /* + * Undifference and scale each scanline of the disassembled MCU-row + * separately. We do not process dummy samples at the end of a scanline + * or dummy rows at the end of the image. + */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + for (row = 0, prev_row = compptr->v_samp_factor - 1; + row < (cinfo->input_iMCU_row == last_iMCU_row ? + compptr->last_row_height : compptr->v_samp_factor); + prev_row = row, row++) { + (*losslsd->predict_undifference[ci]) (cinfo, ci, + diff->diff_buf[ci][row], + diff->undiff_buf[ci][prev_row], + diff->undiff_buf[ci][row], + compptr->width_in_data_units); + (*losslsd->scaler_scale) (cinfo, diff->undiff_buf[ci][row], + output_buf[ci][row], + compptr->width_in_data_units); + } + } + + /* Completed the iMCU row, advance counters for next one. + * + * NB: output_data will increment output_iMCU_row. + * This counter is not needed for the single-pass case + * or the input side of the multi-pass case. + */ + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Dummy consume-input routine for single-pass operation. + */ + +METHODDEF(int) +dummy_consume_data (j_decompress_ptr cinfo) +{ + return JPEG_SUSPENDED; /* Always indicate nothing was done */ +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Consume input data and store it in the full-image sample buffer. + * We read as much as one fully interleaved MCU row ("iMCU" row) per call, + * ie, v_samp_factor rows for each component in the scan. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + */ + +METHODDEF(int) +consume_data (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */ + /* JDIMENSION MCU_count; */ /* number of MCUs decoded */ + /* JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; */ + int comp, ci /* , yoffset, row, prev_row */; + JSAMPARRAY buffer[MAX_COMPS_IN_SCAN]; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (comp = 0; comp < cinfo->comps_in_scan; comp++) { + compptr = cinfo->cur_comp_info[comp]; + ci = compptr->component_index; + buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + cinfo->input_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + } + + return decompress_data(cinfo, buffer); +} + + +/* + * Output some data from the full-image buffer sample in the multi-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image. + */ + +METHODDEF(int) +output_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff = (d_diff_ptr) losslsd->diff_private; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int ci, samp_rows, row; + JSAMPARRAY buffer; + jpeg_component_info *compptr; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number < cinfo->output_scan_number || + (cinfo->input_scan_number == cinfo->output_scan_number && + cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, diff->whole_image[ci], + cinfo->output_iMCU_row * (JDIMENSION)compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + + if (cinfo->output_iMCU_row < last_iMCU_row) + samp_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + samp_rows = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (samp_rows == 0) samp_rows = compptr->v_samp_factor; + } + + for (row = 0; row < samp_rows; row++) { + MEMCOPY(output_buf[ci][row], buffer[row], + compptr->width_in_data_units * SIZEOF(JSAMPLE)); + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +/* + * Initialize difference buffer controller. + */ + +GLOBAL(void) +jinit_d_diff_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + d_diff_ptr diff; + int ci; + jpeg_component_info *compptr; + + diff = (d_diff_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_diff_controller)); + losslsd->diff_private = (void *) diff; + losslsd->diff_start_input_pass = start_input_pass; + losslsd->pub.start_output_pass = start_output_pass; + + /* Create the [un]difference buffers. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + diff->diff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + diff->undiff_buf[ci] = (*cinfo->mem->alloc_darray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } + + if (need_full_buffer) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* Allocate a full-image virtual array for each component. */ + int access_rows; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + access_rows = compptr->v_samp_factor; + diff->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_data_units, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor), + (JDIMENSION) access_rows); + } + losslsd->pub.consume_data = consume_data; + losslsd->pub.decompress_data = output_data; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + losslsd->pub.consume_data = dummy_consume_data; + losslsd->pub.decompress_data = decompress_data; + diff->whole_image[0] = NULL; /* flag for no virtual arrays */ + } +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jdhuff.c b/dcmjpeg/libijg8/jdhuff.c new file mode 100644 index 00000000..dc21e48f --- /dev/null +++ b/dcmjpeg/libijg8/jdhuff.c @@ -0,0 +1,316 @@ +/* + * jdhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines which are shared + * by the sequential, progressive and lossless decoders. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ +#include "jlossls8.h" /* Private declarations for lossless codec */ +#include "jdhuff8.h" /* Declarations shared with jd*huff.c */ + + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +GLOBAL(void) +jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, + d_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + d_derived_tbl *dtbl; + int p, i, l, si, numsymbols; + int lookbits, ctr; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (d_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_derived_tbl)); + dtbl = *pdtbl; + dtbl->pub = htbl; /* fill in back link */ + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + numsymbols = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + * BUG FIX: Comparison must be >, not >= + */ + if (((IJG_INT32) code) > (((IJG_INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure F.15: generate decoding tables for bit-sequential decoding */ + + p = 0; + for (l = 1; l <= 16; l++) { + if (htbl->bits[l]) { + /* valoffset[l] = huffval[] index of 1st symbol of code length l, + * minus the minimum code of length l + */ + dtbl->valoffset[l] = (IJG_INT32) p - (IJG_INT32) huffcode[p]; + p += htbl->bits[l]; + dtbl->maxcode[l] = (IJG_INT32)huffcode[p-1]; /* maximum code of length l */ + } else { + dtbl->maxcode[l] = -1; /* -1 if no codes of this length */ + } + } + dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */ + + /* Compute lookahead tables to speed up decoding. + * First we set all the table entries to 0, indicating "too long"; + * then we iterate through the Huffman codes that are short enough and + * fill in all the entries that correspond to bit sequences starting + * with that code. + */ + + MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits)); + + p = 0; + for (l = 1; l <= HUFF_LOOKAHEAD; l++) { + for (i = 1; i <= (int) htbl->bits[l]; i++, p++) { + /* l = current code's length, p = its index in huffcode[] & huffval[]. */ + /* Generate left-justified code followed by all possible bit sequences */ + lookbits = (int)huffcode[p] << (HUFF_LOOKAHEAD-l); + for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) { + dtbl->look_nbits[lookbits] = l; + dtbl->look_sym[lookbits] = htbl->huffval[p]; + lookbits++; + } + } + } + + /* Validate symbols as being reasonable. + * For AC tables, we make no check, but accept all byte values 0..255. + * For DC tables, we require the symbols to be in range 0..16. + * (Tighter bounds could be applied depending on the data depth and mode, + * but this is sufficient to ensure safe decoding.) + */ + if (isDC) { + for (i = 0; i < numsymbols; i++) { + int sym = htbl->huffval[i]; + if (sym < 0 || sym > 16) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + } + } +} + + +/* + * Out-of-line code for bit fetching. + * See jdhuff.h for info about usage. + * Note: current values of get_buffer and bits_left are passed as parameters, + * but are returned in the corresponding fields of the state struct. + * + * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width + * of get_buffer to be used. (On machines with wider words, an even larger + * buffer could be used.) However, on some machines 32-bit shifts are + * quite slow and take time proportional to the number of places shifted. + * (This is true with most PC compilers, for instance.) In this case it may + * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the + * average shift distance at the cost of more calls to jpeg_fill_bit_buffer. + */ + +#ifdef SLOW_SHIFT_32 +#define MIN_GET_BITS 15 /* minimum allowable value */ +#else +#define MIN_GET_BITS (BIT_BUF_SIZE-7) +#endif + + +GLOBAL(boolean) +jpeg_fill_bit_buffer (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + int nbits) +/* Load up the bit buffer to a depth of at least nbits */ +{ + /* Copy heavily used state fields into locals (hopefully registers) */ + register const JOCTET * next_input_byte = state->next_input_byte; + register size_t bytes_in_buffer = state->bytes_in_buffer; + j_decompress_ptr cinfo = state->cinfo; + + /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */ + /* (It is assumed that no request will be for more than that many bits.) */ + /* We fail to do so only if we hit a marker or are forced to suspend. */ + + if (cinfo->unread_marker == 0) { /* cannot advance past a marker */ + while (bits_left < MIN_GET_BITS) { + register int c; + + /* Attempt to read a byte */ + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + + /* If it's 0xFF, check and discard stuffed zero byte */ + if (c == 0xFF) { + /* Loop here to discard any padding FF's on terminating marker, + * so that we can save a valid unread_marker value. NOTE: we will + * accept multiple FF's followed by a 0 as meaning a single FF data + * byte. This data pattern is not valid according to the standard. + */ + do { + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + } while (c == 0xFF); + + if (c == 0) { + /* Found FF/00, which represents an FF data byte */ + c = 0xFF; + } else { + /* Oops, it's actually a marker indicating end of compressed data. + * Save the marker code for later use. + * Fine point: it might appear that we should save the marker into + * bitread working state, not straight into permanent state. But + * once we have hit a marker, we cannot need to suspend within the + * current MCU, because we will read no more bytes from the data + * source. So it is OK to update permanent state right away. + */ + cinfo->unread_marker = c; + /* See if we need to insert some fake zero bits. */ + goto no_more_bytes; + } + } + + /* OK, load c into get_buffer */ + get_buffer = (get_buffer << 8) | c; + bits_left += 8; + } /* end while */ + } else { + no_more_bytes: + /* We get here if we've read the marker that terminates the compressed + * data segment. There should be enough bits in the buffer register + * to satisfy the request; if so, no problem. + */ + if (nbits > bits_left) { + /* Uh-oh. Report corrupted data to user and stuff zeroes into + * the data stream, so that we can produce some kind of image. + * We use a nonvolatile flag to ensure that only one warning message + * appears per data segment. + */ + huffd_common_ptr huffd; + if (cinfo->process == JPROC_LOSSLESS) + huffd = (huffd_common_ptr) ((j_lossless_d_ptr) cinfo->codec)->entropy_private; + else + huffd = (huffd_common_ptr) ((j_lossy_d_ptr) cinfo->codec)->entropy_private; + if (! huffd->insufficient_data) { + WARNMS(cinfo, JWRN_HIT_MARKER); + huffd->insufficient_data = TRUE; + } + /* Fill the buffer with zero bits */ + get_buffer <<= MIN_GET_BITS - bits_left; + bits_left = MIN_GET_BITS; + } + } + + /* Unload the local registers */ + state->next_input_byte = next_input_byte; + state->bytes_in_buffer = bytes_in_buffer; + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + return TRUE; +} + + +/* + * Out-of-line code for Huffman code decoding. + * See jdhuff.h for info about usage. + */ + +GLOBAL(int) +jpeg_huff_decode (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + d_derived_tbl * htbl, int min_bits) +{ + register int l = min_bits; + register IJG_INT32 code; + + /* HUFF_DECODE has determined that the code is at least min_bits */ + /* bits long, so fetch that many bits in one swoop. */ + + CHECK_BIT_BUFFER(*state, l, return -1); + code = GET_BITS(l); + + /* Collect the rest of the Huffman code one bit at a time. */ + /* This is per Figure F.16 in the JPEG spec. */ + + while (code > htbl->maxcode[l]) { + code <<= 1; + CHECK_BIT_BUFFER(*state, 1, return -1); + code |= GET_BITS(1); + l++; + } + + /* Unload the local registers */ + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + /* With garbage input we may reach the sentinel value l = 17. */ + + if (l > 16) { + WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE); + return 0; /* fake a zero as the safest result */ + } + + return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ]; +} diff --git a/dcmjpeg/libijg8/jdhuff8.h b/dcmjpeg/libijg8/jdhuff8.h new file mode 100644 index 00000000..e61f6816 --- /dev/null +++ b/dcmjpeg/libijg8/jdhuff8.h @@ -0,0 +1,229 @@ +/* + * jdhuff.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains declarations for Huffman entropy decoding routines + * that are shared between the sequential decoder (jdhuff.c), the + * progressive decoder (jdphuff.c) and the lossless decoder (jdlhuff.c). + * No other modules need to see these. + */ + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_make_d_derived_tbl jpeg8_make_d_derived_tbl +#define jpeg_fill_bit_buffer jpeg8_fill_bit_buffer +#define jpeg_huff_decode jpeg8_huff_decode +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Derived data constructed for each Huffman table */ + +#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */ + +typedef struct { + /* Basic tables: (element [0] of each array is unused) */ + IJG_INT32 maxcode[18]; /* largest code of length k (-1 if none) */ + /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */ + IJG_INT32 valoffset[17]; /* huffval[] offset for codes of length k */ + /* valoffset[k] = huffval[] index of 1st symbol of code length k, less + * the smallest code of length k; so given a code of length k, the + * corresponding symbol is huffval[code + valoffset[k]] + */ + + /* Link to public Huffman table (needed only in jpeg_huff_decode) */ + JHUFF_TBL *pub; + + /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of + * the input data stream. If the next Huffman code is no more + * than HUFF_LOOKAHEAD bits long, we can obtain its length and + * the corresponding symbol directly from these tables. + */ + int look_nbits[1< 32 bits on your machine, and shifting/masking longs is + * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE + * appropriately should be a win. Unfortunately we can't define the size + * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8) + * because not all machines measure sizeof in 8-bit bytes. + */ + +typedef struct { /* Bitreading state saved across MCUs */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ +} bitread_perm_state; + +typedef struct { /* Bitreading working state within an MCU */ + /* Current data source location */ + /* We need a copy, rather than munging the original, in case of suspension */ + const JOCTET * next_input_byte; /* => next byte to read from source */ + size_t bytes_in_buffer; /* # of bytes remaining in source buffer */ + /* Bit input buffer --- note these values are kept in register variables, + * not in this struct, inside the inner loops. + */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ + /* Pointer needed by jpeg_fill_bit_buffer. */ + j_decompress_ptr cinfo; /* back link to decompress master record */ +} bitread_working_state; + +/* Macros to declare and load/save bitread local variables. */ +#define BITREAD_STATE_VARS \ + register bit_buf_type get_buffer; \ + register int bits_left; \ + bitread_working_state br_state + +#define BITREAD_LOAD_STATE(cinfop,permstate) \ + br_state.cinfo = cinfop; \ + br_state.next_input_byte = cinfop->src->next_input_byte; \ + br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ + get_buffer = permstate.get_buffer; \ + bits_left = permstate.bits_left; + +#define BITREAD_SAVE_STATE(cinfop,permstate) \ + cinfop->src->next_input_byte = br_state.next_input_byte; \ + cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ + permstate.get_buffer = get_buffer; \ + permstate.bits_left = bits_left + +/* + * These macros provide the in-line portion of bit fetching. + * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer + * before using GET_BITS, PEEK_BITS, or DROP_BITS. + * The variables get_buffer and bits_left are assumed to be locals, + * but the state struct might not be (jpeg_huff_decode needs this). + * CHECK_BIT_BUFFER(state,n,action); + * Ensure there are N bits in get_buffer; if suspend, take action. + * val = GET_BITS(n); + * Fetch next N bits. + * val = PEEK_BITS(n); + * Fetch next N bits without removing them from the buffer. + * DROP_BITS(n); + * Discard next N bits. + * The value N should be a simple variable, not an expression, because it + * is evaluated multiple times. + */ + +#define CHECK_BIT_BUFFER(state,nbits,action) \ + { if (bits_left < (nbits)) { \ + if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \ + { action; } \ + get_buffer = (state).get_buffer; bits_left = (state).bits_left; } } + +#define GET_BITS(nbits) \ + (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1)) + +#define PEEK_BITS(nbits) \ + (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1)) + +#define DROP_BITS(nbits) \ + (bits_left -= (nbits)) + +/* Load up the bit buffer to a depth of at least nbits */ +EXTERN(boolean) jpeg_fill_bit_buffer + JPP((bitread_working_state * state, register bit_buf_type get_buffer, + register int bits_left, int nbits)); + + +/* + * Code for extracting next Huffman-coded symbol from input bit stream. + * Again, this is time-critical and we make the main paths be macros. + * + * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits + * without looping. Usually, more than 95% of the Huffman codes will be 8 + * or fewer bits long. The few overlength codes are handled with a loop, + * which need not be inline code. + * + * Notes about the HUFF_DECODE macro: + * 1. Near the end of the data segment, we may fail to get enough bits + * for a lookahead. In that case, we do it the hard way. + * 2. If the lookahead table contains no entry, the next code must be + * more than HUFF_LOOKAHEAD bits long. + * 3. jpeg_huff_decode returns -1 if forced to suspend. + */ + +#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \ +{ register int nb, look; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + nb = 1; goto slowlabel; \ + } \ + } \ + look = PEEK_BITS(HUFF_LOOKAHEAD); \ + if ((nb = htbl->look_nbits[look]) != 0) { \ + DROP_BITS(nb); \ + result = htbl->look_sym[look]; \ + } else { \ + nb = HUFF_LOOKAHEAD+1; \ +slowlabel: \ + if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \ + { failaction; } \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + } \ +} + +/* Out-of-line case for Huffman code fetching */ +EXTERN(int) jpeg_huff_decode + JPP((bitread_working_state * state, register bit_buf_type get_buffer, + register int bits_left, d_derived_tbl * htbl, int min_bits)); + + +/* Common fields between sequential, progressive and lossless Huffman entropy + * decoder master structs. + */ + +#define huffd_common_fields \ + boolean insufficient_data; /* set TRUE after emmitting warning */ \ + /* These fields are loaded into local variables at start of each MCU. \ + * In case of suspension, we exit WITHOUT updating them. \ + */ \ + bitread_perm_state bitstate /* Bit buffer at start of MCU */ + +/* Routines that are to be used by any or all of the entropy decoders are + * declared to receive a pointer to this structure. There are no actual + * instances of huffd_common_struct, only of shuff_entropy_decoder, + * phuff_entropy_decoder and lhuff_entropy_decoder. + */ +struct huffd_common_struct { + huffd_common_fields; /* Fields common to all decoder struct types */ + /* Additional fields follow in an actual shuff_entropy_decoder, + * phuff_entropy_decoder or lhuff_entropy_decoder struct. All four structs + * must agree on these initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct huffd_common_struct * huffd_common_ptr; diff --git a/dcmjpeg/libijg8/jdinput.c b/dcmjpeg/libijg8/jdinput.c new file mode 100644 index 00000000..1fc88c8f --- /dev/null +++ b/dcmjpeg/libijg8/jdinput.c @@ -0,0 +1,347 @@ +/* + * jdinput.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input control logic for the JPEG decompressor. + * These routines are concerned with controlling the decompressor's input + * processing (marker reading and coefficient/difference decoding). + * The actual input reading is done in jdmarker.c, jdhuff.c, jdphuff.c, + * and jdlhuff.c. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Private state */ + +typedef struct { + struct jpeg_input_controller pub; /* public fields */ + + boolean inheaders; /* TRUE until first SOS is reached */ +} my_input_controller; + +typedef my_input_controller * my_inputctl_ptr; + + +/* Forward declarations */ +METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo)); + + +/* + * Routines to calculate various quantities related to the size of the image. + */ + +LOCAL(void) +initial_setup (j_decompress_ptr cinfo) +/* Called once, when first SOS marker is reached */ +{ + int ci; + jpeg_component_info *compptr; + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + if (cinfo->process == JPROC_LOSSLESS) { + /* If precision > compiled-in value, we must downscale */ + if (cinfo->data_precision > BITS_IN_JSAMPLE) + WARNMS2(cinfo, JWRN_MUST_DOWNSCALE, + cinfo->data_precision, BITS_IN_JSAMPLE); + } + else { /* Lossy processes */ + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + } + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* We initialize codec_data_unit and min_codec_data_unit to data_unit. + * In the full decompressor, this will be overridden by jdmaster.c; + * but in the transcoder, jdmaster.c is not used, so we must do it here. + */ + cinfo->min_codec_data_unit = cinfo->data_unit; + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->codec_data_unit = cinfo->data_unit; + /* Size in data units */ + compptr->width_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * cinfo->data_unit)); + compptr->height_in_data_units = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * cinfo->data_unit)); + /* downsampled_width and downsampled_height will also be overridden by + * jdmaster.c if we are doing full decompression. The transcoder library + * doesn't use these values, but the calling application might. + */ + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) cinfo->max_h_samp_factor); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) cinfo->max_v_samp_factor); + /* Mark component needed, until color conversion says otherwise */ + compptr->component_needed = TRUE; + /* Mark no quantization table yet saved for component */ + compptr->quant_table = NULL; + } + + /* Compute number of fully interleaved MCU rows. */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*cinfo->data_unit)); + + /* Decide whether file contains multiple scans */ + if (cinfo->comps_in_scan < cinfo->num_components || + cinfo->process == JPROC_PROGRESSIVE) + cinfo->inputctl->has_multiple_scans = TRUE; + else + cinfo->inputctl->has_multiple_scans = FALSE; +} + + +LOCAL(void) +per_scan_setup (j_decompress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_data_units; + cinfo->MCU_rows_in_scan = compptr->height_in_data_units; + + /* For noninterleaved scan, always one data unit per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_data_units = 1; + compptr->MCU_sample_width = compptr->codec_data_unit; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of data unit rows present in the last iMCU row. + */ + tmp = (int)compptr->height_in_data_units % compptr->v_samp_factor; + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->data_units_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, + (long) (cinfo->max_h_samp_factor*cinfo->data_unit)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor*cinfo->data_unit)); + + cinfo->data_units_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of data units of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_data_units = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * compptr->codec_data_unit; + /* Figure number of non-dummy data units in last MCU column & row */ + tmp = (int)compptr->width_in_data_units % compptr->MCU_width; + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int)compptr->height_in_data_units % compptr->MCU_height; + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_data_units; + if (cinfo->data_units_in_MCU + mcublks > D_MAX_DATA_UNITS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->data_units_in_MCU++] = ci; + } + } + + } +} + + +/* + * Initialize the input modules to read a scan of compressed data. + * The first call to this is done by jdmaster.c after initializing + * the entire decompressor (during jpeg_start_decompress). + * Subsequent calls come from consume_markers, below. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + per_scan_setup(cinfo); + (*cinfo->codec->start_input_pass) (cinfo); + cinfo->inputctl->consume_input = cinfo->codec->consume_data; +} + + +/* + * Finish up after inputting a compressed-data scan. + * This is called by the coefficient controller after it's read all + * the expected data of the scan. + */ + +METHODDEF(void) +finish_input_pass (j_decompress_ptr cinfo) +{ + cinfo->inputctl->consume_input = consume_markers; +} + + +/* + * Read JPEG markers before, between, or after compressed-data scans. + * Change state as necessary when a new scan is reached. + * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + * + * The consume_input method pointer points either here or to the + * coefficient controller's consume_data routine, depending on whether + * we are reading a compressed data segment or inter-segment markers. + */ + +METHODDEF(int) +consume_markers (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + int val; + + if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */ + return JPEG_REACHED_EOI; + + val = (*cinfo->marker->read_markers) (cinfo); + + switch (val) { + case JPEG_REACHED_SOS: /* Found SOS */ + if (inputctl->inheaders) { /* 1st SOS */ + initial_setup(cinfo); + /* + * Initialize the decompression codec. We need to do this here so that + * any codec-specific fields and function pointers are available to + * the rest of the library. + */ + jinit_d_codec(cinfo); + inputctl->inheaders = FALSE; + /* Note: start_input_pass must be called by jdmaster.c + * before any more input can be consumed. jdapimin.c is + * responsible for enforcing this sequencing. + */ + } else { /* 2nd or later SOS marker */ + if (! inputctl->pub.has_multiple_scans) + ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */ + start_input_pass(cinfo); + } + break; + case JPEG_REACHED_EOI: /* Found EOI */ + inputctl->pub.eoi_reached = TRUE; + if (inputctl->inheaders) { /* Tables-only datastream, apparently */ + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_NO_SOS); + } else { + /* Prevent infinite loop in coef ctlr's decompress_data routine + * if user set output_scan_number larger than number of scans. + */ + if (cinfo->output_scan_number > cinfo->input_scan_number) + cinfo->output_scan_number = cinfo->input_scan_number; + } + break; + case JPEG_SUSPENDED: + break; + } + + return val; +} + + +/* + * Reset state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + + inputctl->pub.consume_input = consume_markers; + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = TRUE; + /* Reset other modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->marker->reset_marker_reader) (cinfo); + /* Reset progression state -- would be cleaner if entropy decoder did this */ + cinfo->coef_bits = NULL; +} + + +/* + * Initialize the input controller module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl; + + /* Create subobject in permanent pool */ + inputctl = (my_inputctl_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_input_controller)); + cinfo->inputctl = (struct jpeg_input_controller *) inputctl; + /* Initialize method pointers */ + inputctl->pub.consume_input = consume_markers; + inputctl->pub.reset_input_controller = reset_input_controller; + inputctl->pub.start_input_pass = start_input_pass; + inputctl->pub.finish_input_pass = finish_input_pass; + /* Initialize state: can't use reset_input_controller since we don't + * want to try to reset other modules yet. + */ + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = TRUE; +} diff --git a/dcmjpeg/libijg8/jdlhuff.c b/dcmjpeg/libijg8/jdlhuff.c new file mode 100644 index 00000000..13ec816e --- /dev/null +++ b/dcmjpeg/libijg8/jdlhuff.c @@ -0,0 +1,296 @@ +/* + * jdlhuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for lossless JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" /* Private declarations for lossless codec */ +#include "jdhuff8.h" /* Declarations shared with jd*huff.c */ + + +#ifdef D_LOSSLESS_SUPPORTED + +typedef struct { + int ci, yoffset, MCU_width; +} lhd_output_ptr_info; + +/* + * Private entropy decoder object for lossless Huffman decoding. + */ + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + /* Precalculated info set up by start_pass for use in decode_mcus: */ + + /* Pointers to derived tables to be used for each data unit within an MCU */ + d_derived_tbl * cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + + /* Pointers to the proper output difference row for each group of data units + * within an MCU. For each component, there are Vi groups of Hi data units. + */ + JDIFFROW output_ptr[D_MAX_DATA_UNITS_IN_MCU]; + + /* Number of output pointers in use for the current MCU. This is the sum + * of all Vi in the MCU. + */ + int num_output_ptrs; + + /* Information used for positioning the output pointers within the output + * difference rows. + */ + lhd_output_ptr_info output_ptr_info[D_MAX_DATA_UNITS_IN_MCU]; + + /* Index of the proper output pointer for each data unit within an MCU */ + int output_ptr_index[D_MAX_DATA_UNITS_IN_MCU]; + +} lhuff_entropy_decoder; + +typedef lhuff_entropy_decoder * lhuff_entropy_ptr; + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_lhuff_decoder (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + int ci, dctbl, sampn, ptrn, yoffset, xoffset; + jpeg_component_info * compptr; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + /* Make sure requested tables are present */ + if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS || + cinfo->dc_huff_tbl_ptrs[dctbl] == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, + & entropy->derived_tbls[dctbl]); + } + + /* Precalculate decoding info for each sample in an MCU of this scan */ + for (sampn = 0, ptrn = 0; sampn < cinfo->data_units_in_MCU;) { + compptr = cinfo->cur_comp_info[cinfo->MCU_membership[sampn]]; + ci = compptr->component_index; + for (yoffset = 0; yoffset < compptr->MCU_height; yoffset++, ptrn++) { + /* Precalculate the setup info for each output pointer */ + entropy->output_ptr_info[ptrn].ci = ci; + entropy->output_ptr_info[ptrn].yoffset = yoffset; + entropy->output_ptr_info[ptrn].MCU_width = compptr->MCU_width; + for (xoffset = 0; xoffset < compptr->MCU_width; xoffset++, sampn++) { + /* Precalculate the output pointer index for each sample */ + entropy->output_ptr_index[sampn] = ptrn; + /* Precalculate which table to use for each sample */ + entropy->cur_tbls[sampn] = entropy->derived_tbls[compptr->dc_tbl_no]; + } + } + } + entropy->num_output_ptrs = ptrn; + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +METHODDEF(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + /* int ci; */ + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)entropy->bitstate.bits_left / 8; + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Decode and return nMCU's worth of Huffman-compressed differences. + * Each MCU is also disassembled and placed accordingly in diff_buf. + * + * MCU_col_num specifies the column of the first MCU being requested within + * the MCU-row. This tells us where to position the output row pointers in + * diff_buf. + * + * Returns the number of MCUs decoded. This may be less than nMCU if data + * source requested suspension. In that case no changes have been made to + * permanent state. (Exception: some output differences may already have + * been assigned. This is harmless for this module, since we'll just + * re-assign them on the next call.) + */ + +METHODDEF(JDIMENSION) +decode_mcus (j_decompress_ptr cinfo, JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, JDIMENSION MCU_col_num, JDIMENSION nMCU) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy = (lhuff_entropy_ptr) losslsd->entropy_private; + unsigned int mcu_num; + int sampn, ci, yoffset, MCU_width, ptrn; + BITREAD_STATE_VARS; + + /* Set output pointer locations based on MCU_col_num */ + for (ptrn = 0; ptrn < entropy->num_output_ptrs; ptrn++) { + ci = entropy->output_ptr_info[ptrn].ci; + yoffset = entropy->output_ptr_info[ptrn].yoffset; + MCU_width = entropy->output_ptr_info[ptrn].MCU_width; + entropy->output_ptr[ptrn] = + diff_buf[ci][MCU_row_num + (JDIMENSION)yoffset] + MCU_col_num * (JDIMENSION)MCU_width; + } + + /* + * If we've run out of data, zero out the buffers and return. + * By resetting the undifferencer, the output samples will be CENTERJSAMPLE. + * + * NB: We should find a way to do this without interacting with the + * undifferencer module directly. + */ + if (entropy->insufficient_data) { + for (ptrn = 0; ptrn < entropy->num_output_ptrs; ptrn++) + jzero_far((void FAR *) entropy->output_ptr[ptrn], + nMCU * (size_t)entropy->output_ptr_info[ptrn].MCU_width * SIZEOF(JDIFF)); + + (*losslsd->predict_process_restart) (cinfo); + } + + else { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + + /* Outer loop handles the number of MCU requested */ + + for (mcu_num = 0; mcu_num < nMCU; mcu_num++) { + + /* Inner loop handles the samples in the MCU */ + for (sampn = 0; sampn < cinfo->data_units_in_MCU; sampn++) { + d_derived_tbl * dctbl = entropy->cur_tbls[sampn]; + register int s, r; + + /* Section H.2.2: decode the sample difference */ + HUFF_DECODE(s, br_state, dctbl, return mcu_num, label1); + if (s) { + if (s == 16) /* special case: always output 32768 */ + s = 32768; + else { /* normal case: fetch subsequent bits */ + CHECK_BIT_BUFFER(br_state, s, return mcu_num); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + } + + /* Output the sample difference */ + *entropy->output_ptr[entropy->output_ptr_index[sampn]]++ = (JDIFF) s; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + } + } + + return nMCU; +} + + +/* + * Module initialization routine for lossless Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_lhuff_decoder (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + lhuff_entropy_ptr entropy; + int i; + + entropy = (lhuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(lhuff_entropy_decoder)); + losslsd->entropy_private = (void *) entropy; + losslsd->entropy_start_pass = start_pass_lhuff_decoder; + losslsd->entropy_process_restart = process_restart; + losslsd->entropy_decode_mcus = decode_mcus; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + } +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jdlossls.c b/dcmjpeg/libijg8/jdlossls.c new file mode 100644 index 00000000..ff329172 --- /dev/null +++ b/dcmjpeg/libijg8/jdlossls.c @@ -0,0 +1,98 @@ +/* + * jdlossls.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossless JPEG decompressor. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" + + +#ifdef D_LOSSLESS_SUPPORTED + +/* + * Compute output image dimensions and related values. + */ + +METHODDEF(void) +calc_output_dimensions (j_decompress_ptr cinfo) +{ + /* Hardwire it to "no scaling" */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + /* jdinput.c has already initialized codec_data_unit to 1, + * and has computed unscaled downsampled_width and downsampled_height. + */ +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + (*losslsd->entropy_start_pass) (cinfo); + (*losslsd->predict_start_pass) (cinfo); + (*losslsd->scaler_start_pass) (cinfo); + (*losslsd->diff_start_input_pass) (cinfo); +} + + +/* + * Initialize the lossless decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossless_d_codec(j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd; + boolean use_c_buffer; + + /* Create subobject in permanent pool */ + losslsd = (j_lossless_d_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossless_d_codec)); + cinfo->codec = (struct jpeg_d_codec *) losslsd; + + /* Initialize sub-modules */ + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + jinit_lhuff_decoder(cinfo); + } + + /* Undifferencer */ + jinit_undifferencer(cinfo); + + /* Scaler */ + jinit_d_scaler(cinfo); + + use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; + jinit_d_diff_controller(cinfo, use_c_buffer); + + /* Initialize method pointers. + * + * Note: consume_data, start_output_pass and decompress_data are + * assigned in jddiffct.c. + */ + losslsd->pub.calc_output_dimensions = calc_output_dimensions; + losslsd->pub.start_input_pass = start_input_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jdlossy.c b/dcmjpeg/libijg8/jdlossy.c new file mode 100644 index 00000000..39009085 --- /dev/null +++ b/dcmjpeg/libijg8/jdlossy.c @@ -0,0 +1,232 @@ +/* + * jdlossy.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the control logic for the lossy JPEG decompressor. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" + + +/* + * Compute output image dimensions and related values. + */ + +METHODDEF(void) +calc_output_dimensions (j_decompress_ptr cinfo) +{ +#ifdef IDCT_SCALING_SUPPORTED + int ci; + jpeg_component_info *compptr; + + /* Compute actual output image dimensions and DCT scaling choices. */ + if (cinfo->scale_num * 8 <= cinfo->scale_denom) { + /* Provide 1/8 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 8L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 8L); + cinfo->min_codec_data_unit = 1; + } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) { + /* Provide 1/4 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 4L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 4L); + cinfo->min_codec_data_unit = 2; + } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) { + /* Provide 1/2 scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, 2L); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, 2L); + cinfo->min_codec_data_unit = 4; + } else { + /* Provide 1/1 scaling */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + cinfo->min_codec_data_unit = DCTSIZE; + } + /* In selecting the actual DCT scaling for each component, we try to + * scale up the chroma components via IDCT scaling rather than upsampling. + * This saves time if the upsampler gets to use 1:1 scaling. + * Note this code assumes that the supported DCT scalings are powers of 2. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + int ssize = cinfo->min_codec_data_unit; + while (ssize < DCTSIZE && + (compptr->h_samp_factor * ssize * 2 <= + cinfo->max_h_samp_factor * cinfo->min_codec_data_unit) && + (compptr->v_samp_factor * ssize * 2 <= + cinfo->max_v_samp_factor * cinfo->min_codec_data_unit)) { + ssize = ssize * 2; + } + compptr->codec_data_unit = ssize; + } + + /* Recompute downsampled dimensions of components; + * application needs to know these if using raw downsampled data. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Size in samples, after IDCT scaling */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * + (long) (compptr->h_samp_factor * compptr->codec_data_unit), + (long) (cinfo->max_h_samp_factor * DCTSIZE)); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * + (long) (compptr->v_samp_factor * compptr->codec_data_unit), + (long) (cinfo->max_v_samp_factor * DCTSIZE)); + } + +#else /* !IDCT_SCALING_SUPPORTED */ + + /* Hardwire it to "no scaling" */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + /* jdinput.c has already initialized codec_data_unit to DCTSIZE, + * and has computed unscaled downsampled_width and downsampled_height. + */ + +#endif /* IDCT_SCALING_SUPPORTED */ +} + + +/* + * Save away a copy of the Q-table referenced by each component present + * in the current scan, unless already saved during a prior scan. + * + * In a multiple-scan JPEG file, the encoder could assign different components + * the same Q-table slot number, but change table definitions between scans + * so that each component uses a different Q-table. (The IJG encoder is not + * currently capable of doing this, but other encoders might.) Since we want + * to be able to dequantize all the components at the end of the file, this + * means that we have to save away the table actually used for each component. + * We do this by copying the table at the start of the first scan containing + * the component. + * The JPEG spec prohibits the encoder from changing the contents of a Q-table + * slot between scans of a component using that slot. If the encoder does so + * anyway, this decoder will simply use the Q-table values that were current + * at the start of the first scan for the component. + * + * The decompressor output side looks only at the saved quant tables, + * not at the current Q-table slots. + */ + +LOCAL(void) +latch_quant_tables (j_decompress_ptr cinfo) +{ + int ci, qtblno; + jpeg_component_info *compptr; + JQUANT_TBL * qtbl; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* No work if we already saved Q-table for this component */ + if (compptr->quant_table != NULL) + continue; + /* Make sure specified quantization table is present */ + qtblno = compptr->quant_tbl_no; + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + /* OK, save away the quantization table */ + qtbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(JQUANT_TBL)); + MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL)); + compptr->quant_table = qtbl; + } +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + + latch_quant_tables(cinfo); + (*lossyd->entropy_start_pass) (cinfo); + (*lossyd->coef_start_input_pass) (cinfo); +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + + (*lossyd->idct_start_pass) (cinfo); + (*lossyd->coef_start_output_pass) (cinfo); +} + +/* + * Initialize the lossy decompression codec. + * This is called only once, during master selection. + */ + +GLOBAL(void) +jinit_lossy_d_codec (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd; + boolean use_c_buffer; + + /* Create subobject in permanent pool */ + lossyd = (j_lossy_d_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(jpeg_lossy_d_codec)); + cinfo->codec = (struct jpeg_d_codec *) lossyd; + + /* Initialize sub-modules */ + + /* Inverse DCT */ + jinit_inverse_dct(cinfo); + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) { +#ifdef WITH_ARITHMETIC_PATCH + jinit_arith_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->process == JPROC_PROGRESSIVE) { +#ifdef D_PROGRESSIVE_SUPPORTED + jinit_phuff_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_shuff_decoder(cinfo); + } + + use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; + jinit_d_coef_controller(cinfo, use_c_buffer); + + /* Initialize method pointers. + * + * Note: consume_data and decompress_data are assigned in jdcoefct.c. + */ + lossyd->pub.calc_output_dimensions = calc_output_dimensions; + lossyd->pub.start_input_pass = start_input_pass; + lossyd->pub.start_output_pass = start_output_pass; +} + + + + diff --git a/dcmjpeg/libijg8/jdmainct.c b/dcmjpeg/libijg8/jdmainct.c new file mode 100644 index 00000000..f205f86f --- /dev/null +++ b/dcmjpeg/libijg8/jdmainct.c @@ -0,0 +1,512 @@ +/* + * jdmainct.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for decompression. + * The main buffer lies between the JPEG decompressor proper and the + * post-processor; it holds downsampled data in the JPEG colorspace. + * + * Note that this code is bypassed in raw-data mode, since the application + * supplies the equivalent of the main buffer in that case. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * In the current system design, the main buffer need never be a full-image + * buffer; any full-height buffers will be found inside the coefficient or + * postprocessing controllers. Nonetheless, the main controller is not + * trivial. Its responsibility is to provide context rows for upsampling/ + * rescaling, and doing this in an efficient fashion is a bit tricky. + * + * Postprocessor input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * codec_data_unit / min_codec_data_unit) + * sample rows of each component. (We require codec_data_unit values to be + * chosen such that these numbers are integers. In practice codec_data_unit + * values will likely be powers of two, so we actually have the stronger + * condition that codec_data_unit / min_codec_data_unit is an integer.) + * Upsampling will typically produce max_v_samp_factor pixel rows from each + * row group (times any additional scale factor that the upsampler is + * applying). + * + * The decompression codec will deliver data to us one iMCU row at a time; + * each iMCU row contains v_samp_factor * codec_data_unit sample rows, or + * exactly min_codec_data_unit row groups. (This amount of data corresponds + * to one row of MCUs when the image is fully interleaved.) Note that the + * number of sample rows varies across components, but the number of row + * groups does not. Some garbage sample rows may be included in the last iMCU + * row at the bottom of the image. + * + * Depending on the vertical scaling algorithm used, the upsampler may need + * access to the sample row(s) above and below its current input row group. + * The upsampler is required to set need_context_rows TRUE at global selection + * time if so. When need_context_rows is FALSE, this controller can simply + * obtain one iMCU row at a time from the coefficient controller and dole it + * out as row groups to the postprocessor. + * + * When need_context_rows is TRUE, this controller guarantees that the buffer + * passed to postprocessing contains at least one row group's worth of samples + * above and below the row group(s) being processed. Note that the context + * rows "above" the first passed row group appear at negative row offsets in + * the passed buffer. At the top and bottom of the image, the required + * context rows are manufactured by duplicating the first or last real sample + * row; this avoids having special cases in the upsampling inner loops. + * + * The amount of context is fixed at one row group just because that's a + * convenient number for this controller to work with. The existing + * upsamplers really only need one sample row of context. An upsampler + * supporting arbitrary output rescaling might wish for more than one row + * group of context when shrinking the image; tough, we don't handle that. + * (This is justified by the assumption that downsizing will be handled mostly + * by adjusting the codec_data_unit values, so that the actual scale factor at + * the upsample step needn't be much less than one.) + * + * To provide the desired context, we have to retain the last two row groups + * of one iMCU row while reading in the next iMCU row. (The last row group + * can't be processed until we have another row group for its below-context, + * and so we have to save the next-to-last group too for its above-context.) + * We could do this most simply by copying data around in our buffer, but + * that'd be very slow. We can avoid copying any data by creating a rather + * strange pointer structure. Here's how it works. We allocate a workspace + * consisting of M+2 row groups (where M = min_codec_data_unit is the number + * of row groups per iMCU row). We create two sets of redundant pointers to + * the workspace. Labeling the physical row groups 0 to M+1, the synthesized + * pointer lists look like this: + * M+1 M-1 + * master pointer --> 0 master pointer --> 0 + * 1 1 + * ... ... + * M-3 M-3 + * M-2 M + * M-1 M+1 + * M M-2 + * M+1 M-1 + * 0 0 + * We read alternate iMCU rows using each master pointer; thus the last two + * row groups of the previous iMCU row remain un-overwritten in the workspace. + * The pointer lists are set up so that the required context rows appear to + * be adjacent to the proper places when we pass the pointer lists to the + * upsampler. + * + * The above pictures describe the normal state of the pointer lists. + * At top and bottom of the image, we diddle the pointer lists to duplicate + * the first or last sample row as necessary (this is cheaper than copying + * sample rows around). + * + * This scheme breaks down if M < 2, ie, min_codec_data_unit is 1. In that + * situation each iMCU row provides only one row group so the buffering logic + * must be different (eg, we must read two iMCU rows before we can emit the + * first row group). For now, we simply do not support providing context + * rows when min_codec_data_unit is 1. That combination seems unlikely to + * be worth providing --- if someone wants a 1/8th-size preview, they probably + * want it quick and dirty, so a context-free upsampler is sufficient. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_main_controller pub; /* public fields */ + + /* Pointer to allocated workspace (M or M+2 row groups). */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + + boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ + JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ + + /* Remaining fields are only used in the context case. */ + + /* These are the master pointers to the funny-order pointer lists. */ + JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ + + int whichptr; /* indicates which pointer set is now in use */ + int context_state; /* process_data state machine status */ + JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ + JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + +/* context_state values: */ +#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ +#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ +#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +METHODDEF(void) process_data_context_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) process_data_crank_post + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#endif + + +LOCAL(void) +alloc_funny_pointers (j_decompress_ptr cinfo) +/* Allocate space for the funny pointer lists. + * This is done only once, not once per pass. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + /* Get top-level space for component array pointers. + * We alloc both arrays with one call to save a few cycles. + */ + mymain->xbuffer[0] = (JSAMPIMAGE) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); + mymain->xbuffer[1] = mymain->xbuffer[0] + cinfo->num_components; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + /* Get space for pointer lists --- M+4 row groups in each list. + * We alloc both pointer lists with one call to save a few cycles. + */ + xbuf = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 2 * (size_t)(rgroup * (M + 4)) * SIZEOF(JSAMPROW)); + xbuf += rgroup; /* want one row group at negative offsets */ + mymain->xbuffer[0][ci] = xbuf; + xbuf += rgroup * (M + 4); + mymain->xbuffer[1][ci] = xbuf; + } +} + + +LOCAL(void) +make_funny_pointers (j_decompress_ptr cinfo) +/* Create the funny pointer lists discussed in the comments above. + * The actual workspace is already allocated (in main->buffer), + * and the space for the pointer lists is allocated too. + * This routine just fills in the curiously ordered lists. + * This will be repeated at the beginning of each pass. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY buf, xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + xbuf0 = mymain->xbuffer[0][ci]; + xbuf1 = mymain->xbuffer[1][ci]; + /* First copy the workspace pointers as-is */ + buf = mymain->buffer[ci]; + for (i = 0; i < rgroup * (M + 2); i++) { + xbuf0[i] = xbuf1[i] = buf[i]; + } + /* In the second list, put the last four row groups in swapped order */ + for (i = 0; i < rgroup * 2; i++) { + xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i]; + xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i]; + } + /* The wraparound pointers at top and bottom will be filled later + * (see set_wraparound_pointers, below). Initially we want the "above" + * pointers to duplicate the first actual data line. This only needs + * to happen in xbuffer[0]. + */ + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[0]; + } + } +} + + +LOCAL(void) +set_wraparound_pointers (j_decompress_ptr cinfo) +/* Set up the "wraparound" pointers at top and bottom of the pointer lists. + * This changes the pointer list state from top-of-image to the normal state. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_codec_data_unit; + jpeg_component_info *compptr; + JSAMPARRAY xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + xbuf0 = mymain->xbuffer[0][ci]; + xbuf1 = mymain->xbuffer[1][ci]; + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; + xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; + xbuf0[rgroup*(M+2) + i] = xbuf0[i]; + xbuf1[rgroup*(M+2) + i] = xbuf1[i]; + } + } +} + + +LOCAL(void) +set_bottom_pointers (j_decompress_ptr cinfo) +/* Change the pointer lists to duplicate the last sample row at the bottom + * of the image. whichptr indicates which xbuffer holds the final iMCU row. + * Also sets rowgroups_avail to indicate number of nondummy row groups in row. + */ +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + int ci, i, rgroup, iMCUheight, rows_left; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Count sample rows in one iMCU row and in one row group */ + iMCUheight = compptr->v_samp_factor * compptr->codec_data_unit; + rgroup = iMCUheight / cinfo->min_codec_data_unit; + /* Count nondummy sample rows remaining for this component */ + rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight); + if (rows_left == 0) rows_left = iMCUheight; + /* Count nondummy row groups. Should get same answer for each component, + * so we need only do it once. + */ + if (ci == 0) { + mymain->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); + } + /* Duplicate the last real sample row rgroup*2 times; this pads out the + * last partial rowgroup and ensures at least one full rowgroup of context. + */ + xbuf = mymain->xbuffer[mymain->whichptr][ci]; + for (i = 0; i < rgroup * 2; i++) { + xbuf[rows_left + i] = xbuf[rows_left-1]; + } + } +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->upsample->need_context_rows) { + mymain->pub.process_data = process_data_context_main; + make_funny_pointers(cinfo); /* Create the xbuffer[] lists */ + mymain->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ + mymain->context_state = CTX_PREPARE_FOR_IMCU; + mymain->iMCU_row_ctr = 0; + } else { + /* Simple case with no context needed */ + mymain->pub.process_data = process_data_simple_main; + } + mymain->buffer_full = FALSE; /* Mark buffer empty */ + mymain->rowgroup_ctr = 0; + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_CRANK_DEST: + /* For last pass of 2-pass quantization, just crank the postprocessor */ + mymain->pub.process_data = process_data_crank_post; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This handles the simple case where no context is required. + */ + +METHODDEF(void) +process_data_simple_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + JDIMENSION rowgroups_avail; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mymain->buffer_full) { + if (! (*cinfo->codec->decompress_data) (cinfo, mymain->buffer)) + return; /* suspension forced, can do nothing more */ + mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + } + + /* There are always min_codec_data_unit row groups in an iMCU row. */ + rowgroups_avail = (JDIMENSION) cinfo->min_codec_data_unit; + /* Note: at the bottom of the image, we may pass extra garbage row groups + * to the postprocessor. The postprocessor has to check for bottom + * of image anyway (at row resolution), so no point in us doing it too. + */ + + /* Feed the postprocessor */ + (*cinfo->post->post_process_data) (cinfo, mymain->buffer, + &mymain->rowgroup_ctr, rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + + /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ + if (mymain->rowgroup_ctr >= rowgroups_avail) { + mymain->buffer_full = FALSE; + mymain->rowgroup_ctr = 0; + } +} + + +/* + * Process some data. + * This handles the case where context rows must be provided. + */ + +METHODDEF(void) +process_data_context_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mymain = (my_main_ptr) cinfo->main; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mymain->buffer_full) { + if (! (*cinfo->codec->decompress_data) (cinfo, + mymain->xbuffer[mymain->whichptr])) + return; /* suspension forced, can do nothing more */ + mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + mymain->iMCU_row_ctr++; /* count rows received */ + } + + /* Postprocessor typically will not swallow all the input data it is handed + * in one call (due to filling the output buffer first). Must be prepared + * to exit and restart. This switch lets us keep track of how far we got. + * Note that each case falls through to the next on successful completion. + */ + switch (mymain->context_state) { + case CTX_POSTPONED_ROW: + /* Call postprocessor using previously set pointers for postponed row */ + (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr], + &mymain->rowgroup_ctr, mymain->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mymain->rowgroup_ctr < mymain->rowgroups_avail) + return; /* Need to suspend */ + mymain->context_state = CTX_PREPARE_FOR_IMCU; + if (*out_row_ctr >= out_rows_avail) + return; /* Postprocessor exactly filled output buf */ + /*FALLTHROUGH*/ + case CTX_PREPARE_FOR_IMCU: + /* Prepare to process first M-1 row groups of this iMCU row */ + mymain->rowgroup_ctr = 0; + mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1); + /* Check for bottom of image: if so, tweak pointers to "duplicate" + * the last sample row, and adjust rowgroups_avail to ignore padding rows. + */ + if (mymain->iMCU_row_ctr == cinfo->total_iMCU_rows) + set_bottom_pointers(cinfo); + mymain->context_state = CTX_PROCESS_IMCU; + /*FALLTHROUGH*/ + case CTX_PROCESS_IMCU: + /* Call postprocessor using previously set pointers */ + (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr], + &mymain->rowgroup_ctr, mymain->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mymain->rowgroup_ctr < mymain->rowgroups_avail) + return; /* Need to suspend */ + /* After the first iMCU, change wraparound pointers to normal state */ + if (mymain->iMCU_row_ctr == 1) + set_wraparound_pointers(cinfo); + /* Prepare to load new iMCU row using other xbuffer list */ + mymain->whichptr ^= 1; /* 0=>1 or 1=>0 */ + mymain->buffer_full = FALSE; + /* Still need to process last row group of this iMCU row, */ + /* which is saved at index M+1 of the other xbuffer */ + mymain->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1); + mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2); + mymain->context_state = CTX_POSTPONED_ROW; + } +} + + +/* + * Process some data. + * Final pass of two-pass quantization: just call the postprocessor. + * Source data will be the postprocessor controller's internal buffer. + */ + +#ifdef QUANT_2PASS_SUPPORTED + +METHODDEF(void) +process_data_crank_post (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL, + (JDIMENSION *) NULL, (JDIMENSION) 0, + output_buf, out_row_ctr, out_rows_avail); +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mymain; + int ci, rgroup, ngroups; + jpeg_component_info *compptr; + + mymain = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = (struct jpeg_d_main_controller *) mymain; + mymain->pub.start_pass = start_pass_main; + + if (need_full_buffer) /* shouldn't happen */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Allocate the workspace. + * ngroups is the number of row groups we need. + */ + if (cinfo->upsample->need_context_rows) { + if (cinfo->min_codec_data_unit < 2) /* unsupported, see comments above */ + ERREXIT(cinfo, JERR_NOTIMPL); + alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ + ngroups = cinfo->min_codec_data_unit + 2; + } else { + ngroups = cinfo->min_codec_data_unit; + } + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; /* height of a row group of component */ + mymain->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_data_units * (JDIMENSION) compptr->codec_data_unit, + (JDIMENSION) (rgroup * ngroups)); + } +} diff --git a/dcmjpeg/libijg8/jdmarker.c b/dcmjpeg/libijg8/jdmarker.c new file mode 100644 index 00000000..22f18e56 --- /dev/null +++ b/dcmjpeg/libijg8/jdmarker.c @@ -0,0 +1,1370 @@ +/* + * jdmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to decode JPEG datastream markers. + * Most of the complexity arises from our desire to support input + * suspension: if not all of the data for a marker is available, + * we must exit back to the application. On resumption, we reprocess + * the marker. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_reader pub; /* public fields */ + + /* Application-overridable marker processing methods */ + jpeg_marker_parser_method process_COM; + jpeg_marker_parser_method process_APPn[16]; + + /* Limit on marker data length to save for each marker type */ + unsigned int length_limit_COM; + unsigned int length_limit_APPn[16]; + + /* Status of COM/APPn marker saving */ + jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */ + unsigned int bytes_read; /* data bytes read so far in marker */ + /* Note: cur_marker is not linked into marker_list until it's all read. */ +} my_marker_reader; + +typedef my_marker_reader * my_marker_ptr; + + +/* + * Macros for fetching data from the data source module. + * + * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect + * the current restart point; we update them only when we have reached a + * suitable place to restart if a suspension occurs. + */ + +/* Declare and initialize local copies of input pointer/count */ +#define INPUT_VARS(cinfo) \ + struct jpeg_source_mgr * datasrc = (cinfo)->src; \ + const JOCTET * next_input_byte = datasrc->next_input_byte; \ + size_t bytes_in_buffer = datasrc->bytes_in_buffer + +/* Unload the local copies --- do this only at a restart boundary */ +#define INPUT_SYNC(cinfo) \ + ( datasrc->next_input_byte = next_input_byte, \ + datasrc->bytes_in_buffer = bytes_in_buffer ) + +/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */ +#define INPUT_RELOAD(cinfo) \ + ( next_input_byte = datasrc->next_input_byte, \ + bytes_in_buffer = datasrc->bytes_in_buffer ) + +/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available. + * Note we do *not* do INPUT_SYNC before calling fill_input_buffer, + * but we must reload the local copies after a successful fill. + */ +#define MAKE_BYTE_AVAIL(cinfo,action) \ + if (bytes_in_buffer == 0) { \ + if (! (*datasrc->fill_input_buffer) (cinfo)) \ + { action; } \ + INPUT_RELOAD(cinfo); \ + } + +/* Read a byte into variable V. + * If must suspend, take the specified action (typically "return FALSE"). + */ +#define INPUT_BYTE(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = GETJOCTET(*next_input_byte++); ) + +/* As above, but read two bytes interpreted as an unsigned 16-bit integer. + * V should be declared unsigned int or perhaps IJG_INT32. + */ +#define INPUT_2BYTES(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ + MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V += GETJOCTET(*next_input_byte++); ) + + +/* + * Routines to process JPEG markers. + * + * Entry condition: JPEG marker itself has been read and its code saved + * in cinfo->unread_marker; input restart point is just after the marker. + * + * Exit: if return TRUE, have read and processed any parameters, and have + * updated the restart point to point after the parameters. + * If return FALSE, was forced to suspend before reaching end of + * marker parameters; restart point has not been moved. Same routine + * will be called again after application supplies more input data. + * + * This approach to suspension assumes that all of a marker's parameters + * can fit into a single input bufferload. This should hold for "normal" + * markers. Some COM/APPn markers might have large parameter segments + * that might not fit. If we are simply dropping such a marker, we use + * skip_input_data to get past it, and thereby put the problem on the + * source manager's shoulders. If we are saving the marker's contents + * into memory, we use a slightly different convention: when forced to + * suspend, the marker processor updates the restart point to the end of + * what it's consumed (ie, the end of the buffer) before returning FALSE. + * On resumption, cinfo->unread_marker still contains the marker code, + * but the data source will point to the next chunk of marker data. + * The marker processor must retain internal state to deal with this. + * + * Note that we don't bother to avoid duplicate trace messages if a + * suspension occurs within marker parameters. Other side effects + * require more care. + */ + + +LOCAL(boolean) +get_soi (j_decompress_ptr cinfo) +/* Process an SOI marker */ +{ + int i; + + TRACEMS(cinfo, 1, JTRC_SOI); + + if (cinfo->marker->saw_SOI) + ERREXIT(cinfo, JERR_SOI_DUPLICATE); + + /* Reset all parameters that are defined to be reset by SOI */ + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + cinfo->restart_interval = 0; + + /* Set initial assumptions for colorspace etc */ + + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ + + cinfo->saw_JFIF_marker = FALSE; + cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; + cinfo->X_density = 1; + cinfo->Y_density = 1; + cinfo->saw_Adobe_marker = FALSE; + cinfo->Adobe_transform = 0; + + cinfo->marker->saw_SOI = TRUE; + + return TRUE; +} + + +LOCAL(boolean) +get_sof (j_decompress_ptr cinfo, J_CODEC_PROCESS process, boolean is_arith, + int data_unit) +/* Process a SOFn marker */ +{ + IJG_INT32 length; + int c, ci; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + cinfo->data_unit = data_unit; + cinfo->process = process; + cinfo->arith_code = is_arith; + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE); + INPUT_BYTE(cinfo, cinfo->num_components, return FALSE); + + length -= 8; + + TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker, + (int) cinfo->image_width, (int) cinfo->image_height, + cinfo->num_components); + + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_DUPLICATE); + + /* We don't support files in which the image height is initially specified */ + /* as 0 and is later redefined by DNL. As long as we have to check that, */ + /* might as well have a general sanity check. */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 + || cinfo->num_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + if (length != (cinfo->num_components * 3)) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + if (cinfo->comp_info == NULL) /* do only once, even if suspend */ + cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components * SIZEOF(jpeg_component_info)); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->component_index = ci; + INPUT_BYTE(cinfo, compptr->component_id, return FALSE); + INPUT_BYTE(cinfo, c, return FALSE); + compptr->h_samp_factor = (c >> 4) & 15; + compptr->v_samp_factor = (c ) & 15; + INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); + + TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, + compptr->component_id, compptr->h_samp_factor, + compptr->v_samp_factor, compptr->quant_tbl_no); + } + + cinfo->marker->saw_SOF = TRUE; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_sos (j_decompress_ptr cinfo) +/* Process a SOS marker */ +{ + IJG_INT32 length; + int i, ci, n, c, cc; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + if (! cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOS_NO_SOF); + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */ + + TRACEMS1(cinfo, 1, JTRC_SOS, n); + + if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + cinfo->comps_in_scan = n; + + /* Collect the component-spec parameters */ + + for (i = 0; i < n; i++) { + INPUT_BYTE(cinfo, cc, return FALSE); + INPUT_BYTE(cinfo, c, return FALSE); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (cc == compptr->component_id) + goto id_found; + } + + ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); + + id_found: + + cinfo->cur_comp_info[i] = compptr; + compptr->dc_tbl_no = (c >> 4) & 15; + compptr->ac_tbl_no = (c ) & 15; + + TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, + compptr->dc_tbl_no, compptr->ac_tbl_no); + } + + /* Collect the additional scan parameters Ss, Se, Ah/Al. */ + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ss = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Se = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ah = (c >> 4) & 15; + cinfo->Al = (c ) & 15; + + TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se, + cinfo->Ah, cinfo->Al); + + /* Prepare to scan data & restart markers */ + cinfo->marker->next_restart_num = 0; + + /* Count another SOS marker */ + cinfo->input_scan_number++; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +#ifdef D_ARITH_CODING_SUPPORTED + +LOCAL(boolean) +get_dac (j_decompress_ptr cinfo) +/* Process a DAC marker */ +{ + IJG_INT32 length; + int idx, val; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + INPUT_BYTE(cinfo, idx, return FALSE); + INPUT_BYTE(cinfo, val, return FALSE); + + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_DAC, idx, val); + + if (idx < 0 || idx >= (2*NUM_ARITH_TBLS)) + ERREXIT1(cinfo, JERR_DAC_INDEX, idx); + + if (idx >= NUM_ARITH_TBLS) { /* define AC table */ + cinfo->arith_ac_K[idx-NUM_ARITH_TBLS] = (UINT8) val; + } else { /* define DC table */ + cinfo->arith_dc_L[idx] = (UINT8) (val & 0x0F); + cinfo->arith_dc_U[idx] = (UINT8) (val >> 4); + if (cinfo->arith_dc_L[idx] > cinfo->arith_dc_U[idx]) + ERREXIT1(cinfo, JERR_DAC_VALUE, val); + } + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + +#else /* ! D_ARITH_CODING_SUPPORTED */ + +#define get_dac(cinfo) skip_variable(cinfo) + +#endif /* D_ARITH_CODING_SUPPORTED */ + + +LOCAL(boolean) +get_dht (j_decompress_ptr cinfo) +/* Process a DHT marker */ +{ + IJG_INT32 length; + UINT8 bits[17]; + UINT8 huffval[256]; + int i, idx, count; + JHUFF_TBL **htblptr; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 16) { + INPUT_BYTE(cinfo, idx, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DHT, idx); + + bits[0] = 0; + count = 0; + for (i = 1; i <= 16; i++) { + INPUT_BYTE(cinfo, bits[i], return FALSE); + count += bits[i]; + } + + length -= 1 + 16; + + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[1], bits[2], bits[3], bits[4], + bits[5], bits[6], bits[7], bits[8]); + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[9], bits[10], bits[11], bits[12], + bits[13], bits[14], bits[15], bits[16]); + + /* Here we just do minimal validation of the counts to avoid walking + * off the end of our table space. jdhuff.c will check more carefully. + */ + if (count > 256 || ((IJG_INT32) count) > length) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + for (i = 0; i < count; i++) + INPUT_BYTE(cinfo, huffval[i], return FALSE); + + length -= count; + + if (idx & 0x10) { /* AC table definition */ + idx -= 0x10; + htblptr = &cinfo->ac_huff_tbl_ptrs[idx]; + } else { /* DC table definition */ + htblptr = &cinfo->dc_huff_tbl_ptrs[idx]; + } + + if (idx < 0 || idx >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_DHT_INDEX, idx); + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dqt (j_decompress_ptr cinfo) +/* Process a DQT marker */ +{ + IJG_INT32 length; + int n, i, prec; + unsigned int tmp; + JQUANT_TBL *quant_ptr; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + INPUT_BYTE(cinfo, n, return FALSE); + prec = n >> 4; + n &= 0x0F; + + TRACEMS2(cinfo, 1, JTRC_DQT, n, prec); + + if (n >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, n); + + if (cinfo->quant_tbl_ptrs[n] == NULL) + cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); + quant_ptr = cinfo->quant_tbl_ptrs[n]; + + for (i = 0; i < DCTSIZE2; i++) { + if (prec) + INPUT_2BYTES(cinfo, tmp, return FALSE); + else + INPUT_BYTE(cinfo, tmp, return FALSE); + /* We convert the zigzag-order table to natural array order. */ + quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp; + } + + if (cinfo->err->trace_level >= 2) { + for (i = 0; i < DCTSIZE2; i += 8) { + TRACEMS8(cinfo, 2, JTRC_QUANTVALS, + quant_ptr->quantval[i], quant_ptr->quantval[i+1], + quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], + quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], + quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); + } + } + + length -= DCTSIZE2+1; + if (prec) length -= DCTSIZE2; + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dri (j_decompress_ptr cinfo) +/* Process a DRI marker */ +{ + IJG_INT32 length; + unsigned int tmp; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + + if (length != 4) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_2BYTES(cinfo, tmp, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DRI, (int)tmp); + + cinfo->restart_interval = tmp; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Routines for processing APPn and COM markers. + * These are either saved in memory or discarded, per application request. + * APP0 and APP14 are specially checked to see if they are + * JFIF and Adobe markers, respectively. + */ + +#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */ +#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */ +#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */ + + +LOCAL(void) +examine_app0 (j_decompress_ptr cinfo, const JOCTET FAR * data, + unsigned int datalen, IJG_INT32 remaining) +/* Examine first few bytes from an APP0. + * Take appropriate action if it is a JFIF marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + IJG_INT32 totallen = (IJG_INT32) datalen + remaining; + + if (datalen >= APP0_DATA_LEN && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x49 && + GETJOCTET(data[3]) == 0x46 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF APP0 marker: save info */ + cinfo->saw_JFIF_marker = TRUE; + cinfo->JFIF_major_version = GETJOCTET(data[5]); + cinfo->JFIF_minor_version = GETJOCTET(data[6]); + cinfo->density_unit = GETJOCTET(data[7]); + cinfo->X_density = (UINT16)((GETJOCTET(data[8]) << 8) + GETJOCTET(data[9])); + cinfo->Y_density = (UINT16)((GETJOCTET(data[10]) << 8) + GETJOCTET(data[11])); + /* Check version. + * Major version must be 1, anything else signals an incompatible change. + * (We used to treat this as an error, but now it's a nonfatal warning, + * because some bozo at Hijaak couldn't read the spec.) + * Minor version should be 0..2, but process anyway if newer. + */ + if (cinfo->JFIF_major_version != 1) + WARNMS2(cinfo, JWRN_JFIF_MAJOR, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version); + /* Generate trace messages */ + TRACEMS5(cinfo, 1, JTRC_JFIF, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version, + cinfo->X_density, cinfo->Y_density, cinfo->density_unit); + /* Validate thumbnail dimensions and issue appropriate messages */ + if (GETJOCTET(data[12]) | GETJOCTET(data[13])) + TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, + GETJOCTET(data[12]), GETJOCTET(data[13])); + totallen -= APP0_DATA_LEN; + if (totallen != + ((IJG_INT32)GETJOCTET(data[12]) * (IJG_INT32)GETJOCTET(data[13]) * (IJG_INT32) 3)) + TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen); + } else if (datalen >= 6 && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x58 && + GETJOCTET(data[3]) == 0x58 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF "JFXX" extension APP0 marker */ + /* The library doesn't actually do anything with these, + * but we try to produce a helpful trace message. + */ + switch (GETJOCTET(data[5])) { + case 0x10: + TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen); + break; + case 0x11: + TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen); + break; + case 0x13: + TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen); + break; + default: + TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, + GETJOCTET(data[5]), (int) totallen); + break; + } + } else { + /* Start of APP0 does not match "JFIF" or "JFXX", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen); + } +} + + +LOCAL(void) +examine_app14 (j_decompress_ptr cinfo, const JOCTET FAR * data, + unsigned int datalen, IJG_INT32 remaining) +/* Examine first few bytes from an APP14. + * Take appropriate action if it is an Adobe marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + unsigned int version, flags0, flags1, transform; + + if (datalen >= APP14_DATA_LEN && + GETJOCTET(data[0]) == 0x41 && + GETJOCTET(data[1]) == 0x64 && + GETJOCTET(data[2]) == 0x6F && + GETJOCTET(data[3]) == 0x62 && + GETJOCTET(data[4]) == 0x65) { + /* Found Adobe APP14 marker */ + version = (unsigned int)((GETJOCTET(data[5]) << 8) + GETJOCTET(data[6])); + flags0 = (unsigned int)((GETJOCTET(data[7]) << 8) + GETJOCTET(data[8])); + flags1 = (unsigned int)((GETJOCTET(data[9]) << 8) + GETJOCTET(data[10])); + transform = GETJOCTET(data[11]); + TRACEMS4(cinfo, 1, JTRC_ADOBE, (int)version, (int)flags0, (int)flags1, (int)transform); + cinfo->saw_Adobe_marker = TRUE; + cinfo->Adobe_transform = (UINT8) transform; + } else { + /* Start of APP14 does not match "Adobe", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining)); + } +} + + +METHODDEF(boolean) +get_interesting_appn (j_decompress_ptr cinfo) +/* Process an APP0 or APP14 marker without saving it */ +{ + IJG_INT32 length; + JOCTET b[APPN_DATA_LEN]; + unsigned int i, numtoread; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + /* get the interesting part of the marker data */ + if (length >= APPN_DATA_LEN) + numtoread = APPN_DATA_LEN; + else if (length > 0) + numtoread = (unsigned int) length; + else + numtoread = 0; + for (i = 0; i < numtoread; i++) + INPUT_BYTE(cinfo, b[i], return FALSE); + length -= numtoread; + + /* process it */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + case M_APP14: + examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + default: + /* can't get here unless jpeg_save_markers chooses wrong processor */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +#ifdef SAVE_MARKERS_SUPPORTED + +METHODDEF(boolean) +save_marker (j_decompress_ptr cinfo) +/* Save an APPn or COM marker into the marker list */ +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + jpeg_saved_marker_ptr cur_marker = marker->cur_marker; + unsigned int bytes_read, data_length; + JOCTET FAR * data; + IJG_INT32 length = 0; + INPUT_VARS(cinfo); + + if (cur_marker == NULL) { + /* begin reading a marker */ + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + if (length >= 0) { /* watch out for bogus length word */ + /* figure out how much we want to save */ + unsigned int limit; + if (cinfo->unread_marker == (int) M_COM) + limit = marker->length_limit_COM; + else + limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0]; + if ((unsigned int) length < limit) + limit = (unsigned int) length; + /* allocate and initialize the marker item */ + cur_marker = (jpeg_saved_marker_ptr) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(struct jpeg_marker_struct) + limit); + cur_marker->next = NULL; + cur_marker->marker = (UINT8) cinfo->unread_marker; + cur_marker->original_length = (unsigned int) length; + cur_marker->data_length = limit; + /* data area is just beyond the jpeg_marker_struct */ + data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1); + marker->cur_marker = cur_marker; + marker->bytes_read = 0; + bytes_read = 0; + data_length = limit; + } else { + /* deal with bogus length word */ + bytes_read = data_length = 0; + data = NULL; + } + } else { + /* resume reading a marker */ + bytes_read = marker->bytes_read; + data_length = cur_marker->data_length; + data = cur_marker->data + bytes_read; + } + + while (bytes_read < data_length) { + INPUT_SYNC(cinfo); /* move the restart point to here */ + marker->bytes_read = bytes_read; + /* If there's not at least one byte in buffer, suspend */ + MAKE_BYTE_AVAIL(cinfo, return FALSE); + /* Copy bytes with reasonable rapidity */ + while (bytes_read < data_length && bytes_in_buffer > 0) { + *data++ = *next_input_byte++; + bytes_in_buffer--; + bytes_read++; + } + } + + /* Done reading what we want to read */ + if (cur_marker != NULL) { /* will be NULL if bogus length word */ + /* Add new marker to end of list */ + if (cinfo->marker_list == NULL) { + cinfo->marker_list = cur_marker; + } else { + jpeg_saved_marker_ptr prev = cinfo->marker_list; + while (prev->next != NULL) + prev = prev->next; + prev->next = cur_marker; + } + /* Reset pointer & calc remaining data length */ + data = cur_marker->data; + length = cur_marker->original_length - data_length; + } + /* Reset to initial state for next marker */ + marker->cur_marker = NULL; + + /* Process the marker if interesting; else just make a generic trace msg */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, data, data_length, length); + break; + case M_APP14: + examine_app14(cinfo, data, data_length, length); + break; + default: + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, + (int) (data_length + length)); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +METHODDEF(boolean) +skip_variable (j_decompress_ptr cinfo) +/* Skip over an unknown or uninteresting variable-length marker */ +{ + IJG_INT32 length; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); + + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +/* + * Find the next JPEG marker, save it in cinfo->unread_marker. + * Returns FALSE if had to suspend before reaching a marker; + * in that case cinfo->unread_marker is unchanged. + * + * Note that the result might not be a valid marker code, + * but it will never be 0 or FF. + */ + +LOCAL(boolean) +next_marker (j_decompress_ptr cinfo) +{ + int c; + INPUT_VARS(cinfo); + + for (;;) { + INPUT_BYTE(cinfo, c, return FALSE); + /* Skip any non-FF bytes. + * This may look a bit inefficient, but it will not occur in a valid file. + * We sync after each discarded byte so that a suspending data source + * can discard the byte from its buffer. + */ + while (c != 0xFF) { + cinfo->marker->discarded_bytes++; + INPUT_SYNC(cinfo); + INPUT_BYTE(cinfo, c, return FALSE); + } + /* This loop swallows any duplicate FF bytes. Extra FFs are legal as + * pad bytes, so don't count them in discarded_bytes. We assume there + * will not be so many consecutive FF bytes as to overflow a suspending + * data source's input buffer. + */ + do { + INPUT_BYTE(cinfo, c, return FALSE); + } while (c == 0xFF); + if (c != 0) + break; /* found a valid marker, exit loop */ + /* Reach here if we found a stuffed-zero data sequence (FF/00). + * Discard it and loop back to try again. + */ + cinfo->marker->discarded_bytes += 2; + INPUT_SYNC(cinfo); + } + + if (cinfo->marker->discarded_bytes != 0) { + WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, (int)cinfo->marker->discarded_bytes, c); + cinfo->marker->discarded_bytes = 0; + } + + cinfo->unread_marker = c; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +first_marker (j_decompress_ptr cinfo) +/* Like next_marker, but used to obtain the initial SOI marker. */ +/* For this marker, we do not allow preceding garbage or fill; otherwise, + * we might well scan an entire input file before realizing it ain't JPEG. + * If an application wants to process non-JFIF files, it must seek to the + * SOI before calling the JPEG library. + */ +{ + int c, c2; + INPUT_VARS(cinfo); + + INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c2, return FALSE); + if (c != 0xFF || c2 != (int) M_SOI) + ERREXIT2(cinfo, JERR_NO_SOI, c, c2); + + cinfo->unread_marker = c2; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Read markers until SOS or EOI. + * + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + */ + +METHODDEF(int) +read_markers (j_decompress_ptr cinfo) +{ + /* Outer loop repeats once for each marker. */ + for (;;) { + /* Collect the marker proper, unless we already did. */ + /* NB: first_marker() enforces the requirement that SOI appear first. */ + if (cinfo->unread_marker == 0) { + if (! cinfo->marker->saw_SOI) { + if (! first_marker(cinfo)) + return JPEG_SUSPENDED; + } else { + if (! next_marker(cinfo)) + return JPEG_SUSPENDED; + } + } + /* At this point cinfo->unread_marker contains the marker code and the + * input point is just past the marker proper, but before any parameters. + * A suspension will cause us to return with this state still true. + */ + switch (cinfo->unread_marker) { + case M_SOI: + if (! get_soi(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_SOF0: /* Baseline */ + case M_SOF1: /* Extended sequential, Huffman */ + if (! get_sof(cinfo, JPROC_SEQUENTIAL, FALSE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF2: /* Progressive, Huffman */ + if (! get_sof(cinfo, JPROC_PROGRESSIVE, FALSE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF3: /* Lossless, Huffman */ + if (! get_sof(cinfo, JPROC_LOSSLESS, FALSE, 1)) + return JPEG_SUSPENDED; + break; + + case M_SOF9: /* Extended sequential, arithmetic */ + if (! get_sof(cinfo, JPROC_SEQUENTIAL, TRUE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF10: /* Progressive, arithmetic */ + if (! get_sof(cinfo, JPROC_PROGRESSIVE, TRUE, DCTSIZE)) + return JPEG_SUSPENDED; + break; + + case M_SOF11: /* Lossless, arithmetic */ + if (! get_sof(cinfo, JPROC_LOSSLESS, TRUE, 1)) + return JPEG_SUSPENDED; + break; + + /* Currently unsupported SOFn types */ + case M_SOF5: /* Differential sequential, Huffman */ + case M_SOF6: /* Differential progressive, Huffman */ + case M_SOF7: /* Differential lossless, Huffman */ + case M_JPG: /* Reserved for JPEG extensions */ + case M_SOF13: /* Differential sequential, arithmetic */ + case M_SOF14: /* Differential progressive, arithmetic */ + case M_SOF15: /* Differential lossless, arithmetic */ + ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker); + break; + + case M_SOS: + if (! get_sos(cinfo)) + return JPEG_SUSPENDED; + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_SOS; + + case M_EOI: + TRACEMS(cinfo, 1, JTRC_EOI); + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_EOI; + + case M_DAC: + if (! get_dac(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DHT: + if (! get_dht(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DQT: + if (! get_dqt(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DRI: + if (! get_dri(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_APP0: + case M_APP1: + case M_APP2: + case M_APP3: + case M_APP4: + case M_APP5: + case M_APP6: + case M_APP7: + case M_APP8: + case M_APP9: + case M_APP10: + case M_APP11: + case M_APP12: + case M_APP13: + case M_APP14: + case M_APP15: + if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[ + cinfo->unread_marker - (int) M_APP0]) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_COM: + if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_RST0: /* these are all parameterless */ + case M_RST1: + case M_RST2: + case M_RST3: + case M_RST4: + case M_RST5: + case M_RST6: + case M_RST7: + case M_TEM: + TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker); + break; + + case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ + if (! skip_variable(cinfo)) + return JPEG_SUSPENDED; + break; + + default: /* must be DHP, EXP, JPGn, or RESn */ + /* For now, we treat the reserved markers as fatal errors since they are + * likely to be used to signal incompatible JPEG Part 3 extensions. + * Once the JPEG 3 version-number marker is well defined, this code + * ought to change! + */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + /* Successfully processed marker, so reset state variable */ + cinfo->unread_marker = 0; + } /* end loop */ +} + + +/* + * Read a restart marker, which is expected to appear next in the datastream; + * if the marker is not there, take appropriate recovery action. + * Returns FALSE if suspension is required. + * + * This is called by the entropy decoder after it has read an appropriate + * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder + * has already read a marker from the data source. Under normal conditions + * cinfo->unread_marker will be reset to 0 before returning; if not reset, + * it holds a marker which the decoder will be unable to read past. + */ + +METHODDEF(boolean) +read_restart_marker (j_decompress_ptr cinfo) +{ + /* Obtain a marker unless we already did. */ + /* Note that next_marker will complain if it skips any data. */ + if (cinfo->unread_marker == 0) { + if (! next_marker(cinfo)) + return FALSE; + } + + if (cinfo->unread_marker == + ((int) M_RST0 + cinfo->marker->next_restart_num)) { + /* Normal case --- swallow the marker and let entropy decoder continue */ + TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num); + cinfo->unread_marker = 0; + } else { + /* Uh-oh, the restart markers have been messed up. */ + /* Let the data source manager determine how to resync. */ + if (! (*cinfo->src->resync_to_restart) (cinfo, + cinfo->marker->next_restart_num)) + return FALSE; + } + + /* Update next-restart state */ + cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7; + + return TRUE; +} + + +/* + * This is the default resync_to_restart method for data source managers + * to use if they don't have any better approach. Some data source managers + * may be able to back up, or may have additional knowledge about the data + * which permits a more intelligent recovery strategy; such managers would + * presumably supply their own resync method. + * + * read_restart_marker calls resync_to_restart if it finds a marker other than + * the restart marker it was expecting. (This code is *not* used unless + * a nonzero restart interval has been declared.) cinfo->unread_marker is + * the marker code actually found (might be anything, except 0 or FF). + * The desired restart marker number (0..7) is passed as a parameter. + * This routine is supposed to apply whatever error recovery strategy seems + * appropriate in order to position the input stream to the next data segment. + * Note that cinfo->unread_marker is treated as a marker appearing before + * the current data-source input point; usually it should be reset to zero + * before returning. + * Returns FALSE if suspension is required. + * + * This implementation is substantially constrained by wanting to treat the + * input as a data stream; this means we can't back up. Therefore, we have + * only the following actions to work with: + * 1. Simply discard the marker and let the entropy decoder resume at next + * byte of file. + * 2. Read forward until we find another marker, discarding intervening + * data. (In theory we could look ahead within the current bufferload, + * without having to discard data if we don't find the desired marker. + * This idea is not implemented here, in part because it makes behavior + * dependent on buffer size and chance buffer-boundary positions.) + * 3. Leave the marker unread (by failing to zero cinfo->unread_marker). + * This will cause the entropy decoder to process an empty data segment, + * inserting dummy zeroes, and then we will reprocess the marker. + * + * #2 is appropriate if we think the desired marker lies ahead, while #3 is + * appropriate if the found marker is a future restart marker (indicating + * that we have missed the desired restart marker, probably because it got + * corrupted). + * We apply #2 or #3 if the found marker is a restart marker no more than + * two counts behind or ahead of the expected one. We also apply #2 if the + * found marker is not a legal JPEG marker code (it's certainly bogus data). + * If the found marker is a restart marker more than 2 counts away, we do #1 + * (too much risk that the marker is erroneous; with luck we will be able to + * resync at some future point). + * For any valid non-restart JPEG marker, we apply #3. This keeps us from + * overrunning the end of a scan. An implementation limited to single-scan + * files might find it better to apply #2 for markers other than EOI, since + * any other marker would have to be bogus data in that case. + */ + +GLOBAL(boolean) +jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) +{ + int marker = cinfo->unread_marker; + int action = 1; + + /* Always put up a warning. */ + WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); + + /* Outer loop handles repeated decision after scanning forward. */ + for (;;) { + if (marker < (int) M_SOF0) + action = 2; /* invalid marker */ + else if (marker < (int) M_RST0 || marker > (int) M_RST7) + action = 3; /* valid non-restart marker */ + else { + if (marker == ((int) M_RST0 + ((desired+1) & 7)) || + marker == ((int) M_RST0 + ((desired+2) & 7))) + action = 3; /* one of the next two expected restarts */ + else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || + marker == ((int) M_RST0 + ((desired-2) & 7))) + action = 2; /* a prior restart, so advance */ + else + action = 1; /* desired restart or too far away */ + } + TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action); + switch (action) { + case 1: + /* Discard marker and let entropy decoder resume processing. */ + cinfo->unread_marker = 0; + return TRUE; + case 2: + /* Scan to the next marker, and repeat the decision loop. */ + if (! next_marker(cinfo)) + return FALSE; + marker = cinfo->unread_marker; + break; + case 3: + /* Return without advancing past this marker. */ + /* Entropy decoder will be forced to process an empty segment. */ + return TRUE; + } + } /* end loop */ +} + + +/* + * Reset marker processing state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + cinfo->comp_info = NULL; /* until allocated by get_sof */ + cinfo->input_scan_number = 0; /* no SOS seen yet */ + cinfo->unread_marker = 0; /* no pending marker */ + marker->pub.saw_SOI = FALSE; /* set internal state too */ + marker->pub.saw_SOF = FALSE; + marker->pub.discarded_bytes = 0; + marker->cur_marker = NULL; +} + + +/* + * Initialize the marker reader module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker; + int i; + + /* Create subobject in permanent pool */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_marker_reader)); + cinfo->marker = (struct jpeg_marker_reader *) marker; + /* Initialize public method pointers */ + marker->pub.reset_marker_reader = reset_marker_reader; + marker->pub.read_markers = read_markers; + marker->pub.read_restart_marker = read_restart_marker; + /* Initialize COM/APPn processing. + * By default, we examine and then discard APP0 and APP14, + * but simply discard COM and all other APPn. + */ + marker->process_COM = skip_variable; + marker->length_limit_COM = 0; + for (i = 0; i < 16; i++) { + marker->process_APPn[i] = skip_variable; + marker->length_limit_APPn[i] = 0; + } + marker->process_APPn[0] = get_interesting_appn; + marker->process_APPn[14] = get_interesting_appn; + /* Reset marker processing state */ + reset_marker_reader(cinfo); +} + + +/* + * Control saving of COM and APPn markers into marker_list. + */ + +#ifdef SAVE_MARKERS_SUPPORTED + +GLOBAL(void) +jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + long maxlength; + jpeg_marker_parser_method processor; + + /* Length limit mustn't be larger than what we can allocate + * (should only be a concern in a 16-bit environment). + */ + maxlength = cinfo->mem->max_alloc_chunk - (long)SIZEOF(struct jpeg_marker_struct); + if (((long) length_limit) > maxlength) + length_limit = (unsigned int) maxlength; + + /* Choose processor routine to use. + * APP0/APP14 have special requirements. + */ + if (length_limit) { + processor = save_marker; + /* If saving APP0/APP14, save at least enough for our internal use. */ + if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN) + length_limit = APP0_DATA_LEN; + else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN) + length_limit = APP14_DATA_LEN; + } else { + processor = skip_variable; + /* If discarding APP0/APP14, use our regular on-the-fly processor. */ + if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14) + processor = get_interesting_appn; + } + + if (marker_code == (int) M_COM) { + marker->process_COM = processor; + marker->length_limit_COM = length_limit; + } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) { + marker->process_APPn[marker_code - (int) M_APP0] = processor; + marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit; + } else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +/* + * Install a special processing method for COM or APPn markers. + */ + +GLOBAL(void) +jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + if (marker_code == (int) M_COM) + marker->process_COM = routine; + else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) + marker->process_APPn[marker_code - (int) M_APP0] = routine; + else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} diff --git a/dcmjpeg/libijg8/jdmaster.c b/dcmjpeg/libijg8/jdmaster.c new file mode 100644 index 00000000..5b5b15e5 --- /dev/null +++ b/dcmjpeg/libijg8/jdmaster.c @@ -0,0 +1,460 @@ +/* + * jdmaster.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG decompressor. + * These routines are concerned with selecting the modules to be executed + * and with determining the number of passes and the work to be done in each + * pass. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Private state */ + +typedef struct { + struct jpeg_decomp_master pub; /* public fields */ + + int pass_number; /* # of passes completed */ + + boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ + + /* Saved references to initialized quantizer modules, + * in case we need to switch modes. + */ + struct jpeg_color_quantizer * quantizer_1pass; + struct jpeg_color_quantizer * quantizer_2pass; +} my_decomp_master; + +typedef my_decomp_master * my_master_ptr; + + +/* + * Determine whether merged upsample/color conversion should be used. + * CRUCIAL: this must match the actual capabilities of jdmerge.c! + */ + +LOCAL(boolean) +use_merged_upsample (j_decompress_ptr cinfo) +{ +#ifdef UPSAMPLE_MERGING_SUPPORTED + /* Merging is the equivalent of plain box-filter upsampling */ + if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) + return FALSE; + /* jdmerge.c only supports YCC=>RGB color conversion */ + if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || + cinfo->out_color_space != JCS_RGB || + cinfo->out_color_components != RGB_PIXELSIZE) + return FALSE; + /* and it only handles 2h1v or 2h2v sampling ratios */ + if (cinfo->comp_info[0].h_samp_factor != 2 || + cinfo->comp_info[1].h_samp_factor != 1 || + cinfo->comp_info[2].h_samp_factor != 1 || + cinfo->comp_info[0].v_samp_factor > 2 || + cinfo->comp_info[1].v_samp_factor != 1 || + cinfo->comp_info[2].v_samp_factor != 1) + return FALSE; + /* furthermore, it doesn't work if each component has been + processed differently */ + if (cinfo->comp_info[0].codec_data_unit != cinfo->min_codec_data_unit || + cinfo->comp_info[1].codec_data_unit != cinfo->min_codec_data_unit || + cinfo->comp_info[2].codec_data_unit != cinfo->min_codec_data_unit) + return FALSE; + /* ??? also need to test for upsample-time rescaling, when & if supported */ + return TRUE; /* by golly, it'll work... */ +#else + return FALSE; +#endif +} + + +/* + * Compute output image dimensions and related values. + * NOTE: this is exported for possible use by application. + * Hence it mustn't do anything that can't be done twice. + * Also note that it may be called before the master module is initialized! + */ + +GLOBAL(void) +jpeg_calc_output_dimensions (j_decompress_ptr cinfo) +/* Do computations that are needed before master selection phase */ +{ + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_READY) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->codec->calc_output_dimensions) (cinfo); + + /* Report number of components in selected colorspace. */ + /* Probably this should be in the color conversion module... */ + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + break; + case JCS_RGB: +#if RGB_PIXELSIZE != 3 + cinfo->out_color_components = RGB_PIXELSIZE; + break; +#endif /* else share code with YCbCr */ + case JCS_YCbCr: + cinfo->out_color_components = 3; + break; + case JCS_CMYK: + case JCS_YCCK: + cinfo->out_color_components = 4; + break; + default: /* else must be same colorspace as in file */ + cinfo->out_color_components = cinfo->num_components; + break; + } + cinfo->output_components = (cinfo->quantize_colors ? 1 : + cinfo->out_color_components); + + /* See if upsampler will want to emit more than one row at a time */ + if (use_merged_upsample(cinfo)) + cinfo->rec_outbuf_height = cinfo->max_v_samp_factor; + else + cinfo->rec_outbuf_height = 1; +} + + +/* + * Several decompression processes need to range-limit values to the range + * 0..MAXJSAMPLE; the input value may fall somewhat outside this range + * due to noise introduced by quantization, roundoff error, etc. These + * processes are inner loops and need to be as fast as possible. On most + * machines, particularly CPUs with pipelines or instruction prefetch, + * a (subscript-check-less) C table lookup + * x = sample_range_limit[x]; + * is faster than explicit tests + * if (x < 0) x = 0; + * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; + * These processes all use a common table prepared by the routine below. + * + * For most steps we can mathematically guarantee that the initial value + * of x is within MAXJSAMPLE+1 of the legal range, so a table running from + * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial + * limiting step (just after the IDCT), a wildly out-of-range value is + * possible if the input data is corrupt. To avoid any chance of indexing + * off the end of memory and getting a bad-pointer trap, we perform the + * post-IDCT limiting thus: + * x = range_limit[x & MASK]; + * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit + * samples. Under normal circumstances this is more than enough range and + * a correct output will be generated; with bogus input data the mask will + * cause wraparound, and we will safely generate a bogus-but-in-range output. + * For the post-IDCT step, we want to convert the data from signed to unsigned + * representation by adding CENTERJSAMPLE at the same time that we limit it. + * So the post-IDCT limiting table ends up looking like this: + * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE, + * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0,1,...,CENTERJSAMPLE-1 + * Negative inputs select values from the upper half of the table after + * masking. + * + * We can save some space by overlapping the start of the post-IDCT table + * with the simpler range limiting table. The post-IDCT table begins at + * sample_range_limit + CENTERJSAMPLE. + * + * Note that the table is allocated in near data space on PCs; it's small + * enough and used often enough to justify this. + */ + +LOCAL(void) +prepare_range_limit_table (j_decompress_ptr cinfo) +/* Allocate and fill in the sample_range_limit table */ +{ + JSAMPLE * table; + int i; + + table = (JSAMPLE *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ + cinfo->sample_range_limit = table; + /* First segment of "simple" table: limit[x] = 0 for x < 0 */ + MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + /* Main part of "simple" table: limit[x] = x */ + for (i = 0; i <= MAXJSAMPLE; i++) + table[i] = (JSAMPLE) i; + table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ + /* End of simple table, rest of first half of post-IDCT table */ + for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) + table[i] = MAXJSAMPLE; + /* Second half of post-IDCT table */ + MEMZERO(table + (2 * (MAXJSAMPLE+1)), + (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), + cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE)); +} + + +/* + * Master selection of decompression modules. + * This is done once at jpeg_start_decompress time. We determine + * which modules will be used and give them appropriate initialization calls. + * We also initialize the decompressor input side to begin consuming data. + * + * Since jpeg_read_header has finished, we know what is in the SOF + * and (first) SOS markers. We also have all the application parameter + * settings. + */ + +LOCAL(void) +master_selection (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + long samplesperrow; + JDIMENSION jd_samplesperrow; + + /* Initialize dimensions and other stuff */ + jpeg_calc_output_dimensions(cinfo); + prepare_range_limit_table(cinfo); + + /* Width of an output scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* Initialize my private state */ + master->pass_number = 0; + master->using_merged_upsample = use_merged_upsample(cinfo); + + /* Color quantizer selection */ + master->quantizer_1pass = NULL; + master->quantizer_2pass = NULL; + /* No mode changes if not using buffered-image mode. */ + if (! cinfo->quantize_colors || ! cinfo->buffered_image) { + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + } + if (cinfo->quantize_colors) { + if (cinfo->raw_data_out) + ERREXIT(cinfo, JERR_NOTIMPL); + /* 2-pass quantizer only works in 3-component color space. */ + if (cinfo->out_color_components != 3) { + cinfo->enable_1pass_quant = TRUE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + cinfo->colormap = NULL; + } else if (cinfo->colormap != NULL) { + cinfo->enable_external_quant = TRUE; + } else if (cinfo->two_pass_quantize) { + cinfo->enable_2pass_quant = TRUE; + } else { + cinfo->enable_1pass_quant = TRUE; + } + + if (cinfo->enable_1pass_quant) { +#ifdef QUANT_1PASS_SUPPORTED + jinit_1pass_quantizer(cinfo); + master->quantizer_1pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + + /* We use the 2-pass code to map to external colormaps. */ + if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) { +#ifdef QUANT_2PASS_SUPPORTED + jinit_2pass_quantizer(cinfo); + master->quantizer_2pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + /* If both quantizers are initialized, the 2-pass one is left active; + * this is necessary for starting with quantization to an external map. + */ + } + + /* Post-processing: in particular, color conversion first */ + if (! cinfo->raw_data_out) { + if (master->using_merged_upsample) { +#ifdef UPSAMPLE_MERGING_SUPPORTED + jinit_merged_upsampler(cinfo); /* does color conversion too */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + jinit_color_deconverter(cinfo); + jinit_upsampler(cinfo); + } + jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant); + } + + /* Initialize principal buffer controllers. */ + if (! cinfo->raw_data_out) + jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* If jpeg_start_decompress will read the whole file, initialize + * progress monitoring appropriately. The input step is counted + * as one pass. + */ + if (cinfo->progress != NULL && ! cinfo->buffered_image && + cinfo->inputctl->has_multiple_scans) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2); + /* Count the input pass as done */ + master->pass_number++; + } +#endif /* D_MULTISCAN_FILES_SUPPORTED */ +} + + +/* + * Per-pass setup. + * This is called at the beginning of each output pass. We determine which + * modules will be active during this pass and give them appropriate + * start_pass calls. We also set is_dummy_pass to indicate whether this + * is a "real" output pass or a dummy pass for color quantization. + * (In the latter case, jdapistd.c will crank the pass to completion.) + */ + +METHODDEF(void) +prepare_for_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (master->pub.is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Final pass of 2-pass quantization */ + master->pub.is_dummy_pass = FALSE; + (*cinfo->cquantize->start_pass) (cinfo, FALSE); + (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); + (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + if (cinfo->quantize_colors && cinfo->colormap == NULL) { + /* Select new quantization method */ + if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) { + cinfo->cquantize = master->quantizer_2pass; + master->pub.is_dummy_pass = TRUE; + } else if (cinfo->enable_1pass_quant) { + cinfo->cquantize = master->quantizer_1pass; + } else { + ERREXIT(cinfo, JERR_MODE_CHANGE); + } + } + (*cinfo->codec->start_output_pass) (cinfo); + if (! cinfo->raw_data_out) { + if (! master->using_merged_upsample) + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->upsample->start_pass) (cinfo); + if (cinfo->quantize_colors) + (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass); + (*cinfo->post->start_pass) (cinfo, + (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + } + } + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->pass_number + + (master->pub.is_dummy_pass ? 2 : 1); + /* In buffered-image mode, we assume one more output pass if EOI not + * yet reached, but no more passes if EOI has been reached. + */ + if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) { + cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1); + } + } +} + + +/* + * Finish up at end of an output pass. + */ + +METHODDEF(void) +finish_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (cinfo->quantize_colors) + (*cinfo->cquantize->finish_pass) (cinfo); + master->pass_number++; +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Switch to a new external colormap between output passes. + */ + +GLOBAL(void) +jpeg_new_colormap (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_BUFIMAGE) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (cinfo->quantize_colors && cinfo->enable_external_quant && + cinfo->colormap != NULL) { + /* Select 2-pass quantizer for external colormap use */ + cinfo->cquantize = master->quantizer_2pass; + /* Notify quantizer of colormap change */ + (*cinfo->cquantize->new_color_map) (cinfo); + master->pub.is_dummy_pass = FALSE; /* just in case */ + } else + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +/* + * Initialize master decompression control and select active modules. + * This is performed at the start of jpeg_start_decompress. + */ + +GLOBAL(void) +jinit_master_decompress (j_decompress_ptr cinfo) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_decomp_master)); + cinfo->master = (struct jpeg_decomp_master *) master; + master->pub.prepare_for_output_pass = prepare_for_output_pass; + master->pub.finish_output_pass = finish_output_pass; + + master->pub.is_dummy_pass = FALSE; + + master_selection(cinfo); +} diff --git a/dcmjpeg/libijg8/jdmerge.c b/dcmjpeg/libijg8/jdmerge.c new file mode 100644 index 00000000..1a74ca5e --- /dev/null +++ b/dcmjpeg/libijg8/jdmerge.c @@ -0,0 +1,400 @@ +/* + * jdmerge.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains code for merged upsampling/color conversion. + * + * This file combines functions from jdsample.c and jdcolor.c; + * read those files first to understand what's going on. + * + * When the chroma components are to be upsampled by simple replication + * (ie, box filtering), we can save some work in color conversion by + * calculating all the output pixels corresponding to a pair of chroma + * samples at one time. In the conversion equations + * R = Y + K1 * Cr + * G = Y + K2 * Cb + K3 * Cr + * B = Y + K4 * Cb + * only the Y term varies among the group of pixels corresponding to a pair + * of chroma samples, so the rest of the terms can be calculated just once. + * At typical sampling ratios, this eliminates half or three-quarters of the + * multiplications needed for color conversion. + * + * This file currently provides implementations for the following cases: + * YCbCr => RGB color conversion only. + * Sampling ratios of 2h1v or 2h2v. + * No scaling needed at upsample time. + * Corner-aligned (non-CCIR601) sampling alignment. + * Other special cases could be added, but in most applications these are + * the only common cases. (For uncommon cases we fall back on the more + * general code in jdsample.c and jdcolor.c.) + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + +#ifdef UPSAMPLE_MERGING_SUPPORTED + + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Pointer to routine to do actual upsampling/conversion of one row group */ + JMETHOD(void, upmethod, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf)); + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + IJG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + IJG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + + /* For 2:1 vertical sampling, we produce two output rows at a time. + * We need a "spare" row buffer to hold the second output row if the + * application provides just a one-row buffer; we also use the spare + * to discard the dummy last row if the image height is odd. + */ + JSAMPROW spare_row; + boolean spare_full; /* T if spare buffer is occupied */ + + JDIMENSION out_row_width; /* samples per output row */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((IJG_INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((IJG_INT32) ((x) * (1L<RGB colorspace conversion. + * This is taken directly from jdcolor.c; see that file for more info. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int i; + IJG_INT32 x; + SHIFT_TEMPS + + upsample->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cr_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + upsample->Cb_g_tab = (IJG_INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(IJG_INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + /* Cr=>R value is nearest int to 1.40200 * x */ + upsample->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + upsample->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -0.71414 * x */ + upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_merged_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the spare buffer empty */ + upsample->spare_full = FALSE; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * The control routine just handles the row buffering considerations. + */ + +METHODDEF(void) +merged_2v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 2:1 vertical sampling case: may need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPROW work_ptrs[2]; + JDIMENSION num_rows; /* number of rows returned to caller */ + + if (upsample->spare_full) { + /* If we have a spare row saved from a previous cycle, just return it. */ + jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0, + 1, upsample->out_row_width); + num_rows = 1; + upsample->spare_full = FALSE; + } else { + /* Figure number of rows to return to caller. */ + num_rows = 2; + /* Not more than the distance to the end of the image. */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + /* Create output pointer array for upsampler. */ + work_ptrs[0] = output_buf[*out_row_ctr]; + if (num_rows > 1) { + work_ptrs[1] = output_buf[*out_row_ctr + 1]; + } else { + work_ptrs[1] = upsample->spare_row; + upsample->spare_full = TRUE; + } + /* Now do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); + } + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (! upsample->spare_full) + (*in_row_group_ctr)++; +} + + +METHODDEF(void) +merged_1v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 1:1 vertical sampling case: much easier, never need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Just do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, + output_buf + *out_row_ctr); + /* Adjust counts */ + (*out_row_ctr)++; + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by the control routines to do + * the actual upsampling/conversion. One row group is processed per call. + * + * Note: since we may be writing directly into application-supplied buffers, + * we have to be honest about the output width; we can't assume the buffer + * has been rounded up to an even width. + */ + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. + */ + +METHODDEF(void) +h2v1_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr; + JSAMPROW inptr0, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + IJG_INT32 * Crgtab = upsample->Cr_g_tab; + IJG_INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr0 = input_buf[0][in_row_group_ctr]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr = output_buf[0]; + /* Loop for each pair of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 2 Y values and emit 2 pixels */ + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr0); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. + */ + +METHODDEF(void) +h2v2_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr0, outptr1; + JSAMPROW inptr00, inptr01, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + IJG_INT32 * Crgtab = upsample->Cr_g_tab; + IJG_INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr00 = input_buf[0][in_row_group_ctr*2]; + inptr01 = input_buf[0][in_row_group_ctr*2 + 1]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr0 = output_buf[0]; + outptr1 = output_buf[1]; + /* Loop for each group of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 4 Y values and emit 4 pixels */ + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr00); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + y = GETJSAMPLE(*inptr01); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Module initialization routine for merged upsampling/color conversion. + * + * NB: this is called under the conditions determined by use_merged_upsample() + * in jdmaster.c. That routine MUST correspond to the actual capabilities + * of this module; no safety checks are made here. + */ + +GLOBAL(void) +jinit_merged_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_merged_upsample; + upsample->pub.need_context_rows = FALSE; + + upsample->out_row_width = cinfo->output_width * (JDIMENSION)cinfo->out_color_components; + + if (cinfo->max_v_samp_factor == 2) { + upsample->pub.upsample = merged_2v_upsample; + upsample->upmethod = h2v2_merged_upsample; + /* Allocate a spare row buffer */ + upsample->spare_row = (JSAMPROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE))); + } else { + upsample->pub.upsample = merged_1v_upsample; + upsample->upmethod = h2v1_merged_upsample; + /* No spare row needed */ + upsample->spare_row = NULL; + } + + build_ycc_rgb_table(cinfo); +} + +#endif /* UPSAMPLE_MERGING_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jdphuff.c b/dcmjpeg/libijg8/jdphuff.c new file mode 100644 index 00000000..2dcfe773 --- /dev/null +++ b/dcmjpeg/libijg8/jdphuff.c @@ -0,0 +1,686 @@ +/* + * jdphuff.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for progressive JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy subsystem */ +#include "jdhuff8.h" /* Declarations shared with jd*huff.c */ + + +#ifdef D_PROGRESSIVE_SUPPORTED + +/* + * Private entropy decoder object for progressive Huffman decoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + unsigned int EOBRUN; /* remaining EOBs in EOBRUN */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).EOBRUN = (src).EOBRUN, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* These fields are loaded into local variables at start of each MCU. + * In case of suspension, we exit WITHOUT updating them. + */ + savable_state saved; /* Other state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */ +} phuff_entropy_decoder; + +typedef phuff_entropy_decoder * phuff_entropy_ptr; + +/* Forward declarations */ +METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_phuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + boolean is_DC_band, bad; + int ci, coefi, tbl; + int *coef_bit_ptr; + jpeg_component_info * compptr; + + is_DC_band = (cinfo->Ss == 0); + + /* Validate scan parameters */ + bad = FALSE; + if (is_DC_band) { + if (cinfo->Se != 0) + bad = TRUE; + } else { + /* need not check Ss/Se < 0 since they came from unsigned bytes */ + if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2) + bad = TRUE; + /* AC scans may have only one component */ + if (cinfo->comps_in_scan != 1) + bad = TRUE; + } + if (cinfo->Ah != 0) { + /* Successive approximation refinement scan: must have Al = Ah-1. */ + if (cinfo->Al != cinfo->Ah-1) + bad = TRUE; + } + if (cinfo->Al > 13) /* need not check for < 0 */ + bad = TRUE; + /* Arguably the maximum Al value should be less than 13 for 8-bit precision, + * but the spec doesn't say so, and we try to be liberal about what we + * accept. Note: large Al values could result in out-of-range DC + * coefficients during early scans, leading to bizarre displays due to + * overflows in the IDCT math. But we won't crash. + */ + if (bad) + ERREXIT4(cinfo, JERR_BAD_PROGRESSION, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + /* Update progression status, and verify that scan order is legal. + * Note that inter-scan inconsistencies are treated as warnings + * not fatal errors ... not clear if this is right way to behave. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + int cindex = cinfo->cur_comp_info[ci]->component_index; + coef_bit_ptr = & cinfo->coef_bits[cindex][0]; + if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */ + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0); + for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) { + int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi]; + if (cinfo->Ah != expected) + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi); + coef_bit_ptr[coefi] = cinfo->Al; + } + } + + /* Select MCU decoding routine */ + if (cinfo->Ah == 0) { + if (is_DC_band) + lossyd->entropy_decode_mcu = decode_mcu_DC_first; + else + lossyd->entropy_decode_mcu = decode_mcu_AC_first; + } else { + if (is_DC_band) + lossyd->entropy_decode_mcu = decode_mcu_DC_refine; + else + lossyd->entropy_decode_mcu = decode_mcu_AC_refine; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Make sure requested tables are present, and compute derived tables. + * We may build same derived table more than once, but it's not expensive. + */ + if (is_DC_band) { + if (cinfo->Ah == 0) { /* DC refinement needs no table */ + tbl = compptr->dc_tbl_no; + jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, + & entropy->derived_tbls[tbl]); + } + } else { + tbl = compptr->ac_tbl_no; + jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, + & entropy->derived_tbls[tbl]); + /* remember the single active table */ + entropy->ac_derived_tbl = entropy->derived_tbls[tbl]; + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; + + /* Initialize private state variables */ + entropy->saved.EOBRUN = 0; + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +LOCAL(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int ci; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)(entropy->bitstate.bits_left / 8); + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Re-init EOB run count, too */ + entropy->saved.EOBRUN = 0; + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Huffman MCU decoding. + * Each of these routines decodes and returns one MCU's worth of + * Huffman-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER. + * + * We return FALSE if data source requested suspension. In that case no + * changes have been made to permanent state. (Exception: some output + * coefficients may already have been assigned. This is harmless for + * spectral selection, since we'll just re-assign them on the next call. + * Successive approximation AC refinement has to be more careful, however.) + */ + +/* + * MCU decoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Al = cinfo->Al; + register int s, r; + int blkn, ci; + JBLOCKROW block; + BITREAD_STATE_VARS; + savable_state state; + d_derived_tbl * tbl; + jpeg_component_info * compptr; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + tbl = entropy->derived_tbls[compptr->dc_tbl_no]; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + HUFF_DECODE(s, br_state, tbl, return FALSE, label1); + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + + /* Convert DC difference to actual value, update last_dc_val */ + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */ + (*block)[0] = (JCOEF) (s << Al); + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Se = cinfo->Se; + int Al = cinfo->Al; + register int s, k, r; + unsigned int EOBRUN; + JBLOCKROW block; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state. + * We can avoid loading/saving bitread state if in an EOB run. + */ + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + + if (EOBRUN > 0) /* if it's a band of zeroes... */ + EOBRUN--; /* ...process it now (we do nothing) */ + else { + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + for (k = cinfo->Ss; k <= Se; k++) { + HUFF_DECODE(s, br_state, tbl, return FALSE, label2); + r = s >> 4; + s &= 15; + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Scale and output coefficient in natural (dezigzagged) order */ + (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al); + } else { + if (r == 15) { /* ZRL */ + k += 15; /* skip 15 zeroes in band */ + } else { /* EOBr, run length is 2^r + appended bits */ + EOBRUN = (unsigned int)(1 << r); + if (r) { /* EOBr, r > 0 */ + CHECK_BIT_BUFFER(br_state, r, return FALSE); + r = GET_BITS(r); + EOBRUN += (unsigned int)r; + } + EOBRUN--; /* this band is processed at this moment */ + break; /* force end-of-band */ + } + } + } + + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + } + + /* Completed MCU, so update state */ + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + int blkn; + JBLOCKROW block; + BITREAD_STATE_VARS; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* Not worth the cycles to check insufficient_data here, + * since we will not change the data anyway if we read zeroes. + */ + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* Encoded data is simply the next bit of the two's-complement DC value */ + CHECK_BIT_BUFFER(br_state, 1, return FALSE); + if (GET_BITS(1)) + (*block)[0] |= (JCOEF)p1; + /* Note: since we use |=, repeating the assignment later is safe */ + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private; + int Se = cinfo->Se; + int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + + /* Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ + int m1 = (int)((~0U) << cinfo->Al); /* -1 in the bit position being coded */ + + register int s, k, r; + unsigned int EOBRUN; + JBLOCKROW block; + JCOEFPTR thiscoef; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + int num_newnz; + int newnz_pos[DCTSIZE2]; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, don't modify the MCU. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + /* If we are forced to suspend, we must undo the assignments to any newly + * nonzero coefficients in the block, because otherwise we'd get confused + * next time about which coefficients were already nonzero. + * But we need not undo addition of bits to already-nonzero coefficients; + * instead, we can test the current bit to see if we already did it. + */ + num_newnz = 0; + + /* initialize coefficient loop counter to start of band */ + k = cinfo->Ss; + + if (EOBRUN == 0) { + for (; k <= Se; k++) { + HUFF_DECODE(s, br_state, tbl, goto undoit, label3); + r = s >> 4; + s &= 15; + if (s) { + if (s != 1) /* size of new coef should always be 1 */ + WARNMS(cinfo, JWRN_HUFF_BAD_CODE); + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) + s = p1; /* newly nonzero coef is positive */ + else + s = m1; /* newly nonzero coef is negative */ + } else { + if (r != 15) { + EOBRUN = (unsigned int)(1 << r); /* EOBr, run length is 2^r + appended bits */ + if (r) { + CHECK_BIT_BUFFER(br_state, r, goto undoit); + r = GET_BITS(r); + EOBRUN += (unsigned int)r; + } + break; /* rest of block is handled by EOB logic */ + } + /* note s = 0 for processing ZRL */ + } + /* Advance over already-nonzero coefs and r still-zero coefs, + * appending correction bits to the nonzeroes. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + do { + thiscoef = *block + jpeg_natural_order[k]; + if (*thiscoef != 0) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already set it */ + if (*thiscoef >= 0) + *thiscoef = (JCOEF)(*thiscoef + p1); + else + *thiscoef = (JCOEF)(*thiscoef + m1); + } + } + } else { + if (--r < 0) + break; /* reached target zero coefficient */ + } + k++; + } while (k <= Se); + if (s) { + int pos = jpeg_natural_order[k]; + /* Output newly nonzero coefficient */ + (*block)[pos] = (JCOEF) s; + /* Remember its position in case we have to suspend */ + newnz_pos[num_newnz++] = pos; + } + } + } + + if (EOBRUN > 0) { + /* Scan any remaining coefficient positions after the end-of-band + * (the last newly nonzero coefficient, if any). Append a correction + * bit to each already-nonzero coefficient. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + for (; k <= Se; k++) { + thiscoef = *block + jpeg_natural_order[k]; + if (*thiscoef != 0) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */ + if (*thiscoef >= 0) + *thiscoef = (JCOEF)(*thiscoef + p1); + else + *thiscoef = (JCOEF)(*thiscoef + m1); + } + } + } + } + /* Count one block completed in EOB run */ + EOBRUN--; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; + +undoit: + /* Re-zero any output coefficients that we made newly nonzero */ + while (num_newnz > 0) + (*block)[newnz_pos[--num_newnz]] = 0; + + return FALSE; +} + + +/* + * Module initialization routine for progressive Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_phuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + phuff_entropy_ptr entropy; + int *coef_bit_ptr; + int ci, i; + + entropy = (phuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(phuff_entropy_decoder)); + lossyd->entropy_private = (void *) entropy; + lossyd->entropy_start_pass = start_pass_phuff_decoder; + + /* Mark derived tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + } + + /* Create progression status table */ + cinfo->coef_bits = (int (*)[DCTSIZE2]) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t)cinfo->num_components*DCTSIZE2*SIZEOF(int)); + coef_bit_ptr = & cinfo->coef_bits[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (i = 0; i < DCTSIZE2; i++) + *coef_bit_ptr++ = -1; +} + +#endif /* D_PROGRESSIVE_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jdpostct.c b/dcmjpeg/libijg8/jdpostct.c new file mode 100644 index 00000000..2804cbb1 --- /dev/null +++ b/dcmjpeg/libijg8/jdpostct.c @@ -0,0 +1,290 @@ +/* + * jdpostct.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the decompression postprocessing controller. + * This controller manages the upsampling, color conversion, and color + * quantization/reduction steps; specifically, it controls the buffering + * between upsample/color conversion and color quantization/reduction. + * + * If no color quantization/reduction is required, then this module has no + * work to do, and it just hands off to the upsample/color conversion code. + * An integrated upsample/convert/quantize process would replace this module + * entirely. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_post_controller pub; /* public fields */ + + /* Color quantization source buffer: this holds output data from + * the upsample/color conversion step to be passed to the quantizer. + * For two-pass color quantization, we need a full-image buffer; + * for one-pass operation, a strip buffer is sufficient. + */ + jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */ + JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */ + JDIMENSION strip_height; /* buffer size in rows */ + /* for two-pass mode only: */ + JDIMENSION starting_row; /* row # of first row in current strip */ + JDIMENSION next_row; /* index of next row to fill/empty in strip */ +} my_post_controller; + +typedef my_post_controller * my_post_ptr; + + +/* Forward declarations */ +METHODDEF(void) post_process_1pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) post_process_prepass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +METHODDEF(void) post_process_2pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->quantize_colors) { + /* Single-pass processing with color quantization. */ + post->pub.post_process_data = post_process_1pass; + /* We could be doing buffered-image output before starting a 2-pass + * color quantization; in that case, jinit_d_post_controller did not + * allocate a strip buffer. Use the virtual-array buffer as workspace. + */ + if (post->buffer == NULL) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + (JDIMENSION) 0, post->strip_height, TRUE); + } + } else { + /* For single-pass processing without color quantization, + * I have no work to do; just call the upsampler directly. + */ + post->pub.post_process_data = cinfo->upsample->upsample; + } + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_SAVE_AND_PASS: + /* First pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_prepass; + break; + case JBUF_CRANK_DEST: + /* Second pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_2pass; + break; +#endif /* QUANT_2PASS_SUPPORTED */ + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } + post->starting_row = post->next_row = 0; +} + + +/* + * Process some data in the one-pass (strip buffer) case. + * This is used for color precision reduction as well as one-pass quantization. + */ + +METHODDEF(void) +post_process_1pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Fill the buffer, but not more than what we can dump out in one go. */ + /* Note we rely on the upsampler to detect bottom of image. */ + max_rows = out_rows_avail - *out_row_ctr; + if (max_rows > post->strip_height) + max_rows = post->strip_height; + num_rows = 0; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &num_rows, max_rows); + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer, output_buf + *out_row_ctr, (int) num_rows); + *out_row_ctr += num_rows; +} + + +#ifdef QUANT_2PASS_SUPPORTED + +/* + * Process some data in the first pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_prepass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION old_next_row, num_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, TRUE); + } + + /* Upsample some data (up to a strip height's worth). */ + old_next_row = post->next_row; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &post->next_row, post->strip_height); + + /* Allow quantizer to scan new data. No data is emitted, */ + /* but we advance out_row_ctr so outer loop can tell when we're done. */ + if (post->next_row > old_next_row) { + num_rows = post->next_row - old_next_row; + (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row, + (JSAMPARRAY) NULL, (int) num_rows); + *out_row_ctr += num_rows; + } + + /* Advance if we filled the strip. */ + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + + +/* + * Process some data in the second pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_2pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, FALSE); + } + + /* Determine number of rows to emit. */ + num_rows = post->strip_height - post->next_row; /* available in strip */ + max_rows = out_rows_avail - *out_row_ctr; /* available in output area */ + if (num_rows > max_rows) + num_rows = max_rows; + /* We have to check bottom of image here, can't depend on upsampler. */ + max_rows = cinfo->output_height - post->starting_row; + if (num_rows > max_rows) + num_rows = max_rows; + + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer + post->next_row, output_buf + *out_row_ctr, + (int) num_rows); + *out_row_ctr += num_rows; + + /* Advance if we filled the strip. */ + post->next_row += num_rows; + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize postprocessing controller. + */ + +GLOBAL(void) +jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_post_ptr post; + + post = (my_post_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_post_controller)); + cinfo->post = (struct jpeg_d_post_controller *) post; + post->pub.start_pass = start_pass_dpost; + post->whole_image = NULL; /* flag for no virtual arrays */ + post->buffer = NULL; /* flag for no strip buffer */ + + /* Create the quantization buffer, if needed */ + if (cinfo->quantize_colors) { + /* The buffer strip height is max_v_samp_factor, which is typically + * an efficient number of rows for upsampling to return. + * (In the presence of output rescaling, we might want to be smarter?) + */ + post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor; + if (need_full_buffer) { + /* Two-pass color quantization: need full-image storage. */ + /* We round up the number of rows to a multiple of the strip height. */ +#ifdef QUANT_2PASS_SUPPORTED + post->whole_image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + cinfo->output_width * (JDIMENSION)cinfo->out_color_components, + (JDIMENSION) jround_up((long) cinfo->output_height, + (long) post->strip_height), + post->strip_height); +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + /* One-pass color quantization: just make a strip buffer. */ + post->buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width * (JDIMENSION)cinfo->out_color_components, + post->strip_height); + } + } +} diff --git a/dcmjpeg/libijg8/jdpred.c b/dcmjpeg/libijg8/jdpred.c new file mode 100644 index 00000000..a4f336da --- /dev/null +++ b/dcmjpeg/libijg8/jdpred.c @@ -0,0 +1,263 @@ +/* + * jdpred.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample undifferencing (reconstruction) for lossless JPEG. + * + * In order to avoid paying the performance penalty of having to check the + * predictor being used and the row being processed for each call of the + * undifferencer, and to promote optimization, we have separate undifferencing + * functions for each case. + * + * We are able to avoid duplicating source code by implementing the predictors + * and undifferencers as macros. Each of the undifferencing functions are + * simply wrappers around an UNDIFFERENCE macro with the appropriate PREDICTOR + * macro passed as an argument. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" /* Private declarations for lossless codec */ + + +#ifdef D_LOSSLESS_SUPPORTED + +/* Predictor for the first column of the first row: 2^(P-Pt-1) */ +#define INITIAL_PREDICTORx (1 << (cinfo->data_precision - cinfo->Al - 1)) + +/* Predictor for the first column of the remaining rows: Rb */ +#define INITIAL_PREDICTOR2 GETJSAMPLE(prev_row[0]) + + +/* + * 1-Dimensional undifferencer routine. + * + * This macro implements the 1-D horizontal predictor (1). INITIAL_PREDICTOR + * is used as the special case predictor for the first column, which must be + * either INITIAL_PREDICTOR2 or INITIAL_PREDICTORx. The remaining samples + * use PREDICTOR1. + * + * The reconstructed sample is supposed to be calculated modulo 2^16, so we + * logically AND the result with 0xFFFF. +*/ + +#define UNDIFFERENCE_1D(INITIAL_PREDICTOR) \ + unsigned int xindex; \ + int Ra; \ + \ + Ra = (diff_buf[0] + INITIAL_PREDICTOR) & 0xFFFF; \ + undiff_buf[0] = Ra; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Ra = (diff_buf[xindex] + PREDICTOR1) & 0xFFFF; \ + undiff_buf[xindex] = Ra; \ + } + +/* + * 2-Dimensional undifferencer routine. + * + * This macro implements the 2-D horizontal predictors (#2-7). PREDICTOR2 is + * used as the special case predictor for the first column. The remaining + * samples use PREDICTOR, which is a function of Ra, Rb, Rc. + * + * Because prev_row and output_buf may point to the same storage area (in an + * interleaved image with Vi=1, for example), we must take care to buffer Rb/Rc + * before writing the current reconstructed sample value into output_buf. + * + * The reconstructed sample is supposed to be calculated modulo 2^16, so we + * logically AND the result with 0xFFFF. + */ + +#define UNDIFFERENCE_2D(PREDICTOR) \ + unsigned int xindex; \ + int Ra, Rb, Rc; \ + \ + Rb = GETJSAMPLE(prev_row[0]); \ + Ra = (diff_buf[0] + PREDICTOR2) & 0xFFFF; \ + undiff_buf[0] = Ra; \ + \ + for (xindex = 1; xindex < width; xindex++) { \ + Rc = Rb; \ + Rb = GETJSAMPLE(prev_row[xindex]); \ + Ra = (diff_buf[xindex] + PREDICTOR) & 0xFFFF; \ + undiff_buf[xindex] = Ra; \ + } + +#define JPEG_UNUSED(x) ((void)x) + +/* + * Undifferencers for the all rows but the first in a scan or restart interval. + * The first sample in the row is undifferenced using the vertical + * predictor (2). The rest of the samples are undifferenced using the + * predictor specified in the scan header. + */ + +METHODDEF(void) +jpeg_undifference1(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_1D(INITIAL_PREDICTOR2); +} + +METHODDEF(void) +jpeg_undifference2(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR2); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference3(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR3); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference4(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + UNDIFFERENCE_2D(PREDICTOR4); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference5(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR5); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference6(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR6); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + +METHODDEF(void) +jpeg_undifference7(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, const JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + SHIFT_TEMPS + UNDIFFERENCE_2D(PREDICTOR7); + JPEG_UNUSED(Rc); + JPEG_UNUSED(Rb); +} + + +/* + * Undifferencer for the first row in a scan or restart interval. The first + * sample in the row is undifferenced using the special predictor constant + * x=2^(P-Pt-1). The rest of the samples are undifferenced using the + * 1-D horizontal predictor (1). + */ + +METHODDEF(void) +jpeg_undifference_first_row(j_decompress_ptr cinfo, int comp_index, + const JDIFFROW diff_buf, JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + UNDIFFERENCE_1D(INITIAL_PREDICTORx); + + /* + * Now that we have undifferenced the first row, we want to use the + * undifferencer which corresponds to the predictor specified in the + * scan header. + */ + switch (cinfo->Ss) { + case 1: + losslsd->predict_undifference[comp_index] = jpeg_undifference1; + break; + case 2: + losslsd->predict_undifference[comp_index] = jpeg_undifference2; + break; + case 3: + losslsd->predict_undifference[comp_index] = jpeg_undifference3; + break; + case 4: + losslsd->predict_undifference[comp_index] = jpeg_undifference4; + break; + case 5: + losslsd->predict_undifference[comp_index] = jpeg_undifference5; + break; + case 6: + losslsd->predict_undifference[comp_index] = jpeg_undifference6; + break; + case 7: + losslsd->predict_undifference[comp_index] = jpeg_undifference7; + break; + } +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +predict_start_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + int ci; + + /* Check that the scan parameters Ss, Se, Ah, Al are OK for lossless JPEG. + * + * Ss is the predictor selection value (psv). Legal values for sequential + * lossless JPEG are: 1 <= psv <= 7. + * + * Se and Ah are not used and should be zero. + * + * Al specifies the point transform (Pt). Legal values are: 0 <= Pt <= 15. + */ + if (cinfo->Ss < 1 || cinfo->Ss > 7 || + cinfo->Se != 0 || cinfo->Ah != 0 || + cinfo->Al > 15) /* need not check for < 0 */ + ERREXIT4(cinfo, JERR_BAD_LOSSLESS, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + + /* Set undifference functions to first row function */ + for (ci = 0; ci < cinfo->num_components; ci++) + losslsd->predict_undifference[ci] = jpeg_undifference_first_row; +} + + +/* + * Module initialization routine for the undifferencer. + */ + +GLOBAL(void) +jinit_undifferencer (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + + losslsd->predict_start_pass = predict_start_pass; + losslsd->predict_process_restart = predict_start_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg8/jdsample.c b/dcmjpeg/libijg8/jdsample.c new file mode 100644 index 00000000..024f2966 --- /dev/null +++ b/dcmjpeg/libijg8/jdsample.c @@ -0,0 +1,478 @@ +/* + * jdsample.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains upsampling routines. + * + * Upsampling input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * codec_data_unit / min_codec_data_unit) + * sample rows of each component. Upsampling will normally produce + * max_v_samp_factor pixel rows from each row group (but this could vary + * if the upsampler is applying a scale factor of its own). + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* Pointer to routine to upsample a single component */ +typedef JMETHOD(void, upsample1_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Color conversion buffer. When using separate upsampling and color + * conversion steps, this buffer holds one upsampled row group until it + * has been color converted and output. + * Note: we do not allocate any storage for component(s) which are full-size, + * ie do not need rescaling. The corresponding entry of color_buf[] is + * simply set to point to the input data array, thereby avoiding copying. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + /* Per-component upsampling method pointers */ + upsample1_ptr methods[MAX_COMPONENTS]; + + int next_row_out; /* counts rows emitted from color_buf */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ + + /* Height of an input row group for each component. */ + int rowgroup_height[MAX_COMPONENTS]; + + /* These arrays save pixel expansion factors so that int_expand need not + * recompute them each time. They are unused for other upsampling methods. + */ + UINT8 h_expand[MAX_COMPONENTS]; + UINT8 v_expand[MAX_COMPONENTS]; +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the conversion buffer empty */ + upsample->next_row_out = cinfo->max_v_samp_factor; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * In this version we upsample each component independently. + * We upsample one row group into the conversion buffer, then apply + * color conversion a row at a time. + */ + +METHODDEF(void) +sep_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int ci; + jpeg_component_info * compptr; + JDIMENSION num_rows; + + /* Fill the conversion buffer, if it's empty */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Invoke per-component upsample method. Notice we pass a POINTER + * to color_buf[ci], so that fullsize_upsample can change it. + */ + (*upsample->methods[ci]) (cinfo, compptr, + input_buf[ci] + (*in_row_group_ctr * (JDIMENSION)upsample->rowgroup_height[ci]), + upsample->color_buf + ci); + } + upsample->next_row_out = 0; + } + + /* Color-convert and emit rows */ + + /* How many we have in the buffer: */ + num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out); + /* Not more than the distance to the end of the image. Need this test + * in case the image height is not a multiple of max_v_samp_factor: + */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + + (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf, + (JDIMENSION) upsample->next_row_out, + output_buf + *out_row_ctr, + (int) num_rows); + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + upsample->next_row_out += (int)num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by sep_upsample to upsample pixel values + * of a single component. One row group is processed per call. + */ + + +/* + * For full-size components, we just make color_buf[ci] point at the + * input buffer, and thus avoid copying any data. Note that this is + * safe only because sep_upsample doesn't declare the input row group + * "consumed" until we are done color converting and emitting it. + */ + +METHODDEF(void) +fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = input_data; +} + + +/* + * This is a no-op version used for "uninteresting" components. + * These components will not be referenced by color conversion. + */ + +METHODDEF(void) +noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = NULL; /* safety check */ +} + + +/* + * This version handles any integral sampling ratios. + * This is not used for typical JPEG files, so it need not be fast. + * Nor, for that matter, is it particularly accurate: the algorithm is + * simple replication of the input pixel onto the corresponding output + * pixels. The hi-falutin sampling literature refers to this as a + * "box filter". A box filter tends to introduce visible artifacts, + * so if you are actually going to use 3:1 or 4:1 sampling ratios + * you would be well advised to improve this code. + */ + +METHODDEF(void) +int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + register int h; + JSAMPROW outend; + int h_expand, v_expand; + int inrow, outrow; + + h_expand = upsample->h_expand[compptr->component_index]; + v_expand = upsample->v_expand[compptr->component_index]; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + /* Generate one output row with proper horizontal expansion */ + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + for (h = h_expand; h > 0; h--) { + *outptr++ = invalue; + } + } + /* Generate any additional output rows by duplicating the first one */ + if (v_expand > 1) { + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + v_expand-1, cinfo->output_width); + } + inrow++; + outrow += v_expand; + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 1:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int inrow; + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 2:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int inrow, outrow; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + 1, cinfo->output_width); + inrow++; + outrow += 2; + } +} + + +/* + * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical. + * + * The upsampling algorithm is linear interpolation between pixel centers, + * also known as a "triangle filter". This is a good compromise between + * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 + * of the way between input pixel centers. + * + * A note about the "bias" calculations: when rounding fractional values to + * integer, we do not want to always round 0.5 up to the next integer. + * If we did that, we'd introduce a noticeable bias towards larger values. + * Instead, this code is arranged so that 0.5 will be rounded up or down at + * alternate pixel locations (a simple ordered dither pattern). + */ + +METHODDEF(void) +h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register int invalue; + register JDIMENSION colctr; + int inrow; + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + /* Special case for first column */ + invalue = GETJSAMPLE(*inptr++); + *outptr++ = (JSAMPLE) invalue; + *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2); + + for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { + /* General case: 3/4 * nearer pixel + 1/4 * further pixel */ + invalue = GETJSAMPLE(*inptr++) * 3; + *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2); + *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2); + } + + /* Special case for last column */ + invalue = GETJSAMPLE(*inptr); + *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2); + *outptr++ = (JSAMPLE) invalue; + } +} + + +/* + * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical. + * Again a triangle filter; see comments for h2v1 case, above. + * + * It is OK for us to reference the adjacent input rows because we demanded + * context from the main buffer controller (see initialization code). + */ + +METHODDEF(void) +h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr0, inptr1, outptr; +#if BITS_IN_JSAMPLE == 8 + register int thiscolsum, lastcolsum, nextcolsum; +#else + register IJG_INT32 thiscolsum, lastcolsum, nextcolsum; +#endif + register JDIMENSION colctr; + int inrow, outrow, v; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + for (v = 0; v < 2; v++) { + /* inptr0 points to nearest input row, inptr1 points to next nearest */ + inptr0 = input_data[inrow]; + if (v == 0) /* next nearest is row above */ + inptr1 = input_data[inrow-1]; + else /* next nearest is row below */ + inptr1 = input_data[inrow+1]; + outptr = output_data[outrow++]; + + /* Special case for first column */ + thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); + lastcolsum = thiscolsum; thiscolsum = nextcolsum; + + for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { + /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */ + /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */ + nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); + lastcolsum = thiscolsum; thiscolsum = nextcolsum; + } + + /* Special case for last column */ + *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); + *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4); + } + inrow++; + } +} + + +/* + * Module initialization routine for upsampling. + */ + +GLOBAL(void) +jinit_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + int ci; + jpeg_component_info * compptr; + boolean need_buffer, do_fancy; + int h_in_group, v_in_group, h_out_group, v_out_group; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_upsample; + upsample->pub.upsample = sep_upsample; + upsample->pub.need_context_rows = FALSE; /* until we find out differently */ + + if (cinfo->CCIR601_sampling) /* this isn't supported */ + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* jdmainct.c doesn't support context rows when min_codec_data_unit = 1, + * so don't ask for it. + */ + do_fancy = cinfo->do_fancy_upsampling && cinfo->min_codec_data_unit > 1; + + /* Verify we can handle the sampling factors, select per-component methods, + * and create storage as needed. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Compute size of an "input group" after IDCT scaling. This many samples + * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. + */ + h_in_group = (compptr->h_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; + v_in_group = (compptr->v_samp_factor * compptr->codec_data_unit) / + cinfo->min_codec_data_unit; + h_out_group = cinfo->max_h_samp_factor; + v_out_group = cinfo->max_v_samp_factor; + upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ + need_buffer = TRUE; + if (! compptr->component_needed) { + /* Don't bother to upsample an uninteresting component. */ + upsample->methods[ci] = noop_upsample; + need_buffer = FALSE; + } else if (h_in_group == h_out_group && v_in_group == v_out_group) { + /* Fullsize components can be processed without any work. */ + upsample->methods[ci] = fullsize_upsample; + need_buffer = FALSE; + } else if (h_in_group * 2 == h_out_group && + v_in_group == v_out_group) { + /* Special cases for 2h1v upsampling */ + if (do_fancy && compptr->downsampled_width > 2) + upsample->methods[ci] = h2v1_fancy_upsample; + else + upsample->methods[ci] = h2v1_upsample; + } else if (h_in_group * 2 == h_out_group && + v_in_group * 2 == v_out_group) { + /* Special cases for 2h2v upsampling */ + if (do_fancy && compptr->downsampled_width > 2) { + upsample->methods[ci] = h2v2_fancy_upsample; + upsample->pub.need_context_rows = TRUE; + } else + upsample->methods[ci] = h2v2_upsample; + } else if ((h_out_group % h_in_group) == 0 && + (v_out_group % v_in_group) == 0) { + /* Generic integral-factors upsampling method */ + upsample->methods[ci] = int_upsample; + upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); + upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + if (need_buffer) { + upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) cinfo->output_width, + (long) cinfo->max_h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/dcmjpeg/libijg8/jdscale.c b/dcmjpeg/libijg8/jdscale.c new file mode 100644 index 00000000..a83f7d16 --- /dev/null +++ b/dcmjpeg/libijg8/jdscale.c @@ -0,0 +1,119 @@ +/* + * jdscale.c + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains sample scaling for lossless JPEG. This is a + * combination of upscaling the undifferenced sample by 2^Pt and downscaling + * the sample to fit into JSAMPLE. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossls8.h" /* Private declarations for lossless codec */ + + +#ifdef D_LOSSLESS_SUPPORTED + +/* + * Private scaler object for lossless decoding. + */ + +typedef struct { + int scale_factor; +} scaler; + +typedef scaler * scaler_ptr; + + +/* + * Scalers for packing sample differences into JSAMPLEs. + */ + +METHODDEF(void) +simple_upscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int scale_factor = scale->scale_factor; + unsigned int xindex; + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) (diff_buf[xindex] << scale_factor); +} + +METHODDEF(void) +simple_downscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int scale_factor = scale->scale_factor; + unsigned int xindex; + SHIFT_TEMPS + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) RIGHT_SHIFT(diff_buf[xindex], scale_factor); +} + +METHODDEF(void) +noscale(j_decompress_ptr cinfo, + const JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width) +{ + unsigned int xindex; + + for (xindex = 0; xindex < width; xindex++) + output_buf[xindex] = (JSAMPLE) diff_buf[xindex]; +} + + +METHODDEF(void) +scaler_start_pass (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale = (scaler_ptr) losslsd->scaler_private; + int downscale; + + /* + * Downscale by the difference in the input vs. output precision. If the + * output precision >= input precision, then do not downscale. + */ + downscale = BITS_IN_JSAMPLE < cinfo->data_precision ? + cinfo->data_precision - BITS_IN_JSAMPLE : 0; + + scale->scale_factor = cinfo->Al - downscale; + + /* Set scaler functions based on scale_factor (positive = left shift) */ + if (scale->scale_factor > 0) + losslsd->scaler_scale = simple_upscale; + else if (scale->scale_factor < 0) { + scale->scale_factor = -scale->scale_factor; + losslsd->scaler_scale = simple_downscale; + } + else + losslsd->scaler_scale = noscale; +} + + +GLOBAL(void) +jinit_d_scaler (j_decompress_ptr cinfo) +{ + j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec; + scaler_ptr scale; + + scale = (scaler_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(scaler)); + losslsd->scaler_private = (void *) scale; + losslsd->scaler_start_pass = scaler_start_pass; +} + +#endif /* D_LOSSLESS_SUPPORTED */ + diff --git a/dcmjpeg/libijg8/jdshuff.c b/dcmjpeg/libijg8/jdshuff.c new file mode 100644 index 00000000..efb207b1 --- /dev/null +++ b/dcmjpeg/libijg8/jdshuff.c @@ -0,0 +1,365 @@ +/* + * jdshuff.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines for sequential JPEG. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" /* Private declarations for lossy codec */ +#include "jdhuff8.h" /* Declarations shared with jd*huff.c */ + + +/* + * Private entropy decoder object for Huffman decoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + huffd_common_fields; /* Fields shared with other entropy decoders */ + + /* These fields are loaded into local variables at start of each MCU. + * In case of suspension, we exit WITHOUT updating them. + */ + savable_state saved; /* Other state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + + /* Precalculated info set up by start_pass for use in decode_mcu: */ + + /* Pointers to derived tables to be used for each block within an MCU */ + d_derived_tbl * dc_cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + d_derived_tbl * ac_cur_tbls[D_MAX_DATA_UNITS_IN_MCU]; + /* Whether we care about the DC and AC coefficient values for each block */ + boolean dc_needed[D_MAX_DATA_UNITS_IN_MCU]; + boolean ac_needed[D_MAX_DATA_UNITS_IN_MCU]; +} shuff_entropy_decoder; + +typedef shuff_entropy_decoder * shuff_entropy_ptr; + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_huff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int ci, blkn, dctbl, actbl; + jpeg_component_info * compptr; + + /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. + * This ought to be an error condition, but we make it a warning because + * there are some baseline files out there with all zeroes in these bytes. + */ + if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 || + cinfo->Ah != 0 || cinfo->Al != 0) + WARNMS(cinfo, JWRN_NOT_SEQUENTIAL); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + dctbl = compptr->dc_tbl_no; + actbl = compptr->ac_tbl_no; + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, + & entropy->dc_derived_tbls[dctbl]); + jpeg_make_d_derived_tbl(cinfo, FALSE, actbl, + & entropy->ac_derived_tbls[actbl]); + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Precalculate decoding info for each block in an MCU of this scan */ + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + /* Precalculate which table to use for each block */ + entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no]; + entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no]; + /* Decide whether we really care about the coefficient values */ + if (compptr->component_needed) { + entropy->dc_needed[blkn] = TRUE; + /* we don't need the ACs if producing a 1/8th-size image */ + entropy->ac_needed[blkn] = (compptr->codec_data_unit > 1); + } else { + entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE; + } + } + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and add will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) + +#else + +#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) + +static const int extend_test[16] = /* entry n is 2**(n-1) */ + { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; + +/* + * Originally, a -1 was shifted but since shifting a negative value is + * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used, + * shifted and casted to an int. The result is the same, of course. + */ +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ + { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1, + (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1, + (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1, + (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 }; + +#endif /* AVOID_TABLES */ + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +LOCAL(boolean) +process_restart (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int ci; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += (unsigned int)(entropy->bitstate.bits_left / 8); + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Decode and return one MCU's worth of Huffman-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER. + * (Wholesale zeroing is usually a little faster than retail...) + * + * Returns FALSE if data source requested suspension. In that case no + * changes have been made to permanent state. (Exception: some output + * coefficients may already have been assigned. This is harmless for + * this module, since we'll just re-assign them on the next call.) + */ + +METHODDEF(boolean) +decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy = (shuff_entropy_ptr) lossyd->entropy_private; + int blkn; + BITREAD_STATE_VARS; + savable_state state; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) { + JBLOCKROW block = MCU_data[blkn]; + d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; + d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; + register int s, k, r; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + HUFF_DECODE(s, br_state, dctbl, return FALSE, label1); + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + + if (entropy->dc_needed[blkn]) { + /* Convert DC difference to actual value, update last_dc_val */ + int ci = cinfo->MCU_membership[blkn]; + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */ + (*block)[0] = (JCOEF) s; + } + + if (entropy->ac_needed[blkn]) { + + /* Section F.2.2.2: decode the AC coefficients */ + /* Since zeroes are skipped, output area must be cleared beforehand */ + for (k = 1; k < DCTSIZE2; k++) { + HUFF_DECODE(s, br_state, actbl, return FALSE, label2); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Output coefficient in natural (dezigzagged) order. + * Note: the extra entries in jpeg_natural_order[] will save us + * if k >= DCTSIZE2, which could happen if the data is corrupted. + */ + (*block)[jpeg_natural_order[k]] = (JCOEF) s; + } else { + if (r != 15) + break; + k += 15; + } + } + + } else { + + /* Section F.2.2.2: decode the AC coefficients */ + /* In this path we just discard the values */ + for (k = 1; k < DCTSIZE2; k++) { + HUFF_DECODE(s, br_state, actbl, return FALSE, label3); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + DROP_BITS(s); + } else { + if (r != 15) + break; + k += 15; + } + } + + } + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * Module initialization routine for Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_shuff_decoder (j_decompress_ptr cinfo) +{ + j_lossy_d_ptr lossyd = (j_lossy_d_ptr) cinfo->codec; + shuff_entropy_ptr entropy; + int i; + + entropy = (shuff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(shuff_entropy_decoder)); + lossyd->entropy_private = (void *) entropy; + lossyd->entropy_start_pass = start_pass_huff_decoder; + lossyd->entropy_decode_mcu = decode_mcu; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; + } +} diff --git a/dcmjpeg/libijg8/jdtrans.c b/dcmjpeg/libijg8/jdtrans.c new file mode 100644 index 00000000..53e603f8 --- /dev/null +++ b/dcmjpeg/libijg8/jdtrans.c @@ -0,0 +1,138 @@ +/* + * jdtrans.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding decompression, + * that is, reading raw DCT coefficient arrays from an input JPEG file. + * The routines in jdapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jlossy8.h" + + +/* Forward declarations */ +LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo)); + + +/* + * Read the coefficient arrays from a JPEG file. + * jpeg_read_header must be completed before calling this. + * + * The entire image is read into a set of virtual coefficient-block arrays, + * one per component. The return value is a pointer to the array of + * virtual-array descriptors. These can be manipulated directly via the + * JPEG memory manager, or handed off to jpeg_write_coefficients(). + * To release the memory occupied by the virtual arrays, call + * jpeg_finish_decompress() when done with the data. + * + * An alternative usage is to simply obtain access to the coefficient arrays + * during a buffered-image-mode decompression operation. This is allowed + * after any jpeg_finish_output() call. The arrays can be accessed until + * jpeg_finish_decompress() is called. (Note that any call to the library + * may reposition the arrays, so don't rely on access_virt_barray() results + * to stay valid across library calls.) + * + * Returns NULL if suspended. This case need be checked only if + * a suspending data source is used. + */ + +GLOBAL(jvirt_barray_ptr *) +jpeg_read_coefficients (j_decompress_ptr cinfo) +{ + /* j_lossy_d_ptr decomp; */ + + /* Can't read coefficients from lossless streams */ + if (cinfo->process == JPROC_LOSSLESS) { + ERREXIT(cinfo, JERR_CANT_TRANSCODE); + return NULL; + } + + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize active modules */ + transdecode_master_selection(cinfo); + cinfo->global_state = DSTATE_RDCOEFS; + } + if (cinfo->global_state == DSTATE_RDCOEFS) { + /* Absorb whole file into the coef buffer */ + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return NULL; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* startup underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } + /* Set state so that jpeg_finish_decompress does the right thing */ + cinfo->global_state = DSTATE_STOPPING; + } + /* At this point we should be in state DSTATE_STOPPING if being used + * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access + * to the coefficients during a full buffered-image-mode decompression. + */ + if ((cinfo->global_state == DSTATE_STOPPING || + cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) { + return ((j_lossy_d_ptr) cinfo->codec)->coef_arrays; + } + /* Oops, improper usage */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return NULL; /* keep compiler happy */ +} + + +/* + * Master selection of decompression modules for transcoding. + * This substitutes for jdmaster.c's initialization of the full decompressor. + */ + +LOCAL(void) +transdecode_master_selection (j_decompress_ptr cinfo) +{ + /* This is effectively a buffered-image operation. */ + cinfo->buffered_image = TRUE; + + /* Initialize decompression codec */ + jinit_d_codec(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + + /* Initialize progress monitoring. */ + if (cinfo->progress != NULL) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->process == JPROC_PROGRESSIVE) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else if (cinfo->inputctl->has_multiple_scans) { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } else { + nscans = 1; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = 1; + } +} diff --git a/dcmjpeg/libijg8/jerror.c b/dcmjpeg/libijg8/jerror.c new file mode 100644 index 00000000..f6595eca --- /dev/null +++ b/dcmjpeg/libijg8/jerror.c @@ -0,0 +1,253 @@ +/* + * jerror.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains simple error-reporting and trace-message routines. + * These are suitable for Unix-like systems and others where writing to + * stderr is the right thing to do. Many applications will want to replace + * some or all of these routines. + * + * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile, + * you get a Windows-specific hack to display error messages in a dialog box. + * It ain't much, but it beats dropping error messages into the bit bucket, + * which is what happens to output to stderr under most Windows C compilers. + * + * These routines are used by both the compression and decompression code. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jversion8.h" +#include "jerror8.h" + +#ifdef USE_WINDOWS_MESSAGEBOX +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#ifndef EXIT_FAILURE /* define exit() codes if not provided */ +#define EXIT_FAILURE 1 +#endif + + +/* + * Create the message string table. + * We do this from the master message list in jerror.h by re-reading + * jerror.h with a suitable definition for macro JMESSAGE. + * The message table is made an external symbol just in case any applications + * want to refer to it directly. + */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_std_message_table jpeg8_std_message_table +#endif + +#define JMESSAGE(code,string) string , + +const char * const jpeg_std_message_table[] = { +#include "jerror8.h" + NULL +}; + + +/* + * Error exit handler: must not return to caller. + * + * Applications may override this if they want to get control back after + * an error. Typically one would longjmp somewhere instead of exiting. + * The setjmp buffer can be made a private field within an expanded error + * handler object. Note that the info needed to generate an error message + * is stored in the error object, so you can generate the message now or + * later, at your convenience. + * You should make sure that the JPEG object is cleaned up (with jpeg_abort + * or jpeg_destroy) at some point. + */ + +METHODDEF(void) +error_exit (j_common_ptr cinfo) +{ + /* Always display the message */ + (*cinfo->err->output_message) (cinfo); + + /* Let the memory manager delete any temp files before we die */ + jpeg_destroy(cinfo); + + exit(EXIT_FAILURE); +} + + +/* + * Actual output of an error or trace message. + * Applications may override this method to send JPEG messages somewhere + * other than stderr. + * + * On Windows, printing to stderr is generally completely useless, + * so we provide optional code to produce an error-dialog popup. + * Most Windows applications will still prefer to override this routine, + * but if they don't, it'll do something at least marginally useful. + * + * NOTE: to use the library in an environment that doesn't support the + * C stdio library, you may have to delete the call to fprintf() entirely, + * not just not use this routine. + */ + +METHODDEF(void) +output_message (j_common_ptr cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + + /* Create the message */ + (*cinfo->err->format_message) (cinfo, buffer); + +#ifdef USE_WINDOWS_MESSAGEBOX + /* Display it in a message dialog box */ + MessageBox(GetActiveWindow(), buffer, "JPEG Library Error", + MB_OK | MB_ICONERROR); +#else + /* Send it to stderr, adding a newline */ + fprintf(stderr, "%s\n", buffer); +#endif +} + + +/* + * Decide whether to emit a trace or warning message. + * msg_level is one of: + * -1: recoverable corrupt-data warning, may want to abort. + * 0: important advisory messages (always display to user). + * 1: first level of tracing detail. + * 2,3,...: successively more detailed tracing messages. + * An application might override this method if it wanted to abort on warnings + * or change the policy about which messages to display. + */ + +METHODDEF(void) +emit_message (j_common_ptr cinfo, int msg_level) +{ + struct jpeg_error_mgr * err = cinfo->err; + + if (msg_level < 0) { + /* It's a warning message. Since corrupt files may generate many warnings, + * the policy implemented here is to show only the first warning, + * unless trace_level >= 3. + */ + if (err->num_warnings == 0 || err->trace_level >= 3) + (*err->output_message) (cinfo); + /* Always count warnings in num_warnings. */ + err->num_warnings++; + } else { + /* It's a trace message. Show it if trace_level >= msg_level. */ + if (err->trace_level >= msg_level) + (*err->output_message) (cinfo); + } +} + + +/* + * Format a message string for the most recent JPEG error or message. + * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX + * characters. Note that no '\n' character is added to the string. + * Few applications should need to override this method. + */ + +METHODDEF(void) +format_message (j_common_ptr cinfo, char * buffer) +{ + struct jpeg_error_mgr * err = cinfo->err; + int msg_code = err->msg_code; + const char * msgtext = NULL; + const char * msgptr; + char ch; + boolean isstring; + + /* Look up message string in proper table */ + if (msg_code > 0 && msg_code <= err->last_jpeg_message) { + msgtext = err->jpeg_message_table[msg_code]; + } else if (err->addon_message_table != NULL && + msg_code >= err->first_addon_message && + msg_code <= err->last_addon_message) { + msgtext = err->addon_message_table[msg_code - err->first_addon_message]; + } + + /* Defend against bogus message number */ + if (msgtext == NULL) { + err->msg_parm.i[0] = msg_code; + msgtext = err->jpeg_message_table[0]; + } + + /* Check for string parameter, as indicated by %s in the message text */ + isstring = FALSE; + msgptr = msgtext; + while ((ch = *msgptr++) != '\0') { + if (ch == '%') { + if (*msgptr == 's') isstring = TRUE; + break; + } + } + + /* Format the message into the passed buffer */ + if (isstring) + sprintf(buffer, msgtext, err->msg_parm.s); + else + sprintf(buffer, msgtext, + err->msg_parm.i[0], err->msg_parm.i[1], + err->msg_parm.i[2], err->msg_parm.i[3], + err->msg_parm.i[4], err->msg_parm.i[5], + err->msg_parm.i[6], err->msg_parm.i[7]); +} + + +/* + * Reset error state variables at start of a new image. + * This is called during compression startup to reset trace/error + * processing to default state, without losing any application-specific + * method pointers. An application might possibly want to override + * this method if it has additional error processing state. + */ + +METHODDEF(void) +reset_error_mgr (j_common_ptr cinfo) +{ + cinfo->err->num_warnings = 0; + /* trace_level is not reset since it is an application-supplied parameter */ + cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */ +} + + +/* + * Fill in the standard error-handling methods in a jpeg_error_mgr object. + * Typical call is: + * struct jpeg_compress_struct cinfo; + * struct jpeg_error_mgr err; + * + * cinfo.err = jpeg_std_error(&err); + * after which the application may override some of the methods. + */ + +GLOBAL(struct jpeg_error_mgr *) +jpeg_std_error (struct jpeg_error_mgr * err) +{ + err->error_exit = error_exit; + err->emit_message = emit_message; + err->output_message = output_message; + err->format_message = format_message; + err->reset_error_mgr = reset_error_mgr; + + err->trace_level = 0; /* default = no tracing */ + err->num_warnings = 0; /* no warnings emitted yet */ + err->msg_code = 0; /* may be useful as a flag for "no error" */ + + /* Initialize message table pointers */ + err->jpeg_message_table = jpeg_std_message_table; + err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; + + err->addon_message_table = NULL; + err->first_addon_message = 0; /* for safety */ + err->last_addon_message = 0; + + return err; +} diff --git a/dcmjpeg/libijg8/jerror8.h b/dcmjpeg/libijg8/jerror8.h new file mode 100644 index 00000000..d90bd1c1 --- /dev/null +++ b/dcmjpeg/libijg8/jerror8.h @@ -0,0 +1,310 @@ +/* + * jerror.h + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the error and message codes for the JPEG library. + * Edit this file to add new codes, or to translate the message strings to + * some other language. + * A set of error-reporting macros are defined too. Some applications using + * the JPEG library may wish to include this file to get the error codes + * and/or the macros. + */ + +/* + * To define the enum list of message codes, include this file without + * defining macro JMESSAGE. To create a message string table, include it + * again with a suitable JMESSAGE definition (see jerror.c for an example). + */ +#ifndef JMESSAGE +#ifndef JERROR_H +/* First time through, define the enum list */ +#define JMAKE_ENUM_LIST +#else +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ +#define JMESSAGE(code,string) +#endif /* JERROR_H */ +#endif /* JMESSAGE */ + +#ifdef JMAKE_ENUM_LIST + +typedef enum { + +#define JMESSAGE(code,string) code , + +#endif /* JMAKE_ENUM_LIST */ + +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ + +/* For maintenance convenience, list is alphabetical by message code name */ +JMESSAGE(JERR_ARITH_NOTIMPL, + "Sorry, there are legal restrictions on arithmetic coding") +JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") +JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") +JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") +JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") +JMESSAGE(JERR_BAD_DIFF, "spatial difference out of range") +JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") +JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") +JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") +JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") +JMESSAGE(JERR_BAD_LIB_VERSION, + "Wrong JPEG library version: library is %d, caller expects %d") +JMESSAGE(JERR_BAD_LOSSLESS, + "Invalid lossless parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_LOSSLESS_SCRIPT, + "Invalid lossless parameters at scan script entry %d") +JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") +JMESSAGE(JERR_BAD_PROGRESSION, + "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_PROG_SCRIPT, + "Invalid progressive parameters at scan script entry %d") +JMESSAGE(JERR_BAD_RESTART, "Invalid restart interval: %d, must be an integer multiple of the number of MCUs in an MCU_row (%d)") +JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") +JMESSAGE(JERR_BAD_STRUCT_SIZE, + "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") +JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") +JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") +JMESSAGE(JERR_CANT_TRANSCODE, + "Cannot transcode to/from lossless JPEG datastreams") +JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") +JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") +JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") +JMESSAGE(JERR_EMS_READ, "Read from EMS failed") +JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") +JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") +JMESSAGE(JERR_FILE_READ, "Input file read error") +JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") +JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") +JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") +JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, + "Cannot transcode due to multiple use of quantization table %d") +JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") +JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") +JMESSAGE(JERR_NOTIMPL, "Not implemented yet") +JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") +#ifdef WITH_ARITHMETIC_PATCH +JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") +#endif +JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") +JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") +JMESSAGE(JERR_NO_LOSSLESS_SCRIPT, "Lossless encoding was requested but no scan script was supplied") +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") +JMESSAGE(JERR_QUANT_COMPONENTS, + "Cannot quantize more than %d color components") +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") +JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") +JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") +JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") +JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") +JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") +JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") +JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") +JMESSAGE(JERR_TFILE_WRITE, + "Write failed on temporary file --- out of disk space?") +JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") +JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") +JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") +JMESSAGE(JERR_XMS_READ, "Read from XMS failed") +JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") +JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) +JMESSAGE(JMSG_VERSION, JVERSION) +JMESSAGE(JTRC_16BIT_TABLES, + "Caution: quantization tables are too coarse for baseline JPEG") +JMESSAGE(JTRC_ADOBE, + "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") +JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") +JMESSAGE(JTRC_DRI, "Define Restart Interval %u") +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") +JMESSAGE(JTRC_EOI, "End Of Image") +JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, + "Warning: thumbnail image size does not match data length %u") +JMESSAGE(JTRC_JFIF_EXTENSION, + "JFIF extension marker: type 0x%02x, length %u") +JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") +JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") +JMESSAGE(JTRC_RST, "RST%d") +JMESSAGE(JTRC_SMOOTH_NOTIMPL, + "Smoothing not supported with nonstandard sampling ratios") +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") +JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") +JMESSAGE(JTRC_SOI, "Start of Image") +JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") +JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") +JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") +JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") +JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") +JMESSAGE(JTRC_THUMB_JPEG, + "JFIF extension marker: JPEG-compressed thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_PALETTE, + "JFIF extension marker: palette thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_RGB, + "JFIF extension marker: RGB thumbnail image, length %u") +JMESSAGE(JTRC_UNKNOWN_LOSSLESS_IDS, + "Unrecognized component IDs %d %d %d, assuming RGB") +JMESSAGE(JTRC_UNKNOWN_LOSSY_IDS, + "Unrecognized component IDs %d %d %d, assuming YCbCr") +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") +#ifdef WITH_ARITHMETIC_PATCH +JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") +#endif +JMESSAGE(JWRN_BOGUS_PROGRESSION, + "Inconsistent progression sequence for component %d coefficient %d") +JMESSAGE(JWRN_EXTRANEOUS_DATA, + "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") +JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") +JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") +JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") +JMESSAGE(JWRN_MUST_DOWNSCALE, + "Must downscale data from %d bits to %d") +JMESSAGE(JWRN_MUST_RESYNC, + "Corrupt JPEG data: found marker 0x%02x instead of RST%d") +JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") +JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") + +#ifdef JMAKE_ENUM_LIST + + JMSG_LASTMSGCODE +} J_MESSAGE_CODE; + +#undef JMAKE_ENUM_LIST +#endif /* JMAKE_ENUM_LIST */ + +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ +#undef JMESSAGE + + +#ifndef JERROR_H +#define JERROR_H + +/* Macros to simplify using the error and trace message stuff */ +/* The first parameter is either type of cinfo pointer */ + +/* Fatal errors (print message and exit) */ +#define ERREXIT(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT3(cinfo,code,p1,p2,p3) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXITS(cinfo,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) + +#define MAKESTMT(stuff) do { stuff } while (0) + +/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ +#define WARNMS(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) + +/* Informational/debugging messages */ +#define TRACEMS(cinfo,lvl,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS1(cinfo,lvl,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS2(cinfo,lvl,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMSS(cinfo,lvl,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) + +#endif /* JERROR_H */ diff --git a/dcmjpeg/libijg8/jfdctflt.c b/dcmjpeg/libijg8/jfdctflt.c new file mode 100644 index 00000000..988a6a67 --- /dev/null +++ b/dcmjpeg/libijg8/jfdctflt.c @@ -0,0 +1,168 @@ +/* + * jfdctflt.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * forward DCT (Discrete Cosine Transform). + * + * This implementation should be more accurate than either of the integer + * DCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jdct8.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_float (FAST_FLOAT * data) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z1, z2, z3, z4, z5, z11, z13; + FAST_FLOAT *dataptr; + int ctr; + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = tmp10 + tmp11; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jfdctfst.c b/dcmjpeg/libijg8/jfdctfst.c new file mode 100644 index 00000000..1c124bda --- /dev/null +++ b/dcmjpeg/libijg8/jfdctfst.c @@ -0,0 +1,224 @@ +/* + * jfdctfst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jdct8.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jfdctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * Again to save a few shifts, the intermediate results between pass 1 and + * pass 2 are not upscaled, but are represented only to integral precision. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#define CONST_BITS 8 + + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_0_382683433 ((IJG_INT32) 98) /* FIX(0.382683433) */ +#define FIX_0_541196100 ((IJG_INT32) 139) /* FIX(0.541196100) */ +#define FIX_0_707106781 ((IJG_INT32) 181) /* FIX(0.707106781) */ +#define FIX_1_306562965 ((IJG_INT32) 334) /* FIX(1.306562965) */ +#else +#define FIX_0_382683433 FIX(0.382683433) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_707106781 FIX(0.707106781) +#define FIX_1_306562965 FIX(1.306562965) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an IJG_INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_ifast (DCTELEM * data) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z1, z2, z3, z4, z5, z11, z13; + DCTELEM *dataptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = tmp10 + tmp11; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jfdctint.c b/dcmjpeg/libijg8/jfdctint.c new file mode 100644 index 00000000..984c2208 --- /dev/null +++ b/dcmjpeg/libijg8/jfdctint.c @@ -0,0 +1,283 @@ +/* + * jfdctint.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jdct8.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D DCT step produces outputs which are a factor of sqrt(N) + * larger than the true DCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D DCT, + * because the y0 and y4 outputs need not be divided by sqrt(N). + * In the IJG code, this factor of 8 is removed by the quantization step + * (in jcdctmgr.c), NOT in this module. + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (For 12-bit sample data, the intermediate + * array is IJG_INT32 anyway.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((IJG_INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((IJG_INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((IJG_INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((IJG_INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((IJG_INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((IJG_INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((IJG_INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((IJG_INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_islow (DCTELEM * data) +{ + IJG_INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + IJG_INT32 tmp10, tmp11, tmp12, tmp13; + IJG_INT32 z1, z2, z3, z4, z5; + DCTELEM *dataptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), + CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), + CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jidctflt.c b/dcmjpeg/libijg8/jidctflt.c new file mode 100644 index 00000000..a57f6dba --- /dev/null +++ b/dcmjpeg/libijg8/jidctflt.c @@ -0,0 +1,242 @@ +/* + * jidctflt.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * This implementation should be more accurate than either of the integer + * IDCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jdct8.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a float result. + */ + +#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z5, z10, z11, z12, z13; + JCOEFPTR inptr; + FLOAT_MULT_TYPE * quantptr; + FAST_FLOAT * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ + tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + wsptr[DCTSIZE*0] = tmp0 + tmp7; + wsptr[DCTSIZE*7] = tmp0 - tmp7; + wsptr[DCTSIZE*1] = tmp1 + tmp6; + wsptr[DCTSIZE*6] = tmp1 - tmp6; + wsptr[DCTSIZE*2] = tmp2 + tmp5; + wsptr[DCTSIZE*5] = tmp2 - tmp5; + wsptr[DCTSIZE*4] = tmp3 + tmp4; + wsptr[DCTSIZE*3] = tmp3 - tmp4; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * And testing floats for zero is relatively expensive, so we don't bother. + */ + + /* Even part */ + + tmp10 = wsptr[0] + wsptr[4]; + tmp11 = wsptr[0] - wsptr[4]; + + tmp13 = wsptr[2] + wsptr[6]; + tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = wsptr[5] + wsptr[3]; + z10 = wsptr[5] - wsptr[3]; + z11 = wsptr[1] + wsptr[7]; + z12 = wsptr[1] - wsptr[7]; + + tmp7 = z11 + z13; + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ + tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + /* Final output stage: scale down by a factor of 8 and range-limit */ + + outptr[0] = range_limit[(int) DESCALE((IJG_INT32) (tmp0 + tmp7), 3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) DESCALE((IJG_INT32) (tmp0 - tmp7), 3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE((IJG_INT32) (tmp1 + tmp6), 3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) DESCALE((IJG_INT32) (tmp1 - tmp6), 3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE((IJG_INT32) (tmp2 + tmp5), 3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) DESCALE((IJG_INT32) (tmp2 - tmp5), 3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) DESCALE((IJG_INT32) (tmp3 + tmp4), 3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE((IJG_INT32) (tmp3 - tmp4), 3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jidctfst.c b/dcmjpeg/libijg8/jidctfst.c new file mode 100644 index 00000000..3d19e3c6 --- /dev/null +++ b/dcmjpeg/libijg8/jidctfst.c @@ -0,0 +1,368 @@ +/* + * jidctfst.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jdct8.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jidctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * The dequantized coefficients are not integers because the AA&N scaling + * factors have been incorporated. We represent them scaled up by PASS1_BITS, + * so that the first and second IDCT rounds have the same input scaling. + * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to + * avoid a descaling shift; this compromises accuracy rather drastically + * for small quantization table entries, but it saves a lot of shifts. + * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway, + * so we use a much larger scaling factor to preserve accuracy. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 8 +#define PASS1_BITS 2 +#else +#define CONST_BITS 8 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_1_082392200 ((IJG_INT32) 277) /* FIX(1.082392200) */ +#define FIX_1_414213562 ((IJG_INT32) 362) /* FIX(1.414213562) */ +#define FIX_1_847759065 ((IJG_INT32) 473) /* FIX(1.847759065) */ +#define FIX_2_613125930 ((IJG_INT32) 669) /* FIX(2.613125930) */ +#else +#define FIX_1_082392200 FIX(1.082392200) +#define FIX_1_414213562 FIX(1.414213562) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_2_613125930 FIX(2.613125930) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an IJG_INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a DCTELEM result. For 8-bit data a 16x16->16 + * multiplication will do. For 12-bit data, the multiplier table is + * declared IJG_INT32, so a 32-bit multiply will be used. + */ + +#if BITS_IN_JSAMPLE == 8 +#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval)) +#else +#define DEQUANTIZE(coef,quantval) \ + DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS) +#endif + + +/* Like DESCALE, but applies to a DCTELEM and produces an int. + * We assume that int right shift is unsigned if IJG_INT32 right shift is. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS DCTELEM ishift_temp; +#if BITS_IN_JSAMPLE == 8 +#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */ +#else +#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */ +#endif +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +#ifdef USE_ACCURATE_ROUNDING +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n)) +#else +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n)) +#endif + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z5, z10, z11, z12, z13; + JCOEFPTR inptr; + IFAST_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS /* for DESCALE */ + ISHIFT_TEMPS /* for IDESCALE */ + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (IFAST_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); + wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); + wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); + wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); + wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5); + wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); + wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); + wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); + tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); + + tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); + tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562) + - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; + z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; + z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; + z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + /* Final output stage: scale down by a factor of 8 and range-limit */ + + outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jidctint.c b/dcmjpeg/libijg8/jidctint.c new file mode 100644 index 00000000..75a36c46 --- /dev/null +++ b/dcmjpeg/libijg8/jidctint.c @@ -0,0 +1,389 @@ +/* + * jidctint.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jdct8.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D IDCT step produces outputs which are a factor of sqrt(N) + * larger than the true IDCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D IDCT, + * because the y0 and y4 inputs need not be divided by sqrt(N). + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (To scale up 12-bit sample data further, an + * intermediate IJG_INT32 array would be needed.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((IJG_INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((IJG_INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((IJG_INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((IJG_INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((IJG_INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((IJG_INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((IJG_INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((IJG_INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce an int result. In this module, both inputs and result + * are 16 bits or less, so either int or short multiply will work. + */ + +#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp1, tmp2, tmp3; + IJG_INT32 tmp10, tmp11, tmp12, tmp13; + IJG_INT32 z1, z2, z3, z4, z5; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (IJG_INT32) wsptr[2]; + z3 = (IJG_INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((IJG_INT32) wsptr[0] + (IJG_INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((IJG_INT32) wsptr[0] - (IJG_INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (IJG_INT32) wsptr[7]; + tmp1 = (IJG_INT32) wsptr[5]; + tmp2 = (IJG_INT32) wsptr[3]; + tmp3 = (IJG_INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jidctred.c b/dcmjpeg/libijg8/jidctred.c new file mode 100644 index 00000000..afeeca09 --- /dev/null +++ b/dcmjpeg/libijg8/jidctred.c @@ -0,0 +1,398 @@ +/* + * jidctred.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains inverse-DCT routines that produce reduced-size output: + * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block. + * + * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M) + * algorithm used in jidctint.c. We simply replace each 8-to-8 1-D IDCT step + * with an 8-to-4 step that produces the four averages of two adjacent outputs + * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output). + * These steps were derived by computing the corresponding values at the end + * of the normal LL&M code, then simplifying as much as possible. + * + * 1x1 is trivial: just take the DC coefficient divided by 8. + * + * See jidctint.c for additional comments. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jdct8.h" /* Private declarations for DCT subsystem */ + +#ifdef IDCT_SCALING_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling is the same as in jidctint.c. */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_211164243 ((IJG_INT32) 1730) /* FIX(0.211164243) */ +#define FIX_0_509795579 ((IJG_INT32) 4176) /* FIX(0.509795579) */ +#define FIX_0_601344887 ((IJG_INT32) 4926) /* FIX(0.601344887) */ +#define FIX_0_720959822 ((IJG_INT32) 5906) /* FIX(0.720959822) */ +#define FIX_0_765366865 ((IJG_INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_850430095 ((IJG_INT32) 6967) /* FIX(0.850430095) */ +#define FIX_0_899976223 ((IJG_INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_061594337 ((IJG_INT32) 8697) /* FIX(1.061594337) */ +#define FIX_1_272758580 ((IJG_INT32) 10426) /* FIX(1.272758580) */ +#define FIX_1_451774981 ((IJG_INT32) 11893) /* FIX(1.451774981) */ +#define FIX_1_847759065 ((IJG_INT32) 15137) /* FIX(1.847759065) */ +#define FIX_2_172734803 ((IJG_INT32) 17799) /* FIX(2.172734803) */ +#define FIX_2_562915447 ((IJG_INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_624509785 ((IJG_INT32) 29692) /* FIX(3.624509785) */ +#else +#define FIX_0_211164243 FIX(0.211164243) +#define FIX_0_509795579 FIX(0.509795579) +#define FIX_0_601344887 FIX(0.601344887) +#define FIX_0_720959822 FIX(0.720959822) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_850430095 FIX(0.850430095) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_061594337 FIX(1.061594337) +#define FIX_1_272758580 FIX(1.272758580) +#define FIX_1_451774981 FIX(1.451774981) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_2_172734803 FIX(2.172734803) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_624509785 FIX(3.624509785) +#endif + + +/* Multiply an IJG_INT32 variable by an IJG_INT32 constant to yield an IJG_INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce an int result. In this module, both inputs and result + * are 16 bits or less, so either int or short multiply will work. + */ + +#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 4x4 output block. + */ + +GLOBAL(void) +jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp2, tmp10, tmp12; + IJG_INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE*4]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { + /* Don't bother to process column 4, because second pass won't use it */ + if (ctr == DCTSIZE-4) + continue; + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 && + inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { + /* AC terms all zero; we need not examine term 4 for 4x4 output */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= (CONST_BITS+1); + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ + + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ + + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ + + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ + + tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ + + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ + + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ + + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ + + /* Final output stage */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1); + } + + /* Pass 2: process 4 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++) { + outptr = output_buf[ctr] + output_col; + /* It's not clear whether a zero row test is worthwhile here ... */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp0 = ((IJG_INT32) wsptr[0]) << (CONST_BITS+1); + + tmp2 = MULTIPLY((IJG_INT32) wsptr[2], FIX_1_847759065) + + MULTIPLY((IJG_INT32) wsptr[6], - FIX_0_765366865); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + /* Odd part */ + + z1 = (IJG_INT32) wsptr[7]; + z2 = (IJG_INT32) wsptr[5]; + z3 = (IJG_INT32) wsptr[3]; + z4 = (IJG_INT32) wsptr[1]; + + tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ + + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ + + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ + + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ + + tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ + + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ + + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ + + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0, + CONST_BITS+PASS1_BITS+3+1) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 2x2 output block. + */ + +GLOBAL(void) +jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + IJG_INT32 tmp0, tmp10, z1; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE*2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { + /* Don't bother to process columns 2,4,6 */ + if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6) + continue; + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) { + /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + + continue; + } + + /* Even part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp10 = z1 << (CONST_BITS+2); + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */ + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ + + /* Final output stage */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2); + } + + /* Pass 2: process 2 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 2; ctr++) { + outptr = output_buf[ctr] + output_col; + /* It's not clear whether a zero row test is worthwhile here ... */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((IJG_INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp10 = ((IJG_INT32) wsptr[0]) << (CONST_BITS+2); + + /* Odd part */ + + tmp0 = MULTIPLY((IJG_INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */ + + MULTIPLY((IJG_INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */ + + MULTIPLY((IJG_INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */ + + MULTIPLY((IJG_INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3+2) + & RANGE_MASK]; + outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3+2) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 1x1 output block. + */ + +GLOBAL(void) +jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + const JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + int dcval; + ISLOW_MULT_TYPE * quantptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + SHIFT_TEMPS + + /* We hardly need an inverse DCT routine for this: just take the + * average pixel value, which is one-eighth of the DC coefficient. + */ + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + dcval = DEQUANTIZE(coef_block[0], quantptr[0]); + dcval = (int) DESCALE((IJG_INT32) dcval, 3); + + output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; +} + +#endif /* IDCT_SCALING_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jinclude8.h b/dcmjpeg/libijg8/jinclude8.h new file mode 100644 index 00000000..cae1f6cc --- /dev/null +++ b/dcmjpeg/libijg8/jinclude8.h @@ -0,0 +1,91 @@ +/* + * jinclude.h + * + * Copyright (C) 1991-1994, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file exists to provide a single place to fix any problems with + * including the wrong system include files. (Common problems are taken + * care of by the standard jconfig symbols, but on really weird systems + * you may have to edit this file.) + * + * NOTE: this file is NOT intended to be included by applications using the + * JPEG library. Most applications need only include jpeglib.h. + */ + + +/* Include auto-config file to find out which system include files we need. */ + +#include "jconfig8.h" /* auto configuration options */ +#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ + +/* + * We need the NULL macro and size_t typedef. + * On an ANSI-conforming system it is sufficient to include . + * Otherwise, we get them from or ; we may have to + * pull in as well. + * Note that the core JPEG library does not require ; + * only the default error handler and data source/destination modules do. + * But we must pull it in because of the references to FILE in jpeglib.h. + * You can remove those references if you want to compile without . + */ + +#ifdef HAVE_STDDEF_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef NEED_SYS_TYPES_H +#include +#endif + +#include + +/* + * We need memory copying and zeroing functions, plus strncpy(). + * ANSI and System V implementations declare these in . + * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). + * Some systems may declare memset and memcpy in . + * + * NOTE: we assume the size parameters to these functions are of type size_t. + * Change the casts in these macros if not! + */ + +#ifdef NEED_BSD_STRINGS + +#include +#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) +#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) + +#else /* not BSD, assume ANSI/SysV string lib */ + +#include +#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) +#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) + +#endif + +/* + * In ANSI C, and indeed any rational implementation, size_t is also the + * type returned by sizeof(). However, it seems there are some irrational + * implementations out there, in which sizeof() returns an int even though + * size_t is defined as long or unsigned long. To ensure consistent results + * we always use this SIZEOF() macro in place of using sizeof() directly. + */ + +#define SIZEOF(object) ((size_t) sizeof(object)) + +/* + * The modules that use fread() and fwrite() always invoke them through + * these macros. On some systems you may need to twiddle the argument casts. + * CAUTION: argument order is different from underlying functions! + */ + +#define JFREAD(file,buf,sizeofbuf) \ + ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) +#define JFWRITE(file,buf,sizeofbuf) \ + ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/dcmjpeg/libijg8/jlossls8.h b/dcmjpeg/libijg8/jlossls8.h new file mode 100644 index 00000000..547b02ea --- /dev/null +++ b/dcmjpeg/libijg8/jlossls8.h @@ -0,0 +1,151 @@ +/* + * jlossls.h + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the lossless JPEG + * codec modules. + */ + +#ifndef JLOSSLS_H +#define JLOSSLS_H + + +/* + * Table H.1: Predictors for lossless coding. + */ + +#define PREDICTOR1 Ra +#define PREDICTOR2 Rb +#define PREDICTOR3 Rc +#define PREDICTOR4 (int) ((IJG_INT32) Ra + (IJG_INT32) Rb - (IJG_INT32) Rc) +#define PREDICTOR5 (int) ((IJG_INT32) Ra + RIGHT_SHIFT((IJG_INT32) Rb - (IJG_INT32) Rc, 1)) +#define PREDICTOR6 (int) ((IJG_INT32) Rb + RIGHT_SHIFT((IJG_INT32) Ra - (IJG_INT32) Rc, 1)) +#define PREDICTOR7 (int) RIGHT_SHIFT((IJG_INT32) Ra + (IJG_INT32) Rb, 1) + + +typedef JMETHOD(void, predict_difference_method_ptr, + (j_compress_ptr cinfo, int ci, + JSAMPROW input_buf, JSAMPROW prev_row, + JDIFFROW diff_buf, JDIMENSION width)); + +typedef JMETHOD(void, scaler_method_ptr, + (j_compress_ptr cinfo, int ci, + JSAMPROW input_buf, JSAMPROW output_buf, + JDIMENSION width)); + +/* Lossless-specific compression codec (compressor proper) */ +typedef struct { + struct jpeg_c_codec pub; /* public fields */ + + + /* Difference buffer control */ + JMETHOD(void, diff_start_pass, (j_compress_ptr cinfo, + J_BUF_MODE pass_mode)); + + /* Pointer to data which is private to diff controller */ + void *diff_private; + + + /* Entropy encoding */ + JMETHOD(JDIMENSION, entropy_encode_mcus, (j_compress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Prediction, differencing */ + JMETHOD(void, predict_start_pass, (j_compress_ptr cinfo)); + + /* It is useful to allow each component to have a separate diff method. */ + predict_difference_method_ptr predict_difference[MAX_COMPONENTS]; + + /* Pointer to data which is private to predictor module */ + void *pred_private; + + /* Sample scaling */ + JMETHOD(void, scaler_start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, scaler_scale, (j_compress_ptr cinfo, + JSAMPROW input_buf, JSAMPROW output_buf, + JDIMENSION width)); + + /* Pointer to data which is private to scaler module */ + void *scaler_private; + +} jpeg_lossless_c_codec; + +typedef jpeg_lossless_c_codec * j_lossless_c_ptr; + + +typedef JMETHOD(void, predict_undifference_method_ptr, + (j_decompress_ptr cinfo, int comp_index, + JDIFFROW diff_buf, JDIFFROW prev_row, + JDIFFROW undiff_buf, JDIMENSION width)); + +/* Lossless-specific decompression codec (decompressor proper) */ +typedef struct { + struct jpeg_d_codec pub; /* public fields */ + + + /* Difference buffer control */ + JMETHOD(void, diff_start_input_pass, (j_decompress_ptr cinfo)); + + /* Pointer to data which is private to diff controller */ + void *diff_private; + + + /* Entropy decoding */ + JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(boolean, entropy_process_restart, (j_decompress_ptr cinfo)); + JMETHOD(JDIMENSION, entropy_decode_mcus, (j_decompress_ptr cinfo, + JDIFFIMAGE diff_buf, + JDIMENSION MCU_row_num, + JDIMENSION MCU_col_num, + JDIMENSION nMCU)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Prediction, undifferencing */ + JMETHOD(void, predict_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, predict_process_restart, (j_decompress_ptr cinfo)); + + /* It is useful to allow each component to have a separate undiff method. */ + predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS]; + + /* Pointer to data which is private to predictor module */ + void *pred_private; + + /* Sample scaling */ + JMETHOD(void, scaler_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, scaler_scale, (j_decompress_ptr cinfo, + JDIFFROW diff_buf, JSAMPROW output_buf, + JDIMENSION width)); + + /* Pointer to data which is private to scaler module */ + void *scaler_private; + +} jpeg_lossless_d_codec; + +typedef jpeg_lossless_d_codec * j_lossless_d_ptr; + + +/* Compression module initialization routines */ +EXTERN(void) jinit_lossless_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_lhuff_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_differencer JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_scaler JPP((j_compress_ptr cinfo)); +/* Decompression module initialization routines */ +EXTERN(void) jinit_lossless_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_lhuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_undifferencer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_scaler JPP((j_decompress_ptr cinfo)); + +#endif /* JLOSSLS_H */ diff --git a/dcmjpeg/libijg8/jlossy8.h b/dcmjpeg/libijg8/jlossy8.h new file mode 100644 index 00000000..ad4d62b3 --- /dev/null +++ b/dcmjpeg/libijg8/jlossy8.h @@ -0,0 +1,120 @@ +/* + * jlossy.h + * + * Copyright (C) 1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the lossy (DCT-based) + * JPEG codec modules. + */ + +#ifndef JLOSSY_H +#define JLOSSY_H + + +/* Lossy-specific compression codec (compressor proper) */ +typedef struct { + struct jpeg_c_codec pub; /* public fields */ + + + /* Coefficient buffer control */ + JMETHOD(void, coef_start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + /* JMETHOD(boolean, coef_compress_data, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf));*/ + + /* Pointer to data which is private to coef module */ + void *coef_private; + + + /* Forward DCT (also controls coefficient quantization) */ + JMETHOD(void, fdct_start_pass, (j_compress_ptr cinfo)); + /* perhaps this should be an array??? */ + JMETHOD(void, fdct_forward_DCT, (j_compress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks)); + + /* Pointer to data which is private to fdct module */ + void *fdct_private; + + + /* Entropy encoding */ + JMETHOD(boolean, entropy_encode_mcu, (j_compress_ptr cinfo, + JBLOCKROW *MCU_data)); + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + +} jpeg_lossy_c_codec; + +typedef jpeg_lossy_c_codec * j_lossy_c_ptr; + + + +typedef JMETHOD(void, inverse_DCT_method_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col)); + +/* Lossy-specific decompression codec (decompressor proper) */ +typedef struct { + struct jpeg_d_codec pub; /* public fields */ + + + /* Coefficient buffer control */ + JMETHOD(void, coef_start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, coef_start_output_pass, (j_decompress_ptr cinfo)); + + /* Pointer to array of coefficient virtual arrays, or NULL if none */ + jvirt_barray_ptr *coef_arrays; + + /* Pointer to data which is private to coef module */ + void *coef_private; + + + /* Entropy decoding */ + JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo)); + JMETHOD(boolean, entropy_decode_mcu, (j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); + + /* This is here to share code between baseline and progressive decoders; */ + /* other modules probably should not use it */ + boolean entropy_insufficient_data; /* set TRUE after emitting warning */ + + /* Pointer to data which is private to entropy module */ + void *entropy_private; + + + /* Inverse DCT (also performs dequantization) */ + JMETHOD(void, idct_start_pass, (j_decompress_ptr cinfo)); + + /* It is useful to allow each component to have a separate IDCT method. */ + inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; + + /* Pointer to data which is private to idct module */ + void *idct_private; + +} jpeg_lossy_d_codec; + +typedef jpeg_lossy_d_codec * j_lossy_d_ptr; + + +/* Compression module initialization routines */ +EXTERN(void) jinit_lossy_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_shuff_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo)); + +/* Decompression module initialization routines */ +EXTERN(void) jinit_lossy_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_shuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); + +#endif /* JLOSSY_H */ diff --git a/dcmjpeg/libijg8/jmemmgr.c b/dcmjpeg/libijg8/jmemmgr.c new file mode 100644 index 00000000..c0ed4248 --- /dev/null +++ b/dcmjpeg/libijg8/jmemmgr.c @@ -0,0 +1,1174 @@ +/* + * jmemmgr.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the JPEG system-independent memory management + * routines. This code is usable across a wide variety of machines; most + * of the system dependencies have been isolated in a separate file. + * The major functions provided here are: + * * pool-based allocation and freeing of memory; + * * policy decisions about how to divide available memory among the + * virtual arrays; + * * control logic for swapping virtual arrays between main memory and + * backing storage. + * The separate system-dependent file provides the actual backing-storage + * access code, and it contains the policy decision about how much total + * main memory to use. + * This file is system-dependent in the sense that some of its functions + * are unnecessary in some systems. For example, if there is enough virtual + * memory so that backing storage will never be used, much of the virtual + * array control logic could be removed. (Of course, if you have that much + * memory then you shouldn't care about a little bit of unused code...) + */ + +#define JPEG_INTERNALS +#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */ +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jmemsys8.h" /* import the system-dependent declarations */ + +#ifndef NO_GETENV +#ifndef HAVE_STDLIB_H /* should declare getenv() */ +extern char * getenv JPP((const char * name)); +#endif +#endif + + +/* + * Some important notes: + * The allocation routines provided here must never return NULL. + * They should exit to error_exit if unsuccessful. + * + * It's not a good idea to try to merge the sarray, barray and darray + * routines, even though they are textually almost the same, because + * samples are usually stored as bytes while coefficients and differenced + * are shorts or ints. Thus, in machines where byte pointers have a + * different representation from word pointers, the resulting machine + * code could not be the same. + */ + + +/* + * Many machines require storage alignment: longs must start on 4-byte + * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc() + * always returns pointers that are multiples of the worst-case alignment + * requirement, and we had better do so too. + * There isn't any really portable way to determine the worst-case alignment + * requirement. This module assumes that the alignment requirement is + * multiples of sizeof(ALIGN_TYPE). + * By default, we define ALIGN_TYPE as double. This is necessary on some + * workstations (where doubles really do need 8-byte alignment) and will work + * fine on nearly everything. If your machine has lesser alignment needs, + * you can save a few bytes by making ALIGN_TYPE smaller. + * The only place I know of where this will NOT work is certain Macintosh + * 680x0 compilers that define double as a 10-byte IEEE extended float. + * Doing 10-byte alignment is counterproductive because longwords won't be + * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have + * such a compiler. + */ + +#ifndef ALIGN_TYPE /* so can override from jconfig.h */ +#define ALIGN_TYPE double +#endif + + +/* + * We allocate objects from "pools", where each pool is gotten with a single + * request to jpeg_get_small() or jpeg_get_large(). There is no per-object + * overhead within a pool, except for alignment padding. Each pool has a + * header with a link to the next pool of the same class. + * Small and large pool headers are identical except that the latter's + * link pointer must be FAR on 80x86 machines. + * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE + * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple + * of the alignment requirement of ALIGN_TYPE. + */ + +typedef union small_pool_struct * small_pool_ptr; + +typedef union small_pool_struct { + struct { + small_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} small_pool_hdr; + +typedef union large_pool_struct FAR * large_pool_ptr; + +typedef union large_pool_struct { + struct { + large_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} large_pool_hdr; + + +/* + * Here is the full definition of a memory manager object. + */ + +typedef struct { + struct jpeg_memory_mgr pub; /* public fields */ + + /* Each pool identifier (lifetime class) names a linked list of pools. */ + small_pool_ptr small_list[JPOOL_NUMPOOLS]; + large_pool_ptr large_list[JPOOL_NUMPOOLS]; + + /* Since we only have one lifetime class of virtual arrays, only one + * linked list is necessary (for each datatype). Note that the virtual + * array control blocks being linked together are actually stored somewhere + * in the small-pool list. + */ + jvirt_sarray_ptr virt_sarray_list; + jvirt_barray_ptr virt_barray_list; + + /* This counts total space obtained from jpeg_get_small/large */ + long total_space_allocated; + + /* alloc_sarray and alloc_barray set this value for use by virtual + * array routines. + */ + JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */ +} my_memory_mgr; + +typedef my_memory_mgr * my_mem_ptr; + + +/* + * The control blocks for virtual arrays. + * Note that these blocks are allocated in the "small" pool area. + * System-dependent info for the associated backing store (if any) is hidden + * inside the backing_store_info struct. + */ + +struct jvirt_sarray_control { + JSAMPARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION samplesperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_sarray_ptr next; /* link to next virtual sarray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + +struct jvirt_barray_control { + JBLOCKARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION blocksperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_barray_ptr next; /* link to next virtual barray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + + +#ifdef MEM_STATS /* optional extra stuff for statistics */ + +LOCAL(void) +print_mem_stats (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + + /* Since this is only a debugging stub, we can cheat a little by using + * fprintf directly rather than going through the trace message code. + * This is helpful because message parm array can't handle longs. + */ + fprintf(stderr, "Freeing pool %d, total space = %ld\n", + pool_id, mem->total_space_allocated); + + for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL; + lhdr_ptr = lhdr_ptr->hdr.next) { + fprintf(stderr, " Large chunk used %ld\n", + (long) lhdr_ptr->hdr.bytes_used); + } + + for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL; + shdr_ptr = shdr_ptr->hdr.next) { + fprintf(stderr, " Small chunk used %ld free %ld\n", + (long) shdr_ptr->hdr.bytes_used, + (long) shdr_ptr->hdr.bytes_left); + } +} + +#endif /* MEM_STATS */ + + +LOCAL(void) +out_of_memory (j_common_ptr cinfo, int which) +/* Report an out-of-memory error and stop execution */ +/* If we compiled MEM_STATS support, report alloc requests before dying */ +{ +#ifdef MEM_STATS + cinfo->err->trace_level = 2; /* force self_destruct to report stats */ +#endif + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which); +} + + +/* + * Allocation of "small" objects. + * + * For these, we use pooled storage. When a new pool must be created, + * we try to get enough space for the current request plus a "slop" factor, + * where the slop will be the amount of leftover space in the new pool. + * The speed vs. space tradeoff is largely determined by the slop values. + * A different slop value is provided for each pool class (lifetime), + * and we also distinguish the first pool of a class from later ones. + * NOTE: the values given work fairly well on both 16- and 32-bit-int + * machines, but may be too small if longs are 64 bits or more. + */ + +static const size_t first_pool_slop[JPOOL_NUMPOOLS] = +{ + 1600, /* first PERMANENT pool */ + 16000 /* first IMAGE pool */ +}; + +static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = +{ + 0, /* additional PERMANENT pools */ + 5000 /* additional IMAGE pools */ +}; + +#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */ + + +METHODDEF(void *) +alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "small" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr hdr_ptr, prev_hdr_ptr; + char * data_ptr; + size_t odd_bytes, min_request, slop; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))) + out_of_memory(cinfo, 1); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* See if space is available in any existing pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + prev_hdr_ptr = NULL; + hdr_ptr = mem->small_list[pool_id]; + while (hdr_ptr != NULL) { + if (hdr_ptr->hdr.bytes_left >= sizeofobject) + break; /* found pool with enough space */ + prev_hdr_ptr = hdr_ptr; + hdr_ptr = hdr_ptr->hdr.next; + } + + /* Time to make a new pool? */ + if (hdr_ptr == NULL) { + /* min_request is what we need now, slop is what will be leftover */ + min_request = sizeofobject + SIZEOF(small_pool_hdr); + if (prev_hdr_ptr == NULL) /* first pool in class? */ + slop = first_pool_slop[pool_id]; + else + slop = extra_pool_slop[pool_id]; + /* Don't ask for more than MAX_ALLOC_CHUNK */ + if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request)) + slop = (size_t) (MAX_ALLOC_CHUNK-min_request); + /* Try to get space, if fail reduce slop and try again */ + for (;;) { + hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop); + if (hdr_ptr != NULL) + break; + slop /= 2; + if (slop < MIN_SLOP) /* give up when it gets real small */ + out_of_memory(cinfo, 2); /* jpeg_get_small failed */ + } + mem->total_space_allocated += (long)(min_request + slop); + /* Success, initialize the new pool header and add to end of list */ + hdr_ptr->hdr.next = NULL; + hdr_ptr->hdr.bytes_used = 0; + hdr_ptr->hdr.bytes_left = sizeofobject + slop; + if (prev_hdr_ptr == NULL) /* first pool in class? */ + mem->small_list[pool_id] = hdr_ptr; + else + prev_hdr_ptr->hdr.next = hdr_ptr; + } + + /* OK, allocate the object from the current pool */ + data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */ + data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */ + hdr_ptr->hdr.bytes_used += sizeofobject; + hdr_ptr->hdr.bytes_left -= sizeofobject; + + return (void *) data_ptr; +} + + +/* + * Allocation of "large" objects. + * + * The external semantics of these are the same as "small" objects, + * except that FAR pointers are used on 80x86. However the pool + * management heuristics are quite different. We assume that each + * request is large enough that it may as well be passed directly to + * jpeg_get_large; the pool management just links everything together + * so that we can free it all on demand. + * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY + * structures. The routines that create these structures (see below) + * deliberately bunch rows together to ensure a large request size. + */ + +METHODDEF(void FAR *) +alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "large" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + large_pool_ptr hdr_ptr; + size_t odd_bytes; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr))) + out_of_memory(cinfo, 3); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* Always make a new pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject + + SIZEOF(large_pool_hdr)); + if (hdr_ptr == NULL) + out_of_memory(cinfo, 4); /* jpeg_get_large failed */ + mem->total_space_allocated += (long)(sizeofobject + SIZEOF(large_pool_hdr)); + + /* Success, initialize the new pool header and add to list */ + hdr_ptr->hdr.next = mem->large_list[pool_id]; + /* We maintain space counts in each pool header for statistical purposes, + * even though they are not needed for allocation. + */ + hdr_ptr->hdr.bytes_used = sizeofobject; + hdr_ptr->hdr.bytes_left = 0; + mem->large_list[pool_id] = hdr_ptr; + + return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */ +} + + +/* + * Creation of 2-D sample arrays. + * The pointers are in near heap, the samples themselves in FAR heap. + * + * To minimize allocation overhead and to allow I/O of large contiguous + * blocks, we allocate the sample rows in groups of as many rows as possible + * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request. + * NB: the virtual array control routines, later in this file, know about + * this chunking of rows. The rowsperchunk value is left in the mem manager + * object so that it can be saved away if this sarray is the workspace for + * a virtual array. + */ + +METHODDEF(JSAMPARRAY) +alloc_sarray (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, JDIMENSION numrows) +/* Allocate a 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JSAMPARRAY result; + JSAMPROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) samplesperrow * SIZEOF(JSAMPLE)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JSAMPARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JSAMPROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JSAMPROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow + * SIZEOF(JSAMPLE))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += samplesperrow; + } + } + + return result; +} + + +/* + * Creation of 2-D coefficient-block arrays. + * This is essentially the same as the code for sample arrays, above. + */ + +METHODDEF(JBLOCKARRAY) +alloc_barray (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, JDIMENSION numrows) +/* Allocate a 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JBLOCKARRAY result; + JBLOCKROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) blocksperrow * SIZEOF(JBLOCK)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JBLOCKARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JBLOCKROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JBLOCKROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow + * SIZEOF(JBLOCK))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += blocksperrow; + } + } + + return result; +} + + +#ifdef NEED_DARRAY + +/* + * Creation of 2-D difference arrays. + * This is essentially the same as the code for sample arrays, above. + */ + +METHODDEF(JDIFFARRAY) +alloc_darray (j_common_ptr cinfo, int pool_id, + JDIMENSION diffsperrow, JDIMENSION numrows) +/* Allocate a 2-D difference array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JDIFFARRAY result; + JDIFFROW workspace; + JDIMENSION rowsperchunk, currow, i; + size_t ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((size_t) diffsperrow * SIZEOF(JDIFF)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JDIFFARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JDIFFROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JDIFFROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) diffsperrow + * SIZEOF(JDIFF))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += diffsperrow; + } + } + + return result; +} + +#endif + + +/* + * About virtual array management: + * + * The above "normal" array routines are only used to allocate strip buffers + * (as wide as the image, but just a few rows high). Full-image-sized buffers + * are handled as "virtual" arrays. The array is still accessed a strip at a + * time, but the memory manager must save the whole array for repeated + * accesses. The intended implementation is that there is a strip buffer in + * memory (as high as is possible given the desired memory limit), plus a + * backing file that holds the rest of the array. + * + * The request_virt_array routines are told the total size of the image and + * the maximum number of rows that will be accessed at once. The in-memory + * buffer must be at least as large as the maxaccess value. + * + * The request routines create control blocks but not the in-memory buffers. + * That is postponed until realize_virt_arrays is called. At that time the + * total amount of space needed is known (approximately, anyway), so free + * memory can be divided up fairly. + * + * The access_virt_array routines are responsible for making a specific strip + * area accessible (after reading or writing the backing file, if necessary). + * Note that the access routines are told whether the caller intends to modify + * the accessed strip; during a read-only pass this saves having to rewrite + * data to disk. The access routines are also responsible for pre-zeroing + * any newly accessed rows, if pre-zeroing was requested. + * + * In current usage, the access requests are usually for nonoverlapping + * strips; that is, successive access start_row numbers differ by exactly + * num_rows = maxaccess. This means we can get good performance with simple + * buffer dump/reload logic, by making the in-memory buffer be a multiple + * of the access height; then there will never be accesses across bufferload + * boundaries. The code will still work with overlapping access requests, + * but it doesn't handle bufferload overlaps very efficiently. + */ + + +METHODDEF(jvirt_sarray_ptr) +request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION samplesperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_sarray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_sarray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->samplesperrow = samplesperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_sarray_list; /* add to list of virtual arrays */ + mem->virt_sarray_list = result; + + return result; +} + + +METHODDEF(jvirt_barray_ptr) +request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION blocksperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_barray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_barray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->blocksperrow = blocksperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_barray_list; /* add to list of virtual arrays */ + mem->virt_barray_list = result; + + return result; +} + + +METHODDEF(void) +realize_virt_arrays (j_common_ptr cinfo) +/* Allocate the in-memory buffers for any unrealized virtual arrays */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + size_t space_per_minheight, maximum_space, avail_mem; + size_t minheights, max_minheights; + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + /* Compute the minimum space needed (maxaccess rows in each buffer) + * and the maximum space needed (full image height in each buffer). + * These may be of use to the system-dependent jpeg_mem_available routine. + */ + space_per_minheight = 0; + maximum_space = 0; + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += sptr->maxaccess * + sptr->samplesperrow * SIZEOF(JSAMPLE); + maximum_space += sptr->rows_in_array * + sptr->samplesperrow * SIZEOF(JSAMPLE); + } + } + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += bptr->maxaccess * + bptr->blocksperrow * SIZEOF(JBLOCK); + maximum_space += bptr->rows_in_array * + bptr->blocksperrow * SIZEOF(JBLOCK); + } + } + + if (space_per_minheight <= 0) + return; /* no unrealized arrays, no work */ + + /* Determine amount of memory to actually use; this is system-dependent. */ + avail_mem = (size_t)jpeg_mem_available(cinfo, (long)space_per_minheight, (long)maximum_space, + mem->total_space_allocated); + + /* If the maximum space needed is available, make all the buffers full + * height; otherwise parcel it out with the same number of minheights + * in each buffer. + */ + if (avail_mem >= maximum_space) + max_minheights = 1000000000L; + else { + max_minheights = avail_mem / space_per_minheight; + /* If there doesn't seem to be enough space, try to get the minimum + * anyway. This allows a "stub" implementation of jpeg_mem_available(). + */ + if (max_minheights <= 0) + max_minheights = 1; + } + + /* Allocate the in-memory buffers and initialize backing store as needed. */ + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = (size_t)((sptr->rows_in_array - 1L) / sptr->maxaccess + 1L); + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + sptr->rows_in_mem = sptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + sptr->rows_in_mem = (JDIMENSION)max_minheights * sptr->maxaccess; + jpeg_open_backing_store(cinfo, & sptr->b_s_info, + (long) sptr->rows_in_array * + (long) sptr->samplesperrow * + (long) SIZEOF(JSAMPLE)); + sptr->b_s_open = TRUE; + } + sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE, + sptr->samplesperrow, sptr->rows_in_mem); + sptr->rowsperchunk = mem->last_rowsperchunk; + sptr->cur_start_row = 0; + sptr->first_undef_row = 0; + sptr->dirty = FALSE; + } + } + + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = (size_t)((bptr->rows_in_array - 1L) / bptr->maxaccess + 1L); + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + bptr->rows_in_mem = bptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + bptr->rows_in_mem = (JDIMENSION)max_minheights * bptr->maxaccess; + jpeg_open_backing_store(cinfo, & bptr->b_s_info, + (long) bptr->rows_in_array * + (long) bptr->blocksperrow * + (long) SIZEOF(JBLOCK)); + bptr->b_s_open = TRUE; + } + bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE, + bptr->blocksperrow, bptr->rows_in_mem); + bptr->rowsperchunk = mem->last_rowsperchunk; + bptr->cur_start_row = 0; + bptr->first_undef_row = 0; + bptr->dirty = FALSE; + } + } +} + + +LOCAL(void) +do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual sample array */ +{ + size_t bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = ptr->samplesperrow * SIZEOF(JSAMPLE); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = ptr->cur_start_row + i; + rows = MIN(rows, ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + file_offset += byte_count; + } +} + + +LOCAL(void) +do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual coefficient-block array */ +{ + size_t bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = ptr->blocksperrow * SIZEOF(JBLOCK); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = ptr->cur_start_row + i; + rows = MIN(rows, ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + (long)file_offset, (long)byte_count); + file_offset += byte_count; + } +} + + +METHODDEF(JSAMPARRAY) +access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual sample array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_sarray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_sarray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +METHODDEF(JBLOCKARRAY) +access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual block array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_barray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_barray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +/* + * Release all objects belonging to a specified pool. + */ + +METHODDEF(void) +free_pool (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + size_t space_freed; + + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + +#ifdef MEM_STATS + if (cinfo->err->trace_level > 1) + print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */ +#endif + + /* If freeing IMAGE pool, close any virtual arrays first */ + if (pool_id == JPOOL_IMAGE) { + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->b_s_open) { /* there may be no backing store */ + sptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info); + } + } + mem->virt_sarray_list = NULL; + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->b_s_open) { /* there may be no backing store */ + bptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info); + } + } + mem->virt_barray_list = NULL; + } + + /* Release large objects */ + lhdr_ptr = mem->large_list[pool_id]; + mem->large_list[pool_id] = NULL; + + while (lhdr_ptr != NULL) { + large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next; + space_freed = lhdr_ptr->hdr.bytes_used + + lhdr_ptr->hdr.bytes_left + + SIZEOF(large_pool_hdr); + jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed); + mem->total_space_allocated -= (long)space_freed; + lhdr_ptr = next_lhdr_ptr; + } + + /* Release small objects */ + shdr_ptr = mem->small_list[pool_id]; + mem->small_list[pool_id] = NULL; + + while (shdr_ptr != NULL) { + small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next; + space_freed = shdr_ptr->hdr.bytes_used + + shdr_ptr->hdr.bytes_left + + SIZEOF(small_pool_hdr); + jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed); + mem->total_space_allocated -= (long)space_freed; + shdr_ptr = next_shdr_ptr; + } +} + + +/* + * Close up shop entirely. + * Note that this cannot be called unless cinfo->mem is non-NULL. + */ + +METHODDEF(void) +self_destruct (j_common_ptr cinfo) +{ + int pool; + + /* Close all backing store, release all memory. + * Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + free_pool(cinfo, pool); + } + + /* Release the memory manager control block too. */ + jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr)); + cinfo->mem = NULL; /* ensures I will be called only once */ + + jpeg_mem_term(cinfo); /* system-dependent cleanup */ +} + + +/* + * Memory manager initialization. + * When this is called, only the error manager pointer is valid in cinfo! + */ + +GLOBAL(void) +jinit_memory_mgr (j_common_ptr cinfo) +{ + my_mem_ptr mem; + long max_to_use; + int pool; + size_t test_mac; + + cinfo->mem = NULL; /* for safety if init fails */ + + /* Check for configuration errors. + * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably + * doesn't reflect any real hardware alignment requirement. + * The test is a little tricky: for X>0, X and X-1 have no one-bits + * in common if and only if X is a power of 2, ie has only one one-bit. + * Some compilers may give an "unreachable code" warning here; ignore it. + */ + if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0) + ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE); + /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be + * a multiple of SIZEOF(ALIGN_TYPE). + * Again, an "unreachable code" warning may be ignored here. + * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK. + */ + test_mac = (size_t) MAX_ALLOC_CHUNK; + if ((long) test_mac != MAX_ALLOC_CHUNK || + (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) + ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); + + max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */ + + /* Attempt to allocate memory manager's control block */ + mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr)); + + if (mem == NULL) { + jpeg_mem_term(cinfo); /* system-dependent cleanup */ + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0); + } + + /* OK, fill in the method pointers */ + mem->pub.alloc_small = alloc_small; + mem->pub.alloc_large = alloc_large; + mem->pub.alloc_sarray = alloc_sarray; + mem->pub.alloc_barray = alloc_barray; +#ifdef NEED_DARRAY + mem->pub.alloc_darray = alloc_darray; +#endif + mem->pub.request_virt_sarray = request_virt_sarray; + mem->pub.request_virt_barray = request_virt_barray; + mem->pub.realize_virt_arrays = realize_virt_arrays; + mem->pub.access_virt_sarray = access_virt_sarray; + mem->pub.access_virt_barray = access_virt_barray; + mem->pub.free_pool = free_pool; + mem->pub.self_destruct = self_destruct; + + /* Make MAX_ALLOC_CHUNK accessible to other modules */ + mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK; + + /* Initialize working state */ + mem->pub.max_memory_to_use = max_to_use; + + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + mem->small_list[pool] = NULL; + mem->large_list[pool] = NULL; + } + mem->virt_sarray_list = NULL; + mem->virt_barray_list = NULL; + + mem->total_space_allocated = SIZEOF(my_memory_mgr); + + /* Declare ourselves open for business */ + cinfo->mem = & mem->pub; + + /* Check for an environment variable JPEGMEM; if found, override the + * default max_memory setting from jpeg_mem_init. Note that the + * surrounding application may again override this value. + * If your system doesn't support getenv(), define NO_GETENV to disable + * this feature. + */ +#ifndef NO_GETENV + { char * memenv; + + if ((memenv = getenv("JPEGMEM")) != NULL) { + char ch = 'x'; + + if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) { + if (ch == 'm' || ch == 'M') + max_to_use *= 1000L; + mem->pub.max_memory_to_use = max_to_use * 1000L; + } + } + } +#endif + +} diff --git a/dcmjpeg/libijg8/jmemnobs.c b/dcmjpeg/libijg8/jmemnobs.c new file mode 100644 index 00000000..78ae56f7 --- /dev/null +++ b/dcmjpeg/libijg8/jmemnobs.c @@ -0,0 +1,110 @@ +/* + * jmemnobs.c + * + * Copyright (C) 1992-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides a really simple implementation of the system- + * dependent portion of the JPEG memory manager. This implementation + * assumes that no backing-store files are needed: all required space + * can be obtained from malloc(). + * This is very portable in the sense that it'll compile on almost anything, + * but you'd better have lots of main memory (or virtual memory) if you want + * to process big images. + * Note that the max_memory_to_use option is ignored by this implementation. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" +#include "jmemsys8.h" /* import the system-dependent declarations */ + +#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +#endif + + +/* + * Memory allocation and freeing are controlled by the regular library + * routines malloc() and free(). + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * "Large" objects are treated the same as "small" ones. + * NB: although we include FAR keywords in the routine declarations, + * this file won't actually work in 80x86 small/medium model; at least, + * you probably won't be able to process useful-size images in only 64KB. + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + + free(object); +} + + +/* + * This routine computes the total memory space available for allocation. + * Here we always say, "we got all you want bud!" + */ + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + return max_bytes_needed; +} + + +/* + * Backing store (temporary file) management. + * Since jpeg_mem_available always promised the moon, + * this should never be called and we can just error out. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + ERREXIT(cinfo, JERR_NO_BACKING_STORE); +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. Here, there isn't any. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + return 0; /* just set max_memory_to_use to 0 */ +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* no work */ +} diff --git a/dcmjpeg/libijg8/jmemsys8.h b/dcmjpeg/libijg8/jmemsys8.h new file mode 100644 index 00000000..fc59f420 --- /dev/null +++ b/dcmjpeg/libijg8/jmemsys8.h @@ -0,0 +1,198 @@ +/* + * jmemsys.h + * + * Copyright (C) 1992-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file defines the interface between the system-independent + * and system-dependent portions of the JPEG memory manager. No other + * modules need include it. (The system-independent portion is jmemmgr.c; + * there are several different versions of the system-dependent portion.) + * + * This file works as-is for the system-dependent memory managers supplied + * in the IJG distribution. You may need to modify it if you write a + * custom memory manager. If system-dependent changes are needed in + * this file, the best method is to #ifdef them based on a configuration + * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR + * and USE_MAC_MEMMGR. + */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_get_small jpeg8_get_small +#define jpeg_free_small jpeg8_free_small +#define jpeg_get_large jpeg8_get_large +#define jpeg_free_large jpeg8_free_large +#define jpeg_mem_available jpeg8_mem_available +#define jpeg_open_backing_store jpeg8_open_backing_store +#define jpeg_mem_init jpeg8_mem_init +#define jpeg_mem_term jpeg8_mem_term +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* + * These two functions are used to allocate and release small chunks of + * memory. (Typically the total amount requested through jpeg_get_small is + * no more than 20K or so; this will be requested in chunks of a few K each.) + * Behavior should be the same as for the standard library functions malloc + * and free; in particular, jpeg_get_small must return NULL on failure. + * On most systems, these ARE malloc and free. jpeg_free_small is passed the + * size of the object being freed, just in case it's needed. + * On an 80x86 machine using small-data memory model, these manage near heap. + */ + +EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject)); +EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object, + size_t sizeofobject)); + +/* + * These two functions are used to allocate and release large chunks of + * memory (up to the total free space designated by jpeg_mem_available). + * The interface is the same as above, except that on an 80x86 machine, + * far pointers are used. On most other machines these are identical to + * the jpeg_get/free_small routines; but we keep them separate anyway, + * in case a different allocation strategy is desirable for large chunks. + */ + +EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo, + size_t sizeofobject)); +EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object, + size_t sizeofobject)); + +/* + * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may + * be requested in a single call to jpeg_get_large (and jpeg_get_small for that + * matter, but that case should never come into play). This macro is needed + * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. + * On those machines, we expect that jconfig.h will provide a proper value. + * On machines with 32-bit flat address spaces, any large constant may be used. + * + * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type + * size_t and will be a multiple of sizeof(align_type). + */ + +#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */ +#define MAX_ALLOC_CHUNK 1000000000L +#endif + +/* + * This routine computes the total space still available for allocation by + * jpeg_get_large. If more space than this is needed, backing store will be + * used. NOTE: any memory already allocated must not be counted. + * + * There is a minimum space requirement, corresponding to the minimum + * feasible buffer sizes; jmemmgr.c will request that much space even if + * jpeg_mem_available returns zero. The maximum space needed, enough to hold + * all working storage in memory, is also passed in case it is useful. + * Finally, the total space already allocated is passed. If no better + * method is available, cinfo->mem->max_memory_to_use - already_allocated + * is often a suitable calculation. + * + * It is OK for jpeg_mem_available to underestimate the space available + * (that'll just lead to more backing-store access than is really necessary). + * However, an overestimate will lead to failure. Hence it's wise to subtract + * a slop factor from the true available space. 5% should be enough. + * + * On machines with lots of virtual memory, any large constant may be returned. + * Conversely, zero may be returned to always use the minimum amount of memory. + */ + +EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo, + long min_bytes_needed, + long max_bytes_needed, + long already_allocated)); + + +/* + * This structure holds whatever state is needed to access a single + * backing-store object. The read/write/close method pointers are called + * by jmemmgr.c to manipulate the backing-store object; all other fields + * are private to the system-dependent backing store routines. + */ + +#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ + + +#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */ + +typedef unsigned short XMSH; /* type of extended-memory handles */ +typedef unsigned short EMSH; /* type of expanded-memory handles */ + +typedef union { + short file_handle; /* DOS file handle if it's a temp file */ + XMSH xms_handle; /* handle if it's a chunk of XMS */ + EMSH ems_handle; /* handle if it's a chunk of EMS */ +} handle_union; + +#endif /* USE_MSDOS_MEMMGR */ + +#ifdef USE_MAC_MEMMGR /* Mac-specific junk */ +#include +#endif /* USE_MAC_MEMMGR */ + + +typedef struct backing_store_struct * backing_store_ptr; + +typedef struct backing_store_struct { + /* Methods for reading/writing/closing this backing-store object */ + JMETHOD(void, read_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, write_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, close_backing_store, (j_common_ptr cinfo, + backing_store_ptr info)); + + /* Private fields for system-dependent backing-store management */ +#ifdef USE_MSDOS_MEMMGR + /* For the MS-DOS manager (jmemdos.c), we need: */ + handle_union handle; /* reference to backing-store storage object */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else +#ifdef USE_MAC_MEMMGR + /* For the Mac manager (jmemmac.c), we need: */ + short temp_file; /* file reference number to temp file */ + FSSpec tempSpec; /* the FSSpec for the temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else + /* For a typical implementation with temp files, we need: */ + FILE * temp_file; /* stdio reference to temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ +#endif +#endif +} backing_store_info; + + +/* + * Initial opening of a backing-store object. This must fill in the + * read/write/close pointers in the object. The read/write routines + * may take an error exit if the specified maximum file size is exceeded. + * (If jpeg_mem_available always returns a large value, this routine can + * just take an error exit.) + */ + +EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo, + backing_store_ptr info, + long total_bytes_needed)); + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. jpeg_mem_init will be called before anything is + * allocated (and, therefore, nothing in cinfo is of use except the error + * manager pointer). It should return a suitable default value for + * max_memory_to_use; this may subsequently be overridden by the surrounding + * application. (Note that max_memory_to_use is only important if + * jpeg_mem_available chooses to consult it ... no one else will.) + * jpeg_mem_term may assume that all requested memory has been freed and that + * all opened backing-store objects have been closed. + */ + +EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo)); diff --git a/dcmjpeg/libijg8/jmorecfg8.h b/dcmjpeg/libijg8/jmorecfg8.h new file mode 100644 index 00000000..26970dbb --- /dev/null +++ b/dcmjpeg/libijg8/jmorecfg8.h @@ -0,0 +1,407 @@ +/* + * jmorecfg.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains additional configuration options that customize the + * JPEG software for special applications or support machine-dependent + * optimizations. Most users will not need to touch this file. + */ + + +#include "dcmtk/ofstd/ofexport.h" /* for DCMTK_DECL_EXPORT */ + +#ifdef ijg8_EXPORTS +#define DCMTK_IJG8_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_IJG8_EXPORT DCMTK_DECL_IMPORT +#endif + + +/* + * Define BITS_IN_JSAMPLE as either + * 8 for 8-bit sample values (the usual setting) + * 12 for 12-bit sample values + * Only 8 and 12 are legal data precisions for lossy JPEG according to the + * JPEG standard, and the IJG code does not support anything else! + * We do not support run-time selection of data precision, sorry. + */ + +#define BITS_IN_JSAMPLE 8 /* use 8 or 12 (or 16 for lossless) */ + + +/* + * Maximum number of components (color channels) allowed in JPEG image. + * To meet the letter of the JPEG spec, set this to 255. However, darn + * few applications need more than 4 channels (maybe 5 for CMYK + alpha + * mask). We recommend 10 as a reasonable compromise; use 4 if you are + * really short on memory. (Each allowed component costs a hundred or so + * bytes of storage, whether actually used in an image or not.) + */ + +#define MAX_COMPONENTS 10 /* maximum number of image components */ + + +/* + * Basic data types. + * You may need to change these if you have a machine with unusual data + * type sizes; for example, "char" not 8 bits, "short" not 16 bits, + * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, + * but it had better be at least 16. + */ + +/* Representation of a single sample (pixel element value). + * We frequently allocate large arrays of these, so it's important to keep + * them small. But if you have memory to burn and access to char or short + * arrays is very slow on your hardware, you might want to change these. + */ + +#if BITS_IN_JSAMPLE == 8 +/* JSAMPLE should be the smallest type that will hold the values 0..255. + * You can use a signed char by having GETJSAMPLE mask it with 0xFF. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JSAMPLE; +#ifdef CHAR_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + +#define MAXJSAMPLE 255 +#define CENTERJSAMPLE 128 + +#endif /* BITS_IN_JSAMPLE == 8 */ + + +#if BITS_IN_JSAMPLE == 12 +/* JSAMPLE should be the smallest type that will hold the values 0..4095. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 4095 +#define CENTERJSAMPLE 2048 + +#endif /* BITS_IN_JSAMPLE == 12 */ + + +#if BITS_IN_JSAMPLE == 16 +/* JSAMPLE should be the smallest type that will hold the values 0..65535. + * You can use a signed short by having GETJSAMPLE mask it with 0xFFFF. + */ + +#ifdef HAVE_UNSIGNED_SHORT + +typedef unsigned short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_SHORT */ + +typedef short JSAMPLE; +#ifdef SHORT_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFFFF) +#endif /* SHORT_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_SHORT */ + +#define MAXJSAMPLE 65535 +#define CENTERJSAMPLE 32768 + +#endif /* BITS_IN_JSAMPLE == 16 */ + + +/* Representation of a DCT frequency coefficient. + * This should be a signed value of at least 16 bits; "short" is usually OK. + * Again, we allocate large arrays of these, but you can change to int + * if you have memory to burn and "short" is really slow. + */ + +typedef short JCOEF; + + +/* Representation of a spatial difference value. + * This should be a signed value of at least 16 bits; int is usually OK. + */ + +typedef int JDIFF; + + +/* Compressed datastreams are represented as arrays of JOCTET. + * These must be EXACTLY 8 bits wide, at least once they are written to + * external storage. Note that when using the stdio data source/destination + * managers, this is also the data type passed to fread/fwrite. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JOCTET; +#define GETJOCTET(value) (value) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JOCTET; +#ifdef CHAR_IS_UNSIGNED +#define GETJOCTET(value) (value) +#else +#define GETJOCTET(value) ((value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + + +/* These typedefs are used for various table entries and so forth. + * They must be at least as wide as specified; but making them too big + * won't cost a huge amount of memory, so we don't provide special + * extraction code like we did for JSAMPLE. (In other words, these + * typedefs live at a different point on the speed/space tradeoff curve.) + */ + +/* UINT8 must hold at least the values 0..255. */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char UINT8; +#else /* not HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char UINT8; +#else /* not CHAR_IS_UNSIGNED */ +typedef short UINT8; +#endif /* CHAR_IS_UNSIGNED */ +#endif /* HAVE_UNSIGNED_CHAR */ + +/* UINT16 must hold at least the values 0..65535. */ + +#ifdef HAVE_UNSIGNED_SHORT +typedef unsigned short UINT16; +#else /* not HAVE_UNSIGNED_SHORT */ +typedef unsigned int UINT16; +#endif /* HAVE_UNSIGNED_SHORT */ + +/* INT16 must hold at least the values -32768..32767. */ + +#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ +typedef short INT16; +#endif + +/* IJG_INT32 must hold at least signed 32-bit values. */ +typedef long IJG_INT32; + +/* Datatype used for image dimensions. The JPEG standard only supports + * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore + * "unsigned int" is sufficient on all machines. However, if you need to + * handle larger images and you don't mind deviating from the spec, you + * can change this datatype. + */ + +typedef unsigned int JDIMENSION; + +#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ + + +/* These macros are used in all function definitions and extern declarations. + * You could modify them if you need to change function linkage conventions; + * in particular, you'll need to do that to make the library a Windows DLL. + * Another application is to make all functions global for use with debuggers + * or code profilers that require it. + */ + +/* a function called through method pointers: */ +#define METHODDEF(type) static type +/* a function used only in its module: */ +#define LOCAL(type) static type +/* a function referenced thru EXTERNs: */ +#define GLOBAL(type) type +/* a reference to a GLOBAL function: */ +#define EXTERN(type) extern DCMTK_IJG8_EXPORT type + + +/* This macro is used to declare a "method", that is, a function pointer. + * We want to supply prototype parameters if the compiler can cope. + * Note that the arglist parameter must be parenthesized! + * Again, you can customize this if you need special linkage keywords. + */ + +#ifdef HAVE_PROTOTYPES +#define JMETHOD(type,methodname,arglist) type (*methodname) arglist +#else +#define JMETHOD(type,methodname,arglist) type (*methodname) () +#endif + + +/* Here is the pseudo-keyword for declaring pointers that must be "far" + * on 80x86 machines. Most of the specialized coding for 80x86 is handled + * by just saying "FAR *" where such a pointer is needed. In a few places + * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. + */ + +#undef FAR +#ifdef NEED_FAR_POINTERS +#define FAR far +#else +#define FAR +#endif + + +/* + * On a few systems, type boolean and/or its values FALSE, TRUE may appear + * in standard header files. Or you may have conflicts with application- + * specific header files that you want to include together with these files. + * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. + */ + +#ifndef HAVE_BOOLEAN +typedef int boolean; +#endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif + + +/* + * The remaining options affect code selection within the JPEG library, + * but they don't need to be visible to most applications using the library. + * To minimize application namespace pollution, the symbols won't be + * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. + */ + +#ifdef JPEG_INTERNALS +#define JPEG_INTERNAL_OPTIONS +#endif + +#ifdef JPEG_INTERNAL_OPTIONS + + +/* + * These defines indicate whether to include various optional functions. + * Undefining some of these symbols will produce a smaller but less capable + * library. Note that you can leave certain source files out of the + * compilation/linking process if you've #undef'd the corresponding symbols. + * (You may HAVE to do that if your compiler doesn't like null source files.) + */ + +/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ + +/* Capability options common to encoder and decoder: */ + +#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ +#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ +#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ + +/* Encoder capability options: */ + +#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */ +#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ +/* Note: if you selected 12-bit data precision, it is dangerous to turn off + * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit + * precision, so jcshuff.c normally uses entropy optimization to compute + * usable tables for higher precision. If you don't want to do optimization, + * you'll have to supply different default Huffman tables. + * The exact same statements apply for progressive and lossless JPEG: + * the default tables don't work for progressive mode or lossless mode. + * (This may get fixed, however.) + */ +#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ + +/* Decoder capability options: */ + +#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */ +#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ +#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ +#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ +#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ +#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ +#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ +#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ + +/* more capability options later, no doubt */ + + +/* + * Ordering of RGB data in scanlines passed to or from the application. + * If your application wants to deal with data in the order B,G,R, just + * change these macros. You can also deal with formats such as R,G,B,X + * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing + * the offsets will also change the order in which colormap data is organized. + * RESTRICTIONS: + * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. + * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not + * useful if you are using JPEG color spaces other than YCbCr or grayscale. + * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE + * is not 3 (they don't understand about dummy color components!). So you + * can't use color quantization if you change that value. + */ + +#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ +#define RGB_GREEN 1 /* Offset of Green */ +#define RGB_BLUE 2 /* Offset of Blue */ +#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ + + +/* Definitions for speed-related optimizations. */ + + +/* If your compiler supports inline functions, define INLINE + * as the inline keyword; otherwise define it as empty. + */ + +#ifndef INLINE +#ifdef __GNUC__ /* for instance, GNU C knows about inline */ +#define INLINE __inline__ +#endif +#ifndef INLINE +#define INLINE /* default is to define it as empty */ +#endif +#endif + + +/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying + * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER + * as short on such a machine. MULTIPLIER must be at least 16 bits wide. + */ + +#ifndef MULTIPLIER +#define MULTIPLIER int /* type for fastest integer multiply */ +#endif + + +/* FAST_FLOAT should be either float or double, whichever is done faster + * by your compiler. (Note that this type is only used in the floating point + * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) + * Typically, float is faster in ANSI C compilers, while double is faster in + * pre-ANSI compilers (because they insist on converting to double anyway). + * The code below therefore chooses float if we have ANSI-style prototypes. + */ + +#ifndef FAST_FLOAT +#ifdef HAVE_PROTOTYPES +#define FAST_FLOAT float +#else +#define FAST_FLOAT double +#endif +#endif + +#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/dcmjpeg/libijg8/jpegint8.h b/dcmjpeg/libijg8/jpegint8.h new file mode 100644 index 00000000..0218018c --- /dev/null +++ b/dcmjpeg/libijg8/jpegint8.h @@ -0,0 +1,373 @@ +/* + * jpegint.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides common declarations for the various JPEG modules. + * These declarations are considered internal to the JPEG library; most + * applications using the library shouldn't need to include this file. + */ + + +/* Declarations for both compression & decompression */ + +typedef enum { /* Operating modes for buffer controllers */ + JBUF_PASS_THRU, /* Plain stripwise operation */ + /* Remaining modes require a full-image buffer to have been created */ + JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ + JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ + JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ +} J_BUF_MODE; + +/* Values of global_state field (jdapi.c has some dependencies on ordering!) */ +#define CSTATE_START 100 /* after create_compress */ +#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ +#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ +#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ +#define DSTATE_START 200 /* after create_decompress */ +#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ +#define DSTATE_READY 202 /* found SOS, ready for start_decompress */ +#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ +#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ +#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ +#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ +#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ +#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ +#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ +#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ + + +/* Declarations for compression modules */ + +/* Master control module */ +struct jpeg_comp_master { + JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo)); + JMETHOD(void, pass_startup, (j_compress_ptr cinfo)); + JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean call_pass_startup; /* True if pass_startup must be called */ + boolean is_last_pass; /* True during last pass */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_c_main_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail)); +}; + +/* Compression preprocessing (downsampling input buffer control) */ +struct jpeg_c_prep_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, pre_process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, + JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail)); +}; + +/* Compression codec (compressor proper) */ +struct jpeg_c_codec { + JMETHOD(void, entropy_start_pass, (j_compress_ptr cinfo, + boolean gather_statistics)); + JMETHOD(void, entropy_finish_pass, (j_compress_ptr cinfo)); + JMETHOD(boolean, need_optimization_pass, (j_compress_ptr cinfo)); + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(boolean, compress_data, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf)); +}; + +/* Colorspace conversion */ +struct jpeg_color_converter { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, color_convert, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows)); +}; + +/* Downsampling */ +struct jpeg_downsampler { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, downsample, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, + JDIMENSION out_row_group_index)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Marker writing */ +struct jpeg_marker_writer { + JMETHOD(void, write_file_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_frame_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_scan_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo)); + JMETHOD(void, write_tables_only, (j_compress_ptr cinfo)); + /* These routines are exported to allow insertion of extra markers */ + /* Probably only COM and APPn markers should be written this way */ + JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker, + unsigned int datalen)); + JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val)); +}; + + +/* Declarations for decompression modules */ + +/* Master control module */ +struct jpeg_decomp_master { + JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ +}; + +/* Input control module */ +struct jpeg_input_controller { + JMETHOD(int, consume_input, (j_decompress_ptr cinfo)); + JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo)); + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean has_multiple_scans; /* True if file has multiple scans */ + boolean eoi_reached; /* True when EOI has been consumed */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_d_main_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Decompression codec (decompressor proper) */ +struct jpeg_d_codec { + JMETHOD(void, calc_output_dimensions, (j_decompress_ptr cinfo)); + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, consume_data, (j_decompress_ptr cinfo)); + JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, decompress_data, (j_decompress_ptr cinfo, + JSAMPIMAGE output_buf)); +}; + +/* Decompression postprocessing (color quantization buffer control) */ +struct jpeg_d_post_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, post_process_data, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Marker reading & parsing */ +struct jpeg_marker_reader { + JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo)); + /* Read markers until SOS or EOI. + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + */ + JMETHOD(int, read_markers, (j_decompress_ptr cinfo)); + /* Read a restart marker --- exported for use by entropy decoder only */ + jpeg_marker_parser_method read_restart_marker; + + /* State of marker reader --- nominally internal, but applications + * supplying COM or APPn handlers might like to know the state. + */ + boolean saw_SOI; /* found SOI? */ + boolean saw_SOF; /* found SOF? */ + int next_restart_num; /* next restart number expected (0-7) */ + unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ +}; + +/* Upsampling (note that upsampler must also call color converter) */ +struct jpeg_upsampler { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, upsample, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Colorspace conversion */ +struct jpeg_color_deconverter { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, color_convert, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows)); +}; + +/* Color quantization or color precision reduction */ +struct jpeg_color_quantizer { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan)); + JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, + int num_rows)); + JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); +}; + + +/* Miscellaneous useful macros */ + +#undef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#undef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + + +/* We assume that right shift corresponds to signed division by 2 with + * rounding towards minus infinity. This is correct for typical "arithmetic + * shift" instructions that shift in copies of the sign bit. But some + * C compilers implement >> with an unsigned shift. For these machines you + * must define RIGHT_SHIFT_IS_UNSIGNED. + * RIGHT_SHIFT provides a proper signed right shift of an IJG_INT32 quantity. + * It is only applied with constant shift counts. SHIFT_TEMPS must be + * included in the variables of any routine using RIGHT_SHIFT. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define SHIFT_TEMPS IJG_INT32 shift_temp; +#define RIGHT_SHIFT(x,shft) \ + ((shift_temp = (x)) < 0 ? \ + (shift_temp >> (shft)) | ((~((IJG_INT32) 0)) << (32-(shft))) : \ + (shift_temp >> (shft))) +#else +#define SHIFT_TEMPS +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jinit_c_codec jinit8_c_codec +#define jinit_c_diff_controller jinit8_c_diff_controller +#define jinit_lossy_c_codec jinit8_lossy_c_codec +#define jinit_lossless_c_codec jinit8_lossless_c_codec +#define jinit_compress_master jinit8_compress_master +#define jinit_c_master_control jinit8_c_master_control +#define jinit_c_main_controller jinit8_c_main_controller +#define jinit_c_prep_controller jinit8_c_prep_controller +#define jinit_c_coef_controller jinit8_c_coef_controller +#define jinit_color_converter jinit8_color_converter +#define jinit_downsampler jinit8_downsampler +#define jinit_forward_dct jinit8_forward_dct +#define jinit_shuff_encoder jinit8_shuff_encoder +#define jinit_phuff_encoder jinit8_phuff_encoder +#ifdef WITH_ARITHMETIC_PATCH +#define jinit_arith_encoder jinit8_arith_encoder +#endif +#define jinit_marker_writer jinit8_marker_writer +#define jinit_d_codec jinit8_d_codec +#define jinit_lossy_d_codec jinit8_lossy_d_codec +#define jinit_lossless_d_codec jinit8_lossless_d_codec +#define jinit_master_decompress jinit8_master_decompress +#define jinit_d_main_controller jinit8_d_main_controller +#define jinit_d_coef_controller jinit8_d_coef_controller +#define jinit_d_diff_controller jinit8_d_diff_controller +#define jinit_d_post_controller jinit8_d_post_controller +#define jinit_input_controller jinit8_input_controller +#define jinit_marker_reader jinit8_marker_reader +#define jinit_shuff_decoder jinit8_shuff_decoder +#define jinit_phuff_decoder jinit8_phuff_decoder +#ifdef WITH_ARITHMETIC_PATCH +#define jinit_arith_decoder jinit8_arith_decoder +#endif +#define jinit_lhuff_decoder jinit8_lhuff_decoder +#define jinit_undifferencer jinit8_undifferencer +#define jinit_d_scaler jinit8_d_scaler +#define jinit_inverse_dct jinit8_inverse_dct +#define jinit_upsampler jinit8_upsampler +#define jinit_color_deconverter jinit8_color_deconverter +#define jinit_1pass_quantizer jinit8_1pass_quantizer +#define jinit_2pass_quantizer jinit8_2pass_quantizer +#define jinit_merged_upsampler jinit8_merged_upsampler +#define jinit_memory_mgr jinit8_memory_mgr +#define jdiv_round_up jdiv8_round_up +#define jround_up jround8_up +#define jcopy_sample_rows jcopy8_sample_rows +#define jcopy_block_row jcopy8_block_row +#define jzero_far jzero8_far +#define jpeg_zigzag_order jpeg8_zigzag_order +#define jpeg_natural_order jpeg8_natural_order +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Compression module initialization routines */ +EXTERN(void) jinit_c_codec JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_diff_controller JPP((j_compress_ptr cinfo, boolean need_full_buffer)); +EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo, + boolean transcode_only)); +EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_compressor JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); +#ifdef WITH_ARITHMETIC_PATCH +EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo)); +#endif +/* Decompression module initialization routines */ +EXTERN(void) jinit_d_codec JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_diff_controller JPP((j_decompress_ptr cinfo, boolean need_full_buffer)); +EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_decompressor JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); +#ifdef WITH_ARITHMETIC_PATCH +EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo)); +#endif +EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo)); +/* Memory manager initialization */ +EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo)); + +/* Utility routines in jutils.c */ +EXTERN(long) jdiv_round_up JPP((long a, long b)); +EXTERN(long) jround_up JPP((long a, long b)); +EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols)); +EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks)); +EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero)); +/* Constant tables in jutils.c */ +#if 0 /* This table is not actually needed in v6a */ +extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ +#endif +extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ + +/* Suppress undefined-structure complaints if necessary. */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +#endif +#endif /* INCOMPLETE_TYPES_BROKEN */ diff --git a/dcmjpeg/libijg8/jpeglib8.h b/dcmjpeg/libijg8/jpeglib8.h new file mode 100644 index 00000000..3cb2bf18 --- /dev/null +++ b/dcmjpeg/libijg8/jpeglib8.h @@ -0,0 +1,1211 @@ +/* + * jpeglib.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the application interface for the JPEG library. + * Most applications using the library need only include this file, + * and perhaps jerror.h if they want to know the exact error codes. + */ + +#ifndef JPEGLIB_H +#define JPEGLIB_H + +/* + * First we include the configuration files that record how this + * installation of the JPEG library is set up. jconfig.h can be + * generated automatically for many systems. jmorecfg.h contains + * manual configuration options that most people need not worry about. + */ + +#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ +#include "jconfig8.h" /* widely used configuration options */ +#endif +#include "jmorecfg8.h" /* seldom changed options */ + + +/* Version ID for the JPEG library. + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". + */ + +#define JPEG_LIB_VERSION 62 /* Version 6b */ + + +/* Various constants determining the sizes of things. + * All of these are specified by the JPEG standard, so don't change them + * if you want to be compatible. + */ + +#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ +#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ +#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ +#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ +#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ +#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ +#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ +/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; + * the PostScript DCT filter can emit files with many more than 10 data units + * per MCU. + * If you happen to run across such a file, you can up D_MAX_DATA_UNITS_IN_MCU + * to handle it. We even let you do this from the jconfig.h file. However, + * we strongly discourage changing C_MAX_DATA_UNITS_IN_MCU; just because Adobe + * sometimes emits noncompliant files doesn't mean you should too. + */ +#define C_MAX_DATA_UNITS_IN_MCU 10 /* compressor's limit on data units/MCU */ +#ifndef D_MAX_DATA_UNITS_IN_MCU +#define D_MAX_DATA_UNITS_IN_MCU 10 /* decompressor's limit on data units/MCU */ +#endif + + +/* Data structures for images (arrays of samples and of DCT coefficients). + * On 80x86 machines, the image arrays are too big for near pointers, + * but the pointer arrays can fit in near memory. + */ + +typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ +typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ +typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ + +typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ +typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ +typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ +typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ + +typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ + +typedef JDIFF FAR *JDIFFROW; /* pointer to one row of difference values */ +typedef JDIFFROW *JDIFFARRAY; /* ptr to some rows (a 2-D diff array) */ +typedef JDIFFARRAY *JDIFFIMAGE; /* a 3-D diff array: top index is color */ + + +/* Types for JPEG compression parameters and working tables. */ + + +/* DCT coefficient quantization tables. */ + +typedef struct { + /* This array gives the coefficient quantizers in natural array order + * (not the zigzag order in which they are stored in a JPEG DQT marker). + * CAUTION: IJG versions prior to v6a kept this array in zigzag order. + */ + UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JQUANT_TBL; + + +/* Huffman coding tables. */ + +typedef struct { + /* These two fields directly represent the contents of a JPEG DHT marker */ + UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ + /* length k bits; bits[0] is unused */ + UINT8 huffval[256]; /* The symbols, in order of incr code length */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JHUFF_TBL; + + +/* Basic info about one component (color channel). */ + +typedef struct { + /* These values are fixed over the whole image. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOF marker. */ + int component_id; /* identifier for this component (0..255) */ + int component_index; /* its index in SOF or cinfo->comp_info[] */ + int h_samp_factor; /* horizontal sampling factor (1..4) */ + int v_samp_factor; /* vertical sampling factor (1..4) */ + int quant_tbl_no; /* quantization table selector (0..3) */ + /* These values may vary between scans. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOS marker. */ + /* The decompressor output side may not use these variables. */ + int dc_tbl_no; /* DC entropy table selector (0..3) */ + int ac_tbl_no; /* AC entropy table selector (0..3) */ + + /* Remaining fields should be treated as private by applications. */ + + /* These values are computed during compression or decompression startup: */ + /* Component's size in data units. + * Any dummy data units added to complete an MCU are not counted; therefore + * these values do not depend on whether a scan is interleaved or not. + */ + JDIMENSION width_in_data_units; + JDIMENSION height_in_data_units; + /* Size of a data unit in/output by the codec (in samples). Always + * data_unit for compression. For decompression this is the size of the + * output from one data_unit, reflecting any processing performed by the + * codec. For example, in the DCT-based codec, scaling may be applied + * during the IDCT step. Values of 1,2,4,8 are likely to be supported. + * Note that different components may have different codec_data_unit sizes. + */ + int codec_data_unit; + /* The downsampled dimensions are the component's actual, unpadded number + * of samples at the main buffer (preprocessing/compression interface), thus + * downsampled_width = ceil(image_width * Hi/Hmax) + * and similarly for height. For decompression, codec-based processing is + * included (ie, IDCT scaling), so + * downsampled_width = ceil(image_width * Hi/Hmax * codec_data_unit/data_unit) + */ + JDIMENSION downsampled_width; /* actual width in samples */ + JDIMENSION downsampled_height; /* actual height in samples */ + /* This flag is used only for decompression. In cases where some of the + * components will be ignored (eg grayscale output from YCbCr image), + * we can skip most computations for the unused components. + */ + boolean component_needed; /* do we need the value of this component? */ + + /* These values are computed before starting a scan of the component. */ + /* The decompressor output side may not use these variables. */ + int MCU_width; /* number of data units per MCU, horizontally */ + int MCU_height; /* number of data units per MCU, vertically */ + int MCU_data_units; /* MCU_width * MCU_height */ + int MCU_sample_width; /* MCU width in samples, MCU_width*codec_data_unit */ + int last_col_width; /* # of non-dummy data_units across in last MCU */ + int last_row_height; /* # of non-dummy data_units down in last MCU */ + + /* Saved quantization table for component; NULL if none yet saved. + * See jdinput.c comments about the need for this information. + * This field is currently used only for decompression. + */ + JQUANT_TBL * quant_table; + + /* Private per-component storage for DCT or IDCT subsystem. */ + void * dct_table; +} jpeg_component_info; + + +/* The script for encoding a multiple-scan file is an array of these: */ + +typedef struct { + int comps_in_scan; /* number of components encoded in this scan */ + int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ + int Ss, Se; /* progressive JPEG spectral selection parms + lossless JPEG predictor select parm (Ss) */ + int Ah, Al; /* progressive JPEG successive approx. parms + lossless JPEG point transform parm (Al) */ +} jpeg_scan_info; + +/* The decompressor can save APPn and COM markers in a list of these: */ + +typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; + +struct jpeg_marker_struct { + jpeg_saved_marker_ptr next; /* next in list, or NULL */ + UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ + unsigned int original_length; /* # bytes of data in the file */ + unsigned int data_length; /* # bytes of data saved at data[] */ + JOCTET FAR * data; /* the data contained in the marker */ + /* the marker length word is not counted in data_length or original_length */ +}; + +/* Known codec processes. */ + +typedef enum { + JPROC_SEQUENTIAL, /* baseline/extended sequential DCT */ + JPROC_PROGRESSIVE, /* progressive DCT */ + JPROC_LOSSLESS /* lossless (sequential) */ +} J_CODEC_PROCESS; + +/* Known color spaces. */ + +typedef enum { + JCS_UNKNOWN, /* error/unspecified */ + JCS_GRAYSCALE, /* monochrome */ + JCS_RGB, /* red/green/blue */ + JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ + JCS_CMYK, /* C/M/Y/K */ + JCS_YCCK /* Y/Cb/Cr/K */ +} J_COLOR_SPACE; + +/* DCT/IDCT algorithm options. */ + +typedef enum { + JDCT_ISLOW, /* slow but accurate integer algorithm */ + JDCT_IFAST, /* faster, less accurate integer method */ + JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ +} J_DCT_METHOD; + +#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ +#define JDCT_DEFAULT JDCT_ISLOW +#endif +#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ +#define JDCT_FASTEST JDCT_IFAST +#endif + +/* Dithering options for decompression. */ + +typedef enum { + JDITHER_NONE, /* no dithering */ + JDITHER_ORDERED, /* simple ordered dither */ + JDITHER_FS /* Floyd-Steinberg error diffusion dither */ +} J_DITHER_MODE; + + +/* Common fields between JPEG compression and decompression master structs. */ + +#define jpeg_common_fields \ + struct jpeg_error_mgr * err; /* Error handler module */\ + struct jpeg_memory_mgr * mem; /* Memory manager module */\ + struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ + void * client_data; /* Available for use by application */\ + boolean is_decompressor; /* So common code can tell which is which */\ + int global_state /* For checking call sequence validity */ + +/* Routines that are to be used by both halves of the library are declared + * to receive a pointer to this structure. There are no actual instances of + * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. + */ +struct jpeg_common_struct { + jpeg_common_fields; /* Fields common to both master struct types */ + /* Additional fields follow in an actual jpeg_compress_struct or + * jpeg_decompress_struct. All three structs must agree on these + * initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct jpeg_common_struct * j_common_ptr; +typedef struct jpeg_compress_struct * j_compress_ptr; +typedef struct jpeg_decompress_struct * j_decompress_ptr; + + +/* Master record for a compression instance */ + +struct jpeg_compress_struct { + jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ + + /* Destination for compressed data */ + struct jpeg_destination_mgr * dest; + + /* Description of source image --- these fields must be filled in by + * outer application before starting compression. in_color_space must + * be correct before you can even call jpeg_set_defaults(). + */ + + JDIMENSION image_width; /* input image width */ + JDIMENSION image_height; /* input image height */ + int input_components; /* # of color components in input image */ + J_COLOR_SPACE in_color_space; /* colorspace of input image */ + + double input_gamma; /* image gamma of input image */ + + /* Compression parameters --- these fields must be set before calling + * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to + * initialize everything to reasonable defaults, then changing anything + * the application specifically wants to change. That way you won't get + * burnt when new parameters are added. Also note that there are several + * helper routines to simplify changing parameters. + */ + + boolean lossless; /* TRUE=lossless encoding, FALSE=lossy */ + + int data_precision; /* bits of precision in image data */ + + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + int num_scans; /* # of entries in scan_info array */ + const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ + /* The default value of scan_info is NULL, which causes a single-scan + * sequential JPEG file to be emitted. To create a multi-scan file, + * set num_scans and scan_info to point to an array of scan definitions. + */ + + boolean raw_data_in; /* TRUE=caller supplies downsampled data */ + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + int smoothing_factor; /* 1..100, or 0 for no input smoothing */ + J_DCT_METHOD dct_method; /* DCT algorithm selector */ + + /* The restart interval can be specified in absolute MCUs by setting + * restart_interval, or in MCU rows by setting restart_in_rows + * (in which case the correct restart_interval will be figured + * for each scan). + */ + unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ + int restart_in_rows; /* if > 0, MCU rows per restart interval */ + + /* Parameters controlling emission of special markers. */ + + boolean write_JFIF_header; /* should a JFIF marker be written? */ + UINT8 JFIF_major_version; /* What to write for the JFIF version number */ + UINT8 JFIF_minor_version; + /* These three values are not used by the JPEG code, merely copied */ + /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ + /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ + /* ratio is defined by X_density/Y_density even when density_unit=0. */ + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean write_Adobe_marker; /* should an Adobe marker be written? */ + + /* State variable: index of next scanline to be written to + * jpeg_write_scanlines(). Application may use this to control its + * processing loop, e.g., "while (next_scanline < image_height)". + */ + + JDIMENSION next_scanline; /* 0 .. image_height-1 */ + + /* Remaining fields are known throughout compressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during compression startup + */ + int data_unit; /* size of data unit in samples */ + J_CODEC_PROCESS process; /* encoding process of JPEG image */ + + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to codec */ + /* The codec receives data in units of MCU rows as defined for fully + * interleaved scans (whether the JPEG file is interleaved or not). + * There are v_samp_factor * data_unit sample rows of each component in an + * "iMCU" (interleaved MCU) row. + */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int data_units_in_MCU; /* # of data units per MCU */ + int MCU_membership[C_MAX_DATA_UNITS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th block in an MCU */ + + int Ss, Se, Ah, Al; /* progressive/lossless JPEG parameters for scan */ + + /* + * Links to compression subobjects (methods and private variables of modules) + */ + struct jpeg_comp_master * master; + struct jpeg_c_main_controller * main; + struct jpeg_c_prep_controller * prep; + struct jpeg_c_codec * codec; + struct jpeg_marker_writer * marker; + struct jpeg_color_converter * cconvert; + struct jpeg_downsampler * downsample; + jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ + int script_space_size; + + /* force the use of an extended sequential SOF1 marker even when a + * SOF0 marker could be used, to comply with DICOM CP 1447. + * This is only needed for 8 bits/sample. */ + boolean force_extended_sequential_marker; +}; + + +/* Master record for a decompression instance */ + +struct jpeg_decompress_struct { + jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ + + /* Source of compressed data */ + struct jpeg_source_mgr * src; + + /* Basic description of image --- filled in by jpeg_read_header(). */ + /* Application may inspect these values to decide how to process image. */ + + JDIMENSION image_width; /* nominal image width (from SOF marker) */ + JDIMENSION image_height; /* nominal image height */ + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + /* Decompression processing parameters --- these fields must be set before + * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes + * them to default values. + */ + + J_COLOR_SPACE out_color_space; /* colorspace for output */ + + unsigned int scale_num, scale_denom; /* fraction by which to scale image */ + + double output_gamma; /* image gamma wanted in output */ + + boolean buffered_image; /* TRUE=multiple output passes */ + boolean raw_data_out; /* TRUE=downsampled data wanted */ + + J_DCT_METHOD dct_method; /* IDCT algorithm selector */ + boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ + boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ + + boolean quantize_colors; /* TRUE=colormapped output wanted */ + /* the following are ignored if not quantize_colors: */ + J_DITHER_MODE dither_mode; /* type of color dithering to use */ + boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ + int desired_number_of_colors; /* max # colors to use in created colormap */ + /* these are significant only in buffered-image mode: */ + boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ + boolean enable_external_quant;/* enable future use of external colormap */ + boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ + + /* Description of actual output image that will be returned to application. + * These fields are computed by jpeg_start_decompress(). + * You can also use jpeg_calc_output_dimensions() to determine these values + * in advance of calling jpeg_start_decompress(). + */ + + JDIMENSION output_width; /* scaled image width */ + JDIMENSION output_height; /* scaled image height */ + int out_color_components; /* # of color components in out_color_space */ + int output_components; /* # of color components returned */ + /* output_components is 1 (a colormap index) when quantizing colors; + * otherwise it equals out_color_components. + */ + int rec_outbuf_height; /* min recommended height of scanline buffer */ + /* If the buffer passed to jpeg_read_scanlines() is less than this many rows + * high, space and time will be wasted due to unnecessary data copying. + * Usually rec_outbuf_height will be 1 or 2, at most 4. + */ + + /* When quantizing colors, the output colormap is described by these fields. + * The application can supply a colormap by setting colormap non-NULL before + * calling jpeg_start_decompress; otherwise a colormap is created during + * jpeg_start_decompress or jpeg_start_output. + * The map has out_color_components rows and actual_number_of_colors columns. + */ + int actual_number_of_colors; /* number of entries in use */ + JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ + + /* State variables: these variables indicate the progress of decompression. + * The application may examine these but must not modify them. + */ + + /* Row index of next scanline to be read from jpeg_read_scanlines(). + * Application may use this to control its processing loop, e.g., + * "while (output_scanline < output_height)". + */ + JDIMENSION output_scanline; /* 0 .. output_height-1 */ + + /* Current input scan number and number of iMCU rows completed in scan. + * These indicate the progress of the decompressor input side. + */ + int input_scan_number; /* Number of SOS markers seen so far */ + JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ + + /* The "output scan number" is the notional scan being displayed by the + * output side. The decompressor will not allow output scan/row number + * to get ahead of input scan/row, but it can fall arbitrarily far behind. + */ + int output_scan_number; /* Nominal scan number being displayed */ + JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ + + /* Current progression status. coef_bits[c][i] indicates the precision + * with which component c's DCT coefficient i (in zigzag order) is known. + * It is -1 when no data has yet been received, otherwise it is the point + * transform (shift) value for the most recent scan of the coefficient + * (thus, 0 at completion of the progression). + * This pointer is NULL when reading a non-progressive file. + */ + int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ + + /* Internal JPEG parameters --- the application usually need not look at + * these fields. Note that the decompressor output side may not use + * any parameters that can change between scans. + */ + + /* Quantization and Huffman tables are carried forward across input + * datastreams when processing abbreviated JPEG datastreams. + */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + /* These parameters are never carried across datastreams, since they + * are given in SOF/SOS markers or defined to be reset by SOI. + */ + + int data_precision; /* bits of precision in image data */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ + + /* These fields record data obtained from optional markers recognized by + * the JPEG library. + */ + boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ + /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ + UINT8 JFIF_major_version; /* JFIF version number */ + UINT8 JFIF_minor_version; + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ + UINT8 Adobe_transform; /* Color transform code from Adobe marker */ + + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + + /* Aside from the specific data retained from APPn markers known to the + * library, the uninterpreted contents of any or all APPn and COM markers + * can be saved in a list for examination by the application. + */ + jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ + + /* Remaining fields are known throughout decompressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during decompression startup + */ + int data_unit; /* size of data unit in samples */ + J_CODEC_PROCESS process; /* decoding process of JPEG image */ + + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + int min_codec_data_unit; /* smallest codec_data_unit of any component */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ + /* The codec's input and output progress is measured in units of "iMCU" + * (interleaved MCU) rows. These are the same as MCU rows in fully + * interleaved JPEG scans, but are used whether the scan is interleaved + * or not. We define an iMCU row as v_samp_factor data_unit rows of each + * component. Therefore, the codec output contains + * v_samp_factor*codec_data_unit sample rows of a component per iMCU row. + */ + + JSAMPLE * sample_range_limit; /* table for fast range-limiting */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + * Note that the decompressor output side must not use these fields. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int data_units_in_MCU; /* # of data _units per MCU */ + int MCU_membership[D_MAX_DATA_UNITS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th data unit in an MCU */ + + int Ss, Se, Ah, Al; /* progressive/lossless JPEG parms for scan */ + + /* This field is shared between entropy decoder and marker parser. + * It is either zero or the code of a JPEG marker that has been + * read from the data source, but has not yet been processed. + */ + int unread_marker; + + /* + * Links to decompression subobjects (methods, private variables of modules) + */ + struct jpeg_decomp_master * master; + struct jpeg_d_main_controller * main; + struct jpeg_d_codec * codec; + struct jpeg_d_post_controller * post; + struct jpeg_input_controller * inputctl; + struct jpeg_marker_reader * marker; + struct jpeg_upsampler * upsample; + struct jpeg_color_deconverter * cconvert; + struct jpeg_color_quantizer * cquantize; + + /* Options that enable or disable various workarounds */ + unsigned int workaround_options; +}; + + +/* "Object" declarations for JPEG modules that may be supplied or called + * directly by the surrounding application. + * As with all objects in the JPEG library, these structs only define the + * publicly visible methods and state variables of a module. Additional + * private fields may exist after the public ones. + */ + + +/* Error handler object */ + +struct jpeg_error_mgr { + /* Error exit handler: does not return to caller */ + JMETHOD(void, error_exit, (j_common_ptr cinfo)); + /* Conditionally emit a trace or warning message */ + JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); + /* Routine that actually outputs a trace or error message */ + JMETHOD(void, output_message, (j_common_ptr cinfo)); + /* Format a message string for the most recent JPEG error or message */ + JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); +#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ + /* Reset error state variables at start of a new image */ + JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); + + /* The message ID code and any parameters are saved here. + * A message can have one string parameter or up to 8 int parameters. + */ + int msg_code; +#define JMSG_STR_PARM_MAX 80 + union { + int i[8]; + char s[JMSG_STR_PARM_MAX]; + } msg_parm; + + /* Standard state variables for error facility */ + + int trace_level; /* max msg_level that will be displayed */ + + /* For recoverable corrupt-data errors, we emit a warning message, + * but keep going unless emit_message chooses to abort. emit_message + * should count warnings in num_warnings. The surrounding application + * can check for bad data by seeing if num_warnings is nonzero at the + * end of processing. + */ + long num_warnings; /* number of corrupt-data warnings */ + + /* These fields point to the table(s) of error message strings. + * An application can change the table pointer to switch to a different + * message list (typically, to change the language in which errors are + * reported). Some applications may wish to add additional error codes + * that will be handled by the JPEG library error mechanism; the second + * table pointer is used for this purpose. + * + * First table includes all errors generated by JPEG library itself. + * Error code 0 is reserved for a "no such error string" message. + */ + const char * const * jpeg_message_table; /* Library errors */ + int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ + /* Second table can be added by application (see cjpeg/djpeg for example). + * It contains strings numbered first_addon_message..last_addon_message. + */ + const char * const * addon_message_table; /* Non-library errors */ + int first_addon_message; /* code for first string in addon table */ + int last_addon_message; /* code for last string in addon table */ +}; + + +/* Progress monitor object */ + +struct jpeg_progress_mgr { + JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); + + long pass_counter; /* work units completed in this pass */ + long pass_limit; /* total number of work units in this pass */ + int completed_passes; /* passes completed so far */ + int total_passes; /* total number of passes expected */ +}; + + +/* Data destination object for compression */ + +struct jpeg_destination_mgr { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + + JMETHOD(void, init_destination, (j_compress_ptr cinfo)); + JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); + JMETHOD(void, term_destination, (j_compress_ptr cinfo)); +}; + + +/* Data source object for decompression */ + +struct jpeg_source_mgr { + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + + JMETHOD(void, init_source, (j_decompress_ptr cinfo)); + JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); + JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); + JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); + JMETHOD(void, term_source, (j_decompress_ptr cinfo)); +}; + + +/* Memory manager object. + * Allocates "small" objects (a few K total), "large" objects (tens of K), + * and "really big" objects (virtual arrays with backing store if needed). + * The memory manager does not allow individual objects to be freed; rather, + * each created object is assigned to a pool, and whole pools can be freed + * at once. This is faster and more convenient than remembering exactly what + * to free, especially where malloc()/free() are not too speedy. + * NB: alloc routines never return NULL. They exit to error_exit if not + * successful. + */ + +#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ +#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ +#define JPOOL_NUMPOOLS 2 + +typedef struct jvirt_sarray_control * jvirt_sarray_ptr; +typedef struct jvirt_barray_control * jvirt_barray_ptr; + + +#ifdef C_LOSSLESS_SUPPORTED +#define NEED_DARRAY +#else +#ifdef D_LOSSLESS_SUPPORTED +#define NEED_DARRAY +#endif +#endif + +struct jpeg_memory_mgr { + /* Method pointers */ + JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, + JDIMENSION numrows)); + JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, + JDIMENSION numrows)); +#ifdef NEED_DARRAY + JMETHOD(JDIFFARRAY, alloc_darray, (j_common_ptr cinfo, int pool_id, + JDIMENSION diffsperrow, + JDIMENSION numrows)); +#endif + JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION samplesperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION blocksperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); + JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, + jvirt_sarray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, + jvirt_barray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); + JMETHOD(void, self_destruct, (j_common_ptr cinfo)); + + /* Limit on memory allocation for this JPEG object. (Note that this is + * merely advisory, not a guaranteed maximum; it only affects the space + * used for virtual-array buffers.) May be changed by outer application + * after creating the JPEG object. + */ + long max_memory_to_use; + + /* Maximum allocation request accepted by alloc_large. */ + long max_alloc_chunk; +}; + + +/* Routine signature for application-supplied marker processing methods. + * Need not pass marker code since it is stored in cinfo->unread_marker. + */ +typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); + + +/* Declarations for routines called by application. + * The JPP macro hides prototype parameters from compilers that can't cope. + * Note JPP requires double parentheses. + */ + +#ifdef HAVE_PROTOTYPES +#define JPP(arglist) arglist +#else +#define JPP(arglist) () +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. + * We shorten external names to be unique in the first six letters, which + * is good enough for all known systems. + * (If your compiler itself needs names to be unique in less than 15 + * characters, you are out of luck. Get a better compiler.) + */ + +/* MAKE SURE THAT ALL FUNCTIONS DECLARED GLOBAL() ARE RE-DEFINED HERE! */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jcopy_block_row jcopy8_block_row +#define jcopy_sample_rows jcopy8_sample_rows +#define jdiv_round_up jdiv8_round_up +#define jinit_1pass_quantizer jinit8_1pass_quantizer +#define jinit_2pass_quantizer jinit8_2pass_quantizer +#define jinit_arith_decoder jinit8_arith_decoder +#define jinit_arith_encoder jinit8_arith_encoder +#define jinit_c_codec jinit8_c_codec +#define jinit_c_coef_controller jinit8_c_coef_controller +#define jinit_c_diff_controller jinit8_c_diff_controller +#define jinit_c_main_controller jinit8_c_main_controller +#define jinit_c_master_control jinit8_c_master_control +#define jinit_c_prep_controller jinit8_c_prep_controller +#define jinit_c_scaler jinit8_c_scaler +#define jinit_color_converter jinit8_color_converter +#define jinit_color_deconverter jinit8_color_deconverter +#define jinit_compress_master jinit8_compress_master +#define jinit_d_codec jinit8_d_codec +#define jinit_d_coef_controller jinit8_d_coef_controller +#define jinit_d_diff_controller jinit8_d_diff_controller +#define jinit_d_main_controller jinit8_d_main_controller +#define jinit_d_post_controller jinit8_d_post_controller +#define jinit_d_post_controller jinit8_d_post_controller +#define jinit_d_scaler jinit8_d_scaler +#define jinit_differencer jinit8_differencer +#define jinit_downsampler jinit8_downsampler +#define jinit_forward_dct jinit8_forward_dct +#define jinit_input_controller jinit8_input_controller +#define jinit_inverse_dct jinit8_inverse_dct +#define jinit_lhuff_decoder jinit8_lhuff_decoder +#define jinit_lhuff_encoder jinit8_lhuff_encoder +#define jinit_lossless_c_codec jinit8_lossless_c_codec +#define jinit_lossless_d_codec jinit8_lossless_d_codec +#define jinit_lossy_c_codec jinit8_lossy_c_codec +#define jinit_lossy_d_codec jinit8_lossy_d_codec +#define jinit_marker_reader jinit8_marker_reader +#define jinit_marker_writer jinit8_marker_writer +#define jinit_master_decompress jinit8_master_decompress +#define jinit_memory_mgr jinit8_memory_mgr +#define jinit_merged_upsampler jinit8_merged_upsampler +#define jinit_phuff_decoder jinit8_phuff_decoder +#define jinit_phuff_encoder jinit8_phuff_encoder +#define jinit_shuff_decoder jinit8_shuff_decoder +#define jinit_shuff_encoder jinit8_shuff_encoder +#define jinit_undifferencer jinit8_undifferencer +#define jinit_upsampler jinit8_upsampler +#define jpeg_CreateCompress jpeg8_CreateCompress +#define jpeg_CreateDecompress jpeg8_CreateDecompress +#define jpeg_abort jpeg8_abort +#define jpeg_abort_compress jpeg8_abort_compress +#define jpeg_abort_decompress jpeg8_abort_decompress +#define jpeg_add_quant_table jpeg8_add_quant_table +#define jpeg_alloc_huff_table jpeg8_alloc_huff_table +#define jpeg_alloc_quant_table jpeg8_alloc_quant_table +#define jpeg_calc_output_dimensions jpeg8_calc_output_dimensions +#define jpeg_consume_input jpeg8_consume_input +#define jpeg_copy_critical_parameters jpeg8_copy_critical_parameters +#define jpeg_default_colorspace jpeg8_default_colorspace +#define jpeg_destroy jpeg8_destroy +#define jpeg_destroy_compress jpeg8_destroy_compress +#define jpeg_destroy_decompress jpeg8_destroy_decompress +#define jpeg_fdct_float jpeg8_fdct_float +#define jpeg_fdct_ifast jpeg8_fdct_ifast +#define jpeg_fdct_islow jpeg8_fdct_islow +#define jpeg_fill_bit_buffer jpeg8_fill_bit_buffer +#define jpeg_finish_compress jpeg8_finish_compress +#define jpeg_finish_decompress jpeg8_finish_decompress +#define jpeg_finish_output jpeg8_finish_output +#define jpeg_free_large jpeg8_free_large +#define jpeg_free_small jpeg8_free_small +#define jpeg_gen_optimal_table jpeg8_gen_optimal_table +#define jpeg_get_large jpeg8_get_large +#define jpeg_get_small jpeg8_get_small +#define jpeg_has_multiple_scans jpeg8_has_multiple_scans +#define jpeg_huff_decode jpeg8_huff_decode +#define jpeg_idct_1x1 jpeg8_idct_1x1 +#define jpeg_idct_2x2 jpeg8_idct_2x2 +#define jpeg_idct_4x4 jpeg8_idct_4x4 +#define jpeg_idct_float jpeg8_idct_float +#define jpeg_idct_ifast jpeg8_idct_ifast +#define jpeg_idct_islow jpeg8_idct_islow +#define jpeg_input_complete jpeg8_input_complete +#define jpeg_make_c_derived_tbl jpeg8_make_c_derived_tbl +#define jpeg_make_d_derived_tbl jpeg8_make_d_derived_tbl +#define jpeg_mem_available jpeg8_mem_available +#define jpeg_mem_init jpeg8_mem_init +#define jpeg_mem_term jpeg8_mem_term +#define jpeg_new_colormap jpeg8_new_colormap +#define jpeg_open_backing_store jpeg8_open_backing_store +#define jpeg_quality_scaling jpeg8_quality_scaling +#define jpeg_read_coefficients jpeg8_read_coefficients +#define jpeg_read_header jpeg8_read_header +#define jpeg_read_raw_data jpeg8_read_raw_data +#define jpeg_read_scanlines jpeg8_read_scanlines +#define jpeg_resync_to_restart jpeg8_resync_to_restart +#define jpeg_save_markers jpeg8_save_markers +#define jpeg_set_colorspace jpeg8_set_colorspace +#define jpeg_set_defaults jpeg8_set_defaults +#define jpeg_set_linear_quality jpeg8_set_linear_quality +#define jpeg_set_marker_processor jpeg8_set_marker_processor +#define jpeg_set_quality jpeg8_set_quality +#define jpeg_simple_lossless jpeg8_simple_lossless +#define jpeg_simple_progression jpeg8_simple_progression +#define jpeg_start_compress jpeg8_start_compress +#define jpeg_start_decompress jpeg8_start_decompress +#define jpeg_start_output jpeg8_start_output +#define jpeg_std_error jpeg8_std_error +#define jpeg_stdio_dest jpeg8_stdio_dest +#define jpeg_stdio_src jpeg8_stdio_src +#define jpeg_suppress_tables jpeg8_suppress_tables +#define jpeg_write_coefficients jpeg8_write_coefficients +#define jpeg_write_m_byte jpeg8_write_m_byte +#define jpeg_write_m_header jpeg8_write_m_header +#define jpeg_write_marker jpeg8_write_marker +#define jpeg_write_raw_data jpeg8_write_raw_data +#define jpeg_write_scanlines jpeg8_write_scanlines +#define jpeg_write_tables jpeg8_write_tables +#define jround_up jround8_up +#define jzero_far jzero8_far +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Default error-management setup */ +EXTERN(struct jpeg_error_mgr *) jpeg_std_error + JPP((struct jpeg_error_mgr * err)); + +/* Initialization of JPEG compression objects. + * jpeg_create_compress() and jpeg_create_decompress() are the exported + * names that applications should call. These expand to calls on + * jpeg_CreateCompress and jpeg_CreateDecompress with additional information + * passed for version mismatch checking. + * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. + */ +#define jpeg_create_compress(cinfo) \ + jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_compress_struct)) +#define jpeg_create_decompress(cinfo) \ + jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_decompress_struct)) +EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, + int version, size_t structsize)); +EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, + int version, size_t structsize)); +/* Destruction of JPEG compression objects */ +EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); + +/* Standard data source and destination managers: stdio streams. */ +/* Caller is responsible for opening the file before and closing after. */ +EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); +EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); + +/* Default parameter setup for compression */ +EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); +/* Compression parameter setup aids */ +EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, + J_COLOR_SPACE colorspace)); +EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, + boolean force_baseline)); +EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, + int scale_factor, + boolean force_baseline)); +EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, + boolean force_baseline)); +EXTERN(int) jpeg_quality_scaling JPP((int quality)); +EXTERN(void) jpeg_simple_lossless JPP((j_compress_ptr cinfo, + int predictor, int point_transform)); +EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, + boolean suppress)); +EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); +EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); + +/* Main entry points for compression */ +EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, + boolean write_all_tables)); +EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION num_lines)); +EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); + +/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION num_lines)); + +/* Write a special marker. See libjpeg.doc concerning safe usage. */ +EXTERN(void) jpeg_write_marker + JPP((j_compress_ptr cinfo, int marker, + const JOCTET * dataptr, unsigned int datalen)); +/* Same, but piecemeal. */ +EXTERN(void) jpeg_write_m_header + JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); +EXTERN(void) jpeg_write_m_byte + JPP((j_compress_ptr cinfo, int val)); + +/* Alternate compression function: just write an abbreviated table file */ +EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); + +/* Decompression startup: read start of JPEG datastream to see what's there */ +EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, + boolean require_image)); +/* Return value is one of: */ +#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ +#define JPEG_HEADER_OK 1 /* Found valid image datastream */ +#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ +/* If you pass require_image = TRUE (normal case), you need not check for + * a TABLES_ONLY return code; an abbreviated file will cause an error exit. + * JPEG_SUSPENDED is only possible if you use a data source module that can + * give a suspension return (the stdio source module doesn't). + */ + +/* Main entry points for decompression */ +EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION max_lines)); +EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); + +/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION max_lines)); + +/* Additional entry points for buffered-image mode. */ +EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, + int scan_number)); +EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); +EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); +/* Return value is one of: */ +/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ +#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ +#define JPEG_REACHED_EOI 2 /* Reached end of image */ +#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ +#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ + +/* Precalculate output dimensions for current decompression parameters. */ +EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); + +/* Control saving of COM and APPn markers into marker_list. */ +EXTERN(void) jpeg_save_markers + JPP((j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit)); + +/* Install a special processing method for COM or APPn markers. */ +EXTERN(void) jpeg_set_marker_processor + JPP((j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine)); + +/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ +EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays)); +EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, + j_compress_ptr dstinfo)); + +/* If you choose to abort compression or decompression before completing + * jpeg_finish_(de)compress, then you need to clean up to release memory, + * temporary files, etc. You can just call jpeg_destroy_(de)compress + * if you're done with the JPEG object, but if you want to clean it up and + * reuse it, call this: + */ +EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); + +/* Generic versions of jpeg_abort and jpeg_destroy that work on either + * flavor of JPEG object. These may be more convenient in some places. + */ +EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); + +/* Default restart-marker-resync procedure for use by data source modules */ +EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, + int desired)); + + +/* These marker codes are exported since applications and data source modules + * are likely to want to use them. + */ + +#define JPEG_RST0 0xD0 /* RST0 marker code */ +#define JPEG_EOI 0xD9 /* EOI marker code */ +#define JPEG_APP0 0xE0 /* APP0 marker code */ +#define JPEG_COM 0xFE /* COM marker code */ + + +/* If we have a brain-damaged compiler that emits warnings (or worse, errors) + * for structure definitions that are never filled in, keep it quiet by + * supplying dummy definitions for the various substructures. + */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +struct jpeg_comp_master { long dummy; }; +struct jpeg_c_main_controller { long dummy; }; +struct jpeg_c_prep_controller { long dummy; }; +struct jpeg_c_coef_controller { long dummy; }; +struct jpeg_marker_writer { long dummy; }; +struct jpeg_color_converter { long dummy; }; +struct jpeg_downsampler { long dummy; }; +struct jpeg_forward_dct { long dummy; }; +struct jpeg_entropy_encoder { long dummy; }; +struct jpeg_decomp_master { long dummy; }; +struct jpeg_d_main_controller { long dummy; }; +struct jpeg_d_coef_controller { long dummy; }; +struct jpeg_d_post_controller { long dummy; }; +struct jpeg_input_controller { long dummy; }; +struct jpeg_marker_reader { long dummy; }; +struct jpeg_entropy_decoder { long dummy; }; +struct jpeg_inverse_dct { long dummy; }; +struct jpeg_upsampler { long dummy; }; +struct jpeg_color_deconverter { long dummy; }; +struct jpeg_color_quantizer { long dummy; }; +#endif /* JPEG_INTERNALS */ +#endif /* INCOMPLETE_TYPES_BROKEN */ + + +/* + * The JPEG library modules define JPEG_INTERNALS before including this file. + * The internal structure declarations are read only when that is true. + * Applications using the library should not include jpegint.h, but may wish + * to include jerror.h. + */ + +#ifdef JPEG_INTERNALS +#include "jpegint8.h" /* fetch private declarations */ +#include "jerror8.h" /* fetch error codes too */ +#endif + +#endif /* JPEGLIB_H */ diff --git a/dcmjpeg/libijg8/jquant1.c b/dcmjpeg/libijg8/jquant1.c new file mode 100644 index 00000000..90a209c1 --- /dev/null +++ b/dcmjpeg/libijg8/jquant1.c @@ -0,0 +1,856 @@ +/* + * jquant1.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 1-pass color quantization (color mapping) routines. + * These routines provide mapping to a fixed color map using equally spaced + * color values. Optional Floyd-Steinberg or ordered dithering is available. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + +#ifdef QUANT_1PASS_SUPPORTED + + +/* + * The main purpose of 1-pass quantization is to provide a fast, if not very + * high quality, colormapped output capability. A 2-pass quantizer usually + * gives better visual quality; however, for quantized grayscale output this + * quantizer is perfectly adequate. Dithering is highly recommended with this + * quantizer, though you can turn it off if you really want to. + * + * In 1-pass quantization the colormap must be chosen in advance of seeing the + * image. We use a map consisting of all combinations of Ncolors[i] color + * values for the i'th component. The Ncolors[] values are chosen so that + * their product, the total number of colors, is no more than that requested. + * (In most cases, the product will be somewhat less.) + * + * Since the colormap is orthogonal, the representative value for each color + * component can be determined without considering the other components; + * then these indexes can be combined into a colormap index by a standard + * N-dimensional-array-subscript calculation. Most of the arithmetic involved + * can be precalculated and stored in the lookup table colorindex[]. + * colorindex[i][j] maps pixel value j in component i to the nearest + * representative value (grid plane) for that component; this index is + * multiplied by the array stride for component i, so that the + * index of the colormap entry closest to a given pixel value is just + * sum( colorindex[component-number][pixel-component-value] ) + * Aside from being fast, this scheme allows for variable spacing between + * representative values with no additional lookup cost. + * + * If gamma correction has been applied in color conversion, it might be wise + * to adjust the color grid spacing so that the representative colors are + * equidistant in linear space. At this writing, gamma correction is not + * implemented by jdcolor, so nothing is done here. + */ + + +/* Declarations for ordered dithering. + * + * We use a standard 16x16 ordered dither array. The basic concept of ordered + * dithering is described in many references, for instance Dale Schumacher's + * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991). + * In place of Schumacher's comparisons against a "threshold" value, we add a + * "dither" value to the input pixel and then round the result to the nearest + * output value. The dither value is equivalent to (0.5 - threshold) times + * the distance between output values. For ordered dithering, we assume that + * the output colors are equally spaced; if not, results will probably be + * worse, since the dither may be too much or too little at a given point. + * + * The normal calculation would be to form pixel value + dither, range-limit + * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual. + * We can skip the separate range-limiting step by extending the colorindex + * table in both directions. + */ + +#define ODITHER_SIZE 16 /* dimension of dither matrix */ +/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */ +#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */ +#define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */ + +typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]; +typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE]; + +static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { + /* Bayer's order-4 dither array. Generated by the code given in + * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I. + * The values in this array must range from 0 to ODITHER_CELLS-1. + */ + { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }, + { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 }, + { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 }, + { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 }, + { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 }, + { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 }, + { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 }, + { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 }, + { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 }, + { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 }, + { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 }, + { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 }, + { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 }, + { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 }, + { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 }, + { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 } +}; + + +/* Declarations for Floyd-Steinberg dithering. + * + * Errors are accumulated into the array fserrors[], at a resolution of + * 1/16th of a pixel count. The error at a given pixel is propagated + * to its not-yet-processed neighbors using the standard F-S fractions, + * ... (here) 7/16 + * 3/16 5/16 1/16 + * We work left-to-right on even rows, right-to-left on odd rows. + * + * We can get away with a single array (holding one row's worth of errors) + * by using it to store the current row's errors at pixel columns not yet + * processed, but the next row's errors at columns already processed. We + * need only a few extra variables to hold the errors immediately around the + * current column. (If we are lucky, those variables are in registers, but + * even if not, they're probably cheaper to access than array elements are.) + * + * The fserrors[] array is indexed [component#][position]. + * We provide (#columns + 2) entries per component; the extra entry at each + * end saves us from special-casing the first and last pixels. + * + * Note: on a wide image, we might not have enough room in a PC's near data + * segment to hold the error array; so it is allocated with alloc_large. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef INT16 FSERROR; /* 16 bits should be enough */ +typedef int LOCFSERROR; /* use 'int' for calculation temps */ +#else +typedef IJG_INT32 FSERROR; /* may need more than 16 bits */ +typedef IJG_INT32 LOCFSERROR; /* be sure calculation temps are big enough */ +#endif + +typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */ + + +/* Private subobject */ + +#define MAX_Q_COMPS 4 /* max components I can handle */ + +typedef struct { + struct jpeg_color_quantizer pub; /* public fields */ + + /* Initially allocated colormap is saved here */ + JSAMPARRAY sv_colormap; /* The color map as a 2-D pixel array */ + int sv_actual; /* number of entries in use */ + + JSAMPARRAY colorindex; /* Precomputed mapping for speed */ + /* colorindex[i][j] = index of color closest to pixel value j in component i, + * premultiplied as described above. Since colormap indexes must fit into + * JSAMPLEs, the entries of this array will too. + */ + boolean is_padded; /* is the colorindex padded for odither? */ + + int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */ + + /* Variables for ordered dithering */ + int row_index; /* cur row's vertical index in dither matrix */ + ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */ + + /* Variables for Floyd-Steinberg dithering */ + FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ + boolean on_odd_row; /* flag to remember which row we are on */ +} my_cquantizer; + +typedef my_cquantizer * my_cquantize_ptr; + + +/* + * Policy-making subroutines for create_colormap and create_colorindex. + * These routines determine the colormap to be used. The rest of the module + * only assumes that the colormap is orthogonal. + * + * * select_ncolors decides how to divvy up the available colors + * among the components. + * * output_value defines the set of representative values for a component. + * * largest_input_value defines the mapping from input values to + * representative values for a component. + * Note that the latter two routines may impose different policies for + * different components, though this is not currently done. + */ + + +LOCAL(int) +select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) +/* Determine allocation of desired colors to components, */ +/* and fill in Ncolors[] array to indicate choice. */ +/* Return value is total number of colors (product of Ncolors[] values). */ +{ + int nc = cinfo->out_color_components; /* number of color components */ + int max_colors = cinfo->desired_number_of_colors; + int total_colors, iroot, i, j; + boolean changed; + long temp; + static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }; + + /* We can allocate at least the nc'th root of max_colors per component. */ + /* Compute floor(nc'th root of max_colors). */ + iroot = 1; + do { + iroot++; + temp = iroot; /* set temp = iroot ** nc */ + for (i = 1; i < nc; i++) + temp *= iroot; + } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */ + iroot--; /* now iroot = floor(root) */ + + /* Must have at least 2 color values per component */ + if (iroot < 2) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp); + + /* Initialize to iroot color values for each component */ + total_colors = 1; + for (i = 0; i < nc; i++) { + Ncolors[i] = iroot; + total_colors *= iroot; + } + /* We may be able to increment the count for one or more components without + * exceeding max_colors, though we know not all can be incremented. + * Sometimes, the first component can be incremented more than once! + * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.) + * In RGB colorspace, try to increment G first, then R, then B. + */ + do { + changed = FALSE; + for (i = 0; i < nc; i++) { + j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); + /* calculate new total_colors if Ncolors[j] is incremented */ + temp = total_colors / Ncolors[j]; + temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */ + if (temp > (long) max_colors) + break; /* won't fit, done with this pass */ + Ncolors[j]++; /* OK, apply the increment */ + total_colors = (int) temp; + changed = TRUE; + } + } while (changed); + + return total_colors; +} + + +LOCAL(int) +output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return j'th output value, where j will range from 0 to maxj */ +/* The output values must fall in 0..MAXJSAMPLE in increasing order */ +{ + /* We always provide values 0 and MAXJSAMPLE for each component; + * any additional values are equally spaced between these limits. + * (Forcing the upper and lower values to the limits ensures that + * dithering can't produce a color outside the selected gamut.) + */ + return (int) (((IJG_INT32) j * MAXJSAMPLE + maxj/2) / maxj); +} + + +LOCAL(int) +largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return largest input value that should map to j'th output value */ +/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ +{ + /* Breakpoints are halfway between values returned by output_value */ + return (int) (((IJG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); +} + + +/* + * Create the colormap. + */ + +LOCAL(void) +create_colormap (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colormap; /* Created colormap */ + int total_colors; /* Number of distinct output colors */ + int i,j,k, nci, blksize, blkdist, ptr, val; + + /* Select number of colors for each component */ + total_colors = select_ncolors(cinfo, cquantize->Ncolors); + + /* Report selected color counts */ + if (cinfo->out_color_components == 3) + TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS, + total_colors, cquantize->Ncolors[0], + cquantize->Ncolors[1], cquantize->Ncolors[2]); + else + TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors); + + /* Allocate and fill in the colormap. */ + /* The colors are ordered in the map in standard row-major order, */ + /* i.e. rightmost (highest-indexed) color changes most rapidly. */ + + colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + /* blkdist is distance between groups of identical entries for a component */ + blkdist = total_colors; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colormap entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blkdist / nci; + for (j = 0; j < nci; j++) { + /* Compute j'th output value (out of nci) for component */ + val = output_value(cinfo, i, j, nci-1); + /* Fill in all colormap entries that have this value of this component */ + for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) { + /* fill in blksize entries beginning at ptr */ + for (k = 0; k < blksize; k++) + colormap[i][ptr+k] = (JSAMPLE) val; + } + } + blkdist = blksize; /* blksize of this color is blkdist of next */ + } + + /* Save the colormap in private storage, + * where it will survive color quantization mode changes. + */ + cquantize->sv_colormap = colormap; + cquantize->sv_actual = total_colors; +} + + +/* + * Create the color index table. + */ + +LOCAL(void) +create_colorindex (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPROW indexptr; + int i,j,k, nci, blksize, val, pad; + + /* For ordered dither, we pad the color index tables by MAXJSAMPLE in + * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE). + * This is not necessary in the other dithering modes. However, we + * flag whether it was done in case user changes dithering mode. + */ + if (cinfo->dither_mode == JDITHER_ORDERED) { + pad = MAXJSAMPLE*2; + cquantize->is_padded = TRUE; + } else { + pad = 0; + cquantize->is_padded = FALSE; + } + + cquantize->colorindex = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (MAXJSAMPLE+1 + pad), + (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + blksize = cquantize->sv_actual; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colorindex entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blksize / nci; + + /* adjust colorindex pointers to provide padding at negative indexes. */ + if (pad) + cquantize->colorindex[i] += MAXJSAMPLE; + + /* in loop, val = index of current output value, */ + /* and k = largest j that maps to current val */ + indexptr = cquantize->colorindex[i]; + val = 0; + k = largest_input_value(cinfo, i, 0, nci-1); + for (j = 0; j <= MAXJSAMPLE; j++) { + while (j > k) /* advance val if past boundary */ + k = largest_input_value(cinfo, i, ++val, nci-1); + /* premultiply so that no multiplication needed in main processing */ + indexptr[j] = (JSAMPLE) (val * blksize); + } + /* Pad at both ends if necessary */ + if (pad) + for (j = 1; j <= MAXJSAMPLE; j++) { + indexptr[-j] = indexptr[0]; + indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE]; + } + } +} + + +/* + * Create an ordered-dither array for a component having ncolors + * distinct output values. + */ + +LOCAL(ODITHER_MATRIX_PTR) +make_odither_array (j_decompress_ptr cinfo, int ncolors) +{ + ODITHER_MATRIX_PTR odither; + int j,k; + IJG_INT32 num,den; + + odither = (ODITHER_MATRIX_PTR) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(ODITHER_MATRIX)); + /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1). + * Hence the dither value for the matrix cell with fill order f + * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1). + * On 16-bit-int machine, be careful to avoid overflow. + */ + den = 2 * ODITHER_CELLS * ((IJG_INT32) (ncolors - 1)); + for (j = 0; j < ODITHER_SIZE; j++) { + for (k = 0; k < ODITHER_SIZE; k++) { + num = ((IJG_INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) + * MAXJSAMPLE; + /* Ensure round towards zero despite C's lack of consistency + * about rounding negative values in integer division... + */ + odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den); + } + } + return odither; +} + + +/* + * Create the ordered-dither tables. + * Components having the same number of representative colors may + * share a dither table. + */ + +LOCAL(void) +create_odither_tables (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + ODITHER_MATRIX_PTR odither; + int i, j, nci; + + for (i = 0; i < cinfo->out_color_components; i++) { + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + odither = NULL; /* search for matching prior component */ + for (j = 0; j < i; j++) { + if (nci == cquantize->Ncolors[j]) { + odither = cquantize->odither[j]; + break; + } + } + if (odither == NULL) /* need a new table? */ + odither = make_odither_array(cinfo, nci); + cquantize->odither[i] = odither; + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colorindex = cquantize->colorindex; + register int pixcode, ci; + register JSAMPROW ptrin, ptrout; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + register int nc = cinfo->out_color_components; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = 0; + for (ci = 0; ci < nc; ci++) { + pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]); + } + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW ptrin, ptrout; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]); + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + int * dither; /* points to active row of dither matrix */ + int row_index, col_index; /* current indexes into dither matrix */ + int nc = cinfo->out_color_components; + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + jzero_far((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + row_index = cquantize->row_index; + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + colorindex_ci = cquantize->colorindex[ci]; + dither = cquantize->odither[ci][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE, + * select output value, accumulate into output code for this pixel. + * Range-limiting need not be done explicitly, as we have extended + * the colorindex table to produce the right answers for out-of-range + * inputs. The maximum dither is +- MAXJSAMPLE; this sets the + * required amount of padding. + */ + *output_ptr = (JSAMPLE)(*output_ptr + colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]]); + input_ptr += nc; + output_ptr++; + col_index = (col_index + 1) & ODITHER_MASK; + } + } + /* Advance row index for next row */ + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int * dither0; /* points to active row of dither matrix */ + int * dither1; + int * dither2; + int row_index, col_index; /* current indexes into dither matrix */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + row_index = cquantize->row_index; + input_ptr = input_buf[row]; + output_ptr = output_buf[row]; + dither0 = cquantize->odither[0][row_index]; + dither1 = cquantize->odither[1][row_index]; + dither2 = cquantize->odither[2][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + + dither0[col_index]]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + + dither1[col_index]]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + + dither2[col_index]]); + *output_ptr++ = (JSAMPLE) pixcode; + col_index = (col_index + 1) & ODITHER_MASK; + } + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register LOCFSERROR cur; /* current error or pixel value */ + LOCFSERROR belowerr; /* error for pixel below cur */ + LOCFSERROR bpreverr; /* error for below/prev col */ + LOCFSERROR bnexterr; /* error for below/next col */ + LOCFSERROR delta; + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + JSAMPROW colormap_ci; + int pixcode; + int nc = cinfo->out_color_components; + int dir; /* 1 for left-to-right, -1 for right-to-left */ + int dirnc; /* dir * nc */ + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + jzero_far((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + input_ptr += (width-1) * (JDIMENSION)nc; /* so point to rightmost pixel */ + output_ptr += width-1; + dir = -1; + dirnc = -nc; + errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */ + } else { + /* work left to right in this row */ + dir = 1; + dirnc = nc; + errorptr = cquantize->fserrors[ci]; /* => entry before first column */ + } + colorindex_ci = cquantize->colorindex[ci]; + colormap_ci = cquantize->sv_colormap[ci]; + /* Preset error values: no error propagated to first pixel from left */ + cur = 0; + /* and no error propagated to row below yet */ + belowerr = bpreverr = 0; + + for (col = width; col > 0; col--) { + /* cur holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4); + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE; this sets the required size + * of the range_limit array. + */ + cur += GETJSAMPLE(*input_ptr); + cur = GETJSAMPLE(range_limit[cur]); + /* Select output value, accumulate into output code for this pixel */ + pixcode = GETJSAMPLE(colorindex_ci[cur]); + *output_ptr = (JSAMPLE)(*output_ptr + pixcode); + /* Compute actual representation error at this pixel */ + /* Note: we can do this even though we don't have the final */ + /* pixel code, because the colormap is orthogonal. */ + cur -= GETJSAMPLE(colormap_ci[pixcode]); + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + bnexterr = cur; + delta = cur * 2; + cur += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr + cur); + cur += delta; /* form error * 5 */ + bpreverr = belowerr + cur; + belowerr = bnexterr; + cur += delta; /* form error * 7 */ + /* At this point cur contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + input_ptr += dirnc; /* advance input ptr to next column */ + output_ptr += dir; /* advance output ptr to next column */ + errorptr += dir; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error value into the + * final fserrors[] entry. Note we need not unload belowerr because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */ + } + cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE); + } +} + + +/* + * Allocate workspace for Floyd-Steinberg errors. + */ + +LOCAL(void) +alloc_fs_workspace (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) { + cquantize->fserrors[i] = (FSERRPTR) + (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + } +} + + +/* + * Initialize for one-pass color quantization. + */ + +METHODDEF(void) +start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + /* Install my colormap. */ + cinfo->colormap = cquantize->sv_colormap; + cinfo->actual_number_of_colors = cquantize->sv_actual; + + /* Initialize for desired dithering mode. */ + switch (cinfo->dither_mode) { + case JDITHER_NONE: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = color_quantize3; + else + cquantize->pub.color_quantize = color_quantize; + break; + case JDITHER_ORDERED: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = quantize3_ord_dither; + else + cquantize->pub.color_quantize = quantize_ord_dither; + cquantize->row_index = 0; /* initialize state for ordered dither */ + /* If user changed to ordered dither from another mode, + * we must recreate the color index table with padding. + * This will cost extra space, but probably isn't very likely. + */ + if (! cquantize->is_padded) + create_colorindex(cinfo); + /* Create ordered-dither tables if we didn't already. */ + if (cquantize->odither[0] == NULL) + create_odither_tables(cinfo); + break; + case JDITHER_FS: + cquantize->pub.color_quantize = quantize_fs_dither; + cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */ + /* Allocate Floyd-Steinberg workspace if didn't already. */ + if (cquantize->fserrors[0] == NULL) + alloc_fs_workspace(cinfo); + /* Initialize the propagated errors to zero. */ + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) + jzero_far((void FAR *) cquantize->fserrors[i], arraysize); + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } +} + + +/* + * Finish up at the end of the pass. + */ + +METHODDEF(void) +finish_pass_1_quant (j_decompress_ptr cinfo) +{ + /* no work in 1-pass case */ +} + + +/* + * Switch to a new external colormap between output passes. + * Shouldn't get to this module! + */ + +METHODDEF(void) +new_color_map_1_quant (j_decompress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + + +/* + * Module initialization routine for 1-pass color quantization. + */ + +GLOBAL(void) +jinit_1pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_1_quant; + cquantize->pub.finish_pass = finish_pass_1_quant; + cquantize->pub.new_color_map = new_color_map_1_quant; + cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */ + cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */ + + /* Make sure my internal arrays won't overflow */ + if (cinfo->out_color_components > MAX_Q_COMPS) + ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1)) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1); + + /* Create the colormap and color index table. */ + create_colormap(cinfo); + create_colorindex(cinfo); + + /* Allocate Floyd-Steinberg workspace now if requested. + * We do this now since it is FAR storage and may affect the memory + * manager's space calculations. If the user changes to FS dither + * mode in a later pass, we will allocate the space then, and will + * possibly overrun the max_memory_to_use setting. + */ + if (cinfo->dither_mode == JDITHER_FS) + alloc_fs_workspace(cinfo); +} + +#endif /* QUANT_1PASS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jquant2.c b/dcmjpeg/libijg8/jquant2.c new file mode 100644 index 00000000..96c87e6c --- /dev/null +++ b/dcmjpeg/libijg8/jquant2.c @@ -0,0 +1,1310 @@ +/* + * jquant2.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 2-pass color quantization (color mapping) routines. + * These routines provide selection of a custom color map for an image, + * followed by mapping of the image to that color map, with optional + * Floyd-Steinberg dithering. + * It is also possible to use just the second pass to map to an arbitrary + * externally-given color map. + * + * Note: ordered dithering is not supported, since there isn't any fast + * way to compute intercolor distances; it's unclear that ordered dither's + * fundamental assumptions even hold with an irregularly spaced color map. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + +#ifdef QUANT_2PASS_SUPPORTED + + +/* + * This module implements the well-known Heckbert paradigm for color + * quantization. Most of the ideas used here can be traced back to + * Heckbert's seminal paper + * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", + * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. + * + * In the first pass over the image, we accumulate a histogram showing the + * usage count of each possible color. To keep the histogram to a reasonable + * size, we reduce the precision of the input; typical practice is to retain + * 5 or 6 bits per color, so that 8 or 4 different input values are counted + * in the same histogram cell. + * + * Next, the color-selection step begins with a box representing the whole + * color space, and repeatedly splits the "largest" remaining box until we + * have as many boxes as desired colors. Then the mean color in each + * remaining box becomes one of the possible output colors. + * + * The second pass over the image maps each input pixel to the closest output + * color (optionally after applying a Floyd-Steinberg dithering correction). + * This mapping is logically trivial, but making it go fast enough requires + * considerable care. + * + * Heckbert-style quantizers vary a good deal in their policies for choosing + * the "largest" box and deciding where to cut it. The particular policies + * used here have proved out well in experimental comparisons, but better ones + * may yet be found. + * + * In earlier versions of the IJG code, this module quantized in YCbCr color + * space, processing the raw upsampled data without a color conversion step. + * This allowed the color conversion math to be done only once per colormap + * entry, not once per pixel. However, that optimization precluded other + * useful optimizations (such as merging color conversion with upsampling) + * and it also interfered with desired capabilities such as quantizing to an + * externally-supplied colormap. We have therefore abandoned that approach. + * The present code works in the post-conversion color space, typically RGB. + * + * To improve the visual quality of the results, we actually work in scaled + * RGB space, giving G distances more weight than R, and R in turn more than + * B. To do everything in integer math, we must use integer scale factors. + * The 2/3/1 scale factors used here correspond loosely to the relative + * weights of the colors in the NTSC grayscale equation. + * If you want to use this code to quantize a non-RGB color space, you'll + * probably need to change these scale factors. + */ + +#define R_SCALE 2 /* scale R distances by this much */ +#define G_SCALE 3 /* scale G distances by this much */ +#define B_SCALE 1 /* and B by this much */ + +/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined + * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B + * and B,G,R orders. If you define some other weird order in jmorecfg.h, + * you'll get compile errors until you extend this logic. In that case + * you'll probably want to tweak the histogram sizes too. + */ + +#if RGB_RED == 0 +#define C0_SCALE R_SCALE +#endif +#if RGB_BLUE == 0 +#define C0_SCALE B_SCALE +#endif +#if RGB_GREEN == 1 +#define C1_SCALE G_SCALE +#endif +#if RGB_RED == 2 +#define C2_SCALE R_SCALE +#endif +#if RGB_BLUE == 2 +#define C2_SCALE B_SCALE +#endif + + +/* + * First we have the histogram data structure and routines for creating it. + * + * The number of bits of precision can be adjusted by changing these symbols. + * We recommend keeping 6 bits for G and 5 each for R and B. + * If you have plenty of memory and cycles, 6 bits all around gives marginally + * better results; if you are short of memory, 5 bits all around will save + * some space but degrade the results. + * To maintain a fully accurate histogram, we'd need to allocate a "long" + * (preferably unsigned long) for each cell. In practice this is overkill; + * we can get by with 16 bits per cell. Few of the cell counts will overflow, + * and clamping those that do overflow to the maximum value will give close- + * enough results. This reduces the recommended histogram size from 256Kb + * to 128Kb, which is a useful savings on PC-class machines. + * (In the second pass the histogram space is re-used for pixel mapping data; + * in that capacity, each cell must be able to store zero to the number of + * desired colors. 16 bits/cell is plenty for that too.) + * Since the JPEG code is intended to run in small memory model on 80x86 + * machines, we can't just allocate the histogram in one chunk. Instead + * of a true 3-D array, we use a row of pointers to 2-D arrays. Each + * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and + * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that + * on 80x86 machines, the pointer row is in near memory but the actual + * arrays are in far memory (same arrangement as we use for image arrays). + */ + +#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ + +/* These will do the right thing for either R,G,B or B,G,R color order, + * but you may not like the results for other color orders. + */ +#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ +#define HIST_C1_BITS 6 /* bits of precision in G histogram */ +#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ + +/* Number of elements along histogram axes. */ +#define HIST_C0_ELEMS (1<cquantize; + register JSAMPROW ptr; + register histptr histp; + register hist3d histogram = cquantize->histogram; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptr = input_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the histogram */ + histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT] + [GETJSAMPLE(ptr[1]) >> C1_SHIFT] + [GETJSAMPLE(ptr[2]) >> C2_SHIFT]; + /* increment, check for overflow and undo increment if so. */ + if (++(*histp) <= 0) + (*histp)--; + ptr += 3; + } + } +} + + +/* + * Next we have the really interesting routines: selection of a colormap + * given the completed histogram. + * These routines work with a list of "boxes", each representing a rectangular + * subset of the input color space (to histogram precision). + */ + +typedef struct { + /* The bounds of the box (inclusive); expressed as histogram indexes */ + int c0min, c0max; + int c1min, c1max; + int c2min, c2max; + /* The volume (actually 2-norm) of the box */ + IJG_INT32 volume; + /* The number of nonzero histogram cells within this box */ + long colorcount; +} box; + +typedef box * boxptr; + + +LOCAL(boxptr) +find_biggest_color_pop (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest color population */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register long maxc = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->colorcount > maxc && boxp->volume > 0) { + which = boxp; + maxc = boxp->colorcount; + } + } + return which; +} + + +LOCAL(boxptr) +find_biggest_volume (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest (scaled) volume */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register IJG_INT32 maxv = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->volume > maxv) { + which = boxp; + maxv = boxp->volume; + } + } + return which; +} + + +LOCAL(void) +update_box (j_decompress_ptr cinfo, boxptr boxp) +/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ +/* and recompute its volume and population */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + IJG_INT32 dist0,dist1,dist2; + long ccount; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + if (c0max > c0min) + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0min = c0min = c0; + goto have_c0min; + } + } + have_c0min: + if (c0max > c0min) + for (c0 = c0max; c0 >= c0min; c0--) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0max = c0max = c0; + goto have_c0max; + } + } + have_c0max: + if (c1max > c1min) + for (c1 = c1min; c1 <= c1max; c1++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1min = c1min = c1; + goto have_c1min; + } + } + have_c1min: + if (c1max > c1min) + for (c1 = c1max; c1 >= c1min; c1--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1max = c1max = c1; + goto have_c1max; + } + } + have_c1max: + if (c2max > c2min) + for (c2 = c2min; c2 <= c2max; c2++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2min = c2min = c2; + goto have_c2min; + } + } + have_c2min: + if (c2max > c2min) + for (c2 = c2max; c2 >= c2min; c2--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2max = c2max = c2; + goto have_c2max; + } + } + have_c2max: + + /* Update box volume. + * We use 2-norm rather than real volume here; this biases the method + * against making long narrow boxes, and it has the side benefit that + * a box is splittable iff norm > 0. + * Since the differences are expressed in histogram-cell units, + * we have to shift back to JSAMPLE units to get consistent distances; + * after which, we scale according to the selected distance scale factors. + */ + dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; + dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; + dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; + boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2; + + /* Now scan remaining volume of box and compute population */ + ccount = 0; + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++, histp++) + if (*histp != 0) { + ccount++; + } + } + boxp->colorcount = ccount; +} + + +LOCAL(int) +median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, + int desired_colors) +/* Repeatedly select and split the largest box until we have enough boxes */ +{ + int n,lb; + int c0,c1,c2,cmax; + register boxptr b1,b2; + + while (numboxes < desired_colors) { + /* Select box to split. + * Current algorithm: by population for first half, then by volume. + */ + if (numboxes*2 <= desired_colors) { + b1 = find_biggest_color_pop(boxlist, numboxes); + } else { + b1 = find_biggest_volume(boxlist, numboxes); + } + if (b1 == NULL) /* no splittable boxes left! */ + break; + b2 = &boxlist[numboxes]; /* where new box will go */ + /* Copy the color bounds to the new box. */ + b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; + b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; + /* Choose which axis to split the box on. + * Current algorithm: longest scaled axis. + * See notes in update_box about scaling distances. + */ + c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; + c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; + c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; + /* We want to break any ties in favor of green, then red, blue last. + * This code does the right thing for R,G,B or B,G,R color orders only. + */ +#if RGB_RED == 0 + cmax = c1; n = 1; + if (c0 > cmax) { cmax = c0; n = 0; } + if (c2 > cmax) { n = 2; } +#else + cmax = c1; n = 1; + if (c2 > cmax) { cmax = c2; n = 2; } + if (c0 > cmax) { n = 0; } +#endif + /* Choose split point along selected axis, and update box bounds. + * Current algorithm: split at halfway point. + * (Since the box has been shrunk to minimum volume, + * any split will produce two nonempty subboxes.) + * Note that lb value is max for lower box, so must be < old max. + */ + switch (n) { + case 0: + lb = (b1->c0max + b1->c0min) / 2; + b1->c0max = lb; + b2->c0min = lb+1; + break; + case 1: + lb = (b1->c1max + b1->c1min) / 2; + b1->c1max = lb; + b2->c1min = lb+1; + break; + case 2: + lb = (b1->c2max + b1->c2min) / 2; + b1->c2max = lb; + b2->c2min = lb+1; + break; + } + /* Update stats for boxes */ + update_box(cinfo, b1); + update_box(cinfo, b2); + numboxes++; + } + return numboxes; +} + + +LOCAL(void) +compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) +/* Compute representative color for a box, put it in colormap[icolor] */ +{ + /* Current algorithm: mean weighted by pixels (not colors) */ + /* Note it is important to get the rounding correct! */ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + long count; + long total = 0; + long c0total = 0; + long c1total = 0; + long c2total = 0; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) { + if ((count = *histp++) != 0) { + total += count; + c0total += ((c0 << C0_SHIFT) + ((1<>1)) * count; + c1total += ((c1 << C1_SHIFT) + ((1<>1)) * count; + c2total += ((c2 << C2_SHIFT) + ((1<>1)) * count; + } + } + } + + cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); + cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); + cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); +} + + +LOCAL(void) +select_colors (j_decompress_ptr cinfo, int desired_colors) +/* Master routine for color selection */ +{ + boxptr boxlist; + int numboxes; + int i; + + /* Allocate workspace for box list */ + boxlist = (boxptr) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (size_t)desired_colors * SIZEOF(box)); + /* Initialize one box containing whole space */ + numboxes = 1; + boxlist[0].c0min = 0; + boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; + boxlist[0].c1min = 0; + boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; + boxlist[0].c2min = 0; + boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; + /* Shrink it to actually-used volume and set its statistics */ + update_box(cinfo, & boxlist[0]); + /* Perform median-cut to produce final box list */ + numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors); + /* Compute the representative color for each box, fill colormap */ + for (i = 0; i < numboxes; i++) + compute_color(cinfo, & boxlist[i], i); + cinfo->actual_number_of_colors = numboxes; + TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes); +} + + +/* + * These routines are concerned with the time-critical task of mapping input + * colors to the nearest color in the selected colormap. + * + * We re-use the histogram space as an "inverse color map", essentially a + * cache for the results of nearest-color searches. All colors within a + * histogram cell will be mapped to the same colormap entry, namely the one + * closest to the cell's center. This may not be quite the closest entry to + * the actual input color, but it's almost as good. A zero in the cache + * indicates we haven't found the nearest color for that cell yet; the array + * is cleared to zeroes before starting the mapping pass. When we find the + * nearest color for a cell, its colormap index plus one is recorded in the + * cache for future use. The pass2 scanning routines call fill_inverse_cmap + * when they need to use an unfilled entry in the cache. + * + * Our method of efficiently finding nearest colors is based on the "locally + * sorted search" idea described by Heckbert and on the incremental distance + * calculation described by Spencer W. Thomas in chapter III.1 of Graphics + * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that + * the distances from a given colormap entry to each cell of the histogram can + * be computed quickly using an incremental method: the differences between + * distances to adjacent cells themselves differ by a constant. This allows a + * fairly fast implementation of the "brute force" approach of computing the + * distance from every colormap entry to every histogram cell. Unfortunately, + * it needs a work array to hold the best-distance-so-far for each histogram + * cell (because the inner loop has to be over cells, not colormap entries). + * The work array elements have to be IJG_INT32s, so the work array would need + * 256Kb at our recommended precision. This is not feasible in DOS machines. + * + * To get around these problems, we apply Thomas' method to compute the + * nearest colors for only the cells within a small subbox of the histogram. + * The work array need be only as big as the subbox, so the memory usage + * problem is solved. Furthermore, we need not fill subboxes that are never + * referenced in pass2; many images use only part of the color gamut, so a + * fair amount of work is saved. An additional advantage of this + * approach is that we can apply Heckbert's locality criterion to quickly + * eliminate colormap entries that are far away from the subbox; typically + * three-fourths of the colormap entries are rejected by Heckbert's criterion, + * and we need not compute their distances to individual cells in the subbox. + * The speed of this approach is heavily influenced by the subbox size: too + * small means too much overhead, too big loses because Heckbert's criterion + * can't eliminate as many colormap entries. Empirically the best subbox + * size seems to be about 1/512th of the histogram (1/8th in each direction). + * + * Thomas' article also describes a refined method which is asymptotically + * faster than the brute-force method, but it is also far more complex and + * cannot efficiently be applied to small subboxes. It is therefore not + * useful for programs intended to be portable to DOS machines. On machines + * with plenty of memory, filling the whole histogram in one shot with Thomas' + * refined method might be faster than the present code --- but then again, + * it might not be any faster, and it's certainly more complicated. + */ + + +/* log2(histogram cells in update box) for each axis; this can be adjusted */ +#define BOX_C0_LOG (HIST_C0_BITS-3) +#define BOX_C1_LOG (HIST_C1_BITS-3) +#define BOX_C2_LOG (HIST_C2_BITS-3) + +#define BOX_C0_ELEMS (1<actual_number_of_colors; + int maxc0, maxc1, maxc2; + int centerc0, centerc1, centerc2; + int i, x, ncolors; + IJG_INT32 minmaxdist, min_dist, max_dist, tdist; + IJG_INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ + + /* Compute true coordinates of update box's upper corner and center. + * Actually we compute the coordinates of the center of the upper-corner + * histogram cell, which are the upper bounds of the volume we care about. + * Note that since ">>" rounds down, the "center" values may be closer to + * min than to max; hence comparisons to them must be "<=", not "<". + */ + maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); + centerc0 = (minc0 + maxc0) >> 1; + maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); + centerc1 = (minc1 + maxc1) >> 1; + maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); + centerc2 = (minc2 + maxc2) >> 1; + + /* For each color in colormap, find: + * 1. its minimum squared-distance to any point in the update box + * (zero if color is within update box); + * 2. its maximum squared-distance to any point in the update box. + * Both of these can be found by considering only the corners of the box. + * We save the minimum distance for each color in mindist[]; + * only the smallest maximum distance is of interest. + */ + minmaxdist = 0x7FFFFFFFL; + + for (i = 0; i < numcolors; i++) { + /* We compute the squared-c0-distance term, then add in the other two. */ + x = GETJSAMPLE(cinfo->colormap[0][i]); + if (x < minc0) { + tdist = (x - minc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else if (x > maxc0) { + tdist = (x - maxc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + min_dist = 0; + if (x <= centerc0) { + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[1][i]); + if (x < minc1) { + tdist = (x - minc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc1) { + tdist = (x - maxc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc1) { + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[2][i]); + if (x < minc2) { + tdist = (x - minc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc2) { + tdist = (x - maxc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc2) { + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } + } + + mindist[i] = min_dist; /* save away the results */ + if (max_dist < minmaxdist) + minmaxdist = max_dist; + } + + /* Now we know that no cell in the update box is more than minmaxdist + * away from some colormap entry. Therefore, only colors that are + * within minmaxdist of some part of the box need be considered. + */ + ncolors = 0; + for (i = 0; i < numcolors; i++) { + if (mindist[i] <= minmaxdist) + colorlist[ncolors++] = (JSAMPLE) i; + } + return ncolors; +} + + +LOCAL(void) +find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, + int numcolors, const JSAMPLE colorlist[], JSAMPLE bestcolor[]) +/* Find the closest colormap entry for each cell in the update box, + * given the list of candidate colors prepared by find_nearby_colors. + * Return the indexes of the closest entries in the bestcolor[] array. + * This routine uses Thomas' incremental distance calculation method to + * find the distance from a colormap entry to successive cells in the box. + */ +{ + int ic0, ic1, ic2; + int i, icolor; + register IJG_INT32 * bptr; /* pointer into bestdist[] array */ + JSAMPLE * cptr; /* pointer into bestcolor[] array */ + IJG_INT32 dist0, dist1; /* initial distance values */ + register IJG_INT32 dist2; /* current distance in inner loop */ + IJG_INT32 xx0, xx1; /* distance increments */ + register IJG_INT32 xx2; + IJG_INT32 inc0, inc1, inc2; /* initial values for increments */ + /* This array holds the distance to the nearest-so-far color for each cell */ + IJG_INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Initialize best-distance for each cell of the update box */ + bptr = bestdist; + for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--) + *bptr++ = 0x7FFFFFFFL; + + /* For each color selected by find_nearby_colors, + * compute its distance to the center of each cell in the box. + * If that's less than best-so-far, update best distance and color number. + */ + + /* Nominal steps between cell centers ("x" in Thomas article) */ +#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) +#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) +#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) + + for (i = 0; i < numcolors; i++) { + icolor = GETJSAMPLE(colorlist[i]); + /* Compute (square of) distance from minc0/c1/c2 to this color */ + inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE; + dist0 = inc0*inc0; + inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE; + dist0 += inc1*inc1; + inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE; + dist0 += inc2*inc2; + /* Form the initial difference increments */ + inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; + inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; + inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; + /* Now loop over all cells in box, updating distance per Thomas method */ + bptr = bestdist; + cptr = bestcolor; + xx0 = inc0; + for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) { + dist1 = dist0; + xx1 = inc1; + for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) { + dist2 = dist1; + xx2 = inc2; + for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) { + if (dist2 < *bptr) { + *bptr = dist2; + *cptr = (JSAMPLE) icolor; + } + dist2 += xx2; + xx2 += 2 * STEP_C2 * STEP_C2; + bptr++; + cptr++; + } + dist1 += xx1; + xx1 += 2 * STEP_C1 * STEP_C1; + } + dist0 += xx0; + xx0 += 2 * STEP_C0 * STEP_C0; + } + } +} + + +LOCAL(void) +fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) +/* Fill the inverse-colormap entries in the update box that contains */ +/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ +/* we can fill as many others as we wish.) */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int minc0, minc1, minc2; /* lower left corner of update box */ + int ic0, ic1, ic2; + register JSAMPLE * cptr; /* pointer into bestcolor[] array */ + register histptr cachep; /* pointer into main cache array */ + /* This array lists the candidate colormap indexes. */ + JSAMPLE colorlist[MAXNUMCOLORS]; + int numcolors; /* number of candidate colors */ + /* This array holds the actually closest colormap index for each cell. */ + JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Convert cell coordinates to update box ID */ + c0 >>= BOX_C0_LOG; + c1 >>= BOX_C1_LOG; + c2 >>= BOX_C2_LOG; + + /* Compute true coordinates of update box's origin corner. + * Actually we compute the coordinates of the center of the corner + * histogram cell, which are the lower bounds of the volume we care about. + */ + minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); + minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); + minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); + + /* Determine which colormap entries are close enough to be candidates + * for the nearest entry to some cell in the update box. + */ + numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist); + + /* Determine the actually nearest colors. */ + find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist, + bestcolor); + + /* Save the best color numbers (plus 1) in the main cache array */ + c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ + c1 <<= BOX_C1_LOG; + c2 <<= BOX_C2_LOG; + cptr = bestcolor; + for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) { + for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) { + cachep = & histogram[c0+ic0][c1+ic1][c2]; + for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) { + *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1); + } + } + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +pass2_no_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register JSAMPROW inptr, outptr; + register histptr cachep; + register int c0, c1, c2; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the cache */ + c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT; + c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT; + c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT; + cachep = & histogram[c0][c1][c2]; + /* If we have not seen this color before, find nearest colormap entry */ + /* and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, c0,c1,c2); + /* Now emit the colormap index for this cell */ + *outptr++ = (JSAMPLE) (*cachep - 1); + } + } +} + + +METHODDEF(void) +pass2_fs_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ + LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ + LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + JSAMPROW inptr; /* => current input pixel */ + JSAMPROW outptr; /* => current output pixel */ + histptr cachep; + int dir; /* +1 or -1 depending on direction */ + int dir3; /* 3*dir, for advancing inptr & errorptr */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + int *error_limit = cquantize->error_limiter; + JSAMPROW colormap0 = cinfo->colormap[0]; + JSAMPROW colormap1 = cinfo->colormap[1]; + JSAMPROW colormap2 = cinfo->colormap[2]; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + inptr += (width-1) * 3; /* so point to rightmost pixel */ + outptr += width-1; + dir = -1; + dir3 = -3; + errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */ + cquantize->on_odd_row = FALSE; /* flip for next time */ + } else { + /* work left to right in this row */ + dir = 1; + dir3 = 3; + errorptr = cquantize->fserrors; /* => entry before first real column */ + cquantize->on_odd_row = TRUE; /* flip for next time */ + } + /* Preset error values: no error propagated to first pixel from left */ + cur0 = cur1 = cur2 = 0; + /* and no error propagated to row below yet */ + belowerr0 = belowerr1 = belowerr2 = 0; + bpreverr0 = bpreverr1 = bpreverr2 = 0; + + for (col = width; col > 0; col--) { + /* curN holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4); + cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4); + cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4); + /* Limit the error using transfer function set by init_error_limit. + * See comments with init_error_limit for rationale. + */ + cur0 = error_limit[cur0]; + cur1 = error_limit[cur1]; + cur2 = error_limit[cur2]; + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE (or less with error limiting); + * this sets the required size of the range_limit array. + */ + cur0 += GETJSAMPLE(inptr[0]); + cur1 += GETJSAMPLE(inptr[1]); + cur2 += GETJSAMPLE(inptr[2]); + cur0 = GETJSAMPLE(range_limit[cur0]); + cur1 = GETJSAMPLE(range_limit[cur1]); + cur2 = GETJSAMPLE(range_limit[cur2]); + /* Index into the cache with adjusted pixel value */ + cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT]; + /* If we have not seen this color before, find nearest colormap */ + /* entry and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, (int)(cur0>>C0_SHIFT),(int)(cur1>>C1_SHIFT),(int)(cur2>>C2_SHIFT)); + /* Now emit the colormap index for this cell */ + { register int pixcode = *cachep - 1; + *outptr = (JSAMPLE) pixcode; + /* Compute representation error for this pixel */ + cur0 -= GETJSAMPLE(colormap0[pixcode]); + cur1 -= GETJSAMPLE(colormap1[pixcode]); + cur2 -= GETJSAMPLE(colormap2[pixcode]); + } + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + { register LOCFSERROR bnexterr, delta; + + bnexterr = cur0; /* Process component 0 */ + delta = cur0 * 2; + cur0 += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr0 + cur0); + cur0 += delta; /* form error * 5 */ + bpreverr0 = belowerr0 + cur0; + belowerr0 = bnexterr; + cur0 += delta; /* form error * 7 */ + bnexterr = cur1; /* Process component 1 */ + delta = cur1 * 2; + cur1 += delta; /* form error * 3 */ + errorptr[1] = (FSERROR) (bpreverr1 + cur1); + cur1 += delta; /* form error * 5 */ + bpreverr1 = belowerr1 + cur1; + belowerr1 = bnexterr; + cur1 += delta; /* form error * 7 */ + bnexterr = cur2; /* Process component 2 */ + delta = cur2 * 2; + cur2 += delta; /* form error * 3 */ + errorptr[2] = (FSERROR) (bpreverr2 + cur2); + cur2 += delta; /* form error * 5 */ + bpreverr2 = belowerr2 + cur2; + belowerr2 = bnexterr; + cur2 += delta; /* form error * 7 */ + } + /* At this point curN contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + inptr += dir3; /* Advance pixel pointers to next column */ + outptr += dir; + errorptr += dir3; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error values into the + * final fserrors[] entry. Note we need not unload belowerrN because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ + errorptr[1] = (FSERROR) bpreverr1; + errorptr[2] = (FSERROR) bpreverr2; + } +} + + +/* + * Initialize the error-limiting transfer function (lookup table). + * The raw F-S error computation can potentially compute error values of up to + * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be + * much less, otherwise obviously wrong pixels will be created. (Typical + * effects include weird fringes at color-area boundaries, isolated bright + * pixels in a dark area, etc.) The standard advice for avoiding this problem + * is to ensure that the "corners" of the color cube are allocated as output + * colors; then repeated errors in the same direction cannot cause cascading + * error buildup. However, that only prevents the error from getting + * completely out of hand; Aaron Giles reports that error limiting improves + * the results even with corner colors allocated. + * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty + * well, but the smoother transfer function used below is even better. Thanks + * to Aaron Giles for this idea. + */ + +LOCAL(void) +init_error_limit (j_decompress_ptr cinfo) +/* Allocate and fill in the error_limiter table */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + int * table; + int in, out; + + table = (int *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int)); + table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ + cquantize->error_limiter = table; + +#define STEPSIZE ((MAXJSAMPLE+1)/16) + /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ + out = 0; + for (in = 0; in < STEPSIZE; in++, out++) { + table[in] = out; table[-in] = -out; + } + /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ + for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) { + table[in] = out; table[-in] = -out; + } + /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ + for (; in <= MAXJSAMPLE; in++) { + table[in] = out; table[-in] = -out; + } +#undef STEPSIZE +} + + +/* + * Finish up at the end of each pass. + */ + +METHODDEF(void) +finish_pass1 (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Select the representative colors and fill in cinfo->colormap */ + cinfo->colormap = cquantize->sv_colormap; + select_colors(cinfo, cquantize->desired); + /* Force next pass to zero the color index table */ + cquantize->needs_zeroed = TRUE; +} + + +METHODDEF(void) +finish_pass2 (j_decompress_ptr cinfo) +{ + /* no work */ +} + + +/* + * Initialize for each processing pass. + */ + +METHODDEF(void) +start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int i; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + if (is_pre_scan) { + /* Set up method pointers */ + cquantize->pub.color_quantize = prescan_quantize; + cquantize->pub.finish_pass = finish_pass1; + cquantize->needs_zeroed = TRUE; /* Always zero histogram */ + } else { + /* Set up method pointers */ + if (cinfo->dither_mode == JDITHER_FS) + cquantize->pub.color_quantize = pass2_fs_dither; + else + cquantize->pub.color_quantize = pass2_no_dither; + cquantize->pub.finish_pass = finish_pass2; + + /* Make sure color count is acceptable */ + i = cinfo->actual_number_of_colors; + if (i < 1) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1); + if (i > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + + if (cinfo->dither_mode == JDITHER_FS) { + size_t arraysize = (size_t) ((cinfo->output_width + 2) * + (3 * SIZEOF(FSERROR))); + /* Allocate Floyd-Steinberg workspace if we didn't already. */ + if (cquantize->fserrors == NULL) + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + /* Initialize the propagated errors to zero. */ + jzero_far((void FAR *) cquantize->fserrors, arraysize); + /* Make the error-limit table if we didn't already. */ + if (cquantize->error_limiter == NULL) + init_error_limit(cinfo); + cquantize->on_odd_row = FALSE; + } + + } + /* Zero the histogram or inverse color map, if necessary */ + if (cquantize->needs_zeroed) { + for (i = 0; i < HIST_C0_ELEMS; i++) { + jzero_far((void FAR *) histogram[i], + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = FALSE; + } +} + + +/* + * Switch to a new external colormap between output passes. + */ + +METHODDEF(void) +new_color_map_2_quant (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Reset the inverse color map */ + cquantize->needs_zeroed = TRUE; +} + + +/* + * Module initialization routine for 2-pass color quantization. + */ + +GLOBAL(void) +jinit_2pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + int i; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_2_quant; + cquantize->pub.new_color_map = new_color_map_2_quant; + cquantize->fserrors = NULL; /* flag optional arrays not allocated */ + cquantize->error_limiter = NULL; + + /* Make sure jdmaster didn't give me a case I can't handle */ + if (cinfo->out_color_components != 3) + ERREXIT(cinfo, JERR_NOTIMPL); + + /* Allocate the histogram/inverse colormap storage */ + cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d)); + for (i = 0; i < HIST_C0_ELEMS; i++) { + cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ + + /* Allocate storage for the completed colormap, if required. + * We do this now since it is FAR storage and may affect + * the memory manager's space calculations. + */ + if (cinfo->enable_2pass_quant) { + /* Make sure color count is acceptable */ + int desired = cinfo->desired_number_of_colors; + /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */ + if (desired < 8) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (desired > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + cquantize->sv_colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3); + cquantize->desired = desired; + } else + cquantize->sv_colormap = NULL; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + /* Allocate Floyd-Steinberg workspace if necessary. + * This isn't really needed until pass 2, but again it is FAR storage. + * Although we will cope with a later change in dither_mode, + * we do not promise to honor max_memory_to_use if dither_mode changes. + */ + if (cinfo->dither_mode == JDITHER_FS) { + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR)))); + /* Might as well create the error-limiting table too. */ + init_error_limit(cinfo); + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ diff --git a/dcmjpeg/libijg8/jutils.c b/dcmjpeg/libijg8/jutils.c new file mode 100644 index 00000000..1a19f37f --- /dev/null +++ b/dcmjpeg/libijg8/jutils.c @@ -0,0 +1,179 @@ +/* + * jutils.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains tables and miscellaneous utility routines needed + * for both compression and decompression. + * Note we prefix all global names with "j" to minimize conflicts with + * a surrounding application. + */ + +#define JPEG_INTERNALS +#include "jinclude8.h" +#include "jpeglib8.h" + + +/* + * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element + * of a DCT block read in natural order (left to right, top to bottom). + */ + +#if 0 /* This table is not actually needed in v6a */ + +const int jpeg_zigzag_order[DCTSIZE2] = { + 0, 1, 5, 6, 14, 15, 27, 28, + 2, 4, 7, 13, 16, 26, 29, 42, + 3, 8, 12, 17, 25, 30, 41, 43, + 9, 11, 18, 24, 31, 40, 44, 53, + 10, 19, 23, 32, 39, 45, 52, 54, + 20, 22, 33, 38, 46, 51, 55, 60, + 21, 34, 37, 47, 50, 56, 59, 61, + 35, 36, 48, 49, 57, 58, 62, 63 +}; + +#endif + +/* + * jpeg_natural_order[i] is the natural-order position of the i'th element + * of zigzag order. + * + * When reading corrupted data, the Huffman decoders could attempt + * to reference an entry beyond the end of this array (if the decoded + * zero run length reaches past the end of the block). To prevent + * wild stores without adding an inner-loop test, we put some extra + * "63"s after the real entries. This will cause the extra coefficient + * to be stored in location 63 of the block, not somewhere random. + * The worst case would be a run-length of 15, which means we need 16 + * fake entries. + */ + +const int jpeg_natural_order[DCTSIZE2+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + + +/* + * Arithmetic utilities + */ + +GLOBAL(long) +jdiv_round_up (long a, long b) +/* Compute a/b rounded up to next integer, ie, ceil(a/b) */ +/* Assumes a >= 0, b > 0 */ +{ + return (a + b - 1L) / b; +} + + +GLOBAL(long) +jround_up (long a, long b) +/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */ +/* Assumes a >= 0, b > 0 */ +{ + a += b - 1L; + return a - (a % b); +} + + +/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays + * and coefficient-block arrays. This won't work on 80x86 because the arrays + * are FAR and we're assuming a small-pointer memory model. However, some + * DOS compilers provide far-pointer versions of memcpy() and memset() even + * in the small-model libraries. These will be used if USE_FMEM is defined. + * Otherwise, the routines below do it the hard way. (The performance cost + * is not all that great, because these routines aren't very heavily used.) + */ + +#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ +#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) +#define FMEMZERO(target,size) MEMZERO(target,size) +#else /* 80x86 case, define if we can */ +#ifdef USE_FMEM +#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size)) +#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size)) +#endif +#endif + + +GLOBAL(void) +jcopy_sample_rows (JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols) +/* Copy some rows of samples from one place to another. + * num_rows rows are copied from input_array[source_row++] + * to output_array[dest_row++]; these areas may overlap for duplication. + * The source and destination arrays must be at least as wide as num_cols. + */ +{ + register JSAMPROW inptr, outptr; +#ifdef FMEMCOPY + register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); +#else + register JDIMENSION count; +#endif + register int row; + + input_array += source_row; + output_array += dest_row; + + for (row = num_rows; row > 0; row--) { + inptr = *input_array++; + outptr = *output_array++; +#ifdef FMEMCOPY + FMEMCOPY(outptr, inptr, count); +#else + for (count = num_cols; count > 0; count--) + *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ +#endif + } +} + + +GLOBAL(void) +jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks) +/* Copy a row of coefficient blocks from one place to another. */ +{ +#ifdef FMEMCOPY + FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); +#else + register JCOEFPTR inptr, outptr; + register long count; + + inptr = (JCOEFPTR) input_row; + outptr = (JCOEFPTR) output_row; + for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) { + *outptr++ = *inptr++; + } +#endif +} + + +GLOBAL(void) +jzero_far (void FAR * target, size_t bytestozero) +/* Zero out a chunk of FAR memory. */ +/* This might be sample-array data, block-array data, or alloc_large data. */ +{ +#ifdef FMEMZERO + FMEMZERO(target, bytestozero); +#else + register char FAR * ptr = (char FAR *) target; + register size_t count; + + for (count = bytestozero; count > 0; count--) { + *ptr++ = 0; + } +#endif +} diff --git a/dcmjpeg/libijg8/jversion8.h b/dcmjpeg/libijg8/jversion8.h new file mode 100644 index 00000000..6472c58d --- /dev/null +++ b/dcmjpeg/libijg8/jversion8.h @@ -0,0 +1,14 @@ +/* + * jversion.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains software version identification. + */ + + +#define JVERSION "6b 27-Mar-1998" + +#define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" diff --git a/dcmjpeg/libsrc/CMakeLists.txt b/dcmjpeg/libsrc/CMakeLists.txt new file mode 100644 index 00000000..a4a8a60b --- /dev/null +++ b/dcmjpeg/libsrc/CMakeLists.txt @@ -0,0 +1,7 @@ +# declare additional include directories +include_directories("${dcmjpeg_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmjpeg_SOURCE_DIR}/libijg8" "${dcmjpeg_SOURCE_DIR}/libijg12" "${dcmjpeg_SOURCE_DIR}/libijg16" ${ZLIB_INCDIR}) + +# create library from source files +DCMTK_ADD_LIBRARY(dcmjpeg ddpiimpl dipijpeg djcodecd djcodece djcparam djdecbas djdecext djdeclol djdecode djdecpro djdecsps djdecsv1 djdijg12 djdijg8 djdijg16 djeijg12 djeijg8 djeijg16 djencbas djencext djenclol djencode djencpro djencsps djencsv1 djrplol djrploss djutils) + +DCMTK_TARGET_LINK_MODULES(dcmjpeg ofstd oflog dcmdata dcmimgle dcmimage ijg8 ijg12 ijg16) diff --git a/dcmjpeg/libsrc/Makefile.dep b/dcmjpeg/libsrc/Makefile.dep new file mode 100644 index 00000000..b0623125 --- /dev/null +++ b/dcmjpeg/libsrc/Makefile.dep @@ -0,0 +1,1649 @@ +ddpiimpl.o: ddpiimpl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/ddpiimpl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcddirif.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmjpeg/djdefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/discalet.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/ditranst.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipxrept.h +dipijpeg.o: dipijpeg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../include/dcmtk/dcmjpeg/dipijpeg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../include/dcmtk/dcmjpeg/djutils.h ../include/dcmtk/dcmjpeg/djdefine.h \ + ../../dcmjpeg/libijg8/jpeglib8.h ../../dcmjpeg/libijg8/jconfig8.h \ + ../../dcmjpeg/libijg8/jmorecfg8.h ../../dcmjpeg/libijg8/jerror8.h \ + ../../dcmjpeg/libijg8/jpegint8.h ../../dcmjpeg/libijg8/jversion8.h +djcodecd.o: djcodecd.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpxitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmjpeg/djcparam.h ../include/dcmtk/dcmjpeg/djdecabs.h +djcodece.o: djcodece.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djcodece.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpxitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmjpeg/djcparam.h ../include/dcmtk/dcmjpeg/djencabs.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h +djcparam.o: djcparam.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h +djdecbas.o: djdecbas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdecbas.h ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djdijg8.h ../include/dcmtk/dcmjpeg/djdecabs.h +djdecext.o: djdecext.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdecext.h ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djdijg8.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../include/dcmtk/dcmjpeg/djdijg12.h +djdeclol.o: djdeclol.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdeclol.h ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrplol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djdijg8.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../include/dcmtk/dcmjpeg/djdijg12.h ../include/dcmtk/dcmjpeg/djdijg16.h +djdecode.o: djdecode.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdecode.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djdecbas.h ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../include/dcmtk/dcmjpeg/djdecext.h ../include/dcmtk/dcmjpeg/djdecsps.h \ + ../include/dcmtk/dcmjpeg/djdecpro.h ../include/dcmtk/dcmjpeg/djdecsv1.h \ + ../include/dcmtk/dcmjpeg/djdeclol.h ../include/dcmtk/dcmjpeg/djcparam.h +djdecpro.o: djdecpro.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdecpro.h ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djdijg8.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../include/dcmtk/dcmjpeg/djdijg12.h +djdecsps.o: djdecsps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdecsps.h ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djdijg8.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../include/dcmtk/dcmjpeg/djdijg12.h +djdecsv1.o: djdecsv1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdecsv1.h ../include/dcmtk/dcmjpeg/djcodecd.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrplol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djdijg8.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../include/dcmtk/dcmjpeg/djdijg12.h ../include/dcmtk/dcmjpeg/djdijg16.h +djdijg12.o: djdijg12.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdijg12.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmjpeg/libijg12/jpeglib12.h ../../dcmjpeg/libijg12/jconfig12.h \ + ../../dcmjpeg/libijg12/jmorecfg12.h ../../dcmjpeg/libijg12/jerror12.h +djdijg16.o: djdijg16.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdijg16.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmjpeg/libijg16/jpeglib16.h ../../dcmjpeg/libijg16/jconfig16.h \ + ../../dcmjpeg/libijg16/jmorecfg16.h ../../dcmjpeg/libijg16/jerror16.h +djdijg8.o: djdijg8.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djdijg8.h ../include/dcmtk/dcmjpeg/djdecabs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmjpeg/libijg8/jpeglib8.h ../../dcmjpeg/libijg8/jconfig8.h \ + ../../dcmjpeg/libijg8/jmorecfg8.h ../../dcmjpeg/libijg8/jerror8.h +djeijg12.o: djeijg12.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djeijg12.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmjpeg/djencabs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmjpeg/libijg12/jpeglib12.h ../../dcmjpeg/libijg12/jconfig12.h \ + ../../dcmjpeg/libijg12/jmorecfg12.h ../../dcmjpeg/libijg12/jerror12.h \ + ../../dcmjpeg/libijg12/jpegint12.h +djeijg16.o: djeijg16.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djeijg16.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmjpeg/djencabs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmjpeg/libijg16/jpeglib16.h ../../dcmjpeg/libijg16/jconfig16.h \ + ../../dcmjpeg/libijg16/jmorecfg16.h ../../dcmjpeg/libijg16/jerror16.h \ + ../../dcmjpeg/libijg16/jpegint16.h +djeijg8.o: djeijg8.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djeijg8.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmjpeg/djencabs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmjpeg/libijg8/jpeglib8.h ../../dcmjpeg/libijg8/jconfig8.h \ + ../../dcmjpeg/libijg8/jmorecfg8.h ../../dcmjpeg/libijg8/jerror8.h \ + ../../dcmjpeg/libijg8/jpegint8.h +djencbas.o: djencbas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djencbas.h ../include/dcmtk/dcmjpeg/djcodece.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djeijg8.h ../include/dcmtk/dcmjpeg/djencabs.h +djencext.o: djencext.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djencext.h ../include/dcmtk/dcmjpeg/djcodece.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djeijg8.h ../include/dcmtk/dcmjpeg/djencabs.h \ + ../include/dcmtk/dcmjpeg/djeijg12.h +djenclol.o: djenclol.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djenclol.h ../include/dcmtk/dcmjpeg/djcodece.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrplol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djeijg8.h ../include/dcmtk/dcmjpeg/djencabs.h \ + ../include/dcmtk/dcmjpeg/djeijg12.h ../include/dcmtk/dcmjpeg/djeijg16.h +djencode.o: djencode.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djencode.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djencbas.h ../include/dcmtk/dcmjpeg/djcodece.h \ + ../include/dcmtk/dcmjpeg/djencext.h ../include/dcmtk/dcmjpeg/djencsps.h \ + ../include/dcmtk/dcmjpeg/djencpro.h ../include/dcmtk/dcmjpeg/djencsv1.h \ + ../include/dcmtk/dcmjpeg/djenclol.h ../include/dcmtk/dcmjpeg/djcparam.h +djencpro.o: djencpro.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djencpro.h ../include/dcmtk/dcmjpeg/djcodece.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djeijg8.h ../include/dcmtk/dcmjpeg/djencabs.h \ + ../include/dcmtk/dcmjpeg/djeijg12.h +djencsps.o: djencsps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djencsps.h ../include/dcmtk/dcmjpeg/djcodece.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djeijg8.h ../include/dcmtk/dcmjpeg/djencabs.h \ + ../include/dcmtk/dcmjpeg/djeijg12.h +djencsv1.o: djencsv1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djencsv1.h ../include/dcmtk/dcmjpeg/djcodece.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h ../include/dcmtk/dcmjpeg/djcparam.h \ + ../include/dcmtk/dcmjpeg/djrplol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmjpeg/djeijg8.h ../include/dcmtk/dcmjpeg/djencabs.h \ + ../include/dcmtk/dcmjpeg/djeijg12.h ../include/dcmtk/dcmjpeg/djeijg16.h +djrplol.o: djrplol.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djrplol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djdefine.h +djrploss.o: djrploss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djrploss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpeg/djdefine.h +djutils.o: djutils.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpeg/djutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../include/dcmtk/dcmjpeg/djdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h diff --git a/dcmjpeg/libsrc/Makefile.in b/dcmjpeg/libsrc/Makefile.in new file mode 100644 index 00000000..c78946ad --- /dev/null +++ b/dcmjpeg/libsrc/Makefile.in @@ -0,0 +1,55 @@ +# +# Makefile for dcmjpeg/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmjpegdir = $(top_srcdir)/../dcmjpeg + +LOCALINCLUDES = -I$(ofstddir)/include -I$(dcmdatadir)/include -I$(dcmimgledir)/include \ + -I$(dcmjpegdir)/libijg8 -I$(dcmjpegdir)/libijg12 -I$(dcmjpegdir)/libijg16 -I$(oflogdir)/include +LOCALDEFS = + +objs = djutils.o djencode.o djrplol.o djrploss.o djcparam.o djeijg8.o djdijg8.o \ + djcodecd.o djdecbas.o djdecext.o djdecpro.o djdecsps.o djdeclol.o djdecsv1.o \ + djcodece.o djencbas.o djencext.o djencpro.o djencsps.o djenclol.o djencsv1.o \ + djeijg12.o djdijg12.o djeijg16.o djdijg16.o djdecode.o dipijpeg.o ddpiimpl.o +library = libdcmjpeg.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmjpeg/libsrc/ddpiimpl.cc b/dcmjpeg/libsrc/ddpiimpl.cc new file mode 100644 index 00000000..7bd35ef1 --- /dev/null +++ b/dcmjpeg/libsrc/ddpiimpl.cc @@ -0,0 +1,119 @@ +/* + * + * Copyright (C) 2003-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdata + * + * Author: Joerg Riesmeier + * + * Purpose: Implementation of DICOMDIR image support (plugin) + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmjpeg/ddpiimpl.h" +#include "dcmtk/dcmimgle/dcmimage.h" /* for class DicomImage */ +#include "dcmtk/dcmimgle/discalet.h" /* for direct image scaling */ + +#include "dcmtk/ofstd/ofcast.h" + + +/*------------------* + * implementation * + *------------------*/ + +// constructor +DicomDirImageImplementation::DicomDirImageImplementation() +{ +} + + +// destructor +DicomDirImageImplementation::~DicomDirImageImplementation() +{ +} + + +// scale pixel data +OFBool DicomDirImageImplementation::scaleData(const Uint8 *srcData, + const unsigned int srcWidth, + const unsigned int srcHeight, + Uint8 *dstData, + const unsigned int dstWidth, + const unsigned int dstHeight) const +{ + OFBool result = OFFalse; + /* check parameters (at least the pointers) */ + if ((srcData != NULL) && (dstData != NULL)) + { + DiScaleTemplate scale(1, OFstatic_cast(Uint16, srcWidth), OFstatic_cast(Uint16, srcHeight), + OFstatic_cast(Uint16, dstWidth), OFstatic_cast(Uint16, dstHeight), 1); + scale.scaleData(OFstatic_cast(const Uint8 **, &srcData), &dstData, 1 /* interpolate */); + result = OFTrue; + } + return result; +} + + +// get scaled pixel data from DICOM image (monochrome only) +OFBool DicomDirImageImplementation::scaleImage(DcmItem *dataset, + Uint8 *pixel, + const unsigned long count, + const unsigned long frame, + const unsigned int width, + const unsigned int height, + const OFBool decompressAll) const +{ + OFBool result = OFFalse; + /* check parameters (at least the pointers) */ + if ((dataset != NULL) && (pixel != NULL) && (frame > 0)) + { + unsigned long flags = CIF_UsePartialAccessToPixelData | CIF_NeverAccessEmbeddedOverlays; + if (decompressAll) + flags |= CIF_DecompressCompletePixelData; + /* open referenced image */ + DicomImage *image = new DicomImage(dataset, EXS_Unknown, flags, frame - 1 /*fstart*/, 1 /*fcount*/); + if ((image != NULL) && (image->getStatus() == EIS_Normal)) + { + /* check if image is monochrome */ + if (!image->isMonochrome()) + { + /* ... if not create one */ + DicomImage *mono = image->createMonochromeImage(); + /* replace image by monochrome one */ + delete image; + image = mono; + } + if (image != NULL) + { + /* create icon */ + DicomImage *scaled = image->createScaledImage(OFstatic_cast(unsigned long, width), + OFstatic_cast(unsigned long, height), 1 /*interpolate*/); + if (scaled != NULL) + { + /* set VOI window */ + if (!scaled->setWindow(0)) + scaled->setMinMaxWindow(); + /* get pixel data */ + void *data = OFstatic_cast(void *, pixel); + if (scaled->getOutputData(data, count, 8)) + result = OFTrue; + delete scaled; + } + } + } + delete image; + } + return result; +} diff --git a/dcmjpeg/libsrc/dipijpeg.cc b/dcmjpeg/libsrc/dipijpeg.cc new file mode 100644 index 00000000..9f38c031 --- /dev/null +++ b/dcmjpeg/libsrc/dipijpeg.cc @@ -0,0 +1,247 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Joerg Riesmeier + * + * Purpose: Implements JPEG interface for plugable image formats + * + */ + + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmimgle/diimage.h" +#include "dcmtk/dcmjpeg/dipijpeg.h" + +#define INCLUDE_CSETJMP +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#define boolean ijg_boolean +#include "jpeglib8.h" +#include "jerror8.h" +#include "jpegint8.h" +#include "jversion8.h" +#undef boolean + +// disable any preprocessor magic the IJG library might be doing with the "const" keyword +#ifdef const +#undef const +#endif + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines longjmp() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + +// private error handler struct +struct DIEIJG8ErrorStruct +{ + // the standard IJG error handler object + struct jpeg_error_mgr pub; + // our jump buffer + jmp_buf setjmp_buffer; + // pointer to this + const DiJPEGPlugin *instance; +}; + +// callback forward declarations +void DIEIJG8ErrorExit(j_common_ptr); +void DIEIJG8OutputMessage(j_common_ptr cinfo); + +// helper method to fix old-style casts warnings +static void OFjpeg_create_compress(j_compress_ptr cinfo) +{ + jpeg_create_compress(cinfo); +} + +END_EXTERN_C + + +/*-------------* + * callbacks * + *-------------*/ + +// error handler, executes longjmp +void DIEIJG8ErrorExit(j_common_ptr cinfo) +{ + DIEIJG8ErrorStruct *myerr = OFreinterpret_cast(DIEIJG8ErrorStruct*, cinfo->err); + longjmp(myerr->setjmp_buffer, 1); +} + +// message handler for warning messages and the like +void DIEIJG8OutputMessage(j_common_ptr cinfo) +{ + DIEIJG8ErrorStruct *myerr = OFreinterpret_cast(DIEIJG8ErrorStruct*, cinfo->err); + myerr->instance->outputMessage(cinfo); +} + + +/*----------------* + * constructors * + *----------------*/ + +DiJPEGPlugin::DiJPEGPlugin() + : DiPluginFormat(), + Quality(75), + Sampling(ESS_444) +{ +} + + +DiJPEGPlugin::~DiJPEGPlugin() +{ +} + + +/*------------------* + * implementation * + *------------------*/ + +void DiJPEGPlugin::setQuality(const unsigned int quality) +{ + /* valid range: 0..100 (percent) */ + if (Quality <= 100) + Quality = quality; +} + + +void DiJPEGPlugin::setSampling(const E_SubSampling sampling) +{ + Sampling = sampling; +} + + +void DiJPEGPlugin::outputMessage(void *arg) const +{ + jpeg_common_struct *cinfo = OFreinterpret_cast(jpeg_common_struct*, arg); + if (cinfo && DCM_dcmjpegLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo, buffer); /* Create the message */ + DCMJPEG_WARN(buffer); + } +} + + +int DiJPEGPlugin::write(DiImage *image, + FILE *stream, + const unsigned long frame) const +{ + int result = 0; + if ((image != NULL) && (stream != NULL)) + { + /* create bitmap with 8 bits per sample */ + const void *data = image->getOutputData(frame, 8 /*bits*/, 0 /*planar*/); + if (data != NULL) + { + const OFBool isMono = (image->getInternalColorModel() == EPI_Monochrome1) || + (image->getInternalColorModel() == EPI_Monochrome2); + + /* code derived from "cjpeg.c" (IJG) and "djeijg8.cc" (DCMJPEG) */ + struct jpeg_compress_struct cinfo; + OFjpeg_create_compress(&cinfo); + /* Initialize JPEG parameters. */ + cinfo.image_width = image->getColumns(); + cinfo.image_height = image->getRows(); + cinfo.input_components = (isMono) ? 1 : 3; + cinfo.in_color_space = (isMono) ? JCS_GRAYSCALE : ((image->getInternalColorModel() == EPI_YBR_Full) ? JCS_YCbCr : JCS_RGB); + + /* Set up the error handling. This has to be after all uses of isMono */ + struct DIEIJG8ErrorStruct jerr; + /* Initialize the JPEG compression object with default error handling. */ + cinfo.err = jpeg_std_error(&jerr.pub); + /* overwrite with specific error handling */ + jerr.instance = this; + jerr.pub.error_exit = DIEIJG8ErrorExit; + jerr.pub.output_message = DIEIJG8OutputMessage; + if (setjmp(jerr.setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + /* Create the message */ + (*cinfo.err->format_message)(OFreinterpret_cast(jpeg_common_struct*, &cinfo), buffer); + /* Release memory */ + jpeg_destroy_compress(&cinfo); + image->deleteOutputData(); + /* return error code */ + return 0; + } + jpeg_set_defaults(&cinfo); + cinfo.optimize_coding = TRUE; + /* Set quantization tables for selected quality. */ + jpeg_set_quality(&cinfo, Quality, TRUE /*force_baseline*/); + /* Specify data destination for compression */ + jpeg_stdio_dest(&cinfo, stream); + /* initialize sampling factors */ + if (cinfo.jpeg_color_space == JCS_YCbCr) + { + switch(Sampling) + { + case ESS_444: /* 4:4:4 sampling (no subsampling) */ + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_422: /* 4:2:2 sampling (horizontal subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_411: /* 4:1:1 sampling (horizontal and vertical subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 2; + break; + } + } else { + // JPEG color space is not YCbCr, disable subsampling. + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + } + // all other components are set to 1x1 + for (int sfi = 1; sfi < MAX_COMPONENTS; sfi++) + { + cinfo.comp_info[sfi].h_samp_factor = 1; + cinfo.comp_info[sfi].v_samp_factor = 1; + } + /* Start compressor */ + jpeg_start_compress(&cinfo, TRUE); + /* Process data */ + JSAMPROW row_pointer[1]; + Uint8 *image_buffer = OFreinterpret_cast(Uint8*, OFconst_cast(void*, data)); + const size_t row_stride = cinfo.image_width * cinfo.input_components; + while (cinfo.next_scanline < cinfo.image_height) + { + row_pointer[0] = &image_buffer[cinfo.next_scanline * row_stride]; + (void)jpeg_write_scanlines(&cinfo, row_pointer, 1); + } + /* Finish compression and release memory */ + jpeg_finish_compress(&cinfo); + jpeg_destroy_compress(&cinfo); + /* All done. */ + result = 1; + } + /* delete pixel data */ + image->deleteOutputData(); + } + return result; +} + + +OFString DiJPEGPlugin::getLibraryVersionString() +{ + /* create version information */ + return "IJG, Version " JVERSION " (modified)"; +} diff --git a/dcmjpeg/libsrc/djcodecd.cc b/dcmjpeg/libsrc/djcodecd.cc new file mode 100644 index 00000000..f7280d97 --- /dev/null +++ b/dcmjpeg/libsrc/djcodecd.cc @@ -0,0 +1,899 @@ +/* + * + * Copyright (C) 2001-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Abstract base class for IJG JPEG decoder + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodecd.h" + +// dcmdata includes +#include "dcmtk/dcmdata/dcdatset.h" /* for class DcmDataset */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for class DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/dcvrpobw.h" /* for class DcmPolymorphOBOW */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary() */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmGenerateUniqueIdentifer()*/ + +// dcmjpeg includes +#include "dcmtk/dcmjpeg/djcparam.h" /* for class DJCodecParameter */ +#include "dcmtk/dcmjpeg/djdecabs.h" /* for class DJDecoder */ + + +DJCodecDecoder::DJCodecDecoder() +: DcmCodec() +{ +} + + +DJCodecDecoder::~DJCodecDecoder() +{ +} + + +OFBool DJCodecDecoder::canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const +{ + E_TransferSyntax myXfer = supportedTransferSyntax(); + DcmXfer newRep(newRepType); + if (newRep.isNotEncapsulated() && (oldRepType == myXfer)) return OFTrue; // decompress requested + + // we don't support re-coding for now. + return OFFalse; +} + + +OFCondition DJCodecDecoder::decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const +{ + OFCondition result = EC_Normal; + // assume we can cast the codec parameter to what we need + const DJCodecParameter *djcp = OFreinterpret_cast(const DJCodecParameter*, cp); + + DcmStack localStack(objStack); + (void)localStack.pop(); // pop pixel data element from stack + DcmObject *dataset = localStack.pop(); // this is the item in which the pixel data is located + if ((!dataset)||((dataset->ident()!= EVR_dataset) && (dataset->ident()!= EVR_item))) result = EC_InvalidTag; + else + { + Uint16 imageSamplesPerPixel = 0; + Uint16 imageRows = 0; + Uint16 imageColumns = 0; + Sint32 imageFrames = 1; + Uint16 imageBitsAllocated = 0; + Uint16 imageBitsStored = 0; + Uint16 imageHighBit = 0; + const char *sopClassUID = NULL; + OFBool createPlanarConfiguration = OFFalse; + OFBool createPlanarConfigurationInitialized = OFFalse; + EP_Interpretation colorModel = EPI_Unknown; + OFBool isSigned = OFFalse; + Uint16 pixelRep = 0; // needed to decline color conversion of signed pixel data to RGB + OFBool numberOfFramesPresent = OFFalse; + + if (result.good()) result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_SamplesPerPixel, imageSamplesPerPixel); + if (result.good()) result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_Rows, imageRows); + if (result.good()) result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_Columns, imageColumns); + if (result.good()) result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_BitsAllocated, imageBitsAllocated); + if (result.good()) result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_BitsStored, imageBitsStored); + if (result.good()) result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_HighBit, imageHighBit); + if (result.good()) result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_PixelRepresentation, pixelRep); + isSigned = (pixelRep == 0) ? OFFalse : OFTrue; + + // number of frames is an optional attribute - we don't mind if it isn't present. + if (result.good()) + { + if (OFreinterpret_cast(DcmItem*, dataset)->findAndGetSint32(DCM_NumberOfFrames, imageFrames).good()) numberOfFramesPresent = OFTrue; + } + + // we consider SOP Class UID as optional since we only need it to determine SOP Class specific + // encoding rules for planar configuration. + if (result.good()) (void) OFreinterpret_cast(DcmItem*, dataset)->findAndGetString(DCM_SOPClassUID, sopClassUID); + + EP_Interpretation dicomPI = DcmJpegHelper::getPhotometricInterpretation(OFreinterpret_cast(DcmItem*, dataset)); + + OFBool isYBR = OFFalse; + if ((dicomPI == EPI_YBR_Full)||(dicomPI == EPI_YBR_Full_422)||(dicomPI == EPI_YBR_Partial_422)) isYBR = OFTrue; + + if (imageFrames >= OFstatic_cast(Sint32, pixSeq->card())) + imageFrames = OFstatic_cast(Sint32, pixSeq->card() - 1); // limit number of frames to number of pixel items - 1 + if (imageFrames < 1) + imageFrames = 1; // default in case the number of frames attribute contains garbage + + if (result.good()) + { + DcmPixelItem *pixItem = NULL; + Uint8 * jpegData = NULL; + result = pixSeq->getItem(pixItem, 1); // first item is offset table, use second item + if (result.good() && (pixItem != NULL)) + { + Uint32 fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(jpegData); + if (result.good()) + { + if (jpegData == NULL) result = EC_CorruptedData; // JPEG data stream is empty/absent + else + { + Uint8 precision = scanJpegDataForBitDepth(jpegData, fragmentLength); + if (precision == 0) result = EC_CannotChangeRepresentation; // something has gone wrong, bail out + else + { + DJDecoder *jpeg = createDecoderInstance(fromRepParam, djcp, precision, isYBR); + if (jpeg == NULL) result = EC_MemoryExhausted; + else + { + size_t frameSize = ((precision > 8) ? sizeof(Uint16) : sizeof(Uint8)) * imageRows * imageColumns * imageSamplesPerPixel; + size_t totalSize = frameSize * imageFrames; + if (totalSize & 1) totalSize++; // align on 16-bit word boundary + Uint16 *imageData16 = NULL; + Sint32 currentFrame = 0; + size_t currentItem = 1; // ignore offset table + + if (isYBR && (imageBitsStored < imageBitsAllocated)) // check for a special case that is currently not handled properly + { + if (djcp->getDecompressionColorSpaceConversion() != EDC_never) + { + DCMJPEG_WARN("BitsStored < BitsAllocated for JPEG compressed image with YCbCr color model, color space conversion will probably not work properly"); + DCMJPEG_DEBUG("workaround: use option --conv-never (for command line tools) or EDC_never (for the DJDecoderRegistration::registerCodecs() call)"); + } + } + + result = uncompressedPixelData.createUint16Array(OFstatic_cast(Uint32, totalSize / sizeof(Uint16)), imageData16); + if (result.good()) + { + Uint8 *imageData8 = OFreinterpret_cast(Uint8*, imageData16); + OFBool forceSingleFragmentPerFrame = djcp->getForceSingleFragmentPerFrame(); + + while ((currentFrame < imageFrames)&&(result.good())) + { + result = jpeg->init(); + if (result.good()) + { + result = EJ_Suspension; + while (EJ_Suspension == result) + { + result = pixSeq->getItem(pixItem, OFstatic_cast(Uint32, currentItem++)); + if (result.good()) + { + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(jpegData); + if (result.good()) + { + result = jpeg->decode(jpegData, fragmentLength, imageData8, OFstatic_cast(Uint32, frameSize), isSigned); + + // check if we should enforce "one fragment per frame" while + // decompressing a multi-frame image even if stream suspension occurs + if ((EJ_Suspension == result) && forceSingleFragmentPerFrame) + { + // frame is incomplete. Nevertheless skip to next frame. + // This permits decompression of faulty multi-frame images. + result = EC_Normal; + } + } + } + } + if (result.good()) + { + if (! createPlanarConfigurationInitialized) + { + // we need to know the decompressed photometric interpretation in order + // to determine the final planar configuration. However, this is only + // known after the first call to jpeg->decode(), i.e. here. + colorModel = jpeg->getDecompressedColorModel(); + if (colorModel == EPI_Unknown) + { + // derive color model from DICOM photometric interpretation + if ((dicomPI == EPI_YBR_Full_422)||(dicomPI == EPI_YBR_Partial_422)) colorModel = EPI_YBR_Full; + else colorModel = dicomPI; + } + + switch (djcp->getPlanarConfiguration()) + { + case EPC_default: + createPlanarConfiguration = requiresPlanarConfiguration(sopClassUID, colorModel); + break; + case EPC_colorByPixel: + createPlanarConfiguration = OFFalse; + break; + case EPC_colorByPlane: + createPlanarConfiguration = OFTrue; + break; + } + createPlanarConfigurationInitialized = OFTrue; + } + + // convert planar configuration if necessary + if ((imageSamplesPerPixel == 3) && createPlanarConfiguration) + { + if (precision > 8) + result = createPlanarConfigurationWord(OFreinterpret_cast(Uint16*, imageData8), imageColumns, imageRows); + else result = createPlanarConfigurationByte(imageData8, imageColumns, imageRows); + } + currentFrame++; + imageData8 += frameSize; + } + } + } + + if (result.good()) + { + // decompression is complete, finally adjust byte order if necessary + if (jpeg->bytesPerSample() == 1) // we're writing bytes into words + { + result = swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, imageData16, + OFstatic_cast(Uint32, totalSize), sizeof(Uint16)); + } + } + + // adjust photometric interpretation depending on what conversion has taken place + if (result.good()) + { + switch (colorModel) + { + case EPI_Monochrome2: + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertString(DCM_PhotometricInterpretation, "MONOCHROME2"); + if (result.good()) + { + imageSamplesPerPixel = 1; + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_SamplesPerPixel, imageSamplesPerPixel); + } + break; + case EPI_YBR_Full: + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertString(DCM_PhotometricInterpretation, "YBR_FULL"); + if (result.good()) + { + imageSamplesPerPixel = 3; + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_SamplesPerPixel, imageSamplesPerPixel); + } + break; + case EPI_RGB: + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertString(DCM_PhotometricInterpretation, "RGB"); + if (result.good()) + { + imageSamplesPerPixel = 3; + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_SamplesPerPixel, imageSamplesPerPixel); + } + break; + default: + /* leave photometric interpretation untouched unless it is YBR_FULL_422 + * or YBR_PARTIAL_422. In this case, replace by YBR_FULL since decompression + * eliminates the subsampling. + */ + if ((dicomPI == EPI_YBR_Full_422)||(dicomPI == EPI_YBR_Partial_422)) + { + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertString(DCM_PhotometricInterpretation, "YBR_FULL"); + } + break; + } + } + + // Bits Allocated is now either 8 or 16 + if (result.good()) + { + if (precision > 8) result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_BitsAllocated, 16); + else result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_BitsAllocated, 8); + } + + // Planar Configuration depends on the createPlanarConfiguration flag + if ((result.good()) && (imageSamplesPerPixel > 1)) + { + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_PlanarConfiguration, (createPlanarConfiguration ? 1 : 0)); + } + + // Bits Stored cannot be larger than precision + if ((result.good()) && (imageBitsStored > precision)) + { + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_BitsStored, precision); + } + + // High Bit cannot be larger than precision - 1 + if ((result.good()) && (imageHighBit >= precision)) + { + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertUint16(DCM_HighBit, OFstatic_cast(Uint16, precision-1)); + } + + // Number of Frames might have changed in case the previous value was wrong + if (result.good() && (numberOfFramesPresent || (imageFrames > 1))) + { + char numBuf[20]; + sprintf(numBuf, "%ld", OFstatic_cast(long, imageFrames)); + result = OFreinterpret_cast(DcmItem*, dataset)->putAndInsertString(DCM_NumberOfFrames, numBuf); + } + + // Pixel Representation could be signed if lossless JPEG. For now, we just believe what we get. + } + delete jpeg; + } + } + } + } + } + } + + // the following operations do not affect the Image Pixel Module + // but other modules such as SOP Common. We only perform these + // changes if we're on the main level of the dataset, + // which should always identify itself as dataset, not as item. + if (dataset->ident() == EVR_dataset) + { + DcmItem *ditem = OFreinterpret_cast(DcmItem*, dataset); + + // create new SOP instance UID if codec parameters require so + if (result.good() && (djcp->getUIDCreation() == EUC_always)) + result = DcmCodec::newInstance(ditem, NULL, NULL, NULL); + + // set Lossy Image Compression to "01" (see DICOM part 3, C.7.6.1.1.5) + if (result.good() && (! isLosslessProcess())) result = ditem->putAndInsertString(DCM_LossyImageCompression, "01"); + } + + } + return result; +} + + +// the following macros make the source code more readable and easier to maintain + +#define GET_AND_CHECK_UINT16_VALUE(tag, variable) \ + if (result.good()) \ + { \ + result = dataset->findAndGetUint16(tag, variable); \ + if (result == EC_TagNotFound) \ + { \ + DCMJPEG_WARN("mandatory element " << DcmTag(tag).getTagName() << " " << tag << " is missing"); \ + result = EC_MissingAttribute; \ + } \ + else if ((result == EC_IllegalCall) || (result == EC_IllegalParameter)) \ + { \ + DCMJPEG_WARN("no value for mandatory element " << DcmTag(tag).getTagName() << " " << tag); \ + result = EC_MissingValue; \ + } \ + else if (result.bad()) \ + DCMJPEG_WARN("cannot retrieve value of element " << DcmTag(tag).getTagName() << " " << tag << ": " << result.text()); \ + } + +#define GET_AND_CHECK_STRING_VALUE(tag, variable) \ + if (result.good()) \ + { \ + result = dataset->findAndGetOFString(tag, variable); \ + if (result == EC_TagNotFound) \ + { \ + DCMJPEG_WARN("mandatory element " << DcmTag(tag).getTagName() << " " << tag << " is missing"); \ + result = EC_MissingAttribute; \ + } \ + else if (result.bad()) \ + { \ + DCMJPEG_WARN("cannot retrieve value of element " << DcmTag(tag).getTagName() << " " << tag << ": " << result.text()); \ + } \ + else if (variable.empty()) \ + { \ + DCMJPEG_WARN("no value for mandatory element " << DcmTag(tag).getTagName() << " " << tag); \ + result = EC_MissingValue; \ + } \ + } + +OFCondition DJCodecDecoder::decodeFrame( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const +{ + + OFCondition result = EC_Normal; + // assume we can cast the codec parameter to what we need + const DJCodecParameter *djcp = OFreinterpret_cast(const DJCodecParameter*, cp); + + if (dataset == NULL) + result = EC_IllegalParameter; + else if ((dataset->ident() != EVR_dataset) && (dataset->ident() != EVR_item)) + result = EC_CorruptedData; + else + { + Uint16 imageSamplesPerPixel = 0; + Uint16 imageRows = 0; + Uint16 imageColumns = 0; + Sint32 imageFrames = 1; + Uint16 imageBitsAllocated = 0; + Uint16 imageBitsStored = 0; + Uint16 imageHighBit = 0; + Uint16 planarConfig = 0; + OFString photometricInterpretation; + OFBool isSigned = OFFalse; + Uint16 pixelRep = 0; // needed to decline color conversion of signed pixel data to RGB + + /* retrieve values from dataset (and warn if missing or empty) */ + GET_AND_CHECK_UINT16_VALUE(DCM_SamplesPerPixel, imageSamplesPerPixel) + GET_AND_CHECK_UINT16_VALUE(DCM_Rows, imageRows) + GET_AND_CHECK_UINT16_VALUE(DCM_Columns, imageColumns) + GET_AND_CHECK_UINT16_VALUE(DCM_BitsAllocated, imageBitsAllocated) + GET_AND_CHECK_UINT16_VALUE(DCM_BitsStored, imageBitsStored) + GET_AND_CHECK_UINT16_VALUE(DCM_HighBit, imageHighBit) + GET_AND_CHECK_UINT16_VALUE(DCM_PixelRepresentation, pixelRep) + GET_AND_CHECK_STRING_VALUE(DCM_PhotometricInterpretation, photometricInterpretation) + if (imageSamplesPerPixel > 1) + { + GET_AND_CHECK_UINT16_VALUE(DCM_PlanarConfiguration, planarConfig); + } + + isSigned = (pixelRep == 0) ? OFFalse : OFTrue; + + // number of frames is an optional attribute - we don't mind if it isn't present. + if (result.good()) dataset->findAndGetSint32(DCM_NumberOfFrames, imageFrames); + + EP_Interpretation dicomPI = DcmJpegHelper::getPhotometricInterpretation(dataset); + + OFBool isYBR = OFFalse; + if ((dicomPI == EPI_YBR_Full)||(dicomPI == EPI_YBR_Full_422)||(dicomPI == EPI_YBR_Partial_422)) isYBR = OFTrue; + + if (imageFrames < 1) imageFrames = 1; // default in case this attribute contains garbage + + // determine the corresponding item (first fragment) for this frame + Uint32 currentItem = startFragment; + + // if the user has provided this information, we trust him. + // If the user has passed a zero, try to find out ourselves. + if (currentItem == 0 && result.good()) + { + result = determineStartFragment(frameNo, imageFrames, fromPixSeq, currentItem); + } + + // book-keeping needed to clean-up memory the end of this routine + Uint32 firstFragmentUsed = currentItem; + Uint32 pastLastFragmentUsed = firstFragmentUsed; + + // now access and decompress the frame starting at the item we have identified + if (result.good()) + { + DcmPixelItem *pixItem = NULL; + Uint8 * jpegData = NULL; + result = fromPixSeq->getItem(pixItem, currentItem); + if (result.good()) + { + size_t fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(jpegData); + if (result.good()) + { + if (jpegData == NULL) result = EC_CorruptedData; // JPEG data stream is empty/absent + else + { + Uint8 precision = scanJpegDataForBitDepth(jpegData, OFstatic_cast(Uint32, fragmentLength)); + if (precision == 0) result = EC_CannotChangeRepresentation; // something has gone wrong, bail out + else + { + size_t frameSize = ((precision > 8) ? sizeof(Uint16) : sizeof(Uint8)) * imageRows * imageColumns * imageSamplesPerPixel; + if (frameSize > bufSize) return EC_IllegalCall; + + DJDecoder *jpeg = createDecoderInstance(fromParam, djcp, precision, isYBR); + if (jpeg == NULL) result = EC_MemoryExhausted; + else + { + if (isYBR && (imageBitsStored < imageBitsAllocated)) // check for a special case that is currently not handled properly + { + if (djcp->getDecompressionColorSpaceConversion() != EDC_never) + { + DCMJPEG_WARN("BitsStored < BitsAllocated for JPEG compressed image with YCbCr color model, color space conversion will probably not work properly"); + DCMJPEG_DEBUG("workaround: use option --conv-never (for command line tools) or EDC_never (for the DJDecoderRegistration::registerCodecs() call)"); + } + } + + result = jpeg->init(); + if (result.good()) + { + result = EJ_Suspension; + while (EJ_Suspension == result) + { + result = fromPixSeq->getItem(pixItem, currentItem++); + if (result.good()) + { + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(jpegData); + if (result.good()) + { + result = jpeg->decode(jpegData, OFstatic_cast(Uint32, fragmentLength), OFreinterpret_cast(Uint8*, buffer), OFstatic_cast(Uint32, frameSize), isSigned); + pastLastFragmentUsed = currentItem; + } + } + } + if (result.good()) + { + // convert planar configuration to color by plane if necessary + if ((imageSamplesPerPixel == 3) && (planarConfig == 1)) + { + if (precision > 8) + result = createPlanarConfigurationWord(OFreinterpret_cast(Uint16*, buffer), imageColumns, imageRows); + else result = createPlanarConfigurationByte(OFreinterpret_cast(Uint8*, buffer), imageColumns, imageRows); + } + } + + if (result.good()) + { + // decompression is complete, finally adjust byte order if necessary + if (jpeg->bytesPerSample() == 1) // we're writing bytes into words + { + result = swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, OFreinterpret_cast(Uint16*, buffer), OFstatic_cast(Uint32, frameSize), sizeof(Uint16)); + } + } + + if (result.good()) + { + // compression was successful. Now update output parameters + startFragment = pastLastFragmentUsed; + decompressedColorModel = photometricInterpretation; // this is the default + + // now see if we have to change the photometric interpretation + // because the decompression has changed something + switch (jpeg->getDecompressedColorModel()) + { + case EPI_Monochrome2: + decompressedColorModel = "MONOCHROME2"; + break; + case EPI_YBR_Full: + decompressedColorModel = "YBR_FULL"; + break; + case EPI_RGB: + decompressedColorModel = "RGB"; + break; + default: + if ((dicomPI == EPI_YBR_Full_422)||(dicomPI == EPI_YBR_Partial_422)) + { + // decompression always eliminates subsampling + decompressedColorModel = "YBR_FULL"; + } + break; + } + } + + delete jpeg; + + /* remove all used fragments from memory */ + while (firstFragmentUsed < pastLastFragmentUsed) + { + fromPixSeq->getItem(pixItem, firstFragmentUsed++); + pixItem->compact(); + } + } + } + } + } + } + } + } + } + return result; +} + + +OFCondition DJCodecDecoder::encode( + const Uint16 * /* pixelData */, + const Uint32 /* length */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* pixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we are a decoder only + return EC_IllegalCall; +} + + +OFCondition DJCodecDecoder::encode( + const E_TransferSyntax /* fromRepType */, + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* toPixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we don't support re-coding for now + return EC_IllegalCall; +} + + +OFCondition DJCodecDecoder::determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const +{ + OFCondition result = EC_CorruptedData; + if ((dataset != NULL) && (fromPixSeq != NULL)) + { + // the first frame always starts with the second fragment + Uint32 startFragment = 1; + Uint32 bufSize = 0; + // determine size of uncompressed frame + if ((fromPixSeq->getUncompressedFrameSize(dataset, bufSize).good()) && (bufSize > 0)) + { + // allocate temporary buffer for a single frame + Uint8 *buffer = new Uint8[bufSize]; + if (buffer != NULL) + { + DCMJPEG_DEBUG("decompressing first frame to determine the decompressed color model"); + // simple approach: decode first frame in order to determine the uncompressed color model + result = decodeFrame(fromParam, fromPixSeq, cp, dataset, 0 /* frameNo */, startFragment, + OFstatic_cast(void *, buffer), bufSize, decompressedColorModel); + } else + result = EC_MemoryExhausted; + delete[] buffer; + } + } + if (result.bad()) + DCMJPEG_ERROR("can't decompress first frame: " << result.text()); + return result; +} + + +Uint16 DJCodecDecoder::readUint16(const Uint8 *data) +{ + return OFstatic_cast(Uint16, (OFstatic_cast(Uint16, *data) << 8) | OFstatic_cast(Uint16, *(data+1))); +} + + +Uint8 DJCodecDecoder::scanJpegDataForBitDepth( + const Uint8 *data, + const Uint32 fragmentLength) +{ + // first, check whether there is any JPEG data at all + if (data == NULL) return 0; + Uint32 offset = 0; + while(offset+4 < fragmentLength) + { + switch(readUint16(data+offset)) + { + case 0xffc0: // SOF_0: JPEG baseline + return data[offset+4]; + /* break; */ + case 0xffc1: // SOF_1: JPEG extended sequential DCT + return data[offset+4]; + /* break; */ + case 0xffc2: // SOF_2: JPEG progressive DCT + return data[offset+4]; + /* break; */ + case 0xffc3 : // SOF_3: JPEG lossless sequential + return data[offset+4]; + /* break; */ + case 0xffc5: // SOF_5: differential (hierarchical) extended sequential, Huffman + return data[offset+4]; + /* break; */ + case 0xffc6: // SOF_6: differential (hierarchical) progressive, Huffman + return data[offset+4]; + /* break; */ + case 0xffc7: // SOF_7: differential (hierarchical) lossless, Huffman + return data[offset+4]; + /* break; */ + case 0xffc8: // Reserved for JPEG extentions + offset += readUint16(data+offset+2)+2; + break; + case 0xffc9: // SOF_9: extended sequential, arithmetic + return data[offset+4]; + /* break; */ + case 0xffca: // SOF_10: progressive, arithmetic + return data[offset+4]; + /* break; */ + case 0xffcb: // SOF_11: lossless, arithmetic + return data[offset+4]; + /* break; */ + case 0xffcd: // SOF_13: differential (hierarchical) extended sequential, arithmetic + return data[offset+4]; + /* break; */ + case 0xffce: // SOF_14: differential (hierarchical) progressive, arithmetic + return data[offset+4]; + /* break; */ + case 0xffcf: // SOF_15: differential (hierarchical) lossless, arithmetic + return data[offset+4]; + /* break; */ + case 0xffc4: // DHT + offset += readUint16(data+offset+2)+2; + break; + case 0xffcc: // DAC + offset += readUint16(data+offset+2)+2; + break; + case 0xffd0: // RST m + case 0xffd1: + case 0xffd2: + case 0xffd3: + case 0xffd4: + case 0xffd5: + case 0xffd6: + case 0xffd7: + offset +=2; + break; + case 0xffd8: // SOI + offset +=2; + break; + case 0xffd9: // EOI + offset +=2; + break; + case 0xffda: // SOS + offset += readUint16(data+offset+2)+2; + break; + case 0xffdb: // DQT + offset += readUint16(data+offset+2)+2; + break; + case 0xffdc: // DNL + offset += readUint16(data+offset+2)+2; + break; + case 0xffdd: // DRI + offset += readUint16(data+offset+2)+2; + break; + case 0xffde: // DHP + offset += readUint16(data+offset+2)+2; + break; + case 0xffdf: // EXP + offset += readUint16(data+offset+2)+2; + break; + case 0xffe0: // APPn + case 0xffe1: + case 0xffe2: + case 0xffe3: + case 0xffe4: + case 0xffe5: + case 0xffe6: + case 0xffe7: + case 0xffe8: + case 0xffe9: + case 0xffea: + case 0xffeb: + case 0xffec: + case 0xffed: + case 0xffee: + case 0xffef: + offset += readUint16(data+offset+2)+2; + break; + case 0xfff0: // JPGn + case 0xfff1: + case 0xfff2: + case 0xfff3: + case 0xfff4: + case 0xfff5: + case 0xfff6: + case 0xfff7: + case 0xfff8: + case 0xfff9: + case 0xfffa: + case 0xfffb: + case 0xfffc: + case 0xfffd: + offset += readUint16(data+offset+2)+2; + break; + case 0xfffe: // COM + offset += readUint16(data+offset+2)+2; + break; + case 0xffff: // fill byte 0xff (skip one byte only) + offset += 1; + break; + case 0xff01: // TEM + break; + default: + if ((data[offset]==0xff) && (data[offset+1]>2) && (data[offset+1] <= 0xbf)) // RES reserved markers + { + offset += 2; + } + else + { + DCMJPEG_ERROR("found invalid marker in JPEG stream while scanning for bit depth: 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') + << STD_NAMESPACE setw(2) << OFstatic_cast(int, data[offset]) + << STD_NAMESPACE setw(2) << OFstatic_cast(int, data[offset+1]) + << STD_NAMESPACE dec << STD_NAMESPACE setfill(' ')); + return 0; // syntax error, stop parsing + } + break; + } + } // while + return 0; // no SOF marker found +} + + +OFCondition DJCodecDecoder::createPlanarConfigurationByte( + Uint8 *imageFrame, + Uint16 columns, + Uint16 rows) +{ + if (imageFrame == NULL) return EC_IllegalCall; + + size_t numPixels = columns * rows; + if (numPixels == 0) return EC_IllegalCall; + + Uint8 *buf = new Uint8[3*numPixels + 3]; + if (buf) + { + memcpy(buf, imageFrame, 3*numPixels); + Uint8 *s = buf; // source + Uint8 *r = imageFrame; // red plane + Uint8 *g = imageFrame + numPixels; // green plane + Uint8 *b = imageFrame + (2*numPixels); // blue plane + for (size_t i=numPixels; i; i--) + { + *r++ = *s++; + *g++ = *s++; + *b++ = *s++; + } + delete[] buf; + } else return EC_MemoryExhausted; + return EC_Normal; +} + +OFCondition DJCodecDecoder::createPlanarConfigurationWord( + Uint16 *imageFrame, + Uint16 columns, + Uint16 rows) +{ + if (imageFrame == NULL) return EC_IllegalCall; + + size_t numPixels = columns * rows; + if (numPixels == 0) return EC_IllegalCall; + + Uint16 *buf = new Uint16[3*numPixels + 3]; + if (buf) + { + memcpy(buf, imageFrame, 3*numPixels*sizeof(Uint16)); + Uint16 *s = buf; // source + Uint16 *r = imageFrame; // red plane + Uint16 *g = imageFrame + numPixels; // green plane + Uint16 *b = imageFrame + (2*numPixels); // blue plane + for (size_t i=numPixels; i; i--) + { + *r++ = *s++; + *g++ = *s++; + *b++ = *s++; + } + delete[] buf; + } else return EC_MemoryExhausted; + return EC_Normal; +} + +/* This method examines if a given image requires color-by-plane planar configuration + * depending on SOP Class UID (DICOM IOD) and photometric interpretation. + * All SOP classes defined in the 2001 edition of the DICOM standard or earlier + * are handled correctly. + */ + +OFBool DJCodecDecoder::requiresPlanarConfiguration( + const char *sopClassUID, + EP_Interpretation photometricInterpretation) +{ + if (sopClassUID) + { + OFString sopClass(sopClassUID); + + // Hardcopy Color Image always requires color-by-plane + if (sopClass == UID_RETIRED_HardcopyColorImageStorage) return OFTrue; + + // The 1996 Ultrasound Image IODs require color-by-plane if color model is YBR_FULL. + if (photometricInterpretation == EPI_YBR_Full) + { + if ((sopClass == UID_UltrasoundMultiframeImageStorage) + ||(sopClass == UID_UltrasoundImageStorage)) return OFTrue; + } + + } + return OFFalse; +} diff --git a/dcmjpeg/libsrc/djcodece.cc b/dcmjpeg/libsrc/djcodece.cc new file mode 100644 index 00000000..f61d9531 --- /dev/null +++ b/dcmjpeg/libsrc/djcodece.cc @@ -0,0 +1,1541 @@ +/* + * + * Copyright (C) 2001-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: abstract codec class for JPEG encoders. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcodece.h" + +// ofstd includes +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofstd.h" + +// dcmdata includes +#include "dcmtk/dcmdata/dcdatset.h" /* for class DcmDataset */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcovlay.h" /* for class DcmOverlayData */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for class DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmGenerateUniqueIdentifer()*/ +#include "dcmtk/dcmdata/dcvrcs.h" /* for class DcmCodeString */ +#include "dcmtk/dcmdata/dcvrds.h" /* for class DcmDecimalString */ +#include "dcmtk/dcmdata/dcvrlt.h" /* for class DcmLongText */ +#include "dcmtk/dcmdata/dcvrst.h" /* for class DcmShortText */ +#include "dcmtk/dcmdata/dcvrus.h" /* for class DcmUnsignedShort */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary */ + +// dcmjpeg includes +#include "dcmtk/dcmjpeg/djcparam.h" /* for class DJCodecParameter */ +#include "dcmtk/dcmjpeg/djencabs.h" /* for class DJEncoder */ + +// dcmimgle includes +#include "dcmtk/dcmimgle/dcmimage.h" /* for class DicomImage */ + +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + + +DJCodecEncoder::DJCodecEncoder() +: DcmCodec() +{ +} + + +DJCodecEncoder::~DJCodecEncoder() +{ +} + + +OFBool DJCodecEncoder::canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const +{ + E_TransferSyntax myXfer = supportedTransferSyntax(); + DcmXfer newRep(newRepType); + DcmXfer oldRep(oldRepType); + if (oldRep.isNotEncapsulated() && (newRepType == myXfer)) return OFTrue; // compress requested + + // we don't support re-coding for now + return OFFalse; +} + + +OFCondition DJCodecEncoder::decode( + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* pixSeq */, + DcmPolymorphOBOW& /* uncompressedPixelData */, + const DcmCodecParameter * /* cp */, + const DcmStack& /* objStack */) const +{ + // we are an encoder only + return EC_IllegalCall; +} + + +OFCondition DJCodecEncoder::decodeFrame( + const DcmRepresentationParameter * /* fromParam */ , + DcmPixelSequence * /* fromPixSeq */ , + const DcmCodecParameter * /* cp */ , + DcmItem * /* dataset */ , + Uint32 /* frameNo */ , + Uint32& /* startFragment */ , + void * /* buffer */ , + Uint32 /* bufSize */ , + OFString& /* decompressedColorModel */ ) const +{ + // we are an encoder only + return EC_IllegalCall; +} + + +OFCondition DJCodecEncoder::encode( + const E_TransferSyntax /* fromRepType */, + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* toPixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we don't support re-coding for now + return EC_IllegalCall; +} + + +OFCondition DJCodecEncoder::encode( + const Uint16 * /* pixelData */, + const Uint32 /* length */, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const +{ + OFCondition result = EC_Normal; + // assume we can cast the codec parameter to what we need + const DJCodecParameter *djcp = OFreinterpret_cast(const DJCodecParameter*, cp); + + // if true lossless mode is enabled, and we're supposed to do lossless compression, + // call the "true lossless encoding"-engine + if (isLosslessProcess() && (djcp->getTrueLosslessMode())) + return encodeTrueLossless(toRepParam, pixSeq, cp, objStack); + + DcmStack localStack(objStack); + (void)localStack.pop(); // pop pixel data element from stack + DcmObject *dataset = localStack.pop(); // this is the item in which the pixel data is located + + if ((!dataset)||((dataset->ident()!= EVR_dataset) && (dataset->ident()!= EVR_item))) result = EC_InvalidTag; + else + { + double compressionRatio = 0.0; + EP_Interpretation photometricInterpretation = DcmJpegHelper::getPhotometricInterpretation(OFreinterpret_cast(DcmItem*, dataset)); + switch (photometricInterpretation) + { + case EPI_Monochrome1: + case EPI_Monochrome2: + // monochrome image + result = encodeMonochromeImage(OFreinterpret_cast(DcmItem*, dataset), toRepParam, pixSeq, djcp, compressionRatio); + break; + case EPI_PaletteColor: + case EPI_RGB: + case EPI_HSV: + case EPI_ARGB: + case EPI_CMYK: + case EPI_YBR_Partial_422: + // color image except YCbCr which receives special treatment + result = encodeColorImage(OFFalse, OFreinterpret_cast(DcmItem*, dataset), toRepParam, pixSeq, djcp, compressionRatio); + break; + case EPI_YBR_Full: + case EPI_YBR_Full_422: + // YCbCr color image + result = encodeColorImage(OFTrue, OFreinterpret_cast(DcmItem*, dataset), toRepParam, pixSeq, djcp, compressionRatio); + break; + case EPI_Unknown: + // unknown color model - bail out + result = EJ_UnsupportedPhotometricInterpretation; + break; + case EPI_Missing: + // photometric interpretation missing. If ACR-NEMA compatibility is activated, we treat this as MONOCHOME2, otherwise we report an error + if (djcp->getAcrNemaCompatibility()) + result = encodeMonochromeImage(OFreinterpret_cast(DcmItem*, dataset), toRepParam, pixSeq, djcp, compressionRatio); + else result = EJ_UnsupportedPhotometricInterpretation; + break; + } + + // the following operations do not affect the Image Pixel Module + // but other modules such as SOP Common. We only perform these + // changes if we're on the main level of the dataset, + // which should always identify itself as dataset, not as item. + if (dataset->ident() == EVR_dataset) + { + + // update image type + if (result.good()) result = DcmCodec::updateImageType(OFreinterpret_cast(DcmItem*, dataset)); + + // determine compressed bit depth passed to JPEG codec + Uint16 compressedBits = OFstatic_cast(Uint16, djcp->getForcedBitDepth()); + if (result.good()) + { + if (compressedBits == 0) + { + result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_BitsStored, compressedBits); + } + } + + // update derivation description + if (result.good()) result = updateDerivationDescription(OFreinterpret_cast(DcmItem*, dataset), toRepParam, + djcp, OFstatic_cast(Uint8, compressedBits), compressionRatio); + + if (result.good()) + { + // lossy process - create new UID unless mode is EUC_never and we're not converting to Secondary Capture + // (pseudo-lossless mode may also result in lossy compression, so treat it the same way) + if (djcp->getConvertToSC() || (djcp->getUIDCreation() != EUC_never)) + result = DcmCodec::newInstance(OFreinterpret_cast(DcmItem*, dataset), "DCM", "121320", "Uncompressed predecessor"); + + // update lossy compression ratio + if (result.good()) result = updateLossyCompressionRatio(OFreinterpret_cast(DcmItem*, dataset), compressionRatio); + } + + // convert to Secondary Capture if requested by user. + // This method creates a new SOP class UID, so it should be executed + // after the call to newInstance() which creates a Source Image Sequence. + if (result.good() && djcp->getConvertToSC()) result = DcmCodec::convertToSecondaryCapture(OFreinterpret_cast(DcmItem*, dataset)); + } + } + return result; +} + + +OFCondition DJCodecEncoder::determineDecompressedColorModel( + const DcmRepresentationParameter * /* fromParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmCodecParameter * /* cp */, + DcmItem * /* dataset */, + OFString & /* decompressedColorModel */) const +{ + return EC_IllegalCall; +} + + +OFCondition DJCodecEncoder::encodeColorImage( + OFBool YBRmode, + DcmItem *dataset, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DJCodecParameter *cp, + double& compressionRatio) const +{ + OFCondition result = EC_Normal; + DcmOffsetList offsetList; + DcmPixelSequence *pixelSequence = NULL; + DcmPixelItem *offsetTable = NULL; + unsigned short bitsPerSample = 0; + compressionRatio = 0.0; // initialize if something goes wrong + size_t compressedSize = 0; + double uncompressedSize = 0.0; + Uint16 compressedBits = OFstatic_cast(Uint16, cp->getForcedBitDepth()); + + // Check if image is continuous-tone, bail out otherwise. + // We check the value of BitsStored, which is not affected by any transformation such as MLUT. + Uint16 bitsStored = 0; + result = dataset->findAndGetUint16(DCM_BitsStored, bitsStored); + if (result.bad()) return result; + + if ((bitsStored > 16) && isLosslessProcess()) + { + DCMJPEG_WARN("Cannot lossless compress image with " << bitsStored << " bits/sample: JPEG supports max. 16 bits."); + return EJ_UnsupportedBitDepth; + } + + if (bitsStored < 2) + { + DCMJPEG_WARN("Cannot compress image with " << bitsStored << " bit/sample: JPEG requires at least 2 bits."); + return EJ_UnsupportedBitDepth; + } + + // initialize settings with defaults for RGB mode + OFBool monochromeMode = OFFalse; + unsigned long flags = 0; // flags for initialization of DicomImage + EP_Interpretation interpr = EPI_RGB; + Uint16 samplesPerPixel = 3; + const char *photometricInterpretation = "RGB"; + if ((cp->getCompressionColorSpaceConversion() == ECC_lossyYCbCr) && (!isLosslessProcess())) + { + if (cp->getWriteYBR422()) photometricInterpretation = "YBR_FULL_422"; + else photometricInterpretation = "YBR_FULL"; + } + + // check mode and adjust settings + if (cp->getCompressionColorSpaceConversion() == ECC_monochrome) + { + monochromeMode = OFTrue; + flags = 0; + interpr = EPI_Monochrome2; + samplesPerPixel = 1; + photometricInterpretation = "MONOCHROME2"; + } + else if (YBRmode) + { + monochromeMode = OFFalse; + flags = CIF_KeepYCbCrColorModel; // keep YCbCr color model + interpr = EPI_YBR_Full; + if (cp->getWriteYBR422()) photometricInterpretation = "YBR_FULL_422"; + else photometricInterpretation = "YBR_FULL"; + } + + // integrate DicomImage flags transported by DJCodecParameter into "flags"-variable + if (cp->getAcceptWrongPaletteTags()) + flags |= CIF_WrongPaletteAttributeTags; + if (cp->getAcrNemaCompatibility()) + flags |= CIF_AcrNemaCompatibility; + + // create dcmimage object. Will fail if dcmimage has not been activated in main(). + // transfer syntax can be any uncompressed one. + DicomImage *dimage = NULL; + if (monochromeMode) + { + DicomImage colorimage(dataset, EXS_LittleEndianImplicit, flags); // read all frames + if (colorimage.getStatus() == EIS_Normal) dimage = colorimage.createMonochromeImage(); + if (dimage) dimage->setNoVoiTransformation(); + } + else + { + dimage = new DicomImage(dataset, EXS_LittleEndianImplicit, flags); // read all frames + } + + if (dimage == NULL) result = EC_MemoryExhausted; + else if (dimage->getStatus() != EIS_Normal) + { + DCMJPEG_WARN("Color encoder: " << DicomImage::getString(dimage->getStatus())); + result = EC_IllegalCall; + } + + // don't render overlays + if (result.good()) + { + dimage->hideAllOverlays(); + } + + // create initial pixel sequence + if (result.good()) + { + pixelSequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSequence == NULL) result = EC_MemoryExhausted; + else + { + // create empty offset table + offsetTable = new DcmPixelItem(DCM_PixelItemTag); + if (offsetTable == NULL) result = EC_MemoryExhausted; + else pixelSequence->insert(offsetTable); + } + } + + // select bit depth + if (result.good()) + { + if (compressedBits == 0) + { + result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_BitsStored, compressedBits); + } + } + + // create codec instance + if (result.good()) + { + DJEncoder *jpeg = createEncoderInstance(toRepParam, cp, OFstatic_cast(Uint8, compressedBits)); + if (jpeg) + { + // render and compress each frame + bitsPerSample = jpeg->bitsPerSample(); + size_t frameCount = dimage->getFrameCount(); + unsigned short bytesPerSample = jpeg->bytesPerSample(); + unsigned short columns = OFstatic_cast(unsigned short, dimage->getWidth()); + unsigned short rows = OFstatic_cast(unsigned short, dimage->getHeight()); + Uint8 *jpegData = NULL; + Uint32 jpegLen = 0; + const void *frame = NULL; + + // compute original image size in bytes, ignoring any padding bits. + uncompressedSize = OFstatic_cast(double, columns * rows * dimage->getDepth() * frameCount * samplesPerPixel) / 8.0; + for (unsigned long i=0; (igetOutputData(bitsPerSample, i, 0); + if (frame == NULL) result = EC_MemoryExhausted; + else + { + // compress frame + jpegData = NULL; + if (bytesPerSample == 1) + { + result = jpeg->encode(columns, rows, interpr, samplesPerPixel, OFreinterpret_cast(Uint8*, OFconst_cast(void*, frame)), jpegData, jpegLen); + } else { + result = jpeg->encode(columns, rows, interpr, samplesPerPixel, OFreinterpret_cast(Uint16*, OFconst_cast(void*, frame)), jpegData, jpegLen); + } + + // store frame + if (result.good()) + { + result = pixelSequence->storeCompressedFrame(offsetList, jpegData, jpegLen, cp->getFragmentSize()); + } + + // delete block of JPEG data + delete[] jpegData; + compressedSize += jpegLen; + } + } + delete jpeg; + } else result = EC_MemoryExhausted; + } + + // store pixel sequence if everything was successful + if (result.good()) pixSeq = pixelSequence; + else + { + delete pixelSequence; + pixSeq = NULL; + } + + if ((result.good()) && (cp->getCreateOffsetTable())) + { + // create offset table + result = offsetTable->createOffsetTable(offsetList); + } + + if (result.good()) + { + // adapt attributes in image pixel module + if (result.good()) result = dataset->putAndInsertUint16(DCM_SamplesPerPixel, samplesPerPixel); + if (result.good()) result = dataset->putAndInsertString(DCM_PhotometricInterpretation, photometricInterpretation); + if (result.good()) + { + if (bitsPerSample > 8) + result = dataset->putAndInsertUint16(DCM_BitsAllocated, 16); + else + result = dataset->putAndInsertUint16(DCM_BitsAllocated, 8); + } + if (result.good()) result = dataset->putAndInsertUint16(DCM_BitsStored, bitsPerSample); + if (result.good()) result = dataset->putAndInsertUint16(DCM_HighBit, OFstatic_cast(Uint16, bitsPerSample-1)); + if (result.good()) result = dataset->putAndInsertUint16(DCM_PixelRepresentation, 0); + if (result.good()) + { + if (monochromeMode) delete dataset->remove(DCM_PlanarConfiguration); + else result = dataset->putAndInsertUint16(DCM_PlanarConfiguration, 0); + } + delete dataset->remove(DCM_SmallestImagePixelValue); + delete dataset->remove(DCM_LargestImagePixelValue); + delete dataset->remove(DCM_RedPaletteColorLookupTableDescriptor); + delete dataset->remove(DCM_GreenPaletteColorLookupTableDescriptor); + delete dataset->remove(DCM_BluePaletteColorLookupTableDescriptor); + delete dataset->remove(DCM_RedPaletteColorLookupTableData); + delete dataset->remove(DCM_GreenPaletteColorLookupTableData); + delete dataset->remove(DCM_BluePaletteColorLookupTableData); + delete dataset->remove(DCM_PixelPaddingValue); + delete dataset->remove(DCM_PixelPaddingRangeLimit); + delete dataset->remove(DCM_SmallestPixelValueInSeries); + delete dataset->remove(DCM_LargestPixelValueInSeries); + delete dataset->remove(DCM_PaletteColorLookupTableUID); + delete dataset->remove(DCM_SegmentedRedPaletteColorLookupTableData); + delete dataset->remove(DCM_SegmentedGreenPaletteColorLookupTableData); + delete dataset->remove(DCM_SegmentedBluePaletteColorLookupTableData); + } + if (compressedSize > 0) compressionRatio = OFstatic_cast(double, uncompressedSize) / OFstatic_cast(double, compressedSize); + + delete dimage; + return result; +} + + +OFCondition DJCodecEncoder::encodeTrueLossless( + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const +{ + OFCondition result = EC_Normal; + // assume we can cast the codec parameter to what we need + DJCodecParameter *djcp = OFreinterpret_cast(DJCodecParameter*, OFconst_cast(DcmCodecParameter*, cp)); + // get dataset from stack + DcmStack localStack(objStack); + (void)localStack.pop(); + DcmObject *dataset = localStack.pop(); + + // check whether dataset was on top of the stack + if ((!dataset)||((dataset->ident()!= EVR_dataset) && (dataset->ident()!= EVR_item))) + return EC_InvalidTag; + else + { + DcmItem *datsetItem = OFreinterpret_cast(DcmItem*, dataset); + double compressionRatio = 0.0; + const Uint16* pixelData; + size_t length = 0; + Uint16 bitsAllocated = 0; + Uint16 bitsStored = 0; + Uint16 bytesAllocated = 0; + Uint16 samplesPerPixel = 0; + Uint16 planarConfiguration = 0; + Uint16 columns = 0; + Uint16 rows = 0; + Sint32 numberOfFrames = 1; + EP_Interpretation interpr = EPI_Unknown; + Uint8 *jpegData = NULL; + Uint32 jpegLen = 0; + OFBool byteSwapped = OFFalse; // true if we have byte-swapped the original pixel data + OFBool planConfSwitched = OFFalse; // true if planar configuration was toggled + DcmOffsetList offsetList; + OFString photometricInterpretation; + DcmElement *dummyElem; + + // get relevant attributes for encoding from dataset + result = datsetItem->findAndGetUint16(DCM_BitsStored, bitsStored); + if (result.good()) result = datsetItem->findAndGetUint16(DCM_BitsAllocated, bitsAllocated); + if (result.good()) result = datsetItem->findAndGetUint16(DCM_SamplesPerPixel, samplesPerPixel); + if (result.good()) result = datsetItem->findAndGetUint16(DCM_Columns, columns); + if (result.good()) result = datsetItem->findAndGetUint16(DCM_Rows, rows); + if (result.good()) result = datsetItem->findAndGetOFString(DCM_PhotometricInterpretation, photometricInterpretation); + if (result.good()) result = datsetItem->findAndGetUint16Array(DCM_PixelData, pixelData, NULL, OFFalse); + if (result.good()) result = datsetItem->findAndGetElement(DCM_PixelData, dummyElem); + if (result.good()) length = dummyElem->getLength(); + if (result.good()) + { + result = datsetItem->findAndGetSint32(DCM_NumberOfFrames, numberOfFrames); + if (result.bad() || numberOfFrames < 1) numberOfFrames = 1; + result = EC_Normal; + } + if (result.bad()) + { + DCMJPEG_ERROR("True lossless encoder: Unable to get relevant attributes from dataset"); + return result; + } + + // check, whether bit depth is supported + if (bitsAllocated == 8) + bytesAllocated = 1; + else if (bitsAllocated == 16) + bytesAllocated = 2; + else + { + DCMJPEG_ERROR("True lossless encoder: Only 8 or 16 bits allocated supported"); + return EC_IllegalParameter; + } + + // make sure that all the descriptive attributes have sensible values + if ((columns < 1)||(rows < 1)||(samplesPerPixel < 1)) + { + DCMJPEG_ERROR("True lossless encoder: Invalid attribute values in pixel module"); + return EC_CannotChangeRepresentation; + } + + /* Set and check photometric interpretation (up to now: EPI_RGB) + * Only photometric interpretations, that are explicitly "supported" by the + * IJG lib are set. For all others "unknown" is set. Some are even rejected here. + */ + if (photometricInterpretation == "MONOCHROME1") + interpr = EPI_Monochrome1; + else if (photometricInterpretation == "MONOCHROME2") + interpr = EPI_Monochrome2; + else if (photometricInterpretation == "YBR_FULL") + interpr = EPI_YBR_Full; + // some photometric interpretations are not supported: + else if ( (photometricInterpretation == "YBR_FULL_422") || + (photometricInterpretation == "YBR_PARTIAL_422") || + (photometricInterpretation == "YBR_PARTIAL_420") || + (photometricInterpretation == "YBR_ICT") || + (photometricInterpretation == "YBR_RCT") ) + { + DCMJPEG_ERROR("True lossless encoder: Photometric interpretation not supported: " << photometricInterpretation); + return EC_IllegalParameter; + } + else // Palette, HSV, ARGB, CMYK + interpr = EPI_Unknown; + + // IJG libs need "color by pixel", transform if required + if (result.good() && (samplesPerPixel > 1) ) + { + result = datsetItem->findAndGetUint16(DCM_PlanarConfiguration, planarConfiguration); + if ( result.good() && (planarConfiguration == 1) ) + { + if (bytesAllocated == 1) + result = togglePlanarConfiguration8(OFreinterpret_cast(Uint8*, OFconst_cast(Uint16*, pixelData)), length, samplesPerPixel, OFstatic_cast(Uint16, 1) /* switch to "by pixel"*/); + else + result = togglePlanarConfiguration16(OFconst_cast(Uint16*, pixelData), length/2 /*16 bit*/, samplesPerPixel, OFstatic_cast(Uint16, 1) /* switch to "by pixel"*/); + planConfSwitched = OFTrue; + } + } + if (result.bad()) + { + DCMJPEG_ERROR("True lossless encoder: Unable to change Planar Configuration from 'by plane' to 'by pixel' for encoding"); + return result; + } + + // check whether enough raw data is available for encoding + if (bytesAllocated * samplesPerPixel * columns * rows * OFstatic_cast(size_t,numberOfFrames) > length) + { + DCMJPEG_ERROR("True lossless encoder: Cannot change representation, not enough data"); + return EC_CannotChangeRepresentation; + } + + // byte swap pixel data to little endian if bits allocated is 8 + if ((gLocalByteOrder == EBO_BigEndian) && (bitsAllocated == 8)) + { + result = swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, OFconst_cast(Uint16*, pixelData), OFstatic_cast(Uint32, length), sizeof(Uint16)); + if ( result.bad() ) + { + DCMJPEG_ERROR("True lossless encoder: Unable to swap bytes to respect local byte ordering"); + return EC_CannotChangeRepresentation; + } + byteSwapped = OFTrue; + } + + // create initial pixel sequence with empty offset table + DcmPixelSequence *pixelSequence = NULL; + DcmPixelItem *offsetTable = NULL; + if (result.good()) + { + pixelSequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSequence == NULL) result = EC_MemoryExhausted; + else + { + // create empty offset table + offsetTable = new DcmPixelItem(DCM_PixelItemTag); + if (offsetTable == NULL) result = EC_MemoryExhausted; + else pixelSequence->insert(offsetTable); + } + } + + // prepare some variables for encoding + size_t frameCount = OFstatic_cast(size_t, numberOfFrames); + size_t frameSize = columns * rows * samplesPerPixel * bytesAllocated; + const Uint8 *framePointer = OFreinterpret_cast(const Uint8 *, pixelData); + size_t compressedSize = 0; + + // create encoder corresponding to bit depth (8 or 16 bit) + DJEncoder *jpeg = createEncoderInstance(toRepParam, djcp, OFstatic_cast(Uint8, bitsAllocated)); + if (jpeg) + { + // main loop for compression: compress each frame + for (unsigned int i=0; iencode(columns, rows, interpr, samplesPerPixel, OFconst_cast(Uint8*, framePointer), jpegData, jpegLen); + } + else if (bitsAllocated == 16) + { + jpeg->encode(columns, rows, interpr, samplesPerPixel, OFreinterpret_cast(Uint16*, OFconst_cast(Uint8*, framePointer)), jpegData, jpegLen); + } + // update variables + compressedSize+=jpegLen; + framePointer+=frameSize; + if (jpegLen == 0) + { + DCMJPEG_ERROR("True lossless encoder: Error encoding frame"); + result = EC_CannotChangeRepresentation; + } + else + { + result = pixelSequence->storeCompressedFrame(offsetList, jpegData, jpegLen, djcp->getFragmentSize()); + } + // free memory + delete[] jpegData; + } + } + else + { + DCMJPEG_ERROR("True lossless encoder: Cannot allocate encoder instance"); + result = EC_IllegalCall; + } + if (result.good()) + { + compressionRatio = OFstatic_cast(double, bytesAllocated * samplesPerPixel * columns * rows * numberOfFrames) / OFstatic_cast(double, compressedSize); + pixSeq = pixelSequence; + } + else + delete pixelSequence; + delete jpeg; // encoder no longer in use + + if ((result.good()) && (djcp->getCreateOffsetTable())) + { + // create offset table + result = offsetTable->createOffsetTable(offsetList); + } + + // the following operations do not affect the Image Pixel Module + // but other modules such as SOP Common. We only perform these + // changes if we're on the main level of the datsetItem, + // which should always identify itself as datsetItem, not as item. + + // update derivation description reflecting the JPEG compression applied + result = updateDerivationDescription(datsetItem, toRepParam, djcp, OFstatic_cast(Uint8, bitsAllocated), compressionRatio); + + if ( (datsetItem->ident() == EVR_dataset) && result.good() ) + { + // convert to Secondary Capture if requested by user. + // This method creates a new SOP class UID, so it should be executed + // after the call to newInstance() which creates a Source Image Sequence. + if ( djcp->getConvertToSC() || (djcp->getUIDCreation() == EUC_always) ) + { + if (djcp->getConvertToSC()) + { + result = DcmCodec::convertToSecondaryCapture(datsetItem); + } + // update image type (set to DERIVED) + if (result.good()) + result = DcmCodec::updateImageType(datsetItem); + if (result.good()) + result = DcmCodec::newInstance(OFreinterpret_cast(DcmItem*, datsetItem), "DCM", "121320", "Uncompressed predecessor"); + } + } + // switch _original_ pixel data back to "color by plane", if required + if (planConfSwitched) + { + if (bytesAllocated == 1) + result = togglePlanarConfiguration8(OFreinterpret_cast(Uint8*, OFconst_cast(Uint16*, pixelData)), length, samplesPerPixel, OFstatic_cast(Uint16, 0) /*switch to "by plane"*/); + else + result = togglePlanarConfiguration16(OFconst_cast(Uint16*, pixelData), length/2, samplesPerPixel, OFstatic_cast(Uint16, 0) /*switch to "by plane"*/); + if (result.good()) + { + // update Planar Configuration in dataset + result = updatePlanarConfiguration(datsetItem, 0 /* update to "by pixel" */); + } + else + { + DCMJPEG_ERROR("True lossless encoder: Cannot switch back to original planar configuration of the pixel data"); + result = EC_CannotChangeRepresentation; + } + } + // byte swap pixel data back to local endian if necessary + if (byteSwapped) + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, OFconst_cast(Uint16*, pixelData), OFstatic_cast(Uint32, length), sizeof(Uint16)); + } + return result; +} + + +void DJCodecEncoder::appendCompressionRatio( + OFString& arg, + double ratio) +{ + char buf[64]; + OFStandard::ftoa(buf, sizeof(buf), ratio, OFStandard::ftoa_uppercase, 0, 5); + arg += buf; +} + + +OFCondition DJCodecEncoder::updateLossyCompressionRatio( + DcmItem *dataset, + double ratio) const +{ + if (dataset == NULL) return EC_IllegalCall; + + // set Lossy Image Compression to "01" (see DICOM part 3, C.7.6.1.1.5) + OFCondition result = dataset->putAndInsertString(DCM_LossyImageCompression, "01"); + if (result.bad()) return result; + + // set Lossy Image Compression Ratio + OFString s; + const char *oldRatio = NULL; + if ((dataset->findAndGetString(DCM_LossyImageCompressionRatio, oldRatio)).good() && oldRatio) + { + s = oldRatio; + s += "\\"; + } + appendCompressionRatio(s, ratio); + + result = dataset->putAndInsertString(DCM_LossyImageCompressionRatio, s.c_str()); + if (result.bad()) return result; + + // count VM of lossy image compression ratio + size_t i; + size_t s_vm = 0; + size_t s_sz = s.size(); + for (i = 0; i < s_sz; ++i) + if (s[i] == '\\') ++s_vm; + + // set Lossy Image Compression Method + const char *oldMethod = NULL; + OFString m; + if ((dataset->findAndGetString(DCM_LossyImageCompressionMethod, oldMethod)).good() && oldMethod) + { + m = oldMethod; + m += "\\"; + } + + // count VM of lossy image compression method + size_t m_vm = 0; + size_t m_sz = m.size(); + for (i = 0; i < m_sz; ++i) + if (m[i] == '\\') ++m_vm; + + // make sure that VM of Compression Method is not smaller than VM of Compression Ratio + while (m_vm++ < s_vm) m += "\\"; + + m += "ISO_10918_1"; + return dataset->putAndInsertString(DCM_LossyImageCompressionMethod, m.c_str()); +} + + +OFCondition DJCodecEncoder::updateDerivationDescription( + DcmItem *dataset, + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + double ratio) const +{ + OFString derivationDescription; + + // create new Derivation Description + createDerivationDescription(toRepParam, cp, bitsPerSample, ratio, derivationDescription); + + // append old Derivation Description, if any + const char *oldDerivation = NULL; + if ((dataset->findAndGetString(DCM_DerivationDescription, oldDerivation)).good() && oldDerivation) + { + derivationDescription += " ["; + derivationDescription += oldDerivation; + derivationDescription += "]"; + if (derivationDescription.length() > 1024) + { + // ST is limited to 1024 characters, cut off tail + derivationDescription.erase(1020); + derivationDescription += "...]"; + } + } + + OFCondition result = dataset->putAndInsertString(DCM_DerivationDescription, derivationDescription.c_str()); + if (result.good()) + { + // assume we can cast the codec parameter to what we need + DJCodecParameter *djcp = OFconst_cast(DJCodecParameter*, cp); + + if (djcp->getTrueLosslessMode()) + result = DcmCodec::insertCodeSequence(dataset, DCM_DerivationCodeSequence, "DCM", "121327", "Full fidelity image"); + else // pseudo-lossless mode may also result in lossy compression + result = DcmCodec::insertCodeSequence(dataset, DCM_DerivationCodeSequence, "DCM", "113040", "Lossy Compression"); + } + return result; +} + + +OFCondition DJCodecEncoder::adjustOverlays( + DcmItem *dataset, + DicomImage& image) const +{ + if (dataset == NULL) return EC_IllegalCall; + + unsigned int overlayCount = image.getOverlayCount(); + if (overlayCount > 0) + { + Uint16 group = 0; + DcmStack stack; + size_t bytesAllocated = 0; + Uint8 *buffer = NULL; + unsigned int width = 0; + unsigned int height = 0; + long unsigned int frames = 0; + DcmElement *elem = NULL; + OFCondition result = EC_Normal; + + // adjust overlays (prior to grayscale compression) + for (unsigned int i=0; i < overlayCount; i++) + { + // check if current overlay is embedded in pixel data + group = OFstatic_cast(Uint16, image.getOverlayGroupNumber(i)); + stack.clear(); + if ((dataset->search(DcmTagKey(group, 0x3000), stack, ESM_fromHere, OFFalse)).bad()) + { + // separate Overlay Data not found. Assume overlay is embedded. + bytesAllocated = image.create6xxx3000OverlayData(buffer, i, width, height, frames); + if (bytesAllocated > 0) + { + elem = new DcmOverlayData(DcmTagKey(group, 0x3000)); // DCM_OverlayData + if (elem) + { + result = elem->putUint8Array(buffer, OFstatic_cast(Uint32, bytesAllocated)); + delete[] buffer; + if (result.good()) + { + dataset->insert(elem, OFTrue /*replaceOld*/); + // DCM_OverlayBitsAllocated + result = dataset->putAndInsertUint16(DcmTagKey(group, 0x0100), 1); + // DCM_OverlayBitPosition + if (result.good()) result = dataset->putAndInsertUint16(DcmTagKey(group, 0x0102), 0); + } + else + { + delete elem; + return result; + } + } + else + { + delete[] buffer; + return EC_MemoryExhausted; + } + } + else return EC_IllegalCall; + } + } + } + return EC_Normal; +} + + +OFCondition DJCodecEncoder::encodeMonochromeImage( + DcmItem *dataset, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DJCodecParameter *cp, + double& compressionRatio) const +{ + OFCondition result = EC_Normal; + DcmOffsetList offsetList; + DcmPixelSequence *pixelSequence = NULL; + DcmPixelItem *offsetTable = NULL; + unsigned short bitsPerSample = 0; + compressionRatio = 0.0; // initialize if something goes wrong + size_t compressedSize = 0; + double uncompressedSize = 0.0; + unsigned long flags = 0; // flags for initialization of DicomImage + + // variables needed if VOI mode is 0 + double minRange = 0.0; + double maxRange = 0.0; + double minUsed = 0.0; + double maxUsed = 0.0; + double rescaleSlope = 1.0; + double rescaleIntercept = 0.0; + double voiFactor = 1.0; + double voiOffset = 0.0; + double windowCenter = 0.0; + double windowWidth = 0.0; + OFBool deleteVOILUT = OFFalse; + OFBool mode_XA = OFFalse; // true if the current SOP class uses the X-Ray Image Module + OFBool mode_CT = OFFalse; // true if the current SOP class uses the CT Image Module + + // Modes of operation (if VOI mode is 0) + OFBool mode_usePixelValues = cp->getUsePixelValues(); + OFBool mode_useModalityRescale = cp->getUseModalityRescale(); + + //create flags for DicomImage corresponding to DJCodecParameter options + if (cp->getAcceptWrongPaletteTags()) + flags |= CIF_WrongPaletteAttributeTags; + if (cp->getAcrNemaCompatibility()) + flags |= CIF_AcrNemaCompatibility; + + // Check if image is continuous-tone, bail out otherwise. + // We check the value of BitsStored, which is not affected by any transformation such as MLUT. + Uint16 bitsStored = 0; + result = dataset->findAndGetUint16(DCM_BitsStored, bitsStored); + if (result.bad()) return result; + + if ((bitsStored > 16) && isLosslessProcess()) + { + DCMJPEG_WARN("Cannot lossless compress image with " << bitsStored << " bits/sample: JPEG supports max. 16 bits."); + return EJ_UnsupportedBitDepth; + } + + if (bitsStored < 2) + { + DCMJPEG_WARN("Cannot compress image with " << bitsStored << " bit/sample: JPEG requires at least 2 bits."); + return EJ_UnsupportedBitDepth; + } + + // create DicomImage object. Will fail if dcmimage has not been activated in main(). + // transfer syntax can be any uncompressed one. + DicomImage dimage(dataset, EXS_LittleEndianImplicit, flags); // read all frames + if (dimage.getStatus() != EIS_Normal) + { + DCMJPEG_WARN("Monochrome encoder: " << DicomImage::getString(dimage.getStatus())); + result = EC_IllegalCall; + } + + // don't render overlays + dimage.hideAllOverlays(); + + // actual pixel depth of source image which can be different from Bits Stored + // e. g. when Modality LUT (if enabled) shifts pixel values to a smaller + // range or if the pixel values itself do not make use of the "Bits Stored" + // full range available. + int pixelDepth = dimage.getDepth(); + + // create overlay data for embedded overlays + if (result.good()) result = adjustOverlays(dataset, dimage); + + // VOI transformations should only be applied on the dataset level, not + // in nested items such as the Icon Image Sequence where we don't expect + // a VOI window or LUT to be present + size_t windowType = 0; + if (dataset->ident() == EVR_dataset) + { + windowType = cp->getWindowType(); + } + + // set VOI transformation + if (result.good()) + { + switch (windowType) + { + case 0: // no VOI transformation + { + // disable correction of polarity or any other presentation LUT transformation + dimage.setPresentationLutShape(ESP_Identity); + + // disable VOI transformation + dimage.setNoVoiTransformation(); + + // look up SOP Class UID, if any + const char *classUID = NULL; + dataset->findAndGetString(DCM_SOPClassUID, classUID); + + // SOP Class specifics. + if (classUID && ! cp->getConvertToSC()) + { + // these three SOP classes use the X-Ray Image Module in which the meaning + // of the Modality LUT transformation is "inversed" and, therefore, + // needs special handling. This is not an issue if we're converting to + // secondary capture anyway. + if ((0 == strcmp(classUID, UID_XRayAngiographicImageStorage)) || + (0 == strcmp(classUID, UID_XRayRadiofluoroscopicImageStorage)) || + (0 == strcmp(classUID, UID_RETIRED_XRayAngiographicBiPlaneImageStorage))) + { + mode_XA = OFTrue; + mode_useModalityRescale = OFFalse; // inverse definition of Modality LUT Module + } + + // CT is also a special case because the Modality LUT is required here + // to convert to Hounsfield units. Again, this is not an issue if we're + // converting to SC anyway. + if (0 == strcmp(classUID, UID_CTImageStorage)) + { + mode_CT = OFTrue; + mode_useModalityRescale = OFTrue; // required for Hounsfield units + } + } + + // query image range and extreme values + if (result.good()) + { + // technically possible min/max values + if (! dimage.getMinMaxValues(minRange, maxRange, 1)) result = EC_IllegalCall; + if (maxRange <= minRange) result = EC_IllegalCall; + } + + if (result.good()) + { + // actually present min/max values in pixel data + if (! dimage.getMinMaxValues(minUsed, maxUsed, 0)) result = EC_IllegalCall; + if (maxUsed < minUsed) result = EC_IllegalCall; + } + } + break; + case 1: // use the n-th VOI window from the image file + { + size_t windowParameter = cp->getWindowParameter(); + if ((windowParameter < 1) || (windowParameter > dimage.getWindowCount())) result = EC_IllegalCall; + if (!dimage.setWindow(OFstatic_cast(unsigned long, windowParameter - 1))) result = EC_IllegalCall; + } + break; + case 2: // use the n-th VOI look up table from the image file + { + size_t windowParameter = cp->getWindowParameter(); + if ((windowParameter < 1) || (windowParameter > dimage.getVoiLutCount())) result = EC_IllegalCall; + if (!dimage.setVoiLut(OFstatic_cast(unsigned long, windowParameter - 1))) result = EC_IllegalCall; + } + break; + case 3: // Compute VOI window using min-max algorithm + if (!dimage.setMinMaxWindow(0)) result = EC_IllegalCall; + break; + case 4: // Compute VOI window using Histogram algorithm, ignoring n percent + { + size_t windowParameter = cp->getWindowParameter(); + if (!dimage.setHistogramWindow(OFstatic_cast(double, windowParameter)/100.0)) result = EC_IllegalCall; + } + break; + case 5: // Compute VOI window using center r and width s + { + double winCenter=0.0, winWidth=0.0; + cp->getVOIWindow(winCenter, winWidth); + if (!dimage.setWindow(winCenter, winWidth)) result = EC_IllegalCall; + } + break; + case 6: // Compute VOI window using min-max algorithm ignoring extremes + if (!dimage.setMinMaxWindow(1)) result = EC_IllegalCall; + break; + case 7: // Compute region of interest VOI window + { + size_t left_pos=0, top_pos=0, width=0, height=0; + cp->getROI(left_pos, top_pos, width, height); + if (!dimage.setRoiWindow(OFstatic_cast(unsigned long, left_pos), OFstatic_cast(unsigned long, top_pos), + OFstatic_cast(unsigned long, width), OFstatic_cast(unsigned long, height))) result = EC_IllegalCall; + } + break; + default: // includes case 0, which must not occur here + result = EC_IllegalCall; + break; + } + } + + // create initial pixel sequence + if (result.good()) + { + pixelSequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSequence == NULL) result = EC_MemoryExhausted; + else + { + // create empty offset table + offsetTable = new DcmPixelItem(DCM_PixelItemTag); + if (offsetTable == NULL) result = EC_MemoryExhausted; + else pixelSequence->insert(offsetTable); + } + } + + // select bit depth + Uint16 compressedBits = OFstatic_cast(Uint16, cp->getForcedBitDepth()); + if (result.good()) + { + if (compressedBits == 0) + { + result = OFreinterpret_cast(DcmItem*, dataset)->findAndGetUint16(DCM_BitsStored, compressedBits); + } + } + + // create codec instance + if (result.good()) + { + DJEncoder *jpeg = createEncoderInstance(toRepParam, cp, OFstatic_cast(Uint8, compressedBits)); + if (jpeg) + { + bitsPerSample = jpeg->bitsPerSample(); + + if (windowType == 0) + { + // perform image computations + if (mode_usePixelValues) + { + double z = minUsed; + if (z >= 0) z = floor(z); else z = ceil(z-1023.0); + double rangeUsed = maxUsed - minUsed + 1; // range that must be covered by window + + // compute optimum window width + if (pixelDepth < bitsPerSample) windowWidth = 1 << pixelDepth; + else windowWidth = 1 << bitsPerSample; + while (windowWidth < rangeUsed) windowWidth *= 2; + + windowCenter = windowWidth * 0.5; + if ((z + windowWidth) > maxUsed) windowCenter += z; else windowCenter += minUsed; + dimage.setWindow(windowCenter, windowWidth); + } + + // perform image computations + if (mode_useModalityRescale) + { + // Use Rescale Slope/Intercept to map the decompressed image data + // back to the original value range, keeping all VOI transformations valid. + if (mode_usePixelValues) + { + rescaleSlope = (windowWidth-1)/((1<bytesPerSample(); + unsigned short columns = OFstatic_cast(unsigned short, dimage.getWidth()); + unsigned short rows = OFstatic_cast(unsigned short, dimage.getHeight()); + Uint8 *jpegData = NULL; + Uint32 jpegLen = 0; + const void *frame = NULL; + + // compute original image size in bytes, ignoring any padding bits. + Uint16 samplesPerPixel = 0; + if ((dataset->findAndGetUint16(DCM_SamplesPerPixel, samplesPerPixel)).bad()) samplesPerPixel = 1; + uncompressedSize = OFstatic_cast(double, columns * rows * pixelDepth * frameCount * samplesPerPixel) / 8.0; + for (size_t i=0; (iencode(columns, rows, EPI_Monochrome2, 1, OFreinterpret_cast(Uint8*, OFconst_cast(void*, frame)), jpegData, jpegLen); + } else { + result = jpeg->encode(columns, rows, EPI_Monochrome2, 1, OFreinterpret_cast(Uint16*, OFconst_cast(void*, frame)), jpegData, jpegLen); + } + + // store frame + if (result.good()) + { + result = pixelSequence->storeCompressedFrame(offsetList, jpegData, jpegLen, cp->getFragmentSize()); + } + + // delete block of JPEG data + delete[] jpegData; + compressedSize += jpegLen; + } + } + delete jpeg; + } else result = EC_MemoryExhausted; + } + + // store pixel sequence if everything went well. + if (result.good()) pixSeq = pixelSequence; + else + { + delete pixelSequence; + pixSeq = NULL; + } + + if ((result.good()) && (cp->getCreateOffsetTable())) + { + // create offset table + result = offsetTable->createOffsetTable(offsetList); + } + + if (result.good()) + { + // adapt attributes in image pixel module + if (result.good()) result = dataset->putAndInsertUint16(DCM_SamplesPerPixel, 1); + if (result.good() && (windowType != 0)) result = dataset->putAndInsertString(DCM_PhotometricInterpretation, "MONOCHROME2"); + if (result.good()) + { + if (bitsPerSample > 8) + result = dataset->putAndInsertUint16(DCM_BitsAllocated, 16); + else + result = dataset->putAndInsertUint16(DCM_BitsAllocated, 8); + } + if (result.good()) result = dataset->putAndInsertUint16(DCM_BitsStored, bitsPerSample); + if (result.good()) result = dataset->putAndInsertUint16(DCM_HighBit, OFstatic_cast(Uint16, bitsPerSample-1)); + if (result.good()) result = dataset->putAndInsertUint16(DCM_PixelRepresentation, 0); + delete dataset->remove(DCM_PlanarConfiguration); + delete dataset->remove(DCM_SmallestImagePixelValue); + delete dataset->remove(DCM_LargestImagePixelValue); + delete dataset->remove(DCM_RedPaletteColorLookupTableDescriptor); + delete dataset->remove(DCM_GreenPaletteColorLookupTableDescriptor); + delete dataset->remove(DCM_BluePaletteColorLookupTableDescriptor); + delete dataset->remove(DCM_RedPaletteColorLookupTableData); + delete dataset->remove(DCM_GreenPaletteColorLookupTableData); + delete dataset->remove(DCM_BluePaletteColorLookupTableData); + delete dataset->remove(DCM_PixelPaddingValue); + delete dataset->remove(DCM_SmallestPixelValueInSeries); + delete dataset->remove(DCM_LargestPixelValueInSeries); + delete dataset->remove(DCM_PaletteColorLookupTableUID); + delete dataset->remove(DCM_SegmentedRedPaletteColorLookupTableData); + delete dataset->remove(DCM_SegmentedGreenPaletteColorLookupTableData); + delete dataset->remove(DCM_SegmentedBluePaletteColorLookupTableData); + + // check if either Modality LUT Sequence or Rescale Slope are present + DcmStack stack; + OFBool foundModalityLUT = OFFalse; + if ((dataset->search(DCM_ModalityLUTSequence, stack, ESM_fromHere, OFFalse)).good()) foundModalityLUT = OFTrue; + if (! foundModalityLUT) + { + stack.clear(); + if ((dataset->search(DCM_RescaleSlope, stack, ESM_fromHere, OFFalse)).good()) foundModalityLUT = OFTrue; + } + + // delete old Modality transformation + delete dataset->remove(DCM_ModalityLUTSequence); + delete dataset->remove(DCM_RescaleIntercept); + delete dataset->remove(DCM_RescaleSlope); + delete dataset->remove(DCM_RescaleType); + + // update Modality LUT Module and Pixel Intensity Relationship + if (windowType == 0) + { + if (mode_XA) // XA needs special handling + { + // XA Mode: set Pixel Intensity Relationship to "DISP", no Modality LUT + if (result.good()) result = dataset->putAndInsertString(DCM_PixelIntensityRelationship, "DISP"); + } + /* else if we had a modality LUT before, a LUT is inserted again. + or if specific rescale slope/intercept has been computed, use that in image + */ + else if (foundModalityLUT || rescaleSlope != 1.0 || rescaleIntercept != 0.0) + { + char buf[64]; + OFStandard::ftoa(buf, sizeof(buf), rescaleIntercept, OFStandard::ftoa_uppercase, 0, 6); + if (result.good()) result = dataset->putAndInsertString(DCM_RescaleIntercept, buf); + OFStandard::ftoa(buf, sizeof(buf), rescaleSlope, OFStandard::ftoa_uppercase, 0, 6); + if (result.good()) result = dataset->putAndInsertString(DCM_RescaleSlope, buf); + if (result.good()) + { + if (mode_CT) result = dataset->putAndInsertString(DCM_RescaleType, "HU"); // Hounsfield units + else result = dataset->putAndInsertString(DCM_RescaleType, "US"); // unspecified + } + } + } + else + { + // if we had found a Modality LUT Transformation, create a identity LUT transformation + if (foundModalityLUT) + { + if (result.good()) result = dataset->putAndInsertString(DCM_RescaleIntercept, "0"); + if (result.good()) result = dataset->putAndInsertString(DCM_RescaleSlope, "1"); + if (result.good()) result = dataset->putAndInsertString(DCM_RescaleType, "US"); // unspecified + } + + // Adjust Pixel Intensity Relationship (needed for XA). If present, set value to "DISP". + stack.clear(); + if ((dataset->search(DCM_PixelIntensityRelationship, stack, ESM_fromHere, OFFalse)).good()) + { + if (result.good()) result = dataset->putAndInsertString(DCM_PixelIntensityRelationship, "DISP"); + } + } + + // Adjust VOI LUT and Presentation LUT transformation + if (windowType == 0) + { + if (deleteVOILUT) delete dataset->remove(DCM_VOILUTSequence); + + // Adjust window center/width + if (result.good()) result = correctVOIWindows(dataset, voiOffset, voiFactor); + + // Don't modify Presentation LUT transformations (if any) + } + else + { + delete dataset->remove(DCM_VOILUTSequence); + delete dataset->remove(DCM_WindowCenter); + delete dataset->remove(DCM_WindowWidth); + delete dataset->remove(DCM_WindowCenterWidthExplanation); + + // Adjust Presentation LUT Transformation. + stack.clear(); + OFBool foundPresentationLUT = OFFalse; + if ((dataset->search(DCM_PresentationLUTSequence, stack, ESM_fromHere, OFFalse)).good()) foundPresentationLUT = OFTrue; + if (! foundPresentationLUT) + { + stack.clear(); + if ((dataset->search(DCM_PresentationLUTShape, stack, ESM_fromHere, OFFalse)).good()) foundPresentationLUT = OFTrue; + } + + // delete old Presentation LUT transformation + delete dataset->remove(DCM_PresentationLUTSequence); + delete dataset->remove(DCM_PresentationLUTShape); + + // if we had found a Presentation LUT Transformation, create a new identity transformation + if (foundPresentationLUT) + { + if (result.good()) result = dataset->putAndInsertString(DCM_PresentationLUTShape, "IDENTITY"); + } + } + } + + // determine compression ratio + if (compressedSize > 0) compressionRatio = OFstatic_cast(double, uncompressedSize) / OFstatic_cast(double, compressedSize); + return result; +} + + +OFCondition DJCodecEncoder::correctVOIWindows( + DcmItem *dataset, + double voiOffset, + double voiFactor) +{ + if (voiOffset == 0.0 && voiFactor == 1.0) return EC_Normal; + + OFCondition result = EC_Normal; + DcmElement *center = NULL; + DcmElement *width = NULL; + DcmElement *explanation = NULL; + + DcmStack stack; + if ((dataset->search(DCM_WindowCenter, stack, ESM_fromHere, OFFalse)).good()) + { + center = OFreinterpret_cast(DcmElement*, stack.top()); + } + stack.clear(); + if ((dataset->search(DCM_WindowWidth, stack, ESM_fromHere, OFFalse)).good()) + { + width = OFreinterpret_cast(DcmElement*, stack.top()); + } + stack.clear(); + if ((dataset->search(DCM_WindowCenterWidthExplanation, stack, ESM_fromHere, OFFalse)).good()) + { + explanation = OFreinterpret_cast(DcmElement*, stack.top()); + } + + OFString newCenter; + OFString newWidth; + OFString newExplanation; + Float64 currentCenter = 0.0; + Float64 currentWidth = 0.0; + OFString currentExplanation; + double tempCenter = 0.0; + double tempWidth = 0.0; + char buf[64]; + + if (center && width) + { + size_t numWindows = center->getVM(); + // iterate over all defined VOI windows + for (size_t i=0; igetFloat64(currentCenter,OFstatic_cast(Uint32, i))).good()) && ((width->getFloat64(currentWidth,OFstatic_cast(Uint32, i))).good())) + { + // found one pair of values, adapt them to value range shifted pixel data + tempCenter = (currentCenter+voiOffset)*voiFactor; + tempWidth = currentWidth * voiFactor; + // add this window to the attribute values that are later replacing old windows + OFStandard::ftoa(buf, sizeof(buf), tempCenter, OFStandard::ftoa_uppercase, 0, 6); + if (!newCenter.empty()) newCenter += "\\"; + newCenter += buf; + OFStandard::ftoa(buf, sizeof(buf), tempWidth, OFStandard::ftoa_uppercase, 0, 6); + if (!newWidth.empty()) newWidth += "\\"; + newWidth += buf; + + if (!newExplanation.empty()) newExplanation += "\\"; + if (explanation && ((explanation->getOFString(currentExplanation,OFstatic_cast(Uint32, i))).good())) + newExplanation += currentExplanation; + else + { + newExplanation += "center="; + OFStandard::ftoa(buf, sizeof(buf), tempCenter, OFStandard::ftoa_uppercase, 0, 6); + newExplanation += buf; + newExplanation += "/width="; + OFStandard::ftoa(buf, sizeof(buf), tempWidth, OFStandard::ftoa_uppercase, 0, 6); + newExplanation += buf; + } + } + } + } + + // remove old windows + delete dataset->remove(DCM_WindowCenter); + delete dataset->remove(DCM_WindowWidth); + delete dataset->remove(DCM_WindowCenterWidthExplanation); + + // and insert newly computed ones if necessary + if (!newCenter.empty()) + { + if (result.good()) result = dataset->putAndInsertString(DCM_WindowCenter, newCenter.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_WindowWidth, newWidth.c_str()); + if (result.good()) result = dataset->putAndInsertString(DCM_WindowCenterWidthExplanation, newExplanation.c_str()); + } + + return result; +} + + +OFCondition DJCodecEncoder::togglePlanarConfiguration8( + Uint8 *pixelData, + const size_t numValues, + const Uint16 samplesPerPixel, + const Uint16 oldPlanarConfig) +{ + if (pixelData == NULL) + return EC_IllegalParameter; + // allocate target buffer + Uint8* px8 = new Uint8[numValues]; + if (!px8) + return EC_MemoryExhausted; + size_t numPixels = numValues / samplesPerPixel; + if (oldPlanarConfig == 1) // change from "by plane" to "by pixel" + { + for (size_t n=0; n < numPixels; n++) + { + for (Uint16 s=0; s < samplesPerPixel; s++) + px8[n*samplesPerPixel+s] = pixelData[n+numPixels*s]; + } + } + else //change from "by pixel" to "by plane" + { + for (size_t n=0; n < numPixels; n++) + { + for (Uint16 s=0; s < samplesPerPixel; s++) + px8[n+numPixels*s] = pixelData[n*samplesPerPixel+s]; + } + } + // copy filled buffer to pixel data and free memory + memcpy(pixelData, px8, OFstatic_cast(size_t, numValues)); + delete[] px8; + return EC_Normal; +} + + +OFCondition DJCodecEncoder::togglePlanarConfiguration16( + Uint16 *pixelData, + const size_t numValues, //number of 16-bit components + const Uint16 samplesPerPixel, + const Uint16 oldPlanarConfig) +{ + if (pixelData == NULL) + return EC_IllegalParameter; + // allocate target buffer + Uint16* px16 = new Uint16[numValues]; + if (!px16) + return EC_MemoryExhausted; + size_t numPixels = numValues / samplesPerPixel; + if (oldPlanarConfig == 1) // change from "by plane" to "by pixel" + { + for (size_t n=0; n < numPixels; n++) + { + for (Uint16 s=0; s < samplesPerPixel; s++) + px16[n*samplesPerPixel+s] = pixelData[n+numPixels*s]; + } + } + else //change from "by pixel" to "by plane" + { + for (size_t n=0; n < numPixels; n++) + { + for (Uint16 s=0; s < samplesPerPixel; s++) + px16[n+numPixels*s] = pixelData[n*samplesPerPixel+s]; + } + } + // copy filled buffer to pixel data and free memory + memcpy(pixelData, px16, OFstatic_cast(size_t, numValues*2)); + delete[] px16; + return EC_Normal; +} + + +OFCondition DJCodecEncoder::updatePlanarConfiguration( + DcmItem *item, + const Uint16 newPlanConf) const +{ + if ( (item == NULL) || (newPlanConf) > 1) + return EC_IllegalParameter; + return item->putAndInsertUint16(DCM_PlanarConfiguration, newPlanConf); +} diff --git a/dcmjpeg/libsrc/djcparam.cc b/dcmjpeg/libsrc/djcparam.cc new file mode 100644 index 00000000..6c46eb5e --- /dev/null +++ b/dcmjpeg/libsrc/djcparam.cc @@ -0,0 +1,132 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: codec parameter class for dcmjpeg codecs + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djcparam.h" + +DJCodecParameter::DJCodecParameter( + E_CompressionColorSpaceConversion pCompressionCSConversion, + E_DecompressionColorSpaceConversion pDecompressionCSConversion, + E_UIDCreation pCreateSOPInstanceUID, + E_PlanarConfiguration pPlanarConfiguration, + OFBool predictor6WorkaroundEnable, + OFBool cornellWorkaroundEnable, + OFBool pForceSingleFragmentPerFrame, + OFBool pOptimizeHuffman, + int pSmoothingFactor, + int pForcedBitDepth, + Uint32 pFragmentSize, + OFBool pCreateOffsetTable, + E_SubSampling pSampleFactors, + OFBool pWriteYBR422, + OFBool pConvertToSC, + size_t pWindowType, + size_t pWindowParameter, + double pVoiCenter, + double pVoiWidth, + size_t pRoiLeft, + size_t pRoiTop, + size_t pRoiWidth, + size_t pRoiHeight, + OFBool pUsePixelValues, + OFBool pUseModalityRescale, + OFBool pAcceptWrongPaletteTags, + OFBool pAcrNemaCompatibility, + OFBool pTrueLosslessMode) +: DcmCodecParameter() +, compressionCSConversion(pCompressionCSConversion) +, decompressionCSConversion(pDecompressionCSConversion) +, planarConfiguration(pPlanarConfiguration) +, optimizeHuffman(pOptimizeHuffman) +, smoothingFactor(pSmoothingFactor) +, forcedBitDepth(pForcedBitDepth) +, fragmentSize(pFragmentSize) +, createOffsetTable(pCreateOffsetTable) +, sampleFactors(pSampleFactors) +, writeYBR422(pWriteYBR422) +, convertToSC(pConvertToSC) +, uidCreation(pCreateSOPInstanceUID) +, windowType(pWindowType) +, windowParameter(pWindowParameter) +, voiCenter(pVoiCenter) +, voiWidth(pVoiWidth) +, roiLeft(pRoiLeft) +, roiTop(pRoiTop) +, roiWidth(pRoiWidth) +, roiHeight(pRoiHeight) +, usePixelValues(pUsePixelValues) +, useModalityRescale(pUseModalityRescale) +, acceptWrongPaletteTags(pAcceptWrongPaletteTags) +, acrNemaCompatibility(pAcrNemaCompatibility) +, trueLosslessMode(pTrueLosslessMode) +, predictor6WorkaroundEnabled_(predictor6WorkaroundEnable) +, cornellWorkaroundEnabled_(cornellWorkaroundEnable) +, forceSingleFragmentPerFrame(pForceSingleFragmentPerFrame) +{ +} + + +DJCodecParameter::DJCodecParameter(const DJCodecParameter& arg) +: DcmCodecParameter(arg) +, compressionCSConversion(arg.compressionCSConversion) +, decompressionCSConversion(arg.decompressionCSConversion) +, planarConfiguration(arg.planarConfiguration) +, optimizeHuffman(arg.optimizeHuffman) +, smoothingFactor(arg.smoothingFactor) +, forcedBitDepth(arg.forcedBitDepth) +, fragmentSize(arg.fragmentSize) +, createOffsetTable(arg.createOffsetTable) +, sampleFactors(arg.sampleFactors) +, writeYBR422(arg.writeYBR422) +, convertToSC(arg.convertToSC) +, uidCreation(arg.uidCreation) +, windowType(arg.windowType) +, windowParameter(arg.windowParameter) +, voiCenter(arg.voiCenter) +, voiWidth(arg.voiWidth) +, roiLeft(arg.roiLeft) +, roiTop(arg.roiTop) +, roiWidth(arg.roiWidth) +, roiHeight(arg.roiHeight) +, usePixelValues(arg.usePixelValues) +, useModalityRescale(arg.useModalityRescale) +, acceptWrongPaletteTags(arg.acceptWrongPaletteTags) +, acrNemaCompatibility(arg.acrNemaCompatibility) +, trueLosslessMode(arg.trueLosslessMode) +, predictor6WorkaroundEnabled_(arg.predictor6WorkaroundEnabled_) +, cornellWorkaroundEnabled_(arg.cornellWorkaroundEnabled_) +, forceSingleFragmentPerFrame(arg.forceSingleFragmentPerFrame) +{ +} + +DJCodecParameter::~DJCodecParameter() +{ +} + +DcmCodecParameter *DJCodecParameter::clone() const +{ + return new DJCodecParameter(*this); +} + +const char *DJCodecParameter::className() const +{ + return "DJCodecParameter"; +} diff --git a/dcmjpeg/libsrc/djdecbas.cc b/dcmjpeg/libsrc/djdecbas.cc new file mode 100644 index 00000000..614d1611 --- /dev/null +++ b/dcmjpeg/libsrc/djdecbas.cc @@ -0,0 +1,58 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Baseline (lossy, 8-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecbas.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" + +#include "dcmtk/dcmjpeg/djdijg8.h" + + +DJDecoderBaseline::DJDecoderBaseline() +: DJCodecDecoder() +{ +} + + +DJDecoderBaseline::~DJDecoderBaseline() +{ +} + + +E_TransferSyntax DJDecoderBaseline::supportedTransferSyntax() const +{ + return EXS_JPEGProcess1; +} + +OFBool DJDecoderBaseline::isLosslessProcess() const +{ + return OFFalse; +} + +DJDecoder *DJDecoderBaseline::createDecoderInstance( + const DcmRepresentationParameter * /* toRepParam */, + const DJCodecParameter *cp, + Uint8 /* bitsPerSample */, + OFBool isYBR) const +{ + return new DJDecompressIJG8Bit(*cp, isYBR); +} diff --git a/dcmjpeg/libsrc/djdecext.cc b/dcmjpeg/libsrc/djdecext.cc new file mode 100644 index 00000000..0f0f2158 --- /dev/null +++ b/dcmjpeg/libsrc/djdecext.cc @@ -0,0 +1,59 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Extended Sequential (lossy, 8/12-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecext.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" +#include "dcmtk/dcmjpeg/djdijg8.h" +#include "dcmtk/dcmjpeg/djdijg12.h" + + +DJDecoderExtended::DJDecoderExtended() +: DJCodecDecoder() +{ +} + + +DJDecoderExtended::~DJDecoderExtended() +{ +} + + +E_TransferSyntax DJDecoderExtended::supportedTransferSyntax() const +{ + return EXS_JPEGProcess2_4; +} + +OFBool DJDecoderExtended::isLosslessProcess() const +{ + return OFFalse; +} + +DJDecoder *DJDecoderExtended::createDecoderInstance( + const DcmRepresentationParameter * /* toRepParam */, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const +{ + if (bitsPerSample > 8) return new DJDecompressIJG12Bit(*cp, isYBR); + else return new DJDecompressIJG8Bit(*cp, isYBR); +} diff --git a/dcmjpeg/libsrc/djdeclol.cc b/dcmjpeg/libsrc/djdeclol.cc new file mode 100644 index 00000000..c342b722 --- /dev/null +++ b/dcmjpeg/libsrc/djdeclol.cc @@ -0,0 +1,60 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Lossless (8/12/16-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdeclol.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrplol.h" +#include "dcmtk/dcmjpeg/djdijg8.h" +#include "dcmtk/dcmjpeg/djdijg12.h" +#include "dcmtk/dcmjpeg/djdijg16.h" + +DJDecoderLossless::DJDecoderLossless() +: DJCodecDecoder() +{ +} + + +DJDecoderLossless::~DJDecoderLossless() +{ +} + + +E_TransferSyntax DJDecoderLossless::supportedTransferSyntax() const +{ + return EXS_JPEGProcess14; +} + +OFBool DJDecoderLossless::isLosslessProcess() const +{ + return OFTrue; +} + +DJDecoder *DJDecoderLossless::createDecoderInstance( + const DcmRepresentationParameter * /* toRepParam */, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const +{ + if (bitsPerSample > 12) return new DJDecompressIJG16Bit(*cp, isYBR); + else if (bitsPerSample > 8) return new DJDecompressIJG12Bit(*cp, isYBR); + else return new DJDecompressIJG8Bit(*cp, isYBR); +} diff --git a/dcmjpeg/libsrc/djdecode.cc b/dcmjpeg/libsrc/djdecode.cc new file mode 100644 index 00000000..9166c7bc --- /dev/null +++ b/dcmjpeg/libsrc/djdecode.cc @@ -0,0 +1,124 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers decoders for all supported JPEG processes. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecode.h" + +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecStruct */ +#include "dcmtk/dcmjpeg/djdecbas.h" +#include "dcmtk/dcmjpeg/djdecext.h" +#include "dcmtk/dcmjpeg/djdecsps.h" +#include "dcmtk/dcmjpeg/djdecpro.h" +#include "dcmtk/dcmjpeg/djdecsv1.h" +#include "dcmtk/dcmjpeg/djdeclol.h" +#include "dcmtk/dcmjpeg/djcparam.h" + +// initialization of static members +OFBool DJDecoderRegistration::registered = OFFalse; +DJCodecParameter *DJDecoderRegistration::cp = NULL; +DJDecoderBaseline *DJDecoderRegistration::decbas = NULL; +DJDecoderExtended *DJDecoderRegistration::decext = NULL; +DJDecoderSpectralSelection *DJDecoderRegistration::decsps = NULL; +DJDecoderProgressive *DJDecoderRegistration::decpro = NULL; +DJDecoderP14SV1 *DJDecoderRegistration::decsv1 = NULL; +DJDecoderLossless *DJDecoderRegistration::declol = NULL; + +void DJDecoderRegistration::registerCodecs( + E_DecompressionColorSpaceConversion pDecompressionCSConversion, + E_UIDCreation pCreateSOPInstanceUID, + E_PlanarConfiguration pPlanarConfiguration, + OFBool predictor6WorkaroundEnable, + OFBool cornellWorkaroundEnable, + OFBool pForceSingleFragmentPerFrame) +{ + if (! registered) + { + cp = new DJCodecParameter( + ECC_lossyYCbCr, // ignored, compression only + pDecompressionCSConversion, + pCreateSOPInstanceUID, + pPlanarConfiguration, + predictor6WorkaroundEnable, + cornellWorkaroundEnable, + pForceSingleFragmentPerFrame); + + if (cp) + { + // baseline JPEG + decbas = new DJDecoderBaseline(); + if (decbas) DcmCodecList::registerCodec(decbas, NULL, cp); + + // extended JPEG + decext = new DJDecoderExtended(); + if (decext) DcmCodecList::registerCodec(decext, NULL, cp); + + // spectral selection JPEG + decsps = new DJDecoderSpectralSelection(); + if (decsps) DcmCodecList::registerCodec(decsps, NULL, cp); + + // progressive JPEG + decpro = new DJDecoderProgressive(); + if (decpro) DcmCodecList::registerCodec(decpro, NULL, cp); + + // lossless SV1 JPEG + decsv1 = new DJDecoderP14SV1(); + if (decsv1) DcmCodecList::registerCodec(decsv1, NULL, cp); + + // lossless JPEG + declol = new DJDecoderLossless(); + if (declol) DcmCodecList::registerCodec(declol, NULL, cp); + + registered = OFTrue; + } + } +} + +void DJDecoderRegistration::cleanup() +{ + if (registered) + { + DcmCodecList::deregisterCodec(decbas); + delete decbas; + DcmCodecList::deregisterCodec(decext); + delete decext; + DcmCodecList::deregisterCodec(decsps); + delete decsps; + DcmCodecList::deregisterCodec(decpro); + delete decpro; + DcmCodecList::deregisterCodec(decsv1); + delete decsv1; + DcmCodecList::deregisterCodec(declol); + delete declol; + delete cp; + registered = OFFalse; +#ifdef DEBUG + // not needed but useful for debugging purposes + decbas = NULL; + decext = NULL; + decsps = NULL; + decpro = NULL; + decsv1 = NULL; + declol = NULL; + cp = NULL; +#endif + + } +} diff --git a/dcmjpeg/libsrc/djdecpro.cc b/dcmjpeg/libsrc/djdecpro.cc new file mode 100644 index 00000000..c5e92854 --- /dev/null +++ b/dcmjpeg/libsrc/djdecpro.cc @@ -0,0 +1,59 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Progressive (lossy, 8/12-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecpro.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" +#include "dcmtk/dcmjpeg/djdijg8.h" +#include "dcmtk/dcmjpeg/djdijg12.h" + + +DJDecoderProgressive::DJDecoderProgressive() +: DJCodecDecoder() +{ +} + + +DJDecoderProgressive::~DJDecoderProgressive() +{ +} + + +E_TransferSyntax DJDecoderProgressive::supportedTransferSyntax() const +{ + return EXS_JPEGProcess10_12; +} + +OFBool DJDecoderProgressive::isLosslessProcess() const +{ + return OFFalse; +} + +DJDecoder *DJDecoderProgressive::createDecoderInstance( + const DcmRepresentationParameter * /* toRepParam */, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const +{ + if (bitsPerSample > 8) return new DJDecompressIJG12Bit(*cp, isYBR); + else return new DJDecompressIJG8Bit(*cp, isYBR); +} diff --git a/dcmjpeg/libsrc/djdecsps.cc b/dcmjpeg/libsrc/djdecsps.cc new file mode 100644 index 00000000..a02e7b45 --- /dev/null +++ b/dcmjpeg/libsrc/djdecsps.cc @@ -0,0 +1,61 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: Codec class for decoding JPEG Spectral Selection (lossy, 8/12-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecsps.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" +#include "dcmtk/dcmjpeg/djdijg8.h" +#include "dcmtk/dcmjpeg/djdijg12.h" + + +DJDecoderSpectralSelection::DJDecoderSpectralSelection() +: DJCodecDecoder() +{ +} + + +DJDecoderSpectralSelection::~DJDecoderSpectralSelection() +{ +} + + +E_TransferSyntax DJDecoderSpectralSelection::supportedTransferSyntax() const +{ + return EXS_JPEGProcess6_8; +} + + +OFBool DJDecoderSpectralSelection::isLosslessProcess() const +{ + return OFFalse; +} + + +DJDecoder *DJDecoderSpectralSelection::createDecoderInstance( + const DcmRepresentationParameter * /* toRepParam */, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const +{ + if (bitsPerSample > 8) return new DJDecompressIJG12Bit(*cp, isYBR); + else return new DJDecompressIJG8Bit(*cp, isYBR); +} diff --git a/dcmjpeg/libsrc/djdecsv1.cc b/dcmjpeg/libsrc/djdecsv1.cc new file mode 100644 index 00000000..5a5587e2 --- /dev/null +++ b/dcmjpeg/libsrc/djdecsv1.cc @@ -0,0 +1,61 @@ +/* + * + * Copyright (C) 2001-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for decoding JPEG Lossless Selection Value 1 (8/12/16-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdecsv1.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrplol.h" +#include "dcmtk/dcmjpeg/djdijg8.h" +#include "dcmtk/dcmjpeg/djdijg12.h" +#include "dcmtk/dcmjpeg/djdijg16.h" + + +DJDecoderP14SV1::DJDecoderP14SV1() +: DJCodecDecoder() +{ +} + + +DJDecoderP14SV1::~DJDecoderP14SV1() +{ +} + + +E_TransferSyntax DJDecoderP14SV1::supportedTransferSyntax() const +{ + return EXS_JPEGProcess14SV1; +} + +OFBool DJDecoderP14SV1::isLosslessProcess() const +{ + return OFTrue; +} + +DJDecoder *DJDecoderP14SV1::createDecoderInstance( + const DcmRepresentationParameter * /* toRepParam */, + const DJCodecParameter *cp, + Uint8 bitsPerSample, + OFBool isYBR) const +{ + if (bitsPerSample > 12) return new DJDecompressIJG16Bit(*cp, isYBR); + else if (bitsPerSample > 8) return new DJDecompressIJG12Bit(*cp, isYBR); + else return new DJDecompressIJG8Bit(*cp, isYBR); +} diff --git a/dcmjpeg/libsrc/djdijg12.cc b/dcmjpeg/libsrc/djdijg12.cc new file mode 100644 index 00000000..a4f7382e --- /dev/null +++ b/dcmjpeg/libsrc/djdijg12.cc @@ -0,0 +1,480 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: decompression routines of the IJG JPEG library configured for 12 bits/sample. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdijg12.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSETJMP +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +// These two macros are re-defined in the IJG header files. +// We undefine them here and hope that IJG's configure has +// come to the same conclusion that we have... +#ifdef HAVE_STDLIB_H +#undef HAVE_STDLIB_H +#endif +#ifdef HAVE_STDDEF_H +#undef HAVE_STDDEF_H +#endif + +BEGIN_EXTERN_C +#define boolean ijg_boolean +#include "jpeglib12.h" +#include "jerror12.h" +#undef boolean + +// disable any preprocessor magic the IJG library might be doing with the "const" keyword +#ifdef const +#undef const +#endif + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines longjmp() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + +// private error handler struct +struct DJDIJG12ErrorStruct +{ + // the standard IJG error handler object + struct jpeg_error_mgr pub; + + // our jump buffer + jmp_buf setjmp_buffer; + + // pointer to this + DJDecompressIJG12Bit *instance; +}; + +// private source manager struct +struct DJDIJG12SourceManagerStruct +{ + // the standard IJG source manager object + struct jpeg_source_mgr pub; + + // number of bytes to skip at start of buffer + long skip_bytes; + + // buffer from which reading will continue as soon as the current buffer is empty + Uint8 *next_buffer; + + // buffer size + Uint32 next_buffer_size; +}; + +// callback forward declarations +void DJDIJG12ErrorExit(j_common_ptr); +void DJDIJG12EmitMessage(j_common_ptr cinfo, int msg_level); +void DJDIJG12initSource(j_decompress_ptr); +ijg_boolean DJDIJG12fillInputBuffer(j_decompress_ptr); +void DJDIJG12skipInputData(j_decompress_ptr, long); +void DJDIJG12termSource(j_decompress_ptr); + +// helper method to fix old-style casts warnings +static void OFjpeg_create_decompress(j_decompress_ptr cinfo) +{ + jpeg_create_decompress(cinfo); +} + +END_EXTERN_C + + +// error handler, executes longjmp +void DJDIJG12ErrorExit(j_common_ptr cinfo) +{ + DJDIJG12ErrorStruct *myerr = OFreinterpret_cast(DJDIJG12ErrorStruct*, cinfo->err); + longjmp(myerr->setjmp_buffer, 1); +} + +// message handler for warning messages and the like +void DJDIJG12EmitMessage(j_common_ptr cinfo, int msg_level) +{ + DJDIJG12ErrorStruct *myerr = OFreinterpret_cast(DJDIJG12ErrorStruct*, cinfo->err); + myerr->instance->emitMessage(msg_level); +} + + +// methods for decompress-source-manager + +void DJDIJG12initSource(j_decompress_ptr /* cinfo */) +{ +} + +ijg_boolean DJDIJG12fillInputBuffer(j_decompress_ptr cinfo) +{ + DJDIJG12SourceManagerStruct *src = OFreinterpret_cast(DJDIJG12SourceManagerStruct*, cinfo->src); + + // if we already have the next buffer, switch buffers + if (src->next_buffer) + { + src->pub.next_input_byte = src->next_buffer; + src->pub.bytes_in_buffer = OFstatic_cast(unsigned int, src->next_buffer_size); + src->next_buffer = NULL; + src->next_buffer_size = 0; + + // The suspension was caused by DJDIJG12skipInputData iff src->skip_bytes > 0. + // In this case we must skip the remaining number of bytes here. + if (src->skip_bytes > 0) + { + if (src->pub.bytes_in_buffer < OFstatic_cast(unsigned long, src->skip_bytes)) + { + src->skip_bytes -= OFstatic_cast(Uint32, src->pub.bytes_in_buffer); + src->pub.next_input_byte += src->pub.bytes_in_buffer; + src->pub.bytes_in_buffer = 0; + // cause a suspension return + return FALSE; + } + else + { + src->pub.bytes_in_buffer -= OFstatic_cast(unsigned int, src->skip_bytes); + src->pub.next_input_byte += src->skip_bytes; + src->skip_bytes = 0; + } + } + return TRUE; + } + + // otherwise cause a suspension return + return FALSE; +} + +void DJDIJG12skipInputData( + j_decompress_ptr cinfo, + long num_bytes) +{ + DJDIJG12SourceManagerStruct *src = OFreinterpret_cast(DJDIJG12SourceManagerStruct*, cinfo->src); + + if (src->pub.bytes_in_buffer < OFstatic_cast(size_t, num_bytes)) + { + src->skip_bytes = num_bytes - OFstatic_cast(Uint32, src->pub.bytes_in_buffer); + src->pub.next_input_byte += src->pub.bytes_in_buffer; + src->pub.bytes_in_buffer = 0; // causes a suspension return + } + else + { + src->pub.bytes_in_buffer -= OFstatic_cast(unsigned int, num_bytes); + src->pub.next_input_byte += num_bytes; + src->skip_bytes = 0; + } +} + +void DJDIJG12termSource(j_decompress_ptr /* cinfo */) +{ +} + + +DJDecompressIJG12Bit::DJDecompressIJG12Bit(const DJCodecParameter& cp, OFBool isYBR) +: DJDecoder() +, cparam(&cp) +, cinfo(NULL) +, suspension(0) +, jsampBuffer(NULL) +, dicomPhotometricInterpretationIsYCbCr(isYBR) +, decompressedColorModel(EPI_Unknown) +{ +} + +DJDecompressIJG12Bit::~DJDecompressIJG12Bit() +{ + cleanup(); +} + + +OFCondition DJDecompressIJG12Bit::init() +{ + suspension = 0; + decompressedColorModel = EPI_Unknown; + cleanup(); // prevent double initialization + + cinfo = new jpeg_decompress_struct(); + if (cinfo) + { + volatile DJDIJG12SourceManagerStruct *src = NULL; + volatile DJDIJG12ErrorStruct *jerr = new DJDIJG12ErrorStruct(); + if (jerr) + { + src = new DJDIJG12SourceManagerStruct(); + if (src) + { + // Specify the source of the compressed data + src->pub.init_source = DJDIJG12initSource; + src->pub.fill_input_buffer = DJDIJG12fillInputBuffer; + src->pub.skip_input_data = DJDIJG12skipInputData; + src->pub.resync_to_restart = jpeg_resync_to_restart; + src->pub.term_source = DJDIJG12termSource; + src->pub.bytes_in_buffer = 0; + src->pub.next_input_byte = NULL; + src->skip_bytes = 0; + src->next_buffer = NULL; + src->next_buffer_size = 0; + } + else + { + delete OFconst_cast(DJDIJG12ErrorStruct *, jerr); + delete cinfo; + cinfo = NULL; + return EC_MemoryExhausted; + } + cinfo->err = jpeg_std_error(& OFconst_cast(DJDIJG12ErrorStruct *, jerr)->pub); + jerr->instance = this; + jerr->pub.error_exit = DJDIJG12ErrorExit; + jerr->pub.emit_message = DJDIJG12EmitMessage; + if (setjmp(OFconst_cast(DJDIJG12ErrorStruct *, jerr)->setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + cleanup(); + delete OFconst_cast(DJDIJG12SourceManagerStruct *, src); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG12_Decompression, OF_error, buffer); + } + } + else + { + delete cinfo; + cinfo = NULL; + return EC_MemoryExhausted; + } + OFjpeg_create_decompress(cinfo); + cinfo->src = &OFconst_cast(DJDIJG12SourceManagerStruct *, src)->pub; + } else return EC_MemoryExhausted; + + // everything OK + return EC_Normal; +} + + +void DJDecompressIJG12Bit::cleanup() +{ + if (cinfo) + { + jpeg_destroy_decompress(cinfo); + delete OFreinterpret_cast(DJDIJG12ErrorStruct*, cinfo->err); + delete OFreinterpret_cast(DJDIJG12SourceManagerStruct*, cinfo->src); + delete cinfo; + cinfo = NULL; + } +} + + +OFCondition DJDecompressIJG12Bit::decode( + Uint8 *compressedFrameBuffer, + Uint32 compressedFrameBufferSize, + Uint8 *uncompressedFrameBuffer, + Uint32 uncompressedFrameBufferSize, + OFBool isSigned) +{ + + if (cinfo==NULL || compressedFrameBuffer==NULL || uncompressedFrameBuffer==NULL) return EC_IllegalCall; + + if (setjmp(OFreinterpret_cast(DJDIJG12ErrorStruct*, cinfo->err)->setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + cleanup(); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG12_Decompression, OF_error, buffer); + } + + // feed compressed buffer into cinfo structure. + // The buffer will be activated by the next call to DJDIJG12fillInputBuffer. + DJDIJG12SourceManagerStruct *src = OFreinterpret_cast(DJDIJG12SourceManagerStruct*, cinfo->src); + src->next_buffer = compressedFrameBuffer; + src->next_buffer_size = compressedFrameBufferSize; + + // Obtain image info + if (suspension < 2) + { + if (JPEG_SUSPENDED == jpeg_read_header(cinfo, TRUE)) + { + suspension = 1; + return EJ_Suspension; + } + + // check if color space conversion is enabled + OFBool colorSpaceConversion = OFFalse; + // check whether to use the IJG library guess for the JPEG color space + OFBool colorSpaceGuess = OFFalse; + switch (cparam->getDecompressionColorSpaceConversion()) + { + case EDC_photometricInterpretation: // color space conversion if DICOM photometric interpretation is YCbCr + colorSpaceConversion = dicomPhotometricInterpretationIsYCbCr; + break; + case EDC_lossyOnly: // color space conversion if lossy JPEG + if (cinfo->process != JPROC_LOSSLESS) + colorSpaceConversion = OFTrue; + break; + case EDC_always: // always do color space conversion + colorSpaceConversion = OFTrue; + break; + case EDC_never: // never do color space conversion + break; + case EDC_guessLossyOnly: // use color space guess by IJG library if lossy JPEG + if (cinfo->process != JPROC_LOSSLESS) + { + colorSpaceGuess = OFTrue; + if (cinfo->jpeg_color_space == JCS_YCbCr) + colorSpaceConversion = OFTrue; + } + break; + case EDC_guess: // always use color space guess by IJG library + colorSpaceGuess = OFTrue; + if (cinfo->jpeg_color_space == JCS_YCbCr) + colorSpaceConversion = OFTrue; + break; + } + // decline color space conversion to RGB for signed pixel data, + // because IJG can handle only unsigned + if (colorSpaceConversion && isSigned) + return EJ_UnsupportedColorConversion; + + // let the IJG library guess the JPEG color space + if (colorSpaceGuess) + { + switch (cinfo->jpeg_color_space) + { + case JCS_GRAYSCALE: + // cinfo->out_color_space = JCS_GRAYSCALE; + decompressedColorModel = EPI_Monochrome2; + break; + case JCS_YCbCr: // enforce conversion YCbCr to RGB + cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + case JCS_RGB: + // cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + default: + decompressedColorModel = EPI_Unknown; + break; + } + } + // set color space for decompression + else if (colorSpaceConversion) + { + switch (cinfo->out_color_space) + { + case JCS_GRAYSCALE: + decompressedColorModel = EPI_Monochrome2; + break; + case JCS_YCbCr: // enforce conversion YCbCr to RGB + cinfo->jpeg_color_space = JCS_YCbCr; + cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + case JCS_RGB: // enforce conversion YCbCr to RGB + cinfo->jpeg_color_space = JCS_YCbCr; + decompressedColorModel = EPI_RGB; + break; + default: + decompressedColorModel = EPI_Unknown; + break; + } + } + else + { + decompressedColorModel = EPI_Unknown; + // prevent the library from performing any color space conversion + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->out_color_space = JCS_UNKNOWN; + } + } + + JSAMPARRAY buffer = NULL; + int bufsize = 0; + size_t rowsize = 0; + + if (suspension < 3) + { + if (FALSE == jpeg_start_decompress(cinfo)) + { + suspension = 2; + return EJ_Suspension; + } + bufsize = cinfo->output_width * cinfo->output_components; // number of JSAMPLEs per row + rowsize = bufsize * sizeof(JSAMPLE); // number of bytes per row + buffer = (*cinfo->mem->alloc_sarray)(OFreinterpret_cast(j_common_ptr, cinfo), JPOOL_IMAGE, bufsize, 1); + if (buffer == NULL) return EC_MemoryExhausted; + jsampBuffer = buffer; + } + else + { + bufsize = cinfo->output_width * cinfo->output_components; + rowsize = bufsize * sizeof(JSAMPLE); + buffer = OFreinterpret_cast(JSAMPARRAY, jsampBuffer); + } + + if (uncompressedFrameBufferSize < rowsize * cinfo->output_height) return EJ_IJG12_FrameBufferTooSmall; + + while (cinfo->output_scanline < cinfo->output_height) + { + if (0 == jpeg_read_scanlines(cinfo, buffer, 1)) + { + suspension = 3; + return EJ_Suspension; + } + memcpy(uncompressedFrameBuffer + (cinfo->output_scanline-1) * rowsize, *buffer, rowsize); + } + + if (FALSE == jpeg_finish_decompress(cinfo)) + { + suspension = 4; + return EJ_Suspension; + } + + return EC_Normal; +} + +void DJDecompressIJG12Bit::emitMessage(int msg_level) const +{ + // This is how we map the message levels: + // -1 - 0: Warning (could also be errors, but no way to find out) + // 1 : Debug + // Everything else: Trace (No point in splitting this further up) + OFLogger::LogLevel level; + + switch (msg_level) + { + case -1: + case 0: + level = OFLogger::WARN_LOG_LEVEL; + break; + case 1: + level = OFLogger::DEBUG_LOG_LEVEL; + break; + default: + level = OFLogger::TRACE_LOG_LEVEL; + break; + } + + if (cinfo && DCM_dcmjpegLogger.isEnabledFor(level)) + { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + DCM_dcmjpegLogger.forcedLog(level, buffer, __FILE__, __LINE__); + } +} diff --git a/dcmjpeg/libsrc/djdijg16.cc b/dcmjpeg/libsrc/djdijg16.cc new file mode 100644 index 00000000..4eb139dc --- /dev/null +++ b/dcmjpeg/libsrc/djdijg16.cc @@ -0,0 +1,483 @@ +/* + * + * Copyright (C) 2001-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: decompression routines of the IJG JPEG library configured for 16 bits/sample. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdijg16.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSETJMP +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +// These two macros are re-defined in the IJG header files. +// We undefine them here and hope that IJG's configure has +// come to the same conclusion that we have... +#ifdef HAVE_STDLIB_H +#undef HAVE_STDLIB_H +#endif +#ifdef HAVE_STDDEF_H +#undef HAVE_STDDEF_H +#endif + +BEGIN_EXTERN_C +#define boolean ijg_boolean +#include "jpeglib16.h" +#include "jerror16.h" +#undef boolean + +// disable any preprocessor magic the IJG library might be doing with the "const" keyword +#ifdef const +#undef const +#endif + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines longjmp() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + +// private error handler struct +struct DJDIJG16ErrorStruct +{ + // the standard IJG error handler object + struct jpeg_error_mgr pub; + + // our jump buffer + jmp_buf setjmp_buffer; + + // pointer to this + DJDecompressIJG16Bit *instance; +}; + +// private source manager struct +struct DJDIJG16SourceManagerStruct +{ + // the standard IJG source manager object + struct jpeg_source_mgr pub; + + // number of bytes to skip at start of buffer + long skip_bytes; + + // buffer from which reading will continue as soon as the current buffer is empty + Uint8 *next_buffer; + + // buffer size + Uint32 next_buffer_size; +}; + +// callback forward declarations +void DJDIJG16ErrorExit(j_common_ptr); +void DJDIJG16EmitMessage(j_common_ptr cinfo, int msg_level); +void DJDIJG16initSource(j_decompress_ptr); +ijg_boolean DJDIJG16fillInputBuffer(j_decompress_ptr); +void DJDIJG16skipInputData(j_decompress_ptr, long); +void DJDIJG16termSource(j_decompress_ptr); + +// helper method to fix old-style casts warnings +static void OFjpeg_create_decompress(j_decompress_ptr cinfo) +{ + jpeg_create_decompress(cinfo); +} + +END_EXTERN_C + + +// error handler, executes longjmp +void DJDIJG16ErrorExit(j_common_ptr cinfo) +{ + DJDIJG16ErrorStruct *myerr = OFreinterpret_cast(DJDIJG16ErrorStruct*, cinfo->err); + longjmp(myerr->setjmp_buffer, 1); +} + +// message handler for warning messages and the like +void DJDIJG16EmitMessage(j_common_ptr cinfo, int msg_level) +{ + DJDIJG16ErrorStruct *myerr = OFreinterpret_cast(DJDIJG16ErrorStruct*, cinfo->err); + myerr->instance->emitMessage(msg_level); +} + + +// methods for decompress-source-manager + +void DJDIJG16initSource(j_decompress_ptr /* cinfo */) +{ +} + +ijg_boolean DJDIJG16fillInputBuffer(j_decompress_ptr cinfo) +{ + DJDIJG16SourceManagerStruct *src = OFreinterpret_cast(DJDIJG16SourceManagerStruct*, cinfo->src); + + // if we already have the next buffer, switch buffers + if (src->next_buffer) + { + src->pub.next_input_byte = src->next_buffer; + src->pub.bytes_in_buffer = OFstatic_cast(unsigned int, src->next_buffer_size); + src->next_buffer = NULL; + src->next_buffer_size = 0; + + // The suspension was caused by DJDIJG16skipInputData iff src->skip_bytes > 0. + // In this case we must skip the remaining number of bytes here. + if (src->skip_bytes > 0) + { + if (src->pub.bytes_in_buffer < OFstatic_cast(unsigned long, src->skip_bytes)) + { + src->skip_bytes -= OFstatic_cast(Uint32, src->pub.bytes_in_buffer); + src->pub.next_input_byte += src->pub.bytes_in_buffer; + src->pub.bytes_in_buffer = 0; + // cause a suspension return + return FALSE; + } + else + { + src->pub.bytes_in_buffer -= OFstatic_cast(unsigned int, src->skip_bytes); + src->pub.next_input_byte += src->skip_bytes; + src->skip_bytes = 0; + } + } + return TRUE; + } + + // otherwise cause a suspension return + return FALSE; +} + +void DJDIJG16skipInputData( + j_decompress_ptr cinfo, + long num_bytes) +{ + DJDIJG16SourceManagerStruct *src = OFreinterpret_cast(DJDIJG16SourceManagerStruct*, cinfo->src); + + if (src->pub.bytes_in_buffer < OFstatic_cast(size_t, num_bytes)) + { + src->skip_bytes = num_bytes - OFstatic_cast(Uint32, src->pub.bytes_in_buffer); + src->pub.next_input_byte += src->pub.bytes_in_buffer; + src->pub.bytes_in_buffer = 0; // causes a suspension return + } + else + { + src->pub.bytes_in_buffer -= OFstatic_cast(unsigned int, num_bytes); + src->pub.next_input_byte += num_bytes; + src->skip_bytes = 0; + } +} + +void DJDIJG16termSource(j_decompress_ptr /* cinfo */) +{ +} + + +DJDecompressIJG16Bit::DJDecompressIJG16Bit(const DJCodecParameter& cp, OFBool isYBR) +: DJDecoder() +, cparam(&cp) +, cinfo(NULL) +, suspension(0) +, jsampBuffer(NULL) +, dicomPhotometricInterpretationIsYCbCr(isYBR) +, decompressedColorModel(EPI_Unknown) +{ +} + +DJDecompressIJG16Bit::~DJDecompressIJG16Bit() +{ + cleanup(); +} + + +OFCondition DJDecompressIJG16Bit::init() +{ + suspension = 0; + decompressedColorModel = EPI_Unknown; + cleanup(); // prevent double initialization + + cinfo = new jpeg_decompress_struct(); + if (cinfo) + { + volatile DJDIJG16SourceManagerStruct *src = NULL; + volatile DJDIJG16ErrorStruct *jerr = new DJDIJG16ErrorStruct(); + if (jerr) + { + src = new DJDIJG16SourceManagerStruct(); + if (src) + { + // Specify the source of the compressed data + src->pub.init_source = DJDIJG16initSource; + src->pub.fill_input_buffer = DJDIJG16fillInputBuffer; + src->pub.skip_input_data = DJDIJG16skipInputData; + src->pub.resync_to_restart = jpeg_resync_to_restart; + src->pub.term_source = DJDIJG16termSource; + src->pub.bytes_in_buffer = 0; + src->pub.next_input_byte = NULL; + src->skip_bytes = 0; + src->next_buffer = NULL; + src->next_buffer_size = 0; + } + else + { + delete OFconst_cast(DJDIJG16ErrorStruct *, jerr); + delete cinfo; + cinfo = NULL; + return EC_MemoryExhausted; + } + cinfo->err = jpeg_std_error(& OFconst_cast(DJDIJG16ErrorStruct *, jerr)->pub); + jerr->instance = this; + jerr->pub.error_exit = DJDIJG16ErrorExit; + jerr->pub.emit_message = DJDIJG16EmitMessage; + if (setjmp(OFconst_cast(DJDIJG16ErrorStruct *, jerr)->setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + cleanup(); + delete OFconst_cast(DJDIJG16SourceManagerStruct *, src); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG16_Decompression, OF_error, buffer); + } + } + else + { + delete cinfo; + cinfo = NULL; + return EC_MemoryExhausted; + } + OFjpeg_create_decompress(cinfo); + cinfo->src = &OFconst_cast(DJDIJG16SourceManagerStruct*, src)->pub; + cinfo->workaround_options = 0; + if (cparam->predictor6WorkaroundEnabled()) cinfo->workaround_options |= WORKAROUND_PREDICTOR6OVERFLOW; + if (cparam->cornellWorkaroundEnabled()) cinfo->workaround_options |= WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER; + } else return EC_MemoryExhausted; + + // everything OK + return EC_Normal; +} + + +void DJDecompressIJG16Bit::cleanup() +{ + if (cinfo) + { + jpeg_destroy_decompress(cinfo); + delete OFreinterpret_cast(DJDIJG16ErrorStruct*, cinfo->err); + delete OFreinterpret_cast(DJDIJG16SourceManagerStruct*, cinfo->src); + delete cinfo; + cinfo = NULL; + } +} + + +OFCondition DJDecompressIJG16Bit::decode( + Uint8 *compressedFrameBuffer, + Uint32 compressedFrameBufferSize, + Uint8 *uncompressedFrameBuffer, + Uint32 uncompressedFrameBufferSize, + OFBool isSigned) +{ + + if (cinfo==NULL || compressedFrameBuffer==NULL || uncompressedFrameBuffer==NULL) return EC_IllegalCall; + + if (setjmp(OFreinterpret_cast(DJDIJG16ErrorStruct*, cinfo->err)->setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + cleanup(); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG16_Decompression, OF_error, buffer); + } + + // feed compressed buffer into cinfo structure. + // The buffer will be activated by the next call to DJDIJG16fillInputBuffer. + DJDIJG16SourceManagerStruct *src = OFreinterpret_cast(DJDIJG16SourceManagerStruct*, cinfo->src); + src->next_buffer = compressedFrameBuffer; + src->next_buffer_size = compressedFrameBufferSize; + + // Obtain image info + if (suspension < 2) + { + if (JPEG_SUSPENDED == jpeg_read_header(cinfo, TRUE)) + { + suspension = 1; + return EJ_Suspension; + } + + // check if color space conversion is enabled + OFBool colorSpaceConversion = OFFalse; + // check whether to use the IJG library guess for the JPEG color space + OFBool colorSpaceGuess = OFFalse; + switch (cparam->getDecompressionColorSpaceConversion()) + { + case EDC_photometricInterpretation: // color space conversion if DICOM photometric interpretation is YCbCr + colorSpaceConversion = dicomPhotometricInterpretationIsYCbCr; + break; + case EDC_lossyOnly: // color space conversion if lossy JPEG + if (cinfo->process != JPROC_LOSSLESS) + colorSpaceConversion = OFTrue; + break; + case EDC_always: // always do color space conversion + colorSpaceConversion = OFTrue; + break; + case EDC_never: // never do color space conversion + break; + case EDC_guessLossyOnly: // use color space guess by IJG library if lossy JPEG + if (cinfo->process != JPROC_LOSSLESS) + { + colorSpaceGuess = OFTrue; + if (cinfo->jpeg_color_space == JCS_YCbCr) + colorSpaceConversion = OFTrue; + } + break; + case EDC_guess: // always use color space guess by IJG library + colorSpaceGuess = OFTrue; + if (cinfo->jpeg_color_space == JCS_YCbCr) + colorSpaceConversion = OFTrue; + break; + } + // decline color space conversion to RGB for signed pixel data, + // because IJG can handle only unsigned + if (colorSpaceConversion && isSigned) + return EJ_UnsupportedColorConversion; + + // let the IJG library guess the JPEG color space + if (colorSpaceGuess) + { + switch (cinfo->jpeg_color_space) + { + case JCS_GRAYSCALE: + // cinfo->out_color_space = JCS_GRAYSCALE; + decompressedColorModel = EPI_Monochrome2; + break; + case JCS_YCbCr: // enforce conversion YCbCr to RGB + cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + case JCS_RGB: + // cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + default: + decompressedColorModel = EPI_Unknown; + break; + } + } + // set color space for decompression + else if (colorSpaceConversion) + { + switch (cinfo->out_color_space) + { + case JCS_GRAYSCALE: + decompressedColorModel = EPI_Monochrome2; + break; + case JCS_YCbCr: // enforce conversion YCbCr to RGB + cinfo->jpeg_color_space = JCS_YCbCr; + cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + case JCS_RGB: // enforce conversion YCbCr to RGB + cinfo->jpeg_color_space = JCS_YCbCr; + decompressedColorModel = EPI_RGB; + break; + default: + decompressedColorModel = EPI_Unknown; + break; + } + } + else + { + decompressedColorModel = EPI_Unknown; + // prevent the library from performing any color space conversion + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->out_color_space = JCS_UNKNOWN; + } + } + + JSAMPARRAY buffer = NULL; + int bufsize = 0; + size_t rowsize = 0; + + if (suspension < 3) + { + if (FALSE == jpeg_start_decompress(cinfo)) + { + suspension = 2; + return EJ_Suspension; + } + bufsize = cinfo->output_width * cinfo->output_components; // number of JSAMPLEs per row + rowsize = bufsize * sizeof(JSAMPLE); // number of bytes per row + buffer = (*cinfo->mem->alloc_sarray)(OFreinterpret_cast(j_common_ptr, cinfo), JPOOL_IMAGE, bufsize, 1); + if (buffer == NULL) return EC_MemoryExhausted; + jsampBuffer = buffer; + } + else + { + bufsize = cinfo->output_width * cinfo->output_components; + rowsize = bufsize * sizeof(JSAMPLE); + buffer = OFreinterpret_cast(JSAMPARRAY, jsampBuffer); + } + + if (uncompressedFrameBufferSize < rowsize * cinfo->output_height) return EJ_IJG16_FrameBufferTooSmall; + + while (cinfo->output_scanline < cinfo->output_height) + { + if (0 == jpeg_read_scanlines(cinfo, buffer, 1)) + { + suspension = 3; + return EJ_Suspension; + } + memcpy(uncompressedFrameBuffer + (cinfo->output_scanline-1) * rowsize, *buffer, rowsize); + } + + if (FALSE == jpeg_finish_decompress(cinfo)) + { + suspension = 4; + return EJ_Suspension; + } + + return EC_Normal; +} + +void DJDecompressIJG16Bit::emitMessage(int msg_level) const +{ + // This is how we map the message levels: + // -1 - 0: Warning (could also be errors, but no way to find out) + // 1 : Debug + // Everything else: Trace (No point in splitting this further up) + OFLogger::LogLevel level; + + switch (msg_level) + { + case -1: + case 0: + level = OFLogger::WARN_LOG_LEVEL; + break; + case 1: + level = OFLogger::DEBUG_LOG_LEVEL; + break; + default: + level = OFLogger::TRACE_LOG_LEVEL; + break; + } + + if (cinfo && DCM_dcmjpegLogger.isEnabledFor(level)) + { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + DCM_dcmjpegLogger.forcedLog(level, buffer, __FILE__, __LINE__); + } +} diff --git a/dcmjpeg/libsrc/djdijg8.cc b/dcmjpeg/libsrc/djdijg8.cc new file mode 100644 index 00000000..b8ad8d3a --- /dev/null +++ b/dcmjpeg/libsrc/djdijg8.cc @@ -0,0 +1,480 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: decompression routines of the IJG JPEG library configured for 8 bits/sample. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djdijg8.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSETJMP +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +// These two macros are re-defined in the IJG header files. +// We undefine them here and hope that IJG's configure has +// come to the same conclusion that we have... +#ifdef HAVE_STDLIB_H +#undef HAVE_STDLIB_H +#endif +#ifdef HAVE_STDDEF_H +#undef HAVE_STDDEF_H +#endif + +BEGIN_EXTERN_C +#define boolean ijg_boolean +#include "jpeglib8.h" +#include "jerror8.h" +#undef boolean + +// disable any preprocessor magic the IJG library might be doing with the "const" keyword +#ifdef const +#undef const +#endif + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines longjmp() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + +// private error handler struct +struct DJDIJG8ErrorStruct +{ + // the standard IJG error handler object + struct jpeg_error_mgr pub; + + // our jump buffer + jmp_buf setjmp_buffer; + + // pointer to this + DJDecompressIJG8Bit *instance; +}; + +// private source manager struct +struct DJDIJG8SourceManagerStruct +{ + // the standard IJG source manager object + struct jpeg_source_mgr pub; + + // number of bytes to skip at start of buffer + long skip_bytes; + + // buffer from which reading will continue as soon as the current buffer is empty + Uint8 *next_buffer; + + // buffer size + Uint32 next_buffer_size; +}; + +// callback forward declarations +void DJDIJG8ErrorExit(j_common_ptr); +void DJDIJG8EmitMessage(j_common_ptr cinfo, int msg_level); +void DJDIJG8initSource(j_decompress_ptr); +ijg_boolean DJDIJG8fillInputBuffer(j_decompress_ptr); +void DJDIJG8skipInputData(j_decompress_ptr, long); +void DJDIJG8termSource(j_decompress_ptr); + +// helper method to fix old-style casts warnings +static void OFjpeg_create_decompress(j_decompress_ptr cinfo) +{ + jpeg_create_decompress(cinfo); +} + +END_EXTERN_C + + +// error handler, executes longjmp +void DJDIJG8ErrorExit(j_common_ptr cinfo) +{ + DJDIJG8ErrorStruct *myerr = OFreinterpret_cast(DJDIJG8ErrorStruct*, cinfo->err); + longjmp(myerr->setjmp_buffer, 1); +} + +// message handler for warning messages and the like +void DJDIJG8EmitMessage(j_common_ptr cinfo, int msg_level) +{ + DJDIJG8ErrorStruct *myerr = OFreinterpret_cast(DJDIJG8ErrorStruct*, cinfo->err); + myerr->instance->emitMessage(msg_level); +} + + +// methods for decompress-source-manager + +void DJDIJG8initSource(j_decompress_ptr /* cinfo */) +{ +} + +ijg_boolean DJDIJG8fillInputBuffer(j_decompress_ptr cinfo) +{ + DJDIJG8SourceManagerStruct *src = OFreinterpret_cast(DJDIJG8SourceManagerStruct*, cinfo->src); + + // if we already have the next buffer, switch buffers + if (src->next_buffer) + { + src->pub.next_input_byte = src->next_buffer; + src->pub.bytes_in_buffer = OFstatic_cast(unsigned int, src->next_buffer_size); + src->next_buffer = NULL; + src->next_buffer_size = 0; + + // The suspension was caused by DJDIJG8skipInputData iff src->skip_bytes > 0. + // In this case we must skip the remaining number of bytes here. + if (src->skip_bytes > 0) + { + if (src->pub.bytes_in_buffer < OFstatic_cast(unsigned long, src->skip_bytes)) + { + src->skip_bytes -= OFstatic_cast(Uint32, src->pub.bytes_in_buffer); + src->pub.next_input_byte += src->pub.bytes_in_buffer; + src->pub.bytes_in_buffer = 0; + // cause a suspension return + return FALSE; + } + else + { + src->pub.bytes_in_buffer -= OFstatic_cast(unsigned int, src->skip_bytes); + src->pub.next_input_byte += src->skip_bytes; + src->skip_bytes = 0; + } + } + return TRUE; + } + + // otherwise cause a suspension return + return FALSE; +} + +void DJDIJG8skipInputData( + j_decompress_ptr cinfo, + long num_bytes) +{ + DJDIJG8SourceManagerStruct *src = OFreinterpret_cast(DJDIJG8SourceManagerStruct*, cinfo->src); + + if (src->pub.bytes_in_buffer < OFstatic_cast(size_t, num_bytes)) + { + src->skip_bytes = num_bytes - OFstatic_cast(Uint32, src->pub.bytes_in_buffer); + src->pub.next_input_byte += src->pub.bytes_in_buffer; + src->pub.bytes_in_buffer = 0; // causes a suspension return + } + else + { + src->pub.bytes_in_buffer -= OFstatic_cast(unsigned int, num_bytes); + src->pub.next_input_byte += num_bytes; + src->skip_bytes = 0; + } +} + +void DJDIJG8termSource(j_decompress_ptr /* cinfo */) +{ +} + + +DJDecompressIJG8Bit::DJDecompressIJG8Bit(const DJCodecParameter& cp, OFBool isYBR) +: DJDecoder() +, cparam(&cp) +, cinfo(NULL) +, suspension(0) +, jsampBuffer(NULL) +, dicomPhotometricInterpretationIsYCbCr(isYBR) +, decompressedColorModel(EPI_Unknown) +{ +} + +DJDecompressIJG8Bit::~DJDecompressIJG8Bit() +{ + cleanup(); +} + + +OFCondition DJDecompressIJG8Bit::init() +{ + suspension = 0; + decompressedColorModel = EPI_Unknown; + cleanup(); // prevent double initialization + + cinfo = new jpeg_decompress_struct(); + if (cinfo) + { + volatile DJDIJG8SourceManagerStruct *src = NULL; + volatile DJDIJG8ErrorStruct *jerr = new DJDIJG8ErrorStruct(); + if (jerr) + { + src = new DJDIJG8SourceManagerStruct(); + if (src) + { + // Specify the source of the compressed data + src->pub.init_source = DJDIJG8initSource; + src->pub.fill_input_buffer = DJDIJG8fillInputBuffer; + src->pub.skip_input_data = DJDIJG8skipInputData; + src->pub.resync_to_restart = jpeg_resync_to_restart; + src->pub.term_source = DJDIJG8termSource; + src->pub.bytes_in_buffer = 0; + src->pub.next_input_byte = NULL; + src->skip_bytes = 0; + src->next_buffer = NULL; + src->next_buffer_size = 0; + } + else + { + delete OFconst_cast(DJDIJG8ErrorStruct *, jerr); + delete cinfo; + cinfo = NULL; + return EC_MemoryExhausted; + } + cinfo->err = jpeg_std_error(& OFconst_cast(DJDIJG8ErrorStruct *, jerr)->pub); + jerr->instance = this; + jerr->pub.error_exit = DJDIJG8ErrorExit; + jerr->pub.emit_message = DJDIJG8EmitMessage; + if (setjmp(OFconst_cast(DJDIJG8ErrorStruct *, jerr)->setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + cleanup(); + delete OFconst_cast(DJDIJG8SourceManagerStruct *, src); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG8_Decompression, OF_error, buffer); + } + } + else + { + delete cinfo; + cinfo = NULL; + return EC_MemoryExhausted; + } + OFjpeg_create_decompress(cinfo); + cinfo->src = &OFconst_cast(DJDIJG8SourceManagerStruct *, src)->pub; + } else return EC_MemoryExhausted; + + // everything OK + return EC_Normal; +} + + +void DJDecompressIJG8Bit::cleanup() +{ + if (cinfo) + { + jpeg_destroy_decompress(cinfo); + delete OFreinterpret_cast(DJDIJG8ErrorStruct*, cinfo->err); + delete OFreinterpret_cast(DJDIJG8SourceManagerStruct*, cinfo->src); + delete cinfo; + cinfo = NULL; + } +} + + +OFCondition DJDecompressIJG8Bit::decode( + Uint8 *compressedFrameBuffer, + Uint32 compressedFrameBufferSize, + Uint8 *uncompressedFrameBuffer, + Uint32 uncompressedFrameBufferSize, + OFBool isSigned) +{ + + if (cinfo==NULL || compressedFrameBuffer==NULL || uncompressedFrameBuffer==NULL) return EC_IllegalCall; + + if (setjmp(OFreinterpret_cast(DJDIJG8ErrorStruct*, cinfo->err)->setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + cleanup(); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG8_Decompression, OF_error, buffer); + } + + // feed compressed buffer into cinfo structure. + // The buffer will be activated by the next call to DJDIJG8fillInputBuffer. + DJDIJG8SourceManagerStruct *src = OFreinterpret_cast(DJDIJG8SourceManagerStruct*, cinfo->src); + src->next_buffer = compressedFrameBuffer; + src->next_buffer_size = compressedFrameBufferSize; + + // Obtain image info + if (suspension < 2) + { + if (JPEG_SUSPENDED == jpeg_read_header(cinfo, TRUE)) + { + suspension = 1; + return EJ_Suspension; + } + + // check if color space conversion is enabled + OFBool colorSpaceConversion = OFFalse; + // check whether to use the IJG library guess for the JPEG color space + OFBool colorSpaceGuess = OFFalse; + switch (cparam->getDecompressionColorSpaceConversion()) + { + case EDC_photometricInterpretation: // color space conversion if DICOM photometric interpretation is YCbCr + colorSpaceConversion = dicomPhotometricInterpretationIsYCbCr; + break; + case EDC_lossyOnly: // color space conversion if lossy JPEG + if (cinfo->process != JPROC_LOSSLESS) + colorSpaceConversion = OFTrue; + break; + case EDC_always: // always do color space conversion + colorSpaceConversion = OFTrue; + break; + case EDC_never: // never do color space conversion + break; + case EDC_guessLossyOnly: // use color space guess by IJG library if lossy JPEG + if (cinfo->process != JPROC_LOSSLESS) + { + colorSpaceGuess = OFTrue; + if (cinfo->jpeg_color_space == JCS_YCbCr) + colorSpaceConversion = OFTrue; + } + break; + case EDC_guess: // always use color space guess by IJG library + colorSpaceGuess = OFTrue; + if (cinfo->jpeg_color_space == JCS_YCbCr) + colorSpaceConversion = OFTrue; + break; + } + // decline color space conversion to RGB for signed pixel data, + // because IJG can handle only unsigned + if (colorSpaceConversion && isSigned) + return EJ_UnsupportedColorConversion; + + // let the IJG library guess the JPEG color space + if (colorSpaceGuess) + { + switch (cinfo->jpeg_color_space) + { + case JCS_GRAYSCALE: + // cinfo->out_color_space = JCS_GRAYSCALE; + decompressedColorModel = EPI_Monochrome2; + break; + case JCS_YCbCr: // enforce conversion YCbCr to RGB + cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + case JCS_RGB: + // cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + default: + decompressedColorModel = EPI_Unknown; + break; + } + } + // set color space for decompression + else if (colorSpaceConversion) + { + switch (cinfo->out_color_space) + { + case JCS_GRAYSCALE: + decompressedColorModel = EPI_Monochrome2; + break; + case JCS_YCbCr: // enforce conversion YCbCr to RGB + cinfo->jpeg_color_space = JCS_YCbCr; + cinfo->out_color_space = JCS_RGB; + decompressedColorModel = EPI_RGB; + break; + case JCS_RGB: // enforce conversion YCbCr to RGB + cinfo->jpeg_color_space = JCS_YCbCr; + decompressedColorModel = EPI_RGB; + break; + default: + decompressedColorModel = EPI_Unknown; + break; + } + } + else + { + decompressedColorModel = EPI_Unknown; + // prevent the library from performing any color space conversion + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->out_color_space = JCS_UNKNOWN; + } + } + + JSAMPARRAY buffer = NULL; + int bufsize = 0; + size_t rowsize = 0; + + if (suspension < 3) + { + if (FALSE == jpeg_start_decompress(cinfo)) + { + suspension = 2; + return EJ_Suspension; + } + bufsize = cinfo->output_width * cinfo->output_components; // number of JSAMPLEs per row + rowsize = bufsize * sizeof(JSAMPLE); // number of bytes per row + buffer = (*cinfo->mem->alloc_sarray)(OFreinterpret_cast(j_common_ptr, cinfo), JPOOL_IMAGE, bufsize, 1); + if (buffer == NULL) return EC_MemoryExhausted; + jsampBuffer = buffer; + } + else + { + bufsize = cinfo->output_width * cinfo->output_components; + rowsize = bufsize * sizeof(JSAMPLE); + buffer = OFreinterpret_cast(JSAMPARRAY, jsampBuffer); + } + + if (uncompressedFrameBufferSize < rowsize * cinfo->output_height) return EJ_IJG8_FrameBufferTooSmall; + + while (cinfo->output_scanline < cinfo->output_height) + { + if (0 == jpeg_read_scanlines(cinfo, buffer, 1)) + { + suspension = 3; + return EJ_Suspension; + } + memcpy(uncompressedFrameBuffer + (cinfo->output_scanline-1) * rowsize, *buffer, rowsize); + } + + if (FALSE == jpeg_finish_decompress(cinfo)) + { + suspension = 4; + return EJ_Suspension; + } + + return EC_Normal; +} + +void DJDecompressIJG8Bit::emitMessage(int msg_level) const +{ + // This is how we map the message levels: + // -1 - 0: Warning (could also be errors, but no way to find out) + // 1 : Debug + // Everything else: Trace (No point in splitting this further up) + OFLogger::LogLevel level; + + switch (msg_level) + { + case -1: + case 0: + level = OFLogger::WARN_LOG_LEVEL; + break; + case 1: + level = OFLogger::DEBUG_LOG_LEVEL; + break; + default: + level = OFLogger::TRACE_LOG_LEVEL; + break; + } + + if (cinfo && DCM_dcmjpegLogger.isEnabledFor(level)) + { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(OFreinterpret_cast(jpeg_common_struct*, cinfo), buffer); /* Create the message */ + DCM_dcmjpegLogger.forcedLog(level, buffer, __FILE__, __LINE__); + } +} diff --git a/dcmjpeg/libsrc/djeijg12.cc b/dcmjpeg/libsrc/djeijg12.cc new file mode 100644 index 00000000..c5c12aee --- /dev/null +++ b/dcmjpeg/libsrc/djeijg12.cc @@ -0,0 +1,576 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: compression routines of the IJG JPEG library configured for 12 bits/sample. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djeijg12.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSETJMP +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +// These two macros are re-defined in the IJG header files. +// We undefine them here and hope that IJG's configure has +// come to the same conclusion that we have... +#ifdef HAVE_STDLIB_H +#undef HAVE_STDLIB_H +#endif +#ifdef HAVE_STDDEF_H +#undef HAVE_STDDEF_H +#endif + +// use 16K blocks for temporary storage of compressed JPEG data +#define IJGE12_BLOCKSIZE 16384 + +BEGIN_EXTERN_C +#define boolean ijg_boolean +#include "jpeglib12.h" +#include "jerror12.h" +#include "jpegint12.h" +#undef boolean + +// disable any preprocessor magic the IJG library might be doing with the "const" keyword +#ifdef const +#undef const +#endif + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines longjmp() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + +// private error handler struct +struct DJEIJG12ErrorStruct +{ + // the standard IJG error handler object + struct jpeg_error_mgr pub; + + // our jump buffer + jmp_buf setjmp_buffer; + + // pointer to this + DJCompressIJG12Bit *instance; +}; + +// callback forward declarations +void DJEIJG12ErrorExit(j_common_ptr); +void DJEIJG12EmitMessage(j_common_ptr cinfo, int msg_level); +void DJEIJG12initDestination(j_compress_ptr cinfo); +ijg_boolean DJEIJG12emptyOutputBuffer(j_compress_ptr cinfo); +void DJEIJG12termDestination(j_compress_ptr cinfo); + +// helper methods to fix old-style casts warnings +static void OFjpeg_create_compress(j_compress_ptr cinfo) +{ + jpeg_create_compress(cinfo); +} + +static void OF_ERREXIT1(j_compress_ptr cinfo, int code, int p1) +{ + ERREXIT1(cinfo, code, p1); +} + +END_EXTERN_C + + +// error handler, executes longjmp + +void DJEIJG12ErrorExit(j_common_ptr cinfo) +{ + DJEIJG12ErrorStruct *myerr = OFreinterpret_cast(DJEIJG12ErrorStruct*, cinfo->err); + longjmp(myerr->setjmp_buffer, 1); +} + +// message handler for warning messages and the like +void DJEIJG12EmitMessage(j_common_ptr cinfo, int msg_level) +{ + DJEIJG12ErrorStruct *myerr = OFreinterpret_cast(DJEIJG12ErrorStruct*, cinfo->err); + myerr->instance->emitMessage(cinfo, msg_level); +} + +// callbacks for compress-destination-manager + +void DJEIJG12initDestination(j_compress_ptr cinfo) +{ + DJCompressIJG12Bit *encoder = OFreinterpret_cast(DJCompressIJG12Bit*, cinfo->client_data); + encoder->initDestination(cinfo); +} + +ijg_boolean DJEIJG12emptyOutputBuffer(j_compress_ptr cinfo) +{ + DJCompressIJG12Bit *encoder = OFreinterpret_cast(DJCompressIJG12Bit*, cinfo->client_data); + return encoder->emptyOutputBuffer(cinfo); +} + +void DJEIJG12termDestination(j_compress_ptr cinfo) +{ + DJCompressIJG12Bit *encoder = OFreinterpret_cast(DJCompressIJG12Bit*, cinfo->client_data); + encoder->termDestination(cinfo); +} + +/* + * jpeg_simple_spectral_selection() creates a scan script + * for progressive JPEG with spectral selection only, + * similar to jpeg_simple_progression() for full progression. + * The scan sequence for YCbCr is as proposed in the IJG documentation. + * The scan sequence for all other color models is somewhat arbitrary. + */ +static void jpeg_simple_spectral_selection(j_compress_ptr cinfo) +{ + int ncomps = cinfo->num_components; + jpeg_scan_info *scanptr = NULL; + int nscans = 0; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + { + OF_ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) nscans = 7; + else nscans = 1 + 2 * ncomps; /* 1 DC scan; 2 AC scans per component */ + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_spectral_selection is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space, and we allocate + * enough space to handle YCbCr even if initially asked for grayscale. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) + { + cinfo->script_space_size = nscans > 7 ? nscans : 7; + cinfo->script_space = OFreinterpret_cast(jpeg_scan_info*, + (*cinfo->mem->alloc_small) (OFreinterpret_cast(j_common_ptr, cinfo), + JPOOL_PERMANENT, cinfo->script_space_size * sizeof(jpeg_scan_info))); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) + { + /* Custom script for YCbCr color images. */ + + // Interleaved DC scan for Y,Cb,Cr: + scanptr[0].component_index[0] = 0; + scanptr[0].component_index[1] = 1; + scanptr[0].component_index[2] = 2; + scanptr[0].comps_in_scan = 3; + scanptr[0].Ss = 0; + scanptr[0].Se = 0; + scanptr[0].Ah = 0; + scanptr[0].Al = 0; + + // AC scans + // First two Y AC coefficients + scanptr[1].component_index[0] = 0; + scanptr[1].comps_in_scan = 1; + scanptr[1].Ss = 1; + scanptr[1].Se = 2; + scanptr[1].Ah = 0; + scanptr[1].Al = 0; + + // Three more + scanptr[2].component_index[0] = 0; + scanptr[2].comps_in_scan = 1; + scanptr[2].Ss = 3; + scanptr[2].Se = 5; + scanptr[2].Ah = 0; + scanptr[2].Al = 0; + + // All AC coefficients for Cb + scanptr[3].component_index[0] = 1; + scanptr[3].comps_in_scan = 1; + scanptr[3].Ss = 1; + scanptr[3].Se = 63; + scanptr[3].Ah = 0; + scanptr[3].Al = 0; + + // All AC coefficients for Cr + scanptr[4].component_index[0] = 2; + scanptr[4].comps_in_scan = 1; + scanptr[4].Ss = 1; + scanptr[4].Se = 63; + scanptr[4].Ah = 0; + scanptr[4].Al = 0; + + // More Y coefficients + scanptr[5].component_index[0] = 0; + scanptr[5].comps_in_scan = 1; + scanptr[5].Ss = 6; + scanptr[5].Se = 9; + scanptr[5].Ah = 0; + scanptr[5].Al = 0; + + // Remaining Y coefficients + scanptr[6].component_index[0] = 0; + scanptr[6].comps_in_scan = 1; + scanptr[6].Ss = 10; + scanptr[6].Se = 63; + scanptr[6].Ah = 0; + scanptr[6].Al = 0; + } + else + { + /* All-purpose script for other color spaces. */ + int j=0; + + // Interleaved DC scan for all components + for (j=0; jformat_message)(OFreinterpret_cast(jpeg_common_struct*, &cinfo), buffer); /* Create the message */ + jpeg_destroy_compress(&cinfo); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG12_Compression, OF_error, buffer); + } + OFjpeg_create_compress(&cinfo); + + // initialize client_data + cinfo.client_data = this; + + // Specify destination manager + jpeg_destination_mgr dest; + dest.init_destination = DJEIJG12initDestination; + dest.empty_output_buffer = DJEIJG12emptyOutputBuffer; + dest.term_destination = DJEIJG12termDestination; + cinfo.dest = &dest; + + cinfo.image_width = columns; + cinfo.image_height = rows; + cinfo.input_components = samplesPerPixel; + cinfo.in_color_space = getJpegColorSpace(colorSpace); + + jpeg_set_defaults(&cinfo); + + if (cparam->getCompressionColorSpaceConversion() != ECC_lossyYCbCr) + { + // prevent IJG library from doing any color space conversion + jpeg_set_colorspace (&cinfo, cinfo.in_color_space); + } + + cinfo.optimize_coding = OFTrue; // must always be true for 12 bit compression + + switch (modeofOperation) + { + case EJM_baseline: // baseline only supports 8 bits/sample. Assume sequential. + case EJM_sequential: + jpeg_set_quality(&cinfo, quality, 0); + break; + case EJM_spectralSelection: + jpeg_set_quality(&cinfo, quality, 0); + jpeg_simple_spectral_selection(&cinfo); + break; + case EJM_progressive: + jpeg_set_quality(&cinfo, quality, 0); + jpeg_simple_progression(&cinfo); + break; + case EJM_lossless: + // always disables any kind of color space conversion + jpeg_simple_lossless(&cinfo,psv,pt); + break; + } + + cinfo.smoothing_factor = cparam->getSmoothingFactor(); + + // initialize sampling factors + if ((cinfo.jpeg_color_space == JCS_YCbCr) && (modeofOperation != EJM_lossless)) + { + switch(cparam->getSampleFactors()) + { + case ESS_444: /* 4:4:4 sampling (no subsampling) */ + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_422: /* 4:2:2 sampling (horizontal subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_411: /* 4:1:1 sampling (horizontal and vertical subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 2; + break; + } + } + else + { + // JPEG color space is not YCbCr, or we are using lossless compression. + // Disable subsampling. + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + } + + // all other components are set to 1x1 + for (int sfi=1; sfi< MAX_COMPONENTS; sfi++) + { + cinfo.comp_info[sfi].h_samp_factor = 1; + cinfo.comp_info[sfi].v_samp_factor = 1; + } + + JSAMPROW row_pointer[1]; + jpeg_start_compress(&cinfo,TRUE); + int row_stride = columns * samplesPerPixel; + while (cinfo.next_scanline < cinfo.image_height) + { + // JSAMPLE is signed, typecast to avoid a warning + row_pointer[0] = OFreinterpret_cast(JSAMPLE*, image_buffer + (cinfo.next_scanline * row_stride)); + jpeg_write_scanlines(&cinfo, row_pointer, 1); + } + jpeg_finish_compress(&cinfo); + jpeg_destroy_compress(&cinfo); + + length = OFstatic_cast(Uint32, bytesInLastBlock); + if (pixelDataList.size() > 1) length += OFstatic_cast(Uint32, (pixelDataList.size() - 1)*IJGE12_BLOCKSIZE); + OFBool length_is_odd = (length % 2) > 0; + if (length_is_odd) length++; // ensure even length + + to = new Uint8[length]; + if (to == NULL) return EC_MemoryExhausted; + + size_t offset=0; + OFListIterator(unsigned char *) first = pixelDataList.begin(); + OFListIterator(unsigned char *) last = pixelDataList.end(); + OFListIterator(unsigned char *) shortBlock = last; + --shortBlock; + while (first != last) + { + if (first == shortBlock) + { + memcpy(to+offset, *first, bytesInLastBlock); + offset += bytesInLastBlock; + } + else + { + memcpy(to+offset, *first, IJGE12_BLOCKSIZE); + offset += IJGE12_BLOCKSIZE; + } + ++first; + } + if (length_is_odd) DcmJpegHelper::fixPadding(to, length); + cleanup(); + + return EC_Normal; +} + +void DJCompressIJG12Bit::initDestination(jpeg_compress_struct *cinfo) +{ + cleanup(); // erase old list of compressed blocks, if any + + unsigned char *newBlock = new unsigned char[IJGE12_BLOCKSIZE]; + if (newBlock) + { + pixelDataList.push_back(newBlock); + cinfo->dest->next_output_byte = newBlock; + cinfo->dest->free_in_buffer = IJGE12_BLOCKSIZE; + } + else + { + cinfo->dest->next_output_byte = NULL; + cinfo->dest->free_in_buffer = 0; + } +} + +int DJCompressIJG12Bit::emptyOutputBuffer(jpeg_compress_struct *cinfo) +{ + bytesInLastBlock = 0; + unsigned char *newBlock = new unsigned char[IJGE12_BLOCKSIZE]; + if (newBlock) + { + pixelDataList.push_back(newBlock); + cinfo->dest->next_output_byte = newBlock; + cinfo->dest->free_in_buffer = IJGE12_BLOCKSIZE; + } + else + { + cinfo->dest->next_output_byte = NULL; + cinfo->dest->free_in_buffer = 0; + OF_ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0xFF); + } + return TRUE; +} + + +void DJCompressIJG12Bit::termDestination(jpeg_compress_struct *cinfo) +{ + bytesInLastBlock = IJGE12_BLOCKSIZE - cinfo->dest->free_in_buffer; +} + +void DJCompressIJG12Bit::cleanup() +{ + OFListIterator(unsigned char *) first = pixelDataList.begin(); + OFListIterator(unsigned char *) last = pixelDataList.end(); + while (first != last) + { + delete[] *first; + first = pixelDataList.erase(first); + } + bytesInLastBlock = 0; +} + +void DJCompressIJG12Bit::emitMessage(void *arg, int msg_level) const +{ + jpeg_common_struct *cinfo = OFreinterpret_cast(jpeg_common_struct*, arg); + + // This is how we map the message levels: + // -1 - 0: Warning (could also be errors, but no way to find out) + // 1 : Debug + // Everything else: Trace (No point in splitting this further up) + OFLogger::LogLevel level; + + switch (msg_level) + { + case -1: + case 0: + level = OFLogger::WARN_LOG_LEVEL; + break; + case 1: + level = OFLogger::DEBUG_LOG_LEVEL; + break; + default: + level = OFLogger::TRACE_LOG_LEVEL; + break; + } + + if (cinfo && DCM_dcmjpegLogger.isEnabledFor(level)) + { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo, buffer); /* Create the message */ + DCM_dcmjpegLogger.forcedLog(level, buffer, __FILE__, __LINE__); + } +} diff --git a/dcmjpeg/libsrc/djeijg16.cc b/dcmjpeg/libsrc/djeijg16.cc new file mode 100644 index 00000000..a85c176c --- /dev/null +++ b/dcmjpeg/libsrc/djeijg16.cc @@ -0,0 +1,412 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: compression routines of the IJG JPEG library configured for 16 bits/sample. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djeijg16.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSETJMP +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +// These two macros are re-defined in the IJG header files. +// We undefine them here and hope that IJG's configure has +// come to the same conclusion that we have... +#ifdef HAVE_STDLIB_H +#undef HAVE_STDLIB_H +#endif +#ifdef HAVE_STDDEF_H +#undef HAVE_STDDEF_H +#endif + +// use 16K blocks for temporary storage of compressed JPEG data +#define IJGE16_BLOCKSIZE 16384 + +BEGIN_EXTERN_C +#define boolean ijg_boolean +#include "jpeglib16.h" +#include "jerror16.h" +#include "jpegint16.h" +#undef boolean + +// disable any preprocessor magic the IJG library might be doing with the "const" keyword +#ifdef const +#undef const +#endif + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines longjmp() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + +// private error handler struct +struct DJEIJG16ErrorStruct +{ + // the standard IJG error handler object + struct jpeg_error_mgr pub; + + // our jump buffer + jmp_buf setjmp_buffer; + + // pointer to this + DJCompressIJG16Bit *instance; +}; + +// callback forward declarations +void DJEIJG16ErrorExit(j_common_ptr); +void DJEIJG16EmitMessage(j_common_ptr cinfo, int msg_level); +void DJEIJG16initDestination(j_compress_ptr cinfo); +ijg_boolean DJEIJG16emptyOutputBuffer(j_compress_ptr cinfo); +void DJEIJG16termDestination(j_compress_ptr cinfo); + +// helper methods to fix old-style casts warnings +static void OFjpeg_create_compress(j_compress_ptr cinfo) +{ + jpeg_create_compress(cinfo); +} + +static void OF_ERREXIT1(j_compress_ptr cinfo, int code, int p1) +{ + ERREXIT1(cinfo, code, p1); +} + +END_EXTERN_C + + +// error handler, executes longjmp + +void DJEIJG16ErrorExit(j_common_ptr cinfo) +{ + DJEIJG16ErrorStruct *myerr = OFreinterpret_cast(DJEIJG16ErrorStruct*, cinfo->err); + longjmp(myerr->setjmp_buffer, 1); +} + +// message handler for warning messages and the like +void DJEIJG16EmitMessage(j_common_ptr cinfo, int msg_level) +{ + DJEIJG16ErrorStruct *myerr = OFreinterpret_cast(DJEIJG16ErrorStruct*, cinfo->err); + myerr->instance->emitMessage(cinfo, msg_level); +} + + +// callbacks for compress-destination-manager + +void DJEIJG16initDestination(j_compress_ptr cinfo) +{ + DJCompressIJG16Bit *encoder = OFreinterpret_cast(DJCompressIJG16Bit*, cinfo->client_data); + encoder->initDestination(cinfo); +} + +ijg_boolean DJEIJG16emptyOutputBuffer(j_compress_ptr cinfo) +{ + DJCompressIJG16Bit *encoder = OFreinterpret_cast(DJCompressIJG16Bit*, cinfo->client_data); + return encoder->emptyOutputBuffer(cinfo); +} + +void DJEIJG16termDestination(j_compress_ptr cinfo) +{ + DJCompressIJG16Bit *encoder = OFreinterpret_cast(DJCompressIJG16Bit*, cinfo->client_data); + encoder->termDestination(cinfo); +} + + +// converts dcmtk color space to IJG color space + +static J_COLOR_SPACE getJpegColorSpace(EP_Interpretation interpr) +{ + switch (interpr) + { + case EPI_Unknown :return JCS_UNKNOWN; + case EPI_Monochrome1 : return JCS_GRAYSCALE; + case EPI_Monochrome2 : return JCS_GRAYSCALE; + case EPI_PaletteColor : return JCS_UNKNOWN; + case EPI_RGB : return JCS_RGB; + case EPI_HSV : return JCS_UNKNOWN; + case EPI_ARGB : return JCS_RGB; + case EPI_CMYK : return JCS_CMYK; + case EPI_YBR_Full : return JCS_YCbCr; + case EPI_YBR_Full_422 : return JCS_YCbCr; + case EPI_YBR_Partial_422 : return JCS_YCbCr; + default : return JCS_UNKNOWN; + } +} + +DJCompressIJG16Bit::DJCompressIJG16Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans) +: DJEncoder() +, cparam(&cp) +, psv(prediction) +, pt(ptrans) +, modeofOperation(mode) +, pixelDataList() +, bytesInLastBlock(0) +{ + assert(mode == EJM_lossless); +} + +DJCompressIJG16Bit::~DJCompressIJG16Bit() +{ + cleanup(); +} + +OFCondition DJCompressIJG16Bit::encode( + Uint16 /* columns */, + Uint16 /* rows */, + EP_Interpretation /* interpr */, + Uint16 /* samplesPerPixel */, + Uint8 * /* image_buffer */, + Uint8 *& /* to */, + Uint32 & /* length */) +{ + return EC_IllegalCall; +} + +OFCondition DJCompressIJG16Bit::encode( + Uint16 columns, + Uint16 rows, + EP_Interpretation colorSpace, + Uint16 samplesPerPixel, + Uint16 * image_buffer, + Uint8 * & to, + Uint32 & length) +{ + + struct jpeg_compress_struct cinfo; + struct DJEIJG16ErrorStruct jerr; + cinfo.err = jpeg_std_error(&jerr.pub); + jerr.instance = this; + jerr.pub.error_exit = DJEIJG16ErrorExit; + jerr.pub.emit_message = DJEIJG16EmitMessage; + if (setjmp(jerr.setjmp_buffer)) + { + // the IJG error handler will cause the following code to be executed + char buffer[JMSG_LENGTH_MAX]; + (*cinfo.err->format_message)(OFreinterpret_cast(jpeg_common_struct*, &cinfo), buffer); /* Create the message */ + jpeg_destroy_compress(&cinfo); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG16_Compression, OF_error, buffer); + } + OFjpeg_create_compress(&cinfo); + + // initialize client_data + cinfo.client_data = this; + + // Specify destination manager + jpeg_destination_mgr dest; + dest.init_destination = DJEIJG16initDestination; + dest.empty_output_buffer = DJEIJG16emptyOutputBuffer; + dest.term_destination = DJEIJG16termDestination; + cinfo.dest = &dest; + + cinfo.image_width = columns; + cinfo.image_height = rows; + cinfo.input_components = samplesPerPixel; + cinfo.in_color_space = getJpegColorSpace(colorSpace); + + jpeg_set_defaults(&cinfo); + + if (cparam->getCompressionColorSpaceConversion() != ECC_lossyYCbCr) + { + // prevent IJG library from doing any color space conversion + jpeg_set_colorspace (&cinfo, cinfo.in_color_space); + } + + cinfo.optimize_coding = OFTrue; // must always be true for 16 bit compression + + switch (modeofOperation) + { + case EJM_lossless: + // always disables any kind of color space conversion + jpeg_simple_lossless(&cinfo,psv,pt); + break; + default: + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG16_Compression, OF_error, "JPEG with 16 bits/sample only allowed with lossless compression"); + /* break; */ + } + + cinfo.smoothing_factor = cparam->getSmoothingFactor(); + + // initialize sampling factors + if ((cinfo.jpeg_color_space == JCS_YCbCr) && (modeofOperation != EJM_lossless)) + { + switch(cparam->getSampleFactors()) + { + case ESS_444: /* 4:4:4 sampling (no subsampling) */ + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_422: /* 4:2:2 sampling (horizontal subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_411: /* 4:1:1 sampling (horizontal and vertical subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 2; + break; + } + } + else + { + // JPEG color space is not YCbCr, or we are using lossless compression. + // Disable subsampling. + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + } + + // all other components are set to 1x1 + for (int sfi=1; sfi< MAX_COMPONENTS; sfi++) + { + cinfo.comp_info[sfi].h_samp_factor = 1; + cinfo.comp_info[sfi].v_samp_factor = 1; + } + + JSAMPROW row_pointer[1]; + jpeg_start_compress(&cinfo,TRUE); + int row_stride = columns * samplesPerPixel; + while (cinfo.next_scanline < cinfo.image_height) + { + // JSAMPLE might be signed, typecast to avoid a warning + row_pointer[0] = OFreinterpret_cast(JSAMPLE*, image_buffer + (cinfo.next_scanline * row_stride)); + jpeg_write_scanlines(&cinfo, row_pointer, 1); + } + jpeg_finish_compress(&cinfo); + jpeg_destroy_compress(&cinfo); + + length = OFstatic_cast(Uint32, bytesInLastBlock); + if (pixelDataList.size() > 1) length += OFstatic_cast(Uint32, (pixelDataList.size() - 1)*IJGE16_BLOCKSIZE); + OFBool length_is_odd = (length % 2) > 0; + if (length_is_odd) length++; // ensure even length + + to = new Uint8[length]; + if (to == NULL) return EC_MemoryExhausted; + + size_t offset=0; + OFListIterator(unsigned char *) first = pixelDataList.begin(); + OFListIterator(unsigned char *) last = pixelDataList.end(); + OFListIterator(unsigned char *) shortBlock = last; + --shortBlock; + while (first != last) + { + if (first == shortBlock) + { + memcpy(to+offset, *first, bytesInLastBlock); + offset += bytesInLastBlock; + } + else + { + memcpy(to+offset, *first, IJGE16_BLOCKSIZE); + offset += IJGE16_BLOCKSIZE; + } + ++first; + } + if (length_is_odd) DcmJpegHelper::fixPadding(to, length); + cleanup(); + + return EC_Normal; +} + +void DJCompressIJG16Bit::initDestination(jpeg_compress_struct *cinfo) +{ + cleanup(); // erase old list of compressed blocks, if any + + unsigned char *newBlock = new unsigned char[IJGE16_BLOCKSIZE]; + if (newBlock) + { + pixelDataList.push_back(newBlock); + cinfo->dest->next_output_byte = newBlock; + cinfo->dest->free_in_buffer = IJGE16_BLOCKSIZE; + } + else + { + cinfo->dest->next_output_byte = NULL; + cinfo->dest->free_in_buffer = 0; + } +} + +int DJCompressIJG16Bit::emptyOutputBuffer(jpeg_compress_struct *cinfo) +{ + bytesInLastBlock = 0; + unsigned char *newBlock = new unsigned char[IJGE16_BLOCKSIZE]; + if (newBlock) + { + pixelDataList.push_back(newBlock); + cinfo->dest->next_output_byte = newBlock; + cinfo->dest->free_in_buffer = IJGE16_BLOCKSIZE; + } + else + { + cinfo->dest->next_output_byte = NULL; + cinfo->dest->free_in_buffer = 0; + OF_ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0xFF); + } + return TRUE; +} + + +void DJCompressIJG16Bit::termDestination(jpeg_compress_struct *cinfo) +{ + bytesInLastBlock = IJGE16_BLOCKSIZE - cinfo->dest->free_in_buffer; +} + +void DJCompressIJG16Bit::cleanup() +{ + OFListIterator(unsigned char *) first = pixelDataList.begin(); + OFListIterator(unsigned char *) last = pixelDataList.end(); + while (first != last) + { + delete[] *first; + first = pixelDataList.erase(first); + } + bytesInLastBlock = 0; +} + +void DJCompressIJG16Bit::emitMessage(void *arg, int msg_level) const +{ + jpeg_common_struct *cinfo = OFreinterpret_cast(jpeg_common_struct*, arg); + + // This is how we map the message levels: + // -1 - 0: Warning (could also be errors, but no way to find out) + // 1 : Debug + // Everything else: Trace (No point in splitting this further up) + OFLogger::LogLevel level; + + switch (msg_level) + { + case -1: + case 0: + level = OFLogger::WARN_LOG_LEVEL; + break; + case 1: + level = OFLogger::DEBUG_LOG_LEVEL; + break; + default: + level = OFLogger::TRACE_LOG_LEVEL; + break; + } + + if (cinfo && DCM_dcmjpegLogger.isEnabledFor(level)) + { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo, buffer); /* Create the message */ + DCM_dcmjpegLogger.forcedLog(level, buffer, __FILE__, __LINE__); + } +} diff --git a/dcmjpeg/libsrc/djeijg8.cc b/dcmjpeg/libsrc/djeijg8.cc new file mode 100644 index 00000000..77420938 --- /dev/null +++ b/dcmjpeg/libsrc/djeijg8.cc @@ -0,0 +1,579 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: compression routines of the IJG JPEG library configured for 8 bits/sample. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djeijg8.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CSETJMP +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +// These two macros are re-defined in the IJG header files. +// We undefine them here and hope that IJG's configure has +// come to the same conclusion that we have... +#ifdef HAVE_STDLIB_H +#undef HAVE_STDLIB_H +#endif +#ifdef HAVE_STDDEF_H +#undef HAVE_STDDEF_H +#endif + +// use 16K blocks for temporary storage of compressed JPEG data +#define IJGE8_BLOCKSIZE 16384 + +BEGIN_EXTERN_C +#define boolean ijg_boolean +#include "jpeglib8.h" +#include "jerror8.h" +#include "jpegint8.h" +#undef boolean + +// disable any preprocessor magic the IJG library might be doing with the "const" keyword +#ifdef const +#undef const +#endif + +#ifdef USE_STD_CXX_INCLUDES +// Solaris defines longjmp() in namespace std, other compilers don't... +namespace std { } +using namespace std; +#endif + +// private error handler struct +struct DJEIJG8ErrorStruct +{ + // the standard IJG error handler object + struct jpeg_error_mgr pub; + + // our jump buffer + jmp_buf setjmp_buffer; + + // pointer to this + DJCompressIJG8Bit *instance; +}; + +// callback forward declarations +void DJEIJG8ErrorExit(j_common_ptr); +void DJEIJG8EmitMessage(j_common_ptr cinfo, int msg_level); +void DJEIJG8initDestination(j_compress_ptr cinfo); +ijg_boolean DJEIJG8emptyOutputBuffer(j_compress_ptr cinfo); +void DJEIJG8termDestination(j_compress_ptr cinfo); + +// helper methods to fix old-style casts warnings +static void OFjpeg_create_compress(j_compress_ptr cinfo) +{ + jpeg_create_compress(cinfo); +} + +static void OF_ERREXIT1(j_compress_ptr cinfo, int code, int p1) +{ + ERREXIT1(cinfo, code, p1); +} + +END_EXTERN_C + + +// error handler, executes longjmp + +void DJEIJG8ErrorExit(j_common_ptr cinfo) +{ + DJEIJG8ErrorStruct *myerr = OFreinterpret_cast(DJEIJG8ErrorStruct*, cinfo->err); + longjmp(myerr->setjmp_buffer, 1); +} + +// message handler for warning messages and the like +void DJEIJG8EmitMessage(j_common_ptr cinfo, int msg_level) +{ + DJEIJG8ErrorStruct *myerr = OFreinterpret_cast(DJEIJG8ErrorStruct*, cinfo->err); + myerr->instance->emitMessage(cinfo, msg_level); +} + + +// callbacks for compress-destination-manager + +void DJEIJG8initDestination(j_compress_ptr cinfo) +{ + DJCompressIJG8Bit *encoder = OFreinterpret_cast(DJCompressIJG8Bit*, cinfo->client_data); + encoder->initDestination(cinfo); +} + +ijg_boolean DJEIJG8emptyOutputBuffer(j_compress_ptr cinfo) +{ + DJCompressIJG8Bit *encoder = OFreinterpret_cast(DJCompressIJG8Bit*, cinfo->client_data); + return encoder->emptyOutputBuffer(cinfo); +} + +void DJEIJG8termDestination(j_compress_ptr cinfo) +{ + DJCompressIJG8Bit *encoder = OFreinterpret_cast(DJCompressIJG8Bit*, cinfo->client_data); + encoder->termDestination(cinfo); +} + +/* + * jpeg_simple_spectral_selection() creates a scan script + * for progressive JPEG with spectral selection only, + * similar to jpeg_simple_progression() for full progression. + * The scan sequence for YCbCr is as proposed in the IJG documentation. + * The scan sequence for all other color models is somewhat arbitrary. + */ +static void jpeg_simple_spectral_selection(j_compress_ptr cinfo) +{ + int ncomps = cinfo->num_components; + jpeg_scan_info *scanptr = NULL; + int nscans = 0; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + { + OF_ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) nscans = 7; + else nscans = 1 + 2 * ncomps; /* 1 DC scan; 2 AC scans per component */ + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_spectral_selection is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space, and we allocate + * enough space to handle YCbCr even if initially asked for grayscale. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) + { + cinfo->script_space_size = nscans > 7 ? nscans : 7; + cinfo->script_space = OFreinterpret_cast(jpeg_scan_info*, + (*cinfo->mem->alloc_small) (OFreinterpret_cast(j_common_ptr, cinfo), + JPOOL_PERMANENT, cinfo->script_space_size * sizeof(jpeg_scan_info))); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) + { + /* Custom script for YCbCr color images. */ + + // Interleaved DC scan for Y,Cb,Cr: + scanptr[0].component_index[0] = 0; + scanptr[0].component_index[1] = 1; + scanptr[0].component_index[2] = 2; + scanptr[0].comps_in_scan = 3; + scanptr[0].Ss = 0; + scanptr[0].Se = 0; + scanptr[0].Ah = 0; + scanptr[0].Al = 0; + + // AC scans + // First two Y AC coefficients + scanptr[1].component_index[0] = 0; + scanptr[1].comps_in_scan = 1; + scanptr[1].Ss = 1; + scanptr[1].Se = 2; + scanptr[1].Ah = 0; + scanptr[1].Al = 0; + + // Three more + scanptr[2].component_index[0] = 0; + scanptr[2].comps_in_scan = 1; + scanptr[2].Ss = 3; + scanptr[2].Se = 5; + scanptr[2].Ah = 0; + scanptr[2].Al = 0; + + // All AC coefficients for Cb + scanptr[3].component_index[0] = 1; + scanptr[3].comps_in_scan = 1; + scanptr[3].Ss = 1; + scanptr[3].Se = 63; + scanptr[3].Ah = 0; + scanptr[3].Al = 0; + + // All AC coefficients for Cr + scanptr[4].component_index[0] = 2; + scanptr[4].comps_in_scan = 1; + scanptr[4].Ss = 1; + scanptr[4].Se = 63; + scanptr[4].Ah = 0; + scanptr[4].Al = 0; + + // More Y coefficients + scanptr[5].component_index[0] = 0; + scanptr[5].comps_in_scan = 1; + scanptr[5].Ss = 6; + scanptr[5].Se = 9; + scanptr[5].Ah = 0; + scanptr[5].Al = 0; + + // Remaining Y coefficients + scanptr[6].component_index[0] = 0; + scanptr[6].comps_in_scan = 1; + scanptr[6].Ss = 10; + scanptr[6].Se = 63; + scanptr[6].Ah = 0; + scanptr[6].Al = 0; + } + else + { + /* All-purpose script for other color spaces. */ + int j=0; + + // Interleaved DC scan for all components + for (j=0; jformat_message)(OFreinterpret_cast(jpeg_common_struct*, &cinfo), buffer); /* Create the message */ + jpeg_destroy_compress(&cinfo); + return makeOFCondition(OFM_dcmjpeg, EJCode_IJG8_Compression, OF_error, buffer); + } + OFjpeg_create_compress(&cinfo); + + // initialize client_data + cinfo.client_data = this; + + // Specify destination manager + jpeg_destination_mgr dest; + dest.init_destination = DJEIJG8initDestination; + dest.empty_output_buffer = DJEIJG8emptyOutputBuffer; + dest.term_destination = DJEIJG8termDestination; + cinfo.dest = &dest; + + cinfo.image_width = columns; + cinfo.image_height = rows; + cinfo.input_components = samplesPerPixel; + cinfo.in_color_space = getJpegColorSpace(colorSpace); + + jpeg_set_defaults(&cinfo); + + if (cparam->getCompressionColorSpaceConversion() != ECC_lossyYCbCr) + { + // prevent IJG library from doing any color space conversion + jpeg_set_colorspace (&cinfo, cinfo.in_color_space); + } + + cinfo.optimize_coding = cparam->getOptimizeHuffmanCoding(); + + switch (modeofOperation) + { + case EJM_baseline: + jpeg_set_quality(&cinfo, quality, 1); + break; + case EJM_sequential: + jpeg_set_quality(&cinfo, quality, 0); + cinfo.force_extended_sequential_marker = TRUE; + break; + case EJM_spectralSelection: + jpeg_set_quality(&cinfo, quality, 0); + jpeg_simple_spectral_selection(&cinfo); + break; + case EJM_progressive: + jpeg_set_quality(&cinfo, quality, 0); + jpeg_simple_progression(&cinfo); + break; + case EJM_lossless: + // always disables any kind of color space conversion + jpeg_simple_lossless(&cinfo,psv,pt); + break; + } + + cinfo.smoothing_factor = cparam->getSmoothingFactor(); + + // initialize sampling factors + if ((cinfo.jpeg_color_space == JCS_YCbCr) && (modeofOperation != EJM_lossless)) + { + switch(cparam->getSampleFactors()) + { + case ESS_444: /* 4:4:4 sampling (no subsampling) */ + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_422: /* 4:2:2 sampling (horizontal subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 1; + break; + case ESS_411: /* 4:1:1 sampling (horizontal and vertical subsampling of chroma components) */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 2; + break; + } + } + else + { + // JPEG color space is not YCbCr, or we are using lossless compression. + // Disable subsampling. + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + } + + // all other components are set to 1x1 + for (int sfi=1; sfi< MAX_COMPONENTS; sfi++) + { + cinfo.comp_info[sfi].h_samp_factor = 1; + cinfo.comp_info[sfi].v_samp_factor = 1; + } + + JSAMPROW row_pointer[1]; + jpeg_start_compress(&cinfo,TRUE); + int row_stride = columns * samplesPerPixel; + while (cinfo.next_scanline < cinfo.image_height) + { + row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride]; + jpeg_write_scanlines(&cinfo, row_pointer, 1); + } + jpeg_finish_compress(&cinfo); + jpeg_destroy_compress(&cinfo); + + length = OFstatic_cast(Uint32, bytesInLastBlock); + if (pixelDataList.size() > 1) length += OFstatic_cast(Uint32, (pixelDataList.size() - 1)*IJGE8_BLOCKSIZE); + OFBool length_is_odd = (length % 2) > 0; + if (length_is_odd) length++; // ensure even length + + to = new Uint8[length]; + if (to == NULL) return EC_MemoryExhausted; + + size_t offset=0; + OFListIterator(unsigned char *) first = pixelDataList.begin(); + OFListIterator(unsigned char *) last = pixelDataList.end(); + OFListIterator(unsigned char *) shortBlock = last; + --shortBlock; + while (first != last) + { + if (first == shortBlock) + { + memcpy(to+offset, *first, bytesInLastBlock); + offset += bytesInLastBlock; + } + else + { + memcpy(to+offset, *first, IJGE8_BLOCKSIZE); + offset += IJGE8_BLOCKSIZE; + } + ++first; + } + if (length_is_odd) DcmJpegHelper::fixPadding(to, length); + cleanup(); + return EC_Normal; +} + +void DJCompressIJG8Bit::initDestination(jpeg_compress_struct *cinfo) +{ + cleanup(); // erase old list of compressed blocks, if any + + unsigned char *newBlock = new unsigned char[IJGE8_BLOCKSIZE]; + if (newBlock) + { + pixelDataList.push_back(newBlock); + cinfo->dest->next_output_byte = newBlock; + cinfo->dest->free_in_buffer = IJGE8_BLOCKSIZE; + } + else + { + cinfo->dest->next_output_byte = NULL; + cinfo->dest->free_in_buffer = 0; + } +} + +int DJCompressIJG8Bit::emptyOutputBuffer(jpeg_compress_struct *cinfo) +{ + bytesInLastBlock = 0; + unsigned char *newBlock = new unsigned char[IJGE8_BLOCKSIZE]; + if (newBlock) + { + pixelDataList.push_back(newBlock); + cinfo->dest->next_output_byte = newBlock; + cinfo->dest->free_in_buffer = IJGE8_BLOCKSIZE; + } + else + { + // should never happen + cinfo->dest->next_output_byte = NULL; + cinfo->dest->free_in_buffer = 0; + OF_ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0xFF); + } + return TRUE; +} + + +void DJCompressIJG8Bit::termDestination(jpeg_compress_struct *cinfo) +{ + bytesInLastBlock = IJGE8_BLOCKSIZE - cinfo->dest->free_in_buffer; +} + +void DJCompressIJG8Bit::cleanup() +{ + OFListIterator(unsigned char *) first = pixelDataList.begin(); + OFListIterator(unsigned char *) last = pixelDataList.end(); + while (first != last) + { + delete[] *first; + first = pixelDataList.erase(first); + } + bytesInLastBlock = 0; +} + +void DJCompressIJG8Bit::emitMessage(void *arg, int msg_level) const +{ + jpeg_common_struct *cinfo = OFreinterpret_cast(jpeg_common_struct*, arg); + + // This is how we map the message levels: + // -1 - 0: Warning (could also be errors, but no way to find out) + // 1 : Debug + // Everything else: Trace (No point in splitting this further up) + OFLogger::LogLevel level; + + switch (msg_level) + { + case -1: + case 0: + level = OFLogger::WARN_LOG_LEVEL; + break; + case 1: + level = OFLogger::DEBUG_LOG_LEVEL; + break; + default: + level = OFLogger::TRACE_LOG_LEVEL; + break; + } + + if (cinfo && DCM_dcmjpegLogger.isEnabledFor(level)) + { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo, buffer); /* Create the message */ + DCM_dcmjpegLogger.forcedLog(level, buffer, __FILE__, __LINE__); + } +} diff --git a/dcmjpeg/libsrc/djencbas.cc b/dcmjpeg/libsrc/djencbas.cc new file mode 100644 index 00000000..e6d46155 --- /dev/null +++ b/dcmjpeg/libsrc/djencbas.cc @@ -0,0 +1,81 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Baseline (lossy, 8-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djencbas.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" +#include "dcmtk/dcmjpeg/djeijg8.h" + + +DJEncoderBaseline::DJEncoderBaseline() +: DJCodecEncoder() +{ +} + + +DJEncoderBaseline::~DJEncoderBaseline() +{ +} + + +E_TransferSyntax DJEncoderBaseline::supportedTransferSyntax() const +{ + return EXS_JPEGProcess1; +} + + +OFBool DJEncoderBaseline::isLosslessProcess() const +{ + return OFFalse; +} + + +void DJEncoderBaseline::createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter * /* cp */, + Uint8 /* bitsPerSample */ , + double ratio, + OFString& derivationDescription) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + char buf[64]; + + derivationDescription = "Lossy compression with JPEG baseline, IJG quality factor "; + sprintf(buf, "%u", rp->getQuality()); + derivationDescription += buf; + derivationDescription += ", compression ratio "; + appendCompressionRatio(derivationDescription, ratio); +} + + +DJEncoder *DJEncoderBaseline::createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 /* bitsPerSample */) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + DJCompressIJG8Bit *result = new DJCompressIJG8Bit(*cp, EJM_baseline, OFstatic_cast(Uint8, rp->getQuality())); + + return result; +} diff --git a/dcmjpeg/libsrc/djencext.cc b/dcmjpeg/libsrc/djencext.cc new file mode 100644 index 00000000..172bcbfa --- /dev/null +++ b/dcmjpeg/libsrc/djencext.cc @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Extended Sequential (lossy, 8/12-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djencext.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" +#include "dcmtk/dcmjpeg/djeijg8.h" +#include "dcmtk/dcmjpeg/djeijg12.h" + + +DJEncoderExtended::DJEncoderExtended() +: DJCodecEncoder() +{ +} + + +DJEncoderExtended::~DJEncoderExtended() +{ +} + + +E_TransferSyntax DJEncoderExtended::supportedTransferSyntax() const +{ + return EXS_JPEGProcess2_4; +} + + +OFBool DJEncoderExtended::isLosslessProcess() const +{ + return OFFalse; +} + +void DJEncoderExtended::createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter * /* cp */ , + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + char buf[64]; + + derivationDescription = "Lossy compression with JPEG extended sequential "; + if (bitsPerSample > 8) derivationDescription += "12 bit"; else derivationDescription += "8 bit"; + derivationDescription += ", IJG quality factor "; + sprintf(buf, "%u", rp->getQuality()); + derivationDescription += buf; + derivationDescription += ", compression ratio "; + appendCompressionRatio(derivationDescription, ratio); +} + + +DJEncoder *DJEncoderExtended::createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + DJEncoder *result = NULL; + if (bitsPerSample > 8) + result = new DJCompressIJG12Bit(*cp, EJM_sequential, OFstatic_cast(Uint8, rp->getQuality())); + else + result = new DJCompressIJG8Bit(*cp, EJM_sequential, OFstatic_cast(Uint8, rp->getQuality())); + return result; +} diff --git a/dcmjpeg/libsrc/djenclol.cc b/dcmjpeg/libsrc/djenclol.cc new file mode 100644 index 00000000..c90ba955 --- /dev/null +++ b/dcmjpeg/libsrc/djenclol.cc @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Lossless (8/12/16-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djenclol.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrplol.h" +#include "dcmtk/dcmjpeg/djeijg8.h" +#include "dcmtk/dcmjpeg/djeijg12.h" +#include "dcmtk/dcmjpeg/djeijg16.h" + + +DJEncoderLossless::DJEncoderLossless() +: DJCodecEncoder() +{ +} + + +DJEncoderLossless::~DJEncoderLossless() +{ +} + + +E_TransferSyntax DJEncoderLossless::supportedTransferSyntax() const +{ + return EXS_JPEGProcess14; +} + + +OFBool DJEncoderLossless::isLosslessProcess() const +{ + return OFTrue; +} + + +void DJEncoderLossless::createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 /* bitsPerSample */ , + double ratio, + OFString& derivationDescription) const +{ + DJ_RPLossless defaultRP; + const DJ_RPLossless *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossless*, toRepParam) : &defaultRP ; + char buf[64]; + + if (cp->getTrueLosslessMode()) + derivationDescription = "Lossless JPEG compression, selection value "; + else + derivationDescription = "Pseudo-Lossless JPEG compression, selection value "; + sprintf(buf, "%u", rp->getPrediction()); + derivationDescription += buf; + derivationDescription += ", point transform "; + sprintf(buf, "%u", rp->getPointTransformation()); + derivationDescription += buf; + derivationDescription += ", compression ratio "; + appendCompressionRatio(derivationDescription, ratio); +} + + +DJEncoder *DJEncoderLossless::createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const +{ + DJ_RPLossless defaultRP; + const DJ_RPLossless *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossless*, toRepParam) : &defaultRP ; + DJEncoder *result = NULL; + if (bitsPerSample > 12) + result = new DJCompressIJG16Bit(*cp, EJM_lossless, rp->getPrediction(), rp->getPointTransformation()); + else if (bitsPerSample > 8) + result = new DJCompressIJG12Bit(*cp, EJM_lossless, rp->getPrediction(), rp->getPointTransformation()); + else + result = new DJCompressIJG8Bit(*cp, EJM_lossless, rp->getPrediction(), rp->getPointTransformation()); + return result; +} diff --git a/dcmjpeg/libsrc/djencode.cc b/dcmjpeg/libsrc/djencode.cc new file mode 100644 index 00000000..b8c9150c --- /dev/null +++ b/dcmjpeg/libsrc/djencode.cc @@ -0,0 +1,161 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: singleton class that registers encoders for all supported JPEG processes. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djencode.h" + +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecStruct */ +#include "dcmtk/dcmjpeg/djencbas.h" +#include "dcmtk/dcmjpeg/djencext.h" +#include "dcmtk/dcmjpeg/djencsps.h" +#include "dcmtk/dcmjpeg/djencpro.h" +#include "dcmtk/dcmjpeg/djencsv1.h" +#include "dcmtk/dcmjpeg/djenclol.h" +#include "dcmtk/dcmjpeg/djcparam.h" + +// initialization of static members +OFBool DJEncoderRegistration::registered = OFFalse; +DJCodecParameter *DJEncoderRegistration::cp = NULL; +DJEncoderBaseline *DJEncoderRegistration::encbas = NULL; +DJEncoderExtended *DJEncoderRegistration::encext = NULL; +DJEncoderSpectralSelection *DJEncoderRegistration::encsps = NULL; +DJEncoderProgressive *DJEncoderRegistration::encpro = NULL; +DJEncoderP14SV1 *DJEncoderRegistration::encsv1 = NULL; +DJEncoderLossless *DJEncoderRegistration::enclol = NULL; + +void DJEncoderRegistration::registerCodecs( + E_CompressionColorSpaceConversion pCompressionCSConversion, + E_UIDCreation pCreateSOPInstanceUID, + OFBool pOptimizeHuffman, + int pSmoothingFactor, + int pForcedBitDepth, + Uint32 pFragmentSize, + OFBool pCreateOffsetTable, + E_SubSampling pSampleFactors, + OFBool pWriteYBR422, + OFBool pConvertToSC, + unsigned long pWindowType, + unsigned long pWindowParameter, + double pVoiCenter, + double pVoiWidth, + unsigned long pRoiLeft, + unsigned long pRoiTop, + unsigned long pRoiWidth, + unsigned long pRoiHeight, + OFBool pUsePixelValues, + OFBool pUseModalityRescale, + OFBool pAcceptWrongPaletteTags, + OFBool pAcrNemaCompatibility, + OFBool pRealLossless) +{ + if (! registered) + { + cp = new DJCodecParameter( + pCompressionCSConversion, + EDC_photometricInterpretation, // not relevant, used for decompression only + pCreateSOPInstanceUID, + EPC_default, // not relevant, used for decompression only + OFFalse, // not relevant, used for decompression only + OFFalse, // not relevant, used for decompression only + OFFalse, // not relevant, used for decompression only + pOptimizeHuffman, + pSmoothingFactor, + pForcedBitDepth, + pFragmentSize, + pCreateOffsetTable, + pSampleFactors, + pWriteYBR422, + pConvertToSC, + pWindowType, + pWindowParameter, + pVoiCenter, + pVoiWidth, + pRoiLeft, + pRoiTop, + pRoiWidth, + pRoiHeight, + pUsePixelValues, + pUseModalityRescale, + pAcceptWrongPaletteTags, + pAcrNemaCompatibility, + pRealLossless); + if (cp) + { + // baseline JPEG + encbas = new DJEncoderBaseline(); + if (encbas) DcmCodecList::registerCodec(encbas, NULL, cp); + + // extended JPEG + encext = new DJEncoderExtended(); + if (encext) DcmCodecList::registerCodec(encext, NULL, cp); + + // spectral selection JPEG + encsps = new DJEncoderSpectralSelection(); + if (encsps) DcmCodecList::registerCodec(encsps, NULL, cp); + + // progressive JPEG + encpro = new DJEncoderProgressive(); + if (encpro) DcmCodecList::registerCodec(encpro, NULL, cp); + + // lossless SV1 JPEG + encsv1 = new DJEncoderP14SV1(); + if (encsv1) DcmCodecList::registerCodec(encsv1, NULL, cp); + + // lossless JPEG + enclol = new DJEncoderLossless(); + if (enclol) DcmCodecList::registerCodec(enclol, NULL, cp); + + registered = OFTrue; + } + } +} + +void DJEncoderRegistration::cleanup() +{ + if (registered) + { + DcmCodecList::deregisterCodec(encbas); + delete encbas; + DcmCodecList::deregisterCodec(encext); + delete encext; + DcmCodecList::deregisterCodec(encsps); + delete encsps; + DcmCodecList::deregisterCodec(encpro); + delete encpro; + DcmCodecList::deregisterCodec(encsv1); + delete encsv1; + DcmCodecList::deregisterCodec(enclol); + delete enclol; + delete cp; + registered = OFFalse; +#ifdef DEBUG + // not needed but useful for debugging purposes + encbas = NULL; + encext = NULL; + encsps = NULL; + encpro = NULL; + encsv1 = NULL; + enclol = NULL; + cp = NULL; +#endif + + } +} diff --git a/dcmjpeg/libsrc/djencpro.cc b/dcmjpeg/libsrc/djencpro.cc new file mode 100644 index 00000000..0d3a1109 --- /dev/null +++ b/dcmjpeg/libsrc/djencpro.cc @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Progressive (lossy, 8/12-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djencpro.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" +#include "dcmtk/dcmjpeg/djeijg8.h" +#include "dcmtk/dcmjpeg/djeijg12.h" + + +DJEncoderProgressive::DJEncoderProgressive() +: DJCodecEncoder() +{ +} + + +DJEncoderProgressive::~DJEncoderProgressive() +{ +} + + +E_TransferSyntax DJEncoderProgressive::supportedTransferSyntax() const +{ + return EXS_JPEGProcess10_12; +} + + +OFBool DJEncoderProgressive::isLosslessProcess() const +{ + return OFFalse; +} + + +void DJEncoderProgressive::createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter * /* cp */ , + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + char buf[64]; + + derivationDescription = "Lossy compression with JPEG full progression "; + if (bitsPerSample > 8) derivationDescription += "12 bit"; else derivationDescription += "8 bit"; + derivationDescription += ", IJG quality factor "; + sprintf(buf, "%u", rp->getQuality()); + derivationDescription += buf; + derivationDescription += ", compression ratio "; + appendCompressionRatio(derivationDescription, ratio); +} + + +DJEncoder *DJEncoderProgressive::createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + DJEncoder *result = NULL; + if (bitsPerSample > 8) + result = new DJCompressIJG12Bit(*cp, EJM_progressive, OFstatic_cast(Uint8, rp->getQuality())); + else result = new DJCompressIJG8Bit(*cp, EJM_progressive, OFstatic_cast(Uint8, rp->getQuality())); + return result; +} diff --git a/dcmjpeg/libsrc/djencsps.cc b/dcmjpeg/libsrc/djencsps.cc new file mode 100644 index 00000000..44d34b40 --- /dev/null +++ b/dcmjpeg/libsrc/djencsps.cc @@ -0,0 +1,87 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg + * + * Purpose: Codec class for encoding JPEG Spectral Selection (lossy, 8/12-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djencsps.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrploss.h" +#include "dcmtk/dcmjpeg/djeijg8.h" +#include "dcmtk/dcmjpeg/djeijg12.h" + + +DJEncoderSpectralSelection::DJEncoderSpectralSelection() +: DJCodecEncoder() +{ +} + + +DJEncoderSpectralSelection::~DJEncoderSpectralSelection() +{ +} + + +E_TransferSyntax DJEncoderSpectralSelection::supportedTransferSyntax() const +{ + return EXS_JPEGProcess6_8; +} + + +OFBool DJEncoderSpectralSelection::isLosslessProcess() const +{ + return OFFalse; +} + + +void DJEncoderSpectralSelection::createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter * /* cp */ , + Uint8 bitsPerSample, + double ratio, + OFString& derivationDescription) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + char buf[64]; + + derivationDescription = "Lossy compression with JPEG spectral selection "; + if (bitsPerSample > 8) derivationDescription += "12 bit"; else derivationDescription += "8 bit"; + derivationDescription += ", IJG quality factor "; + sprintf(buf, "%u", rp->getQuality()); + derivationDescription += buf; + derivationDescription += ", compression ratio "; + appendCompressionRatio(derivationDescription, ratio); +} + + +DJEncoder *DJEncoderSpectralSelection::createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const +{ + DJ_RPLossy defaultRP; + const DJ_RPLossy *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossy*, toRepParam) : &defaultRP ; + DJEncoder *result = NULL; + + if (bitsPerSample > 8) + result = new DJCompressIJG12Bit(*cp, EJM_spectralSelection, OFstatic_cast(Uint8, rp->getQuality())); + else result = new DJCompressIJG8Bit(*cp, EJM_spectralSelection, OFstatic_cast(Uint8, rp->getQuality())); + return result; +} diff --git a/dcmjpeg/libsrc/djencsv1.cc b/dcmjpeg/libsrc/djencsv1.cc new file mode 100644 index 00000000..548ded48 --- /dev/null +++ b/dcmjpeg/libsrc/djencsv1.cc @@ -0,0 +1,92 @@ +/* + * + * Copyright (C) 2001-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Marco Eichelberg, Norbert Olges + * + * Purpose: Codec class for encoding JPEG Lossless Selection Value 1 (8/12/16-bit) + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djencsv1.h" +#include "dcmtk/dcmjpeg/djcparam.h" +#include "dcmtk/dcmjpeg/djrplol.h" +#include "dcmtk/dcmjpeg/djeijg8.h" +#include "dcmtk/dcmjpeg/djeijg12.h" +#include "dcmtk/dcmjpeg/djeijg16.h" + + +DJEncoderP14SV1::DJEncoderP14SV1() +: DJCodecEncoder() +{ +} + + +DJEncoderP14SV1::~DJEncoderP14SV1() +{ +} + + +E_TransferSyntax DJEncoderP14SV1::supportedTransferSyntax() const +{ + return EXS_JPEGProcess14SV1; +} + + +OFBool DJEncoderP14SV1::isLosslessProcess() const +{ + return OFTrue; +} + + +void DJEncoderP14SV1::createDerivationDescription( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 /* bitsPerSample */, + double ratio, + OFString& derivationDescription) const +{ + DJ_RPLossless defaultRP; + const DJ_RPLossless *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossless*, toRepParam) : &defaultRP ; + char buf[64]; + + if (cp->getTrueLosslessMode()) + derivationDescription = "Lossless JPEG compression, selection value 1, point transform "; + else + derivationDescription = "Pseudo-Lossless JPEG compression, selection value 1, point transform "; + sprintf(buf, "%u", rp->getPointTransformation()); + derivationDescription += buf; + derivationDescription += ", compression ratio "; + appendCompressionRatio(derivationDescription, ratio); +} + + +DJEncoder *DJEncoderP14SV1::createEncoderInstance( + const DcmRepresentationParameter * toRepParam, + const DJCodecParameter *cp, + Uint8 bitsPerSample) const +{ + DJ_RPLossless defaultRP; + const DJ_RPLossless *rp = toRepParam ? OFreinterpret_cast(const DJ_RPLossless*, toRepParam) : &defaultRP ; + DJEncoder *result = NULL; + // prediction/selection value is always 1 for this transfer syntax + if (bitsPerSample > 12) + result = new DJCompressIJG16Bit(*cp, EJM_lossless, 1, rp->getPointTransformation()); + else if (bitsPerSample > 8) + result = new DJCompressIJG12Bit(*cp, EJM_lossless, 1, rp->getPointTransformation()); + else + result = new DJCompressIJG8Bit(*cp, EJM_lossless, 1, rp->getPointTransformation()); + return result; +} diff --git a/dcmjpeg/libsrc/djrplol.cc b/dcmjpeg/libsrc/djrplol.cc new file mode 100644 index 00000000..3891f14e --- /dev/null +++ b/dcmjpeg/libsrc/djrplol.cc @@ -0,0 +1,67 @@ +/* + * + * Copyright (C) 1997-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: representation parameter for lossless JPEG + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djrplol.h" + + +DJ_RPLossless::DJ_RPLossless(int aPrediction, int aPt) +: DcmRepresentationParameter() +, prediction(aPrediction) +, pt(aPt) +{ +} + +DJ_RPLossless::DJ_RPLossless(const DJ_RPLossless& arg) +: DcmRepresentationParameter(arg) +, prediction(arg.prediction) +, pt(arg.pt) +{ +} + +DJ_RPLossless::~DJ_RPLossless() +{ +} + +DcmRepresentationParameter *DJ_RPLossless::clone() const +{ + return new DJ_RPLossless(*this); +} + +const char *DJ_RPLossless::className() const +{ + return "DJ_RPLossless"; +} + +OFBool DJ_RPLossless::operator==(const DcmRepresentationParameter &arg) const +{ + const char *argname = arg.className(); + if (argname) + { + OFString argstring(argname); + if (argstring == className()) + { + const DJ_RPLossless& argll = OFstatic_cast(const DJ_RPLossless&, arg); + if ((prediction == argll.prediction) && (pt == argll.pt)) return OFTrue; + } + } + return OFFalse; +} diff --git a/dcmjpeg/libsrc/djrploss.cc b/dcmjpeg/libsrc/djrploss.cc new file mode 100644 index 00000000..b591f93c --- /dev/null +++ b/dcmjpeg/libsrc/djrploss.cc @@ -0,0 +1,65 @@ +/* + * + * Copyright (C) 1997-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: representation parameter for lossy JPEG + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djrploss.h" + + +DJ_RPLossy::DJ_RPLossy(int aQuality) +: DcmRepresentationParameter() +, quality(aQuality) +{ +} + +DJ_RPLossy::DJ_RPLossy(const DJ_RPLossy& arg) +: DcmRepresentationParameter(arg) +, quality(arg.quality) +{ +} + +DJ_RPLossy::~DJ_RPLossy() +{ +} + +DcmRepresentationParameter *DJ_RPLossy::clone() const +{ + return new DJ_RPLossy(*this); +} + +const char *DJ_RPLossy::className() const +{ + return "DJ_RPLossy"; +} + +OFBool DJ_RPLossy::operator==(const DcmRepresentationParameter &arg) const +{ + const char *argname = arg.className(); + if (argname) + { + OFString argstring(argname); + if (argstring == className()) + { + const DJ_RPLossy& argll = OFstatic_cast(const DJ_RPLossy&, arg); + if (quality == argll.quality) return OFTrue; + } + } + return OFFalse; +} diff --git a/dcmjpeg/libsrc/djutils.cc b/dcmjpeg/libsrc/djutils.cc new file mode 100644 index 00000000..968b9eae --- /dev/null +++ b/dcmjpeg/libsrc/djutils.cc @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpeg + * + * Author: Norbert Olges, Marco Eichelberg + * + * Purpose: Various helper methods for the JPEG encoder + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpeg/djutils.h" +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcitem.h" /* for class DcmItem */ + +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +OFLogger DCM_dcmjpegLogger = OFLog::getLogger("dcmtk.dcmjpeg"); + +makeOFConditionConst(EJ_Suspension, OFM_dcmjpeg, 1, OF_error, "IJG codec suspension return" ); +makeOFConditionConst(EJ_IJG8_FrameBufferTooSmall, OFM_dcmjpeg, 2, OF_error, "Buffer for decompressed image (8 bits/sample) too small" ); +makeOFConditionConst(EJ_IJG12_FrameBufferTooSmall, OFM_dcmjpeg, 3, OF_error, "Buffer for decompressed image (12 bits/sample) too small" ); +makeOFConditionConst(EJ_IJG16_FrameBufferTooSmall, OFM_dcmjpeg, 4, OF_error, "Buffer for decompressed image (16 bits/sample) too small" ); +makeOFConditionConst(EJ_UnsupportedPhotometricInterpretation, OFM_dcmjpeg, 5, OF_error, "Codec does not support this PhotometricInterpretation" ); +makeOFConditionConst(EJ_UnsupportedColorConversion, OFM_dcmjpeg, 6, OF_error, "Codec does not support this kind of color conversion" ); +makeOFConditionConst(EJ_UnsupportedBitDepth, OFM_dcmjpeg, 7, OF_error, "Unsupported bit depth for this codec" ); + +EP_Interpretation DcmJpegHelper::getPhotometricInterpretation(DcmItem *item) +{ + if (item) + { + OFString photometric; + if (item->findAndGetOFString(DCM_PhotometricInterpretation, photometric).good() && !photometric.empty()) + { + const char *c = photometric.c_str(); // guaranteed to be zero-terminated + char cp[17]; // legal CS cannot be larger than 16 characters plus 0 byte + int i=0; // current character index + unsigned char cur; // current character + while (*c && (i<16)) + { + cur = OFstatic_cast(unsigned char, *c); + if (isalpha(cur)) cp[i++] = OFstatic_cast(char, toupper(cur)); + else if (isdigit(cur)) cp[i++] = cur; + c++; + } + cp[i] = 0; // write terminating zero + photometric = cp; // copy back into OFString + + // now browse PhotometricInterpretationNames + i = 0; + while (PhotometricInterpretationNames[i].Name) + { + if (photometric == PhotometricInterpretationNames[i].Name) return PhotometricInterpretationNames[i].Type; + i++; + } + return EPI_Unknown; + } + } + return EPI_Missing; +} + +void DcmJpegHelper::fixPadding( + Uint8 *buffer, + Uint32 bufSize) +{ + if (buffer && (bufSize > 0)) + { + // first write a zero pad byte after the end of the JPEG bitstream + buffer[bufSize - 1] = 0; + +#ifndef DISABLE_FF_JPEG_BITSTREAM_PADDING + // look for the EOI marker + if ((bufSize > 2) && (buffer[bufSize-3] == 0xFF) && (buffer[bufSize-2] == 0xD9)) + { + // we now have ff/d9/00 at the end of the JPEG bitstream, + // i.e. an end of image (EOI) marker followed by a pad byte. + // Replace this with ff/ff/d9, which is an "extended" EOI marker + // ending on an even byte boundary. + buffer[bufSize-2] = 0xFF; + buffer[bufSize-1] = 0xD9; + } + } +#endif + + return; +} diff --git a/dcmjpeg/tests/Makefile.in b/dcmjpeg/tests/Makefile.in new file mode 100644 index 00000000..0433c72e --- /dev/null +++ b/dcmjpeg/tests/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmjpeg/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +check: + +check-exhaustive: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) + +dependencies: diff --git a/dcmjpls/CMakeLists.txt b/dcmjpls/CMakeLists.txt new file mode 100644 index 00000000..c8a05a7a --- /dev/null +++ b/dcmjpls/CMakeLists.txt @@ -0,0 +1,7 @@ +# declare project +project(dcmjpls) + +# recurse into subdirectories +foreach(SUBDIR libsrc libcharls apps include) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmjpls/Makefile.in b/dcmjpls/Makefile.in new file mode 100644 index 00000000..aadfd734 --- /dev/null +++ b/dcmjpls/Makefile.in @@ -0,0 +1,102 @@ +# +# Makefile for dcmjpls +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libcharls && $(MAKE) ARCH="$(ARCH)" all) + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libcharls && $(MAKE) ARCH="$(ARCH)" install) + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libcharls && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libcharls && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libcharls && touch $(DEP) && $(MAKE) dependencies) + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) +# (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmjpls/apps/CMakeLists.txt b/dcmjpls/apps/CMakeLists.txt new file mode 100644 index 00000000..2a9a4526 --- /dev/null +++ b/dcmjpls/apps/CMakeLists.txt @@ -0,0 +1,12 @@ +# declare additional include directories +include_directories("${dcmjpls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR}) + +# declare executables +foreach(PROGRAM dcmcjpls dcmdjpls dcml2pnm) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcmcjpls dcmdjpls dcml2pnm) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmjpls charls dcmimage dcmimgle dcmdata oflog ofstd ofstd) +endforeach() diff --git a/dcmjpls/apps/Makefile.dep b/dcmjpls/apps/Makefile.dep new file mode 100644 index 00000000..3877ad97 --- /dev/null +++ b/dcmjpls/apps/Makefile.dep @@ -0,0 +1,404 @@ +dcmcjpls.o: dcmcjpls.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimage/include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimage/include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmjpls/djlsutil.h ../include/dcmtk/dcmjpls/dldefine.h \ + ../include/dcmtk/dcmjpls/djencode.h ../include/dcmtk/dcmjpls/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../include/dcmtk/dcmjpls/djrparam.h +dcmdjpls.o: dcmdjpls.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimage/include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimage/include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmjpls/djlsutil.h ../include/dcmtk/dcmjpls/dldefine.h \ + ../include/dcmtk/dcmjpls/djdecode.h +dcml2pnm.o: dcml2pnm.cc ../../dcmimage/apps/dcm2pnm.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcrledrg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/digsdfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diciefn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dicielut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didislut.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimage/include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimage/include/dcmtk/dcmimage/dicdefin.h \ + ../include/dcmtk/dcmjpls/djdecode.h ../include/dcmtk/dcmjpls/djlsutil.h \ + ../include/dcmtk/dcmjpls/dldefine.h \ + ../../dcmimage/include/dcmtk/dcmimage/dipitiff.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \ + ../../dcmimage/include/dcmtk/dcmimage/dipipng.h diff --git a/dcmjpls/apps/Makefile.in b/dcmjpls/apps/Makefile.in new file mode 100644 index 00000000..33ef2597 --- /dev/null +++ b/dcmjpls/apps/Makefile.in @@ -0,0 +1,88 @@ +# +# Makefile for dcmjpls/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir =$(top_srcdir)/../ofstd +ofstdinc = -I$(ofstddir)/include +ofstdlibdir = -L$(ofstddir)/libsrc +ofstdlib = -lofstd + +oflogdir = $(top_srcdir)/../oflog +ofloginc = -I$(oflogdir)/include +ofloglibdir = -L$(oflogdir)/libsrc +ofloglib = -loflog + +dcmdatadir = $(top_srcdir)/../dcmdata +dcmdatainc = -I$(dcmdatadir)/include +dcmdatalibdir = -L$(dcmdatadir)/libsrc +dcmdatalib = -ldcmdata + +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmimgleinc = -I$(dcmimgledir)/include +dcmimglelibdir = -L$(dcmimgledir)/libsrc +dcmimglelib = -ldcmimgle + +dcmimagedir = $(top_srcdir)/../dcmimage +dcmimageinc = -I$(dcmimagedir)/include +dcmimagelibdir = -L$(dcmimagedir)/libsrc +dcmimagelib = -ldcmimage + +dcmjplsdir = $(top_srcdir)/../dcmjpls +dcmjplsinc = -I$(dcmjplsdir)/include +dcmjplslibdir = -L$(dcmjplsdir)/libsrc +dcmjplslib = -ldcmjpls + +libcharlsdir = $(dcmjplsdir) +libcharlslibdir = -L$(dcmjplsdir)/libcharls +libcharlslib = -lcharls + +LOCALINCLUDES = $(dcmjplsinc) $(ofstdinc) $(ofloginc) $(dcmdatainc) $(dcmimageinc) $(dcmimgleinc) +LIBDIRS = -L$(top_srcdir)/libsrc $(dcmjplslibdir) $(libcharlslibdir) $(dcmimagelibdir) \ + $(dcmimglelibdir) $(dcmdatalibdir) $(ofloglibdir) $(ofstdlibdir) +LOCALLIBS = $(dcmjplslib) $(dcmimagelib) $(dcmimglelib) $(dcmdatalib) $(ofloglib) $(ofstdlib) \ + $(libcharlslib) $(TIFFLIBS) $(PNGLIBS) $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +objs = dcmdjpls.o dcmcjpls.o dcml2pnm.o +progs = dcmdjpls dcmcjpls dcml2pnm + + +all: $(progs) + +dcmdjpls: dcmdjpls.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmcjpls: dcmcjpls.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcml2pnm: dcml2pnm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmjpls/apps/dcmcjpls.cc b/dcmjpls/apps/dcmcjpls.cc new file mode 100644 index 00000000..9e958d53 --- /dev/null +++ b/dcmjpls/apps/dcmcjpls.cc @@ -0,0 +1,501 @@ +/* + * + * Copyright (C) 2007-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmcjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: Compress DICOM file with JPEG-LS transfer syntax + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ +#include "dcmtk/dcmjpls/djlsutil.h" /* for dcmjpls typedefs */ +#include "dcmtk/dcmjpls/djencode.h" /* for class DJLSEncoderRegistration */ +#include "dcmtk/dcmjpls/djrparam.h" /* for class DJLSRepresentationParameter */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#ifdef USE_LICENSE_FILE +#include "oflice.h" +#endif + +#ifndef OFFIS_CONSOLE_APPLICATION +#define OFFIS_CONSOLE_APPLICATION "dcmcjpls" +#endif + +static OFLogger dcmcjplsLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +#define SHORTCOL 3 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + // input options + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + + // JPEG-LS encoding options + E_TransferSyntax opt_oxfer = EXS_JPEGLSLossless; + OFBool opt_useLosslessProcess = OFTrue; + OFBool opt_useFFpadding = OFTrue; + + OFCmdUnsignedInt opt_t1 = 0; + OFCmdUnsignedInt opt_t2 = 0; + OFCmdUnsignedInt opt_t3 = 0; + OFCmdUnsignedInt opt_reset = 0; + + // JPEG-LS options + OFCmdUnsignedInt opt_nearlossless_deviation = 2; + OFBool opt_prefer_cooked = OFFalse; + DJLSCodecParameter::interleaveMode opt_interleaveMode = DJLSCodecParameter::interleaveLine; + + // encapsulated pixel data encoding options + OFCmdUnsignedInt opt_fragmentSize = 0; // 0=unlimited + OFBool opt_createOffsetTable = OFTrue; + JLS_UIDCreation opt_uidcreation = EJLSUC_default; + OFBool opt_secondarycapture = OFFalse; + + // output options + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + +#ifdef USE_LICENSE_FILE +LICENSE_FILE_DECLARATIONS +#endif + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encode DICOM file to JPEG-LS transfer syntax", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + +#ifdef USE_LICENSE_FILE +LICENSE_FILE_DECLARE_COMMAND_LINE_OPTIONS +#endif + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("JPEG-LS encoding options:"); + cmd.addSubGroup("JPEG-LS process:"); + cmd.addOption("--encode-lossless", "+el", "encode JPEG-LS lossless (default)"); + cmd.addOption("--encode-nearlossless", "+en", "encode JPEG-LS TS near-lossless (NEAR: 2)"); + cmd.addSubGroup("JPEG-LS bit rate (near-lossless only):"); + cmd.addOption("--max-deviation", "+md", 1, "[d]eviation: integer (default: 2)", + "defines maximum deviation for an encoded pixel"); + cmd.addSubGroup("lossless compression:"); + cmd.addOption("--prefer-raw", "+pr", "prefer raw encoder mode (default)"); + cmd.addOption("--prefer-cooked", "+pc", "prefer cooked encoder mode "); + + cmd.addSubGroup("JPEG-LS compression:"); + cmd.addOption("--threshold1", "+t1", 1, "[t]hreshhold: integer (default for 8 bpp: 3)", + "set JPEG-LS encoding parameter threshold 1"); + cmd.addOption("--threshold2", "+t2", 1, "[t]hreshhold: integer (default for 8 bpp: 7)", + "set JPEG-LS encoding parameter threshold 2"); + cmd.addOption("--threshold3", "+t3", 1, "[t]hreshhold: integer (default for 8 bpp: 21)", + "set JPEG-LS encoding parameter threshold 3"); + cmd.addOption("--reset", "+rs", 1, "[r]eset: integer (default: 64)", + "set JPEG-LS encoding parameter reset"); + cmd.addSubGroup("JPEG-LS interleave:"); + cmd.addOption("--interleave-line", "+il", "force line-interleaved JPEG-LS images (default)"); + cmd.addOption("--interleave-sample", "+is", "force sample-interleaved JPEG-LS images"); + cmd.addOption("--interleave-none", "+in", "force uninterleaved JPEG-LS images"); + cmd.addOption("--interleave-default", "+iv", "use the fastest possible interleave mode"); + cmd.addSubGroup("JPEG-LS padding of odd-length bitstreams:"); + cmd.addOption("--padding-standard", "+ps", "pad with extended EOI marker (default)"); + cmd.addOption("--padding-zero", "+pz", "pad with zero byte (non-standard)"); + + cmd.addGroup("encapsulated pixel data encoding options:"); + cmd.addSubGroup("pixel data fragmentation:"); + cmd.addOption("--fragment-per-frame", "+ff", "encode each frame as one fragment (default)"); + cmd.addOption("--fragment-size", "+fs", 1, "[s]ize: integer", + "limit fragment size to s kbytes"); + cmd.addSubGroup("basic offset table encoding:"); + cmd.addOption("--offset-table-create", "+ot", "create offset table (default)"); + cmd.addOption("--offset-table-empty", "-ot", "leave offset table empty"); + cmd.addSubGroup("SOP Class UID:"); + cmd.addOption("--class-default", "+cd", "keep SOP Class UID (default)"); + cmd.addOption("--class-sc", "+cs", "convert to Secondary Capture Image\n(implies --uid-always)"); + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-default", "+ud", "assign new UID if lossy compression (default)"); + cmd.addOption("--uid-always", "+ua", "always assign new UID"); + cmd.addOption("--uid-never", "+un", "never assign new UID"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding:"); + cmd.addOption("--padding-retain", "-p=", "do not change padding (default)"); + cmd.addOption("--padding-off", "-p", "no padding"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i byte"); + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + COUT << "- " << DJLSEncoderRegistration::getLibraryVersionString() << OFendl; + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + // general options + OFLog::configureFromCommandLine(cmd, app); + +#ifdef USE_LICENSE_FILE +LICENSE_FILE_EVALUATE_COMMAND_LINE_OPTIONS +#endif + + // input options + // input file format + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + // input transfer syntax + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + // JPEG-LS encoding options + // JPEG-LS process options + cmd.beginOptionBlock(); + if (cmd.findOption("--encode-lossless")) + { + opt_oxfer = EXS_JPEGLSLossless; + opt_useLosslessProcess = OFTrue; + } + if (cmd.findOption("--encode-nearlossless")) + { + opt_oxfer = EXS_JPEGLSLossy; + opt_useLosslessProcess = OFFalse; + opt_nearlossless_deviation = 2; // factor NEAR set to "2", this corresponds to the max. deviation of a pixel + } + cmd.endOptionBlock(); + + // JPEG-LS bit rate options + if (cmd.findOption("--max-deviation")) + { + app.checkConflict("--max-deviation", "--encode-lossless", opt_oxfer == EXS_JPEGLSLossless); + app.checkValue(cmd.getValueAndCheckMin(opt_nearlossless_deviation, 1)); + } + + // lossless compression options + cmd.beginOptionBlock(); + if (cmd.findOption("--prefer-raw")) + { + opt_prefer_cooked = OFFalse; + } + if (cmd.findOption("--prefer-cooked")) + { + opt_prefer_cooked = OFTrue; + } + cmd.endOptionBlock(); + + // thresholds and reset + cmd.beginOptionBlock(); + if (cmd.findOption("--threshold1")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_t1, OFstatic_cast(OFCmdUnsignedInt, 1))); + } + if (cmd.findOption("--threshold2")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_t2, OFstatic_cast(OFCmdUnsignedInt, 1))); + } + if (cmd.findOption("--threshold3")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_t3, OFstatic_cast(OFCmdUnsignedInt, 1))); + } + if (cmd.findOption("--reset")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_reset, OFstatic_cast(OFCmdUnsignedInt, 1))); + } + cmd.endOptionBlock(); + + // interleave mode + cmd.beginOptionBlock(); + if (cmd.findOption("--interleave-default")) + { + opt_interleaveMode = DJLSCodecParameter::interleaveDefault; + } + if (cmd.findOption("--interleave-sample")) + { + opt_interleaveMode = DJLSCodecParameter::interleaveSample; + } + if (cmd.findOption("--interleave-line")) + { + opt_interleaveMode = DJLSCodecParameter::interleaveLine; + } + if (cmd.findOption("--interleave-none")) + { + opt_interleaveMode = DJLSCodecParameter::interleaveNone; + } + cmd.endOptionBlock(); + + // padding + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-standard")) + { + opt_useFFpadding = OFTrue; + } + if (cmd.findOption("--padding-zero")) + { + opt_useFFpadding = OFFalse; + } + cmd.endOptionBlock(); + + // encapsulated pixel data encoding options + // pixel data fragmentation options + cmd.beginOptionBlock(); + if (cmd.findOption("--fragment-per-frame")) opt_fragmentSize = 0; + if (cmd.findOption("--fragment-size")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_fragmentSize, OFstatic_cast(OFCmdUnsignedInt, 1))); + } + cmd.endOptionBlock(); + + // basic offset table encoding options + cmd.beginOptionBlock(); + if (cmd.findOption("--offset-table-create")) opt_createOffsetTable = OFTrue; + if (cmd.findOption("--offset-table-empty")) opt_createOffsetTable = OFFalse; + cmd.endOptionBlock(); + + // SOP Class UID options + cmd.beginOptionBlock(); + if (cmd.findOption("--class-default")) opt_secondarycapture = OFFalse; + if (cmd.findOption("--class-sc")) opt_secondarycapture = OFTrue; + cmd.endOptionBlock(); + + // SOP Instance UID options + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-default")) opt_uidcreation = EJLSUC_default; + if (cmd.findOption("--uid-always")) opt_uidcreation = EJLSUC_always; + if (cmd.findOption("--uid-never")) opt_uidcreation = EJLSUC_never; + cmd.endOptionBlock(); + + // output options + // post-1993 value representations + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + // group length encoding + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + // length encoding in sequences and items + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + // data set trailing padding + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) opt_opadenc = EPD_noChange; + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmcjplsLogger, rcsid << OFendl); + + // register global compression codecs + DJLSEncoderRegistration::registerCodecs( + OFstatic_cast(Uint16, opt_t1), OFstatic_cast(Uint16, opt_t2), OFstatic_cast(Uint16, opt_t3), + OFstatic_cast(Uint16, opt_reset), + opt_prefer_cooked, opt_fragmentSize, opt_createOffsetTable, + opt_uidcreation, opt_secondarycapture, opt_interleaveMode, opt_useFFpadding); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmcjplsLogger, "no data dictionary loaded, " + << "check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open inputfile + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmcjplsLogger, "invalid filename: "); + return 1; + } + + OFLOG_INFO(dcmcjplsLogger, "reading input file " << opt_ifname); + + DcmFileFormat fileformat; + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (error.bad()) + { + OFLOG_FATAL(dcmcjplsLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + DcmDataset *dataset = fileformat.getDataset(); + + DcmXfer original_xfer(dataset->getOriginalXfer()); + if (original_xfer.isEncapsulated()) + { + OFLOG_INFO(dcmcjplsLogger, "DICOM file is already compressed, converting to uncompressed transfer syntax first"); + if (EC_Normal != dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL)) + { + OFLOG_FATAL(dcmcjplsLogger, "No conversion from compressed original to uncompressed transfer syntax possible!"); + return 1; + } + } + + OFString sopClass; + if (fileformat.getMetaInfo()->findAndGetOFString(DCM_MediaStorageSOPClassUID, sopClass).good()) + { + /* check for DICOMDIR files */ + if (sopClass == UID_MediaStorageDirectoryStorage) + { + OFLOG_FATAL(dcmcjplsLogger, "DICOMDIR files (Media Storage Directory Storage SOP Class) cannot be compressed!"); + return 1; + } + } + + OFLOG_INFO(dcmcjplsLogger, "Convert DICOM file to compressed transfer syntax"); + + //create representation parameter + DJLSRepresentationParameter rp(OFstatic_cast(Uint16, opt_nearlossless_deviation), opt_useLosslessProcess); + DcmXfer opt_oxferSyn(opt_oxfer); + + // perform decoding process + OFCondition result = dataset->chooseRepresentation(opt_oxfer, &rp); + if (result.bad()) + { + OFLOG_FATAL(dcmcjplsLogger, result.text() << ": encoding file: " << opt_ifname); + return 1; + } + if (dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_INFO(dcmcjplsLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written"); + } else { + OFLOG_FATAL(dcmcjplsLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return 1; + } + + OFLOG_INFO(dcmcjplsLogger, "creating output file " << opt_ofname); + + fileformat.loadAllDataIntoMemory(); + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), EWM_updateMeta); + + if (error.bad()) + { + OFLOG_FATAL(dcmcjplsLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmcjplsLogger, "conversion successful"); + + // deregister global codecs + DJLSEncoderRegistration::cleanup(); + + return 0; +} diff --git a/dcmjpls/apps/dcmdjpls.cc b/dcmjpls/apps/dcmdjpls.cc new file mode 100644 index 00000000..006ddad3 --- /dev/null +++ b/dcmjpls/apps/dcmdjpls.cc @@ -0,0 +1,338 @@ +/* + * + * Copyright (C) 2007-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmdjpls + * + * Author: Martin Willkomm + * + * Purpose: Decompress DICOM file with JPEG-LS transfer syntax + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmimage/diregist.h" /* include to support color images */ +#include "dcmtk/dcmjpls/djlsutil.h" /* for dcmjpgls typedefs */ +#include "dcmtk/dcmjpls/djdecode.h" /* for JPEG-LS decoder */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#ifdef USE_LICENSE_FILE +#include "oflice.h" +#endif + +#ifndef OFFIS_CONSOLE_APPLICATION +#define OFFIS_CONSOLE_APPLICATION "dcmdjpls" +#endif + +static OFLogger dcmdjplsLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +#define SHORTCOL 3 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + + E_TransferSyntax opt_oxfer = EXS_LittleEndianExplicit; + E_GrpLenEncoding opt_oglenc = EGL_recalcGL; + E_EncodingType opt_oenctype = EET_ExplicitLength; + E_PaddingEncoding opt_opadenc = EPD_noChange; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_FileWriteMode opt_writeMode = EWM_fileformat; + E_TransferSyntax opt_ixfer = EXS_Unknown; + OFBool opt_forceSingleFragmentPerFrame = OFFalse; + + // parameter + JLS_UIDCreation opt_uidcreation = EJLSUC_default; + JLS_PlanarConfiguration opt_planarconfig = EJLSPC_restore; + OFBool opt_ignoreOffsetTable = OFFalse; + +#ifdef USE_LICENSE_FILE +LICENSE_FILE_DECLARATIONS +#endif + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Decode JPEG-LS compressed DICOM file", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input filename to be converted"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + +#ifdef USE_LICENSE_FILE +LICENSE_FILE_DECLARE_COMMAND_LINE_OPTIONS +#endif + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("planar configuration:"); + cmd.addOption("--planar-restore", "+pr", "restore original planar configuration (default)"); + cmd.addOption("--planar-auto", "+pa", "automatically determine planar configuration\nfrom SOP class and color space"); + cmd.addOption("--color-by-pixel", "+px", "always store color-by-pixel"); + cmd.addOption("--color-by-plane", "+pl", "always store color-by-plane"); + cmd.addSubGroup("SOP Instance UID:"); + cmd.addOption("--uid-default", "+ud", "keep same SOP Instance UID (default)"); + cmd.addOption("--uid-always", "+ua", "always assign new UID"); + cmd.addSubGroup("workaround options for incorrect JPEG-LS encodings:"); + cmd.addOption("--workaround-incpl", "+wi", "enable workaround for incomplete JPEG-LS data"); + cmd.addSubGroup("other processing options:"); + cmd.addOption("--ignore-offsettable", "+io", "ignore offset table when decompressing"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian (default)"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding (default)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + COUT << "- " << DJLSDecoderRegistration::getLibraryVersionString() << OFendl; + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* options */ + + OFLog::configureFromCommandLine(cmd, app); + +#ifdef USE_LICENSE_FILE +LICENSE_FILE_EVALUATE_COMMAND_LINE_OPTIONS +#endif + + cmd.beginOptionBlock(); + if (cmd.findOption("--planar-restore")) opt_planarconfig = EJLSPC_restore; + if (cmd.findOption("--planar-auto")) opt_planarconfig = EJLSPC_auto; + if (cmd.findOption("--color-by-pixel")) opt_planarconfig = EJLSPC_colorByPixel; + if (cmd.findOption("--color-by-plane")) opt_planarconfig = EJLSPC_colorByPlane; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--uid-default")) opt_uidcreation = EJLSUC_default; + if (cmd.findOption("--uid-always")) opt_uidcreation = EJLSUC_always; + cmd.endOptionBlock(); + + if (cmd.findOption("--workaround-incpl")) opt_forceSingleFragmentPerFrame = OFTrue; + if (cmd.findOption("--ignore-offsettable")) opt_ignoreOffsetTable = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) + { + opt_readMode = ERM_autoDetect; + opt_ixfer = EXS_Unknown; + } + if (cmd.findOption("--read-file-only")) + { + opt_readMode = ERM_fileOnly; + opt_ixfer = EXS_Unknown; + } + if (cmd.findOption("--read-dataset")) + { + opt_readMode = ERM_dataset; + + // This transfer syntax works as long as the content of encapsulated pixel + // sequences is some kind of JPEG-LS bitstream. hmm? + opt_ixfer = EXS_JPEGLSLossless; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_opadenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_opadenc = EPD_withPadding; + } + cmd.endOptionBlock(); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmdjplsLogger, rcsid << OFendl); + + // register global decompression codecs + DJLSDecoderRegistration::registerCodecs( + opt_uidcreation, + opt_planarconfig, + opt_ignoreOffsetTable, + opt_forceSingleFragmentPerFrame); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmdjplsLogger, "no data dictionary loaded, " + << "check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open input file + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmdjplsLogger, "invalid filename: "); + return 1; + } + + DcmFileFormat fileformat; + + OFLOG_INFO(dcmdjplsLogger, "reading input file " << opt_ifname); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (error.bad()) + { + OFLOG_FATAL(dcmdjplsLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + DcmDataset *dataset = fileformat.getDataset(); + + OFLOG_INFO(dcmdjplsLogger, "decompressing file"); + + DcmXfer opt_oxferSyn(opt_oxfer); + DcmXfer original_xfer(dataset->getOriginalXfer()); + + error = dataset->chooseRepresentation(opt_oxfer, NULL); + if (error.bad()) + { + OFLOG_FATAL(dcmdjplsLogger, error.text() << ": decompressing file: " << opt_ifname); + if (error == EC_CannotChangeRepresentation) + OFLOG_FATAL(dcmdjplsLogger, "Input transfer syntax " << original_xfer.getXferName() << " not supported"); + return 1; + } + + if (! dataset->canWriteXfer(opt_oxfer)) + { + OFLOG_FATAL(dcmdjplsLogger, "no conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible"); + return 1; + } + + OFLOG_INFO(dcmdjplsLogger, "creating output file " << opt_ofname); + + // update file meta information with new SOP Instance UID + if (opt_uidcreation && (opt_writeMode == EWM_fileformat)) + opt_writeMode = EWM_updateMeta; + + fileformat.loadAllDataIntoMemory(); + error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + + if (error != EC_Normal) + { + OFLOG_FATAL(dcmdjplsLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmdjplsLogger, "conversion successful"); + + // deregister global decompression codecs + DJLSDecoderRegistration::cleanup(); + + return 0; +} diff --git a/dcmjpls/apps/dcml2pnm.cc b/dcmjpls/apps/dcml2pnm.cc new file mode 100644 index 00000000..20b75dd6 --- /dev/null +++ b/dcmjpls/apps/dcml2pnm.cc @@ -0,0 +1,27 @@ +/* + * + * Copyright (C) 2001-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Uli Schlachter + * + * Purpose: Convert DICOM Images to PPM or PGM using the dcmimage/dcmjpls library. + * + */ + + +// compile "dcm2pnm" with dcmjpls support +#define BUILD_DCM2PNM_AS_DCML2PNM + +// include full implementation of "dcm2pnm" +#include "../../dcmimage/apps/dcm2pnm.cc" diff --git a/dcmjpls/configure b/dcmjpls/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmjpls/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmjpls/data/Makefile.in b/dcmjpls/data/Makefile.in new file mode 100644 index 00000000..9af028cc --- /dev/null +++ b/dcmjpls/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmjpls/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpls/docs/License.txt b/dcmjpls/docs/License.txt new file mode 100644 index 00000000..ef5e5d72 --- /dev/null +++ b/dcmjpls/docs/License.txt @@ -0,0 +1,44 @@ +The libcharls library containing the JPEG-LS encoder and decoder in this +DCMTK module is based on the CharLS library (see http://charls.codeplex.com/). + +The CharLS library is available under the following license: + +------------------------------------------------------------------------------- +Copyright (c) 2007-2010, Jan de Vaan +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of my employer, nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------- + +LEGAL REMARK: + +Please note that Hewlett Packard claims to own patents that apply to +JPEG-LS. Hewlett Packard grants free licenses for conformant +implementations of JPEG-LS. OFFIS as the author of the DCMTK toolkit +has obtained such a license, but depending on your national +legislations companies that use DCMTK's JPEG-LS codec may need to +also acquire a license. Read more at http://www.hpl.hp.com/loco/ if +you intend to use this module for commercial purposes. diff --git a/dcmjpls/docs/Makefile.in b/dcmjpls/docs/Makefile.in new file mode 100644 index 00000000..57ff7cf8 --- /dev/null +++ b/dcmjpls/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmjpls/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpls/docs/dcmcjpls.man b/dcmjpls/docs/dcmcjpls.man new file mode 100644 index 00000000..b5180db7 --- /dev/null +++ b/dcmjpls/docs/dcmcjpls.man @@ -0,0 +1,400 @@ +/*! + +\if MANPAGES +\page dcmcjpls Encode DICOM file to JPEG-LS transfer syntax +\else +\page dcmcjpls dcmcjpls: Encode DICOM file to JPEG-LS transfer syntax +\endif + +\section dcmcjpls_synopsis SYNOPSIS + +\verbatim +dcmcjpls [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmcjpls_description DESCRIPTION + +The \b dcmcjpls utility reads an uncompressed DICOM image (\e dcmfile-in), +performs a JPEG-LS compression (i. e. conversion to an encapsulated DICOM +transfer syntax) and writes the converted image to an output file +(\e dcmfile-out). + +\section dcmcjpls_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmcjpls_options OPTIONS + +\subsection dcmcjpls_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmcjpls_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmcjpls_JPEG_LS_encoding_options JPEG-LS encoding options +\verbatim +JPEG-LS process: + + +el --encode-lossless + encode JPEG-LS lossless only TS (default) + + # This options selects the JPEG-LS lossless only transfer syntax + # and performs a lossless compression. + + +en --encode-nearlossless + encode JPEG-LS near-lossless TS (NEAR: 2) + + # This options selects the JPEG-LS lossy transfer syntax + # and performs a near-lossless compression. + +JPEG-LS bit rate (near-lossless only): + + +md --max-deviation [d]eviation: integer (default: 2) + defines maximum deviation for an encoded pixel + + # This option specifies the maximum deviation for a single pixel from + # the original pixel value. + +lossless compression: + + +pr --prefer-raw + prefer raw encoder mode (default) + + # This option enables the raw encoder. The raw encoder encodes the + # complete pixel cell as it was read from the source image without + # performing any modifications. + + +pc --prefer-cooked + prefer cooked encoder mode + + # This option enables the cooked encoder. The cooked encoder moves + # overlay data to separate tags (60xx,3000) and only encodes the + # stored bits in each pixel. + +JPEG-LS compression: + + +t1 --threshold1 [t]hreshhold: integer + set JPEG-LS encoding parameter threshold 1 + + +t2 --threshold2 [t]hreshhold: integer + set JPEG-LS encoding parameter threshold 2 + + +t3 --threshold3 [t]hreshhold: integer + set JPEG-LS encoding parameter threshold 3 + + # By default, the values for T1, T2, T3 are computed based on + # the number of bits per sample. + + +rs --reset [r]eset: integer (default: 64) + set JPEG-LS encoding parameter reset + +JPEG-LS interleave: + + +il --interleave-line + force line-interleaved JPEG-LS images (default) + + # This flag forces line-interleaved mode for the resulting image. + # In line-interleave mode each line from the source image is + # compressed separately for each component and then the next line + # is encoded. + + +is --interleave-sample + force sample-interleaved JPEG-LS images + + # This flag forces sample-interleaved mode for the resulting image. + # In sample-interleave mode each pixel's components are encoded before + # the next pixel is encoded. + + +in --interleave-none + force uninterleaved JPEG-LS images + + # This flag forces uninterleaved mode for the resulting image. + # In this mode, each of the image's components are completely encoded + # before the next component is handled. + + +iv --interleave-default + use the fastest possible interleave mode + + # This flag selects an interleave mode based on the source image's mode. + # If possible, the image is not converted to a different interleave mode. + +JPEG-LS padding of odd-length bitstreams: + + +ps --padding-standard + pad with extended EOI marker (default) + + # Pad odd-length JPEG-LS bitstreams by writing an extended end of image + # segment marker FF FF D9, as required by the DICOM standard. + + +pz --padding-zero + pad with zero byte (non-standard) + + # Pad odd-length JPEG-LS bitstreams by writing a zero byte after the + # end of image segment marker, i.e. FF D9 00. This is not DICOM conformant + # but required for interoperability with the HP LOCO reference implementation, + # which does not support extended JPEG-LS bitstreams. + +\endverbatim + +\subsection dcmcjpls_enc_pix_data_encoding_opt encapsulated pixel data encoding options +\verbatim +encapsulated pixel data fragmentation: + + +ff --fragment-per-frame + encode each frame as one fragment (default) + + # This option causes the creation of one compressed fragment for each + # frame (recommended). + + +fs --fragment-size [s]ize: integer + limit fragment size to s kbytes + + # This option limits the fragment size which may cause the creation of + # multiple fragments per frame. + +basic offset table encoding: + + +ot --offset-table-create + create offset table (default) + + # This option causes the creation of a valid offset table for the + # compressed JPEG fragments. + + -ot --offset-table-empty + leave offset table empty + + # This option causes the creation of an empty offset table + # for the compressed JPEG fragments. + +SOP Class UID: + + +cd --class-default + keep SOP Class UID (default) + + # Keep the SOP Class UID of the source image. + + +cs --class-sc + convert to Secondary Capture Image (implies --uid-always) + + # Convert the image to Secondary Capture. In addition to the SOP Class + # UID, all attributes required for a valid secondary capture image are + # added. A new SOP instance UID is always assigned. + +SOP Instance UID: + + +ud --uid-default + assign new UID if lossy compression (default) + + # Assigns a new SOP instance UID if the compression is lossy JPEG. + + +ua --uid-always + always assign new UID + + # Unconditionally assigns a new SOP instance UID. + + +un --uid-never + never assign new UID + + # Never assigns a new SOP instance UID. +\endverbatim + +\subsection dcmcjpls_output_options output options +\verbatim +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding: + + -p= --padding-retain + do not change padding (default) + + -p --padding-off + no padding + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section dcmcjpls_notes NOTES + +The \b dcmcjpls utility compresses DICOM images of all SOP classes. It +processes all Pixel Data (7fe0,0010) elements in the dataset, i.e. compression +is also performed on an icon image. However, \b dcmcjpls does not attempt to +ensure that the compressed image still complies with all restrictions of the +object's IOD. + +The user is responsible for making sure that the compressed images he creates +are compliant with the DICOM standard. If in question, the \b dcmcjpls utility +allows one to convert an image to secondary capture - this SOP class does not +pose restrictions as the ones mentioned above. + +\section dcmcjpls_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmcjpls supports the following transfer syntaxes for input +(\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +(*) if compiled with zlib support enabled + +\b dcmcjpls supports the following transfer syntaxes for output +(\e dcmfile-out): + +\verbatim +JPEGLSLosslessTransferSyntax 1.2.840.10008.1.2.4.80 +JPEGLSLossyTransferSyntax 1.2.840.10008.1.2.4.81 +\endverbatim + +\section dcmcjpls_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmcjpls_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmcjpls_environment ENVIRONMENT + +The \b dcmcjpls utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmcjpls_see_also SEE ALSO + +dcmdjpls(1) + +\section dcmcjpls_copyright COPYRIGHT + +Copyright (C) 2009-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmjpls/docs/dcmdjpls.man b/dcmjpls/docs/dcmdjpls.man new file mode 100644 index 00000000..81a1a6b9 --- /dev/null +++ b/dcmjpls/docs/dcmdjpls.man @@ -0,0 +1,285 @@ +/*! + +\if MANPAGES +\page dcmdjpls Decode JPEG-LS compressed DICOM file +\else +\page dcmdjpls dcmdjpls: Decode JPEG-LS compressed DICOM file +\endif + +\section dcmdjpls_synopsis SYNOPSIS + +\verbatim +dcmdjpls [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmdjpls_description DESCRIPTION + +The \b dcmdjpls utility reads a JPEG-ls compressed DICOM image (\e dcmfile-in), +decompresses the JPEG-LS data (i. e. conversion to a native DICOM transfer +syntax) and writes the converted image to an output file (\e dcmfile-out). + +\section dcmdjpls_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmdjpls_options OPTIONS + +\subsection dcmdjpls_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmdjpls_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + + # This option allows one to decompress JPEG-LS compressed DICOM objects that have + # been stored as dataset without meta-header. Such a thing should not exist + # since the transfer syntax cannot be reliably determined without meta-header, + # but unfortunately it does. +\endverbatim + +\subsection dcmdjpls_processing_options processing options +\verbatim +planar configuration: + + +pr --planar-restore + restore original planar configuration (default) + + # If the compressed image is a color image, restore the planar + # configuration as described in the Planar Configuration attribute. + + +pa --planar-auto + automatically determine planar configuration + from SOP class and color space + + # If the compressed image is a color image, store in color-by-plane + # planar configuration if required by the SOP class and photometric + # interpretation. Hardcopy Color images are always stored color-by- + # plane, and the revised Ultrasound image objects are stored color-by- + # plane if the color model is YBR_FULL. Everything else is stored + # color-by-pixel. + + +px --color-by-pixel + always store color-by-pixel + + # If the compressed image is a color image, store in color-by-pixel + # planar configuration. + + +pl --color-by-plane + always store color-by-plane + + # If the compressed image is a color image, store in color-by-plane + # planar configuration. + +SOP Instance UID: + + +ud --uid-default + keep same SOP Instance UID (default) + + # Never assigns a new SOP instance UID. + + +ua --uid-always + always assign new UID + + # Always assigns a new SOP instance UID. + +workaround options for incorrect JPEG-LS encodings: + + +wi --workaround-incpl + enable workaround for incomplete JPEG-LS data + +other processing options: + + +io --ignore-offsettable + ignore offset table when decompressing +\endverbatim + +\subsection dcmdjpls_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +te --write-xfer-little + write with explicit VR little endian (default) + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes +\endverbatim + +\section dcmdjpls_transfer_syntaxes TRANSFER SYNTAXES + +\b dcmdjpls supports the following transfer syntaxes for input +(\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +JPEGLSLosslessTransferSyntax 1.2.840.10008.1.2.4.80 +JPEGLSLossyTransferSyntax 1.2.840.10008.1.2.4.81 +\endverbatim + +(*) if compiled with zlib support enabled + +\b dcmdjpls supports the following transfer syntaxes for output +(\e dcmfile-out): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +\section dcmdjpls_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmdjpls_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmdjpls_environment ENVIRONMENT + +The \b dcmdjpls utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmdjpls_see_also SEE ALSO + +dcmcjpls(1) + +\section dcmdjpls_copyright COPYRIGHT + +Copyright (C) 2009-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmjpls/docs/dcmjpls.dox b/dcmjpls/docs/dcmjpls.dox new file mode 100644 index 00000000..9db860a5 --- /dev/null +++ b/dcmjpls/docs/dcmjpls.dox @@ -0,0 +1,87 @@ +/*! + +\page mod_dcmjpls dcmjpls: a compression/decompression library and utility apps + +This module contains classes that convert between uncompressed and +JPEG-LS compressed representations (transfer syntaxes) of a DICOM +image object. Both lossless and near-lossless JPEG-LS processes are +supported. This module implements a family of codecs that are derived +from class DcmCodec and can be registered in the codec list maintained +in module dcmdata. + +The main interface classes are: +\li \b DJLSEncoderRegistration +\li \b DJLSDecoderRegistration +\li \b DJLSEncoderBase +\li \b DJLSDecoderBase + +\section Tools + +This module contains the following command line tools: +\li \ref dcmcjpls +\li \ref dcmdjpls +\li \ref dcml2pnm + +\section Examples + +The following example shows how to compress a DICOM image file with lossless JPEG-LS: + +\code +DJLSEncoderRegistration::registerCodecs(); // register JPEG-LS codecs +DcmFileFormat fileformat; +if (fileformat.loadFile("test.dcm").good()) +{ + DcmDataset *dataset = fileformat.getDataset(); + DcmItem *metaInfo = fileformat.getMetaInfo(); + DJLSRepresentationParameter rp(0, OFTrue); // parameters for lossless + + // this causes the lossless JPEG-LS version of the dataset to be created + dataset->chooseRepresentation(EXS_JPEGLSLossless, ¶ms); + + // check if everything went well + if (dataset->canWriteXfer(EXS_JPEGLSLossless)) + { + // force the meta-header UIDs to be re-generated when storing the file + // since the UIDs in the data set may have changed + delete metaInfo->remove(DCM_MediaStorageSOPClassUID); + delete metaInfo->remove(DCM_MediaStorageSOPInstanceUID); + + // store in lossless JPEG-LS format + fileformat.saveFile("test_jpls.dcm", EXS_JPEGLSLossless); + } +} +DJLSEncoderRegistration::cleanup(); // deregister JPEG-LS codecs +\endcode + +The following example shows how to decompress a JPEG-LS compressed DICOM image file: + +\code +DJLSDecoderRegistration::registerCodecs(); // register JPEG-LS codecs +DcmFileFormat fileformat; +if (fileformat.loadFile("test_jpls.dcm").good()) +{ + DcmDataset *dataset = fileformat.getDataset(); + + // decompress data set if compressed + dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL); + + // check if everything went well + if (dataset->canWriteXfer(EXS_LittleEndianExplicit)) + { + fileformat.saveFile("test_decompressed.dcm", EXS_LittleEndianExplicit); + } +} +DJLSDecoderRegistration::cleanup(); // deregister JPEG-LS codecs +\endcode + +\section Legal Legal Remark + +Please note that Hewlett Packard claims to own patents that apply to +JPEG-LS. Hewlett Packard grants free licenses for conformant +implementations of JPEG-LS. OFFIS as the author of the DCMTK toolkit +has obtained such a license, but depending on your national +legislations companies that use DCMTK's JPEG-LS codec may need to +also acquire a license. Read more at http://www.hpl.hp.com/loco/ if +you intend to use this module for commercial purposes. + +*/ diff --git a/dcmjpls/docs/dcml2pnm.man b/dcmjpls/docs/dcml2pnm.man new file mode 100644 index 00000000..a5044f4e --- /dev/null +++ b/dcmjpls/docs/dcml2pnm.man @@ -0,0 +1,503 @@ +/*! + +\if MANPAGES +\page dcml2pnm Convert DICOM images to PGM/PPM, PNG, TIFF or BMP +\else +\page dcml2pnm dcml2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF or BMP +\endif + +\section dcml2pnm_synopsis SYNOPSIS + +\verbatim +dcml2pnm [options] dcmfile-in [bitmap-out] +\endverbatim + +\section dcml2pnm_description DESCRIPTION + +The \b dcml2pnm utility reads a DICOM image, converts the pixel data according +to the selected image processing options and writes back an image in the +well-known PGM/PPM (portable gray map / portable pix map), PNG, TIFF or +Windows BMP format. This utility supports uncompressed as well as JPEG-LS +and RLE compressed DICOM images. + +\section dcml2pnm_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be converted + +bitmap-out output filename to be written (default: stdout) +\endverbatim + +\section dcml2pnm_options OPTIONS + +\subsection dcml2pnm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcml2pnm_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcml2pnm_image_processing_options image processing options +\verbatim +frame selection: + + +F --frame [n]umber: integer + select specified frame (default: 1) + + +Fr --frame-range [n]umber [c]ount: integer + select c frames beginning with frame n + + +Fa --all-frames + select all frames + +rotation: + + +Rl --rotate-left + rotate image left (-90 degrees) + + +Rr --rotate-right + rotate image right (+90 degrees) + + +Rtd --rotate-top-down + rotate image top-down (180 degrees) + +flipping: + + +Lh --flip-horizontally + flip image horizontally + + +Lv --flip-vertically + flip image vertically + + +Lhv --flip-both-axes + flip image horizontally and vertically + +scaling: + + +a --recognize-aspect + recognize pixel aspect ratio (default) + + -a --ignore-aspect + ignore pixel aspect ratio when scaling + + +i --interpolate [n]umber of algorithm: integer + use interpolation when scaling (1..4, default: 1) + + -i --no-interpolation + no interpolation when scaling + + -S --no-scaling + no scaling, ignore pixel aspect ratio (default) + + +Sxf --scale-x-factor [f]actor: float + scale x axis by factor, auto-compute y axis + + +Syf --scale-y-factor [f]actor: float + scale y axis by factor, auto-compute x axis + + +Sxv --scale-x-size [n]umber: integer + scale x axis to n pixels, auto-compute y axis + + +Syv --scale-y-size [n]umber: integer + scale y axis to n pixels, auto-compute x axis + +modality LUT transformation: + + -M --no-modality + ignore stored modality LUT transformation + + +M --use-modality + use modality LUT transformation (default) + +VOI LUT transformation: + + -W --no-windowing + no VOI windowing (default) + + +Wi --use-window [n]umber: integer + use the n-th VOI window from image file + + +Wl --use-voi-lut [n]umber: integer + use the n-th VOI look up table from image file + + +Wm --min-max-window + compute VOI window using min-max algorithm + + +Wn --min-max-window-n + compute VOI window using min-max algorithm, + ignoring extreme values + + +Wr --roi-min-max-window [l]eft [t]op [w]idth [h]eight: integer + compute ROI window using min-max algorithm, + region of interest is specified by l,t,w,h + + +Wh --histogram-window [n]umber: integer + compute VOI window using Histogram algorithm, + ignoring n percent + + +Ww --set-window [c]enter [w]idth: float + compute VOI window using center c and width w + + +Wfl --linear-function + set VOI LUT function to LINEAR + + +Wfs --sigmoid-function + set VOI LUT function to SIGMOID + +presentation LUT transformation: + + +Pid --identity-shape + set presentation LUT shape to IDENTITY + + +Piv --inverse-shape + set presentation LUT shape to INVERSE + + +Pod --lin-od-shape + set presentation LUT shape to LIN OD + +overlay: + + -O --no-overlays + do not display overlays + + +O --display-overlay [n]umber: integer + display overlay n (0..16, 0=all, default: +O 0) + + +Omr --ovl-replace + use overlay mode "Replace" + (default for Graphic overlays) + + +Omt --ovl-threshold + use overlay mode "Threshold Replace" + + +Omc --ovl-complement + use overlay mode "Complement" + + +Omv --ovl-invert + use overlay mode "Invert Bitmap" + + +Omi --ovl-roi + use overlay mode "Region of Interest" + (default for ROI overlays) + + +Osf --set-foreground [d]ensity: float + set overlay foreground density (0..1, default: 1) + + +Ost --set-threshold [d]ensity: float + set overlay threshold density (0..1, default: 0.5) + +display LUT transformation: + + +Dm --monitor-file [f]ilename: string + calibrate output according to monitor characteristics + defined in f + + +Dp --printer-file [f]ilename: string + calibrate output according to printer characteristics + defined in f + + +Da --ambient-light [a]mbient light: float + ambient light value (cd/m^2, default: file f) + + +Di --illumination [i]llumination: float + illumination value (cd/m^2, default: file f) + + +Dn --min-density [m]inimum optical density: float + Dmin value (default: off, only with +Dp) + + +Dx --max-density [m]aximum optical density: float + Dmax value (default: off, only with +Dp) + + +Dg --gsd-function + use GSDF for calibration (default for +Dm/+Dp) + + +Dc --cielab-function + use CIELAB function for calibration + +compatibility: + + +Ma --accept-acr-nema + accept ACR-NEMA images without photometric + interpretation + + +Mp --accept-palettes + accept incorrect palette attribute tags + (0028,111x) and (0028,121x) + + +Mc --check-lut-depth + check 3rd value of the LUT descriptor, compare + with expected bit depth based on LUT data + + +Mm --ignore-mlut-depth + ignore 3rd value of the modality LUT descriptor, + determine bits per table entry automatically + + +Mv --ignore-vlut-depth + ignore 3rd value of the VOI LUT descriptor, + determine bits per table entry automatically + +TIFF format: + + +Tl --compr-lzw + LZW compression (default) + + +Tr --compr-rle + RLE compression + + +Tn --compr-none + uncompressed + + +Pd --predictor-default + no LZW predictor (default) + + +Pn --predictor-none + LZW predictor 1 (no prediction) + + +Ph --predictor-horz + LZW predictor 2 (horizontal differencing) + + +Rs --rows-per-strip [r]ows: integer (default: 0) + rows per strip, default 8K per strip + +PNG format: + + +il --interlace + create interlaced file (default) + + -il --nointerlace + create non-interlaced file + + +mf --meta-file + create PNG file meta information (default) + + -mf --meta-none + no PNG file meta information + +other transformations: + + +G --grayscale + convert to grayscale if necessary + + +P --change-polarity + change polarity (invert pixel output) + + +C --clip-region [l]eft [t]op [w]idth [h]eight: integer + clip image region (l, t, w, h) +\endverbatim + +\subsection dcml2pnm_output_options output options +\verbatim +general: + + -im --image-info + print image details (requires verbose mode) + + -o --no-output + do not create any output (useful with -im) + +filename generation (only with --frame-range or --all-frames): + + +Fc --use-frame-counter + use 0-based counter for filenames (default) + + +Fn --use-frame-number + use absolute frame number for filenames + +image format: + + +op --write-raw-pnm + write 8-bit binary PGM/PPM (default for files) + + +opb --write-8-bit-pnm + write 8-bit ASCII PGM/PPM (default for stdout) + + +opw --write-16-bit-pnm + write 16-bit ASCII PGM/PPM + + +opn --write-n-bit-pnm [n]umber: integer + write n-bit ASCII PGM/PPM (1..32) + + +ob --write-bmp + write 8-bit (monochrome) or 24-bit (color) BMP + + +obp --write-8-bit-bmp + write 8-bit palette BMP (monochrome only) + + +obt --write-24-bit-bmp + write 24-bit truecolor BMP + + +obr --write-32-bit-bmp + write 32-bit truecolor BMP + + +ot --write-tiff + write 8-bit (monochrome) or 24-bit (color) TIFF + + +on --write-png + write 8-bit (monochrome) or 24-bit (color) PNG + + +on2 --write-16-bit-png + write 16-bit (monochrome) or 48-bit (color) PNG +\endverbatim + +\section dcml2pnm_notes NOTES + +The following preferred interpolation algorithms can be selected using the +\e --interpolate option: + +\li 1 = free scaling algorithm with interpolation from pbmplus toolkit +\li 2 = free scaling algorithm with interpolation from c't magazine +\li 3 = magnification algorithm with bilinear interpolation from Eduard Stanescu +\li 4 = magnification algorithm with bicubic interpolation from Eduard Stanescu + +The \e --write-tiff option is only available when DCMTK has been configured +and compiled with support for the external \b libtiff TIFF library. The +availability of the TIFF compression options depends on the \b libtiff +configuration. In particular, the patented LZW algorithm may not be +available. + +The \e --write-png option is only available when DCMTK has been configured +and compiled with support for the external \b libpng PNG library. Option +\e --interlace enables progressive image view while loading the PNG file. +Only a few applications take care of the meta info (TEXT) in a PNG file. + +\section dcml2pnm_transfer_syntaxes TRANSFER SYNTAXES + +\b dcml2pnm supports the following transfer syntaxes for input (\e dcmfile-in): + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +JPEGLSLosslessTransferSyntax 1.2.840.10008.1.2.4.80 +JPEGLSLossyTransferSyntax 1.2.840.10008.1.2.4.81 +RLELosslessTransferSyntax 1.2.840.10008.1.2.5 +\endverbatim + +(*) if compiled with zlib support enabled + +\section dcml2pnm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcml2pnm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcml2pnm_environment ENVIRONMENT + +The \b dcml2pnm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcml2pnm_files FILES + +\/camera.lut - sample characteristics file of a camera +\n\/monitor.lut - sample characteristics file of a monitor +\n\/printer.lut - sample characteristics file of a printer +\n\/scanner.lut - sample characteristics file of a scanner + +\section dcml2pnm_see_also SEE ALSO + +dcm2pnm(1), img2dcm(1) + +\section dcml2pnm_copyright COPYRIGHT + +Copyright (C) 2001-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmjpls/docs/readme.txt b/dcmjpls/docs/readme.txt new file mode 100644 index 00000000..9dc062de --- /dev/null +++ b/dcmjpls/docs/readme.txt @@ -0,0 +1,16 @@ +The libcharls library containing the JPEG-LS encoder and decoder in this +DCMTK module is based on the CharLS library (see http://charls.codeplex.com/). + +The CharLS library is available under the license that can be found in +dcmjpls/docs/License.txt. +------------------------------------------------------------------------------ + +The current CharLS version used is revision 55020 dated 2010-10-05. + +The following modifications have been applied to the library: +- removed "test" directory +- removed project files (CharLS.sln, CharLS.vcproj) +- renamed implementation file extensions from .cpp to .cc +- made file names fit into 8.3 characters +- converted file to use UNIX line feeds instead of Windows CR/LF +- removed trailing whitespace, purified tab usage diff --git a/dcmjpls/etc/Makefile.in b/dcmjpls/etc/Makefile.in new file mode 100644 index 00000000..86775aca --- /dev/null +++ b/dcmjpls/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmjpls/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpls/include/CMakeLists.txt b/dcmjpls/include/CMakeLists.txt new file mode 100644 index 00000000..1f37cb08 --- /dev/null +++ b/dcmjpls/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmjpls DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmjpls/include/Makefile.in b/dcmjpls/include/Makefile.in new file mode 100644 index 00000000..887dd411 --- /dev/null +++ b/dcmjpls/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmjpls/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmjpls + for file in dcmtk/dcmjpls/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmjpls ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmjpls/include/dcmtk/dcmjpls/djcodecd.h b/dcmjpls/include/dcmtk/dcmjpls/djcodecd.h new file mode 100644 index 00000000..71c5de79 --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/djcodecd.h @@ -0,0 +1,341 @@ +/* + * + * Copyright (C) 2007-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Marco Eichelberg + * + * Purpose: codec classes for JPEG-LS decoders. + * + */ + +#ifndef DCMJPLS_DJCODECD_H +#define DCMJPLS_DJCODECD_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmjpls/dldefine.h" + +/* forward declaration */ +class DJLSCodecParameter; + +/** abstract codec class for JPEG-LS decoders. + * This abstract class contains most of the application logic + * needed for a dcmdata codec object that implements a JPEG-LS decoder. + * This class only supports decompression, it neither implements + * encoding nor transcoding. + */ +class DCMTK_DCMJPLS_EXPORT DJLSDecoderBase: public DcmCodec +{ +public: + + /// default constructor + DJLSDecoderBase(); + + /// destructor + virtual ~DJLSDecoderBase(); + + /** decompresses the given pixel sequence and + * stores the result in the given uncompressedPixelData element. + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param pixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const; + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decodeFrame( + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const; + + /** transcodes (re-compresses) the given compressed DICOM image and stores + * the result in the given toPixSeq element. + * @param fromRepType current transfer syntax of the compressed image + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * fromPixSeq, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + const DcmCodecParameter * cp, + DcmStack & objStack) const; + + /** checks if this codec is able to convert from the + * given current transfer syntax to the given new + * transfer syntax + * @param oldRepType current transfer syntax + * @param newRepType desired new transfer syntax + * @return true if transformation is supported by this codec, false otherwise. + */ + virtual OFBool canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const; + + /** determine color model of the decompressed image + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const; + +private: + + /** returns the transfer syntax that this particular codec + * is able to Decode + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const = 0; + + // static private helper methods + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param imageFrames number of frames in this image + * @param imageColumns number of columns for each frame + * @param imageRows number of rows for each frame + * @param imageSamplesPerPixel number of samples per pixel + * @param bytesPerSample number of bytes per sample + * @return EC_Normal if successful, an error code otherwise. + */ + static OFCondition decodeFrame( + DcmPixelSequence * fromPixSeq, + const DJLSCodecParameter *cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + Sint32 imageFrames, + Uint16 imageColumns, + Uint16 imageRows, + Uint16 imageSamplesPerPixel, + Uint16 bytesPerSample); + + /** determines if a given image requires color-by-plane planar configuration + * depending on SOP Class UID (DICOM IOD) and photometric interpretation. + * All SOP classes defined in the 2003 edition of the DICOM standard or earlier + * are handled correctly. + * @param sopClassUID SOP Class UID + * @param photometricInterpretation decompressed photometric interpretation + * @return legal value for planar configuration + */ + static Uint16 determinePlanarConfiguration( + const OFString& sopClassUID, + const OFString& photometricInterpretation); + + /** computes the number of fragments (pixel items) that comprise the current + * frame in the compressed pixel sequence. This method uses various approaches + * to compute the number of fragments for a frame, including a check of the + * offset table and checking the start of each fragment for JPEG SOI markers. + * @param numberOfFrames total number of frames of the DICOM object + * @param currentFrame index of current frame (0..numberOfFrames-1) + * @param startItem index of fragment (pixel item) the frame starts with + * @param ignoreOffsetTable flag instructing the method to ignore the offset table + * even if present and presumably useful + * @param pixSeq the compressed JPEG-LS pixel sequence + * @return number of fragments for the current frame, zero upon error + */ + static Uint32 computeNumberOfFragments( + Sint32 numberOfFrames, + Uint32 currentFrame, + Uint32 startItem, + OFBool ignoreOffsetTable, + DcmPixelSequence *pixSeq); + + /** check whether the given buffer contains a JPEG-LS start-of-image code + * @param fragmentData pointer to 4 or more bytes of JPEG-LS data + * @returns true if the first four bytes of the code stream indicate that + * this fragment is the start of a new JPEG-LS image, i.e. starts with + * an SOI marker followed by SOF, COM or APPn. + */ + static OFBool isJPEGLSStartOfImage(Uint8 *fragmentData); + + /** converts an RGB or YBR frame with 8 bits/sample from + * color-by-pixel to color-by-plane planar configuration. + * @param imageFrame pointer to image frame, must contain + * at least 3*columns*rows bytes of pixel data. + * @param columns columns + * @param rows rows + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition createPlanarConfiguration1Byte( + Uint8 *imageFrame, + Uint16 columns, + Uint16 rows); + + /** converts an RGB or YBR frame with 16 bits/sample from + * color-by-pixel to color-by-plane planar configuration. + * @param imageFrame pointer to image frame, must contain + * at least 3*columns*rows words of pixel data. + * @param columns columns + * @param rows rows + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition createPlanarConfiguration1Word( + Uint16 *imageFrame, + Uint16 columns, + Uint16 rows); + + /** converts an RGB or YBR frame with 8 bits/sample from + * color-by-plane to color-by-pixel planar configuration. + * @param imageFrame pointer to image frame, must contain + * at least 3*columns*rows bytes of pixel data. + * @param columns columns + * @param rows rows + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition createPlanarConfiguration0Byte( + Uint8 *imageFrame, + Uint16 columns, + Uint16 rows); + + /** converts an RGB or YBR frame with 16 bits/sample from + * color-by-plane to color-by-pixel planar configuration. + * @param imageFrame pointer to image frame, must contain + * at least 3*columns*rows words of pixel data. + * @param columns columns + * @param rows rows + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition createPlanarConfiguration0Word( + Uint16 *imageFrame, + Uint16 columns, + Uint16 rows); +}; + +/** codec class for JPEG-LS lossless only TS decoding + */ +class DCMTK_DCMJPLS_EXPORT DJLSLosslessDecoder : public DJLSDecoderBase +{ + /** returns the transfer syntax that this particular codec + * is able to Decode + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; +}; + +/** codec class for JPEG-LS lossy and lossless TS decoding + */ +class DCMTK_DCMJPLS_EXPORT DJLSNearLosslessDecoder : public DJLSDecoderBase +{ + /** returns the transfer syntax that this particular codec + * is able to encode + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; +}; + +#endif diff --git a/dcmjpls/include/dcmtk/dcmjpls/djcodece.h b/dcmjpls/include/dcmtk/dcmjpls/djcodece.h new file mode 100644 index 00000000..e2dbc4f8 --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/djcodece.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2007-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: codec classes for JPEG-LS encoders. + * + */ + +#ifndef DCMJPLS_DJCODEC_H +#define DCMJPLS_DJCODEC_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */ +#include "dcmtk/dcmdata/dcofsetl.h" /* for struct DcmOffsetList */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/dcmjpls/dldefine.h" + +class DJLSRepresentationParameter; +class DJLSCodecParameter; +class DicomImage; +struct JlsCustomParameters; + +/** abstract codec class for JPEG-LS encoders. + * This abstract class contains most of the application logic + * needed for a dcmdata codec object that implements a JPEG-LS encoder + * This class only supports compression, it neither implements + * decoding nor transcoding. + */ +class DCMTK_DCMJPLS_EXPORT DJLSEncoderBase : public DcmCodec +{ +public: + + /// default constructor + DJLSEncoderBase(); + + /// destructor + virtual ~DJLSEncoderBase(); + + /** decompresses the given pixel sequence and + * stores the result in the given uncompressedPixelData element. + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param pixSeq compressed pixel sequence + * @param uncompressedPixelData uncompressed pixel data stored in this element + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decode( + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const; + + /** decompresses a single frame from the given pixel sequence and + * stores the result in the given buffer. + * @param fromParam representation parameter of current compressed + * representation, may be NULL. + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param frameNo number of frame, starting with 0 for the first frame + * @param startFragment index of the compressed fragment that contains + * all or the first part of the compressed bitstream for the given frameNo. + * Upon successful return this parameter is updated to contain the index + * of the first compressed fragment of the next frame. + * When unknown, zero should be passed. In this case the decompression + * algorithm will try to determine the index by itself, which will always + * work if frames are decompressed in increasing order from first to last, + * but may fail if frames are decompressed in random order, multiple fragments + * per frame and multiple frames are present in the dataset, and the offset + * table is empty. + * @param buffer pointer to buffer where frame is to be stored + * @param bufSize size of buffer in bytes + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition decodeFrame( + const DcmRepresentationParameter * fromParam, + DcmPixelSequence * fromPixSeq, + const DcmCodecParameter * cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& startFragment, + void *buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const; + + /** compresses the given uncompressed DICOM image and stores + * the result in the given pixSeq element. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param toRepParam representation parameter describing the desired + * compressed representation (e.g. JPEG quality) + * @param pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const; + + /** transcodes (re-compresses) the given compressed DICOM image and stores + * the result in the given toPixSeq element. + * @param fromRepType current transfer syntax of the compressed image + * @param fromRepParam current representation parameter of compressed data, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param toRepParam representation parameter describing the desired + * new compressed representation (e.g. JPEG quality) + * @param toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object + * allocated on heap) returned in this parameter upon success. + * @param cp codec parameters for this codec + * @param objStack stack pointing to the location of the pixel data + * element in the current dataset. + * @return EC_Normal if successful, an error code otherwise. + */ + virtual OFCondition encode( + const E_TransferSyntax fromRepType, + const DcmRepresentationParameter * fromRepParam, + DcmPixelSequence * fromPixSeq, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & toPixSeq, + const DcmCodecParameter * cp, + DcmStack & objStack) const; + + /** checks if this codec is able to convert from the + * given current transfer syntax to the given new + * transfer syntax + * @param oldRepType current transfer syntax + * @param newRepType desired new transfer syntax + * @return true if transformation is supported by this codec, false otherwise. + */ + virtual OFBool canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const; + + /** determine color model of the decompressed image + * @param fromParam representation parameter of current compressed + * representation, may be NULL + * @param fromPixSeq compressed pixel sequence + * @param cp codec parameters for this codec + * @param dataset pointer to dataset in which pixel data element is contained + * @param dataset pointer to DICOM dataset in which this pixel data object + * is located. Used to access photometric interpretation. + * @param decompressedColorModel upon successful return, the color model + * of the decompressed image (which may be different from the one used + * in the compressed images) is returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition determineDecompressedColorModel( + const DcmRepresentationParameter *fromParam, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + OFString &decompressedColorModel) const; + +private: + + /** returns the transfer syntax that this particular codec + * is able to encode + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const = 0; + + /** lossless encoder that compresses the complete pixel cell + * (very much like the RLE encoder in module dcmdata). + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param dataset pointer to dataset containing image pixel module + * @param djrp representation parameter + * @param pixSeq pixel sequence to write to + * @param djcp codec parameter + * @param compressionRatio compression ratio returned upon success + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition losslessRawEncode( + const Uint16 *pixelData, + const Uint32 length, + DcmItem *dataset, + const DJLSRepresentationParameter *djrp, + DcmPixelSequence * & pixSeq, + const DJLSCodecParameter *djcp, + double& compressionRatio) const; + + /** lossless encoder that moves Overlays to (60xx,3000) and only + * compresses the stored bits of the pixel cell. + * @param pixelData pointer to the uncompressed image data in OW format + * and local byte order + * @param length of the pixel data field in bytes + * @param dataset pointer to dataset containing image pixel module + * @param djrp representation parameter + * @param pixSeq pixel sequence to write to + * @param djcp codec parameter + * @param compressionRatio compression ratio returned upon success + * @param nearLosslessDeviation maximum deviation for near-lossless encoding + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition losslessCookedEncode( + const Uint16 * pixelData, + const Uint32 length, + DcmItem *dataset, + const DJLSRepresentationParameter *djrp, + DcmPixelSequence * & pixSeq, + const DJLSCodecParameter *djcp, + double& compressionRatio, + Uint16 nearLosslessDeviation) const; + + /** for all overlay groups create (60xx,3000) Overlay Data. + * @param dataset dataset to be modified + * @param image DicomImage object for this dataset + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition adjustOverlays( + DcmItem *dataset, + DicomImage& image) const; + + /** create Lossy Image Compression and Lossy Image Compression Ratio. + * @param dataset dataset to be modified + * @param ratio image compression ratio > 1. This is the real effective ratio + * between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition updateLossyCompressionRatio( + DcmItem *dataset, + double ratio) const; + + /** create Derivation Description. + * @param dataset dataset to be modified + * @param djrp representation parameter passed to encode() + * @param ratio image compression ratio > 1. This is the real effective ratio + * between compressed and uncompressed image, + * i. e. 30 means a 30:1 lossy compression. + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition updateDerivationDescription( + DcmItem *dataset, + const DJLSRepresentationParameter *djrp, + double ratio) const; + + /** perform the lossless raw compression of a single frame + * @param framePointer pointer to start of frame + * @param bitsAllocated number of bits allocated per pixel + * @param columns frame width + * @param rows frame height + * @param samplesPerPixel image samples per pixel + * @param planarConfiguration image planar configuration + * @param photometricInterpretation photometric interpretation of the DICOM dataset + * @param pixelSequence object in which the compressed frame is stored + * @param offsetList list of frame offsets updated in this parameter + * @param compressedSize size of compressed frame returned in this parameter + * @param djcp parameters for the codec + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition compressRawFrame( + const Uint8 *framePointer, + Uint16 bitsAllocated, + Uint16 columns, + Uint16 rows, + Uint16 samplesPerPixel, + Uint16 planarConfiguration, + const OFString& photometricInterpretation, + DcmPixelSequence *pixelSequence, + DcmOffsetList &offsetList, + unsigned long &compressedSize, + const DJLSCodecParameter *djcp) const; + + /** perform the lossless cooked compression of a single frame + * @param pixelSequence object in which the compressed frame is stored + * @param dimage DicomImage instance used to process frame + * @param photometricInterpretation photometric interpretation of the DICOM dataset + * @param offsetList list of frame offsets updated in this parameter + * @param compressedSize size of compressed frame returned in this parameter + * @param djcp parameters for the codec + * @param frame frame index + * @param nearLosslessDeviation maximum deviation for near-lossless encoding + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition compressCookedFrame( + DcmPixelSequence *pixelSequence, + DicomImage *dimage, + const OFString& photometricInterpretation, + DcmOffsetList &offsetList, + unsigned long &compressedSize, + const DJLSCodecParameter *djcp, + Uint32 frame, + Uint16 nearLosslessDeviation) const; + + /** Convert an image from sample interleaved to uninterleaved. + * @param target A buffer where the converted image will be stored + * @param source The image buffer to be converted + * @param components Color components used in the image + * @param width The width of the image + * @param height The height of the image + * @param bitsAllocated The number of bits allocated in the image. + * @return EC_Normal if succesful, an error code otherwise + */ + OFCondition convertToUninterleaved( + Uint8 *target, + const Uint8 *source, + Uint16 components, + Uint32 width, + Uint32 height, + Uint16 bitsAllocated) const; + + /** Convert an image from uninterleaved to sample interleaved. + * @param target A buffer where the converted image will be stored + * @param source The image buffer to be converted + * @param components Color components used in the image + * @param width The width of the image. + * @param height The height of the image. + * @param bitsAllocated The number of bits allocated in the image. + * @return EC_Normal if succesful, an error code otherwise + */ + OFCondition convertToSampleInterleaved( + Uint8 *target, + const Uint8 *source, + Uint16 components, + Uint32 width, + Uint32 height, + Uint16 bitsAllocated) const; + + /** Adjust the padding of the JPEG-LS bitstream in the buffer if it has odd length, + * such that the End of Image (EOI) marker ends on an even byte boundary. + * @param buffer pointer to buffer containing compressed JPEG-LS bitstream + * @param bufSize size of the buffer in bytes + * @param bytesWritten number of bytes written to buffer; value is increased + * if this method adds a pad byte. + * @param useFFpadding true if a standard-conforming extended EOI marker + * should be used for padding an odd-length bitstream + */ + static void fixPaddingIfNecessary( + Uint8 *buffer, + size_t bufSize, + unsigned long &bytesWritten, + OFBool useFFpadding); + + /** compute the parameters for the CharLS JlsCustomParameters struct, which maintains + * the JPEG-LS encoding process parameters T1, T2, T3, MAXVAL and RESET. + * @param custom reference to initialized JlsCustomParameters object, values filled by this method + * @param bitsAllocated number of bits allocated + * @param nearLosslessDeviation parameter NEAR of near-lossless mode + * @param djcp parameters for the codec + */ + static void setCustomParameters( + JlsCustomParameters& custom, + Uint16 bitsAllocated, + Uint16 nearLosslessDeviation, + const DJLSCodecParameter *djcp); +}; + + +/** codec class for JPEG-LS lossless only TS encoding + */ +class DCMTK_DCMJPLS_EXPORT DJLSLosslessEncoder : public DJLSEncoderBase +{ + /** returns the transfer syntax that this particular codec + * is able to encode + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; +}; + +/** codec class for JPEG-LS lossy and lossless TS encoding + */ +class DCMTK_DCMJPLS_EXPORT DJLSNearLosslessEncoder : public DJLSEncoderBase +{ + /** returns the transfer syntax that this particular codec + * is able to encode + * @return supported transfer syntax + */ + virtual E_TransferSyntax supportedTransferSyntax() const; +}; + +#endif diff --git a/dcmjpls/include/dcmtk/dcmjpls/djcparam.h b/dcmjpls/include/dcmtk/dcmjpls/djcparam.h new file mode 100644 index 00000000..524fd736 --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/djcparam.h @@ -0,0 +1,287 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: codec parameter class JPEG-LS codecs + * + */ + +#ifndef DCMJPLS_DJCPARAM_H +#define DCMJPLS_DJCPARAM_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */ +#include "dcmtk/dcmjpls/djlsutil.h" /* for enums */ + +/** codec parameter for JPEG-LS codecs + */ +class DCMTK_DCMJPLS_EXPORT DJLSCodecParameter: public DcmCodecParameter +{ +public: + + /** Constants describing the interleave mode which the encoder will use + */ + enum interleaveMode + { + /// Use same interleave mode as the DICOM header says in planarConfiguration, + /// if possible. The cooked encoder will force interleaveLine. + interleaveDefault, + /// Sample-interleaved (color-by-pixel) + interleaveSample, + /// Line-interleaved (color-by-line) + interleaveLine, + /// Uninterleaved (color-by-plane) + interleaveNone + }; + + /** constructor, for use with encoders. + * @param preferCookedEncoding true if the "cooked" lossless encoder should be preferred over the "raw" one + * (which should be the default) + * @param jpls_t1 JPEG-LS parameter "Threshold 1" (used for quantization) + * @param jpls_t2 JPEG-LS parameter "Threshold 2" + * @param jpls_t3 JPEG-LS parameter "Threshold 3" + * @param jpls_reset JPEG-LS parameter "RESET", i.e., value at which the counters A, B, and N are halved. + * @param fragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @param createOffsetTable create offset table during image compression + * @param uidCreation mode for SOP Instance UID creation + * @param convertToSC flag indicating whether image should be converted to Secondary Capture upon compression + * @param planarConfiguration flag describing how planar configuration of decompressed color images should be handled + * @param ignoreOffsetTable flag indicating whether to ignore the offset table when decompressing multiframe images + * @param jplsInterleaveMode flag describing which interleave the JPEG-LS datastream should use + * @param useFFbitstreamPadding flag indicating whether the JPEG-LS bitstream should be FF padded as required by DICOM. + */ + DJLSCodecParameter( + OFBool preferCookedEncoding, + Uint16 jpls_t1 = 0, + Uint16 jpls_t2 = 0, + Uint16 jpls_t3 = 0, + Uint16 jpls_reset = 0, + Uint32 fragmentSize = 0, + OFBool createOffsetTable = OFTrue, + JLS_UIDCreation uidCreation = EJLSUC_default, + OFBool convertToSC = OFFalse, + JLS_PlanarConfiguration planarConfiguration = EJLSPC_restore, + OFBool ignoreOffsetTable = OFFalse, + interleaveMode jplsInterleaveMode = interleaveLine, + OFBool useFFbitstreamPadding = OFTrue ); + + /** constructor, for use with decoders. Initializes all encoder options to defaults. + * @param uidCreation mode for SOP Instance UID creation (used both for encoding and decoding) + * @param planarConfiguration flag describing how planar configuration of decompressed color images should be handled + * @param ignoreOffsetTable flag indicating whether to ignore the offset table when decompressing multiframe images + * @param forceSingleFragmentPerFrame while decompressing a multiframe image, assume one fragment per frame even if the JPEG + * data for some frame is incomplete + */ + DJLSCodecParameter( + JLS_UIDCreation uidCreation = EJLSUC_default, + JLS_PlanarConfiguration planarConfiguration = EJLSPC_restore, + OFBool ignoreOffsetTable = OFFalse, + OFBool forceSingleFragmentPerFrame = OFFalse); + + /// copy constructor + DJLSCodecParameter(const DJLSCodecParameter& arg); + + /// destructor + virtual ~DJLSCodecParameter(); + + /** this methods creates a copy of type DcmCodecParameter * + * it must be overwritten in every subclass. + * @return copy of this object + */ + virtual DcmCodecParameter *clone() const; + + /** returns the class name as string. + * can be used as poor man's RTTI replacement. + */ + virtual const char *className() const; + + /** returns secondary capture conversion flag + * @return secondary capture conversion flag + */ + OFBool getConvertToSC() const + { + return convertToSC_; + } + + /** returns create offset table flag + * @return create offset table flag + */ + OFBool getCreateOffsetTable() const + { + return createOffsetTable_; + } + + /** returns mode for SOP Instance UID creation + * @return mode for SOP Instance UID creation + */ + JLS_UIDCreation getUIDCreation() const + { + return uidCreation_; + } + + /** returns mode for handling planar configuration + * @return mode for handling planar configuration + */ + JLS_PlanarConfiguration getPlanarConfiguration() const + { + return planarConfiguration_; + } + + /** returns flag indicating whether or not the "cooked" lossless encoder + * should be preferred over the "raw" one + * @return raw/cooked lossless encoding flag + */ + OFBool cookedEncodingPreferred() const + { + return preferCookedEncoding_; + } + + /** returns maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @return maximum fragment size for compression + */ + Uint32 getFragmentSize() const + { + return fragmentSize_; + } + + /** returns JPEG-LS parameter T1 + * @return JPEG-LS parameter T1 + */ + Uint16 getT1() const + { + return jpls_t1_; + } + + /** returns JPEG-LS parameter T2 + * @return JPEG-LS parameter T2 + */ + Uint16 getT2() const + { + return jpls_t2_; + } + + /** returns JPEG-LS parameter T3 + * @return JPEG-LS parameter T3 + */ + Uint16 getT3() const + { + return jpls_t3_; + } + + /** returns JPEG-LS parameter RESET + * @return JPEG-LS parameter RESET + */ + Uint16 getReset() const + { + return jpls_reset_; + } + + /** returns true if the offset table should be ignored when decompressing multiframe images + * @return true if the offset table should be ignored when decompressing multiframe images + */ + OFBool ignoreOffsetTable() const + { + return ignoreOffsetTable_; + } + + /** returns the interleave mode which the encoder should use + * @return the interleave mode which the encoder should use + */ + interleaveMode getJplsInterleaveMode() const + { + return jplsInterleaveMode_; + } + + /** returns flag indicating whether one fragment per frame should be enforced while decoding + * @return flag indicating whether one fragment per frame should be enforced while decoding + */ + OFBool getForceSingleFragmentPerFrame() const + { + return forceSingleFragmentPerFrame_; + } + + /** returns flag indicating whether odd-length bitstreams should be padded as FF FF D9 + * @return flag indicating whether odd-length bitstreams should be padded as FF FF D9 + */ + OFBool getUseFFbitstreamPadding() const + { + return useFFbitstreamPadding_; + } + +private: + + /// private undefined copy assignment operator + DJLSCodecParameter& operator=(const DJLSCodecParameter&); + + // **************************************************** + // **** Parameters describing the encoding process **** + + /// flag indicating if the "cooked" lossless encoder should be preferred over the "raw" one + OFBool preferCookedEncoding_; + + /// JPEG-LS parameter "Threshold 1" (used for quantization), 0 if unused + Uint16 jpls_t1_; + + /// JPEG-LS parameter "Threshold 2", 0 if unused + Uint16 jpls_t2_; + + /// JPEG-LS parameter "Threshold 3", 0 if unused + Uint16 jpls_t3_; + + /// JPEG-LS parameter "RESET", i.e., value at which the counters A, B, and N are halved. 0 if unused. + Uint16 jpls_reset_; + + /// maximum fragment size (in kbytes) for compression, 0 for unlimited. + Uint32 fragmentSize_; + + /// create offset table during image compression + OFBool createOffsetTable_; + + /// mode for SOP Instance UID creation (used both for encoding and decoding) + JLS_UIDCreation uidCreation_; + + /// flag indicating whether image should be converted to Secondary Capture upon compression + OFBool convertToSC_; + + /// Flag describing the interleave mode which the encoder will use + interleaveMode jplsInterleaveMode_; + + /** When true, a JPEG-LS bitstream of odd length is padded by extending the + * FF D9 "end of image" marker to FF FF D9, as required by DICOM. When false, + * the bitstream is written as FF D9 00, which is not standard compliant, but + * required for interoperability with the HP LOCO reference implementation, + * which does not support FF padded markers. + */ + OFBool useFFbitstreamPadding_; + + // **************************************************** + // **** Parameters describing the decoding process **** + + /// flag describing how planar configuration of decompressed color images should be handled + JLS_PlanarConfiguration planarConfiguration_; + + /// flag indicating if temporary files should be kept, false if they should be deleted after use + OFBool ignoreOffsetTable_; + + /** while decompressing a multiframe image, + * assume one fragment per frame even if the JPEG data for some frame is incomplete + */ + OFBool forceSingleFragmentPerFrame_; + +}; + + +#endif diff --git a/dcmjpls/include/dcmtk/dcmjpls/djdecode.h b/dcmjpls/include/dcmtk/dcmjpls/djdecode.h new file mode 100644 index 00000000..f03dc46e --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/djdecode.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm + * + * Purpose: singleton class that registers the decoder for all supported JPEG-LS processes. + * + */ + +#ifndef DCMJPLS_DJDECODE_H +#define DCMJPLS_DJDECODE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmjpls/djlsutil.h" /* for enums */ + +class DJLSCodecParameter; +class DJLSLosslessDecoder; +class DJLSNearLosslessDecoder; + +/** singleton class that registers decoders for all supported JPEG-LS processes. + */ +class DCMTK_DCMJPLS_EXPORT DJLSDecoderRegistration +{ +public: + + /** registers decoder for all supported JPEG-LS processes. + * If already registered, call is ignored unless cleanup() has + * been performed before. + * @param uidcreation flag indicating whether or not + * a new SOP Instance UID should be assigned upon decompression. + * @param planarconfig flag indicating how planar configuration + * of color images should be encoded upon decompression. + * @param ignoreOffsetTable flag indicating whether to ignore the offset table when decompressing multiframe images + * @param forceSingleFragmentPerFrame while decompressing a multiframe image, + * assume one fragment per frame even if the JPEG data for some frame is incomplete + */ + static void registerCodecs( + JLS_UIDCreation uidcreation = EJLSUC_default, + JLS_PlanarConfiguration planarconfig = EJLSPC_restore, + OFBool ignoreOffsetTable = OFFalse, + OFBool forceSingleFragmentPerFrame = OFFalse); + + /** deregisters decoders. + * Attention: Must not be called while other threads might still use + * the registered codecs, e.g. because they are currently decoding + * DICOM data sets through dcmdata. + */ + static void cleanup(); + + /** get version information of the CharLS library. + * Typical output format: "CharLS, Revision 55020 (modified)" + * @return name and version number of the CharLS library + */ + static OFString getLibraryVersionString(); + +private: + + /// flag indicating whether the decoders are already registered. + static OFBool registered_; + + /// pointer to codec parameter shared by all decoders + static DJLSCodecParameter *cp_; + + /// pointer to losslessdecoder + static DJLSLosslessDecoder *losslessdecoder_; + + /// pointer to near-lossless encoder + static DJLSNearLosslessDecoder *nearlosslessdecoder_; + +}; + +#endif diff --git a/dcmjpls/include/dcmtk/dcmjpls/djencode.h b/dcmjpls/include/dcmtk/dcmjpls/djencode.h new file mode 100644 index 00000000..78a74c9f --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/djencode.h @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: singleton class that registers encoders for all supported JPEG-LS processes. + * + */ + +#ifndef DCMJPLS_DJENCODE_H +#define DCMJPLS_DJENCODE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftypes.h" /* for OFBool */ +#include "dcmtk/dcmjpls/djlsutil.h" +#include "dcmtk/dcmdata/dctypes.h" /* for Uint32 */ +#include "dcmtk/dcmjpls/djcparam.h" /* for class DJLSCodecParameter */ + +class DJLSCodecParameter; +class DJLSLosslessEncoder; +class DJLSNearLosslessEncoder; + +/** singleton class that registers encoders for all supported JPEG-LS processes. + */ +class DCMTK_DCMJPLS_EXPORT DJLSEncoderRegistration +{ +public: + + /** registers encoders for all supported JPEG-LS processes. + * If already registered, call is ignored unless cleanup() has + * been performed before. + * @param jpls_t1 JPEG-LS parameter "Threshold 1" (used for quantization) + * @param jpls_t2 JPEG-LS parameter "Threshold 2" + * @param jpls_t3 JPEG-LS parameter "Threshold 3" + * @param jpls_reset JPEG-LS parameter "RESET", i.e., value at which the counters A, B, and N are halved. + * @param preferCookedEncoding true if the "cooked" lossless encoder should be preferred over the "raw" one + * @param fragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited. + * @param createOffsetTable create offset table during image compression + * @param uidCreation mode for SOP Instance UID creation + * @param convertToSC flag indicating whether image should be converted to Secondary Capture upon compression + * @param jplsInterleaveMode flag describing which interleave the JPEG-LS datastream should use + * @param useFFbitstreamPadding flag indicating whether the JPEG-LS bitstream should be FF padded as required by DICOM. + */ + static void registerCodecs( + Uint16 jpls_t1 = 0, + Uint16 jpls_t2 = 0, + Uint16 jpls_t3 = 0, + Uint16 jpls_reset = 0, + OFBool preferCookedEncoding = OFTrue, + Uint32 fragmentSize = 0, + OFBool createOffsetTable = OFTrue, + JLS_UIDCreation uidCreation = EJLSUC_default, + OFBool convertToSC = OFFalse, + DJLSCodecParameter::interleaveMode jplsInterleaveMode = DJLSCodecParameter::interleaveDefault, + OFBool useFFbitstreamPadding = OFTrue ); + + /** deregisters encoders. + * Attention: Must not be called while other threads might still use + * the registered codecs, e.g. because they are currently encoding + * DICOM data sets through dcmdata. + */ + static void cleanup(); + + /** get version information of the CharLS library. + * Typical output format: "CharLS, Revision 55020 (modified)" + * @return name and version number of the CharLS library + */ + static OFString getLibraryVersionString(); + +private: + + /// flag indicating whether the encoders are already registered. + static OFBool registered_; + + /// pointer to codec parameter shared by all encoders + static DJLSCodecParameter *cp_; + + /// pointer to encoder for lossless JPEG-LS + static DJLSLosslessEncoder *losslessencoder_; + + /// pointer to encoder for lossy JPEG-LS + static DJLSNearLosslessEncoder *nearlosslessencoder_; + +}; + +#endif diff --git a/dcmjpls/include/dcmtk/dcmjpls/djlsutil.h b/dcmjpls/include/dcmtk/dcmjpls/djlsutil.h new file mode 100644 index 00000000..fc0f9ba7 --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/djlsutil.h @@ -0,0 +1,158 @@ +/* + * + * Copyright (C) 1997-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: enumerations, error constants and helper functions for dcmjpls + * + */ + +#ifndef DCMJPLS_DJLSUTILS_H +#define DCMJPLS_DJLSUTILS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofcond.h" /* for class OFCondition */ +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmjpls/dldefine.h" + + +#define DCMJPLS_CHARLS_VERSION_STRING "CharLS, Version 1.0 (modified)" + + +// global definitions for logging mechanism provided by the oflog module + +extern DCMTK_DCMJPLS_EXPORT OFLogger DCM_dcmjplsLogger; + +#define DCMJPLS_TRACE(msg) OFLOG_TRACE(DCM_dcmjplsLogger, msg) +#define DCMJPLS_DEBUG(msg) OFLOG_DEBUG(DCM_dcmjplsLogger, msg) +#define DCMJPLS_INFO(msg) OFLOG_INFO(DCM_dcmjplsLogger, msg) +#define DCMJPLS_WARN(msg) OFLOG_WARN(DCM_dcmjplsLogger, msg) +#define DCMJPLS_ERROR(msg) OFLOG_ERROR(DCM_dcmjplsLogger, msg) +#define DCMJPLS_FATAL(msg) OFLOG_FATAL(DCM_dcmjplsLogger, msg) + + +// include this file in doxygen documentation + +/** @file djlsutil.h + * @brief type definitions and constants for the dcmjpls module + */ + + +/** describes the condition under which a compressed or decompressed image + * receives a new SOP instance UID. + */ +enum JLS_UIDCreation +{ + /** Upon compression, assign new SOP instance UID if compression is lossy. + * Upon decompression never assign new SOP instance UID. + */ + EJLSUC_default, + + /// always assign new SOP instance UID on compression and decompression + EJLSUC_always, + + /// never assign new SOP instance UID + EJLSUC_never +}; + +/** describes how the decoder should handle planar configuration of + * decompressed color images. + */ +enum JLS_PlanarConfiguration +{ + /// restore planar configuration as indicated in data set + EJLSPC_restore, + + /** automatically determine whether color-by-plane is required from + * the SOP Class UID and decompressed photometric interpretation + */ + EJLSPC_auto, + + /// always create color-by-pixel planar configuration + EJLSPC_colorByPixel, + + /// always create color-by-plane planar configuration + EJLSPC_colorByPlane +}; + +/** describes how the encoder handles the image bit depth + * upon lossy compression. + */ +enum JLS_CompressionBitDepth +{ + /// keep original bit depth + EJLSBD_original, + + /** limit bit depth to a certain value, i.e. scale down + * if the original image bit depth is larger + */ + EJLSBD_limit, + + /** force bit depth to a certain value, i.e. scale up + * or scale down the original image to match the given + * bit depth. + */ + EJLSBD_force +}; + + +// CONDITION CONSTANTS + +/// error condition constant: Too small buffer used for image data (internal error) +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSUncompressedBufferTooSmall; + +/// error condition constant: Too small buffer used for compressed image data (internal error) +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSCompressedBufferTooSmall; + +/// error condition constant: The image uses some features which the codec does not support +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSCodecUnsupportedImageType; + +/// error condition constant: The codec was fed with invalid parameters (e.g. height = -1) +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSCodecInvalidParameters; + +/// error condition constant: The codec was fed with unsupported parameters (e.g. 32 bit per sample) +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSCodecUnsupportedValue; + +/// error condition constant: The compressed image is invalid +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSInvalidCompressedData; + +/// error condition constant: The images' color transformation is not supported in this bit depth +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSUnsupportedBitDepthForTransform; + +/// error condition constant: The images' color transformation is not supported +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSUnsupportedColorTransform; + +/// error condition constant: Unsupported bit depth in JPEG-LS transfer syntax +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSUnsupportedBitDepth; + +/// error condition constant: Cannot compute number of fragments for JPEG-LS frame +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSCannotComputeNumberOfFragments; + +/// error condition constant: Image data mismatch between DICOM header and JPEG-LS bitstream +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSImageDataMismatch; + +/// error condition constant: Unsupported photometric interpretation for near-lossless JPEG-LS compression +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSUnsupportedPhotometricInterpretation; + +/// error condition constant: Unsupported pixel representation for near-lossless JPEG-LS compression +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSUnsupportedPixelRepresentation; + +/// error condition constant: Unsupported type of image for JPEG-LS compression +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSUnsupportedImageType; + +/// error condition constant: Trailing data after image +extern DCMTK_DCMJPLS_EXPORT const OFConditionConst EC_JLSTooMuchCompressedData; + +#endif diff --git a/dcmjpls/include/dcmtk/dcmjpls/djrparam.h b/dcmjpls/include/dcmtk/dcmjpls/djrparam.h new file mode 100644 index 00000000..906a79c8 --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/djrparam.h @@ -0,0 +1,97 @@ +/* + * + * Copyright (C) 1997-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm + * + * Purpose: representation parameters for JPEG-LS + * + */ + +#ifndef DCMJPLS_DJRPARAM_H +#define DCMJPLS_DJRPARAM_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcpixel.h" /* for class DcmRepresentationParameter */ +#include "dcmtk/dcmjpls/dldefine.h" + +/** representation parameter for JPEG-LS + */ +class DCMTK_DCMJPLS_EXPORT DJLSRepresentationParameter: public DcmRepresentationParameter +{ +public: + + /** constructor + * @param nearlosslessDeviation used as parameter NEAR in JPEG-LS nearlossless-encoding process + * @param losslessProcess true if lossless process is requested + */ + DJLSRepresentationParameter( + Uint16 nearlosslessDeviation = 2, + OFBool losslessProcess = OFTrue); + + /// copy constructor + DJLSRepresentationParameter(const DJLSRepresentationParameter& arg); + + /// destructor + virtual ~DJLSRepresentationParameter(); + + /** this methods creates a copy of type DcmRepresentationParameter * + * it must be overweritten in every subclass. + * @return copy of this object + */ + virtual DcmRepresentationParameter *clone() const; + + /** returns the class name as string. + * can be used in operator== as poor man's RTTI replacement. + */ + virtual const char *className() const; + + /** compares an object to another DcmRepresentationParameter. + * Implementation must make sure that classes are comparable. + * @param arg representation parameter to compare with + * @return true if equal, false otherwise. + */ + virtual OFBool operator==(const DcmRepresentationParameter &arg) const; + + /** returns the desired NEAR parameter + * @return return desired NEAR-Parameter + */ + Uint16 getnearlosslessDeviation() const + { + return nearlosslessDeviation_; + } + + /** returns true if lossless compression is desired + * @return true if lossless compression is desired + */ + OFBool useLosslessProcess() const + { + return losslessProcess_; + } + +private: + + /** desired NEAR parameter + * Default is 0 (lossless compression). + * Ignored during lossless compression. + */ + Uint16 nearlosslessDeviation_; + + /// true if lossless process should be used even in lossy transfer syntax + OFBool losslessProcess_; + +}; + + +#endif diff --git a/dcmjpls/include/dcmtk/dcmjpls/dldefine.h b/dcmjpls/include/dcmtk/dcmjpls/dldefine.h new file mode 100644 index 00000000..7ec9f034 --- /dev/null +++ b/dcmjpls/include/dcmtk/dcmjpls/dldefine.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DLDEFINE_H +#define DLDEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmjpls_EXPORTS +#define DCMTK_DCMJPLS_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMJPLS_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmjpls/libcharls/CMakeLists.txt b/dcmjpls/libcharls/CMakeLists.txt new file mode 100644 index 00000000..0c5b1433 --- /dev/null +++ b/dcmjpls/libcharls/CMakeLists.txt @@ -0,0 +1,7 @@ +# declare additional include directories +include_directories("${dcmjpls_SOURCE_DIR}/libcharls" "${ofstd_SOURCE_DIR}/include") + +# create library from source files +DCMTK_ADD_LIBRARY(charls header intrface jpegls) + +DCMTK_TARGET_LINK_MODULES(charls ofstd oflog) diff --git a/dcmjpls/libcharls/Makefile.dep b/dcmjpls/libcharls/Makefile.dep new file mode 100644 index 00000000..1f5dcd41 --- /dev/null +++ b/dcmjpls/libcharls/Makefile.dep @@ -0,0 +1,53 @@ +header.o: header.cc config.h util.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../config/include/dcmtk/config/osconfig.h pubtypes.h header.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h streams.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h decodstr.h procline.h \ + clrtrans.h encodstr.h +intrface.o: intrface.cc config.h util.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../config/include/dcmtk/config/osconfig.h pubtypes.h intrface.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h header.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h streams.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h +jpegls.o: jpegls.cc config.h util.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../config/include/dcmtk/config/osconfig.h pubtypes.h streams.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h header.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h decodstr.h \ + procline.h clrtrans.h encodstr.h context.h ctxtrmod.h lokuptbl.h \ + lltraits.h deftrait.h scan.h ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h diff --git a/dcmjpls/libcharls/Makefile.in b/dcmjpls/libcharls/Makefile.in new file mode 100644 index 00000000..d26877c4 --- /dev/null +++ b/dcmjpls/libcharls/Makefile.in @@ -0,0 +1,45 @@ +# +# Makefile for dcmjpls/libcharls +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd + +LOCALINCLUDES = -I$(ofstddir)/include +LOCALDEFS = + +objs = header.o intrface.o jpegls.o + +library = libcharls.$(LIBEXT) + +all: $(library) + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CC) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmjpls/libcharls/clrtrans.h b/dcmjpls/libcharls/clrtrans.h new file mode 100644 index 00000000..548e9935 --- /dev/null +++ b/dcmjpls/libcharls/clrtrans.h @@ -0,0 +1,180 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// +#ifndef CHARLS_COLORTRANSFORM +#define CHARLS_COLORTRANSFORM + +// +// This file defines simple classes that define (lossless) color transforms. +// They are invoked in processline.h to convert between decoded values and the internal line buffers. +// Color transforms work best for computer generated images. +// + +template +struct TransformNoneImpl +{ + typedef sample SAMPLE; + + inlinehint Triplet operator() (int v1, int v2, int v3) + { return Triplet(v1, v2, v3); } +}; + + +template +struct TransformNone : public TransformNoneImpl +{ + typedef struct TransformNoneImpl INVERSE; +}; + + + +template +struct TransformHp1 +{ + enum { RANGE = 1 << sizeof(sample)*8 }; + typedef sample SAMPLE; + + struct INVERSE + { + INVERSE(const TransformHp1&) {}; + + inlinehint Triplet operator() (int v1, int v2, int v3) + { return Triplet(v1 + v2 - RANGE/2, v2, v3 + v2 - RANGE/2); } + }; + + inlinehint Triplet operator() (int R, int G, int B) + { + Triplet hp1; + hp1.v2 = SAMPLE(G); + hp1.v1 = SAMPLE(R - G + RANGE/2); + hp1.v3 = SAMPLE(B - G + RANGE/2); + return hp1; + } +}; + + + + + +template +struct TransformHp2 +{ + enum { RANGE = 1 << sizeof(sample)*8 }; + typedef sample SAMPLE; + + struct INVERSE + { + INVERSE(const TransformHp2&) {}; + + inlinehint Triplet operator() (int v1, int v2, int v3) + { + Triplet rgb; + rgb.R = SAMPLE(v1 + v2 - RANGE/2); // new R + rgb.G = SAMPLE(v2); // new G + rgb.B = SAMPLE(v3 + ((rgb.R + rgb.G) >> 1) - RANGE/2); // new B + return rgb; + } + }; + + inlinehint Triplet operator() (int R, int G, int B) + { + return Triplet(R - G + RANGE/2, G, B - ((R+G )>>1) - RANGE/2); + } + + +}; + + + +template +struct TransformHp3 +{ + enum { RANGE = 1 << sizeof(sample)*8 }; + typedef sample SAMPLE; + + struct INVERSE + { + INVERSE(const TransformHp3&) {}; + + inlinehint Triplet operator() (int v1, int v2, int v3) + { + int G = v1 - ((v3 + v2)>>2) + RANGE/4; + Triplet rgb; + rgb.R = SAMPLE(v3 + G - RANGE/2); // new R + rgb.G = SAMPLE(G); // new G + rgb.B = SAMPLE(v2 + G - RANGE/2); // new B + return rgb; + } + }; + + inlinehint Triplet operator() (int R, int G, int B) + { + Triplet hp3; + hp3.v2 = SAMPLE(B - G + RANGE/2); + hp3.v3 = SAMPLE(R - G + RANGE/2); + hp3.v1 = SAMPLE(G + ((hp3.v2 + hp3.v3)>>2)) - RANGE/4; + return hp3; + } +}; + + +// Transform class that shifts bits towards the high bit when bitcount is not 8 or 16 +// needed to make the HP color transforms work correctly. + +template +struct TransformShifted +{ + typedef typename TRANSFORM::SAMPLE SAMPLE; + + struct INVERSE + { + INVERSE(const TransformShifted& transform) : + _shift(transform._shift), + _inverseTransform(transform._colortransform) + {} + + inlinehint Triplet operator() (int v1, int v2, int v3) + { + Triplet result = _inverseTransform(v1 << _shift, v2 << _shift, v3 << _shift); + + return Triplet(result.R >> _shift, result.G >> _shift, result.B >> _shift); + } + + inlinehint Quad operator() (int v1, int v2, int v3, int v4) + { + Triplet result = _inverseTransform(v1 << _shift, v2 << _shift, v3 << _shift); + + return Quad(result.R >> _shift, result.G >> _shift, result.B >> _shift, v4); + } + + int _shift; + typename TRANSFORM::INVERSE _inverseTransform; + }; + + + TransformShifted(int shift) : + _shift(shift) + { + } + + inlinehint Triplet operator() (int R, int G, int B) + { + Triplet result = _colortransform(R << _shift, G << _shift, B << _shift); + + return Triplet(result.R >> _shift, result.G >> _shift, result.B >> _shift); + } + + inlinehint Quad operator() (int R, int G, int B, int A) + { + Triplet result = _colortransform(R << _shift, G << _shift, B << _shift); + + return Quad(result.R >> _shift, result.G >> _shift, result.B >> _shift, A); + } + + int _shift; + TRANSFORM _colortransform; +}; + + + +#endif diff --git a/dcmjpls/libcharls/config.h b/dcmjpls/libcharls/config.h new file mode 100644 index 00000000..433206c1 --- /dev/null +++ b/dcmjpls/libcharls/config.h @@ -0,0 +1,63 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef CHARLS_CONFIG +#define CHARLS_CONFIG + +#ifdef NDEBUG +# ifndef ASSERT +# define ASSERT(t) { } +# endif +# ifndef assert +# define assert(t) { } +# endif +#else +#define INCLUDE_CASSERT +#include "dcmtk/ofstd/ofstdinc.h" +#define ASSERT(t) assert(t) +#endif + +#if defined(_WIN32) +#ifdef _MSC_VER +#pragma warning (disable:4512) +#endif + +#endif + +// Typedef used by Charls for the default integral type. +// charls will work correctly with 64 or 32 bit. +typedef long LONG; + +enum constants +{ + LONG_BITCOUNT = sizeof(LONG)*8 +}; + + +typedef unsigned char BYTE; +typedef unsigned short USHORT; + +#undef NEAR + +#ifndef inlinehint +# ifdef _MSC_VER +# ifdef NDEBUG +# define inlinehint __forceinline +# else +# define inlinehint +# endif +# elif defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +# define inlinehint inline +# else +# define inlinehint inline +# endif +#endif + +#if defined(i386) || defined(__i386__) || defined(_M_IX86) || defined(__amd64__) || defined(_M_X64) +#define ARCH_HAS_UNALIGNED_MEM_ACCESS /* TODO define this symbol for more architectures */ +#endif + +#endif + diff --git a/dcmjpls/libcharls/context.h b/dcmjpls/libcharls/context.h new file mode 100644 index 00000000..e97b268a --- /dev/null +++ b/dcmjpls/libcharls/context.h @@ -0,0 +1,122 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef CHARLS_CONTEXT +#define CHARLS_CONTEXT + + +// +// JlsContext: a JPEG-LS context with it's current statistics. +// +struct JlsContext +{ +public: + JlsContext() + {} + + JlsContext(LONG a) : + A(a), + B(0), + C(0), + N(1) + { + } + + LONG A; + LONG B; + short C; + short N; + + inlinehint LONG GetErrorCorrection(LONG k) const + { + if (k != 0) + return 0; + + return BitWiseSign(2 * B + N - 1); + } + + + inlinehint void UpdateVariables(LONG errorValue, LONG NEAR, LONG NRESET) + { + ASSERT(N != 0); + + // For performance work on copies of A,B,N (compiler will use registers). + int b = B + errorValue * (2 * NEAR + 1); + int a = A + ABS(errorValue); + int n = N; + + ASSERT(a < 65536 * 256); + ASSERT(ABS(b) < 65536 * 256); + + if (n == NRESET) + { + a = a >> 1; + b = b >> 1; + n = n >> 1; + } + + n = n + 1; + + if (b + n <= 0) + { + b = b + n; + if (b <= -n) + { + b = -n + 1; + } + C = _tableC[C - 1]; + } + else if (b > 0) + { + b = b - n; + if (b > 0) + { + b = 0; + } + C = _tableC[C + 1]; + } + A = a; + B = b; + N = (short)n; + ASSERT(N != 0); + } + + + + inlinehint LONG GetGolomb() const + { + LONG Ntest = N; + LONG Atest = A; + LONG k = 0; + for(; (Ntest << k) < Atest; k++) + { + ASSERT(k <= 32); + }; + return k; + } + + static signed char* CreateTableC() + { + static OFVector rgtableC; + + rgtableC.reserve(256 + 2); + + rgtableC.push_back(-128); + for (int i = -128; i < 128; i++) + { + rgtableC.push_back(char(i)); + } + rgtableC.push_back(127); + + signed char* pZero = &rgtableC[128 + 1]; + ASSERT(pZero[0] == 0); + return pZero; + } +private: + + static signed char* _tableC; +}; + +#endif diff --git a/dcmjpls/libcharls/ctxtrmod.h b/dcmjpls/libcharls/ctxtrmod.h new file mode 100644 index 00000000..0eac1e01 --- /dev/null +++ b/dcmjpls/libcharls/ctxtrmod.h @@ -0,0 +1,101 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef CHARLS_CONTEXTRUNMODE +#define CHARLS_CONTEXTRUNMODE + +// Implements statistical modelling for the run mode context. +// Computes model dependent parameters like the golomb code lengths + +struct CContextRunMode +{ + CContextRunMode(LONG a, LONG nRItype, LONG nReset) : + A(a), + N(1), + Nn(0), + _nRItype(nRItype), + _nReset((BYTE)nReset) + { + } + + LONG A; + BYTE N; + BYTE Nn; + LONG _nRItype; + BYTE _nReset; + + CContextRunMode() + {} + + + inlinehint LONG GetGolomb() const + { + LONG Ntest = N; + LONG TEMP = A + (N >> 1) * _nRItype; + LONG k = 0; + for(; Ntest < TEMP; k++) + { + Ntest <<= 1; + ASSERT(k <= 32); + }; + return k; + } + + + void UpdateVariables(LONG Errval, LONG EMErrval) + { + if (Errval < 0) + { + Nn = Nn + 1; + } + A = A + ((EMErrval + 1 - _nRItype) >> 1); + if (N == _nReset) + { + A = A >> 1; + N = N >> 1; + Nn = Nn >> 1; + } + N = N + 1; + } + + inlinehint LONG ComputeErrVal(LONG temp, LONG k) + { + bool map = temp & 1; + + LONG errvalabs = (temp + map) / 2; + + if ((k != 0 || (2 * Nn >= N)) == map) + { + ASSERT(map == ComputeMap(-errvalabs, k)); + return -errvalabs; + } + + ASSERT(map == ComputeMap(errvalabs, k)); + return errvalabs; + } + + + bool ComputeMap(LONG Errval, LONG k) const + { + if ((k == 0) && (Errval > 0) && (2 * Nn < N)) + return 1; + + else if ((Errval < 0) && (2 * Nn >= N)) + return 1; + + else if ((Errval < 0) && (k != 0)) + return 1; + + return 0; + } + + + inlinehint LONG ComputeMapNegativeE(LONG k) const + { + return k != 0 || (2 * Nn >= N ); + } +}; + +#endif diff --git a/dcmjpls/libcharls/decodstr.h b/dcmjpls/libcharls/decodstr.h new file mode 100644 index 00000000..c01dbb71 --- /dev/null +++ b/dcmjpls/libcharls/decodstr.h @@ -0,0 +1,295 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + +#ifndef CHARLS_DECODERSTATEGY +#define CHARLS_DECODERSTATEGY + +#include "streams.h" +#include "procline.h" +#include "config.h" +#include "util.h" + +// Implements encoding to stream of bits. In encoding mode JpegLsCodec inherits from EncoderStrategy + + + +class DecoderStrategy +{ +public: + DecoderStrategy(const JlsParameters& info) : + _info(info), + _processLine(OFnullptr), + _readCache(0), + _validBits(0), + _position(0), + _size(0), + _current_offset(0), + _nextFFPosition(0) + { + } + + virtual ~DecoderStrategy() + { + } + + virtual void SetPresets(const JlsCustomParameters& presets) = 0; + virtual size_t DecodeScan(void* outputData, const JlsRect& size, BYTE **buf, size_t *buf_size, size_t offset, bool bCheck) = 0; + + void Init(BYTE **ptr, size_t *size, size_t offset) + { + _validBits = 0; + _readCache = 0; + _position = ptr; + _size = size; + _current_offset = offset; + _nextFFPosition = FindNextFF(); + MakeValid(); + } + + inlinehint void Skip(LONG length) + { + _validBits -= length; + _readCache = _readCache << length; + } + + + void OnLineBegin(LONG /*cpixel*/, void* /*ptypeBuffer*/, LONG /*pixelStride*/) + {} + + + void OnLineEnd(LONG pixelCount, const void* ptypeBuffer, LONG pixelStride) + { + _processLine->NewLineDecoded(ptypeBuffer, pixelCount, pixelStride); + } + + void EndScan() + { + if (current_value() != 0xFF) + { + ReadBit(); + + if (current_value() != 0xFF) + throw JlsException(TooMuchCompressedData); + } + + if (_readCache != 0) + throw JlsException(TooMuchCompressedData); + } + + + inlinehint bool OptimizedRead() + { + // Easy & fast: if there is no 0xFF byte in sight, we can read without bitstuffing + if (_current_offset < _nextFFPosition - (sizeof(bufType)-1)) + { + _readCache |= FromBigEndian::Read(*_position + _current_offset) >> _validBits; + int bytesToRead = (bufferbits - _validBits) >> 3; + _current_offset += bytesToRead; + _validBits += bytesToRead * 8; + ASSERT(_validBits >= bufferbits - 8); + return true; + } + return false; + } + + typedef size_t bufType; + + enum { + bufferbits = sizeof( bufType ) * 8 + }; + + void MakeValid() + { + ASSERT(_validBits <=bufferbits - 8); + + if (OptimizedRead()) + return; + + do + { + if (_current_offset >= *_size) + { + if (_validBits <= 0) + throw JlsException(InvalidCompressedData); + + return; + } + + bufType valnew = current_value(); + + if (valnew == 0xFF) + { + // JPEG bitstream rule: no FF may be followed by 0x80 or higher + if (_current_offset == *_size - 1 || ((*_position)[_current_offset + 1] & 0x80) != 0) + { + if (_validBits <= 0) + throw JlsException(InvalidCompressedData); + + return; + } + } + + _readCache |= valnew << (bufferbits - 8 - _validBits); + _current_offset += 1; + _validBits += 8; + + if (valnew == 0xFF) + { + _validBits--; + } + } + while (_validBits < bufferbits - 8); + + _nextFFPosition = FindNextFF(); + return; + + } + + + size_t FindNextFF() + { + size_t off = _current_offset; + + while (off < *_size) + { + if ((*_position)[off] == 0xFF) + { + break; + } + off++; + } + + + return off; + } + + + BYTE *GetCurBytePos() const + { + LONG validBits = _validBits; + size_t off = _current_offset; + + for (;;) + { + LONG cbitLast = (*_position)[off - 1] == 0xFF ? 7 : 8; + + if (validBits < cbitLast ) + return (*_position) + off; + + validBits -= cbitLast; + off--; + } + } + + + inlinehint LONG ReadValue(LONG length) + { + if (_validBits < length) + { + MakeValid(); + if (_validBits < length) + throw JlsException(InvalidCompressedData); + } + + ASSERT(length != 0 && length <= _validBits); + ASSERT(length < 32); + LONG result = LONG(_readCache >> (bufferbits - length)); + Skip(length); + return result; + } + + + inlinehint LONG PeekByte() + { + if (_validBits < 8) + { + MakeValid(); + } + + return _readCache >> (bufferbits - 8); + } + + + + inlinehint bool ReadBit() + { + if (_validBits <= 0) + { + MakeValid(); + } + + bool bSet = (_readCache & (bufType(1) << (bufferbits - 1))) != 0; + Skip(1); + return bSet; + } + + + + inlinehint LONG Peek0Bits() + { + if (_validBits < 16) + { + MakeValid(); + } + bufType valTest = _readCache; + + for (LONG count = 0; count < 16; count++) + { + if ((valTest & (bufType(1) << (bufferbits - 1))) != 0) + return count; + + valTest <<= 1; + } + return -1; + } + + + + inlinehint LONG ReadHighbits() + { + LONG count = Peek0Bits(); + if (count >= 0) + { + Skip(count + 1); + return count; + } + Skip(15); + + for (LONG highbits = 15; ; highbits++) + { + if (ReadBit()) + return highbits; + } + } + + + LONG ReadLongValue(LONG length) + { + if (length <= 24) + return ReadValue(length); + + return (ReadValue(length - 24) << 24) + ReadValue(24); + } + +protected: + JlsParameters _info; + OFunique_ptr _processLine; + +private: + BYTE current_value() const + { + return (*_position)[_current_offset]; + } + + // decoding + bufType _readCache; + LONG _validBits; + BYTE **_position; + size_t *_size; + size_t _current_offset; + size_t _nextFFPosition; +}; + + +#endif diff --git a/dcmjpls/libcharls/deftrait.h b/dcmjpls/libcharls/deftrait.h new file mode 100644 index 00000000..d577ab21 --- /dev/null +++ b/dcmjpls/libcharls/deftrait.h @@ -0,0 +1,126 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef CHARLS_DEFAULTTRAITS +#define CHARLS_DEFAULTTRAITS + +// Default traits that support all JPEG LS parameters: custom limit, near, maxval (not power of 2) + +// This traits class is used to initialize a coder/decoder. +// The coder/decoder also delegates some functions to the traits class. +// This is to allow the traits class to replace the default implementation here with optimized specific implementations. +// This is done for lossless coding/decoding: see losslesstraits.h + +template +struct DefaultTraitsT +{ +public: + typedef sample SAMPLE; + typedef pixel PIXEL; + + LONG MAXVAL; + LONG RANGE; + LONG NEAR; + LONG qbpp; + LONG bpp; + LONG LIMIT; + LONG RESET; + + DefaultTraitsT(const DefaultTraitsT& src) : + MAXVAL(src.MAXVAL), + RANGE(src.RANGE), + NEAR(src.NEAR), + qbpp(src.qbpp), + bpp(src.bpp), + LIMIT(src.LIMIT), + RESET(src.RESET) + { + } + + DefaultTraitsT(LONG max, LONG jls_near) + { + NEAR = jls_near; + MAXVAL = max; + RANGE = (MAXVAL + 2 * NEAR )/(2 * NEAR + 1) + 1; + bpp = log_2(max); + LIMIT = 2 * (bpp + MAX(8,bpp)); + qbpp = log_2(RANGE); + RESET = BASIC_RESET; + } + + + inlinehint LONG ComputeErrVal(LONG e) const + { + LONG q = Quantize(e); + return ModRange(q); + } + + inlinehint SAMPLE ComputeReconstructedSample(LONG Px, LONG ErrVal) + { + return FixReconstructedValue(Px + DeQuantize(ErrVal)); + } + + inlinehint bool IsNear(LONG lhs, LONG rhs) const + { return ABS(lhs-rhs) <=NEAR; } + + bool IsNear(Triplet lhs, Triplet rhs) const + { + return ABS(lhs.v1-rhs.v1) <=NEAR && + ABS(lhs.v2-rhs.v2) <=NEAR && + ABS(lhs.v3-rhs.v3) <=NEAR; + } + + inlinehint LONG CorrectPrediction(LONG Pxc) const + { + if ((Pxc & MAXVAL) == Pxc) + return Pxc; + + return (~(Pxc >> (LONG_BITCOUNT-1))) & MAXVAL; + } + + inlinehint LONG ModRange(LONG Errval) const + { + ASSERT(ABS(Errval) <= RANGE); + if (Errval < 0) + Errval = Errval + RANGE; + + if (Errval >= ((RANGE + 1) / 2)) + Errval = Errval - RANGE; + + ASSERT(ABS(Errval) <= RANGE/2); + + return Errval; + } + + +private: + LONG Quantize(LONG Errval) const + { + if (Errval > 0) + return (Errval + NEAR) / (2 * NEAR + 1); + else + return - (NEAR - Errval) / (2 * NEAR + 1); + } + + + inlinehint LONG DeQuantize(LONG Errval) const + { + return Errval * (2 * NEAR + 1); + } + + inlinehint SAMPLE FixReconstructedValue(LONG val) const + { + if (val < -NEAR) + val = val + RANGE*(2*NEAR+1); + else if (val > MAXVAL + NEAR) + val = val - RANGE*(2*NEAR+1); + + return SAMPLE(CorrectPrediction(val)); + } + +}; + + +#endif diff --git a/dcmjpls/libcharls/encodstr.h b/dcmjpls/libcharls/encodstr.h new file mode 100644 index 00000000..7c49e8f0 --- /dev/null +++ b/dcmjpls/libcharls/encodstr.h @@ -0,0 +1,201 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + +#ifndef CHARLS_ENCODERSTRATEGY +#define CHARLS_ENCODERSTRATEGY + +#define INCLUDE_NEW +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/ofstd/ofbmanip.h" +#include "procline.h" +#include "decodstr.h" + +// Implements encoding to stream of bits. In encoding mode JpegLsCodec inherits from EncoderStrategy + +class EncoderStrategy +{ + +public: + explicit EncoderStrategy(const JlsParameters& info) : + _qdecoder(OFnullptr), + _info(info), + _processLine(OFnullptr), + valcurrent(0), + bitpos(0), + _isFFWritten(false), + _bytesWritten(0) + + { + } + + virtual ~EncoderStrategy() + { + } + + LONG PeekByte(); + + void OnLineBegin(LONG cpixel, void* ptypeBuffer, LONG pixelStride) + { + _processLine->NewLineRequested(ptypeBuffer, cpixel, pixelStride); + } + + void OnLineEnd(LONG /*cpixel*/, void* /*ptypeBuffer*/, LONG /*pixelStride*/) { } + + virtual void SetPresets(const JlsCustomParameters& presets) = 0; + + virtual size_t EncodeScan(const void* rawData, BYTE **ptr, size_t *size, size_t offset, bool compare) = 0; + +protected: + + void Init(BYTE **ptr, size_t *size, size_t offset) + { + bitpos = 32; + valcurrent = 0; + _position = ptr; + _size = size; + _current_offset = offset; + } + + + void AppendToBitStream(LONG value, LONG length) + { + ASSERT(length < 32 && length >= 0); + + ASSERT((_qdecoder.get() == NULL) || (length == 0 && value == 0) ||( _qdecoder->ReadLongValue(length) == value)); + +#ifndef NDEBUG + if (length < 32) + { + int mask = (1 << (length)) - 1; + ASSERT((value | mask) == mask); + } +#endif + + bitpos -= length; + if (bitpos >= 0) + { + valcurrent = valcurrent | (value << bitpos); + return; + } + + valcurrent |= value >> -bitpos; + Flush(); + + // A second flush may be required if extra marker-detect bits were needed and not all bits could be written. + if (bitpos < 0) + { + valcurrent |= value >> -bitpos; + Flush(); + } + + ASSERT(bitpos >=0); + valcurrent |= value << bitpos; + } + + void EndScan() + { + Flush(); + + // if a 0xff was written, Flush() will force one unset bit anyway + if (_isFFWritten) + AppendToBitStream(0, (bitpos - 1) % 8); + else + AppendToBitStream(0, bitpos % 8); + + Flush(); + ASSERT(bitpos == 0x20); + } + + void Flush() + { + for (LONG i = 0; i < 4; ++i) + { + if (bitpos >= 32) + break; + + if (_isFFWritten) + { + // JPEG-LS requirement (T.87, A.1) to detect markers: after a xFF value a single 0 bit needs to be inserted. + write(BYTE(valcurrent >> 25)); + valcurrent = valcurrent << 7; + bitpos += 7; + _isFFWritten = false; + } + else + { + write(BYTE(valcurrent >> 24)); + _isFFWritten = (*_position)[_current_offset - 1] == 0xFF; + valcurrent = valcurrent << 8; + bitpos += 8; + } + + } + + } + + size_t GetLength() + { + return _bytesWritten - (bitpos -32)/8; + } + + + inlinehint void AppendOnesToBitStream(LONG length) + { + AppendToBitStream((1 << length) - 1, length); + } + + + OFunique_ptr _qdecoder; + +protected: + JlsParameters _info; + OFunique_ptr _processLine; +private: + static BYTE *re_alloc(BYTE *old_ptr, size_t *old_size) + { + size_t new_size = *old_size * 2; +#ifdef HAVE_STD__NOTHROW + BYTE *new_ptr = new(std::nothrow) BYTE[new_size]; +#else + BYTE *new_ptr = new BYTE[new_size]; +#endif + if (new_ptr == NULL) { + throw alloc_fail(); + } + + OFBitmanipTemplate::copyMem(old_ptr, new_ptr, *old_size); + + delete[] old_ptr; + + *old_size = new_size; + + return new_ptr; + } + + void write(BYTE value) + { + if (_current_offset == *_size) { + *_position = re_alloc(*_position, _size); + } + + (*_position)[_current_offset] = value; + ++_current_offset; + ++_bytesWritten; + } + + unsigned int valcurrent; + LONG bitpos; + + // encoding + BYTE **_position; + size_t *_size; + size_t _current_offset; + bool _isFFWritten; + size_t _bytesWritten; + +}; + +#endif diff --git a/dcmjpls/libcharls/header.cc b/dcmjpls/libcharls/header.cc new file mode 100644 index 00000000..8e9a0504 --- /dev/null +++ b/dcmjpls/libcharls/header.cc @@ -0,0 +1,628 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + +#include "config.h" +#include "util.h" +#include "header.h" +#include "streams.h" +#include "decodstr.h" +#include "encodstr.h" + + +bool IsDefault(const JlsCustomParameters* pcustom) +{ + if (pcustom->MAXVAL != 0) + return false; + + if (pcustom->T1 != 0) + return false; + + if (pcustom->T2 != 0) + return false; + + if (pcustom->T3 != 0) + return false; + + if (pcustom->RESET != 0) + return false; + + return true; +} + + +LONG CLAMP(LONG i, LONG j, LONG MAXVAL) +{ + if (i > MAXVAL || i < j) + return j; + + return i; +} + + +JlsCustomParameters ComputeDefault(LONG MAXVAL, LONG NEAR) +{ + JlsCustomParameters preset = JlsCustomParameters(); + + LONG FACTOR = (MIN(MAXVAL, 4095) + 128)/256; + + preset.T1 = CLAMP(FACTOR * (BASIC_T1 - 2) + 2 + 3*NEAR, NEAR + 1, MAXVAL); + preset.T2 = CLAMP(FACTOR * (BASIC_T2 - 3) + 3 + 5*NEAR, preset.T1, MAXVAL); + preset.T3 = CLAMP(FACTOR * (BASIC_T3 - 4) + 4 + 7*NEAR, preset.T2, MAXVAL); + preset.MAXVAL = MAXVAL; + preset.RESET = BASIC_RESET; + return preset; +} + + +JLS_ERROR CheckParameterCoherent(const JlsParameters* pparams) +{ + if (pparams->bitspersample < 6 || pparams->bitspersample > 16) + return ParameterValueNotSupported; + + if (pparams->ilv < 0 || pparams->ilv > 2) + throw JlsException(InvalidCompressedData); + + if (pparams->bitspersample < 6 || pparams->bitspersample > 16) + return ParameterValueNotSupported; + + switch (pparams->components) + { + case 4: return pparams->ilv == ILV_SAMPLE ? ParameterValueNotSupported : OK; + case 3: return OK; + case 1: return pparams->ilv != ILV_NONE ? ParameterValueNotSupported : OK; + case 0: return InvalidJlsParameters; + + default: return pparams->ilv != ILV_NONE ? ParameterValueNotSupported : OK; + } +} + +// +// JpegMarkerSegment +// +class JpegMarkerSegment : public JpegSegment +{ +public: + JpegMarkerSegment(BYTE marker, OFVector vecbyte) + { + _marker = marker; + _vecbyte.swap(vecbyte); + } + + virtual void Write(JLSOutputStream* pstream) + { + pstream->WriteByte(0xFF); + pstream->WriteByte(_marker); + pstream->WriteWord(USHORT(_vecbyte.size() + 2)); + pstream->WriteBytes(_vecbyte); + } + + BYTE _marker; + OFVector _vecbyte; +}; + + +// +// push_back() +// +void push_back(OFVector& vec, USHORT value) +{ + vec.push_back(BYTE(value / 0x100)); + vec.push_back(BYTE(value % 0x100)); +} + + +// +// CreateMarkerStartOfFrame() +// +JpegSegment* CreateMarkerStartOfFrame(Size size, LONG bitsPerSample, LONG ccomp) +{ + + OFVector vec; + vec.push_back(static_cast(bitsPerSample)); + push_back(vec, static_cast(size.cy)); + push_back(vec, static_cast(size.cx)); + + // components + vec.push_back(static_cast(ccomp)); + for (BYTE component = 0; component < ccomp; component++) + { + // rescaling + vec.push_back(component + 1); + vec.push_back(0x11); + //"Tq1" reserved, 0 + vec.push_back(0); + } + + return new JpegMarkerSegment(JPEG_SOF, vec); +} + + + + +// +// ctor() +// +JLSOutputStream::JLSOutputStream() : + _bCompare(false), + _cbytesWritten(0), + _icompLast(0) +{ +} + + + +// +// dtor() +// +JLSOutputStream::~JLSOutputStream() +{ + for (size_t i = 0; i < _segments.size(); ++i) + { + delete _segments[i]; + } + _segments.empty(); +} + + + + +// +// Init() +// +void JLSOutputStream::Init(Size size, LONG bitsPerSample, LONG ccomp) +{ + _segments.push_back(CreateMarkerStartOfFrame(size, bitsPerSample, ccomp)); +} + + +void JLSOutputStream::AddColorTransform(int i) +{ + OFVector rgbyteXform; + rgbyteXform.push_back('m'); + rgbyteXform.push_back('r'); + rgbyteXform.push_back('f'); + rgbyteXform.push_back('x'); + rgbyteXform.push_back((BYTE)i); + + _segments.push_back(new JpegMarkerSegment(JPEG_APP8, rgbyteXform)); +} + + +// +// Write() +// +size_t JLSOutputStream::Write(BYTE **ptr, size_t *size, size_t offset) +{ + _position = ptr; + _size = size; + _current_offset = offset; + + WriteByte(0xFF); + + WriteByte(JPEG_SOI); + + for (size_t i = 0; i < _segments.size(); ++i) + { + _segments[i]->Write(this); + } + + //_bCompare = false; + + WriteByte(0xFF); + WriteByte(JPEG_EOI); + + return _cbytesWritten; +} + + + +JLSInputStream::JLSInputStream(const BYTE* pdata, size_t cbyteLength) : + _pdata(pdata), + _cbyteOffset(0), + _cbyteLength(cbyteLength), + _bCompare(false), + _info(), + _rect() +{ + ::memset(&_info, 0, sizeof(_info)); + ::memset(&_rect, 0, sizeof(_rect)); +} + +// +// Read() +// +void JLSInputStream::Read(void* pvoid, size_t cbyteAvailable) +{ + ReadHeader(); + + JLS_ERROR error = CheckParameterCoherent(&_info); + if (error != OK) + throw JlsException(error); + + ReadPixels(pvoid, cbyteAvailable); +} + + + + + +// +// ReadPixels() +// +void JLSInputStream::ReadPixels(void* pvoid, size_t cbyteAvailable) +{ + + if (_rect.Width <= 0) + { + _rect.Width = _info.width; + _rect.Height = _info.height; + } + + size_t cbytePlane = (size_t)(_rect.Width) * _rect.Height * ((_info.bitspersample + 7)/8); + + if (cbyteAvailable < cbytePlane * _info.components) + throw JlsException(UncompressedBufferTooSmall); + + int scancount = _info.ilv == ILV_NONE ? _info.components : 1; + + BYTE* pbyte = (BYTE*)pvoid; + for (LONG scan = 0; scan < scancount; ++scan) + { + ReadScan(pbyte); + pbyte += cbytePlane; + } +} + +// ReadNBytes() +// +void JLSInputStream::ReadNBytes(OFVector& dst, int byteCount) +{ + for (int i = 0; i < byteCount; ++i) + { + dst.push_back((char)ReadByte()); + } +} + + +// +// ReadHeader() +// +void JLSInputStream::ReadHeader() +{ + if (ReadByte() != 0xFF) + throw JlsException(InvalidCompressedData); + + if (ReadByte() != JPEG_SOI) + throw JlsException(InvalidCompressedData); + + for (;;) + { + if (ReadByte() != 0xFF) + throw JlsException(InvalidCompressedData); + + BYTE marker = (BYTE)ReadByte(); + + size_t cbyteStart = _cbyteOffset; + LONG cbyteMarker = ReadWord(); + + switch (marker) + { + case JPEG_SOS: ReadStartOfScan(); break; + case JPEG_SOF: ReadStartOfFrame(); break; + case JPEG_COM: ReadComment(); break; + case JPEG_LSE: ReadPresetParameters(); break; + case JPEG_APP0: ReadJfif(); break; + case JPEG_APP7: ReadColorSpace(); break; + case JPEG_APP8: ReadColorXForm(); break; + // Other tags not supported (among which DNL DRI) + default: throw JlsException(ImageTypeNotSupported); + } + + if (marker == JPEG_SOS) + { + _cbyteOffset = cbyteStart - 2; + return; + } + _cbyteOffset = cbyteStart + cbyteMarker; + } +} + + +JpegMarkerSegment* EncodeStartOfScan(const JlsParameters* pparams, LONG icomponent) +{ + BYTE itable = 0; + + OFVector rgbyte; + + if (icomponent < 0) + { + rgbyte.push_back((BYTE)pparams->components); + for (LONG i = 0; i < pparams->components; ++i ) + { + rgbyte.push_back(BYTE(i + 1)); + rgbyte.push_back(itable); + } + } + else + { + rgbyte.push_back(1); + rgbyte.push_back((BYTE)icomponent); + rgbyte.push_back(itable); + } + + rgbyte.push_back(BYTE(pparams->allowedlossyerror)); + rgbyte.push_back(BYTE(pparams->ilv)); + rgbyte.push_back(0); // transform + + return new JpegMarkerSegment(JPEG_SOS, rgbyte); +} + + + +JpegMarkerSegment* CreateLSE(const JlsCustomParameters* pcustom) +{ + OFVector rgbyte; + + rgbyte.push_back(1); + push_back(rgbyte, (USHORT)pcustom->MAXVAL); + push_back(rgbyte, (USHORT)pcustom->T1); + push_back(rgbyte, (USHORT)pcustom->T2); + push_back(rgbyte, (USHORT)pcustom->T3); + push_back(rgbyte, (USHORT)pcustom->RESET); + + return new JpegMarkerSegment(JPEG_LSE, rgbyte); +} + +// +// ReadPresetParameters() +// +void JLSInputStream::ReadPresetParameters() +{ + LONG type = ReadByte(); + + + switch (type) + { + case 1: + { + _info.custom.MAXVAL = ReadWord(); + _info.custom.T1 = ReadWord(); + _info.custom.T2 = ReadWord(); + _info.custom.T3 = ReadWord(); + _info.custom.RESET = ReadWord(); + return; + } + } + + +} + + +// +// ReadStartOfScan() +// +void JLSInputStream::ReadStartOfScan() +{ + LONG ccomp = ReadByte(); + for (LONG i = 0; i < ccomp; ++i) + { + ReadByte(); + ReadByte(); + } + _info.allowedlossyerror = ReadByte(); + _info.ilv = interleavemode(ReadByte()); + + if(_info.bytesperline == 0) + { + int width = _rect.Width != 0 ? _rect.Width : _info.width; + int components = _info.ilv == ILV_NONE ? 1 : _info.components; + _info.bytesperline = components * width * ((_info.bitspersample + 7)/8); + } +} + + +// +// ReadComment() +// +void JLSInputStream::ReadComment() +{} + + +// +// ReadJfif() +// +void JLSInputStream::ReadJfif() +{ + const BYTE jfifID[] = {'J','F','I','F','\0'}; + for(int i = 0; i < (int)sizeof(jfifID); i++) + { + if(jfifID[i] != ReadByte()) + return; + } + _info.jfif.Ver = ReadWord(); + + // DPI or DPcm + _info.jfif.units = ReadByte(); + _info.jfif.XDensity = ReadWord(); + _info.jfif.YDensity = ReadWord(); + + // thumbnail + _info.jfif.Xthumb = ReadByte(); + _info.jfif.Ythumb = ReadByte(); + if(_info.jfif.Xthumb > 0 && _info.jfif.pdataThumbnail) + { + OFVector tempbuff((char*)_info.jfif.pdataThumbnail, (char*)_info.jfif.pdataThumbnail+3*_info.jfif.Xthumb*_info.jfif.Ythumb); + ReadNBytes(tempbuff, 3*_info.jfif.Xthumb*_info.jfif.Ythumb); + } +} + +// +// CreateJFIF() +// +JpegMarkerSegment* CreateJFIF(const JfifParameters* jfif) +{ + const BYTE jfifID[] = {'J','F','I','F','\0'}; + OFVector rgbyte; + for(int i = 0; i < (int)sizeof(jfifID); i++) + { + rgbyte.push_back(jfifID[i]); + } + + push_back(rgbyte, (USHORT)jfif->Ver); + + rgbyte.push_back(jfif->units); + push_back(rgbyte, (USHORT)jfif->XDensity); + push_back(rgbyte, (USHORT)jfif->YDensity); + + // thumbnail + rgbyte.push_back((BYTE)jfif->Xthumb); + rgbyte.push_back((BYTE)jfif->Ythumb); + if(jfif->Xthumb > 0) + { + if(jfif->pdataThumbnail) + throw JlsException(InvalidJlsParameters); + + rgbyte.insert(rgbyte.end(), (BYTE*)jfif->pdataThumbnail, (BYTE*)jfif->pdataThumbnail+3*jfif->Xthumb*jfif->Ythumb + ); + } + + return new JpegMarkerSegment(JPEG_APP0, rgbyte); +} + + +// +// ReadStartOfFrame() +// +void JLSInputStream::ReadStartOfFrame() +{ + _info.bitspersample = ReadByte(); + int cline = ReadWord(); + int ccol = ReadWord(); + _info.width = ccol; + _info.height = cline; + _info.components= ReadByte(); +} + + +// +// ReadByte() +// +BYTE JLSInputStream::ReadByte() +{ + if (_cbyteOffset >= _cbyteLength) + throw JlsException(InvalidCompressedData); + + return _pdata[_cbyteOffset++]; +} + + +// +// ReadWord() +// +int JLSInputStream::ReadWord() +{ + int i = ReadByte() * 256; + return i + ReadByte(); +} + + +void JLSInputStream::ReadScan(void* pvout) +{ + OFunique_ptr qcodec = JlsCodecFactory().GetCodec(_info, _info.custom); + + BYTE **ptr = (BYTE **)&_pdata; + size_t *size = &_cbyteLength; + _cbyteOffset += qcodec->DecodeScan(pvout, _rect, ptr, size, _cbyteOffset, _bCompare); +} + + +class JpegImageDataSegment: public JpegSegment +{ +public: + JpegImageDataSegment(const void* pvoidRaw, const JlsParameters& info, LONG icompStart, int ccompScan) : + _ccompScan(ccompScan), + _icompStart(icompStart), + _pvoidRaw(pvoidRaw), + _info(info) + { + } + + void Write(JLSOutputStream* pstream) + { + JlsParameters info = _info; + info.components = _ccompScan; + OFunique_ptr qcodec =JlsCodecFactory().GetCodec(info, _info.custom); + size_t cbyteWritten = qcodec->EncodeScan((BYTE*)_pvoidRaw, pstream->get_pos(), pstream->get_size(), pstream->get_offset(), pstream->_bCompare); + pstream->seek(cbyteWritten); + } + + + int _ccompScan; + LONG _icompStart; + const void* _pvoidRaw; + JlsParameters _info; +}; + + +void JLSOutputStream::AddScan(const void* compareData, const JlsParameters* pparams) +{ + if (pparams->jfif.Ver) + { + _segments.push_back(CreateJFIF(&pparams->jfif)); + } + if (!IsDefault(&pparams->custom)) + { + _segments.push_back(CreateLSE(&pparams->custom)); + } + else if (pparams->bitspersample > 12) + { + JlsCustomParameters preset = ComputeDefault((1 << pparams->bitspersample) - 1, pparams->allowedlossyerror); + _segments.push_back(CreateLSE(&preset)); + } + + _icompLast += 1; + _segments.push_back(EncodeStartOfScan(pparams,pparams->ilv == ILV_NONE ? _icompLast : -1)); + +// Size size = Size(pparams->width, pparams->height); + int ccomp = pparams->ilv == ILV_NONE ? 1 : pparams->components; + _segments.push_back(new JpegImageDataSegment(compareData, *pparams, _icompLast, ccomp)); +} + + +// +// ReadColorSpace() +// +void JLSInputStream::ReadColorSpace() +{} + + + +// +// ReadColorXForm() +// +void JLSInputStream::ReadColorXForm() +{ + OFVector sourceTag; + ReadNBytes(sourceTag, 4); + + if(strncmp(&sourceTag[0],"mrfx", 4) != 0) + return; + + int xform = ReadByte(); + switch(xform) + { + case COLORXFORM_NONE: + case COLORXFORM_HP1: + case COLORXFORM_HP2: + case COLORXFORM_HP3: + _info.colorTransform = xform; + return; + case COLORXFORM_RGB_AS_YUV_LOSSY: + case COLORXFORM_MATRIX: + throw JlsException(ImageTypeNotSupported); + default: + throw JlsException(InvalidCompressedData); + } +} + diff --git a/dcmjpls/libcharls/header.h b/dcmjpls/libcharls/header.h new file mode 100644 index 00000000..effb4f8b --- /dev/null +++ b/dcmjpls/libcharls/header.h @@ -0,0 +1,64 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef CHARLS_HEADER +#define CHARLS_HEADER + +#include "dcmtk/ofstd/ofmem.h" +#undef NEAR +#include "streams.h" + +#define JPEG_SOI 0xD8 +#define JPEG_EOI 0xD9 +#define JPEG_SOS 0xDA + +#define JPEG_SOF 0xF7 +#define JPEG_LSE 0xF8 +#define JPEG_DNL 0xDC +#define JPEG_DRI 0xDD +#define JPEG_RSTm 0xD0 +#define JPEG_COM 0xFE +#define JPEG_APP0 0xE0 // JFIF +#define JPEG_APP7 0xE7 // colorspace +#define JPEG_APP8 0xE8 // colorXForm + + + +// Default bin sizes for JPEG-LS statistical modeling. Can be overridden at compression time, however this is rarely done. +const int BASIC_T1 = 3; +const int BASIC_T2 = 7; +const int BASIC_T3 = 21; + +const LONG BASIC_RESET = 64; + +class JLSOutputStream; + + +template +class JlsCodecFactory +{ +public: + OFrvalue > GetCodec(const JlsParameters& info, const JlsCustomParameters&); +private: + STRATEGY* GetCodecImpl(const JlsParameters& info); +}; + +JLS_ERROR CheckParameterCoherent(const JlsParameters* pparams); + +JlsCustomParameters ComputeDefault(LONG MAXVAL, LONG NEAR); + +// +// JpegSegment +// +class JpegSegment +{ +protected: + JpegSegment() {} +public: + virtual ~JpegSegment() {} + virtual void Write(JLSOutputStream* pstream) = 0; +}; + +#endif diff --git a/dcmjpls/libcharls/intrface.cc b/dcmjpls/libcharls/intrface.cc new file mode 100644 index 00000000..be797404 --- /dev/null +++ b/dcmjpls/libcharls/intrface.cc @@ -0,0 +1,240 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#include "config.h" +#include "util.h" +#include "intrface.h" +#include "header.h" + + +JLS_ERROR CheckInput(const void* compressedData, size_t compressedLength, const void* uncompressedData, size_t uncompressedLength, const JlsParameters* pparams) +{ + if (pparams == NULL) + return InvalidJlsParameters; + + if (compressedLength == 0) + return InvalidJlsParameters; + + if (compressedData == NULL) + return InvalidJlsParameters; + + if (uncompressedData == NULL) + return InvalidJlsParameters; + + if (pparams->width < 1 || pparams->width > 65535) + return ParameterValueNotSupported; + + if (pparams->height < 1 || pparams->height > 65535) + return ParameterValueNotSupported; + + int bytesperline = pparams->bytesperline < 0 ? -pparams->bytesperline : pparams->bytesperline; + + if (uncompressedLength < size_t(bytesperline * pparams->height)) + return InvalidJlsParameters; + + return CheckParameterCoherent(pparams); +} + +JLS_ERROR CheckInput(const void* uncompressedData, size_t uncompressedLength, const JlsParameters* pparams) +{ + if (pparams == NULL) + return InvalidJlsParameters; + + if (uncompressedData == NULL) + return InvalidJlsParameters; + + if (pparams->width < 1 || pparams->width > 65535) + return ParameterValueNotSupported; + + if (pparams->height < 1 || pparams->height > 65535) + return ParameterValueNotSupported; + + int bytesperline = pparams->bytesperline < 0 ? -pparams->bytesperline : pparams->bytesperline; + + if (uncompressedLength < size_t(bytesperline * pparams->height)) + return InvalidJlsParameters; + + return CheckParameterCoherent(pparams); +} + + + +extern "C" +{ + +CHARLS_IMEXPORT(JLS_ERROR) JpegLsEncode(BYTE **buf, size_t *buf_size, size_t* pcbyteWritten, const void* uncompressedData, size_t uncompressedLength, struct JlsParameters* pparams) +{ + *pcbyteWritten = 0; + + JlsParameters info = *pparams; + if(info.bytesperline == 0) + { + info.bytesperline = info.width * ((info.bitspersample + 7)/8); + if (info.ilv != ILV_NONE) + { + info.bytesperline *= info.components; + } + } + + JLS_ERROR parameterError = CheckInput(uncompressedData, uncompressedLength, &info); + + if (parameterError != OK) + return parameterError; + + if (pcbyteWritten == NULL) + return InvalidJlsParameters; + + Size size = Size(info.width, info.height); + JLSOutputStream stream; + + stream.Init(size, info.bitspersample, info.components); + + if (info.colorTransform != 0) + { + stream.AddColorTransform(info.colorTransform); + } + + if (info.ilv == ILV_NONE) + { + LONG cbyteComp = size.cx*size.cy*((info.bitspersample +7)/8); + for (LONG component = 0; component < info.components; ++component) + { + const BYTE* compareData = static_cast(uncompressedData) + component*cbyteComp; + stream.AddScan(compareData, &info); + } + } + else + { + stream.AddScan(uncompressedData, &info); + } + + try + { + stream.Write(buf, buf_size, 0); + } + catch (const alloc_fail&) + { + return MemoryAllocationFailure; + } + + *pcbyteWritten = stream.GetBytesWritten(); + return OK; +} + +CHARLS_IMEXPORT(JLS_ERROR) JpegLsDecode(void* uncompressedData, size_t uncompressedLength, const void* compressedData, size_t compressedLength, JlsParameters* info) +{ + JLSInputStream reader((BYTE*)compressedData, compressedLength); + + if(info != NULL) + { + reader.SetInfo(info); + } + + try + { + reader.Read(uncompressedData, uncompressedLength); + return OK; + } + catch (JlsException& e) + { + return e._error; + } +} + + +CHARLS_IMEXPORT(JLS_ERROR) JpegLsDecodeRect(void* uncompressedData, size_t uncompressedLength, const void* compressedData, size_t compressedLength, JlsRect roi, JlsParameters* info) +{ + JLSInputStream reader((BYTE*)compressedData, compressedLength); + + if(info != NULL) + { + reader.SetInfo(info); + } + + reader.SetRect(roi); + + try + { + reader.Read(uncompressedData, uncompressedLength); + return OK; + } + catch (JlsException& e) + { + return e._error; + } +} + + +CHARLS_IMEXPORT(JLS_ERROR) JpegLsVerifyEncode(const void* uncompressedData, size_t uncompressedLength, const void* compressedData, size_t compressedLength) +{ + JlsParameters info = JlsParameters(); + + JLS_ERROR error = JpegLsReadHeader(compressedData, compressedLength, &info); + if (error != OK) + return error; + + error = CheckInput(compressedData, compressedLength, uncompressedData, uncompressedLength, &info); + + if (error != OK) + return error; + + Size size = Size(info.width, info.height); + + JLSOutputStream stream; + + stream.Init(size, info.bitspersample, info.components); + + if (info.ilv == ILV_NONE) + { + LONG cbyteComp = size.cx*size.cy*((info.bitspersample +7)/8); + for (LONG component = 0; component < info.components; ++component) + { + const BYTE* compareData = static_cast(uncompressedData) + component*cbyteComp; + stream.AddScan(compareData, &info); + } + } + else + { + stream.AddScan(uncompressedData, &info); + } + + size_t buf_size = compressedLength + 16; + BYTE *buf = new BYTE[buf_size]; + + memcpy(buf, compressedData, compressedLength); + + stream.EnableCompare(true); + + try + { + stream.Write(&buf, &buf_size, 0); + } + catch (const alloc_fail&) + { + return MemoryAllocationFailure; + } + + return OK; +} + + +CHARLS_IMEXPORT(JLS_ERROR) JpegLsReadHeader(const void* compressedData, size_t compressedLength, JlsParameters* pparams) +{ + try + { + JLSInputStream reader((BYTE*)compressedData, compressedLength); + reader.ReadHeader(); + JlsParameters info = reader.GetMetadata(); + *pparams = info; + return OK; + } + catch (JlsException& e) + { + return e._error; + } + +} + +} diff --git a/dcmjpls/libcharls/intrface.h b/dcmjpls/libcharls/intrface.h new file mode 100644 index 00000000..c8fdaa90 --- /dev/null +++ b/dcmjpls/libcharls/intrface.h @@ -0,0 +1,50 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef JLS_INTERFACE +#define JLS_INTERFACE + +#include "pubtypes.h" +#include "dcmtk/ofstd/ofstd.h" /* for size_t */ +#include "dcmtk/ofstd/ofdefine.h" /* for DCMTK_DECL_EXPORT */ + +#ifdef charls_EXPORTS +#define DCMTK_CHARLS_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_CHARLS_EXPORT DCMTK_DECL_IMPORT +#endif + +#ifndef CHARLS_IMEXPORT +#define CHARLS_IMEXPORT(returntype) DCMTK_CHARLS_EXPORT returntype +#endif + + +#ifdef __cplusplus +extern "C" +{ +#endif + CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsEncode(BYTE **ptr, size_t *size, size_t* pcbyteWritten, + const void* uncompressedData, size_t uncompressedLength, struct JlsParameters* pparams); + + CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsDecode(void* uncompressedData, size_t uncompressedLength, + const void* compressedData, size_t compressedLength, + struct JlsParameters* info); + + + CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsDecodeRect(void* uncompressedData, size_t uncompressedLength, + const void* compressedData, size_t compressedLength, + struct JlsRect rect, struct JlsParameters* info); + + CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsReadHeader(const void* compressedData, size_t compressedLength, + struct JlsParameters* pparams); + + CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsVerifyEncode(const void* uncompressedData, size_t uncompressedLength, + const void* compressedData, size_t compressedLength); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dcmjpls/libcharls/jpegls.cc b/dcmjpls/libcharls/jpegls.cc new file mode 100644 index 00000000..f90c2ae5 --- /dev/null +++ b/dcmjpls/libcharls/jpegls.cc @@ -0,0 +1,175 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + +#include "config.h" +#include "util.h" +#include "streams.h" +#include "header.h" + +#include "decodstr.h" +#include "encodstr.h" +#include "context.h" +#include "ctxtrmod.h" +#include "lokuptbl.h" + + +signed char* JlsContext::_tableC = CreateTableC(); + +// As defined in the JPEG-LS standard + +// used to determine how large runs should be encoded at a time. +const int J[32] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + + + +#include "lltraits.h" +#include "deftrait.h" + +#include "scan.h" + +signed char QuantizeGratientOrg(const JlsCustomParameters& preset, LONG NEAR, LONG Di) +{ + if (Di <= -preset.T3) return -4; + if (Di <= -preset.T2) return -3; + if (Di <= -preset.T1) return -2; + if (Di < -NEAR) return -1; + if (Di <= NEAR) return 0; + if (Di < preset.T1) return 1; + if (Di < preset.T2) return 2; + if (Di < preset.T3) return 3; + + return 4; +} + + + +OFVector CreateQLutLossless(LONG cbit) +{ + JlsCustomParameters preset = ComputeDefault((1 << cbit) - 1, 0); + LONG range = preset.MAXVAL + 1; + + OFVector lut(range * 2); + + for (LONG diff = -range; diff < range; diff++) + { + lut[range + diff] = QuantizeGratientOrg(preset, 0,diff); + } + return lut; +} + +// Lookup tables to replace code with lookup tables. +// To avoid threading issues, all tables are created when the program is loaded. + + +// Lookup table: decode symbols that are smaller or equal to 8 bit (16 tables for each value of k) +CTable decodingTables[16] = { InitTable(0), InitTable(1), InitTable(2), InitTable(3), + InitTable(4), InitTable(5), InitTable(6), InitTable(7), + InitTable(8), InitTable(9), InitTable(10), InitTable(11), + InitTable(12), InitTable(13), InitTable(14),InitTable(15) }; + + +// Lookup tables: sample differences to bin indexes. +OFVector rgquant8Ll = CreateQLutLossless(8); +OFVector rgquant10Ll = CreateQLutLossless(10); +OFVector rgquant12Ll = CreateQLutLossless(12); +OFVector rgquant16Ll = CreateQLutLossless(16); + + + + +template +OFrvalue > JlsCodecFactory::GetCodec(const JlsParameters& info, const JlsCustomParameters& presets) +{ + STRATEGY* pstrategy = NULL; + if (presets.RESET != 0 && presets.RESET != BASIC_RESET) + { + if (info.bitspersample <= 8) + { + DefaultTraitsT traits((1 << info.bitspersample) - 1, info.allowedlossyerror); + traits.MAXVAL = presets.MAXVAL; + traits.RESET = presets.RESET; + pstrategy = new JlsCodec, STRATEGY>(traits, info); + } + else + { + DefaultTraitsT traits((1 << info.bitspersample) - 1, info.allowedlossyerror); + traits.MAXVAL = presets.MAXVAL; + traits.RESET = presets.RESET; + pstrategy = new JlsCodec, STRATEGY>(traits, info); + } + } + else + { + pstrategy = GetCodecImpl(info); + } + + if (pstrategy != NULL) + { + pstrategy->SetPresets(presets); + } + return OFrvalue >(pstrategy); +} + + + +template +STRATEGY* CreateCodec(const TRAITS& t, const STRATEGY*,const JlsParameters& info) +{ + return new JlsCodec(t, info); +} + + +template +STRATEGY* JlsCodecFactory::GetCodecImpl(const JlsParameters& info) +{ + STRATEGY* s = 0; + + if (info.ilv == ILV_SAMPLE && info.components != 3) + return NULL; + +#ifndef DISABLE_SPECIALIZATIONS + + // optimized lossless versions common formats + if (info.allowedlossyerror == 0) + { + if (info.ilv == ILV_SAMPLE) + { + if (info.bitspersample == 8) + return CreateCodec(LosslessTraitsT,8>(), s, info); + } + else + { + switch (info.bitspersample) + { + case 8: return CreateCodec(LosslessTraitsT(), s, info); + case 12: return CreateCodec(LosslessTraitsT(), s, info); + case 16: return CreateCodec(LosslessTraitsT(), s, info); + } + } + } + +#endif + + int maxval = (1 << info.bitspersample) - 1; + + if (info.bitspersample <= 8) + { + if (info.ilv == ILV_SAMPLE) + return CreateCodec(DefaultTraitsT >(maxval, info.allowedlossyerror), s, info); + + return CreateCodec(DefaultTraitsT((1 << info.bitspersample) - 1, info.allowedlossyerror), s, info); + } + else if (info.bitspersample <= 16) + { + if (info.ilv == ILV_SAMPLE) + return CreateCodec(DefaultTraitsT >(maxval, info.allowedlossyerror), s, info); + + return CreateCodec(DefaultTraitsT(maxval, info.allowedlossyerror), s, info); + } + return NULL; +} + + +template class JlsCodecFactory; +template class JlsCodecFactory; diff --git a/dcmjpls/libcharls/lltraits.h b/dcmjpls/libcharls/lltraits.h new file mode 100644 index 00000000..e08249ca --- /dev/null +++ b/dcmjpls/libcharls/lltraits.h @@ -0,0 +1,128 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + + +#ifndef CHARLS_LOSSLESSTRAITS +#define CHARLS_LOSSLESSTRAITS + +#include "header.h" + +// +// optimized trait classes for lossless compression of 8 bit color and 8/16 bit monochrome images. +// This class is assumes MAXVAL correspond to a whole number of bits, and no custom RESET value is set when encoding. +// The point of this is to have the most optimized code for the most common and most demanding scenario. + +template +struct LosslessTraitsImplT +{ + typedef sample SAMPLE; + enum { + NEAR = 0, + bpp = bitsperpixel, + qbpp = bitsperpixel, + RANGE = (1 << bpp), + MAXVAL= (1 << bpp) - 1, + LIMIT = 2 * (bitsperpixel + MAX(8,bitsperpixel)), + RESET = BASIC_RESET + }; + + static inlinehint LONG ComputeErrVal(LONG d) + { return ModRange(d); } + + static inlinehint bool IsNear(LONG lhs, LONG rhs) + { return lhs == rhs; } + + static inlinehint LONG ModRange(LONG Errval) + { + return LONG(Errval << (LONG_BITCOUNT - bpp)) >> (LONG_BITCOUNT - bpp); + } + + static inlinehint SAMPLE ComputeReconstructedSample(LONG Px, LONG ErrVal) + { + return SAMPLE(MAXVAL & (Px + ErrVal)); + } + + static inlinehint LONG CorrectPrediction(LONG Pxc) + { + if ((Pxc & MAXVAL) == Pxc) + return Pxc; + + return (~(Pxc >> (LONG_BITCOUNT-1))) & MAXVAL; + } + +}; + +// For some weird reason MSVC6 doesn't like these templates. +// xlC (compiler on AIX) tries to instantiate Triple > which +// causes compiler errors and is wrong (other compilers don't instantiate it). +#if (defined(_MSC_VER) && _MSC_VER <= 1200) || defined(__xlC__) +# define DISABLE_SPECIALIZATIONS +#else + +template +struct LosslessTraitsT : public LosslessTraitsImplT +{ + typedef SAMPLE PIXEL; +}; + + + +template<> +struct LosslessTraitsT : public LosslessTraitsImplT +{ + typedef SAMPLE PIXEL; + + static inlinehint signed char ModRange(LONG Errval) + { return (signed char)Errval; } + + static inlinehint LONG ComputeErrVal(LONG d) + { return (signed char)(d); } + + static inlinehint BYTE ComputeReconstructedSample(LONG Px, LONG ErrVal) + { return BYTE(Px + ErrVal); } + +}; + + + +template<> +struct LosslessTraitsT : public LosslessTraitsImplT +{ + typedef SAMPLE PIXEL; + + static inlinehint short ModRange(LONG Errval) + { return short(Errval); } + + static inlinehint LONG ComputeErrVal(LONG d) + { return short(d); } + + static inlinehint SAMPLE ComputeReconstructedSample(LONG Px, LONG ErrVal) + { return SAMPLE(Px + ErrVal); } + +}; + + + + +template +struct LosslessTraitsT,bpp> : public LosslessTraitsImplT +{ + typedef Triplet PIXEL; + + static inlinehint bool IsNear(LONG lhs, LONG rhs) + { return lhs == rhs; } + + static inlinehint bool IsNear(PIXEL lhs, PIXEL rhs) + { return lhs == rhs; } + + + static inlinehint SAMPLE ComputeReconstructedSample(LONG Px, LONG ErrVal) + { return SAMPLE(Px + ErrVal); } + + +}; +#endif + +#endif diff --git a/dcmjpls/libcharls/lokuptbl.h b/dcmjpls/libcharls/lokuptbl.h new file mode 100644 index 00000000..b37d104f --- /dev/null +++ b/dcmjpls/libcharls/lokuptbl.h @@ -0,0 +1,69 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef CHARLS_LOOKUPTABLE +#define CHARLS_LOOKUPTABLE + +// Tables for fast decoding of short Golomb Codes. + +struct Code +{ + Code() + { + } + + Code(LONG value, LONG length) : + _value(value), + _length(length) + { + } + + LONG GetValue() const + { return _value; } + LONG GetLength() const + { return _length; } + + LONG _value; + LONG _length; +}; + + + +class CTable +{ +public: + + enum { cbit = 8 } ; + + CTable() + { + ::memset(rgtype, 0, sizeof(rgtype)); + } + + void AddEntry(BYTE bvalue, Code c); + + inlinehint const Code& Get(LONG value) + { return rgtype[value]; } +private: + Code rgtype[1 << cbit]; +}; + + +// +// AddEntry +// +void CTable::AddEntry(BYTE bvalue, Code c) +{ + LONG length = c.GetLength(); + ASSERT(length <= cbit); + + for (LONG i = 0; i < LONG(1) << (cbit - length); ++i) + { + ASSERT(rgtype[(bvalue << (cbit - length)) + i].GetLength() == 0); + rgtype[(bvalue << (cbit - length)) + i] = c; + } +} + +#endif diff --git a/dcmjpls/libcharls/procline.h b/dcmjpls/libcharls/procline.h new file mode 100644 index 00000000..e9f9f09f --- /dev/null +++ b/dcmjpls/libcharls/procline.h @@ -0,0 +1,227 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// +#ifndef CHARLS_PROCESSLINE +#define CHARLS_PROCESSLINE + +#include "clrtrans.h" + +// +// This file defines the ProcessLine base class, its derivitives and helper functions. +// During coding/decoding, CharLS process one line at a time. The different Processline implementations +// convert the uncompressed format to and from the internal format for encoding. +// Conversions include color transforms, line interleaved vs sample interleaved, masking out unused bits, +// accounting for line padding etc. +// This mechanism could be used to encode/decode images as they are received. +// + +class ProcessLine +{ +public: + virtual ~ProcessLine() {} + virtual void NewLineDecoded(const void* pSrc, int pixelCount, int bytesperline) = 0; + virtual void NewLineRequested(void* pSrc, int pixelCount, int bytesperline) = 0; +}; + + +class PostProcesSingleComponent : public ProcessLine +{ +public: + PostProcesSingleComponent(void* pbyteOutput, const JlsParameters& info, int bytesPerPixel) : + _pbyteOutput((BYTE*)pbyteOutput), + _bytesPerPixel(bytesPerPixel), + _bytesPerLine(info.bytesperline) + { + } + + void NewLineRequested(void* pDst, int pixelCount, int /*byteStride*/) + { + OFBitmanipTemplate::copyMem(_pbyteOutput, (BYTE*) pDst, pixelCount * _bytesPerPixel); + _pbyteOutput += _bytesPerLine; + } + + void NewLineDecoded(const void* pSrc, int pixelCount, int /*byteStride*/) + { + OFBitmanipTemplate::copyMem((BYTE*) pSrc, _pbyteOutput, pixelCount * _bytesPerPixel); + _pbyteOutput += _bytesPerLine; + } + +private: + BYTE* _pbyteOutput; + int _bytesPerPixel; + int _bytesPerLine; +}; + + +template +void TransformLineToQuad(const SAMPLE* ptypeInput, LONG pixelStrideIn, Quad* pbyteBuffer, LONG pixelStride, TRANSFORM& transform) +{ + int cpixel = MIN(pixelStride, pixelStrideIn); + Quad* ptypeBuffer = (Quad*)pbyteBuffer; + + for (int x = 0; x < cpixel; ++x) + { + Quad pixel(transform(ptypeInput[x], ptypeInput[x + pixelStrideIn], ptypeInput[x + 2*pixelStrideIn]),ptypeInput[x + 3*pixelStrideIn]) ; + + ptypeBuffer[x] = pixel; + } +} + + +template +void TransformQuadToLine(const Quad* pbyteInput, LONG pixelStrideIn, SAMPLE* ptypeBuffer, LONG pixelStride, TRANSFORM& transform) +{ + int cpixel = MIN(pixelStride, pixelStrideIn); + const Quad* ptypeBufferIn = (Quad*)pbyteInput; + + for (int x = 0; x < cpixel; ++x) + { + Quad color = ptypeBufferIn[x]; + Quad colorTranformed(transform(color.v1, color.v2, color.v3), color.v4); + + ptypeBuffer[x] = colorTranformed.v1; + ptypeBuffer[x + pixelStride] = colorTranformed.v2; + ptypeBuffer[x + 2 *pixelStride] = colorTranformed.v3; + ptypeBuffer[x + 3 *pixelStride] = colorTranformed.v4; + } +} + + +template +void TransformRgbToBgr(SAMPLE* pDest, int samplesPerPixel, int pixelCount) +{ + for (int i = 0; i < pixelCount; ++i) + { + SAMPLE tmp = pDest[0]; + pDest[0] = pDest[2]; + pDest[2] = tmp; + pDest += samplesPerPixel; + } +} + + +template +void TransformLine(Triplet* pDest, const Triplet* pSrc, int pixelCount, TRANSFORM& transform) +{ + for (int i = 0; i < pixelCount; ++i) + { + pDest[i] = transform(pSrc[i].v1, pSrc[i].v2, pSrc[i].v3); + } +} + + +template +void TransformLineToTriplet(const SAMPLE* ptypeInput, LONG pixelStrideIn, Triplet* pbyteBuffer, LONG pixelStride, TRANSFORM& transform) +{ + int cpixel = MIN(pixelStride, pixelStrideIn); + Triplet* ptypeBuffer = (Triplet*)pbyteBuffer; + + for (int x = 0; x < cpixel; ++x) + { + ptypeBuffer[x] = transform(ptypeInput[x], ptypeInput[x + pixelStrideIn], ptypeInput[x + 2*pixelStrideIn]); + } +} + + +template +void TransformTripletToLine(const Triplet* pbyteInput, LONG pixelStrideIn, SAMPLE* ptypeBuffer, LONG pixelStride, TRANSFORM& transform) +{ + int cpixel = MIN(pixelStride, pixelStrideIn); + const Triplet* ptypeBufferIn = (Triplet*)pbyteInput; + + for (int x = 0; x < cpixel; ++x) + { + Triplet color = ptypeBufferIn[x]; + Triplet colorTranformed = transform(color.v1, color.v2, color.v3); + + ptypeBuffer[x] = colorTranformed.v1; + ptypeBuffer[x + pixelStride] = colorTranformed.v2; + ptypeBuffer[x + 2 *pixelStride] = colorTranformed.v3; + } +} + + +template +class ProcessTransformed : public ProcessLine +{ + typedef typename TRANSFORM::SAMPLE SAMPLE; + + ProcessTransformed(const ProcessTransformed&) {} +public: + ProcessTransformed(void* pbyteOutput, const JlsParameters& info, TRANSFORM transform) : + _pbyteOutput((BYTE*)pbyteOutput), + _info(info), + _templine(info.width * info.components), + _transform(transform), + _inverseTransform(transform) + { +// ASSERT(_info.components == sizeof(TRIPLET)/sizeof(TRIPLET::SAMPLE)); + } + + + void NewLineRequested(void* pDst, int pixelCount, int stride) + { + SAMPLE* pLine = (SAMPLE*)_pbyteOutput; + if (_info.outputBgr) + { + pLine = &_templine[0]; + memcpy(pLine, _pbyteOutput, sizeof(Triplet)*pixelCount); + TransformRgbToBgr(pLine, _info.components, pixelCount); + } + + if (_info.components == 3) + { + if (_info.ilv == ILV_SAMPLE) + { + TransformLine((Triplet*)pDst, (const Triplet*)pLine, pixelCount, _transform); + } + else + { + TransformTripletToLine((const Triplet*)pLine, pixelCount, (SAMPLE*)pDst, stride, _transform); + } + } + else if (_info.components == 4 && _info.ilv == ILV_LINE) + { + TransformQuadToLine((const Quad*)pLine, pixelCount, (SAMPLE*)pDst, stride, _transform); + } + _pbyteOutput += _info.bytesperline; + } + + + void NewLineDecoded(const void* pSrc, int pixelCount, int byteStride) + { + if (_info.components == 3) + { + if (_info.ilv == ILV_SAMPLE) + { + TransformLine((Triplet*)_pbyteOutput, (const Triplet*)pSrc, pixelCount, _inverseTransform); + } + else + { + TransformLineToTriplet((const SAMPLE*)pSrc, byteStride, (Triplet*)_pbyteOutput, pixelCount, _inverseTransform); + } + } + else if (_info.components == 4 && _info.ilv == ILV_LINE) + { + TransformLineToQuad((const SAMPLE*)pSrc, byteStride, (Quad*)_pbyteOutput, pixelCount, _inverseTransform); + } + + if (_info.outputBgr) + { + TransformRgbToBgr(_pbyteOutput, _info.components, pixelCount); + } + _pbyteOutput += _info.bytesperline; + } + + +private: + BYTE* _pbyteOutput; + const JlsParameters& _info; + OFVector _templine; + TRANSFORM _transform; + typename TRANSFORM::INVERSE _inverseTransform; +}; + + + +#endif diff --git a/dcmjpls/libcharls/pubtypes.h b/dcmjpls/libcharls/pubtypes.h new file mode 100644 index 00000000..9e2fd48a --- /dev/null +++ b/dcmjpls/libcharls/pubtypes.h @@ -0,0 +1,77 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// +#ifndef CHARLS_PUBLICTYPES +#define CHARLS_PUBLICTYPES + +#include "config.h" + +enum JLS_ERROR +{ + OK = 0, + InvalidJlsParameters, + ParameterValueNotSupported, + UncompressedBufferTooSmall, + CompressedBufferTooSmall, + InvalidCompressedData, + TooMuchCompressedData, + ImageTypeNotSupported, + UnsupportedBitDepthForTransform, + UnsupportedColorTransform, + MemoryAllocationFailure +}; + + +enum interleavemode +{ + ILV_NONE = 0, + ILV_LINE = 1, + ILV_SAMPLE = 2 +}; + + +struct JlsCustomParameters +{ + int MAXVAL; + int T1; + int T2; + int T3; + int RESET; +}; + + +struct JlsRect +{ + int X, Y; + int Width, Height; +}; + + +struct JfifParameters +{ + int Ver; + char units; + int XDensity; + int YDensity; + short Xthumb; + short Ythumb; + void* pdataThumbnail; // user must set buffer which size is Xthumb*Ythumb*3(RGB) before JpegLsDecode() +}; + + +struct JlsParameters +{ + int width; + int height; + int bitspersample; + int bytesperline; // for [source (at encoding)][decoded (at decoding)] pixel image in user buffer + int components; + int allowedlossyerror; + enum interleavemode ilv; + int colorTransform; + char outputBgr; + struct JlsCustomParameters custom; + struct JfifParameters jfif; +}; + +#endif diff --git a/dcmjpls/libcharls/scan.h b/dcmjpls/libcharls/scan.h new file mode 100644 index 00000000..0cee4d4a --- /dev/null +++ b/dcmjpls/libcharls/scan.h @@ -0,0 +1,859 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + +#ifndef CHARLS_SCAN +#define CHARLS_SCAN + +#include "dcmtk/ofstd/ofmap.h" /* For OFPair */ +#include "dcmtk/ofstd/oftypes.h" /* For OFTypename */ + +#include "lokuptbl.h" + +// This file contains the code for handling a "scan". Usually an image is encoded as a single scan. + + +#ifdef _MSC_VER +#pragma warning (disable: 4127) +#endif + + +extern CTable decodingTables[16]; +extern OFVector rgquant8Ll; +extern OFVector rgquant10Ll; +extern OFVector rgquant12Ll; +extern OFVector rgquant16Ll; +// +// Apply +// +inlinehint LONG ApplySign(LONG i, LONG sign) +{ return (sign ^ i) - sign; } + + + +// Two alternatives for GetPredictedValue() (second is slightly faster due to reduced branching) + +#if 0 + +inlinehint LONG GetPredictedValue(LONG Ra, LONG Rb, LONG Rc) +{ + if (Ra < Rb) + { + if (Rc < Ra) + return Rb; + + if (Rc > Rb) + return Ra; + } + else + { + if (Rc < Rb) + return Ra; + + if (Rc > Ra) + return Rb; + } + + return Ra + Rb - Rc; +} + +#else + +inlinehint LONG GetPredictedValue(LONG Ra, LONG Rb, LONG Rc) +{ + // sign trick reduces the number of if statements (branches) + LONG sgn = BitWiseSign(Rb - Ra); + + // is Ra between Rc and Rb? + if ((sgn ^ (Rc - Ra)) < 0) + { + return Rb; + } + else if ((sgn ^ (Rb - Rc)) < 0) + { + return Ra; + } + + // default case, valid if Rc element of [Ra,Rb] + return Ra + Rb - Rc; +} + +#endif + +inlinehint LONG UnMapErrVal(LONG mappedError) +{ + //LONG sign = ~((mappedError & 1) - 1); + LONG sign = LONG(mappedError << (LONG_BITCOUNT-1)) >> (LONG_BITCOUNT-1); + return sign ^ (mappedError >> 1); +} + + + +inlinehint LONG GetMappedErrVal(LONG Errval) +{ + LONG mappedError = (Errval >> (LONG_BITCOUNT-2)) ^ (2 * Errval); + return mappedError; +} + + + +inlinehint LONG ComputeContextID(LONG Q1, LONG Q2, LONG Q3) +{ return (Q1*9 + Q2)*9 + Q3; } + + +// +// +// +template +class JlsCodec : public STRATEGY +{ +public: + typedef typename TRAITS::PIXEL PIXEL; + typedef typename TRAITS::SAMPLE SAMPLE; + +public: + + JlsCodec(const TRAITS& inTraits, const JlsParameters& info) : STRATEGY(info), + traits(inTraits), + _rect(), + _width(0), + T1(0), + T2(0), + T3(0), + _RUNindex(0), + _pquant(0), + _bCompare(0) + + { + if (Info().ilv == ILV_NONE) + { + Info().components = 1; + } + } + + + void SetPresets(const JlsCustomParameters& presets) + { + JlsCustomParameters presetDefault = ComputeDefault(traits.MAXVAL, traits.NEAR); + + InitParams(presets.T1 != 0 ? presets.T1 : presetDefault.T1, + presets.T2 != 0 ? presets.T2 : presetDefault.T2, + presets.T3 != 0 ? presets.T3 : presetDefault.T3, + presets.RESET != 0 ? presets.RESET : presetDefault.RESET); + } + + + bool IsInterleaved() + { + if (Info().ilv == ILV_NONE) + return false; + + if (Info().components == 1) + return false; + + return true; + } + + JlsParameters& Info() { return STRATEGY::_info; } + + signed char QuantizeGratientOrg(LONG Di); + inlinehint LONG QuantizeGratient(LONG Di) + { + ASSERT(QuantizeGratientOrg(Di) == *(_pquant + Di)); + return *(_pquant + Di); + } + + void InitQuantizationLUT(); + + LONG DecodeValue(LONG k, LONG limit, LONG qbpp); + inlinehint void EncodeMappedValue(LONG k, LONG mappedError, LONG limit); + + void IncrementRunIndex() + { _RUNindex = MIN(31,_RUNindex + 1); } + void DecrementRunIndex() + { _RUNindex = MAX(0,_RUNindex - 1); } + + LONG DecodeRIError(CContextRunMode& ctx); + Triplet DecodeRIPixel(Triplet Ra, Triplet Rb); + SAMPLE DecodeRIPixel(LONG Ra, LONG Rb) + { + if (ABS(Ra - Rb) <= traits.NEAR) + { + LONG ErrVal = DecodeRIError(_contextRunmode[1]); + return static_cast(traits.ComputeReconstructedSample(Ra, ErrVal)); + } + else + { + LONG ErrVal = DecodeRIError(_contextRunmode[0]); + return static_cast(traits.ComputeReconstructedSample(Rb, ErrVal * Sign(Rb - Ra))); + } + } + + + LONG DecodeRunPixels(PIXEL Ra, PIXEL* ptype, LONG cpixelMac); + LONG DoRunMode(LONG index, DecoderStrategy*); + + void EncodeRIError(CContextRunMode& ctx, LONG Errval); + SAMPLE EncodeRIPixel(LONG x, LONG Ra, LONG Rb) + { + if (ABS(Ra - Rb) <= traits.NEAR) + { + LONG ErrVal = traits.ComputeErrVal(x - Ra); + EncodeRIError(_contextRunmode[1], ErrVal); + return static_cast(traits.ComputeReconstructedSample(Ra, ErrVal)); + } + else + { + LONG ErrVal = traits.ComputeErrVal((x - Rb) * Sign(Rb - Ra)); + EncodeRIError(_contextRunmode[0], ErrVal); + return static_cast(traits.ComputeReconstructedSample(Rb, ErrVal * Sign(Rb - Ra))); + } + } + + Triplet EncodeRIPixel(Triplet x, Triplet Ra, Triplet Rb); + void EncodeRunPixels(LONG runLength, bool bEndofline); + LONG DoRunMode(LONG index, EncoderStrategy*); + + // Encode/decode a single sample. Performancewise the #1 important functions + SAMPLE DoRegular(LONG Qs, LONG, LONG pred, DecoderStrategy*) + { + LONG sign = BitWiseSign(Qs); + JlsContext& ctx = _contexts[ApplySign(Qs, sign)]; + LONG k = ctx.GetGolomb(); + LONG Px = traits.CorrectPrediction(pred + ApplySign(ctx.C, sign)); + + LONG ErrVal; + const Code& code = decodingTables[k].Get(STRATEGY::PeekByte()); + if (code.GetLength() != 0) + { + STRATEGY::Skip(code.GetLength()); + ErrVal = code.GetValue(); + ASSERT(ABS(ErrVal) < 65535); + } + else + { + ErrVal = UnMapErrVal(DecodeValue(k, traits.LIMIT, traits.qbpp)); + if (ABS(ErrVal) > 65535) + throw JlsException(InvalidCompressedData); + } + ErrVal = ErrVal ^ ((traits.NEAR == 0) ? ctx.GetErrorCorrection(k) : 0); + ctx.UpdateVariables(ErrVal, traits.NEAR, traits.RESET); + ErrVal = ApplySign(ErrVal, sign); + return traits.ComputeReconstructedSample(Px, ErrVal); + } + + + SAMPLE DoRegular(LONG Qs, LONG x, LONG pred, EncoderStrategy*) + { + LONG sign = BitWiseSign(Qs); + JlsContext& ctx = _contexts[ApplySign(Qs, sign)]; + LONG k = ctx.GetGolomb(); + LONG Px = traits.CorrectPrediction(pred + ApplySign(ctx.C, sign)); + + LONG ErrVal = traits.ComputeErrVal(ApplySign(x - Px, sign)); + + EncodeMappedValue(k, GetMappedErrVal(ctx.GetErrorCorrection(k | traits.NEAR) ^ ErrVal), traits.LIMIT); + ctx.UpdateVariables(ErrVal, traits.NEAR, traits.RESET); + ASSERT(traits.IsNear(traits.ComputeReconstructedSample(Px, ApplySign(ErrVal, sign)), x)); + return static_cast(traits.ComputeReconstructedSample(Px, ApplySign(ErrVal, sign))); + } + + + + void DoLine(SAMPLE* pdummy); + void DoLine(Triplet* pdummy); + void DoScan(BYTE **ptr, size_t *size, size_t offset); + +public: + ProcessLine* CreateProcess(void* pvoidOut); + void InitDefault(); + void InitParams(LONG t1, LONG t2, LONG t3, LONG nReset); + + size_t EncodeScan(const void* rawData, BYTE **ptr, size_t *size, size_t offset, bool compare); + size_t DecodeScan(void* rawData, const JlsRect& size, BYTE **buf, size_t *buf_size, size_t offset, bool bCompare); + +protected: + // codec parameters + TRAITS traits; + JlsRect _rect; + int _width; + LONG T1; + LONG T2; + LONG T3; + + // compression context + JlsContext _contexts[365]; + CContextRunMode _contextRunmode[2]; + LONG _RUNindex; + PIXEL* _previousLine; // previous line ptr + PIXEL* _currentLine; // current line ptr + + + // quantization lookup table + signed char* _pquant; + OFVector _rgquant; + + // debugging + bool _bCompare; +}; + + +// Functions to build tables used to decode short golomb codes. + +inlinehint OFPair CreateEncodedValue(LONG k, LONG mappedError) +{ + LONG highbits = mappedError >> k; + return OFMake_pair(highbits + k + 1, (LONG(1) << k) | (mappedError & ((LONG(1) << k) - 1))); +} + + +CTable InitTable(LONG k) +{ + CTable table; + short nerr; + for (nerr = 0; ; nerr++) + { + // Q is not used when k != 0 + LONG merrval = GetMappedErrVal(nerr);//, k, -1); + OFPair paircode = CreateEncodedValue(k, merrval); + if (paircode.first > CTable::cbit) + break; + + Code code = Code( nerr, short(paircode.first) ); + table.AddEntry(BYTE(paircode.second), code); + } + + for (nerr = -1; ; nerr--) + { + // Q is not used when k != 0 + LONG merrval = GetMappedErrVal(nerr);//, k, -1); + OFPair paircode = CreateEncodedValue(k, merrval); + if (paircode.first > CTable::cbit) + break; + + Code code = Code(nerr, short(paircode.first)); + table.AddEntry(BYTE(paircode.second), code); + } + + return table; +} + + +// Encoding/decoding of golomb codes + +template +LONG JlsCodec::DecodeValue(LONG k, LONG limit, LONG qbpp) +{ + LONG highbits = STRATEGY::ReadHighbits(); + + if (highbits >= limit - (qbpp + 1)) + return STRATEGY::ReadValue(qbpp) + 1; + + if (k == 0) + return highbits; + + return (highbits << k) + STRATEGY::ReadValue(k); +} + + + +template +inlinehint void JlsCodec::EncodeMappedValue(LONG k, LONG mappedError, LONG limit) +{ + LONG highbits = mappedError >> k; + + if (highbits < limit - traits.qbpp - 1) + { + if (highbits + 1 > 31) + { + STRATEGY::AppendToBitStream(0, highbits / 2); + highbits = highbits - highbits / 2; + } + STRATEGY::AppendToBitStream(1, highbits + 1); + STRATEGY::AppendToBitStream((mappedError & ((1 << k) - 1)), k); + return; + } + + if (limit - traits.qbpp > 31) + { + STRATEGY::AppendToBitStream(0, 31); + STRATEGY::AppendToBitStream(1, limit - traits.qbpp - 31); + } + else + { + STRATEGY::AppendToBitStream(1, limit - traits.qbpp); + } + STRATEGY::AppendToBitStream((mappedError - 1) & ((1 << traits.qbpp) - 1), traits.qbpp); +} + + +// Sets up a lookup table to "Quantize" sample difference. + +template +void JlsCodec::InitQuantizationLUT() +{ + // for lossless mode with default parameters, we have precomputed te luts for bitcounts 8,10,12 and 16 + if (traits.NEAR == 0 && traits.MAXVAL == (1 << traits.bpp) - 1) + { + JlsCustomParameters presets = ComputeDefault(traits.MAXVAL, traits.NEAR); + if (presets.T1 == T1 && presets.T2 == T2 && presets.T3 == T3) + { + if (traits.bpp == 8) + { + _pquant = &rgquant8Ll[rgquant8Ll.size() / 2 ]; + return; + } + if (traits.bpp == 10) + { + _pquant = &rgquant10Ll[rgquant10Ll.size() / 2 ]; + return; + } + if (traits.bpp == 12) + { + _pquant = &rgquant12Ll[rgquant12Ll.size() / 2 ]; + return; + } + if (traits.bpp == 16) + { + _pquant = &rgquant16Ll[rgquant16Ll.size() / 2 ]; + return; + } + } + } + + LONG RANGE = 1 << traits.bpp; + + _rgquant.resize(RANGE * 2); + + _pquant = &_rgquant[RANGE]; + for (LONG i = -RANGE; i < RANGE; ++i) + { + _pquant[i] = QuantizeGratientOrg(i); + } +} + + +template +signed char JlsCodec::QuantizeGratientOrg(LONG Di) +{ + if (Di <= -T3) return -4; + if (Di <= -T2) return -3; + if (Di <= -T1) return -2; + if (Di < -traits.NEAR) return -1; + if (Di <= traits.NEAR) return 0; + if (Di < T1) return 1; + if (Di < T2) return 2; + if (Di < T3) return 3; + + return 4; +} + + + +// RI = Run interruption: functions that handle the sample terminating a run. + +template +LONG JlsCodec::DecodeRIError(CContextRunMode& ctx) +{ + LONG k = ctx.GetGolomb(); + LONG EMErrval = DecodeValue(k, traits.LIMIT - J[_RUNindex]-1, traits.qbpp); + LONG Errval = ctx.ComputeErrVal(EMErrval + ctx._nRItype, k); + ctx.UpdateVariables(Errval, EMErrval); + return Errval; +} + + + +template +void JlsCodec::EncodeRIError(CContextRunMode& ctx, LONG Errval) +{ + LONG k = ctx.GetGolomb(); + bool map = ctx.ComputeMap(Errval, k); + LONG EMErrval = 2 * ABS(Errval) - ctx._nRItype - map; + + ASSERT(Errval == ctx.ComputeErrVal(EMErrval + ctx._nRItype, k)); + EncodeMappedValue(k, EMErrval, traits.LIMIT-J[_RUNindex]-1); + ctx.UpdateVariables(Errval, EMErrval); +} + + +template +Triplet JlsCodec::DecodeRIPixel(Triplet Ra, Triplet Rb) +{ + LONG Errval1 = DecodeRIError(_contextRunmode[0]); + LONG Errval2 = DecodeRIError(_contextRunmode[0]); + LONG Errval3 = DecodeRIError(_contextRunmode[0]); + + return Triplet(traits.ComputeReconstructedSample(Rb.v1, Errval1 * Sign(Rb.v1 - Ra.v1)), + traits.ComputeReconstructedSample(Rb.v2, Errval2 * Sign(Rb.v2 - Ra.v2)), + traits.ComputeReconstructedSample(Rb.v3, Errval3 * Sign(Rb.v3 - Ra.v3))); +} + + + +template +Triplet JlsCodec::EncodeRIPixel(Triplet x, Triplet Ra, Triplet Rb) +{ + LONG errval1 = traits.ComputeErrVal(Sign(Rb.v1 - Ra.v1) * (x.v1 - Rb.v1)); + EncodeRIError(_contextRunmode[0], errval1); + + LONG errval2 = traits.ComputeErrVal(Sign(Rb.v2 - Ra.v2) * (x.v2 - Rb.v2)); + EncodeRIError(_contextRunmode[0], errval2); + + LONG errval3 = traits.ComputeErrVal(Sign(Rb.v3 - Ra.v3) * (x.v3 - Rb.v3)); + EncodeRIError(_contextRunmode[0], errval3); + + + return Triplet(traits.ComputeReconstructedSample(Rb.v1, errval1 * Sign(Rb.v1 - Ra.v1)), + traits.ComputeReconstructedSample(Rb.v2, errval2 * Sign(Rb.v2 - Ra.v2)), + traits.ComputeReconstructedSample(Rb.v3, errval3 * Sign(Rb.v3 - Ra.v3))); +} + + + +// RunMode: Functions that handle run-length encoding + +template +void JlsCodec::EncodeRunPixels(LONG runLength, bool endOfLine) +{ + while (runLength >= LONG(1 << J[_RUNindex])) + { + STRATEGY::AppendOnesToBitStream(1); + runLength = runLength - LONG(1 << J[_RUNindex]); + IncrementRunIndex(); + } + + if (endOfLine) + { + if (runLength != 0) + { + STRATEGY::AppendOnesToBitStream(1); + } + } + else + { + STRATEGY::AppendToBitStream(runLength, J[_RUNindex] + 1); // leading 0 + actual remaining length + } +} + + +template +LONG JlsCodec::DecodeRunPixels(PIXEL Ra, PIXEL* startPos, LONG cpixelMac) +{ + LONG index = 0; + while (STRATEGY::ReadBit()) + { + int count = MIN(1 << J[_RUNindex], int(cpixelMac - index)); + index += count; + ASSERT(index <= cpixelMac); + + if (count == (1 << J[_RUNindex])) + { + IncrementRunIndex(); + } + + if (index == cpixelMac) + break; + } + + + if (index != cpixelMac) + { + // incomplete run + index += (J[_RUNindex] > 0) ? STRATEGY::ReadValue(J[_RUNindex]) : 0; + } + + if (index > cpixelMac) + throw JlsException(InvalidCompressedData); + + for (LONG i = 0; i < index; ++i) + { + startPos[i] = Ra; + } + + return index; +} + +template +LONG JlsCodec::DoRunMode(LONG index, EncoderStrategy*) +{ + LONG ctypeRem = _width - index; + PIXEL* ptypeCurX = _currentLine + index; + PIXEL* ptypePrevX = _previousLine + index; + + PIXEL Ra = ptypeCurX[-1]; + + LONG runLength = 0; + + while (traits.IsNear(ptypeCurX[runLength],Ra)) + { + ptypeCurX[runLength] = Ra; + runLength++; + + if (runLength == ctypeRem) + break; + } + + EncodeRunPixels(runLength, runLength == ctypeRem); + + if (runLength == ctypeRem) + return runLength; + + ptypeCurX[runLength] = EncodeRIPixel(ptypeCurX[runLength], Ra, ptypePrevX[runLength]); + DecrementRunIndex(); + return runLength + 1; +} + + +template +LONG JlsCodec::DoRunMode(LONG startIndex, DecoderStrategy*) +{ + PIXEL Ra = _currentLine[startIndex-1]; + + LONG runLength = DecodeRunPixels(Ra, _currentLine + startIndex, _width - startIndex); + LONG endIndex = startIndex + runLength; + + if (endIndex == _width) + return endIndex - startIndex; + + // run interruption + PIXEL Rb = _previousLine[endIndex]; + _currentLine[endIndex] = DecodeRIPixel(Ra, Rb); + DecrementRunIndex(); + return endIndex - startIndex + 1; +} + + +// DoLine: Encodes/Decodes a scanline of samples + +template +void JlsCodec::DoLine(SAMPLE*) +{ + LONG index = 0; + LONG Rb = _previousLine[index-1]; + LONG Rd = _previousLine[index]; + + while(index < _width) + { + LONG Ra = _currentLine[index -1]; + LONG Rc = Rb; + Rb = Rd; + Rd = _previousLine[index + 1]; + + LONG Qs = ComputeContextID(QuantizeGratient(Rd - Rb), QuantizeGratient(Rb - Rc), QuantizeGratient(Rc - Ra)); + + if (Qs != 0) + { + _currentLine[index] = DoRegular(Qs, _currentLine[index], GetPredictedValue(Ra, Rb, Rc), (STRATEGY*)(NULL)); + index++; + } + else + { + index += DoRunMode(index, (STRATEGY*)(NULL)); + Rb = _previousLine[index-1]; + Rd = _previousLine[index]; + } + } +} + + +// DoLine: Encodes/Decodes a scanline of triplets in ILV_SAMPLE mode + +template +void JlsCodec::DoLine(Triplet*) +{ + LONG index = 0; + while(index < _width) + { + Triplet Ra = _currentLine[index -1]; + Triplet Rc = _previousLine[index-1]; + Triplet Rb = _previousLine[index]; + Triplet Rd = _previousLine[index + 1]; + + LONG Qs1 = ComputeContextID(QuantizeGratient(Rd.v1 - Rb.v1), QuantizeGratient(Rb.v1 - Rc.v1), QuantizeGratient(Rc.v1 - Ra.v1)); + LONG Qs2 = ComputeContextID(QuantizeGratient(Rd.v2 - Rb.v2), QuantizeGratient(Rb.v2 - Rc.v2), QuantizeGratient(Rc.v2 - Ra.v2)); + LONG Qs3 = ComputeContextID(QuantizeGratient(Rd.v3 - Rb.v3), QuantizeGratient(Rb.v3 - Rc.v3), QuantizeGratient(Rc.v3 - Ra.v3)); + + + if (Qs1 == 0 && Qs2 == 0 && Qs3 == 0) + { + index += DoRunMode(index, (STRATEGY*)(NULL)); + } + else + { + Triplet Rx; + Rx.v1 = DoRegular(Qs1, _currentLine[index].v1, GetPredictedValue(Ra.v1, Rb.v1, Rc.v1), (STRATEGY*)(NULL)); + Rx.v2 = DoRegular(Qs2, _currentLine[index].v2, GetPredictedValue(Ra.v2, Rb.v2, Rc.v2), (STRATEGY*)(NULL)); + Rx.v3 = DoRegular(Qs3, _currentLine[index].v3, GetPredictedValue(Ra.v3, Rb.v3, Rc.v3), (STRATEGY*)(NULL)); + _currentLine[index] = Rx; + index++; + } + } +} + + +// DoScan: Encodes or decodes a scan. +// In ILV_SAMPLE mode, multiple components are handled in DoLine +// In ILV_LINE mode, a call do DoLine is made for every component +// In ILV_NONE mode, DoScan is called for each component + +template +void JlsCodec::DoScan(BYTE **ptr, size_t *size, size_t offset) +{ + _width = Info().width; + + STRATEGY::Init(ptr, size, offset); + + LONG pixelstride = _width + 4; + int components = Info().ilv == ILV_LINE ? Info().components : 1; + + OFVector vectmp(2 * components * pixelstride); + OFVector rgRUNindex(components); + + for (LONG line = 0; line < Info().height; ++line) + { + _previousLine = &vectmp[1]; + _currentLine = &vectmp[1 + components * pixelstride]; + if ((line & 1) == 1) + { + PIXEL *tmp = _previousLine; + _previousLine = _currentLine; + _currentLine = tmp; + + } + + STRATEGY::OnLineBegin(_width, _currentLine, pixelstride); + + for (int component = 0; component < components; ++component) + { + _RUNindex = rgRUNindex[component]; + + // initialize edge pixels used for prediction + _previousLine[_width] = _previousLine[_width - 1]; + _currentLine[-1] = _previousLine[0]; + DoLine((PIXEL*) NULL); // dummy arg for overload resolution + + rgRUNindex[component] = _RUNindex; + _previousLine += pixelstride; + _currentLine += pixelstride; + } + + if (_rect.Y <= line && line < _rect.Y + _rect.Height) + { + STRATEGY::OnLineEnd(_rect.Width, _currentLine + _rect.X - (components * pixelstride), pixelstride); + } + } + + STRATEGY::EndScan(); +} + + +// Factory function for ProcessLine objects to copy/transform unencoded pixels to/from our scanline buffers. + +template +ProcessLine* JlsCodec::CreateProcess(void* pvoidOut) +{ + if (!IsInterleaved()) + return new PostProcesSingleComponent(pvoidOut, Info(), sizeof(typename TRAITS::PIXEL)); + + if (Info().colorTransform == 0) + return new ProcessTransformed >(pvoidOut, Info(), TransformNone()); + + if (Info().bitspersample == sizeof(SAMPLE)*8) + { + switch(Info().colorTransform) + { + case COLORXFORM_HP1 : return new ProcessTransformed >(pvoidOut, Info(), TransformHp1()); break; + case COLORXFORM_HP2 : return new ProcessTransformed >(pvoidOut, Info(), TransformHp2()); break; + case COLORXFORM_HP3 : return new ProcessTransformed >(pvoidOut, Info(), TransformHp3()); break; + default: throw JlsException(UnsupportedColorTransform); + } + } + else if (Info().bitspersample > 8) + { + int shift = 16 - Info().bitspersample; + switch(Info().colorTransform) + { + case COLORXFORM_HP1 : return new ProcessTransformed > >(pvoidOut, Info(), TransformShifted >(shift)); break; + case COLORXFORM_HP2 : return new ProcessTransformed > >(pvoidOut, Info(), TransformShifted >(shift)); break; + case COLORXFORM_HP3 : return new ProcessTransformed > >(pvoidOut, Info(), TransformShifted >(shift)); break; + default: throw JlsException(UnsupportedColorTransform); + } + } + throw JlsException(UnsupportedBitDepthForTransform); +} + + + +// Setup codec for encoding and calls DoScan + +template +size_t JlsCodec::EncodeScan(const void* rawData, BYTE **ptr, size_t *size, size_t offset, bool compare) +{ + STRATEGY::_processLine.reset(CreateProcess(const_cast(rawData))); + + if (compare) + { + STRATEGY::_qdecoder.reset(new JlsCodec(traits, Info())); + STRATEGY::_qdecoder->Init(ptr, size, offset); + } + + DoScan(ptr, size, offset); + + return STRATEGY::GetLength(); + +} + +// Setup codec for decoding and calls DoScan + +template +size_t JlsCodec::DecodeScan(void* rawData, const JlsRect& rect, BYTE **ptr, size_t *size, size_t offset, bool bCompare) +{ + STRATEGY::_processLine.reset(CreateProcess(rawData)); + + _bCompare = bCompare; + + BYTE rgbyte[20]; + + size_t readBytes = 0; + ::memcpy(rgbyte, *ptr + offset + readBytes, 4); + readBytes += 4; + + size_t cbyteScanheader = rgbyte[3] - 2; + + if (cbyteScanheader > sizeof(rgbyte)) + throw JlsException(InvalidCompressedData); + + ::memcpy(rgbyte, *ptr + offset + readBytes, cbyteScanheader); + readBytes += cbyteScanheader; + + _rect = rect; + + DoScan(ptr, size, offset + readBytes); + + return STRATEGY::GetCurBytePos() - (*ptr + offset); +} + +// Initialize the codec data structures. Depends on JPEG-LS parameters like T1-T3. + +template +void JlsCodec::InitParams(LONG t1, LONG t2, LONG t3, LONG nReset) +{ + T1 = t1; + T2 = t2; + T3 = t3; + + InitQuantizationLUT(); + + LONG A = MAX(2, (traits.RANGE + 32)/64); + for (unsigned int Q = 0; Q < sizeof(_contexts) / sizeof(_contexts[0]); ++Q) + { + _contexts[Q] = JlsContext(A); + } + + _contextRunmode[0] = CContextRunMode(MAX(2, (traits.RANGE + 32)/64), 0, nReset); + _contextRunmode[1] = CContextRunMode(MAX(2, (traits.RANGE + 32)/64), 1, nReset); + _RUNindex = 0; +} + +#endif diff --git a/dcmjpls/libcharls/streams.h b/dcmjpls/libcharls/streams.h new file mode 100644 index 00000000..a2ef422c --- /dev/null +++ b/dcmjpls/libcharls/streams.h @@ -0,0 +1,189 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// +#ifndef CHARLS_STREAMS +#define CHARLS_STREAMS + +#define INCLUDE_NEW +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/ofstd/ofbmanip.h" +#include "util.h" + + + +// This file defines JPEG-LS streams: The header and the actual pixel data. Header markers have fixed length, the pixeldata not. + + + +class JpegSegment; + +enum JPEGLS_ColorXForm +{ + // default (RGB) + COLORXFORM_NONE = 0, + + // Color transforms as defined by HP + COLORXFORM_HP1, + COLORXFORM_HP2, + COLORXFORM_HP3, + + // Defined by HP but not supported by CharLS + COLORXFORM_RGB_AS_YUV_LOSSY, + COLORXFORM_MATRIX +}; + +// +// JLSOutputStream: minimal implementation to write JPEG header streams +// +class JLSOutputStream +{ + friend class JpegMarkerSegment; + friend class JpegImageDataSegment; + +public: + JLSOutputStream(); + virtual ~JLSOutputStream(); + + void Init(Size size, LONG bitsPerSample, LONG ccomp); + void AddScan(const void* compareData, const JlsParameters* pparams); + void AddLSE(const JlsCustomParameters* pcustom); + void AddColorTransform(int i); + size_t GetBytesWritten() + { return _cbytesWritten; } + + size_t Write(BYTE **ptr, size_t *size, size_t offset); + + BYTE **get_pos() { return _position; } + + size_t *get_size() { return _size; } + + size_t get_offset() { return _current_offset; } + + void EnableCompare(bool bCompare) + { _bCompare = bCompare; } +private: + void WriteByte(BYTE val) + { + ASSERT(!_bCompare || (*_position)[_current_offset] == val); + + if (_current_offset == *_size) { + *_position = re_alloc(*_position, _size); + } + + (*_position)[_current_offset++] = val; + + _cbytesWritten++; + } + + void WriteBytes(const OFVector& rgbyte) + { + for (size_t i = 0; i < rgbyte.size(); ++i) + { + WriteByte(rgbyte[i]); + } + } + + void WriteWord(USHORT val) + { + WriteByte(BYTE(val / 0x100)); + WriteByte(BYTE(val % 0x100)); + } + + void seek(size_t n) + { + _cbytesWritten += n; + _current_offset += n; + } + + bool _bCompare; + +private: + static BYTE *re_alloc(BYTE *old_ptr, size_t *old_size) + { + size_t new_size = *old_size * 2; +#ifdef HAVE_STD__NOTHROW + BYTE *new_ptr = new BYTE[new_size]; +#else + BYTE *new_ptr = new BYTE[new_size]; +#endif + if (new_ptr == NULL) { + throw alloc_fail(); + } + + OFBitmanipTemplate::copyMem(old_ptr, new_ptr, *old_size); + + delete[] old_ptr; + + *old_size = new_size; + + return new_ptr; + } + + BYTE **_position; + size_t *_size; + size_t _current_offset; + size_t _cbytesWritten; + LONG _icompLast; + OFVector _segments; +}; + + +// +// JLSInputStream: minimal implementation to read JPEG header streams +// +class JLSInputStream +{ +public: + JLSInputStream(const BYTE* pdata, size_t cbyteLength); + + size_t GetBytesRead() + { return _cbyteOffset; } + + const JlsParameters& GetMetadata() const + { return _info; } + + const JlsCustomParameters& GetCustomPreset() const + { return _info.custom; } + + void Read(void* pvoid, size_t cbyteAvailable); + void ReadHeader(); + + void EnableCompare(bool bCompare) + { _bCompare = bCompare; } + + void SetInfo(JlsParameters* info) { _info = *info; } + + void SetRect(JlsRect rect) { _rect = rect; } + +private: + void ReadPixels(void* pvoid, size_t cbyteAvailable); + void ReadScan(void*); + void ReadStartOfScan(); + void ReadPresetParameters(); + void ReadComment(); + void ReadStartOfFrame(); + BYTE ReadByte(); + int ReadWord(); + void ReadNBytes(OFVector& dst, int byteCount); + + // JFIF + void ReadJfif(); + // Color Transform Application Markers & Code Stream (HP extension) + void ReadColorSpace(); + void ReadColorXForm(); + +private: + const BYTE* _pdata; + size_t _cbyteOffset; + size_t _cbyteLength; + bool _bCompare; + JlsParameters _info; + JlsRect _rect; +}; + + + + +#endif diff --git a/dcmjpls/libcharls/util.h b/dcmjpls/libcharls/util.h new file mode 100644 index 00000000..4b39704f --- /dev/null +++ b/dcmjpls/libcharls/util.h @@ -0,0 +1,153 @@ +// +// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. +// + + +#ifndef CHARLS_UTIL +#define CHARLS_UTIL + +#define INCLUDE_CSTDDEF +#include "dcmtk/ofstd/ofstdinc.h" +#include "pubtypes.h" + +#ifndef MAX +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef MIN +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#ifndef ABS +#define ABS(a) (((a) > 0) ? (a) : -(a)) +#endif + +class alloc_fail { }; + +inline LONG log_2(LONG n) +{ + LONG x = 0; + while (n > (LONG(1) << x)) + { + ++x; + } + return x; + +} + +struct Size +{ + Size(LONG width, LONG height) : + cx(width), + cy(height) + {} + LONG cx; + LONG cy; +}; + + + +inline LONG Sign(LONG n) + { return (n >> (LONG_BITCOUNT-1)) | 1;} + +inline LONG BitWiseSign(LONG i) + { return i >> (LONG_BITCOUNT-1); } + + +template +struct Triplet +{ + Triplet() : + v1(0), + v2(0), + v3(0) + {} + + Triplet(LONG x1, LONG x2, LONG x3) : + v1((SAMPLE)x1), + v2((SAMPLE)x2), + v3((SAMPLE)x3) + {} + + union + { + SAMPLE v1; + SAMPLE R; + }; + union + { + SAMPLE v2; + SAMPLE G; + }; + union + { + SAMPLE v3; + SAMPLE B; + }; +}; + +inline bool operator==(const Triplet& lhs, const Triplet& rhs) + { return lhs.v1 == rhs.v1 && lhs.v2 == rhs.v2 && lhs.v3 == rhs.v3; } + +inline bool operator!=(const Triplet& lhs, const Triplet& rhs) + { return !(lhs == rhs); } + + +template +struct Quad : public Triplet +{ + Quad() : + v4(0) + {} + + Quad(Triplet triplet, LONG alpha) : Triplet(triplet), A((sample)alpha) + {} + + union + { + sample v4; + sample A; + }; +}; + + + +template +struct FromBigEndian +{ +}; + +template <> +struct FromBigEndian<4> +{ + inlinehint static unsigned int Read(BYTE* pbyte) + { + return (pbyte[0] << 24) + (pbyte[1] << 16) + (pbyte[2] << 8) + (pbyte[3] << 0); + } +}; + + + +template <> +struct FromBigEndian<8> +{ + inlinehint static size_t Read(BYTE* pbyte) + { + size_t a = FromBigEndian<4>::Read(&pbyte[0]); + size_t b = FromBigEndian<4>::Read(&pbyte[4]); + return ((a << 16) << 16) + b; + } +}; + + +class JlsException +{ +public: + JlsException(JLS_ERROR error) : _error(error) + { } + + JLS_ERROR _error; +}; + + +#endif diff --git a/dcmjpls/libsrc/CMakeLists.txt b/dcmjpls/libsrc/CMakeLists.txt new file mode 100644 index 00000000..314face7 --- /dev/null +++ b/dcmjpls/libsrc/CMakeLists.txt @@ -0,0 +1,7 @@ +# declare additional include directories +include_directories("${dcmjpls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmjpls_SOURCE_DIR}/libcharls" ${ZLIB_INCDIR}) + +# create library from source files +DCMTK_ADD_LIBRARY(dcmjpls djcparam djdecode djencode djrparam djcodecd djutils djcodece) + +DCMTK_TARGET_LINK_MODULES(dcmjpls ofstd oflog dcmdata dcmimgle dcmimage charls) diff --git a/dcmjpls/libsrc/Makefile.dep b/dcmjpls/libsrc/Makefile.dep new file mode 100644 index 00000000..82d77df9 --- /dev/null +++ b/dcmjpls/libsrc/Makefile.dep @@ -0,0 +1,407 @@ +djcodecd.o: djcodecd.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpls/djcodecd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpls/dldefine.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpxitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmjpls/djcparam.h ../include/dcmtk/dcmjpls/djlsutil.h \ + djerror.h ../../dcmjpls/libcharls/intrface.h \ + ../../dcmjpls/libcharls/pubtypes.h ../../dcmjpls/libcharls/config.h +djcodece.o: djcodece.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpls/djcodece.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../include/dcmtk/dcmjpls/dldefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpxitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../include/dcmtk/dcmjpls/djcparam.h ../include/dcmtk/dcmjpls/djlsutil.h \ + ../include/dcmtk/dcmjpls/djrparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h djerror.h \ + ../../dcmjpls/libcharls/intrface.h ../../dcmjpls/libcharls/pubtypes.h \ + ../../dcmjpls/libcharls/config.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h +djcparam.o: djcparam.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpls/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpls/djlsutil.h ../include/dcmtk/dcmjpls/dldefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +djdecode.o: djdecode.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpls/djdecode.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmjpls/djlsutil.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmjpls/dldefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpls/djcparam.h ../include/dcmtk/dcmjpls/djcodecd.h +djencode.o: djencode.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpls/djencode.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmjpls/djlsutil.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmjpls/dldefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmjpls/djcparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpls/djcodece.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h +djrparam.o: djrparam.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpls/djrparam.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmjpls/dldefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +djutils.o: djutils.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmjpls/djlsutil.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmjpls/dldefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h diff --git a/dcmjpls/libsrc/Makefile.in b/dcmjpls/libsrc/Makefile.in new file mode 100644 index 00000000..21752238 --- /dev/null +++ b/dcmjpls/libsrc/Makefile.in @@ -0,0 +1,53 @@ +# +# Makefile for dcmjpls/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle +libcharlsdir = $(top_srcdir)/../dcmjpls/libcharls + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include \ + -I$(dcmimgledir)/include -I$(libcharlsdir) +LOCALDEFS = + +objs = djcodecd.o djcodece.o djcparam.o djdecode.o djencode.o djrparam.o djutils.o + +library = libdcmjpls.$(LIBEXT) + + +all: $(library) + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmjpls/libsrc/djcodecd.cc b/dcmjpls/libsrc/djcodecd.cc new file mode 100644 index 00000000..4b3b2390 --- /dev/null +++ b/dcmjpls/libsrc/djcodecd.cc @@ -0,0 +1,779 @@ +/* + * + * Copyright (C) 2007-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Marco Eichelberg, Uli Schlachter + * + * Purpose: codec classes for JPEG-LS decoders. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djcodecd.h" + +#include "dcmtk/ofstd/ofstream.h" /* for ofstream */ +#include "dcmtk/ofstd/ofcast.h" /* for casts */ +#include "dcmtk/ofstd/offile.h" /* for class OFFile */ +#include "dcmtk/ofstd/ofstd.h" /* for class OFStandard */ +#include "dcmtk/dcmdata/dcdatset.h" /* for class DcmDataset */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for class DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/dcvrpobw.h" /* for class DcmPolymorphOBOW */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary() */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmGenerateUniqueIdentifer()*/ +#include "dcmtk/dcmjpls/djcparam.h" /* for class DJLSCodecParameter */ +#include "djerror.h" /* for private class DJLSError */ + +// JPEG-LS library (CharLS) includes +#include "intrface.h" + +E_TransferSyntax DJLSLosslessDecoder::supportedTransferSyntax() const +{ + return EXS_JPEGLSLossless; +} + +E_TransferSyntax DJLSNearLosslessDecoder::supportedTransferSyntax() const +{ + return EXS_JPEGLSLossy; +} + +// -------------------------------------------------------------------------- + +DJLSDecoderBase::DJLSDecoderBase() +: DcmCodec() +{ +} + + +DJLSDecoderBase::~DJLSDecoderBase() +{ +} + + +OFBool DJLSDecoderBase::canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const +{ + // this codec only handles conversion from JPEG-LS to uncompressed. + + DcmXfer newRep(newRepType); + if (newRep.isNotEncapsulated() && (oldRepType == supportedTransferSyntax())) + return OFTrue; + + return OFFalse; +} + + +OFCondition DJLSDecoderBase::decode( + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * pixSeq, + DcmPolymorphOBOW& uncompressedPixelData, + const DcmCodecParameter * cp, + const DcmStack& objStack) const +{ + // retrieve pointer to dataset from parameter stack + DcmStack localStack(objStack); + (void)localStack.pop(); // pop pixel data element from stack + DcmObject *dobject = localStack.pop(); // this is the item in which the pixel data is located + if ((!dobject)||((dobject->ident()!= EVR_dataset) && (dobject->ident()!= EVR_item))) return EC_InvalidTag; + DcmItem *dataset = OFstatic_cast(DcmItem *, dobject); + OFBool numberOfFramesPresent = OFFalse; + + // determine properties of uncompressed dataset + Uint16 imageSamplesPerPixel = 0; + if (dataset->findAndGetUint16(DCM_SamplesPerPixel, imageSamplesPerPixel).bad()) return EC_TagNotFound; + + // we only handle one or three samples per pixel + if ((imageSamplesPerPixel != 3) && (imageSamplesPerPixel != 1)) return EC_InvalidTag; + + Uint16 imageRows = 0; + if (dataset->findAndGetUint16(DCM_Rows, imageRows).bad()) return EC_TagNotFound; + if (imageRows < 1) return EC_InvalidTag; + + Uint16 imageColumns = 0; + if (dataset->findAndGetUint16(DCM_Columns, imageColumns).bad()) return EC_TagNotFound; + if (imageColumns < 1) return EC_InvalidTag; + + // number of frames is an optional attribute - we don't mind if it isn't present. + Sint32 imageFrames = 0; + if (dataset->findAndGetSint32(DCM_NumberOfFrames, imageFrames).good()) numberOfFramesPresent = OFTrue; + + if (imageFrames >= OFstatic_cast(Sint32, pixSeq->card())) + imageFrames = pixSeq->card() - 1; // limit number of frames to number of pixel items - 1 + if (imageFrames < 1) + imageFrames = 1; // default in case the number of frames attribute is absent or contains garbage + + Uint16 imageBitsStored = 0; + if (dataset->findAndGetUint16(DCM_BitsStored, imageBitsStored).bad()) return EC_TagNotFound; + + Uint16 imageBitsAllocated = 0; + if (dataset->findAndGetUint16(DCM_BitsAllocated, imageBitsAllocated).bad()) return EC_TagNotFound; + + Uint16 imageHighBit = 0; + if (dataset->findAndGetUint16(DCM_HighBit, imageHighBit).bad()) return EC_TagNotFound; + + //we only support up to 16 bits per sample + if ((imageBitsStored < 1) || (imageBitsStored > 16)) return EC_JLSUnsupportedBitDepth; + + // determine the number of bytes per sample (bits allocated) for the de-compressed object. + Uint16 bytesPerSample = 1; + if (imageBitsStored > 8) bytesPerSample = 2; + else if (imageBitsAllocated > 8) bytesPerSample = 2; + + // compute size of uncompressed frame, in bytes + Uint32 frameSize = bytesPerSample * imageRows * imageColumns * imageSamplesPerPixel; + + // compute size of pixel data attribute, in bytes + Uint32 totalSize = frameSize * imageFrames; + if (totalSize & 1) totalSize++; // align on 16-bit word boundary + + // assume we can cast the codec parameter to what we need + const DJLSCodecParameter *djcp = OFreinterpret_cast(const DJLSCodecParameter *, cp); + + // determine planar configuration for uncompressed data + OFString imageSopClass; + OFString imagePhotometricInterpretation; + dataset->findAndGetOFString(DCM_SOPClassUID, imageSopClass); + dataset->findAndGetOFString(DCM_PhotometricInterpretation, imagePhotometricInterpretation); + + // allocate space for uncompressed pixel data element + Uint16 *pixeldata16 = NULL; + OFCondition result = uncompressedPixelData.createUint16Array(totalSize/sizeof(Uint16), pixeldata16); + if (result.bad()) return result; + + Uint8 *pixeldata8 = OFreinterpret_cast(Uint8 *, pixeldata16); + Sint32 currentFrame = 0; + Uint32 currentItem = 1; // item 0 contains the offset table + OFBool done = OFFalse; + OFBool forceSingleFragmentPerFrame = djcp->getForceSingleFragmentPerFrame(); + + while (result.good() && !done) + { + DCMJPLS_DEBUG("JPEG-LS decoder processes frame " << (currentFrame+1)); + + result = decodeFrame(pixSeq, djcp, dataset, currentFrame, currentItem, pixeldata8, frameSize, + imageFrames, imageColumns, imageRows, imageSamplesPerPixel, bytesPerSample); + + // check if we should enforce "one fragment per frame" while + // decompressing a multi-frame image even if stream suspension occurs + if ((result == EC_JLSInvalidCompressedData) && forceSingleFragmentPerFrame) + { + // frame is incomplete. Nevertheless skip to next frame. + // This permits decompression of faulty multi-frame images. + DCMJPLS_WARN("JPEG-LS bitstream invalid or incomplete, ignoring (but image is likely to be incomplete)."); + result = EC_Normal; + } + + if (result.good()) + { + // increment frame number, check if we're finished + if (++currentFrame == imageFrames) done = OFTrue; + pixeldata8 += frameSize; + } + } + + // Number of Frames might have changed in case the previous value was wrong + if (result.good() && (numberOfFramesPresent || (imageFrames > 1))) + { + char numBuf[20]; + sprintf(numBuf, "%ld", OFstatic_cast(long, imageFrames)); + result = ((DcmItem *)dataset)->putAndInsertString(DCM_NumberOfFrames, numBuf); + } + + if (result.good() && (dataset->ident() == EVR_dataset)) + { + DcmItem *ditem = OFreinterpret_cast(DcmItem*, dataset); + + // the following operations do not affect the Image Pixel Module + // but other modules such as SOP Common. We only perform these + // changes if we're on the main level of the dataset, + // which should always identify itself as dataset, not as item. + if (djcp->getUIDCreation() == EJLSUC_always) + { + // create new SOP instance UID + result = DcmCodec::newInstance(ditem, NULL, NULL, NULL); + } + + // set Lossy Image Compression to "01" (see DICOM part 3, C.7.6.1.1.5) + if (result.good() && (supportedTransferSyntax() == EXS_JPEGLSLossy)) result = ditem->putAndInsertString(DCM_LossyImageCompression, "01"); + + } + + return result; +} + + +OFCondition DJLSDecoderBase::decodeFrame( + const DcmRepresentationParameter * /* fromParam */, + DcmPixelSequence *fromPixSeq, + const DcmCodecParameter *cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& currentItem, + void * buffer, + Uint32 bufSize, + OFString& decompressedColorModel) const +{ + OFCondition result = EC_Normal; + + // assume we can cast the codec parameter to what we need + const DJLSCodecParameter *djcp = OFreinterpret_cast(const DJLSCodecParameter *, cp); + + // determine properties of uncompressed dataset + Uint16 imageSamplesPerPixel = 0; + if (dataset->findAndGetUint16(DCM_SamplesPerPixel, imageSamplesPerPixel).bad()) return EC_TagNotFound; + // we only handle one or three samples per pixel + if ((imageSamplesPerPixel != 3) && (imageSamplesPerPixel != 1)) return EC_InvalidTag; + + Uint16 imageRows = 0; + if (dataset->findAndGetUint16(DCM_Rows, imageRows).bad()) return EC_TagNotFound; + if (imageRows < 1) return EC_InvalidTag; + + Uint16 imageColumns = 0; + if (dataset->findAndGetUint16(DCM_Columns, imageColumns).bad()) return EC_TagNotFound; + if (imageColumns < 1) return EC_InvalidTag; + + Uint16 imageBitsStored = 0; + if (dataset->findAndGetUint16(DCM_BitsStored, imageBitsStored).bad()) return EC_TagNotFound; + + Uint16 imageBitsAllocated = 0; + if (dataset->findAndGetUint16(DCM_BitsAllocated, imageBitsAllocated).bad()) return EC_TagNotFound; + + //we only support up to 16 bits per sample + if ((imageBitsStored < 1) || (imageBitsStored > 16)) return EC_JLSUnsupportedBitDepth; + + // determine the number of bytes per sample (bits allocated) for the de-compressed object. + Uint16 bytesPerSample = 1; + if (imageBitsStored > 8) bytesPerSample = 2; + else if (imageBitsAllocated > 8) bytesPerSample = 2; + + // number of frames is an optional attribute - we don't mind if it isn't present. + Sint32 imageFrames = 0; + dataset->findAndGetSint32(DCM_NumberOfFrames, imageFrames).good(); + + if (imageFrames >= OFstatic_cast(Sint32, fromPixSeq->card())) + imageFrames = fromPixSeq->card() - 1; // limit number of frames to number of pixel items - 1 + if (imageFrames < 1) + imageFrames = 1; // default in case the number of frames attribute is absent or contains garbage + + // if the user has provided this information, we trust him. + // If the user has passed a zero, try to find out ourselves. + if (currentItem == 0) + { + result = determineStartFragment(frameNo, imageFrames, fromPixSeq, currentItem); + } + + if (result.good()) + { + // We got all the data we need from the dataset, let's start decoding + DCMJPLS_DEBUG("Starting to decode frame " << frameNo << " with fragment " << currentItem); + result = decodeFrame(fromPixSeq, djcp, dataset, frameNo, currentItem, buffer, bufSize, + imageFrames, imageColumns, imageRows, imageSamplesPerPixel, bytesPerSample); + } + + if (result.good()) + { + // retrieve color model from given dataset + result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel); + } + + return result; +} + +OFCondition DJLSDecoderBase::decodeFrame( + DcmPixelSequence * fromPixSeq, + const DJLSCodecParameter *cp, + DcmItem *dataset, + Uint32 frameNo, + Uint32& currentItem, + void * buffer, + Uint32 bufSize, + Sint32 imageFrames, + Uint16 imageColumns, + Uint16 imageRows, + Uint16 imageSamplesPerPixel, + Uint16 bytesPerSample) +{ + DcmPixelItem *pixItem = NULL; + Uint8 * jlsData = NULL; + Uint8 * jlsFragmentData = NULL; + Uint32 fragmentLength = 0; + size_t compressedSize = 0; + Uint32 fragmentsForThisFrame = 0; + OFCondition result = EC_Normal; + OFBool ignoreOffsetTable = cp->ignoreOffsetTable(); + + // compute the number of JPEG-LS fragments we need in order to decode the next frame + fragmentsForThisFrame = computeNumberOfFragments(imageFrames, frameNo, currentItem, ignoreOffsetTable, fromPixSeq); + if (fragmentsForThisFrame == 0) result = EC_JLSCannotComputeNumberOfFragments; + + // determine planar configuration for uncompressed data + OFString imageSopClass; + OFString imagePhotometricInterpretation; + dataset->findAndGetOFString(DCM_SOPClassUID, imageSopClass); + dataset->findAndGetOFString(DCM_PhotometricInterpretation, imagePhotometricInterpretation); + Uint16 imagePlanarConfiguration = 0; // 0 is color-by-pixel, 1 is color-by-plane + + if (imageSamplesPerPixel > 1) + { + switch (cp->getPlanarConfiguration()) + { + case EJLSPC_restore: + // get planar configuration from dataset + imagePlanarConfiguration = 2; // invalid value + dataset->findAndGetUint16(DCM_PlanarConfiguration, imagePlanarConfiguration); + // determine auto default if not found or invalid + if (imagePlanarConfiguration > 1) + imagePlanarConfiguration = determinePlanarConfiguration(imageSopClass, imagePhotometricInterpretation); + break; + case EJLSPC_auto: + imagePlanarConfiguration = determinePlanarConfiguration(imageSopClass, imagePhotometricInterpretation); + break; + case EJLSPC_colorByPixel: + imagePlanarConfiguration = 0; + break; + case EJLSPC_colorByPlane: + imagePlanarConfiguration = 1; + break; + } + } + + // get the size of all the fragments + if (result.good()) + { + // Don't modify the original values for now + Uint32 fragmentsForThisFrame2 = fragmentsForThisFrame; + Uint32 currentItem2 = currentItem; + + while (result.good() && fragmentsForThisFrame2--) + { + result = fromPixSeq->getItem(pixItem, currentItem2++); + if (result.good() && pixItem) + { + fragmentLength = pixItem->getLength(); + if (result.good()) + compressedSize += fragmentLength; + } + } /* while */ + } + + // get the compressed data + if (result.good()) + { + Uint32 offset = 0; + jlsData = new Uint8[compressedSize]; + + while (result.good() && fragmentsForThisFrame--) + { + result = fromPixSeq->getItem(pixItem, currentItem++); + if (result.good() && pixItem) + { + fragmentLength = pixItem->getLength(); + result = pixItem->getUint8Array(jlsFragmentData); + if (result.good() && jlsFragmentData) + { + memcpy(&jlsData[offset], jlsFragmentData, fragmentLength); + offset += fragmentLength; + } + } + } /* while */ + } + + if (result.good()) + { + JlsParameters params; + JLS_ERROR err; + + err = JpegLsReadHeader(jlsData, compressedSize, ¶ms); + result = DJLSError::convert(err); + + if (result.good()) + { + if (params.width != imageColumns) result = EC_JLSImageDataMismatch; + else if (params.height != imageRows) result = EC_JLSImageDataMismatch; + else if (params.components != imageSamplesPerPixel) result = EC_JLSImageDataMismatch; + else if ((bytesPerSample == 1) && (params.bitspersample > 8)) result = EC_JLSImageDataMismatch; + else if ((bytesPerSample == 2) && (params.bitspersample <= 8)) result = EC_JLSImageDataMismatch; + } + + if (!result.good()) + { + delete[] jlsData; + } + else + { + err = JpegLsDecode(buffer, bufSize, jlsData, compressedSize, ¶ms); + result = DJLSError::convert(err); + delete[] jlsData; + + if (result.good() && imageSamplesPerPixel == 3) + { + if (imagePlanarConfiguration == 1 && params.ilv != ILV_NONE) + { + // The dataset says this should be planarConfiguration == 1, but + // it isn't -> convert it. + DCMJPLS_WARN("different planar configuration in JPEG stream, converting to \"1\""); + if (bytesPerSample == 1) + result = createPlanarConfiguration1Byte(OFreinterpret_cast(Uint8*, buffer), imageColumns, imageRows); + else + result = createPlanarConfiguration1Word(OFreinterpret_cast(Uint16*, buffer), imageColumns, imageRows); + } + else if (imagePlanarConfiguration == 0 && params.ilv != ILV_SAMPLE && params.ilv != ILV_LINE) + { + // The dataset says this should be planarConfiguration == 0, but + // it isn't -> convert it. + DCMJPLS_WARN("different planar configuration in JPEG stream, converting to \"0\""); + if (bytesPerSample == 1) + result = createPlanarConfiguration0Byte(OFreinterpret_cast(Uint8*, buffer), imageColumns, imageRows); + else + result = createPlanarConfiguration0Word(OFreinterpret_cast(Uint16*, buffer), imageColumns, imageRows); + } + } + + if (result.good()) + { + // decompression is complete, finally adjust byte order if necessary + if (bytesPerSample == 1) // we're writing bytes into words + { + result = swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, buffer, + bufSize, sizeof(Uint16)); + } + } + + // update planar configuration if we are decoding a color image + if (result.good() && (imageSamplesPerPixel > 1)) + { + dataset->putAndInsertUint16(DCM_PlanarConfiguration, imagePlanarConfiguration); + } + } + } + + return result; +} + + +OFCondition DJLSDecoderBase::encode( + const Uint16 * /* pixelData */, + const Uint32 /* length */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* pixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we are a decoder only + return EC_IllegalCall; +} + + +OFCondition DJLSDecoderBase::encode( + const E_TransferSyntax /* fromRepType */, + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* toPixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we don't support re-coding for now. + return EC_IllegalCall; +} + + +OFCondition DJLSDecoderBase::determineDecompressedColorModel( + const DcmRepresentationParameter * /* fromParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmCodecParameter * /* cp */, + DcmItem * dataset, + OFString & decompressedColorModel) const +{ + OFCondition result = EC_IllegalParameter; + if (dataset != NULL) + { + // retrieve color model from given dataset + result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel); + if (result == EC_TagNotFound) + { + DCMJPLS_WARN("mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation << " is missing"); + result = EC_MissingAttribute; + } + else if (result.bad()) + { + DCMJPLS_WARN("cannot retrieve value of element PhotometricInterpretation " << DCM_PhotometricInterpretation << ": " << result.text()); + } + else if (decompressedColorModel.empty()) + { + DCMJPLS_WARN("no value for mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation); + result = EC_MissingValue; + } + } + return result; +} + + +Uint16 DJLSDecoderBase::determinePlanarConfiguration( + const OFString& sopClassUID, + const OFString& photometricInterpretation) +{ + // Hardcopy Color Image always requires color-by-plane + if (sopClassUID == UID_RETIRED_HardcopyColorImageStorage) return 1; + + // The 1996 Ultrasound Image IODs require color-by-plane if color model is YBR_FULL. + if (photometricInterpretation == "YBR_FULL") + { + if ((sopClassUID == UID_UltrasoundMultiframeImageStorage) + ||(sopClassUID == UID_UltrasoundImageStorage)) return 1; + } + + // default for all other cases + return 0; +} + +Uint32 DJLSDecoderBase::computeNumberOfFragments( + Sint32 numberOfFrames, + Uint32 currentFrame, + Uint32 startItem, + OFBool ignoreOffsetTable, + DcmPixelSequence * pixSeq) +{ + + unsigned long numItems = pixSeq->card(); + DcmPixelItem *pixItem = NULL; + + // We first check the simple cases, that is, a single-frame image, + // the last frame of a multi-frame image and the standard case where we do have + // a single fragment per frame. + if ((numberOfFrames <= 1) || (currentFrame + 1 == OFstatic_cast(Uint32, numberOfFrames))) + { + // single-frame image or last frame. All remaining fragments belong to this frame + return (numItems - startItem); + } + if (OFstatic_cast(Uint32, numberOfFrames + 1) == numItems) + { + // multi-frame image with one fragment per frame + return 1; + } + + OFCondition result = EC_Normal; + if (! ignoreOffsetTable) + { + // We do have a multi-frame image with multiple fragments per frame, and we are + // not working on the last frame. Let's check the offset table if present. + result = pixSeq->getItem(pixItem, 0); + if (result.good() && pixItem) + { + Uint32 offsetTableLength = pixItem->getLength(); + if (offsetTableLength == (OFstatic_cast(Uint32, numberOfFrames) * 4)) + { + // offset table is non-empty and contains one entry per frame + Uint8 *offsetData = NULL; + result = pixItem->getUint8Array(offsetData); + if (result.good() && offsetData) + { + // now we can access the offset table + Uint32 *offsetData32 = OFreinterpret_cast(Uint32 *, offsetData); + + // extract the offset for the NEXT frame. This offset is guaranteed to exist + // because the "last frame/single frame" case is handled above. + Uint32 offset = offsetData32[currentFrame+1]; + + // convert to local endian byte order (always little endian in file) + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, &offset, sizeof(Uint32), sizeof(Uint32)); + + // determine index of start fragment for next frame + Uint32 byteCount = 0; + Uint32 fragmentIndex = 1; + while ((byteCount < offset) && (fragmentIndex < numItems)) + { + pixItem = NULL; + result = pixSeq->getItem(pixItem, fragmentIndex++); + if (result.good() && pixItem) + { + byteCount += pixItem->getLength() + 8; // add 8 bytes for item tag and length + if ((byteCount == offset) && (fragmentIndex > startItem)) + { + // bingo, we have found the offset for the next frame + return fragmentIndex - startItem; + } + } + else break; /* something went wrong, break out of while loop */ + } /* while */ + } + } + } + } + + // So we have a multi-frame image with multiple fragments per frame and the + // offset table is empty or wrong. Our last chance is to peek into the JPEG-LS + // bistream and identify the start of the next frame. + Uint32 nextItem = startItem; + Uint8 *fragmentData = NULL; + while (++nextItem < numItems) + { + pixItem = NULL; + result = pixSeq->getItem(pixItem, nextItem); + if (result.good() && pixItem) + { + fragmentData = NULL; + result = pixItem->getUint8Array(fragmentData); + if (result.good() && fragmentData && (pixItem->getLength() > 3)) + { + if (isJPEGLSStartOfImage(fragmentData)) + { + // found a JPEG-LS SOI marker. Assume that this is the start of the next frame. + return (nextItem - startItem); + } + } + else break; /* something went wrong, break out of while loop */ + } + else break; /* something went wrong, break out of while loop */ + } + + // We're bust. No way to determine the number of fragments per frame. + return 0; +} + + +OFBool DJLSDecoderBase::isJPEGLSStartOfImage(Uint8 *fragmentData) +{ + // A valid JPEG-LS bitstream will always start with an SOI marker FFD8, followed + // by either an SOF55 (FFF7), COM (FFFE) or APPn (FFE0-FFEF) marker. + if ((*fragmentData++) != 0xFF) return OFFalse; + if ((*fragmentData++) != 0xD8) return OFFalse; + if ((*fragmentData++) != 0xFF) return OFFalse; + if ((*fragmentData == 0xF7)||(*fragmentData == 0xFE)||((*fragmentData & 0xF0) == 0xE0)) + { + return OFTrue; + } + return OFFalse; +} + + +OFCondition DJLSDecoderBase::createPlanarConfiguration1Byte( + Uint8 *imageFrame, + Uint16 columns, + Uint16 rows) +{ + if (imageFrame == NULL) return EC_IllegalCall; + + unsigned long numPixels = columns * rows; + if (numPixels == 0) return EC_IllegalCall; + + Uint8 *buf = new Uint8[3*numPixels + 3]; + if (buf) + { + memcpy(buf, imageFrame, (size_t)(3*numPixels)); + Uint8 *s = buf; // source + Uint8 *r = imageFrame; // red plane + Uint8 *g = imageFrame + numPixels; // green plane + Uint8 *b = imageFrame + (2*numPixels); // blue plane + for (unsigned long i=numPixels; i; i--) + { + *r++ = *s++; + *g++ = *s++; + *b++ = *s++; + } + delete[] buf; + } else return EC_MemoryExhausted; + return EC_Normal; +} + + +OFCondition DJLSDecoderBase::createPlanarConfiguration1Word( + Uint16 *imageFrame, + Uint16 columns, + Uint16 rows) +{ + if (imageFrame == NULL) return EC_IllegalCall; + + unsigned long numPixels = columns * rows; + if (numPixels == 0) return EC_IllegalCall; + + Uint16 *buf = new Uint16[3*numPixels + 3]; + if (buf) + { + memcpy(buf, imageFrame, (size_t)(3*numPixels*sizeof(Uint16))); + Uint16 *s = buf; // source + Uint16 *r = imageFrame; // red plane + Uint16 *g = imageFrame + numPixels; // green plane + Uint16 *b = imageFrame + (2*numPixels); // blue plane + for (unsigned long i=numPixels; i; i--) + { + *r++ = *s++; + *g++ = *s++; + *b++ = *s++; + } + delete[] buf; + } else return EC_MemoryExhausted; + return EC_Normal; +} + +OFCondition DJLSDecoderBase::createPlanarConfiguration0Byte( + Uint8 *imageFrame, + Uint16 columns, + Uint16 rows) +{ + if (imageFrame == NULL) return EC_IllegalCall; + + unsigned long numPixels = columns * rows; + if (numPixels == 0) return EC_IllegalCall; + + Uint8 *buf = new Uint8[3*numPixels + 3]; + if (buf) + { + memcpy(buf, imageFrame, (size_t)(3*numPixels)); + Uint8 *t = imageFrame; // target + Uint8 *r = buf; // red plane + Uint8 *g = buf + numPixels; // green plane + Uint8 *b = buf + (2*numPixels); // blue plane + for (unsigned long i=numPixels; i; i--) + { + *t++ = *r++; + *t++ = *g++; + *t++ = *b++; + } + delete[] buf; + } else return EC_MemoryExhausted; + return EC_Normal; +} + + +OFCondition DJLSDecoderBase::createPlanarConfiguration0Word( + Uint16 *imageFrame, + Uint16 columns, + Uint16 rows) +{ + if (imageFrame == NULL) return EC_IllegalCall; + + unsigned long numPixels = columns * rows; + if (numPixels == 0) return EC_IllegalCall; + + Uint16 *buf = new Uint16[3*numPixels + 3]; + if (buf) + { + memcpy(buf, imageFrame, (size_t)(3*numPixels*sizeof(Uint16))); + Uint16 *t = imageFrame; // target + Uint16 *r = buf; // red plane + Uint16 *g = buf + numPixels; // green plane + Uint16 *b = buf + (2*numPixels); // blue plane + for (unsigned long i=numPixels; i; i--) + { + *t++ = *r++; + *t++ = *g++; + *t++ = *b++; + } + delete[] buf; + } else return EC_MemoryExhausted; + return EC_Normal; +} diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc new file mode 100644 index 00000000..1370fee7 --- /dev/null +++ b/dcmjpls/libsrc/djcodece.cc @@ -0,0 +1,1234 @@ +/* + * + * Copyright (C) 2007-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Marco Eichelberg, Uli Schlachter + * + * Purpose: codec classes for JPEG-LS encoders. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djcodece.h" + +// ofstd includes +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/offile.h" /* for class OFFile */ +#include "dcmtk/ofstd/ofbmanip.h" + +#define INCLUDE_CMATH +#include "dcmtk/ofstd/ofstdinc.h" + +// dcmdata includes +#include "dcmtk/dcmdata/dcdatset.h" /* for class DcmDataset */ +#include "dcmtk/dcmdata/dcdeftag.h" /* for tag constants */ +#include "dcmtk/dcmdata/dcovlay.h" /* for class DcmOverlayData */ +#include "dcmtk/dcmdata/dcpixseq.h" /* for class DcmPixelSequence */ +#include "dcmtk/dcmdata/dcpxitem.h" /* for class DcmPixelItem */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmGenerateUniqueIdentifer()*/ +#include "dcmtk/dcmdata/dcvrcs.h" /* for class DcmCodeString */ +#include "dcmtk/dcmdata/dcvrds.h" /* for class DcmDecimalString */ +#include "dcmtk/dcmdata/dcvrlt.h" /* for class DcmLongText */ +#include "dcmtk/dcmdata/dcvrst.h" /* for class DcmShortText */ +#include "dcmtk/dcmdata/dcvrus.h" /* for class DcmUnsignedShort */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary */ + +// dcmjpls includes +#include "dcmtk/dcmjpls/djcparam.h" /* for class DJLSCodecParameter */ +#include "dcmtk/dcmjpls/djrparam.h" /* for class D2RepresentationParameter */ +#include "djerror.h" /* for private class DJLSError */ + +// dcmimgle includes +#include "dcmtk/dcmimgle/dcmimage.h" /* for class DicomImage */ + +// JPEG-LS library (CharLS) includes +#include "intrface.h" + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* for O_RDONLY */ +#endif +#ifdef HAVE_SYS_TYPES_H +#include /* required for sys/stat.h */ +#endif +#ifdef HAVE_SYS_STAT_H +#include /* for stat, fstat */ +#endif +END_EXTERN_C + + +E_TransferSyntax DJLSLosslessEncoder::supportedTransferSyntax() const +{ + return EXS_JPEGLSLossless; +} + +E_TransferSyntax DJLSNearLosslessEncoder::supportedTransferSyntax() const +{ + return EXS_JPEGLSLossy; +} + +// -------------------------------------------------------------------------- + +DJLSEncoderBase::DJLSEncoderBase() +: DcmCodec() +{ +} + + +DJLSEncoderBase::~DJLSEncoderBase() +{ +} + + +OFBool DJLSEncoderBase::canChangeCoding( + const E_TransferSyntax oldRepType, + const E_TransferSyntax newRepType) const +{ + // this codec only handles conversion from uncompressed to JPEG-LS. + DcmXfer oldRep(oldRepType); + return (oldRep.isNotEncapsulated() && (newRepType == supportedTransferSyntax())); +} + + +OFCondition DJLSEncoderBase::decode( + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* pixSeq */, + DcmPolymorphOBOW& /* uncompressedPixelData */, + const DcmCodecParameter * /* cp */, + const DcmStack& /* objStack */) const +{ + // we are an encoder only + return EC_IllegalCall; +} + + +OFCondition DJLSEncoderBase::decodeFrame( + const DcmRepresentationParameter * /* fromParam */ , + DcmPixelSequence * /* fromPixSeq */ , + const DcmCodecParameter * /* cp */ , + DcmItem * /* dataset */ , + Uint32 /* frameNo */ , + Uint32& /* startFragment */ , + void * /* buffer */ , + Uint32 /* bufSize */ , + OFString& /* decompressedColorModel */ ) const +{ + // we are an encoder only + return EC_IllegalCall; +} + + +OFCondition DJLSEncoderBase::encode( + const E_TransferSyntax /* fromRepType */, + const DcmRepresentationParameter * /* fromRepParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmRepresentationParameter * /* toRepParam */, + DcmPixelSequence * & /* toPixSeq */, + const DcmCodecParameter * /* cp */, + DcmStack & /* objStack */) const +{ + // we don't support re-coding for now. + return EC_IllegalCall; +} + +OFCondition DJLSEncoderBase::encode( + const Uint16 * pixelData, + const Uint32 length, + const DcmRepresentationParameter * toRepParam, + DcmPixelSequence * & pixSeq, + const DcmCodecParameter *cp, + DcmStack & objStack) const +{ + OFCondition result = EC_Normal; + DJLSRepresentationParameter defRep; + + // retrieve pointer to dataset from parameter stack + DcmStack localStack(objStack); + (void)localStack.pop(); // pop pixel data element from stack + DcmObject *dobject = localStack.pop(); // this is the item in which the pixel data is located + if ((!dobject)||((dobject->ident()!= EVR_dataset) && (dobject->ident()!= EVR_item))) return EC_InvalidTag; + DcmItem *dataset = OFstatic_cast(DcmItem *, dobject); + + // assume we can cast the codec and representation parameters to what we need + const DJLSCodecParameter *djcp = OFreinterpret_cast(const DJLSCodecParameter *, cp); + const DJLSRepresentationParameter *djrp = OFreinterpret_cast(const DJLSRepresentationParameter *, toRepParam); + double compressionRatio = 0.0; + + if (!djrp) + djrp = &defRep; + + if (supportedTransferSyntax() == EXS_JPEGLSLossless || djrp->useLosslessProcess()) + { + if (djcp->cookedEncodingPreferred()) + result = losslessCookedEncode(pixelData, length, dataset, djrp, pixSeq, djcp, compressionRatio, 0); + else result = losslessRawEncode(pixelData, length, dataset, djrp, pixSeq, djcp, compressionRatio); + } + else + { + // near-lossless mode always uses the "cooked" encoder since this one is guaranteed not to "mix" + // overlays and pixel data in one cell subjected to lossy compression. + result = losslessCookedEncode(pixelData, length, dataset, djrp, pixSeq, djcp, compressionRatio, djrp->getnearlosslessDeviation()); + } + + // the following operations do not affect the Image Pixel Module + // but other modules such as SOP Common. We only perform these + // changes if we're on the main level of the dataset, + // which should always identify itself as dataset, not as item. + if (result.good() && dataset->ident() == EVR_dataset) + { + if (result.good()) + { + if (supportedTransferSyntax() == EXS_JPEGLSLossless || djrp->useLosslessProcess()) + { + // lossless process - create new UID if mode is EUC_always or if we're converting to Secondary Capture + if (djcp->getConvertToSC() || (djcp->getUIDCreation() == EJLSUC_always)) + result = DcmCodec::newInstance(dataset, "DCM", "121320", "Uncompressed predecessor"); + } + else + { + // lossy process - create new UID unless mode is EUC_never and we're not converting to Secondary Capture + if (djcp->getConvertToSC() || (djcp->getUIDCreation() != EJLSUC_never)) + result = DcmCodec::newInstance(dataset, "DCM", "121320", "Uncompressed predecessor"); + + // update image type + if (result.good()) result = DcmCodec::updateImageType(dataset); + + // update derivation description + if (result.good()) result = updateDerivationDescription(dataset, djrp, compressionRatio); + + // update lossy compression ratio + if (result.good()) result = updateLossyCompressionRatio(dataset, compressionRatio); + } + } + + // convert to Secondary Capture if requested by user. + // This method creates a new SOP class UID, so it should be executed + // after the call to newInstance() which creates a Source Image Sequence. + if (result.good() && djcp->getConvertToSC()) result = DcmCodec::convertToSecondaryCapture(dataset); + } + + return result; +} + + +OFCondition DJLSEncoderBase::determineDecompressedColorModel( + const DcmRepresentationParameter * /* fromParam */, + DcmPixelSequence * /* fromPixSeq */, + const DcmCodecParameter * /* cp */, + DcmItem * /* dataset */, + OFString & /* decompressedColorModel */) const +{ + return EC_IllegalCall; +} + + +OFCondition DJLSEncoderBase::adjustOverlays( + DcmItem *dataset, + DicomImage& image) const +{ + if (dataset == NULL) return EC_IllegalCall; + + unsigned int overlayCount = image.getOverlayCount(); + if (overlayCount > 0) + { + Uint16 group = 0; + DcmStack stack; + unsigned long bytesAllocated = 0; + Uint8 *buffer = NULL; + unsigned int width = 0; + unsigned int height = 0; + unsigned long frames = 0; + DcmElement *elem = NULL; + OFCondition result = EC_Normal; + + // adjust overlays (prior to grayscale compression) + for (unsigned int i=0; i < overlayCount; i++) + { + // check if current overlay is embedded in pixel data + group = OFstatic_cast(Uint16, image.getOverlayGroupNumber(i)); + stack.clear(); + if ((dataset->search(DcmTagKey(group, 0x3000), stack, ESM_fromHere, OFFalse)).bad()) + { + // separate Overlay Data not found. Assume overlay is embedded. + bytesAllocated = image.create6xxx3000OverlayData(buffer, i, width, height, frames); + if (bytesAllocated > 0) + { + elem = new DcmOverlayData(DcmTagKey(group, 0x3000)); // DCM_OverlayData + if (elem) + { + result = elem->putUint8Array(buffer, bytesAllocated); + delete[] buffer; + if (result.good()) + { + dataset->insert(elem, OFTrue /*replaceOld*/); + // DCM_OverlayBitsAllocated + result = dataset->putAndInsertUint16(DcmTagKey(group, 0x0100), 1); + // DCM_OverlayBitPosition + if (result.good()) result = dataset->putAndInsertUint16(DcmTagKey(group, 0x0102), 0); + } + else + { + delete elem; + return result; + } + } + else + { + delete[] buffer; + return EC_MemoryExhausted; + } + } + else return EC_IllegalCall; + } + } + } + return EC_Normal; +} + + +OFCondition DJLSEncoderBase::updateLossyCompressionRatio( + DcmItem *dataset, + double ratio) const +{ + if (dataset == NULL) return EC_IllegalCall; + + // set Lossy Image Compression to "01" (see DICOM part 3, C.7.6.1.1.5) + OFCondition result = dataset->putAndInsertString(DCM_LossyImageCompression, "01"); + if (result.bad()) return result; + + // set Lossy Image Compression Ratio + OFString s; + const char *oldRatio = NULL; + if ((dataset->findAndGetString(DCM_LossyImageCompressionRatio, oldRatio)).good() && oldRatio) + { + s = oldRatio; + s += "\\"; + } + + // append lossy compression ratio + char buf[64]; + OFStandard::ftoa(buf, sizeof(buf), ratio, OFStandard::ftoa_uppercase, 0, 5); + s += buf; + + result = dataset->putAndInsertString(DCM_LossyImageCompressionRatio, s.c_str()); + if (result.bad()) return result; + + // count VM of lossy image compression ratio + size_t i; + size_t s_vm = 0; + size_t s_sz = s.size(); + for (i = 0; i < s_sz; ++i) + if (s[i] == '\\') ++s_vm; + + // set Lossy Image Compression Method + const char *oldMethod = NULL; + OFString m; + if ((dataset->findAndGetString(DCM_LossyImageCompressionMethod, oldMethod)).good() && oldMethod) + { + m = oldMethod; + m += "\\"; + } + + // count VM of lossy image compression method + size_t m_vm = 0; + size_t m_sz = m.size(); + for (i = 0; i < m_sz; ++i) + if (m[i] == '\\') ++m_vm; + + // make sure that VM of Compression Method is not smaller than VM of Compression Ratio + while (m_vm++ < s_vm) m += "\\"; + + m += "ISO_14495_1"; + return dataset->putAndInsertString(DCM_LossyImageCompressionMethod, m.c_str()); +} + + +OFCondition DJLSEncoderBase::updateDerivationDescription( + DcmItem *dataset, + const DJLSRepresentationParameter *djrp, + double ratio) const +{ + OFString derivationDescription; + char buf[64]; + + derivationDescription = "near lossless JPEG-LS compression, factor "; + OFStandard::ftoa(buf, sizeof(buf), ratio, OFStandard::ftoa_uppercase, 0, 5); + derivationDescription += buf; + sprintf(buf, " (NEAR=%lu)", OFstatic_cast(unsigned long, djrp->getnearlosslessDeviation())); + derivationDescription += buf; + + // append old Derivation Description, if any + const char *oldDerivation = NULL; + if ((dataset->findAndGetString(DCM_DerivationDescription, oldDerivation)).good() && oldDerivation) + { + derivationDescription += " ["; + derivationDescription += oldDerivation; + derivationDescription += "]"; + if (derivationDescription.length() > 1024) + { + // ST is limited to 1024 characters, cut off tail + derivationDescription.erase(1020); + derivationDescription += "...]"; + } + } + + OFCondition result = dataset->putAndInsertString(DCM_DerivationDescription, derivationDescription.c_str()); + if (result.good()) result = DcmCodec::insertCodeSequence(dataset, DCM_DerivationCodeSequence, "DCM", "113040", "Lossy Compression"); + return result; +} + + +OFCondition DJLSEncoderBase::losslessRawEncode( + const Uint16 *pixelData, + const Uint32 length, + DcmItem *dataset, + const DJLSRepresentationParameter *djrp, + DcmPixelSequence * & pixSeq, + const DJLSCodecParameter *djcp, + double& compressionRatio) const +{ + compressionRatio = 0.0; // initialize if something goes wrong + + // determine image properties + Uint16 bitsAllocated = 0; + Uint16 bitsStored = 0; + Uint16 bytesAllocated = 0; + Uint16 samplesPerPixel = 0; + Uint16 planarConfiguration = 0; + Uint16 columns = 0; + Uint16 rows = 0; + Sint32 numberOfFrames = 1; + OFBool byteSwapped = OFFalse; // true if we have byte-swapped the original pixel data + OFString photometricInterpretation; + + OFCondition result = dataset->findAndGetUint16(DCM_BitsAllocated, bitsAllocated); + if (result.good()) result = dataset->findAndGetUint16(DCM_BitsStored, bitsStored); + if (result.good()) result = dataset->findAndGetUint16(DCM_SamplesPerPixel, samplesPerPixel); + if (result.good()) result = dataset->findAndGetUint16(DCM_Columns, columns); + if (result.good()) result = dataset->findAndGetUint16(DCM_Rows, rows); + if (result.good()) result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, photometricInterpretation); + if (result.good()) + { + result = dataset->findAndGetSint32(DCM_NumberOfFrames, numberOfFrames); + if (result.bad() || numberOfFrames < 1) numberOfFrames = 1; + result = EC_Normal; + } + if (result.good() && (samplesPerPixel > 1)) + { + result = dataset->findAndGetUint16(DCM_PlanarConfiguration, planarConfiguration); + } + + if (result.good()) + { + // check if bitsAllocated is 8 or 16 - we don't handle anything else + if (bitsAllocated == 8) + { + bytesAllocated = 1; + } + else if (bitsAllocated == 16) + { + bytesAllocated = 2; + } + else + { + if (photometricInterpretation == "MONOCHROME1" || + photometricInterpretation == "MONOCHROME2" || + photometricInterpretation == "RGB" || + photometricInterpretation == "YBR_FULL") + { + // A bitsAllocated value that we don't handle, but a color model that indicates + // that the cooked encoder could handle this case. Fall back to cooked encoder. + return losslessCookedEncode(pixelData, length, dataset, djrp, pixSeq, djcp, compressionRatio, 0); + } + + // an image that is not supported by either the raw or the cooked encoder. + result = EC_JLSUnsupportedImageType; + } + + // make sure that all the descriptive attributes have sensible values + if ((columns < 1)||(rows < 1)||(samplesPerPixel < 1)) result = EC_JLSUnsupportedImageType; + + // make sure that we have at least as many bytes of pixel data as we expect + if (bytesAllocated * samplesPerPixel * columns * rows * + OFstatic_cast(unsigned long,numberOfFrames) > length) + result = EC_JLSUncompressedBufferTooSmall; + } + + DcmPixelSequence *pixelSequence = NULL; + DcmPixelItem *offsetTable = NULL; + + // create initial pixel sequence + if (result.good()) + { + pixelSequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSequence == NULL) result = EC_MemoryExhausted; + else + { + // create empty offset table + offsetTable = new DcmPixelItem(DCM_PixelItemTag); + if (offsetTable == NULL) result = EC_MemoryExhausted; + else pixelSequence->insert(offsetTable); + } + } + + DcmOffsetList offsetList; + unsigned long compressedSize = 0; + unsigned long compressedFrameSize = 0; + double uncompressedSize = 0.0; + + // render and compress each frame + if (result.good()) + { + + // byte swap pixel data to little endian if bits allocate is 8 + if ((gLocalByteOrder == EBO_BigEndian) && (bitsAllocated == 8)) + { + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, OFstatic_cast(void *, OFconst_cast(Uint16 *, pixelData)), length, sizeof(Uint16)); + byteSwapped = OFTrue; + } + + unsigned long frameCount = OFstatic_cast(unsigned long, numberOfFrames); + unsigned long frameSize = columns * rows * samplesPerPixel * bytesAllocated; + const Uint8 *framePointer = OFreinterpret_cast(const Uint8 *, pixelData); + + // compute original image size in bytes, ignoring any padding bits. + uncompressedSize = columns * rows * samplesPerPixel * bitsStored * frameCount / 8.0; + + for (unsigned long i=0; (igetCreateOffsetTable())) + { + result = offsetTable->createOffsetTable(offsetList); + } + + // adjust planar configuration + if (result.good()) + { + if (photometricInterpretation == "RGB" || photometricInterpretation == "YBR_FULL") + { + // CP 1843 requires a planar configuration value of 0 for these color models + result = dataset->putAndInsertUint16(DCM_PlanarConfiguration, 0); + } + else if (samplesPerPixel == 1) + { + delete dataset->remove(DCM_PlanarConfiguration); + } + } + + if (compressedSize > 0) compressionRatio = uncompressedSize / compressedSize; + + // byte swap pixel data back to local endian if necessary + if (byteSwapped) + { + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, OFstatic_cast(void *, OFconst_cast(Uint16 *, pixelData)), length, sizeof(Uint16)); + } + + return result; +} + +// static helper functions for DJLSEncoderBase::setCustomParameters(). +static long setcp_clamp(long i, long j, long MAXVAL) +{ + if (i > MAXVAL || i < j) + return j; + + return i; +} + +long setcp_min(long a, long b) +{ + return (((a) < (b)) ? (a) : (b)); +} + +void DJLSEncoderBase::setCustomParameters( + JlsCustomParameters& custom, + Uint16 bitsAllocated, + Uint16 nearLosslessDeviation, + const DJLSCodecParameter *djcp) +{ + // first check if all parameters are set to default (which will be the most common case). + // In this case we will set everything in the custom struct to zero as well. + if ((djcp->getT1() == 0) && (djcp->getT2() == 0) && (djcp->getT3() == 0) && (djcp->getReset() == 0)) + { + custom.T1 = 0; + custom.T2 = 0; + custom.T3 = 0; + custom.RESET = 0; + custom.MAXVAL = 0; + return; + } + + // unfortunately, CharLS either takes all or none of the parameters + // in the "custom" struct. So if we change any of them, we need to provide + // legal values for all of them. The function in CharLS that computes these + // values is not public, so we basically have to re-implement it here. + + const int BASIC_T1 = 3; + const int BASIC_T2 = 7; + const int BASIC_T3 = 21; + const long BASIC_RESET = 64; + + long MAXVAL = (1 << bitsAllocated) - 1; + long FACTOR = (setcp_min(MAXVAL, 4095) + 128)/256; + long NEAR = nearLosslessDeviation; + + custom.MAXVAL = MAXVAL; + + if (djcp->getT1() > 0) custom.T1 = djcp->getT1(); else + custom.T1 = setcp_clamp(FACTOR * (BASIC_T1 - 2) + 2 + 3*NEAR, NEAR + 1, MAXVAL); + + if (djcp->getT2() > 0) custom.T2 = djcp->getT2(); else + custom.T2 = setcp_clamp(FACTOR * (BASIC_T2 - 3) + 3 + 5*NEAR, custom.T1, MAXVAL); + + if (djcp->getT3() > 0) custom.T3 = djcp->getT3(); else + custom.T3 = setcp_clamp(FACTOR * (BASIC_T3 - 4) + 4 + 7*NEAR, custom.T2, MAXVAL); + + if (djcp->getReset() > 0) custom.RESET = djcp->getReset(); + else custom.RESET = BASIC_RESET; + +} + +OFCondition DJLSEncoderBase::compressRawFrame( + const Uint8 *framePointer, + Uint16 bitsAllocated, + Uint16 width, + Uint16 height, + Uint16 samplesPerPixel, + Uint16 planarConfiguration, + const OFString& /* photometricInterpretation */, + DcmPixelSequence *pixelSequence, + DcmOffsetList &offsetList, + unsigned long &compressedSize, + const DJLSCodecParameter *djcp) const +{ + OFCondition result = EC_Normal; + Uint16 bytesAllocated = bitsAllocated / 8; + Uint32 frameSize = width*height*bytesAllocated*samplesPerPixel; + Uint32 fragmentSize = djcp->getFragmentSize(); + JlsParameters jls_params; + Uint8 *frameBuffer = NULL; + + // Set up the information structure for CharLS + OFBitmanipTemplate::zeroMem((char *) &jls_params, sizeof(jls_params)); + jls_params.bitspersample = bitsAllocated; + jls_params.height = height; + jls_params.width = width; + jls_params.allowedlossyerror = 0; // must be zero for raw mode + jls_params.outputBgr = false; + // No idea what this one does, but I don't think DICOM says anything about it + jls_params.colorTransform = 0; + // Unset: jls_params.jfif (thumbnail, dpi) + + // set parameters T1, T2, T3, MAXVAL and RESET. + // compressRawFrame() is only used for true lossless mode, so the near-lossless deviation is always 0 here. + setCustomParameters(jls_params.custom, bitsAllocated, 0, djcp); + + // Theoretically we could support any samplesPerPixel value, but for now we + // only accept these (charls is a little picky for other values). + if (samplesPerPixel == 1 || samplesPerPixel == 3) + jls_params.components = samplesPerPixel; + else + return EC_IllegalCall; + + enum interleavemode ilv; + switch (planarConfiguration) + { + // ILV_LINE is not supported by DICOM + case 0: + ilv = ILV_SAMPLE; + break; + case 1: + ilv = ILV_NONE; + break; + default: + return EC_IllegalCall; + } + + switch (djcp->getJplsInterleaveMode()) + { + case DJLSCodecParameter::interleaveSample: + jls_params.ilv = ILV_SAMPLE; + break; + case DJLSCodecParameter::interleaveLine: + jls_params.ilv = ILV_LINE; + break; + case DJLSCodecParameter::interleaveNone: + jls_params.ilv = ILV_NONE; + break; + case DJLSCodecParameter::interleaveDefault: + default: + // In default mode we just never convert the image to another + // interleave-mode. Instead, we use what is already there. + jls_params.ilv = ilv; + break; + } + + // Special case: one component images are always ILV_NONE (Standard requires this) + if (jls_params.components == 1) + { + jls_params.ilv = ILV_NONE; + // Don't try to convert to another interleave mode, not necessary + ilv = ILV_NONE; + } + + // Do we have to convert the image to some other interleave mode? + if ((jls_params.ilv == ILV_NONE && (ilv == ILV_SAMPLE || ilv == ILV_LINE)) || + (ilv == ILV_NONE && (jls_params.ilv == ILV_SAMPLE || jls_params.ilv == ILV_LINE))) + { + DCMJPLS_DEBUG("Converting image from " << (ilv == ILV_NONE ? "color-by-plane" : "color-by-pixel") + << " to " << (jls_params.ilv == ILV_NONE ? "color-by-plane" : "color-by-pixel")); + + frameBuffer = new Uint8[frameSize]; + if (jls_params.ilv == ILV_NONE) + result = convertToUninterleaved(frameBuffer, framePointer, samplesPerPixel, width, height, bitsAllocated); + else + /* For CharLS, sample-interleaved and line-interleaved is both expected to + * be color-by-pixel. + */ + result = convertToSampleInterleaved(frameBuffer, framePointer, samplesPerPixel, width, height, bitsAllocated); + framePointer = frameBuffer; + } + + if (result.good()) + { + // The buffer is going to be dynamically reallocated if it's too small, so it doesn't matter that + // much what initial size we use. + size_t size = frameSize + 1024; + BYTE *buffer = new BYTE[size]; + + size_t bytesWritten = 0; + + JLS_ERROR err = JpegLsEncode(&buffer, &size, &bytesWritten, framePointer, frameSize, &jls_params); + result = DJLSError::convert(err); + + if (result.good()) + { + compressedSize = OFstatic_cast(unsigned long, bytesWritten); + fixPaddingIfNecessary(OFstatic_cast(Uint8 *, buffer), size, compressedSize, djcp->getUseFFbitstreamPadding()); + result = pixelSequence->storeCompressedFrame(offsetList, buffer, compressedSize, fragmentSize); + } + + delete[] buffer; + } + + if (frameBuffer) + delete[] frameBuffer; + + return result; +} + + +OFCondition DJLSEncoderBase::losslessCookedEncode( + const Uint16 *pixelData, + const Uint32 length, + DcmItem *dataset, + const DJLSRepresentationParameter *djrp, + DcmPixelSequence * & pixSeq, + const DJLSCodecParameter *djcp, + double& compressionRatio, + Uint16 nearLosslessDeviation) const +{ + compressionRatio = 0.0; // initialize if something goes wrong + + // determine a few image properties + OFString photometricInterpretation; + Uint16 bitsAllocated = 0; + OFCondition result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, photometricInterpretation); + if (result.good()) result = dataset->findAndGetUint16(DCM_BitsAllocated, bitsAllocated); + if (result.bad()) return result; + + // The cooked encoder only handles the following photometic interpretations + if (photometricInterpretation != "MONOCHROME1" && + photometricInterpretation != "MONOCHROME2" && + photometricInterpretation != "RGB" && + photometricInterpretation != "YBR_FULL") + { + // a photometric interpretation that we don't handle. Fall back to raw encoder (unless in near-lossless mode) + if (nearLosslessDeviation > 0) return EC_JLSUnsupportedPhotometricInterpretation; + else return losslessRawEncode(pixelData, length, dataset, djrp, pixSeq, djcp, compressionRatio); + } + + Uint16 pixelRepresentation = 0; + result = dataset->findAndGetUint16(DCM_PixelRepresentation, pixelRepresentation); + if (result.bad()) return result; + + if (pixelRepresentation > 0) + { + // in near lossless mode we cannot handle signed images because JPEG-LS assumes unsigned pixels + if (nearLosslessDeviation > 0) return EC_JLSUnsupportedPixelRepresentation; + + // The cooked encoder only handles unsigned color images + if (photometricInterpretation == "RGB" || photometricInterpretation == "YBR_FULL") + { + // prevent a loop - only call lossless raw encoder if bitsAllocated is OK for the raw encoder + if ((bitsAllocated == 8) || (bitsAllocated == 16)) + return losslessRawEncode(pixelData, length, dataset, djrp, pixSeq, djcp, compressionRatio); + else return EC_JLSUnsupportedPixelRepresentation; + } + } + + // Check if image is 2..16 bits/sample, bail out otherwise. + // We check the value of BitsStored, which is not affected by any transformation such as MLUT. + Uint16 bitsStored = 0; + result = dataset->findAndGetUint16(DCM_BitsStored, bitsStored); + if (result.bad()) return result; + + if (bitsStored > 16) + { + DCMJPLS_WARN("Cannot compress image with " << bitsStored << " bits/sample: JPEG-LS supports max. 16 bits."); + return EC_JLSUnsupportedBitDepth; + } + if (bitsStored < 2) + { + DCMJPLS_WARN("Cannot compress image with " << bitsStored << " bit/sample: JPEG-LS requires at least 2 bits."); + return EC_JLSUnsupportedBitDepth; + } + + DcmPixelSequence *pixelSequence = NULL; + DcmPixelItem *offsetTable = NULL; + + // ignore modality transformation (rescale slope/intercept or LUT) stored in the dataset + unsigned long flags = CIF_IgnoreModalityTransformation; + // don't convert YCbCr (Full and Full 4:2:2) color images to RGB + flags |= CIF_KeepYCbCrColorModel; + // Don't optimize memory usage, but keep using the same bitsAllocated. + // Without this, the DICOM and the JPEG-LS value for bitsAllocated could + // differ and the decoder would error out. + flags |= CIF_UseAbsolutePixelRange; + + DicomImage *dimage = new DicomImage(dataset, EXS_LittleEndianImplicit, flags); // read all frames + if (dimage == NULL) return EC_MemoryExhausted; + if (dimage->getStatus() != EIS_Normal) + { + delete dimage; + return EC_IllegalCall; + } + + // create overlay data for embedded overlays + result = adjustOverlays(dataset, *dimage); + + // determine number of bits per sample + int bitsPerSample = dimage->getDepth(); + + // create initial pixel sequence + if (result.good()) + { + pixelSequence = new DcmPixelSequence(DCM_PixelSequenceTag); + if (pixelSequence == NULL) result = EC_MemoryExhausted; + else + { + // create empty offset table + offsetTable = new DcmPixelItem(DCM_PixelItemTag); + if (offsetTable == NULL) result = EC_MemoryExhausted; + else pixelSequence->insert(offsetTable); + } + } + + DcmOffsetList offsetList; + unsigned long compressedSize = 0; + unsigned long compressedFrameSize = 0; + double uncompressedSize = 0.0; + + // render and compress each frame + if (result.good()) + { + unsigned long frameCount = dimage->getFrameCount(); + + // compute original image size in bytes, ignoring any padding bits. + Uint16 samplesPerPixel = 0; + if ((dataset->findAndGetUint16(DCM_SamplesPerPixel, samplesPerPixel)).bad()) samplesPerPixel = 1; + uncompressedSize = dimage->getWidth() * dimage->getHeight() * + bitsPerSample * frameCount * samplesPerPixel / 8.0; + + for (unsigned long i=0; (igetCreateOffsetTable())) + { + result = offsetTable->createOffsetTable(offsetList); + } + + // adapt attributes in image pixel module + if (result.good()) + { + // adjustments needed for both color and monochrome + if (bitsPerSample > 8) + result = dataset->putAndInsertUint16(DCM_BitsAllocated, 16); + else + result = dataset->putAndInsertUint16(DCM_BitsAllocated, 8); + if (result.good()) result = dataset->putAndInsertUint16(DCM_BitsStored, bitsPerSample); + if (result.good()) result = dataset->putAndInsertUint16(DCM_HighBit, bitsPerSample-1); + if (result.good()) + { + if (photometricInterpretation == "RGB" || photometricInterpretation == "YBR_FULL") + { + // CP 1843 requires a planar configuration value of 0 for these color models + result = dataset->putAndInsertUint16(DCM_PlanarConfiguration, 0); + } + else + { + // this is monochrome since we have ruled out all other photometric interpretations + // at the start of this method + delete dataset->remove(DCM_PlanarConfiguration); + } + } + } + + if (compressedSize > 0) compressionRatio = uncompressedSize / compressedSize; + delete dimage; + return result; +} + + +OFCondition DJLSEncoderBase::compressCookedFrame( + DcmPixelSequence *pixelSequence, + DicomImage *dimage, + const OFString& /* photometricInterpretation */, + DcmOffsetList &offsetList, + unsigned long &compressedSize, + const DJLSCodecParameter *djcp, + Uint32 frame, + Uint16 nearLosslessDeviation) const +{ + if (dimage == NULL) return EC_IllegalCall; + + // access essential image parameters + int width = dimage->getWidth(); + int height = dimage->getHeight(); + int depth = dimage->getDepth(); + if ((depth < 1) || (depth > 16)) return EC_JLSUnsupportedBitDepth; + + Uint32 fragmentSize = djcp->getFragmentSize(); + + const DiPixel *dinter = dimage->getInterData(); + if (dinter == NULL) return EC_IllegalCall; + + // There should be no other possibilities + int samplesPerPixel = dinter->getPlanes(); + if (samplesPerPixel != 1 && samplesPerPixel != 3) return EC_IllegalCall; + + // get pointer to internal raw representation of image data + const void *draw = dinter->getData(); + if (draw == NULL) return EC_IllegalCall; + + OFCondition result = EC_Normal; + + const void *planes[3] = {NULL, NULL, NULL}; + if (samplesPerPixel == 3) + { + // for color images, dinter->getData() returns a pointer to an array + // of pointers pointing to the real plane data + const void * const * draw_array = OFstatic_cast(const void * const *,draw); + planes[0] = draw_array[0]; + planes[1] = draw_array[1]; + planes[2] = draw_array[2]; + } + else + { + // for monochrome images, dinter->getData() directly returns a pointer + // to the single monochrome plane. + planes[0] = draw; + } + + // This is the buffer with the uncompressed pixel data + Uint8 *buffer; + size_t buffer_size; + + Uint32 framesize = dimage->getWidth() * dimage->getHeight(); + switch(dinter->getRepresentation()) + { + case EPR_Uint8: + case EPR_Sint8: + { + // image representation is 8 bit signed or unsigned + if (samplesPerPixel == 1) + { + const Uint8 *yv = OFreinterpret_cast(const Uint8 *, planes[0]) + framesize * frame; + buffer_size = framesize; + buffer = new Uint8[buffer_size]; + memcpy(buffer, yv, framesize); + } + else + { + const Uint8 *rv = OFreinterpret_cast(const Uint8 *, planes[0]) + framesize * frame; + const Uint8 *gv = OFreinterpret_cast(const Uint8 *, planes[1]) + framesize * frame; + const Uint8 *bv = OFreinterpret_cast(const Uint8 *, planes[2]) + framesize * frame; + + buffer_size = framesize * 3; + buffer = new Uint8[buffer_size]; + + size_t i = 0; + for (int row=height; row; --row) + { + for (int col=width; col; --col) + { + buffer[i++] = *rv; + buffer[i++] = *gv; + buffer[i++] = *bv; + + rv++; + gv++; + bv++; + } + } + } + } + break; + case EPR_Uint16: + case EPR_Sint16: + { + // image representation is 16 bit signed or unsigned + if (samplesPerPixel == 1) + { + const Uint16 *yv = OFreinterpret_cast(const Uint16 *, planes[0]) + framesize * frame; + buffer_size = framesize*sizeof(Uint16); + buffer = new Uint8[buffer_size]; + memcpy(buffer, yv, buffer_size); + } + else + { + const Uint16 *rv = OFreinterpret_cast(const Uint16 *, planes[0]) + framesize * frame; + const Uint16 *gv = OFreinterpret_cast(const Uint16 *, planes[1]) + framesize * frame; + const Uint16 *bv = OFreinterpret_cast(const Uint16 *, planes[2]) + framesize * frame; + + buffer_size = framesize * 3; + Uint16 *buffer16 = new Uint16[buffer_size]; + buffer = OFreinterpret_cast(Uint8 *, buffer16); + + // Convert to byte count + buffer_size *= 2; + + size_t i = 0; + for (int row=height; row; --row) + { + for (int col=width; col; --col) + { + buffer16[i++] = *rv; + buffer16[i++] = *gv; + buffer16[i++] = *bv; + + rv++; + gv++; + bv++; + } + } + } + } + break; + default: + // we don't support images with > 16 bits/sample + return EC_JLSUnsupportedBitDepth; + break; + } + + JlsParameters jls_params; + + // Set up the information structure for CharLS + OFBitmanipTemplate::zeroMem((char *) &jls_params, sizeof(jls_params)); + jls_params.height = height; + jls_params.width = width; + jls_params.allowedlossyerror = nearLosslessDeviation; + jls_params.outputBgr = false; + jls_params.bitspersample = depth; + // No idea what this one does, but I don't think DICOM says anything about it + jls_params.colorTransform = 0; + + // This was already checked for a sane value above + jls_params.components = samplesPerPixel; + + // Unset: jls_params.jfif (thumbnail, dpi) + + // set parameters T1, T2, T3, MAXVAL and RESET + setCustomParameters(jls_params.custom, depth, nearLosslessDeviation, djcp); + + switch (djcp->getJplsInterleaveMode()) + { + case DJLSCodecParameter::interleaveSample: + jls_params.ilv = ILV_SAMPLE; + break; + case DJLSCodecParameter::interleaveLine: + jls_params.ilv = ILV_LINE; + break; + case DJLSCodecParameter::interleaveNone: + jls_params.ilv = ILV_NONE; + break; + case DJLSCodecParameter::interleaveDefault: + default: + // Default for the cooked encoder is always ILV_LINE + jls_params.ilv = ILV_LINE; + break; + } + + // Special case: one component images are always ILV_NONE (Standard requires this) + if (jls_params.components == 1) + { + jls_params.ilv = ILV_NONE; + } + + Uint8 *frameBuffer = NULL; + Uint8 *framePointer = buffer; + // Do we have to convert the image to color-by-plane now? + if (jls_params.ilv == ILV_NONE && jls_params.components != 1) + { + DCMJPLS_DEBUG("Converting image from color-by-pixel to color-by-plane"); + + frameBuffer = new Uint8[buffer_size]; + framePointer = frameBuffer; + result = convertToUninterleaved(frameBuffer, buffer, samplesPerPixel, width, height, jls_params.bitspersample); + } + + size_t compressed_buffer_size = buffer_size + 1024; + BYTE *compressed_buffer = new BYTE[compressed_buffer_size]; + + size_t bytesWritten = 0; + + JLS_ERROR err = JpegLsEncode(&compressed_buffer, &compressed_buffer_size, &bytesWritten, framePointer, buffer_size, &jls_params); + result = DJLSError::convert(err); + + if (result.good()) + { + // 'compressed_buffer_size' now contains the size of the compressed data in buffer + compressedSize = OFstatic_cast(unsigned long, bytesWritten); + fixPaddingIfNecessary(OFstatic_cast(Uint8 *, buffer), compressed_buffer_size, compressedSize, djcp->getUseFFbitstreamPadding()); + result = pixelSequence->storeCompressedFrame(offsetList, compressed_buffer, compressedSize, fragmentSize); + } + + delete[] buffer; + delete[] compressed_buffer; + if (frameBuffer) + delete[] frameBuffer; + + return result; +} + +OFCondition DJLSEncoderBase::convertToUninterleaved( + Uint8 *target, + const Uint8 *source, + Uint16 components, + Uint32 width, + Uint32 height, + Uint16 bitsAllocated) const +{ + Uint8 bytesAllocated = bitsAllocated / 8; + Uint32 planeSize = width * height * bytesAllocated; + + if (bitsAllocated % 8 != 0) + return EC_IllegalCall; + + for (Uint32 pos = 0; pos < width * height; pos++) + { + for (int i = 0; i < components; i++) + { + memcpy(&target[i * planeSize + pos * bytesAllocated], source, bytesAllocated); + source += bytesAllocated; + } + } + return EC_Normal; +} + +OFCondition DJLSEncoderBase::convertToSampleInterleaved( + Uint8 *target, + const Uint8 *source, + Uint16 components, + Uint32 width, + Uint32 height, + Uint16 bitsAllocated) const +{ + Uint8 bytesAllocated = bitsAllocated / 8; + Uint32 planeSize = width * height * bytesAllocated; + + if (bitsAllocated % 8 != 0) + return EC_IllegalCall; + + for (Uint32 pos = 0; pos < width * height; pos++) + { + for (int i = 0; i < components; i++) + { + memcpy(target, &source[i * planeSize + pos * bytesAllocated], bytesAllocated); + target += bytesAllocated; + } + } + return EC_Normal; +} + +void DJLSEncoderBase::fixPaddingIfNecessary( + Uint8 *buffer, + size_t bufSize, + unsigned long &bytesWritten, + OFBool useFFpadding) +{ + // check if an odd number of bytes was written and the buffer + // has space for the needed pad byte (which should in practice + // always be the case because the buffer always has even length). + if (buffer && ((bytesWritten % 2 )> 0) && (bufSize > bytesWritten)) + { + // first write a zero pad byte after the end of the JPEG-LS bitstream + buffer[bytesWritten++] = 0; + + // check if we are expected to use an extended EOI marker for padding + if (useFFpadding) + { + // look for the EOI marker + if ((bytesWritten > 2) && (buffer[bytesWritten-3] == 0xFF) && (buffer[bytesWritten-2] == 0xD9)) + { + // we now have ff/d9/00 at the end of the JPEG bitstream, + // i.e. an end of image (EOI) marker followed by a pad byte. + // Replace this with ff/ff/d9, which is an "extended" EOI marker + // ending on an even byte boundary. + buffer[bytesWritten-2] = 0xFF; + buffer[bytesWritten-1] = 0xD9; + } + } + } + return; +} diff --git a/dcmjpls/libsrc/djcparam.cc b/dcmjpls/libsrc/djcparam.cc new file mode 100644 index 00000000..cbaafa7e --- /dev/null +++ b/dcmjpls/libsrc/djcparam.cc @@ -0,0 +1,113 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: codec parameter class for JPEG-LS codecs + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djcparam.h" +#include "dcmtk/ofstd/ofstd.h" + +DJLSCodecParameter::DJLSCodecParameter( + OFBool preferCookedEncoding, + Uint16 jpls_t1, + Uint16 jpls_t2, + Uint16 jpls_t3, + Uint16 jpls_reset, + Uint32 fragmentSize, + OFBool createOffsetTable, + JLS_UIDCreation uidCreation, + OFBool convertToSC, + JLS_PlanarConfiguration planarConfiguration, + OFBool ignoreOffsetTble, + interleaveMode jplsInterleaveMode, + OFBool useFFbitstreamPadding) +: DcmCodecParameter() +, preferCookedEncoding_(preferCookedEncoding) +, jpls_t1_(jpls_t1) +, jpls_t2_(jpls_t2) +, jpls_t3_(jpls_t3) +, jpls_reset_(jpls_reset) +, fragmentSize_(fragmentSize) +, createOffsetTable_(createOffsetTable) +, uidCreation_(uidCreation) +, convertToSC_(convertToSC) +, jplsInterleaveMode_(jplsInterleaveMode) +, useFFbitstreamPadding_(useFFbitstreamPadding) +, planarConfiguration_(planarConfiguration) +, ignoreOffsetTable_(ignoreOffsetTble) +, forceSingleFragmentPerFrame_(OFFalse) +{ +} + + +DJLSCodecParameter::DJLSCodecParameter( + JLS_UIDCreation uidCreation, + JLS_PlanarConfiguration planarConfiguration, + OFBool ignoreOffsetTble, + OFBool forceSingleFragmentPerFrame) +: DcmCodecParameter() +, preferCookedEncoding_(OFTrue) +, jpls_t1_(0) +, jpls_t2_(0) +, jpls_t3_(0) +, jpls_reset_(0) +, fragmentSize_(0) +, createOffsetTable_(OFTrue) +, uidCreation_(uidCreation) +, convertToSC_(OFFalse) +, jplsInterleaveMode_(interleaveDefault) +, useFFbitstreamPadding_(OFTrue) +, planarConfiguration_(planarConfiguration) +, ignoreOffsetTable_(ignoreOffsetTble) +, forceSingleFragmentPerFrame_(forceSingleFragmentPerFrame) +{ +} + +DJLSCodecParameter::DJLSCodecParameter(const DJLSCodecParameter& arg) +: DcmCodecParameter(arg) +, preferCookedEncoding_(arg.preferCookedEncoding_) +, jpls_t1_(arg.jpls_t1_) +, jpls_t2_(arg.jpls_t2_) +, jpls_t3_(arg.jpls_t3_) +, jpls_reset_(arg.jpls_reset_) +, fragmentSize_(arg.fragmentSize_) +, createOffsetTable_(arg.createOffsetTable_) +, uidCreation_(arg.uidCreation_) +, convertToSC_(arg.convertToSC_) +, jplsInterleaveMode_(arg.jplsInterleaveMode_) +, useFFbitstreamPadding_(arg.useFFbitstreamPadding_) +, planarConfiguration_(arg.planarConfiguration_) +, ignoreOffsetTable_(arg.ignoreOffsetTable_) +, forceSingleFragmentPerFrame_(arg.forceSingleFragmentPerFrame_) +{ +} + +DJLSCodecParameter::~DJLSCodecParameter() +{ +} + +DcmCodecParameter *DJLSCodecParameter::clone() const +{ + return new DJLSCodecParameter(*this); +} + +const char *DJLSCodecParameter::className() const +{ + return "DJLSCodecParameter"; +} diff --git a/dcmjpls/libsrc/djdecode.cc b/dcmjpls/libsrc/djdecode.cc new file mode 100644 index 00000000..e6559a88 --- /dev/null +++ b/dcmjpls/libsrc/djdecode.cc @@ -0,0 +1,77 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm + * + * Purpose: singleton class that registers decoders for all supported JPEG-LS processes. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djdecode.h" +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecStruct */ +#include "dcmtk/dcmjpls/djcparam.h" +#include "dcmtk/dcmjpls/djcodecd.h" + +// initialization of static members +OFBool DJLSDecoderRegistration::registered_ = OFFalse; +DJLSCodecParameter *DJLSDecoderRegistration::cp_ = NULL; +DJLSLosslessDecoder *DJLSDecoderRegistration::losslessdecoder_ = NULL; +DJLSNearLosslessDecoder *DJLSDecoderRegistration::nearlosslessdecoder_ = NULL; + +void DJLSDecoderRegistration::registerCodecs( + JLS_UIDCreation uidcreation, + JLS_PlanarConfiguration planarconfig, + OFBool ignoreOffsetTable, + OFBool forceSingleFragmentPerFrame) +{ + if (! registered_) + { + cp_ = new DJLSCodecParameter(uidcreation, planarconfig, ignoreOffsetTable, forceSingleFragmentPerFrame); + if (cp_) + { + losslessdecoder_ = new DJLSLosslessDecoder(); + if (losslessdecoder_) DcmCodecList::registerCodec(losslessdecoder_, NULL, cp_); + + nearlosslessdecoder_ = new DJLSNearLosslessDecoder(); + if (nearlosslessdecoder_) DcmCodecList::registerCodec(nearlosslessdecoder_, NULL, cp_); + registered_ = OFTrue; + } + } +} + +void DJLSDecoderRegistration::cleanup() +{ + if (registered_) + { + DcmCodecList::deregisterCodec(losslessdecoder_); + DcmCodecList::deregisterCodec(nearlosslessdecoder_); + delete losslessdecoder_; + delete nearlosslessdecoder_; + delete cp_; + registered_ = OFFalse; +#ifdef DEBUG + // not needed but useful for debugging purposes + losslessdecoder_ = NULL; + nearlosslessdecoder_ = NULL; + cp_ = NULL; +#endif + } +} + +OFString DJLSDecoderRegistration::getLibraryVersionString() +{ + return DCMJPLS_CHARLS_VERSION_STRING; +} diff --git a/dcmjpls/libsrc/djencode.cc b/dcmjpls/libsrc/djencode.cc new file mode 100644 index 00000000..2ac87eac --- /dev/null +++ b/dcmjpls/libsrc/djencode.cc @@ -0,0 +1,87 @@ +/* + * + * Copyright (C) 1997-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: singleton class that registers encoders for all supported JPEG processes. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djencode.h" +#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecStruct */ +#include "dcmtk/dcmjpls/djcparam.h" +#include "dcmtk/dcmjpls/djcodece.h" + +// initialization of static members +OFBool DJLSEncoderRegistration::registered_ = OFFalse; +DJLSCodecParameter *DJLSEncoderRegistration::cp_ = NULL; +DJLSLosslessEncoder *DJLSEncoderRegistration::losslessencoder_ = NULL; +DJLSNearLosslessEncoder *DJLSEncoderRegistration::nearlosslessencoder_ = NULL; + + +void DJLSEncoderRegistration::registerCodecs( + Uint16 jpls_t1, + Uint16 jpls_t2, + Uint16 jpls_t3, + Uint16 jpls_reset, + OFBool preferCookedEncoding, + Uint32 fragmentSize, + OFBool createOffsetTable, + JLS_UIDCreation uidCreation, + OFBool convertToSC, + DJLSCodecParameter::interleaveMode jplsInterleaveMode, + OFBool useFFbitstreamPadding) +{ + if (! registered_) + { + cp_ = new DJLSCodecParameter(preferCookedEncoding, jpls_t1, jpls_t2, jpls_t3, + jpls_reset, fragmentSize, createOffsetTable, uidCreation, + convertToSC, EJLSPC_restore, OFFalse, jplsInterleaveMode, useFFbitstreamPadding); + + if (cp_) + { + losslessencoder_ = new DJLSLosslessEncoder(); + if (losslessencoder_) DcmCodecList::registerCodec(losslessencoder_, NULL, cp_); + nearlosslessencoder_ = new DJLSNearLosslessEncoder(); + if (nearlosslessencoder_) DcmCodecList::registerCodec(nearlosslessencoder_, NULL, cp_); + registered_ = OFTrue; + } + } +} + +void DJLSEncoderRegistration::cleanup() +{ + if (registered_) + { + DcmCodecList::deregisterCodec(losslessencoder_); + DcmCodecList::deregisterCodec(nearlosslessencoder_); + delete losslessencoder_; + delete nearlosslessencoder_; + delete cp_; + registered_ = OFFalse; +#ifdef DEBUG + // not needed but useful for debugging purposes + losslessencoder_ = NULL; + nearlosslessencoder_ = NULL; + cp_ = NULL; +#endif + } +} + +OFString DJLSEncoderRegistration::getLibraryVersionString() +{ + return DCMJPLS_CHARLS_VERSION_STRING; +} diff --git a/dcmjpls/libsrc/djerror.h b/dcmjpls/libsrc/djerror.h new file mode 100644 index 00000000..d625c48a --- /dev/null +++ b/dcmjpls/libsrc/djerror.h @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 1997-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Uli Schlachter + * + * Purpose: Helper function than converts between CharLS and dcmjpgls errors + * + */ + +#ifndef DJERROR_H +#define DJERROR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djlsutil.h" /* For the OFCondition codes */ +#include "intrface.h" /* CharLS include */ + +/** Helper class for converting between dcmjpls and CharLS error codes + */ +class DJLSError +{ +private: + /// private undefined constructor + DJLSError(); + +public: + + /** This method converts a CharLS error code into a dcmjpls OFCondition + * @param error The CharLS error code + * @return The OFCondition + */ + static const OFConditionConst& convert(JLS_ERROR error) + { + switch (error) + { + case OK: + return EC_Normal; + case UncompressedBufferTooSmall: + return EC_JLSUncompressedBufferTooSmall; + case CompressedBufferTooSmall: + return EC_JLSCompressedBufferTooSmall; + case ImageTypeNotSupported: + return EC_JLSCodecUnsupportedImageType; + case InvalidJlsParameters: + return EC_JLSCodecInvalidParameters; + case ParameterValueNotSupported: + return EC_JLSCodecUnsupportedValue; + case InvalidCompressedData: + return EC_JLSInvalidCompressedData; + case UnsupportedBitDepthForTransform: + return EC_JLSUnsupportedBitDepthForTransform; + case UnsupportedColorTransform: + return EC_JLSUnsupportedColorTransform; + case TooMuchCompressedData: + return EC_JLSTooMuchCompressedData; + default: + return EC_IllegalParameter; + } + } +}; + +#endif diff --git a/dcmjpls/libsrc/djrparam.cc b/dcmjpls/libsrc/djrparam.cc new file mode 100644 index 00000000..f00a83db --- /dev/null +++ b/dcmjpls/libsrc/djrparam.cc @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 1997-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm + * + * Purpose: representation parameter for JPEG-LS + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djrparam.h" +#include "dcmtk/ofstd/ofstd.h" + +DJLSRepresentationParameter::DJLSRepresentationParameter( + Uint16 nearlosslessDeviation, + OFBool losslessProcess) +: DcmRepresentationParameter() +, nearlosslessDeviation_(nearlosslessDeviation) +, losslessProcess_(losslessProcess) +{ +} + +DJLSRepresentationParameter::DJLSRepresentationParameter(const DJLSRepresentationParameter& arg) +: DcmRepresentationParameter(arg) +, nearlosslessDeviation_(arg.nearlosslessDeviation_) +, losslessProcess_(arg.losslessProcess_) +{ +} + +DJLSRepresentationParameter::~DJLSRepresentationParameter() +{ +} + +DcmRepresentationParameter *DJLSRepresentationParameter::clone() const +{ + return new DJLSRepresentationParameter(*this); +} + +const char *DJLSRepresentationParameter::className() const +{ + return "DJLSRepresentationParameter"; +} + +OFBool DJLSRepresentationParameter::operator==(const DcmRepresentationParameter &arg) const +{ + const char *argname = arg.className(); + if (argname) + { + OFString argstring(argname); + if (argstring == className()) + { + const DJLSRepresentationParameter& argll = OFreinterpret_cast(const DJLSRepresentationParameter &, arg); + if (losslessProcess_ && argll.losslessProcess_) return OFTrue; + else if (losslessProcess_ != argll.losslessProcess_) return OFFalse; + else if (nearlosslessDeviation_ != argll.nearlosslessDeviation_) return OFFalse; + return OFTrue; + } + } + return OFFalse; +} diff --git a/dcmjpls/libsrc/djutils.cc b/dcmjpls/libsrc/djutils.cc new file mode 100644 index 00000000..6224e5d4 --- /dev/null +++ b/dcmjpls/libsrc/djutils.cc @@ -0,0 +1,45 @@ +/* + * + * Copyright (C) 1997-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmjpls + * + * Author: Martin Willkomm, Uli Schlachter + * + * Purpose: Support code for dcmjpls + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmjpls/djlsutil.h" +#include "dcmtk/dcmdata/dcerror.h" + +OFLogger DCM_dcmjplsLogger = OFLog::getLogger("dcmtk.dcmjpls"); + +#define MAKE_DCMJPLS_ERROR(number, name, description) \ +makeOFConditionConst(EC_ ## name, OFM_dcmjpls, number, OF_error, description) + +MAKE_DCMJPLS_ERROR( 1, JLSUncompressedBufferTooSmall, "Uncompressed pixel data too short for uncompressed image"); +MAKE_DCMJPLS_ERROR( 2, JLSCompressedBufferTooSmall, "Allocated too small buffer for compressed image data"); +MAKE_DCMJPLS_ERROR( 3, JLSCodecUnsupportedImageType, "Codec does not support this JPEG-LS image"); +MAKE_DCMJPLS_ERROR( 4, JLSCodecInvalidParameters, "Codec received invalid compression parameters"); +MAKE_DCMJPLS_ERROR( 5, JLSCodecUnsupportedValue, "Codec received unsupported compression parameters"); +MAKE_DCMJPLS_ERROR( 6, JLSInvalidCompressedData, "Invalid compressed image data"); +MAKE_DCMJPLS_ERROR( 7, JLSUnsupportedBitDepthForTransform, "Codec does not support the image's color transformation with this bit depth"); +MAKE_DCMJPLS_ERROR( 8, JLSUnsupportedColorTransform, "Codec does not support the image's color transformation"); +MAKE_DCMJPLS_ERROR( 9, JLSUnsupportedBitDepth, "Unsupported bit depth in JPEG-LS transfer syntax"); +MAKE_DCMJPLS_ERROR(10, JLSCannotComputeNumberOfFragments, "Cannot compute number of fragments for JPEG-LS frame"); +MAKE_DCMJPLS_ERROR(11, JLSImageDataMismatch, "Image data mismatch between DICOM header and JPEG-LS bitstream"); +MAKE_DCMJPLS_ERROR(12, JLSUnsupportedPhotometricInterpretation, "Unsupported photometric interpretation for near-lossless JPEG-LS compression"); +MAKE_DCMJPLS_ERROR(13, JLSUnsupportedPixelRepresentation, "Unsupported pixel representation for near-lossless JPEG-LS compression"); +MAKE_DCMJPLS_ERROR(14, JLSUnsupportedImageType, "Unsupported type of image for JPEG-LS compression"); +MAKE_DCMJPLS_ERROR(15, JLSTooMuchCompressedData, "Too much compressed data, trailing data after image"); diff --git a/dcmjpls/tests/Makefile.in b/dcmjpls/tests/Makefile.in new file mode 100644 index 00000000..895210f2 --- /dev/null +++ b/dcmjpls/tests/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmjpls/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +check: + +check-exhaustive: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) + +dependencies: diff --git a/dcmnet/CMakeLists.txt b/dcmnet/CMakeLists.txt new file mode 100644 index 00000000..4fb4d4dd --- /dev/null +++ b/dcmnet/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmnet) + +# declare include directories which hold for all subdirectories +include_directories("${dcmnet_SOURCE_DIR}/include" "${dcmtls_SOURCE_DIR}/include" ${OPENSSL_INCDIR} "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc apps include docs etc tests) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmnet/Makefile.in b/dcmnet/Makefile.in new file mode 100644 index 00000000..805d9147 --- /dev/null +++ b/dcmnet/Makefile.in @@ -0,0 +1,97 @@ +# +# Makefile for dcmnet +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmnet/apps/CMakeLists.txt b/dcmnet/apps/CMakeLists.txt new file mode 100644 index 00000000..aa0ff8b2 --- /dev/null +++ b/dcmnet/apps/CMakeLists.txt @@ -0,0 +1,40 @@ +# declare additional include directories needed for compression support +include_directories("${dcmjpls_SOURCE_DIR}/include" "${dcmjpeg_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include") + +# declare executables +foreach(PROGRAM dcmrecv dcmsend echoscu findscu getscu movescu storescp storescu termscu) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() + +# declare installation files +if(WITH_OPENSSL) + if(WIN32) + install(DIRECTORY "${OPENSSL_BINDIR}/" + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT bin + CONFIGURATIONS Release MinSizeRel + FILES_MATCHING REGEX "dcmtk(eay|crypto|ssl).*\\.dll" + REGEX "dcmtk(eay|crypto|ssl)_d.*\\.dll" EXCLUDE + ) + install(DIRECTORY "${OPENSSL_BINDIR}/" + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT bin + CONFIGURATIONS Debug RelWithDebInfo + FILES_MATCHING REGEX "dcmtk(eay|crypto|ssl)_d.*\\.dll" + ) + endif() +endif() + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcmrecv dcmsend echoscu findscu getscu movescu storescp storescu termscu) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmnet dcmdata oflog ofstd) +endforeach() +foreach(PROGRAM echoscu findscu storescp storescu) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmtls) +endforeach() + +# uncomment the following line if "storescu" is compiled with ON_THE_FLY_COMPRESSION defined +#DCMTK_TARGET_LINK_MODULES(storescu dcmjpls dcmjpeg dcmimage) + +# "dcmsend" always needs compression support +DCMTK_TARGET_LINK_MODULES(dcmsend dcmjpls dcmjpeg dcmimage) diff --git a/dcmnet/apps/Makefile.dep b/dcmnet/apps/Makefile.dep new file mode 100644 index 00000000..4f10a025 --- /dev/null +++ b/dcmnet/apps/Makefile.dep @@ -0,0 +1,897 @@ +dcmrecv.o: dcmrecv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmnet/dstorscp.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h ../include/dcmtk/dcmnet/scp.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmnet/assoc.h ../include/dcmtk/dcmnet/dicom.h \ + ../include/dcmtk/dcmnet/cond.h ../include/dcmtk/dcmnet/dndefine.h \ + ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h ../include/dcmtk/dcmnet/lst.h \ + ../include/dcmtk/dcmnet/dul.h ../include/dcmtk/dcmnet/extneg.h \ + ../include/dcmtk/dcmnet/dcuserid.h ../include/dcmtk/dcmnet/dntypes.h \ + ../include/dcmtk/dcmnet/dimse.h ../include/dcmtk/dcmnet/scpcfg.h \ + ../include/dcmtk/dcmnet/dcasccff.h ../include/dcmtk/dcmnet/dcasccfg.h \ + ../include/dcmtk/dcmnet/dccftsmp.h ../include/dcmtk/dcmnet/dccfuidh.h \ + ../include/dcmtk/dcmnet/dccfpcmp.h ../include/dcmtk/dcmnet/dccfrsmp.h \ + ../include/dcmtk/dcmnet/dccfenmp.h ../include/dcmtk/dcmnet/dccfprmp.h \ + ../include/dcmtk/dcmnet/diutil.h +dcmsend.o: dcmsend.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmnet/dstorscu.h ../include/dcmtk/dcmnet/scu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dimse.h \ + ../include/dcmtk/dcmnet/dicom.h ../include/dcmtk/dcmnet/cond.h \ + ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \ + ../include/dcmtk/dcmnet/extneg.h ../include/dcmtk/dcmnet/dcuserid.h \ + ../include/dcmtk/dcmnet/dntypes.h ../include/dcmtk/dcmnet/assoc.h \ + ../include/dcmtk/dcmnet/dcasccff.h ../include/dcmtk/dcmnet/dcasccfg.h \ + ../include/dcmtk/dcmnet/dccftsmp.h ../include/dcmtk/dcmnet/dccfuidh.h \ + ../include/dcmtk/dcmnet/dccfpcmp.h ../include/dcmtk/dcmnet/dccfrsmp.h \ + ../include/dcmtk/dcmnet/dccfenmp.h ../include/dcmtk/dcmnet/dccfprmp.h \ + ../../dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h \ + ../../dcmjpeg/include/dcmtk/dcmjpeg/djutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmjpeg/include/dcmtk/dcmjpeg/djdefine.h \ + ../../dcmjpls/include/dcmtk/dcmjpls/djdecode.h \ + ../../dcmjpls/include/dcmtk/dcmjpls/djlsutil.h \ + ../../dcmjpls/include/dcmtk/dcmjpls/dldefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcrledrg.h \ + ../../dcmjpeg/include/dcmtk/dcmjpeg/dipijpeg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h +echoscu.o: echoscu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmnet/dimse.h ../include/dcmtk/dcmnet/dicom.h \ + ../include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmnet/lst.h ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmnet/dul.h ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmnet/extneg.h ../include/dcmtk/dcmnet/dcuserid.h \ + ../include/dcmtk/dcmnet/dntypes.h ../include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmnet/diutil.h ../include/dcmtk/dcmnet/dcmtrans.h \ + ../include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h +findscu.o: findscu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmnet/dfindscu.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../include/dcmtk/dcmnet/dimse.h ../include/dcmtk/dcmnet/dicom.h \ + ../include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmnet/lst.h ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmnet/dul.h ../include/dcmtk/dcmnet/extneg.h \ + ../include/dcmtk/dcmnet/dcuserid.h ../include/dcmtk/dcmnet/dntypes.h \ + ../include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +getscu.o: getscu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmnet/scu.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dimse.h \ + ../include/dcmtk/dcmnet/dicom.h ../include/dcmtk/dcmnet/cond.h \ + ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \ + ../include/dcmtk/dcmnet/extneg.h ../include/dcmtk/dcmnet/dcuserid.h \ + ../include/dcmtk/dcmnet/dntypes.h ../include/dcmtk/dcmnet/assoc.h \ + ../include/dcmtk/dcmnet/dcasccff.h ../include/dcmtk/dcmnet/dcasccfg.h \ + ../include/dcmtk/dcmnet/dccftsmp.h ../include/dcmtk/dcmnet/dccfuidh.h \ + ../include/dcmtk/dcmnet/dccfpcmp.h ../include/dcmtk/dcmnet/dccfrsmp.h \ + ../include/dcmtk/dcmnet/dccfenmp.h ../include/dcmtk/dcmnet/dccfprmp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpath.h +movescu.o: movescu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmnet/dicom.h \ + ../include/dcmtk/dcmnet/cond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmnet/dimse.h ../include/dcmtk/dcmnet/lst.h \ + ../include/dcmtk/dcmnet/dul.h ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmnet/extneg.h ../include/dcmtk/dcmnet/dcuserid.h \ + ../include/dcmtk/dcmnet/dntypes.h ../include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h +storescp.o: storescp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h ../include/dcmtk/dcmnet/dicom.h \ + ../include/dcmtk/dcmnet/cond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmnet/dimse.h ../include/dcmtk/dcmnet/lst.h \ + ../include/dcmtk/dcmnet/dul.h ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmnet/extneg.h ../include/dcmtk/dcmnet/dcuserid.h \ + ../include/dcmtk/dcmnet/dntypes.h ../include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmnet/diutil.h ../include/dcmtk/dcmnet/dcmtrans.h \ + ../include/dcmtk/dcmnet/dcmlayer.h ../include/dcmtk/dcmnet/dcasccfg.h \ + ../include/dcmtk/dcmnet/dccftsmp.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmnet/dccfuidh.h ../include/dcmtk/dcmnet/dccfpcmp.h \ + ../include/dcmtk/dcmnet/dccfrsmp.h ../include/dcmtk/dcmnet/dccfenmp.h \ + ../include/dcmtk/dcmnet/dccfprmp.h ../include/dcmtk/dcmnet/dcasccff.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h +storescu.o: storescu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmnet/dicom.h \ + ../include/dcmtk/dcmnet/cond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmnet/dimse.h ../include/dcmtk/dcmnet/lst.h \ + ../include/dcmtk/dcmnet/dul.h ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmnet/extneg.h ../include/dcmtk/dcmnet/dcuserid.h \ + ../include/dcmtk/dcmnet/dntypes.h ../include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmnet/diutil.h ../include/dcmtk/dcmnet/dcmtrans.h \ + ../include/dcmtk/dcmnet/dcmlayer.h ../include/dcmtk/dcmnet/dcasccfg.h \ + ../include/dcmtk/dcmnet/dccftsmp.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmnet/dccfuidh.h ../include/dcmtk/dcmnet/dccfpcmp.h \ + ../include/dcmtk/dcmnet/dccfrsmp.h ../include/dcmtk/dcmnet/dccfenmp.h \ + ../include/dcmtk/dcmnet/dccfprmp.h ../include/dcmtk/dcmnet/dcasccff.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h +termscu.o: termscu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../include/dcmtk/dcmnet/assoc.h ../include/dcmtk/dcmnet/dicom.h \ + ../include/dcmtk/dcmnet/cond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../include/dcmtk/dcmnet/dndefine.h ../include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmnet/extneg.h ../include/dcmtk/dcmnet/dcuserid.h \ + ../include/dcmtk/dcmnet/dntypes.h ../include/dcmtk/dcmnet/dimse.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h diff --git a/dcmnet/apps/Makefile.in b/dcmnet/apps/Makefile.in new file mode 100644 index 00000000..765e1dd1 --- /dev/null +++ b/dcmnet/apps/Makefile.in @@ -0,0 +1,90 @@ +# +# Makefile for dcmnet/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmtlsdir = $(top_srcdir)/../dcmtls + +# these defines are used when compression support is needed for one of the tools +compr_includes = -I$(top_srcdir)/../dcmimgle/include -I$(top_srcdir)/../dcmimage/include \ + -I$(top_srcdir)/../dcmjpeg/include -I$(top_srcdir)/../dcmjpls/include +compr_libdirs = -L$(top_srcdir)/../dcmimgle/libsrc -L$(top_srcdir)/../dcmimage/libsrc \ + -L$(top_srcdir)/../dcmjpeg/libsrc -L$(top_srcdir)/../dcmjpeg/libijg8 \ + -L$(top_srcdir)/../dcmjpeg/libijg12 -L$(top_srcdir)/../dcmjpeg/libijg16 \ + -L$(top_srcdir)/../dcmjpls/libsrc -L$(top_srcdir)/../dcmjpls/libcharls + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmtlsdir)/include $(compr_includes) +LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc \ + -L$(dcmdatadir)/libsrc -L$(dcmtlsdir)/libsrc $(compr_libdirs) +LOCALLIBS = -ldcmnet -ldcmdata -loflog -lofstd $(ZLIBLIBS) $(TCPWRAPPERLIBS) \ + $(CHARCONVLIBS) $(MATHLIBS) +DCMTLSLIBS = -ldcmtls +COMPR_LIBS = -ldcmjpls -lcharls -ldcmjpeg -lijg8 -lijg12 -lijg16 -ldcmimage -ldcmimgle + +objs = echoscu.o storescu.o storescp.o findscu.o movescu.o termscu.o getscu.o dcmsend.o \ + dcmrecv.o +progs = echoscu storescu storescp findscu movescu termscu getscu dcmsend dcmrecv + + +all: $(progs) + +echoscu: echoscu.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(DCMTLSLIBS) $(OPENSSLLIBS) $(LIBS) + +# add $(COMPR_LIBS) to the linking instructions if "storescu" is compiled +# with ON_THE_FLY_COMPRESSION defined (see "config/docs/macros.txt") +storescu: storescu.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(DCMTLSLIBS) $(OPENSSLLIBS) $(LIBS) + +storescp: storescp.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(DCMTLSLIBS) $(OPENSSLLIBS) $(LIBS) + +findscu: findscu.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(DCMTLSLIBS) $(OPENSSLLIBS) $(LIBS) + +movescu: movescu.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +termscu: termscu.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +getscu: getscu.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +dcmsend: dcmsend.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(COMPR_LIBS) $(LOCALLIBS) $(TIFFLIBS) $(PNGLIBS) $(LIBS) + +dcmrecv: dcmrecv.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmnet/apps/dcmrecv.cc b/dcmnet/apps/dcmrecv.cc new file mode 100644 index 00000000..408581f8 --- /dev/null +++ b/dcmnet/apps/dcmrecv.cc @@ -0,0 +1,308 @@ +/* + * + * Copyright (C) 2013-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Joerg Riesmeier + * + * Purpose: Simple Storage Service Class Provider + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstd.h" /* for OFStandard functions */ +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/ofstd/ofstream.h" /* for OFStringStream et al. */ +#include "dcmtk/dcmdata/dcdict.h" /* for global data dictionary */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/dcmnet/dstorscp.h" /* for DcmStorageSCP */ + + +/* general definitions */ + +#define OFFIS_CONSOLE_APPLICATION "dcmrecv" + +static OFLogger dcmrecvLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* default application entity title */ +#define APPLICATIONTITLE "DCMRECV" + + +/* exit codes for this command line tool */ +/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */ + +// network errors +#define EXITCODE_CANNOT_INITIALIZE_NETWORK 60 // placeholder, currently not used +#define EXITCODE_CANNOT_START_SCP_AND_LISTEN 64 +#define EXITCODE_INVALID_ASSOCIATION_CONFIG 66 + + +/* helper macro for converting stream output to a string */ +#define CONVERT_TO_STRING(output, string) \ + optStream.str(""); \ + optStream.clear(); \ + optStream << output << OFStringStream_ends; \ + OFSTRINGSTREAM_GETOFSTRING(optStream, string) + + +/* main program */ + +#define SHORTCOL 4 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + OFOStringStream optStream; + + const char *opt_configFile = NULL; + const char *opt_profileName = NULL; + const char *opt_aeTitle = APPLICATIONTITLE; + const char *opt_outputDirectory = "."; + const char *opt_filenameExtension = ""; + + OFCmdUnsignedInt opt_port = 0; + OFCmdUnsignedInt opt_dimseTimeout = 0; + OFCmdUnsignedInt opt_acseTimeout = 30; + OFCmdUnsignedInt opt_maxPDULength = ASC_DEFAULTMAXPDU; + T_DIMSE_BlockingMode opt_blockingMode = DIMSE_BLOCKING; + + OFBool opt_showPresentationContexts = OFFalse; // default: do not show presentation contexts in verbose mode + OFBool opt_useCalledAETitle = OFFalse; // default: respond with specified application entity title + OFBool opt_HostnameLookup = OFTrue; // default: perform hostname lookup (for log output) + + DcmStorageSCP::E_DirectoryGenerationMode opt_directoryGeneration = DcmStorageSCP::DGM_NoSubdirectory; + DcmStorageSCP::E_FilenameGenerationMode opt_filenameGeneration = DcmStorageSCP::FGM_SOPInstanceUID; + DcmStorageSCP::E_DatasetStorageMode opt_datasetStorage = DcmStorageSCP::DGM_StoreToFile; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Simple DICOM storage SCP (receiver)", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("port", "tcp/ip port number to listen on"); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--verbose-pc", "+v", "show presentation contexts in verbose mode"); + + cmd.addGroup("network options:"); + cmd.addSubGroup("association negotiation profile from configuration file:"); + cmd.addOption("--config-file", "-xf", 2, "[f]ilename, [p]rofile: string", + "use profile p from configuration file f"); + cmd.addSubGroup("application entity title:"); + CONVERT_TO_STRING("set my AE title (default: " << opt_aeTitle << ")", optString1); + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", optString1.c_str()); + cmd.addOption("--use-called-aetitle", "-uca", "always respond with called AE title"); + cmd.addSubGroup("other network options:"); + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_acseTimeout << ")", optString2); + cmd.addOption("--acse-timeout", "-ta", 1, optString2.c_str(), + "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", + "timeout for DIMSE messages"); + CONVERT_TO_STRING("[n]umber of bytes: integer (" << ASC_MINIMUMPDUSIZE << ".." << ASC_MAXIMUMPDUSIZE << ")", optString3); + CONVERT_TO_STRING("set max receive pdu to n bytes (default: " << opt_maxPDULength << ")", optString4); + cmd.addOption("--max-pdu", "-pdu", 1, optString3.c_str(), + optString4.c_str()); + cmd.addOption("--disable-host-lookup", "-dhl", "disable hostname lookup"); + cmd.addGroup("output options:"); + cmd.addSubGroup("general:"); + CONVERT_TO_STRING("[d]irectory: string (default: \"" << opt_outputDirectory << "\")", optString5); + cmd.addOption("--output-directory", "-od", 1, optString5.c_str(), + "write received objects to existing directory d"); + cmd.addSubGroup("subdirectory generation:"); + cmd.addOption("--no-subdir", "-s", "do not generate any subdirectories (default)"); + cmd.addOption("--series-date-subdir", "+ssd", "generate subdirectories from series date"); + cmd.addSubGroup("filename generation:"); + cmd.addOption("--default-filenames", "+fd", "generate filename from instance UID (default)"); + cmd.addOption("--unique-filenames", "+fu", "generate unique filename based on new UID"); + cmd.addOption("--short-unique-names", "+fsu", "generate short pseudo-random unique filename"); + cmd.addOption("--system-time-names", "+fst", "generate filename from current system time"); + cmd.addOption("--filename-extension", "-fe", 1, "[e]xtension: string (default: none)", + "append e to all generated filenames"); + cmd.addSubGroup("storage mode:"); + cmd.addOption("--normal", "-B", "allow implicit format conversions (default)"); + cmd.addOption("--bit-preserving", "+B", "write dataset exactly as received"); + cmd.addOption("--ignore", "ignore dataset, receive but do not store it"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used: none" << OFendl; + return EXITCODE_NO_ERROR; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + if (cmd.findOption("--verbose-pc")) + { + app.checkDependence("--verbose-pc", "verbose mode", dcmrecvLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_showPresentationContexts = OFTrue; + } + + /* network options */ + if (cmd.findOption("--config-file")) + { + app.checkValue(cmd.getValue(opt_configFile)); + app.checkValue(cmd.getValue(opt_profileName)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--aetitle")) + { + app.checkValue(cmd.getValue(opt_aeTitle)); + opt_useCalledAETitle = OFFalse; + } + if (cmd.findOption("--use-called-aetitle")) + opt_useCalledAETitle = OFTrue; + cmd.endOptionBlock(); + + if (cmd.findOption("--acse-timeout")) + app.checkValue(cmd.getValueAndCheckMin(opt_acseTimeout, 1)); + if (cmd.findOption("--dimse-timeout")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_dimseTimeout, 1)); + opt_blockingMode = DIMSE_NONBLOCKING; + } + if (cmd.findOption("--max-pdu")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_maxPDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--disable-host-lookup")) + opt_HostnameLookup = OFFalse; + + /* output options */ + if (cmd.findOption("--output-directory")) + app.checkValue(cmd.getValue(opt_outputDirectory)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-subdir")) + opt_directoryGeneration = DcmStorageSCP::DGM_NoSubdirectory; + if (cmd.findOption("--series-date-subdir")) + opt_directoryGeneration = DcmStorageSCP::DGM_SeriesDate; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--default-filenames")) + opt_filenameGeneration = DcmStorageSCP::FGM_SOPInstanceUID; + if (cmd.findOption("--unique-filenames")) + opt_filenameGeneration = DcmStorageSCP::FGM_UniqueFromNewUID; + if (cmd.findOption("--short-unique-names")) + opt_filenameGeneration = DcmStorageSCP::FGM_ShortUniquePseudoRandom; + if (cmd.findOption("--system-time-names")) + opt_filenameGeneration = DcmStorageSCP::FGM_CurrentSystemTime; + cmd.endOptionBlock(); + + if (cmd.findOption("--filename-extension")) + app.checkValue(cmd.getValue(opt_filenameExtension)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--normal")) + opt_datasetStorage = DcmStorageSCP::DGM_StoreToFile; + if (cmd.findOption("--bit-preserving")) + { + app.checkConflict("--bit-preserving", "--series-date-subdir", opt_directoryGeneration == DcmStorageSCP::DGM_SeriesDate); + opt_datasetStorage = DcmStorageSCP::DGM_StoreBitPreserving; + } + if (cmd.findOption("--ignore")) + opt_datasetStorage = DcmStorageSCP::DSM_Ignore; + cmd.endOptionBlock(); + + /* command line parameters */ + app.checkParam(cmd.getParamAndCheckMinMax(1, opt_port, 1, 65535)); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmrecvLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmrecvLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* start with the real work */ + DcmStorageSCP storageSCP; + OFCondition status; + + OFLOG_INFO(dcmrecvLogger, "configuring service class provider ..."); + + /* set general network parameters */ + storageSCP.setPort(OFstatic_cast(Uint16, opt_port)); + storageSCP.setAETitle(opt_aeTitle); + storageSCP.setMaxReceivePDULength(OFstatic_cast(Uint32, opt_maxPDULength)); + storageSCP.setACSETimeout(OFstatic_cast(Uint32, opt_acseTimeout)); + storageSCP.setDIMSETimeout(OFstatic_cast(Uint32, opt_dimseTimeout)); + storageSCP.setDIMSEBlockingMode(opt_blockingMode); + storageSCP.setVerbosePCMode(opt_showPresentationContexts); + storageSCP.setRespondWithCalledAETitle(opt_useCalledAETitle); + storageSCP.setHostLookupEnabled(opt_HostnameLookup); + storageSCP.setDirectoryGenerationMode(opt_directoryGeneration); + storageSCP.setFilenameGenerationMode(opt_filenameGeneration); + storageSCP.setFilenameExtension(opt_filenameExtension); + storageSCP.setDatasetStorageMode(opt_datasetStorage); + + /* load association negotiation profile from configuration file (if specified) */ + if ((opt_configFile != NULL) && (opt_profileName != NULL)) + { + status = storageSCP.loadAssociationConfiguration(opt_configFile, opt_profileName); + if (status.bad()) + { + OFLOG_FATAL(dcmrecvLogger, "cannot load association configuration: " << status.text()); + return EXITCODE_INVALID_ASSOCIATION_CONFIG; + } + } else { + /* report a warning message that the SCP will not accept any Storage SOP Classes */ + OFLOG_WARN(dcmrecvLogger, "no configuration file specified, SCP will only support the Verification SOP Class"); + } + + /* specify the output directory (also checks whether directory exists and is writable) */ + status = storageSCP.setOutputDirectory(opt_outputDirectory); + if (status.bad()) + { + OFLOG_FATAL(dcmrecvLogger, "cannot specify output directory: " << status.text()); + return EXITCODE_INVALID_OUTPUT_DIRECTORY; + } + + OFLOG_INFO(dcmrecvLogger, "starting service class provider and listening ..."); + + /* start SCP and listen on the specified port */ + status = storageSCP.listen(); + if (status.bad()) + { + OFLOG_FATAL(dcmrecvLogger, "cannot start SCP and listen on port " << opt_port << ": " << status.text()); + return EXITCODE_CANNOT_START_SCP_AND_LISTEN; + } + + /* make sure that everything is cleaned up properly */ +#ifdef DEBUG + /* useful for debugging with dmalloc */ + dcmDataDict.clear(); +#endif + + return EXITCODE_NO_ERROR; +} diff --git a/dcmnet/apps/dcmsend.cc b/dcmnet/apps/dcmsend.cc new file mode 100644 index 00000000..c5231027 --- /dev/null +++ b/dcmnet/apps/dcmsend.cc @@ -0,0 +1,575 @@ +/* + * + * Copyright (C) 2011-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Joerg Riesmeier + * + * Purpose: Simple Storage Service Class User + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstd.h" /* for OFStandard functions */ +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/ofstd/ofstream.h" /* for OFStringStream et al. */ +#include "dcmtk/dcmdata/dcdict.h" /* for global data dictionary */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/dcmnet/dstorscu.h" /* for DcmStorageSCU */ + +#include "dcmtk/dcmjpeg/djdecode.h" /* for JPEG decoders */ +#include "dcmtk/dcmjpls/djdecode.h" /* for JPEG-LS decoders */ +#include "dcmtk/dcmdata/dcrledrg.h" /* for RLE decoder */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ + + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#if defined (HAVE_WINDOWS_H) || defined(HAVE_FNMATCH_H) +#define PATTERN_MATCHING_AVAILABLE +#endif + + +/* general definitions */ + +#define OFFIS_CONSOLE_APPLICATION "dcmsend" + +static OFLogger dcmsendLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* default application entity titles */ +#define APPLICATIONTITLE "DCMSEND" +#define PEERAPPLICATIONTITLE "ANY-SCP" + + +/* exit codes for this command line tool */ +/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */ + +// output file errors +#define EXITCODE_CANNOT_WRITE_REPORT_FILE 43 + +// network errors +#define EXITCODE_CANNOT_INITIALIZE_NETWORK 60 +#define EXITCODE_CANNOT_NEGOTIATE_ASSOCIATION 61 +#define EXITCODE_CANNOT_SEND_REQUEST 62 +#define EXITCODE_CANNOT_ADD_PRESENTATION_CONTEXT 65 + + +/* helper macro for converting stream output to a string */ +#define CONVERT_TO_STRING(output, string) \ + optStream.str(""); \ + optStream.clear(); \ + optStream << output << OFStringStream_ends; \ + OFSTRINGSTREAM_GETOFSTRING(optStream, string) + + +/* static helper functions */ + +// make sure that everything is cleaned up properly +static void cleanup() +{ + // deregister JPEG decoder + DJDecoderRegistration::cleanup(); + // deregister JPEG-LS decoder + DJLSDecoderRegistration::cleanup(); + // deregister RLE decoder + DcmRLEDecoderRegistration::cleanup(); +#ifdef DEBUG + /* useful for debugging with dmalloc */ + dcmDataDict.clear(); +#endif +} + + +/* main program */ + +#define SHORTCOL 4 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + OFOStringStream optStream; + + const char *opt_peer = NULL; + const char *opt_peerTitle = PEERAPPLICATIONTITLE; + const char *opt_ourTitle = APPLICATIONTITLE; + + E_FileReadMode opt_readMode = ERM_fileOnly; + + OFCmdUnsignedInt opt_port = 0; + OFCmdUnsignedInt opt_timeout = 0; + OFCmdUnsignedInt opt_dimseTimeout = 0; + OFCmdUnsignedInt opt_acseTimeout = 30; + OFCmdUnsignedInt opt_maxReceivePDULength = ASC_DEFAULTMAXPDU; + OFCmdUnsignedInt opt_maxSendPDULength = 0; + T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING; +#ifdef WITH_ZLIB + OFCmdUnsignedInt opt_compressionLevel = 0; +#endif + + OFBool opt_showPresentationContexts = OFFalse; + OFBool opt_haltOnInvalidFile = OFTrue; + OFBool opt_haltOnUnsuccessfulStore = OFTrue; + OFBool opt_allowIllegalProposal = OFTrue; + OFBool opt_checkUIDValues = OFTrue; + OFBool opt_multipleAssociations = OFTrue; + DcmStorageSCU::E_DecompressionMode opt_decompressionMode = DcmStorageSCU::DM_losslessOnly; + + OFBool opt_dicomDir = OFFalse; + OFBool opt_scanDir = OFFalse; + OFBool opt_recurse = OFFalse; + const char *opt_scanPattern = ""; + const char *opt_reportFilename = ""; + + int paramCount = 0; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Simple DICOM storage SCU (sender)", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("peer", "hostname of DICOM peer"); + cmd.addParam("port", "tcp/ip port number of peer"); + cmd.addParam("dcmfile-in", "DICOM file or directory to be transmitted", OFCmdParam::PM_MultiMandatory); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--list-decoders", "list transfer syntaxes of decoders and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--verbose-pc", "+v", "show presentation contexts in verbose mode"); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set"); + cmd.addOption("--read-file-only", "+fo", "read file format only (default)"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input files:"); + cmd.addOption("--read-from-dicomdir", "+rd", "read information on input files from DICOMDIR"); + cmd.addOption("--scan-directories", "+sd", "scan directories for input files (dcmfile-in)"); +#ifdef PATTERN_MATCHING_AVAILABLE + cmd.addOption("--scan-pattern", "+sp", 1, "[p]attern: string (only w/ --scan-directories)", + "pattern for filename matching (wildcards)"); +#endif + cmd.addOption("--no-recurse", "-r", "do not recurse within directories (default)"); + cmd.addOption("--recurse", "+r", "recurse within specified directories"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("transfer syntax conversion:"); + cmd.addOption("--decompress-never", "-dn", "never decompress compressed data sets"); + cmd.addOption("--decompress-lossless", "+dls", "only decompress lossless compression (default)"); + cmd.addOption("--decompress-lossy", "+dly", "decompress both lossy and lossless compression"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level:"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + cmd.addSubGroup("other processing options:"); + cmd.addOption("--no-halt", "-nh", "do not halt on first invalid input file\nor if unsuccessful store encountered"); + cmd.addOption("--no-illegal-proposal", "-nip", "do not propose any presentation context that\ndoes not contain the default TS (if needed)"); + cmd.addOption("--no-uid-checks", "-nuc", "do not check UID values of input files"); + + cmd.addGroup("network options:"); + cmd.addSubGroup("application entity titles:"); + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", + "set my calling AE title (default: " APPLICATIONTITLE ")"); + cmd.addOption("--call", "-aec", 1, "[a]etitle: string", + "set called AE title of peer (default: " PEERAPPLICATIONTITLE ")"); + cmd.addSubGroup("association handling:"); + cmd.addOption("--multi-associations", "+ma", "use multiple associations (one after the other)\nif needed to transfer the instances (default)"); + cmd.addOption("--single-association", "-ma", "always use a single association"); + cmd.addSubGroup("other network options:"); + cmd.addOption("--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", + "timeout for connection requests"); + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_acseTimeout << ")", optString1); + cmd.addOption("--acse-timeout", "-ta", 1, optString1.c_str(), + "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", + "timeout for DIMSE messages"); + CONVERT_TO_STRING("[n]umber of bytes: integer (" << ASC_MINIMUMPDUSIZE << ".." << ASC_MAXIMUMPDUSIZE << ")", optString2); + CONVERT_TO_STRING("set max receive pdu to n bytes (default: " << opt_maxReceivePDULength << ")", optString3); + cmd.addOption("--max-pdu", "-pdu", 1, optString2.c_str(), + optString3.c_str()); + cmd.addOption("--max-send-pdu", 1, optString2.c_str(), + "restrict max send pdu to n bytes"); + cmd.addGroup("output options:"); + cmd.addSubGroup("general:"); + cmd.addOption("--create-report-file", "+crf", 1, "[f]ilename: string", + "create a detailed report on the transfer\n(if successful) and write it to text file f"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; + COUT << "- " << DJLSDecoderRegistration::getLibraryVersionString() << OFendl; + return EXITCODE_NO_ERROR; + } + if (cmd.findOption("--list-decoders")) + { + app.printHeader(OFFalse /*print host identifier*/); + COUT << OFendl << "Transfer syntaxes supported natively:" << OFendl; + COUT << "- " << DcmXfer(EXS_LittleEndianImplicit).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_LittleEndianExplicit).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_BigEndianExplicit).getXferName() << OFendl; + COUT << OFendl << "Transfer syntaxes supported by decoders:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- " << DcmXfer(EXS_DeflatedLittleEndianExplicit).getXferName() << OFendl; +#endif + COUT << "- " << DcmXfer(EXS_JPEGProcess1).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_JPEGProcess2_4).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_JPEGProcess6_8).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_JPEGProcess10_12).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_JPEGProcess14).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_JPEGProcess14SV1).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_JPEGLSLossless).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_JPEGLSLossy).getXferName() << OFendl; + COUT << "- " << DcmXfer(EXS_RLELossless).getXferName() << OFendl; + return EXITCODE_NO_ERROR; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + if (cmd.findOption("--verbose-pc")) + { + app.checkDependence("--verbose-pc", "verbose mode", dcmsendLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_showPresentationContexts = OFTrue; + } + + /* input options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + if (cmd.findOption("--read-from-dicomdir")) opt_dicomDir = OFTrue; + if (cmd.findOption("--scan-directories")) opt_scanDir = OFTrue; +#ifdef PATTERN_MATCHING_AVAILABLE + if (cmd.findOption("--scan-pattern")) + { + app.checkDependence("--scan-pattern", "--scan-directories", opt_scanDir); + app.checkValue(cmd.getValue(opt_scanPattern)); + } +#endif + cmd.beginOptionBlock(); + if (cmd.findOption("--no-recurse")) opt_recurse = OFFalse; + if (cmd.findOption("--recurse")) + { + app.checkDependence("--recurse", "--scan-directories", opt_scanDir); + opt_recurse = OFTrue; + } + cmd.endOptionBlock(); + + /* processing options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--decompress-never")) opt_decompressionMode = DcmStorageSCU::DM_never; + if (cmd.findOption("--decompress-lossless")) opt_decompressionMode = DcmStorageSCU::DM_losslessOnly; + if (cmd.findOption("--decompress-lossy")) opt_decompressionMode = DcmStorageSCU::DM_lossyAndLossless; + cmd.endOptionBlock(); +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + app.checkValue(cmd.getValueAndCheckMinMax(opt_compressionLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, opt_compressionLevel)); + } +#endif + if (cmd.findOption("--no-halt")) + { + opt_haltOnInvalidFile = OFFalse; + opt_haltOnUnsuccessfulStore = OFFalse; + } + if (cmd.findOption("--no-illegal-proposal")) opt_allowIllegalProposal = OFFalse; + if (cmd.findOption("--no-uid-checks")) opt_checkUIDValues = OFFalse; + + /* network options */ + if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_ourTitle)); + if (cmd.findOption("--call")) app.checkValue(cmd.getValue(opt_peerTitle)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--multi-associations")) opt_multipleAssociations = OFTrue; + if (cmd.findOption("--single-association")) opt_multipleAssociations = OFFalse; + cmd.endOptionBlock(); + + if (cmd.findOption("--timeout")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set(OFstatic_cast(Sint32, opt_timeout)); + } + if (cmd.findOption("--acse-timeout")) + app.checkValue(cmd.getValueAndCheckMin(opt_acseTimeout, 1)); + if (cmd.findOption("--dimse-timeout")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_dimseTimeout, 1)); + opt_blockMode = DIMSE_NONBLOCKING; + } + if (cmd.findOption("--max-pdu")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_maxReceivePDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--max-send-pdu")) + { + app.checkValue(cmd.getValueAndCheckMinMax(opt_maxSendPDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + dcmMaxOutgoingPDUSize.set(OFstatic_cast(Uint32, opt_maxSendPDULength)); + } + + /* output options */ + if (cmd.findOption("--create-report-file")) + app.checkValue(cmd.getValue(opt_reportFilename)); + + /* command line parameters */ + paramCount = cmd.getParamCount(); + cmd.getParam(1, opt_peer); + app.checkParam(cmd.getParamAndCheckMinMax(2, opt_port, 1, 65535)); + } + + // register JPEG decoder + DJDecoderRegistration::registerCodecs(); + // register JPEG-LS decoder + DJLSDecoderRegistration::registerCodecs(); + // register RLE decoder + DcmRLEDecoderRegistration::registerCodecs(); + + /* print resource identifier */ + OFLOG_DEBUG(dcmsendLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmsendLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* start with the real work */ + if (opt_scanDir) + OFLOG_INFO(dcmsendLogger, "determining input files ..."); + /* iterate over all input filenames/directories */ + OFList inputFiles; + const char *paramString = NULL; + for (int i = 3; i <= paramCount; i++) + { + cmd.getParam(i, paramString); + /* search directory recursively (if required) */ + if (OFStandard::dirExists(paramString)) + { + if (opt_scanDir) + OFStandard::searchDirectoryRecursively(paramString, inputFiles, opt_scanPattern, "" /* dirPrefix */, opt_recurse); + else + OFLOG_WARN(dcmsendLogger, "ignoring directory because option --scan-directories is not set: " << paramString); + } else + inputFiles.push_back(paramString); + } + + /* check whether there are any input files at all */ + if (inputFiles.empty()) + { + OFLOG_FATAL(dcmsendLogger, "no input files to be processed"); + cleanup(); + return EXITCODE_NO_INPUT_FILES; + } + + DcmStorageSCU storageSCU; + OFCondition status; + unsigned long numInvalidFiles = 0; + + /* set parameters used for processing the input files */ + storageSCU.setReadFromDICOMDIRMode(opt_dicomDir); + storageSCU.setHaltOnInvalidFileMode(opt_haltOnInvalidFile); + + OFLOG_INFO(dcmsendLogger, "checking input files ..."); + /* iterate over all input filenames */ + const char *currentFilename = NULL; + OFListIterator(OFString) if_iter = inputFiles.begin(); + OFListIterator(OFString) if_last = inputFiles.end(); + while (if_iter != if_last) + { + currentFilename = (*if_iter).c_str(); + /* and add them to the list of instances to be transmitted */ + status = storageSCU.addDicomFile(currentFilename, opt_readMode, opt_checkUIDValues); + if (status.bad()) + { + /* check for empty filename */ + if (strlen(currentFilename) == 0) + currentFilename = ""; + /* if something went wrong, we either terminate or ignore the file */ + if (opt_haltOnInvalidFile) + { + OFLOG_FATAL(dcmsendLogger, "bad DICOM file: " << currentFilename << ": " << status.text()); + cleanup(); + return EXITCODE_INVALID_INPUT_FILE; + } else { + OFLOG_WARN(dcmsendLogger, "bad DICOM file: " << currentFilename << ": " << status.text() << ", ignoring file"); + } + ++numInvalidFiles; + } + ++if_iter; + } + + /* check whether there are any valid input files */ + if (storageSCU.getNumberOfSOPInstances() == 0) + { + OFLOG_FATAL(dcmsendLogger, "no valid input files to be processed"); + cleanup(); + return EXITCODE_NO_VALID_INPUT_FILES; + } else { + OFLOG_DEBUG(dcmsendLogger, "in total, there are " << storageSCU.getNumberOfSOPInstances() + << " SOP instances to be sent, " << numInvalidFiles << " invalid files are ignored"); + } + + /* set network parameters */ + storageSCU.setPeerHostName(opt_peer); + storageSCU.setPeerPort(OFstatic_cast(Uint16, opt_port)); + storageSCU.setPeerAETitle(opt_peerTitle); + storageSCU.setAETitle(opt_ourTitle); + storageSCU.setMaxReceivePDULength(OFstatic_cast(Uint32, opt_maxReceivePDULength)); + storageSCU.setACSETimeout(OFstatic_cast(Uint32, opt_acseTimeout)); + storageSCU.setDIMSETimeout(OFstatic_cast(Uint32, opt_dimseTimeout)); + storageSCU.setDIMSEBlockingMode(opt_blockMode); + storageSCU.setVerbosePCMode(opt_showPresentationContexts); + storageSCU.setDatasetConversionMode(opt_decompressionMode != DcmStorageSCU::DM_never); + storageSCU.setDecompressionMode(opt_decompressionMode); + storageSCU.setHaltOnUnsuccessfulStoreMode(opt_haltOnUnsuccessfulStore); + storageSCU.setAllowIllegalProposalMode(opt_allowIllegalProposal); + + /* output information on the single/multiple associations setting */ + if (opt_multipleAssociations) + { + OFLOG_DEBUG(dcmsendLogger, "multiple associations allowed (option --multi-associations used)"); + } else { + OFLOG_DEBUG(dcmsendLogger, "only a single associations allowed (option --single-association used)"); + } + + /* add presentation contexts to be negotiated (if there are still any) */ + while ((status = storageSCU.addPresentationContexts()).good()) + { + if (opt_multipleAssociations) + { + /* output information on the start of the new association */ + if (dcmsendLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + OFLOG_DEBUG(dcmsendLogger, OFString(65, '-') << OFendl + << "starting association #" << (storageSCU.getAssociationCounter() + 1)); + } else { + OFLOG_INFO(dcmsendLogger, "starting association #" << (storageSCU.getAssociationCounter() + 1)); + } + } + OFLOG_INFO(dcmsendLogger, "initializing network ..."); + /* initialize network */ + status = storageSCU.initNetwork(); + if (status.bad()) + { + OFLOG_FATAL(dcmsendLogger, "cannot initialize network: " << status.text()); + cleanup(); + return EXITCODE_CANNOT_INITIALIZE_NETWORK; + } + OFLOG_INFO(dcmsendLogger, "negotiating network association ..."); + /* negotiate network association with peer */ + status = storageSCU.negotiateAssociation(); + if (status.bad()) + { + // check whether we can continue with a new association + if (status == NET_EC_NoAcceptablePresentationContexts) + { + OFLOG_ERROR(dcmsendLogger, "cannot negotiate network association: " << status.text()); + // check whether there are any SOP instances to be sent + const size_t numToBeSent = storageSCU.getNumberOfSOPInstancesToBeSent(); + if (numToBeSent > 0) + { + OFLOG_WARN(dcmsendLogger, "trying to continue with a new association " + << "in order to send the remaining " << numToBeSent << " SOP instances"); + } + } else { + OFLOG_FATAL(dcmsendLogger, "cannot negotiate network association: " << status.text()); + cleanup(); + return EXITCODE_CANNOT_NEGOTIATE_ASSOCIATION; + } + } + if (status.good()) + { + OFLOG_INFO(dcmsendLogger, "sending SOP instances ..."); + /* send SOP instances to be transferred */ + status = storageSCU.sendSOPInstances(); + if (status.bad()) + { + OFLOG_FATAL(dcmsendLogger, "cannot send SOP instance: " << status.text()); + // handle certain error conditions (initiated by the communication peer) + if (status == DUL_PEERREQUESTEDRELEASE) + { + // peer requested release (aborting) + storageSCU.closeAssociation(DCMSCU_PEER_REQUESTED_RELEASE); + } + else if (status == DUL_PEERABORTEDASSOCIATION) + { + // peer aborted the association + storageSCU.closeAssociation(DCMSCU_PEER_ABORTED_ASSOCIATION); + } + cleanup(); + return EXITCODE_CANNOT_SEND_REQUEST; + } + } + /* close current network association */ + storageSCU.releaseAssociation(); + /* check whether multiple associations are permitted */ + if (!opt_multipleAssociations) + break; + } + + /* if anything went wrong, report it to the logger */ + if (status.bad() && (status != NET_EC_NoPresentationContextsDefined)) + { + OFLOG_ERROR(dcmsendLogger, "cannot add presentation contexts: " << status.text()); + cleanup(); + return EXITCODE_CANNOT_ADD_PRESENTATION_CONTEXT; + } + + /* create a detailed report on the transfer of instances ... */ + if ((opt_reportFilename != NULL) && (strlen(opt_reportFilename) > 0)) + { + /* ... and write it to the specified text file */ + status = storageSCU.createReportFile(opt_reportFilename); + if (status.bad()) + { + cleanup(); + return EXITCODE_CANNOT_WRITE_REPORT_FILE; // TODO: do we really want to exit? + } + } + + /* output some status information on the overall sending process */ + if (dcmsendLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) + { + OFString summaryText; + storageSCU.getStatusSummary(summaryText); + OFLOG_INFO(dcmsendLogger, OFendl << summaryText); + } + + /* make sure that everything is cleaned up properly */ + cleanup(); + return EXITCODE_NO_ERROR; +} diff --git a/dcmnet/apps/echoscu.cc b/dcmnet/apps/echoscu.cc new file mode 100644 index 00000000..428bacde --- /dev/null +++ b/dcmnet/apps/echoscu.cc @@ -0,0 +1,510 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Andrew Hewett + * + * Purpose: Verification Service Class User (C-ECHO operation) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CSTDARG +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmnet/dcmtrans.h" /* for dcmSocketSend/ReceiveTimeout */ +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmtls/tlsopt.h" /* for DcmTLSOptions */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#ifdef PRIVATE_ECHOSCU_DECLARATIONS +PRIVATE_ECHOSCU_DECLARATIONS +#else +#define OFFIS_CONSOLE_APPLICATION "echoscu" +#endif + +static OFLogger echoscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* default application titles */ +#define APPLICATIONTITLE "ECHOSCU" +#define PEERAPPLICATIONTITLE "ANY-SCP" + + +/* exit codes for this command line tool */ +/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */ +// network errors +#define EXITCODE_ASSOCIATION_ABORTED 70 + +static T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING; +static int opt_dimse_timeout = 0; + +static OFCondition cecho(T_ASC_Association * assoc, unsigned long num_repeat); + +/* DICOM standard transfer syntaxes */ +static const char* transferSyntaxes[] = { + UID_LittleEndianImplicitTransferSyntax, /* default xfer syntax first */ + UID_LittleEndianExplicitTransferSyntax, + UID_BigEndianExplicitTransferSyntax, + UID_JPEGProcess1TransferSyntax, + UID_JPEGProcess2_4TransferSyntax, + UID_JPEGProcess3_5TransferSyntax, + UID_JPEGProcess6_8TransferSyntax, + UID_JPEGProcess7_9TransferSyntax, + UID_JPEGProcess10_12TransferSyntax, + UID_JPEGProcess11_13TransferSyntax, + UID_JPEGProcess14TransferSyntax, + UID_JPEGProcess15TransferSyntax, + UID_JPEGProcess16_18TransferSyntax, + UID_JPEGProcess17_19TransferSyntax, + UID_JPEGProcess20_22TransferSyntax, + UID_JPEGProcess21_23TransferSyntax, + UID_JPEGProcess24_26TransferSyntax, + UID_JPEGProcess25_27TransferSyntax, + UID_JPEGProcess28TransferSyntax, + UID_JPEGProcess29TransferSyntax, + UID_JPEGProcess14SV1TransferSyntax, + UID_RLELosslessTransferSyntax, + UID_DeflatedExplicitVRLittleEndianTransferSyntax, + UID_JPEGLSLosslessTransferSyntax, + UID_JPEGLSLossyTransferSyntax, + UID_JPEG2000LosslessOnlyTransferSyntax, + UID_JPEG2000TransferSyntax, + UID_JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax, + UID_JPEG2000Part2MulticomponentImageCompressionTransferSyntax, + UID_MPEG2MainProfileAtMainLevelTransferSyntax, + UID_MPEG2MainProfileAtHighLevelTransferSyntax, + UID_MPEG4HighProfileLevel4_1TransferSyntax, + UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax, + UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax, + UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax, + UID_MPEG4StereoHighProfileLevel4_2TransferSyntax, + UID_HEVCMainProfileLevel5_1TransferSyntax, + UID_HEVCMain10ProfileLevel5_1TransferSyntax +}; + +// ******************************************** + +/* helper macro for converting stream output to a string */ +#define CONVERT_TO_STRING(output, string) \ + optStream.str(""); \ + optStream.clear(); \ + optStream << output << OFStringStream_ends; \ + OFSTRINGSTREAM_GETOFSTRING(optStream, string) + +#define SHORTCOL 4 +#define LONGCOL 19 + +int +main(int argc, char *argv[]) +{ + OFOStringStream optStream; + int result = EXITCODE_NO_ERROR; + + const char * opt_peer = NULL; + OFCmdUnsignedInt opt_port = 104; + const char * opt_peerTitle = PEERAPPLICATIONTITLE; + const char * opt_ourTitle = APPLICATIONTITLE; + OFCmdUnsignedInt opt_maxReceivePDULength = ASC_DEFAULTMAXPDU; + OFCmdUnsignedInt opt_repeatCount = 1; + OFBool opt_abortAssociation = OFFalse; + OFCmdUnsignedInt opt_numXferSyntaxes = 1; + OFCmdUnsignedInt opt_numPresentationCtx = 1; + OFCmdUnsignedInt maxXferSyntaxes = OFstatic_cast(OFCmdUnsignedInt, (DIM_OF(transferSyntaxes))); + int opt_acse_timeout = 30; + OFCmdSignedInt opt_socket_timeout = 60; + DcmTLSOptions tlsOptions(NET_REQUESTOR); + + T_ASC_Network *net; + T_ASC_Parameters *params; + DIC_NODENAME peerHost; + T_ASC_Association *assoc; + OFString temp_str; + + OFStandard::initializeNetwork(); +#ifdef WITH_OPENSSL + DcmTLSTransportLayer::initializeOpenSSL(); +#endif + + char tempstr[20]; + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM verification (C-ECHO) SCU", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("peer", "hostname of DICOM peer"); + cmd.addParam("port", "tcp/ip port number of peer"); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("network options:"); + cmd.addSubGroup("application entity titles:"); + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", "set my calling AE title (default: " APPLICATIONTITLE ")"); + cmd.addOption("--call", "-aec", 1, "[a]etitle: string", "set called AE title of peer (default: " PEERAPPLICATIONTITLE ")"); + cmd.addSubGroup("association negotiation debugging:"); + OFString opt5 = "[n]umber: integer (1.."; + sprintf(tempstr, "%ld", OFstatic_cast(long, maxXferSyntaxes)); + opt5 += tempstr; + opt5 += ")"; + cmd.addOption("--propose-ts", "-pts", 1, opt5.c_str(), "propose n transfer syntaxes"); + cmd.addOption("--propose-pc", "-ppc", 1, "[n]umber: integer (1..128)", "propose n presentation contexts"); + + cmd.addSubGroup("other network options:"); + cmd.addOption("--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", "timeout for connection requests"); + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_socket_timeout << ")", optString1); + cmd.addOption("--socket-timeout", "-ts", 1, optString1.c_str(), "timeout for network socket (0 for none)"); + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_acse_timeout << ")", optString2); + cmd.addOption("--acse-timeout", "-ta", 1, optString2.c_str(), "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages"); + + CONVERT_TO_STRING("[n]umber of bytes: integer (" << ASC_MINIMUMPDUSIZE << ".." << ASC_MAXIMUMPDUSIZE << ")", optString3); + CONVERT_TO_STRING("set max receive pdu to n bytes (default: " << opt_maxReceivePDULength << ")", optString4); + cmd.addOption("--max-pdu", "-pdu", 1, optString3.c_str(), optString4.c_str()); + cmd.addOption("--repeat", 1, "[n]umber: integer", "repeat n times"); + cmd.addOption("--abort", "abort association instead of releasing it"); + + // add TLS specific command line options if (and only if) we are compiling with OpenSSL + tlsOptions.addTLSCommandlineOptions(cmd); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_OPENSSL) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + // print OpenSSL version if (and only if) we are compiling with OpenSSL + tlsOptions.printLibraryVersion(); + return EXITCODE_NO_ERROR; + } + + // check if the command line contains the --list-ciphers option + if (tlsOptions.listOfCiphersRequested(cmd)) + { + tlsOptions.printSupportedCiphersuites(app, COUT); + return EXITCODE_NO_ERROR; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_peer); + app.checkParam(cmd.getParamAndCheckMinMax(2, opt_port, 1, 65535)); + + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_ourTitle)); + if (cmd.findOption("--call")) app.checkValue(cmd.getValue(opt_peerTitle)); + + if (cmd.findOption("--timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set(OFstatic_cast(Sint32, opt_timeout)); + } + + if (cmd.findOption("--socket-timeout")) + app.checkValue(cmd.getValueAndCheckMin(opt_socket_timeout, -1)); + // always set the timeout values since the global default might be different + dcmSocketSendTimeout.set(OFstatic_cast(Sint32, opt_socket_timeout)); + dcmSocketReceiveTimeout.set(OFstatic_cast(Sint32, opt_socket_timeout)); + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_acse_timeout = OFstatic_cast(int, opt_timeout); + } + + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_dimse_timeout = OFstatic_cast(int, opt_timeout); + opt_blockMode = DIMSE_NONBLOCKING; + } + + if (cmd.findOption("--max-pdu")) app.checkValue(cmd.getValueAndCheckMinMax(opt_maxReceivePDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--repeat")) app.checkValue(cmd.getValueAndCheckMin(opt_repeatCount, 1)); + if (cmd.findOption("--abort")) opt_abortAssociation=OFTrue; + if (cmd.findOption("--propose-ts")) app.checkValue(cmd.getValueAndCheckMinMax(opt_numXferSyntaxes, 1, maxXferSyntaxes)); + if (cmd.findOption("--propose-pc")) app.checkValue(cmd.getValueAndCheckMinMax(opt_numPresentationCtx, 1, 128)); + + // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL) + tlsOptions.parseArguments(app, cmd); + + } + + /* print resource identifier */ + OFLOG_DEBUG(echoscuLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(echoscuLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* initialize network, i.e. create an instance of T_ASC_Network*. */ + OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, opt_acse_timeout, &net); + if (cond.bad()) { + OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + + /* initialize association parameters, i.e. create an instance of T_ASC_Parameters*. */ + cond = ASC_createAssociationParameters(¶ms, opt_maxReceivePDULength); + if (cond.bad()) { + OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + + /* create a secure transport layer if requested and OpenSSL is available */ + cond = tlsOptions.createTransportLayer(net, params, app, cmd); + if (cond.bad()) { + OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + +#ifdef PRIVATE_ECHOSCU_CODE + PRIVATE_ECHOSCU_CODE +#endif + + /* sets this application's title and the called application's title in the params */ + /* structure. The default values to be set here are "STORESCU" and "ANY-SCP". */ + ASC_setAPTitles(params, opt_ourTitle, opt_peerTitle, NULL); + + /* Figure out the presentation addresses and copy the */ + /* corresponding values into the association parameters.*/ + sprintf(peerHost, "%s:%d", opt_peer, OFstatic_cast(int, opt_port)); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), peerHost); + + /* Set the presentation contexts which will be negotiated */ + /* when the network connection will be established */ + int presentationContextID = 1; /* odd byte value 1, 3, 5, .. 255 */ + for (unsigned long ii=0; iisendPDVLength << ")"); + + /* do the real work, i.e. send a number of C-ECHO-RQ messages to the DICOM application */ + /* this application is connected with and handle corresponding C-ECHO-RSP messages. */ + cond = cecho(assoc, opt_repeatCount); + + /* tear down association, i.e. terminate network connection to SCP */ + if (cond == EC_Normal) + { + if (opt_abortAssociation) { + OFLOG_INFO(echoscuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) + { + OFLOG_FATAL(echoscuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + exit(1); + } + } else { + /* release association */ + OFLOG_INFO(echoscuLogger, "Releasing Association"); + cond = ASC_releaseAssociation(assoc); + if (cond.bad()) + { + OFLOG_FATAL(echoscuLogger, "Association Release Failed: " << DimseCondition::dump(temp_str, cond)); + exit(1); + } + } + } + else if (cond == DUL_PEERREQUESTEDRELEASE) + { + OFLOG_FATAL(echoscuLogger, "Protocol Error: Peer requested release (Aborting)"); + OFLOG_INFO(echoscuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + result = EXITCODE_ASSOCIATION_ABORTED;// return an error code at the end of main + if (cond.bad()) { + OFLOG_FATAL(echoscuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + exit(1); + } + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + OFLOG_INFO(echoscuLogger, "Peer Aborted Association"); + } + else + { + OFLOG_ERROR(echoscuLogger, "Echo SCU Failed: " << DimseCondition::dump(temp_str, cond)); + OFLOG_INFO(echoscuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + result = EXITCODE_ASSOCIATION_ABORTED; // return an error code at the end of main + if (cond.bad()) { + OFLOG_FATAL(echoscuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + exit(1); + } + } + + /* destroy the association, i.e. free memory of T_ASC_Association* structure. This */ + /* call is the counterpart of ASC_requestAssociation(...) which was called above. */ + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) { + OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + + /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */ + /* is the counterpart of ASC_initializeNetwork(...) which was called above. */ + cond = ASC_dropNetwork(&net); + if (cond.bad()) { + OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + + OFStandard::shutdownNetwork(); + + cond = tlsOptions.writeRandomSeed(); + if (cond.bad()) { + // failure to write back the random seed is a warning, not an error + OFLOG_WARN(echoscuLogger, DimseCondition::dump(temp_str, cond)); + } + + return result; +} + +static OFCondition +echoSCU(T_ASC_Association * assoc) + /* + * This function will send a C-ECHO-RQ over the network to another DICOM application + * and handle the response. + * + * Parameters: + * assoc - [in] The association (network connection to another DICOM application). + */ +{ + DIC_US msgId = assoc->nextMsgID++; + DIC_US status; + DcmDataset *statusDetail = NULL; + + /* dump information if required */ + OFLOG_INFO(echoscuLogger, "Sending Echo Request (MsgID " << msgId << ")"); + + /* send C-ECHO-RQ and handle response */ + OFCondition cond = DIMSE_echoUser(assoc, msgId, opt_blockMode, opt_dimse_timeout, &status, &statusDetail); + + /* depending on if a response was received, dump some information */ + if (cond.good()) { + OFLOG_INFO(echoscuLogger, "Received Echo Response (" << DU_cechoStatusString(status) << ")"); + } else { + OFString temp_str; + OFLOG_ERROR(echoscuLogger, "Echo Failed: " << DimseCondition::dump(temp_str, cond)); + } + + /* check for status detail information, there should never be any */ + if (statusDetail != NULL) { + OFLOG_DEBUG(echoscuLogger, "Status Detail (should never be any):" << OFendl << DcmObject::PrintHelper(*statusDetail)); + delete statusDetail; + } + + /* return result value */ + return cond; +} + +static OFCondition +cecho(T_ASC_Association * assoc, unsigned long num_repeat) + /* + * This function will send num_repeat C-ECHO-RQ messages to the DICOM application + * this application is connected with and handle corresponding C-ECHO-RSP messages. + * + * Parameters: + * assoc - [in] The association (network connection to another DICOM application). + * num_repeat - [in] The amount of C-ECHO-RQ messages which shall be sent. + */ +{ + OFCondition cond = EC_Normal; + unsigned long n = num_repeat; + + /* as long as no error occurred and the counter does not equal 0 */ + /* send an C-ECHO-RQ and handle the response */ + while (cond.good() && n--) cond = echoSCU(assoc); + + return cond; +} diff --git a/dcmnet/apps/findscu.cc b/dcmnet/apps/findscu.cc new file mode 100644 index 00000000..fcd9e965 --- /dev/null +++ b/dcmnet/apps/findscu.cc @@ -0,0 +1,465 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Andrew Hewett + * + * Purpose: Query/Retrieve Service Class User (C-FIND operation) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmnet/dfindscu.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/dcmtls/tlsopt.h" /* for DcmTLSOptions */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "findscu" + +static OFLogger findscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* default application titles */ +#define APPLICATIONTITLE "FINDSCU" +#define PEERAPPLICATIONTITLE "ANY-SCP" + +#define SHORTCOL 4 +#define LONGCOL 20 + +int main(int argc, char *argv[]) +{ + OFList fileNameList; + OFBool opt_abortAssociation = OFFalse; + const char * opt_abstractSyntax = UID_FINDModalityWorklistInformationModel; + int opt_acse_timeout = 30; + T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING; + OFCmdSignedInt opt_cancelAfterNResponses = -1; + int opt_dimse_timeout = 0; + int opt_outputResponsesToLogger = 0; + DcmFindSCUExtractMode opt_extractResponses = FEM_none; + OFString opt_extractXMLFilename; + OFString opt_outputDirectory = "."; + OFCmdUnsignedInt opt_maxReceivePDULength = ASC_DEFAULTMAXPDU; + E_TransferSyntax opt_networkTransferSyntax = EXS_Unknown; + const char * opt_ourTitle = APPLICATIONTITLE; + const char * opt_peer; + const char * opt_peerTitle = PEERAPPLICATIONTITLE; + OFCmdUnsignedInt opt_port = 104; + OFCmdUnsignedInt opt_repeatCount = 1; + OFList overrideKeys; + DcmTLSOptions tlsOptions(NET_REQUESTOR); + +#ifdef WITH_ZLIB + OFCmdUnsignedInt opt_compressionLevel = 0; +#endif + + /* + ** By default. don't let "dcmdata" remove trailing padding or + ** perform other manipulations. We want to see the real data. + */ + OFBool opt_automaticDataCorrection = OFFalse; + + OFStandard::initializeNetwork(); +#ifdef WITH_OPENSSL + DcmTLSTransportLayer::initializeOpenSSL(); +#endif + + char tempstr[20]; + OFString temp_str; + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM query (C-FIND) SCU", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("peer", "hostname of DICOM peer"); + cmd.addParam("port", "tcp/ip port number of peer"); + cmd.addParam("dcmfile-in", "DICOM query file(s)", OFCmdParam::PM_MultiOptional); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("network options:"); + cmd.addSubGroup("override matching keys:"); + cmd.addOption("--key", "-k", 1, "[k]ey: gggg,eeee=\"str\", path or dict. name=\"str\"", + "override matching key"); + cmd.addSubGroup("query information model:"); + cmd.addOption("--worklist", "-W", "use modality worklist information model (def.)"); + cmd.addOption("--patient", "-P", "use patient root information model"); + cmd.addOption("--study", "-S", "use study root information model"); + cmd.addOption("--psonly", "-O", "use patient/study only information model"); + cmd.addSubGroup("application entity titles:"); + OFString opt1 = "set my calling AE title (default: "; + opt1 += APPLICATIONTITLE; + opt1 += ")"; + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", opt1.c_str()); + OFString opt2 = "set called AE title of peer (default: "; + opt2 += PEERAPPLICATIONTITLE; + opt2 += ")"; + cmd.addOption("--call", "-aec", 1, "[a]etitle: string", opt2.c_str()); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("proposed transmission transfer syntaxes:"); + cmd.addOption("--propose-uncompr", "-x=", "propose all uncompressed TS, explicit VR\nwith local byte ordering first (default)"); + cmd.addOption("--propose-little", "-xe", "propose all uncompressed TS, explicit VR\nlittle endian first"); + cmd.addOption("--propose-big", "-xb", "propose all uncompressed TS, explicit VR\nbig endian first"); +#ifdef WITH_ZLIB + cmd.addOption("--propose-deflated", "-xd", "propose deflated explicit VR little endian TS\nand all uncompressed transfer syntaxes"); +#endif + cmd.addOption("--propose-implicit", "-xi", "propose implicit VR little endian TS only"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with --propose-deflated):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + cmd.addSubGroup("other network options:"); + OFString opt3 = "set max receive pdu to n bytes (default: "; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_DEFAULTMAXPDU)); + opt3 += tempstr; + opt3 += ")"; + OFString opt4 = "[n]umber of bytes: integer ("; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MINIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ".."; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MAXIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ")"; + cmd.addOption("--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", "timeout for connection requests"); + cmd.addOption("--acse-timeout", "-ta", 1, "[s]econds: integer (default: 30)", "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages"); + cmd.addOption("--max-pdu", "-pdu", 1, opt4.c_str(), opt3.c_str()); + cmd.addOption("--repeat", 1, "[n]umber: integer", "repeat n times"); + cmd.addOption("--abort", "abort association instead of releasing it"); + cmd.addOption("--cancel", 1, "[n]umber: integer", + "cancel after n responses (default: never)"); + + // add TLS specific command line options if (and only if) we are compiling with OpenSSL + tlsOptions.addTLSCommandlineOptions(cmd); + + cmd.addGroup("output options:"); + cmd.addSubGroup("general:"); + cmd.addOption("--output-directory", "-od", 1, "[d]irectory: string (default: \".\")", + "write output files to existing directory d"); + cmd.addSubGroup("automatic data correction:"); + cmd.addOption("--enable-correction", "+dc", "enable automatic data correction"); + cmd.addOption("--disable-correction", "-dc", "disable automatic data correction (default)"); + cmd.addSubGroup("C-FIND responses:"); + cmd.addOption("--show-responses", "+sr", "always output responses to the logger"); + cmd.addOption("--hide-responses", "-sr", "do not output responses to the logger"); + cmd.addOption("--extract", "-X", "extract responses to DICOM file (rsp0001.dcm...)"); + cmd.addOption("--extract-xml", "-Xx", "extract responses to XML file (rsp0001.xml...)"); + cmd.addOption("--extract-xml-single", "-Xs", 1, "[f]ilename: string", + "extract all responses to given XML file f"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_OPENSSL) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + // print OpenSSL version if (and only if) we are compiling with OpenSSL + tlsOptions.printLibraryVersion(); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + + // check if the command line contains the --list-ciphers option + if (tlsOptions.listOfCiphersRequested(cmd)) + { + tlsOptions.printSupportedCiphersuites(app, COUT); + return 0; + } + } + + /* command line parameters */ + cmd.getParam(1, opt_peer); + app.checkParam(cmd.getParamAndCheckMinMax(2, opt_port, 1, 65535)); + + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--key", 0, OFCommandLine::FOM_FirstFromLeft)) + { + const char *ovKey = NULL; + do { + app.checkValue(cmd.getValue(ovKey)); + overrideKeys.push_back(ovKey); + } while (cmd.findOption("--key", 0, OFCommandLine::FOM_NextFromLeft)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--worklist")) opt_abstractSyntax = UID_FINDModalityWorklistInformationModel; + if (cmd.findOption("--patient")) opt_abstractSyntax = UID_FINDPatientRootQueryRetrieveInformationModel; + if (cmd.findOption("--study")) opt_abstractSyntax = UID_FINDStudyRootQueryRetrieveInformationModel; + if (cmd.findOption("--psonly")) opt_abstractSyntax = UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel; + cmd.endOptionBlock(); + + if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_ourTitle)); + if (cmd.findOption("--call")) app.checkValue(cmd.getValue(opt_peerTitle)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--propose-uncompr")) opt_networkTransferSyntax = EXS_Unknown; + if (cmd.findOption("--propose-little")) opt_networkTransferSyntax = EXS_LittleEndianExplicit; + if (cmd.findOption("--propose-big")) opt_networkTransferSyntax = EXS_BigEndianExplicit; + if (cmd.findOption("--propose-implicit")) opt_networkTransferSyntax = EXS_LittleEndianImplicit; +#ifdef WITH_ZLIB + if (cmd.findOption("--propose-deflated")) opt_networkTransferSyntax = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + app.checkDependence("--compression-level", "--propose-deflated", + (opt_networkTransferSyntax == EXS_DeflatedLittleEndianExplicit)); + app.checkValue(cmd.getValueAndCheckMinMax(opt_compressionLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, opt_compressionLevel)); + } +#endif + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + if (cmd.findOption("--timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set(OFstatic_cast(Sint32, opt_timeout)); + } + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_acse_timeout = OFstatic_cast(int, opt_timeout); + } + + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_dimse_timeout = OFstatic_cast(int, opt_timeout); + opt_blockMode = DIMSE_NONBLOCKING; + } + + if (cmd.findOption("--max-pdu")) app.checkValue(cmd.getValueAndCheckMinMax(opt_maxReceivePDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--repeat")) app.checkValue(cmd.getValueAndCheckMin(opt_repeatCount, 1)); + if (cmd.findOption("--abort")) opt_abortAssociation = OFTrue; + if (cmd.findOption("--cancel")) app.checkValue(cmd.getValueAndCheckMin(opt_cancelAfterNResponses, 0)); + + if (cmd.findOption("--output-directory")) app.checkValue(cmd.getValue(opt_outputDirectory)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-correction")) opt_automaticDataCorrection = OFTrue; + if (cmd.findOption("--disable-correction")) opt_automaticDataCorrection = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--show-responses")) opt_outputResponsesToLogger = 1; + if (cmd.findOption("--hide-responses")) opt_outputResponsesToLogger = 2; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--extract")) opt_extractResponses = FEM_dicomFile; + if (cmd.findOption("--extract-xml")) opt_extractResponses = FEM_xmlFile; + if (cmd.findOption("--extract-xml-single")) + { + opt_extractResponses = FEM_singleXMLFile; + app.checkValue(cmd.getValue(opt_extractXMLFilename)); + } + cmd.endOptionBlock(); + + /* finally parse filenames */ + int paramCount = cmd.getParamCount(); + const char *currentFilename = NULL; + OFString errormsg; + + for (int i = 3; i <= paramCount; i++) + { + cmd.getParam(i, currentFilename); + if (access(currentFilename, R_OK) < 0) + { + errormsg = "cannot access file: "; + errormsg += currentFilename; + app.printError(errormsg.c_str()); + } + fileNameList.push_back(currentFilename); + } + + if (fileNameList.empty() && overrideKeys.empty()) + { + app.printError("either query file or override keys (or both) must be specified"); + } + + // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL) + tlsOptions.parseArguments(app, cmd); + } + + if (opt_outputResponsesToLogger == 0) + { + // default configuration for the C-FIND response logger + if (!cmd.findOption("--log-config")) + { + if (cmd.findOption("--extract") || cmd.findOption("--extract-xml") || cmd.findOption("--extract-xml-single")) + { + OFLog::getLogger(DCMNET_LOGGER_NAME ".responses").setLogLevel(OFLogger::OFF_LOG_LEVEL); + } + else if (!cmd.findOption("--quiet") && !cmd.findOption("--verbose") && !cmd.findOption("--debug") && !cmd.findOption("--log-level")) + { + OFLog::getLogger(DCMNET_LOGGER_NAME ".responses").setLogLevel(OFLogger::INFO_LOG_LEVEL); + } + } + } + else if (opt_outputResponsesToLogger == 1) + { + // always show C-FIND responses + OFLog::getLogger(DCMNET_LOGGER_NAME ".responses").setLogLevel(OFLogger::INFO_LOG_LEVEL); + } + else if (opt_outputResponsesToLogger == 2) + { + // never show C-FIND responses + OFLog::getLogger(DCMNET_LOGGER_NAME ".responses").setLogLevel(OFLogger::OFF_LOG_LEVEL); + } + + /* print resource identifier */ + OFLOG_DEBUG(findscuLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(findscuLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* make sure that output directory can be used (if needed) */ + if (opt_extractResponses != FEM_none) + { + if (!OFStandard::dirExists(opt_outputDirectory)) + { + OFLOG_FATAL(findscuLogger, "specified output directory does not exist"); + return 1; + } + else if (!OFStandard::isWriteable(opt_outputDirectory)) + { + OFLOG_FATAL(findscuLogger, "specified output directory is not writeable"); + return 1; + } + } + + // enabled or disable removal of trailing padding + dcmEnableAutomaticInputDataCorrection.set(opt_automaticDataCorrection); + + // declare findSCU handler and initialize network + DcmFindSCU findscu; + OFCondition cond = findscu.initializeNetwork(opt_acse_timeout); + if (cond.bad()) { + OFLOG_ERROR(findscuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + +#ifdef WITH_OPENSSL + if (tlsOptions.secureConnectionRequested()) + { + /* create a secure transport layer */ + cond = tlsOptions.createTransportLayer(NULL, NULL, app, cmd); + if (cond.bad()) + { + OFLOG_FATAL(findscuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + /* activate secure transport layer */ + cond = findscu.setTransportLayer(tlsOptions.getTransportLayer()); + if (cond.bad()) + { + OFLOG_ERROR(findscuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + } +#endif + + // do the main work: negotiate network association, perform C-FIND transaction, + // process results, and finally tear down the association. + cond = findscu.performQuery( + opt_peer, + opt_port, + opt_ourTitle, + opt_peerTitle, + opt_abstractSyntax, + opt_networkTransferSyntax, + opt_blockMode, + opt_dimse_timeout, + opt_maxReceivePDULength, + tlsOptions.secureConnectionRequested(), + opt_abortAssociation, + opt_repeatCount, + opt_extractResponses, + opt_cancelAfterNResponses, + &overrideKeys, + NULL, /* we want to use the default callback */ + &fileNameList, + opt_outputDirectory.c_str(), + opt_extractXMLFilename.c_str()); + + // make sure that an appropriate exit code is returned + int exitCode = cond.good() ? 0 : 2; + + // destroy network structure + cond = findscu.dropNetwork(); + if (cond.bad()) { + OFLOG_ERROR(findscuLogger, DimseCondition::dump(temp_str, cond)); + if (!exitCode) exitCode = 3; + } + + OFStandard::shutdownNetwork(); + + cond = tlsOptions.writeRandomSeed(); + if (cond.bad()) { + // failure to write back the random seed is a warning, not an error + OFLOG_WARN(findscuLogger, DimseCondition::dump(temp_str, cond)); + } + + return exitCode; +} diff --git a/dcmnet/apps/getscu.cc b/dcmnet/apps/getscu.cc new file mode 100644 index 00000000..55f2486b --- /dev/null +++ b/dcmnet/apps/getscu.cc @@ -0,0 +1,593 @@ +/* + * + * Copyright (C) 2011-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Michael Onken + * + * Purpose: Query/Retrieve Service Class User (C-GET operation) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/dcmnet/scu.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/dcmdata/dcpath.h" /* for DcmPathProcessor */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "getscu" + +static OFLogger getscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* default application titles */ +#define APPLICATIONTITLE "GETSCU" +#define PEERAPPLICATIONTITLE "ANY-SCP" + +typedef enum { + QMPatientRoot = 0, + QMStudyRoot = 1, + QMPatientStudyOnly = 2 +} QueryModel; + +static const char* querySyntax[3] = { + UID_GETPatientRootQueryRetrieveInformationModel, + UID_GETStudyRootQueryRetrieveInformationModel, + UID_RETIRED_GETPatientStudyOnlyQueryRetrieveInformationModel +}; + +OFCmdUnsignedInt opt_maxPDU = ASC_DEFAULTMAXPDU; +E_TransferSyntax opt_store_networkTransferSyntax = EXS_Unknown; +E_TransferSyntax opt_get_networkTransferSyntax = EXS_Unknown; +DcmStorageMode opt_storageMode = DCMSCU_STORAGE_DISK; +OFBool opt_showPresentationContexts = OFFalse; +OFBool opt_abortAssociation = OFFalse; +OFCmdUnsignedInt opt_repeatCount = 1; +QueryModel opt_queryModel = QMPatientRoot; +T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING; +int opt_dimse_timeout = 0; +int opt_acse_timeout = 30; +OFString opt_outputDirectory = "."; +static OFList overrideKeys; + +static void prepareTS(E_TransferSyntax ts, + OFList& syntaxes); + +static void applyOverrideKeys(DcmDataset *dataset); + +#define SHORTCOL 4 +#define LONGCOL 21 + +int +main(int argc, char *argv[]) +{ + const char *opt_peer; + OFCmdUnsignedInt opt_port = 104;; + const char *opt_peerTitle = PEERAPPLICATIONTITLE; + const char *opt_ourTitle = APPLICATIONTITLE; + OFList fileNameList; + + char tempstr[20]; + OFString temp_str; + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM retrieve (C-GET) SCU", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("peer", "hostname of DICOM peer"); + cmd.addParam("port", "tcp/ip port number of peer"); + cmd.addParam("dcmfile-in", "DICOM query file(s)", OFCmdParam::PM_MultiOptional); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--verbose-pc", "+v", "show presentation contexts in verbose mode"); + + cmd.addGroup("network options:"); + cmd.addSubGroup("override matching keys:"); + cmd.addOption("--key", "-k", 1, "[k]ey: gggg,eeee=\"str\", path or dic. name=\"str\"", + "override matching key"); + cmd.addSubGroup("retrieve information model:"); + cmd.addOption("--patient", "-P", "use patient root information model (default)"); + cmd.addOption("--study", "-S", "use study root information model"); + cmd.addOption("--psonly", "-O", "use patient/study only information model"); + cmd.addSubGroup("application entity titles:"); + OFString opt1 = "set my calling AE title (default: "; + opt1 += APPLICATIONTITLE; + opt1 += ")"; + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", opt1.c_str()); + OFString opt2 = "set called AE title of peer (default: "; + opt2 += PEERAPPLICATIONTITLE; + opt2 += ")"; + cmd.addOption("--call", "-aec", 1, "[a]etitle: string", opt2.c_str()); + cmd.addSubGroup("preferred storage transfer syntaxes (incoming associations):"); + cmd.addOption("--prefer-uncompr", "+x=", "prefer explicit VR local byte order (default)"); + cmd.addOption("--prefer-little", "+xe", "prefer explicit VR little endian TS"); + cmd.addOption("--prefer-big", "+xb", "prefer explicit VR big endian TS"); + cmd.addOption("--prefer-lossless", "+xs", "prefer default JPEG lossless TS"); + cmd.addOption("--prefer-jpeg8", "+xy", "prefer default JPEG lossy TS for 8 bit data"); + cmd.addOption("--prefer-jpeg12", "+xx", "prefer default JPEG lossy TS for 12 bit data"); + cmd.addOption("--prefer-j2k-lossless", "+xv", "prefer JPEG 2000 lossless TS"); + cmd.addOption("--prefer-j2k-lossy", "+xw", "prefer JPEG 2000 lossy TS"); + cmd.addOption("--prefer-jls-lossless", "+xt", "prefer JPEG-LS lossless TS"); + cmd.addOption("--prefer-jls-lossy", "+xu", "prefer JPEG-LS lossy TS"); + cmd.addOption("--prefer-mpeg2", "+xm", "prefer MPEG2 Main Profile @ Main Level TS"); + cmd.addOption("--prefer-mpeg2-high", "+xh", "prefer MPEG2 Main Profile @ High Level TS"); + cmd.addOption("--prefer-mpeg4", "+xn", "prefer MPEG4 AVC/H.264 HP / Level 4.1 TS"); + cmd.addOption("--prefer-mpeg4-bd", "+xl", "prefer MPEG4 AVC/H.264 BD-compatible TS"); + cmd.addOption("--prefer-mpeg4-2-2d", "+x2", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)"); + cmd.addOption("--prefer-mpeg4-2-3d", "+x3", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)"); + cmd.addOption("--prefer-mpeg4-2-st", "+xo", "prefer MPEG4 AVC/H.264 Stereo HP / Level 4.2 TS"); + cmd.addOption("--prefer-hevc", "+x4", "prefer HEVC/H.265 Main Profile / Level 5.1 TS"); + cmd.addOption("--prefer-hevc10", "+x5", "prefer HEVC/H.265 Main 10 Profile / Level 5.1 TS"); + cmd.addOption("--prefer-rle", "+xr", "prefer RLE lossless TS"); +#ifdef WITH_ZLIB + cmd.addOption("--prefer-deflated", "+xd", "prefer deflated explicit VR little endian TS"); +#endif + cmd.addOption("--implicit", "+xi", "accept implicit VR little endian TS only"); + cmd.addSubGroup("proposed retrieve transfer syntaxes (outgoing associations):"); + cmd.addOption("--propose-uncompr", "-x=", "propose all uncompressed TS, explicit VR\nwith local byte ordering first (default)"); + cmd.addOption("--propose-little", "-xe", "propose all uncompressed TS, explicit VR\nlittle endian first"); + cmd.addOption("--propose-big", "-xb", "propose all uncompressed TS, explicit VR\nbig endian first"); +#ifdef WITH_ZLIB + cmd.addOption("--propose-deflated", "-xd", "propose deflated explicit VR little endian TS\nand all uncompressed transfer syntaxes"); +#endif + cmd.addOption("--propose-implicit", "-xi", "propose implicit VR little endian TS only"); + cmd.addSubGroup("other network options:"); + cmd.addOption("--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", "timeout for connection requests"); + cmd.addOption("--acse-timeout", "-ta", 1, "[s]econds: integer (default: 30)", "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages"); + + OFString opt3 = "set max receive pdu to n bytes (default: "; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_DEFAULTMAXPDU)); + opt3 += tempstr; + opt3 += ")"; + OFString opt4 = "[n]umber of bytes: integer ("; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MINIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ".."; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MAXIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ")"; + cmd.addOption("--max-pdu", "-pdu", 1, opt4.c_str(), opt3.c_str()); + cmd.addOption("--repeat", 1, "[n]umber: integer", "repeat n times"); + cmd.addOption("--abort", "abort association instead of releasing it"); + cmd.addGroup("output options:"); + cmd.addSubGroup("general:"); + cmd.addOption("--output-directory", "-od", 1, "[d]irectory: string (default: \".\")", "write received objects to existing directory d"); + cmd.addSubGroup("storage mode:"); + cmd.addOption("--normal", "-B", "receive in memory, then write to disk (default)"); + cmd.addOption("--bit-preserving", "+B", "receive directly to disk"); + cmd.addOption("--ignore", "ignore store data, receive but do not store"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; + #ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; + #else + COUT << " none" << OFendl; + #endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + if (cmd.findOption("--verbose-pc")) + { + app.checkDependence("--verbose-pc", "verbose mode", getscuLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_showPresentationContexts = OFTrue; + } + + /* network options */ + if (cmd.findOption("--key", 0, OFCommandLine::FOM_FirstFromLeft)) + { + const char *ovKey = NULL; + do + { + app.checkValue(cmd.getValue(ovKey)); + overrideKeys.push_back(ovKey); + } while (cmd.findOption("--key", 0, OFCommandLine::FOM_NextFromLeft)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--patient")) opt_queryModel = QMPatientRoot; + if (cmd.findOption("--study")) opt_queryModel = QMStudyRoot; + if (cmd.findOption("--psonly")) opt_queryModel = QMPatientStudyOnly; + cmd.endOptionBlock(); + + if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_ourTitle)); + if (cmd.findOption("--call")) app.checkValue(cmd.getValue(opt_peerTitle)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--prefer-uncompr")) opt_store_networkTransferSyntax = EXS_Unknown; + if (cmd.findOption("--prefer-little")) opt_store_networkTransferSyntax = EXS_LittleEndianExplicit; + if (cmd.findOption("--prefer-big")) opt_store_networkTransferSyntax = EXS_BigEndianExplicit; + if (cmd.findOption("--prefer-lossless")) opt_store_networkTransferSyntax = EXS_JPEGProcess14SV1; + if (cmd.findOption("--prefer-jpeg8")) opt_store_networkTransferSyntax = EXS_JPEGProcess1; + if (cmd.findOption("--prefer-jpeg12")) opt_store_networkTransferSyntax = EXS_JPEGProcess2_4; + if (cmd.findOption("--prefer-j2k-lossless")) opt_store_networkTransferSyntax = EXS_JPEG2000LosslessOnly; + if (cmd.findOption("--prefer-j2k-lossy")) opt_store_networkTransferSyntax = EXS_JPEG2000; + if (cmd.findOption("--prefer-jls-lossless")) opt_store_networkTransferSyntax = EXS_JPEGLSLossless; + if (cmd.findOption("--prefer-jls-lossy")) opt_store_networkTransferSyntax = EXS_JPEGLSLossy; + if (cmd.findOption("--prefer-mpeg2")) opt_store_networkTransferSyntax = EXS_MPEG2MainProfileAtMainLevel; + if (cmd.findOption("--prefer-mpeg2-high")) opt_store_networkTransferSyntax = EXS_MPEG2MainProfileAtHighLevel; + if (cmd.findOption("--prefer-mpeg4")) opt_store_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-bd")) opt_store_networkTransferSyntax = EXS_MPEG4BDcompatibleHighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-2-2d")) opt_store_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For2DVideo; + if (cmd.findOption("--prefer-mpeg4-2-3d")) opt_store_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For3DVideo; + if (cmd.findOption("--prefer-mpeg4-2-st")) opt_store_networkTransferSyntax = EXS_MPEG4StereoHighProfileLevel4_2; + if (cmd.findOption("--prefer-hevc")) opt_store_networkTransferSyntax = EXS_HEVCMainProfileLevel5_1; + if (cmd.findOption("--prefer-hevc10")) opt_store_networkTransferSyntax = EXS_HEVCMain10ProfileLevel5_1; + if (cmd.findOption("--prefer-rle")) opt_store_networkTransferSyntax = EXS_RLELossless; +#ifdef WITH_ZLIB + if (cmd.findOption("--prefer-deflated")) opt_store_networkTransferSyntax = EXS_DeflatedLittleEndianExplicit; +#endif + if (cmd.findOption("--implicit")) opt_store_networkTransferSyntax = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--propose-uncompr")) opt_get_networkTransferSyntax = EXS_Unknown; + if (cmd.findOption("--propose-little")) opt_get_networkTransferSyntax = EXS_LittleEndianExplicit; + if (cmd.findOption("--propose-big")) opt_get_networkTransferSyntax = EXS_BigEndianExplicit; + if (cmd.findOption("--propose-implicit")) opt_get_networkTransferSyntax = EXS_LittleEndianImplicit; +#ifdef WITH_ZLIB + if (cmd.findOption("--propose-deflated")) opt_get_networkTransferSyntax = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); + + if (cmd.findOption("--timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set(OFstatic_cast(Sint32, opt_timeout)); + } + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_acse_timeout = OFstatic_cast(int, opt_timeout); + } + + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_dimse_timeout = OFstatic_cast(int, opt_timeout); + opt_blockMode = DIMSE_NONBLOCKING; + } + + if (cmd.findOption("--max-pdu")) app.checkValue(cmd.getValueAndCheckMinMax(opt_maxPDU, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--repeat")) app.checkValue(cmd.getValueAndCheckMin(opt_repeatCount, 1)); + if (cmd.findOption("--abort")) opt_abortAssociation = OFTrue; + if (cmd.findOption("--ignore")) opt_storageMode = DCMSCU_STORAGE_IGNORE; + + /* output options */ + if (cmd.findOption("--output-directory")) + { + app.checkConflict("--output-directory", "--ignore", opt_storageMode == DCMSCU_STORAGE_IGNORE); + app.checkValue(cmd.getValue(opt_outputDirectory)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--bit-preserving")) + { + app.checkConflict("--bit-preserving", "--ignore", opt_storageMode == DCMSCU_STORAGE_IGNORE); + opt_storageMode = DCMSCU_STORAGE_BIT_PRESERVING; + } + if (cmd.findOption("--normal")) + { + app.checkConflict("--normal", "--bit-preserving", opt_storageMode == DCMSCU_STORAGE_BIT_PRESERVING); + app.checkConflict("--normal", "--ignore", opt_storageMode == DCMSCU_STORAGE_IGNORE); + opt_storageMode = DCMSCU_STORAGE_DISK; + } + cmd.endOptionBlock(); + + /* command line parameters */ + cmd.getParam(1, opt_peer); + app.checkParam(cmd.getParamAndCheckMinMax(2, opt_port, 1, 65535)); + + /* finally, parse filenames */ + int paramCount = cmd.getParamCount(); + const char *currentFilename = NULL; + OFString errormsg; + + for (int i = 3; i <= paramCount; i++) + { + cmd.getParam(i, currentFilename); + if (access(currentFilename, R_OK) < 0) + { + errormsg = "cannot access file: "; + errormsg += currentFilename; + app.printError(errormsg.c_str()); + } + fileNameList.push_back(currentFilename); + } + + if (fileNameList.empty() && overrideKeys.empty()) + { + app.printError("either query file or override keys (or both) must be specified"); + } + } + + /* print resource identifier */ + OFLOG_DEBUG(getscuLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(getscuLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* make sure output directory exists and is writeable */ + if (!OFStandard::dirExists(opt_outputDirectory)) + { + OFLOG_FATAL(getscuLogger, "specified output directory does not exist"); + return 1; + } + else if (!OFStandard::isWriteable(opt_outputDirectory)) + { + OFLOG_FATAL(getscuLogger, "specified output directory is not writeable"); + return 1; + } + + /* setup SCU */ + OFList syntaxes; + prepareTS(opt_get_networkTransferSyntax, syntaxes); + DcmSCU scu; + scu.setMaxReceivePDULength(opt_maxPDU); + scu.setACSETimeout(opt_acse_timeout); + scu.setDIMSEBlockingMode(opt_blockMode); + scu.setDIMSETimeout(opt_dimse_timeout); + scu.setAETitle(opt_ourTitle); + scu.setPeerHostName(opt_peer); + scu.setPeerPort(OFstatic_cast(Uint16, opt_port)); + scu.setPeerAETitle(opt_peerTitle); + scu.setVerbosePCMode(opt_showPresentationContexts); + + /* add presentation contexts for get and find (we do not actually need find...) + * (only uncompressed) + */ + scu.addPresentationContext(querySyntax[opt_queryModel], syntaxes); + + /* add storage presentation contexts (long list of storage SOP classes, uncompressed) */ + syntaxes.clear(); + prepareTS(opt_store_networkTransferSyntax, syntaxes); + for (Uint16 j = 0; j < numberOfDcmLongSCUStorageSOPClassUIDs; j++) + { + scu.addPresentationContext(dcmLongSCUStorageSOPClassUIDs[j], syntaxes, ASC_SC_ROLE_SCP); + } + + /* set the storage mode */ + scu.setStorageMode(opt_storageMode); + if (opt_storageMode != DCMSCU_STORAGE_IGNORE) + { + scu.setStorageDir(opt_outputDirectory); + } + + /* initialize network and negotiate association */ + OFCondition cond = scu.initNetwork(); + if (cond.bad()) + { + OFLOG_FATAL(getscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + cond = scu.negotiateAssociation(); + if (cond.bad()) + { + OFLOG_FATAL(getscuLogger, "Could not negotiate association: " << cond.text()); + exit(1); + } + cond = EC_Normal; + T_ASC_PresentationContextID pcid = scu.findPresentationContextID(querySyntax[opt_queryModel], ""); + if (pcid == 0) + { + OFLOG_FATAL(getscuLogger, "No adequate Presentation Contexts for sending C-GET"); + exit(1); + } + + /* do the real work, i.e. send C-GET requests and receive objects */ + for (Uint16 repeat = 0; repeat < opt_repeatCount; repeat++) + { + size_t numRuns = 1; + DcmFileFormat dcmff; + DcmDataset *dset = dcmff.getDataset(); + OFListConstIterator(OFString) it; + /* load first file, if there is one */ + if (!fileNameList.empty()) + { + numRuns = fileNameList.size(); + it = fileNameList.begin(); + cond = dcmff.loadFile((*it).c_str()); + if (cond.bad()) + { + OFLOG_FATAL(getscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + dset = dcmff.getDataset(); + } + OFList responses; + /* for all files (or at least one run from override keys) */ + for (Uint16 i = 0; i < numRuns; i++) + { + applyOverrideKeys(dset); + cond = scu.sendCGETRequest(pcid, dset, &responses); + if (cond.bad()) + { + exit(1); + } + /* load next file if there is one */ + if (numRuns > 1) + { + it++; + cond = dcmff.loadFile((*it).c_str()); + if (cond.bad()) + { + OFLOG_FATAL(getscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + dset = dcmff.getDataset(); + } + } + if (!responses.empty()) + { + /* output final status report */ + OFLOG_INFO(getscuLogger, "Final status report from last C-GET message:"); + (*(--responses.end()))->print(); + /* delete responses */ + OFListIterator(RetrieveResponse*) iter = responses.begin(); + OFListConstIterator(RetrieveResponse*) last = responses.end(); + while (iter != last) + { + delete (*iter); + iter = responses.erase(iter); + } + } + } + + int status = 0; + /* tear down association */ + if (cond == EC_Normal) + { + if (opt_abortAssociation) + scu.abortAssociation(); + else + scu.releaseAssociation(); + } + else + { + if (cond == DUL_PEERREQUESTEDRELEASE) + scu.closeAssociation(DCMSCU_PEER_REQUESTED_RELEASE); + else if (cond == DUL_PEERABORTEDASSOCIATION) + scu.closeAssociation(DCMSCU_PEER_ABORTED_ASSOCIATION); + else + { + OFLOG_ERROR(getscuLogger, "Get SCU Failed: " << DimseCondition::dump(temp_str, cond)); + scu.abortAssociation(); + } + /* TODO: need to find better exit codes */ + status = 1; + } + + return status; +} + + +static void applyOverrideKeys(DcmDataset *dataset) +{ + /* replace specific keys by those in overrideKeys */ + OFListConstIterator(OFString) path = overrideKeys.begin(); + OFListConstIterator(OFString) endOfList = overrideKeys.end(); + DcmPathProcessor proc; + proc.setItemWildcardSupport(OFFalse); + proc.checkPrivateReservations(OFFalse); + OFCondition cond; + while (path != endOfList) + { + cond = proc.applyPathWithValue(dataset, *path); + if (cond.bad()) + { + OFLOG_ERROR(getscuLogger, "Bad override key/path: " << *path << ": " << cond.text()); + } + path++; + } +} + +static void prepareTS(E_TransferSyntax ts, + OFList& syntaxes) +{ + /* + ** We prefer to use Explicitly encoded transfer syntaxes. + ** If we are running on a Little Endian machine we prefer + ** LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + ** Some SCP implementations will just select the first transfer + ** syntax they support (this is not part of the standard) so + ** organize the proposed transfer syntaxes to take advantage + ** of such behavior. + ** + ** The presentation contexts proposed here are only used for + ** C-FIND and C-MOVE, so there is no need to support compressed + ** transmission. + */ + + switch (ts) + { + case EXS_LittleEndianImplicit: + /* we only support Little Endian Implicit */ + syntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); + break; + case EXS_LittleEndianExplicit: + /* we prefer Little Endian Explicit */ + syntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); + syntaxes.push_back(UID_BigEndianExplicitTransferSyntax); + syntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); + break; + case EXS_BigEndianExplicit: + /* we prefer Big Endian Explicit */ + syntaxes.push_back(UID_BigEndianExplicitTransferSyntax); + syntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); + syntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); + break; +#ifdef WITH_ZLIB + case EXS_DeflatedLittleEndianExplicit: + /* we prefer Deflated Little Endian Explicit */ + syntaxes.push_back(UID_DeflatedExplicitVRLittleEndianTransferSyntax); + syntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); + syntaxes.push_back(UID_BigEndianExplicitTransferSyntax); + syntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); + break; +#endif + default: + DcmXfer xfer(ts); + if (xfer.isEncapsulated()) + { + syntaxes.push_back(xfer.getXferID()); + } + /* We prefer explicit transfer syntaxes. + * If we are running on a Little Endian machine we prefer + * LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + */ + if (gLocalByteOrder == EBO_LittleEndian) /* defined in dcxfer.h */ + { + syntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); + syntaxes.push_back(UID_BigEndianExplicitTransferSyntax); + } else + { + syntaxes.push_back(UID_BigEndianExplicitTransferSyntax); + syntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); + } + syntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); + break; + } +} diff --git a/dcmnet/apps/movescu.cc b/dcmnet/apps/movescu.cc new file mode 100644 index 00000000..7c406046 --- /dev/null +++ b/dcmnet/apps/movescu.cc @@ -0,0 +1,1728 @@ +/* + * + * Copyright (C) 1994-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Andrew Hewett + * + * Purpose: Query/Retrieve Service Class User (C-MOVE operation) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CSTDARG +#define INCLUDE_CERRNO +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmnet/dicom.h" +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcdicent.h" +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "movescu" + +static OFLogger movescuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* default application titles */ +#define APPLICATIONTITLE "MOVESCU" +#define PEERAPPLICATIONTITLE "ANY-SCP" + +/* exit codes for this command line tool */ +/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */ + +// network errors +#define EXITCODE_CANNOT_INITIALIZE_NETWORK 60 +#define EXITCODE_CANNOT_NEGOTIATE_ASSOCIATION 61 +#define EXITCODE_CANNOT_CREATE_ASSOC_PARAMETERS 65 +#define EXITCODE_NO_PRESENTATION_CONTEXT 66 +#define EXITCODE_CANNOT_CLOSE_ASSOCIATION 67 +#define EXITCODE_CMOVE_WARNING 68 +#define EXITCODE_CMOVE_ERROR 69 + + +typedef enum { + QMPatientRoot = 0, + QMStudyRoot = 1, + QMPatientStudyOnly = 2 +} QueryModel; + +typedef struct { + const char *findSyntax; + const char *moveSyntax; +} QuerySyntax; + +typedef struct { + T_ASC_Association *assoc; + T_ASC_PresentationContextID presId; +} MyCallbackInfo; + +OFCmdUnsignedInt opt_sleepAfter = 0; +OFCmdUnsignedInt opt_sleepDuring = 0; +OFCmdUnsignedInt opt_maxPDU = ASC_DEFAULTMAXPDU; +OFBool opt_useMetaheader = OFTrue; +OFBool opt_acceptAllXfers = OFFalse; +E_TransferSyntax opt_in_networkTransferSyntax = EXS_Unknown; +E_TransferSyntax opt_out_networkTransferSyntax = EXS_Unknown; +E_TransferSyntax opt_writeTransferSyntax = EXS_Unknown; +E_GrpLenEncoding opt_groupLength = EGL_recalcGL; +E_EncodingType opt_sequenceType = EET_ExplicitLength; +E_PaddingEncoding opt_paddingType = EPD_withoutPadding; +OFCmdUnsignedInt opt_filepad = 0; +OFCmdUnsignedInt opt_itempad = 0; +OFBool opt_bitPreserving = OFFalse; +OFBool opt_ignore = OFFalse; +OFBool opt_abortDuringStore = OFFalse; +OFBool opt_abortAfterStore = OFFalse; +OFBool opt_correctUIDPadding = OFFalse; +OFCmdUnsignedInt opt_repeatCount = 1; +OFCmdUnsignedInt opt_retrievePort = 0; +OFBool opt_abortAssociation = OFFalse; +const char * opt_moveDestination = NULL; +OFCmdSignedInt opt_cancelAfterNResponses = -1; +QueryModel opt_queryModel = QMPatientRoot; +T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING; +int opt_dimse_timeout = 0; +int opt_acse_timeout = 30; +OFBool opt_ignorePendingDatasets = OFTrue; +OFString opt_outputDirectory = "."; +int cmove_status_code = EXITCODE_NO_ERROR; + +#ifdef WITH_ZLIB +OFCmdUnsignedInt opt_compressionLevel = 0; +#endif + +static T_ASC_Network *net = NULL; /* the global DICOM network */ +static DcmDataset *overrideKeys = NULL; +static QuerySyntax querySyntax[3] = { + { UID_FINDPatientRootQueryRetrieveInformationModel, + UID_MOVEPatientRootQueryRetrieveInformationModel }, + { UID_FINDStudyRootQueryRetrieveInformationModel, + UID_MOVEStudyRootQueryRetrieveInformationModel }, + { UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel, + UID_RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel } +}; + + +static void +addOverrideKey(OFConsoleApplication& app, const char *s) +{ + unsigned int g = 0xffff; + unsigned int e = 0xffff; + int n = 0; + OFString dicName, valStr; + OFString msg; + char msg2[200]; + + // try to parse group and element number + n = sscanf(s, "%x,%x=", &g, &e); + OFString toParse = s; + size_t eqPos = toParse.find('='); + if (n < 2) // if at least no tag could be parsed + { + // if value is given, extract it (and dictionary name) + if (eqPos != OFString_npos) + { + dicName = toParse.substr(0,eqPos).c_str(); + valStr = toParse.substr(eqPos+1,toParse.length()); + } + else // no value given, just dictionary name + dicName = s; // only dictionary name given (without value) + // try to lookup in dictionary + DcmTagKey key(0xffff,0xffff); + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(dicName.c_str()); + dcmDataDict.rdunlock(); + if (dicent!=NULL) { + // found dictionary name, copy group and element number + key = dicent->getKey(); + g = key.getGroup(); + e = key.getElement(); + } + else { + // not found in dictionary + msg = "bad key format or dictionary name not found in dictionary: "; + msg += dicName; + app.printError(msg.c_str()); + } + } // tag could be parsed, copy value if it exists + else + { + if (eqPos != OFString_npos) + valStr = toParse.substr(eqPos+1,toParse.length()); + } + DcmTag tag(g,e); + if (tag.error() != EC_Normal) { + sprintf(msg2, "unknown tag: (%04x,%04x)", g, e); + app.printError(msg2); + } + DcmElement *elem = DcmItem::newDicomElement(tag); + if (elem == NULL) { + sprintf(msg2, "cannot create element for tag: (%04x,%04x)", g, e); + app.printError(msg2); + } + if (!valStr.empty()) { + if (elem->putString(valStr.c_str()).bad()) + { + sprintf(msg2, "cannot put tag value: (%04x,%04x)=\"", g, e); + msg = msg2; + msg += valStr; + msg += "\""; + app.printError(msg.c_str()); + } + } + + if (overrideKeys == NULL) overrideKeys = new DcmDataset; + if (overrideKeys->insert(elem, OFTrue).bad()) { + sprintf(msg2, "cannot insert tag: (%04x,%04x)", g, e); + app.printError(msg2); + } +} + +static OFCondition cmove(T_ASC_Association *assoc, const char *fname); + +static OFCondition +addPresentationContext(T_ASC_Parameters *params, + T_ASC_PresentationContextID pid, + const char *abstractSyntax); + +#define SHORTCOL 4 +#define LONGCOL 21 + +int +main(int argc, char *argv[]) +{ + T_ASC_Parameters *params = NULL; + const char *opt_peer; + OFCmdUnsignedInt opt_port = 104; + DIC_NODENAME peerHost; + T_ASC_Association *assoc = NULL; + const char *opt_peerTitle = PEERAPPLICATIONTITLE; + const char *opt_ourTitle = APPLICATIONTITLE; + OFList fileNameList; + + OFStandard::initializeNetwork(); + + char tempstr[20]; + OFString temp_str; + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM retrieve (C-MOVE) SCU", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("peer", "hostname of DICOM peer"); + cmd.addParam("port", "tcp/ip port number of peer"); + cmd.addParam("dcmfile-in", "DICOM query file(s)", OFCmdParam::PM_MultiOptional); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("network options:"); + cmd.addSubGroup("override matching keys:"); + cmd.addOption("--key", "-k", 1, "[k]ey: gggg,eeee=\"str\" or dict. name=\"str\"", + "override matching key"); + cmd.addSubGroup("query information model:"); + cmd.addOption("--patient", "-P", "use patient root information model (default)"); + cmd.addOption("--study", "-S", "use study root information model"); + cmd.addOption("--psonly", "-O", "use patient/study only information model"); + cmd.addSubGroup("application entity titles:"); + OFString opt1 = "set my calling AE title (default: "; + opt1 += APPLICATIONTITLE; + opt1 += ")"; + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", opt1.c_str()); + OFString opt2 = "set called AE title of peer (default: "; + opt2 += PEERAPPLICATIONTITLE; + opt2 += ")"; + cmd.addOption("--call", "-aec", 1, "[a]etitle: string", opt2.c_str()); + OFString opt5 = "set move destinat. AE title (default: "; + opt5 += APPLICATIONTITLE; + opt5 += ")"; + cmd.addOption("--move", "-aem", 1, "[a]etitle: string", opt5.c_str()); + cmd.addSubGroup("preferred network transfer syntaxes (incoming associations):"); + cmd.addOption("--prefer-uncompr", "+x=", "prefer explicit VR local byte order (default)"); + cmd.addOption("--prefer-little", "+xe", "prefer explicit VR little endian TS"); + cmd.addOption("--prefer-big", "+xb", "prefer explicit VR big endian TS"); + cmd.addOption("--prefer-lossless", "+xs", "prefer default JPEG lossless TS"); + cmd.addOption("--prefer-jpeg8", "+xy", "prefer default JPEG lossy TS for 8 bit data"); + cmd.addOption("--prefer-jpeg12", "+xx", "prefer default JPEG lossy TS for 12 bit data"); + cmd.addOption("--prefer-j2k-lossless", "+xv", "prefer JPEG 2000 lossless TS"); + cmd.addOption("--prefer-j2k-lossy", "+xw", "prefer JPEG 2000 lossy TS"); + cmd.addOption("--prefer-jls-lossless", "+xt", "prefer JPEG-LS lossless TS"); + cmd.addOption("--prefer-jls-lossy", "+xu", "prefer JPEG-LS lossy TS"); + cmd.addOption("--prefer-mpeg2", "+xm", "prefer MPEG2 Main Profile @ Main Level TS"); + cmd.addOption("--prefer-mpeg2-high", "+xh", "prefer MPEG2 Main Profile @ High Level TS"); + cmd.addOption("--prefer-mpeg4", "+xn", "prefer MPEG4 AVC/H.264 HP / Level 4.1 TS"); + cmd.addOption("--prefer-mpeg4-bd", "+xl", "prefer MPEG4 AVC/H.264 BD-compatible TS"); + cmd.addOption("--prefer-mpeg4-2-2d", "+x2", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)"); + cmd.addOption("--prefer-mpeg4-2-3d", "+x3", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)"); + cmd.addOption("--prefer-mpeg4-2-st", "+xo", "prefer MPEG4 AVC/H.264 Stereo HP / Level 4.2 TS"); + cmd.addOption("--prefer-hevc", "+x4", "prefer HEVC/H.265 Main Profile / Level 5.1 TS"); + cmd.addOption("--prefer-hevc10", "+x5", "prefer HEVC/H.265 Main 10 Profile / Level 5.1 TS"); + cmd.addOption("--prefer-rle", "+xr", "prefer RLE lossless TS"); +#ifdef WITH_ZLIB + cmd.addOption("--prefer-deflated", "+xd", "prefer deflated explicit VR little endian TS"); +#endif + cmd.addOption("--implicit", "+xi", "accept implicit VR little endian TS only"); + cmd.addOption("--accept-all", "+xa", "accept all supported transfer syntaxes"); + cmd.addSubGroup("proposed transmission transfer syntaxes (outgoing associations):"); + cmd.addOption("--propose-uncompr", "-x=", "propose all uncompressed TS, explicit VR\nwith local byte ordering first (default)"); + cmd.addOption("--propose-little", "-xe", "propose all uncompressed TS, explicit VR\nlittle endian first"); + cmd.addOption("--propose-big", "-xb", "propose all uncompressed TS, explicit VR\nbig endian first"); +#ifdef WITH_ZLIB + cmd.addOption("--propose-deflated", "-xd", "propose deflated explicit VR little endian TS\nand all uncompressed transfer syntaxes"); +#endif + cmd.addOption("--propose-implicit", "-xi", "propose implicit VR little endian TS only"); +#ifdef WITH_TCPWRAPPER + cmd.addSubGroup("network host access control (tcp wrapper):"); + cmd.addOption("--access-full", "-ac", "accept connections from any host (default)"); + cmd.addOption("--access-control", "+ac", "enforce host access control rules"); +#endif + cmd.addSubGroup("port for incoming network associations:"); + cmd.addOption("--no-port", "no port for incoming associations (default)"); + cmd.addOption("--port", "+P", 1, "[n]umber: integer", + "port number for incoming associations"); + cmd.addSubGroup("handling of illegal datasets following 'pending' move responses:"); + cmd.addOption("--pending-ignore", "-pi", "assume no dataset present (default)"); + cmd.addOption("--pending-read", "-pr", "read and ignore dataset"); + + cmd.addSubGroup("other network options:"); + cmd.addOption("--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", "timeout for connection requests"); + cmd.addOption("--acse-timeout", "-ta", 1, "[s]econds: integer (default: 30)", "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages"); + + OFString opt3 = "set max receive pdu to n bytes (default: "; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_DEFAULTMAXPDU)); + opt3 += tempstr; + opt3 += ")"; + OFString opt4 = "[n]umber of bytes: integer ("; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MINIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ".."; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MAXIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ")"; + cmd.addOption("--max-pdu", "-pdu", 1, opt4.c_str(), opt3.c_str()); + cmd.addOption("--disable-host-lookup", "-dhl", "disable hostname lookup"); + cmd.addOption("--repeat", 1, "[n]umber: integer", "repeat n times"); + cmd.addOption("--abort", "abort association instead of releasing it"); + cmd.addOption("--ignore", "ignore store data, receive but do not store"); + cmd.addOption("--cancel", 1, "[n]umber: integer", + "cancel after n responses (default: never)"); + cmd.addOption("--uid-padding", "-up", "silently correct space-padded UIDs"); + cmd.addGroup("output options:"); + cmd.addSubGroup("general:"); + cmd.addOption("--output-directory", "-od", 1, "[d]irectory: string (default: \".\")", "write received objects to existing directory d"); + cmd.addSubGroup("bit preserving mode:"); + cmd.addOption("--normal", "-B", "allow implicit format conversions (default)"); + cmd.addOption("--bit-preserving", "+B", "write data exactly as read"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax (not with --bit-preserving or compressed transmission):"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); +#ifdef WITH_ZLIB + cmd.addOption("--write-xfer-deflated", "+td", "write with deflated expl. VR little endian TS"); +#endif + cmd.addSubGroup("post-1993 value representations (not with --bit-preserving):"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding (not with --bit-preserving):"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items (not with --bit-preserving):"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset or --bit-preserving):"); + cmd.addOption("--padding-off", "-p", "no padding (default)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with -xd or --write-xfer-deflated/same):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_TCPWRAPPER) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef WITH_TCPWRAPPER + COUT << "- LIBWRAP" << OFendl; +#endif + return EXITCODE_NO_ERROR; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_peer); + app.checkParam(cmd.getParamAndCheckMinMax(2, opt_port, 1, 65535)); + + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--key", 0, OFCommandLine::FOM_First)) + { + const char *ovKey = NULL; + do { + app.checkValue(cmd.getValue(ovKey)); + addOverrideKey(app, ovKey); + } while (cmd.findOption("--key", 0, OFCommandLine::FOM_Next)); + } + cmd.beginOptionBlock(); + if (cmd.findOption("--patient")) opt_queryModel = QMPatientRoot; + if (cmd.findOption("--study")) opt_queryModel = QMStudyRoot; + if (cmd.findOption("--psonly")) opt_queryModel = QMPatientStudyOnly; + cmd.endOptionBlock(); + + if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_ourTitle)); + if (cmd.findOption("--call")) app.checkValue(cmd.getValue(opt_peerTitle)); + if (cmd.findOption("--move")) app.checkValue(cmd.getValue(opt_moveDestination)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--prefer-uncompr")) + { + opt_acceptAllXfers = OFFalse; + opt_in_networkTransferSyntax = EXS_Unknown; + } + if (cmd.findOption("--prefer-little")) opt_in_networkTransferSyntax = EXS_LittleEndianExplicit; + if (cmd.findOption("--prefer-big")) opt_in_networkTransferSyntax = EXS_BigEndianExplicit; + if (cmd.findOption("--prefer-lossless")) opt_in_networkTransferSyntax = EXS_JPEGProcess14SV1; + if (cmd.findOption("--prefer-jpeg8")) opt_in_networkTransferSyntax = EXS_JPEGProcess1; + if (cmd.findOption("--prefer-jpeg12")) opt_in_networkTransferSyntax = EXS_JPEGProcess2_4; + if (cmd.findOption("--prefer-j2k-lossless")) opt_in_networkTransferSyntax = EXS_JPEG2000LosslessOnly; + if (cmd.findOption("--prefer-j2k-lossy")) opt_in_networkTransferSyntax = EXS_JPEG2000; + if (cmd.findOption("--prefer-jls-lossless")) opt_in_networkTransferSyntax = EXS_JPEGLSLossless; + if (cmd.findOption("--prefer-jls-lossy")) opt_in_networkTransferSyntax = EXS_JPEGLSLossy; + if (cmd.findOption("--prefer-mpeg2")) opt_in_networkTransferSyntax = EXS_MPEG2MainProfileAtMainLevel; + if (cmd.findOption("--prefer-mpeg2-high")) opt_in_networkTransferSyntax = EXS_MPEG2MainProfileAtHighLevel; + if (cmd.findOption("--prefer-mpeg4")) opt_in_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-bd")) opt_in_networkTransferSyntax = EXS_MPEG4BDcompatibleHighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-2-2d")) opt_in_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For2DVideo; + if (cmd.findOption("--prefer-mpeg4-2-3d")) opt_in_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For3DVideo; + if (cmd.findOption("--prefer-mpeg4-2-st")) opt_in_networkTransferSyntax = EXS_MPEG4StereoHighProfileLevel4_2; + if (cmd.findOption("--prefer-hevc")) opt_in_networkTransferSyntax = EXS_HEVCMainProfileLevel5_1; + if (cmd.findOption("--prefer-hevc10")) opt_in_networkTransferSyntax = EXS_HEVCMain10ProfileLevel5_1; + if (cmd.findOption("--prefer-rle")) opt_in_networkTransferSyntax = EXS_RLELossless; +#ifdef WITH_ZLIB + if (cmd.findOption("--prefer-deflated")) opt_in_networkTransferSyntax = EXS_DeflatedLittleEndianExplicit; +#endif + if (cmd.findOption("--implicit")) opt_in_networkTransferSyntax = EXS_LittleEndianImplicit; + if (cmd.findOption("--accept-all")) + { + opt_acceptAllXfers = OFTrue; + opt_in_networkTransferSyntax = EXS_Unknown; + } + cmd.endOptionBlock(); + if (opt_in_networkTransferSyntax != EXS_Unknown) opt_acceptAllXfers = OFFalse; + + cmd.beginOptionBlock(); + if (cmd.findOption("--propose-uncompr")) opt_out_networkTransferSyntax = EXS_Unknown; + if (cmd.findOption("--propose-little")) opt_out_networkTransferSyntax = EXS_LittleEndianExplicit; + if (cmd.findOption("--propose-big")) opt_out_networkTransferSyntax = EXS_BigEndianExplicit; + if (cmd.findOption("--propose-implicit")) opt_out_networkTransferSyntax = EXS_LittleEndianImplicit; +#ifdef WITH_ZLIB + if (cmd.findOption("--propose-deflated")) opt_out_networkTransferSyntax = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); + +#ifdef WITH_TCPWRAPPER + cmd.beginOptionBlock(); + if (cmd.findOption("--access-full")) dcmTCPWrapperDaemonName.set(NULL); + if (cmd.findOption("--access-control")) dcmTCPWrapperDaemonName.set(OFFIS_CONSOLE_APPLICATION); + cmd.endOptionBlock(); +#endif + + if (cmd.findOption("--timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set(OFstatic_cast(Sint32, opt_timeout)); + } + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_acse_timeout = OFstatic_cast(int, opt_timeout); + } + + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_dimse_timeout = OFstatic_cast(int, opt_timeout); + opt_blockMode = DIMSE_NONBLOCKING; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--port")) app.checkValue(cmd.getValueAndCheckMinMax(opt_retrievePort, 1, 65535)); + if (cmd.findOption("--no-port")) opt_retrievePort = 0; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--pending-ignore")) opt_ignorePendingDatasets = OFTrue; + if (cmd.findOption("--pending-read")) opt_ignorePendingDatasets = OFFalse; + cmd.endOptionBlock(); + + if (cmd.findOption("--max-pdu")) app.checkValue(cmd.getValueAndCheckMinMax(opt_maxPDU, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--disable-host-lookup")) dcmDisableGethostbyaddr.set(OFTrue); + if (cmd.findOption("--repeat")) app.checkValue(cmd.getValueAndCheckMin(opt_repeatCount, 1)); + if (cmd.findOption("--abort")) opt_abortAssociation = OFTrue; + if (cmd.findOption("--ignore")) opt_ignore = OFTrue; + if (cmd.findOption("--cancel")) app.checkValue(cmd.getValueAndCheckMin(opt_cancelAfterNResponses, 0)); + if (cmd.findOption("--uid-padding")) opt_correctUIDPadding = OFTrue; + + if (cmd.findOption("--output-directory")) + { + app.checkDependence("--output-directory", "--port", opt_retrievePort > 0); + app.checkValue(cmd.getValue(opt_outputDirectory)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--normal")) opt_bitPreserving = OFFalse; + if (cmd.findOption("--bit-preserving")) opt_bitPreserving = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_useMetaheader = OFTrue; + if (cmd.findOption("--write-dataset")) opt_useMetaheader = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_writeTransferSyntax = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) + { + app.checkConflict("--write-xfer-little", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-little", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-little", "--prefer-lossless", opt_in_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-little", "--prefer-jpeg8", opt_in_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-little", "--prefer-jpeg12", opt_in_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-little", "--prefer-j2k-lossless", opt_in_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-little", "--prefer-j2k-lossy", opt_in_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-little", "--prefer-jls-lossless", opt_in_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-little", "--prefer-jls-lossy", opt_in_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-little", "--prefer-mpeg2", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-little", "--prefer-mpeg2-high", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-bd", opt_in_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-2d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-3d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-st", opt_in_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-little", "--prefer-hevc", opt_in_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-little", "--prefer-hevc10", opt_in_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-little", "--prefer-rle", opt_in_networkTransferSyntax == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. + opt_writeTransferSyntax = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--write-xfer-big")) + { + app.checkConflict("--write-xfer-big", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-big", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-big", "--prefer-lossless", opt_in_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-big", "--prefer-jpeg8", opt_in_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-big", "--prefer-jpeg12", opt_in_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-big", "--prefer-j2k-lossy", opt_in_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-big", "--prefer-j2k-lossless", opt_in_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-big", "--prefer-jls-lossless", opt_in_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-big", "--prefer-jls-lossy", opt_in_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-big", "--prefer-mpeg2", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-big", "--prefer-mpeg2-high", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-bd", opt_in_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-2d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-3d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-st", opt_in_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-big", "--prefer-hevc", opt_in_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-big", "--prefer-hevc10", opt_in_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-big", "--prefer-rle", opt_in_networkTransferSyntax == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. + opt_writeTransferSyntax = EXS_BigEndianExplicit; + } + if (cmd.findOption("--write-xfer-implicit")) + { + app.checkConflict("--write-xfer-implicit", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-implicit", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-implicit", "--prefer-lossless", opt_in_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-implicit", "--prefer-jpeg8", opt_in_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-implicit", "--prefer-jpeg12", opt_in_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-implicit", "--prefer-j2k-lossy", opt_in_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-implicit", "--prefer-j2k-lossless", opt_in_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-implicit", "--prefer-jls-lossless", opt_in_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-implicit", "--prefer-jls-lossy", opt_in_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg2", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg2-high", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-bd", opt_in_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-2d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-3d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-st", opt_in_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-implicit", "--prefer-hevc", opt_in_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-implicit", "--prefer-hevc10", opt_in_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-implicit", "--prefer-rle", opt_in_networkTransferSyntax == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. + opt_writeTransferSyntax = EXS_LittleEndianImplicit; + } +#ifdef WITH_ZLIB + if (cmd.findOption("--write-xfer-deflated")) + { + app.checkConflict("--write-xfer-deflated", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-deflated", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-deflated", "--prefer-lossless", opt_in_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-deflated", "--prefer-jpeg8", opt_in_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-deflated", "--prefer-jpeg12", opt_in_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-deflated", "--prefer-j2k-lossless", opt_in_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-deflated", "--prefer-j2k-lossy", opt_in_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-deflated", "--prefer-jls-lossless", opt_in_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-deflated", "--prefer-jls-lossy", opt_in_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg2", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg2-high", opt_in_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-bd", opt_in_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-2d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-3d", opt_in_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-st", opt_in_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-deflated", "--prefer-hevc", opt_in_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-deflated", "--prefer-hevc10", opt_in_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-deflated", "--prefer-rle", opt_in_networkTransferSyntax == EXS_RLELossless); + opt_writeTransferSyntax = EXS_DeflatedLittleEndianExplicit; + } +#endif + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) + { + app.checkConflict("--enable-new-vr", "--bit-preserving", opt_bitPreserving); + dcmEnableGenerationOfNewVRs(); + } + if (cmd.findOption("--disable-new-vr")) + { + app.checkConflict("--disable-new-vr", "--bit-preserving", opt_bitPreserving); + dcmDisableGenerationOfNewVRs(); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) + { + app.checkConflict("--group-length-recalc", "--bit-preserving", opt_bitPreserving); + opt_groupLength = EGL_recalcGL; + } + if (cmd.findOption("--group-length-create")) + { + app.checkConflict("--group-length-create", "--bit-preserving", opt_bitPreserving); + opt_groupLength = EGL_withGL; + } + if (cmd.findOption("--group-length-remove")) + { + app.checkConflict("--group-length-remove", "--bit-preserving", opt_bitPreserving); + opt_groupLength = EGL_withoutGL; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) + { + app.checkConflict("--length-explicit", "--bit-preserving", opt_bitPreserving); + opt_sequenceType = EET_ExplicitLength; + } + if (cmd.findOption("--length-undefined")) + { + app.checkConflict("--length-undefined", "--bit-preserving", opt_bitPreserving); + opt_sequenceType = EET_UndefinedLength; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-off")) opt_paddingType = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", !opt_useMetaheader); + app.checkConflict("--padding-create", "--bit-preserving", opt_bitPreserving); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_paddingType = EPD_withPadding; + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + app.checkDependence("--compression-level", "--propose-deflated, --write-xfer-deflated or --write-xfer-same", + (opt_out_networkTransferSyntax == EXS_DeflatedLittleEndianExplicit) || + (opt_writeTransferSyntax == EXS_DeflatedLittleEndianExplicit) || + (opt_writeTransferSyntax == EXS_Unknown)); + app.checkValue(cmd.getValueAndCheckMinMax(opt_compressionLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, opt_compressionLevel)); + } +#endif + + /* finally parse filenames */ + int paramCount = cmd.getParamCount(); + const char *currentFilename = NULL; + OFString errormsg; + + for (int i=3; i <= paramCount; i++) + { + cmd.getParam(i, currentFilename); + if (access(currentFilename, R_OK) < 0) + { + errormsg = "cannot access file: "; + errormsg += currentFilename; + app.printError(errormsg.c_str()); + } + fileNameList.push_back(currentFilename); + } + + if ((fileNameList.empty()) && (overrideKeys == NULL)) + { + app.printError("either query file or override keys (or both) must be specified"); + } + } + + /* print resource identifier */ + OFLOG_DEBUG(movescuLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(movescuLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* make sure output directory exists and is writeable */ + if (opt_retrievePort > 0) + { + if (!OFStandard::dirExists(opt_outputDirectory)) + { + OFLOG_FATAL(movescuLogger, "specified output directory does not exist"); + return EXITCODE_INVALID_OUTPUT_DIRECTORY; + } + else if (!OFStandard::isWriteable(opt_outputDirectory)) + { + OFLOG_FATAL(movescuLogger, "specified output directory is not writeable"); + return EXITCODE_CANNOT_WRITE_OUTPUT_FILE; + } + } + +#ifndef DISABLE_PORT_PERMISSION_CHECK +#ifdef HAVE_GETEUID + /* if retrieve port is privileged we must be as well */ + if ((opt_retrievePort > 0) && (opt_retrievePort < 1024)) { + if (geteuid() != 0) + { + OFLOG_FATAL(movescuLogger, "cannot listen on port " << opt_retrievePort << ", insufficient privileges"); + return EXITCODE_INSUFFICIENT_PRIVILEGES; + } + } +#endif +#endif + + /* network for move request and responses */ + T_ASC_NetworkRole role = (opt_retrievePort > 0) ? NET_ACCEPTORREQUESTOR : NET_REQUESTOR; + OFCondition cond = ASC_initializeNetwork(role, OFstatic_cast(int, opt_retrievePort), opt_acse_timeout, &net); + if (cond.bad()) + { + OFLOG_FATAL(movescuLogger, "cannot create network: " << DimseCondition::dump(temp_str, cond)); + return EXITCODE_CANNOT_INITIALIZE_NETWORK; + } + + /* drop root privileges now and revert to the calling user id (if we are running as setuid root) */ + if (OFStandard::dropPrivileges().bad()) + { + OFLOG_FATAL(movescuLogger, "setuid() failed, maximum number of processes/threads for uid already running."); + return EXITCODE_SETUID_FAILED; + } + + /* set up main association */ + cond = ASC_createAssociationParameters(¶ms, opt_maxPDU); + if (cond.bad()) { + OFLOG_FATAL(movescuLogger, DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CREATE_ASSOC_PARAMETERS); + } + ASC_setAPTitles(params, opt_ourTitle, opt_peerTitle, NULL); + + sprintf(peerHost, "%s:%d", opt_peer, OFstatic_cast(int, opt_port)); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), peerHost); + + /* + * We also add a presentation context for the corresponding + * find sop class. + */ + cond = addPresentationContext(params, 1, + querySyntax[opt_queryModel].findSyntax); + + cond = addPresentationContext(params, 3, + querySyntax[opt_queryModel].moveSyntax); + if (cond.bad()) { + OFLOG_FATAL(movescuLogger, DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CREATE_ASSOC_PARAMETERS); + } + + OFLOG_DEBUG(movescuLogger, "Request Parameters:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_RQ)); + + /* create association */ + OFLOG_INFO(movescuLogger, "Requesting Association"); + cond = ASC_requestAssociation(net, params, &assoc); + if (cond.bad()) { + if (cond == DUL_ASSOCIATIONREJECTED) { + T_ASC_RejectParameters rej; + + ASC_getRejectParameters(params, &rej); + OFLOG_FATAL(movescuLogger, "Association Rejected:"); + OFLOG_FATAL(movescuLogger, ASC_printRejectParameters(temp_str, &rej)); + exit(EXITCODE_CANNOT_NEGOTIATE_ASSOCIATION); + } else { + OFLOG_FATAL(movescuLogger, "Association Request Failed:"); + OFLOG_FATAL(movescuLogger, DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_NEGOTIATE_ASSOCIATION); + } + } + /* what has been accepted/refused ? */ + OFLOG_DEBUG(movescuLogger, "Association Parameters Negotiated:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_AC)); + + if (ASC_countAcceptedPresentationContexts(params) == 0) { + OFLOG_FATAL(movescuLogger, "No Acceptable Presentation Contexts"); + exit(EXITCODE_NO_PRESENTATION_CONTEXT); + } + + OFLOG_INFO(movescuLogger, "Association Accepted (Max Send PDV: " << assoc->sendPDVLength << ")"); + + /* do the real work */ + cond = EC_Normal; + if (fileNameList.empty()) + { + /* no files provided on command line */ + cond = cmove(assoc, NULL); + } else { + OFListIterator(OFString) iter = fileNameList.begin(); + OFListIterator(OFString) enditer = fileNameList.end(); + while ((iter != enditer) && cond.good()) + { + cond = cmove(assoc, (*iter).c_str()); + ++iter; + } + } + + /* tear down association */ + if (cond == EC_Normal) + { + if (opt_abortAssociation) { + OFLOG_INFO(movescuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) { + OFLOG_FATAL(movescuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CLOSE_ASSOCIATION); + } + } else { + /* release association */ + OFLOG_INFO(movescuLogger, "Releasing Association"); + cond = ASC_releaseAssociation(assoc); + if (cond.bad()) + { + OFLOG_FATAL(movescuLogger, "Association Release Failed:"); + OFLOG_FATAL(movescuLogger, DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CLOSE_ASSOCIATION); + } + } + } + else if (cond == DUL_PEERREQUESTEDRELEASE) + { + OFLOG_ERROR(movescuLogger, "Protocol Error: Peer requested release (Aborting)"); + OFLOG_INFO(movescuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) { + OFLOG_FATAL(movescuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CLOSE_ASSOCIATION); + } + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + OFLOG_INFO(movescuLogger, "Peer Aborted Association"); + } + else + { + OFLOG_ERROR(movescuLogger, "Move SCU Failed: " << DimseCondition::dump(temp_str, cond)); + OFLOG_INFO(movescuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) { + OFLOG_FATAL(movescuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CLOSE_ASSOCIATION); + } + } + + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) { + OFLOG_FATAL(movescuLogger, DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CLOSE_ASSOCIATION); + } + cond = ASC_dropNetwork(&net); + if (cond.bad()) { + OFLOG_FATAL(movescuLogger, DimseCondition::dump(temp_str, cond)); + exit(EXITCODE_CANNOT_CLOSE_ASSOCIATION); + } + + OFStandard::shutdownNetwork(); + + return cmove_status_code; +} + + +static OFCondition +addPresentationContext(T_ASC_Parameters *params, + T_ASC_PresentationContextID pid, + const char *abstractSyntax) +{ + /* + ** We prefer to use Explicitly encoded transfer syntaxes. + ** If we are running on a Little Endian machine we prefer + ** LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + ** Some SCP implementations will just select the first transfer + ** syntax they support (this is not part of the standard) so + ** organize the proposed transfer syntaxes to take advantage + ** of such behavior. + ** + ** The presentation contexts proposed here are only used for + ** C-FIND and C-MOVE, so there is no need to support compressed + ** transmission. + */ + + const char *transferSyntaxes[] = { NULL, NULL, NULL, NULL }; + int numTransferSyntaxes = 0; + + switch (opt_out_networkTransferSyntax) { + case EXS_LittleEndianImplicit: + /* we only support Little Endian Implicit */ + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_LittleEndianExplicit: + /* we prefer Little Endian Explicit */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_BigEndianExplicit: + /* we prefer Big Endian Explicit */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; +#ifdef WITH_ZLIB + case EXS_DeflatedLittleEndianExplicit: + /* we prefer Deflated Little Endian Explicit */ + transferSyntaxes[0] = UID_DeflatedExplicitVRLittleEndianTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#endif + default: + /* We prefer explicit transfer syntaxes. + * If we are running on a Little Endian machine we prefer + * LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + */ + if (gLocalByteOrder == EBO_LittleEndian) /* defined in dcxfer.h */ + { + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + } + + return ASC_addPresentationContext( + params, pid, abstractSyntax, + transferSyntaxes, numTransferSyntaxes); +} + +static OFCondition +acceptSubAssoc(T_ASC_Network *aNet, T_ASC_Association **assoc) +{ + const char *knownAbstractSyntaxes[] = { + UID_VerificationSOPClass + }; + const char* transferSyntaxes[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, // 10 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, // 20 + NULL }; // +1 + int numTransferSyntaxes; + OFString temp_str; + + OFCondition cond = ASC_receiveAssociation(aNet, assoc, opt_maxPDU); + if (cond.good()) + { + OFLOG_INFO(movescuLogger, "Sub-Association Received"); + OFLOG_DEBUG(movescuLogger, "Parameters:" << OFendl << ASC_dumpParameters(temp_str, (*assoc)->params, ASC_ASSOC_RQ)); + + switch (opt_in_networkTransferSyntax) + { + case EXS_LittleEndianImplicit: + /* we only support Little Endian Implicit */ + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_LittleEndianExplicit: + /* we prefer Little Endian Explicit */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_BigEndianExplicit: + /* we prefer Big Endian Explicit */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_JPEGProcess14SV1: + /* we prefer JPEGLossless:Hierarchical-1stOrderPrediction (default lossless) */ + transferSyntaxes[0] = UID_JPEGProcess14SV1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess1: + /* we prefer JPEGBaseline (default lossy for 8 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess2_4: + /* we prefer JPEGExtended (default lossy for 12 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess2_4TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000LosslessOnly: + /* we prefer JPEG2000 Lossless */ + transferSyntaxes[0] = UID_JPEG2000LosslessOnlyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000: + /* we prefer JPEG2000 Lossy */ + transferSyntaxes[0] = UID_JPEG2000TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossless: + /* we prefer JPEG-LS Lossless */ + transferSyntaxes[0] = UID_JPEGLSLosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossy: + /* we prefer JPEG-LS Lossy */ + transferSyntaxes[0] = UID_JPEGLSLossyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG2MainProfileAtMainLevel: + /* we prefer MPEG2 MP@ML */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG2MainProfileAtHighLevel: + /* we prefer MPEG2 MP@HL */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtHighLevelTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_1: + /* we prefer MPEG4 HP/L4.1 */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4BDcompatibleHighProfileLevel4_1: + /* we prefer MPEG4 BD HP/L4.1 */ + transferSyntaxes[0] = UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_2_For2DVideo: + /* we prefer MPEG4 HP/L4.2 for 2D Videos */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_2_For3DVideo: + /* we prefer MPEG4 HP/L4.2 for 3D Vidoes */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4StereoHighProfileLevel4_2: + /* we prefer MPEG4 Stereo HP/L4.2 */ + transferSyntaxes[0] = UID_MPEG4StereoHighProfileLevel4_2TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_HEVCMainProfileLevel5_1: + /* we prefer HEVC/H.265 Main Profile/L5.1 */ + transferSyntaxes[0] = UID_HEVCMainProfileLevel5_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_HEVCMain10ProfileLevel5_1: + /* we prefer HEVC/H.265 Main 10 Profile/L5.1 */ + transferSyntaxes[0] = UID_HEVCMain10ProfileLevel5_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_RLELossless: + /* we prefer RLE Lossless */ + transferSyntaxes[0] = UID_RLELosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#ifdef WITH_ZLIB + case EXS_DeflatedLittleEndianExplicit: + /* we prefer Deflated Explicit VR Little Endian */ + transferSyntaxes[0] = UID_DeflatedExplicitVRLittleEndianTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#endif + default: + if (opt_acceptAllXfers) + { + /* we accept all supported transfer syntaxes + * (similar to "AnyTransferSyntax" in "storescp.cfg") + */ + transferSyntaxes[0] = UID_JPEG2000TransferSyntax; + transferSyntaxes[1] = UID_JPEG2000LosslessOnlyTransferSyntax; + transferSyntaxes[2] = UID_JPEGProcess2_4TransferSyntax; + transferSyntaxes[3] = UID_JPEGProcess1TransferSyntax; + transferSyntaxes[4] = UID_JPEGProcess14SV1TransferSyntax; + transferSyntaxes[5] = UID_JPEGLSLossyTransferSyntax; + transferSyntaxes[6] = UID_JPEGLSLosslessTransferSyntax; + transferSyntaxes[7] = UID_RLELosslessTransferSyntax; + transferSyntaxes[8] = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + transferSyntaxes[9] = UID_MPEG2MainProfileAtHighLevelTransferSyntax; + transferSyntaxes[10] = UID_MPEG4HighProfileLevel4_1TransferSyntax; + transferSyntaxes[11] = UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax; + transferSyntaxes[12] = UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax; + transferSyntaxes[13] = UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax; + transferSyntaxes[14] = UID_MPEG4StereoHighProfileLevel4_2TransferSyntax; + transferSyntaxes[15] = UID_HEVCMainProfileLevel5_1TransferSyntax; + transferSyntaxes[16] = UID_HEVCMain10ProfileLevel5_1TransferSyntax; + transferSyntaxes[17] = UID_DeflatedExplicitVRLittleEndianTransferSyntax; + if (gLocalByteOrder == EBO_LittleEndian) + { + transferSyntaxes[18] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[19] = UID_BigEndianExplicitTransferSyntax; + } else { + transferSyntaxes[18] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[19] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[20] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 21; + } else { + /* We prefer explicit transfer syntaxes. + * If we are running on a Little Endian machine we prefer + * LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + */ + if (gLocalByteOrder == EBO_LittleEndian) /* defined in dcxfer.h */ + { + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + } + break; + + } + + /* accept the Verification SOP Class if presented */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( + (*assoc)->params, + knownAbstractSyntaxes, DIM_OF(knownAbstractSyntaxes), + transferSyntaxes, numTransferSyntaxes); + + if (cond.good()) + { + /* the array of Storage SOP Class UIDs comes from dcuid.h */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( + (*assoc)->params, + dcmAllStorageSOPClassUIDs, numberOfDcmAllStorageSOPClassUIDs, + transferSyntaxes, numTransferSyntaxes); + } + } + if (cond.good()) + cond = ASC_acknowledgeAssociation(*assoc); + if (cond.good()) + { + OFLOG_INFO(movescuLogger, "Sub-Association Acknowledged (Max Send PDV: " << (*assoc)->sendPDVLength << ")"); + if (ASC_countAcceptedPresentationContexts((*assoc)->params) == 0) + OFLOG_INFO(movescuLogger, " (but no valid presentation contexts)"); + /* dump the presentation contexts which have been accepted/refused */ + OFLOG_DEBUG(movescuLogger, ASC_dumpParameters(temp_str, (*assoc)->params, ASC_ASSOC_AC)); + } else { + OFLOG_ERROR(movescuLogger, DimseCondition::dump(temp_str, cond)); + ASC_dropAssociation(*assoc); + ASC_destroyAssociation(assoc); + } + return cond; +} + +static OFCondition echoSCP( + T_ASC_Association *assoc, + T_DIMSE_Message *msg, + T_ASC_PresentationContextID presID) +{ + OFString temp_str; + // assign the actual information of the C-Echo-RQ command to a local variable + T_DIMSE_C_EchoRQ *req = &msg->msg.CEchoRQ; + if (movescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + OFLOG_INFO(movescuLogger, "Received Echo Request"); + OFLOG_DEBUG(movescuLogger, DIMSE_dumpMessage(temp_str, *req, DIMSE_INCOMING, NULL, presID)); + } else { + OFLOG_INFO(movescuLogger, "Received Echo Request (MsgID " << req->MessageID << ")"); + } + + /* the echo succeeded !! */ + OFCondition cond = DIMSE_sendEchoResponse(assoc, presID, req, STATUS_Success, NULL); + if (cond.bad()) + { + OFLOG_ERROR(movescuLogger, "Echo SCP Failed: " << DimseCondition::dump(temp_str, cond)); + } + return cond; +} + +struct StoreCallbackData +{ + char *imageFileName; + DcmFileFormat *dcmff; + T_ASC_Association *assoc; +}; + +static void +storeSCPCallback( + /* in */ + void *callbackData, + T_DIMSE_StoreProgress *progress, /* progress state */ + T_DIMSE_C_StoreRQ *req, /* original store request */ + char *imageFileName, DcmDataset **imageDataSet, /* being received into */ + /* out */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + DcmDataset **statusDetail) +{ + DIC_UI sopClass; + DIC_UI sopInstance; + + if ((opt_abortDuringStore && progress->state != DIMSE_StoreBegin) || + (opt_abortAfterStore && progress->state == DIMSE_StoreEnd)) { + OFLOG_INFO(movescuLogger, "ABORT initiated (due to command line options)"); + ASC_abortAssociation(OFstatic_cast(StoreCallbackData*, callbackData)->assoc); + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + return; + } + + if (opt_sleepDuring > 0) + { + OFStandard::sleep(OFstatic_cast(unsigned int, opt_sleepDuring)); + } + + // dump some information if required (depending on the progress state) + // We can't use oflog for the pdu output, but we use a special logger for + // generating this output. If it is set to level "INFO" we generate the + // output, if it's set to "DEBUG" then we'll assume that there is debug output + // generated for each PDU elsewhere. + OFLogger progressLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION ".progress"); + if (progressLogger.getChainedLogLevel() == OFLogger::INFO_LOG_LEVEL) + { + switch (progress->state) + { + case DIMSE_StoreBegin: + COUT << "RECV: "; + break; + case DIMSE_StoreEnd: + COUT << OFendl; + break; + default: + COUT << '.'; + break; + } + COUT.flush(); + } + + if (progress->state == DIMSE_StoreEnd) + { + *statusDetail = NULL; /* no status detail */ + + /* could save the image somewhere else, put it in database, etc */ + /* + * An appropriate status code is already set in the resp structure, it need not be success. + * For example, if the caller has already detected an out of resources problem then the + * status will reflect this. The callback function is still called to allow cleanup. + */ + // rsp->DimseStatus = STATUS_Success; + + if ((imageDataSet != NULL) && (*imageDataSet != NULL) && !opt_bitPreserving && !opt_ignore) + { + StoreCallbackData *cbdata = OFstatic_cast(StoreCallbackData*, callbackData); + /* create full path name for the output file */ + OFString ofname; + OFStandard::combineDirAndFilename(ofname, opt_outputDirectory, cbdata->imageFileName, OFTrue /* allowEmptyDirName */); + if (OFStandard::fileExists(ofname)) + { + OFLOG_WARN(movescuLogger, "DICOM file already exists, overwriting: " << ofname); + } + + E_TransferSyntax xfer = opt_writeTransferSyntax; + if (xfer == EXS_Unknown) xfer = (*imageDataSet)->getOriginalXfer(); + + OFCondition cond = cbdata->dcmff->saveFile(ofname.c_str(), xfer, opt_sequenceType, opt_groupLength, + opt_paddingType, OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), + (opt_useMetaheader) ? EWM_fileformat : EWM_dataset); + if (cond.bad()) + { + OFLOG_ERROR(movescuLogger, "cannot write DICOM file: " << ofname); + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + + // delete incomplete file + OFStandard::deleteFile(ofname); + } + + /* should really check the image to make sure it is consistent, + * that its sopClass and sopInstance correspond with those in + * the request. + */ + if ((rsp->DimseStatus == STATUS_Success) && !opt_ignore) + { + /* which SOP class and SOP instance ? */ + if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding)) + { + OFLOG_FATAL(movescuLogger, "bad DICOM file: " << imageFileName); + rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; + } + else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + else if (strcmp(sopInstance, req->AffectedSOPInstanceUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + } + } + } +} + +static OFCondition storeSCP( + T_ASC_Association *assoc, + T_DIMSE_Message *msg, + T_ASC_PresentationContextID presID) +{ + OFCondition cond = EC_Normal; + T_DIMSE_C_StoreRQ *req; + char imageFileName[2048]; + + req = &msg->msg.CStoreRQ; + + if (opt_ignore) + { +#ifdef _WIN32 + tmpnam(imageFileName); +#else + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, 2048); +#endif + } else { + sprintf(imageFileName, "%s.%s", + dcmSOPClassUIDToModality(req->AffectedSOPClassUID), + req->AffectedSOPInstanceUID); + } + + OFString temp_str; + if (movescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + OFLOG_INFO(movescuLogger, "Received Store Request"); + OFLOG_DEBUG(movescuLogger, DIMSE_dumpMessage(temp_str, *req, DIMSE_INCOMING, NULL, presID)); + } else { + OFLOG_INFO(movescuLogger, "Received Store Request (MsgID " << req->MessageID << ", " + << dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "OT") << ")"); + } + + StoreCallbackData callbackData; + callbackData.assoc = assoc; + callbackData.imageFileName = imageFileName; + DcmFileFormat dcmff; + callbackData.dcmff = &dcmff; + + // store SourceApplicationEntityTitle in metaheader + if (assoc && assoc->params) + { + const char *aet = assoc->params->DULparams.callingAPTitle; + if (aet) dcmff.getMetaInfo()->putAndInsertString(DCM_SourceApplicationEntityTitle, aet); + } + + DcmDataset *dset = dcmff.getDataset(); + + if (opt_bitPreserving) + { + cond = DIMSE_storeProvider(assoc, presID, req, imageFileName, opt_useMetaheader, + NULL, storeSCPCallback, OFreinterpret_cast(void*, &callbackData), opt_blockMode, opt_dimse_timeout); + } else { + cond = DIMSE_storeProvider(assoc, presID, req, NULL, opt_useMetaheader, + &dset, storeSCPCallback, OFreinterpret_cast(void*, &callbackData), opt_blockMode, opt_dimse_timeout); + } + + if (cond.bad()) + { + OFLOG_ERROR(movescuLogger, "Store SCP Failed: " << DimseCondition::dump(temp_str, cond)); + /* remove file */ + if (!opt_ignore) + { + if (strcmp(imageFileName, NULL_DEVICE_NAME) != 0) OFStandard::deleteFile(imageFileName); + } +#ifdef _WIN32 + } else if (opt_ignore) { + if (strcmp(imageFileName, NULL_DEVICE_NAME) != 0) OFStandard::deleteFile(imageFileName); // delete the temporary file +#endif + } + + if (opt_sleepAfter > 0) + { + OFStandard::sleep(OFstatic_cast(unsigned int, opt_sleepDuring)); + } + return cond; +} + +static OFCondition +subOpSCP(T_ASC_Association **subAssoc) +{ + T_DIMSE_Message msg; + T_ASC_PresentationContextID presID; + + if (!ASC_dataWaiting(*subAssoc, 0)) /* just in case */ + return DIMSE_NODATAAVAILABLE; + + OFCondition cond = DIMSE_receiveCommand(*subAssoc, opt_blockMode, opt_dimse_timeout, &presID, &msg, NULL); + + if (cond == EC_Normal) { + switch (msg.CommandField) + { + case DIMSE_C_ECHO_RQ: + // process C-ECHO-Request + cond = echoSCP(*subAssoc, &msg, presID); + break; + case DIMSE_C_STORE_RQ: + // process C-STORE-Request + cond = storeSCP(*subAssoc, &msg, presID); + break; + default: + OFString tempStr; + // we cannot handle this kind of message + cond = DIMSE_BADCOMMANDTYPE; + OFLOG_ERROR(movescuLogger, "Expected C-ECHO or C-STORE request but received DIMSE command 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4) + << OFstatic_cast(unsigned, msg.CommandField)); + OFLOG_DEBUG(movescuLogger, DIMSE_dumpMessage(tempStr, msg, DIMSE_INCOMING, NULL, presID)); + break; + } + } + /* clean up on association termination */ + if (cond == DUL_PEERREQUESTEDRELEASE) + { + cond = ASC_acknowledgeRelease(*subAssoc); + ASC_dropSCPAssociation(*subAssoc); + ASC_destroyAssociation(subAssoc); + return cond; + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + } + else if (cond != EC_Normal) + { + OFString temp_str; + OFLOG_ERROR(movescuLogger, "DIMSE failure (aborting sub-association): " << DimseCondition::dump(temp_str, cond)); + /* some kind of error so abort the association */ + cond = ASC_abortAssociation(*subAssoc); + } + + if (cond != EC_Normal) + { + ASC_dropAssociation(*subAssoc); + ASC_destroyAssociation(subAssoc); + } + return cond; +} + +static void +subOpCallback(void * /*subOpCallbackData*/ , + T_ASC_Network *aNet, T_ASC_Association **subAssoc) +{ + + if (aNet == NULL) return; /* help no net ! */ + + if (*subAssoc == NULL) { + /* negotiate association */ + acceptSubAssoc(aNet, subAssoc); + } else { + /* be a service class provider */ + subOpSCP(subAssoc); + } +} + +static void +moveCallback(void *callbackData, T_DIMSE_C_MoveRQ *request, + int responseCount, T_DIMSE_C_MoveRSP *response) +{ + OFCondition cond = EC_Normal; + MyCallbackInfo *myCallbackData; + OFString temp_str; + + myCallbackData = OFstatic_cast(MyCallbackInfo*, callbackData); + + if (movescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) { + OFLOG_INFO(movescuLogger, "Received Move Response " << responseCount); + OFLOG_DEBUG(movescuLogger, DIMSE_dumpMessage(temp_str, *response, DIMSE_INCOMING)); + } else { + OFLOG_INFO(movescuLogger, "Received Move Response " << responseCount << " (" + << DU_cmoveStatusString(response->DimseStatus) << ")"); + } + + /* should we send a cancel back ?? */ + if (opt_cancelAfterNResponses == responseCount) { + OFLOG_INFO(movescuLogger, "Sending Cancel Request (MsgID " << request->MessageID + << ", PresID " << OFstatic_cast(unsigned int, myCallbackData->presId) << ")"); + cond = DIMSE_sendCancelRequest(myCallbackData->assoc, + myCallbackData->presId, request->MessageID); + if (cond != EC_Normal) { + OFLOG_ERROR(movescuLogger, "Cancel Request Failed: " << DimseCondition::dump(temp_str, cond)); + } + } +} + + +static void +substituteOverrideKeys(DcmDataset *dset) +{ + if (overrideKeys == NULL) { + return; /* nothing to do */ + } + + /* copy the override keys */ + DcmDataset keys(*overrideKeys); + + /* put the override keys into dset replacing existing tags */ + unsigned long elemCount = keys.card(); + for (unsigned long i = 0; i < elemCount; i++) { + DcmElement *elem = keys.remove(OFstatic_cast(unsigned long, 0)); + + dset->insert(elem, OFTrue); + } +} + + +static OFCondition +moveSCU(T_ASC_Association *assoc, const char *fname) +{ + T_ASC_PresentationContextID presId; + T_DIMSE_C_MoveRQ req; + T_DIMSE_C_MoveRSP rsp; + DIC_US msgId = assoc->nextMsgID++; + DcmDataset *rspIds = NULL; + const char *sopClass; + DcmDataset *statusDetail = NULL; + MyCallbackInfo callbackData; + OFString temp_str; + + DcmFileFormat dcmff; + + if (fname != NULL) { + if (dcmff.loadFile(fname).bad()) { + OFLOG_ERROR(movescuLogger, "bad DICOM file: " << fname << ": " << dcmff.error().text()); + return DIMSE_BADDATA; + } + } + + /* replace specific keys by those in overrideKeys */ + substituteOverrideKeys(dcmff.getDataset()); + + sopClass = querySyntax[opt_queryModel].moveSyntax; + + /* which presentation context should be used */ + presId = ASC_findAcceptedPresentationContextID(assoc, sopClass); + if (presId == 0) return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + + callbackData.assoc = assoc; + callbackData.presId = presId; + + req.MessageID = msgId; + OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID)); + req.Priority = DIMSE_PRIORITY_MEDIUM; + req.DataSetType = DIMSE_DATASET_PRESENT; + if (opt_moveDestination == NULL) { + /* set the destination to be me */ + ASC_getAPTitles(assoc->params, req.MoveDestination, sizeof(req.MoveDestination), NULL, 0, NULL, 0); + } else { + OFStandard::strlcpy(req.MoveDestination, opt_moveDestination, sizeof(req.MoveDestination)); + } + + if (movescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + OFLOG_INFO(movescuLogger, "Sending Move Request"); + OFLOG_DEBUG(movescuLogger, DIMSE_dumpMessage(temp_str, req, DIMSE_OUTGOING, NULL, presId)); + } else { + OFLOG_INFO(movescuLogger, "Sending Move Request (MsgID " << msgId << ")"); + } + OFLOG_INFO(movescuLogger, "Request Identifiers:" << OFendl << DcmObject::PrintHelper(*dcmff.getDataset())); + + OFCondition cond = DIMSE_moveUser(assoc, presId, &req, dcmff.getDataset(), + moveCallback, &callbackData, opt_blockMode, opt_dimse_timeout, net, subOpCallback, + NULL, &rsp, &statusDetail, &rspIds, opt_ignorePendingDatasets); + + if (cond == EC_Normal) { + + // check if the C-MOVE-RSP message indicated an error + if ((rsp.DimseStatus == STATUS_Success) || + (rsp.DimseStatus == STATUS_MOVE_Cancel_SubOperationsTerminatedDueToCancelIndication)) + { + // status is "success" or "cancel", nothing to do. + } + else if (rsp.DimseStatus == STATUS_MOVE_Warning_SubOperationsCompleteOneOrMoreFailures) + { + // status is "warn". Make sure the application ends with a non-zero return code. + if (EXITCODE_NO_ERROR == cmove_status_code) cmove_status_code = EXITCODE_CMOVE_WARNING; + OFLOG_WARN(movescuLogger, "Move response with warning status (" << DU_cmoveStatusString(rsp.DimseStatus) << ")"); + } + else + { + // status is "failed" or "refused" + cmove_status_code = EXITCODE_CMOVE_ERROR; + OFLOG_WARN(movescuLogger, "Move response with error status (" << DU_cmoveStatusString(rsp.DimseStatus) << ")"); + } + + if (movescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) { + OFLOG_INFO(movescuLogger, "Received Final Move Response"); + OFLOG_DEBUG(movescuLogger, DIMSE_dumpMessage(temp_str, rsp, DIMSE_INCOMING)); + if (rspIds != NULL) { + OFLOG_DEBUG(movescuLogger, "Response Identifiers:" << OFendl << DcmObject::PrintHelper(*rspIds)); + } + } else { + OFLOG_INFO(movescuLogger, "Received Final Move Response (" << DU_cmoveStatusString(rsp.DimseStatus) << ")"); + } + } else { + OFLOG_ERROR(movescuLogger, "Move Request Failed: " << DimseCondition::dump(temp_str, cond)); + } + if (statusDetail != NULL) { + OFLOG_DEBUG(movescuLogger, "Status Detail:" << OFendl << DcmObject::PrintHelper(*statusDetail)); + delete statusDetail; + } + + if (rspIds != NULL) delete rspIds; + + return cond; +} + + +static OFCondition +cmove(T_ASC_Association *assoc, const char *fname) +{ + OFCondition cond = EC_Normal; + int n = OFstatic_cast(int, opt_repeatCount); + while (cond.good() && n--) + cond = moveSCU(assoc, fname); + return cond; +} diff --git a/dcmnet/apps/storescp.cc b/dcmnet/apps/storescp.cc new file mode 100644 index 00000000..db289225 --- /dev/null +++ b/dcmnet/apps/storescp.cc @@ -0,0 +1,2601 @@ +/* + * + * Copyright (C) 1994-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Andrew Hewett + * + * Purpose: Storage Service Class Provider (C-STORE operation) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTRING +#define INCLUDE_CSTDARG +#define INCLUDE_CCTYPE +#define INCLUDE_CSIGNAL +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include /* needed on Solaris for O_RDONLY */ +#endif +#ifdef HAVE_SIGNAL_H +// On Solaris with Sun Workshop 11, declares signal() but does not +#include +#endif +END_EXTERN_C + +#ifdef HAVE_WINDOWS_H +#include /* for _mkdir() */ +#endif + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofdatime.h" +#include "dcmtk/dcmnet/dicom.h" /* for DICOM_APPLICATION_ACCEPTOR */ +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmnet/dcmtrans.h" /* for dcmSocketSend/ReceiveTimeout */ +#include "dcmtk/dcmnet/dcasccfg.h" /* for class DcmAssociationConfiguration */ +#include "dcmtk/dcmnet/dcasccff.h" /* for class DcmAssociationConfigurationFile */ +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/dcmtls/tlsopt.h" /* for DcmTLSOptions */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +// we assume that the inetd super server is available on all non-Windows systems +#ifndef _WIN32 +#define INETD_AVAILABLE +#endif + + +#ifdef PRIVATE_STORESCP_DECLARATIONS +PRIVATE_STORESCP_DECLARATIONS +#else +#define OFFIS_CONSOLE_APPLICATION "storescp" +#endif + +static OFLogger storescpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define APPLICATIONTITLE "STORESCP" /* our application entity title */ + +#define PATH_PLACEHOLDER "#p" +#define FILENAME_PLACEHOLDER "#f" +#define CALLING_AETITLE_PLACEHOLDER "#a" +#define CALLED_AETITLE_PLACEHOLDER "#c" +#define CALLING_PRESENTATION_ADDRESS_PLACEHOLDER "#r" + +static OFCondition processCommands(T_ASC_Association *assoc); +static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfiguration& asccfg, OFBool secureConnection); +static OFCondition echoSCP(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID); +static OFCondition storeSCP(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID); +static void executeOnReception(); +static void executeEndOfStudyEvents(); +static void executeOnEndOfStudy(); +static void renameOnEndOfStudy(); +static OFString replaceChars( const OFString &srcstr, const OFString &pattern, const OFString &substitute ); +static void executeCommand( const OFString &cmd ); +static void cleanChildren(pid_t pid, OFBool synch); +static OFCondition acceptUnknownContextsWithPreferredTransferSyntaxes( + T_ASC_Parameters * params, + const char* transferSyntaxes[], + int transferSyntaxCount, + T_ASC_SC_ROLE acceptedRole = ASC_SC_ROLE_DEFAULT); + +/* sort study mode */ +enum E_SortStudyMode +{ + ESM_None, + ESM_Timestamp, + ESM_StudyInstanceUID, + ESM_PatientName +}; + +OFBool opt_showPresentationContexts = OFFalse; +OFBool opt_uniqueFilenames = OFFalse; +OFString opt_fileNameExtension; +OFBool opt_timeNames = OFFalse; +int timeNameCounter = -1; // "serial number" to differentiate between files with same timestamp +OFCmdUnsignedInt opt_port = 0; +OFBool opt_refuseAssociation = OFFalse; +OFBool opt_rejectWithoutImplementationUID = OFFalse; +OFCmdUnsignedInt opt_sleepAfter = 0; +OFCmdUnsignedInt opt_sleepDuring = 0; +OFCmdUnsignedInt opt_maxPDU = ASC_DEFAULTMAXPDU; +OFBool opt_useMetaheader = OFTrue; +OFBool opt_acceptAllXfers = OFFalse; +E_TransferSyntax opt_networkTransferSyntax = EXS_Unknown; +E_TransferSyntax opt_writeTransferSyntax = EXS_Unknown; +E_GrpLenEncoding opt_groupLength = EGL_recalcGL; +E_EncodingType opt_sequenceType = EET_ExplicitLength; +E_PaddingEncoding opt_paddingType = EPD_withoutPadding; +OFCmdUnsignedInt opt_filepad = 0; +OFCmdUnsignedInt opt_itempad = 0; +OFCmdUnsignedInt opt_compressionLevel = 0; +OFBool opt_bitPreserving = OFFalse; +OFBool opt_ignore = OFFalse; +OFBool opt_abortDuringStore = OFFalse; +OFBool opt_abortAfterStore = OFFalse; +OFBool opt_promiscuous = OFFalse; +OFBool opt_correctUIDPadding = OFFalse; +OFBool opt_inetd_mode = OFFalse; +OFString callingAETitle; // calling application entity title will be stored here +OFString lastCallingAETitle; +OFString calledAETitle; // called application entity title will be stored here +OFString lastCalledAETitle; +OFString callingPresentationAddress; // remote hostname or IP address will be stored here +OFString lastCallingPresentationAddress; +const char * opt_respondingAETitle = APPLICATIONTITLE; +static OFString opt_outputDirectory = "."; // default: output directory equals "." +E_SortStudyMode opt_sortStudyMode = ESM_None; // default: no sorting +static const char *opt_sortStudyDirPrefix = NULL; // default: no directory prefix +OFString lastStudyInstanceUID; +OFString subdirectoryPathAndName; +OFList outputFileNameArray; +static const char *opt_execOnReception = NULL; // default: don't execute anything on reception +static const char *opt_execOnEndOfStudy = NULL; // default: don't execute anything on end of study + +OFString lastStudySubdirectoryPathAndName; +static OFBool opt_renameOnEndOfStudy = OFFalse; // default: don't rename any files on end of study +static long opt_endOfStudyTimeout = -1; // default: no end of study timeout +static OFBool endOfStudyThroughTimeoutEvent = OFFalse; +static const char *opt_configFile = NULL; +static const char *opt_profileName = NULL; +T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING; +int opt_dimse_timeout = 0; +int opt_acse_timeout = 30; +OFCmdSignedInt opt_socket_timeout = 60; + +#if defined(HAVE_FORK) || defined(_WIN32) +OFBool opt_forkMode = OFFalse; +#endif + +OFBool opt_forkedChild = OFFalse; +OFBool opt_execSync = OFFalse; // default: execute in background + + +#ifdef HAVE_WAITPID +/** signal handler for SIGCHLD signals that immediately cleans up + * terminated children. + */ +#ifdef SIGNAL_HANDLER_WITH_ELLIPSE +extern "C" void sigChildHandler(...) +#else +extern "C" void sigChildHandler(int) +#endif +{ + int status = 0; + waitpid( -1, &status, WNOHANG ); + signal(SIGCHLD, sigChildHandler); +} +#endif + + +/* helper macro for converting stream output to a string */ +#define CONVERT_TO_STRING(output, string) \ + optStream.str(""); \ + optStream.clear(); \ + optStream << output << OFStringStream_ends; \ + OFSTRINGSTREAM_GETOFSTRING(optStream, string) + +#define SHORTCOL 4 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + T_ASC_Network *net; + DcmAssociationConfiguration asccfg; + DcmTLSOptions tlsOptions(NET_ACCEPTOR); + + OFStandard::initializeNetwork(); +#ifdef WITH_OPENSSL + DcmTLSTransportLayer::initializeOpenSSL(); +#endif + + OFString temp_str; + OFOStringStream optStream; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "DICOM storage (C-STORE) SCP", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("port", "tcp/ip port number to listen on", OFCmdParam::PM_Optional); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--verbose-pc", "+v", "show presentation contexts in verbose mode"); + +#if defined(HAVE_FORK) || defined(_WIN32) + cmd.addGroup("multi-process options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--single-process", "single process mode (default)"); + cmd.addOption("--fork", "fork child process for each association"); +#ifdef _WIN32 + cmd.addOption("--forked-child", "process is forked child, internal use only", OFCommandLine::AF_Internal); +#endif +#endif + + cmd.addGroup("network options:"); + cmd.addSubGroup("association negotiation profile from configuration file:"); + cmd.addOption("--config-file", "-xf", 2, "[f]ilename, [p]rofile: string", + "use profile p from config file f"); + cmd.addSubGroup("preferred network transfer syntaxes (not with --config-file):"); + cmd.addOption("--prefer-uncompr", "+x=", "prefer explicit VR local byte order (default)"); + cmd.addOption("--prefer-little", "+xe", "prefer explicit VR little endian TS"); + cmd.addOption("--prefer-big", "+xb", "prefer explicit VR big endian TS"); + cmd.addOption("--prefer-lossless", "+xs", "prefer default JPEG lossless TS"); + cmd.addOption("--prefer-jpeg8", "+xy", "prefer default JPEG lossy TS for 8 bit data"); + cmd.addOption("--prefer-jpeg12", "+xx", "prefer default JPEG lossy TS for 12 bit data"); + cmd.addOption("--prefer-j2k-lossless", "+xv", "prefer JPEG 2000 lossless TS"); + cmd.addOption("--prefer-j2k-lossy", "+xw", "prefer JPEG 2000 lossy TS"); + cmd.addOption("--prefer-jls-lossless", "+xt", "prefer JPEG-LS lossless TS"); + cmd.addOption("--prefer-jls-lossy", "+xu", "prefer JPEG-LS lossy TS"); + cmd.addOption("--prefer-mpeg2", "+xm", "prefer MPEG2 Main Profile @ Main Level TS"); + cmd.addOption("--prefer-mpeg2-high", "+xh", "prefer MPEG2 Main Profile @ High Level TS"); + cmd.addOption("--prefer-mpeg4", "+xn", "prefer MPEG4 AVC/H.264 HP / Level 4.1 TS"); + cmd.addOption("--prefer-mpeg4-bd", "+xl", "prefer MPEG4 AVC/H.264 BD-compatible TS"); + cmd.addOption("--prefer-mpeg4-2-2d", "+x2", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)"); + cmd.addOption("--prefer-mpeg4-2-3d", "+x3", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)"); + cmd.addOption("--prefer-mpeg4-2-st", "+xo", "prefer MPEG4 AVC/H.264 Stereo HP / Level 4.2 TS"); + cmd.addOption("--prefer-hevc", "+x4", "prefer HEVC/H.265 Main Profile / Level 5.1 TS"); + cmd.addOption("--prefer-hevc10", "+x5", "prefer HEVC/H.265 Main 10 Profile / Level 5.1 TS"); + cmd.addOption("--prefer-rle", "+xr", "prefer RLE lossless TS"); +#ifdef WITH_ZLIB + cmd.addOption("--prefer-deflated", "+xd", "prefer deflated expl. VR little endian TS"); +#endif + cmd.addOption("--implicit", "+xi", "accept implicit VR little endian TS only"); + cmd.addOption("--accept-all", "+xa", "accept all supported transfer syntaxes"); + +#ifdef WITH_TCPWRAPPER + cmd.addSubGroup("network host access control (tcp wrapper):"); + cmd.addOption("--access-full", "-ac", "accept connections from any host (default)"); + cmd.addOption("--access-control", "+ac", "enforce host access control rules"); +#endif + + cmd.addSubGroup("other network options:"); +#ifdef INETD_AVAILABLE + // this option is only offered on Posix platforms + cmd.addOption("--inetd", "-id", "run from inetd super server (not with --fork)"); +#endif + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_socket_timeout << ")", optString1); + cmd.addOption("--socket-timeout", "-ts", 1, optString1.c_str(), "timeout for network socket (0 for none)"); + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_acse_timeout << ")", optString2); + cmd.addOption("--acse-timeout", "-ta", 1, optString2.c_str(), "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages"); + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", "set my AE title (default: " APPLICATIONTITLE ")"); + CONVERT_TO_STRING("[n]umber of bytes: integer (" << ASC_MINIMUMPDUSIZE << ".." << ASC_MAXIMUMPDUSIZE << ")", optString3); + CONVERT_TO_STRING("set max receive pdu to n bytes (default: " << opt_maxPDU << ")", optString4); + cmd.addOption("--max-pdu", "-pdu", 1, optString3.c_str(), optString4.c_str()); + + cmd.addOption("--disable-host-lookup", "-dhl", "disable hostname lookup"); + cmd.addOption("--refuse", "refuse association"); + cmd.addOption("--reject", "reject association if no implement. class UID"); + cmd.addOption("--ignore", "ignore store data, receive but do not store"); + cmd.addOption("--sleep-after", 1, "[s]econds: integer", + "sleep s seconds after store (default: 0)"); + cmd.addOption("--sleep-during", 1, "[s]econds: integer", + "sleep s seconds during store (default: 0)"); + cmd.addOption("--abort-after", "abort association after receipt of C-STORE-RQ\n(but before sending response)"); + cmd.addOption("--abort-during", "abort association during receipt of C-STORE-RQ"); + cmd.addOption("--promiscuous", "-pm", "promiscuous mode, accept unknown SOP classes\n(not with --config-file)"); + cmd.addOption("--uid-padding", "-up", "silently correct space-padded UIDs"); + + // add TLS specific command line options if (and only if) we are compiling with OpenSSL + tlsOptions.addTLSCommandlineOptions(cmd); + + cmd.addGroup("output options:"); + cmd.addSubGroup("general:"); + cmd.addOption("--output-directory", "-od", 1, "[d]irectory: string (default: \".\")", "write received objects to existing directory d"); + cmd.addSubGroup("bit preserving mode:"); + cmd.addOption("--normal", "-B", "allow implicit format conversions (default)"); + cmd.addOption("--bit-preserving", "+B", "write data exactly as read"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax (not with --bit-preserving or compressed transmission):"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); +#ifdef WITH_ZLIB + cmd.addOption("--write-xfer-deflated", "+td", "write with deflated expl. VR little endian TS"); +#endif + cmd.addSubGroup("post-1993 value representations (not with --bit-preserving):"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding (not with --bit-preserving):"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items (not with --bit-preserving):"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset or --bit-preserving):"); + cmd.addOption("--padding-off", "-p", "no padding (default)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes and items\non multiple of i bytes"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with --write-xfer-deflated/same):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + cmd.addSubGroup("sorting into subdirectories (not with --bit-preserving):"); + cmd.addOption("--sort-conc-studies", "-ss", 1, "[p]refix: string", + "sort studies using prefix p and a timestamp"); + cmd.addOption("--sort-on-study-uid", "-su", 1, "[p]refix: string", + "sort studies using prefix p and the Study\nInstance UID"); + cmd.addOption("--sort-on-patientname", "-sp", "sort studies using the Patient's Name and\na timestamp"); + + cmd.addSubGroup("filename generation:"); + cmd.addOption("--default-filenames", "-uf", "generate filename from instance UID (default)"); + cmd.addOption("--unique-filenames", "+uf", "generate unique filenames"); + cmd.addOption("--timenames", "-tn", "generate filename from creation time"); + cmd.addOption("--filename-extension", "-fe", 1, "[e]xtension: string", + "append e to all filenames"); + + cmd.addGroup("event options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--exec-on-reception", "-xcr", 1, "[c]ommand: string", + "execute command c after having received and\nprocessed one C-STORE-RQ message"); + cmd.addOption("--exec-on-eostudy", "-xcs", 1, "[c]ommand: string", + "execute command c after having received and\nprocessed all C-STORE-RQ messages that belong\nto one study"); + cmd.addOption("--rename-on-eostudy", "-rns", "having received and processed all C-STORE-RQ\nmessages that belong to one study, rename\noutput files according to certain pattern"); + cmd.addOption("--eostudy-timeout", "-tos", 1, "[t]imeout: integer", + "specifies a timeout of t seconds for\nend-of-study determination"); + cmd.addOption("--exec-sync", "-xs", "execute command synchronously in foreground"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* print help text and exit */ + if (cmd.getArgCount() == 0) + app.printUsage(); + + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_OPENSSL) && !defined(WITH_TCPWRAPPER) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + // print OpenSSL version if (and only if) we are compiling with OpenSSL + tlsOptions.printLibraryVersion(); +#ifdef WITH_TCPWRAPPER + COUT << "- LIBWRAP" << OFendl; +#endif + return 0; + } + + // check if the command line contains the --list-ciphers option + if (tlsOptions.listOfCiphersRequested(cmd)) + { + tlsOptions.printSupportedCiphersuites(app, COUT); + return 0; + } + } + +#ifdef INETD_AVAILABLE + if (cmd.findOption("--inetd")) + { + opt_inetd_mode = OFTrue; + opt_forkMode = OFFalse; + + // duplicate stdin, which is the socket passed by inetd + int inetd_fd = dup(0); + if (inetd_fd < 0) exit(99); + + close(0); // close stdin + close(1); // close stdout + close(2); // close stderr + + // open new file descriptor for stdin + int fd = open("/dev/null", O_RDONLY); + if (fd != 0) exit(99); + + // create new file descriptor for stdout + fd = open("/dev/null", O_WRONLY); + if (fd != 1) exit(99); + + // create new file descriptor for stderr + fd = open("/dev/null", O_WRONLY); + if (fd != 2) exit(99); + + dcmExternalSocketHandle.set(inetd_fd); + + // the port number is not really used. Set to non-privileged port number + // to avoid failing the privilege test. + opt_port = 1024; + } +#endif + +#if defined(HAVE_FORK) || defined(_WIN32) + cmd.beginOptionBlock(); + if (cmd.findOption("--single-process")) + opt_forkMode = OFFalse; + if (cmd.findOption("--fork")) + { + app.checkConflict("--inetd", "--fork", opt_inetd_mode); + opt_forkMode = OFTrue; + } + cmd.endOptionBlock(); +#ifdef _WIN32 + if (cmd.findOption("--forked-child")) opt_forkedChild = OFTrue; +#endif +#endif + + if (opt_inetd_mode) + { + // port number is not required in inetd mode + if (cmd.getParamCount() > 0) + OFLOG_WARN(storescpLogger, "Parameter port not required in inetd mode"); + } else { + // omitting the port number is only allowed in inetd mode + if (cmd.getParamCount() == 0) + app.printError("Missing parameter port"); + else + app.checkParam(cmd.getParamAndCheckMinMax(1, opt_port, 1, 65535)); + } + + OFLog::configureFromCommandLine(cmd, app); + if (cmd.findOption("--verbose-pc")) + { + app.checkDependence("--verbose-pc", "verbose mode", storescpLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_showPresentationContexts = OFTrue; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--prefer-uncompr")) + { + opt_acceptAllXfers = OFFalse; + opt_networkTransferSyntax = EXS_Unknown; + } + if (cmd.findOption("--prefer-little")) opt_networkTransferSyntax = EXS_LittleEndianExplicit; + if (cmd.findOption("--prefer-big")) opt_networkTransferSyntax = EXS_BigEndianExplicit; + if (cmd.findOption("--prefer-lossless")) opt_networkTransferSyntax = EXS_JPEGProcess14SV1; + if (cmd.findOption("--prefer-jpeg8")) opt_networkTransferSyntax = EXS_JPEGProcess1; + if (cmd.findOption("--prefer-jpeg12")) opt_networkTransferSyntax = EXS_JPEGProcess2_4; + if (cmd.findOption("--prefer-j2k-lossless")) opt_networkTransferSyntax = EXS_JPEG2000LosslessOnly; + if (cmd.findOption("--prefer-j2k-lossy")) opt_networkTransferSyntax = EXS_JPEG2000; + if (cmd.findOption("--prefer-jls-lossless")) opt_networkTransferSyntax = EXS_JPEGLSLossless; + if (cmd.findOption("--prefer-jls-lossy")) opt_networkTransferSyntax = EXS_JPEGLSLossy; + if (cmd.findOption("--prefer-mpeg2")) opt_networkTransferSyntax = EXS_MPEG2MainProfileAtMainLevel; + if (cmd.findOption("--prefer-mpeg2-high")) opt_networkTransferSyntax = EXS_MPEG2MainProfileAtHighLevel; + if (cmd.findOption("--prefer-mpeg4")) opt_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-bd")) opt_networkTransferSyntax = EXS_MPEG4BDcompatibleHighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-2-2d")) opt_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For2DVideo; + if (cmd.findOption("--prefer-mpeg4-2-3d")) opt_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For3DVideo; + if (cmd.findOption("--prefer-mpeg4-2-st")) opt_networkTransferSyntax = EXS_MPEG4StereoHighProfileLevel4_2; + if (cmd.findOption("--prefer-hevc")) opt_networkTransferSyntax = EXS_HEVCMainProfileLevel5_1; + if (cmd.findOption("--prefer-hevc10")) opt_networkTransferSyntax = EXS_HEVCMain10ProfileLevel5_1; + if (cmd.findOption("--prefer-rle")) opt_networkTransferSyntax = EXS_RLELossless; +#ifdef WITH_ZLIB + if (cmd.findOption("--prefer-deflated")) opt_networkTransferSyntax = EXS_DeflatedLittleEndianExplicit; +#endif + if (cmd.findOption("--implicit")) opt_networkTransferSyntax = EXS_LittleEndianImplicit; + if (cmd.findOption("--accept-all")) + { + opt_acceptAllXfers = OFTrue; + opt_networkTransferSyntax = EXS_Unknown; + } + cmd.endOptionBlock(); + if (opt_networkTransferSyntax != EXS_Unknown) opt_acceptAllXfers = OFFalse; + + if (cmd.findOption("--socket-timeout")) + app.checkValue(cmd.getValueAndCheckMin(opt_socket_timeout, -1)); + // always set the timeout values since the global default might be different + dcmSocketSendTimeout.set(OFstatic_cast(Sint32, opt_socket_timeout)); + dcmSocketReceiveTimeout.set(OFstatic_cast(Sint32, opt_socket_timeout)); + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_acse_timeout = OFstatic_cast(int, opt_timeout); + } + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_dimse_timeout = OFstatic_cast(int, opt_timeout); + opt_blockMode = DIMSE_NONBLOCKING; + } + + if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_respondingAETitle)); + if (cmd.findOption("--max-pdu")) app.checkValue(cmd.getValueAndCheckMinMax(opt_maxPDU, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--disable-host-lookup")) dcmDisableGethostbyaddr.set(OFTrue); + if (cmd.findOption("--refuse")) opt_refuseAssociation = OFTrue; + if (cmd.findOption("--reject")) opt_rejectWithoutImplementationUID = OFTrue; + if (cmd.findOption("--ignore")) opt_ignore = OFTrue; + if (cmd.findOption("--sleep-after")) app.checkValue(cmd.getValueAndCheckMin(opt_sleepAfter, 0)); + if (cmd.findOption("--sleep-during")) app.checkValue(cmd.getValueAndCheckMin(opt_sleepDuring, 0)); + if (cmd.findOption("--abort-after")) opt_abortAfterStore = OFTrue; + if (cmd.findOption("--abort-during")) opt_abortDuringStore = OFTrue; + if (cmd.findOption("--promiscuous")) opt_promiscuous = OFTrue; + if (cmd.findOption("--uid-padding")) opt_correctUIDPadding = OFTrue; + + if (cmd.findOption("--config-file")) + { + // check conflicts with other command line options + app.checkConflict("--config-file", "--prefer-little", opt_networkTransferSyntax == EXS_LittleEndianExplicit); + app.checkConflict("--config-file", "--prefer-big", opt_networkTransferSyntax == EXS_BigEndianExplicit); + app.checkConflict("--config-file", "--prefer-lossless", opt_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--config-file", "--prefer-jpeg8", opt_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--config-file", "--prefer-jpeg12", opt_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--config-file", "--prefer-j2k-lossless", opt_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--config-file", "--prefer-j2k-lossy", opt_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--config-file", "--prefer-jls-lossless", opt_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--config-file", "--prefer-jls-lossy", opt_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--config-file", "--prefer-mpeg2", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--config-file", "--prefer-mpeg2-high", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--config-file", "--prefer-mpeg4", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--config-file", "--prefer-mpeg4-bd", opt_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--config-file", "--prefer-mpeg4-2-2d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--config-file", "--prefer-mpeg4-2-3d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--config-file", "--prefer-mpeg4-2-st", opt_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--config-file", "--prefer-hevc", opt_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--config-file", "--prefer-hevc10", opt_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--config-file", "--prefer-rle", opt_networkTransferSyntax == EXS_RLELossless); +#ifdef WITH_ZLIB + app.checkConflict("--config-file", "--prefer-deflated", opt_networkTransferSyntax == EXS_DeflatedLittleEndianExplicit); +#endif + app.checkConflict("--config-file", "--implicit", opt_networkTransferSyntax == EXS_LittleEndianImplicit); + app.checkConflict("--config-file", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--config-file", "--promiscuous", opt_promiscuous); + + app.checkValue(cmd.getValue(opt_configFile)); + app.checkValue(cmd.getValue(opt_profileName)); + + // read configuration file + OFCondition cond = DcmAssociationConfigurationFile::initialize(asccfg, opt_configFile); + if (cond.bad()) + { + OFLOG_FATAL(storescpLogger, "cannot read config file: " << cond.text()); + return 1; + } + + /* perform name mangling for config file key */ + OFString sprofile; + const unsigned char *c = OFreinterpret_cast(const unsigned char *, opt_profileName); + while (*c) + { + if (! isspace(*c)) sprofile += OFstatic_cast(char, toupper(*c)); + ++c; + } + + if (!asccfg.isKnownProfile(sprofile.c_str())) + { + OFLOG_FATAL(storescpLogger, "unknown configuration profile name: " << sprofile); + return 1; + } + + if (!asccfg.isValidSCPProfile(sprofile.c_str())) + { + OFLOG_FATAL(storescpLogger, "profile '" << sprofile << "' is not valid for SCP use, duplicate abstract syntaxes found"); + return 1; + } + + } + +#ifdef WITH_TCPWRAPPER + cmd.beginOptionBlock(); + if (cmd.findOption("--access-full")) dcmTCPWrapperDaemonName.set(NULL); + if (cmd.findOption("--access-control")) dcmTCPWrapperDaemonName.set(OFFIS_CONSOLE_APPLICATION); + cmd.endOptionBlock(); +#endif + + if (cmd.findOption("--output-directory")) app.checkValue(cmd.getValue(opt_outputDirectory)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--normal")) opt_bitPreserving = OFFalse; + if (cmd.findOption("--bit-preserving")) opt_bitPreserving = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) opt_useMetaheader = OFTrue; + if (cmd.findOption("--write-dataset")) opt_useMetaheader = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_writeTransferSyntax = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) + { + app.checkConflict("--write-xfer-little", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-little", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-little", "--prefer-lossless", opt_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-little", "--prefer-jpeg8", opt_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-little", "--prefer-jpeg12", opt_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-little", "--prefer-j2k-lossless", opt_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-little", "--prefer-j2k-lossy", opt_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-little", "--prefer-jls-lossless", opt_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-little", "--prefer-jls-lossy", opt_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-little", "--prefer-mpeg2", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-little", "--prefer-mpeg2-high", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-bd", opt_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-2d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-3d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-st", opt_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-little", "--prefer-hevc", opt_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-little", "--prefer-hevc10", opt_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-little", "--prefer-rle", opt_networkTransferSyntax == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. + opt_writeTransferSyntax = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--write-xfer-big")) + { + app.checkConflict("--write-xfer-big", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-big", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-big", "--prefer-lossless", opt_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-big", "--prefer-jpeg8", opt_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-big", "--prefer-jpeg12", opt_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-big", "--prefer-j2k-lossless", opt_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-big", "--prefer-j2k-lossy", opt_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-big", "--prefer-jls-lossless", opt_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-big", "--prefer-jls-lossy", opt_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-big", "--prefer-mpeg2", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-big", "--prefer-mpeg2-high", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-bd", opt_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-2d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-3d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-st", opt_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-big", "--prefer-hevc", opt_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-big", "--prefer-hevc10", opt_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-big", "--prefer-rle", opt_networkTransferSyntax == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. + opt_writeTransferSyntax = EXS_BigEndianExplicit; + } + if (cmd.findOption("--write-xfer-implicit")) + { + app.checkConflict("--write-xfer-implicit", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-implicit", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-implicit", "--prefer-lossless", opt_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-implicit", "--prefer-jpeg8", opt_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-implicit", "--prefer-jpeg12", opt_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-implicit", "--prefer-j2k-lossless", opt_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-implicit", "--prefer-j2k-lossy", opt_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-implicit", "--prefer-jls-lossless", opt_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-implicit", "--prefer-jls-lossy", opt_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg2", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg2-high", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-bd", opt_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-2d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-3d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-st", opt_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-implicit", "--prefer-hevc", opt_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-implicit", "--prefer-hevc10", opt_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-implicit", "--prefer-rle", opt_networkTransferSyntax == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. + opt_writeTransferSyntax = EXS_LittleEndianImplicit; + } +#ifdef WITH_ZLIB + if (cmd.findOption("--write-xfer-deflated")) + { + app.checkConflict("--write-xfer-deflated", "--accept-all", opt_acceptAllXfers); + app.checkConflict("--write-xfer-deflated", "--bit-preserving", opt_bitPreserving); + app.checkConflict("--write-xfer-deflated", "--prefer-lossless", opt_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-deflated", "--prefer-jpeg8", opt_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-deflated", "--prefer-jpeg12", opt_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-deflated", "--prefer-j2k-lossless", opt_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-deflated", "--prefer-j2k-lossy", opt_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--write-xfer-deflated", "--prefer-jls-lossless", opt_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-deflated", "--prefer-jls-lossy", opt_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg2", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg2-high", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-bd", opt_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-2d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-3d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-st", opt_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-deflated", "--prefer-hevc", opt_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-deflated", "--prefer-hevc10", opt_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-deflated", "--prefer-rle", opt_networkTransferSyntax == EXS_RLELossless); + opt_writeTransferSyntax = EXS_DeflatedLittleEndianExplicit; + } +#endif + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) + { + app.checkConflict("--enable-new-vr", "--bit-preserving", opt_bitPreserving); + dcmEnableGenerationOfNewVRs(); + } + if (cmd.findOption("--disable-new-vr")) + { + app.checkConflict("--disable-new-vr", "--bit-preserving", opt_bitPreserving); + dcmDisableGenerationOfNewVRs(); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) + { + app.checkConflict("--group-length-recalc", "--bit-preserving", opt_bitPreserving); + opt_groupLength = EGL_recalcGL; + } + if (cmd.findOption("--group-length-create")) + { + app.checkConflict("--group-length-create", "--bit-preserving", opt_bitPreserving); + opt_groupLength = EGL_withGL; + } + if (cmd.findOption("--group-length-remove")) + { + app.checkConflict("--group-length-remove", "--bit-preserving", opt_bitPreserving); + opt_groupLength = EGL_withoutGL; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) + { + app.checkConflict("--length-explicit", "--bit-preserving", opt_bitPreserving); + opt_sequenceType = EET_ExplicitLength; + } + if (cmd.findOption("--length-undefined")) + { + app.checkConflict("--length-undefined", "--bit-preserving", opt_bitPreserving); + opt_sequenceType = EET_UndefinedLength; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-off")) opt_paddingType = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", !opt_useMetaheader); + app.checkConflict("--padding-create", "--bit-preserving", opt_bitPreserving); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_paddingType = EPD_withPadding; + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + app.checkDependence("--compression-level", "--write-xfer-deflated or --write-xfer-same", + (opt_writeTransferSyntax == EXS_DeflatedLittleEndianExplicit) || (opt_writeTransferSyntax == EXS_Unknown)); + app.checkValue(cmd.getValueAndCheckMinMax(opt_compressionLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, opt_compressionLevel)); + } +#endif + + cmd.beginOptionBlock(); + if (cmd.findOption("--sort-conc-studies")) + { + app.checkConflict("--sort-conc-studies", "--bit-preserving", opt_bitPreserving); + app.checkValue(cmd.getValue(opt_sortStudyDirPrefix)); + opt_sortStudyMode = ESM_Timestamp; + } + if (cmd.findOption("--sort-on-study-uid")) + { + app.checkConflict("--sort-on-study-uid", "--bit-preserving", opt_bitPreserving); + app.checkValue(cmd.getValue(opt_sortStudyDirPrefix)); + opt_sortStudyMode = ESM_StudyInstanceUID; + } + if (cmd.findOption("--sort-on-patientname")) + { + app.checkConflict("--sort-on-patientname", "--bit-preserving", opt_bitPreserving); + opt_sortStudyDirPrefix = NULL; + opt_sortStudyMode = ESM_PatientName; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--default-filenames")) opt_uniqueFilenames = OFFalse; + if (cmd.findOption("--unique-filenames")) opt_uniqueFilenames = OFTrue; + cmd.endOptionBlock(); + + if (cmd.findOption("--timenames")) opt_timeNames = OFTrue; + if (cmd.findOption("--filename-extension")) + app.checkValue(cmd.getValue(opt_fileNameExtension)); + if (cmd.findOption("--timenames")) + app.checkConflict("--timenames", "--unique-filenames", opt_uniqueFilenames); + + if (cmd.findOption("--exec-on-reception")) app.checkValue(cmd.getValue(opt_execOnReception)); + + if (cmd.findOption("--exec-on-eostudy")) + { + app.checkConflict("--exec-on-eostudy", "--fork", opt_forkMode); + app.checkConflict("--exec-on-eostudy", "--inetd", opt_inetd_mode); + app.checkDependence("--exec-on-eostudy", "--sort-conc-studies, --sort-on-study-uid or --sort-on-patientname", opt_sortStudyMode != ESM_None ); + app.checkValue(cmd.getValue(opt_execOnEndOfStudy)); + } + + if (cmd.findOption("--rename-on-eostudy")) + { + app.checkConflict("--rename-on-eostudy", "--fork", opt_forkMode); + app.checkConflict("--rename-on-eostudy", "--inetd", opt_inetd_mode); + app.checkDependence("--rename-on-eostudy", "--sort-conc-studies, --sort-on-study-uid or --sort-on-patientname", opt_sortStudyMode != ESM_None ); + opt_renameOnEndOfStudy = OFTrue; + } + + if (cmd.findOption("--eostudy-timeout")) + { + app.checkDependence("--eostudy-timeout", "--sort-conc-studies, --sort-on-study-uid, --sort-on-patientname, --exec-on-eostudy or --rename-on-eostudy", + (opt_sortStudyMode != ESM_None) || (opt_execOnEndOfStudy != NULL) || opt_renameOnEndOfStudy); + app.checkValue(cmd.getValueAndCheckMin(opt_endOfStudyTimeout, 0)); + } + + if (cmd.findOption("--exec-sync")) opt_execSync = OFTrue; + } + + /* print resource identifier */ + OFLOG_DEBUG(storescpLogger, rcsid << OFendl); + + // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL) + tlsOptions.parseArguments(app, cmd); + +#ifndef DISABLE_PORT_PERMISSION_CHECK +#ifdef HAVE_GETEUID + /* if port is privileged we must be as well */ + if (opt_port < 1024) + { + if (geteuid() != 0) + { + OFLOG_FATAL(storescpLogger, "cannot listen on port " << opt_port << ", insufficient privileges"); + return 1; + } + } +#endif +#endif + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(storescpLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* if the output directory does not equal "." (default directory) */ + if (opt_outputDirectory != ".") + { + /* if there is a path separator at the end of the path, get rid of it */ + OFStandard::normalizeDirName(opt_outputDirectory, opt_outputDirectory); + + /* check if the specified directory exists and if it is a directory. + * If the output directory is invalid, dump an error message and terminate execution. + */ + if (!OFStandard::dirExists(opt_outputDirectory)) + { + OFLOG_FATAL(storescpLogger, "specified output directory does not exist"); + return 1; + } + } + + /* check if the output directory is writeable */ + if (!opt_ignore && !OFStandard::isWriteable(opt_outputDirectory)) + { + OFLOG_FATAL(storescpLogger, "specified output directory is not writeable"); + return 1; + } + +#ifdef HAVE_FORK + if (opt_forkMode) + DUL_requestForkOnTransportConnectionReceipt(argc, argv); +#elif defined(_WIN32) + if (opt_forkedChild) + { + // we are a child process in multi-process mode + if (DUL_readSocketHandleAsForkedChild().bad()) return 1; + } + else + { + // parent process + if (opt_forkMode) DUL_requestForkOnTransportConnectionReceipt(argc, argv); + } +#endif + + /* initialize network, i.e. create an instance of T_ASC_Network*. */ + OFCondition cond = ASC_initializeNetwork(NET_ACCEPTOR, OFstatic_cast(int, opt_port), opt_acse_timeout, &net); + if (cond.bad()) + { + OFLOG_ERROR(storescpLogger, "cannot create network: " << DimseCondition::dump(temp_str, cond)); + return 1; + } + + /* drop root privileges now and revert to the calling user id (if we are running as setuid root) */ + if (OFStandard::dropPrivileges().bad()) + { + OFLOG_FATAL(storescpLogger, "setuid() failed, maximum number of processes/threads for uid already running."); + return 1; + } + + /* create a secure transport layer if requested and OpenSSL is available */ + cond = tlsOptions.createTransportLayer(net, NULL, app, cmd); + if (cond.bad()) { + OFLOG_FATAL(storescpLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + +#ifdef HAVE_WAITPID + // register signal handler + signal(SIGCHLD, sigChildHandler); +#endif + + while (cond.good()) + { + /* receive an association and acknowledge or reject it. If the association was */ + /* acknowledged, offer corresponding services and invoke one or more if required. */ + cond = acceptAssociation(net, asccfg, tlsOptions.secureConnectionRequested()); + + /* remove zombie child processes */ + cleanChildren(-1, OFFalse); + + /* since storescp is usually terminated with SIGTERM or the like, + * we write back an updated random seed after every association handled. + */ + cond = tlsOptions.writeRandomSeed(); + if (cond.bad()) { + // failure to write back the random seed is a warning, not an error + OFLOG_WARN(storescpLogger, DimseCondition::dump(temp_str, cond)); + } + + // if running in inetd mode, we always terminate after one association + if (opt_inetd_mode) break; + + // if running in multi-process mode, always terminate child after one association + if (DUL_processIsForkedChild()) break; + } + + /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */ + /* is the counterpart of ASC_initializeNetwork(...) which was called above. */ + cond = ASC_dropNetwork(&net); + if (cond.bad()) + { + OFLOG_ERROR(storescpLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + OFStandard::shutdownNetwork(); + return 0; +} + + +static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfiguration& asccfg, OFBool secureConnection) +{ + char buf[BUFSIZ]; + T_ASC_Association *assoc; + OFCondition cond; + OFString sprofile; + OFString temp_str; + +#ifdef PRIVATE_STORESCP_VARIABLES + PRIVATE_STORESCP_VARIABLES +#endif + + const char* knownAbstractSyntaxes[] = + { + UID_VerificationSOPClass + }; + + const char* transferSyntaxes[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, // 10 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, // 20 + NULL }; // +1 + int numTransferSyntaxes = 0; + + // try to receive an association. Here we either want to use blocking or + // non-blocking, depending on if the option --eostudy-timeout is set. + if( opt_endOfStudyTimeout == -1 ) + cond = ASC_receiveAssociation(net, &assoc, opt_maxPDU, NULL, NULL, secureConnection); + else + cond = ASC_receiveAssociation(net, &assoc, opt_maxPDU, NULL, NULL, secureConnection, DUL_NOBLOCK, OFstatic_cast(int, opt_endOfStudyTimeout)); + + if (cond.code() == DULC_FORKEDCHILD) + { + // OFLOG_DEBUG(storescpLogger, DimseCondition::dump(temp_str, cond)); + goto cleanup; + } + + // if some kind of error occurred, take care of it + if (cond.bad()) + { + // check what kind of error occurred. If no association was + // received, check if certain other conditions are met + if( cond == DUL_NOASSOCIATIONREQUEST ) + { + // If in addition to the fact that no association was received also option --eostudy-timeout is set + // and if at the same time there is still a study which is considered to be open (i.e. we were actually + // expecting to receive more objects that belong to this study) (this is the case if lastStudyInstanceUID + // does not equal NULL), we have to consider that all objects for the current study have been received. + // In such an "end-of-study" case, we might have to execute certain optional functions which were specified + // by the user through command line options passed to storescp. + if( opt_endOfStudyTimeout != -1 && !lastStudyInstanceUID.empty() ) + { + // indicate that the end-of-study-event occurred through a timeout event. + // This knowledge will be necessary in function renameOnEndOFStudy(). + endOfStudyThroughTimeoutEvent = OFTrue; + + // before we actually execute those optional functions, we need to determine the path and name + // of the subdirectory into which the DICOM files for the last study were written. + lastStudySubdirectoryPathAndName = subdirectoryPathAndName; + + // now we can finally handle end-of-study events which might have to be executed + executeEndOfStudyEvents(); + + // also, we need to clear lastStudyInstanceUID to indicate + // that the last study is not considered to be open any more. + lastStudyInstanceUID.clear(); + + // also, we need to clear subdirectoryPathAndName + subdirectoryPathAndName.clear(); + + // reset the endOfStudyThroughTimeoutEvent variable. + endOfStudyThroughTimeoutEvent = OFFalse; + } + } + // If something else was wrong we might have to dump an error message. + else + { + OFLOG_ERROR(storescpLogger, "Receiving Association failed: " << DimseCondition::dump(temp_str, cond)); + } + + // no matter what kind of error occurred, we need to do a cleanup + goto cleanup; + } + +#if defined(HAVE_FORK) || defined(_WIN32) + if (opt_forkMode) + OFLOG_INFO(storescpLogger, "Association Received in " << (DUL_processIsForkedChild() ? "child" : "parent") + << " process (pid: " << OFStandard::getProcessID() << ")"); + else +#endif + OFLOG_INFO(storescpLogger, "Association Received"); + + /* dump presentation contexts if required */ + if (opt_showPresentationContexts) + OFLOG_INFO(storescpLogger, "Parameters:" << OFendl << ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_RQ)); + else + OFLOG_DEBUG(storescpLogger, "Parameters:" << OFendl << ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_RQ)); + + if (opt_refuseAssociation) + { + T_ASC_RejectParameters rej = + { + ASC_RESULT_REJECTEDPERMANENT, + ASC_SOURCE_SERVICEUSER, + ASC_REASON_SU_NOREASON + }; + + OFLOG_INFO(storescpLogger, "Refusing Association (forced via command line)"); + cond = ASC_rejectAssociation(assoc, &rej); + if (cond.bad()) + { + OFLOG_ERROR(storescpLogger, "Association Reject Failed: " << DimseCondition::dump(temp_str, cond)); + } + goto cleanup; + } + + switch (opt_networkTransferSyntax) + { + case EXS_LittleEndianImplicit: + /* we only support Little Endian Implicit */ + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_LittleEndianExplicit: + /* we prefer Little Endian Explicit */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_BigEndianExplicit: + /* we prefer Big Endian Explicit */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_JPEGProcess14SV1: + /* we prefer JPEGLossless:Hierarchical-1stOrderPrediction (default lossless) */ + transferSyntaxes[0] = UID_JPEGProcess14SV1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess1: + /* we prefer JPEGBaseline (default lossy for 8 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess2_4: + /* we prefer JPEGExtended (default lossy for 12 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess2_4TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000LosslessOnly: + /* we prefer JPEG2000 Lossless */ + transferSyntaxes[0] = UID_JPEG2000LosslessOnlyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000: + /* we prefer JPEG2000 Lossy */ + transferSyntaxes[0] = UID_JPEG2000TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossless: + /* we prefer JPEG-LS Lossless */ + transferSyntaxes[0] = UID_JPEGLSLosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossy: + /* we prefer JPEG-LS Lossy */ + transferSyntaxes[0] = UID_JPEGLSLossyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG2MainProfileAtMainLevel: + /* we prefer MPEG2 MP@ML */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG2MainProfileAtHighLevel: + /* we prefer MPEG2 MP@HL */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtHighLevelTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_1: + /* we prefer MPEG4 HP/L4.1 */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4BDcompatibleHighProfileLevel4_1: + /* we prefer MPEG4 BD HP/L4.1 */ + transferSyntaxes[0] = UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_2_For2DVideo: + /* we prefer MPEG4 HP/L4.2 for 2d Videos */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_2_For3DVideo: + /* we prefer MPEG4 HP/L4.2 for 3d Videos */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4StereoHighProfileLevel4_2: + /* we prefer MPEG4 Stereo HP/L4.2 */ + transferSyntaxes[0] = UID_MPEG4StereoHighProfileLevel4_2TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_HEVCMainProfileLevel5_1: + /* we prefer HEVC/H.265 Main Profile/L5.1 */ + transferSyntaxes[0] = UID_HEVCMainProfileLevel5_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_HEVCMain10ProfileLevel5_1: + /* we prefer HEVC/H.265 Main 10 Profile/L5.1 */ + transferSyntaxes[0] = UID_HEVCMain10ProfileLevel5_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_RLELossless: + /* we prefer RLE Lossless */ + transferSyntaxes[0] = UID_RLELosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#ifdef WITH_ZLIB + case EXS_DeflatedLittleEndianExplicit: + /* we prefer Deflated Explicit VR Little Endian */ + transferSyntaxes[0] = UID_DeflatedExplicitVRLittleEndianTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#endif + default: + if (opt_acceptAllXfers) + { + /* we accept all supported transfer syntaxes + * (similar to "AnyTransferSyntax" in "storescp.cfg") + */ + transferSyntaxes[0] = UID_JPEG2000TransferSyntax; + transferSyntaxes[1] = UID_JPEG2000LosslessOnlyTransferSyntax; + transferSyntaxes[2] = UID_JPEGProcess2_4TransferSyntax; + transferSyntaxes[3] = UID_JPEGProcess1TransferSyntax; + transferSyntaxes[4] = UID_JPEGProcess14SV1TransferSyntax; + transferSyntaxes[5] = UID_JPEGLSLossyTransferSyntax; + transferSyntaxes[6] = UID_JPEGLSLosslessTransferSyntax; + transferSyntaxes[7] = UID_RLELosslessTransferSyntax; + transferSyntaxes[8] = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + transferSyntaxes[9] = UID_MPEG2MainProfileAtHighLevelTransferSyntax; + transferSyntaxes[10] = UID_MPEG4HighProfileLevel4_1TransferSyntax; + transferSyntaxes[11] = UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax; + transferSyntaxes[12] = UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax; + transferSyntaxes[13] = UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax; + transferSyntaxes[14] = UID_MPEG4StereoHighProfileLevel4_2TransferSyntax; + transferSyntaxes[15] = UID_HEVCMainProfileLevel5_1TransferSyntax; + transferSyntaxes[16] = UID_HEVCMain10ProfileLevel5_1TransferSyntax; + transferSyntaxes[17] = UID_DeflatedExplicitVRLittleEndianTransferSyntax; + if (gLocalByteOrder == EBO_LittleEndian) + { + transferSyntaxes[18] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[19] = UID_BigEndianExplicitTransferSyntax; + } else { + transferSyntaxes[18] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[19] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[20] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 21; + } else { + /* We prefer explicit transfer syntaxes. + * If we are running on a Little Endian machine we prefer + * LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + */ + if (gLocalByteOrder == EBO_LittleEndian) /* defined in dcxfer.h */ + { + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } + else + { + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + } + break; + } + + if (opt_profileName) + { + /* perform name mangling for config file key */ + const unsigned char *c = OFreinterpret_cast(const unsigned char *, opt_profileName); + while (*c) + { + if (!isspace(*c)) sprofile += OFstatic_cast(char, toupper(*c)); + ++c; + } + + /* set presentation contexts as defined in config file */ + cond = asccfg.evaluateAssociationParameters(sprofile.c_str(), *assoc); + if (cond.bad()) + { + OFLOG_DEBUG(storescpLogger, DimseCondition::dump(temp_str, cond)); + goto cleanup; + } + } + else + { + /* accept the Verification SOP Class if presented */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( assoc->params, knownAbstractSyntaxes, DIM_OF(knownAbstractSyntaxes), transferSyntaxes, numTransferSyntaxes); + if (cond.bad()) + { + OFLOG_DEBUG(storescpLogger, DimseCondition::dump(temp_str, cond)); + goto cleanup; + } + + /* the array of Storage SOP Class UIDs comes from dcuid.h */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( assoc->params, dcmAllStorageSOPClassUIDs, numberOfDcmAllStorageSOPClassUIDs, transferSyntaxes, numTransferSyntaxes); + if (cond.bad()) + { + OFLOG_DEBUG(storescpLogger, DimseCondition::dump(temp_str, cond)); + goto cleanup; + } + + if (opt_promiscuous) + { + /* accept everything not known not to be a storage SOP class */ + cond = acceptUnknownContextsWithPreferredTransferSyntaxes( + assoc->params, transferSyntaxes, numTransferSyntaxes); + if (cond.bad()) + { + OFLOG_DEBUG(storescpLogger, DimseCondition::dump(temp_str, cond)); + goto cleanup; + } + } + } + + /* set our app title */ + ASC_setAPTitles(assoc->params, NULL, NULL, opt_respondingAETitle); + + /* acknowledge or reject this association */ + cond = ASC_getApplicationContextName(assoc->params, buf, sizeof(buf)); + if ((cond.bad()) || strcmp(buf, UID_StandardApplicationContext) != 0) + { + /* reject: the application context name is not supported */ + T_ASC_RejectParameters rej = + { + ASC_RESULT_REJECTEDPERMANENT, + ASC_SOURCE_SERVICEUSER, + ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED + }; + + OFLOG_INFO(storescpLogger, "Association Rejected: Bad Application Context Name: " << buf); + cond = ASC_rejectAssociation(assoc, &rej); + if (cond.bad()) + { + OFLOG_DEBUG(storescpLogger, DimseCondition::dump(temp_str, cond)); + } + goto cleanup; + + } + else if (opt_rejectWithoutImplementationUID && strlen(assoc->params->theirImplementationClassUID) == 0) + { + /* reject: the no implementation Class UID provided */ + T_ASC_RejectParameters rej = + { + ASC_RESULT_REJECTEDPERMANENT, + ASC_SOURCE_SERVICEUSER, + ASC_REASON_SU_NOREASON + }; + + OFLOG_INFO(storescpLogger, "Association Rejected: No Implementation Class UID provided"); + cond = ASC_rejectAssociation(assoc, &rej); + if (cond.bad()) + { + OFLOG_DEBUG(storescpLogger, DimseCondition::dump(temp_str, cond)); + } + goto cleanup; + } + else + { +#ifdef PRIVATE_STORESCP_CODE + PRIVATE_STORESCP_CODE +#endif + cond = ASC_acknowledgeAssociation(assoc); + if (cond.bad()) + { + OFLOG_ERROR(storescpLogger, DimseCondition::dump(temp_str, cond)); + goto cleanup; + } + OFLOG_INFO(storescpLogger, "Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")"); + if (ASC_countAcceptedPresentationContexts(assoc->params) == 0) + OFLOG_INFO(storescpLogger, " (but no valid presentation contexts)"); + /* dump the presentation contexts which have been accepted/refused */ + if (opt_showPresentationContexts) + OFLOG_INFO(storescpLogger, ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_AC)); + else + OFLOG_DEBUG(storescpLogger, ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_AC)); + } + +#ifdef BUGGY_IMPLEMENTATION_CLASS_UID_PREFIX + /* active the dcmPeerRequiresExactUIDCopy workaround code + * (see comments in dimse.h) for a implementation class UID + * prefix known to exhibit the buggy behaviour. + */ + if (0 == strncmp(assoc->params->theirImplementationClassUID, + BUGGY_IMPLEMENTATION_CLASS_UID_PREFIX, + strlen(BUGGY_IMPLEMENTATION_CLASS_UID_PREFIX))) + { + dcmEnableAutomaticInputDataCorrection.set(OFFalse); + dcmPeerRequiresExactUIDCopy.set(OFTrue); + } +#endif + + // store previous values for later use + lastCallingAETitle = callingAETitle; + lastCalledAETitle = calledAETitle; + lastCallingPresentationAddress = callingPresentationAddress; + // store calling and called aetitle in global variables to enable + // the --exec options using them. Enclose in quotation marks because + // aetitles may contain space characters. + DIC_AE callingTitle; + DIC_AE calledTitle; + if (ASC_getAPTitles(assoc->params, callingTitle, sizeof(callingTitle), calledTitle, sizeof(calledTitle), NULL, 0).good()) + { + callingAETitle = "\""; + callingAETitle += OFSTRING_GUARD(callingTitle); + callingAETitle += "\""; + calledAETitle = "\""; + calledAETitle += OFSTRING_GUARD(calledTitle); + calledAETitle += "\""; + } + else + { + // should never happen + callingAETitle.clear(); + calledAETitle.clear(); + } + // store calling presentation address (i.e. remote hostname) + callingPresentationAddress = OFSTRING_GUARD(assoc->params->DULparams.callingPresentationAddress); + + /* now do the real work, i.e. receive DIMSE commands over the network connection */ + /* which was established and handle these commands correspondingly. In case of */ + /* storescp only C-ECHO-RQ and C-STORE-RQ commands can be processed. */ + cond = processCommands(assoc); + + if (cond == DUL_PEERREQUESTEDRELEASE) + { + OFLOG_INFO(storescpLogger, "Association Release"); + cond = ASC_acknowledgeRelease(assoc); + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + OFLOG_INFO(storescpLogger, "Association Aborted"); + } + else + { + OFLOG_ERROR(storescpLogger, "DIMSE failure (aborting association): " << DimseCondition::dump(temp_str, cond)); + /* some kind of error so abort the association */ + cond = ASC_abortAssociation(assoc); + } + +cleanup: + + if (cond.code() == DULC_FORKEDCHILD) return cond; + + cond = ASC_dropSCPAssociation(assoc); + if (cond.bad()) + { + OFLOG_FATAL(storescpLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) + { + OFLOG_FATAL(storescpLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + + return cond; +} + + +static OFCondition +processCommands(T_ASC_Association * assoc) + /* + * This function receives DIMSE commands over the network connection + * and handles these commands correspondingly. Note that in case of + * storescp only C-ECHO-RQ and C-STORE-RQ commands can be processed. + * + * Parameters: + * assoc - [in] The association (network connection to another DICOM application). + */ +{ + OFCondition cond = EC_Normal; + T_DIMSE_Message msg; + T_ASC_PresentationContextID presID = 0; + DcmDataset *statusDetail = NULL; + + // start a loop to be able to receive more than one DIMSE command + while( cond == EC_Normal || cond == DIMSE_NODATAAVAILABLE || cond == DIMSE_OUTOFRESOURCES ) + { + // receive a DIMSE command over the network + if( opt_endOfStudyTimeout == -1 ) + cond = DIMSE_receiveCommand(assoc, DIMSE_BLOCKING, 0, &presID, &msg, &statusDetail); + else + cond = DIMSE_receiveCommand(assoc, DIMSE_NONBLOCKING, OFstatic_cast(int, opt_endOfStudyTimeout), &presID, &msg, &statusDetail); + + // check what kind of error occurred. If no data was + // received, check if certain other conditions are met + if( cond == DIMSE_NODATAAVAILABLE ) + { + // If in addition to the fact that no data was received also option --eostudy-timeout is set and + // if at the same time there is still a study which is considered to be open (i.e. we were actually + // expecting to receive more objects that belong to this study) (this is the case if lastStudyInstanceUID + // does not equal NULL), we have to consider that all objects for the current study have been received. + // In such an "end-of-study" case, we might have to execute certain optional functions which were specified + // by the user through command line options passed to storescp. + if( opt_endOfStudyTimeout != -1 && !lastStudyInstanceUID.empty() ) + { + // indicate that the end-of-study-event occurred through a timeout event. + // This knowledge will be necessary in function renameOnEndOFStudy(). + endOfStudyThroughTimeoutEvent = OFTrue; + + // before we actually execute those optional functions, we need to determine the path and name + // of the subdirectory into which the DICOM files for the last study were written. + lastStudySubdirectoryPathAndName = subdirectoryPathAndName; + + // now we can finally handle end-of-study events which might have to be executed + executeEndOfStudyEvents(); + + // also, we need to clear lastStudyInstanceUID to indicate + // that the last study is not considered to be open any more. + lastStudyInstanceUID.clear(); + + // also, we need to clear subdirectoryPathAndName + subdirectoryPathAndName.clear(); + + // reset the endOfStudyThroughTimeoutEvent variable. + endOfStudyThroughTimeoutEvent = OFFalse; + } + } + + // if the command which was received has extra status + // detail information, dump this information + if (statusDetail != NULL) + { + OFLOG_DEBUG(storescpLogger, "Status Detail:" << OFendl << DcmObject::PrintHelper(*statusDetail)); + delete statusDetail; + } + + // check if peer did release or abort, or if we have a valid message + if (cond == EC_Normal) + { + // in case we received a valid message, process this command + // note that storescp can only process a C-ECHO-RQ and a C-STORE-RQ + switch (msg.CommandField) + { + case DIMSE_C_ECHO_RQ: + // process C-ECHO-Request + cond = echoSCP(assoc, &msg, presID); + break; + case DIMSE_C_STORE_RQ: + // process C-STORE-Request + cond = storeSCP(assoc, &msg, presID); + break; + default: + OFString tempStr; + // we cannot handle this kind of message + cond = DIMSE_BADCOMMANDTYPE; + OFLOG_ERROR(storescpLogger, "Expected C-ECHO or C-STORE request but received DIMSE command 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4) + << OFstatic_cast(unsigned, msg.CommandField)); + OFLOG_DEBUG(storescpLogger, DIMSE_dumpMessage(tempStr, msg, DIMSE_INCOMING, NULL, presID)); + break; + } + } + } + return cond; +} + + +static OFCondition echoSCP( T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) +{ + OFString temp_str; + // assign the actual information of the C-Echo-RQ command to a local variable + T_DIMSE_C_EchoRQ *req = &msg->msg.CEchoRQ; + if (storescpLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + OFLOG_INFO(storescpLogger, "Received Echo Request"); + OFLOG_DEBUG(storescpLogger, DIMSE_dumpMessage(temp_str, *req, DIMSE_INCOMING, NULL, presID)); + } else { + OFLOG_INFO(storescpLogger, "Received Echo Request (MsgID " << req->MessageID << ")"); + } + + /* the echo succeeded !! */ + OFCondition cond = DIMSE_sendEchoResponse(assoc, presID, req, STATUS_Success, NULL); + if (cond.bad()) + { + OFLOG_ERROR(storescpLogger, "Echo SCP Failed: " << DimseCondition::dump(temp_str, cond)); + } + return cond; +} + +// substitute non-ASCII characters with ASCII "equivalents" +static void mapCharacterAndAppendToString(Uint8 c, + OFString &output) +{ + static const char *latin1_table[] = + { + "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", // Codes 0-15 + "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", // Codes 16-31 + "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", // Codes 32-47 + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "_", "_", "_", "_", "_", "_", // Codes 48-63 + "_", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", // Codes 64-79 + "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "_", "_", "_", "_", "_", // Codes 80-95 + "_", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", // Codes 96-111 + "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "_", "_", "_", "_", "_", // Codes 112-127 + "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", // Codes 128-143 + "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", // Codes 144-159 + "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", // Codes 160-175 + "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", // Codes 176-191 + "A", "A", "A", "A", "Ae","A", "A", "C", "E", "E", "E", "E", "I", "I", "I", "I", // Codes 192-107 + "D", "N", "O", "O", "O", "O", "Oe","_", "O", "U", "U", "U", "Ue","Y", "_", "ss",// Codes 108-123 + "a", "a", "a", "a", "ae","a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", // Codes 124-141 + "d", "n", "o", "o", "o", "o", "oe","_", "o", "u", "u", "u", "ue","y", "_", "y" // Codes 142-157 + }; + output += latin1_table[c]; +} + +struct StoreCallbackData +{ + char* imageFileName; + DcmFileFormat* dcmff; + T_ASC_Association* assoc; +}; + + +static void +storeSCPCallback( + void *callbackData, + T_DIMSE_StoreProgress *progress, + T_DIMSE_C_StoreRQ *req, + char * /*imageFileName*/, DcmDataset **imageDataSet, + T_DIMSE_C_StoreRSP *rsp, + DcmDataset **statusDetail) + /* + * This function.is used to indicate progress when storescp receives instance data over the + * network. On the final call to this function (identified by progress->state == DIMSE_StoreEnd) + * this function will store the data set which was received over the network to a file. + * Earlier calls to this function will simply cause some information to be dumped to stdout. + * + * Parameters: + * callbackData - [in] data for this callback function + * progress - [in] The state of progress. (identifies if this is the initial or final call + * to this function, or a call in between these two calls. + * req - [in] The original store request message. + * imageFileName - [in] The path to and name of the file the information shall be written to. + * imageDataSet - [in] The data set which shall be stored in the image file + * rsp - [inout] the C-STORE-RSP message (will be sent after the call to this function) + * statusDetail - [inout] This variable can be used to capture detailed information with regard to + * the status information which is captured in the status element (0000,0900). Note + * that this function does specify any such information, the pointer will be set to NULL. + */ +{ + DIC_UI sopClass; + DIC_UI sopInstance; + + // determine if the association shall be aborted + if( (opt_abortDuringStore && progress->state != DIMSE_StoreBegin) || + (opt_abortAfterStore && progress->state == DIMSE_StoreEnd) ) + { + OFLOG_INFO(storescpLogger, "ABORT initiated (due to command line options)"); + ASC_abortAssociation((OFstatic_cast(StoreCallbackData*, callbackData))->assoc); + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + return; + } + + // if opt_sleepAfter is set, the user requires that the application shall + // sleep a certain amount of seconds after having received one PDU. + if (opt_sleepDuring > 0) + { + OFStandard::sleep(OFstatic_cast(unsigned int, opt_sleepDuring)); + } + + // dump some information if required (depending on the progress state) + // We can't use oflog for the PDU output, but we use a special logger for + // generating this output. If it is set to level "INFO" we generate the + // output, if it's set to "DEBUG" then we'll assume that there is debug output + // generated for each PDU elsewhere. + OFLogger progressLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION ".progress"); + if (progressLogger.getChainedLogLevel() == OFLogger::INFO_LOG_LEVEL) + { + switch (progress->state) + { + case DIMSE_StoreBegin: + COUT << "RECV: "; + break; + case DIMSE_StoreEnd: + COUT << OFendl; + break; + default: + COUT << '.'; + break; + } + COUT.flush(); + } + + // if this is the final call of this function, save the data which was received to a file + // (note that we could also save the image somewhere else, put it in database, etc.) + if (progress->state == DIMSE_StoreEnd) + { + OFString tmpStr; + + // do not send status detail information + *statusDetail = NULL; + + // remember callback data + StoreCallbackData *cbdata = OFstatic_cast(StoreCallbackData *, callbackData); + + // Concerning the following line: an appropriate status code is already set in the resp structure, + // it need not be success. For example, if the caller has already detected an out of resources problem + // then the status will reflect this. The callback function is still called to allow cleanup. + //rsp->DimseStatus = STATUS_Success; + + // we want to write the received information to a file only if this information + // is present and the options opt_bitPreserving and opt_ignore are not set. + if ((imageDataSet != NULL) && (*imageDataSet != NULL) && !opt_bitPreserving && !opt_ignore) + { + OFString fileName; + + // in case one of the --sort-xxx options is set, we need to perform some particular steps to + // determine the actual name of the output file + if (opt_sortStudyMode != ESM_None) + { + // determine the study instance UID in the (current) DICOM object that has just been received + OFString currentStudyInstanceUID; + if ((*imageDataSet)->findAndGetOFString(DCM_StudyInstanceUID, currentStudyInstanceUID).bad() || currentStudyInstanceUID.empty()) + { + OFLOG_ERROR(storescpLogger, "element StudyInstanceUID " << DCM_StudyInstanceUID << " absent or empty in data set"); + rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; + return; + } + + // if --sort-on-patientname is active, we need to extract the + // patient's name (format: last_name^first_name) + OFString currentPatientName; + if (opt_sortStudyMode == ESM_PatientName) + { + OFString tmpName; + if ((*imageDataSet)->findAndGetOFString(DCM_PatientName, tmpName).bad() || tmpName.empty()) + { + // default if patient name is missing or empty + tmpName = "ANONYMOUS"; + OFLOG_WARN(storescpLogger, "element PatientName " << DCM_PatientName << " absent or empty in data set, using '" + << tmpName << "' instead"); + } + else + { + DcmElement *patElem = NULL; + OFString charset; + (*imageDataSet)->findAndGetElement(DCM_PatientName, patElem); // patElem cannot be NULL, see above + (*imageDataSet)->findAndGetOFStringArray(DCM_SpecificCharacterSet, charset); + if (!charset.empty() && !(charset == "ISO_IR 100") && (patElem->containsExtendedCharacters())) + { + OFLOG_WARN(storescpLogger, "Patient name not in Latin-1 (charset: " << charset << "), ASCII dir name may be broken"); + } + } + + /* substitute non-ASCII characters in patient name to ASCII "equivalent" */ + const size_t length = tmpName.length(); + for (size_t i = 0; i < length; i++) + mapCharacterAndAppendToString(tmpName[i], currentPatientName); + } + + // if this is the first DICOM object that was received or if the study instance UID in the + // current DICOM object does not equal the last object's study instance UID we need to create + // a new subdirectory in which the current DICOM object will be stored + if (lastStudyInstanceUID.empty() || (lastStudyInstanceUID != currentStudyInstanceUID)) + { + // if lastStudyInstanceUID is non-empty, we have just completed receiving all objects for one + // study. In such a case, we need to set a certain indicator variable (lastStudySubdirectoryPathAndName), + // so that we know that executeOnEndOfStudy() might have to be executed later. In detail, this indicator + // variable will contain the path and name of the last study's subdirectory, so that we can still remember + // this directory, when we execute executeOnEndOfStudy(). The memory that is allocated for this variable + // here will be freed after the execution of executeOnEndOfStudy(). + if (!lastStudyInstanceUID.empty()) + lastStudySubdirectoryPathAndName = subdirectoryPathAndName; + + // create the new lastStudyInstanceUID value according to the value in the current DICOM object + lastStudyInstanceUID = currentStudyInstanceUID; + + // get the current time (needed for subdirectory name) + OFDateTime dateTime; + dateTime.setCurrentDateTime(); + + // create a name for the new subdirectory. + char timestamp[32]; + sprintf(timestamp, "%04u%02u%02u_%02u%02u%02u%03u", + dateTime.getDate().getYear(), dateTime.getDate().getMonth(), dateTime.getDate().getDay(), + dateTime.getTime().getHour(), dateTime.getTime().getMinute(), dateTime.getTime().getIntSecond(), dateTime.getTime().getMilliSecond()); + + OFString subdirectoryName; + switch (opt_sortStudyMode) + { + case ESM_Timestamp: + // pattern: "[prefix]_[YYYYMMDD]_[HHMMSSMMM]" + subdirectoryName = opt_sortStudyDirPrefix; + if (!subdirectoryName.empty()) + subdirectoryName += '_'; + subdirectoryName += timestamp; + break; + case ESM_StudyInstanceUID: + // pattern: "[prefix]_[Study Instance UID]" + subdirectoryName = opt_sortStudyDirPrefix; + if (!subdirectoryName.empty()) + subdirectoryName += '_'; + subdirectoryName += currentStudyInstanceUID; + break; + case ESM_PatientName: + // pattern: "[Patient's Name]_[YYYYMMDD]_[HHMMSSMMM]" + subdirectoryName = currentPatientName; + subdirectoryName += '_'; + subdirectoryName += timestamp; + break; + case ESM_None: + break; + } + + // create subdirectoryPathAndName (string with full path to new subdirectory) + OFStandard::combineDirAndFilename(subdirectoryPathAndName, OFStandard::getDirNameFromPath(tmpStr, cbdata->imageFileName), subdirectoryName); + + // check if the subdirectory already exists + // if it already exists dump a warning + if( OFStandard::dirExists(subdirectoryPathAndName) ) + OFLOG_WARN(storescpLogger, "subdirectory for study already exists: " << subdirectoryPathAndName); + else + { + // if it does not exist create it + OFLOG_INFO(storescpLogger, "creating new subdirectory for study: " << subdirectoryPathAndName); +#ifdef HAVE_WINDOWS_H + if( _mkdir( subdirectoryPathAndName.c_str() ) == -1 ) +#else + if( mkdir( subdirectoryPathAndName.c_str(), S_IRWXU | S_IRWXG | S_IRWXO ) == -1 ) +#endif + { + OFLOG_ERROR(storescpLogger, "could not create subdirectory for study: " << subdirectoryPathAndName); + rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; + return; + } + // all objects of a study have been received, so a new subdirectory is started. + // ->timename counter can be reset, because the next filename can't cause a duplicate. + // if no reset would be done, files of a new study (->new directory) would start with a counter in filename + if (opt_timeNames) + timeNameCounter = -1; + } + } + + // integrate subdirectory name into file name (note that cbdata->imageFileName currently contains both + // path and file name; however, the path refers to the output directory captured in opt_outputDirectory) + OFStandard::combineDirAndFilename(fileName, subdirectoryPathAndName, OFStandard::getFilenameFromPath(tmpStr, cbdata->imageFileName)); + + // update global variable outputFileNameArray + // (might be used in executeOnReception() and renameOnEndOfStudy) + outputFileNameArray.push_back(tmpStr); + } + // if no --sort-xxx option is set, the determination of the output file name is simple + else + { + fileName = cbdata->imageFileName; + + // update global variables outputFileNameArray + // (might be used in executeOnReception() and renameOnEndOfStudy) + outputFileNameArray.push_back(OFStandard::getFilenameFromPath(tmpStr, fileName)); + } + + // determine the transfer syntax which shall be used to write the information to the file + E_TransferSyntax xfer = opt_writeTransferSyntax; + if (xfer == EXS_Unknown) xfer = (*imageDataSet)->getOriginalXfer(); + + // store file either with meta header or as pure dataset + OFLOG_INFO(storescpLogger, "storing DICOM file: " << fileName); + if (OFStandard::fileExists(fileName)) + { + OFLOG_WARN(storescpLogger, "DICOM file already exists, overwriting: " << fileName); + } + OFCondition cond = cbdata->dcmff->saveFile(fileName.c_str(), xfer, opt_sequenceType, opt_groupLength, + opt_paddingType, OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), + (opt_useMetaheader) ? EWM_fileformat : EWM_dataset); + if (cond.bad()) + { + OFLOG_ERROR(storescpLogger, "cannot write DICOM file: " << fileName << ": " << cond.text()); + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + + // delete incomplete file + OFStandard::deleteFile(fileName); + } + + // check the image to make sure it is consistent, i.e. that its sopClass and sopInstance correspond + // to those mentioned in the request. If not, set the status in the response message variable. + if (rsp->DimseStatus == STATUS_Success) + { + // which SOP class and SOP instance ? + if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding)) + { + OFLOG_ERROR(storescpLogger, "bad DICOM file: " << fileName); + rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; + } + else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + else if (strcmp(sopInstance, req->AffectedSOPInstanceUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + } + } + + // in case opt_bitPreserving is set, do some other things + if( opt_bitPreserving ) + { + // we need to set outputFileNameArray and outputFileNameArrayCnt to be + // able to perform the placeholder substitution in executeOnReception() + outputFileNameArray.push_back(OFStandard::getFilenameFromPath(tmpStr, cbdata->imageFileName)); + } + } +} + + +static OFCondition storeSCP( + T_ASC_Association *assoc, + T_DIMSE_Message *msg, + T_ASC_PresentationContextID presID) + /* + * This function processes a DIMSE C-STORE-RQ command that was + * received over the network connection. + * + * Parameters: + * assoc - [in] The association (network connection to another DICOM application). + * msg - [in] The DIMSE C-STORE-RQ message that was received. + * presID - [in] The ID of the presentation context which was specified in the PDV which contained + * the DIMSE command. + */ +{ + OFCondition cond = EC_Normal; + T_DIMSE_C_StoreRQ *req; + char imageFileName[2048]; + + // assign the actual information of the C-STORE-RQ command to a local variable + req = &msg->msg.CStoreRQ; + + // if opt_ignore is set, the user requires that the data shall be received but not + // stored. in this case, we want to create a corresponding temporary filename for + // a file in which the data shall be stored temporarily. If this is not the case, + // create a real filename (consisting of path and filename) for a real file. + if (opt_ignore) + { +#ifdef _WIN32 + tmpnam(imageFileName); +#else + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, 2048); +#endif + } + else + { + // 3 possibilities: create unique filenames (fn), create timestamp fn, create fn from SOP Instance UIDs + if (opt_uniqueFilenames) + { + // create unique filename by generating a temporary UID and using ".X." as an infix + char buf[70]; + dcmGenerateUniqueIdentifier(buf); + sprintf(imageFileName, "%s%c%s.X.%s%s", opt_outputDirectory.c_str(), PATH_SEPARATOR, dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "UNKNOWN"), + buf, opt_fileNameExtension.c_str()); + } + else if (opt_timeNames) + { + // create a name for the new file. pattern: "[YYYYMMDDHHMMSSMMM]_[NUMBER].MODALITY[EXTENSION]" (use current datetime) + // get the current time (needed for file name) + OFDateTime dateTime; + dateTime.setCurrentDateTime(); + // used to hold prospective filename + char cmpFileName[2048]; + // next if/else block generates prospective filename, that is compared to last written filename + if (timeNameCounter == -1) + { + // timeNameCounter not set -> last written filename has to be without "serial number" + sprintf(cmpFileName, "%04u%02u%02u%02u%02u%02u%03u.%s%s", + dateTime.getDate().getYear(), dateTime.getDate().getMonth(), dateTime.getDate().getDay(), + dateTime.getTime().getHour(), dateTime.getTime().getMinute(), dateTime.getTime().getIntSecond(), dateTime.getTime().getMilliSecond(), + dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "UNKNOWN"), opt_fileNameExtension.c_str()); + } + else + { + // counter was active before, so generate filename with "serial number" for comparison + sprintf(cmpFileName, "%04u%02u%02u%02u%02u%02u%03u_%04u.%s%s", // millisecond version + dateTime.getDate().getYear(), dateTime.getDate().getMonth(), dateTime.getDate().getDay(), + dateTime.getTime().getHour(), dateTime.getTime().getMinute(), dateTime.getTime().getIntSecond(), dateTime.getTime().getMilliSecond(), + timeNameCounter, dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "UNKNOWN"), opt_fileNameExtension.c_str()); + } + if ( (outputFileNameArray.size()!=0) && (outputFileNameArray.back() == cmpFileName) ) + { + // if this is not the first run and the prospective filename is equal to the last written filename + // generate one with a serial number (incremented by 1) + timeNameCounter++; + sprintf(imageFileName, "%s%c%04u%02u%02u%02u%02u%02u%03u_%04u.%s%s", opt_outputDirectory.c_str(), PATH_SEPARATOR, // millisecond version + dateTime.getDate().getYear(), dateTime.getDate().getMonth(), dateTime.getDate().getDay(), + dateTime.getTime().getHour(), dateTime.getTime().getMinute(), dateTime.getTime().getIntSecond(), dateTime.getTime().getMilliSecond(), + timeNameCounter, dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "UNKNOWN"), opt_fileNameExtension.c_str()); + } + else + { + // first run or filenames are different: create filename without serial number + sprintf(imageFileName, "%s%c%04u%02u%02u%02u%02u%02u%03u.%s%s", opt_outputDirectory.c_str(), PATH_SEPARATOR, // millisecond version + dateTime.getDate().getYear(), dateTime.getDate().getMonth(), dateTime.getDate().getDay(), + dateTime.getTime().getHour(), dateTime.getTime().getMinute(),dateTime.getTime().getIntSecond(), dateTime.getTime().getMilliSecond(), + dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "UNKNOWN"), opt_fileNameExtension.c_str()); + // reset counter, because timestamp and therefore filename has changed + timeNameCounter = -1; + } + } + else + { + // don't create new UID, use the study instance UID as found in object + sprintf(imageFileName, "%s%c%s.%s%s", opt_outputDirectory.c_str(), PATH_SEPARATOR, dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "UNKNOWN"), + req->AffectedSOPInstanceUID, opt_fileNameExtension.c_str()); + } + } + + // dump some information if required + OFString str; + if (storescpLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + OFLOG_INFO(storescpLogger, "Received Store Request"); + OFLOG_DEBUG(storescpLogger, DIMSE_dumpMessage(str, *req, DIMSE_INCOMING, NULL, presID)); + } else { + OFLOG_INFO(storescpLogger, "Received Store Request (MsgID " << req->MessageID << ", " + << dcmSOPClassUIDToModality(req->AffectedSOPClassUID, "OT") << ")"); + } + + // initialize some variables + StoreCallbackData callbackData; + callbackData.assoc = assoc; + callbackData.imageFileName = imageFileName; + DcmFileFormat dcmff; + callbackData.dcmff = &dcmff; + + // store SourceApplicationEntityTitle in metaheader + if (assoc && assoc->params) + { + const char *aet = assoc->params->DULparams.callingAPTitle; + if (aet) dcmff.getMetaInfo()->putAndInsertString(DCM_SourceApplicationEntityTitle, aet); + } + + // define an address where the information which will be received over the network will be stored + DcmDataset *dset = dcmff.getDataset(); + + // if opt_bitPreserving is set, the user requires that the data shall be + // written exactly as it was received. Depending on this option, function + // DIMSE_storeProvider must be called with certain parameters. + if (opt_bitPreserving) + { + cond = DIMSE_storeProvider(assoc, presID, req, imageFileName, opt_useMetaheader, NULL, + storeSCPCallback, &callbackData, opt_blockMode, opt_dimse_timeout); + } + else + { + cond = DIMSE_storeProvider(assoc, presID, req, NULL, opt_useMetaheader, &dset, + storeSCPCallback, &callbackData, opt_blockMode, opt_dimse_timeout); + } + + // if some error occurred, dump corresponding information and remove the outfile if necessary + if (cond.bad()) + { + OFString temp_str; + OFLOG_ERROR(storescpLogger, "Store SCP Failed: " << DimseCondition::dump(temp_str, cond)); + // remove file + if (!opt_ignore) + { + if (strcmp(imageFileName, NULL_DEVICE_NAME) != 0) + OFStandard::deleteFile(imageFileName); + } + } +#ifdef _WIN32 + else if (opt_ignore) + { + if (strcmp(imageFileName, NULL_DEVICE_NAME) != 0) + OFStandard::deleteFile(imageFileName); // delete the temporary file + } +#endif + + // if everything was successful so far and option --exec-on-reception is set, + // we want to execute a certain command which was passed to the application + if( cond.good() && opt_execOnReception != NULL ) + executeOnReception(); + + // if everything was successful so far, go ahead and handle possible end-of-study events + if( cond.good() ) + executeEndOfStudyEvents(); + + // if opt_sleepAfter is set, the user requires that the application shall + // sleep a certain amount of seconds after storing the instance data. + if (opt_sleepAfter > 0) + { + OFStandard::sleep(OFstatic_cast(unsigned int, opt_sleepAfter)); + } + + // return return value + return cond; +} + + +static void executeEndOfStudyEvents() + /* + * This function deals with the execution of end-of-study-events. In detail, + * events that need to take place are specified by the user through certain + * command line options. The options that define these end-of-study-events + * are "--rename-on-eostudy" and "--exec-on-eostudy". + * + * Parameters: + * none. + */ +{ + // if option --rename-on-eostudy is set and variable lastStudySubdirectoryPathAndName + // does not equal NULL (i.e. we received all objects that belong to one study, or - in + // other words - it is the end of one study) we want to rename the output files that + // belong to the last study. (Note that these files are captured in outputFileNameArray) + if( opt_renameOnEndOfStudy && !lastStudySubdirectoryPathAndName.empty() ) + renameOnEndOfStudy(); + + // if option --exec-on-eostudy is set and variable lastStudySubdirectoryPathAndName does + // not equal NULL (i.e. we received all objects that belong to one study, or - in other + // words - it is the end of one study) we want to execute a certain command which was + // passed to the application + if( opt_execOnEndOfStudy != NULL && !lastStudySubdirectoryPathAndName.empty() ) + executeOnEndOfStudy(); + + lastStudySubdirectoryPathAndName.clear(); +} + + +static void executeOnReception() + /* + * This function deals with the execution of the command line which was passed + * to option --exec-on-reception of the storescp. This command line is captured + * in opt_execOnReception. Note that the command line can contain the placeholders + * PATH_PLACEHOLDER and FILENAME_PLACEHOLDER which need to be substituted before the command line is actually + * executed. PATH_PLACEHOLDER will be substituted by the path to the output directory into which + * the last file was written; FILENAME_PLACEHOLDER will be substituted by the filename of the last + * file which was written. + * + * Parameters: + * none. + */ +{ + OFString cmd = opt_execOnReception; + + // in case a file was actually written + if( !opt_ignore ) + { + // perform substitution for placeholder #p (depending on presence of any --sort-xxx option) + OFString dir = (opt_sortStudyMode == ESM_None) ? opt_outputDirectory : subdirectoryPathAndName; + cmd = replaceChars( cmd, OFString(PATH_PLACEHOLDER), dir ); + + // perform substitution for placeholder #f; note that outputFileNameArray.back() + // always contains the name of the file (without path) which was written last. + OFString outputFileName = outputFileNameArray.back(); + cmd = replaceChars( cmd, OFString(FILENAME_PLACEHOLDER), outputFileName ); + } + + // perform substitution for placeholder #a + cmd = replaceChars( cmd, OFString(CALLING_AETITLE_PLACEHOLDER), callingAETitle ); + + // perform substitution for placeholder #c + cmd = replaceChars( cmd, OFString(CALLED_AETITLE_PLACEHOLDER), calledAETitle ); + + // perform substitution for placeholder #r + cmd = replaceChars( cmd, OFString(CALLING_PRESENTATION_ADDRESS_PLACEHOLDER), callingPresentationAddress ); + + // Execute command in a new process + executeCommand( cmd ); +} + + +static void renameOnEndOfStudy() + /* + * This function deals with renaming the last study's output files. In detail, these file's + * current filenames will be changed to a filename that corresponds to the pattern [modality- + * prefix][consecutive-numbering]. The current filenames of all files that belong to the study + * are captured in outputFileNameArray. The new filenames will be calculated within this + * function: The [modality-prefix] will be taken from the old filename, + * [consecutive-numbering] is a consecutively numbered, 6 digit number which will be calculated + * starting from 000001. + * + * Parameters: + * none. + */ +{ + int counter = 1; + + OFListIterator(OFString) first = outputFileNameArray.begin(); + OFListIterator(OFString) last = outputFileNameArray.end(); + + // before we deal with all the filenames which are included in the array, we need to distinguish + // two different cases: If endOfStudyThroughTimeoutEvent is not true, the last filename in the array + // refers to a file that belongs to a new study of which the first object was just received. (In this + // case there are at least two filenames in the array). Then, this last filename is - at the end of the + // following loop - not supposed to be deleted from the array. If endOfStudyThroughTimeoutEvent is true, + // all filenames that are captured in the array, refer to files that belong to the same study. Hence, + // all of these files shall be renamed and all of the filenames within the array shall be deleted. + if( !endOfStudyThroughTimeoutEvent ) --last; + + // rename all files that belong to the last study + while (first != last) + { + // determine the new file name: The first two characters of the old file name make up the [modality-prefix]. + // The value for [consecutive-numbering] will be determined using the counter variable. + char modalityId[3]; + char newFileName[20]; + if (opt_timeNames) + { + // modality prefix are the first 2 characters after serial number (if present) + size_t serialPos = (*first).find("_"); + if (serialPos != OFString_npos) + { + //serial present: copy modality prefix (skip serial: 1 digit "_" + 4 digits serial + 1 digit ".") + OFStandard::strlcpy( modalityId, (*first).substr(serialPos+6, 2).c_str(), 3 ); + } + else + { + //serial not present, copy starts directly after first "." (skip 17 for timestamp, one for ".") + OFStandard::strlcpy( modalityId, (*first).substr(18, 2).c_str(), 3 ); + } + } + else + { + OFStandard::strlcpy( modalityId, (*first).c_str(), 3 ); + } + sprintf( newFileName, "%s%06d", modalityId, counter ); + + // create two strings containing path and file name for + // the current filename and the future filename + OFString oldPathAndFileName; + oldPathAndFileName = lastStudySubdirectoryPathAndName; + oldPathAndFileName += PATH_SEPARATOR; + oldPathAndFileName += *first; + + OFString newPathAndFileName; + newPathAndFileName = lastStudySubdirectoryPathAndName; + newPathAndFileName += PATH_SEPARATOR; + newPathAndFileName += newFileName; + + // rename file + if( rename( oldPathAndFileName.c_str(), newPathAndFileName.c_str() ) != 0 ) + OFLOG_WARN(storescpLogger, "cannot rename file '" << oldPathAndFileName << "' to '" << newPathAndFileName << "'"); + + // remove entry from list + first = outputFileNameArray.erase(first); + + // increase counter + counter++; + } +} + + +static void executeOnEndOfStudy() + /* + * This function deals with the execution of the command line which was passed + * to option --exec-on-eostudy of the storescp. This command line is captured + * in opt_execOnEndOfStudy. Note that the command line can contain the placeholder + * PATH_PLACEHOLDER which needs to be substituted before the command line is actually executed. + * In detail, PATH_PLACEHOLDER will be substituted by the path to the output directory into which + * the files of the last study were written. + * + * Parameters: + * none. + */ +{ + OFString cmd = opt_execOnEndOfStudy; + + // perform substitution for placeholder #p; #p will be substituted by lastStudySubdirectoryPathAndName + cmd = replaceChars( cmd, OFString(PATH_PLACEHOLDER), lastStudySubdirectoryPathAndName ); + + // perform substitution for placeholder #a + cmd = replaceChars( cmd, OFString(CALLING_AETITLE_PLACEHOLDER), (endOfStudyThroughTimeoutEvent) ? callingAETitle : lastCallingAETitle ); + + // perform substitution for placeholder #c + cmd = replaceChars( cmd, OFString(CALLED_AETITLE_PLACEHOLDER), (endOfStudyThroughTimeoutEvent) ? calledAETitle : lastCalledAETitle ); + + // perform substitution for placeholder #r + cmd = replaceChars( cmd, OFString(CALLING_PRESENTATION_ADDRESS_PLACEHOLDER), (endOfStudyThroughTimeoutEvent) ? callingPresentationAddress : lastCallingPresentationAddress ); + + // Execute command in a new process + executeCommand( cmd ); +} + + +static OFString replaceChars( const OFString &srcstr, const OFString &pattern, const OFString &substitute ) + /* + * This function replaces all occurrences of pattern in srcstr with substitute and returns + * the result as a new OFString variable. Note that srcstr itself will not be changed, + * + * Parameters: + * srcstr - [in] The source string. + * pattern - [in] The pattern string which shall be substituted. + * substitute - [in] The substitute for pattern in srcstr. + */ +{ + OFString result = srcstr; + size_t pos = 0; + + while( pos != OFString_npos ) + { + pos = result.find( pattern, pos ); + + if( pos != OFString_npos ) + { + result.replace( pos, pattern.size(), substitute ); + pos += substitute.size(); + } + } + + return( result ); +} + + +static void executeCommand( const OFString &cmd ) + /* + * This function executes the given command line. The execution will be + * performed in a new process which can be run in the background + * so that it does not slow down the execution of storescp. + * + * Parameters: + * cmd - [in] The command which shall be executed. + */ +{ +#ifdef HAVE_FORK + pid_t pid = fork(); + if( pid < 0 ) // in case fork failed, dump an error message + OFLOG_ERROR(storescpLogger, "cannot execute command '" << cmd << "' (fork failed)"); + else if (pid > 0) + { + /* we are the parent process */ + /* remove pending zombie child processes */ + cleanChildren(pid, opt_execSync); + } + else // in case we are the child process, execute the command etc. + { + // execute command through execl will terminate the child process. + // Since we only have a single command string and not a list of arguments, + // we 'emulate' a call to system() by passing the command to /bin/sh + // which hopefully exists on all Posix systems. + + if (execl( "/bin/sh", "/bin/sh", "-c", cmd.c_str(), OFreinterpret_cast(char *, 0) ) < 0) + OFLOG_ERROR(storescpLogger, "cannot execute /bin/sh"); + + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + + // execute command (Attention: Do not pass DETACHED_PROCESS as sixth argument to the below + // called function because in such a case the execution of batch-files is not going to work.) + if( !CreateProcess(NULL, OFconst_cast(char *, cmd.c_str()), NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo) ) + OFLOG_ERROR(storescpLogger, "cannot execute command '" << cmd << "'"); + + if (opt_execSync) + { + // Wait until child process exits (makes execution synchronous) + WaitForSingleObject(procinfo.hProcess, INFINITE); + } + + // Close process and thread handles to avoid resource leak + CloseHandle(procinfo.hProcess); + CloseHandle(procinfo.hThread); +#endif +} + + +static void cleanChildren(pid_t pid, OFBool synch) + /* + * This function removes child processes that have terminated, + * i.e. converted to zombies. Should be called now and then. + */ +{ +#ifdef HAVE_WAITPID + int stat_loc; +#elif defined(HAVE_WAIT3) + struct rusage rusage; +#if defined(__NeXT__) + /* some systems need a union wait as argument to wait3 */ + union wait status; +#else + int status; +#endif +#endif + +#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) + int child = 1; + int options = synch ? 0 : WNOHANG; + while (child > 0) + { +#ifdef HAVE_WAITPID + child = OFstatic_cast(int, waitpid(pid, &stat_loc, options)); +#elif defined(HAVE_WAIT3) + child = wait3(&status, options, &rusage); +#endif + if (child < 0) + { + if (errno != ECHILD) + { + char buf[256]; + OFLOG_WARN(storescpLogger, "wait for child failed: " << OFStandard::strerror(errno, buf, sizeof(buf))); + } + } + + if (synch) child = -1; // break out of loop + } +#endif +} + + +static +DUL_PRESENTATIONCONTEXT * +findPresentationContextID(LST_HEAD * head, + T_ASC_PresentationContextID presentationContextID) +{ + DUL_PRESENTATIONCONTEXT *pc; + LST_HEAD **l; + OFBool found = OFFalse; + + if (head == NULL) + return NULL; + + l = &head; + if (*l == NULL) + return NULL; + + pc = OFstatic_cast(DUL_PRESENTATIONCONTEXT *, LST_Head(l)); + (void)LST_Position(l, OFstatic_cast(LST_NODE *, pc)); + + while (pc && !found) { + if (pc->presentationContextID == presentationContextID) { + found = OFTrue; + } else { + pc = OFstatic_cast(DUL_PRESENTATIONCONTEXT *, LST_Next(l)); + } + } + return pc; +} + + +/** accept all presentation contexts for unknown SOP classes, + * i.e. UIDs appearing in the list of abstract syntaxes + * where no corresponding name is defined in the UID dictionary. + * @param params pointer to association parameters structure + * @param transferSyntax transfer syntax to accept + * @param acceptedRole SCU/SCP role to accept + */ +static OFCondition acceptUnknownContextsWithTransferSyntax( + T_ASC_Parameters * params, + const char* transferSyntax, + T_ASC_SC_ROLE acceptedRole) +{ + OFCondition cond = EC_Normal; + int n, i, k; + DUL_PRESENTATIONCONTEXT *dpc; + T_ASC_PresentationContext pc; + OFBool accepted = OFFalse; + OFBool abstractOK = OFFalse; + + n = ASC_countPresentationContexts(params); + for (i = 0; i < n; i++) + { + cond = ASC_getPresentationContext(params, i, &pc); + if (cond.bad()) return cond; + abstractOK = OFFalse; + accepted = OFFalse; + + if (dcmFindNameOfUID(pc.abstractSyntax) == NULL) + { + abstractOK = OFTrue; + + /* check the transfer syntax */ + for (k = 0; (k < OFstatic_cast(int, pc.transferSyntaxCount)) && !accepted; k++) + { + if (strcmp(pc.proposedTransferSyntaxes[k], transferSyntax) == 0) + { + accepted = OFTrue; + } + } + } + + if (accepted) + { + cond = ASC_acceptPresentationContext( + params, pc.presentationContextID, + transferSyntax, acceptedRole); + if (cond.bad()) return cond; + } else { + T_ASC_P_ResultReason reason; + + /* do not refuse if already accepted */ + dpc = findPresentationContextID(params->DULparams.acceptedPresentationContext, + pc.presentationContextID); + if ((dpc == NULL) || ((dpc != NULL) && (dpc->result != ASC_P_ACCEPTANCE))) + { + + if (abstractOK) { + reason = ASC_P_TRANSFERSYNTAXESNOTSUPPORTED; + } else { + reason = ASC_P_ABSTRACTSYNTAXNOTSUPPORTED; + } + /* + * If previously this presentation context was refused + * because of bad transfer syntax let it stay that way. + */ + if ((dpc != NULL) && (dpc->result == ASC_P_TRANSFERSYNTAXESNOTSUPPORTED)) + reason = ASC_P_TRANSFERSYNTAXESNOTSUPPORTED; + + cond = ASC_refusePresentationContext(params, pc.presentationContextID, reason); + if (cond.bad()) return cond; + } + } + } + return EC_Normal; +} + + +/** accept all presentation contexts for unknown SOP classes, + * i.e. UIDs appearing in the list of abstract syntaxes + * where no corresponding name is defined in the UID dictionary. + * This method is passed a list of "preferred" transfer syntaxes. + * @param params pointer to association parameters structure + * @param transferSyntax transfer syntax to accept + * @param acceptedRole SCU/SCP role to accept + */ +static OFCondition acceptUnknownContextsWithPreferredTransferSyntaxes( + T_ASC_Parameters * params, + const char* transferSyntaxes[], int transferSyntaxCount, + T_ASC_SC_ROLE acceptedRole) +{ + OFCondition cond = EC_Normal; + /* + ** Accept in the order "least wanted" to "most wanted" transfer + ** syntax. Accepting a transfer syntax will override previously + ** accepted transfer syntaxes. + */ + for (int i = transferSyntaxCount - 1; i >= 0; i--) + { + cond = acceptUnknownContextsWithTransferSyntax(params, transferSyntaxes[i], acceptedRole); + if (cond.bad()) return cond; + } + return cond; +} diff --git a/dcmnet/apps/storescu.cc b/dcmnet/apps/storescu.cc new file mode 100644 index 00000000..2830a450 --- /dev/null +++ b/dcmnet/apps/storescu.cc @@ -0,0 +1,1595 @@ +/* + * + * Copyright (C) 1996-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Andrew Hewett + * + * Purpose: Storage Service Class User (C-STORE operation) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_FILE_H +#include +#endif +END_EXTERN_C + +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmnet/dicom.h" /* for DICOM_APPLICATION_REQUESTOR */ +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmnet/dcmtrans.h" /* for dcmSocketSend/ReceiveTimeout */ +#include "dcmtk/dcmnet/dcasccfg.h" /* for class DcmAssociationConfiguration */ +#include "dcmtk/dcmnet/dcasccff.h" /* for class DcmAssociationConfigurationFile */ +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/dcmtls/tlsopt.h" /* for DcmTLSOptions */ + +#ifdef ON_THE_FLY_COMPRESSION +#include "dcmtk/dcmjpeg/djdecode.h" /* for JPEG decoders */ +#include "dcmtk/dcmjpeg/djencode.h" /* for JPEG encoders */ +#include "dcmtk/dcmjpls/djdecode.h" /* for JPEG-LS decoders */ +#include "dcmtk/dcmjpls/djencode.h" /* for JPEG-LS encoders */ +#include "dcmtk/dcmdata/dcrledrg.h" /* for RLE decoder */ +#include "dcmtk/dcmdata/dcrleerg.h" /* for RLE encoder */ +#include "dcmtk/dcmjpeg/dipijpeg.h" /* for dcmimage JPEG plugin */ +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#if defined (HAVE_WINDOWS_H) || defined(HAVE_FNMATCH_H) +#define PATTERN_MATCHING_AVAILABLE +#endif + +#define OFFIS_CONSOLE_APPLICATION "storescu" + +static OFLogger storescuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* default application titles */ +#define APPLICATIONTITLE "STORESCU" +#define PEERAPPLICATIONTITLE "ANY-SCP" + +static OFBool opt_showPresentationContexts = OFFalse; +static OFBool opt_abortAssociation = OFFalse; +static OFCmdUnsignedInt opt_maxReceivePDULength = ASC_DEFAULTMAXPDU; +static OFCmdUnsignedInt opt_maxSendPDULength = 0; +static E_TransferSyntax opt_networkTransferSyntax = EXS_Unknown; +static E_FileReadMode opt_readMode = ERM_autoDetect; + +static OFBool opt_scanDir = OFFalse; +static OFBool opt_recurse = OFFalse; +static OFBool opt_renameFile = OFFalse; +static const char *opt_scanPattern = ""; + +static OFBool opt_haltOnUnsuccessfulStore = OFTrue; +static OFBool unsuccessfulStoreEncountered = OFFalse; +static int lastStatusCode = STATUS_Success; + +static OFBool opt_proposeOnlyRequiredPresentationContexts = OFFalse; +static OFBool opt_combineProposedTransferSyntaxes = OFFalse; + +static OFCmdUnsignedInt opt_repeatCount = 1; +static OFCmdUnsignedInt opt_inventPatientCount = 25; +static OFCmdUnsignedInt opt_inventStudyCount = 50; +static OFCmdUnsignedInt opt_inventSeriesCount = 100; +static OFBool opt_inventSOPInstanceInformation = OFFalse; +static OFBool opt_correctUIDPadding = OFFalse; +static OFString patientNamePrefix("OFFIS^TEST_PN_"); // PatientName is PN (maximum 16 chars) +static OFString patientIDPrefix("PID_"); // PatientID is LO (maximum 64 chars) +static OFString studyIDPrefix("SID_"); // StudyID is SH (maximum 16 chars) +static OFString accessionNumberPrefix; // AccessionNumber is SH (maximum 16 chars) +static const char *opt_configFile = NULL; +static const char *opt_profileName = NULL; +T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING; +int opt_dimse_timeout = 0; +int opt_acse_timeout = 30; +OFCmdSignedInt opt_socket_timeout = 60; + +#ifdef WITH_ZLIB +static OFCmdUnsignedInt opt_compressionLevel = 0; +#endif + +// User Identity Negotiation +static T_ASC_UserIdentityNegotiationMode opt_identMode = ASC_USER_IDENTITY_NONE; +static OFString opt_user; +static OFString opt_password; +static OFString opt_identFile; +static OFBool opt_identResponse = OFFalse; + +static OFCondition +addStoragePresentationContexts(T_ASC_Parameters *params, OFList &sopClasses); + +static OFCondition +cstore(T_ASC_Association *assoc, const OFString &fname); + +static OFBool +findSOPClassAndInstanceInFile( + const char *fname, + char *sopClass, + size_t sopClassSize, + char *sopInstance, + size_t sopInstanceSize); + +static OFCondition +configureUserIdentityRequest(T_ASC_Parameters *params); + +static OFCondition +checkUserIdentityResponse(T_ASC_Parameters *params); + +/* helper macro for converting stream output to a string */ +#define CONVERT_TO_STRING(output, string) \ + optStream.str(""); \ + optStream.clear(); \ + optStream << output << OFStringStream_ends; \ + OFSTRINGSTREAM_GETOFSTRING(optStream, string) + +#define SHORTCOL 4 +#define LONGCOL 19 + +int main(int argc, char *argv[]) +{ + OFOStringStream optStream; + + const char *opt_peer = NULL; + OFCmdUnsignedInt opt_port = 104; + const char *opt_peerTitle = PEERAPPLICATIONTITLE; + const char *opt_ourTitle = APPLICATIONTITLE; + + OFList fileNameList; // list of files to transfer to SCP + OFList sopClassUIDList; // the list of SOP classes + OFList sopInstanceUIDList; // the list of SOP instances + + T_ASC_Network *net; + T_ASC_Parameters *params; + DIC_NODENAME peerHost; + T_ASC_Association *assoc; + DcmAssociationConfiguration asccfg; // handler for association configuration profiles + DcmTLSOptions tlsOptions(NET_REQUESTOR); + + OFStandard::initializeNetwork(); +#ifdef WITH_OPENSSL + DcmTLSTransportLayer::initializeOpenSSL(); +#endif + + OFString temp_str; + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM storage (C-STORE) SCU", rcsid); + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("peer", "hostname of DICOM peer"); + cmd.addParam("port", "tcp/ip port number of peer"); + cmd.addParam("dcmfile-in", "DICOM file or directory to be transmitted", OFCmdParam::PM_MultiMandatory); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--verbose-pc", "+v", "show presentation contexts in verbose mode"); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input files:"); + cmd.addOption("--scan-directories", "+sd", "scan directories for input files (dcmfile-in)"); +#ifdef PATTERN_MATCHING_AVAILABLE + cmd.addOption("--scan-pattern", "+sp", 1, "[p]attern: string (only with --scan-directories)", + "pattern for filename matching (wildcards)"); +#endif + cmd.addOption("--no-recurse", "-r", "do not recurse within directories (default)"); + cmd.addOption("--recurse", "+r", "recurse within specified directories"); + cmd.addOption("--no-rename", "-rn", "do not rename processed files (default)"); + cmd.addOption("--rename", "+rn", "append .done/.bad to processed files"); + cmd.addGroup("network options:"); + cmd.addSubGroup("application entity titles:"); + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", "set my calling AE title (default: " APPLICATIONTITLE ")"); + cmd.addOption("--call", "-aec", 1, "[a]etitle: string", "set called AE title of peer (default: " PEERAPPLICATIONTITLE ")"); + cmd.addSubGroup("association negotiation profile from configuration file:"); + cmd.addOption("--config-file", "-xf", 2, "[f]ilename, [p]rofile: string", + "use profile p from config file f"); + cmd.addSubGroup("proposed transmission transfer syntaxes (not with --config-file):"); + cmd.addOption("--propose-uncompr", "-x=", "propose all uncompressed TS, explicit VR\nwith local byte ordering first (default)"); + cmd.addOption("--propose-little", "-xe", "propose all uncompressed TS, explicit VR\nlittle endian first"); + cmd.addOption("--propose-big", "-xb", "propose all uncompressed TS, explicit VR\nbig endian first"); + cmd.addOption("--propose-implicit", "-xi", "propose implicit VR little endian TS only"); + cmd.addOption("--propose-lossless", "-xs", "propose default JPEG lossless TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jpeg8", "-xy", "propose default JPEG lossy TS for 8 bit data\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jpeg12", "-xx", "propose default JPEG lossy TS for 12 bit data\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-j2k-lossless", "-xv", "propose JPEG 2000 lossless TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-j2k-lossy", "-xw", "propose JPEG 2000 lossy TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jls-lossless", "-xt", "propose JPEG-LS lossless TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jls-lossy", "-xu", "propose JPEG-LS lossy TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-mpeg2", "-xm", "propose MPEG2 Main Profile @ Main Level TS"); + cmd.addOption("--propose-mpeg2-high", "-xh", "propose MPEG2 Main Profile @ High Level TS"); + cmd.addOption("--propose-mpeg4", "-xn", "propose MPEG4 AVC/H.264 HP / Level 4.1 TS"); + cmd.addOption("--propose-mpeg4-bd", "-xl", "propose MPEG4 AVC/H.264 BD-compatible TS"); + cmd.addOption("--propose-mpeg4-2-2d", "-x2", "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)"); + cmd.addOption("--propose-mpeg4-2-3d", "-x3", "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)"); + cmd.addOption("--propose-mpeg4-2-st", "-xo", "propose MPEG4 AVC/H.264 Stereo / Level 4.2 TS"); + cmd.addOption("--propose-hevc", "-x4", "propose HEVC/H.265 Main Profile / Level 5.1 TS"); + cmd.addOption("--propose-hevc10", "-x5", "propose HEVC/H.265 Main 10 Profile / Level 5.1 TS"); + cmd.addOption("--propose-rle", "-xr", "propose RLE lossless TS\nand all uncompressed transfer syntaxes"); +#ifdef WITH_ZLIB + cmd.addOption("--propose-deflated", "-xd", "propose deflated expl. VR little endian TS\nand all uncompressed transfer syntaxes"); +#endif + cmd.addOption("--required", "-R", "propose only required presentation contexts\n(default: propose all supported)"); + cmd.addOption("--combine", "+C", "combine proposed transfer syntaxes\n(default: separate pres. context for each TS)"); + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with --propose-deflated or --config-file):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + cmd.addSubGroup("user identity negotiation:"); + cmd.addOption("--user", "-usr", 1, "[u]ser name: string", + "authenticate using user name u"); + cmd.addOption("--password", "-pwd", 1, "[p]assword: string (only with --user)", + "authenticate using password p"); + cmd.addOption("--empty-password", "-epw", "send empty password (only with --user)"); + cmd.addOption("--kerberos", "-kt", 1, "[f]ilename: string", + "read kerberos ticket from file f"); + cmd.addOption("--saml", 1, "[f]ilename: string", + "read SAML request from file f"); + cmd.addOption("--jwt", 1, "[f]ilename: string", + "read JWT data from file f"); + cmd.addOption("--pos-response", "-rsp", "expect positive response"); + cmd.addSubGroup("other network options:"); + cmd.addOption("--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", "timeout for connection requests"); + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_socket_timeout << ")", optString1); + cmd.addOption("--socket-timeout", "-ts", 1, optString1.c_str(), "timeout for network socket (0 for none)"); + CONVERT_TO_STRING("[s]econds: integer (default: " << opt_acse_timeout << ")", optString2); + cmd.addOption("--acse-timeout", "-ta", 1, optString2.c_str(), "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages"); + CONVERT_TO_STRING("[n]umber of bytes: integer (" << ASC_MINIMUMPDUSIZE << ".." << ASC_MAXIMUMPDUSIZE << ")", optString3); + CONVERT_TO_STRING("set max receive pdu to n bytes (default: " << opt_maxReceivePDULength << ")", optString4); + cmd.addOption("--max-pdu", "-pdu", 1, optString3.c_str(), optString4.c_str()); + cmd.addOption("--max-send-pdu", 1, optString3.c_str(), "restrict max send pdu to n bytes"); + cmd.addOption("--repeat", 1, "[n]umber: integer", "repeat n times"); + cmd.addOption("--abort", "abort association instead of releasing it"); + cmd.addOption("--no-halt", "-nh", "do not halt if unsuccessful store encountered\n(default: do halt)"); + cmd.addOption("--uid-padding", "-up", "silently correct space-padded UIDs"); + + cmd.addOption("--invent-instance", "+II", "invent a new SOP instance UID for every image\nsent"); + CONVERT_TO_STRING("invent a new series UID after n images" << OFendl << "have been sent (default: " << opt_inventSeriesCount << ")", optString5); + cmd.addOption("--invent-series", "+IR", 1, "[n]umber: integer (implies --invent-instance)", optString5.c_str()); + CONVERT_TO_STRING("invent a new study UID after n series" << OFendl << "have been sent (default: " << opt_inventStudyCount << ")", optString6); + cmd.addOption("--invent-study", "+IS", 1, "[n]umber: integer (implies --invent-instance)", optString6.c_str()); + CONVERT_TO_STRING("invent a new patient ID and name after n studies" << OFendl << "have been sent (default: " << opt_inventPatientCount << ")", optString7); + cmd.addOption("--invent-patient", "+IP", 1, "[n]umber: integer (implies --invent-instance)", optString7.c_str()); + + // add TLS specific command line options if (and only if) we are compiling with OpenSSL + tlsOptions.addTLSCommandlineOptions(cmd); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !(ON_THE_FLY_COMPRESSION) && !defined(WITH_OPENSSL) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef ON_THE_FLY_COMPRESSION + COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl; + COUT << "- " << DJLSDecoderRegistration::getLibraryVersionString() << OFendl; +#endif + // print OpenSSL version if (and only if) we are compiling with OpenSSL + tlsOptions.printLibraryVersion(); + return 0; + } + + // check if the command line contains the --list-ciphers option + if (tlsOptions.listOfCiphersRequested(cmd)) + { + tlsOptions.printSupportedCiphersuites(app, COUT); + return 0; + } + } + + /* command line parameters */ + + cmd.getParam(1, opt_peer); + app.checkParam(cmd.getParamAndCheckMinMax(2, opt_port, 1, 65535)); + + OFLog::configureFromCommandLine(cmd, app); + if (cmd.findOption("--verbose-pc")) + { + app.checkDependence("--verbose-pc", "verbose mode", storescuLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_showPresentationContexts = OFTrue; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + if (cmd.findOption("--scan-directories")) opt_scanDir = OFTrue; +#ifdef PATTERN_MATCHING_AVAILABLE + if (cmd.findOption("--scan-pattern")) + { + app.checkDependence("--scan-pattern", "--scan-directories", opt_scanDir); + app.checkValue(cmd.getValue(opt_scanPattern)); + } +#endif + cmd.beginOptionBlock(); + if (cmd.findOption("--no-recurse")) opt_recurse = OFFalse; + if (cmd.findOption("--recurse")) + { + app.checkDependence("--recurse", "--scan-directories", opt_scanDir); + opt_recurse = OFTrue; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-rename")) opt_renameFile = OFFalse; + if (cmd.findOption("--rename")) opt_renameFile = OFTrue; + cmd.endOptionBlock(); + + if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_ourTitle)); + if (cmd.findOption("--call")) app.checkValue(cmd.getValue(opt_peerTitle)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--propose-uncompr")) opt_networkTransferSyntax = EXS_Unknown; + if (cmd.findOption("--propose-little")) opt_networkTransferSyntax = EXS_LittleEndianExplicit; + if (cmd.findOption("--propose-big")) opt_networkTransferSyntax = EXS_BigEndianExplicit; + if (cmd.findOption("--propose-implicit")) opt_networkTransferSyntax = EXS_LittleEndianImplicit; + if (cmd.findOption("--propose-lossless")) opt_networkTransferSyntax = EXS_JPEGProcess14SV1; + if (cmd.findOption("--propose-jpeg8")) opt_networkTransferSyntax = EXS_JPEGProcess1; + if (cmd.findOption("--propose-jpeg12")) opt_networkTransferSyntax = EXS_JPEGProcess2_4; + if (cmd.findOption("--propose-j2k-lossless")) opt_networkTransferSyntax = EXS_JPEG2000LosslessOnly; + if (cmd.findOption("--propose-j2k-lossy")) opt_networkTransferSyntax = EXS_JPEG2000; + if (cmd.findOption("--propose-jls-lossless")) opt_networkTransferSyntax = EXS_JPEGLSLossless; + if (cmd.findOption("--propose-jls-lossy")) opt_networkTransferSyntax = EXS_JPEGLSLossy; + if (cmd.findOption("--propose-mpeg2")) opt_networkTransferSyntax = EXS_MPEG2MainProfileAtMainLevel; + if (cmd.findOption("--propose-mpeg2-high")) opt_networkTransferSyntax = EXS_MPEG2MainProfileAtHighLevel; + if (cmd.findOption("--propose-mpeg4")) opt_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_1; + if (cmd.findOption("--propose-mpeg4-bd")) opt_networkTransferSyntax = EXS_MPEG4BDcompatibleHighProfileLevel4_1; + if (cmd.findOption("--propose-mpeg4-2-2d")) opt_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For2DVideo; + if (cmd.findOption("--propose-mpeg4-2-3d")) opt_networkTransferSyntax = EXS_MPEG4HighProfileLevel4_2_For3DVideo; + if (cmd.findOption("--propose-mpeg4-2-st")) opt_networkTransferSyntax = EXS_MPEG4StereoHighProfileLevel4_2; + if (cmd.findOption("--propose-hevc")) opt_networkTransferSyntax = EXS_HEVCMainProfileLevel5_1; + if (cmd.findOption("--propose-hevc10")) opt_networkTransferSyntax = EXS_HEVCMain10ProfileLevel5_1; + if (cmd.findOption("--propose-rle")) opt_networkTransferSyntax = EXS_RLELossless; +#ifdef WITH_ZLIB + if (cmd.findOption("--propose-deflated")) opt_networkTransferSyntax = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); + + if (cmd.findOption("--required")) opt_proposeOnlyRequiredPresentationContexts = OFTrue; + if (cmd.findOption("--combine")) opt_combineProposedTransferSyntaxes = OFTrue; + + if (cmd.findOption("--config-file")) + { + // check conflicts with other command line options + app.checkConflict("--config-file", "--propose-little", opt_networkTransferSyntax == EXS_LittleEndianExplicit); + app.checkConflict("--config-file", "--propose-big", opt_networkTransferSyntax == EXS_BigEndianExplicit); + app.checkConflict("--config-file", "--propose-implicit", opt_networkTransferSyntax == EXS_LittleEndianImplicit); + app.checkConflict("--config-file", "--propose-lossless", opt_networkTransferSyntax == EXS_JPEGProcess14SV1); + app.checkConflict("--config-file", "--propose-jpeg8", opt_networkTransferSyntax == EXS_JPEGProcess1); + app.checkConflict("--config-file", "--propose-jpeg12", opt_networkTransferSyntax == EXS_JPEGProcess2_4); + app.checkConflict("--config-file", "--propose-j2k-lossless", opt_networkTransferSyntax == EXS_JPEG2000LosslessOnly); + app.checkConflict("--config-file", "--propose-j2k-lossy", opt_networkTransferSyntax == EXS_JPEG2000); + app.checkConflict("--config-file", "--propose-jls-lossless", opt_networkTransferSyntax == EXS_JPEGLSLossless); + app.checkConflict("--config-file", "--propose-jls-lossy", opt_networkTransferSyntax == EXS_JPEGLSLossy); + app.checkConflict("--config-file", "--propose-mpeg2", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--config-file", "--propose-mpeg2-high", opt_networkTransferSyntax == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--config-file", "--propose-mpeg4", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--config-file", "--propose-mpeg4-bd", opt_networkTransferSyntax == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--config-file", "--propose-mpeg4-2-2d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--config-file", "--propose-mpeg4-2-3d", opt_networkTransferSyntax == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--config-file", "--propose-mpeg4-2-st", opt_networkTransferSyntax == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--config-file", "--propose-hevc", opt_networkTransferSyntax == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--config-file", "--propose-hevc10", opt_networkTransferSyntax == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--config-file", "--propose-rle", opt_networkTransferSyntax == EXS_RLELossless); +#ifdef WITH_ZLIB + app.checkConflict("--config-file", "--propose-deflated", opt_networkTransferSyntax == EXS_DeflatedLittleEndianExplicit); +#endif + app.checkConflict("--config-file", "--required", opt_proposeOnlyRequiredPresentationContexts); + app.checkConflict("--config-file", "--combine", opt_combineProposedTransferSyntaxes); + + app.checkValue(cmd.getValue(opt_configFile)); + app.checkValue(cmd.getValue(opt_profileName)); + + // read configuration file. The profile name is checked later. + OFCondition cond = DcmAssociationConfigurationFile::initialize(asccfg, opt_configFile); + if (cond.bad()) + { + OFLOG_ERROR(storescuLogger, "reading config file: " << cond.text()); + return 1; + } + } + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + app.checkDependence("--compression-level", "--propose-deflated or --config-file", + (opt_networkTransferSyntax == EXS_DeflatedLittleEndianExplicit) || (opt_configFile != NULL)); + app.checkValue(cmd.getValueAndCheckMinMax(opt_compressionLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, opt_compressionLevel)); + } +#endif + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + if (cmd.findOption("--timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set(OFstatic_cast(Sint32, opt_timeout)); + } + + if (cmd.findOption("--socket-timeout")) + app.checkValue(cmd.getValueAndCheckMin(opt_socket_timeout, -1)); + // always set the timeout values since the global default might be different + dcmSocketSendTimeout.set(OFstatic_cast(Sint32, opt_socket_timeout)); + dcmSocketReceiveTimeout.set(OFstatic_cast(Sint32, opt_socket_timeout)); + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_acse_timeout = OFstatic_cast(int, opt_timeout); + } + + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_dimse_timeout = OFstatic_cast(int, opt_timeout); + opt_blockMode = DIMSE_NONBLOCKING; + } + + if (cmd.findOption("--max-pdu")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_maxReceivePDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + + if (cmd.findOption("--max-send-pdu")) + { + app.checkValue(cmd.getValueAndCheckMinMax(opt_maxSendPDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + dcmMaxOutgoingPDUSize.set(OFstatic_cast(Uint32, opt_maxSendPDULength)); + } + + if (cmd.findOption("--repeat")) app.checkValue(cmd.getValueAndCheckMin(opt_repeatCount, 1)); + if (cmd.findOption("--abort")) opt_abortAssociation = OFTrue; + if (cmd.findOption("--no-halt")) opt_haltOnUnsuccessfulStore = OFFalse; + if (cmd.findOption("--uid-padding")) opt_correctUIDPadding = OFTrue; + + if (cmd.findOption("--invent-instance")) opt_inventSOPInstanceInformation = OFTrue; + if (cmd.findOption("--invent-series")) + { + opt_inventSOPInstanceInformation = OFTrue; + app.checkValue(cmd.getValueAndCheckMin(opt_inventSeriesCount, 1)); + } + if (cmd.findOption("--invent-study")) + { + opt_inventSOPInstanceInformation = OFTrue; + app.checkValue(cmd.getValueAndCheckMin(opt_inventStudyCount, 1)); + } + if (cmd.findOption("--invent-patient")) + { + opt_inventSOPInstanceInformation = OFTrue; + app.checkValue(cmd.getValueAndCheckMin(opt_inventPatientCount, 1)); + } + + // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL) + tlsOptions.parseArguments(app, cmd); + + // User Identity Negotiation + cmd.beginOptionBlock(); + if (cmd.findOption("--user")) + { + app.checkValue(cmd.getValue(opt_user)); + opt_identMode = ASC_USER_IDENTITY_USER; + } + if (cmd.findOption("--kerberos")) + { + app.checkValue(cmd.getValue(opt_identFile)); + opt_identMode = ASC_USER_IDENTITY_KERBEROS; + } + if (cmd.findOption("--saml")) + { + app.checkValue(cmd.getValue(opt_identFile)); + opt_identMode = ASC_USER_IDENTITY_SAML; + } + if (cmd.findOption("--jwt")) + { + app.checkValue(cmd.getValue(opt_identFile)); + opt_identMode = ASC_USER_IDENTITY_JWT; + } + cmd.endOptionBlock(); + cmd.beginOptionBlock(); + if (cmd.findOption("--password")) + { + app.checkDependence("--password", "--user", opt_identMode == ASC_USER_IDENTITY_USER); + app.checkValue(cmd.getValue(opt_password)); + opt_identMode = ASC_USER_IDENTITY_USER_PASSWORD; + } + if (cmd.findOption("--empty-password")) + { + app.checkDependence("--empty-password", "--user", opt_identMode == ASC_USER_IDENTITY_USER); + opt_password= ""; + opt_identMode = ASC_USER_IDENTITY_USER_PASSWORD; + } + cmd.endOptionBlock(); + if (cmd.findOption("--pos-response")) + { + app.checkDependence("--pos-response", "--user, --kerberos or --saml", opt_identMode != ASC_USER_IDENTITY_NONE); + opt_identResponse = OFTrue; + } + } + + /* print resource identifier */ + OFLOG_DEBUG(storescuLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(storescuLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* finally, create list of input files */ + const char *paramString = NULL; + const int paramCount = cmd.getParamCount(); + OFList inputFiles; + if (opt_scanDir) + OFLOG_INFO(storescuLogger, "determining input files ..."); + /* iterate over all input filenames/directories */ + for (int i = 3; i <= paramCount; i++) + { + cmd.getParam(i, paramString); + /* search directory recursively (if required) */ + if (OFStandard::dirExists(paramString)) + { + if (opt_scanDir) + OFStandard::searchDirectoryRecursively(paramString, inputFiles, opt_scanPattern, "" /*dirPrefix*/, opt_recurse); + else + OFLOG_WARN(storescuLogger, "ignoring directory because option --scan-directories is not set: " << paramString); + } else + inputFiles.push_back(paramString); + } + /* check whether there are any input files at all */ + if (inputFiles.empty()) + { + OFLOG_FATAL(storescuLogger, "no input files to be sent"); + exit(1); + } + + /* check input files */ + OFString errormsg; + DcmFileFormat dfile; + char sopClassUID[128]; + char sopInstanceUID[128]; + OFBool ignoreName; + const char *currentFilename = NULL; + OFListIterator(OFString) if_iter = inputFiles.begin(); + OFListIterator(OFString) if_last = inputFiles.end(); + OFLOG_INFO(storescuLogger, "checking input files ..."); + /* iterate over all input filenames */ + while (if_iter != if_last) + { + ignoreName = OFFalse; + currentFilename = (*if_iter).c_str(); + if (OFStandard::fileExists(currentFilename)) + { + if (opt_proposeOnlyRequiredPresentationContexts) + { + if (!findSOPClassAndInstanceInFile(currentFilename, sopClassUID, sizeof(sopClassUID), sopInstanceUID, sizeof(sopInstanceUID))) + { + ignoreName = OFTrue; + errormsg = "missing SOP class (or instance) in file: "; + errormsg += currentFilename; + if (opt_haltOnUnsuccessfulStore) + { + OFLOG_FATAL(storescuLogger, errormsg); + exit(1); + } + else + OFLOG_WARN(storescuLogger, errormsg << ", ignoring file"); + } + else if (!dcmIsaStorageSOPClassUID(sopClassUID, ESSC_All)) + { + ignoreName = OFTrue; + errormsg = "unknown storage SOP class in file: "; + errormsg += currentFilename; + errormsg += ": "; + errormsg += sopClassUID; + if (opt_haltOnUnsuccessfulStore) + { + OFLOG_FATAL(storescuLogger, errormsg); + exit(1); + } + else + OFLOG_WARN(storescuLogger, errormsg << ", ignoring file"); + } + else + { + sopClassUIDList.push_back(sopClassUID); + sopInstanceUIDList.push_back(sopInstanceUID); + } + } + if (!ignoreName) fileNameList.push_back(currentFilename); + } + else + { + errormsg = "cannot access file: "; + errormsg += currentFilename; + if (opt_haltOnUnsuccessfulStore) + { + OFLOG_FATAL(storescuLogger, errormsg); + exit(1); + } + else + OFLOG_WARN(storescuLogger, errormsg << ", ignoring file"); + } + ++if_iter; + } + +#ifdef ON_THE_FLY_COMPRESSION + // register global JPEG decompression codecs + DJDecoderRegistration::registerCodecs(); + + // register global JPEG compression codecs + DJEncoderRegistration::registerCodecs(); + + // register JPEG-LS decompression codecs + DJLSDecoderRegistration::registerCodecs(); + + // register JPEG-LS compression codecs + DJLSEncoderRegistration::registerCodecs(); + + // register RLE compression codec + DcmRLEEncoderRegistration::registerCodecs(); + + // register RLE decompression codec + DcmRLEDecoderRegistration::registerCodecs(); +#endif + + /* initialize network, i.e. create an instance of T_ASC_Network*. */ + OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, opt_acse_timeout, &net); + if (cond.bad()) { + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + /* initialize association parameters, i.e. create an instance of T_ASC_Parameters*. */ + cond = ASC_createAssociationParameters(¶ms, opt_maxReceivePDULength); + if (cond.bad()) { + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + /* create a secure transport layer if requested and OpenSSL is available */ + cond = tlsOptions.createTransportLayer(net, params, app, cmd); + if (cond.bad()) { + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + /* sets this application's title and the called application's title in the params */ + /* structure. The default values to be set here are "STORESCU" and "ANY-SCP". */ + ASC_setAPTitles(params, opt_ourTitle, opt_peerTitle, NULL); + + /* Figure out the presentation addresses and copy the */ + /* corresponding values into the association parameters.*/ + sprintf(peerHost, "%s:%d", opt_peer, OFstatic_cast(int, opt_port)); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), peerHost); + + /* Configure User Identity Negotiation*/ + if (opt_identMode != ASC_USER_IDENTITY_NONE) + { + cond = configureUserIdentityRequest(params); + if (cond.bad()) + return 1; + } + + if (opt_profileName) + { + /* perform name mangling for config file key */ + OFString sprofile; + const unsigned char *c = OFreinterpret_cast(const unsigned char *, opt_profileName); + while (*c) + { + if (!isspace(*c)) sprofile += OFstatic_cast(char, toupper(*c)); + ++c; + } + + /* set presentation contexts as defined in config file */ + cond = asccfg.setAssociationParameters(sprofile.c_str(), *params); + } + else + { + /* Set the presentation contexts which will be negotiated */ + /* when the network connection will be established */ + cond = addStoragePresentationContexts(params, sopClassUIDList); + } + + if (cond.bad()) { + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + /* dump presentation contexts if required */ + if (opt_showPresentationContexts) + OFLOG_INFO(storescuLogger, "Request Parameters:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_RQ)); + else + OFLOG_DEBUG(storescuLogger, "Request Parameters:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_RQ)); + + /* create association, i.e. try to establish a network connection to another */ + /* DICOM application. This call creates an instance of T_ASC_Association*. */ + OFLOG_INFO(storescuLogger, "Requesting Association"); + cond = ASC_requestAssociation(net, params, &assoc); + if (cond.bad()) { + if (cond == DUL_ASSOCIATIONREJECTED) { + T_ASC_RejectParameters rej; + + ASC_getRejectParameters(params, &rej); + OFLOG_FATAL(storescuLogger, "Association Rejected:" << OFendl << ASC_printRejectParameters(temp_str, &rej)); + return 1; + } else { + OFLOG_FATAL(storescuLogger, "Association Request Failed: " << DimseCondition::dump(temp_str, cond)); + return 1; + } + } + + /* dump the connection parameters if in debug mode*/ + OFLOG_DEBUG(storescuLogger, ASC_dumpConnectionParameters(temp_str, assoc)); + + /* dump the presentation contexts which have been accepted/refused */ + if (opt_showPresentationContexts) + OFLOG_INFO(storescuLogger, "Association Parameters Negotiated:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_AC)); + else + OFLOG_DEBUG(storescuLogger, "Association Parameters Negotiated:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_AC)); + + /* count the presentation contexts which have been accepted by the SCP */ + /* If there are none, finish the execution */ + if (ASC_countAcceptedPresentationContexts(params) == 0) { + OFLOG_FATAL(storescuLogger, "No Acceptable Presentation Contexts"); + return 1; + } + + /* check user authentication response (if applicable) */ + cond = checkUserIdentityResponse(params); + if (cond.bad()) + { + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + /* dump general information concerning the establishment of the network connection if required */ + OFLOG_INFO(storescuLogger, "Association Accepted (Max Send PDV: " << assoc->sendPDVLength << ")"); + + /* do the real work, i.e. for all files which were specified in the */ + /* command line, transmit the encapsulated DICOM objects to the SCP. */ + cond = EC_Normal; + OFListIterator(OFString) iter = fileNameList.begin(); + OFListIterator(OFString) enditer = fileNameList.end(); + + while ((iter != enditer) && cond.good()) + { + cond = cstore(assoc, *iter); + ++iter; + } + + /* tear down association, i.e. terminate network connection to SCP */ + if (cond == EC_Normal) + { + if (opt_abortAssociation) { + OFLOG_INFO(storescuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) { + OFLOG_ERROR(storescuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + return 1; + } + } else { + /* release association */ + OFLOG_INFO(storescuLogger, "Releasing Association"); + cond = ASC_releaseAssociation(assoc); + if (cond.bad()) + { + OFLOG_ERROR(storescuLogger, "Association Release Failed: " << DimseCondition::dump(temp_str, cond)); + return 1; + } + } + } + else if (cond == DUL_PEERREQUESTEDRELEASE) + { + OFLOG_ERROR(storescuLogger, "Protocol Error: Peer requested release (Aborting)"); + OFLOG_INFO(storescuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) { + OFLOG_ERROR(storescuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + return 1; + } + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + OFLOG_INFO(storescuLogger, "Peer Aborted Association"); + } + else + { + OFLOG_ERROR(storescuLogger, "Store SCU Failed: " << DimseCondition::dump(temp_str, cond)); + OFLOG_INFO(storescuLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) { + OFLOG_ERROR(storescuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + return 1; + } + } + + /* destroy the association, i.e. free memory of T_ASC_Association* structure. This */ + /* call is the counterpart of ASC_requestAssociation(...) which was called above. */ + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) { + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */ + /* is the counterpart of ASC_initializeNetwork(...) which was called above. */ + cond = ASC_dropNetwork(&net); + if (cond.bad()) { + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + OFStandard::shutdownNetwork(); + + cond = tlsOptions.writeRandomSeed(); + if (cond.bad()) { + // failure to write back the random seed is a warning, not an error + OFLOG_WARN(storescuLogger, DimseCondition::dump(temp_str, cond)); + } + + int exitCode = 0; + if (opt_haltOnUnsuccessfulStore && unsuccessfulStoreEncountered) { + if (lastStatusCode == STATUS_Success) { + // there must have been some kind of general network error + exitCode = 0xff; + } else { + exitCode = (lastStatusCode >> 8); // only the least significant byte is relevant as exit code + } + } + +#ifdef ON_THE_FLY_COMPRESSION + // deregister JPEG codecs + DJDecoderRegistration::cleanup(); + DJEncoderRegistration::cleanup(); + + // deregister JPEG-LS codecs + DJLSDecoderRegistration::cleanup(); + DJLSEncoderRegistration::cleanup(); + + // deregister RLE codecs + DcmRLEDecoderRegistration::cleanup(); + DcmRLEEncoderRegistration::cleanup(); +#endif + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + return exitCode; +} + + +static OFBool +isaListMember(OFList &lst, OFString &s) +{ + OFListIterator(OFString) cur = lst.begin(); + OFListIterator(OFString) end = lst.end(); + + OFBool found = OFFalse; + while (cur != end && !found) { + found = (s == *cur); + ++cur; + } + + return found; +} + +static OFCondition +addPresentationContext(T_ASC_Parameters *params, + int presentationContextId, + const OFString &abstractSyntax, + const OFString &transferSyntax, + T_ASC_SC_ROLE proposedRole = ASC_SC_ROLE_DEFAULT) +{ + const char *c_p = transferSyntax.c_str(); + OFCondition cond = ASC_addPresentationContext(params, presentationContextId, + abstractSyntax.c_str(), &c_p, 1, proposedRole); + return cond; +} + +static OFCondition +addPresentationContext(T_ASC_Parameters *params, + int presentationContextId, + const OFString &abstractSyntax, + const OFList &transferSyntaxList, + T_ASC_SC_ROLE proposedRole = ASC_SC_ROLE_DEFAULT) +{ + // create an array of supported/possible transfer syntaxes + const char **transferSyntaxes = new const char*[transferSyntaxList.size()]; + int transferSyntaxCount = 0; + OFListConstIterator(OFString) s_cur = transferSyntaxList.begin(); + OFListConstIterator(OFString) s_end = transferSyntaxList.end(); + while (s_cur != s_end) { + transferSyntaxes[transferSyntaxCount++] = (*s_cur).c_str(); + ++s_cur; + } + + OFCondition cond = ASC_addPresentationContext(params, presentationContextId, + abstractSyntax.c_str(), transferSyntaxes, transferSyntaxCount, proposedRole); + + delete[] transferSyntaxes; + return cond; +} + +static OFCondition +addStoragePresentationContexts(T_ASC_Parameters *params, + OFList &sopClasses) +{ + /* + * Each SOP Class will be proposed in two presentation contexts (unless + * the opt_combineProposedTransferSyntaxes global variable is true). + * The command line specified a preferred transfer syntax to use. + * This preferred transfer syntax will be proposed in one + * presentation context and a set of alternative (fallback) transfer + * syntaxes will be proposed in a different presentation context. + * + * Generally, we prefer to use Explicitly encoded transfer syntaxes + * and if running on a Little Endian machine we prefer + * LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + * Some SCP implementations will just select the first transfer + * syntax they support (this is not part of the standard) so + * organise the proposed transfer syntaxes to take advantage + * of such behaviour. + */ + + // Which transfer syntax was preferred on the command line + OFString preferredTransferSyntax; + if (opt_networkTransferSyntax == EXS_Unknown) { + /* gLocalByteOrder is defined in dcxfer.h */ + if (gLocalByteOrder == EBO_LittleEndian) { + /* we are on a little endian machine */ + preferredTransferSyntax = UID_LittleEndianExplicitTransferSyntax; + } else { + /* we are on a big endian machine */ + preferredTransferSyntax = UID_BigEndianExplicitTransferSyntax; + } + } else { + DcmXfer xfer(opt_networkTransferSyntax); + preferredTransferSyntax = xfer.getXferID(); + } + + OFListIterator(OFString) s_cur; + OFListIterator(OFString) s_end; + + OFList fallbackSyntaxes; + // - If little endian implicit is preferred, we don't need any fallback syntaxes + // because it is the default transfer syntax and all applications must support it. + // - If MPEG2, MPEG4 or HEVC is preferred, we don't want to propose any fallback solution + // because this is not required and we cannot decompress the movie anyway. + if ((opt_networkTransferSyntax != EXS_LittleEndianImplicit) && + (opt_networkTransferSyntax != EXS_MPEG2MainProfileAtMainLevel) && + (opt_networkTransferSyntax != EXS_MPEG2MainProfileAtHighLevel) && + (opt_networkTransferSyntax != EXS_MPEG4HighProfileLevel4_1) && + (opt_networkTransferSyntax != EXS_MPEG4BDcompatibleHighProfileLevel4_1) && + (opt_networkTransferSyntax != EXS_MPEG4HighProfileLevel4_2_For2DVideo) && + (opt_networkTransferSyntax != EXS_MPEG4HighProfileLevel4_2_For3DVideo) && + (opt_networkTransferSyntax != EXS_MPEG4StereoHighProfileLevel4_2) && + (opt_networkTransferSyntax != EXS_HEVCMainProfileLevel5_1) && + (opt_networkTransferSyntax != EXS_HEVCMain10ProfileLevel5_1)) + { + fallbackSyntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); + fallbackSyntaxes.push_back(UID_BigEndianExplicitTransferSyntax); + fallbackSyntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); + // Remove the preferred syntax from the fallback list + fallbackSyntaxes.remove(preferredTransferSyntax); + } + + // create a list of transfer syntaxes combined from the preferred and fallback syntaxes + OFList combinedSyntaxes; + s_cur = fallbackSyntaxes.begin(); + s_end = fallbackSyntaxes.end(); + combinedSyntaxes.push_back(preferredTransferSyntax); + while (s_cur != s_end) + { + if (!isaListMember(combinedSyntaxes, *s_cur)) combinedSyntaxes.push_back(*s_cur); + ++s_cur; + } + + if (!opt_proposeOnlyRequiredPresentationContexts) { + // add the (short list of) known storage SOP classes to the list + // the array of Storage SOP Class UIDs comes from dcuid.h + for (int i = 0; i < numberOfDcmShortSCUStorageSOPClassUIDs; i++) + sopClasses.push_back(dcmShortSCUStorageSOPClassUIDs[i]); + } + + // thin out the SOP classes to remove any duplicates + OFList sops; + s_cur = sopClasses.begin(); + s_end = sopClasses.end(); + while (s_cur != s_end) { + if (!isaListMember(sops, *s_cur)) { + sops.push_back(*s_cur); + } + ++s_cur; + } + + // add a presentations context for each SOP class / transfer syntax pair + OFCondition cond = EC_Normal; + int pid = 1; // presentation context id + s_cur = sops.begin(); + s_end = sops.end(); + while (s_cur != s_end && cond.good()) { + + if (pid > 255) { + OFLOG_ERROR(storescuLogger, "Too many presentation contexts"); + return ASC_BADPRESENTATIONCONTEXTID; + } + + if (opt_combineProposedTransferSyntaxes) { + cond = addPresentationContext(params, pid, *s_cur, combinedSyntaxes); + pid += 2; /* only odd presentation context id's */ + } else { + + // SOP class with preferred transfer syntax + cond = addPresentationContext(params, pid, *s_cur, preferredTransferSyntax); + pid += 2; /* only odd presentation context id's */ + + if (fallbackSyntaxes.size() > 0) { + if (pid > 255) { + OFLOG_ERROR(storescuLogger, "Too many presentation contexts"); + return ASC_BADPRESENTATIONCONTEXTID; + } + + // SOP class with fallback transfer syntax + cond = addPresentationContext(params, pid, *s_cur, fallbackSyntaxes); + pid += 2; /* only odd presentation context id's */ + } + } + ++s_cur; + } + + return cond; +} + +static int +secondsSince1970() +{ + time_t t = time(NULL); + return OFstatic_cast(int, t); +} + +static OFString +intToString(int i) +{ + char numbuf[32]; + sprintf(numbuf, "%d", i); + return numbuf; +} + +static OFString +makeUID(OFString basePrefix, int counter) +{ + OFString prefix = basePrefix + "." + intToString(counter); + char uidbuf[65]; + OFString uid = dcmGenerateUniqueIdentifier(uidbuf, prefix.c_str()); + return uid; +} + +static OFBool +updateStringAttributeValue(DcmItem *dataset, const DcmTagKey &key, OFString &value) +{ + DcmStack stack; + DcmTag tag(key); + + OFCondition cond = EC_Normal; + cond = dataset->search(key, stack, ESM_fromHere, OFFalse); + if (cond != EC_Normal) { + OFLOG_ERROR(storescuLogger, "updateStringAttributeValue: cannot find: " << tag.getTagName() + << " " << key << ": " << cond.text()); + return OFFalse; + } + + DcmElement *elem = OFstatic_cast(DcmElement *, stack.top()); + + DcmVR vr(elem->ident()); + if (elem->getLength() > vr.getMaxValueLength()) { + OFLOG_ERROR(storescuLogger, "updateStringAttributeValue: INTERNAL ERROR: " << tag.getTagName() + << " " << key << ": value too large (max " << vr.getMaxValueLength() + << ") for " << vr.getVRName() << " value: " << value); + return OFFalse; + } + + cond = elem->putOFStringArray(value); + if (cond != EC_Normal) { + OFLOG_ERROR(storescuLogger, "updateStringAttributeValue: cannot put string in attribute: " << tag.getTagName() + << " " << key << ": " << cond.text()); + return OFFalse; + } + + return OFTrue; +} + +static void +replaceSOPInstanceInformation(DcmDataset *dataset) +{ + static OFCmdUnsignedInt patientCounter = 0; + static OFCmdUnsignedInt studyCounter = 0; + static OFCmdUnsignedInt seriesCounter = 0; + static OFCmdUnsignedInt imageCounter = 0; + static OFString seriesInstanceUID; + static OFString seriesNumber; + static OFString studyInstanceUID; + static OFString studyID; + static OFString accessionNumber; + static OFString patientID; + static OFString patientName; + + if (seriesInstanceUID.empty()) seriesInstanceUID=makeUID(SITE_SERIES_UID_ROOT, OFstatic_cast(int, seriesCounter)); + if (seriesNumber.empty()) seriesNumber = intToString(OFstatic_cast(int, seriesCounter)); + if (studyInstanceUID.empty()) studyInstanceUID = makeUID(SITE_STUDY_UID_ROOT, OFstatic_cast(int, studyCounter)); + if (studyID.empty()) studyID = studyIDPrefix + intToString(OFstatic_cast(int, secondsSince1970())) + intToString(OFstatic_cast(int, studyCounter)); + if (accessionNumber.empty()) accessionNumber = accessionNumberPrefix + intToString(secondsSince1970()) + intToString(OFstatic_cast(int, studyCounter)); + if (patientID.empty()) patientID = patientIDPrefix + intToString(secondsSince1970()) + intToString(OFstatic_cast(int, patientCounter)); + if (patientName.empty()) patientName = patientNamePrefix + intToString(secondsSince1970()) + intToString(OFstatic_cast(int, patientCounter)); + + if (imageCounter >= opt_inventSeriesCount) { + imageCounter = 0; + seriesCounter++; + seriesInstanceUID = makeUID(SITE_SERIES_UID_ROOT, OFstatic_cast(int, seriesCounter)); + seriesNumber = intToString(OFstatic_cast(int, seriesCounter)); + } + if (seriesCounter >= opt_inventStudyCount) { + seriesCounter = 0; + studyCounter++; + studyInstanceUID = makeUID(SITE_STUDY_UID_ROOT, OFstatic_cast(int, studyCounter)); + studyID = studyIDPrefix + intToString(secondsSince1970()) + intToString(OFstatic_cast(int, studyCounter)); + accessionNumber = accessionNumberPrefix + intToString(secondsSince1970()) + intToString(OFstatic_cast(int, studyCounter)); + } + if (studyCounter >= opt_inventPatientCount) { + // we create as many patients as necessary */ + studyCounter = 0; + patientCounter++; + patientID = patientIDPrefix + intToString(secondsSince1970()) + intToString(OFstatic_cast(int, patientCounter)); + patientName = patientNamePrefix + intToString(secondsSince1970()) + intToString(OFstatic_cast(int, patientCounter)); + } + + OFString sopInstanceUID = makeUID(SITE_INSTANCE_UID_ROOT, OFstatic_cast(int, imageCounter)); + OFString imageNumber = intToString(OFstatic_cast(int, imageCounter)); + + OFLOG_INFO(storescuLogger, "Inventing Identifying Information (" + << "pa" << patientCounter << ", st" << studyCounter + << ", se" << seriesCounter << ", im" << imageCounter << "):"); + OFLOG_INFO(storescuLogger, " PatientName=" << patientName); + OFLOG_INFO(storescuLogger, " PatientID=" << patientID); + OFLOG_INFO(storescuLogger, " StudyInstanceUID=" << studyInstanceUID); + OFLOG_INFO(storescuLogger, " StudyID=" << studyID); + OFLOG_INFO(storescuLogger, " SeriesInstanceUID=" << seriesInstanceUID); + OFLOG_INFO(storescuLogger, " SeriesNumber=" << seriesNumber); + OFLOG_INFO(storescuLogger, " SOPInstanceUID=" << sopInstanceUID); + OFLOG_INFO(storescuLogger, " ImageNumber=" << imageNumber); + + updateStringAttributeValue(dataset, DCM_PatientName, patientName); + updateStringAttributeValue(dataset, DCM_PatientID, patientID); + updateStringAttributeValue(dataset, DCM_StudyInstanceUID, studyInstanceUID); + updateStringAttributeValue(dataset, DCM_StudyID, studyID); + updateStringAttributeValue(dataset, DCM_SeriesInstanceUID, seriesInstanceUID); + updateStringAttributeValue(dataset, DCM_SeriesNumber, seriesNumber); + updateStringAttributeValue(dataset, DCM_SOPInstanceUID, sopInstanceUID); + updateStringAttributeValue(dataset, DCM_InstanceNumber, imageNumber); + + imageCounter++; +} + +static void +progressCallback(void * /*callbackData*/, + T_DIMSE_StoreProgress *progress, + T_DIMSE_C_StoreRQ * req) +{ + if (progress->state == DIMSE_StoreBegin) + { + OFString str; + OFLOG_DEBUG(storescuLogger, DIMSE_dumpMessage(str, *req, DIMSE_OUTGOING)); + } + + // We can't use oflog for the pdu output, but we use a special logger for + // generating this output. If it is set to level "INFO" we generate the + // output, if it's set to "DEBUG" then we'll assume that there is debug output + // generated for each PDU elsewhere. + OFLogger progressLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION ".progress"); + if (progressLogger.getChainedLogLevel() == OFLogger::INFO_LOG_LEVEL) { + switch (progress->state) { + case DIMSE_StoreBegin: + COUT << "XMIT: "; break; + case DIMSE_StoreEnd: + COUT << OFendl; break; + default: + COUT << "."; break; + } + COUT.flush(); + } +} + +static void +renameFile(const char *fname, const char *fext) +{ + if (!opt_renameFile) return; + OFString fnewname(fname); + fnewname += fext; + if (OFStandard::renameFile(fname, fnewname)) + OFLOG_DEBUG(storescuLogger, "renamed file '" << fname << "' to '" << fnewname << "'"); + else + OFLOG_WARN(storescuLogger, "cannot rename file '" << fname << "' to '" << fnewname << "'"); +} + +static OFCondition +storeSCU(T_ASC_Association *assoc, const char *fname) + /* + * This function will read all the information from the given file, + * figure out a corresponding presentation context which will be used + * to transmit the information over the network to the SCP, and it + * will finally initiate the transmission of all data to the SCP. + * + * Parameters: + * assoc - [in] The association (network connection to another DICOM application). + * fname - [in] Name of the file which shall be processed. + */ +{ + DIC_US msgId = assoc->nextMsgID++; + T_ASC_PresentationContextID presID; + T_DIMSE_C_StoreRQ req; + T_DIMSE_C_StoreRSP rsp; + DIC_UI sopClass; + DIC_UI sopInstance; + DcmDataset *statusDetail = NULL; + + unsuccessfulStoreEncountered = OFTrue; // assumption + + OFLOG_INFO(storescuLogger, "Sending file: " << fname); + + /* read information from file. After the call to DcmFileFormat::loadFile(...) the information */ + /* which is encapsulated in the file will be available through the DcmFileFormat object. */ + /* In detail, it will be available through calls to DcmFileFormat::getMetaInfo() (for */ + /* meta header information) and DcmFileFormat::getDataset() (for data set information). */ + DcmFileFormat dcmff; + OFCondition cond = dcmff.loadFile(fname, EXS_Unknown, EGL_noChange, DCM_MaxReadLength, opt_readMode); + + /* figure out if an error occurred while the file was read */ + if (cond.bad()) + { + OFLOG_ERROR(storescuLogger, "Bad DICOM file: " << fname << ": " << cond.text()); + renameFile(fname, ".bad"); + return cond; + } + + /* if required, invent new SOP instance information for the current data set (user option) */ + if (opt_inventSOPInstanceInformation) { + replaceSOPInstanceInformation(dcmff.getDataset()); + } + + /* figure out which SOP class and SOP instance is encapsulated in the file */ + if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(), + sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding)) + { + OFLOG_ERROR(storescuLogger, "No SOP Class or Instance UID in file: " << fname); + renameFile(fname, ".bad"); + return DIMSE_BADDATA; + } + + /* figure out which of the accepted presentation contexts should be used */ + DcmXfer filexfer(dcmff.getDataset()->getOriginalXfer()); + + /* special case: if the file uses an unencapsulated transfer syntax (uncompressed + * or deflated explicit VR) and we prefer deflated explicit VR, then try + * to find a presentation context for deflated explicit VR first. + */ + if (filexfer.isNotEncapsulated() && + opt_networkTransferSyntax == EXS_DeflatedLittleEndianExplicit) + { + filexfer = EXS_DeflatedLittleEndianExplicit; + } + + if (filexfer.getXfer() != EXS_Unknown) + presID = ASC_findAcceptedPresentationContextID(assoc, sopClass, filexfer.getXferID()); + else + presID = ASC_findAcceptedPresentationContextID(assoc, sopClass); + if (presID == 0) + { + const char *modalityName = dcmSOPClassUIDToModality(sopClass); + if (!modalityName) modalityName = dcmFindNameOfUID(sopClass); + if (!modalityName) modalityName = "unknown SOP class"; + OFLOG_ERROR(storescuLogger, "No presentation context for: (" << modalityName << ") " << sopClass); + renameFile(fname, ".bad"); + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + T_ASC_PresentationContext pc; + ASC_findAcceptedPresentationContext(assoc->params, presID, &pc); + DcmXfer netTransfer(pc.acceptedTransferSyntax); + + /* if required, dump general information concerning transfer syntaxes */ + if (storescuLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) + { + DcmXfer fileTransfer(dcmff.getDataset()->getOriginalXfer()); + OFLOG_INFO(storescuLogger, "Converting transfer syntax: " << fileTransfer.getXferName() + << " -> " << netTransfer.getXferName()); + } + +#ifdef ON_THE_FLY_COMPRESSION + cond = dcmff.getDataset()->chooseRepresentation(netTransfer.getXfer(), NULL); + if (cond.bad()) + { + OFLOG_ERROR(storescuLogger, "No conversion to transfer syntax " << netTransfer.getXferName() << " possible!"); + renameFile(fname, ".bad"); + return cond; + } +#endif + + /* prepare the transmission of data */ + bzero(OFreinterpret_cast(char *, &req), sizeof(req)); + req.MessageID = msgId; + OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID)); + OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, sizeof(req.AffectedSOPInstanceUID)); + req.DataSetType = DIMSE_DATASET_PRESENT; + req.Priority = DIMSE_PRIORITY_MEDIUM; + + /* if required, dump some more general information */ + OFLOG_INFO(storescuLogger, "Sending Store Request (MsgID " << msgId << ", " + << dcmSOPClassUIDToModality(sopClass, "OT") << ")"); + + /* finally conduct transmission of data */ + cond = DIMSE_storeUser(assoc, presID, &req, + NULL, dcmff.getDataset(), progressCallback, NULL, + opt_blockMode, opt_dimse_timeout, + &rsp, &statusDetail, NULL, OFstatic_cast(long, OFStandard::getFileSize(fname))); + + /* + * If store command completed normally, with a status + * of success or some warning then the image was accepted. + */ + if (cond == EC_Normal && (rsp.DimseStatus == STATUS_Success || DICOM_WARNING_STATUS(rsp.DimseStatus))) + { + unsuccessfulStoreEncountered = OFFalse; + renameFile(fname, ".done"); + } + else + { + renameFile(fname, ".bad"); + } + + /* remember the response's status for later transmissions of data */ + lastStatusCode = rsp.DimseStatus; + + /* dump some more general information */ + if (cond == EC_Normal) + { + OFString temp_str; + if (storescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + OFLOG_INFO(storescuLogger, "Received Store Response"); + OFLOG_DEBUG(storescuLogger, DIMSE_dumpMessage(temp_str, rsp, DIMSE_INCOMING, NULL, presID)); + } else { + OFLOG_INFO(storescuLogger, "Received Store Response (" << DU_cstoreStatusString(rsp.DimseStatus) << ")"); + } + } + else + { + OFString temp_str; + OFLOG_ERROR(storescuLogger, "Store Failed, file: " << fname << ":" << OFendl << DimseCondition::dump(temp_str, cond)); + } + + /* dump status detail information if there is some */ + if (statusDetail != NULL) { + OFLOG_DEBUG(storescuLogger, "Status Detail:" << OFendl << DcmObject::PrintHelper(*statusDetail)); + delete statusDetail; + } + /* return */ + return cond; +} + + +static OFCondition +cstore(T_ASC_Association *assoc, const OFString &fname) + /* + * This function will process the given file as often as is specified by opt_repeatCount. + * "Process" in this case means "read file, send C-STORE-RQ, receive C-STORE-RSP". + * + * Parameters: + * assoc - [in] The association (network connection to another DICOM application). + * fname - [in] Name of the file which shall be processed. + */ +{ + OFCondition cond = EC_Normal; + + /* opt_repeatCount specifies how many times a certain file shall be processed */ + int n = OFstatic_cast(int, opt_repeatCount); + + /* as long as no error occurred and the counter does not equal 0 */ + while ((cond.good()) && n-- && !(opt_haltOnUnsuccessfulStore && unsuccessfulStoreEncountered)) + { + /* process file (read file, send C-STORE-RQ, receive C-STORE-RSP) */ + cond = storeSCU(assoc, fname.c_str()); + } + + // we don't want to return an error code if --no-halt was specified. + if (!opt_haltOnUnsuccessfulStore) + { + cond = EC_Normal; + } + + /* return result value */ + return cond; +} + + +static OFBool +findSOPClassAndInstanceInFile( + const char *fname, + char *sopClass, + size_t sopClassSize, + char *sopInstance, + size_t sopInstanceSize) +{ + DcmFileFormat ff; + if (!ff.loadFile(fname, EXS_Unknown, EGL_noChange, DCM_MaxReadLength, opt_readMode).good()) + return OFFalse; + + /* look in the meta-header first */ + OFBool found = DU_findSOPClassAndInstanceInDataSet(ff.getMetaInfo(), sopClass, sopClassSize, sopInstance, sopInstanceSize, opt_correctUIDPadding); + + if (!found) + found = DU_findSOPClassAndInstanceInDataSet(ff.getDataset(), sopClass, sopClassSize, sopInstance, sopInstanceSize, opt_correctUIDPadding); + + return found; +} + + +static OFCondition +configureUserIdentityRequest(T_ASC_Parameters *params) +{ + OFCondition cond = EC_Normal; + switch (opt_identMode) + { + case ASC_USER_IDENTITY_USER: + { + cond = ASC_setIdentRQUserOnly(params, opt_user, opt_identResponse); + return cond; + } + case ASC_USER_IDENTITY_USER_PASSWORD: + { + cond = ASC_setIdentRQUserPassword(params, opt_user, opt_password, opt_identResponse); + return cond; + } + case ASC_USER_IDENTITY_KERBEROS: + case ASC_USER_IDENTITY_SAML: + case ASC_USER_IDENTITY_JWT: + { + OFFile identFile; + if (!identFile.fopen(opt_identFile.c_str(), "rb")) + { + OFString openerror; + identFile.getLastErrorString(openerror); + OFLOG_ERROR(storescuLogger, "Unable to open Kerberos, SAML or JWT file: " << openerror); + return EC_IllegalCall; + } + // determine file size + offile_off_t result = identFile.fseek(0, SEEK_END); + if (result != 0) + return EC_IllegalParameter; + offile_off_t filesize = identFile.ftell(); + identFile.rewind(); + if (filesize > 65535) + { + OFLOG_INFO(storescuLogger, "Kerberos, SAML or JWT file is larger than 65535 bytes, bytes after that position are ignored"); + filesize = 65535; + } + + char *buf = new char[OFstatic_cast(unsigned int, filesize)]; + size_t bytesRead = identFile.fread(buf, 1, OFstatic_cast(size_t, filesize)); + identFile.fclose(); + if (bytesRead == 0) + { + OFLOG_ERROR(storescuLogger, "Unable to read Kerberos, SAML or JWT info from file: File empty?"); + delete[] buf; + return EC_IllegalCall; + } + // Casting to Uint16 should be safe since it is checked above that file + // size does not exceed 65535 bytes. + if (opt_identMode == ASC_USER_IDENTITY_KERBEROS) + cond = ASC_setIdentRQKerberos(params, buf, OFstatic_cast(Uint16,bytesRead), opt_identResponse); + else if (opt_identMode == ASC_USER_IDENTITY_SAML) + cond = ASC_setIdentRQSaml(params, buf, OFstatic_cast(Uint16,bytesRead), opt_identResponse); + else // JWT + cond = ASC_setIdentRQJwt(params, buf, OFstatic_cast(Uint16,bytesRead), opt_identResponse); + delete[] buf; + break; + } + default: + { + cond = EC_IllegalCall; + } + } + if (cond.bad()) + { + OFString temp_str; + OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond)); + } + return cond; +} + +static OFCondition +checkUserIdentityResponse(T_ASC_Parameters *params) +{ + if (params == NULL) + return ASC_NULLKEY; + + /* So far it is only checked whether a requested, positive response was + actually received */ + + // In case we sent no user identity request, there are no checks at all + if ((opt_identMode == ASC_USER_IDENTITY_NONE) || (!opt_identResponse)) + return EC_Normal; + + // If positive response was requested, we expect a corresponding response + if ((opt_identMode == ASC_USER_IDENTITY_USER) || (opt_identMode == ASC_USER_IDENTITY_USER_PASSWORD)) + { + UserIdentityNegotiationSubItemAC *rsp = params->DULparams.ackUserIdentNeg; + if (rsp == NULL) + { + OFLOG_ERROR(storescuLogger, "User Identity Negotiation failed: Positive response requested but none received"); + return ASC_USERIDENTIFICATIONFAILED; + } + } + return EC_Normal; +} diff --git a/dcmnet/apps/termscu.cc b/dcmnet/apps/termscu.cc new file mode 100644 index 00000000..4282d94f --- /dev/null +++ b/dcmnet/apps/termscu.cc @@ -0,0 +1,282 @@ +/* + * + * Copyright (C) 2005-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmnet + * + * Author: Thomas Wilkens + * + * Purpose: Termination Service Class User (negotiates the private shutdown + * SOP class in order to shutdown server applications) + * + */ + +// ---------------------------------------------------------------------------- + +#include "dcmtk/config/osconfig.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CSTDARG +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmnet/assoc.h" +#include "dcmtk/dcmnet/dimse.h" + +#ifdef WITH_ZLIB +#include +#endif + +// ---------------------------------------------------------------------------- + +#define OFFIS_CONSOLE_APPLICATION "termscu" +#define APPLICATIONTITLE "TERMSCU" +#define PEERAPPLICATIONTITLE "ANY-SCP" +#define SHORTCOL 4 +#define LONGCOL 11 + +static OFLogger termscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +// ---------------------------------------------------------------------------- + +int main( int argc, char *argv[] ) +// Date : September 12, 2005 +// Author : Thomas Wilkens +// Task : Main function for this application. +// Parameters : args - [in] Number of command line arguments. +// argv - [in] Command line arguments. +{ + const char *opt_peer = NULL; + OFCmdUnsignedInt opt_port = 104; + const char *opt_peerTitle = PEERAPPLICATIONTITLE; + const char *opt_ourTitle = APPLICATIONTITLE; + OFCmdUnsignedInt opt_maxReceivePDULength = ASC_DEFAULTMAXPDU; + T_ASC_Network *net; + T_ASC_Parameters *params; + T_ASC_Association *assoc; + DIC_NODENAME peerHost; + char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + const char* transferSyntaxes[] = { UID_LittleEndianImplicitTransferSyntax, UID_LittleEndianExplicitTransferSyntax, UID_BigEndianExplicitTransferSyntax }; + int transferSyntaxCount = 3; + + OFStandard::initializeNetwork(); + + char tempstr[20]; + OFString temp_str; + OFConsoleApplication app( OFFIS_CONSOLE_APPLICATION , "DICOM termination SCU", rcsid ); + OFCommandLine cmd; + + cmd.setParamColumn( LONGCOL + SHORTCOL + 4 ); + cmd.addParam("peer", "hostname of DICOM peer"); + cmd.addParam("port", "tcp/ip port number of peer"); + + cmd.setOptionColumns( LONGCOL, SHORTCOL ); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("network options:"); + cmd.addSubGroup("application entity titles:"); + OFString opt1 = "set my calling AE title (default: "; + opt1 += APPLICATIONTITLE; + opt1 += ")"; + cmd.addOption("--aetitle", "-aet", 1, "[a]etitle: string", opt1.c_str()); + OFString opt2 = "set called AE title of peer (default: "; + opt2 += PEERAPPLICATIONTITLE; + opt2 += ")"; + cmd.addOption("--call", "-aec", 1, "[a]etitle: string", opt2.c_str()); + cmd.addSubGroup("other network options:"); + OFString opt3 = "set max receive pdu to n bytes (default: "; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_DEFAULTMAXPDU)); + opt3 += tempstr; + opt3 += ")"; + OFString opt4 = "[n]umber of bytes: integer ("; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MINIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ".."; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MAXIMUMPDUSIZE)); + opt4 += tempstr; + opt4 += ")"; + cmd.addOption("--max-pdu", "-pdu", 1, opt4.c_str(), opt3.c_str()); + + // evaluate command line + prepareCmdLineArgs( argc, argv, OFFIS_CONSOLE_APPLICATION ); + if( app.parseCommandLine( cmd, argc, argv ) ) + { + // check exclusive options first + if (cmd.hasExclusiveOption()) + { + if( cmd.findOption("--version") ) + { + app.printHeader( OFTrue /*print host identifier*/ ); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return( 0 ); + } + } + + // command line parameters + cmd.getParam( 1, opt_peer ); + app.checkParam( cmd.getParamAndCheckMinMax( 2, opt_port, 1, 65535 ) ); + + // command line options + OFLog::configureFromCommandLine(cmd, app); + + if( cmd.findOption("--aetitle") ) + app.checkValue( cmd.getValue( opt_ourTitle ) ); + if( cmd.findOption("--call") ) + app.checkValue( cmd.getValue( opt_peerTitle ) ); + if( cmd.findOption("--max-pdu") ) + app.checkValue( cmd.getValueAndCheckMinMax( opt_maxReceivePDULength, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE ) ); + } + + /* print resource identifier */ + OFLOG_DEBUG(termscuLogger, rcsid << OFendl); + + // make sure data dictionary is loaded + if( !dcmDataDict.isDictionaryLoaded() ) + OFLOG_WARN(termscuLogger, "no data dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + + // initialize network + OFCondition cond = ASC_initializeNetwork( NET_REQUESTOR, 0, 30, &net ); + if( cond.bad() ) + { + OFLOG_FATAL(termscuLogger, DimseCondition::dump(temp_str, cond)); + exit( 1 ); + } + + // initialize asscociation parameters + cond = ASC_createAssociationParameters( ¶ms, opt_maxReceivePDULength ); + if( cond.bad() ) + { + OFLOG_FATAL(termscuLogger, DimseCondition::dump(temp_str, cond)); + exit( 1 ); + } + + // set this application's title and the called application's title in the params structure + ASC_setAPTitles( params, opt_ourTitle, opt_peerTitle, NULL ); + + // set the transport layer type (type of network connection) in the params structure + cond = ASC_setTransportLayerType( params, OFFalse ); + if( cond.bad() ) + { + OFLOG_FATAL(termscuLogger, DimseCondition::dump(temp_str, cond)); + return( 1 ); + } + + // figure out the presentation addresses and copy the + // corresponding values into the association parameters. + sprintf( peerHost, "%s:%d", opt_peer, OFstatic_cast(int, opt_port)); + ASC_setPresentationAddresses( params, OFStandard::getHostName().c_str(), peerHost ); + + // set the presentation context which will be negotiated + // when the network connection will be established + cond = ASC_addPresentationContext( params, 1, UID_PrivateShutdownSOPClass, transferSyntaxes, transferSyntaxCount ); + if( cond.bad() ) + { + OFLOG_FATAL(termscuLogger, DimseCondition::dump(temp_str, cond)); + exit(1); + } + + // dump presentation contexts + OFLOG_DEBUG(termscuLogger, "Request Parameters:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_RQ)); + + // dump information + OFLOG_INFO(termscuLogger, "Requesting Association"); + + // create association + cond = ASC_requestAssociation( net, params, &assoc ); + if( cond.bad() ) + { + if( cond == DUL_ASSOCIATIONREJECTED ) + { + T_ASC_RejectParameters rej; + ASC_getRejectParameters( params, &rej ); + OFLOG_FATAL(termscuLogger, "Association Rejected: " << OFendl << ASC_printRejectParameters(temp_str, &rej)); + exit( 1 ); + } + else + { + OFLOG_FATAL(termscuLogger, "Association Request Failed: " << DimseCondition::dump(temp_str, cond)); + exit( 1 ); + } + } + + // dump the presentation contexts which have been accepted/refused + OFLOG_DEBUG(termscuLogger, "Association Parameters Negotiated:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_AC)); + + // count the presentation contexts which have been accepted by the SCP + // If there are none, finish the execution + if( ASC_countAcceptedPresentationContexts( params ) == 0 ) + { + OFLOG_FATAL(termscuLogger, "No Acceptable Presentation Contexts"); + exit( 1 ); + } + + // actually, the execution should never get to this point, because when the + // private shutdown SOP class is negotiated, an association shall always be + // rejected by an SCP; and if this application sends an association request + // to another application which does not know of the private shutdown SOP + // class, the above if-condition should have been met, so that we never + // actually get to this point here; nevertheless, the following code is con- + // tained in this file in order to "do nothing" if an association was accepted + + // dump general information concerning the establishment of the network connection if required + OFLOG_INFO(termscuLogger, "Association Accepted (Max Send PDV: " << assoc->sendPDVLength << ")"); + + // + // do nothing when the association was accepted + // + + // dump information + OFLOG_INFO(termscuLogger, "Releasing Association"); + + // release association + cond = ASC_releaseAssociation( assoc ); + if( cond.bad() ) + { + OFLOG_FATAL(termscuLogger, "Association Release Failed: " << DimseCondition::dump(temp_str, cond)); + exit( 1 ); + } + + // destroy the association + cond = ASC_destroyAssociation( &assoc ); + if( cond.bad() ) + { + OFLOG_FATAL(termscuLogger, DimseCondition::dump(temp_str, cond)); + exit( 1 ); + } + + // drop the network + cond = ASC_dropNetwork( &net ); + if( cond.bad() ) + { + OFLOG_FATAL(termscuLogger, DimseCondition::dump(temp_str, cond)); + exit( 1 ); + } + + OFStandard::shutdownNetwork(); + + return( 0 ); +} + +// ---------------------------------------------------------------------------- diff --git a/dcmnet/configure b/dcmnet/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmnet/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmnet/data/Makefile.in b/dcmnet/data/Makefile.in new file mode 100644 index 00000000..c0d3ac06 --- /dev/null +++ b/dcmnet/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmnet/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmnet/docs/CMakeLists.txt b/dcmnet/docs/CMakeLists.txt new file mode 100644 index 00000000..176ffbb0 --- /dev/null +++ b/dcmnet/docs/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES asconfig.txt testing.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc) diff --git a/dcmnet/docs/Makefile.in b/dcmnet/docs/Makefile.in new file mode 100644 index 00000000..06cd2d07 --- /dev/null +++ b/dcmnet/docs/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmnet/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = asconfig.txt testing.txt + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(docdir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(docdir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmnet/docs/asconfig.txt b/dcmnet/docs/asconfig.txt new file mode 100644 index 00000000..53080e94 --- /dev/null +++ b/dcmnet/docs/asconfig.txt @@ -0,0 +1,236 @@ + +ASSOCIATION NEGOTIATION PROFILES AND CONFIGURATION FILES + + Beginning with release 3.5.3, DCMTK provides a flexible mechanism for + specifying the DICOM network association negotiation behaviour of an + application, based on so-called "association negotiation profiles" + which may be read from a configuration file. + + This mechanism is currently enabled in the storescu and storescp + applications. + + +1. CONFIGURATION FILE FORMAT + + The configuration file is a simple text file resembling well-known + "INI" files on the Windows platform. Lines consisting only of + whitespace characters and comment lines starting with a '#' character + in the first column are ignored. Configuration file entries use the + following syntax: + Key = Value + + The key must start in the first column of the line. The case is not + significant for the key, however, it is for the value. Whitespace + characters before and after the '=' separating key and value are + ignored. + + Entries are grouped into sections using section headings, which are + also insensitive to case and whitespace characters: + [Section] + + The well-known "INI" syntax is extended by the definition of + supersections which define a grouping for sections, using the + following syntax: + [[Supersection]] + + The content of the configuration file needs to establish a true tree + structure, i. e. each setting must be part of a section and each + section must be part of one supersection. + + +2. CONFIGURATION FILE STRUCTURE + + A configuration file for association negotiation profiles may contain + the following supersections: + [[TransferSyntaxes]] + [[PresentationContexts]] + [[Profiles]] + [[SCPSCURoleSelection]] + [[ExtendedNegotiation]] + The first three supersections are mandatory, the others are optional. + + +2.1 TRANSFER SYNTAXES + +This supersection contains one or more sections with arbitrary +user-defined but unique section names that are used as symbolic labels. +Within each section, one or more key/value pairs are contained. The key +names are "TransferSyntax1", "TransferSyntax2" etc. (without leading +zeroes before the number!), in increasing order. + +The values may either be DICOM Unique Identifiers (UIDs) in the form +defined by the DICOM standard, or symbolic UID names as used throughout +DCMTK and defined in the "UID Name Map" in file dcmdata/libsrc/dcuid.cc. +Each value must denote a standard or private DICOM transfer syntax. +Within each section (transfer syntax list), no transfer syntax should be +repeated. + +The following example shows two sections (transfer syntax lists), one +using symbolic transfer syntax names, another using a numeric UID. + +[Uncompressed] +TransferSyntax1 = LittleEndianExplicit +TransferSyntax2 = BigEndianExplicit +TransferSyntax3 = LittleEndianImplicit + +[JPEGBaseline] +TransferSyntax1 = 1.2.840.10008.1.2.4.50 + +There are two special symbolic transfer syntax names that are recognized +by the parser: "LocalEndianExplicit" and "OppositeEndianExplicit". These +are interpreted at runtime depending on the byte order of the machine +on which the application is executed: + +On a little endian machine (e.g. x86) + - "LocalEndianExplicit" is interpreted as "LittleEndianExplicit" + - "OppositeEndianExplicit" is interpreted as "BigEndianExplicit" + +On a big endian machine (Sparc, M68K, MIPS) + - "LocalEndianExplicit" is interpreted as "BigEndianExplicit" + - "OppositeEndianExplicit" is interpreted as "LittleEndianExplicit" + + +2.2 PRESENTATION CONTEXTS + +This supersection contains one or more sections with arbitrary +user-defined but unique section names that are used as symbolic labels. +Within each section, one or more key/value pairs are contained. The key +names are "PresentationContext1", "PresentationContext2" etc., in +increasing order. Each list must not contain more than 128 entries, +due to the limitation of the DICOM network protocol to 128 presentation +contexts per association. + +Each value consists of two parts, separated by a single backslash +character ('\'). The first value denotes a DICOM SOP Class UID or +Meta SOP Class UID, standard or private. Again either a numeric UID +or a symbolic value as defined in DCMTK can be used. + +The second part denotes a list of transfer syntaxes defined in the +[[TransferSyntaxes]] supersection. The list is referenced by its +section header, which is used as a symbolic label here. + +The following example shows one presentation context list that could +be used by an association requestor (Store SCU) to negotiate both +lossy-compressed and uncompressed transmission of DICOM ultrasound +images. + +[StorageSCUJPEGBaselineAndUncompressed] +PresentationContext1 = UltrasoundImageStorage\JPEGBaseline +PresentationContext2 = UltrasoundImageStorage\Uncompressed +PresentationContext3 = UltrasoundMultiframeImageStorage\JPEGBaseline +PresentationContext4 = UltrasoundMultiframeImageStorage\Uncompressed + +In the case of an association acceptor (SCP), each SOP class must appear +only once in the list. The following example would be a valid transfer +syntax list for an SCP, accepting only uncompressed ultrasound images: + +[StorageSCPUncompressed] +PresentationContext1 = UltrasoundImageStorage\Uncompressed +PresentationContext2 = UltrasoundMultiframeImageStorage\Uncompressed + +It should be noted that it is the user's responsibility to enforce the +rules defined in the DICOM standard on default transfer syntaxes, i. e. +LittleEndianImplicit has to be offered/accepted for each SOP class in at +least one presentation context unless the image is only available in +lossy compressed form. + + +2.3 SCP/SCU ROLE SELECTION + +This optional supersection contains one or more sections with arbitrary +user-defined but unique section names that are used as symbolic labels. +Within each section, one or more key/value pairs are contained. The key +names are "Role1", "Role2" etc., in increasing order. + +Each value consists of two parts, separated by a single backslash +character ('\'). The first value denotes a DICOM SOP Class UID or +Meta SOP Class UID, standard or private. Again either a numeric UID +or a symbolic value as defined in DCMTK can be used. Each SOP class +should only appear once in the list. + +The second part denotes the roles the application is going to negotiate +for this SOP class. Possible keywords are "SCU", "SCP", or "BOTH", +indicating that the application supports the SCU role, the SCP role or +both roles. Any SOP class that is negotiated but not contained in the +SCP/SCU role selection list will be negotiated with default roles, +i. e. association requestor is SCU and association acceptor is SCP. + +The following example shows a list for SCP/SCU role selection where +an application supports both SCU and SCP roles for transmission +of ultrasound images. + +[USStorageBothRoles] +Role1 = UltrasoundImageStorage\BOTH +Role2 = UltrasoundMultiframeImageStorage\BOTH + +It should be noted that neither storescu nor storescp currently support +SCP/SCU role negotiation, so this functionality should not be used with +these two tools. + + +2.4 EXTENDED NEGOTIATION + +This optional supersection contains one or more sections with arbitrary +user-defined but unique section names that are used as symbolic labels. +Within each section, one or more key/value pairs are contained. The key +names are "ExtendedNegotiation1", "ExtendedNegotiation2" etc., in +increasing order. + +Each value consists of two parts, separated by a single backslash +character ('\'). The first value denotes a DICOM SOP Class UID or +Meta SOP Class UID, standard or private. Again either a numeric UID +or a symbolic value as defined in DCMTK can be used. Each SOP class +should only appear once in the list. + +The second part denotes the SOP class extended negotiation to be +performed for this SOP class. This part contains raw data in hexadecimal +encoding. Any SOP class that is negotiated but not contained in the +extended negotiation list will be negotiated without extended +negotiation. See DICOM standard for a list of SOP classes that support +extended negotiation. + +The following example shows an extended negotiation list for a +storage SCP that accepts Structured Reporting documents as a +"Level 2 SCP", with "Signature Level 3" and no element coercion +(see DICOM part 4, section B.3.1 for details). + +[USSignaturePreservingSCP] +ExtendedNegotiation1 = UltrasoundImageStorage\020003000000 +ExtendedNegotiation2 = UltrasoundMultiframeImageStorage\020003000000 + + +2.5 PROFILES + +This supersection contains one or more sections with arbitrary +user-defined but unique section names that are used as symbolic labels +identifying complete "profiles" for association negotiation that +can be selected by a user or application. + +Each profile consists at least of a reference to one list of +presentation contexts. It may also reference one list of SCP/SCU role +selection items and one list of extended negotiation items, but both of +these are optional. The references use the symbolic section names +defined in the supersections for presentation contexts, role selection +and extended negotiation. + +The following example shows a profile of a hypothetical Storage SCP that +supports the DICOM ultrasound image storage SOP classes both in lossy +JPEG and uncompressed form, supports both SCP and SCU roles for these +SOP classes and also guarantees signature preserving behaviour using +extended negotiation. + +[UltrasoundProfile] +PresentationContexts = StorageSCPJPEGBaselineAndUncompressed +SCPSCURoleSelection = USStorageBothRoles +ExtendedNegotiation = USSignaturePreservingSCP + +A configuration file may contain one or more association negotiation +profiles, but each association request or association negotiation +procedure can use exactly one of these profiles. + + +3. EXAMPLES + +Examples for association negotiation profiles that can be used +with the storescu and storescp tools are provided with DCMTK, as +"storescp.cfg" and "storescu.cfg" in the directory. diff --git a/dcmnet/docs/cptscp.dox b/dcmnet/docs/cptscp.dox new file mode 100644 index 00000000..02e91af0 --- /dev/null +++ b/dcmnet/docs/cptscp.dox @@ -0,0 +1,33 @@ +/** @defgroup SCPThread_Concept SCP Thread Concept + * A SCP object should follow this concept to be used in DcmSCPPool. The + * easiest and recommended way to follow this concept is to derive your + * class from DcmThreadSCP. + * @ingroup Concepts + * @{ + */ + +/** The SCP must be default constructible. + */ +DefaultConstructor(); + +/** The SCP must be configurable by setting it's configuration with + * this method. + * @param config the configuration to be used by the SCP. + * @return EC_Normal if configuration is accepted, error otherwise. + */ +OFCondition setConfig(const DcmSCPConfig& config); + +/** Returns OFTrue if SCP currently runs an association. + * @return OFTrue if currently connected, OFFalse otherwise. + */ +OFBool isConnected(); + +/** Take over incoming association that is in the state that the underlying + * TCP/IP connection is already accepted, while the ACSE negotiation + * is not already done but must be implemented by this method. + * @param assoc The association to run. + @param EC_Normal if association could be handled, error otherwise + */ +OFCondition run( T_ASC_Association* assoc ); + +/// @} diff --git a/dcmnet/docs/dcmnet.dox b/dcmnet/docs/dcmnet.dox new file mode 100644 index 00000000..7753622e --- /dev/null +++ b/dcmnet/docs/dcmnet.dox @@ -0,0 +1,96 @@ +/*! + +\page mod_dcmnet dcmnet: a networking library and utility apps + +This module contains a collection of functions that implement DICOM network +communication, i.e. the DICOM Upper Layer Finite State Machine, the Association +Control Service Element (ACSE) and the DICOM Message Service Element (DIMSE). + +The main interfaces are the structs and functions declared in file assoc.h and +dimse.h. + +There are also two experimental classes for implementing a DICOM Service Class +User and Provider: +\li \b DcmSCU +\li \b DcmSCP + +The following classes are derived from the above experimental classes and +provide a particular DICOM Service: +\li \b DcmStorageSCU +\li \b DcmStorageSCP + +\section dcmnet_tools Tools + +This module contains the following command line tools: +\li \ref dcmrecv +\li \ref dcmsend +\li \ref echoscu +\li \ref findscu +\li \ref getscu +\li \ref movescu +\li \ref storescp +\li \ref storescu +\li \ref termscu + +\section dcmnet_files Files + +The following files provide further documentation: +\li \ref file_asconfig +\li \ref file_testing + +\section dcmnet_examples Examples + +The following example shows a very simple Echo SCU (Verification Service Class +SCU). Most error handling code has been omitted for brevity, also OS specific +code such as WinSock initialization on Win32 is not shown. + +\code +T_ASC_Network *net; // network struct, contains DICOM upper layer FSM etc. +ASC_initializeNetwork(NET_REQUESTOR, 0, 1000 /* timeout */, &net); + +T_ASC_Parameters *params; // parameters of association request +ASC_createAssociationParameters(¶ms, ASC_DEFAULTMAXPDU); + +// set calling and called AE titles +ASC_setAPTitles(params, "ECHOSCU", "ANY-SCP", NULL); + +// the DICOM server accepts connections at server.nowhere.com port 104 +ASC_setPresentationAddresses(params, "localhost", "server.nowhere.com:104"); + +// list of transfer syntaxes, only a single entry here +const char* ts[] = { UID_LittleEndianImplicitTransferSyntax }; + +// add presentation context to association request +ASC_addPresentationContext(params, 1, UID_VerificationSOPClass, ts, 1); + +// request DICOM association +T_ASC_Association *assoc; +if (ASC_requestAssociation(net, params, &assoc).good()) +{ + if (ASC_countAcceptedPresentationContexts(params) == 1) + { + // the remote SCP has accepted the Verification Service Class + DIC_US id = assoc->nextMsgID++; // generate next message ID + DIC_US status; // DIMSE status of C-ECHO-RSP will be stored here + DcmDataset *sd = NULL; // status detail will be stored here + // send C-ECHO-RQ and handle response + DIMSE_echoUser(assoc, id, DIMSE_BLOCKING, 0, &status, &sd); + delete sd; // we don't care about status detail + } +} +ASC_releaseAssociation(assoc); // release association +ASC_destroyAssociation(&assoc); // delete assoc structure +ASC_dropNetwork(&net); // delete net structure +\endcode + +*/ + +/*! + \page file_asconfig asconfig.txt file + \verbinclude asconfig.txt +*/ + +/*! + \page file_testing testing.txt file + \verbinclude testing.txt +*/ diff --git a/dcmnet/docs/dcmrecv.man b/dcmnet/docs/dcmrecv.man new file mode 100644 index 00000000..ed437bfb --- /dev/null +++ b/dcmnet/docs/dcmrecv.man @@ -0,0 +1,360 @@ +/*! + +\if MANPAGES +\page dcmrecv Simple DICOM storage SCP (receiver) +\else +\page dcmrecv dcmrecv: Simple DICOM storage SCP (receiver) +\endif + +\section dcmrecv_synopsis SYNOPSIS + +\verbatim +dcmrecv [options] port +\endverbatim + +\section dcmrecv_description DESCRIPTION + +The \b dcmrecv application implements a Service Class Provider (SCP) for the +Storage Service Class. In contrast to the well-known \b storescp utility, +\b dcmrecv has less options and might, therefore, be easier to use - this also +explains the term "simple" in the title. The main purpose of this application +is to receive a whole bunch of DICOM datasets from a Storage Service Class User +(SCU) and store them to a configurable directory and file structure. + +\section dcmrecv_parameters PARAMETERS + +\verbatim +port tcp/ip port number to listen on +\endverbatim + +\section dcmrecv_options OPTIONS + +\subsection dcmrecv_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger + + +v --verbose-pc + show presentation contexts in verbose mode +\endverbatim + + +\subsection dcmrecv_network_options network options +\verbatim +association negotiation profile from configuration file: + + -xf --config-file [f]ilename, [p]rofile: string + use profile p from configuration file f + +application entity title: + + -aet --aetitle [a]etitle: string + set my AE title (default: DCMRECV) + + -uca --use-called-aetitle + always respond with called AE title + +other network options: + + -ta --acse-timeout [s]econds: integer (default: 30) + timeout for ACSE messages + + -td --dimse-timeout [s]econds: integer (default: unlimited) + timeout for DIMSE messages + + -pdu --max-pdu [n]umber of bytes: integer (4096..131072) + set max receive pdu to n bytes (default: 16384) + + -dhl --disable-host-lookup disable hostname lookup +\endverbatim + +\subsection dcmrecv_output_options output options +\verbatim +general: + + -od --output-directory [d]irectory: string (default: ".") + write received objects to existing directory d + +subdirectory generation: + + -s --no-subdir + do not generate any subdirectories (default) + + +ssd --series-date-subdir + generate subdirectories from series date + +filename generation: + + +fd --default-filenames + generate filename from instance UID (default) + + +fu --unique-filenames + generate unique filename based on new UID + + +fsu --short-unique-names + generate short pseudo-random unique filename + + +fst --system-time-names + generate filename from current system time + + -fe --filename-extension [e]xtension: string (default: none) + append e to all generated filenames + +storage mode: + + -B --normal + allow implicit format conversions (default) + + +B --bit-preserving + write dataset exactly as received + + --ignore + ignore dataset, receive but do not store it +\endverbatim + +\section dcmrecv_notes NOTES + +\subsection dcmrecv_typical_usage Typical Usage + +A typical use case of \b dcmrecv is to receive SOP instances that are sent from +a storage SCU and save them as DICOM files. The following command does exactly +this: + +\verbatim +dcmrecv --verbose --config-file storescp.cfg default +\endverbatim + +If you prefer some automatically created subdirectory structure, shorter file +names and the extension ".dcm" for all DICOM files, use the following command: + +\verbatim +dcmrecv -v -xf storescp.cfg default --series-date-subdir + --short-unique-names + --filename-extension .dcm +\endverbatim + +In case of very large SOP instances or if the dataset should be written exactly +as received (e.g. for debugging purposes), the "bit preserving mode" could be +used: + +\verbatim +dcmrecv -v -xf storescp.cfg default --bit-preserving +\endverbatim + +The received datasets are always stored as DICOM files with the same Transfer +Syntax as used for the network transmission. + +\subsection dcmrecv_dicom_conformance DICOM Conformance + +Basically, the \b dcmrecv application supports all Storage SOP Classes as an +SCP, including private ones. This requires, however, that a corresponding +association negotiation profile is loaded from a configuration file. The format +and semantics of this configuration file are documented in \e asconfig.txt. + +By default, that means if no association negotiation profile is loaded, +\b dcmrecv only supports the Verification SOP Class as an SCP (with default +transfer syntax, i.e. Implicit VR Litte Endian). + +In the future, there might be additional options that allow for specifying the +list of supported Presentation Contexts (i.e. combination of SOP Class and +Transfer Syntaxes) directly, i.e. without loading a configuration file. + +\subsection dcmrecv_subdirectory_generation Subdirectory Generation + +The option \e --series-date-subdir allows for generating subdirectories (below +the specified output directory) based on the value of the data element Series +Date (0008,0021) from the received DICOM dataset. If this value could be +retrieved from the dataset and is valid (i.e. consists of a valid DICOM date +field), the subdirectory structure is as follows: + +\verbatim +/data//// +\endverbatim + +If the Series Date (0008,0021) cannot be retrieved or is invalid, the current +system date is used for the following subdirectory structure: + +\verbatim +/undef// +\endverbatim + +In both cases, \ consists of 4 decimal digits and \ as well as +\ of 2 decimal digits. + +\subsection dcmrecv_filename_generation Filename Generation + +By default, the filenames for storing the received DICOM datasets are generated +according to the following scheme: + +\verbatim +. +\endverbatim + +If the same SOP instance is received twice, a warning message is reported and +the existing file is overwritten. + +The option \e --unique-filenames makes sure that each received DICOM dataset is +stored as a separate file, i.e. no files should ever be overwritten. This is +done by using a newly created unique identifier (UID) for each generated +filename (and the infix ".X" in order to avoid conflicts with real SOP Instance +UID values). The naming scheme for this option is as follows: + +\verbatim +.X. +\endverbatim + +When option \e --short-unique-names is used, the filenames are generated +by some pseudo-random name generator, which also makes sure that there are +no conflicts (i.e. existing files are not overwritten). This is the naming +scheme: + +\verbatim +_ +\endverbatim + +With \ consisting of 16 digits in hexadecimal notation. + +Finally, option \e --system-time-names allows for generating filenames based +on the current system time: + +\verbatim +
Supplement +172 in 2014. + +In the standard, the data inside each Parametric Map object must rely on one of +these data types: + +\li 16 bit unsigned integer +\li 16 bit signed integer +\li 32 bit floating point +\li 64 bit floating point + +All of them are supported by the dcmpmap library. + +The main class of this module is: +\li \b DPMParametricMapIOD + +This module makes heavy use of the \ref mod_dcmiod "dcmiod" module for managing +common IOD attributes and the \ref mod_dcmfg "dcmfg" module for functional group +support. Read the "Examples" sections for more explanations. + +\section dcmpmap_examples Examples + +The following two examples show: +\li How to access and dump information (including the binary data values) from a +Parametric Map object +\li and how to use the API to create such an object yourself. + +\subsection example_dump Dumping information from Parametric Map + +The Parametric Map class uses a template in order to instantiate the correct +pixel data type internally, and to offer a dedicated API for that type. Allowed +types are Uint16, Sint16, Float32 and Float64. + +Since internally the data types are handled in a C++ Variant, the usual concept +to "switch" between these types in code is to use a Visitor which overloads the +operator "()" for each data type that can occur in the Variant. This concept is +also demonstrated below where the type of pixel data is printed. + +The rest of the code uses the API of the \ref mod_dcmiod "dcmiod" and +\ref mod_dcmfg "dcmfg" module in order to get basic information about Patient, +Study, Series and Instance, as well as functional group information, especially +the Real World Value Mapping defined in the file. + +\code +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpmap/dpmparametricmapiod.h" + +static void dumpRWVM(const unsigned long frameNumber, + FGInterface& fg) +{ + FGRealWorldValueMapping* rw = OFstatic_cast(FGRealWorldValueMapping*, fg.get(frameNumber, DcmFGTypes::EFG_REALWORLDVALUEMAPPING)); + if (rw) + { + size_t numMappings = rw->getRealWorldValueMapping().size(); + COUT << " Number of Real World Value Mappings defined: " << numMappings << OFendl; + for (size_t m = 0; m < numMappings; m++) + { + FGRealWorldValueMapping::RWVMItem* item = rw->getRealWorldValueMapping()[m]; + OFString label, expl; + item->getLUTLabel(label); + item->getLUTExplanation(expl); + COUT << " RWVM Mapping #" << m << ":" << OFendl; + COUT << " LUT Label: << " << label << OFendl; + COUT << " LUT Explanation: " << expl << OFendl; + COUT << " Measurement Units Code: " << item->getMeasurementUnitsCode().toString() << OFendl; + size_t numQuant = item->getEntireQuantityDefinitionSequence().size(); + if (numQuant > 0) + { + COUT << " Number of Quantities defined: " << numQuant << OFendl; + for (size_t q = 0; q < numQuant; q++) + { + ContentItemMacro* macro = item->getEntireQuantityDefinitionSequence()[q]; + COUT << " Quantity #" << q << ": " << macro->toString() << OFendl; + } + } + } + } + else + { + CERR << " Error: No Real World Value Mappings defined for frame #" << frameNumber << OFendl; + } +} + +class DumpFramesVisitor +{ +public: + + DumpFramesVisitor(DPMParametricMapIOD* map, + const unsigned long numPerFrame) + : m_Map(map) + , m_numPerFrame(numPerFrame) + { + } + + template + OFBool operator()(DPMParametricMapIOD::Frames& frames) + { + dumpDataType(frames); + for (unsigned long f = 0; f < m_Map->getNumberOfFrames(); f++) + { + COUT << "Dumping info of frame #" << f << ":" << OFendl; + FGInterface& fg = m_Map->getFunctionalGroups(); + dumpRWVM(f, fg); + COUT << "Dumping data for frame #" << f << ": " << OFendl; + T* frame = frames.getFrame(f); + for (unsigned long p = 0; p < m_numPerFrame; p++) + { + COUT << frame[p] << " "; + } + COUT << OFendl << OFendl; + } + return 0; + } + + OFBool operator()(OFCondition& cond) + { + // Avoid compiler warning + (void)cond; + CERR << "Type of data samples not supported" << OFendl; + return OFFalse; + } + + OFBool dumpHeader(DPMParametricMapIOD::Frames& frames) + { + // Avoid compiler warning + (void)frames; + COUT << "File has 32 Bit float data" << OFendl; + return OFFalse; + } + + OFBool dumpHeader(DPMParametricMapIOD::Frames& frames) + { + // Avoid compiler warning + (void)frames; + COUT << "File has 16 Bit unsigned integer data" << OFendl; + return OFFalse; + } + + OFBool dumpHeader(DPMParametricMapIOD::Frames& frames) + { + // Avoid compiler warning + (void)frames; + COUT << "File has 16 Bit signed integer data" << OFendl; + return OFFalse; + } + + OFBool dumpHeader(DPMParametricMapIOD::Frames& frames) + { + // Avoid compiler warning + (void)frames; + COUT << "File has 64 Bit float data" << OFendl; + return OFTrue; + } + + template + OFBool dumpDataType(DPMParametricMapIOD::Frames& frames) + { + // Avoid compiler warning + (void)frames; + CERR << "Type of data samples not supported" << OFendl; + return OFFalse; + } + + DPMParametricMapIOD* m_Map; + unsigned long m_numPerFrame; + +}; + + +static void dumpGeneral(DPMParametricMapIOD& map) +{ + OFString patName, patID, studyUID, studyDate, seriesUID, modality, sopUID; + map.getPatient().getPatientName(patName); + map.getPatient().getPatientID(patID); + map.getStudy().getStudyInstanceUID(studyUID); + map.getStudy().getStudyDate(studyDate); + map.getSeries().getSeriesInstanceUID(seriesUID); + map.getSeries().getModality(modality); + map.getSOPCommon().getSOPInstanceUID(sopUID); + COUT << "Patient Name : " << patName << OFendl; + COUT << "Patient ID : " << patID << OFendl; + COUT << "Study Instance UID : " << studyUID << OFendl; + COUT << "Study Date : " << studyDate << OFendl; + COUT << "Series Instance UID: " << seriesUID << OFendl; + COUT << "SOP Instance UID : " << sopUID << OFendl; + COUT << "---------------------------------------------------------------" << OFendl; + OFBool isPerFrame; + map.getFunctionalGroups().get(0, DcmFGTypes::EFG_REALWORLDVALUEMAPPING, isPerFrame); + if (isPerFrame) + { + COUT << "Real World Value Mapping: Defined per-frame" << OFendl; + } + else + { + COUT << "Real World Value Mapping: Defined shared (i.e. single definition for all frames):" << OFendl; + } + COUT << "---------------------------------------------------------------" << OFendl; +} + + +int main (int argc, char* argv[]) +{ + // OFLog::configure(OFLogger::DEBUG_LOG_LEVEL); + OFString inputFile; + if (argc < 2) + { + CERR << "Usage: dump_pmp " << std::endl; + return 1; + } + else + { + inputFile = argv[1]; + if (!OFStandard::fileExists(inputFile)) + { + CERR << "Input file " << inputFile << " does not exist " << OFendl; + return 1; + } + } + + OFvariant result = DPMParametricMapIOD::loadFile(inputFile); + if (OFget(&result)) + { + DPMParametricMapIOD* map = *OFget(&result); + dumpGeneral(*map); + COUT << "Dumping #" << map->getNumberOfFrames() << " frames of file " << inputFile << OFendl; + Uint16 rows, cols = 0; + map->getRows(rows); + map->getColumns(cols); + unsigned long numPerFrame = rows * cols; + DPMParametricMapIOD::FramesType frames = map->getFrames(); + OFvisit(DumpFramesVisitor(map, numPerFrame), frames); + } + else + { + CERR << "Could not load parametric map: " << (*OFget(&result)).text() << OFendl; + exit(1); + } + exit(0); +} + +\endcode + + +\subsection example_create Creation of Parametric Maps + +The Parametric Map class uses a template in order to instantiate the correct +pixel data type internally, and to offer a dedicated API for that type. Allowed +types are Uint16, Sint16, Float32 and Float64. The example below demonstrates +that the API use is generally the same for all types. + +The procedure in the example (and most of it applies for the general case) is as +follows: + +\li The main() routine calls test_pmap() four times, each time using a different +Image Pixel Module as template parameter which makes sure that the right pixel +data type is used within the created Parametric Map. +\li test_pmap() demonstrates the overall steps to create the map: +\li Create a new Parametric Map by calling DPMParametricMapIOD::create() +(via create_pmap()), and then +\li add shared functional groups, +\li add dimensions, +\li and add frames with the related per-frame functional groups to the object. +\li Finally, general data regarding Patient and Study is set. +\li Note that the order of these steps in test_pmap() does not matter. + + +Per default, DPMParametricMapIOD::create() creates a new DICOM instance, within +a brand-new DICOM Series that belongs to a brand-new DICOM Study. All minimal +information for Patient, Study and Series will be set (e.g. Study, Series and +SOP Instance UID as well as other information that is handed over to the +create() call, like Series Number). Patient Name and ID are left empty per +default. + +Of course, often you might want to put the new instance into an existing Series +instead, or place the brand-new Series into an existing Study or at least assign +it to an existing Patient. The easiest way to to do that is to use the call +import() that imports Patient or even Study, Series and Frame of Reference +information from an existing file, i.e. place it under an existing Patient, +Study and/or Series. + +When adding information to the Parametric Map using the public API, some basic +checks are usually performed on the data. Finally, when calling saveFile(), some +further checks take place, e.g. validating the structure of the functional +groups or making sure that all required element values are set. + +\code + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmpmap/dpmparametricmapiod.h" +#include "dcmtk/dcmfg/fgpixmsr.h" +#include "dcmtk/dcmfg/fgplanpo.h" +#include "dcmtk/dcmfg/fgplanor.h" +#include "dcmtk/dcmfg/fgfracon.h" +#include "dcmtk/dcmfg/fgframeanatomy.h" +#include "dcmtk/dcmfg/fgidentpixeltransform.h" +#include "dcmtk/dcmfg/fgframevoilut.h" +#include "dcmtk/dcmfg/fgrealworldvaluemapping.h" +#include "dcmtk/dcmfg/fgparametricmapframetype.h" + +const size_t NUM_FRAMES = 10; +const Uint16 ROWS = 10; +const Uint16 COLS = 10; +const unsigned long NUM_VALUES_PER_FRAME = ROWS * COLS; + + +// Set Patient and Study example data +static void setGenericData(DPMParametricMapIOD& map) +{ + map.getPatient().setPatientName("Onken^Michael"); + map.getPatient().setPatientID("007"); + map.getStudy().setStudyDate("20160721"); + map.getStudy().setStudyTime("111200"); + map.getStudy().setStudyID("4711"); +} + + +// Create Parametric Map +template +static OFvariant create_pmap() +{ + return DPMParametricMapIOD::create + ( + "MR", // Modality + "1", // Series Number + "1", // Instance Number + ROWS, + COLS, + IODEnhGeneralEquipmentModule::EquipmentInfo("Open Connections GmbH", "make_pmp", "SN_0815", "0.1"), + ContentIdentificationMacro("1", "PARAMAP_LABEL", "Example description from test program", "Onken^Michael"), + "VOLUME", // Image Flavor + "MTT", // Derived Pixel Contrast + DPMTypes::CQ_RESEARCH // Content Qualification + ); +} + + +// Add those functional groups that are common for all frames +static OFCondition addSharedFunctionalGroups(DPMParametricMapIOD& map) +{ + FGPixelMeasures pixelMeasures; + pixelMeasures.setPixelSpacing("1\\1"); + pixelMeasures.setSliceThickness("0.1"); + pixelMeasures.setSpacingBetweenSlices("0.1"); + FGPlaneOrientationPatient planeOrientPatientFG; + planeOrientPatientFG.setImageOrientationPatient("1", "0", "0", "0", "1", "0"); + FGFrameAnatomy frameAnaFG; + frameAnaFG.setLaterality(FGFrameAnatomy::LATERALITY_UNPAIRED); + frameAnaFG.getAnatomy().getAnatomicRegion().set("T-A0100", "SRT", "Brain"); + FGIdentityPixelValueTransformation idTransFG; + FGParametricMapFrameType frameTypeFG; + frameTypeFG.setFrameType("DERIVED\\PRIMARY\\VOLUME\\MTT"); + + // Add groups to Parametric Map + OFCondition result; + if ((result = map.addForAllFrames(pixelMeasures)).good()) + if ((result = map.addForAllFrames(planeOrientPatientFG)).good()) + if ((result = map.addForAllFrames(frameAnaFG)).good()) + if ((result = map.addForAllFrames(idTransFG)).good()) + result = map.addForAllFrames(frameTypeFG); + + return result; +} + + +// Add a single dimension for demonstration purposes based on "Image Position Patient" +static OFCondition addDimensions(DPMParametricMapIOD& map) +{ + IODMultiframeDimensionModule& mod = map.getIODMultiframeDimensionModule(); + OFString dimUID = DcmIODUtil::createUID(0); + OFCondition result = mod.addDimensionIndex(DCM_ImagePositionPatient, dimUID, DCM_RealWorldValueMappingSequence, "Frame position"); + return result; +} + + +// Add one frame to parametric map. Frame number is used to compute some +// varying example data values differing from frame to frame +template +static OFCondition addFrame(DPMParametricMapIOD& map, + const unsigned long frameNo) +{ + // Create example data + + OFVector data(NUM_VALUES_PER_FRAME); + for (size_t n=0; n < data.size(); ++n) + { + data[n] = (n*frameNo+n) + (0.1 * (frameNo % 10)); + } + + Uint16 rows, cols; + OFCondition cond = map.getImagePixel().getRows(rows); + cond = map.getImagePixel().getColumns(cols); + + // Create functional groups + OFVector groups; + OFunique_ptr fgPlanePos(new FGPlanePosPatient); + OFunique_ptr fgFracon(new FGFrameContent); + OFunique_ptr fgRVWM(new FGRealWorldValueMapping()); + FGRealWorldValueMapping::RWVMItem* rvwmItemSimple = new FGRealWorldValueMapping::RWVMItem(); + if (!fgPlanePos || !fgFracon || !fgRVWM || !rvwmItemSimple ) + return EC_MemoryExhausted; + + // Fill in functional group values + + // Real World Value Mapping + rvwmItemSimple->setRealWorldValueSlope(10); + rvwmItemSimple->setRealWorldValueIntercept(0); + rvwmItemSimple->setDoubleFloatRealWorldValueFirstValueMapped(0.12345); + rvwmItemSimple->setDoubleFloatRealWorldValueLastValueMapped(98.7654); + rvwmItemSimple->getMeasurementUnitsCode().set("{counts}/s", "UCUM", "Counts per second"); + rvwmItemSimple->setLUTExplanation("We are mapping trash to junk."); + rvwmItemSimple->setLUTLabel("Just testing"); + CodeSequenceMacro* qCodeName = new CodeSequenceMacro("G-C1C6", "SRT", "Quantity"); + CodeSequenceMacro* qSpec = new CodeSequenceMacro("110805", "SRT", "T2 Weighted MR Signal Intensity"); + ContentItemMacro* quantity = new ContentItemMacro; + if (!quantity || !qSpec || !quantity) + return EC_MemoryExhausted; + quantity->getEntireConceptNameCodeSequence().push_back(qCodeName); + quantity->getEntireConceptCodeSequence().push_back(qSpec); + rvwmItemSimple->getEntireQuantityDefinitionSequence().push_back(quantity); + quantity->setValueType(ContentItemMacro::VT_CODE); + fgRVWM->getRealWorldValueMapping().push_back(rvwmItemSimple); + + // Plane Position + OFStringStream ss; + ss << frameNo; + OFSTRINGSTREAM_GETOFSTRING(ss, framestr) // convert number to string + fgPlanePos->setImagePositionPatient("0", "0", framestr); + + // Frame Content + OFCondition result = fgFracon->setDimensionIndexValues(frameNo+1 /* value within dimension */, 0 /* first dimension */); + + // Add frame with related groups + if (result.good()) + { + // Add frame + groups.push_back(fgPlanePos.get()); + groups.push_back(fgFracon.get()); + groups.push_back(fgRVWM.get()); + groups.push_back(fgPlanePos.get()); + DPMParametricMapIOD::FramesType frames = map.getFrames(); + result = OFget >(&frames)->addFrame(&*data.begin(), NUM_VALUES_PER_FRAME, groups); + } + + return result; +} + + +// Main routine that creates Parametric Maps +template +static OFCondition test_pmap(const OFString& saveDestination) +{ + OFvariant obj = create_pmap(); + if (OFCondition* pCondition = OFget(&obj)) + return *pCondition; + + DPMParametricMapIOD& map = *OFget(&obj); + + OFCondition result; + if ((result = addSharedFunctionalGroups(map)).good()) + if ((result = addDimensions(map)).good()) + { + // Add frames (parametric map data), and per-frame functional groups + for (unsigned long f = 0; result.good() && (f < NUM_FRAMES); f++) + result = addFrame(map, f); + } + + // Set some generic data (keep dciodvfy happy on DICOMDIR warnings) + if (result.good()) + { + setGenericData(map); + } + + // Save + if (result.good()) + { + return map.saveFile(saveDestination.c_str()); + } + else + { + return result; + } +} + + +int main (int argc, char* argv[]) +{ + OFString outputDir; + if (argc < 2) + { + CERR << "Usage: make_pmp " << std::endl; + return 1; + } + else + { + outputDir = argv[1]; + if (!OFStandard::dirExists(outputDir)) + { + CERR << "Output directory " << outputDir << " does not exist " << OFendl; + return 1; + } + } + + //OFLog::configure(OFLogger::DEBUG_LOG_LEVEL); + + // Test all possible parametric map types (signed and unsigned integer, floating point + // and double floating point) + + test_pmap >(outputDir + "/uint_paramap.dcm"); + test_pmap >(outputDir + "/sint_paramap.dcm"); + test_pmap(outputDir + "/float_paramap.dcm"); + test_pmap(outputDir + "/double_paramap.dcm"); + + return 0; +} + +\endcode + +*/ diff --git a/dcmpmap/etc/Makefile.in b/dcmpmap/etc/Makefile.in new file mode 100644 index 00000000..31690d7b --- /dev/null +++ b/dcmpmap/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmpmap/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmpmap/include/CMakeLists.txt b/dcmpmap/include/CMakeLists.txt new file mode 100644 index 00000000..5fd68015 --- /dev/null +++ b/dcmpmap/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmpmap DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmpmap/include/Makefile.in b/dcmpmap/include/Makefile.in new file mode 100644 index 00000000..37af7030 --- /dev/null +++ b/dcmpmap/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmpmap/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmpmap + for file in dcmtk/dcmpmap/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmpmap ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmpmap/include/dcmtk/dcmpmap/dpmdef.h b/dcmpmap/include/dcmtk/dcmpmap/dpmdef.h new file mode 100644 index 00000000..82f89c09 --- /dev/null +++ b/dcmpmap/include/dcmtk/dcmpmap/dpmdef.h @@ -0,0 +1,37 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Michael Onken + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DPMDEF_H +#define DPMDEF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofdefine.h" + +// definitions for DLL/shared library exports + +#ifdef dcmpmap_EXPORTS +#define DCMTK_DCMPMAP_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMPMAP_EXPORT DCMTK_DECL_IMPORT +#endif + +#endif // DPMDEF_H diff --git a/dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapimage.h b/dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapimage.h new file mode 100644 index 00000000..0da18dee --- /dev/null +++ b/dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapimage.h @@ -0,0 +1,304 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Parametric Map Image Module + * + */ + +#ifndef DPMMODPARAMETRICMAPIMAGE_H +#define DPMMODPARAMETRICMAPIMAGE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmpmap/dpmdef.h" + +/** Class representing the Parametric Map Image Module: + * + * ImageType: (CS, 2-n, 1) + * SamplesPerPixel: (US, 1, 1) + * PhotometricInterpretation: (CS, 1, 1) + * BitsAllocated: (US, 1, 1) + * BitsStored: (US, 1, 1C) + * HighBit: (US, 1, 1C) + * PresentationLUTShape: (CS, 1, 1) + * LossyImageCompression: (CS, 1, 1) + * LossyImageCompressionRatio: (DS, 1-n, 1C) + * LossyImageCompressionMethod: (CS, 1-n, 1C) + * BurnedInAnnotation: (CS, 1, 1) + * RecognizableVisualFeatures: (CS, 1, 1) + * ContentQualification: (CS, 1, 1) + */ +class DCMTK_DCMPMAP_EXPORT DPMParametricMapImageModule : public IODModule +{ +public: + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + DPMParametricMapImageModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + DPMParametricMapImageModule(); + + /** Destructor + */ + virtual ~DPMParametricMapImageModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("DPMParametricMapImageModule") + * @return Name of the module ("DPMParametricMapImageModule") + */ + virtual OFString getName() const; + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Get Image Type + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageType(OFString &value, + const signed long pos = 0) const; + + /** Get Samples Per Pixel + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSamplesPerPixel(Uint16 &value, + const signed long pos = 0) const; + + /** Get Photometric Interpretation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhotometricInterpretation(OFString &value, + const signed long pos = 0) const; + + /** Get Bits Allocated + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsAllocated(Uint16 &value, + const signed long pos = 0) const; + + /** Get Bits Stored + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsStored(Uint16 &value, + const signed long pos = 0) const; + + /** Get High Bit + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getHighBit(Uint16 &value, + const signed long pos = 0) const; + + /** Get Presentation LUT Shape + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPresentationLUTShape(OFString &value, + const signed long pos = 0) const; + + /** Get Lossy Image Compression + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompression(OFString &value, + const signed long pos = 0) const; + + /** Get Lossy Image Compression Ratio + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(OFString &value, + const signed long pos = 0) const; + + /** Get Lossy Image Compression Method + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionMethod(OFString &value, + const signed long pos = 0) const; + + /** Get Burned In Annotation + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBurnedInAnnotation(OFString &value, + const signed long pos = 0) const; + + /** Get Recognizable Visual Features + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRecognizableVisualFeatures(OFString &value, + const signed long pos = 0) const; + + /** Get Content Qualification + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, + const signed long pos = 0) const; + + /** Set Image Type + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (2-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageType(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Samples Per Pixel + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (US) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSamplesPerPixel(const Uint16 &value, + const OFBool checkValue = OFTrue); + + /** Set Photometric Interpretation + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhotometricInterpretation(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Bits Allocated + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (US) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsAllocated(const Uint16 &value, + const OFBool checkValue = OFTrue); + + /** Set Bits Stored + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (US) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsStored(const Uint16 &value, + const OFBool checkValue = OFTrue); + + /** Set High Bit + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (US) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setHighBit(const Uint16 &value, + const OFBool checkValue = OFTrue); + + /** Set Presentation LUT Shape + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPresentationLUTShape(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompression(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression Ratio + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionRatio(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Lossy Image Compression Method + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionMethod(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Burned In Annotation + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBurnedInAnnotation(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Recognizable Visual Features + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecognizableVisualFeatures(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set ContentQualification + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + /// The name of this module ("DPMParametricMapImageModule") + static const OFString m_ModuleName; +}; + +#endif // DPMMODPARAMETRICMAPIMAGE_H diff --git a/dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapseries.h b/dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapseries.h new file mode 100644 index 00000000..1c8b1b62 --- /dev/null +++ b/dcmpmap/include/dcmtk/dcmpmap/dpmmodparametricmapseries.h @@ -0,0 +1,133 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Parametric Map Series Module + * + */ + +#ifndef DPMMODPARAMETRICMAPSERIES_H +#define DPMMODPARAMETRICMAPSERIES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofmem.h" +#include "dcmtk/dcmiod/iodrules.h" +#include "dcmtk/dcmiod/modbase.h" +#include "dcmtk/dcmpmap/dpmdef.h" +#include "dcmtk/dcmiod/iodmacro.h" + +/** Class representing the Parametric Map Series Module: + * + * Modality: (CS, 1, 1) + * SeriesNumber: (IS, 1, 1) + * ReferencedPerformedProcedureStepSequence: (SQ, 1, 1C) + */ +class DCMTK_DCMPMAP_EXPORT DPMParametricMapSeriesModule : public IODModule +{ +public: + /** Constructor + * @param item The item to be used for data storage. If NULL, the + * class creates an empty data container. + * @param rules The rule set for this class. If NULL, the class creates + * one from scratch and adds its values. + */ + DPMParametricMapSeriesModule(OFshared_ptr item, + OFshared_ptr rules); + + /** Constructor + */ + DPMParametricMapSeriesModule(); + + /** Destructor + */ + virtual ~DPMParametricMapSeriesModule(); + + /** Resets rules to their original values + */ + virtual void resetRules(); + + /** Get name of module ("DPMParametricMapSeriesModule") + * @return Name of the module ("DPMParametricMapSeriesModule") + */ + virtual OFString getName() const; + + /** Read attributes from given item into this class + * @param source The source to read from + * @param clearOldData If OFTrue, old data is cleared before reading. Otherwise + * old data is overwritten (or amended) + * @result EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& source, + const OFBool clearOldData = OFTrue); + + /** Write attributes from this class into given item + * @param destination The item to write to + * @result EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& destination); + + /** Get Modality + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, + const signed long pos = 0) const; + + /** Get Series Number + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, + const signed long pos = 0) const; + + /** Get reference to the Referenced Performed Procedure Step Sequence + * @return a reference to the Referenced Performed Procedure Step Sequence + */ + virtual SOPInstanceReferenceMacro* getReferencedPerformedProcedureStepSequence(); + + /** Get a reference to the entire Referenced Performed Procedure Step Sequence, including items + * exceeding the value multiplicity restriction of "1" + * @return a reference to the entire Referenced Performed Procedure Step Sequence + */ + virtual OFVector& getEntireReferencedPerformedProcedureStepSequence(); + + /** Set Modality + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, + const OFBool checkValue = OFTrue); + + /** Set Series Number + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, + const OFBool checkValue = OFTrue); + +private: + /// The name of this module ("DPMParametricMapSeriesModule") + static const OFString m_ModuleName; + + /// ReferencedPerformedProcedureStepSequence + OFVector m_ReferencedPerformedProcedureStepSequence; +}; + +#endif // DPMMODPARAMETRICMAPSERIES_H diff --git a/dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapbase.h b/dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapbase.h new file mode 100644 index 00000000..6200c6a4 --- /dev/null +++ b/dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapbase.h @@ -0,0 +1,249 @@ +/* + * + * Copyright (C) 2016-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Generated base class representing the Parametric Map IOD + * + */ + +#ifndef DPMPARAMETRICMAPBASE_H +#define DPMPARAMETRICMAPBASE_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmfg/fginterface.h" +#include "dcmtk/dcmfg/fgderimg.h" +#include "dcmtk/dcmfg/fgfracon.h" +#include "dcmtk/dcmfg/fgframeanatomy.h" +#include "dcmtk/dcmfg/fgframevoilut.h" +#include "dcmtk/dcmfg/fgpixeltransform.h" +#include "dcmtk/dcmfg/fgparametricmapframetype.h" +#include "dcmtk/dcmfg/fgpixmsr.h" +#include "dcmtk/dcmfg/fgplanor.h" +#include "dcmtk/dcmfg/fgplanpo.h" +#include "dcmtk/dcmfg/fgrealworldvaluemapping.h" +#include "dcmtk/dcmiod/iodimage.h" +#include "dcmtk/dcmiod/modacquisitioncontext.h" +#include "dcmtk/dcmiod/modcommoninstanceref.h" +#include "dcmtk/dcmiod/modenhequipment.h" +#include "dcmtk/dcmiod/modequipment.h" +#include "dcmtk/dcmiod/modgeneralimage.h" +#include "dcmtk/dcmiod/modgeneralseries.h" +#include "dcmtk/dcmiod/modgeneralstudy.h" +#include "dcmtk/dcmiod/modmultiframedimension.h" +#include "dcmtk/dcmiod/modmultiframefg.h" +#include "dcmtk/dcmiod/modpatient.h" +#include "dcmtk/dcmiod/modpatientstudy.h" +#include "dcmtk/dcmiod/modsopcommon.h" +#include "dcmtk/dcmiod/modimagepixel.h" +#include "dcmtk/dcmiod/modfloatingpointimagepixel.h" +#include "dcmtk/dcmpmap/dpmmodparametricmapimage.h" +#include "dcmtk/dcmpmap/dpmmodparametricmapseries.h" +#include "dcmtk/dcmpmap/dpmdef.h" + +/** Class for managing the Parametric Map IOD attributes. Template parameter defines the type of pixel data + * to use: Unsigned or signed 16 bit integer, or 32 bit floating point, or 64 bit floating point data. + */ +class DCMTK_DCMPMAP_EXPORT DPMParametricMapBase +: public DcmIODImage +< + IODImagePixelModule, + IODImagePixelModule, + IODFloatingPointImagePixelModule, + IODDoubleFloatingPointImagePixelModule +> +{ + +public: + + /** Virtual Destructor + */ + virtual ~DPMParametricMapBase(); + + // -------------------- loading and saving --------------------- + + /** Save current object to given filename + * @param filename The file to write to + * @param writeXfer The transfer syntax to be used + * @return EC_Normal if writing was successful, error otherwise. + */ + virtual OFCondition saveFile(const OFString& filename, + const E_TransferSyntax writeXfer = EXS_LittleEndianExplicit); + + /** Write current object to given item + * @param dataset The item to write to + * @return EC_Normal if writing was successful, error otherwise. + */ + OFCondition writeDataset(DcmItem& dataset); + + /** Perform some basic checking. This method is also invoked when + * writing the object to a DICOM dataset or file. + * @return OFTrue, if no errors were found, OFFalse otherwise. + */ + virtual OFBool check(); + + /** Get access to functional groups. This is meant for reading data from + * functional groups that are not actively managed, i.e.\ made accessible by + * DcmSegmentation. In rare cases, however, it makes sense to access it + * for writing too, e.g.\ in order to add Stacks; use with care! + * @return Reference to the functional groups + */ + virtual FGInterface& getFunctionalGroups(); + + /** Get Patient Module + * @return a reference to the IOD Patient Module + */ + virtual IODPatientModule& getIODPatientModule(); + + /** Get General Study Module + * @return a reference to the IOD General Study Module + */ + virtual IODGeneralStudyModule& getIODGeneralStudyModule(); + + /** Get Patient Study Module + * @return a reference to the IOD Patient Study Module + */ + virtual IODPatientStudyModule& getIODPatientStudyModule(); + + /** Get General Series Module + * @return a reference to the IOD General Series Module + */ + virtual IODGeneralSeriesModule& getIODGeneralSeriesModule(); + + /** Get Parametric Map Series Module + * @return a reference to the Parametric Map Series Module + */ + virtual DPMParametricMapSeriesModule& getDPMParametricMapSeriesModule(); + + /** Get General Equipment Module + * @return a reference to the General Equipment Module + */ + virtual IODGeneralEquipmentModule& getIODGeneralEquipmentModule(); + + /** Get Enhanced General Equipment Module + * @return a reference to the Enhanced General Equipment Module + */ + virtual IODEnhGeneralEquipmentModule& getIODEnhGeneralEquipmentModule(); + + /** Get General Image Module + * @return a reference to the General Image Module + */ + virtual IODGeneralImageModule& getIODGeneralImageModule(); + + /** Get Parametric Map Image Module + * @return a reference to the Parametric Map Image Module + */ + virtual DPMParametricMapImageModule& getDPMParametricMapImageModule(); + + /** Get Multi-frame Functional Groups Module + * @return a reference to the Multi-frame Functional Groups Module + */ + virtual IODMultiFrameFGModule& getIODMultiFrameFGModule(); + + /** Get Multi-frame Dimension Module + * @return a reference to the Multi-frame Dimension Module + */ + virtual IODMultiframeDimensionModule& getIODMultiframeDimensionModule(); + + /** Get Acquisition Context Module + * @return a reference to the Acquisition Context Module + */ + virtual IODAcquisitionContextModule& getIODAcquisitionContextModule(); + + /** Get Common Instance Reference Module + * @return a reference to the Common Instance Reference Module + */ + virtual IODCommonInstanceReferenceModule& getIODCommonInstanceReferenceModule(); + + /** Get SOP Common Module + * @return a reference to the SOP Common Module + */ + virtual IODSOPCommonModule& getIODSOPCommonModule(); + +protected: + + /** Constructor; not public since object should be create via factory + * method in derived class. + */ + DPMParametricMapBase(); + + /** Constructor; not public since object should be create via factory + * method in derived class. + */ + template + DPMParametricMapBase(OFin_place_type_t(ImagePixel)); + + /** Read Parametric Map attributes (all those handled by this class) + * from given item. Reads attributes from base class DcmIODCommon before. + * The current content is deleted even if the reading process fails. + * If the log stream is set and valid the reason for any error might be + * obtained from the error/warning output. + * @param dataset Reference to DICOM dataset from which the document + * should be read + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** Write current Parametric Map's attributes to DICOM dataset. Also + * writes attributes of base class DcmIODCommon afterwards. + * @param dataset Reference to DICOM dataset to which the current document + * should be written. The dataset is not cleared before writing + * to it! + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + /** Clear (removes) all attributes handled by the modules of this IOD. + * IOD Rules are not reset. + */ + virtual void clearData(); + + /** Loads file + * @param dcmff The file format to load into + * @param filename The filename of the file to load + * @param dset Pointer to dataset after loading + * @return EC_Normal if loading was successful, error otherwise + */ + static OFCondition loadFile(DcmFileFormat& dcmff, + const OFString& filename, + DcmDataset*& dset); + + /// Multi-frame Functional Groups high level interface + FGInterface m_FGInterface; + + /// Parametric Map Series Module + DPMParametricMapSeriesModule m_DPMParametricMapSeriesModule; + + /// Enhanced General Equipment Module + IODEnhGeneralEquipmentModule m_IODEnhGeneralEquipmentModule; + + /// Parametric Map Image Module + DPMParametricMapImageModule m_DPMParametricMapImageModule; + + /// Multi-frame Functional Groups Module + IODMultiFrameFGModule m_IODMultiFrameFGModule; + + /// Multi-frame Dimension Module + IODMultiframeDimensionModule m_IODMultiframeDimensionModule; + + /// Acquisition Context Module + IODAcquisitionContextModule m_IODAcquisitionContextModule; + + /// Common Instance Reference Module + IODCommonInstanceReferenceModule m_IODCommonInstanceReferenceModule; + +}; + +#endif // DPMPARAMETRICMAPBASE_H diff --git a/dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapiod.h b/dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapiod.h new file mode 100644 index 00000000..728f39fe --- /dev/null +++ b/dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapiod.h @@ -0,0 +1,306 @@ +/* + * + * Copyright (C) 2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Michael Onken + * + * Purpose: Class representing the Parametric Map IOD + * + */ + +#ifndef DPMPARAMETRICMAPIOD_H +#define DPMPARAMETRICMAPIOD_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/modimagepixelbase.h" +#include "dcmtk/dcmpmap/dpmparametricmapbase.h" +#include "dcmtk/dcmpmap/dpmtypes.h" + + +/** Class for managing the Parametric Map IOD attributes. + */ +class DCMTK_DCMPMAP_EXPORT DPMParametricMapIOD : public DPMParametricMapBase +{ +public: + + /** Inner class that offers typed interface to bulk data. + */ + template + class DCMTK_DCMPMAP_EXPORT Frames + { + public: + + /// Binary pixel type + typedef PixelType pixel_type; + + /** Method that adds a frame to the Parametric Map using the underlying + * binary data type. + * @param data The frame data + * @param numPixels The number of pixels (rows * columns) of the frame + * @param perFrameInformation The per-frame functional groups applying for + * @return EC_Normal if adding was successful, error otherwise + */ + OFCondition addFrame(PixelType* data, + const size_t numPixels, + const OFVector& perFrameInformation); + + /** Type-specific getFrame() method that returns Float32, Uint16, or whatever + * is used in this Parametric Map. + * @param frameNumber The frame number to get, starting from 0 + * @return Pointer to typed pixel data + */ + PixelType* getFrame(const size_t frameNumber); + + private: + + // Make sure the Parametric Map object (and no one else) can use the constructor below. + friend class DPMParametricMapIOD; + + /** Create Frames object in DPMParametricMapIOD (see friend declaration above) + * @param map The map object that will contain the frames + */ + Frames(DPMParametricMapIOD& map); + + /// Reference to Parametric Map object in order to access its pixel data + DPMParametricMapIOD& m_Map; + }; + + /** Frames can contain Uint16, Sint16, Float32 or Float64 data, or nothing + * at all (in that case OFCondition denotes a corresponding error) + */ + typedef OFvariant + < + OFCondition, + Frames, + Frames, + Frames, + Frames + > FramesType; + + /** Virtual Destructor, frees memory. + */ + virtual ~DPMParametricMapIOD(); + + /** Create new Parametric Map object. Takes the minimum of required parameters. + * Afterwards, additional setters() can be used to set optional data. Frames + * and their related per-frame functional groups should be added using addFrame(). + * Shared functional groups should be added using addForAllFrames(). + * @param modality The modality of this Parametric Map (series level attribute). + * A list of Defined Terms can be found in the standard. Very often + * "MR" is the right choice. Only if a mix of different modalities has been + * use for creation "OT" should be used. + * @param seriesNumber A number identifying this series. If importHierarchy() + * is called later in order to put this Parametric Map into an existing Series, + * the Series Number will be taken over from the existing series instead. + * @param instanceNumber A number identifying this image + * @param rows The number of rows of all frames of the Parametric Map + * @param columns The number of columns of all frames of the Parametric Map + * @param equipmentInfo Information about the equipment creating thing Parametric Map + * @param contentIdentification General information about this content + * @param imageFlavor 3rd value of attribute Image Type. See standard for list of + * applicable Defined Terms. + * @param derivedPixelContrast 4th value of attribute Image Type. See standard for list of + * applicable Defined Terms. + * @param contentQualification Either one of CQ_PRODUCT, CQ_RESEARCH, CQ_SERVICE + * @return Variant, either OFCondition with error code in case of error, Parametric + * Map object in case of success + */ + template + static OFvariant create(const OFString& modality, + const OFString& seriesNumber, + const OFString& instanceNumber, + const Uint16 rows, + const Uint16 columns, + const IODEnhGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification, + const OFString& imageFlavor, + const OFString& derivedPixelContrast, + const DPMTypes::ContentQualification& contentQualification); + + /** Indicates whether or not the image contains sufficiently recognizable visual + * features to allow the image or a reconstruction from a set of images to + * identify the patient. + * @param yesOrNo Must be related "YES" or "NO" types + * @return EC_Normal if setting was successful, error otherwise + */ + + virtual OFCondition setRecognizableVisualFeatures(const DPMTypes::RecognizableVisibleFeatures yesOrNo); + + /** Add a functional group for all frames + * @param group The group to be added as shared functional group + * @return EC_Normal if adding was successful, error otherwise + */ + virtual OFCondition addForAllFrames(const FGBase& group); + + // -------------------- loading and saving --------------------- + + /** Load Parametric Map object from file + * @param filename The file to read from + * @return Variant, either the resulting Parametric Map object in case of success, + * an OFCondition error code otherwise + */ + static OFvariant loadFile(const OFString& filename); + + /** Load Parametric Map object from dataset object. + * @param dataset The dataset to read from + * @return Variant, either the resulting Parametric Map object in case of success, + * an OFCondition error code otherwise + */ + static OFvariant loadDataset(DcmDataset& dataset); + + /** Read Parametric Map attributes (all those handled by this class) + * from given item. Reads attributes from base class DcmIODCommon before. + * The current content is deleted even if the reading process fails. + * If the log stream is set and valid the reason for any error might be + * obtained from the error/warning output. + * @param dataset Reference to DICOM dataset from which the document + * should be read + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** Write current Parametric Map's attributes to DICOM dataset. + * @param dataset Reference to DICOM dataset to which the current document + * should be written. The dataset is not cleared before writing + * to it! + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // -------------------- access --------------------- + + /** Get Recognizable Visual Features + * @return Returns related YES or NO data type + */ + virtual DPMTypes::RecognizableVisibleFeatures getRecognizableVisualFeatures(); + + /** Get Content Qualification + * @return Returns either one of CQ_PRODUCT, CQ_RESEARCH, CQ_SERVICE or CQ_UNKNOWN + */ + virtual DPMTypes::ContentQualification getContentQualification(); + + /** Get number of rows + * @param rows The number of rows (output) + * @return EC_Normal if getting was successful, error otherwise + */ + virtual OFCondition getRows(Uint16& rows); + + /** Get number of cols + * @param cols The number of columns (output) + * @return EC_Normal if getting was successful, error otherwise + */ + virtual OFCondition getColumns(Uint16& cols); + + /** Perform some basic checking. This method is also invoked when + * writing the object to a DICOM dataset or file. + * @return OFTrue, if no errors were found, OFFalse otherwise. + */ + virtual OFBool check(); + + /** Get number of frames, based on the number of items in the shared + * functional functional groups sequence (i.e.\ the attribute Number of + * Frames) is not trusted after reading + * @return The number of frames handled by this object + */ + size_t getNumberOfFrames() const; + + /** Get access to frame data + * @return Class managing the frame data + */ + FramesType getFrames(); + +protected: + + /** Write current generic Parametric Map's attributes to DICOM dataset, i.e. + * those that are not directly pixel-related + * @param dataset Reference to DICOM dataset to which the current document + * should be written. The dataset is not cleared before writing + * to it. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeGeneric(DcmItem &dataset); + + /** Read Parametric Map's generic (not directly pixel-data related) attributes from + * DICOM dataset. + * @param dataset Reference to DICOM dataset to read from. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readGeneric(DcmItem &dataset); + + /** Decompress the given dataset if required. Only RLE compression is accepted + * and decompressed by this tool. A warning is printed if the dataset has been compressed + * before with another compression scheme and is handed into this method in uncompressed + * format. Handing in any other compression but RLE will lead to an error. + * @param dset The dataset to be decompressed + * @return EC_Normal if decompression worked (or dataset is already in uncompressed format) + * IOD_EC_CannotDecompress otherwise + */ + static OFCondition decompress(DcmDataset& dset); + + /** Constructor + */ + DPMParametricMapIOD(); + + /** Constructor, anonymous parameter is the image pixel module to be used + */ + template + DPMParametricMapIOD(OFin_place_type_t(ImagePixel)); + +private: + + // Forward declarations + template class GetPixelDataVisitor; + struct SetImagePixelModuleVisitor; + struct WriteVisitor; + struct GetFramesVisitor; + struct ReadVisitor; + struct ReadFramesVisitor; + + /** Initialize new Parametric Map object except directly pixel-related data + * @param modality The modality of this Parametric Map (series level attribute). + * A list of Defined Terms can be found in the standard. Very often + * "MR" is the right choice. Only if a mix of different modalities has been + * use for creation "OT" should be used. + * @param seriesNumber A number identifying this series. If importHierarchy() + * is called later in order to put this Parametric Map into an existing Series, + * the Series Number will be taken over from the existing series instead. + * @param instanceNumber A number identifying this image + * @param equipmentInfo Information about the equipment creating thing Parametric Map + * @param contentIdentification General information about this content + * @param imageFlavor 3rd value of attribute Image Type. See standard for list of + * applicable Defined Terms. + * @param derivedPixelContrast 4th value of attribute Image Type. See standard for list of + * applicable Defined Terms. + * @param contentQualification Either one of CQ_PRODUCT, CQ_RESEARCH, CQ_SERVICE + * @return EC_Normal in case of success, error otherwise + */ + OFCondition init(const OFString& modality, + const OFString& seriesNumber, + const OFString& instanceNumber, + const IODEnhGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification, + const OFString& imageFlavor, + const OFString& derivedPixelContrast, + const DPMTypes::ContentQualification& contentQualification); + + + /// Parametric Map Image Module's Content Identification + ContentIdentificationMacro m_ContentIdentification; + + /// Binary frame data + OFVector m_Frames; + +}; + +#endif // DPMPARAMETRICMAPIOD_H diff --git a/dcmpmap/include/dcmtk/dcmpmap/dpmtypes.h b/dcmpmap/include/dcmtk/dcmpmap/dpmtypes.h new file mode 100644 index 00000000..9bc952d3 --- /dev/null +++ b/dcmpmap/include/dcmtk/dcmpmap/dpmtypes.h @@ -0,0 +1,137 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Michael Onken + * + * Purpose: Class managing various parametric myps-typical types + * + */ + +#ifndef DPMTYPES_H +#define DPMTYPES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmpmap/dpmdef.h" + +// ---------------------------------------------------------------------------- +// Define the loggers for this module +// ---------------------------------------------------------------------------- + +extern DCMTK_DCMPMAP_EXPORT OFLogger DCM_dcmpmapLogger; + +#define DCMPMAP_TRACE(msg) OFLOG_TRACE(DCM_dcmpmapLogger, msg) +#define DCMPMAP_DEBUG(msg) OFLOG_DEBUG(DCM_dcmpmapLogger, msg) +#define DCMPMAP_INFO(msg) OFLOG_INFO(DCM_dcmpmapLogger, msg) +#define DCMPMAP_WARN(msg) OFLOG_WARN(DCM_dcmpmapLogger, msg) +#define DCMPMAP_ERROR(msg) OFLOG_ERROR(DCM_dcmpmapLogger, msg) +#define DCMPMAP_FATAL(msg) OFLOG_FATAL(DCM_dcmpmapLogger, msg) + +// ---------------------------------------------------------------------------- +// Error constants +// ---------------------------------------------------------------------------- + +extern DCMTK_DCMPMAP_EXPORT const OFConditionConst DPM_InvalidDimensions; +extern DCMTK_DCMPMAP_EXPORT const OFConditionConst DPM_InvalidAttributeValue; +extern DCMTK_DCMPMAP_EXPORT const OFConditionConst DPM_InvalidPixelInfo; +extern DCMTK_DCMPMAP_EXPORT const OFConditionConst DPM_InvalidPixelData; +extern DCMTK_DCMPMAP_EXPORT const OFConditionConst DPM_NoPixelData; +extern DCMTK_DCMPMAP_EXPORT const OFConditionConst DPM_InvalidSOPClass; + +/** General purpose class hiding global functions, constants and types in the + * parametric map context from the global namespace. + */ +class DCMTK_DCMPMAP_EXPORT DPMTypes +{ + public: + + /// Enum for attribute Content Qualification + enum ContentQualification + { + /// Unkonwn (e.g. not set) + CQ_UNKNOWN, + /// PRODUCT + CQ_PRODUCT, + /// RESEARCH + CQ_RESEARCH, + /// SERVICE + CQ_SERVICE + }; + + /// Enum for attribute Lossy Image Compression + enum LossyImageCompression + { + /// Unknown (e.g. not set) + COMP_UNKNOWN, + /// YES (lossy image compression used) + COMP_YES, + /// NO (no lossy image compression used) + COMP_NO + }; + + + /// Enum for attribute Recognizable Visual Features + enum RecognizableVisibleFeatures + { + /// Unknown (e.g. not set) + RVF_UNKNOWN, + /// YES (recognizable visual features present) + RVF_YES, + /// NO (recognizable visual features not present) + RVF_NO + }; + + /** Convert Recognizable Visual Features enum to OFString + * @param rvf The enum to convert + * @return String version of enum value + */ + static OFString rvf2Str(const RecognizableVisibleFeatures rvf); + + /** Convert OFString version of Recognizable Visual Features attribute + * value to enum value + * @param rvf The OFString value to convert + * @return The enum value of the string + */ + static RecognizableVisibleFeatures str2Rvf(const OFString& rvf); + + /** Convert Content Qualification enum to OFString + * @param cq The enum to convert + * @return String version of enum value + */ + static OFString cq2Str(const ContentQualification cq); + + /** Convert OFString version of Content Qualification attribute + * value to enum value + * @param cq The OFString value to convert + * @return The enum value of the string + */ + static ContentQualification str2Cq(const OFString& cq); + + /** Check whether Recognizable Visual Features enum value is valid + * @param rvf Value to check + * @return OFTrue if valid, OFFalse otherwise + */ + static OFBool rvfValid(const RecognizableVisibleFeatures rvf); + + /** Check whether Content Qualification enum value is valid + * @param cq Value to check + * @return OFTrue if valid, OFFalse otherwise + */ + static OFBool cqValid(const ContentQualification cq); + +}; + +#endif // DPMTYPES_H diff --git a/dcmpmap/libsrc/CMakeLists.txt b/dcmpmap/libsrc/CMakeLists.txt new file mode 100644 index 00000000..40874634 --- /dev/null +++ b/dcmpmap/libsrc/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmpmap dpmtypes dpmmodparametricmapseries dpmmodparametricmapimage dpmparametricmapbase dpmparametricmapiod) + +DCMTK_TARGET_LINK_MODULES(dcmpmap dcmfg dcmiod dcmdata ofstd oflog) diff --git a/dcmpmap/libsrc/Makefile.dep b/dcmpmap/libsrc/Makefile.dep new file mode 100644 index 00000000..e945cfc1 --- /dev/null +++ b/dcmpmap/libsrc/Makefile.dep @@ -0,0 +1,670 @@ +dpmmodparametricmapimage.o: dpmmodparametricmapimage.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmpmap/dpmmodparametricmapimage.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmpmap/dpmdef.h +dpmmodparametricmapseries.o: dpmmodparametricmapseries.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmpmap/dpmmodparametricmapseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmpmap/dpmdef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +dpmparametricmapbase.o: dpmparametricmapbase.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmpmap/dpmtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmpmap/dpmdef.h \ + ../include/dcmtk/dcmpmap/dpmparametricmapbase.h \ + ../../dcmfg/include/dcmtk/dcmfg/fginterface.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmfg/include/dcmtk/dcmfg/fg.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgbase.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgderimg.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgfracon.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgframeanatomy.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgframevoilut.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgpixeltransform.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgparametricmapframetype.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgpixmsr.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgplanor.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgplanpo.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgrealworldvaluemapping.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodimage.h \ + ../../ofstd/include/dcmtk/ofstd/ofvriant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/variant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/helpers.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../ofstd/include/dcmtk/ofstd/ofdiag.h \ + ../../ofstd/include/dcmtk/ofstd/diag/push.def \ + ../../ofstd/include/dcmtk/ofstd/diag/cnvrsn.def \ + ../../ofstd/include/dcmtk/ofstd/diag/vsprfw.def \ + ../../ofstd/include/dcmtk/ofstd/diag/pop.def \ + ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \ + ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfor.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \ + ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralimage.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/modacquisitioncontext.h \ + ../../dcmiod/include/dcmtk/dcmiod/modenhequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframefg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixel.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfloatingpointimagepixel.h \ + ../include/dcmtk/dcmpmap/dpmmodparametricmapimage.h \ + ../include/dcmtk/dcmpmap/dpmmodparametricmapseries.h +dpmparametricmapiod.o: dpmparametricmapiod.cc \ + ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpmap/dpmparametricmapiod.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmpmap/dpmparametricmapbase.h \ + ../../dcmfg/include/dcmtk/dcmfg/fginterface.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmfg/include/dcmtk/dcmfg/fg.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgbase.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgderimg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgfracon.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgframeanatomy.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgframevoilut.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgpixeltransform.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgparametricmapframetype.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgpixmsr.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgplanor.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgplanpo.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgrealworldvaluemapping.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodimage.h \ + ../../ofstd/include/dcmtk/ofstd/ofvriant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/variant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/helpers.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../ofstd/include/dcmtk/ofstd/ofdiag.h \ + ../../ofstd/include/dcmtk/ofstd/diag/push.def \ + ../../ofstd/include/dcmtk/ofstd/diag/cnvrsn.def \ + ../../ofstd/include/dcmtk/ofstd/diag/vsprfw.def \ + ../../ofstd/include/dcmtk/ofstd/diag/pop.def \ + ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \ + ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfor.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \ + ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralimage.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h \ + ../../dcmiod/include/dcmtk/dcmiod/modacquisitioncontext.h \ + ../../dcmiod/include/dcmtk/dcmiod/modenhequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframefg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixel.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfloatingpointimagepixel.h \ + ../include/dcmtk/dcmpmap/dpmmodparametricmapimage.h \ + ../include/dcmtk/dcmpmap/dpmdef.h \ + ../include/dcmtk/dcmpmap/dpmmodparametricmapseries.h \ + ../include/dcmtk/dcmpmap/dpmtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h +dpmtypes.o: dpmtypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpmap/dpmtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmpmap/dpmdef.h diff --git a/dcmpmap/libsrc/Makefile.in b/dcmpmap/libsrc/Makefile.in new file mode 100644 index 00000000..4d253f38 --- /dev/null +++ b/dcmpmap/libsrc/Makefile.in @@ -0,0 +1,56 @@ +# +# Makefile for dcmpmap/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmioddir = $(top_srcdir)/../dcmiod +dcmfgdir = $(top_srcdir)/../dcmfg + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmioddir)/include \ + -I$(dcmfgdir)/include + +LOCALDEFS = + +objs = dpmtypes.o dpmmodparametricmapseries.o dpmmodparametricmapimage.o dpmparametricmapbase.o dpmparametricmapiod.o + + +library = libdcmpmap.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmpmap/libsrc/dpmmodparametricmapimage.cc b/dcmpmap/libsrc/dpmmodparametricmapimage.cc new file mode 100644 index 00000000..a22883aa --- /dev/null +++ b/dcmpmap/libsrc/dpmmodparametricmapimage.cc @@ -0,0 +1,289 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Parametric Map Image Module + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmpmap/dpmmodparametricmapimage.h" + +const OFString DPMParametricMapImageModule::m_ModuleName = "DPMParametricMapImageModule"; + +DPMParametricMapImageModule::DPMParametricMapImageModule() +: IODModule() +{ + resetRules(); +} + +DPMParametricMapImageModule::DPMParametricMapImageModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules) +{ + // reset element rules + resetRules(); +} + +DPMParametricMapImageModule::~DPMParametricMapImageModule() +{ + +} + +OFString DPMParametricMapImageModule::getName() const +{ + return m_ModuleName; +} + +void DPMParametricMapImageModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_ImageType, "2-n","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_SamplesPerPixel, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_PhotometricInterpretation, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsAllocated, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_BitsStored, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_HighBit, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_PresentationLUTShape, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompression, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompressionRatio, "1-n","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_LossyImageCompressionMethod, "1-n","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_BurnedInAnnotation, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_RecognizableVisualFeatures, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ContentQualification, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); +} + +OFCondition DPMParametricMapImageModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, OFFalse /* data already cleared */); + + return EC_Normal; +} + +OFCondition DPMParametricMapImageModule::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + result = IODComponent::write(destination); + + return result; +} + +OFCondition DPMParametricMapImageModule::getImageType(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ImageType, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getSamplesPerPixel(Uint16 &value, + const signed long pos) const +{ + return m_Item->findAndGetUint16(DCM_SamplesPerPixel, value, pos); +} + +OFCondition DPMParametricMapImageModule::getPhotometricInterpretation(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PhotometricInterpretation, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getBitsAllocated(Uint16 &value, + const signed long pos) const +{ + return m_Item->findAndGetUint16(DCM_BitsAllocated, value, pos); +} + +OFCondition DPMParametricMapImageModule::getBitsStored(Uint16 &value, + const signed long pos) const +{ + return m_Item->findAndGetUint16(DCM_BitsStored, value, pos); +} + +OFCondition DPMParametricMapImageModule::getHighBit(Uint16 &value, + const signed long pos) const +{ + return m_Item->findAndGetUint16(DCM_HighBit, value, pos); +} + +OFCondition DPMParametricMapImageModule::getPresentationLUTShape(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_PresentationLUTShape, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getLossyImageCompression(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompression, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getLossyImageCompressionRatio(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompressionRatio, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getLossyImageCompressionMethod(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_LossyImageCompressionMethod, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getBurnedInAnnotation(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_BurnedInAnnotation, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getRecognizableVisualFeatures(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_RecognizableVisualFeatures, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::getContentQualification(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_ContentQualification, *m_Item, value, pos); +} + +OFCondition DPMParametricMapImageModule::setImageType(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "2-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ImageType, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setSamplesPerPixel(const Uint16 &value, + const OFBool checkValue) +{ + if (checkValue && (value != 1)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_SamplesPerPixel, value); +} + +OFCondition DPMParametricMapImageModule::setPhotometricInterpretation(const OFString &value, + const OFBool checkValue) +{ + if (checkValue && (value != "MONOCHROME2")) + return IOD_EC_InvalidElementValue; + + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PhotometricInterpretation, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setBitsAllocated(const Uint16 &value, + const OFBool checkValue) +{ + if (checkValue && (value != 16) && (value != 32) && (value != 64)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_BitsAllocated, value); +} + +OFCondition DPMParametricMapImageModule::setBitsStored(const Uint16 &value, + const OFBool checkValue) +{ + if (checkValue && (value != 16) && (value != 32) && (value != 64)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_BitsStored, value); +} + +OFCondition DPMParametricMapImageModule::setHighBit(const Uint16 &value, + const OFBool checkValue) +{ + if (checkValue && (value != 15)) + return IOD_EC_InvalidElementValue; + + return m_Item->putAndInsertUint16(DCM_HighBit, value); +} + +OFCondition DPMParametricMapImageModule::setPresentationLUTShape(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_PresentationLUTShape, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setLossyImageCompression(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompression, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setLossyImageCompressionRatio(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompressionRatio, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setLossyImageCompressionMethod(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_LossyImageCompressionMethod, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setBurnedInAnnotation(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_BurnedInAnnotation, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setRecognizableVisualFeatures(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_RecognizableVisualFeatures, value); + return result; +} + +OFCondition DPMParametricMapImageModule::setContentQualification(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_ContentQualification, value); + return result; +} diff --git a/dcmpmap/libsrc/dpmmodparametricmapseries.cc b/dcmpmap/libsrc/dpmmodparametricmapseries.cc new file mode 100644 index 00000000..efa20b00 --- /dev/null +++ b/dcmpmap/libsrc/dpmmodparametricmapseries.cc @@ -0,0 +1,126 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Class for managing the Parametric Map Series Module + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmpmap/dpmmodparametricmapseries.h" + +const OFString DPMParametricMapSeriesModule::m_ModuleName = "DPMParametricMapSeriesModule"; + +DPMParametricMapSeriesModule::DPMParametricMapSeriesModule() +: IODModule(), + m_ReferencedPerformedProcedureStepSequence() +{ + resetRules(); +} + +DPMParametricMapSeriesModule::DPMParametricMapSeriesModule(OFshared_ptr item, + OFshared_ptr rules) +: IODModule(item, rules), + m_ReferencedPerformedProcedureStepSequence() +{ + // reset element rules + resetRules(); +} + +DPMParametricMapSeriesModule::~DPMParametricMapSeriesModule() +{ + +} + +OFString DPMParametricMapSeriesModule::getName() const +{ + return m_ModuleName; +} + +void DPMParametricMapSeriesModule::resetRules() +{ + // parameters are tag, VM, type. Overwrite old rules if any. + m_Rules->addRule(new IODRule(DCM_Modality, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_SeriesNumber, "1","1", getName(), DcmIODTypes::IE_SERIES), OFTrue); + m_Rules->addRule(new IODRule(DCM_ReferencedPerformedProcedureStepSequence, "1","1C", getName(), DcmIODTypes::IE_SERIES), OFTrue); +} + +OFCondition DPMParametricMapSeriesModule::read(DcmItem& source, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + IODComponent::read(source, OFFalse /* data already cleared */); + DcmIODUtil::readSubSequence(source, DCM_ReferencedPerformedProcedureStepSequence, m_ReferencedPerformedProcedureStepSequence, m_Rules->getByTag(DCM_ReferencedPerformedProcedureStepSequence)); + + return EC_Normal; +} + +OFCondition DPMParametricMapSeriesModule::write(DcmItem& destination) +{ + OFCondition result = EC_Normal; + + if(SOPInstanceReferenceMacro* pReferencedPerformedProcedureStepSequence = getReferencedPerformedProcedureStepSequence()) + DcmIODUtil::writeSingleItem(result, DCM_ReferencedPerformedProcedureStepSequence, *pReferencedPerformedProcedureStepSequence, *m_Item, m_Rules->getByTag(DCM_ReferencedPerformedProcedureStepSequence)); + result = IODComponent::write(destination); + + return result; +} + +OFCondition DPMParametricMapSeriesModule::getModality(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_Modality, *m_Item, value, pos); +} + +OFCondition DPMParametricMapSeriesModule::getSeriesNumber(OFString &value, + const signed long pos) const +{ + return DcmIODUtil::getStringValueFromItem(DCM_SeriesNumber, *m_Item, value, pos); +} + +SOPInstanceReferenceMacro* DPMParametricMapSeriesModule::getReferencedPerformedProcedureStepSequence() +{ + return m_ReferencedPerformedProcedureStepSequence.empty() ? OFnullptr : &*m_ReferencedPerformedProcedureStepSequence.begin(); +} + +OFVector& DPMParametricMapSeriesModule::getEntireReferencedPerformedProcedureStepSequence() +{ + return m_ReferencedPerformedProcedureStepSequence; +} + +OFCondition DPMParametricMapSeriesModule::setModality(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_Modality, value); + return result; +} + +OFCondition DPMParametricMapSeriesModule::setSeriesNumber(const OFString &value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_Item->putAndInsertOFStringArray(DCM_SeriesNumber, value); + return result; +} diff --git a/dcmpmap/libsrc/dpmparametricmapbase.cc b/dcmpmap/libsrc/dpmparametricmapbase.cc new file mode 100644 index 00000000..a31f9792 --- /dev/null +++ b/dcmpmap/libsrc/dpmparametricmapbase.cc @@ -0,0 +1,229 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Jan Schlamelcher + * + * Purpose: Generated base class representing the Parametric Map IOD + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmpmap/dpmtypes.h" +#include "dcmtk/dcmpmap/dpmparametricmapbase.h" + + +DPMParametricMapBase::DPMParametricMapBase() +: DPMParametricMapBase::IODImage() +, m_FGInterface() +, m_DPMParametricMapSeriesModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODEnhGeneralEquipmentModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_DPMParametricMapImageModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODMultiFrameFGModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODMultiframeDimensionModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODAcquisitionContextModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODCommonInstanceReferenceModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +{ +} + + +template +DPMParametricMapBase::DPMParametricMapBase(OFin_place_type_t(ImagePixel)) +: DPMParametricMapBase::IODImage(OFin_place) +, m_FGInterface() +, m_DPMParametricMapSeriesModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODEnhGeneralEquipmentModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_DPMParametricMapImageModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODMultiFrameFGModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODMultiframeDimensionModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODAcquisitionContextModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +, m_IODCommonInstanceReferenceModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules()) +{ +} + + +DPMParametricMapBase::~DPMParametricMapBase() +{ +} + + +void DPMParametricMapBase::clearData() +{ + DPMParametricMapBase::IODImage::clearData(); +} + + +OFCondition DPMParametricMapBase::read(DcmItem& dataset) +{ + OFString sopClass; + if(DcmIODUtil::checkSOPClass(&dataset, UID_ParametricMapStorage, sopClass).bad()) + { + DCMPMAP_ERROR("Given file does not seem to be a Parametric Map storage object since SOP class is: " << sopClass); + return IOD_EC_WrongSOPClass; + } + + DPMParametricMapBase::IODImage::read(dataset); + m_DPMParametricMapSeriesModule.read(dataset); + m_IODEnhGeneralEquipmentModule.read(dataset); + m_DPMParametricMapImageModule.read(dataset); + m_IODMultiFrameFGModule.read(dataset); + m_FGInterface.read(dataset); + m_IODMultiframeDimensionModule.read(dataset); + m_IODAcquisitionContextModule.read(dataset); + m_IODCommonInstanceReferenceModule.read(dataset); + + return EC_Normal; +} + + +OFCondition DPMParametricMapBase::saveFile(const OFString& filename, + const E_TransferSyntax writeXfer) +{ + DcmFileFormat dcmff; + OFCondition result; + if((result = write(*dcmff.getDataset())).good()) + result = dcmff.saveFile(filename.c_str(), writeXfer); + if(result.bad()) + DCMPMAP_ERROR("Cannot save Parametric Map object to file " << filename << ": " << result.text()); + return result; +} + + +OFCondition DPMParametricMapBase::writeDataset(DcmItem& dataset) +{ + return write(dataset); +} + + +OFCondition DPMParametricMapBase::write(DcmItem& dataset) +{ + if(!check()) + return IOD_EC_InvalidObject; + + OFCondition result; + if((result = m_DPMParametricMapSeriesModule.write(dataset)).good()) + if((result = m_IODEnhGeneralEquipmentModule.write(dataset)).good()) + if((result = m_DPMParametricMapImageModule.write(dataset)).good()) + if((result = m_IODMultiFrameFGModule.write(dataset)).good()) + if((result = m_FGInterface.write(dataset)).good()) + if((result = m_IODMultiframeDimensionModule.write(dataset)).good()) + if((result = m_IODAcquisitionContextModule.write(dataset)).good()) + if((result = m_IODCommonInstanceReferenceModule.write(dataset)).good()) + return DPMParametricMapBase::IODImage::write(dataset); + + return result; +} + + +OFBool DPMParametricMapBase::check() +{ + return m_FGInterface.check(); +} + + +FGInterface& DPMParametricMapBase::getFunctionalGroups() +{ + return m_FGInterface; +} + + +IODPatientModule& DPMParametricMapBase::getIODPatientModule() +{ + return DPMParametricMapBase::IODImage::getPatient(); +} + + +IODGeneralStudyModule& DPMParametricMapBase::getIODGeneralStudyModule() +{ + return DPMParametricMapBase::IODImage::getStudy(); +} + + +IODPatientStudyModule& DPMParametricMapBase::getIODPatientStudyModule() +{ + return DPMParametricMapBase::IODImage::getPatientStudy(); +} + + +IODGeneralSeriesModule& DPMParametricMapBase::getIODGeneralSeriesModule() +{ + return DPMParametricMapBase::IODImage::getSeries(); +} + + +DPMParametricMapSeriesModule& DPMParametricMapBase::getDPMParametricMapSeriesModule() +{ + return m_DPMParametricMapSeriesModule; +} + + +IODGeneralEquipmentModule& DPMParametricMapBase::getIODGeneralEquipmentModule() +{ + return DPMParametricMapBase::IODImage::getEquipment(); +} + + +IODEnhGeneralEquipmentModule& DPMParametricMapBase::getIODEnhGeneralEquipmentModule() +{ + return m_IODEnhGeneralEquipmentModule; +} + + +IODGeneralImageModule& DPMParametricMapBase::getIODGeneralImageModule() +{ + return DPMParametricMapBase::IODImage::getGeneralImage(); +} + + +DPMParametricMapImageModule& DPMParametricMapBase::getDPMParametricMapImageModule() +{ + return m_DPMParametricMapImageModule; +} + + +IODMultiFrameFGModule& DPMParametricMapBase::getIODMultiFrameFGModule() +{ + return m_IODMultiFrameFGModule; +} + + +IODMultiframeDimensionModule& DPMParametricMapBase::getIODMultiframeDimensionModule() +{ + return m_IODMultiframeDimensionModule; +} + + +IODAcquisitionContextModule& DPMParametricMapBase::getIODAcquisitionContextModule() +{ + return m_IODAcquisitionContextModule; +} + + +IODCommonInstanceReferenceModule& DPMParametricMapBase::getIODCommonInstanceReferenceModule() +{ + return m_IODCommonInstanceReferenceModule; +} + + +IODSOPCommonModule& DPMParametricMapBase::getIODSOPCommonModule() +{ + return DPMParametricMapBase::IODImage::getSOPCommon(); +} + + +template DCMTK_DCMPMAP_EXPORT DPMParametricMapBase::DPMParametricMapBase(OFin_place_type_t(IODImagePixelModule)); +template DCMTK_DCMPMAP_EXPORT DPMParametricMapBase::DPMParametricMapBase(OFin_place_type_t(IODImagePixelModule)); +template DCMTK_DCMPMAP_EXPORT DPMParametricMapBase::DPMParametricMapBase(OFin_place_type_t(IODFloatingPointImagePixelModule)); +template DCMTK_DCMPMAP_EXPORT DPMParametricMapBase::DPMParametricMapBase(OFin_place_type_t(IODDoubleFloatingPointImagePixelModule)); diff --git a/dcmpmap/libsrc/dpmparametricmapiod.cc b/dcmpmap/libsrc/dpmparametricmapiod.cc new file mode 100644 index 00000000..18feaf66 --- /dev/null +++ b/dcmpmap/libsrc/dpmparametricmapiod.cc @@ -0,0 +1,1065 @@ +/* + * + * Copyright (C) 2016-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Michael Onken + * + * Purpose: Class for managing the Parametric Map IOD + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmpmap/dpmparametricmapiod.h" +#include "dcmtk/dcmiod/iodutil.h" + +// ---------------------------------------------------------------------------- +// Class SetImagePixelModuleVisitor: +// Class for setting Image Pixel Module attributes based on pixel data type +// ---------------------------------------------------------------------------- + +struct DPMParametricMapIOD::SetImagePixelModuleVisitor +{ + SetImagePixelModuleVisitor(const Uint16 r, + const Uint16 c) + : rows(r) + , cols(c) + { + + } + + template + OFCondition operator()( T& t ) + { + if ( (rows == 0) || (cols == 0) ) + { + DCMPMAP_ERROR("Rows/Cols must be non-zero but are : " << rows << "/" << cols); + return DPM_InvalidDimensions; + } + + t.setRows(rows); + t.setColumns(cols); + setSpecificValues(t); + + return EC_Normal; + } + + template + void setSpecificValues(IODImagePixelModule& p) + { + p.setBitsAllocated(16); + p.setBitsStored(16); + p.setHighBit(15); + p.setSamplesPerPixel(1); + p.setPhotometricInterpretation("MONOCHROME2"); + p.setPixelRepresentation(OFis_signed::value ? 1 : 0); + } + + void setSpecificValues(IODFloatingPointImagePixelModule& p) + { + // Avoid compiler warning about unused parameter "p" + (void)p; + // No specific values for 32 bit floating point data to be set + } + + void setSpecificValues(IODDoubleFloatingPointImagePixelModule& p) + { + // Avoid compiler warning about unused parameter "p" + (void)p; + // No specific values for 64 bit floating point data to be set + } + // Members + const Uint16 rows; + const Uint16 cols; +}; + + +struct DPMParametricMapIOD::ReadVisitor +{ + // Inner class that implements the specializations for different + // pixel data types + template + class DcmElementOf; + + ReadVisitor(DcmItem& srcItem, + DPMParametricMapIOD& m) + : item(srcItem) + , map(m) + { + // Nothing to do + } + + OFCondition operator()(OFmonostate) + { + return DPM_InvalidPixelData; + } + + template + OFCondition operator()(ImagePixel& pixel) + { + OFCondition result = map.readGeneric(item); + if (result.good()) + { + Uint16 rows, cols; + Uint32 numFrames; + size_t numBytesFrame = 0; + rows = cols = 0; + map.getRows(rows); + map.getColumns(cols); + numFrames = DcmIODUtil::limitMaxFrames(map.getFunctionalGroups().getNumberOfFrames(), + "Functional groups implicate more than 2147483647 frames, only 2147483647 will be used"); + if (!rows || !cols || !numFrames) + { + DCMPMAP_ERROR("Rows (" << rows << "), Columns (" << cols << ") and Number of Frames (" << numFrames << ") must not be 0"); + return DPM_InvalidPixelInfo; + } + numBytesFrame = OFstatic_cast(size_t,rows) * cols * sizeof(typename ImagePixel::value_type); + result = readSpecific(pixel, numFrames, numBytesFrame); + } + return result; + } + + template + OFCondition readSpecific(IODImagePixelModule& p, + const Uint32 numFrames, + const size_t numBytesFrame) + { + // Avoid compiler warning about unused parameter + (void)p; + unsigned long numTotalWords = 0; + const Uint16* pixData = NULL; + if (item.findAndGetUint16Array(DCM_PixelData, pixData, &numTotalWords).good()) + { + if (numTotalWords == numBytesFrame * numFrames / 2 /* we compare to num words not num bytes */) + { + for (Uint32 n = 0; n < numFrames; n++) + { + DcmIODTypes::Frame* f = new DcmIODTypes::Frame; + if (f) + { + f->length = numBytesFrame; + f->pixData = new Uint8[f->length]; + memcpy(f->pixData, pixData + n*numBytesFrame/2, numBytesFrame); + map.m_Frames.push_back(f); + } + else + { + return EC_MemoryExhausted; + } + } + } + else + { + DCMPMAP_ERROR("Invalid number of pixels: Expected " << numBytesFrame * numFrames / 2 << " pixels but Pixel Data has " << numTotalWords << " pixels"); + return DPM_InvalidPixelInfo; + } + } + else + { + DCMPMAP_ERROR("No Pixel Data element found"); + return DPM_NoPixelData; + } + return EC_Normal; + } + + OFCondition readSpecific(IODFloatingPointImagePixelModule& p, + const Uint32 numFrames, + const size_t numBytesFrame) + { + // Avoid compiler warning on unused parameter + (void)p; + unsigned long numTotalFloats = 0; + const Float32* pixData = NULL; + if (item.findAndGetFloat32Array(DCM_FloatPixelData, pixData, &numTotalFloats).good()) + { + if (numTotalFloats == numBytesFrame * numFrames / 4 /* we compare to 32 bit floats not bytes */) + { + for (Uint32 n=0; n < numFrames; n++) + { + DcmIODTypes::Frame* f = new DcmIODTypes::Frame; + if (f) + { + f->length = numBytesFrame; + f->pixData = new Uint8[f->length]; + memcpy(f->pixData, pixData + n*numBytesFrame/4, numBytesFrame); + map.m_Frames.push_back(f); + } + else + { + return EC_MemoryExhausted; + } + } + } + else + { + DCMPMAP_ERROR("Invalid number of pixels: Expected " << numBytesFrame * numFrames / 4 << " pixels but Float Pixel Data has " << numTotalFloats << " pixels"); + return DPM_InvalidPixelInfo; + } + } + else + { + DCMPMAP_ERROR("No Float Pixel Data element found"); + return DPM_NoPixelData; + } + return EC_Normal; + } + + OFCondition readSpecific(IODDoubleFloatingPointImagePixelModule& p, + const Uint32 numFrames, + const size_t numBytesFrame) + { + // Avoid compiler warning on unused parameter + (void)p; + unsigned long numTotalFloats = 0; + const Float64* pixData = NULL; + if (item.findAndGetFloat64Array(DCM_DoubleFloatPixelData, pixData, &numTotalFloats).good()) + { + if (numTotalFloats == numBytesFrame * numFrames / 8 /* we compare to 64 bit floats not bytes */) + { + for (Uint16 n=0; n < numFrames; n++) + { + DcmIODTypes::Frame* f = new DcmIODTypes::Frame; + if (f) + { + f->length = numBytesFrame; + f->pixData = new Uint8[f->length]; + memcpy(f->pixData, pixData + n*numBytesFrame/8, numBytesFrame); + map.m_Frames.push_back(f); + } + else + { + return EC_MemoryExhausted; + } + } + } + else + { + DCMPMAP_ERROR("Invalid number of pixels: Expected " << numBytesFrame * numFrames / 8 << " pixels but Double Float Pixel Data has " << numTotalFloats << " pixels"); + return DPM_InvalidPixelInfo; + } + } + else + { + DCMPMAP_ERROR("No Double Float Pixel Data element found"); + return DPM_NoPixelData; + } + return EC_Normal; + } + + // Members, i.e. parameters to operator() + DcmItem& item; + DPMParametricMapIOD& map; +}; + + + +// ---------------------------------------------------------------------------- +// Class WriteVisitor: +// Class for adding DICOM pixel data bulk element based on type pixel data type +// ---------------------------------------------------------------------------- + +// Generic implementation, template specialization is done in inner +// DcmElementOf class +struct DPMParametricMapIOD::WriteVisitor +{ + // Inner class that implements the specializations for different + // pixel data types + template + class DcmElementOf; + + // Constructor, sets parameters the visitor works on in operator() + WriteVisitor(DcmItem& i, + DPMParametricMapIOD& m) + : item(i) + , map(m) + { + // Nothing else to do + } + + // + OFCondition operator()(OFmonostate) + { + DCMPMAP_ERROR("Could not write pixel data: Invalid pixel data type, only 16 bit integer as well as 32 and 64 bit float data are handled"); + return DPM_NoPixelData; + } + + template + OFCondition operator()(ImagePixel& pixel) + { + // Avoid compiler warning about unused parameter "pixel" + (void)pixel; + // Input data is checked before + Uint16 rows = 0; + Uint16 cols = 0; + map.getRows(rows); + map.getColumns(cols); + const size_t numFrames = map.m_Frames.size(); + const size_t numBytesFrame = map.m_Frames[0]->length; + const size_t numPixelsFrame = rows * cols; + // Creates the correct pixel data element, based on the image pixel module used. + // I.e. For integer data, the "Pixel Data" element is used, i.e. the DcmElement type + // instantiated by DcmElementOf is of DCMTK type DcmOtherByteOtherWord while for + // IODFloatingPointImagePixelModule which has floating point pixel data, DcmFloatingPointSingle + // is used. + DcmElementOf element; + // copy all frames into map's frame structure + if (OFTypename ImagePixel::value_type* ptr = element.getData(numBytesFrame * numFrames)) + { + for (size_t f = 0; f < numFrames; ++f) + { + memcpy(ptr, map.m_Frames[f]->pixData, numBytesFrame); + ptr += numPixelsFrame; + } + OFCondition result = element.put(item); + // Write generic (i.e. non pixel data-specific attributes) + return result.good() ? map.writeGeneric(item) : result; + } + return EC_MemoryExhausted; + } + + // Members, i.e. parameters to operator() + DcmItem& item; + DPMParametricMapIOD& map; +}; + + +// ---------------------------------------------------------------------------- +// Class WriteVisitor:DcmElementOf >: +// Offers creation and insertion for Pixel Data element as used for +// int-based pixel data. So far, Uint8, Sint8, Uint16 and Sint16 pixel +// data is supported (relates to OB/OW data type for DICOM Pixel data) +// ---------------------------------------------------------------------------- + +template +class DPMParametricMapIOD::WriteVisitor::DcmElementOf > +{ +public: + + DcmElementOf() + : m_pElement(new DcmOtherByteOtherWord(DCM_PixelData)) + { + // Nothing else to do + } + + PixelType* getData(const size_t count); + + OFCondition put(DcmItem& itemPara) + { + OFCondition result = itemPara.insert(m_pElement.get(), OFTrue); + if (result.good()) + m_pElement.release(); + return result; + } + +private: + + OFunique_ptr m_pElement; +}; + + +template<> +Uint8* DPMParametricMapIOD::WriteVisitor::DcmElementOf >::getData(const size_t size) +{ + if (m_pElement) + if (m_pElement->setVR(EVR_OB).good()) + { + Uint8* result; + if (m_pElement->createUint8Array(OFstatic_cast(Uint32, size), result).good()) + return result; + } + return OFnullptr; +} + + +template<> +Sint8* DPMParametricMapIOD::WriteVisitor::DcmElementOf >::getData(const size_t size) +{ + if (m_pElement) + if (m_pElement->setVR(EVR_OB).good()) + { + Uint8* result; + if (m_pElement->createUint8Array(OFstatic_cast(Uint32, size), result).good()) + return OFreinterpret_cast(Sint8*, result); + } + return OFnullptr; +} + + +template<> +Uint16* DPMParametricMapIOD::WriteVisitor::DcmElementOf >::getData(const size_t size /* num total pixels */) +{ + if (m_pElement) + if (m_pElement->setVR(EVR_OW).good()) + { + Uint16* result; + if (m_pElement->createUint16Array(OFstatic_cast(Uint32, size/2), result).good()) + return result; + } + return OFnullptr; +} + + +template<> +Sint16* DPMParametricMapIOD::WriteVisitor::DcmElementOf >::getData(const size_t size) +{ + if (m_pElement) + if (m_pElement->setVR(EVR_OW).good()) + { + Uint16* result; + if (m_pElement->createUint16Array(OFstatic_cast(Uint32, size/2), result).good()) + return OFreinterpret_cast(Sint16*, result); + } + return OFnullptr; +} + + +// ---------------------------------------------------------------------------- +// Class WriteVisitor:DcmElementOf >: +// Offers creation and insertion for Pixel Data element as used for +// 32 bit float-based pixel data as used in Parametric Map IOD +// ---------------------------------------------------------------------------- + +template<> +class DPMParametricMapIOD::WriteVisitor::DcmElementOf +{ +public: + DcmElementOf() + : m_pElement(new DcmFloatingPointSingleAlloc(DCM_FloatPixelData)) + { + + } + + Float32* getData(const size_t size) + { + if (m_pElement) + { + Float32* result; + if (m_pElement->createFloat32Array(size, result).good()) + return result; + } + return OFnullptr; + } + + OFCondition put(DcmItem& itemPara) + { + OFCondition result = itemPara.insert(m_pElement.get(), OFTrue); + if (result.good()) + m_pElement.release(); + return result; + } + +private: + + struct DcmFloatingPointSingleAlloc : DcmFloatingPointSingle + { + DcmFloatingPointSingleAlloc(const DcmTagKey& tag) + : DcmFloatingPointSingle(tag) + { + + } + + OFCondition createFloat32Array(const size_t size, + Float32*& result) + { + OFCondition status = createEmptyValue(OFstatic_cast(Uint32, size)); + result = OFreinterpret_cast(Float32*, getValue()); + return status; + } + }; + + OFunique_ptr m_pElement; +}; + + +// ---------------------------------------------------------------------------- +// Class WriteVisitor:DcmElementOf >: +// Offers creation and insertion for Pixel Data element as used for +// 64 bit float-based pixel data as used in Parametric Map IOD. +// ---------------------------------------------------------------------------- + +template<> +class DPMParametricMapIOD::WriteVisitor::DcmElementOf +{ +public: + DcmElementOf() + : m_pElement(new DcmFloatingPointDoubleAlloc(DCM_DoubleFloatPixelData)) + { + + } + + Float64* getData(const size_t size) + { + if (m_pElement) + { + Float64* result; + if (m_pElement->createFloat64Array(size, result).good()) + return result; + } + return OFnullptr; + } + + OFCondition put(DcmItem& itemPara) + { + OFCondition result = itemPara.insert(m_pElement.get(), OFTrue); + if (result.good()) + m_pElement.release(); + return result; + } + +private: + + struct DcmFloatingPointDoubleAlloc : DcmFloatingPointDouble + { + DcmFloatingPointDoubleAlloc(const DcmTagKey& tag) + : DcmFloatingPointDouble(tag) + { + + } + + OFCondition createFloat64Array(const size_t size, Float64*& result) + { + OFCondition status = createEmptyValue(OFstatic_cast(Uint32, size)); + result = OFreinterpret_cast(Float64*, getValue()); + return status; + } + }; + + OFunique_ptr m_pElement; +}; + + +// Helper "class" that returns Frames offering API to the pixel's frame bulk +// data by offering the dedicated data type, e.g. Float32 instead of the +// internally stored generic Uint8 array. +// +struct DPMParametricMapIOD::GetFramesVisitor +{ + GetFramesVisitor(DPMParametricMapIOD& m) + : map(m) + { + + } + + OFCondition operator()(OFmonostate) + { + return DPM_InvalidPixelData; + } + + template + Frames operator()(ImagePixel&) + { + return Frames(map); + } + + DPMParametricMapIOD& map; +}; + + +/** Helper "class" that returns Frames offering API to the pixel's frame bulk + * data by offering the dedicated data type, e.g. Float32 instead of the + * internally stored generic Uint8 array. + */ +struct DPMParametricMapIOD::ReadFramesVisitor +{ + ReadFramesVisitor(DcmItem& i, + DPMParametricMapIOD& m) + : map(m), item(i) + { + // Nothing else to do + } + + OFCondition operator()(OFmonostate) + { + return DPM_InvalidPixelData; + } + + template + OFCondition operator()(ImagePixel&) + { + return Frames(map); + } + + // Members, i.e. parameters to operator() + DPMParametricMapIOD& map; + DcmItem& item; +}; + + + +template +DPMParametricMapIOD::Frames::Frames(DPMParametricMapIOD& map) +: m_Map(map) +{ + +} + + +template +OFCondition DPMParametricMapIOD::Frames::addFrame(PixelType* data, + const size_t numPixels, + const OFVector& perFrameInformation) +{ + OFCondition result; + if (data && numPixels) + { + if (!perFrameInformation.empty()) + { + OFunique_ptr f(new DcmIODTypes::Frame); + if (f) + { + f->length = numPixels * sizeof(PixelType); + f->pixData = new Uint8[f->length]; + memcpy(f->pixData, data, f->length); + m_Map.m_Frames.push_back(f.release()); + OFVector::const_iterator fg = perFrameInformation.begin(); + while ( result.good() && (fg != perFrameInformation.end()) ) + { + result = m_Map.m_FGInterface.addPerFrame(OFstatic_cast(Uint32, m_Map.m_Frames.size()), **fg); + if (result.bad()) + { + DCMPMAP_ERROR("Could not add functional group: " << DcmFGTypes::FGType2OFString((*fg)->getType())); + break; + } + ++fg; + } + } + } + } + // Clean up if necessary + if (result.bad()) + m_Map.m_FGInterface.deleteFrame(OFstatic_cast(Uint32, m_Map.m_Frames.size())); + return result; +} + + +template +PixelType* DPMParametricMapIOD::Frames::getFrame(const size_t frameNumber) +{ + if (frameNumber < m_Map.m_Frames.size()) + { + return (PixelType*)(m_Map.m_Frames[frameNumber]->pixData); + } + return NULL; +} + + +// Protected constructor +DPMParametricMapIOD::DPMParametricMapIOD() +: DPMParametricMapBase() +, m_ContentIdentification() +, m_Frames() +{ +} + + +// Protected constructor +template +DPMParametricMapIOD::DPMParametricMapIOD(OFin_place_type_t(ImagePixel)) +: DPMParametricMapBase(OFin_place) +, m_ContentIdentification() +, m_Frames() +{ +} + + +// Static method used to create a new Parametric Map IOD object +template +OFvariant DPMParametricMapIOD::create(const OFString& modality, + const OFString& seriesNumber, + const OFString& instanceNumber, + const Uint16 rows, + const Uint16 columns, + const IODEnhGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification, + const OFString& imageFlavor, + const OFString& derivedPixelContrast, + const DPMTypes::ContentQualification& contentQualification) +{ + DPMParametricMapIOD map(OFin_place); + + OFCondition status = SetImagePixelModuleVisitor(rows, columns)(*OFget(&map.getImagePixel())); + if (status.bad()) + return status; + + status = map.init + ( + modality, + seriesNumber, + instanceNumber, + equipmentInfo, + contentIdentification, + imageFlavor, + derivedPixelContrast, + contentQualification + ); + + if(status.bad()) + return status; + + return map; +} + + +OFCondition DPMParametricMapIOD::init(const OFString& modality, + const OFString& seriesNumber, + const OFString& instanceNumber, + const IODEnhGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification, + const OFString& imageFlavor, + const OFString& derivedPixelContrast, + const DPMTypes::ContentQualification& contentQualification) +{ + if (!equipmentInfo.isDataComplete()) + { + DCMPMAP_ERROR("Equipment info incomplete"); + return DPM_InvalidAttributeValue; + } + + OFCondition status = OFconst_cast(ContentIdentificationMacro*, &contentIdentification)->check(); + if (status.bad()) + { + DCMPMAP_ERROR("Content identification is invalid: " << status.text()); + return DPM_InvalidAttributeValue; + } + + status = OFconst_cast(ContentIdentificationMacro*, &contentIdentification)->check(); + if (imageFlavor.empty() || derivedPixelContrast.empty()) + { + DCMPMAP_ERROR + ( + "Image Type value 3 (Image Flavor) and 4 (Derived Pixel Contrast) must be set but are " + << imageFlavor << "/" << derivedPixelContrast + ); + return DPM_InvalidAttributeValue; + } + + if (!DPMTypes::cqValid(contentQualification)) + { + DCMPMAP_ERROR("Content Qualification not set"); + return DPM_InvalidAttributeValue; + } + + // All data is valid, copy to object + status = getIODEnhGeneralEquipmentModule().set(equipmentInfo); + if (status.bad()) + { + DCMPMAP_ERROR("Error setting equipment info: " << status.text()); + return DPM_InvalidAttributeValue; + } + + m_ContentIdentification = contentIdentification; + OFStringStream ss; + ss << "DERIVED\\PRIMARY\\" << imageFlavor << "\\" << derivedPixelContrast; + OFSTRINGSTREAM_GETOFSTRING(ss, imgType); + + status = getIODGeneralImageModule().setImageType(imgType); + if (status.bad()) + { + DCMPMAP_ERROR("Error setting Image Type: " << status.text()); + return DPM_InvalidAttributeValue; + } + + status = m_DPMParametricMapSeriesModule.setModality(modality); + if (status.bad()) + { + + DCMPMAP_ERROR("Could not set modality value \"" << modality << "\": " << status.text()); + return DPM_InvalidAttributeValue; + } + + status = m_DPMParametricMapSeriesModule.setSeriesNumber(seriesNumber); + if (status.bad()) + { + DCMPMAP_ERROR("Could not set Series Number: " << status.text()); + return DPM_InvalidAttributeValue; + } + + status = m_IODMultiFrameFGModule.setInstanceNumber(instanceNumber); + if (status.bad()) + return status; + + m_DPMParametricMapImageModule.setContentQualification(DPMTypes::cq2Str(contentQualification)); + m_DPMParametricMapImageModule.setRecognizableVisualFeatures("YES"); + m_DPMParametricMapImageModule.setBurnedInAnnotation("NO"); + m_DPMParametricMapImageModule.setLossyImageCompression("00"); + m_DPMParametricMapImageModule.setPresentationLUTShape("IDENTITY"); + getSOPCommon().setSOPClassUID(UID_ParametricMapStorage); + DcmIODUtil::setContentDateAndTimeNow(m_IODMultiFrameFGModule); + + return EC_Normal; +} + + +OFCondition DPMParametricMapIOD::read(DcmItem& dataset) +{ + return OFvisit(ReadVisitor(dataset,*this),getImagePixel()); + +} + + +OFCondition DPMParametricMapIOD::write(DcmItem& dataset) +{ + if (!check()) + return DPM_InvalidAttributeValue; + return OFvisit(WriteVisitor(dataset,*this),getImagePixel()); +} + + +OFvariant DPMParametricMapIOD::loadDataset(DcmDataset& dataset) +{ + OFString sopClass; + DPMParametricMapIOD *map = NULL; + if (dataset.findAndGetOFStringArray(DCM_SOPClassUID, sopClass).good()) + { + if (sopClass == UID_ParametricMapStorage) + { + DcmElement *elem = NULL; + if (dataset.findAndGetElement(DCM_PixelData, elem).good()) + { + Uint16 pr = 0; + if (dataset.findAndGetUint16(DCM_PixelRepresentation, pr).good()) + { + if (pr == 0) + { + map = new DPMParametricMapIOD(OFin_place >); + } + else + { + map = new DPMParametricMapIOD(OFin_place >); + } + } + else + { + DCMPMAP_WARN("Pixel Data element found but no Pixel Representation set, assuming 16 bit unsigned integer data"); + map = new DPMParametricMapIOD(OFin_place >); + } + } + else if (dataset.findAndGetElement(DCM_FloatPixelData, elem).good()) + { + map = new DPMParametricMapIOD(OFin_place); + } + else if (dataset.findAndGetElement(DCM_DoubleFloatPixelData, elem).good()) + { + map = new DPMParametricMapIOD(OFin_place); + } + else + { + return DPM_NoPixelData; + } + if (map == NULL) + { + return EC_MemoryExhausted; + } + } + else + { + DCMPMAP_ERROR("Invalid SOP Class: " << sopClass << ", only Parametric Map Storage (1.2.840.10008.5.1.4.1.1.30) supported"); + return DPM_InvalidSOPClass; + } + } + OFCondition result = OFvisit(ReadVisitor(dataset, *map), map->getImagePixel()); + if (result.good()) + return map; + else + return result; +} + + +OFvariant DPMParametricMapIOD::loadFile(const OFString& filename) +{ + DcmFileFormat dcmff; + OFCondition cond = dcmff.loadFile(filename.c_str()); + OFvariant result; + if (cond.good()) + { + result = loadDataset( *(dcmff.getDataset()) ); + return result; + } + else + { + return cond; + } +} + + +DPMParametricMapIOD::~DPMParametricMapIOD() +{ + DcmIODUtil::freeContainer(m_Frames); + // nothing else to do for now +} + + +OFCondition DPMParametricMapIOD::addForAllFrames(const FGBase& group) +{ + return m_FGInterface.addShared(group); +} + + +OFBool DPMParametricMapIOD::check() +{ + OFString val; + m_DPMParametricMapImageModule.getRecognizableVisualFeatures(val); + if (DPMTypes::rvfValid(DPMTypes::str2Rvf(val))) + { + m_DPMParametricMapImageModule.getContentQualification(val); + if (DPMTypes::cqValid(DPMTypes::str2Cq(val))) + { + if (!m_Frames.empty()) + { + return OFTrue; + } + else + { + DCMPMAP_ERROR("No frame data defined in Parametric Map"); + } + } + else + { + DCMPMAP_ERROR("Invalid value for Recognizable Visual Features: " << val); + } + } + else + { + DCMPMAP_ERROR("Invalid value for Content Qualification" << val); + } + return OFFalse; +} + + +OFCondition DPMParametricMapIOD::getColumns(Uint16& cols) +{ + return getImagePixel().getColumns(cols); +} + + +OFCondition DPMParametricMapIOD::getRows(Uint16& rows) +{ + return getImagePixel().getRows(rows); +} + + +size_t DPMParametricMapIOD::getNumberOfFrames() const +{ + return OFconst_cast(DPMParametricMapIOD*,this)->m_FGInterface.getNumberOfFrames(); +} + + +OFCondition DPMParametricMapIOD::setRecognizableVisualFeatures(const DPMTypes::RecognizableVisibleFeatures yesOrNo) +{ + return DPMTypes::rvfValid(yesOrNo) + ? + m_DPMParametricMapImageModule.setRecognizableVisualFeatures(DPMTypes::rvf2Str(yesOrNo)) + : + DPM_InvalidAttributeValue + ; +} + + +OFCondition DPMParametricMapIOD::readGeneric(DcmItem& dataset) +{ + OFCondition result = DPMParametricMapBase::read(dataset); + if (result.good()) + result = m_ContentIdentification.read(dataset); + return result; +} + + +OFCondition DPMParametricMapIOD::writeGeneric(DcmItem& dataset) +{ + getFrameOfReference().ensureFrameOfReferenceUID(); + m_IODMultiFrameFGModule.setNumberOfFrames(DcmIODUtil::limitMaxFrames(m_Frames.size(), "Maximum number of frames exceeded, will write 2147483647")); + OFCondition result = m_ContentIdentification.write(dataset); + if (result.good()) + { + result = DPMParametricMapBase::write(dataset); + } + return result; +} + + +DPMTypes::ContentQualification DPMParametricMapIOD::getContentQualification() +{ + OFString val; + m_DPMParametricMapImageModule.getContentQualification(val); + return DPMTypes::str2Cq(val); +} + + +DPMTypes::RecognizableVisibleFeatures DPMParametricMapIOD::getRecognizableVisualFeatures() +{ + OFString val; + DPMParametricMapIOD::m_DPMParametricMapImageModule.getRecognizableVisualFeatures(val); + return DPMTypes::str2Rvf(val); +} + + +DPMParametricMapIOD::FramesType DPMParametricMapIOD::getFrames() +{ + return OFvisit(GetFramesVisitor(*this),getImagePixel()); +} + + +OFCondition DPMParametricMapIOD::decompress(DcmDataset& dset) +{ + DcmXfer xfer = dset.getOriginalXfer(); + OFCondition result; + // If the original transfer syntax could have been lossy, print warning + if (dset.hasRepresentation(EXS_LittleEndianExplicit, NULL)) + { + if ( xfer.isEncapsulated() && (xfer.getXfer() != EXS_RLELossless) && (xfer.getXfer() != EXS_DeflatedLittleEndianExplicit) ) + { + DCMPMAP_WARN("Dataset has been compressed using a (possibly) lossy compression scheme (ignored)"); + } + } + // If the original transfer is encapsulated and we do not already have an uncompressed version, decompress or reject the file + else if (xfer.isEncapsulated()) + { + // RLE compression is fine (truly lossless). Deflated is handled internally by DCMTK. + if (xfer.getXfer() == EXS_RLELossless) + { + DCMPMAP_DEBUG("DICOM file is RLE-compressed, converting to uncompressed transfer syntax first"); + result = DcmIODUtil::decompress(dset); + } + else // We do not accept any transfer syntax that could be lossy compressed + { + DCMPMAP_ERROR("Transfer syntax " << DcmXfer(xfer).getXferName() << " uses lossy compression, not supported for Parametric Map objects!"); + result = IOD_EC_CannotDecompress; + } + } + return result; +} + +// Explicit instantiations using all permitted Parametric Map data types +template class DPMParametricMapIOD::Frames; +template class DPMParametricMapIOD::Frames; +template class DPMParametricMapIOD::Frames; +template class DPMParametricMapIOD::Frames; + +// Helper macro to not to write the same thing multiple times +#define INSTANTIATE_CREATE(T) template DCMTK_DCMPMAP_EXPORT OFvariant\ +DPMParametricMapIOD::create(const OFString& modality,\ + const OFString& seriesNumber,\ + const OFString& instanceNumber,\ + const Uint16 rows,\ + const Uint16 columns,\ + const IODEnhGeneralEquipmentModule::EquipmentInfo& equipmentInfo,\ + const ContentIdentificationMacro& contentIdentification,\ + const OFString& imageFlavor,\ + const OFString& derivedPixelContrast,\ + const DPMTypes::ContentQualification& contentQualification) + +// Instantiate all four permitted create() methods +INSTANTIATE_CREATE(IODImagePixelModule); +INSTANTIATE_CREATE(IODImagePixelModule); +INSTANTIATE_CREATE(IODFloatingPointImagePixelModule); +INSTANTIATE_CREATE(IODDoubleFloatingPointImagePixelModule); diff --git a/dcmpmap/libsrc/dpmtypes.cc b/dcmpmap/libsrc/dpmtypes.cc new file mode 100644 index 00000000..cce411c9 --- /dev/null +++ b/dcmpmap/libsrc/dpmtypes.cc @@ -0,0 +1,111 @@ +/* + * + * Copyright (C) 2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpmap + * + * Author: Michael Onken + * + * Purpose: Class for managing common paramatric map specific types. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcerror.h" +#include "dcmtk/dcmpmap/dpmtypes.h" + +OFLogger DCM_dcmpmapLogger = OFLog::getLogger("dcmtk.dcmpmap"); + +/*---------------------------------* + * constant definitions + *---------------------------------*/ + +// conditions +makeOFConditionConst(DPM_InvalidDimensions, OFM_dcmpmap, 1, OF_error, "Invalid Dimensions"); +makeOFConditionConst(DPM_InvalidAttributeValue, OFM_dcmpmap, 2, OF_error, "Invalid Attribute Value"); +makeOFConditionConst(DPM_InvalidPixelInfo, OFM_dcmpmap, 3, OF_error, "Invalid information in pixel data or related attributes"); +makeOFConditionConst(DPM_InvalidPixelData, OFM_dcmpmap, 4, OF_error, "Invalid pixel data"); +makeOFConditionConst(DPM_NoPixelData, OFM_dcmpmap, 5, OF_error, "No pixel data found"); +makeOFConditionConst(DPM_InvalidSOPClass, OFM_dcmpmap, 6, OF_error, "SOP Class not supported"); + +OFString DPMTypes::rvf2Str(const RecognizableVisibleFeatures rvf) +{ + switch (rvf) + { + case RVF_NO: return "NO"; + case RVF_YES: return "YES"; + default: return ""; + } +} + +DPMTypes::RecognizableVisibleFeatures DPMTypes::str2Rvf(const OFString& rvf) +{ + if (rvf == "NO") + return RVF_NO; + if (rvf == "YES") + return RVF_YES; + else + return RVF_UNKNOWN; +} + + +OFString DPMTypes::cq2Str(const DPMTypes::ContentQualification cq) +{ + switch (cq) + { + case CQ_PRODUCT: return "PRODUCT"; + case CQ_RESEARCH: return "RESEARCH"; + case CQ_SERVICE: return "SERVICE"; + case CQ_UNKNOWN: return ""; + } + return ""; +} + + +DPMTypes::ContentQualification DPMTypes::str2Cq(const OFString& cq) +{ + if (cq == "PRODUCT") + return CQ_PRODUCT; + if (cq == "RESEARCH") + return CQ_RESEARCH; + if (cq == "SERVICE") + return CQ_SERVICE; + else + return CQ_UNKNOWN; +} + + + +OFBool DPMTypes::cqValid(const DPMTypes::ContentQualification cq) +{ + switch (cq) + { + case CQ_PRODUCT: + case CQ_RESEARCH: + case CQ_SERVICE: return OFTrue; + case CQ_UNKNOWN: return OFFalse; + } + return OFFalse; +} + + +OFBool DPMTypes::rvfValid(const DPMTypes::RecognizableVisibleFeatures rvf) +{ + switch (rvf) + { + case RVF_NO: return OFTrue; + case RVF_YES: return OFTrue; + case RVF_UNKNOWN: return OFFalse; + } + return OFFalse; +} + diff --git a/dcmpmap/tests/Makefile.in b/dcmpmap/tests/Makefile.in new file mode 100644 index 00000000..ff99234b --- /dev/null +++ b/dcmpmap/tests/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmpmap/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +check: + +check-exhaustive: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) + +dependencies: diff --git a/dcmpstat/CMakeLists.txt b/dcmpstat/CMakeLists.txt new file mode 100644 index 00000000..340293b7 --- /dev/null +++ b/dcmpstat/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmpstat) + +# declare include directories which hold for all subdirectories +include_directories("${dcmpstat_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmqrdb_SOURCE_DIR}/include" "${dcmsr_SOURCE_DIR}/include" "${dcmsign_SOURCE_DIR}/include" "${dcmtls_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc apps include data etc tests) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmpstat/Makefile.in b/dcmpstat/Makefile.in new file mode 100644 index 00000000..8dee2ed7 --- /dev/null +++ b/dcmpstat/Makefile.in @@ -0,0 +1,99 @@ +# +# Makefile for dcmpstat +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd jni && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd jni && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmpstat/apps/CMakeLists.txt b/dcmpstat/apps/CMakeLists.txt new file mode 100644 index 00000000..776e4622 --- /dev/null +++ b/dcmpstat/apps/CMakeLists.txt @@ -0,0 +1,16 @@ +# declare additional include directories +include_directories(${dcmtls_SOURCE_DIR}/include ${LIBXML_INCDIR}) + +# declare executables +foreach(PROGRAM dcmmkcrv dcmmklut dcmp2pgm dcmprscp dcmprscu dcmpschk dcmpsmk dcmpsprt dcmpsrcv dcmpssnd) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcmp2pgm dcmprscp dcmprscu dcmpsmk dcmpschk dcmpsprt dcmpsrcv dcmpssnd) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmpstat dcmdsig dcmsr dcmimage dcmimgle dcmqrdb dcmnet dcmtls dcmdata oflog ofstd) +endforeach() + +foreach(PROGRAM dcmmkcrv dcmmklut) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmdsig dcmsr dcmimage dcmimgle dcmdata oflog ofstd) +endforeach() diff --git a/dcmpstat/apps/Makefile.dep b/dcmpstat/apps/Makefile.dep new file mode 100644 index 00000000..8b610b21 --- /dev/null +++ b/dcmpstat/apps/Makefile.dep @@ -0,0 +1,1442 @@ +dcmmkcrv.o: dcmmkcrv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +dcmmklut.o: dcmmklut.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dicrvfit.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/digsdfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../ofstd/include/dcmtk/ofstd/ofrand.h +dcmp2pgm.o: dcmp2pgm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dviface.h ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpstat.h ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmpstat/dvcache.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h ../include/dcmtk/dcmpstat/dvpscu.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +dcmprscp.o: dcmprscp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmpstat/dviface.h ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dvpstat.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmpstat/dvcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmpstat/dvpsprt.h ../include/dcmtk/dcmpstat/dvpspll.h \ + ../include/dcmtk/dcmpstat/dvpsspl.h ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../../oflog/include/dcmtk/oflog/fileap.h \ + ../../oflog/include/dcmtk/oflog/fstreams.h \ + ../../oflog/include/dcmtk/oflog/helpers/timehelp.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h +dcmprscu.o: dcmprscu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmpstat/dviface.h ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dvpstat.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmpstat/dvcache.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmpstat/dvpspr.h ../include/dcmtk/dcmpstat/dvpssp.h \ + ../include/dcmtk/dcmpstat/dvpspll.h ../include/dcmtk/dcmpstat/dvpsibl.h \ + ../include/dcmtk/dcmpstat/dvpsabl.h ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h +dcmpschk.o: dcmpschk.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsgll.h ../include/dcmtk/dcmpstat/dvpsrsl.h \ + ../include/dcmtk/dcmpstat/dvpsall.h ../include/dcmtk/dcmpstat/dvpsgal.h \ + ../include/dcmtk/dcmpstat/dvpscul.h ../include/dcmtk/dcmpstat/dvpsvll.h \ + ../include/dcmtk/dcmpstat/dvpsvwl.h ../include/dcmtk/dcmpstat/dvpsdal.h \ + ../include/dcmtk/dcmpstat/dvpssvl.h ../include/dcmtk/dcmpstat/dvpspl.h +dcmpsmk.o: dcmpsmk.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsgll.h ../include/dcmtk/dcmpstat/dvpsrsl.h \ + ../include/dcmtk/dcmpstat/dvpsall.h ../include/dcmtk/dcmpstat/dvpsgal.h \ + ../include/dcmtk/dcmpstat/dvpscul.h ../include/dcmtk/dcmpstat/dvpsvll.h \ + ../include/dcmtk/dcmpstat/dvpsvwl.h ../include/dcmtk/dcmpstat/dvpsdal.h \ + ../include/dcmtk/dcmpstat/dvpssvl.h ../include/dcmtk/dcmpstat/dvpspl.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h +dcmpsprt.o: dcmpsprt.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dviface.h ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpstat.h ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmpstat/dvcache.h ../include/dcmtk/dcmpstat/dvpssp.h \ + ../include/dcmtk/dcmpstat/dvpspll.h ../include/dcmtk/dcmpstat/dvpsibl.h \ + ../include/dcmtk/dcmpstat/dvpsabl.h ../include/dcmtk/dcmpstat/dvpspr.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h +dcmpsrcv.o: dcmpsrcv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h \ + ../include/dcmtk/dcmpstat/dvpsmsg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h +dcmpssnd.o: dcmpssnd.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h \ + ../include/dcmtk/dcmpstat/dvpsmsg.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h diff --git a/dcmpstat/apps/Makefile.in b/dcmpstat/apps/Makefile.in new file mode 100644 index 00000000..e64a7816 --- /dev/null +++ b/dcmpstat/apps/Makefile.in @@ -0,0 +1,139 @@ +# +# Makefile for dcmpstat/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +ofstdinc = -I$(ofstddir)/include +ofstdlibdir = -L$(ofstddir)/libsrc +ofstdlib = -lofstd + +oflogdir = $(top_srcdir)/../oflog +ofloginc = -I$(oflogdir)/include +ofloglibdir = -L$(oflogdir)/libsrc +ofloglib = -loflog + +dcmdatadir = $(top_srcdir)/../dcmdata +dcmdatainc = -I$(dcmdatadir)/include +dcmdatalibdir = -L$(dcmdatadir)/libsrc +dcmdatalib = -ldcmdata + +dcmnetdir = $(top_srcdir)/../dcmnet +dcmnetinc = -I$(dcmnetdir)/include +dcmnetlibdir = -L$(dcmnetdir)/libsrc +dcmnetlib = -ldcmnet + +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmimgleinc = -I$(dcmimgledir)/include +dcmimglelibdir = -L$(dcmimgledir)/libsrc +dcmimglelib = -ldcmimgle + +dcmimagedir = $(top_srcdir)/../dcmimage +dcmimageinc = -I$(dcmimagedir)/include +dcmimagelibdir = -L$(dcmimagedir)/libsrc +dcmimagelib = -ldcmimage + +dcmpstatdir = $(top_srcdir)/../dcmpstat +dcmpstatinc = -I$(dcmpstatdir)/include +dcmpstatlibdir = -L$(dcmpstatdir)/libsrc +dcmpstatlib = -ldcmpstat + +dcmqrdbdir = $(top_srcdir)/../dcmqrdb +dcmqrdbinc = -I$(dcmqrdbdir)/include +dcmqrdblibdir = -L$(dcmqrdbdir)/libsrc +dcmqrdblib = -ldcmqrdb + +dcmtlsdir = $(top_srcdir)/../dcmtls +dcmtlsinc = -I$(dcmtlsdir)/include +dcmtlslibdir = -L$(dcmtlsdir)/libsrc +dcmtlslib = -ldcmtls + +dcmsigndir = $(top_srcdir)/../dcmsign +dcmsigninc = -I$(dcmsigndir)/include +dcmsignlibdir = -L$(dcmsigndir)/libsrc +dcmsignlib = -ldcmdsig + +dcmsrdir = $(top_srcdir)/../dcmsr +dcmsrinc = -I$(dcmsrdir)/include +dcmsrlibdir = -L$(dcmsrdir)/libsrc +dcmsrlib = -ldcmsr + +LOCALINCLUDES = $(dcmpstatinc) $(ofstdinc) $(ofloginc) $(dcmnetinc) $(dcmdatainc) \ + $(dcmimgleinc) $(dcmqrdbinc) $(dcmtlsinc) $(dcmsigninc) $(dcmsrinc) +LIBDIRS = -L$(top_srcdir)/libsrc $(dcmpstatlibdir) $(dcmqrdblibdir) $(dcmnetlibdir) \ + $(dcmtlslibdir) $(dcmsignlibdir) $(dcmsrlibdir) $(dcmdatalibdir) $(ofstdlibdir) \ + $(ofloglibdir) $(dcmimglelibdir) $(dcmimagelibdir) +LOCALLIBS = $(dcmpstatlib) $(dcmsignlib) $(dcmsrlib) $(dcmimagelib) $(dcmimglelib) \ + $(dcmqrdblib) $(dcmnetlib) $(dcmtlslib) $(dcmdatalib) $(ofloglib) $(ofstdlib) \ + $(TIFFLIBS) $(PNGLIBS) $(XMLLIBS) $(ZLIBLIBS) $(TCPWRAPPERLIBS) $(OPENSSLLIBS) \ + $(CHARCONVLIBS) $(MATHLIBS) +DCMMKLUT_LIBS = $(dcmimglelib) $(dcmdatalib) $(ofloglib) $(ofstdlib) $(XMLLIBS) \ + $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) +DCMMKCRV_LIBS = $(dcmdatalib) $(ofloglib) $(ofstdlib) $(XMLLIBS) $(ZLIBLIBS) \ + $(CHARCONVLIBS) $(MATHLIBS) + +objs = dcmpsmk.o dcmp2pgm.o dcmmklut.o dcmmkcrv.o dcmpssnd.o dcmpsrcv.o dcmpsprt.o dcmprscu.o \ + dcmprscp.o dcmpschk.o +progs = dcmpsmk dcmp2pgm dcmmklut dcmmkcrv dcmpssnd dcmpsrcv dcmpsprt dcmprscu dcmprscp dcmpschk + + +all: $(progs) + +dcmpsmk: dcmpsmk.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmpsmk.o $(LOCALLIBS) $(LIBS) + +dcmp2pgm: dcmp2pgm.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmp2pgm.o $(LOCALLIBS) $(LIBS) + +dcmmklut: dcmmklut.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmmklut.o $(DCMMKLUT_LIBS) $(LIBS) + +dcmmkcrv: dcmmkcrv.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmmkcrv.o $(DCMMKCRV_LIBS) $(LIBS) + +dcmpssnd: dcmpssnd.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmpssnd.o $(LOCALLIBS) $(LIBS) + +dcmpsrcv: dcmpsrcv.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmpsrcv.o $(LOCALLIBS) $(LIBS) + +dcmpsprt: dcmpsprt.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmpsprt.o $(LOCALLIBS) $(LIBS) + +dcmprscu: dcmprscu.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmprscu.o $(LOCALLIBS) $(LIBS) + +dcmprscp: dcmprscp.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmprscp.o $(LOCALLIBS) $(LIBS) + +dcmpschk: dcmpschk.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmpschk.o $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmpstat/apps/dcmmkcrv.cc b/dcmpstat/apps/dcmmkcrv.cc new file mode 100644 index 00000000..32ecbe08 --- /dev/null +++ b/dcmpstat/apps/dcmmkcrv.cc @@ -0,0 +1,399 @@ +/* + * + * Copyright (C) 1998-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Marco Eichelberg + * + * Purpose: This application reads a DICOM image, adds a Curve and writes it back. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofcast.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmmkcrv" + +static OFLogger dcmmkcrvLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define MAX_POINTS 65535 + +// ******************************************** + +#define SHORTCOL 3 +#define LONGCOL 13 + +int main(int argc, char *argv[]) +{ + const char *opt_inName = NULL; /* in file name */ + const char *opt_outName = NULL; /* out file name */ + const char *opt_curveName = NULL; /* curve file name */ + OFCmdUnsignedInt opt_data_vr = 4; + OFCmdUnsignedInt opt_group = 0; + OFBool opt_poly = OFTrue; + const char *opt_label = NULL; + const char *opt_description = NULL; + const char *opt_axis_x = NULL; + const char *opt_axis_y = NULL; + OFCmdUnsignedInt opt_curve_vr = 0; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Add 2D curve data to image", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM input image file"); + cmd.addParam("curvedata-in", "curve data input file (text)"); + cmd.addParam("dcmfile-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("curve creation options:"); + cmd.addSubGroup("curve type:"); + cmd.addOption("--poly", "-r", "create as POLY curve (default)"); + cmd.addOption("--roi", "+r", "create as ROI curve"); + + cmd.addSubGroup("curve value representation:"); + cmd.addOption("--data-vr", "+v", 1, "[n]umber: integer 0..4 (default: 4)", + "select curve data VR: 0=US, 1=SS, 2=FL, 3=FD, 4=SL"); + cmd.addOption("--curve-vr", "-c", 1, "[n]umber: integer 0..2 (default: 0)", + "select VR with which the Curve Data element is written\n" + "0=VR according to --data-vr, 1=OB, 2=OW"); + cmd.addSubGroup("repeating group:"); + cmd.addOption("--group", "-g", 1, "[n]umber: integer 0..15 (default: 0)", + "select repeating group: 0=0x5000, 1=0x5002 etc."); + cmd.addSubGroup("curve description:"); + cmd.addOption("--label", "-l", 1, "s: string", + "set Curve Label to s (default: absent)"); + cmd.addOption("--description", "+d", 1, "s: string", + "set Curve Description to s (default: absent)"); + cmd.addOption("--axis", "-a", 2, "x: string, y: string", + "set Axis Units to x\\y (default: absent)"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + cmd.getParam(1, opt_inName); + cmd.getParam(2, opt_curveName); + cmd.getParam(3, opt_outName); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--roi")) opt_poly = OFFalse; + if (cmd.findOption("--poly")) opt_poly = OFTrue; + cmd.endOptionBlock(); + + + if (cmd.findOption("--data-vr")) app.checkValue(cmd.getValueAndCheckMinMax(opt_data_vr, 0, 4)); + if (cmd.findOption("--curve-vr")) app.checkValue(cmd.getValueAndCheckMinMax(opt_curve_vr, 0, 2)); + if (cmd.findOption("--group")) app.checkValue(cmd.getValueAndCheckMinMax(opt_group, 0, 15)); + if (cmd.findOption("--label")) app.checkValue(cmd.getValue(opt_label)); + if (cmd.findOption("--description")) app.checkValue(cmd.getValue(opt_description)); + if (cmd.findOption("--axis")) + { + app.checkValue(cmd.getValue(opt_axis_x)); + app.checkValue(cmd.getValue(opt_axis_y)); + } + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmmkcrvLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) { + OFLOG_WARN(dcmmkcrvLogger, "no data dictionary loaded, " + << "check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + DcmFileFormat *fileformat = new DcmFileFormat; + if (!fileformat) + { + OFLOG_FATAL(dcmmkcrvLogger, "memory exhausted"); + return 1; + } + + OFCondition error = fileformat->loadFile(opt_inName); + if (! error.good()) + { + OFLOG_FATAL(dcmmkcrvLogger, error.text() << ": reading file: " << opt_inName); + return 1; + } + + DcmDataset *dataset = fileformat->getDataset(); + + /* read curve data */ + + STD_NAMESPACE ifstream curvefile(opt_curveName); + if (!curvefile) + { + OFLOG_FATAL(dcmmkcrvLogger, "cannot open curve file: " << opt_curveName); + return 1; + } + + double *array = new double[MAX_POINTS*2]; + if (array==NULL) + { + OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); + return 1; + } + + size_t idx=0; + double d; + OFBool done = OFFalse; + while ((curvefile.good())&&(!done)) + { + curvefile >> d; + if (idx == MAX_POINTS*2) + { + OFLOG_WARN(dcmmkcrvLogger, "too many curve points, can only handle " << MAX_POINTS << "."); + done = OFTrue; + } else { + if (curvefile.good()) array[idx++] = d; + } + } + + /* create curve description data */ + DcmUnsignedShort *curveDimensions = new DcmUnsignedShort(DCM_RETIRED_CurveDimensions); + DcmUnsignedShort *numberOfPoints = new DcmUnsignedShort(DCM_RETIRED_NumberOfPoints); + DcmCodeString *typeOfData = new DcmCodeString(DCM_RETIRED_TypeOfData); + DcmUnsignedShort *dataValueRepresentation = new DcmUnsignedShort(DCM_RETIRED_DataValueRepresentation); + DcmLongString *curveDescription = new DcmLongString(DCM_RETIRED_CurveDescription); + DcmShortString *axisUnits = new DcmShortString(DCM_RETIRED_AxisUnits); + DcmLongString *curveLabel = new DcmLongString(DCM_RETIRED_CurveLabel); + + if ((!curveDimensions)||(!numberOfPoints)||(!typeOfData)||(!dataValueRepresentation) + ||(!curveDescription)||(!axisUnits)||(!curveLabel)) + { + OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); + delete [] array; + return 1; + } + + curveDimensions->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + curveDimensions->putUint16(2,0); + dataset->insert(curveDimensions, OFTrue); + + numberOfPoints->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + numberOfPoints->putUint16(OFstatic_cast(Uint16,idx/2),0); + dataset->insert(numberOfPoints, OFTrue); + + typeOfData->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + if (opt_poly) typeOfData->putString("POLY"); else typeOfData->putString("ROI"); + dataset->insert(typeOfData, OFTrue); + + dataValueRepresentation->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + dataValueRepresentation->putUint16(OFstatic_cast(Uint16,opt_data_vr),0); + dataset->insert(dataValueRepresentation, OFTrue); + + if (opt_description) + { + curveDescription->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + curveDescription->putString(opt_description); + dataset->insert(curveDescription, OFTrue); + } + + if (opt_label) + { + curveLabel->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + curveLabel->putString(opt_label); + dataset->insert(curveLabel, OFTrue); + } + + if (opt_axis_x && opt_axis_y) + { + OFString aString(opt_axis_x); + aString += "\\"; + aString += opt_axis_y; + axisUnits->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + axisUnits->putString(aString.c_str()); + dataset->insert(axisUnits, OFTrue); + } + + /* now create the curve itself */ + void *rawData; + size_t i; + size_t byteLength = 0; + size_t align=0; + + switch (opt_data_vr) + { + case 0: // US + OFLOG_INFO(dcmmkcrvLogger, "creating curve, VR=US, points=" << idx/2); + rawData = new Uint16[idx]; + if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); delete [] array; return 1; } + byteLength = sizeof(Uint16)*idx; + for (i=0; iputUint16Array(OFstatic_cast(Uint16 *,rawData), OFstatic_cast(Uint32, byteLength/sizeof(Uint16))); + break; + case 1: // SS + OFLOG_INFO(dcmmkcrvLogger, "encoding curve data element as VR=SS"); + element = new DcmSignedShort(DcmTag(DCM_RETIRED_CurveData, EVR_SS)); + if (element==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; } + element->putSint16Array(OFstatic_cast(Sint16 *,rawData), OFstatic_cast(Uint32, byteLength/sizeof(Sint16))); + break; + case 2: // FL + OFLOG_INFO(dcmmkcrvLogger, "encoding curve data element as VR=FL"); + element = new DcmFloatingPointSingle(DcmTag(DCM_RETIRED_CurveData, EVR_FL)); + if (element==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; } + element->putFloat32Array(OFstatic_cast(Float32 *,rawData), OFstatic_cast(Uint32, byteLength/sizeof(Float32))); + break; + case 3: // FD + OFLOG_INFO(dcmmkcrvLogger, "encoding curve data element as VR=FD"); + element = new DcmFloatingPointDouble(DcmTag(DCM_RETIRED_CurveData, EVR_FD)); + if (element==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; } + element->putFloat64Array(OFstatic_cast(Float64 *,rawData), OFstatic_cast(Uint32, byteLength/sizeof(Float64))); + break; + case 4: // SL + OFLOG_INFO(dcmmkcrvLogger, "encoding curve data element as VR=SL"); + element = new DcmSignedLong(DcmTag(DCM_RETIRED_CurveData, EVR_SL)); + if (element==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; } + element->putSint32Array(OFstatic_cast(Sint32 *,rawData), OFstatic_cast(Uint32, byteLength/sizeof(Sint32))); + break; + default: + OFLOG_FATAL(dcmmkcrvLogger, "unknown data VR, bailing out"); + return 1; + } + element->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + dataset->insert(element, OFTrue); + break; + case 1: // OB + // create little endian byte order + OFLOG_INFO(dcmmkcrvLogger, "encoding curve data element as VR=OB"); + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, rawData, OFstatic_cast(Uint32, byteLength), align); + element = new DcmOtherByteOtherWord(DCM_RETIRED_CurveData); + if (element==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; } + element->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + element->setVR(EVR_OB); + element->putUint8Array(OFstatic_cast(Uint8 *,rawData), OFstatic_cast(Uint32, byteLength)); + dataset->insert(element, OFTrue); + break; + case 2: // OW + // create little endian byte order + OFLOG_INFO(dcmmkcrvLogger, "encoding curve data element as VR=OW"); + if (align != sizeof(Uint16)) + { + swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, rawData, OFstatic_cast(Uint32, byteLength), align); + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, rawData, OFstatic_cast(Uint32, byteLength), sizeof(Uint16)); + } + element = new DcmOtherByteOtherWord(DCM_RETIRED_CurveData); + if (element==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; } + element->setGTag(OFstatic_cast(Uint16,0x5000+2*opt_group)); + element->setVR(EVR_OW); + element->putUint16Array(OFstatic_cast(Uint16 *,rawData), OFstatic_cast(Uint32, byteLength/sizeof(Uint16))); + dataset->insert(element, OFTrue); + break; + default: + OFLOG_FATAL(dcmmkcrvLogger, "unsupported VR, bailing out"); + return 1; + } + /* write back */ + + error = fileformat->saveFile(opt_outName, dataset->getOriginalXfer()); + if (error != EC_Normal) + { + OFLOG_FATAL(dcmmkcrvLogger, error.text() + << ": writing file: " << opt_outName); + return 1; + } + + return 0; + +} diff --git a/dcmpstat/apps/dcmmklut.cc b/dcmpstat/apps/dcmmklut.cc new file mode 100644 index 00000000..cd651aff --- /dev/null +++ b/dcmpstat/apps/dcmmklut.cc @@ -0,0 +1,1041 @@ +/* + * + * Copyright (C) 1998-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Marco Eichelberg, Joerg Riesmeier + * + * Purpose: This application reads a DICOM image, adds a Modality LUT, + * a VOI LUT or a Presentation LUT to the image and writes it back. + * The LUT has a gamma curve shape or can be imported from an external + * file. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmimgle/dicrvfit.h" +#include "dcmtk/dcmimgle/digsdfn.h" +#include "dcmtk/dcmimgle/diutils.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/ofstd/ofrand.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CMATH +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmmklut" + +static OFLogger dcmmklutLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + + +enum LUT_Type +{ + LUT_Modality, + LUT_Presentation, + LUT_VOI +}; + + +static OFCondition readMapFile(const char *filename, + double *&inputXData, + double *&inputYData, + unsigned long &inputEntries, + double &inputXMax, + double &inputYMax) +{ + OFCondition result = EC_IllegalCall; + if ((filename != NULL) && (strlen(filename) > 0)) + { + OFLOG_INFO(dcmmklutLogger, "reading map file ..."); + unsigned char buffer[1000]; + FILE *inf = fopen(filename, "rb"); + if (inf != NULL) + { + if (fread(buffer, 1, 264, inf) == 264) + { + if (fread(buffer + 264, 1, 1, inf) == 0) + { + if ((buffer[0] == 0x8a) && (buffer[1] == 0x3f) && (buffer[2] == 0x0) && (buffer[3] == 0x0)) + { + inputEntries = 256; + inputXMax = 255; + inputYMax = 255; + inputXData = new double[inputEntries]; + inputYData = new double[inputEntries]; + if ((inputXData != NULL) && (inputYData != NULL)) + { + for (unsigned long i = 0; i < inputEntries; i++) + { + inputXData[i] = i; + inputYData[i] = (double)buffer[i + 8]; + } + result = EC_Normal; + } + } else + OFLOG_WARN(dcmmklutLogger, "magic word wrong, not a map file ... ignoring !"); + } else + OFLOG_WARN(dcmmklutLogger, "file too large, not a map file ... ignoring !"); + } else + OFLOG_WARN(dcmmklutLogger, "read error in map file ... ignoring !"); + fclose(inf); + } else + OFLOG_WARN(dcmmklutLogger, "cannot open map file ... ignoring !"); + } + return result; +} + + +static OFCondition readTextFile(const char *filename, + double *&inputXData, + double *&inputYData, + unsigned long &inputEntries, + double &inputXMax, + double &inputYMax) +{ + if ((filename != NULL) && (strlen(filename) > 0)) + { + OFLOG_INFO(dcmmklutLogger, "reading text file ..."); + STD_NAMESPACE ifstream file(filename, OFopenmode_in_nocreate); + if (file) + { + inputEntries = 0; + inputXMax = 0; + inputYMax = 0; + unsigned long count = 0; + double xmax = 0; + double ymax = 0; + char c; + while (file.get(c)) + { + if (c == '#') // comment character + { + while (file.get(c) && (c != '\n') && (c != '\r')); // skip comments + } + else if (!isspace(OFstatic_cast(unsigned char, c))) // skip whitespaces + { + file.putback(c); + if (inputEntries == 0) // read number of entries + { + char str[6]; + file.get(str, sizeof(str)); + if (strcmp(str, "count") == 0) // check for key word: count + { + file >> inputEntries; + if (inputEntries > 0) + { + inputXData = new double[inputEntries]; + inputYData = new double[inputEntries]; + if ((inputXData == NULL) || (inputYData == NULL)) + return EC_IllegalCall; + } else { + OFLOG_ERROR(dcmmklutLogger, "invalid or missing value for number of entries in text file ... ignoring !"); + return EC_IllegalCall; // abort + } + } else { + OFLOG_ERROR(dcmmklutLogger, "missing keyword 'count' for number of entries in text file ... ignoring !"); + return EC_IllegalCall; // abort + } + } + else if ((inputXMax == 0.0) && (c == 'x')) // read x maxvalue (optional) + { + char str[5]; + file.get(str, sizeof(str)); + if (strcmp(str, "xMax") == 0) // check for key word: xMax + { + file >> inputXMax; + if (inputXMax <= 0) + { + OFLOG_DEBUG(dcmmklutLogger, "invalid value for xMax in text file ...ignoring !"); + } + } else { + OFLOG_ERROR(dcmmklutLogger, "invalid text file ... ignoring !"); + return EC_IllegalCall; // abort + } + } + else if ((inputYMax == 0.0) && (c == 'y')) // read y maxvalue (optional) + { + char str[5]; + file.get(str, sizeof(str)); + if (strcmp(str, "yMax") == 0) // check for key word: yMax + { + file >> inputYMax; + if (inputYMax <= 0) + { + OFLOG_DEBUG(dcmmklutLogger, "invalid value for yMax in text file ...ignoring !"); + } + } else { + OFLOG_ERROR(dcmmklutLogger, "invalid text file ... ignoring !"); + return EC_IllegalCall; // abort + } + } else { + if (count < inputEntries) + { + file >> inputXData[count]; // read x value + file >> inputYData[count]; // read y value + if (file.fail()) + { + OFLOG_DEBUG(dcmmklutLogger, "missing y value in text file ... ignoring last entry !"); + } else { + if ((count > 0) && (inputXData[count] <= xmax)) + { + OFLOG_DEBUG(dcmmklutLogger, "x values in text file not strictly monotonous ... ignoring entry #" << (count + 1) << " !"); + } else { + xmax = inputXData[count]; + if (inputYData[count] > ymax) + ymax = inputYData[count]; + if ((inputXMax != 0) && (inputXData[count] > inputXMax)) + { + OFLOG_DEBUG(dcmmklutLogger, "x value (" << inputXData[count] << ") exceeds maximum value (" + << inputXMax << ") in text file ..." << OFendl << " ... ignoring value !"); + } + else if ((inputYMax != 0) && (inputYData[count] > inputYMax)) + { + OFLOG_DEBUG(dcmmklutLogger, "y value (" << inputYData[count] << ") exceeds maximum value (" + << inputYMax << ") in text file ..." << OFendl << " ... ignoring value !"); + } else + count++; + } + } + } else { + OFLOG_DEBUG(dcmmklutLogger, "too many values in text file ... ignoring last line(s) !"); + break; + } + } + } + } + if (count < inputEntries) + { + inputEntries = count; + OFLOG_DEBUG(dcmmklutLogger, "automatically setting number of entries in text file to " << inputEntries << " !"); + } + if (inputXMax == 0) // automatic calculation + inputXMax = xmax; + if (inputYMax == 0) + inputYMax = ymax; + if (/*(inputXMax > 0) && (inputYMax > 0) &&*/ (inputEntries > 0) && (inputXData != NULL) && (inputYData != NULL)) + return EC_Normal; + else + OFLOG_WARN(dcmmklutLogger, "invalid text file ... ignoring !"); + } else + OFLOG_WARN(dcmmklutLogger, "can't open text file ... ignoring !"); + } + return EC_IllegalCall; +} + + +static OFCondition writeTextOutput(const char *filename, + const unsigned long numberOfEntries, + const signed long firstMapped, + const Uint16 *outputData, + const OFString &header) +{ + OFCondition result = EC_IllegalCall; + if ((filename != NULL) && (strlen(filename) > 0)) + { + if ((outputData != NULL) && (numberOfEntries > 0)) + { + OFLOG_INFO(dcmmklutLogger, "writing text file ..."); + STD_NAMESPACE ofstream file(filename); + if (file) + { + file << header << OFendl; + for (unsigned long i = 0; i < numberOfEntries; i++) + file << (firstMapped + (signed long)i) << "\t" << outputData[i] << OFendl; + } else + OFLOG_WARN(dcmmklutLogger, "can't create output text file ... ignoring !"); + } + } + return result; +} + + +static OFCondition convertInputLUT(const unsigned int numberOfBits, + const unsigned long numberOfEntries, + const signed long firstMapped, + double *inputXData, + double *inputYData, + const unsigned long inputEntries, + const double inputXMax, + const double inputYMax, + const unsigned int order, + Uint16 *outputData, + OFString &header, + char *explanation) +{ + OFCondition result = EC_IllegalCall; + if ((inputXData != NULL) && (inputYData != NULL) && (inputEntries > 0) && (inputYMax > 0) && (outputData != NULL)) + { + OFOStringStream oss; + if (explanation !=NULL) + { + if (strlen(explanation) == 0) + { + sprintf(explanation, "LUT created from %u->%u bit data, descriptor %u/%ld/%u", + DicomImageClass::tobits((int)inputXMax), DicomImageClass::tobits((int)inputYMax), + (numberOfEntries < 65536) ? (Uint16)numberOfEntries : 0, firstMapped, numberOfBits); + } + oss << "# " << explanation << OFendl; + } + const double factor = (double)(DicomImageClass::maxval(numberOfBits)) / inputYMax; + if (factor != 1.0) + { + OFLOG_INFO(dcmmklutLogger, "multiplying input values by " + << STD_NAMESPACE ios::fixed << factor << " ..."); + for (unsigned long i = 0; i < inputEntries; i++) + inputYData[i] *= factor; + } + if (numberOfEntries == inputEntries) + { + OFLOG_INFO(dcmmklutLogger, "importing LUT data directly ..."); + for (unsigned long i = 0; i < numberOfEntries; i++) + outputData[i] = (Uint16)inputYData[i]; + result = EC_Normal; + } else { + OFLOG_INFO(dcmmklutLogger, "using polynomial curve fitting algorithm ..."); + double *coeff = new double[order + 1]; + if (DiCurveFitting::calculateCoefficients(inputXData, inputYData, (unsigned int)inputEntries, order, coeff)) + { + if (DiCurveFitting::calculateValues(0, inputXMax, outputData, (unsigned int)numberOfEntries, order, coeff)) + { + oss << "# using polynomial curve fitting algorithm (order = " << order << ")" << OFendl; + oss << "# equation: y = C0 + C1*x + C2*x^2 + C3*x^3 + ... + Cn*x^n" << OFendl; + oss << "# where: "; + for (unsigned int i = 0; i <= order; i++) + { + oss << "C" << i << " = "; + oss.setf(STD_NAMESPACE ios::fixed, STD_NAMESPACE ios::floatfield); + //oss.setf(ios::showpos); + oss.precision(5); + oss.width(10); + oss << coeff[i] << OFendl; + if (i < order) + { + oss << "# "; + if (i < 9) + oss << " "; + } + } + result = EC_Normal; + } + } + delete[] coeff; + } + if (result == EC_Normal) + { + oss << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + header += tmpString; + OFSTRINGSTREAM_FREESTR(tmpString) + } else + OFLOG_WARN(dcmmklutLogger, "can't create lookup table from text file ... ignoring !"); + } + return result; +} + + +static void gammaLUT(const unsigned int numberOfBits, + const unsigned long numberOfEntries, + const signed long firstMapped, + const OFBool byteAlign, + const double gammaValue, + Uint16 *outputData, + OFString &header, + char *explanation) +{ + if (outputData != NULL) + { + OFLOG_INFO(dcmmklutLogger, "computing gamma function ..."); + OFOStringStream oss; + if (explanation != NULL) + { + if (strlen(explanation) == 0) + { + char gammabuf[16]; + OFStandard::ftoa(gammabuf, sizeof(gammabuf), gammaValue, OFStandard::ftoa_format_f, 3, 1); + + sprintf(explanation, "LUT with gamma %s, descriptor %u/%ld/%u", gammabuf, + (numberOfEntries < 65536) ? (Uint16)numberOfEntries : 0, firstMapped, numberOfBits); + } + oss << "# " << explanation << OFendl; + } + Uint16 maxValue = 0xFFFF >> (16 - numberOfBits); + double step = (double)maxValue / ((double)numberOfEntries - 1.0); + double gammaExp = 1.0 / gammaValue; + double factor = (double)maxValue / pow((double)maxValue, gammaExp); + double val; + unsigned long i = 0; + if (byteAlign) + { + Uint8 *data8 = (Uint8 *)outputData; + for (i = 0; i < numberOfEntries; i++) + { + val = factor * pow(i * step, gammaExp); + data8[i] = (Uint8)val; + } + data8[numberOfEntries]=0; //create padding value + } else { + for (i = 0; i < numberOfEntries; i++) + { + val = factor * pow(i * step, gammaExp); + outputData[i]= (Uint16)val; + } + } + oss << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + header += tmpString; + OFSTRINGSTREAM_FREESTR(tmpString) + } +} + + +static void applyInverseGSDF(const unsigned int numberOfBits, + const unsigned long numberOfEntries, + const OFBool byteAlign, + const unsigned int minDensity, + const unsigned int maxDensity, + const unsigned int illumination, + const unsigned int reflection, + Uint16 *outputData, + OFString &header, + char *explanation, + size_t explanationSize) +{ + if (outputData != NULL) + { + OFLOG_INFO(dcmmklutLogger, "applying inverse GSDF ..."); + OFOStringStream oss; + if ((explanation != NULL) && (strlen(explanation) > 0)) + OFStandard::strlcat(explanation, ", inverse GSDF", explanationSize); + const double l0 = (double)illumination; + const double la = (double)reflection; + const double dmin = (double)minDensity / 100; + const double dmax = (double)maxDensity / 100; + const double lmin = la + l0 * pow((double)10, -dmax); + const double lmax = la + l0 * pow((double)10, -dmin); + const double jmin = DiGSDFunction::getJNDIndex(lmin); + const double jmax = DiGSDFunction::getJNDIndex(lmax); + const double factor = (double)DicomImageClass::maxval(numberOfBits) / (jmax - jmin); + const double density = (dmax - dmin) / (double)DicomImageClass::maxval(numberOfBits); + unsigned long i; + if (byteAlign) + { + Uint8 *data8 = (Uint8 *)outputData; + for (i = 0; i < numberOfEntries; i++) + data8[i] = (Uint8)((DiGSDFunction::getJNDIndex(la + l0 * pow((double)10, -(dmin + (double)data8[i] * density))) - jmin) * factor); + } else { + for (i = 0; i < numberOfEntries; i++) + outputData[i] = (Uint16)((DiGSDFunction::getJNDIndex(la + l0 * pow((double)10, -(dmin + (double)outputData[i] * density))) - jmin) * factor); + } + oss << "# applied inverse GSDF with Dmin/max = " << minDensity << "/" << maxDensity << ", L0/La = " + << illumination << "/" << reflection << OFendl; + oss << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, tmpString) + header += tmpString; + OFSTRINGSTREAM_FREESTR(tmpString) + } +} + +static void mixingUpLUT(const unsigned long numberOfEntries, + const OFBool byteAlign, + const unsigned long randomCount, + const Uint32 randomSeed, + Uint16 *outputData, + char *explanation, + size_t explanationSize) +{ + OFRandom rnd; + if (outputData != NULL) + { + OFLOG_INFO(dcmmklutLogger, "mixing up LUT entries ..."); + if ((explanation != NULL) && (strlen(explanation) > 0)) + OFStandard::strlcat(explanation, ", mixed-up entries", explanationSize); + rnd.seed(randomSeed); + unsigned long i, i1, i2; + const double factor = (double)(numberOfEntries - 1) / OFstatic_cast(Uint32, -1); + if (byteAlign) + { + Uint8 temp; + Uint8 *data8 = (Uint8 *)outputData; + for (i = 0; i < randomCount; i++) + { + i1 = (unsigned long)(rnd.getRND32() * factor); + i2 = (unsigned long)(rnd.getRND32() * factor); + if (i1 != i2) + { + temp = data8[i1]; + data8[i1] = data8[i2]; + data8[i2] = temp; + } + } + } else { + Uint16 temp; + for (i = 0; i < randomCount; i++) + { + i1 = (unsigned long)(rnd.getRND32() * factor); + i2 = (unsigned long)(rnd.getRND32() * factor); + if (i1 != i2) + { + temp = outputData[i1]; + outputData[i1] = outputData[i2]; + outputData[i2] = temp; + } + } + } + } +} + + +static OFCondition createLUT(const unsigned int numberOfBits, + const unsigned long numberOfEntries, + const signed long firstMapped, + const OFBool byteAlign, + DcmEVR lutVR, + DcmItem &item, + Uint16 *data, + const char *explanation = NULL) +{ + OFCondition result = EC_Normal; + Uint16 numEntries16 = 0; + + if (numberOfEntries == 0) + OFLOG_WARN(dcmmklutLogger, "creating LUT without LUT data"); + if (numberOfEntries > 65536) + { + OFLOG_ERROR(dcmmklutLogger, "cannot create LUT with more than 65536 entries"); + return EC_IllegalCall; + } + if (numberOfEntries < 65536) + numEntries16 = (Uint16)numberOfEntries; + if ((numberOfBits < 8) || (numberOfBits > 16)) + { + OFLOG_ERROR(dcmmklutLogger, "cannot create LUT with " << numberOfBits << " bit entries, only 8..16"); + return EC_IllegalCall; + } + + DcmElement *descriptor = NULL; + if (firstMapped < 0) + { + // LUT Descriptor is SS + if (firstMapped < -32768) + { + OFLOG_ERROR(dcmmklutLogger, "cannot create LUT - first value mapped < -32768"); + return EC_IllegalCall; + } + descriptor = new DcmSignedShort(DcmTag(DCM_LUTDescriptor, EVR_SS)); + if (descriptor) + { + if (EC_Normal==result) result = descriptor->putSint16((Sint16)numEntries16, 0); + if (EC_Normal==result) result = descriptor->putSint16((Sint16)firstMapped, 1); + if (EC_Normal==result) result = descriptor->putSint16((Sint16)numberOfBits, 2); + if (EC_Normal==result) result = item.insert(descriptor, OFTrue /*replaceOld*/); + } else + return EC_MemoryExhausted; + } else { + // LUT Descriptor is US + if (firstMapped > 0xFFFF) + { + OFLOG_ERROR(dcmmklutLogger, "cannot create LUT - first value mapped > 65535"); + return EC_IllegalCall; + } + descriptor = new DcmUnsignedShort(DcmTag(DCM_LUTDescriptor, EVR_US)); + if (descriptor) + { + if (EC_Normal==result) result = descriptor->putUint16(numEntries16, 0); + if (EC_Normal==result) result = descriptor->putUint16((Uint16)firstMapped, 1); + if (EC_Normal==result) result = descriptor->putUint16(numberOfBits, 2); + if (EC_Normal==result) result = item.insert(descriptor, OFTrue /*replaceOld*/); + } else + return EC_MemoryExhausted; + } + + unsigned long wordsToWrite = 0; + if (byteAlign) + { + // the array is now in little endian byte order. Swap to local byte order if neccessary. + swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, (Uint8 *)data, numberOfEntries + 1, sizeof(Uint16)); + wordsToWrite = (numberOfEntries + 1) / 2; + } else + wordsToWrite = numberOfEntries; + if ((wordsToWrite > 32767) && (lutVR != EVR_OW)) + { + OFLOG_WARN(dcmmklutLogger, "LUT data >= 64K, writing as OW"); + lutVR = EVR_OW; + } + + // write LUT Data as OW, US, or SS + DcmElement *lutdata = NULL; + switch (lutVR) + { + case EVR_US: + lutdata = new DcmUnsignedShort(DcmTag(DCM_LUTData, EVR_US)); + if (lutdata) + { + if (EC_Normal==result) result = lutdata->putUint16Array(data, wordsToWrite); + if (EC_Normal==result) result = item.insert(lutdata, OFTrue /*replaceOld*/); + } else + return EC_MemoryExhausted; + break; + case EVR_OW: + lutdata = new DcmOtherByteOtherWord(DcmTag(DCM_LUTData, EVR_OW)); + if (lutdata) + { + if (EC_Normal==result) result = lutdata->putUint16Array(data, wordsToWrite); + if (EC_Normal==result) result = item.insert(lutdata, OFTrue /*replaceOld*/); + } else + return EC_MemoryExhausted; + break; + case EVR_SS: + lutdata = new DcmSignedShort(DcmTag(DCM_LUTData, EVR_SS)); + if (lutdata) + { + if (EC_Normal==result) result = lutdata->putSint16Array((Sint16 *)data, wordsToWrite); + if (EC_Normal==result) result = item.insert(lutdata, OFTrue /*replaceOld*/); + } else + return EC_MemoryExhausted; + break; + default: + OFLOG_ERROR(dcmmklutLogger, "unsupported VR for LUT Data"); + return EC_IllegalCall; + /* break; */ + } + + // create LUT explanation + if (explanation != NULL) + { + DcmElement *explItem = new DcmLongString(DCM_LUTExplanation); + if (explItem) + { + if (result == EC_Normal) result = explItem->putString(explanation); + if (EC_Normal == result) result = item.insert(explItem, OFTrue /*replaceOld*/); + } else + return EC_MemoryExhausted; + } + return result; +} + + +// ******************************************** + + +#define SHORTCOL 3 +#define LONGCOL 14 + +int main(int argc, char *argv[]) +{ + const char *opt_inName = NULL; /* in file name */ + const char *opt_outName = NULL; /* out file name */ + const char *opt_outText = NULL; + const char *opt_mapName = NULL; + const char *opt_textName = NULL; + const char *opt_explanation = NULL; + OFCmdFloat opt_gammaValue = 1.0; + OFCmdUnsignedInt opt_bits = 16; + OFCmdUnsignedInt opt_entries = 256; + OFCmdSignedInt opt_firstMapped = 0; + OFCmdUnsignedInt opt_randomCount = 0; + OFCmdUnsignedInt opt_randomSeed = 0; /* default: for reproduceable results */ + OFCmdUnsignedInt opt_order = 5; + OFCmdUnsignedInt opt_minDensity = 20; + OFCmdUnsignedInt opt_maxDensity = 300; + OFCmdUnsignedInt opt_illumination = 2000; + OFCmdUnsignedInt opt_reflection = 10; + LUT_Type opt_lutType = LUT_VOI; + OFBool opt_inverseGSDF = OFFalse; + OFBool opt_byteAlign = OFFalse; + OFBool opt_replaceMode = OFTrue; + DcmEVR opt_lutVR = EVR_OW; + + OFCommandLine cmd; + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Create DICOM look-up tables", rcsid); + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmimg-out", "DICOM output filename"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("LUT creation options:"); + cmd.addSubGroup("LUT type:"); + cmd.addOption("--modality", "+Tm", "create as Modality LUT"); + cmd.addOption("--presentation", "+Tp", "create as Presentation LUT"); + cmd.addOption("--voi", "+Tv", "create as VOI LUT (default)"); + cmd.addSubGroup("LUT placement:"); + cmd.addOption("--add", "+Pa", "add to existing transform\n(default for and only with --voi)"); + cmd.addOption("--replace", "+Pr", "replace existing transform\n(default for --modality and --presentation)"); + cmd.addSubGroup("LUT content:"); + cmd.addOption("--gamma", "+Cg", 1, "[g]amma: float", + "use gamma value (default: 1.0)"); + cmd.addOption("--map-file", "+Cm", 1, "[f]ilename: string", + "read input data from MAP file"); + cmd.addOption("--text-file", "+Ct", 1, "[f]ilename: string", + "read input data from text file"); + cmd.addSubGroup("LUT options:"); + cmd.addOption("--inverse-gsdf", "+Og", "apply inverse GSDF (print presentation LUT in OD)"); + cmd.addOption("--min-density", 1, "[v]alue: integer (0..65535, default: 20)", + "set min density to v (in hundreds of OD)"); + cmd.addOption("--max-density", 1, "[v]alue: integer (0..65535, default: 300)", + "set max density to v (in hundreds of OD)"); + cmd.addOption("--illumination", "+Oi", 1, "[v]alue: integer (0..65535, default: 2000)", + "set illumination to v (in cd/m^2)"); + cmd.addOption("--reflection", "+Or", 1, "[v]alue: integer (0..65535, default: 10)", + "set reflected ambient light to v (in cd/m^2)"); + cmd.addSubGroup("LUT structure:"); + cmd.addOption("--bits", "-b", 1, "[n]umber: integer", + "create LUT with n bit values (8..16, default: 16)"); + cmd.addOption("--entries", "-e", 1, "[n]umber: integer", + "create LUT with n entries (1..65536, default: 256)"); + cmd.addOption("--first-mapped", "-f", 1, "[n]umber: integer", + "first input value mapped (-31768..65535, default: 0)"); + cmd.addOption("--random", "-r", 1, "[n]umber: unsigned integer", + "perform n randomly selected permutations on the LUT"); + cmd.addOption("--random-seed", "-rs", 1, "[n]umber: unsigned integer", + "initialize the random-number generator with n\n(default: 0, for reproducible results)"); + cmd.addOption("--order", "-o", 1, "[n]umber: integer", + "use polynomial curve fitting algorithm with order n\n(0..99, default: 5)"); + cmd.addOption("--explanation", "-E", 1, "[n]ame: string", + "LUT explanation (default: automatically created)"); + cmd.addSubGroup("LUT data alignment:"); + cmd.addOption("--byte-align", "-a", "create byte-aligned LUT\n(default for and only with 8 bit values)"); + cmd.addOption("--word-align", "+a", "create word-aligned LUT\n(default for 9-16 bit values)"); + cmd.addSubGroup("LUT data VR:"); + cmd.addOption("--data-ow", "+Dw", "write LUT Data as OW (default)"); + cmd.addOption("--data-us", "+Du", "write LUT Data as US"); + cmd.addOption("--data-ss", "+Ds", "write LUT Data as SS (minimal support)"); + cmd.addGroup("file options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--dicom-input", "+Fi", 1, "[f]ilename: string", + "read dataset from DICOM file f"); + cmd.addOption("--text-output", "+Fo", 1, "[f]ilename: string", + "write LUT data to tabbed text file f"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* command line parameters */ + cmd.getParam(1, opt_outName); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--modality")) + opt_lutType = LUT_Modality; + if (cmd.findOption("--presentation")) + opt_lutType = LUT_Presentation; + if (cmd.findOption("--voi")) + opt_lutType = LUT_VOI; + cmd.endOptionBlock(); + + if ((opt_lutType == LUT_Modality) || (opt_lutType == LUT_Presentation)) + opt_replaceMode = OFTrue; + else + opt_replaceMode = OFFalse; + cmd.beginOptionBlock(); + if (cmd.findOption("--add")) + { + app.checkConflict("--add","--modality", (opt_lutType == LUT_Modality)); + app.checkConflict("--add","--presentation", (opt_lutType == LUT_Presentation)); + opt_replaceMode = OFFalse; + } + if (cmd.findOption("--replace")) + opt_replaceMode = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--gamma")) + app.checkValue(cmd.getValue(opt_gammaValue)); + if (cmd.findOption("--map-file")) + app.checkValue(cmd.getValue(opt_mapName)); + if (cmd.findOption("--text-file")) + app.checkValue(cmd.getValue(opt_textName)); + cmd.endOptionBlock(); + + if (cmd.findOption("--inverse-gsdf")) + opt_inverseGSDF = OFTrue; + if (cmd.findOption("--min-density")) + app.checkValue(cmd.getValue(opt_minDensity)); + if (cmd.findOption("--max-density")) + app.checkValue(cmd.getValue(opt_maxDensity)); + if (cmd.findOption("--illumination")) + app.checkValue(cmd.getValue(opt_illumination)); + if (cmd.findOption("--reflection")) + app.checkValue(cmd.getValue(opt_reflection)); + + if (cmd.findOption("--bits")) + { + app.checkValue(cmd.getValueAndCheckMinMax(opt_bits, 8, 16)); + opt_byteAlign = (opt_bits == 8); /* default */ + } + if (cmd.findOption("--entries")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_entries, 1, 65536)); + if (cmd.findOption("--first-mapped")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_firstMapped, -32768, 65535)); + if (cmd.findOption("--explanation")) + app.checkValue(cmd.getValue(opt_explanation)); + if (cmd.findOption("--random")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_randomCount, 1, 99999)); + if (cmd.findOption("--random-seed")) + app.checkValue(cmd.getValue(opt_randomSeed)); + if (cmd.findOption("--order")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_order, 0, 99)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--byte-align")) + opt_byteAlign = OFTrue; + if (cmd.findOption("--word-align")) + opt_byteAlign = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--data-ow")) + opt_lutVR = EVR_OW; + if (cmd.findOption("--data-us")) + opt_lutVR = EVR_US; + if (cmd.findOption("--data-ss")) + opt_lutVR = EVR_SS; + cmd.endOptionBlock(); + + if (cmd.findOption("--dicom-input")) + app.checkValue(cmd.getValue(opt_inName)); + if (cmd.findOption("--text-output")) + app.checkValue(cmd.getValue(opt_outText)); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmmklutLogger, rcsid << OFendl); + + if ((opt_lutType == LUT_Modality) && (opt_bits != 8) && (opt_bits != 16)) + { + OFLOG_FATAL(dcmmklutLogger, "--modality cannot be used with --bits other than 8 or 16"); + return 1; + } + if ((opt_bits != 8) && opt_byteAlign) + { + OFLOG_FATAL(dcmmklutLogger, "--byte-align cannot be used with --bits other than 8"); + return 1; + } + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + OFLOG_WARN(dcmmklutLogger, "no data dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + + E_TransferSyntax Xfer= EXS_LittleEndianExplicit; + OFCondition result = EC_Normal; + DcmFileFormat *fileformat = new DcmFileFormat(); + if (!fileformat) + { + OFLOG_FATAL(dcmmklutLogger, "memory exhausted"); + return 1; + } + DcmDataset *dataset = fileformat->getDataset(); + + if (opt_inName != NULL) + { + OFCondition cond = fileformat->loadFile(opt_inName); + if (! cond.good()) + { + OFLOG_FATAL(dcmmklutLogger, "cannot open file: " << opt_inName); + return 1; + } + Xfer = dataset->getOriginalXfer(); + } + + /* create Item with LUT */ + DcmItem *ditem = new DcmItem(); + if (ditem) + { + Uint16 *outputData = new Uint16[opt_entries]; + if (outputData == NULL) + result = EC_MemoryExhausted; + else + { + char explStr[1024]; + if (opt_explanation != NULL) + OFStandard::strlcpy(explStr, opt_explanation, 1024); + else + explStr[0] = 0; + OFString headerStr; + double *inputXData = NULL; + double *inputYData = NULL; + unsigned long inputEntries = 0; + double inputXMax = 0; + double inputYMax = 0; + if (readMapFile(opt_mapName, inputXData, inputYData, inputEntries, inputXMax, inputYMax) == EC_Normal) + { + result = convertInputLUT((unsigned int)opt_bits, opt_entries, opt_firstMapped, inputXData, inputYData, inputEntries, + inputXMax, inputYMax, (unsigned int)opt_order, outputData, headerStr, explStr); + } + else if (readTextFile(opt_textName, inputXData, inputYData, inputEntries, inputXMax, inputYMax) == EC_Normal) + { + result = convertInputLUT((unsigned int)opt_bits, opt_entries, opt_firstMapped, inputXData, inputYData, inputEntries, + inputXMax, inputYMax, (unsigned int)opt_order, outputData, headerStr, explStr); + } else { + gammaLUT((unsigned int)opt_bits, opt_entries, opt_firstMapped, opt_byteAlign, opt_gammaValue, outputData, headerStr, explStr); + } + if (result == EC_Normal) + { + if (opt_inverseGSDF) + applyInverseGSDF((unsigned int)opt_bits, opt_entries, opt_byteAlign, (unsigned int)opt_minDensity, (unsigned int)opt_maxDensity, + (unsigned int)opt_illumination, (unsigned int)opt_reflection, outputData, headerStr, explStr, 1024); + if (opt_randomCount > 0) + mixingUpLUT(opt_entries, opt_byteAlign, opt_randomCount, (Uint32)opt_randomSeed, outputData, explStr, 1024); + result = createLUT((unsigned int)opt_bits, opt_entries, opt_firstMapped, opt_byteAlign, opt_lutVR, *ditem, + outputData, explStr); + } + delete[] inputXData; + delete[] inputYData; + writeTextOutput(opt_outText, opt_entries, opt_firstMapped, outputData, headerStr); + } + delete[] outputData; + if (EC_Normal != result) + { + OFLOG_FATAL(dcmmklutLogger, "could not create LUT, bailing out."); + return 1; + } + } else + result = EC_MemoryExhausted; + + if (opt_outName != NULL) + { + DcmSequenceOfItems *dseq = NULL; + if (EC_Normal==result) + { + switch (opt_lutType) + { + case LUT_Modality: + { + DcmLongString modalityLUTType(DCM_ModalityLUTType); + modalityLUTType.putString("US"); // unspecified Modality LUT + DcmElement *delem = new DcmLongString(modalityLUTType); + if (delem) + { + ditem->insert(delem, OFTrue /*replaceOld*/); + dseq = new DcmSequenceOfItems(DCM_ModalityLUTSequence); + if (dseq) + { + dataset->insert(dseq, OFTrue); + dseq->insert(ditem); + } else + result = EC_MemoryExhausted; + delete dataset->remove(DCM_RescaleIntercept); + delete dataset->remove(DCM_RescaleSlope); + delete dataset->remove(DCM_RescaleType); + } else + result = EC_MemoryExhausted; + } + break; + case LUT_Presentation: + if (!opt_replaceMode) + { + // search existing sequence + DcmStack stack; + if (EC_Normal == dataset->search(DCM_PresentationLUTSequence, stack, ESM_fromHere, OFFalse)) + dseq=(DcmSequenceOfItems *)stack.top(); + } + if (dseq == NULL) + { + dseq = new DcmSequenceOfItems(DCM_PresentationLUTSequence); + if (dseq) + dataset->insert(dseq, OFTrue); + else + result = EC_MemoryExhausted; + } + if (dseq) + dseq->insert(ditem); + if (opt_replaceMode) + delete dataset->remove(DCM_PresentationLUTShape); + break; + case LUT_VOI: + if (!opt_replaceMode) + { + // search existing sequence + DcmStack stack; + if (EC_Normal == dataset->search(DCM_VOILUTSequence, stack, ESM_fromHere, OFFalse)) + dseq=(DcmSequenceOfItems *)stack.top(); + } + if (dseq == NULL) + { + dseq = new DcmSequenceOfItems(DCM_VOILUTSequence); + if (dseq) + dataset->insert(dseq, OFTrue); + else + result = EC_MemoryExhausted; + } + if (dseq) + dseq->insert(ditem); + if (opt_replaceMode) + { + delete dataset->remove(DCM_WindowCenter); + delete dataset->remove(DCM_WindowWidth); + delete dataset->remove(DCM_WindowCenterWidthExplanation); + } + break; + } + } + + if (result != EC_Normal) + { + OFLOG_FATAL(dcmmklutLogger, "Error while adding LUT to image dataset. Bailing out."); + return 1; + } + + OFLOG_INFO(dcmmklutLogger, "writing DICOM file ..."); + + result = fileformat->saveFile(opt_outName, Xfer); + if (result.bad()) + { + OFLOG_FATAL(dcmmklutLogger, result.text() << ": writing file: " << opt_outName); + return 1; + } + } + + return 0; +} diff --git a/dcmpstat/apps/dcmp2pgm.cc b/dcmpstat/apps/dcmp2pgm.cc new file mode 100644 index 00000000..480975b1 --- /dev/null +++ b/dcmpstat/apps/dcmp2pgm.cc @@ -0,0 +1,579 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Joerg Riesmeier, Marco Eichelberg + * + * Purpose + * sample application that reads a DICOM image and (optionally) + * a presentation state and creates a PGM bitmap using the settings + * of the presentation state. Non-grayscale transformations are + * ignored. If no presentation state is loaded, a default is created. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmpstat/dviface.h" +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve */ +#include "dcmtk/dcmimgle/dcmimage.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmp2pgm" + +static OFLogger dcmp2pgmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +static void dumpPresentationState(DVPresentationState &ps) +{ + size_t i, j, max; + const char *c; + + OFOStringStream oss; + + oss << "DUMPING PRESENTATION STATE" << OFendl + << "--------------------------" << OFendl << OFendl; + + c = ps.getPresentationLabel(); + oss << "Presentation Label: "; if (c) oss << c << OFendl; else oss << "none" << OFendl; + c = ps.getPresentationDescription(); + oss << "Presentation Description: "; if (c) oss << c << OFendl; else oss << "none" << OFendl; + c = ps.getPresentationCreatorsName(); + oss << "Presentation Creator's Name: "; if (c) oss << c << OFendl; else oss << "none" << OFendl; + + oss << "VOI transformation: "; + if (ps.haveActiveVOIWindow()) + { + double width=0.0, center=0.0; + ps.getCurrentWindowWidth(width); + ps.getCurrentWindowCenter(center); + oss << "window center=" << center << " width=" << width << " description=\""; + c = ps.getCurrentVOIDescription(); + if (c) oss << c << "\"" << OFendl; else oss << "(none)\"" << OFendl; + } + else if (ps.haveActiveVOILUT()) + { + oss << "lut description=\""; + c = ps.getCurrentVOIDescription(); + if (c) oss << c << "\"" << OFendl; else oss << "(none)\"" << OFendl; + } + else oss << "none" << OFendl; + + oss << "Rotation: "; + switch (ps.getRotation()) + { + case DVPSR_0_deg: + oss << "none"; + break; + case DVPSR_90_deg: + oss << "90 degrees"; + break; + case DVPSR_180_deg: + oss << "180 degrees"; + break; + case DVPSR_270_deg: + oss << "270 degrees"; + break; + } + oss << OFendl; + oss << "Flip: "; + if (ps.getFlip()) oss << "yes" << OFendl; else oss << "no" << OFendl; + + Sint32 tlhcX=0; + Sint32 tlhcY=0; + Sint32 brhcX=0; + Sint32 brhcY=0; + oss << "Displayed area:" << OFendl; + + DVPSPresentationSizeMode sizemode = ps.getDisplayedAreaPresentationSizeMode(); + double factor=1.0; + switch (sizemode) + { + case DVPSD_scaleToFit: + oss << " presentation size mode: SCALE TO FIT" << OFendl; + break; + case DVPSD_trueSize: + oss << " presentation size mode: TRUE SIZE" << OFendl; + break; + case DVPSD_magnify: + ps.getDisplayedAreaPresentationPixelMagnificationRatio(factor); + oss << " presentation size mode: MAGNIFY factor=" << factor << OFendl; + break; + } + ps.getStandardDisplayedArea(tlhcX, tlhcY, brhcX, brhcY); + oss << " displayed area TLHC=" << tlhcX << "\\" << tlhcY << " BRHC=" << brhcX << "\\" << brhcY << OFendl; + + double x, y; + if (EC_Normal == ps.getDisplayedAreaPresentationPixelSpacing(x,y)) + { + oss << " presentation pixel spacing: X=" << x << "mm Y=" << y << " mm" << OFendl; + } else { + oss << " presentation pixel aspect ratio: " << ps.getDisplayedAreaPresentationPixelAspectRatio() << OFendl; + } + + oss << "Rectangular shutter: "; + if (ps.haveShutter(DVPSU_rectangular)) + { + oss << "LV=" << ps.getRectShutterLV() + << " RV=" << ps.getRectShutterRV() + << " UH=" << ps.getRectShutterUH() + << " LH=" << ps.getRectShutterLH() << OFendl; + + } else oss << "none" << OFendl; + oss << "Circular shutter: "; + if (ps.haveShutter(DVPSU_circular)) + { + oss << "center=" << ps.getCenterOfCircularShutter_x() + << "\\" << ps.getCenterOfCircularShutter_y() + << " radius=" << ps.getRadiusOfCircularShutter() << OFendl; + } else oss << "none" << OFendl; + oss << "Polygonal shutter: "; + if (ps.haveShutter(DVPSU_polygonal)) + { + oss << "points=" << ps.getNumberOfPolyShutterVertices() << " coordinates="; + j = ps.getNumberOfPolyShutterVertices(); + Sint32 polyX, polyY; + for (i=0; igetText() << "\"" << OFendl; + oss << " anchor point: "; + if (ptext->haveAnchorPoint()) + { + oss << ptext->getAnchorPoint_x() << "\\" << ptext->getAnchorPoint_y() << " units="; + if (ptext->getAnchorPointAnnotationUnits()==DVPSA_display) oss << "display"; else oss << "pixel"; + oss << " visible="; + if (ptext->anchorPointIsVisible()) oss << "yes"; else oss << "no"; + oss << OFendl; + } else oss << "none" << OFendl; + oss << " bounding box: "; + if (ptext->haveBoundingBox()) + { + oss << "TLHC="; + oss << ptext->getBoundingBoxTLHC_x() << "\\" << ptext->getBoundingBoxTLHC_y() + << " BRHC=" << ptext->getBoundingBoxBRHC_x() << "\\" << ptext->getBoundingBoxBRHC_y() + << " units="; + if (ptext->getBoundingBoxAnnotationUnits()==DVPSA_display) oss << "display"; else oss << "pixel"; + + DVPSTextJustification justification = ptext->getBoundingBoxHorizontalJustification(); + oss << " justification="; + switch (justification) + { + case DVPSX_left: + oss << "left"; + break; + case DVPSX_right: + oss << "right"; + break; + case DVPSX_center: + oss << "center"; + break; + } + oss << OFendl; + } else oss << "none" << OFendl; + } + } + + // graphic objects + max = ps.getNumberOfGraphicObjects(layer); + oss << " Number of graphic objects: " << max << OFendl; + DVPSGraphicObject *pgraphic = NULL; + for (size_t graphicidx=0; graphicidxgetNumberOfPoints(); + Float32 fx=0.0, fy=0.0; + for (i=0; igetPoint(i,fx,fy)) + { + oss << fx << "\\" << fy << ", "; + } else oss << "???\\???, "; + } + oss << OFendl; + } + } + + // curve objects + max = ps.getNumberOfCurves(layer); + oss << " Number of activated curves: " << max << OFendl; + DVPSCurve *pcurve = NULL; + for (size_t curveidx=0; curveidxgetCurveAxisUnitsY(); + if (c && (strlen(c)>0)) oss << c << OFendl; else oss << "(none)" << OFendl; + oss << " label="; + c = pcurve->getCurveLabel(); + if (c && (strlen(c)>0)) oss << c << " description="; else oss << "(none) description="; + c = pcurve->getCurveDescription(); + if (c && (strlen(c)>0)) oss << c << OFendl; else oss << "(none)" << OFendl; + oss << " coordinates: "; + j = pcurve->getNumberOfPoints(); + double dx=0.0, dy=0.0; + for (i=0; igetPoint(i,dx,dy)) + { + oss << dx << "\\" << dy << ", "; + } else oss << "???\\???, "; + } + oss << OFendl; + } else oss << " curve " << curveidx+1 << " not present in image." << OFendl; + } + + // overlay objects + const void *overlayData=NULL; + unsigned int overlayWidth=0, overlayHeight=0, overlayLeft=0, overlayTop=0; + OFBool overlayROI=OFFalse; + Uint16 overlayTransp=0; + char overlayfile[100]; + FILE *ofile=NULL; + + max = ps.getNumberOfActiveOverlays(layer); + oss << " Number of activated overlays: " << max << OFendl; + for (size_t ovlidx=0; ovlidx 1) + cmd.getParam(2, opt_pgmName); + + OFLog::configureFromCommandLine(cmd, app); + + opt_dump_pstate = dcmp2pgmLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL); + + if (cmd.findOption("--pstate")) app.checkValue(cmd.getValue(opt_pstName)); + if (cmd.findOption("--config")) app.checkValue(cmd.getValue(opt_cfgName)); + if (cmd.findOption("--frame")) app.checkValue(cmd.getValueAndCheckMin(opt_frame, 1)); + if (cmd.findOption("--pgm")) opt_dicom_mode = OFFalse; + if (cmd.findOption("--dicom")) opt_dicom_mode = OFTrue; + if (cmd.findOption("--save-pstate")) app.checkValue(cmd.getValue(opt_savName)); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmp2pgmLogger, rcsid << OFendl); + + if (opt_cfgName) + { + FILE *cfgfile = fopen(opt_cfgName, "rb"); + if (cfgfile) fclose(cfgfile); else + { + OFLOG_FATAL(dcmp2pgmLogger, "can't open configuration file '" << opt_cfgName << "'"); + return 10; + } + } + DVInterface dvi(opt_cfgName); + OFCondition status = EC_Normal; + + if (opt_pstName == NULL) + { + OFLOG_DEBUG(dcmp2pgmLogger, "reading DICOM image file: " << opt_imgName); + status = dvi.loadImage(opt_imgName); + } else { + OFLOG_DEBUG(dcmp2pgmLogger, "reading DICOM pstate file: " << opt_pstName); + OFLOG_DEBUG(dcmp2pgmLogger, "reading DICOM image file: " << opt_imgName); + status = dvi.loadPState(opt_pstName, opt_imgName); + } + + if (status == EC_Normal) + { + if (opt_dump_pstate) dumpPresentationState(dvi.getCurrentPState()); + if (opt_pgmName != NULL) + { + const void *pixelData = NULL; + unsigned long width = 0; + unsigned long height = 0; + OFLOG_DEBUG(dcmp2pgmLogger, "creating pixel data"); + if ((opt_frame > 0) && (dvi.getCurrentPState().selectImageFrameNumber(opt_frame) != EC_Normal)) + OFLOG_ERROR(dcmp2pgmLogger, "cannot select frame " << opt_frame); + if ((dvi.getCurrentPState().getPixelData(pixelData, width, height) == EC_Normal) && (pixelData != NULL)) + { + if (opt_dicom_mode) + { + double pixelAspectRatio = dvi.getCurrentPState().getPrintBitmapPixelAspectRatio(); // works for rotated images + OFLOG_DEBUG(dcmp2pgmLogger, "writing DICOM SC file: " << opt_pgmName); + if (EC_Normal != dvi.saveDICOMImage(opt_pgmName, pixelData, width, height, pixelAspectRatio)) + { + OFLOG_ERROR(dcmp2pgmLogger, "error during creation of DICOM file"); + } + } else { + FILE *outfile = fopen(opt_pgmName, "wb"); + if (outfile) + { + OFLOG_DEBUG(dcmp2pgmLogger, "writing PGM file: " << opt_pgmName); + fprintf(outfile, "P5\n%ld %ld 255\n", width, height); + if (fwrite(pixelData, OFstatic_cast(size_t, width), OFstatic_cast(size_t, height), outfile) != OFstatic_cast(size_t, height)) + OFLOG_FATAL(dcmp2pgmLogger, "Can't write output data to file."); + fclose(outfile); + } else { + OFLOG_FATAL(dcmp2pgmLogger, "Can't create output file."); + return 10; + } + } + } else { + OFLOG_FATAL(dcmp2pgmLogger, "Can't create output data."); + return 10; + } + } + if (opt_savName != NULL) + { + OFLOG_DEBUG(dcmp2pgmLogger, "writing pstate file: " << opt_savName); + if (dvi.savePState(opt_savName, OFFalse) != EC_Normal) + { + OFLOG_FATAL(dcmp2pgmLogger, "Can't write pstate file."); + return 10; + } + } + } else { + OFLOG_FATAL(dcmp2pgmLogger, "Can't open input file(s)."); + return 10; + } + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + + return (status != EC_Normal); +} diff --git a/dcmpstat/apps/dcmprscp.cc b/dcmpstat/apps/dcmprscp.cc new file mode 100644 index 00000000..f7c39413 --- /dev/null +++ b/dcmpstat/apps/dcmprscp.cc @@ -0,0 +1,521 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Marco Eichelberg + * + * Purpose: Presentation State Viewer - Print Server + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* for O_RDONLY */ +#endif +END_EXTERN_C + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmpstat/dviface.h" +#include "dcmtk/ofstd/ofbmanip.h" /* for OFBitmanipTemplate */ +#include "dcmtk/ofstd/ofdatime.h" /* for OFDateTime */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmpstat/dvpsprt.h" +#include "dcmtk/dcmpstat/dvpshlp.h" +#include "dcmtk/oflog/fileap.h" + +#ifdef WITH_OPENSSL +#include "dcmtk/dcmtls/tlstrans.h" +#include "dcmtk/dcmtls/tlslayer.h" +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmprscp" + +static OFLogger dcmprscpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* command line options */ +static OFBool opt_binaryLog = OFFalse; +static OFBool opt_logFile = OFFalse; +static const char *opt_cfgName = NULL; /* config file name */ +static const char *opt_printer = NULL; /* printer name */ + +static void cleanChildren() +{ +#ifdef HAVE_WAITPID + int stat_loc; +#elif defined(HAVE_WAIT3) + struct rusage rusage; +#if defined(__NeXT__) + /* some systems need a union wait as argument to wait3 */ + union wait status; +#else + int status; +#endif +#endif + +#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) + int child = 1; + int options = WNOHANG; + while (child > 0) + { +#ifdef HAVE_WAITPID + child = (int)(waitpid(-1, &stat_loc, options)); +#elif defined(HAVE_WAIT3) + child = wait3(&status, options, &rusage); +#endif + if (child < 0) + { + if (errno != ECHILD) + { + char buf[256]; + OFLOG_ERROR(dcmprscpLogger, "wait for child failed: " << OFStandard::strerror(errno, buf, sizeof(buf))); + } + } + } +#endif +} + + +#define SHORTCOL 3 +#define LONGCOL 12 + +int main(int argc, char *argv[]) +{ + OFStandard::initializeNetwork(); +#ifdef WITH_OPENSSL + DcmTLSTransportLayer::initializeOpenSSL(); +#endif + + dcmDisableGethostbyaddr.set(OFTrue); // disable hostname lookup + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM basic grayscale print management SCP", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 2); + + cmd.addGroup("general options:"); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--logfile", "-l", "write a log file (not with --log-config)"); + + cmd.addGroup("processing options:"); + cmd.addOption("--config", "-c", 1, "[f]ilename: string", + "process using settings from configuration file"); + cmd.addOption("--printer", "-p", 1, "[n]ame: string (default: 1st printer in config file)", + "select printer with identifier n from config file"); + cmd.addOption("--dump", "+d", "dump all DIMSE messages"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_OPENSSL) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef WITH_OPENSSL + COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl; +#endif + return 0; + } + } + + /* options */ + if (cmd.findOption("--dump")) + { + // Messages to the "dump" logger are always written with the debug log + // level, thus enabling that logger for this level shows the dumps + dcmtk::log4cplus::Logger log = dcmtk::log4cplus::Logger::getInstance("dcmtk.dcmpstat.dump"); + log.setLogLevel(OFLogger::DEBUG_LOG_LEVEL); + } + + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--logfile")) + { + app.checkConflict("--logfile", "--log-config", cmd.findOption("--log-config")); + opt_logFile = OFTrue; + } + if (cmd.findOption("--config")) app.checkValue(cmd.getValue(opt_cfgName)); + if (cmd.findOption("--printer")) app.checkValue(cmd.getValue(opt_printer)); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmprscpLogger, rcsid << OFendl); + + if (opt_cfgName) + { + FILE *cfgfile = fopen(opt_cfgName, "rb"); + if (cfgfile) fclose(cfgfile); else + { + OFLOG_FATAL(dcmprscpLogger, "can't open configuration file '" << opt_cfgName << "'"); + return 10; + } + } else { + OFLOG_FATAL(dcmprscpLogger, "no configuration file specified"); + return 10; + } + + DVInterface dvi(opt_cfgName); + + if (opt_printer) + { + if (DVPSE_printLocal != dvi.getTargetType(opt_printer)) + { + OFLOG_FATAL(dcmprscpLogger, "no print scp definition for '" << opt_printer << "' found in config file"); + return 10; + } + } else { + opt_printer = dvi.getTargetID(0, DVPSE_printLocal); // use default print scp + if (opt_printer==NULL) + { + OFLOG_FATAL(dcmprscpLogger, "no default print scp available - no config file?"); + return 10; + } + } + + opt_binaryLog = dvi.getBinaryLog(); + + OFString logfileprefix; + OFString aString; + unsigned long logcounter = 0; + char logcounterbuf[20]; + + logfileprefix = dvi.getSpoolFolder(); + + logfileprefix += PATH_SEPARATOR; + logfileprefix += "PrintSCP_"; + logfileprefix += opt_printer; + logfileprefix += "_"; + DVPSHelper::currentDate(aString); + logfileprefix += aString; + logfileprefix += "_"; + DVPSHelper::currentTime(aString); + logfileprefix += aString; + + if (opt_logFile) + { + const char *pattern = "%m%n"; + OFString logfilename = logfileprefix; + logfilename += ".log"; + + OFunique_ptr layout(new dcmtk::log4cplus::PatternLayout(pattern)); + dcmtk::log4cplus::SharedAppenderPtr logfile(new dcmtk::log4cplus::FileAppender(logfilename)); + dcmtk::log4cplus::Logger log = dcmtk::log4cplus::Logger::getRoot(); + + logfile->setLayout(OFmove(layout)); + log.removeAllAppenders(); + log.addAppender(logfile); + } + + OFLOG_WARN(dcmprscpLogger, rcsid << OFendl << OFDateTime::getCurrentDateTime() << OFendl << "started"); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + OFLOG_WARN(dcmprscpLogger, "no data dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + + /* check if we can get access to the database */ + const char *dbfolder = dvi.getDatabaseFolder(); + OFLOG_INFO(dcmprscpLogger, "Using database in directory '" << dbfolder << "'"); + + OFCondition cond2 = EC_Normal; + DcmQueryRetrieveIndexDatabaseHandle *dbhandle = new DcmQueryRetrieveIndexDatabaseHandle(dbfolder, PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, cond2); + delete dbhandle; + + if (cond2.bad()) + { + OFLOG_FATAL(dcmprscpLogger, "Unable to access database '" << dbfolder << "'"); + return 10; + } + + /* get print scp data from configuration file */ + unsigned short targetPort = dvi.getTargetPort(opt_printer); + OFBool targetDisableNewVRs = dvi.getTargetDisableNewVRs(opt_printer); + OFBool targetUseTLS = dvi.getTargetUseTLS(opt_printer); + + if (targetPort == 0) + { + OFLOG_FATAL(dcmprscpLogger, "no or invalid port number for print scp '" << opt_printer << "'"); + return 10; + } + + if (targetDisableNewVRs) + { + dcmDisableGenerationOfNewVRs(); + } + + T_ASC_Network *net = NULL; /* the DICOM network and listen port */ + OFBool finished = OFFalse; + int connected = 0; + +#ifdef WITH_OPENSSL + /* TLS directory */ + const char *current = NULL; + const char *tlsFolder = dvi.getTLSFolder(); + if (tlsFolder==NULL) tlsFolder = "."; + + /* certificate file */ + OFString tlsCertificateFile(tlsFolder); + tlsCertificateFile += PATH_SEPARATOR; + current = dvi.getTargetCertificate(opt_printer); + if (current) tlsCertificateFile += current; else tlsCertificateFile += "sitecert.pem"; + + /* private key file */ + OFString tlsPrivateKeyFile(tlsFolder); + tlsPrivateKeyFile += PATH_SEPARATOR; + current = dvi.getTargetPrivateKey(opt_printer); + if (current) tlsPrivateKeyFile += current; else tlsPrivateKeyFile += "sitekey.pem"; + + /* private key password */ + const char *tlsPrivateKeyPassword = dvi.getTargetPrivateKeyPassword(opt_printer); + + /* certificate verification */ + DcmCertificateVerification tlsCertVerification = DCV_requireCertificate; + switch (dvi.getTargetPeerAuthentication(opt_printer)) + { + case DVPSQ_require: + tlsCertVerification = DCV_requireCertificate; + break; + case DVPSQ_verify: + tlsCertVerification = DCV_checkCertificate; + break; + case DVPSQ_ignore: + tlsCertVerification = DCV_ignoreCertificate; + break; + } + + /* DH parameter file */ + OFString tlsDHParametersFile; + current = dvi.getTargetDiffieHellmanParameters(opt_printer); + if (current) + { + tlsDHParametersFile = tlsFolder; + tlsDHParametersFile += PATH_SEPARATOR; + tlsDHParametersFile += current; + } + + /* random seed file */ + OFString tlsRandomSeedFile(tlsFolder); + tlsRandomSeedFile += PATH_SEPARATOR; + current = dvi.getTargetRandomSeed(opt_printer); + if (current) tlsRandomSeedFile += current; else tlsRandomSeedFile += "siteseed.bin"; + + /* CA certificate directory */ + const char *tlsCACertificateFolder = dvi.getTLSCACertificateFolder(); + if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = "."; + + /* key file format */ + DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM; + if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1; + + DcmTLSTransportLayer *tLayer = NULL; + if (targetUseTLS) + { + tLayer = new DcmTLSTransportLayer(NET_ACCEPTOR, tlsRandomSeedFile.c_str(), OFFalse); + if (tLayer == NULL) + { + OFLOG_FATAL(dcmprscpLogger, "unable to create TLS transport layer"); + return 1; + } + + // determine TLS profile + OFString profileName; + const char *profileNamePtr = dvi.getTargetTLSProfile(opt_printer); + if (profileNamePtr) profileName = profileNamePtr; + DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195; // default + if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195; + else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND; + else if (profileName == "BCP195-EX") tlsProfile = TSP_Profile_BCP195_Extended; + else if (profileName == "AES") tlsProfile = TSP_Profile_AES; + else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic; + else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted; + else + { + OFLOG_WARN(dcmprscpLogger, "unknown TLS profile '" << profileName << "', ignoring"); + } + + if (TCS_ok != tLayer->setTLSProfile(tlsProfile)) + { + OFLOG_FATAL(dcmprscpLogger, "unable to select the TLS security profile"); + return 1; + } + + // activate cipher suites + if (TCS_ok != tLayer->activateCipherSuites()) + { + OFLOG_FATAL(dcmprscpLogger, "unable to activate the selected list of TLS ciphersuites"); + return 1; + } + + if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat))) + { + OFLOG_WARN(dcmprscpLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring"); + } + if ((tlsDHParametersFile.size() > 0) && ! (tLayer->setTempDHParameters(tlsDHParametersFile.c_str()))) + { + OFLOG_WARN(dcmprscpLogger, "unable to load temporary DH parameter file '" << tlsDHParametersFile << "', ignoring"); + } + tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console + + if (TCS_ok != tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmprscpLogger, "unable to load private TLS key from '" << tlsPrivateKeyFile<< "'"); + return 1; + } + if (TCS_ok != tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmprscpLogger, "unable to load certificate from '" << tlsCertificateFile << "'"); + return 1; + } + if (! tLayer->checkPrivateKeyMatchesCertificate()) + { + OFLOG_FATAL(dcmprscpLogger, "private key '" << tlsPrivateKeyFile << "' and certificate '" << tlsCertificateFile << "' do not match"); + return 1; + } + tLayer->setCertificateVerification(tlsCertVerification); + + } +#else + if (targetUseTLS) + { + OFLOG_FATAL(dcmprscpLogger, "not compiled with OpenSSL, cannot use TLS"); + return 10; + } +#endif + + /* open listen socket */ + OFCondition cond = ASC_initializeNetwork(NET_ACCEPTOR, targetPort, 30, &net); + if (cond.bad()) + { + OFString temp_str; + OFLOG_FATAL(dcmprscpLogger, "cannot initialise network:\n" << DimseCondition::dump(temp_str, cond)); + return 1; + } + +#ifdef WITH_OPENSSL + if (tLayer) + { + cond = ASC_setTransportLayer(net, tLayer, 0); + if (cond.bad()) + { + OFString temp_str; + OFLOG_FATAL(dcmprscpLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + } +#endif + + /* drop root privileges now and revert to the calling user id (if we are running as setuid root) */ + if (OFStandard::dropPrivileges().bad()) + { + OFLOG_FATAL(dcmprscpLogger, "setuid() failed, maximum number of processes/threads for uid already running."); + return 1; + } + +#ifdef HAVE_FORK + int timeout=1; +#else + int timeout=1000; +#endif + + while (!finished) + { + DVPSPrintSCP printSCP(dvi, opt_printer); // use new print SCP object for each association + + if (opt_binaryLog) + { + aString = logfileprefix; + aString += "_"; + sprintf(logcounterbuf, "%04ld", ++logcounter); + aString += logcounterbuf; + aString += ".dcm"; + printSCP.setDimseLogPath(aString.c_str()); + } + + connected = 0; + while (!connected) + { + connected = ASC_associationWaiting(net, timeout); + if (!connected) cleanChildren(); + } + switch (printSCP.negotiateAssociation(*net)) + { + case DVPSJ_error: + // association has already been deleted, we just wait for the next client to connect. + break; + case DVPSJ_terminate: + finished=OFTrue; + cond = ASC_dropNetwork(&net); + if (cond.bad()) + { + OFString temp_str; + OFLOG_FATAL(dcmprscpLogger, "cannot drop network:\n" << DimseCondition::dump(temp_str, cond)); + return 10; + } + break; + case DVPSJ_success: + printSCP.handleClient(); + break; + } + } // finished + cleanChildren(); + + OFStandard::shutdownNetwork(); + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + +#ifdef WITH_OPENSSL + if (tLayer) + { + if (tLayer->canWriteRandomSeed()) + { + if (!tLayer->writeRandomSeed(tlsRandomSeedFile.c_str())) + { + OFLOG_ERROR(dcmprscpLogger, "cannot write back random seed file '" << tlsRandomSeedFile << "', ignoring"); + } + } else { + OFLOG_WARN(dcmprscpLogger, "cannot write back random seed, ignoring"); + } + } + delete tLayer; +#endif + + return 0; +} diff --git a/dcmpstat/apps/dcmprscu.cc b/dcmpstat/apps/dcmprscu.cc new file mode 100644 index 00000000..399af7ae --- /dev/null +++ b/dcmpstat/apps/dcmprscu.cc @@ -0,0 +1,1133 @@ +/* + * Copyright (C) 1999-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmprscu + * + * Authors: Andreas Thiel, Marco Eichelberg + * + * Purpose: Presentation State Viewer - Print Spooler + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmnet/dcompat.h" /* compatibility code, needs to be included before dirent.h */ + +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +/* This #if code is suggested by the gnu autoconf documentation */ +#ifdef HAVE_DIRENT_H +#include +#define NAMLEN(dirent) strlen((dirent)->d_name) +#else +#define dirent direct +#define NAMELEN(dirent) (dirent)->d_namlen +#ifdef HAVE_SYS_NDIR_H +#include +#endif +#ifdef HAVE_SYS_DIR_H +#include +#endif +#ifdef HAVE_NDIR_H +#include +#endif +#endif +#ifdef HAVE_IO_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include /* for O_RDONLY */ +#endif +END_EXTERN_C + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants */ +#include "dcmtk/dcmpstat/dviface.h" /* for DVInterface */ +#include "dcmtk/ofstd/ofstring.h" /* for OFString */ +#include "dcmtk/ofstd/ofbmanip.h" /* for OFBitmanipTemplate */ +#include "dcmtk/ofstd/ofdatime.h" /* for OFDateTime */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/dcmimgle/dcmimage.h" +#include "dcmtk/dcmpstat/dvpspr.h" +#include "dcmtk/dcmpstat/dvpssp.h" +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ +#include "dcmtk/ofstd/ofstd.h" + +#ifdef WITH_OPENSSL +#include "dcmtk/dcmtls/tlstrans.h" +#include "dcmtk/dcmtls/tlslayer.h" +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmprscu" + +static OFLogger dcmprscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* command line options */ +static OFBool opt_spoolMode = OFFalse; /* default: file print mode */ +static OFBool opt_noPrint = OFFalse; +static OFBool opt_sessionPrint = OFFalse; /* Basic Film Session N-ACTION? */ +static OFBool opt_Monochrome1 = OFFalse; /* send images in MONOCHROME 1? */ +static const char * opt_cfgName = NULL; /* config file name */ +static const char * opt_printer = NULL; /* printer name */ + +static const char * opt_mediumtype = NULL; +static const char * opt_destination = NULL; +static const char * opt_sessionlabel = NULL; +static const char * opt_priority = NULL; +static const char * opt_ownerID = NULL; +static const char * opt_spoolPrefix = NULL; +static OFCmdUnsignedInt opt_sleep = (OFCmdUnsignedInt) 1; +static OFCmdUnsignedInt opt_copies = (OFCmdUnsignedInt) 0; + +/* print target data, taken from configuration file */ +static const char * targetHostname = NULL; +static const char * targetDescription = NULL; +static const char * targetAETitle = NULL; +static unsigned short targetPort = 104; +static unsigned long targetMaxPDU = ASC_DEFAULTMAXPDU; +static OFBool targetImplicitOnly = OFFalse; +static OFBool targetDisableNewVRs = OFFalse; +static OFBool targetSupportsPLUT = OFTrue; +static OFBool targetSupportsAnnotation = OFTrue; +static OFBool targetSupports12bit = OFTrue; +static OFBool targetPLUTinFilmSession = OFFalse; +static OFBool targetRequiresMatchingLUT = OFTrue; +static OFBool targetPreferSCPLUTRendering = OFFalse; +static OFBool deletePrintJobs = OFFalse; +static OFBool deleteTerminateJobs = OFFalse; +static OFBool useTLS = OFFalse; + +/* helper class printJob */ + +class printJob +{ +public: + printJob(); + printJob(const printJob& copy); + ~printJob() { } + + OFString studyUID; + OFString seriesUID; + OFString instanceUID; + OFString storedPrintFilename; + OFString mediumType; + OFString filmDestination; + OFString filmSessionLabel; + OFString printPriority; + OFString ownerID; + +#ifdef ALLOW_ILLUMINATION_OVERRIDE + unsigned long illumination; + unsigned long reflectedAmbientLight; +#endif + + unsigned long numberOfCopies; +private: + /* undefined */ printJob& operator=(const printJob& copy); +}; + +printJob::printJob() +: studyUID() +, seriesUID() +, instanceUID() +, storedPrintFilename() +, mediumType() +, filmDestination() +, filmSessionLabel() +, printPriority() +, ownerID() +#ifdef ALLOW_ILLUMINATION_OVERRIDE +, illumination((unsigned long)-1) +, reflectedAmbientLight((unsigned long)-1) +#endif +, numberOfCopies(0) +{ +} + +printJob::printJob(const printJob& copy) +: studyUID(copy.studyUID) +, seriesUID(copy.seriesUID) +, instanceUID(copy.instanceUID) +, storedPrintFilename(copy.storedPrintFilename) +, mediumType(copy.mediumType) +, filmDestination(copy.filmDestination) +, filmSessionLabel(copy.filmSessionLabel) +, printPriority(copy.printPriority) +, ownerID(copy.ownerID) +#ifdef ALLOW_ILLUMINATION_OVERRIDE +, illumination(copy.illumination) +, reflectedAmbientLight(copy.reflectedAmbientLight) +#endif +, numberOfCopies(copy.numberOfCopies) +{ +} + +/* static helper functions */ + +static OFCondition spoolStoredPrintFile( + const char *filename, + DVInterface &dvi, + DcmTransportLayer *tlayer) +{ + DcmFileFormat *ffile = NULL; + DcmDataset *dset = NULL; + + if (opt_spoolMode) + { + OFLOG_WARN(dcmprscuLogger, OFDateTime::getCurrentDateTime() << OFendl << "processing " << filename); + } + + if (filename==NULL) return EC_IllegalCall; + OFCondition result = DVPSHelper::loadFileFormat(filename, ffile); + if (EC_Normal != result) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: unable to load file '" << filename << "'"); + } + if (ffile) dset = ffile->getDataset(); + + DVPSStoredPrint& stprint = dvi.getPrintHandler(); + + if (EC_Normal == result) + { + if (dset) result = stprint.read(*dset); else result = EC_IllegalCall; + } + if (EC_Normal != result) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: file '" << filename << "' is not a valid Stored Print object"); + } + delete ffile; + + if (EC_Normal == result) + { + // we have successfully read the Stored Print, now open connection to printer + DVPSPrintMessageHandler printHandler; + + result = printHandler.negotiateAssociation( + tlayer, dvi.getNetworkAETitle(), + targetAETitle, targetHostname, targetPort, targetMaxPDU, + targetSupportsPLUT, targetSupportsAnnotation, targetImplicitOnly); + + if (result.bad()) + { + OFString temp_str; + OFLOG_ERROR(dcmprscuLogger, "spooler: connection setup with printer failed\n" << DimseCondition::dump(temp_str, result)); + } else { + if (EC_Normal != (result = stprint.printSCUgetPrinterInstance(printHandler))) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: printer communication failed, unable to request printer settings"); + } + if (EC_Normal==result) if (EC_Normal != (result = stprint.printSCUpreparePresentationLUT( + printHandler, targetRequiresMatchingLUT, targetPreferSCPLUTRendering, targetSupports12bit))) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: printer communication failed, unable to create presentation LUT"); + } + if (EC_Normal==result) if (EC_Normal != (result = dvi.printSCUcreateBasicFilmSession(printHandler, targetPLUTinFilmSession))) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: printer communication failed, unable to create basic film session"); + } + if (EC_Normal==result) if (EC_Normal != (result = stprint.printSCUcreateBasicFilmBox(printHandler, targetPLUTinFilmSession))) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: printer communication failed, unable to create basic film box"); + } + // Process images + size_t numberOfImages = stprint.getNumberOfImages(); + const char *studyUID = NULL; + const char *seriesUID = NULL; + const char *instanceUID = NULL; + const char *imagefile = NULL; + OFString theFilename; + DicomImage *dcmimage = NULL; + for (size_t currentImage=0; currentImage 0) + { + dcmimage = new DicomImage(theFilename.c_str()); + if (dcmimage && (EIS_Normal == dcmimage->getStatus())) + { + // N-SET basic image box + if (EC_Normal != (result = stprint.printSCUsetBasicImageBox(printHandler, currentImage, *dcmimage, opt_Monochrome1))) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: printer communication failed, unable to transmit basic grayscale image box"); + } + } else { + result = EC_IllegalCall; + OFLOG_ERROR(dcmprscuLogger, "spooler: unable to load image file '" << theFilename.c_str() << "'"); + } + delete dcmimage; + } else { + result = EC_IllegalCall; + OFLOG_ERROR(dcmprscuLogger, "spooler: unable to locate image file in database"); + } + } else result = EC_IllegalCall; + } + + size_t numberOfAnnotations = stprint.getNumberOfAnnotations(); + for (size_t currentAnnotation=0; currentAnnotation&jobList, + DVInterface &dvi, + DcmTransportLayer *tlayer) +{ + OFCondition result = EC_Normal; + OFCondition result2 = EC_Normal; + OFListIterator(printJob *) first = jobList.begin(); + OFListIterator(printJob *) last = jobList.end(); + printJob *currentJob = NULL; + while (first != last) + { + currentJob = *first; + first = jobList.erase(first); + if (currentJob->storedPrintFilename.size() == 0) + { + const char *spfile = dvi.getFilename(currentJob->studyUID.c_str(), currentJob->seriesUID.c_str(), currentJob->instanceUID.c_str()); + if (spfile) currentJob->storedPrintFilename = spfile; + dvi.releaseDatabase(); // destroys the string spfile points to + } + if (currentJob->storedPrintFilename.size() > 0) + { + // initialize film session settings + dvi.clearFilmSessionSettings(); + if (currentJob->mediumType.size() > 0) dvi.setPrinterMediumType(currentJob->mediumType.c_str()); + if (currentJob->filmDestination.size() > 0) dvi.setPrinterFilmDestination(currentJob->filmDestination.c_str()); + if (currentJob->filmSessionLabel.size() > 0) dvi.setPrinterFilmSessionLabel(currentJob->filmSessionLabel.c_str()); + if (currentJob->printPriority.size() > 0) dvi.setPrinterPriority(currentJob->printPriority.c_str()); + if (currentJob->ownerID.size() > 0) dvi.setPrinterOwnerID(currentJob->ownerID.c_str()); + if (currentJob->numberOfCopies > 0) dvi.setPrinterNumberOfCopies(currentJob->numberOfCopies); +#ifdef ALLOW_ILLUMINATION_OVERRIDE + if (currentJob->illumination != (unsigned long)-1) dvi.setPrintIllumination((Uint16)(currentJob->illumination)); + if (currentJob->reflectedAmbientLight != (unsigned long)-1) dvi.setPrintReflectedAmbientLight((Uint16)(currentJob->reflectedAmbientLight)); +#endif + result2 = spoolStoredPrintFile(currentJob->storedPrintFilename.c_str(), dvi, tlayer); + if (result2 != EC_Normal) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: error occurred during spooling of Stored Print object '" << currentJob->storedPrintFilename << "'"); + } + if (result == EC_Normal) result = result2; // forward error codes, but do not erase + } else { + OFLOG_ERROR(dcmprscuLogger, "spooler: unable to find Stored Print object for print job in database"); + result = EC_IllegalCall; + } + delete currentJob; + } + return result; +} + +/* reads a single line of text from an open input file. + * the line must have the structure + * Trailing whitespace is not removed. + */ +static OFBool readValuePair(FILE *infile, OFString& key, OFString& value) +{ + int c; + int mode = 0; + key.clear(); + value.clear(); + key.reserve(32); // should be sufficient for most cases. + value.reserve(256); + OFBool finished = OFFalse; + while (!finished) + { + c = fgetc(infile); + if ((c==EOF)||(c==13)||(c==10)) finished = OFTrue; + else if (isspace(c)) + { + if (mode==1) mode=2; + else if (mode==3) value += (char)c; + } else { + if (mode < 2) + { + mode=1; + key += (char)c; + } + else + { + mode=3; + value += (char)c; + } + } + } + if (c==EOF) return OFTrue; else return OFFalse; +} + +/* reads a complete "print job" file. + * The file must either contain a complete UID specification (study/series/instance) + * or it must contain the keyword "terminate" in which case everything else is ignored. + * depending on the "deletePrintJob" flag, the job file is renamed to "outfile" + * after reading or deleted. If renaming fails, the file is also deleted. + */ +static OFCondition readJobFile( + const char *infile, + const char *outfile, + printJob& job, + OFBool& terminateFlag) +{ + if (infile==NULL) return EC_IllegalCall; + FILE *inf = fopen(infile, "rb"); + if (inf==NULL) return EC_IllegalCall; + OFString key, value; + OFBool eofFound = OFFalse; + OFBool thisIsTerminate = OFFalse; + OFCondition result = EC_Normal; + while (!eofFound) + { + thisIsTerminate = OFFalse; + eofFound = readValuePair(inf, key, value); + if ((key.size()==0)||(key[0] == '#')) { /* ignore comments and empty lines */ } + else if (key == "copies") + { + if (1 != sscanf(value.c_str(),"%lu", &job.numberOfCopies)) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: parse error for 'copies' in job file '" << infile << "'"); + result = EC_IllegalCall; + } + } +#ifdef ALLOW_ILLUMINATION_OVERRIDE + else if (key == "illumination") + { + if (1 != sscanf(value.c_str(),"%lu", &job.illumination)) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: parse error for 'illumination' in job file '" << infile << "'"); + result = EC_IllegalCall; + } + } + else if (key == "reflection") + { + if (1 != sscanf(value.c_str(),"%lu", &job.reflectedAmbientLight)) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: parse error for 'reflection' in job file '" << infile << "'"); + result = EC_IllegalCall; + } + } +#endif + else if (key == "mediumtype") job.mediumType = value; + else if (key == "destination") job.filmDestination = value; + else if (key == "label") job.filmSessionLabel = value; + else if (key == "priority") job.printPriority = value; + else if (key == "owner_id") job.ownerID = value; + else if (key == "study") job.studyUID = value; + else if (key == "series") job.seriesUID = value; + else if (key == "instance") job.instanceUID = value; + else if (key == "terminate") + { + terminateFlag=OFTrue; + thisIsTerminate = OFTrue; + } + else + { + OFLOG_ERROR(dcmprscuLogger, "spooler: unknown keyword '" << key.c_str() << "' in job file '" << infile << "'"); + result = EC_IllegalCall; + } + } + fclose(inf); + + if (deletePrintJobs || (deleteTerminateJobs && thisIsTerminate)) + { + if (0 != unlink(infile)) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: unable to delete job file '" << infile << "'"); + result = EC_IllegalCall; + } + } else { + if ((outfile==NULL)||(0 != rename(infile, outfile))) + { + // if we can't rename, we delete to make sure we don't read the same file again next time. + if (0 != unlink(infile)) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: unable to delete job file '" << infile << "'"); + result = EC_IllegalCall; + } + } + } + + // make sure that either all mandatory parameters are set or "terminate" is defined. + if ((EC_Normal==result)&&(! terminateFlag)&&((job.studyUID.size()==0)||(job.seriesUID.size()==0)||(job.instanceUID.size()==0))) + { + OFLOG_ERROR(dcmprscuLogger, "spooler: UIDs missing in job file '" << infile << "'"); + result = EC_IllegalCall; + } + return result; +} + +/* browses the spool directory for new print job files and reads/renames all of them. + * The results are stored in the jobList but not processed (spooled). This avoids + * the possibility of life-lock situations. + * + * Uses opendir() on Unix, FindFirstFile()/FindNextFile() on Win32 platforms + */ +static OFCondition updateJobList( + OFList&jobList, + DVInterface &dvi, + OFBool& terminateFlag, + const char *filenamePrefix) +{ + if (filenamePrefix==NULL) return EC_IllegalCall; + OFString prefix = filenamePrefix; + OFString postfix = PRINTJOB_SUFFIX; + size_t prefixSize = prefix.size(); + size_t postfixSize = postfix.size(); + OFString currentName; + OFString jobName; + OFString renameName; + printJob *currentJob = NULL; + OFBool currentTerminate = OFFalse; + OFCondition result = EC_Normal; + const char *spoolFolder = dvi.getSpoolFolder(); + +#ifdef HAVE_WINDOWS_H + WIN32_FIND_DATA stWin32FindData; + OFString currentdir = spoolFolder; + currentdir += "\\*"; + + HANDLE hFile = FindFirstFile(currentdir.c_str(), &stWin32FindData); + int ret = (hFile != INVALID_HANDLE_VALUE); + while (ret) + { + currentName = stWin32FindData.cFileName; +#else + DIR *dirp = NULL; + struct dirent *dp = NULL; + if ((dirp = opendir(spoolFolder)) != NULL) + { + for (dp=readdir(dirp);((result == EC_Normal)&&(dp != NULL)); dp=readdir(dirp)) + { + currentName = dp->d_name; +#endif + if + ( + currentName.size() > (prefixSize + postfixSize) && + prefix == currentName.substr(0, prefixSize) && + postfix == currentName.substr(currentName.size()-postfixSize) && + currentName.find_first_not_of("1234567890",prefixSize) == (currentName.size() - postfixSize) + ) + { + // name matches pattern + jobName = spoolFolder; + jobName += PATH_SEPARATOR; + jobName += currentName; + renameName = jobName; + renameName += PRINTJOB_DONE_SUFFIX; + currentJob = new printJob(); + if (currentJob) + { + currentTerminate = OFFalse; + result = readJobFile(jobName.c_str(), renameName.c_str(), *currentJob, currentTerminate); + if (currentTerminate) terminateFlag = OFTrue; + if (EC_Normal == result) + { + // don't schedule "terminate" job + if (!currentTerminate) jobList.push_back(currentJob); else delete currentJob; + } + else + { + delete currentJob; + OFLOG_ERROR(dcmprscuLogger, "spooler: parsing of job file '" << jobName.c_str() << "' failed"); + } + } else result = EC_MemoryExhausted; + } + +#ifdef HAVE_WINDOWS_H + ret = FindNextFile(hFile, &stWin32FindData); + } /* while */ + if(hFile != INVALID_HANDLE_VALUE) + { + FindClose(hFile); +#else + } /* for */ + closedir(dirp); +#endif + } else { + OFLOG_ERROR(dcmprscuLogger, "unable to read spool directory '" << spoolFolder << "'"); + result = EC_IllegalCall; + } + return result; +} + +#define SHORTCOL 3 +#define LONGCOL 15 + +int main(int argc, char *argv[]) +{ + OFStandard::initializeNetwork(); +#ifdef WITH_OPENSSL + DcmTLSTransportLayer::initializeOpenSSL(); +#endif + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Print spooler for presentation state viewer", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 2); + + cmd.addParam("dcmfile-in", "stored print file(s) to be spooled", OFCmdParam::PM_MultiOptional); + + cmd.addGroup("general options:"); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addGroup("print options:"); + cmd.addOption("--noprint", "do not create print-out (no n-action-rq)"); + cmd.addOption("--session-print", "send film session n-action-rq (instead of film box)"); + cmd.addOption("--monochrome1", "transmit basic grayscale images in MONOCHROME1"); + cmd.addGroup("mode options:"); + cmd.addOption("--print", "+p", "printer mode, print file(s) and terminate (default)"); + cmd.addOption("--spool", "+s", 1, "[n]ame: string", + "spooler mode, use job prefix n"); + cmd.addGroup("processing options:"); + cmd.addOption("--config", "-c", 1, "[f]ilename: string", + "process using settings from configuration file"); + cmd.addOption("--printer", "-p", 1, "[n]ame: string (default: 1st printer in cfg file)", + "select printer with identifier n from cfg file"); + cmd.addOption("--dump", "+d", "dump all DIMSE messages"); + cmd.addGroup("spooler options (only with --spool):"); + cmd.addOption("--sleep", 1, "[d]elay: integer (default: 1)", + "sleep d seconds between spooler checks"); + cmd.addGroup("basic film session options (not with --spool):"); + cmd.addOption("--copies", 1, "[v]alue: integer (1..100, default: 1)", + "set number of copies to v"); + cmd.addOption("--medium-type", 1, "[v]alue: string", + "set medium type to v"); + cmd.addOption("--destination", 1, "[v]alue: string", + "set film destination to v"); + cmd.addOption("--label", 1, "[v]alue: string", + "set film session label to v"); + cmd.addOption("--priority", 1, "[v]alue: string", + "set print priority to v"); + cmd.addOption("--owner", 1, "[v]alue: string", + "set film session owner ID to v"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_OPENSSL) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef WITH_OPENSSL + COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl; +#endif + return 0; + } + } + + /* options */ + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--noprint")) opt_noPrint = OFTrue; + if (cmd.findOption("--session-print")) opt_sessionPrint = OFTrue; + if (cmd.findOption("--monochrome1")) opt_Monochrome1 = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--print")) opt_spoolMode = OFFalse; + if (cmd.findOption("--spool")) + { + opt_spoolMode=OFTrue; + app.checkValue(cmd.getValue(opt_spoolPrefix)); + } + cmd.endOptionBlock(); + + if (cmd.findOption("--config")) app.checkValue(cmd.getValue(opt_cfgName)); + if (cmd.findOption("--printer")) app.checkValue(cmd.getValue(opt_printer)); + if (cmd.findOption("--dump")) + { + // Messages to the "dump" logger are always written with the debug log + // level, thus enabling that logger for this level shows the dumps + dcmtk::log4cplus::Logger log = dcmtk::log4cplus::Logger::getInstance("dcmtk.dcmpstat.dump"); + log.setLogLevel(OFLogger::DEBUG_LOG_LEVEL); + } + + if (cmd.findOption("--medium-type")) + { + app.checkConflict("--medium-type", "--spool", opt_spoolMode); + app.checkValue(cmd.getValue(opt_mediumtype)); + } + + if (cmd.findOption("--destination")) + { + app.checkConflict("--destination", "--spool", opt_spoolMode); + app.checkValue(cmd.getValue(opt_destination)); + } + if (cmd.findOption("--label")) + { + app.checkConflict("--label", "--spool", opt_spoolMode); + app.checkValue(cmd.getValue(opt_sessionlabel)); + } + if (cmd.findOption("--priority")) + { + app.checkConflict("--priority", "--spool", opt_spoolMode); + app.checkValue(cmd.getValue(opt_priority)); + } + if (cmd.findOption("--owner")) + { + app.checkConflict("--owner", "--spool", opt_spoolMode); + app.checkValue(cmd.getValue(opt_ownerID)); + } + if (cmd.findOption("--copies")) + { + app.checkConflict("--copies", "--spool", opt_spoolMode); + app.checkValue(cmd.getValueAndCheckMinMax(opt_copies, 1, 100)); + } + if (cmd.findOption("--sleep")) + { + app.checkConflict("--sleep", "--print", (! opt_spoolMode)); + app.checkValue(cmd.getValue(opt_sleep)); + } + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmprscuLogger, rcsid << OFendl); + + if (opt_cfgName) + { + FILE *cfgfile = fopen(opt_cfgName, "rb"); + if (cfgfile) fclose(cfgfile); else + { + OFLOG_FATAL(dcmprscuLogger, "can't open configuration file '" << opt_cfgName << "'"); + return 10; + } + } else { + OFLOG_FATAL(dcmprscuLogger, "no configuration file specified"); + return 10; + } + + DVInterface dvi(opt_cfgName); + if (opt_printer) + { + if (EC_Normal != dvi.setCurrentPrinter(opt_printer)) + { + OFLOG_FATAL(dcmprscuLogger, "unable to select printer '" << opt_printer << "'"); + return 10; + } + } else { + opt_printer = dvi.getCurrentPrinter(); // use default printer + if (opt_printer==NULL) + { + OFLOG_FATAL(dcmprscuLogger, "no default printer available - no config file?"); + return 10; + } + } + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + OFLOG_WARN(dcmprscuLogger, "no data dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + + /* get print target from configuration file */ + targetHostname = dvi.getTargetHostname(opt_printer); + targetDescription = dvi.getTargetDescription(opt_printer); + targetAETitle = dvi.getTargetAETitle(opt_printer); + targetPort = dvi.getTargetPort(opt_printer); + targetMaxPDU = dvi.getTargetMaxPDU(opt_printer); + targetImplicitOnly = dvi.getTargetImplicitOnly(opt_printer); + targetDisableNewVRs = dvi.getTargetDisableNewVRs(opt_printer); + targetSupportsPLUT = dvi.getTargetPrinterSupportsPresentationLUT(opt_printer); + targetSupportsAnnotation = dvi.getTargetPrinterSupportsAnnotationBoxSOPClass(opt_printer); + targetSupports12bit = dvi.getTargetPrinterSupports12BitTransmission(opt_printer); + targetPLUTinFilmSession = dvi.getTargetPrinterPresentationLUTinFilmSession(opt_printer); + targetRequiresMatchingLUT = dvi.getTargetPrinterPresentationLUTMatchRequired(opt_printer); + targetPreferSCPLUTRendering = dvi.getTargetPrinterPresentationLUTPreferSCPRendering(opt_printer); + deletePrintJobs = dvi.getSpoolerDeletePrintJobs(); + deleteTerminateJobs = dvi.getSpoolerAlwaysDeleteTerminateJobs(); + useTLS = dvi.getTargetUseTLS(opt_printer); + + Sint32 timeout = dvi.getTargetTimeout(opt_printer); + if (timeout > 0) dcmConnectionTimeout.set(timeout); + +#ifdef WITH_OPENSSL + /* TLS directory */ + const char *current = NULL; + const char *tlsFolder = dvi.getTLSFolder(); + if (tlsFolder==NULL) tlsFolder = "."; + + /* certificate file */ + OFString tlsCertificateFile(tlsFolder); + tlsCertificateFile += PATH_SEPARATOR; + current = dvi.getTargetCertificate(opt_printer); + if (current) tlsCertificateFile += current; else tlsCertificateFile.clear(); + + /* private key file */ + OFString tlsPrivateKeyFile(tlsFolder); + tlsPrivateKeyFile += PATH_SEPARATOR; + current = dvi.getTargetPrivateKey(opt_printer); + if (current) tlsPrivateKeyFile += current; else tlsPrivateKeyFile.clear(); + + /* private key password */ + const char *tlsPrivateKeyPassword = dvi.getTargetPrivateKeyPassword(opt_printer); + + /* certificate verification */ + DcmCertificateVerification tlsCertVerification = DCV_requireCertificate; + switch (dvi.getTargetPeerAuthentication(opt_printer)) + { + case DVPSQ_require: + tlsCertVerification = DCV_requireCertificate; + break; + case DVPSQ_verify: + tlsCertVerification = DCV_checkCertificate; + break; + case DVPSQ_ignore: + tlsCertVerification = DCV_ignoreCertificate; + break; + } + + /* DH parameter file */ + OFString tlsDHParametersFile; + current = dvi.getTargetDiffieHellmanParameters(opt_printer); + if (current) + { + tlsDHParametersFile = tlsFolder; + tlsDHParametersFile += PATH_SEPARATOR; + tlsDHParametersFile += current; + } + + /* random seed file */ + OFString tlsRandomSeedFile(tlsFolder); + tlsRandomSeedFile += PATH_SEPARATOR; + current = dvi.getTargetRandomSeed(opt_printer); + if (current) tlsRandomSeedFile += current; else tlsRandomSeedFile += "siteseed.bin"; + + /* CA certificate directory */ + const char *tlsCACertificateFolder = dvi.getTLSCACertificateFolder(); + if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = "."; + + /* key file format */ + DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM; + if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1; + + DcmTLSTransportLayer *tLayer = NULL; + if (useTLS) + { + tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, tlsRandomSeedFile.c_str(), OFFalse); + if (tLayer == NULL) + { + OFLOG_FATAL(dcmprscuLogger, "unable to create TLS transport layer"); + return 1; + } + + // determine TLS profile + OFString profileName; + const char *profileNamePtr = dvi.getTargetTLSProfile(opt_printer); + if (profileNamePtr) profileName = profileNamePtr; + DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195; // default + if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195; + else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND; + else if (profileName == "BCP195-EX") tlsProfile = TSP_Profile_BCP195_Extended; + else if (profileName == "AES") tlsProfile = TSP_Profile_AES; + else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic; + else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted; + else + { + OFLOG_WARN(dcmprscuLogger, "unknown TLS profile '" << profileName << "', ignoring"); + } + + if (TCS_ok != tLayer->setTLSProfile(tlsProfile)) + { + OFLOG_FATAL(dcmprscuLogger, "unable to select the TLS security profile"); + return 1; + } + + // activate cipher suites + if (TCS_ok != tLayer->activateCipherSuites()) + { + OFLOG_FATAL(dcmprscuLogger, "unable to activate the selected list of TLS ciphersuites"); + return 1; + } + + if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat))) + { + OFLOG_WARN(dcmprscuLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring"); + } + if ((tlsDHParametersFile.size() > 0) && ! (tLayer->setTempDHParameters(tlsDHParametersFile.c_str()))) + { + OFLOG_WARN(dcmprscuLogger, "unable to load temporary DH parameter file '" << tlsDHParametersFile << "', ignoring"); + } + tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console + + if (!tlsPrivateKeyFile.empty() && !tlsCertificateFile.empty()) + { + if (TCS_ok != tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmprscuLogger, "unable to load private TLS key from '" << tlsPrivateKeyFile<< "'"); + return 1; + } + if (TCS_ok != tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmprscuLogger, "unable to load certificate from '" << tlsCertificateFile << "'"); + return 1; + } + if (! tLayer->checkPrivateKeyMatchesCertificate()) + { + OFLOG_FATAL(dcmprscuLogger, "private key '" << tlsPrivateKeyFile << "' and certificate '" << tlsCertificateFile << "' do not match"); + return 1; + } + } + + tLayer->setCertificateVerification(tlsCertVerification); + + // a generated UID contains the process ID and current time. + // Adding it to the PRNG seed guarantees that we have different seeds for different processes. + char randomUID[65]; + dcmGenerateUniqueIdentifier(randomUID); + tLayer->addPRNGseed(randomUID, strlen(randomUID)); + } + +#else + DcmTransportLayer *tLayer = NULL; + if (useTLS) + { + OFLOG_FATAL(dcmprscuLogger, "not compiled with OpenSSL, cannot use TLS"); + return 10; + } +#endif + + if (targetHostname == NULL) + { + OFLOG_FATAL(dcmprscuLogger, "no hostname for print target '" << opt_printer << "' - no config file?"); + return 10; + } + if (targetAETitle == NULL) + { + OFLOG_FATAL(dcmprscuLogger, "no aetitle for print target '" << opt_printer << "'"); + return 10; + } + if (targetPort == 0) + { + OFLOG_FATAL(dcmprscuLogger, "no or invalid port number for print target '" << opt_printer << "'"); + return 10; + } + if (targetMaxPDU == 0) targetMaxPDU = DEFAULT_MAXPDU; + else if (targetMaxPDU > ASC_MAXIMUMPDUSIZE) + { + OFLOG_WARN(dcmprscuLogger, "max PDU size " << targetMaxPDU << " too big for print target '" + << opt_printer << "', using default: " << DEFAULT_MAXPDU); + targetMaxPDU = DEFAULT_MAXPDU; + } + if (targetDisableNewVRs) + { + dcmDisableGenerationOfNewVRs(); + } + + OFLOG_INFO(dcmprscuLogger, "Printer parameters for '" << opt_printer << "':"); + OFLOG_INFO(dcmprscuLogger, " hostname : " << targetHostname); + OFLOG_INFO(dcmprscuLogger, " port : " << targetPort); + OFLOG_INFO(dcmprscuLogger, " description : " + << (targetDescription ? targetDescription : "(none)")); + OFLOG_INFO(dcmprscuLogger, " aetitle : " << targetAETitle); + OFLOG_INFO(dcmprscuLogger, " max pdu : " << targetMaxPDU); + OFLOG_INFO(dcmprscuLogger, " timeout : " << timeout); + if (targetImplicitOnly && targetDisableNewVRs) + OFLOG_INFO(dcmprscuLogger, " options : implicit xfer syntax only, disable post-1993 VRs"); + else if (targetImplicitOnly) + OFLOG_INFO(dcmprscuLogger, " options : implicit xfer syntax only"); + else if (targetDisableNewVRs) + OFLOG_INFO(dcmprscuLogger, " options : disable post-1993 VRs"); + else + OFLOG_INFO(dcmprscuLogger, " options : none"); + OFLOG_INFO(dcmprscuLogger, " 12-bit xfer : " << (targetSupports12bit ? "supported" : "not supported")); + OFLOG_INFO(dcmprscuLogger, " present.lut : " << (targetSupportsPLUT ? "supported" : "not supported")); + OFLOG_INFO(dcmprscuLogger, " annotation : " << (targetSupportsAnnotation ? "supported" : "not supported")); + OFLOG_INFO(dcmprscuLogger, "Spooler parameters:"); + OFLOG_INFO(dcmprscuLogger, " mode : " << (opt_spoolMode ? "spooler mode" : "printer mode")); + if (opt_spoolMode) { + OFLOG_INFO(dcmprscuLogger, " sleep time : " << opt_sleep); + } else { + OFLOG_INFO(dcmprscuLogger, " copies : " << opt_copies); + OFLOG_INFO(dcmprscuLogger, " medium : " << (opt_mediumtype ? opt_mediumtype : "printer default")); + OFLOG_INFO(dcmprscuLogger, " destination : " << (opt_destination ? opt_destination : "printer default")); + OFLOG_INFO(dcmprscuLogger, " label : " << (opt_sessionlabel ? opt_sessionlabel : "printer default")); + OFLOG_INFO(dcmprscuLogger, " priority : " << (opt_priority ? opt_priority : "printer default")); + OFLOG_INFO(dcmprscuLogger, " owner ID : " << (opt_ownerID ? opt_ownerID : "printer default")); + } + OFLOG_INFO(dcmprscuLogger, "transport layer security parameters:"); + OFLOG_INFO(dcmprscuLogger, " TLS : " << (useTLS ? "enabled" : "disabled")); + +#ifdef WITH_OPENSSL + if (useTLS) + { + OFString cslist; + if (tLayer) tLayer->getListOfCipherSuitesForOpenSSL(cslist); + OFLOG_INFO(dcmprscuLogger, " certificate : " << tlsCertificateFile); + OFLOG_INFO(dcmprscuLogger, " key file : " << tlsPrivateKeyFile); + OFLOG_INFO(dcmprscuLogger, " DH params : " << tlsDHParametersFile); + OFLOG_INFO(dcmprscuLogger, " PRNG seed : " << tlsRandomSeedFile); + OFLOG_INFO(dcmprscuLogger, " CA directory : " << tlsCACertificateFolder); + OFLOG_INFO(dcmprscuLogger, " ciphersuites : " << cslist); + OFLOG_INFO(dcmprscuLogger, " key format : " << (keyFileFormat == DCF_Filetype_PEM ? "PEM" : "DER")); + const char *verification; + switch (tlsCertVerification) + { + case DCV_checkCertificate: + verification = "verify"; + break; + case DCV_ignoreCertificate: + verification = "ignore"; + break; + default: + verification = "require"; + break; + } + OFLOG_INFO(dcmprscuLogger, " cert verify : " << verification);; + } +#endif + + int paramCount = cmd.getParamCount(); + const char *currentParam = NULL; + if (opt_spoolMode) + { + if (paramCount > 0) + { + OFLOG_WARN(dcmprscuLogger, "filenames specified on command line, will be ignored in spooler mode"); + } + + OFString jobNamePrefix = opt_spoolPrefix; + jobNamePrefix += "_"; + jobNamePrefix += opt_printer; + jobNamePrefix += "_"; + OFList jobList; + OFBool terminateFlag = OFFalse; + do + { + OFStandard::sleep((unsigned int)opt_sleep); + if (EC_Normal != updateJobList(jobList, dvi, terminateFlag, jobNamePrefix.c_str())) + { + OFLOG_FATAL(dcmprscuLogger, "spooler: non recoverable error occured, terminating"); + return 10; + } + // static OFCondition updateJobList(jobList, dvi, terminateFlag, jobNamePrefix.c_str()); + if (EC_Normal != spoolJobList(jobList, dvi, tLayer)) { /* ignore */ } + } while (! terminateFlag); + OFLOG_INFO(dcmprscuLogger, "spooler is terminating, goodbye!"); + } else { + // printer mode + if (paramCount == 0) + { + OFLOG_WARN(dcmprscuLogger, "spooler: no stored print files specified - nothing to do"); + } else { + dvi.clearFilmSessionSettings(); + if (opt_mediumtype) dvi.setPrinterMediumType(opt_mediumtype); + if (opt_destination) dvi.setPrinterFilmDestination(opt_destination); + if (opt_sessionlabel) dvi.setPrinterFilmSessionLabel(opt_sessionlabel); + if (opt_priority) dvi.setPrinterPriority(opt_priority); + if (opt_ownerID) dvi.setPrinterOwnerID(opt_ownerID); + if (opt_copies > 0) dvi.setPrinterNumberOfCopies(opt_copies); + for (int param=1; param <= paramCount; param++) + { + cmd.getParam(param, currentParam); + if (currentParam) + { + OFLOG_INFO(dcmprscuLogger, "spooling file '" << currentParam << "'"); + } + if (currentParam) + { + if (EC_Normal != spoolStoredPrintFile(currentParam, dvi, tLayer)) + { + OFLOG_ERROR(dcmprscuLogger, "spooling of file '" << currentParam << "' failed"); + } + } else { + OFLOG_ERROR(dcmprscuLogger, "empty file name"); + } + } + } + } + +#ifdef WITH_OPENSSL + if (tLayer) + { + if (tLayer->canWriteRandomSeed()) + { + if (!tLayer->writeRandomSeed(tlsRandomSeedFile.c_str())) + { + OFLOG_ERROR(dcmprscuLogger, "cannot write back random seed file '" << tlsRandomSeedFile << "', ignoring"); + } + } else { + OFLOG_WARN(dcmprscuLogger, "cannot write back random seed, ignoring"); + } + } + delete tLayer; +#endif + + OFStandard::shutdownNetwork(); + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + + return 0; +} diff --git a/dcmpstat/apps/dcmpschk.cc b/dcmpstat/apps/dcmpschk.cc new file mode 100644 index 00000000..42f394dd --- /dev/null +++ b/dcmpstat/apps/dcmpschk.cc @@ -0,0 +1,976 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Andrew Hewett, Marco Eichelberg + * + * Purpose: + * VR and IOD checker for Presentation States + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/ofstd/ofconapp.h" /* for OFConsoleApplication */ +#include "dcmtk/dcmdata/dctk.h" /* for class DcmDataset */ +#include "dcmtk/dcmnet/dul.h" +#include "dcmtk/dcmpstat/dcmpstat.h" /* for DcmPresentationState */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmpschk" + +static OFLogger dcmpschkLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +/* command line options */ +static const char *opt_filename = NULL; + +// ******************************************** + +enum ErrorMode +{ + EM_ok, + EM_informational, + EM_warning, + EM_error +}; + +#define MSG_invalidVR "Error: Unsupported Value Representation." +#define MSG_lengthtoolarge "Error: Value Length too large." +#define MSG_lengthtoosmall "Error: Value Length too small." +#define MSG_unexpectedVR "Error: Unexpected Value Representation." +#define MSG_vmtoolarge "Error: Value Multiplicity too large." +#define MSG_vmtoosmall "Error: Value Multiplicity too small." +#define MSGe_mhxferError "Error: Meta-header encoded using invalid transfer syntax." +#define MSGe_missingAtt "Error: Attribute is missing." +#define MSGe_wrongAtt "Error: Attribute is incorrect." +#define MSGe_wrongDType "Error: Attribute value does not conform to data type definition." +#define MSGi_wrongDType "Informational: Attribute value does not conform to data type definition." +#define MSGw_wrongDType "Warning: Attribute value uses retired form." +#define MSGw_dubiousDate "Warning: Dubious date (year before 1850 or after 2050)." + +static void printVRError( + ErrorMode mode, + const char *elementDescription, + const DcmDictEntry* dictRef, + const char *format) +{ + OFOStringStream out; + if (mode == EM_error) out << MSGe_wrongDType << OFendl; + else if (mode == EM_warning) out << MSGw_wrongDType << OFendl; + else if (mode == EM_informational) out << MSGi_wrongDType << OFendl; + out << " Affected attribute: "; + if (dictRef) + { + out << dictRef->getTagName(); + out << " " << dictRef->getKey(); + out << ", Type " << dictRef->getVR().getVRName() << OFendl; + } else out << "(unnamed)" << OFendl; + out << " Attribute value : "; + if (elementDescription) out << "[" << elementDescription << "]" << OFendl; + else out << "(empty)" << OFendl; + if (mode == EM_error) + { + out << " Expected format for each value: "; + if (format) + { + out << format << OFendl; + } else out << "(undefined)" << OFendl; + } + out << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, tmp) + OFLOG_ERROR(dcmpschkLogger, tmp); + OFSTRINGSTREAM_FREESTR(tmp) +} + +static void printResult( + DcmStack& stack, + OFBool showFullData) +{ + unsigned long n = stack.card(); + if (n == 0) { + return; + } + + OFString tmp; + + /* print the path leading up to the top stack elem */ + for (unsigned long i=n-1; i>=1; i--) + { + DcmObject *dobj = stack.elem(i); + /* do not print if a DCM_Item as this is not + * very helpful to distinguish instances. + */ + if (dobj != NULL && dobj->getTag().getXTag() != DCM_Item) + { + char buf[128]; + sprintf(buf, "(%04x,%04x).", + (unsigned)dobj->getGTag(), + (unsigned)dobj->getETag()); + tmp += buf; + } + } + + /* print the tag and its value */ + DcmObject *dobj = stack.top(); + OFLOG_WARN(dcmpschkLogger, tmp << DcmObject::PrintHelper(*dobj, showFullData ? 0 : DCMTypes::PF_shortenLongTagValues)); +} + +static OFBool isaStringVR(DcmVR& vr) +{ + OFBool isaString = OFFalse; + switch(vr.getEVR()) + { + case EVR_AE: + case EVR_AS: + case EVR_CS: + case EVR_DA: + case EVR_DS: + case EVR_DT: + case EVR_IS: + case EVR_LO: + case EVR_LT: + case EVR_PN: + case EVR_SH: + case EVR_ST: + case EVR_TM: + case EVR_UI: + case EVR_UT: + isaString = OFTrue; + break; + default: + isaString = OFFalse; + break; + } + return isaString; +} + +static const char* streamvm(const DcmDictEntry *e) +{ + static char buf[256]; + if (e->isFixedSingleVM()) { + sprintf(buf, "%d", e->getVMMax()); + } else if (e->isVariableRangeVM()) { + sprintf(buf, "%d-n", e->getVMMin()); + } else if (e->isFixedRangeVM()){ + sprintf(buf, "%d-%d", e->getVMMin(), e->getVMMax()); + } else { + sprintf(buf, "?(%d-%d)?", e->getVMMin(), e->getVMMax()); + } + return buf; +} + +static const char* streamLengthOfValue(DcmVR& vr) +{ + static char buf[256]; + Uint32 min = vr.getMinValueLength(); + Uint32 max = vr.getMaxValueLength(); + Uint32 undefLen = DCM_UndefinedLength; + + if (min==max) { + sprintf(buf, "%d bytes fixed length", (int)min); + } else if (min==0) { + if (max==undefLen) { + sprintf(buf, "unrestricted length"); + } else { + sprintf(buf, "%d bytes maximum", (int)max); + } + } else { + sprintf(buf, "range %d-%d bytes length", (int)min, (int)max); + } + return buf; +} + +static int splitFields( + char* line, + char* fields[], + Uint32 maxFields, + char splitChar) +{ + char* p; + Uint32 foundFields = 0; + size_t len; + + do { + p = strchr(line, splitChar); + if (p == NULL) { + len = strlen(line); + } else { + len = p - line; + } + fields[foundFields] = new char[len+1]; + strncpy(fields[foundFields], line, len); + fields[foundFields][len] = '\0'; + + foundFields++; + line = p + 1; + } while ((foundFields < maxFields) && (p != NULL)); + + return foundFields; +} + +static OFBool isaKnownPointer(DcmTag& t) +{ + /* + ** The DICOMDIR code automatically converts any pointers + ** to have VR=up even if when the data has an explicit VR encoding. + ** If this attribute is a known pointer then it is ok for it to + ** have the internal VR=up. + */ + + OFBool result = OFFalse; + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dictRef = globalDataDict.findEntry(t, NULL); + + if (dictRef && (t.getEVR() == EVR_up) && (t.getEVR() == dictRef->getEVR())) result = OFTrue; + + dcmDataDict.rdunlock(); + return result; +} + +static int checkelem( + DcmElement *elem, + DcmXfer& oxfer, + DcmStack& stack, + OFBool showFullData, + int& dderrors) +{ + DcmVR vr(elem->getVR()); + Uint32 len = elem->getLength(); + DcmTag tag(elem->getTag()); + Uint32 vm = elem->getVM(); + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dictRef = globalDataDict.findEntry(tag, NULL); + int i = 0; + + /* + ** if the data was encoded in explicit VR then check that the given VR matches + ** the value in the data dictionary. + */ + if (oxfer.isExplicitVR()) { + if (!vr.isStandard() && !isaKnownPointer(tag)) { + OFLOG_WARN(dcmpschkLogger, MSG_invalidVR << OFendl + << " Affected VR : [" << vr.getVRName() << "]" + << (dictRef ? OFString(", should be [") + + dictRef->getVR().getVRName() + "] according to data dictionary." : "") + << OFendl << " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } else if (dictRef && !vr.isEquivalent(dictRef->getVR())) { + OFLOG_WARN(dcmpschkLogger, MSG_unexpectedVR << OFendl + << " Affected VR : [" << vr.getVRName() << "], should be [" + << dictRef->getVR().getVRName() << "] according to data dictionary." << OFendl + << " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } + } + + if (len) /* type 2 attributes can be empty. */ + { + + /* + ** Check value multiplicity + */ + if ((dictRef)&&(vm < (Uint32)dictRef->getVMMin())) + { + OFLOG_WARN(dcmpschkLogger, MSG_vmtoosmall << OFendl + << " Affected VM : " << vm << ", should be " + << streamvm(dictRef) << " according to data dictionary." + << OFendl << " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } + + if ((dictRef)&&(vm > (Uint32)dictRef->getVMMax())) + { + OFLOG_WARN(dcmpschkLogger, MSG_vmtoolarge << OFendl + << " Affected VM : " << vm << ", should be " + << streamvm(dictRef) << " according to data dictionary." + << OFendl << " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } + + /* + ** Check length of attribute + */ + /* Need to split the value into its components if VM>1 */ + if (isaStringVR(vr)) { + /* only strings have variable length components */ + char* value = NULL; + ((DcmByteString*)elem)->getString(value); + + char **fields = new char*[vm+1]; + if (fields == NULL) { + printResult(stack, showFullData); + OFLOG_FATAL(dcmpschkLogger, "Internal error: out of memory (value multiplicity too large)"); + } else { + int nfields = splitFields(value, fields, vm, '\\'); + if ((Uint32)nfields != vm) { + printResult(stack, showFullData); + OFLOG_FATAL(dcmpschkLogger, "Internal error: splitFields inconsistency (" + << nfields << "!=" << vm << ")"); + exit(1); + } + for (i=0; (Uint32)i vr.getMaxValueLength()) { + OFLOG_WARN(dcmpschkLogger, MSG_lengthtoolarge << OFendl + << " Affected length : " << slen << " bytes, should be " + << streamLengthOfValue(vr) << " for " << vr.getVRName() << "."); + if (vm > 1) + OFLOG_WARN(dcmpschkLogger, " Affected value [" << i << "]: \"" << s << "\""); + OFLOG_WARN(dcmpschkLogger, " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } + if ((Uint32)slen < vr.getMinValueLength()) { + OFLOG_WARN(dcmpschkLogger, MSG_lengthtoosmall << OFendl + << " Affected length : " << slen << " bytes, should be " + << streamLengthOfValue(vr) << " for " << vr.getVRName() << "."); + if (vm > 1) + OFLOG_WARN(dcmpschkLogger, " Affected value [" << i << "]: \"" << s << "\""); + OFLOG_WARN(dcmpschkLogger, " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } + + delete[] fields[i]; + fields[i] = NULL; + } + delete[] fields; + } + } else { + Uint32 componentSize = len; /* vm is 0 if value field is too short, e.g. < 8 bytes for FD */ + if (vm>0) componentSize = len/vm; + if (componentSize > vr.getMaxValueLength()) { + OFLOG_WARN(dcmpschkLogger, MSG_lengthtoolarge << OFendl + << " Affected length : " << componentSize << " bytes, should be " + << streamLengthOfValue(vr) << " for " << vr.getVRName() << "." << OFendl + << " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } + if (componentSize < vr.getMinValueLength()) { + OFLOG_WARN(dcmpschkLogger, MSG_lengthtoosmall << OFendl + << " Affected length : " << componentSize << " bytes, should be " + << streamLengthOfValue(vr) << " for " << vr.getVRName() << "." << OFendl + << " Affected attribute: "); + printResult(stack, showFullData); + dderrors++; + } + } + + /* + ** check, wether the value of the element is suitable to the data type. + */ + + /*** differenciate all value representations */ + if (isaStringVR(vr)) + { + char* value = NULL; + if (EC_Normal == ((DcmByteString*)elem)->getString(value) && value) switch (vr.getEVR()) + { + case EVR_AE: + { + const int realVR = DcmElement::scanValue(value, "ae"); + if (realVR != 13) + { + printVRError(EM_error, value, dictRef, "all but control characters"); + dderrors++; + } + } + break; + case EVR_AS: + { + const int realVR = DcmElement::scanValue(value, "as"); + if (realVR != 1) + { + printVRError(EM_error, value, dictRef, "[0-9]{3}[DWMY]"); + dderrors++; + } + } + break; + case EVR_CS: + { + const int realVR = DcmElement::scanValue(value, "cs"); + if (realVR != 10) + { + printVRError(EM_error, value, dictRef, "[0-9A-Z _]+"); + dderrors++; + } + } + break; + case EVR_DA: + { + const int realVR = DcmElement::scanValue(value, "da"); + if (realVR != 2) + { + switch (realVR) + { + case 3: + printVRError(EM_warning, value, dictRef, NULL); + dderrors++; + break; + case 17: + OFLOG_WARN(dcmpschkLogger, MSGw_dubiousDate); + printVRError(EM_ok, value, dictRef, NULL); + dderrors++; + break; + default: + printVRError(EM_error, value, dictRef, "[0-9]{8} with valid values for year, month and day"); + dderrors++; + break; + } + } + } + break; + case EVR_DS: + { + const int realVR = DcmElement::scanValue(value, "ds"); + if (realVR != 6) + { + printVRError(EM_error, value, dictRef, "([\\-\\+]?[0-9]*[\\.]?[0-9]+)|([\\-\\+]?[0-9][\\.]?[0-9]+[Ee][\\+\\-][0-9]+)"); + dderrors++; + } + } + break; + case EVR_DT: + { + const int realVR = DcmElement::scanValue(value, "dt"); + if (realVR != 7) + { + if (realVR == 18) + { + OFLOG_WARN(dcmpschkLogger, MSGw_dubiousDate); + printVRError(EM_ok, value, dictRef, NULL); + dderrors++; + } else { + printVRError(EM_error, value, dictRef, "[0-9]{8}[0-9]{2}([0-9]{2}([0-9]{2}(\\.[0-9]{1,6})?)?)?([\\+\\-][0-9]{4})?"); + dderrors++; + } + } + } + break; + case EVR_IS: + { + const int realVR = DcmElement::scanValue(value, "is"); + if (realVR != 8) + { + printVRError(EM_error, value, dictRef, "[\\+\\-]?[0-9]+ in the range -2^31 .. 2^31-1"); + dderrors++; + } + } + break; + case EVR_SH: + case EVR_LO: + { + const int realVR = DcmElement::scanValue(value, "lo"); + if (realVR != 12) + { + printVRError(EM_error, value, dictRef, "all but '\\' and control characters"); + dderrors++; + } + } + break; + case EVR_ST: + case EVR_LT: + case EVR_UT: + { + const int realVR = DcmElement::scanValue(value, "lt"); + if (realVR != 14) + { + printVRError(EM_error, value, dictRef, "all"); + dderrors++; + } + } + break; + case EVR_PN: + { + const int realVR = DcmElement::scanValue(value, "pn"); + if (realVR != 11) + { + if (realVR == 15) /* OLD_PN */ + { + printVRError(EM_warning, value, dictRef, NULL); + dderrors++; + } else { + printVRError(EM_error, value, dictRef, "{all}*([\\^]{all}*([\\^]{all}*([\\^]{all}*(\\^{all}*)?)?)?)?"); + dderrors++; + } + } + } + break; + case EVR_TM: + { + const int realVR = DcmElement::scanValue(value, "tm"); + if (realVR != 4) + { + if (realVR == 5) + { + printVRError(EM_warning, value, dictRef, NULL); + dderrors++; + } else { + printVRError(EM_error, value, dictRef, "[0-9]{2}([0-9]{2}([0-9]{2}(\\.[0-9]{1,6})?)?)? with valid values for hour, minute and second"); + dderrors++; + } + } + } + break; + case EVR_UI: + { + const int realVR = DcmElement::scanValue(value, "ui"); + if (realVR != 9) + { + printVRError(EM_error, value, dictRef, "([0-9]+\\.)*[0-9]+ without any leading zeroes"); + dderrors++; + } + } + break; + default: + break; + } + + } //end of if (isaStringVR(vr)) + + } + dcmDataDict.rdunlock(); + return 0; +} + +static int checkitem( + DcmItem *item, + DcmXfer& oxfer, + DcmStack& stack, + OFBool showFullData, + int& dderrors) +{ + + if (item == NULL) { + return 0; + } + /* + ** Step through each attribute and check it. + */ + + unsigned long count = item->card(); + for (unsigned long i=0; igetElement(i); + + stack.push(elem); + checkelem(elem, oxfer, stack, showFullData, dderrors); + stack.pop(); + + if (elem->ident() == EVR_SQ) { + DcmSequenceOfItems *seq = (DcmSequenceOfItems*)elem; + unsigned long nitems = seq->card(); + for (unsigned long j=0; jgetItem(j), oxfer, stack, showFullData, dderrors); + stack.pop(); + } + } + } + return 0; +} + +static int dcmchk( + const char* ifname, + E_FileReadMode readMode, + E_TransferSyntax xfer, + OFBool showFullData, + OFBool loadAllDataInMemory, + int& dderrors) +{ + DcmFileFormat *ds = new DcmFileFormat(); + + OFCondition cond = ds->loadFile(ifname, xfer, EGL_noChange, DCM_MaxReadLength, readMode); + if (! cond.good()) + { + OFLOG_ERROR(dcmpschkLogger, cond.text() << " reading file: " << ifname); + } + + if (loadAllDataInMemory) { + ds->loadAllDataIntoMemory(); + if (ds->error() != EC_Normal) + { + OFLOG_ERROR(dcmpschkLogger, ds->error().text() + << " reading file: " << ifname); + return 1; + } + } + + DcmStack stack; + DcmXfer oxfer(META_HEADER_DEFAULT_TRANSFERSYNTAX); + + DcmMetaInfo *mi = ds->getMetaInfo(); + if (mi->card() > 0) + { + // we only check the meta-header if there is something to check + checkitem(mi, oxfer, stack, showFullData, dderrors); + } + + oxfer = ds->getDataset()->getOriginalXfer(); + checkitem(ds->getDataset(), oxfer, stack, showFullData, dderrors); + + delete ds; + + return 0; +} + +//********************************************************* + +static OFString printAttribute( + OFString &ret, + DcmItem* dset, + const DcmTagKey& key) +{ + DcmElement *elem = NULL; + DcmStack stack; + OFCondition ec = EC_Normal; + OFOStringStream str; + + ec = dset->search(key, stack, ESM_fromHere, OFFalse); + elem = (DcmElement*) stack.top(); + if (elem) + elem->print(str, DCMTypes::PF_shortenLongTagValues); + else + str << ""; + str << OFStringStream_ends; + + OFSTRINGSTREAM_GETSTR(str, tmp) + ret = tmp; + OFSTRINGSTREAM_FREESTR(tmp) + return ret; +} + +static OFBool +chkType1AttributeExistance( + DcmItem* dset, + const DcmTagKey& key) +{ + OFBool found = OFTrue; + if (!dset->tagExistsWithValue(key)) { + DcmTag t(key); + OFLOG_WARN(dcmpschkLogger, MSGe_missingAtt << OFendl + << " Affected attribute: " << t.getXTag() + << " " << t.getTagName() << OFendl); + found = OFFalse; + } + return found; +} + +static int dcmchkMetaHeader( + DcmMetaInfo* meta, + DcmDataset* dset) +{ + + if (meta == NULL || meta->card() == 0) { + /* no meta-header so no errors */ + return 0; + } + + int nErrs = 0; + OFString tmp_str; + + /* + ** The meta-header should use the LittleEndianExplicit transfer syntax + */ + if (meta->getOriginalXfer() != EXS_LittleEndianExplicit) { + DcmXfer used(meta->getOriginalXfer()); + DcmXfer expected(EXS_LittleEndianExplicit); + OFLOG_WARN(dcmpschkLogger, MSGe_mhxferError << OFendl + << " Expected: " << expected.getXferName() << OFendl + << " Used: " << used.getXferName() << OFendl); + nErrs++; + } + + /* + ** Check the meta-header contents + */ + + // examine the FileMetaInformationVersion + DcmTagKey fmiv(DCM_FileMetaInformationVersion); + if (chkType1AttributeExistance(meta, fmiv)) { + Uint8 b0 = 0xff; + Uint8 b1 = 0xff; + // get bytes + meta->findAndGetUint8(fmiv, b0, 0); + meta->findAndGetUint8(fmiv, b1, 1); + // we expect 0x00/0x01 for the version + if ((b0 != 0x00) || (b1 != 0x01)) { + OFLOG_WARN(dcmpschkLogger, MSGe_wrongAtt << OFendl + << " Invalid FileMetaInformationVersion (expected: 00\\01)" << OFendl + << " Affected attribute: " << OFendl + << " " << printAttribute(tmp_str, meta, fmiv)); + nErrs++; + } + } else { + nErrs++; + } + + // examine the MediaStorageSOPClassUID + DcmTagKey msscuid(DCM_MediaStorageSOPClassUID); + if (chkType1AttributeExistance(meta, msscuid)) { + OFString metaHeaderClassUID; + meta->findAndGetOFStringArray(msscuid, metaHeaderClassUID); + // should be the same as SOPClassUID in the dataset + if (dset && dset->tagExistsWithValue(DCM_SOPClassUID)) { + OFString datasetClassUID; + dset->findAndGetOFStringArray(DCM_SOPClassUID, datasetClassUID); + if (metaHeaderClassUID != datasetClassUID) { + OFLOG_WARN(dcmpschkLogger, MSGe_wrongAtt << OFendl + << " Inconsistent SOP class information" << OFendl + << " Affected attributes: " << OFendl + << " " << printAttribute(tmp_str, meta, msscuid) << OFendl + << " " << printAttribute(tmp_str, dset, DCM_SOPClassUID)); + nErrs++; + } + } + if (!dcmFindNameOfUID(metaHeaderClassUID.c_str())) { + OFLOG_WARN(dcmpschkLogger, MSGe_wrongAtt << OFendl + << " Unknown SOP Class" << OFendl + << " Affected attribute: " << OFendl + << " " << printAttribute(tmp_str, meta, msscuid)); + nErrs++; + } + } else { + nErrs++; + } + + // Examine MediaStorageSOPInstanceUID + DcmTagKey mssiuid(DCM_MediaStorageSOPInstanceUID); + if (chkType1AttributeExistance(meta, mssiuid)) { + OFString metaHeaderInstanceUID; + meta->findAndGetOFStringArray(mssiuid, metaHeaderInstanceUID); + // should be the same as SOPInstanceUID in the dataset + if (dset && dset->tagExistsWithValue(DCM_SOPInstanceUID)) { + OFString datasetInstanceUID; + dset->findAndGetOFStringArray(DCM_SOPInstanceUID, datasetInstanceUID); + if (metaHeaderInstanceUID != datasetInstanceUID) { + OFLOG_WARN(dcmpschkLogger, MSGe_wrongAtt << OFendl + << " Inconsistent SOP instance information" << OFendl + << " Affected attributes: " << OFendl + << " " << printAttribute(tmp_str, meta, mssiuid) << OFendl + << " " << printAttribute(tmp_str, dset, DCM_SOPInstanceUID)); + nErrs++; + } + } + } else { + nErrs++; + } + + // examine the TransferSyntaxUID + DcmTagKey tsuid(DCM_TransferSyntaxUID); + if (chkType1AttributeExistance(meta, tsuid)) { + OFString transferSyntaxUID; + meta->findAndGetOFStringArray(tsuid, transferSyntaxUID); + // is this transfer syntax known ? + DcmXfer expected(transferSyntaxUID.c_str()); + if (expected.getXfer() == EXS_Unknown) { + OFLOG_WARN(dcmpschkLogger, MSGe_wrongAtt << OFendl + << " Unknown Transfer Syntax" << OFendl + << " Affected attribute: " << OFendl + << " " << printAttribute(tmp_str, meta, tsuid)); + nErrs++; + } + + // should be the same as transfer syntax used to read the dataset + if (dset && (dset->getOriginalXfer() != EXS_LittleEndianExplicit)) { + DcmXfer used(dset->getOriginalXfer()); + OFString usedTransferSyntaxUID(used.getXferID()); + if (transferSyntaxUID != usedTransferSyntaxUID) { + OFLOG_WARN(dcmpschkLogger, MSGe_wrongAtt << OFendl + << " Dataset not encoded using specified transfer syntax" << OFendl + << " Affected attribute: " << OFendl + << " " << printAttribute(tmp_str, meta, tsuid)); + OFLOG_WARN(dcmpschkLogger, " Dataset encoded using: " << used.getXferName()); + nErrs++; + } + + } + } else { + nErrs++; + } + + // Check the group length information + DcmTagKey gltag(DCM_FileMetaInformationGroupLength); + if (chkType1AttributeExistance(meta, gltag)) { + Uint32 len = 0; + meta->findAndGetUint32(gltag, len, 0); + // Compute how large the Meta-Header should be + Uint32 expectedLength = meta->getLength(EXS_LittleEndianExplicit, + EET_ExplicitLength); + expectedLength -= 12; // less length of group length element itself + + if (len != expectedLength) { + OFLOG_WARN(dcmpschkLogger, MSGe_wrongAtt << OFendl + << " Invalid meta-header group length (expected: " + << expectedLength << ")" << OFendl + << " Affected attribute: " << OFendl + << " " << printAttribute(tmp_str, meta, gltag)); + nErrs++; + } + } else { + nErrs++; + } + + return nErrs; +} + +static int checkfile(const char *filename) +{ + DcmFileFormat *dfile = new DcmFileFormat(); + if (dfile == NULL) + { + OFLOG_ERROR(dcmpschkLogger, "out of memory."); + return -1; + } + + OFCondition cond = dfile->loadFile(filename); + if (! cond.good()) + { + OFLOG_ERROR(dcmpschkLogger, cond.text() << " reading file: " << filename); + delete dfile; + return -1; + } + + int numberOfErrors = 0; + OFBool test_passed = OFTrue; + + DcmDataset *DataSet = dfile->getDataset(); + DcmMetaInfo *MetaInfo = dfile->getMetaInfo(); + + OFLOG_INFO(dcmpschkLogger, "========================================================="); + OFLOG_WARN(dcmpschkLogger, "Testing: " << filename); + OFLOG_INFO(dcmpschkLogger, "========================================================="); + + if (MetaInfo) + { + OFLOG_INFO(dcmpschkLogger, "---------------------------------------------------------" << OFendl + << "Pass 1 - Inconsistencies between Meta-header and Data Set" << OFendl + << "---------------------------------------------------------"); + numberOfErrors += dcmchkMetaHeader(MetaInfo, DataSet); + } + + OFLOG_INFO(dcmpschkLogger, "-------------------------------------------------------------" << OFendl + << "Pass 2 - Inconsistencies between Data Dictionary and Data Set" << OFendl + << "-------------------------------------------------------------"); + + dcmchk(opt_filename, ERM_autoDetect, EXS_Unknown, + OFFalse /* showFullData */, OFTrue /* loadAllDataInMemory */, + numberOfErrors); + + OFLOG_INFO(dcmpschkLogger, "-------------------------------------------------------------" << OFendl + << "Pass 3 - Semantic Check of Presentation State Object " << OFendl + << "-------------------------------------------------------------"); + + OFString aString; + if ((DataSet->findAndGetOFString(DCM_SOPClassUID, aString).good()) && (aString == UID_GrayscaleSoftcopyPresentationStateStorage)) + { + DcmPresentationState pState; + if (pState.read(*DataSet).bad()) + { + test_passed = OFFalse; + } + } else { + OFLOG_INFO(dcmpschkLogger, "Not a Grayscale Softcopy Presentation State, skipping pass 3."); + } + if (numberOfErrors > 0) test_passed = OFFalse; + + if (test_passed) OFLOG_WARN(dcmpschkLogger, "Test passed."); + else OFLOG_WARN(dcmpschkLogger, "Test failed - one or more errors."); + + if (dfile) delete dfile; + return numberOfErrors; +} + +#define SHORTCOL 3 +#define LONGCOL 12 + +int main(int argc, char *argv[]) +{ + OFStandard::initializeNetwork(); + +#ifdef WITH_TCPWRAPPER + // this code makes sure that the linker cannot optimize away + // the DUL part of the network module where the external flags + // for libwrap are defined. Needed on OpenBSD. + dcmTCPWrapperDaemonName.set(NULL); +#endif + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Checking tool for presentation states", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 2); + + cmd.addParam("dcmfile-in", "presentation state file(s) to be checked", OFCmdParam::PM_MultiMandatory); + + cmd.addGroup("general options:"); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* options */ + OFLog::configureFromCommandLine(cmd, app); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmpschkLogger, rcsid << OFendl); + + int paramCount = cmd.getParamCount(); + for (int param=1; param <= paramCount; param++) + { + cmd.getParam(param, opt_filename); + checkfile(opt_filename); + } + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + return 0; +} diff --git a/dcmpstat/apps/dcmpsmk.cc b/dcmpstat/apps/dcmpsmk.cc new file mode 100644 index 00000000..061c3ca8 --- /dev/null +++ b/dcmpstat/apps/dcmpsmk.cc @@ -0,0 +1,378 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * sample application that reads a DICOM image and creates + * a matching presentation state. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmnet/dul.h" +#include "dcmtk/dcmpstat/dcmpstat.h" +#include "dcmtk/dcmpstat/dvpshlp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmpsmk" + +static OFLogger dcmpsmkLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +// ******************************************** + +#define SHORTCOL 3 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + +#ifdef WITH_TCPWRAPPER + // this code makes sure that the linker cannot optimize away + // the DUL part of the network module where the external flags + // for libwrap are defined. Needed on OpenBSD. + dcmTCPWrapperDaemonName.set(NULL); +#endif + + // Variables for input parameters + const char* opt_ifname = NULL; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + + // Variables for output parameters + const char* opt_ofname = NULL; + E_TransferSyntax opt_oxfer = EXS_Unknown; + E_GrpLenEncoding oglenc = EGL_recalcGL; // currently not available as command line option + E_EncodingType oenctype = EET_ExplicitLength; // currently not available as command line option + E_PaddingEncoding opadenc = EPD_noChange; // currently not available as command line option + Uint32 padlen = 0; // currently not available as command line option + Uint32 subPadlen = 0; // currently not available as command line option + + // Variables for processing parameters + DVPSoverlayActivation overlayActivation = DVPSO_copyOverlays; + DVPSVOIActivation voiActivation = DVPSV_preferVOILUT; + OFBool curveActivation = OFTrue; + OFBool shutterActivation = OFTrue; + OFBool presentationActivation = OFTrue; + DVPSGraphicLayering layering = DVPSG_twoLayers; + + const char * opt_aetitle = NULL; + const char * opt_filesetID = NULL; + const char * opt_filesetUID = NULL; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Create DICOM grayscale softcopy presentation state", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM image file(s) to be read", OFCmdParam::PM_MultiMandatory); + cmd.addParam("dcmfile-out", "DICOM presentation state file to be created"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:", LONGCOL, SHORTCOL); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("VOI transform handling:"); + cmd.addOption("--voi-lut", "+Vl", "use first VOI LUT if present (default)"); + cmd.addOption("--voi-window", "+Vw", "use first window center/width if present"); + cmd.addOption("--voi-ignore", "-V", "ignore VOI LUT and window center/width"); + cmd.addSubGroup("curve handling:"); + cmd.addOption("--curve-activate", "+c", "activate curve data if present (default)"); + cmd.addOption("--curve-ignore", "-c", "ignore curve data"); + cmd.addSubGroup("overlay handling:"); + cmd.addOption("--overlay-copy", "+oc", "copy overlays if not embedded,\nactivate otherwise (default)"); + cmd.addOption("--overlay-activate", "+oa", "activate overlays"); + cmd.addOption("--overlay-ignore", "-o", "ignore overlays"); + cmd.addSubGroup("shutter handling:"); + cmd.addOption("--shutter-activate", "+s", "use shutter if present in image (default)"); + cmd.addOption("--shutter-ignore", "-s", "ignore shutter"); + cmd.addSubGroup("presentation LUT shape handling:"); + cmd.addOption("--plut-activate", "+p", "use presentation LUT shape if present (default)"); + cmd.addOption("--plut-ignore", "-p", "ignore presentation LUT shape"); + cmd.addSubGroup("layering:"); + cmd.addOption("--layer-single", "+l1", "all curves and overlays are in one layer"); + cmd.addOption("--layer-double", "+l2", "one layer for curves, one for overlays (default)"); + cmd.addOption("--layer-separate", "+ls", "separate layers for each curve and overlay"); + cmd.addSubGroup("location of referenced image:"); + cmd.addOption("--location-none", "-lx", "image reference without location (default)"); + cmd.addOption("--location-network", "-ln", 1, "[a]etitle: string", + "image located at application entity a"); + cmd.addOption("--location-media", "-lm", 2, "[f]ilesetID, fileset[UID]: string", + "image located on storage medium"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as image file (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* command line parameters and options */ + cmd.getParam(1, opt_ifname); + cmd.getParam(cmd.getParamCount(), opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--voi-lut")) voiActivation = DVPSV_preferVOILUT; + if (cmd.findOption("--voi-window")) voiActivation = DVPSV_preferVOIWindow; + if (cmd.findOption("--voi-ignore")) voiActivation = DVPSV_ignoreVOI; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--curve-activate")) curveActivation = OFTrue; + if (cmd.findOption("--curve-ignore")) curveActivation = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--overlay-copy")) overlayActivation = DVPSO_copyOverlays; + if (cmd.findOption("--overlay-activate")) overlayActivation = DVPSO_referenceOverlays; + if (cmd.findOption("--overlay-ignore")) overlayActivation = DVPSO_ignoreOverlays; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--shutter-activate")) shutterActivation = OFTrue; + if (cmd.findOption("--shutter-ignore")) shutterActivation = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--plut-activate")) presentationActivation = OFTrue; + if (cmd.findOption("--plut-ignore")) presentationActivation = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--layer-single")) layering = DVPSG_oneLayer; + if (cmd.findOption("--layer-double")) layering = DVPSG_twoLayers; + if (cmd.findOption("--layer-separate")) layering = DVPSG_separateLayers; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--location-none")) { /* nothing */ } + if (cmd.findOption("--location-network")) app.checkValue(cmd.getValue(opt_aetitle)); + if (cmd.findOption("--location-media")) + { + app.checkValue(cmd.getValue(opt_filesetID)); + app.checkValue(cmd.getValue(opt_filesetUID)); + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_oxfer = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.endOptionBlock(); + + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmpsmkLogger, rcsid << OFendl); + + // additional checks + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmpsmkLogger, "invalid input filename: "); + return 1; + } + + if ((opt_ofname == NULL) || (strlen(opt_ofname) == 0)) + { + OFLOG_FATAL(dcmpsmkLogger, "invalid output filename: "); + return 1; + } + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmpsmkLogger, "no data dictionary loaded, " + << "check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open input file + DcmFileFormat fileformat; + + OFLOG_INFO(dcmpsmkLogger, "read and interpret DICOM file " << opt_ifname); + + OFCondition error = fileformat.loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (error.bad()) + { + OFLOG_FATAL(dcmpsmkLogger, error.text() << ": reading file: " << opt_ifname); + return 1; + } + + DcmDataset *dataset = fileformat.getDataset(); + + /* create presentation state */ + DcmPresentationState state; + OFLOG_INFO(dcmpsmkLogger, "creating presentation state object"); + + error = state.createFromImage(*dataset, overlayActivation, voiActivation, + curveActivation, shutterActivation, presentationActivation, layering, opt_aetitle, opt_filesetID, opt_filesetUID); + if (error != EC_Normal) + { + OFLOG_FATAL(dcmpsmkLogger, error.text() << ": creating presentation state from image file: " << opt_ifname); + return 1; + } + + /* add additional image references to pstate */ + if (cmd.getParamCount() > 2) + { + OFLOG_INFO(dcmpsmkLogger, "adding additonal image reference(s)"); + const int count = cmd.getParamCount(); + for (int i = 2; i < count; i++) + { + const char *fn = NULL; + if (cmd.getParam(i, fn) == OFCommandLine::PVS_Normal) + { + DcmFileFormat *ff = NULL; + if (DVPSHelper::loadFileFormat(fn, ff) == EC_Normal) + { + if (ff) + { + DcmDataset *dset = ff->getDataset(); + if (dset) + state.addImageReference(*dset); + } + } + delete ff; + } + } + } + + DcmFileFormat fileformat2; + DcmDataset *dataset2 = fileformat2.getDataset(); + + error = state.write(*dataset2, OFTrue); + if (error != EC_Normal) + { + OFLOG_FATAL(dcmpsmkLogger, error.text() << ": re-encoding presentation state : " << opt_ifname); + return 1; + } + + if (opt_oxfer == EXS_Unknown) + { + OFLOG_INFO(dcmpsmkLogger, "set output transfersyntax to input transfer syntax"); + opt_oxfer = dataset->getOriginalXfer(); + } + + OFLOG_INFO(dcmpsmkLogger, "Check if new output transfer syntax is possible"); + + DcmXfer oxferSyn(opt_oxfer); + + if (dataset2->chooseRepresentation(opt_oxfer, NULL).good() && dataset2->canWriteXfer(opt_oxfer)) + { + OFLOG_INFO(dcmpsmkLogger, "Output transfer syntax " << oxferSyn.getXferName() + << " can be written"); + } else { + OFLOG_FATAL(dcmpsmkLogger, "No conversion to transfer syntax " << oxferSyn.getXferName() + << " possible!"); + return 1; + } + + OFLOG_INFO(dcmpsmkLogger, "write converted DICOM file"); + + error = fileformat2.saveFile(opt_ofname, opt_oxfer, oenctype, oglenc, opadenc, padlen, subPadlen); + if (error.bad()) + { + OFLOG_FATAL(dcmpsmkLogger, error.text() << ": writing file: " << opt_ofname); + return 1; + } + + OFLOG_INFO(dcmpsmkLogger, "conversion successful"); + + return 0; +} diff --git a/dcmpstat/apps/dcmpsprt.cc b/dcmpstat/apps/dcmpsprt.cc new file mode 100644 index 00000000..c7273f24 --- /dev/null +++ b/dcmpstat/apps/dcmpsprt.cc @@ -0,0 +1,675 @@ +/* + * + * Copyright (C) 1999-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Marco Eichelberg + * + * Purpose + * sample application that reads multiple images and (optionally) + * presentation states and creates a print job consisting of + * stored print and hardcopy grayscale images. + * Non-grayscale transformations in the presentation state are ignored. + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmpstat/dviface.h" +#include "dcmtk/dcmpstat/dvpssp.h" +#include "dcmtk/dcmimgle/dcmimage.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/ofstd/oflist.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmpsprt" + +static OFLogger dcmpsprtLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +static int addOverlay(const char *filename, + unsigned long xpos, + unsigned long ypos, + Uint16 *pixel, + unsigned long width, + unsigned long height, + unsigned int gray) +{ + if ((filename != NULL) && (pixel != NULL)) + { + STD_NAMESPACE ifstream input(filename, OFopenmode_in_nocreate); + if (input) + { + char c; + unsigned int xsize, ysize; + if (input.get(c) && (c == 'P') && input.get(c) && (c == '1')) + { + /* still need to add code for skipping comments in PBM file */ + input >> xsize; + input >> ysize; + if ((xpos + xsize <= width) && (ypos + ysize <= height)) + { + unsigned int value; + Uint16 *p = pixel + (ypos * width) + xpos; + for (unsigned long ys = 0; ys < ysize; ys++) + { + for (unsigned long xs = 0; xs < xsize; xs++) + { + while (input.get(c) && !isdigit(OFstatic_cast(unsigned char, c))); // skip non-numeric chars + input.putback(c); + input >> value; + if (value) + *p = gray; + p++; + } + p += (width - xsize); + } + return 1; + } else + OFLOG_ERROR(dcmpsprtLogger, "invalid position for overlay PBM file '" << filename); + } else + OFLOG_ERROR(dcmpsprtLogger, "overlay PBM file '" << filename << "' has no magic number P1"); + } else + OFLOG_ERROR(dcmpsprtLogger, "can't open overlay PBM file '" << filename << "'"); + } + return 0; +} + + +#define SHORTCOL 2 +#define LONGCOL 21 + +int main(int argc, char *argv[]) +{ + const char * opt_printerID = NULL; /* printer ID */ + const char * opt_cfgName = NULL; /* config read file name */ + DVPSFilmOrientation opt_filmorientation = DVPSF_default; + DVPSTrimMode opt_trim = DVPSH_default; + DVPSDecimateCropBehaviour opt_decimate = DVPSI_default; + OFCmdUnsignedInt opt_columns = 1; + OFCmdUnsignedInt opt_rows = 1; + OFCmdUnsignedInt opt_copies = 0; + OFCmdUnsignedInt opt_ovl_graylevel = 4095; + const char * opt_filmsize = NULL; + const char * opt_magnification = NULL; + const char * opt_smoothing = NULL; + const char * opt_configuration = NULL; + const char * opt_img_polarity = NULL; + const char * opt_img_request_size = NULL; + const char * opt_img_magnification = NULL; + const char * opt_img_smoothing = NULL; + const char * opt_img_configuration = NULL; + const char * opt_resolution = NULL; + const char * opt_border = NULL; + const char * opt_emptyimage = NULL; + const char * opt_maxdensity = NULL; + const char * opt_mindensity = NULL; + const char * opt_plutname = NULL; + OFList opt_filenames; + int opt_LUTshape = 0; // 0=use SCP default, 1=IDENTITY, 2=LIN OD. + OFBool opt_inverse_plut = OFFalse; + OFBool opt_spool = OFFalse; + const char * opt_mediumtype = NULL; + const char * opt_destination = NULL; + const char * opt_sessionlabel = NULL; + const char * opt_priority = NULL; + const char * opt_ownerID = NULL; + + OFBool opt_annotation = OFFalse; + OFBool opt_annotationDatetime = OFTrue; + OFBool opt_annotationPrinter = OFTrue; + OFBool opt_annotationIllumination = OFTrue; + const char * opt_annotationString = NULL; + + OFCmdUnsignedInt opt_illumination = (OFCmdUnsignedInt)-1; + OFCmdUnsignedInt opt_reflection = (OFCmdUnsignedInt)-1; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Read DICOM images and presentation states and render print job", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL + 2); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dcmfile-in", "DICOM image file(s) to be printed", OFCmdParam::PM_MultiMandatory); + + cmd.addGroup("general options:"); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("processing options:"); + cmd.addOption("--pstate", "+p", 1, "[p]state file: string", + "render the following image with pres. state p\n(this option can be specified multiple times)", OFCommandLine::AF_NoWarning); + cmd.addOption("--config", "-c", 1, "[f]ilename: string", + "process using settings from configuration file f"); + cmd.addOption("--printer", "-p", 1, "[n]ame: string (default: 1st printer in cfg file)", + "select printer with identifier n from cfg file"); + + cmd.addGroup("spooling options:"); + cmd.addOption("--spool", "-s", "spool print job to DICOM printer"); + cmd.addOption("--nospool", "do not spool print job to DICOM printer (default)"); + + cmd.addGroup("film orientation options:"); + cmd.addOption("--portrait", "set portrait orientation"); + cmd.addOption("--landscape", "set landscape orientation"); + cmd.addOption("--default-orientation", "use printer default (default)"); + + cmd.addGroup("trim (border) options:"); + cmd.addOption("--trim", "set trim on"); + cmd.addOption("--no-trim", "set trim off"); + cmd.addOption("--default-trim", "use printer default (default)"); + + cmd.addGroup("requested decimate/crop behaviour options:"); + cmd.addOption("--request-decimate", "request decimate"); + cmd.addOption("--request-crop", "request crop"); + cmd.addOption("--request-fail", "request failure"); + cmd.addOption("--default-request", "use printer default (default)"); + + cmd.addGroup("print presentation LUT options:"); + cmd.addOption("--default-plut", "do not create presentation LUT (default)"); + cmd.addOption("--identity", "set IDENTITY presentation LUT shape"); + cmd.addOption("--lin-od", "set LIN OD presentation LUT shape"); + cmd.addOption("--plut", 1, "[l]ut identifier: string", + "add LUT [l] to print job"); + cmd.addOption("--inverse-plut", "render the inverse presentation LUT into the\nbitmap of the hardcopy grayscale image"); + cmd.addOption("--illumination", 1, "[v]alue: integer (0..65535)", + "set illumination to v (in cd/m^2)"); + cmd.addOption("--reflection", 1, "[v]alue: integer (0..65535)", + "set reflected ambient light to v (in cd/m^2)"); + + cmd.addGroup("basic film session options (only with --spool):"); + cmd.addOption("--copies", 1, "[v]alue: integer (1..100, default: 1)", + "set number of copies to v"); + cmd.addOption("--medium-type", 1, "[v]alue: string", + "set medium type to v"); + cmd.addOption("--destination", 1, "[v]alue: string", + "set film destination to v"); + cmd.addOption("--label", 1, "[v]alue: string", + "set film session label to v"); + cmd.addOption("--priority", 1, "[v]alue: string", + "set print priority to v"); + cmd.addOption("--owner", 1, "[v]alue: string", + "set film session owner ID to v"); + + cmd.addGroup("annotation options:"); + cmd.addOption("--no-annotation", "do not create annotation (default)"); + cmd.addOption("--annotation", "-a", 1, "[t]ext: string", + "create annotation with text t"); + cmd.addOption("--print-date", "+pd", "prepend date/time to annotation (default)"); + cmd.addOption("--print-no-date", "-pd", "do not prepend date/time to annotation"); + + cmd.addOption("--print-name", "+pn", "prepend printer name to annotation (default)"); + cmd.addOption("--print-no-name", "-pn", "do not prepend printer name to annotation"); + + cmd.addOption("--print-lighting", "+pl", "prepend illumination to annotation (default)"); + cmd.addOption("--print-no-lighting", "-pl", "do not prepend illumination to annotation"); + + cmd.addGroup("overlay options:"); + cmd.addOption("--overlay", "+O" , 3, "[f]ilename: string, [x] [y]: integer", + "load overlay data from PBM file f and\ndisplay at position (x,y)"); + cmd.addOption("--ovl-graylevel", "+Og", 1, "[v]alue: integer (0..4095)", + "use overlay gray level v (default: 4095 = white)"); + + cmd.addGroup("other print options:"); + cmd.addOption("--layout", "-l", 2, "[c]olumns [r]ows: integer (default: 1 1)", + "use 'STANDARD\\c,r' image display format"); + cmd.addOption("--filmsize", 1, "[v]alue: string", + "set film size ID to v"); + cmd.addOption("--magnification", 1, "[v]alue: string", + "set magnification type to v"); + cmd.addOption("--smoothing", 1, "[v]alue: string", + "set smoothing type to v"); + cmd.addOption("--configinfo", 1, "[v]alue: string", + "set configuration information to v"); + cmd.addOption("--resolution", 1, "[v]alue: string", + "set requested resolution ID to v"); + cmd.addOption("--border", 1, "[v]alue: string", + "set border density to v"); + cmd.addOption("--empty-image", 1, "[v]alue: string", + "set empty image density to v"); + cmd.addOption("--max-density", 1, "[v]alue: string", + "set max density to v"); + cmd.addOption("--min-density", 1, "[v]alue: string", + "set min density to v"); + cmd.addOption("--img-polarity", 1, "[v]alue: string", + "set image box polarity to v (NORMAL or REVERSE)"); + cmd.addOption("--img-request-size", 1, "[v]alue: string", + "set requested image size to v (width in mm)"); + cmd.addOption("--img-magnification", 1, "[v]alue: string", + "set image box magnification type to v"); + cmd.addOption("--img-smoothing", 1, "[v]alue: string", + "set image box smoothing type to v"); + cmd.addOption("--img-configinfo", 1, "[v]alue: string", + "set image box configuration information to v"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* options */ + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--portrait")) opt_filmorientation = DVPSF_portrait; + if (cmd.findOption("--landscape")) opt_filmorientation = DVPSF_landscape; + if (cmd.findOption("--default-orientation")) opt_filmorientation = DVPSF_default; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--trim")) opt_trim = DVPSH_trim_on; + if (cmd.findOption("--no-trim")) opt_trim = DVPSH_trim_off; + if (cmd.findOption("--default-trim")) opt_trim = DVPSH_default; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--request-decimate")) opt_decimate = DVPSI_decimate; + if (cmd.findOption("--request-crop")) opt_decimate = DVPSI_crop; + if (cmd.findOption("--request-fail")) opt_decimate = DVPSI_fail; + if (cmd.findOption("--default-request")) opt_decimate = DVPSI_default; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--default-plut")) opt_LUTshape = 0; + if (cmd.findOption("--identity")) opt_LUTshape = 1; + if (cmd.findOption("--lin-od")) opt_LUTshape = 2; + if (cmd.findOption("--plut")) app.checkValue(cmd.getValue(opt_plutname)); + cmd.endOptionBlock(); + if (cmd.findOption("--inverse-plut")) opt_inverse_plut = OFTrue; + + cmd.beginOptionBlock(); + if (cmd.findOption("--spool")) opt_spool = OFTrue; + if (cmd.findOption("--nospool")) opt_spool = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--no-annotation")) opt_annotation = OFFalse; + if (cmd.findOption("--annotation")) + { + opt_annotation = OFTrue; + app.checkValue(cmd.getValue(opt_annotationString)); + } + cmd.endOptionBlock(); + + cmd.findOption("--overlay", 0, OFCommandLine::FOM_First); /* check at least once to avoid warnings */ + if (cmd.findOption("--ovl-graylevel")) + app.checkValue(cmd.getValueAndCheckMinMax(opt_ovl_graylevel, 0, 4095)); + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-date")) opt_annotationDatetime = OFTrue; + if (cmd.findOption("--print-no-date")) opt_annotationDatetime = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-name")) opt_annotationPrinter = OFTrue; + if (cmd.findOption("--print-no-name")) opt_annotationPrinter = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-lighting")) opt_annotationIllumination = OFTrue; + if (cmd.findOption("--print-no-lighting")) opt_annotationIllumination = OFFalse; + cmd.endOptionBlock(); + + if (cmd.findOption("--filmsize")) app.checkValue(cmd.getValue(opt_filmsize)); + if (cmd.findOption("--magnification")) app.checkValue(cmd.getValue(opt_magnification)); + if (cmd.findOption("--smoothing")) app.checkValue(cmd.getValue(opt_smoothing)); + if (cmd.findOption("--configinfo")) app.checkValue(cmd.getValue(opt_configuration)); + if (cmd.findOption("--resolution")) app.checkValue(cmd.getValue(opt_resolution)); + if (cmd.findOption("--border")) app.checkValue(cmd.getValue(opt_border)); + if (cmd.findOption("--empty-image")) app.checkValue(cmd.getValue(opt_emptyimage)); + if (cmd.findOption("--max-density")) app.checkValue(cmd.getValue(opt_maxdensity)); + if (cmd.findOption("--min-density")) app.checkValue(cmd.getValue(opt_mindensity)); + if (cmd.findOption("--config")) app.checkValue(cmd.getValue(opt_cfgName)); + if (cmd.findOption("--printer")) app.checkValue(cmd.getValue(opt_printerID)); + if (cmd.findOption("--img-polarity")) app.checkValue(cmd.getValue(opt_img_polarity)); + if (cmd.findOption("--img-request-size")) app.checkValue(cmd.getValue(opt_img_request_size)); + if (cmd.findOption("--img-magnification")) app.checkValue(cmd.getValue(opt_img_magnification)); + if (cmd.findOption("--img-smoothing")) app.checkValue(cmd.getValue(opt_img_smoothing)); + if (cmd.findOption("--img-configinfo")) app.checkValue(cmd.getValue(opt_img_configuration)); + + /* film session options */ + if (cmd.findOption("--medium-type")) + { + app.checkConflict("--medium-type", "--nospool", (! opt_spool)); + app.checkValue(cmd.getValue(opt_mediumtype)); + } + if (cmd.findOption("--illumination")) + { + app.checkValue(cmd.getValueAndCheckMinMax(opt_illumination, 0, 65535)); + } + if (cmd.findOption("--reflection")) + { + app.checkValue(cmd.getValueAndCheckMinMax(opt_reflection, 0, 65535)); + } + + if (cmd.findOption("--destination")) + { + app.checkConflict("--destination", "--nospool", (! opt_spool)); + app.checkValue(cmd.getValue(opt_destination)); + } + if (cmd.findOption("--label")) + { + app.checkConflict("--label", "--nospool", (! opt_spool)); + app.checkValue(cmd.getValue(opt_sessionlabel)); + } + if (cmd.findOption("--priority")) + { + app.checkConflict("--priority", "--nospool", (! opt_spool)); + app.checkValue(cmd.getValue(opt_priority)); + } + if (cmd.findOption("--owner")) + { + app.checkConflict("--owner", "--nospool", (! opt_spool)); + app.checkValue(cmd.getValue(opt_ownerID)); + } + if (cmd.findOption("--copies")) + { + app.checkConflict("--copies", "--nospool", (! opt_spool)); + app.checkValue(cmd.getValueAndCheckMinMax(opt_copies, 1, 100)); + } + + if (cmd.findOption("--layout")) + { + app.checkValue(cmd.getValueAndCheckMin(opt_columns, 1)); + app.checkValue(cmd.getValueAndCheckMin(opt_rows, 1)); + } + + const char *imageFile = NULL; + const char *pstateFile = NULL; + int paramCount = cmd.getParamCount(); + for (int param = 1; param <= paramCount; param++) + { + cmd.getParam(param, imageFile); + pstateFile = NULL; + if (cmd.findOption("--pstate", -param)) app.checkValue(cmd.getValue(pstateFile)); + opt_filenames.push_back(imageFile); + opt_filenames.push_back(pstateFile); + } + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmpsprtLogger, rcsid << OFendl); + + if (opt_cfgName) + { + FILE *cfgfile = fopen(opt_cfgName, "rb"); + if (cfgfile) fclose(cfgfile); else + { + OFLOG_FATAL(dcmpsprtLogger, "can't open configuration file '" << opt_cfgName << "'"); + return 10; + } + } + DVInterface dvi(opt_cfgName); + + if (opt_printerID && (EC_Normal != dvi.setCurrentPrinter(opt_printerID))) + OFLOG_WARN(dcmpsprtLogger, "unable to select printer '" << opt_printerID << "', ignoring."); + + /* dump printer characteristics if requested */ + const char *currentPrinter = dvi.getCurrentPrinter(); + + if ((opt_img_request_size) && (!dvi.getTargetPrinterSupportsRequestedImageSize(opt_printerID))) + OFLOG_WARN(dcmpsprtLogger, "printer does not support requested image size"); + + if (EC_Normal != dvi.getPrintHandler().setImageDisplayFormat(opt_columns, opt_rows)) + OFLOG_WARN(dcmpsprtLogger, "cannot set image display format to columns=" << opt_columns + << ", rows=" << opt_rows << ", ignoring."); + if ((opt_filmsize)&&(EC_Normal != dvi.getPrintHandler().setFilmSizeID(opt_filmsize))) + OFLOG_WARN(dcmpsprtLogger, "cannot set film size ID to '" << opt_filmsize << "', ignoring."); + if ((opt_magnification)&&(EC_Normal != dvi.getPrintHandler().setMagnificationType(opt_magnification))) + OFLOG_WARN(dcmpsprtLogger, "cannot set magnification type to '" << opt_magnification << "', ignoring."); + if ((opt_smoothing)&&(EC_Normal != dvi.getPrintHandler().setSmoothingType(opt_smoothing))) + OFLOG_WARN(dcmpsprtLogger, "cannot set smoothing type to '" << opt_smoothing << "', ignoring."); + if ((opt_configuration)&&(EC_Normal != dvi.getPrintHandler().setConfigurationInformation(opt_configuration))) + OFLOG_WARN(dcmpsprtLogger, "cannot set configuration information to '" << opt_configuration << "', ignoring."); + if ((opt_resolution)&&(EC_Normal != dvi.getPrintHandler().setResolutionID(opt_resolution))) + OFLOG_WARN(dcmpsprtLogger, "cannot set requested resolution ID to '" << opt_resolution << "', ignoring."); + if ((opt_border)&&(EC_Normal != dvi.getPrintHandler().setBorderDensity(opt_border))) + OFLOG_WARN(dcmpsprtLogger, "cannot set border density to '" << opt_border << "', ignoring."); + if ((opt_emptyimage)&&(EC_Normal != dvi.getPrintHandler().setEmtpyImageDensity(opt_emptyimage))) + OFLOG_WARN(dcmpsprtLogger, "cannot set empty image density to '" << opt_emptyimage << "', ignoring."); + if ((opt_maxdensity)&&(EC_Normal != dvi.getPrintHandler().setMaxDensity(opt_maxdensity))) + OFLOG_WARN(dcmpsprtLogger, "cannot set max density to '" << opt_maxdensity << "', ignoring."); + if ((opt_mindensity)&&(EC_Normal != dvi.getPrintHandler().setMinDensity(opt_mindensity))) + OFLOG_WARN(dcmpsprtLogger, "cannot set min density to '" << opt_mindensity << "', ignoring."); + if (EC_Normal != dvi.getPrintHandler().setFilmOrientation(opt_filmorientation)) + OFLOG_WARN(dcmpsprtLogger, "cannot set film orientation, ignoring."); + if (EC_Normal != dvi.getPrintHandler().setTrim(opt_trim)) + OFLOG_WARN(dcmpsprtLogger, "cannot set trim, ignoring."); + if (EC_Normal != dvi.getPrintHandler().setRequestedDecimateCropBehaviour(opt_decimate)) + OFLOG_WARN(dcmpsprtLogger, "cannot set requested decimate/crop behaviour, ignoring."); + if ((opt_illumination != (OFCmdUnsignedInt)-1)&&(EC_Normal != dvi.getPrintHandler().setPrintIllumination((Uint16)opt_illumination))) + OFLOG_WARN(dcmpsprtLogger, "cannot set illumination to '" << opt_illumination << "', ignoring."); + if ((opt_reflection != (OFCmdUnsignedInt)-1)&&(EC_Normal != dvi.getPrintHandler().setPrintReflectedAmbientLight((Uint16)opt_reflection))) + OFLOG_WARN(dcmpsprtLogger, "cannot set reflected ambient light to '" << opt_reflection << "', ignoring."); + + if ((opt_copies > 0)&&(EC_Normal != dvi.setPrinterNumberOfCopies(opt_copies))) + OFLOG_WARN(dcmpsprtLogger, "cannot set film session number of copies to '" << opt_copies << "', ignoring."); + if ((opt_mediumtype)&&(EC_Normal != dvi.setPrinterMediumType(opt_mediumtype))) + OFLOG_WARN(dcmpsprtLogger, "cannot set film session medium type to '" << opt_mediumtype << "', ignoring."); + if ((opt_destination)&&(EC_Normal != dvi.setPrinterFilmDestination(opt_destination))) + OFLOG_WARN(dcmpsprtLogger, "cannot set film destination to '" << opt_destination << "', ignoring."); + if ((opt_sessionlabel)&&(EC_Normal != dvi.setPrinterFilmSessionLabel(opt_sessionlabel))) + OFLOG_WARN(dcmpsprtLogger, "cannot set film session label to '" << opt_sessionlabel << "', ignoring."); + if ((opt_priority)&&(EC_Normal != dvi.setPrinterPriority(opt_priority))) + OFLOG_WARN(dcmpsprtLogger, "cannot set film session print priority to '" << opt_priority << "', ignoring."); + if ((opt_ownerID)&&(EC_Normal != dvi.setPrinterOwnerID(opt_ownerID))) + OFLOG_WARN(dcmpsprtLogger, "cannot set film session owner ID to '" << opt_ownerID << "', ignoring."); + if ((opt_spool)&&(EC_Normal != dvi.startPrintSpooler())) + OFLOG_WARN(dcmpsprtLogger, "unable to start print spooler, ignoring."); + + OFListIterator(const char *) first = opt_filenames.begin(); + OFListIterator(const char *) last = opt_filenames.end(); + const char *currentImage = NULL; + const char *currentPState = NULL; + OFCondition status = EC_Normal; + void *pixelData = NULL; + unsigned long width = 0; + unsigned long height = 0; + unsigned long bitmapSize = 0; + double pixelAspectRatio; + + while ((EC_Normal == status) && (first != last)) + { + currentImage = *first; + ++first; + if (first != last) + { + currentPState = *first; + ++first; + if (currentPState) + { + OFLOG_INFO(dcmpsprtLogger, "loading image file '" << currentImage << "' with presentation state '" << currentPState << "'"); + status = dvi.loadPState(currentPState, currentImage); + if (EC_Normal != status) + { + OFLOG_FATAL(dcmpsprtLogger, "loading image file '" << currentImage << "' with presentation state '" << currentPState << "' failed."); + return 10; + } + } + else + { + OFLOG_INFO(dcmpsprtLogger, "loading image file '" << currentImage << "'"); + status = dvi.loadImage(currentImage); + if (EC_Normal != status) + { + OFLOG_FATAL(dcmpsprtLogger, "loading image file '" << currentImage << "' failed."); + return 10; + } + } + + if (opt_plutname) + { + if (EC_Normal != dvi.selectDisplayPresentationLUT(opt_plutname)) + OFLOG_WARN(dcmpsprtLogger, "cannot set requested presentation LUT '" << opt_plutname << "', ignoring."); + } else { + // in the case of a Presentation LUT Shape, we set the shape inside + // the GSPS object to default (corresponding to IDENTITY for MONOCHROME2 + // and INVERSE for MONOCHROME1). This will leave our image data unaltered. + // The LIN OD shape is only activated in the print handler, not the GSPS. + if ((opt_LUTshape == 1) || (opt_LUTshape == 2)) + { + if (dvi.getCurrentPState().setDefaultPresentationLUTShape().bad()) + OFLOG_WARN(dcmpsprtLogger, "cannot set presentation LUT shape, ignoring."); + + if (opt_LUTshape == 2) + { + if (dvi.getPrintHandler().setPresentationLUTShape(DVPSP_lin_od).bad()) + OFLOG_WARN(dcmpsprtLogger, "cannot set LIN OD presentation LUT shape, ignoring."); + } + } + } + + // save grayscale hardcopy image. + bitmapSize = dvi.getCurrentPState().getPrintBitmapSize(); + pixelData = new char[bitmapSize]; + if (pixelData) + { + if (EC_Normal != dvi.getCurrentPState().getPrintBitmapWidthHeight(width, height)) + { + OFLOG_FATAL(dcmpsprtLogger, "can't determine bitmap size"); + return 10; + } + if (EC_Normal != dvi.getCurrentPState().getPrintBitmap(pixelData, bitmapSize, opt_inverse_plut)) + { + OFLOG_FATAL(dcmpsprtLogger, "can't create print bitmap"); + return 10; + } + pixelAspectRatio = dvi.getCurrentPState().getPrintBitmapPixelAspectRatio(); + + if (cmd.findOption("--overlay", 0, OFCommandLine::FOM_First)) + { + do { + const char *fn = NULL; + OFCmdUnsignedInt x, y; + app.checkValue(cmd.getValue(fn)); + app.checkValue(cmd.getValue(x)); + app.checkValue(cmd.getValue(y)); + if (fn != NULL) + addOverlay(fn, x, y, OFstatic_cast(Uint16 *, pixelData), width, height, OFstatic_cast(unsigned int, opt_ovl_graylevel)); + } while (cmd.findOption("--overlay", 0, OFCommandLine::FOM_Next)); + } + + OFLOG_INFO(dcmpsprtLogger, "writing DICOM grayscale hardcopy image to database."); + if (EC_Normal != dvi.saveHardcopyGrayscaleImage(pixelData, width, height, pixelAspectRatio)) + { + OFLOG_FATAL(dcmpsprtLogger, "error during creation of DICOM grayscale hardcopy image file"); + return 10; + } + delete[] OFstatic_cast(char *, pixelData); + } else { + OFLOG_FATAL(dcmpsprtLogger, "out of memory error: cannot allocate print bitmap"); + return 10; + } + } else { + OFLOG_FATAL(dcmpsprtLogger, "internal error - odd number of filenames"); + return 10; + } + } + + // set annotations + if (status == EC_Normal) + { + if (opt_annotation) + { + if (dvi.getTargetPrinterSupportsAnnotation(currentPrinter)) + { + dvi.setActiveAnnotation(OFTrue); + dvi.setPrependDateTime(opt_annotationDatetime); + dvi.setPrependPrinterName(opt_annotationPrinter); + dvi.setPrependLighting(opt_annotationIllumination); + dvi.setAnnotationText(opt_annotationString); + } else { + OFLOG_WARN(dcmpsprtLogger, "printer '" << currentPrinter << "' does not support annotations, ignoring."); + dvi.setActiveAnnotation(OFFalse); + } + } else { + dvi.setActiveAnnotation(OFFalse); + } + } + + if (status == EC_Normal) + { + size_t numImages = dvi.getPrintHandler().getNumberOfImages(); + for (size_t i=0; i 0)&&(! opt_spool)) + { + // no need to do this manually if we are spooling - spoolPrintJob() will do this anyway. + OFLOG_WARN(dcmpsprtLogger, "writing DICOM stored print object to database."); + if (EC_Normal != dvi.saveStoredPrint(dvi.getTargetPrinterSupportsRequestedImageSize(opt_printerID))) + { + OFLOG_ERROR(dcmpsprtLogger, "error during creation of DICOM stored print object"); + } + } + } + + if ((status == EC_Normal) && opt_spool) + { + if (currentPrinter) + { + OFLOG_INFO(dcmpsprtLogger, "spooling print job to printer '" << currentPrinter << "'"); + if (EC_Normal != dvi.spoolPrintJob()) + OFLOG_WARN(dcmpsprtLogger, "unable to spool print job to printer '" << currentPrinter << "', ignoring."); + } else { + OFLOG_WARN(dcmpsprtLogger, "no printer (undefined in config file?), cannot spool print job."); + } + } + + if ((opt_spool)&&(EC_Normal != dvi.terminatePrintSpooler())) + OFLOG_WARN(dcmpsprtLogger, "unable to stop print spooler, ignoring."); + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + + return (status != EC_Normal); +} diff --git a/dcmpstat/apps/dcmpsrcv.cc b/dcmpstat/apps/dcmpsrcv.cc new file mode 100644 index 00000000..2d108c88 --- /dev/null +++ b/dcmpstat/apps/dcmpsrcv.cc @@ -0,0 +1,1437 @@ +/* + * + * Copyright (C) 1999-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Marco Eichelberg + * + * Purpose: Presentation State Viewer - Network Receive Component (Store SCP) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* for O_RDONLY */ +#endif +#ifdef HAVE_SYS_TYPES_H +#include /* required for sys/stat.h */ +#endif +#ifdef HAVE_SYS_STAT_H +#include /* for stat, fstat */ +#endif +END_EXTERN_C + +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants */ +#include "dcmtk/dcmpstat/dvpscf.h" /* for class DVConfiguration */ +#include "dcmtk/ofstd/ofbmanip.h" /* for OFBitmanipTemplate */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" /* for LOCK_IMAGE_FILES */ +#include "dcmtk/dcmqrdb/dcmqrdbs.h" /* for DcmQueryRetrieveDatabaseStatus */ +#include "dcmtk/dcmpstat/dvpsmsg.h" /* for class DVPSIPCClient */ +#include "dcmtk/dcmnet/dcmlayer.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmpstat/dcmpstat.h" + +#ifdef WITH_OPENSSL +#include "dcmtk/dcmtls/tlstrans.h" +#include "dcmtk/dcmtls/tlslayer.h" +#endif + +#include "dcmtk/ofstd/ofstream.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmpsrcv" + +static OFLogger dcmpsrcvLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +DVPSIPCClient *messageClient = NULL; // global pointer to IPC message client, if present + + +enum associationType +{ + assoc_success, + assoc_error, + assoc_terminate +}; + +enum refuseReason +{ + ref_TooManyAssociations, + ref_CannotFork, + ref_BadAppContext, + ref_BadAEPeer, + ref_BadAEService, + ref_NoReason +}; + +static int errorCond(OFCondition cond, const char *message) +{ + int result = (cond.bad()); + if (result) + { + OFString temp_str; + OFLOG_ERROR(dcmpsrcvLogger, message << OFendl << DimseCondition::dump(temp_str, cond)); + } + return result; +} + +static void cleanChildren() +{ +#ifdef HAVE_WAITPID + int stat_loc; +#elif defined(HAVE_WAIT3) + struct rusage rusage; +#if defined(__NeXT__) + /* some systems need a union wait as argument to wait3 */ + union wait status; +#else + int status; +#endif +#endif + +#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) + int child = 1; + int options = WNOHANG; + while (child > 0) + { +#ifdef HAVE_WAITPID + child = (int)(waitpid(-1, &stat_loc, options)); +#elif defined(HAVE_WAIT3) + child = wait3(&status, options, &rusage); +#endif + if (child < 0) + { + if (errno != ECHILD) + { + char buf[256]; + OFLOG_ERROR(dcmpsrcvLogger, "wait for child failed: " << OFStandard::strerror(errno, buf, sizeof(buf))); + } + } + } +#endif +} + +static void dropAssociation(T_ASC_Association **assoc) +{ + if ((assoc == NULL)||(*assoc == NULL)) return; + OFCondition cond = ASC_dropSCPAssociation(*assoc); + errorCond(cond, "Cannot Drop Association:"); + cond = ASC_destroyAssociation(assoc); + errorCond(cond, "Cannot Destroy Association:"); + *assoc = NULL; + return; +} + + +static OFCondition +refuseAssociation(T_ASC_Association *assoc, refuseReason reason) +{ + T_ASC_RejectParameters rej; + + switch (reason) + { + case ref_TooManyAssociations: + rej.result = ASC_RESULT_REJECTEDTRANSIENT; + rej.source = ASC_SOURCE_SERVICEPROVIDER_PRESENTATION_RELATED; + rej.reason = ASC_REASON_SP_PRES_LOCALLIMITEXCEEDED; + break; + case ref_CannotFork: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEPROVIDER_PRESENTATION_RELATED; + rej.reason = ASC_REASON_SP_PRES_TEMPORARYCONGESTION; + break; + case ref_BadAppContext: + rej.result = ASC_RESULT_REJECTEDTRANSIENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED; + break; + case ref_BadAEPeer: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_CALLINGAETITLENOTRECOGNIZED; + break; + case ref_BadAEService: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_CALLEDAETITLENOTRECOGNIZED; + break; + case ref_NoReason: + default: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_NOREASON; + break; + } + + OFCondition cond = ASC_rejectAssociation(assoc, &rej); + errorCond(cond, "Association Reject Failed:"); + return cond; +} + +static associationType negotiateAssociation( + T_ASC_Network *net, + T_ASC_Association **assoc, + const char *aetitle, + unsigned long maxPDU, + OFBool opt_networkImplicitVROnly, + OFBool useTLS) +{ + associationType result = assoc_success; + char buf[BUFSIZ]; + OFBool dropAssoc = OFFalse; + + OFCondition cond = ASC_receiveAssociation(net, assoc, maxPDU, NULL, NULL, useTLS); + + if (errorCond(cond, "Failed to receive association:")) + { + dropAssoc = OFTrue; + result = assoc_error; + + if (messageClient) + { + // notify about failed association setup + OFOStringStream out; + out << "Unable to Receive DIMSE Association Request:" << OFendl << cond.text() << OFendl << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyReceivedEncryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + else messageClient->notifyReceivedUnencryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + } + else + { + OFLOG_INFO(dcmpsrcvLogger, "Association Received (" + << (*assoc)->params->DULparams.callingPresentationAddress << ":" + << (*assoc)->params->DULparams.callingAPTitle << " -> " + << (*assoc)->params->DULparams.calledAPTitle << ")"); + + ASC_setAPTitles((*assoc)->params, NULL, NULL, aetitle); + /* Application Context Name */ + cond = ASC_getApplicationContextName((*assoc)->params, buf, sizeof(buf)); + if (cond.bad() || strcmp(buf, DICOM_STDAPPLICATIONCONTEXT) != 0) + { + /* reject: the application context name is not supported */ + OFLOG_INFO(dcmpsrcvLogger, "Bad AppContextName: " << buf); + cond = refuseAssociation(*assoc, ref_BadAppContext); + + if (messageClient) + { + // notify about rejected association + OFOStringStream out; + OFString temp_str; + out << "DIMSE Association Rejected:" << OFendl + << " reason: bad application context name '" << buf << "'" << OFendl + << " calling presentation address: " << (*assoc)->params->DULparams.callingPresentationAddress << OFendl + << " calling AE title: " << (*assoc)->params->DULparams.callingAPTitle << OFendl + << " called AE title: " << (*assoc)->params->DULparams.calledAPTitle << OFendl; + out << ASC_dumpConnectionParameters(temp_str, *assoc) << OFendl; + out << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyReceivedEncryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + else messageClient->notifyReceivedUnencryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + dropAssoc = OFTrue; + result = assoc_error; + } else { + + const char *nonStorageSyntaxes[] = + { + UID_VerificationSOPClass, + UID_PrivateShutdownSOPClass + }; + + const char* transferSyntaxes[] = { NULL, NULL, NULL }; + int numTransferSyntaxes = 0; + if (opt_networkImplicitVROnly) + { + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + } else { + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + + if (gLocalByteOrder == EBO_LittleEndian) { + /* we are on a little endian machine */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + /* we are on a big endian machine */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + } + + /* accept any of the non-storage syntaxes */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( + (*assoc)->params, + (const char**)nonStorageSyntaxes, DIM_OF(nonStorageSyntaxes), + (const char**)transferSyntaxes, numTransferSyntaxes); + errorCond(cond, "Cannot accept presentation contexts:"); + + /* accept any of the storage syntaxes */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( + (*assoc)->params, + dcmAllStorageSOPClassUIDs, numberOfDcmAllStorageSOPClassUIDs, + (const char**)transferSyntaxes, numTransferSyntaxes); + errorCond(cond, "Cannot accept presentation contexts:"); + } + + /* check if we have negotiated the private "shutdown" SOP Class */ + if (0 != ASC_findAcceptedPresentationContextID(*assoc, UID_PrivateShutdownSOPClass)) + { + // we don't notify the IPC server about this incoming connection + cond = refuseAssociation(*assoc, ref_NoReason); + dropAssoc = OFTrue; + result = assoc_terminate; + } + } /* receiveAssociation successful */ + + if (dropAssoc) dropAssociation(assoc); + return result; +} + +class StoreContext +{ +public: + DcmQueryRetrieveIndexDatabaseHandle *dbHandle; + DIC_US status; + const char *fileName; + DcmFileFormat *dcmff; + OFBool opt_correctUIDPadding; + + StoreContext(DcmQueryRetrieveIndexDatabaseHandle *handle, DIC_US aStatus, const char *fname, DcmFileFormat *ff, OFBool correctUID) + : dbHandle(handle) + , status(aStatus) + , fileName(fname) + , dcmff(ff) + , opt_correctUIDPadding(correctUID) + {} + + ~StoreContext() {} + +private: + /* unimplemented */ StoreContext(const StoreContext&); + /* unimplemented */ StoreContext& operator=(const StoreContext&); +}; + +static void +checkRequestAgainstDataset( + T_DIMSE_C_StoreRQ *req, /* original store request */ + const char* fname, /* filename of dataset */ + DcmDataset *dataSet, /* dataset to check */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + OFBool opt_correctUIDPadding) +{ + DcmFileFormat ff; + if (dataSet == NULL) + { + /* load the data from file */ + if (ff.loadFile(fname).bad()) + { + OFLOG_ERROR(dcmpsrcvLogger, "Cannot open file: " << fname); + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + return; + } + dataSet = ff.getDataset(); + } + + /* which SOP class and SOP instance ? */ + DIC_UI sopClass; + DIC_UI sopInstance; + + if (!DU_findSOPClassAndInstanceInDataSet(dataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding)) + { + OFLOG_ERROR(dcmpsrcvLogger, "Bad image file: " << fname); + rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; + } + else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + else if (strcmp(sopInstance, req->AffectedSOPInstanceUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + else if (strcmp(sopClass, UID_GrayscaleSoftcopyPresentationStateStorage) == 0) + { + /* we have received a presentation state. Check if we can parse it! */ + DcmPresentationState pstate; + if (EC_Normal != pstate.read(*dataSet)) + { + OFLOG_ERROR(dcmpsrcvLogger, "Grayscale softcopy presentation state object cannot be displayed - rejected"); + rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; + } + } + return; +} + +static void +saveImageToDB( + StoreContext *context, + T_DIMSE_C_StoreRQ *req, /* original store request */ + const char *imageFileName, + /* out */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + DcmDataset **statusDetail) +{ + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + + /* Store image */ + if (context->status == STATUS_Success) + { + if (context->dbHandle->storeRequest(req->AffectedSOPClassUID, req->AffectedSOPInstanceUID, + imageFileName, &dbStatus).bad()) + { + OFLOG_ERROR(dcmpsrcvLogger, "storeSCP: Database: DB_storeRequest Failed (" + << DU_cstoreStatusString(dbStatus.status()) << ")"); + } + context->status = dbStatus.status(); + } + + rsp->DimseStatus = context->status; + *statusDetail = dbStatus.extractStatusDetail(); + return; +} + +static void +storeProgressCallback( + /* in */ + void *callbackData, + T_DIMSE_StoreProgress *progress, /* progress state */ + T_DIMSE_C_StoreRQ *req, /* original store request */ + char *imageFileName, /* being received into */ + DcmDataset **imageDataSet, /* being received into */ + /* out */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + DcmDataset **statusDetail) +{ + if (progress->state == DIMSE_StoreEnd) + { + StoreContext *context = (StoreContext *)callbackData; + if (rsp->DimseStatus == STATUS_Success) + { + if ((imageDataSet)&&(*imageDataSet)) + { + checkRequestAgainstDataset(req, NULL, *imageDataSet, rsp, context->opt_correctUIDPadding); + } else { + checkRequestAgainstDataset(req, imageFileName, NULL, rsp, context->opt_correctUIDPadding); + } + } + + if (rsp->DimseStatus == STATUS_Success) + { + if ((imageDataSet)&&(*imageDataSet)) + { + OFCondition cond = context->dcmff->saveFile(context->fileName, EXS_LittleEndianExplicit, + EET_ExplicitLength, EGL_recalcGL); + if (! cond.good()) + { + OFLOG_ERROR(dcmpsrcvLogger, "Cannot write image file: " << context->fileName); + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + + // delete incomplete file + OFStandard::deleteFile(context->fileName); + } + } + saveImageToDB(context, req, context->fileName, rsp, statusDetail); + } + } +} + +static OFCondition echoSCP(T_ASC_Association *assoc, T_DIMSE_C_EchoRQ *req, T_ASC_PresentationContextID presId) +{ + OFLOG_INFO(dcmpsrcvLogger, "Received Echo SCP RQ: MsgID " << req->MessageID); + OFCondition cond = DIMSE_sendEchoResponse(assoc, presId, req, STATUS_Success, NULL); + errorCond(cond, "echoSCP: Echo Response Failed:"); + return cond; +} + + +static OFCondition storeSCP( + T_ASC_Association *assoc, + T_DIMSE_C_StoreRQ *request, + T_ASC_PresentationContextID presId, + const char *dbfolder, + OFBool opt_bitpreserving, + OFBool opt_correctUIDPadding) +{ + OFString str; + OFLOG_INFO(dcmpsrcvLogger, "Received Store SCP:\n" << DIMSE_dumpMessage(str, *request, DIMSE_INCOMING)); + + OFCondition cond = EC_Normal; + char imageFileName[MAXPATHLEN+1]; + DcmFileFormat dcmff; + + // store SourceApplicationEntityTitle in metaheader + if (assoc && assoc->params) + { + const char *aet = assoc->params->DULparams.callingAPTitle; + if (aet) dcmff.getMetaInfo()->putAndInsertString(DCM_SourceApplicationEntityTitle, aet); + } + + DcmDataset *dset = dcmff.getDataset(); + DIC_US status = STATUS_Success; + DcmQueryRetrieveIndexDatabaseHandle *dbhandle = NULL; + + if (!dcmIsaStorageSOPClassUID(request->AffectedSOPClassUID)) + { + /* callback will send back sop class not supported status */ + status = STATUS_STORE_Refused_SOPClassNotSupported; + /* must still receive data */ + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName)); + } + else + { + dbhandle = new DcmQueryRetrieveIndexDatabaseHandle(dbfolder, PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, cond); + if (cond.bad()) + { + OFLOG_ERROR(dcmpsrcvLogger, "Unable to access database '" << dbfolder << "'"); + /* must still receive data */ + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName)); + /* callback will send back out of resources status */ + status = STATUS_STORE_Refused_OutOfResources; + dbhandle = NULL; + } + else + { + if (dbhandle->makeNewStoreFileName( + request->AffectedSOPClassUID, + request->AffectedSOPInstanceUID, + imageFileName, sizeof(imageFileName)).bad()) + { + OFLOG_ERROR(dcmpsrcvLogger, "storeSCP: Database: DB_makeNewStoreFileName Failed"); + /* must still receive data */ + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName)); + /* callback will send back out of resources status */ + status = STATUS_STORE_Refused_OutOfResources; + } + } + } + +#ifdef LOCK_IMAGE_FILES + /* exclusively lock image file, but only on Unix systems - + * on Win32 we would prevent ourselves from writing the file! + */ +#ifdef O_BINARY + int lockfd = open(imageFileName, (O_WRONLY | O_CREAT | O_TRUNC | O_BINARY), 0666); +#else + int lockfd = open(imageFileName, (O_WRONLY | O_CREAT | O_TRUNC), 0666); +#endif + + dcmtk_flock(lockfd, LOCK_EX); +#endif + + /* we must still retrieve the data set even if some error has occured */ + StoreContext context(dbhandle, status, imageFileName, &dcmff, opt_correctUIDPadding); + + if (opt_bitpreserving) + { + cond = DIMSE_storeProvider(assoc, presId, request, imageFileName, 1, + NULL, storeProgressCallback, + (void*)&context, DIMSE_BLOCKING, 0); + } else { + cond = DIMSE_storeProvider(assoc, presId, request, (char *)NULL, 1, + &dset, storeProgressCallback, + (void*)&context, DIMSE_BLOCKING, 0); + } + errorCond(cond, "Store SCP Failed:"); + + if (cond.bad() || (context.status != STATUS_Success)) + { + /* remove file */ + OFLOG_INFO(dcmpsrcvLogger, "Store SCP: Deleting Image File: " << imageFileName); + OFStandard::deleteFile(imageFileName); + if (dbhandle) dbhandle->pruneInvalidRecords(); + } + +#ifdef LOCK_IMAGE_FILES + /* unlock image file */ + dcmtk_flock(lockfd, LOCK_UN); + close(lockfd); +#endif + + /* free DB handle */ + delete dbhandle; + + if (messageClient) + { + OFOStringStream out; + Uint32 operationStatus = DVPSIPCMessage::statusError; + if (cond.good()) + { + if (context.status == STATUS_Success) operationStatus = DVPSIPCMessage::statusOK; + else operationStatus = DVPSIPCMessage::statusWarning; + } + const char *sopClassName = dcmFindNameOfUID(request->AffectedSOPClassUID); + const char *successName = "failed"; + if (operationStatus == DVPSIPCMessage::statusOK) successName = "successful"; + if (sopClassName==NULL) sopClassName = request->AffectedSOPClassUID; + + out << "DICOM C-STORE receipt " << successName << ": " << OFendl + << "\tSOP class UID : " << sopClassName << OFendl + << "\tSOP instance UID : " << request->AffectedSOPInstanceUID << OFendl; + + if (operationStatus == DVPSIPCMessage::statusOK) + { + unsigned long fileSize = 0; + struct stat fileStat; + if (0 == stat(imageFileName, &fileStat)) fileSize = fileStat.st_size; + out + << "\tTarget file path : " << imageFileName << OFendl + << "\tTarget file size (kB) : " << (fileSize+1023)/1024 << OFendl; + } + + out << "\tDIMSE presentation ctx : " << (int)presId << OFendl + << "\tDIMSE message ID : " << request->MessageID << OFendl + << "\tDIMSE status : " << DU_cstoreStatusString(context.status) << OFendl + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + messageClient->notifyReceivedDICOMObject(operationStatus, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + + return cond; +} + +static void handleClient( + T_ASC_Association **assoc, + const char *dbfolder, + OFBool opt_bitpreserving, + OFBool useTLS, + OFBool opt_correctUIDPadding) +{ + OFCondition cond = ASC_acknowledgeAssociation(*assoc); + if (! errorCond(cond, "Cannot acknowledge association:")) + { + OFLOG_INFO(dcmpsrcvLogger, "Association Acknowledged (Max Send PDV: " << (*assoc)->sendPDVLength << ")" + << (ASC_countAcceptedPresentationContexts((*assoc)->params) == 0 ? " (but no valid presentation contexts)" : "")); + + if (messageClient) + { + // notify about successfully negotiated association + OFOStringStream out; + OFString temp_str; + out << "DIMSE Association Acknowledged:" << OFendl + << " calling presentation address: " << (*assoc)->params->DULparams.callingPresentationAddress << OFendl + << " calling AE title: " << (*assoc)->params->DULparams.callingAPTitle << OFendl + << " called AE title: " << (*assoc)->params->DULparams.calledAPTitle << OFendl + << " max send PDV: " << (*assoc)->sendPDVLength << OFendl + << " presentation contexts: " << ASC_countAcceptedPresentationContexts((*assoc)->params) << OFendl; + out << ASC_dumpConnectionParameters(temp_str, *assoc) << OFendl; + out << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyReceivedEncryptedDICOMConnection(DVPSIPCMessage::statusOK, theString); + else messageClient->notifyReceivedUnencryptedDICOMConnection(DVPSIPCMessage::statusOK, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + + T_DIMSE_Message msg; + T_ASC_PresentationContextID presID; + cond = EC_Normal; + + /* do real work */ + while (cond.good()) + { + cond = DIMSE_receiveCommand(*assoc, DIMSE_BLOCKING, 0, &presID, &msg, NULL); + /* did peer release, abort, or do we have a valid message ? */ + + if (cond.good()) + { + /* process command */ + switch (msg.CommandField) + { + case DIMSE_C_ECHO_RQ: + cond = echoSCP(*assoc, &msg.msg.CEchoRQ, presID); + break; + case DIMSE_C_STORE_RQ: + cond = storeSCP(*assoc, &msg.msg.CStoreRQ, presID, dbfolder, opt_bitpreserving, opt_correctUIDPadding); + break; + default: + cond = DIMSE_BADCOMMANDTYPE; /* unsupported command */ + OFLOG_ERROR(dcmpsrcvLogger, "Cannot handle command: 0x" << STD_NAMESPACE hex << (unsigned)msg.CommandField); + break; + } + } + else + { + /* finish processing loop */ + } + } /* while */ + + /* close association */ + if (cond == DUL_PEERREQUESTEDRELEASE) + { + OFLOG_INFO(dcmpsrcvLogger, "Association Release"); + cond = ASC_acknowledgeRelease(*assoc); + errorCond(cond, "Cannot release association:"); + if (messageClient) messageClient->notifyConnectionClosed(DVPSIPCMessage::statusOK); + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + OFLOG_INFO(dcmpsrcvLogger, "Association Aborted"); + if (messageClient) messageClient->notifyConnectionAborted(DVPSIPCMessage::statusWarning, "DIMSE association aborted by remote peer"); + } + else + { + errorCond(cond, "DIMSE Failure (aborting association):"); + cond = ASC_abortAssociation(*assoc); + errorCond(cond, "Cannot abort association:"); + if (messageClient) messageClient->notifyConnectionAborted(DVPSIPCMessage::statusError, "DIMSE failure, aborting association"); + } + } + dropAssociation(assoc); +} + +static void terminateAllReceivers(DVConfiguration& dvi) +{ + OFLOG_INFO(dcmpsrcvLogger, "Terminating all receivers"); + + const char *recID=NULL; + const char *recAETitle=NULL; + unsigned short recPort=0; + OFBool recUseTLS=OFFalse; + T_ASC_Network *net=NULL; + T_ASC_Parameters *params=NULL; + DIC_NODENAME peerHost; + T_ASC_Association *assoc=NULL; + OFBool prepared = OFTrue; + const char *xfer = UID_LittleEndianImplicitTransferSyntax; + +#ifdef WITH_OPENSSL + /* TLS directory */ + const char *current = NULL; + const char *tlsFolder = dvi.getTLSFolder(); + if (tlsFolder==NULL) tlsFolder = "."; + + /* key file format */ + DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM; + if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_PEM; +#endif + + if ((ASC_initializeNetwork(NET_REQUESTOR, 0, 30, &net).bad())) return; + + Uint32 numReceivers = dvi.getNumberOfTargets(DVPSE_receiver); + for (Uint32 i=0; isetTLSProfile(tlsProfile); + (void) tLayer->activateCipherSuites(); + + if (tlsCACertificateFolder) tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat); + if (tlsDHParametersFile.size() > 0) tLayer->setTempDHParameters(tlsDHParametersFile.c_str()); + tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console + tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat); + tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat); + tLayer->setCertificateVerification(DCV_ignoreCertificate); + ASC_setTransportLayer(net, tLayer, 1); + } +#else + prepared = OFFalse; +#endif + } else { + DcmTransportLayer *dLayer = new DcmTransportLayer(); + ASC_setTransportLayer(net, dLayer, 1); + } + if (prepared && recAETitle && (recPort > 0)) + { + if ((ASC_createAssociationParameters(¶ms, DEFAULT_MAXPDU)).good()) + { + ASC_setTransportLayerType(params, recUseTLS); + ASC_setAPTitles(params, dvi.getNetworkAETitle(), recAETitle, NULL); + sprintf(peerHost, "%s:%d", "localhost", (int)recPort); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), peerHost); + // we propose only the "shutdown" SOP class in implicit VR + ASC_addPresentationContext(params, 1, UID_PrivateShutdownSOPClass, &xfer, 1); + // request shutdown association, abort if some strange peer accepts it + if (ASC_requestAssociation(net, params, &assoc).good()) ASC_abortAssociation(assoc); + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + } + } + } /* for loop */ + + ASC_dropNetwork(&net); + OFStandard::shutdownNetwork(); + return; +} + + +// ******************************************** + +#define SHORTCOL 3 +#define LONGCOL 12 + +int main(int argc, char *argv[]) +{ + OFStandard::initializeNetwork(); +#ifdef WITH_OPENSSL + DcmTLSTransportLayer::initializeOpenSSL(); +#endif + + int opt_terminate = 0; /* default: no terminate mode */ + const char *opt_cfgName = NULL; /* config file name */ + const char *opt_cfgID = NULL; /* name of entry in config file */ + + dcmDisableGethostbyaddr.set(OFTrue); // disable hostname lookup + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Network receive for presentation state viewer", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 2); + + cmd.addParam("config-file", "configuration file to be read"); + cmd.addParam("receiver-id", "identifier of receiver in config file", OFCmdParam::PM_Optional); + + cmd.addGroup("general options:"); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--terminate", "-t", "terminate all running receivers"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_OPENSSL) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef WITH_OPENSSL + COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl; +#endif + return 0; + } + } + + /* command line parameters and options */ + cmd.getParam(1, opt_cfgName); + if (cmd.getParamCount() >= 2) cmd.getParam(2, opt_cfgID); + if (cmd.findOption("--terminate")) opt_terminate = 1; + + OFLog::configureFromCommandLine(cmd, app); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmpsrcvLogger, rcsid << OFendl); + + if ((opt_cfgID == 0)&&(! opt_terminate)) + { + OFLOG_FATAL(dcmpsrcvLogger, "parameter receiver-id required unless --terminate is specified"); + return 10; + } + + if (opt_cfgName) + { + FILE *cfgfile = fopen(opt_cfgName, "rb"); + if (cfgfile) fclose(cfgfile); else + { + OFLOG_FATAL(dcmpsrcvLogger, "can't open configuration file '" << opt_cfgName << "'"); + return 10; + } + } else { + OFLOG_FATAL(dcmpsrcvLogger, "missing configuration file name"); + return 10; + } + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmpsrcvLogger, "no data dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + DVConfiguration dvi(opt_cfgName); + if (opt_terminate) + { + terminateAllReceivers(dvi); + return 0; // application terminates here + } + + /* get network configuration from configuration file */ + OFBool networkImplicitVROnly = dvi.getTargetImplicitOnly(opt_cfgID); + OFBool networkBitPreserving = dvi.getTargetBitPreservingMode(opt_cfgID); + OFBool opt_correctUIDPadding = dvi.getTargetCorrectUIDPadding(opt_cfgID); + OFBool networkDisableNewVRs = dvi.getTargetDisableNewVRs(opt_cfgID); + unsigned short networkPort = dvi.getTargetPort(opt_cfgID); + unsigned long networkMaxPDU = dvi.getTargetMaxPDU(opt_cfgID); + const char *networkAETitle = dvi.getTargetAETitle(opt_cfgID); + if (networkAETitle==NULL) networkAETitle = dvi.getNetworkAETitle(); + unsigned short messagePort = dvi.getMessagePort(); /* port number for IPC */ + OFBool keepMessagePortOpen = dvi.getMessagePortKeepOpen(); + OFBool useTLS = dvi.getTargetUseTLS(opt_cfgID); + OFBool notifyTermination = OFTrue; // notify IPC server of application termination +#ifdef WITH_OPENSSL + /* TLS directory */ + const char *current = NULL; + const char *tlsFolder = dvi.getTLSFolder(); + if (tlsFolder==NULL) tlsFolder = "."; + + /* certificate file */ + OFString tlsCertificateFile(tlsFolder); + tlsCertificateFile += PATH_SEPARATOR; + current = dvi.getTargetCertificate(opt_cfgID); + if (current) tlsCertificateFile += current; else tlsCertificateFile += "sitecert.pem"; + + /* private key file */ + OFString tlsPrivateKeyFile(tlsFolder); + tlsPrivateKeyFile += PATH_SEPARATOR; + current = dvi.getTargetPrivateKey(opt_cfgID); + if (current) tlsPrivateKeyFile += current; else tlsPrivateKeyFile += "sitekey.pem"; + + /* private key password */ + const char *tlsPrivateKeyPassword = dvi.getTargetPrivateKeyPassword(opt_cfgID); + + /* certificate verification */ + DcmCertificateVerification tlsCertVerification = DCV_requireCertificate; + switch (dvi.getTargetPeerAuthentication(opt_cfgID)) + { + case DVPSQ_require: + tlsCertVerification = DCV_requireCertificate; + break; + case DVPSQ_verify: + tlsCertVerification = DCV_checkCertificate; + break; + case DVPSQ_ignore: + tlsCertVerification = DCV_ignoreCertificate; + break; + } + + /* DH parameter file */ + OFString tlsDHParametersFile; + current = dvi.getTargetDiffieHellmanParameters(opt_cfgID); + if (current) + { + tlsDHParametersFile = tlsFolder; + tlsDHParametersFile += PATH_SEPARATOR; + tlsDHParametersFile += current; + } + + /* random seed file */ + OFString tlsRandomSeedFile(tlsFolder); + tlsRandomSeedFile += PATH_SEPARATOR; + current = dvi.getTargetRandomSeed(opt_cfgID); + if (current) tlsRandomSeedFile += current; else tlsRandomSeedFile += "siteseed.bin"; + + /* CA certificate directory */ + const char *tlsCACertificateFolder = dvi.getTLSCACertificateFolder(); + if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = "."; + + /* key file format */ + DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM; + if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1; + +#else + if (useTLS) + { + OFLOG_FATAL(dcmpsrcvLogger, "not compiled with OpenSSL, cannot use TLS"); + return 10; + } +#endif + + if (networkAETitle==NULL) + { + OFLOG_FATAL(dcmpsrcvLogger, "no application entity title"); + return 10; + } + + if (networkPort==0) + { + OFLOG_FATAL(dcmpsrcvLogger, "no or invalid port number"); + return 10; + } + +#ifndef DISABLE_PORT_PERMISSION_CHECK +#ifdef HAVE_GETEUID + /* if port is privileged we must be as well */ + if ((networkPort < 1024)&&(geteuid() != 0)) + { + OFLOG_FATAL(dcmpsrcvLogger, "cannot listen on port " << networkPort << ", insufficient privileges"); + return 10; + } +#endif +#endif + + if (networkMaxPDU==0) networkMaxPDU = DEFAULT_MAXPDU; + else if (networkMaxPDU > ASC_MAXIMUMPDUSIZE) + { + OFLOG_FATAL(dcmpsrcvLogger, "max PDU size " << networkMaxPDU << " too big, using default: " << DEFAULT_MAXPDU); + networkMaxPDU = DEFAULT_MAXPDU; + } + + if (networkDisableNewVRs) + { + dcmDisableGenerationOfNewVRs(); + } + + OFOStringStream verboseParameters; + + OFBool comma=OFFalse; + verboseParameters << "Network parameters:" << OFendl + << " port : " << networkPort << OFendl + << " aetitle : " << networkAETitle << OFendl + << " max pdu : " << networkMaxPDU << OFendl + << " options : "; + if (networkImplicitVROnly) + { + if (comma) verboseParameters << ", "; else comma=OFTrue; + verboseParameters << "implicit xfer syntax only"; + } + if (networkBitPreserving) + { + if (comma) verboseParameters << ", "; else comma=OFTrue; + verboseParameters << "bit-preserving receive mode"; + } + if (networkDisableNewVRs) + { + if (comma) verboseParameters << ", "; else comma=OFTrue; + verboseParameters << "disable post-1993 VRs"; + } + if (!comma) verboseParameters << "none"; + verboseParameters << OFendl; + verboseParameters << " TLS : "; + if (useTLS) verboseParameters << "enabled" << OFendl; else verboseParameters << "disabled" << OFendl; + + /* check if we can get access to the database */ + const char *dbfolder = dvi.getDatabaseFolder(); + + OFLOG_INFO(dcmpsrcvLogger, "Using database in directory '" << dbfolder << "'"); + + OFCondition cond2 = EC_Normal; + DcmQueryRetrieveIndexDatabaseHandle *dbhandle = new DcmQueryRetrieveIndexDatabaseHandle(dbfolder, PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, cond2); + delete dbhandle; + + if (cond2.bad()) + { + OFLOG_FATAL(dcmpsrcvLogger, "Unable to access database '" << dbfolder << "'"); + return 1; + } + + T_ASC_Network *net = NULL; /* the DICOM network and listen port */ + T_ASC_Association *assoc = NULL; /* the DICOM association */ + OFBool finished1 = OFFalse; + OFBool finished2 = OFFalse; + int connected = 0; + OFCondition cond = EC_Normal; + +#ifdef WITH_OPENSSL + + DcmTLSTransportLayer *tLayer = NULL; + if (useTLS) + { + tLayer = new DcmTLSTransportLayer(NET_ACCEPTOR, tlsRandomSeedFile.c_str(), OFFalse); + if (tLayer == NULL) + { + OFLOG_FATAL(dcmpsrcvLogger, "unable to create TLS transport layer"); + return 1; + } + + // determine TLS profile + OFString profileName; + const char *profileNamePtr = dvi.getTargetTLSProfile(opt_cfgID); + if (profileNamePtr) profileName = profileNamePtr; + DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195; // default + if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195; + else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND; + else if (profileName == "AES") tlsProfile = TSP_Profile_AES; + else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic; + else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted; + else + { + OFLOG_WARN(dcmpsrcvLogger, "unknown TLS profile '" << profileName << "', ignoring"); + } + + if (TCS_ok != tLayer->setTLSProfile(tlsProfile)) + { + OFLOG_FATAL(dcmpsrcvLogger, "unable to select the TLS security profile"); + return 1; + } + + // activate cipher suites + if (TCS_ok != tLayer->activateCipherSuites()) + { + OFLOG_FATAL(dcmpsrcvLogger, "unable to activate the selected list of TLS ciphersuites"); + return 1; + } + + if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat))) + { + OFLOG_WARN(dcmpsrcvLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring"); + } + if ((tlsDHParametersFile.size() > 0) && ! (tLayer->setTempDHParameters(tlsDHParametersFile.c_str()))) + { + OFLOG_WARN(dcmpsrcvLogger, "unable to load temporary DH parameter file '" << tlsDHParametersFile << "', ignoring"); + } + tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console + + if (TCS_ok != tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmpsrcvLogger, "unable to load private TLS key from '" << tlsPrivateKeyFile<< "'"); + return 1; + } + if (TCS_ok != tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmpsrcvLogger, "unable to load certificate from '" << tlsCertificateFile << "'"); + return 1; + } + if (! tLayer->checkPrivateKeyMatchesCertificate()) + { + OFLOG_FATAL(dcmpsrcvLogger, "private key '" << tlsPrivateKeyFile << "' and certificate '" << tlsCertificateFile << "' do not match"); + return 1; + } + + tLayer->setCertificateVerification(tlsCertVerification); + + } + + if (useTLS) + { + OFString cslist; + if (tLayer) tLayer->getListOfCipherSuitesForOpenSSL(cslist); + verboseParameters << " TLS certificate : " << tlsCertificateFile << OFendl + << " TLS key file : " << tlsPrivateKeyFile << OFendl + << " TLS DH params : " << tlsDHParametersFile << OFendl + << " TLS PRNG seed : " << tlsRandomSeedFile << OFendl + << " TLS CA directory: " << tlsCACertificateFolder << OFendl + << " TLS ciphersuites: " << cslist << OFendl + << " TLS key format : "; + if (keyFileFormat == DCF_Filetype_PEM) verboseParameters << "PEM" << OFendl; else verboseParameters << "DER" << OFendl; + verboseParameters << " TLS cert verify : "; + switch (tlsCertVerification) + { + case DCV_checkCertificate: + verboseParameters << "verify" << OFendl; + break; + case DCV_ignoreCertificate: + verboseParameters << "ignore" << OFendl; + break; + default: + verboseParameters << "require" << OFendl; + break; + } + } +#endif + + verboseParameters << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(verboseParameters, verboseParametersString) + OFLOG_INFO(dcmpsrcvLogger, verboseParametersString); + + while (!finished1) + { + /* open listen socket */ + cond = ASC_initializeNetwork(NET_ACCEPTOR, networkPort, 30, &net); + if (errorCond(cond, "Error initialising network:")) + { + return 1; + } + +#ifdef WITH_OPENSSL + if (tLayer) + { + cond = ASC_setTransportLayer(net, tLayer, 0); + if (cond.bad()) + { + OFString temp_str; + OFLOG_FATAL(dcmpsrcvLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + } +#endif + + /* drop root privileges now and revert to the calling user id (if we are running as setuid root) */ + if (OFStandard::dropPrivileges().bad()) + { + OFLOG_FATAL(dcmpsrcvLogger, "setuid() failed, maximum number of processes/threads for uid already running."); + return 1; + } + +#ifdef HAVE_FORK + int timeout=1; +#else + int timeout=1000; +#endif + while (!finished2) + { + /* now we connect to the IPC server and request an application ID */ + if (messageClient) // on Unix, re-initialize for each connect which is later inherited by the forked child + { + delete messageClient; + messageClient = NULL; + } + if (messagePort > 0) + { + messageClient = new DVPSIPCClient(DVPSIPCMessage::clientStoreSCP, verboseParametersString, messagePort, keepMessagePortOpen); + if (! messageClient->isServerActive()) + { + OFLOG_WARN(dcmpsrcvLogger, "no IPC message server found at port " << messagePort << ", disabling IPC"); + } + } + connected = 0; + while (!connected) + { + connected = ASC_associationWaiting(net, timeout); + if (!connected) cleanChildren(); + } + switch (negotiateAssociation(net, &assoc, networkAETitle, networkMaxPDU, networkImplicitVROnly, useTLS)) + { + case assoc_error: + // association has already been deleted, we just wait for the next client to connect. + break; + case assoc_terminate: + finished2=OFTrue; + finished1=OFTrue; + notifyTermination = OFFalse; // IPC server will probably already be down + cond = ASC_dropNetwork(&net); + if (errorCond(cond, "Error dropping network:")) return 1; + break; + case assoc_success: +#ifdef HAVE_FORK + // Unix version - call fork() + int pid; + pid = (int)(fork()); + if (pid < 0) + { + char buf[256]; + OFLOG_ERROR(dcmpsrcvLogger, "Cannot create association sub-process: " << OFStandard::strerror(errno, buf, sizeof(buf))); + refuseAssociation(assoc, ref_CannotFork); + + if (messageClient) + { + // notify about rejected association + OFOStringStream out; + OFString temp_str; + out << "DIMSE Association Rejected:" << OFendl + << " reason: cannot create association sub-process: " << OFStandard::strerror(errno, buf, sizeof(buf)) << OFendl + << " calling presentation address: " << assoc->params->DULparams.callingPresentationAddress << OFendl + << " calling AE title: " << assoc->params->DULparams.callingAPTitle << OFendl + << " called AE title: " << assoc->params->DULparams.calledAPTitle << OFendl; + out << ASC_dumpConnectionParameters(temp_str, assoc) << OFendl; + out << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyReceivedEncryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + else messageClient->notifyReceivedUnencryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + dropAssociation(&assoc); + } else if (pid > 0) + { + /* parent process */ + assoc = NULL; + } else { + /* child process */ + +#ifdef WITH_OPENSSL + // a generated UID contains the process ID and current time. + // Adding it to the PRNG seed guarantees that we have different seeds for + // different child processes. + char randomUID[65]; + dcmGenerateUniqueIdentifier(randomUID); + if (tLayer) tLayer->addPRNGseed(randomUID, strlen(randomUID)); +#endif + handleClient(&assoc, dbfolder, networkBitPreserving, useTLS, opt_correctUIDPadding); + finished2=OFTrue; + finished1=OFTrue; + } +#else + // Windows version - call CreateProcess() + finished2=OFTrue; + cond = ASC_dropNetwork(&net); + if (errorCond(cond, "Error dropping network:")) + { + if (messageClient) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + delete messageClient; + } + return 1; + } + + // initialize startup info + const char *receiver_application = dvi.getReceiverName(); + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + sprintf(commandline, "%s %s %s", receiver_application, opt_cfgName, opt_cfgID); +#ifdef DEBUG + if (CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { +#ifdef WITH_OPENSSL + // a generated UID contains the process ID and current time. + // Adding it to the PRNG seed guarantees that we have different seeds for + // different child processes. + char randomUID[65]; + dcmGenerateUniqueIdentifier(randomUID); + if (tLayer) tLayer->addPRNGseed(randomUID, strlen(randomUID)); +#endif + handleClient(&assoc, dbfolder, networkBitPreserving, useTLS, opt_correctUIDPadding); + finished1=OFTrue; + } else { + OFLOG_ERROR(dcmpsrcvLogger, "Cannot execute command line: " << commandline); + refuseAssociation(assoc, ref_CannotFork); + + if (messageClient) + { + // notify about rejected association + OFOStringStream out; + out << "DIMSE Association Rejected:" << OFendl + << " reason: cannot execute command line: " << commandline << OFendl + << " calling presentation address: " << assoc->params->DULparams.callingPresentationAddress << OFendl + << " calling AE title: " << assoc->params->DULparams.callingAPTitle << OFendl + << " called AE title: " << assoc->params->DULparams.calledAPTitle << OFendl; + ASC_dumpConnectionParameters(assoc, out); + out << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyReceivedEncryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + else messageClient->notifyReceivedUnencryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + + dropAssociation(&assoc); + } +#endif + break; + } + } // finished2 + } // finished1 + cleanChildren(); + + // tell the IPC server that we're going to terminate. + // We need to do this before we shutdown WinSock. + if (messageClient && notifyTermination) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusOK); + delete messageClient; + } + + OFStandard::shutdownNetwork(); + +#ifdef WITH_OPENSSL + if (tLayer) + { + if (tLayer->canWriteRandomSeed()) + { + if (!tLayer->writeRandomSeed(tlsRandomSeedFile.c_str())) + { + OFLOG_WARN(dcmpsrcvLogger, "cannot write back random seed file '" << tlsRandomSeedFile << "', ignoring"); + } + } else { + OFLOG_WARN(dcmpsrcvLogger, "cannot write back random seed, ignoring"); + } + } + delete tLayer; +#endif + + OFSTRINGSTREAM_FREESTR(verboseParametersString) + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + + return 0; +} diff --git a/dcmpstat/apps/dcmpssnd.cc b/dcmpstat/apps/dcmpssnd.cc new file mode 100644 index 00000000..3af86485 --- /dev/null +++ b/dcmpstat/apps/dcmpssnd.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 1999-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Marco Eichelberg + * + * Purpose: Presentation State Viewer - Network Send Component (Store SCU) + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* for O_RDONLY */ +#endif +#ifdef HAVE_SYS_TYPES_H +#include /* required for sys/stat.h */ +#endif +#ifdef HAVE_SYS_STAT_H +#include /* for stat, fstat */ +#endif +END_EXTERN_C + +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants */ +#include "dcmtk/dcmpstat/dvpscf.h" /* for class DVConfiguration */ +#include "dcmtk/ofstd/ofbmanip.h" /* for OFBitmanipTemplate */ +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ +#include "dcmtk/dcmqrdb/dcmqrdbi.h" /* for LOCK_IMAGE_FILES */ +#include "dcmtk/dcmqrdb/dcmqrdbs.h" /* for DcmQueryRetrieveDatabaseStatus */ +#include "dcmtk/dcmpstat/dvpsmsg.h" + +#ifdef WITH_OPENSSL +#include "dcmtk/dcmtls/tlstrans.h" +#include "dcmtk/dcmtls/tlslayer.h" +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#include "dcmtk/ofstd/ofstream.h" + +#define OFFIS_CONSOLE_APPLICATION "dcmpssnd" + +static OFLogger dcmpssndLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +DVPSIPCClient *messageClient = NULL; // global pointer to IPC message client, if present + +/** sends a single DICOM instance over an association which must be already established. + * @param assoc DICOM network association + * @param sopClass SOP Class UID of the image (used for the C-Store-RQ) + * @param sopInstance SOP Instance UID of the image (used for the C-Store-RQ) + * @param imgFile path to the image file to be transmitted + * @return EC_Normal if successful, a different DIMSE code otherwise. + */ +static OFCondition sendImage(T_ASC_Association *assoc, const char *sopClass, const char *sopInstance, const char *imgFile) +{ + DcmDataset *statusDetail = NULL; + T_ASC_PresentationContextID presId=0; + T_DIMSE_C_StoreRQ req; + T_DIMSE_C_StoreRSP rsp; + + if (assoc == NULL) return DIMSE_NULLKEY; + if ((sopClass == NULL)||(strlen(sopClass) == 0)) return DIMSE_NULLKEY; + if ((sopInstance == NULL)||(strlen(sopInstance) == 0)) return DIMSE_NULLKEY; + if ((imgFile == NULL)||(strlen(imgFile) == 0)) return DIMSE_NULLKEY; + +#ifdef LOCK_IMAGE_FILES + /* shared lock image file */ +#ifdef O_BINARY + int lockfd = open(imgFile, O_RDONLY | O_BINARY, 0666); +#else + int lockfd = open(imgFile, O_RDONLY, 0666); +#endif + if (lockfd < 0) + { + OFLOG_INFO(dcmpssndLogger, "unable to lock image file '" << imgFile << "'"); + return DIMSE_BADDATA; + } + dcmtk_flock(lockfd, LOCK_SH); +#endif + + /* which presentation context should be used */ + presId = ASC_findAcceptedPresentationContextID(assoc, sopClass); + if (presId == 0) + { + OFLOG_INFO(dcmpssndLogger, "no presentation context for: (" + << dcmSOPClassUIDToModality(sopClass, "OT") << ") " << sopClass); + if (messageClient) + { + OFString buf("unable to send image: no presentation context for "); + const char *sopClassName = dcmFindNameOfUID(sopClass); + if (sopClassName == NULL) buf.append(sopClass); else buf.append(sopClassName); + buf.append("\n"); + messageClient->notifySentDICOMObject(DVPSIPCMessage::statusWarning, buf.c_str()); + } + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + /* start store */ + OFBitmanipTemplate::zeroMem((char *)&req, sizeof(req)); + req.MessageID = assoc->nextMsgID++; + + OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID)); + OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, sizeof(req.AffectedSOPInstanceUID)); + req.DataSetType = DIMSE_DATASET_PRESENT; + req.Priority = DIMSE_PRIORITY_MEDIUM; + + OFCondition cond = DIMSE_storeUser(assoc, presId, &req, + imgFile, NULL, NULL, NULL, DIMSE_BLOCKING, 0, &rsp, &statusDetail); + +#ifdef LOCK_IMAGE_FILES + /* unlock image file */ + dcmtk_flock(lockfd, LOCK_UN); + close(lockfd); +#endif + + if (cond.good()) + { + OFLOG_INFO(dcmpssndLogger, "[MsgID " << req.MessageID << "] Complete [Status: " + << DU_cstoreStatusString(rsp.DimseStatus) << "]"); + } else { + OFString temp_str; + OFLOG_INFO(dcmpssndLogger, "[MsgID " << req.MessageID << "] Failed [Status: " + << DU_cstoreStatusString(rsp.DimseStatus) << "]\n" << DimseCondition::dump(temp_str, cond)); + } + if (statusDetail) delete statusDetail; + + if (messageClient) + { + OFOStringStream out; + Uint32 operationStatus = DVPSIPCMessage::statusError; + if (cond.good()) + { + if (rsp.DimseStatus == STATUS_Success) operationStatus = DVPSIPCMessage::statusOK; + else operationStatus = DVPSIPCMessage::statusWarning; + } + const char *sopClassName = dcmFindNameOfUID(sopClass); + const char *successName = "failed"; + if (operationStatus == DVPSIPCMessage::statusOK) successName = "successful"; + if (sopClassName==NULL) sopClassName = sopClass; + unsigned long fileSize = 0; + struct stat fileStat; + if (0 == stat(imgFile, &fileStat)) fileSize = fileStat.st_size; + out << "DICOM C-STORE transmission " << successName << ": " << OFendl + << "\tSOP class UID : " << sopClassName << OFendl + << "\tSOP instance UID : " << sopInstance << OFendl + << "\tSource file path : " << imgFile << OFendl + << "\tSource file size (kB) : " << (fileSize+1023)/1024 << OFendl + << "\tDIMSE presentation ctx : " << (int)presId << OFendl + << "\tDIMSE message ID : " << req.MessageID << OFendl + << "\tDIMSE status : " << DU_cstoreStatusString(rsp.DimseStatus) << OFendl + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + messageClient->notifySentDICOMObject(operationStatus, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + return cond; +} + +/** sends a complete DICOM study, series or a single instance + * over an association which must be already established. + * The instances (files) to be transmitted are derived from the database. + * @param handle open database handle + * @param assoc DICOM network association + * @param studyUID Study Instance UID of the study/series/image to be transmitted. + * @param seriesUID Series Instance UID of the series/image to be transmitted. + * If NULL, a complete study is transmitted. + * @param instanceUID SOP Instance UID of the image to be transmitted. + * If NULL, a complete series is transmitted. + * @return EC_Normal if successful, a different DIMSE code otherwise. + */ + +static OFCondition sendStudy( + DcmQueryRetrieveIndexDatabaseHandle &handle, + T_ASC_Association *assoc, + const char *studyUID, + const char *seriesUID, + const char *instanceUID) +{ + if ((assoc==NULL)||(studyUID==NULL)) return DIMSE_NULLKEY; + + /* build query */ + DcmDataset query; + OFCondition cond = DVPSHelper::putStringValue(&query, DCM_StudyInstanceUID, studyUID); + if (cond.bad()) return cond; + if (seriesUID && instanceUID) + { + cond = DVPSHelper::putStringValue(&query, DCM_QueryRetrieveLevel, "IMAGE"); + if (cond.bad()) return cond; + cond = DVPSHelper::putStringValue(&query, DCM_SeriesInstanceUID, seriesUID); + if (cond.bad()) return cond; + cond = DVPSHelper::putStringValue(&query, DCM_SOPInstanceUID, instanceUID); + if (cond.bad()) return cond; + + OFLOG_INFO(dcmpssndLogger, "Sending at IMAGE level:" << OFendl + << " Study Instance UID : " << studyUID << OFendl + << " Series Instance UID: " << seriesUID << OFendl + << " SOP Instance UID : " << instanceUID); + } + else if (seriesUID) + { + cond = DVPSHelper::putStringValue(&query, DCM_QueryRetrieveLevel, "SERIES"); + if (cond.bad()) return cond; + cond = DVPSHelper::putStringValue(&query, DCM_SeriesInstanceUID, seriesUID); + if (cond.bad()) return cond; + + OFLOG_INFO(dcmpssndLogger, "Sending at SERIES level:" << OFendl + << " Study Instance UID : " << studyUID << OFendl + << " Series Instance UID: " << seriesUID); + } + else + { + cond = DVPSHelper::putStringValue(&query, DCM_QueryRetrieveLevel, "STUDY"); + if (cond.bad()) return cond; + + OFLOG_INFO(dcmpssndLogger, "Sending at STUDY level:" << OFendl + << " Study Instance UID : " << studyUID); + } + + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Pending); + DIC_UI sopClass; + DIC_UI sopInstance; + char imgFile[MAXPATHLEN+1]; + DIC_US nRemaining = 0; + + cond = handle.startMoveRequest(UID_MOVEStudyRootQueryRetrieveInformationModel, &query, &dbStatus); + if (cond.bad()) return cond; + + while (dbStatus.status() == STATUS_Pending) + { + cond = handle.nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), imgFile, sizeof(imgFile), &nRemaining, &dbStatus); + if (cond.bad()) return cond; + + if (dbStatus.status() == STATUS_Pending) + { + cond = sendImage(assoc, sopClass, sopInstance, imgFile); + if (cond.bad()) + { + handle.cancelMoveRequest(&dbStatus); + return cond; + } + } + } + return cond; +} + +/** adds presentation contexts for all storage SOP classes + * to the association parameters. + * If the opt_implicitOnly flag is set, only Implicit VR Little Endian + * is offered as transfer syntax. Otherwise, three xfer syntaxes are offered: + * first the explicit VR with local byte ordering, followed by explicit VR + * with opposite byte ordering, followed by implicit VR little endian. + * @param params parameter set to which presentation contexts are added + * @param opt_implicitOnly flag defining whether only Implicit VR Little Endian + * should be offered as xfer syntax. + * @return EC_Normal upon success, an error code otherwise. + */ +static OFCondition addAllStoragePresentationContexts(T_ASC_Parameters *params, int opt_implicitOnly) +{ + OFCondition cond = EC_Normal; + int pid = 1; + + const char* transferSyntaxes[3]; + int transferSyntaxCount = 0; + + if (opt_implicitOnly) + { + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + transferSyntaxCount = 1; + } else { + /* gLocalByteOrder is defined in dcxfer.h */ + if (gLocalByteOrder == EBO_LittleEndian) { + /* we are on a little endian machine */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + /* we are on a big endian machine */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + transferSyntaxCount = 3; + } + + for (int i=0; i= 4) cmd.getParam(4, opt_seriesUID); + if (cmd.getParamCount() >= 5) cmd.getParam(5, opt_instanceUID); + + OFLog::configureFromCommandLine(cmd, app); + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmpssndLogger, rcsid << OFendl); + + if (opt_cfgName) + { + FILE *cfgfile = fopen(opt_cfgName, "rb"); + if (cfgfile) fclose(cfgfile); else + { + OFLOG_FATAL(dcmpssndLogger, "can't open configuration file '" << opt_cfgName << "'"); + return 10; + } + } else { + OFLOG_FATAL(dcmpssndLogger, "missing configuration file name"); + return 10; + } + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmpssndLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + DVConfiguration dvi(opt_cfgName); + + /* get send target from configuration file */ + const char *targetHostname = dvi.getTargetHostname(opt_target); + const char *targetDescription = dvi.getTargetDescription(opt_target); + const char *targetAETitle = dvi.getTargetAETitle(opt_target); + unsigned short targetPort = dvi.getTargetPort(opt_target); + unsigned long targetMaxPDU = dvi.getTargetMaxPDU(opt_target); + OFBool targetImplicitOnly = dvi.getTargetImplicitOnly(opt_target); + OFBool targetDisableNewVRs = dvi.getTargetDisableNewVRs(opt_target); + + unsigned short messagePort = dvi.getMessagePort(); /* port number for IPC */ + OFBool keepMessagePortOpen = dvi.getMessagePortKeepOpen(); + OFBool useTLS = dvi.getTargetUseTLS(opt_target); + + Sint32 timeout = dvi.getTargetTimeout(opt_target); + if (timeout > 0) dcmConnectionTimeout.set(timeout); + +#ifdef WITH_OPENSSL + /* TLS directory */ + const char *current = NULL; + const char *tlsFolder = dvi.getTLSFolder(); + if (tlsFolder==NULL) tlsFolder = "."; + + /* certificate file */ + OFString tlsCertificateFile(tlsFolder); + tlsCertificateFile += PATH_SEPARATOR; + current = dvi.getTargetCertificate(opt_target); + if (current) tlsCertificateFile += current; else tlsCertificateFile.clear(); + + /* private key file */ + OFString tlsPrivateKeyFile(tlsFolder); + tlsPrivateKeyFile += PATH_SEPARATOR; + current = dvi.getTargetPrivateKey(opt_target); + if (current) tlsPrivateKeyFile += current; else tlsPrivateKeyFile.clear(); + + /* private key password */ + const char *tlsPrivateKeyPassword = dvi.getTargetPrivateKeyPassword(opt_target); + + /* certificate verification */ + DcmCertificateVerification tlsCertVerification = DCV_requireCertificate; + switch (dvi.getTargetPeerAuthentication(opt_target)) + { + case DVPSQ_require: + tlsCertVerification = DCV_requireCertificate; + break; + case DVPSQ_verify: + tlsCertVerification = DCV_checkCertificate; + break; + case DVPSQ_ignore: + tlsCertVerification = DCV_ignoreCertificate; + break; + } + + /* DH parameter file */ + OFString tlsDHParametersFile; + current = dvi.getTargetDiffieHellmanParameters(opt_target); + if (current) + { + tlsDHParametersFile = tlsFolder; + tlsDHParametersFile += PATH_SEPARATOR; + tlsDHParametersFile += current; + } + + /* random seed file */ + OFString tlsRandomSeedFile(tlsFolder); + tlsRandomSeedFile += PATH_SEPARATOR; + current = dvi.getTargetRandomSeed(opt_target); + if (current) tlsRandomSeedFile += current; else tlsRandomSeedFile += "siteseed.bin"; + + /* CA certificate directory */ + const char *tlsCACertificateFolder = dvi.getTLSCACertificateFolder(); + if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = "."; + + /* key file format */ + DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM; + if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1; + +#else + if (useTLS) + { + OFLOG_FATAL(dcmpssndLogger, "not compiled with OpenSSL, cannot use TLS"); + return 10; + } +#endif + + if (targetHostname==NULL) + { + OFLOG_FATAL(dcmpssndLogger, "no hostname for send target '" << opt_target << "'"); + return 10; + } + + if (targetAETitle==NULL) + { + OFLOG_FATAL(dcmpssndLogger, "no aetitle for send target '" << opt_target << "'"); + return 10; + } + + if (targetPort==0) + { + OFLOG_FATAL(dcmpssndLogger, "no or invalid port number for send target '" << opt_target << "'"); + return 10; + } + + if (targetMaxPDU==0) targetMaxPDU = DEFAULT_MAXPDU; + else if (targetMaxPDU > ASC_MAXIMUMPDUSIZE) + { + OFLOG_WARN(dcmpssndLogger, "max PDU size " << targetMaxPDU << " too big for send target '" + << opt_target << "', using default: " << DEFAULT_MAXPDU); + targetMaxPDU = DEFAULT_MAXPDU; + } + + if (targetDisableNewVRs) + { + dcmDisableGenerationOfNewVRs(); + } + + OFOStringStream verboseParameters; + + verboseParameters << "Send target parameters:" << OFendl + << "\thostname : " << targetHostname << OFendl + << "\tport : " << targetPort << OFendl + << "\tdescription : "; + if (targetDescription) verboseParameters << targetDescription; else verboseParameters << "(none)"; + verboseParameters << OFendl + << "\taetitle : " << targetAETitle << OFendl + << "\tmax pdu : " << targetMaxPDU << OFendl + << "\ttimeout : " << timeout << OFendl + << "\toptions : "; + if (targetImplicitOnly && targetDisableNewVRs) verboseParameters << "implicit xfer syntax only, disable post-1993 VRs"; + else if (targetImplicitOnly) verboseParameters << "implicit xfer syntax only"; + else if (targetDisableNewVRs) verboseParameters << "disable post-1993 VRs"; + else verboseParameters << "none"; + verboseParameters << OFendl; + + verboseParameters << "\tTLS : "; + if (useTLS) verboseParameters << "enabled" << OFendl; else verboseParameters << "disabled" << OFendl; + + /* open database */ + const char *dbfolder = dvi.getDatabaseFolder(); + + OFLOG_INFO(dcmpssndLogger, "Opening database in directory '" << dbfolder << "'"); + + OFCondition result; + DcmQueryRetrieveIndexDatabaseHandle dbhandle(dbfolder, PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.bad()) + { + OFLOG_FATAL(dcmpssndLogger, "Unable to access database '" << dbfolder << "'"); + return 1; + } + +#ifdef WITH_OPENSSL + + DcmTLSTransportLayer *tLayer = NULL; + if (useTLS) + { + tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, tlsRandomSeedFile.c_str(), OFFalse); + if (tLayer == NULL) + { + OFLOG_FATAL(dcmpssndLogger, "unable to create TLS transport layer"); + return 1; + } + + // determine TLS profile + OFString profileName; + const char *profileNamePtr = dvi.getTargetTLSProfile(opt_target); + if (profileNamePtr) profileName = profileNamePtr; + DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195; // default + if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195; + else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND; + else if (profileName == "BCP195-EX") tlsProfile = TSP_Profile_BCP195_Extended; + else if (profileName == "AES") tlsProfile = TSP_Profile_AES; + else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic; + else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted; + else + { + OFLOG_WARN(dcmpssndLogger, "unknown TLS profile '" << profileName << "', ignoring"); + } + + if (TCS_ok != tLayer->setTLSProfile(tlsProfile)) + { + OFLOG_FATAL(dcmpssndLogger, "unable to select the TLS security profile"); + return 1; + } + + // activate cipher suites + if (TCS_ok != tLayer->activateCipherSuites()) + { + OFLOG_FATAL(dcmpssndLogger, "unable to activate the selected list of TLS ciphersuites"); + return 1; + } + + if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat))) + { + OFLOG_WARN(dcmpssndLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring"); + } + if ((tlsDHParametersFile.size() > 0) && ! (tLayer->setTempDHParameters(tlsDHParametersFile.c_str()))) + { + OFLOG_WARN(dcmpssndLogger, "unable to load temporary DH parameter file '" << tlsDHParametersFile << "', ignoring"); + } + tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console + + if (!tlsPrivateKeyFile.empty() && !tlsCertificateFile.empty()) + { + if (TCS_ok != tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmpssndLogger, "unable to load private TLS key from '" << tlsPrivateKeyFile<< "'"); + return 1; + } + if (TCS_ok != tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat)) + { + OFLOG_FATAL(dcmpssndLogger, "unable to load certificate from '" << tlsCertificateFile << "'"); + return 1; + } + if (! tLayer->checkPrivateKeyMatchesCertificate()) + { + OFLOG_FATAL(dcmpssndLogger, "private key '" << tlsPrivateKeyFile << "' and certificate '" << tlsCertificateFile << "' do not match"); + return 1; + } + } + + tLayer->setCertificateVerification(tlsCertVerification); + + // a generated UID contains the process ID and current time. + // Adding it to the PRNG seed guarantees that we have different seeds for different processes. + char randomUID[65]; + dcmGenerateUniqueIdentifier(randomUID); + tLayer->addPRNGseed(randomUID, strlen(randomUID)); + } + + if (useTLS) + { + OFString cslist; + if (tLayer) tLayer->getListOfCipherSuitesForOpenSSL(cslist); + verboseParameters << "\tTLS certificate : " << tlsCertificateFile << OFendl + << "\tTLS key file : " << tlsPrivateKeyFile << OFendl + << "\tTLS DH params : " << tlsDHParametersFile << OFendl + << "\tTLS PRNG seed : " << tlsRandomSeedFile << OFendl + << "\tTLS CA directory: " << tlsCACertificateFolder << OFendl + << "\tTLS ciphersuites: " << cslist << OFendl + << "\tTLS key format : "; + if (keyFileFormat == DCF_Filetype_PEM) verboseParameters << "PEM" << OFendl; else verboseParameters << "DER" << OFendl; + verboseParameters << "\tTLS cert verify : "; + switch (tlsCertVerification) + { + case DCV_checkCertificate: + verboseParameters << "verify" << OFendl; + break; + case DCV_ignoreCertificate: + verboseParameters << "ignore" << OFendl; + break; + default: + verboseParameters << "require" << OFendl; + break; + } + } +#endif + + verboseParameters << OFStringStream_ends; + OFSTRINGSTREAM_GETOFSTRING(verboseParameters, verboseParametersString) + OFLOG_INFO(dcmpssndLogger, verboseParametersString); + + /* open network connection */ + T_ASC_Network *net=NULL; + T_ASC_Parameters *params=NULL; + DIC_NODENAME peerHost; + T_ASC_Association *assoc=NULL; + + OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, 30, &net); + if (cond.bad()) + { + OFLOG_FATAL(dcmpssndLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + +#ifdef WITH_OPENSSL + if (tLayer) + { + cond = ASC_setTransportLayer(net, tLayer, 0); + if (cond.bad()) + { + OFLOG_FATAL(dcmpssndLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + } +#endif + + cond = ASC_createAssociationParameters(¶ms, targetMaxPDU); + if (cond.bad()) + { + OFLOG_FATAL(dcmpssndLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + cond = ASC_setTransportLayerType(params, useTLS); + if (cond.bad()) + { + OFLOG_FATAL(dcmpssndLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + ASC_setAPTitles(params, dvi.getNetworkAETitle(), targetAETitle, NULL); + + sprintf(peerHost, "%s:%d", targetHostname, (int)targetPort); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), peerHost); + + cond = addAllStoragePresentationContexts(params, targetImplicitOnly); + if (cond.bad()) + { + OFLOG_FATAL(dcmpssndLogger, DimseCondition::dump(temp_str, cond)); + return 1; + } + + if (messagePort > 0) + { + messageClient = new DVPSIPCClient(DVPSIPCMessage::clientStoreSCU, verboseParametersString.c_str(), messagePort, keepMessagePortOpen); + if (! messageClient->isServerActive()) + { + OFLOG_WARN(dcmpssndLogger, "no IPC message server found at port " << messagePort << ", disabling IPC"); + } + } + + /* create association */ + OFLOG_INFO(dcmpssndLogger, "Requesting Association"); + + cond = ASC_requestAssociation(net, params, &assoc); + if (cond.bad()) + { + if (cond == DUL_ASSOCIATIONREJECTED) + { + T_ASC_RejectParameters rej; + + ASC_getRejectParameters(params, &rej); + OFLOG_ERROR(dcmpssndLogger, "Association Rejected" << OFendl << ASC_printRejectParameters(temp_str, &rej)); + if (messageClient) + { + // notify about rejected association + OFOStringStream out; + out << "DIMSE Association Rejected:" << OFendl + << "\t" << ASC_printRejectParameters(temp_str, &rej) << OFendl; + out << "\tcalled presentation address: " << assoc->params->DULparams.calledPresentationAddress << OFendl + << "\tcalling AE title: " << assoc->params->DULparams.callingAPTitle << OFendl + << "\tcalled AE title: " << assoc->params->DULparams.calledAPTitle << OFendl; + out << ASC_dumpConnectionParameters(temp_str, assoc) << OFendl; + out << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyRequestedEncryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + else messageClient->notifyRequestedUnencryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + OFSTRINGSTREAM_FREESTR(theString) + delete messageClient; + } + return 1; + } else { + OFLOG_ERROR(dcmpssndLogger, "Association Request Failed " << DimseCondition::dump(temp_str, cond)); + if (messageClient) + { + // notify about rejected association + OFOStringStream out; + out << "DIMSE Association Request Failed:" << OFendl + << "\tcalled presentation address: " << assoc->params->DULparams.calledPresentationAddress << OFendl + << "\tcalling AE title: " << assoc->params->DULparams.callingAPTitle << OFendl + << "\tcalled AE title: " << assoc->params->DULparams.calledAPTitle << OFendl + << ASC_dumpConnectionParameters(temp_str, assoc) << OFendl + << cond.text() << OFendl << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyRequestedEncryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + else messageClient->notifyRequestedUnencryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + OFSTRINGSTREAM_FREESTR(theString) + delete messageClient; + } + return 1; + } + } + + if (ASC_countAcceptedPresentationContexts(params) == 0) + { + OFLOG_ERROR(dcmpssndLogger, "No Acceptable Presentation Contexts"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) + { + OFLOG_ERROR(dcmpssndLogger, "Association Abort Failed\n" << DimseCondition::dump(temp_str, cond)); + } + if (messageClient) + { + // notify about rejected association + OFOStringStream out; + out << "DIMSE association accepted, but no acceptable presentation contexts - aborting" << OFendl + << "\tcalled presentation address: " << assoc->params->DULparams.calledPresentationAddress << OFendl + << "\tcalling AE title: " << assoc->params->DULparams.callingAPTitle << OFendl + << "\tcalled AE title: " << assoc->params->DULparams.calledAPTitle << OFendl + << ASC_dumpConnectionParameters(temp_str, assoc) << OFendl + << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyRequestedEncryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + else messageClient->notifyRequestedUnencryptedDICOMConnection(DVPSIPCMessage::statusError, theString); + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + OFSTRINGSTREAM_FREESTR(theString) + delete messageClient; + } + return 1; + } + + OFLOG_INFO(dcmpssndLogger, "Association accepted (Max Send PDV: " << assoc->sendPDVLength << ")"); + + if (messageClient) + { + // notify about successfully negotiated association + OFOStringStream out; + out << "DIMSE Association Accepted:" << OFendl + << "\tcalled presentation address: " << assoc->params->DULparams.calledPresentationAddress << OFendl + << "\tcalling AE title: " << assoc->params->DULparams.callingAPTitle << OFendl + << "\tcalled AE title: " << assoc->params->DULparams.calledAPTitle << OFendl + << "\tmax send PDV: " << assoc->sendPDVLength << OFendl + << "\tpresentation contexts: " << ASC_countAcceptedPresentationContexts(assoc->params) << OFendl; + out << ASC_dumpConnectionParameters(temp_str, assoc) << OFendl; + out << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(out, theString) + if (useTLS) + messageClient->notifyRequestedEncryptedDICOMConnection(DVPSIPCMessage::statusOK, theString); + else messageClient->notifyRequestedUnencryptedDICOMConnection(DVPSIPCMessage::statusOK, theString); + OFSTRINGSTREAM_FREESTR(theString) + } + + + /* do the real work */ + cond = sendStudy(dbhandle, assoc, opt_studyUID, opt_seriesUID, opt_instanceUID); + + /* tear down association */ + if (cond.good()) + { + /* release association */ + OFLOG_INFO(dcmpssndLogger, "Releasing Association"); + cond = ASC_releaseAssociation(assoc); + if (cond.bad()) + { + OFLOG_ERROR(dcmpssndLogger, "Association Release Failed\n" << DimseCondition::dump(temp_str, cond)); + if (messageClient) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + delete messageClient; + } + return 1; + } + if (messageClient) messageClient->notifyConnectionClosed(DVPSIPCMessage::statusOK); + } + else if (cond == DUL_PEERREQUESTEDRELEASE) + { + OFLOG_ERROR(dcmpssndLogger, "Protocol Error: peer requested release (Aborting)"); + OFLOG_INFO(dcmpssndLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) + { + OFLOG_ERROR(dcmpssndLogger, "Association Abort Failed" << DimseCondition::dump(temp_str, cond)); + if (messageClient) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + delete messageClient; + } + return 1; + } + if (messageClient) messageClient->notifyConnectionAborted(DVPSIPCMessage::statusError, "Protocol error: peer requested release, aborting association"); + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + OFLOG_INFO(dcmpssndLogger, "Peer Aborted Association"); + if (messageClient) messageClient->notifyConnectionAborted(DVPSIPCMessage::statusError, "Peer aborted association"); + } + else + { + OFLOG_ERROR(dcmpssndLogger, "SCU Failed" << DimseCondition::dump(temp_str, cond)); + OFLOG_INFO(dcmpssndLogger, "Aborting Association"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) + { + OFLOG_ERROR(dcmpssndLogger, "Association Abort Failed" << DimseCondition::dump(temp_str, cond)); + if (messageClient) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + delete messageClient; + } + return 1; + } + if (messageClient) messageClient->notifyConnectionAborted(DVPSIPCMessage::statusError, "Storage SCU failed, aborting association"); + } + + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) + { + OFLOG_ERROR(dcmpssndLogger, DimseCondition::dump(temp_str, cond)); + if (messageClient) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + delete messageClient; + } + return 1; + } + cond = ASC_dropNetwork(&net); + if (cond.bad()) + { + OFLOG_ERROR(dcmpssndLogger, DimseCondition::dump(temp_str, cond)); + if (messageClient) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusError); + delete messageClient; + } + return 1; + } + + // tell the IPC server that we're going to terminate. + // We need to do this before we shutdown WinSock. + if (messageClient) + { + messageClient->notifyApplicationTerminates(DVPSIPCMessage::statusOK); + delete messageClient; + } + + OFStandard::shutdownNetwork(); + +#ifdef WITH_OPENSSL + if (tLayer) + { + if (tLayer->canWriteRandomSeed()) + { + if (!tLayer->writeRandomSeed(tlsRandomSeedFile.c_str())) + { + OFLOG_WARN(dcmpssndLogger, "cannot write back random seed file '" << tlsRandomSeedFile << "', ignoring"); + } + } else { + OFLOG_WARN(dcmpssndLogger, "cannot write back random seed, ignoring"); + } + } + delete tLayer; +#endif + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + + return 0; +} diff --git a/dcmpstat/configure b/dcmpstat/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmpstat/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmpstat/data/CMakeLists.txt b/dcmpstat/data/CMakeLists.txt new file mode 100644 index 00000000..9a10736a --- /dev/null +++ b/dcmpstat/data/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES philips.lut DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data) diff --git a/dcmpstat/data/Makefile.in b/dcmpstat/data/Makefile.in new file mode 100644 index 00000000..e9f33e99 --- /dev/null +++ b/dcmpstat/data/Makefile.in @@ -0,0 +1,31 @@ +# +# Makefile for dcmpstat/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = philips.lut + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(datadir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(datadir) ;\ + done + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + +dependencies: diff --git a/dcmpstat/data/philips.lut b/dcmpstat/data/philips.lut new file mode 100644 index 00000000..08b61605 --- /dev/null +++ b/dcmpstat/data/philips.lut @@ -0,0 +1,274 @@ +# Philips Medical Systems Presentation LUT +# Difference between GSDF and Philips Standard Display Curve +# y = 523.31018 * (1 - exp(-x * 0.0026257106)), with x = 0..255 + +# number of entries (x,y) +count 256 + +# maximum x value (optional) +#xMax 255 + +# maximum y value (optional) +#yMax 255 + +# table data +# x y + +0 0 +1 1.372258721 +2 2.740919014 +3 4.105990316 +4 5.467482036 +5 6.825403563 +6 8.179764257 +7 9.530573457 +8 10.87784048 +9 12.2215746 +10 13.5617851 +11 14.8984812 +12 16.23167214 +13 17.56136709 +14 18.88757523 +15 20.21030569 +16 21.52956761 +17 22.84537007 +18 24.15772214 +19 25.46663288 +20 26.7721113 +21 28.07416642 +22 29.37280719 +23 30.66804259 +24 31.95988153 +25 33.24833293 +26 34.53340566 +27 35.81510859 +28 37.09345055 +29 38.36844037 +30 39.64008681 +31 40.90839867 +32 42.17338467 +33 43.43505354 +34 44.69341397 +35 45.94847466 +36 47.20024423 +37 48.44873134 +38 49.69394458 +39 50.93589254 +40 52.17458378 +41 53.41002684 +42 54.64223024 +43 55.87120247 +44 57.09695201 +45 58.31948731 +46 59.5388168 +47 60.75494888 +48 61.96789194 +49 63.17765434 +50 64.38424442 +51 65.58767049 +52 66.78794087 +53 67.98506381 +54 69.17904758 +55 70.36990041 +56 71.5576305 +57 72.74224605 +58 73.92375522 +59 75.10216616 +60 76.27748699 +61 77.44972582 +62 78.61889072 +63 79.78498977 +64 80.94803099 +65 82.1080224 +66 83.26497201 +67 84.41888779 +68 85.5697777 +69 86.71764966 +70 87.8625116 +71 89.00437141 +72 90.14323695 +73 91.27911609 +74 92.41201665 +75 93.54194644 +76 94.66891326 +77 95.79292486 +78 96.91398901 +79 98.03211343 +80 99.14730583 +81 100.2595739 +82 101.3689253 +83 102.4753677 +84 103.5789087 +85 104.6795559 +86 105.777317 +87 106.8721994 +88 107.9642107 +89 109.0533585 +90 110.1396503 +91 111.2230935 +92 112.3036956 +93 113.3814641 +94 114.4564064 +95 115.52853 +96 116.5978421 +97 117.6643502 +98 118.7280617 +99 119.7889838 +100 120.8471239 +101 121.9024892 +102 122.9550871 +103 124.0049249 +104 125.0520096 +105 126.0963487 +106 127.1379492 +107 128.1768183 +108 129.2129633 +109 130.2463912 +110 131.2771091 +111 132.3051243 +112 133.3304437 +113 134.3530745 +114 135.3730237 +115 136.3902983 +116 137.4049053 +117 138.4168517 +118 139.4261446 +119 140.4327908 +120 141.4367973 +121 142.4381711 +122 143.436919 +123 144.4330479 +124 145.4265647 +125 146.4174762 +126 147.4057893 +127 148.3915107 +128 149.3746474 +129 150.355206 +130 151.3331933 +131 152.3086161 +132 153.281481 +133 154.2517949 +134 155.2195643 +135 156.1847959 +136 157.1474965 +137 158.1076726 +138 159.0653309 +139 160.0204779 +140 160.9731203 +141 161.9232646 +142 162.8709174 +143 163.8160852 +144 164.7587745 +145 165.6989918 +146 166.6367436 +147 167.5720364 +148 168.5048766 +149 169.4352707 +150 170.363225 +151 171.2887459 +152 172.2118399 +153 173.1325133 +154 174.0507724 +155 174.9666237 +156 175.8800733 +157 176.7911276 +158 177.6997929 +159 178.6060754 +160 179.5099814 +161 180.4115171 +162 181.3106888 +163 182.2075025 +164 183.1019647 +165 183.9940812 +166 184.8838585 +167 185.7713024 +168 186.6564193 +169 187.5392152 +170 188.4196961 +171 189.2978682 +172 190.1737374 +173 191.04731 +174 191.9185917 +175 192.7875888 +176 193.6543071 +177 194.5187526 +178 195.3809313 +179 196.2408492 +180 197.0985121 +181 197.953926 +182 198.8070968 +183 199.6580304 +184 200.5067325 +185 201.3532092 +186 202.1974661 +187 203.0395092 +188 203.8793443 +189 204.716977 +190 205.5524133 +191 206.3856588 +192 207.2167193 +193 208.0456006 +194 208.8723083 +195 209.6968482 +196 210.5192259 +197 211.3394471 +198 212.1575175 +199 212.9734427 +200 213.7872283 +201 214.59888 +202 215.4084032 +203 216.2158037 +204 217.021087 +205 217.8242586 +206 218.6253241 +207 219.424289 +208 220.2211588 +209 221.0159389 +210 221.808635 +211 222.5992523 +212 223.3877965 +213 224.1742729 +214 224.958687 +215 225.7410441 +216 226.5213496 +217 227.299609 +218 228.0758276 +219 228.8500107 +220 229.6221638 +221 230.392292 +222 231.1604007 +223 231.9264953 +224 232.6905809 +225 233.452663 +226 234.2127466 +227 234.9708371 +228 235.7269397 +229 236.4810596 +230 237.2332019 +231 237.983372 +232 238.7315749 +233 239.4778158 +234 240.2220999 +235 240.9644323 +236 241.7048181 +237 242.4432624 +238 243.1797702 +239 243.9143468 +240 244.6469971 +241 245.3777262 +242 246.1065392 +243 246.833441 +244 247.5584367 +245 248.2815312 +246 249.0027296 +247 249.7220368 +248 250.4394578 +249 251.1549976 +250 251.868661 +251 252.580453 +252 253.2903784 +253 253.9984423 +254 254.7046494 +255 255.4090047 + +# eof \ No newline at end of file diff --git a/dcmpstat/docs/Makefile.in b/dcmpstat/docs/Makefile.in new file mode 100644 index 00000000..46f72aa7 --- /dev/null +++ b/dcmpstat/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmpstat/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmpstat/docs/dcmmkcrv.man b/dcmpstat/docs/dcmmkcrv.man new file mode 100644 index 00000000..0d0c7e8b --- /dev/null +++ b/dcmpstat/docs/dcmmkcrv.man @@ -0,0 +1,183 @@ +/*! + +\if MANPAGES +\page dcmmkcrv Add 2D curve data to image +\else +\page dcmmkcrv dcmmkcrv: Add 2D curve data to image +\endif + +\section dcmmkcrv_synopsis SYNOPSIS + +\verbatim +dcmmkcrv [options] dcmfile-in curvedata-in dcmfile-out +\endverbatim + +\section dcmmkcrv_description DESCRIPTION + +The \b dcmmkcrv utility allows one to create DICOM images containing curve data. +Since curve data is hardly used by vendors today, this is intended as a +means to test implementations that can read curve data. The utility reads an +existing DICOM image and a text file containing the curve data in textual +form. A DICOM curve data repeating group is created according to the +options specified on the command line, added to the existing image and +written back to file. The output file is encoded with the same transfer +syntax used for the input file. This utility only supports the creation of +two-dimensional curves. + +\section dcmmkcrv_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input image file + +curvedata-in curve data input file (text) + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmmkcrv_options OPTIONS + +\subsection dcmmkcrv_general_options general options + +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmmkcrv_curve_creation_options curve creation options + +\verbatim +curve type: + + -r --poly + create as POLY curve (default) + + +r --roi + create as ROI curve + +curve value representation: + + +v --data-vr [n]umber: integer 0..4 (default: 4) + select curve data VR: 0=US, 1=SS, 2=FL, 3=FD, 4=SL + + -c --curve-vr [n]umber: integer 0..2 (default: 0) + select VR with which the Curve Data element is written + 0=VR according to --data-vr, 1=OB, 2=OW + +repeating group: + + -g --group [n]umber: integer 0..15 (default: 0) + select repeating group: 0=0x5000, 1=0x5002 etc. + +curve description: + + -l --label s: string + set Curve Label to s (default: absent) + + +d --description s: string + set Curve Description to s (default: absent) + + -a --axis x: string, y: string + set Axis Units to x\y (default: absent) +\endverbatim + +\section dcmmkcrv_notes NOTES + +\subsection dcmmkcrv_syntax_data_file Syntax of the Curve Data File + +The curve data file is expected to be a plain ASCII text file containing +numbers (integer or floating point) comprising the values of the point +coordinates. Numbers must be separated by whitespace. No checking of the +value range or value range conversion is performed. Example: + +\verbatim + 256.451947 1.000000 + 477.689863 128.822080 + 128.822080 477.689863 + 35.310137 128.822080 + 256.451947 1.000000 +\endverbatim + +\section dcmmkcrv_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmmkcrv_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmmkcrv_environment ENVIRONMENT + +The \b dcmmkcrv utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmmkcrv_copyright COPYRIGHT + +Copyright (C) 1998-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmmklut.man b/dcmpstat/docs/dcmmklut.man new file mode 100644 index 00000000..fa7ab225 --- /dev/null +++ b/dcmpstat/docs/dcmmklut.man @@ -0,0 +1,253 @@ +/*! + +\if MANPAGES +\page dcmmklut Create DICOM look-up tables +\else +\page dcmmklut dcmmklut: Create DICOM look-up tables +\endif + +\section dcmmklut_synopsis SYNOPSIS + +\verbatim +dcmmklut [options] dcmimg-out +\endverbatim + +\section dcmmklut_description DESCRIPTION + +The \b dcmmklut utility allows one to create a variety of DICOM Modality, +Presentation and VOI look-up tables (LUT) and is intended for the creation +of test images. The utility is able to read an existing DICOM image file, +create a look up table according to the command line options, and write +the new object back to file. It is also possible to create a new object +containing the specified LUT without reading an existing DICOM image file. +This is e.g. useful to simply store different look-up tables in a DICOM-like +structure. As a default the output file is encoded with the same transfer +syntax used for the input file, but the transfer syntax can also be specified +as a command line option. + +The LUT data can be derived from the shape of a gamma curve (default for the +gamma factor is 1) or imported from a file (currently the MAP format from +Ulead's PhotoImpact and a simple text format are supported). The input and +output width of the LUT can also be specified in the range allowed by the +DICOM standard. The interpolation of the input range is done by a polynomial +curve fitting algorithm. + +In addition to the DICOM output file the LUT data can also be exported to a +tabbed text file which allows the easy visualization of the curves with a +common spread sheet application (e.g. Microsoft Excel). + +\section dcmmklut_parameters PARAMETERS + +\verbatim +dcmimg-out DICOM output filename +\endverbatim + +\section dcmmklut_options OPTIONS + +\subsection dcmmklut_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmmklut_lut_creation_options LUT creation options +\verbatim +LUT type: + + +Tm --modality + create as Modality LUT + + +Tp --presentation + create as Presentation LUT + + +Tv --voi + create as VOI LUT (default) + +LUT placement: + + +Pa --add + add to existing transform + (default for and only with --voi) + + +Pr --replace + replace existing transform + (default for --modality and --presentation) + +LUT content: + + +Cg --gamma [g]amma: float + use gamma value (default: 1.0) + + +Cm --map-file [f]ilename: string + read input data from MAP file + + +Ct --text-file [f]ilename: string + read input data from text file + +LUT options: + + +Og --inverse-gsdf + apply inverse GSDF (print presentation LUT in OD) + + --min-density [v]alue: integer (0..65535, default: 20) + set min density to v (in hundreds of OD) + + --max-density [v]alue: integer (0..65535, default: 300) + set max density to v (in hundreds of OD) + + +Oi --illumination [v]alue: integer (0..65535, default: 2000) + set illumination to v (in cd/m^2) + + +Or --reflection [v]alue: integer (0..65535, default: 10) + set reflected ambient light to v (in cd/m^2) + +LUT structure: + + -b --bits [n]umber: integer + create LUT with n bit values (8..16, default: 16) + + -e --entries [n]umber: integer + create LUT with n entries (1..65536, default: 256) + + -f --first-mapped [n]umber: integer + first input value mapped (-31768..65535, default: 0) + + -r --random [n]umber: unsigned integer + perform n randomly selected permutations on the LUT + + -rs --random-seed [n]umber: unsigned integer + initialize the random-number generator with n + (default: 0, for reproducible results) + + -o --order [n]umber: integer + use polynomial curve fitting algorithm with order n + (0..99, default: 5) + + -E --explanation [n]ame: string + LUT explanation (default: automatically created) + +LUT data alignment: + + -a --byte-align + create byte-aligned LUT + (default for and only with 8 bit values) + + +a --word-align + create word-aligned LUT + (default for 9-16 bit values) + +LUT data VR: + + +Dw --data-ow + write LUT Data as OW (default) + + +Du --data-us + write LUT Data as US + + +Ds --data-ss + write LUT Data as SS (minimal support) +\endverbatim + +\subsection dcmmklut_file_options file options +\verbatim + +Fi --dicom-input [f]ilename: string + read dataset from DICOM file f + + +Fo --text-output [f]ilename: string + write LUT data to tabbed text file f +\endverbatim + +\section dcmmklut_notes NOTES + +Please check the DICOM standard for further restrictions on the look-up table +structure. Especially the number of bits per table entry might be restricted +in particular IODs. + +\section dcmmklut_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmmklut_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmmklut_environment ENVIRONMENT + +The \b dcmmklut utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmmklut_files FILES + +\/philips.lut - sample LUT in text format + +\section dcmmklut_copyright COPYRIGHT + +Copyright (C) 1998-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmp2pgm.man b/dcmpstat/docs/dcmp2pgm.man new file mode 100644 index 00000000..8254ac34 --- /dev/null +++ b/dcmpstat/docs/dcmp2pgm.man @@ -0,0 +1,175 @@ +/*! + +\if MANPAGES +\page dcmp2pgm Read DICOM image and presentation state and render bitmap +\else +\page dcmp2pgm dcmp2pgm: Read DICOM image and presentation state and render bitmap +\endif + +\section dcmp2pgm_synopsis SYNOPSIS + +\verbatim +dcmp2pgm [options] dcmimage-in [bitmap-out] +\endverbatim + +\section dcmp2pgm_description DESCRIPTION + +The \b dcmp2pgm utility renders a monochrome DICOM image under the control of +a grayscale softcopy presentation state object into a monochrome bitmap +with 8 bits/pixel. The bitmap is stored either as "Portable Gray Map" (PGM) +or as a DICOM secondary capture image object. If no presentation state is +read from file, a default presentation state is created. The utility allows +to read a configuration file of the Softcopy Presentation State Viewer upon +startup. In this case, the settings from the configuration file affecting +the rendering of the presentation state are used, e.g. a correction of the +gray scale range according to Barten's model (DICOM part 14) can be +performed if the characteristic curve of the display system is available +and defined in the configuration file. + +\section dcmp2pgm_parameters PARAMETERS + +\verbatim +dcmimage-in input DICOM image + +bitmap-out output DICOM image or PGM bitmap +\endverbatim + +\section dcmp2pgm_options OPTIONS + +\subsection dcmp2pgm_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmp2pgm_processing_options processing options +\verbatim + -p --pstate [f]ilename: string + process using presentation state file + + -c --config [f]ilename: string + process using settings from configuration file + + -f --frame [f]rame: integer + process using image frame f (default: 1) +\endverbatim + +\subsection dcmp2pgm_output_format output format +\verbatim + -D --pgm + save image as PGM (default) + + +D --dicom + save image as DICOM secondary capture +\endverbatim + +\subsection dcmp2pgm_output_options output options +\verbatim + +S --save-pstate [f]ilename: string + save presentation state to file +\endverbatim + +\section dcmp2pgm_notes NOTES + +\subsection dcmp2pgm_limitations Limitations + +Please note that the \b dcmp2pgm tool does not render all aspects that are +defined by the Grayscale Softcopy Presentation State (GSPS) object but only +those that are supported by the underlying DCMTK classes. In particular, +textual and graphical annotations will not be visible in the output image. +The reason is that these aspects of a GSPS object are typically rendered by +DICOMscope, the graphical user interface that is put on top of the related +DCMTK classes and written in Java. + +Also concepts that were introduced after the initial definition of the GSPS +IOD (see Supplement 33) are ignored. This includes Supplement 120 with its +extended features like e.g. Compound Graphics. + +\section dcmp2pgm_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmp2pgm_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmp2pgm_environment ENVIRONMENT + +The \b dcmp2pgm utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmp2pgm_files FILES + +\/dcmpstat.cfg - sample configuration file + +\section dcmp2pgm_copyright COPYRIGHT + +Copyright (C) 1998-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmprscp.man b/dcmpstat/docs/dcmprscp.man new file mode 100644 index 00000000..da6262a1 --- /dev/null +++ b/dcmpstat/docs/dcmprscp.man @@ -0,0 +1,146 @@ +/*! + +\if MANPAGES +\page dcmprscp DICOM basic grayscale print management SCP +\else +\page dcmprscp dcmprscp: DICOM basic grayscale print management SCP +\endif + +\section dcmprscp_synopsis SYNOPSIS + +\verbatim +dcmprscp [options] +\endverbatim + +\section dcmprscp_description DESCRIPTION + +The \b dcmprscp utility implements the DICOM Basic Grayscale Print Management +Service Class as SCP. It also supports the optional Presentation LUT SOP +Class. The utility is intended for use within the DICOMscope viewer. + +The \b dcmprscp utility accepts print jobs from a remote Print SCU. It does +not create real hardcopies but stores print jobs in the local DICOMscope +database as a set of Stored Print objects (one per page) and Hardcopy +Grayscale images (one per film box N-SET). The DICOMscope application allows +to load a Stored Print object created by \b dcmprscp and to render a screen +preview of the hardcopy. The \b dcmprscp utility reads the characteristics of +the printer to be emulated from the configuration file. + +\section dcmprscp_options OPTIONS + +\subsection dcmprscp_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger + + -l --logfile + write a log file (not with --log-config) + + # this option is available for reasons of backward + # compatibility only +\endverbatim + +\subsection dcmprscp_processing_options processing options +\verbatim + -c --config [f]ilename: string + process using settings from configuration file + + -p --printer [n]ame: string (default: 1st printer in config file) + select printer with identifier n from config file + + +d --dump + dump all DIMSE messages +\endverbatim + +\section dcmprscp_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmprscp_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmprscp_environment ENVIRONMENT + +The \b dcmprscp utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmprscp_files FILES + +\/dcmpstat.cfg, \/printers.cfg - sample configuration files + +\section dcmprscp_see_also SEE ALSO + +dcmprscu(1) + +\section dcmprscp_copyright COPYRIGHT + +Copyright (C) 1999-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmprscu.man b/dcmpstat/docs/dcmprscu.man new file mode 100644 index 00000000..7fa53e94 --- /dev/null +++ b/dcmpstat/docs/dcmprscu.man @@ -0,0 +1,206 @@ +/*! + +\if MANPAGES +\page dcmprscu Print spooler for presentation state viewer +\else +\page dcmprscu dcmprscu: Print spooler for presentation state viewer +\endif + +\section dcmprscu_synopsis SYNOPSIS + +\verbatim +dcmprscu [options] [dcmfile-in...] +\endverbatim + +\section dcmprscu_description DESCRIPTION + +The \b dcmprscu utility implements the DICOM Basic Grayscale Print Management +Service Class as SCU. It also supports the optional Basic Annotation Box +and Presentation LUT SOP Classes. The utility is intended for use within +the DICOMscope viewer. + +The \b dcmprscu utility takes complete print jobs consisting of a Stored Print +object and one or more Hardcopy Grayscale objects and spools them to the +printer. No attempt is made to check whether the attributes defined in the +Stored Print object are supported by the Print SCP. However, the print +spooler will not attempt to use the optional Annotation or Presentation LUT +services if they are not successfully negotiated with the Print SCP. + +The \b dcmprscu utility reads the characteristics of the printer to +communicate with from the configuration file. Depending on the printer's +support for Presentation LUT, any Presentation LUT present in the print job +will be rendered into the hardcopy images before they are spooled to the +printer if necessary. If the printer does not support image transmission +with 12 bits/pixel (as per the configuration file), the grayscale hardcopy +images are down-sampled to 8 bits/pixel before transmission to the printer. + +The \b dcmprscu utility can be run either in "printer mode", in which case +the file name of a Stored Print object must be passed, or in "spool mode", +in which case commands are read periodically from a spool directory. + +\section dcmprscu_parameters PARAMETERS + +\verbatim +dcmfile-in stored print file(s) to be spooled +\endverbatim + +\section dcmprscu_options OPTIONS + +\subsection dcmprscu_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmprscu_print_options print options +\verbatim + --noprint + do not create print-out (no n-action-rq) + + --session-print + send film session n-action-rq (instead of film box) + + --monochrome1 + transmit basic grayscale images in MONOCHROME1 +\endverbatim + +\subsection dcmprscu_mode_options mode options +\verbatim + +p --print + printer mode, print file(s) and terminate (default) + + +s --spool [n]ame: string + spooler mode, use job prefix n +\endverbatim + +\subsection dcmprscu_processing_options processing options +\verbatim + -c --config [f]ilename: string + process using settings from configuration file + + -p --printer [n]ame: string (default: 1st printer in cfg file) + select printer with identifier n from cfg file + + +d --dump + dump all DIMSE messages +\endverbatim + +\subsection dcmprscu_spooler_options spooler options (only with --spool) +\verbatim + --sleep [d]elay: integer (default: 1) + sleep d seconds between spooler checks +\endverbatim + +\subsection dcmprscu_film_session_options basic film session options (not with --spool): +\verbatim + --copies [v]alue: integer (1..100, default: 1) + set number of copies to v + + --medium-type [v]alue: string + set medium type to v + + --destination [v]alue: string + set film destination to v + + --label [v]alue: string + set film session label to v + + --priority [v]alue: string + set print priority to v + + --owner [v]alue: string + set film session owner ID to v +\endverbatim + +\section dcmprscu_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmprscu_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmprscu_environment ENVIRONMENT + +The \b dcmprscu utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmprscu_files FILES + +\/dcmpstat.cfg, \/printers.cfg - sample configuration files + +\section dcmprscu_see_also SEE ALSO + +dcmprscp(1) + +\section dcmprscu_copyright COPYRIGHT + +Copyright (C) 1999-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmpschk.man b/dcmpstat/docs/dcmpschk.man new file mode 100644 index 00000000..a060142a --- /dev/null +++ b/dcmpstat/docs/dcmpschk.man @@ -0,0 +1,137 @@ +/*! + +\if MANPAGES +\page dcmpschk Checking tool for presentation states +\else +\page dcmpschk dcmpschk: Checking tool for presentation states +\endif + +\section dcmpschk_synopsis SYNOPSIS + +\verbatim +dcmpschk [options] [dcmfile-in...] +\endverbatim + +\section dcmpschk_description DESCRIPTION + +The \b dcmpschk utility checks DICOM Grayscale Softcopy Presentation State +objects for conformance with the standard. The test is performed in three +phases: + +\li Phase 1 checks the Meta-header of the DICOM file. It is tested whether + all required attributes are present, whether the SOP class and instance + UIDs match the UIDs in the main object and whether the group length + attribute contains a correct value. The Transfer Syntax of the Meta + header is also checked. + +\li Phase 2 performs a syntactic check of the values, value representations + and value multiplicities for each attribute in the object. The values + present in the object under test are compared with the definitions of the + DICOM data dictionary. + +\li Phase 3 performs a semantic check of the integrity of the Presentation + State. This phase is omitted when objects of other SOP Classes are + encountered. Phase 1 and 2 can also be applied to other DICOM objects of + arbitrary SOP class. + It should be noted that \b dcmpschk does not support Presentation States + which contain the Mask Module. These will be rejected with a message + that the Mask Module is not supported. + +\section dcmpschk_parameters PARAMETERS + +\verbatim +dcmfile-in presentation state file(s) to be checked +\endverbatim + +\section dcmpschk_options OPTIONS + +\subsection dcmpschk_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\section dcmpschk_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmpschk_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmpschk_environment ENVIRONMENT + +The \b dcmpschk utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmpschk_copyright COPYRIGHT + +Copyright (C) 2000-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmpsmk.man b/dcmpstat/docs/dcmpsmk.man new file mode 100644 index 00000000..58ff17a4 --- /dev/null +++ b/dcmpstat/docs/dcmpsmk.man @@ -0,0 +1,250 @@ +/*! + +\if MANPAGES +\page dcmpsmk Create DICOM grayscale softcopy presentation state +\else +\page dcmpsmk dcmpsmk: Create DICOM grayscale softcopy presentation state +\endif + +\section dcmpsmk_synopsis SYNOPSIS + +\verbatim +dcmpsmk [options] dcmfile-in dcmfile-out +\endverbatim + +\section dcmpsmk_description DESCRIPTION + +The \b dcmpsmk utility reads a DICOM image file and creates a grayscale +softcopy presentation state object according to Supplement 33. The +presentation state object is written back to file. A number of command line +options allow to specify how certain constructs that might be present in +the image file should be referenced or activated in the presentation state. +The newly created presentation state references the source image and +contains values that should allow for a "reasonable" display of the image +when rendered under control of the presentation state. + +\section dcmpsmk_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM image file(s) to be read + +dcmfile-out DICOM presentation state file to be created +\endverbatim + +\section dcmpsmk_options OPTIONS + +\subsection dcmpsmk_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmpsmk_input_options input optons +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmpsmk_processing_options processing options +\verbatim +VOI transform handling: + + +Vl --voi-lut + use first VOI LUT if present (default) + + +Vw --voi-window + use first window center/width if present + + -V --voi-ignore + ignore VOI LUT and window center/width + +curve handling: + + +c --curve-activate + activate curve data if present (default) + + -c --curve-ignore + ignore curve data + +overlay handling: + + +oc --overlay-copy + copy overlays if not embedded, activate otherwise (default) + + +oa --overlay-activate + activate overlays + + -o --overlay-ignore + ignore overlays + +shutter handling: + + +s --shutter-activate + use shutter if present in image (default) + + -s --shutter-ignore + ignore shutter + +presentation LUT shape handling: + + +p --plut-activate + use presentation LUT shape if present (default) + + -p --plut-ignore + ignore presentation LUT shape + +layering: + + +l1 --layer-single + all curves and overlays are in one layer + + +l2 --layer-double + one layer for curves, one for overlays (default) + + +ls --layer-separate + separate layers for each curve and overlay + +location of referenced image: + + -lx --location-none + image reference without location (default) + + -ln --location-network [a]etitle: string + image located at application entity a + + -lm --location-media [f]ilesetID, fileset[UID]: string + image located on storage medium +\endverbatim + +\subsection dcmpsmk_output_options output options +\verbatim +output transfer syntax: + + +t= --write-xfer-same + write with same TS as image file (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS +\endverbatim + +\section dcmpsmk_notes NOTES + +If more than one input file (\e dcmfile-in) is specified, the additional image +files are only referenced from the created presentation state file, but no +further (e.g. display-related) information is taken over. + +\section dcmpsmk_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmpsmk_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmpsmk_environment ENVIRONMENT + +The \b dcmpsmk utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmpsmk_copyright COPYRIGHT + +Copyright (C) 1998-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmpsprt.man b/dcmpstat/docs/dcmpsprt.man new file mode 100644 index 00000000..7e4d2bd3 --- /dev/null +++ b/dcmpstat/docs/dcmpsprt.man @@ -0,0 +1,317 @@ +/*! + +\if MANPAGES +\page dcmpsprt Read DICOM images and presentation states and render print job +\else +\page dcmpsprt dcmpsprt: Read DICOM images and presentation states and render print job +\endif + +\section dcmpsprt_synopsis SYNOPSIS + +\verbatim +dcmpsprt [options] dcmfile-in... +\endverbatim + +\section dcmpsprt_description DESCRIPTION + +The \b dcmpsprt utility reads one or more DICOM images and presentation states +and creates a print job. The print job consists of one Stored Print object +and one or more Hardcopy Grayscale images and is written to the database +specified in the configuration file. The print job can optionally be spooled +to the printer. In this case, \b dcmpsprt calls the \b dcmprscu application +which performs communication with the printer. + +\section dcmpsprt_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM image file(s) to be printed +\endverbatim + +\section dcmpsprt_options OPTIONS + +\subsection dcmpsprt_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmpsprt_processing_options processing options +\verbatim + +p --pstate [p]state file: string + render the following image with presentation state p + (this option can be specified multiple times) + + -c --config [f]ilename: string + process using settings from configuration file f + + -p --printer [n]ame: string (default: 1st printer in cfg file) + select printer with identifier n from cfg file +\endverbatim + +\subsection dcmpsprt_spooling_options spooling options +\verbatim + -s --spool + spool print job to DICOM printer + + --nospool + do not spool print job to DICOM printer (default) +\endverbatim + +\subsection dcmpsprt_film_orientation_options film orientation options +\verbatim + --portrait + set portrait orientation + + --landscape + set landscape orientation + + --default-orientation + use printer default (default) +\endverbatim + +\subsection dcmpsprt_trim_border_options trim (border) options +\verbatim + --trim + set trim on + + --no-trim + set trim off + + --default-trim + use printer default (default) +\endverbatim + +\subsection dcmpsprt_behavior_options requested decimate/crop behavior options +\verbatim + --request-decimate + request decimate + + --request-crop + request crop + + --request-fail + request failure + + --default-request + use printer default (default) +\endverbatim + +\subsection dcmpsprt_print_presentation_LUT_options print presentation LUT options +\verbatim + --default-plut + do not create presentation LUT (default) + + --identity + set IDENTITY presentation LUT shape + + --plut [l]ut identifier: string + add LUT l to print job + + --inverse-plut + render the inverse presentation LUT into the + bitmap of the hardcopy grayscale image + + --illumination [v]alue: integer (0..65535) + set illumination to v (in cd/m^2) + + --reflection [v]alue: integer (0..65535) + set reflected ambient light to v (in cd/m^2) +\endverbatim + +\subsection dcmpsprt_film_options basic film session options (only with --spool) +\verbatim + --copies [v]alue: integer (1..100, default: 1) + set number of copies to v + + --medium-type [v]alue: string + set medium type to v + + --destination [v]alue: string + set film destination to v + + --label [v]alue: string + set film session label to v + + --priority [v]alue: string + set print priority to v + + --owner [v]alue: string + set film session owner ID to v +\endverbatim + +\subsection dcmpsprt_annotation_options annotation options +\verbatim + --no-annotation + do not create annotation (default) + + -a --annotation [t]ext: string + create annotation with text t + + +pd --print-date + prepend date/time to annotation (default) + + -pd --print-no-date + do not prepend date/time to annotation + + +pn --print-name + prepend printer name to annotation (default) + + -pn --print-no-name + do not prepend printer name to annotation + + +pl --print-lighting + prepend illumination to annotation (default) + + -pl --print-no-lighting + do not prepend illumination to annotation +\endverbatim + +\subsection dcmpsprt_overlay_options overlay options +\verbatim + +O --overlay [f]ilename: string, [x] [y]: integer + load overlay data from PBM file f and display at position (x,y) + + +Og --ovl-graylevel [v]alue: integer (0..4095) + use overlay gray level v (default: 4095 = white) +\endverbatim + +\subsection dcmpsprt_other_print_options other print options +\verbatim + -l --layout [c]olumns [r]ows: integer (default: 1 1) + use 'STANDARD\c,r' image display format + + --filmsize [v]alue: string + set film size ID to v + + --magnification [v]alue: string + set magnification type to v + + --smoothing [v]alue: string + set smoothing type to v + + --configinfo [v]alue: string + set configuration information to v + + --resolution [v]alue: string + set requested resolution ID to v + + --border [v]alue: string + set border density to v + + --empty-image [v]alue: string + set empty image density to v + + --max-density [v]alue: string + set max density to v + + --min-density [v]alue: string + set min density to v + + --img-polarity [v]alue: string + set image box polarity to v (NORMAL or REVERSE) + + --img-request-size [v]alue: string + set requested image size to v (width in mm) + + --img-magnification [v]alue: string + set image box magnification type to v + + --img-smoothing [v]alue: string + set image box smoothing type to v + + --img-configinfo [v]alue: string + set image box configuration information to v +\endverbatim + +\section dcmpsprt_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmpsprt_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmpsprt_environment ENVIRONMENT + +The \b dcmpsprt utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmpsprt_files FILES + +\/dcmpstat.cfg, \/printers.cfg - sample configuration files + +\section dcmpsprt_see_also SEE ALSO + +dcmprscu(1) + +\section dcmpsprt_copyright COPYRIGHT + +Copyright (C) 1999-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmpsrcv.man b/dcmpstat/docs/dcmpsrcv.man new file mode 100644 index 00000000..de928659 --- /dev/null +++ b/dcmpstat/docs/dcmpsrcv.man @@ -0,0 +1,135 @@ +/*! + +\if MANPAGES +\page dcmpsrcv Network receive for presentation state viewer +\else +\page dcmpsrcv dcmpsrcv: Network receive for presentation state viewer +\endif + +\section dcmpsrcv_synopsis SYNOPSIS + +\verbatim +dcmpsrcv [options] config-file +\endverbatim + +\section dcmpsrcv_description DESCRIPTION + +The \b dcmpsrcv application is invoked by the Grayscale Softcopy Presentation +State Viewer and is not intended to be invoked manually. The application +reads the common configuration file which is shared between the different +components of the viewer and opens a TCP/IP socket on which incoming +association requests are accepted. The application sparks a separate +process for each DICOM connection. It supports the same storage SOP classes +as the \b storescp utility as SCP, but does not support encapsulated transfer +syntaxes. Incoming images are stored in the common viewer database. See the +full conformance statement for further details. + +\section dcmpsrcv_parameters PARAMETERS + +\verbatim +config-file configuration file to be read +\endverbatim + +\section dcmpsrcv_options OPTIONS + +\subsection dcmpsrcv_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger + + -t --terminate + terminate all running receivers +\endverbatim + +\section dcmpsrcv_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmpsrcv_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmpsrcv_environment ENVIRONMENT + +The \b dcmpsrcv utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmpsrcv_files FILES + +\/dcmpstat.cfg - sample configuration file + +\section dcmpsrcv_see_also SEE ALSO + +dcmpssnd(1), storescp(1) + +\section dcmpsrcv_copyright COPYRIGHT + +Copyright (C) 1998-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmpssnd.man b/dcmpstat/docs/dcmpssnd.man new file mode 100644 index 00000000..fc64ba60 --- /dev/null +++ b/dcmpstat/docs/dcmpssnd.man @@ -0,0 +1,143 @@ +/*! + +\if MANPAGES +\page dcmpssnd Network send for presentation state viewer +\else +\page dcmpssnd dcmpssnd: Network send for presentation state viewer +\endif + +\section dcmpssnd_synopsis SYNOPSIS + +\verbatim +dcmpssnd [options] config-file target study [series] [instance] +\endverbatim + +\section dcmpssnd_description DESCRIPTION + +The \b dcmpssnd application is invoked by the Grayscale Softcopy Presentation +State Viewer and is not intended to be invoked manually. The application +reads the common configuration file which is shared between the different +components of the viewer, attempts to establish a DICOM association with +the selected target and, if successful, selects the required DICOM +instances from the viewer's database and transmits them using the DICOM +storage service class, which is supported as SCU. When transmission is +finished (successfully or unsuccessfully), the application terminates. This +application supports the same storage SOP classes as the \b storescu utility, +but does not support encapsulated transfer syntaxes. See the full +conformance statement for further details. + + +\section dcmpssnd_parameters PARAMETERS + +\verbatim +config-file configuration file to be read + +target symbolic identifier of send target in config file + +study study instance UID of study in database to be sent + +series series instance UID (default: send complete study) + +instance SOP instance UID (default: send complete series) +\endverbatim + +\section dcmpssnd_options OPTIONS + +\subsection dcmpssnd_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\section dcmpssnd_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmpssnd_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmpssnd_environment ENVIRONMENT + +The \b dcmpssnd utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmpssnd_files FILES + +\/dcmpstat.cfg - sample configuration file + +\section dcmpssnd_see_also SEE ALSO + +dcmpsrcv(1), storescu(1) + +\section dcmpssnd_copyright COPYRIGHT + +Copyright (C) 1998-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmpstat/docs/dcmpstat.dox b/dcmpstat/docs/dcmpstat.dox new file mode 100644 index 00000000..01b8e23a --- /dev/null +++ b/dcmpstat/docs/dcmpstat.dox @@ -0,0 +1,79 @@ +/*! + +\page mod_dcmpstat dcmpstat: a presentation state library and utility apps + +This module contains classes that implement a high-level API for the DICOM +Softcopy Grayscale Presentation State Storage SOP Class. It also contains various +support classes that are used by DICOMscope, a free DICOM viewer that has been +developed as a demonstrator for presentation states. See http://dicom.offis.de/dscope + +The main interface classes are: +\li \b DVPresentationState +\li \b DVInterface +\li \b DVPSStoredPrint + +\section Tools + +This module contains the following command line tools: +\li \ref dcmmkcrv +\li \ref dcmmklut +\li \ref dcmp2pgm +\li \ref dcmprscp +\li \ref dcmprscu +\li \ref dcmpschk +\li \ref dcmpsmk +\li \ref dcmpsprt +\li \ref dcmpsrcv +\li \ref dcmpssnd + +\section Examples + +The following example shows how to create a default presentation state for a DICOM image: + +\code +DcmFileFormat infile; +DcmFileFormat outfile; +if (infile.loadFile("image.dcm").good()) +{ + DVPresentationState pstate; // presentation state handler + if (pstate.createFromImage(*infile.getDataset()).good()) + { + // serialize presentation state into DICOM data set structure + if (pstate.write(*outfile.getDataset(), OFFalse).good()) + { + // and write to file + outfile.saveFile("gsps.dcm", EXS_LittleEndianExplicit); + } + } +} +\endcode + +The following example shows how to apply the grayscale transformation pipeline +from a presentation state to a DICOM image: + +\code +DcmFileFormat imagefile; +DcmFileFormat gspsfile; +if (imagefile.loadFile("image.dcm").good() && + gspsfile.loadFile("gsps.dcm").good()) +{ + DVPresentationState pstate; // presentation state handler + if (pstate.read(*gspsfile.getDataset()).good()) // parse gsps object + { + // attach presentation state to image data + if (pstate.attachImage(&imagefile, OFFalse).good()) + { + const void *pixel; // pointer to pixel data, one byte per pixel + unsigned long width; // width of image bitmap + unsigned long height; // height of image bitmap + if (pstate.getPixelData(pixel, width, height).good()) + { + /* do something useful with the pixel data */ + } + pstate.detachImage(); // release connection between GSPS and image + } + } +} +\endcode + +*/ diff --git a/dcmpstat/etc/CMakeLists.txt b/dcmpstat/etc/CMakeLists.txt new file mode 100644 index 00000000..9f4bd0b1 --- /dev/null +++ b/dcmpstat/etc/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES dcmpstat.cfg printers.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc) diff --git a/dcmpstat/etc/Makefile.in b/dcmpstat/etc/Makefile.in new file mode 100644 index 00000000..24db0ec7 --- /dev/null +++ b/dcmpstat/etc/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmpstat/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = dcmpstat.cfg printers.cfg + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(etcdir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(etcdir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmpstat/etc/dcmpstat.cfg b/dcmpstat/etc/dcmpstat.cfg new file mode 100644 index 00000000..5b575948 --- /dev/null +++ b/dcmpstat/etc/dcmpstat.cfg @@ -0,0 +1,1388 @@ +# +# Copyright (C) 1998-2019, OFFIS e.V. +# All rights reserved. See COPYRIGHT file for details. +# +# This software and supporting documentation were developed by +# +# OFFIS e.V. +# R&D Division Health +# Escherweg 2 +# D-26121 Oldenburg, Germany +# +# +# Module: dcmpstat +# +# Author: Marco Eichelberg et al. +# +# Purpose: Sample configuration file for DCMTK "dcmpstat" tools and the +# DICOMscope application +# + +# ============================================================================ +# General settings for the viewer applications +[[GENERAL]] +# ============================================================================ + +# ---------------------------------------------------------------------------- +# General application settings in this section. +[APPLICATION] +# ---------------------------------------------------------------------------- + +# Directory in which log files are stored. +# Default: application root directory, for print: same as spool directory. +LogDirectory = log + +# Name of the file where the general log messages are stored. +# Default: no log file, i.e. do not write any log messages. +LogFile = general.log + +# Filter for the general log messages: +# ERROR = only error messages +# WARN = also warning messages (includes ERROR) +# INFO = also informational messages (includes WARN) +# DEBUG = also debug messages (includes INFO) +# Default: no general log messages at all. +LogLevel = INFO + +# Port on which the GUI application accepts notification messages from +# the network processes. Default: 0 (no notifications sent) +MessagePort = 11000 + +# Indicates whether client processes are allowed to keep their notification +# message port open during the lifetime of the process. Default: false +KeepMessagePortOpen = false + +# ---------------------------------------------------------------------------- +# Monitor calibration settings in this section. +[MONITOR] +# ---------------------------------------------------------------------------- + +# Settings for Clinton Medical monitor with SXGA 1152x864 + +# monitor description file for software based correction (GSDF etc.) +#Characteristics = monitor.lut + +# screen resolution in pixels, width\height +Resolution = 1152\864 + +# size of the visible screen area in mm, width\height +Screensize = 400\300 + +# preview size in pixels, width\height +PreviewSize = 256\256 + +# Settings for Siemens Monitor with Dome Board +# +# screen resolution in pixels, width\height +#Resolution = 2048\2560 +# +# size of the visible screen area in mm, width\height +#ScreenSize = 280\367 +# +# preview size in pixels, width\height +#PreviewSize = 512\512 + +# ---------------------------------------------------------------------------- +# General print settings in this section. +[PRINT] +# ---------------------------------------------------------------------------- + +# Path to the DICOM print spooler (Print Management SCU) application to be used +Spooler = dcmprscu + +# Path to the DICOM print server (Print Management SCP) application to be used +Server = dcmprscp + +# Directory in which spooled print jobs reside +Directory = spool + +# Log complete DICOM protocol (--dump --verbose) in print spooler/server. +# Default: false +DetailedLog = true + +# Log complete ACSE and DIMSE protocol in binary form (as DICOM file). +# This setting is independent from the DetailedLog setting and currently +# only implemented by the print server. Default: false +BinaryLog = false + +# Time (in seconds) the print spooler should wait before polling (again) +# the spool directory. Default: use spooler default. +Sleep = 5 + +# Minimum resolution for a print bitmap (width\height in pixel). If a +# bitmap to be printed is smaller than this, it is scaled up by an +# appropriate integer factor before burning in graphical annotations. This +# allows to have acceptable annotation visibility on low resolution +# bitmaps. +# Default: No lower limit for the print bitmap resolution. +MinPrintResolution = 1024\1024 + +# Maximum resolution for a print bitmap (width\height in pixel). If a +# bitmap to be printed is larger than this, it is scaled down by an +# appropriate integer factor before sent to the printer. This allows to +# reduce the amount of pixel data to be transfered. +# Default: No upper limit for the print bitmap resolution. +MaxPrintResolution = 8192\8192 + +# Specifies the default value for the Illumination to be transmitted to the +# printer when using the Presentation LUT SOP Class. Default: 2000 +DefaultIllumination = 2000 + +# Specifies the default value for the Reflected Ambient Light to be transmitted +# to the printer when using the Presentation LUT SOP Class. Default: 10 +DefaultReflection = 10 + +# Delete print job files from spool directory after processing. +# If false, spool jobs are renamed instead. Default is false. +DeletePrintJobs = true + +# Always delete terminate job files from spool directory (these special print job files +# are created to inform the spool processes that the application has been terminated). +# If false, terminate jobs are handled like normal print jobs (see DeletePrintJobs). +# Default is false. +AlwaysDeleteTerminateJobs = true + +# ---------------------------------------------------------------------------- +# Database settings in this section. +[DATABASE] +# ---------------------------------------------------------------------------- + +# directory in which DICOM images and index.dat reside +Directory = database + +# Path to the dump tool used to display the contents of DICOM files located +# in the database +Dump = c:\program files\tcl\bin\wish83 dcmpsdmp.tcl + +# Path to the check tool used to evaluate the contents of DICOM files located +# in the database +Check = c:\program files\tcl\bin\wish83 dcmpschk.tcl + +# ---------------------------------------------------------------------------- +# General Presentation LUT settings in this section. +[LUT] +# ---------------------------------------------------------------------------- + +# directory in which LUT files reside +Directory = lut + +# ---------------------------------------------------------------------------- +# General Structured Reporting (SR) settings in this section. +[REPORT] +# ---------------------------------------------------------------------------- + +# directory in which SR "template" files reside +Directory = reports + +# ---------------------------------------------------------------------------- +# This section contains the settings for network communication. +[NETWORK] +# ---------------------------------------------------------------------------- + +# Path to the DICOM sender (Store SCU) application to be used +Sender = dcmpssnd + +# Path to the DICOM receiver (Store SCP) application to be used +Receiver = dcmpsrcv + +# Application entity title sender processes use to identify themselves. +# Also used as default application entity title for the [[communication]] +# section. +aetitle = DCMPSTATE + +# ---------------------------------------------------------------------------- +# This section contains the settings for secure TLS (Transport Layer +# Security) communication. +[TLS] +# ---------------------------------------------------------------------------- + +# directory in which TLS related files (certificates, keys, random data, +# Diffie-Hellman parameters etc.) are located. The content of this directory +# should be kept confidential because it may help an attacker to break +# the security of the TLS transmission. +# +TLSDirectory = tls + +# directory in which certificates of the trusted Certification Authorities +# are located. During negotiation of a secure TLS connection, the remote +# site's certificate may be verified, depending on the settings for the +# sender or receiver process in [[communication]]. Verification checks +# if the certificate has been issued by one of the CAs located in this +# directory. This means that the content of this directory defines a simple +# means of access control for TLS communication. +# +# File names of certificates in this directory must have +# names derived from a hash key of the certificate DN, see -hash +# option of openssl x509 command. +# +CACertificateDirectory = cacerts + +# directory in which certificates and encrypted private keys of the known +# users are located. User certificates and keys are used for the +# verification of DICOM Structured Reports and for the creation of digital +# signatures. +# +UserKeyDirectory = usrcerts + +# DICOMscope allows to have certificates, keys and Diffie-Hellman parameters +# either in PEM ("privacy enhanced mail") format or in DER ("distinguished +# encoding rules") format. However, all files within one DICOMscope +# installation must use the same format, which is defined by this setting. +# True => PEM format, false => DER format. Default is PEM. +# +UsePEMFormat = true + +# ---------------------------------------------------------------------------- +# This section contains the settings for the query/retrieve server. +[QUERY_RETRIEVE] +# ---------------------------------------------------------------------------- + +# Specifies whether the configuration file for the query/retrieve server is +# created automatically from the data contained in this file each time the +# server is started. Default is true. +AutoCreateConfigFile = true + +# Path to the DICOM query/retrieve server (Q/R SCP) to be used. +# The configuration filename is created from this entry by adding the file +# extension ".cfg". +Server = dcmqrscp + +# IP Port number on which the server listens for new connections. +# On Unix platforms, the receiver must be started with setuid root +# if port numbers < 1024 (i.e. the standard DICOM port number 104) +# should be used. +Port = 10003 + +# Maximum PDU (protocol data unit) size to use when negotiating +# incoming connections. Must be between 4096 and 131072. +# Default is 16384. +MaxPDU = 32768 + +# Application entity title dcmqrscp will use to identify itself. +AETitle = DCMQRSCP + +# Maximum number of associations the server can handle at the same time. +# This is only applicable on Unix platforms, since Windows does not support +# the fork() command which is used for this purpose. +MaxAssociations = 16 + +# Timeout (in seconds) for outgoing connection requests, must be larger +# than zero. Optional setting, default is Unlimited (wait for TCP/IP timeout). +# Timeout = 5 + +# ---------------------------------------------------------------------------- +# This section contains the settings for the graphical user interface (GUI). +[GUI] +# ---------------------------------------------------------------------------- + +# If this setting is true, we assume a system with very high resolution +# (2 x 2.5K) and a graphics board that performs calibration according to the +# DICOM GSDF in hardware. Therefore, we display much larger icons and +# disable rendering of the GSDF in software. This setting requires that +# a static 256 grayscale color palette is used by the operating system +# to access the graphics board. +HighResolutionGraphics = false + +#Starts the update thread for the study browser. +#Defaults is true +AutoUpdateStudyBrowser = true + +#Sets the background color of the study manager as rgb color +#Default: If HighResolutionGraphics, the default is 0\0\0 otherwise 255\255\255 +#BackgroundColor = 255\255\255 + +# Sets the size of the fonts used in all GUI components +# Default: If HighResolutionGraphics, the default is 30 otherwise 12 +#FontSize = 30 + +# Sets the name of the fonts used in all GUI components +# Default value: SansSerif +#FontName = SansSerif + +# Sets the size of the fonts used for textual annotations +# Default: If HighResolutionGraphics, the default is 48 otherwise 16 +#FontSizeText = 16 + +# Sets the name of the fonts used for textual annotations +# Default value: SansSerif +#FontNameText = SansSerif + +# Sets the size of the fonts used for the process log +# Default: If HighResolutionGraphics, the default is 30 otherwise 12 +#FontSizeLog = 30 + +# Sets the name of the fonts used for the process log +# Default value: Monospaced +#FontNameLog = Monospaced + +# Sets the placement of the main tab in the GUI. +# Valid values are: North, South, East, West. Default is North. +#TabPlacement = North + +# Sets the placement of the image processing panel in the viewer. +# Valid values are: North, South, East, West, None. +# Default: If HighResolutionGraphics, the default is East otherwise South +#FunctionPanelPlacement = East + +# Sets the placement of the paint function panel in the viewer. +# Valid values are: North, South, East, West, None, Toolbar, Integrated +# Default value: Integrated +#PaintPanelPlacement = Integrated + +# Checks if the presentation state information panel should be visible +# Valid values are: true, false. Default value: false +PSPanelOn = true + +# Displays a warning message if an unsigned instance (report, presentation +# state, image) referenced from the current report is opened +# Valid values are: true, false. Default value: true +WarnUnsignedObjectsInSR = true + +# ============================================================================ +# Storage and Print applications are configured in the following section. +[[COMMUNICATION]] +# ============================================================================ + +# ---------------------------------------------------------------------------- +# The following text documents all settings defined for a local or remote +# storage or print application. Each application or communication target +# requires one section with a unique section title. +# +# [COMMUNICATION_PEER_1] +# ---------------------------------------------------------------------------- +# +# The following entry defines which DICOM services are offered by the +# application described in this section. Four types are supported: +# +# STORAGE - a remote DICOM Storage Service Class SCP. Entries of this type are +# shown as "send targets" in the DICOMscope browser GUI. An entry of this +# type is also required for each system that wants to download objects +# from the DICOMscope database using Query/Retrieve. The settings from +# this section are used to resolve an application entity title into the +# target hostname and IP port number. +# +# RECEIVER - a local DICOM Storage Service Class SCP which accepts incoming +# images and stores them in the local database. +# +# PRINTER - a remote DICOM Print Management Service Class SCP. +# For each entry of this type, a separate Print SCU ("spooler process") +# is started together with DICOMscope. +# Entries of this type are shown as printers in the DICOMscope +# print preview GUI. +# +# LOCALPRINTER - a DICOM Print Management SCP that is running as part of +# the DICOMscope software on the local system. For each entry of this +# type both a DICOM Print SCP and a Print SCU (spooler) are started +# together with DICOMscope. This allows DICOMscope to print "to itself". +# +# Default value for this setting is: STORAGE. +# +# type = LOCALPRINTER +# +# ---------------------------------------------------------------------------- +# +# Hostname: The IP number or domain name of the communication partner in +# conventional TCP/IP notation. For entries of type LOCALPRINTER this setting +# must have the value "localhost". This setting is mandatory, no default. +# +# hostname = localhost +# +# ---------------------------------------------------------------------------- +# +# IP port number under which the application or remote peer receives DICOM +# associations. +# +# port = 104 +# +# ---------------------------------------------------------------------------- +# +# Human readable description of the communication partner. Used in the GUI to +# present the communication partner to the application user in selection boxes. +# +# description = Local DICOM Print SCP +# +# ---------------------------------------------------------------------------- +# +# For outgoing connections (STORAGE, PRINTER) this setting contains the +# called application entity title of the communication partner. +# For incoming connections (RECEIVER, LOCALPRINTER) this setting contains +# the responding application entity used during association negotiation. +# +# aetitle = DICOM_PRINTER +# +# ---------------------------------------------------------------------------- +# +# Only negotiate the default Implicit VR Little Endian transfer syntax for +# all abstract syntaxes. This setting is useful if we're communicating with +# very old DICOM software which claims to support Explicit VR communication +# but fails to do so... Optional setting, default is: false. +# +# ImplicitOnly = false +# +# ---------------------------------------------------------------------------- +# +# Do not create data types (VRs) that were defined in post-1993 editions +# of the DICOM standard when converting implicit VR files to explicit VR +# network transmission. Maybe necessary for old DICOM Store SCPs. +# Optional setting, default is: false. +# +# DisableNewVRs = false +# +# ---------------------------------------------------------------------------- +# +# Maximum PDU (protocol data unit) size to negotiate for incoming PDUs. +# Value must be between 4096 and 131072. Default is 16384. +# +# MaxPDU = 32768 +# +# ---------------------------------------------------------------------------- +# +# Timeout (in seconds) for outgoing connection requests, must be larger +# than zero. Optional setting, default is Unlimited (wait for TCP/IP timeout). +# +# Timeout = 5 +# +# ---------------------------------------------------------------------------- +# +# Use the Transport Layer Security (TLS) protocol for image transmission +# in accordance with the DICOM Security Enhancements One (Supplement 31). +# Optional setting, default is: false. +# +# UseTLS = false +# +# ---------------------------------------------------------------------------- +# +# Filename of the X.509 certificate to be used for TLS authentication. +# The file should be located in the directory specified by +# GENERAL/TLS/TLSDIRECTORY. +# +# SCP usage: The TLS protocol requires that a TLS server +# must have a certificate. Therefore, this parameter is mandatory. +# If absent, the certificate file is loaded from "sitecert.pem" in the +# TLS directory. +# +# SCU usage: For a TLS client the certificate is optional. +# Therefore, this setting is optional for Store SCUs. If absent, no +# TLS authentication is performed for the client. Warning: Anonymous TLS +# may be susceptible to man-in-the-middle attacks. +# +# Certificate = cert.pem +# +# ---------------------------------------------------------------------------- +# +# Filename of the private key "matching" the certificate, +# to be used for TLS authentication. The file should be located in the +# directory specified by GENERAL/TLS/TLSDIRECTORY. +# +# SCP usage: The TLS protocol requires that a TLS server +# must have a certificate. Therefore, this parameter is mandatory. +# If absent, the certificate file is loaded from "sitekey.pem" in the +# TLS directory. +# +# SCU usage: For a TLS client the certificate is optional. +# Therefore, this setting is optional for Store SCUs. If absent, no +# TLS authentication is performed for the client. Warning: Anonymous TLS +# may be susceptible to man-in-the-middle attacks. +# +# PrivateKey = pkey.pem +# +# ---------------------------------------------------------------------------- +# +# Private keys may be stored in encrypted form (e.g. 3DES), +# protected with a password. Since the DICOMscope Store SCU/SCP processes +# do not have any interaction with the user, they cannot request a password +# from the command line. Two options are available to the user: +# - the private key can be unencrypted. In this case this setting should +# be absent from the config file. Users should carefully adjust file system +# access rights to the private key file to make sure that the private key +# is not compromised (e.g. copied by an unauthorized used). +# - the private key can be encrypted, with the password in clear text in this +# configuration file. In this case, the DICOMscope configuration file must +# be protected from read access by unauthorized users, otherwise the private +# key may be compromised as well. +# A real secure approach would be to keep the private key in a safe place, +# e.g. in a microprocessor card, but this is not yet supported. +# +# PrivateKeyPassword = Should_be_kept_secret +# +# ---------------------------------------------------------------------------- +# +# Select the following security profile when using TLS connections. +# Known terms are: +# BCP195: BCP 195 TLS Profile (default) +# BCP195-ND: Non-downgrading BCP 195 TLS Profile +# BCP195-EX: Extended BCP 195 TLS Profile +# AES: AES TLS Secure Transport Connection Profile (retired) +# BASIC: Basic TLS Secure Transport Connection Profile (retired) +# NULL: Authenticated unencrypted communication (retired) +# +# TLSProfile = BCP195 +# +# Note 1: The direct configuration of a list of ciphersuites using the +# "CipherSuites" configuration setting is not supported anymore; +# this setting will be ignored. +# +# Note 2: The BCP195 profile, which is the default, provides backwards +# compatibility with older implementations only supporting the AES or +# BASIC profile. +# +# Note 3: The BASIC profile requires 3DES to be enabled in the OpenSSL +# library that DCMTK is compiled with. Starting with OpenSSL 1.1.0, this +# has to be manually enabled at compile time. +# +# ---------------------------------------------------------------------------- +# +# This setting defines the policy for handling the remote peer's TLS +# certificate. Known terms are: +# REQUIRE: verify peer certificate, refuse transmission if absent +# VERIFY: verify peer certificate if present +# IGNORE: don't verify peer certificate +# Optional setting, default is: REQUIRE. +# +# PeerAuthentication = REQUIRE +# +# ---------------------------------------------------------------------------- +# +# File containing a set of random-generated Diffie-Hellman parameters +# as required for DH[E]/DSS ciphersuites. +# File should be located in the directory specified by GENERAL/TLS/TLSDIRECTORY +# in the format specified by GENERAL/TLS/USEPEMFORMAT. +# Optional setting, default is: used built-in set of DH parameters. +# +# DiffieHellmanParameters = dhparams.pem +# +# ---------------------------------------------------------------------------- +# +# File containing random data which is used to initialize the pseudo-random +# generator. After transmission, a modified file is written back. +# The random seed file should be different for each send/receive +# target - see DCMTK documentation on random data for details. +# The file should be located in the directory specified by +# GENERAL/TLS/TLSDIRECTORY. +# Optional setting, default is: no random data (which may cause TLS connection +# setup to fail). +# +# RandomSeed = random.dat +# +# +# ============================================================================ +# The next two settings described below are only used with entries of type +# STORAGE and RECEIVER and have no meaning for PRINTER or LOCALPRINTER. +# ============================================================================ +# +# Receive data in "bit preserving mode". In this mode, data is stored +# to file directly as read from network. Transfer syntax in file is +# identical to transfer syntax used for network transmission. +# If this mode is switched off (default), images are converted to explicit VR +# Little Endian format before storing in file, which makes it easier +# to burn images on CD-R in "General Purpose Image Exchange Profile" format. +# Optional entry, default is: false +# +# BitPreservingMode = false +# +# ---------------------------------------------------------------------------- +# +# Silently ignore space padded SOP Class and SOP Instance UIDs in incoming +# images. Optional setting, default is: false. +# +# CorrectUIDPadding = false +# +# +# ============================================================================ +# The remaining settings described below are only used with entries of type +# PRINTER and LOCALPRINTER and have no meaning for STORAGE or RECEIVER. +# ============================================================================ +# +# Print SCU usage: assume that the Print SCP supports transmission of image +# pixel data with 12 bits/pixel in the Basic Grayscale Image Box SOP Class. +# Print SCP usage: accept image pixel data with 12 bits/pixel. +# Optional setting, default is: true. Not used for Storage type entries. +# +# Supports12Bit = true +# +# ---------------------------------------------------------------------------- +# +# Print SCU usage: assume that the Print SCP supports the Presentation LUT +# SOP Class (Supplement 22) and attempt to negotiate it during association +# negotiation. +# Print SCP usage: activate support for the Presentation LUT SOP Class. +# Optional setting, default is: false. Not used for Storage type entries. +# +# SupportsPresentationLUT = true +# +# ---------------------------------------------------------------------------- +# +# The 1999 edition of the DICOM standard contains an inconsistency in the +# definition of the Presentation LUT SOP class. The attributes +# "Referenced Presentation LUT", "Illumination" and "Reflected Ambient Light" +# can either be part of the Basic Film Session or be part of the Basic Film +# Box. DICOM Correction Proposal CP 173 defines that these attributes +# have to be specified on Basic Film Box level. However, not all existing +# Print SCPs supporting the Presentation LUT SOP Class are implemented +# in accordance with CP 173. Both Print SCU and Print SCP can, therefore, +# be configured to use either Film Session or Film Box (but never both). +# +# Print SCU usage: If flag is true, transmit attributes in the Basic Film +# session instead of the Basic Film Box. +# Print SCP usage: If flag is true, attributes are accepted and returned +# in Basic Film Session instead of Basic Film Box. +# Optional setting, default is: false (which means that behaviour will be +# consistent with CP 173.) Not used for Storage type entries. +# +# PresentationLUTinFilmSession = false +# +# ---------------------------------------------------------------------------- +# +# Some Print SCPs which support Presentation LUTs require that the number +# of entries in a Presentation LUT matches the bit depth of the image pixel +# data (4096 entries for 12 bit pixel data, 256 entries for 8 bit pixel +# data). +# +# Print SCU usage: If flag is true, assume that Print SCP requires match +# between Presentation LUT and image data. If for a given print job this +# match cannot be guaranteed, perform rendering of the Presentation LUT in +# the Print SCU and use an IDENTITY Presentation LUT shape in the Print SCP. +# Print SCP usage: If flag is true, enforce a matching rule as described +# above. All Presentation LUT N-CREATE or Basic Grayscale Image Box N-SET +# operations that would violate the rule will be refused. +# Optional setting, default is: true. Not used for Storage type entries. +# +# PresentationLUTMatchRequired = true +# +# ---------------------------------------------------------------------------- +# +# Print SCU usage: if the printer supports 12-bit image transmission and the +# film is to be printed with a Presentation LUT that could be rendered either +# in the print client or in the printer without loss of precision, +# prefer rendering in the printer. +# Print SCP usage: flag is ignored. +# Optional setting, default is: false. Not used for Storage type entries. +# +# PresentationLUTPreferSCPRendering = false +# +# ---------------------------------------------------------------------------- +# +# Some Print SCPs do not support the optional "Requested Image Size" +# attribute in Basic Grayscale Image Box N-SET operations. +# +# Print SCU usage: If flag is false, assume that the printer does not support +# requested image size, never send this attribute. +# Print SCP usage: If flag is true, support requested image size. Otherwise +# refuse N-SET operations containing a requested image size attribute. +# Optional setting, default is: false. Not used for Storage type entries. +# +# SupportsImageSize = false +# +# ---------------------------------------------------------------------------- +# +# Some Print SCPs do not support the optional "Requested Decimate/Crop Behaviour" +# attribute defined in Supplement 37 in Basic Grayscale Image Box N-SET +# operations. +# +# Print SCU usage: If flag is false, assume that the printer does not support +# requested decimate/crop behaviour, never send this attribute. +# Print SCP usage: If flag is true, support requested decimate/crop behaviour. +# Otherwise refuse N-SET operations containing this attribute. +# Optional setting, default is: false. Not used for Storage type entries. +# +# SupportsDecimateCrop = false +# +# ---------------------------------------------------------------------------- +# +# Some Print SCPs do not support the optional "Trim" attribute +# in Basic Film Box N-CREATE or N-SET operations. +# +# Print SCU usage: If flag is false, assume that the printer does not support +# trim, never send this attribute. +# Print SCP usage: If flag is true, support trim. +# Otherwise refuse N-CREATE or N-SET operations containing this attribute. +# Optional setting, default is: false. Not used for Storage type entries. +# +# SupportsTrim = true +# +# ---------------------------------------------------------------------------- +# +# Print SCU usage: this entry contains a list of all STANDARD\C,R column, row +# combinations supported as Image Display Format by the Print SCP +# for portrait orientation. Landscape image display formats are derived +# automatically by exchanging column and row for each format. +# Print SCP usage: this entry specifies all STANDARD\C,R image display formats +# accepted by the Print SCP for portrait orientation. Landscape image display +# formats are also derived automatically. +# This is a mandatory entry, no default. +# +# DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 +# +# ---------------------------------------------------------------------------- +# +# Film Size ID identifiers supported by the printer for the Basic Film Box. +# Multiple values can be specified, must be separated by '\' characters. +# +# Print SCU usage: Optional setting, default: don't specify film size ID, +# use printer default. +# Print SCP usage: The first specified value is used as the default. This +# is a mandatory setting for entries of type LOCALPRINTER. +# +# FilmSizeID = 8INX10IN\10INX12IN\10INX14IN\11INX14IN\14INX14IN\14INX17IN\24CMX24CM\24CMX30CM +# +# ---------------------------------------------------------------------------- +# +# Medium Type identifiers supported by the printer for the Basic Film Session. +# Multiple values can be specified, must be separated by '\' characters. +# +# Print SCU usage: Optional setting, default: don't specify medium type, +# use printer default. +# Print SCP usage: The first specified value is used as the default. This +# is a mandatory entry. +# +# MediumType = PAPER\CLEAR FILM\BLUE FILM +# +# ---------------------------------------------------------------------------- +# +# Requested Resolution ID identifiers supported by the printer +# for the Basic Film Box (optional attribute defined in Supplement 37). +# Multiple values can be specified, must be separated by '\' characters. +# +# Print SCU usage: Optional setting, default: don't specify resolution ID, +# use printer default. +# Print SCP usage: The first specified value is used as the default. This +# is an optional entry. If omitted, the Print SCP does not support the +# attribute and rejects N-CREATE or N-SET requests containing the attribute. +# +# ResolutionID = STANDARD\HIGH +# +# ---------------------------------------------------------------------------- +# +# Magnification Type identifiers supported by the printer for the Basic +# Film Box or Basic Grayscale Image Box. Multiple values can be specified, +# must be separated by '\' characters. +# +# Print SCU usage: Optional setting, default: don't specify magnification type, +# use printer default. +# Print SCP usage: The first specified value is used as the default. This +# is a mandatory entry. +# +# MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +# +# ---------------------------------------------------------------------------- +# +# Smoothing Type identifiers supported by the printer for the Basic Film +# Box or Image Box. Multiple values can be specified, must be separated by +# '\' characters. +# +# Print SCU usage: Optional setting, default: don't specify smoothing type, +# use printer default. +# Print SCP usage: The first specified value is used as the default. This +# is an optional entry. If omitted, the Print SCP does not support the +# attribute and rejects N-CREATE or N-SET requests containing the attribute. +# +# SmoothingType = NONE +# +# ---------------------------------------------------------------------------- +# +# Border Density identifiers supported by the printer for the Basic Film +# Box. Multiple values can be specified, must be separated by '\' +# characters. +# +# Print SCU usage: Optional setting, default: don't specify border density, +# use printer default. +# Print SCP usage: If any of the identifiers is numeric, then all numbers +# are accepted. The first specified value is used as the default. This is +# an optional entry. If omitted, the Print SCP does not support the +# attribute and rejects N-CREATE or N-SET requests containing the +# attribtute. +# +# BorderDensity = BLACK\WHITE\150 +# +# ---------------------------------------------------------------------------- +# +# Empty Image Density identifiers supported by the printer for the Basic +# Film Box. Multiple values can be specified, must be separated by '\' +# characters. +# +# Print SCU usage: Optional setting, default: don't specify empty image +# density, use printer default. +# Print SCP usage: If any of the identifiers is numeric, then all numbers +# are accepted. The first specified value is used as the default. This is +# an optional entry. If omitted, the Print SCP does not support the +# attribute and rejects N-CREATE or N-SET requests containing the +# attribtute. +# +# EmptyImageDensity = BLACK\WHITE\150 +# +# ---------------------------------------------------------------------------- +# +# Print SCU usage: Max Density values supported by the printer for the +# Basic Film Box. Multiple values can be specified, must be separated by +# '\' characters. Optional setting, default: don't specify max density +# density, use printer default. +# Print SCP usage: only the first value is read and defines the default max +# density that is used when the Print SCU does not specify max density. +# This is a mandatory entry. +# +# MaxDensity = 320\310\300\290\280\270 +# +# ---------------------------------------------------------------------------- +# +# Print SCU usage: Min Density values supported by the printer for the +# Basic Film Box. Multiple values can be specified, must be separated by +# '\' characters. Optional setting, default: don't specify min density +# density, use printer default. +# Print SCP usage: only the first value is read and defines the default min +# density that is used when the Print SCU does not specify min density. +# This is an optional entry. If omitted, the Print SCP does not support the +# attribute and rejects N-CREATE or N-SET requests containing the +# attribtute. +# +# MinDensity = 20\25\30\35\40\45\50 +# +# ---------------------------------------------------------------------------- +# +# The DICOMscope application provides limited support for the Basic +# Annotation Box SOP Class. When printing on printers supporting +# Annotation, a single annotation can be specified for each print job. This +# setting defines the annotation display format ID and annotation position +# that are used when creating the annotation. +# +# Print SCU usage: Two values must be specified: First the Annotation +# Position, then the Annotation Display Format ID, separated by '\'. This +# is an optional setting, default is not to use Basic Annotation Box. +# Print SCP usage: The Print SCP component does not support the Basic +# Annotation Box SOP Class. This setting should be omitted for all entries +# of type LOCALPRINTER. +# +# Annotation = 1\ANNOTATION +# +# ---------------------------------------------------------------------------- +# +# Some printers use the Film Session Label as a replacement for annotations. +# +# Print SCU usage: If flag is true, any annotation defined in the user +# interface is replicated in the Film Session Label attribute of the Basic +# Film Session. This is an optional setting, default is: false. +# Print SCP usage: Ignored. This setting should be omitted for all entries +# of type LOCALPRINTER. +# +# SessionLabelAnnotation = false +# +# ---------------------------------------------------------------------------- +# +# Configuration Information that can be sent to the printer for the Basic +# Film Box or Image Box. Only a single value per entry can be specified +# because values may contain backslash characters. (VR=ST). Keywords are +# "Configuration_1", "Configuration_2", etc., without leading zeroes. +# +# Print SCU usage: These are optional settings, default is not to use +# configuration information. +# Print SCP usage: These are optional settings. If omitted, the Print +# SCP does not support the attribute and rejects N-CREATE or N-SET requests +# containing the attribute. The Print SCP default for Configuration +# Information is always an empty string. +# +# Configuration_1 = Configuration Value 1 +# Configuration_2 = Configuration Value 2 +# +# ---------------------------------------------------------------------------- +# +# Film Destination identifiers supported by the Print SCP for the Basic +# Film Session. Multiple values can be specified, must be separated by '\' +# characters. +# +# Print SCU usage: ignored. +# Print SCP usage: The first specified value is used as the default. This +# is a mandatory entry. +# +# FilmDestination = MAGAZINE\PROCESSOR\BIN_1\BIN_2 +# +# ---------------------------------------------------------------------------- +# +# The Affected SOP Class UID attribute is optional in DIMSE N-CREATE-RSP +# messages but some clients rely on its presence. This setting can be used +# to test client behaviour. +# +# Print SCU usage: ignored. +# Print SCP usage: Defines whether the Print SCP should include Affected SOP +# Class UID in DIMSE N-CREATE-RSP messages. This is an optional setting, +# default is false. +# +# OmitSOPClassUIDFromCreateResponse = false +# +# ---------------------------------------------------------------------------- + + +# ---------------------------------------------------------------------------- +# +# We define three send targets: +# One is a standard Store SCP which accepts conventional +# DICOM associations on port 10004, the others accept TLS secured DICOM +# associations on port 10007, with different ciphersuites. +# +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +[STORE_1] +# ---------------------------------------------------------------------------- +Type = STORAGE +Aetitle = STORESCP +Description = Hostname, unsecure transmission +Hostname = Hostname +MaxPDU = 32768 +Port = 10004 +ImplicitOnly = false +DisableNewVRs = false + +# ---------------------------------------------------------------------------- +[STORE_2] +# ---------------------------------------------------------------------------- +Type = STORAGE +Aetitle = STORESCP +Description = Hostname, TLS transmission, no encryption +Hostname = Hostname +MaxPDU = 32768 +Port = 10007 +ImplicitOnly = false +DisableNewVRs = false +UseTLS = true +TLSProfile = NULL +RandomSeed = store2.rnd +PeerAuthentication = REQUIRE +Certificate = sitecert.pem +PrivateKey = sitekey.pem + +# ---------------------------------------------------------------------------- +[STORE_3] +# ---------------------------------------------------------------------------- +Type = STORAGE +Aetitle = STORESCP +Description = Hostname, TLS transmission, with encryption +Hostname = Hostname +MaxPDU = 32768 +Port = 10007 +ImplicitOnly = false +DisableNewVRs = false +UseTLS = true +TLSProfile = BCP195 +RandomSeed = store3.rnd +PeerAuthentication = REQUIRE +Certificate = sitecert.pem +PrivateKey = sitekey.pem + +# ---------------------------------------------------------------------------- +# +# We support two types of receivers: +# One is a standard Store SCP which accepts conventional +# DICOM associations on port 10004, the other one accepts TLS secured DICOM +# associations on port 10007. +# +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +[RECEIVE_1] +# ---------------------------------------------------------------------------- +Type = RECEIVER +Aetitle = STORESCP1 +Description = Standard receiver at port 10004 +Hostname = localhost +MaxPDU = 32768 +Port = 10004 +ImplicitOnly = false +DisableNewVRs = false +BitPreservingMode = false + +# ---------------------------------------------------------------------------- +[RECEIVE_2] +# We use the BCP 195 TLS profile. We require that the client authenticates +# with a certificate issued by a Certification Authority that we trust. +# ---------------------------------------------------------------------------- +Type = RECEIVER +Aetitle = STORESCP2 +Description = Secure TLS receiver at port 10007 +Hostname = localhost +MaxPDU = 32768 +Port = 10007 +ImplicitOnly = false +DisableNewVRs = false +BitPreservingMode = false +UseTLS = true +TLSProfile = BCP195 +RandomSeed = receiver.rnd +PeerAuthentication = REQUIRE +Certificate = sitecert.pem +PrivateKey = sitekey.pem + +# ---------------------------------------------------------------------------- +# Print SCP that supports most options of the DICOM Print protocol and +# the IHE technical framework requirements for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - layouts: 1x1, 1x2, 2x2, 2x3, 3x3, 3x4, 3x5, 4x4, 4x5 +# - supports typical defined terms for empty image density, film +# destination, film size ID, magnification type, medium type, resolution +# ID, requested decimate/crop behaviour, image size and trim. +# ---------------------------------------------------------------------------- + +[IHEFULL] +Aetitle = IHEFULL +Description = IHE Full Print SCP +Hostname = localhost +Port = 10005 +Type = LOCALPRINTER + +BorderDensity = 150\20\BLACK\WHITE +DisableNewVRs = false +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 +EmptyImageDensity = 20\BLACK\WHITE +FilmDestination = MAGAZINE\PROCESSOR\BIN_1\BIN_2 +FilmSizeID = 8INX10IN\10INX12IN\10INX14IN\11INX14IN\14INX14IN\14INX17IN\24CMX24CM\24CMX30CM +ImplicitOnly = false +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 32768 +MediumType = PAPER\CLEAR FILM\BLUE FILM +MinDensity = 20 +OmitSOPClassUIDFromCreateResponse = false +PresentationLUTMatchRequired = false +PresentationLUTinFilmSession = false +ResolutionID = STANDARD\HIGH +SmoothingType = NONE +Supports12Bit = true +SupportsDecimateCrop = true +SupportsImageSize = true +SupportsPresentationLUT = true +SupportsTrim = true + +# ---------------------------------------------------------------------------- +# Print SCP that only supports the absolute minimum that is required by +# the IHE technical framework for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - supports STANDARD\1,1 layout only +# ---------------------------------------------------------------------------- + +[IHERESTRICTED] +Aetitle = IHERESTRICTED +Description = IHE Restricted Print SCP +Hostname = localhost +Port = 10006 +Type = LOCALPRINTER + +DisableNewVRs = true +DisplayFormat=1,1 +FilmDestination = STOREDPRINT +FilmSizeID = 8INX10IN\11INX14IN\14INX17IN +ImplicitOnly = true +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 16384 +MediumType = STOREDPRINT +OmitSOPClassUIDFromCreateResponse = true +PresentationLUTMatchRequired = true +PresentationLUTinFilmSession = false +Supports12Bit = true +SupportsPresentationLUT = true + +# ---------------------------------------------------------------------------- +# Print SCP that supports most options of the DICOM Print protocol and +# the IHE technical framework requirements for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - layouts: 1x1, 1x2, 2x2, 2x3, 3x3, 3x4, 3x5, 4x4, 4x5 +# - supports typical defined terms for empty image density, film +# destination, film size ID, magnification type, medium type, resolution +# ID, requested decimate/crop behaviour, image size and trim. +# This Print SCP communicates over TLS and requires peer authentication. +# ---------------------------------------------------------------------------- + +[IHEFULL_TLS] +Aetitle = IHEFULL_TLS +Description = IHE Full Print SCP +Hostname = localhost +# in the IHE Year 2 MESA release, this printer listened on port 10005 +Port = 10012 +Type = LOCALPRINTER + +BorderDensity = 150\20\BLACK\WHITE +DisableNewVRs = false +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 +EmptyImageDensity = 20\BLACK\WHITE +FilmDestination = MAGAZINE\PROCESSOR\BIN_1\BIN_2 +FilmSizeID = 8INX10IN\10INX12IN\10INX14IN\11INX14IN\14INX14IN\14INX17IN\24CMX24CM\24CMX30CM +ImplicitOnly = false +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 32768 +MediumType = PAPER\CLEAR FILM\BLUE FILM +MinDensity = 20 +OmitSOPClassUIDFromCreateResponse = false +PresentationLUTMatchRequired = false +PresentationLUTinFilmSession = false +ResolutionID = STANDARD\HIGH +SmoothingType = NONE +Supports12Bit = true +SupportsDecimateCrop = true +SupportsImageSize = true +SupportsPresentationLUT = true +SupportsTrim = true + +# TLS settings +UseTLS = true +TLSProfile = BCP195 +RandomSeed = iheprt1.rnd +PeerAuthentication = REQUIRE +Certificate = sitecert.pem +PrivateKey = sitekey.pem + +# ---------------------------------------------------------------------------- +# Print SCP that only supports the absolute minimum that is required by +# the IHE technical framework for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - supports STANDARD\1,1 layout only +# This Print SCP communicates over TLS and requires peer authentication. +# ---------------------------------------------------------------------------- + +[IHERESTRICT_TLS] +Aetitle = IHERESTRICT_TLS +Description = IHE Restricted Print SCP +Hostname = localhost +Port = 10013 +Type = LOCALPRINTER + +DisableNewVRs = true +DisplayFormat=1,1 +FilmDestination = STOREDPRINT +FilmSizeID = 8INX10IN\11INX14IN\14INX17IN +ImplicitOnly = true +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 16384 +MediumType = STOREDPRINT +OmitSOPClassUIDFromCreateResponse = true +PresentationLUTMatchRequired = true +PresentationLUTinFilmSession = false +Supports12Bit = true +SupportsPresentationLUT = true + +# TLS settings +UseTLS = true +TLSProfile = BCP195 +RandomSeed = iheprt2.rnd +PeerAuthentication = REQUIRE +Certificate = sitecert.pem +PrivateKey = sitekey.pem + +# ============================================================================ +# Logins and Certificates for Digital Signature purposes +# are defined in the following section. +[[USERS]] +# ============================================================================ + +# ---------------------------------------------------------------------------- +# The following text documents all settings defined for a user. +# Each user requires one section with a unique section title. +# +# [USER_1] +# ---------------------------------------------------------------------------- +# +# Login of user, must be unique. Required entry. +# +# Login = name +# +# ---------------------------------------------------------------------------- +# +# Name of user in human readable form, must be unique (e.g. might be +# presented in combo box GUI). +# Required entry. +# +# Name = name +# +# ---------------------------------------------------------------------------- +# +# Name of user in DICOM Person Name (PN) format. Used when creating a +# Verifying Observer Sequence in a DICOM SR document. +# Required entry. +# +# DicomName = name +# +# ---------------------------------------------------------------------------- +# +# Name of Organization for which this user is acting, in DICOM Long String (LO) +# format (i.e. max 64 characters). Used when creating a +# Verifying Observer Sequence in a DICOM SR document. +# Required entry. +# +# Organization = name +# +# ---------------------------------------------------------------------------- +# +# Code for identifying the user, with the entries required for the DICOM +# Code Sequence Macro (DICOM Part 3, Table 8.8-1). This is an optional entry +# that is used when creating a Verifying Observer Sequence in a DICOM SR +# document. If present, it must consist of four parts separated by backslash +# characters: +# - coding scheme designator, DICOM SH format (max. 16 characters) +# - coding scheme version (may be empty), DICOM SH format +# - code value, DICOM SH format +# - code meaning, DICOM LO format (max. 64 characters) +# +# Code = Coding_Scheme_Designator\Coding_Scheme_Version\Code_Value\Code_Meaning +# +# ---------------------------------------------------------------------------- +# +# File containing the user's X.509 certificate for digital signature purposes. +# +# The certificate file must be located in directory defined in +# GENERAL/TLS/USERKEYDIRECTORY. The file format is defined in +# GENERAL/TLS/USEPEMFORMAT. This is a mandatory entry. +# +# Certificate = filename +# +# ---------------------------------------------------------------------------- +# +# File containing the user's private key. The key is used during creation +# of digital signatures. The password with which the key is protected +# (when stored in PEM format) is also used to authenticate a user when +# a DICOM Structured Report is to be verified by a "Verifying Observer". +# +# The key file must be located in directory defined in +# GENERAL/TLS/USERKEYDIRECTORY. The file format is defined in +# GENERAL/TLS/USEPEMFORMAT. It is strongly recommended to keep the files +# in PEM format which (unlike DER) allows 3DES encryption of private keys! +# This is a mandatory entry. +# +# PrivateKey = filename +# +# ---------------------------------------------------------------------------- + +[USER_1] +Login = default +Name = Default User +DicomName = User^Default^^^ +Organization = OFFIS e.V. +Code = 99_OFFIS_DCMTK\\USR.000001\DICOMscope 3.6.0 Default User +Certificate = usercert.pem +PrivateKey = userkey.pem + +# ============================================================================ +# Print Presentation LUT files are defined in the following section. +[[LUT]] +# ============================================================================ + +# ---------------------------------------------------------------------------- +# Assign a unique name to each LUT and put this into the section name. +[LINEAR] +# ---------------------------------------------------------------------------- + +# Description of the LUT. Used in the GUI to present the selectable LUTs +# to the application user. +description = Linear LUT (256 Entries) + +# Filename of the LUT file, should reside in LUT directory (see above). +filename = linear256us.lut + +[LIGHTEN] +description = Lighten Image (256 Entries) +filename = lighten256us.lut + +[DARKEN] +description = Darken Image (256 Entries) +filename = darken256us.lut + +[MIDTONE] +description = Enhance Midtone (256 Entries) +filename = midtone256us.lut + +[PHILIPS] +description = Philips Standard (256 Entries) +filename = philips256us.lut + +[LINEAR12] +description = Linear LUT (4096 Entries) +filename = linear4096us.lut + +[LIGHTEN12] +description = Lighten Image (4096 Entries) +filename = lighten4096us.lut + +[DARKEN12] +description = Darken Image (4096 Entries) +filename = darken4096us.lut + +[MIDTONE12] +description = Enhance Midtone (4096 Entries) +filename = midtone4096us.lut + +[PHILIPS12] +description = Philips Standard (4096 Entries) +filename = philips4096us.lut + +# ============================================================================ +# VOI Window Level/Width Preset Definitions +[[VOI]] +# ============================================================================ + +# ---------------------------------------------------------------------------- +# Assign a unique name to each preset and put this into the section name. +[CT_ABDOMEN] +# ---------------------------------------------------------------------------- + +# Description of the preset. Used in the GUI to present the selectable VOIs +description = Abdomen + +# Modality to which this preset applies. Must be one of the DICOM defined +# terms for element (0008,0060) Modality, see PS3.3 C.7.3.1.1.1 +modality = CT + +# Window center +center = 45 + +# Window width +width = 250 + +[CT_BONE] +description = Bone +modality = CT +center = 500 +width = 4000 + +[CT_CRANE] +description = Crane +modality = CT +center = 35 +width = 100 + +[CT_LUNG] +description = Lung +modality = CT +center = -500 +width = 2000 + +[CT_MEDIASTINUM] +description = Mediastinum +modality = CT +center = 45 +width = 440 + +[CT_PELVIS] +description = Pelvis +modality = CT +center = 45 +width = 300 + +# ============================================================================ +# Structured Reporting (SR) "templates" are defined in the following section. +[[REPORT]] +# ============================================================================ + +# ---------------------------------------------------------------------------- +# Assign a unique name to each "template" and put this into the section name. +[KEY_IMAGE] +# ---------------------------------------------------------------------------- + +# Description of the report. Used in the GUI to present the selectable SR +# "template" to the application user. +description = Key Image Note (IHE Y2) + +# Filename of the SR "template" file, should reside in REPORT directory +# (see above). +filename = reportki.dcm + +[SIMPLE_IMAGE] +description = Simple Image Report (IHE Y2) +filename = reportsi.dcm diff --git a/dcmpstat/etc/printers.cfg b/dcmpstat/etc/printers.cfg new file mode 100644 index 00000000..65dec8cc --- /dev/null +++ b/dcmpstat/etc/printers.cfg @@ -0,0 +1,455 @@ +# +# Copyright (C) 1998-2018, OFFIS e.V. +# All rights reserved. See COPYRIGHT file for details. +# +# This software and supporting documentation were developed by +# +# OFFIS e.V. +# R&D Division Health +# Escherweg 2 +# D-26121 Oldenburg, Germany +# +# +# Module: dcmpstat +# +# Author: Marco Eichelberg et al. +# +# Purpose: This file contains sample configurations for the DICOMscope +# Print SCP. Some of the sample configurations attempt to "emulate" +# as good as possible the capabilities of existing DICOM printers +# such as AGFA Drystar 3000, Kodak/Imation 8700/9410 etc. +# The configurations can also be used for the DICOMscope Print SCU. +# +# This is not a complete configuration file; use the template from +# dcmpstat.cfg (DICOMscope.cfg in the DICOMscope release) and copy/ +# paste individual printer configurations into that template. +# + + +# ---------------------------------------------------------------------------- +# Print SCP that supports most options of the DICOM Print protocol and +# the IHE technical framework requirements for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - layouts: 1x1, 1x2, 2x2, 2x3, 3x3, 3x4, 3x5, 4x4, 4x5 +# - supports typical defined terms for empty image density, film +# destination, film size ID, magnification type, medium type, resolution +# ID, requested decimate/crop behaviour, image size and trim. +# ---------------------------------------------------------------------------- + +[IHEFULL] +Aetitle = IHEFULL +Description = IHE Full Print SCP +Hostname = localhost +Port = 10005 +Type = LOCALPRINTER + +BorderDensity = 150\20\BLACK\WHITE +DisableNewVRs = false +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 +EmptyImageDensity = 20\BLACK\WHITE +FilmDestination = MAGAZINE\PROCESSOR\BIN_1\BIN_2 +FilmSizeID = 8INX10IN\10INX12IN\10INX14IN\11INX14IN\14INX14IN\14INX17IN\24CMX24CM\24CMX30CM +ImplicitOnly = false +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 32768 +MediumType = PAPER\CLEAR FILM\BLUE FILM +MinDensity = 20 +OmitSOPClassUIDFromCreateResponse = false +PresentationLUTMatchRequired = false +PresentationLUTinFilmSession = false +ResolutionID = STANDARD\HIGH +SmoothingType = NONE +Supports12Bit = true +SupportsDecimateCrop = true +SupportsImageSize = true +SupportsPresentationLUT = true +SupportsTrim = true + +# ---------------------------------------------------------------------------- +# Print SCP that only supports the absolute minimum that is required by +# the IHE technical framework for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - supports STANDARD\1,1 layout only +# ---------------------------------------------------------------------------- + +[IHERESTRICTED] +Aetitle = IHERESTRICTED +Description = IHE Restricted Print SCP +Hostname = localhost +Port = 10006 +Type = LOCALPRINTER + +DisableNewVRs = true +DisplayFormat=1,1 +FilmDestination = STOREDPRINT +FilmSizeID = 8INX10IN\11INX14IN\14INX17IN +ImplicitOnly = true +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 16384 +MediumType = STOREDPRINT +OmitSOPClassUIDFromCreateResponse = true +PresentationLUTMatchRequired = true +PresentationLUTinFilmSession = false +Supports12Bit = true +SupportsPresentationLUT = true + +# ---------------------------------------------------------------------------- +# Print SCP that emulates (as good as possible) an AGFA Drystar 3000 +# with Presentation LUT support +# as shown at the RSNA InfoRAD 1999 DICOM Display Consistency Demo +# ---------------------------------------------------------------------------- + +[AGFA] +hostname = localhost +type = LOCALPRINTER +description = AGFA Drystar 3000 +# The original AGFA Drystar 3000 accepts associations on Port 104, +# but we use something different for the simulation. +port = 10008 + +# This is the AETITLE Agfa uses +aetitle = AGFA_DI3000 + +# Setting probably doesn't matter anyway +DisableNewVRs = true + +# The standard Drystar 3000 (as of 1999) does not support Presentation LUT; +# however, we're working with a non-standard model (as shown at RSNA 1999) +# that does support Presentation LUT. This model, however, requires +# the Presentation LUT to be referenced on Film Session level instead of +# Film Box level. +SupportsPresentationLUT = true +PresentationLUTinFilmSession = true +PresentationLUTMatchRequired = true + +# not properly documented in conformance statement, but seems to work +SupportsImageSize = true + +Supports12Bit = true +SupportsDecimateCrop = false +SupportsTrim = true + +# valid image display formats for 14INX17IN +DisplayFormat=1,1\2,1\1,2\2,2\3,2\2,3\3,3\4,3\5,3\3,4\4,4\5,4\6,4\3,5\4,5\5,5\6,5\4,6\5,6 + +# depending on dispenser contents +FilmSizeID = 8INX10IN\11INX14IN\14INX14IN\14INX17IN +MediumType = PAPER\CLEAR FILM\BLUE FILM + +MagnificationType = REPLICATE\BILINEAR\CUBIC + +# The Drystar accepts any value between 0 and 140 for smoothing type, +# but our emulation only supports "0" and "140" +# "0" - Unsharp smoothing +# "140" - Sharp (Hi-resolution) smoothing +SmoothingType = 0\140 + +# The Drystar accepts all OD values for density, +# but our emulation only supports the following choice +BorderDensity = BLACK\WHITE\150 +EmptyImageDensity = BLACK\WHITE\150 +MaxDensity = 320\310\300\290\280\270 +MinDensity = 20\25\30\35\40\45\50 + +# The Drystar supports annotation, but only prints the first 32 characters +# of the annotation text. THE SCP EMULATION DOES NOT SUPPORT ANNOTATION! +Annotation = 2\ANNOTATION + +# AGFA uses lots of configuration information strings... +# Multiple values can be sent, separated by '\'. + +# These ones select a "Perception LUT" - nice for printers that don't support Presentation LUT. +Configuration_1 = PERCEPTION_LUT=LINEAR +Configuration_2 = PERCEPTION_LUT=KANAMORI + +# Both Annotation and File can range [1..6] +# Allows to print a TIFF image that must be pre-loaded in the printer +# into one of six pre-defined locations. +Configuration_3 = ANNOTATION1=FILE1 + +# Same as above, but the Patient ID is printed. The Drystar 3000 allows +# (0010,0020) PatientID to be present in Basic Grayscale Image Box N-SETs +Configuration_4 = ANNOTATION1=PATID + +# allows to define a VOI Window for Basic Print (whatever that is good for...) +# Window width and center must be "in range", whatever that means. +Configuration_5 = WINDOW_WIDTH=256\WINDOW_CENTER=128 + + +# ---------------------------------------------------------------------------- +# Print SCP that emulates (as good as possible) a Kodak Imation 8700/9410 +# with Presentation LUT support +# as shown at the RSNA InfoRAD 1999 DICOM Display Consistency Demo +# ---------------------------------------------------------------------------- + +[KODAK] +hostname = localhost +type = LOCALPRINTER +description = Kodak 8700/9410 +# The original printer accepted associations on Port 1024, +# but we use something different for the simulation. +port = 10009 +aetitle = IMN_9410 + +# Setting probably doesn't matter anyway +DisableNewVRs = true + +# The standard Kodak 8700/9410 (as of 1999) does not support Presentation LUT; +# however, we're working with a non-standard model (as shown at RSNA 1999) +# that does support Presentation LUT. +SupportsPresentationLUT = true +PresentationLUTinFilmSession = false +PresentationLUTMatchRequired = true + +Supports12Bit = true +SupportsImageSize = true +SupportsDecimateCrop = false +SupportsTrim = true + +# This list of values is incomplete but should do for testing purposes +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 +FilmSizeID = 8INX10IN\11INX14IN\14INX17IN\CURRENT +MediumType = CLEAR FILM\BLUE FILM\CURRENT +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +SmoothingType = 0\1\2\3\4\5\6\7\8\9\10\11\12\13\14\15 +BorderDensity = BLACK\WHITE +MaxDensity = 320\310\300\290\280\270 +MinDensity = 20\25\30\35\40\45\50 + +# The Kodak printer supports annotation. THE SCP EMULATION DOES NOT! +Annotation = 0\LABEL + +# Configuration Information can be used to select a +# Perception LUT Curve Shape 0..15 +Configuration_1 = CS000 +Configuration_2 = CS001 +Configuration_3 = CS002 +Configuration_4 = CS003 +Configuration_5 = CS004 +Configuration_6 = CS005 +Configuration_7 = CS006 +Configuration_8 = CS007 +Configuration_9 = CS008 +Configuration_10= CS009 +Configuration_11= CS010 +Configuration_12= CS011 +Configuration_13= CS012 +Configuration_14= CS013 +Configuration_15= CS014 +Configuration_16= CS015 + + +# ---------------------------------------------------------------------------- +# Print SCP that emulates (as good as possible) a Merge APS with +# Presentation LUT support and attached Fuji camera +# as shown at the RSNA InfoRAD 1999 DICOM Display Consistency Demo +# ---------------------------------------------------------------------------- + +[MERGE_APS] +hostname = localhost +type = LOCALPRINTER +description = MERGE_APS +# The original printer accepted associations on Port 1114, +# but we use something different for the simulation. +port = 10010 +aetitle = MERGE_APS +Supports12Bit = true + +# Setting probably doesn't matter anyway +DisableNewVRs = true + +# The standard Merge APS (as of 1999) does not support Presentation LUT; +# however, we're working with a non-standard model (as shown at RSNA 1999) +# that does support Presentation LUT. +SupportsPresentationLUT = true + +# This list of values is incomplete but should do for testing purposes +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 + + +# ---------------------------------------------------------------------------- +# Print SCP that emulates (as good as possible) an AYCAN DICOM paper printer +# with limited presentation LUT support (IDENTITY only) +# as shown at the RSNA InfoRAD 1999 DICOM Display Consistency Demo +# ---------------------------------------------------------------------------- +[AYCAN] + +hostname = localhost +type = LOCALPRINTER +description = Aycan DICOM Print Server +# The original printer accepted associations on Port 2137, +# (a value that is configurable anyway) +# but we use something different for the simulation. +port = 10011 +aetitle = AYCAN + +# Setting probably doesn't matter anyway +DisableNewVRs = true + +# we're working with a non-standard model that supports P-LUT. +# The standard AYCAN DICOM paper printer (as of 1999) does not support +# Presentation LUT; however, we're working with a non-standard model +# (as shown at RSNA 1999) that does support Presentation LUT. +SupportsPresentationLUT = true +PresentationLUTinFilmSession = false +PresentationLUTMatchRequired = true + +Supports12Bit = true +SupportsImageSize = false +SupportsDecimateCrop = false +SupportsTrim = false + +# The Aycan printer supports all layouts with rows <= 10 and columns <= 10 +# We define only the most reasonable combinations +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5\5,6\8,10\10,10 + +FilmSizeID = 8INX10IN\10INX12IN +MediumType = PAPER +MagnificationType = REPLICATE +BorderDensity = WHITE +EmptyImageDensity = WHITE + +# The Aycan printer uses the film session label for annotation +SessionLabelAnnotation = true + +# the config info string must begin with "aycan print" followed by one or more +# settings separated by space characters. No space characters in strings allowed, use '_' +# "G=" gamma correction, value must be [0..2] +# "Ix=" print string (max 64 chars) in 1st/2nd/3rd line on top left corner +# "Dx=" print string (max 64 chars) in 1st/2nd/3rd line on top right corner +# "C=" PostScript compression; 0 = no compression, 1 = level 1 compression (default) +# "TI=" select input papertray; 99=manual feed; default: 0 +# "TO=" select input papertray; default: 0 +# "AYCAN=" is used for communication with aycan DICOM package. +Configuration_1 = aycan print I1=RSNA_1999_Display_Consistency_Demo I2=DICOMscope_2.0 +Configuration_2 = aycan print G=0.5 +Configuration_3 = aycan print G=2.0 +Configuration_4 = aycan print TI=99 + + +# ---------------------------------------------------------------------------- +# Print SCP that supports most options of the DICOM Print protocol and +# the IHE technical framework requirements for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - layouts: 1x1, 1x2, 2x2, 2x3, 3x3, 3x4, 3x5, 4x4, 4x5 +# - supports typical defined terms for empty image density, film +# destination, film size ID, magnification type, medium type, resolution +# ID, requested decimate/crop behaviour, image size and trim. +# This Print SCP communicates over TLS and requires peer authentication. +# ---------------------------------------------------------------------------- + +[IHEFULL_TLS] +Aetitle = IHEFULL_TLS +Description = IHE Full Print SCP +Hostname = localhost +# in the IHE Year 2 MESA release, this printer listened on port 10005 +Port = 10012 +Type = LOCALPRINTER + +BorderDensity = 150\20\BLACK\WHITE +DisableNewVRs = false +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 +EmptyImageDensity = 20\BLACK\WHITE +FilmDestination = MAGAZINE\PROCESSOR\BIN_1\BIN_2 +FilmSizeID = 8INX10IN\10INX12IN\10INX14IN\11INX14IN\14INX14IN\14INX17IN\24CMX24CM\24CMX30CM +ImplicitOnly = false +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 32768 +MediumType = PAPER\CLEAR FILM\BLUE FILM +MinDensity = 20 +OmitSOPClassUIDFromCreateResponse = false +PresentationLUTMatchRequired = false +PresentationLUTinFilmSession = false +ResolutionID = STANDARD\HIGH +SmoothingType = NONE +Supports12Bit = true +SupportsDecimateCrop = true +SupportsImageSize = true +SupportsPresentationLUT = true +SupportsTrim = true + +# TLS settings +UseTLS = true +TLSProfile = BCP195 +RandomSeed = iheprt1.rnd +PeerAuthentication = REQUIRE +Certificate = sitecert.pem +PrivateKey = sitekey.pem + + +# ---------------------------------------------------------------------------- +# Print SCP that only supports the absolute minimum that is required by +# the IHE technical framework for Print Server actors: +# - supports Presentation LUT and 12-bit image transmission +# - supports STANDARD\1,1 layout only +# This Print SCP communicates over TLS and requires peer authentication. +# ---------------------------------------------------------------------------- + +[IHERESTRICT_TLS] +Aetitle = IHERESTRICT_TLS +Description = IHE Restricted Print SCP +Hostname = localhost +Port = 10013 +Type = LOCALPRINTER + +DisableNewVRs = true +DisplayFormat=1,1 +FilmDestination = STOREDPRINT +FilmSizeID = 8INX10IN\11INX14IN\14INX17IN +ImplicitOnly = true +MagnificationType = REPLICATE\BILINEAR\CUBIC\NONE +MaxDensity = 320 +MaxPDU = 16384 +MediumType = STOREDPRINT +OmitSOPClassUIDFromCreateResponse = true +PresentationLUTMatchRequired = true +PresentationLUTinFilmSession = false +Supports12Bit = true +SupportsPresentationLUT = true + +# TLS settings +UseTLS = true +TLSProfile = BCP195 +RandomSeed = iheprt2.rnd +PeerAuthentication = REQUIRE +Certificate = sitecert.pem +PrivateKey = sitekey.pem + + +# ---------------------------------------------------------------------------- +# Print SCU configuration for communication with OFFIS DCMPRINT print server +# as of 2003-08-27 (3.5.2 plus extensions) +# ---------------------------------------------------------------------------- + +[DCMPRINT] +Aetitle = PS Print Server +Description = DCMPRINT Print SCP at localhost +Hostname = localhost +Port = 3100 +Type = PRINTER +DisableNewVRs = false + +ImplicitOnly = false +FilmDestination = MAGAZINE +MagnificationType = BILINEAR +MediumType = PAPER + +# DCMPRINT supports any format, this is just an arbitrary choice +DisplayFormat=1,1\1,2\2,2\2,3\3,3\3,4\3,5\4,4\4,5 + +# film sizes can be configured in DCMPRINT +FilmSizeID = A4\8INX10IN\11INX14IN\14INX17IN + +# max density depends on the characteristic curve of the printer +# which can be configured in DCMPRINT +MaxDensity = 300 + +MaxPDU = 32768 +PresentationLUTMatchRequired = true +PresentationLUTPreferSCPRendering = true +PresentationLUTinFilmSession = false +Supports12Bit = true +SupportsPresentationLUT = true diff --git a/dcmpstat/include/CMakeLists.txt b/dcmpstat/include/CMakeLists.txt new file mode 100644 index 00000000..9bf65f67 --- /dev/null +++ b/dcmpstat/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmpstat DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmpstat/include/Makefile.in b/dcmpstat/include/Makefile.in new file mode 100644 index 00000000..da0acf74 --- /dev/null +++ b/dcmpstat/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmpstat/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmpstat + for file in dcmtk/dcmpstat/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmpstat ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmpstat/include/dcmtk/dcmpstat/dcmpstat.h b/dcmpstat/include/dcmtk/dcmpstat/dcmpstat.h new file mode 100644 index 00000000..a25a649d --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dcmpstat.h @@ -0,0 +1,980 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DcmPresentationState + * + */ + +#ifndef DCMPSTAT_H +#define DCMPSTAT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctk.h" + +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dvpsovl.h" /* for DVPSOverlay_PList */ +#include "dcmtk/dcmpstat/dvpsgll.h" /* for DVPSGraphicLayer_PList */ +#include "dcmtk/dcmpstat/dvpsrsl.h" /* for DVPSReferencedSeries_PList */ +#include "dcmtk/dcmpstat/dvpsall.h" /* for DVPSOverlayCurveActivationLayer_PList */ +#include "dcmtk/dcmpstat/dvpsgal.h" /* for DVPSGraphicObject_PList */ +#include "dcmtk/dcmpstat/dvpscul.h" /* for DVPSCurve_PList */ +#include "dcmtk/dcmpstat/dvpsvll.h" /* for DVPSVOILUT_PList */ +#include "dcmtk/dcmpstat/dvpsvwl.h" /* for DVPSVOIWindow_PList */ +#include "dcmtk/dcmpstat/dvpsdal.h" /* for DVPSDisplayedArea_PList */ +#include "dcmtk/dcmpstat/dvpssvl.h" /* for DVPSSoftcopyVOI_PList */ +#include "dcmtk/dcmpstat/dvpspl.h" /* for DVPSPresentationLUT */ + +class DVPSTextObject; +class DVPSGraphicObject; +class DVPSCurve; +class DVPSDisplayedArea; +class DVPSSoftcopyVOI; + +/** a Grayscale Softcopy Presentation State. + * This class manages the data structures comprising a Presentation State object. + * Presentation states can be created, read, written, and modified. + */ + +class DCMTK_DCMPSTAT_EXPORT DcmPresentationState +{ +public: + /** default constructor + */ + DcmPresentationState(); + + /// destructor + virtual ~DcmPresentationState(); + + /** reads a presentation state from a DICOM dataset. + * The DICOM elements of the presentation state are copied + * from the dataset to this object. + * The completeness and correctness of the + * presentation state (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the presentation state is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the presentation state managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the presentation state is written + * @param replaceSOPInstanceUID flag indicating whether the + * SOP Instance UID should be replaced by a new UID. + * If true, a new UID is always generated. If false, a new + * UID is generated only if no UID has been assigned before. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset, OFBool replaceSOPInstanceUID); + + /** generates a new SOP Instance UID for the Presentation State. + * @return new SOP Instance UID if successfully set, NULL otherwise. + */ + const char *createInstanceUID(); + + /** returns the current SOP Instance UID for the Presentation State. + * @return SOP Instance UID if present, NULL otherwise. + */ + const char *getInstanceUID(); + + /** returns the (currently hard-coded) SOP Class UID of the Presentation State. + * @return SOP Class UID of the presentation state + */ + const char *getSOPClassUID(); + + /** returns the patient ID of the presentation state + */ + const char *getPatientID(); + + /** returns the Study Instance UID of the presentation state. + * @return Study Instance UID if successful, NULL otherwise. + */ + const char *getStudyUID(); + + /** adds a reference to an image to this presentation state. + * This method checks if the given SOP class and Study UID match + * for this presentation state and returns an error code otherwise. + * @param studyUID the Study Instance UID of the image reference to be added. + * @param seriesUID the Series Instance UID of the image reference to be added. + * @param sopclassUID the SOP class UID of the image reference to be added. + * @param instanceUID the SOP instance UID of the image reference to be added. + * @param frames a list of frame numbers in DICOM IS format + * (integer numbers separated by '\' characters). Default: frame numbers absent. + * The frame numbers are required if the referenced image is a multiframe image. + * @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent. + * @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent. + * @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + const char *studyUID, + const char *seriesUID, + const char *sopclassUID, + const char *instanceUID, + const char *frames=NULL, + const char *aetitle=NULL, + const char *filesetID=NULL, + const char *filesetUID=NULL); + + /** adds a reference to an image to this presentation state. + * This method checks if the given SOP class and Study UID match + * for this presentation state and returns an error code otherwise. + * @param dset the DICOM dataset containing the image IOD + * @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent. + * @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent. + * @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + DcmItem &dset, + const char *aetitle=NULL, + const char *filesetID=NULL, + const char *filesetUID=NULL); + + /** removes a reference to an image from this presentation state. + * @param studyUID the Study Instance UID of the image reference to be removed. + * @param seriesUID the Series Instance UID of the image reference to be removed. + * @param instanceUID the SOP instance UID of the image reference to be removed. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition removeImageReference( + const char *studyUID, + const char *seriesUID, + const char *instanceUID); + + /** removes a reference to an image from this presentation state. + * @param dset the DICOM dataset containing the image IOD + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition removeImageReference(DcmItem &dset); + + /** gets the number of image references in all series managed by this list. + * @return number of image references + */ + size_t numberOfImageReferences(); + + /** gets an image reference with the given index. + * @param idx index, must be < numberOfImageReferences(). + * @param studyUID the Study Instance UID is returned in this string + * @param seriesUID the Series Instance UID is returned in this string + * @param sopclassUID the SOP Class UID is returned in this string + * @param instanceUID the SOP Instance UID is returned in this string + * @param frames the list of frames is returned in this string + * @param aetitle the series retrieveAETitle is returned in this string + * @param filesetID the series storageMediaFileSetID is returned in this string + * @param filesetUID the series storageMediaFileSetUID is returned in this string + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference( + size_t idx, + OFString& studyUID, + OFString& seriesUID, + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames, + OFString& aetitle, + OFString& filesetID, + OFString& filesetUID); + + + /** resets the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** creates a default presentation state for a DICOM image. + * A number of flags specify how curves, overlays, VOI transformations, + * a display shutter and a presentation LUT shape + * should be treated when found in the image IOD. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset containing the image IOD + * @param overlayActivation flag defining how overlays should be handled + * (copied, activated or ignored). Default: Copy overlays. + * @param voiActivation flag defining how VOI LUTs or VOI window width/center should + * be handled. Default: Use VOI and prefer VOI LUT from VOI window. + * @param curveActivation flag defining whether curves in the image should + * be activated. Default: Activate curves. + * @param shutterActivation flag defining whether a shutter (not bitmap shutter) + * should be copied to the presentation state when found in the image. + * Default: Copy shutter. + * @param presentationActivation flag defining whether a presentation LUT shape + * should be copied to the presentation state when found in the image. + * Default: Copy presentation LUT shape. + * @param layering flag defining how graphic layers should be created for + * activated overlays and curves. Default: Create one layer for all overlays + * and another layer for all curves. + * @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent. + * @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent. + * @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition createFromImage(DcmItem &dset, + DVPSoverlayActivation overlayActivation = DVPSO_copyOverlays, + DVPSVOIActivation voiActivation = DVPSV_preferVOILUT, + OFBool curveActivation = OFTrue, + OFBool shutterActivation = OFTrue, + OFBool presentationActivation = OFTrue, + DVPSGraphicLayering layering = DVPSG_twoLayers, + const char * aetitle = NULL, + const char * filesetID = NULL, + const char * filesetUID = NULL); + + + /* Presentation LUT Interface */ + + /** gets the current Presentation LUT type. + * @return the current presentation LUT type + */ + DVPSPresentationLUTType getPresentationLUT() { return presentationLUT.getType(); } + + /** checks if a real Presentation LUT (not shape) + * is available in the presentation state. + * @return OFTrue if the presentation state contains + * a presentation LUT, no matter if it is activated or not. + * Returns OFFalse otherwise. + */ + OFBool havePresentationLookupTable() { return presentationLUT.haveTable(); } + + /** gets a description of the current presentation LUT. + * For well-known presentation LUT shapes, a standard text + * is returned. For presentation LUTs, the LUT explanation + * is returned if it exists and a standard text otherwise. + * This method never returns NULL. + * @return a pointer to a string describing the current presentation LUT. + */ + const char *getCurrentPresentationLUTExplanation() { return presentationLUT.getCurrentExplanation(); } + + /** returns the LUT explanation of the presentation LUT + * if it exists and is non-empty. + * Otherwise returns NULL. + * @return a string pointer + */ + const char *getPresentationLUTExplanation() { return presentationLUT.getLUTExplanation(); } + + /** gets the current Presentation LUT object. + * @return the current presentation LUT object + */ + DVPSPresentationLUT *getPresentationLUTData() { return &presentationLUT; } + + /* Rotate/Flip Interface */ + + /** gets the current rotation status of the presentation state. + * @return the current rotation status + */ + DVPSRotationType getRotation(); + + /** gets the current horizontal flip status of the presentation state. + * @return OFTrue if flip is on, OFFalse if flip is off. + */ + OFBool getFlip(); + + /** sets rotation status of the presentation state. + * @param rotation the rotation to be set + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setRotation(DVPSRotationType rotation); + + /** sets horizontal flip status of the presentation state. + * @param isFlipped the flip status, OFTrue for on, OFFalse for off. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setFlip(OFBool isFlipped); + + + /* VOI Transform Interface */ + + /* Displayed Area Interface */ + + + /* shutter Interface */ + + /** checks if a display shutter of given type is active. + * @param type the shutter type + * @return OFTrue if this type of shutter is currently active. + */ + OFBool haveShutter(DVPSShutterType type); + + /* rectangular shutter Interface */ + + /** gets rectangular shutter left vertical edge. + * May only be called if a rectangular shutter is active. + * @return the rect shutter LV edge. + */ + Sint32 getRectShutterLV(); + + /** gets rectangular shutter right vertical edge. + * May only be called if a rectangular shutter is active. + * @return the rect shutter RV edge. + */ + Sint32 getRectShutterRV(); + + /** gets rectangular shutter upper horitontal edge. + * May only be called if a rectangular shutter is active. + * @return the rect shutter UH edge. + */ + Sint32 getRectShutterUH(); + + /** gets rectangular shutter lower horiztonal edge. + * May only be called if a rectangular shutter is active. + * @return the rect shutter LH edge. + */ + Sint32 getRectShutterLH(); + + + /* circular shutter Interface */ + + /** gets circular shutter center x component. + * May only be called if a circular shutter is active. + * @return the circ shutter center x component + */ + Sint32 getCenterOfCircularShutter_x(); + + /** gets circular shutter center y component. + * May only be called if a circular shutter is active. + * @return the circ shutter center y component + */ + Sint32 getCenterOfCircularShutter_y(); + + /** gets circular shutter radius. + * May only be called if a circular shutter is active. + * Note: In DICOM, a circular shutter must be rendered + * with consideration of the image pixel aspect ratio. + * The radius returned by this method is the number + * of pixels describing a horizontal line from the + * center of the circle to its border. See sample figures + * in NEMA PS3.3:1998. + * @return the circ shutter radius + */ + Sint32 getRadiusOfCircularShutter(); + + /* polygonal shutter Interface */ + + /** gets polygonal shutter number of points. + * May only be called if a polygonal shutter is active. + * @return the number of points describing the poly shutter + */ + size_t getNumberOfPolyShutterVertices(); + + /** get polygonal shutter point. + * May only be called if a polygonal shutter is active. + * Shutter points are relative to the origin 1\1 which is + * the left upper edge of the image. + * @param idx the index of the shutter point, must be < getNumberOfPolyShutterVertices() + * @param x returns the x component of the point + * @param y returns the y component of the point + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getPolyShutterVertex(size_t idx, Sint32& x, Sint32& y); + + /** sets polygonal display shutter origin. + * This method creates a + * polygonal shutter consisting only of a single point. + * The polygonal display shutter is deactivated after this method. + * @param x the x component of the shutter origin + * @param y the x component of the shutter origin + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setPolyShutterOrigin(Sint32 x, Sint32 y); + + /* bitmap shutter Interface + * + * see methods: + * overlayIsBitmapShutter(), + * overlayIsSuitableAsBitmapShutter(), + * activateOverlayAsBitmapShutter() + * in overlay interface definitions. + */ + + /* shutter presentation value Interface */ + + /** gets the shutter presentation value. If no shutter display + * value exists, a default of 0 (black) is set. + * @return the shutter presentation value as 16bit unsigned P-value + */ + Uint16 getShutterPresentationValue(); + + /** sets the shutter presentation value to the given P-value. + * @param pvalue the shutter presentation value. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setShutterPresentationValue(Uint16 pvalue); + + /* Presentation State Label, Description and Name Interface */ + + /** returns a label for the presentation state. + * If no label is available, NULL is returned. + * @return a pointer to a string or NULL. + */ + const char *getPresentationLabel(); + + /** returns a description for the presentation state. + * If no description is available, NULL is returned. + * @return a pointer to a string or NULL. + */ + const char *getPresentationDescription(); + + /** returns the creator's name for the presentation state. + * If no name is available, NULL is returned. + * @return a pointer to a string or NULL. + */ + const char *getPresentationCreatorsName(); + + /** sets the presentation state label. + * The passed string must be a valid DICOM Code String + * (i.e. max 16 characters, only uppercase and numbers). + * @param label the new presentation state label + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setPresentationLabel(const char *label); + + /** sets the presentation state description. + * The passed string must be a valid DICOM Long String + * (i.e. max 64 characters, no backslash or control chars). + * @param descr the new presentation state description + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setPresentationDescription(const char *descr); + + /** sets the presentation state creator's name. + * The passed string must be a valid DICOM Person Name String + * (see NEMA PS3.5:1998). + * @param name the new creator's name + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setPresentationCreatorsName(const char *name); + + /* specific character set */ + + /** sets the specific character set for this presentation state. + * @param charset the new character set for this text object + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setCharset(DVPScharacterSet charset); + + /** gets the specific character set for this presentation state. + * @return character set identifier + */ + DVPScharacterSet getCharset(); + + /** gets the specific character set string for this presentation state. + * @return character set if present, NULL otherwise + */ + const char *getCharsetString(); + + /* graphic layers */ + + /** sorts the graphic layers according to + * the graphic layer order. Layers with lower order have lower + * indices after sorting which means that the layers can be + * drawn to the screen in ascending index order. + * Calling this routine may result in a re-numbering + * of the graphic layer orders in a way that does not affect + * their sequence. + */ + void sortGraphicLayers(); + + /** returns the number of graphic layers. + * @return number of graphic layers + */ + size_t getNumberOfGraphicLayers(); + + /** gets the unique name of the graphic + * layer with the given index. If no layer for the given + * index exists, NULL is returned. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return name of the graphic layer + */ + const char *getGraphicLayerName(size_t idx); + + /** gets the index of the graphic + * layer with the given unique name. If no matching layer + * is found, DVPS_IDX_NONE is returned. + * @param name name of the graphic layer + * @return index of the graphic layer + */ + size_t getGraphicLayerIndex(const char *name); + + + /** gets a description string for the graphic + * layer with the given index. If no layer for the given + * index exists, or if the description is empty, NULL is returned. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return description of the graphic layer + */ + const char *getGraphicLayerDescription(size_t idx); + + /** checks whether a recommended display value (grayscale, color or both) for the given graphic layer exists. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return OFTrue if a recommended display value exists + */ + OFBool haveGraphicLayerRecommendedDisplayValue(size_t idx); + + /** gets the recommended grayscale display value for the given graphic layer. + * If the graphic layer contains an RGB display value but no grayscale + * display value, the RGB value is implicitly converted to grayscale. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param gray the recommended display value as an unsigned 16-bit P-value + * is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16& gray); + + /** gets the recommended RGB display value for the given graphic layer. + * If the graphic layer contains a grayscale display value but no RGB + * display value, the grayscale value is implicitly converted to RGB. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param r returns the R component of the recommended display value as unsigned 16-bit P-value + * @param g returns the G component of the recommended display value as unsigned 16-bit P-value + * @param b returns the B component of the recommended display value as unsigned 16-bit P-value + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16& r, Uint16& g, Uint16& b); + + /** set graphic layer recommended grayscale display value for the given graphic layer. + * This method does not affect (set or modify) the recommended RGB display value + * which should be set separately. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param gray the recommended display value as an unsigned 16-bit P-value + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16 gray); + + /** set graphic layer recommended RGB display value for the given graphic layer. + * This method does not affect (set or modify) the recommended grayscale display value + * which should be set separately. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param r the R component of the recommended display value as unsigned 16-bit P-value + * @param g the G component of the recommended display value as unsigned 16-bit P-value + * @param b the B component of the recommended display value as unsigned 16-bit P-value + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16 r, Uint16 g, Uint16 b); + + /** removes recommended display values for the given graphic layer. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param rgb if true, the RGB recommended display value is removed + * @param monochrome if true the monochrome recommended display value is removed + */ + void removeGraphicLayerRecommendedDisplayValue(size_t idx, OFBool rgb, OFBool monochrome); + + /** assigns a new unique name to the given graphic layer. + * The new name must be unique, otherwise an error code is returned. + * Upon success, all references (for graphic annotations, curves and overlays) to the given + * graphic layer are also renamed so that the presentation state remains + * consistent. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param name the new name of the graphic layer. Must be a valid DICOM Code String. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerName(size_t idx, const char *name); + + /** sets a new description to the given graphic layer. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param descr description of the graphic layer. Must be a valid DICOM Long String. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerDescription(size_t idx, const char *descr); + + /** makes a graphic layer the highest layer for display. + * This method assigns a graphic layer order higher than all + * existing graphic layer orders to the given graphic layer, + * sorts and renumbers the list of graphic layers. Upon success, + * the given graphic layer is guaranteed to have the new index + * (getNumberOfGraphicLayers()-1). + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition toFrontGraphicLayer(size_t idx); + + /** makes a graphic layer the lowest layer for display. + * This method assigns a graphic layer order lower than all + * existing graphic layer orders to the given graphic layer, + * sorts and renumbers the list of graphic layers. Upon success, + * the given graphic layer is guaranteed to have the new index 0. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition toBackGraphicLayer(size_t idx); + + /** exchanges the layer order of the two graphic layers with + * the given indices. This method does not sort or renumber + * the graphic layers. + * @param idx1 index of the first graphic layer, must be < getNumberOfGraphicLayers() + * @param idx2 index of the second graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition exchangeGraphicLayers(size_t idx1, size_t idx2); + + /** creates a new graphic layer with the given + * name and optional description. + * The new name must be unique, otherwise an error code is returned. + * The toFrontGraphicLayer() method is implicitly called for the new layer. + * @param gLayer the name of the graphic layer. Must be a valid DICOM Code String. + * @param gLayerDescription the optional description of the graphic layer. + * Must be a valid DICOM Long String. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition addGraphicLayer( + const char *gLayer, + const char *gLayerDescription=NULL); + + + /* text objects */ + + /* graphic objects */ + + /* curves */ + + /** returns the number of curve activations for the given + * graphic layer. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return number of curves + */ + size_t getNumberOfCurves(size_t layer); + + /** deletes the curve activation with the given index + * on the given layer. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the curve activation, must be < getNumberOfCurves(layer) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeCurve(size_t layer, size_t idx); + + /** moves the curve activation with the given index on the given + * layer to a different layer. + * @param old_layer index of the graphic layer on which the curve is, + * must be < getNumberOfGraphicLayers() + * @param idx index of the curve activation, must be < getNumberOfCurves(layer) + * @param new_layer index of the graphic layer to which the curve is moved, + * must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition moveCurve(size_t old_layer, size_t idx, size_t new_layer); + + + /* overlays */ + + /** gets the number of overlays that are currently activated + * on the given graphic layer. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return number of active overlays + */ + size_t getNumberOfActiveOverlays(size_t layer); + + /** gets the repeating group number of the given activated overlay. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the overlay, must be < getNumberOfActiveOverlays(). + * @return repeating group number if found, 0 otherwise. + */ + Uint16 getActiveOverlayGroup(size_t layer, size_t idx); + + /** gets the number of overlays which are embedded in the + * presentation state. + * @return number of overlays in presentation state + */ + size_t getNumberOfOverlaysInPresentationState(); + + /** gets the repeating group number of the given overlay in the presentation state. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return repeating group number if found, 0 otherwise. + */ + Uint16 getOverlayInPresentationStateGroup(size_t idx); + + /** gets the overlay label of the given overlay in the presentation state. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return label string if it exists, NULL otherwise. + */ + const char *getOverlayInPresentationStateLabel(size_t idx); + + /** gets the overlay description of the given overlay in the presentation state. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return description string if it exists, NULL otherwise. + */ + const char *getOverlayInPresentationStateDescription(size_t idx); + + /** gets the index of the activation layer on which the given + * overlay from the presentation state is activated. If an overlay is used + * as a bitmap shutter, it is reported as being not activated by this method. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return layer index (which is < getNumberOfGraphicLayers()) if overlay exists + * and is activated, DVPS_IDX_NONE otherwise. + */ + size_t getOverlayInPresentationStateActivationLayer(size_t idx); + + /** checks if the given overlay in the presentation state + * is currently activated as a bitmap shutter. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return OFTrue if overlay exists and is activated as bitmap shutter, OFFalse otherwise. + */ + OFBool overlayIsBitmapShutter(size_t idx); + + /** checks whether the given overlay in the presentation state is a ROI + * (region of interest) overlay. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return OFTrue if overlay exists and is ROI, OFFalse otherwise. + */ + OFBool overlayInPresentationStateIsROI(size_t idx); + + /** moves the overlay activation with the given index on the given + * layer to a different layer. + * @param old_layer index of the graphic layer on which the curve is, + * must be < getNumberOfGraphicLayers() + * @param idx index of the overlay activation, must be < getNumberOfActiveOverlays(layer) + * @param new_layer index of the graphic layer to which the curve is moved, + * must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition moveOverlay(size_t old_layer, size_t idx, size_t new_layer); + + /* attached image */ + + /* Display transform */ + + /* print related methods */ + +private: + + /** private undefined copy constructor + */ + DcmPresentationState(const DcmPresentationState& copy); + + /** private undefined assignment operator + */ + DcmPresentationState& operator=(const DcmPresentationState& obj); + + /** create dummy values for all missing type 1 elements. + * Called before a presentation state is written to make sure + * that the presentation state is complete. + * @param replaceSOPInstanceUID flag indicating whether the + * SOP Instance UID should be replaced by a new UID. + * If true, a new UID is always generated. If false, a new + * UID is generated only if no UID has been assigned before. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createDummyValues(OFBool replaceSOPInstanceUID); + + /** removes and deletes all graphic layer for which + * no matching text, graphic, curve or overlay object exists. + * Also deletes all graphic annotation sequence items containing + * no text and no graphic object. Called before writing a presentation state. + */ + void cleanupLayers(); + +protected: + + /** creates a default displayed area selection for the given dataset. + * Used in createFromImage(). + * @param dset the DICOM dataset containing the image IOD + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition createDefaultDisplayedArea(DcmItem &dset); + + /* Module: Patient (M) + */ + /// Module=Patient, VR=PN, VM=1, Type 1 + DcmPersonName patientName; + /// Module=Patient, VR=LO, VM=1, Type 2 + DcmLongString patientID; + /// Module=Patient, VR=DA, VM=1, Type 2 + DcmDate patientBirthDate; + /// Module=Patient, VR=CS, VM=1, Type 2 + DcmCodeString patientSex; + + /* Module: General Study (M) + */ + /// Module=General_Study, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier studyInstanceUID; + /// Module=General_Study, VR=DA, VM=1, Type 2 + DcmDate studyDate; + /// Module=General_Study, VR=TM, VM=1, Type 2 + DcmTime studyTime; + /// Module=General_Study, VR=PN, VM=1, Type 2 + DcmPersonName referringPhysicianName; + /// Module=General_Study, VR=SH, VM=1, Type 2 + DcmShortString studyID; + /// Module=General_Study, VR=SH, VM=1, Type 2 + DcmShortString accessionNumber; + + /* Module: General Series (M) + */ + /// Module=General_Series, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier seriesInstanceUID; + /// Module=General_Series, VR=IS, VM=1, Type 2 + DcmIntegerString seriesNumber; + + /* Module: Presentation Series (M) - specializes general series + */ + // modality; see General Series + + /* Module: General Equipment (M) + */ + /// Module=General_Equipment, VR=LO, VM=1, Type 2 + DcmLongString manufacturer; + + /* Module: Displayed Area (M) + */ + /// Module=Displayed_Area, VR=SQ, Card=1-n, Type 1 + DVPSDisplayedArea_PList displayedAreaSelectionList; + + /* Module: Softcopy Presentation LUT (M) + * There must never be more that one Presentation LUT for one Presentation State, + * therefore we need not save a list of LUTs. + */ + /// Module=Softcopy_Presentation_LUT, VR=SQ, Card=1, Type 1C + DVPSPresentationLUT presentationLUT; + + /* Module: Presentation State (M) + * specializes mask and display shutter + */ + /// Module=Presentation_State, VR=IS, VM=1, Type 1 + DcmIntegerString imageNumber; + /// Module=Presentation_State, VR=CS, VM=1, Type 1 + DcmCodeString presentationLabel; + /// Module=Presentation_State, VR=LO, VM=1, Type 2 + DcmLongString presentationDescription; + /// Module=Presentation_State, VR=DA, VM=1, Type 1 + DcmDate presentationCreationDate; + /// Module=Presentation_State, VR=TM, VM=1, Type 1 + DcmTime presentationCreationTime; + /// Module=Presentation_State, VR=PN, VM=1, Type 2 + DcmPersonName presentationCreatorsName; + /// ReferencedSeriesSequence, Module=Presentation_State + DVPSReferencedSeries_PList referencedSeriesList; + // shutterPresentationValue; Type 1c. See Display Shutter module + + /* Module: SOP Common (M) + * we don't store the SOP Class UID because it is well known. + */ + /// Module=SOP_Common, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier sOPInstanceUID; + /// Module=SOP_Common, VR=CS, VM=1-n, Type 1C + DcmCodeString specificCharacterSet; + /// Module=SOP_Common, VR=DA, VM=1, Type 3 + DcmDate instanceCreationDate; + /// Module=SOP_Common, VR=TM, VM=1, Type 3 + DcmTime instanceCreationTime; + /// Module=SOP_Common, VR=UI, VM=1, Type 3 + DcmUniqueIdentifier instanceCreatorUID; + + /* Module: Display Shutter (C) + * "required if display shutter to be applied and BitmapDispShutter not present" + */ + /// if true, a rectangular shutter is in use + OFBool useShutterRectangular; + /// if true, a circular shutter is in use + OFBool useShutterCircular; + /// if true, a polygonal shutter is in use + OFBool useShutterPolygonal; + /// if true, a bitmap shutter is in use + OFBool useShutterBitmap; + /// Module=Display_Shutter, VM=CS, VR=1-3, Type 1 + DcmCodeString shutterShape; + /// Module=Display_Shutter, VR=IS, VM=1, Type 1C + DcmIntegerString shutterLeftVerticalEdge; + /// Module=Display_Shutter, VR=IS, VM=1, Type 1C + DcmIntegerString shutterRightVerticalEdge; + /// Module=Display_Shutter, VR=IS, VM=1, Type 1C + DcmIntegerString shutterUpperHorizontalEdge; + /// Module=Display_Shutter, VR=IS, VM=1, Type 1C + DcmIntegerString shutterLowerHorizontalEdge; + /// Module=Display_Shutter, VR=IS, VM=2, Type 1C + DcmIntegerString centerOfCircularShutter; + /// Module=Display_Shutter, VR=IS, VM=1, Type 1C + DcmIntegerString radiusOfCircularShutter; + /// Module=Display_Shutter, VR=IS, VM=2-2n, Type 1C + DcmIntegerString verticesOfThePolygonalShutter; + /// Module=Display_Shutter, VR=US, VM=1, Type 3 (1c in other modules) + DcmUnsignedShort shutterPresentationValue; + + /* Module: Bitmap Display Shutter (C) + * "required if display shutter to be applied and DispShutter not present" + */ + /// Module=Bitmap_Display_Shutter, VR=US, VM=1, Type 1 + DcmUnsignedShort shutterOverlayGroup; + // shutterPresentationValue already defined in Display Shutter module + // shutterShape already defined in Display Shutter module + + /* Module: Overlay Plane (C) + * "required if overlay to be applied or BitmapDispShutter present" + */ + /// Overlay(s), Module=Overlay_Plane + DVPSOverlay_PList overlayList; + + /* Module: Overlay/Curve Activation (C) + * "required if ref. image contains overlay or curve to be displayed" + */ + /// Overlay/Curve Activation Layer(s), Module=Overlay_Activation/Curve_Activation + DVPSOverlayCurveActivationLayer_PList activationLayerList; + + /* Module: Graphic Annotation (C) + * "required if graphical annotation to be applied" + */ + /// GraphicAnnotationSequence, Module=Graphic_Annotation + DVPSGraphicAnnotation_PList graphicAnnotationList; + + /* Module: Spatial Transformation (C) + * "required if rotation/flipping/magnification to be applied" + */ + /// Module=Spatial_Transform, VR=US, VM=1, Type 1 + DcmUnsignedShort imageRotation; + /// Module=Spatial_Transform, VR=CS, VM=1, Type 1 + DcmCodeString imageHorizontalFlip; + + /* Module: Graphic Layer (C) + * "required if graphic annotation, overlays or curves to be applied" + */ + /// GraphicLayerSequence, Module=Graphic_Layer + DVPSGraphicLayer_PList graphicLayerList; + + /* Module: Modality LUT (C) + * "required if modality LUT to be applied" + * There must never be more that one Modality LUT for one Presentation State, + * therefore we need not save a list of LUTs. + */ + /// if true, a modality rescale slope/intercept is set + OFBool useModalityRescale; + /// if true, a modality LUT is set + OFBool useModalityLUT; + /// Module=Modality_LUT, VR=xs, VM=3, Type 1c + DcmUnsignedShort modalityLUTDescriptor; + /// Module=Modality_LUT, VR=LO, VM=1, Type 3 + DcmLongString modalityLUTExplanation; + /// Module=Modality_LUT, VR=LO, VM=1, Type 3 + DcmLongString modalityLUTType; + /// Module=Modality_LUT, VR=xs, VM=1-n, Type 1c + DcmUnsignedShort modalityLUTData; + /// Module=Modality_LUT, VR=DS, VM=1, Type 1c + DcmDecimalString rescaleIntercept; + /// Module=Modality_LUT, VR=DS, VM=1, Type 1c + DcmDecimalString rescaleSlope; + /// Module=Modality_LUT, VR=LO, VM=1, Type 1c + DcmLongString rescaleType; + + /* Module: Softcopy VOI LUT (C) + * "required if VOI LUT to be applied" + */ + /// Module=Softcopy_VOI_LUT, VR=SQ, Card=1-n, Type 1 + DVPSSoftcopyVOI_PList softcopyVOIList; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dpdefine.h b/dcmpstat/include/dcmtk/dcmpstat/dpdefine.h new file mode 100644 index 00000000..33054ee7 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dpdefine.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DPDEFINE_H +#define DPDEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmpstat_EXPORTS +#define DCMTK_DCMPSTAT_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMPSTAT_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvcache.h b/dcmpstat/include/dcmtk/dcmpstat/dvcache.h new file mode 100644 index 00000000..a5903307 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvcache.h @@ -0,0 +1,897 @@ +/* + * + * Copyright (C) 1998-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Joerg Riesmeier + * + * Purpose: Classes for caching of the image database (Header/Source) + * + */ + + +#ifndef DVCACHE_H +#define DVCACHE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" /* for DVIFhierarchyStatus */ + + +/*--------------------* + * type definitions * + *--------------------*/ + +/** describes the different types of instances stored in the database + */ +enum DVPSInstanceType +{ + /// image object + DVPSI_image, + /// presentation state object + DVPSI_presentationState, + /// structured reporting document + DVPSI_structuredReport, + /// stored print object + DVPSI_storedPrint, + /// hardcopy grayscale object + DVPSI_hardcopyGrayscale +}; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** A class to handle an instance cache (list of items). + * This is the lowest level in the hierarchical cache structure. + * Images are handled as well as presentation states. This class + * is used by DVSeriesCache. + */ +class DCMTK_DCMPSTAT_EXPORT DVInstanceCache +{ + + public: + + /** Internal structure defining the list items. + */ + struct DCMTK_DCMPSTAT_EXPORT ItemStruct + { + /** Constructor. + * sets internal member variables. + * + ** @param uid unique identifier + * @param pos file position in index file + * @param status review status + * @param type type of instance + * @param size image size (in bytes) + * @param filename filename of instance + */ + ItemStruct(const OFString &uid, + const int pos, + const DVIFhierarchyStatus status, + const DVPSInstanceType type, + const int size, + const OFString &filename) + : UID(uid), + Pos(pos), + Status(status), + Type(type), + ImageSize(size), + Filename(filename), + Checked(OFFalse), + Description(), + Label(), + List() + {} + + /// instance UID + OFString UID; + /// position in the index file + int Pos; + /// review status + DVIFhierarchyStatus Status; + /// type of instance + DVPSInstanceType Type; + /// image size (in bytes) + int ImageSize; + /// filename of instance + OFString Filename; + /// status flag to avoid double checking of referencing pstates + OFBool Checked; + /// instance description + OFString Description; + /// instance label + OFString Label; + /// list of referencing pstates + OFList List; + }; + + /** Constructor + */ + DVInstanceCache() + : List(), + Iterator(), + OldIterator() + { + Iterator = OldIterator = List.end(); + } + + /** Destructor + */ + virtual ~DVInstanceCache() + { + clear(); + } + + /** reset all member variables to initial state. + * delete all list items. + */ + inline void clear() + { + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + delete (*Iterator); + Iterator = List.erase(Iterator); + } + List.clear(); + Iterator = OldIterator = List.end(); + } + + /** checks whether instance cache is empty + * + ** @result OFTrue if cache is empty, OFFalse otherwise + */ + inline OFBool empty() const + { + return List.empty(); + } + + /** gets number of cache entries + * + ** @return number of cache entries + */ + inline Uint32 getCount() const + { + return OFstatic_cast(Uint32, List.size()); + } + + /** sets internal cursor to specified position in cache list + * + ** @param idx index position in cache list (starting with 0) + * + ** @return OFTrue if successful, OFFalse if 'idx' is invalid + */ + inline OFBool gotoItem(Uint32 idx) + { + OFBool result = OFFalse; + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + if (idx == 0) + { + result = OFTrue; + break; + } + idx--; + ++Iterator; + } + return result; + } + + /** sets internal cursor to first position in cache list + * + ** @return OFTrue if successful, OFFalse if list is empty + */ + inline OFBool gotoFirst() + { + OldIterator = Iterator; + Iterator = List.begin(); + return (Iterator != List.end()); + } + + /** sets internal cursor to next position in cache list + * + ** @return OFTrue if successful, OFFalse if new position is invalid + */ + inline OFBool gotoNext() + { + OFListIterator(ItemStruct *) last = List.end(); + if (Iterator != last) + Iterator++; + return (Iterator != last); + } + + /** sets internal cursor to last visited position in cache list + * + ** @return OFTrue if successful, + * OFFalse if last visited position was invalid or the last one in the list + */ + inline OFBool reset() + { + OFBool result = OFFalse; + OFListIterator(ItemStruct *) last = List.end(); + if (OldIterator != last) + { + Iterator = OldIterator; + OldIterator = last; + result = OFTrue; + } + return result; + } + + /** checks whether an item with the specified UID exists in the cache list + * + ** @param uid UID which should be checked + * + ** @return OFTrue if such an item exists, OFFalse otherwise + */ + inline OFBool isElem(const OFString &uid) + { + OFBool result = OFFalse; + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + const ItemStruct *item = (*Iterator); + if (item != NULL) + { + if (item->UID == uid) + { + result = OFTrue; + break; + } + } + ++Iterator; + } + return result; + } + + /** gets the file position of the current (selected) instance + * + ** @return file position if successful, 0 otherwise + */ + inline int getPos() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->Pos : 0; + } + + /** gets review status of the current (selected) instance + * + ** @return hierarchical status code if successful, 'isNew' otherwise + */ + inline DVIFhierarchyStatus getStatus() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->Status : DVIF_objectIsNew; + } + + /** gets type of the instance + * + ** @return type of instance + */ + inline DVPSInstanceType getType() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->Type : DVPSI_image; + } + + /** gets image size of current (selected) instance + * + ** @return image size in bytes if successful, 0 otherwise + */ + inline int getImageSize() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->ImageSize : 0; + } + + /** gets filename of current (selected) instance + * + ** @return filename if successful, NULL otherwise + */ + inline const char *getFilename() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->Filename.c_str() : (const char *)NULL; + } + + /** gets reference to current (selected) instance + * + ** @return pointer to ItemStruct if successful, NULL otherwise + */ + inline ItemStruct *getItem() const + { + OFListConstIterator(ItemStruct *) it = Iterator; + return (it != List.end()) ? (*Iterator) : (ItemStruct *)NULL; + } + + /** adds a new item to the cache list. + * sets internal cursor to new position. + * + ** @param uid unique identifier + * @param pos file position in index file + * @param status review status + * @param type type of instance + * @param size image size (in bytes) + * @param filename filename of instance + */ + inline void addItem(const OFString &uid, + const int pos, + const DVIFhierarchyStatus status, + const DVPSInstanceType type, + const int size, + const OFString &filename) + { + ItemStruct *item = new ItemStruct(uid, pos, status, type, size, filename); + List.push_back(item); + Iterator = --List.end(); // set to new position + } + + /** updates hierarchical/review status for all list items. + * + ** @return resulting review status (summary of all items) + */ + inline DVIFhierarchyStatus updateStatus() + { + OFListIterator(ItemStruct *) first = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + OFListIterator(ItemStruct *) iter = first; + DVIFhierarchyStatus status = DVIF_objectIsNew; + while (iter != last) + { + ItemStruct *item = (*iter); + if (item != NULL) + { + switch (item->Status) + { + case DVIF_objectIsNew: + if (status == DVIF_objectIsNotNew) + status = DVIF_objectContainsNewSubobjects; + break; + case DVIF_objectIsNotNew: + case DVIF_objectContainsNewSubobjects: + if (iter == first) + status = DVIF_objectIsNotNew; + else if (status == DVIF_objectIsNew) + status = DVIF_objectContainsNewSubobjects; + break; + } + } + ++iter; + } + return status; + } + + + protected: + + /// list of instances + OFList List; + /// internal cursor to current (selected) list item + OFListIterator(ItemStruct *) Iterator; + /// last visited position in item list + OFListIterator(ItemStruct *) OldIterator; +}; + + +/* ------------------------------ */ + + +/** A class to handle a series cache (list of items). + * This is the middle level in the hierarchical cache structure. + * This class is used by DVStudyCache. The internal structure + * is a list of DVInstanceCache. + */ +class DCMTK_DCMPSTAT_EXPORT DVSeriesCache +{ + + public: + + /** Internal structure defining the list items. + */ + struct DCMTK_DCMPSTAT_EXPORT ItemStruct + { + /** Constructor. + * sets internal member variables. + * + ** @param uid unique identifier + * @param status review status (optional) + * @param type type of series + */ + ItemStruct(const OFString &uid, + const DVIFhierarchyStatus status = DVIF_objectIsNew, + const DVPSInstanceType type = DVPSI_image) + : UID(uid), + Status(status), + Type(type), + List() + {} + + /// instance UID + OFString UID; + /// review status for the series + DVIFhierarchyStatus Status; + /// type of all instances within this series + DVPSInstanceType Type; + /// list of instances within this series + DVInstanceCache List; + }; + + /** Constructor. + */ + DVSeriesCache() + : List(), + Iterator(), + OldIterator() + { + Iterator = OldIterator = List.end(); + } + + /** Destructor + */ + virtual ~DVSeriesCache() + { + clear(); + } + + /** reset all member variables to initial state + * delete all list items. + */ + inline void clear() + { + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + delete (*Iterator); + Iterator = List.erase(Iterator); + } + List.clear(); + Iterator = OldIterator = List.end(); + } + + /** checks whether instance cache is empty + * + ** @return OFTrue if cache is empty, OFFalse otherwise + */ + inline OFBool empty() const + { + return List.empty(); + } + + /** gets number of cache entries + * + ** @return number of cache entries + */ + inline Uint32 getCount() const + { + return OFstatic_cast(Uint32, List.size()); + } + + /** sets internal cursor to specified position in cache list + * + ** @param idx index position in cache list (starting with 0) + * + ** @return OFTrue if successful, OFFalse if 'idx' is invalid + */ + inline OFBool gotoItem(Uint32 idx) + { + OFBool result = OFFalse; + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + if (idx == 0) + { + result = OFTrue; + break; + } + idx--; + ++Iterator; + } + return result; + } + + /** sets internal cursor to first position in cache list + * + ** @return OFTrue if successful, OFFalse if list is empty + */ + inline OFBool gotoFirst() + { + OldIterator = Iterator; + Iterator = List.begin(); + return (Iterator != List.end()); + } + + /** sets internal cursor to next position in cache list + * + ** @return OFTrue if successful, OFFalse if new position is invalid + */ + inline OFBool gotoNext() + { + OFListIterator(ItemStruct *) last = List.end(); + if (Iterator != last) + Iterator++; + return (Iterator != last); + } + + /** sets internal cursor to last visited position in cache list + * + ** @return OFTrue if successful, + * OFFalse if last visited position was invalid or the last one in the list + */ + inline OFBool reset() + { + OFBool result = OFFalse; + OFListIterator(ItemStruct *) last = List.end(); + if (OldIterator != last) + { + Iterator = OldIterator; + OldIterator = last; + result = OFTrue; + } + return result; + } + + /** checks whether an item with the specified UID exists in the cache list + * + ** @param uid UID which should be checked + * + ** @return OFTrue if such an item exists, OFFalse otherwise + */ + inline OFBool isElem(const OFString &uid) + { + OFBool result = OFFalse; + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + const ItemStruct *item = (*Iterator); + if (item != NULL) + { + if (item->UID == uid) + { + result = OFTrue; + break; + } + } + ++Iterator; + } + return result; + } + + /** gets review status of the current (selected) series + * + ** @return hierarchical status code if successful, 'isNew' otherwise + */ + inline DVIFhierarchyStatus getStatus() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->Status : DVIF_objectIsNew; + } + + /** gets type of all instances in the series + * + ** @return type of all instances + */ + inline DVPSInstanceType getType() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->Type : DVPSI_image; + } + + /** gets reference to current (selected) series + * + ** @return pointer to ItemStruct if successful, NULL otherwise + */ + inline ItemStruct *getItem() const + { + OFListConstIterator(ItemStruct *) it = Iterator; + return (it != List.end()) ? (*Iterator) : (ItemStruct *)NULL; + } + + /** adds a new item to the cache list. + * sets internal cursor to new position. + * + ** @param uid unique identifier + * @param status review status (optional) + */ + inline void addItem(const OFString &uid, + const DVIFhierarchyStatus status = DVIF_objectIsNew) + { + ItemStruct *item = new ItemStruct(uid, status); + List.push_back(item); + Iterator = --List.end(); // set to new position + } + + /** updates hierarchical/review status for all list items. + * + ** @return resulting review status (summary of all items) + */ + inline DVIFhierarchyStatus updateStatus() + { + OFListIterator(ItemStruct *) first = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + OFListIterator(ItemStruct *) iter = first; + DVIFhierarchyStatus status = DVIF_objectIsNew; + while (iter != last) + { + ItemStruct *item = (*iter); + if (item != NULL) + { + item->Status = item->List.updateStatus(); + switch (item->Status) + { + case DVIF_objectIsNew: + if (status == DVIF_objectIsNotNew) + status = DVIF_objectContainsNewSubobjects; + break; + case DVIF_objectIsNotNew: + if (iter == first) + status = DVIF_objectIsNotNew; + else if (status == DVIF_objectIsNew) + status = DVIF_objectContainsNewSubobjects; + break; + case DVIF_objectContainsNewSubobjects: + status = DVIF_objectContainsNewSubobjects; + break; + } + } + ++iter; + } + return status; + } + + + protected: + + /// list of series + OFList List; + /// internal cursor to current (selected) list item + OFListIterator(ItemStruct *) Iterator; + /// last visited position in item list + OFListIterator(ItemStruct *) OldIterator; +}; + + +/* ------------------------------ */ + + +/** A class to handle a study cache (list of items). + * This is the highest level in the hierarchical cache structure. + * This class is used by DVInterface. The internal structure + * is a list of DVSeriesCache. + */ +class DCMTK_DCMPSTAT_EXPORT DVStudyCache +{ + + public: + + /** Internal structure defining the list items. + */ + struct DCMTK_DCMPSTAT_EXPORT ItemStruct + { + /** Constructor. + * sets internal member variables. + * + ** @param uid unique identifier + * @param status review status (optional) + */ + ItemStruct(const OFString &uid, + const DVIFhierarchyStatus status = DVIF_objectIsNew) + : UID(uid), + Status(status), + List() + {} + + /// instance UID + OFString UID; + /// review status for the series + DVIFhierarchyStatus Status; + /// list of series within this study + DVSeriesCache List; + }; + + /** Constructor. + */ + DVStudyCache() + : List(), + Iterator() + { + Iterator = List.end(); + } + + /** Destructor + */ + virtual ~DVStudyCache() + { + clear(); + } + + /** reset all member variables to initial state + * delete all list items. + */ + inline void clear() + { + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + delete (*Iterator); + Iterator = List.erase(Iterator); + } + List.clear(); + Iterator = List.end(); + } + + /** checks whether study cache is empty + * + ** @return OFTrue if cache is empty, OFFalse otherwise + */ + inline OFBool empty() const + { + return List.empty(); + } + + /** gets number of cache entries + * + ** @return number of cache entries + */ + inline Uint32 getCount() const + { + return OFstatic_cast(Uint32, List.size()); + } + + /** sets internal cursor to specified position in cache list + * + ** @param idx index position in cache list (starting with 0) + * + ** @return OFTrue if successful, OFFalse if 'idx' is invalid + */ + inline OFBool gotoItem(Uint32 idx) + { + OFBool result = OFFalse; + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + if (idx == 0) + { + result = OFTrue; + break; + } + idx--; + ++Iterator; + } + return result; + } + + /** sets internal cursor to first position in cache list + * + ** @return OFTrue if successful, OFFalse if list is empty + */ + inline OFBool gotoFirst() + { + //OldIterator = Iterator; + Iterator = List.begin(); + return (Iterator != List.end()); + } + + /** sets internal cursor to next position in cache list + * + ** @return OFTrue if successful, OFFalse if new position is invalid + */ + inline OFBool gotoNext() + { + OFListIterator(ItemStruct *) last = List.end(); + if (Iterator != last) + Iterator++; + return (Iterator != last); + } + + /** checks whether an item with the specified UID exists in the cache list + * + ** @param uid UID which should be checked + * + ** @return OFTrue if such an item exists, OFFalse otherwise + */ + inline OFBool isElem(const OFString &uid) + { + OFBool result = OFFalse; + Iterator = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (Iterator != last) + { + const ItemStruct *item = (*Iterator); + if (item != NULL) + { + if (item->UID == uid) + { + result= OFTrue; + break; + } + } + ++Iterator; + } + return result; + } + + /** gets review status of the current (selected) sstudy + * + ** @return hierarchical status code if successful, 'isNew' otherwise + */ + inline DVIFhierarchyStatus getStatus() const + { + const ItemStruct *item = getItem(); + return (item != NULL) ? item->Status : DVIF_objectIsNew; + } + + /** gets reference to current (selected) study + * + ** @return pointer to ItemStruct if successful, NULL otherwise + */ + inline ItemStruct *getItem() const + { + OFListConstIterator(ItemStruct *) it = Iterator; + return (it != List.end()) ? (*Iterator) : (ItemStruct *)NULL; + } + + /** adds a new item to the cache list. + * sets internal cursor to new position. + * + ** @param uid unique identifier + * @param status review status (optional) + */ + inline void addItem(const OFString &uid, + const DVIFhierarchyStatus status = DVIF_objectIsNew) + { + ItemStruct *item = new ItemStruct(uid, status); + List.push_back(item); + Iterator = --List.end(); // set to new position + } + + /** updates hierarchical/review status for all list items. + * + ** @return resulting review status (summary of all items) + */ + inline void updateStatus() + { + OFListIterator(ItemStruct *) iter = List.begin(); + OFListIterator(ItemStruct *) last = List.end(); + while (iter != last) + { + ItemStruct *item = (*iter); + if (item != NULL) + item->Status = item->List.updateStatus(); + ++iter; + } + } + + + protected: + + /// list of studies + OFList List; + /// internal cursor to current (selected) list item + OFListIterator(ItemStruct *) Iterator; +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dviface.h b/dcmpstat/include/dcmtk/dcmpstat/dviface.h new file mode 100644 index 00000000..4dc1c811 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dviface.h @@ -0,0 +1,1836 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg, Joerg Riesmeier + * + * Purpose: + * classes: DVInterface + * + */ + + +#ifndef DVIFACE_H +#define DVIFACE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmpstat/dvpscf.h" /* for class DVConfiguration */ +#include "dcmtk/dcmpstat/dvpstat.h" /* for class DVPresentationState */ +#include "dcmtk/dcmqrdb/dcmqridx.h" /* for struct IdxRecord */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/dcmpstat/dvcache.h" /* for index file caching */ + + +class DicomImage; +class DiDisplayFunction; +class DVPSStoredPrint; +class DVPSPrintMessageHandler; +class DSRDocument; +class DVSignatureHandler; + +/** Interface class for the Softcopy Presentation State viewer. + * This class manages the database facilities, allows to start and stop + * network transactions and gives access to images and presentation states. + */ +class DCMTK_DCMPSTAT_EXPORT DVInterface: public DVConfiguration +{ + + public: + + /** constructor. + * @param config_file filename (path) of the config file to be used + * by the interface object. The caller should make sure that the config file + * really exists because the constructor cannot return an error status. + * If a non-existing filename (or NULL) is passed, an empty configuration file + * is assumed. + * @param useLog (optional) flag specifying whether a general log file should be used + * (config entry GENERAL\APPLICATION\LOGFILE). + */ + DVInterface(const char *config_file = NULL, OFBool useLog = OFFalse); + + /** destructor. + */ + virtual ~DVInterface(); + + /* load images, presentation states and structured reports */ + + /** loads an image which is contained in the database + * and creates a default presentation state for the image. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID study instance UID of the image + * @param seriesUID series instance UID of the image + * @param instanceUID SOP instance UID of the image + * @param changeStatus if true the image file is marked 'reviewed' (not new) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadImage(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus = OFFalse); + + /** loads an image (which need not be contained in the database) + * and creates a default presentation state for the image. + * This method does not acquire a database lock. + * @param filename path and filename of the image to be loaded + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadImage(const char *filename); + + /** loads an image which referenced by the current presentation + * state and needs to be contained in the database. + * This method acquires a database lock which must be explicitly freed by the user. + * @param idx index of the image to be loaded (< getNumberOfImageReferences()) + * @param changeStatus if true the image file is marked 'reviewed' (not new) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadReferencedImage(size_t idx, OFBool changeStatus = OFFalse); + + /** loads a presentation state which is contained in the database. + * The first image referenced in presentation state is also looked up in the + * database, loaded, and attached to the presentation state. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID study instance UID of the presentation state + * @param seriesUID series instance UID of the presentation state + * @param instanceUID SOP instance UID of the presentation state + * @param changeStatus if true the pstate and (first) image file is marked 'reviewed' (not new) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadPState(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus = OFFalse); + + /** loads a presentation state and an image (which need not be contained in the database) + * and attaches the image to the presentation state (if specified, otherwise the current + * image will be used). + * This method does not acquire a database lock. + * @param pstName path and filename of the presentation state to be loaded + * @param imgName path and filename of the image to be loaded + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadPState(const char *pstName, const char *imgName = NULL); + + /** loads a structured report which is contained in the database. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID study instance UID of the structured report + * @param seriesUID series instance UID of the structured report + * @param instanceUID SOP instance UID of the structured report + * @param changeStatus if true the structured report file is marked 'reviewed' (not new) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadStructuredReport(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus = OFFalse); + + /** loads a structured report (which need not be contained in the database). + * This method does not acquire a database lock. + * @param filename path and filename of the structured report to be loaded + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadStructuredReport(const char *filename); + + /** loads a structured reporting "template". + * This "template" is just a DICOM Structured Reporting file which resides in a + * special sub-folder and is referenced by the configuration file. This meachanism + * should facilitate the creation of new reports since one does not have to start + * with a completely empty report. + * Please note that the current structured report is replaced by the specified + * "template". New study/series/instance UIDs are generated automatically for the + * new report. + * This method does not acquire a database lock. + * @param reportID report identifier, as returned by getReportID(). + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadSRTemplate(const char *reportID); + + /** saves the current presentation state in the same directory + * in which the database index file resides. The filename is generated automatically. + * A new SOP Instance UID is assigned whenever a presentation state is saved. + * After successfully storing the presentation state, the database index is updated + * to include the new object. + * This method releases under any circumstances the database lock if it exists. + * @param replaceSOPInstanceUID flag indicating whether the + * SOP Instance UID should be replaced by a new UID. + * If true, a new UID is always generated. If false, a new + * UID is generated only if no UID has been assigned before. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition savePState(OFBool replaceSOPInstanceUID); + + /** saves the current presentation state in a file with the given path and filename. + * A new SOP Instance UID is assigned whenever a presentation state is saved. + * This method does not acquire a database lock and does not register + * the saved presentation state in the database. + * @param filename path and filename under which the presentation state is to be saved + * @param replaceSOPInstanceUID flag indicating whether the + * SOP Instance UID should be replaced by a new UID. + * If true, a new UID is always generated. If false, a new + * UID is generated only if no UID has been assigned before. + * @param explicitVR selects the transfer syntax to be written. True (the default) selects + * Explicit VR Little Endian, False selects Implicit VR Little Endian. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition savePState(const char *filename, OFBool replaceSOPInstanceUID, OFBool explicitVR=OFTrue); + + /** saves the DICOM image that is currently attached to the presentation state + * in a file with the given path and filename. + * This method does not acquire a database lock and does not register + * the saved presentation state in the database. + * @param filename path and filename under which the image is to be saved + * @param explicitVR selects the transfer syntax to be written. True (the default) selects + * Explicit VR Little Endian, False selects Implicit VR Little Endian. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveCurrentImage(const char *filename, OFBool explicitVR=OFTrue); + + /** saves the current structured report in the same directory in which the database index + * file resides. The filename is generated automatically. A new SOP Instance UID is not + * assigned automatically unless the method getStructuredReport().createRevisedVersion() + * is called (see documentation in file dcmsr/dsrdoc.h). This is not required for the + * first version of a document (i.e. directly after program start or calling the method + * getStructuredReport().createNewDocument()). + * After successfully storing the structured report, the database index is updated + * to include the new object. + * This method releases under any circumstances the database lock if it exists. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveStructuredReport(); + + /** saves the current structured report in a file with the given path and filename. + * A new SOP Instance UID is not assigned automatically unless the method + * getStructuredReport().createRevisedVersion() is called (see documentation in file + * dcmsr/dsrdoc.h). This is not required for the first version of a document (i.e. + * directly after program start or calling the method getStructuredReport().createNewDocument()). + * This method does not acquire a database lock and does not register the saved structured + * report in the database. + * @param filename path and filename under which the structured report is to be saved + * @param explicitVR selects the transfer syntax to be written. True (the default) selects + * Explicit VR Little Endian, False selects Implicit VR Little Endian. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveStructuredReport(const char *filename, OFBool explicitVR=OFTrue); + + /** adds an image which is contained in the database + * to the list of referenced images of the current presentation state. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID study instance UID of the image + * @param seriesUID series instance UID of the image + * @param instanceUID SOP instance UID of the image + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition addImageReferenceToPState(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** gets the number of image references contained in the current presentation state. + * @return number of image references, 0 if an error occurred. + */ + size_t getNumberOfImageReferences(); + + /** returns a reference to the current presentation state. + * This reference will become invalid when the DVInterface object is deleted, + * a different image or presentation state is loaded + * (using loadPState or loadImage) or when resetPresentationState() is called. + * @return reference to the current presentation state + */ + DVPresentationState& getCurrentPState() + { + return *pState; + } + + /** returns a reference to the current structured report. + * This reference will become invalid when the DVInterface object is deleted or + * a different structured report is loaded (using loadStructuredReport). + * @return reference to the current structured report + */ + DSRDocument& getCurrentReport() + { + return *pReport; + } + + /** returns a reference to the print handler. + * This reference remains valid as long as the DVInterface object exists. + * @return reference to the current print handler + */ + DVPSStoredPrint& getPrintHandler() + { + return *pPrint; + } + + /** resets the presentation state object to the status it had immediately after the + * last successful operation of "loadImage" or "loadPState". A state can also explicitly + * specified as such a "reset state" by using the method saveCurrentPStateForReset(). + * Attention: The last reference returned by getCurrentPState() becomes invalid + * when this method is called. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition resetPresentationState(); + + /** saves the current state of the presentation state object to be used for + * resetPresentationState(). This is e.g. useful after registration of additional images + * directly after a new images has been loaded. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveCurrentPStateForReset(); + + /** removes any shared or exclusive lock on the database. + * This method should be called when a database transaction + * (i.e. reading all studies, series, instances etc.) is finished. + * As long as a lock exists on the database, no other application + * (i.e. the network receiver) can add new images to the database. + * This method also clears the index cache. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition releaseDatabase(); + + /** searches in the database for a DICOM instance with the given + * study, series and instance UIDs and returns its pathname if found. + * If the given instance is not found in the database, NULL is returned. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID the DICOM study instance UID + * @param seriesUID the DICOM series instance UID + * @param instanceUID the DICOM SOP instance UID + * @return filename (path) if found, NULL otherwise + */ + const char *getFilename(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** returns the number of studies currently contained in the database. + * This method acquires a database lock which must be explicitly freed by the user. + * The number reported (returned) by this method remains valid as long + * as the database lock remains active and no function modifying the database is called. + * Functions that modify the database are: Storing new presentation states, + * deleting data, modifying the 'reviewed' status flag of IODs. + * @return number of studies in the database. + */ + Uint32 getNumberOfStudies(); + + /** selects the study with the given index in the database. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * Implicitly the first series and first instance within this study is selected, too. + * @param idx index to be selected, must be < getNumberOfStudies() + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectStudy(Uint32 idx); + + /** selects the study with the given UID in the database. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * Implicitly the first series and first instance within this study is selected, too. + * @param studyUID the DICOM study instance UID + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectStudy(const char *studyUID); + + /** returns the review status of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * Implicitly the first instance within this series is selected, too. + * @return study review status + */ + DVIFhierarchyStatus getStudyStatus() ; + + /** returns the Study Instance UID of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Study Instance UID or NULL if absent or not selected. + */ + const char *getStudyUID(); + + /** returns the Study Description of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Study Description or NULL if absent or not selected. + */ + const char *getStudyDescription(); + + /** returns the Study Date of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Study Date or NULL if absent or not selected. + */ + const char *getStudyDate(); + + /** returns the Study Time of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Study Time or NULL if absent or not selected. + */ + const char *getStudyTime(); + + /** returns the Referring Physicians Name of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Referring Physicians Name or NULL if absent or not selected. + */ + const char *getReferringPhysiciansName(); + + /** returns the Accession Number of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Accession Number or NULL if absent or not selected. + */ + const char *getAccessionNumber(); + + /** returns the Name Of Physicians Reading Study of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Name Of Physicians Reading Study or NULL if absent or not selected. + */ + const char *getNameOfPhysiciansReadingStudy(); + + /** returns the Patient Name of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Patient Name or NULL if absent or not selected. + */ + const char *getPatientName(); + + /** returns the Patient ID of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Patient ID or NULL if absent or not selected. + */ + const char *getPatientID(); + + /** returns the Patient Birth Date of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Patient Birth Date or NULL if absent or not selected. + */ + const char *getPatientBirthDate(); + + /** returns the Patient Sex of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Patient Sex or NULL if absent or not selected. + */ + const char *getPatientSex(); + + /** returns the Patient Birth Time of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Patient Birth Time or NULL if absent or not selected. + */ + const char *getPatientBirthTime(); + + /** returns the Other Patient Names of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Other Patient Names or NULL if absent or not selected. + */ + const char *getOtherPatientNames(); + + /** returns the Other Patient ID of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Other Patient ID or NULL if absent or not selected. + */ + const char *getOtherPatientID(); + + /** returns the Patient Ethnic Group of the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * Note: Since the database uses the Study Root model, patient data appears + * on the study level. + * This method acquires a database lock which must be explicitly freed by the user. + * @return Patient Ethnic Group or NULL if absent or not selected. + */ + const char *getEthnicGroup(); + + /** returns the number of series within the currently selected study. + * May be called only if a valid study selection exists - see selectStudy(). + * This method acquires a database lock which must be explicitly freed by the user. + * See the comments for getNumberOfStudies() about the validity period + * of the returned number. + * @return number of series in the current study. + */ + Uint32 getNumberOfSeries(); + + /** selects the series with the given index within the currently selected study. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * @param idx index to be selected, must be < getNumberOfSeries() + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectSeries(Uint32 idx); + + /** selects the series with the given UID within the currently selected study. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * @param seriesUID series instance UID of the image + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectSeries(const char *seriesUID); + + /** returns the Series Instance UID of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Instance UID or NULL if absent or not selected. + */ + const char *getSeriesUID(); + + /** returns the review status of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return series review status + */ + DVIFhierarchyStatus getSeriesStatus(); + + /** returns the type of all instances within the currently selected series. + * DICOM series always contain a single modality only, if not the modality of + * the first examined instance (which is no image) is used (e.g. PresentationState). + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return instance type + */ + DVPSInstanceType getSeriesType(); + + /** returns the type of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return instance type + */ + DVPSInstanceType getInstanceType(); + + /** returns the Series Number of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Number or NULL if absent or not selected. + */ + const char *getSeriesNumber(); + + /** returns the Series Date of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Date or NULL if absent or not selected. + */ + const char *getSeriesDate(); + + /** returns the Series Time of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Time or NULL if absent or not selected. + */ + const char *getSeriesTime(); + + /** returns the Series Description of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Description or NULL if absent or not selected. + */ + const char *getSeriesDescription(); + + /** returns the Series Performing Physicians Name of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Performing Physicians Name or NULL if absent or not selected. + */ + const char *getSeriesPerformingPhysiciansName(); + + /** returns the Series Protocol Name of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Protocol Name or NULL if absent or not selected. + */ + const char *getSeriesProtocolName(); + + /** returns the Series Operators Name of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Series Operators Name or NULL if absent or not selected. + */ + const char *getSeriesOperatorsName(); + + /** returns the Modality of the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Modality or NULL if absent or not selected. + */ + const char *getModality(); + + /** returns the number of instances (IODs) within the currently selected series. + * May be called only if a valid series selection exists - see selectSeries(). + * This method acquires a database lock which must be explicitly freed by the user. + * See the comments for getNumberOfStudies() about the validity period + * of the returned number. + * @return number of instances in the current series. + */ + Uint32 getNumberOfInstances(); + + /** selects the instance with the given index within the currently selected series. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * @param idx index to be selected, must be < getNumberOfInstances() + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectInstance(Uint32 idx); + + /** selects the instance with the given UID within the currently selected series. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * @param instanceUID SOP instance UID of the instance + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectInstance(const char *instanceUID); + + /** selects the instance with the given UID and SOP class over all studies and series. + * Please note that in worst case all studies, series and instances are examined. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * @param instanceUID SOP instance UID of the instance + * @param sopClassUID SOP class UID of the instance (might be NULL to be not compared) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectInstance(const char *instanceUID, const char *sopClassUID); + + /** selects the instance with the given UIDs. + * This method acquires a database lock which must be explicitly freed by the user. + * The selection remains valid until the database lock is removed or the database + * is modified (see comments for getNumberOfStudies). + * @param studyUID study instance UID of the instance + * @param seriesUID series instance UID of the instance + * @param instanceUID SOP instance UID of the instance + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectInstance(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** returns the SOP class UID of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return SOP Instance UID or NULL if absent or not selected. + */ + const char *getSOPClassUID(); + + /** returns the SOP Instance UID of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return SOP Instance UID or NULL if absent or not selected. + */ + const char *getInstanceUID(); + + /** returns the Image Number of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Image Number or NULL if absent or not selected. + */ + const char *getImageNumber(); + + /** returns the Filename of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Filename or NULL if absent or not selected. + */ + const char *getFilename(); + + /** returns the review status of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return instance review status + */ + DVIFhierarchyStatus getInstanceStatus() ; + + /** returns the escription of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Instance Description or NULL if absent or not selected. + */ + const char *getInstanceDescription(); + + /** returns the Presentation Label of the currently selected instance. + * May be called only if a valid instance selection exists - see selectInstance(). + * This method acquires a database lock which must be explicitly freed by the user. + * @return Presentation Label or NULL if absent or not selected. + */ + const char *getPresentationLabel(); + + + /* methods modifying the database */ + + /** modifies the review flag for one instance in the database, which is set to + * 'reviewed' state (DVIF_objectIsNotNew). The status of the corresponding series + * and study is updated automatically. + * This method acquires a database lock which must be explicitly freed by the user. + * The database is modified - any study, series or instance selection + * and the number of studies, series and instances reported will become invalid since + * other processes may modify the database before the exclusive lock is granted to this method. + * @param studyUID study instance UID of the reviewed instance + * @param seriesUID series instance UID of the reviewed instance + * @param instanceUID SOP instance UID of the reviewed instance + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition instanceReviewed(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** deletes the given instance from the database. If the corresponding DICOM file + * resides in the same directory as the index file, it is also removed. + * This method acquires a database lock which must be explicitly freed by the user. + * The database is modified - any study, series or instance selection + * and the number of studies, series and instances reported will become invalid since + * other processes may modify the database before the exclusive lock is granted to this method. + * @param studyUID study instance UID of the instance to be deleted + * @param seriesUID series instance UID of the instance to be deleted + * @param instanceUID SOP instance UID of the instance to be deleted + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition deleteInstance(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** deletes the given series from the database. Any of the corresponding DICOM files + * residing in the same directory as the index file are also removed. + * This method acquires a database lock which must be explicitly freed by the user. + * The database is modified - any study, series or instance selection + * and the number of studies, series and instances reported will become invalid since + * other processes may modify the database before the exclusive lock is granted to this method. + * @param studyUID study instance UID of the series to be deleted + * @param seriesUID series instance UID of the series to be deleted + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition deleteSeries(const char *studyUID, const char *seriesUID); + + /** deletes the given study from the database. Any of the corresponding DICOM files + * residing in the same directory as the index file are also removed. + * This method acquires a database lock which must be explicitly freed by the user. + * The database is modified - any study, series or instance selection + * and the number of studies, series and instances reported will become invalid since + * other processes may modify the database before the exclusive lock is granted to this method. + * @param studyUID study instance UID of the study to be deleted + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition deleteStudy(const char *studyUID); + + /* here follow the Network interface methods */ + + /** starts the network receiver processes (Storage Service Class SCPs). + * The receiver processes will wait for incoming DICOM associations, receive images + * and presentation states. Data will be stored in file and registered in the + * database index file. Attention: Successful return of this method is no guarantee + * that the network receiver has successfully started, because certain errors + * (i.e. incorrect settings in the config file) will only be noted in the network + * receiver process when running. On Unix platform, successful return of this method + * means that the fork() used to start the receiver was successful. + * On Win32 platforms, it means that the CreateProcess() call was successful. + * @return EC_Normal if the receiver processes could be started, an error code otherwise. + */ + OFCondition startReceiver(); + + /** terminates the network receiver process (Storage Service Class SCP). + * This method attempts to terminate the network receiver process by + * requesting a DICOM association with it and delivering a special "shutdown" command. + * If for some reason the network receiver cannot be found (i.e. because it has + * terminated abnormally), a TCP/IP timeout (several seconds) may occur before this method returns. + * @return EC_Normal if the receiver process could be terminated, an error code otherwise. + */ + OFCondition terminateReceiver(); + + /** starts the query/retrieve server process (Query/Retrieve Service Class SCP). + * The query/retrieve process will wait for incoming DICOM associations, serve queries and + * send the requested instances to the specified destination. Data will be taken from the + * same local database used to store received instances and created presentation states, + * stored print objects and hardcopy grayscale images. + * The configuration file which is required for the query/retrieve process will be created + * automatically from the 'global' configuration file each time this method is called, unless + * this automatical creation is disabled (entry: [QUERYRETIUEVE] AutoCreateConfigFile = false). + * Attention: Successful return of this method is no guarantee that the query/retrieve server + * has successfully started, because certain errors (i.e. incorrect settings in the config file) + * will only be noted in the query/retrieve process when running. On Unix platform, successful + * return of this method means that the fork() used to start the receiver was successful. + * On Win32 platforms, it means that the CreateProcess() call was successful. + * @return EC_Normal if the query/retrieve process could be started, an error code otherwise. + */ + OFCondition startQueryRetrieveServer(); + + /** terminates the query/retrieve server process (Query/Retrieve Service Class SCP). + * This method attempts to terminate the query/retrieve process by requesting a + * DICOM association with it and delivering a special "shutdown" command. + * If for some reason the query/retrieve server cannot be found (i.e. because it has + * terminated abnormally), a TCP/IP timeout (several seconds) may occur before this + * method returns. + * @return EC_Normal if the query/retrieve process could be terminated, + * an error code otherwise. + */ + OFCondition terminateQueryRetrieveServer(); + + /** tests whether the database has been modified in any way since the last + * call to this method. Any write access to the database (adding, deleting, changing) + * is reported. This method works by modifying and checking the "modification date/time" + * of the database index file. This method is not affected by database locks and can be + * called at any time. + * Always returns OFTrue for the first call after construction of the interface. + * Also returns OFTrue if something goes wrong (i.e. if the method cannot make sure + * that nothing has changed). + * @return OFTrue if the database has been modified since the last call to this method. + */ + OFBool newInstancesReceived(); + + /** sends a complete study over network to a different DICOM peer. + * A separate application or process is launched to handle the send operation. + * This call returns when the send operation has successfully been launched. + * No information about the status or success of the transfer itself is being made + * available. + * @param targetID symbolic identifier of the send target, must be one of the + * strings returned by getTargetID(). + * @param studyUID Study Instance UID of the study to be sent. Must be a study + * contained in the database. + * @return EC_Normal when the send process has successfully been launched, + * an error condition otherwise. + */ + OFCondition sendStudy(const char *targetID, const char *studyUID) + { + return sendIOD(targetID, studyUID, NULL, NULL); + } + + /** sends a complete series over network to a different DICOM peer. + * A separate application or process is launched to handle the send operation. + * This call returns when the send operation has successfully been launched. + * No information about the status or success of the transfer itself is being made + * available. + * @param targetID symbolic identifier of the send target, must be one of the + * strings returned by getTargetID(). + * @param studyUID Study Instance UID of the series to be sent. Must be a series + * contained in the database. + * @param seriesUID Series Instance UID of the series to be sent. Must be a series + * contained in the database. + * @return EC_Normal when the send process has successfully been launched, + * an error condition otherwise. + */ + OFCondition sendSeries(const char *targetID, const char *studyUID, const char *seriesUID) + { + return sendIOD(targetID, studyUID, seriesUID, NULL); + } + + /** sends a single instance (image or presentation state) + * over network to a different DICOM peer. + * A separate application or process is launched to handle the send operation. + * This call returns when the send operation has successfully been launched. + * No information about the status or success of the transfer itself is being made + * available. + * @param targetID symbolic identifier of the send target, must be one of the + * strings returned by getTargetID(). + * @param studyUID Study Instance UID of the IOD to be sent. Must be an IOD + * contained in the database. + * @param seriesUID Series Instance UID of the IOD to be sent. Must be an IOD + * contained in the database. + * @param instanceUID SOP Instance UID of the IOD to be sent. Must be an IOD + * contained in the database. + * @return EC_Normal when the send process has successfully been launched, + * an error condition otherwise. + */ + OFCondition sendIOD(const char *targetID, const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** creates a dump of the contents of a DICOM file and displays it on-screen. + * A separate application or process is launched to handle the dump and display. + * This call returns when the dump operation has successfully been launched. + * No information about the status or success of the process itself is being made + * available. + * This method does not acquire a database lock. + * @param filename path of file to be displayed. + * @return EC_Normal when the process has successfully been launched, + * an error condition otherwise. + */ + OFCondition dumpIOD(const char *filename); + + /** creates a dump of the contents of a DICOM file and displays it on-screen. + * A separate application or process is launched to handle the dump and display. + * This call returns when the dump operation has successfully been launched. + * No information about the status or success of the process itself is being made + * available. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID Study Instance UID of the IOD to be dumped. Must be an IOD + * contained in the database. + * @param seriesUID Series Instance UID of the IOD to be dumped. Must be an IOD + * contained in the database. + * @param instanceUID SOP Instance UID of the IOD to be dumped. Must be an IOD + * contained in the database. + * @return EC_Normal when the process has successfully been launched, + * an error condition otherwise. + */ + OFCondition dumpIOD(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** checks the contents of a DICOM file and displays an evaluation report on the screen. + * A separate application or process is launched to handle the evaluation and display. + * This call returns when the check operation has successfully been launched. + * No information about the status or success of the process itself is being made + * available. + * This method does not acquire a database lock. + * @param filename path of file to be checked. + * @return EC_Normal when the process has successfully been launched, + * an error condition otherwise. + */ + OFCondition checkIOD(const char *filename); + + /** checks the contents of a DICOM file and displays an evaluation report on the screen. + * A separate application or process is launched to handle the evaluation and display. + * This call returns when the check operation has successfully been launched. + * No information about the status or success of the process itself is being made + * available. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID Study Instance UID of the IOD to be checked. Must be an IOD + * contained in the database. + * @param seriesUID Series Instance UID of the IOD to be checked. Must be an IOD + * contained in the database. + * @param instanceUID SOP Instance UID of the IOD to be checked. Must be an IOD + * contained in the database. + * @return EC_Normal when the process has successfully been launched, + * an error condition otherwise. + */ + OFCondition checkIOD(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** saves a monochrome bitmap as a DICOM Secondary Capture image. + * The bitmap must use one byte per pixel, left to right, top to bottom + * order of the pixels. 0 is interpreted as black, 255 as white. + * @param filename the file name or path under which the image is saved. + * @param pixelData a pointer to the image data. Must contain at least + * width*height bytes of data. + * @param width the width of the image, must be <= 0xFFFF + * @param height the height of the image, must be <= 0xFFFF + * @param aspectRatio the pixel aspect ratio as width/height. If omitted, a pixel + * aspect ratio of 1/1 is assumed. + * @param explicitVR selects the transfer syntax to be written. + * True selects Explicit VR Little Endian, False selects Implicit VR Little Endian. + * @param instanceUID optional parameter containing the SOP Instance UID to be written. + * This parameter should be omitted unless the SOP Instance UID needs to be controlled + * externally. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveDICOMImage( + const char *filename, + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio=1.0, + OFBool explicitVR=OFTrue, + const char *instanceUID=NULL); + + /** saves a monochrome bitmap as a DICOM Secondary Capture image + * in the same directory in which the database index file resides. + * The filename is generated automatically. + * When the image is stored successfully, the database index is updated + * to include the new object. + * This method releases under any circumstances the database lock if it exists. + * @param pixelData a pointer to the image data. Must contain at least + * width*height bytes of data. + * @param width the width of the image, must be <= 0xFFFF + * @param height the height of the image, must be <= 0xFFFF + * @param aspectRatio the pixel aspect ratio as width/height. If omitted, a pixel + * aspect ratio of 1/1 is assumed. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveDICOMImage( + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio=1.0); + + /** saves a monochrome bitmap as a DICOM Hardcopy Grayscale image. + * The bitmap must use 16 bits per pixel, left to right, top to bottom + * order of the pixels. It is assumed that only values 0..4095 are used. + * @param filename the file name or path under which the image is saved. + * @param pixelData a pointer to the image data. Must contain at least + * width*height*2 bytes of data. + * @param width the width of the image, must be <= 0xFFFF + * @param height the height of the image, must be <= 0xFFFF + * @param aspectRatio the pixel aspect ratio as width/height. If omitted, a pixel + * aspect ratio of 1/1 is assumed. + * @param explicitVR selects the transfer syntax to be written. + * True selects Explicit VR Little Endian, False selects Implicit VR Little Endian. + * @param instanceUID optional parameter containing the SOP Instance UID to be written. + * This parameter should be omitted unless the SOP Instance UID needs to be controlled + * externally. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveHardcopyGrayscaleImage( + const char *filename, + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio=1.0, + OFBool explicitVR=OFTrue, + const char *instanceUID=NULL); + + /** saves a monochrome bitmap as a DICOM Hardcopy Grayscale image + * in the same directory in which the database index file resides. + * The filename is generated automatically. + * When the image is stored successfully, the database index is updated + * to include the new object. + * This method releases under any circumstances the database lock if it exists. + * @param pixelData a pointer to the image data. Must contain at least + * width*height*2 bytes of data. + * @param width the width of the image, must be <= 0xFFFF + * @param height the height of the image, must be <= 0xFFFF + * @param aspectRatio the pixel aspect ratio as width/height. If omitted, a pixel + * aspect ratio of 1/1 is assumed. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveHardcopyGrayscaleImage( + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio=1.0); + + /** saves a DICOM object into a file in the same directory in which the + * database index file resides. The object must contain a SOP Class + * UID and SOP Instance UID. The filename is generated automatically. + * When the image is stored successfully, the database index is + * updated to include the new object. This method releases under any + * circumstances the database lock if it exists. + * @param fileformat the complete DICOM file object to be written + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveFileFormatToDB(DcmFileFormat &fileformat); + + /** loads a Stored Print object which is contained in the database into memory. + * Attention: The current print job (Stored Print object) will be deleted by doing this. + * This method acquires a database lock which must be explicitly freed by the user. + * @param studyUID study instance UID of the Stored Print object + * @param seriesUID series instance UID of the Stored Print object + * @param instanceUID SOP instance UID of the Stored Print object + * @param changeStatus if true the stored print object is marked 'reviewed' (not new) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadStoredPrint(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus = OFFalse); + + /** loads a Stored Print object (which need not be contained in the database) into memory. + * Attention: The current print job (Stored Print object) will be deleted by doing this. + * This method does not acquire a database lock. + * @param filename path and filename of the Stored Print object to be loaded + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition loadStoredPrint(const char *filename); + + /** saves the current print job as a Stored Print object. + * @param filename the file name or path under which the image is saved. + * @param writeRequestedImageSize if false, the Requested Image Size attributes are not written, + * e. g. because they are not supported by the target printer. + * @param explicitVR selects the transfer syntax to be written. + * True selects Explicit VR Little Endian, False selects Implicit VR Little Endian. + * @param instanceUID optional parameter containing the SOP Instance UID to be written. + * This parameter should be omitted unless the SOP Instance UID needs to be controlled + * externally. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveStoredPrint( + const char *filename, + OFBool writeRequestedImageSize, + OFBool explicitVR=OFTrue, + const char *instanceUID=NULL); + + /** saves the current print job as a Stored Print object + * in the same directory in which the database index file resides. + * The filename is generated automatically. + * When the image is stored successfully, the database index is updated + * to include the new object. + * This method releases under any circumstances the database lock if it exists. + * @param writeRequestedImageSize if false, the Requested Image Size attributes are not written, + * e. g. because they are not supported by the target printer. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition saveStoredPrint(OFBool writeRequestedImageSize); + + /** gets the number of Hardcopy Grayscaleimages currently registered by the stored print object. + * @return number of images. + */ + size_t getNumberOfPrintPreviews(); + + /** loads a Hardcopy Grayscale image registered by the stored print object and creates a preview. + * The preview bitmap is implicitly scaled to fit into the rectangle specified by + * setMaxPrintPreviewWidthHeight(). + * @param idx index of the image, must be < getNumberOfPrintPreviews() + * @param printLUT OFTrue if presentation LUT should be interpreted as a print presentation LUT + * (default, in this case there is no implicit scaling of the input width of the LUT and, + * therefore, the VOI transformation - which is absent for print - is used), + * OFFalse otherwise (softcopy interpretation of a presentation LUT) + * @param changeStatus if true the hardcopy grayscale image file is marked 'reviewed' (not new) + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition loadPrintPreview(size_t idx, OFBool printLUT = OFTrue, OFBool changeStatus = OFFalse); + + /** removes a currently loaded Hardcopy Grayscale image from memory. + */ + void unloadPrintPreview(); + + /** gets number of bytes used for the print preview bitmap. + * (depends on width, height and depth) + * @return number of bytes used for the preview bitmap + */ + unsigned long getPrintPreviewSize(); + + /** sets the maximum print preview bitmap width and height. + * Larger images are scaled down (according to the pixel aspect ratio) to fit into + * the specified rectangle. + * Attention: If the values differ from the the previous ones the currently loaded + * hardcopy grayscale image (preview) is automatically detroyed and has to be re-loaded. + * @param width maximum width of preview bitmap (in pixels) + * @param height maximum height of preview bitmap (in pixels) + */ + void setMaxPrintPreviewWidthHeight(unsigned long width, unsigned long height); + + /** gets width and height of print preview bitmap. + * The return values depend on the current maximum preview bitmap width/height values! + * @param width upon success, the bitmap width (in pixels) is returned in this parameter + * @param height upon success, the bitmap height (in pixels) is returned in this parameter + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPrintPreviewWidthHeight(unsigned long &width, unsigned long &height); + + /** writes the bitmap data of the print preview image into the given buffer. + * The storage area must be allocated and deleted from the calling method. + * @param bitmap pointer to storage area where the pixel data is copied to (array of 8 bit values) + * @param size specifies size of the storage area in bytes + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPrintPreviewBitmap(void *bitmap, unsigned long size); + + /** stores the current presentation state in a temporary place + * and creates a new presentation state that corresponds with an + * image displayed "without" presentation state. + * If called twice, an error code is returned. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition disablePState(); + + /** restores the stored presentation state (see disablePresentationState) + * and deletes the temporary presentation state. + * If no stored presentation state exists, returns an error. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition enablePState(); + + /** returns number of presentation states referencing the currently selected image. + * If no instance is currently selected or the selected instance is a presentation + * state, returns an error. + * @return number of presentation states, 0 if none available or an error occurred + */ + Uint32 getNumberOfPStates(); + + /** selects and loads specified presentation state referencing the currently selected + * image. + * @param idx index to be selected, must be < getNumberOfPStates() + * @param changeStatus if true the presentation state is marked 'reviewed' (not new) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition selectPState(Uint32 idx, OFBool changeStatus = OFFalse); + + /** returns description of specified presentation state referencing the currently + * selected image. + * @param idx index to be selected, must be < getNumberOfPStates() + * @return presentation state description or NULL idx is invalid + */ + const char *getPStateDescription(Uint32 idx); + + /** returns label of specified presentation state referencing the currently + * selected image. + * @param idx index to be selected, must be < getNumberOfPStates() + * @return presentation state label or NULL idx is invalid + */ + const char *getPStateLabel(Uint32 idx); + + /** checks whether display correction is possible (in principle), + * i.e. a valid monitor characteristics description exists + * and current system is a low-cost system (without built-in + * calibration). + * @param transform display transform to be checked (default: GSDF) + * @return OFTrue if display transform is possible, OFFalse otherwise + */ + OFBool isDisplayTransformPossible(DVPSDisplayTransform transform = DVPSD_GSDF); + + /** sets ambient light value for the display transformation. + * @param value ambient light value to be set + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setAmbientLightValue(double value); + + /** returns ambient light value for the display transformation. + * @param value returned ambient light value + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getAmbientLightValue(double &value); + + /* print related methods */ + + /** selects the current printer. Also adjusts the destination AE title and the + * printer name attribute within the Stored Print object. + * @param targetID one of the printer target IDs returned by getTargetID(). + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setCurrentPrinter(const char *targetID); + + /** gets the current printer's target ID. + * @return printer target ID, can be NULL if no printer is defined + * in the configuration file. + */ + const char *getCurrentPrinter(); + + /** sets the (optional) print medium type. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrinterMediumType(const char *value); + + /** gets the (optional) print medium type. + * @return medium type, may be NULL. + */ + const char *getPrinterMediumType(); + + /** sets the (optional) printer film destination. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrinterFilmDestination(const char *value); + + /** gets the (optional) printer film destination. + * @return printer film destination, may be NULL or empty string. + */ + const char *getPrinterFilmDestination(); + + /** sets the (optional) printer film session label. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrinterFilmSessionLabel(const char *value); + + /** gets the (optional) printer film session label. + * @return printer film session label, may be NULL or empty string. + */ + const char *getPrinterFilmSessionLabel(); + + /** sets the (optional) print priority. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrinterPriority(const char *value); + + /** gets the (optional) print priority. + * @return print priority, may be NULL or empty string. + */ + const char *getPrinterPriority(); + + /** sets the (optional) print session owner ID. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrinterOwnerID(const char *value); + + /** gets the (optional) print session owner ID. + * @return print session owner ID, may be NULL or empty string. + */ + const char *getPrinterOwnerID(); + + /** sets the (optional) print number of copies. + * @param value new attribute value, may be 0. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrinterNumberOfCopies(unsigned long value); + + /** gets the (optional) print number of copies. + * @return print number of copies, 0 if absent. + */ + unsigned long getPrinterNumberOfCopies(); + + /** resets the settings for basic film session (everything that + * is not managed by the Stored Print object) to initial state. + * Affects medium type, film destination, film session label, + * priority, owner ID, and number of copies. + */ + void clearFilmSessionSettings(); + + /** sets the LUT with the given identifier + * in the Presentation State as current Presentation LUT. + * @param lutID LUT identifier, as returned by getLUTID(). + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition selectDisplayPresentationLUT(const char *lutID); + + /** if the Presentation State contains an active + * Presentation LUT that was set with selectDisplayPresentationLUT(), + * return the corresponding LUT identifier. + * @return lutID if found, NULL or empty string otherwise. + */ + const char *getDisplayPresentationLUTID(); + + /** sets the LUT with the given identifier in the Stored Print object + * as current Presentation LUT. This LUT overrides the settings made + * for the separate image boxes, it can be deactivated using the method + * DVPSStoredPrint::setDefaultPresentationLUT(). + * @param lutID LUT identifier, as returned by getLUTID(). + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition selectPrintPresentationLUT(const char *lutID); + + /** if the Stored Print object contains an active + * Presentation LUT that was set with selectPrintPresentationLUT(), + * return the corresponding LUT identifier. + * @return lutID if found, NULL or empty string otherwise. + */ + const char *getPrintPresentationLUTID(); + + /** start spooling of print job with current settings. + * @param deletePrintedImages if true, delete printed images from queue. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition spoolPrintJob(OFBool deletePrintedImages=OFTrue); + + /** starts the print spooler process. + * The print spooler will wait for print jobs created with spoolPrintJob() + * and communicate them to the printer using the DICOM Print Management Service Class. + * Attention: Successful return of this method is no guarantee + * that the spooler has successfully started, because certain errors + * (i.e. incorrect settings in the config file) will only be noted in the spooler + * process when running. On Unix platform, successful return of this method + * means that the fork() used to start the spooler was successful. + * On Win32 platforms, it means that the CreateProcess() call was successful. + * @return EC_Normal if the spooler process could be started, an error code otherwise. + */ + OFCondition startPrintSpooler(); + + /** terminates the print spooler process. This method creates a "dummy" + * print job that request the print spooler to shutdown as soon as all other pending + * print jobs are finished. + * @return EC_Normal if the spooler process dummy print job could be written, + * an error code otherwise. + */ + OFCondition terminatePrintSpooler(); + + /** starts the print server process (Basic Grayscale Print Management SCP). + * The print server process will wait for incoming DICOM associations, handle the + * DICOM print protcol, store data in file and register stored print and grayscale + * image objects in the database index file. + * Attention: Successful return of this method is no guarantee that the print + * server has successfully started, because certain errors (i.e. incorrect settings + * in the config file) will only be noted in the print server process when running. + * On Unix platform, successful return of this method means that the fork() used to + * start the server was successful. + * On Win32 platforms, it means that the CreateProcess() call was successful. + * @return EC_Normal if the server process could be started, an error code otherwise. + */ + OFCondition startPrintServer(); + + /** terminates the print server process (Basic Grayscale Print Management SCP). + * This method attempts to terminate the print server process by requesting a DICOM + * association with it and delivering a special "shutdown" command. + * If for some reason the print server cannot be found (i.e. because it has terminated + * abnormally), a TCP/IP timeout (several seconds) may occur before this method returns. + * @return EC_Normal if the server process could be terminated, an error code otherwise. + */ + OFCondition terminatePrintServer(); + + /** adds an existing DICOM image (should be Hardcopy Grayscale) + * that is already present in the image database to the current print image queue + * without rendering it again. + * The "requested image size" option is not used - the bitmap is treated as if the + * presentation mode was "SCALE TO FIT". + * @param studyUID study instance UID of the image, as reported by getStudyUID() + * @param seriesUID series instance UID of the image, as reported by getSeriesUID() + * @param instanceUID SOP instance UID of the image, as reported by getInstanceUID() + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition addToPrintHardcopyFromDB(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** requests the spooler process to print an old print job that is stored + * in the database as a "stored print" object. The Stored Print that is printed + * does not contain all parameters of a print job. The following parameters are taken from the + * current settings in this object: Target printer, medium type, + * illumination and reflected ambient light. + * @param studyUID study instance UID of the Stored Print, as reported by getStudyUID() + * @param seriesUID series instance UID of the Stored Print, as reported by getSeriesUID() + * @param instanceUID SOP instance UID of the Stored Print, as reported by getInstanceUID() + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition spoolStoredPrintFromDB(const char *studyUID, const char *seriesUID, const char *instanceUID); + + /** Initiates the creation of a DICOM Basic Film Session SOP Instance in the printer. + * This method stores all Basic Film Session related attributes that are managed by this object + * in a DICOM dataset and passes the result to the embedded Stored Print object which manages + * the further communication. + * @param printHandler print communication handler, association must be open. + * @param plutInSession true if printer expects referenced presentation LUT sequence, illumination + * and reflected ambient light in basic film session, false if it expects them in basic film box. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUcreateBasicFilmSession(DVPSPrintMessageHandler& printHandler, OFBool plutInSession); + + /* annotation interface */ + + /** gets the current setting of the annotation activity annotation flag. + * @return OFTrue if annotation is on, OFFalse otherwise. + */ + OFBool isActiveAnnotation() { return activateAnnotation; } + + /** gets the current setting of the Prepend Date/Time annotation flag. + * @return OFTrue if Prepend Date/Time is on, OFFalse otherwise. + */ + OFBool getPrependDateTime() { return prependDateTime; } + + /** gets the current setting of the Prepend Printer Name annotation flag. + * @return OFTrue if Prepend Printer Name is on, OFFalse otherwise. + */ + OFBool getPrependPrinterName() { return prependPrinterName; } + + /** gets the current setting of the Prepend Lighting annotation flag. + * @return OFTrue if Prepend Lighting is on, OFFalse otherwise. + */ + OFBool getPrependLighting() { return prependLighting; } + + /** gets the current annotation text. + * @return annotation text, may be NULL or empty string. + */ + const char *getAnnotationText() { return annotationText.c_str(); } + + /** switches annotation printing on/off + * @param value OFTrue if annotation is switched on, OFFalse otherwise. + */ + void setActiveAnnotation(OFBool value) { activateAnnotation=value; } + + /** sets the Prepend Date/Time annotation flag. + * @param value OFTrue if Prepend Date/Time is switched on, OFFalse otherwise. + */ + void setPrependDateTime(OFBool value) { prependDateTime=value; } + + /** sets the Prepend Printer Name annotation flag. + * @param value OFTrue if Prepend Printer Name is switched on, OFFalse otherwise. + */ + void setPrependPrinterName(OFBool value) { prependPrinterName=value; } + + /** sets the Prepend Lighting annotation flag. + * @param value OFTrue if Prepend Lighting is switched on, OFFalse otherwise. + */ + void setPrependLighting(OFBool value) { prependLighting=value; } + + /** sets the current annotation text. + * @param value new text, may be NULL. + */ + void setAnnotationText(const char *value); + + /* user management interface */ + + /** verifies the given password for the given user ID. This method tries + * to load and decrypt the private key for the given user with the + * given password. If this fails, the password verification fails, + * otherwise the password verification succeeds. + * @remark this method is only functional if DCMTK is compiled with + * OpenSSL support enabled. Otherwise it always returns false. + * @param userID symbolic user ID for given user, as returned by + * DVConfiguration::getUserID() + * @param passwd for user as entered in some GUI control + * @return true if password verification succeeds, false otherwise. + */ + OFBool verifyUserPassword(const char *userID, const char *passwd); + + /** verifies and digitally signs the current structured report. + * If the user ID is known (i.e. specified in the configuration file) the current + * structured report is verified (a verifying observer is added). If the 'mode' + * parameter is set accordingly and the password is correct (see verifyUserPassword) + * the report is also digitally signed. + * Please note that a document can be verified/signed more than once, but only completed + * documents can be verified. After signing the report no modifications should be performed + * before the object is stored in the database or a file. Otherwise the digital signature + * would be corrupted. Therefore, the SOP instance UID should be generated before calling + * this method. + * @remark this method only has full functionality if DCMTK is compiled with + * OpenSSL support enabled. If not, only mode DVPSY_verify (verification) + * is available and an error is returned for any other mode. + * @param userID symbolic user ID for given user, as returned by + * DVConfiguration::getUserID() + * @param passwd for user as entered in some GUI control + * @param mode flag specifying whether to verify only, verify and sign or verify and + * sign and finalize the document. The difference between the second and the third mode + * is that "finalize" always signs the entire document whereas the other mode only signs + * the marked items (if any, all items otherwise) and leaves out certain header attributes + * (e.g. the SOP instance UID and the verifying observer sequence). + * @return status, EC_Normal if successful, an error code otherwise. + */ + OFCondition verifyAndSignStructuredReport(const char *userID, const char *passwd, DVPSVerifyAndSignMode mode); + + + /* digital signatures */ + + /** returns a string containing a complete HTML page with the + * signature validation results for the last object of the + * given type. Never returns NULL. + * @param objtype object type + * @return pointer to string with HTML page + */ + const char *getCurrentSignatureValidationHTML(DVPSObjectType objtype) const; + + /** returns a string containing a complete HTML page with the + * signature validation overview. Never returns NULL. + * @return pointer to string with HTML page + */ + const char *getCurrentSignatureValidationOverview() const; + + /** returns the status flag for the current object of given type. + * @param objtype object type + * @return digital signature status for object + */ + DVPSSignatureStatus getCurrentSignatureStatus(DVPSObjectType objtype) const; + + /** returns the combined status flag for the current image and presentation state. + * @return digital signature status for image and presentation state + */ + DVPSSignatureStatus getCombinedImagePStateSignatureStatus() const; + + /** returns number of correct signatures for given object type. + * @param objtype object type + * @return number of digital signatures + */ + unsigned long getNumberOfCorrectSignatures(DVPSObjectType objtype) const; + + /** returns number of untrustworthy signatures for given object type. + * @param objtype object type + * @return number of digital signatures + */ + unsigned long getNumberOfUntrustworthySignatures(DVPSObjectType objtype) const; + + /** returns number of corrupt signatures for given object type. + * @param objtype object type + * @return number of digital signatures + */ + unsigned long getNumberOfCorruptSignatures(DVPSObjectType objtype) const; + + /** disables internal settings for image and presentation state. + * Called when a new SR object is loaded and the current + * image/presentation state are hidden consequently. + */ + void disableImageAndPState(); + +private: + + /** private undefined copy constructor + */ + DVInterface(const DVInterface&); + + /** private undefined assignment operator + */ + DVInterface& operator=(const DVInterface&); + + /** helper function that exchanges the current presentation state and image + * by the pointers passed and frees the old ones. + * @param newState new presentation state, must not be NULL + * @param image image file + * @param state presentation state if newState was not created from image. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition exchangeImageAndPState(DVPresentationState *newState, DcmFileFormat *image, DcmFileFormat *state=NULL); + + /** creates a database handle if none exists yet (this method may + * be called multiple times without interference) and puts a shared lock + * on the database. + * The lock will remain until explicitly released with releaseDatabase(); + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition lockDatabase(); + + /** creates an exlusive lock on the database if none exists. + * The lock will remain until explicitly released with releaseDatabase() + * or unlockExclusive(). + * This method also clears the index cache. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition lockExclusive(); + + /** removes an exlusive lock on the database if any. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition unlockExclusive(); + + /** creates a new pair of filenames for print job creation. + * @param printer printer identifier + * @param tempname temporary name is returned here + * @param jobname print job name is returned here + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition createPrintJobFilenames(const char *printer, OFString& tempname, OFString& jobname); + + /** creates the query/retrieve server configuration file. + * @param filename path to the configuration file (incl. filename) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition createQueryRetrieveServerConfigFile(const char *filename); + + /** starts an external application and passes a filename. + * @param application pathname of the application to be started + * @param filename filename to be passed as single parameter. + * @return EC_Normal if fork or CreateProcess succeeds, an error + * condition otherwise. + */ + OFCondition startExternalApplication(const char *application, const char *filename); + + /* member variables */ + + /** pointer to the current print handler object + */ + DVPSStoredPrint *pPrint; + + /** pointer to the current presentation state object + */ + DVPresentationState *pState; + + /** pointer to the current structured reporting object (should never be NULL) + */ + DSRDocument *pReport; + + /** pointer to the handler object for digital signatures + */ + DVSignatureHandler *pSignatureHandler; + + /** pointer to the stored presentation state object (if any) + */ + DVPresentationState *pStoredPState; + + /** pointer to the current DICOM image attached to the presentation state + */ + DcmFileFormat *pDicomImage; + + /** pointer to the current DICOM dataset containing the loaded presentation state. + * Is NULL when the presentation state has been created "on the fly" from image. + */ + DcmFileFormat *pDicomPState; + + /** pointer to the current hardcopy grayscale image (bitmap information only) + */ + DicomImage *pHardcopyImage; + + /** a unique string generated for each instance of this class. + * Used to identify print jobs generated from this instance. + */ + OFString printJobIdentifier; + + /** a counter used for generating print job names. + */ + unsigned long printJobCounter; + + /** string containing the path name of the config file as passed to the ctor. + */ + OFString configPath; + + /** string containing the path name of the database index file + * after a database lock has been acquired for the first time + */ + OFString databaseIndexFile; + + /** initialized with construction time of the interface object + * minus one day. Used to check modifications of the database index file. + */ + unsigned long referenceTime; + + /** list of display function object + */ + DiDisplayFunction *displayFunction[DVPSD_max]; + + /** handle to access database/index file + */ + DcmQueryRetrieveIndexDatabaseHandle *pHandle; + + /** locking mode (OFFalse => shared, OFTrue => exclusive) + */ + OFBool lockingMode; + + /** hierarchical cache structure to optimize index file access + */ + DVStudyCache idxCache; + + /** record structure of index items (last read entry) + */ + IdxRecord idxRec; + + /** position of last read index record (for optimization purposes) + */ + int idxRecPos; + + /** OFTrue if current image is already stored in database, OFFalse otherwise + */ + OFBool imageInDatabase; + + /* private methods for database */ + + /** creates index cache to optimize reading of index file + */ + OFBool createIndexCache(); + + /** creates cache of referencing pstates for the current image + */ + OFBool createPStateCache(); + + /** clears index cache (includes pstate cache) + */ + void clearIndexCache(); + + /** clears specified index record (and makes pos invalid) + */ + void clearIndexRecord(IdxRecord &record, + int &recpos); + + /** reads specified index record (comparing pos with oldpos to avoid redundant + * loading) + */ + OFBool readIndexRecord(const int pos, + IdxRecord &record, + int *oldpos = NULL); + + /** updates (hierarchical) status cache (propagates status information from instances + * to series and from series to studies) + */ + void updateStatusCache(); + + /** returns pointer to study struct specified by given UIDs or to current study + */ + DVStudyCache::ItemStruct *getStudyStruct(const char *studyUID = NULL, + const char *seriesUID = NULL); + + /** returns pointer to series struct specified by given UIDs or to current series + */ + DVSeriesCache::ItemStruct *getSeriesStruct(const char *studyUID = NULL, + const char *seriesUID = NULL, + const char *instanceUID = NULL); + + /** returns pointer to instance struct specified by given UIDs or to current instance + */ + DVInstanceCache::ItemStruct *getInstanceStruct(const char *studyUID = NULL, + const char *seriesUID = NULL, + const char *instanceUID = NULL); + + /** returns index of specified study within study description record + */ + int findStudyIdx(StudyDescRecord *study, + const char *uid); + + /** conditionally deletes given image file (only if file resides in index.dat directory) + */ + int deleteImageFile(const char *filename); + + /** resets index file modification time to reference time (yesterday) + */ + void resetDatabaseReferenceTime(); + + + /** modifies the review flag for one instance in the database (see method with three UID + * parameters) + */ + OFCondition instanceReviewed(int pos); + + /** minimum width of print bitmap (used for implicit scaling) + */ + unsigned long minimumPrintBitmapWidth; + + /** minimum height of print bitmap (used for implicit scaling) + */ + unsigned long minimumPrintBitmapHeight; + + /** maximum width of print bitmap (used for implicit scaling) + */ + unsigned long maximumPrintBitmapWidth; + + /** maximum height of print bitmap (used for implicit scaling) + */ + unsigned long maximumPrintBitmapHeight; + + /** maximum width of print preview bitmap + */ + unsigned long maximumPrintPreviewWidth; + + /** maximum height of print preview bitmap + */ + unsigned long maximumPrintPreviewHeight; + + /** maximum width of (optional) preview image + */ + unsigned long maximumPreviewImageWidth; + + /** maximum height of (optional) preview image + */ + unsigned long maximumPreviewImageHeight; + + /** target ID of current printer, empty if no printer exists in config file + */ + OFString currentPrinter; + + /** config file identifier of LUT currently selected as Display Presentation LUT + */ + OFString displayCurrentLUTID; + + /** config file identifier of LUT currently selected as Print Presentation LUT + */ + OFString printCurrentLUTID; + + /** printer medium type identifier, may be empty. VR=CS, VM=1 + */ + OFString printerMediumType; + + /** printer film destination identifier, may be empty. VR=CS, VM=1 + */ + OFString printerFilmDestination; + + /** printer film session label, may be empty. VR=LO, VM=1 + */ + OFString printerFilmSessionLabel; + + /** printer number of copies + */ + unsigned long printerNumberOfCopies; + + /** printer print priority, may be empty. VR=CS, VM=1, + * enumerated values: HIGH, MED, LOW + */ + OFString printerPriority; + + /** printer film session owner ID, may be empty. VR=SH, VM=1 + */ + OFString printerOwnerID; + + /** true if annotation should be created when spooling print job + */ + OFBool activateAnnotation; + + /** true if date and time should be prepended to annotation text + */ + OFBool prependDateTime; + + /** true if printer name should be prepended to annotation text + */ + OFBool prependPrinterName; + + /** true if reflected ambient light and illumination should be prepended to annotation text + */ + OFBool prependLighting; + + /** annotation text (if any) + */ + OFString annotationText; +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsab.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsab.h new file mode 100644 index 00000000..9d4b9e9a --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsab.h @@ -0,0 +1,123 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSAnnotationContent + * + */ + +#ifndef DVPSAB_H +#define DVPSAB_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcvrus.h" /* for class DcmUnsignedShort */ +#include "dcmtk/dcmdata/dcvrlo.h" /* for class DcmLongString */ +#include "dcmtk/dcmdata/dcvrui.h" /* for class DcmUniqueIdentifier */ + +/** the representation of a Annotation Content SQ item for Stored Print + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSAnnotationContent +{ +public: + /// default constructor + DVPSAnnotationContent(); + + /// copy constructor + DVPSAnnotationContent(const DVPSAnnotationContent& copy); + + /** clone method. + * @return a pointer to a new DVPSAnnotationContent object containing + * a copy of this object. + */ + DVPSAnnotationContent *clone() { return new DVPSAnnotationContent(*this); } + + /// destructor + virtual ~DVPSAnnotationContent(); + + /** resets the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** reads an annotation content item from a DICOM dataset. + * The DICOM elements of the referenced item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the AnnotationContentSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the annotation box managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the AnnotationContentSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** sets the content of this annotation box object. + * @param instanceuid SOP instance UID of this annotation + * @param text annotation text string + * @param position annotation box position + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setContent( + const char *instanceuid, + const char *text, + Uint16 position); + + /** gets the current SOP Instance UID. + * @return SOP Instance UID, may be NULL. + */ + const char *getSOPInstanceUID(); + + /** sets the SOP instance UID (which is returned by the Print SCP). + * @param value new attribute value, must not be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setSOPInstanceUID(const char *value); + + /** writes the attributes managed by this objects that are part of a + * basic annotation box N-SET request into the DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition prepareBasicAnnotationBox(DcmItem &dset); + +private: + /// private undefined assignment operator + DVPSAnnotationContent& operator=(const DVPSAnnotationContent&); + + /// Module=Annotation_List, VR=UI, VM=1, Type 1(c) + DcmUniqueIdentifier sOPInstanceUID; + /// Module=Annotation_List, VR=US, VM=1, Type 1(c) + DcmUnsignedShort annotationPosition; + /// Module=Annotation_List, VR=LO, VM=1, Type 1(c) + DcmLongString textString; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsabl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsabl.h new file mode 100644 index 00000000..4ed8ffcc --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsabl.h @@ -0,0 +1,156 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSAnnotationContent_PList + * + */ + +#ifndef DVPSABL_H +#define DVPSABL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcitem.h" + +class DVPSAnnotationContent; + +/** the list of Annotations contained in a stored print object. + * This class manages the data structures comprising one complete + * Annotation Content Sequence in a Stored Print object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSAnnotationContent_PList +{ +public: + + /// default constructor + DVPSAnnotationContent_PList(); + + /// copy constructor + DVPSAnnotationContent_PList(const DVPSAnnotationContent_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSAnnotationContent_PList object containing + * a deep copy of this object. + */ + DVPSAnnotationContent_PList *clone() { return new DVPSAnnotationContent_PList(*this); } + + /// destructor + virtual ~DVPSAnnotationContent_PList(); + + /** reads a list of annotations (AnnotationContentSequence) from a DICOM dataset. + * The DICOM elements of the annotations are copied from the dataset to this object. + * The completeness of all items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the sequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of annotations managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the AnnotationContentSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** gets the number of annotations in this list. + * @return the number of annotations. + */ + size_t size() const { return list_.size(); } + + /** creates a new annotation object and sets the content of this annotation object. + * @param instanceuid SOP instance UID of this annotation + * @param text annotation text string + * @param position annotation box position + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addAnnotationBox( + const char *instanceuid, + const char *text, + Uint16 position); + + /** deletes one of the registered annotations. + * @param idx index, must be < size() + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition deleteAnnotation(size_t idx); + + /** deletes multiple of the registered annotations, starting with the first one. + * @param number number of annotations to delete, must be <= size() + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition deleteMultipleAnnotations(size_t number); + + /** sets the SOP instance UID for the given annotation. + * @param idx index, must be < getNumberOfAnnotations() + * @param value new attribute value, must not be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setAnnotationSOPInstanceUID(size_t idx, const char *value); + + /** gets the current SOP Instance UID for the given registered annotation. + * @param idx index, must be < getNumberOfAnnotations() + * @return SOP Instance UID, may be NULL. + */ + const char *getSOPInstanceUID(size_t idx); + + /** writes the attributes managed by the referenced object that are part of a + * basic annotation box N-SET request into the DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param idx index, must be < getNumberOfAnnotations() + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition prepareBasicAnnotationBox(size_t idx, DcmItem &dset); + + /** removes all UIDs from the annotation boxes managed by this object + */ + void clearAnnotationSOPInstanceUIDs(); + +private: + + /** private undefined assignment operator + */ + DVPSAnnotationContent_PList& operator=(const DVPSAnnotationContent_PList&); + + /** returns a pointer to the annotation with the given + * index or NULL if it does not exist. + * @param idx index, must be < size() + * @return pointer to annotation object or NULL + */ + DVPSAnnotationContent *getAnnotationBox(size_t idx); + + /** the list maintained by this object + */ + OFList list_; + +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsal.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsal.h new file mode 100644 index 00000000..be75f773 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsal.h @@ -0,0 +1,114 @@ +/* + * + * Copyright (C) 1998-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlayCurveActivationLayer + * + */ + +#ifndef DVPSAL_H +#define DVPSAL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +/** a curve or overlay activation layer in a presentation state (internal use only). + * This class manages the data structures comprising a single curve + * activation layer or overlay activation layer + * (one instance of the Curve Activation Layer Module or + * Overlay Activation Layer Module repeating elements) + * contained in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSOverlayCurveActivationLayer +{ +public: + /// default constructor + DVPSOverlayCurveActivationLayer(); + + /// copy constructor + DVPSOverlayCurveActivationLayer(const DVPSOverlayCurveActivationLayer& copy); + + /** clone method. + * @return a pointer to a new DVPSOverlayCurveActivationLayer object containing + * a copy of this object. + */ + DVPSOverlayCurveActivationLayer *clone() { return new DVPSOverlayCurveActivationLayer(*this); } + + /// destructor + virtual ~DVPSOverlayCurveActivationLayer(); + + /** reads the activation layer for the specified repeating group from a DICOM dataset. + * The DICOM elements of the Overlay/Curve Activation Layer module are copied + * from the dataset to this object. + * The completeness of the module is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the activation layer is to be read + * @param ovGroup the the repeating group to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset, Uint16 ovGroup); + + /** writes the activation layer managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the activation layer is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** set activation layer name of this activation. + * @param aLayer a pointer to the activation layer name, which is copied into this object. + */ + void setActivationLayer(const char *aLayer); + + /** set repeating group of this activation. + * @param rGroup the repeating group + */ + void setRepeatingGroup(Uint16 rGroup); + + /** get activation layer name. + * @return a pointer to the activation layer name (might be NULL) + */ + const char *getActivationLayer(); + + /** get repeating group. + * @return the repeating group of this activation. + */ + Uint16 getRepeatingGroup(); + + /** compare repeating group. + * @param rGroup the repeating group to compare + * @return OFTrue if the activation matches the passed repeating group, OFFalse otherwise. + */ + OFBool isRepeatingGroup(Uint16 rGroup); + +private: + + /// private undefined assignment operator + DVPSOverlayCurveActivationLayer& operator=(const DVPSOverlayCurveActivationLayer&); + + /// the repeating group managed by this object + Uint16 repeatingGroup; + /// VR=CS, VM=1, Type 2c + DcmCodeString activationLayer; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsall.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsall.h new file mode 100644 index 00000000..c6f3afde --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsall.h @@ -0,0 +1,175 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlayCurveActivationLayer + * + */ + +#ifndef DVPSALL_H +#define DVPSALL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSGraphicLayer_PList; +class DVPSOverlay_PList; +class DVPSOverlayCurveActivationLayer; + +/** the list of curve and overlay activation layers contained in a presentation state (internal use only). + * This class manages the data structures comprising the list of curve + * activation layers and overlay activation layers + * (all instances of the Curve Activation Layer Module and + * Overlay Activation Layer Module repeating elements) + * contained in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSOverlayCurveActivationLayer_PList +{ +public: + /// default constructor + DVPSOverlayCurveActivationLayer_PList(); + + /// copy constructor + DVPSOverlayCurveActivationLayer_PList(const DVPSOverlayCurveActivationLayer_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSOverlayCurveActivationLayer_PList object containing + * a deep copy of this object. + */ + DVPSOverlayCurveActivationLayer_PList *clone() { return new DVPSOverlayCurveActivationLayer_PList(*this); } + + /// destructor + virtual ~DVPSOverlayCurveActivationLayer_PList(); + + /** reads the curve and overlay activations from a DICOM dataset. + * The DICOM elements of the activations are copied from the dataset to this object. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the activations are to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the curve and overlay activations managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the activations are written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** create graphic layers and activations for DICOM image. + * This method is used when a default presentation state + * for a DICOM image is created. Depending on the given flags, + * graphic layer and curve/overlay activations for the curves + * and overlays present in the DICOM dataset are created. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset containing the image IOD + * @param gLayerList the list of graphic layers to be created + * @param overlayList the list of overlays internal to the presentation state + * @param overlayActivation flag defining how overlays should be handled + * @param curveActivation flag defining how curves should be handled + * @param layering flag defining how graphic layers should be created + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition createFromImage(DcmItem &dset, + DVPSGraphicLayer_PList &gLayerList, + DVPSOverlay_PList &overlayList, + DVPSoverlayActivation overlayActivation, + OFBool curveActivation, + DVPSGraphicLayering layering); + + /** set activation layer for given repeating group. + * The activation is created if necessary and the layer name + * is assigned. This method check if a valid repeating group + * number is passed and returns an error code otherwise. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setActivation(Uint16 group, const char *layer); + + /** remove activation for given repeating group. + */ + void removeActivation(Uint16 group); + + /** get activation layer name of the given repeating group. + * @return a pointer to the activation layer name if found, NULL otherwise. + */ + const char *getActivationLayer(Uint16 group); + + /** renames the activation layer name in all activations + * with a matching old activation layer name. + * Required to keep the presentation consistent when a + * graphic layer is renamed. + * @param oldName the old activation layer name + * @param newName the new activation layer name + */ + void renameLayer(const char *oldName, const char *newName); + + /** deletes all activation belonging to the given activation + * layer name. + * @param name name of the deleted activation layer + */ + void removeLayer(const char *name); + + /** checks if the given layer name is used for any of the + * activation layers managed by this object. + * @param name name of the layer + * @return OFTrue if name is used + */ + OFBool usesLayerName(const char *name); + + /** returns the number of activations for the given + * graphic layer and object type (curve or overlay). + * This method does not check whether an image object is attached to the + * presentation state and if all activations really have a matching + * curve structure in the attached image. + * @param layer name of the graphic layer + * @param isCurve if OFTrue, curves are counted, otherwise overlays are counted. + * @return number of curves or overlays on the given layer. + */ + size_t getNumberOfActivations(const char *layer, OFBool isCurve); + + /** gets the repeating group of the overlay/curve activation with the given index + * on the given layer. If the activation or the graphic layer does + * not exist, 0 is returned. + * @param layer name of the graphic layer + * @param idx index of the object, must be < getNumberOfActivations(layer, isCurve) + * @param isCurve if OFTrue, curves are searched, otherwise overlays are searched. + * @return the repeating group number of the activation + */ + Uint16 getActivationGroup(const char *layer, size_t idx, OFBool isCurve); + +private: + + /// private undefined assignment operator + DVPSOverlayCurveActivationLayer_PList& operator=(const DVPSOverlayCurveActivationLayer_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpscf.h b/dcmpstat/include/dcmtk/dcmpstat/dvpscf.h new file mode 100644 index 00000000..028fe0d7 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpscf.h @@ -0,0 +1,1085 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg, Joerg Riesmeier + * + * Purpose: + * classes: DVConfiguration + * + */ + + +#ifndef DVPSCF_H +#define DVPSCF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/oflog/oflog.h" /* for OFLogger::LogLevel */ +#include "dcmtk/dcmdata/dctypes.h" /* for Uint32 */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for DVPS enums */ +#include "dcmtk/dcmpstat/dpdefine.h" + +class OFConfigFile; + +/** Configuration class for the Softcopy Presentation State viewer. + * This class manages the configuration file content used by the + * presentation state viewer. + */ +class DCMTK_DCMPSTAT_EXPORT DVConfiguration +{ + public: + + /** constructor. + * @param config_file filename (path) of the config file to be used. + * The caller should make sure that the config file + * really exists because the constructor cannot return an error status. + * If a non-existing filename (or NULL) is passed, an empty configuration file + * is assumed. + */ + DVConfiguration(const char *config_file=NULL); + + /** destructor. + */ + virtual ~DVConfiguration(); + + /* access to communication partner data */ + + /** returns the number of communication partners (send targets) + * in the configuration file. + * @param peerType defines a filter for the peer service type. Default: handle only storage peers. + * @return number of communication partners + */ + Uint32 getNumberOfTargets(DVPSPeerType peerType=DVPSE_storage); + + /** returns the target identifier of the communication partner + * with the given index. The target identifier is unique within the configuration file + * @param idx index, must be < getNumberOfTargets() + * @param peerType defines a filter for the peer service type. Default: handle only storage peers. + * @return target identifier if found, NULL otherwise. + */ + const char *getTargetID(Uint32 idx, DVPSPeerType peerType=DVPSE_storage); + + /** returns the DESCRIPTION entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetDescription(const char *targetID); + + /** returns the HOSTNAME entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetHostname(const char *targetID); + + /** returns the PORT entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present and parsable in the config file, 0 otherwise. + */ + unsigned short getTargetPort(const char *targetID); + + /** returns the TYPE entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present and parsable in the config file, DVPSE_storage otherwise. + */ + DVPSPeerType getTargetType(const char *targetID); + + /** returns the AETITLE entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetAETitle(const char *targetID); + + /** returns the MAXPDU entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present and parsable in the config file, 0 otherwise. + */ + unsigned long getTargetMaxPDU(const char *targetID); + + /** returns the TIMEOUT entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present and parsable in the config file, -1 otherwise. + */ + Sint32 getTargetTimeout(const char *targetID); + + /** returns the IMPLICITONLY entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetImplicitOnly(const char *targetID); + + /** returns the DISABLENEWVRS entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetDisableNewVRs(const char *targetID); + + /** returns the BITPRESERVINGMODE entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetBitPreservingMode(const char *targetID); + + /** returns the CORRECTUIDPADDING entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetCorrectUIDPadding(const char *targetID); + + /** returns the USETLS entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetUseTLS(const char *targetID); + + /** returns the CERTIFICATE entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetCertificate(const char *targetID); + + /** returns the PRIVATEKEY entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetPrivateKey(const char *targetID); + + /** returns the PRIVATEKEYPASSWORD entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetPrivateKeyPassword(const char *targetID); + + /** returns the TLSPROFILE entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetTLSProfile(const char *targetID); + + /** returns the PEERAUTHENTICATION entry for the communication partner with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present and parsable in the config file, DVPSQ_require otherwise. + */ + DVPSCertificateVerificationType getTargetPeerAuthentication(const char *targetID); + + /** returns the DIFFIEHELLMANPARAMETERS entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetDiffieHellmanParameters(const char *targetID); + + /** returns the RANDOMSEED entry for the storage peer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getTargetRandomSeed(const char *targetID); + + /** returns the SUPPORTSPRESENTATIONLUT entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetPrinterSupportsPresentationLUT(const char *targetID); + + /** returns the PRESENTATIONLUTMATCHREQUIRED entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFTrue otherwise. + */ + OFBool getTargetPrinterPresentationLUTMatchRequired(const char *targetID); + + /** returns the PRESENTATIONLUTPREFERSCPRENDERING entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetPrinterPresentationLUTPreferSCPRendering(const char *targetID); + + /** returns the PRESENTATIONLUTINFILMSESSION entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetPrinterPresentationLUTinFilmSession(const char *targetID); + + /** returns the SUPPORTS12BIT entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFTrue otherwise + * (default is 12 bit supported). + */ + OFBool getTargetPrinterSupports12BitTransmission(const char *targetID); + + /** returns the SUPPORTSIMAGESIZE entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetPrinterSupportsRequestedImageSize(const char *targetID); + + /** returns the SUPPORTSDECIMATECROP entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetPrinterSupportsDecimateCrop(const char *targetID); + + /** returns the SUPPORTSTRIM entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetPrinterSupportsTrim(const char *targetID); + + /** returns the number of distinct values (separated by backslash characters) + * in the BORDERDENSITY entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfBorderDensities(const char *targetID); + + /** returns one value from the BORDERDENSITY entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfBorderDensities(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterBorderDensity(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the MAXDENSITY entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfMaxDensities(const char *targetID); + + /** returns one value from the MAXDENSITY entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfMaxDensities(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterMaxDensity(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the MINDENSITY entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfMinDensities(const char *targetID); + + /** returns one value from the MINDENSITY entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfMinDensities(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterMinDensity(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the DISPLAYFORMAT entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfPortraitDisplayFormats(const char *targetID); + + /** returns one row value from the DISPLAYFORMAT entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfPortraitDisplayFormats(targetID) + * @return number of rows for this display format if present, 0 otherwise + */ + Uint32 getTargetPrinterPortraitDisplayFormatRows(const char *targetID, Uint32 idx); + + /** returns one columns value from the DISPLAYFORMAT entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfPortraitDisplayFormats(targetID) + * @return number of columns for this display format if present, 0 otherwise + */ + Uint32 getTargetPrinterPortraitDisplayFormatColumns(const char *targetID, Uint32 idx); + + /** returns OFTrue if an ANNOTATION entry for the printer with the given + * target ID from the configuration file exists or if the + * SESSIONLABELANNOTATION flag is true for the printer. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return OFTrue if printer supports annotation, OFFalse otherwise. + */ + OFBool getTargetPrinterSupportsAnnotation(const char *targetID); + + /** returns OFTrue if an ANNOTATION entry for the printer with the given + * target ID from the configuration file exists. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return OFTrue if printer supports annotation, OFFalse otherwise. + */ + OFBool getTargetPrinterSupportsAnnotationBoxSOPClass(const char *targetID); + + /** returns OFTrue if an SESSIONLABELANNOTATION entry for the printer + * with the given target ID from the configuration file exists and is true. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return OFTrue if printer supports annotations in film session label, OFFalse otherwise. + */ + OFBool getTargetPrinterSessionLabelAnnotation(const char *targetID); + + /** returns the second value from the ANNOTATION entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterAnnotationDisplayFormatID(const char *targetID, OFString& value); + + /** returns the first value from the ANNOTATION entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return value if present, 0 otherwise. + */ + Uint16 getTargetPrinterAnnotationPosition(const char *targetID); + + /** returns the number of distinct values (separated by backslash characters) + * in the FILMSIZEID entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfFilmSizeIDs(const char *targetID); + + /** returns one value from the FILMSIZEID entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfFilmSizeIDs(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterFilmSizeID(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the MEDIUMTYPE entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfMediumTypes(const char *targetID); + + /** returns one value from the MEDIUMTYPE entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfMediumTypes(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterMediumType(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the FILMDESTINATION entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfFilmDestinations(const char *targetID); + + /** returns one value from the FILMDESTINATION entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfFilmDestinations(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterFilmDestination(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the RESOLUTIONID entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfPrinterResolutionIDs(const char *targetID); + + /** returns one value from the RESOLUTIONID entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfPrinterResolutionIDs(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterResolutionID(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the MAGNIFICATIONTYPE entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfMagnificationTypes(const char *targetID); + + /** returns one value from the MAGNIFICATIONTYPE entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfMagnificationTypes(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterMagnificationType(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values (separated by backslash characters) + * in the SMOOTHINGTYPE entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfSmoothingTypes(const char *targetID); + + /** returns one value from the SMOOTHINGTYPE entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfSmoothingTypes(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterSmoothingType(const char *targetID, Uint32 idx, OFString& value); + + /** returns the number of distinct values in the CONFIGURATION_x entries + * for the printer with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfConfigurationSettings(const char *targetID); + + /** returns the value from one of the CONFIGURATION_x entries for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfConfigurationSettings(targetID) + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterConfigurationSetting(const char *targetID, Uint32 idx); + + /** returns the number of distinct values (separated by backslash characters) + * in the EMPTYIMAGEDENSITY entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return number of values if entry present in the config file, 0 otherwise. + */ + Uint32 getTargetPrinterNumberOfEmptyImageDensities(const char *targetID); + + /** returns one value from the EMPTYIMAGEDENSITY entry for the printer + * with the given target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @param idx index of the value, must be < getTargetPrinterNumberOfEmptyImageDensities(targetID) + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getTargetPrinterEmptyImageDensity(const char *targetID, Uint32 idx, OFString& value); + + /** returns the OMITSOPCLASSUIDFROMCREATERESPONSE entry for the printer with the given + * target ID from the configuration file. + * @param targetID communication target ID, must be one of the target + * identifiers returned by getTargetID() for peer type DVPSE_printerAny. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getTargetPrintSCPOmitSOPClassUIDFromCreateResponse(const char *targetID); + + /* general settings */ + + /** returns the directory used to store log files. + * Value is taken from the section GENERAL/APPLICATION/LOGDIRECTORY + * in the config file. + * @return log directory path, NULL if absent. + */ + const char *getLogFolder(); + + /** returns the name of the log file to be used for general application messages. + * Value is taken from the section GENERAL/APPLICATION/LOGFILE + * in the config file. + * @return name of the log file, NULL if absent. + */ + const char *getLogFile(); + + /** returns the log level / filter to be used for general application messages. + * Value is taken from the section GENERAL/APPLICATION/LOGLEVEL + * in the config file. + * @return log level, default: OFLogger::FATAL_LOG_LEVEL + */ + OFLogger::LogLevel getLogLevel(); + + /** returns the port on which the GUI application accepts notification + * messages from the network processes. + * Value is taken from the section GENERAL/APPLICATION/MESSAGEPORT + * in the config file. + * @return message port, default: 0 (no message exchange). + */ + unsigned short getMessagePort(); + + /** Indicates whether client processes are allowed to keep their notification + * message port open during the lifetime of the process. + * Value is taken from the section GENERAL/APPLICATION/KEEPMESSAGEPORTOPEN + * in the config file. + * @return message port open flag, default: false + */ + OFBool getMessagePortKeepOpen(); + + /** returns the AETitle with which this application should identify itself. + * The AETitle is taken from the section GENERAL/NETWORK in the + * config file. If absent, a default value is returned. + * @return AETitle for this application. Never returns NULL. + */ + const char *getNetworkAETitle(); + + /** returns the AUTOCREATECONFIGFILE entry for the query/retrieve server + * from the section GENERAL/QUERY_RETRIEVE in the config file. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getQueryRetrieveAutoCreateConfigFile(); + + /** returns the AETitle with which the Q/R server should identify itself. + * The AETitle is taken from the section GENERAL/QUERY_RETRIEVE in the + * config file. If absent, a default value is returned. + * @return AETitle for the Q/R server. Never returns NULL. + */ + const char *getQueryRetrieveAETitle(); + + /** returns the PORT entry for the Q/R server + * from the section GENERAL/QUERY_RETRIEVE in the config file. + * @return entry if present and parsable in the config file, 0 otherwise. + */ + unsigned short getQueryRetrievePort(); + + /** returns the MAXPDU entry for the Q/R server + * from the section GENERAL/QUERY_RETRIEVE in the config file. + * @return entry if present and parsable in the config file, 0 otherwise. + */ + unsigned long getQueryRetrieveMaxPDU(); + + /** returns the TIMEOUT entry for the the Q/R server + * from the section GENERAL/QUERY_RETRIEVE in the config file. + * @return entry if present and parsable in the config file, -1 otherwise. + */ + Sint32 getQueryRetrieveTimeout(); + + /** returns the MaxAssociations entry for the Q/R server + * from the section GENERAL/QUERY_RETRIEVE in the config file. + * @return entry if present and parsable in the config file, 0 otherwise. + */ + unsigned long getQueryRetrieveMaxAssociations(); + + /** returns the database folder to be used for sending/receiving/browsing. + * Value is taken from the section GENERAL/DATABASE/DIRECTORY + * in the config file. If absent, a default value is returned. + * @return database folder path. Never returns NULL. + */ + const char *getDatabaseFolder(); + + /** returns the spool folder to be used for print jobs. + * Value is taken from the section GENERAL/PRINT/DIRECTORY + * in the config file. If absent, a default value is returned. + * @return spool folder path. Never returns NULL. + */ + const char *getSpoolFolder(); + + /** returns the DETAILEDLOG entry + * from the section GENERAL/PRINT in the config file. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getDetailedLog(); + + /** returns the BINARYLOG entry + * from the section GENERAL/PRINT in the config file. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getBinaryLog(); + + /** returns the filename (path) of the DICOM Store SCU application used + * for sending images, as configured in section + * GENERAL/NETWORK/SENDER in the config file. + * @return send application path name or NULL if absent. + */ + const char *getSenderName(); + + /** returns the filename (path) of the DICOM Store SCP application used + * for receiving images, as configured in section + * GENERAL/NETWORK/RECEIVER in the config file. + * @return receive application path name or NULL if absent. + */ + const char *getReceiverName(); + + /** returns the filename (path) of the DICOM Query/Retrieve SCP application, + * as configured in section GENERAL/QUERY_RETRIEVE/SERVER in the config file. + * @return send application path name or NULL if absent. + */ + const char *getQueryRetrieveServerName(); + + /** returns the filename (path) of the DICOM Print SCU application used + * for printing images, as configured in section + * GENERAL/PRINT/SPOOLER in the config file. + * @return receive application path name or NULL if absent. + */ + const char *getSpoolerName(); + + /** returns the filename (path) of the DICOM Print SCU application used + * for printing images, as configured in section + * GENERAL/PRINT/Server in the config file. + * @return receive application path name or NULL if absent. + */ + const char *getPrintServerName(); + + /** returns the filename (path) of the application used + * for dumping DICOM objects, as configured in section + * GENERAL/DATABASE/DUMP in the config file. + * @return dump application path name or NULL if absent. + */ + const char *getDumpToolName(); + + /** returns the filename (path) of the application used + * for dumping DICOM objects, as configured in section + * GENERAL/DATABASE/CHECK in the config file. + * @return check application path name or NULL if absent. + */ + const char *getCheckToolName(); + + /** returns the sleep delay for the print spooler in seconds, + * as configured in section GENERAL/PRINT/SLEEP in the config file. + * @return sleep delay, 0 if absent. + */ + unsigned long getSpoolerSleep(); + + /** returns the DELETEPRINTJOBS entry for the print spooler + * from the section GENERAL/PRINT in the config file. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getSpoolerDeletePrintJobs(); + + /** returns the ALWAYSDELETETERMINATEJOBS entry for the print spooler + * from the section GENERAL/PRINT in the config file. + * @return entry if present in the config file, OFFalse otherwise. + */ + OFBool getSpoolerAlwaysDeleteTerminateJobs(); + + /** returns the filename (path) of the monitor characteristics file + * used to implement that Barten transform, as configured in section + * GENERAL/MONITOR/CHARACTERISTICS in the config file. + * @return monitor characteristics path name or NULL if absent. + */ + const char *getMonitorCharacteristicsFile(); + + /** returns the width (in mm) of one pixel on the current monitor + * @return pixel width, 0 if unknown + */ + double getMonitorPixelWidth(); + + /** returns the height (in mm) of one pixel on the current monitor + * @return pixel height, 0 if unknown + */ + double getMonitorPixelHeight(); + + /** returns the maximum horizontal preview image resolution, from + * GENERAL/MONITOR/PREVIEW in the config file. Default: 0. + * @return maximum horizontal preview resolution + */ + Uint32 getMaxPreviewResolutionX(); + + /** returns the maximum vertical preview image resolution, from + * GENERAL/MONITOR/PREVIEW in the config file. Default: 0. + * @return maximum vertical preview resolution + */ + Uint32 getMaxPreviewResolutionY(); + + /** returns the value of configuration file entry key=value + * in the section GENERAL/GUI of the config file. + * Specified key must be upper case. + * If the entry is absent, NULL is returned. + * @param key the entry key + * @return entry value or NULL. + */ + const char *getGUIConfigEntry(const char *key); + + /** returns the value of configuration file entry key=value + * in the section GENERAL/GUI of the config file. + * Specified key must be upper case. + * If the entry is absent or cannot be parsed, the default dfl + * is returned. + * @param key the entry key + * @param dfl the default to be used if the value is absent or incorrect + * @return entry value or default. + */ + OFBool getGUIConfigEntryBool(const char *key, OFBool dfl); + + /** returns the folder to be used for Print Presentation LUTs. + * Value is taken from the section GENERAL/LUT/DIRECTORY + * in the config file. If absent, a default value is returned. + * @return LUT folder path. Never returns NULL. + */ + const char *getLUTFolder(); + + /** returns the folder to be used for Structured Reporting "templates". + * Value is taken from the section GENERAL/REPORT/DIRECTORY + * in the config file. If absent, a default value is returned. + * @return report folder path. Never returns NULL. + */ + const char *getReportFolder(); + + /* Presentation Look Up Tables (LUTs) */ + + /** returns the number of Presentation LUTs in the configuration file. + * @return number of LUTs + */ + Uint32 getNumberOfLUTs(); + + /** returns the identifier of the Presentation LUT + * with the given index. The identifier is unique within the configuration file + * @param idx index, must be < getNumberOfLUTs() + * @return identifier if found, NULL otherwise. + */ + const char *getLUTID(Uint32 idx); + + /** returns the DESCRIPTION entry for the LUT with the given + * ID from the configuration file. + * @param lutID LUT ID, must be one of the identifiers returned by getLUTID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getLUTDescription(const char *lutID); + + /** returns the FILENAME entry for the LUT with the given + * ID from the configuration file. + * @param lutID LUT ID, must be one of the identifiers returned by getLUTID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getLUTFilename(const char *lutID); + + /* Structured Reporting (SR) "templates" */ + + /** returns the number of SR "templates" in the configuration file. + * @return number of SR "templates" + */ + Uint32 getNumberOfReports(); + + /** returns the identifier of the SR "template" + * with the given index. The identifier is unique within the configuration file + * @param idx index, must be < getNumberOfReports() + * @return identifier if found, NULL otherwise. + */ + const char *getReportID(Uint32 idx); + + /** returns the DESCRIPTION entry for the SR "template" with the given + * ID from the configuration file. + * @param reportID SR "template" ID, must be one of the identifiers returned by + * getReportID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getReportDescription(const char *reportID); + + /** returns the FILENAME entry for the SR "template" with the given + * ID from the configuration file. + * @param reportID SR "template" ID, must be one of the identifiers returned by + * getReportID(). + * @return entry if present in the config file, NULL otherwise. + */ + const char *getReportFilename(const char *reportID); + + /* general print settings */ + + /** returns the minimum horizontal bitmap resolution for print, from + * GENERAL/PRINT/MINPRINTRESOLUTION in the config file. Default: 0. + * @return minimum horizontal bitmap resolution + */ + Uint32 getMinPrintResolutionX(); + + /** returns the minimum vertical bitmap resolution for print, from + * GENERAL/PRINT/MINPRINTRESOLUTION in the config file. Default: 0. + * @return minimum vertical bitmap resolution + */ + Uint32 getMinPrintResolutionY(); + + /** returns the maximum horizontal bitmap resolution for print, from + * GENERAL/PRINT/MAXPRINTRESOLUTION in the config file. Default: 0. + * @return maximum horizontal bitmap resolution + */ + Uint32 getMaxPrintResolutionX(); + + /** returns the maximum vertical bitmap resolution for print, from + * GENERAL/PRINT/MAXPRINTRESOLUTION in the config file. Default: 0. + * @return maximum vertical bitmap resolution + */ + Uint32 getMaxPrintResolutionY(); + + /** returns the default illumination for print, from + * GENERAL/PRINT/DEFAULTILLUMINATION in the config file. Default: 2000. + * @return default illumination for print + */ + Uint16 getDefaultPrintIllumination(); + + /** returns the default reflection for print, from + * GENERAL/PRINT/DEFAULTREFLECTION in the config file. Default: 10. + * @return default reflection for print + */ + Uint16 getDefaultPrintReflection(); + + /* VOI settings */ + + /** returns the number of VOI Presets defined for the given modality + * @param modality Modality, e.g. "CT", "MR", "DX" etc. + * @return number of VOI Presets + */ + Uint32 getNumberOfVOIPresets(const char *modality); + + /** returns the description string for the given VOI Preset + * @param modality Modality, e.g. "CT", "MR", "DX" etc. + * @param idx index of the value, must be < getNumberOfVOIPresets(modality) + * @return description if present, NULL otherwise. + */ + const char *getVOIPresetDescription(const char *modality, Uint32 idx); + + /** returns the window center for the given VOI Preset + * @param modality Modality, e.g. "CT", "MR", "DX" etc. + * @param idx index of the value, must be < getNumberOfVOIPresets(modality) + * @return window center if present, 0.0 otherwise. + */ + double getVOIPresetWindowCenter(const char *modality, Uint32 idx); + + /** returns the window width for the given VOI Preset + * @param modality Modality, e.g. "CT", "MR", "DX" etc. + * @param idx index of the value, must be < getNumberOfVOIPresets(modality) + * @return window width if present, 1.0 otherwise. + */ + double getVOIPresetWindowWidth(const char *modality, Uint32 idx); + + /* TLS settings */ + + /** returns the directory in which TLS related files (certificates, keys, + * random data, Diffie-Hellman parameters etc.) are located. + * @return TLS directory path, NULL if absent. + */ + const char *getTLSFolder(); + + /** returns the directory in which certificates of the trusted + * Certification Authorities are located. + * @return TLS CA Certificate directory path, NULL if absent. + */ + const char *getTLSCACertificateFolder(); + + /** returns the file format used for certificates, keys and Diffie-Hellman + * parameters. OFTrue for PEM ("privacy enhanced mail") format, OFFalse for + * DER ("distinguished encoding rules") format. + * @return OFTrue for PEM (default), OFFalse for DER. + */ + OFBool getTLSPEMFormat(); + + /* User login settings */ + + /** returns the directory in which user certificates and keys + * are located. + * @return User key/certificate directory path, NULL if absent. + */ + const char *getUserCertificateFolder(); + + /** returns the number of configured users in the USERS section. + * @return number of configured users + */ + Uint32 getNumberOfUsers(); + + /** returns the symbolic identifier of the user with the given index. + * The symbolic identifier is unique within the configuration file. + * @param idx index, must be < getNumberOfUsers() + * @return identifier if found, NULL otherwise. + */ + const char *getUserID(Uint32 idx); + + /** returns the login for the given user. If absent in the config file, + * returns NULL. + * @param userID user ID as returned by getUserID() + * @return login for the given user + */ + const char *getUserLogin(const char *userID); + + /** returns the human readable name for the given user. + * If absent in the config file, returns NULL. + * @param userID user ID as returned by getUserID() + * @return name for the given user + */ + const char *getUserName(const char *userID); + + /** returns the name for the given user in DICOM Person Name (PN) format. + * If absent in the config file, returns NULL. + * @param userID user ID as returned by getUserID() + * @return DICOM PN name for the given user + */ + const char *getUserDICOMName(const char *userID); + + /** returns the organization for the given user. + * If absent in the config file, returns NULL. + * @param userID user ID as returned by getUserID() + * @return organization for the given user + */ + const char *getUserOrganization(const char *userID); + + /** returns the coding scheme designator of the user code for the given user if present. + * @param userID user ID as returned by getUserID() + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getUserCodingSchemeDesignator(const char *userID, OFString& value); + + /** returns the coding scheme version of the user code for the given user if present. + * @param userID user ID as returned by getUserID() + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getUserCodingSchemeVersion(const char *userID, OFString& value); + + /** returns the code value of the user code for the given user if present. + * @param userID user ID as returned by getUserID() + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getUserCodeValue(const char *userID, OFString& value); + + /** returns the code meaning of the user code for the given user if present. + * @param userID user ID as returned by getUserID() + * @param value the result is both stored in this object and returned as return value. + * @return value if present, NULL otherwise. + */ + const char *getUserCodeMeaning(const char *userID, OFString& value); + + /** returns the certificate file name for the given user. + * If absent in the config file, returns NULL. + * @param userID user ID as returned by getUserID() + * @return certificate file for the given user + */ + const char *getUserCertificate(const char *userID); + + /** returns the private key file name for the given user. + * If absent in the config file, returns NULL. + * @param userID user ID as returned by getUserID() + * @return key file for the given user + */ + const char *getUserPrivateKey(const char *userID); + +private: + + /** private undefined copy constructor + */ + DVConfiguration(const DVConfiguration&); + + /** private undefined assignment operator + */ + DVConfiguration& operator=(const DVConfiguration&); + + /** returns the entry with the given keys. + * @param l2_key level 2 key + * @param l1_key level 1 key + * @param l0_key level 0 key (entry name) + * @return value assigned to the key if present, NULL otherwise. + */ + const char *getConfigEntry(const char *l2_key, const char *l1_key, const char *l0_key); + + /** returns the entry with the given keys as bool. + * @param l2_key level 2 key + * @param l1_key level 1 key + * @param l0_key level 0 key (entry name) + * @param deflt default to be returned if entry is not present or syntax error. + * @return value assigned to the key if present, default otherwise. + */ + OFBool getConfigBoolEntry(const char *l2_key, const char *l1_key, const char *l0_key, OFBool deflt); + + /* member variables */ + + /** pointer to the configuration file data if the configuration file was found. + * NULL otherwise. + */ + OFConfigFile *pConfig; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpscu.h b/dcmpstat/include/dcmtk/dcmpstat/dvpscu.h new file mode 100644 index 00000000..61afa512 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpscu.h @@ -0,0 +1,138 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSCurve + * + */ + +#ifndef DVPSCU_H +#define DVPSCU_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dctypes.h" +#include "dcmtk/dcmdata/dcerror.h" + +class DcmItem; + +/** the representation of one Curve in a DICOM image. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSCurve +{ +public: + /// default constructor + DVPSCurve(); + + /// copy constructor + DVPSCurve(const DVPSCurve& copy); + + /** clone method. + * @return a pointer to a new DVPSCurve object containing + * a copy of this object. + */ + DVPSCurve *clone() { return new DVPSCurve(*this); } + + /// destructor + virtual ~DVPSCurve(); + + /** reads a curve from a DICOM dataset. + * The DICOM elements of the Graphic Object item are copied + * from the dataset to this object. + * The completeness of the curve (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the data is to be read + * @param group lower byte of the curve repeating group to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset, Uint8 group); + + /** get group number of curve repeating group managed by this object. + * @return the lower byte of the curve group + */ + Uint8 getCurveGroup() { return curveGroup; } + + /** gets the number of points in the curve. + * @return number of points + */ + size_t getNumberOfPoints() { return numberOfPoints; } + + /** gets the type of data in the curve (ROI or POLY). + * @return type of data in curve + */ + DVPSCurveType getTypeOfData() { return typeOfData; } + + /** gets one point from the curve data. + * @param idx index of the curve point, must be < getNumberOfPoints(); + * @param x upon success the x value of the point is returned in this parameter + * @param y upon success the y value of the point is returned in this parameter + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getPoint(size_t idx, double& x, double& y); + + /** gets the curve description string if present. + * If the description string is absent, this method returns NULL or an empty string. + * @return curve description + */ + const char *getCurveDescription() { return curveDescription.c_str(); } + + /** gets the curve label string if present. + * If the label string is absent, this method returns NULL or an empty string. + * @return curve label + */ + const char *getCurveLabel() { return curveLabel.c_str(); } + + /** gets the curve axis units string for the X dimension if present. + * If the string is absent, this method returns NULL or an empty string. + * @return curve description + */ + const char *getCurveAxisUnitsX() { return axisUnitsX.c_str(); } + + /** gets the curve axis units string for the Y dimension if present. + * If the string is absent, this method returns NULL or an empty string. + * @return curve description + */ + const char *getCurveAxisUnitsY() { return axisUnitsY.c_str(); } + +private: + /// private undefined assignment operator + DVPSCurve& operator=(const DVPSCurve&); + + /// lower byte of the curve repeating group managed by this object + Uint8 curveGroup; + /// number of points in curve data + size_t numberOfPoints; + /// type of curve data + DVPSCurveType typeOfData; + /// curve data, converted to double + double *curveData; + /// curve data description if present + OFString curveDescription; + /// curve label if present + OFString curveLabel; + /// axis units X if present + OFString axisUnitsX; + /// axis units Y if present + OFString axisUnitsY; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpscul.h b/dcmpstat/include/dcmtk/dcmpstat/dvpscul.h new file mode 100644 index 00000000..df7a4fb4 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpscul.h @@ -0,0 +1,113 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSCurve_PList + * + */ + +#ifndef DVPSCUL_H +#define DVPSCUL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSCurve; + +/** the list of curves contained in image which is attached to a presentation state. + * This class manages the data structures comprising the list of curves + * (all instances of the Curve Module repeating elements) + * contained in an image object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSCurve_PList +{ +public: + /// default constructor + DVPSCurve_PList(); + + /// copy constructor + DVPSCurve_PList(const DVPSCurve_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSCurve_PList object containing + * a deep copy of this object. + */ + DVPSCurve_PList *clone() { return new DVPSCurve_PList(*this); } + + /// destructor + virtual ~DVPSCurve_PList(); + + /** reads all curve groups which can be displayed in a presentation state + * from a DICOM dataset. + * This method checks which curves are contained in the DICOM dataset. + * All curves complying with the presentation state requirements + * (i.e. 2-dimensional POLY or ROI curves without curve descriptor) are copied + * into the "list of curves" structure managed by this object. + * The completeness of the curves (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the curves are read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** check presence of curve group + * @param group curve repeating group to be checked + * @return OFTrue if the specified curve group is present in the + * list of curves managed by this object. + */ + OFBool haveCurveGroup(Uint16 group); + + /** get curve by group + * @param group curve repeating group to be checked + * @return a pointer to the matching DVPSCurve object if found, + * NULL otherwise. + */ + DVPSCurve *getCurveGroup(Uint16 group); + + /** get curve by index + * @param idx index, must be < size() + * @return a pointer to the matching DVPSCurve object if it exists, + * NULL otherwise. + */ + DVPSCurve *getCurve(size_t idx); + + /** get number of curves in this list. + * @return the number of curves. + */ + size_t size() const { return list_.size(); } + +private: + + /// private undefined assignment operator + DVPSCurve_PList& operator=(const DVPSCurve_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsda.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsda.h new file mode 100644 index 00000000..de907ce2 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsda.h @@ -0,0 +1,268 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSDisplayedArea + * + */ + +#ifndef DVPSDA_H +#define DVPSDA_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmpstat/dvpsril.h" /* for DVPSReferencedImage_PList */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ + +class DVPSReferencedSeries_PList; + +/** an item of the displayed area selection sequence in a presentation state. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSDisplayedArea +{ +public: + /// default constructor + DVPSDisplayedArea(); + + /// copy constructor + DVPSDisplayedArea(const DVPSDisplayedArea& copy); + + /** clone method. + * @return a pointer to a new DVPSDisplayedArea object containing + * a copy of this object. + */ + DVPSDisplayedArea *clone() { return new DVPSDisplayedArea(*this); } + + /// destructor + virtual ~DVPSDisplayedArea(); + + /** reads an displayed area selection from a DICOM dataset. + * The DICOM elements of the displayed area selection item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the DisplayedAreaSelectionSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the displayed area selection managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the DisplayedAreaSelectionSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** checks if this displayed area is applicable to the given image and frame. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return OFTrue if applicable. + */ + OFBool isApplicable(const char *instanceUID, unsigned long frame); + + /** checks if this displayed area matches exactly the applicability + * defined by the instanceUID, frame and applicability parameters. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return OFTrue if matching. + */ + OFBool matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability); + + /** gets the presentation size mode for this displayed area selection. + * @return presentation size mode + */ + DVPSPresentationSizeMode getPresentationSizeMode(); + + /** gets the presentation pixel aspect ratio for this displayed area selection. + * Pixel aspect ratio is defined here as the width of a pixel divided + * by the height of a pixel (x/y). + * @return pixel aspect ratio + */ + double getPresentationPixelAspectRatio(); + + /** gets the displayed area top lefthand corner and + * bottom righthand corner. + * @param tlhcX the displayed area top lefthand corner X value is returned in this parameter + * @param tlhcY the displayed area top lefthand corner Y value is returned in this parameter + * @param brhcX the displayed area bottom righthand corner X value is returned in this parameter + * @param brhcY the displayed area bottom righthand corner Y value is returned in this parameter + */ + void getDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY); + + /** gets the presentation pixel spacing for this displayed area if present. + * @param x the horizontal pixel spacing (mm) is returned in this parameter upon success + * @param y the vertical pixel spacing (mm) is returned in this parameter upon success + * @return EC_Normal if successful, an error code if no presentation pixel spacing is available. + */ + OFCondition getPresentationPixelSpacing(double& x, double& y); + + /** gets the presentation pixel magnification ratio for this displayed area if present. + * @param magnification the magnification ratio is returned in this parameter upon success + * @return EC_Normal if successful, an error code if no magnification ratio is available. + */ + OFCondition getPresentationPixelMagnificationRatio(double& magnification); + + /** add a new image reference. + * Checks if the referenced SOP instance UID already exists in this sequence. + * If it exists, an error code is returned. Otherwise a new image reference + * is created and added to the ReferencedImageSequence. + * @param sopclassUID the SOP class UID of the image reference to be added. + * @param instanceUID the SOP instance UID of the image reference to be added. + * @param frame the frame number of the image reference (current image) to be added. + * @param applicability the applicability of the image reference (DVPSB_currentFrame or DVPSB_currentImage) + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability); + + /** removes a reference to an image or frame. If the current reference is empty ("global"), an + * explicit list of references is constructed from the list of series/instance references. + * The image or frame reference is removed from the total list of references in this object. + * If the only reference contained in this object is removed, the reference list becomes empty + * which means that the current reference becomes "global". This case must be handled by the caller. + * @param allReferences list of series/instance references registered for the presentation state. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param numberOfFrames the number of frames of the current image + * @param applicability the applicability of the image reference to be removed + * (DVPSB_currentFrame or DVPSB_currentImage) + */ + void removeImageReference( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability); + + /** removes all image references for this displayed area. + */ + void clearImageReferences() { referencedImageList.clear(); } + + /** checks if the list of image references for this displayed area is empty. + * @return OFTrue if list of image references is empty, OFFalse otherwise. + */ + OFBool imageReferencesEmpty() { if (referencedImageList.size()==0) return OFTrue; else return OFFalse; } + + /** checks if the TRUE SIZE mode is possible, i.e. + * if pixel spacing is known. + * @return OFTrue if TRUE SIZE mode is available, OFFalse otherwise. + */ + OFBool canUseTrueSize(); + + /** sets the displayed area pixel spacing and + * removes any pixel aspect ratio setting. + * @param spacingX horizontal pixel spacing in mm + * @param spacingY vertical pixel spacing in mm + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDisplayedAreaPixelSpacing(double spacingX, double spacingY); + + /** sets the displayed area pixel spacing and + * removes any pixel aspect ratio setting. + * @param spacing vertical/horizontal spacing in DICOM DS format. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDisplayedAreaPixelSpacing(const char *spacing); + + /** sets the displayed area pixel spacing and + * removes any pixel spacing setting. + * Pixel aspect ratio is defined here as the width of a pixel divided + * by the height of a pixel (x/y). + * @param ratio pixel aspect ratio + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDisplayedAreaPixelAspectRatio(double ratio); + + /** sets the displayed area pixel spacing and + * removes any pixel spacing setting. + * @param ratio pixel aspect ratio in DICOM IS format. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDisplayedAreaPixelAspectRatio(const char *ratio); + + /** sets the displayed area and size mode. + * @param sizeMode presentation size mode. + * @param tlhcX displayed area top lefthand corner X + * @param tlhcY displayed area top lefthand corner Y + * @param brhcX displayed area bottom righthand corner X + * @param brhcY displayed area bottom righthand corner Y + * @param magnification magnification factor - ignored unless + * sizeMode==DVPSD_magnify. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDisplayedArea( + DVPSPresentationSizeMode sizeMode, + Sint32 tlhcX, Sint32 tlhcY, + Sint32 brhcX, Sint32 brhcY, + double magnification=1.0); + + /** adjusts the displayed area coordinates for the rotation and flipping + * status of the image. + * @param rotationFrom previous rotation + * @param isFlippedFrom previous flip status + * @param rotationTo new rotation + * @param isFlippedTo new flip status + */ + void rotateAndFlip( + DVPSRotationType rotationFrom, + OFBool isFlippedFrom, + DVPSRotationType rotationTo, + OFBool isFlippedTo); + +private: + /** undefined private assignment operator + */ + DVPSDisplayedArea& operator=(const DVPSDisplayedArea& source); + + /// swaps the horizontal (X) components of TLHC and BRHC + void switchHorizontalCorners(); + + /// swaps the vertical (Y) components of TLHC and BRHC + void switchVerticalCorners(); + + /** adjusts the displayed area coordinates for rotation and flipping. + * This method can either be used to adjust from unrotated/unflipped + * to a rotated/flipped status or back from this status to original. + * @param rotation rotation + * @param isFlipped flip status + */ + void rotateAndFlipFromOrTo(DVPSRotationType rotation, OFBool isFlipped); + + /// ReferencedImageSequence, Type 1c + DVPSReferencedImage_PList referencedImageList; + /// VR=SL, VM=2, Type 1 + DcmSignedLong displayedAreaTopLeftHandCorner; + /// VR=SL, VM=2, Type 1 + DcmSignedLong displayedAreaBottomRightHandCorner; + /// VR=CS, VM=1, Type 1 + DcmCodeString presentationSizeMode; + /// VR=DS, VM=2, Type 1c (required if presentationSizeMode is "TRUE SIZE") + DcmDecimalString presentationPixelSpacing; + /// VR=IS, VM=2, Type 1c (required if presentationPixelSpacing is absent) + DcmIntegerString presentationPixelAspectRatio; + /// VR=FL, VM=1, Type 1c (required if presentationSizeMode is "MAGNIFY") + DcmFloatingPointSingle presentationPixelMagnificationRatio; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsdal.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsdal.h new file mode 100644 index 00000000..3152c8a8 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsdal.h @@ -0,0 +1,142 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSDisplayedArea_PList + * + */ + +#ifndef DVPSDAL_H +#define DVPSDAL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmdata/dcitem.h" + +class DVPSDisplayedArea; +class DVPSReferencedSeries_PList; + +/** the list of displayed area selections contained in a presentation state (internal use only). + * This class manages the data structures comprising one complete displayed area selection sequence + * contained in a presentation state object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSDisplayedArea_PList +{ +public: + /// default constructor + DVPSDisplayedArea_PList(); + + /// copy constructor + DVPSDisplayedArea_PList(const DVPSDisplayedArea_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSDisplayedArea_PList object containing + * a deep copy of this object. + */ + DVPSDisplayedArea_PList *clone() { return new DVPSDisplayedArea_PList(*this); } + + /// destructor + virtual ~DVPSDisplayedArea_PList(); + + /** reads a list of displayed area selections (DisplayedAreaSelectionSequence) from a DICOM dataset. + * The DICOM elements of the displayed area selection item are copied from the dataset to this object. + * The completeness of all items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the sequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of displayed area selections managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the DisplayedAreaSelectionSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** gets the number of displayed area selections in this list. + * @return the number of displayed area selections. + */ + size_t size() const { return list_.size(); } + + /** checks if an displayed area selection exists for the given image and frame. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return pointer to the displayed area if it exists, NULL otherwise. + */ + DVPSDisplayedArea *findDisplayedArea(const char *instanceUID, unsigned long frame); + + /** finds or creates a displayed area selection SQ item + * with an applicability controlled by the applicability, instanceUID and frame + * parameters. The displayed area selection sequence is rearranged such that + * all other referenced images/frames keep their old displayed area settings. + * @param allReferences list of series/instance references registered for the + * presentation state. + * @param sopclassUID SOP class UID of the current image + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param numberOfFrames number of frames of the current image + * @param applicability applicability of the new displayed area selection + * @return pointer to a displayed area selection object from the list + * that matches the applicability parameters. NULL is returned if + * out of memory. + */ + DVPSDisplayedArea *createDisplayedArea( + DVPSReferencedSeries_PList& allReferences, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability); + + /** adjusts all displayed area coordinates for the rotation and flipping + * status of the image. + * @param rotationFrom previous rotation + * @param isFlippedFrom previous flip status + * @param rotationTo new rotation + * @param isFlippedTo new flip status + */ + void rotateAndFlip( + DVPSRotationType rotationFrom, + OFBool isFlippedFrom, + DVPSRotationType rotationTo, + OFBool isFlippedTo); + +private: + + /** private undefined assignment operator + */ + DVPSDisplayedArea_PList& operator=(const DVPSDisplayedArea_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsdef.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsdef.h new file mode 100644 index 00000000..799777d6 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsdef.h @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * definitions of constants and macros for pstat module + * + */ + +#ifndef DVPSDEF_H +#define DVPSDEF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/oflog/oflog.h" + +extern DCMTK_DCMPSTAT_EXPORT OFLogger DCM_dcmpstatLogger; +extern DCMTK_DCMPSTAT_EXPORT OFLogger DCM_dcmpstatDumpLogger; +extern DCMTK_DCMPSTAT_EXPORT OFLogger DCM_dcmpstatLogfileLogger; + +#define DCMPSTAT_TRACE(msg) OFLOG_TRACE(DCM_dcmpstatLogger, msg) +#define DCMPSTAT_DEBUG(msg) OFLOG_DEBUG(DCM_dcmpstatLogger, msg) +#define DCMPSTAT_INFO(msg) OFLOG_INFO(DCM_dcmpstatLogger, msg) +#define DCMPSTAT_WARN(msg) OFLOG_WARN(DCM_dcmpstatLogger, msg) +#define DCMPSTAT_ERROR(msg) OFLOG_ERROR(DCM_dcmpstatLogger, msg) +#define DCMPSTAT_FATAL(msg) OFLOG_FATAL(DCM_dcmpstatLogger, msg) + +#define DCMPSTAT_DUMP(msg) OFLOG_DEBUG(DCM_dcmpstatDumpLogger, msg) +#define DCMPSTAT_LOGFILE(msg) OFLOG_DEBUG(DCM_dcmpstatLogfileLogger, msg) + +/* default for max PDU size */ +#define DEFAULT_MAXPDU 16384 + +#define DEFAULT_filmDestination "DEFAULT" +#define DEFAULT_filmOrientation "PORTRAIT" +#define DEFAULT_filmSizeID "DEFAULT" +#define DEFAULT_illumination 2000 +#define DEFAULT_imageDisplayFormat "STANDARD\\1,1" +#define DEFAULT_imageNumber "1" +#define DEFAULT_magnificationType "DEFAULT" +#define DEFAULT_maxDensity 320 +#define DEFAULT_mediumType "DEFAULT" +#define DEFAULT_minDensity 20 +#define DEFAULT_numberOfCopies "1" +#define DEFAULT_ownerID "DEFAULT" +#define DEFAULT_patientName "^^^^" +#define DEFAULT_presentationLabel "UNNAMED" +#define DEFAULT_printerStatus "NORMAL" +#define DEFAULT_printerStatusInfo "NORMAL" +#define DEFAULT_priority "MED" +#define DEFAULT_reflectedAmbientLight 10 +#define DEFAULT_seriesNumber "1" +#define DEFAULT_shutterPresentationValue 0 +#define DEFAULT_specificCharacterSet "ISO_IR 100" +#define DEFAULT_trim "NO" + +/* SOP instance UID used by the Print SCP when creating a default IDENTITY Presentation LUT */ +#define WELLKNOWN_IDENTITY_PLUT_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.1" + +/* SOP class UID used by the Print SCP when storing a DIMSE log as a DICOM file */ +#define PSTAT_DIMSE_LOG_STORAGE_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.2" + +/* size_t value indicating that no index is active or available */ +#define DVPS_IDX_NONE ((size_t)-1) + +/* max study count for DB handle creation */ +#define PSTAT_MAXSTUDYCOUNT 200 + +/* study size for DB handle creation */ +#define PSTAT_STUDYSIZE DB_UpperMaxBytesPerStudy + +/* filename suffixes for print jobs */ +#define PRINTJOB_SUFFIX ".job" +#define PRINTJOB_DONE_SUFFIX ".old" +#define PRINTJOB_TEMP_SUFFIX ".tmp" + +/* default AETitle for the Presentation State viewer */ +#define PSTAT_AETITLE "DCMPSTAT" + +/* default path for database folder */ +#define PSTAT_DBFOLDER "." + +/* default path for LUT folder */ +#define PSTAT_LUTFOLDER "." + +/* default path for report folder */ +#define PSTAT_REPORTFOLDER "." + +/* default path for spool folder */ +#define PSTAT_SPOOLFOLDER "." + +/* config file facility constant for high resolution graphics */ +#define L2_HIGHRESOLUTIONGRAPHICS "HIGHRESOLUTIONGRAPHICS" + +#define PSTAT_DCM_LogReservation DcmTag(0x0009, 0x0010, EVR_LO) +#define PSTAT_DCM_AcseSequence DcmTag(0x0009, 0x1100, EVR_SQ) +#define PSTAT_DCM_LogSequence DcmTag(0x0009, 0x1200, EVR_SQ) +#define PSTAT_DCM_LogEntryType DcmTag(0x0009, 0x1001, EVR_CS) +#define PSTAT_DCM_LogDate DcmTag(0x0009, 0x1002, EVR_DA) +#define PSTAT_DCM_LogTime DcmTag(0x0009, 0x1003, EVR_TM) +#define PSTAT_DCM_AssociateData DcmTag(0x0009, 0x1004, EVR_OB) + +/* --------------- a few macros which avoid copy/paste code --------------- */ + +// inserts a copy of a dicom data element into a dataset +#define ADD_TO_DATASET(a_type, a_name) \ +if (result==EC_Normal) \ +{ \ + delem = new a_type(a_name); \ + if (delem) dset.insert(delem, OFTrue); else result=EC_MemoryExhausted; \ +} + +// inserts a copy of a dicom data element into an item +#define ADD_TO_DATASET2(a_type, a_name) \ +if (result==EC_Normal) \ +{ \ + delem = new a_type(a_name); \ + if (delem) ditem->insert(delem, OFTrue); else result=EC_MemoryExhausted; \ +} + +// inserts a copy of a dicom data element into an item +#define ADD_TO_PDATASET(a_type, a_name) \ +if (writeresult==EC_Normal) \ +{ \ + delem = new a_type(a_name); \ + if (delem) rspDataset->insert(delem, OFTrue); else writeresult=EC_MemoryExhausted; \ +} + +// inserts a copy of a repeating element into a dataset, assigns group number +#define ADD_REPEATING_ELEMENT_TO_DATASET(a_type, a_name, a_group) \ +if (result==EC_Normal) \ +{ \ + delem = new a_type(a_name); \ + if (delem) \ + { \ + delem->setGTag(a_group); \ + dset.insert(delem, OFTrue); \ + } else result=EC_MemoryExhausted; \ +} + +// reads a dicom element from a dataset if present +#define READ_FROM_DATASET(a_type, an_ident, a_name) \ +stack.clear(); \ +if ((EC_Normal == dset.search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \ +{ \ + a_name = *((a_type *)(stack.top())); \ +} + +// reads a dicom element from an item if present +#define READ_FROM_DATASET2(a_type, an_ident, a_name) \ +stack.clear(); \ +if ((EC_Normal == item->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \ +{ \ + a_name = *((a_type *)(stack.top())); \ +} + +// reads a dicom element from an item if present +#define READ_FROM_PDATASET(a_type, an_ident, a_name) \ +stack.clear(); \ +if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \ +{ \ + a_name = *((a_type *)(stack.top())); \ +} + +// assigns a newly generated UID to a dicom element if it is empty +#define SET_UID(a_name) \ +if (result==EC_Normal) \ +{ \ + if (a_name.getLength()==0) result = a_name.putString(dcmGenerateUniqueIdentifier(uid)); \ +} + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsfs.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsfs.h new file mode 100644 index 00000000..0f3237fd --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsfs.h @@ -0,0 +1,179 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSFilmSession + * + */ + +#ifndef DVPSFS_H +#define DVPSFS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmnet/dimse.h" + +class DVConfiguration; +class DVPSPresentationLUT_PList; +class DVPSStoredPrint_PList; +class DVPSStoredPrint; + +/** a basic film session object managed by a Print SCP. + */ +class DCMTK_DCMPSTAT_EXPORT DVPSFilmSession +{ +public: + + /** constructor + * @param illumin default Illumination setting + * @param reflection default Reflected Ambient Light setting + */ + DVPSFilmSession(Uint16 illumin, Uint16 reflection); + + /// copy constructor + DVPSFilmSession(const DVPSFilmSession& copy); + + /** clone method. + * @return a pointer to a new DVPSFilmSession object containing + * a copy of this object. + */ + DVPSFilmSession *clone() { return new DVPSFilmSession(*this); } + + /// destructor + virtual ~DVPSFilmSession(); + + /** performs a Print SCP Basic Film Session N-CREATE operation on a newly + * created instance of this class. The results of the operation are + * stored in the objects passed as rsp and rspDataset. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rqDataset N-CREATE request dataset, may be NULL + * @param rsp N-CREATE response message + * @param rspDataset N-CREATE response dataset passed back in this parameter + * @param peerae application entity title of the print SCU we're + * communicating with. Used to create default values for ownerID + * and filmSessionLabel. + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation and is supported on + * Basic Film Session level + * @param globalPresentationLUTList + * list of presentation LUTs managed by the Print SCP + * @return OFTrue if N-CREATE was successful, OFFalse otherwise. + */ + OFBool printSCPCreate( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + const char *peerae, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList); + + /** performs a Print SCP Basic Film Session N-SET operation on an instance + * of this class. The results of the N-SET operation are stored in the + * objects passed as rsp and rspDataset. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rqDataset N-SET request dataset + * @param rsp N-SET response message + * @param rspDataset N-SET response dataset passed back in this parameter + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation and is supported on + * Basic Film Session level + * @param globalPresentationLUTList + * list of presentation LUTs managed by the Print SCP + * @param basicFilmBoxList list of basic film boxes. Presentation LUT + * settings are copied to all film boxes. + * @return OFTrue if N-SET was successful, OFFalse otherwise. + */ + OFBool printSCPSet( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList, + DVPSStoredPrint_PList& basicFilmBoxList); + + /** compares the SOP instance UID with the given UID string. + * @return OFTrue if UIDs are equal, OFFalse otherwise. + */ + OFBool isInstance(const char *uid); + + /** returns the SOP instance UID of the basic film session. + * @return SOP instance UID + */ + const char *getUID() { return sopInstanceUID.c_str(); } + + /** copies the film box Presentation LUT settings into the + * stored print object passed by reference. + * @param sp stored print object + */ + void copyPresentationLUTSettings(DVPSStoredPrint& sp); + +private: + + /// private undefined assignment operator + DVPSFilmSession& operator=(const DVPSFilmSession&); + + /** writes a Referenced Presentation LUT SQ, Illumination and + * reflected ambient light to the given dataset. + * Helper function used when creating Basic Film Session or + * Basic Film Box. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addPresentationLUTReference(DcmItem& dset); + + /// SOP instance UID of basic film session object + OFString sopInstanceUID; + /// VR=IS, VM=1 + DcmIntegerString numberOfCopies; + /// VR=CS, VM=1 + DcmCodeString printPriority; + /// VR=CS, VM=1 + DcmCodeString mediumType; + /// VR=CS, VM=1 + DcmCodeString filmDestination; + /// VR=LO, VM=1 + DcmLongString filmSessionLabel; + /// VR=SH, VM=1 + DcmShortString ownerID; + + /// VR=US, VM=1, Type 2c required if presentation SOP class present + DcmUnsignedShort illumination; + /// VR=US, VM=1, Type 2c required if presentation SOP class present + DcmUnsignedShort reflectedAmbientLight; + /// the ReferencedPresentationLUTSequence is only created/read on the fly + DcmUniqueIdentifier referencedPresentationLUTInstanceUID; + + /** The Print SCP can be configured to enforce a rule requiring that the + * number of entries in a Presentation LUT matches the bit depth of the + * image pixel data. This member variable describes the type of the + * current presentation LUT (if any). + */ + DVPSPrintPresentationLUTAlignment referencedPresentationLUTAlignment; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsga.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsga.h new file mode 100644 index 00000000..88ab21d8 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsga.h @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicAnnotation + * + */ + +#ifndef DVPSGA_H +#define DVPSGA_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcvrcs.h" /* for DcmCodeString */ +#include "dcmtk/dcmpstat/dvpstxl.h" /* for DVPSTextObject_PList */ +#include "dcmtk/dcmpstat/dvpsgrl.h" /* for DVPSGraphicObject_PList */ +#include "dcmtk/dcmpstat/dvpsril.h" /* for DVPSReferencedImage_PList */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ + +/** an item of the graphic annotation sequence in a presentation state (internal use only). + * This class manages the data structures comprising one item + * of the Graphic Annotation Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSGraphicAnnotation +{ +public: + /// default constructor + DVPSGraphicAnnotation(); + + /// copy constructor + DVPSGraphicAnnotation(const DVPSGraphicAnnotation& copy); + + /** clone method. + * @return a pointer to a new DVPSGraphicAnnotation object containing + * a deep copy of this object. + */ + DVPSGraphicAnnotation *clone() { return new DVPSGraphicAnnotation(*this); } + + /// destructor + virtual ~DVPSGraphicAnnotation(); + + /** reads a graphic annotation from a DICOM dataset. + * The DICOM elements of the Graphic Annotation item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the GraphicAnnotationSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the graphic annotation managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the GraphicAnnotationSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** get annotation layer name. + * @return a pointer to the annotation layer name + */ + const char *getAnnotationLayer(); + + /** set annotation layer name of this annotation. + * @param aLayer a pointer to the annotation layer name, which is copied into this object. + */ + void setAnnotationLayer(const char *aLayer); + + /** add a new image reference. + * Checks if the referenced SOP instance UID already exists in this sequence. + * If it exists, an error code is returned. Otherwise a new image reference + * is created and added to the ReferencedImageSequence. + * @param sopclassUID the SOP class UID of the image reference to be added. + * @param instanceUID the SOP instance UID of the image reference to be added. + * @param frame the frame number of the image reference (current image) to be added. + * @param applicability the applicability of the image reference (DVPSB_currentFrame or DVPSX_currentImage) + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability); + + /** checks if this annotation layer is empty. + * An annotation layer is empty when it contains no text object and no graphic object. + * @return OFTrue if empty. + */ + OFBool isEmpty(); + + /** checks if this annotation layer is applicable to the given image and frame. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param applicability the required (minimum) applicability of the reference. Default: + * annotation layer applies to the current frame of the current image. + * @return OFTrue if applicable. + */ + OFBool isApplicable( + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability=DVPSB_currentFrame); + + /** returns the number of text objects in this annotation. + * @return number of text objects + */ + size_t getNumberOfTextObjects(); + + /** returns the number of graphic objects in this annotation. + * @return number of graphic objects + */ + size_t getNumberOfGraphicObjects(); + + /** returns a pointer to the text object with the given + * index or NULL if it does not exist. + * @param idx index, must be < getNumberOfTextObjects() + * @return pointer to text object or NULL + */ + DVPSTextObject *getTextObject(size_t idx); + + /** returns a pointer to the graphic object with the given + * index or NULL if it does not exist. + * @param idx index, must be < getNumberOfGraphicObjects() + * @return pointer to graphic object or NULL + */ + DVPSGraphicObject *getGraphicObject(size_t idx); + + /** adds the given text object to + * the list of text objects managed by this object. + * @param text text object to be inserted. + */ + void addTextObject(DVPSTextObject *text); + + /** adds the given graphic object to + * the list of graphic objects managed by this object. + * @param text graphic object to be inserted. + */ + void addGraphicObject(DVPSGraphicObject *graphic); + + /** returns a pointer to the text object with the given + * index (or NULL if it does not exist) and removes it from the list. + * @param idx index, must be < getNumberOfTextObjects() + * @return pointer to text object or NULL + */ + DVPSTextObject *removeTextObject(size_t idx); + + /** returns a pointer to the graphic object with the given + * index (or NULL if it does not exist) and removes it from the list. + * @param idx index, must be < getNumberOfGraphicObjects() + * @return pointer to graphic object or NULL + */ + DVPSGraphicObject *removeGraphicObject(size_t idx); + +private: + + /// private undefined assignment operator + DVPSGraphicAnnotation& operator=(const DVPSGraphicAnnotation&); + + /// ReferencedImageSequence, Type 1c + DVPSReferencedImage_PList referencedImageList; + /// VR=CS, VM=1, Type 1 + DcmCodeString graphicAnnotationLayer; + /// TextObjectSequence, Type 1c + DVPSTextObject_PList textObjectList; + /// GraphicObjectSequence, Type 1c + DVPSGraphicObject_PList graphicObjectList; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsgal.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsgal.h new file mode 100644 index 00000000..913ad07e --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsgal.h @@ -0,0 +1,266 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicAnnotation_PList + * + */ + +#ifndef DVPSGAL_H +#define DVPSGAL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSGraphicAnnotation; +class DVPSTextObject; +class DVPSGraphicObject; + +/** the list of graphic annotations contained in a presentation state (internal use only). + * This class manages the data structures comprising the complete + * Graphic Annotation Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSGraphicAnnotation_PList +{ +public: + /// default constructor + DVPSGraphicAnnotation_PList(); + + /// copy constructor + DVPSGraphicAnnotation_PList(const DVPSGraphicAnnotation_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSGraphicAnnotation_PList object containing + * a deep copy of this object. + */ + DVPSGraphicAnnotation_PList *clone() { return new DVPSGraphicAnnotation_PList(*this); } + + /// destructor + virtual ~DVPSGraphicAnnotation_PList(); + + /** reads a list of graphic annotations from a DICOM dataset. + * The DICOM elements of the Graphic Annotation Sequence are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the GraphicAnnotationSequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of graphic annotations managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the GraphicAnnotationSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** renames the graphic annotation layer name in all activations + * with a matching old graphic annotation layer name. + * Required to keep the presentation consistent when a + * graphic layer is renamed. + * @param oldName the old graphic annotation layer name + * @param newName the new graphic annotation layer name + */ + void renameLayer(const char *oldName, const char *newName); + + /** deletes all graphic annotation layers belonging to the given + * graphic annotation layer name. + * @param name name of the graphic annotation layers to be deleted + */ + void removeLayer(const char *name); + + /** deletes all graphic annotation sequence items containing + * no text and no graphic object. Called before writing a presentation state. + */ + void cleanupLayers(); + + /** checks if the given layer name is used for any of the + * graphic annotation layers managed by this object. + * @param name name of the layer + * @return OFTrue if name is used + */ + OFBool usesLayerName(const char *name); + + /** returns the number of text objects for the given graphic layer + * that apply to the given image and frame. + * @param layer name of the graphic layer + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return number of text objects + */ + size_t getNumberOfTextObjects(const char *layer, const char *instanceUID, unsigned long frame); + + /** gets the text object (applicable to the current image and frame) + * with the given index on the given layer. + * If the text object or the graphic layer does not exist, NULL is returned. + * @param layer name of the graphic layer + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param idx index of the text object, must be < getNumberOfTextObjects(layer) + * @return a pointer to the text object + */ + DVPSTextObject *getTextObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx); + + /** creates a new text object on the given layer. + * Returns a pointer to the new text object. + * If no graphic layer with appropriate applicability exists, it is created. + * If the creation of the layer or text object fails, NULL is returned. + * @param layer name of the graphic layer + * @param sopclassUID SOP class UID of the current image + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param applicability applicability of the new text object + * @param text the text object to be inserted. If NULL, a new text object + * is created. If a pointer to an object is passed in this parameter, + * it gets owned by this graphic annotation object and will be deleted + * upon destruction of the annotation or if this method fails (returns NULL). + * @return a pointer to the new text object + */ + DVPSTextObject *addTextObject( + const char *layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability, + DVPSTextObject *text=NULL); + + /** deletes the text object (applicable to the current image and frame) with the given index + * on the given layer. + * @param layer name of the graphic layer + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param idx index of the text object, must be < getNumberOfTextObjects(layer) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeTextObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx); + + /** moves the text object (applicable to the current image and frame) with the given index + * on the given layer to a different layer. + * @param old_layer name of the graphic layer on which the text object is + * @param sopclassUID SOP class UID of the current image + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param idx index of the text object, must be < getNumberOfTextObjects(layer) + * @param applicability new applicability of the text object + * @param new_layer name of the graphic layer to which the text object is moved + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition moveTextObject( + const char *old_layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + size_t idx, + DVPSObjectApplicability applicability, + const char *new_layer); + + /** returns the number of graphic objects for the given + * graphic layer. + * @param layer name of the graphic layer + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return number of graphic objects + */ + size_t getNumberOfGraphicObjects(const char *layer, const char *instanceUID, unsigned long frame); + + /** gets the graphic object with the given index + * on the given layer. If the graphic object or the graphic layer does + * not exist, NULL is returned. + * @param layer name of the graphic layer + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param idx index of the graphic object, must be < getNumberOfGraphicObjects(layer) + * @return a pointer to the graphic object + */ + DVPSGraphicObject *getGraphicObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx); + + /** creates a new graphic object on the given layer. + * Returns a pointer to the new graphic object. If the graphic layer + * does not exist or if the creation of the graphic object fails, NULL is returned. + * @param layer name of the graphic layer + * @param sopclassUID SOP class UID of the current image + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param applicability applicability of the new text object + * @param graphic the graphic object to be inserted. If NULL, a new graphic object + * is created. If a pointer to an object is passed in this parameter, + * it gets owned by this graphic annotation object and will be deleted + * upon destruction of the annotation or if this method fails (returns NULL). + * @return a pointer to the new graphic object + */ + DVPSGraphicObject *addGraphicObject( + const char *layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability, + DVPSGraphicObject *graphic=NULL); + + /** deletes the graphic object with the given index + * on the given layer. + * @param layer name of the graphic layer + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param idx index of the graphic object, must be < getNumberOfGraphicObjects(layer) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeGraphicObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx); + + /** moves the graphic object with the given index on the given + * layer to a different layer. + * @param old_layer name of the graphic layer on which the graphic object is + * @param sopclassUID SOP class UID of the current image + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param idx index of the graphic object, must be < getNumberOfGraphicObjects(layer) + * @param applicability new applicability of the graphic object + * @param new_layer name of the graphic layer to which the graphic object is moved + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition moveGraphicObject( + const char *old_layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + size_t idx, + DVPSObjectApplicability applicability, + const char *new_layer); + +private: + + /// private undefined assignment operator + DVPSGraphicAnnotation_PList& operator=(const DVPSGraphicAnnotation_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsgl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsgl.h new file mode 100644 index 00000000..b1830734 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsgl.h @@ -0,0 +1,167 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicLayer + * + */ + +#ifndef DVPSGL_H +#define DVPSGL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmpstat/dpdefine.h" + + +/** an item of the graphic layer sequence in a presentation state (internal use only). + * This class manages the data structures comprising one item + * of the Graphic Layer Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSGraphicLayer +{ +public: + /// default constructor + DVPSGraphicLayer(); + + /// copy constructor + DVPSGraphicLayer(const DVPSGraphicLayer& copy); + + /** clone method. + * @return a pointer to a new DVPSGraphicLayer object containing + * a copy of this object. + */ + DVPSGraphicLayer *clone() { return new DVPSGraphicLayer(*this); } + + /// destructor + virtual ~DVPSGraphicLayer(); + + /** reads a graphic layer from a DICOM dataset. + * The DICOM elements of the Graphic Layer item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the GraphicLayerSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the graphic layer managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the GraphicLayerSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** get graphic layer name of this layer. + * @return a pointer to the graphic layer name + */ + const char *getGL(); + + /** get graphic layer description of this layer. + * @return a pointer to the graphic layer description + */ + const char *getGLDescription(); + + /** gets the graphic layer order of this layer. + * @return the graphic layer order + */ + Sint32 getGLOrder(); + + /** checks whether a recommended display value (grayscale, color or both) exists. + * @return OFTrue if a recommended display value exists + */ + OFBool haveGLRecommendedDisplayValue(); + + /** gets the recommended grayscale display value. + * If the graphic layer contains an RGB display value but no grayscale + * display value, the RGB value is implicitly converted to grayscale. + * @param gray the recommended display value as an unsigned 16-bit P-value + * is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getGLRecommendedDisplayValueGray(Uint16& gray); + + /** gets the recommended RGB display value. + * If the graphic layer contains a grayscale display value but no RGB + * display value, the grayscale value is implicitly converted to RGB. + * @param r returns the R component of the recommended display value as unsigned 16-bit P-value + * @param g returns the G component of the recommended display value as unsigned 16-bit P-value + * @param b returns the B component of the recommended display value as unsigned 16-bit P-value + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getGLRecommendedDisplayValueRGB(Uint16& r, Uint16& g, Uint16& b); + + /** removes recommended display values. + * @param rgb if true, the RGB recommended display value is removed + * @param monochrome if true the monochrome recommended display value is removed + */ + void removeRecommendedDisplayValue(OFBool rgb, OFBool monochrome); + + /** set graphic layer name of this layer. + * @param gl a pointer to the graphic layer name, which is copied into this object. + */ + void setGL(const char *gl); + + /** set graphic layer order of this layer. + * @param glOrder the graphic layer order. + */ + void setGLOrder(Sint32 glOrder); + + /** set graphic layer recommended grayscale display value of this layer. + * This method does not affect (set or modify) the recommended RGB display value + * which should be set separately. + * @param gray the recommended display value in P-values 0..0xffff. + */ + void setGLRecommendedDisplayValueGray(Uint16 gray); + + /** set graphic layer recommended RGB display value of this layer. + * This method does not affect (set or modify) the recommended grayscale display value + * which should be set separately. + * @param r the red component of the recommended display value in P-values 0..0xffff. + * @param g the green component of the recommended display value in P-values 0..0xffff. + * @param b the blue component of the recommended display value in P-values 0..0xffff. + */ + void setGLRecommendedDisplayValueRGB(Uint16 r, Uint16 g, Uint16 b); + + /** set graphic layer description of this layer. + * @param glDescription a pointer to the graphic layer description, which is copied into this object. + */ + void setGLDescription(const char *glDescription); + +private: + + /// private undefined assignment operator + DVPSGraphicLayer& operator=(const DVPSGraphicLayer&); + + /// VR=CS, VM=1, Type 1 + DcmCodeString graphicLayer; + /// VR=IS, VM=1, Type 1 + DcmIntegerString graphicLayerOrder; + /// VR=US, VM=1, Type 3 + DcmUnsignedShort graphicLayerRecommendedDisplayGrayscaleValue; + /// VR=US, VM=3, Type 3 + DcmUnsignedShort graphicLayerRecommendedDisplayRGBValue; + /// VR=LO, VM=1, Type 3 + DcmLongString graphicLayerDescription; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsgll.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsgll.h new file mode 100644 index 00000000..d634427d --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsgll.h @@ -0,0 +1,276 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicLayer_PList + * + */ + +#ifndef DVPSGLL_H +#define DVPSGLL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSGraphicLayer; +class DVPSOverlayCurveActivationLayer_PList; +class DVPSGraphicAnnotation_PList; + +/** the list of graphic layers contained in a presentation state (internal use only). + * This class manages the data structures comprising the complete + * Graphic Layer Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSGraphicLayer_PList +{ +public: + /// default constructor + DVPSGraphicLayer_PList(); + + /// copy constructor + DVPSGraphicLayer_PList(const DVPSGraphicLayer_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSGraphicLayer_PList object containing + * a deep copy of this object. + */ + DVPSGraphicLayer_PList *clone() { return new DVPSGraphicLayer_PList(*this); } + + /// destructor + virtual ~DVPSGraphicLayer_PList(); + + /** reads the Graphic Layer Sequence from a DICOM dataset. + * The completeness of the sequence items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the overlays are read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the Graphic Layer Sequence managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the sequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** adds a new graphic layer to the list. The recommended display value + * of the new graphic layer remains undefined and can be set later. + * @param gLayer name of the graphic layer. Must be unique within the sequence, + * i.e. no other graphic layer with the same name may exist, otherwise an error + * code is returned. + * @param gLayerOrder graphic layer order of the new layer. + * @param gLayerDescription (optional) description of the new layer. Default: description absent. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addGraphicLayer(const char *gLayer, + const Sint32 gLayerOrder, + const char *gLayerDescription=NULL); + + /** creates a new graphic layer with the given + * name and optional description. + * The new name must be unique, otherwise an error code is returned. + * The toFrontGraphicLayer() method is implicitly called for the new layer. + * @param gLayer the name of the graphic layer. Must be a valid DICOM Code String. + * @param gLayerDescription the optional description of the graphic layer. + * Must be a valid DICOM Long String. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition addGraphicLayer( + const char *gLayer, + const char *gLayerDescription=NULL); + + /** get number of graphic layer objects in this list. + * @return the number of objects. + */ + size_t size() const { return list_.size(); } + + /** sorts the graphic layers according to + * the graphic layer order. Layers with lower order have lower + * indices after sorting which means that the layers can be + * drawn to the screen in ascending index order. + * Calling this routine may result in a re-numbering + * of the graphic layer orders in a way that does not affect + * their sequence. + * @param lowestLayer is the lowest number assigned to + * a layer during the renumbering. + */ + void sortGraphicLayers(Sint32 lowestLayer=1); + + /** gets the unique name of the graphic + * layer with the given index. If no layer for the given + * index exists, NULL is returned. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return name of the graphic layer + */ + const char *getGraphicLayerName(size_t idx); + + /** gets the index of the graphic + * layer with the given unique name. If no matching layer + * is found, DVPS_IDX_NONE is returned. + * @param name name of the graphic layer + * @return index of the graphic layer + */ + size_t getGraphicLayerIndex(const char *name); + + /** gets a description string for the graphic + * layer with the given index. If no layer for the given + * index exists, or if the description is empty, NULL is returned. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return description of the graphic layer + */ + const char *getGraphicLayerDescription(size_t idx); + + /** checks whether a recommended display value (grayscale, color or both) for the given graphic layer exists. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return OFTrue if a recommended display value exists + */ + OFBool haveGraphicLayerRecommendedDisplayValue(size_t idx); + + /** gets the recommended grayscale display value for the given graphic layer. + * If the graphic layer contains an RGB display value but no grayscale + * display value, the RGB value is implicitly converted to grayscale. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param gray the recommended display value as an unsigned 16-bit P-value + * is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16& gray); + + /** gets the recommended RGB display value for the given graphic layer. + * If the graphic layer contains a grayscale display value but no RGB + * display value, the grayscale value is implicitly converted to RGB. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param r returns the R component of the recommended display value as unsigned 16-bit P-value + * @param g returns the G component of the recommended display value as unsigned 16-bit P-value + * @param b returns the B component of the recommended display value as unsigned 16-bit P-value + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16& r, Uint16& g, Uint16& b); + + /** set graphic layer recommended grayscale display value for the given graphic layer. + * This method does not affect (set or modify) the recommended RGB display value + * which should be set separately. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param gray the recommended display value as an unsigned 16-bit P-value + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16 gray); + + /** set graphic layer recommended RGB display value for the given graphic layer. + * This method does not affect (set or modify) the recommended grayscale display value + * which should be set separately. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param r the R component of the recommended display value as unsigned 16-bit P-value + * @param g the G component of the recommended display value as unsigned 16-bit P-value + * @param b the B component of the recommended display value as unsigned 16-bit P-value + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16 r, Uint16 g, Uint16 b); + + /** removes recommended display values for the given graphic layer. + * @param rgb if true, the RGB recommended display value is removed + * @param monochrome if true the monochrome recommended display value is removed + */ + void removeGraphicLayerRecommendedDisplayValue(size_t idx, OFBool rgb, OFBool monochrome); + + /** assigns a new unique name to the given graphic layer. + * The new name must be unique, otherwise an error code is returned. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param name the new name of the graphic layer. Must be a valid DICOM Code String. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerName(size_t idx, const char *name); + + /** sets a new description to the given graphic layer. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param descr description of the graphic layer. Must be a valid DICOM Long String. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setGraphicLayerDescription(size_t idx, const char *descr); + + /** makes a graphic layer the highest layer for display. + * This method assigns a graphic layer order higher than all + * existing graphic layer orders to the given graphic layer, + * sorts and renumbers the list of graphic layers. Upon success, + * the given graphic layer is guaranteed to have the new index + * (getNumberOfGraphicLayers()-1). + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition toFrontGraphicLayer(size_t idx); + + /** makes a graphic layer the lowest layer for display. + * This method assigns a graphic layer order lower than all + * existing graphic layer orders to the given graphic layer, + * sorts and renumbers the list of graphic layers. Upon success, + * the given graphic layer is guaranteed to have the new index 0. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition toBackGraphicLayer(size_t idx); + + /** exchanges the layer order of the two graphic layers with + * the given indices. This method does not sort or renumber + * the graphic layers. + * @param idx1 index of the first graphic layer, must be < getNumberOfGraphicLayers() + * @param idx2 index of the second graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition exchangeGraphicLayers(size_t idx1, size_t idx2); + + /** removes and deletes a graphic layer. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeGraphicLayer(size_t idx); + + /** removes and deletes all graphic layers for which + * no matching text, graphic, curve or overlay object exists. + * Called before writing a presentation state. + */ + void cleanupLayers( + DVPSOverlayCurveActivationLayer_PList& activations, + DVPSGraphicAnnotation_PList& annotations); + +private: + + /// private undefined assignment operator + DVPSGraphicLayer_PList& operator=(const DVPSGraphicLayer_PList&); + + /** gets the the graphic layer with the given index. If no layer for the given + * index exists, NULL is returned. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return pointer to the graphic layer + */ + DVPSGraphicLayer *getGraphicLayer(size_t idx); + + /** the list maintained by this object + */ + OFList list_; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsgr.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsgr.h new file mode 100644 index 00000000..d7bcdef3 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsgr.h @@ -0,0 +1,140 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicObject + * + */ + +#ifndef DVPSGR_H +#define DVPSGR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +/** an item of the graphic object sequence in a presentation state (internal use only). + * This class manages the data structures comprising one item + * of the Graphic Object Sequence which is contained + * in the Graphic Annotation Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSGraphicObject +{ +public: + /// default constructor + DVPSGraphicObject(); + + /// copy constructor + DVPSGraphicObject(const DVPSGraphicObject& copy); + + /** clone method. + * @return a pointer to a new DVPSGraphicObject object containing + * a copy of this object. + */ + DVPSGraphicObject *clone() { return new DVPSGraphicObject(*this); } + + /// destructor + virtual ~DVPSGraphicObject(); + + /** reads a graphic object from a DICOM dataset. + * The DICOM elements of the Graphic Object item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the GraphicObjectSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the graphic object managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the GraphicObjectSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** gets the graphic annotation units. + * @return annotation units + */ + DVPSannotationUnit getAnnotationUnits(); + + /** gets the number of graphic points. + * @return number of graphic points + */ + size_t getNumberOfPoints(); + + /** gets one point from the graphic data. + * @param idx index of the graphic point, must be < getNumberOfPoints(); + * @param x upon success the x value of the point is returned in this parameter + * @param y upon success the y value of the point is returned in this parameter + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getPoint(size_t idx, Float32& x, Float32& y); + + /** gets the graphic type of this graphic object. + * @return graphic type + */ + DVPSGraphicType getGraphicType(); + + /** checks if the graphic is filled + * @return OFTrue if graphic is filled. + */ + OFBool isFilled(); + + /** sets the graphic data for this graphic object. + * @param number number of graphic points in parameter "data" + * @param data pointer to an array of Float32 values with a size of (at least) + * 2*number. The values are copied into the graphic object. + * @param unit the graphic annotation units for this data. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setData(size_t number, const Float32 *data, DVPSannotationUnit unit); + + /** sets the graphic type for the graphic object + * @param gtype the graphic type + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setGraphicType(DVPSGraphicType gtype); + + /** sets the graphic filled status for the graphic object + * @param isFilled OFTrue if graphic is filled, OFFalse otherwise. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setFilled(OFBool filled); + +private: + + /// private undefined assignment operator + DVPSGraphicObject& operator=(const DVPSGraphicObject&); + + /// VR=CS, VM=1, Type 1 + DcmCodeString graphicAnnotationUnits; + /// VR=US, VM=1, Type 1 + DcmUnsignedShort numberOfGraphicPoints; + /// VR=FL, VM=2-n, Type 1 + DcmFloatingPointSingle graphicData; + /// VR=CS, VM=1, Type 1 + DcmCodeString graphicType; + /// VR=CS, VM=1, Type 1c + DcmCodeString graphicFilled; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsgrl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsgrl.h new file mode 100644 index 00000000..6bc6e535 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsgrl.h @@ -0,0 +1,116 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicObject_PList + * + */ + +#ifndef DVPSGRL_H +#define DVPSGRL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSGraphicObject; + +/** the list of graphic objects contained in a presentation state (internal use only). + * This class manages the data structures comprising one complete + * Graphic Object Sequence which is contained in one item + * of the Graphic Annotation Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSGraphicObject_PList +{ +public: + /// default constructor + DVPSGraphicObject_PList(); + + /// copy constructor + DVPSGraphicObject_PList(const DVPSGraphicObject_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSGraphicObject_PList object containing + * a deep copy of this object. + */ + DVPSGraphicObject_PList *clone() { return new DVPSGraphicObject_PList(*this); } + + /// destructor + virtual ~DVPSGraphicObject_PList(); + + /** reads a list of graphic objects from a DICOM dataset. + * The DICOM elements of the Graphic Object Sequence are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the GraphicObjectSequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of graphic objects managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the GraphicObjectSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** get number of graphic objects in this list. + * @return the number of graphic objects. + */ + size_t size() const { return list_.size(); } + + /** returns a pointer to the graphic object with the given + * index or NULL if it does not exist. + * @param idx index, must be < size() + * @return pointer to graphic object or NULL + */ + DVPSGraphicObject *getGraphicObject(size_t idx); + + /** adds the given graphic object to + * the list of graphic objects managed by this object. + * @param text graphic object to be inserted. + */ + void addGraphicObject(DVPSGraphicObject *graphic); + + /** returns a pointer to the graphic object with the given + * index (or NULL if it does not exist) and removes it from the list. + * @param idx index, must be < size() + * @return pointer to graphic object or NULL + */ + DVPSGraphicObject *removeGraphicObject(size_t idx); + +private: + + /// private undefined assignment operator + DVPSGraphicObject_PList& operator=(const DVPSGraphicObject_PList&); + + /** the list maintained by this object + */ + OFList list_; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpshlp.h b/dcmpstat/include/dcmtk/dcmpstat/dvpshlp.h new file mode 100644 index 00000000..c44fd247 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpshlp.h @@ -0,0 +1,120 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg, Joerg Riesmeier + * + * Purpose: + * classes: DVPSHelper + * + */ + + +#ifndef DVPSHLP_H +#define DVPSHLP_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcsequen.h" + +class DcmFileFormat; + +/** this class contains a collection of static helper methods. + */ +class DCMTK_DCMPSTAT_EXPORT DVPSHelper +{ + public: + /** helper function which loads a DICOM file and returns a + * pointer to a DcmFileFormat object if loading succeeds. + * @param filename name of DICOM file to be loaded + * @param fileformat pointer to DcmFileFormat object passed back here + * @return EC_Normal upon success, an error code otherwise. + */ + static OFCondition loadFileFormat(const char *filename, DcmFileFormat *&fileformat); + + /** helper function which saves a DICOM object to file. + * @param filename name of DICOM file to be created + * @param fileformat DICOM object to be saved + * @param explicitVR selects the transfer syntax to be written. + * True selects Explicit VR Little Endian, False selects Implicit VR Little Endian. + * @return EC_Normal upon success, an error code otherwise. + */ + static OFCondition saveFileFormat(const char *filename, + DcmFileFormat *fileformat, + OFBool explicitVR); + + /** helper function that inserts a new element into a DICOM dataset. + * A new DICOM element of the type determined by the tag is created. + * The string value (if any) is assigned and the element is inserted + * into the dataset. Only tags corresponding to string VRs may be passed. + * @param item the dataset into which the new element is inserted + * @param tag the tag key of the new DICOM element, must have string VR. + * @param value the value to be inserted. If omitted, an empty element is created. + * @return EC_Normal upon success, an error code otherwise. + */ + static OFCondition putStringValue(DcmItem *item, DcmTagKey tag, const char *value=NULL); + + /** helper function that inserts a new element into a DICOM dataset. + * A new DICOM element of type "US" is created, the value is assigned + * and the element is inserted into the dataset. + * @param item the dataset into which the new element is inserted + * @param tag the tag key of the new DICOM element, must have "US" VR. + * @param value the value to be inserted. + * @return EC_Normal upon success, an error code otherwise. + */ + static OFCondition putUint16Value(DcmItem *item, DcmTagKey tag, Uint16 value); + + /** helper function that cleans up pending processes under Unix. + * No function if used on Windows. + */ + static void cleanChildren(); + + /** helper function that writes the current date in DICOM format (YYYYMMDD) + * @param str current date is written to this string + */ + static void currentDate(OFString &str); + + /** helper function that writes the current time in DICOM format (HHMMSS) + * @param str current time is written to this string + */ + static void currentTime(OFString &str); + + /** assigns the given value to the given DICOM element if it is empty + * and the status is OK, returns new status. + * @param result status in/out + * @param a_name DICOM element to be set + * @param a_value new value, must not be NULL. + */ + static void setDefault(OFCondition& result, DcmElement& a_name, const char *a_value); + + /** static helper method that checks whether the given sequence contains an + * item with a ReferencedSOPClassUID element that matches the given UID string. + * @param seq sequence to be searched, should be a PrintManagementCapabilitiesSequence. + * @param uid UID string + * @return OFTrue if found, OFFalse otherwise. Returns OFFalse if uid is NULL. + */ + static OFBool haveReferencedUIDItem(DcmSequenceOfItems& seq, const char *uid); + + /** static helper method that adds an item to the given sequence. The item + * contains a ReferencedSOPClassUID element with the given UID string as value. + * @param seq sequence to be added to, should be a PrintManagementCapabilitiesSequence. + * @param uid UID string, must not be NULL + * @return EC_Normal if successful, an error code otherwise. + */ + static OFCondition addReferencedUIDItem(DcmSequenceOfItems& seq, const char *uid); + +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsib.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsib.h new file mode 100644 index 00000000..7f18a24c --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsib.h @@ -0,0 +1,383 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSImageBoxContent + * + */ + +#ifndef DVPSIB_H +#define DVPSIB_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmnet/dimse.h" + +class DVPSPresentationLUT_PList; +class DVConfiguration; + +/** the representation of a Image Box Content SQ item for Stored Print + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSImageBoxContent +{ +public: + /// default constructor + DVPSImageBoxContent(); + + /// copy constructor + DVPSImageBoxContent(const DVPSImageBoxContent& copy); + + /** clone method. + * @return a pointer to a new DVPSImageBoxContent object containing + * a copy of this object. + */ + DVPSImageBoxContent *clone() { return new DVPSImageBoxContent(*this); } + + /// destructor + virtual ~DVPSImageBoxContent(); + + /** resets the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** reads an image box content item from a DICOM dataset. + * The DICOM elements of the referenced item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the ImageBoxContentSequence from which the data is to be read + * @param presentationLUTList list of presentation LUTs which may be referenced + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset, DVPSPresentationLUT_PList& presentationLUTList); + + /** writes the image box managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the ImageBoxContentSequence to which the data is written + * @param writeRequestedImageSize if false, the Requested Image Size attribute is not written, + * e.g. because it is not supported by the target printer. + * @param writeReferencedPLUTSQ if false, the Referenced Presentation LUT Sequence is not written, + * e.g. because a "general" presentation LUT is used instead of those referenced by the image boxes. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset, OFBool writeRequestedImageSize, OFBool writeReferencedPLUTSQ = OFTrue); + + /** create default values for all missing type 1 elements. + * Called before a stored print object is written. + * @param renumber if true, a new imageBoxPosition values is created + * @param number new imageBoxPosition to be assigned + * @param ignoreEmptyImages if true, an empty image box position does not cause an error. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createDefaultValues(OFBool renumber, unsigned long number, OFBool ignoreEmptyImages); + + /** returns the referencedSOPClassUID from the ReferencedImageSequence + * @return referencedSOPClassUID string + */ + const char *getSOPClassUID(); + + /** sets the content of this image box object. + * @param instanceuid SOP instance UID of this image box + * @param retrieveaetitle retrieve AETITLE of the referenced image + * @param refstudyuid study instance UID of the referenced image + * @param refseriesuid series instance UID of the referenced image + * @param refsopclassuid SOP class UID of the referenced image + * @param refsopinstanceuid SOP instance UID of the referenced image + * @param requestedimagesize requested images size for this image + * @param patientid patient ID for the referenced image + * @param presentationlutreference referenced SOP instance UID for the referenced Presentation LUT, + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setContent( + const char *instanceuid, + const char *retrieveaetitle, + const char *refstudyuid, + const char *refseriesuid, + const char *refsopclassuid, + const char *refsopinstanceuid, + const char *requestedimagesize, + const char *patientid, + const char *presentationlutreference); + + /** sets the (optional) requested decimate/crop behaviour for this image box. + * @param value new enumerated value. The caller is responsible for + * making sure that the selected printer supports decimate/crop + * if a non-default value is set. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setRequestedDecimateCropBehaviour(DVPSDecimateCropBehaviour value); + + /** gets the current requested decimate/crop behaviour setting + * that is used for this image box. + * @return requested decimate/crop behaviour + */ + DVPSDecimateCropBehaviour getRequestedDecimateCropBehaviour(); + + /** checks whether image box has additional settings + * that are not default. + * @return OFTrue if additional settings exist, OFFalse otherwise. + */ + OFBool hasAdditionalSettings(); + + /** gets the (optional) referenced Presentation LUT Instance UID. + * @return UID, may be NULL. + */ + const char *getReferencedPresentationLUTInstanceUID(); + + /** gets the polarity. + * @return polarity, may be NULL. + */ + const char *getPolarity(); + + /** gets the requested image size. + * @return requested image size, may be NULL. + */ + const char *getRequestedImageSize(); + + /** gets the (optional) magnification type. + * @return magnification type, may be NULL. + */ + const char *getMagnificationType(); + + /** gets the (optional) smoothing type. + * @return smoothing type, may be NULL. + */ + const char *getSmoothingType(); + + /** gets the (optional) configuration information. + * @return configuration information, may be NULL. + */ + const char *getConfigurationInformation(); + + /** gets the current SOP Instance UID. + * @return SOP Instance UID, may be NULL. + */ + const char *getSOPInstanceUID(); + + /** gets the current image box position, 0 if none is set. + * @return image box position + */ + Uint16 getImageBoxPosition(); + + /** sets the polarity. + * @param value new attribute value (NORMAL or REVERSE), may be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPolarity(const char *value); + + /** sets the requested image size. + * @param value new attribute value, may be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setRequestedImageSize(const char *value); + + /** sets the (optional) magnification type. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setMagnificationType(const char *value); + + /** sets the (optional) smoothing type. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setSmoothingType(const char *value); + + /** sets the (optional) configuration information. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setConfigurationInformation(const char *value); + + /** sets the SOP instance UID (which is returned by the Print SCP). + * @param value new attribute value, must not be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setSOPInstanceUID(const char *value); + + /** sets magnification type, smoothing type and configuration information back to default. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDefault(); + + /** returns the image UIDs that are required to look up the referenced image in the database + * @param studyUID Study UID of the image + * @param seriesUID series UID of the image + * @param instanceUID instance UID of the image + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference(const char *&studyUID, const char *&seriesUID, const char *&instanceUID); + + /** writes the attributes managed by this objects that are part of a + * basic grayscale image box N-SET request into the DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition prepareBasicImageBox(DcmItem &dset); + + /** checks whether the given Presentation LUT type could be used together + * with this image box on a Print SCP that requires a matching alignment + * between a Presentation LUT and the image pixel data. + * @param align LUT alignment type + * @return OFTrue if matching, OFFalse otherwise + */ + OFBool matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align) const; + + /** performs a Print SCP Basic Grayscale Image Box N-SET operation. + * The results of the N-SET operation are stored in the objects passed as + * rsp and rspDataset. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rqDataset N-SET request dataset + * @param rsp N-SET response message + * @param rspDataset N-SET response dataset passed back in this parameter + * @param imageDataset a hardcopy grayscale image (without general study + * and general series modules which must be added by the caller) + * containing the image data from the N-SET request is written to + * this dataset if the method returns successfully. + * @param align describes the current Presentation LUT. Used if the Print + * SCP has been configured to enforce a matching of Presentation LUT + * and pixel data bit depth. + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation + * @return OFTrue if N-SET operation was successful, OFFalse otherwise. + */ + OFBool printSCPSet( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + DcmDataset &imageDataset, + DVPSPrintPresentationLUTAlignment align, + OFBool presentationLUTnegotiated); + + /** assigns new values for study instance UID, series instance UID + * and retrieve aetitle. + * @param studyUID new studyUID + * @param seriesUID new seriesUID + * @param aetitle new retrieve aetitle, must not be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setUIDsAndAETitle( + DcmUniqueIdentifier& studyUID, + DcmUniqueIdentifier& seriesUID, + const char *aetitle); + +private: + /// private undefined assignment operator + DVPSImageBoxContent& operator=(const DVPSImageBoxContent&); + + /** writes a Referenced Presentation LUT SQ to the given + * dataset. Helper function used in the more general write() method. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addReferencedPLUTSQ(DcmItem &dset); + + /** evaluates the contents of the Basic Grayscale Image Sequence during a + * Print SCP Basic Grayscale Image Box N-SET operation. + * The results of the N-SET operation are stored in the object passed as rsp. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rqDataset first item of the Basic Grayscale Image Sequence + * @param rsp N-SET response message + * @param imageDataset a hardcopy grayscale image (without general study + * and general series modules which must be added by the caller) + * containing the image data from the N-SET request is written to + * this dataset if the method returns successfully. + * @param align describes the current Presentation LUT. Used if the Print + * SCP has been configured to enforce a matching of Presentation LUT + * and pixel data bit depth. + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation + * @return OFTrue if N-SET operation was successful, OFFalse otherwise. + */ + OFBool printSCPEvaluateBasicGrayscaleImageSequence( + DVConfiguration& cfg, + const char *cfgname, + DcmItem *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset &imageDataset, + DVPSPrintPresentationLUTAlignment align, + OFBool presentationLUTnegotiated); + + /// Module=Image_Box_List, VR=UI, VM=1, Type 1(c) + DcmUniqueIdentifier sOPInstanceUID; + /// Module=Image_Box_List, VR=US, VM=1, Type 1 + DcmUnsignedShort imageBoxPosition; + /// Module=Image_Box_List, VR=CS, VM=1, Type 2 + DcmCodeString polarity; + /// Module=Image_Box_List, VR=CS, VM=1, Type 3 + DcmCodeString magnificationType; + /// Module=Image_Box_List, VR=ST, VM=1, Type 3 + DcmShortText configurationInformation; + /// Module=Image_Box_List, VR=CS, VM=1, Type 3 + DcmCodeString smoothingType; + /// Module=Image_Box_List, VR=DS, VM=1, Type 3 + DcmDecimalString requestedImageSize; + /// Module=Image_Box_List (Supplement 38), VR=CS, VM=1, Type 3 + DcmCodeString requestedDecimateCropBehavior; + + /* the following attributes belong to the ReferencedImageSequence + * which must have exactly one item here. + */ + /// Module=Image_Box_List, VR=AE, VM=1-n, Type 1 + DcmApplicationEntity retrieveAETitle; + /// Module=Image_Box_List, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier referencedSOPClassUID; + /// Module=Image_Box_List, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier referencedSOPInstanceUID; + /// Module=Image_Box_List, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier studyInstanceUID; + /// Module=Image_Box_List, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier seriesInstanceUID; + /// Module=Image_Box_List, VR=IS, VM=1, Type 1c + DcmIntegerString referencedFrameNumber; + /// Module=Image_Box_List, VR=LO, VM=1, Type 2 + DcmLongString patientID; + + // we do not support the ReferencedImageOverlayBoxSequence which is retired in Supplement 35 anyway. + + // the ReferencedPresentationLUTSequence is only created/read on the fly + DcmUniqueIdentifier referencedPresentationLUTInstanceUID; + + /// describes whether the image depth is 8 bit or 12 bit. + DVPSImageDepth imageDepth; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsibl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsibl.h new file mode 100644 index 00000000..6efda158 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsibl.h @@ -0,0 +1,388 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSImageBoxContent_PList + * + */ + +#ifndef DVPSIBL_H +#define DVPSIBL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvrui.h" + +class DVPSImageBoxContent; +class DVPSPresentationLUT_PList; + +/** the list of Image Boxes contained in a stored print object. + * This class manages the data structures comprising one complete + * Image Box Content Sequence in a Stored Print object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSImageBoxContent_PList +{ +public: + + /// default constructor + DVPSImageBoxContent_PList(); + + /// copy constructor + DVPSImageBoxContent_PList(const DVPSImageBoxContent_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSImageBoxContent_PList object containing + * a deep copy of this object. + */ + DVPSImageBoxContent_PList *clone() { return new DVPSImageBoxContent_PList(*this); } + + /// destructor + virtual ~DVPSImageBoxContent_PList(); + + /** reads a list of image boxes (ImageBoxContentSequence) from a DICOM dataset. + * The DICOM elements of the image boxes are copied from the dataset to this object. + * The completeness of all items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the sequence is to be read + * @param presentationLUTList list of presentation LUTs which may be referenced + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset, DVPSPresentationLUT_PList& presentationLUTList); + + /** writes the list of image boxes managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the ImageBoxContentSequence is written + * @param writeRequestedImageSize if false, the Requested Image Size attributes are not written, + * e.g. because they are not supported by the target printer. + * @param numItems the number of items (from the beginning of the list) to be written. + * Default: all items are written. + * @param ignoreEmptyImages if true, all image boxes without image box position are ignored + * when writing. + * @param writeReferencedPLUTSQ if false, the Referenced Presentation LUT Sequence is not written, + * e.g. because a "general" presentation LUT is used instead of those referenced by the image boxes. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write( + DcmItem &dset, + OFBool writeRequestedImageSize, + size_t numItems, + OFBool ignoreEmptyImages, + OFBool writeReferencedPLUTSQ = OFTrue); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** gets the number of image boxes in this list. + * @return the number of image boxes. + */ + size_t size() const { return list_.size(); } + + /** create default values for all missing type 1 elements. + * Called before a stored print object is written. + * @param renumber if true, new imageBoxPosition values are created + * @param ignoreEmptyImages if true, an empty image box position does not cause an error. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createDefaultValues(OFBool renumber, OFBool ignoreEmptyImages); + + /** adds all image SOP classes referenced in the image box list to + * the given sequence. Duplicate entries are suppressed. + * @param seq sequence to be added to, should be a PrintManagementCapabilitiesSequence. + * @param numItems number of items of this list to be taken into account. + * Default: all items. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageSOPClasses(DcmSequenceOfItems& seq, size_t numItems=0); + + /** creates a new image box object and sets the content of this image box object. + * @param instanceuid SOP instance UID of this image box + * @param retrieveaetitle retrieve AETITLE of the referenced image + * @param refstudyuid study instance UID of the referenced image + * @param refseriesuid series instance UID of the referenced image + * @param refsopclassuid SOP class UID of the referenced image + * @param refsopinstanceuid SOP instance UID of the referenced image + * @param requestedimagesize requested images size for this image, default: absent + * @param patientid patient ID for the referenced image, default: absent + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageBox( + const char *instanceuid, + const char *retrieveaetitle, + const char *refstudyuid, + const char *refseriesuid, + const char *refsopclassuid, + const char *refsopinstanceuid, + const char *requestedimagesize, + const char *patientid, + const char *presentationlutuid); + + /** adds the given image box object to the list managed by this object. + * @param box image box object to be added. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageBox(DVPSImageBoxContent *box); + + /** sets the (optional) requested decimate/crop behaviour + * for all image boxes managed by this object. + * @param value new enumerated value. The caller is responsible for + * making sure that the selected printer supports decimate/crop + * if a non-default value is set. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setRequestedDecimateCropBehaviour(DVPSDecimateCropBehaviour value); + + /** deletes one of the registered images. + * @param idx index, must be < size() + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition deleteImage(size_t idx); + + /** deletes multiple of the registered images, starting with the first one. + * @param number number of images to delete, must be <= size() + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition deleteMultipleImages(size_t number); + + /** checks if one of the registered images has additional settings that are not + * default values on the image box level. + * @param idx index, must be < getNumberOfImages() + * @return EC_Normal if successful, an error code otherwise. + */ + OFBool imageHasAdditionalSettings(size_t idx); + + /** sets the polarity for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value (NORMAL or REVERSE), may be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImagePolarity(size_t idx, const char *value); + + /** sets the requested size for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, may be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageRequestedSize(size_t idx, const char *value); + + /** sets the (optional) magnification type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageMagnificationType(size_t idx, const char *value); + + /** sets the (optional) smoothing type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageSmoothingType(size_t idx, const char *value); + + /** sets the (optional) configuration information for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageConfigurationInformation(size_t idx, const char *value); + + /** sets the SOP instance UID for the given image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, must not be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageSOPInstanceUID(size_t idx, const char *value); + + /** sets magnification type, smoothing type and configuration information back to default + * for all registered images. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setAllImagesToDefault(); + + /** gets the polarity for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return polarity, may be NULL. + */ + const char *getImagePolarity(size_t idx); + + /** gets the requested size for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return requested size, may be NULL. + */ + const char *getImageRequestedSize(size_t idx); + + /** gets the (optional) magnification type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return magnification type, may be NULL. + */ + const char *getImageMagnificationType(size_t idx); + + /** gets the (optional) smoothing type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return smoothing type, may be NULL. + */ + const char *getImageSmoothingType(size_t idx); + + /** gets the (optional) configuration information for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return configuration information, may be NULL. + */ + const char *getImageConfigurationInformation(size_t idx); + + /** gets the current SOP Instance UID for the given registered image box.. + * @param idx index, must be < getNumberOfImages() + * @return SOP Instance UID, may be NULL. + */ + const char *getSOPInstanceUID(size_t idx); + + /** gets the referenced Presentation LUT SOP Instance UID for the given registered image box.. + * @param idx index, must be < getNumberOfImages() + * @return SOP Instance UID, may be NULL. + */ + const char *getReferencedPresentationLUTInstanceUID(size_t idx); + + /** returns the image UIDs that are required to look up the referenced image in the database + * @param idx index, must be < getNumberOfImages() + * @param studyUID Study UID of the image + * @param seriesUID series UID of the image + * @param instanceUID instance UID of the image + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference(size_t idx, const char *&studyUID, const char *&seriesUID, const char *&instanceUID); + + /** writes the attributes managed by the referenced object that are part of a + * basic grayscale image box N-SET request into the DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param idx index, must be < getNumberOfImages() + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition prepareBasicImageBox(size_t idx, DcmItem &dset); + + /** checks whether the given SOP instance UID is used as + * referenced Presentation LUT SOP Instance UID inside the list of + * image boxes managed by this object. + * @param uid name of UID + * @return OFTrue if UID is used, OFFalse otherwise. + */ + OFBool presentationLUTInstanceUIDisUsed(const char *uid); + + /** if only one Presentation LUT is required to render all images + * managed by this object, returns the UID of this presentation LUT. + * Otherwise returns NULL. + * @param filmBox UID of Presentation LUT specified on Film Box + * level. May be NULL or empty string if absent. + * @return UID of Presentation LUT if found, NULL or empty string otherwise. + */ + const char *haveSinglePresentationLUTUsed(const char *filmBox); + + /** creates a number of image boxes as part of a Print SCP N-CREATE operation. + * The previous content of the list is deleted. + * @param numBoxes number of boxes to be created + * @param studyUID study instance UID under which Hardcopy Grayscale images will be saved + * @param seriesUID series instance UID under which Hardcopy Grayscale images will be saved + * @param aetitle retrieve AE title for Hardcopy Grayscale images + * @return OFTrue if successful, OFFalse otherwise. + */ + OFBool printSCPCreate( + unsigned long numBoxes, + DcmUniqueIdentifier& studyUID, + DcmUniqueIdentifier& seriesUID, + const char *aetitle); + + /** writes a Referenced Image Box Sequence for the image boxes + * managed by this object. Used in a Print SCP N-CREATE operation. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition writeReferencedImageBoxSQ(DcmItem &dset); + + /** checks whether the given Presentation LUT type could be used together + * with all image boxes in this list on a Print SCP that requires a matching + * alignment between a Presentation LUT and the image pixel data. + * @param align LUT alignment type + * @return OFTrue if matching, OFFalse otherwise + */ + OFBool matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align) const; + + /** looks up the image box with the given SOP instance UID in this list + * and returns a pointer to a new object containing a copy of this + * image box. If the object is not found, NULL is returned. + * @param uid SOP instance UID of the image box to be looked up + * @return pointer to copied image box object, may be NULL. + */ + DVPSImageBoxContent *duplicateImageBox(const char *uid); + + /** checks whether any of the image boxes managed by this list + * has the same position as the given one, but a different + * SOP instance UID. This is used during an Print SCP N-SET operation + * to check whether a position clash exists. + * @param uid SOP instance UID of the image box to be looked up + * @param position image position to be looked up + */ + OFBool haveImagePositionClash(const char *uid, Uint16 position); + + /** adds the given image box object to this list. Any other object existing + * in the list with the same SOP instance UID is removed. + * Used during a Print SCP image box N-SET operation. + * @param newImageBox new image box object to be added to the list. + */ + void replace(DVPSImageBoxContent *newImageBox); + + /** checks whether any of the image boxes has an image box position + * assigned. If no image box position is assigned, the object list + * cannot be written and a Print SCP should return a warning + * status upon receipt of an N-ACTION request. + * @return OFTrue if empty page (no image box position assigned), OFFalse otherwise. + */ + OFBool emptyPageWarning(); + +private: + + /** private undefined assignment operator + */ + DVPSImageBoxContent_PList& operator=(const DVPSImageBoxContent_PList&); + + /** returns a pointer to the image box with the given + * index or NULL if it does not exist. + * @param idx index, must be < size() + * @return pointer to image box object or NULL + */ + DVPSImageBoxContent *getImageBox(size_t idx); + + /** the list maintained by this object + */ + OFList list_; + +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsmsg.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsmsg.h new file mode 100644 index 00000000..c2723229 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsmsg.h @@ -0,0 +1,273 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSIPCMessage + * + */ + +#ifndef DVPSMSG_H +#define DVPSMSG_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dctypes.h" /* for Uint32 */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ + +class DcmTransportConnection; + +/** class for IPC message exchange between different processes of the + * DICOMscope application + */ +class DCMTK_DCMPSTAT_EXPORT DVPSIPCMessage +{ +public: + + /// default constructor + DVPSIPCMessage(); + + /// copy constructor + DVPSIPCMessage(const DVPSIPCMessage& copy); + + /// destructor + virtual ~DVPSIPCMessage(); + + /// copy assignment operator + DVPSIPCMessage& operator=(const DVPSIPCMessage&); + + /** sets the message type + * @param msgtype new message type + */ + void setMessageType(Uint32 msgtype) { messageType = msgtype; } + + /** returns the message type + * @return message type + */ + Uint32 getMessageType() { return messageType; } + + /** adds a character string into the message payload. + * @param str zero terminated string, may be NULL (in which case an empty string is added) + */ + void addStringToPayload(const char *str); + + /** adds an integer into the message payload. + * @param value to write + */ + void addIntToPayload(Uint32 i); + + /** extracts a string from the message payload + * and copies it into the given str object. + * @param str string is written into this parameter + * @return OFTrue if successful, OFFalse otherwise + */ + OFBool extractStringFromPayload(OFString& str); + + /** extracts an integer from the message payload. + * @param i integer is written into this parameter + * @return OFTrue if successful, OFFalse otherwise + */ + OFBool extractIntFromPayload(Uint32& i); + + /** rewinds the read offset to the beginning of the message payload + */ + void rewindPayload(); + + /** removes all payload + */ + void erasePayload(); + + /** sends the current message over the given transport connection. + * @param connection transport connection to be used + * @return OFTrue if successful, OFFalse otherwise. + */ + OFBool send(DcmTransportConnection &connection); + + /** receives a messages from the given transport connection + * and stores it in the current object, replacing any existing + * payload. + * @param connection transport connection to be used + * @return OFTrue if successful, OFFalse otherwise. + */ + OFBool receive(DcmTransportConnection &connection); + + + // constants for message type + static const Uint32 OK; + static const Uint32 requestApplicationID; + static const Uint32 assignApplicationID; + static const Uint32 applicationTerminates; + static const Uint32 receivedUnencryptedDICOMConnection; + static const Uint32 receivedEncryptedDICOMConnection; + static const Uint32 connectionClosed; + static const Uint32 connectionAborted; + static const Uint32 requestedUnencryptedDICOMConnection; + static const Uint32 requestedEncryptedDICOMConnection; + static const Uint32 receivedDICOMObject; + static const Uint32 sentDICOMObject; + + // message status constants + static const Uint32 statusOK; // OK + static const Uint32 statusWarning; // warning + static const Uint32 statusError; // error + + // client type constants + static const Uint32 clientOther; // client is of unspecified type + static const Uint32 clientStoreSCP; // client is Store SCP + static const Uint32 clientStoreSCU; // client is Store SCU + static const Uint32 clientPrintSCP; // client is Print SCP + static const Uint32 clientPrintSCU; // client is Print SCU + static const Uint32 clientQRSCP; // client is Query/Retrieve (Find/Move/Get) SCP + +private: + + /** resize payload if necessary such that at least i bytes can be written + * @param i number of bytes required in buffer + */ + void resizePayload(size_t i); + + /// type of message + Uint32 messageType; + + /// number of bytes actually used in payload + Uint32 payloadUsed; + + /// number of bytes allocated in payload + Uint32 payloadAllocated; + + /// read offset into payload in bytes + Uint32 payloadReadOffset; + + /// pointer to raw payload data in big endian byte order + unsigned char *payload; +}; + + +/** a client for IPC message exchange between different processes of the + * DICOMscope application + */ +class DCMTK_DCMPSTAT_EXPORT DVPSIPCClient +{ +public: + + /** constructor + * @param clientType type of client application, see constants defined in DVPSIPCMessage + * @param txt textual description of client application + * @param thePort TCP/IP port on which the server is listening + * @param keepOpen flag indicating whether the connection should be kept + * open all the time or should be opened/closed for each transaction. + */ + DVPSIPCClient(Uint32 clientType, const char *txt, int thePort, OFBool keepOpen); + + /// destructor + virtual ~DVPSIPCClient(); + + /** sends ApplicationTerminates notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + */ + void notifyApplicationTerminates(Uint32 status); + + /** sends ReceivedUnencryptedDICOMConnection notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + * @param txt textual description of notification for server + */ + void notifyReceivedUnencryptedDICOMConnection(Uint32 status, const char *txt); + + /** sends ReceivedEncryptedDICOMConnection notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + * @param txt textual description of notification for server + */ + void notifyReceivedEncryptedDICOMConnection(Uint32 status, const char *txt); + + /** sends ConnectionClosed notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + */ + void notifyConnectionClosed(Uint32 status); + + /** sends ConnectionAborted notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + * @param txt textual description of notification for server + */ + void notifyConnectionAborted(Uint32 status, const char *txt); + + /** sends RequestedUnencryptedDICOMConnection notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + * @param txt textual description of notification for server + */ + void notifyRequestedUnencryptedDICOMConnection(Uint32 status, const char *txt); + + /** sends RequestedEncryptedDICOMConnection notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + * @param txt textual description of notification for server + */ + void notifyRequestedEncryptedDICOMConnection(Uint32 status, const char *txt); + + /** sends ReceivedDICOMObject notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + * @param txt textual description of DICOM object + */ + void notifyReceivedDICOMObject(Uint32 status, const char *txt); + + /** sends SentDICOMObject notification to server. + * @param Uint32 message status, see constants defined in DVPSIPCMessage + * @param txt textual description of DICOM object + */ + void notifySentDICOMObject(Uint32 status, const char *txt); + + /** checks whether the message server has been found active + * upon creation of this object. + * @return OFTrue if server is active, OFFalse otherwise. + */ + OFBool isServerActive() { return serverActive; } + +private: + + /// private undefined copy constructor + DVPSIPCClient(const DVPSIPCClient& copy); + + /// private undefined copy assignment operator + DVPSIPCClient& operator=(const DVPSIPCClient&); + + /** request connection to server, store in 'connection' if successful. + */ + void requestConnection(); + + /** perform message transaction with server. If serverActive is false, + * no connection attempt is performed. + * @param msg contains message to be sent, overwritten with message + * received from server if successful + * @return OFTrue if successful, OFFalse otherwise + */ + OFBool performTransaction(DVPSIPCMessage& msg); + + /// TCP/IP port number on which the server is listening + int port; + + /// true if the first connection attempt has succeeded, false otherwise + OFBool serverActive; + + /// application ID assigned by the server + Uint32 applicationID; + + /// flag indicating whether we want to keep the connection open + OFBool keepConnectionOpen; + + /// current transport connection + DcmTransportConnection *connection; +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsov.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsov.h new file mode 100644 index 00000000..46a65ccd --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsov.h @@ -0,0 +1,167 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlay + * + */ + +#ifndef DVPSOV_H +#define DVPSOV_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +class DicomImage; + +/** an overlay contained in a presentation state (internal use only). + * This class manages the data structures comprising a single overlay + * (one instance of the Overlay Plane Module repeating elements) + * that is contained in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSOverlay +{ +public: + /// default constructor + DVPSOverlay(); + + /// copy constructor + DVPSOverlay(const DVPSOverlay& copy); + + /** clone method. + * @return a pointer to a new DVPSOverlay object containing + * a copy of this object. + */ + DVPSOverlay *clone() const { return new DVPSOverlay(*this); } + + /// destructor + virtual ~DVPSOverlay(); + + /** reads the specified overlay group from a DICOM dataset. + * The DICOM elements of the Overlay Plane module are copied + * from the dataset to this object. The OverlayData element, which is + * optional in the Overlay Plane Module but required for presentation states, + * must be present. + * The completeness of the overlay plane (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the overlay is to be read + * @param ovGroup the lower byte of the overlay group to be read + * @param asGroup the lower byte of the overlay group to be assigned to the + * overlay plane in the presentation state. Default: identical to ovGroup. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset, Uint8 ovGroup, Uint8 asGroup=0xFF); + + /** writes the overlay plane managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the overlay is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** get group number of overlay repeating group managed by this object. + * @return the lower byte of the overlay group + */ + Uint8 getOverlayGroup() const { return overlayGroup; } + + /** sets the group number for the overlay repeating group managed + * by this object. + * @param newGroup lower byte of the repeating group number. + */ + void setOverlayGroup(Uint8 newGroup) { overlayGroup = newGroup; } + + /** checks if the overlay is suitable as a bitmap shutter + * for an image with the given image size. Checks overlay type, + * origin and size. + * @param x image width in pixels + * @param y image height in pixels + * @return OFTrue if the specified overlay group matches the image size. + */ + OFBool isSuitableAsShutter(unsigned long x, unsigned long y); + + /** gets the overlay label if present. + * If the label string is absent, this method returns NULL. + * @return overlay label + */ + const char *getOverlayLabel(); + + /** gets the overlay description if present. + * If the label string is absent, this method returns NULL. + * @return overlay description + */ + const char *getOverlayDescription(); + + /** checks whether this overlay is ROI type. + * @return OFTrue if overlay is ROI, OFFalse if overlay is Graphic. + */ + OFBool isROI(); + + /** retrieve origin and size values for this overlay + * @param originX horizontal origin returned in this parameter + * @param originY vertical origin returned in this parameter + * @param sizeX horizontal size returned in this parameter + * @param sizeY vertical size returned in this parameter + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition getValues( + Sint16& originX, + Sint16& originY, + Uint16& sizeX, + Uint16& sizeY); + + /// return reference to overlay data + DcmOverlayData& getData() { return overlayData; } + + /// return reference to overlay label + DcmLongString& getLabel() { return overlayLabel; } + + /// return reference to overlay description + DcmLongString& getDescription() { return overlayDescription; } + +private: + + /// private undefined assignment operator + DVPSOverlay& operator=(const DVPSOverlay&); + + /// lower byte of the overlay repeating group managed by this object + Uint8 overlayGroup; + /// VR=US, VM=1, Type=1 + DcmUnsignedShort overlayRows; + /// VR=US, VM=1, Type=1 + DcmUnsignedShort overlayColumns; + /// VR=CS, VM=1, Type=1 + DcmCodeString overlayType; + /// VR=SS, VM=2, Type=1 + DcmSignedShort overlayOrigin; + /// VR=US, VM=1, Type=1 + DcmUnsignedShort overlayBitsAllocated; + /// VR=US, VM=1, Type=1 + DcmUnsignedShort overlayBitPosition; + /// VR=OW, VM=1, Type=1C + DcmOverlayData overlayData; + /// VR=LO, VM=1, Type=3 + DcmLongString overlayDescription; + /// VR=LO, VM=1, Type=3 + DcmLongString overlayLabel; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsovl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsovl.h new file mode 100644 index 00000000..6072eb51 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsovl.h @@ -0,0 +1,145 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlay_PList + * + */ + +#ifndef DVPSOVL_H +#define DVPSOVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSOverlay; + +/** the list of overlays contained in a presentation state (internal use only). + * This class manages the data structures comprising the list of overlays + * (all instances of the Overlay Plane Module repeating elements) + * contained in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSOverlay_PList +{ +public: + /// default constructor + DVPSOverlay_PList(); + + /// copy constructor + DVPSOverlay_PList(const DVPSOverlay_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSOverlay_PList object containing + * a deep copy of this object. + */ + DVPSOverlay_PList *clone() { return new DVPSOverlay_PList(*this); } + + /// destructor + virtual ~DVPSOverlay_PList(); + + /** reads all overlay groups from a DICOM dataset. + * This method checks which overlays are contained in the DICOM dataset. + * All overlays that contain the OverlayData element are copied + * into the "list of overlays" structure managed by this object. + * The completeness of the overlays (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the overlays are read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the overlays managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the overlays are written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** check presence of overlay group + * @param group overlay repeating group to be checked + * @return OFTrue if the specified overlay group is present in the + * list of overlays managed by this object. + */ + OFBool haveOverlayGroup(Uint16 group); + + /** gets the number of overlays in managed by this object. + * @return number of overlays in this list. + */ + size_t size() const { return list_.size(); } + + /** gets the overlay object with the given index. + * @param idx index of the overlay, must be < size(). + * @return pointer to overlay object or NULL. + */ + DVPSOverlay *getOverlay(size_t idx); + + /** removes the overlay object with the given index. + * @param idx index of the overlay, must be < size(). + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeOverlay(size_t idx); + + /** changes the repeating group used for an overlay. + * @param idx index of the overlay, must be < size(). + * @param newGroup new repeating group number 0x6000-0x601F (even) + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition changeOverlayGroup(size_t idx, Uint16 newGroup); + + /** adds a new overlay bitmap. + * The overlay is read from a DICOM dataset which must contain the + * attributes required for a graphic or ROI overlay, see class DVPSOverlay. + * The dataset can be an image or standalone overlay IOD. + * The overlay data is copied into the presentation state, i.e. the DICOM dataset + * can be deleted after execution of this method. + * @param overlayIOD the DICOM dataset from which the overlay is to be read + * @groupInItem the repeating group 0x6000..0x61F (even) of the overlay to be read + * @param newGroup repeating group number 0x6000-0x601F (even) to be used for + * the overlay in the presentation state. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition addOverlay(DcmItem& overlayIOD, Uint16 groupInItem, Uint16 newGroup); + + /** get overlay by group + * @param group overlay repeating group to be checked + * @return a pointer to the matching DVPSOverlay object if found, + * NULL otherwise. + */ + DVPSOverlay *getOverlayGroup(Uint16 group); + +private: + + /// private undefined assignment operator + DVPSOverlay_PList& operator=(const DVPSOverlay_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpspl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpspl.h new file mode 100644 index 00000000..f881196c --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpspl.h @@ -0,0 +1,248 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPresentationLUT + * + */ + +#ifndef DVPSPL_H +#define DVPSPL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrlo.h" + +struct T_DIMSE_Message; + +class DicomImage; +class DiLookupTable; +class DcmDataset; + +/** the representation of a Presentation LUT Content SQ item for Stored Print + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSPresentationLUT +{ +public: + /// default constructor + DVPSPresentationLUT(); + + /// copy constructor + DVPSPresentationLUT(const DVPSPresentationLUT& copy); + + /** clone method. + * @return a pointer to a new DVPSPresentationLUT object containing + * a copy of this object. + */ + DVPSPresentationLUT *clone() { return new DVPSPresentationLUT(*this); } + + /// destructor + virtual ~DVPSPresentationLUT(); + + /** resets the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** reads an Presentation LUT from a DICOM dataset. + * The DICOM elements of the referenced item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the PresentationLUTContentSequence from which the data is to be read + * @param withSOPInstance true if SOPinstanceUID should be read (when used with Stored Print). + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset, OFBool withSOPInstance); + + /** writes the Presentation LUT managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the PresentationLUTContentSequence to which the data is written + * @param withSOPInstance true if SOPinstanceUID should be written (when used with Stored Print). + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset, OFBool withSOPInstance); + + /** checks whether current presentation LUT is inverse, i.e. + * shape is INVERSE or first LUT entry larger than last LUT entry. + */ + OFBool isInverse(); + + /** gets the current Presentation LUT type. + * @return the current presentation LUT type + */ + DVPSPresentationLUTType getType() { return presentationLUT; } + + /** gets a description of the Presentation LUT in terms of + * its restrictions for use with a Print SCP that requires + * Presentation LUT number of entries to match the bit depth + * of the image pixel data. + * @return the current presentation LUT alignment type + */ + DVPSPrintPresentationLUTAlignment getAlignment(); + + /** checks if a real Presentation LUT (not shape) is available. + * @return OFTrue if this object contains + * a presentation LUT, no matter if it is activated or not. + * Returns OFFalse otherwise. + */ + OFBool haveTable(); + + /** gets a description of the current presentation LUT. + * For well-known presentation LUT shapes, a standard text + * is returned. For presentation LUTs, the LUT explanation + * is returned if it exists and a standard text otherwise. + * This method never returns NULL. + * @return a pointer to a string describing the current presentation LUT. + */ + const char *getCurrentExplanation(); + + /** returns the LUT explanation of the presentation LUT if it exists and is non-empty. + * Otherwise returns NULL. + * @return a string pointer + */ + const char *getLUTExplanation(); + + /** returns the SOP instance UID of the presentation LUT if present. + * Otherwise returns NULL. + * @return a string pointer + */ + const char *getSOPInstanceUID(); + + /** stores a presentation lookup table and activates it. + * The LUT is copied. If the method returns EC_Normal, + * any old presentation LUT is overwritten. + * If the method returns an error code, an old LUT is left unchanged. + * @param lutDescriptor the LUT Descriptor in DICOM format (VM=3) + * @param lutData the LUT Data in DICOM format + * @param lutExplanation the LUT Explanation in DICOM format, may be empty. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setLUT( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation); + + /** sets the current Presentation LUT type. + * DVPSP_table can only be used if the object + * contains a lookup table, i.e. if haveTable() returns OFTrue. + * @param newType the new presentation LUT type. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setType(DVPSPresentationLUTType newType); + + /** inverts presentation LUT or presentation state LUT shape. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition invert(); + + /** activates the current presentation transform in the given DicomImage. + * @param image the DicomImage for which the presentation transform is to be set. + * @param printLUT OFTrue if presentation LUT is activated for print bitmap rendering + * (in this case there is no implicit scaling of the input width of the LUT and, + * therefore, the VOI transformation - which is absent for print - is used), + * OFFalse otherwise (softcopy rendering, default) + * @return OFTrue if successful, OFFalse otherwise. + */ + OFBool activate(DicomImage *image, OFBool printLUT = OFFalse); + + /** activates the inverse LUT of the current presentation LUT (if any) in the given DicomImage. + * Presentation LUT shape is not supported by this method. + * @param image the DicomImage for which the inverse presentation LUT is to be set. + * @return OFTrue if successful, OFFalse otherwise. + */ + OFBool activateInverseLUT(DicomImage *image); + + /** creates a DiLookupTable instance from the LUT table + * managed by this object. The returned object must be freed by the caller. + * @return new DiLookupTable object, may be NULL if no LUT present. + */ + DiLookupTable *createDiLookupTable(); + + /** compares a DiLookupTable instance with the LUT table + * managed by this object. Returns OFTrue if equal, OFFalse otherwise. + * @param lut DiLookupTable object to compare with + * @return comparison, true if equal + */ + OFBool compareDiLookupTable(DiLookupTable *lut); + + /** sets the SOP instance UID. + * @param value new attribute value, must not be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setSOPInstanceUID(const char *value); + + /** checks whether the current Presentation LUT (or shape) is + * legal when used with Supplement 22. + * @return true if current Presentation LUT is legal for print. + */ + OFBool isLegalPrintPresentationLUT(); + + /** checks whether the current Presentation LUT (or shape) + * matches the current image bit depth in number of entries and first value mapped. + * @param is12bit true if the image is 12 bit, false if the image is 8 bit + * @return true if Presentation LUT matches, false otherwise. + */ + OFBool matchesImageDepth(OFBool is12bit); + + /** performs a Print SCP N-CREATE operation on a newly created instance of + * this class. The results of the operation are stored in the objects + * passed as rsp and rspDataset. + * @param rqDataset N-CREATE request dataset, may be NULL + * @param rsp N-CREATE response message + * @param rspDataset N-CREATE response dataset passed back in this parameter + * @param matchRequired boolean flag specifying whether the SCP should + * enforce a rule that all Presentation LUTs must match with the + * bit depth of the image pixel data. + * @param supports12Bit boolean flag specifying whether the SCP should + * allow 12 bit/pixel image data transmission. Affects handling of + * matching rule. + * @return OFTrue if operation was successful, OFFalse otherwise. + */ + OFBool printSCPCreate( + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool matchRequired, + OFBool supports12Bit); + +private: + /// private undefined assignment operator + DVPSPresentationLUT& operator=(const DVPSPresentationLUT&); + + /// describes active type of presentation LUT. + DVPSPresentationLUTType presentationLUT; + /// Module=Softcopy_Presentation_LUT, VR=xs, VM=3, Type 1c + DcmUnsignedShort presentationLUTDescriptor; + /// Module=Softcopy_Presentation_LUT, VR=LO, VM=1, Type 3 + DcmLongString presentationLUTExplanation; + /// Module=Softcopy_Presentation_LUT, VR=xs, VM=1-n, Type 1c + DcmUnsignedShort presentationLUTData; + + /// Module=Presentation_LUT_List, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier sOPInstanceUID; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpspll.h b/dcmpstat/include/dcmtk/dcmpstat/dvpspll.h new file mode 100644 index 00000000..2edef951 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpspll.h @@ -0,0 +1,135 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPresentationLUT_PList + * + */ + +#ifndef DVPSPLL_H +#define DVPSPLL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/dcmnet/dimse.h" + +class DVPSPresentationLUT; +class DVPSImageBoxContent_PList; + +/** the list of presentation LUTs contained in a stored print object. + * This class manages the data structures comprising one complete + * Presentation LUT Content Sequence. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSPresentationLUT_PList +{ +public: + /// default constructor + DVPSPresentationLUT_PList(); + + /// copy constructor + DVPSPresentationLUT_PList(const DVPSPresentationLUT_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSPresentationLUT_PList object containing + * a deep copy of this object. + */ + DVPSPresentationLUT_PList *clone() { return new DVPSPresentationLUT_PList(*this); } + + /// destructor + virtual ~DVPSPresentationLUT_PList(); + + /** reads a list of Presentation LUTs (Presentation LUT Content Sequence) from a DICOM dataset. + * The DICOM elements of the image references item are copied from the dataset to this object. + * The completeness of all items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the sequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of Presentation LUTs managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the ReferencedImageSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** gets the number of Presentation LUTs in this list. + * @return the number of Presentation LUTs. + */ + size_t size() const { return list_.size(); } + + /** finds a presentation LUT by its SOP instance UID. + * @param instanceUID SOP instance UID + * @return pointer to matching presentation LUT if found, NULL otherwise. + */ + DVPSPresentationLUT *findPresentationLUT(const char *instanceUID); + + /** removes all presentation LUT entries that are not + * referenced from the film box or image box level. + * @param filmBox Presentation LUT UID reference on film box level, may be NULL. + * @param imageBoxes list of image boxes + */ + void cleanup(const char *filmBox, DVPSImageBoxContent_PList& imageBoxes); + + /** adds a Presentation LUT to the list of managed LUTs. + * The referenced LUT is copied. If an identical LUT already exists, + * no duplicate is created. + * @param newLUT pointer to new Presentation LUT. May be NULL. + * @param inversePLUT true if presentation LUT is for Monochrome1 and must be inversed. + * @return UID of referenced Presentation LUT. May be NULL (if input was NULL). + */ + const char *addPresentationLUT(DVPSPresentationLUT *newLUT, OFBool inversePLUT); + + /** adds a Presentation LUT to the list of managed LUT. The LUT object becomes + * owned by this object and is destroyed upon destruction of the list. + * @param newLUT LUT to be added. + */ + void insert(DVPSPresentationLUT *newLUT) { if (newLUT) list_.push_back(newLUT); } + + /** performs a Print SCP Presentation LUT N-DELETE operation. + * The results of the N-DELETE operation are stored in the object passed as rsp. + * @param rq N-DELETE request message + * @param rsp N-DELETE response message + */ + void printSCPDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); + +private: + + /** private undefined assignment operator + */ + DVPSPresentationLUT_PList& operator=(const DVPSPresentationLUT_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpspr.h b/dcmpstat/include/dcmtk/dcmpstat/dvpspr.h new file mode 100644 index 00000000..7b92bd29 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpspr.h @@ -0,0 +1,291 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPrintMessageHandler + * + */ + +#ifndef DVPSPR_H +#define DVPSPR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmnet/dimse.h" + +/** pure abstract event handler class for N-EVENT-REPORT. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSPrintEventHandler +{ +public: + + /// destructor + virtual ~DVPSPrintEventHandler() {} + + /** handles an N-EVENT-REPORT-RQ message. This method is called + * from DVPSPrintMessageHandler whenever an event report is received. + * The event message, information and status detail elements must be copied + * if they should remain valid after the end of this method call. + * The event handler can react on the event message in any implementation + * dependent way, e.g. display the event on-screen. + * @param eventMessage the N-EVENT-REPORT-RQ message + * @param eventInformation event information dataset. May be NULL if no event information available. + * @param statusDetail status detail dataset. ay be NULL if no status detail available. + * @return the status code to be sent back as part of the N-EVENT-REPORT-RSP message, usually STATUS_Success. + */ + virtual DIC_US handleEvent( + T_DIMSE_N_EventReportRQ& eventMessage, + DcmDataset *eventInformation, + DcmDataset *statusDetail)=0; +}; + +/** representation of an association used for DICOM Basic Grayscale Print. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSPrintMessageHandler +{ +public: + /// default constructor + DVPSPrintMessageHandler(); + + /// destructor + virtual ~DVPSPrintMessageHandler(); + + /** sends an N-CREATE-RQ message and receives response. + * Any event report requests incoming before the expected response message are handled. + * @param sopclassUID the affected SOP class UID, must be one of the supported print classes. + * @param sopinstanceUID the affected SOP instance UID. May be empty in which case the + * UID is assigned by the SCP and returned in this parameter. + * @param attributeListIn the attribute list dataset, may be NULL. + * @param status the response message status code is passed back in this parameter + * if the method returns with success status. Content is undefined otherwise. + * @param attributeListOut a pointer to the attribute list returned by the SCP is passed back + * in this parameter if the method returns with success status. Content is undefined otherwise. + * May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, + * it must be deleted by the caller. + * @return DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise. + */ + OFCondition createRQ( + const char *sopclassUID, + OFString& sopinstanceUID, + DcmDataset *attributeListIn, + Uint16& status, + DcmDataset* &attributeListOut); + + /** sends an N-SET-RQ message and receives response. + * Any event report requests incoming before the expected response message are handled. + * @param sopclassUID the requested SOP class UID, must be one of the supported print classes. + * @param sopinstanceUID the requested SOP instance UID + * @param modificationList the modification list dataset, must not be NULL. + * @param status the response message status code is passed back in this parameter + * if the method returns with success status. Content is undefined otherwise. + * @param attributeListOut a pointer to the attribute list returned by the SCP is passed back + * in this parameter if the method returns with success status. Content is undefined otherwise. + * May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, + * it must be deleted by the caller. + * @return DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise. + */ + OFCondition setRQ( + const char *sopclassUID, + const char *sopinstanceUID, + DcmDataset *modificationList, + Uint16& status, + DcmDataset* &attributeListOut); + + /** sends an N-GET-RQ message and receives response. + * Any event report requests incoming before the expected response message are handled. + * @param sopclassUID the requested SOP class UID, must be one of the supported print classes. + * @param sopinstanceUID the requested SOP instance UID + * @param attributeIdentifierList the list of DICOM attributes to get, may be NULL. + * The attributes should be coded in pairs along the array (e.g. {g,e,g,e,g,e,...}). + * @param numShorts the number of Uint16 values in the array (not the number of pairs). + * @param status the response message status code is passed back in this parameter + * if the method returns with success status. Content is undefined otherwise. + * @param attributeListOut a pointer to the attribute list returned by the SCP is passed back + * in this parameter if the method returns with success status. Content is undefined otherwise. + * May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, + * it must be deleted by the caller. + * @return DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise. + */ + OFCondition getRQ( + const char *sopclassUID, + const char *sopinstanceUID, + const Uint16 *attributeIdentifierList, + size_t numShorts, + Uint16& status, + DcmDataset* &attributeListOut); + + /** sends an N-ACTION-RQ message and receives response. + * Any event report requests incoming before the expected response message are handled. + * @param sopclassUID the requested SOP class UID, must be one of the supported print classes. + * @param sopinstanceUID the requested SOP instance UID + * @param actionTypeID the action type ID + * @param actionInformation the action information dataset, may be NULL. + * @param status the response message status code is passed back in this parameter + * if the method returns with success status. Content is undefined otherwise. + * @param actionReply a pointer to the action reply dataset returned by the SCP is passed back + * in this parameter if the method returns with success status. Content is undefined otherwise. + * May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, + * it must be deleted by the caller. + * @return DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise. + */ + OFCondition actionRQ( + const char *sopclassUID, + const char *sopinstanceUID, + Uint16 actionTypeID, + DcmDataset *actionInformation, + Uint16& status, + DcmDataset* &actionReply); + + /** sends an N-DELETE-RQ message and receives response. + * Any event report requests incoming before the expected response message are handled. + * @param sopclassUID the requested SOP class UID, must be one of the supported print classes. + * @param sopinstanceUID the requested SOP instance UID + * @param status the response message status code is passed back in this parameter + * if the method returns with success status. Content is undefined otherwise. + * @return DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise. + */ + OFCondition deleteRQ( + const char *sopclassUID, + const char *sopinstanceUID, + Uint16& status); + + /** opens a DICOM association to a remote printer. + * The Basic Grayscale Print Management Meta SOP Class and Presentation LUT SOP Class + * are requested. The association is only accepted if the remote printer supports + * at least the Basic Grayscale Print Management Meta SOP Class. + * @param tlayer transport layer object, may be NULL. If present, a transport + * layer object for TLS transports is expected. + * @param myAEtitle the print client's own application entity title (calling aetitle) + * @param peerAEtitle the printer's called aetitle + * @param peerHost hostname/IP address of the printer + * @param peerPort port number of the printer + * @param peerMaxPDU maximum PDU size to negotiate, must be between 8192 and 65536. + * @param negotiatePresentationLUT if true, Presentation LUT SOP Class is negotiated + * @param negotiateAnnotationBox if true, Basic Annotation Box SOP Class is negotiated + * @param implicitOnly if true, only the default implicit VR transfer syntax is proposed, + * otherwise all uncompressed transfer syntaxes are proposed. + * @return status code that can be checked with the SUCCESS macro. If successful, an association + * is established. If unsuccessful, no association is established. + */ + OFCondition negotiateAssociation( + DcmTransportLayer *tlayer, + const char *myAEtitle, + const char *peerAEtitle, + const char *peerHost, + int peerPort, + long peerMaxPDU, + OFBool negotiatePresentationLUT, + OFBool negotiateAnnotationBox, + OFBool implicitOnly); + + /** releases the current association. + * @return ASC_NORMAL or ASC_RELEASECONFIRMED upon success, an error code otherwise. + */ + OFCondition releaseAssociation(); + + /** aborts the current association. + * @return a status code that can be checked with the SUCCESS() macro. + */ + OFCondition abortAssociation(); + + /** registers an event handler object for incoming N-EVENT-REPORTs. + * @param handler pointer to the new handler object. May be NULL. + */ + void setEventHandler(DVPSPrintEventHandler *handler) { eventHandler = handler; } + + /** sets the blocking and timeout mode for receive operations. + * @param blockMode blocking mode + * @param timeout + */ + void setTimeout(T_DIMSE_BlockingMode blocking, int timeOut) { blockMode=blocking; timeout=timeOut; } + + /** checks if the remote printer supports the Presentation LUT SOP class. + * May only be called if association in place. + * @return true if presentation context for presentation LUT exists, false otherwise. + */ + OFBool printerSupportsPresentationLUT(); + + /** checks if the remote printer supports the Basic Annotation Box SOP class. + * May only be called if association in place. + * @return true if presentation context for Basic Annotation Box exists, false otherwise. + */ + OFBool printerSupportsAnnotationBox(); + +private: + + /// private undefined copy constructor + DVPSPrintMessageHandler(const DVPSPrintMessageHandler& copy); + /// private undefined assignment operator + DVPSPrintMessageHandler& operator=(const DVPSPrintMessageHandler& copy); + + /** sends a DIMSE-N request (any type except N-EVENT-REPORT) and waits for a response. + * Any event report requests incoming before the expected DIMSE-N-RSP are handled. + * If an event handler is registered, it is called for each received event report request. + * @param presId presentation context ID + * @param request DIMSE-N request message to be sent. All fields except DataSetType must be filled in. + * @param rqDataSet DICOM dataset to be sent with the request message, e.g. N-Set modification list, + * N-Action action information, or N-Create attribute list. Not applicable to N-Get or N-Delete. + * @param response the received response is passed back in this parameter if the method returns + * with success status. Content is undefined otherwise. + * @param statusDetail the status detail dataset of the received response is passed back in this + * parameter if the method returns with success status. Content is undefined otherwise. + * @param rspDataset the received response dataset is passed back in this + * parameter if the method returns with success status. Content is undefined otherwise. + * @return DIMSE_NORMAL if successful, an error code otherwise. + */ + OFCondition sendNRequest( + T_ASC_PresentationContextID presId, + T_DIMSE_Message &request, + DcmDataset *rqDataSet, + T_DIMSE_Message &response, + DcmDataset* &statusDetail, + DcmDataset* &rspDataset); + + /** looks for an accepted presentation context for the given SOP class. + * If the SOP class is one of the Basic Grayscale Print Management Meta classes, + * looks for a presentation context for the meta SOP class. + * @param sopclassuid SOP Class UID for which a presentation context is searched + * @return presentation context if found, 0 otherwise. + */ + T_ASC_PresentationContextID findAcceptedPC(const char *sopclassuid); + + /** dumps the given message to the dump stream if it exists. + * @param msg message to be dumped, should be DIMSE-N + * @param dataset option dataset to be dumped, may be NULL + * @param outgoing OFTrue if message is outgoing, OFFalse if incoming. + */ + void dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing); + + /// the association to be used for message communication. Can be NULL. + T_ASC_Association *assoc; + + /// the network used for establishing associations. Can be NULL. + T_ASC_Network *net; + + /// the current event handler. Can be NULL. + DVPSPrintEventHandler *eventHandler; + + /// blocking mode for receive + T_DIMSE_BlockingMode blockMode; + + /// timeout for receive + int timeout; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsprt.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsprt.h new file mode 100644 index 00000000..e59adb0f --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsprt.h @@ -0,0 +1,313 @@ +/* + * + * Copyright (C) 2000-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPrintSCP + * + */ + + +#ifndef DVPSPRT_H +#define DVPSPRT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dvpspll.h" /* for class DVPSPresentationLUT_PList */ +#include "dcmtk/dcmpstat/dvpsspl.h" /* for class DVPSStoredPrint_PList */ +#include "dcmtk/dcmnet/assoc.h" +#include "dcmtk/dcmnet/dimse.h" + +class DVInterface; +class DVPSFilmSession; + +/** the representation of a Print Management SCP. This class implements most of the + * DIMSE behaviour of a DICOM Print SCP and uses Stored Print and Hardcopy Grayscale + * objects to store received print jobs in the local database. + */ +class DCMTK_DCMPSTAT_EXPORT DVPSPrintSCP +{ + public: + + /** constructor + * @param iface Interface to database and config file + * @param cfname symbolic name of print SCP in config file + */ + DVPSPrintSCP(DVInterface &iface, const char *cfname); + + /// destructor + virtual ~DVPSPrintSCP(); + + /** activates or deactivates dumping of the DIMSE communication + * in DICOM file format. This method should be called prior to + * association negotiation with negotiateAssociation(). + * @param fname full path name of the file into which a log + * of the DIMSE communication is written after association release. + * NULL disables the DICOM DIMSE dump completely. + */ + void setDimseLogPath(const char *fname); + + /** performs association negotiation for the Print SCP. Depending on the + * configuration file settings, Basic Grayscale Print and Presentation LUT + * are accepted with all uncompressed transfer syntaxes. + * If association negotiation is unsuccessful, an A-ASSOCIATE-RQ is sent + * and the association is dropped. If successful, an A-ASSOCIATE-AC is + * prepared but not (yet) sent. + * @param net DIMSE network over which to receive the association request + * @return result indicating whether association negotiation was successful, + * unsuccessful or whether termination of the server was requested. + */ + DVPSAssociationNegotiationResult negotiateAssociation(T_ASC_Network &net); + + /** confirms an association negotiated with negotiateAssociation() and handles + * all DIMSE communication for the Print SCP. Returns after the association + * has been released or aborted. + */ + void handleClient(); + +private: + + /// private undefined assignment operator + DVPSPrintSCP& operator=(const DVPSPrintSCP&); + + /// private undefined copy constructor + DVPSPrintSCP(const DVPSPrintSCP& copy); + + /** if the given condition indicates an error, prints the given string + * to the error log and returns true (nonzero), otherwise returns false. + * @param cond condition to be checked + * @param message to be printed, must not be NULL + * @return nonzero if cond indicates error, zero otherwise. + */ + int errorCond(OFCondition cond, const char *message); + + /** sends A-ASSOCIATION-RQ as the result of an unsuccesful association + * negotiation. + * @param isBadContext defines the reason for the A-ASSOCIATE-RQ. + * true indicates an incorrect application context, false sends back + * an unspecified reject with no reason and is used when termination + * of the server application has been initiated. + * @return ASC_NORMAL if successful, an error code otherwise. + */ + OFCondition refuseAssociation(OFBool isBadContext); + + /** destroys the association managed by this object. + */ + void dropAssociation(); + + /** handles any incoming N-GET-RQ message and sends back N-GET-RSP. + * @param rq request message + * @param presID presentation context over which the message was received + * @return DIMSE_NORMAL if successful, an error code otherwise + */ + OFCondition handleNGet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); + + /** handles any incoming N-SET-RQ message and sends back N-SET-RSP. + * @param rq request message + * @param presID presentation context over which the message was received + * @return DIMSE_NORMAL if successful, an error code otherwise + */ + OFCondition handleNSet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); + + /** handles any incoming N-ACTION-RQ message and sends back N-ACTION-RSP. + * @param rq request message + * @param presID presentation context over which the message was received + * @return DIMSE_NORMAL if successful, an error code otherwise + */ + OFCondition handleNAction(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); + + /** handles any incoming N-CREATE-RQ message and sends back N-CREATE-RSP. + * @param rq request message + * @param presID presentation context over which the message was received + * @return DIMSE_NORMAL if successful, an error code otherwise + */ + OFCondition handleNCreate(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); + + /** handles any incoming N-DELETE-RQ message and sends back N-DELETE-RSP. + * @param rq request message + * @param presID presentation context over which the message was received + * @return DIMSE_NORMAL if successful, an error code otherwise + */ + OFCondition handleNDelete(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); + + /** handles any incoming C-ECHO-RQ message and sends back C-ECHO-RSP. + * @param rq request message + * @param presID presentation context over which the message was received + * @return DIMSE_NORMAL if successful, an error code otherwise + */ + OFCondition handleCEcho(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); + + /** implements the N-GET operation for the Printer SOP Class. + * @param rq request message + * @param rsp response message, already initialized + * @param rspDataset response dataset passed back in this parameter (if any) + */ + void printerNGet(T_DIMSE_Message& rq, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); + + /** implements the N-SET operation for the Basic Film Session SOP Class. + * @param rq request message + * @param rqDataset request dataset, may be NULL + * @param rsp response message, already initialized + * @param rspDataset response dataset passed back in this parameter (if any) + */ + void filmSessionNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); + + /** implements the N-SET operation for the Basic Film Box SOP Class. + * @param rq request message + * @param rqDataset request dataset, may be NULL + * @param rsp response message, already initialized + * @param rspDataset response dataset passed back in this parameter (if any) + */ + void filmBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); + + /** implements the N-SET operation for the Basic Grayscale Image Box SOP Class. + * @param rq request message + * @param rqDataset request dataset, may be NULL + * @param rsp response message, already initialized + * @param rspDataset response dataset passed back in this parameter (if any) + */ + void imageBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); + + /** implements the N-ACTION operation for the Basic Film Session SOP Class. + * @param rq request message + * @param rsp response message, already initialized + */ + void filmSessionNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); + + /** implements the N-ACTION operation for the Basic Film Box SOP Class. + * @param rq request message + * @param rsp response message, already initialized + */ + void filmBoxNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); + + /** implements the N-CREATE operation for the Basic Film Session SOP Class. + * @param rqDataset request dataset, may be NULL + * @param rsp response message, already initialized + * @param rspDataset response dataset passed back in this parameter (if any) + */ + void filmSessionNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); + + /** implements the N-CREATE operation for the Basic Film Box SOP Class. + * @param rqDataset request dataset, may be NULL + * @param rsp response message, already initialized + * @param rspDataset response dataset passed back in this parameter (if any) + */ + void filmBoxNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); + + /** implements the N-CREATE operation for the Presentation LUT SOP Class. + * @param rqDataset request dataset, may be NULL + * @param rsp response message, already initialized + * @param rspDataset response dataset passed back in this parameter (if any) + */ + void presentationLUTNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); + + /** implements the N-DELETE operation for the Basic Film Session SOP Class. + * @param rq request message + * @param rsp response message, already initialized + */ + void filmSessionNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); + + /** implements the N-DELETE operation for the Basic Film Box SOP Class. + * @param rq request message + * @param rsp response message, already initialized + */ + void filmBoxNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); + + /** implements the N-DELETE operation for the Presentation LUT SOP Class. + * @param rq request message + * @param rsp response message, already initialized + */ + void presentationLUTNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); + + /** stores the binary log of the DIMSE communication in a DICOM file + * in the log directory. Called upon association release or abort. + */ + void saveDimseLog(); + + /** adds an item to the given sequence containing the current date, time + * and the given text. + * @param seq sequence to which the item is added + * @param text text to be added, must not be NULL + */ + static void addLogEntry(DcmSequenceOfItems *seq, const char *text); + + /** prints a dump of the given DIMSE message to the log stream. + * @param msg DIMSE message to be dumped + * @param dataset dataset to be dumped, may be NULL + * @param outgoing flag defining whether we are dumping an outgoing or an + * incoming message. + */ + void dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing); + + + /* class data */ + + /* Interface to database and config file + */ + DVInterface& dviface; + + /* symbolic name of print SCP in config file, not NULL. + */ + const char *cfgname; + + /** blocking mode for receive + */ + T_DIMSE_BlockingMode blockMode; + + /** timeout for receive + */ + int timeout; + + /** basic film session instance + */ + DVPSFilmSession *filmSession; + + /* Presentation LUT List + */ + DVPSPresentationLUT_PList presentationLUTList; + + /* Stored Print List (contains Basic Film Boxes plus hierarchy) + */ + DVPSStoredPrint_PList storedPrintList; + + /* the network association over which the print SCP is operating + */ + T_ASC_Association *assoc; + + /// study UID for stored print and hardcopy images of one print session + DcmUniqueIdentifier studyInstanceUID; + + /// series UID for presentation state objects + DcmUniqueIdentifier psSeriesInstanceUID; + + /// series UID for hardcopy image objects + DcmUniqueIdentifier imageSeriesInstanceUID; + + /// DIMSE communication logged in this object if present + DcmSequenceOfItems *logSequence; + + /// ACSE communication logged in this object if present + DcmSequenceOfItems *acseSequence; + + /// full path of the file into which the DIMSE log is written + OFString logPath; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsri.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsri.h new file mode 100644 index 00000000..0faa4401 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsri.h @@ -0,0 +1,173 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSReferencedImage + * + */ + +#ifndef DVPSRI_H +#define DVPSRI_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvris.h" + +/** an item of the referenced image sequence in a presentation state (internal use only). + * This class manages the data structures comprising one item + * of the Reference Image Sequence which is contained + * in the Referenced Series Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSReferencedImage +{ +public: + /// default constructor + DVPSReferencedImage(); + + /// copy constructor + DVPSReferencedImage(const DVPSReferencedImage& copy); + + /** clone method. + * @return a pointer to a new DVPSReferencedImage object containing + * a copy of this object. + */ + DVPSReferencedImage *clone() { return new DVPSReferencedImage(*this); } + + /// destructor + virtual ~DVPSReferencedImage(); + + /** reads an image reference from a DICOM dataset. + * The DICOM elements of the referenced image item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the ReferencedImageSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the image reference managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the ReferencedImageSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** check if the passed SOP Class UID is equal to the one stored in this object. + * If sopclassuid is empty, the referencedSOPClassUID is assigned to it and the method returns + * OFTrue. Otherwise the passed UID is compared with the referencedSOPClassUID. + * OFTrue is returned if they are equal, OFFalse otherwise. + * This method is used to check whether all image references in a presentation state + * share the same SOP Class UID. + * @param sopclassuid the SOP class UID to be validated + * @return OFTrue if successful, OFFalse if unsuccessful. + */ + OFBool validateSOPClassUID(OFString& sopclassuid); + + /** set SOP Class UID of this image reference. + * @param uid a pointer to the UID, which is copied into this object. + */ + void setSOPClassUID(const char *uid); + + /** set SOP Instance UID of this image reference. + * @param uid a pointer to the UID, which is copied into this object. + */ + void setSOPInstanceUID(const char *uid); + + /** set the list of frame numbers of this image reference. + * @param frames a list of frame numbers in DICOM IS format + * (integer numbers separated by '\' characters) + */ + void setFrameNumbers(const char *frames); + + /** compare SOP Instance UID. + * @param uid the UID to be compared + * @return OFTrue if the referencedSOPInstanceUID of this object is + * equal to uid, OFFalse otherwise. + */ + OFBool isSOPInstanceUID(const char *uid); + + /** gets the image reference managed by this object. + * @param sopclassUID the SOP Class UID is returned in this string + * @param instanceUID the SOP Instance UID is returned in this string + * @param frames the list of frames is returned in this string + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference( + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames); + + /** checks whether this image reference applies to the given frame number. + * An image reference applies to a frame if the frame number is explicitly + * listed in the referencedFrameNumber attribute or if the referencedFrameNumber + * is empty. + * @param frame frame number to be checked + * @return OFTrue if the image reference applies to the given frame number, OFFalse otherwise. + */ + OFBool appliesToFrame(unsigned long frame); + + /** checks whether this image reference applies exactly to the given frame number. + * This is the case if the referencedFrameNumber only contains the given frame number. + * @param frame frame number to be checked + * @return OFTrue if the image reference applies only to the given frame number, OFFalse otherwise. + */ + OFBool appliesOnlyToFrame(unsigned long frame); + + /** checks whether this image reference applies all frames + * because the referencedFrameNumber is empty. + * @return OFTrue if the image reference applies to all frames, OFFalse otherwise. + */ + OFBool appliesToAllFrames(); + + /** update the reference such that the given frame is not referenced any more. + * @param frame the frame reference + * @param numberOfFrames the number of frames of the image reference + */ + void removeFrameReference(unsigned long frame, unsigned long numberOfFrames); + +private: + + /** undefined private assignment operator + */ + DVPSReferencedImage& operator=(const DVPSReferencedImage& source); + + /** flushes the frame cache. + */ + void flushCache(); + /** updated the frame cache. + */ + void updateCache(); + + /// VR=UI, VM=1, Type 1c + DcmUniqueIdentifier referencedSOPClassUID; + /// VR=UI, VM=1, Type 1c + DcmUniqueIdentifier referencedSOPInstanceUID; + /// VR=IS, VM=1-n, Type 1c + DcmIntegerString referencedFrameNumber; + /// if exists, contains binary representation of referencedFrameNumber + Sint32 *frameCache; + /// describes array size of frameCache + unsigned long frameCacheEntries; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsril.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsril.h new file mode 100644 index 00000000..d62e69bb --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsril.h @@ -0,0 +1,208 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSReferencedImage_PList + * + */ + +#ifndef DVPSRIL_H +#define DVPSRIL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSReferencedImage; +class DVPSReferencedSeries_PList; + +/** the list of referenced images contained in a presentation state (internal use only). + * This class manages the data structures comprising one complete + * Reference Image Sequence which is contained in one item + * of the Referenced Series Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSReferencedImage_PList +{ +public: + /// default constructor + DVPSReferencedImage_PList(); + + /// copy constructor + DVPSReferencedImage_PList(const DVPSReferencedImage_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSReferencedImage_PList object containing + * a deep copy of this object. + */ + DVPSReferencedImage_PList *clone() { return new DVPSReferencedImage_PList(*this); } + + /// destructor + virtual ~DVPSReferencedImage_PList(); + + /** reads a list of image references (ReferencedImageSequence) from a DICOM dataset. + * The DICOM elements of the image references item are copied from the dataset to this object. + * The completeness of all items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the sequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of image references managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the ReferencedImageSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** checks if images are referenced within this ReferencedImageSequence + * and whether all images share the same SOP class UID. + * @param sopclassuid should be an empty string when called. + * Returns the SOP class UID of the images in the list. + * @return OFTrue if the sequence is valid (correct), OFFalse otherwise. + */ + OFBool isValid(OFString& sopclassuid); + + /** checks if an image reference with the given SOP instance UID exists + * in this ReferencedImageSequence. + * @param sopinstanceuid the SOP instance UID of the searched image reference + * @return a pointer to the matching DVPSReferencedImage if found, NULL otherwise. + */ + DVPSReferencedImage *findImageReference(const char *sopinstanceuid); + + /** update the reference to the given image such that + * the given frame is not referenced any more. + * @param sopinstanceuid the SOP instance UID of the image reference + * @param frame the frame reference + * @param numberOfFrames the number of frames of the image reference + */ + void removeFrameReference(const char *sopinstanceuid, unsigned long frame, unsigned long numberOfFrames); + + /** checks if an image reference with the given SOP instance UID exists + * in this ReferencedImageSequence and deletes it. + * @param sopinstanceuid the SOP instance UID of the image reference to be removed. + */ + void removeImageReference(const char *sopinstanceuid); + + /** add a new image reference. + * Checks if the referenced SOP instance UID already exists in this sequence. + * If it exists, an error code is returned. Otherwise a new image reference + * is created and added to the ReferencedImageSequence. + * @param sopclassUID the SOP class UID of the image reference to be added. + * @param instanceUID the SOP instance UID of the image reference to be added. + * @param frames a list of frame numbers in DICOM IS format + * (integer numbers separated by '\' characters). Default: frame numbers absent. + * The frame numbers are required if the referenced image is a multiframe image. + */ + OFCondition addImageReference( + const char *sopclassUID, + const char *instanceUID, + const char *frames=NULL); + + /** add a new image reference. + * Checks if the referenced SOP instance UID already exists in this sequence. + * If it exists, an error code is returned. Otherwise a new image reference + * is created and added to the ReferencedImageSequence. + * @param sopclassUID the SOP class UID of the image reference to be added. + * @param instanceUID the SOP instance UID of the image reference to be added. + * @param frame the frame number of the image reference (current image) to be added. + * @param applicability the applicability of the image reference (DVPSB_currentFrame or DVPSB_currentImage) + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability); + + /** removes a reference to an image or frame. If the current reference is empty ("global"), an + * explicit list of references is constructed from the list of series/instance references. + * The image or frame reference is removed from the total list of references in this object. + * If the only reference contained in this object is removed, the reference list becomes empty + * which means that the current reference becomes "global". This case must be handled by the caller. + * @param allReferences list of series/instance references registered for the presentation state. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param numberOfFrames the number of frames of the current image + * @param applicability the applicability of the image reference to be removed + * (DVPSB_currentFrame or DVPSB_currentImage) + */ + void removeImageReference( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability); + + /** gets the number of image references in this list. + * @return the number of image references. + */ + size_t size() const { return list_.size(); } + + /** gets an image reference with the given index. + * @param idx index, must be < size(). + * @param sopclassUID the SOP Class UID is returned in this string + * @param instanceUID the SOP Instance UID is returned in this string + * @param frames the list of frames is returned in this string + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference( + size_t idx, + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames); + + /** checks if the object containing this list of image references + * is applicable to the given image and frame. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return OFTrue if applicable. + */ + OFBool isApplicable(const char *instanceUID, unsigned long frame); + + /** checks if the object containing this list of image references + * matches exactly the applicability + * defined by the instanceUID, frame and applicability parameters. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return OFTrue if matching. + */ + OFBool matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability); + +private: + + /// private undefined assignment operator + DVPSReferencedImage_PList& operator=(const DVPSReferencedImage_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsrs.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsrs.h new file mode 100644 index 00000000..dd464fd1 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsrs.h @@ -0,0 +1,195 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSReferencedSeries + * + */ + +#ifndef DVPSRS_H +#define DVPSRS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsril.h" /* for DVPSReferencedImage_PList */ +#include "dcmtk/dcmdata/dcvrae.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcvrui.h" + +/** an item of the referenced series sequence in a presentation state (internal use only). + * This class manages the data structures comprising one item + * of the Referenced Series Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSReferencedSeries +{ +public: + /// default constructor + DVPSReferencedSeries(); + + /// copy constructor + DVPSReferencedSeries(const DVPSReferencedSeries& copy); + + /** clone method. + * @return a pointer to a new DVPSReferencedSeries object containing + * a deep copy of this object. + */ + DVPSReferencedSeries *clone() { return new DVPSReferencedSeries(*this); } + + /// destructor + virtual ~DVPSReferencedSeries(); + + /** reads an series reference from a DICOM dataset. + * The DICOM elements of the referenced series item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the ReferencedSeriesSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the series reference managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the ReferencedSeriesSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** check if the passed SOP Class UID is equal to the ones stored in this object. + * This method checks whether this object contains at least one image reference + * and whether all image references use the same SOP class UID as the one passed. + * If sopclassuid is empty, the referencedSOPClassUID of the first image reference + * is assigned to it. + * @param sopclassuid the SOP class UID to be validated + * @return OFTrue if successful, OFFalse if unsuccessful. + */ + OFBool isValid(OFString& sopclassuid); + + /** compare SOP Instance UID. + * @param uid the UID to be compared + * @return OFTrue if the SeriesInstanceUID of this object is + * equal to uid, OFFalse otherwise. + */ + OFBool isSeriesUID(const char *uid); + + + /** checks if an image reference with the given SOP instance UID exists + * in the ReferencedImageSequence of this series reference. + * @param sopinstanceuid the SOP instance UID of the searched image reference + * @return a pointer to the matching DVPSReferencedImage if found, NULL otherwise. + */ + DVPSReferencedImage *findImageReference(const char *sopinstanceuid); + + /** remove image reference from this series reference if present. + * If an image reference with a SOP instance UID corresponding to the + * passed UID is found, it is removed from this series reference. + * @param uid a pointer to the image SOP instance UID. + */ + void removeImageReference(const char *sopinstanceuid); + + /** set Series Instance UID of this series reference. + * @param uid a pointer to the UID, which is copied into this object. + */ + void setSeriesInstanceUID(const char *uid); + + /** set the optional retrieve location for this series reference. + * @param aetitle the retrieveAETitle, must be a valid DICOM 'AE' value. Default: value absent. + * @param filesetID the storageMediaFileSetID, must be a valid DICOM 'SH' value. Default: value absent. + * @param filesetUID the storageMediaFileSetUID, must be a valid DICOM UID. Default: value absent. + */ + void setRetrieveLocation(const char *aetitle=NULL, const char *filesetID=NULL, const char *filesetUID=NULL); + + /** gets the retrieveAETitle for this series reference. + * @return retrieveAETitle if present, NULL otherwise. + */ + const char *getRetrieveAETitle(); + + /** gets the storageMediaFileSetID for this series reference. + * @return storageMediaFileSetID if present, NULL otherwise. + */ + const char *getStorageMediaFileSetID(); + + /** gets the storageMediaFileSetUID for this series reference. + * @return storageMediaFileSetUID if present, NULL otherwise. + */ + const char *getStorageMediaFileSetUID(); + + /** add image reference to this series reference. + * A new image reference for this series is created. + * The image SOP instance UID must be unique (must not yet exist + * as a reference in this series), otherwise an error code is returned. + * @param sopclassUID a pointer to the Image SOP Class UID, which is copied into + * the new image reference + * @param instanceUID a pointer to the Image SOP Instance UID, which is copied into + * the new image reference + * @param frames a list of frame numbers in DICOM IS format + * (integer numbers separated by '\' characters). Default: frame numbers absent. + * The frame numbers are required if the referenced image is a multiframe image. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + const char *sopclassUID, + const char *instanceUID, + const char *frames=NULL); + + /** gets the number of image references in this object. + * @return the number of image references. + */ + size_t numberOfImageReferences() const { return referencedImageList.size(); } + + /** gets an image reference with the given index. + * @param idx index, must be < numberOfImageReferences(). + * @param seriesUID the Series Instance UID is returned in this string + * @param sopclassUID the SOP Class UID is returned in this string + * @param instanceUID the SOP Instance UID is returned in this string + * @param frames the list of frames is returned in this string + * @param aetitle the series retrieveAETitle is returned in this string + * @param filesetID the series storageMediaFileSetID is returned in this string + * @param filesetUID the series storageMediaFileSetUID is returned in this string + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference( + size_t idx, + OFString& seriesUID, + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames, + OFString& aetitle, + OFString& filesetID, + OFString& filesetUID); + +private: + + /// private undefined assignment operator + DVPSReferencedSeries& operator=(const DVPSReferencedSeries&); + + /// Referenced Image Sequence + DVPSReferencedImage_PList referencedImageList; + /// VR=UI, VM=1, Type 1c + DcmUniqueIdentifier seriesInstanceUID; + /// VR=AE, VM=1, Type 3 + DcmApplicationEntity retrieveAETitle; + /// VR=SH, VM=1, Type 3 + DcmShortString storageMediaFileSetID; + /// VR=UI, VM=1, Type 3 + DcmUniqueIdentifier storageMediaFileSetUID; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsrsl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsrsl.h new file mode 100644 index 00000000..9c86b85b --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsrsl.h @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSReferencedSeries_PList + * + */ + +#ifndef DVPSRSL_H +#define DVPSRSL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcitem.h" + + +class DVPSReferencedSeries; +class DVPSReferencedImage; + +/** the list of referenced series contained in a presentation state (internal use only). + * This class manages the data structures comprising the complete + * Referenced Series Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSReferencedSeries_PList +{ +public: + /// default constructor + DVPSReferencedSeries_PList(); + + /// copy constructor + DVPSReferencedSeries_PList(const DVPSReferencedSeries_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSReferencedSeries_PList object containing + * a deep copy of this object. + */ + DVPSReferencedSeries_PList *clone() { return new DVPSReferencedSeries_PList(*this); } + + /// destructor + virtual ~DVPSReferencedSeries_PList(); + + /** reads a list of series references (ReferencedSeriesSequence) from a DICOM dataset. + * The DICOM elements of the image references item are copied from the dataset to this object. + * The completeness of all items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the sequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of series references managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the ReferencedSeriesSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** checks whether at least one series is referenced, whether all referenced + * series contain image references and whether all references images use the same + * SOP class. + */ + OFBool isValid(); + + /** checks whether all images referenced in this series use the passed SOP class UID. + * @param uid the SOP class UID to be checked + * @return result of the test + */ + OFBool checkSOPClass(const char *uid); + + /** find series reference in this list. + * This method checks if a series reference with the given Series Instance UID exists + * in this ReferencedSeriesSequence. + * @param seriesUID the Series Instance UID of the searched series reference + * @return a pointer to the matching DVPSReferencedSeries if found, NULL otherwise. + */ + DVPSReferencedSeries *findSeriesReference(const char *seriesUID); + + /** find image reference in this list. + * This method checks if an image reference with the given Series Instance UID and + * SOP instance UID exists in this ReferencedImageSequence. + * @param seriesUID the Series Instance UID of the searched image reference + * @param instanceUID the SOP Instance UID of the searched image reference + * @return a pointer to the matching DVPSReferencedImage if found, NULL otherwise. + */ + DVPSReferencedImage *findImageReference(const char *seriesUID, const char *instanceUID); + + /** removes series reference. + * This method checks if an series reference with the given Series Instance UID exists + * in this ReferencedSeriesSequence and deletes it (including its image references). + * @param seriesUID the Series Instance UID of the series reference to be removed. + */ + void removeSeriesReference(const char *seriesUID); + + /** removes image reference. + * This method checks if an image reference with the given SOP instance UID exists + * in the series with the given Series Instance UID and deletes it. + * @param seriesUID the Series Instance UID of the image reference to be removed. + * @param instanceUID the SOP instance UID of the image reference to be removed. + */ + void removeImageReference(const char *seriesUID, const char *instanceUID); + + /** add new image reference. + * This method checks if the given SOP class matches the SOP class of all + * other existing image references and whether the image reference exists. + * In this case an error code is returned. Otherwise a new image reference + * (in a new series if necessary) is created. + * @param seriesUID the Series Instance UID of the image reference to be added. + * @param sopclassUID the SOP class UID of the image reference to be added. + * @param instanceUID the SOP instance UID of the image reference to be added. + * @param frames a list of frame numbers in DICOM IS format + * (integer numbers separated by '\' characters). Default: frame numbers absent. + * The frame numbers are required if the referenced image is a multiframe image. + * @param aetitle the series retrieveAETitle. Default: value absent. + * @param filesetID the series storageMediaFileSetID. Default: value absent. + * @param filesetUID the series storageMediaFileSetUID. Default: value absent. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + const char *seriesUID, + const char *sopclassUID, + const char *instanceUID, + const char *frames=NULL, + const char *aetitle=NULL, + const char *filesetID=NULL, + const char *filesetUID=NULL); + + /** gets the number of image references in all series managed by this list. + * @return number of image references + */ + size_t numberOfImageReferences(); + + /** gets an image reference with the given index. + * @param idx index, must be < numberOfImageReferences(). + * @param seriesUID the Series Instance UID is returned in this string + * @param sopclassUID the SOP Class UID is returned in this string + * @param instanceUID the SOP Instance UID is returned in this string + * @param frames the list of frames is returned in this string + * @param aetitle the series retrieveAETitle is returned in this string + * @param filesetID the series storageMediaFileSetID is returned in this string + * @param filesetUID the series storageMediaFileSetUID is returned in this string + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference( + size_t idx, + OFString& seriesUID, + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames, + OFString& aetitle, + OFString& filesetID, + OFString& filesetUID); + +private: + + /// private undefined assignment operator + DVPSReferencedSeries_PList& operator=(const DVPSReferencedSeries_PList&); + + /** the list maintained by this object + */ + OFList list_; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpssp.h b/dcmpstat/include/dcmtk/dcmpstat/dvpssp.h new file mode 100644 index 00000000..62e7e2b1 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpssp.h @@ -0,0 +1,1117 @@ +/* + * + * Copyright (C) 1999-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSStoredPrint + * + */ + + +#ifndef DVPSSP_H +#define DVPSSP_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmpstat/dvpspll.h" /* for class DVPSPresentationLUT_PList */ +#include "dcmtk/dcmpstat/dvpsibl.h" /* for class DVPSImageBoxContent_PList */ +#include "dcmtk/dcmpstat/dvpsabl.h" /* for class DVPSAnnotationContent_PList */ +#include "dcmtk/dcmpstat/dvpstat.h" /* for class DVPresentationState */ +#include "dcmtk/dcmpstat/dvpspr.h" /* for class DVPrintMessageHandler */ + +class DicomImage; +class DVPSPresentationLUT; +class DVConfiguration; +/** the representation of a Stored Print object + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSStoredPrint +{ + public: + /** constructor + * @param illumin default Illumination setting + * @param reflection default Reflected Ambient Light setting + * @param aetitle application entity title of the print originator (SCU) + */ + DVPSStoredPrint(Uint16 illumin, Uint16 reflection, const char *aetitle = NULL); + + /// copy constructor + DVPSStoredPrint(const DVPSStoredPrint& copy); + + /** clone method. + * @return a pointer to a new DVPSStoredPrint object containing + * a copy of this object. + */ + DVPSStoredPrint *clone() { return new DVPSStoredPrint(*this); } + + /// destructor + virtual ~DVPSStoredPrint(); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** reads a Stored Print object from a DICOM dataset. + * The DICOM elements of the stored print object are copied + * from the dataset to this object. + * The completeness of the object (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the Stored Print object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the data is written + * @param writeRequestedImageSize if false, the Requested Image Size attributes are not written, + * e. g. because they are not supported by the target printer. + * @param limitImages if true, only the number of image references + * that are needed for the current image display format (film layout) are written. + * If false, all image references are written. + * @param updateDecimateCrop if true, the decimate/crop attribute on image box level + * is replaced by the global stored print level setting in all image boxes + * prior to writing the dataset. + * @param ignoreEmptyImages if true, all image boxes without image box position are ignored + * when writing. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write( + DcmItem &dset, + OFBool writeRequestedImageSize, + OFBool limitImages, + OFBool updateDecimateCrop, + OFBool ignoreEmptyImages); + + /** sets the name of the current printer. + * This name is identical to the unique entry used in the configuration file. + * @return name of the current printer + */ + OFCondition setOriginator(const char *aetitle); + + /** sets the application entity title of the print SCU. + * @return application entity title of the print SCU + */ + OFCondition setDestination(const char *aetitle); + + /** sets the application entity title of the print SCP. + * @return application entity title of the print SCP + */ + OFCondition setPrinterName(const char *name); + + /** sets the image display format to 'STANDARD\columns,rows'. + * The caller must make sure that the column and row values are + * valid for the selected printer. + * @param columns number of columns + * @param rows number of rows + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageDisplayFormat(unsigned long columns, unsigned long rows); + + /** sets the (optional) film size ID. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setFilmSizeID(const char *value); + + /** sets the (optional) magnification type. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setMagnificationType(const char *value); + + /** sets the (optional) smoothing type. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setSmoothingType(const char *value); + + /** sets the (optional) configuration information. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setConfigurationInformation(const char *value); + + /** sets the (optional) requested resolution ID. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setResolutionID(const char *value); + + /** sets the (optional) film orientation. + * @param value new enumerated value. The caller is responsible for + * making sure that the selected printer supports film orientation + * if a non-default value is set. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setFilmOrientation(DVPSFilmOrientation value); + + /** sets the (optional) trim (printing of borders). + * @param value new enumerated value. The caller is responsible for + * making sure that the selected printer supports trim + * if a non-default value is set. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setTrim(DVPSTrimMode value); + + /** sets the (optional) requested decimate/crop behaviour + * for all image boxes managed by this stored print object. + * @param value new enumerated value. The caller is responsible for + * making sure that the selected printer supports decimate/crop + * if a non-default value is set. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setRequestedDecimateCropBehaviour(DVPSDecimateCropBehaviour value); + + /** sets the (optional) border density. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setBorderDensity(const char *value); + + /** sets the (optional) empty image density. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setEmtpyImageDensity(const char *value); + + /** sets the (optional) max density. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setMaxDensity(const char *value); + + /** sets the (optional) min density. + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setMinDensity(const char *value); + + /** deletes all optional attribute values that might not be + * supported by all printers. Film size ID, magnification and smoothing type, + * configuration information, requested resolution ID, + * trim and requested decimate/crop behaviour, border and empty image density + * are reset to default. For all registered images, magnification, smoothing type + * and configuration information are also set back to default. + * @param name name of the new printer (optional) + * @param aetitle of the new printer (optional) + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition newPrinter(const char *name = NULL, const char *destinationAE = NULL); // short cut, delete all optional settings + + /** gets the the application entity title of the print SCU. + * @return application entity title of the print SCP + */ + const char *getOriginator(); + /** gets the the application entity title of the print SCP. + * @return application entity title of the print SCP + */ + const char *getDestination(); + /** gets the name of the current printer. + * @return name of the current printer + */ + const char *getPrinterName(); + + /** gets the number of columns of the current image display format. + * @return number of columns. + */ + unsigned long getImageDisplayFormatColumns(); + + /** gets the number of rows of the current image display format. + * @return number of rows. + */ + unsigned long getImageDisplayFormatRows(); + + /** gets the current film orientation. + * @return film orientation. + */ + DVPSFilmOrientation getFilmOrientation(); + + /** gets the current trim mode. + * @return trim mode. + */ + DVPSTrimMode getTrim(); + + /** gets the current requested decimate/crop behaviour setting + * that is used for all image boxes managed by this object. + * @return requested decimate/crop behaviour + */ + DVPSDecimateCropBehaviour getRequestedDecimateCropBehaviour() + { + return decimateCropBehaviour; + } + + /** gets the Study Instance UID. + * @return Study Instance UID, may be NULL. + */ + const char *getStudyInstanceUID(); + + /** gets the Series Instance UID. + * @return Series Instance UID, may be NULL. + */ + const char *getSeriesInstanceUID(); + + /** gets the SOP Instance UID. + * @return SOP Instance UID, may be NULL. + */ + const char *getSOPInstanceUID(); + + /** gets the (optional) film size ID. + * @return film size ID, may be NULL. + */ + const char *getFilmSizeID(); + + /** gets the (optional) magnification type. + * @return magnification type, may be NULL. + */ + const char *getMagnificationType(); + + /** gets the (optional) smoothing type. + * @return smoothing type, may be NULL. + */ + const char *getSmoothingType(); + + /** gets the (optional) configuration information. + * @return configuration information, may be NULL. + */ + const char *getConfigurationInformation(); + + /** gets the (optional) requestes resolution ID + * @return requested resolution ID, may be NULL. + */ + const char *getResolutionID(); + + /** gets the (optional) border density. + * @return border density, may be NULL. + */ + const char *getBorderDensity(); + + /** gets the (optional) empty image density. + * @return empty image density, may be NULL. + */ + const char *getEmtpyImageDensity(); + + /** gets the (optional) max density. + * The string returned becomes invalid after the next + * call to getMaxDensity or getMinDensity. + * @return max density, may be NULL. + */ + const char *getMaxDensity(); + + /** gets the (optional) min density. + * The string returned becomes invalid after the next + * call to getMaxDensity or getMinDensity. + * @return min density, may be NULL. + */ + const char *getMinDensity(); + + /** gets the (optional) max density. + * @return max density (default: 300). + */ + Uint16 getMaxDensityValue(); + + /** gets the (optional) min density. + * @return min density (default: 20). + */ + Uint16 getMinDensityValue(); + + /** gets the number of images currently registered in this object. + * @return number of images. + */ + size_t getNumberOfImages() + { + return imageBoxContentList.size(); + } + + /** gets the number of annotations currently registered in this object. + * @return number of annotations. + */ + size_t getNumberOfAnnotations() + { + return annotationContentList.size(); + } + + /** deletes one of the registered images. + * @param idx index, must be < getNumberOfImages() + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition deleteImage(size_t idx); + + /** deletes multiple of the registered + * images, starting with the first one. + * @param number number of images to delete, must be <= getNumberOfImages() + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition deleteMultipleImages(size_t number); + + /** deletes as many images as fit on the current page according + * to the image display format settings. Used to remove images + * from the queue after a print job with one film box has been + * spooled. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition deleteSpooledImages(); + + /** checks if one of the registered images has additional settings that are not + * default values on the image box level. + * @param idx index, must be < getNumberOfImages() + * @return EC_Normal if successful, an error code otherwise. + */ + OFBool imageHasAdditionalSettings(size_t idx) + { + return imageBoxContentList.imageHasAdditionalSettings(idx); + } + + /** sets the polarity for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value (NORMAL or REVERSE), may be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImagePolarity(size_t idx, const char *value) + { + return imageBoxContentList.setImagePolarity(idx, value); + } + + /** sets the requested size for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value (in mm), may be NULL. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageRequestedSize(size_t idx, const char *value) + { + return imageBoxContentList.setImageRequestedSize(idx, value); + } + + /** sets the (optional) magnification type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageMagnificationType(size_t idx, const char *value) + { + return imageBoxContentList.setImageMagnificationType(idx, value); + } + + /** sets the (optional) smoothing type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageSmoothingType(size_t idx, const char *value) + { + return imageBoxContentList.setImageSmoothingType(idx, value); + } + + /** sets the (optional) configuration information for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @param value new attribute value, may be NULL. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageConfigurationInformation(size_t idx, const char *value) + { + return imageBoxContentList.setImageConfigurationInformation(idx, value); + } + + /** gets the polarity for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return polarity (NORMAL or REVERSE), may be NULL. + */ + const char *getImagePolarity(size_t idx) + { + return imageBoxContentList.getImagePolarity(idx); + } + + /** gets the requested size for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return requested size (in mm), may be NULL. + */ + const char *getImageRequestedSize(size_t idx) + { + return imageBoxContentList.getImageRequestedSize(idx); + } + + /** gets the (optional) magnification type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return magnification type, may be NULL. + */ + const char *getImageMagnificationType(size_t idx) + { + return imageBoxContentList.getImageMagnificationType(idx); + } + + /** gets the (optional) smoothing type for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return smoothing type, may be NULL. + */ + const char *getImageSmoothingType(size_t idx) + { + return imageBoxContentList.getImageSmoothingType(idx); + } + + /** gets the (optional) configuration information for the given registered image box. + * @param idx index, must be < getNumberOfImages() + * @return configuration information, may be NULL. + */ + const char *getImageConfigurationInformation(size_t idx) + { + return imageBoxContentList.getImageConfigurationInformation(idx); + } + + /** gets the presentation LUT for the given registered image box. + * If not available the presentation LUT of the film box is used. + * @param idx index, must be < getNumberOfImages() + * @return pointer to presentation LUT, may be NULL. + */ + DVPSPresentationLUT *getImagePresentationLUT(size_t idx); + + /** gets the "global" presentation LUT which overrides the settings for the image boxes. + * If not available the presentation LUT of the image box is used. + * @return pointer to presentation LUT, may be NULL. + */ + DVPSPresentationLUT *getPresentationLUT(); + + /** resets the Presentation LUT to the default setting. i.e. the presentation LUT + * which is specified separately for each image box is used. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDefaultPresentationLUT(); + + /** sets the current Presentation LUT shape (overrides the image box settings). + * Only DVPSP_identity and DVPSP_lin_od are allowed. + * @param shape the new presentation LUT shape. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPresentationLUTShape(DVPSPresentationLUTType shape); + + /** stores a presentation lookup table in the stored print object. + * This method stores a presentation lookup table in the + * stored print object and activates it. This LUT overrides the + * settings made for the individual image boxes. If unsuccessful, + * LUT is not set. + * @param dset dataset from which the Presentation LUT SQ or Shape is read. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPresentationLookupTable(DcmItem &dset); + + /** converts an optical density (OD) value to an 8/12/16-bit P-value which is linear to luminance. + * The output is not calibrated according to the GSDF. This can be done by convertPValueToDDL() in + * class DVPSPresentationState. The attributes illumination, reflected ambient light and min/max + * density (default 20/300) from this stored print object are used for the calculation. + * @param density in hundreds of OD (e.g. 150 corressponds to 1.5 OD) + * @param bits number of bits used for the output value (8, 12, 16) + * @return P-Value, 0..0xFF, 0..0xFFF, 0..0xFFFF, < 0 if an error occurred. + */ + Sint32 convertODtoPValue(Uint16 density, unsigned int bits = 8); + + /** writes the general study and series module attributes for a grayscale hardcopy image + * that is related to this stored print object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition writeHardcopyImageAttributes(DcmItem &dset); + + /** creates a new image box object and sets the content of this image box object. + * @param retrieveaetitle retrieve AETITLE of the referenced image + * @param refstudyuid Study instance UID of the referenced image + * @param refseriesuid Series instance UID of the referenced image + * @param refsopclassuid SOP Class UID of the referenced image + * @param refsopinstanceuid SOP instance UID of the referenced image + * @param requestedimagesize requested images size for this image, may be NULL (absent) + * @param patientid patient ID for the referenced image, may be NULL (absent) + * @param presentationlut presentation LUT to be used, may be NULL (absent) + * @param inversePLUT true if presentation LUT is for Monochrome1 and must be inversed. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageBox( + const char *retrieveaetitle, + const char *refstudyuid, + const char *refseriesuid, + const char *refsopclassuid, + const char *refsopinstanceuid, + const char *requestedimagesize, + const char *patientid, + DVPSPresentationLUT *presentationlut, + OFBool inversePLUT); + + /** creates a new image box object and sets the content of this image box object. + * This is a specialized version of the method with the same name and more parameters. + * SOP Class is assumed to be Grayscale Hardcopy, Study and Series are derived from + * the Stored Print internal defaults. + * @param retrieveaetitle retrieve AETITLE of the referenced image + * @param refsopinstanceuid SOP instance UID of the referenced image + * @param requestedimagesize requested images size for this image, default: absent + * @param patientid patient ID for the referenced image, default: absent + * @param presentationlut presentation LUT to be used, may be NULL (absent) + * @param inversePLUT true if presentation LUT is for Monochrome1 and must be inversed. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageBox( + const char *retrieveaetitle, + const char *refsopinstanceuid, + const char *requestedimagesize=NULL, + const char *patientid=NULL, + DVPSPresentationLUT *presentationlut=NULL, + OFBool inversePLUT=OFFalse); + + /** deletes all existing annotations and creates a new one, + * with given text and position. Sets annotation display format + * to the given value. + * + * @param displayformat annotation display format + * @param text annotation text + * @param position annotation position + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setSingleAnnotation( + const char *displayformat, + const char *text, + Uint16 position); + + /** deletes all annotations, clears annotation display format. + */ + void deleteAnnotations(); + + /** sets a new SOP Instance UID for the Stored Print object. + * @param uid new SOP Instance UID + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setInstanceUID(const char *uid); + + /** clears the SOP instance UID for the Stored Print object. + * a new UID is assigned automatically when writing the object. + */ + void clearInstanceUID() { sOPInstanceUID.clear(); } + + /** returns the image UIDs that are required to look up the referenced image in the database + * @param idx index, must be < getNumberOfImages() + * @param studyUID Study UID of the image + * @param seriesUID series UID of the image + * @param instanceUID instance UID of the image + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageReference(size_t idx, const char *&studyUID, const char *&seriesUID, const char *&instanceUID) + { + return imageBoxContentList.getImageReference(idx, studyUID, seriesUID, instanceUID); + } + + /** returns a description of the currently activated Presentation LUT (if + * any) in terms of the Presentation LUT matching rule (see description + * of enum type for details). + * @return Presentation LUT alignment + */ + DVPSPrintPresentationLUTAlignment getReferencedPresentationLUTAlignment() { return referencedPresentationLUTAlignment; } + + /** Requests the properties of the printer (Printer SOP Instance N-GET). + * The properties are not returned, but if the message handler is switched to "dump mode", + * the DIMSE communication will be printed. + * @param printHandler print communication handler, association must be open. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUgetPrinterInstance(DVPSPrintMessageHandler& printHandler); + + /** checks whether a presentation LUT or LUT shape is active in this stored print object. + * In this case, if the printer supports the Presentation LUT SOP class, + * a Presentation LUT SOP Instance is created in the printer. + * @param printHandler print communication handler, association must be open. + * @param printerRequiresMatchingLUT true if printer requires presentation LUTs matching the image depth + * @param printerLUTRenderingPreferred true if SCP side presentation LUTs should be preferred + * even if printer supports 12-bit image transmission. + * @param printerSupports12Bit true if printer supports 12 bit transmission + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUpreparePresentationLUT( + DVPSPrintMessageHandler& printHandler, + OFBool printerRequiresMatchingLUT, + OFBool printerLUTRenderingPreferred, + OFBool printerSupports12Bit); + + /** Creates a DICOM Basic Film Session SOP Instance in the printer. + * @param printHandler print communication handler, association must be open. + * @param dset DICOM dataset containing all Basic Film Session attributes managed outside this class + * @param plutInSession true if printer expects referenced presentation LUT sequence, illumination + * and reflected ambient light in basic film session, false if it expects them in basic film box. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUcreateBasicFilmSession( + DVPSPrintMessageHandler& printHandler, + DcmDataset& dset, + OFBool plutInSession); + + /** Creates a DICOM Basic Film Box SOP Instance in the printer. + * This method only allows one basic film box to exist at any time - + * collation is not supported. + * @param printHandler print communication handler, association must be open. + * @param plutInSession true if printer expects referenced presentation LUT sequence, illumination + * and reflected ambient light in basic film session, false if it expects them in basic film box. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUcreateBasicFilmBox(DVPSPrintMessageHandler& printHandler, OFBool plutInSession); + + /** Transmits a DICOM image to the printer (Basic Grayscale Image Box N-SET). + * @param printHandler print communication handler, association must be open. + * @param idx index of the image reference from which the Image Box settings are taken, + * must be < getNumberOfImages(). + * @param image DICOM image to be printed + * @param useMonochrome1 if true, the image is transmitted in MONOCHROME1 photometric interpretation. + * Default is false, image is transmitted in MONOCHROME2 in this case. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUsetBasicImageBox( + DVPSPrintMessageHandler& printHandler, + size_t idx, + DicomImage& image, + OFBool useMonochrome1=OFFalse); + + /** Transmits a DICOM annotation to the printer (Basic Annotation Box N-SET). + * @param printHandler print communication handler, association must be open. + * @param idx index of the annotation from which the settings are taken, + * must be < getNumberOfAnnotations(). + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUsetBasicAnnotationBox( + DVPSPrintMessageHandler& printHandler, + size_t idx); + + /** Prints the current DICOM Basic Film Box SOP Instance. + * @param printHandler print communication handler, association must be open. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUprintBasicFilmBox(DVPSPrintMessageHandler& printHandler); + + /** Prints the current DICOM Basic Film Session. + * @param printHandler print communication handler, association must be open. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUprintBasicFilmSession(DVPSPrintMessageHandler& printHandler); + + /** Deletes all objects currently present in the print association. + * @param printHandler print communication handler, association must be open. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition printSCUdelete(DVPSPrintMessageHandler& printHandler); + + /** sets the illumination to be used + * with the print Presentation LUT SOP Class. + * @param value new attribute value, in cd/m2. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrintIllumination(Uint16 value); + + /** gets the current illumination setting + * used with the print Presentation LUT SOP Class. + * @return illumination in cd/m2 + */ + Uint16 getPrintIllumination(); + + /** sets the reflected ambient light to be used + * with the print Presentation LUT SOP Class. + * @param value new attribute value, in cd/m2. + * The caller is responsible for making sure + * that the value is valid for the selected printer. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPrintReflectedAmbientLight(Uint16 value); + + /** gets the current reflected ambient light setting + * used with the print Presentation LUT SOP Class. + * @return reflected ambient light in cd/m2 + */ + Uint16 getPrintReflectedAmbientLight(); + + /** performs a Print SCP Basic Film Box N-CREATE operation on a newly + * created instance of this class. The results of the operation are + * stored in the objects passed as rsp, rspDataset and + * globalPresentationLUTList. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rqDataset N-CREATE request dataset, may be NULL + * @param rsp N-CREATE response message + * @param rspDataset N-CREATE response dataset passed back in this parameter + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation and is supported on + * Basic Film Box level + * @param globalPresentationLUTList + * list of presentation LUTs managed by the Print SCP. + * If a SCP default Presentation LUT needs to be created as the result + * of the N-CREATE operation, it is stored in this list. + * @param filmSessionUID + * SOP instance UID of the Basic Film Session object + * @param study study UID to be used when storing Stored Print or image objects + * @param psSeries series UID to be used when storing Stored Print objects + * @param imgSeries series UID to be used when storing image objects (Hardcopy Grayscale) + * @return OFTrue if N-CREATE was successful, OFFalse otherwise. + */ + OFBool printSCPCreate( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList, + const char *filmSessionUID, + DcmUniqueIdentifier& study, + DcmUniqueIdentifier& psSeries, + DcmUniqueIdentifier& imgSeries); + + /** performs a Print SCP Basic Film Box N-SET operation on an instance of + * this class. The results of the N-SET operation are stored in the + * objects passed as rsp and rspDataset. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rqDataset N-SET request dataset + * @param rsp N-SET response message + * @param rspDataset N-SET response dataset passed back in this parameter + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation and is supported on + * Basic Film Box level + * @param globalPresentationLUTList + * list of presentation LUTs managed by the Print SCP + * @return OFTrue if N-SET was successful, OFFalse otherwise. + */ + OFBool printSCPSet( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList); + + /** checks whether the given UID string matches the film box UID. + * @param c uid to be compared + * @return OFTrue if equal, OFFalse otherwise + */ + OFBool isFilmBoxInstance(const char *c) { if (c && (filmBoxInstanceUID == c)) return OFTrue; else return OFFalse; } + + /** checks whether the Presentation LUT with the given UID + * is referenced by this Stored Print object on the film box level. + * Presentation LUT references on Image Box level are ignored. + * @param c uid to be compared + * @return OFTrue if equal, OFFalse otherwise + */ + OFBool usesPresentationLUT(const char *c); + + /** looks up the image box with the given SOP instance UID in the image box list + * and returns a pointer to a new object containing a copy of this + * image box. If the object is not found, NULL is returned. + * @param uid SOP instance UID of the image box to be looked up + * @return pointer to copied image box object, may be NULL. + */ + DVPSImageBoxContent *duplicateImageBox(const char *uid) { return imageBoxContentList.duplicateImageBox(uid); } + + /** checks whether any of the image boxes managed by the image box list + * has the same position as the given one, but a different + * SOP instance UID. This is used during a Print SCP basic grayscale + * image box N-SET operation to check whether an image position clash exists. + * @param uid SOP instance UID of the image box to be looked up + * @param position image position to be looked up + */ + OFBool haveImagePositionClash(const char *uid, Uint16 position) { return imageBoxContentList.haveImagePositionClash(uid, position); } + + /** adds the given image box object to the image box list. + * Any other object existing in the list with the same SOP instance UID is removed. + * Used during a Print SCP basic grayscale image box N-SET operation. + * @param newImageBox new image box object to be added to the list. + */ + void replaceImageBox(DVPSImageBoxContent *newImageBox) { imageBoxContentList.replace(newImageBox); } + + /** updates the list of Presentation LUTs managed by the Stored Print object + * from a global list. If a Presentation LUT is active on Film Box level, the corresponding + * LUT is copied from the global presentation LUT list. + * Presentation LUT references on Image Box level are ignored. + * Used during a Print SCP N-ACTION operation. + * @param globalPresentationLUTList list of presentation LUTs managed by the Print SCP + */ + void updatePresentationLUTList(DVPSPresentationLUT_PList& globalPresentationLUTList); + + /** checks whether the given Presentation LUT type could be used together + * with all image boxes in this film box on a Print SCP that requires a matching + * alignment between a Presentation LUT and the image pixel data. + * @param align LUT alignment type + * @return OFTrue if matching, OFFalse otherwise + */ + OFBool matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align) const + { + return imageBoxContentList.matchesPresentationLUT(align); + } + + /** replaces the settings for illumination, reflected ambient light and + * referenced Presentation LUT in this film box. + * Used by a Print SCP if Presentation LUT is implemented on Film Session + * level. + * @param newIllumination new value for illumination + * @param newReflectedAmbientLight new value for reflectedAmbientLight + * @param newReferencedPLUT new value for referenced presentation LUT instance UID + * @param newAlignment new alignment type of active presentation LUT + */ + void overridePresentationLUTSettings( + DcmUnsignedShort& newIllumination, + DcmUnsignedShort& newReflectedAmbientLight, + DcmUniqueIdentifier& newReferencedPLUT, + DVPSPrintPresentationLUTAlignment newAlignment); + + /** checks whether any of the image boxes has an image box position + * assigned. If no image box position is assigned, the stored print object + * cannot be written and a Print SCP should return a warning + * status upon receipt of an N-ACTION request. + * @return OFTrue if empty page (no image box position assigned), OFFalse otherwise. + */ + OFBool emptyPageWarning() { return imageBoxContentList.emptyPageWarning(); } + + private: + + /// private undefined assignment operator + DVPSStoredPrint& operator=(const DVPSStoredPrint&); + + /* checks if given SOP class UID is an image storage SOP class + * @return OFTrue if image SOP class, OFFalse otherwise. + */ + OFBool isImageStorageSOPClass(OFString& sopclassuid); + + /** create default values for all missing type 1 elements. + * Called before a stored print object is written. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createDefaultValues(); + + /** writes a Referenced Presentation LUT SQ to the given + * dataset. Helper function used in the more general write() method. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addReferencedPLUTSQ(DcmItem &dset); + + /** writes a Referenced Presentation LUT SQ, Illumination and + * reflected ambient light to the given dataset. + * Helper function used when creating Basic Film Session or + * Basic Film Box. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addPresentationLUTReference(DcmItem& dset); + + /** invalidates the cached number of columns and rows + */ + void invalidateCache(); + + /** updates the cached number of columns and rows + */ + void updateCache(); + + /* Module: Patient (M) + */ + /// Module=Patient, VR=PN, VM=1, Type 1 + DcmPersonName patientName; + /// Module=Patient, VR=LO, VM=1, Type 2 + DcmLongString patientID; + /// Module=Patient, VR=DA, VM=1, Type 2 + DcmDate patientBirthDate; + /// Module=Patient, VR=CS, VM=1, Type 2 + DcmCodeString patientSex; + + /* Module: General Study (M) + */ + /// Module=General_Study, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier studyInstanceUID; + /// Module=General_Study, VR=DA, VM=1, Type 2 + DcmDate studyDate; + /// Module=General_Study, VR=TM, VM=1, Type 2 + DcmTime studyTime; + /// Module=General_Study, VR=PN, VM=1, Type 2 + DcmPersonName referringPhysicianName; + /// Module=General_Study, VR=SH, VM=1, Type 2 + DcmShortString studyID; + /// Module=General_Study, VR=SH, VM=1, Type 2 + DcmShortString accessionNumber; + + /* Module: General Series (M) + */ + /// Module=General_Series, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier seriesInstanceUID; + /// Module=General_Series, VR=IS, VM=1, Type 2 + DcmIntegerString seriesNumber; + + /* Module: General Equipment (M) + */ + /// Module=General_Equipment, VR=LO, VM=1, Type 2 + DcmLongString manufacturer; + + /* Module: Printer Characteristics (M) + */ + // the PrintManagementCapabilitiesSequence is only created/checked on the fly + + // PrinterCharacteristicsSequence + /// Module=Printer_Characteristics_Module, VR=AE, VM=1, Type 2 + DcmApplicationEntity originator; + /// Module=Printer_Characteristics_Module, VR=AE, VM=1, Type 2 + DcmApplicationEntity destination; + /// Module=Printer_Characteristics_Module, VR=LO, VM=1, Type 3 + DcmLongString printerName; + + /* Module: Film Box (M) + */ + /// Module=Film_Box_Module, VR=IS, VM=1, Type 2 + DcmIntegerString instanceNumber; + /* the following attributes belong to the Film Box Content SQ (Type 1) */ + /// Module=Film_Box_Module, VR=ST, VM=1, Type 1 + DcmShortText imageDisplayFormat; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 3 + DcmCodeString annotationDisplayFormatID; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 2 + DcmCodeString filmOrientation; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 2 + DcmCodeString filmSizeID; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 2 + DcmCodeString magnificationType; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 3 + DcmCodeString smoothingType; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 3 + DcmCodeString borderDensity; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 3 + DcmCodeString emptyImageDensity; + /// Module=Film_Box_Module, VR=US, VM=1, Type 3 + DcmUnsignedShort minDensity; + /// Module=Film_Box_Module, VR=US, VM=1, Type 2 + DcmUnsignedShort maxDensity; + /// Module=Film_Box_Module, VR=CS, VM=1, Type 3 + DcmCodeString trim; + /// Module=Film_Box_Module, VR=ST, VM=1, Type 2 + DcmShortText configurationInformation; + /// Module=Film_Box_Module, VR=US, VM=1, Type 2c required if presentation SOP class present + DcmUnsignedShort illumination; + /// Module=Film_Box_Module, VR=US, VM=1, Type 2c required if presentation SOP class present + DcmUnsignedShort reflectedAmbientLight; + /// Module=Film_Box_Module (Supplement 38), VR=CS, VM=1, Type 3 + DcmCodeString requestedResolutionID; + /// the ReferencedPresentationLUTSequence is only created/read on the fly + DcmUniqueIdentifier referencedPresentationLUTInstanceUID; + + /** The Print SCP can be configured to enforce a rule requiring that the + * number of entries in a Presentation LUT matches the bit depth of the + * image pixel data. This member variable describes the type of the + * current presentation LUT (if any). + */ + DVPSPrintPresentationLUTAlignment referencedPresentationLUTAlignment; + + /* Module: Image Box List (M) + */ + /// Module=Image_Box_List_Module, VR=SQ, VM=1, Type 1 + DVPSImageBoxContent_PList imageBoxContentList; + + /* Module: Annotation List (U) + */ + /// Module=Annotation_List_Module, VR=SQ, VM=1, Type 3 + DVPSAnnotationContent_PList annotationContentList; + + /* Module: Presentation LUT List (U) + */ + DVPSPresentationLUT_PList presentationLUTList; + + /* Module: SOP Common (M) + * we don't store the SOP Class UID because it is well known. + */ + /// Module=SOP_Common, VR=UI, VM=1, Type 1 + DcmUniqueIdentifier sOPInstanceUID; + /// Module=SOP_Common, VR=CS, VM=1-n, Type 1C + DcmCodeString specificCharacterSet; + /// Module=SOP_Common, VR=DA, VM=1, Type 3 + DcmDate instanceCreationDate; + /// Module=SOP_Common, VR=TM, VM=1, Type 3 + DcmTime instanceCreationTime; + + /// used when creating hardcopy image objects + DcmUniqueIdentifier imageSeriesInstanceUID; + + /// flag indicating whether the currentXX values are up to date + OFBool currentValuesValid; + /// current number of columns + unsigned long currentNumCols; + /// current number of rows + unsigned long currentNumRows; + + /// requested decimate/crop behaviour used in all image boxes + DVPSDecimateCropBehaviour decimateCropBehaviour; + + /// the current film session instance + OFString filmSessionInstanceUID; + + /// the current film box instance + OFString filmBoxInstanceUID; + + /** the current presentation LUT instance. If used as Print SCU, the + * content of this string can differ from referencedPresentationLUTInstanceUID + * which contains the UID from the Stored Print object wheras this + * string contains the UID assigned by the remote Print SCP. + * If used as Print SCP, these strings should always be equal. + */ + OFString presentationLUTInstanceUID; + + /// stores the "global" presentation LUT that overrides the image box LUTs (optional) + DVPSPresentationLUT globalPresentationLUT; + + /// flag indicating whether the globalPresentationLUT is currently valid or not + OFBool globalPresentationLUTValid; + + /// transmit images in 12 bit for the current print job + OFBool transmitImagesIn12Bit; + + /// presentation LUTs are rendered on SCP side + OFBool renderPresentationLUTinSCP; + + /// temporary buffer for getMaxDensity and getMinDensity + OFString tempDensity; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsspl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsspl.h new file mode 100644 index 00000000..d7732b08 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsspl.h @@ -0,0 +1,216 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSStoredPrint_PList + * + */ + +#ifndef DVPSSPL_H +#define DVPSSPL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmnet/dimse.h" + +class DVInterface; +class DVPSStoredPrint; +class DVConfiguration; +class DVPSPresentationLUT_PList; + +/** a list of stored print objects, each of which manages a single Basic + * Film Box in a Print SCP. + */ +class DCMTK_DCMPSTAT_EXPORT DVPSStoredPrint_PList +{ +public: + /// default constructor + DVPSStoredPrint_PList(); + + /// copy constructor + DVPSStoredPrint_PList(const DVPSStoredPrint_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSStoredPrint_PList object containing + * a deep copy of this object. + */ + DVPSStoredPrint_PList *clone() { return new DVPSStoredPrint_PList(*this); } + + /// destructor + virtual ~DVPSStoredPrint_PList(); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** get number of stored print objects in this list. + * @return the number of stored print objects. + */ + size_t size() const { return list_.size(); } + + /** adds a Stored Print object to the list of managed objects. The stored + * print object becomes owned by this object and is destroyed upon + * destruction of the list. + * @param newSP Stored Print object to be added. + */ + void insert(DVPSStoredPrint *newSP) { if (newSP) list_.push_back(newSP); } + + /** performs a Print SCP Basic Film Box N-SET operation. + * The results of the N-SET operation are stored in the + * objects passed as rsp and rspDataset. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rq N-SET request message + * @param rqDataset N-SET request dataset + * @param rsp N-SET response message + * @param rspDataset N-SET response dataset passed back in this parameter + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation + * @param globalPresentationLUTList + * list of presentation LUTs managed by the Print SCP + */ + void printSCPBasicFilmBoxSet( + DVConfiguration& cfg, + const char *cfgname, + T_DIMSE_Message& rq, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList); + + /** performs a Print SCP Basic Grayscale Image Box N-SET operation. + * The results of the N-SET operation are stored in the + * objects passed as rsp and rspDataset. + * If successful, a Hardcopy Grayscale Image object containing + * the image data of the N-SET request is created in the database. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rq N-SET request message + * @param rqDataset N-SET request dataset + * @param rsp N-SET response message + * @param rspDataset N-SET response dataset passed back in this parameter + * @param presentationLUTnegotiated + * OFTrue if support for the Presentation LUT SOP class + * has been negotiated at association negotiation + */ + void printSCPBasicGrayscaleImageBoxSet( + DVInterface& cfg, + const char *cfgname, + T_DIMSE_Message& rq, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated); + + /** performs a Print SCP Basic Film Box N-ACTION operation. + * The results of the N-ACTION operation are stored in the + * object passed as rsp. + * If successful, a Stored Print object containing the film box + * hierarchy is created in the database. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rq N-ACTION request message + * @param rsp N-ACTION response message + * @param globalPresentationLUTList list of presentation LUTs managed by the Print SCP + */ + void printSCPBasicFilmBoxAction( + DVInterface& cfg, + const char *cfgname, + T_DIMSE_Message& rq, + T_DIMSE_Message& rsp, + DVPSPresentationLUT_PList& globalPresentationLUTList); + + /** performs a Print SCP Basic Film Session N-ACTION operation. + * The results of the N-ACTION operation are stored in the + * object passed as rsp. + * If successful, one Stored Print object for each film box + * in the film session is created in the database. + * @param cfg config file facility + * @param cfgname symbolic printer name in config file + * @param rsp N-ACTION response message + * @param globalPresentationLUTList list of presentation LUTs managed by the Print SCP + */ + void printSCPBasicFilmSessionAction( + DVInterface& cfg, + const char *cfgname, + T_DIMSE_Message& rsp, + DVPSPresentationLUT_PList& globalPresentationLUTList); + + /** performs a Print SCP basic film box N-DELETE operation. + * The results of the N-DELETE operation are stored in the object passed as rsp. + * @param rq N-DELETE request message + * @param rsp N-DELETE response message + */ + void printSCPBasicFilmBoxDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); + + /** checks whether a film box object with the given SOP instance UID + * already exists. + * @param uid uid to be checked + * @return OFTrue if found, OFFalse otherwise + */ + OFBool haveFilmBoxInstance(const char *uid); + + /** checks whether the Presentation LUT with the given UID + * is referenced by any Stored Print object in this list + * on the film box level. + * @param uid uid to be compared + * @return OFTrue if equal, OFFalse otherwise + */ + OFBool usesPresentationLUT(const char *uid); + + /** checks whether the given Presentation LUT type could be used together + * with all image boxes in all film boxes on a Print SCP that requires a matching + * alignment between a Presentation LUT and the image pixel data. + * @param align LUT alignment type + * @return OFTrue if matching, OFFalse otherwise + */ + OFBool matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align) const; + + /** replaces the settings for illumination, reflected ambient light and + * referenced Presentation LUT in all film boxes in this list. + * Used by a Print SCP if Presentation LUT is implemented on Film Session + * level. + * @param newIllumination new value for illumination + * @param newReflectedAmbientLight new value for reflectedAmbientLight + * @param newReferencedPLUT new value for referenced presentation LUT instance UID + * @param newAlignment new alignment type of active presentation LUT + */ + void overridePresentationLUTSettings( + DcmUnsignedShort& newIllumination, + DcmUnsignedShort& newReflectedAmbientLight, + DcmUniqueIdentifier& newReferencedPLUT, + DVPSPrintPresentationLUTAlignment newAlignment); + +private: + + /// private undefined assignment operator + DVPSStoredPrint_PList& operator=(const DVPSStoredPrint_PList&); + + /** the list maintained by this object + */ + OFList list_; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpssv.h b/dcmpstat/include/dcmtk/dcmpstat/dvpssv.h new file mode 100644 index 00000000..19b30b8b --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpssv.h @@ -0,0 +1,221 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSSoftcopyVOI + * + */ + +#ifndef DVPSSV_H +#define DVPSSV_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmpstat/dvpsril.h" /* for DVPSReferencedImage_PList */ +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ + +class DVPSReferencedSeries_PList; + +/** the representation of one item of the Softcopy VOI LUT Sequence + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSSoftcopyVOI +{ +public: + /// default constructor + DVPSSoftcopyVOI(); + + /// copy constructor + DVPSSoftcopyVOI(const DVPSSoftcopyVOI& copy); + + /** clone method. + * @return a pointer to a new DVPSSoftcopyVOI object containing + * a copy of this object. + */ + DVPSSoftcopyVOI *clone() { return new DVPSSoftcopyVOI(*this); } + + /// destructor + virtual ~DVPSSoftcopyVOI(); + + /** reads a softcopy VOI LUT item from a DICOM dataset. + * The DICOM elements of the softcopy VOI LUT item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the SoftcopyVOILUTSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the dsoftcopy VOI LUT item managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the SoftcopyVOILUTSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** checks if this displayed area is applicable to the given image and frame. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return OFTrue if applicable. + */ + OFBool isApplicable(const char *instanceUID, unsigned long frame); + + /** checks if this displayed area matches exactly the applicability + * defined by the instanceUID, frame and applicability parameters. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return OFTrue if matching. + */ + OFBool matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability); + + /** add a new image reference. + * Checks if the referenced SOP instance UID already exists in this sequence. + * If it exists, an error code is returned. Otherwise a new image reference + * is created and added to the ReferencedImageSequence. + * @param sopclassUID the SOP class UID of the image reference to be added. + * @param instanceUID the SOP instance UID of the image reference to be added. + * @param frame the frame number of the image reference (current image) to be added. + * @param applicability the applicability of the image reference (DVPSB_currentFrame or DVPSB_currentImage) + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability); + + /** removes a reference to an image or frame. If the current reference is empty ("global"), an + * explicit list of references is constructed from the list of series/instance references. + * The image or frame reference is removed from the total list of references in this object. + * If the only reference contained in this object is removed, the reference list becomes empty + * which means that the current reference becomes "global". This case must be handled by the + * called (e.g. by deleting the displayed area selection object). + * @param allReferences list of series/instance references registered for the presentation state. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param numberOfFrames the number of frames of the current image + * @param applicability applicability of the new displayed area selection + * @param applicability the applicability of the image reference to be removed + * (DVPSB_currentFrame or DVPSB_currentImage) + */ + void removeImageReference( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability); + + /** removes all image references for this displayed area. + */ + void clearImageReferences() { referencedImageList.clear(); } + + /** checks if the list of image references for this displayed area is empty. + * @return OFTrue if list of image references is empty, OFFalse otherwise. + */ + OFBool imageReferencesEmpty() { if (referencedImageList.size()==0) return OFTrue; else return OFFalse; } + + /** check if a VOI LUT is currently active + * @return OFTrue if a VOI LUT is active, OFFalse if VOI Window is active. + */ + OFBool haveLUT() { return useLUT; } + + /** returns a description string for a currently active VOI transform. + * If no description is available, NULL is returned. + * @return a pointer to a string or NULL. + */ + const char *getCurrentVOIDescription(); + + /** gets the width of the current VOI window. + * May only be called if haveLUT() is OFFalse. + * @param w the window width is returned in this parameter + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getCurrentWindowWidth(double &w); + + /** get the center of the current VOI window. + * May only be called if haveLUT() is OFFalse. + * @param c the window center is returned in this parameter + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getCurrentWindowCenter(double &c); + + /** returns a reference to the current VOI LUT descriptor. + * May only be called if haveLUT() is OFTrue. + * @return reference to the current VOI LUT descriptor + */ + DcmUnsignedShort& getLUTDescriptor() { return voiLUTDescriptor; } + + /** returns a reference to the current VOI LUT data. + * May only be called if haveLUT() is OFTrue. + * @return reference to the current VOI LUT data + */ + DcmUnsignedShort& getLUTData() { return voiLUTData; } + + /** sets a user defined VOI window center and width. + * @param wCenter the window center + * @param wWidth the window width + * @param description an optional description. Default: absent. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setVOIWindow(double wCenter, double wWidth, const char *description=NULL); + + /** stores (copies) a VOI lookup table. + * If the method returns an error code, an old LUT is left unchanged. + * @param lutDescriptor the LUT Descriptor in DICOM format (VM=3) + * @param lutData the LUT Data in DICOM format + * @param lutExplanation the LUT Explanation in DICOM format, may be empty. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setVOILUT( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation); + +private: + /// private undefined assignment operator + DVPSSoftcopyVOI& operator=(const DVPSSoftcopyVOI&); + + /* since the VOI LUT sequence in the Softcopy VOI LUT module must + * not contain more than one item, we do not need to manage a list of + * VOI LUT SQ items. + */ + + /// ReferencedImageSequence, Type 1c + DVPSReferencedImage_PList referencedImageList; + /// If true, a VOI LUT is set, otherwise a VOI Window is set. + OFBool useLUT; + /// Module=VOI_LUT, VR=xs, VM=3, Type 1c + DcmUnsignedShort voiLUTDescriptor; + /// Module=VOI_LUT, VR=LO, VM=1, Type 3 + DcmLongString voiLUTExplanation; + /// Module=VOI_LUT, VR=xs, VM=1-n, Type 1c + DcmUnsignedShort voiLUTData; + /// Module=VOI_LUT, VR=DS, VM=1-n, Type 1c (unlike VOI LUT module!) + DcmDecimalString windowCenter; + /// Module=VOI_LUT, VR=DS, VM=1-n, Type 1c + DcmDecimalString windowWidth; + /// Module=VOI_LUT, VR=LO, VM=1-n, Type 3 + DcmLongString windowCenterWidthExplanation; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpssvl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpssvl.h new file mode 100644 index 00000000..228c5d02 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpssvl.h @@ -0,0 +1,164 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSSoftcopyVOI_PList + * + */ + +#ifndef DVPSSVL_H +#define DVPSSVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ +#include "dcmtk/dcmdata/dcitem.h" + +class DVPSSoftcopyVOI; +class DVPSReferencedSeries_PList; + +/** the list of softcopy VOI LUT items contained in a presentation state (internal use only). + * This class manages the data structures comprising one complete Softcopy VOI LUT sequence + * contained in a presentation state object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSSoftcopyVOI_PList +{ +public: + /// default constructor + DVPSSoftcopyVOI_PList(); + + /// copy constructor + DVPSSoftcopyVOI_PList(const DVPSSoftcopyVOI_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSSoftcopyVOI_PList object containing + * a deep copy of this object. + */ + DVPSSoftcopyVOI_PList *clone() { return new DVPSSoftcopyVOI_PList(*this); } + + /// destructor + virtual ~DVPSSoftcopyVOI_PList(); + + /** reads a list of softcopy VOI LUTs (SoftcopyVOILUTSequence) from a DICOM dataset. + * The DICOM elements of the softcopy VOI LUT item are copied from the dataset to this object. + * The completeness of all items (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset from which the sequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of softcopy VOI LUTs managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the DICOM dataset to which the SoftcopyVOILUTSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** gets the number of softcopy VOI LUTs in this list. + * @return the number of softcopy VOI LUTs. + */ + size_t size() const { return list_.size(); } + + /** creates a default softcopy VOI LUT sequence for a presentation state from a DICOM image. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset containing the image IOD + * @param allReferences list of series/instance references registered for the + * presentation state. + * @param sopclassUID SOP class UID of the current image + * @param instanceUID SOP instance UID of the current image + * @param voiActivation flag defining how VOI LUTs or VOI window width/center should + * be handled. Default: Use VOI and prefer VOI LUT from VOI window. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition createFromImage( + DcmItem &dset, + DVPSReferencedSeries_PList& allReferences, + const char *sopclassUID, + const char *instanceUID, + DVPSVOIActivation voiActivation); + + /** checks if a softcopy VOI LUT item exists for the given image and frame. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @return pointer to the softcopy VOI LUT item if it exists, NULL otherwise. + */ + DVPSSoftcopyVOI *findSoftcopyVOI(const char *instanceUID, unsigned long frame); + + /** finds or creates a softcopy VOI LUT SQ item + * with an applicability controlled by the applicability, instanceUID and frame + * parameters. The softcopy VOI LUT sequence is rearranged such that + * all other referenced images/frames keep their old settings. + * @param allReferences list of series/instance references registered for the + * presentation state. + * @param sopclassUID SOP class UID of the current image + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param numberOfFrames number of frames of the current image + * @param applicability applicability of the new softcopy VOI LUT + * @return pointer to a softcopy VOI LUT object from the list + * that matches the applicability parameters. NULL is returned if + * out of memory. + */ + DVPSSoftcopyVOI *createSoftcopyVOI( + DVPSReferencedSeries_PList& allReferences, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability); + + /** removes the softcopy VOI for a set of references + * controlled by the applicability, instanceUID and frame + * parameters. The softcopy VOI LUT sequence is rearranged such that + * all other referenced images/frames keep their old settings. + * @param allReferences list of series/instance references registered for the + * presentation state. + * @param instanceUID SOP instance UID of the current image + * @param frame number of the current frame + * @param numberOfFrames number of frames of the current image + * @param applicability applicability of the VOI LUT removal + */ + void removeSoftcopyVOI( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability); + +private: + + /// private undefined assignment operator + DVPSSoftcopyVOI_PList& operator=(const DVPSSoftcopyVOI_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpstat.h b/dcmpstat/include/dcmtk/dcmpstat/dvpstat.h new file mode 100644 index 00000000..37e7071b --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpstat.h @@ -0,0 +1,1330 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPresentationState + * + */ + +#ifndef DVPSTAT_H +#define DVPSTAT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dcmpstat.h" + +class DicomImage; +class DiDisplayFunction; + +/** a Grayscale Softcopy Presentation State. + * This class manages the data structures comprising a Presentation State object. + * Presentation states can be created, read, written, and modified. + */ +class DCMTK_DCMPSTAT_EXPORT DVPresentationState: public DcmPresentationState +{ +public: + /** default constructor + * @param dispFunction list of objects describing the display + * characteristics of the monitor. Used to implement the standard display function. + * The parameter should be an array with DVPSD_max entries (see DVInterface). + * If absent, no display transform is performed. + * @param minPrintBitmapX default value for minimum print bitmap size X + * @param minPrintBitmapY default value for minimum print bitmap size Y + * @param maxPrintBitmapX default value for maximum print bitmap size X + * @param maxPrintBitmapY default value for maximum print bitmap size Y + * @param maxPreviewImageX default value for maximum preview image size X + * @param maxPreviewImageY default value for maximum preview image size Y + */ + DVPresentationState( + DiDisplayFunction **dispFunction=NULL, + unsigned long minPrintBitmapX=0, + unsigned long minPrintBitmapY=0, + unsigned long maxPrintBitmapX=0, + unsigned long maxPrintBitmapY=0, + unsigned long maxPreviewImageX=0, + unsigned long maxPreviewImageY=0); + + /// destructor + virtual ~DVPresentationState(); + + /** resets the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** reads a presentation state from a DICOM dataset. + * The DICOM elements of the presentation state are copied + * from the dataset to this object. + * The completeness and correctness of the + * presentation state (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the presentation state is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** creates a default presentation state for a DICOM image. + * A number of flags specify how curves, overlays, VOI transformations, + * a display shutter and a presentation LUT shape + * should be treated when found in the image IOD. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the DICOM dataset containing the image IOD + * @param overlayActivation flag defining how overlays should be handled + * (copied, activated or ignored). Default: Copy overlays. + * @param voiActivation flag defining how VOI LUTs or VOI window width/center should + * be handled. Default: Use VOI and prefer VOI LUT from VOI window. + * @param curveActivation flag defining whether curves in the image should + * be activated. Default: Activate curves. + * @param shutterActivation flag defining whether a shutter (not bitmap shutter) + * should be copied to the presentation state when found in the image. + * Default: Copy shutter. + * @param presentationActivation flag defining whether a presentation LUT shape + * should be copied to the presentation state when found in the image. + * Default: Copy presentation LUT shape. + * @param layering flag defining how graphic layers should be created for + * activated overlays and curves. Default: Create one layer for all overlays + * and another layer for all curves. + * @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent. + * @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent. + * @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition createFromImage(DcmItem &dset, + DVPSoverlayActivation overlayActivation = DVPSO_copyOverlays, + DVPSVOIActivation voiActivation = DVPSV_preferVOILUT, + OFBool curveActivation = OFTrue, + OFBool shutterActivation = OFTrue, + OFBool presentationActivation = OFTrue, + DVPSGraphicLayering layering = DVPSG_twoLayers, + const char * aetitle = NULL, + const char * filesetID = NULL, + const char * filesetUID = NULL); + + /** adds a reference to the currently attached image to this + * presentation state. This method checks if the given image + * is not yet referenced and if its Study UID and SOP class + * match for this presentation state and returns an error code otherwise. + * @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent. + * @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent. + * @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition addImageReferenceAttached( + const char *aetitle=NULL, + const char *filesetID=NULL, + const char *filesetUID=NULL); + + /** removes a reference to the currently attached image from this presentation state. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition removeImageReferenceAttached(); + + /** sets the current Presentation LUT type. + * DVPSP_table can only be used if the presentation state + * contains a lookup table, i.e. if havePresentationLookupTable() returns OFTrue. + * @param newType the new presentation LUT type. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setCurrentPresentationLUT(DVPSPresentationLUTType newType); + + /** resets the Presentation LUT to the default LUT shape + * which is DVPSP_identity for MONOCHROME2 images and DVPSP_inverse for MONOCHROME1. + * DVPSP_table can only be used if the presentation state + * contains a lookup table, i.e. if havePresentationLookupTable() returns OFTrue. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setDefaultPresentationLUTShape(); + + /** stores a presentation lookup table in the presentation state. + * This method stores a presentation lookup table in the + * presentation state and activates it. The LUT is copied to + * the presentation state. If the method returns EC_Normal, + * any old presentation LUT in the presentation state is overwritten. + * This method keeps the inverse/not inverse status intact, + * i.e. inverses the LUT if necessary. + * @param lutDescriptor the LUT Descriptor in DICOM format (VM=3) + * @param lutData the LUT Data in DICOM format + * @param lutExplanation the LUT Explanation in DICOM format, may be empty. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPresentationLookupTable( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation); + + /** stores a presentation lookup table in the presentation state. + * This method stores a presentation lookup table in the + * presentation state and activates it. The LUT is copied to + * the presentation state. Overwrites old LUT. If unsuccessful, + * LUT is set to DVPSP_identity. + * This method keeps the inverse/not inverse status intact, + * i.e. inverses the LUT if necessary. + * @param dset dataset from which the Presentation LUT SQ or Shape is read. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setPresentationLookupTable(DcmItem &dset); + + /** writes the current Presentation LUT to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. In the case of a MONOCHROME1 image an inverted + * LUT is written to dataset because the print bitmap is always MONOCHROME2. + * @param dset the dataset to which the Presentation LUT SQ/Shape is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition writePresentationLUTforPrint(DcmItem &dset); + + /** checks whether the attached image is MONOCHROME1. In this case, the + * presentation LUT must be reversed when applied to the print bitmap + * which is always MONOCHROME2. + * @return OFTrue if attached image is MONOCHROME1, OFFalse otherwise. + */ + OFBool isMonochrome1Image() { return currentImageMonochrome1; } + + /** check if a VOI window is currently active + * @return OFTrue if a VOI window is active + */ + OFBool haveActiveVOIWindow(); + + /** check if a VOI LUT is currently active + * @return OFTrue if a VOI LUT is active + */ + OFBool haveActiveVOILUT(); + + /** returns a description string for a currently active VOI transform. + * If no description is available, NULL is returned. + * @return a pointer to a string or NULL. + */ + const char *getCurrentVOIDescription(); + + /** gets the width of the current VOI window. + * May only be called if haveActiveVOIWindow() is OFTrue. + * @param w the window width is returned in this parameter + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getCurrentWindowWidth(double &w); + + /** get the center of the current VOI window. + * May only be called if haveActiveVOIWindow() is OFTrue. + * @param c the window center is returned in this parameter + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getCurrentWindowCenter(double &c); + + /** gets the number of VOI LUTs available in the attached image. + */ + size_t getNumberOfVOILUTsInImage(); + + /** gets the number of VOI Windows available in the attached image. + */ + size_t getNumberOfVOIWindowsInImage(); + + /** returns a description string for the given VOI LUT in the attached + * image. + * If no description for the given index is available, NULL is returned. + * @param idx index, must be < getNumberOfVOILUTsInImage() + * @return a pointer to a string or NULL. + */ + const char *getDescriptionOfVOILUTsInImage(size_t idx); + + /** returns a description string for the given VOI Window + * in the attached image. + * If no description for the given index is available, NULL is returned. + * @param idx index, must be < getNumberOfVOIWindowsInImage() + * @return a pointer to a string or NULL. + */ + const char *getDescriptionOfVOIWindowsInImage(size_t idx); + + /** activates one of the VOI LUTs from the attached image. + * The applicability of the activation is controlled by the applicability parameter. + * @param idx index of the VOI transform, must be < getNumberOfVOILUTsInImage(). + * @param applicability defines the applicability of the new VOI transform. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setVOILUTFromImage(size_t idx, + DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** activates one of the VOI Windows from the attached image. + * The applicability of the activation is controlled by the applicability parameter. + * @param idx index of the VOI transform, must be < getNumberOfVOIWindowsInImage(). + * @param applicability defines the applicability of the new VOI transform. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setVOIWindowFromImage(size_t idx, + DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** sets a user defined VOI window center and width. + * The applicability of the VOI window is controlled by the applicability parameter. + * @param wCenter the window center + * @param wWidth the window width + * @param description an optional description. Default: absent. + * @param applicability defines the applicability of the new VOI transform. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setVOIWindow(double wCenter, double wWidth, const char *description=NULL, + DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** stores a VOI lookup table in the presentation state. + * This method stores a VOI lookup table in the + * presentation state and activates it. The LUT is copied to + * the presentation state. + * If the method returns an error code, an old LUT is left unchanged. + * The applicability of the VOI LUT is controlled by the applicability parameter. + * @param lutDescriptor the LUT Descriptor in DICOM format (VM=3) + * @param lutData the LUT Data in DICOM format + * @param lutExplanation the LUT Explanation in DICOM format, may be empty. + * @param applicability defines the applicability of the new VOI transform. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setVOILUT( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation, + DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** deactivates the current VOI transformation. + * The applicability of the deactivation is controlled by the applicability parameter. + * After a call to this method, no VOI transform is active for the current image and frame. + * @param applicability defines the applicability of the new VOI transform. + */ + void deactivateVOI(DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** stores VOI lookup table with a gamma curve shape in the presentation state. + * If a VOI window is currently active the center and width values are used to specify + * the number of LUT entries and the first value mapped, otherwise the full pixel range + * is used. The output range of the LUT is always 16 bit (data is stored as OW). + * This method stores a VOI lookup table in the presentation state and activates it. + * The LUT is copied to the presentation state. + * If the method returns an error code, an old LUT is left unchanged. + * The applicability of the VOI LUT is controlled by the applicability parameter. + * @param gammaValue gamma value used to create the VOI LUT data + * @param applicability defines the applicability of the new VOI transform. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setGammaVOILUT(double gammaValue, DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** gets the presentation size mode for the current image and frame. + * This method may only be called when an image is attached to the presentation state. + * @return presentation size mode + */ + DVPSPresentationSizeMode getDisplayedAreaPresentationSizeMode(); + + /** gets the presentation pixel aspect ratio for for the current image and frame. + * Pixel aspect ratio is defined here as the width of a pixel divided + * by the height of a pixel (x/y). + * This method may only be called when an image is attached to the presentation state. + * @return pixel aspect ratio + */ + double getDisplayedAreaPresentationPixelAspectRatio(); + + /** gets the displayed area top lefthand corner and + * bottom righthand corner for the current potentially rotated and flipped image and frame. + * This method may only be called when an image is attached to the presentation state. + * @param tlhcX the displayed area top lefthand corner X value is returned in this parameter + * @param tlhcY the displayed area top lefthand corner Y value is returned in this parameter + * @param brhcX the displayed area bottom righthand corner X value is returned in this parameter + * @param brhcY the displayed area bottom righthand corner Y value is returned in this parameter + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getStandardDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY); + + /** gets the displayed area top lefthand corner and + * bottom righthand corner for the current image and frame, as if the image was unrotated + * This method may only be called when an image is attached to the presentation state. + * @param tlhcX the displayed area top lefthand corner X value is returned in this parameter + * @param tlhcY the displayed area top lefthand corner Y value is returned in this parameter + * @param brhcX the displayed area bottom righthand corner X value is returned in this parameter + * @param brhcY the displayed area bottom righthand corner Y value is returned in this parameter + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition getImageRelativeDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY); + + /** gets the presentation pixel spacing for the current image and frame if it is known. + * @param x the horizontal pixel spacing (mm) is returned in this parameter upon success + * @param y the vertical pixel spacing (mm) is returned in this parameter upon success + * @return EC_Normal if successful, an error code if no presentation pixel spacing is available. + */ + OFCondition getDisplayedAreaPresentationPixelSpacing(double& x, double& y); + + /** gets the presentation pixel magnification ratio for the current image and frame if it is present. + * @param magnification the magnification ratio is returned in this parameter upon success + * @return EC_Normal if successful, an error code if no magnification ratio is available. + */ + OFCondition getDisplayedAreaPresentationPixelMagnificationRatio(double& magnification); + + /** checks if "TRUE SIZE" can be used as presentation size mode for the current image and frame + * (i.e. pixel spacing is known). + * @return OFTrue if TRUE SIZE mode is available, OFFalse otherwise. + */ + OFBool canUseDisplayedAreaTrueSize(); + + /** sets the displayed area and size mode (for the current frame, the current image + * or all images referenced by the presentation state object). + * @param sizeMode presentation size mode. + * @param tlhcX displayed area top lefthand corner X + * @param tlhcY displayed area top lefthand corner Y + * @param brhcX displayed area bottom righthand corner X + * @param brhcY displayed area bottom righthand corner Y + * @param magnification magnification factor - ignored unless sizeMode==DVPSD_magnify. + * @param applicability defines the applicability of the new displayed area definition. + * Possible choices are: DVPSB_currentFrame - current frame only, + * DVPSB_currentImage - all frames of current image (default), + * and DVPSB_allImages - all images referenced by this presentation state. + * The last choice should be used with care + * because it will also cause the pixel spacing or pixel aspect ratio of the current image + * to be applied to all images referenced by the presentation state. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setStandardDisplayedArea( + DVPSPresentationSizeMode sizeMode, + Sint32 tlhcX, Sint32 tlhcY, + Sint32 brhcX, Sint32 brhcY, + double magnification=1.0, + DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** sets the displayed area and size mode (for the current frame, the current image + * or all images referenced by the presentation state object). + * Treats the image as if it was neither rotated nor flipped. + * @param sizeMode presentation size mode. + * @param tlhcX displayed area top lefthand corner X + * @param tlhcY displayed area top lefthand corner Y + * @param brhcX displayed area bottom righthand corner X + * @param brhcY displayed area bottom righthand corner Y + * @param magnification magnification factor - ignored unless sizeMode==DVPSD_magnify. + * @param applicability defines the applicability of the new displayed area definition. + * Possible choices are: DVPSB_currentFrame - current frame only, + * DVPSB_currentImage - all frames of current image (default), + * and DVPSB_allImages - all images referenced by this presentation state. + * The last choice should be used with care + * because it will also cause the pixel spacing or pixel aspect ratio of the current image + * to be applied to all images referenced by the presentation state. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setImageRelativeDisplayedArea( + DVPSPresentationSizeMode sizeMode, + Sint32 tlhcX, Sint32 tlhcY, + Sint32 brhcX, Sint32 brhcY, + double magnification=1.0, + DVPSObjectApplicability applicability=DVPSB_currentImage); + + /** deactivates display shutter of given type. + * After a call to this method haveShutter(type) will return OFFalse. + * @param type the shutter type + */ + void removeShutter(DVPSShutterType type); + + /** sets and activates rectangular display shutter. + * If a bitmap shutter is exists, it is deactivated if this + * method returns successfully. If no shutter display value exists, + * a default of 0 (black) is set. + * @param lv the left vertical edge + * @param rv the right vertical edge + * @param uh the upper horizontal edge + * @param lh the lower horizontal edge + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setRectShutter(Sint32 lv, Sint32 rv, Sint32 uh, Sint32 lh); + /** sets and activates circular display shutter. + * If a bitmap shutter is exists, it is deactivated if this + * method returns successfully. If no shutter display value exists, + * a default of 0 (black) is set. + * @param centerX the X component of the shutter center + * @param centerY the Y component of the shutter center + * @param radius the (horizontal) radius of the shutter + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition setCircularShutter(Sint32 centerX, Sint32 centerY, Sint32 radius); + + /** sets polygonal display shutter point. + * This method adds a point to the polygonal display shutter, + * which must already have at least an origin. + * If the point set with this method is identical to the + * origin of the shutter, the shutter is activated and + * a possible bitmap shutter is deactivated. If no shutter display value exists, + * a default of 0 (black) is set. + * @param x the x component of the shutter origin + * @param y the x component of the shutter origin + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition addPolyShutterVertex(Sint32 x, Sint32 y); + + /** removes and deletes a graphic layer. All text, graphic, curve + * and overlay objects on this graphic layer are also deleted or deactivated, respectively. + * @param idx index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeGraphicLayer(size_t idx); + + /** returns the number of text objects for the given + * graphic layer. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return number of text objects + */ + size_t getNumberOfTextObjects(size_t layer); + + /** gets the text object with the given index + * on the given layer. If the text object or the graphic layer does + * not exist, NULL is returned. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the text object, must be < getNumberOfTextObjects(layer) + * @return a pointer to the text object + */ + DVPSTextObject *getTextObject(size_t layer, size_t idx); + + /** creates a new text object on the given layer. + * Returns a pointer to the new text object. + * If the creation of the text object fails or if the graphic layer + * does not exist, NULL is returned. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param applicability defines to which images/frames the new object applies. + * Default: all images referenced by the presentation state. + * @return a pointer to the new text object + */ + DVPSTextObject *addTextObject(size_t layer, + DVPSObjectApplicability applicability=DVPSB_allImages); + + /** deletes the text object with the given index + * on the given layer. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the text object, must be < getNumberOfTextObjects(layer) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeTextObject(size_t layer, size_t idx); + + /** moves the text object with the given index on the given + * layer to a different layer. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param old_layer index of the graphic layer on which the text object is, + * must be < getNumberOfGraphicLayers() + * @param idx index of the text object, must be < getNumberOfTextObjects(layer) + * @param new_layer index of the graphic layer to which the text object is moved, + * must be < getNumberOfGraphicLayers() + * @param applicability defines to which images/frames the new object applies from now on. + * Default: all images referenced by the presentation state. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition moveTextObject(size_t old_layer, size_t idx, size_t new_layer, + DVPSObjectApplicability applicability=DVPSB_allImages); + + /** returns the number of graphic objects for the given + * graphic layer. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @return number of graphic objects + */ + size_t getNumberOfGraphicObjects(size_t layer); + + /** gets the graphic object with the given index + * on the given layer. If the graphic object or the graphic layer does + * not exist, NULL is returned. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the graphic object, must be < getNumberOfGraphicObjects(layer) + * @return a pointer to the graphic object + */ + DVPSGraphicObject *getGraphicObject(size_t layer, size_t idx); + + /** creates a new graphic object on the given layer. + * Returns a pointer to the new graphic object. + * If the creation of the graphic object fails or if the graphic layer + * does not exist, NULL is returned. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param applicability defines to which images/frames the new object applies. + * Default: all images referenced by the presentation state. + * @return a pointer to the new graphic object + */ + DVPSGraphicObject *addGraphicObject(size_t layer, + DVPSObjectApplicability applicability=DVPSB_allImages); + + /** deletes the graphic object with the given index + * on the given layer. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the graphic object, must be < getNumberOfGraphicObjects(layer) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition removeGraphicObject(size_t layer, size_t idx); + + /** moves the graphic object with the given index on the given + * layer to a different layer. + * Only the objects that are applicable to the current (attached) image + * and the selected frame number are used by this method. + * @param old_layer index of the graphic layer on which the graphic object is, + * must be < getNumberOfGraphicLayers() + * @param idx index of the graphic object, must be < getNumberOfGraphicObjects(layer) + * @param new_layer index of the graphic layer to which the graphic object is moved, + * must be < getNumberOfGraphicLayers() + * @param applicability defines to which images/frames the new object applies from now on. + * Default: all images referenced by the presentation state. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition moveGraphicObject(size_t old_layer, size_t idx, size_t new_layer, + DVPSObjectApplicability applicability=DVPSB_allImages); + + /** gets the curve with the given index + * on the given layer. If the curve or the graphic layer does + * not exist, NULL is returned. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the curve, must be < getNumberOfCurves(layer) + * @return a pointer to the curve + */ + DVPSCurve *getCurve(size_t layer, size_t idx); + + /** returns the number of curves in the attached image + * that could be activated in the presentation state. + * @return number of available curves + */ + size_t getNumberOfCurvesInImage(); + + /** gets the curve with the given index + * from the attached image. If the curve does + * not exist, NULL is returned. + * @param idx index of the curve, must be < getNumberOfCurvesInImage() + * @return a pointer to the curve + */ + DVPSCurve *getCurveInImage(size_t idx); + + /** activates curve in presentation state. + * This method adds an activation for the given curve from the + * attached image to the given graphic layer in the presentation state. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param curveidxinimage index of the curve in the attached image, + * must be < getNumberOfCurvesInImage() + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition addCurve(size_t layer, size_t curveidxinimage); + + /** gets the overlay label of the given activated overlay. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the overlay, must be < getNumberOfActiveOverlays(). + * @return label string if it exists, NULL otherwise. + */ + const char *getActiveOverlayLabel(size_t layer, size_t idx); + + /** gets the overlay description of the given activated overlay. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the overlay, must be < getNumberOfActiveOverlays(). + * @return description string if it exists, NULL otherwise. + */ + const char *getActiveOverlayDescription(size_t layer, size_t idx); + + /** checks whether the given activated overlay is a ROI + * (region of interest) overlay. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the overlay, must be < getNumberOfActiveOverlays(). + * @return OFTrue if overlay exists and is ROI, OFFalse otherwise. + */ + OFBool activeOverlayIsROI(size_t layer, size_t idx); + + /** gets one overlay bitmap. + * @param layer index of the graphic layer on which this overlay is + * activated, must be < getNumberOfGraphicLayers(). + * @param idx index of the overlay activation on the given layer, + * must be < getNumberOfActiveOverlays(layer). + * @param overlayData upon success a pointer to the overlay plane is passed back + * in this parameter. The overlay plane is organized as one byte or one word per pixel. + * The byte/word values are already transformed from pvalues to DDLs. + * @param width upon success the width of the overlay bitmap in pixels is returned in this parameter. + * @param height upon success the height of the overlay bitmap in pixels is returned in this parameter. + * @param left_pos upon success the horizontal position of the overlay relative to the image + * is returned. 0 means that the overlay is left aligned with the image. + * Since the overlay is cropped at the borders of the image, values < 0 are impossible. + * @param top_pos upon success the vertical position of the overlay relative to the image + * is returned. + * @param isROI returns OFTrue if the overlay is ROI, OFFalse if the overlay is Graphic. + * @param fore returns value of foreground color (pvalue), all other values are transparent + * @param bits number of bits used for overlayData (valid: 8 or 12, default: 8). If bits is less than or + * equal to 8 the resulting overlayData is an array of 8 bit values, an array 16 bit values otherwise. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getOverlayData( + size_t layer, + size_t idx, + const void *&overlayData, + unsigned int &width, + unsigned int &height, + unsigned int &left_pos, + unsigned int &top_pos, + OFBool &isROI, + Uint16 &fore, + unsigned int bits = 8); + + /** gets the number of overlays which are embedded in the + * image currently attached to the presentation state. Overlays in the image are counted only + * if they are not shadowed by overlays that are embedded in the presentation state + * and use the same repeating group number. + * @return number of overlays in attached image + */ + size_t getNumberOfOverlaysInImage(); + + /** gets the repeating group number of the given overlay in the attached image. + * @param idx index of the overlay, must be < getNumberOfOverlaysInImage(). + * @return repeating group number if found, 0 otherwise. + */ + Uint16 getOverlayInImageGroup(size_t idx); + + /** gets the overlay label of the given overlay in the attached image. + * @param idx index of the overlay, must be < getNumberOfOverlaysInImage(). + * @return label string if it exists, NULL otherwise. + */ + const char *getOverlayInImageLabel(size_t idx); + + /** gets the overlay description of the given overlay in the attached image. + * @param idx index of the overlay, must be < getNumberOfOverlaysInImage(). + * @return description string if it exists, NULL otherwise. + */ + const char *getOverlayInImageDescription(size_t idx); + + /** gets the index of the activation layer on which the given + * overlay from the attached image is activated. + * @param idx index of the overlay, must be < getNumberOfOverlaysInImage(). + * @return layer index (which is < getNumberOfGraphicLayers()) if overlay exists + * and is activated, DVPS_IDX_NONE otherwise. + */ + size_t getOverlayInImageActivationLayer(size_t idx); + + /** checks whether the given overlay in the attached image is a ROI + * (region of interest) overlay. + * @param idx index of the overlay, must be < getNumberOfOverlaysInImage(). + * @return OFTrue if overlay exists and is ROI, OFFalse otherwise. + */ + OFBool overlayInImageIsROI(size_t idx); + + /** removes an overlay from the presentation state. + * If the overlay is activated, the activation is also removed. + * Since overlays in the presentation state can shadow overlays in the attached image, + * execution of this method may change the number of overlays reported in the attached image. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition removeOverlayFromPresentationState(size_t idx); + + /** changes the repeating group used for an overlay in the presentation state. + * Since overlays in the presentation state can shadow overlays in the attached image, + * execution of this method may change the number of overlays reported in the attached image. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @param newGroup new repeating group number 0x6000-0x601F (even). If this optional parameter is omitted, + * the method attemps to automatically determine a new group number so that no overlay in the + * attached image is shadowed any more. If this is impossible, the method fails and leaves + * the overlay repeating group unchanged. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition changeOverlayGroupInPresentationState(size_t idx, Uint16 newGroup=0); + + /** adds a new overlay bitmap to the presentation state. + * The overlay is read from a DICOM dataset which must contain the + * attributes required for a graphic or ROI overlay, see class DVPSOverlay. + * The dataset can be an image or standalone overlay IOD. + * The overlay data is copied into the presentation state, i.e. the DICOM dataset + * can be deleted after execution of this method. + * @param overlayIOD the DICOM dataset from which the overlay is to be read + * @param groupInItem the repeating group 0x6000..0x61F (even) of the overlay to be read + * @param newGroup repeating group number 0x6000-0x601F (even) to be used for + * the overlay in the presentation state. If this optional parameter is omitted, + * the method attemps to automatically determine a new group number so that no overlay in the + * attached image is shadowed any more. If this is impossible, a group number so far unused + * in the presentation state is taken. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition addOverlayToPresentationState(DcmItem& overlayIOD, Uint16 groupInItem, Uint16 newGroup=0); + + /** checks if an overlay from the presentation state is suitable + * for use as a bitmap shutter. An overlay is suitable if it is a graphic overlay + * with the same size as the attached image and with the origin 1\1. + * This method does not check wether the overlay is already activated as overlay + * or bitmap shutter. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return OFTrue if overlay can be used as display shutter. + */ + OFBool overlayIsSuitableAsBitmapShutter(size_t idx); + + /** activates the given overlay from the attached image + * on the given graphic layer. + * If the overlay is already activated (i.e. + * getOverlayInImageActivationLayer(idx) != DVPS_IDX_NONE) this method fails. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the overlay, must be < getNumberOfOverlaysInImage(). + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition activateOverlayInImage(size_t layer, size_t idx); + + /** activates the given overlay from the presentation state + * on the given graphic layer. + * If the overlay is already activated or used as a bitmap overlay (i.e. + * getOverlayInPresentationStateActivationLayer(idx) != DVPS_IDX_NONE or + * overlayIsBitmapShutter(idx) == OFTrue) this method fails. + * @param layer index of the graphic layer, must be < getNumberOfGraphicLayers() + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition activateOverlayInPresentationState(size_t layer, size_t idx); + + /** activates an overlay as bitmap shutter. + * The overlay must not be activated on a graphic layer (i.e. + * getOverlayInPresentationStateActivationLayer(idx) != DVPS_IDX_NONE, + * otherwise this method fails. + * @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState(). + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition activateOverlayAsBitmapShutter(size_t idx); + + /** removes activation for an overlay which may be + * embedded in the attached image or part of the presentation state. + * @param layer index of the graphic layer on which this overlay is + * activated, must be < getNumberOfGraphicLayers(). + * @param idx index of the overlay activation on the given layer, + * must be < getNumberOfActiveOverlays(layer). + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition deactivateOverlay(size_t layer, size_t idx); + + /** attaches an image to the presentation state. + * If an image is already attached to the presentation state, + * the old image is detached (and freed if necessary) and the new image is attached. + * A preview image is created automatically (if values for preview resolution are valid). + * @param dataset pointer to the DICOM image as DcmDataset. + * @param transferOwnership if true, the presentation state assumes ownership + * of the passed DcmDataset, which is freed when a different image is attached + * or the presentation state is deleted. + * @return EC_Normal if successful, an error code otherwise. If an error code + * is returned, the presentation state has the same state as before the call + * to this method. + */ + OFCondition attachImage(DcmDataset *dataset, OFBool transferOwnership); + + /** attaches an image to the presentation state. + * If an image is already attached to the presentation state, + * the old image is detached (and freed if necessary) and the new image is attached. + * A preview image is created automatically (if values for preview resolution are valid). + * @param fileformat pointer to the DICOM image as DcmFileFormat. + * @param transferOwnership if true, the presentation state assumes ownership + * of the passed DcmFileFormat, which is freed when a different image is attached + * or the presentation state is deleted. + * @return EC_Normal if successful, an error code otherwise. If an error code + * is returned, the presentation state has the same state as before the call + * to this method. + */ + OFCondition attachImage(DcmFileFormat *fileformat, OFBool transferOwnership); + + /** detaches and frees the image (incl. preview) attached to the presentation state. + */ + void detachImage(); + + /** checks whether image is inverse (shape, plut or mono1). + * @return OFTrue if image is inverse, OFFalse otherwise. + */ + OFBool isInverse(); + + /** inverts image by changing presentation state LUT or presentation state LUT shape. + * Pixel data has to be re-get after this transformation. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition invertImage(); + + /** applies presentation state to attached image and returns image bitmap. + * This method sets all parameter required to correctly render the pixel data + * in the image attached to the presentation state and then creates the + * required pixel data which contains all grayscale transformations but none + * of the none-grayscale transformations of the presentation state "burned in" + * into the pixel data. The pixel data returned is already corrected by a + * display transform for the current display device and can be mapped directly + * to digital driving levels of the graphics board. The pointer to the pixel + * data remains valid until the next call to this function, or until the + * image is detached or the presentation state is deleted. + * @param pixelData in this parameter a pointer to the pixel data is returned + * (array of 8 bit values). The storage area allocated for this pointer must + * not be freed by the caller. If the return value is an error code, + * no valid pixel data pointer may be assumed. + * @param width returns the width of the bitmap in pixels + * @param height returns the height of the bitmap in pixels + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getPixelData( + const void *&pixelData, + unsigned long &width, + unsigned long &height); + + /** same as method above apart from the fact that the storage area is handled + * externally. + * @param pixelData pointer to storage area where the pixel data is copied to + * (array of 8 bit values). The storage area must be allocated and deleted + * from the calling method. + * @param size specifies size of the storage area in bytes. + * @return EC_Normal upon success, an error code otherwise. + */ + OFCondition getPixelData( + void *pixelData, + unsigned long size); + + /** returns the SOP Class UID of the currently attached image. + * @return SOP class UID of current image, NULL if absent + */ + const char *getAttachedImageSOPClassUID(); + + /** returns the SOP Instance UID of the currently attached image. + * @return SOP instance UID of current image, NULL if absent + */ + const char *getAttachedImageSOPInstanceUID(); + + /** gets the width of the attached image. + * The rotation status of the presentation state is not taken + * into account, i.e. the width of an unrotated image is returned. + * This method may only be called when an image is attached to the + * presentation state. + * @param width upon success, the image width (pixels) is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getImageWidth(unsigned long &width); + + /** gets the height of the attached image. + * The rotation status of the presentation state is not taken + * into account, i.e. the height of an unrotated image is returned. + * This method may only be called when an image is attached to the + * presentation state. + * @param height upon success, the image height (pixels) is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getImageHeight(unsigned long &height); + + /** gets number of bytes used for the print bitmap. + * (depends on width, height and depth) + * @return number of bytes used for the print bitmap + */ + unsigned long getPrintBitmapSize(); + + /** sets the minimum print bitmap width and height. + * Smaller images are scaled up by an appropriate integer factor. Both maximum + * values need to be twice greater than the maximum of the minimum values. + * @param width minimum width of print bitmap (in pixels) + * @param height minimum height of print bitmap (in pixels) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setMinimumPrintBitmapWidthHeight(unsigned long width, + unsigned long height); + + /** sets the maximum print bitmap width and height. + * Larger images are scaled down by an appropriate integer factor. Both maximum + * values need to be twice greater than the maximum of the minimum values. + * @param width maximum width of print bitmap (in pixels) + * @param height maximum height of print bitmap (in pixels) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition setMaximumPrintBitmapWidthHeight(unsigned long width, + unsigned long height); + + /** gets width and height of print bitmap. + * Bitmap size depends on implicit scaling, a heuristic is used for very small images. + * The return values depend on the current minimum/maximum print bitmap width/height values! + * @param width upon success, the bitmap width (in pixels) is returned in this parameter + * @param height upon success, the bitmap height (in pixels) is returned in this parameter + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPrintBitmapWidthHeight(unsigned long &width, + unsigned long &height); + + /** gets width of print bitmap. + * Bitmap size depends on implicit scaling, a heuristic is used for very small images. + * The return value depends on the current minimum/maximum print bitmaps width/height values! + * @param width upon success, the image width (in pixels) is returned in this parameter + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPrintBitmapWidth(unsigned long &width); + + /** gets height of print bitmap. + * bitmap size depends on implicit scaling, a heuristic is used for very small images + * The return value depends on the current minimum/maximum print bitmaps width/height values! + * @param height upon success, the image height (in pixels) is returned in this parameter + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPrintBitmapHeight(unsigned long &height); + + /** gets the presentation pixel aspect ratio for the print bitmap. + * Pixel aspect ratio is defined here as the width of a pixel divided + * by the height of a pixel (x/y). The related image is already rotated and flipped! + * @return pixel aspect ratio + */ + double getPrintBitmapPixelAspectRatio(); + + /** gets requested image size for print bitmap. + * If the presentation state mode is DVPSD_trueSize, this method computes + * the true physical width (in mm) of the print image (under consideration of the + * rotation status) and writes it to the requestedImageSize string. + * @param requestedImageSize requested image size is written to this parameter upon + * successful return. Otherwise string is empty upon return. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPrintBitmapRequestedImageSize(OFString& requestedImageSize); + + /** writes the bitmap data into the given buffer. + * The bitmap has the format: 12 bits stored and 16 bits allocated. This method is used + * to create the preformatted bitmap where the annotations are later burned in. + * Implicit scaling is performed if the bitmap is too small (see minimum bitmap size). + * The storage area must be allocated and deleted from the calling method. + * @param bitmap pointer to storage area where the pixel data is copied to. + * @param size specifies size of the storage area in bytes + * @param inversePLUT render inverse PLUT into bitmap if OFTrue (optional) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPrintBitmap(void *bitmap, + unsigned long size, + OFBool inversePLUT = OFFalse); + + /** creates a new preview image based on the current image and pstate. + * The maximum size of this image is specified by the two parameters maxWidth and maxHeight. + * The actual size should be determined using one of the following appropriate methods (e.g. + * getPreviewImageWidthHeight) since the original pixel aspect ratio is alsways considered. + * The preview image includes all grayscale and spatial transformations performed on the + * current image so far. The method renderPixelData also renders the preview image (if existing). + * Therefore the preview image is always held consistent with the current image. + * Overlays, bitmapped shutters and any other annotations are not rendered into the preview image. + * @param maxWidth the maximum width used to create the preview image + * @param maxHeight the maximum height used to create the preview image + * @param clipMode specifies whether to clip the preview image to the displayed area (not implemented!) + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition createPreviewImage(unsigned long maxWidth, + unsigned long maxHeight, + OFBool clipMode = OFFalse); + + /** deletes and disables the current preview image. + */ + void deletePreviewImage(); + + /** gets number of bytes used for the preview image bitmap. + * (depends on width and height) + * @return number of bytes used for the preview image bitmap + */ + unsigned long getPreviewImageSize(); + + /** gets current width and height of the preview image. + * @param width upon success, the image width (in pixels) is returned in this parameter + * @param height upon success, the image height (in pixels) is returned in this parameter + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPreviewImageWidthHeight(unsigned long &width, + unsigned long &height); + + /** gets current width of the preview image. + * @param width upon success, the image width (in pixels) is returned in this parameter + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPreviewImageWidth(unsigned long &width); + + /** gets current height of the preview image. + * @param height upon success, the image height (in pixels) is returned in this parameter + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPreviewImageHeight(unsigned long &height); + + /** writes the bitmap data of the preview image into the given buffer. + * The storage area must be allocated and deleted from the calling method. + * @param bitmap pointer to storage area where the pixel data is copied to (array of 8 bit values) + * @param size specifies size of the storage area in bytes + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getPreviewImageBitmap(void *bitmap, + unsigned long size); + + /** gets smallest and biggest possible pixel value in the attached image. + * These values are defined as the smallest and biggest number that + * could possibly be contained in the image after application of the Modality transform, + * but before any VOI, Presentation or display transform. + * This method may only be called when an image is attached to the + * presentation state. + * @param minValue upon success, the smallest value is returned in this parameter. + * @param maxValue upon success, the biggest value is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getImageMinMaxPixelRange(double &minValue, double& maxValue); + + /** gets smallest and biggest occuring pixel value in the attached image. + * These values are defined as the smallest and biggest number that + * are actually contained in the image after application of the Modality transform, + * but before any VOI, Presentation or display transform. + * This method may only be called when an image is attached to the + * presentation state. + * @param minValue upon success, the smallest value is returned in this parameter. + * @param maxValue upon success, the biggest value is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getImageMinMaxPixelValue(double &minValue, double& maxValue); + + /** gets the number of frames of the current (attached) image. + * This method may only be called when an image is attached to the + * presentation state. + * @param frames upon success, the number of frames is returned in this parameter. + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition getImageNumberOfFrames(unsigned long &frames); + + /** selects one frame of a multiframe image. This affects the image bitmap + * that is rendered, the overlay bitmaps and the visibility of graphic and text objects. + * This method may only be called when an image is attached to the + * presentation state. + * @param frame frame number in the range [1..getImageNumberOfFrames()] + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition selectImageFrameNumber(unsigned long frame); + + /** gets the index of the currently selected frame in a multi-frame image. + * @return index of the currently selected frame, 0 if an error occurred + */ + unsigned long getSelectedImageFrameNumber(); + + /** gets the currently selected display transform. + * Display transform will only be performed if switched on _and_ + * a valid monitor characteristics description exists. + * Default after creation of a presentation state is "on". + * @return current display transform if on, DVPSD_none if off. + */ + DVPSDisplayTransform getDisplayTransform() { return displayTransform; } + + /** activates or deactivates display correction. + * Display transform will only be performed if switched on + * _and_ a valid display function object exists. + * @param transform display transform to be set, DVPSD_none to switch off. + */ + void setDisplayTransform(DVPSDisplayTransform transform) { displayTransform = transform; } + + /** converts a 16-bit P-Value to an 8-bit DDL value for on-sceen display. + * If a display function is set and enabled (see setDisplayTransform()), + * the DDL is corrected for the nonlinearity of the display, otherwise + * a simple linear mapping is performed. For 12-bit DDL values (hardcopy) + * the display function is automatically disabled. + * @param pvalue P-Value 0..0xFFFF + * @param bits number of bits used for the output DDL value (8 = softcopy, 12 = hardcopy) + * @return display driving level (DDL), 0..0xFF (8 bit) / 0..0xFFF (12 bit) + */ + Uint16 convertPValueToDDL(Uint16 pvalue, unsigned int bits = 8); + + /** writes the patient module attributes and a source image sequence + * for a grayscale hardcopy image. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition writeHardcopyImageAttributes(DcmItem &dset); + + /** gets the modality of the attached image. + * @return modality string if it exists, NULL or empty string otherwise. + */ + const char *getCurrentImageModality(); + + /** tries to find an overlay repeating group that is not used in the + * presentation state or the attached image. If that does not exist, + * it returns a group number that is unused in the presentation state + * but used in the image. + * @param currentGroup the current group number of the overlay + * to be changed (if any) + * @return group number 0x6000..0x601F if found, 0 otherwise. + */ + Uint16 findOverlayGroup(Uint16 currentGroup=0); + + /** prepares pixel data for image and overlays for access. + * This method is called internally before any image pixel data + * or overlay bitmaps is created. It makes sure that the following settings + * of the presentation state are reflected in the dcmimage-based + * image processing routines: VOI transformation, Presentation LUT, + * rotation, flip, overlay activation. + * @param display use current display function if OFTrue, don't use otherwise + */ + void renderPixelData(OFBool display = OFTrue); + + /** attempts to find the displayed area selection for the + * current image and frame. If not found, creates a default. + * @return displayed area selection item. If creation of a default failed + * or no image is attached to the presentation state, returns NULL. + */ + DVPSDisplayedArea *getDisplayedAreaSelection(); + + /** attempts to find the Softcopy VOI LUT item for the + * current image and frame. If not found, returns NULL. + * @return softcopy VOI LUT item for current image and frame if found, NULL otherwise + */ + DVPSSoftcopyVOI *getCurrentSoftcopyVOI(); + +private: + + /// private undefined copy constructor + DVPresentationState(const DVPresentationState& other); + + /// private undefined assignment operator + DVPresentationState& operator=(const DVPresentationState& other); + + /** helper method that activates the given overlay in the given image + * @param ovl overlay to activate + * @param image image to be rendered + * @param asShutter true if overlay should be used as bitmap shutter + * @param pvalue pvalue for overlay foreground + * @return EC_Normal if successful, an error code otherwise + */ + static OFCondition activateOverlayHelper( + DVPSOverlay& ovl, + DicomImage &image, + OFBool asShutter = OFFalse, + Uint16 pvalue = 0); + + /* connection with dcmimage */ + + /** a pointer to the DICOM dataset comprising the image + * to which the presentation state is currently applied + */ + DcmDataset *currentImageDataset; + /** a pointer to the fileformat (if it exists) of the + * DICOM dataset comprising the image to which the + * presentation state is currently applied + */ + DcmFileFormat *currentImageFileformat; + /** a pointer to the dcmimage representation of the + * image to which the presentation state is currently applied + */ + DicomImage *currentImage; + /** a pointer to the dcmimage representation of the (smaller) preview + * image to which the presentation state is currently applied + */ + DicomImage *previewImage; + /** contains the width of the attached image without consideration of rotation. + */ + unsigned long currentImageWidth; + /** contains the height of the attached image without consideration of rotation. + */ + unsigned long currentImageHeight; + /** contains the width of the attached image after pixel data have been rendered (w/o clipping). + */ + unsigned long renderedImageWidth; + /** contains the height of the attached image after pixel data have been rendered (w/o clipping). + */ + unsigned long renderedImageHeight; + /** contains the top hand corner of the attached image after pixel data have been rendered. + */ + signed long renderedImageTop; + /** contains the left hand corner of the attached image after pixel data have been rendered. + * (the following equation is always true: renderedImageTop <= renderedImageBottom) + */ + signed long renderedImageLeft; + /** contains the bottom hand corner of the attached image after pixel data have been rendered. + * (the following equation is always true: renderedImageLeft <= renderedImageRight) + */ + signed long renderedImageBottom; + /** contains the right hand corner of the attached image after pixel data have been rendered. + */ + signed long renderedImageRight; + /** contains the SOP Class UID of the attached image + */ + char *currentImageSOPClassUID; + /** contains the SOP Instance UID of the attached image + */ + char *currentImageSOPInstanceUID; + /** contains the current selected frame number of the attached image. + * Frame numbers are counted from 1 (like in DICOM, unlike dcmimgle). + */ + unsigned long currentImageSelectedFrame; + /** a flag describing whether the presentation state is owner of + * the DICOM dataset in currentImageDataset/currentImageFileformat. + * If the presentation state is owner, it will delete the dataset + * upon its own destruction or attachment of a different image. + */ + OFBool currentImageOwned; + /** a flag describing whether the VOI settings in currentImage + * match the ones in the presentation state. + */ + OFBool currentImageVOIValid; + /** a flag describing whether the presentation LUT settings + * in currentImage match the ones in the presentation state. + */ + OFBool currentImagePLUTValid; + /** a flag describing whether currentImage has been flipped + */ + OFBool currentImageFlip; + /** a flag describing the current rotation angle of currentImage + */ + DVPSRotationType currentImageRotation; + /** a flag describing whether the Overlay settings in + * currentImage match the ones in the presentation state. + * values: 0=invalid, 1=invalid, but no external overlay added, 2=valid + */ + int currentImageOverlaysValid; + + /** list of curves of the currently attached image + */ + DVPSCurve_PList currentImageCurveList; + /** list of VOI LUTs of the currently attached image + */ + DVPSVOILUT_PList currentImageVOILUTList; + /** list of VOI Windows of the currently attached image + */ + DVPSVOIWindow_PList currentImageVOIWindowList; + + /** modality of currently attached image (if any) + */ + DcmCodeString currentImageModality; + + /** true if attached image is MONOCHROME1 + */ + OFBool currentImageMonochrome1; + + /** flag indicating the currently selected display transform + * DVPSD_none if switched off + */ + DVPSDisplayTransform displayTransform; + + /** a flag describing whether current image is inverse + */ + OFBool imageInverse; + + /** reference to list of display functions if existing + */ + DiDisplayFunction **displayFunction; + + /** minimum width of print bitmap (used for implicit scaling) + */ + unsigned long minimumPrintBitmapWidth; + + /** minimum height of print bitmap (used for implicit scaling) + */ + unsigned long minimumPrintBitmapHeight; + + /** maximum width of print bitmap (used for implicit scaling) + */ + unsigned long maximumPrintBitmapWidth; + + /** maximum height of print bitmap (used for implicit scaling) + */ + unsigned long maximumPrintBitmapHeight; + + /** maximum width of (optional) preview image + */ + unsigned long maximumPreviewImageWidth; + + /** maximum height of (optional) preview image + */ + unsigned long maximumPreviewImageHeight; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpstx.h b/dcmpstat/include/dcmtk/dcmpstat/dvpstx.h new file mode 100644 index 00000000..b3e3a0c2 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpstx.h @@ -0,0 +1,212 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSTextObject + * + */ + +#ifndef DVPSTX_H +#define DVPSTX_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +/** an item of the text object sequence in a presentation state (internal use only). + * This class manages the data structures comprising one item + * of the Text Object Sequence which is contained + * in the Graphic Annotation Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSTextObject +{ +public: + /// default constructor + DVPSTextObject(); + + /// copy constructor + DVPSTextObject(const DVPSTextObject& copy); + + /** clone method. + * @return a pointer to a new DVPSTextObject object containing + * a copy of this object. + */ + DVPSTextObject *clone() { return new DVPSTextObject(*this); } + + /// destructor + virtual ~DVPSTextObject(); + + /** reads a text object from a DICOM dataset. + * The DICOM elements of the Text Object item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the TextObjectSequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the text object managed by this object to a DICOM dataset. + * Copies of the DICOM element managed by this object are inserted into + * the DICOM dataset. + * @param dset the the item of the TextObjectSequence to which the data is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** checks if this text object contains an anchor point. + * @return OFTrue if anchor point present + */ + OFBool haveAnchorPoint(); + + /** checks if this text object contains bounding box. + * @return OFTrue if bounding box present + */ + OFBool haveBoundingBox(); + + /** sets an anchor point for this text object. + * @param x anchor point X value + * @param y anchor point Y value + * @param unit anchor point annotation units (pixel/display) + * @param isVisible anchor point visibility + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setAnchorPoint(double x, double y, DVPSannotationUnit unit, OFBool isVisible); + + /** sets bounding box for this text object. + * @param TLHC_x bounding box top-lefthand corner X value + * @param TLHC_x bounding box top-lefthand corner Y value + * @param BRHC_x bounding box bottom-righthand corner X value + * @param BRHC_x bounding box bottom-righthand corner Y value + * @param unit bounding box annotation units (pixel/display) + * @param justification bounding box horizontal justification (left/right/center) + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setBoundingBox(double TLHC_x, double TLHC_y, double BRHC_x, + double BRHC_y, DVPSannotationUnit unit, DVPSTextJustification justification); + + /** assigns a new "unformatted text value" for this text object. + * @param text unformatted text value. Must not be NULL or empty string. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition setText(const char *text); + + /** removes any anchor point from the text object. + * Attention: A text object must always contain either anchor point, bounding box + * or both. This property is not asserted by the text object itself. + */ + void removeAnchorPoint(); + + /** removes any bounding box from the text object. + * Attention: A text object must always contain either anchor point, bounding box + * or both. This property is not asserted by the text object itself. + */ + void removeBoundingBox(); + + /** gets the unformatted text value for this text object. + * @return unformatted text value + */ + const char *getText(); + + /** gets the bounding box TLHC x value. + * May only be called when a bounding box is present (haveBoundingBox()==OFTrue) + * @return bounding box TLHC x value + */ + double getBoundingBoxTLHC_x(); + + /** gets the bounding box TLHC y value. + * May only be called when a bounding box is present (haveBoundingBox()==OFTrue) + * @return bounding box TLHC y value + */ + double getBoundingBoxTLHC_y(); + + /** gets the bounding box BRHC x value. + * May only be called when a bounding box is present (haveBoundingBox()==OFTrue) + * @return bounding box BRHC x value + */ + double getBoundingBoxBRHC_x(); + + /** gets the bounding box BRHC y value. + * May only be called when a bounding box is present (haveBoundingBox()==OFTrue) + * @return bounding box BRHC y value + */ + double getBoundingBoxBRHC_y(); + + /** gets the bounding box annotation units. + * May only be called when a bounding box is present (haveBoundingBox()==OFTrue) + * @return bounding box annotation units + */ + DVPSannotationUnit getBoundingBoxAnnotationUnits(); + + /** gets the bounding box horizontal justification. + * May only be called when a bounding box is present (haveBoundingBox()==OFTrue) + * @return bounding box horizontal justification + */ + DVPSTextJustification getBoundingBoxHorizontalJustification(); + + /** gets the anchor point x value. + * May only be called when an anchor point is present (haveAnchorPoint()==OFTrue) + * @return anchor point x value + */ + double getAnchorPoint_x(); + + /** gets the anchor point y value. + * May only be called when an anchor point is present (haveAnchorPoint()==OFTrue) + * @return anchor point y value + */ + double getAnchorPoint_y(); + + /** gets the anchor point visibility + * May only be called when an anchor point is present (haveAnchorPoint()==OFTrue) + * @return OFTrue if anchor point is visible + */ + OFBool anchorPointIsVisible(); + + /** gets the anchor point annotation units. + * May only be called when an anchor point is present (haveAnchorPoint()==OFTrue) + * @return anchor point annotation units + */ + DVPSannotationUnit getAnchorPointAnnotationUnits(); + +private: + /** private undefined assignment operator + */ + DVPSTextObject& operator=(const DVPSTextObject&); + + /// VR=CS, VM=1, Type 1c + DcmCodeString boundingBoxAnnotationUnits; + /// VR=CS, VM=1, Type 1c + DcmCodeString anchorPointAnnotationUnits; + /// VR=ST, VM=1, Type 1 + DcmShortText unformattedTextValue; + /// VR=FL, VM=2, Type 1c + DcmFloatingPointSingle boundingBoxTLHC; + /// VR=FL, VM=2, Type 1c + DcmFloatingPointSingle boundingBoxBRHC; + /// VR=CS, VM=1, Type 1c + DcmCodeString boundingBoxTextHorizontalJustification; + /// VR=FL, VM=2, Type 1c + DcmFloatingPointSingle anchorPoint; + /// VR=CS, VM=1, Type 1c + DcmCodeString anchorPointVisibility; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpstxl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpstxl.h new file mode 100644 index 00000000..0259ba82 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpstxl.h @@ -0,0 +1,118 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSTextObject_PList + * + */ + +#ifndef DVPSTXL_H +#define DVPSTXL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dpdefine.h" + +class DVPSTextObject; + + +/** the list of text objects contained in a presentation state (internal use only). + * This class manages the data structures comprising one complete + * Text Object Sequence which is contained in one item + * of the Graphic Annotation Sequence in a Presentation State object. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSTextObject_PList +{ +public: + /// default constructor + DVPSTextObject_PList(); + + /// copy constructor + DVPSTextObject_PList(const DVPSTextObject_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSTextObject_PList object containing + * a deep copy of this object. + */ + DVPSTextObject_PList *clone() { return new DVPSTextObject_PList(*this); } + + /// destructor + virtual ~DVPSTextObject_PList(); + + /** reads a list of text objects from a DICOM dataset. + * The DICOM elements of the Text Object Sequence are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the TextObjectSequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** writes the list of text objects managed by this object to a DICOM dataset. + * Copies of the DICOM elements managed by this object are inserted into + * the DICOM dataset. + * @param dset the dataset to which the TextObjectSequence is written + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition write(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** get number of text objects in this list. + * @return the number of text objects. + */ + size_t size() const { return list_.size(); } + + /** returns a pointer to the text object with the given + * index or NULL if it does not exist. + * @param idx index, must be < size() + * @return pointer to text object or NULL + */ + DVPSTextObject *getTextObject(size_t idx); + + /** adds the given text object to + * the list of text objects managed by this object. + * @param text text object to be inserted. + */ + void addTextObject(DVPSTextObject *text); + + /** returns a pointer to the text object with the given + * index (or NULL if it does not exist) and removes it from the list. + * @param idx index, must be < size() + * @return pointer to text object or NULL + */ + DVPSTextObject *removeTextObject(size_t idx); + +private: + /** private undefined assignment operator + */ + DVPSTextObject_PList& operator=(const DVPSTextObject_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpstyp.h b/dcmpstat/include/dcmtk/dcmpstat/dvpstyp.h new file mode 100644 index 00000000..1f71a693 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpstyp.h @@ -0,0 +1,523 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * enums: DVPSoverlayActivation, DVPSVOIActivation, DVPSGraphicLayering + * DVPSPresentationLUTType, DVPSRotationType, + * DVPSShutterType + * + */ + +#ifndef DVPSTYP_H +#define DVPSTYP_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +/** describes how to handle overlays when creating a default presentation state + * for an image. + */ +enum DVPSoverlayActivation +{ + /** ignore overlays even if present in the image. + * A presentation state without any embedded or activated overlays + * is created. + */ + DVPSO_ignoreOverlays, + /** if overlays are present in the image, activate but do not copy them. + * If the image contains overlays, overlay activation elements are + * created in the presentation state object. The overlays remain in the image. + */ + DVPSO_referenceOverlays, + /** if overlays are present in the image, copy them. + * If the image contains overlays which are not embedded in the pixel + * data but use the OverlayData element, the overlays are copied to the + * presentation state and activated. + * Overlays that are embedded in the image pixel data are not copied + * but also activated. + */ + DVPSO_copyOverlays +}; + + +/** describes how to handle VOI transformations when creating a default presentation state + * for an image. + */ +enum DVPSVOIActivation +{ + /** ignore VOI transformations even if present in the image. + * The presentation state will not contain any VOI transformation. + */ + DVPSV_ignoreVOI, + /** select the first VOI window if present, VOI LUT alternatively. + * If the image contains one or more settings for window center and + * window width, the first window center/width is copied to the presentation + * state. If the image contains no window center/width but does contain + * one or more VOI LUTs, the first VOI LUT is copied to the presentation + * state. + */ + DVPSV_preferVOIWindow, + /** select the first VOI LUT if present, VOI Window alternatively. + * If the image contains one or more VOI LUTs, + * the first VOI LUT is copied to the presentation + * state. If the image contains no VOI LUT but does contain + * one or more settings for window center/width, the first + * window center and width are copied to the presentation state. + */ + DVPSV_preferVOILUT +}; + +/** describes how to handle layering of curves and overlays + * when creating a default presentation state for an image. + */ +enum DVPSGraphicLayering +{ + /** put all overlays and curves into a single graphic layer. + * If curves and/or overlays are present, a single graphic layer is + * created and all curves and overlays are assigned to this single layer. + */ + DVPSG_oneLayer, + /** create one graphic layer for overlays and one graphic layer for curves on top of that. + * If overlays are present, one layer containing all overlays is created. + * If curves are present, a different layer containing all curves is created. + * If both curves and overlays are present, the curves are assigned the higher layer order. + */ + DVPSG_twoLayers, + /** create individual layers for each referenced element, curves on top of overlays. + * For each overlay and curve present, a separate graphic layer is created. + * The curve layers have higher order than the overlay layers. + */ + DVPSG_separateLayers +}; + +/** describes a type of presentation LUT that is currently + * being used or set in a presentation state. + */ +enum DVPSPresentationLUTType +{ + /** Presentation LUT Shape with value 'IDENTITY' + */ + DVPSP_identity, + /** Presentation LUT Shape with value 'INVERSE' + */ + DVPSP_inverse, + /** Presentation LUT look up table + */ + DVPSP_table, + /** Presentation LUT Shape with value 'LIN OD' + */ + DVPSP_lin_od + +}; + +/** some Print SCPs which support Presentation LUTs require that the number + * of entries in a Presentation LUT matches the bit depth of the image pixel + * data (4096 entries for 12 bit pixel data, 256 entries for 8 bit pixel + * data). An instance of this enumeration describes the characteristics + * of a Presentation LUT with regard to this matching rule. + */ +enum DVPSPrintPresentationLUTAlignment +{ + /** Presentation LUT Shape, matches all kinds of image data + */ + DVPSK_shape, + /** Presentation LUT with 256 entries and first entry mapped to 0, + * matches 8 bit image data + */ + DVPSK_table8, + /** Presentation LUT with 4096 entries and first entry mapped to 0, + * matches 12 bit image data + */ + DVPSK_table12, + /** Presentation LUT Shape with number of entries other than 256 or 4096 + * or with first entry mapped to anything but 0. + */ + DVPSK_other +}; + +/** describes the rotation status of a presentation state. + */ +enum DVPSRotationType +{ + /** no rotation + */ + DVPSR_0_deg, + /** rotation of 90 degrees + */ + DVPSR_90_deg, + /** rotation of 180 degrees + */ + DVPSR_180_deg, + /** rotation of 270 degrees + */ + DVPSR_270_deg +}; + +/** describes the different types of display shutters + */ +enum DVPSShutterType +{ + /** rectangular shutter + */ + DVPSU_rectangular, + /** circular shutter + */ + DVPSU_circular, + /** polygonal shutter + */ + DVPSU_polygonal, + /** bitmap shutter + */ + DVPSU_bitmap +}; + +/** describes the different types of annotation units + */ +enum DVPSannotationUnit +{ + /** pixels + */ + DVPSA_pixels, + /** fraction of specified display area + */ + DVPSA_display +}; + +/** describes the specific character set of a DICOM element. + * The defined terms for code extension techniques are + * not supported. + */ +enum DVPScharacterSet +{ + /** ISO 646 (ISO-IR 6): ASCII + */ + DVPSC_ascii, + /** ISO-IR 100: Latin alphabet No. 1 + */ + DVPSC_latin1, + /** ISO-IR 101: Latin alphabet No. 2 + */ + DVPSC_latin2, + /** ISO-IR 109: Latin alphabet No. 3 + */ + DVPSC_latin3, + /** ISO-IR 110: Latin alphabet No. 4 + */ + DVPSC_latin4, + /** ISO-IR 148: Latin alphabet No. 5 + */ + DVPSC_latin5, + /** ISO-IR 144: Cyrillic + */ + DVPSC_cyrillic, + /** ISO-IR 127: Arabic + */ + DVPSC_arabic, + /** ISO-IR 126: Greek + */ + DVPSC_greek, + /** ISO-IR 138: Hebrew + */ + DVPSC_hebrew, + /** ISO-IR 13: Japanese (Katakana/Romaji) + */ + DVPSC_japanese, + /** unrecognized term or code extension + */ + DVPSC_other +}; + +/** describes the different types of graphic objects + */ +enum DVPSGraphicType +{ + /** single point + */ + DVPST_point, + /** non-interpolated polygonal line + */ + DVPST_polyline, + /** interpolated polygonal line + */ + DVPST_interpolated, + /** circle + */ + DVPST_circle, + /** ellipse + */ + DVPST_ellipse +}; + +/** describes a curve type + */ +enum DVPSCurveType +{ + /** region of interest (ROI) - a closed polygonal line + */ + DVPSL_roiCurve, + /** polyline - an open polygonal line + */ + DVPSL_polylineCurve +}; + +/** describes the horizontal justification of a text box + */ +enum DVPSTextJustification +{ + /** left justified text + */ + DVPSX_left, + /** right justified text + */ + DVPSX_right, + /** centered text + */ + DVPSX_center +}; + +/** describes the images and frames to which + * an object (graphic layer, displayed area selection or VOI) is applicable + */ +enum DVPSObjectApplicability +{ + /** the object only applies to the current (selected) frame of the current (attached) image + */ + DVPSB_currentFrame, + /** the object applies to all frames of the current (attached) image + */ + DVPSB_currentImage, + /** the object applies to all frames of all referenced images + */ + DVPSB_allImages +}; + +/** describes the presentation size mode for a displayed area selection + */ +enum DVPSPresentationSizeMode +{ + /** the displayed area should be scaled to fill the screen + */ + DVPSD_scaleToFit, + /** the displayed area should be scaled to its true physical size + */ + DVPSD_trueSize, + /** the displayed area should be scaled to a fixed scaling factor + */ + DVPSD_magnify +}; + +/** describes the service type supported by a DICOM communication peer + */ +enum DVPSPeerType +{ + /** Storage SCP peer + */ + DVPSE_storage, + /** local Storage SCP + */ + DVPSE_receiver, + /** remote Print Management SCP + */ + DVPSE_printRemote, + /** local Print Management SCP + */ + DVPSE_printLocal, + /** local or remote Print Management SCP + */ + DVPSE_printAny, + /** any type of peer + */ + DVPSE_any +}; + +/** describes the orientation (portrait or landscape) of a basic film box + */ +enum DVPSFilmOrientation +{ + /** portrait orientation + */ + DVPSF_portrait, + /** landscape orientation + */ + DVPSF_landscape, + /** printer default + */ + DVPSF_default +}; + +/** describes the trim mode (printing of borders around image boxes) for a basic film box + */ +enum DVPSTrimMode +{ + /** print with trims (borders) + */ + DVPSH_trim_on, + /** print without trims (borders) + */ + DVPSH_trim_off, + /** printer default + */ + DVPSH_default +}; + +/** describes the decimate/crop behaviour for a basic image box + */ +enum DVPSDecimateCropBehaviour +{ + /** a magnification factor less than one to be applied to the image. + */ + DVPSI_decimate, + /** some image rows and/or columns are to be deleted before printing. + */ + DVPSI_crop, + /** the SCP shall not crop or decimate + */ + DVPSI_fail, + /** printer default + */ + DVPSI_default +}; + +/** describes the type of display function + */ +enum DVPSDisplayTransform +{ + /** first entry + */ + DVPSD_first=0, + /** Grayscale Standard Display Function (defined in DICOM part 14) + */ + DVPSD_GSDF=DVPSD_first, + /** CIE Lab + */ + DVPSD_CIELAB=1, + /** no display transform + */ + DVPSD_none=2, + /** number of display transforms + */ + DVPSD_max=DVPSD_none +}; + +/** describes the result of an association negotiation + */ +enum DVPSAssociationNegotiationResult +{ + /** negotiation was successful + */ + DVPSJ_success, + /** negotiation was unsuccessful + */ + DVPSJ_error, + /** peer requests termination of server process + */ + DVPSJ_terminate +}; + +/** describes the bit depth of a Basic Grayscale Image Box + */ +enum DVPSImageDepth +{ + /** not yet assigned + */ + DVPSN_undefined, + /** 8 bit + */ + DVPSN_8bit, + /** 12 bit + */ + DVPSN_12bit +}; + +/** describes the certificate verification policy for TLS association negotiation + */ +enum DVPSCertificateVerificationType +{ + /** verify peer certificate, refuse transmission if absent + */ + DVPSQ_require, + /** verify peer certificate if present + */ + DVPSQ_verify, + /** don't verify peer certificate + */ + DVPSQ_ignore +}; + + +/** describes the types of objects handled by the dcmpstat signature routines + */ +enum DVPSObjectType +{ + /** structured report + */ + DVPSS_structuredReport, + /** image + */ + DVPSS_image, + /** grayscale softcopy presentation state + */ + DVPSS_presentationState +}; + + +/** describes the types of objects handled by the dcmpstat signature routines + */ +enum DVPSSignatureStatus +{ + /** no digital signatures are present + */ + DVPSW_unsigned, + + /** one or more digital signatures are present and have been successfully verified + */ + DVPSW_signed_OK, + + /** one or more digital signatures are present, and all of them are valid. + * However, at least one of them was created + * with a certificate issued by an unknown CA. + */ + DVPSW_signed_unknownCA, + + /** one or more digital signatures are present and at least one of them + * could not be successfully verified because it was corrupt. + */ + DVPSW_signed_corrupt +}; + + +/** describes the mode to verify and sign structured reports + */ +enum DVPSVerifyAndSignMode +{ + /** verify the document only + */ + DVPSY_verify, + + /** verify and digitally sign the document (apart from VerifyingObserver and SOPInstanceUID) + */ + DVPSY_verifyAndSign, + + /** verify and digitally sign the entire document (finalize it) + */ + DVPSY_verifyAndSign_finalize +}; + + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsvl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsvl.h new file mode 100644 index 00000000..d7a4ecec --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsvl.h @@ -0,0 +1,97 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOILUT + * + */ + +#ifndef DVPSVL_H +#define DVPSVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dctk.h" + +class DVPSSoftcopyVOI; + +/** the representation of one VOI LUT in a DICOM image. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSVOILUT +{ +public: + /// default constructor + DVPSVOILUT(); + + /// copy constructor + DVPSVOILUT(const DVPSVOILUT& copy); + + /** clone method. + * @return a pointer to a new DVPSVOILUT object containing + * a copy of this object. + */ + DVPSVOILUT *clone() { return new DVPSVOILUT(*this); } + + /// destructor + virtual ~DVPSVOILUT(); + + /** reads a VOI LUT from a DICOM dataset. + * The DICOM elements of the VOI LUT item are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the item of the VOI LUT Sequence from which the data is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** resets the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** gets the LUT explanation for this VOI LUT. + * If no explanation exists, NULL is returned. + * @return LUT explanation or NULL + */ + const char *getExplanation(); + + /** assigns the contents of this VOI LUT to the + * references passed as parameters. + * @param reference to the Softcopy VOI in which the LUT is stored. + */ + OFCondition assign(DVPSSoftcopyVOI& voi); + +private: + + /// private undefined assignment operator + DVPSVOILUT& operator=(const DVPSVOILUT&); + + /// Module=VOI_LUT, VR=xs, VM=3, Type 1c + DcmUnsignedShort voiLUTDescriptor; + /// Module=VOI_LUT, VR=LO, VM=1, Type 3 + DcmLongString voiLUTExplanation; + /// Module=VOI_LUT, VR=xs, VM=1-n, Type 1c + DcmUnsignedShort voiLUTData; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsvll.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsvll.h new file mode 100644 index 00000000..23639a5b --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsvll.h @@ -0,0 +1,95 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOILUT_PList + * + */ + +#ifndef DVPSVLL_H +#define DVPSVLL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcitem.h" + +class DVPSVOILUT; + + +/** the list of VOI LUTs contained in an image attached to a presentation state. + * This class manages the data structures comprising the VOI LUT Sequence + * of one image attached to a presentation state. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSVOILUT_PList +{ +public: + /// default constructor + DVPSVOILUT_PList(); + + /// copy constructor + DVPSVOILUT_PList(const DVPSVOILUT_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSVOILUT_PList object containing + * a deep copy of this object. + */ + DVPSVOILUT_PList *clone() { return new DVPSVOILUT_PList(*this); } + + /// destructor + virtual ~DVPSVOILUT_PList(); + + /** reads a list of VOI LUTs from a DICOM dataset. + * The DICOM elements of the VOI LUT Sequence are copied + * from the dataset to this object. + * The completeness of the item (presence of all required elements, + * value multiplicity) is checked. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the VOI LUT Sequence is to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** get number of VOI LUTs in this list. + * @return the number of VOI LUTs. + */ + size_t size() const { return list_.size(); } + + /** returns a pointer to the VOI LUT with the given + * index or NULL if it does not exist. + * @param idx index, must be < size() + * @return pointer to VOI LUT or NULL + */ + DVPSVOILUT *getVOILUT(size_t idx); + +private: + + /// private undefined assignment operator + DVPSVOILUT_PList& operator=(const DVPSVOILUT_PList&); + + /** the list maintained by this object + */ + OFList list_; +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsvw.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsvw.h new file mode 100644 index 00000000..e588b88e --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsvw.h @@ -0,0 +1,100 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOIWindow + * + */ + +#ifndef DVPSVW_H +#define DVPSVW_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dcerror.h" /* for OFCondition */ + +class DcmDecimalString; +class DcmLongString; + +/** the representation of one VOI Window in a DICOM image. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSVOIWindow +{ +public: + /// default constructor + DVPSVOIWindow(); + + /// copy constructor + DVPSVOIWindow(const DVPSVOIWindow& copy); + + /** clone method. + * @return a pointer to a new DVPSVOIWindow object containing + * a copy of this object. + */ + DVPSVOIWindow *clone() { return new DVPSVOIWindow(*this); } + + /// destructor + virtual ~DVPSVOIWindow(); + + /** reads a VOI Window from DICOM elements. + * The DICOM elements of the given VOI Window are copied to this object. + * If this method returns an error code, the object is in undefined state afterwards. + * @param idx the index of the VOI window to be read, must be < wcenter.getVM() + * @param wcenter the window center(s) + * @param wwidth the window width(s). wwidth.getVM() must be == wcenter.getVM(). + * @param expl the window center/window width explanation. If omitted, explanation remains empty. + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(size_t idx, DcmDecimalString &wcenter, DcmDecimalString& wwidth, DcmLongString *expl=NULL); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** gets the Window center/width explanation for this VOI Window. + * If no explanation exists, NULL is returned. + * @return Window explanation or NULL + */ + const char *getExplanation(); + + /** gets the Window Center of this VOI Window. + * @return window center + */ + double getWindowCenter() { return windowCenter; } + + /** gets the Window Width of this VOI Window. + * @return window width + */ + double getWindowWidth() { return windowWidth; } + +private: + /// private undefined assignment operator + DVPSVOIWindow& operator=(const DVPSVOIWindow&); + // window center + double windowCenter; + // window width + double windowWidth; + // optional window explanation + OFString windowCenterWidthExplanation; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvpsvwl.h b/dcmpstat/include/dcmtk/dcmpstat/dvpsvwl.h new file mode 100644 index 00000000..b544e921 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvpsvwl.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 1998-2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOIWindow_PList + * + */ + +#ifndef DVPSVWL_H +#define DVPSVWL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/dcmdata/dcitem.h" + +class DVPSVOIWindow; + + +/** the list of VOI Windows contained in an image attached to a presentation state. + * This class manages the data structures comprising the VOI Windows + * of one image attached to a presentation state. + */ + +class DCMTK_DCMPSTAT_EXPORT DVPSVOIWindow_PList +{ +public: + /// default constructor + DVPSVOIWindow_PList(); + + /// copy constructor + DVPSVOIWindow_PList(const DVPSVOIWindow_PList& copy); + + /** clone method. + * @return a pointer to a new DVPSVOIWindow_PList object containing + * a deep copy of this object. + */ + DVPSVOIWindow_PList *clone() { return new DVPSVOIWindow_PList(*this); } + + /// destructor + virtual ~DVPSVOIWindow_PList(); + + /** reads a list of VOI Windows from a DICOM dataset. + * The DICOM elements of the VOI Window are copied + * from the dataset to this object. + * If this method returns an error code, the object is in undefined state afterwards. + * @param dset the dataset from which the VOI Windows are to be read + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition read(DcmItem &dset); + + /** reset the object to initial state. + * After this call, the object is in the same state as after + * creation with the default constructor. + */ + void clear(); + + /** get number of VOI Windows in this list. + * @return the number of VOI Windows. + */ + size_t size() const { return list_.size(); } + + /** returns a pointer to the VOI Window with the given + * index or NULL if it does not exist. + * @param idx index, must be < size() + * @return pointer to VOI Window or NULL + */ + DVPSVOIWindow *getVOIWindow(size_t idx); + +private: + + /// private undefined assignment operator + DVPSVOIWindow_PList& operator=(const DVPSVOIWindow_PList&); + + /** the list maintained by this object + */ + OFList list_; + +}; + +#endif diff --git a/dcmpstat/include/dcmtk/dcmpstat/dvsighdl.h b/dcmpstat/include/dcmtk/dcmpstat/dvsighdl.h new file mode 100644 index 00000000..b4c39071 --- /dev/null +++ b/dcmpstat/include/dcmtk/dcmpstat/dvsighdl.h @@ -0,0 +1,230 @@ +/* + * + * Copyright (C) 2001-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVSignatureHandler + * + */ + +#ifndef DVSIGHDL_H +#define DVSIGHDL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dpdefine.h" +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmsign/sicertvf.h" +#include "dcmtk/dcmdata/dcerror.h" + + + +class DcmAttributeTag; +class DcmItem; +class DcmStack; +class DVConfiguration; +class DcmAttributeTag; +class DcmTagKey; + +/** handler for all digital signature related functions in dcmpstat + */ +class DCMTK_DCMPSTAT_EXPORT DVSignatureHandler +{ +public: + /** constructor + * @param cfg system configuration + */ + DVSignatureHandler(DVConfiguration& cfg); + + /// destructor + virtual ~DVSignatureHandler(); + + /** returns a string containing a complete HTML page with the + * signature validation results for the last object of the + * given type. Never returns NULL. + * @param objtype object type + * @return pointer to string with HTML page + */ + const char *getCurrentSignatureValidationHTML(DVPSObjectType objtype) const; + + /** returns a string containing a complete HTML page with the + * signature validation overview. Never returns NULL. + * @return pointer to string with HTML page + */ + const char *getCurrentSignatureValidationOverview() const; + + /** updates the digital signature information for the given object type. + * @remark This class is only functional if DCMTK is compiled with + * OpenSSL support enabled. If compiled without, it always reports + * that no signatures were found in the object. + * @param dataset dataset to be checked for digital signatures + * @param objtype object type of dataset + * @param onRead true if the dataset is just being read, false if it is being written + */ + void updateDigitalSignatureInformation(DcmItem& dataset, DVPSObjectType objtype, OFBool onRead); + + /** disables the digital signature information for the given object type. + * @param objtype object type + */ + void disableDigitalSignatureInformation(DVPSObjectType objtype); + + /** returns the status flag for the current object of given type. + * @param objtype object type + * @return digital signature status for object + */ + DVPSSignatureStatus getCurrentSignatureStatus(DVPSObjectType objtype) const; + + /** returns number of correct signatures for given object type. + * @param objtype object type + * @return number of digital signatures + */ + unsigned long getNumberOfCorrectSignatures(DVPSObjectType objtype) const; + + /** returns number of untrustworthy signatures for given object type. + * @param objtype object type + * @return number of digital signatures + */ + unsigned long getNumberOfUntrustworthySignatures(DVPSObjectType objtype) const; + + /** returns number of corrupt signatures for given object type. + * @param objtype object type + * @return number of digital signatures + */ + unsigned long getNumberOfCorruptSignatures(DVPSObjectType objtype) const; + + /** returns the combined status flag for the current image and presentation state. + * @return digital signature status for image and presentation state + */ + DVPSSignatureStatus getCombinedImagePStateSignatureStatus() const; + + /** disables internal settings for image and presentation state. + * Called when a new SR object is loaded and the current + * image/presentation state are hidden consequently. + */ + void disableImageAndPState(); + + /** checks whether any attribute mentioned in the tag list is affected + * by digital signatures. Returns true if either any of the attributes + * is signed by a digital signature on the dataset level, or if any + * of the attributes is a sequence that contains one or more signatures + * in its items. Otherwise returns false. + * @remark this method is only functional if DCMTK is compiled with + * OpenSSL support enabled. Otherwise it always returns false. + * @param item item or dataset to be tested + * @param tagList list of attributes (tags) to be looked up inside the dataset + * @return true if any of the given attributes is affected by a digital signature, + * false otherwise. + */ + OFBool attributesSigned(DcmItem& item, DcmAttributeTag& tagList) const; + + /** adds one or more new digital signatures to the given dataset. + * If compiled without WITH_OPENSSL, always returns EC_IllegalCall. + * @param mainDataset reference to main dataset in which signature(s) are to be added + * @param itemStack stack of items within the main dataset that are to be signed + * separately. If main dataset is to be signed, it must be included in this stack. + * @param attributesNotToSignInMainDataset list of attribute tags that should be + * omitted from the signature on the main dataset level + * @param usedID user ID in configuration file, must not be NULL + * @param passwd passwd password for private key, may be NULL + * @return EC_Normal if successful, an error code otherwise. + */ + OFCondition createSignature( + DcmItem& mainDataset, + const DcmStack& itemStack, + DcmAttributeTag& attributesNotToSignInMainDataset, + const char *userID, + const char *passwd); + +private: + + /// private undefined copy constructor + DVSignatureHandler(const DVSignatureHandler& copy); + + /// private undefined assignment operator + DVSignatureHandler& operator=(const DVSignatureHandler&); + + /* print the location stack into the given stream. + * It is assumed that the stack top is a DigitalSignatureSequence which is not printed + * and that the stack bottom is the main dataset, which is also not printed. + * @param stack search stack, as returned by DcmSignature::findFirstSignatureItem() etc. + * @param os output stream + */ + static void printSignatureItemPosition(DcmStack& stack, STD_NAMESPACE ostream& os); + + /** replaces the current HTML page for the given object type by the new string. + * @param objtype object type + * @param str string, must not be NULL + */ + void replaceString(DVPSObjectType objtype, const char *str); + + /** updates the overview HTML page. + */ + void updateSignatureValidationOverview(); + + /// current SR html page + OFString htmlSR; + + /// current image html page + OFString htmlImage; + + /// current presentation state html page + OFString htmlPState; + + /// current overview + OFString htmlOverview; + + /// number of correct signatures in current SR + unsigned long correctSignaturesSR; + + /// number of corrupt signatures in current SR + unsigned long corruptSignaturesSR; + + /// number of untrustworthy signatures in current SR + unsigned long untrustSignaturesSR; + + /// number of correct signatures in current Image + unsigned long correctSignaturesImage; + + /// number of corrupt signatures in current Image + unsigned long corruptSignaturesImage; + + /// number of untrustworthy signatures in current Image + unsigned long untrustSignaturesImage; + + /// number of correct signatures in current PState + unsigned long correctSignaturesPState; + + /// number of corrupt signatures in current PState + unsigned long corruptSignaturesPState; + + /// number of untrustworthy signatures in current PState + unsigned long untrustSignaturesPState; + +#ifdef WITH_OPENSSL + /// the certificate verifier, available only if compiled with OpenSSL support + /// @remark This member is only available if DCMTK is compiled with + /// OpenSSL support enabled. + + SiCertificateVerifier certVerifier; +#endif + + /// reference to object maintaining the system configuration + DVConfiguration& config; + +}; + +#endif diff --git a/dcmpstat/jni/Makefile.dep b/dcmpstat/jni/Makefile.dep new file mode 100644 index 00000000..e69de29b diff --git a/dcmpstat/jni/Makefile.in b/dcmpstat/jni/Makefile.in new file mode 100644 index 00000000..ff927d32 --- /dev/null +++ b/dcmpstat/jni/Makefile.in @@ -0,0 +1,119 @@ +# +# Makefile for dcmpstat/jni +# +# This makefile requires changes specific for the operating system +# and compiler that are not automatically adjusted by "configure". +# +# In addition, the CXXFLAGS in config/Makefile.def must be adjusted +# _before_ compiling dcmtk to create position independent code +# (e.g. -fPIC for gcc, -PIC for Sun CC) +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +# +# Settings for Solaris 2.x with Sun CC 4.2 compiler +# +javainc = -I/usr/java1.3/include -I/usr/java1.3/include/solaris +soflags = -G +solibs = -lC + +# +# Settings for Linux (glibc) with gcc 2.95 (and above) compiler +# +# Include files for Sun J2SE 1.3, Blackdown JDK 1.2 or IBM JDK 1.3 +# javainc = -I/usr/lib/SunJava2/include -I/usr/lib/SunJava2/include/linux +# javainc = -I/usr/jdk1.2/include -I/usr/jdk1.2/include/linux +# javainc = -I/opt/IBMJava2-13/include +# soflags = -shared + +ofstddir = $(top_srcdir)/../ofstd +ofstdinc = -I$(ofstddir)/include +ofstdlibdir = -L$(ofstddir)/libsrc +ofstdlib = -lofstd + +dcmdatadir = $(top_srcdir)/../dcmdata +dcmdatainc = -I$(dcmdatadir)/include +dcmdatalibdir = -L$(dcmdatadir)/libsrc +dcmdatalib = -ldcmdata + +dcmnetdir = $(top_srcdir)/../dcmnet +dcmnetinc = -I$(dcmnetdir)/include +dcmnetlibdir = -L$(dcmnetdir)/libsrc +dcmnetlib = -ldcmnet + +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmimgleinc = -I$(dcmimgledir)/include +dcmimglelibdir = -L$(dcmimgledir)/libsrc +dcmimglelib = -ldcmimgle + +dcmpstatdir = $(top_srcdir)/../dcmpstat +dcmpstatinc = -I$(dcmpstatdir)/include +dcmpstatlibdir = -L$(dcmpstatdir)/libsrc +dcmpstatlib = -ldcmpstat + +dcmqrdbdir = $(top_srcdir)/../dcmqrdb +dcmqrdbinc = -I$(dcmqrdbdir)/include +dcmqrdblibdir = -L$(dcmqrdbdir)/libsrc +dcmqrdblib = -ldcmqrdb + +dcmsigndir = $(top_srcdir)/../dcmsign +dcmsigninc = -I$(dcmsigndir)/include +dcmsignlibdir = -L$(dcmsigndir)/libsrc +dcmsignlib = -ldcmdsig + +dcmsrdir = $(top_srcdir)/../dcmsr +dcmsrinc = -I$(dcmsrdir)/include +dcmsrlibdir = -L$(dcmsrdir)/libsrc +dcmsrlib = -ldcmsr + +dcmjpegdir = $(top_srcdir)/../dcmjpeg +dcmjpeginc = -I$(dcmjpegdir)/include +dcmjpeglibdir = -L$(dcmjpegdir)/libsrc -L$(dcmjpegdir)/libijg8 -L$(dcmjpegdir)/libijg12 \ + -L$(dcmjpegdir)/libijg16 +dcmjpeglib = -ldcmjpeg -lijg8 -lijg12 -lijg16 + +LOCALINCLUDES = $(dcmpstatinc) $(ofstdinc) $(dcmnetinc) $(dcmdatainc) $(dcmimgleinc) \ + $(dcmqrdbinc) $(dcmsigninc) $(dcmsrinc) $(dcmjpeginc) $(javainc) +LIBDIRS = -L$(top_srcdir)/libsrc $(dcmpstatlibdir) $(dcmqrdblibdir) $(dcmnetlibdir) \ + $(dcmdatalibdir) $(ofstdlibdir) $(dcmimglelibdir) $(dcmsignlibdir) $(dcmsrlibdir) \ + $(dcmjpeglibdir) +LOCALLIBS = $(dcmpstatlib) $(dcmsrlib) $(dcmsignlib) $(dcmjpeglib) $(dcmimglelib) \ + $(dcmqrdblib) $(dcmnetlib) $(dcmdatalib) $(ofstdlib) $(OPENSSLLIBS) $(solibs) + +objs = DVInterface.o DVPSGraphicObject.o DVPresentationState.o DVPSCurve.o \ + DVPSTextObject.o DVPSStoredPrint.o DSRCodeValue.o DSRCompositeValue.o \ + DSRDocument.o DSRDocumentTree.o DSRImageValue.o DSRNumericValue.o \ + DSRSCoordValue.o DSRTCoordValue.o DSRWaveformValue.o +library = libjInterface.so + + +all: $(library) + +$(library): $(objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) $(soflags) -o $@ $(objs) $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmpstat/jni/make_stub.sh b/dcmpstat/jni/make_stub.sh new file mode 100755 index 00000000..afb83dfa --- /dev/null +++ b/dcmpstat/jni/make_stub.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +JAVA_HOME=/usr/java1.2 +JAVA_JNI_LIB_DIR=. +JAVA_MAINCLASS=DICOMscope +OUTFILE=DICOMscope + +/usr/java1.2/bin/javald -H $JAVA_HOME -o $OUTFILE -R $JAVA_JNI_LIB_DIR $JAVA_MAINCLASS + diff --git a/dcmpstat/libsrc/CMakeLists.txt b/dcmpstat/libsrc/CMakeLists.txt new file mode 100644 index 00000000..920c5e40 --- /dev/null +++ b/dcmpstat/libsrc/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmpstat dcmpstat dviface dvpsab dvpsabl dvpsal dvpsall dvpscf dvpscu dvpscul dvpsda dvpsdal dvpsfs dvpsga dvpsgal dvpsgl dvpsgll dvpsgr dvpsgrl dvpshlp dvpsib dvpsibl dvpsmsg dvpsov dvpsovl dvpspl dvpspl2 dvpspll dvpspr dvpsprt dvpsri dvpsril dvpsrs dvpsrsl dvpssp dvpsspl dvpssv dvpssvl dvpstat dvpstx dvpstxl dvpsvl dvpsvll dvpsvw dvpsvwl dvsighdl) + +DCMTK_TARGET_LINK_MODULES(dcmpstat ofstd oflog dcmdata dcmimgle dcmimage dcmnet dcmdsig dcmtls dcmsr dcmqrdb) diff --git a/dcmpstat/libsrc/Makefile.dep b/dcmpstat/libsrc/Makefile.dep new file mode 100644 index 00000000..8fed5dd9 --- /dev/null +++ b/dcmpstat/libsrc/Makefile.dep @@ -0,0 +1,4805 @@ +dcmpstat.o: dcmpstat.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dvpsovl.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../include/dcmtk/dcmpstat/dvpscu.h ../include/dcmtk/dcmpstat/dvpsvl.h \ + ../include/dcmtk/dcmpstat/dvpsvw.h ../include/dcmtk/dcmpstat/dvpsov.h \ + ../include/dcmtk/dcmpstat/dvpsda.h ../include/dcmtk/dcmpstat/dvpsril.h \ + ../include/dcmtk/dcmpstat/dvpssv.h ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../include/dcmtk/dcmpstat/dvpsgl.h ../include/dcmtk/dcmpstat/dvpsrs.h \ + ../include/dcmtk/dcmpstat/dvpsal.h ../include/dcmtk/dcmpstat/dvpsga.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpsri.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h +dviface.o: dviface.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dviface.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpstat.h ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmpstat/dvcache.h ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/digsdfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diciefn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dicielut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didislut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../include/dcmtk/dcmpstat/dvpssp.h ../include/dcmtk/dcmpstat/dvpspll.h \ + ../include/dcmtk/dcmpstat/dvpsibl.h ../include/dcmtk/dcmpstat/dvpsabl.h \ + ../include/dcmtk/dcmpstat/dvpspr.h ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../include/dcmtk/dcmpstat/dvsighdl.h \ + ../../dcmsign/include/dcmtk/dcmsign/sicertvf.h \ + ../../dcmsign/include/dcmtk/dcmsign/sitypes.h \ + ../../dcmsign/include/dcmtk/dcmsign/sidefine.h \ + ../../dcmsign/include/dcmtk/dcmsign/dcsignat.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrdoc.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrdoctr.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrdocst.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtree.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtypes.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsdefine.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtncsr.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrposcn.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrdoctn.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrdncsr.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrdnflt.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsritcsr.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrcitem.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrscovl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrscogr.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrsc3gr.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtcovl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtcodt.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtcosp.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrtcoto.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrcomvl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrimgvl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrimgfr.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrimgse.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrwavvl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrwavch.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrrtpl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrctpl.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrsoprf.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrrefin.h \ + ../../dcmsr/include/dcmtk/dcmsr/dsrcsidl.h \ + ../../oflog/include/dcmtk/oflog/fileap.h \ + ../../oflog/include/dcmtk/oflog/fstreams.h \ + ../../oflog/include/dcmtk/oflog/helpers/timehelp.h \ + ../include/dcmtk/dcmpstat/dvpsib.h ../include/dcmtk/dcmpstat/dvpsab.h \ + ../include/dcmtk/dcmpstat/dvpsov.h ../include/dcmtk/dcmpstat/dvpsgl.h \ + ../include/dcmtk/dcmpstat/dvpsal.h ../include/dcmtk/dcmpstat/dvpsga.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpscu.h \ + ../include/dcmtk/dcmpstat/dvpsvl.h ../include/dcmtk/dcmpstat/dvpsvw.h \ + ../include/dcmtk/dcmpstat/dvpsda.h ../include/dcmtk/dcmpstat/dvpssv.h \ + ../include/dcmtk/dcmpstat/dvpsrs.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h ../include/dcmtk/dcmpstat/dvpsri.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \ + ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h +dvpsab.o: dvpsab.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsab.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h +dvpsabl.o: dvpsabl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpsabl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsab.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dvpsal.o: dvpsal.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpsal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsdef.h +dvpsall.o: dvpsall.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpsall.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpsov.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsgl.h +dvpscf.o: dvpscf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dvpscu.o: dvpscu.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpscu.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h +dvpscul.o: dvpscul.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpscul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpscu.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h +dvpsda.o: dvpsda.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmpstat/dvpsda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsri.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../include/dcmtk/dcmpstat/dvpsrs.h +dvpsdal.o: dvpsdal.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpsri.h +dvpsfs.o: dvpsfs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsfs.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../include/dcmtk/dcmpstat/dvpscf.h ../include/dcmtk/dcmpstat/dvpspl.h \ + ../include/dcmtk/dcmpstat/dvpspll.h ../include/dcmtk/dcmpstat/dvpssp.h \ + ../include/dcmtk/dcmpstat/dvpsibl.h ../include/dcmtk/dcmpstat/dvpsabl.h \ + ../include/dcmtk/dcmpstat/dvpstat.h ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspr.h ../include/dcmtk/dcmpstat/dvpsspl.h \ + ../include/dcmtk/dcmpstat/dvpsib.h ../include/dcmtk/dcmpstat/dvpsab.h \ + ../include/dcmtk/dcmpstat/dvpsov.h ../include/dcmtk/dcmpstat/dvpsgl.h \ + ../include/dcmtk/dcmpstat/dvpsal.h ../include/dcmtk/dcmpstat/dvpsga.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpscu.h \ + ../include/dcmtk/dcmpstat/dvpsvl.h ../include/dcmtk/dcmpstat/dvpsvw.h \ + ../include/dcmtk/dcmpstat/dvpsda.h ../include/dcmtk/dcmpstat/dvpssv.h \ + ../include/dcmtk/dcmpstat/dvpsrs.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h ../include/dcmtk/dcmpstat/dvpsri.h +dvpsga.o: dvpsga.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsga.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dvpsri.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h +dvpsgal.o: dvpsgal.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsga.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h ../include/dcmtk/dcmpstat/dvpsri.h +dvpsgl.o: dvpsgl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsgl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsdef.h +dvpsgll.o: dvpsgll.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsgl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpsgal.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsal.h ../include/dcmtk/dcmpstat/dvpsga.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h ../include/dcmtk/dcmpstat/dvpsri.h +dvpsgr.o: dvpsgr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h +dvpsgrl.o: dvpsgrl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsgr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h +dvpshlp.o: dvpshlp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +dvpsib.o: dvpsib.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpsib.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpspll.h \ + ../include/dcmtk/dcmpstat/dvpscf.h ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../include/dcmtk/dcmpstat/dvpspl.h +dvpsibl.o: dvpsibl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsibl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmpstat/dvpsib.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h +dvpsmsg.o: dvpsmsg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../include/dcmtk/dcmpstat/dvpsmsg.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofsockad.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h +dvpsov.o: dvpsov.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsov.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsdef.h +dvpsovl.o: dvpsovl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsov.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +dvpspl.o: dvpspl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h +dvpspl2.o: dvpspl2.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h +dvpspll.o: dvpspll.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpspll.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmpstat/dvpsibl.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpsib.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +dvpspr.o: dvpspr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmpstat/dvpspr.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h +dvpsprt.o: dvpsprt.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpsprt.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dvpspll.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsspl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dviface.h \ + ../include/dcmtk/dcmpstat/dvpscf.h ../include/dcmtk/dcmpstat/dvpstat.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmpstat/dvcache.h ../include/dcmtk/dcmpstat/dvpsfs.h \ + ../include/dcmtk/dcmpstat/dvpssp.h ../include/dcmtk/dcmpstat/dvpsibl.h \ + ../include/dcmtk/dcmpstat/dvpsabl.h ../include/dcmtk/dcmpstat/dvpspr.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h ../include/dcmtk/dcmpstat/dvpsov.h \ + ../include/dcmtk/dcmpstat/dvpsgl.h ../include/dcmtk/dcmpstat/dvpsrs.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpsal.h \ + ../include/dcmtk/dcmpstat/dvpsga.h ../include/dcmtk/dcmpstat/dvpstxl.h \ + ../include/dcmtk/dcmpstat/dvpsgrl.h ../include/dcmtk/dcmpstat/dvpscu.h \ + ../include/dcmtk/dcmpstat/dvpsvl.h ../include/dcmtk/dcmpstat/dvpsvw.h \ + ../include/dcmtk/dcmpstat/dvpsda.h ../include/dcmtk/dcmpstat/dvpssv.h \ + ../include/dcmtk/dcmpstat/dvpsib.h ../include/dcmtk/dcmpstat/dvpsab.h \ + ../include/dcmtk/dcmpstat/dvpstx.h ../include/dcmtk/dcmpstat/dvpsgr.h \ + ../include/dcmtk/dcmpstat/dvpsri.h +dvpsri.o: dvpsri.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsri.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h +dvpsril.o: dvpsril.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmpstat/dvpsril.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsri.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsrs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h +dvpsrs.o: dvpsrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmpstat/dvpsrs.h ../include/dcmtk/dcmpstat/dvpsril.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpsri.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h +dvpsrsl.o: dvpsrsl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsrs.h ../include/dcmtk/dcmpstat/dvpsril.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmpstat/dvpsri.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h +dvpssp.o: dvpssp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpssp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dvpspll.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsibl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmpstat/dvpsabl.h ../include/dcmtk/dcmpstat/dvpstat.h \ + ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpspr.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpsib.h \ + ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/digsdfn.h \ + ../include/dcmtk/dcmpstat/dvpscf.h ../include/dcmtk/dcmpstat/dvpsov.h \ + ../include/dcmtk/dcmpstat/dvpsgl.h ../include/dcmtk/dcmpstat/dvpsrs.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpsal.h \ + ../include/dcmtk/dcmpstat/dvpsga.h ../include/dcmtk/dcmpstat/dvpstxl.h \ + ../include/dcmtk/dcmpstat/dvpsgrl.h ../include/dcmtk/dcmpstat/dvpscu.h \ + ../include/dcmtk/dcmpstat/dvpsvl.h ../include/dcmtk/dcmpstat/dvpsvw.h \ + ../include/dcmtk/dcmpstat/dvpsda.h ../include/dcmtk/dcmpstat/dvpssv.h \ + ../include/dcmtk/dcmpstat/dvpsab.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h ../include/dcmtk/dcmpstat/dvpsri.h +dvpsspl.o: dvpsspl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsspl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpssp.h ../include/dcmtk/dcmpstat/dvpspll.h \ + ../include/dcmtk/dcmpstat/dvpsibl.h ../include/dcmtk/dcmpstat/dvpsabl.h \ + ../include/dcmtk/dcmpstat/dvpstat.h ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpsovl.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpspr.h \ + ../include/dcmtk/dcmpstat/dvpsib.h ../include/dcmtk/dcmpstat/dviface.h \ + ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmpstat/dvcache.h ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../include/dcmtk/dcmpstat/dvpsov.h ../include/dcmtk/dcmpstat/dvpsgl.h \ + ../include/dcmtk/dcmpstat/dvpsrs.h ../include/dcmtk/dcmpstat/dvpsril.h \ + ../include/dcmtk/dcmpstat/dvpsal.h ../include/dcmtk/dcmpstat/dvpsga.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpscu.h ../include/dcmtk/dcmpstat/dvpsvl.h \ + ../include/dcmtk/dcmpstat/dvpsvw.h ../include/dcmtk/dcmpstat/dvpsda.h \ + ../include/dcmtk/dcmpstat/dvpssv.h ../include/dcmtk/dcmpstat/dvpsab.h \ + ../include/dcmtk/dcmpstat/dvpstx.h ../include/dcmtk/dcmpstat/dvpsgr.h \ + ../include/dcmtk/dcmpstat/dvpsri.h +dvpssv.o: dvpssv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmpstat/dvpssv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmpstat/dvpsril.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsri.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../include/dcmtk/dcmpstat/dvpsrs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h +dvpssvl.o: dvpssvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../include/dcmtk/dcmpstat/dvpssvl.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpssv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../include/dcmtk/dcmpstat/dvpsril.h ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../include/dcmtk/dcmpstat/dvpsri.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h +dvpstat.o: dvpstat.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmpstat/dvpstat.h ../include/dcmtk/dcmpstat/dcmpstat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dvpsovl.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpsgll.h \ + ../include/dcmtk/dcmpstat/dvpsrsl.h ../include/dcmtk/dcmpstat/dvpsall.h \ + ../include/dcmtk/dcmpstat/dvpsgal.h ../include/dcmtk/dcmpstat/dvpscul.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dvpsvwl.h \ + ../include/dcmtk/dcmpstat/dvpsdal.h ../include/dcmtk/dcmpstat/dvpssvl.h \ + ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpsdef.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../include/dcmtk/dcmpstat/dvpscu.h ../include/dcmtk/dcmpstat/dvpsvl.h \ + ../include/dcmtk/dcmpstat/dvpsvw.h ../include/dcmtk/dcmpstat/dvpsov.h \ + ../include/dcmtk/dcmpstat/dvpsda.h ../include/dcmtk/dcmpstat/dvpsril.h \ + ../include/dcmtk/dcmpstat/dvpssv.h ../include/dcmtk/dcmpstat/dvpshlp.h \ + ../include/dcmtk/dcmpstat/dvpsgl.h ../include/dcmtk/dcmpstat/dvpsrs.h \ + ../include/dcmtk/dcmpstat/dvpsal.h ../include/dcmtk/dcmpstat/dvpsga.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h ../include/dcmtk/dcmpstat/dvpsgrl.h \ + ../include/dcmtk/dcmpstat/dvpsri.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../include/dcmtk/dcmpstat/dvpsgr.h +dvpstx.o: dvpstx.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpstx.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h +dvpstxl.o: dvpstxl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpstxl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dpdefine.h ../include/dcmtk/dcmpstat/dvpstx.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpstyp.h +dvpsvl.o: dvpsvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsvl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmpstat/dvpssv.h ../include/dcmtk/dcmpstat/dvpsril.h \ + ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dvpsri.h +dvpsvll.o: dvpsvll.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsvll.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsvl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +dvpsvw.o: dvpsvw.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvpsvw.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +dvpsvwl.o: dvpsvwl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../include/dcmtk/dcmpstat/dvpsvwl.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpsvw.h ../include/dcmtk/dcmpstat/dvpsdef.h +dvsighdl.o: dvsighdl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmpstat/dvsighdl.h ../include/dcmtk/dcmpstat/dvpstyp.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../dcmsign/include/dcmtk/dcmsign/sicertvf.h \ + ../../dcmsign/include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmsign/include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmsign/include/dcmtk/dcmsign/dcsignat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmpstat/dvpscf.h \ + ../../dcmsign/include/dcmtk/dcmsign/sicert.h \ + ../../dcmsign/include/dcmtk/dcmsign/sinullpr.h \ + ../../dcmsign/include/dcmtk/dcmsign/sisprof.h \ + ../../dcmsign/include/dcmtk/dcmsign/siprivat.h \ + ../../dcmsign/include/dcmtk/dcmsign/siripemd.h \ + ../../dcmsign/include/dcmtk/dcmsign/simac.h diff --git a/dcmpstat/libsrc/Makefile.in b/dcmpstat/libsrc/Makefile.in new file mode 100644 index 00000000..8a23569c --- /dev/null +++ b/dcmpstat/libsrc/Makefile.in @@ -0,0 +1,64 @@ +# +# Makefile for dcmpstat/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +dcmdatadir = $(top_srcdir)/../dcmdata +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmsrdir = $(top_srcdir)/../dcmsr +dcmqrdbdir = $(top_srcdir)/../dcmqrdb +dcmnetdir = $(top_srcdir)/../dcmnet +dcmsigndir = $(top_srcdir)/../dcmsign +dcmtlsdir = $(top_srcdir)/../dcmtls + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include \ + -I$(dcmimgledir)/include -I$(dcmsrdir)/include -I$(dcmqrdbdir)/include \ + -I$(dcmnetdir)/include -I$(dcmsigndir)/include -I$(dcmtlsdir)/include +LOCALDEFS = + +objs = dvpsal.o dvpsgal.o dvpsgr.o dvpsovl.o dvpsrs.o dvpstx.o \ + dvpsall.o dvpsgl.o dvpsgrl.o dvpsri.o dvpsrsl.o dvpstxl.o \ + dvpsga.o dvpsgll.o dvpsov.o dvpsril.o dvpstat.o dviface.o \ + dvpscu.o dvpscul.o dvpsvl.o dvpsvll.o dvpsvw.o dvpsvwl.o \ + dvpsda.o dvpsdal.o dvpssv.o dvpssvl.o dvpspl.o \ + dvpsib.o dvpsibl.o dvpssp.o dvpspr.o dvpscf.o dvpshlp.o \ + dvpspll.o dvpsab.o dvpsabl.o dvpsspl.o dvpsprt.o dvpsfs.o \ + dvpsmsg.o dvsighdl.o dcmpstat.o dvpspl2.o +library = libdcmpstat.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmpstat/libsrc/dcmpstat.cc b/dcmpstat/libsrc/dcmpstat.cc new file mode 100644 index 00000000..b98cdb6a --- /dev/null +++ b/dcmpstat/libsrc/dcmpstat.cc @@ -0,0 +1,1941 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DcmPresentationState + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dcmpstat.h" + +#include "dcmtk/ofstd/ofstd.h" /* for class OFStandard */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve */ +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT */ +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow */ +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay */ +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea */ +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI */ +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ + +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CMATH +#define INCLUDE_CTIME +#define INCLUDE_LIBC +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +OFLogger DCM_dcmpstatLogger = OFLog::getLogger("dcmtk.dcmpstat"); +OFLogger DCM_dcmpstatDumpLogger = OFLog::getLogger("dcmtk.dcmpstat.dump"); +OFLogger DCM_dcmpstatLogfileLogger = OFLog::getLogger("dcmtk.dcmpstat.logfile"); + +/* --------------- class DcmPresentationState --------------- */ + +DcmPresentationState::DcmPresentationState() +: patientName(DCM_PatientName) +, patientID(DCM_PatientID) +, patientBirthDate(DCM_PatientBirthDate) +, patientSex(DCM_PatientSex) +, studyInstanceUID(DCM_StudyInstanceUID) +, studyDate(DCM_StudyDate) +, studyTime(DCM_StudyTime) +, referringPhysicianName(DCM_ReferringPhysicianName) +, studyID(DCM_StudyID) +, accessionNumber(DCM_AccessionNumber) +, seriesInstanceUID(DCM_SeriesInstanceUID) +, seriesNumber(DCM_SeriesNumber) +, manufacturer(DCM_Manufacturer) +, displayedAreaSelectionList() +, presentationLUT() +, imageNumber(DCM_InstanceNumber) +, presentationLabel(DCM_ContentLabel) +, presentationDescription(DCM_ContentDescription) +, presentationCreationDate(DCM_PresentationCreationDate) +, presentationCreationTime(DCM_PresentationCreationTime) +, presentationCreatorsName(DCM_ContentCreatorName) +, referencedSeriesList() +, sOPInstanceUID(DCM_SOPInstanceUID) +, specificCharacterSet(DCM_SpecificCharacterSet) +, instanceCreationDate(DCM_InstanceCreationDate) +, instanceCreationTime(DCM_InstanceCreationTime) +, instanceCreatorUID(DCM_InstanceCreatorUID) +, useShutterRectangular(OFFalse) +, useShutterCircular(OFFalse) +, useShutterPolygonal(OFFalse) +, useShutterBitmap(OFFalse) +, shutterShape(DCM_ShutterShape) +, shutterLeftVerticalEdge(DCM_ShutterLeftVerticalEdge) +, shutterRightVerticalEdge(DCM_ShutterRightVerticalEdge) +, shutterUpperHorizontalEdge(DCM_ShutterUpperHorizontalEdge) +, shutterLowerHorizontalEdge(DCM_ShutterLowerHorizontalEdge) +, centerOfCircularShutter(DCM_CenterOfCircularShutter) +, radiusOfCircularShutter(DCM_RadiusOfCircularShutter) +, verticesOfThePolygonalShutter(DCM_VerticesOfThePolygonalShutter) +, shutterPresentationValue(DCM_ShutterPresentationValue) +, shutterOverlayGroup(DCM_ShutterOverlayGroup) +, overlayList() +, activationLayerList() +, graphicAnnotationList() +, imageRotation(DCM_ImageRotation) +, imageHorizontalFlip(DCM_ImageHorizontalFlip) +, graphicLayerList() +, useModalityRescale(OFFalse) +, useModalityLUT(OFFalse) +, modalityLUTDescriptor(DCM_LUTDescriptor) +, modalityLUTExplanation(DCM_LUTExplanation) +, modalityLUTType(DCM_ModalityLUTType) +, modalityLUTData(DCM_LUTData) +, rescaleIntercept(DCM_RescaleIntercept) +, rescaleSlope(DCM_RescaleSlope) +, rescaleType(DCM_RescaleType) +, softcopyVOIList() +{ + createInstanceUID(); +} + + +DcmPresentationState::~DcmPresentationState() +{ +} + +void DcmPresentationState::clear() +{ + patientName.clear(); + patientID.clear(); + patientBirthDate.clear(); + patientSex.clear(); + studyInstanceUID.clear(); + studyDate.clear(); + studyTime.clear(); + referringPhysicianName.clear(); + studyID.clear(); + accessionNumber.clear(); + seriesInstanceUID.clear(); + seriesNumber.clear(); + manufacturer.clear(); + displayedAreaSelectionList.clear(); + presentationLUT.clear(); + imageNumber.clear(); + presentationLabel.clear(); + presentationDescription.clear(); + presentationCreationDate.clear(); + presentationCreationTime.clear(); + presentationCreatorsName.clear(); + referencedSeriesList.clear(); + sOPInstanceUID.clear(); + specificCharacterSet.clear(); + instanceCreationDate.clear(); + instanceCreationTime.clear(); + instanceCreatorUID.clear(); + shutterShape.clear(); + shutterLeftVerticalEdge.clear(); + shutterRightVerticalEdge.clear(); + shutterUpperHorizontalEdge.clear(); + shutterLowerHorizontalEdge.clear(); + centerOfCircularShutter.clear(); + radiusOfCircularShutter.clear(); + verticesOfThePolygonalShutter.clear(); + shutterPresentationValue.clear(); + shutterOverlayGroup.clear(); + overlayList.clear(); + activationLayerList.clear(); + graphicAnnotationList.clear(); + imageRotation.clear(); + imageHorizontalFlip.clear(); + graphicLayerList.clear(); + useModalityRescale = OFFalse; + useModalityLUT = OFFalse; + modalityLUTDescriptor.clear(); + modalityLUTExplanation.clear(); + modalityLUTType.clear(); + modalityLUTData.clear(); + rescaleIntercept.clear(); + rescaleSlope.clear(); + rescaleType.clear(); + softcopyVOIList.clear(); + return; +} + + +const char *DcmPresentationState::createInstanceUID() +{ + char uid[100]; + OFString aString; + char *puid = NULL; + + OFCondition result = sOPInstanceUID.putString(dcmGenerateUniqueIdentifier(uid)); + DVPSHelper::currentDate(aString); + DVPSHelper::setDefault(result, instanceCreationDate, aString.c_str()); + DVPSHelper::currentTime(aString); + DVPSHelper::setDefault(result, instanceCreationTime, aString.c_str()); + if (EC_Normal == result) + { + if (EC_Normal != sOPInstanceUID.getString(puid)) puid=NULL; + } + return puid; +} + + +const char *DcmPresentationState::getInstanceUID() +{ + char *puid = NULL; + if (EC_Normal != sOPInstanceUID.getString(puid)) puid=NULL; + return puid; +} + + +const char *DcmPresentationState::getSOPClassUID() +{ + return UID_GrayscaleSoftcopyPresentationStateStorage; +} + + +const char *DcmPresentationState::getPatientID() +{ + char *c = NULL; + if (EC_Normal == patientID.getString(c)) return c; else return NULL; +} + + +const char *DcmPresentationState::getStudyUID() +{ + char *c = NULL; + if (EC_Normal == studyInstanceUID.getString(c)) return c; else return NULL; +} + + +OFCondition DcmPresentationState::createDummyValues(OFBool replaceSOPInstanceUID) +{ + OFCondition result = EC_Normal; + char uid[100]; + OFString aString; + + DVPSHelper::setDefault(result, patientName, DEFAULT_patientName); + SET_UID(studyInstanceUID) + SET_UID(seriesInstanceUID) + + DVPSHelper::setDefault(result, imageNumber, DEFAULT_imageNumber); + DVPSHelper::setDefault(result, presentationLabel, DEFAULT_presentationLabel); + DVPSHelper::currentDate(aString); + DVPSHelper::setDefault(result, presentationCreationDate, aString.c_str() ); + DVPSHelper::currentTime(aString); + DVPSHelper::setDefault(result, presentationCreationTime, aString.c_str() ); + + if ((result==EC_Normal)&&(replaceSOPInstanceUID ||(sOPInstanceUID.getLength()==0))) + { + sOPInstanceUID.putString(dcmGenerateUniqueIdentifier(uid)); + DVPSHelper::currentDate(aString); + DVPSHelper::setDefault(result, instanceCreationDate, aString.c_str() ); + DVPSHelper::currentTime(aString); + DVPSHelper::setDefault(result, instanceCreationTime, aString.c_str() ); + } + + // default for specific character set is -absent-. + // DVPSHelper::setDefault(result, specificCharacterSet, DEFAULT_specificCharacterSet ); + + // create some dummy defaults for shutters + if (shutterPresentationValue.getVM() != 1) shutterPresentationValue.putUint16(0); + DVPSHelper::setDefault(result, shutterLeftVerticalEdge, "1"); + DVPSHelper::setDefault(result, shutterRightVerticalEdge, "1024"); + DVPSHelper::setDefault(result, shutterUpperHorizontalEdge, "1"); + DVPSHelper::setDefault(result, shutterLowerHorizontalEdge, "1024"); + DVPSHelper::setDefault(result, centerOfCircularShutter, "512\\512"); + DVPSHelper::setDefault(result, radiusOfCircularShutter, "512"); + DVPSHelper::setDefault(result, verticesOfThePolygonalShutter, "1\\1\\1\\1024\\1024\\1024\\1024\\1\\1\\1"); + if (shutterOverlayGroup.getVM() != 1) shutterOverlayGroup.putUint16(0x6000); + + // create defaults for Spatial Transformation Module + if (result==EC_Normal) + { + if (imageRotation.getVM() != 1) result = imageRotation.putUint16(0); + } + DVPSHelper::setDefault(result, imageHorizontalFlip, "N"); + + // create defaults for Modality Rescale + DVPSHelper::setDefault(result, rescaleIntercept, "0"); + DVPSHelper::setDefault(result, rescaleSlope, "1"); + DVPSHelper::setDefault(result, rescaleType, "UNSPECIFIED"); + + return result; +} + + +OFCondition DcmPresentationState::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DcmSequenceOfItems *seq; + DcmItem *item; + + clear(); // re-initialize Presentation State object + + /* check SOP class UID and modality first */ + DcmUniqueIdentifier sopclassuid(DCM_SOPClassUID); + DcmCodeString modality(DCM_Modality); + OFString aString; + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassuid) + READ_FROM_DATASET(DcmCodeString, EVR_CS, modality) + + if (sopclassuid.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("SOPClassUID absent or empty in presentation state"); + } + else if (sopclassuid.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("SOPClassUID VM != 1 in presentation state"); + } + + if (modality.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("Modality absent or empty in presentation state"); + } + else if (modality.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("Modality VM != 1 in presentation state"); + } + + sopclassuid.getOFString(aString,0); + if (aString != UID_GrayscaleSoftcopyPresentationStateStorage) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("SOP Class UID does not match GrayscaleSoftcopyPresentationStateStorage"); + } + + modality.getOFString(aString,0); + if (aString != "PR") + { + result=EC_IllegalCall; + DCMPSTAT_WARN("Modality does not match 'PR' for presentation state"); + } + + if (result==EC_Normal) + { + READ_FROM_DATASET(DcmPersonName, EVR_PN, patientName) + READ_FROM_DATASET(DcmLongString, EVR_LO, patientID) + READ_FROM_DATASET(DcmDate, EVR_DA, patientBirthDate) + READ_FROM_DATASET(DcmCodeString, EVR_CS, patientSex) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyInstanceUID) + READ_FROM_DATASET(DcmDate, EVR_DA, studyDate) + READ_FROM_DATASET(DcmTime, EVR_TM, studyTime) + READ_FROM_DATASET(DcmPersonName, EVR_PN, referringPhysicianName) + READ_FROM_DATASET(DcmShortString, EVR_SH, studyID) + READ_FROM_DATASET(DcmShortString, EVR_SH, accessionNumber) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesInstanceUID) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, seriesNumber) + READ_FROM_DATASET(DcmLongString, EVR_LO, manufacturer) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, imageNumber) + READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationLabel) + READ_FROM_DATASET(DcmLongString, EVR_LO, presentationDescription) + READ_FROM_DATASET(DcmDate, EVR_DA, presentationCreationDate) + READ_FROM_DATASET(DcmTime, EVR_TM, presentationCreationTime) + READ_FROM_DATASET(DcmPersonName, EVR_PN, presentationCreatorsName) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID) + READ_FROM_DATASET(DcmCodeString, EVR_CS, specificCharacterSet) + READ_FROM_DATASET(DcmDate, EVR_DA, instanceCreationDate) + READ_FROM_DATASET(DcmTime, EVR_TM, instanceCreationTime) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, instanceCreatorUID) + READ_FROM_DATASET(DcmCodeString, EVR_CS, shutterShape) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLeftVerticalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterRightVerticalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterUpperHorizontalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLowerHorizontalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, centerOfCircularShutter) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, radiusOfCircularShutter) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, verticesOfThePolygonalShutter) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, shutterPresentationValue) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, shutterOverlayGroup) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, imageRotation) + READ_FROM_DATASET(DcmCodeString, EVR_CS, imageHorizontalFlip) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleIntercept) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleSlope) + READ_FROM_DATASET(DcmLongString, EVR_LO, rescaleType) + } + + /* read Modality LUT Sequence */ + if (result==EC_Normal) + { + stack.clear(); + if ((EC_Normal == dset.search(DCM_ModalityLUTSequence, stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_SQ)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + item = seq->getItem(0); + stack.clear(); + // LUTDescriptor can be US or SS. For now we only handle US. + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTDescriptor.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US)) + { + modalityLUTDescriptor = *((DcmUnsignedShort *)(stack.top())); + } + stack.clear(); + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTExplanation.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO)) + { + modalityLUTExplanation = *((DcmLongString *)(stack.top())); + } + stack.clear(); + + // LUTData can be OW, US or SS. For now we only handle US. + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTData.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US)) + { + modalityLUTData = *((DcmUnsignedShort *)(stack.top())); + } + stack.clear(); + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTType.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO)) + { + modalityLUTType = *((DcmLongString *)(stack.top())); + } + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("Modality LUT SQ does not have exactly one item in presentation state"); + } + } + } + + if (result==EC_Normal) result = overlayList.read(dset); + if (result==EC_Normal) result = activationLayerList.read(dset); + if (result==EC_Normal) result = graphicLayerList.read(dset); + if (result==EC_Normal) result = referencedSeriesList.read(dset); + if (result==EC_Normal) result = graphicAnnotationList.read(dset); + if (result==EC_Normal) result = displayedAreaSelectionList.read(dset); + if (result==EC_Normal) result = softcopyVOIList.read(dset); + if (result==EC_Normal) result = presentationLUT.read(dset, OFFalse); + + /* Now perform basic sanity checks and adjust use flags */ + + if (result==EC_Normal) + { + + if (patientName.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("patientName absent or empty in presentation state"); + } + else if (patientName.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("patientName VM != 1 in presentation state"); + } + + if (studyInstanceUID.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("studyInstanceUID absent or empty in presentation state"); + } + else if (studyInstanceUID.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("studyInstanceUID VM != 1 in presentation state"); + } + + if (displayedAreaSelectionList.size() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("displayedAreaSelectionSQ absent or empty in presentation state"); + } + + if (imageNumber.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("instanceNumber absent or empty in presentation state"); + } + else if (imageNumber.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("instanceNumber VM != 1 in presentation state"); + } + + if (presentationLabel.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationLabel absent or empty in presentation state"); + } + else if (presentationLabel.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationLabel VM != 1 in presentation state"); + } + + if (presentationCreationDate.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationCreationDate absent or empty in presentation state"); + } + else if (presentationCreationDate.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationCreationDate VM != 1 in presentation state"); + } + + if (presentationCreationTime.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationCreationTime absent or empty in presentation state"); + } + else if (presentationCreationTime.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationCreationTime VM != 1 in presentation state"); + } + + if (sOPInstanceUID.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("sOPInstanceUID absent or empty in presentation state"); + } + else if (sOPInstanceUID.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("sOPInstanceUID VM != 1 in presentation state"); + } + + /* if imageRotation or imageHorizontalFlip are present, then both must be present. */ + if ((imageRotation.getLength() > 0)&&(imageHorizontalFlip.getLength() == 0)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("imageRotation present but imageHorizontalFlip absent or empty in presentation state"); + } + + if ((imageRotation.getLength() == 0)&&(imageHorizontalFlip.getLength() > 0)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("imageHorizontalFlip present but imageRotation absent or empty in presentation state"); + } + + /* Modality LUT */ + if (rescaleIntercept.getLength() > 0) + { + useModalityRescale = OFTrue; + + if (rescaleSlope.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("rescaleIntercept present but rescaleSlope absent or empty in presentation state"); + } + else if (rescaleSlope.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("rescaleIntercept present but rescaleSlope VM != 1 in presentation state"); + } + if (rescaleType.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("rescaleIntercept present but rescaleType absent or empty in presentation state"); + } + else if (rescaleType.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("rescaleIntercept present but rescaleType VM != 1 in presentation state"); + } + if (rescaleIntercept.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("rescaleIntercept present but VM != 1 in presentation state"); + } + } else useModalityRescale = OFFalse; + if (modalityLUTData.getLength() > 0) + { + useModalityLUT = OFTrue; + + if (modalityLUTDescriptor.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("modalityLUTData present but modalityLUTDescriptor absent or empty in presentation state"); + } + else if (modalityLUTDescriptor.getVM() != 3) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("modalityLUTData present but modalityLUTDescriptor VM != 3 in presentation state"); + } + + } else useModalityLUT = OFFalse; + /* we may not have both modality rescale and LUT */ + if (useModalityRescale && useModalityLUT) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("both modality rescale and LUT present in presentation state"); + } + + } /* end result==EC_Normal */ + + /* check shutters */ + if (result==EC_Normal) + { + // now we examine the shutterShape for the Shutter modules + Uint32 i; + aString.clear(); + useShutterRectangular=OFFalse; + useShutterCircular=OFFalse; + useShutterPolygonal=OFFalse; + useShutterBitmap=OFFalse; + for (i=0; i= 0x6000) + { + if (!overlayList.haveOverlayGroup(shuttergroup)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("bitmap shutter specified but referenced overlay group missing in presentation state"); + } + } else { + result=EC_IllegalCall; + DCMPSTAT_WARN("wrong overlay group specified for bitmap shutter in presentation state"); + } + } + + /* check that referenced series list is non-empty and that every series contains images + and that all referenced images share the same SOP class UID. + */ + if (result.good() && (!referencedSeriesList.isValid())) + { + // referencedSeriesList.isValid() has already displayed an error message in verbose mode + result = EC_IllegalCall; + } + + /* check that there is no mask module present. We don't support Mask and therefore + are obliged to reject any presentation state containing a mask! */ + + stack.clear(); + if (EC_Normal == dset.search(DCM_MaskSubtractionSequence, stack, ESM_fromHere, OFFalse)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("mask module present in presentation state, but unsupported"); + } + stack.clear(); + if (EC_Normal == dset.search(DCM_RecommendedViewingMode, stack, ESM_fromHere, OFFalse)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("mask module present in presentation state, but unsupported"); + } + + return result; +} + +OFCondition DcmPresentationState::createDefaultDisplayedArea(DcmItem &dset) +{ + DcmUnsignedShort rows(DCM_Rows); + DcmUnsignedShort columns(DCM_Columns); + DcmUniqueIdentifier sopclassUID(DCM_SOPClassUID); + DcmUniqueIdentifier imageUID(DCM_SOPInstanceUID); + DcmDecimalString imagerPixelSpacing(DCM_ImagerPixelSpacing); + DcmDecimalString pixelSpacing(DCM_PixelSpacing); + DcmIntegerString pixelAspectRatio(DCM_PixelAspectRatio); + Uint16 cols_uint=0; + Uint16 rows_uint=0; + char *c_sopclassUID = NULL; + char *c_imageUID = NULL; + char *pixelspacing = NULL; + OFCondition result = EC_Normal; + DcmStack stack; + + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, rows) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, columns) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassUID) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, imageUID) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, imagerPixelSpacing) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, pixelSpacing) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, pixelAspectRatio) + + if (result == EC_Normal) result = columns.getUint16(cols_uint,0); + if (result == EC_Normal) result = rows.getUint16(rows_uint,0); + if (result == EC_Normal) result = sopclassUID.getString(c_sopclassUID); + if (result == EC_Normal) result = imageUID.getString(c_imageUID); + + /* create displayed area selection item for this image */ + if (EC_Normal == result) + { + DVPSDisplayedArea *area = displayedAreaSelectionList.createDisplayedArea( + referencedSeriesList, c_sopclassUID, c_imageUID, 1, 1, DVPSB_currentImage); + if (area) + { + if (EC_Normal == result) result = area->setDisplayedArea(DVPSD_scaleToFit, (Sint32)1, (Sint32)1, (Sint32)cols_uint, (Sint32)rows_uint); + if (EC_Normal == result) + { + OFBool foundRatio = OFFalse; + if ((imagerPixelSpacing.getVM()==2)&&(EC_Normal==imagerPixelSpacing.getString(pixelspacing))) + { + result = area->setDisplayedAreaPixelSpacing(pixelspacing); + if (EC_Normal==result) foundRatio = OFTrue; + } + if ((! foundRatio)&&(pixelSpacing.getVM()==2)&&(EC_Normal==pixelSpacing.getString(pixelspacing))) + { + result = area->setDisplayedAreaPixelSpacing(pixelspacing); + if (EC_Normal==result) foundRatio = OFTrue; + } + if ((! foundRatio)&&(pixelAspectRatio.getVM()==2)&&(EC_Normal==pixelAspectRatio.getString(pixelspacing))) + { + result = area->setDisplayedAreaPixelAspectRatio(pixelspacing); + if (EC_Normal==result) foundRatio = OFTrue; + } + if (! foundRatio) result = area->setDisplayedAreaPixelAspectRatio(1.0); + } + } else result = EC_MemoryExhausted; + } + return result; +} + +OFCondition DcmPresentationState::createFromImage( + DcmItem &dset, + DVPSoverlayActivation overlayActivation, + DVPSVOIActivation voiActivation, + OFBool curveActivation, + OFBool shutterActivation, + OFBool presentationActivation, + DVPSGraphicLayering layering, + const char *aetitle, + const char *filesetID, + const char *filesetUID) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DcmSequenceOfItems *seq; + DcmItem *item; + char uid[100]; + OFString aString; + OFString ofsopclassUID; + OFString ofimageUID; + OFBool isMonochrome1 = OFFalse; + DcmUniqueIdentifier sopclassUID(DCM_SOPClassUID); + DcmUniqueIdentifier imageUID(DCM_SOPInstanceUID); + DcmCodeString photometricInterpretation(DCM_PhotometricInterpretation); + DcmCodeString presentationLUTShape(DCM_PresentationLUTShape); + + clear(); // re-initialize Presentation State object + + /* copy some image attributes we will need later */ + READ_FROM_DATASET(DcmCodeString, EVR_CS, photometricInterpretation) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassUID) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, imageUID) + sopclassUID.getOFString(ofsopclassUID,0); + imageUID.getOFString(ofimageUID,0); + + /* copy attributes for Patient, General Study and General Equipment + * modules from image object. Also copy specific character set (SOP common). */ + READ_FROM_DATASET(DcmPersonName, EVR_PN, patientName) + READ_FROM_DATASET(DcmLongString, EVR_LO, patientID) + READ_FROM_DATASET(DcmDate, EVR_DA, patientBirthDate) + READ_FROM_DATASET(DcmCodeString, EVR_CS, patientSex) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyInstanceUID) + READ_FROM_DATASET(DcmDate, EVR_DA, studyDate) + READ_FROM_DATASET(DcmTime, EVR_TM, studyTime) + READ_FROM_DATASET(DcmPersonName, EVR_PN, referringPhysicianName) + READ_FROM_DATASET(DcmShortString, EVR_SH, studyID) + READ_FROM_DATASET(DcmShortString, EVR_SH, accessionNumber) + READ_FROM_DATASET(DcmLongString, EVR_LO, manufacturer) + READ_FROM_DATASET(DcmCodeString, EVR_CS, specificCharacterSet) + + /* if there is a modality rescale, copy it now. + * Later we decide whether we want to use it. + */ + READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleIntercept) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleSlope) + READ_FROM_DATASET(DcmLongString, EVR_LO, rescaleType) + + if ((result==EC_Normal) && shutterActivation) + { + /* if there is a display shutter in the image (i.e. in XA, RF, DX), copy it. + * We never copy bitmap shutters. + */ + READ_FROM_DATASET(DcmCodeString, EVR_CS, shutterShape) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLeftVerticalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterRightVerticalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterUpperHorizontalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLowerHorizontalEdge) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, centerOfCircularShutter) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, radiusOfCircularShutter) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, verticesOfThePolygonalShutter) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, shutterPresentationValue) + } + + if ((result==EC_Normal) && presentationActivation) + { + /* if there is a Presentation LUT shape in the image (i.e. in DX), copy it. + * We never copy presentation LUT sequences. + */ + READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationLUTShape) + } + + /* read Modality LUT Sequence */ + if (result==EC_Normal) + { + stack.clear(); + if ((EC_Normal == dset.search(DCM_ModalityLUTSequence, stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_SQ)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() >0) + { + item = seq->getItem(0); + stack.clear(); + // LUTDescriptor can be US or SS. For now we only handle US. + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTDescriptor.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US)) + { + modalityLUTDescriptor = *((DcmUnsignedShort *)(stack.top())); + } + stack.clear(); + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTExplanation.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO)) + { + modalityLUTExplanation = *((DcmLongString *)(stack.top())); + } + stack.clear(); + + // LUTData can be OW, US or SS. For now we only handle US. + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTData.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US)) + { + modalityLUTData = *((DcmUnsignedShort *)(stack.top())); + } + stack.clear(); + if ((EC_Normal == item->search((DcmTagKey &)modalityLUTType.getTag(), + stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO)) + { + modalityLUTType = *((DcmLongString *)(stack.top())); + } + } else result=EC_TagNotFound; + } + } + + /* copy overlays if appropriate */ + if ((result==EC_Normal)&&(overlayActivation==DVPSO_copyOverlays)) result = overlayList.read(dset); + + /* Now perform basic sanity checks and adjust use flags */ + + if ((studyInstanceUID.getLength() == 0)||(studyInstanceUID.getVM() != 1)) result=EC_IllegalCall; + + + if (photometricInterpretation.getVM() == 1) + { + aString.clear(); + photometricInterpretation.getOFString(aString,0); + if ((aString == "MONOCHROME1")||(aString == "MONOCHROME 1")) isMonochrome1 = OFTrue; + else if ((aString != "MONOCHROME2")&&(aString != "MONOCHROME 2")) + { + result = EC_IllegalCall; + DCMPSTAT_WARN("Wrong image photometric interpretation - not MONOCHROME1/2"); + } + } + + if (result==EC_Normal) + { + if ((patientName.getLength() == 0)||(patientName.getVM() != 1)) + result = patientName.putString(DEFAULT_patientName); + } + if (result==EC_Normal) + { + result = imageNumber.putString(DEFAULT_imageNumber); + } + if (result==EC_Normal) + { + result = presentationLabel.putString(DEFAULT_presentationLabel); + } + if (result==EC_Normal) + { + aString.clear(); + DVPSHelper::currentDate(aString); + result = presentationCreationDate.putString(aString.c_str()); + } + if (result==EC_Normal) + { + aString.clear(); + DVPSHelper::currentTime(aString); + result = presentationCreationTime.putString(aString.c_str()); + } + if (result==EC_Normal) result = seriesInstanceUID.putString(dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT)); + if (result==EC_Normal) result = sOPInstanceUID.putString(dcmGenerateUniqueIdentifier(uid)); + if (result==EC_Normal) result = seriesNumber.putString(DEFAULT_seriesNumber); + if (result==EC_Normal) result = specificCharacterSet.putString(DEFAULT_specificCharacterSet); + + if (result==EC_Normal) + { + /* Presentation LUT Shape */ + if (isMonochrome1) presentationLUT.setType(DVPSP_inverse); else presentationLUT.setType(DVPSP_identity); + if (presentationLUTShape.getVM() == 1) + { + aString.clear(); + presentationLUTShape.getOFString(aString,0); + if (aString == "IDENTITY") presentationLUT.setType(DVPSP_identity); + if (aString == "INVERSE") presentationLUT.setType(DVPSP_inverse); + if (aString == "LIN OD") + { + DCMPSTAT_WARN("LIN OD found in presentation state; set to IDENTITY"); + presentationLUT.setType(DVPSP_identity); + } + } + } + + if (result==EC_Normal) + { + /* Modality LUT */ + if ((rescaleIntercept.getVM() == 1) && (rescaleSlope.getVM() == 1)) + { + useModalityRescale = OFTrue; + modalityLUTData.clear(); + modalityLUTDescriptor.clear(); + modalityLUTExplanation.clear(); + modalityLUTType.clear(); + // be lenient with Modality rescale type. If missing or wrong, just invent a value. + if (rescaleType.getVM() != 1) rescaleType.putString("US"); + } else useModalityRescale = OFFalse; + + // these three SOP classes use the X-Ray Image Module in which the meaning + // of the Modality LUT transformation is "inversersed" and, therefore, + // must not be copied into the presentation state + if ((ofsopclassUID == UID_XRayAngiographicImageStorage) || + (ofsopclassUID == UID_XRayRadiofluoroscopicImageStorage) || + (ofsopclassUID == UID_RETIRED_XRayAngiographicBiPlaneImageStorage)) + { + modalityLUTData.clear(); + modalityLUTDescriptor.clear(); + modalityLUTExplanation.clear(); + modalityLUTType.clear(); + useModalityLUT = OFFalse; + } + + if ((modalityLUTDescriptor.getVM() == 3) && (modalityLUTData.getLength() > 0)) + { + useModalityLUT = OFTrue; + rescaleIntercept.clear(); + rescaleSlope.clear(); + rescaleType.clear(); + } else useModalityLUT = OFFalse; + } + + /* check shutters */ + if (result==EC_Normal) + { + // now we examine the shutterShape for the Shutter modules + Uint32 i; + aString.clear(); + useShutterRectangular=OFFalse; + useShutterCircular=OFFalse; + useShutterPolygonal=OFFalse; + useShutterBitmap=OFFalse; + for (i=0; i0) aString += '\\'; + aString += "CIRCULAR"; + } + if (useShutterPolygonal) + { + if (aString.size() >0) aString += '\\'; + aString += "POLYGONAL"; + } + shutterShape.putString(aString.c_str()); + if ((shutterPresentationValue.getLength() == 0)||(shutterPresentationValue.getVM() != 1)) + { + shutterPresentationValue.clear(); + shutterPresentationValue.putUint16(DEFAULT_shutterPresentationValue,0); + } + } + } + + /* browse the image for overlays and curves, create activation tags and + * graphic layers as appropriate. + */ + if (result==EC_Normal) result = activationLayerList.createFromImage(dset, + graphicLayerList, overlayList, overlayActivation, curveActivation, layering); + + /* create reference for this image */ + if (EC_Normal == result) result = addImageReference(dset, aetitle, filesetID, filesetUID); + + /* create displayed area selection item for this image */ + if (EC_Normal == result) result = createDefaultDisplayedArea(dset); + + /* create softcopy VOI LUT sequence item for this image if necessary */ + if (EC_Normal == result) result = softcopyVOIList.createFromImage(dset, + referencedSeriesList, ofsopclassUID.c_str(), ofimageUID.c_str(), voiActivation); + + return result; +} + + +OFCondition DcmPresentationState::write(DcmItem &dset, OFBool replaceSOPInstanceUID) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + cleanupLayers(); /* remove unused layers */ + createDummyValues(replaceSOPInstanceUID); + + /* add SOP Class UID */ + DcmUniqueIdentifier sopclassuid(DCM_SOPClassUID); + if (result==EC_Normal) + { + result = sopclassuid.putString(UID_GrayscaleSoftcopyPresentationStateStorage); + } + ADD_TO_DATASET(DcmUniqueIdentifier, sopclassuid) + + /* add Modality */ + DcmCodeString modality(DCM_Modality); + if (result==EC_Normal) + { + result = modality.putString("PR"); + } + ADD_TO_DATASET(DcmCodeString, modality) + + ADD_TO_DATASET(DcmPersonName, patientName) + ADD_TO_DATASET(DcmLongString, patientID) + ADD_TO_DATASET(DcmDate, patientBirthDate) + ADD_TO_DATASET(DcmCodeString, patientSex) + ADD_TO_DATASET(DcmUniqueIdentifier, studyInstanceUID) + ADD_TO_DATASET(DcmDate, studyDate) + ADD_TO_DATASET(DcmTime, studyTime) + ADD_TO_DATASET(DcmPersonName, referringPhysicianName) + ADD_TO_DATASET(DcmShortString, studyID) + ADD_TO_DATASET(DcmShortString, accessionNumber) + ADD_TO_DATASET(DcmCodeString, modality) + ADD_TO_DATASET(DcmUniqueIdentifier, seriesInstanceUID) + ADD_TO_DATASET(DcmIntegerString, seriesNumber) + ADD_TO_DATASET(DcmLongString, manufacturer) + ADD_TO_DATASET(DcmIntegerString, imageNumber) + ADD_TO_DATASET(DcmCodeString, presentationLabel) + ADD_TO_DATASET(DcmLongString, presentationDescription) + ADD_TO_DATASET(DcmDate, presentationCreationDate) + ADD_TO_DATASET(DcmTime, presentationCreationTime) + ADD_TO_DATASET(DcmPersonName, presentationCreatorsName) + + + ADD_TO_DATASET(DcmUniqueIdentifier, sOPInstanceUID) + if (specificCharacterSet.getLength() >0) { ADD_TO_DATASET(DcmCodeString, specificCharacterSet) } + if (instanceCreationDate.getLength() >0) { ADD_TO_DATASET(DcmDate, instanceCreationDate) } + if (instanceCreationTime.getLength() >0) { ADD_TO_DATASET(DcmTime, instanceCreationTime) } + if (instanceCreatorUID.getLength() >0) { ADD_TO_DATASET(DcmUniqueIdentifier, instanceCreatorUID) } + + shutterShape.clear(); + if (useShutterRectangular || useShutterCircular || useShutterPolygonal) + { + OFString aString; + if (useShutterRectangular) aString = "RECTANGULAR"; + if (useShutterCircular) + { + if (aString.size() > 0) aString += '\\'; + aString += "CIRCULAR"; + } + if (useShutterPolygonal) + { + if (aString.size() > 0) aString += '\\'; + aString += "POLYGONAL"; + } + shutterShape.putString(aString.c_str()); + } else if (useShutterBitmap) + { + shutterShape.putString("BITMAP"); + } + if (useShutterRectangular || useShutterCircular || useShutterPolygonal) + { + ADD_TO_DATASET(DcmCodeString, shutterShape) + ADD_TO_DATASET(DcmUnsignedShort, shutterPresentationValue) + if (useShutterRectangular) + { + ADD_TO_DATASET(DcmIntegerString, shutterLeftVerticalEdge) + ADD_TO_DATASET(DcmIntegerString, shutterRightVerticalEdge) + ADD_TO_DATASET(DcmIntegerString, shutterUpperHorizontalEdge) + ADD_TO_DATASET(DcmIntegerString, shutterLowerHorizontalEdge) + } + if (useShutterCircular) + { + ADD_TO_DATASET(DcmIntegerString, centerOfCircularShutter) + ADD_TO_DATASET(DcmIntegerString, radiusOfCircularShutter) + } + if (useShutterPolygonal) + { + ADD_TO_DATASET(DcmIntegerString, verticesOfThePolygonalShutter) + } + } + else if (useShutterBitmap) + { + ADD_TO_DATASET(DcmCodeString, shutterShape) + ADD_TO_DATASET(DcmUnsignedShort, shutterPresentationValue) + ADD_TO_DATASET(DcmUnsignedShort, shutterOverlayGroup) + } + + if (EC_Normal == result) result = referencedSeriesList.write(dset); + if (EC_Normal == result) result = overlayList.write(dset); + if (EC_Normal == result) result = activationLayerList.write(dset); + if (EC_Normal == result) result = graphicAnnotationList.write(dset); + if (EC_Normal == result) result = displayedAreaSelectionList.write(dset); + if (EC_Normal == result) result = softcopyVOIList.write(dset); + if (EC_Normal == result) result = graphicLayerList.write(dset); + if (EC_Normal == result) result = presentationLUT.write(dset, OFFalse); + + // strictly speaking we are not allowed to include the Spatial Transformation + // Module if neither rotation nor flipping are needed. + OFString aString; + OFBool haveRotation=OFFalse; + OFBool haveFlip=OFFalse; + if (imageRotation.getVM() == 1) + { + Uint16 urot=0; + imageRotation.getUint16(urot,0); + if (urot) haveRotation=OFTrue; + } + if (imageHorizontalFlip.getLength() > 0) + { + imageHorizontalFlip.getOFString(aString, 0, OFTrue); + if (aString == "Y") haveFlip=OFTrue; + } + + if (haveRotation || haveFlip) + { + ADD_TO_DATASET(DcmUnsignedShort, imageRotation) + ADD_TO_DATASET(DcmCodeString, imageHorizontalFlip) + } + + if (useModalityRescale) + { + ADD_TO_DATASET(DcmDecimalString, rescaleIntercept) + ADD_TO_DATASET(DcmDecimalString, rescaleSlope) + ADD_TO_DATASET(DcmLongString, rescaleType) + } + else if (useModalityLUT) + { + if (result == EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + dseq = new DcmSequenceOfItems(DCM_ModalityLUTSequence); + if (dseq) + { + delem = new DcmUnsignedShort(modalityLUTDescriptor); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUnsignedShort(modalityLUTData); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmLongString(modalityLUTType); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + if (modalityLUTExplanation.getLength() >0) + { + delem = new DcmLongString(modalityLUTExplanation); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + } + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + // out of memory during creation of sequence contents. + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } else { + // could allocate item but not sequence. Bail out. + delete ditem; + result = EC_MemoryExhausted; + } + } + else result = EC_MemoryExhausted; + } + } + + return result; +} + + +OFCondition DcmPresentationState::addImageReference( + const char *studyUID, + const char *seriesUID, + const char *sopclassUID, + const char *instanceUID, + const char *frames, + const char *aetitle, + const char *filesetID, + const char *filesetUID) +{ + if ((studyUID==NULL)||(seriesUID==NULL)||(sopclassUID==NULL)||(instanceUID==NULL)) return EC_IllegalCall; + + OFString study; + studyInstanceUID.getOFString(study,0); + if (study != studyUID) + { + DCMPSTAT_WARN("cannot add reference to image with different Study Instance UID."); + return EC_IllegalCall; + } + return referencedSeriesList.addImageReference(seriesUID, sopclassUID, instanceUID, frames, aetitle, filesetID, filesetUID); +} + + +OFCondition DcmPresentationState::addImageReference( + DcmItem &dset, + const char *aetitle, + const char *filesetID, + const char *filesetUID) +{ + DcmIntegerString numberOfFrames(DCM_NumberOfFrames); + DcmUniqueIdentifier studyUID(DCM_StudyInstanceUID); + DcmUniqueIdentifier seriesUID(DCM_SeriesInstanceUID); + DcmUniqueIdentifier sopclassUID(DCM_SOPClassUID); + DcmUniqueIdentifier imageUID(DCM_SOPInstanceUID); + + OFString ofstudyUID; + OFString ofseriesUID; + OFString ofsopclassUID; + OFString ofimageUID; + OFString aString; + char buf[20]; + Sint32 i=0; + Sint32 ofnumberOfFrames=0; + DcmStack stack; + + READ_FROM_DATASET(DcmIntegerString, EVR_IS, numberOfFrames) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyUID) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesUID) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassUID) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, imageUID) + + numberOfFrames.getSint32(ofnumberOfFrames,0); + seriesUID.getOFString(ofseriesUID,0); + sopclassUID.getOFString(ofsopclassUID,0); + imageUID.getOFString(ofimageUID,0); + studyUID.getOFString(ofstudyUID,0); + + OFCondition result = EC_Normal; + /* if the image is multiframe, reference all frames */ + if (ofnumberOfFrames > 1) + { + for (i=0; igetOverlayGroup()); + return 0; +} + +const char *DcmPresentationState::getOverlayInPresentationStateLabel(size_t idx) +{ + DVPSOverlay *overlay = overlayList.getOverlay(idx); + if (overlay) return overlay->getOverlayLabel(); + return NULL; +} + +const char *DcmPresentationState::getOverlayInPresentationStateDescription(size_t idx) +{ + DVPSOverlay *overlay = overlayList.getOverlay(idx); + if (overlay) return overlay->getOverlayDescription(); + return NULL; +} + +size_t DcmPresentationState::getOverlayInPresentationStateActivationLayer(size_t idx) +{ + DVPSOverlay *overlay = overlayList.getOverlay(idx); + if (overlay) + { + const char *layerName = activationLayerList.getActivationLayer(0x6000+overlay->getOverlayGroup()); + if (layerName) return graphicLayerList.getGraphicLayerIndex(layerName); + } + return DVPS_IDX_NONE; +} + +OFBool DcmPresentationState::overlayIsBitmapShutter(size_t idx) +{ + if (shutterOverlayGroup.getLength() == 0) return OFFalse; + + Uint16 shutterGroup=0; + if (EC_Normal == shutterOverlayGroup.getUint16(shutterGroup,0)) + { + DVPSOverlay *overlay = overlayList.getOverlay(idx); + if (overlay) return (shutterGroup == 0x6000+overlay->getOverlayGroup()); + } + return OFFalse; +} + +OFBool DcmPresentationState::overlayInPresentationStateIsROI(size_t idx) +{ + DVPSOverlay *overlay = overlayList.getOverlay(idx); + if (overlay) return overlay->isROI(); + return OFFalse; +} + +OFCondition DcmPresentationState::moveOverlay(size_t old_layer, size_t idx, size_t new_layer) +{ + const char *lname = graphicLayerList.getGraphicLayerName(new_layer); + if (lname==NULL) return EC_IllegalCall; + + Uint16 group = activationLayerList.getActivationGroup( + graphicLayerList.getGraphicLayerName(old_layer), idx, OFFalse); + if (group == 0) return EC_IllegalCall; + + activationLayerList.removeActivation(group); + return activationLayerList.setActivation(group, lname); +} diff --git a/dcmpstat/libsrc/dviface.cc b/dcmpstat/libsrc/dviface.cc new file mode 100644 index 00000000..43c1bf5d --- /dev/null +++ b/dcmpstat/libsrc/dviface.cc @@ -0,0 +1,4194 @@ +/* + * + * Copyright (C) 1998-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Joerg Riesmeier, Marco Eichelberg + * + * Purpose: DVPresentationState + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmpstat/dviface.h" + +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants */ +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/ofstd/ofbmanip.h" /* for OFBitmanipTemplate */ +#include "dcmtk/ofstd/ofdatime.h" /* for OFDateTime */ +#include "dcmtk/ofstd/oflist.h" /* for class OFList */ +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofcast.h" + +#include "dcmtk/dcmimgle/digsdfn.h" /* for DiGSDFunction */ +#include "dcmtk/dcmimgle/diciefn.h" /* for DiCIELABFunction */ +#include "dcmtk/dcmnet/diutil.h" /* for DU_getStringDOElement */ +#include "dcmtk/dcmpstat/dvpssp.h" /* for class DVPSStoredPrint */ +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ +#include "dcmtk/dcmimgle/dcmimage.h" /* for class DicomImage */ +#include "dcmtk/dcmpstat/dvsighdl.h" /* for class DVSignatureHandler */ +#include "dcmtk/dcmsign/dcsignat.h" /* for class DcmSignature */ +#include "dcmtk/dcmsr/dsrdoc.h" /* for class DSRDocument */ +#include "dcmtk/dcmsr/dsrcodvl.h" /* for class DSRCodedEntryValue */ +#include "dcmtk/oflog/fileap.h" /* for dcmtk::log4cplus::FileAppender */ + +#include "dcmtk/dcmpstat/dvpsib.h" /* for DVPSImageBoxContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsab.h" /* for DVPSAnnotationContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ +#include "dcmtk/dcmqrdb/dcmqrdbi.h" /* for DB_UpperMaxBytesPerStudy */ +#include "dcmtk/dcmqrdb/dcmqrdbs.h" /* for DcmQueryRetrieveDatabaseStatus */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CCTYPE +#define INCLUDE_CMATH +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_TYPES_H +#include /* for fork */ +#endif +#ifdef HAVE_SYS_WAIT_H +#include /* for waitpid */ +#endif +#ifdef HAVE_SYS_TIME_H +#include /* for wait3 */ +#endif +#ifdef HAVE_SYS_RESOURCE_H +#include /* for wait3 */ +#endif +#ifdef HAVE_SYS_STAT_H +#include /* for stat, fstat */ +#endif +#ifdef HAVE_SYS_UTIME_H +#include /* for utime */ +#endif +#ifdef HAVE_UTIME_H +#include /* for utime */ +#endif +END_EXTERN_C + +#ifdef HAVE_WINDOWS_H +#include /* for CreateProcess */ +#endif + +#ifdef WITH_OPENSSL +#include "dcmtk/dcmtls/tlstrans.h" +#include "dcmtk/dcmtls/tlslayer.h" + +BEGIN_EXTERN_C +#include +#include +#include +#include +#include +END_EXTERN_C +#endif + + +DVInterface::DVInterface(const char *config_file, OFBool useLog) +: DVConfiguration(config_file) +, pPrint(NULL) +, pState(NULL) +, pReport(NULL) +, pSignatureHandler(NULL) +, pStoredPState(NULL) +, pDicomImage(NULL) +, pDicomPState(NULL) +, pHardcopyImage(NULL) +, printJobIdentifier() +, printJobCounter(0) +, configPath() +, databaseIndexFile() +, referenceTime(0) +, pHandle(NULL) +, lockingMode(OFFalse) +, idxCache() +, idxRec() +, idxRecPos(-1) +, imageInDatabase(OFFalse) +, minimumPrintBitmapWidth(0) +, minimumPrintBitmapHeight(0) +, maximumPrintBitmapWidth(0) +, maximumPrintBitmapHeight(0) +, maximumPrintPreviewWidth(0) +, maximumPrintPreviewHeight(0) +, maximumPreviewImageWidth(0) +, maximumPreviewImageHeight(0) +, currentPrinter() +, displayCurrentLUTID() +, printCurrentLUTID() +, printerMediumType() +, printerFilmDestination() +, printerFilmSessionLabel() +, printerNumberOfCopies(0) +, printerPriority() +, printerOwnerID() +, activateAnnotation(OFFalse) +, prependDateTime(OFTrue) +, prependPrinterName(OFTrue) +, prependLighting(OFTrue) +, annotationText() +{ +#ifdef WITH_OPENSSL + DcmSignature::initializeLibrary(); // initializes OpenSSL for dcmsign and dcmtls +#endif + + clearIndexRecord(idxRec, idxRecPos); + if (config_file) configPath = config_file; + + /* initialize display transform (only on low-cost systems) */ + for (int i = DVPSD_first; i < DVPSD_max;i++) + displayFunction[i] = NULL; + if (!getGUIConfigEntryBool(L2_HIGHRESOLUTIONGRAPHICS, OFFalse)) + { + const char *displayFunctionFile = getMonitorCharacteristicsFile(); + if (displayFunctionFile && (strlen(displayFunctionFile) > 0)) + { + DiDisplayFunction *df = new DiGSDFunction(displayFunctionFile); + if (df && (df->isValid())) + { + displayFunction[DVPSD_GSDF] = df; + df = new DiCIELABFunction(displayFunctionFile); + if (df && (df->isValid())) + displayFunction[DVPSD_CIELAB] = df; + } + else + { + if (df) delete df; + DCMPSTAT_WARN("Unable to load monitor characterics file '" << displayFunctionFile << "', ignoring"); + } + } + } + + minimumPrintBitmapWidth = getMinPrintResolutionX(); + minimumPrintBitmapHeight = getMinPrintResolutionY(); + maximumPrintBitmapWidth = getMaxPrintResolutionX(); + maximumPrintBitmapHeight = getMaxPrintResolutionY(); + maximumPreviewImageWidth = getMaxPreviewResolutionX(); + maximumPreviewImageHeight = getMaxPreviewResolutionY(); + + pPrint = new DVPSStoredPrint(getDefaultPrintIllumination(), getDefaultPrintReflection(), getNetworkAETitle()); + pState = new DVPresentationState(OFstatic_cast(DiDisplayFunction **, displayFunction), + minimumPrintBitmapWidth, minimumPrintBitmapHeight, maximumPrintBitmapWidth, maximumPrintBitmapHeight, + maximumPreviewImageWidth, maximumPreviewImageHeight); + pReport = new DSRDocument(); + pSignatureHandler = new DVSignatureHandler(*this); + + referenceTime = OFstatic_cast(unsigned long, time(NULL)); + /* initialize printJobIdentifier with a string comprising the current time */ + char buf[20]; + sprintf(buf, "%lu", referenceTime); + printJobIdentifier = buf; + /* initialize reference time with "yesterday" */ + if (referenceTime >= 86400) referenceTime -= 86400; // subtract one day + setCurrentPrinter(getTargetID(0, DVPSE_printAny)); + + if (useLog) + { + const char *filename = getLogFile(); + if (filename != NULL) + { + const char *directory = getLogFolder(); + OFString filepath; + if (directory != NULL) + { + filepath = directory; + filepath += PATH_SEPARATOR; + filepath += filename; + } else + filepath = filename; + + // This will badly interact with oflog config files :( + const char *pattern = "%D, Level %p, Module DCMPSTAT%n%m%n"; + OFunique_ptr layout(new dcmtk::log4cplus::PatternLayout(pattern)); + dcmtk::log4cplus::SharedAppenderPtr logfile(new dcmtk::log4cplus::FileAppender(filepath, STD_NAMESPACE ios::app)); + // We can't use OFLog::getLogger() here because that doesn't let us + // configure the object + dcmtk::log4cplus::Logger log = dcmtk::log4cplus::Logger::getInstance("dcmtk.dcmpstat.logfile"); + + logfile->setLayout(OFmove(layout)); + log.addAppender(logfile); + log.setLogLevel(getLogLevel()); + + // All log messages to the logger "dcmtk.dcmpstat" are now written + // to the log file + } + } + + DCMPSTAT_LOGFILE("---------------------------\n--- Application started ---\n---------------------------"); +} + + +DVInterface::~DVInterface() +{ + DCMPSTAT_INFO("Application terminated"); + delete pPrint; + delete pState; + delete pReport; + delete pSignatureHandler; + delete pStoredPState; + delete pDicomImage; + delete pDicomPState; + delete pHardcopyImage; + for (int i = DVPSD_first; i < DVPSD_max; i++) + delete displayFunction[i]; + if (pHandle) releaseDatabase(); + // refresh database index file access time + if (!databaseIndexFile.empty()) + // cast to char* required for gcc 2.5.8 on NeXTSTEP + utime(OFconst_cast(char *, databaseIndexFile.c_str()), NULL); +} + + +OFCondition DVInterface::loadImage(const char *studyUID, + const char *seriesUID, + const char *instanceUID, + OFBool changeStatus) +{ + OFCondition status = EC_IllegalCall; + if (studyUID && seriesUID && instanceUID) + { + if (lockDatabase() == EC_Normal) + { + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + { + if ((status = loadImage(filename)) == EC_Normal) + { + imageInDatabase = OFTrue; + if (changeStatus) + instanceReviewed(studyUID, seriesUID, instanceUID); + } + } else + DCMPSTAT_LOGFILE("Load image from database failed: UIDs not in index file"); + } else + DCMPSTAT_LOGFILE("Load image from database failed: could not lock index file"); + } else + DCMPSTAT_LOGFILE("Load image from database failed: invalid UIDs"); + return status; +} + + +OFCondition DVInterface::loadImage(const char *imgName) +{ + OFCondition status = EC_IllegalCall; + DcmFileFormat *image = NULL; + DVPresentationState *newState = new DVPresentationState(OFstatic_cast(DiDisplayFunction **, displayFunction), + minimumPrintBitmapWidth, minimumPrintBitmapHeight, maximumPrintBitmapWidth, maximumPrintBitmapHeight, + maximumPreviewImageWidth, maximumPreviewImageHeight); + if (newState==NULL) + { + DCMPSTAT_LOGFILE("Load image from file failed: memory exhausted"); + return EC_MemoryExhausted; + } + + if ((status = DVPSHelper::loadFileFormat(imgName, image)) == EC_Normal) + { + if (image) + { + DcmDataset *dataset = image->getDataset(); + if (dataset) + { + if (EC_Normal == (status = newState->createFromImage(*dataset))) + status = newState->attachImage(image, OFFalse); + if (EC_Normal == status) + { + exchangeImageAndPState(newState, image); + imageInDatabase = OFFalse; + } + } else status = EC_CorruptedData; + } else status = EC_IllegalCall; + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Load image from file failed: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Load image from file failed: could not read fileformat"); + if (status != EC_Normal) + { + delete newState; + delete image; + } + return status; +} + + +OFCondition DVInterface::loadReferencedImage(size_t idx, OFBool changeStatus) +{ + OFCondition status = EC_IllegalCall; + if ((pState != NULL) && (idx < pState->numberOfImageReferences())) + { + OFString ofstudyUID, ofseriesUID, ofsopclassUID, ofinstanceUID, offrames, aetitle, mediaID, mediaUID; + if ((status = pState->getImageReference(idx, ofstudyUID, ofseriesUID, ofsopclassUID, ofinstanceUID, + offrames, aetitle, mediaID, mediaUID)) == EC_Normal) + { + if (lockDatabase() == EC_Normal) + { + const char *filename = getFilename(ofstudyUID.c_str(), ofseriesUID.c_str(), ofinstanceUID.c_str()); + if (filename != NULL) + { + DcmFileFormat *image = NULL; + if ((status = DVPSHelper::loadFileFormat(filename, image)) == EC_Normal) + { + status = EC_IllegalCall; + if (image != NULL) + { + DcmDataset *dataset = image->getDataset(); + if (dataset != NULL) + { + if ((status = pState->attachImage(image, OFFalse)) == EC_Normal) + { + exchangeImageAndPState(pState, image); // do not exchange pState + imageInDatabase = OFTrue; + if (changeStatus) + instanceReviewed(ofstudyUID.c_str(), ofseriesUID.c_str(), ofinstanceUID.c_str()); + } + } + } + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Load referenced image from file failed: invalid data structures"); + } else { + status = EC_CorruptedData; + DCMPSTAT_LOGFILE("Load referenced image from file failed: could not read fileformat"); + } + if (status != EC_Normal) + delete image; + } else { + status = EC_IllegalCall; + DCMPSTAT_LOGFILE("Load referenced image from database failed: UIDs not in index file"); + } + } else + DCMPSTAT_LOGFILE("Load referenced image from database failed: could not lock index file"); + } else + DCMPSTAT_LOGFILE("Load referenced image from database failed: internal error"); + } else + DCMPSTAT_LOGFILE("Load referenced image from database failed: internal error"); + return status; +} + + +OFCondition DVInterface::loadPState(const char *studyUID, + const char *seriesUID, + const char *instanceUID, + OFBool changeStatus) +{ + // determine the filename of the presentation state + OFCondition status = lockDatabase(); + if (status != EC_Normal) + { + DCMPSTAT_LOGFILE("Load presentation state from database failed: could not lock index file"); + return status; + } + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename==NULL) + { + DCMPSTAT_LOGFILE("Load presentation state from database failed: UIDs not in index file"); + return EC_IllegalCall; + } + + // load the presentation state + DcmFileFormat *pstate = NULL; + DVPresentationState *newState = new DVPresentationState(OFstatic_cast(DiDisplayFunction **, displayFunction), + minimumPrintBitmapWidth, minimumPrintBitmapHeight, maximumPrintBitmapWidth, maximumPrintBitmapHeight, + maximumPreviewImageWidth, maximumPreviewImageHeight); + if (newState==NULL) + { + DCMPSTAT_LOGFILE("Load presentation state from database failed: memory exhausted"); + return EC_MemoryExhausted; + } + + if ((EC_Normal == (status = DVPSHelper::loadFileFormat(filename, pstate)))&&(pstate)) + { + DcmDataset *dataset = pstate->getDataset(); + if (dataset) status = newState->read(*dataset); else status = EC_CorruptedData; + } + if (status == EC_Normal) + { + // access the first image reference in the presentation state + OFString ofstudyUID, ofseriesUID, ofsopclassUID, ofinstanceUID, offrames, aetitle, mediaID, mediaUID; + status = newState->getImageReference(0, ofstudyUID, ofseriesUID, ofsopclassUID, ofinstanceUID, + offrames, aetitle, mediaID, mediaUID); + + // we could do something fancy with the retrieve AE title and the storage media ID here, + // but we just assume that the referenced image is in our local database. + if (EC_Normal == status) + { + // determine the filename of the referenced image + const char *imagefilename = NULL; + imagefilename = getFilename(ofstudyUID.c_str(), ofseriesUID.c_str(), ofinstanceUID.c_str()); + + // load the image file and attach it + if (imagefilename) + { + DcmFileFormat *fimage = NULL; + if ((EC_Normal == (status = DVPSHelper::loadFileFormat(imagefilename, fimage)))&&(fimage)) + { + DcmDataset *dataset = pstate->getDataset(); + if (dataset) + { + status = newState->attachImage(fimage, OFFalse); + if (EC_Normal == status) + { + exchangeImageAndPState(newState, fimage, pstate); + imageInDatabase = OFTrue; + if (changeStatus) + { + // mark pstate and (first) image reviewed + instanceReviewed(studyUID, seriesUID, instanceUID); + instanceReviewed(ofstudyUID.c_str(), ofseriesUID.c_str(), ofinstanceUID.c_str()); + } + } + } else status = EC_CorruptedData; + } + if (status!=EC_Normal) + { + delete fimage; + DCMPSTAT_LOGFILE("Load presentation state from database failed: could not read image data"); + } + } else { + status = EC_IllegalCall; // no valid image filename + DCMPSTAT_LOGFILE("Load presentation state from database failed: referenced image not in index file"); + } + } + } else + DCMPSTAT_LOGFILE("Load presentation state from database failed: could not read fileformat"); + if (status!=EC_Normal) + { + delete pstate; + delete newState; + } + return status; +} + + +OFCondition DVInterface::loadPState(const char *pstName, + const char *imgName) +{ + OFCondition status = EC_IllegalCall; + DcmFileFormat *pstate = NULL; + DcmFileFormat *image = pDicomImage; // default: do not replace image if image filename is NULL + DVPresentationState *newState = new DVPresentationState(OFstatic_cast(DiDisplayFunction **, displayFunction), + minimumPrintBitmapWidth, minimumPrintBitmapHeight, maximumPrintBitmapWidth, maximumPrintBitmapHeight, + maximumPreviewImageWidth, maximumPreviewImageHeight); + if (newState==NULL) + { + DCMPSTAT_LOGFILE("Load presentation state from file failed: memory exhausted"); + return EC_MemoryExhausted; + } + + if ((status = DVPSHelper::loadFileFormat(pstName, pstate)) == EC_Normal) + { + if ((imgName == NULL) || ((status = DVPSHelper::loadFileFormat(imgName, image)) == EC_Normal)) + { + if ((pstate)&&(image)) + { + DcmDataset *dataset = pstate->getDataset(); + if (dataset) + { + if (EC_Normal == (status = newState->read(*dataset))) + status = newState->attachImage(image, OFFalse); + if (EC_Normal == status) + { + exchangeImageAndPState(newState, image, pstate); + imageInDatabase = OFFalse; + } + } else status = EC_CorruptedData; + } else status = EC_IllegalCall; + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Load presentation state from file failed: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Load presentation state from file failed: could not load image"); + } else + DCMPSTAT_LOGFILE("Load presentation state from file failed: could not read fileformat"); + if (status != EC_Normal) + { + delete newState; + if (image != pDicomImage) + delete image; + delete pstate; + } + return status; +} + + +OFCondition DVInterface::loadStructuredReport(const char *studyUID, + const char *seriesUID, + const char *instanceUID, + OFBool changeStatus) +{ + OFCondition status = EC_IllegalCall; + if (studyUID && seriesUID && instanceUID) + { + if (lockDatabase() == EC_Normal) + { + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + { + if ((status = loadStructuredReport(filename)) == EC_Normal) + { + if (changeStatus) + instanceReviewed(studyUID, seriesUID, instanceUID); + } + } else + DCMPSTAT_LOGFILE("Load structured report from database failed: UIDs not in index file"); + } else + DCMPSTAT_LOGFILE("Load structured report from database failed: could not lock index file"); + } else + DCMPSTAT_LOGFILE("Load structured report from database failed: invalid UIDs"); + return status; +} + + +OFCondition DVInterface::loadStructuredReport(const char *filename) +{ + OFCondition status = EC_IllegalCall; + DcmFileFormat *fileformat = NULL; + DSRDocument *newReport = new DSRDocument(); + if (newReport == NULL) + { + DCMPSTAT_LOGFILE("Load structured report from file failed: memory exhausted"); + return EC_MemoryExhausted; + } + + if ((status = DVPSHelper::loadFileFormat(filename, fileformat)) == EC_Normal) + { + if (fileformat) + { + DcmDataset *dataset = fileformat->getDataset(); + if (dataset) + { + if ((status = newReport->read(*dataset, DSRTypes::RF_readDigitalSignatures)) == EC_Normal) + { + delete pReport; + pReport = newReport; + if (pSignatureHandler) + { + pSignatureHandler->updateDigitalSignatureInformation(*dataset, DVPSS_structuredReport, OFTrue); + /* check whether loaded report is 'finalized' (certain attributes are digitally signed) */ + DcmAttributeTag tagList(DcmTag(0, 0) /* irrelevant value */); + tagList.putTagVal(DCM_SOPInstanceUID, 0); + tagList.putTagVal(DCM_VerifyingObserverSequence, 1); + tagList.putTagVal(DCM_InstanceCreationDate, 2); + tagList.putTagVal(DCM_InstanceCreationTime, 3); + tagList.putTagVal(DCM_InstanceCreatorUID, 4); + if (pSignatureHandler->attributesSigned(*dataset, tagList)) + pReport->finalizeDocument(); + } + } + } else + status = EC_CorruptedData; + } else + status = EC_IllegalCall; + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Load structured report from file failed: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Load structured report from file failed: could not read fileformat"); + if (status != EC_Normal) + delete newReport; + delete fileformat; + return status; +} + + +OFCondition DVInterface::loadSRTemplate(const char *reportID) +{ + OFCondition result = EC_IllegalCall; + if (reportID) + { + const char *srfile = getReportFilename(reportID); + if (srfile) + { + OFString filename = getReportFolder(); // never NULL. + filename += PATH_SEPARATOR; + filename += srfile; + result = loadStructuredReport(filename.c_str()); + if (result == EC_Normal) + { + if (pReport != NULL) + { + /* date/time is filled automatically if empty */ + pReport->setContentDate(""); + pReport->setContentTime(""); + /* generate new study/series/instance UID and fill date/time */ + pReport->createNewStudy(); + } + } else + DCMPSTAT_LOGFILE("Load structured reporting 'template' from file failed"); + } + } + return result; +} + + +OFCondition DVInterface::savePState(OFBool replaceSOPInstanceUID) +{ + // release database lock since we are using the DB module directly + releaseDatabase(); + + if (pState==NULL) return EC_IllegalCall; + const char *instanceUID = NULL; + if (replaceSOPInstanceUID) instanceUID=pState->createInstanceUID(); else instanceUID=pState->getInstanceUID(); + if (instanceUID==NULL) return EC_IllegalCall; + + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + OFCondition result=EC_Normal; + char imageFileName[MAXPATHLEN+1]; + + DcmQueryRetrieveIndexDatabaseHandle dbhandle(getDatabaseFolder(), PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.bad()) + { + DCMPSTAT_LOGFILE("Save presentation state to database failed: could not lock index file"); + return EC_IllegalCall; + } + + if (dbhandle.makeNewStoreFileName(UID_GrayscaleSoftcopyPresentationStateStorage, instanceUID, imageFileName, sizeof(imageFileName)).good()) + { + // now store presentation state as filename + result = savePState(imageFileName, OFFalse); + if (EC_Normal==result) + { + if (dbhandle.storeRequest(UID_GrayscaleSoftcopyPresentationStateStorage, + instanceUID, imageFileName, &dbStatus).bad()) + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Save presentation state to database failed: could not register in index file"); + DCMPSTAT_WARN("Unable to register presentation state '" << imageFileName << "' in database"); + } + } + } + if (pDicomImage != NULL) + { + DcmDataset *dset = pDicomImage->getDataset(); + if (dset != NULL) + { + DIC_UI sopClass; + DIC_UI instanceUID2; + DIC_UI seriesUID; + DIC_UI studyUID; + if (DU_getStringDOElement(dset, DCM_SOPClassUID, sopClass, sizeof(sopClass)) && + DU_getStringDOElement(dset, DCM_SOPInstanceUID, instanceUID2, sizeof(instanceUID2)) && + DU_getStringDOElement(dset, DCM_SeriesInstanceUID, seriesUID, sizeof(seriesUID)) && + DU_getStringDOElement(dset, DCM_StudyInstanceUID, studyUID, sizeof(studyUID)) && + ((!imageInDatabase) || (getSeriesStruct(studyUID, seriesUID, instanceUID2) == NULL))) + { + releaseDatabase(); /* avoid deadlocks */ + if (dbhandle.makeNewStoreFileName(sopClass, instanceUID2, imageFileName, sizeof(imageFileName)).good()) + { + // now store presentation state as filename + result = saveCurrentImage(imageFileName); + if (EC_Normal==result) + { + if (dbhandle.storeRequest(sopClass, instanceUID2, imageFileName, &dbStatus).bad()) + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Save presentation state to database failed: could not register image in index file"); + DCMPSTAT_WARN("Unable to register image '" << imageFileName << "' in database"); + } else { + imageInDatabase = OFTrue; + } + } + } + } + } + } + return result; +} + + +OFCondition DVInterface::savePState(const char *filename, OFBool replaceSOPInstanceUID, OFBool explicitVR) +{ + if (pState==NULL) return EC_IllegalCall; + if (filename==NULL) return EC_IllegalCall; + + OFCondition status = EC_IllegalCall; + DcmFileFormat *fileformat = new DcmFileFormat(); + DcmDataset *dataset = NULL; + if (fileformat) dataset=fileformat->getDataset(); + + if (dataset) + { + if ((status = pState->write(*dataset, replaceSOPInstanceUID)) == EC_Normal) + { + status = DVPSHelper::saveFileFormat(filename, fileformat, explicitVR); + + // replace the stored data for resetPresentationState() + delete pDicomPState; + pDicomPState = fileformat; + fileformat = NULL; // make sure we don't delete fileformat later + if (pSignatureHandler) + { + pSignatureHandler->updateDigitalSignatureInformation(*pDicomPState->getDataset(), DVPSS_presentationState, OFFalse); + } + } + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Save presentation state to file failed: could not write fileformat"); + } else { + DCMPSTAT_LOGFILE("Save presentation state to file failed: memory exhausted"); + status = EC_MemoryExhausted; + } + + delete fileformat; + return status; +} + + +OFCondition DVInterface::saveCurrentImage(const char *filename, OFBool explicitVR) +{ + if (filename==NULL) return EC_IllegalCall; + if (pDicomImage==NULL) return EC_IllegalCall; + OFCondition result = DVPSHelper::saveFileFormat(filename, pDicomImage, explicitVR); + if (result != EC_Normal) + DCMPSTAT_LOGFILE("Save image to file failed: could not write fileformat"); + return result; +} + + +OFCondition DVInterface::saveStructuredReport() +{ + // release database lock since we are using the DB module directly + releaseDatabase(); + + if (pReport == NULL) + return EC_IllegalCall; + OFString sopClassUID; + if (pReport->getSOPClassUID(sopClassUID).bad() || sopClassUID.empty()) + return EC_IllegalCall; + OFString instanceUID; + if (pReport->getSOPInstanceUID(instanceUID).bad() || instanceUID.empty()) + return EC_IllegalCall; + + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + char filename[MAXPATHLEN + 1]; + OFCondition result = EC_Normal; + + DcmQueryRetrieveIndexDatabaseHandle dbhandle(getDatabaseFolder(), PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.bad()) + { + DCMPSTAT_LOGFILE("Save structured report to database failed: could not lock index file"); + return EC_IllegalCall; + } + + if (dbhandle.makeNewStoreFileName(sopClassUID.c_str(), instanceUID.c_str(), filename, sizeof(filename)).good()) + { + // now store presentation state as filename + result = saveStructuredReport(filename); + if (EC_Normal == result) + { + if (dbhandle.storeRequest(sopClassUID.c_str(), instanceUID.c_str(), filename, &dbStatus).bad()) + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Save structured report to database failed: could not register in index file"); + DCMPSTAT_WARN("Unable to register structured report '" << filename << "' in database"); + } + } + } + return result; +} + + +OFCondition DVInterface::saveStructuredReport(const char *filename, OFBool explicitVR) +{ + if (pReport==NULL) return EC_IllegalCall; + if (filename==NULL) return EC_IllegalCall; + + OFCondition status = EC_IllegalCall; + DcmFileFormat *fileformat = new DcmFileFormat(); + DcmDataset *dataset = NULL; + if (fileformat) dataset=fileformat->getDataset(); + + if (dataset) + { + /* always add information about private OFFIS DCMTK Coding Scheme */ + pReport->getCodingSchemeIdentification().addPrivateDcmtkCodingScheme(); + if ((status = pReport->write(*dataset)) == EC_Normal) + { + status = DVPSHelper::saveFileFormat(filename, fileformat, explicitVR); + if (pSignatureHandler) + { + pSignatureHandler->updateDigitalSignatureInformation(*dataset, DVPSS_structuredReport, OFFalse); + } + } + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Save structured report to file failed: could not write fileformat"); + } else { + DCMPSTAT_LOGFILE("Save structured report to file failed: memory exhausted"); + status = EC_MemoryExhausted; + } + + delete fileformat; + return status; +} + + +OFCondition DVInterface::addImageReferenceToPState(const char *studyUID, const char *seriesUID, const char *instanceUID) +{ + OFCondition status = EC_IllegalCall; + if (pState && studyUID && seriesUID && instanceUID) + { + OFString study = pState->getStudyUID(); + if (study == studyUID) + { + if (lockDatabase() == EC_Normal) + { + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + { + DcmFileFormat *image = NULL; + if ((status = DVPSHelper::loadFileFormat(filename, image)) == EC_Normal) + { + status = EC_CorruptedData; + if (image) + { + DcmDataset *dataset = image->getDataset(); + if (dataset) + status = pState->addImageReference(*dataset); + } + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Add image reference to presentation state failed: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Add image reference to presentation state failed: could not read fileformat"); + delete image; + } else + DCMPSTAT_LOGFILE("Add image reference to presentation state failed: UIDs not in index file"); + } else + DCMPSTAT_LOGFILE("Add image reference to presentation state failed: could not lock index file"); + } else + DCMPSTAT_LOGFILE("Add image reference to presentation state failed: not the same study UID"); + } else + DCMPSTAT_LOGFILE("Add image reference to presentation state failed: invalid UIDs"); + return status; +} + + +size_t DVInterface::getNumberOfImageReferences() +{ + if (pState != NULL) + return pState->numberOfImageReferences(); + return 0; +} + + +OFCondition DVInterface::exchangeImageAndPState(DVPresentationState *newState, DcmFileFormat *image, DcmFileFormat *state) +{ + if (newState==NULL) return EC_IllegalCall; + if (image==NULL) return EC_IllegalCall; + if (pState != newState) + { + delete pState; + delete pStoredPState; + delete pDicomPState; + pState = newState; + pStoredPState = NULL; + pDicomPState = state; + if (pSignatureHandler) + { + if (pDicomPState) pSignatureHandler->updateDigitalSignatureInformation(*pDicomPState->getDataset(), DVPSS_presentationState, OFTrue); + else pSignatureHandler->disableDigitalSignatureInformation(DVPSS_presentationState); + } + } + if (pDicomImage != image) + { + delete pDicomImage; // delete only if different + pDicomImage = image; + if (pSignatureHandler) + { + pSignatureHandler->updateDigitalSignatureInformation(*pDicomImage->getDataset(), DVPSS_image, OFTrue); + } + } + return EC_Normal; +} + + +OFCondition DVInterface::resetPresentationState() +{ + DVPresentationState *newState = new DVPresentationState(displayFunction, + minimumPrintBitmapWidth, minimumPrintBitmapHeight, maximumPrintBitmapWidth, maximumPrintBitmapHeight, + maximumPreviewImageWidth, maximumPreviewImageHeight); + if (newState==NULL) return EC_MemoryExhausted; + + OFCondition status = EC_Normal; + if ((pDicomImage)&&(pDicomPState)) + { + // both image and presentation state are present + DcmDataset *dataset = pDicomPState->getDataset(); + if (dataset) + { + if (EC_Normal == (status = newState->read(*dataset))) status = newState->attachImage(pDicomImage, OFFalse); + if (EC_Normal == status) + { + if (pState) delete pState; + if (pStoredPState) delete pStoredPState; + pState = newState; + pStoredPState = NULL; // return to original pstate + } + } else status = EC_IllegalCall; + } + else if (pDicomImage) + { + // only image is present + DcmDataset *dataset = pDicomImage->getDataset(); + if (dataset) + { + if (EC_Normal == (status = newState->createFromImage(*dataset))) status = newState->attachImage(pDicomImage, OFFalse); + if (EC_Normal == status) + { + if (pState) delete pState; + if (pStoredPState) delete pStoredPState; + pState = newState; + pStoredPState = NULL; + } + } else status = EC_IllegalCall; + } + if (EC_Normal != status) delete newState; + return status; +} + + +OFCondition DVInterface::saveCurrentPStateForReset() +{ + OFCondition status = EC_IllegalCall; + if (pState != NULL) + { + DcmFileFormat *fileformat = new DcmFileFormat(); + if (fileformat != NULL) + { + DcmDataset *dataset = fileformat->getDataset(); + if (dataset) + { + status = pState->write(*dataset, OFFalse); // write current state to 'reset' dataset + if (status == EC_Normal) + { + delete pDicomPState; + pDicomPState = fileformat; + fileformat = NULL; // avoid deletion of pDicomPState a few lines later + } + } else status = EC_MemoryExhausted; + } else status = EC_MemoryExhausted; + delete fileformat; + } + return status; +} + + +Uint32 DVInterface::getNumberOfPStates() +{ + if (createPStateCache()) + { + DVInstanceCache::ItemStruct *instance = getInstanceStruct(); + if ((instance != NULL) && ((instance->Type == DVPSI_image) || (instance->Type == DVPSI_hardcopyGrayscale))) + return OFstatic_cast(Uint32, instance->List.size()); + } + return 0; +} + + +OFCondition DVInterface::selectPState(Uint32 idx, OFBool changeStatus) +{ + if (createPStateCache()) + { + DVInstanceCache::ItemStruct *instance = getInstanceStruct(); + if ((instance != NULL) && ((instance->Type == DVPSI_image) || (instance->Type == DVPSI_hardcopyGrayscale))) + { + OFListIterator(DVInstanceCache::ItemStruct *) iter = instance->List.begin(); + OFListIterator(DVInstanceCache::ItemStruct *) last = instance->List.end(); + while (iter != last) + { + if (idx == 0) + { + DVInstanceCache::ItemStruct *pstate = (*iter); + if (pstate != NULL) + { + OFCondition status = EC_IllegalCall; + if (pDicomImage == NULL) + status = loadPState(pstate->Filename.c_str(), instance->Filename.c_str()); + else + status = loadPState(pstate->Filename.c_str()); + if ((status == EC_Normal) && changeStatus) + instanceReviewed(pstate->Pos); + return status; + } + } + idx--; + ++iter; + } + } + } + return EC_IllegalCall; +} + + +const char *DVInterface::getPStateDescription(Uint32 idx) +{ + if (createPStateCache()) + { + DVInstanceCache::ItemStruct *instance = getInstanceStruct(); + if ((instance != NULL) && ((instance->Type == DVPSI_image) || (instance->Type == DVPSI_hardcopyGrayscale))) + { + OFListIterator(DVInstanceCache::ItemStruct *) iter = instance->List.begin(); + OFListIterator(DVInstanceCache::ItemStruct *) last = instance->List.end(); + while (iter != last) + { + if (idx == 0) + { + DVInstanceCache::ItemStruct *pstate = (*iter); + if (pstate != NULL) + return pstate->Description.c_str(); + } + idx--; + ++iter; + } + } + } + return NULL; +} + + +const char *DVInterface::getPStateLabel(Uint32 idx) +{ + if (createPStateCache()) + { + DVInstanceCache::ItemStruct *instance = getInstanceStruct(); + if ((instance != NULL) && ((instance->Type == DVPSI_image) || (instance->Type == DVPSI_hardcopyGrayscale))) + { + OFListIterator(DVInstanceCache::ItemStruct *) iter = instance->List.begin(); + OFListIterator(DVInstanceCache::ItemStruct *) last = instance->List.end(); + while (iter != last) + { + if (idx == 0) + { + DVInstanceCache::ItemStruct *pstate = (*iter); + if (pstate != NULL) + return pstate->Label.c_str(); + } + idx--; + ++iter; + } + } + } + return NULL; +} + + +OFCondition DVInterface::disablePState() +{ + OFCondition status = EC_IllegalCall; + if ((pState != NULL) && (pStoredPState == NULL)) + { + if (pDicomImage != NULL) + { + DcmDataset *dataset = pDicomImage->getDataset(); + if (dataset != NULL) + { + DVPresentationState *newState = new DVPresentationState(displayFunction, + minimumPrintBitmapWidth, minimumPrintBitmapHeight, maximumPrintBitmapWidth, maximumPrintBitmapHeight, + maximumPreviewImageWidth, maximumPreviewImageHeight); + if (newState != NULL) + { + if ((status = newState->createFromImage(*dataset)) == EC_Normal) + { + if ((status = newState->attachImage(pDicomImage, OFFalse)) == EC_Normal) + { + pStoredPState = pState; + pState = newState; + return EC_Normal; + } + } + delete newState; + } + } + } + } + return status; +} + + +OFCondition DVInterface::enablePState() +{ + if ((pState != NULL) && (pStoredPState != NULL)) + { + delete pState; + pState = pStoredPState; + pStoredPState = NULL; + return EC_Normal; + } + return EC_IllegalCall; +} + + +DVStudyCache::ItemStruct *DVInterface::getStudyStruct(const char *studyUID, + const char *seriesUID) +{ + if (createIndexCache()) + { + if (studyUID) + { + if (idxCache.isElem(studyUID)) + { + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if ((seriesUID == NULL) || (study->List.isElem(seriesUID))) + return study; + } + } else + return idxCache.getItem(); // current study + } + return NULL; +} + + +DVSeriesCache::ItemStruct *DVInterface::getSeriesStruct(const char *studyUID, + const char *seriesUID, + const char *instanceUID) +{ + if ((studyUID && seriesUID) || (!studyUID && !seriesUID)) + { + DVStudyCache::ItemStruct *study = getStudyStruct(studyUID, seriesUID); + if (study != NULL) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if ((instanceUID == NULL) || (series->List.isElem(instanceUID))) + return series; + } + } + } + return NULL; +} + + +DVInstanceCache::ItemStruct *DVInterface::getInstanceStruct(const char *studyUID, + const char *seriesUID, + const char *instanceUID) +{ + if ((studyUID && seriesUID && instanceUID) || (!studyUID && !seriesUID && !instanceUID)) + { + DVSeriesCache::ItemStruct *series = getSeriesStruct(studyUID, seriesUID, instanceUID); + if (series != NULL) + return series->List.getItem(); + } + return NULL; +} + + +const char *DVInterface::getFilename(const char *studyUID, + const char *seriesUID, + const char *instanceUID) +{ + DVSeriesCache::ItemStruct *series = getSeriesStruct(studyUID, seriesUID, instanceUID); + if (series != NULL) + return series->List.getFilename(); + return NULL; +} + + +OFCondition DVInterface::lockDatabase() +{ + if (pHandle) return EC_Normal; // may be called multiple times + + OFCondition result; + pHandle = new DcmQueryRetrieveIndexDatabaseHandle(getDatabaseFolder(), PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.good()) + { + lockingMode = OFFalse; + if (pHandle->DB_lock(OFFalse).good()) + { + if (databaseIndexFile.empty()) + databaseIndexFile = pHandle->getIndexFilename(); + return EC_Normal; + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::lockExclusive() +{ + if (pHandle && lockingMode) return EC_Normal; + OFCondition result = EC_Normal; + if (pHandle == NULL) result = lockDatabase(); + if (result.good()) + { + // we now have a shared lock. + pHandle->DB_unlock(); + if (pHandle->DB_lock(OFTrue).good()) + lockingMode = OFTrue; + else + result = EC_IllegalCall; + } + return result; +} + + +OFCondition DVInterface::unlockExclusive() +{ + if (pHandle && lockingMode) + { + if (pHandle->DB_unlock().good()) + { + delete pHandle; + pHandle=NULL; + lockingMode=OFFalse; + clearIndexCache(); + return EC_Normal; + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::releaseDatabase() +{ + if (pHandle == NULL) return EC_Normal; + OFCondition cond = pHandle->DB_unlock(); + if (cond.good()) + { + delete pHandle; + pHandle = NULL; + clearIndexCache(); + } + return cond; +} + + +void DVInterface::resetDatabaseReferenceTime() +{ + // set index file modification time to "yesterday" to make sure + // we notice any change even if different processes have minor + // date/time differences (i.e. over NFS) +#ifdef HAVE_DECLARATION_STRUCT_UTIMBUF + struct utimbuf utime_buf; + utime_buf.actime = OFstatic_cast(time_t, referenceTime); + utime_buf.modtime = OFstatic_cast(time_t, referenceTime); + if (0 != utime(databaseIndexFile.c_str(), &utime_buf)) +#else + // some old platforms use the prototype int utime(char *file, time_t timep[]) + time_t utime_buf[2]; + utime_buf[0] = OFstatic_cast(time_t, referenceTime); + utime_buf[1] = OFstatic_cast(time_t, referenceTime); + if (0 != utime(OFconst_cast(char *, databaseIndexFile.c_str()), utime_buf)) +#endif + { + DCMPSTAT_WARN("Cannot set database index file modification time"); + } else { + struct stat stat_buf; + if (0 == stat(databaseIndexFile.c_str(), &stat_buf)) + { + referenceTime = OFstatic_cast(unsigned long, stat_buf.st_mtime); + } + } +} + + +OFBool DVInterface::newInstancesReceived() +{ + if (databaseIndexFile.empty()) + { + if (pHandle == NULL) + { + lockDatabase(); // derives databaseIndexFile + releaseDatabase(); + } + } + + if (!databaseIndexFile.empty()) + { + struct stat stat_buf; + if (0== stat(databaseIndexFile.c_str(), &stat_buf)) + { + if (OFstatic_cast(unsigned long, stat_buf.st_mtime) == referenceTime) return OFFalse; + } + + resetDatabaseReferenceTime(); + } + return OFTrue; // default +} + + +void DVInterface::clearIndexCache() +{ + idxCache.clear(); + clearIndexRecord(idxRec, idxRecPos); +} + + +OFBool DVInterface::createIndexCache() +{ + if (lockDatabase() == EC_Normal) + { + if (idxCache.empty()) + { + int counter = 0; + pHandle->DB_IdxInitLoop(&counter); + IdxRecord record; + while (pHandle->DB_IdxGetNext(&counter, &record).good()) + { + if (!idxCache.isElem(record.StudyInstanceUID)) + idxCache.addItem(record.StudyInstanceUID); + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study != NULL) + { + if (!study->List.isElem(record.SeriesInstanceUID)) + study->List.addItem(record.SeriesInstanceUID); + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if (!series->List.isElem(record.SOPInstanceUID)) + { + DVPSInstanceType type = DVPSI_image; + if (DSRTypes::sopClassUIDToDocumentType(record.SOPClassUID) != DSRTypes::DT_invalid) + type = DVPSI_structuredReport; + else if (strcmp(record.Modality, "PR") == 0) + type = DVPSI_presentationState; + else if (strcmp(record.Modality, "SR") == 0) + type = DVPSI_structuredReport; + else if (strcmp(record.Modality, "HC") == 0) + type =DVPSI_hardcopyGrayscale; + else if (strcmp(record.Modality, "STORED_PRINT") == 0) + type = DVPSI_storedPrint; + series->List.addItem(record.SOPInstanceUID, + counter, + OFstatic_cast(DVIFhierarchyStatus, record.hstat), + type, + record.ImageSize, + record.filename); + if (series->Type == DVPSI_image) + series->Type = type; // series contains only one type of instances + } + } + } + } + updateStatusCache(); + } + return OFTrue; + } + return OFFalse; +} + + +OFBool DVInterface::createPStateCache() +{ + DVStudyCache::ItemStruct *study = getStudyStruct(); + if (study != NULL) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + DVInstanceCache::ItemStruct *instance = series->List.getItem(); + if ((instance != NULL) && ((instance->Type == DVPSI_image) || (instance->Type == DVPSI_hardcopyGrayscale))) + { + if (!instance->Checked) // is current instance already checked? + { + if (instance->List.empty()) + { + OFString seriesUID = series->UID; + OFString instanceUID = instance->UID; + if (study->List.gotoFirst()) + { + do { /* for all series */ + if (study->List.getType() == DVPSI_presentationState) + { + series = study->List.getItem(); + if (series != NULL) + { + if (series->List.gotoFirst()) + { + do { /* for all instances */ + if (series->List.getType() == DVPSI_presentationState) + { + DcmFileFormat *pstate = NULL; + if ((DVPSHelper::loadFileFormat(series->List.getFilename(), pstate) == EC_Normal) && pstate) + { + DcmDataset *dataset = pstate->getDataset(); + DVPSReferencedSeries_PList plist; + if (dataset && (plist.read(*dataset) == EC_Normal) && plist.isValid()) + { + if (plist.findImageReference(seriesUID.c_str(), instanceUID.c_str())) + { + DVInstanceCache::ItemStruct *reference = series->List.getItem(); + if (reference != NULL) + { + DcmStack stack; + if (dataset->search(DCM_ContentDescription, stack, ESM_fromHere, OFFalse) == EC_Normal) + { + char *value = NULL; + if ((*OFstatic_cast(DcmLongString *, stack.top())).getString(value) == EC_Normal) + reference->Description = value; + } + stack.clear(); + if (dataset->search(DCM_ContentLabel, stack, ESM_fromHere, OFFalse) == EC_Normal) + { + char *value = NULL; + if ((*OFstatic_cast(DcmLongString *, stack.top())).getString(value) == EC_Normal) + reference->Label = value; + } + instance->List.push_back(reference); + } + } + } + } + delete pstate; + } + } while (series->List.gotoNext()); + } + series->List.reset(); // set iterator to old position + } + } + } while (study->List.gotoNext()); + } + study->List.reset(); // set iterator to old position + } + instance->Checked = OFTrue; // do not check twice + } + return OFTrue; + } + } + } + return OFFalse; +} + + +void DVInterface::clearIndexRecord(IdxRecord &record, + int &recpos) +{ + OFBitmanipTemplate::zeroMem(OFreinterpret_cast(Uint8 *, &record), sizeof(idxRec)); + recpos = -1; +} + + +OFBool DVInterface::readIndexRecord(const int pos, + IdxRecord &record, + int *oldpos) +{ + if (lockDatabase() == EC_Normal) + { + if ((oldpos != NULL) && (pos == *oldpos)) // record already read + return OFTrue; + if (pHandle->DB_IdxRead(pos, &record).good()) + { + if (oldpos != NULL) + *oldpos = pos; + return OFTrue; + } + } + return OFFalse; +} + + +void DVInterface::updateStatusCache() +{ + idxCache.updateStatus(); +} + + +Uint32 DVInterface::getNumberOfStudies() +{ + if (createIndexCache()) + return idxCache.getCount(); + return 0; +} + + +Uint32 DVInterface::getNumberOfSeries() +{ + DVStudyCache::ItemStruct *study = getStudyStruct(); + if (study != NULL) + return study->List.getCount(); + return 0; +} + + +Uint32 DVInterface::getNumberOfInstances() +{ + DVSeriesCache::ItemStruct *series = getSeriesStruct(); + if (series != NULL) + return series->List.getCount(); + return 0; +} + + +OFCondition DVInterface::selectStudy(Uint32 idx) +{ + if (createIndexCache()) + { + if (idxCache.gotoItem(idx)) + { + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study->List.gotoItem(0)) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if (series->List.gotoItem(0)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + return EC_Normal; + } + } + } + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::selectStudy(const char *studyUID) +{ + if (studyUID) + { + if (createIndexCache()) + { + if (idxCache.isElem(studyUID)) + { + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study->List.gotoItem(0)) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if (series->List.gotoItem(0)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + return EC_Normal; + } + } + } + } + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::selectSeries(Uint32 idx) +{ + DVStudyCache::ItemStruct *study = getStudyStruct(); + if (study != NULL) + { + if (study->List.gotoItem(idx)) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if (series->List.gotoItem(0)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + return EC_Normal; + } + } + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::selectSeries(const char *seriesUID) +{ + if (seriesUID) + { + DVStudyCache::ItemStruct *study = getStudyStruct(); + if (study != NULL) + { + if (study->List.isElem(seriesUID)) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if (series->List.gotoItem(0)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + return EC_Normal; + } + } + } + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::selectInstance(Uint32 idx) +{ + DVSeriesCache::ItemStruct *series = getSeriesStruct(); + if (series != NULL) + { + if (series->List.gotoItem(idx)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + return EC_Normal; + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::selectInstance(const char *instanceUID) +{ + if (instanceUID) + { + DVSeriesCache::ItemStruct *series = getSeriesStruct(); + if (series != NULL) + { + if (series->List.isElem(instanceUID)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + return EC_Normal; + } + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::selectInstance(const char *instanceUID, const char *sopClassUID) +{ + if (instanceUID) + { + if (createIndexCache() && idxCache.gotoFirst()) + { + DVStudyCache::ItemStruct *study = NULL; + DVSeriesCache::ItemStruct *series = NULL; + do { /* for all studies */ + study = idxCache.getItem(); + if ((study != NULL) && study->List.gotoFirst()) + { + do { /* for all series */ + series = study->List.getItem(); + if ((series != NULL) && series->List.isElem(instanceUID)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + { + if (sopClassUID == NULL) + return EC_Normal; + else if (strcmp(sopClassUID, idxRec.SOPClassUID) == 0) + return EC_Normal; + } + } + } while (study->List.gotoNext()); + } + } while (idxCache.gotoNext()); + } + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::selectInstance(const char *studyUID, const char *seriesUID, const char *instanceUID) +{ + if (studyUID && seriesUID && instanceUID) + { + if (createIndexCache()) + { + if (idxCache.isElem(studyUID)) + { + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study->List.isElem(seriesUID)) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if (series->List.isElem(instanceUID)) + { + if (readIndexRecord(series->List.getPos(), idxRec, &idxRecPos)) + return EC_Normal; + } + } + } + } + } + } + return EC_IllegalCall; +} + + +DVIFhierarchyStatus DVInterface::getStudyStatus() +{ + return idxCache.getStatus(); +} + + +DVIFhierarchyStatus DVInterface::getSeriesStatus() +{ + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study != NULL) + return study->List.getStatus(); + return DVIF_objectIsNew; +} + + +DVIFhierarchyStatus DVInterface::getInstanceStatus() +{ + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study != NULL) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + return series->List.getStatus(); + } + return DVIF_objectIsNew; +} + + +DVPSInstanceType DVInterface::getSeriesType() +{ + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study != NULL) + return study->List.getType(); + return DVPSI_image; +} + + +DVPSInstanceType DVInterface::getInstanceType() +{ + DVStudyCache::ItemStruct *study = idxCache.getItem(); + if (study != NULL) + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + return series->List.getType(); + } + return DVPSI_image; +} + + +const char *DVInterface::getStudyUID() +{ + return idxRec.StudyInstanceUID; +} + + +const char *DVInterface::getSeriesUID() +{ + return idxRec.SeriesInstanceUID; +} + + +const char *DVInterface::getSOPClassUID() +{ + return idxRec.SOPClassUID; +} + + +const char *DVInterface::getInstanceUID() +{ + return idxRec.SOPInstanceUID; +} + + +const char *DVInterface::getStudyDescription() +{ + return idxRec.StudyDescription; +} + + +const char *DVInterface::getStudyDate() +{ + return idxRec.StudyDate; +} + + +const char *DVInterface::getStudyTime() +{ + return idxRec.StudyTime; +} + + +const char *DVInterface::getReferringPhysiciansName() +{ + return idxRec.ReferringPhysicianName; +} + + +const char *DVInterface::getAccessionNumber() +{ + return idxRec.AccessionNumber; +} + + +const char *DVInterface::getNameOfPhysiciansReadingStudy() +{ + return idxRec.NameOfPhysiciansReadingStudy; +} + + +const char *DVInterface::getPatientName() +{ + return idxRec.PatientName; +} + + +const char *DVInterface::getPatientID() +{ + return idxRec.PatientID; +} + + +const char *DVInterface::getPatientBirthDate() +{ + return idxRec.PatientBirthDate; +} + + +const char *DVInterface::getPatientSex() +{ + return idxRec.PatientSex; +} + + +const char *DVInterface::getPatientBirthTime() +{ + return idxRec.PatientBirthTime; +} + + +const char *DVInterface::getOtherPatientNames() +{ + return idxRec.OtherPatientNames; +} + + +const char *DVInterface::getOtherPatientID() +{ + return idxRec.OtherPatientIDs; +} + + +const char *DVInterface::getEthnicGroup() +{ + return idxRec.EthnicGroup; +} + + +const char *DVInterface::getSeriesDescription() +{ + return idxRec.SeriesDescription; +} + + +const char *DVInterface::getSeriesNumber() +{ + return idxRec.SeriesNumber; +} + + +const char *DVInterface::getSeriesDate() +{ + return idxRec.SeriesDate; +} + + +const char *DVInterface::getSeriesTime() +{ + return idxRec.SeriesTime; +} + + +const char *DVInterface::getSeriesPerformingPhysiciansName() +{ + return idxRec.PerformingPhysicianName; +} + + +const char *DVInterface::getSeriesProtocolName() +{ + return idxRec.ProtocolName; +} + + +const char *DVInterface::getSeriesOperatorsName() +{ + return idxRec.OperatorsName; +} + + +const char *DVInterface::getModality() +{ + return idxRec.Modality; +} + + +const char *DVInterface::getImageNumber() +{ + return idxRec.ImageNumber; +} + + +const char *DVInterface::getFilename() +{ + return idxRec.filename; +} + + +const char *DVInterface::getInstanceDescription() +{ + return idxRec.InstanceDescription; +} + + +const char *DVInterface::getPresentationLabel() +{ + return idxRec.PresentationLabel; +} + + +OFCondition DVInterface::instanceReviewed(int pos) +{ + lockDatabase(); + OFBool wasNew = newInstancesReceived(); + if (pHandle == NULL) return EC_IllegalCall; + pHandle->DB_unlock(); + OFCondition result = pHandle->instanceReviewed(pos); + pHandle->DB_lock(OFFalse); + if (!wasNew) resetDatabaseReferenceTime(); + releaseDatabase(); + return result; +} + + +OFCondition DVInterface::instanceReviewed(const char *studyUID, + const char *seriesUID, + const char *instanceUID) +{ + OFCondition result = EC_IllegalCall; + DVInstanceCache::ItemStruct *instance = getInstanceStruct(studyUID, seriesUID, instanceUID); + if (instance != NULL) + { + if (instance->Status == DVIF_objectIsNotNew) + result = EC_Normal; + else + result = instanceReviewed(instance->Pos); + } + return result; +} + + +int DVInterface::findStudyIdx(StudyDescRecord *study, + const char *uid) +{ + if ((study != NULL) && (uid != NULL)) + { + int i = 0; + for (i = 0; i < PSTAT_MAXSTUDYCOUNT; i++) + { + if (strcmp(uid, study[i].StudyInstanceUID) == 0) + return i; + } + } + return -1; +} + + +int DVInterface::deleteImageFile(const char *filename) +{ + if ((filename != NULL) && (pHandle != NULL)) + { + const char *pos; + if (((pos = strrchr(filename, OFstatic_cast(int, PATH_SEPARATOR))) == NULL) || // check whether image file resides in index.dat directory + (strncmp(filename, pHandle->getStorageArea(), pos - filename) == 0)) + { +// DB_deleteImageFile((/*const */char *)filename); + if (unlink(filename) == 0) + return 1; // image file has been deleted + } + return 2; // image file has not been deleted + } + return 0; // given filename is invalid +} + + +OFCondition DVInterface::deleteStudy(const char *studyUID) +{ + DVStudyCache::ItemStruct *study = getStudyStruct(studyUID); + if (study != NULL) + { + OFCondition result = EC_IllegalCall; + OFBool wasNew = OFTrue; + if (lockExclusive() == EC_Normal) + { + wasNew = newInstancesReceived(); + if (study->List.gotoFirst()) + { + StudyDescRecord *study_desc = OFstatic_cast(StudyDescRecord *, malloc(SIZEOF_STUDYDESC)); + if (study_desc != NULL) + { + if (pHandle->DB_GetStudyDesc(study_desc).good()) + { + int idx = findStudyIdx(study_desc, studyUID); + if (idx >= 0) + { + do /* for all series */ + { + DVSeriesCache::ItemStruct *series = study->List.getItem(); + if (series != NULL) + { + if (series->List.gotoFirst()) + { + do /* for all instances */ + { + pHandle->DB_IdxRemove(series->List.getPos()); + deleteImageFile(series->List.getFilename()); + } while (series->List.gotoNext()); + } + } + } while (study->List.gotoNext()); + study_desc[idx].NumberofRegistratedImages = 0; + study_desc[idx].StudySize = 0; + pHandle->DB_StudyDescChange(study_desc); + } + } + free(study_desc); + } + } + } + unlockExclusive(); + if (!wasNew) + resetDatabaseReferenceTime(); + return result; + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::deleteSeries(const char *studyUID, + const char *seriesUID) +{ + DVSeriesCache::ItemStruct *series = getSeriesStruct(studyUID, seriesUID); + if (series != NULL) + { + OFCondition result = EC_IllegalCall; + OFBool wasNew = OFTrue; + if (lockExclusive() == EC_Normal) + { + wasNew = newInstancesReceived(); + if (series->List.gotoFirst()) + { + StudyDescRecord *study_desc = OFstatic_cast(StudyDescRecord *, malloc(SIZEOF_STUDYDESC)); + if (study_desc != NULL) + { + if (pHandle->DB_GetStudyDesc(study_desc).good()) + { + int idx = findStudyIdx(study_desc, studyUID); + if (idx >= 0) + { + do /* for all images */ + { + pHandle->DB_IdxRemove(series->List.getPos()); + if (study_desc[idx].NumberofRegistratedImages > 0) + { + study_desc[idx].NumberofRegistratedImages--; + study_desc[idx].StudySize -= series->List.getImageSize(); + } + deleteImageFile(series->List.getFilename()); + } while (series->List.gotoNext()); + pHandle->DB_StudyDescChange(study_desc); + } + } + free(study_desc); + } + } + } + unlockExclusive(); + if (!wasNew) + resetDatabaseReferenceTime(); + return result; + } + return EC_IllegalCall; +} + + + +OFCondition DVInterface::deleteInstance(const char *studyUID, + const char *seriesUID, + const char *instanceUID) +{ + DVSeriesCache::ItemStruct *series = getSeriesStruct(studyUID, seriesUID, instanceUID); + if (series != NULL) + { + OFCondition result = EC_IllegalCall; + OFBool wasNew = OFTrue; + if (lockExclusive() == EC_Normal) + { + wasNew = newInstancesReceived(); + pHandle->DB_IdxRemove(series->List.getPos()); + StudyDescRecord *study_desc = OFstatic_cast(StudyDescRecord *, malloc(SIZEOF_STUDYDESC)); + if (study_desc != NULL) + { + if (pHandle->DB_GetStudyDesc(study_desc).good()) + { + int i = 0; + for (i = 0; i < PSTAT_MAXSTUDYCOUNT; i++) + { + if (strcmp(studyUID, study_desc[i].StudyInstanceUID) != 0) + { + if (study_desc[i].NumberofRegistratedImages > 0) + { + study_desc[i].NumberofRegistratedImages--; + study_desc[i].StudySize -= series->List.getImageSize(); + pHandle->DB_StudyDescChange(study_desc); + } + break; + } + } + free(study_desc); + result = EC_Normal; + } + deleteImageFile(series->List.getFilename()); + } + } + unlockExclusive(); + if (!wasNew) + resetDatabaseReferenceTime(); + return result; + } + return EC_IllegalCall; +} + + +OFBool DVInterface::isDisplayTransformPossible(DVPSDisplayTransform transform) +{ + if (transform == DVPSD_none) + return OFFalse; + return (displayFunction[transform] != NULL); +} + + +OFCondition DVInterface::setAmbientLightValue(double value) +{ + OFCondition result = EC_IllegalCall; + for (int i = DVPSD_first; i < DVPSD_max; i++) + { + if ((displayFunction[i] != NULL) && (displayFunction[i]->setAmbientLightValue(value))) + result = EC_Normal; // at least one display function has been valid + } + return result; +} + + +OFCondition DVInterface::getAmbientLightValue(double &value) +{ + if (displayFunction[DVPSD_first] != NULL) + { + value = displayFunction[DVPSD_first]->getAmbientLightValue(); + return EC_Normal; + } + return EC_IllegalCall; +} + + +OFCondition DVInterface::sendIOD(const char * targetID, + const char * studyUID, + const char * seriesUID, + const char * instanceUID) +{ + if ((targetID==NULL)||(studyUID==NULL)) return EC_IllegalCall; + const char *sender_application = getSenderName(); + if (sender_application==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones + +#ifdef HAVE_FORK + // Unix version - call fork() and execl() + pid_t pid = fork(); + if (pid < 0) + { + // fork failed - return error code + return EC_IllegalCall; + } else if (pid > 0) + { + // we are the parent process + return EC_Normal; + } else { + // we are the child process + if (execl(sender_application, sender_application, configPath.c_str(), + targetID, studyUID, seriesUID, instanceUID, OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << sender_application << "'"); + } + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + // Windows version - call CreateProcess() + + // initialize startup info + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + if (seriesUID && instanceUID) sprintf(commandline, "%s %s %s %s %s %s", sender_application, configPath.c_str(), + targetID, studyUID, seriesUID, instanceUID); + else if (seriesUID) sprintf(commandline, "%s %s %s %s %s", sender_application, configPath.c_str(), targetID, + studyUID, seriesUID); + else sprintf(commandline, "%s %s %s %s", sender_application, configPath.c_str(), targetID, studyUID); +#ifdef DEBUG + if (CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { + return EC_Normal; + } else { + DCMPSTAT_ERROR("Unable to execute '" << sender_application << "'"); + } + +#endif + return EC_IllegalCall; +} + + +OFCondition DVInterface::startReceiver() +{ + const char *receiver_application = getReceiverName(); + if (receiver_application==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + OFCondition result = EC_Normal; + DCMPSTAT_LOGFILE("Starting network receiver processes ..."); + + Uint32 numberOfReceivers = getNumberOfTargets(DVPSE_receiver); + for (Uint32 i=0; i < numberOfReceivers; i++) + { + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones +#ifdef HAVE_FORK + // Unix version - call fork() and execl() + pid_t pid = fork(); + if (pid < 0) + { + // fork failed - set error code + result = EC_IllegalCall; + } else if (pid > 0) + { + // we are the parent process, continue loop + } else { + // we are the child process + if (execl(receiver_application, receiver_application, configPath.c_str(), getTargetID(i, DVPSE_receiver), OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << receiver_application << "'"); + } + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + // Windows version - call CreateProcess() + // initialize startup info + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + sprintf(commandline, "%s %s %s", receiver_application, configPath.c_str(), getTargetID(i, DVPSE_receiver)); +#ifdef DEBUG + if (CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { + // continue loop + } else { + DCMPSTAT_ERROR("Unable to execute '" << receiver_application << "'"); + result = EC_IllegalCall; + } +#endif + } + return result; +} + +OFCondition DVInterface::terminateReceiver() +{ + const char *receiver_application = getReceiverName(); + if (receiver_application==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + OFCondition result = EC_Normal; + DCMPSTAT_LOGFILE("Terminating network receiver processes ..."); + + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones +#ifdef HAVE_FORK + // Unix version - call fork() and execl() + pid_t pid = fork(); + if (pid < 0) + { + // fork failed - set error code + result = EC_IllegalCall; + } else if (pid > 0) + { + // we are the parent process, continue loop + } else { + // we are the child process + if (execl(receiver_application, receiver_application, configPath.c_str(), "--terminate", OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << receiver_application << "'"); + } + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + // Windows version - call CreateProcess() + // initialize startup info + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + sprintf(commandline, "%s %s %s", receiver_application, configPath.c_str(), "--terminate"); +#ifdef DEBUG + if (CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { + // continue loop + } else { + DCMPSTAT_ERROR("Unable to execute '" << receiver_application << "'"); + result = EC_IllegalCall; + } +#endif + return result; +} + + +OFCondition DVInterface::startQueryRetrieveServer() +{ + const char *server_application = getQueryRetrieveServerName(); + if (server_application==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + OFString config_filename = getQueryRetrieveServerName(); + config_filename += ".cfg"; + if (getQueryRetrieveAutoCreateConfigFile()) + createQueryRetrieveServerConfigFile(config_filename.c_str()); + + DCMPSTAT_LOGFILE("Starting query/retrieve server process ..."); + + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones + + Sint32 timeout = getQueryRetrieveTimeout(); + +#ifdef HAVE_FORK + // Unix version - call fork() and execl() + pid_t pid = fork(); + if (pid < 0) + { + // fork failed - return error code + return EC_IllegalCall; + } else if (pid > 0) + { + // we are the parent process + return EC_Normal; + } else { + // we are the child process + if (timeout > 0) + { + char str_timeout[20]; + sprintf(str_timeout, "%lu", OFstatic_cast(unsigned long, timeout)); + execl(server_application, server_application, "-c", config_filename.c_str(), "--allow-shutdown", + "--timeout", str_timeout, OFreinterpret_cast(char *, 0)); + } + else + { + execl(server_application, server_application, "-c", config_filename.c_str(), "--allow-shutdown", OFreinterpret_cast(char *, 0)); + } + + DCMPSTAT_ERROR("Unable to execute '" << server_application << "'"); + + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + // Windows version - call CreateProcess() + // initialize startup info + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + + if (timeout > 0) + { + sprintf(commandline, "%s -c %s --allow-shutdown --timeout %lu", + server_application, config_filename.c_str(), (unsigned long) timeout); + } + else + { + sprintf(commandline, "%s -c %s --allow-shutdown", server_application, config_filename.c_str()); + } + +#ifdef DEBUG + if (CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { + return EC_Normal; + } else { + DCMPSTAT_ERROR("Unable to execute '" << server_application << "'"); + } +#endif + return EC_IllegalCall; +} + +OFCondition DVInterface::terminateQueryRetrieveServer() +{ + if (getQueryRetrieveServerName()==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + OFStandard::initializeNetwork(); + + OFCondition result = EC_Normal; + T_ASC_Network *net=NULL; + T_ASC_Parameters *params=NULL; + DIC_NODENAME peerHost; + T_ASC_Association *assoc=NULL; + + DCMPSTAT_LOGFILE("Terminating query/retrieve server process ..."); + + OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, 30, &net); + if (cond.good()) + { + cond = ASC_createAssociationParameters(¶ms, DEFAULT_MAXPDU); + if (cond.good()) + { + ASC_setAPTitles(params, getNetworkAETitle(), getQueryRetrieveAETitle(), NULL); + sprintf(peerHost, "localhost:%d", OFstatic_cast(int, getQueryRetrievePort())); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), peerHost); + + const char* transferSyntaxes[] = { UID_LittleEndianImplicitTransferSyntax }; + cond = ASC_addPresentationContext(params, 1, UID_PrivateShutdownSOPClass, transferSyntaxes, 1); + if (cond.good()) + { + cond = ASC_requestAssociation(net, params, &assoc); + if (cond.good()) ASC_abortAssociation(assoc); // tear down association if necessary + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + } + } else result = EC_IllegalCall; + ASC_dropNetwork(&net); + } else result = EC_IllegalCall; + + OFStandard::shutdownNetwork(); + + return result; +} + +OFCondition DVInterface::createQueryRetrieveServerConfigFile(const char *filename) +{ + STD_NAMESPACE ofstream output(filename); + if (output) + { + DCMPSTAT_LOGFILE("Creating configuration file for query/retrieve server"); + output << "# ATTENTION: This file has been created automatically and will" << OFendl; + output << "# be re-created each time the query/retrieve server" << OFendl; + output << "# is started. To avoid that manual changes to this" << OFendl; + output << "# file are destroyed, the flag AutoCreateConfigFile" << OFendl; + output << "# in the configuration file '" << configPath << "' has to be" << OFendl; + output << "# switched off." << OFendl; + output << OFendl; + output << "NetworkType = \"tcp\"" << OFendl; + output << "NetworkTCPPort = " << getQueryRetrievePort() << OFendl; + output << "MaxPDUSize = " << getQueryRetrieveMaxPDU() << OFendl; + output << "MaxAssociations = " << getQueryRetrieveMaxAssociations() << OFendl; + output << "Display = \"no\"" << OFendl; + output << OFendl; + output << "HostTable BEGIN" << OFendl; + const char *aet = NULL; + const char *name = NULL; + const Uint32 count = getNumberOfTargets(); + for (Uint32 i = 0; i < count; i++) + { + const char *id = getTargetID(i); + if (id != NULL) + { + aet = getTargetAETitle(id); + name = getTargetHostname(id); + if ((aet != NULL) && (name != NULL)) + output << id << " = (" << aet << ", " << name << ", " << getTargetPort(id) << ")" << OFendl; + } + } + output << "HostTable END" << OFendl; + output << OFendl; + output << "AETable BEGIN" << OFendl; + output << getQueryRetrieveAETitle() << "\t" << getDatabaseFolder() << "\tR\t("; + output << PSTAT_MAXSTUDYCOUNT << ", " << PSTAT_STUDYSIZE / 1024 / 1024 << "mb)\tANY" << OFendl; + output << "AETable END" << OFendl; + return EC_Normal; + } + DCMPSTAT_LOGFILE("Could not create configuration file for query/retrieve server"); + return EC_IllegalCall; +} + +OFCondition DVInterface::saveDICOMImage( + const char *filename, + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio, + OFBool explicitVR, + const char *instanceUID) +{ + if ((width<1)||(width > 0xFFFF)) return EC_IllegalCall; + if ((height<1)||(height > 0xFFFF)) return EC_IllegalCall; + if (pixelData == NULL) return EC_IllegalCall; + if (filename == NULL) return EC_IllegalCall; + if (aspectRatio == 0.0) return EC_IllegalCall; + + Uint16 columns = OFstatic_cast(Uint16, width); + Uint16 rows = OFstatic_cast(Uint16, height); + OFCondition status = EC_Normal; + DcmFileFormat *fileformat = new DcmFileFormat(); + DcmDataset *dataset = NULL; + if (fileformat) dataset=fileformat->getDataset(); + char newuid[70]; + + if (dataset) + { + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PatientName); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PatientID); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PatientBirthDate); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PatientSex); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_StudyDate); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_StudyTime); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_ReferringPhysicianName); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_StudyID); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_AccessionNumber); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_SeriesNumber); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_InstanceNumber); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PatientOrientation); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_SOPClassUID, UID_SecondaryCaptureImageStorage); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_Modality, "OT"); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_ConversionType, "WSD"); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PhotometricInterpretation, "MONOCHROME2"); + dcmGenerateUniqueIdentifier(newuid); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_SOPInstanceUID, (instanceUID ? instanceUID : newuid)); + dcmGenerateUniqueIdentifier(newuid, SITE_SERIES_UID_ROOT); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_SeriesInstanceUID, newuid); + dcmGenerateUniqueIdentifier(newuid, SITE_STUDY_UID_ROOT); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_StudyInstanceUID, newuid); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_SamplesPerPixel, 1); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_Rows, rows); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_Columns, columns); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_BitsAllocated, 8); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_BitsStored, 8); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_HighBit, 7); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_PixelRepresentation, 0); + if ((EC_Normal==status)&&(aspectRatio != 1.0)) + { + sprintf(newuid, "%ld\\%ld", 1000L, OFstatic_cast(long, aspectRatio*1000.0)); + status = DVPSHelper::putStringValue(dataset, DCM_PixelAspectRatio, newuid); + } + DcmPolymorphOBOW *pxData = new DcmPolymorphOBOW(DCM_PixelData); + if (pxData) + { + status = pxData->putUint8Array(OFstatic_cast(Uint8 *, OFconst_cast(void *, pixelData)), OFstatic_cast(unsigned long, width*height)); + if (EC_Normal==status) status = dataset->insert(pxData, OFTrue /*replaceOld*/); else delete pxData; + } else status = EC_MemoryExhausted; + + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Save image to file failed: invalid data structures"); + + if (EC_Normal == status) + { + status = DVPSHelper::saveFileFormat(filename, fileformat, explicitVR); + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Save image to file failed: could not write fileformat"); + } + } else { + status = EC_MemoryExhausted; + DCMPSTAT_LOGFILE("Save image to file failed: memory exhausted"); + } + + delete fileformat; + return status; +} + + +OFCondition DVInterface::saveDICOMImage( + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio) +{ + // release database lock since we are using the DB module directly + releaseDatabase(); + + char uid[100]; + dcmGenerateUniqueIdentifier(uid); + + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + char imageFileName[MAXPATHLEN+1]; + + OFCondition result = EC_Normal; + DcmQueryRetrieveIndexDatabaseHandle handle(getDatabaseFolder(), PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.bad()) + { + DCMPSTAT_LOGFILE("Save image to database failed: could not lock index file"); + return result; + } + + if (handle.makeNewStoreFileName(UID_SecondaryCaptureImageStorage, uid, imageFileName, sizeof(imageFileName)).good()) + { + // now store presentation state as filename + result = saveDICOMImage(imageFileName, pixelData, width, height, aspectRatio, OFTrue, uid); + if (EC_Normal==result) + { + if (handle.storeRequest(UID_SecondaryCaptureImageStorage, uid, imageFileName, &dbStatus).bad()) + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Save image to database failed: could not register in index file"); + DCMPSTAT_WARN("Unable to register secondary capture image '" << imageFileName << "' in database"); + } + } + } + return result; +} + + +OFCondition DVInterface::saveHardcopyGrayscaleImage( + const char *filename, + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio, + OFBool explicitVR, + const char *instanceUID) +{ + if (pState == NULL) return EC_IllegalCall; + if (pPrint == NULL) return EC_IllegalCall; + + if ((width<1)||(width > 0xFFFF)) return EC_IllegalCall; + if ((height<1)||(height > 0xFFFF)) return EC_IllegalCall; + if (pixelData == NULL) return EC_IllegalCall; + if (filename == NULL) return EC_IllegalCall; + if (aspectRatio == 0.0) return EC_IllegalCall; + + Uint16 columns = OFstatic_cast(Uint16, width); + Uint16 rows = OFstatic_cast(Uint16, height); + OFCondition status = EC_Normal; + DcmFileFormat *fileformat = new DcmFileFormat(); + DcmDataset *dataset = NULL; + if (fileformat) dataset=fileformat->getDataset(); + char newuid[70]; + OFString aString; + OFString theInstanceUID; + + if (dataset) + { + // write patient module + if (EC_Normal==status) status = pState->writeHardcopyImageAttributes(*dataset); + // write general study and general series module + if (EC_Normal==status) status = pPrint->writeHardcopyImageAttributes(*dataset); + + // Hardcopy Equipment Module + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_RETIRED_HardcopyDeviceManufacturer, "OFFIS"); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_RETIRED_HardcopyDeviceSoftwareVersion, OFFIS_DTK_IMPLEMENTATION_VERSION_NAME); + + // General Image Module + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_InstanceNumber); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PatientOrientation); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_ImageType, "DERIVED\\SECONDARY"); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_DerivationDescription, "Hardcopy rendered using Presentation State"); + // source image sequence is written in pState->writeHardcopyImageAttributes(). + + // SOP Common Module + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_SOPClassUID, UID_RETIRED_HardcopyGrayscaleImageStorage); + dcmGenerateUniqueIdentifier(newuid); + theInstanceUID = (instanceUID ? instanceUID : newuid); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_SOPInstanceUID, theInstanceUID.c_str()); + DVPSHelper::currentDate(aString); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_InstanceCreationDate, aString.c_str()); + DVPSHelper::currentTime(aString); + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_InstanceCreationTime, aString.c_str()); + + // Hardcopy Grayscale Image Module + if (EC_Normal==status) status = DVPSHelper::putStringValue(dataset, DCM_PhotometricInterpretation, "MONOCHROME2"); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_SamplesPerPixel, 1); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_Rows, rows); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_Columns, columns); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_BitsAllocated, 16); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_BitsStored, 12); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_HighBit, 11); + if (EC_Normal==status) status = DVPSHelper::putUint16Value(dataset, DCM_PixelRepresentation, 0); + if ((EC_Normal==status)&&(aspectRatio != 1.0)) + { + sprintf(newuid, "%ld\\%ld", 1000L, OFstatic_cast(long, aspectRatio*1000.0)); + status = DVPSHelper::putStringValue(dataset, DCM_PixelAspectRatio, newuid); + } + + DcmPolymorphOBOW *pxData = new DcmPolymorphOBOW(DCM_PixelData); + if (pxData) + { + status = pxData->putUint16Array(OFstatic_cast(Uint16 *, OFconst_cast(void *, pixelData)), OFstatic_cast(unsigned long, width*height)); + if (EC_Normal==status) status = dataset->insert(pxData, OFTrue /*replaceOld*/); else delete pxData; + } else status = EC_MemoryExhausted; + + // add Presentation LUT to hardcopy file if present, making it a Standard Extended SOP Class + if ((EC_Normal==status)&&(pState->getPresentationLUT() == DVPSP_table)) + { + status = pState->writePresentationLUTforPrint(*dataset); + } + + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Save hardcopy grayscale image to file failed: invalid data structures"); + + // save image file + if (EC_Normal == status) + { + status = DVPSHelper::saveFileFormat(filename, fileformat, explicitVR); + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Save hardcopy grayscale image to file failed: could not write fileformat"); + } + } else { + status = EC_MemoryExhausted; + DCMPSTAT_LOGFILE("Save hardcopy grayscale image to file failed: memory exhausted"); + } + + if (EC_Normal == status) + { + OFString reqImageTmp; + const char *reqImageSize = NULL; + DVPSPresentationLUT *presLUT = pState->getPresentationLUTData(); + + if (EC_Normal == pState->getPrintBitmapRequestedImageSize(reqImageTmp)) reqImageSize = reqImageTmp.c_str(); + /* we don't pass the patient ID (available as pState->getPatientID()) here because then + * we could end up with multiple images being part of one study and one series, but having + * different patient IDs. This might confuse archives using the patient root query model. + */ + status = pPrint->addImageBox(getNetworkAETitle(), theInstanceUID.c_str(), reqImageSize, NULL, presLUT, pState->isMonochrome1Image()); + } + + delete fileformat; + return status; +} + + +OFCondition DVInterface::saveHardcopyGrayscaleImage( + const void *pixelData, + unsigned long width, + unsigned long height, + double aspectRatio) +{ + // release database lock since we are using the DB module directly + releaseDatabase(); + + char uid[100]; + dcmGenerateUniqueIdentifier(uid); + + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + char imageFileName[MAXPATHLEN+1]; + + OFCondition result=EC_Normal; + DcmQueryRetrieveIndexDatabaseHandle handle(getDatabaseFolder(), PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.bad()) + { + DCMPSTAT_LOGFILE("Save hardcopy grayscale image to database failed: could not lock index file"); + return result; + } + + if (handle.makeNewStoreFileName(UID_RETIRED_HardcopyGrayscaleImageStorage, uid, imageFileName, sizeof(imageFileName)).good()) + { + result = saveHardcopyGrayscaleImage(imageFileName, pixelData, width, height, aspectRatio, OFTrue, uid); + if (EC_Normal==result) + { + if (handle.storeRequest(UID_RETIRED_HardcopyGrayscaleImageStorage, uid, imageFileName, &dbStatus).bad()) + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Save hardcopy grayscale image to database failed: could not register in index file"); + DCMPSTAT_WARN("Unable to register hardcopy grayscale image '" << imageFileName << "' in database"); + } + } + } + return result; +} + + +OFCondition DVInterface::saveFileFormatToDB(DcmFileFormat &fileformat) +{ + // release database lock since we are using the DB module directly + releaseDatabase(); + + // get SOP class and instance UID from dataset + char *classUID = NULL; + char *instanceUID = NULL; + DcmStack stack; + DcmDataset *dset = fileformat.getDataset(); + if (dset) + { + if (EC_Normal == dset->search(DCM_SOPInstanceUID, stack, ESM_fromHere, OFFalse)) + { + OFstatic_cast(DcmElement *, stack.top())->getString(instanceUID); + } + stack.clear(); + if (EC_Normal == dset->search(DCM_SOPClassUID, stack, ESM_fromHere, OFFalse)) + { + OFstatic_cast(DcmElement *, stack.top())->getString(classUID); + } + } + if ((instanceUID==NULL)||(classUID==NULL)) return EC_IllegalCall; + + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + char imageFileName[MAXPATHLEN+1]; + + OFCondition result=EC_Normal; + DcmQueryRetrieveIndexDatabaseHandle handle(getDatabaseFolder(), PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.bad()) + { + DCMPSTAT_LOGFILE("Save fileformat to database failed: could not lock index file"); + return result; + } + + if (handle.makeNewStoreFileName(classUID, instanceUID, imageFileName, sizeof(imageFileName)).good()) + { + // save image file + result = DVPSHelper::saveFileFormat(imageFileName, &fileformat, OFTrue); + if (EC_Normal==result) + { + if (handle.storeRequest(classUID, instanceUID, imageFileName, &dbStatus).bad()) + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Save fileformat to database failed: could not register in index file"); + DCMPSTAT_WARN("Unable to register file '" << imageFileName << "' in database"); + } + } + } + return result; +} + + +OFCondition DVInterface::loadStoredPrint(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus) +{ + OFCondition status = EC_IllegalCall; + if (studyUID && seriesUID && instanceUID) + { + if (lockDatabase() == EC_Normal) + { + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + { + if ((status = loadStoredPrint(filename)) == EC_Normal) + { + if (changeStatus) + instanceReviewed(studyUID, seriesUID, instanceUID); + } + } else + DCMPSTAT_LOGFILE("Load stored print from database failed: UIDs not in index file"); + } else + DCMPSTAT_LOGFILE("Load stored print from database failed: could not lock index file"); + } else + DCMPSTAT_LOGFILE("Load stored print from database failed: invalid UIDs"); + return status; +} + + +OFCondition DVInterface::loadStoredPrint(const char *filename) +{ + OFCondition status = EC_IllegalCall; + DcmFileFormat *fileformat = NULL; + DVPSStoredPrint *print = new DVPSStoredPrint(getDefaultPrintIllumination(), getDefaultPrintReflection()); + if (print==NULL) + { + DCMPSTAT_LOGFILE("Load stored print from file failed: memory exhausted"); + return EC_MemoryExhausted; + } + + if ((status = DVPSHelper::loadFileFormat(filename, fileformat)) == EC_Normal) + { + if (fileformat) + { + DcmDataset *dataset = fileformat->getDataset(); + if (dataset) + { + if (EC_Normal == (status = print->read(*dataset))) + { + delete pPrint; + pPrint = print; + clearFilmSessionSettings(); + } + } else status = EC_CorruptedData; + delete fileformat; + } else status = EC_IllegalCall; + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Load stored print from file failed: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Load stored print from file failed: could not read fileformat"); + if (status != EC_Normal) + { + delete print; + } + return status; +} + + +OFCondition DVInterface::saveStoredPrint( + const char *filename, + OFBool writeRequestedImageSize, + OFBool explicitVR, + const char *instanceUID) +{ + if (pState == NULL) return EC_IllegalCall; + if (pPrint == NULL) return EC_IllegalCall; + if (filename == NULL) return EC_IllegalCall; + + OFCondition status = EC_Normal; + DcmFileFormat *fileformat = new DcmFileFormat(); + DcmDataset *dataset = NULL; + if (fileformat) + dataset = fileformat->getDataset(); + + char newuid[70]; + char buf[32]; + + /* set annotation if active */ + if (activateAnnotation) + { + OFString text; + OFString dummy; + if (prependDateTime) + { + OFDateTime::getCurrentDateTime().getISOFormattedDateTime(text, OFFalse /*showSeconds*/); + } + if (prependPrinterName) + { + text += currentPrinter; + text += " "; + } + if (prependLighting) + { + sprintf(buf, "%d/%d ", pPrint->getPrintIllumination(), pPrint->getPrintReflectedAmbientLight()); + text += buf; + } + text += annotationText; + if (text.size() >64) text.erase(64); // limit to max annotation length + + if (getTargetPrinterSupportsAnnotationBoxSOPClass(currentPrinter.c_str())) + { + const char *displayformat = getTargetPrinterAnnotationDisplayFormatID(currentPrinter.c_str(), dummy); + Uint16 position = getTargetPrinterAnnotationPosition(currentPrinter.c_str()); + pPrint->setSingleAnnotation(displayformat, text.c_str(), position); + } else pPrint->deleteAnnotations(); + if (getTargetPrinterSessionLabelAnnotation(currentPrinter.c_str())) + { + status = setPrinterFilmSessionLabel(text.c_str()); + } + } else { + pPrint->deleteAnnotations(); + } + + if (dataset) + { + if (instanceUID) status = pPrint->setInstanceUID(instanceUID); else + { + dcmGenerateUniqueIdentifier(newuid); + status = pPrint->setInstanceUID(newuid); + } + if (EC_Normal == status) status = pPrint->write(*dataset, writeRequestedImageSize, OFTrue, OFTrue, OFFalse); + + // save file + if (EC_Normal == status) status = DVPSHelper::saveFileFormat(filename, fileformat, explicitVR); + + if (status != EC_Normal) + DCMPSTAT_LOGFILE("Save stored print to file failed: could not write fileformat"); + } else { + DCMPSTAT_LOGFILE("Save stored print to file failed: memory exhausted"); + status = EC_MemoryExhausted; + } + + delete fileformat; + return status; +} + +OFCondition DVInterface::saveStoredPrint(OFBool writeRequestedImageSize) +{ + // release database lock since we are using the DB module directly + releaseDatabase(); + + char uid[100]; + dcmGenerateUniqueIdentifier(uid); + + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + char imageFileName[MAXPATHLEN+1]; + OFCondition result=EC_Normal; + DcmQueryRetrieveIndexDatabaseHandle handle(getDatabaseFolder(), PSTAT_MAXSTUDYCOUNT, PSTAT_STUDYSIZE, result); + if (result.bad()) + { + DCMPSTAT_LOGFILE("Save stored print to database failed: could not lock index file"); + return result; + } + + if (handle.makeNewStoreFileName(UID_RETIRED_StoredPrintStorage, uid, imageFileName, sizeof(imageFileName)).good()) + { + // now store stored print object as filename + result = saveStoredPrint(imageFileName, writeRequestedImageSize, OFTrue, uid); + if (EC_Normal==result) + { + if (handle.storeRequest(UID_RETIRED_StoredPrintStorage, uid, imageFileName, &dbStatus).bad()) + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Save stored print to database failed: could not register in index file"); + DCMPSTAT_WARN("Unable to register stored print object '" << imageFileName << "' in database"); + } + } + } + return result; +} + +size_t DVInterface::getNumberOfPrintPreviews() +{ + if (pPrint != NULL) + return pPrint->getNumberOfImages(); + return 0; +} + +OFCondition DVInterface::loadPrintPreview(size_t idx, OFBool printLUT, OFBool changeStatus) +{ + OFCondition status = EC_IllegalCall; + if ((pPrint != NULL) && (maximumPrintPreviewWidth > 0) && (maximumPrintPreviewHeight > 0)) + { + const char *studyUID; + const char *seriesUID; + const char *instanceUID; + if ((status = pPrint->getImageReference(idx, studyUID, seriesUID, instanceUID)) == EC_Normal) + { + status = EC_IllegalCall; + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + { + DicomImage *image = new DicomImage(filename); + if (image != NULL) + { + if (image->getStatus() == EIS_Normal) + { + unsigned long width = maximumPrintPreviewWidth; + unsigned long height = maximumPrintPreviewHeight; + /* consider aspect ratio of the image and the display */ + double ratio = image->getWidthHeightRatio(); + const double mpWidth = getMonitorPixelWidth(); + const double mpHeight = getMonitorPixelHeight(); + if ((mpWidth > 0) && (mpHeight > 0)) + ratio *= (mpWidth / mpHeight); + if (ratio == 0.0) + ratio = 1.0; + if (OFstatic_cast(double, image->getWidth()) / OFstatic_cast(double, width * ratio) < + OFstatic_cast(double, image->getHeight()) / OFstatic_cast(double, height)) + { + width = 0; + } else + height = 0; + image->setWidthHeightRatio(ratio); + pHardcopyImage = image->createScaledImage(width, height, 0 /*interpolate*/, 1 /*aspect ratio*/); + if (pHardcopyImage != NULL) + { + if (pHardcopyImage->getStatus() == EIS_Normal) + { + /* set display function for calibrated output */ + if (displayFunction[DVPSD_GSDF] != NULL) + pHardcopyImage->setDisplayFunction(displayFunction[DVPSD_GSDF]); + /* adapt polarity if necessary */ + const char *polarity = pPrint->getImagePolarity(idx); + if ((polarity != NULL) && (strcmp(polarity, "REVERSE") == 0)) + pHardcopyImage->setPolarity(EPP_Reverse); + /* set (print/display) presentation LUT */ + DVPSPresentationLUT *plut = pPrint->getPresentationLUT(); // first check whether there's a global one + if (plut == NULL) + plut = pPrint->getImagePresentationLUT(idx); // ... then check for an image box specific + if (plut != NULL) + { + pHardcopyImage->setHardcopyParameters(pPrint->getMinDensityValue(), pPrint->getMaxDensityValue(), + pPrint->getPrintReflectedAmbientLight(), pPrint->getPrintIllumination()); + plut->activate(pHardcopyImage, printLUT); + } + status = EC_Normal; + if (changeStatus) + instanceReviewed(studyUID, seriesUID, instanceUID); + } else + unloadPrintPreview(); + } else + DCMPSTAT_LOGFILE("Load hardcopy grayscale image for print preview failed: memory exhausted"); + } else + DCMPSTAT_LOGFILE("Load hardcopy grayscale image for print preview failed: could not read image"); + delete image; + } else + DCMPSTAT_LOGFILE("Load hardcopy grayscale image for print preview failed: memory exhausted"); + } else + DCMPSTAT_LOGFILE("Load hardcopy grayscale image for print preview failed: UIDs not in index file"); + } + } + return status; +} + +void DVInterface::unloadPrintPreview() +{ + delete pHardcopyImage; + pHardcopyImage = NULL; +} + +unsigned long DVInterface::getPrintPreviewSize() +{ + unsigned long result = 0; + unsigned long width; + unsigned long height; + if (getPrintPreviewWidthHeight(width, height) == EC_Normal) + result = width * height; + return result; +} + +void DVInterface::setMaxPrintPreviewWidthHeight(unsigned long width, unsigned long height) +{ + if ((width != maximumPrintPreviewWidth) || (height != maximumPrintPreviewHeight)) + { + unloadPrintPreview(); + maximumPrintPreviewWidth = width; + maximumPrintPreviewHeight = height; + } +} + +OFCondition DVInterface::getPrintPreviewWidthHeight(unsigned long &width, unsigned long &height) +{ + OFCondition result = EC_IllegalCall; + if (pHardcopyImage != NULL) + { + width = pHardcopyImage->getWidth(); + height = pHardcopyImage->getHeight(); + if ((width > 0) && (height > 0)) + result = EC_Normal; + } else { + width = 0; + height = 0; + } + return result; +} + +OFCondition DVInterface::getPrintPreviewBitmap(void *bitmap, unsigned long size) +{ + OFCondition status = EC_IllegalCall; + if ((pHardcopyImage != NULL) && (bitmap != NULL) && (size > 0)) + { + if (pHardcopyImage->getOutputData(bitmap, size, 8 /*bits*/)) + status = EC_Normal; + } + return status; +} + +OFCondition DVInterface::setCurrentPrinter(const char *targetID) +{ + if (targetID == NULL) return EC_IllegalCall; + if (getTargetHostname(targetID) == NULL) return EC_IllegalCall; // Printer seems to be unknown + activateAnnotation = getTargetPrinterSupportsAnnotation(targetID); + if (pPrint != NULL) + { + pPrint->setPrinterName(targetID); + pPrint->setDestination(getTargetAETitle(targetID)); + } + currentPrinter = targetID; + return EC_Normal; +} + +const char *DVInterface::getCurrentPrinter() +{ + return currentPrinter.c_str(); +} + +OFCondition DVInterface::setPrinterMediumType(const char *value) +{ + if (value) printerMediumType = value; else printerMediumType.clear(); + return EC_Normal; +} + +const char *DVInterface::getPrinterMediumType() +{ + return printerMediumType.c_str(); +} + +OFCondition DVInterface::setPrinterFilmDestination(const char *value) +{ + if (value) printerFilmDestination = value; else printerFilmDestination.clear(); + return EC_Normal; +} + +const char *DVInterface::getPrinterFilmDestination() +{ + return printerFilmDestination.c_str(); +} + +OFCondition DVInterface::setPrinterFilmSessionLabel(const char *value) +{ + if (value) printerFilmSessionLabel = value; else printerFilmSessionLabel.clear(); + return EC_Normal; +} + +const char *DVInterface::getPrinterFilmSessionLabel() +{ + return printerFilmSessionLabel.c_str(); +} + +OFCondition DVInterface::setPrinterPriority(const char *value) +{ + if (value) printerPriority = value; else printerPriority.clear(); + return EC_Normal; +} + +const char *DVInterface::getPrinterPriority() +{ + return printerPriority.c_str(); +} + +OFCondition DVInterface::setPrinterOwnerID(const char *value) +{ + if (value) printerOwnerID = value; else printerOwnerID.clear(); + return EC_Normal; +} + +const char *DVInterface::getPrinterOwnerID() +{ + return printerOwnerID.c_str(); +} + +OFCondition DVInterface::setPrinterNumberOfCopies(unsigned long value) +{ + printerNumberOfCopies = value; + return EC_Normal; +} + +unsigned long DVInterface::getPrinterNumberOfCopies() +{ + return printerNumberOfCopies; +} + +OFCondition DVInterface::selectDisplayPresentationLUT(const char *lutID) +{ + OFCondition result = EC_IllegalCall; + if (lutID && pState) + { + const char *lutfile = getLUTFilename(lutID); + if (lutfile) + { + OFString filename = getLUTFolder(); // never NULL. + filename += PATH_SEPARATOR; + filename += lutfile; + DcmFileFormat *fileformat = NULL; + if ((result = DVPSHelper::loadFileFormat(filename.c_str(), fileformat)) == EC_Normal) + { + if (fileformat) + { + DcmDataset *dataset = fileformat->getDataset(); + if (dataset) + result = pState->setPresentationLookupTable(*dataset); + else + result = EC_IllegalCall; + if (EC_Normal == result) + displayCurrentLUTID = lutID; + else + displayCurrentLUTID.clear(); + } else result = EC_IllegalCall; + if (result != EC_Normal) + DCMPSTAT_LOGFILE("Load display presentation LUT from file: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Load display presentation LUT from file: could not read fileformat"); + delete fileformat; + } else + DCMPSTAT_LOGFILE("Load display presentation LUT from file: not specified in config file"); + } + return result; +} + +const char *DVInterface::getDisplayPresentationLUTID() +{ + return displayCurrentLUTID.c_str(); +} + +OFCondition DVInterface::selectPrintPresentationLUT(const char *lutID) +{ + OFCondition result = EC_IllegalCall; + if (lutID && pPrint) + { + const char *lutfile = getLUTFilename(lutID); + if (lutfile) + { + OFString filename = getLUTFolder(); // never NULL. + filename += PATH_SEPARATOR; + filename += lutfile; + DcmFileFormat *fileformat = NULL; + if ((result = DVPSHelper::loadFileFormat(filename.c_str(), fileformat)) == EC_Normal) + { + if (fileformat) + { + DcmDataset *dataset = fileformat->getDataset(); + if (dataset) + result = pPrint->setPresentationLookupTable(*dataset); + else + result = EC_IllegalCall; + if (EC_Normal == result) + printCurrentLUTID = lutID; + else + printCurrentLUTID.clear(); + } else result = EC_IllegalCall; + if (result != EC_Normal) + DCMPSTAT_LOGFILE("Load print presentation LUT from file: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Load print presentation LUT from file: could not read fileformat"); + delete fileformat; + } else + DCMPSTAT_LOGFILE("Load print presentation LUT from file: not specified in config file"); + } + return result; +} + +const char *DVInterface::getPrintPresentationLUTID() +{ + return printCurrentLUTID.c_str(); +} + +OFCondition DVInterface::spoolPrintJob(OFBool deletePrintedImages) +{ + if (pPrint==NULL) return EC_IllegalCall; + if (currentPrinter.size()==0) return EC_IllegalCall; + + OFCondition result = saveStoredPrint(getTargetPrinterSupportsRequestedImageSize(currentPrinter.c_str())); + if (EC_Normal == result) + { + result = spoolStoredPrintFromDB(pPrint->getStudyInstanceUID(), pPrint->getSeriesInstanceUID(), pPrint->getSOPInstanceUID()); + } + if ((EC_Normal == result) && deletePrintedImages) result = pPrint->deleteSpooledImages(); + return result; +} + +OFCondition DVInterface::startPrintSpooler() +{ + const char *spooler_application = getSpoolerName(); + if (spooler_application==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + const char *printer = NULL; + unsigned long sleepingTime = getSpoolerSleep(); + if (sleepingTime==0) sleepingTime=1; // default + char sleepStr[20]; + sprintf(sleepStr, "%lu", sleepingTime); + OFBool detailedLog = getDetailedLog(); + + OFCondition result = EC_Normal; + DCMPSTAT_LOGFILE("Starting print spooler process ..."); + + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones + + Uint32 numberOfPrinters = getNumberOfTargets(DVPSE_printAny); + if (numberOfPrinters > 0) for (Uint32 i=0; i < numberOfPrinters; i++) + { + printer = getTargetID(i, DVPSE_printAny); + +#ifdef HAVE_FORK + // Unix version - call fork() and execl() + pid_t pid = fork(); + if (pid < 0) result = EC_IllegalCall; // fork failed - return error code + else if (pid==0) + { + // we are the child process + + if (detailedLog) + { + if (execl(spooler_application, spooler_application, "--verbose", "--dump", "--spool", printJobIdentifier.c_str(), + "--printer", printer, "--config", configPath.c_str(), "--sleep", sleepStr, OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << spooler_application << "'"); + } + } else { + if (execl(spooler_application, spooler_application, "--spool", printJobIdentifier.c_str(), + "--printer", printer, "--config", configPath.c_str(), "--sleep", sleepStr, OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << spooler_application << "'"); + } + } + + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + // Windows version - call CreateProcess() + // initialize startup info + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + if (detailedLog) + { + sprintf(commandline, "%s --verbose --dump --spool %s --printer %s --config %s --sleep %s", spooler_application, + printJobIdentifier.c_str(), printer, configPath.c_str(), sleepStr); + } else { + sprintf(commandline, "%s --spool %s --printer %s --config %s --sleep %s", spooler_application, + printJobIdentifier.c_str(), printer, configPath.c_str(), sleepStr); + } +#ifdef DEBUG + if (0 == CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (0 == CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { + DCMPSTAT_ERROR("Unable to execute '" << spooler_application << "'"); + result = EC_IllegalCall; + } +#endif + } + return result; +} + +OFCondition DVInterface::createPrintJobFilenames(const char *printer, OFString& tempname, OFString& jobname) +{ + tempname.clear(); + jobname.clear(); + if (printer==NULL) return EC_IllegalCall; + char buf[20]; + + sprintf(buf, "%04lu", printJobCounter++); + jobname = getSpoolFolder(); + jobname += PATH_SEPARATOR; + jobname += printJobIdentifier; + jobname += '_'; + jobname += printer; + jobname += '_'; + jobname += buf; + tempname = jobname; + jobname += PRINTJOB_SUFFIX; + tempname += PRINTJOB_TEMP_SUFFIX; + return EC_Normal; +} + +OFCondition DVInterface::terminatePrintSpooler() +{ + if (getSpoolerName()==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones + OFString spoolFilename; + OFString tempFilename; + const char *prt = NULL; + + DCMPSTAT_LOGFILE("Terminating print spooler process ..."); + + Uint32 numberOfPrinters = getNumberOfTargets(DVPSE_printAny); + if (numberOfPrinters > 0) for (Uint32 i=0; i < numberOfPrinters; i++) + { + prt = getTargetID(i, DVPSE_printAny); + if (EC_Normal != createPrintJobFilenames(prt, tempFilename, spoolFilename)) return EC_IllegalCall; + FILE *outf = fopen(tempFilename.c_str(),"wb"); + if (outf) + { + OFString timeString; + OFDateTime::getCurrentDateTime().getISOFormattedDateTime(timeString); + fprintf(outf,"#\n# print job created %s\n", timeString.c_str()); + fprintf(outf,"# target printer: [%s]\n#\n", (prt ? prt : "none")); + fprintf(outf,"terminate\n"); + fclose(outf); + if (0 != rename(tempFilename.c_str(), spoolFilename.c_str())) + { + DCMPSTAT_ERROR("Unable to activate spooler termination request '" << spoolFilename.c_str() << "'"); + return EC_IllegalCall; + } + } else { + DCMPSTAT_ERROR("Unable to create spooler termination request '" << tempFilename.c_str() << "'"); + return EC_IllegalCall; + } + } + return EC_Normal; +} + +OFCondition DVInterface::startPrintServer() +{ + const char *application = getPrintServerName(); + if (application==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + const char *printer = NULL; + OFBool detailedLog = getDetailedLog(); + + OFCondition result = EC_Normal; + DCMPSTAT_LOGFILE("Starting print server process ..."); + + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones + + Uint32 numberOfPrinters = getNumberOfTargets(DVPSE_printLocal); + if (numberOfPrinters > 0) for (Uint32 i=0; i < numberOfPrinters; i++) + { + printer = getTargetID(i, DVPSE_printLocal); + +#ifdef HAVE_FORK + // Unix version - call fork() and execl() + pid_t pid = fork(); + if (pid < 0) result = EC_IllegalCall; // fork failed - return error code + else if (pid==0) + { + // we are the child process + + if (detailedLog) + { + if (execl(application, application, "--logfile", "--verbose", "--dump", "--printer", printer, "--config", + configPath.c_str(), OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << application << "'"); + } + } else { + if (execl(application, application, "--logfile", "--printer", printer, "--config", configPath.c_str(), OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << application << "'"); + } + } + + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + // Windows version - call CreateProcess() + // initialize startup info + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + if (detailedLog) + { + sprintf(commandline, "%s --logfile --verbose --dump --printer %s --config %s", application, printer, configPath.c_str()); + } else { + sprintf(commandline, "%s --logfile --printer %s --config %s", application, printer, configPath.c_str()); + } +#ifdef DEBUG + if (0 == CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (0 == CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { + DCMPSTAT_ERROR("Unable to execute '" << application << "'"); + result = EC_IllegalCall; + } +#endif + } + return result; // result of last process only +} + +OFCondition DVInterface::terminatePrintServer() +{ + if (getPrintServerName()==NULL) return EC_IllegalCall; + if (configPath.empty()) return EC_IllegalCall; + + OFStandard::initializeNetwork(); + + OFCondition result = EC_Normal; + T_ASC_Network *net=NULL; + T_ASC_Parameters *params=NULL; + DIC_NODENAME peerHost; + T_ASC_Association *assoc=NULL; + const char *target = NULL; + OFBool useTLS = OFFalse; + + DCMPSTAT_LOGFILE("Terminating print server process ..."); + +#ifdef WITH_OPENSSL + /* TLS directory */ + const char *current = NULL; + const char *tlsFolder = getTLSFolder(); + if (tlsFolder==NULL) tlsFolder = "."; + + /* key file format */ + DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM; + if (! getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1; +#endif + + Uint32 numberOfPrinters = getNumberOfTargets(DVPSE_printLocal); + if (numberOfPrinters > 0) for (Uint32 i=0; i < numberOfPrinters; i++) + { + target = getTargetID(i, DVPSE_printLocal); + useTLS = getTargetUseTLS(target); + + OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, 30, &net); + if (cond.good()) + { + cond = ASC_createAssociationParameters(¶ms, DEFAULT_MAXPDU); + if (cond.good()) + { + if (useTLS) + { +#ifdef WITH_OPENSSL + /* certificate file */ + OFString tlsCertificateFile(tlsFolder); + tlsCertificateFile += PATH_SEPARATOR; + current = getTargetCertificate(target); + if (current) tlsCertificateFile += current; else tlsCertificateFile += "sitecert.pem"; + + /* private key file */ + OFString tlsPrivateKeyFile(tlsFolder); + tlsPrivateKeyFile += PATH_SEPARATOR; + current = getTargetPrivateKey(target); + if (current) tlsPrivateKeyFile += current; else tlsPrivateKeyFile += "sitekey.pem"; + + /* private key password */ + const char *tlsPrivateKeyPassword = getTargetPrivateKeyPassword(target); + + /* DH parameter file */ + OFString tlsDHParametersFile; + current = getTargetDiffieHellmanParameters(target); + if (current) + { + tlsDHParametersFile = tlsFolder; + tlsDHParametersFile += PATH_SEPARATOR; + tlsDHParametersFile += current; + } + + /* random seed file */ + OFString tlsRandomSeedFile(tlsFolder); + tlsRandomSeedFile += PATH_SEPARATOR; + current = getTargetRandomSeed(target); + if (current) tlsRandomSeedFile += current; else tlsRandomSeedFile += "siteseed.bin"; + + /* CA certificate directory */ + const char *tlsCACertificateFolder = getTLSCACertificateFolder(); + if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = "."; + + + DcmTLSTransportLayer *tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, tlsRandomSeedFile.c_str(), OFTrue); + if (tLayer) + { + if (tlsCACertificateFolder) tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat); + if (tlsDHParametersFile.size() > 0) tLayer->setTempDHParameters(tlsDHParametersFile.c_str()); + tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console + tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat); + tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat); + tLayer->setCertificateVerification(DCV_ignoreCertificate); + + // determine TLS profile + OFString profileName; + const char *profileNamePtr = getTargetTLSProfile(target); + if (profileNamePtr) profileName = profileNamePtr; + DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195; // default + if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND; + else if (profileName == "BCP195-EX") tlsProfile = TSP_Profile_BCP195_Extended; + else if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195; + else if (profileName == "AES") tlsProfile = TSP_Profile_AES; + else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic; + else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted; + + // set TLS profile + (void) tLayer->setTLSProfile(tlsProfile); + + // activate cipher suites + (void) tLayer->activateCipherSuites(); + + ASC_setTransportLayer(net, tLayer, 1); + } +#else + // we cannot shutdown a TLS process since we're compiled without OpenSSL support + cond = EC_IllegalCall; +#endif + } + + ASC_setAPTitles(params, getNetworkAETitle(), getTargetAETitle(target), NULL); + sprintf(peerHost, "%s:%d", getTargetHostname(target), OFstatic_cast(int, getTargetPort(target))); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), peerHost); + + if (cond.good()) cond = ASC_setTransportLayerType(params, useTLS); + + const char* transferSyntaxes[] = { UID_LittleEndianImplicitTransferSyntax }; + if (cond.good()) cond = ASC_addPresentationContext(params, 1, UID_PrivateShutdownSOPClass, transferSyntaxes, 1); + if (cond.good()) + { + cond = ASC_requestAssociation(net, params, &assoc); + if (cond.good()) ASC_abortAssociation(assoc); // tear down association if necessary + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + } + } else result = EC_IllegalCall; + ASC_dropNetwork(&net); + } else result = EC_IllegalCall; + } + + OFStandard::shutdownNetwork(); + + return result; // result of last process only +} + +OFCondition DVInterface::addToPrintHardcopyFromDB(const char *studyUID, const char *seriesUID, const char *instanceUID) +{ + OFCondition result = EC_IllegalCall; + + if (pPrint) + { + if (studyUID && seriesUID && instanceUID) + { + if (EC_Normal == (result = lockDatabase())) + { + DcmUniqueIdentifier sopclassuid(DCM_SOPClassUID); + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + { + DcmFileFormat *ff = NULL; + if ((result = DVPSHelper::loadFileFormat(filename, ff)) == EC_Normal) + { + if (ff) + { + DcmDataset *dataset = ff->getDataset(); + if (dataset) + { + DcmStack stack; + DVPSPresentationLUT presentationLUT; + if (EC_Normal != presentationLUT.read(*dataset, OFFalse)) presentationLUT.setType(DVPSP_identity); + result = dataset->search(sopclassuid.getTag(), stack, ESM_fromHere, OFFalse); + if (EC_Normal == result) + { + char *sopclass = NULL; + sopclassuid = *OFstatic_cast(DcmUniqueIdentifier *, stack.top()); + if (EC_Normal == sopclassuid.getString(sopclass)) + result = pPrint->addImageBox(getNetworkAETitle(), studyUID, seriesUID, + sopclass, instanceUID, NULL, NULL, &presentationLUT, OFFalse); + else + result = EC_IllegalCall; + } + } else result = EC_CorruptedData; + } else result = EC_IllegalCall; + if (result != EC_Normal) + DCMPSTAT_LOGFILE("Load hardcopy grayscale image from file failed: invalid data structures"); + } else + DCMPSTAT_LOGFILE("Load hardcopy grayscale image from file failed: could not read fileformat"); + if (ff) delete ff; + } else { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Load hardcopy grayscale image from database failed: UIDs not in index file"); + } + } else + DCMPSTAT_LOGFILE("Load hardcopy grayscale image from database failed: could not lock index file"); + } else + DCMPSTAT_LOGFILE("Load hardcopy grayscale image from database failed: invalid UIDs"); + } + + releaseDatabase(); + return result; +} + +OFCondition DVInterface::spoolStoredPrintFromDB(const char *studyUID, const char *seriesUID, const char *instanceUID) +{ + if ((studyUID==NULL)||(seriesUID==NULL)||(instanceUID==NULL)||configPath.empty()) return EC_IllegalCall; + OFString spoolFilename; + OFString tempFilename; + const char *prt = getCurrentPrinter(); + if (EC_Normal != createPrintJobFilenames(prt, tempFilename, spoolFilename)) return EC_IllegalCall; + + FILE *outf = fopen(tempFilename.c_str(),"wb"); + if (outf) + { + OFString timeString; + OFDateTime::getCurrentDateTime().getISOFormattedDateTime(timeString); + fprintf(outf, "#\n# print job created %s\n", timeString.c_str()); + fprintf(outf, "# target printer: [%s]\n#\n", (prt ? prt : "none")); + fprintf(outf, "study %s\nseries %s\ninstance %s\n", studyUID, seriesUID, instanceUID); + if (printerMediumType.size() >0) fprintf(outf,"mediumtype %s\n", printerMediumType.c_str()); + if (printerFilmDestination.size() >0) fprintf(outf,"destination %s\n", printerFilmDestination.c_str()); + if (printerFilmSessionLabel.size() >0) fprintf(outf,"label %s\n", printerFilmSessionLabel.c_str()); + if (printerPriority.size() >0) fprintf(outf,"priority %s\n", printerPriority.c_str()); + if (printerOwnerID.size() >0) fprintf(outf,"owner_id %s\n", printerOwnerID.c_str()); + if (printerNumberOfCopies >0) fprintf(outf,"copies %lu\n", printerNumberOfCopies); + + fclose(outf); + if (0 != rename(tempFilename.c_str(), spoolFilename.c_str())) + { + DCMPSTAT_ERROR("Unable to activate print job '" << spoolFilename.c_str() << "'"); + return EC_IllegalCall; + } + } else { + DCMPSTAT_ERROR("Unable to create print job '" << tempFilename.c_str() << "'"); + return EC_IllegalCall; + } + return EC_Normal; +} + +OFCondition DVInterface::printSCUcreateBasicFilmSession(DVPSPrintMessageHandler& printHandler, OFBool plutInSession) +{ + if (!pPrint) return EC_IllegalCall; + OFCondition result = EC_Normal; + DcmDataset dset; + DcmElement *delem = NULL; + char buf[20]; + + if ((EC_Normal==result)&&(printerMediumType.size() > 0)) + { + delem = new DcmCodeString(DCM_MediumType); + if (delem) result = delem->putString(printerMediumType.c_str()); else result=EC_IllegalCall; + if (EC_Normal==result) result = dset.insert(delem, OFTrue /*replaceOld*/); + } + + if ((EC_Normal==result)&&(printerFilmDestination.size() > 0)) + { + delem = new DcmCodeString(DCM_FilmDestination); + if (delem) result = delem->putString(printerFilmDestination.c_str()); else result=EC_IllegalCall; + if (EC_Normal==result) result = dset.insert(delem, OFTrue /*replaceOld*/); + } + + if ((EC_Normal==result)&&(printerFilmSessionLabel.size() > 0)) + { + delem = new DcmLongString(DCM_FilmSessionLabel); + if (delem) result = delem->putString(printerFilmSessionLabel.c_str()); else result=EC_IllegalCall; + if (EC_Normal==result) result = dset.insert(delem, OFTrue /*replaceOld*/); + } + + if ((EC_Normal==result)&&(printerPriority.size() > 0)) + { + delem = new DcmCodeString(DCM_PrintPriority); + if (delem) result = delem->putString(printerPriority.c_str()); else result=EC_IllegalCall; + if (EC_Normal==result) result = dset.insert(delem, OFTrue /*replaceOld*/); + } + + if ((EC_Normal==result)&&(printerOwnerID.size() > 0)) + { + delem = new DcmShortString(DCM_OwnerID); + if (delem) result = delem->putString(printerOwnerID.c_str()); else result=EC_IllegalCall; + if (EC_Normal==result) result = dset.insert(delem, OFTrue /*replaceOld*/); + } + + if ((EC_Normal==result)&&(printerNumberOfCopies > 0)) + { + sprintf(buf, "%lu", printerNumberOfCopies); + delem = new DcmIntegerString(DCM_NumberOfCopies); + if (delem) result = delem->putString(buf); else result=EC_IllegalCall; + if (EC_Normal==result) result = dset.insert(delem, OFTrue /*replaceOld*/); + } + + if (EC_Normal==result) result = pPrint->printSCUcreateBasicFilmSession(printHandler, dset, plutInSession); + return result; +} + +void DVInterface::clearFilmSessionSettings() +{ + printerMediumType.clear(); + printerFilmDestination.clear(); + printerFilmSessionLabel.clear(); + printerPriority.clear(); + printerOwnerID.clear(); + printerNumberOfCopies = 0; + return; +} + +void DVInterface::setAnnotationText(const char *value) +{ + if (value) annotationText=value; else annotationText.clear(); + return; +} + +OFCondition DVInterface::startExternalApplication(const char *application, const char *filename) +{ + if ((filename==NULL)||(application==NULL)) return EC_IllegalCall; + DVPSHelper::cleanChildren(); // clean up old child processes before creating new ones + +#ifdef HAVE_FORK + // Unix version - call fork() and execl() + pid_t pid = fork(); + if (pid < 0) return EC_IllegalCall; // fork failed - return error code + else if (pid > 0) return EC_Normal; // we are the parent process + else + { + // we are the child process + if (execl(application, application, filename, OFreinterpret_cast(char *, 0)) < 0) + { + DCMPSTAT_ERROR("Unable to execute '" << application << "'"); + } + // if execl succeeds, this part will not get executed. + // if execl fails, there is not much we can do except bailing out. + abort(); + } +#else + // Windows version - call CreateProcess() + + // initialize startup info + PROCESS_INFORMATION procinfo; + STARTUPINFO sinfo; + OFBitmanipTemplate::zeroMem((char *)&sinfo, sizeof(sinfo)); + sinfo.cb = sizeof(sinfo); + char commandline[4096]; + sprintf(commandline, "%s %s", application, filename); +#ifdef DEBUG + if (CreateProcess(NULL, commandline, NULL, NULL, 0, 0, NULL, NULL, &sinfo, &procinfo)) +#else + if (CreateProcess(NULL, commandline, NULL, NULL, 0, DETACHED_PROCESS, NULL, NULL, &sinfo, &procinfo)) +#endif + { + return EC_Normal; + } else { + DCMPSTAT_ERROR("Unable to execute '" << application << "'"); + } +#endif + return EC_IllegalCall; +} + +OFCondition DVInterface::dumpIOD(const char *filename) +{ + OFCondition result = startExternalApplication(getDumpToolName(), filename); + if (result != EC_Normal) + DCMPSTAT_LOGFILE("Dump IOD failed: could not start dump application"); + return result; +} + +OFCondition DVInterface::dumpIOD(const char *studyUID, const char *seriesUID, const char *instanceUID) +{ + OFCondition result = EC_IllegalCall; + if (studyUID && seriesUID && instanceUID) + { + if (EC_Normal == (result = lockDatabase())) + { + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + result = dumpIOD(filename); + else + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Dump IOD from database failed: could not lock index file"); + } + } else + DCMPSTAT_LOGFILE("Dump IOD from database failed: UIDs not in index file"); + } else + DCMPSTAT_LOGFILE("Dump IOD from database failed: invalid UIDs"); + return result; +} + +OFCondition DVInterface::checkIOD(const char *filename) +{ + OFCondition result = startExternalApplication(getCheckToolName(), filename); + if (result != EC_Normal) + DCMPSTAT_LOGFILE("Check IOD failed: could not start evaluator application"); + return result; +} + +OFCondition DVInterface::checkIOD(const char *studyUID, const char *seriesUID, const char *instanceUID) +{ + OFCondition result = EC_IllegalCall; + if (studyUID && seriesUID && instanceUID) + { + if (EC_Normal == (result = lockDatabase())) + { + const char *filename = getFilename(studyUID, seriesUID, instanceUID); + if (filename) + result = checkIOD(filename); + else + { + result = EC_IllegalCall; + DCMPSTAT_LOGFILE("Check IOD from database failed: could not lock index file"); + } + } else + DCMPSTAT_LOGFILE("Check IOD from database failed: UIDs not in index file"); + } else + DCMPSTAT_LOGFILE("Check IOD from database failed: invalid UIDs"); + return result; +} + +#ifdef WITH_OPENSSL + +/* buf : buffer to write password into + * size : length of buffer in bytes + * rwflag : nonzero if the password will be used as a new password, i.e. user should be asked to repeat the password + * userdata: arbitrary pointer that can be set with SSL_CTX_set_default_passwd_cb_userdata() + * returns : number of bytes written to password buffer, -1 upon error + */ +extern "C" int DVInterfacePasswordCallback(char *buf, int size, int rwflag, void *userdata); + +int DVInterfacePasswordCallback(char *buf, int size, int /* rwflag */, void *userdata) +{ + if (userdata == NULL) return -1; + OFString *password = OFstatic_cast(OFString *, userdata); + int passwordSize = OFstatic_cast(int, password->length()); + if (passwordSize > size) passwordSize = size; + strncpy(buf, password->c_str(), passwordSize); + return passwordSize; +} + +#endif + + +#ifdef WITH_OPENSSL +OFBool DVInterface::verifyUserPassword(const char *userID, const char *passwd) +#else +OFBool DVInterface::verifyUserPassword(const char * /*userID*/, const char * /*passwd*/) +#endif +{ + OFBool result = OFFalse; +#ifdef WITH_OPENSSL + OFString filename; + OFString privateKeyPasswd; + if (passwd) privateKeyPasswd = passwd; + OFBool isPEMFormat = getTLSPEMFormat(); + const char *userKey = getUserPrivateKey(userID); + if (userKey == NULL) + DCMPSTAT_LOGFILE("Cannot verify user password: unknown user or undefined private key file"); + else + { + const char *userDir = getUserCertificateFolder(); + if (userDir) + { + filename = userDir; + filename += PATH_SEPARATOR; + } + filename += userKey; + + /* attempt to load the private key with the given password*/ + EVP_PKEY *pkey = NULL; + BIO *in = BIO_new(BIO_s_file()); + if (in) + { + if (BIO_read_filename(in, filename.c_str()) > 0) + { + if (isPEMFormat) + { + pkey = PEM_read_bio_PrivateKey(in, NULL, DVInterfacePasswordCallback, &privateKeyPasswd); + if (pkey) result = OFTrue; + } else { + // ASN.1/DER encoded keys are never encrypted, thus no callback here. + pkey = d2i_PrivateKey_bio(in, NULL); + if (pkey) result = OFTrue; + } + } else + DCMPSTAT_LOGFILE("Cannot verify user password: private key file not found"); + BIO_free(in); + } + if (pkey) EVP_PKEY_free(pkey); + } +#else + DCMPSTAT_LOGFILE("Cannot verify user password: not compiled with OpenSSL support"); +#endif + return result; +} + +#ifdef WITH_OPENSSL +OFCondition DVInterface::verifyAndSignStructuredReport(const char *userID, const char *passwd, DVPSVerifyAndSignMode mode) +#else +OFCondition DVInterface::verifyAndSignStructuredReport(const char *userID, const char * /*passwd*/, DVPSVerifyAndSignMode mode) +#endif +{ + OFCondition result = EC_IllegalCall; + if ((pReport != NULL) && (userID != NULL)) + { + OFString userName(getUserDICOMName(userID)); + OFString userOrg(getUserOrganization(userID)); + OFString userCV, userCSD, userCSV, userCM; + DSRCodedEntryValue userCode(getUserCodeValue(userID, userCV), getUserCodingSchemeDesignator(userID, userCSD), + getUserCodingSchemeVersion(userID, userCSV), getUserCodeMeaning(userID, userCM)); + /* verify document */ + if (pReport->verifyDocument(userName, userCode, userOrg) == EC_Normal) + { + if ((mode == DVPSY_verifyAndSign) || (mode == DVPSY_verifyAndSign_finalize)) + { +#ifdef WITH_OPENSSL + if (pSignatureHandler) + { + DcmStack stack; + DcmItem dataset; + if (pReport->write(dataset, &stack) == EC_Normal) + { + DcmAttributeTag tagList(DcmTag(0, 0) /* irrelevant value */); + if (mode == DVPSY_verifyAndSign) + { + /* do not sign particular attributes */ + tagList.putTagVal(DCM_SOPInstanceUID, 0); + tagList.putTagVal(DCM_VerifyingObserverSequence, 1); + tagList.putTagVal(DCM_InstanceCreationDate, 2); + tagList.putTagVal(DCM_InstanceCreationTime, 3); + tagList.putTagVal(DCM_InstanceCreatorUID, 4); + } + else if (mode == DVPSY_verifyAndSign_finalize) + { + /* always sign the entire document */ + stack.clear(); + } + /* if no item is marked, sign entire dataset */ + if (stack.empty()) + stack.push(&dataset); + /* digitally sign document */ + if (pSignatureHandler->createSignature(dataset, stack, tagList, userID, passwd) == EC_Normal) + { + DSRDocument *newReport = new DSRDocument(); + if (newReport != NULL) + { + if (newReport->read(dataset, DSRTypes::RF_readDigitalSignatures) == EC_Normal) + { + /* replace report in memory */ + delete pReport; + pReport = newReport; + pSignatureHandler->updateDigitalSignatureInformation(dataset, DVPSS_structuredReport, OFFalse /* onRead? */); + if (mode == DVPSY_verifyAndSign_finalize) + result = pReport->finalizeDocument(); + else + result = EC_Normal; + } + } else + result = EC_MemoryExhausted; + } + } + } +#else + DCMPSTAT_LOGFILE("Cannot sign structured report: not compiled with OpenSSL support"); +#endif + } else + result= EC_Normal; + } + } + return result; +} + +const char *DVInterface::getCurrentSignatureValidationHTML(DVPSObjectType objtype) const +{ + return pSignatureHandler->getCurrentSignatureValidationHTML(objtype); +} + +const char *DVInterface::getCurrentSignatureValidationOverview() const +{ + return pSignatureHandler->getCurrentSignatureValidationOverview(); +} + +DVPSSignatureStatus DVInterface::getCurrentSignatureStatus(DVPSObjectType objtype) const +{ + return pSignatureHandler->getCurrentSignatureStatus(objtype); +} + +DVPSSignatureStatus DVInterface::getCombinedImagePStateSignatureStatus() const +{ + return pSignatureHandler->getCombinedImagePStateSignatureStatus(); +} + +unsigned long DVInterface::getNumberOfCorrectSignatures(DVPSObjectType objtype) const +{ + return pSignatureHandler->getNumberOfCorrectSignatures(objtype); +} + +unsigned long DVInterface::getNumberOfUntrustworthySignatures(DVPSObjectType objtype) const +{ + return pSignatureHandler->getNumberOfUntrustworthySignatures(objtype); +} + +unsigned long DVInterface::getNumberOfCorruptSignatures(DVPSObjectType objtype) const +{ + return pSignatureHandler->getNumberOfCorruptSignatures(objtype); +} + +void DVInterface::disableImageAndPState() +{ + pSignatureHandler->disableImageAndPState(); +} diff --git a/dcmpstat/libsrc/dvpsab.cc b/dcmpstat/libsrc/dvpsab.cc new file mode 100644 index 00000000..c00d4175 --- /dev/null +++ b/dcmpstat/libsrc/dvpsab.cc @@ -0,0 +1,160 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSAnnotationContent + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dvpsab.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + + +/* --------------- class DVPSAnnotationContent --------------- */ + +DVPSAnnotationContent::DVPSAnnotationContent() +: sOPInstanceUID(DCM_SOPInstanceUID) +, annotationPosition(DCM_AnnotationPosition) +, textString(DCM_TextString) +{ +} + +DVPSAnnotationContent::DVPSAnnotationContent(const DVPSAnnotationContent& copy) +: sOPInstanceUID(copy.sOPInstanceUID) +, annotationPosition(copy.annotationPosition) +, textString(copy.textString) +{ +} + +DVPSAnnotationContent::~DVPSAnnotationContent() +{ +} + +void DVPSAnnotationContent::clear() +{ + sOPInstanceUID.clear(); + annotationPosition.clear(); + textString.clear(); + return; +} + +OFCondition DVPSAnnotationContent::setContent( + const char *instanceuid, + const char *text, + Uint16 position) +{ + OFCondition result = EC_Normal; + if (instanceuid && text) + { + clear(); + result = sOPInstanceUID.putString(instanceuid); + if (EC_Normal == result) result = textString.putString(text); + if (EC_Normal == result) result = annotationPosition.putUint16(position,0); + } else result = EC_IllegalCall; + return result; +} + +OFCondition DVPSAnnotationContent::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, annotationPosition) + READ_FROM_DATASET(DcmLongString, EVR_LO, textString) + + /* Now perform basic sanity checks */ + + if (result==EC_Normal) + { + if ((sOPInstanceUID.getLength() == 0)||(sOPInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("SOPInstanceUID missing or incorrect in Stored Print Annotation"); + } + if ((annotationPosition.getLength() == 0)||(annotationPosition.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("AnnotationPosition missing or incorrect in Stored Print Annotation"); + } + if ((textString.getLength() == 0)||(textString.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("TextString missing or incorrect in Stored Print Annotation"); + } + } + + return result; +} + +OFCondition DVPSAnnotationContent::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + /* before writing anything, check that we are able to write a correct item */ + if (sOPInstanceUID.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Annotation: SOPInstanceUID empty"); + } + if (annotationPosition.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Annotation: AnnotationPosition empty"); + } + if (textString.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Annotation: TextString empty"); + } + + ADD_TO_DATASET(DcmUniqueIdentifier, sOPInstanceUID) + ADD_TO_DATASET(DcmUnsignedShort, annotationPosition) + ADD_TO_DATASET(DcmLongString, textString) + + return result; +} + +OFCondition DVPSAnnotationContent::prepareBasicAnnotationBox(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_TO_DATASET(DcmUnsignedShort, annotationPosition) + ADD_TO_DATASET(DcmLongString, textString) + return result; +} + +OFCondition DVPSAnnotationContent::setSOPInstanceUID(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + sOPInstanceUID.clear(); + return EC_Normal; + } + return sOPInstanceUID.putString(value); +} + +const char *DVPSAnnotationContent::getSOPInstanceUID() +{ + char *c = NULL; + if (EC_Normal == sOPInstanceUID.getString(c)) return c; else return NULL; +} diff --git a/dcmpstat/libsrc/dvpsabl.cc b/dcmpstat/libsrc/dvpsabl.cc new file mode 100644 index 00000000..62cc1d51 --- /dev/null +++ b/dcmpstat/libsrc/dvpsabl.cc @@ -0,0 +1,211 @@ +/* + * + * Copyright (C) 1999-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSAnnotationContent_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmpstat/dvpsabl.h" +#include "dcmtk/dcmpstat/dvpsab.h" /* for DVPSAnnotationContent */ +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ + +/* --------------- class DVPSAnnotationContent_PList --------------- */ + +DVPSAnnotationContent_PList::DVPSAnnotationContent_PList() +: list_() +{ +} + +DVPSAnnotationContent_PList::DVPSAnnotationContent_PList(const DVPSAnnotationContent_PList &arg) +: list_() +{ + OFListConstIterator(DVPSAnnotationContent *) first = arg.list_.begin(); + OFListConstIterator(DVPSAnnotationContent *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSAnnotationContent_PList::~DVPSAnnotationContent_PList() +{ + clear(); +} + +void DVPSAnnotationContent_PList::clear() +{ + OFListIterator(DVPSAnnotationContent *) first = list_.begin(); + OFListIterator(DVPSAnnotationContent *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSAnnotationContent_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSAnnotationContent *newAnnotation = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_RETIRED_AnnotationContentSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newAnnotation = new DVPSAnnotationContent(); + if (newAnnotation && ditem) + { + result = newAnnotation->read(*ditem); + list_.push_back(newAnnotation); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSAnnotationContent_PList::write(DcmItem &dset) +{ + if (size()==0) return EC_Normal; // don't write if sequence is empty + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_RETIRED_AnnotationContentSequence); + if (dseq) + { + OFListIterator(DVPSAnnotationContent *) first = list_.begin(); + OFListIterator(DVPSAnnotationContent *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + + +OFCondition DVPSAnnotationContent_PList::addAnnotationBox( + const char *instanceuid, + const char *text, + Uint16 position) +{ + OFCondition result = EC_Normal; + DVPSAnnotationContent *newAnnotation = new DVPSAnnotationContent(); + if (newAnnotation) + { + result = newAnnotation->setContent(instanceuid, text, position); + if (EC_Normal == result) list_.push_back(newAnnotation); else delete newAnnotation; + } else result = EC_MemoryExhausted; + return result; +} + + +OFCondition DVPSAnnotationContent_PList::deleteAnnotation(size_t idx) +{ + OFListIterator(DVPSAnnotationContent *) first = list_.begin(); + OFListIterator(DVPSAnnotationContent *) last = list_.end(); + while ((first != last)&&(idx--)) ++first; + if (first != last) + { + delete (*first); + list_.erase(first); + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPSAnnotationContent_PList::deleteMultipleAnnotations(size_t number) +{ + OFListIterator(DVPSAnnotationContent *) first = list_.begin(); + OFListIterator(DVPSAnnotationContent *) last = list_.end(); + while ((first != last)&&(number--)) + { + delete (*first); + first = list_.erase(first); + } + return EC_Normal; +} + +DVPSAnnotationContent *DVPSAnnotationContent_PList::getAnnotationBox(size_t idx) +{ + OFListIterator(DVPSAnnotationContent *) first = list_.begin(); + OFListIterator(DVPSAnnotationContent *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} + +OFCondition DVPSAnnotationContent_PList::setAnnotationSOPInstanceUID(size_t idx, const char *value) +{ + DVPSAnnotationContent *box = getAnnotationBox(idx); + if (box) return box->setSOPInstanceUID(value); + return EC_IllegalCall; +} + +const char *DVPSAnnotationContent_PList::getSOPInstanceUID(size_t idx) +{ + DVPSAnnotationContent *box = getAnnotationBox(idx); + if (box) return box->getSOPInstanceUID(); + return NULL; +} + +OFCondition DVPSAnnotationContent_PList::prepareBasicAnnotationBox(size_t idx, DcmItem &dset) +{ + DVPSAnnotationContent *box = getAnnotationBox(idx); + if (box) return box->prepareBasicAnnotationBox(dset); + return EC_IllegalCall; +} + +void DVPSAnnotationContent_PList::clearAnnotationSOPInstanceUIDs() +{ + OFListIterator(DVPSAnnotationContent *) first = list_.begin(); + OFListIterator(DVPSAnnotationContent *) last = list_.end(); + while (first != last) + { + (*first)->setSOPInstanceUID(NULL); + ++first; + } +} diff --git a/dcmpstat/libsrc/dvpsal.cc b/dcmpstat/libsrc/dvpsal.cc new file mode 100644 index 00000000..b5a276d3 --- /dev/null +++ b/dcmpstat/libsrc/dvpsal.cc @@ -0,0 +1,101 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlayCurveActivationLayer + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmpstat/dvpsal.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + + +/* --------------- class DVPSOverlayCurveActivationLayer --------------- */ + +DVPSOverlayCurveActivationLayer::DVPSOverlayCurveActivationLayer() +: repeatingGroup(0) +, activationLayer(DCM_OverlayActivationLayer) // default is Overlay not Curve +{ +} + +DVPSOverlayCurveActivationLayer::DVPSOverlayCurveActivationLayer(const DVPSOverlayCurveActivationLayer& copy) +: repeatingGroup(copy.repeatingGroup) +, activationLayer(copy.activationLayer) +{ +} + +DVPSOverlayCurveActivationLayer::~DVPSOverlayCurveActivationLayer() +{ +} + +OFCondition DVPSOverlayCurveActivationLayer::read(DcmItem &dset, Uint16 ovGroup) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + repeatingGroup = ovGroup; + activationLayer.setGTag(repeatingGroup); + READ_FROM_DATASET(DcmCodeString, EVR_CS, activationLayer) + + if (activationLayer.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a curve or overlay activation layer with VM > 1"); + } + + return result; +} + +OFCondition DVPSOverlayCurveActivationLayer::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_REPEATING_ELEMENT_TO_DATASET(DcmCodeString, activationLayer, repeatingGroup) + + return result; +} + +void DVPSOverlayCurveActivationLayer::setActivationLayer(const char *aLayer) +{ + if (aLayer) activationLayer.putString(aLayer); else activationLayer.clear(); + return; +} + +void DVPSOverlayCurveActivationLayer::setRepeatingGroup(Uint16 rGroup) +{ + repeatingGroup = rGroup; + return; +} + +const char *DVPSOverlayCurveActivationLayer::getActivationLayer() +{ + char *c = NULL; + if (EC_Normal == activationLayer.getString(c)) return c; else return NULL; +} + +Uint16 DVPSOverlayCurveActivationLayer::getRepeatingGroup() +{ + return repeatingGroup; +} + +OFBool DVPSOverlayCurveActivationLayer::isRepeatingGroup(Uint16 rGroup) +{ + if (rGroup==repeatingGroup) return OFTrue; else return OFFalse; +} diff --git a/dcmpstat/libsrc/dvpsall.cc b/dcmpstat/libsrc/dvpsall.cc new file mode 100644 index 00000000..826e025c --- /dev/null +++ b/dcmpstat/libsrc/dvpsall.cc @@ -0,0 +1,460 @@ +/* + * + * Copyright (C) 1998-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlayCurveActivationLayer_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstring.h" + +#include "dcmtk/dcmpstat/dvpsall.h" +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer */ +#include "dcmtk/dcmpstat/dvpsovl.h" /* for DVPSOverlay_PList */ +#include "dcmtk/dcmpstat/dvpsgll.h" /* for DVPSGraphicLayer_PList */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ + +DVPSOverlayCurveActivationLayer_PList::DVPSOverlayCurveActivationLayer_PList() +: list_() +{ +} + +DVPSOverlayCurveActivationLayer_PList::DVPSOverlayCurveActivationLayer_PList(const DVPSOverlayCurveActivationLayer_PList &arg) +: list_() +{ + OFListConstIterator(DVPSOverlayCurveActivationLayer *) first = arg.list_.begin(); + OFListConstIterator(DVPSOverlayCurveActivationLayer *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSOverlayCurveActivationLayer_PList::~DVPSOverlayCurveActivationLayer_PList() +{ + clear(); +} + +void DVPSOverlayCurveActivationLayer_PList::clear() +{ + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSOverlayCurveActivationLayer_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DcmTagKey key(DCM_RETIRED_CurveActivationLayer); + DVPSOverlayCurveActivationLayer *newLayer = NULL; + + Uint16 i = 0x5000; + while (i < 0x6020) + { + if (result==EC_Normal) + { + stack.clear(); + key.setGroup(i); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + newLayer = new DVPSOverlayCurveActivationLayer(); + if (newLayer) + { + result = newLayer->read(dset,i); + list_.push_back(newLayer); + } else result = EC_MemoryExhausted; + } + } + i += 2; + if (i == 0x5020) i = 0x6000; + } + return result; +} + + +OFCondition DVPSOverlayCurveActivationLayer_PList::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) result = (*first)->write(dset); + ++first; + } + return result; +} + +OFCondition DVPSOverlayCurveActivationLayer_PList::createFromImage( + DcmItem &dset, + DVPSGraphicLayer_PList &gLayerList, + DVPSOverlay_PList &overlayList, + DVPSoverlayActivation overlayActivation, + OFBool curveActivation, + DVPSGraphicLayering layering) +{ + OFCondition result = EC_Normal; + long currentLayer = 0; + long lastOverlayLayer = 0; + char layerName[100]; + char layerDesc[100]; + OFString aString; + Uint16 dimensions; + + OFBool found; + DcmStack stack; + DcmTagKey overlayRows(DCM_OverlayRows); + DcmTagKey overlayColumns(DCM_OverlayColumns); + DcmTagKey overlayType(DCM_OverlayType); + DcmTagKey overlayOrigin(DCM_OverlayOrigin); + DcmTagKey overlayBitsAllocated(DCM_OverlayBitsAllocated); + DcmTagKey overlayBitPosition(DCM_OverlayBitPosition); + + DcmTagKey curveDimensions(DCM_RETIRED_CurveDimensions); + DcmTagKey numberOfPoints(DCM_RETIRED_NumberOfPoints); + DcmTagKey typeOfData(DCM_RETIRED_TypeOfData); + DcmTagKey dataValueRepresentation(DCM_RETIRED_DataValueRepresentation); + DcmTagKey curveData(DCM_RETIRED_CurveData); + + OFBool haveOverlays = OFFalse; + /* first we handle overlays */ + if ((overlayActivation==DVPSO_referenceOverlays) || (overlayActivation==DVPSO_copyOverlays)) + { + for (Uint16 group = 0x6000; ((result==EC_Normal)&&(group < 0x6020)); group += 2) + { + found = OFFalse; + /* check if we have an internal overlay with this group */ + if (overlayList.haveOverlayGroup(group)) found=OFTrue; + + /* otherwise check if we have an external overlay with this group */ + if (!found) + { + overlayRows.setGroup(group); + overlayColumns.setGroup(group); + overlayType.setGroup(group); + overlayOrigin.setGroup(group); + overlayBitsAllocated.setGroup(group); + overlayBitPosition.setGroup(group); + stack.clear(); + if (EC_Normal == dset.search(overlayRows, stack, ESM_fromHere, OFFalse)) found = OFTrue; + stack.clear(); + if (EC_Normal != dset.search(overlayColumns, stack, ESM_fromHere, OFFalse)) found = OFFalse; + stack.clear(); + if (EC_Normal != dset.search(overlayType, stack, ESM_fromHere, OFFalse)) found = OFFalse; + stack.clear(); + if (EC_Normal != dset.search(overlayOrigin, stack, ESM_fromHere, OFFalse)) found = OFFalse; + stack.clear(); + if (EC_Normal != dset.search(overlayBitsAllocated, stack, ESM_fromHere, OFFalse)) found = OFFalse; + stack.clear(); + if (EC_Normal != dset.search(overlayBitPosition, stack, ESM_fromHere, OFFalse)) found = OFFalse; + } + + /* if found, create graphic layer if necessary. Create activation. */ + if (found) + { + switch (layering) + { + case DVPSG_oneLayer: + if (currentLayer==0) + { + currentLayer++; + sprintf(layerName, "LAYER"); + result = gLayerList.addGraphicLayer(layerName, 1, "Overlays and Curves"); + } + break; + case DVPSG_twoLayers: + if (currentLayer==0) + { + currentLayer++; + sprintf(layerName, "OVERLAY"); + result = gLayerList.addGraphicLayer(layerName, 1, "Overlays"); + } + break; + case DVPSG_separateLayers: + currentLayer++; + sprintf(layerName, "OVERLAY%04ld", (long)currentLayer); + sprintf(layerDesc, "Overlay Layer %ld", (long)currentLayer); + result = gLayerList.addGraphicLayer(layerName, currentLayer, layerDesc); + break; + } + DVPSOverlayCurveActivationLayer *newLayer = new DVPSOverlayCurveActivationLayer(); + if (newLayer) + { + newLayer->setActivationLayer(layerName); + newLayer->setRepeatingGroup(group); + list_.push_back(newLayer); + haveOverlays = OFTrue; + } else result = EC_MemoryExhausted; + } + } + } + + lastOverlayLayer = currentLayer; + /* then we handle curves */ + if (curveActivation) + { + for (Uint16 group = 0x5000; ((result==EC_Normal)&&(group < 0x5020)); group += 2) + { + found = OFFalse; + + /* check if we have an external curve with this group */ + curveDimensions.setGroup(group); + numberOfPoints.setGroup(group); + typeOfData.setGroup(group); + dataValueRepresentation.setGroup(group); + curveData.setGroup(group); + stack.clear(); + if (EC_Normal == dset.search(curveDimensions, stack, ESM_fromHere, OFFalse)) found = OFTrue; + stack.clear(); + if (EC_Normal != dset.search(numberOfPoints, stack, ESM_fromHere, OFFalse)) found = OFFalse; + stack.clear(); + if (EC_Normal != dset.search(typeOfData, stack, ESM_fromHere, OFFalse)) found = OFFalse; + stack.clear(); + if (EC_Normal != dset.search(dataValueRepresentation, stack, ESM_fromHere, OFFalse)) found = OFFalse; + stack.clear(); + if (EC_Normal != dset.search(curveData, stack, ESM_fromHere, OFFalse)) found = OFFalse; + + /* if we have found a curve, make sure that this is a type of curve we can display */ + if (found) + { + /* read the curve dimensions and curve type from the dataset */ + DcmUnsignedShort curveDimensionsValue(DCM_RETIRED_CurveDimensions); + DcmCodeString typeOfDataValue(DCM_RETIRED_TypeOfData); + curveDimensionsValue.setGTag(group); + typeOfDataValue.setGTag(group); + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, curveDimensionsValue) + READ_FROM_DATASET(DcmCodeString, EVR_CS, typeOfDataValue) + + /* we can only display POLY and ROI curves */ + aString.clear(); + typeOfDataValue.getOFString(aString,0); + if ((aString != "POLY")&&(aString != "ROI")) found=OFFalse; + + /* we can only display 2D curves */ + dimensions=0; + curveDimensionsValue.getUint16(dimensions,0); + if (dimensions != 2) found=OFFalse; + } + + /* if found, create graphic layer if necessary. Create activation. */ + if (found) + { + switch (layering) + { + case DVPSG_oneLayer: + if (currentLayer==0) + { + currentLayer++; + sprintf(layerName, "LAYER"); + result = gLayerList.addGraphicLayer(layerName, 1, "Overlays and Curves"); + } + break; + case DVPSG_twoLayers: + if ((currentLayer==0)||((currentLayer==1)&&(haveOverlays))) + { + currentLayer++; + sprintf(layerName, "CURVE"); + result = gLayerList.addGraphicLayer(layerName, 1, "Curves"); + } + break; + case DVPSG_separateLayers: + currentLayer++; + sprintf(layerName, "CURVE%04ld", (long)currentLayer-lastOverlayLayer); + sprintf(layerDesc, "Curve Layer %ld", (long)currentLayer-lastOverlayLayer); + result = gLayerList.addGraphicLayer(layerName, currentLayer, layerDesc); + break; + } + DVPSOverlayCurveActivationLayer *newLayer = new DVPSOverlayCurveActivationLayer(); + if (newLayer) + { + newLayer->setActivationLayer(layerName); + newLayer->setRepeatingGroup(group); + list_.push_back(newLayer); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSOverlayCurveActivationLayer_PList::setActivation(Uint16 group, const char *layer) +{ + /* first we make sure we have a valid overlay group */ + OFBool result = OFFalse; + if ((group < 0x6020)&&(group >= 0x6000)&&((group & 1) == 0)) result = OFTrue; + if ((group < 0x5020)&&(group >= 0x5000)&&((group & 1) == 0)) result = OFTrue; + if (!result) return EC_IllegalCall; + if (layer==NULL) return EC_IllegalCall; + + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + if ((*first)->isRepeatingGroup(group)) + { + (*first)->setActivationLayer(layer); + return EC_Normal; + } + ++first; + } + DVPSOverlayCurveActivationLayer * newLayer = new DVPSOverlayCurveActivationLayer(); + if (newLayer) + { + newLayer->setActivationLayer(layer); + newLayer->setRepeatingGroup(group); + list_.push_back(newLayer); + return EC_Normal; + } + return EC_MemoryExhausted; +} + +void DVPSOverlayCurveActivationLayer_PList::removeActivation(Uint16 group) +{ + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + if ((*first)->isRepeatingGroup(group)) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } +} + +const char *DVPSOverlayCurveActivationLayer_PList::getActivationLayer(Uint16 group) +{ + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + if ((*first)->isRepeatingGroup(group)) return (*first)->getActivationLayer(); + ++first; + } + return NULL; +} + +void DVPSOverlayCurveActivationLayer_PList::renameLayer(const char *oldName, const char *newName) +{ + if ((oldName==NULL)||(newName==NULL)) return; + + OFString aString(oldName); + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + const char *activationLayer = (*first)->getActivationLayer(); + if (activationLayer && (aString == activationLayer)) + { + (*first)->setActivationLayer(newName); + } + ++first; + } + return; +} + +void DVPSOverlayCurveActivationLayer_PList::removeLayer(const char *name) +{ + if (name==NULL) return; + + OFString aString(name); + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + const char *activationLayer = (*first)->getActivationLayer(); + if (activationLayer && (aString == activationLayer)) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + return; +} + +OFBool DVPSOverlayCurveActivationLayer_PList::usesLayerName(const char *name) +{ + if (name==NULL) return OFFalse; + + OFString aString(name); + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + const char *activationLayer = (*first)->getActivationLayer(); + if (activationLayer && (aString == activationLayer)) return OFTrue; + ++first; + } + return OFFalse; +} + +size_t DVPSOverlayCurveActivationLayer_PList::getNumberOfActivations(const char *layer, OFBool isCurve) +{ + if (layer==NULL) return 0; + + size_t result = 0; + Uint16 group; + OFString aString(layer); + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + const char *activationLayer = (*first)->getActivationLayer(); + if (activationLayer && (aString == activationLayer)) + { + group = (*first)->getRepeatingGroup(); + if (((isCurve) && (group < 0x6000)) || ((!isCurve) && (group >= 0x6000))) result++; + } + ++first; + } + return result; +} + + +Uint16 DVPSOverlayCurveActivationLayer_PList::getActivationGroup(const char *layer, size_t idx, OFBool isCurve) +{ + if (layer==NULL) return 0; + + Uint16 group; + OFString aString(layer); + OFListIterator(DVPSOverlayCurveActivationLayer *) first = list_.begin(); + OFListIterator(DVPSOverlayCurveActivationLayer *) last = list_.end(); + while (first != last) + { + const char *activationLayer = (*first)->getActivationLayer(); + if (activationLayer && (aString == activationLayer)) + { + group = (*first)->getRepeatingGroup(); + if (((isCurve) && (group < 0x6000)) || ((!isCurve) && (group >= 0x6000))) + { + if (idx==0) return group; else idx--; + } + } + ++first; + } + return 0; +} diff --git a/dcmpstat/libsrc/dvpscf.cc b/dcmpstat/libsrc/dvpscf.cc new file mode 100644 index 00000000..18e4359a --- /dev/null +++ b/dcmpstat/libsrc/dvpscf.cc @@ -0,0 +1,1473 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Joerg Riesmeier, Marco Eichelberg + * + * Purpose: DVConfiguration + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpscf.h" /* for DVConfiguration */ +#include "dcmtk/ofstd/ofconfig.h" /* for class OFConfigFile */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants */ +#include "dcmtk/ofstd/ofstd.h" /* for class OFStandard */ + +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#ifndef HAVE_WINDOWS_H +/* some Unix operating systems do not define a prototype for strncasecmp + * although the function is known. + */ +#ifndef HAVE_PROTOTYPE_STRNCASECMP +extern "C" int strncasecmp(const char *s1, const char *s2, size_t n); +#endif +#endif + +/* keywords for configuration file */ + +#define L0_AETITLE "AETITLE" +#define L0_ALWAYSDELETETERMINATEJOBS "ALWAYSDELETETERMINATEJOBS" +#define L0_ANNOTATION "ANNOTATION" +#define L0_AUTOCREATECONFIGFILE "AUTOCREATECONFIGFILE" +#define L0_BINARYLOG "BINARYLOG" +#define L0_BITPRESERVINGMODE "BITPRESERVINGMODE" +#define L0_BORDERDENSITY "BORDERDENSITY" +#define L0_CACERTIFICATEDIRECTORY "CACERTIFICATEDIRECTORY" +#define L0_CENTER "CENTER" +#define L0_CERTIFICATE "CERTIFICATE" +#define L0_CHARACTERISTICS "CHARACTERISTICS" +#define L0_CHECK "CHECK" +#define L0_CODE "CODE" +#define L0_CORRECTUIDPADDING "CORRECTUIDPADDING" +#define L0_DEFAULTILLUMINATION "DEFAULTILLUMINATION" +#define L0_DEFAULTREFLECTION "DEFAULTREFLECTION" +#define L0_DELETEPRINTJOBS "DELETEPRINTJOBS" +#define L0_DESCRIPTION "DESCRIPTION" +#define L0_DETAILEDLOG "DETAILEDLOG" +#define L0_DICOMNAME "DICOMNAME" +#define L0_DIFFIEHELLMANPARAMETERS "DIFFIEHELLMANPARAMETERS" +#define L0_DIRECTORY "DIRECTORY" +#define L0_DISABLENEWVRS "DISABLENEWVRS" +#define L0_DISPLAYFORMAT "DISPLAYFORMAT" +#define L0_DUMP "DUMP" +#define L0_EMPTYIMAGEDENSITY "EMPTYIMAGEDENSITY" +#define L0_FILENAME "FILENAME" +#define L0_FILMDESTINATION "FILMDESTINATION" +#define L0_FILMSIZEID "FILMSIZEID" +#define L0_HOSTNAME "HOSTNAME" +#define L0_IMPLICITONLY "IMPLICITONLY" +#define L0_KEEPMESSAGEPORTOPEN "KEEPMESSAGEPORTOPEN" +#define L0_LOGDIRECTORY "LOGDIRECTORY" +#define L0_LOGFILE "LOGFILE" +#define L0_LOGIN "LOGIN" +#define L0_LOGLEVEL "LOGLEVEL" +#define L0_MAGNIFICATIONTYPE "MAGNIFICATIONTYPE" +#define L0_MAXASSOCIATIONS "MAXASSOCIATIONS" +#define L0_MAXCOLUMNS "MAXCOLUMNS" +#define L0_MAXDENSITY "MAXDENSITY" +#define L0_MAXPDU "MAXPDU" +#define L0_MAXPRINTRESOLUTION "MAXPRINTRESOLUTION" +#define L0_MAXROWS "MAXROWS" +#define L0_MEDIUMTYPE "MEDIUMTYPE" +#define L0_MESSAGEPORT "MESSAGEPORT" +#define L0_MINDENSITY "MINDENSITY" +#define L0_MINPRINTRESOLUTION "MINPRINTRESOLUTION" +#define L0_MODALITY "MODALITY" +#define L0_NAME "NAME" +#define L0_OMITSOPCLASSUIDFROMCREATERESPONSE "OMITSOPCLASSUIDFROMCREATERESPONSE" +#define L0_ORGANIZATION "ORGANIZATION" +#define L0_PEERAUTHENTICATION "PEERAUTHENTICATION" +#define L0_PORT "PORT" +#define L0_PRESENTATIONLUTINFILMSESSION "PRESENTATIONLUTINFILMSESSION" +#define L0_PRESENTATIONLUTMATCHREQUIRED "PRESENTATIONLUTMATCHREQUIRED" +#define L0_PRESENTATIONLUTPREFERSCPRENDERING "PRESENTATIONLUTPREFERSCPRENDERING" +#define L0_PREVIEW "PREVIEWSIZE" +#define L0_PRIVATEKEY "PRIVATEKEY" +#define L0_PRIVATEKEYPASSWORD "PRIVATEKEYPASSWORD" +#define L0_RANDOMSEED "RANDOMSEED" +#define L0_RECEIVER "RECEIVER" +#define L0_RESOLUTION "RESOLUTION" +#define L0_RESOLUTIONID "RESOLUTIONID" +#define L0_SCREENSIZE "SCREENSIZE" +#define L0_SENDER "SENDER" +#define L0_SERVER "SERVER" +#define L0_SESSIONLABELANNOTATION "SESSIONLABELANNOTATION" +#define L0_SLEEP "SLEEP" +#define L0_SMOOTHINGTYPE "SMOOTHINGTYPE" +#define L0_SPOOLER "SPOOLER" +#define L0_SUPPORTS12BIT "SUPPORTS12BIT" +#define L0_SUPPORTSDECIMATECROP "SUPPORTSDECIMATECROP" +#define L0_SUPPORTSIMAGESIZE "SUPPORTSIMAGESIZE" +#define L0_SUPPORTSPRESENTATIONLUT "SUPPORTSPRESENTATIONLUT" +#define L0_SUPPORTSTRIM "SUPPORTSTRIM" +#define L0_TIMEOUT "TIMEOUT" +#define L0_TLSDIRECTORY "TLSDIRECTORY" +#define L0_TLSPROFILE "TLSPROFILE" +#define L0_TYPE "TYPE" +#define L0_USEPEMFORMAT "USEPEMFORMAT" +#define L0_USERKEYDIRECTORY "USERKEYDIRECTORY" +#define L0_USETLS "USETLS" +#define L0_WIDTH "WIDTH" +#define L1_APPLICATION "APPLICATION" +#define L1_DATABASE "DATABASE" +#define L1_GUI "GUI" +#define L1_LUT "LUT" +#define L1_REPORT "REPORT" +#define L1_MONITOR "MONITOR" +#define L1_NETWORK "NETWORK" +#define L1_PRINT "PRINT" +#define L1_QUERY_RETRIEVE "QUERY_RETRIEVE" +#define L1_TLS "TLS" +#define L2_COMMUNICATION "COMMUNICATION" +#define L2_GENERAL "GENERAL" +// L2_HIGHRESOLUTIONGRAPHICS is defined in dvpsdef.h +#define L2_LUT "LUT" +#define L2_USERS "USERS" +#define L2_VOI "VOI" +#define L2_REPORT "REPORT" + + + +/* --------------- static helper functions --------------- */ + +static DVPSPeerType getConfigTargetType(const char *val) +{ + DVPSPeerType result = DVPSE_storage; /* default */ + + if (val==NULL) return result; + OFString pstring(val); + OFString ostring; + size_t len = pstring.length(); + unsigned char c; + for (size_t i=0; i='a') && (c <= 'z')) ostring += (char)(toupper(c)); + else if ((c>='A') && (c <= 'Z')) ostring += c; + else if ((c>='0') && (c <= '9')) ostring += c; + else if (c=='_') ostring += c; + } + if (ostring=="PRINTER") result=DVPSE_printRemote; else + if (ostring=="LOCALPRINTER") result=DVPSE_printLocal; else + if (ostring=="STORAGE") result=DVPSE_storage; else + if (ostring=="RECEIVER") result=DVPSE_receiver; else + { + DCMPSTAT_WARN("unsupported peer type in config file: '" << val << "', ignoring."); + } + return result; +} + +static Uint32 countValues(const char *str) +{ + if (str) + { + Uint32 result = 0; + if (*str) result++; + char c; + while ((c = *str++)) if (c == '\\') result++; + return result; + } + return 0; +} + +static void copyValue(const char *str, Uint32 idx, OFString& target) +{ + target.clear(); + if (str) + { + char c = '\\'; + while (idx) + { + c = *str++; + if (c == 0) idx=0; else if (c == '\\') idx--; + } + if (c=='\\') + { + const char *endstr = str; + while ((*endstr) && (*endstr != '\\')) endstr++; + target.assign(str,(endstr-str)); + } + } + return; +} + +static int strCompare(const char *str1, const char *str2, size_t len) +{ +#ifdef HAVE_WINDOWS_H + return _strnicmp(str1, str2, len); +#else + return strncasecmp(str1, str2, len); +#endif +} + + +DVConfiguration::DVConfiguration(const char *config_file) +: pConfig(NULL) +{ + if (config_file) + { + FILE *cfgfile = fopen(config_file, "rb"); + if (cfgfile) + { + pConfig = new OFConfigFile(cfgfile); + fclose(cfgfile); + } + } +} + + +DVConfiguration::~DVConfiguration() +{ + if (pConfig) delete pConfig; +} + + +Uint32 DVConfiguration::getNumberOfTargets(DVPSPeerType peerType) +{ + Uint32 result = 0; + DVPSPeerType currentType; + + if (pConfig) + { + pConfig->set_section(2, L2_COMMUNICATION); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + currentType = getConfigTargetType(pConfig->get_entry(L0_TYPE)); + switch (peerType) + { + case DVPSE_storage: + if (currentType==DVPSE_storage) result++; + break; + case DVPSE_receiver: + if (currentType==DVPSE_receiver) result++; + break; + case DVPSE_printRemote: + if (currentType==DVPSE_printRemote) result++; + break; + case DVPSE_printLocal: + if (currentType==DVPSE_printLocal) result++; + break; + case DVPSE_printAny: + if (currentType==DVPSE_printRemote) result++; + else if (currentType==DVPSE_printLocal) result++; + break; + case DVPSE_any: + result++; + break; + } + pConfig->next_section(1); + } + } + } + return result; +} + + +const char *DVConfiguration::getTargetID(Uint32 idx, DVPSPeerType peerType) +{ + const char *result=NULL; + DVPSPeerType currentType; + OFBool found = OFFalse; + + if (pConfig) + { + pConfig->set_section(2, L2_COMMUNICATION); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while ((! found)&&(pConfig->section_valid(1))) + { + currentType = getConfigTargetType(pConfig->get_entry(L0_TYPE)); + switch (peerType) + { + case DVPSE_storage: + if (currentType==DVPSE_storage) + { + if (idx==0) found=OFTrue; else idx--; + } + break; + case DVPSE_receiver: + if (currentType==DVPSE_receiver) + { + if (idx==0) found=OFTrue; else idx--; + } + break; + case DVPSE_printRemote: + if (currentType==DVPSE_printRemote) + { + if (idx==0) found=OFTrue; else idx--; + } + break; + case DVPSE_printLocal: + if (currentType==DVPSE_printLocal) + { + if (idx==0) found=OFTrue; else idx--; + } + break; + case DVPSE_printAny: + if ((currentType==DVPSE_printRemote)||(currentType==DVPSE_printLocal)) + { + if (idx==0) found=OFTrue; else idx--; + } + break; + case DVPSE_any: + if (idx==0) found=OFTrue; else idx--; + break; + } + if (!found) pConfig->next_section(1); + } + if (pConfig->section_valid(1)) result = pConfig->get_keyword(1); + } + } + return result; +} + + +const char *DVConfiguration::getConfigEntry(const char *l2_key, const char *l1_key, const char *l0_key) +{ + const char *result=NULL; + if (l2_key && l1_key && l0_key && pConfig) + { + pConfig->select_section(l1_key, l2_key); + if (pConfig->section_valid(1)) result = pConfig->get_entry(l0_key); + } + return result; +} + +OFBool DVConfiguration::getConfigBoolEntry(const char *l2_key, const char *l1_key, const char *l0_key, OFBool deflt) +{ + OFBool result=deflt; + if (l2_key && l1_key && l0_key && pConfig) + { + pConfig->select_section(l1_key, l2_key); + if (pConfig->section_valid(1)) + { + pConfig->set_section(0,l0_key); + result = pConfig->get_bool_value(deflt); + } + } + return result; +} + +const char *DVConfiguration::getTargetDescription(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_DESCRIPTION); +} + +const char *DVConfiguration::getTargetHostname(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_HOSTNAME); +} + +unsigned short DVConfiguration::getTargetPort(const char *targetID) +{ + const char *c = getConfigEntry(L2_COMMUNICATION, targetID, L0_PORT); + unsigned short result = 0; + if (c) + { + if (1 != sscanf(c, "%hu", &result)) result=0; + } + return result; +} + +const char *DVConfiguration::getTargetAETitle(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_AETITLE); +} + +unsigned long DVConfiguration::getTargetMaxPDU(const char *targetID) +{ + const char *c = getConfigEntry(L2_COMMUNICATION, targetID, L0_MAXPDU); + unsigned long result = 0; + if (c) + { + if (1 != sscanf(c, "%lu", &result)) result=0; + } + return result; +} + +Sint32 DVConfiguration::getTargetTimeout(const char *targetID) +{ + const char *c = getConfigEntry(L2_COMMUNICATION, targetID, L0_TIMEOUT); + signed long result = -1; // default is -1 + if (c) + { + if (1 != sscanf(c, "%ld", &result)) result=0; + } + return (Sint32) result; +} + +OFBool DVConfiguration::getTargetImplicitOnly(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_IMPLICITONLY, OFFalse); +} + +OFBool DVConfiguration::getTargetDisableNewVRs(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_DISABLENEWVRS, OFFalse); +} + +DVPSPeerType DVConfiguration::getTargetType(const char *targetID) +{ + return getConfigTargetType(getConfigEntry(L2_COMMUNICATION, targetID, L0_TYPE)); +} + +const char *DVConfiguration::getLogFolder() +{ + return getConfigEntry(L2_GENERAL, L1_APPLICATION, L0_LOGDIRECTORY); +} + +const char *DVConfiguration::getLogFile() +{ + return getConfigEntry(L2_GENERAL, L1_APPLICATION, L0_LOGFILE); +} + +OFLogger::LogLevel DVConfiguration::getLogLevel() +{ + OFLogger::LogLevel result = OFLogger::FATAL_LOG_LEVEL; + const char *c = getConfigEntry(L2_GENERAL, L1_APPLICATION, L0_LOGLEVEL); + if (c != NULL) + { + if (strCompare(c, "ERROR", 5) == 0) + result = OFLogger::ERROR_LOG_LEVEL; + else if (strCompare(c, "WARN", 4) == 0) + result = OFLogger::WARN_LOG_LEVEL; + else if (strCompare(c, "INFO", 4) == 0) + result = OFLogger::INFO_LOG_LEVEL; + else if (strCompare(c, "DEBUG", 5) == 0) + result = OFLogger::DEBUG_LOG_LEVEL; + } + return result; +} + +unsigned short DVConfiguration::getMessagePort() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_APPLICATION, L0_MESSAGEPORT); + unsigned short result = 0; + if (c) + { + if (1 != sscanf(c, "%hu", &result)) result=0; + } + return result; +} + +OFBool DVConfiguration::getMessagePortKeepOpen() +{ + return getConfigBoolEntry(L2_GENERAL, L1_APPLICATION, L0_KEEPMESSAGEPORTOPEN, OFFalse); +} + +const char *DVConfiguration::getNetworkAETitle() +{ + const char *result = getConfigEntry(L2_GENERAL, L1_NETWORK, L0_AETITLE); + if (result==NULL) result = PSTAT_AETITLE; + return result; +} + +OFBool DVConfiguration::getQueryRetrieveAutoCreateConfigFile() +{ + return getConfigBoolEntry(L2_GENERAL, L1_QUERY_RETRIEVE, L0_AUTOCREATECONFIGFILE, OFTrue); +} + +const char *DVConfiguration::getQueryRetrieveAETitle() +{ + const char *result = getConfigEntry(L2_GENERAL, L1_QUERY_RETRIEVE, L0_AETITLE); + if (result==NULL) result = PSTAT_AETITLE; + return result; +} + +unsigned short DVConfiguration::getQueryRetrievePort() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_QUERY_RETRIEVE, L0_PORT); + unsigned short result = 0; + if (c) + { + if (1 != sscanf(c, "%hu", &result)) result=0; + } + return result; +} + +unsigned long DVConfiguration::getQueryRetrieveMaxPDU() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_QUERY_RETRIEVE, L0_MAXPDU); + unsigned long result = 0; + if (c) + { + if (1 != sscanf(c, "%lu", &result)) result=0; + } + return result; +} + +Sint32 DVConfiguration::getQueryRetrieveTimeout() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_QUERY_RETRIEVE, L0_TIMEOUT); + signed long result = -1; // default is -1 + if (c) + { + if (1 != sscanf(c, "%ld", &result)) result=0; + } + return (Sint32) result; +} + +unsigned long DVConfiguration::getQueryRetrieveMaxAssociations() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_QUERY_RETRIEVE, L0_MAXASSOCIATIONS); + unsigned long result = 0; + if (c) + { + if (1 != sscanf(c, "%lu", &result)) result=0; + } + return result; +} + +const char *DVConfiguration::getDatabaseFolder() +{ + const char *result = getConfigEntry(L2_GENERAL, L1_DATABASE, L0_DIRECTORY); + if (result==NULL) result = PSTAT_DBFOLDER; + return result; +} + +const char *DVConfiguration::getSpoolFolder() +{ + const char *result = getConfigEntry(L2_GENERAL, L1_PRINT, L0_DIRECTORY); + if (result==NULL) result = PSTAT_SPOOLFOLDER; + return result; +} + +OFBool DVConfiguration::getDetailedLog() +{ + return getConfigBoolEntry(L2_GENERAL, L1_PRINT, L0_DETAILEDLOG, OFFalse); +} + +OFBool DVConfiguration::getBinaryLog() +{ + return getConfigBoolEntry(L2_GENERAL, L1_PRINT, L0_BINARYLOG, OFFalse); +} + +unsigned long DVConfiguration::getSpoolerSleep() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_PRINT, L0_SLEEP); + unsigned long result = 0; + if (c) + { + if (1 != sscanf(c, "%lu", &result)) result=0; + } + return result; +} + +OFBool DVConfiguration::getSpoolerDeletePrintJobs() +{ + return getConfigBoolEntry(L2_GENERAL, L1_PRINT, L0_DELETEPRINTJOBS, OFFalse); +} + +OFBool DVConfiguration::getSpoolerAlwaysDeleteTerminateJobs() +{ + return getConfigBoolEntry(L2_GENERAL, L1_PRINT, L0_ALWAYSDELETETERMINATEJOBS, OFFalse); +} + +const char *DVConfiguration::getLUTFolder() +{ + const char *result = getConfigEntry(L2_GENERAL, L1_LUT, L0_DIRECTORY); + if (result==NULL) result = PSTAT_LUTFOLDER; + return result; +} + +const char *DVConfiguration::getReportFolder() +{ + const char *result = getConfigEntry(L2_GENERAL, L1_REPORT, L0_DIRECTORY); + if (result==NULL) result = PSTAT_REPORTFOLDER; + return result; +} + +const char *DVConfiguration::getSenderName() +{ + return getConfigEntry(L2_GENERAL, L1_NETWORK, L0_SENDER); +} + +const char *DVConfiguration::getReceiverName() +{ + return getConfigEntry(L2_GENERAL, L1_NETWORK, L0_RECEIVER); +} + +const char *DVConfiguration::getQueryRetrieveServerName() +{ + return getConfigEntry(L2_GENERAL, L1_QUERY_RETRIEVE, L0_SERVER); +} + +const char *DVConfiguration::getSpoolerName() +{ + return getConfigEntry(L2_GENERAL, L1_PRINT, L0_SPOOLER); +} + +const char *DVConfiguration::getPrintServerName() +{ + return getConfigEntry(L2_GENERAL, L1_PRINT, L0_SERVER); +} + +const char *DVConfiguration::getDumpToolName() +{ + return getConfigEntry(L2_GENERAL, L1_DATABASE, L0_DUMP); +} + +const char *DVConfiguration::getCheckToolName() +{ + return getConfigEntry(L2_GENERAL, L1_DATABASE, L0_CHECK); +} + +const char *DVConfiguration::getMonitorCharacteristicsFile() +{ + return getConfigEntry(L2_GENERAL, L1_MONITOR, L0_CHARACTERISTICS); +} + +double DVConfiguration::getMonitorPixelWidth() +{ + const char *resolution = getConfigEntry(L2_GENERAL, L1_MONITOR, L0_RESOLUTION); + const char *screensize = getConfigEntry(L2_GENERAL, L1_MONITOR, L0_SCREENSIZE); + + if (resolution && screensize) + { + double rX=0.0, rY=0.0, sX=0.0, sY=0.0; + OFString s(resolution); + OFBool success = OFFalse; + + rX = OFStandard::atof(s.c_str(), &success); + if (success) + { + s.erase(0, s.find('\\')+1); + if (!s.empty()) + { + rY = OFStandard::atof(s.c_str(), &success); + } else success = OFFalse; + } + + if (success) + { + s = screensize; + sX = OFStandard::atof(s.c_str(), &success); + if (success) + { + s.erase(0, s.find('\\')+1); + if (!s.empty()) + { + sY = OFStandard::atof(s.c_str(), &success); + } else success = OFFalse; + } + } + + if (success && (rX > 0) && (rY > 0) && (sX > 0) && (sY > 0)) + { + // everything OK, return pixel width + return sX/rX; + } + } + return 0.0; +} + +double DVConfiguration::getMonitorPixelHeight() +{ + const char *resolution = getConfigEntry(L2_GENERAL, L1_MONITOR, L0_RESOLUTION); + const char *screensize = getConfigEntry(L2_GENERAL, L1_MONITOR, L0_SCREENSIZE); + + if (resolution && screensize) + { + double rX=0.0, rY=0.0, sX=0.0, sY=0.0; + OFString s(resolution); + OFBool success = OFFalse; + + rX = OFStandard::atof(s.c_str(), &success); + if (success) + { + s.erase(0, s.find('\\')+1); + if (!s.empty()) + { + rY = OFStandard::atof(s.c_str(), &success); + } else success = OFFalse; + } + + if (success) + { + s = screensize; + sX = OFStandard::atof(s.c_str(), &success); + if (success) + { + s.erase(0, s.find('\\')+1); + if (!s.empty()) + { + sY = OFStandard::atof(s.c_str(), &success); + } else success = OFFalse; + } + } + + if (success && (rX > 0) && (rY > 0) && (sX > 0) && (sY > 0)) + { + // everything OK, return pixel height + return sY/rY; + } + } + return 0.0; +} + +Uint32 DVConfiguration::getMaxPreviewResolutionX() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_MONITOR, L0_PREVIEW); + if (c) + { + unsigned long result = 0; + unsigned long dummy = 0; + if (2 == sscanf(c, "%lu\\%lu", &result, &dummy)) return (Uint32) result; + } + return 0; +} + +Uint32 DVConfiguration::getMaxPreviewResolutionY() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_MONITOR, L0_PREVIEW); + if (c) + { + unsigned long result = 0; + unsigned long dummy = 0; + if (2 == sscanf(c, "%lu\\%lu", &dummy, &result)) return (Uint32) result; + } + return 0; +} + +const char *DVConfiguration::getGUIConfigEntry(const char *key) +{ + return getConfigEntry(L2_GENERAL, L1_GUI, key); +} + +OFBool DVConfiguration::getGUIConfigEntryBool(const char *key, OFBool dfl) +{ + return getConfigBoolEntry(L2_GENERAL, L1_GUI, key, dfl); +} + +OFBool DVConfiguration::getTargetPrinterSupportsPresentationLUT(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_SUPPORTSPRESENTATIONLUT, OFFalse); +} + +OFBool DVConfiguration::getTargetPrinterPresentationLUTMatchRequired(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_PRESENTATIONLUTMATCHREQUIRED, OFTrue); +} + +OFBool DVConfiguration::getTargetPrinterPresentationLUTPreferSCPRendering(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_PRESENTATIONLUTPREFERSCPRENDERING, OFFalse); +} + +OFBool DVConfiguration::getTargetPrinterPresentationLUTinFilmSession(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_PRESENTATIONLUTINFILMSESSION, OFFalse); +} + +OFBool DVConfiguration::getTargetPrinterSupports12BitTransmission(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_SUPPORTS12BIT, OFTrue); +} + +OFBool DVConfiguration::getTargetPrintSCPOmitSOPClassUIDFromCreateResponse(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_OMITSOPCLASSUIDFROMCREATERESPONSE, OFFalse); +} + +OFBool DVConfiguration::getTargetPrinterSupportsRequestedImageSize(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_SUPPORTSIMAGESIZE, OFFalse); +} + +OFBool DVConfiguration::getTargetPrinterSupportsDecimateCrop(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_SUPPORTSDECIMATECROP, OFFalse); +} + +OFBool DVConfiguration::getTargetPrinterSupportsTrim(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_SUPPORTSTRIM, OFFalse); +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfFilmSizeIDs(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_FILMSIZEID)); +} + +const char *DVConfiguration::getTargetPrinterFilmSizeID(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_FILMSIZEID), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfMediumTypes(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_MEDIUMTYPE)); +} + +const char *DVConfiguration::getTargetPrinterMediumType(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_MEDIUMTYPE), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfFilmDestinations(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_FILMDESTINATION)); +} + +const char *DVConfiguration::getTargetPrinterFilmDestination(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_FILMDESTINATION), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfPrinterResolutionIDs(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_RESOLUTIONID)); +} + +const char *DVConfiguration::getTargetPrinterResolutionID(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_RESOLUTIONID), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfMagnificationTypes(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_MAGNIFICATIONTYPE)); +} + +const char *DVConfiguration::getTargetPrinterMagnificationType(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_MAGNIFICATIONTYPE), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfSmoothingTypes(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_SMOOTHINGTYPE)); +} + +const char *DVConfiguration::getTargetPrinterSmoothingType(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_SMOOTHINGTYPE), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + + +Uint32 DVConfiguration::getTargetPrinterNumberOfConfigurationSettings(const char *targetID) +{ + Uint32 result = 0; + + if (pConfig) + { + + pConfig->select_section(targetID, L2_COMMUNICATION); + if (pConfig->section_valid(1)) + { + int counter = 1; + char l0_key[80]; + do + { + sprintf(l0_key, "CONFIGURATION_%d", counter++); + } while (NULL != pConfig->get_entry(l0_key)); + result = counter - 2; + } + } + return result; +} + +const char *DVConfiguration::getTargetPrinterConfigurationSetting(const char *targetID, Uint32 idx) +{ + char l0_key[80]; + sprintf(l0_key, "CONFIGURATION_%d", (int)idx+1); + return getConfigEntry(L2_COMMUNICATION, targetID, l0_key); +} + +Uint32 DVConfiguration::getNumberOfLUTs() +{ + Uint32 result = 0; + if (pConfig) + { + pConfig->set_section(2, L2_LUT); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + result++; + pConfig->next_section(1); + } + } + } + return result; +} + +const char *DVConfiguration::getLUTID(Uint32 idx) +{ + OFBool found = OFFalse; + const char *result=NULL; + if (pConfig) + { + pConfig->set_section(2, L2_LUT); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while ((! found)&&(pConfig->section_valid(1))) + { + if (idx==0) found=OFTrue; + else + { + idx--; + pConfig->next_section(1); + } + } + if (pConfig->section_valid(1)) result = pConfig->get_keyword(1); + } + } + return result; +} + +const char *DVConfiguration::getLUTDescription(const char *lutID) +{ + return getConfigEntry(L2_LUT, lutID, L0_DESCRIPTION); +} + +const char *DVConfiguration::getLUTFilename(const char *lutID) +{ + return getConfigEntry(L2_LUT, lutID, L0_FILENAME); +} + +Uint32 DVConfiguration::getNumberOfReports() +{ + Uint32 result = 0; + if (pConfig) + { + pConfig->set_section(2, L2_REPORT); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + result++; + pConfig->next_section(1); + } + } + } + return result; +} + +const char *DVConfiguration::getReportID(Uint32 idx) +{ + OFBool found = OFFalse; + const char *result=NULL; + if (pConfig) + { + pConfig->set_section(2, L2_REPORT); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while ((! found)&&(pConfig->section_valid(1))) + { + if (idx==0) found=OFTrue; + else + { + idx--; + pConfig->next_section(1); + } + } + if (pConfig->section_valid(1)) result = pConfig->get_keyword(1); + } + } + return result; +} + +const char *DVConfiguration::getReportDescription(const char *reportID) +{ + return getConfigEntry(L2_REPORT, reportID, L0_DESCRIPTION); +} + +const char *DVConfiguration::getReportFilename(const char *reportID) +{ + return getConfigEntry(L2_REPORT, reportID, L0_FILENAME); +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfBorderDensities(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_BORDERDENSITY)); +} + +const char *DVConfiguration::getTargetPrinterBorderDensity(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_BORDERDENSITY), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfMaxDensities(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_MAXDENSITY)); +} + +const char *DVConfiguration::getTargetPrinterMaxDensity(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_MAXDENSITY), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfMinDensities(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_MINDENSITY)); +} + +const char *DVConfiguration::getTargetPrinterMinDensity(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_MINDENSITY), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfEmptyImageDensities(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_EMPTYIMAGEDENSITY)); +} + +const char *DVConfiguration::getTargetPrinterEmptyImageDensity(const char *targetID, Uint32 idx, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_EMPTYIMAGEDENSITY), idx, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint32 DVConfiguration::getMinPrintResolutionX() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_PRINT, L0_MINPRINTRESOLUTION); + if (c) + { + unsigned long result = 0; + unsigned long dummy = 0; + if (2 == sscanf(c, "%lu\\%lu", &result, &dummy)) return (Uint32) result; + } + return 0; +} + +Uint32 DVConfiguration::getMinPrintResolutionY() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_PRINT, L0_MINPRINTRESOLUTION); + if (c) + { + unsigned long result = 0; + unsigned long dummy = 0; + if (2 == sscanf(c, "%lu\\%lu", &dummy, &result)) return (Uint32) result; + } + return 0; +} + +Uint32 DVConfiguration::getMaxPrintResolutionX() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_PRINT, L0_MAXPRINTRESOLUTION); + if (c) + { + unsigned long result = 0; + unsigned long dummy = 0; + if (2 == sscanf(c, "%lu\\%lu", &result, &dummy)) return (Uint32) result; + } + return 0; +} + +Uint32 DVConfiguration::getMaxPrintResolutionY() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_PRINT, L0_MAXPRINTRESOLUTION); + if (c) + { + unsigned long result = 0; + unsigned long dummy = 0; + if (2 == sscanf(c, "%lu\\%lu", &dummy, &result)) return (Uint32) result; + } + return 0; +} + +Uint16 DVConfiguration::getDefaultPrintIllumination() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_PRINT, L0_DEFAULTILLUMINATION); + if (c) + { + Uint16 result = 0; + if (1 == sscanf(c, "%hu", &result)) return result; + } + return DEFAULT_illumination; +} + +Uint16 DVConfiguration::getDefaultPrintReflection() +{ + const char *c = getConfigEntry(L2_GENERAL, L1_PRINT, L0_DEFAULTREFLECTION); + if (c) + { + Uint16 result = 0; + if (1 == sscanf(c, "%hu", &result)) return result; + } + return DEFAULT_reflectedAmbientLight; +} + +Uint32 DVConfiguration::getNumberOfVOIPresets(const char *modality) +{ + Uint32 result = 0; + if (modality && pConfig) + { + OFString aModality = modality; + const char *currentModality = NULL; + pConfig->set_section(2, L2_VOI); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + currentModality = pConfig->get_entry(L0_MODALITY); + if (currentModality && (aModality == currentModality)) result++; + pConfig->next_section(1); + } + } + } + return result; +} + +const char *DVConfiguration::getVOIPresetDescription(const char *modality, Uint32 idx) +{ + if (modality && pConfig) + { + OFString aModality = modality; + const char *currentModality = NULL; + pConfig->set_section(2, L2_VOI); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + currentModality = pConfig->get_entry(L0_MODALITY); + if (currentModality && (aModality == currentModality)) + { + if (idx==0) + { + // found entry + return pConfig->get_entry(L0_DESCRIPTION); + } else idx--; + } + pConfig->next_section(1); + } + } + } + return NULL; +} + +double DVConfiguration::getVOIPresetWindowCenter(const char *modality, Uint32 idx) +{ + double result = 0.0; + if (modality && pConfig) + { + OFString aModality = modality; + const char *currentModality = NULL; + pConfig->set_section(2, L2_VOI); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + currentModality = pConfig->get_entry(L0_MODALITY); + if (currentModality && (aModality == currentModality)) + { + if (idx==0) + { + // found entry + const char *window = pConfig->get_entry(L0_CENTER); + if (window) return OFStandard::atof(window); else return 0.0; + } else idx--; + } + pConfig->next_section(1); + } + } + } + return result; +} + +double DVConfiguration::getVOIPresetWindowWidth(const char *modality, Uint32 idx) +{ + double result = 1.0; + if (modality && pConfig) + { + OFString aModality = modality; + const char *currentModality = NULL; + pConfig->set_section(2, L2_VOI); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + currentModality = pConfig->get_entry(L0_MODALITY); + if (currentModality && (aModality == currentModality)) + { + if (idx==0) + { + // found entry + const char *window = pConfig->get_entry(L0_WIDTH); + if (window) return OFStandard::atof(window); else return 1.0; + } else idx--; + } + pConfig->next_section(1); + } + } + } + return result; +} + +Uint32 DVConfiguration::getTargetPrinterNumberOfPortraitDisplayFormats(const char *targetID) +{ + return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_DISPLAYFORMAT)); +} + +Uint32 DVConfiguration::getTargetPrinterPortraitDisplayFormatRows(const char *targetID, Uint32 idx) +{ + OFString value; + unsigned long rows=0; + unsigned long columns=0; + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_DISPLAYFORMAT), idx, value); + if (2==sscanf(value.c_str(), "%lu,%lu", &columns, &rows)) return rows; + return 0; +} + +Uint32 DVConfiguration::getTargetPrinterPortraitDisplayFormatColumns(const char *targetID, Uint32 idx) +{ + OFString value; + unsigned long rows=0; + unsigned long columns=0; + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_DISPLAYFORMAT), idx, value); + if (2==sscanf(value.c_str(), "%lu,%lu", &columns, &rows)) return columns; + return 0; +} + +OFBool DVConfiguration::getTargetPrinterSupportsAnnotation(const char *targetID) +{ + if (NULL==getConfigEntry(L2_COMMUNICATION, targetID, L0_ANNOTATION)) return getTargetPrinterSessionLabelAnnotation(targetID); + return OFTrue; +} + +OFBool DVConfiguration::getTargetPrinterSupportsAnnotationBoxSOPClass(const char *targetID) +{ + if (NULL==getConfigEntry(L2_COMMUNICATION, targetID, L0_ANNOTATION)) return OFFalse; + return OFTrue; +} + +OFBool DVConfiguration::getTargetPrinterSessionLabelAnnotation(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_SESSIONLABELANNOTATION, OFFalse); +} + +const char *DVConfiguration::getTargetPrinterAnnotationDisplayFormatID(const char *targetID, OFString& value) +{ + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_ANNOTATION), 1, value); + if (value.length()) return value.c_str(); else return NULL; +} + +Uint16 DVConfiguration::getTargetPrinterAnnotationPosition(const char *targetID) +{ + OFString value; + copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_ANNOTATION), 0, value); + if (value.length()) + { + Uint16 result = 0; + if (1 == sscanf(value.c_str(), "%hu", &result)) return result; + } + return 0; +} + +const char *DVConfiguration::getTLSFolder() +{ + return getConfigEntry(L2_GENERAL, L1_TLS, L0_TLSDIRECTORY); +} + +const char *DVConfiguration::getTLSCACertificateFolder() +{ + return getConfigEntry(L2_GENERAL, L1_TLS, L0_CACERTIFICATEDIRECTORY); +} + +OFBool DVConfiguration::getTLSPEMFormat() +{ + return getConfigBoolEntry(L2_GENERAL, L1_TLS, L0_USEPEMFORMAT, OFTrue); +} + +OFBool DVConfiguration::getTargetBitPreservingMode(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_BITPRESERVINGMODE, OFFalse); +} + +OFBool DVConfiguration::getTargetCorrectUIDPadding(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_CORRECTUIDPADDING, OFFalse); +} + +OFBool DVConfiguration::getTargetUseTLS(const char *targetID) +{ + return getConfigBoolEntry(L2_COMMUNICATION, targetID, L0_USETLS, OFFalse); +} + +const char *DVConfiguration::getTargetCertificate(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_CERTIFICATE); +} + +const char *DVConfiguration::getTargetPrivateKey(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_PRIVATEKEY); +} + +const char *DVConfiguration::getTargetPrivateKeyPassword(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_PRIVATEKEYPASSWORD); +} + +const char *DVConfiguration::getTargetTLSProfile(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_TLSPROFILE); +} + +DVPSCertificateVerificationType DVConfiguration::getTargetPeerAuthentication(const char *targetID) +{ + DVPSCertificateVerificationType result = DVPSQ_require; + const char *c = getConfigEntry(L2_COMMUNICATION, targetID, L0_PEERAUTHENTICATION); + if (c != NULL) + { + if (strCompare(c, "REQUIRE", 7) == 0) + result = DVPSQ_require; + else if (strCompare(c, "VERIFY", 6) == 0) + result = DVPSQ_verify; + else if (strCompare(c, "IGNORE", 6) == 0) + result = DVPSQ_ignore; + } + return result; +} + +const char *DVConfiguration::getTargetDiffieHellmanParameters(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_DIFFIEHELLMANPARAMETERS); +} + +const char *DVConfiguration::getTargetRandomSeed(const char *targetID) +{ + return getConfigEntry(L2_COMMUNICATION, targetID, L0_RANDOMSEED); +} + +const char *DVConfiguration::getUserCertificateFolder() +{ + return getConfigEntry(L2_GENERAL, L1_TLS, L0_USERKEYDIRECTORY); +} + +Uint32 DVConfiguration::getNumberOfUsers() +{ + Uint32 result = 0; + if (pConfig) + { + pConfig->set_section(2, L2_USERS); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while (pConfig->section_valid(1)) + { + result++; + pConfig->next_section(1); + } + } + } + return result; +} + +const char *DVConfiguration::getUserID(Uint32 idx) +{ + OFBool found = OFFalse; + const char *result=NULL; + if (pConfig) + { + pConfig->set_section(2, L2_USERS); + if (pConfig->section_valid(2)) + { + pConfig->first_section(1); + while ((! found)&&(pConfig->section_valid(1))) + { + if (idx==0) found=OFTrue; + else + { + idx--; + pConfig->next_section(1); + } + } + if (pConfig->section_valid(1)) result = pConfig->get_keyword(1); + } + } + return result; +} + +const char *DVConfiguration::getUserLogin(const char *userID) +{ + return getConfigEntry(L2_USERS, userID, L0_LOGIN); +} + +const char *DVConfiguration::getUserName(const char *userID) +{ + return getConfigEntry(L2_USERS, userID, L0_NAME); +} + +const char *DVConfiguration::getUserDICOMName(const char *userID) +{ + return getConfigEntry(L2_USERS, userID, L0_DICOMNAME); +} + +const char *DVConfiguration::getUserCertificate(const char *userID) +{ + return getConfigEntry(L2_USERS, userID, L0_CERTIFICATE); +} + +const char *DVConfiguration::getUserPrivateKey(const char *userID) +{ + return getConfigEntry(L2_USERS, userID, L0_PRIVATEKEY); +} + +const char *DVConfiguration::getUserOrganization(const char *userID) +{ + return getConfigEntry(L2_USERS, userID, L0_ORGANIZATION); +} + +const char *DVConfiguration::getUserCodingSchemeDesignator(const char *userID, OFString& value) +{ + copyValue(getConfigEntry(L2_USERS, userID, L0_CODE), 0, value); + if (value.length()) return value.c_str(); else return NULL; +} + +const char *DVConfiguration::getUserCodingSchemeVersion(const char *userID, OFString& value) +{ + copyValue(getConfigEntry(L2_USERS, userID, L0_CODE), 1, value); + if (value.length()) return value.c_str(); else return NULL; +} + +const char *DVConfiguration::getUserCodeValue(const char *userID, OFString& value) +{ + copyValue(getConfigEntry(L2_USERS, userID, L0_CODE), 2, value); + if (value.length()) return value.c_str(); else return NULL; +} + +const char *DVConfiguration::getUserCodeMeaning(const char *userID, OFString& value) +{ + copyValue(getConfigEntry(L2_USERS, userID, L0_CODE), 3, value); + if (value.length()) return value.c_str(); else return NULL; +} diff --git a/dcmpstat/libsrc/dvpscu.cc b/dcmpstat/libsrc/dvpscu.cc new file mode 100644 index 00000000..f5efccf6 --- /dev/null +++ b/dcmpstat/libsrc/dvpscu.cc @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 1998-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSCurve + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpscu.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/ofstd/ofbmanip.h" + +DVPSCurve::DVPSCurve() +: curveGroup(0) +, numberOfPoints(0) +, typeOfData(DVPSL_polylineCurve) +, curveData(NULL) +, curveDescription() +, curveLabel() +, axisUnitsX() +, axisUnitsY() +{ +} + +DVPSCurve::DVPSCurve(const DVPSCurve& copy) +: curveGroup(copy.curveGroup) +, numberOfPoints(copy.numberOfPoints) +, typeOfData(copy.typeOfData) +, curveData(NULL) +, curveDescription(copy.curveDescription) +, curveLabel(copy.curveLabel) +, axisUnitsX(copy.axisUnitsX) +, axisUnitsY(copy.axisUnitsY) +{ + if (copy.curveData) + { + curveData = new double[2*numberOfPoints]; + if (curveData) + { + OFBitmanipTemplate::copyMem(copy.curveData, curveData, 2*numberOfPoints); + } + } +} + +DVPSCurve::~DVPSCurve() +{ + if (curveData) delete[] curveData; +} + + +OFCondition DVPSCurve::read(DcmItem &dset, Uint8 group) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + curveGroup = group; + DcmElement *d_curveDimensions = NULL; + DcmElement *d_numberOfPoints = NULL; + DcmElement *d_typeOfData = NULL; + DcmElement *d_dataVR = NULL; + DcmElement *d_curveData = NULL; + DcmElement *d_curveDescription = NULL; + DcmElement *d_axisUnits = NULL; + DcmElement *d_curveLabel = NULL; + + /* first we look for the Curve Data */ + DcmTagKey key(0x5000 + group,0x3000); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_curveData = (DcmElement *)(stack.top()); + } else return EC_IllegalCall; + + key.setElement(0x0005); // Curve Dimensions + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_curveDimensions = (DcmElement *)(stack.top()); + } else return EC_IllegalCall; + + key.setElement(0x0110); // Curve Data Descriptor + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + return EC_IllegalCall; // we don't support curves with Curve Data Descriptor! + } + + key.setElement(0x0010); // Number of Points + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_numberOfPoints = (DcmElement *)(stack.top()); + } else return EC_IllegalCall; + + key.setElement(0x0020); // Type of Data + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_typeOfData = (DcmElement *)(stack.top()); + } else return EC_IllegalCall; + + key.setElement(0x0103); // Data Value Representation + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_dataVR = (DcmElement *)(stack.top()); + } else return EC_IllegalCall; + + key.setElement(0x0022); // Curve Description + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_curveDescription = (DcmElement *)(stack.top()); + } + + key.setElement(0x0030); // Axis Units + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_axisUnits = (DcmElement *)(stack.top()); + } + + key.setElement(0x2500); // Curve Label + stack.clear(); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + d_curveLabel = (DcmElement *)(stack.top()); + } + + Uint16 u=0; + if ((EC_Normal != d_curveDimensions->getUint16(u,0))||(u != 2)) + { + // Curve Dimensions unreadable or != 2, bail out + return EC_IllegalCall; + } + + u=0; + if ((EC_Normal != d_numberOfPoints->getUint16(u,0))||(u == 0)) + { + // Number of Points == 0 or unreadable, bail out. + return EC_IllegalCall; + } else numberOfPoints = u; + + OFString aString; + if (EC_Normal != d_typeOfData->getOFString(aString,0)) + { + // cannot read type of data, bail out + return EC_IllegalCall; + } else { + if (aString == "ROI") typeOfData=DVPSL_roiCurve; + else if (aString == "POLY") typeOfData=DVPSL_polylineCurve; + else return EC_IllegalCall; // unsupported type of data, bail out + } + + if ((d_curveDescription) &&(EC_Normal == d_curveDescription->getOFString(aString,0))) + { + curveDescription = aString; + } + + if ((d_axisUnits) &&(EC_Normal == d_axisUnits->getOFString(aString,0))) + { + axisUnitsX = aString; + } + if ((d_axisUnits) &&(EC_Normal == d_axisUnits->getOFString(aString,1))) + { + axisUnitsY = aString; + } + + if ((d_curveLabel) &&(EC_Normal == d_curveLabel->getOFString(aString,0))) + { + curveLabel = aString; + } + + Uint16 dataVR=0; + if (EC_Normal != d_dataVR->getUint16(dataVR,0)) + { + // cannot read curve data VR, bail out + return EC_IllegalCall; + } + + curveData = new double[numberOfPoints*2]; + if (curveData==NULL) return EC_MemoryExhausted; + + void *rawData=NULL; + size_t align=0; + + Uint8 *pui8=NULL; + Uint16 *pui16=NULL; + Sint16 *psi16=NULL; + Float32 *pfl32=NULL; + Float64 *pfl64=NULL; + Sint32 *psi32=NULL; + switch (d_curveData->ident()) + { + case EVR_OB: + case EVR_OW: + case EVR_ox: + case EVR_US: + + if (EC_Normal == d_curveData->getUint8Array(pui8)) + { + rawData = pui8; + align = 1; + } + else if (EC_Normal == d_curveData->getUint16Array(pui16)) + { + rawData = pui16; + align = sizeof(Uint16); + } + else result = EC_IllegalCall; + break; + case EVR_SS: + if (EC_Normal == d_curveData->getSint16Array(psi16)) + { + rawData = psi16; + align = sizeof(Sint16); + } else result = EC_IllegalCall; + break; + case EVR_FL: + if (EC_Normal == d_curveData->getFloat32Array(pfl32)) + { + rawData = pfl32; + align = sizeof(Float32); + } else result = EC_IllegalCall; + break; + case EVR_FD: + if (EC_Normal == d_curveData->getFloat64Array(pfl64)) + { + rawData = pfl64; + align = sizeof(Float64); + } else result = EC_IllegalCall; + break; + case EVR_SL: + if (EC_Normal == d_curveData->getSint32Array(psi32)) + { + rawData = psi32; + align = sizeof(Sint32); + } else result = EC_IllegalCall; + break; + default: + result = EC_IllegalCall; + break; + } + + size_t byteLength = (size_t)(d_curveData->getLength()); + size_t maxidx = 2*numberOfPoints; + size_t i; + + switch (dataVR) + { + case 0: // VR=US. align can be 1 or 2 + if ((align==1)||(align==sizeof(Uint16))) + { + if (align==1) swapIfNecessary(gLocalByteOrder, EBO_LittleEndian, rawData, OFstatic_cast(Uint32, byteLength), sizeof(Uint16)); + if (maxidx*sizeof(Uint16) <= byteLength) + { + for (i=0; iclone()); + ++first; + } +} + +DVPSCurve_PList::~DVPSCurve_PList() +{ + clear(); +} + +void DVPSCurve_PList::clear() +{ + OFListIterator(DVPSCurve *) first = list_.begin(); + OFListIterator(DVPSCurve *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSCurve_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DVPSCurve *newCurve = NULL; + + for (Uint8 i=0; i<16; i+=2) + { + newCurve = new DVPSCurve(); + if (newCurve) + { + result = newCurve->read(dset,i); + if (result==EC_Normal) list_.push_back(newCurve); else delete newCurve; + } else return EC_MemoryExhausted; + } + return EC_Normal; +} + + +OFBool DVPSCurve_PList::haveCurveGroup(Uint16 group) +{ + if (getCurveGroup(group)) return OFTrue; else return OFFalse; +} + + +DVPSCurve *DVPSCurve_PList::getCurveGroup(Uint16 group) +{ + Uint8 lowergroup = (Uint8)(group & 0x00FF); + OFListIterator(DVPSCurve *) first = list_.begin(); + OFListIterator(DVPSCurve *) last = list_.end(); + while (first != last) + { + if ((*first)->getCurveGroup() == lowergroup) return *first; + ++first; + } + return NULL; +} + +DVPSCurve *DVPSCurve_PList::getCurve(size_t idx) +{ + OFListIterator(DVPSCurve *) first = list_.begin(); + OFListIterator(DVPSCurve *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} diff --git a/dcmpstat/libsrc/dvpsda.cc b/dcmpstat/libsrc/dvpsda.cc new file mode 100644 index 00000000..17ef491a --- /dev/null +++ b/dcmpstat/libsrc/dvpsda.cc @@ -0,0 +1,442 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSDisplayedArea + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmpstat/dvpsda.h" +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage */ +#include "dcmtk/dcmpstat/dvpsrsl.h" /* DVPSReferencedSeries_PList */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ + +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +/* --------------- class DVPSDisplayedArea --------------- */ + +DVPSDisplayedArea::DVPSDisplayedArea() +: referencedImageList() +, displayedAreaTopLeftHandCorner(DCM_DisplayedAreaTopLeftHandCorner) +, displayedAreaBottomRightHandCorner(DCM_DisplayedAreaBottomRightHandCorner) +, presentationSizeMode(DCM_PresentationSizeMode) +, presentationPixelSpacing(DCM_PresentationPixelSpacing) +, presentationPixelAspectRatio(DCM_PresentationPixelAspectRatio) +, presentationPixelMagnificationRatio(DCM_PresentationPixelMagnificationRatio) +{ +} + +DVPSDisplayedArea::DVPSDisplayedArea(const DVPSDisplayedArea& copy) +: referencedImageList(copy.referencedImageList) +, displayedAreaTopLeftHandCorner(copy.displayedAreaTopLeftHandCorner) +, displayedAreaBottomRightHandCorner(copy.displayedAreaBottomRightHandCorner) +, presentationSizeMode(copy.presentationSizeMode) +, presentationPixelSpacing(copy.presentationPixelSpacing) +, presentationPixelAspectRatio(copy.presentationPixelAspectRatio) +, presentationPixelMagnificationRatio(copy.presentationPixelMagnificationRatio) +{ +} + +DVPSDisplayedArea::~DVPSDisplayedArea() +{ +} + +OFCondition DVPSDisplayedArea::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + OFString aString; + + READ_FROM_DATASET(DcmSignedLong, EVR_SL, displayedAreaTopLeftHandCorner) + READ_FROM_DATASET(DcmSignedLong, EVR_SL, displayedAreaBottomRightHandCorner) + READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationSizeMode) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, presentationPixelSpacing) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, presentationPixelAspectRatio) + READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, presentationPixelMagnificationRatio) + + if (result==EC_Normal) result = referencedImageList.read(dset); + + /* Now perform basic sanity checks */ + + if (displayedAreaTopLeftHandCorner.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with displayedAreaTopLeftHandCorner absent or empty"); + } + else if (displayedAreaTopLeftHandCorner.getVM() != 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with displayedAreaTopLeftHandCorner VM != 2"); + } + + if (displayedAreaBottomRightHandCorner.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with displayedAreaBottomRightHandCorner absent or empty"); + } + else if (displayedAreaBottomRightHandCorner.getVM() != 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with displayedAreaBottomRightHandCorner VM != 2"); + } + + if (presentationSizeMode.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with presentationSizeMode absent or empty"); + } + else if (presentationSizeMode.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with presentationSizeMode VM != 1"); + } else { + aString.clear(); + presentationSizeMode.getOFString(aString,0); + if (aString=="TRUE SIZE") + { + if (presentationPixelSpacing.getVM() != 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with mode 'TRUE SIZE' but presentationPixelSpacing VM != 2"); + } + } else if (aString == "MAGNIFY") + { + if (presentationPixelMagnificationRatio.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with mode 'MAGNIFY' but presentationPixelSpacing VM != 1"); + } + } else if (aString != "SCALE TO FIT") + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with unknown presentation size mode: " << aString); + } + } + + if ((presentationPixelSpacing.getLength() > 0)&&(presentationPixelSpacing.getVM() != 2)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with presentationPixelSpacing VM != 2"); +} + + if ((presentationPixelAspectRatio.getLength() > 0)&&(presentationPixelAspectRatio.getVM() != 2)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with presentationPixelAspectRatio VM != 2"); + } + + if ((presentationPixelMagnificationRatio.getLength() > 0)&&(presentationPixelMagnificationRatio.getVM() != 1)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with presentationPixelMagnificationRatio VM != 1"); + } + + if ((presentationPixelSpacing.getLength() == 0)&&(presentationPixelAspectRatio.getVM() != 2)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a display area selection SQ item with both presentationPixelSpacing and presentationPixelAspectRatio missing/incorrect"); + } + + return result; +} + +OFCondition DVPSDisplayedArea::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + if ((presentationPixelSpacing.getLength()==0)&&(presentationPixelAspectRatio.getLength()==0)) + presentationPixelAspectRatio.putString("1\\1"); + + ADD_TO_DATASET(DcmSignedLong, displayedAreaTopLeftHandCorner) + ADD_TO_DATASET(DcmSignedLong, displayedAreaBottomRightHandCorner) + ADD_TO_DATASET(DcmCodeString, presentationSizeMode) + if (presentationPixelSpacing.getLength() >0) { ADD_TO_DATASET(DcmDecimalString, presentationPixelSpacing) } + if (presentationPixelAspectRatio.getLength() >0) { ADD_TO_DATASET(DcmIntegerString, presentationPixelAspectRatio) } + if (presentationPixelMagnificationRatio.getLength() >0) { ADD_TO_DATASET(DcmFloatingPointSingle, presentationPixelMagnificationRatio) } + if ((result == EC_Normal)&&(referencedImageList.size() >0)) result = referencedImageList.write(dset); + + return result; +} + +OFBool DVPSDisplayedArea::isApplicable(const char *instanceUID, unsigned long frame) +{ + return referencedImageList.isApplicable(instanceUID, frame); +} + +OFBool DVPSDisplayedArea::matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability) +{ + return referencedImageList.matchesApplicability(instanceUID, frame, applicability); +} + +void DVPSDisplayedArea::removeImageReference( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability) +{ + referencedImageList.removeImageReference(allReferences, instanceUID, frame, numberOfFrames, applicability); + return; +} + +DVPSPresentationSizeMode DVPSDisplayedArea::getPresentationSizeMode() +{ + OFString aString; + presentationSizeMode.getOFString(aString,0); + if (aString=="TRUE SIZE") return DVPSD_trueSize; + else if (aString=="MAGNIFY") return DVPSD_magnify; + return DVPSD_scaleToFit; +} + +double DVPSDisplayedArea::getPresentationPixelAspectRatio() +{ + double result = 1.0; // default in case something goes wrong + if (presentationPixelSpacing.getVM() == 2) + { + Float64 flX=0.0; + Float64 flY=0.0; + presentationPixelSpacing.getFloat64(flY, 0); + presentationPixelSpacing.getFloat64(flX, 1); + if (flY != 0.0) result = flX/flY; + } + else if (presentationPixelAspectRatio.getVM() == 2) + { + Sint32 siX=0; + Sint32 siY=0; + presentationPixelAspectRatio.getSint32(siY, 0); + presentationPixelAspectRatio.getSint32(siX, 1); + if (siY != 0) result = ((double)siX) / ((double)siY); + } + return result; +} + +void DVPSDisplayedArea::getDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY) +{ + if (EC_Normal != displayedAreaTopLeftHandCorner.getSint32(tlhcX, 0)) tlhcX = 0; + if (EC_Normal != displayedAreaTopLeftHandCorner.getSint32(tlhcY, 1)) tlhcY = 0; + if (EC_Normal != displayedAreaBottomRightHandCorner.getSint32(brhcX, 0)) brhcX = 0; + if (EC_Normal != displayedAreaBottomRightHandCorner.getSint32(brhcY, 1)) brhcY = 0; + return; +} + +OFCondition DVPSDisplayedArea::getPresentationPixelSpacing(double& x, double& y) +{ + if (presentationPixelSpacing.getVM() == 2) + { + Float64 psX=0.0; + Float64 psY=0.0; + // presentationPixelSpacing uses the format row_spacing\\col_spacing + presentationPixelSpacing.getFloat64(psY, 0); + presentationPixelSpacing.getFloat64(psX, 1); + x = psX; + y = psY; + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPSDisplayedArea::getPresentationPixelMagnificationRatio(double& magnification) +{ + if (presentationPixelMagnificationRatio.getVM() == 1) + { + Float32 mag=0.0; + presentationPixelMagnificationRatio.getFloat32(mag, 0); + magnification = (double)mag; + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPSDisplayedArea::addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability) +{ + return referencedImageList.addImageReference(sopclassUID, instanceUID, frame, applicability); +} + +OFBool DVPSDisplayedArea::canUseTrueSize() +{ + if (presentationPixelSpacing.getVM() == 2) return OFTrue; else return OFFalse; +} + +OFCondition DVPSDisplayedArea::setDisplayedAreaPixelSpacing(double spacingX, double spacingY) +{ + char str[66]; + OFStandard::ftoa(str, 32, spacingY, OFStandard::ftoa_format_f); + OFStandard::strlcat(str, "\\", 66); + OFStandard::ftoa(strchr(str, 0), 32, spacingX, OFStandard::ftoa_format_f); + + return setDisplayedAreaPixelSpacing(str); +} + +OFCondition DVPSDisplayedArea::setDisplayedAreaPixelSpacing(const char *spacing) +{ + if (spacing==NULL) return EC_IllegalCall; + presentationPixelAspectRatio.clear(); + OFCondition result = presentationPixelSpacing.putString(spacing); + if (EC_Normal == result) + { + Float64 fl=0.0; + presentationPixelSpacing.getFloat64(fl, 0); + if (fl == 0.0) result = EC_IllegalCall; + else if (fl < 0) presentationPixelSpacing.putFloat64(-fl, 0); // silently correct negative values + fl =0.0; + presentationPixelSpacing.getFloat64(fl, 1); + if (fl == 0.0) result = EC_IllegalCall; + else if (fl < 0) presentationPixelSpacing.putFloat64(-fl, 1); // silently correct negative values + } + if (EC_Normal != result) presentationPixelSpacing.clear(); + return result; +} + +OFCondition DVPSDisplayedArea::setDisplayedAreaPixelAspectRatio(double ratio) +{ + char str[100]; + sprintf(str, "10000\\%ld", (long)(ratio*10000.0)); + return setDisplayedAreaPixelAspectRatio(str); +} + +OFCondition DVPSDisplayedArea::setDisplayedAreaPixelAspectRatio(const char *ratio) +{ + if (ratio==NULL) return EC_IllegalCall; + presentationPixelSpacing.clear(); + + OFCondition result = presentationPixelAspectRatio.putString(ratio); + if (EC_Normal == result) + { + Sint32 si=0; + presentationPixelAspectRatio.getSint32(si, 0); + if (si == 0) result = EC_IllegalCall; + else if (si < 0) presentationPixelAspectRatio.putSint32(-si, 0); // silently correct negative values + si = 0; + presentationPixelAspectRatio.getSint32(si, 1); + if (si == 0) result = EC_IllegalCall; + else if (si < 0) presentationPixelAspectRatio.putSint32(-si, 1); // silently correct negative values + } + if (EC_Normal != result) presentationPixelAspectRatio.clear(); + return result; +} + +OFCondition DVPSDisplayedArea::setDisplayedArea( + DVPSPresentationSizeMode sizeMode, + Sint32 tlhcX, + Sint32 tlhcY, + Sint32 brhcX, + Sint32 brhcY, + double magnification) +{ + OFCondition result = EC_Normal; + switch (sizeMode) + { + case DVPSD_scaleToFit: + result = presentationSizeMode.putString("SCALE TO FIT"); + if (EC_Normal == result) presentationPixelMagnificationRatio.clear(); + break; + case DVPSD_trueSize: + if (! canUseTrueSize()) return EC_IllegalCall; + result = presentationSizeMode.putString("TRUE SIZE"); + if (EC_Normal == result) presentationPixelMagnificationRatio.clear(); + break; + case DVPSD_magnify: + if (magnification == 0.0) return EC_IllegalCall; + result = presentationSizeMode.putString("MAGNIFY"); + if (EC_Normal == result) presentationPixelMagnificationRatio.clear(); + if (EC_Normal == result) result = presentationPixelMagnificationRatio.putFloat32((Float32)magnification,0); + break; + } + if (EC_Normal == result) result = displayedAreaTopLeftHandCorner.putSint32(tlhcX,0); + if (EC_Normal == result) result = displayedAreaTopLeftHandCorner.putSint32(tlhcY,1); + if (EC_Normal == result) result = displayedAreaBottomRightHandCorner.putSint32(brhcX,0); + if (EC_Normal == result) result = displayedAreaBottomRightHandCorner.putSint32(brhcY,1); + return result; +} + +void DVPSDisplayedArea::switchHorizontalCorners() +{ + Sint32 tlhcX = 0; + Sint32 brhcX = 0; + + displayedAreaTopLeftHandCorner.getSint32(tlhcX, 0); + displayedAreaBottomRightHandCorner.getSint32(brhcX, 0); + + displayedAreaTopLeftHandCorner.putSint32(brhcX,0); + displayedAreaBottomRightHandCorner.putSint32(tlhcX,0); +} + +void DVPSDisplayedArea::switchVerticalCorners() +{ + Sint32 tlhcY = 0; + Sint32 brhcY = 0; + + displayedAreaTopLeftHandCorner.getSint32(tlhcY, 1); + displayedAreaBottomRightHandCorner.getSint32(brhcY, 1); + + displayedAreaTopLeftHandCorner.putSint32(brhcY,1); + displayedAreaBottomRightHandCorner.putSint32(tlhcY,1); +} + +void DVPSDisplayedArea::rotateAndFlipFromOrTo(DVPSRotationType rotation, OFBool isFlipped) +{ + switch (rotation) + { + case DVPSR_0_deg: + if (isFlipped) switchHorizontalCorners(); + break; + case DVPSR_90_deg: + if (!isFlipped) switchVerticalCorners(); + break; + case DVPSR_180_deg: + if (isFlipped) + switchVerticalCorners(); + else + { + switchHorizontalCorners(); + switchVerticalCorners(); + } + break; + case DVPSR_270_deg: + if (isFlipped) + { + switchHorizontalCorners(); + switchVerticalCorners(); + } + else switchHorizontalCorners(); + break; + } +} + +void DVPSDisplayedArea::rotateAndFlip( + DVPSRotationType rotationFrom, + OFBool isFlippedFrom, + DVPSRotationType rotationTo, + OFBool isFlippedTo) +{ + // restore original coordinates (no rotation, no flipping) + rotateAndFlipFromOrTo(rotationFrom, isFlippedFrom); + + // create new coordinates + rotateAndFlipFromOrTo(rotationTo, isFlippedTo); +} diff --git a/dcmpstat/libsrc/dvpsdal.cc b/dcmpstat/libsrc/dvpsdal.cc new file mode 100644 index 00000000..519aa977 --- /dev/null +++ b/dcmpstat/libsrc/dvpsdal.cc @@ -0,0 +1,198 @@ +/* + * + * Copyright (C) 1999-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSDisplayedArea_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsdal.h" +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + + +DVPSDisplayedArea_PList::DVPSDisplayedArea_PList() +: list_() +{ +} + +DVPSDisplayedArea_PList::DVPSDisplayedArea_PList(const DVPSDisplayedArea_PList &arg) +: list_() +{ + OFListConstIterator(DVPSDisplayedArea *) first = arg.list_.begin(); + OFListConstIterator(DVPSDisplayedArea *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSDisplayedArea_PList::~DVPSDisplayedArea_PList() +{ + clear(); +} + +void DVPSDisplayedArea_PList::clear() +{ + OFListIterator(DVPSDisplayedArea *) first = list_.begin(); + OFListIterator(DVPSDisplayedArea *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSDisplayedArea_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSDisplayedArea *newImage = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_DisplayedAreaSelectionSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newImage = new DVPSDisplayedArea(); + if (newImage && ditem) + { + result = newImage->read(*ditem); + list_.push_back(newImage); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSDisplayedArea_PList::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_DisplayedAreaSelectionSequence); + if (dseq) + { + OFListIterator(DVPSDisplayedArea *) first = list_.begin(); + OFListIterator(DVPSDisplayedArea *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + +DVPSDisplayedArea *DVPSDisplayedArea_PList::findDisplayedArea(const char *instanceUID, unsigned long frame) +{ + OFListIterator(DVPSDisplayedArea *) first = list_.begin(); + OFListIterator(DVPSDisplayedArea *) last = list_.end(); + while (first != last) + { + if ((*first)->isApplicable(instanceUID, frame)) return (*first); + ++first; + } + return NULL; +} + +void DVPSDisplayedArea_PList::rotateAndFlip( + DVPSRotationType rotationFrom, + OFBool isFlippedFrom, + DVPSRotationType rotationTo, + OFBool isFlippedTo) +{ + OFListIterator(DVPSDisplayedArea *) first = list_.begin(); + OFListIterator(DVPSDisplayedArea *) last = list_.end(); + while (first != last) + { + (*first)->rotateAndFlip(rotationFrom, isFlippedFrom, rotationTo, isFlippedTo); + ++first; + } +} + +DVPSDisplayedArea *DVPSDisplayedArea_PList::createDisplayedArea( + DVPSReferencedSeries_PList& allReferences, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability) +{ + + DVPSDisplayedArea *oldArea = findDisplayedArea(instanceUID, frame); + DVPSDisplayedArea *newArea = NULL; + if (oldArea == NULL) newArea = new DVPSDisplayedArea(); + else + { + // Check if the existing displayed area selection happens to match the new + // applicability. If yes, we only need to return the existing item. + if (oldArea->matchesApplicability(instanceUID, frame, applicability)) return oldArea; + + // the applicability has changed. Rework the complete sequence. + newArea = new DVPSDisplayedArea(*oldArea); // create copy + if (newArea) newArea->clearImageReferences(); + + OFListIterator(DVPSDisplayedArea *) first = list_.begin(); + OFListIterator(DVPSDisplayedArea *) last = list_.end(); + switch (applicability) + { + case DVPSB_currentFrame: + case DVPSB_currentImage: + while (first != last) + { + (*first)->removeImageReference(allReferences, instanceUID, frame, numberOfFrames, applicability); + if ((*first)->imageReferencesEmpty()) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + break; + case DVPSB_allImages: + clear(); // delete all area selections + break; + } + } + + if (newArea) + { + if (applicability != DVPSB_allImages) newArea->addImageReference(sopclassUID, instanceUID, frame, applicability); + list_.push_back(newArea); + } + return newArea; +} diff --git a/dcmpstat/libsrc/dvpsfs.cc b/dcmpstat/libsrc/dvpsfs.cc new file mode 100644 index 00000000..b4d6598f --- /dev/null +++ b/dcmpstat/libsrc/dvpsfs.cc @@ -0,0 +1,834 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSFilmSession + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsfs.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpshlp.h" +#include "dcmtk/dcmpstat/dvpscf.h" +#include "dcmtk/dcmpstat/dvpspl.h" +#include "dcmtk/dcmpstat/dvpspll.h" +#include "dcmtk/dcmpstat/dvpssp.h" +#include "dcmtk/dcmpstat/dvpsspl.h" + +#include "dcmtk/dcmpstat/dvpsib.h" /* for DVPSImageBoxContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsab.h" /* for DVPSAnnotationContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + + +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +/* --------------- class DVPSFilmSession --------------- */ + +DVPSFilmSession::DVPSFilmSession(Uint16 illumin, Uint16 reflection) +: sopInstanceUID(NULL) +, numberOfCopies(DCM_NumberOfCopies) +, printPriority(DCM_PrintPriority) +, mediumType(DCM_MediumType) +, filmDestination(DCM_FilmDestination) +, filmSessionLabel(DCM_FilmSessionLabel) +, ownerID(DCM_OwnerID) +, illumination(DCM_Illumination) +, reflectedAmbientLight(DCM_ReflectedAmbientLight) +, referencedPresentationLUTInstanceUID(DCM_ReferencedSOPInstanceUID) +, referencedPresentationLUTAlignment(DVPSK_other) +{ + illumination.putUint16(illumin, 0); + reflectedAmbientLight.putUint16(reflection, 0); +} + +DVPSFilmSession::DVPSFilmSession(const DVPSFilmSession& copy) +: sopInstanceUID(copy.sopInstanceUID) +, numberOfCopies(copy.numberOfCopies) +, printPriority(copy.printPriority) +, mediumType(copy.mediumType) +, filmDestination(copy.filmDestination) +, filmSessionLabel(copy.filmSessionLabel) +, ownerID(copy.ownerID) +, illumination(copy.illumination) +, reflectedAmbientLight(copy.reflectedAmbientLight) +, referencedPresentationLUTInstanceUID(copy.referencedPresentationLUTInstanceUID) +, referencedPresentationLUTAlignment(copy.referencedPresentationLUTAlignment) +{ +} + +DVPSFilmSession::~DVPSFilmSession() +{ +} + +OFBool DVPSFilmSession::isInstance(const char *uid) +{ + if (uid && (sopInstanceUID == uid)) return OFTrue; + return OFFalse; +} + +OFBool DVPSFilmSession::printSCPCreate( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + const char *peerae, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList) +{ + OFBool result = OFTrue; + DcmStack stack; + sopInstanceUID = rsp.msg.NCreateRSP.AffectedSOPInstanceUID; + + // numberOfCopies + if (result) + { + READ_FROM_PDATASET(DcmIntegerString, EVR_IS, numberOfCopies) + if (numberOfCopies.getLength() == 0) numberOfCopies.putString(DEFAULT_numberOfCopies); + else + { + Sint32 numCopies=0; + char *numCopiesString=NULL; + if ((EC_Normal != numberOfCopies.getSint32(numCopies)) || (numCopies < 1)) + { + numberOfCopies.getString(numCopiesString); + if (numCopiesString==NULL) numCopiesString = (char *)""; + DCMPSTAT_WARN("cannot create Basic Film Session: illegal number of copies: '" << numCopiesString << "'"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } + + // printPriority + if (result) + { + READ_FROM_PDATASET(DcmCodeString, EVR_CS, printPriority) + if (printPriority.getLength() == 0) printPriority.putString(DEFAULT_priority); + else + { + OFString aString; + printPriority.getOFString(aString, 0, OFTrue); + if ((aString != "HIGH")&&(aString != "MED")&&(aString != "LOW")) + { + DCMPSTAT_WARN("cannot create Basic Film Session: illegal print priority: '" << aString.c_str() << "'"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } + + // mediumType + if (result) + { + Uint32 numMediumTypes = cfg.getTargetPrinterNumberOfMediumTypes(cfgname); + READ_FROM_PDATASET(DcmCodeString, EVR_CS, mediumType) + if (mediumType.getLength() == 0) + { + if (numMediumTypes > 0) + { + OFString aString; + cfg.getTargetPrinterMediumType(cfgname, 0, aString); + mediumType.putString(aString.c_str()); + } else { + mediumType.putString(DEFAULT_mediumType); + } + } else { + // check whether we can accept the proposed medium type + OFString theMedium; + OFString aString; + OFBool found = OFFalse; + mediumType.getOFString(theMedium, 0, OFTrue); + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterFilmDestination(cfgname, 0, aString); + filmDestination.putString(aString.c_str()); + } else { + filmDestination.putString(DEFAULT_filmDestination); + } + } else { + // check whether we can accept the proposed medium type + OFString theDestination; + OFString aString; + OFBool found = OFFalse; + filmDestination.getOFString(theDestination, 0, OFTrue); + for (Uint32 i=0; isearch(DCM_ReferencedPresentationLUTSequence, stack, ESM_fromHere, OFFalse))) + { + DcmSequenceOfItems *seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + OFString aString; + DcmItem *item = seq->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID) + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + referencedPresentationLUTInstanceUID.getOFString(aString,0); + DVPSPresentationLUT *currentPLUT = globalPresentationLUTList.findPresentationLUT(aString.c_str()); + if (NULL == currentPLUT) + { + DCMPSTAT_WARN("cannot create Basic Film Session: presentation LUT reference cannot be resolved"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // check referenced SOP class UID + DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID) + if (refClassUID.getLength() > 0) + { + aString.clear(); + refClassUID.getOFString(aString,0, OFTrue); + if (aString != UID_PresentationLUTSOPClass) + { + DCMPSTAT_WARN("cannot create Basic Film Session: referenced SOP class UID in referenced presentation LUT sequence incorrect:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // referenced presentation LUT sequence is OK + referencedPresentationLUTAlignment = currentPLUT->getAlignment(); + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Session: no referenced SOP class UID in referenced presentation LUT sequence"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Session: no referenced SOP instance UID in referenced presentation LUT sequence"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Session: referenced presentation LUT sequence number of items != 1"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } + + } /* if presentationLUTnegotiated */ + + // browse through rqDataset and check for unsupported attributes + if (result && rqDataset) + { + OFBool intoSub = OFTrue; + stack.clear(); + while (EC_Normal == rqDataset->nextObject(stack, intoSub)) + { + intoSub = OFFalse; + const DcmTagKey& currentTag = (stack.top())->getTag(); + if (currentTag.getElement() == 0x0000) /* group length */ ; + else if (currentTag == DCM_NumberOfCopies) /* OK */ ; + else if (currentTag == DCM_PrintPriority) /* OK */ ; + else if (currentTag == DCM_MediumType) /* OK */ ; + else if (currentTag == DCM_FilmDestination) /* OK */ ; + else if (currentTag == DCM_FilmSessionLabel) /* OK */ ; + else if (currentTag == DCM_OwnerID) /* OK */ ; + else if (currentTag == DCM_MemoryAllocation) + { + DCMPSTAT_WARN("warning while creating Basic Film Session: memory allocation not supported:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + if (rsp.msg.NCreateRSP.DimseStatus == 0) rsp.msg.NCreateRSP.DimseStatus = STATUS_N_PRINT_BFS_Warn_MemoryAllocation; + } + else if (currentTag == DCM_Illumination) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot create Basic Film Session: illumination received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReflectedAmbientLight) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot create Basic Film Session: reflected ambient light received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReferencedPresentationLUTSequence) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot create Basic Film Session: referenced presentation LUT sequence received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else + { + DCMPSTAT_WARN("cannot create Basic Film Session: unsupported attribute received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // if n-create was successful, create response dataset + if (result) + { + rspDataset = new DcmDataset; + if (rspDataset) + { + OFCondition writeresult = EC_Normal; + DcmElement *delem = NULL; + + ADD_TO_PDATASET(DcmIntegerString, numberOfCopies) + ADD_TO_PDATASET(DcmCodeString, printPriority) + ADD_TO_PDATASET(DcmCodeString, mediumType) + ADD_TO_PDATASET(DcmCodeString, filmDestination) + ADD_TO_PDATASET(DcmLongString, filmSessionLabel) + ADD_TO_PDATASET(DcmShortString, ownerID) + + if (presentationLUTnegotiated) + { + if (referencedPresentationLUTInstanceUID.getLength() == 0) + { + referencedPresentationLUTInstanceUID.putString(WELLKNOWN_IDENTITY_PLUT_UID); + if (NULL == globalPresentationLUTList.findPresentationLUT(WELLKNOWN_IDENTITY_PLUT_UID)) + { + DVPSPresentationLUT *wellknownlut = new DVPSPresentationLUT(); + if (wellknownlut) + { + writeresult = wellknownlut->setType(DVPSP_identity); + if (EC_Normal == writeresult) writeresult = wellknownlut->setSOPInstanceUID(WELLKNOWN_IDENTITY_PLUT_UID); + if (EC_Normal == writeresult) globalPresentationLUTList.insert(wellknownlut); + } else writeresult = EC_MemoryExhausted; + } + } + if (EC_Normal == writeresult) writeresult = addPresentationLUTReference(*rspDataset); + } + + if (EC_Normal == writeresult) + { + rsp.msg.NCreateRSP.DataSetType = DIMSE_DATASET_PRESENT; + } else { + delete rspDataset; + rspDataset = NULL; + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } else { + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } + return result; +} + + +OFBool DVPSFilmSession::printSCPSet( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList, + DVPSStoredPrint_PList& basicFilmBoxList) +{ + OFBool result = OFTrue; + DcmStack stack; + OFCondition writeresult = EC_Normal; + DcmElement *delem = NULL; + OFBool overrideFilmBoxPLUTSettings = OFFalse; + + rspDataset = new DcmDataset; + if ((rqDataset == NULL)||(rspDataset == NULL)) + { + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + + // numberOfCopies + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)numberOfCopies.getTag(), stack, ESM_fromHere, OFFalse))) + { + numberOfCopies = *((DcmIntegerString *)(stack.top())); + Sint32 numCopies=0; + char *numCopiesString=NULL; + if ((EC_Normal != numberOfCopies.getSint32(numCopies)) || (numCopies < 1)) + { + numberOfCopies.getString(numCopiesString); + if (numCopiesString==NULL) numCopiesString = (char *)""; + DCMPSTAT_WARN("cannot update Basic Film Session: illegal number of copies: '" << numCopiesString << "'"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmIntegerString, numberOfCopies) + } + } + } + + // printPriority + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)printPriority.getTag(), stack, ESM_fromHere, OFFalse))) + { + printPriority = *((DcmCodeString *)(stack.top())); + OFString aString; + printPriority.getOFString(aString, 0, OFTrue); + if ((aString != "HIGH")&&(aString != "MED")&&(aString != "LOW")) + { + DCMPSTAT_WARN("cannot update Basic Film Session: illegal print priority: '" << aString.c_str() << "'"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmCodeString, printPriority) + } + } + } + + // mediumType + if (result) + { + Uint32 numMediumTypes = cfg.getTargetPrinterNumberOfMediumTypes(cfgname); + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)mediumType.getTag(), stack, ESM_fromHere, OFFalse))) + { + mediumType = *((DcmCodeString *)(stack.top())); + OFString theMedium; + OFString aString; + OFBool found = OFFalse; + mediumType.getOFString(theMedium, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)filmDestination.getTag(), stack, ESM_fromHere, OFFalse))) + { + filmDestination = *((DcmCodeString *)(stack.top())); + OFString theDestination; + OFString aString; + OFBool found = OFFalse; + filmDestination.getOFString(theDestination, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)filmSessionLabel.getTag(), stack, ESM_fromHere, OFFalse))) + { + filmSessionLabel = *((DcmLongString *)(stack.top())); + ADD_TO_PDATASET(DcmLongString, filmSessionLabel) + } + } + + // ownerID + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)ownerID.getTag(), stack, ESM_fromHere, OFFalse))) + { + ownerID = *((DcmShortString *)(stack.top())); + ADD_TO_PDATASET(DcmShortString, ownerID) + } + } + + if (presentationLUTnegotiated) + { + + // illumination + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)illumination.getTag(), stack, ESM_fromHere, OFFalse))) + { + illumination = *((DcmUnsignedShort *)(stack.top())); + // we don't check illumination set by the user (for now) + ADD_TO_PDATASET(DcmUnsignedShort, illumination) + } + } + + // reflectedAmbientLight + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)reflectedAmbientLight.getTag(), stack, ESM_fromHere, OFFalse))) + { + reflectedAmbientLight = *((DcmUnsignedShort *)(stack.top())); + // we don't check reflected ambient light set by the user (for now) + ADD_TO_PDATASET(DcmUnsignedShort, reflectedAmbientLight) + } + } + + // referenced presentation LUT sequence + if (result) + { + stack.clear(); + + if (rqDataset && (EC_Normal == rqDataset->search(DCM_ReferencedPresentationLUTSequence, stack, ESM_fromHere, OFFalse))) + { + DcmSequenceOfItems *seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + OFString aString; + DcmItem *item = seq->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID) + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + referencedPresentationLUTInstanceUID.getOFString(aString,0); + DVPSPresentationLUT *currentPLUT = globalPresentationLUTList.findPresentationLUT(aString.c_str()); + if (NULL == currentPLUT) + { + DCMPSTAT_WARN("cannot update Basic Film Session: presentation LUT reference cannot be resolved"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // check referenced SOP class UID + DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID) + if (refClassUID.getLength() > 0) + { + aString.clear(); + refClassUID.getOFString(aString,0, OFTrue); + if (aString != UID_PresentationLUTSOPClass) + { + DCMPSTAT_WARN("cannot update Basic Film Session: referenced SOP class UID in referenced presentation LUT sequence incorrect:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + referencedPresentationLUTAlignment = currentPLUT->getAlignment(); + if ((cfg.getTargetPrinterPresentationLUTMatchRequired(cfgname)) && + (! basicFilmBoxList.matchesPresentationLUT(referencedPresentationLUTAlignment))) + { + DCMPSTAT_WARN("cannot update Basic Film Session: referenced presentation LUT number of entries does not match image bit depth."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // referenced presentation LUT sequence is OK + overrideFilmBoxPLUTSettings = OFTrue; + DcmSequenceOfItems *newSeq = new DcmSequenceOfItems(*seq); + if (newSeq) rspDataset->insert(newSeq, OFTrue /*replaceOld*/); + else + { + writeresult = EC_MemoryExhausted; + } + } + } + } else { + DCMPSTAT_WARN("cannot update Basic Film Session: no referenced SOP class UID in referenced presentation LUT sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } else { + DCMPSTAT_WARN("cannot update Basic Film Session: no referenced SOP instance UID in referenced presentation LUT sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Film Session: referenced presentation LUT sequence number of items != 1"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } + + } /* if presentationLUTnegotiated */ + + // browse through rqDataset and check for unsupported attributes + if (result && rqDataset) + { + stack.clear(); + OFBool intoSub = OFTrue; + while (EC_Normal == rqDataset->nextObject(stack, intoSub)) + { + intoSub = OFFalse; + const DcmTagKey& currentTag = (stack.top())->getTag(); + if (currentTag.getElement() == 0x0000) /* group length */ ; + else if (currentTag == DCM_NumberOfCopies) /* OK */ ; + else if (currentTag == DCM_PrintPriority) /* OK */ ; + else if (currentTag == DCM_MediumType) /* OK */ ; + else if (currentTag == DCM_FilmDestination) /* OK */ ; + else if (currentTag == DCM_FilmSessionLabel) /* OK */ ; + else if (currentTag == DCM_OwnerID) /* OK */ ; + else if (currentTag == DCM_MemoryAllocation) + { + DCMPSTAT_WARN("warning while updating Basic Film Session: memory allocation not supported\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + if (rsp.msg.NSetRSP.DimseStatus == 0) rsp.msg.NSetRSP.DimseStatus = STATUS_N_PRINT_BFS_Warn_MemoryAllocation; + } + else if (currentTag == DCM_Illumination) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot update Basic Film Session: illumination received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReflectedAmbientLight) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot update Basic Film Session: reflected ambient light received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReferencedPresentationLUTSequence) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot update Basic Film Session: referenced presentation LUT sequence received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else + { + DCMPSTAT_WARN("cannot update Basic Film Session: unsupported attribute received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // if n-set was successful, send back response dataset + if (result && (EC_Normal == writeresult)) + { + rsp.msg.NSetRSP.DataSetType = DIMSE_DATASET_PRESENT; + if (overrideFilmBoxPLUTSettings) + { + basicFilmBoxList.overridePresentationLUTSettings(illumination, reflectedAmbientLight, + referencedPresentationLUTInstanceUID, referencedPresentationLUTAlignment); + } + } else { + delete rspDataset; + rspDataset = NULL; + if (rsp.msg.NSetRSP.DimseStatus == 0) rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + return result; +} + +OFCondition DVPSFilmSession::addPresentationLUTReference(DcmItem& dset) +{ + DcmElement *delem=NULL; + OFCondition result = EC_Normal; + + ADD_TO_DATASET(DcmUnsignedShort, illumination) + ADD_TO_DATASET(DcmUnsignedShort, reflectedAmbientLight) + + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + DcmUniqueIdentifier refsopclassuid(DCM_ReferencedSOPClassUID); + if (result==EC_Normal) result = refsopclassuid.putString(UID_PresentationLUTSOPClass); + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(DCM_ReferencedPresentationLUTSequence); + DcmItem *ditem = new DcmItem(); + if ((result == EC_Normal) && ditem && dseq) + { + ADD_TO_DATASET2(DcmUniqueIdentifier, refsopclassuid) + ADD_TO_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID) + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + delete dseq; + delete ditem; + } + } else { + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } + return result; +} + +void DVPSFilmSession::copyPresentationLUTSettings(DVPSStoredPrint& sp) +{ + sp.overridePresentationLUTSettings(illumination, reflectedAmbientLight, + referencedPresentationLUTInstanceUID, referencedPresentationLUTAlignment); +} diff --git a/dcmpstat/libsrc/dvpsga.cc b/dcmpstat/libsrc/dvpsga.cc new file mode 100644 index 00000000..4496d494 --- /dev/null +++ b/dcmpstat/libsrc/dvpsga.cc @@ -0,0 +1,194 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPresentationState + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsga.h" +#include "dcmtk/dcmpstat/dvpsri.h" +#include "dcmtk/dcmpstat/dvpstyp.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ + +/* --------------- class DVPSGraphicAnnotation --------------- */ + +DVPSGraphicAnnotation::DVPSGraphicAnnotation() +: referencedImageList() +, graphicAnnotationLayer(DCM_GraphicLayer) +, textObjectList() +, graphicObjectList() +{ +} + +DVPSGraphicAnnotation::DVPSGraphicAnnotation(const DVPSGraphicAnnotation& copy) +: referencedImageList(copy.referencedImageList) +, graphicAnnotationLayer(copy.graphicAnnotationLayer) +, textObjectList(copy.textObjectList) +, graphicObjectList(copy.graphicObjectList) +{ +} + +DVPSGraphicAnnotation::~DVPSGraphicAnnotation() +{ +} + +OFCondition DVPSGraphicAnnotation::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicAnnotationLayer) + if (result==EC_Normal) result = textObjectList.read(dset); + if (result==EC_Normal) result = graphicObjectList.read(dset); + if (result==EC_Normal) result = referencedImageList.read(dset); + + /* Now perform basic sanity checks */ + + if (graphicAnnotationLayer.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic annotation SQ item with graphicAnnotationLayer absent or empty"); + } + else if (graphicAnnotationLayer.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic annotation SQ item with graphicAnnotationLayer VM != 1"); + } + + if ((textObjectList.size() ==0)&&(graphicObjectList.size() ==0)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic annotation SQ item without any graphic or text objects"); + } + + return result; +} + +OFCondition DVPSGraphicAnnotation::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_TO_DATASET(DcmCodeString, graphicAnnotationLayer) + + if (result == EC_Normal) result = textObjectList.write(dset); + if (result == EC_Normal) result = graphicObjectList.write(dset); + if ((result == EC_Normal)&&(referencedImageList.size() >0)) result = referencedImageList.write(dset); + return result; +} + +void DVPSGraphicAnnotation::setAnnotationLayer(const char *aLayer) +{ + if (aLayer) graphicAnnotationLayer.putString(aLayer); else graphicAnnotationLayer.clear(); + return; +} + +const char *DVPSGraphicAnnotation::getAnnotationLayer() +{ + char *c = NULL; + if (EC_Normal == graphicAnnotationLayer.getString(c)) return c; else return NULL; +} + +OFBool DVPSGraphicAnnotation::isEmpty() +{ + if ((textObjectList.size() == 0)&&(graphicObjectList.size()==0)) return OFTrue; + else return OFFalse; +} + +size_t DVPSGraphicAnnotation::getNumberOfTextObjects() +{ + return textObjectList.size(); +} + +size_t DVPSGraphicAnnotation::getNumberOfGraphicObjects() +{ + return graphicObjectList.size(); +} + +DVPSTextObject *DVPSGraphicAnnotation::getTextObject(size_t idx) +{ + return textObjectList.getTextObject(idx); +} + +DVPSGraphicObject *DVPSGraphicAnnotation::getGraphicObject(size_t idx) +{ + return graphicObjectList.getGraphicObject(idx); +} + +void DVPSGraphicAnnotation::addTextObject(DVPSTextObject *text) +{ + textObjectList.addTextObject(text); +} + +void DVPSGraphicAnnotation::addGraphicObject(DVPSGraphicObject *graphic) +{ + graphicObjectList.addGraphicObject(graphic); +} + +DVPSTextObject *DVPSGraphicAnnotation::removeTextObject(size_t idx) +{ + return textObjectList.removeTextObject(idx); +} + +DVPSGraphicObject *DVPSGraphicAnnotation::removeGraphicObject(size_t idx) +{ + return graphicObjectList.removeGraphicObject(idx); +} + +OFCondition DVPSGraphicAnnotation::addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability) +{ + if ((sopclassUID==NULL)||(instanceUID==NULL)||(applicability==DVPSB_allImages)) return EC_IllegalCall; + const char *framenumber=NULL; + if (applicability==DVPSB_currentFrame) + { + char frameString[100]; + sprintf(frameString, "%ld", frame); + framenumber = frameString; + } + return referencedImageList.addImageReference(sopclassUID, instanceUID, framenumber); +} + +OFBool DVPSGraphicAnnotation::isApplicable( + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability) +{ + if (referencedImageList.size() == 0) return OFTrue; // if no image references exist, the annotation is valid "globally". + DVPSReferencedImage *imageRef = NULL; + switch (applicability) + { + case DVPSB_currentFrame: // check if annotation applies to current frame + imageRef = referencedImageList.findImageReference(instanceUID); + if (imageRef) return imageRef->appliesToFrame(frame); + break; + case DVPSB_currentImage: // check if annotation applies to all frames of current image + imageRef = referencedImageList.findImageReference(instanceUID); + if (imageRef) return imageRef->appliesToAllFrames(); + break; + default: /* do nothing */ + break; + } + return OFFalse; +} diff --git a/dcmpstat/libsrc/dvpsgal.cc b/dcmpstat/libsrc/dvpsgal.cc new file mode 100644 index 00000000..909deac9 --- /dev/null +++ b/dcmpstat/libsrc/dvpsgal.cc @@ -0,0 +1,502 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicAnnotation_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsgal.h" +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation */ +#include "dcmtk/ofstd/ofstring.h" /* for OFString */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + +DVPSGraphicAnnotation_PList::DVPSGraphicAnnotation_PList() +: list_() +{ +} + +DVPSGraphicAnnotation_PList::DVPSGraphicAnnotation_PList(const DVPSGraphicAnnotation_PList &arg) +: list_() +{ + OFListConstIterator(DVPSGraphicAnnotation *) first = arg.list_.begin(); + OFListConstIterator(DVPSGraphicAnnotation *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSGraphicAnnotation_PList::~DVPSGraphicAnnotation_PList() +{ + clear(); +} + +void DVPSGraphicAnnotation_PList::clear() +{ + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSGraphicAnnotation_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSGraphicAnnotation *newObject = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_GraphicAnnotationSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newObject = new DVPSGraphicAnnotation(); + if (newObject && ditem) + { + result = newObject->read(*ditem); + list_.push_back(newObject); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSGraphicAnnotation_PList::write(DcmItem &dset) +{ + if (list_.size()==0) return EC_Normal; // don't write empty Sequence + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_GraphicAnnotationSequence); + if (dseq) + { + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + + +void DVPSGraphicAnnotation_PList::renameLayer(const char *oldName, const char *newName) +{ + if ((oldName==NULL)||(newName==NULL)) return; + + OFString aString(oldName); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if (aString == (*first)->getAnnotationLayer()) + { + (*first)->setAnnotationLayer(newName); + } + ++first; + } + return; +} + +void DVPSGraphicAnnotation_PList::removeLayer(const char *name) +{ + if (name==NULL) return; + + OFString aString(name); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if (aString == (*first)->getAnnotationLayer()) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + return; +} + +void DVPSGraphicAnnotation_PList::cleanupLayers() +{ + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((*first)->isEmpty()) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + return; +} + + +OFBool DVPSGraphicAnnotation_PList::usesLayerName(const char *name) +{ + if (name==NULL) return OFFalse; + + OFString aString(name); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if (aString == (*first)->getAnnotationLayer()) return OFTrue; + ++first; + } + return OFFalse; +} + + +size_t DVPSGraphicAnnotation_PList::getNumberOfTextObjects(const char *layer, const char *instanceUID, unsigned long frame) +{ + if (layer==NULL) return 0; + + size_t result = 0; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + result += (*first)->getNumberOfTextObjects(); + } + ++first; + } + return result; +} + +DVPSTextObject *DVPSGraphicAnnotation_PList::getTextObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx) +{ + if (layer==NULL) return NULL; + + size_t tmp = 0; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + tmp = (*first)->getNumberOfTextObjects(); + if (idx < tmp) return (*first)->getTextObject(idx); else idx -= tmp; + } + ++first; + } + return NULL; +} + + +DVPSTextObject *DVPSGraphicAnnotation_PList::addTextObject( + const char *layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability, + DVPSTextObject *text) +{ + if (layer==NULL) return NULL; + + if (text==NULL) + { + text = new DVPSTextObject(); + } + if (text==NULL) return NULL; + + DVPSGraphicAnnotation *annotation = NULL; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame, applicability))) + { + annotation = *first; + first = last; + } else ++first; + } + + if (annotation==NULL) + { + annotation = new DVPSGraphicAnnotation(); + if (annotation) + { + annotation->setAnnotationLayer(layer); + if (applicability != DVPSB_allImages) annotation->addImageReference(sopclassUID, instanceUID, frame, applicability); + list_.push_back(annotation); + } + } + + if (annotation) + { + annotation->addTextObject(text); + return text; + } + + delete text; + return NULL; +} + + +OFCondition DVPSGraphicAnnotation_PList::removeTextObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx) +{ + if (layer==NULL) return EC_IllegalCall; + + size_t tmp = 0; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + tmp = (*first)->getNumberOfTextObjects(); + if (idx < tmp) + { + DVPSTextObject *textObject = (*first)->removeTextObject(idx); + if (textObject) + { + delete textObject; + return EC_Normal; + } else return EC_IllegalCall; + } else idx -= tmp; + } + ++first; + } + return EC_IllegalCall; +} + + +OFCondition DVPSGraphicAnnotation_PList::moveTextObject( + const char *old_layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + size_t idx, + DVPSObjectApplicability applicability, + const char *new_layer) +{ + if (old_layer==NULL) return EC_IllegalCall; + if (new_layer==NULL) return EC_IllegalCall; + + size_t tmp = 0; + OFString aString(old_layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + tmp = (*first)->getNumberOfTextObjects(); + if (idx < tmp) + { + DVPSTextObject *textObject = (*first)->removeTextObject(idx); + if (textObject) + { + textObject = addTextObject(new_layer, sopclassUID, instanceUID, frame, applicability, textObject); + if (textObject) return EC_Normal; else return EC_MemoryExhausted; + } else return EC_IllegalCall; + } else idx -= tmp; + } + ++first; + } + return EC_IllegalCall; +} + + +size_t DVPSGraphicAnnotation_PList::getNumberOfGraphicObjects(const char *layer, const char *instanceUID, unsigned long frame) +{ + if (layer==NULL) return 0; + + size_t result = 0; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + result += (*first)->getNumberOfGraphicObjects(); + } + ++first; + } + return result; +} + +DVPSGraphicObject *DVPSGraphicAnnotation_PList::getGraphicObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx) +{ + if (layer==NULL) return NULL; + + size_t tmp = 0; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + tmp = (*first)->getNumberOfGraphicObjects(); + if (idx < tmp) return (*first)->getGraphicObject(idx); else idx -= tmp; + } + ++first; + } + return NULL; +} + + +DVPSGraphicObject *DVPSGraphicAnnotation_PList::addGraphicObject( + const char *layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability, + DVPSGraphicObject *graphic) +{ + if (layer==NULL) return NULL; + + if (graphic==NULL) graphic = new DVPSGraphicObject(); + if (graphic==NULL) return NULL; + + DVPSGraphicAnnotation *annotation = NULL; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame, applicability))) + { + annotation = *first; + first = last; + } else ++first; + } + + if (annotation==NULL) + { + annotation = new DVPSGraphicAnnotation(); + if (annotation) + { + annotation->setAnnotationLayer(layer); + if (applicability != DVPSB_allImages) annotation->addImageReference(sopclassUID, instanceUID, frame, applicability); + list_.push_back(annotation); + } + } + + if (annotation) + { + annotation->addGraphicObject(graphic); + return graphic; + } + + delete graphic; + return NULL; +} + + +OFCondition DVPSGraphicAnnotation_PList::removeGraphicObject(const char *layer, const char *instanceUID, unsigned long frame, size_t idx) +{ + if (layer==NULL) return EC_IllegalCall; + + size_t tmp = 0; + OFString aString(layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + tmp = (*first)->getNumberOfGraphicObjects(); + if (idx < tmp) + { + DVPSGraphicObject *graphicObject = (*first)->removeGraphicObject(idx); + if (graphicObject) + { + delete graphicObject; + return EC_Normal; + } else return EC_IllegalCall; + } else idx -= tmp; + } + ++first; + } + return EC_IllegalCall; +} + + +OFCondition DVPSGraphicAnnotation_PList::moveGraphicObject( + const char *old_layer, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + size_t idx, + DVPSObjectApplicability applicability, + const char *new_layer) +{ + if (old_layer==NULL) return EC_IllegalCall; + if (new_layer==NULL) return EC_IllegalCall; + + size_t tmp = 0; + OFString aString(old_layer); + OFListIterator(DVPSGraphicAnnotation *) first = list_.begin(); + OFListIterator(DVPSGraphicAnnotation *) last = list_.end(); + while (first != last) + { + if ((aString == (*first)->getAnnotationLayer()) && ((*first)->isApplicable(instanceUID, frame))) + { + tmp = (*first)->getNumberOfGraphicObjects(); + if (idx < tmp) + { + DVPSGraphicObject *graphicObject = (*first)->removeGraphicObject(idx); + if (graphicObject) + { + graphicObject = addGraphicObject(new_layer, sopclassUID, instanceUID, frame, applicability, graphicObject); + if (graphicObject) return EC_Normal; else return EC_MemoryExhausted; + } else return EC_IllegalCall; + } else idx -= tmp; + } + ++first; + } + return EC_IllegalCall; +} diff --git a/dcmpstat/libsrc/dvpsgl.cc b/dcmpstat/libsrc/dvpsgl.cc new file mode 100644 index 00000000..4e2373b4 --- /dev/null +++ b/dcmpstat/libsrc/dvpsgl.cc @@ -0,0 +1,253 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicLayer + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsgl.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +/* --------------- class DVPSGraphicLayer --------------- */ + +DVPSGraphicLayer::DVPSGraphicLayer() +: graphicLayer(DCM_GraphicLayer) +, graphicLayerOrder(DCM_GraphicLayerOrder) +, graphicLayerRecommendedDisplayGrayscaleValue(DCM_GraphicLayerRecommendedDisplayGrayscaleValue) +, graphicLayerRecommendedDisplayRGBValue(DCM_RETIRED_GraphicLayerRecommendedDisplayRGBValue) +, graphicLayerDescription(DCM_GraphicLayerDescription) +{ +} + +DVPSGraphicLayer::DVPSGraphicLayer(const DVPSGraphicLayer& copy) +: graphicLayer(copy.graphicLayer) +, graphicLayerOrder(copy.graphicLayerOrder) +, graphicLayerRecommendedDisplayGrayscaleValue(copy.graphicLayerRecommendedDisplayGrayscaleValue) +, graphicLayerRecommendedDisplayRGBValue(copy.graphicLayerRecommendedDisplayRGBValue) +, graphicLayerDescription(copy.graphicLayerDescription) +{ +} + +DVPSGraphicLayer::~DVPSGraphicLayer() +{ +} + +OFCondition DVPSGraphicLayer::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicLayer) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, graphicLayerOrder) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, graphicLayerRecommendedDisplayGrayscaleValue) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, graphicLayerRecommendedDisplayRGBValue) + READ_FROM_DATASET(DcmLongString, EVR_LO, graphicLayerDescription) + + /* Now perform basic sanity checks */ + + if (graphicLayer.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic layer SQ item with graphicLayer absent or empty"); + } + else if (graphicLayer.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic layer SQ item with graphicLayer VM != 1"); + } + + if (graphicLayerOrder.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic layer SQ item with graphicLayerOrder absent or empty"); + } + else if (graphicLayerOrder.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic layer SQ item with graphicLayerOrder VM != 1"); + } + + if (graphicLayerRecommendedDisplayGrayscaleValue.getVM()>1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic layer SQ item with graphicLayerRecommendedDisplayGrayscaleValue VM != 1"); + } + + if ((graphicLayerRecommendedDisplayRGBValue.getVM()>0)&&(graphicLayerRecommendedDisplayRGBValue.getVM() != 3)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic layer SQ item with graphicLayerRecommendedDisplayRGBValue VM != 3"); + } + + if (graphicLayerDescription.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic layer SQ item with graphicLayerDescription VM > 1"); + } + + return result; +} + +OFCondition DVPSGraphicLayer::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_TO_DATASET(DcmCodeString, graphicLayer) + ADD_TO_DATASET(DcmIntegerString, graphicLayerOrder) + if (graphicLayerRecommendedDisplayGrayscaleValue.getLength() >0) { ADD_TO_DATASET(DcmUnsignedShort, graphicLayerRecommendedDisplayGrayscaleValue) } + if (graphicLayerRecommendedDisplayRGBValue.getLength() >0) { ADD_TO_DATASET(DcmUnsignedShort, graphicLayerRecommendedDisplayRGBValue) } + if (graphicLayerDescription.getLength() >0) { ADD_TO_DATASET(DcmLongString, graphicLayerDescription) } + + return result; +} + +const char *DVPSGraphicLayer::getGL() +{ + char *c = NULL; + if (EC_Normal == graphicLayer.getString(c)) return c; else return NULL; +} + +const char *DVPSGraphicLayer::getGLDescription() +{ + char *c = NULL; + if (EC_Normal == graphicLayerDescription.getString(c)) return c; else return NULL; +} + + +void DVPSGraphicLayer::setGL(const char *gl) +{ + if (gl) graphicLayer.putString(gl); else graphicLayer.clear(); + return; +} + +void DVPSGraphicLayer::setGLOrder(Sint32 glOrder) +{ + char buf[100]; + sprintf(buf, "%ld", (long)glOrder); + graphicLayerOrder.putString(buf); + return; +} + +void DVPSGraphicLayer::setGLRecommendedDisplayValueGray(Uint16 gray) +{ + graphicLayerRecommendedDisplayGrayscaleValue.clear(); + graphicLayerRecommendedDisplayGrayscaleValue.putUint16(gray,0); + return; +} + +void DVPSGraphicLayer::setGLRecommendedDisplayValueRGB(Uint16 r, Uint16 g, Uint16 b) +{ + graphicLayerRecommendedDisplayRGBValue.clear(); + graphicLayerRecommendedDisplayRGBValue.putUint16(r,0); + graphicLayerRecommendedDisplayRGBValue.putUint16(g,1); + graphicLayerRecommendedDisplayRGBValue.putUint16(b,2); + return; +} + +void DVPSGraphicLayer::setGLDescription(const char *glDescription) +{ + if (glDescription) graphicLayerDescription.putString(glDescription); else graphicLayerDescription.clear(); + return; +} + + +Sint32 DVPSGraphicLayer::getGLOrder() +{ + Sint32 result=0; + if (EC_Normal == graphicLayerOrder.getSint32(result,0)) return result; else return 0; +} + +OFBool DVPSGraphicLayer::haveGLRecommendedDisplayValue() +{ + if ((graphicLayerRecommendedDisplayGrayscaleValue.getVM() == 1) || + (graphicLayerRecommendedDisplayRGBValue.getVM() == 3)) + return OFTrue; else return OFFalse; +} + +OFCondition DVPSGraphicLayer::getGLRecommendedDisplayValueGray(Uint16& gray) +{ + gray = 0; + OFCondition result = EC_Normal; + if (graphicLayerRecommendedDisplayGrayscaleValue.getVM()==1) + { + Uint16 gr=0; + result = graphicLayerRecommendedDisplayGrayscaleValue.getUint16(gr,0); + if (result==EC_Normal) gray = gr; + } else if (graphicLayerRecommendedDisplayRGBValue.getVM() == 3) + { + Uint16 r=0; + Uint16 g=0; + Uint16 b=0; + result = graphicLayerRecommendedDisplayRGBValue.getUint16(r,0); + if (EC_Normal==result) result = graphicLayerRecommendedDisplayRGBValue.getUint16(g,1); + if (EC_Normal==result) result = graphicLayerRecommendedDisplayRGBValue.getUint16(b,2); + if (result==EC_Normal) + { + double dg = 0.299*(double)r + 0.587*(double)g +0.114*(double)b; + gray = (Uint16) dg; + } + } else result=EC_IllegalCall; + return result; +} + +OFCondition DVPSGraphicLayer::getGLRecommendedDisplayValueRGB(Uint16& r, Uint16& g, Uint16& b) +{ + r = 0; + g = 0; + b = 0; + OFCondition result = EC_Normal; + if (graphicLayerRecommendedDisplayRGBValue.getVM()==3) + { + Uint16 rr=0; + Uint16 gg=0; + Uint16 bb=0; + result = graphicLayerRecommendedDisplayRGBValue.getUint16(rr,0); + if (EC_Normal==result) result = graphicLayerRecommendedDisplayRGBValue.getUint16(gg,1); + if (EC_Normal==result) result = graphicLayerRecommendedDisplayRGBValue.getUint16(bb,2); + if (result==EC_Normal) + { + r = rr; + g = gg; + b = bb; + } + } + else if (graphicLayerRecommendedDisplayGrayscaleValue.getVM() == 1) + { + Uint16 gr=0; + result = graphicLayerRecommendedDisplayGrayscaleValue.getUint16(gr,0); + if (result==EC_Normal) + { + r = gr; + g = gr; + b = gr; + } + } else result=EC_IllegalCall; + return result; +} + +void DVPSGraphicLayer::removeRecommendedDisplayValue(OFBool rgb, OFBool monochrome) +{ + if (rgb) graphicLayerRecommendedDisplayRGBValue.clear(); + if (monochrome) graphicLayerRecommendedDisplayGrayscaleValue.clear(); + return; +} diff --git a/dcmpstat/libsrc/dvpsgll.cc b/dcmpstat/libsrc/dvpsgll.cc new file mode 100644 index 00000000..d82d2086 --- /dev/null +++ b/dcmpstat/libsrc/dvpsgll.cc @@ -0,0 +1,424 @@ +/* + * + * Copyright (C) 1998-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicLayer_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpsgll.h" +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for DVPS_IDX_NONE */ +#include "dcmtk/dcmpstat/dvpsgal.h" /* for DVPSOverlayCurveActivationLayer_PList */ +#include "dcmtk/dcmpstat/dvpsall.h" /* for DVPSGraphicAnnotation_PList& annotations */ + +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + +DVPSGraphicLayer_PList::DVPSGraphicLayer_PList() +: list_() +{ +} + +DVPSGraphicLayer_PList::DVPSGraphicLayer_PList(const DVPSGraphicLayer_PList &arg) +: list_() +{ + OFListConstIterator(DVPSGraphicLayer *) first = arg.list_.begin(); + OFListConstIterator(DVPSGraphicLayer *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSGraphicLayer_PList::~DVPSGraphicLayer_PList() +{ + clear(); +} + +void DVPSGraphicLayer_PList::clear() +{ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSGraphicLayer_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSGraphicLayer *newLayer = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_GraphicLayerSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newLayer = new DVPSGraphicLayer(); + if (newLayer && ditem) + { + result = newLayer->read(*ditem); + list_.push_back(newLayer); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSGraphicLayer_PList::write(DcmItem &dset) +{ + if (size()==0) return EC_Normal; // don't write empty Sequence + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_GraphicLayerSequence); + if (dseq) + { + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + +OFCondition DVPSGraphicLayer_PList::addGraphicLayer(const char *gLayer, + const Sint32 gLayerOrder, + const char *gLayerDescription) +{ + if (gLayer==NULL) return EC_IllegalCall; + OFString ggLayer(gLayer); + + /* check that no graphic layer with the same name exist */ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + while (first != last) + { + if (ggLayer == (*first)->getGL()) return EC_IllegalCall; + ++first; + } + + DVPSGraphicLayer *newLayer = new DVPSGraphicLayer; + if (newLayer) + { + newLayer->setGL(gLayer); + newLayer->setGLOrder(gLayerOrder); + if (gLayerDescription) newLayer->setGLDescription(gLayerDescription); + list_.push_back(newLayer); + } else return EC_MemoryExhausted; + return EC_Normal; +} + + +DVPSGraphicLayer *DVPSGraphicLayer_PList::getGraphicLayer(size_t idx) +{ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + while (first != last) + { + if ((idx--) == 0) return *first; + ++first; + } + return NULL; +} + + +OFCondition DVPSGraphicLayer_PList::addGraphicLayer( + const char *gLayer, + const char *gLayerDescription) +{ + sortGraphicLayers(1); + Sint32 layerOrder = OFstatic_cast(Sint32, size()+1); + return addGraphicLayer(gLayer, layerOrder, gLayerDescription); +} + + +void DVPSGraphicLayer_PList::sortGraphicLayers(Sint32 lowestLayer) +{ + /* this sorting routine is a simple straight selection. + * since we won't have many graphic layers, this should be sufficient. + */ + OFList tempList; + tempList.splice(tempList.end(),list_); // move all entries to tempList + OFListIterator(DVPSGraphicLayer *) current; + OFListIterator(DVPSGraphicLayer *) first; + OFListIterator(DVPSGraphicLayer *) last; + Sint32 currentSize; + while (tempList.size() > 0) + { + current = tempList.begin(); + currentSize = (*current)->getGLOrder(); + first = tempList.begin(); + last = tempList.end(); + while (first != last) + { + if ((*first)->getGLOrder() < currentSize) + { + current = first; + currentSize = (*first)->getGLOrder(); + } + ++first; + } + list_.push_back(*current); + tempList.erase(current); + } + + /* now renumber layer orders */ + first = list_.begin(); + last = list_.end(); + while (first != last) (*first++)->setGLOrder(lowestLayer++); + return; +} + + +const char *DVPSGraphicLayer_PList::getGraphicLayerName(size_t idx) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) return layer->getGL(); else return NULL; +} + + +size_t DVPSGraphicLayer_PList::getGraphicLayerIndex(const char *name) +{ + if (name==NULL) return DVPS_IDX_NONE; + size_t idx =0; + OFString aString(name); + + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + while (first != last) + { + if (aString == (*first)->getGL()) return idx; + idx++; + ++first; + } + return DVPS_IDX_NONE; +} + +const char *DVPSGraphicLayer_PList::getGraphicLayerDescription(size_t idx) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) return layer->getGLDescription(); else return NULL; +} + +OFBool DVPSGraphicLayer_PList::haveGraphicLayerRecommendedDisplayValue(size_t idx) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) return layer->haveGLRecommendedDisplayValue(); else return OFFalse; +} + +OFCondition DVPSGraphicLayer_PList::getGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16& gray) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) return layer->getGLRecommendedDisplayValueGray(gray); else return EC_IllegalCall; +} + +OFCondition DVPSGraphicLayer_PList::getGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16& r, Uint16& g, Uint16& b) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) return layer->getGLRecommendedDisplayValueRGB(r, g, b); else return EC_IllegalCall; +} + +OFCondition DVPSGraphicLayer_PList::setGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16 gray) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) + { + layer->setGLRecommendedDisplayValueGray(gray); + return EC_Normal; + } else return EC_IllegalCall; +} + +OFCondition DVPSGraphicLayer_PList::setGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16 r, Uint16 g, Uint16 b) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) + { + layer->setGLRecommendedDisplayValueRGB(r, g, b); + return EC_Normal; + } else return EC_IllegalCall; +} + +void DVPSGraphicLayer_PList::removeGraphicLayerRecommendedDisplayValue(size_t idx, OFBool rgb, OFBool monochrome) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) layer->removeRecommendedDisplayValue(rgb, monochrome); + return; +} + +OFCondition DVPSGraphicLayer_PList::setGraphicLayerName(size_t idx, const char *name) +{ + if (name==NULL) return EC_IllegalCall; + + OFString aString(name); + /* check that no graphic layer with the same name exist */ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + while (first != last) + { + if (aString == (*first)->getGL()) return EC_IllegalCall; + ++first; + } + + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) + { + layer->setGL(name); + return EC_Normal; + } + return EC_IllegalCall; +} + + +OFCondition DVPSGraphicLayer_PList::setGraphicLayerDescription(size_t idx, const char *descr) +{ + DVPSGraphicLayer *layer = getGraphicLayer(idx); + if (layer) + { + layer->setGLDescription(descr); + return EC_Normal; + } + return EC_IllegalCall; +} + + +OFCondition DVPSGraphicLayer_PList::toFrontGraphicLayer(size_t idx) +{ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + OFBool found = OFFalse; + while ((!found) && (first != last)) + { + if ((idx--) == 0) found=OFTrue; else ++first; + } + if (found) + { + DVPSGraphicLayer *layer = *first; + list_.erase(first); + sortGraphicLayers(1); + Sint32 layerOrder = OFstatic_cast(Sint32, size()+1); + layer->setGLOrder(layerOrder); + list_.push_back(layer); + } else return EC_IllegalCall; + return EC_Normal; +} + +OFCondition DVPSGraphicLayer_PList::toBackGraphicLayer(size_t idx) +{ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + OFBool found = OFFalse; + while ((!found) && (first != last)) + { + if ((idx--) == 0) found=OFTrue; else ++first; + } + if (found) + { + DVPSGraphicLayer *layer = *first; + list_.erase(first); + sortGraphicLayers(2); + layer->setGLOrder(1); + list_.push_front(layer); + } else return EC_IllegalCall; + return EC_Normal; +} + +OFCondition DVPSGraphicLayer_PList::exchangeGraphicLayers(size_t idx1, size_t idx2) +{ + if (idx1 == idx2) return EC_Normal; + DVPSGraphicLayer *layer1 = getGraphicLayer(idx1); + DVPSGraphicLayer *layer2 = getGraphicLayer(idx2); + if ((layer1==NULL)||(layer2==NULL)) return EC_IllegalCall; + + Sint32 order1 = layer1->getGLOrder(); + Sint32 order2 = layer2->getGLOrder(); + if (order1 != order2) + { + layer1->setGLOrder(order2); + layer2->setGLOrder(order1); + } + return EC_Normal; +} + +OFCondition DVPSGraphicLayer_PList::removeGraphicLayer(size_t idx) +{ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + OFBool found = OFFalse; + while ((!found) && (first != last)) + { + if ((idx--) == 0) found=OFTrue; else ++first; + } + if (found) + { + delete *first; + list_.erase(first); + } else return EC_IllegalCall; + return EC_Normal; +} + + +void DVPSGraphicLayer_PList::cleanupLayers( + DVPSOverlayCurveActivationLayer_PList& activations, + DVPSGraphicAnnotation_PList& annotations) +{ + OFListIterator(DVPSGraphicLayer *) first = list_.begin(); + OFListIterator(DVPSGraphicLayer *) last = list_.end(); + const char *name=NULL; + while (first != last) + { + name = (*first)->getGL(); + if ((! activations.usesLayerName(name))&&(! annotations.usesLayerName(name))) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + return; +} diff --git a/dcmpstat/libsrc/dvpsgr.cc b/dcmpstat/libsrc/dvpsgr.cc new file mode 100644 index 00000000..1bd837d9 --- /dev/null +++ b/dcmpstat/libsrc/dvpsgr.cc @@ -0,0 +1,259 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSGraphicObject + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsgr.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + +/* --------------- class DVPSGraphicObject --------------- */ + +DVPSGraphicObject::DVPSGraphicObject() +: graphicAnnotationUnits(DCM_GraphicAnnotationUnits) +, numberOfGraphicPoints(DCM_NumberOfGraphicPoints) +, graphicData(DCM_GraphicData) +, graphicType(DCM_GraphicType) +, graphicFilled(DCM_GraphicFilled) +{ +} + +DVPSGraphicObject::DVPSGraphicObject(const DVPSGraphicObject& copy) +: graphicAnnotationUnits(copy.graphicAnnotationUnits) +, numberOfGraphicPoints(copy.numberOfGraphicPoints) +, graphicData(copy.graphicData) +, graphicType(copy.graphicType) +, graphicFilled(copy.graphicFilled) +{ +} + +DVPSGraphicObject::~DVPSGraphicObject() +{ +} + +OFCondition DVPSGraphicObject::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DcmUnsignedShort graphicDimensions(DCM_GraphicDimensions); // VR=US, VM=1, Type 1 + + READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicAnnotationUnits) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, graphicDimensions) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, numberOfGraphicPoints) + READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, graphicData) + READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicType) + READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicFilled) + + /* Now perform basic sanity checks */ + + if (graphicAnnotationUnits.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicAnnotationUnits absent or empty"); + } + else if (graphicAnnotationUnits.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicAnnotationUnits VM != 1"); + } + + if (graphicDimensions.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicDimensions VM != 1"); + } else { + Uint16 dimension=0; + if ((EC_Normal != graphicDimensions.getUint16(dimension,0))||(dimension != 2)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicDimensions != 2"); + } + } + + if (numberOfGraphicPoints.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with numberOfGraphicPoints absent or empty"); + } + else if (numberOfGraphicPoints.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with numberOfGraphicPoints VM != 1"); + } + + if (graphicData.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicData absent or empty"); + } + else if (graphicData.getVM() < 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicData VM < 2"); + } + + if (graphicType.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicType absent or empty"); + } + else if (graphicType.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicType VM != 1"); + } + + if ((graphicFilled.getLength() > 0)&&(graphicFilled.getVM() != 1)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a graphic object SQ item with graphicFilled present but VM != 1"); + } + + return result; +} + +OFCondition DVPSGraphicObject::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmUnsignedShort graphicDimensions(DCM_GraphicDimensions); // VR=US, VM=1, Type 1 + Uint16 dimensions=2; + graphicDimensions.putUint16(dimensions,0); + + ADD_TO_DATASET(DcmCodeString, graphicAnnotationUnits) + ADD_TO_DATASET(DcmUnsignedShort, graphicDimensions) + ADD_TO_DATASET(DcmUnsignedShort, numberOfGraphicPoints) + ADD_TO_DATASET(DcmFloatingPointSingle, graphicData) + ADD_TO_DATASET(DcmCodeString, graphicType) + + // strictly speaking we are not allowed to include graphicFilled + // when the graphicType is "POLYLINE" or "INTERPOLATED" and the + // first point of graphicData is not equal the last point. + // For simplicity reasons we always include the attribute unless + // the graphic type is POINT. + if (DVPST_point != getGraphicType()) + { + ADD_TO_DATASET(DcmCodeString, graphicFilled) + } + return result; +} + + +DVPSannotationUnit DVPSGraphicObject::getAnnotationUnits() +{ + DVPSannotationUnit aresult = DVPSA_pixels; + OFString aString; + OFCondition result = graphicAnnotationUnits.getOFString(aString,0); + if ((result==EC_Normal)&&(aString == "DISPLAY")) aresult = DVPSA_display; + return aresult; +} + +size_t DVPSGraphicObject::getNumberOfPoints() +{ + Uint16 result=0; + if (EC_Normal == numberOfGraphicPoints.getUint16(result,0)) return result; + else return 0; +} + +OFCondition DVPSGraphicObject::getPoint(size_t idx, Float32& x, Float32& y) +{ + x=0.0; + y=0.0; + OFCondition result = EC_IllegalCall; + if ((idx*2+1)clone()); + ++first; + } +} + +DVPSGraphicObject_PList::~DVPSGraphicObject_PList() +{ + clear(); +} + +void DVPSGraphicObject_PList::clear() +{ + OFListIterator(DVPSGraphicObject *) first = list_.begin(); + OFListIterator(DVPSGraphicObject *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSGraphicObject_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSGraphicObject *newObject = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_GraphicObjectSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newObject = new DVPSGraphicObject(); + if (newObject && ditem) + { + result = newObject->read(*ditem); + list_.push_back(newObject); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSGraphicObject_PList::write(DcmItem &dset) +{ + if (size()==0) return EC_Normal; // don't write empty Sequence + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_GraphicObjectSequence); + if (dseq) + { + OFListIterator(DVPSGraphicObject *) first = list_.begin(); + OFListIterator(DVPSGraphicObject *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + + +DVPSGraphicObject *DVPSGraphicObject_PList::getGraphicObject(size_t idx) +{ + OFListIterator(DVPSGraphicObject *) first = list_.begin(); + OFListIterator(DVPSGraphicObject *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} + +void DVPSGraphicObject_PList::addGraphicObject(DVPSGraphicObject *graphic) +{ + if (graphic) list_.push_back(graphic); +} + +DVPSGraphicObject *DVPSGraphicObject_PList::removeGraphicObject(size_t idx) +{ + OFListIterator(DVPSGraphicObject *) first = list_.begin(); + OFListIterator(DVPSGraphicObject *) last = list_.end(); + while (first != last) + { + if (idx==0) + { + DVPSGraphicObject *result = *first; + list_.erase(first); + return result; + } + idx--; + ++first; + } + return NULL; +} diff --git a/dcmpstat/libsrc/dvpshlp.cc b/dcmpstat/libsrc/dvpshlp.cc new file mode 100644 index 00000000..cc27733e --- /dev/null +++ b/dcmpstat/libsrc/dvpshlp.cc @@ -0,0 +1,220 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Joerg Riesmeier, Marco Eichelberg + * + * Purpose: DVPSHelper + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpshlp.h" +#include "dcmtk/dcmpstat/dvpsdef.h" +#include "dcmtk/dcmnet/dcompat.h" /* compatibility routines */ +#include "dcmtk/dcmdata/dctk.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CERRNO +#define INCLUDE_CTIME +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_TYPES_H +#include /* for fork */ +#endif +#ifdef HAVE_SYS_WAIT_H +#include /* for waitpid */ +#endif +#ifdef HAVE_SYS_TIME_H +#include /* for wait3 */ +#endif +#ifdef HAVE_SYS_RESOURCE_H +#include /* for wait3 */ +#endif +END_EXTERN_C + +void DVPSHelper::currentDate(OFString &str) +{ + DcmDate::getCurrentDate(str); +} + +void DVPSHelper::currentTime(OFString &str) +{ + DcmTime::getCurrentTime(str); +} + +OFCondition DVPSHelper::loadFileFormat(const char *filename, + DcmFileFormat *&fileformat) +{ + fileformat = new DcmFileFormat; + OFCondition result = fileformat->loadFile(OFFilename(filename,OFTrue)); + + if (result.bad()) + { + delete fileformat; + fileformat = NULL; + } + + return result; +} + +OFCondition DVPSHelper::saveFileFormat(const char *filename, + DcmFileFormat *fileformat, OFBool explicitVR) +{ + E_TransferSyntax xfer = EXS_LittleEndianImplicit; + if (explicitVR) xfer = EXS_LittleEndianExplicit; + + return fileformat->saveFile(filename, xfer, EET_ExplicitLength, EGL_recalcGL, EPD_withoutPadding); +} + +OFCondition DVPSHelper::putStringValue(DcmItem *item, DcmTagKey tag, const char *value) +{ + OFCondition result = EC_Normal; + DcmTag localTag(tag); + if (item) + { + DcmElement *elem = NULL; + switch(localTag.getEVR()) + { + case EVR_AE: elem = new DcmApplicationEntity(localTag); break; + case EVR_AS: elem = new DcmAgeString(localTag); break; + case EVR_CS: elem = new DcmCodeString(localTag); break; + case EVR_DA: elem = new DcmDate(localTag); break; + case EVR_DS: elem = new DcmDecimalString(localTag); break; + case EVR_DT: elem = new DcmDateTime(localTag); break; + case EVR_IS: elem = new DcmIntegerString(localTag); break; + case EVR_TM: elem = new DcmTime(localTag); break; + case EVR_UI: elem = new DcmUniqueIdentifier(localTag); break; + case EVR_LO: elem = new DcmLongString(localTag); break; + case EVR_LT: elem = new DcmLongText(localTag); break; + case EVR_PN: elem = new DcmPersonName(localTag); break; + case EVR_SH: elem = new DcmShortString(localTag); break; + case EVR_ST: elem = new DcmShortText(localTag); break; + default: result=EC_IllegalCall; break; + } + if (elem) + { + if (value) result = elem->putString(value); + } else if (result==EC_Normal) result = EC_MemoryExhausted; + if (EC_Normal==result) item->insert(elem, OFTrue); + } else result = EC_IllegalCall; + return result; +} + + +OFCondition DVPSHelper::putUint16Value(DcmItem *item, DcmTagKey tag, Uint16 value) +{ + OFCondition result = EC_Normal; + DcmTag localTag(tag); + if (item) + { + DcmElement *elem = new DcmUnsignedShort(localTag); + if (elem) result = elem->putUint16(value); else result=EC_MemoryExhausted; + if (EC_Normal==result) item->insert(elem, OFTrue); + } else result = EC_IllegalCall; + return result; +} + +void DVPSHelper::cleanChildren() +{ +#ifdef HAVE_WAITPID + int stat_loc; +#elif defined(HAVE_WAIT3) + struct rusage rusage; +#if defined(__NeXT__) + /* some systems need a union wait as argument to wait3 */ + union wait status; +#else + int status; +#endif +#endif + +#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) + int child = 1; + int options = WNOHANG; + while (child > 0) + { +#ifdef HAVE_WAITPID + child = (int)(waitpid(-1, &stat_loc, options)); +#elif defined(HAVE_WAIT3) + child = wait3(&status, options, &rusage); +#endif + if (child < 0) + { + if ((errno != ECHILD) && (errno != 0)) + { + char buf[256]; + DCMPSTAT_ERROR("wait for child failed: " << OFStandard::strerror(errno, buf, sizeof(buf))); + } + } + } +#endif +} + +void DVPSHelper::setDefault(OFCondition& result, DcmElement& a_name, const char *a_value) +{ + if ((result==EC_Normal)&&(a_name.getLength()==0)) result = a_name.putString(a_value); + return; +} + +OFBool DVPSHelper::haveReferencedUIDItem(DcmSequenceOfItems& seq, const char *uid) +{ + if (uid==NULL) return OFFalse; + + DcmItem *item = NULL; + DcmUniqueIdentifier *refuid = NULL; + unsigned long numItems = seq.card(); + DcmStack stack; + OFString aString; + for (unsigned long i=0; isearch(DCM_ReferencedSOPClassUID, stack, ESM_fromHere, OFFalse)) + { + aString.clear(); + refuid = (DcmUniqueIdentifier *)(stack.top()); + if (refuid) refuid->getOFString(aString,0); + if (aString == uid) return OFTrue; + } + } + return OFFalse; +} + +OFCondition DVPSHelper::addReferencedUIDItem(DcmSequenceOfItems& seq, const char *uid) +{ + if (uid==NULL) return EC_IllegalCall; + OFCondition result = EC_Normal; + + DcmElement *delem = new DcmUniqueIdentifier(DCM_ReferencedSOPClassUID); + if (delem) + { + result = delem->putString(uid); + if (EC_Normal==result) + { + DcmItem *ditem = new DcmItem(); + if (ditem) + { + ditem->insert(delem, OFTrue /*replaceOld*/); + seq.insert(ditem); + } else { + delete delem; + result=EC_MemoryExhausted; + } + } + } else result=EC_MemoryExhausted; + return result; +} diff --git a/dcmpstat/libsrc/dvpsib.cc b/dcmpstat/libsrc/dvpsib.cc new file mode 100644 index 00000000..096c5b3e --- /dev/null +++ b/dcmpstat/libsrc/dvpsib.cc @@ -0,0 +1,1307 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSImageBoxContent + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpsib.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmpstat/dvpspll.h" +#include "dcmtk/dcmpstat/dvpscf.h" +#include "dcmtk/dcmpstat/dvpshlp.h" +#include "dcmtk/dcmpstat/dvpspl.h" /* for DVPSPresentationLUT, needed by MSVC5 with STL */ + + +/* --------------- class DVPSImageBoxContent --------------- */ + +DVPSImageBoxContent::DVPSImageBoxContent() +: sOPInstanceUID(DCM_SOPInstanceUID) +, imageBoxPosition(DCM_ImageBoxPosition) +, polarity(DCM_Polarity) +, magnificationType(DCM_MagnificationType) +, configurationInformation(DCM_ConfigurationInformation) +, smoothingType(DCM_SmoothingType) +, requestedImageSize(DCM_RequestedImageSize) +, requestedDecimateCropBehavior(DCM_RequestedDecimateCropBehavior) +, retrieveAETitle(DCM_RetrieveAETitle) +, referencedSOPClassUID(DCM_ReferencedSOPClassUID) +, referencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +, studyInstanceUID(DCM_StudyInstanceUID) +, seriesInstanceUID(DCM_SeriesInstanceUID) +, referencedFrameNumber(DCM_ReferencedFrameNumber) +, patientID(DCM_PatientID) +, referencedPresentationLUTInstanceUID(DCM_ReferencedSOPInstanceUID) +, imageDepth(DVPSN_undefined) +{ +} + +DVPSImageBoxContent::DVPSImageBoxContent(const DVPSImageBoxContent& copy) +: sOPInstanceUID(copy.sOPInstanceUID) +, imageBoxPosition(copy.imageBoxPosition) +, polarity(copy.polarity) +, magnificationType(copy.magnificationType) +, configurationInformation(copy.configurationInformation) +, smoothingType(copy.smoothingType) +, requestedImageSize(copy.requestedImageSize) +, requestedDecimateCropBehavior(copy.requestedDecimateCropBehavior) +, retrieveAETitle(copy.retrieveAETitle) +, referencedSOPClassUID(copy.referencedSOPClassUID) +, referencedSOPInstanceUID(copy.referencedSOPInstanceUID) +, studyInstanceUID(copy.studyInstanceUID) +, seriesInstanceUID(copy.seriesInstanceUID) +, referencedFrameNumber(copy.referencedFrameNumber) +, patientID(copy.patientID) +, referencedPresentationLUTInstanceUID(copy.referencedPresentationLUTInstanceUID) +, imageDepth(copy.imageDepth) +{ +} + +DVPSImageBoxContent::~DVPSImageBoxContent() +{ +} + +void DVPSImageBoxContent::clear() +{ + sOPInstanceUID.clear(); + imageBoxPosition.clear(); + polarity.clear(); + magnificationType.clear(); + configurationInformation.clear(); + smoothingType.clear(); + requestedImageSize.clear(); + requestedDecimateCropBehavior.clear(); + retrieveAETitle.clear(); + referencedSOPClassUID.clear(); + referencedSOPInstanceUID.clear(); + studyInstanceUID.clear(); + seriesInstanceUID.clear(); + referencedFrameNumber.clear(); + patientID.clear(); + referencedPresentationLUTInstanceUID.clear(); + imageDepth = DVPSN_undefined; + return; +} + +OFCondition DVPSImageBoxContent::setContent( + const char *instanceuid, + const char *retrieveaetitle, + const char *refstudyuid, + const char *refseriesuid, + const char *refsopclassuid, + const char *refsopinstanceuid, + const char *requestedimagesize, + const char *patientid, + const char *presentationlutreference) +{ + OFCondition result = EC_Normal; + if (refstudyuid && refseriesuid && instanceuid && retrieveaetitle && refsopclassuid && refsopinstanceuid) + { + clear(); + result = sOPInstanceUID.putString(instanceuid); + if (EC_Normal == result) result = retrieveAETitle.putString(retrieveaetitle); + if (EC_Normal == result) result = referencedSOPClassUID.putString(refsopclassuid); + if (EC_Normal == result) result = referencedSOPInstanceUID.putString(refsopinstanceuid); + if (EC_Normal == result) result = studyInstanceUID.putString(refstudyuid); + if (EC_Normal == result) result = seriesInstanceUID.putString(refseriesuid); + if (requestedimagesize && (EC_Normal == result)) result = requestedImageSize.putString(requestedimagesize); + if (patientid && (EC_Normal == result)) result = patientID.putString(patientid); + if (presentationlutreference && (EC_Normal == result)) result = referencedPresentationLUTInstanceUID.putString(presentationlutreference); + } else result = EC_IllegalCall; + return result; +} + +OFCondition DVPSImageBoxContent::read(DcmItem &dset, DVPSPresentationLUT_PList& presentationLUTList) +{ + DcmSequenceOfItems *seq; + DcmItem *item; + OFCondition result = EC_Normal; + DcmStack stack; + OFString aString; + + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, imageBoxPosition) + READ_FROM_DATASET(DcmCodeString, EVR_CS, polarity) + READ_FROM_DATASET(DcmCodeString, EVR_CS, magnificationType) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET(DcmShortText, EVR_ST, configurationInformation) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET(DcmCodeString, EVR_CS, smoothingType) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET(DcmDecimalString, EVR_DS, requestedImageSize) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET(DcmCodeString, EVR_CS, requestedDecimateCropBehavior) + if (result==EC_TagNotFound) result = EC_Normal; + + if (result==EC_Normal) + { + stack.clear(); + if (EC_Normal == dset.search(DCM_ReferencedImageSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + item = seq->getItem(0); + stack.clear(); + + READ_FROM_DATASET2(DcmApplicationEntity, EVR_AE, retrieveAETitle) + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedSOPClassUID) + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedSOPInstanceUID) + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, studyInstanceUID) + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, seriesInstanceUID) + READ_FROM_DATASET2(DcmIntegerString, EVR_IS, referencedFrameNumber) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmLongString, EVR_LO, patientID) + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("found ReferencedImageSequence in Stored Print Image Box with number of items != 1"); + } + } + } + + if (result==EC_Normal) + { + // check referenced presentation LUT sequence + // if there is any reference, it must refer to one of the presentation LUTs we are managing. + stack.clear(); + if (EC_Normal == dset.search(DCM_ReferencedPresentationLUTSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + item = seq->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID) + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + referencedPresentationLUTInstanceUID.getOFString(aString,0); + if (NULL == presentationLUTList.findPresentationLUT(aString.c_str())) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("ImageBoxContentSequence presentation LUT reference cannot be resolved"); + } + } + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("found ImageBoxContentSequence in Stored Print with ReferencedPresentationLUTSequence number of items != 1"); + } + } + } + + /* the following attributes belong to the ReferencedImageSequence */ + + if (result==EC_Normal) + { + stack.clear(); + if (EC_Normal == dset.search(DCM_RETIRED_ReferencedImageOverlayBoxSequence, stack, ESM_fromHere, OFFalse)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("Stored Print: retired ReferencedImageOverlayBoxSequence not supported"); + + } + } + + /* Now perform basic sanity checks */ + + if (result==EC_Normal) + { + if ((sOPInstanceUID.getLength() == 0)||(sOPInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("SOPInstanceUID missing or incorrect in Stored Print Image Box"); + } + if ((imageBoxPosition.getLength() == 0)||(imageBoxPosition.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("ImageBoxPosition missing or incorrect in Stored Print Image Box"); + } + if (retrieveAETitle.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("RetrieveAETitle missing in Stored Print Image Box"); + } + if ((referencedSOPClassUID.getLength() == 0)||(referencedSOPClassUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("ReferencedSOPClassUID missing or incorrect in Stored Print Image Box"); + } + if ((referencedSOPInstanceUID.getLength() == 0)||(referencedSOPInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("ReferencedSOPInstanceUID missing or incorrect in Stored Print Image Box"); + } + if ((studyInstanceUID.getLength() == 0)||(studyInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("StudyInstanceUID missing or incorrect in Stored Print Image Box"); + } + if ((seriesInstanceUID.getLength() == 0)||(seriesInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("SeriesInstanceUID missing or incorrect in Stored Print Image Box"); + } + if (referencedFrameNumber.getVM() > 1) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("ReferencedFrameNumber VM>1 in Stored Print Image Box"); + } + } + + return result; +} + +OFCondition DVPSImageBoxContent::write(DcmItem &dset, OFBool writeRequestedImageSize, OFBool writeReferencedPLUTSQ) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + /* before writing anything, check that we are able to write a correct item */ + if (sOPInstanceUID.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Image Box: SOPInstanceUID empty"); + } + if (imageBoxPosition.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Image Box: ImageBoxPosition empty"); + } + if (retrieveAETitle.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Image Box: RetrieveAETitle empty"); + } + if (referencedSOPClassUID.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Image Box: ReferencedSOPClassUID empty"); + } + if (referencedSOPInstanceUID.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Image Box: ReferencedSOPInstanceUID empty"); + } + if (studyInstanceUID.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Image Box: StudyInstanceUID empty"); + } + if (seriesInstanceUID.getLength() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("cannot write Stored Print Image Box: SeriesInstanceUID empty"); + } + + ADD_TO_DATASET(DcmUniqueIdentifier, sOPInstanceUID) + ADD_TO_DATASET(DcmUnsignedShort, imageBoxPosition) + ADD_TO_DATASET(DcmCodeString, polarity) + if (magnificationType.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, magnificationType) } + if (configurationInformation.getLength() > 0) { ADD_TO_DATASET(DcmShortText, configurationInformation) } + if (smoothingType.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, smoothingType) } + if ((writeRequestedImageSize)&&(requestedImageSize.getLength() > 0)) { ADD_TO_DATASET(DcmDecimalString, requestedImageSize) } + if (requestedDecimateCropBehavior.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, requestedDecimateCropBehavior) } + + if (result == EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + dseq = new DcmSequenceOfItems(DCM_ReferencedImageSequence); + if (dseq) + { + delem = new DcmApplicationEntity(retrieveAETitle); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUniqueIdentifier(referencedSOPClassUID); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUniqueIdentifier(referencedSOPInstanceUID); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUniqueIdentifier(studyInstanceUID); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUniqueIdentifier(seriesInstanceUID); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + if (referencedFrameNumber.getLength() >0) + { + delem = new DcmIntegerString(referencedFrameNumber); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + } + delem = new DcmLongString(patientID); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + // out of memory during creation of sequence contents. + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } else { + // could allocate item but not sequence. Bail out. + delete ditem; + result = EC_MemoryExhausted; + } + } + else result = EC_MemoryExhausted; + } + + if ((EC_Normal == result) && writeReferencedPLUTSQ) + result = addReferencedPLUTSQ(dset); + + return result; +} + +OFCondition DVPSImageBoxContent::addReferencedPLUTSQ(DcmItem &dset) +{ + if (referencedPresentationLUTInstanceUID.getLength() == 0) return EC_Normal; + + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(DCM_ReferencedPresentationLUTSequence); + DcmItem *ditem = new DcmItem(); + + if (ditem && dseq) + { + ADD_TO_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID) + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + delete dseq; + delete ditem; + } + } else { + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + return result; +} + +OFCondition DVPSImageBoxContent::prepareBasicImageBox(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_TO_DATASET(DcmUnsignedShort, imageBoxPosition) + if (polarity.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, polarity) } + if (magnificationType.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, magnificationType) } + if (configurationInformation.getLength() > 0) { ADD_TO_DATASET(DcmShortText, configurationInformation) } + if (smoothingType.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, smoothingType) } + if (requestedImageSize.getLength() > 0) { ADD_TO_DATASET(DcmDecimalString, requestedImageSize) } + if (requestedDecimateCropBehavior.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, requestedDecimateCropBehavior) } + + return result; +} + +OFCondition DVPSImageBoxContent::createDefaultValues(OFBool renumber, unsigned long number, OFBool ignoreEmptyImages) +{ + OFCondition result = EC_Normal; + char uid[100]; + OFBool isEmpty = OFFalse; + + SET_UID(sOPInstanceUID) + + if (renumber) + { + imageBoxPosition.clear(); + result = imageBoxPosition.putUint16((Uint16)number, 0); + } else { + if (imageBoxPosition.getVM() != 1) isEmpty = OFTrue; + if ((!ignoreEmptyImages)&& isEmpty) result = EC_TagNotFound; + } + + if ((EC_Normal == result)&&((! isEmpty)||(! ignoreEmptyImages))) + { + if (retrieveAETitle.getLength() == 0) result = EC_TagNotFound; + if (referencedSOPClassUID.getLength() == 0) result = EC_TagNotFound; + if (referencedSOPInstanceUID.getLength() == 0) result = EC_TagNotFound; + if (studyInstanceUID.getLength() == 0) result = EC_TagNotFound; + if (seriesInstanceUID.getLength() == 0) result = EC_TagNotFound; + } + return result; +} + +const char *DVPSImageBoxContent::getSOPClassUID() +{ + char *c = NULL; + if (EC_Normal == referencedSOPClassUID.getString(c)) return c; else return NULL; +} + +OFCondition DVPSImageBoxContent::setRequestedDecimateCropBehaviour(DVPSDecimateCropBehaviour value) +{ + switch (value) + { + case DVPSI_decimate: + return requestedDecimateCropBehavior.putString("DECIMATE"); + /* break; */ + case DVPSI_crop: + return requestedDecimateCropBehavior.putString("CROP"); + /* break; */ + case DVPSI_fail: + return requestedDecimateCropBehavior.putString("FAIL"); + /* break; */ + case DVPSI_default: + requestedDecimateCropBehavior.clear(); + break; + } + return EC_Normal; +} + +OFCondition DVPSImageBoxContent::getImageReference( + const char *&studyUID, + const char *&seriesUID, + const char *&instanceUID) +{ + OFCondition result=EC_Normal; + char *astudyUID = NULL; + char *aseriesUID = NULL; + char *aninstanceUID = NULL; + result = studyInstanceUID.getString(astudyUID); + if (EC_Normal == result) result = seriesInstanceUID.getString(aseriesUID); + if (EC_Normal == result) result = referencedSOPInstanceUID.getString(aninstanceUID); + studyUID = astudyUID; + seriesUID = aseriesUID; + instanceUID = aninstanceUID; + return result; +} + +DVPSDecimateCropBehaviour DVPSImageBoxContent::getRequestedDecimateCropBehaviour() +{ + DVPSDecimateCropBehaviour result = DVPSI_default; + char *c = NULL; + if ((EC_Normal == requestedDecimateCropBehavior.getString(c))&& c) + { + OFString aString(c); + if (aString == "DECIMATE") result = DVPSI_decimate; + else if (aString == "CROP") result = DVPSI_crop; + else if (aString == "FAIL") result = DVPSI_fail; + } + return result; +} + +const char *DVPSImageBoxContent::getPolarity() +{ + char *c = NULL; + if (EC_Normal == polarity.getString(c)) return c; else return NULL; +} + +const char *DVPSImageBoxContent::getRequestedImageSize() +{ + char *c = NULL; + if (EC_Normal == requestedImageSize.getString(c)) return c; else return NULL; +} + +const char *DVPSImageBoxContent::getMagnificationType() +{ + char *c = NULL; + if (EC_Normal == magnificationType.getString(c)) return c; else return NULL; +} + +const char *DVPSImageBoxContent::getSmoothingType() +{ + char *c = NULL; + if (EC_Normal == smoothingType.getString(c)) return c; else return NULL; +} + +const char *DVPSImageBoxContent::getConfigurationInformation() +{ + char *c = NULL; + if (EC_Normal == configurationInformation.getString(c)) return c; else return NULL; +} + +const char *DVPSImageBoxContent::getReferencedPresentationLUTInstanceUID() +{ + char *c = NULL; + if (EC_Normal == referencedPresentationLUTInstanceUID.getString(c)) return c; else return NULL; +} + +OFCondition DVPSImageBoxContent::setPolarity(const char *value) +{ + OFCondition result = EC_IllegalCall; + if ((value==NULL)||(strlen(value)==0)) + { + polarity.clear(); + result = EC_Normal; + } else { + if ((result = polarity.putString(value)) == EC_Normal) + { + OFString str; + if ((result = polarity.getOFString(str, 0, OFTrue)) == EC_Normal) + { + if ((str == "NORMAL") || (str == "REVERSE")) + result = EC_Normal; + } + } + } + return result; +} + +OFCondition DVPSImageBoxContent::setRequestedImageSize(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + requestedImageSize.clear(); + return EC_Normal; + } + return requestedImageSize.putString(value); +} + +OFCondition DVPSImageBoxContent::setMagnificationType(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + magnificationType.clear(); + return EC_Normal; + } + return magnificationType.putString(value); +} + +OFCondition DVPSImageBoxContent::setSmoothingType(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + smoothingType.clear(); + return EC_Normal; + } + return smoothingType.putString(value); +} + +OFCondition DVPSImageBoxContent::setConfigurationInformation(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + configurationInformation.clear(); + return EC_Normal; + } + return configurationInformation.putString(value); +} + +OFCondition DVPSImageBoxContent::setSOPInstanceUID(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) return EC_IllegalCall; + return sOPInstanceUID.putString(value); +} + +const char *DVPSImageBoxContent::getSOPInstanceUID() +{ + char *c = NULL; + if (EC_Normal == sOPInstanceUID.getString(c)) return c; else return NULL; +} + +OFCondition DVPSImageBoxContent::setDefault() +{ + magnificationType.clear(); + smoothingType.clear(); + configurationInformation.clear(); + return EC_Normal; +} + +OFBool DVPSImageBoxContent::hasAdditionalSettings() +{ + if (magnificationType.getLength() > 0) return OFTrue; + if (smoothingType.getLength() > 0) return OFTrue; + if (configurationInformation.getLength() > 0) return OFTrue; + return OFFalse; +} + +OFBool DVPSImageBoxContent::matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align) const +{ + OFBool result = OFFalse; + switch (align) + { + case DVPSK_shape: // always matches + result = OFTrue; + break; + case DVPSK_table8: + if (imageDepth != DVPSN_12bit) result = OFTrue; + break; + case DVPSK_table12: + if (imageDepth != DVPSN_8bit) result = OFTrue; + break; + case DVPSK_other: // never matches + break; + } + return result; +} + + +OFBool DVPSImageBoxContent::printSCPSet( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + DcmDataset &imageDataset, + DVPSPrintPresentationLUTAlignment align, + OFBool presentationLUTnegotiated) +{ + OFBool result = OFTrue; + DcmStack stack; + OFCondition writeresult = EC_Normal; + DcmElement *delem = NULL; + + rspDataset = new DcmDataset; + if ((rqDataset == NULL)||(rspDataset == NULL)) + { + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + + // image(Box)Position + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)imageBoxPosition.getTag(), stack, ESM_fromHere, OFFalse))) + { + imageBoxPosition = *((DcmUnsignedShort *)(stack.top())); + // the image box position is checked elsewhere + ADD_TO_PDATASET(DcmUnsignedShort, imageBoxPosition) + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: attribute (2020,0010) Image Position missing."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // magnificationType + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)magnificationType.getTag(), stack, ESM_fromHere, OFFalse))) + { + magnificationType = *((DcmCodeString *)(stack.top())); + Uint32 numMagnifications = cfg.getTargetPrinterNumberOfMagnificationTypes(cfgname); + OFString theMagnification; + OFString aString; + OFBool found = OFFalse; + magnificationType.getOFString(theMagnification, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)smoothingType.getTag(), stack, ESM_fromHere, OFFalse))) + { + smoothingType = *((DcmCodeString *)(stack.top())); + Uint32 numSmoothings = cfg.getTargetPrinterNumberOfSmoothingTypes(cfgname); + OFString theSmoothing; + OFString aString; + OFBool found = OFFalse; + smoothingType.getOFString(theSmoothing, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)configurationInformation.getTag(), stack, ESM_fromHere, OFFalse))) + { + configurationInformation = *((DcmShortText *)(stack.top())); + Uint32 numConfigurationInformation = cfg.getTargetPrinterNumberOfConfigurationSettings(cfgname); + if (numConfigurationInformation == 0) // we don't support configuration information + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: configuration information requested but not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theConfiguration; + OFBool found = OFFalse; + configurationInformation.getOFString(theConfiguration, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)polarity.getTag(), stack, ESM_fromHere, OFFalse))) + { + polarity = *((DcmCodeString *)(stack.top())); + OFString thePolarity; + polarity.getOFString(thePolarity, 0, OFTrue); + if ((thePolarity != "NORMAL")&&(thePolarity != "REVERSE")) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal polarity: '" << thePolarity.c_str() << "'"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmCodeString, polarity) + } + } + } + + // requestedImageSize + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)requestedImageSize.getTag(), stack, ESM_fromHere, OFFalse))) + { + if (! cfg.getTargetPrinterSupportsRequestedImageSize(cfgname)) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: requested image size not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + else + { + requestedImageSize = *((DcmDecimalString *)(stack.top())); + // we don't check a requested image size set by the user (for now) + ADD_TO_PDATASET(DcmDecimalString, requestedImageSize) + } + } + } + + // requestedDecimateCropBehavior + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)requestedDecimateCropBehavior.getTag(), stack, ESM_fromHere, OFFalse))) + { + if (! cfg.getTargetPrinterSupportsDecimateCrop(cfgname)) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: requested decimate/crop behaviour not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + else + { + requestedDecimateCropBehavior = *((DcmCodeString *)(stack.top())); + + OFString theBehaviour; + requestedDecimateCropBehavior.getOFString(theBehaviour, 0, OFTrue); + if ((theBehaviour != "DECIMATE")&&(theBehaviour != "CROP")&&(theBehaviour != "FAIL")) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal decimate/crop behaviour: '" << theBehaviour.c_str() << "'"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmCodeString, requestedDecimateCropBehavior) + } + } + } + } + + // basicGrayscaleImageSequence + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search(DCM_BasicGrayscaleImageSequence, stack, ESM_fromHere, OFFalse))) + { + DcmSequenceOfItems *seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + DcmItem *item = seq->getItem(0); + result = printSCPEvaluateBasicGrayscaleImageSequence(cfg, cfgname, item, rsp, imageDataset, align, presentationLUTnegotiated); + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: basic grayscale image sequence number of items != 1"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: basic grayscale image sequence missing."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // browse through rqDataset and check for unsupported attributes + if (result && rqDataset) + { + OFBool intoSub = OFTrue; + stack.clear(); + while (EC_Normal == rqDataset->nextObject(stack, intoSub)) + { + intoSub = OFFalse; + const DcmTagKey& currentTag = (stack.top())->getTag(); + if (currentTag.getElement() == 0x0000) /* group length */ ; + else if (currentTag == DCM_ImageBoxPosition) /* OK */ ; + else if (currentTag == DCM_Polarity) /* OK */ ; + else if (currentTag == DCM_RequestedDecimateCropBehavior) /* OK */ ; + else if (currentTag == DCM_RequestedImageSize) /* OK */ ; + else if (currentTag == DCM_MagnificationType) /* OK */ ; + else if (currentTag == DCM_SmoothingType) /* OK */ ; + else if (currentTag == DCM_ConfigurationInformation) /* OK */ ; + else if (currentTag == DCM_BasicGrayscaleImageSequence) /* OK */ ; + else + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: unsupported attribute received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // if n-set was successful, send back response dataset + if (result && (EC_Normal == writeresult)) + { + rsp.msg.NSetRSP.DataSetType = DIMSE_DATASET_PRESENT; + } else { + delete rspDataset; + rspDataset = NULL; + if (rsp.msg.NSetRSP.DimseStatus == 0) rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + return result; +} + + +OFBool DVPSImageBoxContent::printSCPEvaluateBasicGrayscaleImageSequence( + DVConfiguration& cfg, + const char *cfgname, + DcmItem *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset &imageDataset, + DVPSPrintPresentationLUTAlignment align, + OFBool presentationLUTnegotiated) +{ + OFBool result = OFTrue; + DcmStack stack; + OFCondition writeresult = EC_Normal; + DcmElement *delem = NULL; + DcmDataset *rspDataset = &imageDataset; + + if (rqDataset == NULL) + { + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + + DcmUnsignedShort samplesPerPixel(DCM_SamplesPerPixel); + DcmCodeString photometricInterpretation(DCM_PhotometricInterpretation); + DcmUnsignedShort rows(DCM_Rows); + DcmUnsignedShort columns(DCM_Columns); + DcmIntegerString pixelAspectRatio(DCM_PixelAspectRatio); + DcmUnsignedShort bitsAllocated(DCM_BitsAllocated); + DcmUnsignedShort bitsStored(DCM_BitsStored); + DcmUnsignedShort highBit(DCM_HighBit); + DcmUnsignedShort pixelRepresentation(DCM_PixelRepresentation); + DcmPixelData *pixelData = NULL; + Uint16 val=0; + char newuid[70]; + OFString aString; + + // samplesPerPixel + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)samplesPerPixel.getTag(), stack, ESM_fromHere, OFFalse))) + { + samplesPerPixel = *((DcmUnsignedShort *)(stack.top())); + val = 0; + if ((EC_Normal == samplesPerPixel.getUint16(val,0)) && (val == 1)) + { + ADD_TO_PDATASET(DcmUnsignedShort, samplesPerPixel) + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal samples per pixel value: " << val); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: samples per pixel missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // rows + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)rows.getTag(), stack, ESM_fromHere, OFFalse))) + { + rows = *((DcmUnsignedShort *)(stack.top())); + val = 0; + if ((EC_Normal == rows.getUint16(val,0)) && (val > 0)) + { + ADD_TO_PDATASET(DcmUnsignedShort, rows) + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal rows value: " << val); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: rows missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // columns + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)columns.getTag(), stack, ESM_fromHere, OFFalse))) + { + columns = *((DcmUnsignedShort *)(stack.top())); + val = 0; + if ((EC_Normal == columns.getUint16(val,0)) && (val > 0)) + { + ADD_TO_PDATASET(DcmUnsignedShort, columns) + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal columns value: " << val); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: columns missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + Uint16 bitsStoredValue = 0; + + // bitsStored + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)bitsStored.getTag(), stack, ESM_fromHere, OFFalse))) + { + bitsStored = *((DcmUnsignedShort *)(stack.top())); + val = 0; + if ((EC_Normal == bitsStored.getUint16(val,0)) && ((val == 8) || (val == 12))) + { + bitsStoredValue = val; + if (bitsStoredValue==8) imageDepth = DVPSN_8bit; else imageDepth = DVPSN_12bit; + OFBool supports12Bit = cfg.getTargetPrinterSupports12BitTransmission(cfgname); + if ((bitsStoredValue == 12)&&(! supports12Bit)) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: image transmission with 12 bits/pixel not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + if (presentationLUTnegotiated && (cfg.getTargetPrinterPresentationLUTMatchRequired(cfgname)) && (! matchesPresentationLUT(align))) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: image data with " << bitsStoredValue << " bits/pixel does not match characteristics of active Presentation LUT."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmUnsignedShort, bitsStored) + } + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal bits stored value: " << val); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: bits stored missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // bitsAllocated + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)bitsAllocated.getTag(), stack, ESM_fromHere, OFFalse))) + { + bitsAllocated = *((DcmUnsignedShort *)(stack.top())); + val = 0; + if ((EC_Normal == bitsAllocated.getUint16(val,0)) && (((val == 8)&&(bitsStoredValue == 8)) || ((val == 16)&&(bitsStoredValue == 12)))) + { + ADD_TO_PDATASET(DcmUnsignedShort, bitsAllocated) + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal bits allocated value: " << val); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: bits allocated missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // highBit + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)highBit.getTag(), stack, ESM_fromHere, OFFalse))) + { + highBit = *((DcmUnsignedShort *)(stack.top())); + val = 0; + if ((EC_Normal == highBit.getUint16(val,0)) && (((val == 7)&&(bitsStoredValue == 8)) || ((val == 11)&&(bitsStoredValue == 12)))) + { + ADD_TO_PDATASET(DcmUnsignedShort, highBit) + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal high bit value: " << val); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: high bit missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // pixelRepresentation + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)pixelRepresentation.getTag(), stack, ESM_fromHere, OFFalse))) + { + pixelRepresentation = *((DcmUnsignedShort *)(stack.top())); + val = 0; + if ((EC_Normal == pixelRepresentation.getUint16(val,0)) && (val == 0)) + { + ADD_TO_PDATASET(DcmUnsignedShort, pixelRepresentation) + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal pixel representation value: " << val); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: pixel representation missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // photometricInterpretation + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)photometricInterpretation.getTag(), stack, ESM_fromHere, OFFalse))) + { + photometricInterpretation = *((DcmCodeString *)(stack.top())); + OFString theColorModel; + photometricInterpretation.getOFString(theColorModel, 0, OFTrue); + if ((theColorModel != "MONOCHROME1")&&(theColorModel != "MONOCHROME2")) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal photometric interpretation: '" << theColorModel.c_str() << "'"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmCodeString, photometricInterpretation) + } + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: photometric interpretation missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // pixelAspectRatio + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)pixelAspectRatio.getTag(), stack, ESM_fromHere, OFFalse))) + { + pixelAspectRatio = *((DcmIntegerString *)(stack.top())); + if (pixelAspectRatio.getVM() != 2) + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: illegal pixel aspect ratio, VM=: '" << pixelAspectRatio.getVM()); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmIntegerString, pixelAspectRatio) + } + } + } + + // pixelData + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search(DCM_PixelData, stack, ESM_fromHere, OFFalse))) + { + pixelData = new DcmPixelData(DCM_PixelData); + if (pixelData) + { + DcmElement *oldPxData = (DcmElement *)(stack.top()); + Uint16 *pxdata16 = NULL; + Uint8 *pxdata8 = NULL; + if ((EC_Normal == oldPxData->getUint16Array(pxdata16)) && pxdata16) + { + pixelData->putUint16Array(pxdata16, oldPxData->getLength()/sizeof(Uint16)); + rspDataset->insert(pixelData, OFTrue /*replaceOld*/); + } + else if ((EC_Normal == oldPxData->getUint8Array(pxdata8)) && pxdata8) + { + pixelData->putUint8Array(pxdata8, oldPxData->getLength()/sizeof(Uint8)); + rspDataset->insert(pixelData, OFTrue /*replaceOld*/); + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: cannot access pixel data"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } else writeresult=EC_MemoryExhausted; + } else { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: pixel data missing in basic grayscale image sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // browse through rqDataset and check for unsupported attributes + if (result && rqDataset) + { + OFBool intoSub = OFTrue; + stack.clear(); + while (EC_Normal == rqDataset->nextObject(stack, intoSub)) + { + intoSub = OFFalse; + const DcmTagKey& currentTag = (stack.top())->getTag(); + if (currentTag.getElement() == 0x0000) /* group length */ ; + else if (currentTag == DCM_SamplesPerPixel) /* OK */ ; + else if (currentTag == DCM_PhotometricInterpretation) /* OK */ ; + else if (currentTag == DCM_Rows) /* OK */ ; + else if (currentTag == DCM_Columns) /* OK */ ; + else if (currentTag == DCM_PixelAspectRatio) /* OK */ ; + else if (currentTag == DCM_BitsAllocated) /* OK */ ; + else if (currentTag == DCM_BitsStored) /* OK */ ; + else if (currentTag == DCM_HighBit) /* OK */ ; + else if (currentTag == DCM_PixelRepresentation) /* OK */ ; + else if (currentTag == DCM_PixelData) /* OK */ ; + else + { + DCMPSTAT_WARN("cannot update Basic Grayscale Image Box: unsupported attribute in basic grayscale image sequence:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // if n-set was successful, send back response dataset + if (result && (EC_Normal == writeresult)) + { + // complete Hardcopy Grayscale Image + + // write patient module + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_PatientName, DEFAULT_patientName); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_PatientID); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_PatientBirthDate); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_PatientSex); + + // general study and general series modules are written somewhere else + + // Hardcopy Equipment Module + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_RETIRED_HardcopyDeviceManufacturer, "OFFIS"); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_RETIRED_HardcopyDeviceSoftwareVersion, OFFIS_DTK_IMPLEMENTATION_VERSION_NAME); + + // General Image Module + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_InstanceNumber); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_PatientOrientation); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_ImageType, "DERIVED\\SECONDARY"); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_DerivationDescription, "Hardcopy"); + + // SOP Common Module + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_SOPClassUID, UID_RETIRED_HardcopyGrayscaleImageStorage); + if (EC_Normal==writeresult) writeresult = referencedSOPClassUID.putString(UID_RETIRED_HardcopyGrayscaleImageStorage); + dcmGenerateUniqueIdentifier(newuid); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_SOPInstanceUID, newuid); + if (EC_Normal==writeresult) writeresult = referencedSOPInstanceUID.putString(newuid); + DVPSHelper::currentDate(aString); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_InstanceCreationDate, aString.c_str()); + DVPSHelper::currentTime(aString); + if (EC_Normal==writeresult) writeresult = DVPSHelper::putStringValue(rspDataset, DCM_InstanceCreationTime, aString.c_str()); + + } else result = OFFalse; + return result; +} + +Uint16 DVPSImageBoxContent::getImageBoxPosition() +{ + Uint16 result = 0; + if (EC_Normal == imageBoxPosition.getUint16(result, 0)) return result; else return 0; +} + +OFCondition DVPSImageBoxContent::setUIDsAndAETitle(DcmUniqueIdentifier& studyUID, DcmUniqueIdentifier& seriesUID, const char *aetitle) +{ + if (aetitle==NULL) return EC_IllegalCall; + + studyInstanceUID = studyUID; + seriesInstanceUID = seriesUID; + return retrieveAETitle.putString(aetitle); +} diff --git a/dcmpstat/libsrc/dvpsibl.cc b/dcmpstat/libsrc/dvpsibl.cc new file mode 100644 index 00000000..e3768d5a --- /dev/null +++ b/dcmpstat/libsrc/dvpsibl.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 1999-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSImageBoxContent_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsibl.h" +#include "dcmtk/dcmpstat/dvpsib.h" /* for DVPSImageBoxContent */ +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ + +/* --------------- class DVPSImageBoxContent_PList --------------- */ + +DVPSImageBoxContent_PList::DVPSImageBoxContent_PList() +: list_() +{ +} + +DVPSImageBoxContent_PList::DVPSImageBoxContent_PList(const DVPSImageBoxContent_PList &arg) +: list_() +{ + OFListConstIterator(DVPSImageBoxContent *) first = arg.list_.begin(); + OFListConstIterator(DVPSImageBoxContent *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSImageBoxContent_PList::~DVPSImageBoxContent_PList() +{ + clear(); +} + +void DVPSImageBoxContent_PList::clear() +{ + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSImageBoxContent_PList::read(DcmItem &dset, DVPSPresentationLUT_PList& presentationLUTList) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSImageBoxContent *newImage = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_RETIRED_ImageBoxContentSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newImage = new DVPSImageBoxContent(); + if (newImage && ditem) + { + result = newImage->read(*ditem, presentationLUTList); + list_.push_back(newImage); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSImageBoxContent_PList::write( + DcmItem &dset, + OFBool writeRequestedImageSize, + size_t numItems, + OFBool ignoreEmptyImages, + OFBool writeReferencedPLUTSQ) +{ + if (size()==0) return EC_IllegalCall; // can't write if sequence is empty + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + OFBool working = OFTrue; + unsigned long numWritten = 0; + + dseq = new DcmSequenceOfItems(DCM_RETIRED_ImageBoxContentSequence); + if (dseq) + { + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while ((first != last) && working) + { + if ((result==EC_Normal) && ((! ignoreEmptyImages)||((*first)->getImageBoxPosition() > 0))) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem, writeRequestedImageSize, writeReferencedPLUTSQ); + if (result==EC_Normal) + { + dseq->insert(ditem); + numWritten++; + } else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + if (numItems && (--numItems==0)) working=OFFalse; + } + // we're not allowed to store SP objects with empty image box list sequence + if ((result==EC_Normal) && (numWritten > 0)) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + +OFCondition DVPSImageBoxContent_PList::createDefaultValues(OFBool renumber, OFBool ignoreEmptyImages) +{ + if (size()==0) return EC_IllegalCall; // can't write if sequence is empty + OFCondition result = EC_Normal; + unsigned long counter = 1; + + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while ((first != last)&&(EC_Normal == result)) + { + result = (*first)->createDefaultValues(renumber, counter++, ignoreEmptyImages); + ++first; + } + return result; +} + +OFCondition DVPSImageBoxContent_PList::addImageSOPClasses(DcmSequenceOfItems& seq, size_t numItems) +{ + OFCondition result = EC_Normal; + OFBool working = OFTrue; + const char *c = NULL; + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while ((first != last) && working) + { + if (EC_Normal == result) + { + c = (*first)->getSOPClassUID(); + if (c && (! DVPSHelper::haveReferencedUIDItem(seq, c))) result = DVPSHelper::addReferencedUIDItem(seq, c); + } + ++first; + if (numItems && (--numItems==0)) working=OFFalse; + } + return result; +} + +OFCondition DVPSImageBoxContent_PList::addImageBox( + const char *instanceuid, + const char *retrieveaetitle, + const char *refstudyuid, + const char *refseriesuid, + const char *refsopclassuid, + const char *refsopinstanceuid, + const char *requestedimagesize, + const char *patientid, + const char *presentationlutuid) +{ + OFCondition result = EC_Normal; + DVPSImageBoxContent *newImage = new DVPSImageBoxContent(); + if (newImage) + { + result = newImage->setContent(instanceuid, retrieveaetitle, refstudyuid, + refseriesuid, refsopclassuid, refsopinstanceuid, + requestedimagesize, patientid, presentationlutuid); + if (EC_Normal == result) list_.push_back(newImage); else delete newImage; + } else result = EC_MemoryExhausted; + return result; +} + +OFCondition DVPSImageBoxContent_PList::addImageBox(DVPSImageBoxContent * box) +{ + list_.push_back(box); + return(EC_Normal); +} + +OFCondition DVPSImageBoxContent_PList::setRequestedDecimateCropBehaviour(DVPSDecimateCropBehaviour value) +{ + OFCondition result=EC_Normal; + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + result = (*first)->setRequestedDecimateCropBehaviour(value); + if (EC_Normal != result) return result; + ++first; + } + return result; +} + +OFCondition DVPSImageBoxContent_PList::deleteImage(size_t idx) +{ + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while ((first != last)&&(idx--)) ++first; + if (first != last) + { + delete (*first); + list_.erase(first); + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPSImageBoxContent_PList::deleteMultipleImages(size_t number) +{ + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while ((first != last)&&(number--)) + { + delete (*first); + first = list_.erase(first); + } + return EC_Normal; +} + +DVPSImageBoxContent *DVPSImageBoxContent_PList::getImageBox(size_t idx) +{ + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} + +OFBool DVPSImageBoxContent_PList::imageHasAdditionalSettings(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->hasAdditionalSettings(); + return OFFalse; +} + +OFCondition DVPSImageBoxContent_PList::setImagePolarity(size_t idx, const char *value) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->setPolarity(value); + return EC_IllegalCall; +} + +OFCondition DVPSImageBoxContent_PList::setImageRequestedSize(size_t idx, const char *value) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->setRequestedImageSize(value); + return EC_IllegalCall; +} + +OFCondition DVPSImageBoxContent_PList::setImageMagnificationType(size_t idx, const char *value) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->setMagnificationType(value); + return EC_IllegalCall; +} + +OFCondition DVPSImageBoxContent_PList::setImageSmoothingType(size_t idx, const char *value) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->setSmoothingType(value); + return EC_IllegalCall; +} + +OFCondition DVPSImageBoxContent_PList::setImageConfigurationInformation(size_t idx, const char *value) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->setConfigurationInformation(value); + return EC_IllegalCall; +} + +OFCondition DVPSImageBoxContent_PList::setImageSOPInstanceUID(size_t idx, const char *value) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->setSOPInstanceUID(value); + return EC_IllegalCall; +} + +const char *DVPSImageBoxContent_PList::getImagePolarity(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getPolarity(); + return NULL; +} + +const char *DVPSImageBoxContent_PList::getImageRequestedSize(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getRequestedImageSize(); + return NULL; +} + +const char *DVPSImageBoxContent_PList::getImageMagnificationType(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getMagnificationType(); + return NULL; +} + +const char *DVPSImageBoxContent_PList::getImageSmoothingType(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getSmoothingType(); + return NULL; +} + +const char *DVPSImageBoxContent_PList::getImageConfigurationInformation(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getConfigurationInformation(); + return NULL; +} + +const char *DVPSImageBoxContent_PList::getSOPInstanceUID(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getSOPInstanceUID(); + return NULL; +} + +const char *DVPSImageBoxContent_PList::getReferencedPresentationLUTInstanceUID(size_t idx) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getReferencedPresentationLUTInstanceUID(); + return NULL; +} + +OFCondition DVPSImageBoxContent_PList::setAllImagesToDefault() +{ + OFCondition result = EC_Normal; + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + result = (*first)->setDefault(); + ++first; + if (EC_Normal != result) return result; + } + return result; +} + +OFCondition DVPSImageBoxContent_PList::getImageReference(size_t idx, const char *&studyUID, const char *&seriesUID, const char *&instanceUID) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->getImageReference(studyUID, seriesUID, instanceUID); + return EC_IllegalCall; +} + +OFCondition DVPSImageBoxContent_PList::prepareBasicImageBox(size_t idx, DcmItem &dset) +{ + DVPSImageBoxContent *box = getImageBox(idx); + if (box) return box->prepareBasicImageBox(dset); + return EC_IllegalCall; +} + +OFBool DVPSImageBoxContent_PList::presentationLUTInstanceUIDisUsed(const char *uid) +{ + OFString uidS; + if (uid) uidS = uid; + const char *c; + + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + c = (*first)->getReferencedPresentationLUTInstanceUID(); + if (c && (uidS == c)) return OFTrue; + ++first; + } + return OFFalse; +} + +const char *DVPSImageBoxContent_PList::haveSinglePresentationLUTUsed(const char *filmBox) +{ + OFList uidList; + if (filmBox==NULL) filmBox = ""; + const char *c; + OFString aString; + OFBool found; + OFListIterator(char *) uidfirst; + OFListIterator(char *) uidlast; + + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + c = (*first)->getReferencedPresentationLUTInstanceUID(); + if ((c == NULL)||(strlen(c)==0)) c = filmBox; + aString = c; // aString now contains the UID of the P-LUT to be used for this image, if any. + uidfirst = uidList.begin(); + uidlast = uidList.end(); + found = OFFalse; + while (uidfirst != uidlast) + { + if (aString == (*uidfirst)) + { + found = OFTrue; + break; + } + ++uidfirst; + } + if (!found) uidList.push_back((char *)c); + ++first; + } + + if (uidList.size()==1) return *(uidList.begin()); // if there is only one LUT, return it + return NULL; +} + + +OFBool DVPSImageBoxContent_PList::printSCPCreate( + unsigned long numBoxes, + DcmUniqueIdentifier& studyUID, + DcmUniqueIdentifier& seriesUID, + const char *aetitle) +{ + clear(); + DVPSImageBoxContent *box = NULL; + char uid[100]; + for (unsigned long i=0; isetSOPInstanceUID(dcmGenerateUniqueIdentifier(uid))) && + (EC_Normal == box->setUIDsAndAETitle(studyUID, seriesUID, aetitle))) + { + list_.push_back(box); + } + else + { + delete box; + return OFFalse; + } + } else return OFFalse; + } + return OFTrue; +} + + +OFCondition DVPSImageBoxContent_PList::writeReferencedImageBoxSQ(DcmItem &dset) +{ + if (size()==0) return EC_IllegalCall; // can't write if sequence is empty + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + DcmUniqueIdentifier *uid=NULL; + const char *instanceUID=NULL; + + dseq = new DcmSequenceOfItems(DCM_ReferencedImageBoxSequence); + if (dseq) + { + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + uid = new DcmUniqueIdentifier(DCM_ReferencedSOPClassUID); + if (uid) result = uid->putString(UID_BasicGrayscaleImageBoxSOPClass); else result = EC_MemoryExhausted; + if (EC_Normal == result) result = ditem->insert(uid, OFTrue /*replaceOld*/); else delete uid; + + uid = new DcmUniqueIdentifier(DCM_ReferencedSOPInstanceUID); + instanceUID = (*first)->getSOPInstanceUID(); + if (uid && instanceUID) result = uid->putString(instanceUID); else result = EC_MemoryExhausted; + if (EC_Normal == result) result = ditem->insert(uid, OFTrue /*replaceOld*/); else delete uid; + + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + + +OFBool DVPSImageBoxContent_PList::matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align) const +{ + OFBool result = OFTrue; + OFListConstIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListConstIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + result = result && (*first)->matchesPresentationLUT(align); + ++first; + } + return result; +} + + +DVPSImageBoxContent *DVPSImageBoxContent_PList::duplicateImageBox(const char *uid) +{ + if (uid == NULL) return NULL; + + OFString aString(uid); + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + if (aString == (*first)->getSOPInstanceUID()) return (*first)->clone(); + ++first; + } + return NULL; +} + +OFBool DVPSImageBoxContent_PList::haveImagePositionClash(const char *uid, Uint16 position) +{ + if (uid == NULL) return OFFalse; + + OFString aString(uid); + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + if (((*first)->getImageBoxPosition() == position)&&(aString != (*first)->getSOPInstanceUID())) return OFTrue; //clash + ++first; + } + return OFFalse; +} + + +void DVPSImageBoxContent_PList::replace(DVPSImageBoxContent *newImageBox) +{ + if (! newImageBox) return; + + OFString aString(newImageBox->getSOPInstanceUID()); + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + if (aString == (*first)->getSOPInstanceUID()) + { + delete (*first); + first = list_.erase(first); + } + else ++first; + } + list_.push_back(newImageBox); +} + +OFBool DVPSImageBoxContent_PList::emptyPageWarning() +{ + OFListIterator(DVPSImageBoxContent *) first = list_.begin(); + OFListIterator(DVPSImageBoxContent *) last = list_.end(); + while (first != last) + { + if ((*first)->getImageBoxPosition() > 0) return OFFalse; + ++first; + } + return OFTrue; +} diff --git a/dcmpstat/libsrc/dvpsmsg.cc b/dcmpstat/libsrc/dvpsmsg.cc new file mode 100644 index 00000000..b0e5f273 --- /dev/null +++ b/dcmpstat/libsrc/dvpsmsg.cc @@ -0,0 +1,413 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSIPCMessage + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#ifdef HAVE_WINDOWS_H +// on Windows, we need Winsock2 for network functions +#include +#endif + +#include "dcmtk/dcmnet/dcompat.h" +#include "dcmtk/dcmpstat/dvpsmsg.h" +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ +#include "dcmtk/ofstd/ofbmanip.h" /* for OFBitmanipTemplate<> */ +#include "dcmtk/dcmdata/dcswap.h" /* for swapIfNecessary() */ +#include "dcmtk/dcmnet/dcmtrans.h" /* for class DcmTransportConnection */ +#include "dcmtk/ofstd/ofsockad.h" +#include "dcmtk/ofstd/ofstd.h" + +/* --------------- class DVPSIPCMessage --------------- */ + +#define PAYLOAD_ALLOCATION_UNIT 1024 +#define PAYLOAD_OFFSET 8 + +// constants for message type +const Uint32 DVPSIPCMessage::OK = 0; +const Uint32 DVPSIPCMessage::requestApplicationID = 1; +const Uint32 DVPSIPCMessage::assignApplicationID = 2; +const Uint32 DVPSIPCMessage::applicationTerminates = 3; +const Uint32 DVPSIPCMessage::receivedUnencryptedDICOMConnection = 5; +const Uint32 DVPSIPCMessage::receivedEncryptedDICOMConnection = 7; +const Uint32 DVPSIPCMessage::connectionClosed = 9; +const Uint32 DVPSIPCMessage::connectionAborted = 11; +const Uint32 DVPSIPCMessage::requestedUnencryptedDICOMConnection = 13; +const Uint32 DVPSIPCMessage::requestedEncryptedDICOMConnection = 15; +const Uint32 DVPSIPCMessage::receivedDICOMObject = 17; +const Uint32 DVPSIPCMessage::sentDICOMObject = 19; + +// message status constants +const Uint32 DVPSIPCMessage::statusOK = 0; +const Uint32 DVPSIPCMessage::statusWarning = 1; +const Uint32 DVPSIPCMessage::statusError = 2; + +// client type constants +const Uint32 DVPSIPCMessage::clientOther = 0; +const Uint32 DVPSIPCMessage::clientStoreSCP = 1; +const Uint32 DVPSIPCMessage::clientStoreSCU = 2; +const Uint32 DVPSIPCMessage::clientPrintSCP = 3; +const Uint32 DVPSIPCMessage::clientPrintSCU = 4; +const Uint32 DVPSIPCMessage::clientQRSCP = 5; + + +DVPSIPCMessage::DVPSIPCMessage() +: messageType(OK) +, payloadUsed(PAYLOAD_OFFSET) +, payloadAllocated(PAYLOAD_ALLOCATION_UNIT) +, payloadReadOffset(PAYLOAD_OFFSET) +, payload(NULL) +{ + payload = new unsigned char[payloadAllocated]; +} + +DVPSIPCMessage::DVPSIPCMessage(const DVPSIPCMessage& copy) +: messageType(copy.messageType) +, payloadUsed(copy.payloadUsed) +, payloadAllocated(copy.payloadAllocated) +, payloadReadOffset(copy.payloadReadOffset) +, payload(NULL) +{ + payload = new unsigned char[payloadAllocated]; + OFBitmanipTemplate::copyMem(copy.payload, payload, payloadUsed); +} + +DVPSIPCMessage::~DVPSIPCMessage() +{ + delete[] payload; +} + +DVPSIPCMessage& DVPSIPCMessage::operator=(const DVPSIPCMessage& copy) +{ + messageType = copy.messageType; + payloadUsed = copy.payloadUsed; + payloadReadOffset = copy.payloadReadOffset; + if (payloadAllocated < payloadUsed) + { + delete[] payload; + payloadAllocated = copy.payloadAllocated; + payload = new unsigned char[payloadAllocated]; + } + OFBitmanipTemplate::copyMem(copy.payload, payload, payloadUsed); + return *this; +} + +void DVPSIPCMessage::resizePayload(size_t i) +{ + size_t requiredSize = payloadUsed+i; + if (requiredSize < payloadAllocated) return; + + while (payloadAllocated < requiredSize) payloadAllocated += PAYLOAD_ALLOCATION_UNIT; + unsigned char *newpayload = new unsigned char[payloadAllocated]; + OFBitmanipTemplate::copyMem(payload, newpayload, payloadUsed); + delete[] payload; + payload = newpayload; + return; +} + +void DVPSIPCMessage::addStringToPayload(const char *str) +{ + size_t length = 0; + if (str) length = strlen(str); else str = ""; + Uint32 padBytes = 4 - (length % 4); + size_t sizeNeeded = sizeof(Uint32)+length+padBytes; + resizePayload(sizeNeeded); + + // write string length + addIntToPayload(OFstatic_cast(Uint32, length+padBytes)); + + // write string + OFStandard::strlcpy((char *)(payload + payloadUsed), str, (length+padBytes)); + payloadUsed += OFstatic_cast(Uint32, length); + + // write pad bytes + for (Uint32 i=0; i < padBytes; i++) *(payload + payloadUsed++) = 0; + return; +} + +void DVPSIPCMessage::addIntToPayload(Uint32 i) +{ + resizePayload(sizeof(Uint32)); + unsigned char *target = payload + payloadUsed; + // write integer value + *(Uint32 *)target = i; + // and swap to big endian + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, target, sizeof(Uint32), sizeof(Uint32)); + payloadUsed += sizeof(Uint32); + return; +} + +OFBool DVPSIPCMessage::extractStringFromPayload(OFString& str) +{ + Uint32 length = 0; + if (! extractIntFromPayload(length)) return OFFalse; + // check if we have sufficient data available + if (payloadReadOffset + length > payloadUsed) return OFFalse; + + str = (const char *)(payload+payloadReadOffset); // guaranteed to be zero terminated string + payloadReadOffset += length; + return OFTrue; +} + +OFBool DVPSIPCMessage::extractIntFromPayload(Uint32& i) +{ + // check if we have sufficient data available + if (payloadReadOffset + sizeof(Uint32) > payloadUsed) return OFFalse; + + // copy integer into temporary buffer and adjust byte order there + unsigned char *temp = new unsigned char[sizeof(Uint32)+8]; // allocate a bit more than needed to be safe + OFBitmanipTemplate::copyMem(payload+payloadReadOffset, temp, sizeof(Uint32)); + swapIfNecessary(gLocalByteOrder, EBO_BigEndian, temp, sizeof(Uint32), sizeof(Uint32)); + payloadReadOffset += sizeof(Uint32); + + i = *(Uint32 *)temp; + delete[] temp; + return OFTrue; +} + +void DVPSIPCMessage::rewindPayload() +{ + payloadReadOffset = PAYLOAD_OFFSET; +} + +void DVPSIPCMessage::erasePayload() +{ + payloadUsed = PAYLOAD_OFFSET; +} + +OFBool DVPSIPCMessage::send(DcmTransportConnection &connection) +{ + // adjust message type and length + *(Uint32 *)payload = messageType; + *(Uint32 *)(payload + sizeof(Uint32)) = (payloadUsed - PAYLOAD_OFFSET); + swapIfNecessary(EBO_BigEndian, gLocalByteOrder, payload, 2*sizeof(Uint32), sizeof(Uint32)); + + // send + if (connection.write(payload, (size_t)payloadUsed) <= 0) return OFFalse; + return OFTrue; +} + +OFBool DVPSIPCMessage::receive(DcmTransportConnection &connection) +{ + payloadReadOffset = PAYLOAD_OFFSET; + + // read message type and payload length + if (connection.read(payload, 2*sizeof(Uint32)) <= 0) return OFFalse; + swapIfNecessary(gLocalByteOrder, EBO_BigEndian, payload, 2*sizeof(Uint32), sizeof(Uint32)); + messageType = *(Uint32 *)payload; + payloadUsed = *(Uint32 *)(payload+sizeof(Uint32)); + + // check if we need to allocate more memory + Uint32 requiredSize = payloadUsed + PAYLOAD_OFFSET; + if (requiredSize > payloadAllocated) + { + delete[] payload; + while (payloadAllocated < requiredSize) payloadAllocated += PAYLOAD_ALLOCATION_UNIT; + payload = new unsigned char[payloadAllocated]; + } + + // read payload if any + if (payloadUsed > 0) + { + if (connection.read(payload+PAYLOAD_OFFSET, (size_t)payloadUsed) <= 0) + { + payloadUsed = PAYLOAD_OFFSET; + return OFFalse; + } else { + payloadUsed += PAYLOAD_OFFSET; + return OFTrue; + } + } else payloadUsed = PAYLOAD_OFFSET; + return OFTrue; +} + +/* --------------- class DVPSIPCClient --------------- */ + +DVPSIPCClient::DVPSIPCClient(Uint32 clientType, const char *txt, int thePort, OFBool keepOpen) +: port(thePort) +, serverActive(OFTrue) +, applicationID(0) +, keepConnectionOpen(keepOpen) +, connection(NULL) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::requestApplicationID); + msg.addIntToPayload(clientType); + msg.addIntToPayload(DVPSIPCMessage::statusOK); + msg.addStringToPayload(txt); + if (performTransaction(msg)) + { + if ((msg.getMessageType() != DVPSIPCMessage::assignApplicationID) || (! msg.extractIntFromPayload(applicationID))) + { + // protocol violation + serverActive = OFFalse; + } + } else { + serverActive = OFFalse; + } + return; +} + +DVPSIPCClient::~DVPSIPCClient() +{ + if (connection) + { + connection->close(); + delete connection; + } +} + +void DVPSIPCClient::requestConnection() +{ + if (connection) return; // connection already open + +#ifdef _WIN32 + SOCKET s = socket(AF_INET, SOCK_STREAM, 0); + if (s == INVALID_SOCKET) return; +#else + int s = socket(AF_INET, SOCK_STREAM, 0); + if (s < 0) return; +#endif + OFSockAddr server; + OFStandard::getAddressByHostname("localhost", server); + server.setPort(OFstatic_cast(unsigned short, htons(port))); + + if (connect(s, server.getSockaddr(), server.size()) < 0) + { +#ifdef HAVE_WINSOCK_H + (void) shutdown(s, 1 /* SD_SEND */); + (void) closesocket(s); +#else + (void) close(s); +#endif + return; + } + connection = new DcmTCPConnection(s); +} + +OFBool DVPSIPCClient::performTransaction(DVPSIPCMessage& msg) +{ + if (!serverActive) return OFFalse; + + requestConnection(); + // this would be the right place to retry connections + if (connection == NULL) return OFFalse; + + OFBool result = msg.send(*connection); + if (result) result = msg.receive(*connection); + + if (! keepConnectionOpen) + { + connection->close(); + delete connection; + connection = NULL; + } + + return result; +} + +void DVPSIPCClient::notifyApplicationTerminates(Uint32 status) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::applicationTerminates); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + performTransaction(msg); +} + +void DVPSIPCClient::notifyReceivedUnencryptedDICOMConnection(Uint32 status, const char *txt) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::receivedUnencryptedDICOMConnection); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + msg.addStringToPayload(txt); + performTransaction(msg); +} + +void DVPSIPCClient::notifyReceivedEncryptedDICOMConnection(Uint32 status, const char *txt) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::receivedEncryptedDICOMConnection); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + msg.addStringToPayload(txt); + performTransaction(msg); +} + +void DVPSIPCClient::notifyConnectionClosed(Uint32 status) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::connectionClosed); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + performTransaction(msg); +} + +void DVPSIPCClient::notifyConnectionAborted(Uint32 status, const char *txt) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::connectionAborted); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + msg.addStringToPayload(txt); + performTransaction(msg); +} + +void DVPSIPCClient::notifyRequestedUnencryptedDICOMConnection(Uint32 status, const char *txt) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::requestedUnencryptedDICOMConnection); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + msg.addStringToPayload(txt); + performTransaction(msg); +} + +void DVPSIPCClient::notifyRequestedEncryptedDICOMConnection(Uint32 status, const char *txt) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::requestedEncryptedDICOMConnection); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + msg.addStringToPayload(txt); + performTransaction(msg); +} + +void DVPSIPCClient::notifyReceivedDICOMObject(Uint32 status, const char *txt) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::receivedDICOMObject); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + msg.addStringToPayload(txt); + performTransaction(msg); +} + +void DVPSIPCClient::notifySentDICOMObject(Uint32 status, const char *txt) +{ + DVPSIPCMessage msg; + msg.setMessageType(DVPSIPCMessage::sentDICOMObject); + msg.addIntToPayload(applicationID); + msg.addIntToPayload(status); + msg.addStringToPayload(txt); + performTransaction(msg); +} diff --git a/dcmpstat/libsrc/dvpsov.cc b/dcmpstat/libsrc/dvpsov.cc new file mode 100644 index 00000000..b111ac7a --- /dev/null +++ b/dcmpstat/libsrc/dvpsov.cc @@ -0,0 +1,253 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlay + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsov.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + + +/* --------------- class DVPSOverlay --------------- */ + +DVPSOverlay::DVPSOverlay() +: overlayGroup(0) +, overlayRows(DCM_OverlayRows) +, overlayColumns(DCM_OverlayColumns) +, overlayType(DCM_OverlayType) +, overlayOrigin(DCM_OverlayOrigin) +, overlayBitsAllocated(DCM_OverlayBitsAllocated) +, overlayBitPosition(DCM_OverlayBitPosition) +, overlayData(DCM_OverlayData) +, overlayDescription(DCM_OverlayDescription) +, overlayLabel(DCM_OverlayLabel) +{ +} + +DVPSOverlay::DVPSOverlay(const DVPSOverlay& copy) +: overlayGroup(copy.overlayGroup) +, overlayRows(copy.overlayRows) +, overlayColumns(copy.overlayColumns) +, overlayType(copy.overlayType) +, overlayOrigin(copy.overlayOrigin) +, overlayBitsAllocated(copy.overlayBitsAllocated) +, overlayBitPosition(copy.overlayBitPosition) +, overlayData(copy.overlayData) +, overlayDescription(copy.overlayDescription) +, overlayLabel(copy.overlayLabel) +{ +} + +DVPSOverlay::~DVPSOverlay() +{ +} + +OFCondition DVPSOverlay::read(DcmItem &dset, Uint8 ovGroup, Uint8 asGroup) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + if (asGroup==0xFF) asGroup=ovGroup; + overlayGroup = asGroup; + Uint16 gtag = 0x6000 + ovGroup; + + overlayRows.setGTag(gtag); + overlayColumns.setGTag(gtag); + overlayType.setGTag(gtag); + overlayOrigin.setGTag(gtag); + overlayBitsAllocated.setGTag(gtag); + overlayBitPosition.setGTag(gtag); + overlayData.setGTag(gtag); + overlayDescription.setGTag(gtag); + overlayLabel.setGTag(gtag); + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayRows) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayColumns) + READ_FROM_DATASET(DcmCodeString, EVR_CS, overlayType) + READ_FROM_DATASET(DcmSignedShort, EVR_SS, overlayOrigin) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayBitsAllocated) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayBitPosition) + READ_FROM_DATASET(DcmOverlayData, EVR_OverlayData, overlayData) + READ_FROM_DATASET(DcmLongString, EVR_LO, overlayDescription) + READ_FROM_DATASET(DcmLongString, EVR_LO, overlayLabel) + + /* Now perform basic sanity checks and adjust use flags */ + if (overlayRows.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayRows absent or empty"); + } + else if (overlayRows.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayRows VM != 1"); + } + + if (overlayColumns.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayColumns absent or empty"); + } + else if (overlayColumns.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayColumns VM != 1"); + } + + if (overlayType.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayType absent or empty"); + } + else if (overlayType.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayType VM != 1"); + } + + if (overlayOrigin.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayOrigin absent or empty"); + } + else if (overlayOrigin.getVM() != 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayOrigin VM != 2"); + } + + if (overlayBitsAllocated.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayBitsAllocated absent or empty"); + } + else if (overlayBitsAllocated.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayBitsAllocated VM != 1"); + } + + if (overlayBitPosition.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayBitPosition absent or empty"); + } + else if (overlayBitPosition.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayBitPosition VM != 1"); + } + + /* in a presentation state object, the overlay data must always be present in this group */ + if (overlayData.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains an overlay with overlayData absent or empty"); + } + + return result; +} + + +OFCondition DVPSOverlay::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + Uint16 repeatingGroup = 0x6000 + overlayGroup; + + ADD_REPEATING_ELEMENT_TO_DATASET(DcmUnsignedShort, overlayRows, repeatingGroup) + ADD_REPEATING_ELEMENT_TO_DATASET(DcmUnsignedShort, overlayColumns, repeatingGroup) + ADD_REPEATING_ELEMENT_TO_DATASET(DcmCodeString, overlayType, repeatingGroup) + ADD_REPEATING_ELEMENT_TO_DATASET(DcmSignedShort, overlayOrigin, repeatingGroup) + ADD_REPEATING_ELEMENT_TO_DATASET(DcmUnsignedShort, overlayBitsAllocated, repeatingGroup) + ADD_REPEATING_ELEMENT_TO_DATASET(DcmUnsignedShort, overlayBitPosition, repeatingGroup) + if (overlayData.getLength() >0) + { + ADD_REPEATING_ELEMENT_TO_DATASET(DcmOverlayData, overlayData, repeatingGroup) + } + if (overlayDescription.getLength() >0) + { + ADD_REPEATING_ELEMENT_TO_DATASET(DcmLongString, overlayDescription, repeatingGroup) + } + if (overlayLabel.getLength() >0) + { + ADD_REPEATING_ELEMENT_TO_DATASET(DcmLongString, overlayLabel, repeatingGroup) + } + + return result; +} + + +OFBool DVPSOverlay::isSuitableAsShutter(unsigned long x, unsigned long y) +{ + // check that overlay is Graphic, not ROI. + if (isROI()) return OFFalse; + + // check if overlay origin is 1\1 + Sint16 originX=0; + Sint16 originY=0; + OFCondition result = overlayOrigin.getSint16(originX,0); + if (result==EC_Normal) result = overlayOrigin.getSint16(originY,1); + if ((result != EC_Normal)||(originX != 1)||(originY != 1)) return OFFalse; + + // check if overlay size matches given image size + Uint16 rows=0; + Uint16 columns=0; + result = overlayRows.getUint16(rows,0); + if (result==EC_Normal) result = overlayColumns.getUint16(columns,0); + + if (result==EC_Normal) return ((columns==x)&&(rows==y)); + return OFFalse; +} + +const char *DVPSOverlay::getOverlayLabel() +{ + char *c = NULL; + if (EC_Normal == overlayLabel.getString(c)) return c; else return NULL; +} + +const char *DVPSOverlay::getOverlayDescription() +{ + char *c = NULL; + if (EC_Normal == overlayDescription.getString(c)) return c; else return NULL; +} + +OFBool DVPSOverlay::isROI() +{ + OFString aString; + if (EC_Normal == overlayType.getOFString(aString,0)) + { + return (aString == "ROI"); + } + return OFFalse; +} + +OFCondition DVPSOverlay::getValues( + Sint16& originX, + Sint16& originY, + Uint16& sizeX, + Uint16& sizeY) +{ + OFCondition result = overlayOrigin.getSint16(originX,1); + if (result.good()) result = overlayOrigin.getSint16(originY,0); + if (result.good()) result = overlayColumns.getUint16(sizeX,0); + if (result.good()) result = overlayRows.getUint16(sizeY,0); + return result; +} diff --git a/dcmpstat/libsrc/dvpsovl.cc b/dcmpstat/libsrc/dvpsovl.cc new file mode 100644 index 00000000..3cdb500e --- /dev/null +++ b/dcmpstat/libsrc/dvpsovl.cc @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSOverlay_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsovl.h" +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay */ + + +DVPSOverlay_PList::DVPSOverlay_PList() +: list_() +{ +} + +DVPSOverlay_PList::DVPSOverlay_PList(const DVPSOverlay_PList &arg) +: list_() +{ + OFListConstIterator(DVPSOverlay *) first = arg.list_.begin(); + OFListConstIterator(DVPSOverlay *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSOverlay_PList::~DVPSOverlay_PList() +{ + clear(); +} + +void DVPSOverlay_PList::clear() +{ + OFListIterator(DVPSOverlay *) first = list_.begin(); + OFListIterator(DVPSOverlay *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSOverlay_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DcmTagKey key(0x6000,0x3000); + DVPSOverlay *newOverlay = NULL; + + for (Uint8 i=0; i<16; i+=2) + { + if (result==EC_Normal) + { + stack.clear(); + key.setGroup(0x6000+i); + if (EC_Normal == dset.search(key, stack, ESM_fromHere, OFFalse)) + { + newOverlay = new DVPSOverlay(); + if (newOverlay) + { + result = newOverlay->read(dset,i); + list_.push_back(newOverlay); + } else result = EC_MemoryExhausted; + } + } + } + return result; +} + +OFCondition DVPSOverlay_PList::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + OFListIterator(DVPSOverlay *) first = list_.begin(); + OFListIterator(DVPSOverlay *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) result = (*first)->write(dset); + ++first; + } + return result; +} + +OFBool DVPSOverlay_PList::haveOverlayGroup(Uint16 group) +{ + if (getOverlayGroup(group)) return OFTrue; else return OFFalse; +} + +DVPSOverlay *DVPSOverlay_PList::getOverlayGroup(Uint16 group) +{ + Uint8 lowergroup = (Uint8)(group & 0x00FF); + OFListIterator(DVPSOverlay *) first = list_.begin(); + OFListIterator(DVPSOverlay *) last = list_.end(); + while (first != last) + { + if ((*first)->getOverlayGroup() == lowergroup) return *first; + ++first; + } + return NULL; +} + +DVPSOverlay *DVPSOverlay_PList::getOverlay(size_t idx) +{ + OFListIterator(DVPSOverlay *) first = list_.begin(); + OFListIterator(DVPSOverlay *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} + +OFCondition DVPSOverlay_PList::removeOverlay(size_t idx) +{ + OFListIterator(DVPSOverlay *) first = list_.begin(); + OFListIterator(DVPSOverlay *) last = list_.end(); + while (first != last) + { + if (idx==0) + { + delete (*first); + first = list_.erase(first); + return EC_Normal; + } + idx--; + ++first; + } + return EC_IllegalCall; +} + + +OFCondition DVPSOverlay_PList::changeOverlayGroup(size_t idx, Uint16 newGroup) +{ + if ((newGroup < 0x6000)||(newGroup > 0x601F)) return EC_IllegalCall; + DVPSOverlay *overlay = getOverlay(idx); + if (overlay) + { + if (newGroup == (overlay->getOverlayGroup()+0x6000)) return EC_Normal; + if (haveOverlayGroup(newGroup)) return EC_IllegalCall; // don't allocate twice + overlay->setOverlayGroup((Uint8)(newGroup-0x6000)); + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPSOverlay_PList::addOverlay(DcmItem& overlayIOD, Uint16 groupInItem, Uint16 newGroup) +{ + if ((groupInItem < 0x6000)||(groupInItem > 0x601F)) return EC_IllegalCall; + if ((newGroup < 0x6000)||(newGroup > 0x601F)) return EC_IllegalCall; + if (haveOverlayGroup(newGroup)) return EC_IllegalCall; // don't allocate twice + + DcmStack stack; + DcmTagKey key(groupInItem,0x3000); + DVPSOverlay *newOverlay = NULL; + + OFCondition result = overlayIOD.search(key, stack, ESM_fromHere, OFFalse); + if (EC_Normal == result) + { + newOverlay = new DVPSOverlay(); + if (newOverlay) + { + result = newOverlay->read(overlayIOD,(Uint8)(groupInItem-0x6000), (Uint8)(newGroup-0x6000)); + if (EC_Normal==result) list_.push_back(newOverlay); else delete newOverlay; + } else result = EC_MemoryExhausted; + } + return result; +} diff --git a/dcmpstat/libsrc/dvpspl.cc b/dcmpstat/libsrc/dvpspl.cc new file mode 100644 index 00000000..ec4cccf9 --- /dev/null +++ b/dcmpstat/libsrc/dvpspl.cc @@ -0,0 +1,455 @@ +/* + * + * Copyright (C) 1999-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPresentationLUT + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmpstat/dvpspl.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmnet/dimse.h" + +/* --------------- class DVPSPresentationLUT --------------- */ + +DVPSPresentationLUT::DVPSPresentationLUT() +: presentationLUT(DVPSP_identity) +, presentationLUTDescriptor(DCM_LUTDescriptor) +, presentationLUTExplanation(DCM_LUTExplanation) +, presentationLUTData(DCM_LUTData) +, sOPInstanceUID(DCM_SOPInstanceUID) +{ +} + +DVPSPresentationLUT::DVPSPresentationLUT(const DVPSPresentationLUT& copy) +: presentationLUT(copy.presentationLUT) +, presentationLUTDescriptor(copy.presentationLUTDescriptor) +, presentationLUTExplanation(copy.presentationLUTExplanation) +, presentationLUTData(copy.presentationLUTData) +, sOPInstanceUID(copy.sOPInstanceUID) +{ +} + +DVPSPresentationLUT::~DVPSPresentationLUT() +{ +} + +void DVPSPresentationLUT::clear() +{ + presentationLUT = DVPSP_identity; + presentationLUTDescriptor.clear(); + presentationLUTExplanation.clear(); + presentationLUTData.clear(); + sOPInstanceUID.clear(); +} + +OFCondition DVPSPresentationLUT::read(DcmItem &dset, OFBool withSOPInstance) +{ + DcmSequenceOfItems *seq; + DcmItem *item; + OFCondition result = EC_Normal; + DcmStack stack; + OFString aString; + + DcmCodeString presentationLUTShape(DCM_PresentationLUTShape); + + READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationLUTShape) + if (withSOPInstance) { READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID) } + else sOPInstanceUID.clear(); + + /* read Presentation LUT Sequence */ + if (result==EC_Normal) + { + stack.clear(); + if (EC_Normal == dset.search(DCM_PresentationLUTSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + item = seq->getItem(0); + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)presentationLUTDescriptor.getTag(), + stack, ESM_fromHere, OFFalse)) + { + presentationLUTDescriptor = *((DcmUnsignedShort *)(stack.top())); + } + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)presentationLUTExplanation.getTag(), + stack, ESM_fromHere, OFFalse)) + { + presentationLUTExplanation = *((DcmLongString *)(stack.top())); + } + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)presentationLUTData.getTag(), + stack, ESM_fromHere, OFFalse)) + { + presentationLUTData = *((DcmUnsignedShort *)(stack.top())); + } + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("found Presentation LUT SQ with number of items != 1"); + } + } + } + + + /* Now perform basic sanity checks */ + + if (presentationLUTShape.getLength() == 0) + { + presentationLUT = DVPSP_table; + + if (presentationLUTDescriptor.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationLUTShape and presentationLUTDescriptor absent or empty"); + } + else if (presentationLUTDescriptor.getVM() != 3) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationLUTDescriptor present but VM != 3 in presentation state"); + } + if (presentationLUTData.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationLUTShape and presentationLUTData absent or empty"); + } + } else { + if (presentationLUTShape.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentationLUTShape present but VM != 1"); + } else { + // check presentation LUT shape + aString.clear(); + presentationLUTShape.getOFString(aString,0); + if (aString=="IDENTITY") presentationLUT = DVPSP_identity; + else if (aString=="INVERSE") presentationLUT = DVPSP_inverse; + else if (aString=="LIN OD") presentationLUT = DVPSP_lin_od; + else + { + result=EC_IllegalCall; + DCMPSTAT_WARN("unknown presentationLUTShape keyword: " << aString); + } + } + } + + if (withSOPInstance) + { + if (sOPInstanceUID.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("sOPInstanceUID absent in Presentation LUT Content Sequence"); + } + else if (sOPInstanceUID.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("sOPInstanceUID VM != 1 in Presentation LUT Content Sequence"); + } + } + + return result; +} + +OFCondition DVPSPresentationLUT::write(DcmItem &dset, OFBool withSOPInstance) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + DcmCodeString presentationLUTShape(DCM_PresentationLUTShape); + + if (presentationLUT==DVPSP_table) + { + if (result == EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + dseq = new DcmSequenceOfItems(DCM_PresentationLUTSequence); + if (dseq) + { + delem = new DcmUnsignedShort(presentationLUTDescriptor); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUnsignedShort(presentationLUTData); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + if (presentationLUTExplanation.getLength() >0) + { + delem = new DcmLongString(presentationLUTExplanation); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + } + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + // out of memory during creation of sequence contents. + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } else { + // could allocate item but not sequence. Bail out. + delete ditem; + result = EC_MemoryExhausted; + } + } + else result = EC_MemoryExhausted; + } + } else { + if (presentationLUT==DVPSP_inverse) presentationLUTShape.putString("INVERSE"); + else if (presentationLUT==DVPSP_lin_od) presentationLUTShape.putString("LIN OD"); + else presentationLUTShape.putString("IDENTITY"); + ADD_TO_DATASET(DcmCodeString, presentationLUTShape) + } + if (withSOPInstance) { ADD_TO_DATASET(DcmUniqueIdentifier, sOPInstanceUID) } + + return result; +} + + +OFBool DVPSPresentationLUT::haveTable() +{ + if ((presentationLUTDescriptor.getVM()==3)&&(presentationLUTData.getLength() > 0)) return OFTrue; + else return OFFalse; +} + +const char *DVPSPresentationLUT::getSOPInstanceUID() +{ + char *c = NULL; + if (EC_Normal == sOPInstanceUID.getString(c)) return c; else return NULL; +} + +const char *DVPSPresentationLUT::getCurrentExplanation() +{ + const char *value = NULL; + switch (presentationLUT) + { + case DVPSP_identity: + value = "Identity Presentation LUT Shape"; + break; + case DVPSP_inverse: + value = "Inverse Presentation LUT Shape"; + break; + case DVPSP_lin_od: + value = "Linear Optical Density Presentation LUT Shape"; + break; + case DVPSP_table: + value = getLUTExplanation(); + if (value==NULL) value = "Unnamed Presentation LUT"; + break; + } + return value; +} + +const char *DVPSPresentationLUT::getLUTExplanation() +{ + char *value = NULL; + if (EC_Normal != presentationLUTExplanation.getString(value)) return NULL; + return value; +} + +OFCondition DVPSPresentationLUT::setLUT( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation) +{ + if ((lutDescriptor.getVM()==3)&&(lutData.getLength() > 0)) + { + presentationLUTDescriptor = lutDescriptor; + presentationLUTData = lutData; + presentationLUTExplanation = lutExplanation; + presentationLUT = DVPSP_table; + } else return EC_IllegalCall; + return EC_Normal; +} + +OFCondition DVPSPresentationLUT::setType(DVPSPresentationLUTType newType) +{ + if ((newType == DVPSP_table)&&(! haveTable())) return EC_IllegalCall; + presentationLUT = newType; + return EC_Normal; +} + + +OFCondition DVPSPresentationLUT::setSOPInstanceUID(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) return EC_IllegalCall; + return sOPInstanceUID.putString(value); +} + + +OFBool DVPSPresentationLUT::isLegalPrintPresentationLUT() +{ + OFBool result = OFFalse; + Uint16 val=0; + switch (presentationLUT) + { + case DVPSP_table: + if (EC_Normal == presentationLUTDescriptor.getUint16(val,2)) + { + if ((val>=10)&&(val<=16)) result = OFTrue; + } + break; + case DVPSP_inverse: + break; + case DVPSP_identity: + case DVPSP_lin_od: + result = OFTrue; + break; + } + return result; +} + +OFBool DVPSPresentationLUT::matchesImageDepth(OFBool is12bit) +{ + Uint16 numEntries=0; + Uint16 firstMapped=0; + OFBool result = OFFalse; + switch (presentationLUT) + { + case DVPSP_table: + + if ((EC_Normal == presentationLUTDescriptor.getUint16(numEntries,0)) && + (EC_Normal == presentationLUTDescriptor.getUint16(firstMapped,1))) + { + if ((firstMapped == 0)&&((is12bit && (numEntries == 4096))||((!is12bit) && (numEntries == 256)))) result = OFTrue; + } + break; + case DVPSP_inverse: + break; + case DVPSP_identity: + case DVPSP_lin_od: + result = OFTrue; + break; + } + return result; +} + +DVPSPrintPresentationLUTAlignment DVPSPresentationLUT::getAlignment() +{ + if (presentationLUT == DVPSP_table) + { + Uint16 numberOfEntries = 0; + Uint16 firstEntryMapped = 0xFFFF; + if (EC_Normal != presentationLUTDescriptor.getUint16(numberOfEntries, 0)) numberOfEntries = 0; + if (EC_Normal != presentationLUTDescriptor.getUint16(firstEntryMapped, 1)) firstEntryMapped = 0xFFFF; + if ((numberOfEntries == 256)&&(firstEntryMapped == 0)) return DVPSK_table8; + if ((numberOfEntries == 4096)&&(firstEntryMapped == 0)) return DVPSK_table12; + return DVPSK_other; + } + return DVPSK_shape; +} + + +OFBool DVPSPresentationLUT::printSCPCreate( + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool matchRequired, + OFBool supports12Bit) +{ + OFBool result = OFTrue; + DcmStack stack; + + if ((rqDataset==NULL)||(EC_Normal != read(*rqDataset, OFFalse))) + { + DCMPSTAT_WARN("cannot create Presentation LUT: attribute list error."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + + // read() has cleared sOPInstanceUID; assign UID now. + if (EC_Normal != setSOPInstanceUID(rsp.msg.NCreateRSP.AffectedSOPInstanceUID)) + { + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + + // browse through rqDataset and check for unsupported attributes + if (result && rqDataset) + { + OFBool intoSub = OFTrue; + stack.clear(); + while (EC_Normal == rqDataset->nextObject(stack, intoSub)) + { + intoSub = OFFalse; + const DcmTagKey& currentTag = (stack.top())->getTag(); + if (currentTag.getElement() == 0x0000) /* group length */ ; + else if (currentTag == DCM_PresentationLUTShape) /* OK */ ; + else if (currentTag == DCM_PresentationLUTSequence) /* OK */ ; + else + { + DCMPSTAT_WARN("cannot create Presentation LUT: unsupported attribute received:" << OFendl + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // if match between LUT and pixel data required, enforce rule + if (result && matchRequired) + { + OFBool matches = OFTrue; + switch (getAlignment()) + { + case DVPSK_shape: + case DVPSK_table8: + break; // always OK + case DVPSK_table12: + // is OK if printer supports 12 bit + matches = supports12Bit; + break; + case DVPSK_other: // never fits + matches = OFFalse; + break; + } + if (!matches) + { + DCMPSTAT_WARN("cannot create Presentation LUT: Mismatch between LUT entries and image pixel depth."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + + // if n-create was successful, create response dataset + if (result) + { + rspDataset = new DcmDataset; + if (rspDataset) + { + if (EC_Normal == write(*rspDataset, OFFalse)) + { + rsp.msg.NCreateRSP.DataSetType = DIMSE_DATASET_PRESENT; + } else { + delete rspDataset; + rspDataset = NULL; + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } else { + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } + return result; +} diff --git a/dcmpstat/libsrc/dvpspl2.cc b/dcmpstat/libsrc/dvpspl2.cc new file mode 100644 index 00000000..39dd8004 --- /dev/null +++ b/dcmpstat/libsrc/dvpspl2.cc @@ -0,0 +1,150 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPresentationLUT + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpspl.h" +#include "dcmtk/dcmimgle/dcmimage.h" /* for class DiLookupTable, DicomImage */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmnet/dimse.h" + +/* --------------- class DVPSPresentationLUT --------------- */ + +OFBool DVPSPresentationLUT::compareDiLookupTable(DiLookupTable *lut) +{ + if ((presentationLUT == DVPSP_table) && lut + && (0 == lut->compareLUT(presentationLUTData, presentationLUTDescriptor))) return OFTrue; + return OFFalse; +} + +DiLookupTable *DVPSPresentationLUT::createDiLookupTable() +{ + DiLookupTable *result = NULL; + if (presentationLUT == DVPSP_table) result = new DiLookupTable(presentationLUTData, presentationLUTDescriptor); + return result; +} + +OFCondition DVPSPresentationLUT::invert() +{ + OFCondition status = EC_Normal; + switch (presentationLUT) + { + case DVPSP_identity: + presentationLUT = DVPSP_inverse; + break; + case DVPSP_inverse: + presentationLUT = DVPSP_identity; + break; + case DVPSP_table: + status = EC_IllegalCall; + if (haveTable()) + { + DiLookupTable *lut = new DiLookupTable(presentationLUTData, presentationLUTDescriptor); + if (lut && (lut->mirrorTable(0x2))) status = EC_Normal; // flag = 0x2: mirror only original LUT data + delete lut; + } + break; + case DVPSP_lin_od: + status = EC_IllegalCall; + break; + + } + return status; +} + +OFBool DVPSPresentationLUT::activate(DicomImage *image, OFBool printLUT) +{ + if (image==NULL) return OFFalse; + + int result=0; + switch (presentationLUT) + { + case DVPSP_identity: + if (printLUT) + { + // in DICOM print, IDENTITY should not invert a MONOCHROME1 image + result = image->setPresentationLutShape(ESP_Default); + } + else + { + result = image->setPresentationLutShape(ESP_Identity); + } + if (!result) + DCMPSTAT_WARN("unable to set identity presentation LUT shape, ignoring."); + break; + case DVPSP_inverse: + if (!printLUT) + result = image->setPresentationLutShape(ESP_Inverse); + if (!result) + DCMPSTAT_WARN("unable to set inverse presentation LUT shape, ignoring."); + break; + case DVPSP_lin_od: + result = image->setPresentationLutShape(ESP_LinOD); + if (!result) + DCMPSTAT_WARN("unable to set linear optical density presentation LUT shape, ignoring."); + break; + case DVPSP_table: + if (printLUT) + result = image->setVoiLut(presentationLUTData, presentationLUTDescriptor, &presentationLUTExplanation); + else + result = image->setPresentationLut(presentationLUTData, presentationLUTDescriptor, &presentationLUTExplanation); + if (!result) + DCMPSTAT_WARN("unable to set presentation LUT, ignoring."); + break; + } + if (result) return OFTrue; else return OFFalse; +} + +OFBool DVPSPresentationLUT::activateInverseLUT(DicomImage *image) +{ + int result = 0; + if ((image != NULL) && (presentationLUT == DVPSP_table)) + { + result = image->setInversePresentationLut(presentationLUTData, presentationLUTDescriptor); + if (!result) + DCMPSTAT_WARN("unable to set inverse presentation LUT, ignoring."); + } + if (result) return OFTrue; else return OFFalse; +} + +OFBool DVPSPresentationLUT::isInverse() +{ + OFBool result = OFFalse; + switch (presentationLUT) + { + case DVPSP_identity: + case DVPSP_lin_od: + break; + case DVPSP_inverse: + result = OFTrue; + break; + case DVPSP_table: + if ((presentationLUTDescriptor.getVM()==3)&&(presentationLUTData.getLength() > 0)) + { + DiLookupTable *lut = new DiLookupTable(presentationLUTData, presentationLUTDescriptor); + if (lut && (lut->getFirstValue() > lut->getLastValue())) result = OFTrue; + delete lut; + } + break; + } + return result; +} diff --git a/dcmpstat/libsrc/dvpspll.cc b/dcmpstat/libsrc/dvpspll.cc new file mode 100644 index 00000000..a88553a7 --- /dev/null +++ b/dcmpstat/libsrc/dvpspll.cc @@ -0,0 +1,249 @@ +/* + * + * Copyright (C) 1999-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSImageBoxContent_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpspll.h" +#include "dcmtk/dcmpstat/dvpspl.h" /* for DVPSImageBoxContent */ +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ +#include "dcmtk/dcmpstat/dvpsibl.h" /* for class DVPSImageBoxContent_PList */ +#include "dcmtk/dcmimgle/diluptab.h" /* for class DiLookupTable */ +#include "dcmtk/dcmpstat/dvpsdef.h" +#include "dcmtk/dcmpstat/dvpsib.h" /* for DVPSImageBoxContent, needed by MSVC5 with STL */ + +/* --------------- class DVPSImageBoxContent_PList --------------- */ + +DVPSPresentationLUT_PList::DVPSPresentationLUT_PList() +: list_() +{ +} + +DVPSPresentationLUT_PList::DVPSPresentationLUT_PList(const DVPSPresentationLUT_PList &arg) +: list_() +{ + OFListConstIterator(DVPSPresentationLUT *) first = arg.list_.begin(); + OFListConstIterator(DVPSPresentationLUT *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSPresentationLUT_PList::~DVPSPresentationLUT_PList() +{ + clear(); +} + +void DVPSPresentationLUT_PList::clear() +{ + OFListIterator(DVPSPresentationLUT *) first = list_.begin(); + OFListIterator(DVPSPresentationLUT *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSPresentationLUT_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSPresentationLUT *newLUT = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_RETIRED_PresentationLUTContentSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newLUT = new DVPSPresentationLUT(); + if (newLUT && ditem) + { + result = newLUT->read(*ditem, OFTrue); + list_.push_back(newLUT); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSPresentationLUT_PList::write(DcmItem &dset) +{ + if (size()==0) return EC_Normal; // don't write if sequence is empty + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_RETIRED_PresentationLUTContentSequence); + if (dseq) + { + OFListIterator(DVPSPresentationLUT *) first = list_.begin(); + OFListIterator(DVPSPresentationLUT *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem, OFTrue); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + +void DVPSPresentationLUT_PList::cleanup(const char *filmBox, DVPSImageBoxContent_PList& imageBoxes) +{ + OFString aFilmbox; + if (filmBox) aFilmbox = filmBox; + const char *uid; + OFListIterator(DVPSPresentationLUT *) first = list_.begin(); + OFListIterator(DVPSPresentationLUT *) last = list_.end(); + while (first != last) + { + uid = (*first)->getSOPInstanceUID(); + if (uid && ((aFilmbox == uid)||(imageBoxes.presentationLUTInstanceUIDisUsed(uid)))) ++first; + else + { + delete (*first); + first = list_.erase(first); + } + } + return; +} + +DVPSPresentationLUT *DVPSPresentationLUT_PList::findPresentationLUT(const char *instanceUID) +{ + if (instanceUID==NULL) return NULL; + OFString instance(instanceUID); + OFListIterator(DVPSPresentationLUT *) first = list_.begin(); + OFListIterator(DVPSPresentationLUT *) last = list_.end(); + const char *c; + while (first != last) + { + c = (*first)->getSOPInstanceUID(); + if (c && (instance == c)) return (*first); + ++first; + } + return NULL; +} + +const char *DVPSPresentationLUT_PList::addPresentationLUT(DVPSPresentationLUT *newLUT, OFBool inversePLUT) +{ + if (newLUT == NULL) return NULL; + + DiLookupTable *diLUT = NULL; + const char *result = NULL; + + // 'INVERSE' LUT shape is undefined for Print and has already + // been rendered into the bitmap at this stage. + DVPSPresentationLUTType lutType = newLUT->getType(); + if (lutType == DVPSP_inverse) lutType = DVPSP_identity; + + DVPSPresentationLUT *myLUT = newLUT->clone(); + if (myLUT) + { + // make sure that we don't copy an inverse LUT shape + if (myLUT->getType() == DVPSP_inverse) myLUT->setType(DVPSP_identity); + if (lutType == DVPSP_table) + { + if (inversePLUT) myLUT->invert(); + diLUT = myLUT->createDiLookupTable(); + } + } else return NULL; + + // see if myLUT is already somewhere in the list + OFListIterator(DVPSPresentationLUT *) first = list_.begin(); + OFListIterator(DVPSPresentationLUT *) last = list_.end(); + while (first != last) + { + if ((*first)->getType() == lutType) + { + if (lutType == DVPSP_table) + { + if ((*first)->compareDiLookupTable(diLUT)) + { + result = (*first)->getSOPInstanceUID(); + break; + } + } else { + result = (*first)->getSOPInstanceUID(); + break; + } + } + ++first; + } + delete diLUT; + + if (result) + { + delete myLUT; + return result; + } + + // no match, store new LUT + char uid[100]; + dcmGenerateUniqueIdentifier(uid); + myLUT->setSOPInstanceUID(uid); + list_.push_back(myLUT); + result = myLUT->getSOPInstanceUID(); + + return result; +} + + +void DVPSPresentationLUT_PList::printSCPDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp) +{ + OFListIterator(DVPSPresentationLUT *) first = list_.begin(); + OFListIterator(DVPSPresentationLUT *) last = list_.end(); + OFBool found = OFFalse; + OFString theUID(rq.msg.NDeleteRQ.RequestedSOPInstanceUID); + while ((first != last) && (!found)) + { + if (theUID == (*first)->getSOPInstanceUID()) found = OFTrue; + else ++first; + } + + if (found) + { + delete (*first); + list_.erase(first); + } else { + // presentation LUT does not exist or wrong instance UID + DCMPSTAT_WARN("cannot delete presentation LUT with instance UID '" << rq.msg.NDeleteRQ.RequestedSOPInstanceUID << "': object does not exist."); + rsp.msg.NDeleteRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} diff --git a/dcmpstat/libsrc/dvpspr.cc b/dcmpstat/libsrc/dvpspr.cc new file mode 100644 index 00000000..f3159de2 --- /dev/null +++ b/dcmpstat/libsrc/dvpspr.cc @@ -0,0 +1,599 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPrintMessageHandler + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmpstat/dvpsdef.h" +#include "dcmtk/dcmpstat/dvpspr.h" + +/* --------------- class DVPSPrintMessageHandler --------------- */ + +DVPSPrintMessageHandler::DVPSPrintMessageHandler() +: assoc(NULL) +, net(NULL) +, eventHandler(NULL) +, blockMode(DIMSE_BLOCKING) +, timeout(0) +{ +} + +DVPSPrintMessageHandler::~DVPSPrintMessageHandler() +{ + abortAssociation(); // won't do any harm if there is no association in place +} + +void DVPSPrintMessageHandler::dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing) +{ + OFString str; + if (outgoing) { + DIMSE_dumpMessage(str, msg, DIMSE_OUTGOING, dataset); + } else { + DIMSE_dumpMessage(str, msg, DIMSE_INCOMING, dataset); + } + DCMPSTAT_DUMP(str); +} + +OFCondition DVPSPrintMessageHandler::sendNRequest( + T_ASC_PresentationContextID presId, + T_DIMSE_Message &request, + DcmDataset *rqDataSet, + T_DIMSE_Message &response, + DcmDataset* &statusDetail, + DcmDataset* &rspDataset) +{ + OFCondition cond = EC_Normal; + T_DIMSE_Command expectedResponse; + DIC_US expectedMessageID=0; + if (assoc == NULL) + { + return DIMSE_ILLEGALASSOCIATION; + } + + T_DIMSE_DataSetType datasetType = DIMSE_DATASET_NULL; + if (rqDataSet && (rqDataSet->card() > 0)) datasetType = DIMSE_DATASET_PRESENT; + + switch(request.CommandField) + { + case DIMSE_N_GET_RQ: + request.msg.NGetRQ.DataSetType = datasetType; + expectedResponse = DIMSE_N_GET_RSP; + expectedMessageID = request.msg.NGetRQ.MessageID; + break; + case DIMSE_N_SET_RQ: + request.msg.NSetRQ.DataSetType = datasetType; + expectedResponse = DIMSE_N_SET_RSP; + expectedMessageID = request.msg.NSetRQ.MessageID; + break; + case DIMSE_N_ACTION_RQ: + request.msg.NActionRQ.DataSetType = datasetType; + expectedResponse = DIMSE_N_ACTION_RSP; + expectedMessageID = request.msg.NActionRQ.MessageID; + break; + case DIMSE_N_CREATE_RQ: + request.msg.NCreateRQ.DataSetType = datasetType; + expectedResponse = DIMSE_N_CREATE_RSP; + expectedMessageID = request.msg.NCreateRQ.MessageID; + break; + case DIMSE_N_DELETE_RQ: + request.msg.NDeleteRQ.DataSetType = datasetType; + expectedResponse = DIMSE_N_DELETE_RSP; + expectedMessageID = request.msg.NDeleteRQ.MessageID; + break; + default: + return DIMSE_BADCOMMANDTYPE; + /* break; */ + } + + dumpNMessage(request, rqDataSet, OFTrue); + cond = DIMSE_sendMessageUsingMemoryData(assoc, presId, &request, NULL, rqDataSet, NULL, NULL); + if (cond.bad()) return cond; + + T_ASC_PresentationContextID thisPresId; + T_DIMSE_Message eventReportRsp; + DIC_US eventReportStatus; + do + { + thisPresId = presId; + statusDetail = NULL; + cond = DIMSE_receiveCommand(assoc, blockMode, timeout, &thisPresId, &response, &statusDetail); + if (cond.bad()) return cond; + + if (response.CommandField == DIMSE_N_EVENT_REPORT_RQ) + { + /* handle N-EVENT-REPORT-RQ */ + rspDataset = NULL; + if (response.msg.NEventReportRQ.DataSetType == DIMSE_DATASET_PRESENT) + { + cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &thisPresId, &rspDataset, NULL, NULL); + if (cond.bad()) return cond; + } + dumpNMessage(response, rspDataset, OFFalse); + // call event handler if registered + eventReportStatus = STATUS_Success; + if (eventHandler) eventReportStatus = eventHandler->handleEvent(response.msg.NEventReportRQ, rspDataset, statusDetail); + if (rspDataset) delete rspDataset; + rspDataset = NULL; + if (statusDetail) delete statusDetail; + statusDetail = NULL; + + // send back N-EVENT-REPORT-RSP */ + eventReportRsp.CommandField = DIMSE_N_EVENT_REPORT_RSP; + eventReportRsp.msg.NEventReportRSP.MessageIDBeingRespondedTo = response.msg.NEventReportRQ.MessageID; + eventReportRsp.msg.NEventReportRSP.EventTypeID = response.msg.NEventReportRQ.EventTypeID; + eventReportRsp.msg.NEventReportRSP.DimseStatus = eventReportStatus; + eventReportRsp.msg.NEventReportRSP.DataSetType = DIMSE_DATASET_NULL; + eventReportRsp.msg.NEventReportRSP.opts = O_NEVENTREPORT_EVENTTYPEID; + eventReportRsp.msg.NEventReportRSP.AffectedSOPClassUID[0] = 0; + eventReportRsp.msg.NEventReportRSP.AffectedSOPInstanceUID[0] = 0; + dumpNMessage(eventReportRsp, NULL, OFTrue); + cond = DIMSE_sendMessageUsingMemoryData(assoc, thisPresId, &eventReportRsp, NULL, NULL, NULL, NULL); + if (cond.bad()) return cond; + } else { + /* No N-EVENT-REPORT-RQ. Check if this message is what we expected */ + if (response.CommandField != expectedResponse) + { + char buf1[256]; + sprintf(buf1, "DIMSE: Unexpected Response Command Field: 0x%x", (unsigned)response.CommandField); + return makeDcmnetCondition(DIMSEC_UNEXPECTEDRESPONSE, OF_error, buf1); + } + T_DIMSE_DataSetType responseDataset = DIMSE_DATASET_NULL; + DIC_US responseMessageID = 0; + /** change request to response */ + switch(expectedResponse) + { + case DIMSE_N_GET_RSP: + responseDataset = response.msg.NGetRSP.DataSetType; + responseMessageID = response.msg.NGetRSP.MessageIDBeingRespondedTo; + break; + case DIMSE_N_SET_RSP: + responseDataset = response.msg.NSetRSP.DataSetType; + responseMessageID = response.msg.NSetRSP.MessageIDBeingRespondedTo; + break; + case DIMSE_N_ACTION_RSP: + responseDataset = response.msg.NActionRSP.DataSetType; + responseMessageID = response.msg.NActionRSP.MessageIDBeingRespondedTo; + break; + case DIMSE_N_CREATE_RSP: + responseDataset = response.msg.NCreateRSP.DataSetType; + responseMessageID = response.msg.NCreateRSP.MessageIDBeingRespondedTo; + break; + case DIMSE_N_DELETE_RSP: + responseDataset = response.msg.NDeleteRSP.DataSetType; + responseMessageID = response.msg.NDeleteRSP.MessageIDBeingRespondedTo; + break; + default: + { + char buf1[256]; + sprintf(buf1, "DIMSE: Unexpected Response Command Field: 0x%x", (unsigned)response.CommandField); + return makeDcmnetCondition(DIMSEC_UNEXPECTEDRESPONSE, OF_error, buf1); + } + /* break; */ + } + if (responseMessageID != expectedMessageID) + { + char buf1[256]; + sprintf(buf1, "DIMSE: Unexpected Response Command Field: 0x%x", (unsigned)response.CommandField); + return makeDcmnetCondition(DIMSEC_UNEXPECTEDRESPONSE, OF_error, buf1); + } + rspDataset = NULL; + if (responseDataset == DIMSE_DATASET_PRESENT) + { + cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &thisPresId, &rspDataset, NULL, NULL); + if (cond.bad()) return cond; + } + dumpNMessage(response, rspDataset, OFFalse); + } + } while (response.CommandField == DIMSE_N_EVENT_REPORT_RQ); + return EC_Normal; +} + +OFCondition DVPSPrintMessageHandler::createRQ( + const char *sopclassUID, + OFString& sopinstanceUID, + DcmDataset *attributeListIn, + Uint16& status, + DcmDataset* &attributeListOut) +{ + if (assoc == NULL) + { + return DIMSE_ILLEGALASSOCIATION; + } + if (sopclassUID==NULL) + { + return DIMSE_NULLKEY; + } + + T_ASC_PresentationContextID presCtx = findAcceptedPC(sopclassUID); + if (presCtx == 0) + { + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + T_DIMSE_Message request; + T_DIMSE_Message response; + DcmDataset *statusDetail = NULL; + + // construct N-CREATE-RQ + request.CommandField = DIMSE_N_CREATE_RQ; + request.msg.NCreateRQ.MessageID = assoc->nextMsgID++; + OFStandard::strlcpy(request.msg.NCreateRQ.AffectedSOPClassUID, sopclassUID, sizeof(request.msg.NCreateRQ.AffectedSOPClassUID)); + if (sopinstanceUID.size() > 0) + { + OFStandard::strlcpy(request.msg.NCreateRQ.AffectedSOPInstanceUID, sopinstanceUID.c_str(), sizeof(request.msg.NCreateRQ.AffectedSOPInstanceUID)); + request.msg.NCreateRQ.opts = O_NCREATE_AFFECTEDSOPINSTANCEUID; + } else { + request.msg.NCreateRQ.AffectedSOPInstanceUID[0] = 0; + request.msg.NCreateRQ.opts = 0; + } + + OFCondition cond = sendNRequest(presCtx, request, attributeListIn, response, statusDetail, attributeListOut); + if (cond.good()) + { + status = response.msg.NCreateRSP.DimseStatus; + // if response contains SOP Instance UID, copy it. + if (response.msg.NCreateRSP.opts & O_NCREATE_AFFECTEDSOPINSTANCEUID) + { + sopinstanceUID = response.msg.NCreateRSP.AffectedSOPInstanceUID; + } + } + if (statusDetail) delete statusDetail; + return cond; +} + +OFCondition DVPSPrintMessageHandler::setRQ( + const char *sopclassUID, + const char *sopinstanceUID, + DcmDataset *modificationList, + Uint16& status, + DcmDataset* &attributeListOut) +{ + if (assoc == NULL) + { + return DIMSE_ILLEGALASSOCIATION; + } + if ((sopclassUID==NULL)||(sopinstanceUID==NULL)||(modificationList==NULL)) + { + return DIMSE_NULLKEY; + } + + T_ASC_PresentationContextID presCtx = findAcceptedPC(sopclassUID); + if (presCtx == 0) + { + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + T_DIMSE_Message request; + T_DIMSE_Message response; + DcmDataset *statusDetail = NULL; + + // construct N-SET-RQ + request.CommandField = DIMSE_N_SET_RQ; + request.msg.NSetRQ.MessageID = assoc->nextMsgID++; + OFStandard::strlcpy(request.msg.NSetRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NSetRQ.RequestedSOPClassUID)); + OFStandard::strlcpy(request.msg.NSetRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NSetRQ.RequestedSOPInstanceUID)); + + OFCondition cond = sendNRequest(presCtx, request, modificationList, response, statusDetail, attributeListOut); + if (cond.good()) status = response.msg.NSetRSP.DimseStatus; + if (statusDetail) delete statusDetail; + return cond; +} + +OFCondition DVPSPrintMessageHandler::getRQ( + const char *sopclassUID, + const char *sopinstanceUID, + const Uint16 *attributeIdentifierList, + size_t numShorts, + Uint16& status, + DcmDataset* &attributeListOut) +{ + if (assoc == NULL) + { + return DIMSE_ILLEGALASSOCIATION; + } + if ((sopclassUID==NULL)||(sopinstanceUID==NULL)) + { + return DIMSE_NULLKEY; + } + + T_ASC_PresentationContextID presCtx = findAcceptedPC(sopclassUID); + if (presCtx == 0) + { + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + T_DIMSE_Message request; + T_DIMSE_Message response; + DcmDataset *statusDetail = NULL; + + // construct N-GET-RQ + request.CommandField = DIMSE_N_GET_RQ; + request.msg.NGetRQ.MessageID = assoc->nextMsgID++; + OFStandard::strlcpy(request.msg.NGetRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NGetRQ.RequestedSOPClassUID)); + OFStandard::strlcpy(request.msg.NGetRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NGetRQ.RequestedSOPInstanceUID)); + request.msg.NGetRQ.ListCount = 0; + if (attributeIdentifierList) request.msg.NGetRQ.ListCount = (int)numShorts; + request.msg.NGetRQ.AttributeIdentifierList = (DIC_US *)attributeIdentifierList; + + OFCondition cond = sendNRequest(presCtx, request, NULL, response, statusDetail, attributeListOut); + if (cond.good()) status = response.msg.NGetRSP.DimseStatus; + if (statusDetail) delete statusDetail; + return cond; +} + + +OFCondition DVPSPrintMessageHandler::actionRQ( + const char *sopclassUID, + const char *sopinstanceUID, + Uint16 actionTypeID, + DcmDataset *actionInformation, + Uint16& status, + DcmDataset* &actionReply) +{ + if (assoc == NULL) + { + return DIMSE_ILLEGALASSOCIATION; + } + if ((sopclassUID==NULL)||(sopinstanceUID==NULL)) + { + return DIMSE_NULLKEY; + } + + T_ASC_PresentationContextID presCtx = findAcceptedPC(sopclassUID); + if (presCtx == 0) + { + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + T_DIMSE_Message request; + T_DIMSE_Message response; + DcmDataset *statusDetail = NULL; + + // construct N-ACTION-RQ + request.CommandField = DIMSE_N_ACTION_RQ; + request.msg.NActionRQ.MessageID = assoc->nextMsgID++; + OFStandard::strlcpy(request.msg.NActionRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NActionRQ.RequestedSOPClassUID)); + OFStandard::strlcpy(request.msg.NActionRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NActionRQ.RequestedSOPInstanceUID)); + request.msg.NActionRQ.ActionTypeID = (DIC_US)actionTypeID; + + OFCondition cond = sendNRequest(presCtx, request, actionInformation, response, statusDetail, actionReply); + if (cond.good()) status = response.msg.NActionRSP.DimseStatus; + if (statusDetail) delete statusDetail; + return cond; +} + +OFCondition DVPSPrintMessageHandler::deleteRQ( + const char *sopclassUID, + const char *sopinstanceUID, + Uint16& status) +{ + if (assoc == NULL) + { + return DIMSE_ILLEGALASSOCIATION; + } + if ((sopclassUID==NULL)||(sopinstanceUID==NULL)) + { + return DIMSE_NULLKEY; + } + + T_ASC_PresentationContextID presCtx = findAcceptedPC(sopclassUID); + if (presCtx == 0) + { + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + T_DIMSE_Message request; + T_DIMSE_Message response; + DcmDataset *statusDetail = NULL; + DcmDataset *attributeListOut = NULL; + + // construct N-DELETE-RQ + request.CommandField = DIMSE_N_DELETE_RQ; + request.msg.NDeleteRQ.MessageID = assoc->nextMsgID++; + OFStandard::strlcpy(request.msg.NDeleteRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NDeleteRQ.RequestedSOPClassUID)); + OFStandard::strlcpy(request.msg.NDeleteRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NDeleteRQ.RequestedSOPInstanceUID)); + + OFCondition cond = sendNRequest(presCtx, request, NULL, response, statusDetail, attributeListOut); + if (cond.good()) status = response.msg.NDeleteRSP.DimseStatus; + if (statusDetail) delete statusDetail; + if (attributeListOut) delete attributeListOut; // should never happen + return cond; +} + +OFCondition DVPSPrintMessageHandler::releaseAssociation() +{ + OFCondition result = EC_Normal; + if (assoc) + { + result = ASC_releaseAssociation(assoc); + ASC_destroyAssociation(&assoc); + ASC_dropNetwork(&net); + assoc = NULL; + net = NULL; + } + return result; +} + +OFCondition DVPSPrintMessageHandler::abortAssociation() +{ + OFCondition result = EC_Normal; + if (assoc) + { + result = ASC_abortAssociation(assoc); + ASC_destroyAssociation(&assoc); + ASC_dropNetwork(&net); + assoc = NULL; + net = NULL; + } + return result; +} + +T_ASC_PresentationContextID DVPSPrintMessageHandler::findAcceptedPC(const char *sopclassuid) +{ + if ((assoc==NULL)||(sopclassuid==NULL)) return 0; + + // if the SOP class is one of the Basic Grayscale Print Management Meta SOP Classes, + // look for a presentation context for Basic Grayscale Print. + OFString sopclass(sopclassuid); + if ((sopclass == UID_BasicFilmSessionSOPClass) || + (sopclass == UID_BasicFilmBoxSOPClass) || + (sopclass == UID_BasicGrayscaleImageBoxSOPClass) || + (sopclass == UID_PrinterSOPClass)) sopclassuid = UID_BasicGrayscalePrintManagementMetaSOPClass; + return ASC_findAcceptedPresentationContextID(assoc, sopclassuid); +} + + +OFCondition DVPSPrintMessageHandler::negotiateAssociation( + DcmTransportLayer *tlayer, + const char *myAEtitle, + const char *peerAEtitle, + const char *peerHost, + int peerPort, + long peerMaxPDU, + OFBool negotiatePresentationLUT, + OFBool negotiateAnnotationBox, + OFBool implicitOnly) +{ + if (assoc) + { + return makeDcmnetCondition(DIMSEC_ILLEGALASSOCIATION, OF_error, "association already in place"); + } + if ((myAEtitle==NULL)||(peerAEtitle==NULL)||(peerHost==NULL)) + { + return DIMSE_NULLKEY; + } + + T_ASC_Parameters *params=NULL; + DIC_NODENAME dnpeerHost; + + OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, 30, &net); + if (cond.good()) cond = ASC_createAssociationParameters(¶ms, peerMaxPDU); + + if (tlayer && cond.good()) + { + cond = ASC_setTransportLayer(net, tlayer, 0); + if (cond.good()) cond = ASC_setTransportLayerType(params, OFTrue /* use TLS */); + } + + if (cond.bad()) return cond; + + ASC_setAPTitles(params, myAEtitle, peerAEtitle, NULL); + sprintf(dnpeerHost, "%s:%d", peerHost, peerPort); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), dnpeerHost); + + /* presentation contexts */ + const char* transferSyntaxes[3]; + int transferSyntaxCount = 0; + + if (implicitOnly) + { + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + transferSyntaxCount = 1; + } else { + /* gLocalByteOrder is defined in dcxfer.h */ + if (gLocalByteOrder == EBO_LittleEndian) { + /* we are on a little endian machine */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + /* we are on a big endian machine */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + transferSyntaxCount = 3; + } + + /* we always propose basic grayscale, presentation LUT and annotation box*/ + if (cond.good()) cond = ASC_addPresentationContext(params, 1, UID_BasicGrayscalePrintManagementMetaSOPClass, transferSyntaxes, transferSyntaxCount); + if (negotiatePresentationLUT) + { + if (cond.good()) cond = ASC_addPresentationContext(params, 3, UID_PresentationLUTSOPClass, transferSyntaxes, transferSyntaxCount); + } + + if (negotiateAnnotationBox) + { + if (cond.good()) cond = ASC_addPresentationContext(params, 5, UID_BasicAnnotationBoxSOPClass, transferSyntaxes, transferSyntaxCount); + } + + /* create association */ + DCMPSTAT_INFO("Requesting Association"); + + if (cond.good()) + { + cond = ASC_requestAssociation(net, params, &assoc); + + if (cond == DUL_ASSOCIATIONREJECTED) + { + OFString temp_str; + T_ASC_RejectParameters rej; + ASC_getRejectParameters(params, &rej); + DCMPSTAT_WARN("Association Rejected" << OFendl << ASC_printRejectParameters(temp_str, &rej)); + } else { + if (cond.bad()) + { + // if assoc is non-NULL, then params has already been moved into the + // assoc structure. Make sure we only delete once! + if (assoc) ASC_destroyAssociation(&assoc); + else if (params) ASC_destroyAssociationParameters(¶ms); + + if (net) ASC_dropNetwork(&net); + assoc = NULL; + net = NULL; + return cond; + } + } + } + + if ((cond.good()) && (0 == ASC_findAcceptedPresentationContextID(assoc, UID_BasicGrayscalePrintManagementMetaSOPClass))) + { + DCMPSTAT_WARN("Peer does not support Basic Grayscale Print Management, aborting association."); + abortAssociation(); + cond = DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + if (cond.good()) + { + DCMPSTAT_INFO("Association accepted (Max Send PDV: " << assoc->sendPDVLength << ")"); + } else { + // params is now an alias to assoc->params. Don't call ASC_destroyAssociationParameters. + if (assoc) ASC_destroyAssociation(&assoc); + if (net) ASC_dropNetwork(&net); + assoc = NULL; + net = NULL; + } + + return cond; +} + +OFBool DVPSPrintMessageHandler::printerSupportsPresentationLUT() +{ + if ((assoc)&&(0 != ASC_findAcceptedPresentationContextID(assoc, UID_PresentationLUTSOPClass))) return OFTrue; + return OFFalse; +} + +OFBool DVPSPrintMessageHandler::printerSupportsAnnotationBox() +{ + if ((assoc)&&(0 != ASC_findAcceptedPresentationContextID(assoc, UID_BasicAnnotationBoxSOPClass))) return OFTrue; + return OFFalse; +} diff --git a/dcmpstat/libsrc/dvpsprt.cc b/dcmpstat/libsrc/dvpsprt.cc new file mode 100644 index 00000000..f1766b7f --- /dev/null +++ b/dcmpstat/libsrc/dvpsprt.cc @@ -0,0 +1,1091 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSPrintSCP + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmpstat/dvpsprt.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants */ +#include "dcmtk/dcmpstat/dviface.h" +#include "dcmtk/dcmpstat/dvpsfs.h" +#include "dcmtk/dcmpstat/dvpssp.h" +#include "dcmtk/dcmpstat/dvpshlp.h" +#include "dcmtk/ofstd/ofdatime.h" + +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsib.h" /* for DVPSImageBoxContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsab.h" /* for DVPSAnnotationContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + +DVPSPrintSCP::DVPSPrintSCP(DVInterface &iface, const char *cfname) +: dviface(iface) +, cfgname(cfname) +, blockMode(DIMSE_BLOCKING) +, timeout(0) +, filmSession(NULL) +, presentationLUTList() +, storedPrintList() +, assoc(NULL) +, studyInstanceUID(DCM_StudyInstanceUID) +, psSeriesInstanceUID(DCM_SeriesInstanceUID) +, imageSeriesInstanceUID(DCM_SeriesInstanceUID) +, logSequence(NULL) +, acseSequence(NULL) +, logPath() +{ +} + +DVPSPrintSCP::~DVPSPrintSCP() +{ + dropAssociation(); + delete logSequence; + delete acseSequence; +} + +int DVPSPrintSCP::errorCond(OFCondition cond, const char *message) +{ + int result = cond.bad(); + if (result) + { + OFString temp_str; + DCMPSTAT_WARN(message << OFendl << DimseCondition::dump(temp_str, cond)); + } + return result; +} + + +DVPSAssociationNegotiationResult DVPSPrintSCP::negotiateAssociation(T_ASC_Network &net) +{ + DVPSAssociationNegotiationResult result = DVPSJ_success; + char buf[BUFSIZ]; + OFBool dropAssoc = OFFalse; + + // get AETITLE from config file + const char *aetitle = dviface.getTargetAETitle(cfgname); + if (aetitle==NULL) aetitle = dviface.getNetworkAETitle(); // default if AETITLE is missing + + // get MaxPDU from config file + unsigned long maxPDU = dviface.getTargetMaxPDU(cfgname); + if (maxPDU == 0) maxPDU = DEFAULT_MAXPDU; + else if (maxPDU > ASC_MAXIMUMPDUSIZE) + { + DCMPSTAT_INFO("max PDU size " << maxPDU << " too big, using default: " << DEFAULT_MAXPDU); + maxPDU = DEFAULT_MAXPDU; + } + else if (maxPDU < ASC_MINIMUMPDUSIZE) + { + DCMPSTAT_INFO("max PDU size " << maxPDU << " too small, using default: " << DEFAULT_MAXPDU); + maxPDU = DEFAULT_MAXPDU; + } + + // check whether we want to support Presentation LUT + OFBool supportPresentationLUT = dviface.getTargetPrinterSupportsPresentationLUT(cfgname); + + // check whether we want to support Implicit VR only + OFBool implicitOnly = dviface.getTargetImplicitOnly(cfgname); + + // check whether we're expected to accept TLS associations + OFBool useTLS = dviface.getTargetUseTLS(cfgname); + + void *associatePDU=NULL; + unsigned long associatePDUlength=0; + + OFCondition cond = ASC_receiveAssociation(&net, &assoc, maxPDU, &associatePDU, &associatePDUlength, useTLS); + if (errorCond(cond, "Failed to receive association:")) + { + dropAssoc = OFTrue; + result = DVPSJ_error; + } + else + { + DCMPSTAT_INFO("Association Received (" + << assoc->params->DULparams.callingPresentationAddress + << ":" << assoc->params->DULparams.callingAPTitle << " -> " + << assoc->params->DULparams.calledAPTitle + << ") " << OFDateTime::getCurrentDateTime()); + + OFString temp_str; + DCMPSTAT_DUMP(ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_RQ)); + + ASC_setAPTitles(assoc->params, NULL, NULL, aetitle); + + /* Application Context Name */ + cond = ASC_getApplicationContextName(assoc->params, buf, sizeof(buf)); + if (cond.bad() || strcmp(buf, DICOM_STDAPPLICATIONCONTEXT) != 0) + { + /* reject: the application context name is not supported */ + DCMPSTAT_WARN("Bad AppContextName: " << buf); + cond = refuseAssociation(OFTrue); + dropAssoc = OFTrue; + result = DVPSJ_error; + } else { + const char *abstractSyntaxes[] = + { + UID_VerificationSOPClass, + UID_BasicGrayscalePrintManagementMetaSOPClass, + UID_PresentationLUTSOPClass, + UID_PrivateShutdownSOPClass + }; + + int numAbstractSyntaxes = 3; + if (supportPresentationLUT) numAbstractSyntaxes = 4; + + const char* transferSyntaxes[] = { NULL, NULL, NULL }; + int numTransferSyntaxes = 0; + if (implicitOnly) + { + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + } else { + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + + if (gLocalByteOrder == EBO_LittleEndian) { + /* we are on a little endian machine */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + /* we are on a big endian machine */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + } + + /* accept presentation contexts */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( + assoc->params, + (const char**)abstractSyntaxes, numAbstractSyntaxes, + (const char**)transferSyntaxes, numTransferSyntaxes); + errorCond(cond, "Cannot accept presentation contexts:"); + + } + + /* check if we have negotiated the private "shutdown" SOP Class */ + if (0 != ASC_findAcceptedPresentationContextID(assoc, UID_PrivateShutdownSOPClass)) + { + cond = refuseAssociation(OFFalse); + dropAssoc = OFTrue; + result = DVPSJ_terminate; + } + } /* receiveAssociation successful */ + if (dropAssoc) dropAssociation(); + + if (acseSequence && associatePDU) + { + addLogEntry(acseSequence, "A_ASSOCIATE_RQ"); + DcmItem *newItem = new DcmItem(); + if (newItem) + { + DcmElement *assocData = new DcmOtherByteOtherWord(PSTAT_DCM_AssociateData); + if (assocData) + { + assocData->putUint8Array((Uint8 *) associatePDU, associatePDUlength); + newItem->insert(assocData, OFTrue /*replaceOld*/); + acseSequence->insert(newItem); + } else delete newItem; + } + } + delete[] (char *)associatePDU; + return result; +} + + +OFCondition DVPSPrintSCP::refuseAssociation(OFBool isBadContext) +{ + T_ASC_RejectParameters rej; + + if (isBadContext) + { + rej.result = ASC_RESULT_REJECTEDTRANSIENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED; + } else { + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_NOREASON; + } + + void *associatePDU=NULL; + unsigned long associatePDUlength=0; + + OFCondition cond = ASC_rejectAssociation(assoc, &rej, &associatePDU, &associatePDUlength); + + OFString temp_str; + DCMPSTAT_DUMP(ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_RJ)); + + if (acseSequence && associatePDU) + { + addLogEntry(acseSequence, "A_ASSOCIATE_RJ"); + DcmItem *newItem = new DcmItem(); + if (newItem) + { + DcmElement *assocData = new DcmOtherByteOtherWord(PSTAT_DCM_AssociateData); + if (assocData) + { + assocData->putUint8Array((Uint8 *) associatePDU, associatePDUlength); + newItem->insert(assocData, OFTrue /*replaceOld*/); + acseSequence->insert(newItem); + } else delete newItem; + } + } + delete[] (char *)associatePDU; + errorCond(cond, "Association Reject Failed:"); + return cond; +} + + +void DVPSPrintSCP::dropAssociation() +{ + if (assoc == NULL) return; + OFCondition cond = ASC_dropSCPAssociation(assoc); + errorCond(cond, "Cannot Drop Association:"); + cond = ASC_destroyAssociation(&assoc); + errorCond(cond, "Cannot Destroy Association:"); + assoc = NULL; + return; +} + + +void DVPSPrintSCP::handleClient() +{ + void *associatePDU=NULL; + unsigned long associatePDUlength=0; + OFString temp_str; + + OFCondition cond = ASC_acknowledgeAssociation(assoc, &associatePDU, &associatePDUlength); + DCMPSTAT_DUMP(ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_AC)); + if (acseSequence && associatePDU) + { + addLogEntry(acseSequence, "A_ASSOCIATE_AC"); + DcmItem *newItem = new DcmItem(); + if (newItem) + { + DcmElement *assocData = new DcmOtherByteOtherWord(PSTAT_DCM_AssociateData); + if (assocData) + { + assocData->putUint8Array((Uint8 *) associatePDU, associatePDUlength); + newItem->insert(assocData, OFTrue /*replaceOld*/); + acseSequence->insert(newItem); + } else delete newItem; + } + } + delete[] (char *)associatePDU; + + if (! errorCond(cond, "Cannot acknowledge association:")) + { + + DCMPSTAT_INFO("Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")" + << ((ASC_countAcceptedPresentationContexts(assoc->params) == 0) ? "\n (but no valid presentation contexts)" : "")); + + T_DIMSE_Message msg; + T_ASC_PresentationContextID presID; + cond = EC_Normal; + DcmDataset *rawCommandSet=NULL; + + /* do real work */ + while (cond.good()) + { + cond = DIMSE_receiveCommand(assoc, DIMSE_BLOCKING, 0, &presID, &msg, NULL, &rawCommandSet); + /* did peer release, abort, or do we have a valid message ? */ + + if (cond.good()) + { + addLogEntry(logSequence, "RECEIVE"); + if (rawCommandSet) + { + if (logSequence) logSequence->insert(new DcmItem(*rawCommandSet)); + delete rawCommandSet; + rawCommandSet = NULL; + } else { + // should not happen + if (logSequence) logSequence->insert(new DcmItem()); + } + } + + if (cond.good()) + { + /* process command */ + switch (msg.CommandField) + { + case DIMSE_C_ECHO_RQ: + cond = handleCEcho(msg, presID); + break; + case DIMSE_N_GET_RQ: + cond = handleNGet(msg, presID); + break; + case DIMSE_N_SET_RQ: + cond = handleNSet(msg, presID); + break; + case DIMSE_N_ACTION_RQ: + cond = handleNAction(msg, presID); + break; + case DIMSE_N_CREATE_RQ: + cond = handleNCreate(msg, presID); + break; + case DIMSE_N_DELETE_RQ: + cond = handleNDelete(msg, presID); + break; + default: + cond = DIMSE_BADCOMMANDTYPE; /* unsupported command */ + dumpNMessage(msg, NULL, OFFalse); + DCMPSTAT_ERROR("Cannot handle command: 0x" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4) + << OFstatic_cast(unsigned int, msg.CommandField)); + break; + } + } + else + { + /* finish processing loop */ + } + } /* while */ + + if (logSequence) saveDimseLog(); + + /* close association */ + if (cond == DUL_PEERREQUESTEDRELEASE) + { + DCMPSTAT_INFO("Association Release"); + cond = ASC_acknowledgeRelease(assoc); + errorCond(cond, "Cannot release association:"); + } + else if (cond == DUL_PEERABORTEDASSOCIATION) + { + DCMPSTAT_INFO("Association Aborted"); + } + else + { + errorCond(cond, "DIMSE Failure (aborting association):"); + cond = ASC_abortAssociation(assoc); + errorCond(cond, "Cannot abort association:"); + } + } + dropAssociation(); +} + + +OFCondition DVPSPrintSCP::handleCEcho(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID) +{ + OFCondition cond = DIMSE_sendEchoResponse(assoc, presID, &rq.msg.CEchoRQ, STATUS_Success, NULL); + return cond; +} + +OFCondition DVPSPrintSCP::handleNGet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID) +{ + // initialize response message + T_DIMSE_Message rsp; + rsp.CommandField = DIMSE_N_GET_RSP; + rsp.msg.NGetRSP.MessageIDBeingRespondedTo = rq.msg.NGetRQ.MessageID; + rsp.msg.NGetRSP.AffectedSOPClassUID[0] = 0; + rsp.msg.NGetRSP.DimseStatus = STATUS_Success; + rsp.msg.NGetRSP.AffectedSOPInstanceUID[0] = 0; + rsp.msg.NGetRSP.DataSetType = DIMSE_DATASET_NULL; + rsp.msg.NGetRSP.opts = 0; + + OFCondition cond = EC_Normal; + DcmDataset *rspDataset = NULL; + + if (rq.msg.NGetRQ.DataSetType == DIMSE_DATASET_PRESENT) + { + DcmDataset *dataset = NULL; + // should not happen + cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &presID, &dataset, NULL, NULL); + if (cond.good()) + { + if (logSequence) logSequence->insert(new DcmItem(*dataset)); + dumpNMessage(rq, dataset, OFFalse); + } + delete dataset; + if (cond.bad()) return cond; + } else { + dumpNMessage(rq, NULL, OFFalse); + if (logSequence) logSequence->insert(new DcmItem()); + } + + OFString sopClass(rq.msg.NGetRQ.RequestedSOPClassUID); + if (sopClass == UID_PrinterSOPClass) + { + // Print N-GET + printerNGet(rq, rsp, rspDataset); + } else { + DCMPSTAT_WARN("N-GET unsupported for SOP class '" << sopClass << "'"); + rsp.msg.NGetRSP.DimseStatus = STATUS_N_NoSuchSOPClass; + } + DcmDataset *rspCommand = NULL; + addLogEntry(logSequence, "SEND"); + dumpNMessage(rsp, rspDataset, OFTrue); + cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &rsp, NULL, rspDataset, NULL, NULL, &rspCommand); + if (logSequence) + { + if (rspCommand) logSequence->insert(new DcmItem(*rspCommand)); + if (rspDataset) logSequence->insert(new DcmItem(*rspDataset)); + else logSequence->insert(new DcmItem()); + } + delete rspCommand; + delete rspDataset; + return cond; +} + + +OFCondition DVPSPrintSCP::handleNSet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID) +{ + // initialize response message + T_DIMSE_Message rsp; + rsp.CommandField = DIMSE_N_SET_RSP; + rsp.msg.NSetRSP.MessageIDBeingRespondedTo = rq.msg.NSetRQ.MessageID; + rsp.msg.NSetRSP.AffectedSOPClassUID[0] = 0; + rsp.msg.NSetRSP.DimseStatus = STATUS_Success; + rsp.msg.NSetRSP.AffectedSOPInstanceUID[0] = 0; + rsp.msg.NSetRSP.DataSetType = DIMSE_DATASET_NULL; + rsp.msg.NSetRSP.opts = 0; + + OFCondition cond = EC_Normal; + DcmDataset *rqDataset = NULL; + DcmDataset *rspDataset = NULL; + + if (rq.msg.NSetRQ.DataSetType == DIMSE_DATASET_PRESENT) + { + cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &presID, &rqDataset, NULL, NULL); + if (cond.bad()) return cond; + if (logSequence && rqDataset) logSequence->insert(new DcmItem(*rqDataset)); + } else if (logSequence) logSequence->insert(new DcmItem()); + + dumpNMessage(rq, rqDataset, OFFalse); + + OFString sopClass(rq.msg.NSetRQ.RequestedSOPClassUID); + if (sopClass == UID_BasicFilmSessionSOPClass) + { + // BFS N-SET + filmSessionNSet(rq, rqDataset, rsp, rspDataset); + } else if (sopClass == UID_BasicFilmBoxSOPClass) + { + // BFB N-SET + filmBoxNSet(rq, rqDataset, rsp, rspDataset); + } else if (sopClass == UID_BasicGrayscaleImageBoxSOPClass) + { + // BGIB N-SET + imageBoxNSet(rq, rqDataset, rsp, rspDataset); + } else { + DCMPSTAT_WARN("N-SET unsupported for SOP class '" << sopClass << "'"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchSOPClass; + } + + DcmDataset *rspCommand = NULL; + addLogEntry(logSequence, "SEND"); + dumpNMessage(rsp, rspDataset, OFTrue); + cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &rsp, NULL, rspDataset, NULL, NULL, &rspCommand); + if (logSequence) + { + if (rspCommand) logSequence->insert(new DcmItem(*rspCommand)); + if (rspDataset) logSequence->insert(new DcmItem(*rspDataset)); + else logSequence->insert(new DcmItem()); + } + delete rspCommand; + delete rqDataset; + delete rspDataset; + return cond; +} + + +OFCondition DVPSPrintSCP::handleNAction(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID) +{ + // initialize response message + T_DIMSE_Message rsp; + rsp.CommandField = DIMSE_N_ACTION_RSP; + rsp.msg.NActionRSP.MessageIDBeingRespondedTo = rq.msg.NActionRQ.MessageID; + rsp.msg.NActionRSP.AffectedSOPClassUID[0] = 0; + rsp.msg.NActionRSP.DimseStatus = STATUS_Success; + rsp.msg.NActionRSP.AffectedSOPInstanceUID[0] = 0; + rsp.msg.NActionRSP.ActionTypeID = rq.msg.NActionRQ.ActionTypeID; + rsp.msg.NActionRSP.DataSetType = DIMSE_DATASET_NULL; + rsp.msg.NActionRSP.opts = O_NACTION_ACTIONTYPEID; + + OFCondition cond = EC_Normal; + DcmDataset *rqDataset = NULL; + + if (rq.msg.NActionRQ.DataSetType == DIMSE_DATASET_PRESENT) + { + cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &presID, &rqDataset, NULL, NULL); + if (cond.bad()) return cond; + if (logSequence && rqDataset) logSequence->insert(new DcmItem(*rqDataset)); + } else if (logSequence) logSequence->insert(new DcmItem()); + + dumpNMessage(rq, rqDataset, OFFalse); + + OFString sopClass(rq.msg.NActionRQ.RequestedSOPClassUID); + if (sopClass == UID_BasicFilmSessionSOPClass) + { + // BFS N-ACTION + filmSessionNAction(rq, rsp); + } else if (sopClass == UID_BasicFilmBoxSOPClass) + { + // BFB N-ACTION + filmBoxNAction(rq, rsp); + } else { + DCMPSTAT_WARN("N-ACTION unsupported for SOP class '" << sopClass << "'"); + rsp.msg.NActionRSP.DimseStatus = STATUS_N_NoSuchSOPClass; + } + + DcmDataset *rspCommand = NULL; + addLogEntry(logSequence, "SEND"); + dumpNMessage(rsp, NULL, OFTrue); + cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &rsp, NULL, NULL, NULL, NULL, &rspCommand); + if (logSequence) + { + if (rspCommand) logSequence->insert(new DcmItem(*rspCommand)); + logSequence->insert(new DcmItem()); + } + delete rspCommand; + delete rqDataset; + return cond; +} + + +OFCondition DVPSPrintSCP::handleNCreate(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID) +{ + // initialize response message + T_DIMSE_Message rsp; + rsp.CommandField = DIMSE_N_CREATE_RSP; + rsp.msg.NCreateRSP.MessageIDBeingRespondedTo = rq.msg.NCreateRQ.MessageID; + rsp.msg.NCreateRSP.AffectedSOPClassUID[0] = 0; + rsp.msg.NCreateRSP.DimseStatus = STATUS_Success; + if (rq.msg.NCreateRQ.opts & O_NCREATE_AFFECTEDSOPINSTANCEUID) + { + // instance UID is provided by SCU + strncpy(rsp.msg.NCreateRSP.AffectedSOPInstanceUID, rq.msg.NCreateRQ.AffectedSOPInstanceUID, sizeof(DIC_UI)); + } else { + // we generate our own instance UID + dcmGenerateUniqueIdentifier(rsp.msg.NCreateRSP.AffectedSOPInstanceUID); + } + rsp.msg.NCreateRSP.DataSetType = DIMSE_DATASET_NULL; + OFBool omitFlag = dviface.getTargetPrintSCPOmitSOPClassUIDFromCreateResponse(cfgname); + if (omitFlag) + { + rsp.msg.NCreateRSP.opts = O_NCREATE_AFFECTEDSOPINSTANCEUID; + } else { + strncpy(rsp.msg.NCreateRSP.AffectedSOPClassUID, rq.msg.NCreateRQ.AffectedSOPClassUID, sizeof(DIC_UI)); + rsp.msg.NCreateRSP.opts = O_NCREATE_AFFECTEDSOPINSTANCEUID | O_NCREATE_AFFECTEDSOPCLASSUID; + } + + OFCondition cond = EC_Normal; + DcmDataset *rqDataset = NULL; + DcmDataset *rspDataset = NULL; + + if (rq.msg.NCreateRQ.DataSetType == DIMSE_DATASET_PRESENT) + { + cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &presID, &rqDataset, NULL, NULL); + if (cond.bad()) return cond; + if (logSequence && rqDataset) logSequence->insert(new DcmItem(*rqDataset)); + } else if (logSequence) logSequence->insert(new DcmItem()); + + dumpNMessage(rq, rqDataset, OFFalse); + + OFString sopClass(rq.msg.NCreateRQ.AffectedSOPClassUID); + if (sopClass == UID_BasicFilmSessionSOPClass) + { + // BFS N-CREATE + filmSessionNCreate(rqDataset, rsp, rspDataset); + } else if (sopClass == UID_BasicFilmBoxSOPClass) + { + // BFB N-CREATE + filmBoxNCreate(rqDataset, rsp, rspDataset); + } else if (sopClass == UID_PresentationLUTSOPClass) + { + // P-LUT N-CREATE + presentationLUTNCreate(rqDataset, rsp, rspDataset); + } else { + DCMPSTAT_WARN("N-CREATE unsupported for SOP class '" << sopClass << "'"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchSOPClass; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } + + DcmDataset *rspCommand = NULL; + addLogEntry(logSequence, "SEND"); + dumpNMessage(rsp, rspDataset, OFTrue); + cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &rsp, NULL, rspDataset, NULL, NULL, &rspCommand); + if (logSequence) + { + if (rspCommand) logSequence->insert(new DcmItem(*rspCommand)); + if (rspDataset) logSequence->insert(new DcmItem(*rspDataset)); + else logSequence->insert(new DcmItem()); + } + delete rspCommand; + delete rqDataset; + delete rspDataset; + return cond; +} + +OFCondition DVPSPrintSCP::handleNDelete(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID) +{ + // initialize response message + T_DIMSE_Message rsp; + rsp.CommandField = DIMSE_N_DELETE_RSP; + rsp.msg.NDeleteRSP.MessageIDBeingRespondedTo = rq.msg.NDeleteRQ.MessageID; + rsp.msg.NDeleteRSP.AffectedSOPClassUID[0] = 0; + rsp.msg.NDeleteRSP.DimseStatus = STATUS_Success; + rsp.msg.NDeleteRSP.AffectedSOPInstanceUID[0] = 0; + rsp.msg.NDeleteRSP.DataSetType = DIMSE_DATASET_NULL; + rsp.msg.NDeleteRSP.opts = 0; + + OFCondition cond = EC_Normal; + if (rq.msg.NDeleteRQ.DataSetType == DIMSE_DATASET_PRESENT) + { + // should not happen + DcmDataset *dataset = NULL; + cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &presID, &dataset, NULL, NULL); + if (cond.good()) + { + if (logSequence) logSequence->insert(new DcmItem(*dataset)); + dumpNMessage(rq, dataset, OFFalse); + } + delete dataset; + if (cond.bad()) return cond; + } else { + if (logSequence) logSequence->insert(new DcmItem()); + dumpNMessage(rq, NULL, OFFalse); + } + + OFString sopClass(rq.msg.NDeleteRQ.RequestedSOPClassUID); + if (sopClass == UID_BasicFilmSessionSOPClass) + { + // BFS N-DELETE + filmSessionNDelete(rq, rsp); + } else if (sopClass == UID_BasicFilmBoxSOPClass) + { + // BFB N-DELETE + filmBoxNDelete(rq, rsp); + } else if (sopClass == UID_PresentationLUTSOPClass) + { + // P-LUT N-DELETE + presentationLUTNDelete(rq, rsp); + } else { + DCMPSTAT_WARN("N-DELETE unsupported for SOP class '" << sopClass << "'"); + rsp.msg.NDeleteRSP.DimseStatus = STATUS_N_NoSuchSOPClass; + } + + DcmDataset *rspCommand = NULL; + addLogEntry(logSequence, "SEND"); + dumpNMessage(rsp, NULL, OFTrue); + cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &rsp, NULL, NULL, NULL, NULL, &rspCommand); + if (logSequence) + { + if (rspCommand) logSequence->insert(new DcmItem(*rspCommand)); + logSequence->insert(new DcmItem()); + } + delete rspCommand; + return cond; +} + + +void DVPSPrintSCP::printerNGet(T_DIMSE_Message& rq, T_DIMSE_Message& rsp, DcmDataset *& rspDataset) +{ + OFString printerInstance(UID_PrinterSOPInstance); + if (printerInstance == rq.msg.NGetRQ.RequestedSOPInstanceUID) + { + OFBool result = OFTrue; + rspDataset = new DcmDataset; + if (rspDataset == NULL) + { + rsp.msg.NGetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + + int i=0; + DIC_US group=0; + DIC_US element=0; + while (i+1 < rq.msg.NGetRQ.ListCount) + { + group = rq.msg.NGetRQ.AttributeIdentifierList[i++]; + element = rq.msg.NGetRQ.AttributeIdentifierList[i++]; + if ((group == 0x2110)&&(element == 0x0010)) + { + if (EC_Normal != DVPSHelper::putStringValue(rspDataset, DCM_PrinterStatus, DEFAULT_printerStatus)) result = OFFalse; + } + else if ((group == 0x2110)&&(element == 0x0020)) + { + if (EC_Normal != DVPSHelper::putStringValue(rspDataset, DCM_PrinterStatusInfo, DEFAULT_printerStatusInfo)) result = OFFalse; + } + else if (element == 0x0000) + { + /* group length */ + } + else + { + DCMPSTAT_WARN("cannot retrieve printer information: unsupported attribute (" + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4) << (int)group << "," + << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4) << (int)element + << ") in attribute list."); + rsp.msg.NGetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + + if (rq.msg.NGetRQ.ListCount == 0) + { + if (EC_Normal != DVPSHelper::putStringValue(rspDataset, DCM_PrinterStatus, DEFAULT_printerStatus)) result = OFFalse; + if (EC_Normal != DVPSHelper::putStringValue(rspDataset, DCM_PrinterStatusInfo, DEFAULT_printerStatusInfo)) result = OFFalse; + } + + if (result) + { + rsp.msg.NSetRSP.DataSetType = DIMSE_DATASET_PRESENT; + } else { + delete rspDataset; + rspDataset = NULL; + if (rsp.msg.NGetRSP.DimseStatus == 0) rsp.msg.NGetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot retrieve printer information, instance UID is not well-known printer SOP instance UID."); + rsp.msg.NGetRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + +void DVPSPrintSCP::filmSessionNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset) +{ + if (filmSession && (filmSession->isInstance(rq.msg.NSetRQ.RequestedSOPInstanceUID))) + { + OFBool usePLUTinFilmSession = OFFalse; + if (assoc && (0 != ASC_findAcceptedPresentationContextID(assoc, UID_PresentationLUTSOPClass))) + { + if (dviface.getTargetPrinterPresentationLUTinFilmSession(cfgname)) usePLUTinFilmSession = OFTrue; + } + + DVPSFilmSession *newSession = new DVPSFilmSession(*filmSession); + if (newSession) + { + if (newSession->printSCPSet(dviface, cfgname, rqDataset, rsp, rspDataset, usePLUTinFilmSession, presentationLUTList, storedPrintList)) + { + delete filmSession; + filmSession = newSession; + } else delete newSession; + } else { + DCMPSTAT_WARN("cannot update film session, out of memory."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } else { + // film session does not exist or wrong instance UID + DCMPSTAT_WARN("cannot update film session, object not found."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + +void DVPSPrintSCP::filmBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset) +{ + OFBool usePLUTinFilmBox = OFFalse; + if (assoc && (0 != ASC_findAcceptedPresentationContextID(assoc, UID_PresentationLUTSOPClass))) + { + if (! dviface.getTargetPrinterPresentationLUTinFilmSession(cfgname)) usePLUTinFilmBox = OFTrue; + } + storedPrintList.printSCPBasicFilmBoxSet(dviface, cfgname, rq, rqDataset, rsp, rspDataset, usePLUTinFilmBox, presentationLUTList); +} + +void DVPSPrintSCP::filmSessionNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp) +{ + if (filmSession && (filmSession->isInstance(rq.msg.NActionRQ.RequestedSOPInstanceUID))) + { + storedPrintList.printSCPBasicFilmSessionAction(dviface, cfgname, rsp, presentationLUTList); + } else { + // film session does not exist or wrong instance UID + DCMPSTAT_WARN("cannot print film session, object not found."); + rsp.msg.NActionRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + +void DVPSPrintSCP::filmBoxNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp) +{ + storedPrintList.printSCPBasicFilmBoxAction(dviface, cfgname, rq, rsp, presentationLUTList); +} + +void DVPSPrintSCP::filmSessionNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset) +{ + if (filmSession) + { + // film session exists already, refuse n-create + DCMPSTAT_WARN("cannot create two film sessions concurrently."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_DuplicateSOPInstance; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } else { + OFBool usePLUTinFilmSession = OFFalse; + if (assoc && (0 != ASC_findAcceptedPresentationContextID(assoc, UID_PresentationLUTSOPClass))) + { + if (dviface.getTargetPrinterPresentationLUTinFilmSession(cfgname)) usePLUTinFilmSession = OFTrue; + } + + DVPSFilmSession *newSession = new DVPSFilmSession(DEFAULT_illumination, DEFAULT_reflectedAmbientLight); + if (newSession) + { + DIC_AE peerTitle; + peerTitle[0]=0; + ASC_getAPTitles(assoc->params, peerTitle, sizeof(peerTitle), NULL, 0, NULL, 0); + if (newSession->printSCPCreate(dviface, cfgname, rqDataset, rsp, rspDataset, + peerTitle, usePLUTinFilmSession, presentationLUTList)) + filmSession = newSession; + char uid[100]; + studyInstanceUID.putString(dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT)); + psSeriesInstanceUID.putString(dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT)); + imageSeriesInstanceUID.putString(dcmGenerateUniqueIdentifier(uid)); + } else { + DCMPSTAT_WARN("cannot create film session, out of memory."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } + } +} + +void DVPSPrintSCP::filmBoxNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset) +{ + if (filmSession) + { + if (storedPrintList.haveFilmBoxInstance(rsp.msg.NCreateRSP.AffectedSOPInstanceUID)) + { + DCMPSTAT_WARN("cannot create film box, requested SOP instance UID already in use."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_DuplicateSOPInstance; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } else { + DVPSStoredPrint *newSPrint = new DVPSStoredPrint(DEFAULT_illumination, DEFAULT_reflectedAmbientLight); + if (newSPrint) + { + if (assoc) newSPrint->setOriginator(assoc->params->DULparams.callingAPTitle); + + // get AETITLE from config file + const char *aetitle = dviface.getTargetAETitle(cfgname); + if (aetitle==NULL) aetitle = dviface.getNetworkAETitle(); // default if AETITLE is missing + newSPrint->setDestination(aetitle); + newSPrint->setPrinterName(cfgname); + + OFBool usePLUTinFilmBox = OFFalse; + OFBool usePLUTinFilmSession = OFFalse; + if (assoc && (0 != ASC_findAcceptedPresentationContextID(assoc, UID_PresentationLUTSOPClass))) + { + if (dviface.getTargetPrinterPresentationLUTinFilmSession(cfgname)) usePLUTinFilmSession = OFTrue; + else usePLUTinFilmBox = OFTrue; + } + if (newSPrint->printSCPCreate(dviface, cfgname, rqDataset, rsp, rspDataset, usePLUTinFilmBox, + presentationLUTList, filmSession->getUID(), studyInstanceUID, psSeriesInstanceUID, imageSeriesInstanceUID)) + { + if (usePLUTinFilmSession) + { + filmSession->copyPresentationLUTSettings(*newSPrint); // update P-LUT settings from film session + } + storedPrintList.insert(newSPrint); + } else delete newSPrint; + } else { + DCMPSTAT_WARN("cannot create film box, out of memory."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } + } + } else { + // no film session, refuse n-create + DCMPSTAT_WARN("cannot create film box without film session."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidObjectInstance; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } +} + +void DVPSPrintSCP::presentationLUTNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset) +{ + if ((assoc==NULL) || (0 == ASC_findAcceptedPresentationContextID(assoc, UID_PresentationLUTSOPClass))) + { + DCMPSTAT_WARN("cannot create presentation LUT, not negotiated."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchSOPClass; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } + else if (presentationLUTList.findPresentationLUT(rsp.msg.NCreateRSP.AffectedSOPInstanceUID)) + { + DCMPSTAT_WARN("cannot create presentation LUT, requested SOP instance UID already in use."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_DuplicateSOPInstance; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } else { + DVPSPresentationLUT *newPLut = new DVPSPresentationLUT(); + if (newPLut) + { + OFBool matchRequired = dviface.getTargetPrinterPresentationLUTMatchRequired(cfgname); + OFBool supports12Bit = dviface.getTargetPrinterSupports12BitTransmission(cfgname); + if (newPLut->printSCPCreate(rqDataset, rsp, rspDataset, matchRequired, supports12Bit)) + { + presentationLUTList.insert(newPLut); + } else delete newPLut; + } else { + DCMPSTAT_WARN("cannot create presentation LUT, out of memory."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + rsp.msg.NCreateRSP.opts = 0; // don't include affected SOP instance UID + } + } +} + +void DVPSPrintSCP::filmSessionNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp) +{ + if (filmSession && (filmSession->isInstance(rq.msg.NDeleteRQ.RequestedSOPInstanceUID))) + { + // delete film box hierarchy and film session object + storedPrintList.clear(); + delete filmSession; + filmSession = NULL; + } else { + // film session does not exist or wrong instance UID + DCMPSTAT_WARN("cannot delete film session with instance UID '" << rq.msg.NDeleteRQ.RequestedSOPInstanceUID << "': object does not exist."); + rsp.msg.NDeleteRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + +void DVPSPrintSCP::filmBoxNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp) +{ + storedPrintList.printSCPBasicFilmBoxDelete(rq, rsp); +} + +void DVPSPrintSCP::presentationLUTNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp) +{ + // check whether references to this object exist. In this case, don't delete + if (storedPrintList.usesPresentationLUT(rq.msg.NDeleteRQ.RequestedSOPInstanceUID)) + { + DCMPSTAT_WARN("cannot delete presentation LUT '" << rq.msg.NDeleteRQ.RequestedSOPInstanceUID << "': object still in use."); + rsp.msg.NDeleteRSP.DimseStatus = STATUS_N_ProcessingFailure; + } else { + presentationLUTList.printSCPDelete(rq, rsp); + } +} + +void DVPSPrintSCP::imageBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset) +{ + OFBool usePLUT = OFFalse; + if (assoc && (0 != ASC_findAcceptedPresentationContextID(assoc, UID_PresentationLUTSOPClass))) usePLUT = OFTrue; + storedPrintList.printSCPBasicGrayscaleImageBoxSet(dviface, cfgname, rq, rqDataset, rsp, rspDataset, usePLUT); +} + +void DVPSPrintSCP::addLogEntry(DcmSequenceOfItems *seq, const char *text) +{ + if ((!seq)||(!text)) return; + + DcmItem *newItem = new DcmItem(); + if (!newItem) return; + + OFString aString; + DcmElement *logEntryType = new DcmCodeString(PSTAT_DCM_LogEntryType); + if (logEntryType) + { + logEntryType->putString(text); + newItem->insert(logEntryType, OFTrue /*replaceOld*/); + } + + DVPSHelper::currentDate(aString); + DcmElement *logDate = new DcmDate(PSTAT_DCM_LogDate); + if (logDate) + { + logDate->putString(aString.c_str()); + newItem->insert(logDate, OFTrue /*replaceOld*/); + } + + DVPSHelper::currentTime(aString); + DcmElement *logTime = new DcmTime(PSTAT_DCM_LogTime); + if (logTime) + { + logTime->putString(aString.c_str()); + newItem->insert(logTime, OFTrue /*replaceOld*/); + } + seq->insert(newItem); +} + + +void DVPSPrintSCP::setDimseLogPath(const char *fname) +{ + if (fname) + { + logPath = fname; + if (logSequence == NULL) logSequence = new DcmSequenceOfItems(PSTAT_DCM_LogSequence); + if (acseSequence == NULL) acseSequence = new DcmSequenceOfItems(PSTAT_DCM_AcseSequence); + } else { + logPath.clear(); + delete logSequence; + logSequence = NULL; + } +} + +void DVPSPrintSCP::saveDimseLog() +{ + if (logSequence == NULL) return; + + DcmFileFormat fformat; + DcmDataset *dset = fformat.getDataset(); + if (! dset) return; + + dset->insert(logSequence, OFTrue /*replaceOld*/); + logSequence = NULL; + if (acseSequence) dset->insert(acseSequence, OFTrue /*replaceOld*/); + acseSequence = NULL; + + char uid[80]; + OFString aString; + + const char *aetitle = dviface.getTargetAETitle(cfgname); + if (aetitle==NULL) aetitle = dviface.getNetworkAETitle(); // default if AETITLE is missing + aString = OFFIS_DTK_IMPLEMENTATION_VERSION_NAME; + aString += " "; + aString += aetitle; + + DcmElement *logReserve = new DcmLongString(PSTAT_DCM_LogReservation); + if (logReserve) + { + logReserve->putString(aString.c_str()); + dset->insert(logReserve, OFTrue /*replaceOld*/); + } + + DVPSHelper::putStringValue(dset, DCM_SOPClassUID, PSTAT_DIMSE_LOG_STORAGE_UID); + DVPSHelper::putStringValue(dset, DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid)); + DVPSHelper::currentDate(aString); + DVPSHelper::putStringValue(dset, DCM_InstanceCreationDate, aString.c_str()); + DVPSHelper::currentTime(aString); + DVPSHelper::putStringValue(dset, DCM_InstanceCreationTime, aString.c_str()); + + OFCondition cond = DVPSHelper::saveFileFormat(logPath.c_str(), &fformat, OFTrue); + if (cond == EC_Normal) + { + DCMPSTAT_INFO("DIMSE communication log stored in in DICOM file '" << logPath << "'."); + } else { + DCMPSTAT_WARN("unable to store DIMSE communication log in file '" << logPath << "'."); + } + + logPath.clear(); +} + +void DVPSPrintSCP::dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing) +{ + OFString str; + if (outgoing) { + DIMSE_dumpMessage(str, msg, DIMSE_OUTGOING, dataset); + } else { + DIMSE_dumpMessage(str, msg, DIMSE_INCOMING, dataset); + } + DCMPSTAT_DUMP(str); +} diff --git a/dcmpstat/libsrc/dvpsri.cc b/dcmpstat/libsrc/dvpsri.cc new file mode 100644 index 00000000..5142a03f --- /dev/null +++ b/dcmpstat/libsrc/dvpsri.cc @@ -0,0 +1,258 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSReferencedImage + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dvpsri.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + + +/* --------------- class DVPSReferencedImage --------------- */ + +DVPSReferencedImage::DVPSReferencedImage() +: referencedSOPClassUID(DCM_ReferencedSOPClassUID) +, referencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +, referencedFrameNumber(DCM_ReferencedFrameNumber) +, frameCache(NULL) +, frameCacheEntries(0) +{ +} + +DVPSReferencedImage::DVPSReferencedImage(const DVPSReferencedImage& copy) +: referencedSOPClassUID(copy.referencedSOPClassUID) +, referencedSOPInstanceUID(copy.referencedSOPInstanceUID) +, referencedFrameNumber(copy.referencedFrameNumber) +, frameCache(NULL) // we don't copy the frame cache +, frameCacheEntries(0) +{ +} + +DVPSReferencedImage::~DVPSReferencedImage() +{ + if (frameCache) delete[] frameCache; +} + +OFCondition DVPSReferencedImage::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + flushCache(); + + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, referencedSOPClassUID) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, referencedSOPInstanceUID) + READ_FROM_DATASET(DcmIntegerString, EVR_IS, referencedFrameNumber) + + /* Now perform basic sanity checks */ + + if (referencedSOPClassUID.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced image SQ item with referencedSOPClassUID absent or empty"); + } + else if (referencedSOPClassUID.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced image SQ item with referencedSOPClassUID VM != 1"); + } + + if (referencedSOPInstanceUID.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced image SQ item with referencedSOPInstanceUID absent or empty"); + } + else if (referencedSOPInstanceUID.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced image SQ item with referencedSOPInstanceUID VM != 1"); + } + + return result; +} + +OFCondition DVPSReferencedImage::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_TO_DATASET(DcmUniqueIdentifier, referencedSOPClassUID) + ADD_TO_DATASET(DcmUniqueIdentifier, referencedSOPInstanceUID) + if (referencedFrameNumber.getLength() >0) { ADD_TO_DATASET(DcmIntegerString, referencedFrameNumber) } + + return result; +} + +OFBool DVPSReferencedImage::validateSOPClassUID(OFString& sopclassuid) +{ + OFBool result = OFTrue; + if (sopclassuid.empty()) referencedSOPClassUID.getOFString(sopclassuid, 0); + else + { + OFString currentUID; + referencedSOPClassUID.getOFString(currentUID, 0); + if (currentUID != sopclassuid) + { + result = OFFalse; + DCMPSTAT_WARN("images of different SOP classes referenced in presentation state"); + } + } + return result; +} + +void DVPSReferencedImage::setSOPClassUID(const char *uid) +{ + if (uid) referencedSOPClassUID.putString(uid); else referencedSOPClassUID.clear(); + return; +} + +void DVPSReferencedImage::setSOPInstanceUID(const char *uid) +{ + if (uid) referencedSOPInstanceUID.putString(uid); else referencedSOPInstanceUID.clear(); + return; +} + +void DVPSReferencedImage::setFrameNumbers(const char *frames) +{ + if (frames) referencedFrameNumber.putString(frames); else referencedFrameNumber.clear(); + flushCache(); + return; +} + +OFBool DVPSReferencedImage::isSOPInstanceUID(const char *uid) +{ + OFString aString; + if (uid && (EC_Normal == referencedSOPInstanceUID.getOFString(aString,0))) + { + if (aString == uid) return OFTrue; + } + return OFFalse; +} + +OFCondition DVPSReferencedImage::getImageReference( + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames) +{ + OFCondition result = referencedSOPClassUID.getOFString(sopclassUID,0); + if (EC_Normal == result) result = referencedSOPInstanceUID.getOFString(instanceUID,0); + if (EC_Normal == result) result = referencedFrameNumber.getOFStringArray(frames); + return result; +} + +void DVPSReferencedImage::flushCache() +{ + if (frameCache) delete[] frameCache; + frameCache = NULL; + frameCacheEntries = 0; +} + +OFBool DVPSReferencedImage::appliesToAllFrames() +{ + if (referencedFrameNumber.getLength() == 0) return OFTrue; + if (referencedFrameNumber.getVM() == 0) return OFTrue; + return OFFalse; +} + +void DVPSReferencedImage::updateCache() +{ + Sint32 val=0; + unsigned long i; + if (frameCache==NULL) + { + frameCacheEntries = (Uint32) referencedFrameNumber.getVM(); + if (frameCacheEntries > 0) + { + frameCache = new Sint32[frameCacheEntries]; + if (frameCache) + { + for (i=0; iclone()); + ++first; + } +} + +DVPSReferencedImage_PList::~DVPSReferencedImage_PList() +{ + clear(); +} + +void DVPSReferencedImage_PList::clear() +{ + OFListIterator(DVPSReferencedImage *) first = list_.begin(); + OFListIterator(DVPSReferencedImage *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSReferencedImage_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSReferencedImage *newImage = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_ReferencedImageSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newImage = new DVPSReferencedImage(); + if (newImage && ditem) + { + result = newImage->read(*ditem); + list_.push_back(newImage); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSReferencedImage_PList::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_ReferencedImageSequence); + if (dseq) + { + OFListIterator(DVPSReferencedImage *) first = list_.begin(); + OFListIterator(DVPSReferencedImage *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + +OFBool DVPSReferencedImage_PList::isValid(OFString& sopclassuid) +{ + if (size() == 0) + { + DCMPSTAT_WARN("referenced image SQ contains empty item in presentation state"); + return OFFalse; + } + OFBool result = OFTrue; + OFListIterator(DVPSReferencedImage *) first = list_.begin(); + OFListIterator(DVPSReferencedImage *) last = list_.end(); + while ((result == OFTrue) && (first != last)) + { + result = (*first)->validateSOPClassUID(sopclassuid); + ++first; + } + return result; +} + +DVPSReferencedImage *DVPSReferencedImage_PList::findImageReference(const char *sopinstanceuid) +{ + OFListIterator(DVPSReferencedImage *) first = list_.begin(); + OFListIterator(DVPSReferencedImage *) last = list_.end(); + while (first != last) + { + if ((*first)->isSOPInstanceUID(sopinstanceuid)) return *first; + ++first; + } + return NULL; +} + +void DVPSReferencedImage_PList::removeFrameReference(const char *sopinstanceuid, unsigned long frame, unsigned long numberOfFrames) +{ + if ((frame<1)||(numberOfFramesisSOPInstanceUID(sopinstanceuid)) + { + (*first)->removeFrameReference(frame, numberOfFrames); + if ((*first)->appliesToAllFrames()) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } else ++first; + } + return; +} + +void DVPSReferencedImage_PList::removeImageReference(const char *sopinstanceuid) +{ + OFListIterator(DVPSReferencedImage *) first = list_.begin(); + OFListIterator(DVPSReferencedImage *) last = list_.end(); + while (first != last) + { + if ((*first)->isSOPInstanceUID(sopinstanceuid)) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + return; +} + +OFCondition DVPSReferencedImage_PList::addImageReference( + const char *sopclassUID, + const char *instanceUID, + const char *frames) +{ + OFCondition result = EC_Normal; + + /* make sure that we don't create two references to the same image */ + if (findImageReference(instanceUID)) result = EC_IllegalCall; + else + { + DVPSReferencedImage *image = new DVPSReferencedImage(); + if (image) + { + image->setSOPClassUID(sopclassUID); + image->setSOPInstanceUID(instanceUID); + if (frames) image->setFrameNumbers(frames); + list_.push_back(image); + } else result = EC_MemoryExhausted; + } + return result; +} + +OFCondition DVPSReferencedImage_PList::addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability) +{ + if ((sopclassUID==NULL)||(instanceUID==NULL)||(applicability==DVPSB_allImages)) return EC_IllegalCall; + const char *framenumber=NULL; + if (applicability==DVPSB_currentFrame) + { + char frameString[100]; + sprintf(frameString, "%ld", frame); + framenumber = frameString; + } + return addImageReference(sopclassUID, instanceUID, framenumber); +} + + +OFCondition DVPSReferencedImage_PList::getImageReference( + size_t idx, + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames) +{ + if (size() <= idx) return EC_IllegalCall; + OFListIterator(DVPSReferencedImage *) first = list_.begin(); + OFListIterator(DVPSReferencedImage *) last = list_.end(); + while (first != last) + { + if (idx==0) return (*first)->getImageReference(sopclassUID, instanceUID, frames); else + { + idx--; + ++first; + } + } + return EC_IllegalCall; +} + +void DVPSReferencedImage_PList::removeImageReference( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability) +{ + + if (applicability == DVPSB_allImages) + { + clear(); + return; + } + + // if list of image references is empty, add all existing references + if (size() == 0) + { + OFString seriesUID; + OFString sopclassUID; + OFString sopinstanceUID; + OFString frames; + OFString aetitle; + OFString filesetID; + OFString filesetUID; + const char *cframes=NULL; + + size_t numberOfReferences = allReferences.numberOfImageReferences(); + for (size_t i=0; i 0) cframes=frames.c_str(); else cframes=NULL; + addImageReference(sopclassUID.c_str(), sopinstanceUID.c_str(), cframes); + } + } + } + if (applicability == DVPSB_currentImage) removeImageReference(instanceUID); + else removeFrameReference(instanceUID, frame, numberOfFrames); + return; +} + +OFBool DVPSReferencedImage_PList::isApplicable(const char *instanceUID, unsigned long frame) +{ + if (size() == 0) return OFTrue; // if no image references exist, the object is valid "globally". + DVPSReferencedImage *imageRef = findImageReference(instanceUID); + if (imageRef) return imageRef->appliesToFrame(frame); + return OFFalse; +} + +OFBool DVPSReferencedImage_PList::matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability) +{ + DVPSReferencedImage *imageRef = NULL; + switch (applicability) + { + case DVPSB_currentFrame: + // we match if referenced image SQ contains exactly one item + // referencing only the current frame of the current image + if (size() == 1) + { + imageRef = findImageReference(instanceUID); + if (imageRef) return imageRef->appliesOnlyToFrame(frame); + } + break; + case DVPSB_currentImage: + // we match if referenced image SQ contains exactly one item + // referencing all frames of the current image + if (size() == 1) + { + imageRef = findImageReference(instanceUID); + if (imageRef) return imageRef->appliesToAllFrames(); + } + break; + case DVPSB_allImages: + // applicability matches if referenced image SQ is empty + if (size() == 0) return OFTrue; + break; + } + return OFFalse; +} diff --git a/dcmpstat/libsrc/dvpsrs.cc b/dcmpstat/libsrc/dvpsrs.cc new file mode 100644 index 00000000..f7e41ab7 --- /dev/null +++ b/dcmpstat/libsrc/dvpsrs.cc @@ -0,0 +1,218 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSReferencedSeries + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmpstat/dvpsrs.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + +/* --------------- class DVPSReferencedSeries --------------- */ + +DVPSReferencedSeries::DVPSReferencedSeries() +: referencedImageList() +, seriesInstanceUID(DCM_SeriesInstanceUID) +, retrieveAETitle(DCM_RetrieveAETitle) +, storageMediaFileSetID(DCM_StorageMediaFileSetID) +, storageMediaFileSetUID(DCM_StorageMediaFileSetUID) +{ +} + +DVPSReferencedSeries::DVPSReferencedSeries(const DVPSReferencedSeries& copy) +: referencedImageList(copy.referencedImageList) +, seriesInstanceUID(copy.seriesInstanceUID) +, retrieveAETitle(copy.retrieveAETitle) +, storageMediaFileSetID(copy.storageMediaFileSetID) +, storageMediaFileSetUID(copy.storageMediaFileSetUID) +{ +} + +DVPSReferencedSeries::~DVPSReferencedSeries() +{ +} + +OFCondition DVPSReferencedSeries::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesInstanceUID) + READ_FROM_DATASET(DcmApplicationEntity, EVR_AE, retrieveAETitle) + READ_FROM_DATASET(DcmShortString, EVR_SH, storageMediaFileSetID) + READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, storageMediaFileSetUID) + if (result==EC_Normal) result = referencedImageList.read(dset); + + /* Now perform basic sanity checks */ + + if (seriesInstanceUID.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced series SQ item with seriesInstanceUID absent or empty"); + } + else if (seriesInstanceUID.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced series SQ item with seriesInstanceUID VM != 1"); + } + else if (retrieveAETitle.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced series SQ item with retrieveAETitle VM > 1"); + } + else if (storageMediaFileSetID.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced series SQ item with storageMediaFileSetID VM > 1"); + } + else if (storageMediaFileSetUID.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a referenced series SQ item with storageMediaFileSetUID VM > 1"); + } + + return result; +} + +OFCondition DVPSReferencedSeries::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_TO_DATASET(DcmUniqueIdentifier, seriesInstanceUID) + if (retrieveAETitle.getLength() > 0) + { + ADD_TO_DATASET(DcmApplicationEntity, retrieveAETitle) + } + if (storageMediaFileSetID.getLength() > 0) + { + ADD_TO_DATASET(DcmShortString, storageMediaFileSetID) + } + if (storageMediaFileSetUID.getLength() > 0) + { + ADD_TO_DATASET(DcmUniqueIdentifier, storageMediaFileSetUID) + } + if (result==EC_Normal) result = referencedImageList.write(dset); + + return result; +} + +OFBool DVPSReferencedSeries::isValid(OFString& sopclassuid) +{ + return referencedImageList.isValid(sopclassuid); +} + +OFBool DVPSReferencedSeries::isSeriesUID(const char *uid) +{ + OFString aString; + if (uid && (EC_Normal == seriesInstanceUID.getOFString(aString,0))) + { + if (aString == uid) return OFTrue; + } + return OFFalse; +} + +DVPSReferencedImage *DVPSReferencedSeries::findImageReference(const char *sopinstanceuid) +{ + return referencedImageList.findImageReference(sopinstanceuid); +} + +void DVPSReferencedSeries::removeImageReference(const char *sopinstanceuid) +{ + referencedImageList.removeImageReference(sopinstanceuid); + return; +} + +OFCondition DVPSReferencedSeries::addImageReference( + const char *sopclassUID, + const char *instanceUID, + const char *frames) +{ + return referencedImageList.addImageReference(sopclassUID, instanceUID, frames); +} + +void DVPSReferencedSeries::setSeriesInstanceUID(const char *uid) +{ + if (uid) seriesInstanceUID.putString(uid); else seriesInstanceUID.clear(); + return; +} + +void DVPSReferencedSeries::setRetrieveLocation(const char *aetitle, const char *filesetID, const char *filesetUID) +{ + if (aetitle) retrieveAETitle.putString(aetitle); else retrieveAETitle.clear(); + if (filesetID) storageMediaFileSetID.putString(filesetID); else storageMediaFileSetID.clear(); + if (filesetUID) storageMediaFileSetUID.putString(filesetUID); else storageMediaFileSetUID.clear(); +} + +const char *DVPSReferencedSeries::getRetrieveAETitle() +{ + char *c = NULL; + if (EC_Normal == retrieveAETitle.getString(c)) return c; else return NULL; +} + +const char *DVPSReferencedSeries::getStorageMediaFileSetID() +{ + char *c = NULL; + if (EC_Normal == storageMediaFileSetID.getString(c)) return c; else return NULL; +} + +const char *DVPSReferencedSeries::getStorageMediaFileSetUID() +{ + char *c = NULL; + if (EC_Normal == storageMediaFileSetUID.getString(c)) return c; else return NULL; +} + + +OFCondition DVPSReferencedSeries::getImageReference( + size_t idx, + OFString& seriesUID, + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames, + OFString& aetitle, + OFString& filesetID, + OFString& filesetUID) +{ + OFCondition result = referencedImageList.getImageReference(idx, sopclassUID, instanceUID, frames); + if (EC_Normal == result) result = seriesInstanceUID.getOFString(seriesUID,0); // must not be empty string + if (EC_Normal == result) + { + if (retrieveAETitle.getLength() == 0) + aetitle.clear(); + else + result = retrieveAETitle.getOFString(aetitle,0); + } + if (EC_Normal == result) + { + if (storageMediaFileSetID.getLength() == 0) + filesetID.clear(); + else + result = storageMediaFileSetID.getOFString(filesetID,0); + } + if (EC_Normal == result) + { + if (storageMediaFileSetUID.getLength() == 0) + filesetUID.clear(); + else + result = storageMediaFileSetUID.getOFString(filesetUID,0); + } + return result; +} diff --git a/dcmpstat/libsrc/dvpsrsl.cc b/dcmpstat/libsrc/dvpsrsl.cc new file mode 100644 index 00000000..4b0c83aa --- /dev/null +++ b/dcmpstat/libsrc/dvpsrsl.cc @@ -0,0 +1,272 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSReferencedSeries_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmpstat/dvpsrsl.h" +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsdef.h" + +DVPSReferencedSeries_PList::DVPSReferencedSeries_PList() +: list_() +{ +} + +DVPSReferencedSeries_PList::DVPSReferencedSeries_PList(const DVPSReferencedSeries_PList &arg) +: list_() +{ + OFListConstIterator(DVPSReferencedSeries *) first = arg.list_.begin(); + OFListConstIterator(DVPSReferencedSeries *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSReferencedSeries_PList::~DVPSReferencedSeries_PList() +{ + clear(); +} + +void DVPSReferencedSeries_PList::clear() +{ + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSReferencedSeries_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSReferencedSeries *newSeries = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_ReferencedSeriesSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newSeries = new DVPSReferencedSeries(); + if (newSeries && ditem) + { + result = newSeries->read(*ditem); + list_.push_back(newSeries); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSReferencedSeries_PList::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_ReferencedSeriesSequence); + if (dseq) + { + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + +OFBool DVPSReferencedSeries_PList::isValid() +{ + if (list_.size() == 0) + { + DCMPSTAT_WARN("referenced series SQ is empty in presentation state"); + return OFFalse; + } + + OFBool result = OFTrue; + OFString sopclassuid; + + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + while ((result == OFTrue) && (first != last)) + { + result = (*first)->isValid(sopclassuid); + ++first; + } + return result; +} + +OFBool DVPSReferencedSeries_PList::checkSOPClass(const char *uid) +{ + + OFBool result = OFTrue; + OFString sopclassuid(uid); + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + while ((result == OFTrue) && (first != last)) + { + result = (*first)->isValid(sopclassuid); + ++first; + } + return result; +} + +void DVPSReferencedSeries_PList::removeImageReference(const char *seriesUID, const char *instanceUID) +{ + DVPSReferencedSeries *series = findSeriesReference(seriesUID); + if (series) series->removeImageReference(instanceUID); + return; +} + +DVPSReferencedSeries *DVPSReferencedSeries_PList::findSeriesReference(const char *seriesUID) +{ + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + while (first != last) + { + if ((*first)->isSeriesUID(seriesUID)) return *first; + ++first; + } + return NULL; +} + +DVPSReferencedImage *DVPSReferencedSeries_PList::findImageReference(const char *seriesUID, const char *instanceUID) +{ + DVPSReferencedSeries *series = findSeriesReference(seriesUID); + if (series) return series->findImageReference(instanceUID); else return NULL; +} + +void DVPSReferencedSeries_PList::removeSeriesReference(const char *seriesUID) +{ + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + while (first != last) + { + if ((*first)->isSeriesUID(seriesUID)) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + return; +} + +OFCondition DVPSReferencedSeries_PList::addImageReference( + const char *seriesUID, + const char *sopclassUID, + const char *instanceUID, + const char *frames, + const char *aetitle, + const char *filesetID, + const char *filesetUID) + +{ + if ((seriesUID==NULL) || (sopclassUID==NULL) || (instanceUID==NULL)) return EC_IllegalCall; + + OFCondition result = EC_Normal; + if (checkSOPClass(sopclassUID)) + { + DVPSReferencedSeries *series = findSeriesReference(seriesUID); + if (series == NULL) + { + series = new DVPSReferencedSeries(); + if (series) + { + series->setSeriesInstanceUID(seriesUID); + list_.push_back(series); + } + } + if (series) + { + result = series->addImageReference(sopclassUID, instanceUID, frames); + if (EC_Normal == result) series->setRetrieveLocation(aetitle, filesetID, filesetUID); + } else result = EC_MemoryExhausted; + } else result = EC_IllegalCall; + return result; +} + + +size_t DVPSReferencedSeries_PList::numberOfImageReferences() +{ + size_t result=0; + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + while (first != last) + { + result += (*first)->numberOfImageReferences(); + ++first; + } + return result; +} + +OFCondition DVPSReferencedSeries_PList::getImageReference( + size_t idx, + OFString& seriesUID, + OFString& sopclassUID, + OFString& instanceUID, + OFString& frames, + OFString& aetitle, + OFString& filesetID, + OFString& filesetUID) +{ + OFListIterator(DVPSReferencedSeries *) first = list_.begin(); + OFListIterator(DVPSReferencedSeries *) last = list_.end(); + OFBool found = OFFalse; + size_t i; + while ((!found)&&(first != last)) + { + i=(*first)->numberOfImageReferences(); + if (i > idx) found = OFTrue; else + { + idx -= i; + ++first; + } + } + if (found) return (*first)->getImageReference(idx, seriesUID, sopclassUID, instanceUID, frames, aetitle, filesetID, filesetUID); + return EC_IllegalCall; +} diff --git a/dcmpstat/libsrc/dvpssp.cc b/dcmpstat/libsrc/dvpssp.cc new file mode 100644 index 00000000..c13c73d6 --- /dev/null +++ b/dcmpstat/libsrc/dvpssp.cc @@ -0,0 +1,3194 @@ +/* + * + * Copyright (C) 1998-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSStoredPrint + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpssp.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmpstat/dvpsib.h" +#include "dcmtk/dcmpstat/dvpshlp.h" +#include "dcmtk/dcmimgle/dcmimage.h" +#include "dcmtk/dcmimgle/digsdfn.h" +#include "dcmtk/dcmpstat/dvpscf.h" +#include "dcmtk/dcmnet/dimse.h" /* for DICOM_WARNING_STATUS */ +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsab.h" /* for DVPSAnnotationContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + +#define INCLUDE_CMATH +#define INCLUDE_CTIME +#include "dcmtk/ofstd/ofstdinc.h" + +#define DIMSE_STATUS_OK(status) (((status) == 0) || DICOM_WARNING_STATUS(status)) +#define DIMSE_STATUS_BAD(status) (((status) != 0) && !(DICOM_WARNING_STATUS(status))) + + +/* --------------- class DVPSStoredPrint --------------- */ + +DVPSStoredPrint::DVPSStoredPrint(Uint16 illumin, Uint16 reflection, const char *aetitle) +: patientName(DCM_PatientName) +, patientID(DCM_PatientID) +, patientBirthDate(DCM_PatientBirthDate) +, patientSex(DCM_PatientSex) +, studyInstanceUID(DCM_StudyInstanceUID) +, studyDate(DCM_StudyDate) +, studyTime(DCM_StudyTime) +, referringPhysicianName(DCM_ReferringPhysicianName) +, studyID(DCM_StudyID) +, accessionNumber(DCM_AccessionNumber) +, seriesInstanceUID(DCM_SeriesInstanceUID) +, seriesNumber(DCM_SeriesNumber) +, manufacturer(DCM_Manufacturer) +, originator(DCM_Originator) +, destination(DCM_DestinationAE) +, printerName(DCM_PrinterName) +, instanceNumber(DCM_InstanceNumber) +, imageDisplayFormat(DCM_ImageDisplayFormat) +, annotationDisplayFormatID(DCM_AnnotationDisplayFormatID) +, filmOrientation(DCM_FilmOrientation) +, filmSizeID(DCM_FilmSizeID) +, magnificationType(DCM_MagnificationType) +, smoothingType(DCM_SmoothingType) +, borderDensity(DCM_BorderDensity) +, emptyImageDensity(DCM_EmptyImageDensity) +, minDensity(DCM_MinDensity) +, maxDensity(DCM_MaxDensity) +, trim(DCM_Trim) +, configurationInformation(DCM_ConfigurationInformation) +, illumination(DCM_Illumination) +, reflectedAmbientLight(DCM_ReflectedAmbientLight) +, requestedResolutionID(DCM_RequestedResolutionID) +, referencedPresentationLUTInstanceUID(DCM_ReferencedSOPInstanceUID) +, referencedPresentationLUTAlignment(DVPSK_other) +, imageBoxContentList() +, annotationContentList() +, presentationLUTList() +, sOPInstanceUID(DCM_SOPInstanceUID) +, specificCharacterSet(DCM_SpecificCharacterSet) +, instanceCreationDate(DCM_InstanceCreationDate) +, instanceCreationTime(DCM_InstanceCreationTime) +, imageSeriesInstanceUID(DCM_SeriesInstanceUID) +, currentValuesValid(OFFalse) +, currentNumCols(0) +, currentNumRows(0) +, decimateCropBehaviour(DVPSI_default) +, filmSessionInstanceUID() +, filmBoxInstanceUID() +, presentationLUTInstanceUID() +, globalPresentationLUT() +, globalPresentationLUTValid(OFFalse) +, transmitImagesIn12Bit(OFTrue) +, renderPresentationLUTinSCP(OFFalse) +, tempDensity() +{ + illumination.putUint16(illumin, 0); + reflectedAmbientLight.putUint16(reflection, 0); + if (aetitle != NULL) + originator.putString(aetitle); +} + +DVPSStoredPrint::DVPSStoredPrint(const DVPSStoredPrint& copy) +: patientName(copy.patientName) +, patientID(copy.patientID) +, patientBirthDate(copy.patientBirthDate) +, patientSex(copy.patientSex) +, studyInstanceUID(copy.studyInstanceUID) +, studyDate(copy.studyDate) +, studyTime(copy.studyTime) +, referringPhysicianName(copy.referringPhysicianName) +, studyID(copy.studyID) +, accessionNumber(copy.accessionNumber) +, seriesInstanceUID(copy.seriesInstanceUID) +, seriesNumber(copy.seriesNumber) +, manufacturer(copy.manufacturer) +, originator(copy.originator) +, destination(copy.destination) +, printerName(copy.printerName) +, instanceNumber(copy.instanceNumber) +, imageDisplayFormat(copy.imageDisplayFormat) +, annotationDisplayFormatID(copy.annotationDisplayFormatID) +, filmOrientation(copy.filmOrientation) +, filmSizeID(copy.filmSizeID) +, magnificationType(copy.magnificationType) +, smoothingType(copy.smoothingType) +, borderDensity(copy.borderDensity) +, emptyImageDensity(copy.emptyImageDensity) +, minDensity(copy.minDensity) +, maxDensity(copy.maxDensity) +, trim(copy.trim) +, configurationInformation(copy.configurationInformation) +, illumination(copy.illumination) +, reflectedAmbientLight(copy.reflectedAmbientLight) +, requestedResolutionID(copy.requestedResolutionID) +, referencedPresentationLUTInstanceUID(copy.referencedPresentationLUTInstanceUID) +, referencedPresentationLUTAlignment(copy.referencedPresentationLUTAlignment) +, imageBoxContentList(copy.imageBoxContentList) +, annotationContentList(copy.annotationContentList) +, presentationLUTList(copy.presentationLUTList) +, sOPInstanceUID(copy.sOPInstanceUID) +, specificCharacterSet(copy.specificCharacterSet) +, instanceCreationDate(copy.instanceCreationDate) +, instanceCreationTime(copy.instanceCreationTime) +, imageSeriesInstanceUID(copy.imageSeriesInstanceUID) +, currentValuesValid(copy.currentValuesValid) +, currentNumCols(copy.currentNumCols) +, currentNumRows(copy.currentNumRows) +, decimateCropBehaviour(copy.decimateCropBehaviour) +, filmSessionInstanceUID(copy.filmSessionInstanceUID) +, filmBoxInstanceUID(copy.filmBoxInstanceUID) +, presentationLUTInstanceUID(copy.presentationLUTInstanceUID) +, globalPresentationLUT(copy.globalPresentationLUT) +, globalPresentationLUTValid(copy.globalPresentationLUTValid) +, transmitImagesIn12Bit(copy.transmitImagesIn12Bit) +, renderPresentationLUTinSCP(copy.renderPresentationLUTinSCP) +, tempDensity(copy.tempDensity) +{ +} + +DVPSStoredPrint::~DVPSStoredPrint() +{ +} + +void DVPSStoredPrint::clear() +{ + patientName.clear(); + patientID.clear(); + patientBirthDate.clear(); + patientSex.clear(); + studyInstanceUID.clear(); + studyDate.clear(); + studyTime.clear(); + referringPhysicianName.clear(); + studyID.clear(); + accessionNumber.clear(); + seriesInstanceUID.clear(); + seriesNumber.clear(); + manufacturer.clear(); + originator.clear(); + destination.clear(); + printerName.clear(); + instanceNumber.clear(); + imageDisplayFormat.clear(); + annotationDisplayFormatID.clear(); + filmOrientation.clear(); + filmSizeID.clear(); + magnificationType.clear(); + smoothingType.clear(); + borderDensity.clear(); + emptyImageDensity.clear(); + minDensity.clear(); + maxDensity.clear(); + trim.clear(); + configurationInformation.clear(); + illumination.clear(); + reflectedAmbientLight.clear(); + requestedResolutionID.clear(); + referencedPresentationLUTInstanceUID.clear(); + referencedPresentationLUTAlignment = DVPSK_other; + imageBoxContentList.clear(); + annotationContentList.clear(); + presentationLUTList.clear(); + sOPInstanceUID.clear(); + specificCharacterSet.clear(); + instanceCreationDate.clear(); + instanceCreationTime.clear(); + imageSeriesInstanceUID.clear(); + invalidateCache(); + decimateCropBehaviour = DVPSI_default; + filmSessionInstanceUID.clear(); + filmBoxInstanceUID.clear(); + presentationLUTInstanceUID.clear(); + globalPresentationLUT.clear(); + globalPresentationLUTValid = OFFalse; + transmitImagesIn12Bit = OFTrue; + renderPresentationLUTinSCP = OFFalse; + tempDensity.clear(); +} + +void DVPSStoredPrint::invalidateCache() +{ + currentValuesValid = OFFalse; + currentNumCols=0; + currentNumRows=0; +} + +void DVPSStoredPrint::updateCache() +{ + if (currentValuesValid) return; + OFString aString; + imageDisplayFormat.getOFStringArray(aString,OFTrue); + if (aString.substr(0,9) == "STANDARD\\") + { + unsigned long columns=0; + unsigned long rows=0; + const char *format = aString.c_str() + 9; + + if (2==sscanf(format, "%lu,%lu", &columns, &rows)) + { + currentNumCols = columns; + currentNumRows = rows; + if ((columns > 0)&&(rows > 0)) currentValuesValid = OFTrue; + } else { + DCMPSTAT_WARN("cannot parse image display format '" << aString.c_str() << "'"); + } + } else { + DCMPSTAT_WARN("unknown image display format '" << aString.c_str() << "'"); + } + return; +} + +OFBool DVPSStoredPrint::isImageStorageSOPClass(OFString& sopclassuid) +{ + for (int i=0; icard() ==1) + { + item = seq->getItem(0); + stack.clear(); + + READ_FROM_DATASET2(DcmShortText, EVR_ST, imageDisplayFormat) + READ_FROM_DATASET2(DcmCodeString, EVR_CS, annotationDisplayFormatID) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmCodeString, EVR_CS, filmOrientation) + READ_FROM_DATASET2(DcmCodeString, EVR_CS, filmSizeID) + READ_FROM_DATASET2(DcmCodeString, EVR_CS, magnificationType) + READ_FROM_DATASET2(DcmCodeString, EVR_CS, smoothingType) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmCodeString, EVR_CS, borderDensity) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmCodeString, EVR_CS, emptyImageDensity) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, minDensity) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, maxDensity) + READ_FROM_DATASET2(DcmCodeString, EVR_CS, trim) + READ_FROM_DATASET2(DcmShortText, EVR_ST, configurationInformation) + READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, illumination) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, reflectedAmbientLight) + if (result==EC_TagNotFound) result = EC_Normal; + READ_FROM_DATASET2(DcmCodeString, EVR_CS, requestedResolutionID) + if (result==EC_TagNotFound) result = EC_Normal; + // check referenced presentation LUT sequence + // if there is any reference, it must refer to one of the presentation LUTs we are managing. + stack.clear(); + if (EC_Normal == item->search(DCM_ReferencedPresentationLUTSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + item = seq->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID) + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + referencedPresentationLUTInstanceUID.getOFString(aString,0); + if (NULL == presentationLUTList.findPresentationLUT(aString.c_str())) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("FilmBoxContentSequence presentation LUT reference cannot be resolved"); + } + } + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("found FilmBoxContentSequence in Stored Print with ReferencedPresentationLUTSequence number of items != 1"); + } + } + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("found FilmBoxContentSequence in Stored Print with number of items != 1"); + } + } + } + + if (EC_Normal==result) result = imageBoxContentList.read(dset, presentationLUTList); + + if (EC_Normal==result) result = annotationContentList.read(dset); + + /* Now perform basic sanity checks */ + + if (result==EC_Normal) + { + if ((studyInstanceUID.getLength() == 0)||(studyInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("StudyInstanceUID missing or incorrect in Stored Print"); + } + if ((seriesInstanceUID.getLength() == 0)||(seriesInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("SeriesInstanceUID missing or incorrect in Stored Print"); + } + if ((sOPInstanceUID.getLength() == 0)||(sOPInstanceUID.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("SOPInstanceUID missing or incorrect in Stored Print"); + } + if ((patientName.getLength() == 0)||(patientName.getVM() != 1)) + { + // result=EC_TagNotFound; + DCMPSTAT_WARN("PatientName missing or incorrect in Stored Print"); + } + if ((imageDisplayFormat.getLength() == 0)||(imageDisplayFormat.getVM() != 1)) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("ImageDisplayFormat missing or incorrect in Stored Print"); + } + if (imageBoxContentList.size() == 0) + { + result=EC_TagNotFound; + DCMPSTAT_WARN("ImageBoxContentSequence missing or empty in Stored Print"); + } + } + + /* Finally check the Print Management Capabilities Sequence + * we require the following SOP classes to be referenced here: + * - Basic Film Box + * - Basic Grayscale Image Box + * - at least one Image Storage SOP Class + * we also allow the following SOP classes to be referenced: + * - Printer (is part of Basic Grayscale Meta SOP Class) + * - Basic Film Session (ditto) + * - Presentation LUT + * - Basic Annotation Box + */ + if (result==EC_Normal) + { + stack.clear(); + if (EC_Normal == dset.search(DCM_RETIRED_PrintManagementCapabilitiesSequence, stack, ESM_fromHere, OFFalse)) + { + OFBool haveFilmBox = OFFalse; + OFBool haveGrayscaleImageBox = OFFalse; + OFBool haveImageStorage = OFFalse; + + seq=(DcmSequenceOfItems *)stack.top(); + unsigned long numItems = seq->card(); + for (unsigned long i=0; igetItem(i); + stack.clear(); + refsopclassuid.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopclassuid) + refsopclassuid.getOFString(aString,0); + if (aString == UID_BasicFilmBoxSOPClass) + haveFilmBox=OFTrue; + else + if (aString==UID_BasicGrayscaleImageBoxSOPClass) + haveGrayscaleImageBox = OFTrue; + else + if ((aString == UID_PrinterSOPClass) + ||(aString == UID_BasicFilmSessionSOPClass) + ||(aString == UID_PresentationLUTSOPClass) + ||(aString == UID_BasicAnnotationBoxSOPClass)) { } + else + if (isImageStorageSOPClass(aString)) + haveImageStorage=OFTrue; + else + { + result=EC_IllegalCall; + DCMPSTAT_WARN("Unsupported SOP Class UID in PrintManagementCapabilitiesSequence"); + } + + } + if (EC_Normal==result) + { + if (! haveFilmBox) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("Film Box SOP Class not referenced in PrintManagementCapabilitiesSequence"); + } + if (! haveGrayscaleImageBox) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("Basic Grayscale Image Box SOP Class not referenced in PrintManagementCapabilitiesSequence"); + } + if (! haveImageStorage) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("No Image Storage SOP Class referenced in PrintManagementCapabilitiesSequence"); + } + } + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("PrintManagementCapabilitiesSequence not found"); + } + } + + /* read PrinterName from PrinterCharacteristicsSequence if available */ + if (result == EC_Normal) + { + originator.clear(); + destination.clear(); + printerName.clear(); + stack.clear(); + if (EC_Normal == dset.search(DCM_RETIRED_PrinterCharacteristicsSequence, stack, ESM_fromHere, OFFalse)) + { + seq = (DcmSequenceOfItems *)stack.top(); + if (seq->card() > 0) + { + item = seq->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmApplicationEntity, EVR_AE, originator) + READ_FROM_DATASET2(DcmApplicationEntity, EVR_AE, destination) + READ_FROM_DATASET2(DcmLongString, EVR_LO, printerName) + } + } + if (printerName.getLength() == 0) + DCMPSTAT_WARN("PrinterName missing or incorrect in PrinterCharacteristicsSequence"); + } + + return result; +} + + +OFCondition DVPSStoredPrint::createDefaultValues() +{ + OFCondition result = EC_Normal; + char uid[100]; + OFString aString; + + SET_UID(seriesInstanceUID) + SET_UID(imageSeriesInstanceUID) + + if ((result==EC_Normal)&&(patientName.getLength()==0)) + { + result = patientName.putString(DEFAULT_patientName); + } + + if ((result==EC_Normal)&&(sOPInstanceUID.getLength()==0)) + { + result = sOPInstanceUID.putString(dcmGenerateUniqueIdentifier(uid)); + DVPSHelper::currentDate(aString); + if (result==EC_Normal) result = instanceCreationDate.putString(aString.c_str()); + DVPSHelper::currentTime(aString); + if (result==EC_Normal) result = instanceCreationTime.putString(aString.c_str()); + } + + if ((result==EC_Normal)&&(studyInstanceUID.getLength()==0)) + { + result = studyInstanceUID.putString(dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT)); + DVPSHelper::currentDate(aString); + if (result==EC_Normal) result = studyDate.putString(aString.c_str()); + DVPSHelper::currentTime(aString); + if (result==EC_Normal) result = studyTime.putString(aString.c_str()); + } + + if ((result==EC_Normal)&&(imageDisplayFormat.getLength()==0)) result = imageDisplayFormat.putString(DEFAULT_imageDisplayFormat); + return result; +} + +OFCondition DVPSStoredPrint::write( + DcmItem &dset, + OFBool writeRequestedImageSize, + OFBool limitImages, + OFBool updateDecimateCrop, + OFBool ignoreEmptyImages) +{ + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + OFCondition result = createDefaultValues(); + if ((EC_Normal==result)&& updateDecimateCrop) result = imageBoxContentList.setRequestedDecimateCropBehaviour(decimateCropBehaviour); // set in all image boxes + if (EC_Normal==result) result = imageBoxContentList.createDefaultValues(limitImages, ignoreEmptyImages); // renumber if limitImages is true + + ADD_TO_DATASET(DcmPersonName, patientName) + ADD_TO_DATASET(DcmLongString, patientID) + ADD_TO_DATASET(DcmDate, patientBirthDate) + ADD_TO_DATASET(DcmCodeString, patientSex) + ADD_TO_DATASET(DcmUniqueIdentifier, studyInstanceUID) + ADD_TO_DATASET(DcmDate, studyDate) + ADD_TO_DATASET(DcmTime, studyTime) + ADD_TO_DATASET(DcmPersonName, referringPhysicianName) + ADD_TO_DATASET(DcmShortString, studyID) + ADD_TO_DATASET(DcmShortString, accessionNumber) + ADD_TO_DATASET(DcmUniqueIdentifier, seriesInstanceUID) + ADD_TO_DATASET(DcmIntegerString, seriesNumber) + ADD_TO_DATASET(DcmLongString, manufacturer) + ADD_TO_DATASET(DcmIntegerString, instanceNumber) + ADD_TO_DATASET(DcmUniqueIdentifier, sOPInstanceUID) + + if (specificCharacterSet.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, specificCharacterSet) } + if (instanceCreationDate.getLength() > 0) { ADD_TO_DATASET(DcmDate, instanceCreationDate) } + if (instanceCreationTime.getLength() > 0) { ADD_TO_DATASET(DcmTime, instanceCreationTime) } + + /* create the Film Box Content SQ */ + if (result == EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + dseq = new DcmSequenceOfItems(DCM_RETIRED_FilmBoxContentSequence); + if (dseq) + { + ADD_TO_DATASET2(DcmShortText, imageDisplayFormat) + ADD_TO_DATASET2(DcmCodeString, filmOrientation) + ADD_TO_DATASET2(DcmCodeString, filmSizeID) + ADD_TO_DATASET2(DcmCodeString, magnificationType) + ADD_TO_DATASET2(DcmUnsignedShort, maxDensity) + ADD_TO_DATASET2(DcmShortText, configurationInformation) + if (annotationDisplayFormatID.getLength() > 0) { ADD_TO_DATASET2(DcmCodeString, annotationDisplayFormatID) } + if (smoothingType.getLength() > 0) { ADD_TO_DATASET2(DcmCodeString, smoothingType) } + if (borderDensity.getLength() > 0) { ADD_TO_DATASET2(DcmCodeString, borderDensity) } + if (emptyImageDensity.getLength() > 0) { ADD_TO_DATASET2(DcmCodeString, emptyImageDensity) } + if (minDensity.getLength() > 0) { ADD_TO_DATASET2(DcmUnsignedShort, minDensity) } + if (trim.getLength() > 0) { ADD_TO_DATASET2(DcmCodeString, trim) } + if (requestedResolutionID.getLength() > 0) { ADD_TO_DATASET2(DcmCodeString, requestedResolutionID) } + if ((presentationLUTList.size() > 0) || globalPresentationLUTValid) + { + ADD_TO_DATASET2(DcmUnsignedShort, illumination) + ADD_TO_DATASET2(DcmUnsignedShort, reflectedAmbientLight) + if ((result == EC_Normal) && globalPresentationLUTValid) + { + // generate a new UID for the "global" presentation LUT + char uid[100]; + dcmGenerateUniqueIdentifier(uid); + globalPresentationLUT.setSOPInstanceUID(uid); + result = referencedPresentationLUTInstanceUID.putString(uid); + } + if (EC_Normal == result) result = addReferencedPLUTSQ(*ditem); + } + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + // out of memory during creation of sequence contents. + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } else { + // could allocate item but not sequence. Bail out. + delete ditem; + result = EC_MemoryExhausted; + } + } + else result = EC_MemoryExhausted; + } + + /* add SOP Class UID */ + DcmUniqueIdentifier sopclassuid(DCM_SOPClassUID); + if (result==EC_Normal) + { + result = sopclassuid.putString(UID_RETIRED_StoredPrintStorage); + } + ADD_TO_DATASET(DcmUniqueIdentifier, sopclassuid) + + /* add Modality */ + + DcmCodeString modality(DCM_Modality); + if (result==EC_Normal) + { + result = modality.putString("STORED_PRINT"); // defined term + } + ADD_TO_DATASET(DcmCodeString, modality) + + // compute number of image boxes to write + updateCache(); + unsigned long writeImageBoxes=0; // default: write all + if (limitImages && currentValuesValid) writeImageBoxes = currentNumCols * currentNumRows; + + // write PresentationLUTContentSequence + if (EC_Normal == result) + { + // write general presentation LUT only + if (globalPresentationLUTValid) + { + dseq = new DcmSequenceOfItems(DCM_RETIRED_PresentationLUTContentSequence); + if (dseq) + { + ditem = new DcmItem(); + if (ditem) + { + result = globalPresentationLUT.write(*ditem, OFTrue); + if (result == EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } else result = EC_MemoryExhausted; + if (result == EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else { + // write presentation LUT list + result = presentationLUTList.write(dset); + } + } + + // write imageBoxContentList + if (EC_Normal == result) + result = imageBoxContentList.write(dset, writeRequestedImageSize, (size_t)writeImageBoxes, ignoreEmptyImages, !globalPresentationLUTValid); + + // write annotationContentList + if (EC_Normal == result) result = annotationContentList.write(dset); + + // write PrintManagementCapabilitiesSequence + dseq = new DcmSequenceOfItems(DCM_RETIRED_PrintManagementCapabilitiesSequence); + if (dseq) + { + if (EC_Normal == result) result = DVPSHelper::addReferencedUIDItem(*dseq, UID_BasicFilmSessionSOPClass); + if (EC_Normal == result) result = DVPSHelper::addReferencedUIDItem(*dseq, UID_BasicFilmBoxSOPClass); + if (EC_Normal == result) result = DVPSHelper::addReferencedUIDItem(*dseq, UID_BasicGrayscaleImageBoxSOPClass); + if (EC_Normal == result) result = imageBoxContentList.addImageSOPClasses(*dseq, (size_t)writeImageBoxes); + if ((result == EC_Normal)&&(presentationLUTList.size() > 0)) + { + result = DVPSHelper::addReferencedUIDItem(*dseq, UID_PresentationLUTSOPClass); + } + if ((result == EC_Normal)&&(annotationContentList.size() > 0)) + { + result = DVPSHelper::addReferencedUIDItem(*dseq, UID_BasicAnnotationBoxSOPClass); + } + + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + + // write PrinterCharacteristicsSequence (Type 2) + if (EC_Normal == result) + { + dseq = new DcmSequenceOfItems(DCM_RETIRED_PrinterCharacteristicsSequence); + if (dseq) + { + if (printerName.getLength() > 0) + { + ditem = new DcmItem(); + if (ditem) + { + ADD_TO_DATASET2(DcmApplicationEntity, originator); + ADD_TO_DATASET2(DcmApplicationEntity, destination); + ADD_TO_DATASET2(DcmLongString, printerName); + if (result == EC_Normal) result = dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + if (result == EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + } + + return result; +} + +OFCondition DVPSStoredPrint::writeHardcopyImageAttributes(DcmItem &dset) +{ + DcmElement *delem=NULL; + OFCondition result = createDefaultValues(); + + // add general study module + ADD_TO_DATASET(DcmUniqueIdentifier, studyInstanceUID) + ADD_TO_DATASET(DcmDate, studyDate) + ADD_TO_DATASET(DcmTime, studyTime) + ADD_TO_DATASET(DcmPersonName, referringPhysicianName) + ADD_TO_DATASET(DcmShortString, studyID) + ADD_TO_DATASET(DcmShortString, accessionNumber) + + // add general series module for hardcopy images + DcmIntegerString imageSeriesNumber(DCM_SeriesNumber); // always empty + DcmCodeString modality(DCM_Modality); + if (result==EC_Normal) + { + result = modality.putString("HC"); + } + ADD_TO_DATASET(DcmUniqueIdentifier, imageSeriesInstanceUID) + ADD_TO_DATASET(DcmIntegerString, imageSeriesNumber) + ADD_TO_DATASET(DcmCodeString, modality) + + return result; +} + +DVPSPresentationLUT *DVPSStoredPrint::getImagePresentationLUT(size_t idx) +{ + /* look for referenced Presentation LUT in image box */ + const char *plutuid = imageBoxContentList.getReferencedPresentationLUTInstanceUID(idx); + /* if absent, look for referenced Presentation LUT in film box */ + if ((plutuid == NULL) || (strlen(plutuid) == 0)) + { + char *uid = NULL; + if (referencedPresentationLUTInstanceUID.getString(uid) == EC_Normal) + plutuid = uid; + } + DVPSPresentationLUT *plut = NULL; + if ((plutuid != NULL) && (strlen(plutuid) > 0)) + plut = presentationLUTList.findPresentationLUT(plutuid); + return plut; +} + +DVPSPresentationLUT *DVPSStoredPrint::getPresentationLUT() +{ + if (globalPresentationLUTValid) + return &globalPresentationLUT; + return NULL; +} + +OFCondition DVPSStoredPrint::setDefaultPresentationLUT() +{ + globalPresentationLUTValid = OFFalse; + globalPresentationLUT.clear(); + return EC_Normal; +} + +OFCondition DVPSStoredPrint::setPresentationLUTShape(DVPSPresentationLUTType shape) +{ + OFCondition result = EC_IllegalCall; + if ((shape == DVPSP_identity) || (shape == DVPSP_lin_od)) + { + result = globalPresentationLUT.setType(shape); + globalPresentationLUTValid = (result == EC_Normal); + } + return result; +} + +OFCondition DVPSStoredPrint::setPresentationLookupTable(DcmItem &dset) +{ + OFCondition result = globalPresentationLUT.read(dset, OFFalse); + globalPresentationLUTValid = (result == EC_Normal); + return result; +} + +Sint32 DVPSStoredPrint::convertODtoPValue(Uint16 density, unsigned int bits) +{ + const Uint16 min = getMinDensityValue(); + const Uint16 max = getMaxDensityValue(); + if ((min < max) && ((bits == 8) || (bits == 12) || (bits == 16))) + { + if (density >= max) + return 0; + else if (density <= min) + return (Sint32)DicomImageClass::maxval(bits); + else + { + const double l0 = (double)getPrintIllumination(); + const double la = (double)getPrintReflectedAmbientLight(); + const double d0 = (double)density / 100; + const double dmin = (double)min / 100; + const double dmax = (double)max / 100; + const double lmin = la + l0 * pow((double)10, -dmax); + const double lmax = la + l0 * pow((double)10, -dmin); + const double jmin = DiGSDFunction::getJNDIndex(lmin); + const double jmax = DiGSDFunction::getJNDIndex(lmax); + const double factor = (double)DicomImageClass::maxval(bits) / (jmax - jmin); + return (Sint32)((DiGSDFunction::getJNDIndex(la + l0 * pow((double)10, -d0)) - jmin) * factor); + } + } + return -1; +} + +OFCondition DVPSStoredPrint::addImageBox( + const char *retrieveaetitle, + const char *refstudyuid, + const char *refseriesuid, + const char *refsopclassuid, + const char *refsopinstanceuid, + const char *requestedimagesize, + const char *patientid, + DVPSPresentationLUT *presentationlut, + OFBool inversePLUT) +{ + char instanceuid[100]; + const char *lutUID = presentationLUTList.addPresentationLUT(presentationlut, inversePLUT); + return imageBoxContentList.addImageBox(dcmGenerateUniqueIdentifier(instanceuid), + retrieveaetitle, refstudyuid, refseriesuid, refsopclassuid, + refsopinstanceuid, requestedimagesize, patientid, lutUID); +} + +OFCondition DVPSStoredPrint::addImageBox( + const char *retrieveaetitle, + const char *refsopinstanceuid, + const char *requestedimagesize, + const char *patientid, + DVPSPresentationLUT *presentationlut, + OFBool inversePLUT) +{ + char *refstudyuid=NULL; + char *refseriesuid=NULL; + + createDefaultValues(); // make sure that all UIDs are defined + studyInstanceUID.getString(refstudyuid); // same study UID for stored print and hardcopy image + imageSeriesInstanceUID.getString(refseriesuid); // but separate series for the hardcopy images + + return addImageBox(retrieveaetitle, refstudyuid, refseriesuid, UID_RETIRED_HardcopyGrayscaleImageStorage, + refsopinstanceuid, requestedimagesize, patientid, presentationlut, inversePLUT); +} + +OFCondition DVPSStoredPrint::setOriginator(const char *aetitle) +{ + if ((aetitle == NULL) || (strlen(aetitle) == 0)) + return originator.clear(); + else + return originator.putString(aetitle); +} + +OFCondition DVPSStoredPrint::setDestination(const char *aetitle) +{ + if ((aetitle == NULL) || (strlen(aetitle) == 0)) + return destination.clear(); + else + return destination.putString(aetitle); +} + +OFCondition DVPSStoredPrint::setPrinterName(const char *name) +{ + if ((name == NULL) || (strlen(name) == 0)) + return printerName.clear(); + else + return printerName.putString(name); +} + +OFCondition DVPSStoredPrint::setInstanceUID(const char *uid) +{ + if ((uid==NULL)||(strlen(uid)==0)) return EC_IllegalCall; + return sOPInstanceUID.putString(uid); +} + +OFCondition DVPSStoredPrint::setImageDisplayFormat(unsigned long columns, unsigned long rows) +{ + if ((columns==0)||(rows==0)) return EC_IllegalCall; + char newFormat[80]; + sprintf(newFormat, "STANDARD\\%lu,%lu", columns, rows); + + OFCondition result = imageDisplayFormat.putString(newFormat); + if (EC_Normal == result) + { + currentNumCols = columns; + currentNumRows = rows; + currentValuesValid = OFTrue; + } else invalidateCache(); + return result; +} + +OFCondition DVPSStoredPrint::setFilmSizeID(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + filmSizeID.clear(); + return EC_Normal; + } + return filmSizeID.putString(value); +} + +OFCondition DVPSStoredPrint::setMagnificationType(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + magnificationType.clear(); + return EC_Normal; + } + return magnificationType.putString(value); +} + +OFCondition DVPSStoredPrint::setSmoothingType(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + smoothingType.clear(); + return EC_Normal; + } + return smoothingType.putString(value); +} + +OFCondition DVPSStoredPrint::setConfigurationInformation(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + configurationInformation.clear(); + return EC_Normal; + } + return configurationInformation.putString(value); +} + +OFCondition DVPSStoredPrint::setResolutionID(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + requestedResolutionID.clear(); + return EC_Normal; + } + return requestedResolutionID.putString(value); +} + +OFCondition DVPSStoredPrint::setFilmOrientation(DVPSFilmOrientation value) +{ + switch (value) + { + case DVPSF_portrait: + return filmOrientation.putString("PORTRAIT"); + /* break; */ + case DVPSF_landscape: + return filmOrientation.putString("LANDSCAPE"); + /* break; */ + case DVPSF_default: + filmOrientation.clear(); + break; + } + return EC_Normal; +} + +OFCondition DVPSStoredPrint::setTrim(DVPSTrimMode value) +{ + switch (value) + { + case DVPSH_trim_on: + return trim.putString("YES"); + /* break; */ + case DVPSH_trim_off: + return trim.putString("NO"); + /* break; */ + case DVPSH_default: + trim.clear(); + break; + } + return EC_Normal; +} + +OFCondition DVPSStoredPrint::setRequestedDecimateCropBehaviour(DVPSDecimateCropBehaviour value) +{ + decimateCropBehaviour = value; + return EC_Normal; +} + + +OFCondition DVPSStoredPrint::newPrinter(const char *name, const char *destinationAE) +{ + filmSizeID.clear(); + magnificationType.clear(); + smoothingType.clear(); + configurationInformation.clear(); + requestedResolutionID.clear(); + trim.clear(); + borderDensity.clear(); + emptyImageDensity.clear(); + minDensity.clear(); + maxDensity.clear(); + + if (name != NULL) + setPrinterName(name); + if (destinationAE != NULL) + setDestination(destinationAE); + + OFCondition result = setRequestedDecimateCropBehaviour(DVPSI_default); + if (EC_Normal == result) result = imageBoxContentList.setAllImagesToDefault(); + return result; +} + +const char *DVPSStoredPrint::getOriginator() +{ + char *c = NULL; + if (EC_Normal == originator.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getDestination() +{ + char *c = NULL; + if (EC_Normal == destination.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getPrinterName() +{ + char *c = NULL; + if (EC_Normal == printerName.getString(c)) return c; else return NULL; +} + +unsigned long DVPSStoredPrint::getImageDisplayFormatColumns() +{ + updateCache(); + return currentNumCols; +} + +unsigned long DVPSStoredPrint::getImageDisplayFormatRows() +{ + updateCache(); + return currentNumRows; +} + +DVPSFilmOrientation DVPSStoredPrint::getFilmOrientation() +{ + DVPSFilmOrientation result = DVPSF_default; + char *c = NULL; + if ((EC_Normal == filmOrientation.getString(c))&& c) + { + OFString aString(c); + if (aString == "PORTRAIT") result = DVPSF_portrait; + else if (aString == "LANDSCAPE") result = DVPSF_landscape; + } + return result; +} + +DVPSTrimMode DVPSStoredPrint::getTrim() +{ + DVPSTrimMode result = DVPSH_default; + char *c = NULL; + if ((EC_Normal == trim.getString(c))&& c) + { + OFString aString(c); + if (aString == "YES") result = DVPSH_trim_on; + else if (aString == "NO") result = DVPSH_trim_off; + } + return result; +} + +const char *DVPSStoredPrint::getStudyInstanceUID() +{ + char *c = NULL; + if (EC_Normal == studyInstanceUID.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getSeriesInstanceUID() +{ + char *c = NULL; + if (EC_Normal == seriesInstanceUID.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getSOPInstanceUID() +{ + char *c = NULL; + if (EC_Normal == sOPInstanceUID.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getFilmSizeID() +{ + char *c = NULL; + if (EC_Normal == filmSizeID.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getMagnificationType() +{ + char *c = NULL; + if (EC_Normal == magnificationType.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getSmoothingType() +{ + char *c = NULL; + if (EC_Normal == smoothingType.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getConfigurationInformation() +{ + char *c = NULL; + if (EC_Normal == configurationInformation.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getResolutionID() +{ + char *c = NULL; + if (EC_Normal == requestedResolutionID.getString(c)) return c; else return NULL; +} + +OFCondition DVPSStoredPrint::setBorderDensity(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + borderDensity.clear(); + return EC_Normal; + } + return borderDensity.putString(value); +} + +OFCondition DVPSStoredPrint::setEmtpyImageDensity(const char *value) +{ + if ((value==NULL)||(strlen(value)==0)) + { + emptyImageDensity.clear(); + return EC_Normal; + } + return emptyImageDensity.putString(value); +} + +const char *DVPSStoredPrint::getBorderDensity() +{ + char *c = NULL; + if (EC_Normal == borderDensity.getString(c)) return c; else return NULL; +} + +const char *DVPSStoredPrint::getEmtpyImageDensity() +{ + char *c = NULL; + if (EC_Normal == emptyImageDensity.getString(c)) return c; else return NULL; +} + +OFCondition DVPSStoredPrint::setPrintIllumination(Uint16 value) +{ + return illumination.putUint16(value, 0); +} + +Uint16 DVPSStoredPrint::getPrintIllumination() +{ + Uint16 result = 0; + if (EC_Normal == illumination.getUint16(result, 0)) return result; else return 0; +} + +OFCondition DVPSStoredPrint::setPrintReflectedAmbientLight(Uint16 value) +{ + return reflectedAmbientLight.putUint16(value, 0); +} + +Uint16 DVPSStoredPrint::getPrintReflectedAmbientLight() +{ + Uint16 result = 0; + if (EC_Normal == reflectedAmbientLight.getUint16(result, 0)) return result; else return 0; +} + +OFCondition DVPSStoredPrint::deleteImage(size_t idx) +{ + OFCondition result = imageBoxContentList.deleteImage(idx); + char *c = NULL; + if (EC_Normal != configurationInformation.getString(c)) c = NULL; + presentationLUTList.cleanup(c, imageBoxContentList); + return result; +} + +OFCondition DVPSStoredPrint::deleteMultipleImages(size_t number) +{ + OFCondition result = imageBoxContentList.deleteMultipleImages(number); + char *c = NULL; + if (EC_Normal != configurationInformation.getString(c)) c = NULL; + presentationLUTList.cleanup(c, imageBoxContentList); + return result; +} + +OFCondition DVPSStoredPrint::deleteSpooledImages() +{ + OFCondition result = EC_IllegalCall; + char *c = NULL; + size_t deleteImageBoxes=0; + + updateCache(); + if (currentValuesValid) + { + deleteImageBoxes = currentNumCols * currentNumRows; + if (deleteImageBoxes > imageBoxContentList.size()) deleteImageBoxes = imageBoxContentList.size(); + result = imageBoxContentList.deleteMultipleImages(deleteImageBoxes); + } + if (EC_Normal != configurationInformation.getString(c)) c = NULL; + presentationLUTList.cleanup(c, imageBoxContentList); + return result; +} + +OFCondition DVPSStoredPrint::printSCUgetPrinterInstance(DVPSPrintMessageHandler& printHandler) +{ + DcmDataset *attributeListOut=NULL; + Uint16 status=0; + OFCondition cond=printHandler.getRQ(UID_PrinterSOPClass, UID_PrinterSOPInstance, NULL, 0, status, attributeListOut); + + /* the N-GET response has been dumped somewhere else, we only need to delete it */ + delete attributeListOut; + + if (cond.bad()) return EC_IllegalCall; + return EC_Normal; +} + +OFCondition DVPSStoredPrint::printSCUpreparePresentationLUT( + DVPSPrintMessageHandler& printHandler, + OFBool printerRequiresMatchingLUT, + OFBool printerLUTRenderingPreferred, + OFBool printerSupports12Bit) +{ + /* first of all we determine whether we can let the print SCP render Presentation LUT for us. */ + renderPresentationLUTinSCP = OFFalse; // set to true if we can create a presentation LUT for all images + transmitImagesIn12Bit = OFTrue; // set to false later if images should be transmitted in 8-bit depth + + OFBool printerSupportsPresentationLUT = printHandler.printerSupportsPresentationLUT(); + DVPSPresentationLUT *plut = NULL; + if (printerSupportsPresentationLUT) + { + char *filmBox = NULL; + if (EC_Normal != referencedPresentationLUTInstanceUID.getString(filmBox)) filmBox=NULL; + const char *plutuid = imageBoxContentList.haveSinglePresentationLUTUsed(filmBox); + if (plutuid) plut = presentationLUTList.findPresentationLUT(plutuid); + if (plut && (plut->isLegalPrintPresentationLUT())) + { + /* there is a single Presentation LUT that can be used for the complete film, + * and it is a valid Supplement 22 Presentation LUT. + */ + if (printerSupports12Bit) + { + /* 12-bit printer, we use the LUT if the printer can handle it and if the user wants it */ + if (printerLUTRenderingPreferred) + { + if (printerRequiresMatchingLUT) + { + if (plut->matchesImageDepth(OFTrue)) renderPresentationLUTinSCP = OFTrue; + else + { + if (plut->matchesImageDepth(OFFalse)) + { + renderPresentationLUTinSCP = OFTrue; + transmitImagesIn12Bit = OFFalse; + } + } + } else renderPresentationLUTinSCP = OFTrue; + } + } else { + /* 8-bit printer, we use the LUT if the printer can handle it */ + transmitImagesIn12Bit = OFFalse; + if (printerRequiresMatchingLUT) + { + if (plut->matchesImageDepth(OFFalse)) renderPresentationLUTinSCP = OFTrue; + } else renderPresentationLUTinSCP = OFTrue; + } + } else transmitImagesIn12Bit = printerSupports12Bit; + } else { + transmitImagesIn12Bit = printerSupports12Bit; + DCMPSTAT_WARN("spooler: printer does not support Presentation LUT SOP Class," + << " presentation LUT related print job settings will be ignored."); + } + + OFCondition result = EC_Normal; + if (printerSupportsPresentationLUT) + { + DcmDataset dset; + DcmDataset *attributeListOut=NULL; + Uint16 status=0; + if (renderPresentationLUTinSCP) + { + result = plut->write(dset, OFFalse); + } else { + DVPSPresentationLUT identity; + result = identity.write(dset, OFFalse); + } + + if (result==EC_Normal) + { + OFCondition cond = printHandler.createRQ(UID_PresentationLUTSOPClass, presentationLUTInstanceUID, &dset, status, attributeListOut); + if (cond.good() && DIMSE_STATUS_OK(status)) + { + /* nothing */ + } else { + presentationLUTInstanceUID.clear(); + result = EC_IllegalCall; + } + delete attributeListOut; + } + } + + return result; +} + +OFCondition DVPSStoredPrint::addReferencedPLUTSQ(DcmItem &dset) +{ + if (referencedPresentationLUTInstanceUID.getLength() == 0) return EC_Normal; + + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(DCM_ReferencedPresentationLUTSequence); + DcmItem *ditem = new DcmItem(); + + if (ditem && dseq) + { + ADD_TO_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID) + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + delete dseq; + delete ditem; + } + } else { + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + return result; +} + +OFCondition DVPSStoredPrint::addPresentationLUTReference(DcmItem& dset) +{ + DcmElement *delem=NULL; + OFCondition result = EC_Normal; + + ADD_TO_DATASET(DcmUnsignedShort, illumination) + ADD_TO_DATASET(DcmUnsignedShort, reflectedAmbientLight) + + if (presentationLUTInstanceUID.size() > 0) + { + + DcmUniqueIdentifier refsopclassuid(DCM_ReferencedSOPClassUID); + DcmUniqueIdentifier refsopinstanceuid(DCM_ReferencedSOPInstanceUID); + if (result==EC_Normal) result = refsopclassuid.putString(UID_PresentationLUTSOPClass); + if (result==EC_Normal) result = refsopinstanceuid.putString(presentationLUTInstanceUID.c_str()); + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(DCM_ReferencedPresentationLUTSequence); + DcmItem *ditem = new DcmItem(); + if ((result == EC_Normal) && ditem && dseq) + { + ADD_TO_DATASET2(DcmUniqueIdentifier, refsopclassuid) + ADD_TO_DATASET2(DcmUniqueIdentifier, refsopinstanceuid) + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + delete dseq; + delete ditem; + } + } else { + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } + return result; +} + +OFCondition DVPSStoredPrint::printSCUcreateBasicFilmSession( + DVPSPrintMessageHandler& printHandler, + DcmDataset& dset, + OFBool plutInSession) +{ + if (filmSessionInstanceUID.size() > 0) return EC_IllegalCall; + + DcmDataset *attributeListOut=NULL; + Uint16 status=0; + OFCondition result = EC_Normal; + + // we expect 'number of copies', 'print priority', 'medium type' and 'film destination' in dset + // add illumination and reflection, and presentation LUT reference if necessary. + if ((printHandler.printerSupportsPresentationLUT()) && plutInSession) result = addPresentationLUTReference(dset); + + if (result==EC_Normal) + { + OFCondition cond = printHandler.createRQ(UID_BasicFilmSessionSOPClass, filmSessionInstanceUID, &dset, status, attributeListOut); + if (cond.bad() || DIMSE_STATUS_BAD(status)) + { + result = EC_IllegalCall; + filmSessionInstanceUID.clear(); + } + delete attributeListOut; + } + return result; +} + +OFCondition DVPSStoredPrint::printSCUcreateBasicFilmBox(DVPSPrintMessageHandler& printHandler, OFBool plutInSession) +{ + if ((filmSessionInstanceUID.size() == 0)||(filmBoxInstanceUID.size() > 0)) return EC_IllegalCall; + + OFCondition result = EC_Normal; + DcmDataset dset; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq=NULL; + DcmSequenceOfItems *seq=NULL; + DcmItem *ditem=NULL; + DcmItem *item=NULL; + DcmDataset *attributeListOut=NULL; + char *c = NULL; + Uint16 status=0; + DcmStack stack; + OFString grayscaleIB(UID_BasicGrayscaleImageBoxSOPClass); + OFString annotationB(UID_BasicAnnotationBoxSOPClass); + + ADD_TO_DATASET(DcmShortText, imageDisplayFormat) + if (filmOrientation.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, filmOrientation) } + if (filmSizeID.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, filmSizeID) } + if (magnificationType.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, magnificationType) } + if (maxDensity.getLength() > 0) { ADD_TO_DATASET(DcmUnsignedShort, maxDensity) } + if (configurationInformation.getLength() > 0) { ADD_TO_DATASET(DcmShortText, configurationInformation) } + if (smoothingType.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, smoothingType) } + if (borderDensity.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, borderDensity) } + if (emptyImageDensity.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, emptyImageDensity) } + if (minDensity.getLength() > 0) { ADD_TO_DATASET(DcmUnsignedShort, minDensity) } + if (trim.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, trim) } + if (requestedResolutionID.getLength() > 0) { ADD_TO_DATASET(DcmCodeString, requestedResolutionID) } + if ((printHandler.printerSupportsAnnotationBox())&&(annotationDisplayFormatID.getLength() > 0)) + { + ADD_TO_DATASET(DcmCodeString, annotationDisplayFormatID) + } + + // add Referenced Film Session SQ + DcmUniqueIdentifier refsopclassuid(DCM_ReferencedSOPClassUID); + DcmUniqueIdentifier refsopinstanceuid(DCM_ReferencedSOPInstanceUID); + if (result==EC_Normal) result = refsopclassuid.putString(UID_BasicFilmSessionSOPClass); + if (result==EC_Normal) result = refsopinstanceuid.putString(filmSessionInstanceUID.c_str()); + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + dseq = new DcmSequenceOfItems(DCM_ReferencedFilmSessionSequence); + if (dseq) + { + ADD_TO_DATASET2(DcmUniqueIdentifier, refsopclassuid) + ADD_TO_DATASET2(DcmUniqueIdentifier, refsopinstanceuid) + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + // out of memory during creation of sequence contents. + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } else { + // could allocate item but not sequence. Bail out. + delete ditem; + result = EC_MemoryExhausted; + } + } + else result = EC_MemoryExhausted; + } + + // add illumination and reflection, and presentation LUT reference if necessary. + if ((result==EC_Normal) && (printHandler.printerSupportsPresentationLUT()) && (!plutInSession)) result = addPresentationLUTReference(dset); + + if (result==EC_Normal) + { + size_t numItems = 0; + size_t i; + OFCondition cond = printHandler.createRQ(UID_BasicFilmBoxSOPClass, filmBoxInstanceUID, &dset, status, attributeListOut); + if (cond.good() && DIMSE_STATUS_OK(status) && attributeListOut) + { + // N-CREATE was successful, now evaluate Referenced Image Box SQ + stack.clear(); + if (EC_Normal == attributeListOut->search(DCM_ReferencedImageBoxSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + numItems = (size_t)seq->card(); + if (numItems > imageBoxContentList.size()) numItems = imageBoxContentList.size(); + for (i=0; igetItem(OFstatic_cast(Uint32, i)); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopclassuid) + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopinstanceuid) + if (EC_Normal==result) result = refsopclassuid.getString(c); + if ((EC_Normal==result) && c && (grayscaleIB == c)) + { + result = refsopinstanceuid.getString(c); + if (EC_Normal==result) result = imageBoxContentList.setImageSOPInstanceUID(i, c); + } else result = EC_IllegalCall; /* wrong SOP class or unable to read UID */ + } + } else result=EC_TagNotFound; + + // evaluate Referenced Basic Annotation Box SQ if present + stack.clear(); + annotationContentList.clearAnnotationSOPInstanceUIDs(); + if (EC_Normal == attributeListOut->search(DCM_ReferencedBasicAnnotationBoxSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + numItems = (size_t)seq->card(); + if (numItems > annotationContentList.size()) numItems = annotationContentList.size(); + for (i=0; igetItem(OFstatic_cast(Uint32, i)); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopclassuid) + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopinstanceuid) + if (EC_Normal==result) result = refsopclassuid.getString(c); + if ((EC_Normal==result) && c && (annotationB == c)) + { + result = refsopinstanceuid.getString(c); + if (EC_Normal==result) result = annotationContentList.setAnnotationSOPInstanceUID(i, c); + } else result = EC_IllegalCall; /* wrong SOP class or unable to read UID */ + } + } + } else { + filmBoxInstanceUID.clear(); + result = EC_IllegalCall; + } + delete attributeListOut; + } + return result; +} + + +OFCondition DVPSStoredPrint::printSCUprintBasicFilmBox(DVPSPrintMessageHandler& printHandler) +{ + if (filmBoxInstanceUID.size() == 0) return EC_IllegalCall; + DcmDataset *attributeListOut=NULL; + Uint16 status=0; + + OFCondition cond = printHandler.actionRQ(UID_BasicFilmBoxSOPClass, filmBoxInstanceUID.c_str(), + 1 /* action type ID 1 = print */, NULL /* no action information */, status, attributeListOut); + delete attributeListOut; // should be empty anyway + + if (cond.good() && DIMSE_STATUS_OK(status)) return EC_Normal; + return EC_IllegalCall; // otherwise +} + +OFCondition DVPSStoredPrint::printSCUprintBasicFilmSession(DVPSPrintMessageHandler& printHandler) +{ + DcmDataset *attributeListOut=NULL; + Uint16 status=0; + + OFCondition cond = printHandler.actionRQ(UID_BasicFilmSessionSOPClass, filmSessionInstanceUID.c_str(), + 1 /* action type ID 1 = print */, NULL /* no action information */, status, attributeListOut); + delete attributeListOut; // should be empty anyway + + if (cond.good() && DIMSE_STATUS_OK(status)) return EC_Normal; + return EC_IllegalCall; // otherwise +} + +OFCondition DVPSStoredPrint::printSCUdelete(DVPSPrintMessageHandler& printHandler) +{ + OFCondition cond = EC_Normal; + Uint16 status=0; + OFCondition result = EC_Normal; + + // delete basic film box + if (filmBoxInstanceUID.size() > 0) + { + cond = printHandler.deleteRQ(UID_BasicFilmBoxSOPClass, filmBoxInstanceUID.c_str(), status); + if (cond.bad() || DIMSE_STATUS_BAD(status)) result = EC_IllegalCall; + filmBoxInstanceUID.clear(); + } + + // delete basic film session + if (filmSessionInstanceUID.size() > 0) + { + cond = printHandler.deleteRQ(UID_BasicFilmSessionSOPClass, filmSessionInstanceUID.c_str(), status); + if (cond.bad() || DIMSE_STATUS_BAD(status)) result = EC_IllegalCall; + filmSessionInstanceUID.clear(); + } + + // delete presentation LUT + if ((presentationLUTInstanceUID.size() > 0)&&(printHandler.printerSupportsPresentationLUT())) + { + cond = printHandler.deleteRQ(UID_PresentationLUTSOPClass, presentationLUTInstanceUID.c_str(), status); + if (cond.bad() || DIMSE_STATUS_BAD(status)) result = EC_IllegalCall; + presentationLUTInstanceUID.clear(); + } + return result; +} + +OFCondition DVPSStoredPrint::printSCUsetBasicImageBox( + DVPSPrintMessageHandler& printHandler, + size_t idx, + DicomImage& image, + OFBool useMonochrome1) +{ + DcmDataset dataset; + DcmItem *ditem = NULL; + DcmSequenceOfItems *dseq = NULL; + char str[100]; + DcmPolymorphOBOW *pxData = NULL; + const void *pxDataVoid; + unsigned long width = image.getWidth(); + unsigned long height = image.getHeight(); + DcmDataset *attributeListOut=NULL; + Uint16 status=0; + + const char *imageSopInstanceUID = imageBoxContentList.getSOPInstanceUID(idx); + if (imageSopInstanceUID==NULL) return EC_IllegalCall; + + /* any presentation LUT to render on SCU side? */ + if (! renderPresentationLUTinSCP) + { + /* look for referenced Presentation LUT in image box */ + const char *imageplutuid = imageBoxContentList.getReferencedPresentationLUTInstanceUID(idx); + char *filmplutuid = NULL; + if (EC_Normal != referencedPresentationLUTInstanceUID.getString(filmplutuid)) filmplutuid=NULL; + /* if absent, look for referenced Presentation LUT in film box */ + if ((imageplutuid == NULL)||(strlen(imageplutuid)==0)) imageplutuid = filmplutuid; + DVPSPresentationLUT *pLUT = NULL; + if (imageplutuid && (strlen(imageplutuid)>0)) pLUT = presentationLUTList.findPresentationLUT(imageplutuid); + if (pLUT) + { + /* found presentation LUT, activate */ + if (pLUT->activate(&image)) + { + if ((pLUT->getType() == DVPSP_table)&&(! transmitImagesIn12Bit)) + { + DCMPSTAT_WARN("rendering Presentation LUT into 8-bit bitmap, image quality loss possible."); + } + } else { + DCMPSTAT_WARN("unable to activate Presentation LUT, using IDENTITY instead."); + image.setPresentationLutShape(ESP_Identity); + } + } /* else image.setPresentationLutShape(ESP_Identity); -- this does not make sense for MONO1 HG images */ + } /* else image.setPresentationLutShape(ESP_Identity); -- this does not make sense for MONO1 HG images */ + + OFCondition result = imageBoxContentList.prepareBasicImageBox(idx, dataset); + if (EC_Normal == result) + { + ditem = new DcmItem(); + if (ditem) + { + dseq = new DcmSequenceOfItems(DCM_BasicGrayscaleImageSequence); + if (dseq) + { + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_SamplesPerPixel, 1); + if (useMonochrome1) + { + image.setPolarity(EPP_Reverse); + if (EC_Normal==result) result = DVPSHelper::putStringValue(ditem, DCM_PhotometricInterpretation, "MONOCHROME1"); + } else { + if (EC_Normal==result) result = DVPSHelper::putStringValue(ditem, DCM_PhotometricInterpretation, "MONOCHROME2"); + } + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_PixelRepresentation, 0); + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_Rows, (Uint16)height); + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_Columns, (Uint16)width); + double aspectRatio = image.getWidthHeightRatio(); + if ((aspectRatio != 1.0)&&(aspectRatio != 0)) + { + sprintf(str, "10000\\%ld", (long)(aspectRatio*10000.0)); + if (EC_Normal==result) result = DVPSHelper::putStringValue(ditem, DCM_PixelAspectRatio, str); + } + if (transmitImagesIn12Bit) + { + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_BitsAllocated, 16); + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_BitsStored, 12); + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_HighBit, 11); + if (EC_Normal==result) + { + pxDataVoid = image.getOutputData(12); + pxData = new DcmPolymorphOBOW(DCM_PixelData); + if (pxData && pxDataVoid) + { + result = pxData->putUint16Array((Uint16 *)pxDataVoid, (width*height)); + if (EC_Normal==result) result = ditem->insert(pxData, OFTrue /*replaceOld*/); else delete pxData; + } else result = EC_IllegalCall; + } + } else { + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_BitsAllocated, 8); + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_BitsStored, 8); + if (EC_Normal==result) result = DVPSHelper::putUint16Value(ditem, DCM_HighBit, 7); + if (EC_Normal==result) + { + pxDataVoid = image.getOutputData(8); + pxData = new DcmPolymorphOBOW(DCM_PixelData); + if (pxData && pxDataVoid) + { + result = pxData->putUint8Array((Uint8 *)pxDataVoid, (width*height)); + if (EC_Normal==result) result = ditem->insert(pxData, OFTrue /*replaceOld*/); else delete pxData; + } else result = EC_IllegalCall; + } + } + + if (result==EC_Normal) + { + dseq->insert(ditem); + dataset.insert(dseq, OFTrue /*replaceOld*/); + } else { + // out of memory during creation of sequence contents. + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } else { + // could allocate item but not sequence. Bail out. + delete ditem; + result = EC_MemoryExhausted; + } + } else result = EC_MemoryExhausted; + } + + if (EC_Normal == result) + { + OFCondition cond = printHandler.setRQ(UID_BasicGrayscaleImageBoxSOPClass, imageSopInstanceUID, &dataset, status, attributeListOut); + if (cond.bad() || DIMSE_STATUS_BAD(status)) result = EC_IllegalCall; + } + delete attributeListOut; + return result; +} + +OFCondition DVPSStoredPrint::printSCUsetBasicAnnotationBox( + DVPSPrintMessageHandler& printHandler, + size_t idx) +{ + DcmDataset dataset; + DcmDataset *attributeListOut=NULL; + Uint16 status=0; + OFCondition result = EC_Normal; + + if (printHandler.printerSupportsAnnotationBox()) + { + const char *annotationSopInstanceUID = annotationContentList.getSOPInstanceUID(idx); + if ((annotationSopInstanceUID==NULL)||(strlen(annotationSopInstanceUID)==0)) + { + DCMPSTAT_WARN("not enough Annotation Boxes created by printer, ignoring annotation."); + return EC_Normal; + } + + result = annotationContentList.prepareBasicAnnotationBox(idx, dataset); + + if (EC_Normal == result) + { + OFCondition cond = printHandler.setRQ(UID_BasicAnnotationBoxSOPClass, annotationSopInstanceUID, &dataset, status, attributeListOut); + if (cond.bad() || DIMSE_STATUS_BAD(status)) result = EC_IllegalCall; + } + delete attributeListOut; + } else { + DCMPSTAT_WARN("printer does not support Annotation Box, ignoring annotation."); + } + + return result; +} + +const char *DVPSStoredPrint::getMaxDensity() +{ + if (maxDensity.getLength() > 0) + { + Uint16 density=0; + if (EC_Normal == maxDensity.getUint16(density,0)) + { + char buf[20]; + sprintf(buf, "%hu", density); + tempDensity = buf; + return tempDensity.c_str(); + } + } + return NULL; +} + +const char *DVPSStoredPrint::getMinDensity() +{ + if (minDensity.getLength() > 0) + { + Uint16 density=0; + if (EC_Normal == minDensity.getUint16(density,0)) + { + char buf[20]; + sprintf(buf, "%hu", density); + tempDensity = buf; + return tempDensity.c_str(); + } + } + return NULL; +} + +Uint16 DVPSStoredPrint::getMaxDensityValue() +{ + if (maxDensity.getLength() > 0) + { + Uint16 density = 0; + if (EC_Normal == maxDensity.getUint16(density, 0)) + return density; + } + return 300; +} + +Uint16 DVPSStoredPrint::getMinDensityValue() +{ + if (minDensity.getLength() > 0) + { + Uint16 density = 0; + if (EC_Normal == minDensity.getUint16(density, 0)) + return density; + } + return 20; +} + +OFCondition DVPSStoredPrint::setMaxDensity(const char *value) +{ + OFCondition result = EC_Normal; + if (value && (strlen(value)>0)) + { + Uint16 density = 0; + if (1 == (sscanf(value, "%hu", &density))) + { + result = maxDensity.putUint16(density, 0); + } else result = EC_IllegalCall; + } else maxDensity.clear(); + return result; +} + +OFCondition DVPSStoredPrint::setMinDensity(const char *value) +{ + OFCondition result = EC_Normal; + if (value && (strlen(value)>0)) + { + Uint16 density = 0; + if (1 == (sscanf(value, "%hu", &density))) + { + result = minDensity.putUint16(density, 0); + } else result = EC_IllegalCall; + } else minDensity.clear(); + return result; +} + +OFCondition DVPSStoredPrint::setSingleAnnotation( + const char *displayformat, + const char *text, + Uint16 position) +{ + OFCondition result = EC_IllegalCall; + if (displayformat && text) + { + char newuid[70]; + dcmGenerateUniqueIdentifier(newuid); + deleteAnnotations(); + result = annotationContentList.addAnnotationBox(newuid, text, position); + if (EC_Normal==result) result = annotationDisplayFormatID.putString(displayformat); + } + return result; +} + +void DVPSStoredPrint::deleteAnnotations() +{ + annotationContentList.clear(); + annotationDisplayFormatID.clear(); + return; +} + + + +OFBool DVPSStoredPrint::printSCPCreate( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList, + const char *filmSessionUID, + DcmUniqueIdentifier& study, + DcmUniqueIdentifier& psSeries, + DcmUniqueIdentifier& imgSeries) +{ + studyInstanceUID = study; + seriesInstanceUID = psSeries; + imageSeriesInstanceUID = imgSeries; + + OFBool result = OFTrue; + DcmStack stack; + filmBoxInstanceUID = rsp.msg.NCreateRSP.AffectedSOPInstanceUID; + + // filmOrientation + if (result) + { + READ_FROM_PDATASET(DcmCodeString, EVR_CS, filmOrientation) + if (filmOrientation.getLength() == 0) filmOrientation.putString(DEFAULT_filmOrientation); + else + { + OFString aString; + filmOrientation.getOFString(aString, 0, OFTrue); + if ((aString != "PORTRAIT")&&(aString != "LANDSCAPE")) + { + DCMPSTAT_WARN("cannot create Basic Film Box: illegal film orientation: '" << aString.c_str() << "'"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } + + // imageDisplayFormat + if (result) + { + READ_FROM_PDATASET(DcmShortText, EVR_ST, imageDisplayFormat) + if (imageDisplayFormat.getLength() == 0) + { + DCMPSTAT_WARN("cannot create Basic Film Box: image display format missing or empty"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } else { + currentValuesValid = OFFalse; + updateCache(); // evaluates image display format and computes number of columns and rows + if (currentValuesValid) + { + // now we check whether this is a supported layout as per the config file + Uint32 numPortraitDisplayFormats = cfg.getTargetPrinterNumberOfPortraitDisplayFormats(cfgname); + if (numPortraitDisplayFormats > 0) + { + OFBool found = OFFalse; + DVPSFilmOrientation orientation = getFilmOrientation(); + Uint32 col=0; + Uint32 row=0; + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterFilmSizeID(cfgname, 0, aString); + filmSizeID.putString(aString.c_str()); + } else { + filmSizeID.putString(DEFAULT_filmSizeID); + } + } else { + // check whether we can accept the proposed medium type + OFString theSizeID; + OFString aString; + OFBool found = OFFalse; + filmSizeID.getOFString(theSizeID, 0, OFTrue); + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterMagnificationType(cfgname, 0, aString); + magnificationType.putString(aString.c_str()); + } else { + magnificationType.putString(DEFAULT_magnificationType); + } + } else { + // check whether we can accept the proposed medium type + OFString theMagnification; + OFString aString; + OFBool found = OFFalse; + magnificationType.getOFString(theMagnification, 0, OFTrue); + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterSmoothingType(cfgname, 0, aString); + smoothingType.putString(aString.c_str()); + } + } else { + // check whether we can accept the proposed smoothing type + OFString theSmoothing; + OFString aString; + OFBool found = OFFalse; + smoothingType.getOFString(theSmoothing, 0, OFTrue); + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterBorderDensity(cfgname, 0, aString); + borderDensity.putString(aString.c_str()); + } + } else { + // check whether we can accept the proposed border density + if (numBorderDensities == 0) // we don't support border density + { + DCMPSTAT_WARN("cannot create Basic Film Box: border density requested but not supported."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theBorderDensity; + OFString aString; + OFBool found = OFFalse; + OFBool supportsNumericDensity = OFFalse; + unsigned long l; + borderDensity.getOFString(theBorderDensity, 0, OFTrue); + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterEmptyImageDensity(cfgname, 0, aString); + emptyImageDensity.putString(aString.c_str()); + } + } else { + // check whether we can accept the proposed empty image density + if (numEmptyImageDensities == 0) // we don't support empty image density + { + DCMPSTAT_WARN("cannot create Basic Film Box: empty image density requested but not supported."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theEIDensity; + OFString aString; + OFBool found = OFFalse; + OFBool supportsNumericDensity = OFFalse; + unsigned long l; + emptyImageDensity.getOFString(theEIDensity, 0, OFTrue); + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterMaxDensity(cfgname, 0, aString); + if (EC_Normal != setMaxDensity(aString.c_str())) maxDensity.putUint16(DEFAULT_maxDensity, 0); + } + } // we don't check a max density set by the user (for now) + } + + // minDensity + if (result) + { + Uint32 numMinDensities = cfg.getTargetPrinterNumberOfMinDensities(cfgname); + READ_FROM_PDATASET(DcmUnsignedShort, EVR_US, minDensity) + if (minDensity.getLength() == 0) + { + if (numMinDensities > 0) + { + OFString aString; + cfg.getTargetPrinterMinDensity(cfgname, 0, aString); + if (EC_Normal != setMinDensity(aString.c_str())) minDensity.putUint16(DEFAULT_minDensity, 0); + } + } else { + if (numMinDensities == 0) // we don't support min density + { + DCMPSTAT_WARN("cannot create Basic Film Box: min density requested but not supported."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + // we don't check a min density set by the user (for now) + } + } + + // trim + if (result) + { + READ_FROM_PDATASET(DcmCodeString, EVR_CS, trim) + if (trim.getLength() == 0) + { + if (cfg.getTargetPrinterSupportsTrim(cfgname)) trim.putString(DEFAULT_trim); + } + else + { + if (cfg.getTargetPrinterSupportsTrim(cfgname)) + { + OFString aString; + trim.getOFString(aString, 0, OFTrue); + if ((aString != "YES")&&(aString != "NO")) + { + DCMPSTAT_WARN("cannot create Basic Film Box: illegal trim: '" << aString.c_str() << "'"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: trim requested but not supported."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // configurationInformation + if (result) + { + READ_FROM_PDATASET(DcmShortText, EVR_ST, configurationInformation) + if (configurationInformation.getLength() > 0) + { + // check whether we can accept the proposed configuration information + Uint32 numConfigurationInformation = cfg.getTargetPrinterNumberOfConfigurationSettings(cfgname); + if (numConfigurationInformation == 0) // we don't support configuration information + { + DCMPSTAT_WARN("cannot create Basic Film Box: configuration information requested but not supported."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theConfiguration; + OFBool found = OFFalse; + configurationInformation.getOFString(theConfiguration, 0, OFTrue); + for (Uint32 i=0; i 0) + { + OFString aString; + cfg.getTargetPrinterResolutionID(cfgname, 0, aString); + requestedResolutionID.putString(aString.c_str()); + } + } else { + // check whether we can accept the requested resolution ID + if (numResolutionIDs == 0) // we don't support requested resolution ID + { + DCMPSTAT_WARN("cannot create Basic Film Box: requested resolution ID present but not supported."); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theResolutionID; + OFString aString; + OFBool found = OFFalse; + requestedResolutionID.getOFString(theResolutionID, 0, OFTrue); + for (Uint32 i=0; isearch(DCM_ReferencedPresentationLUTSequence, stack, ESM_fromHere, OFFalse))) + { + DcmSequenceOfItems *seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + OFString aString; + DcmItem *item = seq->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID) + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + referencedPresentationLUTInstanceUID.getOFString(aString,0); + DVPSPresentationLUT *currentPLUT = globalPresentationLUTList.findPresentationLUT(aString.c_str()); + if (NULL == currentPLUT) + { + DCMPSTAT_WARN("cannot create Basic Film Box: presentation LUT reference cannot be resolved"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // check referenced SOP class UID + DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID) + if (refClassUID.getLength() > 0) + { + aString.clear(); + refClassUID.getOFString(aString,0, OFTrue); + if (aString != UID_PresentationLUTSOPClass) + { + DCMPSTAT_WARN("cannot create Basic Film Box: referenced SOP class UID in referenced presentation LUT sequence incorrect:" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // referenced presentation LUT sequence is OK + // synchronize presentationLUTInstanceUID and referencedPresentationLUTInstanceUID + presentationLUTInstanceUID.clear(); + referencedPresentationLUTInstanceUID.getOFString(presentationLUTInstanceUID,0); + referencedPresentationLUTAlignment = currentPLUT->getAlignment(); + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: no referenced SOP class UID in referenced presentation LUT sequence"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: no referenced SOP instance UID in referenced presentation LUT sequence"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: referenced presentation LUT sequence number of items != 1"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } + + } /* if presentationLUTnegotiated */ + + DcmSequenceOfItems *refFilmSessionSequence = NULL; + + // referenced film session sequence + if (result) + { + stack.clear(); + + if (rqDataset && (EC_Normal == rqDataset->search(DCM_ReferencedFilmSessionSequence, stack, ESM_fromHere, OFFalse))) + { + DcmUniqueIdentifier classUID(DCM_ReferencedSOPClassUID); + DcmUniqueIdentifier instanceUID(DCM_ReferencedSOPInstanceUID); + refFilmSessionSequence =(DcmSequenceOfItems *)stack.top(); + if (refFilmSessionSequence->card() ==1) + { + OFString aString; + DcmItem *item = refFilmSessionSequence->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, instanceUID) + if (instanceUID.getLength() > 0) + { + instanceUID.getOFString(aString,0); + if (aString != filmSessionUID) + { + DCMPSTAT_WARN("cannot create Basic Film Box: referenced film session instance UID incorrect"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // check referenced SOP class UID + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, classUID) + if (classUID.getLength() > 0) + { + aString.clear(); + classUID.getOFString(aString,0, OFTrue); + if (aString != UID_BasicFilmSessionSOPClass) + { + DCMPSTAT_WARN("cannot create Basic Film Box: referenced SOP class UID in referenced film session sequence incorrect:" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: no referenced SOP class UID in referenced film session sequence"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: no referenced SOP instance UID in referenced film session sequence"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: referenced film session sequence number of items != 1"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot create Basic Film Box: referenced film session sequence absent"); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_MissingAttribute; + result = OFFalse; + } + } + + // browse through rqDataset and check for unsupported attributes + if (result && rqDataset) + { + OFBool intoSub = OFTrue; + stack.clear(); + while (EC_Normal == rqDataset->nextObject(stack, intoSub)) + { + intoSub = OFFalse; + const DcmTagKey& currentTag = (stack.top())->getTag(); + if (currentTag.getElement() == 0x0000) /* group length */ ; + else if (currentTag == DCM_ImageDisplayFormat) /* OK */ ; + else if (currentTag == DCM_FilmOrientation) /* OK */ ; + else if (currentTag == DCM_FilmSizeID) /* OK */ ; + else if (currentTag == DCM_MagnificationType) /* OK */ ; + else if (currentTag == DCM_SmoothingType) /* OK */ ; + else if (currentTag == DCM_BorderDensity) /* OK */ ; + else if (currentTag == DCM_EmptyImageDensity) /* OK */ ; + else if (currentTag == DCM_MinDensity) /* OK */ ; + else if (currentTag == DCM_MaxDensity) /* OK */ ; + else if (currentTag == DCM_Trim) /* OK */ ; + else if (currentTag == DCM_ConfigurationInformation) /* OK */ ; + else if (currentTag == DCM_RequestedResolutionID) /* OK */ ; + else if (currentTag == DCM_ReferencedFilmSessionSequence) /* OK */ ; + else if (currentTag == DCM_Illumination) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot create Basic Film Box: illumination received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReflectedAmbientLight) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot create Basic Film Box: reflected ambient light received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReferencedPresentationLUTSequence) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot create Basic Film Box: referenced presentation LUT sequence received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else + { + DCMPSTAT_WARN("cannot create Basic Film Box: unsupported attribute received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // if n-create was successful, create response dataset + if (result) + { + rspDataset = new DcmDataset; + if (rspDataset) + { + OFCondition writeresult = EC_Normal; + DcmElement *delem = NULL; + + if (refFilmSessionSequence) // should never be NULL if we get this far + { + DcmSequenceOfItems *newRefFilmSessionSequence = new DcmSequenceOfItems(*refFilmSessionSequence); + if (newRefFilmSessionSequence) rspDataset->insert(newRefFilmSessionSequence, OFTrue /*replaceOld*/); + else writeresult = EC_MemoryExhausted; + } + + ADD_TO_PDATASET(DcmShortText, imageDisplayFormat) + ADD_TO_PDATASET(DcmCodeString, filmOrientation) + ADD_TO_PDATASET(DcmCodeString, filmSizeID) + ADD_TO_PDATASET(DcmCodeString, magnificationType) + ADD_TO_PDATASET(DcmUnsignedShort, maxDensity) + ADD_TO_PDATASET(DcmShortText, configurationInformation) + if (smoothingType.getLength() > 0) { ADD_TO_PDATASET(DcmCodeString, smoothingType) } + if (borderDensity.getLength() > 0) { ADD_TO_PDATASET(DcmCodeString, borderDensity) } + if (emptyImageDensity.getLength() > 0) { ADD_TO_PDATASET(DcmCodeString, emptyImageDensity) } + if (minDensity.getLength() > 0) { ADD_TO_PDATASET(DcmUnsignedShort, minDensity) } + if (trim.getLength() > 0) { ADD_TO_PDATASET(DcmCodeString, trim) } + if (requestedResolutionID.getLength() > 0) { ADD_TO_PDATASET(DcmCodeString, requestedResolutionID) } + + if (presentationLUTnegotiated) + { + if (referencedPresentationLUTInstanceUID.getLength() == 0) + { + referencedPresentationLUTInstanceUID.putString(WELLKNOWN_IDENTITY_PLUT_UID); + if (NULL == globalPresentationLUTList.findPresentationLUT(WELLKNOWN_IDENTITY_PLUT_UID)) + { + DVPSPresentationLUT *wellknownlut = new DVPSPresentationLUT(); + if (wellknownlut) + { + writeresult = wellknownlut->setType(DVPSP_identity); + if (EC_Normal == writeresult) writeresult = wellknownlut->setSOPInstanceUID(WELLKNOWN_IDENTITY_PLUT_UID); + if (EC_Normal == writeresult) globalPresentationLUTList.insert(wellknownlut); + } else writeresult = EC_MemoryExhausted; + } + } + if (EC_Normal == writeresult) writeresult = addPresentationLUTReference(*rspDataset); + } + + // create image boxes and referenced image box sequence + if (imageBoxContentList.printSCPCreate(currentNumRows * currentNumCols, studyInstanceUID, imageSeriesInstanceUID, cfg.getNetworkAETitle())) + { + if (EC_Normal == writeresult) writeresult = imageBoxContentList.writeReferencedImageBoxSQ(*rspDataset); + } else writeresult = EC_MemoryExhausted; + + if (EC_Normal == writeresult) + { + rsp.msg.NCreateRSP.DataSetType = DIMSE_DATASET_PRESENT; + } else { + delete rspDataset; + rspDataset = NULL; + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } else { + rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + } + return result; +} + + + + +OFBool DVPSStoredPrint::printSCPSet( + DVConfiguration& cfg, + const char *cfgname, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList) +{ + OFBool result = OFTrue; + DcmStack stack; + OFCondition writeresult = EC_Normal; + DcmElement *delem = NULL; + + rspDataset = new DcmDataset; + if ((rqDataset == NULL)||(rspDataset == NULL)) + { + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + + // magnificationType + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)magnificationType.getTag(), stack, ESM_fromHere, OFFalse))) + { + magnificationType = *((DcmCodeString *)(stack.top())); + Uint32 numMagnifications = cfg.getTargetPrinterNumberOfMagnificationTypes(cfgname); + OFString theMagnification; + OFString aString; + OFBool found = OFFalse; + magnificationType.getOFString(theMagnification, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)smoothingType.getTag(), stack, ESM_fromHere, OFFalse))) + { + smoothingType = *((DcmCodeString *)(stack.top())); + Uint32 numSmoothings = cfg.getTargetPrinterNumberOfSmoothingTypes(cfgname); + OFString theSmoothing; + OFString aString; + OFBool found = OFFalse; + smoothingType.getOFString(theSmoothing, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)borderDensity.getTag(), stack, ESM_fromHere, OFFalse))) + { + borderDensity = *((DcmCodeString *)(stack.top())); + Uint32 numBorderDensities = cfg.getTargetPrinterNumberOfBorderDensities(cfgname); + if (numBorderDensities == 0) // we don't support border density + { + DCMPSTAT_WARN("cannot update Basic Film Box: border density requested but not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theBorderDensity; + OFString aString; + OFBool found = OFFalse; + OFBool supportsNumericDensity = OFFalse; + unsigned long l; + borderDensity.getOFString(theBorderDensity, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)emptyImageDensity.getTag(), stack, ESM_fromHere, OFFalse))) + { + emptyImageDensity = *((DcmCodeString *)(stack.top())); + Uint32 numEmptyImageDensities = cfg.getTargetPrinterNumberOfEmptyImageDensities(cfgname); + if (numEmptyImageDensities == 0) // we don't support empty image density + { + DCMPSTAT_WARN("cannot update Basic Film Box: empty image density requested but not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theEIDensity; + OFString aString; + OFBool found = OFFalse; + OFBool supportsNumericDensity = OFFalse; + unsigned long l; + emptyImageDensity.getOFString(theEIDensity, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)maxDensity.getTag(), stack, ESM_fromHere, OFFalse))) + { + maxDensity = *((DcmUnsignedShort *)(stack.top())); + // we don't check a max density set by the user (for now) + ADD_TO_PDATASET(DcmUnsignedShort, maxDensity) + } + } + + // minDensity + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)minDensity.getTag(), stack, ESM_fromHere, OFFalse))) + { + minDensity = *((DcmUnsignedShort *)(stack.top())); + Uint32 numMinDensities = cfg.getTargetPrinterNumberOfMinDensities(cfgname); + if (numMinDensities == 0) // we don't support min density + { + DCMPSTAT_WARN("cannot update Basic Film Box: min density requested but not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + else + { + // we don't check a min density set by the user (for now) + ADD_TO_PDATASET(DcmUnsignedShort, minDensity) + } + } + } + + // trim + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)trim.getTag(), stack, ESM_fromHere, OFFalse))) + { + trim = *((DcmCodeString *)(stack.top())); + + if (cfg.getTargetPrinterSupportsTrim(cfgname)) + { + OFString aString; + trim.getOFString(aString, 0, OFTrue); + if ((aString != "YES")&&(aString != "NO")) + { + DCMPSTAT_WARN("cannot update Basic Film Box: illegal trim: '" << aString.c_str() << "'"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + ADD_TO_PDATASET(DcmCodeString, trim) + } + } else { + DCMPSTAT_WARN("cannot update Basic Film Box: trim requested but not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // configurationInformation + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)configurationInformation.getTag(), stack, ESM_fromHere, OFFalse))) + { + configurationInformation = *((DcmShortText *)(stack.top())); + Uint32 numConfigurationInformation = cfg.getTargetPrinterNumberOfConfigurationSettings(cfgname); + if (numConfigurationInformation == 0) // we don't support configuration information + { + DCMPSTAT_WARN("cannot update Basic Film Box: configuration information requested but not supported."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } else { + OFString theConfiguration; + OFBool found = OFFalse; + configurationInformation.getOFString(theConfiguration, 0, OFTrue); + for (Uint32 i=0; isearch((DcmTagKey &)illumination.getTag(), stack, ESM_fromHere, OFFalse))) + { + illumination = *((DcmUnsignedShort *)(stack.top())); + // we don't check illumination set by the user (for now) + ADD_TO_PDATASET(DcmUnsignedShort, illumination) + } + } + + // reflectedAmbientLight + if (result) + { + stack.clear(); + if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)reflectedAmbientLight.getTag(), stack, ESM_fromHere, OFFalse))) + { + reflectedAmbientLight = *((DcmUnsignedShort *)(stack.top())); + // we don't check reflected ambient light set by the user (for now) + ADD_TO_PDATASET(DcmUnsignedShort, reflectedAmbientLight) + } + } + + // referenced presentation LUT sequence + if (result) + { + stack.clear(); + + if (rqDataset && (EC_Normal == rqDataset->search(DCM_ReferencedPresentationLUTSequence, stack, ESM_fromHere, OFFalse))) + { + DcmSequenceOfItems *seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + OFString aString; + DcmItem *item = seq->getItem(0); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID) + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + referencedPresentationLUTInstanceUID.getOFString(aString,0); + DVPSPresentationLUT *currentPLUT = globalPresentationLUTList.findPresentationLUT(aString.c_str()); + if (NULL == currentPLUT) + { + DCMPSTAT_WARN("cannot update Basic Film Box: presentation LUT reference cannot be resolved"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + // check referenced SOP class UID + DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID); + stack.clear(); + READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID) + if (refClassUID.getLength() > 0) + { + aString.clear(); + refClassUID.getOFString(aString,0, OFTrue); + if (aString != UID_PresentationLUTSOPClass) + { + DCMPSTAT_WARN("cannot update Basic Film Box: referenced SOP class UID in referenced presentation LUT sequence incorrect:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + referencedPresentationLUTAlignment = currentPLUT->getAlignment(); + if ((cfg.getTargetPrinterPresentationLUTMatchRequired(cfgname)) && + (! imageBoxContentList.matchesPresentationLUT(referencedPresentationLUTAlignment))) + { + DCMPSTAT_WARN("cannot update Basic Film Box: referenced presentation LUT number of entries does not match image bit depth."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } else { + + // referenced presentation LUT sequence is OK + // synchronize presentationLUTInstanceUID and referencedPresentationLUTInstanceUID + presentationLUTInstanceUID.clear(); + referencedPresentationLUTInstanceUID.getOFString(presentationLUTInstanceUID,0); + DcmSequenceOfItems *newSeq = new DcmSequenceOfItems(*seq); + if (newSeq) rspDataset->insert(newSeq, OFTrue /*replaceOld*/); + else + { + writeresult = EC_MemoryExhausted; + } + } + } + } else { + DCMPSTAT_WARN("cannot update Basic Film Box: no referenced SOP class UID in referenced presentation LUT sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } else { + DCMPSTAT_WARN("cannot update Basic Film Box: no referenced SOP instance UID in referenced presentation LUT sequence"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } else { + DCMPSTAT_WARN("cannot update Basic Film Box: referenced presentation LUT sequence number of items != 1"); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + result = OFFalse; + } + } + } + + } /* if presentationLUTnegotiated */ + + + // browse through rqDataset and check for unsupported attributes + if (result && rqDataset) + { + OFBool intoSub = OFTrue; + stack.clear(); + while (EC_Normal == rqDataset->nextObject(stack, intoSub)) + { + intoSub = OFFalse; + const DcmTagKey& currentTag = (stack.top())->getTag(); + if (currentTag.getElement() == 0x0000) /* group length */ ; + else if (currentTag == DCM_MagnificationType) /* OK */ ; + else if (currentTag == DCM_SmoothingType) /* OK */ ; + else if (currentTag == DCM_BorderDensity) /* OK */ ; + else if (currentTag == DCM_EmptyImageDensity) /* OK */ ; + else if (currentTag == DCM_MinDensity) /* OK */ ; + else if (currentTag == DCM_MaxDensity) /* OK */ ; + else if (currentTag == DCM_Trim) /* OK */ ; + else if (currentTag == DCM_ConfigurationInformation) /* OK */ ; + else if (currentTag == DCM_ReferencedFilmSessionSequence) /* OK */ ; + else if (currentTag == DCM_Illumination) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot update Basic Film Box: illumination received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReflectedAmbientLight) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot update Basic Film Box: reflected ambient light received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else if (currentTag == DCM_ReferencedPresentationLUTSequence) + { + if (! presentationLUTnegotiated) + { + DCMPSTAT_WARN("cannot update Basic Film Box: referenced presentation LUT sequence received:\n" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + else + { + DCMPSTAT_WARN("cannot update Basic Film Box: unsupported attribute received:" + << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues)); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute; + result = OFFalse; + } + } + } + + // if n-set was successful, send back response dataset + if (result && (EC_Normal == writeresult)) + { + rsp.msg.NSetRSP.DataSetType = DIMSE_DATASET_PRESENT; + } else { + delete rspDataset; + rspDataset = NULL; + if (rsp.msg.NSetRSP.DimseStatus == 0) rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + result = OFFalse; + } + return result; +} + + +OFBool DVPSStoredPrint::usesPresentationLUT(const char *c) +{ + char *plut = NULL; + if (c && (EC_Normal == referencedPresentationLUTInstanceUID.getString(plut)) && plut) + { + OFString aString(plut); + if (aString == c) return OFTrue; + } + return OFFalse; +} + +void DVPSStoredPrint::updatePresentationLUTList(DVPSPresentationLUT_PList& globalPresentationLUTList) +{ + presentationLUTList.clear(); + if (referencedPresentationLUTInstanceUID.getLength() > 0) + { + OFString aString; + referencedPresentationLUTInstanceUID.getOFString(aString,0); + DVPSPresentationLUT *currentPLUT = globalPresentationLUTList.findPresentationLUT(aString.c_str()); + if (currentPLUT) presentationLUTList.insert(currentPLUT->clone()); + else + { + referencedPresentationLUTInstanceUID.clear(); + presentationLUTInstanceUID.clear(); + } + } +} + +void DVPSStoredPrint::overridePresentationLUTSettings( + DcmUnsignedShort& newIllumination, + DcmUnsignedShort& newReflectedAmbientLight, + DcmUniqueIdentifier& newReferencedPLUT, + DVPSPrintPresentationLUTAlignment newAlignment) +{ + illumination = newIllumination; + reflectedAmbientLight = newReflectedAmbientLight; + referencedPresentationLUTInstanceUID = newReferencedPLUT; + presentationLUTInstanceUID.clear(); + referencedPresentationLUTInstanceUID.getOFString(presentationLUTInstanceUID,0); + referencedPresentationLUTAlignment = newAlignment; +} diff --git a/dcmpstat/libsrc/dvpsspl.cc b/dcmpstat/libsrc/dvpsspl.cc new file mode 100644 index 00000000..6f591527 --- /dev/null +++ b/dcmpstat/libsrc/dvpsspl.cc @@ -0,0 +1,354 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSStoredPrint_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsspl.h" +#include "dcmtk/dcmpstat/dvpssp.h" /* for DVPSStoredPrint */ +#include "dcmtk/dcmpstat/dvpsib.h" /* for DVPSImageBoxContent */ +#include "dcmtk/dcmpstat/dviface.h" +#include "dcmtk/dcmpstat/dvpsdef.h" + +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsab.h" /* for DVPSAnnotationContent, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + +DVPSStoredPrint_PList::DVPSStoredPrint_PList() +: list_() +{ +} + +DVPSStoredPrint_PList::DVPSStoredPrint_PList(const DVPSStoredPrint_PList &arg) +: list_() +{ + OFListConstIterator(DVPSStoredPrint *) first = arg.list_.begin(); + OFListConstIterator(DVPSStoredPrint *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSStoredPrint_PList::~DVPSStoredPrint_PList() +{ + clear(); +} + +void DVPSStoredPrint_PList::clear() +{ + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +void DVPSStoredPrint_PList::printSCPBasicFilmBoxSet( + DVConfiguration& cfg, + const char *cfgname, + T_DIMSE_Message& rq, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated, + DVPSPresentationLUT_PList& globalPresentationLUTList) +{ + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + OFBool found = OFFalse; + while ((first != last) && (!found)) + { + if ((*first)->isFilmBoxInstance(rq.msg.NSetRQ.RequestedSOPInstanceUID)) found = OFTrue; + else ++first; + } + + if (found) + { + DVPSStoredPrint *newSP = new DVPSStoredPrint(*(*first)); + if (newSP) + { + if (newSP->printSCPSet(cfg, cfgname, rqDataset, rsp, rspDataset, presentationLUTnegotiated, globalPresentationLUTList)) + { + // N-SET successful, replace entry in list + delete (*first); + list_.erase(first); + list_.push_back(newSP); + } else delete newSP; + } else { + DCMPSTAT_WARN("cannot update film box, out of memory."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } else { + // film box does not exist or wrong instance UID + DCMPSTAT_WARN("cannot update film box, object not found."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + + +void DVPSStoredPrint_PList::printSCPBasicGrayscaleImageBoxSet( + DVInterface& cfg, + const char *cfgname, + T_DIMSE_Message& rq, + DcmDataset *rqDataset, + T_DIMSE_Message& rsp, + DcmDataset *& rspDataset, + OFBool presentationLUTnegotiated) +{ + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + DVPSStoredPrint *sp = NULL; + DVPSImageBoxContent *newib = NULL; + while ((first != last) && (sp == NULL)) + { + newib = (*first)->duplicateImageBox(rq.msg.NSetRQ.RequestedSOPInstanceUID); + if (newib) sp = *first; else ++first; + } + + if (newib && sp) + { + DcmFileFormat imageFile; + DcmDataset *imageDataset = imageFile.getDataset(); + + if (newib->printSCPSet(cfg, cfgname, rqDataset, rsp, rspDataset, *imageDataset, + sp->getReferencedPresentationLUTAlignment(), presentationLUTnegotiated)) + { + if (EC_Normal == sp->writeHardcopyImageAttributes(*imageDataset)) + { + // check for image position clash + if (sp->haveImagePositionClash(rq.msg.NSetRQ.RequestedSOPInstanceUID, newib->getImageBoxPosition())) + { + delete rspDataset; + rspDataset = NULL; + DCMPSTAT_WARN("cannot update basic grayscale image box, image position collision."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue; + } else { + if (EC_Normal == cfg.saveFileFormatToDB(imageFile)) + { + sp->replaceImageBox(newib); + } else { + delete rspDataset; + rspDataset = NULL; + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } + } else { + delete rspDataset; + rspDataset = NULL; + DCMPSTAT_WARN("cannot update basic grayscale image box, out of memory."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } + } else { + // image box does not exist or wrong instance UID + DCMPSTAT_WARN("cannot update basic grayscale image box, object not found."); + rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + + +void DVPSStoredPrint_PList::printSCPBasicFilmBoxAction( + DVInterface& cfg, + const char *cfgname, + T_DIMSE_Message& rq, + T_DIMSE_Message& rsp, + DVPSPresentationLUT_PList& globalPresentationLUTList) +{ + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + OFBool found = OFFalse; + while ((first != last) && (!found)) + { + if ((*first)->isFilmBoxInstance(rq.msg.NActionRQ.RequestedSOPInstanceUID)) found = OFTrue; + else ++first; + } + if (found) + { + DcmFileFormat spFile; + DcmDataset *spDataset = spFile.getDataset(); + DVPSStoredPrint *sp = *first; + OFBool writeRequestedImageSize = cfg.getTargetPrinterSupportsRequestedImageSize(cfgname); + sp->updatePresentationLUTList(globalPresentationLUTList); + sp->clearInstanceUID(); + + if ((*first)->emptyPageWarning()) + { + DCMPSTAT_INFO("empty page, will not be stored in database"); + if (STATUS_Success == rsp.msg.NActionRSP.DimseStatus) rsp.msg.NActionRSP.DimseStatus = STATUS_N_PRINT_BFB_Warn_EmptyPage; + } else { + if (EC_Normal == sp->write(*spDataset, writeRequestedImageSize, OFFalse, OFFalse, OFTrue)) + { + if (EC_Normal == cfg.saveFileFormatToDB(spFile)) + { + // N-ACTION successful. + } else { + rsp.msg.NActionRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } else { + DCMPSTAT_WARN("cannot print basic film box, out of memory."); + rsp.msg.NActionRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } + } else { + // film box does not exist or wrong instance UID + DCMPSTAT_WARN("cannot print film box, object not found."); + rsp.msg.NActionRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + + +void DVPSStoredPrint_PList::printSCPBasicFilmSessionAction( + DVInterface& cfg, + const char *cfgname, + T_DIMSE_Message& rsp, + DVPSPresentationLUT_PList& globalPresentationLUTList) +{ + if (size() > 0) + { + OFBool writeRequestedImageSize = cfg.getTargetPrinterSupportsRequestedImageSize(cfgname); + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + while (first != last) + { + DcmFileFormat spFile; + DcmDataset *spDataset = spFile.getDataset(); + (*first)->updatePresentationLUTList(globalPresentationLUTList); + (*first)->clearInstanceUID(); + + if ((*first)->emptyPageWarning()) + { + DCMPSTAT_INFO("empty page, will not be stored in database"); + if (STATUS_Success == rsp.msg.NActionRSP.DimseStatus) rsp.msg.NActionRSP.DimseStatus = STATUS_N_PRINT_BFS_Warn_EmptyPage; + } else { + if (EC_Normal == (*first)->write(*spDataset, writeRequestedImageSize, OFFalse, OFFalse, OFTrue)) + { + if (EC_Normal == cfg.saveFileFormatToDB(spFile)) + { + // success for this film box + } else { + rsp.msg.NActionRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } else { + DCMPSTAT_WARN("cannot print basic film session, out of memory."); + rsp.msg.NActionRSP.DimseStatus = STATUS_N_ProcessingFailure; + } + } + ++first; + } + } else { + // no film boxes to print + DCMPSTAT_WARN("cannot print film session, no film box."); + rsp.msg.NActionRSP.DimseStatus = STATUS_N_PRINT_BFS_Fail_NoFilmBox; + } +} + +void DVPSStoredPrint_PList::printSCPBasicFilmBoxDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp) +{ + + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + OFBool found = OFFalse; + while ((first != last) && (!found)) + { + if ((*first)->isFilmBoxInstance(rq.msg.NDeleteRQ.RequestedSOPInstanceUID)) found = OFTrue; + else ++first; + } + + if (found) + { + delete (*first); + list_.erase(first); + } else { + // film box does not exist or wrong instance UID + DCMPSTAT_WARN("cannot delete film box with instance UID '" << rq.msg.NDeleteRQ.RequestedSOPInstanceUID << "': object does not exist."); + rsp.msg.NDeleteRSP.DimseStatus = STATUS_N_NoSuchObjectInstance; + } +} + +OFBool DVPSStoredPrint_PList::haveFilmBoxInstance(const char *uid) +{ + if (uid==NULL) return OFFalse; + + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + while (first != last) + { + if ((*first)->isFilmBoxInstance(uid)) return OFTrue; + else ++first; + } + return OFFalse; +} + +OFBool DVPSStoredPrint_PList::usesPresentationLUT(const char *uid) +{ + if (uid==NULL) return OFFalse; + + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + while (first != last) + { + if ((*first)->usesPresentationLUT(uid)) return OFTrue; + else ++first; + } + return OFFalse; +} + +OFBool DVPSStoredPrint_PList::matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align) const +{ + OFBool result = OFTrue; + OFListConstIterator(DVPSStoredPrint *) first = list_.begin(); + OFListConstIterator(DVPSStoredPrint *) last = list_.end(); + while (first != last) + { + result = result && (*first)->matchesPresentationLUT(align); + ++first; + } + return result; +} + +void DVPSStoredPrint_PList::overridePresentationLUTSettings( + DcmUnsignedShort& newIllumination, + DcmUnsignedShort& newReflectedAmbientLight, + DcmUniqueIdentifier& newReferencedPLUT, + DVPSPrintPresentationLUTAlignment newAlignment) +{ + OFListIterator(DVPSStoredPrint *) first = list_.begin(); + OFListIterator(DVPSStoredPrint *) last = list_.end(); + while (first != last) + { + (*first)->overridePresentationLUTSettings(newIllumination, newReflectedAmbientLight, newReferencedPLUT, newAlignment); + ++first; + } +} diff --git a/dcmpstat/libsrc/dvpssv.cc b/dcmpstat/libsrc/dvpssv.cc new file mode 100644 index 00000000..8e3d49bd --- /dev/null +++ b/dcmpstat/libsrc/dvpssv.cc @@ -0,0 +1,332 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSSoftcopyVOI + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmpstat/dvpssv.h" +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage */ +#include "dcmtk/dcmpstat/dvpsrsl.h" /* DVPSReferencedSeries_PList */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/ofstd/ofstd.h" +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ + +/* --------------- class DVPSSoftcopyVOI --------------- */ + +DVPSSoftcopyVOI::DVPSSoftcopyVOI() +: referencedImageList() +, useLUT(OFFalse) +, voiLUTDescriptor(DCM_LUTDescriptor) +, voiLUTExplanation(DCM_LUTExplanation) +, voiLUTData(DCM_LUTData) +, windowCenter(DCM_WindowCenter) +, windowWidth(DCM_WindowWidth) +, windowCenterWidthExplanation(DCM_WindowCenterWidthExplanation) +{ +} + +DVPSSoftcopyVOI::DVPSSoftcopyVOI(const DVPSSoftcopyVOI& copy) +: referencedImageList(copy.referencedImageList) +, useLUT(copy.useLUT) +, voiLUTDescriptor(copy.voiLUTDescriptor) +, voiLUTExplanation(copy.voiLUTExplanation) +, voiLUTData(copy.voiLUTData) +, windowCenter(copy.windowCenter) +, windowWidth(copy.windowWidth) +, windowCenterWidthExplanation(copy.windowCenterWidthExplanation) +{ +} + +DVPSSoftcopyVOI::~DVPSSoftcopyVOI() +{ +} + +OFCondition DVPSSoftcopyVOI::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DcmSequenceOfItems *seq; + DcmItem *item; + + READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowCenter) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowWidth) + READ_FROM_DATASET(DcmLongString, EVR_LO, windowCenterWidthExplanation) + + /* read VOI LUT Sequence */ + if (result==EC_Normal) + { + stack.clear(); + if (EC_Normal == dset.search(DCM_VOILUTSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() ==1) + { + item = seq->getItem(0); + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)voiLUTDescriptor.getTag(), + stack, ESM_fromHere, OFFalse)) + { + voiLUTDescriptor = *((DcmUnsignedShort *)(stack.top())); + } + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)voiLUTExplanation.getTag(), + stack, ESM_fromHere, OFFalse)) + { + voiLUTExplanation = *((DcmLongString *)(stack.top())); + } + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)voiLUTData.getTag(), + stack, ESM_fromHere, OFFalse)) + { + voiLUTData = *((DcmUnsignedShort *)(stack.top())); + } + } else { + result=EC_TagNotFound; + DCMPSTAT_WARN("VOI LUT SQ does not have exactly one item in presentation state"); + } + } + } + + if (result==EC_Normal) result = referencedImageList.read(dset); + + /* Now perform basic sanity checks */ + + if (result==EC_Normal) + { + if (windowCenter.getLength() > 0) + { + useLUT = OFFalse; + + if (windowWidth.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("windowCenter present but windowWidth absent or empty in presentation state"); + } + else if (windowWidth.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("windowCenter present but windowWidth VM != 1 in presentation state"); + } + if (windowCenter.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("windowCenter present but VM != 1 in presentation state"); + } + } else useLUT = OFTrue; + + if (voiLUTData.getLength() > 0) + { + + if (! useLUT) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("both VOI window and LUT present in presentation state"); + } + + if (voiLUTDescriptor.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("voiLUTData present but voiLUTDescriptor absent or empty in presentation state"); + } + else if (voiLUTDescriptor.getVM() != 3) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("voiLUTData present but voiLUTDescriptor VM != 3 in presentation state"); + } + } + else if (useLUT) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("neither VOI window nor LUT present in presentation state"); + } + } + return result; +} + +OFCondition DVPSSoftcopyVOI::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (useLUT) + { + ditem = new DcmItem(); + if (ditem) + { + dseq = new DcmSequenceOfItems(DCM_VOILUTSequence); + if (dseq) + { + delem = new DcmUnsignedShort(voiLUTDescriptor); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUnsignedShort(voiLUTData); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + if (voiLUTExplanation.getLength() >0) + { + delem = new DcmLongString(voiLUTExplanation); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + } + if (result==EC_Normal) + { + dseq->insert(ditem); + dset.insert(dseq, OFTrue /*replaceOld*/); + } else { + // out of memory during creation of sequence contents. + delete dseq; + delete ditem; + result = EC_MemoryExhausted; + } + } else { + // could allocate item but not sequence. Bail out. + delete ditem; + result = EC_MemoryExhausted; + } + } + else result = EC_MemoryExhausted; + } + else + { + ADD_TO_DATASET(DcmDecimalString, windowCenter) + ADD_TO_DATASET(DcmDecimalString, windowWidth) + if (windowCenterWidthExplanation.getLength() > 0) { ADD_TO_DATASET(DcmLongString, windowCenterWidthExplanation) } + } + + if ((result == EC_Normal)&&(referencedImageList.size() >0)) result = referencedImageList.write(dset); + return result; +} + +OFBool DVPSSoftcopyVOI::isApplicable(const char *instanceUID, unsigned long frame) +{ + return referencedImageList.isApplicable(instanceUID, frame); +} + +OFBool DVPSSoftcopyVOI::matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability) +{ + return referencedImageList.matchesApplicability(instanceUID, frame, applicability); +} + +void DVPSSoftcopyVOI::removeImageReference( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability) +{ + referencedImageList.removeImageReference(allReferences, instanceUID, frame, numberOfFrames, applicability); + return; +} + +OFCondition DVPSSoftcopyVOI::addImageReference( + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + DVPSObjectApplicability applicability) +{ + return referencedImageList.addImageReference(sopclassUID, instanceUID, frame, applicability); +} + +const char *DVPSSoftcopyVOI::getCurrentVOIDescription() +{ + char *c=NULL; + if (useLUT) + { + if (EC_Normal == voiLUTExplanation.getString(c)) return c; + } + else + { + if (EC_Normal == windowCenterWidthExplanation.getString(c)) return c; + } + return NULL; +} + +OFCondition DVPSSoftcopyVOI::getCurrentWindowWidth(double &w) +{ + OFCondition result = EC_IllegalCall; + if (!useLUT) + { + Float64 temp=0.0; + result = windowWidth.getFloat64(temp,0); + if (EC_Normal==result) w = (double)temp; + } + return result; +} + +OFCondition DVPSSoftcopyVOI::getCurrentWindowCenter(double &c) +{ + OFCondition result = EC_IllegalCall; + if (!useLUT) + { + Float64 temp=0.0; + result = windowCenter.getFloat64(temp,0); + if (EC_Normal==result) c = (double)temp; + } + return result; +} + +OFCondition DVPSSoftcopyVOI::setVOIWindow(double wCenter, double wWidth, const char *description) +{ + if (wWidth < 1.0) + { + DCMPSTAT_WARN("Window Width < 1 not allowed."); + return EC_IllegalCall; + } + DcmDecimalString wc(DCM_WindowCenter); + DcmDecimalString ww(DCM_WindowWidth); + DcmLongString expl(DCM_WindowCenterWidthExplanation); + char buf[80]; + + OFStandard::ftoa(buf, sizeof(buf), wCenter, OFStandard::ftoa_uppercase); + OFCondition result = wc.putString(buf); + OFStandard::ftoa(buf, sizeof(buf), wWidth, OFStandard::ftoa_uppercase); + if (EC_Normal == result) result = ww.putString(buf); + if ((EC_Normal == result)&&(description)) result = expl.putString(description); + if (EC_Normal == result) + { + // everything worked fine, now copy. + windowCenter = wc; + windowWidth = ww; + windowCenterWidthExplanation = expl; + voiLUTDescriptor.clear(); + voiLUTData.clear(); + voiLUTExplanation.clear(); + useLUT = OFFalse; + } + return result; +} + +OFCondition DVPSSoftcopyVOI::setVOILUT( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation) +{ + if (lutData.getLength() == 0) return EC_IllegalCall; + if (lutDescriptor.getVM() != 3) return EC_IllegalCall; + voiLUTDescriptor = lutDescriptor; + voiLUTData = lutData; + voiLUTExplanation = lutExplanation; + windowCenter.clear(); + windowWidth.clear(); + windowCenterWidthExplanation.clear(); + useLUT = OFTrue; + return EC_Normal; +} diff --git a/dcmpstat/libsrc/dvpssvl.cc b/dcmpstat/libsrc/dvpssvl.cc new file mode 100644 index 00000000..aefb58e1 --- /dev/null +++ b/dcmpstat/libsrc/dvpssvl.cc @@ -0,0 +1,311 @@ +/* + * + * Copyright (C) 1999-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSSoftcopyVOI_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmpstat/dvpssvl.h" +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + +/* --------------- class DVPSSoftcopyVOI_PList --------------- */ + +DVPSSoftcopyVOI_PList::DVPSSoftcopyVOI_PList() +: list_() +{ +} + +DVPSSoftcopyVOI_PList::DVPSSoftcopyVOI_PList(const DVPSSoftcopyVOI_PList &arg) +: list_() +{ + OFListConstIterator(DVPSSoftcopyVOI *) first = arg.list_.begin(); + OFListConstIterator(DVPSSoftcopyVOI *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSSoftcopyVOI_PList::~DVPSSoftcopyVOI_PList() +{ + clear(); +} + +void DVPSSoftcopyVOI_PList::clear() +{ + OFListIterator(DVPSSoftcopyVOI *) first = list_.begin(); + OFListIterator(DVPSSoftcopyVOI *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSSoftcopyVOI_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSSoftcopyVOI *newImage = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_SoftcopyVOILUTSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newImage = new DVPSSoftcopyVOI(); + if (newImage && ditem) + { + result = newImage->read(*ditem); + list_.push_back(newImage); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSSoftcopyVOI_PList::write(DcmItem &dset) +{ + if (size()==0) return EC_Normal; // don't write empty Sequence + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_SoftcopyVOILUTSequence); + if (dseq) + { + OFListIterator(DVPSSoftcopyVOI *) first = list_.begin(); + OFListIterator(DVPSSoftcopyVOI *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + +DVPSSoftcopyVOI *DVPSSoftcopyVOI_PList::findSoftcopyVOI(const char *instanceUID, unsigned long frame) +{ + OFListIterator(DVPSSoftcopyVOI *) first = list_.begin(); + OFListIterator(DVPSSoftcopyVOI *) last = list_.end(); + while (first != last) + { + if ((*first)->isApplicable(instanceUID, frame)) return (*first); + ++first; + } + return NULL; +} + + +DVPSSoftcopyVOI *DVPSSoftcopyVOI_PList::createSoftcopyVOI( + DVPSReferencedSeries_PList& allReferences, + const char *sopclassUID, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability) +{ + + DVPSSoftcopyVOI *oldArea = findSoftcopyVOI(instanceUID, frame); + DVPSSoftcopyVOI *newArea = NULL; + if (oldArea == NULL) newArea = new DVPSSoftcopyVOI(); + else + { + // Check if the existing VOI LUT item happens to match the new + // applicability. If yes, we only need to return the existing item. + if (oldArea->matchesApplicability(instanceUID, frame, applicability)) return oldArea; + + // the applicability has changed. Rework the complete sequence. + newArea = new DVPSSoftcopyVOI(*oldArea); // create copy + if (newArea) newArea->clearImageReferences(); + + OFListIterator(DVPSSoftcopyVOI *) first = list_.begin(); + OFListIterator(DVPSSoftcopyVOI *) last = list_.end(); + switch (applicability) + { + case DVPSB_currentFrame: + case DVPSB_currentImage: + while (first != last) + { + (*first)->removeImageReference(allReferences, instanceUID, frame, numberOfFrames, applicability); + if ((*first)->imageReferencesEmpty()) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + break; + case DVPSB_allImages: + clear(); // delete all softcopy VOI LUT items + break; + } + } + + if (newArea) + { + if (applicability != DVPSB_allImages) newArea->addImageReference(sopclassUID, instanceUID, frame, applicability); + list_.push_back(newArea); + } + return newArea; +} + +void DVPSSoftcopyVOI_PList::removeSoftcopyVOI( + DVPSReferencedSeries_PList& allReferences, + const char *instanceUID, + unsigned long frame, + unsigned long numberOfFrames, + DVPSObjectApplicability applicability) +{ + OFListIterator(DVPSSoftcopyVOI *) first = list_.begin(); + OFListIterator(DVPSSoftcopyVOI *) last = list_.end(); + switch (applicability) + { + case DVPSB_currentFrame: + case DVPSB_currentImage: + while (first != last) + { + (*first)->removeImageReference(allReferences, instanceUID, frame, numberOfFrames, applicability); + if ((*first)->imageReferencesEmpty()) + { + delete (*first); + first = list_.erase(first); + } else ++first; + } + break; + case DVPSB_allImages: + clear(); // delete all softcopy VOI LUT items + break; + } + return; +} + +OFCondition DVPSSoftcopyVOI_PList::createFromImage( + DcmItem &dset, + DVPSReferencedSeries_PList& allReferences, + const char *sopclassUID, + const char *instanceUID, + DVPSVOIActivation voiActivation) +{ + if (voiActivation == DVPSV_ignoreVOI) return EC_Normal; + + OFCondition result = EC_Normal; + DcmStack stack; + DcmSequenceOfItems *seq; + DcmItem *item; + DcmUnsignedShort voiLUTDescriptor(DCM_LUTDescriptor); + DcmLongString voiLUTExplanation(DCM_LUTExplanation); + DcmUnsignedShort voiLUTData(DCM_LUTData); + DcmDecimalString windowCenter(DCM_WindowCenter); + DcmDecimalString windowWidth(DCM_WindowWidth); + DcmLongString windowCenterWidthExplanation(DCM_WindowCenterWidthExplanation); + + READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowCenter) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowWidth) + READ_FROM_DATASET(DcmLongString, EVR_LO, windowCenterWidthExplanation) + + /* read VOI LUT Sequence */ + if (result==EC_Normal) + { + stack.clear(); + if (EC_Normal == dset.search(DCM_VOILUTSequence, stack, ESM_fromHere, OFFalse)) + { + seq=(DcmSequenceOfItems *)stack.top(); + if (seq->card() > 0) + { + item = seq->getItem(0); + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)voiLUTDescriptor.getTag(), + stack, ESM_fromHere, OFFalse)) + { + voiLUTDescriptor = *((DcmUnsignedShort *)(stack.top())); + } + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)voiLUTExplanation.getTag(), + stack, ESM_fromHere, OFFalse)) + { + voiLUTExplanation = *((DcmLongString *)(stack.top())); + } + stack.clear(); + if (EC_Normal == item->search((DcmTagKey &)voiLUTData.getTag(), + stack, ESM_fromHere, OFFalse)) + { + voiLUTData = *((DcmUnsignedShort *)(stack.top())); + } + } else result=EC_TagNotFound; + } + } + + OFBool haveWindow = ((windowCenter.getVM() > 0) && (windowWidth.getVM() > 0)); + OFBool haveLUT = ((voiLUTDescriptor.getVM() == 3) && (voiLUTData.getLength() > 0)); + + if (result==EC_Normal) + { + DVPSSoftcopyVOI *voi = NULL; + if (haveWindow && ((voiActivation==DVPSV_preferVOIWindow)||(! haveLUT))) + { + // create VOI window + Float64 wc, ww; + char *wexp = NULL; + result = windowCenter.getFloat64(wc,0); + if (EC_Normal==result) result = windowWidth.getFloat64(ww,0); + if (windowCenterWidthExplanation.getLength() > 0) + { + if (EC_Normal != windowCenterWidthExplanation.getString(wexp)) wexp = NULL; + } + if (EC_Normal==result) + { + voi = createSoftcopyVOI(allReferences, sopclassUID, instanceUID, 1, 1, DVPSB_currentImage); + if (voi) result = voi->setVOIWindow(wc, ww, wexp); else result = EC_MemoryExhausted; + } + } + else if (haveLUT && ((voiActivation==DVPSV_preferVOILUT)||(! haveWindow))) + { + // create VOI LUT + voi = createSoftcopyVOI(allReferences, sopclassUID, instanceUID, 1, 1, DVPSB_currentImage); + if (voi) result = voi->setVOILUT(voiLUTDescriptor, voiLUTData, voiLUTExplanation); else result = EC_MemoryExhausted; + } + } + + return result; +} diff --git a/dcmpstat/libsrc/dvpstat.cc b/dcmpstat/libsrc/dvpstat.cc new file mode 100644 index 00000000..d603272a --- /dev/null +++ b/dcmpstat/libsrc/dvpstat.cc @@ -0,0 +1,2166 @@ +/* + * + * Copyright (C) 1998-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPresentationState + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/dcmpstat/dvpstat.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmimgle/dcmimage.h" /* for DicomImage */ +#include "dcmtk/dcmpstat/dvpscu.h" /* for DVPSCurve */ +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT */ +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow */ +#include "dcmtk/dcmpstat/dvpsov.h" /* for DVPSOverlay */ +#include "dcmtk/dcmpstat/dvpsda.h" /* for DVPSDisplayedArea */ +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI */ +#include "dcmtk/dcmpstat/dvpshlp.h" /* for class DVPSHelper */ +#include "dcmtk/ofstd/ofstd.h" /* for class OFStandard */ + +#include "dcmtk/dcmpstat/dvpsgl.h" /* for DVPSGraphicLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsrs.h" /* for DVPSReferencedSeries, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsal.h" /* for DVPSOverlayCurveActivationLayer, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsga.h" /* for DVPSGraphicAnnotation, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject, needed by MSVC5 with STL */ +#include "dcmtk/dcmpstat/dvpsgr.h" /* for DVPSGraphicObject, needed by MSVC5 with STL */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CMATH +#define INCLUDE_CTIME +#define INCLUDE_LIBC +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" + +/* --------------- class DVPresentationState --------------- */ + +DVPresentationState::DVPresentationState( + DiDisplayFunction **dispFunction, + unsigned long minPrintBitmapX, + unsigned long minPrintBitmapY, + unsigned long maxPrintBitmapX, + unsigned long maxPrintBitmapY, + unsigned long maxPreviewImageX, + unsigned long maxPreviewImageY) +: DcmPresentationState() +, currentImageDataset(NULL) +, currentImageFileformat(NULL) +, currentImage(NULL) +, previewImage(NULL) +, currentImageWidth(0) +, currentImageHeight(0) +, renderedImageWidth(0) +, renderedImageHeight(0) +, renderedImageTop(0) +, renderedImageLeft(0) +, renderedImageBottom(0) +, renderedImageRight(0) +, currentImageSOPClassUID(NULL) +, currentImageSOPInstanceUID(NULL) +, currentImageSelectedFrame(0) +, currentImageOwned(OFFalse) +, currentImageVOIValid(OFFalse) +, currentImagePLUTValid(OFFalse) +, currentImageFlip(OFFalse) +, currentImageRotation(DVPSR_0_deg) +, currentImageOverlaysValid(0) +, currentImageCurveList() +, currentImageVOILUTList() +, currentImageVOIWindowList() +, currentImageModality(DCM_Modality) +, currentImageMonochrome1(OFFalse) +, displayTransform(DVPSD_GSDF) +, imageInverse(OFFalse) +, displayFunction(dispFunction) +, minimumPrintBitmapWidth(minPrintBitmapX) +, minimumPrintBitmapHeight(minPrintBitmapY) +, maximumPrintBitmapWidth(maxPrintBitmapX) +, maximumPrintBitmapHeight(maxPrintBitmapY) +, maximumPreviewImageWidth(maxPreviewImageX) +, maximumPreviewImageHeight(maxPreviewImageY) +{ + createInstanceUID(); +} + + +DVPresentationState::~DVPresentationState() +{ + detachImage(); +} + +void DVPresentationState::detachImage() +{ + if (currentImage) delete currentImage; + deletePreviewImage(); + if (currentImageOwned) + { + if (currentImageFileformat) delete currentImageFileformat; + else if (currentImageDataset) delete currentImageDataset; + } + currentImage = NULL; + currentImageFileformat = NULL; + currentImageDataset = NULL; + currentImageCurveList.clear(); + currentImageVOILUTList.clear(); + currentImageVOIWindowList.clear(); + currentImageModality.clear(); + currentImageMonochrome1 = OFFalse; + + // reset flags + currentImageWidth = 0; + currentImageHeight = 0; + renderedImageWidth = 0; + renderedImageHeight = 0; + renderedImageTop = 0; + renderedImageLeft = 0; + renderedImageBottom = 0; + renderedImageRight = 0; + currentImageOwned = OFFalse; + currentImageVOIValid = OFFalse; + currentImagePLUTValid = OFFalse; + currentImageFlip = OFFalse; + currentImageRotation = DVPSR_0_deg; + currentImageOverlaysValid = 0; + currentImageSOPClassUID=NULL; + currentImageSOPInstanceUID=NULL; + currentImageSelectedFrame=0; +} + + +void DVPresentationState::clear() +{ + DcmPresentationState::clear(); + detachImage(); // clears all currentImageXX attributes + // we do not change the display function + displayTransform = DVPSD_GSDF; + imageInverse = OFFalse; + return; +} + + +OFCondition DVPresentationState::writeHardcopyImageAttributes(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + DVPSHelper::setDefault(result, patientName, DEFAULT_patientName); + ADD_TO_DATASET(DcmPersonName, patientName) + ADD_TO_DATASET(DcmLongString, patientID) + ADD_TO_DATASET(DcmDate, patientBirthDate) + ADD_TO_DATASET(DcmCodeString, patientSex) + + // write source image sequence + if (result == EC_Normal) + { + dseq = new DcmSequenceOfItems(DCM_SourceImageSequence); + if (dseq) + { + // first item references source image + if (currentImageSOPClassUID && currentImageSOPInstanceUID) + { + ditem = new DcmItem(); + if (ditem) + { + delem = new DcmUniqueIdentifier(DCM_SOPClassUID); + if (delem) + { + result = delem->putString(currentImageSOPClassUID); + ditem->insert(delem, OFTrue /*replaceOld*/); + } else result=EC_MemoryExhausted; + delem = new DcmUniqueIdentifier(DCM_SOPInstanceUID); + if (delem) + { + result = delem->putString(currentImageSOPInstanceUID); + ditem->insert(delem, OFTrue /*replaceOld*/); + } else result=EC_MemoryExhausted; + if (EC_Normal == result) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + // second item references presentation state + ditem = new DcmItem(); + if (ditem) + { + delem = new DcmUniqueIdentifier(sOPInstanceUID); + if (delem) ditem->insert(delem, OFTrue /*replaceOld*/); else result=EC_MemoryExhausted; + delem = new DcmUniqueIdentifier(DCM_SOPClassUID); + if (delem) + { + result = delem->putString(UID_GrayscaleSoftcopyPresentationStateStorage); + ditem->insert(delem, OFTrue /*replaceOld*/); + } else result=EC_MemoryExhausted; + if (EC_Normal == result) dseq->insert(ditem); else delete ditem; + } + } else result = EC_MemoryExhausted; + if (EC_Normal == result) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } + + return result; +} + +unsigned long DVPresentationState::getPrintBitmapSize() +{ + unsigned long result = 0; + unsigned long width; + unsigned long height; + if (getPrintBitmapWidthHeight(width, height) == EC_Normal) + result = width * height * 2; // print bitmap: 12 bit stored, 16 bit allocated (2 bytes per pixel) + return result; +} + + +OFCondition DVPresentationState::setMinimumPrintBitmapWidthHeight(unsigned long width, + unsigned long height) +{ + OFCondition result = EC_IllegalCall; + const unsigned long max = (width > height) ? width : height; + if (((maximumPrintBitmapWidth == 0) || (maximumPrintBitmapWidth >= 2 * max)) && + ((maximumPrintBitmapHeight == 0) || (maximumPrintBitmapHeight >= 2 * max))) + { + minimumPrintBitmapWidth = width; + minimumPrintBitmapHeight = height; + result = EC_Normal; + } + return result; +} + + +OFCondition DVPresentationState::setMaximumPrintBitmapWidthHeight(unsigned long width, + unsigned long height) +{ + OFCondition result = EC_IllegalCall; + const unsigned long min = (width < height) ? width : height; + if (((minimumPrintBitmapWidth == 0) || (min >= 2 * minimumPrintBitmapWidth)) && + ((minimumPrintBitmapHeight == 0) || (min >= 2 * minimumPrintBitmapHeight))) + { + maximumPrintBitmapWidth = width; + maximumPrintBitmapHeight = height; + result = EC_Normal; + } + return result; +} + + +OFCondition DVPresentationState::getPrintBitmapWidthHeight(unsigned long &width, + unsigned long &height) +{ + OFCondition result = EC_Normal; + if (currentImage) + { + renderPixelData(OFFalse); // switch off display function + width = renderedImageWidth; + height = renderedImageHeight; + if ((width > 0) && (height > 0)) + { + width = (unsigned long)(renderedImageRight - renderedImageLeft + 1); + height = (unsigned long)(renderedImageBottom - renderedImageTop + 1); + + if ((minimumPrintBitmapWidth > 0) && (width < minimumPrintBitmapWidth)) + { + if ((minimumPrintBitmapHeight > 0) && (height < minimumPrintBitmapHeight)) + { + const unsigned long xfactor = (unsigned long)((double)(minimumPrintBitmapWidth - 1) / (double)width) + 1; + const unsigned long yfactor = (unsigned long)((double)(minimumPrintBitmapHeight - 1) / (double)height) + 1; + if (xfactor > yfactor) + { + width *= xfactor; + height *= xfactor; + } else { + width *= yfactor; + height *= yfactor; + } + } else { + const unsigned long factor = (unsigned long)((double)(minimumPrintBitmapWidth - 1) / (double)width) + 1; + width *= factor; + height *= factor; + } + } + else if ((minimumPrintBitmapHeight > 0) && (height < minimumPrintBitmapHeight)) + { + const unsigned long factor = (unsigned long)((double)(minimumPrintBitmapHeight - 1) / (double)height) + 1; + width *= factor; + height *= factor; + } + + if ((maximumPrintBitmapWidth > 0) && (width > maximumPrintBitmapWidth)) + { + if ((maximumPrintBitmapHeight > 0) && (height > maximumPrintBitmapHeight)) + { + const unsigned long xdivisor = (unsigned long)((double)(width - 1) / (double)maximumPrintBitmapWidth) + 1; + const unsigned long ydivisor = (unsigned long)((double)(height - 1) / (double)maximumPrintBitmapHeight) + 1; + if (xdivisor > ydivisor) + { + width /= xdivisor; + height /= xdivisor; + } else { + width /= ydivisor; + height /= ydivisor; + } + } else { + const unsigned long divisor = (unsigned long)((double)(width - 1) / (double)maximumPrintBitmapWidth) + 1; + width /= divisor; + height /= divisor; + } + } + else if ((maximumPrintBitmapHeight > 0) && (height > maximumPrintBitmapHeight)) + { + const unsigned long divisor = (unsigned long)((double)(height - 1) / (double)maximumPrintBitmapHeight) + 1; + width /= divisor; + height /= divisor; + } + } + } else { + width = 0; + height = 0; + result = EC_IllegalCall; + } + return result; +} + + +OFCondition DVPresentationState::getPrintBitmapWidth(unsigned long &width) +{ + unsigned long dummy; + return getPrintBitmapWidthHeight(width, dummy); +} + + +OFCondition DVPresentationState::getPrintBitmapHeight(unsigned long &height) +{ + unsigned long dummy; + return getPrintBitmapWidthHeight(dummy, height); +} + + +double DVPresentationState::getPrintBitmapPixelAspectRatio() +{ + double result = getDisplayedAreaPresentationPixelAspectRatio(); + if (result == 1.0) return result; // handle most frequent case quickly + if (result == 0.0) result = 1.0; // should never happen + + DVPSRotationType rotation = getRotation(); + if ((rotation==DVPSR_90_deg)||(rotation==DVPSR_270_deg)) result = 1.0/result; + return result; +} + + +OFCondition DVPresentationState::getPrintBitmap(void *bitmap, + unsigned long size, + OFBool inversePLUT) +{ + OFCondition result = EC_IllegalCall; + if ((bitmap != NULL) && (size == getPrintBitmapSize())) // check given buffer + { + if (currentImage) + { + renderPixelData(OFFalse); // don't use current display function + unsigned long width; + unsigned long height; + if (getPrintBitmapWidthHeight(width, height) == EC_Normal) + { + DicomImage *image = currentImage; + + /* we deactivate any presentation LUT at this point because + * getPrintBitmapWidthHeight() calls renderPixelData(). + */ + if (presentationLUT.getType() == DVPSP_table) + { + if (inversePLUT) + { + if (currentImageMonochrome1) currentImage->setPolarity(EPP_Reverse); + presentationLUT.activateInverseLUT(currentImage); + } else { + // we never render a presentation LUT into the print bitmap at this stage. + if (currentImageMonochrome1) currentImage->setPresentationLutShape(ESP_Inverse); + else currentImage->setPresentationLutShape(ESP_Identity); + } + // make sure the presentation LUT is re-activated for on-screen display + currentImagePLUTValid = OFFalse; + } + + /* clip to displayed area if necessary */ + if ((renderedImageLeft != 1) || (renderedImageRight != (signed long)renderedImageWidth) || + (renderedImageTop != 1) || (renderedImageBottom != (signed long)renderedImageHeight)) + { + DicomImage *img = currentImage->createMonoOutputImage(currentImageSelectedFrame-1, 12 /*bits*/); + if (img == NULL) + img = currentImage; // fall-back solution + image = img->createClippedImage(renderedImageLeft - 1, renderedImageTop - 1, renderedImageRight - renderedImageLeft + 1, + renderedImageBottom - renderedImageTop + 1, getShutterPresentationValue()); + if (img != currentImage) + delete img; + } + /* scale up to minimum size or down to maximum size if necessary */ + if (((signed long)width != renderedImageRight - renderedImageLeft + 1) || + ((signed long)height != renderedImageBottom - renderedImageTop + 1)) + { + DicomImage *img = image; + image = img->createScaledImage(width, height, 0 /*no interpolation*/, 0 /*ignore aspect ratio*/); + if (img != currentImage) + delete img; + } + if (image != NULL) + { + if (image->getOutputData(bitmap, size, 12 /*bits*/, currentImageSelectedFrame-1)) result = EC_Normal; + } + if (image != currentImage) delete image; + } + } + } + return result; +} + + +OFCondition DVPresentationState::createPreviewImage(unsigned long maxWidth, + unsigned long maxHeight, + OFBool clipMode) +{ + OFCondition result = EC_IllegalCall; + if ((currentImage != NULL) && (maxWidth > 0) && (maxHeight > 0)) + { + deletePreviewImage(); + renderPixelData(); + unsigned long width = maxWidth; + unsigned long height = maxHeight; + double ratio = getPrintBitmapPixelAspectRatio(); // never 0 ! + if ((double)renderedImageWidth / (double)maxWidth * ratio < (double)renderedImageHeight / (double)maxHeight) + width = 0; + else + height = 0; + if (clipMode) + { + /* not yet implemented: clip preview image to current displayed area */ + } + double oldRatio = currentImage->getWidthHeightRatio(); + currentImage->setWidthHeightRatio(ratio); + previewImage = currentImage->createScaledImage(width, height, 1 /*interpolate*/, 1 /*aspect ratio*/); + currentImage->setWidthHeightRatio(oldRatio); + if (previewImage != NULL) + { + if (previewImage->getStatus() == EIS_Normal) + { + previewImage->removeAllOverlays(); + result = EC_Normal; + } else { + deletePreviewImage(); + } + } + } + return result; +} + + +void DVPresentationState::deletePreviewImage() +{ + delete previewImage; + previewImage = NULL; +} + + +unsigned long DVPresentationState::getPreviewImageSize() +{ + unsigned long result = 0; + unsigned long width; + unsigned long height; + if (getPreviewImageWidthHeight(width, height) == EC_Normal) + result = width * height; + return result; +} + + +OFCondition DVPresentationState::getPreviewImageWidthHeight(unsigned long &width, + unsigned long &height) +{ + OFCondition result = EC_IllegalCall; + if (previewImage != NULL) + { + width = previewImage->getWidth(); + height = previewImage->getHeight(); + if ((width > 0) && (height > 0)) + result = EC_Normal; + } else { + width = 0; + height = 0; + } + return result; +} + + +OFCondition DVPresentationState::getPreviewImageWidth(unsigned long &width) +{ + unsigned long dummy; + return getPreviewImageWidthHeight(width, dummy); +} + + +OFCondition DVPresentationState::getPreviewImageHeight(unsigned long &height) +{ + unsigned long dummy; + return getPreviewImageWidthHeight(dummy, height); +} + + +OFCondition DVPresentationState::getPreviewImageBitmap(void *bitmap, + unsigned long size) +{ + OFCondition result = EC_IllegalCall; + if ((previewImage != NULL) && (bitmap != NULL) && (size > 0)) + { + renderPixelData(); + if (previewImage->getOutputData(bitmap, size, 8 /*bits*/, currentImageSelectedFrame-1)) + result = EC_Normal; + } + return result; +} + + +OFCondition DVPresentationState::attachImage(DcmDataset *dataset, OFBool transferOwnership) +{ + if (!dataset) return EC_IllegalCall; + + // select the right DicomImage constructor depending on the Modality LUT + DicomImage *image = NULL; + if (useModalityRescale) + { + Float64 slope = 1.0; + Float64 intercept = 0.0; + + if (EC_Normal != rescaleSlope.getFloat64(slope, 0)) + { + DCMPSTAT_WARN("unable to evaluate Modality Rescale Slope, ignoring."); + slope = 1.0; + } + if (EC_Normal != rescaleIntercept.getFloat64(intercept, 0)) + { + DCMPSTAT_WARN("unable to evaluate Modality Rescale Slope, ignoring."); + intercept = 0.0; + } + image = new DicomImage(dataset, dataset->getOriginalXfer(), + slope, intercept, CIF_UsePresentationState); + } + else if (useModalityLUT) + { + image = new DicomImage(dataset, dataset->getOriginalXfer(), + modalityLUTData, modalityLUTDescriptor, &modalityLUTExplanation, CIF_UsePresentationState); + } + else + { + image = new DicomImage(dataset, dataset->getOriginalXfer(), CIF_UsePresentationState); + } + + OFCondition result = EC_Normal; + if (image) + { + if (EIS_Normal == image->getStatus()) + { + OFString aString; + DcmStack stack; + detachImage(); + currentImage = image; + currentImageWidth = image->getWidth(); + currentImageHeight = image->getHeight(); + currentImageDataset = dataset; + currentImageOwned = transferOwnership; + currentImageSelectedFrame = 1; // default: first frame + + // get Modality + if (EC_Normal == dataset->search(DCM_Modality, stack, ESM_fromHere, OFFalse)) + { + currentImageModality = *((DcmCodeString *)(stack.top())); + } + stack.clear(); + + // determine default Presentation LUT Shape + if (EC_Normal == dataset->search(DCM_PhotometricInterpretation, stack, ESM_fromHere, OFFalse)) + { + DcmCodeString *photometricInterpretation = (DcmCodeString *)(stack.top()); + if (photometricInterpretation->getVM() == 1) + { + aString.clear(); + photometricInterpretation->getOFString(aString,0); + if ((aString == "MONOCHROME1")||(aString == "MONOCHROME 1")) currentImageMonochrome1 = OFTrue; + } + } + stack.clear(); + + // get SOP class UID and SOP instance UID. + if ((EC_Normal == result)&&(EC_Normal == dataset->search(DCM_SOPClassUID, stack, ESM_fromHere, OFFalse))) + { + result = ((DcmUniqueIdentifier *)(stack.top()))->getString(currentImageSOPClassUID); + } + stack.clear(); + if ((EC_Normal == result)&&(EC_Normal == dataset->search(DCM_SOPInstanceUID, stack, ESM_fromHere, OFFalse))) + { + result = ((DcmUniqueIdentifier *)(stack.top()))->getString(currentImageSOPInstanceUID); + } + if (EC_Normal==result) result = currentImageCurveList.read(*dataset); + if (EC_Normal==result) result = currentImageVOILUTList.read(*dataset); + if (EC_Normal==result) result = currentImageVOIWindowList.read(*dataset); + + createPreviewImage(maximumPreviewImageWidth, maximumPreviewImageHeight); + } else { + delete image; + result = EC_IllegalCall; + } + } else result = EC_MemoryExhausted; + return result; +} + +OFCondition DVPresentationState::getImageWidth(unsigned long &width) +{ + OFCondition result=EC_Normal; + if (currentImage) width = currentImageWidth; + else + { + width = 0; + result = EC_IllegalCall; + } + return result; +} + +OFCondition DVPresentationState::getImageHeight(unsigned long &height) +{ + OFCondition result=EC_Normal; + if (currentImage) height = currentImageHeight; + else + { + height = 0; + result = EC_IllegalCall; + } + return result; +} + + +OFCondition DVPresentationState::attachImage(DcmFileFormat *fileformat, OFBool transferOwnership) +{ + if (fileformat == NULL) return EC_IllegalCall; + OFCondition result = attachImage(fileformat->getDataset(), transferOwnership); + if (EC_Normal == result) currentImageFileformat = fileformat; + return result; +} + + +OFCondition DVPresentationState::addImageReferenceAttached( + const char *aetitle, + const char *filesetID, + const char *filesetUID) +{ + if (currentImageDataset) return addImageReference(*currentImageDataset, aetitle, filesetID, filesetUID); + else return EC_IllegalCall; +} + + +OFCondition DVPresentationState::removeImageReferenceAttached() +{ + if (currentImageDataset) return removeImageReference(*currentImageDataset); + else return EC_IllegalCall; +} + + + +OFCondition DVPresentationState::setCurrentPresentationLUT(DVPSPresentationLUTType newType) +{ + OFCondition result = presentationLUT.setType(newType); + currentImagePLUTValid = OFFalse; // PLUT has changed + imageInverse = presentationLUT.isInverse(); + return result; +} + +OFCondition DVPresentationState::setDefaultPresentationLUTShape() +{ + OFCondition result = EC_Normal; + if (currentImageMonochrome1) result=presentationLUT.setType(DVPSP_inverse); else result=presentationLUT.setType(DVPSP_identity); + currentImagePLUTValid = OFFalse; // PLUT has changed + imageInverse = presentationLUT.isInverse(); + return result; +} + +OFCondition DVPresentationState::setPresentationLookupTable( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation) +{ + OFCondition result = presentationLUT.setLUT(lutDescriptor, lutData, lutExplanation); + currentImagePLUTValid = OFFalse; // PLUT has changed + OFBool wasInverse = imageInverse; + imageInverse = presentationLUT.isInverse(); + + // keep inverse/normal status as before + if ((wasInverse && (! imageInverse))||(imageInverse && (! wasInverse))) result = invertImage(); + return result; +} + +OFCondition DVPresentationState::setPresentationLookupTable(DcmItem &dset) +{ + OFCondition result = presentationLUT.read(dset, OFFalse); + if (EC_Normal != result) presentationLUT.setType(DVPSP_identity); // set to well-defined default in case of error + currentImagePLUTValid = OFFalse; // PLUT has changed + OFBool wasInverse = imageInverse; + imageInverse = presentationLUT.isInverse(); + + // keep inverse/normal status as before + if ((wasInverse && (! imageInverse))||(imageInverse && (! wasInverse))) result = invertImage(); + return result; +} + + +void DVPresentationState::removeShutter(DVPSShutterType type) +{ + switch (type) + { + case DVPSU_rectangular: + useShutterRectangular = OFFalse; + break; + case DVPSU_circular: + useShutterCircular = OFFalse; + break; + case DVPSU_polygonal: + useShutterPolygonal = OFFalse; + break; + case DVPSU_bitmap: + if (useShutterBitmap) currentImageOverlaysValid = 1; // invalid but nothing added + useShutterBitmap = OFFalse; + break; + } + return; +} + + +OFCondition DVPresentationState::setRectShutter(Sint32 lv, Sint32 rv, Sint32 uh, Sint32 lh) +{ + OFCondition result=EC_Normal; + char buf[80]; + + sprintf(buf, "%ld", (long)lv); + result = shutterLeftVerticalEdge.putString(buf); + sprintf(buf, "%ld", (long)rv); + if (EC_Normal==result) result = shutterRightVerticalEdge.putString(buf); + sprintf(buf, "%ld", (long)uh); + if (EC_Normal==result) result = shutterUpperHorizontalEdge.putString(buf); + sprintf(buf, "%ld", (long)lh); + if (EC_Normal==result) result = shutterLowerHorizontalEdge.putString(buf); + if ((EC_Normal==result)&&(shutterPresentationValue.getLength()==0)) + result = shutterPresentationValue.putUint16(0,0); + if (EC_Normal==result) + { + useShutterRectangular = OFTrue; + if (useShutterBitmap) currentImageOverlaysValid = 1; // invalid but nothing added + useShutterBitmap = OFFalse; + } + return result; +} + + +OFCondition DVPresentationState::setCircularShutter(Sint32 centerX, Sint32 centerY, Sint32 radius) +{ + OFCondition result=EC_Normal; + char buf[80]; + + sprintf(buf, "%ld\\%ld", (long)centerY, (long)centerX); + result = centerOfCircularShutter.putString(buf); + sprintf(buf, "%ld", (long)radius); + if (EC_Normal==result) result = radiusOfCircularShutter.putString(buf); + if ((EC_Normal==result)&&(shutterPresentationValue.getLength()==0)) + result = shutterPresentationValue.putUint16(0,0); + if (EC_Normal==result) + { + useShutterCircular = OFTrue; + if (useShutterBitmap) currentImageOverlaysValid = 1; // invalid but nothing added + useShutterBitmap = OFFalse; + } + return result; +} + + +OFCondition DVPresentationState::addPolyShutterVertex(Sint32 x, Sint32 y) +{ + if (verticesOfThePolygonalShutter.getLength()==0) return EC_IllegalCall; + OFString aString; + OFCondition result = verticesOfThePolygonalShutter.getOFStringArray(aString,OFTrue); + if (result==EC_Normal) + { + char buf[80]; + sprintf(buf, "\\%ld\\%ld", (long)y, (long)x); + aString += buf; + result = verticesOfThePolygonalShutter.putOFStringArray(aString); + } + + if (result==EC_Normal) + { + Sint32 xp0 = 0; + Sint32 yp0 = 0; + result = getPolyShutterVertex(0, xp0, yp0); + if (result==EC_Normal) + { + if ((xp0==x)&&(yp0==y)) // polygon is closed now, activate. + { + if (shutterPresentationValue.getLength()==0) + result = shutterPresentationValue.putUint16(0,0); + if (EC_Normal==result) + { + useShutterPolygonal = OFTrue; + if (useShutterBitmap) currentImageOverlaysValid = 1; // invalid but nothing added + useShutterBitmap = OFFalse; + } + } + } + } + return result; +} + +OFCondition DVPresentationState::removeGraphicLayer(size_t idx) +{ + const char *name = graphicLayerList.getGraphicLayerName(idx); + if (name==NULL) return EC_IllegalCall; + activationLayerList.removeLayer(name); + currentImageOverlaysValid = 1; // invalid but nothing added + graphicAnnotationList.removeLayer(name); + return graphicLayerList.removeGraphicLayer(idx); +} + +size_t DVPresentationState::getNumberOfTextObjects(size_t layer) +{ + if (!currentImage) return 0; + return graphicAnnotationList.getNumberOfTextObjects(graphicLayerList.getGraphicLayerName(layer), currentImageSOPInstanceUID, currentImageSelectedFrame); +} + +DVPSTextObject *DVPresentationState::getTextObject(size_t layer, size_t idx) +{ + if (!currentImage) return NULL; + return graphicAnnotationList.getTextObject(graphicLayerList.getGraphicLayerName(layer), currentImageSOPInstanceUID, currentImageSelectedFrame, idx); +} + +DVPSTextObject *DVPresentationState::addTextObject(size_t layer, DVPSObjectApplicability applicability) +{ + if (!currentImage) return NULL; + return graphicAnnotationList.addTextObject(graphicLayerList.getGraphicLayerName(layer), currentImageSOPClassUID, + currentImageSOPInstanceUID, currentImageSelectedFrame, applicability); +} + +OFCondition DVPresentationState::removeTextObject(size_t layer, size_t idx) +{ + if (!currentImage) return EC_IllegalCall; + return graphicAnnotationList.removeTextObject(graphicLayerList.getGraphicLayerName(layer), currentImageSOPInstanceUID, currentImageSelectedFrame, idx); +} + +OFCondition DVPresentationState::moveTextObject(size_t old_layer, size_t idx, size_t new_layer, DVPSObjectApplicability applicability) +{ + if (!currentImage) return EC_IllegalCall; + if (old_layer==new_layer) return EC_Normal; + return graphicAnnotationList.moveTextObject( + graphicLayerList.getGraphicLayerName(old_layer), + currentImageSOPClassUID, + currentImageSOPInstanceUID, + currentImageSelectedFrame, + idx, + applicability, + graphicLayerList.getGraphicLayerName(new_layer)); +} + +size_t DVPresentationState::getNumberOfGraphicObjects(size_t layer) +{ + if (!currentImage) return 0; + return graphicAnnotationList.getNumberOfGraphicObjects(graphicLayerList.getGraphicLayerName(layer), currentImageSOPInstanceUID, currentImageSelectedFrame); +} + +DVPSGraphicObject *DVPresentationState::getGraphicObject(size_t layer, size_t idx) +{ + if (!currentImage) return NULL; + return graphicAnnotationList.getGraphicObject(graphicLayerList.getGraphicLayerName(layer), currentImageSOPInstanceUID, currentImageSelectedFrame, idx); +} + +DVPSGraphicObject *DVPresentationState::addGraphicObject(size_t layer, DVPSObjectApplicability applicability) +{ + if (!currentImage) return NULL; + return graphicAnnotationList.addGraphicObject(graphicLayerList.getGraphicLayerName(layer), currentImageSOPClassUID, + currentImageSOPInstanceUID, currentImageSelectedFrame, applicability); +} + +OFCondition DVPresentationState::removeGraphicObject(size_t layer, size_t idx) +{ + if (!currentImage) return EC_IllegalCall; + return graphicAnnotationList.removeGraphicObject(graphicLayerList.getGraphicLayerName(layer), currentImageSOPInstanceUID, currentImageSelectedFrame, idx); +} + +OFCondition DVPresentationState::moveGraphicObject(size_t old_layer, size_t idx, size_t new_layer, DVPSObjectApplicability applicability) +{ + if (!currentImage) return EC_IllegalCall; + if (old_layer==new_layer) return EC_Normal; + return graphicAnnotationList.moveGraphicObject( + graphicLayerList.getGraphicLayerName(old_layer), + currentImageSOPClassUID, + currentImageSOPInstanceUID, + currentImageSelectedFrame, + idx, + applicability, + graphicLayerList.getGraphicLayerName(new_layer)); +} + + +DVPSCurve *DVPresentationState::getCurve(size_t layer, size_t idx) +{ + Uint16 rgroup = activationLayerList.getActivationGroup( + graphicLayerList.getGraphicLayerName(layer), idx, OFTrue); + if (rgroup==0) return NULL; + else return currentImageCurveList.getCurveGroup(rgroup); +} + +size_t DVPresentationState::getNumberOfCurvesInImage() +{ + return currentImageCurveList.size(); +} + +DVPSCurve *DVPresentationState::getCurveInImage(size_t idx) +{ + return currentImageCurveList.getCurve(idx); +} + +OFCondition DVPresentationState::addCurve(size_t layer, size_t curveidxinimage) +{ + const char *lname = graphicLayerList.getGraphicLayerName(layer); + DVPSCurve *curve = currentImageCurveList.getCurve(curveidxinimage); + if ((curve==NULL)||(lname==NULL)) return EC_IllegalCall; + return activationLayerList.setActivation(0x5000 + curve->getCurveGroup(), lname); +} + +OFBool DVPresentationState::haveActiveVOIWindow() +{ + DVPSSoftcopyVOI *voi = getCurrentSoftcopyVOI(); + if (voi) + { + if (voi->haveLUT()) return OFFalse; else return OFTrue; + } + return OFFalse; +} + +OFBool DVPresentationState::haveActiveVOILUT() +{ + DVPSSoftcopyVOI *voi = getCurrentSoftcopyVOI(); + if (voi) return voi->haveLUT(); + return OFFalse; +} + +const char *DVPresentationState::getCurrentVOIDescription() +{ + DVPSSoftcopyVOI *voi = getCurrentSoftcopyVOI(); + if (voi) return voi->getCurrentVOIDescription(); + return NULL; +} + +OFCondition DVPresentationState::getCurrentWindowWidth(double &w) +{ + DVPSSoftcopyVOI *voi = getCurrentSoftcopyVOI(); + if (voi) return voi->getCurrentWindowWidth(w); + return EC_IllegalCall; +} + +OFCondition DVPresentationState::getCurrentWindowCenter(double &c) +{ + DVPSSoftcopyVOI *voi = getCurrentSoftcopyVOI(); + if (voi) return voi->getCurrentWindowCenter(c); + return EC_IllegalCall; +} + +size_t DVPresentationState::getNumberOfVOILUTsInImage() +{ + return currentImageVOILUTList.size(); +} + +size_t DVPresentationState::getNumberOfVOIWindowsInImage() +{ + return currentImageVOIWindowList.size(); +} + +const char *DVPresentationState::getDescriptionOfVOILUTsInImage(size_t idx) +{ + DVPSVOILUT *lut = currentImageVOILUTList.getVOILUT(idx); + if (lut==NULL) return NULL; + return lut->getExplanation(); +} + +const char *DVPresentationState::getDescriptionOfVOIWindowsInImage(size_t idx) +{ + DVPSVOIWindow *window = currentImageVOIWindowList.getVOIWindow(idx); + if (window==NULL) return NULL; + return window->getExplanation(); +} + +OFCondition DVPresentationState::setVOILUTFromImage(size_t idx, + DVPSObjectApplicability applicability) +{ + if (currentImage == NULL) return EC_IllegalCall; + + DVPSVOILUT *lut = currentImageVOILUTList.getVOILUT(idx); + if (lut) + { + currentImageVOIValid = OFFalse; // VOI has changed + + DVPSSoftcopyVOI *voi = softcopyVOIList.createSoftcopyVOI( + referencedSeriesList, currentImageSOPClassUID, currentImageSOPInstanceUID, + currentImageSelectedFrame, currentImage->getFrameCount(), applicability); + if (voi) return lut->assign(*voi); + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::setVOIWindowFromImage(size_t idx, + DVPSObjectApplicability applicability) +{ + currentImageVOIValid = OFFalse; // VOI has changed + DVPSVOIWindow *window = currentImageVOIWindowList.getVOIWindow(idx); + if (window) + { + return setVOIWindow(window->getWindowCenter(), + window->getWindowWidth(), window->getExplanation(), applicability); + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::setVOIWindow(double wCenter, double wWidth, const char *description, + DVPSObjectApplicability applicability) +{ + if (currentImage == NULL) return EC_IllegalCall; + currentImageVOIValid = OFFalse; // VOI has changed + DVPSSoftcopyVOI *voi = softcopyVOIList.createSoftcopyVOI( + referencedSeriesList, currentImageSOPClassUID, currentImageSOPInstanceUID, + currentImageSelectedFrame, currentImage->getFrameCount(), applicability); + if (voi) return voi->setVOIWindow(wCenter, wWidth, description); + return EC_IllegalCall; +} + +OFCondition DVPresentationState::setVOILUT( + DcmUnsignedShort& lutDescriptor, + DcmUnsignedShort& lutData, + DcmLongString& lutExplanation, + DVPSObjectApplicability applicability) +{ + if (lutData.getLength() == 0) return EC_IllegalCall; + if (lutDescriptor.getVM() != 3) return EC_IllegalCall; + if (currentImage == NULL) return EC_IllegalCall; + + currentImageVOIValid = OFFalse; // VOI has changed + DVPSSoftcopyVOI *voi = softcopyVOIList.createSoftcopyVOI( + referencedSeriesList, currentImageSOPClassUID, currentImageSOPInstanceUID, + currentImageSelectedFrame, currentImage->getFrameCount(), applicability); + if (voi) return voi->setVOILUT(lutDescriptor, lutData, lutExplanation); + return EC_IllegalCall; +} + +void DVPresentationState::deactivateVOI(DVPSObjectApplicability applicability) +{ + if (currentImage == NULL) return; + currentImageVOIValid = OFFalse; // VOI has changed + softcopyVOIList.removeSoftcopyVOI( + referencedSeriesList, currentImageSOPInstanceUID, + currentImageSelectedFrame, currentImage->getFrameCount(), applicability); + return; +} + +OFCondition DVPresentationState::setGammaVOILUT(double gammaValue, DVPSObjectApplicability applicability) +{ + if (currentImage == NULL) return EC_IllegalCall; + + OFCondition status = EC_IllegalCall; + const unsigned int numberOfBits = 16; + unsigned long numberOfEntries = 0; + signed long firstMapped = 0; + if (haveActiveVOIWindow()) // use active VOI window to specify the LUT descriptor + { + double ww, wc; + if ((getCurrentWindowWidth(ww) == EC_Normal) && (getCurrentWindowCenter(wc) == EC_Normal)) + { + if (ww <= 65536) + { + numberOfEntries = (unsigned long)ww; + firstMapped = (signed long)(wc - ww / 2); + } + } + } + if (numberOfEntries == 0) // no valid VOI window, use whole pixel range + { + double min, max; + if (getImageMinMaxPixelRange(min, max) == EC_Normal) + { + if (max - min < 65536.0) + { + numberOfEntries = (unsigned long)(max - min + 1.0); + firstMapped = (signed long)min; + } + } + } + + if ((numberOfEntries > 0) && (numberOfEntries <= 65536) && + (((firstMapped >= -32768) && (firstMapped <= 32767)) || ((firstMapped >= 0) && (firstMapped <= 65535)))) + { + Uint16 *data = new Uint16[numberOfEntries]; + if (data != NULL) + { + /* calculate gamma curve */ + const Uint16 maxValue = 0xFFFF >> (16 - numberOfBits); + double step = (double)maxValue / ((double)numberOfEntries - 1.0); + double gammaExp = 1.0 / gammaValue; + double factor = (double)maxValue / pow((double)maxValue, gammaExp); + unsigned long i; + for (i = 0; i < numberOfEntries; i++) + data[i]= (Uint16)(factor * pow(i * step, gammaExp)); + + Uint16 numEntries16 = 0; + if (numberOfEntries < 65536) + numEntries16 = (Uint16)numberOfEntries; + + /* LUT Descriptor */ + DcmElement *lutDescriptor = NULL; + if (firstMapped < 0) + { + // LUT Descriptor is SS + lutDescriptor = new DcmSignedShort(DcmTag(DCM_LUTDescriptor, EVR_SS)); + if (lutDescriptor != NULL) + { + status = lutDescriptor->putSint16((Sint16)numEntries16, 0); + if (EC_Normal == status) + status = lutDescriptor->putSint16((Sint16)firstMapped, 1); + if (EC_Normal == status) + status = lutDescriptor->putSint16((Sint16)numberOfBits, 2); + } else + status = EC_MemoryExhausted; + } else { + // LUT Descriptor is US + lutDescriptor = new DcmUnsignedShort(DcmTag(DCM_LUTDescriptor, EVR_US)); + if (lutDescriptor != NULL) + { + status = lutDescriptor->putUint16(numEntries16, 0); + if (EC_Normal == status) + status = lutDescriptor->putUint16((Uint16)firstMapped, 1); + if (EC_Normal == status) + status = lutDescriptor->putUint16((Uint16)numberOfBits, 2); + } else + status = EC_MemoryExhausted; + } + + /* LUT Data */ + DcmElement *lutData = NULL; + if (status == EC_Normal) + { + // LUT Data as OW, because of max size = 64K + lutData = new DcmOtherByteOtherWord(DcmTag(DCM_LUTData, EVR_OW)); + if (lutData != NULL) + status = lutData->putUint16Array(data, numberOfEntries); + else + status = EC_MemoryExhausted; + } + + /* LUT Explanation */ + DcmLongString *lutExplanation = NULL; + if (status == EC_Normal) + { + char explanation[100]; + char gammabuf[16]; + OFStandard::ftoa(gammabuf, sizeof(gammabuf), gammaValue, OFStandard::ftoa_format_f, 3, 1); + + sprintf(explanation, "LUT with gamma %s, descriptor %u/%ld/%u", gammabuf, + (numberOfEntries < 65536) ? (Uint16)numberOfEntries : 0, firstMapped, numberOfBits); + + lutExplanation = new DcmLongString(DCM_LUTExplanation); + if (lutExplanation != NULL) + status = lutExplanation->putString(explanation); + else + status = EC_MemoryExhausted; + } + + /* set VOI LUT */ + if (status == EC_Normal) + { + if ((lutDescriptor != NULL) && (lutData != NULL) && (lutExplanation != NULL)) + status = setVOILUT(*(DcmUnsignedShort *)lutDescriptor, *(DcmUnsignedShort *)lutData, *lutExplanation, applicability); + } + + /* delete temporary dcmtk structures */ + delete lutDescriptor; + delete lutData; + delete lutExplanation; + } else + status = EC_MemoryExhausted; + delete[] data; + } + return status; +} + + +const char *DVPresentationState::getActiveOverlayLabel(size_t layer, size_t idx) +{ + Uint16 group = getActiveOverlayGroup(layer, idx); + if (group==0) return NULL; + DVPSOverlay *internalOverlay = overlayList.getOverlayGroup(group); + if (internalOverlay) return internalOverlay->getOverlayLabel(); + if (currentImage) return currentImage->getOverlayLabel(group); + return NULL; +} + +const char *DVPresentationState::getActiveOverlayDescription(size_t layer, size_t idx) +{ + Uint16 group = getActiveOverlayGroup(layer, idx); + if (group==0) return NULL; + DVPSOverlay *internalOverlay = overlayList.getOverlayGroup(group); + if (internalOverlay) return internalOverlay->getOverlayDescription(); + if (currentImage) return currentImage->getOverlayDescription(group); + return NULL; +} + +OFBool DVPresentationState::activeOverlayIsROI(size_t layer, size_t idx) +{ + Uint16 group = getActiveOverlayGroup(layer, idx); + if (group==0) return OFFalse; + DVPSOverlay *internalOverlay = overlayList.getOverlayGroup(group); + if (internalOverlay) return internalOverlay->isROI(); + if ((currentImage)&&(EMO_RegionOfInterest == currentImage->getOverlayMode(group))) return OFTrue; + return OFFalse; +} + +size_t DVPresentationState::getNumberOfOverlaysInImage() +{ + if (currentImage == NULL) return 0; + + unsigned int numOverlays=currentImage->getOverlayCount(); + size_t result = (size_t) numOverlays; + Uint16 group; + for (unsigned int i=0; igetOverlayGroupNumber(i)); + if ((group==0)||(overlayList.haveOverlayGroup(group))) result--; + } + return result; +} + + +Uint16 DVPresentationState::getOverlayInImageGroup(size_t idx) +{ + if (currentImage == NULL) return 0; + + size_t currentIndex = 0; + Uint16 group; + do + { + group = (Uint16) (currentImage->getOverlayGroupNumber(OFstatic_cast(Uint32, currentIndex++))); + if (!overlayList.haveOverlayGroup(group)) + { + // group is not shadowed by the presentation state + if (idx==0) return group; else idx--; + } + } while (group != 0); + return 0; +} + + +const char *DVPresentationState::getOverlayInImageLabel(size_t idx) +{ + Uint16 group = getOverlayInImageGroup(idx); // returns 0 if currentImage==NULL + if (group==0) return NULL; else return currentImage->getOverlayLabel(group); +} + + +const char *DVPresentationState::getOverlayInImageDescription(size_t idx) +{ + Uint16 group = getOverlayInImageGroup(idx); // returns 0 if currentImage==NULL + if (group==0) return NULL; else return currentImage->getOverlayDescription(group); +} + + +size_t DVPresentationState::getOverlayInImageActivationLayer(size_t idx) +{ + Uint16 group = getOverlayInImageGroup(idx); // returns 0 if currentImage==NULL + if (group==0) return DVPS_IDX_NONE; + const char *layerName = activationLayerList.getActivationLayer(group); + if (layerName) return graphicLayerList.getGraphicLayerIndex(layerName); + else return DVPS_IDX_NONE; +} + + +OFBool DVPresentationState::overlayInImageIsROI(size_t idx) +{ + Uint16 group = getOverlayInImageGroup(idx); // returns 0 if currentImage==NULL + if (group==0) return OFFalse; + if (EMO_RegionOfInterest == currentImage->getOverlayMode(group)) return OFTrue; + else return OFFalse; +} + +OFCondition DVPresentationState::removeOverlayFromPresentationState(size_t idx) +{ + Uint16 group = getOverlayInPresentationStateGroup(idx); + if (group != 0) + { + activationLayerList.removeActivation(group); + currentImageOverlaysValid = 1; // invalid but nothing added + return overlayList.removeOverlay(idx); + } + return EC_IllegalCall; // overlay does not exist +} + + +Uint16 DVPresentationState::findOverlayGroup(Uint16 currentGroup) +{ + int allocated[16]; + size_t i, max; + Uint16 group = 0; + + for (i=0; i<16; i++) allocated[i]=0; + max = overlayList.size(); + for (i=0; i= 0x6000)&&(group <= 0x601F)) allocated[(Uint16)(group - 0x6000) >> 1] = 2; + } + max = getNumberOfOverlaysInImage(); + for (i=0; i= 0x6000)&&(group <= 0x601F)) allocated[(Uint16)(group - 0x6000) >> 1] += 1; + } + // now we have 0=unused, 1=used in image, 2=used in pstate, 3=used in both. + + // check if the current group can be left unchanged + if ((currentGroup >= 0x6000)&&(currentGroup <= 0x601F)) + { + if (allocated[(Uint16)(group - 0x6000) >> 1] == 2) return currentGroup; + } + // find a free group + for (i=0; i<16; i++) if (allocated[i]==0) return OFstatic_cast(Uint16, 0x6000+(i<<1)); + // find a group not used in the presentation state + for (i=0; i<16; i++) if (allocated[i]<2) return OFstatic_cast(Uint16, 0x6000+(i<<1)); + // not found. + return 0; +} + +OFCondition DVPresentationState::changeOverlayGroupInPresentationState(size_t idx, Uint16 newGroup) +{ + Uint16 group = getOverlayInPresentationStateGroup(idx); + if (group != 0) + { + if (newGroup==0) newGroup = findOverlayGroup(group); + if (newGroup==group) return EC_Normal; // shortcut - no change needed + OFCondition result = overlayList.changeOverlayGroup(idx, newGroup); + if (EC_Normal == result) + { + const char *layerName = activationLayerList.getActivationLayer(group); + if (layerName) + { + activationLayerList.removeActivation(group); + result = activationLayerList.setActivation(newGroup, layerName); + currentImageOverlaysValid = 0; // invalid + } + } + return result; + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::addOverlayToPresentationState(DcmItem& overlayIOD, Uint16 groupInItem, Uint16 newGroup) +{ + if (newGroup==0) newGroup = findOverlayGroup(); + if (newGroup==0) return EC_IllegalCall; // no group number available + return overlayList.addOverlay(overlayIOD, groupInItem, newGroup); +} + +OFBool DVPresentationState::overlayIsSuitableAsBitmapShutter(size_t idx) +{ + if (currentImage) + { + DVPSOverlay *overlay = overlayList.getOverlay(idx); + if (overlay) + { + return overlay->isSuitableAsShutter(currentImage->getWidth(), currentImage->getHeight()); + } + } + return OFFalse; +} + +OFCondition DVPresentationState::activateOverlayInImage(size_t layer, size_t idx) +{ + Uint16 group = getOverlayInImageGroup(idx); + if (group==0) return EC_IllegalCall; + if (activationLayerList.getActivationLayer(group) != NULL) return EC_IllegalCall; //already activated + + const char *layerName = getGraphicLayerName(layer); + if (layerName==NULL) return EC_IllegalCall; + currentImageOverlaysValid = 1; // invalid but nothing (external) added + return activationLayerList.setActivation(group, layerName); +} + +OFCondition DVPresentationState::activateOverlayInPresentationState(size_t layer, size_t idx) +{ + Uint16 group = getOverlayInPresentationStateGroup(idx); + if (group==0) return EC_IllegalCall; + if (activationLayerList.getActivationLayer(group) != NULL) return EC_IllegalCall; //already activated + if (haveShutter(DVPSU_bitmap)) + { // check if the overlay is used as the bitmap shutter + Uint16 shutterGroup=0; + shutterOverlayGroup.getUint16(shutterGroup,0); + if (shutterGroup == group) return EC_IllegalCall; // used as bitmap shutter + } + const char *layerName = getGraphicLayerName(layer); + if (layerName==NULL) return EC_IllegalCall; + currentImageOverlaysValid = 0; // invalid + return activationLayerList.setActivation(group, layerName); +} + +OFCondition DVPresentationState::activateOverlayAsBitmapShutter(size_t idx) +{ + Uint16 group = getOverlayInPresentationStateGroup(idx); + if (group==0) return EC_IllegalCall; + if (activationLayerList.getActivationLayer(group) != NULL) return EC_IllegalCall; // activated as overlay + if (overlayIsSuitableAsBitmapShutter(idx)) + { + shutterOverlayGroup.clear(); + OFCondition result = shutterOverlayGroup.putUint16(group,0); + if ((EC_Normal==result)&&(shutterPresentationValue.getLength()==0)) + result = shutterPresentationValue.putUint16(0,0); + if (EC_Normal==result) + { + useShutterRectangular = OFFalse; + useShutterCircular = OFFalse; + useShutterPolygonal = OFFalse; + useShutterBitmap = OFTrue; + currentImageOverlaysValid = 0; // invalid + } + return result; + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::deactivateOverlay(size_t layer, size_t idx) +{ + Uint16 group = activationLayerList.getActivationGroup( + graphicLayerList.getGraphicLayerName(layer), idx, OFFalse); + if (group == 0) return EC_IllegalCall; + activationLayerList.removeActivation(group); + currentImageOverlaysValid = 1; // invalid but nothing added + return EC_Normal; +} + +Uint16 DVPresentationState::convertPValueToDDL(Uint16 pvalue, unsigned int bits) +{ + Uint16 result = 0; + if ((bits == 8) || (bits == 12)) + { + if (currentImage && (bits == 8)) + { + /* activate display transform */ + if (displayFunction && (displayTransform != DVPSD_none)) + currentImage->setDisplayFunction(displayFunction[displayTransform]); + else + currentImage->setNoDisplayFunction(); + currentImage->convertPValueToDDL(pvalue, result, bits /* 8 */); + } else + result = (pvalue >> (16 - bits)); + } + return result; +} + + +void DVPresentationState::renderPixelData(OFBool display) +{ + if (currentImage == NULL) return; + int result=0; + + /* activate Barten transform */ + if (displayFunction && (displayTransform != DVPSD_none) && display) + { + currentImage->setDisplayFunction(displayFunction[displayTransform]); + if (previewImage != NULL) + previewImage->setDisplayFunction(displayFunction[displayTransform]); + } else { + currentImage->setNoDisplayFunction(); + if (previewImage != NULL) + previewImage->setNoDisplayFunction(); + } + + if (! currentImageVOIValid) + { + currentImageVOIValid = OFTrue; + + /* set VOI transformation */ + DVPSSoftcopyVOI *voi = getCurrentSoftcopyVOI(); + if (voi) + { + if (voi->haveLUT()) + { + result = currentImage->setVoiLut(voi->getLUTData(), voi->getLUTDescriptor()); + if (previewImage != NULL) + previewImage->setVoiLut(voi->getLUTData(), voi->getLUTDescriptor()); + } else { + double wc=0.0, ww=0.0; + if ((EC_Normal == voi->getCurrentWindowCenter(wc)) && + (EC_Normal == voi->getCurrentWindowWidth(ww))) + { + result = currentImage->setWindow(wc, ww); + if (previewImage != NULL) + previewImage->setWindow(wc, ww); + } else { + result = currentImage->setNoVoiTransformation(); + if (previewImage != NULL) + previewImage->setNoVoiTransformation(); + } + } + } else { + result = currentImage->setNoVoiTransformation(); + if (previewImage != NULL) + previewImage->setNoVoiTransformation(); + } + if (!result) + DCMPSTAT_WARN("unable to set VOI transformation, ignoring."); + } /* VOI transform */ + + if (! currentImagePLUTValid) + { + presentationLUT.activate(currentImage); + if (previewImage != NULL) + presentationLUT.activate(previewImage); + currentImagePLUTValid = OFTrue; + } /* Presentation LUT */ + + Uint16 bitmapShutterGroup = 0; + Uint16 bitmapShutterPValue = 0; + if (useShutterBitmap) + { + if (EC_Normal != shutterOverlayGroup.getUint16(bitmapShutterGroup, 0)) bitmapShutterGroup=0; + if (EC_Normal != shutterPresentationValue.getUint16(bitmapShutterPValue, 0)) bitmapShutterPValue=0; + } + + if (currentImageOverlaysValid==1) + { + /* overlays are invalid but no external overlays have been added */ + /* remove all external overlays that are not active as overlay or bitmap shutter */ + for (unsigned int remgroup=0x6000; remgroup <= 0x601F; remgroup += 2) + { + if ((remgroup != bitmapShutterGroup)&&((! overlayList.haveOverlayGroup(remgroup))|| + (NULL == activationLayerList.getActivationLayer(remgroup)))) + { + currentImage->removeOverlay(remgroup); // ignore return value. + } + } + currentImageOverlaysValid = 2; // valid + } + else if (currentImageOverlaysValid==0) + { + /* overlays are invalid */ + + /* since we might be required to add external overlays, we first + * need to flip the image back to its original rotation and flip state + */ + if (currentImageFlip) + { + result = currentImage->flipImage(); + if (previewImage != NULL) previewImage->flipImage(); + if (!result) + DCMPSTAT_WARN("unable to flip image horizontally, ignoring."); + currentImageFlip = OFFalse; + } + signed int srot=0; + switch(currentImageRotation) + { + case DVPSR_0_deg: break; + case DVPSR_90_deg: srot=270; break; + case DVPSR_180_deg: srot=180; break; + case DVPSR_270_deg: srot=90; break; + } + if (srot != 0) + { + result = currentImage->rotateImage(srot); + if (previewImage != NULL) + previewImage->rotateImage(srot); + if (!result) + DCMPSTAT_WARN("unable to rotate image by " << srot << " degrees, ignoring."); + } + currentImageRotation = DVPSR_0_deg; + + // deactivate all overlays first + result = currentImage->removeAllOverlays(); + if (!result) + DCMPSTAT_WARN("unable to disable external overlays, ignoring."); + + size_t numOverlays = overlayList.size(); + DVPSOverlay *overlay = NULL; + Uint16 ovgroup; + for (size_t ovidx=0; ovidxgetOverlayGroup()+ 0x6000; + if (NULL != activationLayerList.getActivationLayer(ovgroup)) + { + if (activateOverlayHelper(*overlay, *currentImage).bad()) + { + if (!result) + DCMPSTAT_WARN("unable to set external overlay group 0x" + << STD_NAMESPACE hex << ovgroup << STD_NAMESPACE dec << ", ignoring."); + } + } + else if ((useShutterBitmap)&&(ovgroup == bitmapShutterGroup)) + { + //activate bitmap overlay + if (activateOverlayHelper(*overlay, *currentImage, OFTrue, bitmapShutterPValue).bad()) + { + if (!result) + DCMPSTAT_WARN("unable to activate bitmap shutter 0x" + << STD_NAMESPACE hex << ovgroup << STD_NAMESPACE dec << ", ignoring."); + } + } + } + } + currentImageOverlaysValid = 2; // valid + } + + OFBool pstateFlip = getFlip(); + DVPSRotationType pstateRotation = getRotation(); + + // store image width and height after application of rotation + if ((pstateRotation == DVPSR_90_deg) || (pstateRotation == DVPSR_270_deg)) + { + renderedImageWidth = currentImageHeight; + renderedImageHeight = currentImageWidth; + } else { + renderedImageWidth = currentImageWidth; + renderedImageHeight = currentImageHeight; + } + + // get coordinates of current displayed area and store values after the + // 'virtual' anti-rotation has been applied + Sint32 tlhcX = 1; + Sint32 tlhcY = 1; + Sint32 brhcX = currentImageWidth; + Sint32 brhcY = currentImageHeight; + getImageRelativeDisplayedArea(tlhcX, tlhcY, brhcX, brhcY); + if (tlhcX > brhcX) + { // swap 'left' and 'right' if necessary + Sint32 tmp = tlhcX; + tlhcX = brhcX; + brhcX = tmp; + } + if (tlhcY > brhcY) + { // swap 'top' and 'bottom' if necessary + Sint32 tmp = tlhcY; + tlhcY = brhcY; + brhcY = tmp; + } + switch (pstateRotation) + { + case DVPSR_0_deg: + renderedImageTop = tlhcY; + renderedImageLeft = tlhcX; + renderedImageBottom = brhcY; + renderedImageRight = brhcX; + break; + case DVPSR_90_deg: + renderedImageTop = tlhcX; + renderedImageLeft = (signed long)currentImageHeight - brhcY + 1; + renderedImageBottom = brhcX; + renderedImageRight = (signed long)currentImageHeight - tlhcY + 1; + break; + case DVPSR_180_deg: + renderedImageTop = (signed long)currentImageHeight - brhcY + 1; + renderedImageLeft = (signed long)currentImageWidth - brhcX + 1; + renderedImageBottom = (signed long)currentImageHeight - tlhcY + 1; + renderedImageRight = (signed long)currentImageWidth - tlhcX + 1; + break; + case DVPSR_270_deg: + renderedImageTop = (signed long)currentImageWidth - brhcX + 1; + renderedImageLeft = tlhcY; + renderedImageBottom = (signed long)currentImageWidth - tlhcX + 1; + renderedImageRight = brhcY; + break; + } + if (pstateFlip) + { + signed long tmp = renderedImageLeft; + renderedImageLeft = (signed long)renderedImageWidth - renderedImageRight + 1; + renderedImageRight = (signed long)renderedImageWidth - tmp + 1; + } + + // we can always reach the final rotation/flip status with + // at most one rotation and one flip. The following formula + // derives the operations to perform. + OFBool flp=OFFalse; + if ((pstateFlip && !currentImageFlip)||(!pstateFlip && currentImageFlip)) flp=OFTrue; else flp=OFFalse; + + signed int rot=0; + switch (pstateRotation) + { + case DVPSR_0_deg: + switch(currentImageRotation) + { + case DVPSR_0_deg: rot=0; break; + case DVPSR_90_deg: if (currentImageFlip) rot=90; else rot=270; break; + case DVPSR_180_deg: rot=180; break; + case DVPSR_270_deg: if (currentImageFlip) rot=270; else rot=90; break; + } + break; + case DVPSR_90_deg: + switch(currentImageRotation) + { + case DVPSR_0_deg: if (currentImageFlip) rot=270; else rot=90; break; + case DVPSR_90_deg: rot=0; break; + case DVPSR_180_deg: if (currentImageFlip) rot=90; else rot=270; break; + case DVPSR_270_deg: rot=180; break; + } + break; + case DVPSR_180_deg: + switch(currentImageRotation) + { + case DVPSR_0_deg: rot=180; break; + case DVPSR_90_deg: if (currentImageFlip) rot=270; else rot=90; break; + case DVPSR_180_deg: rot=0; break; + case DVPSR_270_deg: if (currentImageFlip) rot=90; else rot=270; break; + } + break; + case DVPSR_270_deg: + switch(currentImageRotation) + { + case DVPSR_0_deg: if (currentImageFlip) rot=90; else rot=270; break; + case DVPSR_90_deg: rot=180; break; + case DVPSR_180_deg: if (currentImageFlip) rot=270; else rot=90; break; + case DVPSR_270_deg: rot=0; break; + } + break; + } + + if (rot != 0) + { + result = currentImage->rotateImage(rot); + if (previewImage != NULL) previewImage->rotateImage(rot); + if (!result) + DCMPSTAT_WARN("unable to rotate image by " << rot << " degrees, ignoring."); + } + + if (flp) + { + result = currentImage->flipImage(); + if (previewImage != NULL) previewImage->flipImage(); + if (!result) + DCMPSTAT_WARN("unable to flip image horizontally, ignoring."); + } + + currentImageRotation = pstateRotation; + currentImageFlip = pstateFlip; + + return; +} + + +OFCondition DVPresentationState::getOverlayData( + size_t layer, + size_t idx, + const void *&overlayData, + unsigned int &width, + unsigned int &height, + unsigned int &left_pos, + unsigned int &top_pos, + OFBool &isROI, + Uint16 &fore, + unsigned int bits) +{ + EM_Overlay mode = EMO_Default; + if (currentImage && ((bits == 8) || (bits == 12))) + { + renderPixelData(); + Uint16 group = activationLayerList.getActivationGroup(graphicLayerList.getGraphicLayerName(layer), idx, OFFalse); + if (group==0) return EC_IllegalCall; + Uint16 back = 0; + fore = (Uint16)DicomImageClass::maxval(bits); /* 255 or 4095 */ + Uint16 pvalue = 65535; + if (graphicLayerList.getGraphicLayerRecommendedDisplayValueGray(layer, pvalue) == EC_Normal) + currentImage->convertPValueToDDL(pvalue, fore, bits); + if (fore == 0) + back = (Uint16)DicomImageClass::maxval(bits); + const void *data = currentImage->getOverlayData((unsigned int)group, left_pos, top_pos, width, height, mode, + currentImageSelectedFrame-1, bits, fore, back); + if (EMO_RegionOfInterest == mode) isROI=OFTrue; else isROI=OFFalse; + if (data) overlayData = data; + else + { + overlayData = NULL; + return EC_IllegalCall; + } + } else { + overlayData = NULL; + width = 0; + height = 0; + left_pos = 0; + top_pos = 0; + isROI = OFFalse; + fore = 0; + return EC_IllegalCall; + } + return EC_Normal; +} + +OFBool DVPresentationState::isInverse() +{ + return imageInverse; +} + +OFCondition DVPresentationState::invertImage() +{ + OFCondition status = presentationLUT.invert(); + currentImagePLUTValid = OFFalse; // PLUT has changed + imageInverse = (imageInverse ? OFFalse : OFTrue); + return status; +} + + +OFCondition DVPresentationState::getPixelData( + const void *&pixelData, + unsigned long &width, + unsigned long &height) +{ + if (currentImage) + { + renderPixelData(); + width = currentImage->getWidth(); + height = currentImage->getHeight(); + pixelData = currentImage->getOutputData(8, currentImageSelectedFrame-1); + } else { + pixelData = NULL; + width = 0; + height = 0; + return EC_IllegalCall; + } + return EC_Normal; +} + +OFCondition DVPresentationState::getPixelData( + void *pixelData, + unsigned long size) +{ + if (currentImage) + { + renderPixelData(); + if (currentImage->getOutputData(pixelData, size, 8, currentImageSelectedFrame-1)) + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::getImageMinMaxPixelRange(double &minValue, double& maxValue) +{ + OFCondition result = EC_IllegalCall; + if (currentImage) + { + if (currentImage->getMinMaxValues(minValue, maxValue, 1)) result = EC_Normal; + } + return result; +} + +OFCondition DVPresentationState::getImageMinMaxPixelValue(double &minValue, double& maxValue) +{ + OFCondition result = EC_IllegalCall; + if (currentImage) + { + if (currentImage->getMinMaxValues(minValue, maxValue, 0)) result = EC_Normal; + } + return result; +} + +OFCondition DVPresentationState::getImageNumberOfFrames(unsigned long &frames) +{ + if (currentImage) + { + frames = (unsigned long)(currentImage->getFrameCount()); + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::selectImageFrameNumber(unsigned long frame) +{ + if ((frame > 0) && currentImage && (frame <= currentImage->getFrameCount())) + { + if (currentImageSelectedFrame != frame) + currentImageVOIValid = OFFalse; // VOI might has changed + currentImageSelectedFrame=frame; + return EC_Normal; + } + return EC_IllegalCall; +} + +unsigned long DVPresentationState::getSelectedImageFrameNumber() +{ + if (currentImage) + { + if (currentImageSelectedFrame <= currentImage->getFrameCount()) + return currentImageSelectedFrame; + } + return 0; +} + +DVPSDisplayedArea *DVPresentationState::getDisplayedAreaSelection() +{ + if (currentImage==NULL) return NULL; + DVPSDisplayedArea * area = displayedAreaSelectionList.findDisplayedArea(currentImageSOPInstanceUID, currentImageSelectedFrame); + if (area==NULL) + { + DCMPSTAT_WARN("no displayed area selection item for current image found, creating default."); + if ((currentImageDataset)&&(EC_Normal == createDefaultDisplayedArea(*currentImageDataset))) + { + area = displayedAreaSelectionList.findDisplayedArea(currentImageSOPInstanceUID, currentImageSelectedFrame); + } + } + return area; +} + +DVPSPresentationSizeMode DVPresentationState::getDisplayedAreaPresentationSizeMode() +{ + DVPSDisplayedArea * area = getDisplayedAreaSelection(); + if (area) return area->getPresentationSizeMode(); else return DVPSD_scaleToFit; +} + +double DVPresentationState::getDisplayedAreaPresentationPixelAspectRatio() +{ + DVPSDisplayedArea * area = getDisplayedAreaSelection(); + if (area) return area->getPresentationPixelAspectRatio(); else return 1.0; +} + +OFCondition DVPresentationState::getStandardDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY) +{ + DVPSDisplayedArea * area = getDisplayedAreaSelection(); + if (area) + { + area->getDisplayedArea(tlhcX, tlhcY, brhcX, brhcY); + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::getImageRelativeDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY) +{ + DVPSDisplayedArea * area = getDisplayedAreaSelection(); + if (area) + { + DVPSRotationType rotation = getRotation(); + OFBool flip = getFlip(); + area = area->clone(); // create temporary copy + area->rotateAndFlip(rotation, flip, DVPSR_0_deg, OFFalse); + area->getDisplayedArea(tlhcX, tlhcY, brhcX, brhcY); + delete area; + return EC_Normal; + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::getDisplayedAreaPresentationPixelSpacing(double& x, double& y) +{ + DVPSDisplayedArea * area = getDisplayedAreaSelection(); + if (area) return area->getPresentationPixelSpacing(x, y); else return EC_IllegalCall; +} + +OFCondition DVPresentationState::getDisplayedAreaPresentationPixelMagnificationRatio(double& magnification) +{ + DVPSDisplayedArea * area = getDisplayedAreaSelection(); + if (area) return area->getPresentationPixelMagnificationRatio(magnification); else return EC_IllegalCall; +} + +OFBool DVPresentationState::canUseDisplayedAreaTrueSize() +{ + DVPSDisplayedArea * area = getDisplayedAreaSelection(); + if (area) return area->canUseTrueSize(); else return OFFalse; +} + +OFCondition DVPresentationState::setStandardDisplayedArea( + DVPSPresentationSizeMode sizeMode, + Sint32 tlhcX, Sint32 tlhcY, + Sint32 brhcX, Sint32 brhcY, + double magnification, + DVPSObjectApplicability applicability) +{ + if (currentImage == NULL) return EC_IllegalCall; + + // make sure that we have an old displayed area item that "knows" about pixel spacing/aspect ratio, + // because we will only copy this data into the new item. + DVPSDisplayedArea *area = getDisplayedAreaSelection(); + + // find appropriate item, create new if necessary. + area = displayedAreaSelectionList.createDisplayedArea( + referencedSeriesList, currentImageSOPClassUID, currentImageSOPInstanceUID, + currentImageSelectedFrame, currentImage->getFrameCount(), applicability); + + if (area) return area->setDisplayedArea(sizeMode, tlhcX, tlhcY, brhcX, brhcY, magnification); + return EC_IllegalCall; +} + +OFCondition DVPresentationState::setImageRelativeDisplayedArea( + DVPSPresentationSizeMode sizeMode, + Sint32 tlhcX, Sint32 tlhcY, + Sint32 brhcX, Sint32 brhcY, + double magnification, + DVPSObjectApplicability applicability) +{ + if (currentImage == NULL) return EC_IllegalCall; + + // make sure that we have an old displayed area item that "knows" about pixel spacing/aspect ratio, + // because we will only copy this data into the new item. + DVPSDisplayedArea *area = getDisplayedAreaSelection(); + + // find appropriate item, create new if necessary. + area = displayedAreaSelectionList.createDisplayedArea( + referencedSeriesList, currentImageSOPClassUID, currentImageSOPInstanceUID, + currentImageSelectedFrame, currentImage->getFrameCount(), applicability); + + if (area) + { + // get current rotation and flip status + DVPSRotationType rotation = getRotation(); + OFBool flip = getFlip(); + + // force rotation and flip status back to unrotated/unflipped + // because in this case standard displayed area and image relative displayed area are the same + area->rotateAndFlip(rotation, flip, DVPSR_0_deg, OFFalse); + + // set displayed area + OFCondition result = area->setDisplayedArea(sizeMode, tlhcX, tlhcY, brhcX, brhcY, magnification); + + // restore rotation and flip status + area->rotateAndFlip(DVPSR_0_deg, OFFalse, rotation, flip); + + return result; + } + return EC_IllegalCall; +} + + +DVPSSoftcopyVOI *DVPresentationState::getCurrentSoftcopyVOI() +{ + if (currentImage==NULL) return NULL; + return softcopyVOIList.findSoftcopyVOI(currentImageSOPInstanceUID, currentImageSelectedFrame); +} + +OFCondition DVPresentationState::getPrintBitmapRequestedImageSize(OFString& requestedImageSize) +{ + requestedImageSize.clear(); + if ((currentImage)&&(getDisplayedAreaPresentationSizeMode()==DVPSD_trueSize)) + { + double x=0.0, y=0.0; + if (EC_Normal == getDisplayedAreaPresentationPixelSpacing(x, y)) + { + char c[80]; + DVPSRotationType rotation = getRotation(); + if ((rotation==DVPSR_90_deg)||(rotation==DVPSR_270_deg)) + { + x = y * currentImageHeight; // physical height of unrotated image in mm + } else { + x *= currentImageWidth; // physical width of unrotated image in mm + } + OFStandard::ftoa(c, sizeof(c), x, OFStandard::ftoa_format_f); + + requestedImageSize = c; + return EC_Normal; + } + } + return EC_IllegalCall; +} + +OFCondition DVPresentationState::writePresentationLUTforPrint(DcmItem &dset) +{ + OFCondition result = EC_Normal; + if (currentImageMonochrome1) + { + // write inverted LUT because image is also converted to MONOCHROME2 + presentationLUT.invert(); + if (EC_Normal==result) result = presentationLUT.write(dset, OFFalse); + presentationLUT.invert(); + } else result = presentationLUT.write(dset, OFFalse); + return result; +} + +const char *DVPresentationState::getCurrentImageModality() +{ + char *c = NULL; + if (EC_Normal == currentImageModality.getString(c)) return c; else return NULL; +} + +const char *DVPresentationState::getAttachedImageSOPClassUID() +{ + return currentImageSOPClassUID; +} + + +const char *DVPresentationState::getAttachedImageSOPInstanceUID() +{ + return currentImageSOPInstanceUID; +} + + +OFCondition DVPresentationState::activateOverlayHelper(DVPSOverlay& ovl, DicomImage &image, OFBool asShutter, Uint16 pvalue) +{ + Sint16 originX=0; + Sint16 originY=0; + Uint16 sizeX=0; + Uint16 sizeY=0; + unsigned int group = ovl.getOverlayGroup() + 0x6000; + EM_Overlay mode=EMO_Graphic; + if (asShutter) mode=EMO_BitmapShutter; else if (ovl.isROI()) mode=EMO_RegionOfInterest; + + OFCondition result = ovl.getValues(originX, originY, sizeX, sizeY); + if (result.good()) + { + signed int left_pos = (signed int) originX; + signed int top_pos = (signed int) originY; + unsigned int columns = (unsigned int)sizeX; + unsigned int rows = (unsigned int)sizeY; + if (0 == image.addOverlay(group, left_pos, top_pos, columns, rows, + ovl.getData(), ovl.getLabel(), ovl.getDescription(), mode)) + result = EC_IllegalCall; + if ((asShutter)&&(EC_Normal==result)) + { + if (0 == image.showOverlay(group, pvalue)) result = EC_IllegalCall; + } + } + return result; +} + +OFCondition DVPresentationState::read(DcmItem &dset) +{ + OFCondition result = DcmPresentationState::read(dset); + imageInverse = presentationLUT.isInverse(); + return result; +} + +OFCondition DVPresentationState::createFromImage( + DcmItem &dset, + DVPSoverlayActivation overlayActivation, + DVPSVOIActivation voiActivation, + OFBool curveActivation, + OFBool shutterActivation, + OFBool presentationActivation, + DVPSGraphicLayering layering, + const char *aetitle, + const char *filesetID, + const char *filesetUID) +{ + OFCondition result = DcmPresentationState::createFromImage( + dset, overlayActivation, voiActivation, curveActivation, shutterActivation, + presentationActivation, layering, aetitle, filesetID, filesetUID); + imageInverse = presentationLUT.isInverse(); + return result; +} diff --git a/dcmpstat/libsrc/dvpstx.cc b/dcmpstat/libsrc/dvpstx.cc new file mode 100644 index 00000000..639d3551 --- /dev/null +++ b/dcmpstat/libsrc/dvpstx.cc @@ -0,0 +1,415 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSTextObject + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstx.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + + +/* --------------- class DVPSTextObject --------------- */ + +DVPSTextObject::DVPSTextObject() +: boundingBoxAnnotationUnits(DCM_BoundingBoxAnnotationUnits) +, anchorPointAnnotationUnits(DCM_AnchorPointAnnotationUnits) +, unformattedTextValue(DCM_UnformattedTextValue) +, boundingBoxTLHC(DCM_BoundingBoxTopLeftHandCorner) +, boundingBoxBRHC(DCM_BoundingBoxBottomRightHandCorner) +, boundingBoxTextHorizontalJustification(DCM_BoundingBoxTextHorizontalJustification) +, anchorPoint(DCM_AnchorPoint) +, anchorPointVisibility(DCM_AnchorPointVisibility) +{ +} + +DVPSTextObject::DVPSTextObject(const DVPSTextObject& copy) +: boundingBoxAnnotationUnits(copy.boundingBoxAnnotationUnits) +, anchorPointAnnotationUnits(copy.anchorPointAnnotationUnits) +, unformattedTextValue(copy.unformattedTextValue) +, boundingBoxTLHC(copy.boundingBoxTLHC) +, boundingBoxBRHC(copy.boundingBoxBRHC) +, boundingBoxTextHorizontalJustification(copy.boundingBoxTextHorizontalJustification) +, anchorPoint(copy.anchorPoint) +, anchorPointVisibility(copy.anchorPointVisibility) +{ +} + +DVPSTextObject::~DVPSTextObject() +{ +} + +OFCondition DVPSTextObject::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + READ_FROM_DATASET(DcmCodeString, EVR_CS, boundingBoxAnnotationUnits) + READ_FROM_DATASET(DcmCodeString, EVR_CS, anchorPointAnnotationUnits) + READ_FROM_DATASET(DcmShortText, EVR_ST, unformattedTextValue) + READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, boundingBoxTLHC) + READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, boundingBoxBRHC) + READ_FROM_DATASET(DcmCodeString, EVR_CS, boundingBoxTextHorizontalJustification) + READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, anchorPoint) + READ_FROM_DATASET(DcmCodeString, EVR_CS, anchorPointVisibility) + + /* Now perform basic sanity checks */ + + if (unformattedTextValue.getLength() == 0) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with unformattedTextValue absent or empty"); + } + else if (unformattedTextValue.getVM() != 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with unformattedTextValue VM != 1"); + } + + if (boundingBoxAnnotationUnits.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with boundingBoxAnnotationUnits VM > 1"); + } + + if (anchorPointAnnotationUnits.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with anchorPointAnnotationUnits VM > 1"); + } + + if (anchorPointVisibility.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with anchorPointVisibility VM > 1"); + } + + if (boundingBoxTLHC.getVM() ==1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with boundingBoxTLHC VM == 1"); + } + else if (boundingBoxTLHC.getVM() > 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with boundingBoxTLHC VM > 2"); + } + + if (boundingBoxBRHC.getVM() ==1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with boundingBoxBRHC VM == 1"); + } + else if (boundingBoxBRHC.getVM() > 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with boundingBoxBRHC VM > 2"); + } + + if (boundingBoxTextHorizontalJustification.getVM() > 1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with boundingBoxTextHorizontalJustification VM > 1"); + } + + if (anchorPoint.getVM() ==1) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with anchorPoint VM == 1"); + } + else if (anchorPoint.getVM() > 2) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with anchorPoint VM > 2"); + } + + /* test for the various type 1c conditions */ + + if ((boundingBoxAnnotationUnits.getVM() == 0) + && ((boundingBoxTLHC.getVM() >0) || (boundingBoxBRHC.getVM() >0))) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with bounding box but boundingBoxAnnotationUnits absent or empty"); + } + + if ((boundingBoxTextHorizontalJustification.getVM() == 0) + && ((boundingBoxTLHC.getVM() >0) || (boundingBoxBRHC.getVM() >0))) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with bounding box but boundingBoxTextHorizontalJustification absent or empty"); + } + + if ((anchorPointAnnotationUnits.getVM() == 0) && (anchorPoint.getVM() >0)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with anchor point but anchorPointAnnotationUnits absent or empty"); + } + + if ((anchorPointVisibility.getVM() == 0) && (anchorPoint.getVM() >0)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item with anchor point but anchorPointVisibility absent or empty"); + } + + if ((boundingBoxTLHC.getVM() == 0) && (anchorPoint.getVM() == 0)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item without bounding box and anchor point"); + } + + if ((boundingBoxBRHC.getVM() == 0) && (anchorPoint.getVM() == 0)) + { + result=EC_IllegalCall; + DCMPSTAT_WARN("presentation state contains a text object SQ item without bounding box and anchor point"); + } + + return result; +} + + +OFCondition DVPSTextObject::write(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmElement *delem=NULL; + + ADD_TO_DATASET(DcmShortText, unformattedTextValue) + if (anchorPoint.getLength() > 0) + { + ADD_TO_DATASET(DcmFloatingPointSingle, anchorPoint) + ADD_TO_DATASET(DcmCodeString, anchorPointAnnotationUnits) + ADD_TO_DATASET(DcmCodeString, anchorPointVisibility) + } + if (boundingBoxTLHC.getLength() > 0) + { + ADD_TO_DATASET(DcmFloatingPointSingle, boundingBoxTLHC) + ADD_TO_DATASET(DcmFloatingPointSingle, boundingBoxBRHC) + ADD_TO_DATASET(DcmCodeString, boundingBoxAnnotationUnits) + ADD_TO_DATASET(DcmCodeString, boundingBoxTextHorizontalJustification) + } + return result; +} + + +OFBool DVPSTextObject::haveAnchorPoint() +{ + if (anchorPoint.getLength() > 0) return OFTrue; else return OFFalse; +} + +OFBool DVPSTextObject::haveBoundingBox() +{ + if (boundingBoxTLHC.getLength() > 0) return OFTrue; else return OFFalse; +} + + +OFCondition DVPSTextObject::setAnchorPoint(double x, double y, DVPSannotationUnit unit, OFBool isVisible) +{ + Float32 aPoint[2]; + + anchorPoint.clear(); + anchorPointVisibility.clear(); + anchorPointAnnotationUnits.clear(); + + aPoint[0] = (Float32) x; + aPoint[1] = (Float32) y; + OFCondition result = anchorPoint.putFloat32Array(aPoint, 2); + if (result==EC_Normal) + { + if (isVisible) result=anchorPointVisibility.putString("Y"); + else result=anchorPointVisibility.putString("N"); + } + if (result==EC_Normal) + { + if (unit==DVPSA_display) result=anchorPointAnnotationUnits.putString("DISPLAY"); + else result=anchorPointAnnotationUnits.putString("PIXEL"); + } + return result; +} + + +OFCondition DVPSTextObject::setBoundingBox( + double TLHC_x, + double TLHC_y, + double BRHC_x, + double BRHC_y, + DVPSannotationUnit unit, + DVPSTextJustification justification) +{ + Float32 aPoint[2]; + + boundingBoxAnnotationUnits.clear(); + boundingBoxTLHC.clear(); + boundingBoxBRHC.clear(); + + aPoint[0] = (Float32)TLHC_x; + aPoint[1] = (Float32)TLHC_y; + OFCondition result = boundingBoxTLHC.putFloat32Array(aPoint, 2); + if (result==EC_Normal) + { + aPoint[0] = (Float32)BRHC_x; + aPoint[1] = (Float32)BRHC_y; + result = boundingBoxBRHC.putFloat32Array(aPoint, 2); + } + if (result==EC_Normal) + { + if (unit==DVPSA_display) result=boundingBoxAnnotationUnits.putString("DISPLAY"); + else result=boundingBoxAnnotationUnits.putString("PIXEL"); + switch (justification) + { + case DVPSX_left: + boundingBoxTextHorizontalJustification.putString("LEFT"); + break; + case DVPSX_right: + boundingBoxTextHorizontalJustification.putString("RIGHT"); + break; + case DVPSX_center: + boundingBoxTextHorizontalJustification.putString("CENTER"); + break; + } + } + return result; +} + +OFCondition DVPSTextObject::setText(const char *text) +{ + if ((text==NULL)||(strlen(text)==0)) return EC_IllegalCall; + return unformattedTextValue.putString(text); +} + + +void DVPSTextObject::removeAnchorPoint() +{ + anchorPoint.clear(); + anchorPointVisibility.clear(); + anchorPointAnnotationUnits.clear(); + return; +} + +void DVPSTextObject::removeBoundingBox() +{ + boundingBoxAnnotationUnits.clear(); + boundingBoxTLHC.clear(); + boundingBoxBRHC.clear(); + return; +} + +const char *DVPSTextObject::getText() +{ + char *c = NULL; + if (EC_Normal == unformattedTextValue.getString(c)) return c; else return NULL; +} + +double DVPSTextObject::getBoundingBoxTLHC_x() +{ + Float32 result =0.0; + if (boundingBoxTLHC.getVM() == 2) + { + boundingBoxTLHC.getFloat32(result,0); + } + return result; +} + +double DVPSTextObject::getBoundingBoxTLHC_y() +{ + Float32 result =0.0; + if (boundingBoxTLHC.getVM() == 2) + { + boundingBoxTLHC.getFloat32(result,1); + } + return result; +} + +double DVPSTextObject::getBoundingBoxBRHC_x() +{ + Float32 result =0.0; + if (boundingBoxBRHC.getVM() == 2) + { + boundingBoxBRHC.getFloat32(result,0); + } + return result; +} + +double DVPSTextObject::getBoundingBoxBRHC_y() +{ + Float32 result =0.0; + if (boundingBoxBRHC.getVM() == 2) + { + boundingBoxBRHC.getFloat32(result,1); + } + return result; +} + + +DVPSannotationUnit DVPSTextObject::getBoundingBoxAnnotationUnits() +{ + DVPSannotationUnit aresult = DVPSA_pixels; + OFString aString; + OFCondition result = boundingBoxAnnotationUnits.getOFString(aString,0); + if ((result==EC_Normal)&&(aString == "DISPLAY")) aresult = DVPSA_display; + return aresult; +} + +DVPSTextJustification DVPSTextObject::getBoundingBoxHorizontalJustification() +{ + DVPSTextJustification aresult = DVPSX_left; + OFString aString; + OFCondition result = boundingBoxTextHorizontalJustification.getOFString(aString,0); + if ((result==EC_Normal)&&(aString == "RIGHT")) aresult = DVPSX_right; + if ((result==EC_Normal)&&(aString == "CENTER")) aresult = DVPSX_center; + return aresult; +} + +double DVPSTextObject::getAnchorPoint_x() +{ + Float32 result =0.0; + if (anchorPoint.getVM() == 2) + { + anchorPoint.getFloat32(result,0); + } + return result; +} + +double DVPSTextObject::getAnchorPoint_y() +{ + Float32 result =0.0; + if (anchorPoint.getVM() == 2) + { + anchorPoint.getFloat32(result,1); + } + return result; +} + +OFBool DVPSTextObject::anchorPointIsVisible() +{ + OFString aString; + anchorPointVisibility.getOFString(aString,0); + if (aString == "Y") return OFTrue; else return OFFalse; +} + +DVPSannotationUnit DVPSTextObject::getAnchorPointAnnotationUnits() +{ + DVPSannotationUnit aresult = DVPSA_pixels; + OFString aString; + OFCondition result = anchorPointAnnotationUnits.getOFString(aString,0); + if ((result==EC_Normal)&&(aString == "DISPLAY")) aresult = DVPSA_display; + return aresult; +} diff --git a/dcmpstat/libsrc/dvpstxl.cc b/dcmpstat/libsrc/dvpstxl.cc new file mode 100644 index 00000000..ffb6dcc1 --- /dev/null +++ b/dcmpstat/libsrc/dvpstxl.cc @@ -0,0 +1,157 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSTextObject_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpstxl.h" +#include "dcmtk/dcmpstat/dvpstx.h" /* for DVPSTextObject */ + + +DVPSTextObject_PList::DVPSTextObject_PList() +: list_() +{ +} + +DVPSTextObject_PList::DVPSTextObject_PList(const DVPSTextObject_PList &arg) +: list_() +{ + OFListConstIterator(DVPSTextObject *) first = arg.list_.begin(); + OFListConstIterator(DVPSTextObject *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSTextObject_PList::~DVPSTextObject_PList() +{ + clear(); +} + +void DVPSTextObject_PList::clear() +{ + OFListIterator(DVPSTextObject *) first = list_.begin(); + OFListIterator(DVPSTextObject *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSTextObject_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSTextObject *newObject = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_TextObjectSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newObject = new DVPSTextObject(); + if (newObject && ditem) + { + result = newObject->read(*ditem); + list_.push_back(newObject); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + +OFCondition DVPSTextObject_PList::write(DcmItem &dset) +{ + if (size()==0) return EC_Normal; // don't write empty Sequence + + OFCondition result = EC_Normal; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + dseq = new DcmSequenceOfItems(DCM_TextObjectSequence); + if (dseq) + { + OFListIterator(DVPSTextObject *) first = list_.begin(); + OFListIterator(DVPSTextObject *) last = list_.end(); + while (first != last) + { + if (result==EC_Normal) + { + ditem = new DcmItem(); + if (ditem) + { + result = (*first)->write(*ditem); + if (result==EC_Normal) dseq->insert(ditem); else delete ditem; + } else result = EC_MemoryExhausted; + } + ++first; + } + if (result==EC_Normal) dset.insert(dseq, OFTrue /*replaceOld*/); else delete dseq; + } else result = EC_MemoryExhausted; + return result; +} + + +DVPSTextObject *DVPSTextObject_PList::getTextObject(size_t idx) +{ + OFListIterator(DVPSTextObject *) first = list_.begin(); + OFListIterator(DVPSTextObject *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} + +void DVPSTextObject_PList::addTextObject(DVPSTextObject *text) +{ + if (text) list_.push_back(text); +} + +DVPSTextObject *DVPSTextObject_PList::removeTextObject(size_t idx) +{ + OFListIterator(DVPSTextObject *) first = list_.begin(); + OFListIterator(DVPSTextObject *) last = list_.end(); + while (first != last) + { + if (idx==0) + { + DVPSTextObject *result = *first; + list_.erase(first); + return result; + } + idx--; + ++first; + } + return NULL; +} diff --git a/dcmpstat/libsrc/dvpsvl.cc b/dcmpstat/libsrc/dvpsvl.cc new file mode 100644 index 00000000..b10b83f2 --- /dev/null +++ b/dcmpstat/libsrc/dvpsvl.cc @@ -0,0 +1,93 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOILUT + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsvl.h" +#include "dcmtk/dcmpstat/dvpssv.h" /* for DVPSSoftcopyVOI */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ +#include "dcmtk/dcmpstat/dvpsri.h" /* for DVPSReferencedImage, needed by MSVC5 with STL */ + + +/* --------------- class DVPSVOILUT --------------- */ + +DVPSVOILUT::DVPSVOILUT() +: voiLUTDescriptor(DCM_LUTDescriptor) +, voiLUTExplanation(DCM_LUTExplanation) +, voiLUTData(DCM_LUTData) +{ +} + +DVPSVOILUT::DVPSVOILUT(const DVPSVOILUT& copy) +: voiLUTDescriptor(copy.voiLUTDescriptor) +, voiLUTExplanation(copy.voiLUTExplanation) +, voiLUTData(copy.voiLUTData) +{ +} + +DVPSVOILUT::~DVPSVOILUT() +{ +} + +void DVPSVOILUT::clear() +{ + voiLUTDescriptor.clear(); + voiLUTExplanation.clear(); + voiLUTData.clear(); +} + +OFCondition DVPSVOILUT::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, voiLUTDescriptor) + READ_FROM_DATASET(DcmLongString, EVR_LO, voiLUTExplanation) + READ_FROM_DATASET(DcmUnsignedShort, EVR_US, voiLUTData) + + if (EC_Normal == result) + { + if (voiLUTData.getLength() == 0) result=EC_IllegalCall; + if (voiLUTDescriptor.getVM() != 3) result=EC_IllegalCall; + } + if ((EC_Normal==result) && (voiLUTExplanation.getLength() == 0)) + { + Uint16 numEntries=0, bits=0; + voiLUTDescriptor.getUint16(numEntries,0); + voiLUTDescriptor.getUint16(bits,2); + char descr[100]; + sprintf(descr, "VOI LUT entries=%u bits=%u", (unsigned int)numEntries, (unsigned int)bits); + voiLUTExplanation.putString(descr); + } + return result; +} + +const char *DVPSVOILUT::getExplanation() +{ + char *value = NULL; + if (EC_Normal != voiLUTExplanation.getString(value)) return NULL; + return value; +} + +OFCondition DVPSVOILUT::assign(DVPSSoftcopyVOI& voi) +{ + return voi.setVOILUT(voiLUTDescriptor, voiLUTData, voiLUTExplanation); +} diff --git a/dcmpstat/libsrc/dvpsvll.cc b/dcmpstat/libsrc/dvpsvll.cc new file mode 100644 index 00000000..3859f4ab --- /dev/null +++ b/dcmpstat/libsrc/dvpsvll.cc @@ -0,0 +1,102 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOILUT_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsvll.h" +#include "dcmtk/dcmpstat/dvpsvl.h" /* for DVPSVOILUT */ + + +DVPSVOILUT_PList::DVPSVOILUT_PList() +: list_() +{ +} + +DVPSVOILUT_PList::DVPSVOILUT_PList(const DVPSVOILUT_PList &arg) +: list_() +{ + OFListConstIterator(DVPSVOILUT *) first = arg.list_.begin(); + OFListConstIterator(DVPSVOILUT *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSVOILUT_PList::~DVPSVOILUT_PList() +{ + clear(); +} + +void DVPSVOILUT_PList::clear() +{ + OFListIterator(DVPSVOILUT *) first = list_.begin(); + OFListIterator(DVPSVOILUT *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSVOILUT_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSVOILUT *newObject = NULL; + DcmSequenceOfItems *dseq=NULL; + DcmItem *ditem=NULL; + + if (EC_Normal == dset.search(DCM_VOILUTSequence, stack, ESM_fromHere, OFFalse)) + { + dseq=(DcmSequenceOfItems *)stack.top(); + if (dseq) + { + unsigned long numItems = dseq->card(); + for (unsigned int i=0; igetItem(i); + newObject = new DVPSVOILUT(); + if (newObject && ditem) + { + if (EC_Normal == newObject->read(*ditem)) list_.push_back(newObject); else delete(newObject); + } else result = EC_MemoryExhausted; + } + } + } + + return result; +} + + +DVPSVOILUT *DVPSVOILUT_PList::getVOILUT(size_t idx) +{ + OFListIterator(DVPSVOILUT *) first = list_.begin(); + OFListIterator(DVPSVOILUT *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} diff --git a/dcmpstat/libsrc/dvpsvw.cc b/dcmpstat/libsrc/dvpsvw.cc new file mode 100644 index 00000000..427a79a3 --- /dev/null +++ b/dcmpstat/libsrc/dvpsvw.cc @@ -0,0 +1,89 @@ +/* + * + * Copyright (C) 1998-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOIWindow + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvpsvw.h" +#include "dcmtk/dcmdata/dctk.h" +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +/* --------------- class DVPSVOIWindow --------------- */ + +DVPSVOIWindow::DVPSVOIWindow() +: windowCenter(0.0) +, windowWidth(0.0) +, windowCenterWidthExplanation() +{ +} + +DVPSVOIWindow::DVPSVOIWindow(const DVPSVOIWindow& copy) +: windowCenter(copy.windowCenter) +, windowWidth(copy.windowWidth) +, windowCenterWidthExplanation(copy.windowCenterWidthExplanation) +{ +} + +DVPSVOIWindow::~DVPSVOIWindow() +{ +} + +void DVPSVOIWindow::clear() +{ + windowCenter = 0.0; + windowWidth = 0.0; + windowCenterWidthExplanation.clear(); +} + +OFCondition DVPSVOIWindow::read(size_t idx, DcmDecimalString &wcenter, DcmDecimalString& wwidth, DcmLongString *expl) +{ + if (wcenter.getVM() <= idx) return EC_IllegalCall; + if (wwidth.getVM() <= idx) return EC_IllegalCall; + Float64 wc=0.0, ww=0.0; + OFCondition result = wcenter.getFloat64(wc, OFstatic_cast(Uint32, idx)); + if (EC_Normal==result) result= wwidth.getFloat64(ww, OFstatic_cast(Uint32, idx)); + if (EC_Normal==result) + { + windowCenter = wc; + windowWidth = ww; + if (expl && (expl->getVM() > idx)) expl->getOFString(windowCenterWidthExplanation, OFstatic_cast(Uint32, idx)); + else + { + // create default description for VOI Window + char descr[32]; + windowCenterWidthExplanation = "window center="; + OFStandard::ftoa(descr, sizeof(descr), wc, OFStandard::ftoa_uppercase); + windowCenterWidthExplanation += descr; + windowCenterWidthExplanation += " width="; + OFStandard::ftoa(descr, sizeof(descr), ww, OFStandard::ftoa_uppercase); + windowCenterWidthExplanation += descr; + } + } + return result; +} + +const char *DVPSVOIWindow::getExplanation() +{ + if (windowCenterWidthExplanation.empty()) return NULL; + return windowCenterWidthExplanation.c_str(); +} diff --git a/dcmpstat/libsrc/dvpsvwl.cc b/dcmpstat/libsrc/dvpsvwl.cc new file mode 100644 index 00000000..120dd568 --- /dev/null +++ b/dcmpstat/libsrc/dvpsvwl.cc @@ -0,0 +1,107 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVPSVOIWindow_PList + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrds.h" +#include "dcmtk/dcmpstat/dvpsvwl.h" +#include "dcmtk/dcmpstat/dvpsvw.h" /* for DVPSVOIWindow */ +#include "dcmtk/dcmpstat/dvpsdef.h" /* for constants and macros */ + + +DVPSVOIWindow_PList::DVPSVOIWindow_PList() +: list_() +{ +} + +DVPSVOIWindow_PList::DVPSVOIWindow_PList(const DVPSVOIWindow_PList &arg) +: list_() +{ + OFListConstIterator(DVPSVOIWindow *) first = arg.list_.begin(); + OFListConstIterator(DVPSVOIWindow *) last = arg.list_.end(); + while (first != last) + { + list_.push_back((*first)->clone()); + ++first; + } +} + +DVPSVOIWindow_PList::~DVPSVOIWindow_PList() +{ + clear(); +} + +void DVPSVOIWindow_PList::clear() +{ + OFListIterator(DVPSVOIWindow *) first = list_.begin(); + OFListIterator(DVPSVOIWindow *) last = list_.end(); + while (first != last) + { + delete (*first); + first = list_.erase(first); + } +} + +OFCondition DVPSVOIWindow_PList::read(DcmItem &dset) +{ + OFCondition result = EC_Normal; + DcmStack stack; + DVPSVOIWindow *newObject = NULL; + + DcmDecimalString windowCenter(DCM_WindowCenter); + DcmDecimalString windowWidth(DCM_WindowWidth); + DcmLongString windowCenterWidthExplanation(DCM_WindowCenterWidthExplanation); + + READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowCenter) + READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowWidth) + READ_FROM_DATASET(DcmLongString, EVR_LO, windowCenterWidthExplanation) + + DcmLongString *expl=NULL; + if (windowCenterWidthExplanation.getVM() > 0) expl = &windowCenterWidthExplanation; + + size_t vm = (size_t)windowCenter.getVM(); + for (size_t i=0; iread(i, windowCenter, windowWidth, expl)) list_.push_back(newObject); + else delete(newObject); + } else result = EC_MemoryExhausted; + } + return result; +} + + +DVPSVOIWindow *DVPSVOIWindow_PList::getVOIWindow(size_t idx) +{ + OFListIterator(DVPSVOIWindow *) first = list_.begin(); + OFListIterator(DVPSVOIWindow *) last = list_.end(); + while (first != last) + { + if (idx==0) return *first; + idx--; + ++first; + } + return NULL; +} diff --git a/dcmpstat/libsrc/dvsighdl.cc b/dcmpstat/libsrc/dvsighdl.cc new file mode 100644 index 00000000..a64b8187 --- /dev/null +++ b/dcmpstat/libsrc/dvsighdl.cc @@ -0,0 +1,865 @@ +/* + * + * Copyright (C) 2001-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DVSignatureHandler + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmpstat/dvsighdl.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmsign/dcsignat.h" +#include "dcmtk/dcmdata/dcobject.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmpstat/dvpscf.h" +#include "dcmtk/dcmsign/sicert.h" +#include "dcmtk/dcmsign/sitypes.h" +#include "dcmtk/dcmsign/sinullpr.h" +#include "dcmtk/dcmsign/siprivat.h" +#include "dcmtk/dcmsign/siripemd.h" + +#include "dcmtk/ofstd/ofstream.h" + +#ifdef WITH_OPENSSL +BEGIN_EXTERN_C +#include +END_EXTERN_C + +/// the signature profile class we're using with DICOMscope +class DVSignatureHandlerSignatureProfile: public SiNullProfile +{ +public: + + /// default constructor + DVSignatureHandlerSignatureProfile(DcmAttributeTag& at) + : SiNullProfile() + , notToSign(at) + , vmNotToSign(notToSign.getVM()) + { + } + + /// destructor + virtual ~DVSignatureHandlerSignatureProfile() { } + + /** checks whether the given tag is in the list of tags not to sign + * @param tag tag to check + * @return true if in list, false otherwise + */ + OFBool tagInList(const DcmTagKey& tag) const + { + DcmAttributeTag tempList(notToSign); // required because getTagVal() is not const + DcmTagKey tagkey; + for (unsigned long n=0; nStructured ReportNo structured report is currently active.\n") +, htmlImage("ImageNo image is currently active.\n") +, htmlPState("Presentation StateNo presentation state is currently active.\n") +, htmlOverview() +, correctSignaturesSR(0) +, corruptSignaturesSR(0) +, untrustSignaturesSR(0) +, correctSignaturesImage(0) +, corruptSignaturesImage(0) +, untrustSignaturesImage(0) +, correctSignaturesPState(0) +, corruptSignaturesPState(0) +, untrustSignaturesPState(0) +#ifdef WITH_OPENSSL +, certVerifier() +#endif +, config(cfg) +{ +#ifdef WITH_OPENSSL + int fileFormat = config.getTLSPEMFormat() ? X509_FILETYPE_PEM : X509_FILETYPE_ASN1; + const char *tlsCACertificateFolder = config.getTLSCACertificateFolder(); + if (tlsCACertificateFolder) certVerifier.addTrustedCertificateDir(tlsCACertificateFolder, fileFormat); +#endif + updateSignatureValidationOverview(); +} + + +DVSignatureHandler::~DVSignatureHandler() +{ +} + + +void DVSignatureHandler::replaceString(DVPSObjectType objtype, const char *str) +{ + switch (objtype) + { + case DVPSS_structuredReport: + if (str) htmlSR=str; else htmlSR.clear(); + break; + case DVPSS_image: + if (str) htmlImage=str; else htmlImage.clear(); + break; + case DVPSS_presentationState: + if (str) htmlPState=str; else htmlPState.clear(); + break; + } +} + +void DVSignatureHandler::printSignatureItemPosition(DcmStack& stack, STD_NAMESPACE ostream& os) +{ + DcmObject *elem = NULL; + DcmSequenceOfItems *sq = NULL; + unsigned long sqCard=0; + const char *tagname = NULL; + unsigned long m=0; + char buf[20]; + OFBool printed = OFFalse; + + if (stack.card() > 2) + { + // signature is located within a sequence + for (unsigned long l=stack.card()-2; l>0; --l) // loop over all elements except the stack top and bottom + { + elem = stack.elem(l); + if (elem) + { + if ((elem->ident() == EVR_item) && sq) + { + sqCard = sq->card(); + for (m=0; mgetItem(m) == elem) + { + sprintf(buf, "[%lu]", m); + os << buf; + printed = OFTrue; + } + } + } + else + { + if (printed) os << ". "; + sq = (DcmSequenceOfItems *)elem; + DcmTag currentTag(elem->getTag()); + tagname = currentTag.getTagName(); + if (tagname) os << tagname; else + { + sprintf(buf, "(%04x,%04x)", elem->getTag().getGroup(), elem->getTag().getElement()); + os << buf; + printed = OFTrue; + } + if (elem->ident() == EVR_SQ) sq = (DcmSequenceOfItems *)elem; else sq = NULL; + } + } + } + } else { + // signature is located in the main dataset + os << "Main Dataset"; + } +} + +#ifdef WITH_OPENSSL +void DVSignatureHandler::updateDigitalSignatureInformation(DcmItem& dataset, DVPSObjectType objtype, OFBool /* onRead */) +#else +void DVSignatureHandler::updateDigitalSignatureInformation(DcmItem& /*dataset*/, DVPSObjectType objtype, OFBool /* onRead */) +#endif +{ + OFOStringStream os; + unsigned long counter = 0; + unsigned long corrupt_counter = 0; + unsigned long untrustworthy_counter = 0; + const char *htmlHead = NULL; + const char *htmlFoot = "\n\n"; + + switch (objtype) + { + case DVPSS_structuredReport: + htmlHead = "\nStructured Report\n"; + break; + case DVPSS_image: + htmlHead = "\nImage\n"; + break; + case DVPSS_presentationState: + htmlHead = "\nPresentation State\n"; + break; + } + os << htmlHead; + +#ifdef WITH_OPENSSL + DcmStack stack; + OFString aString; + DcmAttributeTag at(DCM_DataElementsSigned); + DcmTag tag; + unsigned long numSignatures = 0; + unsigned long l=0; + Uint16 macID = 0; + DcmTagKey tagkey; + const char *tagName = NULL; + OFBool nextline; + + const char *htmlEndl = "\n"; + const char *htmlVfyOK = ""; + const char *htmlVfyCA = ""; + const char *htmlVfyErr = ""; + const char *htmlLine1 = " "; + const char *htmlLine2 = " "; + const char *htmlLine3 = " "; + const char *htmlLine4 = "  "; + const char *htmlNext = ""; + const char *htmlTableOK = "\n"; + const char *htmlTableCA = "
\n"; + const char *htmlTableErr = "
\n"; + const char *htmlTableE = "

\n\n"; + + DcmItem *sigItem = DcmSignature::findFirstSignatureItem(dataset, stack); + OFCondition sicond = EC_Normal; + DcmSignature signer; + while (sigItem) + { + signer.attach(sigItem); + numSignatures = signer.numberOfSignatures(); + for (l=0; lSignature #" << counter << " UID="; + if (EC_Normal == signer.getCurrentSignatureUID(aString)) os << aString.c_str(); else os << "(unknown)"; + os << "" << htmlEndl; + + os << htmlLine1 << "Location" << htmlNext; + printSignatureItemPosition(stack, os); + os << htmlEndl; + + os << htmlLine1 << "MAC ID" << htmlNext; + if (EC_Normal == signer.getCurrentMacID(macID)) os << macID; else os << "(unknown)"; + os << htmlEndl; + + os << htmlLine1 << "MAC algorithm" << htmlNext; + if (EC_Normal == signer.getCurrentMacName(aString)) os << aString.c_str(); else os << "(unknown)"; + os << htmlEndl; + + os << htmlLine1 << "MAC calculation xfer syntax" << htmlNext; + if (EC_Normal == signer.getCurrentMacXferSyntaxName(aString)) os << aString.c_str(); else os << "(unknown)"; + os << htmlEndl; + + os << htmlLine1 << "Data elements signed" << htmlNext; + nextline = OFFalse; + if (EC_Normal == signer.getCurrentDataElementsSigned(at)) + { + unsigned long atVM = at.getVM(); + for (unsigned long n=0; ngetKeyType()==EKT_none)) os << "none" << htmlEndl; else + { + os << "X.509v" << cert->getX509Version() << htmlEndl; + cert->getCertSubjectName(aString); + os << htmlLine3 << "Subject" << htmlNext << aString.c_str() << htmlEndl; + cert->getCertIssuerName(aString); + os << htmlLine3 << "Issued by" << htmlNext << aString.c_str() << htmlEndl + << htmlLine3 << "Serial no." << htmlNext << cert->getCertSerialNo() << htmlEndl + << htmlLine3 << "Validity" << htmlNext << "not before "; + cert->getCertValidityNotBefore(aString); + os << aString.c_str() << ", not after "; + cert->getCertValidityNotAfter(aString); + os << aString.c_str() << htmlEndl + << htmlLine4 << "Public key" << htmlNext; + switch (cert->getKeyType()) + { + case EKT_RSA: + os << "RSA, " << cert->getCertKeyBits() << " bits" << htmlEndl; + break; + case EKT_DSA: + os << "DSA, " << cert->getCertKeyBits() << " bits" << htmlEndl; + break; + case EKT_DH: + os << "DH, " << cert->getCertKeyBits() << " bits" << htmlEndl; + break; + case EKT_none: // should never happen + os << "none" << htmlEndl; + break; + } + } + + if (sicond.good()) + { + os << htmlVfyOK << "Verification: OK" << htmlEndl; + } + else if (sicond == SI_EC_VerificationFailed_NoTrust) + { + untrustworthy_counter++; + os << htmlVfyCA << "Verification: Signature is valid but certificate could not be verified: " + << certVerifier.lastError() << "" << htmlEndl ; + } + else + { + corrupt_counter++; + os << htmlVfyErr << "Verification: "; + os << sicond.text() << "" << htmlEndl; + } + os << htmlTableE; + } + } + signer.detach(); + sigItem = DcmSignature::findNextSignatureItem(dataset, stack); + } +#endif + + switch (objtype) + { + case DVPSS_structuredReport: + if (counter == 0) os << "The current structured report does not contain any digital signature." << OFendl; + corruptSignaturesSR = corrupt_counter; + untrustSignaturesSR = untrustworthy_counter; + correctSignaturesSR = counter - corrupt_counter - untrustworthy_counter; + break; + case DVPSS_image: + if (counter == 0) os << "The current image does not contain any digital signature." << OFendl; + corruptSignaturesImage = corrupt_counter; + untrustSignaturesImage = untrustworthy_counter; + correctSignaturesImage = counter - corrupt_counter - untrustworthy_counter; + break; + case DVPSS_presentationState: + if (counter == 0) os << "The current presentation state does not contain any digital signature." << OFendl; + corruptSignaturesPState = corrupt_counter; + untrustSignaturesPState = untrustworthy_counter; + correctSignaturesPState = counter - corrupt_counter - untrustworthy_counter; + break; + } + os << htmlFoot << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(os, newText) + replaceString(objtype, newText); // copies newText into OFString + OFSTRINGSTREAM_FREESTR(newText) + updateSignatureValidationOverview(); + return; +} + + +void DVSignatureHandler::disableDigitalSignatureInformation(DVPSObjectType objtype) +{ + switch (objtype) + { + case DVPSS_structuredReport: + htmlSR = "Structured ReportThe current structured report does not contain any digital signature.\n"; + corruptSignaturesSR = 0; + untrustSignaturesSR = 0; + correctSignaturesSR = 0; + break; + case DVPSS_image: + corruptSignaturesImage = 0; + untrustSignaturesImage = 0; + correctSignaturesImage = 0; + htmlImage = "ImageThe current image does not contain any digital signature.\n"; + break; + case DVPSS_presentationState: + corruptSignaturesPState = 0; + untrustSignaturesPState = 0; + correctSignaturesPState = 0; + htmlPState = "Presentation StateThe current presentation state does not contain any digital signature.\n"; + break; + } + updateSignatureValidationOverview(); +} + +void DVSignatureHandler::disableImageAndPState() +{ + corruptSignaturesImage = 0; + untrustSignaturesImage = 0; + correctSignaturesImage = 0; + htmlImage = "ImageNo image is currently active.\n"; + corruptSignaturesPState = 0; + untrustSignaturesPState = 0; + correctSignaturesPState = 0; + htmlPState = "Presentation StateNo presentation state is currently active.\n"; + updateSignatureValidationOverview(); + return; +} + + +DVPSSignatureStatus DVSignatureHandler::getCurrentSignatureStatus(DVPSObjectType objtype) const +{ + switch (objtype) + { + case DVPSS_structuredReport: + if ((correctSignaturesSR + corruptSignaturesSR + untrustSignaturesSR) == 0) return DVPSW_unsigned; + if ((corruptSignaturesSR + untrustSignaturesSR) == 0) return DVPSW_signed_OK; + if (corruptSignaturesSR == 0) return DVPSW_signed_unknownCA; + break; + case DVPSS_image: + if ((correctSignaturesImage + corruptSignaturesImage + untrustSignaturesImage) == 0) return DVPSW_unsigned; + if ((corruptSignaturesImage + untrustSignaturesImage) == 0) return DVPSW_signed_OK; + if (corruptSignaturesImage == 0) return DVPSW_signed_unknownCA; + break; + case DVPSS_presentationState: + if ((correctSignaturesPState + corruptSignaturesPState + untrustSignaturesPState) == 0) return DVPSW_unsigned; + if ((corruptSignaturesPState + untrustSignaturesPState) == 0) return DVPSW_signed_OK; + if (corruptSignaturesPState == 0) return DVPSW_signed_unknownCA; + break; + } + return DVPSW_signed_corrupt; +} + +DVPSSignatureStatus DVSignatureHandler::getCombinedImagePStateSignatureStatus() const +{ + DVPSSignatureStatus statImage = getCurrentSignatureStatus(DVPSS_image); + DVPSSignatureStatus statPState = getCurrentSignatureStatus(DVPSS_presentationState); + if ((statImage == DVPSW_signed_corrupt)||(statPState == DVPSW_signed_corrupt)) return DVPSW_signed_corrupt; + if ((statImage == DVPSW_signed_unknownCA)||(statPState == DVPSW_signed_unknownCA)) return DVPSW_signed_unknownCA; + if ((statImage == DVPSW_signed_OK)&&(statPState == DVPSW_signed_OK)) return DVPSW_signed_OK; + return DVPSW_unsigned; +} + +const char *DVSignatureHandler::getCurrentSignatureValidationHTML(DVPSObjectType objtype) const +{ + const char *result = ""; + switch (objtype) + { + case DVPSS_structuredReport: + result = htmlSR.c_str(); + break; + case DVPSS_image: + result = htmlImage.c_str(); + break; + case DVPSS_presentationState: + result = htmlPState.c_str(); + break; + } + return result; +} + +void DVSignatureHandler::updateSignatureValidationOverview() +{ + const char *htmlHead = "\nOverview\n"; + const char *htmlFoot = "\n\n"; + const char *htmlEndl = "\n"; + const char *htmlTitle = ""; + const char *htmlVfyUns = ""; + const char *htmlVfySig = ""; + const char *htmlVfyCA = ""; + const char *htmlVfyErr = ""; + const char *htmlLine1 = " "; + const char *htmlNext = ""; + const char *htmlTableUns = "

\n"; + const char *htmlTableSig = "

\n"; + const char *htmlTableCA = "

\n"; + const char *htmlTableErr = "

\n"; + const char *htmlTableE = "

\n\n"; + + OFOStringStream os; + DVPSSignatureStatus status; + os << htmlHead; + + // Structured Report + status = getCurrentSignatureStatus(DVPSS_structuredReport); + switch (status) + { + case DVPSW_unsigned: + os << htmlTableUns; + break; + case DVPSW_signed_OK: + os << htmlTableSig; + break; + case DVPSW_signed_unknownCA: + os << htmlVfyCA; + break; + case DVPSW_signed_corrupt: + os << htmlTableErr; + break; + } + os << htmlTitle << "Structured Report"<< htmlEndl; + os << htmlLine1 << "Number of correct signatures" << htmlNext << correctSignaturesSR << htmlEndl; + os << htmlLine1 << "Number of corrupt signatures" << htmlNext << corruptSignaturesSR << htmlEndl; + os << htmlLine1 << "Number of untrusted signatures" << htmlNext << untrustSignaturesSR << htmlEndl; + switch (status) + { + case DVPSW_unsigned: + os << htmlVfyUns << "Status: unsigned" << htmlEndl; + break; + case DVPSW_signed_OK: + os << htmlVfySig << "Status: signed" << htmlEndl; + break; + case DVPSW_signed_unknownCA: + os << htmlVfyCA << "Status: signed but untrustworthy: certificate could not be verified" << htmlEndl; + break; + case DVPSW_signed_corrupt: + os << htmlVfyErr << "Status: contains corrupt signatures" << htmlEndl; + break; + } + os << htmlTableE; + + // Image + status = getCurrentSignatureStatus(DVPSS_image); + switch (status) + { + case DVPSW_unsigned: + os << htmlTableUns; + break; + case DVPSW_signed_OK: + os << htmlTableSig; + break; + case DVPSW_signed_unknownCA: + os << htmlTableCA; + break; + case DVPSW_signed_corrupt: + os << htmlTableErr; + break; + } + os << htmlTitle << "Image"<< htmlEndl; + os << htmlLine1 << "Number of correct signatures" << htmlNext << correctSignaturesImage << htmlEndl; + os << htmlLine1 << "Number of corrupt signatures" << htmlNext << corruptSignaturesImage << htmlEndl; + os << htmlLine1 << "Number of untrusted signatures" << htmlNext << untrustSignaturesImage << htmlEndl; + switch (status) + { + case DVPSW_unsigned: + os << htmlVfyUns << "Status: unsigned" << htmlEndl; + break; + case DVPSW_signed_OK: + os << htmlVfySig << "Status: signed" << htmlEndl; + break; + case DVPSW_signed_unknownCA: + os << htmlVfyCA << "Status: signed but untrustworthy: certificate could not be verified" << htmlEndl; + break; + case DVPSW_signed_corrupt: + os << htmlVfyErr << "Status: contains corrupt signatures" << htmlEndl; + break; + } + os << htmlTableE; + + // Presentation State + status = getCurrentSignatureStatus(DVPSS_presentationState); + switch (status) + { + case DVPSW_unsigned: + os << htmlTableUns; + break; + case DVPSW_signed_OK: + os << htmlTableSig; + break; + case DVPSW_signed_unknownCA: + os << htmlTableCA; + break; + case DVPSW_signed_corrupt: + os << htmlTableErr; + break; + } + os << htmlTitle << "Presentation State"<< htmlEndl; + os << htmlLine1 << "Number of correct signatures" << htmlNext << correctSignaturesPState << htmlEndl; + os << htmlLine1 << "Number of corrupt signatures" << htmlNext << corruptSignaturesPState << htmlEndl; + os << htmlLine1 << "Number of untrusted signatures" << htmlNext << untrustSignaturesPState << htmlEndl; + switch (status) + { + case DVPSW_unsigned: + os << htmlVfyUns << "Status: unsigned" << htmlEndl; + break; + case DVPSW_signed_OK: + os << htmlVfySig << "Status: signed" << htmlEndl; + break; + case DVPSW_signed_unknownCA: + os << htmlVfyCA << "Status: signed but untrustworthy: certificate could not be verified" << htmlEndl; + break; + case DVPSW_signed_corrupt: + os << htmlVfyErr << "Status: contains corrupt signatures" << htmlEndl; + break; + } + os << htmlTableE; + os << htmlFoot << OFStringStream_ends; + + OFSTRINGSTREAM_GETSTR(os, newText) + htmlOverview = newText; + OFSTRINGSTREAM_FREESTR(newText) + return; +} + +const char *DVSignatureHandler::getCurrentSignatureValidationOverview() const +{ + return htmlOverview.c_str(); +} + +unsigned long DVSignatureHandler::getNumberOfCorrectSignatures(DVPSObjectType objtype) const +{ + unsigned long result = 0; + switch (objtype) + { + case DVPSS_structuredReport: + result = correctSignaturesSR; + break; + case DVPSS_image: + result = correctSignaturesImage; + break; + case DVPSS_presentationState: + result = correctSignaturesPState; + break; + } + return result; +} + + +unsigned long DVSignatureHandler::getNumberOfUntrustworthySignatures(DVPSObjectType objtype) const +{ + unsigned long result = 0; + switch (objtype) + { + case DVPSS_structuredReport: + result = untrustSignaturesSR; + break; + case DVPSS_image: + result = untrustSignaturesImage; + break; + case DVPSS_presentationState: + result = untrustSignaturesPState; + break; + } + return result; +} + + +unsigned long DVSignatureHandler::getNumberOfCorruptSignatures(DVPSObjectType objtype) const +{ + unsigned long result = 0; + switch (objtype) + { + case DVPSS_structuredReport: + result = corruptSignaturesSR; + break; + case DVPSS_image: + result = corruptSignaturesImage; + break; + case DVPSS_presentationState: + result = corruptSignaturesPState; + break; + } + return result; +} + +#ifdef WITH_OPENSSL + +OFBool DVSignatureHandler::attributesSigned(DcmItem& item, DcmAttributeTag& tagList) const +{ + DcmStack stack; + DcmAttributeTag at(DCM_DataElementsSigned); + DcmTagKey tagkey; + DcmSignature signer; + unsigned long numSignatures; + unsigned long l; + DVSignatureHandlerSignatureProfile sigProfile(tagList); + DcmItem *sigItem = DcmSignature::findFirstSignatureItem(item, stack); + while (sigItem) + { + if (sigItem == &item) + { + // signatures on main level - check attributes signed + signer.attach(sigItem); + numSignatures = signer.numberOfSignatures(); + for (l=0; l 1) // should always be true + { + DcmObject *obj = stack.elem(scard-2); + if (obj) // should always be true + { + if (sigProfile.tagInList(obj->getTag())) return OFTrue; // one of the elements in tagList contains a signature + } + } + } + sigItem = DcmSignature::findNextSignatureItem(item, stack); + } + return OFFalse; +} + +#else + +OFBool DVSignatureHandler::attributesSigned(DcmItem& /* item */, DcmAttributeTag& /* tagList */) const +{ + return OFFalse; +} + +#endif + + +#ifdef WITH_OPENSSL + +OFCondition DVSignatureHandler::createSignature( + DcmItem& mainDataset, + const DcmStack& itemStack, + DcmAttributeTag& attributesNotToSignInMainDataset, + const char *userID, + const char *passwd) +{ + if (userID == NULL) return EC_IllegalCall; + + // get user settings + int fileformat = config.getTLSPEMFormat() ? X509_FILETYPE_PEM : X509_FILETYPE_ASN1; + const char *userDir = config.getUserCertificateFolder(); + const char *userKey = config.getUserPrivateKey(userID); + if (userKey == NULL) return EC_IllegalCall; + const char *userCert = config.getUserCertificate(userID); + if (userCert == NULL) return EC_IllegalCall; + + // load private key + SiPrivateKey key; + OFString filename; + if (userDir) + { + filename = userDir; + filename += PATH_SEPARATOR; + } + filename += userKey; + if (passwd) key.setPrivateKeyPasswd(passwd); + OFCondition sicond = key.loadPrivateKey(filename.c_str(), fileformat); + if (sicond != EC_Normal) return EC_IllegalCall; // unable to load private key + + // load certificate + SiCertificate cert; + filename.clear(); + if (userDir) + { + filename = userDir; + filename += PATH_SEPARATOR; + } + filename += userCert; + sicond = cert.loadCertificate(filename.c_str(), fileformat); + if (sicond != EC_Normal) return EC_IllegalCall; // unable to load certificate + if (! key.matchesCertificate(cert)) return EC_IllegalCall; // private key does not match certificate + + DcmSignature signer; + SiRIPEMD160 mac; + SiNullProfile nullProfile; + DVSignatureHandlerSignatureProfile mainProfile(attributesNotToSignInMainDataset); + + DcmObject *current; + DcmItem *currentItem; + DcmStack workStack(itemStack); + while (! workStack.empty()) + { + current = workStack.pop(); + if ((current->ident() != EVR_dataset) && (current->ident() != EVR_item)) return EC_IllegalCall; // wrong type on stack + currentItem = (DcmItem *)current; + signer.attach(currentItem); + if (currentItem == &mainDataset) + { + // we're creating a signature in the main dataset + // we have to establish an explicit tag list, otherwise the profile does not work! + DcmAttributeTag tagList(DCM_DataElementsSigned); + unsigned long numAttributes = currentItem->card(); + for (unsigned long l=0; lgetElement(l)->getTag(),l); + } + sicond = signer.createSignature(key, cert, mac, mainProfile, EXS_LittleEndianExplicit, &tagList); + if (sicond != EC_Normal) return EC_IllegalCall; // error while creating signature + } + else + { + // we're creating a signature in a sequence item + sicond = signer.createSignature(key, cert, mac, nullProfile, EXS_LittleEndianExplicit); + if (sicond != EC_Normal) return EC_IllegalCall; // error while creating signature + } + signer.detach(); + } + return EC_Normal; +} + +#else + +OFCondition DVSignatureHandler::createSignature( + DcmItem& /* mainDataset */, + const DcmStack& /* itemStack */, + DcmAttributeTag& /* attributesNotToSignInMainDataset */, + const char * /* userID */, + const char * /* passwd */) +{ + return EC_IllegalCall; +} + +#endif diff --git a/dcmpstat/tests/CMakeLists.txt b/dcmpstat/tests/CMakeLists.txt new file mode 100644 index 00000000..f3fae247 --- /dev/null +++ b/dcmpstat/tests/CMakeLists.txt @@ -0,0 +1,5 @@ +# declare executables +DCMTK_ADD_EXECUTABLE(msgserv msgserv) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(msgserv dcmpstat dcmdsig dcmsr dcmimage dcmimgle dcmqrdb dcmnet dcmtls dcmdata oflog ofstd) diff --git a/dcmpstat/tests/Makefile.dep b/dcmpstat/tests/Makefile.dep new file mode 100644 index 00000000..35485ec7 --- /dev/null +++ b/dcmpstat/tests/Makefile.dep @@ -0,0 +1,78 @@ +msgserv.o: msgserv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmpstat/dvpsmsg.h ../include/dcmtk/dcmpstat/dpdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h diff --git a/dcmpstat/tests/Makefile.in b/dcmpstat/tests/Makefile.in new file mode 100644 index 00000000..40d0a994 --- /dev/null +++ b/dcmpstat/tests/Makefile.in @@ -0,0 +1,65 @@ +# +# Makefile for dcmpstat/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmnetdir = $(top_srcdir)/../dcmnet +dcmqrdbdir = $(top_srcdir)/../dcmqrdb +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmimagedir = $(top_srcdir)/../dcmimage +dcmsigndir = $(top_srcdir)/../dcmsign +dcmtlsdir = $(top_srcdir)/../dcmtls +dcmsrdir = $(top_srcdir)/../dcmsr + +LOCALINCLUDES = -I$(dcmnetdir)/include -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmsigndir)/include -I$(dcmtlsdir)/include \ + -I$(dcmqrdbdir)/include -I$(dcmimgledir)/include -I$(dcmimagedir)/include \ + -I$(dcmsrdir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(dcmnetdir)/libsrc -L$(ofstddir)/libsrc \ + -L$(oflogdir)/libsrc -L$(dcmdatadir)/libsrc -L$(dcmsigndir)/libsrc \ + -L$(dcmtlsdir)/libsrc -L$(dcmqrdbdir)/libsrc -L$(dcmimgledir)/libsrc \ + -L$(dcmimagedir)/libsrc -L$(dcmsrdir)/libsrc +LOCALLIBS = -ldcmpstat -ldcmdsig -ldcmsr -ldcmimage -ldcmimgle -ldcmqrdb -ldcmnet \ + -ldcmtls -ldcmdata -loflog -lofstd $(TIFFLIBS) $(PNGLIBS) $(XMLLIBS) $(ZLIBLIBS) \ + $(TCPWRAPPERLIBS) $(OPENSSLLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +objs = msgserv.o +progs = msgserv + + +all: $(progs) + +msgserv: msgserv.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ msgserv.o $(LOCALLIBS) $(LIBS) + + +check: + +check-exhaustive: + +install: all + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmpstat/tests/dcmpschk.tcl b/dcmpstat/tests/dcmpschk.tcl new file mode 100644 index 00000000..209406dc --- /dev/null +++ b/dcmpstat/tests/dcmpschk.tcl @@ -0,0 +1,161 @@ +#!/bin/sh +# the next line restarts using wish \ +exec wish4.2 "$0" "$@" + + +# load text from file into window + +proc loadText {w name} { +# $w configure -state normal + set f [open $name] + while {![eof $f]} { + gets $f s + if {[string first "-" $s] == 0 || [string first "=" $s] == 0} { + $w insert end $s tag_emph + } elseif {[string first "Testing: " $s] == 0} { + $w insert end $s tag_emph + } elseif {[string first "Pass " $s] == 0} { + $w insert end $s tag_emph + } elseif {[string first "Error: " $s] == 0} { + $w insert end $s tag_err + } elseif {[string first "Warning: " $s] == 0} { + $w insert end $s tag_warn + } elseif {[string first "Informational: " $s] == 0} { + $w insert end $s tag_inf + } elseif {[string first "Test passed" $s] == 0} { + $w insert end $s tag_passed + } elseif {[string first "Test failed" $s] == 0} { + $w insert end $s tag_failed + } else { + $w insert end $s + } + $w insert end "\n" + } + close $f +# $w configure -state disabled +} + + +# search string in text window and mark all positions with tag + +proc findText {w name tag} { + $w tag remove $tag 1.0 end + set hits 0 + set pos -1 + if {$name != ""} { + set cur 1.0 + while 1 { + set cur [$w search -count length -- $name $cur end] + if {$cur == ""} { + break + } + if {$pos < 0} { + set pos $cur + } + $w tag add $tag $cur "$cur + $length char" + set cur [$w index "$cur + $length char"] + incr hits + } + } + if {$pos >= 0} { + $w see $pos + } + return $hits +} + +# search string in both text windows + +proc findTextCommand {name} { + global hitsText + + set dh [findText .report.text $name tag_found] + set hitsText [concat "Hits: " $dh] + focus .find.entry + .find.entry delete 0 end +} + + +# set up text window + +proc setupTextWindow {} { + global findName + global hitsText + + set hitsText "Hits: 0" + + frame .find + button .find.button -text "Find" -command "findTextCommand \$findName" -width 4 -anchor w + entry .find.entry -textvariable findName + label .find.label -textvariable hitsText -width 13 + pack .find.button -side left + pack .find.label -side right + pack .find.entry -fill x -expand yes -padx 5 + + frame .report + text .report.text -height 1 -wrap none -background #fff7e9 -selectbackground lightgray -font -*-Courier-Medium-R-Normal--*-150-*-*-*-*-*-* -xscrollcommand ".report.xscroll set" -yscrollcommand ".report.yscroll set" + scrollbar .report.xscroll -orient horizontal -command ".report.text xview" + scrollbar .report.yscroll -orient vertical -command ".report.text yview" + pack .report.xscroll -side bottom -fill x + pack .report.yscroll -side right -fill y + pack .report.text -expand yes -fill both + + .report.text tag configure tag_emph -foreground black -font -*-Courier-Bold-R-Normal--*-150-*-*-*-*-*-* + .report.text tag configure tag_found -background lightgray -underline true + .report.text tag configure tag_warn -background #ffff8c + .report.text tag configure tag_err -background #ff8c8c + .report.text tag configure tag_inf -background #aae6aa + .report.text tag configure tag_passed -foreground white -background black -font -*-Courier-Bold-R-Normal--*-150-*-*-*-*-*-* + .report.text tag configure tag_failed -foreground white -background black -font -*-Courier-Bold-R-Normal--*-150-*-*-*-*-*-* + + pack .find -side top -fill x + pack .report -expand yes -fill both + + bind .find.entry "findTextCommand \$findName" + bind .report.text {if {[.report.text tag nextrange sel 1.0] != ""} {findTextCommand [selection get]}} + + focus .find.entry +} + + +# main window +catch {eval destroy [winfo child .]} errMsg +if {$errMsg > 0} { + exit 1 +} + +# initialization +set temp "/tmp" +if [info exists env(TEMP)] { + set temp $env(TEMP) +} elseif [info exists env(TMP)] { + set temp $env(TMP) +} +set checkReport [file join $temp dcmpschk.report] +set checkApp "dcmpschk" + +# set up window +wm iconname . "DICOM Checker" +if {$tcl_platform(os) == "SunOS"} { + wm geometry . 956x903 +} else { + wm geometry . [expr int([winfo screenwidth .] * 0.995)]x[expr int([winfo screenheight .] * 0.938)] +} +wm geometry . +0+0 +wm minsize . 400 165 + +setupTextWindow + +# set up bindings +bind all {destroy .} + +# start check process +if {$argc > 0} { + set fileName [lindex $argv 0] + wm title . "Please wait ..." + catch {exec $checkApp -v $fileName >& $checkReport} + loadText .report.text $checkReport + update + wm title . [format "DICOM PState Checker - %s" $fileName] +} else { + wm title . [format "DICOM PState Checker - "] +} diff --git a/dcmpstat/tests/dcmpsprt.pl b/dcmpstat/tests/dcmpsprt.pl new file mode 100755 index 00000000..92491b6a --- /dev/null +++ b/dcmpstat/tests/dcmpsprt.pl @@ -0,0 +1,39 @@ +#!/usr/local/bin/perl +# + +$program='../apps/dcmpsprt'; +# set '[Database] Directory = /data/dicom-images/rsna99/results' in test.cfg for better performance +$options='-c test.cfg'; +$source='/data/dicom-images/rsna99'; +# this entry is only used for message output, see comment on test.cfg +$destination='/data/dicom-images/rsna99/results'; +$img_ext='.img'; +$pst_ext='.pres'; + +printf("Create hardcopy objects from images in $source\nand store results in $destination\n\n"); + +# first, collect a list of all files in the archive +printf("reading file list...\n"); +@files = `find $source/*$img_ext -type f -print"`; + +# then create a list of all files +$files_idx = 0; +for (@files) +{ + if ($_ =~ /.*\/files$/) + { + $files[$files_idx++] = $_; + } +} + +printf("creating hardcopy grayscale images...\n"); +for (@files) +{ + chop($_); + if ($_ !~ /.*\/files$/) + { + ($basename) = ($_ =~ /$source(.*)$img_ext/); + printf("processing: $_\n"); + `$program $options -p $source$basename$pst_ext $_`; + } +} diff --git a/dcmpstat/tests/msgserv.cc b/dcmpstat/tests/msgserv.cc new file mode 100644 index 00000000..a4ed2771 --- /dev/null +++ b/dcmpstat/tests/msgserv.cc @@ -0,0 +1,364 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmpstat + * + * Authors: Marco Eichelberg + * + * Purpose: Sample message server for class DVPSIPCClient + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#ifdef HAVE_WINDOWS_H +#include +#include +#elif defined(HAVE_WINSOCK_H) +#include /* include winsock.h directly i.e. on MacOS */ +#endif + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_TYPES_H +#include /* we have to include this before sys/time.h on Solaris */ +#endif +#ifdef HAVE_SYS_TIME_H +#include /* for struct timeval on Linux */ +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +END_EXTERN_C + +#define INCLUDE_CSTDLIB +#define INCLUDE_CERRNO +#define INCLUDE_CTIME +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmpstat/dvpsmsg.h" /* for class DVPSIPCMessage */ +#include "dcmtk/dcmdata/cmdlnarg.h" /* for prepareCmdLineArgs */ +#include "dcmtk/ofstd/ofconapp.h" /* for class OFConsoleApplication */ +#include "dcmtk/dcmnet/dcmtrans.h" /* for class DcmTCPConnection */ +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmnet/dcompat.h" /* compatability routines */ +#include "dcmtk/dcmnet/dul.h" +#include "dcmtk/dcmnet/diutil.h" + +#define OFFIS_CONSOLE_APPLICATION "msgserv" + +static OFLogger msgservLogger = OFLog::getLogger("dcmtk.tests." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +static const char *statusString(Uint32 i) +{ + if (i==DVPSIPCMessage::statusOK) return "OK"; + if (i==DVPSIPCMessage::statusWarning) return "Warning"; + if (i==DVPSIPCMessage::statusError) return "Error"; + return "unknown status code"; +} + +static const char *applicationType(Uint32 i) +{ + if (i==DVPSIPCMessage::clientOther) return "unspecified"; + if (i==DVPSIPCMessage::clientStoreSCP) return "Receiver (Store SCP)"; + if (i==DVPSIPCMessage::clientStoreSCU) return "Sender (Store SCU)"; + if (i==DVPSIPCMessage::clientPrintSCP) return "Printer (Print SCP)"; + if (i==DVPSIPCMessage::clientPrintSCU) return "Print Client (Print SCU)"; + if (i==DVPSIPCMessage::clientQRSCP) return "Database (Query/Retrieve SCP)"; + return "unknown application type"; +} + +#define SHORTCOL 3 +#define LONGCOL 12 + +int main(int argc, char *argv[]) +{ + OFStandard::initializeNetwork(); + +#ifdef WITH_TCPWRAPPER + // this code makes sure that the linker cannot optimize away + // the DUL part of the network module where the external flags + // for libwrap are defined. Needed on OpenBSD. + dcmTCPWrapperDaemonName.set(NULL); +#endif + + OFCmdUnsignedInt opt_port = 0; /* listen port */ + Uint32 clientID = 0; /* IDs assigned to connecting clients */ + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Sample message server for class DVPSIPCClient", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 2); + + cmd.addParam("port", "port number to listen at"); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + cmd.getParam(1, opt_port); + OFLog::configureFromCommandLine(cmd, app); + } + + OFLOG_DEBUG(msgservLogger, rcsid << OFendl); + + unsigned short networkPort = (unsigned short) opt_port; + if (networkPort==0) + { + OFLOG_FATAL(msgservLogger, "no or invalid port number"); + return 10; + } + +#ifndef DISABLE_PORT_PERMISSION_CHECK +#ifdef HAVE_GETEUID + /* if port is privileged we must be as well */ + if ((networkPort < 1024)&&(geteuid() != 0)) + { + OFLOG_FATAL(msgservLogger, "cannot listen on port " << networkPort << ", insufficient privileges"); + return 10; + } +#endif +#endif + + /* open listen socket */ +#ifdef _WIN32 + SOCKET s = socket(AF_INET, SOCK_STREAM, 0); + if (s == INVALID_SOCKET) +#else + int s = socket(AF_INET, SOCK_STREAM, 0); + if (s < 0) +#endif + { + OFLOG_FATAL(msgservLogger, "failed to create socket"); + return 10; + } + + int reuse = 1; + +#ifdef _WIN32 + if (setsockopt(s, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *) &reuse, sizeof(reuse)) < 0) +#else + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *) &reuse, sizeof(reuse)) < 0) +#endif + { + OFLOG_FATAL(msgservLogger, "failed to set socket options"); + return 10; + } + + /* Name socket using wildcards */ + struct sockaddr_in server; + server.sin_family = AF_INET; + server.sin_addr.s_addr = INADDR_ANY; + server.sin_port = (unsigned short) htons(networkPort); + if (bind(s, (struct sockaddr *) & server, sizeof(server))) + { + OFLOG_FATAL(msgservLogger, "failed to bind socket to port, already in use?"); + return 10; + } + listen(s, 64); // accept max 64 pending TCP connections on this socket + + /* drop root privileges now and revert to the calling user id (if we are running as setuid root) */ + if (OFStandard::dropPrivileges().bad()) + { + OFLOG_FATAL(msgservLogger, "setuid() failed, maximum number of processes/threads for uid already running."); + return 10; + } + + fd_set fdset; + struct timeval t; + int nfound; + while (1) + { + // wait for next incoming connection + FD_ZERO(&fdset); + FD_SET(s, &fdset); + t.tv_sec = 10; // 10 seconds timeout + t.tv_usec = 0; + +#ifdef HAVE_INTP_SELECT + nfound = select(OFstatic_cast(int, s + 1), (int *)(&fdset), NULL, NULL, &t); +#else + // the typecast is safe because Windows ignores the first select() parameter anyway + nfound = select(OFstatic_cast(int, s + 1), &fdset, NULL, NULL, &t); +#endif + + if (DCM_dcmnetLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) + { + DU_logSelectResult(nfound); + } + + if (nfound > 0) + { + // incoming connection detected +#ifdef _WIN32 + SOCKET sock=0; +#else + int sock=0; +#endif + struct sockaddr from; +#ifdef HAVE_DECLARATION_SOCKLEN_T + socklen_t len = sizeof(from); +#elif !defined(HAVE_PROTOTYPE_ACCEPT) || defined(HAVE_INTP_ACCEPT) + int len = sizeof(from); +#else + size_t len = sizeof(from); +#endif + do + { + sock = accept(s, &from, &len); +#ifdef _WIN32 + } while ((sock == INVALID_SOCKET)&&(errno == WSAEINTR)); + if (sock == INVALID_SOCKET) +#else + } while ((sock == -1)&&(errno == EINTR)); + if (sock < 0) +#endif + { + OFLOG_FATAL(msgservLogger, "unable to accept incoming connection"); + return 10; + } + + reuse = 1; + +#ifdef _WIN32 + if (setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *) &reuse, sizeof(reuse)) < 0) +#else + if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &reuse, sizeof(reuse)) < 0) +#endif + { + OFLOG_FATAL(msgservLogger, "failed to set socket options"); + return 10; + } + + // now we can handle the incoming connection + DcmTCPConnection connection(sock); + DVPSIPCMessage msg; + Uint32 i=0; + Uint32 msgType=0; + OFString str; + + OFBool finished = OFFalse; + while (!finished) + { + while (! connection.networkDataAvailable(1)) + { + // waiting for network data to become available or connection to be closed + } + if (msg.receive(connection)) + { + OFOStringStream oss; + // handle message + msgType = msg.getMessageType(); + if (msgType == DVPSIPCMessage::OK) + { + oss << "received 'OK' (should not happen)" << OFendl; + } else if (msgType == DVPSIPCMessage::requestApplicationID) { + oss << "New client requests application ID, assigning #" << clientID+1 << OFendl + << "Application Type: "; + if (msg.extractIntFromPayload(i)) oss << applicationType(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::assignApplicationID) { + oss << "received 'AssignApplicationID' (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::applicationTerminates) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Application Terminates, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + } else if (msgType == DVPSIPCMessage::receivedUnencryptedDICOMConnection) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Received Unencrypted DICOM Connection, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::receivedEncryptedDICOMConnection) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Received Encrypted DICOM Connection, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::connectionClosed) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Connection Closed, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + } else if (msgType == DVPSIPCMessage::connectionAborted) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Connection Aborted, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::requestedUnencryptedDICOMConnection) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Requested Unencrypted DICOM Connection, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::requestedEncryptedDICOMConnection) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Requested Encrypted DICOM Connection, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::receivedDICOMObject) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Received DICOM Object, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else if (msgType == DVPSIPCMessage::sentDICOMObject) { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "Sent DICOM Object, status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + if (msg.extractStringFromPayload(str)) oss << str << OFendl; else oss << "No description (should not happen)." << OFendl; + } else { + if (msg.extractIntFromPayload(i)) oss << "#" << i << ": "; else oss << "unknown client: "; + oss << "received unknown message type " << msg.getMessageType() << ", status: "; + if (msg.extractIntFromPayload(i)) oss << statusString(i) << OFendl; else oss << "(none)" << OFendl; + } + oss << OFStringStream_ends; + OFSTRINGSTREAM_GETSTR(oss, result); + OFLOG_INFO(msgservLogger, result); + OFSTRINGSTREAM_FREESTR(result); + msg.erasePayload(); + if (msg.getMessageType() == DVPSIPCMessage::requestApplicationID) + { + msg.setMessageType(DVPSIPCMessage::assignApplicationID); + msg.addIntToPayload(++clientID); + } else { + msg.setMessageType(DVPSIPCMessage::OK); + } + if (! msg.send(connection)) + { + OFLOG_WARN(msgservLogger, "unable to send response message, closing connection"); + finished = OFTrue; + } + } else finished = OFTrue; + } + // connection has been closed by the client or something has gone wrong. + // clean up connection and wait for next client. + connection.close(); + } + } + + OFStandard::shutdownNetwork(); + + return 0; +} diff --git a/dcmqrdb/CMakeLists.txt b/dcmqrdb/CMakeLists.txt new file mode 100644 index 00000000..b083d01a --- /dev/null +++ b/dcmqrdb/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmqrdb) + +# declare include directories which hold for all subdirectories +include_directories("${dcmqrdb_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc apps include docs etc) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmqrdb/Makefile.in b/dcmqrdb/Makefile.in new file mode 100644 index 00000000..59c2f81a --- /dev/null +++ b/dcmqrdb/Makefile.in @@ -0,0 +1,97 @@ +# +# Makefile for dcmqrdb +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) +# (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmqrdb/apps/CMakeLists.txt b/dcmqrdb/apps/CMakeLists.txt new file mode 100644 index 00000000..7dc4b3c4 --- /dev/null +++ b/dcmqrdb/apps/CMakeLists.txt @@ -0,0 +1,9 @@ +# declare executables +foreach(PROGRAM dcmqrscp dcmqridx dcmqrti) + DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}) +endforeach() + +# make sure executables are linked to the corresponding libraries +foreach(PROGRAM dcmqrscp dcmqridx dcmqrti) + DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmqrdb dcmnet dcmdata oflog ofstd) +endforeach() diff --git a/dcmqrdb/apps/Makefile.dep b/dcmqrdb/apps/Makefile.dep new file mode 100644 index 00000000..9bb15d23 --- /dev/null +++ b/dcmqrdb/apps/Makefile.dep @@ -0,0 +1,253 @@ +dcmqridx.o: dcmqridx.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbi.h ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h +dcmqrscp.o: dcmqrscp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcasccff.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h ../include/dcmtk/dcmqrdb/dcmqrsrv.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcasccfg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccftsmp.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfuidh.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfpcmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfrsmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfenmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfprmp.h \ + ../include/dcmtk/dcmqrdb/dcmqrptb.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../ofstd/include/dcmtk/ofstd/ofgrp.h \ + ../../ofstd/include/dcmtk/ofstd/ofpwd.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbi.h ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +dcmqrti.o: dcmqrti.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmqrdb/dcmqrtis.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmqrdb/dcmqrcnf.h ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h diff --git a/dcmqrdb/apps/Makefile.in b/dcmqrdb/apps/Makefile.in new file mode 100644 index 00000000..db172247 --- /dev/null +++ b/dcmqrdb/apps/Makefile.in @@ -0,0 +1,74 @@ +# +# Makefile for dcmqrdb/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +ofstdinc = -I$(ofstddir)/include +ofstdlibdir = -L$(ofstddir)/libsrc +ofstdlib = -lofstd + +oflogdir = $(top_srcdir)/../oflog +ofloginc = -I$(oflogdir)/include +ofloglibdir = -L$(oflogdir)/libsrc +ofloglib = -loflog + +dcmdatadir = $(top_srcdir)/../dcmdata +dcmdatainc = -I$(dcmdatadir)/include +dcmdatalibdir = -L$(dcmdatadir)/libsrc +dcmdatalib = -ldcmdata + +dcmnetdir = $(top_srcdir)/../dcmnet +dcmnetinc = -I$(dcmnetdir)/include +dcmnetlibdir = -L$(dcmnetdir)/libsrc +dcmnetlib = -ldcmnet + +LOCALINCLUDES = $(dcmnetinc) $(dcmdatainc) $(ofstdinc) $(ofloginc) +LIBDIRS = -L$(top_srcdir)/libsrc $(dcmnetlibdir) $(dcmdatalibdir) \ + $(ofstdlibdir) $(ofloglibdir) +LOCALLIBS = -ldcmqrdb $(dcmnetlib) $(dcmdatalib) $(ofstdlib) $(ofloglib) \ + $(ZLIBLIBS) $(TCPWRAPPERLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +objs = dcmqrscp.o dcmqrti.o dcmqridx.o +progs = dcmqrscp dcmqrti dcmqridx + + +all: $(progs) + +dcmqrscp: dcmqrscp.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmqrscp.o $(LOCALLIBS) $(LIBS) + +dcmqrti: dcmqrti.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmqrti.o $(LOCALLIBS) $(LIBS) + +dcmqridx: dcmqridx.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ dcmqridx.o $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmqrdb/apps/dcmqridx.cc b/dcmqrdb/apps/dcmqridx.cc new file mode 100644 index 00000000..bdfa25b6 --- /dev/null +++ b/dcmqrdb/apps/dcmqridx.cc @@ -0,0 +1,179 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Andrew Hewett + * + * Purpose: This test program registers image files in the image database. + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmnet/dicom.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmnet/dul.h" +#include "dcmtk/dcmnet/dcompat.h" +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmqridx" + +static OFLogger dcmqridxLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +// ******************************************** + + +#define SHORTCOL 3 +#define LONGCOL 12 + + +int main (int argc, char *argv[]) +{ + char sclass [120] ; + char sinst [120] ; +#ifdef DEBUG + char fname [120] ; +#endif + DcmQueryRetrieveDatabaseStatus status; + + const char *opt_storageArea = NULL; + OFBool opt_print = OFFalse; + OFBool opt_isNewFlag = OFTrue; + +#ifdef WITH_TCPWRAPPER + // this code makes sure that the linker cannot optimize away + // the DUL part of the network module where the external flags + // for libwrap are defined. Needed on OpenBSD. + dcmTCPWrapperDaemonName.set(NULL); +#endif + + OFCommandLine cmd; + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Register a DICOM image file in an image database index file", rcsid); + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 2); + + cmd.addParam("index-out", "storage area for the index file (directory)"); + cmd.addParam("dcmfile-in", "DICOM image file to be registered in the index file", OFCmdParam::PM_MultiOptional); + + cmd.addGroup("options:", LONGCOL, SHORTCOL); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + cmd.addOption("--print", "-p", "list contents of database index file"); + cmd.addOption("--not-new", "-n", "set instance reviewed status to 'not new'"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_TCPWRAPPER) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef WITH_TCPWRAPPER + COUT << "- LIBWRAP" << OFendl; +#endif + return 0; + } + } + + /* command line parameters and options */ + cmd.getParam(1, opt_storageArea); + + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--print")) + opt_print = OFTrue; + + if (cmd.findOption("--not-new")) + opt_isNewFlag = OFFalse; + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmqridxLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmqridxLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + OFCondition cond; + DcmQueryRetrieveIndexDatabaseHandle hdl(opt_storageArea, DB_UpperMaxStudies, DB_UpperMaxBytesPerStudy, cond); + if (cond.good()) + { + hdl.enableQuotaSystem(OFFalse); /* disable deletion of images */ + int paramCount = cmd.getParamCount(); + for (int param = 2; param <= paramCount; param++) + { + const char *opt_imageFile = NULL; + cmd.getParam(param, opt_imageFile); + if (access(opt_imageFile, R_OK) < 0) + OFLOG_ERROR(dcmqridxLogger, "cannot access: " << opt_imageFile); + else + { + OFLOG_INFO(dcmqridxLogger, "registering: " << opt_imageFile); + if (DU_findSOPClassAndInstanceInFile(opt_imageFile, sclass, sizeof(sclass), sinst, sizeof(sinst))) + { +#ifdef DEBUG + /*** Test what filename is recommended by DB_Module **/ + hdl.makeNewStoreFileName (sclass, sinst, fname, sizeof(fname)); + OFLOG_DEBUG(dcmqridxLogger, "DB_Module recommends " << fname << " for filename"); +#endif + hdl.storeRequest(sclass, sinst, opt_imageFile, &status, opt_isNewFlag) ; + } else + OFLOG_ERROR(dcmqridxLogger, "cannot load dicom file: " << opt_imageFile); + } + } + if (opt_print) + { + COUT << "-- DB Index File --" << OFendl; + hdl.printIndexFile(OFconst_cast(char *, opt_storageArea)); + } + return 0; + } + + return 1; +} diff --git a/dcmqrdb/apps/dcmqrscp.cc b/dcmqrdb/apps/dcmqrscp.cc new file mode 100644 index 00000000..591fb1ff --- /dev/null +++ b/dcmqrdb/apps/dcmqrscp.cc @@ -0,0 +1,926 @@ +/* + * + * Copyright (C) 1993-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Andrew Hewett + * + * Purpose: Image Server Central Test Node (ctn) Main Program + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CSTDARG +#define INCLUDE_CTIME +#define INCLUDE_LIBC +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_FILE_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_IO_H +#include +#endif +END_EXTERN_C + +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmnet/dicom.h" +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmnet/dcasccff.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/dcmqrdb/dcmqrsrv.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ +#include "dcmtk/ofstd/ofgrp.h" +#include "dcmtk/ofstd/ofpwd.h" + +#ifdef WITH_SQL_DATABASE +#include "dcmtk/dcmqrdbx/dcmqrdbq.h" +#else +#include "dcmtk/dcmqrdb/dcmqrdbi.h" +#endif + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#ifndef OFFIS_CONSOLE_APPLICATION +#define OFFIS_CONSOLE_APPLICATION "dcmqrscp" +#endif + +static OFLogger dcmqrscpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +#define APPLICATIONTITLE "DCMQRSCP" + +const char *opt_configFileName = DEFAULT_CONFIGURATION_DIR "dcmqrscp.cfg"; +OFBool opt_checkFindIdentifier = OFFalse; +OFBool opt_checkMoveIdentifier = OFFalse; +OFCmdUnsignedInt opt_port = 0; + +#define SHORTCOL 4 +#define LONGCOL 22 + +static void mangleAssociationProfileKey(OFString& key) +{ + for (size_t ui = 0; ui < key.size();) + { + if (!isspace(key[ui])) + { + key[ui] = toupper(key[ui]); + ++ui; + } + else key.erase(ui, 1); + } +} + +int +main(int argc, char *argv[]) +{ + OFCondition cond = EC_Normal; + OFCmdUnsignedInt overridePort = 0; + OFCmdUnsignedInt overrideMaxPDU = 0; + DcmQueryRetrieveOptions options; + DcmAssociationConfiguration asccfg; + + OFStandard::initializeNetwork(); + + char tempstr[20]; + OFString temp_str; +#ifdef HAVE_FORK + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "DICOM image archive (central test node)", rcsid); +#else + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "DICOM image archive (central test node)\nThis version of dcmqrscp supports only single process mode.", rcsid); +#endif + + OFCommandLine cmd; + + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + cmd.addParam("port", "tcp/ip port number to listen on\n(default: in config file)", OFCmdParam::PM_Optional); + + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + if (strlen(opt_configFileName) > 16) + { + OFString opt5 = "use specific configuration file\n(default: "; + opt5 += opt_configFileName; + opt5 += ")"; + cmd.addOption("--config", "-c", 1, "[f]ilename: string", + opt5.c_str()); + } else { + OFString opt5 = "[f]ilename: string (default: "; + opt5 += opt_configFileName; + opt5 += ")"; + cmd.addOption("--config", "-c", 1, opt5.c_str(), + "use specific configuration file"); + } +#ifdef HAVE_FORK + cmd.addGroup("multi-process options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--single-process", "-s", "single process mode"); + cmd.addOption("--fork", "fork child process for each assoc. (default)"); +#endif + + cmd.addGroup("database options:"); + cmd.addSubGroup("association negotiation:"); + cmd.addOption("--require-find", "reject all MOVE/GET presentation contexts for\nwhich no correspond. FIND context is proposed"); + cmd.addOption("--no-parallel-store", "reject multiple simultaneous STORE presentat.\ncontexts for one application entity title"); + cmd.addOption("--disable-get", "disable C-GET support"); + cmd.addOption("--allow-shutdown", "allow external shutdown via private SOP class"); + cmd.addSubGroup("checking identifier validity:"); + cmd.addOption("--check-find", "-XF", "check C-FIND identifier validity"); + cmd.addOption("--no-check-find", "do not check C-FIND identifier validity (def.)"); + cmd.addOption("--check-move", "-XM", "check C-MOVE identifier validity"); + cmd.addOption("--no-check-move", "do not check C-MOVE identifier validity (def.)"); + cmd.addSubGroup("restriction of move targets:"); + cmd.addOption("--move-unrestricted", "do not restrict move destination (default)"); + cmd.addOption("--move-aetitle", "-ZA", "restrict move dest. to requesting AE title"); + cmd.addOption("--move-host", "-ZH", "restrict move destination to requesting host"); + cmd.addOption("--move-vendor", "-ZV", "restrict move destination to requesting vendor"); + cmd.addSubGroup("restriction of query/retrieve models:"); + cmd.addOption("--no-patient-root", "-QP", "do not support Patient Root Q/R models"); + cmd.addOption("--no-study-root", "-QS", "do not support Study Root Q/R models"); +#ifndef NO_PATIENTSTUDYONLY_SUPPORT + cmd.addOption("--no-patient-study", "-QO", "do not support Patient/Study Only Q/R models"); +#endif + + cmd.addGroup("network options:"); + cmd.addSubGroup("association negotiation profiles from configuration file:"); + cmd.addOption("--assoc-config-file", "-xf", 3, "[f]ilename, [i]n-profile, [o]ut-profile: string", + "use profile i from f for incoming associations\nuse profile o from f for outgoing associations"); + cmd.addSubGroup("preferred network transfer syntaxes (incoming associations):"); + cmd.addOption("--prefer-uncompr", "+x=", "prefer explicit VR local byte order (default)"); + cmd.addOption("--prefer-little", "+xe", "prefer explicit VR little endian TS"); + cmd.addOption("--prefer-big", "+xb", "prefer explicit VR big endian TS"); +#ifndef DISABLE_COMPRESSION_EXTENSION + cmd.addOption("--prefer-lossless", "+xs", "prefer default JPEG lossless TS"); + cmd.addOption("--prefer-jpeg8", "+xy", "prefer default JPEG lossy TS for 8 bit data"); + cmd.addOption("--prefer-jpeg12", "+xx", "prefer default JPEG lossy TS for 12 bit data"); + cmd.addOption("--prefer-j2k-lossless", "+xv", "prefer JPEG 2000 lossless TS"); + cmd.addOption("--prefer-j2k-lossy", "+xw", "prefer JPEG 2000 lossy TS"); + cmd.addOption("--prefer-jls-lossless", "+xt", "prefer JPEG-LS lossless TS"); + cmd.addOption("--prefer-jls-lossy", "+xu", "prefer JPEG-LS lossy TS"); + cmd.addOption("--prefer-mpeg2", "+xm", "prefer MPEG2 Main Profile @ Main Level TS"); + cmd.addOption("--prefer-mpeg2-high", "+xh", "prefer MPEG2 Main Profile @ High Level TS"); + cmd.addOption("--prefer-mpeg4", "+xn", "prefer MPEG4 AVC/H.264 HP / Level 4.1 TS"); + cmd.addOption("--prefer-mpeg4-bd", "+xl", "prefer MPEG4 AVC/H.264 BD-compatible TS"); + cmd.addOption("--prefer-mpeg4-2-2d", "+x2", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)"); + cmd.addOption("--prefer-mpeg4-2-3d", "+x3", "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)"); + cmd.addOption("--prefer-mpeg4-2-st", "+xo", "prefer MPEG4 AVC/H.264 Stereo / Level 4.2 TS"); + cmd.addOption("--prefer-hevc", "+x4", "prefer HEVC/H.265 Main Profile / Level 5.1 TS"); + cmd.addOption("--prefer-hevc10", "+x5", "prefer HEVC/H.265 Main 10 Profile / Level 5.1 TS"); + cmd.addOption("--prefer-rle", "+xr", "prefer RLE lossless TS"); +#ifdef WITH_ZLIB + cmd.addOption("--prefer-deflated", "+xd", "prefer deflated expl. VR little endian TS"); +#endif +#endif + cmd.addOption("--implicit", "+xi", "accept implicit VR little endian TS only"); + +#ifndef DISABLE_COMPRESSION_EXTENSION + cmd.addSubGroup("proposed transmission transfer syntaxes (outgoing associations):"); + cmd.addOption("--propose-uncompr", "-x=", "propose all uncompressed TS, explicit VR\nwith local byte ordering first (default)"); + cmd.addOption("--propose-little", "-xe", "propose all uncompressed TS, explicit VR\nlittle endian first"); + cmd.addOption("--propose-big", "-xb", "propose all uncompressed TS, explicit VR\nbig endian first"); + cmd.addOption("--propose-implicit", "-xi", "propose implicit VR little endian TS only"); + cmd.addOption("--propose-lossless", "-xs", "propose default JPEG lossless TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jpeg8", "-xy", "propose default JPEG lossy TS for 8 bit data\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jpeg12", "-xx", "propose default JPEG lossy TS for 12 bit data\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-j2k-lossless", "-xv", "propose JPEG 2000 lossless TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-j2k-lossy", "-xw", "propose JPEG 2000 lossy TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jls-lossless", "-xt", "propose JPEG-LS lossless TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-jls-lossy", "-xu", "propose JPEG-LS lossy TS\nand all uncompressed transfer syntaxes"); + cmd.addOption("--propose-mpeg2", "-xm", "propose MPEG2 Main Profile @ Main Level TS"); + cmd.addOption("--propose-mpeg2-high", "-xh", "propose MPEG2 Main Profile @ High Level TS"); + cmd.addOption("--propose-mpeg4", "-xn", "propose MPEG4 AVC/H.264 HP / Level 4.1 TS"); + cmd.addOption("--propose-mpeg4-bd", "-xl", "propose MPEG4 AVC/H.264 BD-compatible TS"); + cmd.addOption("--propose-mpeg4-2-2d", "-x2", "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)"); + cmd.addOption("--propose-mpeg4-2-3d", "-x3", "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)"); + cmd.addOption("--propose-mpeg4-2-st", "-xo", "propose MPEG4 AVC/H.264 Stereo / Level 4.2 TS"); + cmd.addOption("--propose-hevc", "-x4", "propose HEVC/H.265 Main Profile / Level 5.1 TS"); + cmd.addOption("--propose-hevc10", "-x5", "propose HEVC/H.265 Main 10 Profile / Level 5.1 TS"); + cmd.addOption("--propose-rle", "-xr", "propose RLE lossless TS\nand all uncompressed transfer syntaxes"); +#ifdef WITH_ZLIB + cmd.addOption("--propose-deflated", "-xd", "propose deflated expl. VR little endian TS\nand all uncompressed transfer syntaxes"); +#endif +#endif + +#ifdef WITH_TCPWRAPPER + cmd.addSubGroup("network host access control (tcp wrapper):"); + cmd.addOption("--access-full", "-ac", "accept connections from any host (default)"); + cmd.addOption("--access-control", "+ac", "enforce host access control rules"); +#endif + + cmd.addSubGroup("other network options:"); + cmd.addOption("--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", + "timeout for connection requests"); + cmd.addOption("--acse-timeout", "-ta", 1, "[s]econds: integer (default: 30)", + "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", + "timeout for DIMSE messages"); + OFString opt4 = "[n]umber of bytes: integer ("; + sprintf(tempstr, "%ld", (long)ASC_MINIMUMPDUSIZE); + opt4 += tempstr; + opt4 += ".."; + sprintf(tempstr, "%ld", (long)ASC_MAXIMUMPDUSIZE); + opt4 += tempstr; + opt4 += ")"; + cmd.addOption("--max-pdu", "-pdu", 1, opt4.c_str(), + "set max receive pdu to n bytes\n(default: use value from configuration file)"); + cmd.addOption("--disable-host-lookup", "-dhl", "disable hostname lookup"); + cmd.addOption("--refuse", "refuse association"); + cmd.addOption("--reject", "reject association if no implement. class UID"); + cmd.addOption("--ignore", "ignore store data, receive but do not store"); + cmd.addOption("--uid-padding", "-up", "silently correct space-padded UIDs"); + +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.addGroup("processing options:"); + cmd.addSubGroup("specific character set:"); + cmd.addOption("--use-request-charset", "+Cr", "try to convert all element values that are\naffected by Specific Character Set (0008,0005)\n" + "to the one specified in the request data set,\nfall back to the one specified via\n" + "--convert-to-xxx if that is not possible\n(default, unless overridden by config file)"); + cmd.addOption("--override-charset", "-Cr", "convert affected element values to the\ncharacter set specified via --convert-to-xxx,\n" + "ignoring the one specified in the request"); + cmd.addOption("--convert-to-ascii", "+A7", "convert affected element values to 7-bit ASCII\n(default, unless overridden by config file)"); + cmd.addOption("--convert-to-utf8", "+U8", "convert affected element values to UTF-8"); + cmd.addOption("--convert-to-latin1", "+L1", "convert affected element values to ISO 8859-1"); + cmd.addOption("--convert-to-charset", "+C", 1, "[c]harset: string", + "convert affected element values to the char.\nset specified by the DICOM defined term c"); + cmd.addOption("--transliterate", "-Ct", "try to approximate characters that cannot be\nrepresented through similar looking characters"); + cmd.addOption("--discard-illegal", "-Cd", "discard characters that cannot be represented\nin destination character set"); +#endif + + cmd.addGroup("output options:"); + cmd.addSubGroup("bit preserving mode:"); + cmd.addOption("--normal", "-B", "allow implicit format conversions (default)"); + cmd.addOption("--bit-preserving", "+B", "write data exactly as read"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax (not with --bit-preserving or compressed transmission):"); + cmd.addOption("--write-xfer-same", "+t=", "write with same TS as input (default)"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); +#ifdef WITH_ZLIB + cmd.addOption("--write-xfer-deflated", "+td", "write with deflated expl. VR little endian TS"); +#endif + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding (not with --bit-preserving):"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items (not with --bit-preserving):"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset or --bit-preserving):"); + cmd.addOption("--padding-off", "-p", "no padding (default)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +#ifdef WITH_ZLIB +#ifdef DISABLE_COMPRESSION_EXTENSION + cmd.addSubGroup("deflate compression level (only with --write-xfer-deflated/same):"); +#else + cmd.addSubGroup("deflate compression level (only with -xd or --write-xfer-deflated/same):"); +#endif + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(WITH_TCPWRAPPER) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef WITH_TCPWRAPPER + COUT << "- LIBWRAP" << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* command line parameters and options */ + if (cmd.getParamCount() > 0) app.checkParam(cmd.getParamAndCheckMinMax(1, overridePort, 1, 65535)); + + OFLog::configureFromCommandLine(cmd, app); + + if (cmd.findOption("--config")) app.checkValue(cmd.getValue(opt_configFileName)); +#ifdef HAVE_FORK + cmd.beginOptionBlock(); + if (cmd.findOption("--single-process")) options.singleProcess_ = OFTrue; + if (cmd.findOption("--fork")) options.singleProcess_ = OFFalse; + cmd.endOptionBlock(); +#endif + + if (cmd.findOption("--require-find")) options.requireFindForMove_ = OFTrue; + if (cmd.findOption("--no-parallel-store")) options.refuseMultipleStorageAssociations_ = OFTrue; + if (cmd.findOption("--disable-get")) options.disableGetSupport_ = OFTrue; + if (cmd.findOption("--allow-shutdown")) options.allowShutdown_ = OFTrue; + cmd.beginOptionBlock(); + if (cmd.findOption("--check-find")) opt_checkFindIdentifier = OFTrue; + if (cmd.findOption("--no-check-find")) opt_checkFindIdentifier = OFFalse; + cmd.endOptionBlock(); + cmd.beginOptionBlock(); + if (cmd.findOption("--check-move")) opt_checkMoveIdentifier = OFTrue; + if (cmd.findOption("--no-check-move")) opt_checkMoveIdentifier = OFFalse; + cmd.endOptionBlock(); + cmd.beginOptionBlock(); + if (cmd.findOption("--move-unrestricted")) + { + options.restrictMoveToSameAE_ = OFFalse; + options.restrictMoveToSameHost_ = OFFalse; + options.restrictMoveToSameVendor_ = OFFalse; + } + if (cmd.findOption("--move-aetitle")) options.restrictMoveToSameAE_ = OFTrue; + if (cmd.findOption("--move-host")) options.restrictMoveToSameHost_ = OFTrue; + if (cmd.findOption("--move-vendor")) options.restrictMoveToSameVendor_ = OFTrue; + cmd.endOptionBlock(); + + if (cmd.findOption("--no-patient-root")) options.supportPatientRoot_ = OFFalse; + if (cmd.findOption("--no-study-root")) options.supportStudyRoot_ = OFFalse; +#ifndef NO_PATIENTSTUDYONLY_SUPPORT + if (cmd.findOption("--no-patient-study")) options.supportPatientStudyOnly_ = OFFalse; +#endif + if (!options.supportPatientRoot_ && !options.supportStudyRoot_ && !options.supportPatientStudyOnly_) + { + app.printError("cannot disable all Q/R models"); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--prefer-uncompr")) options.networkTransferSyntax_ = EXS_Unknown; + if (cmd.findOption("--prefer-little")) options.networkTransferSyntax_ = EXS_LittleEndianExplicit; + if (cmd.findOption("--prefer-big")) options.networkTransferSyntax_ = EXS_BigEndianExplicit; +#ifndef DISABLE_COMPRESSION_EXTENSION + if (cmd.findOption("--prefer-lossless")) options.networkTransferSyntax_ = EXS_JPEGProcess14SV1; + if (cmd.findOption("--prefer-jpeg8")) options.networkTransferSyntax_ = EXS_JPEGProcess1; + if (cmd.findOption("--prefer-jpeg12")) options.networkTransferSyntax_ = EXS_JPEGProcess2_4; + if (cmd.findOption("--prefer-j2k-lossless")) options.networkTransferSyntax_ = EXS_JPEG2000LosslessOnly; + if (cmd.findOption("--prefer-j2k-lossy")) options.networkTransferSyntax_ = EXS_JPEG2000; + if (cmd.findOption("--prefer-jls-lossless")) options.networkTransferSyntax_ = EXS_JPEGLSLossless; + if (cmd.findOption("--prefer-jls-lossy")) options.networkTransferSyntax_ = EXS_JPEGLSLossy; + if (cmd.findOption("--prefer-mpeg2")) options.networkTransferSyntax_ = EXS_MPEG2MainProfileAtMainLevel; + if (cmd.findOption("--prefer-mpeg2-high")) options.networkTransferSyntax_ = EXS_MPEG2MainProfileAtHighLevel; + if (cmd.findOption("--prefer-mpeg4")) options.networkTransferSyntax_ = EXS_MPEG4HighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-bd")) options.networkTransferSyntax_ = EXS_MPEG4BDcompatibleHighProfileLevel4_1; + if (cmd.findOption("--prefer-mpeg4-2-2d")) options.networkTransferSyntax_ = EXS_MPEG4HighProfileLevel4_2_For2DVideo; + if (cmd.findOption("--prefer-mpeg4-2-3d")) options.networkTransferSyntax_ = EXS_MPEG4HighProfileLevel4_2_For3DVideo; + if (cmd.findOption("--prefer-mpeg4-2-st")) options.networkTransferSyntax_ = EXS_MPEG4StereoHighProfileLevel4_2; + if (cmd.findOption("--prefer-hevc")) options.networkTransferSyntax_ = EXS_HEVCMainProfileLevel5_1; + if (cmd.findOption("--prefer-hevc10")) options.networkTransferSyntax_ = EXS_HEVCMain10ProfileLevel5_1; + if (cmd.findOption("--prefer-rle")) options.networkTransferSyntax_ = EXS_RLELossless; +#ifdef WITH_ZLIB + if (cmd.findOption("--prefer-deflated")) options.networkTransferSyntax_ = EXS_DeflatedLittleEndianExplicit; +#endif + if (cmd.findOption("--implicit")) options.networkTransferSyntax_ = EXS_LittleEndianImplicit; +#endif + cmd.endOptionBlock(); + +#ifndef DISABLE_COMPRESSION_EXTENSION + cmd.beginOptionBlock(); + if (cmd.findOption("--propose-uncompr")) options.networkTransferSyntaxOut_ = EXS_Unknown; + if (cmd.findOption("--propose-little")) options.networkTransferSyntaxOut_ = EXS_LittleEndianExplicit; + if (cmd.findOption("--propose-big")) options.networkTransferSyntaxOut_ = EXS_BigEndianExplicit; + if (cmd.findOption("--propose-implicit")) options.networkTransferSyntaxOut_ = EXS_LittleEndianImplicit; + if (cmd.findOption("--propose-lossless")) options.networkTransferSyntaxOut_ = EXS_JPEGProcess14SV1; + if (cmd.findOption("--propose-jpeg8")) options.networkTransferSyntaxOut_ = EXS_JPEGProcess1; + if (cmd.findOption("--propose-jpeg12")) options.networkTransferSyntaxOut_ = EXS_JPEGProcess2_4; + if (cmd.findOption("--propose-j2k-lossless")) options.networkTransferSyntaxOut_ = EXS_JPEG2000LosslessOnly; + if (cmd.findOption("--propose-j2k-lossy")) options.networkTransferSyntaxOut_ = EXS_JPEG2000; + if (cmd.findOption("--propose-jls-lossless")) options.networkTransferSyntaxOut_ = EXS_JPEGLSLossless; + if (cmd.findOption("--propose-jls-lossy")) options.networkTransferSyntaxOut_ = EXS_JPEGLSLossy; + if (cmd.findOption("--propose-mpeg2")) options.networkTransferSyntaxOut_ = EXS_MPEG2MainProfileAtMainLevel; + if (cmd.findOption("--propose-mpeg2-high")) options.networkTransferSyntaxOut_ = EXS_MPEG2MainProfileAtHighLevel; + if (cmd.findOption("--propose-mpeg4")) options.networkTransferSyntaxOut_ = EXS_MPEG4HighProfileLevel4_1; + if (cmd.findOption("--propose-mpeg4-bd")) options.networkTransferSyntaxOut_ = EXS_MPEG4BDcompatibleHighProfileLevel4_1; + if (cmd.findOption("--propose-mpeg4-2-2d")) options.networkTransferSyntaxOut_ = EXS_MPEG4HighProfileLevel4_2_For2DVideo; + if (cmd.findOption("--propose-mpeg4-2-3d")) options.networkTransferSyntaxOut_ = EXS_MPEG4HighProfileLevel4_2_For3DVideo; + if (cmd.findOption("--propose-mpeg4-2-st")) options.networkTransferSyntaxOut_ = EXS_MPEG4StereoHighProfileLevel4_2; + if (cmd.findOption("--propose-hevc")) options.networkTransferSyntaxOut_ = EXS_HEVCMainProfileLevel5_1; + if (cmd.findOption("--propose-hevc10")) options.networkTransferSyntaxOut_ = EXS_HEVCMain10ProfileLevel5_1; + if (cmd.findOption("--propose-rle")) options.networkTransferSyntaxOut_ = EXS_RLELossless; +#ifdef WITH_ZLIB + if (cmd.findOption("--propose-deflated")) options.networkTransferSyntaxOut_ = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); +#endif + +#ifdef WITH_TCPWRAPPER + cmd.beginOptionBlock(); + if (cmd.findOption("--access-full")) dcmTCPWrapperDaemonName.set(NULL); + if (cmd.findOption("--access-control")) dcmTCPWrapperDaemonName.set(OFFIS_CONSOLE_APPLICATION); + cmd.endOptionBlock(); +#endif + + if (cmd.findOption("--timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set((Sint32) opt_timeout); + } + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + options.acse_timeout_ = OFstatic_cast(int, opt_timeout); + } + + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + options.dimse_timeout_ = OFstatic_cast(int, opt_timeout); + options.blockMode_ = DIMSE_NONBLOCKING; + } + + if (cmd.findOption("--max-pdu")) app.checkValue(cmd.getValueAndCheckMinMax(overrideMaxPDU, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE)); + if (cmd.findOption("--disable-host-lookup")) dcmDisableGethostbyaddr.set(OFTrue); + if (cmd.findOption("--refuse")) options.refuse_ = OFTrue; + if (cmd.findOption("--reject")) options.rejectWhenNoImplementationClassUID_ = OFTrue; + if (cmd.findOption("--ignore")) options.ignoreStoreData_ = OFTrue; + if (cmd.findOption("--uid-padding")) options.correctUIDPadding_ = OFTrue; + + if (cmd.findOption("--assoc-config-file")) + { + // check conflicts with other command line options + app.checkConflict("--assoc-config-file", "--prefer-little", options.networkTransferSyntax_ == EXS_LittleEndianExplicit); + app.checkConflict("--assoc-config-file", "--prefer-big", options.networkTransferSyntax_ == EXS_BigEndianExplicit); + app.checkConflict("--assoc-config-file", "--prefer-lossless", options.networkTransferSyntax_ == EXS_JPEGProcess14SV1); + app.checkConflict("--assoc-config-file", "--prefer-jpeg8", options.networkTransferSyntax_ == EXS_JPEGProcess1); + app.checkConflict("--assoc-config-file", "--prefer-jpeg12", options.networkTransferSyntax_ == EXS_JPEGProcess2_4); + app.checkConflict("--assoc-config-file", "--prefer-j2k-lossless", options.networkTransferSyntax_ == EXS_JPEG2000LosslessOnly); + app.checkConflict("--assoc-config-file", "--prefer-j2k-lossy", options.networkTransferSyntax_ == EXS_JPEG2000); + app.checkConflict("--assoc-config-file", "--prefer-jls-lossless", options.networkTransferSyntax_ == EXS_JPEGLSLossless); + app.checkConflict("--assoc-config-file", "--prefer-jls-lossy", options.networkTransferSyntax_ == EXS_JPEGLSLossy); + app.checkConflict("--assoc-config-file", "--prefer-mpeg2", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--assoc-config-file", "--prefer-mpeg2-high", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--assoc-config-file", "--prefer-mpeg4", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--assoc-config-file", "--prefer-mpeg4-bd", options.networkTransferSyntax_ == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--assoc-config-file", "--prefer-mpeg4-2-2d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--assoc-config-file", "--prefer-mpeg4-2-3d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--assoc-config-file", "--prefer-mpeg4-2-st", options.networkTransferSyntax_ == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--assoc-config-file", "--prefer-hevc", options.networkTransferSyntax_ == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--assoc-config-file", "--prefer-hevc10", options.networkTransferSyntax_ == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--assoc-config-file", "--prefer-rle", options.networkTransferSyntax_ == EXS_RLELossless); +#ifdef WITH_ZLIB + app.checkConflict("--assoc-config-file", "--prefer-deflated", options.networkTransferSyntax_ == EXS_DeflatedLittleEndianExplicit); +#endif + app.checkConflict("--assoc-config-file", "--implicit", options.networkTransferSyntax_ == EXS_LittleEndianImplicit); + + app.checkConflict("--assoc-config-file", "--propose-little", options.networkTransferSyntaxOut_ == EXS_LittleEndianExplicit); + app.checkConflict("--assoc-config-file", "--propose-big", options.networkTransferSyntaxOut_ == EXS_BigEndianExplicit); + app.checkConflict("--assoc-config-file", "--propose-implicit", options.networkTransferSyntaxOut_ == EXS_LittleEndianImplicit); + app.checkConflict("--assoc-config-file", "--propose-lossless", options.networkTransferSyntaxOut_ == EXS_JPEGProcess14SV1); + app.checkConflict("--assoc-config-file", "--propose-jpeg8", options.networkTransferSyntaxOut_ == EXS_JPEGProcess1); + app.checkConflict("--assoc-config-file", "--propose-jpeg12", options.networkTransferSyntaxOut_ == EXS_JPEGProcess2_4); + app.checkConflict("--assoc-config-file", "--propose-j2k-lossless", options.networkTransferSyntaxOut_ == EXS_JPEG2000LosslessOnly); + app.checkConflict("--assoc-config-file", "--propose-j2k-lossy", options.networkTransferSyntaxOut_ == EXS_JPEG2000); + app.checkConflict("--assoc-config-file", "--propose-jls-lossless", options.networkTransferSyntaxOut_ == EXS_JPEGLSLossless); + app.checkConflict("--assoc-config-file", "--propose-jls-lossy", options.networkTransferSyntaxOut_ == EXS_JPEGLSLossy); + app.checkConflict("--assoc-config-file", "--propose-mpeg2", options.networkTransferSyntaxOut_ == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--assoc-config-file", "--propose-mpeg2-high", options.networkTransferSyntaxOut_ == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--assoc-config-file", "--propose-mpeg4", options.networkTransferSyntaxOut_ == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--assoc-config-file", "--propose-mpeg4-bd", options.networkTransferSyntaxOut_ == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--assoc-config-file", "--propose-mpeg4-2-2d", options.networkTransferSyntaxOut_ == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--assoc-config-file", "--propose-mpeg4-2-3d", options.networkTransferSyntaxOut_ == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--assoc-config-file", "--propose-mpeg4-2-st", options.networkTransferSyntaxOut_ == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--assoc-config-file", "--propose-hevc", options.networkTransferSyntaxOut_ == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--assoc-config-file", "--propose-hevc10", options.networkTransferSyntaxOut_ == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--assoc-config-file", "--propose-rle", options.networkTransferSyntaxOut_ == EXS_RLELossless); +#ifdef WITH_ZLIB + app.checkConflict("--assoc-config-file", "--propose-deflated", options.networkTransferSyntaxOut_ == EXS_DeflatedLittleEndianExplicit); +#endif + + app.checkValue(cmd.getValue(options.associationConfigFile)); + app.checkValue(cmd.getValue(options.incomingProfile)); + app.checkValue(cmd.getValue(options.outgoingProfile)); + + // read configuration file + cond = DcmAssociationConfigurationFile::initialize(asccfg, options.associationConfigFile.c_str()); + if (cond.bad()) + { + OFLOG_FATAL(dcmqrscpLogger, "cannot read association config file: " << cond.text()); + return 1; + } + + const OFString unmangledInProfile = options.incomingProfile; + const OFString unmangledOutProfile = options.outgoingProfile; + + /* perform name mangling for config file keys */ + mangleAssociationProfileKey(options.incomingProfile); + mangleAssociationProfileKey(options.outgoingProfile); + + if (!asccfg.isKnownProfile(options.incomingProfile.c_str())) + { + OFLOG_FATAL(dcmqrscpLogger, "unknown configuration profile name: " << unmangledInProfile); + return 1; + } + + if (!asccfg.isKnownProfile(options.outgoingProfile.c_str())) + { + OFLOG_FATAL(dcmqrscpLogger, "unknown configuration profile name: " << unmangledOutProfile); + return 1; + } + + if (!asccfg.isValidSCPProfile(options.incomingProfile.c_str())) + { + OFLOG_FATAL(dcmqrscpLogger, "profile '" << unmangledInProfile << "' is not valid for incoming use, duplicate abstract syntaxes found"); + return 1; + } + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--normal")) options.bitPreserving_ = OFFalse; + if (cmd.findOption("--bit-preserving")) options.bitPreserving_ = OFTrue; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) options.useMetaheader_ = OFTrue; + if (cmd.findOption("--write-dataset")) options.useMetaheader_ = OFFalse; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) options.writeTransferSyntax_ = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) + { + app.checkConflict("--write-xfer-little", "--bit-preserving", options.bitPreserving_); +#ifndef DISABLE_COMPRESSION_EXTENSION + app.checkConflict("--write-xfer-little", "--prefer-lossless", options.networkTransferSyntax_ == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-little", "--prefer-jpeg8", options.networkTransferSyntax_ == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-little", "--prefer-jpeg12", options.networkTransferSyntax_ == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-little", "--prefer-j2k-lossless", options.networkTransferSyntax_ == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-little", "--prefer-j2k-lossy", options.networkTransferSyntax_ == EXS_JPEG2000); + app.checkConflict("--write-xfer-little", "--prefer-jls-lossless", options.networkTransferSyntax_ == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-little", "--prefer-jls-lossy", options.networkTransferSyntax_ == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-little", "--prefer-mpeg2", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-little", "--prefer-mpeg2-high", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-bd", options.networkTransferSyntax_ == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-2d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-3d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-little", "--prefer-mpeg4-2-st", options.networkTransferSyntax_ == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-little", "--prefer-hevc", options.networkTransferSyntax_ == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-little", "--prefer-hevc10", options.networkTransferSyntax_ == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-little", "--prefer-rle", options.networkTransferSyntax_ == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. +#endif + options.writeTransferSyntax_ = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--write-xfer-big")) + { + app.checkConflict("--write-xfer-big", "--bit-preserving", options.bitPreserving_); +#ifndef DISABLE_COMPRESSION_EXTENSION + app.checkConflict("--write-xfer-big", "--prefer-lossless", options.networkTransferSyntax_ == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-big", "--prefer-jpeg8", options.networkTransferSyntax_ == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-big", "--prefer-jpeg12", options.networkTransferSyntax_ == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-big", "--prefer-j2k-lossless", options.networkTransferSyntax_ == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-big", "--prefer-j2k-lossy", options.networkTransferSyntax_ == EXS_JPEG2000); + app.checkConflict("--write-xfer-big", "--prefer-jls-lossless", options.networkTransferSyntax_ == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-big", "--prefer-jls-lossy", options.networkTransferSyntax_ == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-big", "--prefer-mpeg2", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-big", "--prefer-mpeg2-high", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-bd", options.networkTransferSyntax_ == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-2d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-3d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-big", "--prefer-mpeg4-2-st", options.networkTransferSyntax_ == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-big", "--prefer-hevc", options.networkTransferSyntax_ == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-big", "--prefer-hevc10", options.networkTransferSyntax_ == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-big", "--prefer-rle", options.networkTransferSyntax_ == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. +#endif + options.writeTransferSyntax_ = EXS_BigEndianExplicit; + } + if (cmd.findOption("--write-xfer-implicit")) + { + app.checkConflict("--write-xfer-implicit", "--bit-preserving", options.bitPreserving_); +#ifndef DISABLE_COMPRESSION_EXTENSION + app.checkConflict("--write-xfer-implicit", "--prefer-lossless", options.networkTransferSyntax_ == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-implicit", "--prefer-jpeg8", options.networkTransferSyntax_ == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-implicit", "--prefer-jpeg12", options.networkTransferSyntax_ == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-implicit", "--prefer-j2k-lossless", options.networkTransferSyntax_ == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-implicit", "--prefer-j2k-lossy", options.networkTransferSyntax_ == EXS_JPEG2000); + app.checkConflict("--write-xfer-implicit", "--prefer-jls-lossless", options.networkTransferSyntax_ == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-implicit", "--prefer-jls-lossy", options.networkTransferSyntax_ == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg2", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg2-high", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-bd", options.networkTransferSyntax_ == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-2d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-3d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-implicit", "--prefer-mpeg4-2-st", options.networkTransferSyntax_ == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-implicit", "--prefer-hevc", options.networkTransferSyntax_ == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-implicit", "--prefer-hevc10", options.networkTransferSyntax_ == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-implicit", "--prefer-rle", options.networkTransferSyntax_ == EXS_RLELossless); + // we don't have to check a conflict for --prefer-deflated because we can always convert that to uncompressed. +#endif + options.writeTransferSyntax_ = EXS_LittleEndianImplicit; + } +#ifdef WITH_ZLIB + if (cmd.findOption("--write-xfer-deflated")) + { + app.checkConflict("--write-xfer-deflated", "--bit-preserving", options.bitPreserving_); +#ifndef DISABLE_COMPRESSION_EXTENSION + app.checkConflict("--write-xfer-deflated", "--prefer-lossless", options.networkTransferSyntax_ == EXS_JPEGProcess14SV1); + app.checkConflict("--write-xfer-deflated", "--prefer-jpeg8", options.networkTransferSyntax_ == EXS_JPEGProcess1); + app.checkConflict("--write-xfer-deflated", "--prefer-jpeg12", options.networkTransferSyntax_ == EXS_JPEGProcess2_4); + app.checkConflict("--write-xfer-deflated", "--prefer-j2k-lossless", options.networkTransferSyntax_ == EXS_JPEG2000LosslessOnly); + app.checkConflict("--write-xfer-deflated", "--prefer-j2k-lossy", options.networkTransferSyntax_ == EXS_JPEG2000); + app.checkConflict("--write-xfer-deflated", "--prefer-jls-lossless", options.networkTransferSyntax_ == EXS_JPEGLSLossless); + app.checkConflict("--write-xfer-deflated", "--prefer-jls-lossy", options.networkTransferSyntax_ == EXS_JPEGLSLossy); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg2", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtMainLevel); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg2-high", options.networkTransferSyntax_ == EXS_MPEG2MainProfileAtHighLevel); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_1); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-bd", options.networkTransferSyntax_ == EXS_MPEG4BDcompatibleHighProfileLevel4_1); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-2d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For2DVideo); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-3d", options.networkTransferSyntax_ == EXS_MPEG4HighProfileLevel4_2_For3DVideo); + app.checkConflict("--write-xfer-deflated", "--prefer-mpeg4-2-st", options.networkTransferSyntax_ == EXS_MPEG4StereoHighProfileLevel4_2); + app.checkConflict("--write-xfer-deflated", "--prefer-hevc", options.networkTransferSyntax_ == EXS_HEVCMainProfileLevel5_1); + app.checkConflict("--write-xfer-deflated", "--prefer-hevc10", options.networkTransferSyntax_ == EXS_HEVCMain10ProfileLevel5_1); + app.checkConflict("--write-xfer-deflated", "--prefer-rle", options.networkTransferSyntax_ == EXS_RLELossless); +#endif + options.writeTransferSyntax_ = EXS_DeflatedLittleEndianExplicit; + } +#endif + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) + { + app.checkConflict("--group-length-recalc", "--bit-preserving", options.bitPreserving_); + options.groupLength_ = EGL_recalcGL; + } + if (cmd.findOption("--group-length-create")) + { + app.checkConflict("--group-length-create", "--bit-preserving", options.bitPreserving_); + options.groupLength_ = EGL_withGL; + } + if (cmd.findOption("--group-length-remove")) + { + app.checkConflict("--group-length-remove", "--bit-preserving", options.bitPreserving_); + options.groupLength_ = EGL_withoutGL; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) + { + app.checkConflict("--length-explicit", "--bit-preserving", options.bitPreserving_); + options.sequenceType_ = EET_ExplicitLength; + } + if (cmd.findOption("--length-undefined")) + { + app.checkConflict("--length-undefined", "--bit-preserving", options.bitPreserving_); + options.sequenceType_ = EET_UndefinedLength; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-off")) options.paddingType_ = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", !options.useMetaheader_); + app.checkConflict("--padding-create", "--bit-preserving", options.bitPreserving_); + app.checkValue(cmd.getValueAndCheckMin(options.filepad_, 0)); + app.checkValue(cmd.getValueAndCheckMin(options.itempad_, 0)); + options.paddingType_ = EPD_withPadding; + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + OFCmdUnsignedInt compressionLevel = 0; +#ifdef DISABLE_COMPRESSION_EXTENSION + app.checkDependence("--compression-level", "--write-xfer-deflated or --write-xfer-same", + (options.writeTransferSyntax_ == EXS_DeflatedLittleEndianExplicit) || + (options.writeTransferSyntax_ == EXS_Unknown)); +#else + app.checkDependence("--compression-level", "--propose-deflated, --write-xfer-deflated or --write-xfer-same", + (options.networkTransferSyntaxOut_ == EXS_DeflatedLittleEndianExplicit) || + (options.writeTransferSyntax_ == EXS_DeflatedLittleEndianExplicit) || + (options.writeTransferSyntax_ == EXS_Unknown)); +#endif + app.checkValue(cmd.getValueAndCheckMinMax(compressionLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, compressionLevel)); + } +#endif + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmqrscpLogger, rcsid << OFendl); + + /* read config file */ + if (access(opt_configFileName, R_OK) < 0) { + OFLOG_FATAL(dcmqrscpLogger, "cannot access " << opt_configFileName << ": " + << OFStandard::getLastSystemErrorCode().message()); + return 10; + } + + DcmQueryRetrieveConfig config; + + if (!config.init(opt_configFileName)) { + OFLOG_FATAL(dcmqrscpLogger, "bad config file: " << opt_configFileName); + return 10; + } + options.maxAssociations_ = config.getMaxAssociations(); + + opt_port = config.getNetworkTCPPort(); + if (opt_port == 0) opt_port = 104; /* not set, use default */ + if (overridePort > 0) opt_port = overridePort; + + options.maxPDU_ = config.getMaxPDUSize(); + if (options.maxPDU_ == 0) options.maxPDU_ = ASC_DEFAULTMAXPDU; /* not set, use default */ + if (options.maxPDU_ < ASC_MINIMUMPDUSIZE || options.maxPDU_ > ASC_MAXIMUMPDUSIZE) + { + OFLOG_FATAL(dcmqrscpLogger, "invalid MaxPDUSize in config file"); + return 10; + } + if (overrideMaxPDU > 0) options.maxPDU_ = overrideMaxPDU; + +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + /* character set conversion options */ + DcmQueryRetrieveCharacterSetOptions& characterSetOptions = config.getCharacterSetOptions(); + if (!(characterSetOptions.flags & DcmQueryRetrieveCharacterSetOptions::Configured)) + characterSetOptions.flags = DcmQueryRetrieveCharacterSetOptions::Configured | DcmQueryRetrieveCharacterSetOptions::Fallback; + cmd.beginOptionBlock(); + if (cmd.findOption("--use-request-charset")) { + characterSetOptions.flags &= ~DcmQueryRetrieveCharacterSetOptions::Override; + } + if (cmd.findOption("--override-charset")) { + characterSetOptions.flags |= DcmQueryRetrieveCharacterSetOptions::Override; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--convert-to-utf8")) characterSetOptions.characterSet = "ISO_IR 192"; + if (cmd.findOption("--convert-to-latin1")) characterSetOptions.characterSet = "ISO_IR 100"; + if (cmd.findOption("--convert-to-ascii")) characterSetOptions.characterSet = ""; + if (cmd.findOption("--convert-to-charset")) app.checkValue(cmd.getValue(characterSetOptions.characterSet)); + cmd.endOptionBlock(); + + if (cmd.findOption("--transliterate")) { + characterSetOptions.conversionFlags |= DCMTypes::CF_transliterate; + } + if (cmd.findOption("--discard-illegal")) { + characterSetOptions.conversionFlags |= DCMTypes::CF_discardIllegal; + } +#endif // DCMTK_ENABLE_CHARSET_CONVERSION + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) { + OFLOG_WARN(dcmqrscpLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + +#ifndef DISABLE_PORT_PERMISSION_CHECK +#ifdef HAVE_GETEUID + /* if port is privileged we must be as well */ + if (opt_port < 1024) { + if (geteuid() != 0) { + OFLOG_FATAL(dcmqrscpLogger, "cannot listen on port " << opt_port << ", insufficient privileges"); + return 10; + } + } +#endif +#endif + + cond = ASC_initializeNetwork(NET_ACCEPTORREQUESTOR, (int)opt_port, options.acse_timeout_, &options.net_); + if (cond.bad()) { + OFLOG_FATAL(dcmqrscpLogger, "cannot initialize network: " << DimseCondition::dump(temp_str, cond)); + return 10; + } + + /* drop root privileges now and revert to the calling user id (if we are running as setuid root) */ + if (OFStandard::dropPrivileges().bad()) + { + OFLOG_FATAL(dcmqrscpLogger, "setuid() failed, maximum number of processes/threads for uid already running."); + return 10; + } + +#if defined(HAVE_SETUID) && defined(HAVE_GRP_H) && defined(HAVE_PWD_H) + OFStandard::OFGroup grp; + OFStandard::OFPasswd pwd; + const char *opt_UserName = NULL; + const char *opt_GroupName = NULL; + + if (((opt_GroupName = config.getGroupName()) != NULL) && strlen(opt_GroupName) > 0) + { + if (!(grp = OFStandard::getGrNam(opt_GroupName))) + { + OFLOG_FATAL(dcmqrscpLogger, "bad group name " << opt_GroupName); + return 10; + } + if (setgid(grp.gr_gid) == -1) + { + OFLOG_FATAL(dcmqrscpLogger, "setgid: Unable to set group id to group " << (unsigned)grp.gr_gid); + return 10; + } + } + if (((opt_UserName = config.getUserName()) != NULL) && strlen(opt_UserName) > 0) + { + if (!(pwd = OFStandard::getPwNam(opt_UserName))) + { + OFLOG_FATAL(dcmqrscpLogger, "bad user name " << opt_UserName); + return 10; + } + if (setuid(pwd.pw_uid) == -1) + { + OFLOG_FATAL(dcmqrscpLogger, "setuid: Unable to set user id to user " << (unsigned)pwd.pw_uid); + return 10; + } + } +#endif // defined(HAVE_SETUID) && defined(HAVE_GRP_H) && defined(HAVE_PWD_H) + +#ifdef WITH_SQL_DATABASE + // use SQL database + DcmQueryRetrieveSQLDatabaseHandleFactory factory; +#else + // use linear index database (index.dat) + DcmQueryRetrieveIndexDatabaseHandleFactory factory(&config); +#endif + + DcmQueryRetrieveSCP scp(config, options, factory, asccfg); + scp.setDatabaseFlags(opt_checkFindIdentifier, opt_checkMoveIdentifier); + + /* loop waiting for associations */ + while (cond.good()) + { + cond = scp.waitForAssociation(options.net_); + if (!options.singleProcess_) scp.cleanChildren(); /* clean up any child processes */ + } + + cond = ASC_dropNetwork(&options.net_); + if (cond.bad()) { + OFLOG_FATAL(dcmqrscpLogger, "cannot drop network: " << DimseCondition::dump(temp_str, cond)); + return 10; + } + + OFStandard::shutdownNetwork(); + + return 0; +} diff --git a/dcmqrdb/apps/dcmqrti.cc b/dcmqrdb/apps/dcmqrti.cc new file mode 100644 index 00000000..0e78905f --- /dev/null +++ b/dcmqrdb/apps/dcmqrti.cc @@ -0,0 +1,386 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Andrew Hewett + * + * Purpose: Telnet Initiator (ti) Main Program + * + */ + +#include "dcmtk/config/osconfig.h" + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CSTDARG +#define INCLUDE_CERRNO +#define INCLUDE_CTIME +#define INCLUDE_CSIGNAL +#include "dcmtk/ofstd/ofstdinc.h" +BEGIN_EXTERN_C +#ifdef HAVE_SYS_FILE_H +#include +#endif +#ifdef HAVE_SIGNAL_H +// On Solaris with Sun Workshop 11, declares signal() but does not +#include +#endif +END_EXTERN_C +#include "dcmtk/dcmqrdb/dcmqrtis.h" +#include "dcmtk/dcmnet/assoc.h" +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/dcmdata/dcdict.h" +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/ofstd/ofconapp.h" +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmqrti" +#define MAXREMOTEDBTITLES 20 +#define APPLICATIONTITLE "TELNET_INITIATOR" +#define SHORTCOL 4 +#define LONGCOL 18 + +static OFLogger dcmqrtiLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; +DcmQueryRetrieveConfig config; +DcmQueryRetrieveTelnetInitiator conf(config); + +/* + * Handle interrupt signals. + * We only really need to make sure that the display is clear + * before quiting. + */ +#ifdef SIGNAL_HANDLER_WITH_ELLIPSE +extern "C" void TI_signalHandler(...) +#else +extern "C" void TI_signalHandler(int) +#endif +{ + conf.TI_detachAssociation(OFTrue); + exit( 1 ); +} + +int main( int argc, char *argv[] ) +{ + + const char *remoteDBTitles[ MAXREMOTEDBTITLES ]; + int remoteDBTitlesCount = 0; + const char *configFileName = DEFAULT_CONFIGURATION_DIR "dcmqrscp.cfg"; + E_TransferSyntax networkTransferSyntax = EXS_Unknown; + int opt_acse_timeout = 30; + + const char *currentPeer = NULL, **vendorHosts, **aeTitleList; + OFBool noCommandLineValueForMaxReceivePDULength = OFTrue; + int peerCount, j, n, returnValue = 0; + OFCondition cond = EC_Normal; + char tempstr[20]; + OFString temp_str; + + OFStandard::initializeNetwork(); + + // initialize conf structure + conf.setAETitle(APPLICATIONTITLE); + + // setup console application and command line objects + OFConsoleApplication app( OFFIS_CONSOLE_APPLICATION , "Telnet initiator", rcsid ); + OFCommandLine cmd; + + cmd.setParamColumn( LONGCOL + SHORTCOL + 2 ); + cmd.addParam( "peer", "peer host name or symbolic name from cfg file", OFCmdParam::PM_MultiMandatory ); + + cmd.setOptionColumns( LONGCOL, SHORTCOL ); + cmd.addGroup( "general options:"); + cmd.addOption( "--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive ); + cmd.addOption( "--version", "print version information and exit", OFCommandLine::AF_Exclusive ); + OFLog::addOptions(cmd); + + if (strlen(configFileName) > 21) + { + OFString opt0 = "use specific configuration file\n(default: "; + opt0 += configFileName; + opt0 += ")"; + cmd.addOption( "--config", "-c", 1, "[f]ilename: string", opt0.c_str() ); + } else { + OFString opt0 = "[f]ilename: string (default: "; + opt0 += configFileName; + opt0 += ")"; + cmd.addOption( "--config", "-c", 1, opt0.c_str(), "use specific configuration file" ); + } + + cmd.addGroup( "network options:" ); + cmd.addOption( "--timeout", "-to", 1, "[s]econds: integer (default: unlimited)", "timeout for connection requests"); + cmd.addOption("--acse-timeout", "-ta", 1, "[s]econds: integer (default: 30)", "timeout for ACSE messages"); + cmd.addOption("--dimse-timeout", "-td", 1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages"); + + cmd.addOption( "--propose-implicit", "-xi", "propose implicit VR little endian TS only" ); + OFString opt1 = "set my AE title (default: "; + opt1 += APPLICATIONTITLE; + opt1 += ")"; + cmd.addOption( "--aetitle", "-aet", 1, "[a]etitle: string", opt1.c_str() ); + OFString opt2 = "[n]umber of bytes: integer ("; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MINIMUMPDUSIZE)); + opt2 += tempstr; + opt2 += ".."; + sprintf(tempstr, "%ld", OFstatic_cast(long, ASC_MAXIMUMPDUSIZE)); + opt2 += tempstr; + opt2 += ")"; + cmd.addOption( "--max-pdu", "-pdu", 1, opt2.c_str(), "set max receive pdu to n bytes\n(default: use value from configuration file)" ); + + cmd.addGroup( "other options:" ); + cmd.addOption( "--disable-new-vr", "-u", "disable support for new VRs, convert to OB" ); + cmd.addOption( "--remote", "-rmt", 1, "[t]itle: string", "connect to remote database defined in cfg file" ); + + // evaluate command line + prepareCmdLineArgs( argc, argv, OFFIS_CONSOLE_APPLICATION ); + if( app.parseCommandLine( cmd, argc, argv ) ) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if( cmd.findOption("--version") ) + { + app.printHeader( OFTrue /*print host identifier*/ ); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + return( 0 ); + } + } + + // command line parameters + OFLog::configureFromCommandLine(cmd, app); + + if( cmd.findOption("--config") ) app.checkValue( cmd.getValue( configFileName ) ); + if( cmd.findOption("--propose-implicit") ) networkTransferSyntax = EXS_LittleEndianImplicit; + + conf.setXferSyntax(networkTransferSyntax); + + const char *myAE = NULL; + if( cmd.findOption("--aetitle") ) + { + app.checkValue( cmd.getValue( myAE ) ); + conf.setAETitle(myAE); + } + if( cmd.findOption("--max-pdu") ) + { + OFCmdUnsignedInt pdu=0; + app.checkValue( cmd.getValueAndCheckMinMax( pdu, ASC_MINIMUMPDUSIZE, ASC_MAXIMUMPDUSIZE ) ); + conf.setMaxPDU(pdu); + noCommandLineValueForMaxReceivePDULength = OFFalse; + } + + if (cmd.findOption("--timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + dcmConnectionTimeout.set(OFstatic_cast(Sint32, opt_timeout)); + } + + if (cmd.findOption("--acse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + opt_acse_timeout = OFstatic_cast(int, opt_timeout); + } + + if (cmd.findOption("--dimse-timeout")) + { + OFCmdSignedInt opt_timeout = 0; + app.checkValue(cmd.getValueAndCheckMin(opt_timeout, 1)); + conf.setBlockMode(DIMSE_NONBLOCKING, OFstatic_cast(int, opt_timeout)); + } + + if (cmd.findOption("--disable-new-vr")) + { + dcmDisableGenerationOfNewVRs(); + } + + if (cmd.findOption("--remote", 0, OFCommandLine::FOM_First)) + { + do + { + if( remoteDBTitlesCount < MAXREMOTEDBTITLES ) + { + app.checkValue( cmd.getValue( remoteDBTitles[remoteDBTitlesCount] ) ); + remoteDBTitlesCount++; + } + else OFLOG_ERROR(dcmqrtiLogger, "ti: Too many remote database titles"); + } while (cmd.findOption("--remote", 0, OFCommandLine::FOM_Next)); + } + + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmqrtiLogger, rcsid << OFendl); + + // in case accessing the configuration file for reading is successful + if( access( configFileName, R_OK ) != -1 ) + { + // in case reading values from configuration file is successful + if( config.init( configFileName ) == 1 ) + { + // dump information + if (dcmqrtiLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) + config.printConfig(); + + // determine max pdu size from configuration file + OFCmdUnsignedInt maxPDU = config.getMaxPDUSize(); + + // in case the max pdu size was not set in the configuration file, or + // in case its value is not in a certain range, use the default value + if( maxPDU == 0 || maxPDU < ASC_MINIMUMPDUSIZE || maxPDU > ASC_MAXIMUMPDUSIZE ) + { + OFLOG_WARN(dcmqrtiLogger, "ti: no or invalid max pdu size found in configuration file"); + maxPDU = ASC_DEFAULTMAXPDU; + } + + // if no max pdu size was set on the command line then use config file value + if( noCommandLineValueForMaxReceivePDULength ) conf.setMaxPDU(maxPDU); + + // go through all peers that were specified on the command line + peerCount = cmd.getParamCount(); + for( int i=1 ; i<=peerCount ; i++ ) + { + // determine current peer + cmd.getParam( i, currentPeer ); + + // in general, we now want to add host names to the conf structure; it might be + // though that currentPeer is a symbolic name that stands for a number of hosts; + // hence we need to check first if peer can stands for a symbolic name + if( ( n = config.aeTitlesForSymbolicName( currentPeer, &aeTitleList ) ) > 0 ) + { + // in case peer is a symbolic name and can be found in the host table, + // determine corresponding host names and add them to conf structure + const char *peerName = NULL; + int portNumber; + for( j=0 ; j 0 ) + { + // in case peer is a symbolic name and can be interpreted as a vendor name, add the + // corresponding host names are known for for this vendor to the conf structure + for( j=0 ; j 0 ) + { + // dump information + if (dcmqrtiLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) + conf.printConfig(); + + // make sure data dictionary is loaded + if( !dcmDataDict.isDictionaryLoaded() ) + OFLOG_WARN(dcmqrtiLogger, "no data dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + + // if starting up network is successful + cond = ASC_initializeNetwork( NET_REQUESTOR, 0, opt_acse_timeout, conf.accessNet() ); + if( cond.good() ) + { + // set interrupts for signal handling +#ifdef SIGHUP + signal( SIGHUP, TI_signalHandler ); +#endif +#ifdef SIGINT + signal( SIGINT, TI_signalHandler ); +#endif +#ifdef SIGQUIT + signal( SIGQUIT, TI_signalHandler ); +#endif +#ifdef SIGTERM + signal( SIGTERM, TI_signalHandler ); +#endif + + // do the real work + conf.TI_userInput(); + + // clean up network + cond = ASC_dropNetwork( conf.accessNet() ); + if( cond.bad() ) + { + OFLOG_ERROR(dcmqrtiLogger, "ti: cannot drop network: " << DimseCondition::dump(temp_str, cond)); + returnValue = 1; + } + } + else + { + OFLOG_ERROR(dcmqrtiLogger, "ti: cannot initialize network: " << DimseCondition::dump(temp_str, cond)); + returnValue = 1; + } + } + else + { + OFLOG_ERROR(dcmqrtiLogger, "ti: no accessible databases"); + returnValue = 1; + } + } + else + { + OFLOG_ERROR(dcmqrtiLogger, "ti: cannot read configuration file '" << configFileName << "'"); + returnValue = 1; + } + } + else + { + OFLOG_ERROR(dcmqrtiLogger, "ti: cannot access configuration file '" << configFileName << "'"); + returnValue = 1; + } + + OFStandard::shutdownNetwork(); + + // return result + return( returnValue ); +} diff --git a/dcmqrdb/configure b/dcmqrdb/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmqrdb/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmqrdb/data/Makefile.in b/dcmqrdb/data/Makefile.in new file mode 100644 index 00000000..128c88ea --- /dev/null +++ b/dcmqrdb/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmqrdb/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmqrdb/docs/CMakeLists.txt b/dcmqrdb/docs/CMakeLists.txt new file mode 100644 index 00000000..ec15335f --- /dev/null +++ b/dcmqrdb/docs/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES dcmqrcnf.txt dcmqrset.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc) diff --git a/dcmqrdb/docs/Makefile.in b/dcmqrdb/docs/Makefile.in new file mode 100644 index 00000000..8cb87350 --- /dev/null +++ b/dcmqrdb/docs/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmqrdb/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = dcmqrcnf.txt dcmqrset.txt + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(docdir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(docdir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmqrdb/docs/dcmqrcnf.txt b/dcmqrdb/docs/dcmqrcnf.txt new file mode 100644 index 00000000..eeb7d7b9 --- /dev/null +++ b/dcmqrdb/docs/dcmqrcnf.txt @@ -0,0 +1,148 @@ + +Configuration + +1. Configuration File + +The dcmqrscp and dcmqrti applications are configured via a configuration file. +This configuration file defines global options, known Peer Application +Entities (AEs), groups of Peer AEs belonging to the same vendor, local AEs +(storage areas) and options specific to individual storage areas (file system +path, read/write permission, quota and access permission for Peer AEs). + +There are four different parts in the configuration file: + + 1. Global Parameters + 2. Host Table + 3. Vendor Table + 4. Application Entity Table + +All lines in this parts define one option and the entries in one line are +separated by white spaces. Blank lines and lines which begin with a "#" will +be ignored. They can be used for structuring and as comments. The first entry +in one line is the keyword. All the other entries in the line will be the +desired values. A string value which should include spaces must be enclosed +with quotes. Known quote characters are """, "'", "(" and ")". An integer +value must not enclosed with quotes. A "=" may be used in addition to the +white spaces between the two different entry types, a "," may be used in a +value list. + +1.1. Global Parameters + +The Global Parameter part knows of the following keywords: + +NetworkTCPPort - integer value +MaxPDUSize - integer value +MaxAssociations - integer value +SpecificCharacterSet - comma separated list of string options +UserName - string value +GroupName - string value + +There are default values for all these keywords hardcoded in the configuration +module. + +Example: + +NetworkTCPPort = 104 +MaxPDUSize = 8192 +MaxAssociations = 20 +SpecificCharacterSet = fallback +UserName = (do not change user) +GroupName = (do not change group) + +Available options for specific character sets are: + + "" - a character set, e.g. "ISO_IR 192" for UTF-8 + fallback - retry with another character set if conversion failed + override - override the response character set with the given one + (otherwise the given character set will act as fall back + if enabled) + transliterate - enable transliteration of unsupported characters + discard - discard unsupported characters + +NOTE: You must have root privileges to bind port 104 for DICOM association +requests on Unix/Linux/Posix platforms as this is a privileged port number +(i.e., a port number less than 1024.) If you wish dcmqrscp to run as user/ +group different from root, you must invoke dcmqrscp as root initially. +dcmqrscp will switch to unprivileged user/group as specified by UserName/ +GroupName keywords once it has successfully established the listen socket. + + +1.2. Host Table (AE Title/Presentation Address Mapping) + +The Host Table part must be enclosed with the keywords "HostTable BEGIN" and +"HostTable END". It is used to define symbolic names for a number of DICOM +peers. A peer is a structure with the three values AETitle, HostName, +PortNumber separated with white spaces and commas and enclosed with "(" and +")". + +The right hand side of each entry effectively defines a mapping between +Application Entity Title and Presentation Address. These entries are used +when establishing associations to remote Application Entities. + +NOTE: in the current implementation you cannot substitute an IP address +for a hostname. + +A symbolic name may be defined for a list of peers. Symbolic names and peers +may be mixed to define new symbolic names. A symbolic name must be defined +before used. They can be used in the Vendor and Application Entity Table. + +Example: + +HostTable BEGIN +Acme_1 = (ACME_DN1, acme, 10001) +Acme_2 = (ACME_DN2, acme, 10001) +Acme_3 = (ACME_DN3, acme, 10001) +Acme = Acme_1, Acme_2, Acme_3 +HostTable END + +1.3. Vendor Table + +The Vendor Table part must be enclosed with the keywords "VendorTable BEGIN" +and "VendorTable END". The vendor table is used by the dcmqrscp and dcmqrti +programs. You can give a vendor name to the dcmqrti program and it will talk +to all hosts and AEs of the vendor. The dcmqrscp program can use the vendor +table to restrict move destination to hosts belonging to a vendor. A vendor +name may be defined with a list of symbolic names. The vendor name defined on +the left hand side of an entry was used for the annotation of images in the +CTN Display Program (ctndisp) which existed in earlier DCMTK releases. +Currently the value is not used. + +Example: +VendorTable BEGIN +"ACME CT Company" = Acme +VendorTable END + + +1.4. Application Entity Table + +The Application Entity Table defines the local Application Entities managed by +the dcmqrscp application. Each local AE is associated with a separate storage +area and defines a set of peer AE's which may communicate with the local AE. +Peers attempting to associate with a local AE will be refused if they are not +explicitly or implicitly mentioned. + +The Application Entity Table part must be enclosed with the keywords "AETable +BEGIN" and "AETable END". The entry format is held in a very simple style: + +ApplicationTitle StorageArea Access Quota Peers + +where + + ApplicationTitle - string value + StorageArea - string value + Access - access format: "R" or "RW" or "W" + Quota - quota format: ( maxStudies, maxBytesPerStudy ) + with maxStudies - integer value + maxBytesPerStudy - string value + Peers - peers + with peers - list of ( Hostname, AETitle, Portnumber ) + - list of symbolic names + - mixed list of symbolic names and peers + - keyword "ANY" + +Example: + +AETable BEGIN +ACME_PUB /dicom/ACME_PUB R (10, 24mb) ANY +ACME_PRV /dicom/ACME_PRV RW (10, 24mb) Acme +AETable END diff --git a/dcmqrdb/docs/dcmqrdb.dox b/dcmqrdb/docs/dcmqrdb.dox new file mode 100644 index 00000000..cbc58e7c --- /dev/null +++ b/dcmqrdb/docs/dcmqrdb.dox @@ -0,0 +1,32 @@ +/*! + +\page mod_dcmqrdb dcmqrdb: an image database server + +This module contains a simple image archive that manages a number of storage +areas and allows images to be stored in these storage areas using the DICOM +Storage Service Class. It also allows image attributes to be queried and +images to be retrieved using the DICOM Query/Retrieve Service Class. + +\section Tools + +This module contains the following command line tools: +\li \ref dcmqridx +\li \ref dcmqrscp +\li \ref dcmqrti + +\section Files + +The following files provide further documentation: +\li \ref file_dcmqrcnf +\li \ref file_dcmqrset + +*/ + +/*! + \page file_dcmqrcnf dcmqrcnf.txt file + \verbinclude dcmqrcnf.txt +*/ +/*! + \page file_dcmqrset dcmqrset.txt file + \verbinclude dcmqrset.txt +*/ diff --git a/dcmqrdb/docs/dcmqridx.man b/dcmqrdb/docs/dcmqridx.man new file mode 100644 index 00000000..3db24014 --- /dev/null +++ b/dcmqrdb/docs/dcmqridx.man @@ -0,0 +1,136 @@ +/*! + +\if MANPAGES +\page dcmqridx Register a DICOM image file in an image database index file +\else +\page dcmqridx dcmqridx: Register a DICOM image file in an image database index file +\endif + +\section dcmqridx_synopsis SYNOPSIS + +\verbatim +dcmqridx [options] index-out [dcmfile-in...] +\endverbatim + +\section dcmqridx_description DESCRIPTION + +The \b dcmqridx utility registers DICOM image files in the database index file +used by the \b dcmqrscp and \b dcmqrti applications. No image files are copied. +\b dcmqridx can also list the contents of the database index file. + +\section dcmqridx_parameters PARAMETERS +\verbatim +index-out storage area for the index file (directory) + +dcmfile-in DICOM image file to be registered in the index file +\endverbatim + +\section dcmqridx_options OPTIONS + +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger + + -p --print + list contents of database index file + + -n --not-new + set instance reviewed status to 'not new' +\endverbatim + +\section dcmqridx_notes NOTES + +\b dcmqridx attempts to add a reference to the database index file for each +image-file provided on the command line. + +\b dcmqridx disables the database back-end quota system so that no image files +will be deleted. + +\section dcmqridx_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmqridx_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmqridx_environment ENVIRONMENT + +The \b dcmqridx utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmqridx_see_also SEE ALSO + +dcmqrscp(1), dcmqrti(1) + +\section dcmqridx_copyright COPYRIGHT + +Copyright (C) 1993-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmqrdb/docs/dcmqrscp.man b/dcmqrdb/docs/dcmqrscp.man new file mode 100644 index 00000000..b932a235 --- /dev/null +++ b/dcmqrdb/docs/dcmqrscp.man @@ -0,0 +1,1082 @@ +/*! + +\if MANPAGES +\page dcmqrscp DICOM image archive (central test node) +\else +\page dcmqrscp dcmqrscp: DICOM image archive (central test node) +\endif + +\section dcmqrscp_synopsis SYNOPSIS + +\verbatim +dcmqrscp [options] [port] +\endverbatim + +\section dcmqrscp_description DESCRIPTION + +The Image Central Test Node (\b dcmqrscp) Application implements a simple image +archive. It manages a number of storage areas and allows images to be stored +in these storage areas using the DICOM Storage Service Class. It also allows +image attributes to be queried and images to be retrieved using the DICOM +Query/Retrieve Service Class. The \b dcmqrscp application also implements +access restriction rules to limit operations to specific peer application +entities. + +The \b dcmqrscp application is intended to be used in DICOM demonstrations and +as a compatibility test tool. In particular, \b dcmqrscp will delete images +if its quota restrictions have been exceeded. + +Caution: Note that the format of dcmqrdb's binary \e index.dat file +changed on 20130705 due to a bug fix in the corresponding code. An \e index.dat +file created before that date will not work with dcmqrdb code compiled after +that date but must be re-created. Use \b dcmqridx for that task or re-send all +images to the server after deleting all old files (and creating a new empty +\e index.dat file). + +\section dcmqrscp_parameters PARAMETERS + +\verbatim +port tcp/ip port number to listen on (default: in config file) +\endverbatim + +\section dcmqrscp_options OPTIONS + +\subsection dcmqrscp_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger + + -c --config [f]ilename: string + use specific configuration file + (default: /usr/local/etc/dcmtk/dcmqrscp.cfg) + + # This option allows a specific configuration file to be + # specified. By default, the configuration file in the + # system configuration directory ("etc" on Unix systems and + # current working directory on Windows systems) with the name + # "dcmqrscp.cfg" will be used. It is an error if a valid + # configuration file is not available. See the documentation + # on configuration for more information (dcmqrcnf.txt and the + # example configuration file dcmqrscp.cfg). +\endverbatim + +\subsection dcmqrscp_multiprocess_options multi-process options +\verbatim + -s --single-process + single process mode + + # This option instructs dcmqrscp to run in single process mode. + # Normally, dcmqrscp will spawn a new copy of itself to handle + # each association. This option will prevent such copies being + # spawned and is particularly useful when running within a + # debugger. + + --fork + fork child process for each association (default) + + # Please note that the multi-process options are only available + # on systems that support the fork() call, i.e. not on Windows. +\endverbatim + +\subsection dcmqrscp_database_options database options +\verbatim +association negotiation: + + --require-find + reject all MOVE/GET presentation contexts for + which no corresponding FIND context is proposed + + # This option causes dcmqrscp to enforce a restriction about + # FIND and MOVE presentation contexts. The RSNA'93 demonstration + # required that a CTN refuse to accept a presentation context for + # a MOVE if a FIND presentation context is not also requested. + # This option enforces this restriction. + + --no-parallel-store + reject multiple simultaneous STORE presentation + contexts for one application entity title + + # This option causes dcmqrscp to refuse storage presentations + # contexts for AE Titles if another association has already + # successfully negotiated storage presentation contexts for the + # AE Title. This option should only be needed for debugging + # since the dcmqrscp database back-end sequentialises access via + # file-locking. + + --disable-get + disable C-GET support + + --allow-shutdown + allow external shutdown via a private SOP class + +checking identifier validity: + + -XF --check-find + check C-FIND identifier validity + + # This option causes dcmqrscp database back-end to perform checks + # on the Query Identifiers for a C-FIND command. With this option, + # dcmqrscp will reject any queries which do not conform to the very + # strict DICOM rules for Query Identifiers. + + --no-check-find + do not check C-FIND identifier validity (default) + + -XM --check-move + check C-MOVE identifier validity + + + # This option causes dcmqrscp database back-end to perform checks + # on the Query Identifiers for a C-MOVE command. With this option, + # dcmqrscp will reject any queries which do not conform to the very + # strict DICOM rules for Query Identifiers. + + --no-check-move + do not check C-MOVE identifier validity (default) + +restriction of move targets: + + --move-unrestricted + do not restrict move destination (default) + + -ZA --move-aetitle + restrict move destination to requesting AE title + + -ZH --move-host + restrict move destination to requesting host + + -ZV --move-vendor + restrict move destination to requesting vendor + +restriction of query/retrieve models: + + -QP --no-patient-root + do not support Patient Root Q/R models + + -QS --no-study-root + do not support Study Root Q/R models + + -QO --no-patient-study + do not support Patient/Study Only Q/R models +\endverbatim + +\subsection dcmqrscp_network_options network options +\verbatim +association negotiation profiles from configuration file: + + -xf --assoc-config-file + [f]ilename, [i]n-profile, [o]ut-profile: string + use profile i from f for incoming associations + use profile o from f for outgoing associations + +preferred network transfer syntaxes (incoming associations): + + +x= --prefer-uncompr + prefer explicit VR local byte order (default) + + +xe --prefer-little + prefer explicit VR little endian TS + + +xb --prefer-big + prefer explicit VR big endian TS + + +xs --prefer-lossless + prefer default JPEG lossless TS + + +xy --prefer-jpeg8 + prefer default JPEG lossy TS for 8 bit data + + +xx --prefer-jpeg12 + prefer default JPEG lossy TS for 12 bit data + + +xv --prefer-j2k-lossless + prefer JPEG 2000 lossless TS + + +xw --prefer-j2k-lossy + prefer JPEG 2000 lossy TS + + +xt --prefer-jls-lossless + prefer JPEG-LS lossless TS + + +xu --prefer-jls-lossy + prefer JPEG-LS lossy TS + + +xm --prefer-mpeg2 + prefer MPEG2 Main Profile @ Main Level TS + + +xh --prefer-mpeg2-high + prefer MPEG2 Main Profile @ High Level TS + + +xn --prefer-mpeg4 + prefer MPEG4 AVC/H.264 High Profile / Level 4.1 TS + + +xl --prefer-mpeg4-bd + prefer MPEG4 AVC/H.264 BD-compatible HP / Level 4.1 TS + + +x2 --prefer-mpeg4-2-2d + prefer MPEG4 AVC/H.264 HP / Level 4.2 TS for 2D Videos + + +x3 --prefer-mpeg4-2-3d + prefer MPEG4 AVC/H.264 HP / Level 4.2 TS for 3D Videos + + +xo --prefer-mpeg4-2-st + prefer MPEG4 AVC/H.264 Stereo HP / Level 4.2 TS + + +x4 --prefer-hevc + prefer HEVC H.265 Main Profile / Level 5.1 TS + + +x5 --prefer-hevc10 + prefer HEVC H.265 Main 10 Profile / Level 5.1 TS + + +xr --prefer-rle + prefer RLE lossless TS + + +xd --prefer-deflated + prefer deflated explicit VR little endian TS + + +xi --implicit + accept implicit VR little endian TS only + +proposed transmission transfer syntaxes (outgoing associations): + + -x= --propose-uncompr + propose all uncompressed TS, explicit VR + with local byte ordering first (default) + + -xe --propose-little + propose all uncompressed TS, explicit VR little endian first + + -xb --propose-big + propose all uncompressed TS, explicit VR big endian first + + -xi --propose-implicit + propose implicit VR little endian TS only + + -xs --propose-lossless + propose default JPEG lossless TS + and all uncompressed transfer syntaxes + + -xy --propose-jpeg8 + propose default JPEG lossy TS for 8 bit data + and all uncompressed transfer syntaxes + + -xx --propose-jpeg12 + propose default JPEG lossy TS for 12 bit data + and all uncompressed transfer syntaxes + + -xv --propose-j2k-lossless + propose JPEG 2000 lossless TS + and all uncompressed transfer syntaxes + + -xw --propose-j2k-lossy + propose JPEG 2000 lossy TS + and all uncompressed transfer syntaxes + + -xt --propose-jls-lossless + propose JPEG-LS lossless TS + and all uncompressed transfer syntaxes + + -xu --propose-jls-lossy + propose JPEG-LS lossy TS + and all uncompressed transfer syntaxes + + -xm --propose-mpeg2 + propose MPEG2 Main Profile @ Main Level TS only + + -xh --propose-mpeg2-high + propose MPEG2 Main Profile @ High Level TS only + + -xn --propose-mpeg4 + propose MPEG4 AVC/H.264 High Profile / Level 4.1 TS only + + -xl --propose-mpeg4-bd + propose MPEG4 AVC/H.264 BD-compatible HP / Level 4.1 TS only + + -x2 --propose-mpeg4-2-2d + propose MPEG4 AVC/H.264 HP / Level 4.2 TS for 2D Videos only + + -x3 --propose-mpeg4-2-3d + propose MPEG4 AVC/H.264 HP / Level 4.2 TS for 3D Videos only + + -xo --propose-mpeg4-2-st + propose MPEG4 AVC/H.264 Stereo HP / Level 4.2 TS only + + -x4 --propose-hevc + propose HEVC H.265 Main Profile / Level 5.1 TS only + + -x5 --propose-hevc10 + propose HEVC H.265 Main 10 Profile / Level 5.1 TS only + + -xr --propose-rle + propose RLE lossless TS + and all uncompressed transfer syntaxes + + -xd --propose-deflated + propose deflated explicit VR little endian TS + and all uncompressed transfer syntaxes + +network host access control (tcp wrapper): + + -ac --access-full + accept connections from any host (default) + + +ac --access-control + enforce host access control rules + +other network options: + + -to --timeout [s]econds: integer (default: unlimited) + timeout for connection requests + + -ta --acse-timeout [s]econds: integer (default: 30) + timeout for ACSE messages + + -td --dimse-timeout [s]econds: integer (default: unlimited) + timeout for DIMSE messages + + -pdu --max-pdu [n]umber of bytes: integer (4096..131072) + set max receive pdu to n bytes + (default: use value from configuration file) + + -dhl --disable-host-lookup + disable hostname lookup + + --refuse + refuse association + + --reject + reject association if no implementation class UID + + --ignore + ignore store data, receive but do not store + + # This option causes dcmqrscp database back-end to ignore + # all images received by the Storage Service Class. All images + # will be received from the network but not stored to disk nor + # recorded in database. + + -up --uid-padding + silently correct space-padded UIDs +\endverbatim + +\subsection dcmqrscp_processing_options processing options +\verbatim +specific character set: + + # the following options require support from an underlying character + # encoding library (see output of --version on which one is available) + + +Cr --use-request-charset + try to convert all element values that are affected by + Specific Character Set (0008,0005) to the one specified + in the request data set, fall back to the one specified + via --convert-to-xxx if that is not possible + (default, unless overridden by config file) + + -Cr --override-charset + convert affected element values to the character set + specified via --convert-to-xxx, ignoring the one + specified in the request + + +A7 --convert-to-ascii + convert affected element values to 7-bit ASCII + (default, unless overridden by config file) + + +U8 --convert-to-utf8 + convert affected element values to UTF-8 + + +L1 --convert-to-latin1 + convert affected element values to ISO 8859-1 + + +C --convert-to-charset [c]harset: string + convert affected element values to the character set + specified by the DICOM defined term c + + -Ct --transliterate + try to approximate characters that cannot be + represented through similar looking characters + + -Cd --discard-illegal + discard characters that cannot be represented + in destination character set +\endverbatim + +\subsection dcmqrscp_output_options output options +\verbatim +bit preserving mode: + + -B --normal + allow implicit format conversions (default) + + +B --bit-preserving + write data exactly as read + +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: +(not with --bit-preserving or compressed transmission) + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + + +td --write-xfer-deflated + write with deflated explicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding (not with --bit-preserving): + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items (not with --bit-preserving): + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset or --bit-preserving): + + -p --padding-off + no padding (default) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes + +deflate compression level (only with --propose-deflated or +--write-xfer-deflated/same): + + +cl --compression-level [l]evel: integer (default: 6) + 0=uncompressed, 1=fastest, 9=best compression +\endverbatim + +\section dcmqrscp_notes NOTES + +\subsection dcmqrscp_operation Operation + +\b dcmqrscp waits for another application to connect at the presentation +address (port number) specified in its configuration file (or overridden by a +command line option). When another application connects, \b dcmqrscp expects +it to be a DICOM application and to use calling and called AE Titles specified +in dcmqrscp's configuration file. \b dcmqrscp will accept associations +with Presentation Contexts for SOP Classes of the Verification Service Class, +Storage Service Class and Query/Retrieve Service Class. Associations will be +rejected or Presentation Contexts will be refused if the peer application does +not have appropriate access rights as specified by \b dcmqrscp configuration +file. + +\b dcmqrscp will receive images on Presentation Contexts of the Storage Service +Class, write them to a configurable storage area associated with the class AE +title, extract attributes from these images and store them in a database. +\b dcmqrscp will receive query requests and generate query responses on +Presentation Contexts of the Query/Retrieve Service class. \b dcmqrscp will +receive retrieve requests and generate retrieve responses on Presentation +Contexts of the Query/Retrieve Service class. \b dcmqrscp will also process +C-CANCEL messages to interrupt query/retrieve operations. + +Under normal operations \b dcmqrscp will never exit, it keeps on waiting for +new associations until killed. + +\subsection dcmqrscp_dicom_conformance DICOM Conformance + +\subsubsection dcmqrscp_scu_conformance SCU Conformance + +The \b dcmqrscp application supports the following SOP Classes as an SCU: + +\verbatim +VerificationSOPClass 1.2.840.10008.1.1 + +RETIRED_StoredPrintStorage 1.2.840.10008.5.1.1.27 +RETIRED_HardcopyGrayscaleImageStorage 1.2.840.10008.5.1.1.29 +RETIRED_HardcopyColorImageStorage 1.2.840.10008.5.1.1.30 +ComputedRadiographyImageStorage 1.2.840.10008.5.1.4.1.1.1 +DigitalXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.1 +DigitalXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.1.1 +DigitalMammographyXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.2 +DigitalMammographyXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.2.1 +DigitalIntraOralXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.3 +DigitalIntraOralXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.3.1 +CTImageStorage 1.2.840.10008.5.1.4.1.1.2 +EnhancedCTImageStorage 1.2.840.10008.5.1.4.1.1.2.1 +LegacyConvertedEnhancedCTImageStorage 1.2.840.10008.5.1.4.1.1.2.2 +RETIRED_UltrasoundMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.3 +UltrasoundMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.3.1 +MRImageStorage 1.2.840.10008.5.1.4.1.1.4 +EnhancedMRImageStorage 1.2.840.10008.5.1.4.1.1.4.1 +MRSpectroscopyStorage 1.2.840.10008.5.1.4.1.1.4.2 +EnhancedMRColorImageStorage 1.2.840.10008.5.1.4.1.1.4.3 +LegacyConvertedEnhancedMRImageStorage 1.2.840.10008.5.1.4.1.1.4.4 +RETIRED_NuclearMedicineImageStorage 1.2.840.10008.5.1.4.1.1.5 +RETIRED_UltrasoundImageStorage 1.2.840.10008.5.1.4.1.1.6 +UltrasoundImageStorage 1.2.840.10008.5.1.4.1.1.6.1 +EnhancedUSVolumeStorage 1.2.840.10008.5.1.4.1.1.6.2 +SecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7 +MultiframeSingleBitSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.1 +MultiframeGrayscaleByteSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.2 +MultiframeGrayscaleWordSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.3 +MultiframeTrueColorSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.4 +RETIRED_StandaloneOverlayStorage 1.2.840.10008.5.1.4.1.1.8 +RETIRED_StandaloneCurveStorage 1.2.840.10008.5.1.4.1.1.9 +TwelveLeadECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.1 +GeneralECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.2 +AmbulatoryECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.3 +HemodynamicWaveformStorage 1.2.840.10008.5.1.4.1.1.9.2.1 +CardiacElectrophysiologyWaveformStorage 1.2.840.10008.5.1.4.1.1.9.3.1 +BasicVoiceAudioWaveformStorage 1.2.840.10008.5.1.4.1.1.9.4.1 +GeneralAudioWaveformStorage 1.2.840.10008.5.1.4.1.1.9.4.2 +ArterialPulseWaveformStorage 1.2.840.10008.5.1.4.1.1.9.5.1 +RespiratoryWaveformStorage 1.2.840.10008.5.1.4.1.1.9.6.1 +RETIRED_StandaloneModalityLUTStorage 1.2.840.10008.5.1.4.1.1.10 +RETIRED_StandaloneVOILUTStorage 1.2.840.10008.5.1.4.1.1.11 +GrayscaleSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.1 +ColorSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.2 +PseudoColorSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.3 +BlendingSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.4 +XAXRFGrayscaleSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.5 +XRayAngiographicImageStorage 1.2.840.10008.5.1.4.1.1.12.1 +EnhancedXAImageStorage 1.2.840.10008.5.1.4.1.1.12.1.1 +XRayRadiofluoroscopicImageStorage 1.2.840.10008.5.1.4.1.1.12.2 +EnhancedXRFImageStorage 1.2.840.10008.5.1.4.1.1.12.2.1 +RETIRED_XRayAngiographicBiPlaneImageStorage 1.2.840.10008.5.1.4.1.1.12.3 +XRay3DAngiographicImageStorage 1.2.840.10008.5.1.4.1.1.13.1.1 +XRay3DCraniofacialImageStorage 1.2.840.10008.5.1.4.1.1.13.1.2 +BreastTomosynthesisImageStorage 1.2.840.10008.5.1.4.1.1.13.1.3 +IntravascularOpt.Coh.Tom.ImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.14.1 +IntravascularOpt.Coh.Tom.ImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.14.2 +NuclearMedicineImageStorage 1.2.840.10008.5.1.4.1.1.20 +RawDataStorage 1.2.840.10008.5.1.4.1.1.66 +SpatialRegistrationStorage 1.2.840.10008.5.1.4.1.1.66.1 +SpatialFiducialsStorage 1.2.840.10008.5.1.4.1.1.66.2 +DeformableSpatialRegistrationStorage 1.2.840.10008.5.1.4.1.1.66.3 +SegmentationStorage 1.2.840.10008.5.1.4.1.1.66.4 +SurfaceSegmentationStorage 1.2.840.10008.5.1.4.1.1.66.5 +RealWorldValueMappingStorage 1.2.840.10008.5.1.4.1.1.67 +SurfaceScanMeshStorage 1.2.840.10008.5.1.4.1.1.68.1 +SurfaceScanPointCloudStorage 1.2.840.10008.5.1.4.1.1.68.2 +RETIRED_VLImageStorage 1.2.840.10008.5.1.4.1.1.77.1 +VLEndoscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.1 +VideoEndoscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.1.1 +VLMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.2 +VideoMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.2.1 +VLSlideCoordinatesMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.3 +VLPhotographicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.4 +VideoPhotographicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.4.1 +OphthalmicPhotography8BitImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.1 +OphthalmicPhotography16BitImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.2 +StereometricRelationshipStorage 1.2.840.10008.5.1.4.1.1.77.1.5.3 +OphthalmicTomographyImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.4 +VLWholeSlideMicroscopyImageStorage 1.2.840.10008.5.1.4.1.1.77.1.6 +RETIRED_VLMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.77.2 +LensometryMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.1 +AutorefractionMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.2 +KeratometryMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.3 +SubjectiveRefractionMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.4 +VisualAcuityMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.5 +SpectaclePrescriptionReportStorage 1.2.840.10008.5.1.4.1.1.78.6 +OphthalmicAxialMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.7 +IntraocularLensCalculationsStorage 1.2.840.10008.5.1.4.1.1.78.8 +MacularGridThicknessAndVolumeReportStorage 1.2.840.10008.5.1.4.1.1.79.1 +OphthalmicVisualFieldStaticPerimetryMeasurementsSt. 1.2.840.10008.5.1.4.1.1.80.1 +OphthalmicThicknessMapStorage 1.2.840.10008.5.1.4.1.1.81.1 +BasicTextSRStorage 1.2.840.10008.5.1.4.1.1.88.11 +EnhancedSRStorage 1.2.840.10008.5.1.4.1.1.88.22 +ComprehensiveSRStorage 1.2.840.10008.5.1.4.1.1.88.33 +Comprehensive3DSRStorage 1.2.840.10008.5.1.4.1.1.88.34 +ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40 +MammographyCADSRStorage 1.2.840.10008.5.1.4.1.1.88.50 +KeyObjectSelectionDocumentStorage 1.2.840.10008.5.1.4.1.1.88.59 +ChestCADSRStorage 1.2.840.10008.5.1.4.1.1.88.65 +XRayRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.67 +ColonCADSRStorage 1.2.840.10008.5.1.4.1.1.88.69 +ImplantationPlanSRDocumentStorage 1.2.840.10008.5.1.4.1.1.88.70 +EncapsulatedPDFStorage 1.2.840.10008.5.1.4.1.1.104.1 +EncapsulatedCDAStorage 1.2.840.10008.5.1.4.1.1.104.2 +PositronEmissionTomographyImageStorage 1.2.840.10008.5.1.4.1.1.128 +LegacyConvertedEnhancedPETImageStorage 1.2.840.10008.5.1.4.1.1.128.1 +RETIRED_StandalonePETCurveStorage 1.2.840.10008.5.1.4.1.1.129 +EnhancedPETImageStorage 1.2.840.10008.5.1.4.1.1.130 +BasicStructuredDisplayStorage 1.2.840.10008.5.1.4.1.1.131 +RTImageStorage 1.2.840.10008.5.1.4.1.1.481.1 +RTDoseStorage 1.2.840.10008.5.1.4.1.1.481.2 +RTStructureSetStorage 1.2.840.10008.5.1.4.1.1.481.3 +RTBeamsTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.4 +RTPlanStorage 1.2.840.10008.5.1.4.1.1.481.5 +RTBrachyTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.6 +RTTreatmentSummaryRecordStorage 1.2.840.10008.5.1.4.1.1.481.7 +RTIonPlanStorage 1.2.840.10008.5.1.4.1.1.481.8 +RTIonBeamsTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.9 +RTBeamsDeliveryInstructionStorage 1.2.840.10008.5.1.4.34.7 +\endverbatim + +The \b dcmqrscp application will propose presentation contexts for all of the +abovementioned supported SOP Classes using the transfer syntaxes: + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +This default behavior can be changed with the \e --propose options (see above). +Depending on these options, the following transfer syntaxes are supported: + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +JPEGProcess1TransferSyntax 1.2.840.10008.1.2.4.50 +JPEGProcess2_4TransferSyntax 1.2.840.10008.1.2.4.51 +JPEGProcess14SV1TransferSyntax 1.2.840.10008.1.2.4.70 +JPEGLSLosslessTransferSyntax 1.2.840.10008.1.2.4.80 +JPEGLSLossyTransferSyntax 1.2.840.10008.1.2.4.81 +JPEG2000LosslessOnlyTransferSyntax 1.2.840.10008.1.2.4.90 +JPEG2000TransferSyntax 1.2.840.10008.1.2.4.91 +MPEG2MainProfileAtMainLevelTransferSyntax 1.2.840.10008.1.2.4.100 +MPEG2MainProfileAtHighLevelTransferSyntax 1.2.840.10008.1.2.4.101 +MPEG4HighProfileLevel4_1TransferSyntax 1.2.840.10008.1.2.4.102 +MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax 1.2.840.10008.1.2.4.103 +MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax 1.2.840.10008.1.2.4.104 +MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax 1.2.840.10008.1.2.4.105 +MPEG4StereoHighProfileLevel4_2TransferSyntax 1.2.840.10008.1.2.4.106 +HEVCMainProfileLevel5_1TransferSyntax 1.2.840.10008.1.2.4.107 +HEVCMain10ProfileLevel5_1TransferSyntax 1.2.840.10008.1.2.4.108 +RLELosslessTransferSyntax 1.2.840.10008.1.2.5 +\endverbatim + +The \b dcmqrscp application does not support extended negotiation. + +Presentation contexts for other SOP Classes may be configured via the +\e --assoc-config-file option by selecting an appropriate profile for outgoing +associations. The selected profile will completely override the above mentioned +default configuration. + +\subsubsection dcmqrscp_scp_conformance SCP Conformance + +The \b dcmqrscp application supports the following SOP Classes as an SCP: + +\verbatim +VerificationSOPClass 1.2.840.10008.1.1 + +FINDPatientRootQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.1.1 +FINDPatientStudyOnlyQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.3.1 +FINDStudyRootQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.2.1 +GETPatientRootQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.1.3 +GETPatientStudyOnlyQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.3.3 +GETStudyRootQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.2.3 +MOVEPatientRootQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.1.2 +MOVEPatientStudyOnlyQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.3.2 +MOVEStudyRootQueryRetrieveInformationModel 1.2.840.10008.5.1.4.1.2.2.2 + +RETIRED_StoredPrintStorage 1.2.840.10008.5.1.1.27 +RETIRED_HardcopyGrayscaleImageStorage 1.2.840.10008.5.1.1.29 +RETIRED_HardcopyColorImageStorage 1.2.840.10008.5.1.1.30 +ComputedRadiographyImageStorage 1.2.840.10008.5.1.4.1.1.1 +DigitalXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.1 +DigitalXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.1.1 +DigitalMammographyXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.2 +DigitalMammographyXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.2.1 +DigitalIntraOralXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.3 +DigitalIntraOralXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.3.1 +CTImageStorage 1.2.840.10008.5.1.4.1.1.2 +EnhancedCTImageStorage 1.2.840.10008.5.1.4.1.1.2.1 +LegacyConvertedEnhancedCTImageStorage 1.2.840.10008.5.1.4.1.1.2.2 +RETIRED_UltrasoundMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.3 +UltrasoundMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.3.1 +MRImageStorage 1.2.840.10008.5.1.4.1.1.4 +EnhancedMRImageStorage 1.2.840.10008.5.1.4.1.1.4.1 +MRSpectroscopyStorage 1.2.840.10008.5.1.4.1.1.4.2 +EnhancedMRColorImageStorage 1.2.840.10008.5.1.4.1.1.4.3 +LegacyConvertedEnhancedMRImageStorage 1.2.840.10008.5.1.4.1.1.4.4 +RETIRED_NuclearMedicineImageStorage 1.2.840.10008.5.1.4.1.1.5 +RETIRED_UltrasoundImageStorage 1.2.840.10008.5.1.4.1.1.6 +UltrasoundImageStorage 1.2.840.10008.5.1.4.1.1.6.1 +EnhancedUSVolumeStorage 1.2.840.10008.5.1.4.1.1.6.2 +SecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7 +MultiframeSingleBitSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.1 +MultiframeGrayscaleByteSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.2 +MultiframeGrayscaleWordSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.3 +MultiframeTrueColorSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.4 +RETIRED_StandaloneOverlayStorage 1.2.840.10008.5.1.4.1.1.8 +RETIRED_StandaloneCurveStorage 1.2.840.10008.5.1.4.1.1.9 +DRAFT_WaveformStorage 1.2.840.10008.5.1.4.1.1.9.1 +TwelveLeadECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.1 +GeneralECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.2 +AmbulatoryECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.3 +HemodynamicWaveformStorage 1.2.840.10008.5.1.4.1.1.9.2.1 +CardiacElectrophysiologyWaveformStorage 1.2.840.10008.5.1.4.1.1.9.3.1 +BasicVoiceAudioWaveformStorage 1.2.840.10008.5.1.4.1.1.9.4.1 +GeneralAudioWaveformStorage 1.2.840.10008.5.1.4.1.1.9.4.2 +ArterialPulseWaveformStorage 1.2.840.10008.5.1.4.1.1.9.5.1 +RespiratoryWaveformStorage 1.2.840.10008.5.1.4.1.1.9.6.1 +RETIRED_StandaloneModalityLUTStorage 1.2.840.10008.5.1.4.1.1.10 +RETIRED_StandaloneVOILUTStorage 1.2.840.10008.5.1.4.1.1.11 +GrayscaleSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.1 +ColorSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.2 +PseudoColorSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.3 +BlendingSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.4 +XAXRFGrayscaleSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.5 +GrayscalePlanarMPRVolumetricPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.6 +CompositingPlanarMPRVolumetricPresent.StateStorage 1.2.840.10008.5.1.4.1.1.11.7 +AdvancedBlendingPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.8 +VolumeRenderingVolumetricPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.9 +SegmentedVolumeRenderingVolumetricPres.StateStorage 1.2.840.10008.5.1.4.1.1.11.10 +MultipleVolumeRenderingVolumetricPres.StateStorage 1.2.840.10008.5.1.4.1.1.11.11 +XRayAngiographicImageStorage 1.2.840.10008.5.1.4.1.1.12.1 +EnhancedXAImageStorage 1.2.840.10008.5.1.4.1.1.12.1.1 +XRayRadiofluoroscopicImageStorage 1.2.840.10008.5.1.4.1.1.12.2 +EnhancedXRFImageStorage 1.2.840.10008.5.1.4.1.1.12.2.1 +RETIRED_XRayAngiographicBiPlaneImageStorage 1.2.840.10008.5.1.4.1.1.12.3 +XRay3DAngiographicImageStorage 1.2.840.10008.5.1.4.1.1.13.1.1 +XRay3DCraniofacialImageStorage 1.2.840.10008.5.1.4.1.1.13.1.2 +BreastTomosynthesisImageStorage 1.2.840.10008.5.1.4.1.1.13.1.3 +BreastProjectionXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.13.1.4 +BreastProjectionXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.13.1.5 +IntravascularOpt.Coh.Tom.ImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.14.1 +IntravascularOpt.Coh.Tom.ImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.14.2 +NuclearMedicineImageStorage 1.2.840.10008.5.1.4.1.1.20 +ParametricMapStorage 1.2.840.10008.5.1.4.1.1.30 +RawDataStorage 1.2.840.10008.5.1.4.1.1.66 +SpatialRegistrationStorage 1.2.840.10008.5.1.4.1.1.66.1 +SpatialFiducialsStorage 1.2.840.10008.5.1.4.1.1.66.2 +DeformableSpatialRegistrationStorage 1.2.840.10008.5.1.4.1.1.66.3 +SegmentationStorage 1.2.840.10008.5.1.4.1.1.66.4 +SurfaceSegmentationStorage 1.2.840.10008.5.1.4.1.1.66.5 +TractographyResultsStorage 1.2.840.10008.5.1.4.1.1.66.6 +RealWorldValueMappingStorage 1.2.840.10008.5.1.4.1.1.67 +SurfaceScanMeshStorage 1.2.840.10008.5.1.4.1.1.68.1 +SurfaceScanPointCloudStorage 1.2.840.10008.5.1.4.1.1.68.2 +RETIRED_VLImageStorage 1.2.840.10008.5.1.4.1.1.77.1 +VLEndoscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.1 +VideoEndoscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.1.1 +VLMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.2 +VideoMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.2.1 +VLSlideCoordinatesMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.3 +VLPhotographicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.4 +VideoPhotographicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.4.1 +OphthalmicPhotography8BitImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.1 +OphthalmicPhotography16BitImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.2 +StereometricRelationshipStorage 1.2.840.10008.5.1.4.1.1.77.1.5.3 +OphthalmicTomographyImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.4 +WideFieldOphthalmicPhoto.Stereogr.Proj.ImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.5 +WideFieldOphthalmicPhotogr.3DCoordinatesImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.6 +OphthalmicOpticalCoherenceTomogr.EnFaceImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.7 +OphthalmicOpticalCoh.Tomogr.BscanVolumeAnalysisStor. 1.2.840.10008.5.1.4.1.1.77.1.5.8 +VLWholeSlideMicroscopyImageStorage 1.2.840.10008.5.1.4.1.1.77.1.6 +RETIRED_VLMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.77.2 +LensometryMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.1 +AutorefractionMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.2 +KeratometryMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.3 +SubjectiveRefractionMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.4 +VisualAcuityMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.5 +SpectaclePrescriptionReportStorage 1.2.840.10008.5.1.4.1.1.78.6 +OphthalmicAxialMeasurementsStorage 1.2.840.10008.5.1.4.1.1.78.7 +IntraocularLensCalculationsStorage 1.2.840.10008.5.1.4.1.1.78.8 +MacularGridThicknessAndVolumeReportStorage 1.2.840.10008.5.1.4.1.1.79.1 +OphthalmicVisualFieldStaticPerimetryMeasurementsSt. 1.2.840.10008.5.1.4.1.1.80.1 +OphthalmicThicknessMapStorage 1.2.840.10008.5.1.4.1.1.81.1 +CornealTopographyMapStorage 1.2.840.10008.5.1.4.1.1.82.1 +DRAFT_SRTextStorage 1.2.840.10008.5.1.4.1.1.88.1 +DRAFT_SRAudioStorage 1.2.840.10008.5.1.4.1.1.88.2 +DRAFT_SRDetailStorage 1.2.840.10008.5.1.4.1.1.88.3 +DRAFT_SRComprehensiveStorage 1.2.840.10008.5.1.4.1.1.88.4 +BasicTextSRStorage 1.2.840.10008.5.1.4.1.1.88.11 +EnhancedSRStorage 1.2.840.10008.5.1.4.1.1.88.22 +ComprehensiveSRStorage 1.2.840.10008.5.1.4.1.1.88.33 +Comprehensive3DSRStorage 1.2.840.10008.5.1.4.1.1.88.34 +ExtensibleSRStorage 1.2.840.10008.5.1.4.1.1.88.35 +ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40 +MammographyCADSRStorage 1.2.840.10008.5.1.4.1.1.88.50 +KeyObjectSelectionDocumentStorage 1.2.840.10008.5.1.4.1.1.88.59 +ChestCADSRStorage 1.2.840.10008.5.1.4.1.1.88.65 +XRayRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.67 +RadiopharmaceuticalRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.68 +ColonCADSRStorage 1.2.840.10008.5.1.4.1.1.88.69 +ImplantationPlanSRDocumentStorage 1.2.840.10008.5.1.4.1.1.88.70 +AcquisitionContextSRStorage 1.2.840.10008.5.1.4.1.1.88.71 +SimplifiedAdultEchoSRStorage 1.2.840.10008.5.1.4.1.1.88.72 +PatientRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.73 +PlannedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.74 +PerformedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.75 +ContentAssessmentResultsStorage 1.2.840.10008.5.1.4.1.1.90.1 +EncapsulatedPDFStorage 1.2.840.10008.5.1.4.1.1.104.1 +EncapsulatedCDAStorage 1.2.840.10008.5.1.4.1.1.104.2 +EncapsulatedSTLStorage 1.2.840.10008.5.1.4.1.1.104.3 +PositronEmissionTomographyImageStorage 1.2.840.10008.5.1.4.1.1.128 +LegacyConvertedEnhancedPETImageStorage 1.2.840.10008.5.1.4.1.1.128.1 +RETIRED_StandalonePETCurveStorage 1.2.840.10008.5.1.4.1.1.129 +EnhancedPETImageStorage 1.2.840.10008.5.1.4.1.1.130 +BasicStructuredDisplayStorage 1.2.840.10008.5.1.4.1.1.131 +CTPerformedProcedureProtocolStorage 1.2.840.10008.5.1.4.1.1.200.2 +RTImageStorage 1.2.840.10008.5.1.4.1.1.481.1 +RTDoseStorage 1.2.840.10008.5.1.4.1.1.481.2 +RTStructureSetStorage 1.2.840.10008.5.1.4.1.1.481.3 +RTBeamsTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.4 +RTPlanStorage 1.2.840.10008.5.1.4.1.1.481.5 +RTBrachyTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.6 +RTTreatmentSummaryRecordStorage 1.2.840.10008.5.1.4.1.1.481.7 +RTIonPlanStorage 1.2.840.10008.5.1.4.1.1.481.8 +RTIonBeamsTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.9 +RTPhysicianIntentStorage 1.2.840.10008.5.1.4.1.1.481.10 +RTSegmentAnnotationStorage 1.2.840.10008.5.1.4.1.1.481.11 +RTRadiationSetStorage 1.2.840.10008.5.1.4.1.1.481.12 +CArmPhotonElectronRadiationStorage 1.2.840.10008.5.1.4.1.1.481.13 +DICOS_CTImageStorage 1.2.840.10008.5.1.4.1.1.501.1 +DICOS_DigitalXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.501.2.1 +DICOS_DigitalXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.501.2.2 +DICOS_ThreatDetectionReportStorage 1.2.840.10008.5.1.4.1.1.501.3 +DICOS_2DAITStorage 1.2.840.10008.5.1.4.1.1.501.4 +DICOS_3DAITStorage 1.2.840.10008.5.1.4.1.1.501.5 +DICOS_QuadrupoleResonanceStorage 1.2.840.10008.5.1.4.1.1.501.6 +DICONDE_EddyCurrentImageStorage 1.2.840.10008.5.1.4.1.1.601.1 +DICONDE_EddyCurrentMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.601.2 +DRAFT_RTBeamsDeliveryInstructionStorage 1.2.840.10008.5.1.4.34.1 +RTBeamsDeliveryInstructionStorage 1.2.840.10008.5.1.4.34.7 +RTBrachyApplicationSetupDeliveryInstructionStorage 1.2.840.10008.5.1.4.34.10 + +PrivateShutdownSOPClass 1.2.276.0.7230010.3.4.1915765545.18030.917282194.0 +\endverbatim + +The \b dcmqrscp application will accept presentation contexts for all of the +above mentioned supported SOP Classes using any of the transfer syntaxes: + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +The \b dcmqrscp application will prefer transfer syntaxes having an explicit +encoding over the default implicit transfer syntax. If \b dcmqrscp is running +on big-endian hardware it will prefer BigEndianExplicit to LittleEndianExplicit +transfer syntax (and vice versa). This behavior can be changed with the +\e --prefer options (see above). Depending on these options, the following +transfer syntaxes are supported: + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +JPEGProcess1TransferSyntax 1.2.840.10008.1.2.4.50 +JPEGProcess2_4TransferSyntax 1.2.840.10008.1.2.4.51 +JPEGProcess14SV1TransferSyntax 1.2.840.10008.1.2.4.70 +JPEGLSLosslessTransferSyntax 1.2.840.10008.1.2.4.80 +JPEGLSLossyTransferSyntax 1.2.840.10008.1.2.4.81 +JPEG2000LosslessOnlyTransferSyntax 1.2.840.10008.1.2.4.90 +JPEG2000TransferSyntax 1.2.840.10008.1.2.4.91 +MPEG2MainProfileAtMainLevelTransferSyntax 1.2.840.10008.1.2.4.100 +MPEG2MainProfileAtHighLevelTransferSyntax 1.2.840.10008.1.2.4.101 +MPEG4HighProfileLevel4_1TransferSyntax 1.2.840.10008.1.2.4.102 +MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax 1.2.840.10008.1.2.4.103 +MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax 1.2.840.10008.1.2.4.104 +MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax 1.2.840.10008.1.2.4.105 +MPEG4StereoHighProfileLevel4_2TransferSyntax 1.2.840.10008.1.2.4.106 +HEVCMainProfileLevel5_1TransferSyntax 1.2.840.10008.1.2.4.107 +HEVCMain10ProfileLevel5_1TransferSyntax 1.2.840.10008.1.2.4.108 +RLELosslessTransferSyntax 1.2.840.10008.1.2.5 +\endverbatim + +The \b dcmqrscp application does not support extended negotiation. + +Presentation contexts for other SOP Classes may be configured via the +\e --assoc-config-file option by selecting an appropriate profile for incoming +associations. The selected profile will override only the above mentioned +storage SOP classes, \b dcmqrscp will accept contexts with the above mentioned +FIND, GET, MOVE and private shutdown SOP Classes additionally to the ones +defined in the selected profile. Please note that an appropriate profile for +role negotiation must be defined and used for enabling GET support. + +\subsubsection dcmqrscp_query_keys Query Keys + +The \b dcmqrscp application supports the following attributes as query keys. + +Query/Retrieve Level: PATIENT (or STUDY for the Study Root Q/R model) + +\verbatim +(0010,0010) PatientName +(0010,0020) PatientID +(0010,0021) IssuerOfPatientID +(0010,0030) PatientBirthDate +(0010,0032) PatientBirthTime +(0010,0040) PatientSex +(0010,1000) OtherPatientIDs (retired) +(0010,1001) OtherPatientNames +(0010,2160) EthnicGroup +(0010,4000) PatientComments +\endverbatim + +Query/Retrieve Level: STUDY + +\verbatim +(0008,0020) StudyDate +(0008,0030) StudyTime +(0008,0050) AccessionNumber +(0008,0090) ReferringPhysicianName +(0008,1030) StudyDescription +(0008,1060) NameOfPhysiciansReadingStudy +(0008,1080) AdmittingDiagnosesDescription +(0010,1010) PatientAge +(0010,1020) PatientSize +(0010,1030) PatientWeight +(0010,2180) Occupation +(0010,21B0) AdditionalPatientHistory +(0020,000D) StudyInstanceUID +(0020,0010) StudyID +(0020,1070) RETIRED_OtherStudyNumbers +\endverbatim + +Query/Retrieve Level: SERIES + +\verbatim +(0008,0060) Modality +(0020,000E) SeriesInstanceUID +(0020,0011) SeriesNumber +\endverbatim + +Query/Retrieve Level: IMAGE + +\verbatim +(0008,0018) SOPInstanceUID +(0020,0013) InstanceNumber +\endverbatim + +\subsection dcmqrscp_configuration Configuration + +The \b dcmqrscp program uses the same configuration file as the \b dcmqrti +program. See the documentation on configuration for more information. + +\subsection dcmqrscp_access_control Access Control + +When compiled on Unix platforms with TCP wrapper support, host-based access +control can be enabled with the \e --access-control command line option. In +this case the access control rules defined in the system's host access control +tables for \b dcmqrscp are enforced. The default locations of the host access +control tables are /etc/hosts.allow and /etc/hosts.deny. +Further details are described in hosts_access(5). + +\section dcmqrscp_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmqrscp_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmqrscp_environment ENVIRONMENT + +The \b dcmqrscp utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built into +the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmqrscp_files FILES + +\/dcmqrcnf.txt - configuration information +\n\/dcmqrset.txt - setup information +\n\/dcmqrscp.cfg - example configuration file +\n\/dcmqrprf.cfg - example configuration file for association profiles + +\section dcmqrscp_see_also SEE ALSO + +dcmqridx(1), dcmqrti(1) + +\section dcmqrscp_copyright COPYRIGHT + +Copyright (C) 1993-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmqrdb/docs/dcmqrset.txt b/dcmqrdb/docs/dcmqrset.txt new file mode 100644 index 00000000..ef0aa59a --- /dev/null +++ b/dcmqrdb/docs/dcmqrset.txt @@ -0,0 +1,122 @@ + +SETTING UP DCMQRSCP AND DCMQRTI + +Before attempting to setup dcmqrscp or dcmqrti you should read the documentation +for these programs (dcmqrscp and dcmqrti man pages) as well as the documentation +on configuration (dcmqrcnf.txt). + +Step 1: + +Create a directory where the image databases will be located. +e.g. + mkdir /home/dicom/db + +Step 2: + +Create subdirectories for each individual image database storage areas to be +managed by dcmqrscp. Each database storage area corresponds to an Application +Entity (AE) title of dcmqrscp. +e.g. + cd /home/dicom/db + mkdir COMMON ACME_STORE UNITED_STORE + +Step 3: + +Copy the example configuration file (dcmqrscp.cfg) to the main image database +directory. +e.g. + cp /usr/local/etc/dcmtk/dcmqrscp.cfg /home/dicom/db + +Step 4: + +Edit your copy of the configuration file. You may have used different image +database directory and subdirectory names than in the examples above. If so, +edit the AETable (near the bottom) of your dcmqrscp.cfg file and change the first +and second columns to reflect the names you have chosen (AE title and directory +paths). + +Step 5: + +Determine the hostnames, TCP/IP port numbers, and AE titles of the DICOM +applications you will be communicating with. You need to edit your copy of +dcmqrscp.cfg to include these in the HostTable section. + +Step 6: + +Edit the VendorTable to give a string title to symbolic names declared in the +HostTable. + +Step 7: + +If you wish to restrict access to image databases to particular remote +applications (peers) you need to edit the last column of the AETable to contain +a symbolic name defined in the HostTable. If no access restrictions are desired +you can use the constant name ANY. + +Step 8 (optional): + +If you wish to initialize a database storage area to reference a set of external +images, you can use the dcmqridx utility. This step would normally only be +performed on a read-only database storage area since sending images to such a +storage area (AE title) might cause your original images to be deleted if the +quota specifications (4th column of the AETable in dcmqrscp.cfg) are exceeded. +e.g. + dcmqridx -v /home/dicom/db/COMMON /home/dicom/images/rsna95/*/*/* + +would register the "rsna95" images in the COMMON storage area (which is defined +as read-only in dcmqrscp.cfg). The "rsna95" images are available via ftp from +the Mallinckrodt Institute of Radiology, St. Louis, USA : + + ftp://wuerlim.wustl.edu/pub/dicom/images/version3/RSNA95 + +Step 9: + +You can now start the dcmqrscp application. +e.g. + dcmqrscp -v -c /home/dicom/db/dcmqrscp.cfg 5678 + +will start dcmqrscp in verbose mode, using the configuration file you created +and edited in steps 3 to 8, and listening on TCP/IP port 5678. The dcmqrscp +application will wait for DICOM association requests and will never exit. + +Step 10: + +You can try sending a DICOM image to dcmqrscp from one of the remote machines +which may access dcmqrscp's storage areas. +e.g. + storescu -v --aetitle ACME1 --call ACME_STORE dbhost 5678 ctimage.dcm + +will start the storescu application in verbose mode, giving it the DICOM AE +title ACME1, and requesting that it transmit the DICOM image ctimage.dcm to +the ACME_STORE storage area of dcmqrscp which is running on the host dbhost +(attached to port 5678, as in step 9). The AE title which storescu uses (via +the -t option) and the host on which it is running must match the values known +to dcmqrscp in its dcmqrscp.cfg file. See the storescu man page for more +information on the storescu application. + +Step 11: + +On the remote machine used in step 10 you can start a DICOM Storage SCP which +is capable of receiving images. +e.g. + storescp -v 3456 + +will start storescp in verbose mode listening on port 3456 for incoming +associations. See the storescp man page for more information on the storescp +application. + +Step 12: + +You can try using the dcmqrti application to examine the database storage +areas and send images to the storescp application started in step 11. +dcmqrti should be run on the same host as dcmqrscp. +e.g. + dcmqrti -c /home/dicom/db/dcmqrscp.cfg acmeCTcompany + +will start the dcmqrti application using the configuration file you created +and edited in steps 3 to 8, with the capability to communicate to the +applications defined by the symbolic name acmeCTcompany. You can use the +"database" command to select a database, the "title" command to select a +remote application, "echo" to send an echo message, and "send study" to +transmit a complete study. See the dcmqrti man page for more information on +the commands accepted by dcmqrti. diff --git a/dcmqrdb/docs/dcmqrti.man b/dcmqrdb/docs/dcmqrti.man new file mode 100644 index 00000000..995ddbc3 --- /dev/null +++ b/dcmqrdb/docs/dcmqrti.man @@ -0,0 +1,448 @@ +/*! + +\if MANPAGES +\page dcmqrti The Terminal Initiator Telnet Client Program +\else +\page dcmqrti dcmqrti: The Terminal Initiator Telnet Client Program +\endif + +\section dcmqrti_synopsis SYNOPSIS + +\verbatim +dcmqrti [options] peer... +\endverbatim + +\section dcmqrti_description DESCRIPTION + +The \b dcmqrti program (telnet initiator) is an interactive character based +program intended to be used for examining the dcmqrscp image databases and +sending images contained within these databases to Vendor nodes. During a +DICOM Demonstration the \b dcmqrti program can be activated by a Vendor by +logging onto the computer running the \b dcmqrscp program. Each vendor will +have their own login account and the \b dcmqrti program will be started +instead of a normal shell when they login. + +The \b dcmqrti program takes one main argument, the hostname or vendor +symbolic name (from the VendorTable in the configuration file) of a Vendor. +It then searches in the configuration file for all AE titles associated with +this hostname or vendor name, and all storage areas accessible to these AE +titles. Thus only the accessible databases and peer applications discovered +in the configuration file are available as choices within the \b dcmqrti user +interface. + +\section dcmqrti_parameters PARAMETERS + +\verbatim +peer peer host name or symbolic name from cfg file +\endverbatim + +\section dcmqrti_options OPTIONS + +\subsection dcmqrti_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger + + -c --config [f]ilename: string + use specific configuration file + (default: /usr/local/etc/dcmqrscp.cfg) +\endverbatim + +\subsection dcmqrti_network_options network options +\verbatim + -to --timeout [s]econds: integer (default: unlimited) + timeout for connection requests + + -ta --acse-timeout [s]econds: integer (default: 30) + timeout for ACSE messages + + -td --dimse-timeout [s]econds: integer (default: unlimited) + timeout for DIMSE messages + + -xi --propose-implicit + propose implicit VR little endian TS only + + -aet --aetitle [a]etitle: string + set my AE title (default: TELNET_INITIATOR) + + -pdu --max-pdu [n]umber of bytes: integer (4096..131072) + set max receive pdu to n bytes + (default: use value from configuration file) +\endverbatim + +\subsection dcmqrti_other_options other options +\verbatim + -u --disable-new-vr + disable support for new VRs, convert to OB + + -rmt --remote [t]itle: string + connect to remote database defined in cfg file +\endverbatim + +\section dcmqrti_NOTES + +\subsection dcmqrti_commands Commands + +All commands can be abbreviated. An abbreviation is allowed if it does not +conflict with another command. + +\subsubsection dcmqrti_help_command "help" Command + +The "help" command gives a summary of all available commands. Its output is +shown underneath. In order to separate the examples from surrounding text, +all examples are bracketed by dashed lines. These lines do not appear when +running the program. + +\verbatim +------------------------------------------------------------ +Command Summary: +help list this summary +? short help +title [#] list [set] current peer AE title +database [#] list [set] current database +study [#] list [set] current study +series [#] list [set] current series +image [#] list [set] current image +display [#] display current [specific] image +send study [#] send current [specific] study +send series [#] send current [specific] series +send image [#] send current [specific] image +echo [#] verify connectivity [# times] +quit quit program +exit synonym for quit +------------------------------------------------------------ +\endverbatim + +\subsubsection dcmqrti_title_command "title" Command + +The "title" command without an argument allows the user to list the known +remote Application Entities (AE). An example output might look like: + +\verbatim +------------------------------------------------------------ +Peer AE Titles: + Peer AE HostName:PortNumber +* 0) ACME1 (swallow:2001) + 1) ACME2 (swallow:2002) + 2) UNITED1 (kolibri:2001) + 3) UNITED2 (kolibri:2002) +------------------------------------------------------------ +\endverbatim + +The current peer AE is marked with an asterisk (*). Each peer AE has an index +(second column) which can be used as an argument to the "title" command in +order to set the current peer AE. The third column gives the AE title of the +peer AE. The fourth column shows the hostname and TCP/IP port number of the +peer AE. + +When invoked with an argument index, the "title" command will set the current +peer AE. The \b dcmqrti program will attempt to initiate an association to the +current peer AE when asked to send a study/series/image or to send an echo. + +\subsubsection dcmqrti_database_command "database" Command + +The "database" command without an argument allows the user to list the know +local databases (these correspond to dcmqrscp's Application Entity Titles). +An example output might look like: + +\verbatim +------------------------------------------------------------ +Database Titles: + Database +* 0) COMMON + 1) ACME_QUERY + 2) ACME_STORE + 3) UNITED_QUERY +------------------------------------------------------------ +\endverbatim + +The current database is marked with an asterisk (*). Each database has an +index (second column) which can be used as an argument to the "database" +command in order to set the current database. The third column shows the name +of the database (i.e. the dcmqrscp Application Entity title for the particular +storage area). + +When invoked with an argument index, the "database" command will set the +current database. The current database is used as the basis for further +database specific actions. + +\subsubsection dcmqrti_study_command "study" Command + +The "study" command with no argument lists the studies in the current +database. An example output might look like: + +\verbatim +------------------------------------------------------------ + Patient PatientID StudyID +* 0) JACKSON^ANDREW^^^ M4997106 20001 + 1) GRANT^MARY^^^ F4997108 20002 + 2) ARTHUR^CHESTER^^^ M4997107 20003 + 3) JEFFERSON^THOMAS^^^ M4997096 9465 + 4) MADISON^DOLLY^^^ F4997097 9443 + +4 Studies in Database: COMMON +------------------------------------------------------------ +\endverbatim + +The current study is marked with an asterisk (*). Each study has an index +(second column) which can be used as an argument to the "study" command in +order to set the current study. The third column shows the patient name, the +fourth column the patient ID and the fifth column the study ID. + +When invoked with an argument index, the "study" command will set the current +study. The current study is used as the basis for further study specific +actions. + +\subsubsection dcmqrti_series_command "series" Command + +The "series" command with no argument lists the series in the current study. +An example output might look like: + +\verbatim +------------------------------------------------------------ + Series Modality SeriesInstanceUID +* 0) 1 MR 1.2.840.113654.2.3.1993.201 + 1) 2 MR 1.2.840.113654.2.3.1993.202 + 2) 3 MR 1.2.840.113654.2.3.1993.203 + 3) 4 MR 1.2.840.113654.2.3.1993.204 + 4) 5 MR 1.2.840.113654.2.3.1993.205 + +5 Series in StudyID 05381, + Patient: MONROE^JAMES^^^ (Database: COMMON) +------------------------------------------------------------ +\endverbatim + +The current series is marked with an asterisk (*). Each series has an index +(second column) which can be used as an argument to the "series" command in +order to set the current series. The third column shows the series number, +the fourth column the series modality, and the fifth column the series +instance UID. + +When invoked with an argument index, the "series" command will set the current +series. The current series is used as the basis for further series specific +actions. + +\subsubsection dcmqrti_image_command "image" Command + +The "image" command with no argument lists the images in the current series. +An example output might look like: + +\verbatim +------------------------------------------------------------ + Image ImageInstanceUID +* 0) 1 1.2.840.113654.2.3.1993.9.123.6.2674 + 1) 2 1.2.840.113654.2.3.1993.9.123.6.2675 + 2) 3 1.2.840.113654.2.3.1993.9.123.6.2676 + 3) 4 1.2.840.113654.2.3.1993.9.123.6.2677 + 4) 5 1.2.840.113654.2.3.1993.9.123.6.2678 + 5) 6 1.2.840.113654.2.3.1993.9.123.6.2679 + 6) 7 1.2.840.113654.2.3.1993.9.123.6.2680 + 7) 8 1.2.840.113654.2.3.1993.9.123.6.2681 + 8) 9 1.2.840.113654.2.3.1993.9.123.6.2682 + 9) 10 1.2.840.113654.2.3.1993.9.123.6.2683 + 10) 11 1.2.840.113654.2.3.1993.9.123.6.2684 + 11) 12 1.2.840.113654.2.3.1993.9.123.6.2685 + 12) 13 1.2.840.113654.2.3.1993.9.123.6.2686 + +13 Images in MR Series, StudyID 05381, + Patient: MONROE^JAMES^^^ (Database: COMMON) +------------------------------------------------------------ +\endverbatim + +The current image is marked with an asterisk (*). Each image has an index +(second column) which can be used as an argument to the "image" command in +order to set the current image. The third column shows the image number, and +the fourth column the image instance UID (SOP Instance UID). + +When invoked with an argument index, the "image" command will set the current +image. The current image is used as the basis for further image specific +actions. + +\subsubsection dcmqrti_display_command "display" Command + +The display command serves no purpose in the current version of DCMTK. It was +used in prior releases to request the CTN Display Program to display an image. + +\subsubsection dcmqrti_send_command "send" Command + +The "send" command allows a complete study/series or individual image to be +stored on a remote AE. When this command is invoked, the \b dcmqrti program +will operate as a SCU of the DICOM Storage Service Class and attempt to +initiate an association with the current peer AE (defined via the "title" +command). Presentation contexts for all relevant Storage SOP Classes will be +proposed. An attempt will be made to store all specified images. If no +association could be negotiated an error message will be printed. If an +storage operation fails or if no appropriate presentation context is available +and error message will be printed. + +\verbatim +The "send" command exists in three forms: + + send study [#] + send series [#] + send image [#] +\endverbatim + +The "study" keyword means send all images in the current study. When invoked +with an argument index, the specified study in the current database will be +stored. The "series" keyword means send all images in the current series. +When invoked with an argument index, the specified series in the current study +will be stored. The "image" keyword means send the current image. When +invoked with an argument index, the specified image in the current series will +be stored. + +When an image is stored, a message will be printed of the form: +\verbatim +------------------------------------------------------------ +New Association Started (swallow:2001,ACME1) +[MsgID 1] Store, + PatientName: JACKSON^ANDREW^^^, StudyID: 20001, + Series: 2, Modality: CR, Image: 1, + Image UID: 1.2.840.113654.2.3.1993.9.123.6.1834 + 0%________25%_________50%__________75%________100% + -------------------------------------------------- +[MsgID 1] Complete [Status: Success] +Released Association (swallow:2001,ACME1) +------------------------------------------------------------ +\endverbatim + +\subsubsection dcmqrti_echo_command "echo" Command + +The "echo" command allows the user to verify connectivity with the current +peer AE (defined via the "title" command). When invoked, the \b dcmqrti +program acts as an SCU of the Verification Service Class. + +When invoked without an argument, only one C-ECHO message is generated. When +invoked with an argument, the specified number of C-ECHO messages will be +sent. A message will be printed of the form: + +\verbatim +------------------------------------------------------------ +New Association Started (localhost:2001,CMOVE) +[MsgID 1] Echo, Complete [Status: Success] +Released Association (localhost:2001,CMOVE) +------------------------------------------------------------ +\endverbatim + +\subsubsection dcmqrti_quit_exit_commands "quit", "exit" Commands + +The "quit" and "exit" commands have the same effect. They terminate the +\b dcmqrti program. + +\subsection dcmqrti_dicom_conformance DICOM Conformance + +The \b dcmqrti application supports the same set of SOP Classes as an SCU as +the \b dcmqrscp application - see dcmqrscp documentation. + +The \b dcmqrti application will propose presentation contexts for all of the +abovementioned supported SOP Classes using the transfer syntaxes: + +\verbatim +LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 +LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 +BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 +\endverbatim + +The \b dcmqrti application does not support extended negotiation. + +\subsection dcmqrti_configuration Configuration + +The \b dcmqrti program uses the same configuration file as the \b dcmqrscp +program. See the documentation on configuration for more information +(dcmqrcnf.txt and the example configuration file +dcmqrscp.cfg). + +\section dcmqrti_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmqrti_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmqrti_environment ENVIRONMENT + +The \b dcmqrti utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built into +the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmqrti_files FILES + +\/dcmqrcnf.txt - configuration information +\n\/dcmqrset.txt - setup information +\n\/dcmqrscp.cfg - example configuration file + +\section dcmqrti_see_also SEE ALSO + +dcmqrscp(1) + +\section dcmqrti_copyright COPYRIGHT + +Copyright (C) 1993-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmqrdb/etc/CMakeLists.txt b/dcmqrdb/etc/CMakeLists.txt new file mode 100644 index 00000000..f64f09a7 --- /dev/null +++ b/dcmqrdb/etc/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES dcmqrscp.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc) diff --git a/dcmqrdb/etc/Makefile.in b/dcmqrdb/etc/Makefile.in new file mode 100644 index 00000000..b1da51b6 --- /dev/null +++ b/dcmqrdb/etc/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmqrdb/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = dcmqrscp.cfg + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(etcdir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(etcdir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmqrdb/etc/dcmqrprf.cfg b/dcmqrdb/etc/dcmqrprf.cfg new file mode 100644 index 00000000..881db973 --- /dev/null +++ b/dcmqrdb/etc/dcmqrprf.cfg @@ -0,0 +1,1110 @@ +# +# Copyright (C) 2017-2019, OFFIS e.V. +# All rights reserved. See COPYRIGHT file for details. +# +# This software and supporting documentation were developed by +# +# OFFIS e.V. +# R&D Division Health +# Escherweg 2 +# D-26121 Oldenburg, Germany +# +# Module: dcmqrdb +# +# Author: Jan Schlamelcher +# +# Purpose: Sample storage profiles configuration file for dcmqrscp +# + +# ============================================================================ +[[TransferSyntaxes]] +# ============================================================================ + +[Uncompressed] +TransferSyntax1 = LocalEndianExplicit +TransferSyntax2 = OppositeEndianExplicit +TransferSyntax3 = LittleEndianImplicit + +[UncompressedOrZlib] +TransferSyntax1 = DeflatedLittleEndianExplicit +TransferSyntax2 = LocalEndianExplicit +TransferSyntax3 = OppositeEndianExplicit +TransferSyntax4 = LittleEndianImplicit + +[JPEGBaseline] +TransferSyntax1 = JPEGBaseline + +[JPEGLossless] +TransferSyntax1 = JPEGLossless:Non-hierarchical-1stOrderPrediction + +[RLE] +TransferSyntax1 = RLELossless + +[MPEG2] +TransferSyntax1 = MPEG2MainProfile@MainLevel +# +# commented out the following line since we do not support transcoding of MPEG2 +# +#TransferSyntax2 = MPEG2MainProfile@HighLevel + +[MPEG4] +TransferSyntax1 = MPEG4HighProfile/Level4.1 +# +# commented out the following lines since we do not support transcoding of MPEG4 +# +#TransferSyntax2 = MPEG4BDcompatibleHighProfile/Level4.1 +#TransferSyntax3 = MPEG4HighProfile/Level4.2For2DVideo +#TransferSyntax4 = MPEG4HighProfile/Level4.2For3DVideo +#TransferSyntax5 = MPEG4StereoHighProfile/Level4.2 + +[AnyTransferSyntax] +TransferSyntax1 = JPEG2000 +TransferSyntax2 = JPEG2000LosslessOnly +TransferSyntax3 = JPEGExtended:Process2+4 +TransferSyntax4 = JPEGBaseline +TransferSyntax5 = JPEGLossless:Non-hierarchical-1stOrderPrediction +TransferSyntax6 = JPEGLSLossy +TransferSyntax7 = JPEGLSLossless +TransferSyntax8 = RLELossless +TransferSyntax9 = MPEG2MainProfile@MainLevel +TransferSyntax10 = MPEG2MainProfile@HighLevel +TransferSyntax11 = MPEG4HighProfile/Level4.1 +TransferSyntax12 = MPEG4BDcompatibleHighProfile/Level4.1 +TransferSyntax13 = MPEG4HighProfile/Level4.2For2DVideo +TransferSyntax14 = MPEG4HighProfile/Level4.2For3DVideo +TransferSyntax15 = MPEG4StereoHighProfile/Level4.2 +TransferSyntax16 = HEVCMainProfile/Level5.1 +TransferSyntax17 = HEVCMain10Profile/Level5.1 +TransferSyntax18 = DeflatedLittleEndianExplicit +TransferSyntax19 = LocalEndianExplicit +TransferSyntax20 = OppositeEndianExplicit +TransferSyntax21 = LittleEndianImplicit + +# ============================================================================ +[[PresentationContexts]] +# ============================================================================ + +[GenericStorageSCP] +# +# Don't forget to support the Verification SOP Class. +# +PresentationContext1 = VerificationSOPClass\Uncompressed +# +# Accept image SOP classes with virtually any transfer syntax we know. +# Accept non-image SOP classes uncompressed or with zlib compression only. +# +PresentationContext2 = BreastTomosynthesisImageStorage\AnyTransferSyntax +PresentationContext3 = ComputedRadiographyImageStorage\AnyTransferSyntax +PresentationContext4 = CornealTopographyMapStorage\AnyTransferSyntax +PresentationContext5 = CTImageStorage\AnyTransferSyntax +PresentationContext6 = DigitalIntraOralXRayImageStorageForPresentation\AnyTransferSyntax +PresentationContext7 = DigitalIntraOralXRayImageStorageForProcessing\AnyTransferSyntax +PresentationContext8 = DigitalMammographyXRayImageStorageForPresentation\AnyTransferSyntax +PresentationContext9 = DigitalMammographyXRayImageStorageForProcessing\AnyTransferSyntax +PresentationContext10 = DigitalXRayImageStorageForPresentation\AnyTransferSyntax +PresentationContext11 = DigitalXRayImageStorageForProcessing\AnyTransferSyntax +PresentationContext12 = EnhancedCTImageStorage\AnyTransferSyntax +PresentationContext13 = EnhancedMRColorImageStorage\AnyTransferSyntax +PresentationContext14 = EnhancedMRImageStorage\AnyTransferSyntax +PresentationContext15 = EnhancedPETImageStorage\AnyTransferSyntax +PresentationContext16 = EnhancedUSVolumeStorage\AnyTransferSyntax +PresentationContext17 = EnhancedXAImageStorage\AnyTransferSyntax +PresentationContext18 = EnhancedXRFImageStorage\AnyTransferSyntax +PresentationContext19 = IntravascularOpticalCoherenceTomographyImageStorageForPresentation\AnyTransferSyntax +PresentationContext20 = IntravascularOpticalCoherenceTomographyImageStorageForProcessing\AnyTransferSyntax +PresentationContext21 = MRImageStorage\AnyTransferSyntax +PresentationContext22 = MultiframeGrayscaleByteSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext23 = MultiframeGrayscaleWordSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext24 = MultiframeSingleBitSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext25 = MultiframeTrueColorSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext26 = NuclearMedicineImageStorage\AnyTransferSyntax +PresentationContext27 = OphthalmicPhotography16BitImageStorage\AnyTransferSyntax +PresentationContext28 = OphthalmicPhotography8BitImageStorage\AnyTransferSyntax +PresentationContext29 = OphthalmicThicknessMapStorage\AnyTransferSyntax +PresentationContext30 = OphthalmicTomographyImageStorage\AnyTransferSyntax +PresentationContext31 = PositronEmissionTomographyImageStorage\AnyTransferSyntax +PresentationContext32 = RTImageStorage\AnyTransferSyntax +PresentationContext33 = SecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext34 = UltrasoundImageStorage\AnyTransferSyntax +PresentationContext35 = UltrasoundMultiframeImageStorage\AnyTransferSyntax +PresentationContext36 = VideoEndoscopicImageStorage\AnyTransferSyntax +PresentationContext37 = VideoMicroscopicImageStorage\AnyTransferSyntax +PresentationContext38 = VideoPhotographicImageStorage\AnyTransferSyntax +PresentationContext39 = VLEndoscopicImageStorage\AnyTransferSyntax +PresentationContext40 = VLMicroscopicImageStorage\AnyTransferSyntax +PresentationContext41 = VLPhotographicImageStorage\AnyTransferSyntax +PresentationContext42 = VLSlideCoordinatesMicroscopicImageStorage\AnyTransferSyntax +PresentationContext43 = VLWholeSlideMicroscopyImageStorage\AnyTransferSyntax +PresentationContext44 = XRay3DAngiographicImageStorage\AnyTransferSyntax +PresentationContext45 = XRay3DCraniofacialImageStorage\AnyTransferSyntax +PresentationContext46 = XRayAngiographicImageStorage\AnyTransferSyntax +PresentationContext47 = XRayRadiofluoroscopicImageStorage\AnyTransferSyntax +# retired +PresentationContext48 = RETIRED_HardcopyColorImageStorage\AnyTransferSyntax +PresentationContext49 = RETIRED_HardcopyGrayscaleImageStorage\AnyTransferSyntax +PresentationContext50 = RETIRED_NuclearMedicineImageStorage\AnyTransferSyntax +PresentationContext51 = RETIRED_UltrasoundImageStorage\AnyTransferSyntax +PresentationContext52 = RETIRED_UltrasoundMultiframeImageStorage\AnyTransferSyntax +PresentationContext53 = RETIRED_VLImageStorage\AnyTransferSyntax +PresentationContext54 = RETIRED_VLMultiframeImageStorage\AnyTransferSyntax +PresentationContext55 = RETIRED_XRayAngiographicBiPlaneImageStorage\AnyTransferSyntax +# +# the following presentation contexts are for non-image SOP classes +# +PresentationContext56 = AmbulatoryECGWaveformStorage\UncompressedOrZlib +PresentationContext57 = ArterialPulseWaveformStorage\UncompressedOrZlib +PresentationContext58 = AutorefractionMeasurementsStorage\UncompressedOrZlib +PresentationContext59 = BasicStructuredDisplayStorage\UncompressedOrZlib +PresentationContext60 = BasicTextSRStorage\UncompressedOrZlib +PresentationContext61 = BasicVoiceAudioWaveformStorage\UncompressedOrZlib +PresentationContext62 = BlendingSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext63 = CardiacElectrophysiologyWaveformStorage\UncompressedOrZlib +PresentationContext64 = ChestCADSRStorage\UncompressedOrZlib +PresentationContext65 = ColonCADSRStorage\UncompressedOrZlib +PresentationContext66 = ColorSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext67 = Comprehensive3DSRStorage\UncompressedOrZlib +PresentationContext68 = ComprehensiveSRStorage\UncompressedOrZlib +PresentationContext69 = DeformableSpatialRegistrationStorage\UncompressedOrZlib +PresentationContext70 = EncapsulatedCDAStorage\UncompressedOrZlib +PresentationContext71 = EncapsulatedPDFStorage\UncompressedOrZlib +PresentationContext72 = EnhancedSRStorage\UncompressedOrZlib +PresentationContext73 = GeneralAudioWaveformStorage\UncompressedOrZlib +PresentationContext74 = GeneralECGWaveformStorage\UncompressedOrZlib +PresentationContext75 = GenericImplantTemplateStorage\UncompressedOrZlib +PresentationContext76 = GrayscaleSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext77 = HemodynamicWaveformStorage\UncompressedOrZlib +PresentationContext78 = ImplantAssemblyTemplateStorage\UncompressedOrZlib +PresentationContext79 = ImplantationPlanSRDocumentStorage\UncompressedOrZlib +PresentationContext80 = ImplantTemplateGroupStorage\UncompressedOrZlib +PresentationContext81 = IntraocularLensCalculationsStorage\UncompressedOrZlib +PresentationContext82 = KeratometryMeasurementsStorage\UncompressedOrZlib +PresentationContext83 = KeyObjectSelectionDocumentStorage\UncompressedOrZlib +PresentationContext84 = LensometryMeasurementsStorage\UncompressedOrZlib +PresentationContext85 = MacularGridThicknessAndVolumeReportStorage\UncompressedOrZlib +PresentationContext86 = MammographyCADSRStorage\UncompressedOrZlib +PresentationContext87 = MRSpectroscopyStorage\UncompressedOrZlib +PresentationContext88 = OphthalmicAxialMeasurementsStorage\UncompressedOrZlib +PresentationContext89 = OphthalmicVisualFieldStaticPerimetryMeasurementsStorage\UncompressedOrZlib +PresentationContext90 = ProcedureLogStorage\UncompressedOrZlib +PresentationContext91 = PseudoColorSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext92 = RawDataStorage\UncompressedOrZlib +PresentationContext93 = RealWorldValueMappingStorage\UncompressedOrZlib +PresentationContext94 = RespiratoryWaveformStorage\UncompressedOrZlib +PresentationContext95 = RTBeamsDeliveryInstructionStorage\UncompressedOrZlib +PresentationContext96 = RTBeamsTreatmentRecordStorage\UncompressedOrZlib +PresentationContext97 = RTBrachyTreatmentRecordStorage\UncompressedOrZlib +PresentationContext98 = RTDoseStorage\UncompressedOrZlib +PresentationContext99 = RTIonBeamsTreatmentRecordStorage\UncompressedOrZlib +PresentationContext100 = RTIonPlanStorage\UncompressedOrZlib +PresentationContext101 = RTPlanStorage\UncompressedOrZlib +PresentationContext102 = RTStructureSetStorage\UncompressedOrZlib +PresentationContext103 = RTTreatmentSummaryRecordStorage\UncompressedOrZlib +PresentationContext104 = SegmentationStorage\UncompressedOrZlib +PresentationContext105 = SpatialFiducialsStorage\UncompressedOrZlib +PresentationContext106 = SpatialRegistrationStorage\UncompressedOrZlib +PresentationContext107 = SpectaclePrescriptionReportStorage\UncompressedOrZlib +PresentationContext108 = StereometricRelationshipStorage\UncompressedOrZlib +PresentationContext109 = SubjectiveRefractionMeasurementsStorage\UncompressedOrZlib +PresentationContext110 = SurfaceScanMeshStorage\UncompressedOrZlib +PresentationContext111 = SurfaceScanPointCloudStorage\UncompressedOrZlib +PresentationContext112 = SurfaceSegmentationStorage\UncompressedOrZlib +PresentationContext113 = TwelveLeadECGWaveformStorage\UncompressedOrZlib +PresentationContext114 = VisualAcuityMeasurementsStorage\UncompressedOrZlib +PresentationContext115 = XAXRFGrayscaleSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext116 = XRayRadiationDoseSRStorage\UncompressedOrZlib +# retired +PresentationContext117 = RETIRED_StandaloneCurveStorage\UncompressedOrZlib +PresentationContext118 = RETIRED_StandaloneModalityLUTStorage\UncompressedOrZlib +PresentationContext119 = RETIRED_StandaloneOverlayStorage\UncompressedOrZlib +PresentationContext120 = RETIRED_StandalonePETCurveStorage\UncompressedOrZlib +PresentationContext121 = RETIRED_StandaloneVOILUTStorage\UncompressedOrZlib +PresentationContext122 = RETIRED_StoredPrintStorage\UncompressedOrZlib +# draft +PresentationContext123 = DRAFT_RTBeamsDeliveryInstructionStorage\UncompressedOrZlib +PresentationContext124 = DRAFT_SRAudioStorage\UncompressedOrZlib +PresentationContext125 = DRAFT_SRComprehensiveStorage\UncompressedOrZlib +PresentationContext126 = DRAFT_SRDetailStorage\UncompressedOrZlib +PresentationContext127 = DRAFT_SRTextStorage\UncompressedOrZlib +PresentationContext128 = DRAFT_WaveformStorage\UncompressedOrZlib +# +# the following SOP classes are missing in the above list: +# +# - AcquisitionContextSRStorage +# - AdvancedBlendingPresentationStateStorage +# - BreastProjectionXRayImageStorageForPresentation +# - BreastProjectionXRayImageStorageForProcessing +# - CArmPhotonElectronRadiationStorage +# - ColorPaletteStorage +# - CompositingPlanarMPRVolumetricPresentationStateStorage +# - ContentAssessmentResultsStorage +# - CTDefinedProcedureProtocolStorage +# - CTPerformedProcedureProtocolStorage +# - EncapsulatedSTLStorage +# - ExtensibleSRStorage +# - GrayscalePlanarMPRVolumetricPresentationStateStorage +# - HangingProtocolStorage +# - LegacyConvertedEnhancedCTImageStorage +# - LegacyConvertedEnhancedMRImageStorage +# - LegacyConvertedEnhancedPETImageStorage +# - MultipleVolumeRenderingVolumetricPresentationStateStorage +# - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage +# - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage +# - ParametricMapStorage +# - PatientRadiationDoseSRStorage +# - PerformedImagingAgentAdministrationSRStorage +# - PlannedImagingAgentAdministrationSRStorage +# - RadiopharmaceuticalRadiationDoseSRStorage +# - RTBrachyApplicationSetupDeliveryInstructionStorage +# - RTPhysicianIntentStorage +# - RTRadiationSetStorage +# - RTSegmentAnnotationStorage +# - SegmentedVolumeRenderingVolumetricPresentationStateStorage +# - SimplifiedAdultEchoSRStorage +# - TractographyResultsStorage +# - VolumeRenderingVolumetricPresentationStateStorage +# - WideFieldOphthalmicPhotographyStereographicProjectionImageStorage +# - WideFieldOphthalmicPhotography3DCoordinatesImageStorage +# +# - DICOS_2DAITStorage +# - DICOS_3DAITStorage +# - DICOS_CTImageStorage +# - DICOS_DigitalXRayImageStorageForPresentation +# - DICOS_DigitalXRayImageStorageForProcessing +# - DICOS_QuadrupoleResonanceStorage +# - DICOS_ThreatDetectionReportStorage +# +# - DICONDE_EddyCurrentImageStorage +# - DICONDE_EddyCurrentMultiframeImageStorage + +# ---------------------------------------------------------------------------- + +[AllDICOMStorageSCP] +# +# Same as "GenericStorageSCP" but limited to non-retired and non-draft SOP Classes. +# This allows for accepting (almost) all DICOM Storage SOP Classes that are currently +# defined in the standard (an exception is made for some very new DICOM objects because +# of the limitation of 128 Presentation Contexts for SCPs, see DCMTK Feature #540). +# +PresentationContext1 = VerificationSOPClass\Uncompressed +# +# DICOM images +# +PresentationContext2 = BreastProjectionXRayImageStorageForPresentation\AnyTransferSyntax +PresentationContext3 = BreastProjectionXRayImageStorageForProcessing\AnyTransferSyntax +PresentationContext4 = BreastTomosynthesisImageStorage\AnyTransferSyntax +PresentationContext5 = ComputedRadiographyImageStorage\AnyTransferSyntax +PresentationContext6 = CornealTopographyMapStorage\AnyTransferSyntax +PresentationContext7 = CTImageStorage\AnyTransferSyntax +PresentationContext8 = DigitalIntraOralXRayImageStorageForPresentation\AnyTransferSyntax +PresentationContext9 = DigitalIntraOralXRayImageStorageForProcessing\AnyTransferSyntax +PresentationContext10 = DigitalMammographyXRayImageStorageForPresentation\AnyTransferSyntax +PresentationContext11 = DigitalMammographyXRayImageStorageForProcessing\AnyTransferSyntax +PresentationContext12 = DigitalXRayImageStorageForPresentation\AnyTransferSyntax +PresentationContext13 = DigitalXRayImageStorageForProcessing\AnyTransferSyntax +PresentationContext14 = EnhancedCTImageStorage\AnyTransferSyntax +PresentationContext15 = EnhancedMRColorImageStorage\AnyTransferSyntax +PresentationContext16 = EnhancedMRImageStorage\AnyTransferSyntax +PresentationContext17 = EnhancedPETImageStorage\AnyTransferSyntax +PresentationContext18 = EnhancedUSVolumeStorage\AnyTransferSyntax +PresentationContext19 = EnhancedXAImageStorage\AnyTransferSyntax +PresentationContext20 = EnhancedXRFImageStorage\AnyTransferSyntax +PresentationContext21 = IntravascularOpticalCoherenceTomographyImageStorageForPresentation\AnyTransferSyntax +PresentationContext22 = IntravascularOpticalCoherenceTomographyImageStorageForProcessing\AnyTransferSyntax +PresentationContext23 = LegacyConvertedEnhancedCTImageStorage\AnyTransferSyntax +PresentationContext24 = LegacyConvertedEnhancedMRImageStorage\AnyTransferSyntax +PresentationContext25 = LegacyConvertedEnhancedPETImageStorage\AnyTransferSyntax +PresentationContext26 = MRImageStorage\AnyTransferSyntax +PresentationContext27 = MultiframeGrayscaleByteSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext28 = MultiframeGrayscaleWordSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext29 = MultiframeSingleBitSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext30 = MultiframeTrueColorSecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext31 = NuclearMedicineImageStorage\AnyTransferSyntax +PresentationContext32 = OphthalmicPhotography16BitImageStorage\AnyTransferSyntax +PresentationContext33 = OphthalmicPhotography8BitImageStorage\AnyTransferSyntax +PresentationContext34 = OphthalmicThicknessMapStorage\AnyTransferSyntax +PresentationContext35 = OphthalmicTomographyImageStorage\AnyTransferSyntax +PresentationContext36 = ParametricMapStorage\AnyTransferSyntax +PresentationContext37 = PositronEmissionTomographyImageStorage\AnyTransferSyntax +PresentationContext38 = RTImageStorage\AnyTransferSyntax +PresentationContext39 = SecondaryCaptureImageStorage\AnyTransferSyntax +PresentationContext40 = UltrasoundImageStorage\AnyTransferSyntax +PresentationContext41 = UltrasoundMultiframeImageStorage\AnyTransferSyntax +PresentationContext42 = VideoEndoscopicImageStorage\AnyTransferSyntax +PresentationContext43 = VideoMicroscopicImageStorage\AnyTransferSyntax +PresentationContext44 = VideoPhotographicImageStorage\AnyTransferSyntax +PresentationContext45 = VLEndoscopicImageStorage\AnyTransferSyntax +PresentationContext46 = VLMicroscopicImageStorage\AnyTransferSyntax +PresentationContext47 = VLPhotographicImageStorage\AnyTransferSyntax +PresentationContext48 = VLSlideCoordinatesMicroscopicImageStorage\AnyTransferSyntax +PresentationContext49 = VLWholeSlideMicroscopyImageStorage\AnyTransferSyntax +PresentationContext50 = WideFieldOphthalmicPhotographyStereographicProjectionImageStorage\AnyTransferSyntax +PresentationContext51 = WideFieldOphthalmicPhotography3DCoordinatesImageStorage\AnyTransferSyntax +PresentationContext52 = XRay3DAngiographicImageStorage\AnyTransferSyntax +PresentationContext53 = XRay3DCraniofacialImageStorage\AnyTransferSyntax +PresentationContext54 = XRayAngiographicImageStorage\AnyTransferSyntax +PresentationContext55 = XRayRadiofluoroscopicImageStorage\AnyTransferSyntax +# +# all other DICOM objects +# +PresentationContext56 = AcquisitionContextSRStorage\UncompressedOrZlib +PresentationContext57 = AmbulatoryECGWaveformStorage\UncompressedOrZlib +PresentationContext58 = ArterialPulseWaveformStorage\UncompressedOrZlib +PresentationContext59 = AutorefractionMeasurementsStorage\UncompressedOrZlib +PresentationContext60 = BasicStructuredDisplayStorage\UncompressedOrZlib +PresentationContext61 = BasicTextSRStorage\UncompressedOrZlib +PresentationContext62 = BasicVoiceAudioWaveformStorage\UncompressedOrZlib +PresentationContext63 = BlendingSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext64 = CardiacElectrophysiologyWaveformStorage\UncompressedOrZlib +PresentationContext65 = ChestCADSRStorage\UncompressedOrZlib +PresentationContext66 = ColonCADSRStorage\UncompressedOrZlib +PresentationContext67 = ColorSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext68 = CompositingPlanarMPRVolumetricPresentationStateStorage\UncompressedOrZlib +PresentationContext69 = Comprehensive3DSRStorage\UncompressedOrZlib +PresentationContext70 = ComprehensiveSRStorage\UncompressedOrZlib +PresentationContext71 = ContentAssessmentResultsStorage\UncompressedOrZlib +PresentationContext72 = CTDefinedProcedureProtocolStorage\UncompressedOrZlib +PresentationContext73 = CTPerformedProcedureProtocolStorage\UncompressedOrZlib +PresentationContext74 = DeformableSpatialRegistrationStorage\UncompressedOrZlib +PresentationContext75 = EncapsulatedCDAStorage\UncompressedOrZlib +PresentationContext76 = EncapsulatedPDFStorage\UncompressedOrZlib +PresentationContext77 = EnhancedSRStorage\UncompressedOrZlib +PresentationContext78 = ExtensibleSRStorage\UncompressedOrZlib +PresentationContext79 = GeneralAudioWaveformStorage\UncompressedOrZlib +PresentationContext80 = GeneralECGWaveformStorage\UncompressedOrZlib +PresentationContext81 = GenericImplantTemplateStorage\UncompressedOrZlib +PresentationContext82 = GrayscalePlanarMPRVolumetricPresentationStateStorage\UncompressedOrZlib +PresentationContext83 = GrayscaleSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext84 = HangingProtocolStorage\UncompressedOrZlib +PresentationContext85 = HemodynamicWaveformStorage\UncompressedOrZlib +PresentationContext86 = ImplantAssemblyTemplateStorage\UncompressedOrZlib +PresentationContext87 = ImplantationPlanSRDocumentStorage\UncompressedOrZlib +PresentationContext88 = ImplantTemplateGroupStorage\UncompressedOrZlib +PresentationContext89 = IntraocularLensCalculationsStorage\UncompressedOrZlib +PresentationContext90 = KeratometryMeasurementsStorage\UncompressedOrZlib +PresentationContext91 = KeyObjectSelectionDocumentStorage\UncompressedOrZlib +PresentationContext92 = LensometryMeasurementsStorage\UncompressedOrZlib +PresentationContext93 = MacularGridThicknessAndVolumeReportStorage\UncompressedOrZlib +PresentationContext94 = MammographyCADSRStorage\UncompressedOrZlib +PresentationContext95 = MRSpectroscopyStorage\UncompressedOrZlib +PresentationContext96 = OphthalmicAxialMeasurementsStorage\UncompressedOrZlib +PresentationContext97 = OphthalmicVisualFieldStaticPerimetryMeasurementsStorage\UncompressedOrZlib +PresentationContext98 = ProcedureLogStorage\UncompressedOrZlib +PresentationContext99 = PseudoColorSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext100 = RadiopharmaceuticalRadiationDoseSRStorage\UncompressedOrZlib +PresentationContext101 = RawDataStorage\UncompressedOrZlib +PresentationContext102 = RealWorldValueMappingStorage\UncompressedOrZlib +PresentationContext103 = RespiratoryWaveformStorage\UncompressedOrZlib +PresentationContext104 = RTBeamsDeliveryInstructionStorage\UncompressedOrZlib +PresentationContext105 = RTBeamsTreatmentRecordStorage\UncompressedOrZlib +PresentationContext106 = RTBrachyApplicationSetupDeliveryInstructionStorage\UncompressedOrZlib +PresentationContext107 = RTBrachyTreatmentRecordStorage\UncompressedOrZlib +PresentationContext108 = RTDoseStorage\UncompressedOrZlib +PresentationContext109 = RTIonBeamsTreatmentRecordStorage\UncompressedOrZlib +PresentationContext110 = RTIonPlanStorage\UncompressedOrZlib +PresentationContext111 = RTPlanStorage\UncompressedOrZlib +PresentationContext112 = RTStructureSetStorage\UncompressedOrZlib +PresentationContext113 = RTTreatmentSummaryRecordStorage\UncompressedOrZlib +PresentationContext114 = SegmentationStorage\UncompressedOrZlib +PresentationContext115 = SimplifiedAdultEchoSRStorage\UncompressedOrZlib +PresentationContext116 = SpatialFiducialsStorage\UncompressedOrZlib +PresentationContext117 = SpatialRegistrationStorage\UncompressedOrZlib +PresentationContext118 = SpectaclePrescriptionReportStorage\UncompressedOrZlib +PresentationContext119 = StereometricRelationshipStorage\UncompressedOrZlib +PresentationContext120 = SubjectiveRefractionMeasurementsStorage\UncompressedOrZlib +PresentationContext121 = SurfaceScanMeshStorage\UncompressedOrZlib +PresentationContext122 = SurfaceScanPointCloudStorage\UncompressedOrZlib +PresentationContext123 = SurfaceSegmentationStorage\UncompressedOrZlib +PresentationContext124 = TractographyResultsStorage\UncompressedOrZlib +PresentationContext125 = TwelveLeadECGWaveformStorage\UncompressedOrZlib +PresentationContext126 = VisualAcuityMeasurementsStorage\UncompressedOrZlib +PresentationContext127 = XAXRFGrayscaleSoftcopyPresentationStateStorage\UncompressedOrZlib +PresentationContext128 = XRayRadiationDoseSRStorage\UncompressedOrZlib +# +# the following SOP classes are missing in the above list: +# +# - AdvancedBlendingPresentationStateStorage +# - CArmPhotonElectronRadiationStorage +# - ColorPaletteStorage +# - EncapsulatedSTLStorage +# - MultipleVolumeRenderingVolumetricPresentationStateStorage +# - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage +# - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage +# - PatientRadiationDoseSRStorage +# - PerformedImagingAgentAdministrationSRStorage +# - PlannedImagingAgentAdministrationSRStorage +# - ProtocolApprovalStorage +# - RTPhysicianIntentStorage +# - RTRadiationSetStorage +# - RTSegmentAnnotationStorage +# - SegmentedVolumeRenderingVolumetricPresentationStateStorage +# - VolumeRenderingVolumetricPresentationStateStorage +# +# - RETIRED_HardcopyColorImageStorage +# - RETIRED_HardcopyGrayscaleImageStorage +# - RETIRED_NuclearMedicineImageStorage +# - RETIRED_UltrasoundImageStorage +# - RETIRED_UltrasoundMultiframeImageStorage +# - RETIRED_VLImageStorage +# - RETIRED_VLMultiframeImageStorage +# - RETIRED_XRayAngiographicBiPlaneImageStorage +# +# - RETIRED_StandaloneCurveStorage +# - RETIRED_StandaloneModalityLUTStorage +# - RETIRED_StandaloneOverlayStorage +# - RETIRED_StandalonePETCurveStorage +# - RETIRED_StandaloneVOILUTStorage +# - RETIRED_StoredPrintStorage +# +# - DRAFT_RTBeamsDeliveryInstructionStorage +# - DRAFT_SRAudioStorage +# - DRAFT_SRComprehensiveStorage +# - DRAFT_SRDetailStorage +# - DRAFT_SRTextStorage +# - DRAFT_WaveformStorage +# +# - DICOS_2DAITStorage +# - DICOS_3DAITStorage +# - DICOS_CTImageStorage +# - DICOS_DigitalXRayImageStorageForPresentation +# - DICOS_DigitalXRayImageStorageForProcessing +# - DICOS_QuadrupoleResonanceStorage +# - DICOS_ThreatDetectionReportStorage +# +# - DICONDE_EddyCurrentImageStorage +# - DICONDE_EddyCurrentMultiframeImageStorage + +[StorageSCUCompressedAndUncompressed] +# +# For non-image SOP classes, we only support uncompressed transmission. +# For image SOP classes, we support JPEG lossy, JPEG lossless and uncompressed. +# For Ultrasound, we additionally support RLE. +# The retired and standalone SOP classes are not supported with this profile. +# +PresentationContext1 = ComputedRadiographyImageStorage\JPEGBaseline +PresentationContext2 = ComputedRadiographyImageStorage\JPEGLossless +PresentationContext3 = ComputedRadiographyImageStorage\Uncompressed +PresentationContext4 = CTImageStorage\JPEGBaseline +PresentationContext5 = CTImageStorage\JPEGLossless +PresentationContext6 = CTImageStorage\Uncompressed +PresentationContext7 = DigitalIntraOralXRayImageStorageForPresentation\JPEGBaseline +PresentationContext8 = DigitalIntraOralXRayImageStorageForPresentation\JPEGLossless +PresentationContext9 = DigitalIntraOralXRayImageStorageForPresentation\Uncompressed +PresentationContext10 = DigitalIntraOralXRayImageStorageForProcessing\JPEGBaseline +PresentationContext11 = DigitalIntraOralXRayImageStorageForProcessing\JPEGLossless +PresentationContext12 = DigitalIntraOralXRayImageStorageForProcessing\Uncompressed +PresentationContext13 = DigitalMammographyXRayImageStorageForPresentation\JPEGBaseline +PresentationContext14 = DigitalMammographyXRayImageStorageForPresentation\JPEGLossless +PresentationContext15 = DigitalMammographyXRayImageStorageForPresentation\Uncompressed +PresentationContext16 = DigitalMammographyXRayImageStorageForProcessing\JPEGBaseline +PresentationContext17 = DigitalMammographyXRayImageStorageForProcessing\JPEGLossless +PresentationContext18 = DigitalMammographyXRayImageStorageForProcessing\Uncompressed +PresentationContext19 = DigitalXRayImageStorageForPresentation\JPEGBaseline +PresentationContext20 = DigitalXRayImageStorageForPresentation\JPEGLossless +PresentationContext21 = DigitalXRayImageStorageForPresentation\Uncompressed +PresentationContext22 = DigitalXRayImageStorageForProcessing\JPEGBaseline +PresentationContext23 = DigitalXRayImageStorageForProcessing\JPEGLossless +PresentationContext24 = DigitalXRayImageStorageForProcessing\Uncompressed +PresentationContext25 = EnhancedCTImageStorage\JPEGBaseline +PresentationContext26 = EnhancedCTImageStorage\JPEGLossless +PresentationContext27 = EnhancedCTImageStorage\Uncompressed +PresentationContext28 = EnhancedMRImageStorage\JPEGBaseline +PresentationContext29 = EnhancedMRImageStorage\JPEGLossless +PresentationContext30 = EnhancedMRImageStorage\Uncompressed +PresentationContext31 = EnhancedXAImageStorage\JPEGBaseline +PresentationContext32 = EnhancedXAImageStorage\JPEGLossless +PresentationContext33 = EnhancedXAImageStorage\Uncompressed +PresentationContext34 = EnhancedXRFImageStorage\JPEGBaseline +PresentationContext35 = EnhancedXRFImageStorage\JPEGLossless +PresentationContext36 = EnhancedXRFImageStorage\Uncompressed +PresentationContext37 = MRImageStorage\JPEGBaseline +PresentationContext38 = MRImageStorage\JPEGLossless +PresentationContext39 = MRImageStorage\Uncompressed +PresentationContext40 = MultiframeGrayscaleByteSecondaryCaptureImageStorage\JPEGBaseline +PresentationContext41 = MultiframeGrayscaleByteSecondaryCaptureImageStorage\JPEGLossless +PresentationContext42 = MultiframeGrayscaleByteSecondaryCaptureImageStorage\Uncompressed +PresentationContext43 = MultiframeGrayscaleWordSecondaryCaptureImageStorage\JPEGBaseline +PresentationContext44 = MultiframeGrayscaleWordSecondaryCaptureImageStorage\JPEGLossless +PresentationContext45 = MultiframeGrayscaleWordSecondaryCaptureImageStorage\Uncompressed +PresentationContext46 = MultiframeSingleBitSecondaryCaptureImageStorage\JPEGBaseline +PresentationContext47 = MultiframeSingleBitSecondaryCaptureImageStorage\JPEGLossless +PresentationContext48 = MultiframeSingleBitSecondaryCaptureImageStorage\Uncompressed +PresentationContext49 = MultiframeTrueColorSecondaryCaptureImageStorage\JPEGBaseline +PresentationContext50 = MultiframeTrueColorSecondaryCaptureImageStorage\JPEGLossless +PresentationContext51 = MultiframeTrueColorSecondaryCaptureImageStorage\Uncompressed +PresentationContext52 = NuclearMedicineImageStorage\JPEGBaseline +PresentationContext53 = NuclearMedicineImageStorage\JPEGLossless +PresentationContext54 = NuclearMedicineImageStorage\Uncompressed +PresentationContext55 = OphthalmicPhotography16BitImageStorage\JPEGBaseline +PresentationContext56 = OphthalmicPhotography16BitImageStorage\JPEGLossless +PresentationContext57 = OphthalmicPhotography16BitImageStorage\Uncompressed +PresentationContext58 = OphthalmicPhotography8BitImageStorage\JPEGBaseline +PresentationContext59 = OphthalmicPhotography8BitImageStorage\JPEGLossless +PresentationContext60 = OphthalmicPhotography8BitImageStorage\Uncompressed +PresentationContext61 = PositronEmissionTomographyImageStorage\JPEGBaseline +PresentationContext62 = PositronEmissionTomographyImageStorage\JPEGLossless +PresentationContext63 = PositronEmissionTomographyImageStorage\Uncompressed +PresentationContext64 = RTImageStorage\JPEGBaseline +PresentationContext65 = RTImageStorage\JPEGLossless +PresentationContext66 = RTImageStorage\Uncompressed +PresentationContext67 = SecondaryCaptureImageStorage\JPEGBaseline +PresentationContext68 = SecondaryCaptureImageStorage\JPEGLossless +PresentationContext69 = SecondaryCaptureImageStorage\Uncompressed +PresentationContext70 = UltrasoundImageStorage\JPEGBaseline +PresentationContext71 = UltrasoundImageStorage\JPEGLossless +PresentationContext72 = UltrasoundImageStorage\RLE +PresentationContext73 = UltrasoundImageStorage\Uncompressed +PresentationContext74 = UltrasoundMultiframeImageStorage\JPEGBaseline +PresentationContext75 = UltrasoundMultiframeImageStorage\JPEGLossless +PresentationContext76 = UltrasoundMultiframeImageStorage\RLE +PresentationContext77 = UltrasoundMultiframeImageStorage\Uncompressed +PresentationContext78 = VLEndoscopicImageStorage\JPEGBaseline +PresentationContext79 = VLEndoscopicImageStorage\JPEGLossless +PresentationContext80 = VLEndoscopicImageStorage\Uncompressed +PresentationContext81 = VLMicroscopicImageStorage\JPEGBaseline +PresentationContext82 = VLMicroscopicImageStorage\JPEGLossless +PresentationContext83 = VLMicroscopicImageStorage\Uncompressed +PresentationContext84 = VLPhotographicImageStorage\JPEGBaseline +PresentationContext85 = VLPhotographicImageStorage\JPEGLossless +PresentationContext86 = VLPhotographicImageStorage\Uncompressed +PresentationContext87 = VLSlideCoordinatesMicroscopicImageStorage\JPEGBaseline +PresentationContext88 = VLSlideCoordinatesMicroscopicImageStorage\JPEGLossless +PresentationContext89 = VLSlideCoordinatesMicroscopicImageStorage\Uncompressed +PresentationContext90 = XRayAngiographicImageStorage\JPEGBaseline +PresentationContext91 = XRayAngiographicImageStorage\JPEGLossless +PresentationContext92 = XRayAngiographicImageStorage\Uncompressed +PresentationContext93 = XRayRadiofluoroscopicImageStorage\JPEGBaseline +PresentationContext94 = XRayRadiofluoroscopicImageStorage\JPEGLossless +PresentationContext95 = XRayRadiofluoroscopicImageStorage\Uncompressed +# +# the following presentation contexts are for non-image SOP classes +# +PresentationContext96 = AmbulatoryECGWaveformStorage\Uncompressed +PresentationContext97 = BasicTextSRStorage\Uncompressed +PresentationContext98 = BasicVoiceAudioWaveformStorage\Uncompressed +PresentationContext99 = CardiacElectrophysiologyWaveformStorage\Uncompressed +PresentationContext100 = ChestCADSRStorage\Uncompressed +PresentationContext101 = ColonCADSRStorage\Uncompressed +PresentationContext102 = ColorSoftcopyPresentationStateStorage\Uncompressed +PresentationContext103 = ComprehensiveSRStorage\Uncompressed +PresentationContext104 = EncapsulatedPDFStorage\Uncompressed +PresentationContext105 = EnhancedSRStorage\Uncompressed +PresentationContext106 = GeneralECGWaveformStorage\Uncompressed +PresentationContext107 = GrayscaleSoftcopyPresentationStateStorage\Uncompressed +PresentationContext108 = HemodynamicWaveformStorage\Uncompressed +PresentationContext109 = KeyObjectSelectionDocumentStorage\Uncompressed +PresentationContext110 = MammographyCADSRStorage\Uncompressed +PresentationContext111 = MRSpectroscopyStorage\Uncompressed +PresentationContext112 = ProcedureLogStorage\Uncompressed +PresentationContext113 = PseudoColorSoftcopyPresentationStateStorage\Uncompressed +PresentationContext114 = RawDataStorage\Uncompressed +PresentationContext115 = RTBeamsTreatmentRecordStorage\Uncompressed +PresentationContext116 = RTBrachyTreatmentRecordStorage\Uncompressed +PresentationContext117 = RTDoseStorage\Uncompressed +PresentationContext118 = RTPlanStorage\Uncompressed +PresentationContext119 = RTStructureSetStorage\Uncompressed +PresentationContext120 = RTTreatmentSummaryRecordStorage\Uncompressed +PresentationContext121 = SpatialFiducialsStorage\Uncompressed +PresentationContext122 = SpatialRegistrationStorage\Uncompressed +PresentationContext123 = StereometricRelationshipStorage\Uncompressed +PresentationContext124 = TwelveLeadECGWaveformStorage\Uncompressed +PresentationContext125 = XRayRadiationDoseSRStorage\Uncompressed +# +# the new video objects are only negotiated with MPEG2 transfer syntax +# +PresentationContext126 = VideoEndoscopicImageStorage\MPEG2 +PresentationContext127 = VideoMicroscopicImageStorage\MPEG2 +PresentationContext128 = VideoPhotographicImageStorage\MPEG2 +# +# the following SOP classes are missing in the above list: +# +# - AcquisitionContextSRStorage +# - AdvancedBlendingPresentationStateStorage +# - ArterialPulseWaveformStorage +# - AutorefractionMeasurementsStorage +# - BasicStructuredDisplayStorage +# - BlendingSoftcopyPresentationStateStorage +# - BreastProjectionXRayImageStorageForPresentation +# - BreastProjectionXRayImageStorageForProcessing +# - BreastTomosynthesisImageStorage +# - CArmPhotonElectronRadiationStorage +# - CompositingPlanarMPRVolumetricPresentationStateStorage +# - Comprehensive3DSRStorage +# - ContentAssessmentResultsStorage +# - CornealTopographyMapStorage +# - CTDefinedProcedureProtocolStorage +# - CTPerformedProcedureProtocolStorage +# - DeformableSpatialRegistrationStorage +# - EncapsulatedCDAStorage +# - EncapsulatedSTLStorage +# - EnhancedMRColorImageStorage +# - EnhancedPETImageStorage +# - EnhancedUSVolumeStorage +# - ExtensibleSRStorage +# - GeneralAudioWaveformStorage +# - GenericImplantTemplateStorage +# - GrayscalePlanarMPRVolumetricPresentationStateStorage +# - ImplantAssemblyTemplateStorage +# - ImplantationPlanSRDocumentStorage +# - ImplantTemplateGroupStorage +# - IntraocularLensCalculationsStorage +# - IntravascularOpticalCoherenceTomographyImageStorageForPresentation +# - IntravascularOpticalCoherenceTomographyImageStorageForProcessing +# - KeratometryMeasurementsStorage +# - LegacyConvertedEnhancedCTImageStorage +# - LegacyConvertedEnhancedMRImageStorage +# - LegacyConvertedEnhancedPETImageStorage +# - LensometryMeasurementsStorage +# - MacularGridThicknessAndVolumeReportStorage +# - MultipleVolumeRenderingVolumetricPresentationStateStorage +# - OphthalmicAxialMeasurementsStorage +# - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage +# - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage +# - OphthalmicThicknessMapStorage +# - OphthalmicTomographyImageStorage +# - OphthalmicVisualFieldStaticPerimetryMeasurementsStorage +# - ParametricMapStorage +# - PatientRadiationDoseSRStorage +# - PerformedImagingAgentAdministrationSRStorage +# - PlannedImagingAgentAdministrationSRStorage +# - ProtocolApprovalStorage +# - RadiopharmaceuticalRadiationDoseSRStorage +# - RealWorldValueMappingStorage +# - RespiratoryWaveformStorage +# - RTBeamsDeliveryInstructionStorage +# - RTBrachyApplicationSetupDeliveryInstructionStorage +# - RTIonBeamsTreatmentRecordStorage +# - RTIonPlanStorage +# - RTPhysicianIntentStorage +# - RTRadiationSetStorage +# - RTSegmentAnnotationStorage +# - SegmentationStorage +# - SegmentedVolumeRenderingVolumetricPresentationStateStorage +# - SimplifiedAdultEchoSRStorage +# - SpectaclePrescriptionReportStorage +# - SubjectiveRefractionMeasurementsStorage +# - SurfaceScanMeshStorage +# - SurfaceScanPointCloudStorage +# - SurfaceSegmentationStorage +# - TractographyResultsStorage +# - VisualAcuityMeasurementsStorage +# - VLWholeSlideMicroscopyImageStorage +# - VolumeRenderingVolumetricPresentationStateStorage +# - WideFieldOphthalmicPhotographyStereographicProjectionImageStorage +# - WideFieldOphthalmicPhotography3DCoordinatesImageStorage +# - XAXRFGrayscaleSoftcopyPresentationStateStorage +# - XRay3DAngiographicImageStorage +# - XRay3DCraniofacialImageStorage +# +# - RETIRED_StandaloneCurveStorage +# - RETIRED_StandaloneModalityLUTStorage +# - RETIRED_StandaloneOverlayStorage +# - RETIRED_StandalonePETCurveStorage +# - RETIRED_StandaloneVOILUTStorage +# - RETIRED_StoredPrintStorage +# +# - DRAFT_RTBeamsDeliveryInstructionStorage +# - DRAFT_SRAudioStorage +# - DRAFT_SRComprehensiveStorage +# - DRAFT_SRDetailStorage +# - DRAFT_SRTextStorage +# - DRAFT_WaveformStorage +# +# - DICOS_2DAITStorage +# - DICOS_3DAITStorage +# - DICOS_CTImageStorage +# - DICOS_DigitalXRayImageStorageForPresentation +# - DICOS_DigitalXRayImageStorageForProcessing +# - DICOS_QuadrupoleResonanceStorage +# - DICOS_ThreatDetectionReportStorage +# +# - DICONDE_EddyCurrentImageStorage +# - DICONDE_EddyCurrentMultiframeImageStorage + +# ============================================================================ +[[SCPSCURoleSelection]] +# ============================================================================ + +[GenericBothRoles] +Role1 = BreastTomosynthesisImageStorage\BOTH +Role2 = ComputedRadiographyImageStorage\BOTH +Role3 = CornealTopographyMapStorage\BOTH +Role4 = CTImageStorage\BOTH +Role5 = DigitalIntraOralXRayImageStorageForPresentation\BOTH +Role6 = DigitalIntraOralXRayImageStorageForProcessing\BOTH +Role7 = DigitalMammographyXRayImageStorageForPresentation\BOTH +Role8 = DigitalMammographyXRayImageStorageForProcessing\BOTH +Role9 = DigitalXRayImageStorageForPresentation\BOTH +Role10 = DigitalXRayImageStorageForProcessing\BOTH +Role11 = EnhancedCTImageStorage\BOTH +Role12 = EnhancedMRColorImageStorage\BOTH +Role13 = EnhancedMRImageStorage\BOTH +Role14 = EnhancedPETImageStorage\BOTH +Role15 = EnhancedUSVolumeStorage\BOTH +Role16 = EnhancedXAImageStorage\BOTH +Role17 = EnhancedXRFImageStorage\BOTH +Role18 = IntravascularOpticalCoherenceTomographyImageStorageForPresentation\BOTH +Role19 = IntravascularOpticalCoherenceTomographyImageStorageForProcessing\BOTH +Role20 = MRImageStorage\BOTH +Role21 = MultiframeGrayscaleByteSecondaryCaptureImageStorage\BOTH +Role22 = MultiframeGrayscaleWordSecondaryCaptureImageStorage\BOTH +Role23 = MultiframeSingleBitSecondaryCaptureImageStorage\BOTH +Role24 = MultiframeTrueColorSecondaryCaptureImageStorage\BOTH +Role25 = NuclearMedicineImageStorage\BOTH +Role26 = OphthalmicPhotography16BitImageStorage\BOTH +Role27 = OphthalmicPhotography8BitImageStorage\BOTH +Role28 = OphthalmicThicknessMapStorage\BOTH +Role29 = OphthalmicTomographyImageStorage\BOTH +Role30 = PositronEmissionTomographyImageStorage\BOTH +Role31 = RTImageStorage\BOTH +Role32 = SecondaryCaptureImageStorage\BOTH +Role33 = UltrasoundImageStorage\BOTH +Role34 = UltrasoundMultiframeImageStorage\BOTH +Role35 = VideoEndoscopicImageStorage\BOTH +Role36 = VideoMicroscopicImageStorage\BOTH +Role37 = VideoPhotographicImageStorage\BOTH +Role38 = VLEndoscopicImageStorage\BOTH +Role39 = VLMicroscopicImageStorage\BOTH +Role40 = VLPhotographicImageStorage\BOTH +Role41 = VLSlideCoordinatesMicroscopicImageStorage\BOTH +Role42 = VLWholeSlideMicroscopyImageStorage\BOTH +Role43 = XRay3DAngiographicImageStorage\BOTH +Role44 = XRay3DCraniofacialImageStorage\BOTH +Role45 = XRayAngiographicImageStorage\BOTH +Role46 = XRayRadiofluoroscopicImageStorage\BOTH +# retired +Role47 = RETIRED_HardcopyColorImageStorage\BOTH +Role48 = RETIRED_HardcopyGrayscaleImageStorage\BOTH +Role49 = RETIRED_NuclearMedicineImageStorage\BOTH +Role50 = RETIRED_UltrasoundImageStorage\BOTH +Role51 = RETIRED_UltrasoundMultiframeImageStorage\BOTH +Role52 = RETIRED_VLImageStorage\BOTH +Role53 = RETIRED_VLMultiframeImageStorage\BOTH +Role54 = RETIRED_XRayAngiographicBiPlaneImageStorage\BOTH +# +# the following presentation contexts are for non-image SOP classes +# +Role55 = AmbulatoryECGWaveformStorage\BOTH +Role56 = ArterialPulseWaveformStorage\BOTH +Role57 = AutorefractionMeasurementsStorage\BOTH +Role58 = BasicStructuredDisplayStorage\BOTH +Role59 = BasicTextSRStorage\BOTH +Role60 = BasicVoiceAudioWaveformStorage\BOTH +Role61 = BlendingSoftcopyPresentationStateStorage\BOTH +Role62 = CardiacElectrophysiologyWaveformStorage\BOTH +Role63 = ChestCADSRStorage\BOTH +Role64 = ColonCADSRStorage\BOTH +Role65 = ColorSoftcopyPresentationStateStorage\BOTH +Role66 = Comprehensive3DSRStorage\BOTH +Role67 = ComprehensiveSRStorage\BOTH +Role68 = DeformableSpatialRegistrationStorage\BOTH +Role69 = EncapsulatedCDAStorage\BOTH +Role70 = EncapsulatedPDFStorage\BOTH +Role71 = EnhancedSRStorage\BOTH +Role72 = GeneralAudioWaveformStorage\BOTH +Role73 = GeneralECGWaveformStorage\BOTH +Role74 = GenericImplantTemplateStorage\BOTH +Role75 = GrayscaleSoftcopyPresentationStateStorage\BOTH +Role76 = HemodynamicWaveformStorage\BOTH +Role77 = ImplantAssemblyTemplateStorage\BOTH +Role78 = ImplantationPlanSRDocumentStorage\BOTH +Role79 = ImplantTemplateGroupStorage\BOTH +Role80 = IntraocularLensCalculationsStorage\BOTH +Role81 = KeratometryMeasurementsStorage\BOTH +Role82 = KeyObjectSelectionDocumentStorage\BOTH +Role83 = LensometryMeasurementsStorage\BOTH +Role84 = MacularGridThicknessAndVolumeReportStorage\BOTH +Role85 = MammographyCADSRStorage\BOTH +Role86 = MRSpectroscopyStorage\BOTH +Role87 = OphthalmicAxialMeasurementsStorage\BOTH +Role88 = OphthalmicVisualFieldStaticPerimetryMeasurementsStorage\BOTH +Role89 = ProcedureLogStorage\BOTH +Role90 = PseudoColorSoftcopyPresentationStateStorage\BOTH +Role91 = RawDataStorage\BOTH +Role92 = RealWorldValueMappingStorage\BOTH +Role93 = RespiratoryWaveformStorage\BOTH +Role94 = RTBeamsDeliveryInstructionStorage\BOTH +Role95 = RTBeamsTreatmentRecordStorage\BOTH +Role96 = RTBrachyTreatmentRecordStorage\BOTH +Role97 = RTDoseStorage\BOTH +Role98 = RTIonBeamsTreatmentRecordStorage\BOTH +Role99 = RTIonPlanStorage\BOTH +Role100 = RTPlanStorage\BOTH +Role101 = RTStructureSetStorage\BOTH +Role102 = RTTreatmentSummaryRecordStorage\BOTH +Role103 = SegmentationStorage\BOTH +Role104 = SpatialFiducialsStorage\BOTH +Role105 = SpatialRegistrationStorage\BOTH +Role106 = SpectaclePrescriptionReportStorage\BOTH +Role107 = StereometricRelationshipStorage\BOTH +Role108 = SubjectiveRefractionMeasurementsStorage\BOTH +Role109 = SurfaceScanMeshStorage\BOTH +Role110 = SurfaceScanPointCloudStorage\BOTH +Role111 = SurfaceSegmentationStorage\BOTH +Role112 = TwelveLeadECGWaveformStorage\BOTH +Role113 = VisualAcuityMeasurementsStorage\BOTH +Role114 = XAXRFGrayscaleSoftcopyPresentationStateStorage\BOTH +Role115 = XRayRadiationDoseSRStorage\BOTH +# retired +Role116 = RETIRED_StandaloneCurveStorage\BOTH +Role117 = RETIRED_StandaloneModalityLUTStorage\BOTH +Role118 = RETIRED_StandaloneOverlayStorage\BOTH +Role119 = RETIRED_StandalonePETCurveStorage\BOTH +Role120 = RETIRED_StandaloneVOILUTStorage\BOTH +Role121 = RETIRED_StoredPrintStorage\BOTH +# draft +Role122 = DRAFT_RTBeamsDeliveryInstructionStorage\BOTH +Role123 = DRAFT_SRAudioStorage\BOTH +Role124 = DRAFT_SRComprehensiveStorage\BOTH +Role125 = DRAFT_SRDetailStorage\BOTH +Role126 = DRAFT_SRTextStorage\BOTH +Role127 = DRAFT_WaveformStorage\BOTH +# +# the following SOP classes are missing in the above list: +# +# - AcquisitionContextSRStorage +# - AdvancedBlendingPresentationStateStorage +# - BreastProjectionXRayImageStorageForPresentation +# - BreastProjectionXRayImageStorageForProcessing +# - CArmPhotonElectronRadiationStorage +# - ColorPaletteStorage +# - CompositingPlanarMPRVolumetricPresentationStateStorage +# - ContentAssessmentResultsStorage +# - CTDefinedProcedureProtocolStorage +# - CTPerformedProcedureProtocolStorage +# - EncapsulatedSTLStorage +# - ExtensibleSRStorage +# - GrayscalePlanarMPRVolumetricPresentationStateStorage +# - HangingProtocolStorage +# - LegacyConvertedEnhancedCTImageStorage +# - LegacyConvertedEnhancedMRImageStorage +# - LegacyConvertedEnhancedPETImageStorage +# - MultipleVolumeRenderingVolumetricPresentationStateStorage +# - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage +# - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage +# - ParametricMapStorage +# - PatientRadiationDoseSRStorage +# - PerformedImagingAgentAdministrationSRStorage +# - PlannedImagingAgentAdministrationSRStorage +# - ProtocolApprovalStorage +# - RadiopharmaceuticalRadiationDoseSRStorage +# - RTBrachyApplicationSetupDeliveryInstructionStorage +# - RTPhysicianIntentStorage +# - RTRadiationSetStorage +# - RTSegmentAnnotationStorage +# - SegmentedVolumeRenderingVolumetricPresentationStateStorage +# - SimplifiedAdultEchoSRStorage +# - TractographyResultsStorage +# - VolumeRenderingVolumetricPresentationStateStorage +# - WideFieldOphthalmicPhotographyStereographicProjectionImageStorage +# - WideFieldOphthalmicPhotography3DCoordinatesImageStorage +# +# - DICOS_2DAITStorage +# - DICOS_3DAITStorage +# - DICOS_CTImageStorage +# - DICOS_DigitalXRayImageStorageForPresentation +# - DICOS_DigitalXRayImageStorageForProcessing +# - DICOS_QuadrupoleResonanceStorage +# - DICOS_ThreatDetectionReportStorage +# +# - DICONDE_EddyCurrentImageStorage +# - DICONDE_EddyCurrentMultiframeImageStorage + +[AllBothRoles] +Role1 = BreastProjectionXRayImageStorageForPresentation\BOTH +Role2 = BreastProjectionXRayImageStorageForProcessing\BOTH +Role3 = BreastTomosynthesisImageStorage\BOTH +Role4 = ComputedRadiographyImageStorage\BOTH +Role5 = CornealTopographyMapStorage\BOTH +Role6 = CTImageStorage\BOTH +Role7 = DigitalIntraOralXRayImageStorageForPresentation\BOTH +Role8 = DigitalIntraOralXRayImageStorageForProcessing\BOTH +Role9 = DigitalMammographyXRayImageStorageForPresentation\BOTH +Role10 = DigitalMammographyXRayImageStorageForProcessing\BOTH +Role11 = DigitalXRayImageStorageForPresentation\BOTH +Role12 = DigitalXRayImageStorageForProcessing\BOTH +Role13 = EnhancedCTImageStorage\BOTH +Role14 = EnhancedMRColorImageStorage\BOTH +Role15 = EnhancedMRImageStorage\BOTH +Role16 = EnhancedPETImageStorage\BOTH +Role17 = EnhancedUSVolumeStorage\BOTH +Role18 = EnhancedXAImageStorage\BOTH +Role19 = EnhancedXRFImageStorage\BOTH +Role20 = IntravascularOpticalCoherenceTomographyImageStorageForPresentation\BOTH +Role21 = IntravascularOpticalCoherenceTomographyImageStorageForProcessing\BOTH +Role22 = LegacyConvertedEnhancedCTImageStorage\BOTH +Role23 = LegacyConvertedEnhancedMRImageStorage\BOTH +Role24 = LegacyConvertedEnhancedPETImageStorage\BOTH +Role25 = MRImageStorage\BOTH +Role26 = MultiframeGrayscaleByteSecondaryCaptureImageStorage\BOTH +Role27 = MultiframeGrayscaleWordSecondaryCaptureImageStorage\BOTH +Role28 = MultiframeSingleBitSecondaryCaptureImageStorage\BOTH +Role29 = MultiframeTrueColorSecondaryCaptureImageStorage\BOTH +Role30 = NuclearMedicineImageStorage\BOTH +Role31 = OphthalmicPhotography16BitImageStorage\BOTH +Role32 = OphthalmicPhotography8BitImageStorage\BOTH +Role33 = OphthalmicThicknessMapStorage\BOTH +Role34 = OphthalmicTomographyImageStorage\BOTH +Role35 = ParametricMapStorage\BOTH +Role36 = PositronEmissionTomographyImageStorage\BOTH +Role37 = RTImageStorage\BOTH +Role38 = SecondaryCaptureImageStorage\BOTH +Role39 = UltrasoundImageStorage\BOTH +Role40 = UltrasoundMultiframeImageStorage\BOTH +Role41 = VideoEndoscopicImageStorage\BOTH +Role42 = VideoMicroscopicImageStorage\BOTH +Role43 = VideoPhotographicImageStorage\BOTH +Role44 = VLEndoscopicImageStorage\BOTH +Role45 = VLMicroscopicImageStorage\BOTH +Role46 = VLPhotographicImageStorage\BOTH +Role47 = VLSlideCoordinatesMicroscopicImageStorage\BOTH +Role48 = VLWholeSlideMicroscopyImageStorage\BOTH +Role49 = WideFieldOphthalmicPhotographyStereographicProjectionImageStorage\BOTH +Role50 = WideFieldOphthalmicPhotography3DCoordinatesImageStorage\BOTH +Role51 = XRay3DAngiographicImageStorage\BOTH +Role52 = XRay3DCraniofacialImageStorage\BOTH +Role53 = XRayAngiographicImageStorage\BOTH +Role54 = XRayRadiofluoroscopicImageStorage\BOTH +# +# all other DICOM objects +# +Role55 = AcquisitionContextSRStorage\BOTH +Role56 = AmbulatoryECGWaveformStorage\BOTH +Role57 = ArterialPulseWaveformStorage\BOTH +Role58 = AutorefractionMeasurementsStorage\BOTH +Role59 = BasicStructuredDisplayStorage\BOTH +Role60 = BasicTextSRStorage\BOTH +Role61 = BasicVoiceAudioWaveformStorage\BOTH +Role62 = BlendingSoftcopyPresentationStateStorage\BOTH +Role63 = CardiacElectrophysiologyWaveformStorage\BOTH +Role64 = ChestCADSRStorage\BOTH +Role65 = ColonCADSRStorage\BOTH +Role66 = ColorSoftcopyPresentationStateStorage\BOTH +Role67 = CompositingPlanarMPRVolumetricPresentationStateStorage\BOTH +Role68 = Comprehensive3DSRStorage\BOTH +Role69 = ComprehensiveSRStorage\BOTH +Role70 = ContentAssessmentResultsStorage\BOTH +Role71 = CTDefinedProcedureProtocolStorage\BOTH +Role72 = CTPerformedProcedureProtocolStorage\BOTH +Role73 = DeformableSpatialRegistrationStorage\BOTH +Role74 = EncapsulatedCDAStorage\BOTH +Role75 = EncapsulatedPDFStorage\BOTH +Role76 = EnhancedSRStorage\BOTH +Role77 = ExtensibleSRStorage\BOTH +Role78 = GeneralAudioWaveformStorage\BOTH +Role79 = GeneralECGWaveformStorage\BOTH +Role80 = GenericImplantTemplateStorage\BOTH +Role81 = GrayscalePlanarMPRVolumetricPresentationStateStorage\BOTH +Role82 = GrayscaleSoftcopyPresentationStateStorage\BOTH +Role83 = HangingProtocolStorage\BOTH +Role84 = HemodynamicWaveformStorage\BOTH +Role85 = ImplantAssemblyTemplateStorage\BOTH +Role86 = ImplantationPlanSRDocumentStorage\BOTH +Role87 = ImplantTemplateGroupStorage\BOTH +Role88 = IntraocularLensCalculationsStorage\BOTH +Role89 = KeratometryMeasurementsStorage\BOTH +Role90 = KeyObjectSelectionDocumentStorage\BOTH +Role91 = LensometryMeasurementsStorage\BOTH +Role92 = MacularGridThicknessAndVolumeReportStorage\BOTH +Role93 = MammographyCADSRStorage\BOTH +Role94 = MRSpectroscopyStorage\BOTH +Role95 = OphthalmicAxialMeasurementsStorage\BOTH +Role96 = OphthalmicVisualFieldStaticPerimetryMeasurementsStorage\BOTH +Role97 = ProcedureLogStorage\BOTH +Role98 = PseudoColorSoftcopyPresentationStateStorage\BOTH +Role99 = RadiopharmaceuticalRadiationDoseSRStorage\BOTH +Role100 = RawDataStorage\BOTH +Role101 = RealWorldValueMappingStorage\BOTH +Role102 = RespiratoryWaveformStorage\BOTH +Role103 = RTBeamsDeliveryInstructionStorage\BOTH +Role104 = RTBeamsTreatmentRecordStorage\BOTH +Role105 = RTBrachyApplicationSetupDeliveryInstructionStorage\BOTH +Role106 = RTBrachyTreatmentRecordStorage\BOTH +Role107 = RTDoseStorage\BOTH +Role108 = RTIonBeamsTreatmentRecordStorage\BOTH +Role109 = RTIonPlanStorage\BOTH +Role110 = RTPlanStorage\BOTH +Role111 = RTStructureSetStorage\BOTH +Role112 = RTTreatmentSummaryRecordStorage\BOTH +Role113 = SegmentationStorage\BOTH +Role114 = SimplifiedAdultEchoSRStorage\BOTH +Role115 = SpatialFiducialsStorage\BOTH +Role116 = SpatialRegistrationStorage\BOTH +Role117 = SpectaclePrescriptionReportStorage\BOTH +Role118 = StereometricRelationshipStorage\BOTH +Role119 = SubjectiveRefractionMeasurementsStorage\BOTH +Role120 = SurfaceScanMeshStorage\BOTH +Role121 = SurfaceScanPointCloudStorage\BOTH +Role122 = SurfaceSegmentationStorage\BOTH +Role123 = TractographyResultsStorage\BOTH +Role124 = TwelveLeadECGWaveformStorage\BOTH +Role125 = VisualAcuityMeasurementsStorage\BOTH +Role126 = XAXRFGrayscaleSoftcopyPresentationStateStorage\BOTH +Role127 = XRayRadiationDoseSRStorage\BOTH +# +# the following SOP classes are missing in the above list: +# +# - AdvancedBlendingPresentationStateStorage +# - CArmPhotonElectronRadiationStorage +# - ColorPaletteStorage +# - EncapsulatedSTLStorage +# - MultipleVolumeRenderingVolumetricPresentationStateStorage +# - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage +# - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage +# - PatientRadiationDoseSRStorage +# - PerformedImagingAgentAdministrationSRStorage +# - PlannedImagingAgentAdministrationSRStorage +# - ProtocolApprovalStorage +# - RTPhysicianIntentStorage +# - RTRadiationSetStorage +# - RTSegmentAnnotationStorage +# - SegmentedVolumeRenderingVolumetricPresentationStateStorage +# - VolumeRenderingVolumetricPresentationStateStorage +# +# - RETIRED_HardcopyColorImageStorage +# - RETIRED_HardcopyGrayscaleImageStorage +# - RETIRED_NuclearMedicineImageStorage +# - RETIRED_UltrasoundImageStorage +# - RETIRED_UltrasoundMultiframeImageStorage +# - RETIRED_VLImageStorage +# - RETIRED_VLMultiframeImageStorage +# - RETIRED_XRayAngiographicBiPlaneImageStorage +# +# - RETIRED_StandaloneCurveStorage +# - RETIRED_StandaloneModalityLUTStorage +# - RETIRED_StandaloneOverlayStorage +# - RETIRED_StandalonePETCurveStorage +# - RETIRED_StandaloneVOILUTStorage +# - RETIRED_StoredPrintStorage +# +# - DRAFT_RTBeamsDeliveryInstructionStorage +# - DRAFT_SRAudioStorage +# - DRAFT_SRComprehensiveStorage +# - DRAFT_SRDetailStorage +# - DRAFT_SRTextStorage +# - DRAFT_WaveformStorage +# +# - DICOS_2DAITStorage +# - DICOS_3DAITStorage +# - DICOS_CTImageStorage +# - DICOS_DigitalXRayImageStorageForPresentation +# - DICOS_DigitalXRayImageStorageForProcessing +# - DICOS_QuadrupoleResonanceStorage +# - DICOS_ThreatDetectionReportStorage +# +# - DICONDE_EddyCurrentImageStorage +# - DICONDE_EddyCurrentMultiframeImageStorage + +# ============================================================================ +[[Profiles]] +# ============================================================================ + +[IncomingDefault] +PresentationContexts = GenericStorageSCP +SCPSCURoleSelection = GenericBothRoles + +[IncomingAllDICOM] +PresentationContexts = AllDICOMStorageSCP +SCPSCURoleSelection = AllBothRoles + +[OutgoingDefault] +PresentationContexts = StorageSCUCompressedAndUncompressed diff --git a/dcmqrdb/etc/dcmqrscp.cfg b/dcmqrdb/etc/dcmqrscp.cfg new file mode 100644 index 00000000..ad16b0e8 --- /dev/null +++ b/dcmqrdb/etc/dcmqrscp.cfg @@ -0,0 +1,87 @@ +#----------------------------------------------------------------------- +# +# Example configuration file for the dcmqrscp and dcmqrti applications. +# +#----------------------------------------------------------------------- + +# +# Global Configuration Parameters +# +NetworkTCPPort = 104 +MaxPDUSize = 16384 +MaxAssociations = 16 + +# +# Default settings for specific character set behavior: +# SpecificCharacterSet = fallback + +# +# Uncomment to override response character set with UTF-8 and enable +# transliteration and discarding of unsupported characters: +# SpecificCharacterSet = "ISO_IR 192", override, discard, transliterate + +# +# UserName = +# GroupName = + +HostTable BEGIN +# +# The HostTable defines symbolic names for collections of network +# DICOM Application Entities. A symbolic name can represent a single +# application entity or it can represent a group of application entities. +# Each DICOM application entity is defined by a triple consisting of +# Application Entity Title, host name and TCP/IP port number. +# +# Entry Format: SymbolicName = ( AETitle, HostName, Portnumber ), ... | +# SymbolicName = SymbolicName, ... +# +# NOTE: in the current implementation you cannot substitute an IP address +# for a hostname. +# +acme1 = (ACME1, acmehost1, 5678) +acme2 = (ACME2, acmehost2, 5678) +acmeCTcompany = acme1, acme2 +united1 = (UNITED1, unitedhost1, 104) +united2 = (UNITED2, unitedhost2, 104) +unitedMRcompany = united1, united2 +# +HostTable END + +VendorTable BEGIN +# +# The VendorTable is used by the dcmqrdb and dcmqrti applications. +# You can give a vendor name (r.h.s. entry below) to the dcmqrti +# program and it will talk to all hosts and AEs of the vendor. +# The dcmqrdb program can use the vendor table to restrict move destination +# to hosts belonging to a vendor. +# Also, the dcmqrti and dcmqrdb programs use the name defined on the left hand side +# as the vendor name to display above images. +# +# The format: +# VendorName = SymbolicName +# The symbolic name should be defined in the HostTable. +# +"Acme CT Company" = acmeCTcompany +"United MR Company" = unitedMRcompany +# +VendorTable END + +AETable BEGIN +# +# Each row of the AETable defines an Application Entities (AE) Title known +# to the dcmqrdb application. Each AE Title represents a separate +# image database located in the specified file system directory (storage area). +# Each AE Title has read/write, quota and peer access restrictions. +# +# Entry Format: AETitle StorageArea Access Quota Peers +# AccessFormat: R | RW | W +# Quota Format: ( maxStudies, maxBytesPerStudy ) +# Peers Format: ( Hostname, AETitle, Portnumber ), ... | +# Entry in HostTable | +# ANY +# +COMMON /home/dicom/db/COMMON R (200, 1024mb) ANY +ACME_STORE /home/dicom/db/ACME_STORE RW (9, 1024mb) acmeCTcompany +UNITED_STORE /home/dicom/db/UNITED_STORE RW (9, 1024mb) unitedMRcompany +# +AETable END diff --git a/dcmqrdb/include/CMakeLists.txt b/dcmqrdb/include/CMakeLists.txt new file mode 100644 index 00000000..567088e4 --- /dev/null +++ b/dcmqrdb/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmqrdb DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmqrdb/include/Makefile.in b/dcmqrdb/include/Makefile.in new file mode 100644 index 00000000..90a25c32 --- /dev/null +++ b/dcmqrdb/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmqrdb/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmqrdb + for file in dcmtk/dcmqrdb/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmqrdb ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbf.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbf.h new file mode 100644 index 00000000..3a1fa001 --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbf.h @@ -0,0 +1,100 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveFindContext + * + */ + +#ifndef DCMQRCBF_H +#define DCMQRCBF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +class DcmQueryRetrieveDatabaseHandle; +class DcmQueryRetrieveOptions; +class DcmQueryRetrieveCharacterSetOptions; + +/** this class maintains the context information that is passed to the + * callback function called by DIMSE_findProvider. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveFindContext +{ +public: + /** constructor + * @param handle reference to database handle + * @param options options for the Q/R service + * @param priorStat prior DIMSE status + */ + DcmQueryRetrieveFindContext( + DcmQueryRetrieveDatabaseHandle& handle, + const DcmQueryRetrieveOptions& options, + DIC_US priorStat, + const DcmQueryRetrieveCharacterSetOptions& characterSetOptions) + : dbHandle(handle) + , options_(options) + , priorStatus(priorStat) + , ourAETitle() + , characterSetOptions(characterSetOptions) + { + } + + /** set the AEtitle under which this application operates + * @param ae AEtitle, is copied into this object. + */ + void setOurAETitle(const char *ae) + { + if (ae) ourAETitle = ae; else ourAETitle.clear(); + } + + /** callback handler called by the DIMSE_storeProvider callback function. + * @param cancelled (in) flag indicating whether a C-CANCEL was received + * @param request original find request (in) + * @param requestIdentifiers original find request identifiers (in) + * @param responseCount find response count (in) + * @param response find response (out) + * @param responseIdentifiers find response identifiers (out) + * @param stDetail status detail for find response (out) + */ + void callbackHandler( + OFBool cancelled, T_DIMSE_C_FindRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + T_DIMSE_C_FindRSP *response, + DcmDataset **responseIdentifiers, + DcmDataset **stDetail); + +private: + + /// reference to database handle + DcmQueryRetrieveDatabaseHandle& dbHandle; + + /// reference to Q/R service options + const DcmQueryRetrieveOptions& options_; + + /// prior DIMSE status + DIC_US priorStatus; + + /// our current title + OFString ourAETitle; + + /// Specific Character Set related options + const DcmQueryRetrieveCharacterSetOptions& characterSetOptions; + +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbg.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbg.h new file mode 100644 index 00000000..e1e5531c --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbg.h @@ -0,0 +1,168 @@ +/* + * + * Copyright (C) 1993-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveGetContext + * + */ + +#ifndef DCMQRCBG_H +#define DCMQRCBG_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +class DcmQueryRetrieveDatabaseHandle; +class DcmQueryRetrieveOptions; +class DcmQueryRetrieveDatabaseStatus; + +/** this class maintains the context information that is passed to the + * callback function called by DIMSE_getProvider. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveGetContext +{ +public: + /** constructor + * @param handle reference to database handle + * @param options options for the Q/R service + * @param priorstatus prior DIMSE status + * @param origassoc pointer to DIMSE association + * @param origmsgid DIMSE message ID + * @param prior DIMSE priority + * @param origpresid presentation context ID + */ + DcmQueryRetrieveGetContext(DcmQueryRetrieveDatabaseHandle& handle, + const DcmQueryRetrieveOptions& options, + DIC_US priorstatus, + T_ASC_Association *origassoc, + DIC_US origmsgid, + T_DIMSE_Priority prior, + T_ASC_PresentationContextID origpresid) + : dbHandle(handle) + , options_(options) + , priorStatus(priorstatus) + , origAssoc(origassoc) + , assocStarted(OFFalse) + , origPresId(origpresid) + , origMsgId(origmsgid) + , origAETitle() +// , origHostName() + , priority(prior) + , ourAETitle() + , failedUIDs(NULL) + , nRemaining(0) + , nCompleted(0) + , nFailed(0) + , nWarning(0) + , getCancelled(OFFalse) + { + origHostName[0] = '\0'; + } + + /** set the AEtitle under which this application operates + * @param ae AEtitle, is copied into this object. + */ + void setOurAETitle(const char *ae) + { + if (ae) ourAETitle = ae; else ourAETitle.clear(); + } + + /** callback handler called by the DIMSE_storeProvider callback function. + * @param cancelled (in) flag indicating whether a C-CANCEL was received + * @param request original get request (in) + * @param requestIdentifiers original get request identifiers (in) + * @param responseCount get response count (in) + * @param response get response (out) + * @param stDetail status detail for get response (out) + * @param responseIdentifiers get response identifiers (out) + */ + void callbackHandler( + /* in */ + OFBool cancelled, T_DIMSE_C_GetRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_GetRSP *response, DcmDataset **stDetail, + DcmDataset **responseIdentifiers); + +private: + + /// private undefined copy constructor + DcmQueryRetrieveGetContext(const DcmQueryRetrieveGetContext& other); + + /// private undefined assignment operator + DcmQueryRetrieveGetContext& operator=(const DcmQueryRetrieveGetContext& other); + + void addFailedUIDInstance(const char *sopInstance); + OFCondition performGetSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname); + void getNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus); + void buildFailedInstanceList(DcmDataset ** rspIds); + + /// reference to database handle + DcmQueryRetrieveDatabaseHandle& dbHandle; + + /// reference to Q/R service options + const DcmQueryRetrieveOptions& options_; + + /// prior DIMSE status + DIC_US priorStatus; + + /// pointer to association on which the C-GET-RQ was received + T_ASC_Association *origAssoc; + + /// true if the association was started + OFBool assocStarted; + + /// presentation context id of request + T_ASC_PresentationContextID origPresId; + + /// message id of request + DIC_US origMsgId; + + /// title of requestor + OFString origAETitle; + + /// hostname of requestor + DIC_NODENAME origHostName; + + + /// priority of request + T_DIMSE_Priority priority; + + /// our current title + OFString ourAETitle; + + /// instance UIDs of failed store sub-ops + char *failedUIDs; + + /// number of remaining sub-operations + DIC_US nRemaining; + + /// number of completed sub-operations + DIC_US nCompleted; + + /// number of failed sub-operations + DIC_US nFailed; + + /// number of completed sub-operations that causes warnings + DIC_US nWarning; + + /// true if the get sub-operations have been cancelled + OFBool getCancelled; + +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h new file mode 100644 index 00000000..538dae3c --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h @@ -0,0 +1,188 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveMoveContext + * + */ + +#ifndef DCMQRCBM_H +#define DCMQRCBM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmnet/dcasccfg.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +class DcmQueryRetrieveDatabaseHandle; +class DcmQueryRetrieveOptions; +class DcmQueryRetrieveConfig; +class DcmQueryRetrieveDatabaseStatus; + +/** this class maintains the context information that is passed to the + * callback function called by DIMSE_moveProvider. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveMoveContext +{ +public: + /** constructor + * @param handle reference to database handle + * @param options options for the Q/R service + * @param cfg configuration for the Q/R service + * @param priorstatus prior DIMSE status + * @param assoc pointer to DIMSE association + * @param msgid DIMSE message ID + * @param pr DIMSE priority + */ + DcmQueryRetrieveMoveContext( + DcmQueryRetrieveDatabaseHandle& handle, + const DcmQueryRetrieveOptions& options, + const DcmAssociationConfiguration& associationConfiguration, + const DcmQueryRetrieveConfig *cfg, + DIC_US priorstatus, + T_ASC_Association *assoc, + DIC_US msgid, + T_DIMSE_Priority pr) + : dbHandle(handle) + , options_(options) + , associationConfiguration_(associationConfiguration) + , priorStatus(priorstatus) + , origAssoc(assoc) + , subAssoc(NULL) + , config(cfg) + , assocStarted(OFFalse) + , origMsgId(msgid) +// , origAETitle() +// , origHostName() + , priority(pr) + , ourAETitle() +// , dstAETitle() + , failedUIDs(NULL) + , nRemaining(0) + , nCompleted(0) + , nFailed(0) + , nWarning(0) + { + origAETitle[0] = '\0'; + origHostName[0] = '\0'; + dstAETitle[0] = '\0'; + } + + /** callback handler called by the DIMSE_storeProvider callback function. + * @param cancelled (in) flag indicating whether a C-CANCEL was received + * @param request original move request (in) + * @param requestIdentifiers original move request identifiers (in) + * @param responseCount move response count (in) + * @param response move response (out) + * @param stDetail status detail for move response (out) + * @param responseIdentifiers move response identifiers (out) + */ + void callbackHandler( + /* in */ + OFBool cancelled, T_DIMSE_C_MoveRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_MoveRSP *response, DcmDataset **stDetail, + DcmDataset **responseIdentifiers); + + /** set the AEtitle under which this application operates + * @param ae AEtitle, is copied into this object. + */ + void setOurAETitle(const char *ae) + { + if (ae) ourAETitle = ae; else ourAETitle.clear(); + } + +private: + + /// private undefined copy constructor + DcmQueryRetrieveMoveContext(const DcmQueryRetrieveMoveContext& other); + + /// private undefined assignment operator + DcmQueryRetrieveMoveContext& operator=(const DcmQueryRetrieveMoveContext& other); + + void addFailedUIDInstance(const char *sopInstance); + OFCondition performMoveSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname); + OFCondition buildSubAssociation(T_DIMSE_C_MoveRQ *request); + OFCondition closeSubAssociation(); + void moveNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus); + void failAllSubOperations(DcmQueryRetrieveDatabaseStatus * dbStatus); + void buildFailedInstanceList(DcmDataset ** rspIds); + OFBool mapMoveDestination( + const char *origPeer, const char *origAE, + const char *dstAE, char *dstPeer, size_t dstPeerLen, int *dstPort); + OFCondition addAllStoragePresentationContexts(T_ASC_Parameters *params); + + /// reference to database handle + DcmQueryRetrieveDatabaseHandle& dbHandle; + + /// reference to Q/R service options + const DcmQueryRetrieveOptions& options_; + + /// reference to association configuration + const DcmAssociationConfiguration& associationConfiguration_; + + /// prior DIMSE status + DIC_US priorStatus; + + /// pointer to original association on which the C-MOVE-RQ was received + T_ASC_Association *origAssoc; /* association of requestor */ + + /// pointer to sub-association for outgoing C-STORE-RQ + T_ASC_Association *subAssoc; /* sub-association */ + + /// pointer to Q/R configuration + const DcmQueryRetrieveConfig *config; + + /// true if the association was started + OFBool assocStarted; + + /// message id of request + DIC_US origMsgId; + + /// title of requestor + DIC_AE origAETitle; + + /// hostname of move requestor + DIC_NODENAME origHostName; + + /// priority of move request + T_DIMSE_Priority priority; + + /// our current title + OFString ourAETitle; + + /// destination title for move + DIC_AE dstAETitle; + + /// instance UIDs of failed store sub-ops + char *failedUIDs; + + /// number of remaining sub-operations + DIC_US nRemaining; + + /// number of completed sub-operations + DIC_US nCompleted; + + /// number of failed sub-operations + DIC_US nFailed; + + /// number of completed sub-operations that causes warnings + DIC_US nWarning; + +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbs.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbs.h new file mode 100644 index 00000000..c47b4432 --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbs.h @@ -0,0 +1,133 @@ +/* + * + * Copyright (C) 1993-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveStoreContext + * + */ + +#ifndef DCMQRCBS_H +#define DCMQRCBS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +class DcmQueryRetrieveDatabaseHandle; +class DcmQueryRetrieveOptions; +class DcmFileFormat; + +/** this class maintains the context information that is passed to the + * callback function called by DIMSE_storeProvider. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveStoreContext +{ +public: + /** constructor + * @param handle reference to database handle + * @param options options for the Q/R service + * @param s initial DIMSE status + * @param ff pointer to DcmFileformat object to be used for storing the dataset + * @param correctuidpadding flag indicating whether space padded UIDs should be silently corrected + */ + DcmQueryRetrieveStoreContext( + DcmQueryRetrieveDatabaseHandle& handle, + const DcmQueryRetrieveOptions& options, + DIC_US s, + DcmFileFormat *ff, + OFBool correctuidpadding) + : dbHandle(handle) + , options_(options) + , status(s) + , fileName(NULL) + , dcmff(ff) + , correctUIDPadding(correctuidpadding) + { + } + + /** set DIMSE status + * param s new status + */ + void setStatus(DIC_US s) { status = s; } + + /// return current DIMSE status + DIC_US getStatus() const { return status; } + + /** set file name under which the image should be stored + * @param fn file name. String is not copied. + */ + void setFileName(const char *fn) { fileName = fn; } + + /** callback handler called by the DIMSE_storeProvider callback function. + * @param progress progress state (in) + * @param req original store request (in) + * @param imageFileName being received into (in) + * @param imageDataSet being received into (in) + * @param rsp final store response (out) + * @param stDetail status detail dataset (out) + */ + void callbackHandler( + T_DIMSE_StoreProgress *progress, + T_DIMSE_C_StoreRQ *req, + char *imageFileName, + DcmDataset **imageDataSet, + T_DIMSE_C_StoreRSP *rsp, + DcmDataset **stDetail); + +private: + + void updateDisplay(T_DIMSE_StoreProgress * progress); + + void saveImageToDB( + T_DIMSE_C_StoreRQ *req, /* original store request */ + const char *imageFileName, + /* out */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + DcmDataset **stDetail); + + void writeToFile( + DcmFileFormat *ff, + const char* fname, + T_DIMSE_C_StoreRSP *rsp); + + void checkRequestAgainstDataset( + T_DIMSE_C_StoreRQ *req, /* original store request */ + const char* fname, /* filename of dataset */ + DcmDataset *dataSet, /* dataset to check */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + OFBool uidPadding); /* correct UID padding */ + + /// reference to database handle + DcmQueryRetrieveDatabaseHandle& dbHandle; + + /// reference to Q/R service options + const DcmQueryRetrieveOptions& options_; + + /// current DIMSE status + DIC_US status; + + /// file name under which the incoming image should be stored + const char *fileName; + + /// DICOM file format into which the image is received + DcmFileFormat *dcmff; + + /// flag indicating whether space padded UIDs should be silently corrected + OFBool correctUIDPadding; + +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcnf.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcnf.h new file mode 100644 index 00000000..9284d68b --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcnf.h @@ -0,0 +1,531 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg / Ralph Meyer + * + * Purpose: class DcmQueryRetrieveConfig + * + */ + +#ifndef DCMQRCNF_H +#define DCMQRCNF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +extern DCMTK_DCMQRDB_EXPORT OFLogger DCM_dcmqrdbLogger; + +#define DCMQRDB_TRACE(msg) OFLOG_TRACE(DCM_dcmqrdbLogger, msg) +#define DCMQRDB_DEBUG(msg) OFLOG_DEBUG(DCM_dcmqrdbLogger, msg) +#define DCMQRDB_INFO(msg) OFLOG_INFO(DCM_dcmqrdbLogger, msg) +#define DCMQRDB_WARN(msg) OFLOG_WARN(DCM_dcmqrdbLogger, msg) +#define DCMQRDB_ERROR(msg) OFLOG_ERROR(DCM_dcmqrdbLogger, msg) +#define DCMQRDB_FATAL(msg) OFLOG_FATAL(DCM_dcmqrdbLogger, msg) + +/** this class describes configuration settings regarding character set handling + */ +struct DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveCharacterSetOptions +{ + /** Flags for controlling the application behavior regarding character set + * conversion. Might be used for global and for per peer configuration. + */ + enum Flags + { + /** Activate options for Specific Character Set. + * If this flag is not set, all other flags and the given string for + * Specific Character Set will be ignored, e.g. using the global + * settings instead of peer specific ones. + */ + Configured = 0x01, + + /** Always respond using the given character set, ignoring the + * character set of the request. + * If this flag is not set, the response will be created to the + * character set of the request (if possible). + */ + Override = 0x02, + + /** Fall back to another character set. + * If this flag is set, the application will try to recover from a + * conversion failure: + * - If 'Override' is set, the application will try to convert + * the response to the character set of the request if conversion + * to the given character set failed. + * - If 'Override' is not set, the application will try to convert + * the response to the given character set if conversion to the + * character set of the response failed. + * If this flag is not set, the response will be left as-is, i.e. + * like it is stored in the index file, if conversion to another + * character set failed. + * @note The fall back conversion might also fail, in which case + * the response will still be left as-is, even if a fall back + * option was given. + */ + Fallback = 0x04 + }; + + /** Constructor, will construct an object that is marked as + * "not configured". + */ + DcmQueryRetrieveCharacterSetOptions(); + + /** extract arguments from the config file. + * @param mnemonic the name of the current option + * @param valueptr the argument(s) + * @return OFTrue if the given name value pair referred to a character + * set option and was 'consumed', OFFalse if it should be handled + * elsewhere. + */ + OFBool parseOptions(const char* mnemonic, char* valueptr); + + /// the given character set + OFString characterSet; + + /** determine semantics of the character set value + * @see DcmQueryRetrieveCharacterSet::Flags + */ + unsigned flags; + + /** special character set conversion flags. + * @see OFCharacterEncoding::ConversionFlags + */ + unsigned conversionFlags; +}; + +/** this class describes configuration settings for the quota of a storage area + */ +struct DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveConfigQuota +{ + /// maximum number of studies + int maxStudies; + /// maximum number of bytes per study + long maxBytesPerStudy; +}; + +/** this class describes configuration settings for a remote SCP peer + */ +struct DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveConfigPeer +{ + /// remote peer AE title + const char *ApplicationTitle; + + /// remote peer host name + const char *HostName; + + /// remote peer port number + int PortNumber; +}; + +/** this class describes configuration settings for a single storage area + */ +struct DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveConfigAEEntry +{ + /// application entity title + const char *ApplicationTitle; + + /// name of storage area + const char *StorageArea; + + /// access type (read-only, read/write) + const char *Access; + + /// quota setting for this storage area + DcmQueryRetrieveConfigQuota *StorageQuota; + + /// number of peer entries + int noOfPeers; + + /// array of peer entries describing remote SCP peers + DcmQueryRetrieveConfigPeer *Peers; +}; + +/** this class describes configuration settings for a list of storage areas + */ +struct DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveConfigConfiguration +{ + /// number of storage areas (aetitles) + int noOfAEEntries; + + /// array of entries for each storage area + DcmQueryRetrieveConfigAEEntry *AEEntries; +}; + +/** this class describes configuration settings for one symbolic host or vendor + */ +struct DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveConfigHostEntry +{ + /// symbolic name of host + const char *SymbolicName; + + /// number of peer entries + int noOfPeers; + + /// array of peer entries describing remote SCP peers + DcmQueryRetrieveConfigPeer *Peers; +}; + +/** this class describes configuration settings for a list of symbolic hosts or vendors + */ +struct DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveConfigHostTable +{ + /// number of entries + int noOfHostEntries; + + /// array of entries + DcmQueryRetrieveConfigHostEntry *HostEntries; +}; + +/** this class describes configuration settings for a Query/Retrieve SCP Service + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveConfig +{ + +public: + + DcmQueryRetrieveConfig() + : UserName_() + , GroupName_() + , networkTCPPort_(0) + , maxPDUSize_(0) + , maxAssociations_(0) + , CNF_Config() + , CNF_HETable() + , CNF_VendorTable() + { + } + + ~DcmQueryRetrieveConfig(); + + /* + * read configuration file and initialize the + * intern configuration structure + * Input : configuration file name + * Return : 1 - ok + * 0 - error + */ + int init(const char *ConfigurationFile); + + /* + * search for peer with AETitle + * Input : AETitle + * Ouput : Host Name, Port Number + * Return : 1 - found in AETable + * 2 - found in HostTable + * 0 - not found + */ + int peerForAETitle(const char *AETitle, const char **HostName, int *PortNumber) const; + + /* + * check if given AETitles exist in same + * Vendor Group + * Input : two AETitles + * Return : 1 - same group + * 0 - else + */ + int checkForSameVendor(const char *AETitle1, const char *AETitle2) const; + + /* + * get Storage Area for AETitle + * Input : AETitle + * Return : Storage Area + */ + const char *getStorageArea(const char *AETitle) const; + + /* + * get Number of Maximal Studies + * Input : AETitle + * Return : Number of Maximal Studies + */ + int getMaxStudies(const char *AETitle) const; + + /* + * get Number of maximal Bytes per Study + * Input : AETitle + * Return : Number of maximal Bytes per Study + */ + long getMaxBytesPerStudy(const char *AETitle) const; + + /* + * get Max Associations + * Input : + * Return : Max Associations + */ + int getMaxAssociations() const; + + /* + * get Network TCP Port + * Input : + * Return : Network TCP Port + */ + int getNetworkTCPPort() const; + + /* + * get Max PDU Size + * Input : + * Return : Max PDU Size + */ + OFCmdUnsignedInt getMaxPDUSize() const; + + /* + * check if there is an peer with calling AETitle + * on HostName + * Input : called AETitle, calling AETitle, Host Name + * Return : 1 -- yes + * 0 -- no + */ + int peerInAETitle(const char *calledAETitle, const char *callingAETitle, const char *HostName) const; + + /* + * get Access mode + * Input : AETitle + * Return : Access mode + */ + const char *getAccess(const char *AETitle) const; + + /* + * check if given storage area is read/write + * Input : AETitle + * Return : true if storage area is writable + */ + OFBool writableStorageArea(const char *aeTitle) const; + + // methods only used by TI + + /* + * searches in the host table for all AE titles + * known for peer hostName. Creates an array of string pointers + * containing the known AE titles. The AE titles contained + * in the array are privately owned by the config facility (you + * may not free them). You may free the array when no longer needed. + * + * Input Parameter: peer host name + * Output Parameter: malloc'ed array of private string pointers. + * Returns : number of entries in the malloced array. + * 0 if no entries found. + */ + + int aeTitlesForPeer(const char *hostName, const char *** aeTitleList) const; + + /* + * Creates an array of string pointers + * containing the known AE titles for CTN storage areas. + * The AE titles contained in the array are privately owned + * by the config facility (you may not free them). You may + * free the array when no longer needed. + * + * Output Parameter: malloc'ed array of private string pointers. + * Returns : number of entries in the malloced array. + * 0 if no entries exist. + */ + + int ctnTitles(const char *** ctnTitleList) const; + + /* + * Creates an array of string pointers + * containing the kown Host Names for given Vendor Name. + * The Host Names contained in the array are privately owned + * by the config facility (you may not free them). You may + * free the array when no longer needed. + * Input : Vendor Name + * Ouput : array of string pointers + * Return : number of entries in array + * 0 if no entries exist + */ + int HostNamesForVendor(const char *Vendor, const char ***HostNameArray) const; + + /* + * searches in the host table for all AE titles + * known for a symbolic name. Creates an array of string pointers + * containing the known AE titles. The AE titles contained + * in the array are privately owned by the config facility (you + * may not free them). You may free the array when no longer needed. + * + * Input Parameter: symbolic name + * Output Parameter: malloc'ed array of private string pointers. + * Returns : number of entries in the malloced array. + * 0 if no entries found. + */ + int aeTitlesForSymbolicName(const char *symbolicName, const char ***aeTitleList) const; + + /* + * printf contents of configuration stucture + * to stdout + */ + void printConfig(); + + /* + * get User Name + * Input : + * Return : User Name + */ + const char *getUserName() const; + + /* + * get Group Name + * Input : + * Return : Group Name + */ + const char *getGroupName() const; + + /* + * get Character Set Options + * Input : + * Return : Character Set Options + */ + const DcmQueryRetrieveCharacterSetOptions& getCharacterSetOptions() const; + + /* + * get Character Set Options + * Input : + * Return : Character Set Options + */ + DcmQueryRetrieveCharacterSetOptions& getCharacterSetOptions(); + +private: + + friend class DcmQueryRetrieveCharacterSetOptions; + + const char* vendorForPeerAETitle(const char *peerAETitle) const; + + int countCtnTitles() const; + + + /* + * initialize configuration storage structure + */ + void initConfigStruct(); + + /* + * read configuration file line by line + * Input : configuration file pointer + * Return : 1 - ok + * 0 - error + */ + int readConfigLines(FILE *cnffp); + + /* + * read HostTable in configuration file + * Input : configuration file pointer, line number + * Output : line number + * Return : 1 - ok + * 0 - error + */ + int readHostTable(FILE *cnffp, int *lineno); + + /* + * read VendorTable in configuration file + * Input : configuration file pointer, line number + * Output : line number + * Return : 1 - ok + * 0 - error + */ + int readVendorTable(FILE *cnffp, int *lineno); + + /* + * read AETable in configuration file + * Input : configuration file pointer, line number + * Output : line number + * Return : 1 - ok + * 0 - error + */ + int readAETable(FILE *cnffp, int *lineno); + + /* + * separate the peer list from value list + * Input : pointer to value list + * Output : number of peers + * Return : pointer to peer list + */ + DcmQueryRetrieveConfigPeer *parsePeers(char **valuehandle, int *peers); + + /* + * extract peers from peer list + * Input : pointer to value list + * Output : number of peers + * Return : pointer to peer list + */ + DcmQueryRetrieveConfigPeer *readPeerList(char **valuehandle, int *peers); + + /* + * separate a quota from value list + * Input : pointer to value list + * Return : pointer to quota structure + */ + static DcmQueryRetrieveConfigQuota *parseQuota(char **valuehandle); + + /* + * check if character is white space or separator + * Input : character + * Return : 1 - yes + * 0 - no + */ + static int isgap (char gap); + + /* + * check if character is quote + * Input : character + * Return : 1 - yes + * 0 - no + */ + static int isquote (char quote); + + /* + * print a panic message to stderr + * Input : variable + */ + static void panic(const char *fmt, ...); + + /* + * convert string to long + * Input : parameter string value + * Return : parameter as long + * -1 on error + */ + static long quota (const char *value); + + /* + * skip mnemonic and first gap in rc line + * Input : rc line + * Return : pointer to value list + */ + static char *skipmnemonic (char *rcline); + + /* + * separate on value from value list + * Input : pointer to value list + * Return : pointer to next value + */ + static char *parsevalues (char **valuehandle); + + /* Configuration Parameters */ + OFString UserName_; + OFString GroupName_; + int networkTCPPort_; + Uint32 maxPDUSize_; + int maxAssociations_; + DcmQueryRetrieveCharacterSetOptions characterSetOptions_; + DcmQueryRetrieveConfigConfiguration CNF_Config; /* configuration file contents */ + DcmQueryRetrieveConfigHostTable CNF_HETable; /* HostEntries Table */ + DcmQueryRetrieveConfigHostTable CNF_VendorTable; /* Vendor Table */ + +}; + + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h new file mode 100644 index 00000000..9a3cec58 --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h @@ -0,0 +1,234 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Andrew Hewett, Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveDatabaseHandle + * + */ + +#ifndef DCMQRDBA_H +#define DCMQRDBA_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_UNISTD +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +class DcmDataset; +class DcmQueryRetrieveDatabaseStatus; +struct DcmQueryRetrieveCharacterSetOptions; + +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +/** abstract base class for database handles. A database handle maintains + * a connection to a database and encapsulates database support for + * store, find and move/get operations. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveDatabaseHandle +{ +public: + + /// default constructor + DcmQueryRetrieveDatabaseHandle() { } + + /** Destructor. Destroys handle, cancels any ongoing + * request if necessary, deletes temporary files used for C-STORE and + * sub-operations of C-MOVE. + */ + virtual ~DcmQueryRetrieveDatabaseHandle(); + + /** create a filename under which a DICOM object that is currently + * being received through a C-STORE operation can be stored. + * @param SOPClassUID SOP class UID of DICOM instance + * @param SOPInstanceUID SOP instance UID of DICOM instance + * @param newImageFileName file name is returned in this parameter. + * Memory must be provided by the caller and should be at least MAXPATHLEN+1 + * characters. The file name generated should be an absolute file name. + * @param newImageFileNameLen length of buffer pointed to by newImageFileName + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition makeNewStoreFileName( + const char *SOPClassUID, + const char *SOPInstanceUID, + char *newImageFileName, + size_t newImageFileNameLen) = 0; + + /** register the given DICOM object, which has been received through a C-STORE + * operation and stored in a file, in the database. + * @param SOPClassUID SOP class UID of DICOM instance + * @param SOPInstanceUID SOP instance UID of DICOM instance + * @param imageFileName file name (full path) of DICOM instance + * @param status pointer to DB status object in which a DIMSE status code + suitable for use with the C-STORE-RSP message is set. + * @param isNew if true, the instance is marked as "new" in the database, + * if such a flag is maintained in the database. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition storeRequest( + const char *SOPClassUID, + const char *SOPInstanceUID, + const char *imageFileName, + DcmQueryRetrieveDatabaseStatus *status, + OFBool isNew = OFTrue ) = 0; + + /** initiate FIND operation using the given SOP class UID (which identifies + * the query model) and DICOM dataset containing find request identifiers. + * @param SOPClassUID SOP class UID of query service, identifies Q/R model + * @param findRequestIdentifiers dataset containing request identifiers (i.e., the query) + * The caller retains responsibility for destroying the + * findRequestIdentifiers when no longer needed. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-FIND-RSP message is set. Status will be + * PENDING if any FIND responses will be generated or SUCCESS if no FIND responses will + * be generated (SUCCESS indicates the completion of a operation), or + * another status code upon failure. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition startFindRequest( + const char *SOPClassUID, + DcmDataset *findRequestIdentifiers, + DcmQueryRetrieveDatabaseStatus *status) = 0; + + /** return the next available FIND response as a new DICOM dataset. + * @param findResponseIdentifiers DICOM dataset returned in this parameter. + * The caller is responsible for destroying the findResponseIdentifiers + * when no longer needed. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-FIND-RSP message is set. Status will be + * PENDING if more FIND responses will be generated or SUCCESS if no more + * FIND responses will be generated (SUCCESS indicates the completion of + * a operation), or another status code upon failure. + * @param characterSetOptions the character set options for response conversion etc. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition nextFindResponse( + DcmDataset **findResponseIdentifiers, + DcmQueryRetrieveDatabaseStatus *status, + const DcmQueryRetrieveCharacterSetOptions& characterSetOptions) = 0; + + /** cancel the ongoing FIND request, stop and reset every running operation + * associated with this request, delete existing temporary files. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-FIND-RSP message is set. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition cancelFindRequest(DcmQueryRetrieveDatabaseStatus *status) = 0; + + /** initiate MOVE operation using the given SOP class UID (which identifies + * the retrieve model) and DICOM dataset containing move request identifiers. + * @param SOPClassUID SOP class UID of retrieve service, identifies Q/R model + * @param moveRequestIdentifiers dataset containing request identifiers (i.e., the query) + * The caller retains responsibility for destroying the + * moveRequestIdentifiers when no longer needed. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-MOVE-RSP message is set. Status will be + * PENDING if any MOVE responses will be generated or SUCCESS if no MOVE responses will + * be generated (SUCCESS indicates the completion of a operation), or + * another status code upon failure. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition startMoveRequest( + const char *SOPClassUID, + DcmDataset *moveRequestIdentifiers, + DcmQueryRetrieveDatabaseStatus *status) = 0; + + /** Constructs the information required for the next available C-MOVE + * sub-operation (the image SOP class UID, SOP Instance UID and an + * imageFileName containing the requested data). + * @param SOPClassUID pointer to string of at least 65 characters into + * which the SOP class UID for the next DICOM object to be transferred is copied. + * @param SOPClassUIDSize size of SOPClassUID element + * @param SOPInstanceUID pointer to string of at least 65 characters into + * which the SOP instance UID for the next DICOM object to be transferred is copied. + * @param SOPInstanceUIDSize size of SOPInstanceUID element + * @param imageFileName pointer to string of at least MAXPATHLEN+1 characters into + * which the file path for the next DICOM object to be transferred is copied. + * @param imageFileNameSize size of imageFileName element + * @param numberOfRemainingSubOperations On return, this parameter will contain + * the number of suboperations still remaining for the request + * (this number is needed by move responses with PENDING status). + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-MOVE-RSP message is set. Status will be + * PENDING if more MOVE responses will be generated or SUCCESS if no more + * MOVE responses will be generated (SUCCESS indicates the completion of + * a operation), or another status code upon failure. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition nextMoveResponse( + char *SOPClassUID, + size_t SOPClassUIDSize, + char *SOPInstanceUID, + size_t SOPInstanceUIDSize, + char *imageFileName, + size_t imageFileNameSize, + unsigned short *numberOfRemainingSubOperations, + DcmQueryRetrieveDatabaseStatus *status) = 0; + + /** cancel the ongoing MOVE request, stop and reset every running operation + * associated with this request, delete existing temporary files. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-MOVE-RSP message is set. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + virtual OFCondition cancelMoveRequest(DcmQueryRetrieveDatabaseStatus *status) = 0; + + /** Prune invalid records from the database. + * Records referring to non-existant image files are invalid. + */ + virtual OFCondition pruneInvalidRecords() = 0; + + /** Configure the DB module to perform (or not perform) checking + * of FIND and MOVE request identifiers. Default is no checking. + * @param checkFind checking for C-FIND parameters + * @param checkMove checking for C-MOVE parameters + */ + virtual void setIdentifierChecking(OFBool checkFind, OFBool checkMove) = 0; + +}; + + +/** abstract factory class. Instances of this class are able to create database + * handles for a given called application entity title. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveDatabaseHandleFactory +{ +public: + /** this method creates a new database handle instance on the heap and returns + * a pointer to it, along with a result that indicates if the instance was + * successfully initialized, i.e. connected to the database + * @param callingAETitle calling aetitle + * @param calledAETitle called aetitle + * @param result result returned in this variable + * @return pointer to database object, must not be NULL if result is EC_Normal. + */ + virtual DcmQueryRetrieveDatabaseHandle *createDBHandle( + const char *callingAETitle, + const char *calledAETitle, + OFCondition& result) const = 0; + + /** Virtual Destructor + */ + virtual ~DcmQueryRetrieveDatabaseHandleFactory() {} + +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h new file mode 100644 index 00000000..371f342b --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h @@ -0,0 +1,459 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Andrew Hewett, Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveIndexDatabaseHandle + * + */ + +#ifndef DCMQRDBI_H +#define DCMQRDBI_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrdba.h" /* for class DcmQueryRetrieveDatabaseHandle */ + +#include "dcmtk/dcmnet/dicom.h" +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/ofstd/offname.h" + +struct StudyDescRecord; +struct DB_Private_Handle; +struct DB_SmallDcmElmt; +struct IdxRecord; +struct DB_ElementList; +class DcmQueryRetrieveConfig; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THE INDEX FILE STRUCTS IS MODIFIED */ + +#define DBINDEXFILE "index.dat" +#define DBMAGIC "QRDB" +#define DBVERSION 5 +#define DBHEADERSIZE 6 + +#if DBVERSION > 0xFF +#error maximum database version reached, you have to invent a new mechanism +#endif + +#ifndef _WIN32 +/* we lock image files on all platforms except Win32 where it does not work + * due to the different semantics of LockFile/LockFileEx compared to flock. + */ +#define LOCK_IMAGE_FILES +#endif + +/** enumeration describing the levels of the DICOM Q/R information model + */ +enum DB_LEVEL +{ + /// DICOM Q/R patient level + PATIENT_LEVEL, + /// DICOM Q/R study level + STUDY_LEVEL, + /// DICOM Q/R series level + SERIE_LEVEL, + /// DICOM Q/R instance level + IMAGE_LEVEL +}; + +/** This enum describes the status of one entry in the database hierarchy. An + * entry can describe a study, a series or an instance. A study or series is + * new exactly if all subobjects (series and instances) are new. A study or + * series contains new subobjecs as long as any subobject (series or instance) + * has the status objectIsNew. Instances can never have the status + * DVIF_objectContainsNewSubobjects. + */ +enum DVIFhierarchyStatus +{ + /// object (study, series or instance) in the database is not new + DVIF_objectIsNotNew, + /// object (study, series or instance) in the database is new + DVIF_objectIsNew, + /// object (study or series) in the database is not new but contains new subobjects + DVIF_objectContainsNewSubobjects +}; + +/// upper limit for the number of studies per storage area +#define DB_UpperMaxStudies 500 + +/// upper limit for the number bytes per study +#define DB_UpperMaxBytesPerStudy 0x40000000L + + +/** This class maintains database handles based on the classical "index.dat" file. + * A database handle maintains a connection to a database and encapsulates database support for + * store, find and move/get operations. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveIndexDatabaseHandle: public DcmQueryRetrieveDatabaseHandle +{ +private: + /// private undefined copy constructor + DcmQueryRetrieveIndexDatabaseHandle(const DcmQueryRetrieveIndexDatabaseHandle& other); + + /// private undefined assignment operator + DcmQueryRetrieveIndexDatabaseHandle& operator=(const DcmQueryRetrieveIndexDatabaseHandle& other); + +public: + + /** Constructor. Creates and initializes a index file handle for the given + * database storage area (storageArea). + * @param storageArea name of storage area, must not be NULL + * @param maxStudiesPerStorageArea maximum number of studies for this storage area, + * needed to correctly parse the index file. + * @param maxBytesPerStudy maximum number of bytes per study, for quota mechanism + * @param result upon successful initialization of the database handle, + * EC_Normal is returned in this parameter, otherwise an error code is returned. + */ + DcmQueryRetrieveIndexDatabaseHandle( + const char *storageArea, + long maxStudiesPerStorageArea, + long maxBytesPerStudy, + OFCondition& result); + + /** Destructor. Destroys handle, cancels any ongoing + * request if necessary, deletes temporary files used for C-STORE and + * sub-operations of C-MOVE. + */ + ~DcmQueryRetrieveIndexDatabaseHandle(); + + /** Configure the DB module to perform (or not perform) checking + * of FIND and MOVE request identifiers. Default is no checking. + * @param checkFind checking for C-FIND parameters + * @param checkMove checking for C-MOVE parameters + */ + void setIdentifierChecking(OFBool checkFind, OFBool checkMove); + + /** create a filename under which a DICOM object that is currently + * being received through a C-STORE operation can be stored. + * @param SOPClassUID SOP class UID of DICOM instance + * @param SOPInstanceUID SOP instance UID of DICOM instance + * @param newImageFileName file name is returned in this parameter. + * Memory must be provided by the caller and should be at least MAXPATHLEN+1 + * characters. The file name generated should be an absolute file name. + * @param newImageFileNameLen length of buffer pointed to by newImageFileName + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + OFCondition makeNewStoreFileName( + const char *SOPClassUID, + const char *SOPInstanceUID, + char *newImageFileName, + size_t newImageFileNameLen); + + /** register the given DICOM object, which has been received through a C-STORE + * operation and stored in a file, in the database. + * @param SOPClassUID SOP class UID of DICOM instance + * @param SOPInstanceUID SOP instance UID of DICOM instance + * @param imageFileName file name (full path) of DICOM instance + * @param status pointer to DB status object in which a DIMSE status code + suitable for use with the C-STORE-RSP message is set. + * @param isNew if true, the instance is marked as "new" in the database, + * if such a flag is maintained in the database. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + OFCondition storeRequest( + const char *SOPClassUID, + const char *SOPInstanceUID, + const char *imageFileName, + DcmQueryRetrieveDatabaseStatus *status, + OFBool isNew = OFTrue ); + + /** @copydoc DcmQueryRetrieveDatabaseHandle::startFindRequest() + */ + OFCondition startFindRequest( + const char *SOPClassUID, + DcmDataset *findRequestIdentifiers, + DcmQueryRetrieveDatabaseStatus *status); + + /** @copydoc DcmQueryRetrieveDatabaseHandle::nextFindResponse() + */ + OFCondition nextFindResponse( + DcmDataset **findResponseIdentifiers, + DcmQueryRetrieveDatabaseStatus *status, + const DcmQueryRetrieveCharacterSetOptions& characterSetOptions); + + /** cancel the ongoing FIND request, stop and reset every running operation + * associated with this request, delete existing temporary files. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-FIND-RSP message is set. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + OFCondition cancelFindRequest(DcmQueryRetrieveDatabaseStatus *status); + + /** initiate MOVE operation using the given SOP class UID (which identifies + * the retrieve model) and DICOM dataset containing move request identifiers. + * @param SOPClassUID SOP class UID of retrieve service, identifies Q/R model + * @param moveRequestIdentifiers dataset containing request identifiers (i.e., the query) + * The caller retains responsibility for destroying the + * moveRequestIdentifiers when no longer needed. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-MOVE-RSP message is set. Status will be + * PENDING if any MOVE responses will be generated or SUCCESS if no MOVE responses will + * be generated (SUCCESS indicates the completion of a operation), or + * another status code upon failure. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + OFCondition startMoveRequest( + const char *SOPClassUID, + DcmDataset *moveRequestIdentifiers, + DcmQueryRetrieveDatabaseStatus *status); + + /** Constructs the information required for the next available C-MOVE + * sub-operation (the image SOP class UID, SOP Instance UID and an + * imageFileName containing the requested data). + * @param SOPClassUID pointer to string of at least 65 characters into + * which the SOP class UID for the next DICOM object to be transferred is copied. + * @param SOPClassUIDSize size of SOPClassUID element + * @param SOPInstanceUID pointer to string of at least 65 characters into + * which the SOP instance UID for the next DICOM object to be transferred is copied. + * @param SOPInstanceUIDSize size of SOPInstanceUID element + * @param imageFileName pointer to string of at least MAXPATHLEN+1 characters into + * which the file path for the next DICOM object to be transferred is copied. + * @param imageFileNameSize size of imageFileName element + * @param numberOfRemainingSubOperations On return, this parameter will contain + * the number of suboperations still remaining for the request + * (this number is needed by move responses with PENDING status). + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-MOVE-RSP message is set. Status will be + * PENDING if more MOVE responses will be generated or SUCCESS if no more + * MOVE responses will be generated (SUCCESS indicates the completion of + * a operation), or another status code upon failure. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + OFCondition nextMoveResponse( + char *SOPClassUID, + size_t SOPClassUIDSize, + char *SOPInstanceUID, + size_t SOPInstanceUIDSize, + char *imageFileName, + size_t imageFileNameSize, + unsigned short *numberOfRemainingSubOperations, + DcmQueryRetrieveDatabaseStatus *status); + + /** cancel the ongoing MOVE request, stop and reset every running operation + * associated with this request, delete existing temporary files. + * @param status pointer to DB status object in which a DIMSE status code + * suitable for use with the C-MOVE-RSP message is set. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + OFCondition cancelMoveRequest(DcmQueryRetrieveDatabaseStatus *status); + + /** Prune invalid records from the database. + * Records referring to non-existant image files are invalid. + */ + OFCondition pruneInvalidRecords(); + + // methods not inherited from the base class + + /** enable/disable the DB quota system (default: enabled) which causes images + * to be deleted if certain boundaries (number of studies, bytes per study) are exceeded. + */ + void enableQuotaSystem(OFBool enable); + + /** dump database index file to stdout. + * @param storeArea name of storage area, must not be NULL + */ + static void printIndexFile (char *storeArea); + + /** search for a SOP class and SOP instance UIDs in index file. + * @param storeArea name of storage area, must not be NULL + * @param sopClassUID SOP Class UID to search for + * @param sopInstanceUID SOP Instance UID to search for + * @return OFTrue if SOP Class and SOP Instance UIDs are found. otherwise return OFFalse. + */ + OFBool findSOPInstance(const char *storeArea, const OFString &sopClassUID,const OFString &sopInstanceUID); + + /** deletes the given file only if the quota mechanism is enabled. + * The image is not de-registered from the database by this routine. + * @param imgFile file name (path) to the file to be deleted. + * @return EC_Normal upon normal completion, or some other OFCondition code upon failure. + */ + OFCondition deleteImageFile(char* imgFile); + + /** create lock on database + * @param exclusive exclusive/shared lock flag + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition DB_lock(OFBool exclusive); + + /** release lock on database + */ + OFCondition DB_unlock(); + + /** Get next Index record that is in use (i.e. references a non-empty a filename) + * @param idx pointer to index number, updated upon successful return + * @param idxRec pointer to index record structure + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition DB_IdxGetNext(int *idx, IdxRecord *idxRec); + + /** seek to beginning of image records in index file + * @param idx initialized to -1 + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition DB_IdxInitLoop(int *idx); + + /** read index record at given index + * @param idx index + * @param idxRec pointer to index record + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition DB_IdxRead(int idx, IdxRecord *idxRec); + + /** get study descriptor record from start of index file + * @param pStudyDesc pointer to study record descriptor structure + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition DB_GetStudyDesc(StudyDescRecord *pStudyDesc); + + /** write study descriptor record to start of index file + * @param pStudyDesc pointer to study record descriptor structure + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition DB_StudyDescChange(StudyDescRecord *pStudyDesc); + + /** deactivate index record at given index by setting an empty filename + * @param idx index + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition DB_IdxRemove(int idx); + + /** clear the "is new" flag for the instance with the given index + * @param idx index + * @return EC_Normal upon success, an error code otherwise + */ + OFCondition instanceReviewed(int idx); + + /// return name of storage area + const char *getStorageArea() const; + + /// return path to index file + const char *getIndexFilename() const; + + +private: + + /** a private helper class that performs character set conversions on the fly + * (if necessary) before matching. + */ + class CharsetConsideringMatcher; + + /** Determine if a character set is not compatible to UTF-8, i.e.\ if it is + * not UTF-8 or ASCII. + * @param characterSet the character set to inspect. + * @return OFTrue if the character set is neither ASCII nor UTF-8, OFFalse + * otherwise. + */ + static OFBool isConversionToUTF8Necessary(const OFString& characterSet); + + /** Determine if data in the source character set must be converted to + * be compatible to the given destination character set. + * @param sourceCharacterSet the character set the data is encoded in. + * @param destinationCharacterSet the character set that is requested, + * e.g. the character set that the SCU understands. + * @return OFTrue if the source character set is not equal to and not a + * subset of the destination character set, OFFalse otherwise. + */ + static OFBool isConversionNecessary(const OFString& sourceCharacterSet, + const OFString& destinationCharacterSet); + + OFCondition removeDuplicateImage( + const char *SOPInstanceUID, const char *StudyInstanceUID, + StudyDescRecord *pStudyDesc, const char *newImageFileName); + int deleteOldestStudy(StudyDescRecord *pStudyDesc); + OFCondition deleteOldestImages(StudyDescRecord *pStudyDesc, int StudyNum, char *StudyUID, long RequiredSize); + void makeResponseList(DB_Private_Handle *phandle, IdxRecord *idxRec); + int matchStudyUIDInStudyDesc (StudyDescRecord *pStudyDesc, char *StudyUID, int maxStudiesAllowed); + OFCondition checkupinStudyDesc(StudyDescRecord *pStudyDesc, char *StudyUID, long imageSize); + + OFCondition hierarchicalCompare ( + DB_Private_Handle *phandle, + IdxRecord *idxRec, + DB_LEVEL level, + DB_LEVEL infLevel, + int *match, + CharsetConsideringMatcher& dbmatch); + + OFCondition testFindRequestList ( + DB_ElementList *findRequestList, + DB_LEVEL queryLevel, + DB_LEVEL infLevel, + DB_LEVEL lowestLevel); + + OFCondition testMoveRequestList ( + DB_ElementList *findRequestList, + DB_LEVEL queryLevel, + DB_LEVEL infLevel, + DB_LEVEL lowestLevel); + + /// database handle + DB_Private_Handle *handle_; + + /// flag indicating whether or not the quota system is enabled + OFBool quotaSystemEnabled; + + /// flag indicating whether or not the check function for FIND requests is enabled + OFBool doCheckFindIdentifier; + + /// flag indicating whether or not the check function for MOVE requests is enabled + OFBool doCheckMoveIdentifier; + + /// helper object for file name creation + OFFilenameCreator fnamecreator; + +}; + + +/** Index database factory class. Instances of this class are able to create database + * handles for a given called application entity title. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveIndexDatabaseHandleFactory: public DcmQueryRetrieveDatabaseHandleFactory +{ +private: + /// private undefined copy constructor + DcmQueryRetrieveIndexDatabaseHandleFactory(const DcmQueryRetrieveIndexDatabaseHandleFactory& other); + + /// private undefined assignment operator + DcmQueryRetrieveIndexDatabaseHandleFactory& operator=(const DcmQueryRetrieveIndexDatabaseHandleFactory& other); + +public: + + /** constructor + * @param config system configuration object, must not be NULL. + */ + DcmQueryRetrieveIndexDatabaseHandleFactory(const DcmQueryRetrieveConfig *config); + + /// destructor + virtual ~DcmQueryRetrieveIndexDatabaseHandleFactory(); + + /** this method creates a new database handle instance on the heap and returns + * a pointer to it, along with a result that indicates if the instance was + * successfully initialized, i.e. connected to the database + * @param callingAETitle calling aetitle + * @param calledAETitle called aetitle + * @param result result returned in this variable + * @return pointer to database object, must not be NULL if result is EC_Normal. + */ + virtual DcmQueryRetrieveDatabaseHandle *createDBHandle( + const char *callingAETitle, + const char *calledAETitle, + OFCondition& result) const; + +private: + + /// pointer to system configuration + const DcmQueryRetrieveConfig *config_; +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h new file mode 100644 index 00000000..3e5659f7 --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbs.h @@ -0,0 +1,78 @@ +/* + * + * Copyright (C) 1993-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveDatabaseStatus + * + */ + +#ifndef DCMQRDBS_H +#define DCMQRDBS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +class DcmDataset; + +/** this class describes the result of a database operation (for an + * incoming C-FIND, C-MOVE, C-GET or C-STORE request) in a format + * that can directly be communicated to the remote SCU in a DIMSE RSP message. + * An object of this class comprises a status field along with an + * optional dataset containing status detail information. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveDatabaseStatus +{ +public: + /** default constructor + * @param s initial DIMSE status, default is 0 (success). + */ + DcmQueryRetrieveDatabaseStatus(Uint16 s = 0); + + /// copy constructor + DcmQueryRetrieveDatabaseStatus(const DcmQueryRetrieveDatabaseStatus& org); + + /// destructor + ~DcmQueryRetrieveDatabaseStatus(); + + /// copy assignment operator + DcmQueryRetrieveDatabaseStatus& operator=(const DcmQueryRetrieveDatabaseStatus& org); + + /// delete status detail, if any + void deleteStatusDetail(); + + /** return pointer to status detail object, then set status detail to NULL + * @return status detail, may be NULL + */ + DcmDataset *extractStatusDetail(); + + /// return status value + Uint16 status() const { return status_; } + + /** set new status value + * @param s new status + */ + void setStatus(Uint16 s) { status_ = s; } + +private: + /// the status flag as defined for the various DIMSE services + Uint16 status_; + + /// an optional DICOM dataset with status detail, may be NULL. + DcmDataset *statusDetail_; +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h new file mode 100644 index 00000000..38d65e84 --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h @@ -0,0 +1,426 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg / Didier Lemoine / Gilles Mevel + * + * Purpose: enums and structures used for the database index file + * + */ + +#ifndef DATAPRIV_H +#define DATAPRIV_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofoption.h" +#include "dcmtk/dcmnet/dicom.h" +#include "dcmtk/dcmdata/dcdatset.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcspchrs.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" + +BEGIN_EXTERN_C +#ifdef HAVE_IO_H +#define access my_access // Workaround to make Visual C++ Compiler happy! +#include +#undef access +#endif +END_EXTERN_C + +// include this file in doxygen documentation + +/** @file dcmqridx.h + * @brief type definitions and constants for the database index file + */ + +/** types of query keys + */ +enum DB_KEY_TYPE +{ + /// unique key + UNIQUE_KEY, + /// required key + REQUIRED_KEY, + /// optional key + OPTIONAL_KEY +}; + +/** query models + */ +enum DB_QUERY_CLASS +{ + /// patient root Q/R model + PATIENT_ROOT, + /// study root Q/R model + STUDY_ROOT, + /// patient/study only Q/R model + PATIENT_STUDY +}; + +/** Level Strings + */ + +#define PATIENT_LEVEL_STRING "PATIENT" +#define STUDY_LEVEL_STRING "STUDY" +#define SERIE_LEVEL_STRING "SERIES" +#define IMAGE_LEVEL_STRING "IMAGE" + +/* +** Maximum size of things to put in db records. +** Some values will have vm>1 thus these maximums are +** intended to leave enough space for most common uses. +*/ +#define AE_MAX_LENGTH 128 /* Application Entity */ +#define AS_MAX_LENGTH 32 /* Age String */ +#define AT_MAX_LENGTH 32 /* Attribute Tag */ +#define CS_MAX_LENGTH 128 /* Code String */ +#define DA_MAX_LENGTH 80 /* Date */ +#define DS_MAX_LENGTH 128 /* Decimal String */ +#define DT_MAX_LENGTH 208 /* Date Time */ +#define FL_MAX_LENGTH 32 /* FLoating point single */ +#define FD_MAX_LENGTH 64 /* Floating point Double */ +#define IS_MAX_LENGTH 96 /* Integer String */ +#define LO_MAX_LENGTH 256 /* Long String */ +#define LT_MAX_LENGTH 40960 /* Long Text */ +#define PN_MAX_LENGTH 256 /* Person Name */ +#define SH_MAX_LENGTH 64 /* Short String */ +#define SL_MAX_LENGTH 32 /* Signed Long */ +#define SS_MAX_LENGTH 16 /* Signed Short */ +#define ST_MAX_LENGTH 4096 /* Short Text */ +#define TM_MAX_LENGTH 128 /* Time */ +#define UI_MAX_LENGTH 64 /* Unique Identifier */ +#define UL_MAX_LENGTH 32 /* Unsigned Long */ +#define US_MAX_LENGTH 16 /* Unsigned Short */ +#define CS_LABEL_MAX_LENGTH 16 /* Code String - Presentation Label */ +#define DESCRIPTION_MAX_LENGTH 128 /* Not related to any particular DICOM attribute */ + +#define DBC_MAXSTRING 256 + +#define MAX_MAX_STUDIES DB_UpperMaxStudies +#define MAX_NUMBER_OF_IMAGES 10000 +#define SIZEOF_IDXRECORD (sizeof (IdxRecord)) +#define SIZEOF_STUDYDESC (sizeof (StudyDescRecord) * MAX_MAX_STUDIES) + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +struct DCMTK_DCMQRDB_EXPORT DB_SerializedTagKey +{ + inline DB_SerializedTagKey() {} + inline DB_SerializedTagKey(const DcmTagKey& rhs) { *this = rhs; } + inline DB_SerializedTagKey& operator=(const DcmTagKey& tk) { key[0] = tk.getGroup(); key[1] = tk.getElement(); return *this; } + inline operator DcmTagKey() const { return DcmTagKey( key[0], key[1] ); } + inline bool operator==(const DB_SerializedTagKey& rhs) const { return key[0] == rhs.key[0] && key[1] == rhs.key[1]; } + Uint16 key[2]; +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +struct DCMTK_DCMQRDB_EXPORT DB_SerializedCharPtr +{ + inline DB_SerializedCharPtr(char* p) { ptr.p = p; } + inline DB_SerializedCharPtr& operator=(char* p) { ptr.p = p; return *this; } + inline operator char*() const { return ptr.p; } + union + { + char* p; + Uint64 placeholder; + } ptr ; +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +/** this class provides a primitive interface for handling a flat DICOM element, + * similar to DcmElement, but only for use within the database module + */ +struct DCMTK_DCMQRDB_EXPORT DB_SmallDcmElmt +{ +public: + /// default constructor + DB_SmallDcmElmt(); + + /// pointer to the value field + DB_SerializedCharPtr PValueField ; + + /// value length in bytes + Uint32 ValueLength ; + + /// attribute tag + DB_SerializedTagKey XTag ; + +private: + /// private undefined copy constructor + DB_SmallDcmElmt(const DB_SmallDcmElmt& copy); + /// private undefined copy assignment operator + DB_SmallDcmElmt& operator=(const DB_SmallDcmElmt& copy); +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +/** this class provides a primitive interface for handling a list of flat DICOM elements, + * similar to DcmItem, but only for use within the database module + */ +struct DCMTK_DCMQRDB_EXPORT DB_ElementList +{ + /// default constructor + DB_ElementList(): elem(), next(NULL), utf8Value() {} + + /// current list element + DB_SmallDcmElmt elem ; + + /// pointer to next in list + struct DB_ElementList *next ; + + /// UTF-8 cache + OFoptional utf8Value ; + +private: + /// private undefined copy constructor + DB_ElementList(const DB_ElementList& copy); + /// private undefined copy assignment operator + DB_ElementList& operator=(const DB_ElementList& copy); +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +struct DCMTK_DCMQRDB_EXPORT DB_UidList +{ + char *patient ; + char *study ; + char *serie ; + char *image ; + struct DB_UidList *next ; +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +struct DCMTK_DCMQRDB_EXPORT DB_CounterList +{ + int idxCounter ; + struct DB_CounterList *next ; +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +struct DCMTK_DCMQRDB_EXPORT DB_FindAttr +{ + DcmTagKey tag ; + DB_LEVEL level ; + DB_KEY_TYPE keyAttr ; + + /* to passify some C++ compilers */ + DB_FindAttr(const DcmTagKey& t, DB_LEVEL l, DB_KEY_TYPE kt) + : tag(t), level(l), keyAttr(kt) { } +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +struct DCMTK_DCMQRDB_EXPORT DB_Private_Handle +{ + int pidx ; + OFString findRequestCharacterSet ; + DcmSpecificCharacterSet findRequestConverter ; + DB_ElementList *findRequestList ; + DB_ElementList *findResponseList ; + DB_LEVEL queryLevel ; + char indexFilename[DBC_MAXSTRING+1] ; + char storageArea[DBC_MAXSTRING+1] ; + long maxBytesPerStudy ; + long maxStudiesAllowed ; + int idxCounter ; + DB_CounterList *moveCounterList ; + int NumberRemainOperations ; + DB_QUERY_CLASS rootLevel ; + DB_UidList *uidList ; + + DB_Private_Handle() + : pidx(0) + , findRequestCharacterSet() + , findRequestConverter() + , findRequestList(NULL) + , findResponseList(NULL) + , queryLevel(STUDY_LEVEL) +// , indexFilename() +// , storageArea() + , maxBytesPerStudy(0) + , maxStudiesAllowed(0) + , idxCounter(0) + , moveCounterList(NULL) + , NumberRemainOperations(0) + , rootLevel(STUDY_ROOT) + , uidList(NULL) + { + } +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +/** this struct defines the structure of each "Study Record" in the index.dat + * file maintained by this module. A Study Record is a direct binary copy + * of an instance of this struct. + */ +struct DCMTK_DCMQRDB_EXPORT StudyDescRecord +{ + /// Study Instance UID of the study described by this record + char StudyInstanceUID [UI_MAX_LENGTH+1] ; + + /// combined size (in bytes) of all images of this study in the database + Uint32 StudySize ; + + /// timestamp for last update of this study. Format: output of time(2) converted to double. + double LastRecordedDate ; + + /// number of images of this study in the database + Uint32 NumberofRegistratedImages ; +}; + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +struct DCMTK_DCMQRDB_EXPORT ImagesofStudyArray +{ + Uint32 idxCounter ; + double RecordedDate ; + Uint32 ImageSize ; +}; + + +/* the following constants define which array element + * of the param[] array in the IdxRecord structure + * is linked to which value field in the IdxRecord. + * numbers must be continuous, starting with 0. + * + * The constant NBPARAMETERS must contain the number + * of array elements to be referenced in param[] + * (= highest index +1) + */ + +#define RECORDIDX_PatientBirthDate 0 +#define RECORDIDX_PatientSex 1 +#define RECORDIDX_PatientName 2 +#define RECORDIDX_PatientID 3 +#define RECORDIDX_PatientBirthTime 4 +#define RECORDIDX_OtherPatientIDs 5 +#define RECORDIDX_OtherPatientNames 6 +#define RECORDIDX_EthnicGroup 7 +#define RECORDIDX_StudyDate 8 +#define RECORDIDX_StudyTime 9 +#define RECORDIDX_StudyID 10 +#define RECORDIDX_StudyDescription 11 +#define RECORDIDX_NameOfPhysiciansReadingStudy 12 +#define RECORDIDX_AccessionNumber 13 +#define RECORDIDX_ReferringPhysicianName 14 +#define RECORDIDX_ProcedureDescription 15 +#define RECORDIDX_AttendingPhysiciansName 16 +#define RECORDIDX_StudyInstanceUID 17 +#define RECORDIDX_OtherStudyNumbers 18 +#define RECORDIDX_AdmittingDiagnosesDescription 19 +#define RECORDIDX_PatientAge 20 +#define RECORDIDX_PatientSize 21 +#define RECORDIDX_PatientWeight 22 +#define RECORDIDX_Occupation 23 +#define RECORDIDX_SeriesNumber 24 +#define RECORDIDX_SeriesInstanceUID 25 +#define RECORDIDX_Modality 26 +#define RECORDIDX_ImageNumber 27 +#define RECORDIDX_SOPInstanceUID 28 +#define RECORDIDX_SeriesDate 29 +#define RECORDIDX_SeriesTime 30 +#define RECORDIDX_SeriesDescription 31 +#define RECORDIDX_ProtocolName 32 +#define RECORDIDX_OperatorsName 33 +#define RECORDIDX_PerformingPhysicianName 34 +#define RECORDIDX_PresentationLabel 35 +#define RECORDIDX_IssuerOfPatientID 36 +#define RECORDIDX_SpecificCharacterSet 37 + +#define NBPARAMETERS 38 + +/* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */ + +/** this class manages an instance entry of the index file. + * Each instance/image record within the index.dat file is + * a direct (binary) copy of this structure. + */ +struct DCMTK_DCMQRDB_EXPORT IdxRecord +{ + /// default constructor + IdxRecord(); + + char filename [DBC_MAXSTRING+1] ; + char SOPClassUID [UI_MAX_LENGTH+1] ; + double RecordedDate ; + Uint32 ImageSize ; + + DB_SmallDcmElmt param [NBPARAMETERS] ; + + char PatientBirthDate [DA_MAX_LENGTH+1] ; + char PatientSex [CS_MAX_LENGTH+1] ; + char PatientName [PN_MAX_LENGTH+1] ; + char PatientID [LO_MAX_LENGTH+1] ; + char PatientBirthTime [TM_MAX_LENGTH+1] ; + char OtherPatientIDs [LO_MAX_LENGTH+1] ; + char OtherPatientNames [PN_MAX_LENGTH+1] ; + char EthnicGroup [SH_MAX_LENGTH+1] ; + + char StudyDate [DA_MAX_LENGTH+1] ; + char StudyTime [TM_MAX_LENGTH+1] ; + char StudyID [CS_MAX_LENGTH+1] ; + char StudyDescription [LO_MAX_LENGTH+1] ; + char NameOfPhysiciansReadingStudy [PN_MAX_LENGTH+1] ; + + char AccessionNumber [CS_MAX_LENGTH+1] ; + char ReferringPhysicianName [PN_MAX_LENGTH+1] ; + char ProcedureDescription [LO_MAX_LENGTH+1] ; + char AttendingPhysiciansName [PN_MAX_LENGTH+1] ; + char StudyInstanceUID [UI_MAX_LENGTH+1] ; + char OtherStudyNumbers [IS_MAX_LENGTH+1] ; + char AdmittingDiagnosesDescription [LO_MAX_LENGTH+1] ; + char PatientAge [AS_MAX_LENGTH+1] ; + char PatientSize [DS_MAX_LENGTH+1] ; + char PatientWeight [DS_MAX_LENGTH+1] ; + char Occupation [SH_MAX_LENGTH+1] ; + + char SeriesNumber [IS_MAX_LENGTH+1] ; + char SeriesInstanceUID [UI_MAX_LENGTH+1] ; + char Modality [CS_MAX_LENGTH+1] ; + + char ImageNumber [IS_MAX_LENGTH+1] ; + char SOPInstanceUID [UI_MAX_LENGTH+1] ; + + char SeriesDate [DA_MAX_LENGTH+1] ; + char SeriesTime [TM_MAX_LENGTH+1] ; + char SeriesDescription [LO_MAX_LENGTH+1] ; + char ProtocolName [LO_MAX_LENGTH+1] ; + char OperatorsName [PN_MAX_LENGTH+1] ; + char PerformingPhysicianName [PN_MAX_LENGTH+1] ; + char PresentationLabel [CS_LABEL_MAX_LENGTH+1] ; + char IssuerOfPatientID [LO_MAX_LENGTH+1] ; + + char hstat; + + // Not related to any particular DICOM attribute ! + char InstanceDescription [DESCRIPTION_MAX_LENGTH+1] ; + + // Specific Character Set, support for VM ~ 8 (depending on the + // actual length of the used DTs) + char SpecificCharacterSet [CS_MAX_LENGTH*8+1] ; + +private: + /* undefined */ IdxRecord(const IdxRecord& copy); + /* undefined */ IdxRecord& operator=(const IdxRecord& copy); +}; + + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqropt.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqropt.h new file mode 100644 index 00000000..bc83777c --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqropt.h @@ -0,0 +1,174 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Andrew Hewett + * + * Purpose: class DcmQueryRetrieveOptions + * + */ + +#ifndef DCMQROPT_H +#define DCMQROPT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcxfer.h" +#include "dcmtk/dcmnet/dicom.h" +#include "dcmtk/dcmnet/cond.h" +#include "dcmtk/dcmnet/assoc.h" +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmnet/dimse.h" + +/// invalid peer for move operation +extern DCMTK_DCMQRDB_EXPORT const OFConditionConst QR_EC_InvalidPeer; +extern DCMTK_DCMQRDB_EXPORT const OFConditionConst QR_EC_IndexDatabaseError; + +/** this class encapsulates all the various options that affect the + * operation of the SCP, in addition to those defined in the config file + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveOptions +{ +private: + /// private undefined copy constructor + DcmQueryRetrieveOptions(const DcmQueryRetrieveOptions& other); + + /// private undefined assignment operator + DcmQueryRetrieveOptions& operator=(const DcmQueryRetrieveOptions& other); + +public: + /// default constructor + DcmQueryRetrieveOptions(); + + /// destructor + ~DcmQueryRetrieveOptions(); + + // these member variables should be private but are public for now + + /// enable negotiation of private shutdown SOP class + OFBool allowShutdown_; + + /// bit preserving mode for incoming storage requests. + OFBool bitPreserving_; + + /// silently correct space-padded UIDs + OFBool correctUIDPadding_; + + /// enable/disable C-GET support + OFBool disableGetSupport_; + + /// block size for file padding, pad DICOM files to multiple of this value + OFCmdUnsignedInt filepad_; + + /// group length encoding when writing DICOM files + E_GrpLenEncoding groupLength_; + + /// ignore incoming data, receive but do not store (for debugging) + OFBool ignoreStoreData_; + + /// block size for item padding, pad DICOM files to multiple of this value + OFCmdUnsignedInt itempad_; + + /// maximum number of parallel associations accepted + int maxAssociations_; + + /// maximum PDU size + OFCmdUnsignedInt maxPDU_; + + /// pointer to network structure used for requesting C-STORE sub-associations + T_ASC_Network * net_; + + /// preferred transfer syntax for incoming associations + E_TransferSyntax networkTransferSyntax_; + +#ifndef DISABLE_COMPRESSION_EXTENSION + /// preferred transfer syntax for outgoing associations + E_TransferSyntax networkTransferSyntaxOut_; +#endif + + /// padding algorithm for writing DICOM files + E_PaddingEncoding paddingType_; + + /* refuse storage presentation contexts in incoming associations + * if a storage presentation context for the application entity already exists + */ + OFBool refuseMultipleStorageAssociations_; + + /// refuse all incoming associations + OFBool refuse_; + + /// reject associations if implementatino class UID is missing + OFBool rejectWhenNoImplementationClassUID_; + + /// refuse MOVE context if no corresponding FIND context is present + OFBool requireFindForMove_; + + /// restrict MOVE operations to same Application Entity + OFBool restrictMoveToSameAE_; + + /// restrict MOVE operations to same host + OFBool restrictMoveToSameHost_; + + /// restrict MOVE operations to same vendor according to vendor table + OFBool restrictMoveToSameVendor_; + + /// sequence encoding when writing DICOM files + E_EncodingType sequenceType_; + + /// single process mode + OFBool singleProcess_; + + /// support for patient root q/r model + OFBool supportPatientRoot_; + + /// support for patient/study only q/r model + OFBool supportPatientStudyOnly_; + + /// support for study root q/r model + OFBool supportStudyRoot_; + + /// write DICOM files with DICOM metaheader + OFBool useMetaheader_; + + /** keep DB handle open for the complete lifetime of an association. + * If false, the DB handle is created and released for each incoming + * DIMSE message that is processed. + */ + OFBool keepDBHandleDuringAssociation_; + + /// transfer syntax for writing + E_TransferSyntax writeTransferSyntax_; + + /// blocking mode for DIMSE operations + T_DIMSE_BlockingMode blockMode_; + + /// timeout for DIMSE operations + int dimse_timeout_; + + /// timeout for ACSE operations + int acse_timeout_; + + // association configuration file name + OFString associationConfigFile; + + /// profile name for incoming association configuration + OFString incomingProfile; + + /// profile name for outgoing association configuration + OFString outgoingProfile; +}; + + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrptb.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrptb.h new file mode 100644 index 00000000..2767d22a --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrptb.h @@ -0,0 +1,96 @@ +/* + * + * Copyright (C) 1993-2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveProcessTable + * + */ + +#ifndef DCMQRPTB_H +#define DCMQRPTB_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/dcmnet/assoc.h" +#include "dcmtk/dcmqrdb/qrdefine.h" + +#define INCLUDE_CTIME +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_TIME_H +#include +#endif +END_EXTERN_C + + +class DcmQueryRetrieveProcessSlot; + + +/** this class maintains a table of client processes. For each client process, + * certain key parameters such as the peer hostname, AE titles, read/write access + * are stored along with the process ID. + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveProcessTable +{ +public: + /// default constructor + DcmQueryRetrieveProcessTable() : table_() { } + + /// destructor + virtual ~DcmQueryRetrieveProcessTable(); + + /** adds a new child process to the process table. + * @param pid process ID of the child process + * @param assoc peer hostname and AEtitles are read from this object + */ + void addProcessToTable(int pid, T_ASC_Association * assoc); + + /** returns the number of child processes in the table + * @return number of child processes + */ + size_t countChildProcesses() const + { + return table_.size(); + } + + /** check if child processes have terminated and, if yes, remove + * them from the process table. This method should be called + * regularly. + */ + void cleanChildren(); + + /** check if we have a child process that has write access to the + * given aetitle. Used to enforce an ad-hoc rule that allows only + * one parallel association to negotiate storage presentation contexts + * for each storage area (aetitle) + */ + OFBool haveProcessWithWriteAccess(const char *calledAETitle) const; + +private: + + /** remove the process with the given process ID from the table + * @param pid process ID + */ + void removeProcessFromTable(int pid); + + /// the list of process entries maintained by this object. + OFList table_; +}; + + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrsrv.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrsrv.h new file mode 100644 index 00000000..3c4a9099 --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrsrv.h @@ -0,0 +1,174 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveSCP + * + */ + +#ifndef DCMQRSRV_H +#define DCMQRSRV_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/dcmnet/assoc.h" +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/dcmnet/dcasccfg.h" +#include "dcmtk/dcmqrdb/dcmqrptb.h" + +class DcmQueryRetrieveConfig; +class DcmQueryRetrieveOptions; +class DcmQueryRetrieveDatabaseHandle; +class DcmQueryRetrieveDatabaseHandleFactory; + +/// enumeration describing reasons for refusing an association request +enum CTN_RefuseReason +{ + /// too many concurrent associations + CTN_TooManyAssociations, + /// fork system function failed + CTN_CannotFork, + /// bad application context (not DICOM) + CTN_BadAppContext, + /// unknown peer application entity title (access not authorised) + CTN_BadAEPeer, + /// unknown peer application entity title (access not authorised) + CTN_BadAEService, + /// other non-specific reason + CTN_NoReason +}; + +/** main class for Query/Retrieve Service Class Provider + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveSCP +{ +public: + + /** constructor + * @param config SCP configuration facility + * @param options SCP configuration options + * @param factory factory object used to create database handles + */ + DcmQueryRetrieveSCP( + const DcmQueryRetrieveConfig& config, + const DcmQueryRetrieveOptions& options, + const DcmQueryRetrieveDatabaseHandleFactory& factory, + const DcmAssociationConfiguration& associationConfiguration); + + /// destructor + virtual ~DcmQueryRetrieveSCP() { } + + /** wait for incoming A-ASSOCIATE requests, perform association negotiation + * and serve the requests. May fork child processes depending on availability + * of the fork() system function and configuration options. + * @param theNet network structure for listen socket + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition waitForAssociation(T_ASC_Network *theNet); + + /** set database flags + * @param dbCheckFindIdentifier flag indicating that a check should be performed for C-FIND requests + * @param dbCheckMoveIdentifier flag indicating that a check should be performed for C-MOVE requests + */ + void setDatabaseFlags( + OFBool dbCheckFindIdentifier, + OFBool dbCheckMoveIdentifier); + + /** clean up terminated child processes. + */ + void cleanChildren(); + +private: + + /// private undefined copy constructor + DcmQueryRetrieveSCP(const DcmQueryRetrieveSCP& other); + + /// private undefined assignment operator + DcmQueryRetrieveSCP& operator=(const DcmQueryRetrieveSCP& other); + + /** perform association negotiation for an incoming A-ASSOCIATE request based + * on the SCP configuration and option flags. No A-ASSOCIATE response is generated, + * this is left to the caller. + * @param assoc incoming association + * @return EC_Normal if successful, an error code otherwise + */ + OFCondition negotiateAssociation(T_ASC_Association * assoc); + + OFCondition refuseAssociation(T_ASC_Association ** assoc, CTN_RefuseReason reason); + + OFCondition handleAssociation( + T_ASC_Association * assoc, + OFBool correctUIDPadding); + + OFCondition echoSCP( + T_ASC_Association * assoc, + T_DIMSE_C_EchoRQ * req, + T_ASC_PresentationContextID presId); + + OFCondition findSCP( + T_ASC_Association * assoc, + T_DIMSE_C_FindRQ * request, + T_ASC_PresentationContextID presID, + DcmQueryRetrieveDatabaseHandle& dbHandle); + + OFCondition getSCP( + T_ASC_Association * assoc, + T_DIMSE_C_GetRQ * request, + T_ASC_PresentationContextID presID, + DcmQueryRetrieveDatabaseHandle& dbHandle); + + OFCondition moveSCP( + T_ASC_Association * assoc, + T_DIMSE_C_MoveRQ * request, + T_ASC_PresentationContextID presID, + DcmQueryRetrieveDatabaseHandle& dbHandle); + + OFCondition storeSCP( + T_ASC_Association * assoc, + T_DIMSE_C_StoreRQ * req, + T_ASC_PresentationContextID presId, + DcmQueryRetrieveDatabaseHandle& dbHandle, + OFBool correctUIDPadding); + + OFCondition dispatch( + T_ASC_Association *assoc, + OFBool correctUIDPadding); + + static void refuseAnyStorageContexts(T_ASC_Association *assoc); + + /// configuration facility + const DcmQueryRetrieveConfig *config_; + + /// child process table, only used in multi-processing mode + DcmQueryRetrieveProcessTable processtable_; + + /// flag for database interface: check C-FIND identifier + OFBool dbCheckFindIdentifier_; + + /// flag for database interface: check C-MOVE identifier + OFBool dbCheckMoveIdentifier_; + + /// factory object used to create database handles + const DcmQueryRetrieveDatabaseHandleFactory& factory_; + + /// SCP configuration options + const DcmQueryRetrieveOptions& options_; + + /// Association configuration profiles read from configuration file + const DcmAssociationConfiguration& associationConfiguration_; +}; + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrtis.h b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrtis.h new file mode 100644 index 00000000..7583cd1a --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrtis.h @@ -0,0 +1,296 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Andrew Hewett + * + * Purpose: TI Common Constants, Types, Globals and Functions + * + */ + +#ifndef DCMQRTIS_H +#define DCMQRTIS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmnet/dicom.h" +#include "dcmtk/dcmnet/cond.h" +#include "dcmtk/dcmnet/assoc.h" +#include "dcmtk/dcmnet/dimse.h" +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/dcmqrdb/dcmqrcnf.h" + +class DcmQueryRetrieveDatabaseHandle; + +/* + * Constants + */ + +#define TI_MAXPEERS 100 +#define TI_MAXDATABASES 100 +#define TI_MAXSTUDIES 1000 +#define TI_MAXSERIES 500 +#define TI_MAXIMAGES 1000 + +/* + * Type definitions + */ + +struct DCMTK_DCMQRDB_EXPORT TI_ImageEntry +{ + DIC_UI sopInstanceUID; + DIC_IS imageNumber; + int intImageNumber; +} ; + +struct DCMTK_DCMQRDB_EXPORT TI_SeriesEntry +{ + DIC_UI seriesInstanceUID; + DIC_IS seriesNumber; + int intSeriesNumber; + DIC_CS modality; + TI_ImageEntry *images[TI_MAXIMAGES]; /* array of image pointers */ + int imageCount; + + time_t lastQueryTime; /* time we last queried db */ +}; + +struct DCMTK_DCMQRDB_EXPORT TI_StudyEntry +{ + DIC_UI studyInstanceUID; + DIC_CS studyID; + DIC_PN patientName; + DIC_LO patientID; + TI_SeriesEntry *series[TI_MAXSERIES]; /* array of series pointers */ + int seriesCount; + time_t lastQueryTime; /* time we last queried db */ +}; + + +struct DCMTK_DCMQRDB_EXPORT TI_DBEntry +{ + const char *title; /* the CTN AE Title associated with this DB */ + + const char **peerTitles; /* peer titles which can read this database + * and thus we can comminicate with */ + int peerTitleCount; /* number of peer titles */ + + DcmQueryRetrieveDatabaseHandle *dbHandle; /* handle to current db */ + + TI_StudyEntry *studies[TI_MAXSTUDIES]; /* array of study pointers */ + int studyCount; + + int currentStudy; /* index of current study */ + int currentSeries; /* index of current series in current study */ + int currentImage; /* index of current image in current study */ + + time_t lastQueryTime; /* time we last queried db */ + + OFBool isRemoteDB; /* true if DB is remote */ +}; + +struct DCMTK_DCMQRDB_EXPORT TI_GenericCallbackStruct +{ + TI_DBEntry *db; + TI_StudyEntry *study; + TI_SeriesEntry *series; +}; + +typedef OFBool (*TI_GenericEntryCallbackFunction)(TI_GenericCallbackStruct *cbstruct, DcmDataset *reply); + +/** this class provides the functionality of the telnet initiator application + */ +class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveTelnetInitiator +{ +public: + + /** constructor + * @param cfg configuration facility + */ + DcmQueryRetrieveTelnetInitiator(DcmQueryRetrieveConfig &cfg); + + /** main entry point for console-based user interface + */ + void TI_userInput(); + + /** add remote peer to list of peers + * @param peerName name of peer + * @param configFileName name of configuration file from which peer was read + */ + OFBool addPeerName(const char *peerName, const char *configFileName); + + /** print TI configuration to stdout + */ + void printConfig(); + + /** detach current association + * @param abortFlag if true, abort association instead of releasing it + */ + OFBool TI_detachAssociation(OFBool abortFlag); + + /** set local aetitle + * @param ae aetitle + */ + void setAETitle(const char *ae) + { + myAETitle = ae; + } + + /** set max receive PDU + * @param pdu max receive PDU size + */ + void setMaxPDU(OFCmdUnsignedInt pdu) + { + maxReceivePDULength = pdu; + } + + /** activate first peer in list of peers + */ + void activateFirstPeer() + { + peerHostName = peerNames[0]; + } + + /** provide read/write access to network structure maintained by this object. + * Yes, this is ugly. + * @return pointer to pointer to network structure + */ + T_ASC_Network **accessNet() + { + return &net; + } + + /// return number of databases + int getdbCount() const + { + return dbCount; + } + + /** create configuration entries for remote databases + * @param configFileName name of configuration file + * @param remoteDBTitlesCount number of remote DB titles + * @param remoteDBTitles list of remote DB titles + */ + void createConfigEntries( + const char *configFileName, + int remoteDBTitlesCount, + const char **remoteDBTitles); + + /** set the network transfer syntax + * @param xfer new network transfer syntax + */ + void setXferSyntax(E_TransferSyntax xfer) { networkTransferSyntax = xfer; } + + /** set blocking mode and timeout for DIMSE operations + * @param blockMode blocking mode for DIMSE operations + * @param timeout timeout for DIMSE operations + */ + void setBlockMode(T_DIMSE_BlockingMode blockMode, int timeout) + { + blockMode_ = blockMode; + dimse_timeout_ = timeout; + } + +private: + + OFBool TI_attachAssociation(); + OFBool TI_changeAssociation(); + OFBool TI_sendEcho(); + OFBool TI_storeImage(char *sopClass, char *sopInstance, char * imgFile); + OFBool TI_remoteFindQuery( + TI_DBEntry *db, DcmDataset *query, + TI_GenericEntryCallbackFunction callbackFunction, + TI_GenericCallbackStruct *callbackData); + OFBool TI_title(int arg, const char * /*cmdbuf*/ ); + OFBool TI_attachDB(TI_DBEntry *db); + OFBool TI_database(int arg, const char * /*cmdbuf*/ ); + OFBool TI_echo(int arg, const char * /*cmdbuf*/ ); + OFBool TI_quit(int arg, const char * /*cmdbuf*/ ); + OFBool TI_actualizeStudies(); + OFBool TI_study(int arg, const char * /*cmdbuf*/ ); + OFBool TI_actualizeSeries(); + OFBool TI_series(int arg, const char * /*cmdbuf*/ ); + OFBool TI_actualizeImages(); + OFBool TI_image(int arg, const char * /*cmdbuf*/ ); + OFBool TI_buildStudies(TI_DBEntry *db); + OFBool TI_buildSeries(TI_DBEntry *db, TI_StudyEntry *study); + OFBool TI_buildRemoteImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series); + OFBool TI_buildImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series); + OFBool TI_sendStudy(int arg, const char * /*cmdbuf*/ ); + OFBool TI_sendSeries(int arg, const char * /*cmdbuf*/ ); + OFBool TI_sendImage(int arg, const char * /*cmdbuf*/ ); + OFBool TI_send(int /*arg*/, const char *cmdbuf); + OFBool TI_shortHelp(int /*arg*/ , const char * /*cmdbuf*/ ); + OFBool TI_help(int arg, const char * /*cmdbuf*/ ); + OFBool TI_buildRemoteStudies(TI_DBEntry *db); + OFBool TI_buildRemoteSeries(TI_DBEntry *db, TI_StudyEntry *study); + OFBool TI_dbReadable(const char *dbTitle); + time_t TI_dbModifyTime(const char *dbTitle); + OFCondition addPresentationContexts(T_ASC_Parameters *params); + void selectDestinationCharacterSet(OFString& destinationCharacterSet); + + OFBool findDBPeerTitles( + const char *configFileName, + TI_DBEntry *dbEntry, + const char *peer); + + /// the CTN databases we know + TI_DBEntry **dbEntries; + + /// number of entries in databases we know + int dbCount; + + /// current peer to talk to + const char *peerHostName; + + /// list of peer names + const char *peerNames[TI_MAXPEERS]; + + /// number of peer names in list + int peerNamesCount; + + /// my application entity title + const char *myAETitle; + + /// active network + T_ASC_Network *net; + + /// currently active association + T_ASC_Association *assoc; + + /// number of bytes per PDU we can receive + OFCmdUnsignedInt maxReceivePDULength; + + /// current database index + int currentdb; + + /// current peer title + const char *currentPeerTitle; + + /// configuration facility + DcmQueryRetrieveConfig& config; + + /// network transfer syntax + E_TransferSyntax networkTransferSyntax; + + /// blocking mode for DIMSE operations + T_DIMSE_BlockingMode blockMode_; + + /// timeout for DIMSE operations + int dimse_timeout_; + +}; + + +#endif diff --git a/dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h b/dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h new file mode 100644 index 00000000..c2a228b7 --- /dev/null +++ b/dcmqrdb/include/dcmtk/dcmqrdb/qrdefine.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef QRDEFINE_H +#define QRDEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmqrdb_EXPORTS +#define DCMTK_DCMQRDB_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMQRDB_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmqrdb/libsrc/CMakeLists.txt b/dcmqrdb/libsrc/CMakeLists.txt new file mode 100644 index 00000000..95ce4789 --- /dev/null +++ b/dcmqrdb/libsrc/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmqrdb dcmqrcbf dcmqrcbg dcmqrcbm dcmqrcbs dcmqrcnf dcmqrdbi dcmqrdbs dcmqropt dcmqrptb dcmqrsrv dcmqrtis) + +DCMTK_TARGET_LINK_MODULES(dcmqrdb ofstd dcmdata dcmnet) diff --git a/dcmqrdb/libsrc/Makefile.dep b/dcmqrdb/libsrc/Makefile.dep new file mode 100644 index 00000000..157ec139 --- /dev/null +++ b/dcmqrdb/libsrc/Makefile.dep @@ -0,0 +1,867 @@ +dcmqrcbf.o: dcmqrcbf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrcbf.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h ../include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h +dcmqrcbg.o: dcmqrcbg.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrcbg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h ../include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h +dcmqrcbm.o: dcmqrcbm.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrcbm.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcasccfg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccftsmp.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfuidh.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfpcmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfrsmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfenmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfprmp.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h ../include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h +dcmqrcbs.o: dcmqrcbs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrcbs.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h ../include/dcmtk/dcmqrdb/dcmqrdbi.h \ + ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h +dcmqrcnf.o: dcmqrcnf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h +dcmqrdbi.o: dcmqrdbi.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbi.h ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmqrdb/dcmqridx.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcspchrs.h \ + ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmatch.h +dcmqrdbs.o: dcmqrdbs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h +dcmqropt.o: dcmqropt.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h +dcmqrptb.o: dcmqrptb.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrptb.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../include/dcmtk/dcmqrdb/qrdefine.h ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h +dcmqrsrv.o: dcmqrsrv.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrsrv.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcasccfg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccftsmp.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfuidh.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfpcmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfrsmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfenmp.h \ + ../../dcmnet/include/dcmtk/dcmnet/dccfprmp.h \ + ../include/dcmtk/dcmqrdb/dcmqrptb.h ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h ../include/dcmtk/dcmqrdb/dcmqrcnf.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../include/dcmtk/dcmqrdb/dcmqrdba.h ../include/dcmtk/dcmqrdb/dcmqrcbf.h \ + ../include/dcmtk/dcmqrdb/dcmqrcbm.h ../include/dcmtk/dcmqrdb/dcmqrcbg.h \ + ../include/dcmtk/dcmqrdb/dcmqrcbs.h +dcmqrtis.o: dcmqrtis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmqrdb/dcmqrtis.h \ + ../../dcmnet/include/dcmtk/dcmnet/dicom.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmnet/include/dcmtk/dcmnet/cond.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmnet/include/dcmtk/dcmnet/assoc.h \ + ../../dcmnet/include/dcmtk/dcmnet/lst.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../dcmnet/include/dcmtk/dcmnet/dul.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmnet/include/dcmtk/dcmnet/extneg.h \ + ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \ + ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \ + ../../dcmnet/include/dcmtk/dcmnet/dimse.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmqrdb/dcmqrcnf.h ../include/dcmtk/dcmqrdb/qrdefine.h \ + ../../dcmnet/include/dcmtk/dcmnet/diutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbi.h ../include/dcmtk/dcmqrdb/dcmqrdba.h \ + ../../ofstd/include/dcmtk/ofstd/offname.h \ + ../include/dcmtk/dcmqrdb/dcmqrdbs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmqrdb/dcmqropt.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h diff --git a/dcmqrdb/libsrc/Makefile.in b/dcmqrdb/libsrc/Makefile.in new file mode 100644 index 00000000..00dddfad --- /dev/null +++ b/dcmqrdb/libsrc/Makefile.in @@ -0,0 +1,52 @@ +# +# Makefile for dcmqrdb/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmnetdir = $(top_srcdir)/../dcmnet + +LOCALINCLUDES = -I$(dcmnetdir)/include -I$(dcmdatadir)/include \ + -I$(ofstddir)/include -I$(oflogdir)/include +LOCALDEFS = + +objs = dcmqrcbf.o dcmqrcbg.o dcmqrcbm.o dcmqrcbs.o dcmqrcnf.o dcmqrdbi.o \ + dcmqrdbs.o dcmqropt.o dcmqrptb.o dcmqrsrv.o dcmqrtis.o +library = libdcmqrdb.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmqrdb/libsrc/dcmqrcbf.cc b/dcmqrdb/libsrc/dcmqrcbf.cc new file mode 100644 index 00000000..091e3d85 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrcbf.cc @@ -0,0 +1,90 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveFindContext + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrcbf.h" + +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" + + +void DcmQueryRetrieveFindContext::callbackHandler( + /* in */ + OFBool cancelled, T_DIMSE_C_FindRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_FindRSP *response, + DcmDataset **responseIdentifiers, + DcmDataset **stDetail) +{ + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(priorStatus); + + if (responseCount == 1) { + /* start the database search */ + DCMQRDB_INFO("Find SCP Request Identifiers:" << OFendl << DcmObject::PrintHelper(*requestIdentifiers)); + dbcond = dbHandle.startFindRequest( + request->AffectedSOPClassUID, requestIdentifiers, &dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("findSCP: Database: startFindRequest Failed (" + << DU_cfindStatusString(dbStatus.status()) << "):"); + } + } + + /* only cancel if we have pending responses */ + if (cancelled && DICOM_PENDING_STATUS(dbStatus.status())) { + dbHandle.cancelFindRequest(&dbStatus); + } + + if (DICOM_PENDING_STATUS(dbStatus.status())) { + dbcond = dbHandle.nextFindResponse(responseIdentifiers, &dbStatus, characterSetOptions); + if (dbcond.bad()) { + DCMQRDB_ERROR("findSCP: Database: nextFindResponse Failed (" + << DU_cfindStatusString(dbStatus.status()) << "):"); + } + } + + if (*responseIdentifiers != NULL) + { + + if (! DU_putStringDOElement(*responseIdentifiers, DCM_RetrieveAETitle, ourAETitle.c_str())) { + DCMQRDB_ERROR("DO: adding Retrieve AE Title"); + } + } + + /* set response status */ + response->DimseStatus = dbStatus.status(); + *stDetail = dbStatus.extractStatusDetail(); + + OFString str; + DCMQRDB_INFO("Find SCP Response " << responseCount << " [status: " + << DU_cfindStatusString(dbStatus.status()) << "]"); + DCMQRDB_DEBUG(DIMSE_dumpMessage(str, *response, DIMSE_OUTGOING)); + if (DICOM_PENDING_STATUS(dbStatus.status()) && (*responseIdentifiers != NULL)) + DCMQRDB_DEBUG("Find SCP Response Identifiers:" << OFendl << DcmObject::PrintHelper(**responseIdentifiers)); + if (*stDetail) + DCMQRDB_DEBUG(" Status detail:" << OFendl << DcmObject::PrintHelper(**stDetail)); +} diff --git a/dcmqrdb/libsrc/dcmqrcbg.cc b/dcmqrdb/libsrc/dcmqrcbg.cc new file mode 100644 index 00000000..ab1c61b9 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrcbg.cc @@ -0,0 +1,332 @@ +/* + * + * Copyright (C) 1993-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveGetContext + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrcbg.h" + +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmnet/dimse.h" /* for DICOM_WARNING_STATUS */ +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" +#include "dcmtk/ofstd/ofstd.h" + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* needed on Solaris for O_RDONLY */ +#endif +END_EXTERN_C + +static void getSubOpProgressCallback(void * /* callbackData */, + T_DIMSE_StoreProgress *progress, + T_DIMSE_C_StoreRQ * /*req*/) +{ + //DcmQueryRetrieveGetContext *context = OFstatic_cast(DcmQueryRetrieveGetContext *, callbackData); + // We can't use oflog for the pdu output, but we use a special logger for + // generating this output. If it is set to level "INFO" we generate the + // output, if it's set to "DEBUG" then we'll assume that there is debug output + // generated for each PDU elsewhere. + OFLogger progressLogger = OFLog::getLogger("dcmtk.dcmqrdb.progress"); + if (progressLogger.getChainedLogLevel() == OFLogger::INFO_LOG_LEVEL) + { + switch (progress->state) + { + case DIMSE_StoreBegin: + printf("XMIT: "); + break; + case DIMSE_StoreEnd: + printf("\n"); + break; + default: + putchar('.'); + break; + } + fflush(stdout); + } +} + +void DcmQueryRetrieveGetContext::callbackHandler( + /* in */ + OFBool cancelled, T_DIMSE_C_GetRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_GetRSP *response, DcmDataset **stDetail, + DcmDataset **responseIdentifiers) +{ + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(priorStatus); + + if (responseCount == 1) { + /* start the database search */ + DCMQRDB_INFO("Get SCP Request Identifiers:" << OFendl << DcmObject::PrintHelper(*requestIdentifiers)); + dbcond = dbHandle.startMoveRequest( + request->AffectedSOPClassUID, requestIdentifiers, &dbStatus); + if (dbcond.bad()) { + OFString temp_str; + DCMQRDB_ERROR("getSCP: Database: startMoveRequest Failed (" + << DU_cmoveStatusString(dbStatus.status()) << "): " + << DimseCondition::dump(temp_str, dbcond)); + } + } + + /* only cancel if we have pending status */ + if (cancelled && dbStatus.status() == STATUS_Pending) { + dbHandle.cancelMoveRequest(&dbStatus); + } + + if (dbStatus.status() == STATUS_Pending) { + getNextImage(&dbStatus); + } + + if (dbStatus.status() != STATUS_Pending) { + + /* + * Need to adjust the final status if any sub-operations failed or + * had warnings + */ + if (nFailed > 0 || nWarning > 0) { + dbStatus.setStatus(STATUS_GET_Warning_SubOperationsCompleteOneOrMoreFailures); + } + /* + * if all the sub-operations failed then we need to generate a failed or refused status. + * cf. DICOM part 4, C.4.3.3.1 + * we choose to generate a "Refused - Out of Resources - Unable to perform suboperations" status. + */ + if ((nFailed > 0) && ((nCompleted + nWarning) == 0)) { + dbStatus.setStatus(STATUS_GET_Refused_OutOfResourcesSubOperations); + } + } + + DCMQRDB_INFO("Get SCP Response " << responseCount << " [status: " + << DU_cmoveStatusString(dbStatus.status()) << "]"); + + if (dbStatus.status() != STATUS_Success && + dbStatus.status() != STATUS_Pending) { + /* + * May only include response identifiers if not Success + * and not Pending + */ + buildFailedInstanceList(responseIdentifiers); + } + + /* set response status */ + response->DimseStatus = dbStatus.status(); + response->NumberOfRemainingSubOperations = nRemaining; + response->NumberOfCompletedSubOperations = nCompleted; + response->NumberOfFailedSubOperations = nFailed; + response->NumberOfWarningSubOperations = nWarning; + *stDetail = dbStatus.extractStatusDetail(); + +} + +void DcmQueryRetrieveGetContext::addFailedUIDInstance(const char *sopInstance) +{ + size_t len; + size_t buflen = DIC_UI_LEN+1; + if (failedUIDs == NULL) { + if ((failedUIDs = (char*)malloc(buflen)) == NULL) { + DCMQRDB_ERROR("malloc failure: addFailedUIDInstance"); + return; + } + OFStandard::strlcpy(failedUIDs, sopInstance, buflen); + } else { + len = strlen(failedUIDs); + buflen = len+strlen(sopInstance)+2; + if ((failedUIDs = (char*)realloc(failedUIDs, buflen)) == NULL) { + DCMQRDB_ERROR("realloc failure: addFailedUIDInstance"); + return; + } + /* tag sopInstance onto end of old with '\' between */ + OFStandard::strlcat(failedUIDs, "\\", buflen); + OFStandard::strlcat(failedUIDs, sopInstance, buflen); + } +} + +OFCondition DcmQueryRetrieveGetContext::performGetSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname) +{ + OFCondition cond = EC_Normal; + T_DIMSE_C_StoreRQ req; + T_DIMSE_C_StoreRSP rsp; + DIC_US msgId; + T_ASC_PresentationContextID presId; + DcmDataset *stDetail = NULL; + +#ifdef LOCK_IMAGE_FILES + /* shared lock image file */ + int lockfd; +#ifdef O_BINARY + lockfd = open(fname, O_RDONLY | O_BINARY, 0666); +#else + lockfd = open(fname, O_RDONLY , 0666); +#endif + if (lockfd < 0) { + /* due to quota system the file could have been deleted */ + DCMQRDB_ERROR("Get SCP: storeSCU: [file: " << fname << "]: " << OFStandard::getLastSystemErrorCode().message()); + nFailed++; + addFailedUIDInstance(sopInstance); + return EC_Normal; + } + dcmtk_flock(lockfd, LOCK_SH); +#endif + + msgId = origAssoc->nextMsgID++; + + /* which presentation context should be used */ + presId = ASC_findAcceptedPresentationContextID(origAssoc, + sopClass); + if (presId == 0) { + nFailed++; + addFailedUIDInstance(sopInstance); + DCMQRDB_ERROR("Get SCP: storeSCU: [file: " << fname << "] No presentation context for: (" + << dcmSOPClassUIDToModality(sopClass, "OT") << ") " << sopClass); + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } else { + /* make sure that we can send images in this presentation context */ + T_ASC_PresentationContext pc; + ASC_findAcceptedPresentationContext(origAssoc->params, presId, &pc); + /* the acceptedRole is the association requestor role */ + if ((pc.acceptedRole != ASC_SC_ROLE_SCP) && (pc.acceptedRole != ASC_SC_ROLE_SCUSCP)) { + /* the role is not appropriate */ + nFailed++; + addFailedUIDInstance(sopInstance); + DCMQRDB_ERROR("Get SCP: storeSCU: [file: " << fname << "] No presentation context with requestor SCP role for: (" + << dcmSOPClassUIDToModality(sopClass, "OT") << ") " << sopClass); + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + } + + req.MessageID = msgId; + OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, DIC_UI_LEN + 1); + OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, DIC_UI_LEN + 1); + req.DataSetType = DIMSE_DATASET_PRESENT; + req.Priority = priority; + req.opts = 0; + + DCMQRDB_INFO("Store SCU RQ: MsgID " << msgId << ", (" + << dcmSOPClassUIDToModality(sopClass, "OT") << ")"); + + T_DIMSE_DetectedCancelParameters cancelParameters; + + cond = DIMSE_storeUser(origAssoc, presId, &req, + fname, NULL, getSubOpProgressCallback, this, options_.blockMode_, options_.dimse_timeout_, + &rsp, &stDetail, &cancelParameters); + +#ifdef LOCK_IMAGE_FILES + /* unlock image file */ + dcmtk_flock(lockfd, LOCK_UN); + close(lockfd); +#endif + + if (cond.good()) { + if (cancelParameters.cancelEncountered) { + if (origPresId == cancelParameters.presId && + origMsgId == cancelParameters.req.MessageIDBeingRespondedTo) { + getCancelled = OFTrue; + } else { + DCMQRDB_ERROR("Get SCP: Unexpected C-Cancel-RQ encountered: pid=" << (int)cancelParameters.presId + << ", mid=" << (int)cancelParameters.req.MessageIDBeingRespondedTo); + } + } + DCMQRDB_INFO("Get SCP: Received Store SCU RSP [Status=" + << DU_cstoreStatusString(rsp.DimseStatus) << "]"); + if (rsp.DimseStatus == STATUS_Success) { + /* everything ok */ + nCompleted++; + } else if (DICOM_WARNING_STATUS(rsp.DimseStatus)) { + /* a warning status message */ + nWarning++; + DCMQRDB_ERROR("Get SCP: Store Warning: Response Status: " << + DU_cstoreStatusString(rsp.DimseStatus)); + } else { + nFailed++; + addFailedUIDInstance(sopInstance); + /* print a status message */ + DCMQRDB_ERROR("Get SCP: Store Failed: Response Status: " + << DU_cstoreStatusString(rsp.DimseStatus)); + } + } else { + nFailed++; + addFailedUIDInstance(sopInstance); + OFString temp_str; + DCMQRDB_ERROR("Get SCP: storeSCU: Store Request Failed: " << DimseCondition::dump(temp_str, cond)); + } + if (stDetail) { + DCMQRDB_INFO(" Status Detail:" << OFendl << DcmObject::PrintHelper(*stDetail)); + delete stDetail; + } + return cond; +} + +void DcmQueryRetrieveGetContext::getNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus) +{ + OFCondition cond = EC_Normal; + OFCondition dbcond = EC_Normal; + DIC_UI subImgSOPClass; /* sub-operation image SOP Class */ + DIC_UI subImgSOPInstance; /* sub-operation image SOP Instance */ + char subImgFileName[MAXPATHLEN + 1]; /* sub-operation image file */ + + /* clear out strings */ + bzero(subImgFileName, sizeof(subImgFileName)); + bzero(subImgSOPClass, sizeof(subImgSOPClass)); + bzero(subImgSOPInstance, sizeof(subImgSOPInstance)); + + /* get DB response */ + dbcond = dbHandle.nextMoveResponse( + subImgSOPClass, sizeof(subImgSOPClass), subImgSOPInstance, sizeof(subImgSOPInstance), subImgFileName, sizeof(subImgFileName), &nRemaining, dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("getSCP: Database: nextMoveResponse Failed (" + << DU_cmoveStatusString(dbStatus->status()) << "):"); + } + + if (dbStatus->status() == STATUS_Pending) { + /* perform sub-op */ + cond = performGetSubOp(subImgSOPClass, subImgSOPInstance, subImgFileName); + + if (getCancelled) { + dbStatus->setStatus(STATUS_GET_Cancel_SubOperationsTerminatedDueToCancelIndication); + DCMQRDB_INFO("Get SCP: Received C-Cancel RQ"); + } + + if (cond != EC_Normal) { + OFString temp_str; + DCMQRDB_ERROR("getSCP: Get Sub-Op Failed: " << DimseCondition::dump(temp_str, cond)); + /* clear condition stack */ + } + } +} + +void DcmQueryRetrieveGetContext::buildFailedInstanceList(DcmDataset ** rspIds) +{ + OFBool ok; + + if (failedUIDs != NULL) { + *rspIds = new DcmDataset(); + ok = DU_putStringDOElement(*rspIds, DCM_FailedSOPInstanceUIDList, failedUIDs); + if (!ok) { + DCMQRDB_ERROR("getSCP: failed to build DCM_FailedSOPInstanceUIDList"); + } + free(failedUIDs); + failedUIDs = NULL; + } +} diff --git a/dcmqrdb/libsrc/dcmqrcbm.cc b/dcmqrdb/libsrc/dcmqrcbm.cc new file mode 100644 index 00000000..d3e07295 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrcbm.cc @@ -0,0 +1,706 @@ +/* + * + * Copyright (C) 1993-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveMoveContext + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmqrdb/dcmqrcbm.h" + +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmnet/dimse.h" /* for DICOM_WARNING_STATUS */ +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" +#include "dcmtk/ofstd/ofstd.h" + +BEGIN_EXTERN_C +#ifdef HAVE_FCNTL_H +#include /* needed on Solaris for O_RDONLY */ +#endif +END_EXTERN_C + + +static void moveSubOpProgressCallback(void * /* callbackData */, + T_DIMSE_StoreProgress *progress, + T_DIMSE_C_StoreRQ * /*req*/) +{ + //DcmQueryRetrieveMoveContext *context = OFstatic_cast(DcmQueryRetrieveMoveContext *, callbackData); + // We can't use oflog for the pdu output, but we use a special logger for + // generating this output. If it is set to level "INFO" we generate the + // output, if it's set to "DEBUG" then we'll assume that there is debug output + // generated for each PDU elsewhere. + OFLogger progressLogger = OFLog::getLogger("dcmtk.dcmqrdb.progress"); + if (progressLogger.getChainedLogLevel() == OFLogger::INFO_LOG_LEVEL) + { + switch (progress->state) + { + case DIMSE_StoreBegin: + printf("XMIT: "); + break; + case DIMSE_StoreEnd: + printf("\n"); + break; + default: + putchar('.'); + break; + } + fflush(stdout); + } +} + +void DcmQueryRetrieveMoveContext::callbackHandler( + /* in */ + OFBool cancelled, T_DIMSE_C_MoveRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_MoveRSP *response, DcmDataset **stDetail, + DcmDataset **responseIdentifiers) +{ + OFCondition cond = EC_Normal; + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(priorStatus); + + if (responseCount == 1) { + /* start the database search */ + DCMQRDB_INFO("Move SCP Request Identifiers:" << OFendl << DcmObject::PrintHelper(*requestIdentifiers)); + dbcond = dbHandle.startMoveRequest( + request->AffectedSOPClassUID, requestIdentifiers, &dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("moveSCP: Database: startMoveRequest Failed (" + << DU_cmoveStatusString(dbStatus.status()) << "):"); + } + + if (dbStatus.status() == STATUS_Pending) { + /* If we are going to be performing sub-operations, build + * a new association to the move destination. + */ + cond = buildSubAssociation(request); + if (cond == QR_EC_InvalidPeer) { + dbStatus.setStatus(STATUS_MOVE_Failed_MoveDestinationUnknown); + } else if (cond.bad()) { + /* failed to build association, must fail move */ + failAllSubOperations(&dbStatus); + } + } + } + + /* only cancel if we have pending status */ + if (cancelled && dbStatus.status() == STATUS_Pending) { + dbHandle.cancelMoveRequest(&dbStatus); + } + + if (dbStatus.status() == STATUS_Pending) { + moveNextImage(&dbStatus); + } + + if (dbStatus.status() != STATUS_Pending) { + /* + * Tear down sub-association (if it exists). + */ + closeSubAssociation(); + + /* + * Need to adjust the final status if any sub-operations failed or + * had warnings + */ + if (nFailed > 0 || nWarning > 0) { + dbStatus.setStatus(STATUS_MOVE_Warning_SubOperationsCompleteOneOrMoreFailures); + } + /* + * if all the sub-operations failed then we need to generate a failed or refused status. + * cf. DICOM part 4, C.4.2.3.1 + * we choose to generate a "Refused - Out of Resources - Unable to perform suboperations" status. + */ + if ((nFailed > 0) && ((nCompleted + nWarning) == 0)) { + dbStatus.setStatus(STATUS_MOVE_Refused_OutOfResourcesSubOperations); + } + } + + if (dbStatus.status() != STATUS_Success && + dbStatus.status() != STATUS_Pending) { + /* + * May only include response identifiers if not Success + * and not Pending + */ + buildFailedInstanceList(responseIdentifiers); + } + + /* set response status */ + response->DimseStatus = dbStatus.status(); + response->NumberOfRemainingSubOperations = nRemaining; + response->NumberOfCompletedSubOperations = nCompleted; + response->NumberOfFailedSubOperations = nFailed; + response->NumberOfWarningSubOperations = nWarning; + *stDetail = dbStatus.extractStatusDetail(); + + OFString str; + DCMQRDB_INFO("Move SCP Response " << responseCount << " [status: " + << DU_cmoveStatusString(dbStatus.status()) << "]"); + DCMQRDB_DEBUG(DIMSE_dumpMessage(str, *response, DIMSE_OUTGOING)); + if (DICOM_PENDING_STATUS(dbStatus.status()) && (*responseIdentifiers != NULL)) { + DCMQRDB_DEBUG("Move SCP Response Identifiers:" << OFendl << DcmObject::PrintHelper(**responseIdentifiers)); + } + if (*stDetail) { + DCMQRDB_DEBUG(" Status detail:" << OFendl << DcmObject::PrintHelper(**stDetail)); + } +} + +void DcmQueryRetrieveMoveContext::addFailedUIDInstance(const char *sopInstance) +{ + size_t len; + size_t buflen = DIC_UI_LEN+1; + if (failedUIDs == NULL) { + if ((failedUIDs = (char*)malloc(buflen)) == NULL) { + DCMQRDB_ERROR("malloc failure: addFailedUIDInstance"); + return; + } + OFStandard::strlcpy(failedUIDs, sopInstance, buflen); + } else { + len = strlen(failedUIDs); + buflen = len+strlen(sopInstance)+2; + if ((failedUIDs = (char*)realloc(failedUIDs, buflen)) == NULL) { + DCMQRDB_ERROR("realloc failure: addFailedUIDInstance"); + return; + } + /* tag sopInstance onto end of old with '\' between */ + OFStandard::strlcat(failedUIDs, "\\", buflen); + OFStandard::strlcat(failedUIDs, sopInstance, buflen); + } +} + +OFCondition DcmQueryRetrieveMoveContext::performMoveSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname) +{ + OFCondition cond = EC_Normal; + T_DIMSE_C_StoreRQ req; + T_DIMSE_C_StoreRSP rsp; + DIC_US msgId; + T_ASC_PresentationContextID presId; + DcmDataset *stDetail = NULL; + +#ifdef LOCK_IMAGE_FILES + /* shared lock image file */ + int lockfd; +#ifdef O_BINARY + lockfd = open(fname, O_RDONLY | O_BINARY, 0666); +#else + lockfd = open(fname, O_RDONLY , 0666); +#endif + if (lockfd < 0) { + /* due to quota system the file could have been deleted */ + DCMQRDB_ERROR("Move SCP: storeSCU: [file: " << fname << "]: " + << OFStandard::getLastSystemErrorCode().message()); + nFailed++; + addFailedUIDInstance(sopInstance); + return EC_Normal; + } + dcmtk_flock(lockfd, LOCK_SH); +#endif + + msgId = subAssoc->nextMsgID++; + + /* which presentation context should be used */ + presId = ASC_findAcceptedPresentationContextID(subAssoc, + sopClass); + if (presId == 0) { + nFailed++; + addFailedUIDInstance(sopInstance); + DCMQRDB_ERROR("Move SCP: storeSCU: [file: " << fname << "] No presentation context for: (" + << dcmSOPClassUIDToModality(sopClass, "OT") << ") " << sopClass); + return DIMSE_NOVALIDPRESENTATIONCONTEXTID; + } + + req.MessageID = msgId; + OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, DIC_UI_LEN + 1); // see declaration of DIC_UI in dcmtk/dcmnet/dicom.h + OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, DIC_UI_LEN + 1); + req.DataSetType = DIMSE_DATASET_PRESENT; + req.Priority = priority; + req.opts = (O_STORE_MOVEORIGINATORAETITLE | O_STORE_MOVEORIGINATORID); + OFStandard::strlcpy(req.MoveOriginatorApplicationEntityTitle, origAETitle, DIC_AE_LEN + 1); + req.MoveOriginatorID = origMsgId; + + DCMQRDB_INFO("Store SCU RQ: MsgID " << msgId << ", (" + << dcmSOPClassUIDToModality(sopClass, "OT") << ")"); + + cond = DIMSE_storeUser(subAssoc, presId, &req, + fname, NULL, moveSubOpProgressCallback, this, + options_.blockMode_, options_.dimse_timeout_, + &rsp, &stDetail); + +#ifdef LOCK_IMAGE_FILES + /* unlock image file */ + dcmtk_flock(lockfd, LOCK_UN); + close(lockfd); +#endif + + if (cond.good()) { + DCMQRDB_INFO("Move SCP: Received Store SCU RSP [Status=" + << DU_cstoreStatusString(rsp.DimseStatus) << "]"); + if (rsp.DimseStatus == STATUS_Success) { + /* everything ok */ + nCompleted++; + } else if (DICOM_WARNING_STATUS(rsp.DimseStatus)) { + /* a warning status message */ + nWarning++; + DCMQRDB_ERROR("Move SCP: Store Warning: Response Status: " << + DU_cstoreStatusString(rsp.DimseStatus)); + } else { + nFailed++; + addFailedUIDInstance(sopInstance); + /* print a status message */ + DCMQRDB_ERROR("Move SCP: Store Failed: Response Status: " << + DU_cstoreStatusString(rsp.DimseStatus)); + } + } else { + nFailed++; + addFailedUIDInstance(sopInstance); + OFString temp_str; + DCMQRDB_ERROR("Move SCP: storeSCU: Store Request Failed: " << DimseCondition::dump(temp_str, cond)); + } + if (stDetail != NULL) { + DCMQRDB_INFO(" Status Detail:" << OFendl << DcmObject::PrintHelper(*stDetail)); + delete stDetail; + } + return cond; +} + +OFCondition DcmQueryRetrieveMoveContext::buildSubAssociation(T_DIMSE_C_MoveRQ *request) +{ + OFCondition cond = EC_Normal; + DIC_NODENAME dstHostName; + DIC_NODENAME dstHostNamePlusPort; + int dstPortNumber; + T_ASC_Parameters *params; + OFString temp_str; + + OFStandard::strlcpy(dstAETitle, request->MoveDestination, DIC_AE_LEN + 1); + + /* + * We must map the destination AE Title into a host name and port + * address. Further, we must make sure that the RSNA'93 demonstration + * rules are observed regarding move destinations. + */ + + DIC_AE aeTitle; + aeTitle[0] = '\0'; + ASC_getAPTitles(origAssoc->params, origAETitle, sizeof(origAETitle), aeTitle, sizeof(aeTitle), NULL, 0); + ourAETitle = aeTitle; + + ASC_getPresentationAddresses(origAssoc->params, origHostName, sizeof(origHostName), NULL, 0); + + if (!mapMoveDestination(origHostName, origAETitle, + request->MoveDestination, dstHostName, DIC_NODENAME_LEN + 1, &dstPortNumber)) { + return QR_EC_InvalidPeer; + } + if (cond.good()) { + cond = ASC_createAssociationParameters(¶ms, ASC_DEFAULTMAXPDU); + if (cond.bad()) { + DCMQRDB_ERROR("moveSCP: Cannot create Association-params for sub-ops: " << DimseCondition::dump(temp_str, cond)); + } + } + if (cond.good()) { + OFStandard::snprintf(dstHostNamePlusPort, sizeof(DIC_NODENAME), "%s:%d", dstHostName, dstPortNumber); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), + dstHostNamePlusPort); + ASC_setAPTitles(params, ourAETitle.c_str(), dstAETitle,NULL); + + if (options_.outgoingProfile.empty()) { + cond = addAllStoragePresentationContexts(params); + } else { + cond = associationConfiguration_.setAssociationParameters(options_.outgoingProfile.c_str(), *params); + } + if (cond.bad()) { + DCMQRDB_ERROR(DimseCondition::dump(temp_str, cond)); + } + DCMQRDB_DEBUG("Request Parameters:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_RQ)); + } + if (cond.good()) { + /* create association */ + DCMQRDB_INFO("Requesting Sub-Association"); + cond = ASC_requestAssociation(options_.net_, params, &subAssoc); + if (cond.bad()) { + if (cond == DUL_ASSOCIATIONREJECTED) { + T_ASC_RejectParameters rej; + + ASC_getRejectParameters(params, &rej); + DCMQRDB_ERROR("moveSCP: Sub-Association Rejected" << OFendl << ASC_printRejectParameters(temp_str, &rej)); + } else { + DCMQRDB_ERROR("moveSCP: Sub-Association Request Failed: " << DimseCondition::dump(temp_str, cond)); + } + } + } + + if (cond.good()) { + assocStarted = OFTrue; + } + return cond; +} + +OFCondition DcmQueryRetrieveMoveContext::closeSubAssociation() +{ + OFCondition cond = EC_Normal; + + if (subAssoc != NULL) { + /* release association */ + OFString temp_str; + DCMQRDB_INFO("Releasing Sub-Association"); + cond = ASC_releaseAssociation(subAssoc); + if (cond.bad()) { + DCMQRDB_ERROR("moveSCP: Sub-Association Release Failed: " << DimseCondition::dump(temp_str, cond)); + } + cond = ASC_dropAssociation(subAssoc); + if (cond.bad()) { + DCMQRDB_ERROR("moveSCP: Sub-Association Drop Failed: " << DimseCondition::dump(temp_str, cond)); + } + cond = ASC_destroyAssociation(&subAssoc); + if (cond.bad()) { + DCMQRDB_ERROR("moveSCP: Sub-Association Destroy Failed: " << DimseCondition::dump(temp_str, cond)); + } + } + + if (assocStarted) { + assocStarted = OFFalse; + } + + return cond; +} + +void DcmQueryRetrieveMoveContext::moveNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus) +{ + OFCondition cond = EC_Normal; + OFCondition dbcond = EC_Normal; + DIC_UI subImgSOPClass; /* sub-operation image SOP Class */ + DIC_UI subImgSOPInstance; /* sub-operation image SOP Instance */ + char subImgFileName[MAXPATHLEN + 1]; /* sub-operation image file */ + + /* clear out strings */ + bzero(subImgFileName, sizeof(subImgFileName)); + bzero(subImgSOPClass, sizeof(subImgSOPClass)); + bzero(subImgSOPInstance, sizeof(subImgSOPInstance)); + + /* get DB response */ + dbcond = dbHandle.nextMoveResponse( + subImgSOPClass, sizeof(subImgSOPClass), subImgSOPInstance, sizeof(subImgSOPInstance), subImgFileName, sizeof(subImgFileName), &nRemaining, dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("moveSCP: Database: nextMoveResponse Failed (" + << DU_cmoveStatusString(dbStatus->status()) << "):"); + } + + if (dbStatus->status() == STATUS_Pending) { + /* perform sub-op */ + cond = performMoveSubOp(subImgSOPClass, subImgSOPInstance, subImgFileName); + if (cond != EC_Normal) { + OFString temp_str; + DCMQRDB_ERROR("moveSCP: Move Sub-Op Failed: " << DimseCondition::dump(temp_str, cond)); + /* clear condition stack */ + } + } +} + +void DcmQueryRetrieveMoveContext::failAllSubOperations(DcmQueryRetrieveDatabaseStatus * dbStatus) +{ + OFCondition dbcond = EC_Normal; + DIC_UI subImgSOPClass; /* sub-operation image SOP Class */ + DIC_UI subImgSOPInstance; /* sub-operation image SOP Instance */ + char subImgFileName[MAXPATHLEN + 1]; /* sub-operation image file */ + + /* clear out strings */ + bzero(subImgFileName, sizeof(subImgFileName)); + bzero(subImgSOPClass, sizeof(subImgSOPClass)); + bzero(subImgSOPInstance, sizeof(subImgSOPInstance)); + + while (dbStatus->status() == STATUS_Pending) { + /* get DB response */ + dbcond = dbHandle.nextMoveResponse( + subImgSOPClass, sizeof(subImgSOPClass), subImgSOPInstance, sizeof(subImgSOPInstance), subImgFileName, sizeof(subImgFileName), &nRemaining, dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("moveSCP: Database: nextMoveResponse Failed (" + << DU_cmoveStatusString(dbStatus->status()) << "):"); + } + + if (dbStatus->status() == STATUS_Pending) { + nFailed++; + addFailedUIDInstance(subImgSOPInstance); + } + } + dbStatus->setStatus(STATUS_MOVE_Warning_SubOperationsCompleteOneOrMoreFailures); +} + +void DcmQueryRetrieveMoveContext::buildFailedInstanceList(DcmDataset ** rspIds) +{ + OFBool ok; + + if (failedUIDs != NULL) { + *rspIds = new DcmDataset(); + ok = DU_putStringDOElement(*rspIds, DCM_FailedSOPInstanceUIDList, failedUIDs); + if (!ok) { + DCMQRDB_ERROR("moveSCP: failed to build DCM_FailedSOPInstanceUIDList"); + } + free(failedUIDs); + failedUIDs = NULL; + } +} + +OFBool DcmQueryRetrieveMoveContext::mapMoveDestination( + const char *origPeer, const char *origAE, + const char *dstAE, char *dstPeer, size_t dstPeerLen, int *dstPort) +{ + /* + * This routine enforces RSNA'93 Demo Requirements regarding + * the destination of move commands. + * + */ + OFBool ok = OFFalse; + const char *dstPeerName; /* the CNF utility returns us a static char* */ + + if (options_.restrictMoveToSameAE_) { + /* AE Titles the same ? */ + ok = (strcmp(origAE, dstAE) == 0); + if (!ok) { + DCMQRDB_INFO("mapMoveDestination: strictMove Reqs: '" << origAE << "' != '" << dstAE << "'"); + return OFFalse; + } + } + + ok = config->peerForAETitle((char*)dstAE, &dstPeerName, dstPort) > 0; + if (!ok) { + DCMQRDB_INFO("mapMoveDestination: unknown AE: '" << dstAE << "'"); + return OFFalse; /* dstAE not known */ + } + + OFStandard::strlcpy(dstPeer, dstPeerName, dstPeerLen); + + if (options_.restrictMoveToSameHost_) { + /* hosts the same ? */ + ok = (strcmp(origPeer, dstPeer) == 0); + if (!ok) { + DCMQRDB_INFO("mapMoveDestination: different hosts: '" << origPeer << "', '" << dstPeer << "'"); + return OFFalse; + } + } + + if (options_.restrictMoveToSameVendor_) { + /* AE titles belong to the same vendor */ + ok = config->checkForSameVendor((char*)origAE, (char*)dstAE) > 0; + if (!ok) { + DCMQRDB_INFO("mapMoveDestination: different vendors: '" << origAE << "', '" << dstAE << "'"); + return OFFalse; + } + } + + return ok; +} + +OFCondition DcmQueryRetrieveMoveContext::addAllStoragePresentationContexts(T_ASC_Parameters *params) +{ + // this would be the place to add support for compressed transfer syntaxes + OFCondition cond = EC_Normal; + + int i; + int pid = 1; + + const char* transferSyntaxes[] = { NULL, NULL, NULL, NULL }; + int numTransferSyntaxes = 0; + +#ifdef DISABLE_COMPRESSION_EXTENSION + /* gLocalByteOrder is defined in dcxfer.h */ + if (gLocalByteOrder == EBO_LittleEndian) { + /* we are on a little endian machine */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + } else { + /* we are on a big endian machine */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + } +#else + switch (options_.networkTransferSyntaxOut_) + { + case EXS_LittleEndianImplicit: + /* we only propose Little Endian Implicit */ + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_LittleEndianExplicit: + /* we prefer Little Endian Explicit */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_BigEndianExplicit: + /* we prefer Big Endian Explicit */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_JPEGProcess14SV1: + /* we prefer JPEGLossless:Hierarchical-1stOrderPrediction (default lossless) */ + transferSyntaxes[0] = UID_JPEGProcess14SV1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess1: + /* we prefer JPEGBaseline (default lossy for 8 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess2_4: + /* we prefer JPEGExtended (default lossy for 12 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess2_4TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000LosslessOnly: + /* we prefer JPEG 2000 lossless */ + transferSyntaxes[0] = UID_JPEG2000LosslessOnlyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000: + /* we prefer JPEG 2000 lossy or lossless */ + transferSyntaxes[0] = UID_JPEG2000TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossless: + /* we prefer JPEG-LS Lossless */ + transferSyntaxes[0] = UID_JPEGLSLosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossy: + /* we prefer JPEG-LS Lossy */ + transferSyntaxes[0] = UID_JPEGLSLossyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG2MainProfileAtMainLevel: + /* we only propose MPEG2 MP@ML since we don't want to decompress */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_MPEG2MainProfileAtHighLevel: + /* we only propose MPEG2 MP@HL since we don't want to decompress */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtHighLevelTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_MPEG4HighProfileLevel4_1: + /* we only propose MPEG4 HP/L4.1 since we don't want to decompress */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_1TransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_MPEG4BDcompatibleHighProfileLevel4_1: + /* we only propose MPEG4 BD HP/L4.1 since we don't want to decompress */ + transferSyntaxes[0] = UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_MPEG4HighProfileLevel4_2_For2DVideo: + /* we only propose MPEG4 HP/L4.2 for 2D Videos since we don't want to decompress */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_MPEG4HighProfileLevel4_2_For3DVideo: + /* we only propose MPEG4 HP/L4.2 for 3D Videos since we don't want to decompress */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_MPEG4StereoHighProfileLevel4_2: + /* we only propose MPEG4 Stereo HP/L4.2 since we don't want to decompress */ + transferSyntaxes[0] = UID_MPEG4StereoHighProfileLevel4_2TransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_HEVCMainProfileLevel5_1: + /* we only propose HEVC/H.265 Main Profile/L5.1 since we don't want to decompress */ + transferSyntaxes[0] = UID_HEVCMainProfileLevel5_1TransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_HEVCMain10ProfileLevel5_1: + /* we only propose HEVC/H.265 Main 10 Profile/L5.1 since we don't want to decompress */ + transferSyntaxes[0] = UID_HEVCMain10ProfileLevel5_1TransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_RLELossless: + /* we prefer RLE Lossless */ + transferSyntaxes[0] = UID_RLELosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#ifdef WITH_ZLIB + case EXS_DeflatedLittleEndianExplicit: + /* we prefer deflated transmission */ + transferSyntaxes[0] = UID_DeflatedExplicitVRLittleEndianTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#endif + default: + /* We prefer explicit transfer syntaxes. + * If we are running on a Little Endian machine we prefer + * LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + */ + if (gLocalByteOrder == EBO_LittleEndian) /* defined in dcxfer.h */ + { + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + } +#endif + + for (i = 0; i < numberOfDcmLongSCUStorageSOPClassUIDs && cond.good(); i++) { + cond = ASC_addPresentationContext( + params, pid, dcmLongSCUStorageSOPClassUIDs[i], + transferSyntaxes, numTransferSyntaxes); + pid += 2; /* only odd presentation context id's */ + } + return cond; +} diff --git a/dcmqrdb/libsrc/dcmqrcbs.cc b/dcmqrdb/libsrc/dcmqrcbs.cc new file mode 100644 index 00000000..94b36cc9 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrcbs.cc @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveStoreContext + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrcbs.h" + +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" + + +void DcmQueryRetrieveStoreContext::updateDisplay(T_DIMSE_StoreProgress * progress) +{ + // We can't use oflog for the pdu output, but we use a special logger for + // generating this output. If it is set to level "INFO" we generate the + // output, if it's set to "DEBUG" then we'll assume that there is debug output + // generated for each PDU elsewhere. + OFLogger progressLogger = OFLog::getLogger("dcmtk.dcmqrdb.progress"); + if (progressLogger.getChainedLogLevel() == OFLogger::INFO_LOG_LEVEL) + { + switch (progress->state) + { + case DIMSE_StoreBegin: + printf("RECV: "); + break; + case DIMSE_StoreEnd: + printf("\n"); + break; + default: + putchar('.'); + break; + } + fflush(stdout); + } +} + + +void DcmQueryRetrieveStoreContext::saveImageToDB( + T_DIMSE_C_StoreRQ *req, /* original store request */ + const char *imageFileName, + /* out */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + DcmDataset **stDetail) +{ + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Success); + + /* Store image */ + if (options_.ignoreStoreData_) { + rsp->DimseStatus = STATUS_Success; + *stDetail = NULL; + return; /* nothing else to do */ + } + + if (status == STATUS_Success) + { + dbcond = dbHandle.storeRequest( + req->AffectedSOPClassUID, req->AffectedSOPInstanceUID, + imageFileName, &dbStatus); + if (dbcond.bad()) + { + OFString temp_str; + DCMQRDB_ERROR("storeSCP: Database: storeRequest Failed (" + << DU_cstoreStatusString(dbStatus.status()) << "): " + << DimseCondition::dump(temp_str, dbcond)); + } + status = dbStatus.status(); + } + + rsp->DimseStatus = status; + *stDetail = dbStatus.extractStatusDetail(); +} + +void DcmQueryRetrieveStoreContext::writeToFile( + DcmFileFormat *ff, + const char* fname, + T_DIMSE_C_StoreRSP *rsp) +{ + E_TransferSyntax xfer = options_.writeTransferSyntax_; + if (xfer == EXS_Unknown) xfer = ff->getDataset()->getOriginalXfer(); + + OFCondition cond = ff->saveFile(fname, xfer, options_.sequenceType_, + options_.groupLength_, options_.paddingType_, (Uint32)options_.filepad_, + (Uint32)options_.itempad_, (options_.useMetaheader_) ? EWM_fileformat : EWM_dataset); + + if (cond.bad()) + { + DCMQRDB_ERROR("storescp: Cannot write image file: " << fname); + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + + // delete incomplete file + OFStandard::deleteFile(fname); + } +} + +void DcmQueryRetrieveStoreContext::checkRequestAgainstDataset( + T_DIMSE_C_StoreRQ *req, /* original store request */ + const char* fname, /* filename of dataset */ + DcmDataset *dataSet, /* dataset to check */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + OFBool uidPadding) /* correct UID passing */ +{ + DcmFileFormat ff; + + if (dataSet == NULL) + { + ff.loadFile(fname); + dataSet = ff.getDataset(); + } + + /* which SOP class and SOP instance ? */ + DIC_UI sopClass; + DIC_UI sopInstance; + + if (!DU_findSOPClassAndInstanceInDataSet(dataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), uidPadding)) + { + DCMQRDB_ERROR("Bad image file: " << fname); + rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; + } else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0) { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } else if (strcmp(sopInstance, req->AffectedSOPInstanceUID) != 0) { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } +} + +void DcmQueryRetrieveStoreContext::callbackHandler( + /* in */ + T_DIMSE_StoreProgress *progress, /* progress state */ + T_DIMSE_C_StoreRQ *req, /* original store request */ + char *imageFileName, /* being received into */ + DcmDataset **imageDataSet, /* being received into */ + /* out */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + DcmDataset **stDetail) +{ + updateDisplay(progress); + + if (progress->state == DIMSE_StoreEnd) { + + if (!options_.ignoreStoreData_ && rsp->DimseStatus == STATUS_Success) { + if ((imageDataSet)&&(*imageDataSet)) { + checkRequestAgainstDataset(req, NULL, *imageDataSet, rsp, correctUIDPadding); + } else { + checkRequestAgainstDataset(req, imageFileName, NULL, rsp, correctUIDPadding); + } + } + + if (!options_.ignoreStoreData_ && rsp->DimseStatus == STATUS_Success) { + if ((imageDataSet)&&(*imageDataSet)) { + writeToFile(dcmff, fileName, rsp); + } + if (rsp->DimseStatus == STATUS_Success) { + saveImageToDB(req, fileName, rsp, stDetail); + } + } + + OFString str; + if (rsp->DimseStatus != STATUS_Success) + DCMQRDB_WARN("NOTICE: StoreSCP:" << OFendl << DIMSE_dumpMessage(str, *rsp, DIMSE_OUTGOING)); + else + DCMQRDB_INFO("Sending:" << OFendl << DIMSE_dumpMessage(str, *rsp, DIMSE_OUTGOING)); + status = rsp->DimseStatus; + } +} diff --git a/dcmqrdb/libsrc/dcmqrcnf.cc b/dcmqrdb/libsrc/dcmqrcnf.cc new file mode 100644 index 00000000..586d3e05 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrcnf.cc @@ -0,0 +1,1122 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg / Ralph Meyer + * + * Purpose: class DcmQueryRetrieveConfig + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrcnf.h" + +/* includes */ +#define INCLUDE_CSTDIO +#define INCLUDE_CCTYPE +#define INCLUDE_CSTDARG +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/ofstd/ofcmdln.h" +#include "dcmtk/ofstd/ofmap.h" +#include "dcmtk/ofstd/ofchrenc.h" + +OFLogger DCM_dcmqrdbLogger = OFLog::getLogger("dcmtk.dcmqrdb"); + +static void freePeer(OFMap &pointersToFree, struct DcmQueryRetrieveConfigPeer *entry) +{ + // Hack to make sure we don't double-free + pointersToFree[entry->ApplicationTitle] = OFTrue; + pointersToFree[entry->HostName] = OFTrue; +} + +static void freeConfigAEEntry(OFMap &pointersToFree, struct DcmQueryRetrieveConfigAEEntry *entry) +{ + for (int i = 0; i < entry->noOfPeers; i++) { + freePeer(pointersToFree, &entry->Peers[i]); + } + free(OFconst_cast(char *, entry->ApplicationTitle)); + free(OFconst_cast(char *, entry->StorageArea)); + free(OFconst_cast(char *, entry->Access)); + free(entry->StorageQuota); + free(entry->Peers); +} + +static void freeConfigHostEntry(OFMap &pointersToFree, struct DcmQueryRetrieveConfigHostEntry *entry) +{ + for (int i = 0; i< entry->noOfPeers; i++) { + freePeer(pointersToFree, &entry->Peers[i]); + } + free(OFconst_cast(char *, entry->SymbolicName)); + free(entry->Peers); +} + +DcmQueryRetrieveCharacterSetOptions::DcmQueryRetrieveCharacterSetOptions() +: characterSet() +, flags(0) +, conversionFlags(0) +{ + +} + +OFBool DcmQueryRetrieveCharacterSetOptions::parseOptions(const char* mnemonic, char* valueptr) +{ + struct RAIIFree + { + RAIIFree(char* ptr) : ptr(ptr) {} + ~RAIIFree() {free(ptr);} + char* ptr; + }; + if (strcmp(mnemonic,"SpecificCharacterSet") != 0) + return OFFalse; + characterSet.clear(); + flags = Configured; + conversionFlags = 0; + for (char* c = DcmQueryRetrieveConfig::parsevalues(&valueptr); c; + c = DcmQueryRetrieveConfig::parsevalues(&valueptr)) { + // ensure free is called when this scope is left + RAIIFree cleanup(c); + if (!strcmp(c, "override")) { + flags |= Override; + } else if(!strcmp(c, "fallback")) { + flags |= Fallback; + } else if(!strcmp(c, "abort")) { + conversionFlags |= OFCharacterEncoding::AbortTranscodingOnIllegalSequence; + } else if(!strcmp(c, "discard")) { + conversionFlags |= OFCharacterEncoding::DiscardIllegalSequences; + } else if(!strcmp(c, "transliterate")) { + conversionFlags |= OFCharacterEncoding::TransliterateIllegalSequences; + } else { + characterSet = c; + } + } + return OFTrue; +} + +DcmQueryRetrieveConfig::~DcmQueryRetrieveConfig() +{ + // There can be more than one DcmQueryRetrieveConfigPeer which points to the + // same strings. To make sure that we don't free them more than once, we use + // a std::set which contains the pointers which we have to free. + // This happens in DcmQueryRetrieveConfig::readPeerList() while handling + // symbolic names (DcmQueryRetrieveConfigPeer gets copied via memcpy()). + // + // TODO: Since OFSet and std::set have nothing in common, we have to fake a + // set via a map. + OFMap pointersToFree; + OFMap::const_iterator it; + int i; + + for (i = 0; i < CNF_Config.noOfAEEntries; i++) { + freeConfigAEEntry(pointersToFree, &CNF_Config.AEEntries[i]); + } + free(CNF_Config.AEEntries); + + for (i = 0; i < CNF_HETable.noOfHostEntries; i++) { + freeConfigHostEntry(pointersToFree, &CNF_HETable.HostEntries[i]); + } + free(CNF_HETable.HostEntries); + + for (i = 0; i < CNF_VendorTable.noOfHostEntries; i++) { + freeConfigHostEntry(pointersToFree, &CNF_VendorTable.HostEntries[i]); + } + free(CNF_VendorTable.HostEntries); + + for (it = pointersToFree.begin(); it != pointersToFree.end(); ++it) { + free(OFconst_cast(void *, it->first)); + } +} + +int DcmQueryRetrieveConfig::aeTitlesForPeer(const char *hostName, const char *** aeTitleList) const +{ + int n = 0; + int i, j, k; + const int chunkSize = 1; + int maxAlloc = 0; + const char *hname; + const char *aetitle; + int found; + + *aeTitleList = (const char**)malloc(chunkSize*sizeof(const char*)); + maxAlloc = chunkSize; + + /* collect up titles for peer, search in host table */ + for (i=0; i= maxAlloc) { + *aeTitleList = (const char**)realloc(*aeTitleList, + (maxAlloc + chunkSize)*sizeof(const char*)); + maxAlloc += chunkSize; + } + (*aeTitleList)[n] = aetitle; + + n++; + } + } + } + } + /* collect up titles for peer, search in AE table */ + for (i=0; i= maxAlloc) { + *aeTitleList = (const char**)realloc(*aeTitleList, + (maxAlloc + chunkSize)*sizeof(const char*)); + maxAlloc += chunkSize; + } + (*aeTitleList)[n] = aetitle; + + n++; + } + } + } + } + + if (n == 0) { + free(*aeTitleList); + *aeTitleList = NULL; + } + return n; +} + + +int DcmQueryRetrieveConfig::ctnTitles(const char *** ctnTitleList) const +{ + int i; + int n = 0; + + n = CNF_Config.noOfAEEntries; + *ctnTitleList = (const char**)malloc(n * sizeof(const char*)); + + for (i=0; imaxStudies == 0) || + (CNF_Config.AEEntries[noOfAEEntries - 1].StorageQuota->maxBytesPerStudy == 0)) + error = 1; + else + { + CNF_Config.AEEntries[noOfAEEntries - 1].Peers = parsePeers(&lineptr, &CNF_Config.AEEntries[noOfAEEntries - 1].noOfPeers); + if (!CNF_Config.AEEntries[noOfAEEntries - 1].noOfPeers) error = 1; + } + } + + if (!end) { + error = 1; + panic("No \"AETable END\" in configuration file, line %d", *lineno); + } + CNF_Config.noOfAEEntries = noOfAEEntries; + return(error ? 0 : 1); +} + + +DcmQueryRetrieveConfigQuota *DcmQueryRetrieveConfig::parseQuota(char **valuehandle) +{ + int studies; + char *helpvalue, + helpval[512]; + DcmQueryRetrieveConfigQuota *helpquota; + + if ((helpquota = (DcmQueryRetrieveConfigQuota *)malloc(sizeof(DcmQueryRetrieveConfigQuota))) == NULL) + panic("Memory allocation 4"); + helpvalue = parsevalues(valuehandle); + if (helpvalue) + { + sscanf(helpvalue, "%d , %s", &studies, helpval); + helpquota->maxStudies = studies; + helpquota->maxBytesPerStudy = quota(helpval); + } else { + helpquota->maxStudies = 0; + helpquota->maxBytesPerStudy = 0; + } + free(helpvalue); + + return(helpquota); +} + + +DcmQueryRetrieveConfigPeer *DcmQueryRetrieveConfig::parsePeers(char **valuehandle, int *peers) +{ + char *helpvalue; + char *valueptr = *valuehandle; + + helpvalue = parsevalues(valuehandle); + if (!strcmp("ANY", helpvalue)) { /* keyword ANY used */ + free(helpvalue); + *peers = -1; + return((DcmQueryRetrieveConfigPeer *) 0); + } + + free(helpvalue); /* regular peer list */ + return(readPeerList(&valueptr, peers)); +} + + +DcmQueryRetrieveConfigPeer *DcmQueryRetrieveConfig::readPeerList(char **valuehandle, int *peers) +{ + int i, + found, + noOfPeers = 0; + char *helpvalue; + DcmQueryRetrieveConfigPeer *helppeer, + *peerlist = NULL; + + while((helpvalue = parsevalues(valuehandle)) != NULL) { + found = 0; + if (strchr(helpvalue, ',') == NULL) { /* symbolic name */ + if (!CNF_HETable.noOfHostEntries) { + panic("No symbolic names defined"); + *peers = 0; + free(helpvalue); + return((DcmQueryRetrieveConfigPeer *) 0); + } + for(i = 0; i < CNF_HETable.noOfHostEntries; i++) { + if (!strcmp(CNF_HETable.HostEntries[i].SymbolicName, helpvalue)) { + found = 1; + break; + } + } + if (!found) { + panic("Symbolic name \"%s\" not defined", helpvalue); + *peers = 0; + free(helpvalue); + return((DcmQueryRetrieveConfigPeer *) 0); + } + + noOfPeers += CNF_HETable.HostEntries[i].noOfPeers; + if ((helppeer = (DcmQueryRetrieveConfigPeer *)malloc(noOfPeers * sizeof(DcmQueryRetrieveConfigPeer))) == NULL) + panic("Memory allocation 5 (%d)", noOfPeers); + if (noOfPeers - CNF_HETable.HostEntries[i].noOfPeers) { + memcpy((char*)helppeer, (char*)peerlist, (noOfPeers - CNF_HETable.HostEntries[i].noOfPeers) * sizeof(DcmQueryRetrieveConfigPeer)); + free(peerlist); + } + peerlist = helppeer; + memcpy((char*)(peerlist + (noOfPeers - CNF_HETable.HostEntries[i].noOfPeers)), (char*)CNF_HETable.HostEntries[i].Peers, CNF_HETable.HostEntries[i].noOfPeers * sizeof(DcmQueryRetrieveConfigPeer)); + } + + else { /* peer */ + noOfPeers++; + if ((helppeer = (DcmQueryRetrieveConfigPeer *)malloc(noOfPeers * sizeof(DcmQueryRetrieveConfigPeer))) == NULL) + panic("Memory allocation 6 (%d)", noOfPeers); + if (noOfPeers - 1) { + memcpy((char*)helppeer, (char*)peerlist, (noOfPeers - 1) *sizeof(DcmQueryRetrieveConfigPeer)); + free(peerlist); + } + peerlist = helppeer; + + char *tempvalue = helpvalue; + peerlist[noOfPeers - 1].ApplicationTitle = parsevalues(&helpvalue); + peerlist[noOfPeers - 1].HostName = parsevalues(&helpvalue); + peerlist[noOfPeers - 1].PortNumber = atoi(helpvalue); + helpvalue = tempvalue; + } + free(helpvalue); + } + *peers = noOfPeers; + return(peerlist); +} + + +char *DcmQueryRetrieveConfig::skipmnemonic (char *rcline) +{ + char *help = rcline; + + while(*help != '\0') { /* leading spaces */ + if (isgap(*help)) help++; + else break; + } + while(*help != '\0') { + if (!isspace(OFstatic_cast(unsigned char, *help))) help++; /* Mnemonic */ + else break; + } + while(*help != '\0') { + if (isgap(*help)) help++; /* Gap */ + else break; + } + return(help); +} + + +int DcmQueryRetrieveConfig::isgap (char gap) +{ + if (isspace(OFstatic_cast(unsigned char, gap))) + return(1); + if (gap == '=' || gap == ',' || gap == 10 || gap == 13) + return(1); + else + return(0); +} + + +int DcmQueryRetrieveConfig::isquote (char quote) +{ + if (quote == '"' || quote == '\'' || quote == '(' || quote == ')') + return(1); + else + return(0); +} + + +char *DcmQueryRetrieveConfig::parsevalues (char **valuehandle) +{ + int i, + inquotes = 0, + count = 0; + char *value = NULL; + const char *help, + *valueptr = *valuehandle; + + if (isquote(*valueptr)) { + inquotes = 1; + valueptr++; + } + + help = valueptr; + + while(*help != '\0') { + if (inquotes) { + if (isquote(*help)) { + if ((value = (char*)malloc(count * sizeof(char) + 1)) == NULL) + panic("Memory allocation 7 (%d)", count); + for(i = 0; i < count; i++) + value[i] = valueptr[i]; + value[count] = '\0'; + count++; + help++; + while (*help != '\0') { + if (isgap(*help)) { + count++; + help++; + } + else + break; + } + *valuehandle += (count + 1); + break; + } + else { + count++; + help++; + } + } + else { + if (isgap(*help)) { + if ((value = (char*)malloc(count * sizeof(char) + 1)) == NULL) + panic("Memory allocation 8 (%d)", count); + for(i = 0; i < count; i++) + value[i] = valueptr[i]; + value[count] = '\0'; + while (*help != '\0') { + if (isgap(*help)) { + count++; + help++; + } + else + break; + } + *valuehandle += count; + break; + } + else { + count++; + help++; + } + } /* inquotes */ + } /* while */ + + return(value); +} + + +long DcmQueryRetrieveConfig::quota (const char *value) +{ + int number; + long factor; + char last = *(value + strlen(value) - 1), /* last character */ + mult = *(value + strlen(value) - 2); /* multiplier */ + + if (last == 'b' || last == 'B') { + if (mult == 'k' || mult == 'K') factor = 1024; + else if (mult == 'm' || mult == 'M') factor = 1024 * 1024; + else if (mult == 'g' || mult == 'G') factor = 1024 * 1024 * 1024; + else factor = 1; + } + else return(-1L); + + number = atoi(value); + return(number * factor); +} + + +int DcmQueryRetrieveConfig::init(const char *ConfigurationFile) +{ + int error = 0; /* error flag */ + FILE *cnffp; /* configuration file pointer */ + + if ((cnffp = fopen(ConfigurationFile, "r")) == NULL) { + panic("Unable to open configuration file \"%s\"", ConfigurationFile); + return(0); + } + + initConfigStruct(); + + if (!readConfigLines(cnffp)) { + panic("Reading configuration file \"%s\" with errors", ConfigurationFile); + error = 1; + } + + fclose(cnffp); + + return(error ? 0 : 1); +} + + +void DcmQueryRetrieveConfig::printConfig() +{ + int i,j; + + DCMQRDB_INFO("\nHostTable: " << CNF_HETable.noOfHostEntries); + for(i = 0; i < CNF_HETable.noOfHostEntries; i++) { + DCMQRDB_INFO(CNF_HETable.HostEntries[i].SymbolicName << " " << CNF_HETable.HostEntries[i].noOfPeers); + for(j = 0; j < CNF_HETable.HostEntries[i].noOfPeers; j++) { + DCMQRDB_INFO(CNF_HETable.HostEntries[i].Peers[j].ApplicationTitle << " " << + CNF_HETable.HostEntries[i].Peers[j].HostName << " " << CNF_HETable.HostEntries[i].Peers[j].PortNumber); + } + } + DCMQRDB_INFO("\nVendorTable: " << CNF_VendorTable.noOfHostEntries); + for(i = 0; i < CNF_VendorTable.noOfHostEntries; i++) { + DCMQRDB_INFO(CNF_VendorTable.HostEntries[i].SymbolicName << " " << CNF_VendorTable.HostEntries[i].noOfPeers); + for(j = 0; j < CNF_VendorTable.HostEntries[i].noOfPeers; j++) { + DCMQRDB_INFO(CNF_VendorTable.HostEntries[i].Peers[j].ApplicationTitle << " " << + CNF_VendorTable.HostEntries[i].Peers[j].HostName << " " << CNF_VendorTable.HostEntries[i].Peers[j].PortNumber); + } + } + DCMQRDB_INFO("\nGlobal Parameters:\n" << networkTCPPort_ << "\n" << OFstatic_cast(unsigned long, maxPDUSize_) + << "\n" << maxAssociations_); + DCMQRDB_INFO("\nAEEntries: " << CNF_Config.noOfAEEntries); + for(i = 0; i < CNF_Config.noOfAEEntries; i++) { + DCMQRDB_INFO(CNF_Config.AEEntries[i].ApplicationTitle << "\n" << CNF_Config.AEEntries[i].StorageArea + << "\n" << CNF_Config.AEEntries[i].Access << "\n" << CNF_Config.AEEntries[i].StorageQuota->maxStudies + << ", " << CNF_Config.AEEntries[i].StorageQuota->maxBytesPerStudy); + if (CNF_Config.AEEntries[i].noOfPeers == -1) + DCMQRDB_INFO("Peers: ANY"); + else { + DCMQRDB_INFO("Peers: " << CNF_Config.AEEntries[i].noOfPeers); + for(j = 0; j < CNF_Config.AEEntries[i].noOfPeers; j++) { + DCMQRDB_INFO(CNF_Config.AEEntries[i].Peers[j].ApplicationTitle << " " << + CNF_Config.AEEntries[i].Peers[j].HostName << " " << CNF_Config.AEEntries[i].Peers[j].PortNumber); + } + } + DCMQRDB_INFO("----------------------------------\n"); + } +} + + +int DcmQueryRetrieveConfig::getNetworkTCPPort() const +{ + return(networkTCPPort_); +} + + +OFCmdUnsignedInt DcmQueryRetrieveConfig::getMaxPDUSize() const +{ + return(maxPDUSize_); +} + + +int DcmQueryRetrieveConfig::getMaxAssociations() const +{ + return(maxAssociations_); +} + + +const char *DcmQueryRetrieveConfig::getStorageArea(const char *AETitle) const +{ + int i; + + for(i = 0; i < CNF_Config.noOfAEEntries; i++) { + if (!strcmp(AETitle, CNF_Config.AEEntries[i].ApplicationTitle)) + return(CNF_Config.AEEntries[i].StorageArea); + } + return(NULL); /* AETitle not found */ +} + + +const char *DcmQueryRetrieveConfig::getAccess(const char *AETitle) const +{ + int i; + + for(i = 0; i < CNF_Config.noOfAEEntries; i++) { + if (!strcmp(AETitle, CNF_Config.AEEntries[i].ApplicationTitle)) + return(CNF_Config.AEEntries[i].Access); + } + return(NULL); /* AETitle not found */ +} + + +int DcmQueryRetrieveConfig::getMaxStudies(const char *AETitle) const +{ + int i; + + for(i = 0; i < CNF_Config.noOfAEEntries; i++) { + if (!strcmp(AETitle, CNF_Config.AEEntries[i].ApplicationTitle)) + return(CNF_Config.AEEntries[i].StorageQuota->maxStudies); + } + return(0); /* AETitle not found */ +} + +long DcmQueryRetrieveConfig::getMaxBytesPerStudy(const char *AETitle) const +{ + int i; + + for(i = 0; i < CNF_Config.noOfAEEntries; i++) { + if (!strcmp(AETitle, CNF_Config.AEEntries[i].ApplicationTitle)) + return(CNF_Config.AEEntries[i].StorageQuota->maxBytesPerStudy); + } + return(0); /* AETitle not found */ +} + + +int DcmQueryRetrieveConfig::peerInAETitle(const char *calledAETitle, const char *callingAETitle, const char *HostName) const +{ + int i, + j; + + for(i = 0; i < CNF_Config.noOfAEEntries; i++) { + if (!strcmp(calledAETitle, CNF_Config.AEEntries[i].ApplicationTitle)) { + if (CNF_Config.AEEntries[i].noOfPeers == -1) /* ANY Peer allowed */ + return(1); + for(j = 0; j < CNF_Config.AEEntries[i].noOfPeers; j++) { + if (!strcmp(callingAETitle, CNF_Config.AEEntries[i].Peers[j].ApplicationTitle) && +#ifdef HAVE_PROTOTYPE_STRCASECMP + /* DNS is not case-sensitive */ + !strcasecmp(HostName, CNF_Config.AEEntries[i].Peers[j].HostName)) +#elif defined(HAVE_PROTOTYPE__STRICMP) + !_stricmp(HostName, CNF_Config.AEEntries[i].Peers[j].HostName)) +#else + /* fallback solution is to do case sensitive comparison on systems + which do not implement strcasecmp or _stricmp */ + !strcmp(HostName, CNF_Config.AEEntries[i].Peers[j].HostName)) +#endif + return(1); /* Peer found */ + } + } + } + return(0); /* Peer not found */ +} + + +int DcmQueryRetrieveConfig::peerForAETitle(const char *AETitle, const char **HostName, int *PortNumber) const +{ + int i, + j; + + for(i = 0; i < CNF_Config.noOfAEEntries; i++) { + for(j = 0; j < CNF_Config.AEEntries[i].noOfPeers; j++) { + if (!strcmp(AETitle, CNF_Config.AEEntries[i].Peers[j].ApplicationTitle)) { + *HostName = CNF_Config.AEEntries[i].Peers[j].HostName; + *PortNumber = CNF_Config.AEEntries[i].Peers[j].PortNumber; + return(1); /* Peer found in AETable */ + } + } + } + + for(i = 0; i < CNF_HETable.noOfHostEntries; i++) { + for(j = 0; j < CNF_HETable.HostEntries[i].noOfPeers; j++) { + if (!strcmp(AETitle, CNF_HETable.HostEntries[i].Peers[j].ApplicationTitle)) { + *HostName = CNF_HETable.HostEntries[i].Peers[j].HostName; + *PortNumber = CNF_HETable.HostEntries[i].Peers[j].PortNumber; + return(2); /* Peer found in HostTable */ + } + } + } + + return(0); /* Peer not found */ +} + + +int DcmQueryRetrieveConfig::checkForSameVendor(const char *AETitle1, const char *AETitle2) const +{ + int i, + j, + k, + found = 0; + + for(i = 0; i < CNF_VendorTable.noOfHostEntries; i++) { + for(j = 0; j < CNF_VendorTable.HostEntries[i].noOfPeers; j++) { + if (!strcmp(AETitle1, CNF_VendorTable.HostEntries[i].Peers[j].ApplicationTitle)) { + for(k = 0; k < CNF_VendorTable.HostEntries[i].noOfPeers; k++) { + if (!strcmp(AETitle2, CNF_VendorTable.HostEntries[i].Peers[k].ApplicationTitle)) + found = 1; + } + } + } + } + + return(found); +} + + +int DcmQueryRetrieveConfig::HostNamesForVendor(const char *Vendor, const char ***HostNameArray) const +{ + int i, j, + found = 0; + + for(i = 0; i < CNF_VendorTable.noOfHostEntries; i++) { + if (!strcmp(CNF_VendorTable.HostEntries[i].SymbolicName, Vendor)) { + found = 1; + break; + } + } + + if (!found) + return(0); + + if ((*HostNameArray = (const char**)malloc(CNF_VendorTable.HostEntries[i].noOfPeers * sizeof(const char *))) == NULL) { + panic("Memory allocation A (%d)", CNF_VendorTable.HostEntries[i].noOfPeers); + return(0); + } + for(j = 0; j < CNF_VendorTable.HostEntries[i].noOfPeers; j++) + (*HostNameArray)[j] = CNF_VendorTable.HostEntries[i].Peers[j].HostName; + + return(CNF_VendorTable.HostEntries[i].noOfPeers); +} + +OFBool DcmQueryRetrieveConfig::writableStorageArea(const char *aeTitle) const +{ + const char *axs = getAccess((char*)aeTitle); + if (strcmp(axs, "RW") == 0) return OFTrue; + if (strcmp(axs, "WR") == 0) return OFTrue; + if (strcmp(axs, "W") == 0) return OFTrue; + return OFFalse; +} + +const char *DcmQueryRetrieveConfig::getUserName() const +{ + return UserName_.c_str(); +} + +const char *DcmQueryRetrieveConfig::getGroupName() const +{ + return GroupName_.c_str(); +} + +const DcmQueryRetrieveCharacterSetOptions& DcmQueryRetrieveConfig::getCharacterSetOptions() const +{ + return characterSetOptions_; +} + +DcmQueryRetrieveCharacterSetOptions& DcmQueryRetrieveConfig::getCharacterSetOptions() +{ + return characterSetOptions_; +} diff --git a/dcmqrdb/libsrc/dcmqrdbi.cc b/dcmqrdb/libsrc/dcmqrdbi.cc new file mode 100644 index 00000000..1ef1ec47 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrdbi.cc @@ -0,0 +1,3318 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: classes DcmQueryRetrieveIndexDatabaseHandle, + * DcmQueryRetrieveIndexDatabaseHandleFactory + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif +END_EXTERN_C + +#define INCLUDE_CCTYPE +#define INCLUDE_CSTDARG +#include "dcmtk/ofstd/ofstdinc.h" +#include "dcmtk/ofstd/ofstd.h" + +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" +#include "dcmtk/dcmqrdb/dcmqrcnf.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" + +#include "dcmtk/dcmqrdb/dcmqridx.h" +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcmatch.h" + +/* ========================= static data ========================= */ + +/**** The TbFindAttr table contains the description of tags (keys) supported + **** by the DB Module. + **** Tags described here have to be present in the Index Record file. + **** The order is insignificant. + **** + **** Each element of this table is described by + **** The tag value + **** The level of this tag (from patient to image) + **** The Key Type (only UNIQUE_KEY values is used) + **** + **** This table and the IndexRecord structure should contain at least + **** all Unique and Required keys. + ***/ + +static const DB_FindAttr TbFindAttr [] = { + DB_FindAttr( DCM_PatientBirthDate, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_PatientSex, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_PatientName, PATIENT_LEVEL, REQUIRED_KEY ), + DB_FindAttr( DCM_PatientID, PATIENT_LEVEL, UNIQUE_KEY ), + DB_FindAttr( DCM_PatientBirthTime, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_RETIRED_OtherPatientIDs, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_OtherPatientNames, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_EthnicGroup, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_PatientComments, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_IssuerOfPatientID, PATIENT_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_StudyDate, STUDY_LEVEL, REQUIRED_KEY ), + DB_FindAttr( DCM_StudyTime, STUDY_LEVEL, REQUIRED_KEY ), + DB_FindAttr( DCM_StudyID, STUDY_LEVEL, REQUIRED_KEY ), + DB_FindAttr( DCM_AccessionNumber, STUDY_LEVEL, REQUIRED_KEY ), + DB_FindAttr( DCM_ReferringPhysicianName, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_StudyDescription, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_NameOfPhysiciansReadingStudy, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_StudyInstanceUID, STUDY_LEVEL, UNIQUE_KEY ), + DB_FindAttr( DCM_RETIRED_OtherStudyNumbers, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_AdmittingDiagnosesDescription, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_PatientAge, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_PatientSize, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_PatientWeight, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_Occupation, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_AdditionalPatientHistory, STUDY_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_SeriesNumber, SERIE_LEVEL, REQUIRED_KEY ), + DB_FindAttr( DCM_SeriesInstanceUID, SERIE_LEVEL, UNIQUE_KEY ), + DB_FindAttr( DCM_Modality, SERIE_LEVEL, OPTIONAL_KEY ), + DB_FindAttr( DCM_InstanceNumber, IMAGE_LEVEL, REQUIRED_KEY ), + DB_FindAttr( DCM_SOPInstanceUID, IMAGE_LEVEL, UNIQUE_KEY ) + }; + +/**** The NbFindAttr variable contains the length of the TbFindAttr table + ***/ + +static int NbFindAttr = ((sizeof (TbFindAttr)) / (sizeof (TbFindAttr [0]))); + +/* ========================= static functions ========================= */ + +static char *DB_strdup(const char* str) +{ + if (str == NULL) return NULL; + size_t buflen = strlen(str)+1; + char* s = (char*)malloc(buflen); + OFStandard::strlcpy(s, str, buflen); + return s; +} + +/************ +** Add UID in Index Record to the UID found list + */ + +static void DB_UIDAddFound ( + DB_Private_Handle *phandle, + IdxRecord *idxRec + ) +{ + DB_UidList *plist ; + + plist = (DB_UidList *) malloc (sizeof (DB_UidList)) ; + if (plist == NULL) { + DCMQRDB_ERROR("DB_UIDAddFound: out of memory"); + return; + } + plist->next = phandle->uidList ; + plist->patient = NULL ; + plist->study = NULL ; + plist->serie = NULL ; + plist->image = NULL ; + + if ((int)phandle->queryLevel >= PATIENT_LEVEL) + plist->patient = DB_strdup ((char *) idxRec->PatientID) ; + if ((int)phandle->queryLevel >= STUDY_LEVEL) + plist->study = DB_strdup ((char *) idxRec->StudyInstanceUID) ; + if ((int)phandle->queryLevel >= SERIE_LEVEL) + plist->serie = DB_strdup ((char *) idxRec->SeriesInstanceUID) ; + if ((int)phandle->queryLevel >= IMAGE_LEVEL) + plist->image = DB_strdup ((char *) idxRec->SOPInstanceUID) ; + + phandle->uidList = plist ; +} + + +/************ +** Search if an Index Record has already been found + */ + +static int DB_UIDAlreadyFound ( + DB_Private_Handle *phandle, + IdxRecord *idxRec + ) +{ + DB_UidList *plist ; + + for (plist = phandle->uidList ; plist ; plist = plist->next) { + if ( ((int)phandle->queryLevel >= PATIENT_LEVEL) + && (strcmp (plist->patient, (char *) idxRec->PatientID) != 0) + ) + continue ; + if ( ((int)phandle->queryLevel >= STUDY_LEVEL) + && (strcmp (plist->study, (char *) idxRec->StudyInstanceUID) != 0) + ) + continue ; + if ( ((int)phandle->queryLevel >= SERIE_LEVEL) + && (strcmp (plist->serie, (char *) idxRec->SeriesInstanceUID) != 0) + ) + continue ; + if ( ((int)phandle->queryLevel >= IMAGE_LEVEL) + && (strcmp (plist->image, (char *) idxRec->SOPInstanceUID) != 0) + ) + continue ; + return (OFTrue) ; + } + return (OFFalse) ; +} + +/************ + * Initializes addresses in an IdxRecord + */ + +static void DB_IdxInitRecord (IdxRecord *idx, int linksOnly) +{ + if (! linksOnly) + { + idx -> param[RECORDIDX_PatientBirthDate]. XTag = DCM_PatientBirthDate ; + idx -> param[RECORDIDX_PatientBirthDate]. ValueLength = DA_MAX_LENGTH ; + idx -> PatientBirthDate[0] = '\0' ; + idx -> param[RECORDIDX_PatientSex]. XTag = DCM_PatientSex ; + idx -> param[RECORDIDX_PatientSex]. ValueLength = CS_MAX_LENGTH ; + idx -> PatientSex[0] = '\0' ; + idx -> param[RECORDIDX_PatientName]. XTag = DCM_PatientName ; + idx -> param[RECORDIDX_PatientName]. ValueLength = PN_MAX_LENGTH ; + idx -> PatientName[0] = '\0' ; + idx -> param[RECORDIDX_PatientID]. XTag = DCM_PatientID ; + idx -> param[RECORDIDX_PatientID]. ValueLength = LO_MAX_LENGTH ; + idx -> PatientID[0] = '\0' ; + idx -> param[RECORDIDX_PatientBirthTime]. XTag = DCM_PatientBirthTime ; + idx -> param[RECORDIDX_PatientBirthTime]. ValueLength = TM_MAX_LENGTH ; + idx -> PatientBirthTime[0] = '\0' ; + idx -> param[RECORDIDX_OtherPatientIDs]. XTag = DCM_RETIRED_OtherPatientIDs ; + idx -> param[RECORDIDX_OtherPatientIDs]. ValueLength = LO_MAX_LENGTH ; + idx -> OtherPatientIDs[0] = '\0' ; + idx -> param[RECORDIDX_OtherPatientNames]. XTag = DCM_OtherPatientNames ; + idx -> param[RECORDIDX_OtherPatientNames]. ValueLength = PN_MAX_LENGTH ; + idx -> OtherPatientNames[0] = '\0' ; + idx -> param[RECORDIDX_EthnicGroup]. XTag = DCM_EthnicGroup ; + idx -> param[RECORDIDX_EthnicGroup]. ValueLength = SH_MAX_LENGTH ; + idx -> EthnicGroup[0] = '\0' ; + idx -> param[RECORDIDX_StudyDate]. XTag = DCM_StudyDate ; + idx -> param[RECORDIDX_StudyDate]. ValueLength = DA_MAX_LENGTH ; + idx -> StudyDate[0] = '\0' ; + idx -> param[RECORDIDX_StudyTime]. XTag = DCM_StudyTime ; + idx -> param[RECORDIDX_StudyTime]. ValueLength = TM_MAX_LENGTH ; + idx -> StudyTime[0] = '\0' ; + idx -> param[RECORDIDX_StudyID]. XTag = DCM_StudyID ; + idx -> param[RECORDIDX_StudyID]. ValueLength = CS_MAX_LENGTH ; + idx -> StudyID[0] = '\0' ; + idx -> param[RECORDIDX_StudyDescription]. XTag = DCM_StudyDescription ; + idx -> param[RECORDIDX_StudyDescription]. ValueLength = LO_MAX_LENGTH ; + idx -> StudyDescription[0] = '\0' ; + idx -> param[RECORDIDX_NameOfPhysiciansReadingStudy]. XTag = DCM_NameOfPhysiciansReadingStudy ; + idx -> param[RECORDIDX_NameOfPhysiciansReadingStudy]. ValueLength = PN_MAX_LENGTH ; + idx -> NameOfPhysiciansReadingStudy[0] = '\0' ; + idx -> param[RECORDIDX_AccessionNumber]. XTag = DCM_AccessionNumber ; + idx -> param[RECORDIDX_AccessionNumber]. ValueLength = CS_MAX_LENGTH ; + idx -> AccessionNumber[0] = '\0' ; + idx -> param[RECORDIDX_ReferringPhysicianName]. XTag = DCM_ReferringPhysicianName ; + idx -> param[RECORDIDX_ReferringPhysicianName]. ValueLength = PN_MAX_LENGTH ; + idx -> ReferringPhysicianName[0] = '\0' ; + idx -> param[RECORDIDX_ProcedureDescription]. XTag = DCM_StudyDescription ; + idx -> param[RECORDIDX_ProcedureDescription]. ValueLength = LO_MAX_LENGTH ; + idx -> ProcedureDescription[0] = '\0' ; + idx -> param[RECORDIDX_AttendingPhysiciansName]. XTag = DCM_NameOfPhysiciansReadingStudy ; + idx -> param[RECORDIDX_AttendingPhysiciansName]. ValueLength = PN_MAX_LENGTH ; + idx -> AttendingPhysiciansName[0] = '\0' ; + idx -> param[RECORDIDX_StudyInstanceUID]. XTag = DCM_StudyInstanceUID ; + idx -> param[RECORDIDX_StudyInstanceUID]. ValueLength = UI_MAX_LENGTH ; + idx -> StudyInstanceUID[0] = '\0' ; + idx -> param[RECORDIDX_OtherStudyNumbers]. XTag = DCM_RETIRED_OtherStudyNumbers ; + idx -> param[RECORDIDX_OtherStudyNumbers]. ValueLength = IS_MAX_LENGTH ; + idx -> OtherStudyNumbers[0] = '\0' ; + idx -> param[RECORDIDX_AdmittingDiagnosesDescription]. XTag = DCM_AdmittingDiagnosesDescription ; + idx -> param[RECORDIDX_AdmittingDiagnosesDescription]. ValueLength = LO_MAX_LENGTH ; + idx -> AdmittingDiagnosesDescription[0] = '\0' ; + idx -> param[RECORDIDX_PatientAge]. XTag = DCM_PatientAge ; + idx -> param[RECORDIDX_PatientAge]. ValueLength = AS_MAX_LENGTH ; + idx -> PatientAge[0] = '\0' ; + idx -> param[RECORDIDX_PatientSize]. XTag = DCM_PatientSize ; + idx -> param[RECORDIDX_PatientSize]. ValueLength = DS_MAX_LENGTH ; + idx -> PatientSize[0] = '\0' ; + idx -> param[RECORDIDX_PatientWeight]. XTag = DCM_PatientWeight ; + idx -> param[RECORDIDX_PatientWeight]. ValueLength = DS_MAX_LENGTH ; + idx -> PatientWeight[0] = '\0' ; + idx -> param[RECORDIDX_Occupation]. XTag = DCM_Occupation ; + idx -> param[RECORDIDX_Occupation]. ValueLength = SH_MAX_LENGTH ; + idx -> Occupation[0] = '\0' ; + idx -> param[RECORDIDX_SeriesNumber]. XTag = DCM_SeriesNumber ; + idx -> param[RECORDIDX_SeriesNumber]. ValueLength = IS_MAX_LENGTH ; + idx -> SeriesNumber[0] = '\0' ; + idx -> param[RECORDIDX_SeriesInstanceUID]. XTag = DCM_SeriesInstanceUID ; + idx -> param[RECORDIDX_SeriesInstanceUID]. ValueLength = UI_MAX_LENGTH ; + idx -> SeriesInstanceUID[0] = '\0' ; + idx -> param[RECORDIDX_Modality]. XTag = DCM_Modality ; + idx -> param[RECORDIDX_Modality]. ValueLength = CS_MAX_LENGTH ; + idx -> ImageNumber[0] = '\0' ; + idx -> param[RECORDIDX_ImageNumber]. XTag = DCM_InstanceNumber ; + idx -> param[RECORDIDX_ImageNumber]. ValueLength = IS_MAX_LENGTH ; + idx -> ImageNumber[0] = '\0' ; + idx -> param[RECORDIDX_SOPInstanceUID]. XTag = DCM_SOPInstanceUID ; + idx -> param[RECORDIDX_SOPInstanceUID]. ValueLength = UI_MAX_LENGTH ; + idx -> SOPInstanceUID[0] = '\0' ; + idx -> param[RECORDIDX_SeriesDate]. XTag = DCM_SeriesDate ; + idx -> param[RECORDIDX_SeriesDate]. ValueLength = DA_MAX_LENGTH ; + idx -> SeriesDate[0] = '\0' ; + idx -> param[RECORDIDX_SeriesTime]. XTag = DCM_SeriesTime ; + idx -> param[RECORDIDX_SeriesTime]. ValueLength = TM_MAX_LENGTH ; + idx -> SeriesTime[0] = '\0' ; + idx -> param[RECORDIDX_SeriesDescription]. XTag = DCM_SeriesDescription ; + idx -> param[RECORDIDX_SeriesDescription]. ValueLength = LO_MAX_LENGTH ; + idx -> SeriesDescription[0] = '\0' ; + idx -> param[RECORDIDX_ProtocolName]. XTag = DCM_ProtocolName ; + idx -> param[RECORDIDX_ProtocolName]. ValueLength = LO_MAX_LENGTH ; + idx -> ProtocolName[0] = '\0' ; + idx -> param[RECORDIDX_OperatorsName ]. XTag = DCM_OperatorsName ; + idx -> param[RECORDIDX_OperatorsName ]. ValueLength = PN_MAX_LENGTH ; + idx -> OperatorsName[0] = '\0' ; + idx -> param[RECORDIDX_PerformingPhysicianName]. XTag = DCM_PerformingPhysicianName ; + idx -> param[RECORDIDX_PerformingPhysicianName]. ValueLength = PN_MAX_LENGTH ; + idx -> PerformingPhysicianName[0] = '\0' ; + idx -> param[RECORDIDX_PresentationLabel]. XTag = DCM_ContentLabel ; + idx -> param[RECORDIDX_PresentationLabel]. ValueLength = CS_LABEL_MAX_LENGTH ; + idx -> PresentationLabel[0] = '\0' ; + idx -> param[RECORDIDX_IssuerOfPatientID]. XTag = DCM_IssuerOfPatientID ; + idx -> param[RECORDIDX_IssuerOfPatientID]. ValueLength = LO_MAX_LENGTH ; + idx -> IssuerOfPatientID[0] = '\0' ; + idx -> param[RECORDIDX_SpecificCharacterSet]. XTag = DCM_SpecificCharacterSet ; + idx -> param[RECORDIDX_SpecificCharacterSet]. ValueLength = CS_MAX_LENGTH*8 ; + idx -> SpecificCharacterSet[0] = '\0' ; + } + idx -> param[RECORDIDX_PatientBirthDate]. PValueField = (char *)idx -> PatientBirthDate ; + idx -> param[RECORDIDX_PatientSex]. PValueField = (char *)idx -> PatientSex ; + idx -> param[RECORDIDX_PatientName]. PValueField = (char *)idx -> PatientName ; + idx -> param[RECORDIDX_PatientID]. PValueField = (char *)idx -> PatientID ; + idx -> param[RECORDIDX_PatientBirthTime]. PValueField = (char *)idx -> PatientBirthTime ; + idx -> param[RECORDIDX_OtherPatientIDs]. PValueField = (char *)idx -> OtherPatientIDs ; + idx -> param[RECORDIDX_OtherPatientNames]. PValueField = (char *)idx -> OtherPatientNames ; + idx -> param[RECORDIDX_EthnicGroup]. PValueField = (char *)idx -> EthnicGroup ; + idx -> param[RECORDIDX_StudyDate]. PValueField = (char *) idx -> StudyDate ; + idx -> param[RECORDIDX_StudyTime]. PValueField = (char *) idx -> StudyTime ; + idx -> param[RECORDIDX_StudyID]. PValueField = (char *) idx -> StudyID ; + idx -> param[RECORDIDX_StudyDescription]. PValueField = (char *) idx -> StudyDescription ; + idx -> param[RECORDIDX_NameOfPhysiciansReadingStudy]. PValueField = (char *) idx ->NameOfPhysiciansReadingStudy; + idx -> param[RECORDIDX_AccessionNumber]. PValueField = (char *) idx -> AccessionNumber ; + idx -> param[RECORDIDX_ReferringPhysicianName]. PValueField = (char *) idx -> ReferringPhysicianName ; + idx -> param[RECORDIDX_ProcedureDescription]. PValueField = (char *) idx -> ProcedureDescription ; + idx -> param[RECORDIDX_AttendingPhysiciansName]. PValueField = (char *) idx -> AttendingPhysiciansName ; + idx -> param[RECORDIDX_StudyInstanceUID]. PValueField = (char *) idx -> StudyInstanceUID ; + idx -> param[RECORDIDX_OtherStudyNumbers]. PValueField = (char *) idx -> OtherStudyNumbers ; + idx -> param[RECORDIDX_AdmittingDiagnosesDescription]. PValueField = (char *) idx -> AdmittingDiagnosesDescription ; + idx -> param[RECORDIDX_PatientAge]. PValueField = (char *) idx -> PatientAge ; + idx -> param[RECORDIDX_PatientSize]. PValueField = (char *) idx -> PatientSize ; + idx -> param[RECORDIDX_PatientWeight]. PValueField = (char *) idx -> PatientWeight ; + idx -> param[RECORDIDX_Occupation]. PValueField = (char *) idx -> Occupation ; + idx -> param[RECORDIDX_SeriesNumber]. PValueField = (char *) idx -> SeriesNumber ; + idx -> param[RECORDIDX_SeriesInstanceUID]. PValueField = (char *) idx -> SeriesInstanceUID ; + idx -> param[RECORDIDX_Modality]. PValueField = (char *) idx -> Modality ; + idx -> param[RECORDIDX_ImageNumber]. PValueField = (char *) idx -> ImageNumber ; + idx -> param[RECORDIDX_SOPInstanceUID]. PValueField = (char *) idx -> SOPInstanceUID ; + idx -> param[RECORDIDX_SeriesDate]. PValueField = (char *) idx -> SeriesDate ; + idx -> param[RECORDIDX_SeriesTime]. PValueField = (char *) idx -> SeriesTime ; + idx -> param[RECORDIDX_SeriesDescription]. PValueField = (char *) idx -> SeriesDescription ; + idx -> param[RECORDIDX_ProtocolName]. PValueField = (char *) idx -> ProtocolName ; + idx -> param[RECORDIDX_OperatorsName ]. PValueField = (char *) idx -> OperatorsName ; + idx -> param[RECORDIDX_PerformingPhysicianName]. PValueField = (char *) idx -> PerformingPhysicianName ; + idx -> param[RECORDIDX_PresentationLabel]. PValueField = (char *) idx -> PresentationLabel ; + idx -> param[RECORDIDX_IssuerOfPatientID]. PValueField = (char *) idx -> IssuerOfPatientID ; + idx -> param[RECORDIDX_SpecificCharacterSet]. PValueField = (char *) idx -> SpecificCharacterSet ; +} + +/****************************** + * Seek to a file position and do error checking + * + * Motivation: + * We have had situations during demonstrations where size of the DB index file + * has exploded. It seems that a record is being written to a position + * way past the end of file. + * This seek function does some sanity error checking to try to identify + * the problem. + */ +static long DB_lseek(int fildes, long offset, int whence) +{ + long pos; + long curpos; + long endpos; + + /* + ** we should not be seeking to an offset < 0 + */ + if (offset < 0) { + DCMQRDB_ERROR("*** DB ALERT: attempt to seek before beginning of file"); + } + + /* get the current position */ + curpos = lseek(fildes, 0, SEEK_CUR); + if (curpos < 0) { + DCMQRDB_ERROR("DB_lseek: cannot get current position: " << OFStandard::getLastSystemErrorCode().message()); + return curpos; + } + /* get the end of file position */ + endpos = lseek(fildes, 0, SEEK_END); + if (endpos < 0) { + DCMQRDB_ERROR("DB_lseek: cannot get end of file position: " << OFStandard::getLastSystemErrorCode().message()); + return endpos; + } + + /* return to current position */ + curpos = lseek(fildes, curpos, SEEK_SET); + if (curpos < 0) { + DCMQRDB_ERROR("DB_lseek: cannot reset current position: " << OFStandard::getLastSystemErrorCode().message()); + return curpos; + } + + /* do the requested seek */ + pos = lseek(fildes, offset, whence); + if (pos < 0) { + DCMQRDB_ERROR("DB_lseek: cannot seek to " << offset << ": " << OFStandard::getLastSystemErrorCode().message()); + return pos; + } + + /* + ** print an alert if we are seeking to far + ** what is the limit? We don't expect the index file to be + ** larger than 32Mb + */ + const long maxFileSize = 33554432; + if (pos > maxFileSize) { + DCMQRDB_ERROR("*** DB ALERT: attempt to seek beyond " << maxFileSize << " bytes"); + } + + /* print an alert if we are seeking beyond the end of file. + * ignore when file is empty or contains only the version information. + */ + if ((endpos > DBHEADERSIZE) && (pos > endpos)) { + DCMQRDB_ERROR("*** DB ALERT: attempt to seek beyond end of file" << OFendl + << " offset=" << offset << " filesize=" << endpos); + } + + return pos; +} + +/****************************** + * Read an Index record + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_IdxRead (int idx, IdxRecord *idxRec) +{ + + /*** Goto the right index in file + **/ + + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE + SIZEOF_STUDYDESC + idx * SIZEOF_IDXRECORD), SEEK_SET) ; + + /*** Read the record + **/ + + if (read (handle_ -> pidx, (char *) idxRec, SIZEOF_IDXRECORD) != SIZEOF_IDXRECORD) + return (QR_EC_IndexDatabaseError) ; + + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + + /*** Initialize record links + **/ + + DB_IdxInitRecord (idxRec, 1) ; + return EC_Normal ; +} + + +/****************************** + * Add an Index record + * Returns the index allocated for this record + */ + +static OFCondition DB_IdxAdd (DB_Private_Handle *phandle, int *idx, IdxRecord *idxRec) +{ + IdxRecord rec ; + OFCondition cond = EC_Normal; + + /*** Find free place for the record + *** A place is free if filename is empty + **/ + + *idx = 0 ; + + DB_lseek (phandle -> pidx, OFstatic_cast(long, DBHEADERSIZE + SIZEOF_STUDYDESC), SEEK_SET) ; + while (read (phandle -> pidx, (char *) &rec, SIZEOF_IDXRECORD) == SIZEOF_IDXRECORD) { + if (rec. filename [0] == '\0') + break ; + (*idx)++ ; + } + + /*** We have either found a free place or we are at the end of file. **/ + + + DB_lseek (phandle -> pidx, OFstatic_cast(long, DBHEADERSIZE + SIZEOF_STUDYDESC + (*idx) * SIZEOF_IDXRECORD), SEEK_SET) ; + + if (write (phandle -> pidx, (char *) idxRec, SIZEOF_IDXRECORD) != SIZEOF_IDXRECORD) + cond = QR_EC_IndexDatabaseError ; + else + cond = EC_Normal ; + + DB_lseek (phandle -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + + return cond ; +} + + +/****************************** + * Change the StudyDescRecord + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_StudyDescChange(StudyDescRecord *pStudyDesc) +{ + OFCondition cond = EC_Normal; + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + if (write (handle_ -> pidx, (char *) pStudyDesc, SIZEOF_STUDYDESC) != SIZEOF_STUDYDESC) + cond = QR_EC_IndexDatabaseError; + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + return cond ; +} + +/****************************** + * Init an Index record loop + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_IdxInitLoop(int *idx) +{ + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE + SIZEOF_STUDYDESC), SEEK_SET) ; + *idx = -1 ; + return EC_Normal ; +} + +/****************************** + * Get next Index record + * On return, idx is initialized with the index of the record read + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_IdxGetNext(int *idx, IdxRecord *idxRec) +{ + + (*idx)++ ; + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE + SIZEOF_STUDYDESC + OFstatic_cast(long, *idx) * SIZEOF_IDXRECORD), SEEK_SET) ; + while (read (handle_ -> pidx, (char *) idxRec, SIZEOF_IDXRECORD) == SIZEOF_IDXRECORD) { + if (idxRec -> filename [0] != '\0') { + DB_IdxInitRecord (idxRec, 1) ; + + return EC_Normal ; + } + (*idx)++ ; + } + + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + + return QR_EC_IndexDatabaseError ; +} + + +/****************************** + * Get next Index record + * On return, idx is initialized with the index of the record read + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_GetStudyDesc (StudyDescRecord *pStudyDesc) +{ + + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + if ( read (handle_ -> pidx, (char *) pStudyDesc, SIZEOF_STUDYDESC) == SIZEOF_STUDYDESC ) + return EC_Normal ; + + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + + return QR_EC_IndexDatabaseError ; +} + + +/****************************** + * Remove an Index record + * Just put a record with filename == "" + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_IdxRemove(int idx) +{ + IdxRecord rec ; + OFCondition cond = EC_Normal; + + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE + SIZEOF_STUDYDESC + OFstatic_cast(long, idx) * SIZEOF_IDXRECORD), SEEK_SET) ; + DB_IdxInitRecord (&rec, 0) ; + + rec. filename [0] = '\0' ; + if (write (handle_ -> pidx, (char *) &rec, SIZEOF_IDXRECORD) == SIZEOF_IDXRECORD) + cond = EC_Normal ; + else + cond = QR_EC_IndexDatabaseError ; + + DB_lseek (handle_ -> pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET) ; + + return cond ; +} + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_lock(OFBool exclusive) +{ + int lockmode; + + if (exclusive) { + lockmode = LOCK_EX; /* exclusive lock */ + } else { + lockmode = LOCK_SH; /* shared lock */ + } + if (dcmtk_flock(handle_->pidx, lockmode) < 0) { + dcmtk_plockerr("DB_lock"); + return QR_EC_IndexDatabaseError; + } + return EC_Normal; +} + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::DB_unlock() +{ + if (dcmtk_flock(handle_->pidx, LOCK_UN) < 0) { + dcmtk_plockerr("DB_unlock"); + return QR_EC_IndexDatabaseError; + } + return EC_Normal; +} + +/******************* + * Free an element List + */ + +static OFCondition DB_FreeUidList (DB_UidList *lst) +{ + while (lst != NULL) { + if (lst -> patient) + free (lst -> patient); + if (lst -> study) + free (lst -> study); + if (lst -> serie) + free (lst -> serie); + if (lst -> image) + free (lst -> image); + DB_UidList *curlst = lst; + lst = lst->next; + free (curlst); + } + return EC_Normal; +} + + +/******************* + * Free a UID List + */ + +static OFCondition DB_FreeElementList (DB_ElementList *lst) +{ + if (lst == NULL) return EC_Normal; + + OFCondition cond = DB_FreeElementList (lst -> next); + if (lst->elem.PValueField != NULL) { + free ((char *) lst -> elem. PValueField); + } + delete lst; + return (cond); +} + +/******************* + * Is the specified tag supported + */ + +static int DB_TagSupported (DcmTagKey tag) +{ + int i; + + for (i = 0; i < NbFindAttr; i++) + if (TbFindAttr[i]. tag == tag) + return (OFTrue); + + return (OFFalse); + +} + +/******************* + * Get UID tag of a specified level + */ + +static OFCondition DB_GetUIDTag (DB_LEVEL level, DcmTagKey *tag) +{ + int i; + + for (i = 0; i < NbFindAttr; i++) + if ((TbFindAttr[i]. level == level) && (TbFindAttr[i]. keyAttr == UNIQUE_KEY)) + break; + + if (i < NbFindAttr) { + *tag = TbFindAttr[i].tag; + return (EC_Normal); + } + else + return (QR_EC_IndexDatabaseError); + +} + +/******************* + * Get tag level of a specified tag + */ + +static OFCondition DB_GetTagLevel (DcmTagKey tag, DB_LEVEL *level) +{ + int i; + + for (i = 0; i < NbFindAttr; i++) + if (TbFindAttr[i]. tag == tag) + break; + + if (i < NbFindAttr) { + *level = TbFindAttr[i]. level; + return (EC_Normal); + } + else + return (QR_EC_IndexDatabaseError); +} + +/******************* + * Get tag key attribute of a specified tag + */ + +static OFCondition DB_GetTagKeyAttr (DcmTagKey tag, DB_KEY_TYPE *keyAttr) +{ + int i; + + for (i = 0; i < NbFindAttr; i++) + if (TbFindAttr[i]. tag == tag) + break; + + if (i < NbFindAttr) { + *keyAttr = TbFindAttr[i]. keyAttr; + return (EC_Normal); + } + else + return (QR_EC_IndexDatabaseError); +} + +/*********************** + * Duplicate a DICOM element + * dst space is supposed provided by the caller + */ + +static void DB_DuplicateElement (DB_SmallDcmElmt *src, DB_SmallDcmElmt *dst) +{ + bzero( (char*)dst, sizeof (DB_SmallDcmElmt)); + dst -> XTag = src -> XTag; + dst -> ValueLength = src -> ValueLength; + + if (src -> ValueLength == 0) + dst -> PValueField = NULL; + else { + dst -> PValueField = (char *)malloc ((int) src -> ValueLength+1); + bzero(dst->PValueField, (size_t)(src->ValueLength+1)); + if (dst->PValueField != NULL) { + memcpy (dst -> PValueField, src -> PValueField, + (size_t) src -> ValueLength); + } else { + DCMQRDB_ERROR("DB_DuplicateElement: out of memory"); + } + } +} + + +/*********************** + * Compare two ImagesofStudyArray elements + */ + +extern "C" int DB_Compare(const void *ve1, const void *ve2) +{ + ImagesofStudyArray *e1 = (ImagesofStudyArray *)ve1; + ImagesofStudyArray *e2 = (ImagesofStudyArray *)ve2; + if ( e1 -> RecordedDate > e2 -> RecordedDate ) + return (1); + else + if ( e1 -> RecordedDate == e2 -> RecordedDate ) + return (0); + else + return (-1); + +} + + +/* ==================================================================== */ + +DcmQueryRetrieveDatabaseHandle::~DcmQueryRetrieveDatabaseHandle() +{ +} + +/* ========================= FIND ========================= */ + +// helper function to print 'ASCII' instead of an empty string for the value of +// Specific Character Set +static const char* characterSetName( const OFString& charset ) +{ + if (charset.empty()) + return "ASCII"; + return charset.c_str(); +} + +class DcmQueryRetrieveIndexDatabaseHandle::CharsetConsideringMatcher +{ +public: + + // Constructor, remember references to the find request character set and converter + CharsetConsideringMatcher(DB_Private_Handle& handle) + : findRequestCharacterSet(handle.findRequestCharacterSet) + , findRequestConverter(handle.findRequestConverter) + , candidateCharacterSet() + , candidateConverter() + , isFindRequestConversionNecessary(isConversionToUTF8Necessary(findRequestCharacterSet)) + , isCandidateConversionNecessary() + , isConversionNecessary() + { + + } + + // read access to the candidate's character set value + const OFString& getCandidateCharacterSet() const + { + return candidateCharacterSet; + } + + // prepare character set conversion for specific index record + void setRecord(IdxRecord& idxRec) + { + // copy value of specific character set of the entry, since the converter + // would need it as an OFString anyway. + candidateCharacterSet.assign(idxRec.param[RECORDIDX_SpecificCharacterSet].PValueField, + idxRec.param[RECORDIDX_SpecificCharacterSet].ValueLength); + // test if conversion is potentially necessary since the character sets differ + if (findRequestCharacterSet != candidateCharacterSet) { + // determine if the candidate is compatible to UTF-8 or must be converted + isCandidateConversionNecessary = isConversionToUTF8Necessary(candidateCharacterSet); + // if it must be converted, clear the converter if it was previously initialized, + // but for a different character set + if (isCandidateConversionNecessary && candidateConverter && + candidateConverter.getSourceCharacterSet() != candidateCharacterSet) { + candidateConverter.clear(); + } + // even if the character sets differ, they may both be compatible to UTF-8, + // in which case conversion is still not necessary + isConversionNecessary = isCandidateConversionNecessary || isFindRequestConversionNecessary; + } else { + // conversion is not necessary + isConversionNecessary = OFFalse; + } + } + + // Try to match Two DB_ElementList elements + // The first one is the query key, the second one the candidate + // from the database entry. + // Returns OFTrue if both values match, OFFalse otherwise + OFBool operator()(DB_ElementList* query, DB_SmallDcmElmt* candidate) + { + // Universal matching is applied if the query value is empty: + // always return OFTrue + if (!query->elem.ValueLength) + return OFTrue; + + OFString buffer; + const char* pQuery = query->elem.PValueField; + const char* pQueryEnd = pQuery + query->elem.ValueLength; + const char* pCandidate = candidate->PValueField; + const char* pCandidateEnd = pCandidate + candidate->ValueLength; + + DcmVR vr = DcmTag(query->elem.XTag).getVR(); + if (isConversionNecessary && vr.isAffectedBySpecificCharacterSet()) { +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + // convert query, if it isn't UTF-8 or ASCII already + if (isFindRequestConversionNecessary) { + // does a value already exist in the cache? + if (!query->utf8Value) { + // fill the cache if it doesn't + query->utf8Value = OFString(); + // initialize the converter, if this is the first + // time we need it + OFCondition cond = EC_Normal; + if (!findRequestConverter) + cond = findRequestConverter.selectCharacterSet(findRequestCharacterSet); + if (cond.good()) { + // covert the string and cache the result, using the + // specific delimitation characters for this VR + cond = findRequestConverter.convertString( + query->elem.PValueField, + query->elem.ValueLength, + *query->utf8Value, + vr.getDelimiterChars() + ); + } + if (cond.bad()) { + DCMQRDB_WARN("Character set conversion of the query key failed with the following error: '" << cond.text() + << "', will compare values that use different (incompatible) character sets: \"" + << characterSetName(findRequestCharacterSet) << "\" and \"" << characterSetName(candidateCharacterSet) << '"'); + // put the original value in the cache, since retrying the conversion on the next encounter does not make sense + // (it would only fail again). + query->utf8Value = OFString(query->elem.PValueField, query->elem.ValueLength); + } + } + // use the value from the cache for the following match + // operations + pQuery = query->utf8Value->c_str(); + pQueryEnd = pQuery + query->utf8Value->size(); + } + // convert the candidate, if it isn't already UTF-8 or ASCII + if (isCandidateConversionNecessary) { + // initialize the converter, if this is the first time + // we need it for this entry + OFCondition cond = EC_Normal; + if (!candidateConverter) + cond = candidateConverter.selectCharacterSet(candidateCharacterSet); + if (cond.good()) { + // convert the string using the local buffer and the + // specific delimitation characters for this VR + cond = candidateConverter.convertString( + candidate->PValueField, + candidate->ValueLength, + buffer, + vr.getDelimiterChars() + ); + } + if (cond.good()) { + // assign the buffer contents to the value being used + // in the following match operations + pCandidate = buffer.c_str(); + pCandidateEnd = pCandidate + buffer.size(); + } else { + DCMQRDB_WARN("Character set conversion of the candidate failed with the following error: '" << cond.text() + << "', will compare values that use different (incompatible) character sets: \"" + << characterSetName(findRequestCharacterSet) << "\" and \"" << characterSetName(candidateCharacterSet) << '"'); + } + } +#else + DCMQRDB_WARN("Character set conversion is not available, comparing values that use different (incompatible) character sets: \"" + << characterSetName(findRequestCharacterSet) << "\" and \"" << characterSetName(candidateCharacterSet) << '"'); +#endif + } + + // remove leading and trailing spaces before matching + if (vr.isaString()) { + OFStandard::trimString(pQuery, pQueryEnd); + OFStandard::trimString(pCandidate, pCandidateEnd); + } + + // use DcmAttributeMatching to perform the appropriate matching function + // for the given VR + return DcmAttributeMatching( vr )( pQuery, pQueryEnd - pQuery, + pCandidate, pCandidateEnd - pCandidate ); + } + +private: + const OFString& findRequestCharacterSet; + DcmSpecificCharacterSet& findRequestConverter; + OFString candidateCharacterSet; + DcmSpecificCharacterSet candidateConverter; + const OFBool isFindRequestConversionNecessary; + OFBool isCandidateConversionNecessary; + OFBool isConversionNecessary; +}; + +OFBool DcmQueryRetrieveIndexDatabaseHandle::isConversionToUTF8Necessary(const OFString& characterSet) +{ + // empty -> ASCII, subset of UTF-8 + // ISO_IR 6 -> ASCII, subset of UTF-8 + // ISO_IR 192 -> UTF-8 + return !characterSet.empty() && + characterSet != "ISO_IR 192" && + characterSet != "ISO_IR 6" + ; +} + +OFBool DcmQueryRetrieveIndexDatabaseHandle::isConversionNecessary(const OFString& sourceCharacterSet, + const OFString& destinationCharacterSet) +{ + // conversion is unnecessary if both are the same character set or if + // the destination is UTF-8 and the source is compatible to UTF-8 + // (i.e. ASCII). + return sourceCharacterSet != destinationCharacterSet && + ( + destinationCharacterSet != "ISO_IR 192" || + isConversionToUTF8Necessary(sourceCharacterSet) + ); +} + +/************ +** Create the response list in specified handle, +** using informations found in an index record. +** Old response list is supposed freed +**/ + +void DcmQueryRetrieveIndexDatabaseHandle::makeResponseList ( + DB_Private_Handle *phandle, + IdxRecord *idxRec + ) +{ + int i ; + DB_ElementList *pRequestList = NULL; + DB_ElementList *plist = NULL; + DB_ElementList *last = NULL; + + phandle->findResponseList = NULL ; + + /*** For each element in Request identifier + **/ + + for (pRequestList = phandle->findRequestList ; pRequestList ; pRequestList = pRequestList->next) { + + /*** Find Corresponding Tag in index record + **/ + + for (i = 0 ; i < NBPARAMETERS ; i++) + if (idxRec->param [i]. XTag == pRequestList->elem. XTag) + break ; + + /*** If Tag not found, skip the element + **/ + + if (i >= NBPARAMETERS) + continue ; + + /*** Append index record element to response list + **/ + + plist = new DB_ElementList ; + if (plist == NULL) { + DCMQRDB_ERROR("makeResponseList: out of memory"); + return; + } + + DB_DuplicateElement(&idxRec->param[i], &plist->elem); + + if (phandle->findResponseList == NULL) { + phandle->findResponseList = last = plist ; + } + else { + last->next = plist ; + last = plist ; + } + + } + + /** Specific Character Set stuff + **/ + + if (idxRec->param[RECORDIDX_SpecificCharacterSet].ValueLength) { + plist = new DB_ElementList ; + if (plist == NULL) { + DCMQRDB_ERROR("makeResponseList: out of memory"); + return; + } + + DB_DuplicateElement(&idxRec->param[RECORDIDX_SpecificCharacterSet], &plist->elem); + + if (phandle->findResponseList == NULL) { + phandle->findResponseList = last = plist ; + } + else { + last->next = plist ; + last = plist ; + } + } +} + + + +/************ +** Test a Find Request List +** Returns EC_Normal if OK, else returns QR_EC_IndexDatabaseError + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::testFindRequestList ( + DB_ElementList *findRequestList, + DB_LEVEL queryLevel, + DB_LEVEL infLevel, + DB_LEVEL lowestLevel + ) +{ + DB_ElementList *plist ; + DB_LEVEL XTagLevel = PATIENT_LEVEL; // DB_GetTagLevel() will set this correctly + DB_KEY_TYPE XTagType = OPTIONAL_KEY; // DB_GetTagKeyAttr() will set this + int level ; + + /**** Query level must be at least the infLevel + ***/ + + if (queryLevel < infLevel) { + DCMQRDB_INFO("Level incompatible with Information Model (level " << queryLevel << ")"); + return QR_EC_IndexDatabaseError ; + } + + if (queryLevel > lowestLevel) { + DCMQRDB_DEBUG("Level incompatible with Information Model (level " << queryLevel << ")"); + return QR_EC_IndexDatabaseError ; + } + + for (level = PATIENT_LEVEL ; level <= IMAGE_LEVEL ; level++) { + + /**** Manage exception due to StudyRoot Information Model : + **** In this information model, queries may include Patient attributes + **** but only if they are made at the study level + ***/ + + if ((level == PATIENT_LEVEL) && (infLevel == STUDY_LEVEL)) { + /** In Study Root Information Model, accept only Patient Tags + ** if the Query Level is the Study level + */ + + int atLeastOneKeyFound = OFFalse ; + for (plist = findRequestList ; plist ; plist = plist->next) { + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + if (XTagLevel != level) + continue ; + atLeastOneKeyFound = OFTrue ; + } + if (atLeastOneKeyFound && (queryLevel != STUDY_LEVEL)) { + DCMQRDB_DEBUG("Key found in Study Root Information Model (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + } + + /**** If current level is above the QueryLevel + ***/ + + else if (level < queryLevel) { + + /** For this level, only unique keys are allowed + ** Parse the request list elements referring to + ** this level. + ** Check that only unique key attr are provided + */ + + int uniqueKeyFound = OFFalse ; + for (plist = findRequestList ; plist ; plist = plist->next) { + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + if (XTagLevel != level) + continue ; + DB_GetTagKeyAttr (plist->elem. XTag, &XTagType) ; + if (XTagType != UNIQUE_KEY) { + DCMQRDB_DEBUG("Non Unique Key found (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + else if (uniqueKeyFound) { + DCMQRDB_DEBUG("More than one Unique Key found (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + else + uniqueKeyFound = OFTrue ; + } + } + + /**** If current level is the QueryLevel + ***/ + + else if (level == queryLevel) { + + /** For this level, all keys are allowed + ** Parse the request list elements referring to + ** this level. + ** Check that at least one key is provided + */ + + int atLeastOneKeyFound = OFFalse ; + for (plist = findRequestList ; plist ; plist = plist->next) { + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + if (XTagLevel != level) + continue ; + atLeastOneKeyFound = OFTrue ; + } + if (! atLeastOneKeyFound) { + DCMQRDB_DEBUG("No Key found at query level (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + } + + /**** If current level beyond the QueryLevel + ***/ + + else if (level > queryLevel) { + + /** For this level, no key is allowed + ** Parse the request list elements referring to + ** this level. + ** Check that no key is provided + */ + + int atLeastOneKeyFound = OFFalse ; + for (plist = findRequestList ; plist ; plist = plist->next) { + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + if (XTagLevel != level) + continue ; + atLeastOneKeyFound = OFTrue ; + } + if (atLeastOneKeyFound) { + DCMQRDB_DEBUG("Key found beyond query level (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + } + + } + return EC_Normal ; +} + + +/************ +** Hierarchical Search Algorithm +** Returns OFTrue if matching is OK, else returns OFFalse + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::hierarchicalCompare ( + DB_Private_Handle *phandle, + IdxRecord *idxRec, + DB_LEVEL level, + DB_LEVEL infLevel, + int *match, + CharsetConsideringMatcher& dbmatch) +{ + int i ; + DcmTagKey XTag ; + DB_ElementList *plist ; + DB_LEVEL XTagLevel = PATIENT_LEVEL; // DB_GetTagLevel() will set this correctly + + /**** If current level is above the QueryLevel + ***/ + + if (level < phandle->queryLevel) { + + /** Get UID Tag for current level + */ + + DB_GetUIDTag (level, &XTag) ; + + /** Find Element with this XTag in Identifier list + */ + + for (plist = phandle->findRequestList ; plist ; plist = plist->next) + if (plist->elem. XTag == XTag) + break ; + + /** Element not found + */ + + if (plist == NULL) { + *match = OFFalse ; + DCMQRDB_WARN("hierarchicalCompare : No UID Key found at level " << (int) level); + return QR_EC_IndexDatabaseError ; + } + + /** Find element with the same XTag in index record + */ + + for (i = 0 ; i < NBPARAMETERS ; i++) + if (idxRec->param [i]. XTag == XTag) + break ; + + /** Compare with Single value matching + ** If Match fails, return OFFalse + */ + + if (!dbmatch(plist, &idxRec->param[i])) { + *match = OFFalse ; + return EC_Normal ; + } + + /** Match succeeded. + ** Try at next level + */ + + return hierarchicalCompare (phandle, idxRec, (DB_LEVEL)(level + 1), infLevel, match, dbmatch) ; + } + + /**** If current level is the QueryLevel + ***/ + + else if (level == phandle->queryLevel) { + + /*** For each element in Identifier list + **/ + + for (plist = phandle->findRequestList ; plist ; plist = plist->next) { + + /** Get the Tag level of this element + */ + + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + + /** If we are in the Study Root Information Model exception + ** we must accept patients keys at the study level + */ + + if ( (XTagLevel == PATIENT_LEVEL) + && (phandle->queryLevel == STUDY_LEVEL) + && (infLevel == STUDY_LEVEL) + ) ; + + /** In other cases, only keys at the current level are + ** taken into account. So skip this element. + */ + + else if (XTagLevel != level) + continue ; + + /** Find element with the same XTag in index record + */ + + for (i = 0 ; i < NBPARAMETERS ; i++) + if (idxRec->param [i]. XTag == plist->elem. XTag) + break ; + + /** Compare with appropriate Matching. + ** If Match fails, return OFFalse + */ + + + if (!dbmatch(plist, &idxRec->param[i])) { + *match = OFFalse ; + return EC_Normal ; + } + } + + /*** If we are here, all matches succeeded at the current level. + *** Perhaps check that we have tried at least one match ?? + **/ + + *match = OFTrue ; + return EC_Normal ; + + } + return QR_EC_IndexDatabaseError; +} + +/******************** +** Start find in Database +**/ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::startFindRequest( + const char *SOPClassUID, + DcmDataset *findRequestIdentifiers, + DcmQueryRetrieveDatabaseStatus *status) +{ + DB_SmallDcmElmt elem ; + DB_ElementList *plist = NULL; + DB_ElementList *last = NULL; + int MatchFound ; + IdxRecord idxRec ; + DB_LEVEL qLevel = PATIENT_LEVEL; // highest legal level for a query in the current model + DB_LEVEL lLevel = IMAGE_LEVEL; // lowest legal level for a query in the current model + + OFCondition cond = EC_Normal; + OFBool qrLevelFound = OFFalse; + + /**** Is SOPClassUID supported ? + ***/ + + if (strcmp( SOPClassUID, UID_FINDPatientRootQueryRetrieveInformationModel) == 0) + handle_->rootLevel = PATIENT_ROOT ; + else if (strcmp( SOPClassUID, UID_FINDStudyRootQueryRetrieveInformationModel) == 0) + handle_->rootLevel = STUDY_ROOT ; +#ifndef NO_PATIENTSTUDYONLY_SUPPORT + else if (strcmp( SOPClassUID, UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel) == 0) + handle_->rootLevel = PATIENT_STUDY ; +#endif + else { + status->setStatus(STATUS_FIND_Refused_SOPClassNotSupported); + return (QR_EC_IndexDatabaseError) ; + } + + /**** Parse Identifiers in the Dicom Object + **** Find Query Level and construct a list + **** of query identifiers + ***/ + + if (findRequestIdentifiers->findAndGetOFStringArray(DCM_SpecificCharacterSet, handle_->findRequestCharacterSet).bad()) + handle_->findRequestCharacterSet.clear(); + if (handle_->findRequestConverter && handle_->findRequestConverter.getSourceCharacterSet() != handle_->findRequestCharacterSet) + handle_->findRequestConverter.clear(); + + handle_->findRequestList = NULL ; + + int elemCount = OFstatic_cast(int, findRequestIdentifiers->card()); + for (int elemIndex=0; elemIndexgetElement(elemIndex); + + elem.XTag = dcelem->getTag().getXTag(); + if (elem.XTag == DCM_QueryRetrieveLevel || DB_TagSupported(elem.XTag)) { + elem.ValueLength = dcelem->getLength(); + if (elem.ValueLength == 0) { + elem.PValueField = NULL ; + } else if ((elem.PValueField = OFstatic_cast(char*, malloc(OFstatic_cast(size_t, elem.ValueLength+1)))) == NULL) { + status->setStatus(STATUS_FIND_Refused_OutOfResources); + return (QR_EC_IndexDatabaseError) ; + } else { + /* only char string type tags are supported at the moment */ + char *s = NULL; + dcelem->getString(s); + /* the available space is always elem.ValueLength+1 */ + OFStandard::strlcpy(elem.PValueField, s, elem.ValueLength+1); + } + /** If element is the Query Level, store it in handle + */ + + if (elem.XTag == DCM_QueryRetrieveLevel && elem.PValueField) { + char *pc ; + char level [50] ; + + strncpy(level, (char*)elem.PValueField, + (elem.ValueLength<50)? (size_t)(elem.ValueLength) : 49) ; + + /*** Skip this two lines if you want strict comparison + **/ + + for (pc = level ; *pc ; pc++) + *pc = ((*pc >= 'a') && (*pc <= 'z')) ? 'A' - 'a' + *pc : *pc ; + + if (strncmp (level, PATIENT_LEVEL_STRING, + strlen (PATIENT_LEVEL_STRING)) == 0) + handle_->queryLevel = PATIENT_LEVEL ; + else if (strncmp (level, STUDY_LEVEL_STRING, + strlen (STUDY_LEVEL_STRING)) == 0) + handle_->queryLevel = STUDY_LEVEL ; + else if (strncmp (level, SERIE_LEVEL_STRING, + strlen (SERIE_LEVEL_STRING)) == 0) + handle_->queryLevel = SERIE_LEVEL ; + else if (strncmp (level, IMAGE_LEVEL_STRING, + strlen (IMAGE_LEVEL_STRING)) == 0) + handle_->queryLevel = IMAGE_LEVEL ; + else { + if (elem. PValueField) + free (elem. PValueField) ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startFindRequest () : Illegal query level (" << level << ")"); +#endif + status->setStatus(STATUS_FIND_Failed_UnableToProcess); + return (QR_EC_IndexDatabaseError) ; + } + qrLevelFound = OFTrue; + } else { + /** Else it is a query identifier. + ** Append it to our RequestList if it is supported + */ + if (DB_TagSupported (elem. XTag)) { + + plist = new DB_ElementList ; + if (plist == NULL) { + status->setStatus(STATUS_FIND_Refused_OutOfResources); + return (QR_EC_IndexDatabaseError) ; + } + DB_DuplicateElement (&elem, &(plist->elem)) ; + if (handle_->findRequestList == NULL) { + handle_->findRequestList = last = plist ; + } else { + last->next = plist ; + last = plist ; + } + } + } + + if ( elem. PValueField ) { + free (elem. PValueField) ; + } + } + } + + if (!qrLevelFound) { + /* The Query/Retrieve Level is missing */ + status->setStatus(STATUS_FIND_Failed_IdentifierDoesNotMatchSOPClass); + DCMQRDB_WARN("DB_startFindRequest(): missing Query/Retrieve Level"); + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; + return (QR_EC_IndexDatabaseError) ; + } + + switch (handle_->rootLevel) + { + case PATIENT_ROOT : + qLevel = PATIENT_LEVEL ; + lLevel = IMAGE_LEVEL ; + break ; + case STUDY_ROOT : + qLevel = STUDY_LEVEL ; + lLevel = IMAGE_LEVEL ; + break ; + case PATIENT_STUDY: + qLevel = PATIENT_LEVEL ; + lLevel = STUDY_LEVEL ; + break ; + } + + /**** Test the consistency of the request list + ***/ + + if (doCheckFindIdentifier) { + cond = testFindRequestList (handle_->findRequestList, handle_->queryLevel, qLevel, lLevel) ; + if (cond != EC_Normal) { + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startFindRequest () : STATUS_FIND_Failed_IdentifierDoesNotMatchSOPClass - Invalid RequestList"); +#endif + status->setStatus(STATUS_FIND_Failed_IdentifierDoesNotMatchSOPClass); + return (cond) ; + } + } + + /**** Goto the beginning of Index File + **** Then find the first matching image + ***/ + + DB_lock(OFFalse); + + DB_IdxInitLoop (&(handle_->idxCounter)) ; + MatchFound = OFFalse ; + cond = EC_Normal ; + + CharsetConsideringMatcher dbmatch(*handle_); + while (1) { + + /*** Exit loop if read error (or end of file) + **/ + + if (DB_IdxGetNext (&(handle_->idxCounter), &idxRec) != EC_Normal) + break ; + + /*** Exit loop if error or matching OK + **/ + + dbmatch.setRecord(idxRec); + cond = hierarchicalCompare (handle_, &idxRec, qLevel, qLevel, &MatchFound, dbmatch) ; + if (cond != EC_Normal) + break ; + if (MatchFound) + break ; + } + + /**** If an error occurred in Matching function + **** return a failed status + ***/ + + if (cond != EC_Normal) { + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startFindRequest () : STATUS_FIND_Failed_UnableToProcess"); +#endif + status->setStatus(STATUS_FIND_Failed_UnableToProcess); + + DB_unlock(); + + return (cond) ; + } + + + /**** If a matching image has been found, + **** add index record to UID found list + **** prepare Response List in handle + **** return status is pending + ***/ + + if (MatchFound) { + DB_UIDAddFound (handle_, &idxRec) ; + makeResponseList (handle_, &idxRec) ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startFindRequest () : STATUS_Pending"); +#endif + status->setStatus(STATUS_Pending); + return (EC_Normal) ; + } + + /**** else no matching image has been found, + **** free query identifiers list + **** status is success + ***/ + + else { + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startFindRequest () : STATUS_Success"); +#endif + status->setStatus(STATUS_Success); + + DB_unlock(); + + return (EC_Normal) ; + } + +} + +/******************** +** Get next find response in Database + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::nextFindResponse ( + DcmDataset **findResponseIdentifiers, + DcmQueryRetrieveDatabaseStatus *status, + const DcmQueryRetrieveCharacterSetOptions& characterSetOptions) +{ + + DB_ElementList *plist = NULL; + int MatchFound = OFFalse; + IdxRecord idxRec ; + DB_LEVEL qLevel = PATIENT_LEVEL; + const char *queryLevelString = NULL; + OFCondition cond = EC_Normal; + + if (handle_->findResponseList == NULL) { +#ifdef DEBUG + DCMQRDB_DEBUG("DB_nextFindResponse () : STATUS_Success"); +#endif + *findResponseIdentifiers = NULL ; + status->setStatus(STATUS_Success); + + DB_unlock(); + + return (EC_Normal) ; + } + + /***** Create the response (findResponseIdentifiers) using + ***** the last find done and saved in handle findResponseList + ****/ + + *findResponseIdentifiers = new DcmDataset ; + if ( *findResponseIdentifiers != NULL ) { + + /*** Put responses + **/ + + for ( plist = handle_->findResponseList ; plist != NULL ; plist = plist->next ) { + DcmTag t(plist->elem.XTag); + DcmElement *dce = DcmItem::newDicomElement(t); + if (dce == NULL) { + status->setStatus(STATUS_FIND_Refused_OutOfResources); + return QR_EC_IndexDatabaseError; + } + if (plist->elem.PValueField != NULL && + strlen(plist->elem.PValueField) > 0) { + OFCondition ec = dce->putString(plist->elem.PValueField); + if (ec != EC_Normal) { + DCMQRDB_WARN("dbfind: DB_nextFindResponse: cannot put()"); + status->setStatus(STATUS_FIND_Failed_UnableToProcess); + return QR_EC_IndexDatabaseError; + } + } + OFCondition ec = (*findResponseIdentifiers)->insert(dce, OFTrue /*replaceOld*/); + if (ec != EC_Normal) { + DCMQRDB_WARN("dbfind: DB_nextFindResponse: cannot insert()"); + status->setStatus(STATUS_FIND_Failed_UnableToProcess); + return QR_EC_IndexDatabaseError; + } + } + + /*** Append the Query level + **/ + + switch (handle_->queryLevel) { + case PATIENT_LEVEL : + queryLevelString = PATIENT_LEVEL_STRING ; + break ; + case STUDY_LEVEL : + queryLevelString = STUDY_LEVEL_STRING ; + break ; + case SERIE_LEVEL : + queryLevelString = SERIE_LEVEL_STRING ; + break ; + case IMAGE_LEVEL : + queryLevelString = IMAGE_LEVEL_STRING ; + break ; + } + DU_putStringDOElement(*findResponseIdentifiers, + DCM_QueryRetrieveLevel, queryLevelString); + +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + OFString specificCharacterSet; + if ((*findResponseIdentifiers)->findAndGetOFStringArray(DCM_SpecificCharacterSet, specificCharacterSet).bad()) + specificCharacterSet.clear(); + + const OFString* destinationCharacterSet = NULL; + const OFString* fallbackCharacterSet = NULL; + + if (characterSetOptions.flags & DcmQueryRetrieveCharacterSetOptions::Override) { + destinationCharacterSet = &characterSetOptions.characterSet; + if ( + (characterSetOptions.flags & DcmQueryRetrieveCharacterSetOptions::Fallback) && + characterSetOptions.characterSet != handle_->findRequestCharacterSet + ) { + fallbackCharacterSet = &handle_->findRequestCharacterSet; + } + } else { + destinationCharacterSet = &handle_->findRequestCharacterSet; + if ( + (characterSetOptions.flags & DcmQueryRetrieveCharacterSetOptions::Fallback) && + characterSetOptions.characterSet != handle_->findRequestCharacterSet + ) { + fallbackCharacterSet = &characterSetOptions.characterSet; + } + } + + if (isConversionNecessary(specificCharacterSet, *destinationCharacterSet)) { + OFCondition status = (*findResponseIdentifiers)->convertCharacterSet( + specificCharacterSet, + *destinationCharacterSet, + characterSetOptions.conversionFlags, + OFTrue); + if (status.bad()) { + DCMQRDB_WARN("Converting response from character set \"" + << characterSetName(specificCharacterSet) + << "\" to character set \"" + << characterSetName(*destinationCharacterSet) + << "\" failed, (error message: " << status.text() << ')'); + if (fallbackCharacterSet && isConversionNecessary(specificCharacterSet, *fallbackCharacterSet)) { + DCMQRDB_INFO("Trying to convert response from character set \"" + << characterSetName(specificCharacterSet) + << "\" to fall-back character set \"" + << characterSetName(*fallbackCharacterSet) << "\" instead"); + status = (*findResponseIdentifiers)->convertCharacterSet( + specificCharacterSet, + *fallbackCharacterSet, + characterSetOptions.conversionFlags, + OFTrue); + if (status.bad()) { + DCMQRDB_WARN("Converting response from character set \"" + << characterSetName(specificCharacterSet) + << "\" to character set \"" + << characterSetName(*fallbackCharacterSet) + << "\" failed, (error message: " << status.text() << ')'); + } else { + DCMQRDB_INFO("Successfully converted response from character set \"" + << characterSetName(specificCharacterSet) + << "\" to character set \"" + << characterSetName(*fallbackCharacterSet) << "\""); + } + } else if (fallbackCharacterSet) { + DCMQRDB_INFO("Conversion to fall-back character set \"" + << characterSetName(*fallbackCharacterSet) + << "\" is not necessary, since the original character set is compatible"); + } + } else { + DCMQRDB_INFO("Successfully converted response from character set \"" + << characterSetName(specificCharacterSet) + << "\" to character set \"" + << characterSetName(*destinationCharacterSet) + << "\""); + } + } +#endif + +#ifdef DEBUG + DCMQRDB_DEBUG("DB: findResponseIdentifiers:" << OFendl + << DcmObject::PrintHelper(**findResponseIdentifiers)); +#endif + } else { + + DB_unlock(); + + return (QR_EC_IndexDatabaseError) ; + } + + switch (handle_->rootLevel) { + case PATIENT_ROOT : qLevel = PATIENT_LEVEL ; break ; + case STUDY_ROOT : qLevel = STUDY_LEVEL ; break ; + case PATIENT_STUDY: qLevel = PATIENT_LEVEL ; break ; + } + + /***** Free the last response... + ****/ + + DB_FreeElementList (handle_->findResponseList) ; + handle_->findResponseList = NULL ; + + /***** ... and find the next one + ****/ + + MatchFound = OFFalse ; + cond = EC_Normal ; + + CharsetConsideringMatcher dbmatch(*handle_); + while (1) { + + /*** Exit loop if read error (or end of file) + **/ + + if (DB_IdxGetNext (&(handle_->idxCounter), &idxRec) != EC_Normal) + break ; + + /*** If Response already found + **/ + + if (DB_UIDAlreadyFound (handle_, &idxRec)) + continue ; + + /*** Exit loop if error or matching OK + **/ + + dbmatch.setRecord(idxRec); + cond = hierarchicalCompare (handle_, &idxRec, qLevel, qLevel, &MatchFound, dbmatch) ; + if (cond != EC_Normal) + break ; + if (MatchFound) + break ; + + } + + /**** If an error occured in Matching function + **** return status is pending + ***/ + + if (cond != EC_Normal) { + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_nextFindResponse () : STATUS_FIND_Failed_UnableToProcess"); +#endif + status->setStatus(STATUS_FIND_Failed_UnableToProcess); + + DB_unlock(); + + return (cond) ; + } + + /**** If a matching image has been found + **** add index records UIDs in found UID list + **** prepare Response List in handle + ***/ + + if (MatchFound) { + DB_UIDAddFound (handle_, &idxRec) ; + makeResponseList (handle_, &idxRec) ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_nextFindResponse () : STATUS_Pending"); +#endif + status->setStatus(STATUS_Pending); + return (EC_Normal) ; + } + + /**** else no matching image has been found, + **** free query identifiers list + **** Response list is null, so next call will return STATUS_Success + ***/ + + else { + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; + DB_FreeUidList (handle_->uidList) ; + handle_->uidList = NULL ; + } + +#ifdef DEBUG + DCMQRDB_DEBUG("DB_nextFindResponse () : STATUS_Pending"); +#endif + status->setStatus(STATUS_Pending); + return (EC_Normal) ; +} + +/******************** +** Cancel find request + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::cancelFindRequest (DcmQueryRetrieveDatabaseStatus *status) +{ + + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; + DB_FreeElementList (handle_->findResponseList) ; + handle_->findResponseList = NULL ; + DB_FreeUidList (handle_->uidList) ; + handle_->uidList = NULL ; + + status->setStatus(STATUS_FIND_Cancel_MatchingTerminatedDueToCancelRequest); + + DB_unlock(); + + return (EC_Normal) ; +} + +/* ========================= MOVE ========================= */ + +/************ + * Test a Move Request List + * Returns EC_Normal if OK, else returns QR_EC_IndexDatabaseError + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::testMoveRequestList ( + DB_ElementList *findRequestList, + DB_LEVEL queryLevel, + DB_LEVEL infLevel, + DB_LEVEL lowestLevel + ) +{ + DB_ElementList *plist ; + DB_LEVEL XTagLevel = PATIENT_LEVEL; // DB_GetTagLevel() will set this correctly + DB_KEY_TYPE XTagType = OPTIONAL_KEY; // DB_GetTagKeyAttr() will set this + int level ; + + /**** Query level must be at least the infLevel + ***/ + + if (queryLevel < infLevel) { + DCMQRDB_DEBUG("Level incompatible with Information Model (level " << (int)queryLevel << ")"); + return QR_EC_IndexDatabaseError ; + } + + if (queryLevel > lowestLevel) { + DCMQRDB_DEBUG("Level incompatible with Information Model (level " << (int)queryLevel << ")"); + return QR_EC_IndexDatabaseError ; + } + + for (level = PATIENT_LEVEL ; level <= IMAGE_LEVEL ; level++) { + + /**** Manage exception due to StudyRoot Information Model : + **** In this information model, move may not include any + **** Patient attributes. + ***/ + + if ((level == PATIENT_LEVEL) && (infLevel == STUDY_LEVEL)) { + + /** In Study Root Information Model, do not accept any + ** Patient Tag + */ + + int atLeastOneKeyFound = OFFalse ; + for (plist = findRequestList ; plist ; plist = plist->next) { + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + if (XTagLevel != level) + continue ; + atLeastOneKeyFound = OFTrue ; + } + if (atLeastOneKeyFound) { + DCMQRDB_DEBUG("Key found in Study Root Information Model (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + } + + /**** If current level is above or equal to the QueryLevel + ***/ + + else if (level <= queryLevel) { + + /** For these levels, only unique keys are allowed + ** Parse the request list elements referring to + ** this level. + ** Check that only unique key attr are provided + */ + + int uniqueKeyFound = OFFalse ; + for (plist = findRequestList ; plist ; plist = plist->next) { + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + if (XTagLevel != level) + continue ; + DB_GetTagKeyAttr (plist->elem. XTag, &XTagType) ; + if (XTagType != UNIQUE_KEY) { + DCMQRDB_DEBUG("Non Unique Key found (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + else if (uniqueKeyFound) { + DCMQRDB_DEBUG("More than one Unique Key found (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + else + uniqueKeyFound = OFTrue ; + } + if (! uniqueKeyFound) { + DCMQRDB_DEBUG("No Unique Key found (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + } + + /**** If current level beyond the QueryLevel + ***/ + + else if (level > queryLevel) { + + /** For this level, no key is allowed + ** Parse the request list elements referring to + ** this level. + ** Check that no key is provided + */ + + int atLeastOneKeyFound = OFFalse ; + for (plist = findRequestList ; plist ; plist = plist->next) { + DB_GetTagLevel (plist->elem. XTag, &XTagLevel) ; + if (XTagLevel != level) + continue ; + atLeastOneKeyFound = OFTrue ; + } + if (atLeastOneKeyFound) { + DCMQRDB_DEBUG("Key found beyond query level (level " << level << ")"); + return QR_EC_IndexDatabaseError ; + } + } + + } + return EC_Normal ; +} + + + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::startMoveRequest( + const char *SOPClassUID, + DcmDataset *moveRequestIdentifiers, + DcmQueryRetrieveDatabaseStatus *status) +{ + + DB_SmallDcmElmt elem ; + DB_ElementList *plist = NULL; + DB_ElementList *last = NULL; + DB_CounterList *pidxlist = NULL; + DB_CounterList *lastidxlist = NULL; + int MatchFound = OFFalse; + IdxRecord idxRec ; + DB_LEVEL qLevel = PATIENT_LEVEL; // highest legal level for a query in the current model + DB_LEVEL lLevel = IMAGE_LEVEL; // lowest legal level for a query in the current model + OFCondition cond = EC_Normal; + OFBool qrLevelFound = OFFalse; + + /**** Is SOPClassUID supported ? + ***/ + + if (strcmp( SOPClassUID, UID_MOVEPatientRootQueryRetrieveInformationModel) == 0) + handle_->rootLevel = PATIENT_ROOT ; + else if (strcmp( SOPClassUID, UID_MOVEStudyRootQueryRetrieveInformationModel) == 0) + handle_->rootLevel = STUDY_ROOT ; +#ifndef NO_PATIENTSTUDYONLY_SUPPORT + else if (strcmp( SOPClassUID, UID_RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel) == 0) + handle_->rootLevel = PATIENT_STUDY ; +#endif +#ifndef NO_GET_SUPPORT + /* experimental support for GET */ + else if (strcmp( SOPClassUID, UID_GETPatientRootQueryRetrieveInformationModel) == 0) + handle_->rootLevel = PATIENT_ROOT ; + else if (strcmp( SOPClassUID, UID_GETStudyRootQueryRetrieveInformationModel) == 0) + handle_->rootLevel = STUDY_ROOT ; +#ifndef NO_PATIENTSTUDYONLY_SUPPORT + else if (strcmp( SOPClassUID, UID_RETIRED_GETPatientStudyOnlyQueryRetrieveInformationModel) == 0) + handle_->rootLevel = PATIENT_STUDY ; +#endif +#endif + + else { + status->setStatus(STATUS_MOVE_Failed_SOPClassNotSupported); + return (QR_EC_IndexDatabaseError) ; + } + + + /**** Parse Identifiers in the Dicom Object + **** Find Query Level and construct a list + **** of query identifiers + ***/ + + int elemCount = (int)(moveRequestIdentifiers->card()); + for (int elemIndex=0; elemIndexgetElement(elemIndex); + + elem.XTag = dcelem->getTag().getXTag(); + if (elem.XTag == DCM_QueryRetrieveLevel || DB_TagSupported(elem.XTag)) { + elem.ValueLength = dcelem->getLength(); + if (elem.ValueLength == 0) { + elem.PValueField = NULL ; + } else if ((elem.PValueField = (char*)malloc((size_t)(elem.ValueLength+1))) == NULL) { + status->setStatus(STATUS_MOVE_Failed_UnableToProcess); + return (QR_EC_IndexDatabaseError) ; + } else { + /* only char string type tags are supported at the moment */ + char *s = NULL; + dcelem->getString(s); + /* the available space is always elem.ValueLength+1 */ + OFStandard::strlcpy(elem.PValueField, s, elem.ValueLength+1); + } + + /** If element is the Query Level, store it in handle + */ + + if (elem. XTag == DCM_QueryRetrieveLevel && elem.PValueField) { + char *pc ; + char level [50] ; + + strncpy (level, (char *) elem. PValueField, (size_t)((elem. ValueLength < 50) ? elem. ValueLength : 49)) ; + + /*** Skip this two lines if you want strict comparison + **/ + + for (pc = level ; *pc ; pc++) + *pc = ((*pc >= 'a') && (*pc <= 'z')) ? 'A' - 'a' + *pc : *pc ; + + if (strncmp (level, PATIENT_LEVEL_STRING, + strlen (PATIENT_LEVEL_STRING)) == 0) + handle_->queryLevel = PATIENT_LEVEL ; + else if (strncmp (level, STUDY_LEVEL_STRING, + strlen (STUDY_LEVEL_STRING)) == 0) + handle_->queryLevel = STUDY_LEVEL ; + else if (strncmp (level, SERIE_LEVEL_STRING, + strlen (SERIE_LEVEL_STRING)) == 0) + handle_->queryLevel = SERIE_LEVEL ; + else if (strncmp (level, IMAGE_LEVEL_STRING, + strlen (IMAGE_LEVEL_STRING)) == 0) + handle_->queryLevel = IMAGE_LEVEL ; + else { +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startMoveRequest : STATUS_MOVE_Failed_UnableToProcess"); +#endif + status->setStatus(STATUS_MOVE_Failed_UnableToProcess); + return (QR_EC_IndexDatabaseError) ; + } + qrLevelFound = OFTrue; + } else { + /** Else it is a query identifier + ** Append it to our RequestList + */ + if (! DB_TagSupported (elem. XTag)) + continue ; + + plist = new DB_ElementList ; + if (plist == NULL) { + status->setStatus(STATUS_FIND_Refused_OutOfResources); + return (QR_EC_IndexDatabaseError) ; + } + DB_DuplicateElement (&elem, & (plist->elem)) ; + if (handle_->findRequestList == NULL) { + handle_->findRequestList = last = plist ; + } else { + last->next = plist ; + last = plist ; + } + } + + if ( elem. PValueField ) { + free (elem. PValueField) ; + } + } + } + + if (!qrLevelFound) { + /* The Query/Retrieve Level is missing */ + status->setStatus(STATUS_MOVE_Failed_IdentifierDoesNotMatchSOPClass); + DCMQRDB_WARN("DB_startMoveRequest(): missing Query/Retrieve Level"); + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; + return (QR_EC_IndexDatabaseError) ; + } + + switch (handle_->rootLevel) + { + case PATIENT_ROOT : + qLevel = PATIENT_LEVEL ; + lLevel = IMAGE_LEVEL ; + break ; + case STUDY_ROOT : + qLevel = STUDY_LEVEL ; + lLevel = IMAGE_LEVEL ; + break ; + case PATIENT_STUDY: + qLevel = PATIENT_LEVEL ; + lLevel = STUDY_LEVEL ; + break ; + } + + /**** Test the consistency of the request list + ***/ + + if (doCheckMoveIdentifier) { + cond = testMoveRequestList (handle_->findRequestList, + handle_->queryLevel, qLevel, lLevel) ; + if (cond != EC_Normal) { + handle_->idxCounter = -1 ; + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startMoveRequest () : STATUS_MOVE_Failed_IdentifierDoesNotMatchSOPClass - Invalid RequestList"); +#endif + status->setStatus(STATUS_MOVE_Failed_IdentifierDoesNotMatchSOPClass); + return (cond) ; + } + } + + /**** Goto the beginning of Index File + **** Then find all matching images + ***/ + + MatchFound = OFFalse ; + handle_->moveCounterList = NULL ; + handle_->NumberRemainOperations = 0 ; + + /**** Find matching images + ***/ + + DB_lock(OFFalse); + + CharsetConsideringMatcher dbmatch(*handle_); + DB_IdxInitLoop (&(handle_->idxCounter)) ; + while (1) { + + /*** Exit loop if read error (or end of file) + **/ + + if (DB_IdxGetNext (&(handle_->idxCounter), &idxRec) != EC_Normal) + break ; + + /*** If matching found + **/ + + dbmatch.setRecord(idxRec); + cond = hierarchicalCompare (handle_, &idxRec, qLevel, qLevel, &MatchFound, dbmatch) ; + if (MatchFound) { + pidxlist = (DB_CounterList *) malloc (sizeof( DB_CounterList ) ) ; + if (pidxlist == NULL) { + status->setStatus(STATUS_FIND_Refused_OutOfResources); + return (QR_EC_IndexDatabaseError) ; + } + + pidxlist->next = NULL ; + pidxlist->idxCounter = handle_->idxCounter ; + handle_->NumberRemainOperations++ ; + if ( handle_->moveCounterList == NULL ) + handle_->moveCounterList = lastidxlist = pidxlist ; + else { + lastidxlist->next = pidxlist ; + lastidxlist = pidxlist ; + } + } + } + + DB_FreeElementList (handle_->findRequestList) ; + handle_->findRequestList = NULL ; + + /**** If a matching image has been found, + **** status is pending + ***/ + + if ( handle_->NumberRemainOperations > 0 ) { +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startMoveRequest : STATUS_Pending"); +#endif + status->setStatus(STATUS_Pending); + return (EC_Normal) ; + } + + /**** else no matching image has been found, + **** free query identifiers list + **** status is success + ***/ + + else { + handle_->idxCounter = -1 ; +#ifdef DEBUG + DCMQRDB_DEBUG("DB_startMoveRequest : STATUS_Success"); +#endif + status->setStatus(STATUS_Success); + + DB_unlock(); + + return (EC_Normal) ; + } + + +} + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::nextMoveResponse( + char *SOPClassUID, + size_t SOPClassUIDSize, + char *SOPInstanceUID, + size_t SOPInstanceUIDSize, + char *imageFileName, + size_t imageFileNameSize, + unsigned short *numberOfRemainingSubOperations, + DcmQueryRetrieveDatabaseStatus *status) +{ + IdxRecord idxRec ; + DB_CounterList *nextlist ; + + /**** If all matching images have been retrieved, + **** status is success + ***/ + + if ( handle_->NumberRemainOperations <= 0 ) { + status->setStatus(STATUS_Success); + + DB_unlock(); + + return (EC_Normal) ; + } + + /**** Goto the next matching image number of Index File + ***/ + + if (DB_IdxRead (handle_->moveCounterList->idxCounter, &idxRec) != EC_Normal) { +#ifdef DEBUG + DCMQRDB_DEBUG("DB_nextMoveResponse : STATUS_MOVE_Failed_UnableToProcess"); +#endif + status->setStatus(STATUS_MOVE_Failed_UnableToProcess); + + DB_unlock(); + + return (QR_EC_IndexDatabaseError) ; + } + + OFStandard::strlcpy(SOPClassUID, (char *) idxRec. SOPClassUID, SOPClassUIDSize) ; + OFStandard::strlcpy(SOPInstanceUID, (char *) idxRec. SOPInstanceUID, SOPInstanceUIDSize) ; + OFStandard::strlcpy(imageFileName, (char *) idxRec. filename, imageFileNameSize) ; + + *numberOfRemainingSubOperations = --handle_->NumberRemainOperations ; + + nextlist = handle_->moveCounterList->next ; + free (handle_->moveCounterList) ; + handle_->moveCounterList = nextlist ; + status->setStatus(STATUS_Pending); +#ifdef DEBUG + DCMQRDB_DEBUG("DB_nextMoveResponse : STATUS_Pending"); +#endif + return (EC_Normal) ; +} + + + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::cancelMoveRequest (DcmQueryRetrieveDatabaseStatus *status) +{ + DB_CounterList *plist ; + + while (handle_->moveCounterList) { + plist = handle_->moveCounterList ; + handle_->moveCounterList = handle_->moveCounterList->next ; + free (plist) ; + } + + status->setStatus(STATUS_MOVE_Cancel_SubOperationsTerminatedDueToCancelIndication); + + DB_unlock(); + + return (EC_Normal) ; +} + + +/* ========================= STORE ========================= */ + + +void DcmQueryRetrieveIndexDatabaseHandle::enableQuotaSystem(OFBool enable) +{ + quotaSystemEnabled = enable; +} + + +/* +** Image file deleting +*/ + + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::deleteImageFile(char* imgFile) +{ + if (!quotaSystemEnabled) { + DCMQRDB_WARN("file delete operations are disabled, keeping file: " << imgFile << " despite duplicate SOP Instance UID"); + return EC_Normal; + } else { + DCMQRDB_WARN("Deleting file: " << imgFile << " due to quota or duplicate SOP instance UID"); + } + +#ifdef LOCK_IMAGE_FILES + int lockfd; +#ifdef O_BINARY + lockfd = open(imgFile, O_RDWR | O_BINARY, 0666); /* obtain file descriptor */ +#else + lockfd = open(imgFile, O_RDWR, 0666); /* obtain file descriptor */ +#endif + if (lockfd < 0) { + DCMQRDB_WARN("DB ERROR: cannot open image file for deleting: " << imgFile); + return QR_EC_IndexDatabaseError; + } + if (dcmtk_flock(lockfd, LOCK_EX) < 0) { /* exclusive lock (blocking) */ + DCMQRDB_WARN("DB ERROR: cannot lock image file for deleting: " << imgFile); + dcmtk_plockerr("DB ERROR"); + } +#endif + + if (unlink(imgFile) < 0) { + /* delete file */ + DCMQRDB_ERROR("DB ERROR: cannot delete image file: " << imgFile << OFendl + << "QR_EC_IndexDatabaseError: " << OFStandard::getLastSystemErrorCode().message()); + } + +#ifdef LOCK_IMAGE_FILES + if (dcmtk_flock(lockfd, LOCK_UN) < 0) { /* unlock */ + DCMQRDB_WARN("DB ERROR: cannot unlock image file for deleting: " << imgFile); + dcmtk_plockerr("DB ERROR"); + } + close(lockfd); /* release file descriptor */ +#endif + + return EC_Normal; +} + + +/************************* +** Delete oldest study in database + */ + +int DcmQueryRetrieveIndexDatabaseHandle::deleteOldestStudy(StudyDescRecord *pStudyDesc) +{ + + int oldestStudy ; + double OldestDate ; + int s ; + size_t n ; + int idx = 0 ; + IdxRecord idxRec ; + + oldestStudy = 0 ; + OldestDate = 0.0 ; + +#ifdef DEBUG + DCMQRDB_DEBUG("deleteOldestStudy"); +#endif + + for ( s = 0 ; s < handle_ -> maxStudiesAllowed ; s++ ) { + if ( ( pStudyDesc[s]. NumberofRegistratedImages != 0 ) && + ( ( OldestDate == 0.0 ) || ( pStudyDesc[s]. LastRecordedDate < OldestDate ) ) ) { + OldestDate = pStudyDesc[s]. LastRecordedDate ; + oldestStudy = s ; + } + } + +#ifdef DEBUG + DCMQRDB_DEBUG("deleteOldestStudy oldestStudy = " << oldestStudy); +#endif + + n = strlen(pStudyDesc[oldestStudy].StudyInstanceUID) ; + while ( DB_IdxRead (idx, &idxRec) == EC_Normal ) { + + if ( ! ( strncmp(idxRec. StudyInstanceUID, pStudyDesc[oldestStudy].StudyInstanceUID, n) ) ) { + DB_IdxRemove (idx) ; + deleteImageFile(idxRec.filename); + } + idx++ ; + } + + pStudyDesc[oldestStudy].NumberofRegistratedImages = 0 ; + pStudyDesc[oldestStudy].StudySize = 0 ; + return(oldestStudy) ; +} + + + + +/************************* +** Delete oldest images in database + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::deleteOldestImages(StudyDescRecord *pStudyDesc, int StudyNum, char *StudyUID, long RequiredSize) +{ + + ImagesofStudyArray *StudyArray ; + IdxRecord idxRec ; + int nbimages = 0 , s = 0; + size_t n ; + long DeletedSize ; + +#ifdef DEBUG + DCMQRDB_DEBUG("deleteOldestImages RequiredSize = " << RequiredSize); +#endif + n = strlen(StudyUID) ; + StudyArray = (ImagesofStudyArray *)malloc(MAX_NUMBER_OF_IMAGES * sizeof(ImagesofStudyArray)) ; + + if (StudyArray == NULL) { + DCMQRDB_WARN("deleteOldestImages: out of memory"); + return QR_EC_IndexDatabaseError; + } + + /** Find all images having the same StudyUID + */ + + DB_IdxInitLoop (&(handle_ -> idxCounter)) ; + while ( DB_IdxGetNext(&(handle_ -> idxCounter), &idxRec) == EC_Normal ) { + if ( ! ( strncmp(idxRec. StudyInstanceUID, StudyUID, n) ) ) { + + StudyArray[nbimages]. idxCounter = handle_ -> idxCounter ; + StudyArray[nbimages]. RecordedDate = idxRec. RecordedDate ; + StudyArray[nbimages++]. ImageSize = idxRec. ImageSize ; + } + } + + /** Sort the StudyArray in order to have the oldest images first + */ + qsort((char *)StudyArray, nbimages, sizeof(ImagesofStudyArray), DB_Compare) ; + +#ifdef DEBUG + { + int i ; + DCMQRDB_DEBUG("deleteOldestImages : Sorted images ref array"); + for (i = 0 ; i < nbimages ; i++) + DCMQRDB_DEBUG("[" << STD_NAMESPACE setw(2) << i << "] : Size " << StudyArray[i].ImageSize + << " Date " << STD_NAMESPACE setw(20) << STD_NAMESPACE setprecision(3) << StudyArray[i].RecordedDate + << " Ref " << StudyArray[i].idxCounter); + DCMQRDB_DEBUG("deleteOldestImages : end of ref array"); + } +#endif + + s = 0 ; + DeletedSize = 0 ; + + while ( DeletedSize < RequiredSize ) { + + IdxRecord idxRemoveRec ; + DB_IdxRead (StudyArray[s]. idxCounter, &idxRemoveRec) ; +#ifdef DEBUG + DCMQRDB_DEBUG("Removing file : " << idxRemoveRec. filename); +#endif + deleteImageFile(idxRemoveRec.filename); + + DB_IdxRemove (StudyArray[s]. idxCounter) ; + pStudyDesc[StudyNum].NumberofRegistratedImages -= 1 ; + pStudyDesc[StudyNum].StudySize -= StudyArray[s]. ImageSize ; + DeletedSize += StudyArray[s++]. ImageSize ; + } + +#ifdef DEBUG + DCMQRDB_DEBUG("deleteOldestImages DeletedSize = " << (int)DeletedSize); +#endif + free(StudyArray) ; + return( EC_Normal ) ; + +} + + + +/************************* + * Verify if study UID already exists + * If the study UID exists, its index in the study descriptor is returned. + * If the study UID does not exist, the index of the first unused descriptor entry is returned. + * If no entries are free, maxStudiesAllowed is returned. + */ + +int DcmQueryRetrieveIndexDatabaseHandle::matchStudyUIDInStudyDesc (StudyDescRecord *pStudyDesc, char *StudyUID, int maxStudiesAllowed) +{ + int s = 0 ; + while (s < maxStudiesAllowed) + { + if ((pStudyDesc[s].NumberofRegistratedImages > 0) && (0 == strcmp(pStudyDesc[s].StudyInstanceUID, StudyUID))) break; + s++ ; + } + if (s==maxStudiesAllowed) // study uid does not exist, look for free descriptor + { + s=0; + while (s < maxStudiesAllowed) + { + if (pStudyDesc[s].NumberofRegistratedImages == 0) break; + s++ ; + } + } + return s; +} + + +/************************* +** Check up storage rights in Study Desk record + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::checkupinStudyDesc(StudyDescRecord *pStudyDesc, char *StudyUID, long imageSize) +{ + int s ; + long RequiredSize ; + + s = matchStudyUIDInStudyDesc (pStudyDesc, StudyUID, + (int)(handle_ -> maxStudiesAllowed)) ; + + /** If Study already exists + */ + + if ( pStudyDesc[s]. NumberofRegistratedImages != 0 ) { + +#ifdef DEBUG + DCMQRDB_DEBUG("checkupinStudyDesc: study already exists : " << s) ; +#endif + if ( OFstatic_cast(size_t, pStudyDesc[s]. StudySize) + imageSize > + OFstatic_cast(size_t, handle_ -> maxBytesPerStudy) ) + { + if ( imageSize > handle_ -> maxBytesPerStudy ) { +#ifdef DEBUG + DCMQRDB_DEBUG("checkupinStudyDesc: imageSize = " << imageSize << " too large"); +#endif + return ( QR_EC_IndexDatabaseError ) ; + } + + RequiredSize = imageSize - + ( handle_ -> maxBytesPerStudy - pStudyDesc[s]. StudySize ) ; + deleteOldestImages(pStudyDesc, s, StudyUID, RequiredSize) ; + } + + + } + else { +#ifdef DEBUG + DCMQRDB_DEBUG("checkupinStudyDesc: study doesn't already exist"); +#endif + if ( imageSize > handle_ -> maxBytesPerStudy ) { +#ifdef DEBUG + DCMQRDB_DEBUG("checkupinStudyDesc: imageSize = " << imageSize << " too large"); +#endif + return ( QR_EC_IndexDatabaseError ) ; + } + if ( s > ( handle_ -> maxStudiesAllowed - 1 ) ) + s = deleteOldestStudy(pStudyDesc) ; + + } + + pStudyDesc[s]. StudySize += imageSize ; +#ifdef DEBUG + DCMQRDB_DEBUG("checkupinStudyDesc: ~~~~~~~~ StudySize = " << pStudyDesc[s]. StudySize); +#endif + + /* we only have second accuracy */ + pStudyDesc[s]. LastRecordedDate = (double) time(NULL); + + pStudyDesc[s]. NumberofRegistratedImages++ ; + OFStandard::strlcpy(pStudyDesc[s].StudyInstanceUID, StudyUID, UI_MAX_LENGTH+1) ; + + if ( DB_StudyDescChange (pStudyDesc) == EC_Normal) + return ( EC_Normal ) ; + else + return ( QR_EC_IndexDatabaseError ) ; +} + +/* + * If the image is already stored remove it from the database. + * hewett - Nov. 1, 93 + */ +OFCondition DcmQueryRetrieveIndexDatabaseHandle::removeDuplicateImage( + const char *SOPInstanceUID, const char *StudyInstanceUID, + StudyDescRecord *pStudyDesc, const char *newImageFileName) +{ + + int idx = 0; + IdxRecord idxRec ; + int studyIdx = 0; + + studyIdx = matchStudyUIDInStudyDesc (pStudyDesc, (char*)StudyInstanceUID, + (int)(handle_ -> maxStudiesAllowed)) ; + + if ( pStudyDesc[studyIdx].NumberofRegistratedImages == 0 ) { + /* no study images, cannot be any old images */ + return EC_Normal; + } + + while (DB_IdxRead(idx, &idxRec) == EC_Normal) { + + if (strcmp(idxRec.SOPInstanceUID, SOPInstanceUID) == 0) { + +#ifdef DEBUG + DCMQRDB_DEBUG("--- Removing Existing DB Image Record: " << idxRec.filename); +#endif + /* remove the idx record */ + DB_IdxRemove (idx); + /* only remove the image file if it is different than that + * being entered into the database. + */ + if (strcmp(idxRec.filename, newImageFileName) != 0) { + deleteImageFile(idxRec.filename); + } + /* update the study info */ + pStudyDesc[studyIdx].NumberofRegistratedImages--; + pStudyDesc[studyIdx].StudySize -= idxRec.ImageSize; + } + idx++; + } + /* the study record should be written to file later */ + return EC_Normal; +} + + +/************************* +** Add data from imageFileName to database + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::storeRequest ( + const char *SOPClassUID, + const char * /*SOPInstanceUID*/, + const char *imageFileName, + DcmQueryRetrieveDatabaseStatus *status, + OFBool isNew) +{ + IdxRecord idxRec ; + StudyDescRecord *pStudyDesc ; + int i ; + struct stat stat_buf ; + + /**** Initialize an IdxRecord + ***/ + + bzero((char*)&idxRec, sizeof(idxRec)); + + DB_IdxInitRecord (&idxRec, 0) ; + + strncpy(idxRec.filename, imageFileName, DBC_MAXSTRING); +#ifdef DEBUG + DCMQRDB_DEBUG("DB_storeRequest () : storage request of file : " << idxRec.filename); +#endif + strncpy (idxRec.SOPClassUID, SOPClassUID, UI_MAX_LENGTH); + + /**** Get IdxRec values from ImageFile + ***/ + + DcmFileFormat dcmff; + if (dcmff.loadFile(imageFileName).bad()) + { + DCMQRDB_WARN("DB: Cannot open file: " << imageFileName << ": " + << OFStandard::getLastSystemErrorCode().message()); + status->setStatus(STATUS_STORE_Error_CannotUnderstand); + return (QR_EC_IndexDatabaseError) ; + } + + DcmDataset *dset = dcmff.getDataset(); + + assert(dset); + + OFCondition ec; + + for (i = 0 ; i < NBPARAMETERS ; i++ ) { + DB_SmallDcmElmt *se = idxRec.param + i; + + const char *strPtr = NULL; + ec = dset->findAndGetString(se->XTag, strPtr); + if ((ec != EC_Normal) || (strPtr == NULL)) { + /* not found or empty */ + se->PValueField[0] = '\0'; + se->ValueLength = 0; + } else { + /* found and non-empty */ + strncpy(se->PValueField, strPtr, (size_t)(se->ValueLength)); + /* important: do not change the ValueLength field before the string is copied! */ + se->ValueLength = OFstatic_cast(int, strlen(se->PValueField)); + } + } + + /* InstanceStatus */ + idxRec.hstat = (isNew) ? DVIF_objectIsNew : DVIF_objectIsNotNew; + + /* InstanceDescription */ + OFBool useDescrTag = OFTrue; + DcmTagKey descrTag = DCM_ImageComments; + if (SOPClassUID != NULL) + { + /* fill in value depending on SOP class UID (content might be improved) */ + if (strcmp(SOPClassUID, UID_GrayscaleSoftcopyPresentationStateStorage) == 0) + { + descrTag = DCM_ContentDescription; + } else if (strcmp(SOPClassUID, UID_RETIRED_HardcopyGrayscaleImageStorage) == 0) + { + OFStandard::strlcpy(idxRec.InstanceDescription, "Hardcopy Grayscale Image", DESCRIPTION_MAX_LENGTH+1); + useDescrTag = OFFalse; + } else if ((strcmp(SOPClassUID, UID_BasicTextSRStorage) == 0) || + (strcmp(SOPClassUID, UID_EnhancedSRStorage) == 0) || + (strcmp(SOPClassUID, UID_ComprehensiveSRStorage) == 0) || + (strcmp(SOPClassUID, UID_Comprehensive3DSRStorage) == 0) || + (strcmp(SOPClassUID, UID_ExtensibleSRStorage) == 0) || + (strcmp(SOPClassUID, UID_ProcedureLogStorage) == 0) || + (strcmp(SOPClassUID, UID_MammographyCADSRStorage) == 0) || + (strcmp(SOPClassUID, UID_KeyObjectSelectionDocumentStorage) == 0) || + (strcmp(SOPClassUID, UID_ChestCADSRStorage) == 0) || + (strcmp(SOPClassUID, UID_ColonCADSRStorage) == 0) || + (strcmp(SOPClassUID, UID_XRayRadiationDoseSRStorage) == 0) || + (strcmp(SOPClassUID, UID_SpectaclePrescriptionReportStorage) == 0) || + (strcmp(SOPClassUID, UID_MacularGridThicknessAndVolumeReportStorage) == 0) || + (strcmp(SOPClassUID, UID_ImplantationPlanSRDocumentStorage) == 0) || + (strcmp(SOPClassUID, UID_RadiopharmaceuticalRadiationDoseSRStorage) == 0) || + (strcmp(SOPClassUID, UID_AcquisitionContextSRStorage) == 0) || + (strcmp(SOPClassUID, UID_SimplifiedAdultEchoSRStorage) == 0) || + (strcmp(SOPClassUID, UID_PatientRadiationDoseSRStorage) == 0) || + (strcmp(SOPClassUID, UID_PerformedImagingAgentAdministrationSRStorage) == 0) || + (strcmp(SOPClassUID, UID_PlannedImagingAgentAdministrationSRStorage) == 0)) + { + OFString string; + OFString description = "unknown SR"; + const char *name = dcmFindNameOfUID(SOPClassUID); + if (name != NULL) + description = name; + if (dset->findAndGetOFString(DCM_VerificationFlag, string) == EC_Normal) + { + description += ", "; + description += string; + } + if (dset->findAndGetOFString(DCM_CompletionFlag, string) == EC_Normal) + { + description += ", "; + description += string; + } + if (dset->findAndGetOFString(DCM_CompletionFlagDescription, string) == EC_Normal) + { + description += ", "; + description += string; + } + OFStandard::strlcpy(idxRec.InstanceDescription, description.c_str(), DESCRIPTION_MAX_LENGTH+1); + useDescrTag = OFFalse; + } else if (strcmp(SOPClassUID, UID_RETIRED_StoredPrintStorage) == 0) + { + OFStandard::strlcpy(idxRec.InstanceDescription, "Stored Print", DESCRIPTION_MAX_LENGTH+1); + useDescrTag = OFFalse; + } + } + /* get description from attribute specified above */ + if (useDescrTag) + { + OFString string; + /* return value is irrelevant */ + dset->findAndGetOFString(descrTag, string); + strncpy(idxRec.InstanceDescription, string.c_str(), DESCRIPTION_MAX_LENGTH); + } + /* is dataset digitally signed? */ + if (strlen(idxRec.InstanceDescription) + 9 < DESCRIPTION_MAX_LENGTH) + { + DcmStack stack; + if (dset->search(DCM_DigitalSignaturesSequence, stack, ESM_fromHere, OFTrue /* searchIntoSub */) == EC_Normal) + { + /* in principle it should be checked whether there is _any_ non-empty digital signatures sequence, but ... */ + if (((DcmSequenceOfItems *)stack.top())->card() > 0) + { + if (strlen(idxRec.InstanceDescription) > 0) + OFStandard::strlcat(idxRec.InstanceDescription, " (Signed)", DESCRIPTION_MAX_LENGTH+1); + else + OFStandard::strlcpy(idxRec.InstanceDescription, "Signed Instance", DESCRIPTION_MAX_LENGTH+1); + } + } + } + + /**** Print Elements + ***/ + +#ifdef DEBUG + DCMQRDB_DEBUG("-- BEGIN Parameters to Register in DB"); + for (i = 0 ; i < NBPARAMETERS ; i++) { /* new definition */ + DB_SmallDcmElmt *se = idxRec.param + i; + const char* value = ""; + if (se->PValueField != NULL) value = se->PValueField; + DcmTag tag(se->XTag); + DCMQRDB_DEBUG(" " << tag.getTagName() << ": \"" << value << "\""); + } + DCMQRDB_DEBUG("-- END Parameters to Register in DB"); +#endif + + /**** Goto the end of IndexFile, and write the record + ***/ + + DB_lock(OFTrue); + + pStudyDesc = (StudyDescRecord *)malloc (SIZEOF_STUDYDESC) ; + if (pStudyDesc == NULL) { + DCMQRDB_ERROR("DB_storeRequest: out of memory"); + status->setStatus(STATUS_STORE_Refused_OutOfResources); + DB_unlock(); + return (QR_EC_IndexDatabaseError) ; + } + + bzero((char *)pStudyDesc, SIZEOF_STUDYDESC); + DB_GetStudyDesc(pStudyDesc) ; + + stat(imageFileName, &stat_buf) ; + idxRec. ImageSize = (int)(stat_buf. st_size) ; + + /* we only have second accuracy */ + idxRec. RecordedDate = (double) time(NULL); + + /* + * If the image is already stored remove it from the database. + * hewett - Nov. 1, 93 + */ + + removeDuplicateImage(idxRec.SOPInstanceUID, + idxRec.StudyInstanceUID, pStudyDesc, + imageFileName); + + + if ( checkupinStudyDesc(pStudyDesc, idxRec. StudyInstanceUID, idxRec. ImageSize) != EC_Normal ) { + free (pStudyDesc) ; + status->setStatus(STATUS_STORE_Refused_OutOfResources); + + DB_unlock(); + + return (QR_EC_IndexDatabaseError) ; + } + + free (pStudyDesc) ; + + if (DB_IdxAdd (handle_, &i, &idxRec) == EC_Normal) + { + status->setStatus(STATUS_Success); + DB_unlock(); + return (EC_Normal) ; + } + else + { + status->setStatus(STATUS_STORE_Refused_OutOfResources); + DB_unlock(); + } + return QR_EC_IndexDatabaseError; +} + +/* +** Prune invalid DB records. +*/ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::pruneInvalidRecords() +{ + int idx = 0; + IdxRecord idxRec ; + StudyDescRecord *pStudyDesc; + + DB_lock(OFTrue); + + pStudyDesc = (StudyDescRecord *)malloc (SIZEOF_STUDYDESC) ; + if (pStudyDesc == NULL) { + DCMQRDB_WARN("DB_pruneInvalidRecords: out of memory"); + DB_unlock(); + return (QR_EC_IndexDatabaseError) ; + } + + for (int i = 0 ; i < handle_ -> maxStudiesAllowed ; i++ ) + pStudyDesc[i]. NumberofRegistratedImages = 0 ; + + DB_GetStudyDesc(pStudyDesc) ; + + while (DB_IdxRead(idx, &idxRec) == EC_Normal) + { + if (access(idxRec.filename, R_OK) < 0) + { +#ifdef DEBUG + DCMQRDB_DEBUG("*** Pruning Invalid DB Image Record: " << idxRec.filename); +#endif + /* update the study info */ + int studyIdx = matchStudyUIDInStudyDesc(pStudyDesc, idxRec.StudyInstanceUID, (int)(handle_->maxStudiesAllowed)) ; + if (studyIdx < handle_->maxStudiesAllowed) + { + if (pStudyDesc[studyIdx].NumberofRegistratedImages > 0) + { + pStudyDesc[studyIdx].NumberofRegistratedImages--; + } else { + pStudyDesc[studyIdx].NumberofRegistratedImages = 0; + pStudyDesc[studyIdx].StudySize = 0; + pStudyDesc[studyIdx].StudyInstanceUID[0] = '\0'; + } + if (pStudyDesc[studyIdx].StudySize > idxRec.ImageSize) + { + pStudyDesc[studyIdx].StudySize -= idxRec.ImageSize; + } + } + + /* remove the idx record */ + DB_IdxRemove (idx); + } + idx++; + } + + DB_StudyDescChange (pStudyDesc); + DB_unlock(); + free (pStudyDesc) ; + return EC_Normal; +} + + +/* ========================= INDEX ========================= */ + + +/************************ + * Dump an index file + */ + +void DcmQueryRetrieveIndexDatabaseHandle::printIndexFile (char *storeArea) +{ + int i ; + int j ; + IdxRecord idxRec ; + StudyDescRecord *pStudyDesc; + + OFCondition result; + DcmQueryRetrieveIndexDatabaseHandle handle(storeArea, -1, -1, result); + if (result.bad()) return; + + pStudyDesc = (StudyDescRecord *)malloc (SIZEOF_STUDYDESC) ; + if (pStudyDesc == NULL) { + DCMQRDB_ERROR("printIndexFile: out of memory"); + return; + } + + handle.DB_lock(OFFalse); + + handle.DB_GetStudyDesc(pStudyDesc); + + for (i=0; imaxStudiesAllowed; i++) { + if (pStudyDesc[i].NumberofRegistratedImages != 0 ) { + COUT << "******************************************************" << OFendl + << "STUDY DESCRIPTOR: " << i << OFendl + << " Study UID: " << pStudyDesc[i].StudyInstanceUID << OFendl + << " StudySize: " << pStudyDesc[i].StudySize << OFendl + << " LastRecDate: " << pStudyDesc[i].LastRecordedDate << OFendl + << " NumOfImages: " << pStudyDesc[i].NumberofRegistratedImages << OFendl; + } + } + + handle.DB_IdxInitLoop (&j) ; + while (1) { + if (handle.DB_IdxGetNext(&j, &idxRec) != EC_Normal) + break ; + + COUT << "*******************************************************" << OFendl; + COUT << "RECORD NUMBER: " << j << OFendl << " Status: "; + if (idxRec.hstat == DVIF_objectIsNotNew) + COUT << "is NOT new" << OFendl; + else + COUT << "is new" << OFendl; + COUT << " Filename: " << idxRec.filename << OFendl + << " ImageSize: " << idxRec.ImageSize << OFendl + << " RecordedDate: " << idxRec.RecordedDate << OFendl; + for (i = 0 ; i < NBPARAMETERS ; i++) { /* new definition */ + DB_SmallDcmElmt *se = idxRec.param + i; + const char* value = ""; + if (se->PValueField != NULL) value = se->PValueField; + DcmTag tag(se->XTag); + COUT << " " << tag.getTagName() << ": \"" << value << "\"" << OFendl; + } + COUT << " InstanceDescription: \"" << idxRec.InstanceDescription << "\"" << OFendl; + } + COUT << "*******************************************************" << OFendl + << "RECORDS IN THIS INDEXFILE: " << j << OFendl; + + handle.DB_unlock(); + +} + +/************************ + * Search in index file for SOP Class UID and SOP Instance UID. Used for the storage commitment server + */ + +OFBool DcmQueryRetrieveIndexDatabaseHandle::findSOPInstance(const char *storeArea, const OFString &sopClassUID,const OFString &sopInstanceUID) +{ + int j ; + IdxRecord idxRec ; + + OFCondition result; + OFBool Found = OFFalse; + + if (sopClassUID.empty() || sopInstanceUID.empty()) return Found; + + DcmQueryRetrieveIndexDatabaseHandle handle(storeArea, -1, -1, result); + if (result.bad()) return Found; + + handle.DB_lock(OFFalse); + + handle.DB_IdxInitLoop (&j) ; + while (1) { + if (handle.DB_IdxGetNext(&j, &idxRec) != EC_Normal) + break ; + if (sopClassUID.compare(idxRec.SOPClassUID)==0 && sopInstanceUID.compare(idxRec.SOPInstanceUID)==0) + { + Found=OFTrue; + break; + } + } + handle.DB_unlock(); + return Found; +} + + +/* ========================= UTILS ========================= */ + + +const char *DcmQueryRetrieveIndexDatabaseHandle::getStorageArea() const +{ + return handle_->storageArea; +} + +const char *DcmQueryRetrieveIndexDatabaseHandle::getIndexFilename() const +{ + return handle_->indexFilename; +} + +void DcmQueryRetrieveIndexDatabaseHandle::setIdentifierChecking(OFBool checkFind, OFBool checkMove) +{ + doCheckFindIdentifier = checkFind; + doCheckMoveIdentifier = checkMove; +} + + +/*********************** + * Creates a handle + */ + +DcmQueryRetrieveIndexDatabaseHandle::DcmQueryRetrieveIndexDatabaseHandle( + const char *storageArea, + long maxStudiesPerStorageArea, + long maxBytesPerStudy, + OFCondition& result) +: handle_(NULL) +, quotaSystemEnabled(OFTrue) +, doCheckFindIdentifier(OFFalse) +, doCheckMoveIdentifier(OFFalse) +, fnamecreator() +{ + + handle_ = new DB_Private_Handle; + +#ifdef DEBUG + DCMQRDB_DEBUG("DB_createHandle () : Handle created for " << storageArea); + DCMQRDB_DEBUG(" maxStudiesPerStorageArea: " << maxStudiesPerStorageArea + << " maxBytesPerStudy: " << maxBytesPerStudy); +#endif + + /* check maximum number of studies for valid value */ + if (maxStudiesPerStorageArea < 0) { + maxStudiesPerStorageArea = DB_UpperMaxStudies; + } + else if (maxStudiesPerStorageArea > DB_UpperMaxStudies) { + DCMQRDB_WARN("maxStudiesPerStorageArea too large" << OFendl + << " setting to " << DB_UpperMaxStudies); + maxStudiesPerStorageArea = DB_UpperMaxStudies; + } + /* check maximum study size for valid value value */ + if (maxBytesPerStudy < 0) { + maxBytesPerStudy = DB_UpperMaxBytesPerStudy; + } + else if (maxBytesPerStudy > DB_UpperMaxBytesPerStudy) { + DCMQRDB_WARN("maxBytesPerStudy too large" << OFendl + << " setting to " << DB_UpperMaxBytesPerStudy); + maxBytesPerStudy = DB_UpperMaxBytesPerStudy; + } + + if (handle_) { + sprintf (handle_ -> storageArea,"%s", storageArea); + sprintf (handle_ -> indexFilename,"%s%c%s", storageArea, PATH_SEPARATOR, DBINDEXFILE); + + /* create index file if it does not already exist */ + FILE* f = fopen(handle_->indexFilename, "ab"); + if (f == NULL) { + DCMQRDB_ERROR(handle_->indexFilename << ": " << OFStandard::getLastSystemErrorCode().message()); + result = QR_EC_IndexDatabaseError; + return; + } + fclose(f); + + /* open fd of index file */ +#ifdef O_BINARY + handle_ -> pidx = open(handle_ -> indexFilename, O_RDWR | O_BINARY ); +#else + handle_ -> pidx = open(handle_ -> indexFilename, O_RDWR ); +#endif + if ( handle_ -> pidx == (-1) ) + { + result = QR_EC_IndexDatabaseError; + return; + } + else + { + result = DB_lock(OFTrue); + if ( result.bad() ) + return; + + // test whether the file contains more than zero bytes + if ( DB_lseek( handle_ -> pidx, 0L, SEEK_END ) > 0 ) + { + DB_lseek( handle_ -> pidx, 0L, SEEK_SET ); + // allocate HEADERSIZE + 1 bytes and fill it with zeros, + // ensuring whatever is read is terminated with a NUL byte + char header[DBHEADERSIZE+1] = {}; + // 0 is an invalid version, no matter what + unsigned int version = 0; + if + ( + read( handle_ -> pidx, header, DBHEADERSIZE ) != DBHEADERSIZE || + strncmp( header, DBMAGIC, strlen(DBMAGIC) ) != 0 || + sscanf( header + strlen(DBMAGIC), "%x", &version ) != 1 || + version != DBVERSION + ) + { + DB_unlock(); + if ( version ) + DCMQRDB_ERROR(handle_->indexFilename << ": invalid/unsupported QRDB database version " << version); + else + DCMQRDB_ERROR(handle_->indexFilename << ": unknown/legacy QRDB database file format"); + result = QR_EC_IndexDatabaseError; + return; + } + } + else + { + // write magic word and version number to the buffer + // then write it to the file + char header[DBHEADERSIZE + 1]; + sprintf( header, DBMAGIC "%.2X", DBVERSION ); + if ( write( handle_ -> pidx, header, DBHEADERSIZE ) != DBHEADERSIZE ) + { + DCMQRDB_ERROR(handle_->indexFilename << ": " << OFStandard::getLastSystemErrorCode().message()); + DB_unlock(); + result = QR_EC_IndexDatabaseError; + return; + } + } + + DB_unlock(); + + handle_ -> idxCounter = -1; + handle_ -> findRequestList = NULL; + handle_ -> findResponseList = NULL; + handle_ -> maxBytesPerStudy = maxBytesPerStudy; + handle_ -> maxStudiesAllowed = maxStudiesPerStorageArea; + handle_ -> uidList = NULL; + result = EC_Normal; + return; + } + } + else + { + result = QR_EC_IndexDatabaseError; + return; + } +} + +/*********************** + * Destroys a handle + */ + +DcmQueryRetrieveIndexDatabaseHandle::~DcmQueryRetrieveIndexDatabaseHandle() +{ + if (handle_) + { +#ifndef _WIN32 + /* should not be necessary because we are closing the file handle anyway. + * On Unix systems this does no harm, but on Windows the unlock fails + * if the file was not locked before + * and this gives an unnecessary error message on stderr. + */ + DB_unlock(); +#endif + close( handle_ -> pidx); + + /* Free lists */ + DB_FreeElementList (handle_ -> findRequestList); + DB_FreeElementList (handle_ -> findResponseList); + DB_FreeUidList (handle_ -> uidList); + + delete handle_; + } +} + +/********************************** + * Provides a storage filename + */ + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::makeNewStoreFileName( + const char *SOPClassUID, + const char * /* SOPInstanceUID */ , + char *newImageFileName, + size_t newImageFileNameLen) +{ + + OFString filename; + char prefix[12]; + + const char *m = dcmSOPClassUIDToModality(SOPClassUID); + if (m==NULL) m = "XX"; + sprintf(prefix, "%s_", m); + // unsigned int seed = fnamecreator.hashString(SOPInstanceUID); + unsigned int seed = (unsigned int)time(NULL); + newImageFileName[0]=0; // return empty string in case of error + if (! fnamecreator.makeFilename(seed, handle_->storageArea, prefix, ".dcm", filename)) + return QR_EC_IndexDatabaseError; + + OFStandard::strlcpy(newImageFileName, filename.c_str(), newImageFileNameLen); + return EC_Normal; +} + + +OFCondition DcmQueryRetrieveIndexDatabaseHandle::instanceReviewed(int idx) +{ + // acquire shared lock and read record at index position + OFCondition result = DB_lock(OFFalse); + if (result.bad()) return result; + IdxRecord record; + result = DB_IdxRead(idx, &record); + DB_unlock(); + + if (result.good() && (record.hstat != DVIF_objectIsNotNew)) + { + // acquire exclusive lock and update flag + result = DB_lock(OFTrue); + if (result.bad()) return result; + + record.hstat = DVIF_objectIsNotNew; + DB_lseek(handle_->pidx, OFstatic_cast(long, DBHEADERSIZE + SIZEOF_STUDYDESC + idx * SIZEOF_IDXRECORD), SEEK_SET); + if (write(handle_->pidx, OFreinterpret_cast(char *, &record), SIZEOF_IDXRECORD) != SIZEOF_IDXRECORD) + result = QR_EC_IndexDatabaseError; + DB_lseek(handle_->pidx, OFstatic_cast(long, DBHEADERSIZE), SEEK_SET); + DB_unlock(); + } + + return result; +} + + +/*********************** + * Default constructors for struct IdxRecord and DB_SSmallDcmElmt + */ + +IdxRecord::IdxRecord() +: RecordedDate(0.0) +, ImageSize(0) +, hstat(DVIF_objectIsNotNew) +{ +} + +DB_SmallDcmElmt::DB_SmallDcmElmt() +: PValueField(NULL) +, ValueLength(0) +, XTag() +{ +} + + +DcmQueryRetrieveIndexDatabaseHandleFactory::DcmQueryRetrieveIndexDatabaseHandleFactory(const DcmQueryRetrieveConfig *config) +: DcmQueryRetrieveDatabaseHandleFactory() +, config_(config) +{ +} + +DcmQueryRetrieveIndexDatabaseHandleFactory::~DcmQueryRetrieveIndexDatabaseHandleFactory() +{ +} + +DcmQueryRetrieveDatabaseHandle *DcmQueryRetrieveIndexDatabaseHandleFactory::createDBHandle( + const char * /* callingAETitle */, + const char *calledAETitle, + OFCondition& result) const +{ + return new DcmQueryRetrieveIndexDatabaseHandle( + config_->getStorageArea(calledAETitle), + config_->getMaxStudies(calledAETitle), + config_->getMaxBytesPerStudy(calledAETitle), result); +} diff --git a/dcmqrdb/libsrc/dcmqrdbs.cc b/dcmqrdb/libsrc/dcmqrdbs.cc new file mode 100644 index 00000000..4cc0998f --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrdbs.cc @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 1993-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveDatabaseStatus + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmdata/dcdatset.h" /* for class DcmDataset */ + +#define INCLUDE_CSTDDEF +#include "dcmtk/ofstd/ofstdinc.h" + + +DcmQueryRetrieveDatabaseStatus::DcmQueryRetrieveDatabaseStatus(Uint16 s) +: status_(s) +, statusDetail_(NULL) +{ +} + +DcmQueryRetrieveDatabaseStatus::DcmQueryRetrieveDatabaseStatus(const DcmQueryRetrieveDatabaseStatus& org) +: status_(org.status_) +, statusDetail_(NULL) +{ + if (org.statusDetail_) statusDetail_ = OFstatic_cast(DcmDataset *, org.statusDetail_->clone()); +} + +DcmQueryRetrieveDatabaseStatus::~DcmQueryRetrieveDatabaseStatus() +{ + delete statusDetail_; +} + +DcmQueryRetrieveDatabaseStatus& DcmQueryRetrieveDatabaseStatus::operator=(const DcmQueryRetrieveDatabaseStatus& org) +{ + if (this != &org) + { + status_ = org.status_; + if (org.statusDetail_ != statusDetail_) + { + delete statusDetail_; + if (org.statusDetail_) statusDetail_ = OFstatic_cast(DcmDataset *, org.statusDetail_->clone()); else statusDetail_ = NULL; + } + } + return *this; +} + +void DcmQueryRetrieveDatabaseStatus::deleteStatusDetail() +{ + delete statusDetail_; + statusDetail_ = NULL; +} + +DcmDataset *DcmQueryRetrieveDatabaseStatus::extractStatusDetail() +{ + DcmDataset *result = statusDetail_; + statusDetail_ = NULL; + return result; +} diff --git a/dcmqrdb/libsrc/dcmqropt.cc b/dcmqrdb/libsrc/dcmqropt.cc new file mode 100644 index 00000000..355ad6c6 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqropt.cc @@ -0,0 +1,82 @@ +/* + * + * Copyright (C) 1993-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveOptions + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqropt.h" + +#define INCLUDE_CSTDARG +#include "dcmtk/ofstd/ofstdinc.h" + +makeOFConditionConst(QR_EC_IndexDatabaseError, OFM_dcmqrdb, 1, OF_error, "Index database error"); +makeOFConditionConst(QR_EC_InvalidPeer, OFM_dcmqrdb, 2, OF_error, "Invalid peer for move operation"); + +DcmQueryRetrieveOptions::DcmQueryRetrieveOptions() +: allowShutdown_(OFFalse) +, bitPreserving_(OFFalse) +, correctUIDPadding_(OFFalse) +, disableGetSupport_(OFFalse) +, filepad_(0) +, groupLength_(EGL_recalcGL) +, ignoreStoreData_(OFFalse) +, itempad_(0) +, maxAssociations_(20) +, maxPDU_(ASC_DEFAULTMAXPDU) +, net_(NULL) +, networkTransferSyntax_(EXS_Unknown) +#ifndef DISABLE_COMPRESSION_EXTENSION +, networkTransferSyntaxOut_(EXS_Unknown) +#endif +, paddingType_(EPD_withoutPadding) +, refuseMultipleStorageAssociations_(OFFalse) +, refuse_(OFFalse) +, rejectWhenNoImplementationClassUID_(OFFalse) +, requireFindForMove_(OFFalse) +, restrictMoveToSameAE_(OFFalse) +, restrictMoveToSameHost_(OFFalse) +, restrictMoveToSameVendor_(OFFalse) +, sequenceType_(EET_ExplicitLength) +#ifdef HAVE_FORK +, singleProcess_(OFFalse) +#else +, singleProcess_(OFTrue) +#endif +, supportPatientRoot_(OFTrue) +#ifdef NO_PATIENTSTUDYONLY_SUPPORT +, supportPatientStudyOnly_(OFFalse) +#else +, supportPatientStudyOnly_(OFTrue) +#endif +, supportStudyRoot_(OFTrue) +, useMetaheader_(OFTrue) +, keepDBHandleDuringAssociation_(OFTrue) +, writeTransferSyntax_(EXS_Unknown) +, blockMode_(DIMSE_BLOCKING) +, dimse_timeout_(0) +, acse_timeout_(30) +, associationConfigFile() +, incomingProfile() +, outgoingProfile() +{ +} + +DcmQueryRetrieveOptions::~DcmQueryRetrieveOptions() +{ +} diff --git a/dcmqrdb/libsrc/dcmqrptb.cc b/dcmqrdb/libsrc/dcmqrptb.cc new file mode 100644 index 00000000..b2fbdca8 --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrptb.cc @@ -0,0 +1,226 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: classes DcmQueryRetrieveProcessSlot, DcmQueryRetrieveProcessTable + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrptb.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" + +/** helper class that describes entries in the process slot table. Internal use only. + */ +class DcmQueryRetrieveProcessSlot +{ +public: + /** constructor. + * @param peerName hostname or IP address of peer system + * @param callingAETitle calling aetitle of peer + * @param calledAETitle called aetitle we're responding to + * @param processId process ID of child process + * @param startTime time the child process was started + * @param hasStorageAbility true if the child process is allowed to store + */ + DcmQueryRetrieveProcessSlot( + const char *peerName, + const char *callingAETitle, + const char *calledAETitle, + int processId, + time_t startTime, + OFBool hasStorageAbility); + + /// destructor + virtual ~DcmQueryRetrieveProcessSlot() {} + + /** check if this instance matches the given process ID + */ + OFBool matchesPID(int pid) const + { + return pid == processId_; + } + + /** check if this instance describes a client with write access + */ + OFBool isProcessWithWriteAccess( + const char *calledAETitle) const; + +private: + + /// hostname or IP address of peer system + OFString peerName_; + + /// calling aetitle of peer + OFString callingAETitle_; + + /// called aetitle we're responding to + OFString calledAETitle_; + + /// process ID of child process + int processId_; + + /// time the child process was started + time_t startTime_; + + /// true if the child process is allowed to store + OFBool hasStorageAbility_; +}; + + +DcmQueryRetrieveProcessSlot::DcmQueryRetrieveProcessSlot( + const char *peerName, + const char *callingAETitle, + const char *calledAETitle, + int processId, + time_t startTime, + OFBool hasStorageAbility) +: peerName_() +, callingAETitle_() +, calledAETitle_() +, processId_(processId) +, startTime_(startTime) +, hasStorageAbility_(hasStorageAbility) +{ + if (peerName) peerName_ = peerName; + if (callingAETitle) callingAETitle_ = callingAETitle; + if (calledAETitle) calledAETitle_ = calledAETitle; +} + + +OFBool DcmQueryRetrieveProcessSlot::isProcessWithWriteAccess(const char *calledAETitle) const +{ + return (hasStorageAbility_ && calledAETitle && calledAETitle_ == calledAETitle); +} + + +/* ================================================================== */ + + +DcmQueryRetrieveProcessTable::~DcmQueryRetrieveProcessTable() +{ + OFListIterator(DcmQueryRetrieveProcessSlot *) first = table_.begin(); + OFListIterator(DcmQueryRetrieveProcessSlot *) last = table_.end(); + while (first != last) + { + delete *first; + first = table_.erase(first); + } +} + +void DcmQueryRetrieveProcessTable::addProcessToTable(int pid, T_ASC_Association * assoc) +{ + DIC_NODENAME peerName; + DIC_AE callingAETitle; + DIC_AE calledAETitle; + OFBool hasStorageAbility = OFFalse; + + ASC_getPresentationAddresses(assoc->params, peerName, sizeof(peerName), NULL, 0); + ASC_getAPTitles(assoc->params, callingAETitle, sizeof(callingAETitle), calledAETitle, sizeof(calledAETitle), NULL, 0); + + for (int i=0; imatchesPID(pid)) + { + delete (*first); + table_.erase(first); + return; + } + ++first; + } +} + +OFBool DcmQueryRetrieveProcessTable::haveProcessWithWriteAccess(const char *calledAETitle) const +{ + OFListConstIterator(DcmQueryRetrieveProcessSlot *) first = table_.begin(); + OFListConstIterator(DcmQueryRetrieveProcessSlot *) last = table_.end(); + while (first != last) + { + if ((*first)->isProcessWithWriteAccess(calledAETitle)) return OFTrue; + ++first; + } + return OFFalse; +} + + +void DcmQueryRetrieveProcessTable::cleanChildren() +{ +#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) + + /* declare local variables for waitpid/wait3 */ +#ifdef HAVE_WAITPID + int stat_loc; +#else +#if defined(__NeXT__) + union wait status; /* some systems need a union wait as argument to wait3 */ +#else + int status; +#endif + struct rusage rusage; +#endif + + int child = 1; + while (child > 0) + { +#ifdef HAVE_WAITPID + child = OFstatic_cast(int, waitpid(-1, &stat_loc, WNOHANG)); +#else + child = wait3(&status, WNOHANG, &rusage); +#endif + if (child < 0) + { + if (errno == ECHILD) + { + /* no children so don't complain */ + } + else if (errno != 0) + { + char buf[256]; + DCMQRDB_ERROR("wait for child process failed: " << OFStandard::strerror(errno, buf, sizeof(buf))); + } + } + else if (child > 0) + { + DCMQRDB_INFO("Cleaned up after child (" << child << ")"); + + /* Remove Entry from Process Table */ + removeProcessFromTable(child); + } + } +#else + /* cannot wait for child processes */ +#endif +} diff --git a/dcmqrdb/libsrc/dcmqrsrv.cc b/dcmqrdb/libsrc/dcmqrsrv.cc new file mode 100644 index 00000000..7f01409c --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrsrv.cc @@ -0,0 +1,1149 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveSCP + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmqrdb/dcmqrsrv.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcmetinf.h" +#include "dcmtk/dcmqrdb/dcmqrdba.h" +#include "dcmtk/dcmqrdb/dcmqrcbf.h" /* for class DcmQueryRetrieveFindContext */ +#include "dcmtk/dcmqrdb/dcmqrcbm.h" /* for class DcmQueryRetrieveMoveContext */ +#include "dcmtk/dcmqrdb/dcmqrcbg.h" /* for class DcmQueryRetrieveGetContext */ +#include "dcmtk/dcmqrdb/dcmqrcbs.h" /* for class DcmQueryRetrieveStoreContext */ + + +static void findCallback( + /* in */ + void *callbackData, + OFBool cancelled, T_DIMSE_C_FindRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_FindRSP *response, + DcmDataset **responseIdentifiers, + DcmDataset **stDetail) +{ + DcmQueryRetrieveFindContext *context = OFstatic_cast(DcmQueryRetrieveFindContext *, callbackData); + context->callbackHandler(cancelled, request, requestIdentifiers, responseCount, response, responseIdentifiers, stDetail); +} + + +static void getCallback( + /* in */ + void *callbackData, + OFBool cancelled, T_DIMSE_C_GetRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_GetRSP *response, DcmDataset **stDetail, + DcmDataset **responseIdentifiers) +{ + DcmQueryRetrieveGetContext *context = OFstatic_cast(DcmQueryRetrieveGetContext *, callbackData); + context->callbackHandler(cancelled, request, requestIdentifiers, responseCount, response, stDetail, responseIdentifiers); +} + + +static void moveCallback( + /* in */ + void *callbackData, + OFBool cancelled, T_DIMSE_C_MoveRQ *request, + DcmDataset *requestIdentifiers, int responseCount, + /* out */ + T_DIMSE_C_MoveRSP *response, DcmDataset **stDetail, + DcmDataset **responseIdentifiers) +{ + DcmQueryRetrieveMoveContext *context = OFstatic_cast(DcmQueryRetrieveMoveContext *, callbackData); + context->callbackHandler(cancelled, request, requestIdentifiers, responseCount, response, stDetail, responseIdentifiers); +} + + +static void storeCallback( + /* in */ + void *callbackData, + T_DIMSE_StoreProgress *progress, /* progress state */ + T_DIMSE_C_StoreRQ *req, /* original store request */ + char *imageFileName, /* being received into */ + DcmDataset **imageDataSet, /* being received into */ + /* out */ + T_DIMSE_C_StoreRSP *rsp, /* final store response */ + DcmDataset **stDetail) +{ + DcmQueryRetrieveStoreContext *context = OFstatic_cast(DcmQueryRetrieveStoreContext *, callbackData); + context->callbackHandler(progress, req, imageFileName, imageDataSet, rsp, stDetail); +} + + +/* + * ============================================================================================================ + */ + + +DcmQueryRetrieveSCP::DcmQueryRetrieveSCP( + const DcmQueryRetrieveConfig& config, + const DcmQueryRetrieveOptions& options, + const DcmQueryRetrieveDatabaseHandleFactory& factory, + const DcmAssociationConfiguration& associationConfiguration) +: config_(&config) +, processtable_() +, dbCheckFindIdentifier_(OFFalse) +, dbCheckMoveIdentifier_(OFFalse) +, factory_(factory) +, options_(options) +, associationConfiguration_(associationConfiguration) +{ +} + + +OFCondition DcmQueryRetrieveSCP::dispatch(T_ASC_Association *assoc, OFBool correctUIDPadding) +{ + OFCondition cond = EC_Normal; + T_DIMSE_Message msg; + T_ASC_PresentationContextID presID; + OFBool firstLoop = OFTrue; + + // this while loop is executed exactly once unless the "keepDBHandleDuringAssociation_" + // flag is not set, in which case the inner loop is executed only once and this loop + // repeats for each incoming DIMSE command. In this case, the DB handle is created + // and released for each DIMSE command. + while (cond.good()) + { + /* Create a database handle for this association */ + DcmQueryRetrieveDatabaseHandle *dbHandle = factory_.createDBHandle( + assoc->params->DULparams.callingAPTitle, + assoc->params->DULparams.calledAPTitle, cond); + + if (cond.bad()) + { + DCMQRDB_ERROR("dispatch: cannot create DB Handle"); + return cond; + } + + if (dbHandle == NULL) + { + // this should not happen, but we check it anyway + DCMQRDB_ERROR("dispatch: cannot create DB Handle"); + return EC_IllegalCall; + } + + dbHandle->setIdentifierChecking(dbCheckFindIdentifier_, dbCheckMoveIdentifier_); + firstLoop = OFTrue; + + // this while loop is executed exactly once unless the "keepDBHandleDuringAssociation_" + // flag is set, in which case the DB handle remains open until something goes wrong + // or the remote peer closes the association + while (cond.good() && (firstLoop || options_.keepDBHandleDuringAssociation_) ) + { + firstLoop = OFFalse; + cond = DIMSE_receiveCommand(assoc, DIMSE_BLOCKING, 0, &presID, &msg, NULL); + + /* did peer release, abort, or do we have a valid message ? */ + if (cond.good()) + { + /* process command */ + switch (msg.CommandField) { + case DIMSE_C_ECHO_RQ: + cond = echoSCP(assoc, &msg.msg.CEchoRQ, presID); + break; + case DIMSE_C_STORE_RQ: + cond = storeSCP(assoc, &msg.msg.CStoreRQ, presID, *dbHandle, correctUIDPadding); + break; + case DIMSE_C_FIND_RQ: + cond = findSCP(assoc, &msg.msg.CFindRQ, presID, *dbHandle); + break; + case DIMSE_C_MOVE_RQ: + cond = moveSCP(assoc, &msg.msg.CMoveRQ, presID, *dbHandle); + break; + case DIMSE_C_GET_RQ: + cond = getSCP(assoc, &msg.msg.CGetRQ, presID, *dbHandle); + break; + case DIMSE_C_CANCEL_RQ: + /* This is a late cancel request, just ignore it */ + DCMQRDB_INFO("dispatch: late C-CANCEL-RQ, ignoring"); + break; + default: + /* we cannot handle this kind of message */ + cond = DIMSE_BADCOMMANDTYPE; + DCMQRDB_ERROR("Cannot handle command: 0x" << STD_NAMESPACE hex << + (unsigned)msg.CommandField); + /* the condition will be returned, the caller will abort the association. */ + } + } + else if ((cond == DUL_PEERREQUESTEDRELEASE)||(cond == DUL_PEERABORTEDASSOCIATION)) + { + // association gone + } + else + { + // the condition will be returned, the caller will abort the association. + } + } + + // release DB handle + delete dbHandle; + } + + // Association done + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::handleAssociation(T_ASC_Association * assoc, OFBool correctUIDPadding) +{ + OFCondition cond = EC_Normal; + DIC_NODENAME peerHostName; + DIC_AE peerAETitle; + DIC_AE myAETitle; + OFString temp_str; + + ASC_getPresentationAddresses(assoc->params, peerHostName, sizeof(peerHostName), NULL, 0); + ASC_getAPTitles(assoc->params, peerAETitle, sizeof(peerAETitle), myAETitle, sizeof(myAETitle), NULL, 0); + + /* now do the real work */ + cond = dispatch(assoc, correctUIDPadding); + + /* clean up on association termination */ + if (cond == DUL_PEERREQUESTEDRELEASE) { + DCMQRDB_INFO("Association Release"); + cond = ASC_acknowledgeRelease(assoc); + ASC_dropSCPAssociation(assoc); + } else if (cond == DUL_PEERABORTEDASSOCIATION) { + DCMQRDB_INFO("Association Aborted"); + } else { + DCMQRDB_ERROR("DIMSE Failure (aborting association): " << DimseCondition::dump(temp_str, cond)); + /* some kind of error so abort the association */ + cond = ASC_abortAssociation(assoc); + } + + cond = ASC_dropAssociation(assoc); + if (cond.bad()) { + DCMQRDB_ERROR("Cannot Drop Association: " << DimseCondition::dump(temp_str, cond)); + } + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) { + DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond)); + } + + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::echoSCP(T_ASC_Association * assoc, T_DIMSE_C_EchoRQ * req, + T_ASC_PresentationContextID presId) +{ + OFCondition cond = EC_Normal; + + DCMQRDB_INFO("Received Echo SCP RQ: MsgID " << req->MessageID); + /* we send an echo response back */ + cond = DIMSE_sendEchoResponse(assoc, presId, + req, STATUS_Success, NULL); + + if (cond.bad()) { + OFString temp_str; + DCMQRDB_ERROR("echoSCP: Echo Response Failed: " << DimseCondition::dump(temp_str, cond)); + } + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::findSCP(T_ASC_Association * assoc, T_DIMSE_C_FindRQ * request, + T_ASC_PresentationContextID presID, + DcmQueryRetrieveDatabaseHandle& dbHandle) + +{ + OFCondition cond = EC_Normal; + DcmQueryRetrieveFindContext context(dbHandle, options_, STATUS_Pending, config_->getCharacterSetOptions()); + + DIC_AE aeTitle; + aeTitle[0] = '\0'; + ASC_getAPTitles(assoc->params, NULL, 0, aeTitle, sizeof(aeTitle), NULL, 0); + context.setOurAETitle(aeTitle); + + OFString temp_str; + DCMQRDB_INFO("Received Find SCP:" << OFendl << DIMSE_dumpMessage(temp_str, *request, DIMSE_INCOMING)); + + cond = DIMSE_findProvider(assoc, presID, request, + findCallback, &context, options_.blockMode_, options_.dimse_timeout_); + if (cond.bad()) { + DCMQRDB_ERROR("Find SCP Failed: " << DimseCondition::dump(temp_str, cond)); + } + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::getSCP(T_ASC_Association * assoc, T_DIMSE_C_GetRQ * request, + T_ASC_PresentationContextID presID, DcmQueryRetrieveDatabaseHandle& dbHandle) +{ + OFCondition cond = EC_Normal; + DcmQueryRetrieveGetContext context(dbHandle, options_, STATUS_Pending, assoc, request->MessageID, request->Priority, presID); + + DIC_AE aeTitle; + aeTitle[0] = '\0'; + ASC_getAPTitles(assoc->params, NULL, 0, aeTitle, sizeof(aeTitle), NULL, 0); + context.setOurAETitle(aeTitle); + + OFString temp_str; + DCMQRDB_INFO("Received Get SCP:" << OFendl << DIMSE_dumpMessage(temp_str, *request, DIMSE_INCOMING)); + + cond = DIMSE_getProvider(assoc, presID, request, + getCallback, &context, options_.blockMode_, options_.dimse_timeout_); + if (cond.bad()) { + DCMQRDB_ERROR("Get SCP Failed: " << DimseCondition::dump(temp_str, cond)); + } + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::moveSCP(T_ASC_Association * assoc, T_DIMSE_C_MoveRQ * request, + T_ASC_PresentationContextID presID, DcmQueryRetrieveDatabaseHandle& dbHandle) +{ + OFCondition cond = EC_Normal; + DcmQueryRetrieveMoveContext context(dbHandle, options_, associationConfiguration_, config_, STATUS_Pending, assoc, request->MessageID, request->Priority); + + DIC_AE aeTitle; + aeTitle[0] = '\0'; + ASC_getAPTitles(assoc->params, NULL, 0, aeTitle, sizeof(aeTitle), NULL, 0); + context.setOurAETitle(aeTitle); + + OFString temp_str; + DCMQRDB_INFO("Received Move SCP:" << OFendl << DIMSE_dumpMessage(temp_str, *request, DIMSE_INCOMING)); + + cond = DIMSE_moveProvider(assoc, presID, request, + moveCallback, &context, options_.blockMode_, options_.dimse_timeout_); + if (cond.bad()) { + DCMQRDB_ERROR("Move SCP Failed: " << DimseCondition::dump(temp_str, cond)); + } + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::storeSCP(T_ASC_Association * assoc, T_DIMSE_C_StoreRQ * request, + T_ASC_PresentationContextID presId, + DcmQueryRetrieveDatabaseHandle& dbHandle, + OFBool correctUIDPadding) +{ + OFCondition cond = EC_Normal; + OFCondition dbcond = EC_Normal; + char imageFileName[MAXPATHLEN+1]; + DcmFileFormat dcmff; + + DcmQueryRetrieveStoreContext context(dbHandle, options_, STATUS_Success, &dcmff, correctUIDPadding); + + OFString temp_str; + DCMQRDB_INFO("Received Store SCP:" << OFendl << DIMSE_dumpMessage(temp_str, *request, DIMSE_INCOMING)); + + if (!dcmIsaStorageSOPClassUID(request->AffectedSOPClassUID)) { + /* callback will send back sop class not supported status */ + context.setStatus(STATUS_STORE_Refused_SOPClassNotSupported); + /* must still receive data */ + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName)); + } else if (options_.ignoreStoreData_) { + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName)); + } else { + dbcond = dbHandle.makeNewStoreFileName( + request->AffectedSOPClassUID, + request->AffectedSOPInstanceUID, + imageFileName, sizeof(imageFileName)); + if (dbcond.bad()) { + DCMQRDB_ERROR("storeSCP: Database: makeNewStoreFileName Failed"); + /* must still receive data */ + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName)); + /* callback will send back out of resources status */ + context.setStatus(STATUS_STORE_Refused_OutOfResources); + } + } + +#ifdef LOCK_IMAGE_FILES + /* exclusively lock image file */ +#ifdef O_BINARY + int lockfd = open(imageFileName, (O_WRONLY | O_CREAT | O_TRUNC | O_BINARY), 0666); +#else + int lockfd = open(imageFileName, (O_WRONLY | O_CREAT | O_TRUNC), 0666); +#endif + if (lockfd < 0) + { + DCMQRDB_ERROR("storeSCP: file locking failed, cannot create file"); + + /* must still receive data */ + OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName)); + + /* callback will send back out of resources status */ + context.setStatus(STATUS_STORE_Refused_OutOfResources); + } + else + dcmtk_flock(lockfd, LOCK_EX); +#endif + + context.setFileName(imageFileName); + + // store SourceApplicationEntityTitle in metaheader + if (assoc && assoc->params) + { + const char *aet = assoc->params->DULparams.callingAPTitle; + if (aet) dcmff.getMetaInfo()->putAndInsertString(DCM_SourceApplicationEntityTitle, aet); + } + + DcmDataset *dset = dcmff.getDataset(); + + /* we must still retrieve the data set even if some error has occurred */ + + if (options_.bitPreserving_) { /* the bypass option can be set on the command line */ + cond = DIMSE_storeProvider(assoc, presId, request, imageFileName, (int)options_.useMetaheader_, + NULL, storeCallback, + (void*)&context, options_.blockMode_, options_.dimse_timeout_); + } else { + cond = DIMSE_storeProvider(assoc, presId, request, (char *)NULL, (int)options_.useMetaheader_, + &dset, storeCallback, + (void*)&context, options_.blockMode_, options_.dimse_timeout_); + } + + if (cond.bad()) { + DCMQRDB_ERROR("Store SCP Failed: " << DimseCondition::dump(temp_str, cond)); + } + if (!options_.ignoreStoreData_ && (cond.bad() || (context.getStatus() != STATUS_Success))) + { + /* remove file */ + if (strcmp(imageFileName, NULL_DEVICE_NAME) != 0) // don't try to delete /dev/null + { + DCMQRDB_INFO("Store SCP: Deleting Image File: %s" << imageFileName); + OFStandard::deleteFile(imageFileName); + } + dbHandle.pruneInvalidRecords(); + } + +#ifdef LOCK_IMAGE_FILES + /* unlock image file */ + if (lockfd >= 0) + { + dcmtk_flock(lockfd, LOCK_UN); + close(lockfd); + } +#endif + + return cond; +} + + +/* Association negotiation */ + +void DcmQueryRetrieveSCP::refuseAnyStorageContexts(T_ASC_Association * assoc) +{ + int i; + T_ASC_PresentationContextID pid; + + for (i = 0; i < numberOfDcmAllStorageSOPClassUIDs; i++) { + do { + pid = ASC_findAcceptedPresentationContextID(assoc, dcmAllStorageSOPClassUIDs[i]); + if (pid != 0) ASC_refusePresentationContext(assoc->params, pid, ASC_P_USERREJECTION); + } while (pid != 0); // repeat as long as we find presentation contexts for this SOP class - there might be multiple ones. + } +} + + +OFCondition DcmQueryRetrieveSCP::refuseAssociation(T_ASC_Association ** assoc, CTN_RefuseReason reason) +{ + OFCondition cond = EC_Normal; + T_ASC_RejectParameters rej; + OFString temp_str; + + const char *reason_string; + switch (reason) + { + case CTN_TooManyAssociations: + reason_string = "TooManyAssociations"; + break; + case CTN_CannotFork: + reason_string = "CannotFork"; + break; + case CTN_BadAppContext: + reason_string = "BadAppContext"; + break; + case CTN_BadAEPeer: + reason_string = "BadAEPeer"; + break; + case CTN_BadAEService: + reason_string = "BadAEService"; + break; + case CTN_NoReason: + reason_string = "NoReason"; + break; + default: + reason_string = "???"; + break; + } + DCMQRDB_INFO("Refusing Association (" << reason_string << ")"); + + switch (reason) + { + case CTN_TooManyAssociations: + rej.result = ASC_RESULT_REJECTEDTRANSIENT; + rej.source = ASC_SOURCE_SERVICEPROVIDER_PRESENTATION_RELATED; + rej.reason = ASC_REASON_SP_PRES_LOCALLIMITEXCEEDED; + break; + case CTN_CannotFork: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEPROVIDER_PRESENTATION_RELATED; + rej.reason = ASC_REASON_SP_PRES_TEMPORARYCONGESTION; + break; + case CTN_BadAppContext: + rej.result = ASC_RESULT_REJECTEDTRANSIENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED; + break; + case CTN_BadAEPeer: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_CALLINGAETITLENOTRECOGNIZED; + break; + case CTN_BadAEService: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_CALLEDAETITLENOTRECOGNIZED; + break; + case CTN_NoReason: + default: + rej.result = ASC_RESULT_REJECTEDPERMANENT; + rej.source = ASC_SOURCE_SERVICEUSER; + rej.reason = ASC_REASON_SU_NOREASON; + break; + } + + cond = ASC_rejectAssociation(*assoc, &rej); + + if (cond.bad()) + { + DCMQRDB_ERROR("Association Reject Failed: " << DimseCondition::dump(temp_str, cond)); + } + + cond = ASC_dropAssociation(*assoc); + if (cond.bad()) + { + DCMQRDB_ERROR("Cannot Drop Association: " << DimseCondition::dump(temp_str, cond)); + } + cond = ASC_destroyAssociation(assoc); + if (cond.bad()) + { + DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond)); + } + + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::negotiateAssociation(T_ASC_Association * assoc) +{ + OFCondition cond = EC_Normal; + int i; + T_ASC_PresentationContextID movepid, findpid; + OFString temp_str; + struct { const char *moveSyntax, *findSyntax; } queryRetrievePairs[] = + { + { UID_MOVEPatientRootQueryRetrieveInformationModel, + UID_FINDPatientRootQueryRetrieveInformationModel }, + { UID_MOVEStudyRootQueryRetrieveInformationModel, + UID_FINDStudyRootQueryRetrieveInformationModel }, + { UID_RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel, + UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel } + }; + + DIC_AE calledAETitle; + ASC_getAPTitles(assoc->params, NULL, 0, calledAETitle, sizeof(calledAETitle), NULL, 0); + + const char* transferSyntaxes[] = { NULL, NULL, NULL, NULL }; + int numTransferSyntaxes = 0; + + switch (options_.networkTransferSyntax_) + { + case EXS_LittleEndianImplicit: + /* we only support Little Endian Implicit */ + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + break; + case EXS_LittleEndianExplicit: + /* we prefer Little Endian Explicit */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + case EXS_BigEndianExplicit: + /* we prefer Big Endian Explicit */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; +#ifndef DISABLE_COMPRESSION_EXTENSION + case EXS_JPEGProcess14SV1: + /* we prefer JPEGLossless:Hierarchical-1stOrderPrediction (default lossless) */ + transferSyntaxes[0] = UID_JPEGProcess14SV1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess1: + /* we prefer JPEGBaseline (default lossy for 8 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGProcess2_4: + /* we prefer JPEGExtended (default lossy for 12 bit images) */ + transferSyntaxes[0] = UID_JPEGProcess2_4TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000LosslessOnly: + /* we prefer JPEG 2000 lossless */ + transferSyntaxes[0] = UID_JPEG2000LosslessOnlyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEG2000: + /* we prefer JPEG 2000 lossy or lossless */ + transferSyntaxes[0] = UID_JPEG2000TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossless: + /* we prefer JPEG-LS Lossless */ + transferSyntaxes[0] = UID_JPEGLSLosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_JPEGLSLossy: + /* we prefer JPEG-LS Lossy */ + transferSyntaxes[0] = UID_JPEGLSLossyTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG2MainProfileAtMainLevel: + /* we prefer MPEG2 MP@ML */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtMainLevelTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG2MainProfileAtHighLevel: + /* we prefer MPEG2 MP@HL */ + transferSyntaxes[0] = UID_MPEG2MainProfileAtHighLevelTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_1: + /* we prefer MPEG4 HP/L4.1 */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4BDcompatibleHighProfileLevel4_1: + /* we prefer MPEG4 BD HP/L4.1 */ + transferSyntaxes[0] = UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_2_For2DVideo: + /* we prefer MPEG4 HP/L4.2 for 2D Videos */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4HighProfileLevel4_2_For3DVideo: + /* we prefer MPEG4 HP/L4.2 for 3D Videos */ + transferSyntaxes[0] = UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_MPEG4StereoHighProfileLevel4_2: + /* we prefer MPEG4 Stereo HP/L4.2 */ + transferSyntaxes[0] = UID_MPEG4StereoHighProfileLevel4_2TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_HEVCMainProfileLevel5_1: + /* we prefer HEVC/H.265 Main Profile/L5.1 */ + transferSyntaxes[0] = UID_HEVCMainProfileLevel5_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_HEVCMain10ProfileLevel5_1: + /* we prefer HEVC/H.265 Main 10 Profile/L5.1 */ + transferSyntaxes[0] = UID_HEVCMain10ProfileLevel5_1TransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; + case EXS_RLELossless: + /* we prefer RLE Lossless */ + transferSyntaxes[0] = UID_RLELosslessTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#ifdef WITH_ZLIB + case EXS_DeflatedLittleEndianExplicit: + /* we prefer deflated transmission */ + transferSyntaxes[0] = UID_DeflatedExplicitVRLittleEndianTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[3] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 4; + break; +#endif +#endif + default: + /* We prefer explicit transfer syntaxes. + * If we are running on a Little Endian machine we prefer + * LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + */ + if (gLocalByteOrder == EBO_LittleEndian) /* defined in dcxfer.h */ + { + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + } else { + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + } + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + break; + } + + const char * const nonStorageSyntaxes[] = + { + UID_VerificationSOPClass, + UID_FINDPatientRootQueryRetrieveInformationModel, + UID_MOVEPatientRootQueryRetrieveInformationModel, + UID_GETPatientRootQueryRetrieveInformationModel, +#ifndef NO_PATIENTSTUDYONLY_SUPPORT + UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel, + UID_RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel, + UID_RETIRED_GETPatientStudyOnlyQueryRetrieveInformationModel, +#endif + UID_FINDStudyRootQueryRetrieveInformationModel, + UID_MOVEStudyRootQueryRetrieveInformationModel, + UID_GETStudyRootQueryRetrieveInformationModel, + UID_PrivateShutdownSOPClass + }; + + const int numberOfNonStorageSyntaxes = DIM_OF(nonStorageSyntaxes); + const char *selectedNonStorageSyntaxes[DIM_OF(nonStorageSyntaxes)]; + int numberOfSelectedNonStorageSyntaxes = 0; + for (i = 0; i < numberOfNonStorageSyntaxes; i++) + { + if (0 == strcmp(nonStorageSyntaxes[i], UID_FINDPatientRootQueryRetrieveInformationModel)) + { + if (options_.supportPatientRoot_) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_MOVEPatientRootQueryRetrieveInformationModel)) + { + if (options_.supportPatientRoot_) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_GETPatientRootQueryRetrieveInformationModel)) + { + if (options_.supportPatientRoot_ && (! options_.disableGetSupport_)) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_RETIRED_FINDPatientStudyOnlyQueryRetrieveInformationModel)) + { + if (options_.supportPatientStudyOnly_) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_RETIRED_MOVEPatientStudyOnlyQueryRetrieveInformationModel)) + { + if (options_.supportPatientStudyOnly_) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_RETIRED_GETPatientStudyOnlyQueryRetrieveInformationModel)) + { + if (options_.supportPatientStudyOnly_ && (! options_.disableGetSupport_)) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_FINDStudyRootQueryRetrieveInformationModel)) + { + if (options_.supportStudyRoot_) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_MOVEStudyRootQueryRetrieveInformationModel)) + { + if (options_.supportStudyRoot_) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_GETStudyRootQueryRetrieveInformationModel)) + { + if (options_.supportStudyRoot_ && (! options_.disableGetSupport_)) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + else if (0 == strcmp(nonStorageSyntaxes[i], UID_PrivateShutdownSOPClass)) + { + if (options_.allowShutdown_) selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } else { + selectedNonStorageSyntaxes[numberOfSelectedNonStorageSyntaxes++] = nonStorageSyntaxes[i]; + } + } + + if (options_.incomingProfile.empty()) + { + /* accept any of the storage syntaxes */ + if (options_.disableGetSupport_) + { + /* accept storage syntaxes with default role only */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( + assoc->params, + dcmAllStorageSOPClassUIDs, numberOfDcmAllStorageSOPClassUIDs, + (const char**)transferSyntaxes, numTransferSyntaxes); + if (cond.bad()) { + DCMQRDB_ERROR("Cannot accept presentation contexts: " << DimseCondition::dump(temp_str, cond)); + } + } else { + /* accept storage syntaxes with proposed role */ + T_ASC_PresentationContext pc; + T_ASC_SC_ROLE role; + int npc = ASC_countPresentationContexts(assoc->params); + for (i = 0; i < npc; i++) + { + ASC_getPresentationContext(assoc->params, i, &pc); + if (dcmIsaStorageSOPClassUID(pc.abstractSyntax)) + { + /* + ** We are prepared to accept whatever role he proposes. + ** Normally we can be the SCP of the Storage Service Class. + ** When processing the C-GET operation we can be the SCU of the Storage Service Class. + */ + role = pc.proposedRole; + + /* + ** Accept in the order "least wanted" to "most wanted" transfer + ** syntax. Accepting a transfer syntax will override previously + ** accepted transfer syntaxes. + */ + for (int k = numTransferSyntaxes - 1; k >= 0; k--) + { + for (int j = 0; j < (int)pc.transferSyntaxCount; j++) + { + /* if the transfer syntax was proposed then we can accept it + * appears in our supported list of transfer syntaxes + */ + if (strcmp(pc.proposedTransferSyntaxes[j], transferSyntaxes[k]) == 0) + { + cond = ASC_acceptPresentationContext( + assoc->params, pc.presentationContextID, transferSyntaxes[k], role); + if (cond.bad()) return cond; + } + } + } + } + } /* for */ + } /* else */ + } + else + { + cond = associationConfiguration_.evaluateAssociationParameters(options_.incomingProfile.c_str(), *assoc); + if (cond.bad()) return cond; + } + + /* accept any of the non-storage syntaxes */ + cond = ASC_acceptContextsWithPreferredTransferSyntaxes( + assoc->params, + (const char**)selectedNonStorageSyntaxes, numberOfSelectedNonStorageSyntaxes, + (const char**)transferSyntaxes, numTransferSyntaxes); + if (cond.bad()) { + DCMQRDB_ERROR("Cannot accept presentation contexts: " << DimseCondition::dump(temp_str, cond)); + } + + /* + * check if we have negotiated the private "shutdown" SOP Class + */ + if (0 != ASC_findAcceptedPresentationContextID(assoc, UID_PrivateShutdownSOPClass)) + { + DCMQRDB_INFO("Shutting down server ... (negotiated private \"shut down\" SOP class)"); + refuseAssociation(&assoc, CTN_NoReason); + return ASC_SHUTDOWNAPPLICATION; + } + + /* + * Refuse any "Storage" presentation contexts to non-writable + * storage areas. + */ + if (!config_->writableStorageArea(calledAETitle)) + { + refuseAnyStorageContexts(assoc); + } + + /* + * Enforce RSNA'93 Demonstration Requirements about only + * accepting a context for MOVE if a context for FIND is also present. + */ + + for (i = 0; i < (int)DIM_OF(queryRetrievePairs); i++) { + movepid = ASC_findAcceptedPresentationContextID(assoc, + queryRetrievePairs[i].moveSyntax); + if (movepid != 0) { + findpid = ASC_findAcceptedPresentationContextID(assoc, + queryRetrievePairs[i].findSyntax); + if (findpid == 0) { + if (options_.requireFindForMove_) { + /* refuse the move */ + ASC_refusePresentationContext(assoc->params, + movepid, ASC_P_USERREJECTION); + } else { + DCMQRDB_ERROR("Move Presentation Context but no Find (accepting for now)"); + } + } + } + } + + /* + * Enforce an Ad-Hoc rule to limit storage access. + * If the storage area is "writable" and some other association has + * already negotiated a "Storage" class presentation context, + * then refuse any "storage" presentation contexts. + */ + + if (options_.refuseMultipleStorageAssociations_) + { + if (config_->writableStorageArea(calledAETitle)) + { + if (processtable_.haveProcessWithWriteAccess(calledAETitle)) + { + refuseAnyStorageContexts(assoc); + } + } + } + + return cond; +} + + +OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet) +{ + OFCondition cond = EC_Normal; + OFString temp_str; +#ifdef HAVE_FORK + int pid; +#endif + T_ASC_Association *assoc; + char buf[BUFSIZ]; + int timeout; + OFBool go_cleanup = OFFalse; + + if (options_.singleProcess_) timeout = 1000; + else + { + if (processtable_.countChildProcesses() > 0) + { + timeout = 1; + } else { + timeout = 1000; + } + } + + if (ASC_associationWaiting(theNet, timeout)) + { + cond = ASC_receiveAssociation(theNet, &assoc, (int)options_.maxPDU_); + if (cond.bad()) + { + DCMQRDB_INFO("Failed to receive association: " << DimseCondition::dump(temp_str, cond)); + go_cleanup = OFTrue; + } + } else return EC_Normal; + + if (! go_cleanup) + { + DCMQRDB_INFO("Association Received (" << assoc->params->DULparams.callingPresentationAddress + << ":" << assoc->params->DULparams.callingAPTitle << " -> " + << assoc->params->DULparams.calledAPTitle << ")"); + + DCMQRDB_DEBUG("Parameters:" << OFendl << ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_RQ)); + + if (options_.refuse_) + { + DCMQRDB_INFO("Refusing Association (forced via command line)"); + cond = refuseAssociation(&assoc, CTN_NoReason); + go_cleanup = OFTrue; + } + } + + if (! go_cleanup) + { + /* Application Context Name */ + cond = ASC_getApplicationContextName(assoc->params, buf, sizeof(buf)); + if (cond.bad() || strcmp(buf, DICOM_STDAPPLICATIONCONTEXT) != 0) + { + /* reject: the application context name is not supported */ + DCMQRDB_INFO("Bad AppContextName: " << buf); + cond = refuseAssociation(&assoc, CTN_BadAppContext); + go_cleanup = OFTrue; + } + } + + if (! go_cleanup) + { + /* Implementation Class UID */ + if (options_.rejectWhenNoImplementationClassUID_ && + strlen(assoc->params->theirImplementationClassUID) == 0) + { + /* reject: no implementation Class UID provided */ + DCMQRDB_INFO("No implementation Class UID provided"); + cond = refuseAssociation(&assoc, CTN_NoReason); + go_cleanup = OFTrue; + } + } + + if (! go_cleanup) + { + /* Does peer AE have access to required service ?? */ + if (! config_->peerInAETitle(assoc->params->DULparams.calledAPTitle, + assoc->params->DULparams.callingAPTitle, + assoc->params->DULparams.callingPresentationAddress)) + { + DCMQRDB_DEBUG("Peer " + << assoc->params->DULparams.callingPresentationAddress << ":" + << assoc->params->DULparams.callingAPTitle << " is not not permitted to access " + << assoc->params->DULparams.calledAPTitle << " (see configuration file)"); + cond = refuseAssociation(&assoc, CTN_BadAEService); + go_cleanup = OFTrue; + } + } + + if (! go_cleanup) + { + // too many concurrent associations ?? + if (processtable_.countChildProcesses() >= OFstatic_cast(size_t, options_.maxAssociations_)) + { + cond = refuseAssociation(&assoc, CTN_TooManyAssociations); + go_cleanup = OFTrue; + } + } + + if (! go_cleanup) + { + cond = negotiateAssociation(assoc); + if (cond.bad()) go_cleanup = OFTrue; + } + + if (! go_cleanup) + { + cond = ASC_acknowledgeAssociation(assoc); + if (cond.bad()) + { + DCMQRDB_ERROR(DimseCondition::dump(temp_str, cond)); + go_cleanup = OFTrue; + } + } + + if (! go_cleanup) + { + DCMQRDB_INFO("Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")"); + if (ASC_countAcceptedPresentationContexts(assoc->params) == 0) + DCMQRDB_INFO(" (but no valid presentation contexts)"); + DCMQRDB_DEBUG(ASC_dumpParameters(temp_str, assoc->params, ASC_ASSOC_AC)); + + if (options_.singleProcess_) + { + /* don't spawn a sub-process to handle the association */ + cond = handleAssociation(assoc, options_.correctUIDPadding_); + } +#ifdef HAVE_FORK + else + { + /* spawn a sub-process to handle the association */ + pid = (int)(fork()); + if (pid < 0) + { + DCMQRDB_ERROR("Cannot create association sub-process: " + << OFStandard::getLastSystemErrorCode().message()); + cond = refuseAssociation(&assoc, CTN_CannotFork); + go_cleanup = OFTrue; + } + else if (pid > 0) + { + /* parent process, note process in table */ + processtable_.addProcessToTable(pid, assoc); + } + else + { + /* child process, handle the association */ + cond = handleAssociation(assoc, options_.correctUIDPadding_); + /* the child process is done so exit */ + exit(0); + } + } +#endif + } + + // cleanup code + OFCondition oldcond = cond; /* store condition flag for later use */ + if (!options_.singleProcess_ && (cond != ASC_SHUTDOWNAPPLICATION)) + { + /* the child will handle the association, we can drop it */ + cond = ASC_dropAssociation(assoc); + if (cond.bad()) + { + DCMQRDB_ERROR("Cannot Drop Association: " << DimseCondition::dump(temp_str, cond)); + } + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) + { + DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond)); + } + } + + if (oldcond == ASC_SHUTDOWNAPPLICATION) cond = oldcond; /* abort flag is reported to top-level wait loop */ + return cond; +} + + +void DcmQueryRetrieveSCP::cleanChildren() +{ + processtable_.cleanChildren(); +} + + +void DcmQueryRetrieveSCP::setDatabaseFlags( + OFBool dbCheckFindIdentifier, + OFBool dbCheckMoveIdentifier) +{ + dbCheckFindIdentifier_ = dbCheckFindIdentifier; + dbCheckMoveIdentifier_ = dbCheckMoveIdentifier; +} diff --git a/dcmqrdb/libsrc/dcmqrtis.cc b/dcmqrdb/libsrc/dcmqrtis.cc new file mode 100644 index 00000000..f11a2b1a --- /dev/null +++ b/dcmqrdb/libsrc/dcmqrtis.cc @@ -0,0 +1,2193 @@ +/* + * + * Copyright (C) 1993-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmqrdb + * + * Author: Marco Eichelberg + * + * Purpose: class DcmQueryRetrieveOptions + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmqrdb/dcmqrtis.h" + +#include "dcmtk/dcmnet/diutil.h" +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmqrdb/dcmqrdbi.h" +#include "dcmtk/dcmqrdb/dcmqrdbs.h" +#include "dcmtk/dcmdata/dcfilefo.h" +#include "dcmtk/dcmqrdb/dcmqropt.h" + +BEGIN_EXTERN_C +#ifdef HAVE_SYS_STAT_H +#include /* needed for stat() */ +#endif +#ifdef HAVE_FCNTL_H +#include /* needed on Solaris for O_RDONLY */ +#endif +END_EXTERN_C + +/* ========================================== helper functions ======================================== */ + +OFBool TI_addStudyEntry(TI_DBEntry *db, DcmDataset *reply); +OFBool TI_addSeriesEntry(TI_StudyEntry *study, DcmDataset *reply); +OFBool TI_addImageEntry(TI_SeriesEntry *series, DcmDataset *reply); +extern "C" int TI_seriesCompare(const void *a, const void *b); +extern "C" int TI_imageCompare(const void *a, const void *b); + +static void +TI_getInfoFromDataset(DcmDataset *dset, DIC_PN patientName, DIC_CS studyId, + DIC_IS seriesNumber, DIC_CS modality, DIC_IS imageNumber) +{ + DU_getStringDOElement(dset, DCM_PatientName, patientName, sizeof(DIC_PN)); + DU_stripLeadingAndTrailingSpaces(patientName); + DU_getStringDOElement(dset, DCM_StudyID, studyId, sizeof(DIC_CS)); + DU_stripLeadingAndTrailingSpaces(studyId); + DU_getStringDOElement(dset, DCM_SeriesNumber, seriesNumber, sizeof(DIC_IS)); + DU_stripLeadingAndTrailingSpaces(seriesNumber); + DU_getStringDOElement(dset, DCM_Modality, modality, sizeof(DIC_CS)); + DU_stripLeadingAndTrailingSpaces(modality); + DU_getStringDOElement(dset, DCM_InstanceNumber, imageNumber, sizeof(DIC_IS)); + DU_stripLeadingAndTrailingSpaces(imageNumber); +} + +static void +TI_getInfoFromImage(char *imgFile, DIC_PN patientName, DIC_CS studyId, + DIC_IS seriesNumber, DIC_CS modality, DIC_IS imageNumber) +{ + DcmFileFormat dcmff; + if (dcmff.loadFile(imgFile).bad()) + { + DCMQRDB_ERROR("Help!, cannot open image file: " << imgFile); + return; + } + + DcmDataset *obj = dcmff.getDataset(); + + TI_getInfoFromDataset(obj, patientName, studyId, seriesNumber, + modality, imageNumber); +} + +static void +TI_destroyImageEntries(TI_SeriesEntry *series) +{ + int i; + + if (series == NULL) return; + + for (i=0; iimageCount; i++) { + free(series->images[i]); + series->images[i] = NULL; + } + series->imageCount = 0; +} + +static void +TI_destroySeriesEntries(TI_StudyEntry *study) +{ + int i; + + if (study == NULL) return; + + for (i=0; iseriesCount; i++) { + TI_destroyImageEntries(study->series[i]); + free(study->series[i]); + study->series[i] = NULL; + } + study->seriesCount = 0; +} + +static void +TI_destroyStudyEntries(TI_DBEntry *db) +{ + int i; + + if (db == NULL) return; + + for (i=0; istudyCount; i++) { + TI_destroySeriesEntries(db->studies[i]); + free(db->studies[i]); + db->studies[i] = NULL; + } + + db->studyCount = 0; +} + +static void storeProgressCallback(void * /*callbackData*/, + T_DIMSE_StoreProgress *progress, + T_DIMSE_C_StoreRQ * /*req*/) +{ + int percent; + static int dotsSoFar = 0; + int dotsToPrint; + int i; + + switch (progress->state) { + case DIMSE_StoreBegin: + printf(" 0%%________25%%_________50%%__________75%%________100%%\n"); + printf(" "); + dotsSoFar = 0; + break; + case DIMSE_StoreEnd: + printf("\n"); + break; + default: + if (progress->totalBytes == 0) { + percent = 100; + } else { + percent = (int)(((float)progress->progressBytes / + (float)progress->totalBytes) * 100.0); + } + dotsToPrint = (percent/2) - dotsSoFar; + for (i=0; icbf(cbd->cbs, responseIdentifiers); + + /* responseIdentifers will be deleted in DIMSE_findUser() */ +} + +static OFBool TI_welcome() +{ + printf("\n"); + printf("Welcome to the Image CTN Telnet Initiator\n"); + printf("\n"); + printf("This program allows you to list the contents of the CTN databases, send\n"); + printf("images to peer Application Entities (AEs), and to verify connectivity with\n"); + printf("peer AEs.\n"); + printf("The databases can only be viewed using a Study/Series/Image\n"); + printf("information model.\n"); + printf("\n"); + printf("Network associations will be started when you try to send a\n"); + printf("study/series/image or perform an echo.\n"); + printf("\n"); + printf("The prompt shows the current database title and the current peer AE title.\n"); + printf("\n"); + printf("Type help for help\n"); + + return OFTrue; +} + +static OFBool TI_detachDB(TI_DBEntry *db) +{ + if (db == NULL) return OFTrue; + + TI_destroyStudyEntries(db); + + if (!db->isRemoteDB && db->dbHandle != NULL) { + delete db->dbHandle; + db->dbHandle = NULL; + } else { + + } + + return OFTrue; +} + +#define STUDYFORMAT "%-30s %-12s %-12s\n" + +static void printStudyEntry(TI_StudyEntry *study) +{ + printf(STUDYFORMAT, study->patientName, study->patientID, + study->studyID); +} + +#define SERIESFORMAT "%-6s %-8s %-s\n" + +static void printSeriesEntry(TI_SeriesEntry *series) +{ + printf(SERIESFORMAT, series->seriesNumber, + series->modality, series->seriesInstanceUID); +} + +#define IMAGEFORMAT "%-5s %-s\n" + +static void printImageEntry(TI_ImageEntry *image) +{ + printf(IMAGEFORMAT, image->imageNumber, image->sopInstanceUID); +} + +static void TI_buildStudyQuery(DcmDataset **query) +{ + if (*query != NULL) delete *query; + *query = new DcmDataset; + if (*query == NULL) { + DCMQRDB_ERROR("Help, out of memory"); + return; + } + + DU_putStringDOElement(*query, DCM_QueryRetrieveLevel, "STUDY"); + DU_putStringDOElement(*query, DCM_StudyInstanceUID, NULL); + DU_putStringDOElement(*query, DCM_StudyID, NULL); + DU_putStringDOElement(*query, DCM_PatientName, NULL); + DU_putStringDOElement(*query, DCM_PatientID, NULL); +} + +static OFBool TI_genericEntryCallback(TI_GenericCallbackStruct *cbs, DcmDataset *reply) +{ + if (cbs->db) return TI_addStudyEntry(cbs->db, reply); + if (cbs->study) return TI_addSeriesEntry(cbs->study, reply); + if (cbs->series) return TI_addImageEntry(cbs->series, reply); + return OFFalse; +} + +OFBool +TI_addSeriesEntry(TI_StudyEntry *study, DcmDataset *reply) +{ + TI_SeriesEntry *series; + OFBool ok = OFTrue; + + if (study->seriesCount >= TI_MAXSERIES) { + DCMQRDB_ERROR("TI_addSeriesEntry: too many series"); + return OFFalse; + } + + series = (TI_SeriesEntry*) malloc(sizeof(TI_SeriesEntry)); + if (series == NULL) return OFFalse; + + bzero((char*)series, sizeof(TI_SeriesEntry)); /* make sure its clean */ + + /* extract info from reply */ + ok = DU_getStringDOElement(reply, DCM_SeriesInstanceUID, series->seriesInstanceUID, sizeof(series->seriesInstanceUID)); + if (ok) ok = DU_getStringDOElement(reply, DCM_SeriesNumber, series->seriesNumber, sizeof(series->seriesNumber)); + if (ok) ok = DU_getStringDOElement(reply, DCM_Modality, series->modality, sizeof(series->modality)); + + if (!ok) { + DCMQRDB_ERROR("TI_addSeriesEntry: missing data in DB reply"); + return OFFalse; + } + + DU_stripLeadingAndTrailingSpaces(series->seriesInstanceUID); + DU_stripLeadingAndTrailingSpaces(series->seriesNumber); + DU_stripLeadingAndTrailingSpaces(series->modality); + + series->intSeriesNumber = atoi(series->seriesNumber); + + /* add to array */ + study->series[study->seriesCount] = series; + study->seriesCount++; + + return OFTrue; +} + +int TI_seriesCompare(const void *a, const void *b) +{ + TI_SeriesEntry **sa, **sb; + int cmp = 0; + + /* compare function for qsort, a and b are pointers to + * the images array elements. The routine must return an + * integer less than, equal to, or greater than 0 according as + * the first argument is to be considered less than, equal to, + * or greater than the second. + */ + sa = (TI_SeriesEntry **)a; + sb = (TI_SeriesEntry **)b; + + cmp = (*sa)->intSeriesNumber - (*sb)->intSeriesNumber; + + return cmp; +} + +static void TI_buildSeriesQuery(DcmDataset **query, TI_StudyEntry *study) +{ + if (*query != NULL) delete *query; + *query = new DcmDataset; + if (*query == NULL) { + DCMQRDB_ERROR("Help, out of memory"); + return; + } + + DU_putStringDOElement(*query, DCM_QueryRetrieveLevel, "SERIES"); + DU_putStringDOElement(*query, DCM_StudyInstanceUID, + study->studyInstanceUID); + DU_putStringDOElement(*query, DCM_SeriesInstanceUID, NULL); + DU_putStringDOElement(*query, DCM_Modality, NULL); + DU_putStringDOElement(*query, DCM_SeriesNumber, NULL); +} + +OFBool +TI_addImageEntry(TI_SeriesEntry *series, DcmDataset *reply) +{ + TI_ImageEntry *image; + OFBool ok = OFTrue; + DIC_CS studyID; + + if (series->imageCount >= TI_MAXIMAGES) { + DCMQRDB_ERROR("TI_addImageEntry: too many images"); + return OFFalse; + } + + image = (TI_ImageEntry*) malloc(sizeof(TI_ImageEntry)); + if (image == NULL) return OFFalse; + + bzero((char*)image, sizeof(TI_ImageEntry)); /* make sure its clean */ + bzero((char*)studyID, sizeof(DIC_CS)); + + /* extract info from reply */ + ok = DU_getStringDOElement(reply, DCM_SOPInstanceUID, image->sopInstanceUID, sizeof(image->sopInstanceUID)); + if (ok) ok = DU_getStringDOElement(reply, DCM_InstanceNumber, image->imageNumber, sizeof(image->imageNumber)); + + if (!ok) { + DCMQRDB_ERROR("TI_addImageEntry: missing data in DB reply"); + return OFFalse; + } + + DU_stripLeadingAndTrailingSpaces(image->sopInstanceUID); + DU_stripLeadingAndTrailingSpaces(image->imageNumber); + + image->intImageNumber = atoi(image->imageNumber); + + /* add to array */ + series->images[series->imageCount] = image; + series->imageCount++; + + return OFTrue; +} + +int TI_imageCompare(const void *a, const void *b) +{ + TI_ImageEntry **ia, **ib; + int cmp = 0; + + /* compare function for qsort, a and b are pointers to + * the images array elements. The routine must return an + * integer less than, equal to, or greater than 0 according as + * the first argument is to be considered less than, equal to, + * or greater than the second. + */ + ia = (TI_ImageEntry **)a; + ib = (TI_ImageEntry **)b; + + /* compare image numbers */ + cmp = (*ia)->intImageNumber - (*ib)->intImageNumber; + + return cmp; +} + +static void TI_buildImageQuery(DcmDataset **query, TI_StudyEntry *study, + TI_SeriesEntry *series) +{ + if (*query != NULL) delete *query; + *query = new DcmDataset; + if (*query == NULL) { + DCMQRDB_ERROR("Help, out of memory!"); + return; + } + + DU_putStringDOElement(*query, DCM_QueryRetrieveLevel, "IMAGE"); + DU_putStringDOElement(*query, DCM_StudyInstanceUID, + study->studyInstanceUID); + DU_putStringDOElement(*query, DCM_SeriesInstanceUID, + series->seriesInstanceUID); + DU_putStringDOElement(*query, DCM_InstanceNumber, NULL); + DU_putStringDOElement(*query, DCM_SOPInstanceUID, NULL); +} + + +OFBool +TI_addStudyEntry(TI_DBEntry *db, DcmDataset *reply) +{ + TI_StudyEntry *se; + OFBool ok = OFTrue; + + if (db->studyCount >= TI_MAXSTUDIES) { + DCMQRDB_ERROR("TI_addStudyEntry: too many studies"); + return OFFalse; + } + + se = (TI_StudyEntry*) malloc(sizeof(TI_StudyEntry)); + if (se == NULL) return OFFalse; + + bzero((char*)se, sizeof(TI_StudyEntry)); /* make sure its clean */ + + /* extract info from reply */ + ok = DU_getStringDOElement(reply, DCM_StudyInstanceUID, se->studyInstanceUID, sizeof(se->studyInstanceUID)); + if (ok) ok = DU_getStringDOElement(reply, DCM_StudyID, se->studyID, sizeof(se->studyID)); + if (ok) ok = DU_getStringDOElement(reply, DCM_PatientName, se->patientName, sizeof(se->patientName)); + if (ok) ok = DU_getStringDOElement(reply, DCM_PatientID, se->patientID, sizeof(se->patientID)); + + if (!ok) { + DCMQRDB_ERROR("TI_addStudyEntry: missing data in DB reply"); + return OFFalse; + } + + DU_stripLeadingAndTrailingSpaces(se->studyInstanceUID); + DU_stripLeadingAndTrailingSpaces(se->studyID); + DU_stripLeadingAndTrailingSpaces(se->patientName); + DU_stripLeadingAndTrailingSpaces(se->patientID); + + /* add to array */ + db->studies[db->studyCount] = se; + db->studyCount++; + + return OFTrue; +} + +/* ========================================== DcmQueryRetrieveTelnetInitiator ======================================== */ + +DcmQueryRetrieveTelnetInitiator::DcmQueryRetrieveTelnetInitiator( + DcmQueryRetrieveConfig &cfg) +: dbEntries(NULL) +, dbCount(0) +, peerHostName(NULL) +, peerNamesCount(0) +, myAETitle(NULL) +, net(NULL) +, assoc(NULL) +, maxReceivePDULength(0) +, currentdb(0) +, currentPeerTitle(NULL) +, config(cfg) +, networkTransferSyntax(EXS_Unknown) +, blockMode_(DIMSE_BLOCKING) +, dimse_timeout_(0) +{ + bzero((char*)peerNames, sizeof(peerNames)); +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_detachAssociation(OFBool abortFlag) +{ + OFCondition cond = EC_Normal; + DIC_NODENAME presentationAddress; + DIC_AE peerTitle; + OFString temp_str; + + if (assoc == NULL) { + return OFTrue; /* nothing to do */ + } + + ASC_getPresentationAddresses(assoc->params, NULL, 0, + presentationAddress, sizeof(presentationAddress)); + ASC_getAPTitles(assoc->params, NULL, 0, peerTitle, sizeof(peerTitle), NULL, 0); + + if (abortFlag) { + /* abort association */ + DCMQRDB_INFO("Aborting Association (" << peerTitle << ")"); + cond = ASC_abortAssociation(assoc); + if (cond.bad()) { + DCMQRDB_ERROR("Association Abort Failed: " << DimseCondition::dump(temp_str, cond)); + } + } else { + /* release association */ + DCMQRDB_INFO("Releasing Association (" << peerTitle << ")"); + cond = ASC_releaseAssociation(assoc); + if (cond.bad()) { + DCMQRDB_ERROR("Association Release Failed: " << DimseCondition::dump(temp_str, cond)); + } + } + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + + if (abortFlag) { + printf("Aborted Association (%s,%s)\n", + presentationAddress, peerTitle); + } else { + printf("Released Association (%s,%s)\n", + presentationAddress, peerTitle); + } + + return OFTrue; +} + +OFCondition DcmQueryRetrieveTelnetInitiator::addPresentationContexts(T_ASC_Parameters *params) +{ + OFCondition cond = EC_Normal; + + /* abstract syntaxes for storage SOP classes are taken from dcmdata */ + const char *abstractSyntaxes[] = { + UID_VerificationSOPClass, + UID_FINDStudyRootQueryRetrieveInformationModel + }; + + int i; + int pid = 1; + + /* + ** We prefer to accept Explicitly encoded transfer syntaxes. + ** If we are running on a Little Endian machine we prefer + ** LittleEndianExplicitTransferSyntax to BigEndianTransferSyntax. + ** Some SCP implementations will just select the first transfer + ** syntax they support (this is not part of the standard) so + ** organise the proposed transfer syntaxes to take advantage + ** of such behaviour. + */ + + unsigned int numTransferSyntaxes = 0; + const char* transferSyntaxes[] = { NULL, NULL, NULL }; + + if (networkTransferSyntax == EXS_LittleEndianImplicit) + { + transferSyntaxes[0] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 1; + } + else + { + /* gLocalByteOrder is defined in dcxfer.h */ + if (gLocalByteOrder == EBO_LittleEndian) + { + /* we are on a little endian machine */ + transferSyntaxes[0] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + } else { + /* we are on a big endian machine */ + transferSyntaxes[0] = UID_BigEndianExplicitTransferSyntax; + transferSyntaxes[1] = UID_LittleEndianExplicitTransferSyntax; + transferSyntaxes[2] = UID_LittleEndianImplicitTransferSyntax; + numTransferSyntaxes = 3; + } + } + + /* first add presentation contexts for find and verification */ + for (i=0; i<(int)DIM_OF(abstractSyntaxes) && cond.good(); i++) + { + cond = ASC_addPresentationContext( params, pid, abstractSyntaxes[i], transferSyntaxes, numTransferSyntaxes); + pid += 2; /* only odd presentation context id's */ + } + + /* and then for all storage SOP classes */ + for (i=0; iisRemoteDB) { + OFStandard::strlcpy(currentAETitle, myAETitle, sizeof(currentAETitle)); + } else { + OFStandard::strlcpy(currentAETitle, dbEntries[currentdb]->title, sizeof(currentAETitle)); + } + + cond = ASC_createAssociationParameters(¶ms, maxReceivePDULength); + if (cond.bad()) { + DCMQRDB_ERROR("Help, cannot create association parameters: " << DimseCondition::dump(temp_str, cond)); + return OFFalse; + } + ASC_setAPTitles(params, currentAETitle, currentPeerTitle, NULL); + + if (!config.peerForAETitle(currentPeerTitle, &peer, &port)) { + DCMQRDB_ERROR("Help, AE title (" << currentPeerTitle << ") no longer in config"); + ASC_destroyAssociationParameters(¶ms); + return OFFalse; + } + sprintf(presentationAddress, "%s:%d", peer, port); + ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(), presentationAddress); + + cond = addPresentationContexts(params); + if (cond.bad()) { + DCMQRDB_ERROR("Help, cannot add presentation contexts: " << DimseCondition::dump(temp_str, cond)); + ASC_destroyAssociationParameters(¶ms); + return OFFalse; + } + DCMQRDB_DEBUG("Request Parameters:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_RQ)); + + /* create association */ + DCMQRDB_INFO("Requesting Association"); + cond = ASC_requestAssociation(net, params, &assoc); + if (cond.bad()) { + if (cond == DUL_ASSOCIATIONREJECTED) { + T_ASC_RejectParameters rej; + + ASC_getRejectParameters(params, &rej); + DCMQRDB_ERROR("Association Rejected:" << OFendl << ASC_printRejectParameters(temp_str, &rej)); + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + + return OFFalse; + } else { + DCMQRDB_ERROR("Association Request Failed: Peer (" << presentationAddress << ", " + << currentPeerTitle << "): " << DimseCondition::dump(temp_str, cond)); + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + + return OFFalse; + } + } + /* what has been accepted/refused ? */ + DCMQRDB_DEBUG("Association Parameters Negotiated:" << OFendl << ASC_dumpParameters(temp_str, params, ASC_ASSOC_AC)); + + if (ASC_countAcceptedPresentationContexts(params) == 0) { + DCMQRDB_ERROR("All Presentation Contexts Refused: Peer (" << presentationAddress << "," + << currentPeerTitle << ")"); + ASC_abortAssociation(assoc); + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + + return OFFalse; + } + + DCMQRDB_INFO("Association Accepted (Max Send PDV: " + << assoc->sendPDVLength << ")"); + + printf("New Association Started (%s,%s)\n", presentationAddress, + currentPeerTitle); + + return OFTrue; +} + +/* + * Change Association + */ + +OFBool DcmQueryRetrieveTelnetInitiator::TI_changeAssociation() +{ + DIC_AE actualPeerAETitle; + OFBool ok = OFTrue; + + if (assoc != NULL) { + /* do we really need to change the association */ + ASC_getAPTitles(assoc->params, NULL, 0, actualPeerAETitle, sizeof(actualPeerAETitle), NULL, 0); + if (strcmp(actualPeerAETitle, currentPeerTitle) == 0) { + /* no need to change */ + return OFTrue; + } + } + + ok = TI_detachAssociation(OFFalse); + if (!ok) return ok; + + ok = TI_attachAssociation(); + return ok; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_sendEcho() +{ + OFCondition cond = EC_Normal; + DIC_US msgId; + DIC_US status; + DcmDataset *stDetail = NULL; + + msgId = assoc->nextMsgID++; + printf("[MsgID %d] Echo, ", msgId); + fflush(stdout); + + cond = DIMSE_echoUser(assoc, msgId, blockMode_, dimse_timeout_, + &status, &stDetail); + + if (cond.good()) { + printf("Complete [Status: %s]\n", + DU_cstoreStatusString(status)); + } else { + OFString temp_str; + DCMQRDB_ERROR("Failed: " << DimseCondition::dump(temp_str, cond)); + ASC_abortAssociation(assoc); + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + + } + if (stDetail != NULL) { + printf(" Status Detail (should never be any):\n"); + stDetail->print(COUT); + delete stDetail; + } + return (cond.good()); +} + + +OFBool DcmQueryRetrieveTelnetInitiator::TI_storeImage(char *sopClass, char *sopInstance, char * imgFile) +{ + OFCondition cond = EC_Normal; + DIC_US msgId; + DcmDataset *stDetail = NULL; + T_ASC_PresentationContextID presId; + T_DIMSE_C_StoreRQ req; + T_DIMSE_C_StoreRSP rsp; + DIC_PN patientName; + DIC_CS studyId; + DIC_IS seriesNumber; + DIC_CS modality; + DIC_IS imageNumber; + + if (strlen(sopClass) == 0) { + DCMQRDB_WARN("CTN has deleted image, giving up (no sopClass): " + << ((imgFile)?(imgFile):("(nil)"))); + /* give up because if this image is gone, then others are also + * very likely to have disappeared. The user should restart + * the operation when other activities have finished. + */ + return OFFalse; + } + +#ifdef LOCK_IMAGE_FILES + /* shared lock image file */ + int lockfd; +#ifdef O_BINARY + lockfd = open(imgFile, O_RDONLY | O_BINARY, 0666); +#else + lockfd = open(imgFile, O_RDONLY, 0666); +#endif + if (lockfd < 0) { + DCMQRDB_WARN("CTN has deleted image, giving up (no imgFile): " + << ((imgFile)?(imgFile):("(nil)"))); + /* give up because if this image is gone, then others are also + * very likely to have disappeared. The user should restart + * the operation when other activities have finished. + */ + return OFFalse; + } + dcmtk_flock(lockfd, LOCK_SH); +#endif + + /* which presentation context should be used */ + presId = ASC_findAcceptedPresentationContextID(assoc, sopClass); + if (presId == 0) { + DCMQRDB_ERROR("No presentation context for: (" + << dcmSOPClassUIDToModality(sopClass, "OT") << ") " << sopClass); + return OFFalse; + } + + TI_getInfoFromImage(imgFile, patientName, studyId, + seriesNumber, modality, imageNumber); + + /* start store */ + msgId = assoc->nextMsgID++; + printf("[MsgID %d] Store,\n", msgId); + printf(" PatientName: %s, StudyID: %s,\n", + patientName, studyId); + printf(" Series: %s, Modality: %s, Image: %s,\n", + seriesNumber, modality, imageNumber); + printf(" Image UID: %s\n", sopInstance); + fflush(stdout); + bzero((char*)&req, sizeof(req)); + req.MessageID = msgId; + OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID)); + OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, sizeof(req.AffectedSOPInstanceUID)); + req.DataSetType = DIMSE_DATASET_PRESENT; + req.Priority = DIMSE_PRIORITY_MEDIUM; + + cond = DIMSE_storeUser(assoc, presId, &req, + imgFile, NULL, storeProgressCallback, NULL, + blockMode_, dimse_timeout_, + &rsp, &stDetail); + +#ifdef LOCK_IMAGE_FILES + /* unlock image file */ + dcmtk_flock(lockfd, LOCK_UN); + close(lockfd); +#endif + + if (cond.good()) { + printf("[MsgID %d] Complete [Status: %s]\n", msgId, + DU_cstoreStatusString(rsp.DimseStatus)); + } else { + OFString temp_str; + DCMQRDB_ERROR("[MsgID " << msgId << "] Failed: " << DimseCondition::dump(temp_str, cond)); + ASC_abortAssociation(assoc); + ASC_dropAssociation(assoc); + ASC_destroyAssociation(&assoc); + } + if (stDetail != NULL) { + printf(" Status Detail:\n"); + stDetail->print(COUT); + delete stDetail; + } + + return (cond.good()); +} + + +/* + * Find for remote DBs + */ + +OFBool DcmQueryRetrieveTelnetInitiator::TI_remoteFindQuery(TI_DBEntry *db, DcmDataset *query, + TI_GenericEntryCallbackFunction callbackFunction, + TI_GenericCallbackStruct *callbackData) +{ + OFBool ok = OFTrue; + TI_LocalFindCallbackData cbd; + OFCondition cond = EC_Normal; + T_ASC_PresentationContextID presId; + DIC_US msgId; + T_DIMSE_C_FindRQ req; + T_DIMSE_C_FindRSP rsp; + DcmDataset *stDetail = NULL; + int responseCount = 0; + + currentPeerTitle = db->title; + + /* make sure we have an association */ + ok = TI_changeAssociation(); + if (!ok) return OFFalse; + + cbd.cbf = callbackFunction; + cbd.cbs = callbackData; + + /* which presentation context should be used */ + presId = ASC_findAcceptedPresentationContextID(assoc, + UID_FINDStudyRootQueryRetrieveInformationModel); + if (presId == 0) { + DCMQRDB_ERROR("No Presentation Context for Find Operation"); + return OFFalse; + } + + msgId = assoc->nextMsgID++; + + DCMQRDB_INFO("Sending Find SCU RQ: MsgID " << msgId << ":" << OFendl << DcmObject::PrintHelper(*query)); + + req.MessageID = msgId; + OFStandard::strlcpy(req.AffectedSOPClassUID, + UID_FINDStudyRootQueryRetrieveInformationModel, sizeof(req.AffectedSOPClassUID)); + req.Priority = DIMSE_PRIORITY_MEDIUM; + + cond = DIMSE_findUser(assoc, presId, &req, query, responseCount, + findCallback, &cbd, blockMode_, dimse_timeout_, &rsp, &stDetail); + + if (cond.good()) { + OFString temp_str; + DCMQRDB_INFO(DIMSE_dumpMessage(temp_str, rsp, DIMSE_INCOMING)); + } else { + OFString temp_str; + DCMQRDB_ERROR("Find Failed: " << DimseCondition::dump(temp_str, cond)); + } + if (stDetail != NULL) { + printf(" Status Detail:\n"); + stDetail->print(COUT); + delete stDetail; + } + + return cond.good(); + +} + + +/* ====================================== TI USER INTERFACE ===================================== */ + + +OFBool DcmQueryRetrieveTelnetInitiator::TI_shortHelp(int /*arg*/ , const char * /*cmdbuf*/ ) +{ + printf("h)elp, t)itle, da)tabase, st)udy, ser)ies i)mage, di)splay, sen)d, e)cho, q)uit\n"); + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_help(int arg, const char * /*cmdbuf*/ ) +{ + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_help: arg=%d\n", arg); + } + printf("Command Summary:\n"); + printf("help list this summary\n"); + printf("? short help\n"); + printf("title [#] list [set] current peer AE title\n"); + printf("database [#] list [set] current database\n"); + printf("study [#] list [set] current study\n"); + printf("series [#] list [set] current series\n"); + printf("image [#] list [set] current image\n"); + printf("send study [#] send current [specific] study\n"); + printf("send series [#] send current [specific] series\n"); + printf("send image [#] send current [specific] image\n"); + printf("echo [#] verify connectivity [# times]\n"); + printf("quit quit program\n"); + printf("exit synonym for quit\n"); + + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_title(int arg, const char * /*cmdbuf*/ ) +{ + int i; + TI_DBEntry *db; + const char *peer; + int port; + DIC_AE peerTitle; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_title: arg=%d\n", arg); + } + + bzero(peerTitle, sizeof(peerTitle)); + if (assoc) { + ASC_getAPTitles(assoc->params, NULL, 0, peerTitle, sizeof(peerTitle), NULL, 0); + } + + db = dbEntries[currentdb]; + if (arg < 0) { + /* print list of peer AE titles we know */ + printf("Peer AE Titles:\n"); + printf(" %-16s %s\n", "Peer AE", "HostName:PortNumber"); + for (i=0; ipeerTitleCount; i++) { + if (strcmp(currentPeerTitle, db->peerTitles[i]) == 0) { + printf("*"); + } else { + printf(" "); + } + /* active = (strcmp(peerTitle, db->peerTitles[i]) == 0); */ + config.peerForAETitle(db->peerTitles[i], &peer, &port); + printf(" %d) %-16s (%s:%d)\n", i, db->peerTitles[i], + peer, port); + } + } else { + /* choosing new peer AE title */ + if (arg >= db->peerTitleCount) { + printf("ERROR: Peer AE Title Choice: 0 - %d\n", + db->peerTitleCount - 1); + } else { + currentPeerTitle = db->peerTitles[arg]; + } + } + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_attachDB(TI_DBEntry *db) +{ + OFCondition dbcond = EC_Normal; + + db->studyCount = 0; + db->currentStudy = 0; + db->currentImage = 0; + + if (!db->isRemoteDB && db->dbHandle == NULL) { + /* Create a database handle */ + db->dbHandle = new DcmQueryRetrieveIndexDatabaseHandle( + config.getStorageArea(db->title), + config.getMaxStudies(db->title), + config.getMaxBytesPerStudy(db->title), dbcond); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_attachDB: cannot create DB Handle"); + return OFFalse; + } + } else { + + } + + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_database(int arg, const char * /*cmdbuf*/ ) +{ + int i; + TI_DBEntry *db = NULL; + OFBool found = OFFalse; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_database: arg=%d\n", arg); + } + + if (arg < 0) { + /* print list of database titles we know */ + printf("Database Titles:\n"); + printf(" %s\n", "Database"); + for (i=0; iisRemoteDB) { + printf("!"); + } else { + printf(" "); + } + printf("%2d) %s\n", i, dbEntries[i]->title); + } + } else { + /* choosing new title */ + if (arg >= dbCount) { + printf("ERROR: Database Title Choice: 0 - %d\n", + dbCount - 1); + } else { + /* release old dbHandle */ + TI_detachDB(dbEntries[currentdb]); + + currentdb = arg; + /* check to make sure that current peer AE title is + * available for this database, if not must choose + * another and tell user about the change. + */ + db = dbEntries[currentdb]; + for (i=0; !found && ipeerTitleCount; i++) { + found = (strcmp(currentPeerTitle, + db->peerTitles[i]) == 0); + } + if (!found) { + printf("WARNING: Actual Peer AE Title (%s) has no access to database: %s\n", currentPeerTitle, db->title); + printf(" Setting Default Peer AE Title: %s\n", + db->peerTitles[0]); + currentPeerTitle = db->peerTitles[0]; + } + + if (!TI_attachDB(dbEntries[currentdb])) + { + DCMQRDB_FATAL("unable to open database, bailing out"); + exit(10); + } + } + } + + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_echo(int arg, const char * /*cmdbuf*/ ) +{ + OFBool ok = OFTrue; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_echo: arg=%d\n", arg); + } + + ok = TI_changeAssociation(); + if (!ok) return OFFalse; + + if (arg <= 0) arg = 1; /* send 1 echo message */ + + /* send echo message to peer AE title */ + + while ( arg-- > 0 && ok) { + ok = TI_sendEcho(); + } + + ok = TI_detachAssociation(OFFalse); + + return ok; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_quit(int arg, const char * /*cmdbuf*/ ) +{ + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_quit: arg=%d\n", arg); + } + TI_detachAssociation(OFFalse); + printf("Good Bye, Auf Wiedersehen, Au Revoir\n"); + exit(0); + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_actualizeStudies() +{ + TI_DBEntry *db; + + db = dbEntries[currentdb]; + + /* get a list of all the available studies in the current database */ + if (!TI_buildStudies(db)) + return OFFalse; + + if (db->studyCount == 0) { + printf("No Studies in Database: %s\n", db->title); + return OFFalse; + } + + if (db->currentStudy < 0 || db->currentStudy >= db->studyCount) + db->currentStudy = 0; + + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_study(int arg, const char * /*cmdbuf*/ ) +{ + TI_DBEntry *db; + TI_StudyEntry *se; + int i; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_study: arg=%d\n", arg); + } + + db = dbEntries[currentdb]; + + if (db->isRemoteDB) { + currentPeerTitle = db->title; + /* make sure we have an association */ + OFBool ok = TI_changeAssociation(); + if (!ok) return OFFalse; + } + + if (!TI_actualizeStudies()) + return OFFalse; + +#ifndef RETAIN_ASSOCIATION + if (dbEntries[currentdb]->isRemoteDB) { + TI_detachAssociation(OFFalse); + } +#endif + + if (arg >= 0) { + /* set current study */ + if (arg >= db->studyCount) { + printf("ERROR: Study Choice: 0 - %d\n", + db->studyCount - 1); + return OFFalse; + } + db->currentStudy = arg; + return OFTrue; + } + + /* list studies to user */ + printf(" "); + printf(STUDYFORMAT, "Patient", "PatientID", "StudyID"); + for (i=0; istudyCount; i++) { + if (db->currentStudy == i) { + printf("*"); + } else { + printf(" "); + } + printf(" %2d) ", i); + se = db->studies[i]; + printStudyEntry(se); + } + + printf("\n"); + printf("%d Studies in Database: %s\n", db->studyCount, db->title); + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_actualizeSeries() +{ + TI_DBEntry *db; + TI_StudyEntry *study; + + db = dbEntries[currentdb]; + + if (db->studyCount == 0) + if (!TI_actualizeStudies()) + return OFFalse; + + study = db->studies[db->currentStudy]; + + /* get a list of all the available series in the current study */ + if (!TI_buildSeries(db, study)) + return OFFalse; + + if (study->seriesCount == 0) { + printf("No Series in Study %s (Database: %s)\n", + study->studyID, db->title); + return OFFalse; + } + if (db->currentSeries < 0 || db->currentSeries >= study->seriesCount) + db->currentSeries = 0; + + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_series(int arg, const char * /*cmdbuf*/ ) +{ + TI_DBEntry *db; + TI_StudyEntry *study; + TI_SeriesEntry *series; + int i; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_sseries: arg=%d\n", arg); + } + + db = dbEntries[currentdb]; + + if (db->isRemoteDB) { + currentPeerTitle = db->title; + /* make sure we have an association */ + OFBool ok = TI_changeAssociation(); + if (!ok) return OFFalse; + } + + if (!TI_actualizeSeries()) + return OFFalse; + +#ifndef RETAIN_ASSOCIATION + if (dbEntries[currentdb]->isRemoteDB) { + TI_detachAssociation(OFFalse); + } +#endif + + study = db->studies[db->currentStudy]; + + if (arg >= 0) { + /* set current series */ + if (arg >= study->seriesCount) { + printf("ERROR: Series Choice: 0 - %d\n", + study->seriesCount - 1); + return OFFalse; + } + db->currentSeries = arg; + return OFTrue; + } + + /* list series to user */ + printf(" "); + printf(SERIESFORMAT, "Series", "Modality", "SeriesInstanceUID"); + for (i=0; iseriesCount; i++) { + if (db->currentSeries == i) { + printf("*"); + } else { + printf(" "); + } + printf(" %2d) ", i); + series = study->series[i]; + printSeriesEntry(series); + } + + printf("\n"); + printf("%d Series in StudyID %s,\n", + study->seriesCount, study->studyID); + printf(" Patient: %s (Database: %s)\n", + study->patientName, db->title); + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_actualizeImages() +{ + TI_DBEntry *db; + TI_StudyEntry *study; + TI_SeriesEntry *series; + + db = dbEntries[currentdb]; + + if (db->studyCount == 0) { + if (!TI_actualizeStudies()) + return OFFalse; + } + + study = db->studies[db->currentStudy]; + if (study->seriesCount == 0) { + if (!TI_actualizeSeries()) + return OFFalse; + } + + series = study->series[db->currentSeries]; + + /* get a list of all the available images in the current series */ + if (!TI_buildImages(db, study, series)) + return OFFalse; + + if (series->imageCount == 0) { + printf("No Images in Series %s, Study %s (Database: %s)\n", + series->seriesNumber, study->studyID, db->title); + return OFFalse; + } + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_image(int arg, const char * /*cmdbuf*/ ) +{ + TI_DBEntry *db; + TI_StudyEntry *study; + TI_SeriesEntry *series; + TI_ImageEntry *image; + int i; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_image: arg=%d\n", arg); + } + + db = dbEntries[currentdb]; + + if (db->isRemoteDB) { + currentPeerTitle = db->title; + /* make sure we have an association */ + OFBool ok = TI_changeAssociation(); + if (!ok) return OFFalse; + } + + if (!TI_actualizeImages()) + return OFFalse; + +#ifndef RETAIN_ASSOCIATION + if (dbEntries[currentdb]->isRemoteDB) { + TI_detachAssociation(OFFalse); + } +#endif + + study = db->studies[db->currentStudy]; + series = study->series[db->currentSeries]; + + if (arg >= 0) { + /* set current image */ + if (arg >= series->imageCount) { + printf("ERROR: Image Choice: 0 - %d\n", + series->imageCount - 1); + return OFFalse; + } + db->currentImage = arg; + return OFTrue; + } + + /* list images to user */ + printf(" "); + printf(IMAGEFORMAT, "Image", "ImageInstanceUID"); + for (i=0; iimageCount; i++) { + if (db->currentImage == i) { + printf("*"); + } else { + printf(" "); + } + printf(" %2d) ", i); + image = series->images[i]; + printImageEntry(image); + } + + printf("\n"); + printf("%d Images in %s Series, StudyID %s,\n", + series->imageCount, series->modality, study->studyID); + printf(" Patient: %s (Database: %s)\n", + study->patientName, db->title); + return OFTrue; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_sendStudy(int arg, const char * /*cmdbuf*/ ) +{ + OFBool ok = OFTrue; + DcmDataset *query = NULL; + TI_DBEntry *db; + TI_StudyEntry *study; + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Pending); + DIC_UI sopClass; + DIC_UI sopInstance; + char imgFile[MAXPATHLEN+1]; + DIC_US nRemaining = 0; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_sendStudy: arg=%d\n", arg); + } + + db = dbEntries[currentdb]; + + /* + ** We cannot read images from a DB and send images to the same DB + ** over the network because of deadlock. The DB move routines + ** lock the index file. When we send over the network to the same + ** DB it tries to lock the index file exclusively to insert the image + ** in the database. We end up waiting for a response from the remote + ** peer which never comes. + */ + + if (strcmp(db->title, currentPeerTitle) == 0) { + printf("Sorry, cannot send images from a DB to itself, possible deadlock\n"); + return OFFalse; + } + + /* make sure study info is actual */ + ok = TI_actualizeStudies(); + if (!ok) return OFFalse; + + /* set arg as current study */ + if (arg < 0) { + arg = db->currentStudy; + } + + if (arg >= db->studyCount) { + printf("ERROR: Study Choice: 0 - %d\n", + db->studyCount - 1); + return OFFalse; + } + study = db->studies[arg]; + + /* make sure we have an association */ + ok = TI_changeAssociation(); + if (!ok) return OFFalse; + + /* fabricate query */ + query = new DcmDataset; + if (query == NULL) { + DCMQRDB_ERROR("Help, out of memory"); + return OFFalse; + } + DU_putStringDOElement(query, DCM_QueryRetrieveLevel, "STUDY"); + DU_putStringDOElement(query, DCM_StudyInstanceUID, study->studyInstanceUID); + + dbcond = db->dbHandle->startMoveRequest( + UID_MOVEStudyRootQueryRetrieveInformationModel, query, &dbStatus); + delete query; query = NULL; + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_sendStudy: cannot query database"); + return OFFalse; + } + + while (ok && dbStatus.status() == STATUS_Pending) { + dbcond = db->dbHandle->nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), + imgFile, sizeof(imgFile), &nRemaining, &dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_sendStudy: database error"); + return OFFalse; + } + if (dbStatus.status() == STATUS_Pending) { + + ok = TI_storeImage(sopClass, sopInstance, imgFile); + if (!ok) { + db->dbHandle->cancelMoveRequest(&dbStatus); + } + } + } + + ok = TI_detachAssociation(OFFalse); + + return ok; +} + + +OFBool DcmQueryRetrieveTelnetInitiator::TI_sendSeries(int arg, const char * /*cmdbuf*/ ) +{ + OFBool ok = OFTrue; + DcmDataset *query = NULL; + TI_DBEntry *db; + TI_StudyEntry *study; + TI_SeriesEntry *series; + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Pending); + DIC_UI sopClass; + DIC_UI sopInstance; + char imgFile[MAXPATHLEN+1]; + DIC_US nRemaining = 0; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_sendSeries: arg=%d\n", arg); + } + + db = dbEntries[currentdb]; + + /* make sure study/series info is actual */ + ok = TI_actualizeSeries(); + if (!ok) return OFFalse; + + study = db->studies[db->currentStudy]; + + /* set arg as current series */ + if (arg < 0) { + arg = db->currentSeries; + } + + if (arg >= study->seriesCount) { + printf("ERROR: Series Choice: 0 - %d\n", + study->seriesCount - 1); + return OFFalse; + } + series = study->series[arg]; + + /* make sure we have an association */ + ok = TI_changeAssociation(); + if (!ok) return OFFalse; + + /* fabricate query */ + query = new DcmDataset; + if (query == NULL) { + DCMQRDB_ERROR("Help, out of memory"); + return OFFalse; + } + DU_putStringDOElement(query, DCM_QueryRetrieveLevel, "SERIES"); + DU_putStringDOElement(query, DCM_StudyInstanceUID, study->studyInstanceUID); + DU_putStringDOElement(query, DCM_SeriesInstanceUID, + series->seriesInstanceUID); + + dbcond = db->dbHandle->startMoveRequest( + UID_MOVEStudyRootQueryRetrieveInformationModel, query, &dbStatus); + delete query; query = NULL; + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_sendSeries: cannot query database"); + return OFFalse; + } + + while (ok && dbStatus.status() == STATUS_Pending) { + dbcond = db->dbHandle->nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), + imgFile, sizeof(imgFile), &nRemaining, &dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_sendSeries: database error"); + return OFFalse; + } + if (dbStatus.status() == STATUS_Pending) { + + ok = TI_storeImage(sopClass, sopInstance, imgFile); + if (!ok) { + db->dbHandle->cancelMoveRequest(&dbStatus); + } + } + } + + ok = TI_detachAssociation(OFFalse); + + return ok; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_sendImage(int arg, const char * /*cmdbuf*/ ) +{ + OFBool ok = OFTrue; + DcmDataset *query = NULL; + TI_DBEntry *db; + TI_StudyEntry *study; + TI_SeriesEntry *series; + TI_ImageEntry *image; + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Pending); + DIC_UI sopClass; + DIC_UI sopInstance; + char imgFile[MAXPATHLEN+1]; + DIC_US nRemaining = 0; + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("TI_sendImage: arg=%d\n", arg); + } + + db = dbEntries[currentdb]; + + /* make sure study/series/image info is actual */ + ok = TI_actualizeImages(); + if (!ok) return OFFalse; + + study = db->studies[db->currentStudy]; + series = study->series[db->currentSeries]; + + /* set arg as current image */ + if (arg < 0) { + arg = db->currentImage; + } + + if (arg >= series->imageCount) { + printf("ERROR: Image Choice: 0 - %d\n", + series->imageCount - 1); + return OFFalse; + } + + image = series->images[arg]; + + /* make sure we have an association */ + ok = TI_changeAssociation(); + if (!ok) return OFFalse; + + /* fabricate query */ + query = new DcmDataset; + if (query == NULL) { + DCMQRDB_ERROR("Help, out of memory"); + return OFFalse; + } + DU_putStringDOElement(query, DCM_QueryRetrieveLevel, "IMAGE"); + DU_putStringDOElement(query, DCM_StudyInstanceUID, study->studyInstanceUID); + DU_putStringDOElement(query, DCM_SeriesInstanceUID, + series->seriesInstanceUID); + DU_putStringDOElement(query, DCM_SOPInstanceUID, + image->sopInstanceUID); + + dbcond = db->dbHandle->startMoveRequest( + UID_MOVEStudyRootQueryRetrieveInformationModel, query, &dbStatus); + delete query; query = NULL; + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_sendImage: cannot query database"); + return OFFalse; + } + + /* + * We should only ever get 1 response to the above query, + * but you never know (there could be non-unique UIDs in + * the database). + */ + while (ok && dbStatus.status() == STATUS_Pending) { + dbcond = db->dbHandle->nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), + imgFile, sizeof(imgFile), &nRemaining, &dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_sendImage: database error"); + return OFFalse; + } + if (dbStatus.status() == STATUS_Pending) { + ok = TI_storeImage(sopClass, sopInstance, imgFile); + if (!ok) { + db->dbHandle->cancelMoveRequest(&dbStatus); + } + } + } + + ok = TI_detachAssociation(OFFalse); + + return ok; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_send(int /*arg*/, const char *cmdbuf) +{ + OFBool ok = OFTrue; + char cmdarg[1024]; + int iarg; + int narg; + + if (dbEntries[currentdb]->isRemoteDB) { + printf("Sorry, cannot send from remote DB\n"); + return OFTrue; + } + + bzero(cmdarg, sizeof(cmdarg)); + + narg = sscanf(cmdbuf, "send %s %d", cmdarg, &iarg); + if (narg == 1) + iarg = -1; + + if (strncmp("st", cmdarg, strlen("st")) == 0) TI_sendStudy(iarg, cmdbuf); + else if (strncmp("se", cmdarg, strlen("se")) == 0) TI_sendSeries(iarg, cmdbuf); + else if (strncmp("i", cmdarg, strlen("i")) == 0) TI_sendImage(iarg, cmdbuf); + else { + printf("What do you want to send? Type help for help\n"); + } + + return ok; +} + +void DcmQueryRetrieveTelnetInitiator::TI_userInput() +{ + char cmdBuf[1024]; /* can't have lines longer than this */ + int arg; + + /* make the first database current */ + currentdb = 0; + /* make the first peer title for this database current */ + currentPeerTitle = dbEntries[currentdb]->peerTitles[0]; + /* open db */ + TI_database(currentdb, cmdBuf); + + TI_welcome(); + printf("\n"); + + while (1) { + printf("%s->%s> ", dbEntries[currentdb]->title, + currentPeerTitle); + if (fgets(cmdBuf, 1024, stdin) == NULL) { + DCMQRDB_ERROR("unexpected end of input\n"); + return; /* give up */ + } + + DU_stripLeadingSpaces(cmdBuf); + if (strlen(cmdBuf) == 0) + continue; /* no input */ + + if (sscanf(cmdBuf, "%*s %d", &arg) != 1) { + arg = -1; + } + + /* find command parser */ + if (strncmp("h", cmdBuf, strlen("h")) == 0) TI_help(arg, cmdBuf); + else if (strncmp("?", cmdBuf, strlen("?")) == 0) TI_shortHelp(arg, cmdBuf); + else if (strncmp("t", cmdBuf, strlen("t")) == 0) TI_title(arg, cmdBuf); + else if (strncmp("da", cmdBuf, strlen("da")) == 0) TI_database(arg, cmdBuf); + else if (strncmp("st", cmdBuf, strlen("st")) == 0) TI_study(arg, cmdBuf); + else if (strncmp("ser", cmdBuf, strlen("ser"))== 0) TI_series(arg, cmdBuf); + else if (strncmp("i", cmdBuf, strlen("i")) == 0) TI_image(arg, cmdBuf); + else if (strncmp("send", cmdBuf, strlen("send")) == 0) TI_send(arg, cmdBuf); + else if (strncmp("ec", cmdBuf, strlen("ec")) == 0) TI_echo(arg, cmdBuf); + else if (strncmp("q", cmdBuf, strlen("q")) == 0) TI_quit(arg, cmdBuf); + else if (strncmp("exit", cmdBuf, strlen("exit")) == 0) TI_quit(arg, cmdBuf); + else { + printf("What do you want to do? Type help for help\n"); + } + } +} + +/* ========================================== TI QUERY ========================================== */ + + +OFBool DcmQueryRetrieveTelnetInitiator::TI_dbReadable(const char *dbTitle) +{ + char path[MAXPATHLEN+1]; + sprintf(path, "%s%c%s", config.getStorageArea(dbTitle), PATH_SEPARATOR, DBINDEXFILE); + + return (access(path, R_OK) == 0); +} + +time_t DcmQueryRetrieveTelnetInitiator::TI_dbModifyTime(const char *dbTitle) +{ + char path[MAXPATHLEN+1]; + struct stat s; + + sprintf(path, "%s%c%s", config.getStorageArea(dbTitle), PATH_SEPARATOR, DBINDEXFILE); + + if (stat(path, &s) < 0) { + DCMQRDB_ERROR("cannot stat: " << path); + return 0; + } + return s.st_mtime; +} + +/* + * Study Level + */ + +OFBool DcmQueryRetrieveTelnetInitiator::TI_buildRemoteStudies(TI_DBEntry *db) +{ + TI_GenericCallbackStruct cbs; + DcmDataset *query = NULL; + OFBool ok = OFTrue; + + cbs.db = db; + cbs.study = NULL; cbs.series = NULL; + + TI_destroyStudyEntries(db); + + /* get all known studies */ + TI_buildStudyQuery(&query); + + ok = TI_remoteFindQuery(db, query, TI_genericEntryCallback, &cbs); + + delete query; + + return ok; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_buildStudies(TI_DBEntry *db) +{ + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Pending); + DcmDataset *query = NULL; + DcmDataset *reply = NULL; + + if (db->isRemoteDB) { + return TI_buildRemoteStudies(db); + } + + if (db->studyCount != 0 && + TI_dbModifyTime(db->title) < db->lastQueryTime) { + /* nothing has changed */ + return OFTrue; + } + + TI_destroyStudyEntries(db); + + /* get all known studies */ + TI_buildStudyQuery(&query); + + printf("Querying Database for Studies ...\n"); + db->lastQueryTime = time(NULL); + + dbcond = db->dbHandle->startFindRequest( + UID_FINDStudyRootQueryRetrieveInformationModel, query, &dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_buildStudies: cannot query database"); + delete query; + return OFFalse; + } + + dbStatus.deleteStatusDetail(); + + while (dbStatus.status() == STATUS_Pending) { + dbcond = db->dbHandle->nextFindResponse(&reply, &dbStatus, config.getCharacterSetOptions()); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_buildStudies: database error"); + return OFFalse; + } + if (dbStatus.status() == STATUS_Pending) { + TI_addStudyEntry(db, reply); + delete reply; + reply = NULL; + } + } + + delete query; + + return OFTrue; +} + +/* + * Series Level + */ + + +OFBool DcmQueryRetrieveTelnetInitiator::TI_buildRemoteSeries(TI_DBEntry *db, TI_StudyEntry *study) +{ + TI_GenericCallbackStruct cbs; + DcmDataset *query = NULL; + OFBool ok = OFTrue; + + cbs.db = NULL; + cbs.study = study; cbs.series = NULL; + + TI_destroySeriesEntries(study); + + /* get all known studies */ + TI_buildSeriesQuery(&query, study); + + ok = TI_remoteFindQuery(db, query, TI_genericEntryCallback, &cbs); + + delete query; + + return ok; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_buildSeries(TI_DBEntry *db, TI_StudyEntry *study) +{ + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Pending); + DcmDataset *query = NULL; + DcmDataset *reply = NULL; + + if (db->isRemoteDB) { + return TI_buildRemoteSeries(db, study); + } + + if (study->seriesCount != 0 && + TI_dbModifyTime(db->title) < db->lastQueryTime) { + /* nothing has changed */ + return OFTrue; + } + + TI_destroySeriesEntries(study); + + /* get all known series for this study */ + TI_buildSeriesQuery(&query, study); + + printf("Querying Database for Series ...\n"); + study->lastQueryTime = time(NULL); + + dbcond = db->dbHandle->startFindRequest( + UID_FINDStudyRootQueryRetrieveInformationModel, query, &dbStatus); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_buildSeries: cannot query database"); + delete query; query = NULL; + return OFFalse; + } + + dbStatus.deleteStatusDetail(); + + while (dbStatus.status() == STATUS_Pending) { + dbcond = db->dbHandle->nextFindResponse(&reply, &dbStatus, config.getCharacterSetOptions()); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_buildSeries: database error"); + return OFFalse; + } + if (dbStatus.status() == STATUS_Pending) { + TI_addSeriesEntry(study, reply); + delete reply; + reply = NULL; + } + } + + delete query; + query = NULL; + + if (study->seriesCount > 0) { + /* sort the seriesinto assending series number order */ + qsort(study->series, study->seriesCount, sizeof(study->series[0]), + TI_seriesCompare); + } + + return OFTrue; +} + +/* + * Image Level + */ + + +OFBool DcmQueryRetrieveTelnetInitiator::TI_buildRemoteImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series) +{ + TI_GenericCallbackStruct cbs; + DcmDataset *query = NULL; + OFBool ok = OFTrue; + + cbs.db = NULL; + cbs.study = NULL; cbs.series = series; + + TI_destroyImageEntries(series); + + /* get all known studies */ + TI_buildImageQuery(&query, study, series); + + ok = TI_remoteFindQuery(db, query, TI_genericEntryCallback, &cbs); + + delete query; + + return ok; +} + +OFBool DcmQueryRetrieveTelnetInitiator::TI_buildImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series) +{ + OFCondition dbcond = EC_Normal; + DcmQueryRetrieveDatabaseStatus dbStatus(STATUS_Pending); + DcmDataset *query = NULL; + DcmDataset *reply = NULL; + + if (db->isRemoteDB) { + return TI_buildRemoteImages(db, study, series); + } + + if (series->imageCount != 0 && + TI_dbModifyTime(db->title) < study->lastQueryTime) { + /* nothing has changed */ + return OFTrue; + } + + TI_destroyImageEntries(series); + + /* get all known images in current series */ + TI_buildImageQuery(&query, study, series); + + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("QUERY OBJECT:\n"); + query->print(COUT); + } + + printf("Querying Database for Images ...\n"); + series->lastQueryTime = time(NULL); + + dbcond = db->dbHandle->startFindRequest( + UID_FINDStudyRootQueryRetrieveInformationModel, query, &dbStatus); + delete query; query = NULL; + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_buildImages: cannot query database"); + return OFFalse; + } + + while (dbStatus.status() == STATUS_Pending) { + dbcond = db->dbHandle->nextFindResponse(&reply, &dbStatus, config.getCharacterSetOptions()); + if (dbcond.bad()) { + DCMQRDB_ERROR("TI_buildImages: database error"); + return OFFalse; + } + if (dbStatus.status() == STATUS_Pending) { + if (DCM_dcmqrdbLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)) { + printf("REPLY OBJECT:\n"); + reply->print(COUT); + } + TI_addImageEntry(series, reply); + delete reply; reply = NULL; + } + } + + if (series->imageCount > 0) { + /* sort the images into assending image number order */ + qsort(series->images, series->imageCount, sizeof(series->images[0]), + TI_imageCompare); + } + + return OFTrue; +} + + +OFBool DcmQueryRetrieveTelnetInitiator::addPeerName(const char *peerName, const char *configFileName) +{ + int k; + OFBool found = OFFalse; + const char **aeTitles; + + if (peerNamesCount == TI_MAXPEERS) + return OFFalse; + + for( k=0; !found && ktitle; + + for( j=0 ; jpeerTitleCount ; j++ ) { + tmpString += dbEntries[i]->peerTitles[j]; + tmpString += ' '; + } + + DCMQRDB_INFO(tmpString); + } +} + +OFBool DcmQueryRetrieveTelnetInitiator::findDBPeerTitles( + const char *configFileName, + TI_DBEntry *dbEntry, + const char *peer) +{ + const char **peerTitles = NULL; + int peerTitleCount = 0; + int i; + + // discover all known AETitles for peer + peerTitleCount = config.aeTitlesForPeer( peer,&peerTitles ); + if( peerTitleCount <= 0 ) + { + DCMQRDB_ERROR("no AE titles defined (in: " << configFileName << ") for peer: " << peer); + return( OFFalse ); + } + + // check to make sure peer+AEtitle has access to database areas + for( i=0 ; ititle, peerTitles[i], peer ) ) + { + // add peer title to database's peer title list + if( dbEntry->peerTitles == NULL ) + dbEntry->peerTitles = (const char**) malloc( sizeof( const char* ) ); + else + dbEntry->peerTitles = (const char**) realloc( dbEntry->peerTitles, (dbEntry->peerTitleCount + 1) * sizeof(const char*) ); + + dbEntry->peerTitles[ dbEntry->peerTitleCount ] = peerTitles[i]; + dbEntry->peerTitleCount++; + } + } + + // throw away the old list + free( peerTitles ); + + return( dbEntry->peerTitleCount > 0 ); +} + + +void DcmQueryRetrieveTelnetInitiator::createConfigEntries( + const char *configFileName, + int remoteDBTitlesCount, + const char **remoteDBTitles) +{ + const char **ctnTitles = NULL; + int ctnTitleCount = 0; + int i, j; + TI_DBEntry *dbEntry = NULL; + + dbCount = 0; + + // discover all the known CTN AE titles + ctnTitleCount = config.ctnTitles(&ctnTitles); + for( i=0 ; ititle = ctnTitles[i]; + + for( j=0 ; jpeerTitleCount > 0 ) + { + // add database to list, it is accessible by something + if( dbEntries == NULL ) + dbEntries = (TI_DBEntry**) malloc( sizeof( TI_DBEntry* ) ); + else + dbEntries = (TI_DBEntry**) realloc( dbEntries, (dbCount + 1) * sizeof(TI_DBEntry*) ); + + dbEntries[ dbCount ] = dbEntry; + dbCount++; + } + else + free( dbEntry ); + } + } + + // throw away the old lists + free( ctnTitles ); + + // add any remote DB entries + for( i=0 ; ititle = remoteDBTitles[i]; + dbEntry->isRemoteDB = OFTrue; + + if( dbEntries == NULL ) + dbEntries = (TI_DBEntry**) malloc( sizeof( TI_DBEntry* ) ); + else + dbEntries = (TI_DBEntry**) realloc( dbEntries, (dbCount + 1) * sizeof(TI_DBEntry*) ); + + dbEntries[ dbCount ] = dbEntry; + dbCount++; + + for( j=0 ; jpeerTitles == NULL ) + dbEntry->peerTitles = (const char**) malloc( sizeof( const char* ) ); + else + dbEntry->peerTitles = (const char**) realloc( dbEntry->peerTitles, (dbEntry->peerTitleCount + 1) * sizeof(const char*) ); + + dbEntry->peerTitles[ dbEntry->peerTitleCount ] = peerTitles[k]; + dbEntry->peerTitleCount++; + } + + // throw away the old list + free( peerTitles ); + } + } + } +} diff --git a/dcmqrdb/tests/Makefile.in b/dcmqrdb/tests/Makefile.in new file mode 100644 index 00000000..bc71ebd9 --- /dev/null +++ b/dcmqrdb/tests/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmqrdb/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +check: + +check-exhaustive: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) + +dependencies: diff --git a/dcmrt/CHANGES b/dcmrt/CHANGES new file mode 100644 index 00000000..8b6df5e7 --- /dev/null +++ b/dcmrt/CHANGES @@ -0,0 +1,802 @@ + +Changes that happened before this module has been moved to the public DCMTK +are documented here. + +**** Changes from 2012.06.04 (riesmeier) + +- Moved module for "DICOM in Radiation Therapy" (DCMRT) to the public DCMTK. + Removed: COPYRIGHT + +**** Changes from 2012.03.28 (riesmeier) + +- Added missing get methods for PixelData (7fe0,0010) element. + Affects: dcmrt/include/dcmtk/dcmrt/drtdose.h + dcmrt/include/dcmtk/dcmrt/drtimage.h + dcmrt/include/dcmtk/dcmrt/seq/drtiis.h + dcmrt/include/dcmtk/dcmrt/seq/drtris.h + +**** Changes from 2012.03.27 (riesmeier) + +- Added get/set methods for US/SS/OW data, e.g. LUTData (0028,3006). + Affects: dcmrt/include/dcmtk/dcmrt/seq/drtmls.h + dcmrt/include/dcmtk/dcmrt/seq/drtvls.h + dcmrt/libsrc/drtmls.cc + dcmrt/libsrc/drtvls.cc + +- Added const variant to get sequence methods. + Affects: dcmrt/include/dcmtk/dcmrt/drtdose.h + dcmrt/include/dcmtk/dcmrt/drtimage.h + dcmrt/include/dcmtk/dcmrt/drtionpl.h + dcmrt/include/dcmtk/dcmrt/drtiontr.h + dcmrt/include/dcmtk/dcmrt/drtplan.h + dcmrt/include/dcmtk/dcmrt/drtstruct.h + +- Updated copyright date. + Affects: dcmrt/docs/drtdump.man + +**** Changes from 2012.02.01 (riesmeier) + +- Moved header files for sequence classes to sub-directory "seq". + Added: dcmrt/include/dcmtk/dcmrt/seq/drt*s.h + dcmrt/include/dcmtk/dcmrt/seq/drt*s1.h + dcmrt/include/dcmtk/dcmrt/seq/drt*s2.h + dcmrt/include/dcmtk/dcmrt/seq/drt*s3.h + Removed: dcmrt/include/dcmtk/dcmrt/drt*s.h + dcmrt/include/dcmtk/dcmrt/drt*s1.h + dcmrt/include/dcmtk/dcmrt/drt*s2.h + dcmrt/include/dcmtk/dcmrt/drt*s3.h + Affects: dcmrt/apps/Makefile.dep + dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/include/Makefile.in + dcmrt/libsrc/Makefile.dep + dcmrt/tests/Makefile.dep + +**** Changes from 2012.01.06 (riesmeier) + +- Added support for building this library as a Windows DLL. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/CMakeLists.txt + +- Updated copyright date to the current year. + Affects: dcmrt/COPYRIGHT + dcmrt/apps/drtdump.cc + dcmrt/libsrc/*.cc + dcmrt/tests/drttest.cc + +**** Changes from 2011.11.23 (riesmeier) + +- Use putOFStringArray() instead of putString() where appropriate. + Affects: dcmrt/libsrc/*.cc + dcmrt/libsrc/drttypes.cc + +**** Changes from 2011.10.27 (riesmeier) + +- Added libiconv to all "apps" that depend on dcmdata to avoid linker errors. + Affects: dcmrt/apps/CMakeLists.txt + dcmrt/apps/Makefile.in + dcmrt/tests/CMakeLists.txt + dcmrt/tests/Makefile.in + +**** Changes from 2011.10.18 (riesmeier) + +- Rebuilt Makefile dependencies. + Affects: dcmrt/apps/Makefile.dep + dcmrt/libsrc/Makefile.dep + dcmrt/tests/Makefile.dep + +**** Changes from 2011.08.24 (riesmeier) + +- Removed unused parameters "argc" and "argv" from the main() function because + this caused warnings reported by gcc with additional options. + Affects: dcmrt/tests/drttest.cc + +**** Changes from 2011.08.23 (riesmeier) + +- Fixed memory leak in write() method of sequence classes. + Affects: dcmrt/libsrc/*.cc + +**** Changes from 2011.08.22 (riesmeier) + +- Fixed wrong documentation of getItem() parameter. Re-generated header files. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + +**** Changes from 2011.08.22 (schlachter) + +- Enhanced the "make check" target. + Affects: dcmrt/Makefile.in + dcmrt/tests/Makefile.in + +**** Changes from 2011.08.09 (riesmeier) + +- Introduced installation components for the CMake build system (in a similar + way as for GNU autoconf), which could be useful for package maintainers. + Added: dcmrt/include/CMakeLists.txt + Removed: dcmrt/include/dcmtk/dcmrt/CMakeLists.txt + Affects: dcmrt/CMakeLists.txt + dcmrt/apps/CMakeLists.txt + dcmrt/libsrc/CMakeLists.txt + +**** Changes from 2011.08.01 (riesmeier) + +- Fixed typo in generated header files. Re-generated all files. + Affects: dcmrt/libsrc/*.cc + dcmrt/include/dcmtk/dcmrt/*.h + +**** Changes from 2011.07.05 (schlachter) + +- Rebuilt Makefile dependencies. + Affects: dcmrt/apps/Makefile.dep + dcmrt/libsrc/Makefile.dep + dcmrt/tests/Makefile.dep + +**** Changes from 2011.05.31 (schlachter) + +- Added a "check" Makefile target. + Affects: dcmrt/Makefile.in + +**** Changes from 2011.05.30 (riesmeier) + +- Changed code generator script in order to handle sequences that are defined + differently in different Modules (not in different IODs as it was before). + Please note that as a result of the new approach some class names changed. + Thanks to forum user "rmoore" for the original report on missing elements. + Added: dcmrt/include/dcmtk/dcmrt/drtas1.h + dcmrt/include/dcmtk/dcmrt/drtas5.h + dcmrt/include/dcmtk/dcmrt/drtas6.h + dcmrt/include/dcmtk/dcmrt/drtas7.h + dcmrt/include/dcmtk/dcmrt/drtbl2.h + dcmrt/include/dcmtk/dcmrt/drtbl5.h + dcmrt/include/dcmtk/dcmrt/drtblds5.h + dcmrt/include/dcmtk/dcmrt/drtblds6.h + dcmrt/include/dcmtk/dcmrt/drtlsds6.h + dcmrt/include/dcmtk/dcmrt/drtlsds7.h + dcmrt/include/dcmtk/dcmrt/drtrbass8.h + dcmrt/include/dcmtk/dcmrt/drtrbos1.h + dcmrt/include/dcmtk/dcmrt/drtrbos6.h + dcmrt/include/dcmtk/dcmrt/drtrbos7.h + dcmrt/include/dcmtk/dcmrt/drtrbs8.h + dcmrt/include/dcmtk/dcmrt/drtrdros.h + dcmrt/include/dcmtk/dcmrt/drtrdrs1.h + dcmrt/include/dcmtk/dcmrt/drtrdrs6.h + dcmrt/include/dcmtk/dcmrt/drtrdrs8.h + dcmrt/include/dcmtk/dcmrt/drtrmss6.h + dcmrt/include/dcmtk/dcmrt/drtrmss7.h + dcmrt/include/dcmtk/dcmrt/drtrris1.h + dcmrt/include/dcmtk/dcmrt/drtrris6.h + dcmrt/include/dcmtk/dcmrt/drtrris9.h + dcmrt/include/dcmtk/dcmrt/drtrrtps3.h + dcmrt/include/dcmtk/dcmrt/drtrrtps4.h + dcmrt/include/dcmtk/dcmrt/drtrrtps5.h + dcmrt/include/dcmtk/dcmrt/drtrshs6.h + dcmrt/include/dcmtk/dcmrt/drtrshs7.h + dcmrt/include/dcmtk/dcmrt/drttms0.h + dcmrt/include/dcmtk/dcmrt/drttms9.h + dcmrt/libsrc/drtas1.cc + dcmrt/libsrc/drtas5.cc + dcmrt/libsrc/drtas6.cc + dcmrt/libsrc/drtas7.cc + dcmrt/libsrc/drtbl2.cc + dcmrt/libsrc/drtbl5.cc + dcmrt/libsrc/drtblds5.cc + dcmrt/libsrc/drtblds6.cc + dcmrt/libsrc/drtlsds6.cc + dcmrt/libsrc/drtlsds7.cc + dcmrt/libsrc/drtrbass8.cc + dcmrt/libsrc/drtrbos1.cc + dcmrt/libsrc/drtrbos6.cc + dcmrt/libsrc/drtrbos7.cc + dcmrt/libsrc/drtrbs8.cc + dcmrt/libsrc/drtrdros.cc + dcmrt/libsrc/drtrdrs1.cc + dcmrt/libsrc/drtrdrs6.cc + dcmrt/libsrc/drtrdrs8.cc + dcmrt/libsrc/drtrmss6.cc + dcmrt/libsrc/drtrmss7.cc + dcmrt/libsrc/drtrris1.cc + dcmrt/libsrc/drtrris6.cc + dcmrt/libsrc/drtrris9.cc + dcmrt/libsrc/drtrrtps3.cc + dcmrt/libsrc/drtrrtps4.cc + dcmrt/libsrc/drtrrtps5.cc + dcmrt/libsrc/drtrshs6.cc + dcmrt/libsrc/drtrshs7.cc + dcmrt/libsrc/drttms0.cc + dcmrt/libsrc/drttms9.cc + Removed: dcmrt/include/dcmtk/dcmrt/drtas.h + dcmrt/include/dcmtk/dcmrt/drtblds2.h + dcmrt/include/dcmtk/dcmrt/drtbls.h + dcmrt/include/dcmtk/dcmrt/drtfgs6.h + dcmrt/include/dcmtk/dcmrt/drtlsdss.h + dcmrt/include/dcmtk/dcmrt/drtrbas3.h + dcmrt/include/dcmtk/dcmrt/drtrbas6.h + dcmrt/include/dcmtk/dcmrt/drtrbos.h + dcmrt/include/dcmtk/dcmrt/drtrbs3.h + dcmrt/include/dcmtk/dcmrt/drtrbs6.h + dcmrt/include/dcmtk/dcmrt/drtrdors.h + dcmrt/include/dcmtk/dcmrt/drtrdrs.h + dcmrt/include/dcmtk/dcmrt/drtrmss.h + dcmrt/include/dcmtk/dcmrt/drtrris.h + dcmrt/include/dcmtk/dcmrt/drtrrps1.h + dcmrt/include/dcmtk/dcmrt/drtrrps2.h + dcmrt/include/dcmtk/dcmrt/drtrrps3.h + dcmrt/include/dcmtk/dcmrt/drtrshss.h + dcmrt/include/dcmtk/dcmrt/drttms.h + dcmrt/libsrc/drtas.cc + dcmrt/libsrc/drtblds2.cc + dcmrt/libsrc/drtbls.cc + dcmrt/libsrc/drtfgs6.cc + dcmrt/libsrc/drtlsdss.cc + dcmrt/libsrc/drtrbas3.cc + dcmrt/libsrc/drtrbas6.cc + dcmrt/libsrc/drtrbos.cc + dcmrt/libsrc/drtrbs3.cc + dcmrt/libsrc/drtrbs6.cc + dcmrt/libsrc/drtrdors.cc + dcmrt/libsrc/drtrdrs.cc + dcmrt/libsrc/drtrmss.cc + dcmrt/libsrc/drtrris.cc + dcmrt/libsrc/drtrrps1.cc + dcmrt/libsrc/drtrrps2.cc + dcmrt/libsrc/drtrrps3.cc + dcmrt/libsrc/drtrshss.cc + dcmrt/libsrc/drttms.cc + Affects: dcmrt/apps/Makefile.dep + dcmrt/libsrc/*.cc + dcmrt/libsrc/CMakeLists.txt + dcmrt/libsrc/Makefile.dep + dcmrt/libsrc/Makefile.in + dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/tests/Makefile.dep + dcmrt/tests/drttest.cc + +- Removed unused variables in order to avoid compiler warnings. + Affects: dcmrt/libsrc/drttypes.cc + +**** Changes from 2011.05.24 (schlachter) + +- Moved LIBDIRS in front of LDFLAGS to link against the freshly build libs. + Thanks to Eric A. Borisch for reporting this. + Affects: dcmrt/apps/Makefile.in + dcmrt/tests/Makefile.in + +**** Changes from 2011.04.19 (schlachter) + +- Use a more thread-safe, global variable for the logger object. + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + dcmrt/libsrc/*.cc + +**** Changes from 2011.03.23 (riesmeier) + +- Added prefix "DCMTK_" to various installation sub-directory CMake variables. + Affects: dcmrt/apps/CMakeLists.txt + dcmrt/include/dcmtk/dcmrt/CMakeLists.txt + dcmrt/libsrc/CMakeLists.txt + +**** Changes from 2011.02.02 (riesmeier) + +- Moved documentation of valid values for the VMs that can be checked to a + central place, i.e. DcmElement::checkVM(). + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + +**** Changes from 2011.01.13 (riesmeier) + +- Indicate in the library description that this module also contains apps. + Affects: dcmrt/docs/dcmrt.dox + +**** Changes from 2011.01.07 (riesmeier) + +- Updated copyright date to the current year. + Affects: dcmrt/COPYRIGHT + +**** Changes from 2010.11.05 (riesmeier) + +- Added support for checking the value multiplicity "9" (see Supplement 131). + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + +**** Changes from 2010.10.27 (riesmeier) + +- Added method which allows for retrieving the stored floating point values + more efficiently from a DecimalString element (using a vector). + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +- Rebuilt Makefile dependencies. + Affects: dcmrt/apps/Makefile.dep + dcmrt/libsrc/Makefile.dep + dcmrt/tests/Makefile.dep + +**** Changes from 2010.10.21 (riesmeier) + +- Added virtual destructor in order to avoid warnings reported by gcc with + additional flags. + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + dcmrt/libsrc/drttypes.cc + +**** Changes from 2010.09.29 (riesmeier) + +- Fixed possible memory leak when "not adding" a data element to the dataset. + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + dcmrt/libsrc/drttypes.cc + +- Use new isEmpty() method instead of length in order to determine whether the + element value is empty (e.g. for checking the presence of type 2 attributes). + Affects: dcmrt/libsrc/drttypes.cc + +**** Changes from 2010.09.27 (riesmeier) + +- Removed module-specific definitions for RT Ion SOP Classes (now in DCMTK). + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + +**** Changes from 2010.08.20 (riesmeier) + +- Added support for RT Ion Plan IOD and RT Ion Beams Treatment Record IOD. + Added: dcmrt/include/dcmtk/dcmrt/drtbldls.h + dcmrt/include/dcmtk/dcmrt/drtcdrs.h + dcmrt/include/dcmtk/dcmrt/drtcpas.h + dcmrt/include/dcmtk/dcmrt/drtfgs6.h + dcmrt/include/dcmtk/dcmrt/drtiblds.h + dcmrt/include/dcmtk/dcmrt/drtibls.h + dcmrt/include/dcmtk/dcmrt/drtibs.h + dcmrt/include/dcmtk/dcmrt/drticpds.h + dcmrt/include/dcmtk/dcmrt/drticps.h + dcmrt/include/dcmtk/dcmrt/drtionpl.h + dcmrt/include/dcmtk/dcmrt/drtiontr.h + dcmrt/include/dcmtk/dcmrt/drtircs.h + dcmrt/include/dcmtk/dcmrt/drtitts.h + dcmrt/include/dcmtk/dcmrt/drtiwps.h + dcmrt/include/dcmtk/dcmrt/drtiws.h + dcmrt/include/dcmtk/dcmrt/drtlsds.h + dcmrt/include/dcmtk/dcmrt/drtlsdss.h + dcmrt/include/dcmtk/dcmrt/drtmdrs.h + dcmrt/include/dcmtk/dcmrt/drtos.h + dcmrt/include/dcmtk/dcmrt/drtrbas6.h + dcmrt/include/dcmtk/dcmrt/drtrbls.h + dcmrt/include/dcmtk/dcmrt/drtrbs6.h + dcmrt/include/dcmtk/dcmrt/drtrcdrs.h + dcmrt/include/dcmtk/dcmrt/drtrcos.h + dcmrt/include/dcmtk/dcmrt/drtrlsds.h + dcmrt/include/dcmtk/dcmrt/drtrmdrs.h + dcmrt/include/dcmtk/dcmrt/drtrms.h + dcmrt/include/dcmtk/dcmrt/drtrmss.h + dcmrt/include/dcmtk/dcmrt/drtrrms.h + dcmrt/include/dcmtk/dcmrt/drtrrshs.h + dcmrt/include/dcmtk/dcmrt/drtrshs.h + dcmrt/include/dcmtk/dcmrt/drtrshss.h + dcmrt/include/dcmtk/dcmrt/drtrsns.h + dcmrt/include/dcmtk/dcmrt/drtrvis.h + dcmrt/include/dcmtk/dcmrt/drtrws.h + dcmrt/include/dcmtk/dcmrt/drtsns.h + dcmrt/include/dcmtk/dcmrt/drttsibs.h + dcmrt/libsrc/drtbldls.cc + dcmrt/libsrc/drtcdrs.cc + dcmrt/libsrc/drtcpas.cc + dcmrt/libsrc/drtfgs6.cc + dcmrt/libsrc/drtiblds.cc + dcmrt/libsrc/drtibls.cc + dcmrt/libsrc/drtibs.cc + dcmrt/libsrc/drticpds.cc + dcmrt/libsrc/drticps.cc + dcmrt/libsrc/drtionpl.cc + dcmrt/libsrc/drtiontr.cc + dcmrt/libsrc/drtircs.cc + dcmrt/libsrc/drtitts.cc + dcmrt/libsrc/drtiwps.cc + dcmrt/libsrc/drtiws.cc + dcmrt/libsrc/drtlsds.cc + dcmrt/libsrc/drtlsdss.cc + dcmrt/libsrc/drtmdrs.cc + dcmrt/libsrc/drtos.cc + dcmrt/libsrc/drtrbas6.cc + dcmrt/libsrc/drtrbls.cc + dcmrt/libsrc/drtrbs6.cc + dcmrt/libsrc/drtrcdrs.cc + dcmrt/libsrc/drtrcos.cc + dcmrt/libsrc/drtrlsds.cc + dcmrt/libsrc/drtrmdrs.cc + dcmrt/libsrc/drtrms.cc + dcmrt/libsrc/drtrmss.cc + dcmrt/libsrc/drtrrms.cc + dcmrt/libsrc/drtrrshs.cc + dcmrt/libsrc/drtrshs.cc + dcmrt/libsrc/drtrshss.cc + dcmrt/libsrc/drtrsns.cc + dcmrt/libsrc/drtrvis.cc + dcmrt/libsrc/drtrws.cc + dcmrt/libsrc/drtsns.cc + dcmrt/libsrc/drttsibs.cc + Affects: dcmrt/apps/drtdump.cc + dcmrt/apps/Makefile.dep + dcmrt/docs/dcmrt.dox + dcmrt/docs/drtdump.man + dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/CMakeLists.txt + dcmrt/libsrc/Makefile.dep + dcmrt/libsrc/Makefile.in + dcmrt/libsrc/*.cc + +- Rebuilt Makefile dependencies. + Affects: dcmrt/tests/Makefile.dep + +**** Changes from 2010.08.09 (riesmeier) + +- Updated data dictionary to 2009 edition of the DICOM standard. From now on, + the official "keyword" is used for the attribute name which results in a + number of minor changes (e.g. "PatientsName" is now called "PatientName"). + NB: Both users and developers should be aware of these changes and modify + their scripts and/or source code accordingly. + Affects: dcmrt/apps/drtdump.cc + dcmrt/docs/dcmrt.dox + dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +**** Changes from 2010.07.21 (onken) + +- Fixed compilation when compiling using cmake. + Affects: dcmrt/apps/CMakeLists.txt + dcmrt/tests/CMakeLists.txt + +**** Changes from 2010.06.04 (schlachter) + +- Don't trip over spaces in the absolute path to the code. + Affects: dcmrt/configure + +**** Changes from 2010.05.11 (riesmeier) + +- Added simple command line tool that dumps the content of a DICOM RT file. + The output of IOD specific data is still somewhat limited for most of the + RT objects. + Added: dcmrt/apps/CMakeLists.txt + dcmrt/apps/drtdump.cc + dcmrt/apps/Makefile.dep + dcmrt/apps/Makefile.in + dcmrt/docs/drtdump.man + Affects: dcmrt/CMakeLists.txt + dcmrt/Makefile.in + dcmrt/docs/dcmrt.dox + +- Added source code examples on how to use the library. + Affects: dcmrt/docs/dcmrt.dox + +- Rebuilt Makefile dependencies. + Affects: dcmrt/libsrc/Makefile.dep + dcmrt/tests/Makefile.dep + +**** Changes from 2010.04.28 (riesmeier) + +- Made default constructor of the item class public (was private) in order to + be also used from the medium-level API. Makes friend declaration obsolete. + Affects: dcmrt/include/dcmtk/dcmrt/drt*s.h + dcmrt/include/dcmtk/dcmrt/drt*s1.h + dcmrt/include/dcmtk/dcmrt/drt*s2.h + dcmrt/include/dcmtk/dcmrt/drt*s3.h + +- Added comment that error code 4 is reserved for medium-level API messages. + Affects: dcmrt/libsrc/drttypes.cc + +**** Changes from 2010.04.23 (riesmeier) + +- Enhanced checking of element values using the new methods from module + dcmdata (check whether the value conforms to the VR and to the given VM). + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/include/dcmtk/dcmrt/drttypes.h + dcmrt/libsrc/*.cc + dcmrt/libsrc/drttypes.cc + +- Added missing detail to API documentation. + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + +**** Changes from 2010.04.21 (riesmeier) + +- Added get methods with numeric result variable for data elements with a + value representation of IS (Integer String) and DS (Decimal String). + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +- Changed default log level from TRACE to INFO. + Affects: dcmrt/tests/drttest.cc + +**** Changes from 2010.03.26 (riesmeier) + +- Added methods for checking the presence of non-mandatory DICOM modules. + Affects: dcmrt/include/dcmtk/dcmrt/drtdose.h + dcmrt/include/dcmtk/dcmrt/drtimage.h + dcmrt/include/dcmtk/dcmrt/drtplan.h + dcmrt/include/dcmtk/dcmrt/drtstruct.h + dcmrt/include/dcmtk/dcmrt/drttreat.h + dcmrt/libsrc/drtdose.cc + dcmrt/libsrc/drtimage.cc + dcmrt/libsrc/drtplan.cc + dcmrt/libsrc/drtstruct.cc + dcmrt/libsrc/drttreat.cc + +- Added comment that the VR of an element value should also be checked. + Affects: dcmrt/libsrc/drttypes.cc + +**** Changes from 2010.03.25 (riesmeier) + +- Added COPYRIGHT file which contains the license details for the library. + Added: dcmrt/COPYRIGHT + +- Updated copyright date and added OFFIS e.V. as a copyright holder. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + dcmrt/tests/drttest.cc + +**** Changes from 2010.03.15 (schlachter) + +- Remove the second occurance of drttsmds.o from $(objs). + Affects: dcmrt/libsrc/Makefile.in + +**** Changes from 2009.12.17 (riesmeier) + +- Added "const" variant of some methods and used const list iterators where + appropriate in order to avoid compiler errors with HAVE_STL defined. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +**** Changes from 2009.12.09 (schlachter) + +- Rebuilt Makefile dependencies. + Affects: dcmrt/libsrc/Makefile.dep + dcmrt/tests/Makefile.dep + +**** Changes from 2009.11.02 (riesmeier) + +- Added separate read() methods for patient, study and series data. + Affects: dcmrt/include/dcmtk/dcmrt/drtdose.h + dcmrt/include/dcmtk/dcmrt/drtimage.h + dcmrt/include/dcmtk/dcmrt/drtplan.h + dcmrt/include/dcmtk/dcmrt/drtstruct.h + dcmrt/include/dcmtk/dcmrt/drttreat.h + dcmrt/libsrc/drtdose.cc + dcmrt/libsrc/drtimage.cc + dcmrt/libsrc/drtplan.cc + dcmrt/libsrc/drtstruct.cc + dcmrt/libsrc/drttreat.cc + +- Clear result variable if getElementFromDataset() fails. + Affects: dcmrt/libsrc/drttypes.cc + +- Use symbolic name of SOP classes instead of numeric UID values. + Affects: dcmrt/libsrc/drtdose.cc + dcmrt/libsrc/drtimage.cc + dcmrt/libsrc/drtplan.cc + dcmrt/libsrc/drtstruct.cc + dcmrt/libsrc/drttreat.cc + +- Added tests for copy constructors and assignment operators. + Affects: dcmrt/tests/drttest.cc + +**** Changes from 2009.10.30 (riesmeier) + +- Added implementation of copy constructor and assignment operator. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +- Added new condition code "invalid object". + Affects: dcmrt/include/dcmtk/dcmrt/drttypes.h + dcmrt/libsrc/drttypes.cc + +**** Changes from 2009.10.02 (riesmeier) + +- Added "const" variant of some methods, especially getXXX() methods, and made + some existing methods "const". + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +- Switched to logging mechanism provided by the "new" oflog module. + Affects: dcmrt/CMakeLists.txt + dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/Makefile.dep + dcmrt/libsrc/Makefile.in + dcmrt/libsrc/*.cc + dcmrt/tests/CMakeLists.txt + dcmrt/tests/Makefile.dep + dcmrt/tests/Makefile.in + dcmrt/tests/drttest.cc + +- Added DRTTreatmentSummaryRecordIOD to the list of main interface classes. + Affects: dcmrt/docs/dcmrt.dox + +**** Changes from 2009.09.28 (riesmeier) + +- Moved general purpose definition file from module dcmdata to ofstd, and + added new defines in order to make the usage easier. + Affects: dcmrt/libsrc/Makefile.dep + dcmrt/tests/Makefile.dep + +**** Changes from 2009.09.02 (riesmeier) + +- Added support for the RT Treament Summary Record IOD. + Added: dcmrt/include/dcmtk/dcmrt/drtfgss.h + dcmrt/include/dcmtk/dcmrt/drtfsss.h + dcmrt/include/dcmtk/dcmrt/drtrrtps.h + dcmrt/include/dcmtk/dcmrt/drttreat.h + dcmrt/include/dcmtk/dcmrt/drttscds.h + dcmrt/include/dcmtk/dcmrt/drttsmds.h + dcmrt/include/dcmtk/dcmrt/drtrtrs.h + dcmrt/libsrc/drtrtrs.cc + dcmrt/libsrc/drttsmds.cc + dcmrt/libsrc/drttreat.cc + dcmrt/libsrc/drttscds.cc + dcmrt/libsrc/drtfgss.cc + dcmrt/libsrc/drtfsss.cc + dcmrt/libsrc/drtrrtps.cc + Affects: dcmrt/libsrc/CMakeLists.txt + dcmrt/libsrc/Makefile.dep + dcmrt/libsrc/Makefile.in + dcmrt/tests/drttest.cc + dcmrt/tests/Makefile.dep + +- Specified default value for parameter "check" in set() methods. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + +- Regenerated source files. + Affects: dcmrt/libsrc/*.cc + +- Regenerated header files. + Affects: dcmrt/include/dcmtk/dcmrt/drtdose.h + dcmrt/include/dcmtk/dcmrt/drtimage.h + dcmrt/include/dcmtk/dcmrt/drtplan.h + dcmrt/include/dcmtk/dcmrt/drtstruct.h + +**** Changes from 2009.08.07 (riesmeier) + +- Use new isEmpty() method instead of length in order to determine whether the + element value is empty (e.g. for checking the presence of type 1 attributes). + Affects: dcmrt/libsrc/drttypes.cc + +- Removed "const" specifier from isEmpty() methods (required because of changes + to the underlying dcmdata method). + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +**** Changes from 2009.08.04 (riesmeier) + +- Enhanced documentation of new "check" parameter of setXXX() methods: Added + details on the VM definition. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + +**** Changes from 2009.08.03 (riesmeier) + +- Added check to the setXXX() methods whether the given string value conforms + to the VR and VM definitions of the DICOM standards. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +**** Changes from 2009.07.27 (riesmeier) + +- Significantly enhanced the checking mechanism used for the write() methods. + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/*.cc + +**** Changes from 2009.07.24 (riesmeier) + +- Made (almost) all public methods of the IOD class "virtual" in order to + facilitate the derivation of subclasses. + Affects: dcmrt/include/dcmtk/dcmrt/drtdose.h + dcmrt/include/dcmtk/dcmrt/drtimage.h + dcmrt/include/dcmtk/dcmrt/drtplan.h + dcmrt/include/dcmtk/dcmrt/drtstruct.h + +- Added check on the presence of all type 1/2 attributes when reading a module. + Affects: dcmrt/libsrc/drtdose.cc + dcmrt/libsrc/drtimage.cc + dcmrt/libsrc/drtstruct.cc + dcmrt/libsrc/drtplan.cc + +- Regenerated source and header file. + Affects: dcmrt/include/dcmtk/dcmrt/drtbcps.h + dcmrt/libsrc/drtbcps.cc + +**** Changes from 2009.04.16 (riesmeier) + +- Updated automatically generated source and header files (added files for + missing sequence classes). + Added: dcmrt/include/dcmtk/dcmrt/drtas.h + dcmrt/include/dcmtk/dcmrt/drtbads.h + dcmrt/include/dcmtk/dcmrt/drtbcps.h + dcmrt/include/dcmtk/dcmrt/drtbldps.h + dcmrt/include/dcmtk/dcmrt/drtbls.h + dcmrt/include/dcmtk/dcmrt/drtbrdrs.h + dcmrt/include/dcmtk/dcmrt/drtchs.h + dcmrt/include/dcmtk/dcmrt/drtcos.h + dcmrt/include/dcmtk/dcmrt/drtcps.h + dcmrt/include/dcmtk/dcmrt/drtcshs.h + dcmrt/include/dcmtk/dcmrt/drtfds.h + dcmrt/include/dcmtk/dcmrt/drtmss.h + dcmrt/include/dcmtk/dcmrt/drtpvis.h + dcmrt/include/dcmtk/dcmrt/drtrbas2.h + dcmrt/include/dcmtk/dcmrt/drtrbas3.h + dcmrt/include/dcmtk/dcmrt/drtrbos.h + dcmrt/include/dcmtk/dcmrt/drtrbs2.h + dcmrt/include/dcmtk/dcmrt/drtrbs3.h + dcmrt/include/dcmtk/dcmrt/drtrdors.h + dcmrt/include/dcmtk/dcmrt/drtrics.h + dcmrt/include/dcmtk/dcmrt/drtrpps.h + dcmrt/include/dcmtk/dcmrt/drtrrros.h + dcmrt/include/dcmtk/dcmrt/drtrses.h + dcmrt/include/dcmtk/dcmrt/drtrsts.h + dcmrt/include/dcmtk/dcmrt/drtsds.h + dcmrt/include/dcmtk/dcmrt/drtshds.h + dcmrt/include/dcmtk/dcmrt/drtwps.h + dcmrt/include/dcmtk/dcmrt/drtws.h + dcmrt/libsrc/drtas.cc + dcmrt/libsrc/drtbads.cc + dcmrt/libsrc/drtbcps.cc + dcmrt/libsrc/drtbldps.cc + dcmrt/libsrc/drtbls.cc + dcmrt/libsrc/drtbrdrs.cc + dcmrt/libsrc/drtchs.cc + dcmrt/libsrc/drtcos.cc + dcmrt/libsrc/drtcps.cc + dcmrt/libsrc/drtcshs.cc + dcmrt/libsrc/drtfds.cc + dcmrt/libsrc/drtmss.cc + dcmrt/libsrc/drtpvis.cc + dcmrt/libsrc/drtrbas2.cc + dcmrt/libsrc/drtrbas3.cc + dcmrt/libsrc/drtrbos.cc + dcmrt/libsrc/drtrbs2.cc + dcmrt/libsrc/drtrbs3.cc + dcmrt/libsrc/drtrdors.cc + dcmrt/libsrc/drtrics.cc + dcmrt/libsrc/drtrpps.cc + dcmrt/libsrc/drtrrros.cc + dcmrt/libsrc/drtrses.cc + dcmrt/libsrc/drtrsts.cc + dcmrt/libsrc/drtsds.cc + dcmrt/libsrc/drtshds.cc + dcmrt/libsrc/drtwps.cc + dcmrt/libsrc/drtws.cc + Removed: dcmrt/include/dcmtk/dcmrt/drtrbs.h + dcmrt/libsrc/drtrbs.cc + Affects: dcmrt/include/dcmtk/dcmrt/*.h + dcmrt/libsrc/CMakeLists.txt + dcmrt/libsrc/Makefile.dep + dcmrt/libsrc/Makefile.in + dcmrt/libsrc/*.cc + dcmrt/tests/Makefile.dep + +**** Changes from 2009.04.02 (riesmeier) + +- Fixed issue with "const" declaration when compiled with HAVE_STL defined. + Affects: dcmrt/include/dcmtk/dcmrt/drt*.h + dcmrt/libsrc/drt*.cc + +**** Changes from 2009.03.26 (riesmeier) + +- Added missing zlib include directory to CMake project file. + Affects: dcmrt/CMakeLists.txt + +- Added missing zlib library and directory to CMake project file. + Affects: dcmrt/tests/CMakeLists.txt + +**** Changes from 2009.03.25 (riesmeier) + +- Added main Doxygen page for this new module. + Added: dcmrt/docs/Makefile.in + dcmrt/docs/dcmrt.dox + +- Added "install" target to makefiles. + Affects: dcmrt/Makefile.in + dcmrt/include/Makefile.in + dcmrt/libsrc/Makefile.in + +- Initial checkin of new module "dcmrt" used for DICOM Radiation Therapy IODs. + Please note that (almost) all of these source code and header files are + generated automatically based on an XML representation of the DICOM standard. + Added: dcmrt/CMakeLists.txt + dcmrt/configure + dcmrt/Makefile.in + dcmrt/include/dcmtk/dcmrt/CMakeLists.txt + dcmrt/include/dcmtk/dcmrt/drt*.h + dcmrt/include/Makefile.in + dcmrt/libsrc/CMakeLists.txt + dcmrt/libsrc/Makefile.dep + dcmrt/libsrc/Makefile.in + dcmrt/libsrc/drt*.cc + dcmrt/tests/CMakeLists.txt + dcmrt/tests/Makefile.dep + dcmrt/tests/Makefile.in + dcmrt/tests/drttest.cc diff --git a/dcmrt/CMakeLists.txt b/dcmrt/CMakeLists.txt new file mode 100644 index 00000000..fe09c890 --- /dev/null +++ b/dcmrt/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmrt) + +# declare include directories which hold for all subdirectories +include_directories("${dcmrt_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc apps tests include) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmrt/Makefile.in b/dcmrt/Makefile.in new file mode 100644 index 00000000..364f9a2d --- /dev/null +++ b/dcmrt/Makefile.in @@ -0,0 +1,87 @@ +# +# Makefile for dcmrt +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: + +install-etc: + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmrt/apps/CMakeLists.txt b/dcmrt/apps/CMakeLists.txt new file mode 100644 index 00000000..e3f97a94 --- /dev/null +++ b/dcmrt/apps/CMakeLists.txt @@ -0,0 +1,5 @@ +# declare executables +DCMTK_ADD_EXECUTABLE(drtdump drtdump) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(drtdump dcmrt dcmdata oflog ofstd) diff --git a/dcmrt/apps/Makefile.dep b/dcmrt/apps/Makefile.dep new file mode 100644 index 00000000..cd8283ba --- /dev/null +++ b/dcmrt/apps/Makefile.dep @@ -0,0 +1,293 @@ +drtdump.o: drtdump.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../include/dcmtk/dcmrt/drtdose.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdvhs.h \ + ../include/dcmtk/dcmrt/seq/drtdvrrs.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtfes.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtiis.h ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtmls.h ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpsss.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h ../include/dcmtk/dcmrt/seq/drtrcs.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h ../include/dcmtk/dcmrt/seq/drtcis.h \ + ../include/dcmtk/dcmrt/seq/drtrdros.h \ + ../include/dcmtk/dcmrt/seq/drtrwvms.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrfors.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps.h \ + ../include/dcmtk/dcmrt/seq/drtrfgs.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h \ + ../include/dcmtk/dcmrt/seq/drtrbas2.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs2.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtssrs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h ../include/dcmtk/dcmrt/drtimage.h \ + ../include/dcmtk/dcmrt/seq/drtcbars.h \ + ../include/dcmtk/dcmrt/seq/drtads.h ../include/dcmtk/dcmrt/seq/drtbas.h \ + ../include/dcmtk/dcmrt/seq/drtds.h ../include/dcmtk/dcmrt/seq/drtes.h \ + ../include/dcmtk/dcmrt/seq/drtas5.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds5.h \ + ../include/dcmtk/dcmrt/seq/drtbl5.h ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h ../include/dcmtk/dcmrt/seq/drtfms.h \ + ../include/dcmtk/dcmrt/seq/drtmacds.h \ + ../include/dcmtk/dcmrt/seq/drtcss.h ../include/dcmtk/dcmrt/seq/drtrims.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps5.h \ + ../include/dcmtk/dcmrt/seq/drtsis.h ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtvls.h ../include/dcmtk/dcmrt/drtplan.h \ + ../include/dcmtk/dcmrt/seq/drtass.h ../include/dcmtk/dcmrt/seq/drtbads.h \ + ../include/dcmtk/dcmrt/seq/drtchs.h ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h \ + ../include/dcmtk/dcmrt/seq/drtrris9.h ../include/dcmtk/dcmrt/seq/drtbs.h \ + ../include/dcmtk/dcmrt/seq/drtas1.h \ + ../include/dcmtk/dcmrt/seq/drtblds1.h \ + ../include/dcmtk/dcmrt/seq/drtbl2.h ../include/dcmtk/dcmrt/seq/drtcos.h \ + ../include/dcmtk/dcmrt/seq/drtcps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h \ + ../include/dcmtk/dcmrt/seq/drtpvis.h \ + ../include/dcmtk/dcmrt/seq/drtrbos1.h \ + ../include/dcmtk/dcmrt/seq/drtrris1.h ../include/dcmtk/dcmrt/seq/drtws.h \ + ../include/dcmtk/dcmrt/seq/drtdrs.h ../include/dcmtk/dcmrt/seq/drtfgs.h \ + ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../include/dcmtk/dcmrt/seq/drtpss.h ../include/dcmtk/dcmrt/seq/drtfds.h \ + ../include/dcmtk/dcmrt/seq/drtmss.h ../include/dcmtk/dcmrt/seq/drtrsis.h \ + ../include/dcmtk/dcmrt/seq/drtsds.h ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps3.h \ + ../include/dcmtk/dcmrt/seq/drtss.h ../include/dcmtk/dcmrt/seq/drttts.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h \ + ../include/dcmtk/dcmrt/seq/drttms9.h ../include/dcmtk/dcmrt/drtstrct.h \ + ../include/dcmtk/dcmrt/seq/drtrros.h \ + ../include/dcmtk/dcmrt/seq/drtrpps.h \ + ../include/dcmtk/dcmrt/seq/drtrecs.h \ + ../include/dcmtk/dcmrt/seq/drtrics.h \ + ../include/dcmtk/dcmrt/seq/drtsptcs.h \ + ../include/dcmtk/dcmrt/seq/drtrrs.h \ + ../include/dcmtk/dcmrt/seq/drtrrros.h \ + ../include/dcmtk/dcmrt/seq/drtspccs.h ../include/dcmtk/dcmrt/drttreat.h \ + ../include/dcmtk/dcmrt/seq/drtfgss.h \ + ../include/dcmtk/dcmrt/seq/drtfsss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps4.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs4.h \ + ../include/dcmtk/dcmrt/seq/drttscds.h \ + ../include/dcmtk/dcmrt/seq/drttsmds.h ../include/dcmtk/dcmrt/drtionpl.h \ + ../include/dcmtk/dcmrt/seq/drtibs.h ../include/dcmtk/dcmrt/seq/drtas6.h \ + ../include/dcmtk/dcmrt/seq/drtddps.h \ + ../include/dcmtk/dcmrt/seq/drtiblds.h \ + ../include/dcmtk/dcmrt/seq/drtibls.h ../include/dcmtk/dcmrt/seq/drtbss.h \ + ../include/dcmtk/dcmrt/seq/drticps.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../include/dcmtk/dcmrt/seq/drtlsds6.h \ + ../include/dcmtk/dcmrt/seq/drtrmss6.h \ + ../include/dcmtk/dcmrt/seq/drtrshs6.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs6.h \ + ../include/dcmtk/dcmrt/seq/drtircs.h ../include/dcmtk/dcmrt/seq/drtiws.h \ + ../include/dcmtk/dcmrt/seq/drtlsds.h ../include/dcmtk/dcmrt/seq/drtrms.h \ + ../include/dcmtk/dcmrt/seq/drtrshs.h \ + ../include/dcmtk/dcmrt/seq/drtrbos6.h \ + ../include/dcmtk/dcmrt/seq/drtrris6.h \ + ../include/dcmtk/dcmrt/seq/drtsns.h ../include/dcmtk/dcmrt/seq/drtitts.h \ + ../include/dcmtk/dcmrt/drtiontr.h ../include/dcmtk/dcmrt/seq/drtcdrs.h \ + ../include/dcmtk/dcmrt/seq/drtmdrs.h \ + ../include/dcmtk/dcmrt/seq/drttms0.h \ + ../include/dcmtk/dcmrt/seq/drttsibs.h \ + ../include/dcmtk/dcmrt/seq/drtas7.h \ + ../include/dcmtk/dcmrt/seq/drtbldls.h \ + ../include/dcmtk/dcmrt/seq/drtdddps.h \ + ../include/dcmtk/dcmrt/seq/drticpds.h \ + ../include/dcmtk/dcmrt/seq/drtcpas.h \ + ../include/dcmtk/dcmrt/seq/drtlsds7.h ../include/dcmtk/dcmrt/seq/drtos.h \ + ../include/dcmtk/dcmrt/seq/drtrmss7.h \ + ../include/dcmtk/dcmrt/seq/drtrshs7.h \ + ../include/dcmtk/dcmrt/seq/drtrbls.h \ + ../include/dcmtk/dcmrt/seq/drtrcos.h \ + ../include/dcmtk/dcmrt/seq/drtrlsds.h \ + ../include/dcmtk/dcmrt/seq/drtrrms.h \ + ../include/dcmtk/dcmrt/seq/drtrrshs.h \ + ../include/dcmtk/dcmrt/seq/drtrsns.h ../include/dcmtk/dcmrt/seq/drtrws.h \ + ../include/dcmtk/dcmrt/seq/drtrbos7.h \ + ../include/dcmtk/dcmrt/seq/drtrcdrs.h \ + ../include/dcmtk/dcmrt/seq/drtrmdrs.h \ + ../include/dcmtk/dcmrt/seq/drtrvis.h diff --git a/dcmrt/apps/Makefile.in b/dcmrt/apps/Makefile.in new file mode 100644 index 00000000..eee9bb4f --- /dev/null +++ b/dcmrt/apps/Makefile.in @@ -0,0 +1,55 @@ + +# Makefile for dcmrt/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle + +LOCALINCLUDES = -I$(dcmdatadir)/include -I$(oflogdir)/include -I$(ofstddir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(dcmimgledir)/libsrc -L$(dcmdatadir)/libsrc \ + -L$(oflogdir)/libsrc -L$(ofstddir)/libsrc +LOCALLIBS = -ldcmrt -ldcmimgle -ldcmdata -loflog -lofstd \ + $(TIFFLIBS) $(PNGLIBS) $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +objs = drtdump.o +progs = drtdump + + +all: $(progs) + +drtdump: drtdump.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + + +install: install-bin + +install-bin: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmrt/apps/drtdump.cc b/dcmrt/apps/drtdump.cc new file mode 100644 index 00000000..c55c00ab --- /dev/null +++ b/dcmrt/apps/drtdump.cc @@ -0,0 +1,517 @@ +/* + * + * Copyright (c) 2010-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Test read and write methods of DICOM RT classes + * + * Generated manually + * File created on 2010-05-10 + * Last modified on 2012-10-09 by Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofconapp.h" + +#include "dcmtk/dcmrt/drtdose.h" +#include "dcmtk/dcmrt/drtimage.h" +#include "dcmtk/dcmrt/drtplan.h" +#include "dcmtk/dcmrt/drtstrct.h" +#include "dcmtk/dcmrt/drttreat.h" +#include "dcmtk/dcmrt/drtionpl.h" +#include "dcmtk/dcmrt/drtiontr.h" + + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "drtdump" + +static OFLogger drtdumpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +// ******************************************** + + +#define DUMP_PATIENT_DATA(rtObject) \ + if (rtObject.getPatientName(tmpString).good()) \ + { \ + OFString outString; \ + out << "Patient : " << tmpString; \ + if (rtObject.getPatientSex(tmpString).good()) \ + appendToString(outString, tmpString); \ + if (rtObject.getPatientBirthDate(tmpString).good()) \ + appendToString(outString, tmpString); \ + if (rtObject.getPatientID(tmpString).good()) \ + appendToString(outString, tmpString, "#" /*prefix*/); \ + if (!outString.empty()) \ + out << " (" << outString << ")"; \ + out << OFendl; \ + } + +#define DUMP_PHYSICIAN_DATA(rtObject) \ + if (rtObject.getReferringPhysicianName(tmpString).good()) \ + { \ + out << "Physician : " << tmpString << OFendl; \ + } + +#define DUMP_OPERATOR_DATA(rtObject) \ + if (rtObject.getOperatorsName(tmpString).good()) \ + { \ + out << "Operator : " << tmpString << OFendl; \ + } + +#define DUMP_STUDY_DATA(rtObject) \ + if (rtObject.getStudyDescription(tmpString).good()) \ + { \ + OFString outString = tmpString; \ + if (rtObject.getStudyID(tmpString).good()) \ + appendToString(outString, tmpString, "#" /*prefix*/); \ + if (rtObject.getStudyDate(tmpString).good()) \ + appendToString(outString, tmpString); \ + if (rtObject.getStudyTime(tmpString).good()) \ + appendToString(outString, tmpString); \ + out << "Study : " << outString << OFendl; \ + } + +#define DUMP_SERIES_DATA(rtObject) \ + if (rtObject.getSeriesDescription(tmpString).good()) \ + { \ + OFString outString = tmpString; \ + if (rtObject.getSeriesNumber(tmpString).good()) \ + appendToString(outString, tmpString, "#" /*prefix*/); \ + out << "Series : " << outString << OFendl; \ + } + +#define DUMP_INSTITUTION_DATA(rtObject) \ + if (rtObject.getInstitutionName(tmpString).good() || \ + rtObject.getInstitutionalDepartmentName(dummyString).good()) \ + { \ + OFString outString = tmpString; \ + if (rtObject.getInstitutionalDepartmentName(tmpString).good()) \ + appendToString(outString, tmpString); \ + out << "Institution : " << outString << OFendl; \ + } + +#define DUMP_DEVICE_DATA(rtObject) \ + if (rtObject.getManufacturer(tmpString).good()) \ + { \ + OFString outString = tmpString; \ + if (rtObject.getManufacturerModelName(tmpString).good()) \ + appendToString(outString, tmpString); \ + if (rtObject.getStationName(tmpString).good()) \ + appendToString(outString, tmpString); \ + out << "Device : " << outString << OFendl; \ + } + + +// ******************************************** + + +static void appendToString(OFString &outString, + const OFString &appendString, + const OFString &prefix = "", + const OFString &suffix = "", + const OFString &delimiter = ", ") +{ + if (!appendString.empty()) + { + if (!outString.empty()) + outString += delimiter; + outString += prefix; + outString += appendString; + outString += suffix; + } +} + +static OFCondition dumpRTDose(STD_NAMESPACE ostream &out, + DcmDataset &dataset) +{ + DRTDoseIOD rtObject; + OFCondition result = rtObject.read(dataset); + if (result.good()) + { + OFString tmpString, dummyString; + out << "RT Dose object" << OFendl << OFendl; + /* output general information */ + DUMP_PATIENT_DATA(rtObject) + DUMP_PHYSICIAN_DATA(rtObject) + DUMP_STUDY_DATA(rtObject) + DUMP_SERIES_DATA(rtObject) + DUMP_INSTITUTION_DATA(rtObject) + DUMP_DEVICE_DATA(rtObject) + /* output further IOD specific data */ + // -- TODO --- + out << OFendl; + } + return result; +} + + +static OFCondition dumpRTImage(STD_NAMESPACE ostream &out, + DcmDataset &dataset) +{ + DRTImageIOD rtObject; + OFCondition result = rtObject.read(dataset); + if (result.good()) + { + OFString tmpString, dummyString; + out << "RT Image object" << OFendl << OFendl; + /* output general information */ + DUMP_PATIENT_DATA(rtObject) + DUMP_PHYSICIAN_DATA(rtObject) + DUMP_OPERATOR_DATA(rtObject) + DUMP_STUDY_DATA(rtObject) + DUMP_SERIES_DATA(rtObject) + DUMP_INSTITUTION_DATA(rtObject) + DUMP_DEVICE_DATA(rtObject) + out << OFendl; + /* output further IOD specific data */ + if (rtObject.getRTImageLabel(tmpString).good()) + { + OFString outString = tmpString; + if (rtObject.getRTImageName(tmpString).good()) + appendToString(outString, tmpString); + if (rtObject.getRTImageDescription(tmpString).good()) + appendToString(outString, tmpString); + out << "RT Image Label/Name : " << outString << OFendl; + } + if (rtObject.getImageType(tmpString, -1 /*all*/).good()) + { + OFString outString = tmpString; + if (rtObject.getConversionType(tmpString).good()) + appendToString(outString, tmpString); + if (rtObject.getRTImagePlane(tmpString).good()) + appendToString(outString, tmpString); + out << "Image/Conversion Type : " << outString << OFendl; + } + if (rtObject.getRadiationMachineName(tmpString).good()) + { + OFString outString = tmpString; + if (rtObject.getRadiationMachineSAD(tmpString).good()) + appendToString(outString, tmpString, "" /*prefix*/, " mm" /*suffix*/); + out << "Radiation Machine : " << outString << OFendl; + } + Uint16 rows, columns; + if (rtObject.getRows(rows).good() && + rtObject.getColumns(columns).good()) + { + out << "Image Resolution : " << columns << " x " << rows << OFendl; + } + Uint16 bitsAllocated, bitsStored, highBit; + if (rtObject.getBitsAllocated(bitsAllocated).good() && + rtObject.getBitsStored(bitsStored).good() && + rtObject.getHighBit(highBit).good()) + { + out << "Image Encoding : " << bitsAllocated << " / " << bitsStored << " / " << highBit << OFendl; + } + out << OFendl; + } + return result; +} + + +static OFCondition dumpRTPlan(STD_NAMESPACE ostream &out, + DcmDataset &dataset) +{ + DRTPlanIOD rtObject; + OFCondition result = rtObject.read(dataset); + if (result.good()) + { + OFString tmpString, dummyString; + out << "RT Plan object" << OFendl << OFendl; + /* output general information */ + DUMP_PATIENT_DATA(rtObject) + DUMP_PHYSICIAN_DATA(rtObject) + DUMP_OPERATOR_DATA(rtObject) + DUMP_STUDY_DATA(rtObject) + DUMP_SERIES_DATA(rtObject) + DUMP_INSTITUTION_DATA(rtObject) + DUMP_DEVICE_DATA(rtObject) + /* output further IOD specific data */ + // -- TODO --- + out << OFendl; + } + return result; +} + + +static OFCondition dumpRTStructureSet(STD_NAMESPACE ostream &out, + DcmDataset &dataset) +{ + DRTStructureSetIOD rtObject; + OFCondition result = rtObject.read(dataset); + if (result.good()) + { + OFString tmpString, dummyString; + out << "RT Structure Set object" << OFendl << OFendl; + /* output general information */ + DUMP_PATIENT_DATA(rtObject) + DUMP_PHYSICIAN_DATA(rtObject) + DUMP_STUDY_DATA(rtObject) + DUMP_SERIES_DATA(rtObject) + DUMP_INSTITUTION_DATA(rtObject) + DUMP_DEVICE_DATA(rtObject) + /* output further IOD specific data */ + // -- TODO --- + out << OFendl; + } + return result; +} + + +static OFCondition dumpRTTreatmentSummaryRecord(STD_NAMESPACE ostream &out, + DcmDataset &dataset) +{ + DRTTreatmentSummaryRecordIOD rtObject; + OFCondition result = rtObject.read(dataset); + if (result.good()) + { + OFString tmpString, dummyString; + out << "RT Treatment Summary Record object" << OFendl << OFendl; + /* output general information */ + DUMP_PATIENT_DATA(rtObject) + DUMP_PHYSICIAN_DATA(rtObject) + DUMP_STUDY_DATA(rtObject) + DUMP_SERIES_DATA(rtObject) + DUMP_INSTITUTION_DATA(rtObject) + DUMP_DEVICE_DATA(rtObject) + /* output further IOD specific data */ + // -- TODO --- + out << OFendl; + } + return result; +} + + +static OFCondition dumpRTIonPlan(STD_NAMESPACE ostream &out, + DcmDataset &dataset) +{ + DRTIonPlanIOD rtObject; + OFCondition result = rtObject.read(dataset); + if (result.good()) + { + OFString tmpString, dummyString; + out << "RT Ion Plan object" << OFendl << OFendl; + /* output general information */ + DUMP_PATIENT_DATA(rtObject) + DUMP_PHYSICIAN_DATA(rtObject) + DUMP_STUDY_DATA(rtObject) + DUMP_SERIES_DATA(rtObject) + DUMP_INSTITUTION_DATA(rtObject) + DUMP_DEVICE_DATA(rtObject) + /* output further IOD specific data */ + // -- TODO --- + out << OFendl; + } + return result; +} + + +static OFCondition dumpRTIonBeamsTreatmentRecord(STD_NAMESPACE ostream &out, + DcmDataset &dataset) +{ + DRTIonBeamsTreatmentRecordIOD rtObject; + OFCondition result = rtObject.read(dataset); + if (result.good()) + { + OFString tmpString, dummyString; + out << "RT Ion Beams Treatment Record object" << OFendl << OFendl; + /* output general information */ + DUMP_PATIENT_DATA(rtObject) + DUMP_PHYSICIAN_DATA(rtObject) + DUMP_STUDY_DATA(rtObject) + DUMP_SERIES_DATA(rtObject) + DUMP_INSTITUTION_DATA(rtObject) + DUMP_DEVICE_DATA(rtObject) + /* output further IOD specific data */ + // -- TODO --- + out << OFendl; + } + return result; +} + + +static OFCondition dumpFile(STD_NAMESPACE ostream &out, + const char *ifname, + const E_FileReadMode readMode, + const E_TransferSyntax xfer) +{ + OFCondition result = EC_IllegalParameter; + /* check for valid input filename */ + if ((ifname != NULL) && (strlen(ifname) > 0)) + { + /* load DICOM file or dataset */ + DcmFileFormat fileformat; + if (readMode == ERM_dataset) + result = fileformat.getDataset()->loadFile(ifname, xfer); + else + result = fileformat.loadFile(ifname, xfer); + if (result.good()) + { + DcmDataset *dataset = fileformat.getDataset(); + /* check SOP Class UID for one of the supported RT objects */ + OFString sopClass; + if (dataset->findAndGetOFString(DCM_SOPClassUID, sopClass).good() && !sopClass.empty()) + { + if (sopClass == UID_RTDoseStorage) + result = dumpRTDose(out, *dataset); + else if (sopClass == UID_RTImageStorage) + result = dumpRTImage(out, *dataset); + else if (sopClass == UID_RTPlanStorage) + result = dumpRTPlan(out, *dataset); + else if (sopClass == UID_RTStructureSetStorage) + result = dumpRTStructureSet(out, *dataset); + else if (sopClass == UID_RTTreatmentSummaryRecordStorage) + result = dumpRTTreatmentSummaryRecord(out, *dataset); + else if (sopClass == UID_RTIonPlanStorage) + result = dumpRTIonPlan(out, *dataset); + else if (sopClass == UID_RTIonBeamsTreatmentRecordStorage) + result = dumpRTIonBeamsTreatmentRecord(out, *dataset); + else + OFLOG_ERROR(drtdumpLogger, "unsupported SOPClassUID (" << sopClass << ") in file: " << ifname); + } else { + OFLOG_ERROR(drtdumpLogger, "SOPClassUID (0008,0016) missing or empty in file: " << ifname); + } + } else { + OFLOG_FATAL(drtdumpLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << result.text() + << ") reading file: " << ifname); + } + } else { + OFLOG_FATAL(drtdumpLogger, OFFIS_CONSOLE_APPLICATION << ": invalid filename: "); + } + return result; +} + + +#define SHORTCOL 3 +#define LONGCOL 20 + + +int main(int argc, char *argv[]) +{ + OFBool opt_printFilename = OFFalse; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Dump DICOM RT file and data set", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("drtfile-in", "DICOM RT input filename to be dumped", OFCmdParam::PM_MultiMandatory); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("printing:"); + cmd.addOption("--print-filename", "+Pf", "print header with filename for each input file"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#ifdef WITH_ZLIB + COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl; +#else + COUT << " none" << OFendl; +#endif + return 0; + } + } + + /* options */ + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + if (cmd.findOption("--print-filename")) + opt_printFilename = OFTrue; + } + + /* print resource identifier */ + OFLOG_DEBUG(drtdumpLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(drtdumpLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + int errorCount = 0; + const int count = cmd.getParamCount(); + const char *current = NULL; + for (int i = 1; i <= count; i++) + { + cmd.getParam(i, current); + if (opt_printFilename) + { + if (i > 1) + COUT << OFString(79, '-') << OFendl; + COUT << OFFIS_CONSOLE_APPLICATION << " (" << i << "/" << count << "): " << current << OFendl << OFendl; + } + if (dumpFile(COUT, current, opt_readMode, opt_ixfer).bad()) + errorCount++; + } + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + return errorCount; +} diff --git a/dcmrt/configure b/dcmrt/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmrt/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmrt/docs/Makefile.in b/dcmrt/docs/Makefile.in new file mode 100644 index 00000000..7727e241 --- /dev/null +++ b/dcmrt/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmrt/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmrt/docs/dcmrt.dox b/dcmrt/docs/dcmrt.dox new file mode 100644 index 00000000..31e015e3 --- /dev/null +++ b/dcmrt/docs/dcmrt.dox @@ -0,0 +1,128 @@ +/*! + +\page mod_dcmrt dcmrt: a radiation therapy library and utility apps + +This module contains classes to read, write, create, modify and access various +DICOM Radiation Therapy (RT) objects. These classes are generated automatically +from the official DocBook/XML version of the DICOM standard. + +The main interface classes are: +\li \b DRTDoseIOD +\li \b DRTImageIOD +\li \b DRTPlanIOD +\li \b DRTStructureSetIOD +\li \b DRTTreatmentSummaryRecordIOD +\li \b DRTIonPlanIOD +\li \b DRTIonBeamsTreatmentRecordIOD + +To simplify working with this low-level interface, there are some hand-written +classes which provide commonly needed functionality. + +These classes are: +\li \b DRTDose +\li \b DRTImage +\li \b DRTPlan +\li \b DRTStructureSet + +\section Tools + +This module contains the following command line tools: +\li \ref drtdump + +\section Examples + +The following example shows how to load an RT Dose file and output the +patient's name: + +\code +DcmFileFormat fileformat; +OFCondition status = fileformat.loadFile("rtdose.dcm"); +if (status.good()) +{ + DRTDoseIOD rtdose; + status = rtdose.read(*fileformat.getDataset()); + if (status.good()) + { + OFString patientName; + status = rtdose.getPatientName(patientName); + if (status.good()) + { + cout << "Patient's Name: " << patientName << endl; + } else + cerr << "Error: cannot access Patient's Name (" << status.text() << ")" << endl; + } else + cerr << "Error: cannot read RT Dose object (" << status.text() << ")" << endl; +} else + cerr << "Error: cannot load DICOM file (" << status.text() << ")" << endl; +\endcode + +The following example shows how to load an RT Dose file and access the scaled +dose image: + +\code +DRTDose rtdose; +OFCondition status = rtdose.loadFile("rtdose.dcm"); +if (status.good()) +{ + const unsigned int frame = 0; + OFVector doseImage; + status = rtdose.getDoseImage(doseImage, frame); + if (status.good()) + { + OFVector::iterator it = doseImage.begin(); + for (int y = 0; y < doseImage.getDoseImageHeight(); ++y) + { + for (int x = 0; x < doseImage.getDoseImageWidth(); ++x) + { + double value = *it++; + /* do something useful with the dose image pixel */ + } + } + } else + cerr << "Error: cannot read RT Dose image (" << status.text() << ")" << endl; +} else + cerr << "Error: cannot load RT Dose object (" << status.text() << ")" << endl; +\endcode + +The following example shows how to load an RT Plan file, change the patient's +name and save it to a new file: + +\code +DcmFileFormat fileformat; +OFCondition status = fileformat.loadFile("rtplan.dcm"); +if (status.good()) +{ + DRTPlanIOD rtplan; + status = rtplan.read(*fileformat.getDataset()); + if (status.good()) + { + status = rtplan.setPatientName("Doe^John"); + if (status.good()) + { + fileformat.clear(); + status = rtplan.write(*fileformat.getDataset()); + if (status.good()) + { + status = fileformat.saveFile("rtplan_new.dcm"); + if (status.bad()) + cerr << "Error: cannot save DICOM file (" << status.text() << ")" << endl; + } else + cerr << "Error: cannot write RT Plan object (" << status.text() << ")" << endl; + } else + cerr << "Error: cannot change Patient's Name (" << status.text() << ")" << endl; + } else + cerr << "Error: cannot read RT Plan object (" << status.text() << ")" << endl; +} else + cerr << "Error: cannot load DICOM file (" << status.text() << ")" << endl; +\endcode + +\section known_issues Known Issues + +Since most of the classes in this module are generated automatically from a +machine-readable version of the DICOM standard and the RT objects are known to +"re-use" the same sequence attributes with different content at various places, +there still might be some issues with wrong definitions in a few sub-sequences. +E.g., the Referenced Beam Sequence (300C,0004) and the Referenced SOP Sequence +(0008,1199) are candidates that might not be handled 100% correctly yet. + +*/ diff --git a/dcmrt/docs/drtdump.man b/dcmrt/docs/drtdump.man new file mode 100644 index 00000000..5d1c2304 --- /dev/null +++ b/dcmrt/docs/drtdump.man @@ -0,0 +1,187 @@ +/*! + +\if MANPAGES +\page drtdump Dump DICOM RT file and data set +\else +\page drtdump drtdump: Dump DICOM RT file and data set +\endif + +\section drtdump_synopsis SYNOPSIS + +\verbatim +drtdump [options] drtfile-in... +\endverbatim + +\section drtdump_description DESCRIPTION + +The \b drtdump utility dumps the contents of a DICOM Radiation Therapy (RT) +object (file format or raw data set) to stdout in textual form. The output +consists of essential information on the RT object in a format that is +probably easier to read than the more generic one from \b dcmdump. + +If \b drtdump reads a raw data set (DICOM data without a file format +meta-header) it will attempt to guess the transfer syntax by examining the +first few bytes of the file. It is not always possible to correctly guess the +transfer syntax and it is better to convert a data set to a file format +whenever possible (using the \b dcmconv utility). It is also possible to use +the \e -f and -t[ieb] options to force \b drtdump to read a dataset +with a particular transfer syntax. + +\section drtdump_parameters PARAMETERS + +\verbatim +drtfile-in DICOM RT input filename to be dumped +\endverbatim + +\section drtdump_options OPTIONS + +\subsection drtdump_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection drtdump_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection drtdump_output_options output options +\verbatim +printing: + + +Pf --print-filename + print header with filename for each input file +\endverbatim + +\section drtdump_notes NOTES + +\subsection drtdump_dicom_conformance DICOM Conformance + +The \b drtdump utility supports the following SOP Classes: + +\verbatim +RTImageStorage 1.2.840.10008.5.1.4.1.1.481.1 +RTDoseStorage 1.2.840.10008.5.1.4.1.1.481.2 +RTStructureSetStorage 1.2.840.10008.5.1.4.1.1.481.3 +RTPlanStorage 1.2.840.10008.5.1.4.1.1.481.5 +RTTreatmentSummaryRecordStorage 1.2.840.10008.5.1.4.1.1.481.7 +RTIonPlanStorage 1.2.840.10008.5.1.4.1.1.481.8 +RTIonBeamsTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.9 +\endverbatim + +\section drtdump_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section drtdump_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section drtdump_environment ENVIRONMENT + +The \b drtdump utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section drtdump_see_also SEE ALSO + +dcmconv(1), dcmdump(1) + +\section drtdump_copyright COPYRIGHT + +Copyright (C) 2010-2014 by OFFIS e.V. and ICSMED AG, Escherweg 2, 26121 +Oldenburg, Germany. + +*/ diff --git a/dcmrt/include/CMakeLists.txt b/dcmrt/include/CMakeLists.txt new file mode 100644 index 00000000..0370f56e --- /dev/null +++ b/dcmrt/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmrt DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmrt/include/Makefile.in b/dcmrt/include/Makefile.in new file mode 100644 index 00000000..89b7f604 --- /dev/null +++ b/dcmrt/include/Makefile.in @@ -0,0 +1,31 @@ +# +# Makefile for dcmrt/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmrt + for file in dcmtk/dcmrt/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmrt ;\ + done + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmrt/seq + for file in dcmtk/dcmrt/seq/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmrt/seq ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmrt/include/dcmtk/dcmrt/drmdose.h b/dcmrt/include/dcmtk/dcmrt/drmdose.h new file mode 100644 index 00000000..17fa30dc --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drmdose.h @@ -0,0 +1,159 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Dose objects + * + */ + +#ifndef DRMDOSE_H +#define DRMDOSE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drtdose.h" + + +/** + * helper class for working with radio therapy dose information objects. This + * class provides several helper functions on top of DRTDoseIOD. + * + * @note These functions hopefully simplify working with DRTDoseIOD. This is a + * work in progress, please propose any improvements which would make working + * with this class easier for you and that your consider useful. + */ +class DCMTK_DCMRT_EXPORT DRTDose : public DRTDoseIOD +{ +public: + /** load an object from a file + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readMode read file with or without meta header, i.e. as a fileformat or a + * dataset. Use ERM_fileOnly in order to force the presence of a meta header. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFile(const OFFilename &fileName, + const E_FileReadMode readMode = ERM_autoDetect, + const E_TransferSyntax readXfer = EXS_Unknown); + + /** get the dose information for a single pixel. The result is the same as + * with getUnscaledDose() * getDoseGridScaling(). Please note that this + * function is inefficient when used for reading most of a frame. It is + * better to use getDoseImage() or getDoseImages() for this. + * @param x x-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageWidth()-1. Left edge of the image has + * coordinate 0. + * @param y y-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageHeight()-1. Top edge of the image has + * coordinate 0. + * @param frame frame to use. The first frame has number 0, the last + * frame is getNumberOfFrames()-1. + * @return dose value for the pixel or 0 if an error occurred. + * @see getDoseType() and getDoseUnits() for the meaning of dose values. + */ + virtual double getDose(unsigned int x, unsigned int y, unsigned int frame = 0) const; + + /** get the dose information for a single pixel. The result is the same as + * with getUnscaledDose() * getDoseGridScaling(). Please note that this + * function is inefficient when used for reading most of a frame. It is + * better to use getDoseImage() or getDoseImages() for this. + * @param result after this function returns successfully, this value will + * be set to the dose information for the requested pixel. + * @param x x-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageWidth()-1. Left edge of the image has + * coordinate 0. + * @param y y-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageHeight()-1. Top edge of the image has + * coordinate 0. + * @param frame frame to use. The first frame has number 0, the last + * frame is getNumberOfFrames()-1. + * @return status, EC_Normal if successful, an error code otherwise + * @see getDoseType() and getDoseUnits() for the meaning of dose values. + */ + virtual OFCondition getDose(double &result, unsigned int x, unsigned int y, unsigned int frame = 0) const; + + /** get the unscaled dose information for a single pixel. Please note that + * this function is inefficient when used for reading most of a frame. + * @param x x-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageWidth()-1. Left edge of the image has + * coordinate 0. + * @param y y-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageHeight()-1. Top edge of the image has + * coordinate 0. + * @param frame frame to use. The first frame has number 0, the last + * frame is getNumberOfFrames()-1. + * @return unscaled dose value for the pixel or 0 if an error occured. + */ + virtual double getUnscaledDose(unsigned int x, unsigned int y, unsigned int frame = 0) const; + + /** get the unscaled dose information for a single pixel. Please note that + * this function is inefficient when used for reading most of a frame. + * @param result after this function returns successfully, this value will + * be set to the unscaled dose information for the requested + * pixel. + * @param x x-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageWidth()-1. Left edge of the image has + * coordinate 0. + * @param y y-coordinate of the pixel. The valid range is from 0 up to + * getDoseImageHeight()-1. Top edge of the image has + * coordinate 0. + * @param frame frame to use. The first frame has number 0, the last + * frame is getNumberOfFrames()-1. + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getUnscaledDose(double &result, unsigned int x, unsigned int y, unsigned int frame = 0) const; + + /** get the dose information for a single frame of the image. + * @param result after this function returns successfully, this will be set + * to an array with getDoseImageWidth() * getDoseImageHeight() + * entries, one for each pixel in the frame. However, when an + * error occurs, this vector is cleared. + * @param frame frame to use. The first frame has number 0, the last + * frame is getNumberOfFrames()-1. + * @return status, EC_Normal if successful, an error code otherwise + * @see getDoseType() and getDoseUnits() for the meaning of dose values. + */ + virtual OFCondition getDoseImage(OFVector &result, unsigned int frame) const; + + /** get the dose information for the whole image. + * @param result after this function returns successfully, this will be set + * to an array with one item per frame. The array for each + * frame will have getDoseImageWidth() * getDoseImageHeight() + * entries, one for each pixel in the frame. However, when an + * error occurs, this vector is cleared. + * @return status, EC_Normal if successful, an error code otherwise + * @see getDoseType() and getDoseUnits() for the meaning of dose values. + */ + virtual OFCondition getDoseImages(OFVector > &result) const; + + /** get the width in pixel of the dose image + * @return the width of the dose image + */ + virtual Uint16 getDoseImageWidth() const; + + /** get the height in pixel of the dose image + * @return the height of the dose image + */ + virtual Uint16 getDoseImageHeight() const; + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); +}; + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drmimage.h b/dcmrt/include/dcmtk/dcmrt/drmimage.h new file mode 100644 index 00000000..33f583eb --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drmimage.h @@ -0,0 +1,275 @@ +/* + * + * Copyright (C) 2012-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Image objects + * + */ + +#ifndef DRMIMAGE_H +#define DRMIMAGE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drtimage.h" +#include "dcmtk/dcmimgle/dcmimage.h" + + +/** + * Helper class for working with radio therapy image objects. This class provides + * a binding between DicomImage and DRTImageIOD. The information from the + * dataset are managed by the DRTImageIOD base class, but the image itself is + * represented through DicomImage. + * + * @note These functions hopefully simplify working with DRTImageIOD. This is a + * work in progress, please propose any improvements which would make working + * with this class easier for you and that your consider useful. + */ +class DCMTK_DCMRT_EXPORT DRTImage : public DRTImageIOD +{ +public: + /** Default constructor */ + DRTImage(); + + /** Destructor */ + ~DRTImage(); + + /** Load an object from a file + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readMode read file with or without meta header, i.e. as a fileformat or a + * dataset. Use ERM_fileOnly in order to force the presence of a meta header. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFile(const OFFilename &fileName, + const E_FileReadMode readMode = ERM_autoDetect, + const E_TransferSyntax readXfer = EXS_Unknown); + + /** Load an RT Image from a given dataset. Please note that this DRTImage + * instance assumes ownership of the dataset pointer and will delete it + * when done with it. You must not delete it yourself. This applies even + * when the function returns an error. + * @param dataset DICOM dataset from which the RT Image should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem *dataset); + + /** Get the DicomImage instance for this RT Image. + * @return the DicomImage instance for this RT Image, may be NULL! + */ + DicomImage *getImage() { return image_; } + /** Get the DicomImage instance for this RT Image. + * @return the DicomImage instance for this RT Image, may be NULL! + */ + const DicomImage *getImage() const { return image_; } + + /** Get the number of pixels in one row + * @return number of pixels in one row + */ + unsigned long getWidth() const + { + return (image_ != NULL) ? image_->getWidth() : 0; + } + + /** Get the number of pixels in one column + * @return number of pixels in one column + */ + unsigned long getHeight() const + { + return (image_ != NULL) ? image_->getHeight() : 0; + } + + /** Get the number of bits per sample of the internal representation + * @return number of bits per sample of the internal representation + */ + int getDepth() const + { + return (image_ != NULL) ? image_->getDepth() : 0; + } + + /** Get the number of frames + * @return number of frames + */ + unsigned long getFrameCount() const + { + return (image_ != NULL) ? image_->getFrameCount() : 0; + } + + /** Get the current status code + * @return current status code + */ + EI_Status getStatus() const + { + return (image_ != NULL) ? image_->getStatus() : EIS_InvalidImage; + } + + /** render pixel data and return result as a memory buffer. + * apply VOI/PLUT transformation and (visible) overlay planes. + * The rendered pixel data is alway unsigned. + * @param result OFVector to fill with resulting frame's data + * @param frame number of frame to be rendered (0..n-1) + * @return EC_Normal if successful, else an error code + */ + OFCondition getOutputData(OFVector& result, const unsigned long frame = 0); + + /** unset all VOI transformations (windows and LUTs). + * + * @return EC_Normal if successful, else an error code + */ + OFCondition setNoVoiTransformation() + { + if (image_ == NULL) + return EC_Normal; + return statusToCondition(image_->setNoVoiTransformation()); + } + + /** set automatically calculated minimum/maximum window. + * possibly active VOI LUT is implicitly disabled. + * Please note that the min/max values refer to the full pixel data (i.e. including + * all possible present frames). + * + ** @param idx ignore global min/max values if true (1) + * + * @return EC_Normal if successful, else an error code + */ + OFCondition setMinMaxWindow(const int idx = 0) + { + if (image_ == NULL) + return EC_Normal; + return statusToCondition(image_->setMinMaxWindow(idx)); + } + + /** set automatically calculated histogram window. + * possibly active VOI LUT is implicitly disabled. + * + ** @param thresh threshold value specifying percentage of histogram border which + * shall be ignored (default: 5%). + * + * @return EC_Normal if successful, else an error code + */ + OFCondition setHistogramWindow(const double thresh = 0.05) + { + if (image_ == NULL) + return EC_Normal; + return statusToCondition(image_->setHistogramWindow(thresh)); + } + + /** set automatically calculated VOI window for the specified Region of Interest (ROI). + * The ROI is specified by means of a rectangle (left, top, width, height). Only the part + * of the ROI that overlaps with the image is regarded - if the overlapping area is empty + * this method returns an error. + * Possibly active VOI LUT is implicitly disabled. + * + ** @param left_pos x-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param top_pos y-coordinate of the top left-hand corner of the ROI (starting from 0) + * @param width width in pixels of the rectangular ROI (minimum: 1) + * @param height height in pixels of the rectangular ROI (minimum: 1) + * @param frame index of the frame to be used for calculation (default: 0 = first) + * + * @return EC_Normal if successful, else an error code + */ + OFCondition setRoiWindow(const unsigned long left_pos, + const unsigned long top_pos, + const unsigned long width, + const unsigned long height, + const unsigned long frame = 0) + { + if (image_ == NULL) + return EC_Normal; + return statusToCondition(image_->setRoiWindow(left_pos, top_pos, width, height, frame)); + } + + /** set specified window (given by window width and center). + * possibly active VOI LUT is implicitly disabled. + * + ** @param center center of specified window + * @param width width of specified window (> 0.0) + * + * @return EC_Normal if successful, else an error code + */ + OFCondition setWindow(const double center, + const double width) + { + if (image_ == NULL) + return EC_Normal; + return statusToCondition(image_->setWindow(center, width)); + } + + /** get current window center and width values + * + ** @param center return current window center value + * @param width return current window width value + * + * @return EC_Normal if successful, else an error code + */ + OFCondition getWindow(double ¢er, + double &width) + { + center = 0; + width = 0; + if (image_ == NULL) + return EC_Normal; + return statusToCondition(image_->getWindow(center, width)); + } + + /** + * Clear all internal state. + */ + virtual void clear(); + +private: + /// Reset this class image and DICOM object members + virtual void reset(); + + /** hide DRTImageIOD::read(). DicomImage() doesn't allow the dataset that was + * used for loading the image to be deleted. Thus, read() cannot work. + * @return always returns EC_IllegalCall since this method should not be called + */ + virtual OFCondition read(DcmItem & /*dataset*/) + { + return EC_IllegalCall; + } + + /** turn a status code from DicomImage into an OFCondition object. + * @param status status code + * @return OFCondition instance for the given status + */ + OFCondition statusToCondition(int status) + { + if (status) + return EC_Normal; + // This is our new "unknown error" OFCondition + return RT_EC_UnsupportedValue; + } + + /** undefined private copy constructor */ + DRTImage(const DRTImage &); + + /** undefined private assignment operator */ + DRTImage &operator=(const DRTImage &); + + /// File format that was used when last loading an image + DcmFileFormat format_; + + /// Dataset that image_ is using, or NULL if it uses format_ + DcmItem *dataset_; + + /// DicomImage instance representing the image + DicomImage *image_; +}; + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drmplan.h b/dcmrt/include/dcmtk/dcmrt/drmplan.h new file mode 100644 index 00000000..fce704eb --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drmplan.h @@ -0,0 +1,95 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Plan objects + * + */ + +#ifndef DRMPLAN_H +#define DRMPLAN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drtplan.h" + + +/** + * helper class for working with radio therapy plan objects. This class + * provides several helper functions on top of DRTPlanIOD. + * + * @note These functions hopefully simplify working with DRTPlanIOD. This is a + * work in progress, please propose any improvements which would make working + * with this class easier for you and that your consider useful. + */ +class DCMTK_DCMRT_EXPORT DRTPlan : public DRTPlanIOD { +public: + /** load an object from a file + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readMode read file with or without meta header, i.e. as a fileformat or a + * dataset. Use ERM_fileOnly in order to force the presence of a meta header. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFile(const OFFilename &fileName, + const E_FileReadMode readMode = ERM_autoDetect, + const E_TransferSyntax readXfer = EXS_Unknown); + + /** find a fraction group by its fraction group number. + * @param fractionGroupNumber the fraction group number to find. + * @return the item representing the fraction group or the EmptyDefaultItem + * of the DRTFractionGroupSequence. + */ + DRTFractionGroupSequence::Item& getFractionGroup(Sint32 fractionGroupNumber); + + /** find a beam by its beam number. + * @param beamNumber the beam number to find. + * @return the item representing the beam or the EmptyDefaultItem of the + * DRTBeamSequence. + */ + DRTBeamSequence::Item& getBeam(Sint32 beamNumber); + + /** find a dose reference by its dose reference number. + * @param referenceNumber the beam number to find. + * @return the item representing the dose reference or the EmptyDefaultItem + * of the DRTDoseReferenceSequence. + */ + DRTDoseReferenceSequence::Item& getDoseReference(Sint32 referenceNumber); + + /** find a tolerance table by its tolerance table number. + * @param tableNumber the tolerance table number to find. + * @return the item representing the tolerance table or the + * EmptyDefaultItem of the DRTToleranceTableSequence. + */ + DRTToleranceTableSequence::Item& getToleranceTable(Sint32 tableNumber); + + /** find a patient setup by its patient setup number. + * @param setupNumber the setup number to find. + * @return the item representing the setup or the + * EmptyDefaultItem of the DRTPatientSetupSequence. + */ + DRTPatientSetupSequence::Item& getPatientSetup(Sint32 setupNumber); + + /** find a application setup by its application setup number. + * @param setupNumber the setup number to find. + * @return the item representing the setup or the + * EmptyDefaultItem of the DRTApplicationSetupSequence. + */ + DRTApplicationSetupSequence::Item& getApplicationSetup(Sint32 setupNumber); +}; + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drmsrch.h b/dcmrt/include/dcmtk/dcmrt/drmsrch.h new file mode 100644 index 00000000..184e3f26 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drmsrch.h @@ -0,0 +1,126 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Template helper functions for searching through sequences + * + */ + +#ifndef DRMSRCH_H +#define DRMSRCH_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + + +namespace DRTSearch { + /** + * Given a function predicate, this iterates over an IOD and finds the + * first item for which the predicate returns true. The result will be the + * IOD's currentItem(). If nothing is found, currentItem() will return the + * EmptyDefaultItem. + * @tparam IOD the type of the IOD that should be checked + * @tparam Predicate the type of the search predicate + * @param iod the IOD to search through + * @param pred the predicate to check + * @return EC_IllegalCall if search failed, else EC_Normal + */ + template + static inline OFCondition findItem(IOD& iod, Predicate& pred) + { + OFCondition cond = iod.gotoFirstItem(); + + while (cond.good()) { + if (pred(iod.getCurrentItem())) + break; + cond = iod.gotoNextItem(); + } + + return cond; + } + + /** + * This implements a search predicate for findItem which looks for some + * object attribute via the equality operator. + * @tparam IOD the type of the IOD that should be checked + * @tparam Item this should always be IOD::Item. Sadly, MSC6 can't figure + * that out by itself and so we must explicitly tell it about this type. + * @tparam type the type that is being searched for + * @tparam arg2 the type of the second argument to the getter function + * @tparam argument2 the value of the second argument to the getter function + */ + template + class searchPropertyEqual { + public: + /// Type of the getter-function that is used for getting the value. + typedef OFCondition (Item::*funcType)(type&, arg2) const; + + /** + * Constructor + * @param expected the expected value that we are searching for + * @param func member function that gets us the value from the object + */ + searchPropertyEqual(const type& expected, funcType func) : m_expected(expected), m_func(func) { } + + /// @return true if the given item has the wanted property + OFBool operator()(const Item& item) { + type value; + OFCondition cond = (item.*m_func)(value, argument2); + return cond.good() && value == m_expected; + } + + private: + /// The expected value of an item + type m_expected; + + /// Getter function which gets the actual value from an item + funcType m_func; + }; + + /** + * Helper class which wraps searchPropertyEqual and findItem to make it + * easier to search through an IOD. + * @tparam IOD the type of the IOD that should be checked + * @tparam Item this should always be IOD::Item. Sadly, MSC6 can't figure + * that out by itself and so we must explicitly tell it about this type. + * @tparam type the type that is being searched for + * @tparam arg2 the type of the second argument to the getter function + * @tparam argument2 the value of the second argument to the getter function + */ + template + class searchPropertyEqualHelper { + public: + /// Typedef for simplifying usage of searchPropertyEqual + typedef searchPropertyEqual searchType; + + /** + * Find an item in a sequence + * @param seq the sequence to search through + * @param wanted the value that should be found + * @param func function that gets a value from a sequence item + * @return Reference to the first item that matches or to the empty + * default item. + */ + static typename IOD::Item& search(IOD& seq, const type& wanted, typename searchType::funcType func) + { + searchType s(wanted, func); + findItem(seq, s); + // If the search failed, this will be the empty default item + return seq.getCurrentItem(); + } + }; +} + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drmstrct.h b/dcmrt/include/dcmtk/dcmrt/drmstrct.h new file mode 100644 index 00000000..e42542c0 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drmstrct.h @@ -0,0 +1,96 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Structure Set objects + * + */ + +#ifndef DRMSTRCT_H +#define DRMSTRCT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drtstrct.h" + + +/** + * helper class for working with radio therapy structure set objects. This class + * provides several helper functions on top of DRTStructureSet. + * + * @note These functions hopefully simplify working with DRTStructureSetIOD. + * This is a work in progress, please propose any improvements which would make + * working with this class easier for you and that your consider useful. + */ +class DCMTK_DCMRT_EXPORT DRTStructureSet : public DRTStructureSetIOD +{ +public: + /** load an object from a file + * @param fileName name of the file to load (may contain wide chars if support enabled). + * Since there are various constructors for the OFFilename class, a "char *", "OFString" + * or "wchar_t *" can also be passed directly to this parameter. + * @param readMode read file with or without meta header, i.e. as a fileformat or a + * dataset. Use ERM_fileOnly in order to force the presence of a meta header. + * @param readXfer transfer syntax used to read the data (auto detection if EXS_Unknown) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition loadFile(const OFFilename &fileName, + const E_FileReadMode readMode = ERM_autoDetect, + const E_TransferSyntax readXfer = EXS_Unknown); + + /** find a frame of reference by its fraction UID. + * @param uid the UID to find. + * @return the item representing the frame of reference or the + * EmptyDefaultItem of the DRTReferencedFrameOfReferenceSequence. + */ + DRTReferencedFrameOfReferenceSequence::Item& getFrameOfReference(const OFString& uid); + + /** find a region of interest by its roi number. + * @param roiNumber the ROI to find. + * @return the item representing the region of interest or the + * EmptyDefaultItem of the DRTStructureSetROISequence. + */ + DRTStructureSetROISequence::Item& getROI(Sint32 roiNumber); + + /** find an observation by its observation number. + * @param observationNumber the observation number to find. + * @return the item representing the observation or the + * EmptyDefaultItem of the DRTRTROIObservationsSequence. + */ + DRTRTROIObservationsSequence::Item& getObservation(Sint32 observationNumber); + + /** find an observation belonging to a given ROI number. + * @param roiNumber the ROI number to find. + * @return the item representing the observation or the + * EmptyDefaultItem of the DRTRTROIObservationsSequence. + */ + DRTRTROIObservationsSequence::Item& getObservationByROINumber(Sint32 roiNumber); + + /** get all contours for a region of interest. + * @param result vector for storing the contours + * @param roiNumber ROI number to look for + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContoursForROINumber(OFVector result, Sint32 roiNumber); + + /** get all contours for a region of interest. + * @param result list for storing the contours + * @param roiNumber ROI number to look for + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContoursForROINumber(OFList result, Sint32 roiNumber); +}; + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drtdose.h b/dcmrt/include/dcmtk/dcmrt/drtdose.h new file mode 100644 index 00000000..bdff02bc --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drtdose.h @@ -0,0 +1,4712 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDoseIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDOSE_H +#define DRTDOSE_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtadcs.h" // for AdmittingDiagnosesCodeSequence +#include "dcmtk/dcmrt/seq/drtbrs.h" // for BreedRegistrationSequence +#include "dcmtk/dcmrt/seq/drtcsis.h" // for CodingSchemeIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcctus.h" // for ConsentForClinicalTrialUseSequence +#include "dcmtk/dcmrt/seq/drtcpis.h" // for ConsultingPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcgis.h" // for ContextGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtces.h" // for ContributingEquipmentSequence +#include "dcmtk/dcmrt/seq/drtcsas.h" // for ConversionSourceAttributesSequence +#include "dcmtk/dcmrt/seq/drtdvhs.h" // for DVHSequence +#include "dcmtk/dcmrt/seq/drtdimcs.h" // for DeidentificationMethodCodeSequence +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence +#include "dcmtk/dcmrt/seq/drtdss.h" // for DigitalSignaturesSequence +#include "dcmtk/dcmrt/seq/drteas.h" // for EncryptedAttributesSequence +#include "dcmtk/dcmrt/seq/drtfes.h" // for FrameExtractionSequence +#include "dcmtk/dcmrt/seq/drtgms.h" // for GeneticModificationsSequence +#include "dcmtk/dcmrt/seq/drtgpis.h" // for GroupOfPatientsIdentificationSequence +#include "dcmtk/dcmrt/seq/drthsdrs.h" // for HL7StructuredDocumentReferenceSequence +#include "dcmtk/dcmrt/seq/drtiis.h" // for IconImageSequence +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtiais.h" // for IssuerOfAdmissionIDSequence +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence +#include "dcmtk/dcmrt/seq/drtiseis.h" // for IssuerOfServiceEpisodeIDSequence +#include "dcmtk/dcmrt/seq/drtmps.h" // for MACParametersSequence +#include "dcmtk/dcmrt/seq/drtmris.h" // for MappingResourceIdentificationSequence +#include "dcmtk/dcmrt/seq/drtmls.h" // for ModalityLUTSequence +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtoas.h" // for OriginalAttributesSequence +#include "dcmtk/dcmrt/seq/drtopis.h" // for OtherPatientIDsSequence +#include "dcmtk/dcmrt/seq/drtpbcs.h" // for PatientBreedCodeSequence +#include "dcmtk/dcmrt/seq/drtpsics.h" // for PatientSizeCodeSequence +#include "dcmtk/dcmrt/seq/drtpscs.h" // for PatientSpeciesCodeSequence +#include "dcmtk/dcmrt/seq/drtppcs.h" // for PerformedProtocolCodeSequence +#include "dcmtk/dcmrt/seq/drtporis.h" // for PhysiciansOfRecordIdentificationSequence +#include "dcmtk/dcmrt/seq/drtprsis.h" // for PhysiciansReadingStudyIdentificationSequence +#include "dcmtk/dcmrt/seq/drtpsss.h" // for PredecessorStructureSetSequence +#include "dcmtk/dcmrt/seq/drtpdecs.h" // for PrivateDataElementCharacteristicsSequence +#include "dcmtk/dcmrt/seq/drtpcs.h" // for ProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrcs.h" // for ROIContourSequence +#include "dcmtk/dcmrt/seq/drtrdros.h" // for RTDoseROISequence +#include "dcmtk/dcmrt/seq/drtrwvms.h" // for RealWorldValueMappingSequence +#include "dcmtk/dcmrt/seq/drtrppcs.h" // for ReasonForPerformedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrfors.h" // for ReferencedFrameOfReferenceSequence +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence +#include "dcmtk/dcmrt/seq/drtrpphs.h" // for ReferencedPatientPhotoSequence +#include "dcmtk/dcmrt/seq/drtrps.h" // for ReferencedPatientSequence +#include "dcmtk/dcmrt/seq/drtrppss.h" // for ReferencedPerformedProcedureStepSequence +#include "dcmtk/dcmrt/seq/drtrrtps.h" // for ReferencedRTPlanSequence +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence +#include "dcmtk/dcmrt/seq/drtrsrs.h" // for ReferencedSpatialRegistrationSequence +#include "dcmtk/dcmrt/seq/drtrsss.h" // for ReferencedStructureSetSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrtrs2.h" // for ReferencedTreatmentRecordSequence +#include "dcmtk/dcmrt/seq/drtrpis.h" // for ReferringPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtras.h" // for RequestAttributesSequence +#include "dcmtk/dcmrt/seq/drtrscs.h" // for RequestingServiceCodeSequence +#include "dcmtk/dcmrt/seq/drtsdcs.h" // for SeriesDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtspgis.h" // for SourcePatientGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtscs.h" // for StrainCodeSequence +#include "dcmtk/dcmrt/seq/drtsss.h" // for StrainStockSequence +#include "dcmtk/dcmrt/seq/drtssrs.h" // for StructureSetROISequence +#include "dcmtk/dcmrt/seq/drtscris.h" // for StudiesContainingOtherReferencedInstancesSequence +#include "dcmtk/dcmrt/seq/drtudis.h" // for UDISequence + + +/** Interface class for RTDoseIOD + * @note Because of its many member variables, an instance of this class requires quite + * some memory. So be careful when creating automatic variables from this class (the + * stack size might be exceeded); it is probably better to use the heap space. + */ +class DCMTK_DCMRT_EXPORT DRTDoseIOD + : protected DRTTypes +{ + + public: + + // --- constructors, destructor and operators --- + + /** default constructor + */ + DRTDoseIOD(); + + /** copy constructor + * @param copy IOD object to be copied + */ + DRTDoseIOD(const DRTDoseIOD ©); + + /** destructor + */ + virtual ~DRTDoseIOD(); + + /** assigment operator + * @param copy IOD object to be copied + * @return reference to this object + */ + DRTDoseIOD &operator=(const DRTDoseIOD ©); + + // --- general methods --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + // --- input/output methods --- + + /** read object from dataset + * @param dataset reference to DICOM dataset from which the object should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** read PatientData from dataset + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset); + + /** read StudyData from dataset. Also reads PatientData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset); + + /** read SeriesData from dataset. Also reads PatientData, StudyData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSeriesData(DcmItem &dataset); + + /** write object to dataset + * @param dataset reference to DICOM dataset to which the object should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // --- check presence of non-mandatory DICOM modules --- + + /** check whether ClinicalTrialSubjectModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSubjectModulePresent(const OFBool complete = OFFalse); + + /** check whether PatientStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isPatientStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialSeriesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSeriesModulePresent(const OFBool complete = OFFalse); + + /** check whether GeneralImageModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isGeneralImageModulePresent(const OFBool complete = OFFalse); + + /** check whether ImagePlaneModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isImagePlaneModulePresent(const OFBool complete = OFFalse); + + /** check whether ImagePixelModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isImagePixelModulePresent(const OFBool complete = OFFalse); + + /** check whether MultiFrameModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isMultiFrameModulePresent(const OFBool complete = OFFalse); + + /** check whether OverlayPlaneModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isOverlayPlaneModulePresent(const OFBool complete = OFFalse); + + /** check whether MultiFrameOverlayModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isMultiFrameOverlayModulePresent(const OFBool complete = OFFalse); + + /** check whether ModalityLUTModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isModalityLUTModulePresent(const OFBool complete = OFFalse); + + /** check whether RTDVHModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTDVHModulePresent(const OFBool complete = OFFalse); + + /** check whether StructureSetModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isStructureSetModulePresent(const OFBool complete = OFFalse); + + /** check whether ROIContourModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isROIContourModulePresent(const OFBool complete = OFFalse); + + /** check whether RTDoseROIModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTDoseROIModulePresent(const OFBool complete = OFFalse); + + /** check whether CommonInstanceReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCommonInstanceReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether FrameExtractionModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isFrameExtractionModulePresent(const OFBool complete = OFFalse); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionDate (0008,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDate(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionDateTime (0008,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDateTime(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionNumber (0020,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionNumber(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionNumber (0020,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get AcquisitionTime (0008,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionTime(OFString &value, const signed long pos = 0) const; + + /** get AdditionalPatientHistory (0010,21b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdditionalPatientHistory(OFString &value, const signed long pos = 0) const; + + /** get AdmissionID (0038,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmissionID(OFString &value, const signed long pos = 0) const; + + /** get AdmittingDiagnosesDescription (0008,1080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString &value, const signed long pos = 0) const; + + /** get Allergies (0010,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAllergies(OFString &value, const signed long pos = 0) const; + + /** get AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos = 0) const; + + /** get BitsAllocated (0028,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsAllocated(Uint16 &value, const unsigned long pos = 0) const; + + /** get BitsStored (0028,0101) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsStored(Uint16 &value, const unsigned long pos = 0) const; + + /** get BluePaletteColorLookupTableData (0028,1203) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBluePaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get BluePaletteColorLookupTableDescriptor (0028,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBluePaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get BurnedInAnnotation (0028,0301) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBurnedInAnnotation(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolName (0012,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesDescription (0012,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesID (0012,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteID (0012,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteName (0012,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSponsorName (0012,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSponsorName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectID (0012,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectReadingID (0012,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectReadingID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointDescription (0012,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointID (0012,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointID(OFString &value, const signed long pos = 0) const; + + /** get ColorSpace (0028,2002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getColorSpace(OFString &value, const signed long pos = 0) const; + + /** get Columns (0028,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getColumns(Uint16 &value, const unsigned long pos = 0) const; + + /** get CommentsOnThePerformedProcedureStep (0040,0280) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos = 0) const; + + /** get ConsultingPhysicianName (0008,009c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConsultingPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get ContentDate (0008,0023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentDate(OFString &value, const signed long pos = 0) const; + + /** get ContentQualification (0018,9004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, const signed long pos = 0) const; + + /** get ContentTime (0008,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentTime(OFString &value, const signed long pos = 0) const; + + /** get DVHNormalizationDoseValue (3004,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDVHNormalizationDoseValue(OFString &value, const signed long pos = 0) const; + + /** get DVHNormalizationDoseValue (3004,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDVHNormalizationDoseValue(Float64 &value, const unsigned long pos = 0) const; + + /** get DVHNormalizationPoint (3004,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDVHNormalizationPoint(OFString &value, const signed long pos = 0) const; + + /** get DVHNormalizationPoint (3004,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDVHNormalizationPoint(Float64 &value, const unsigned long pos = 0) const; + + /** get DVHNormalizationPoint (3004,0040) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDVHNormalizationPoint(OFVector &value) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeidentificationMethod (0012,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeidentificationMethod(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get DoseComment (3004,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoseComment(OFString &value, const signed long pos = 0) const; + + /** get DoseGridScaling (3004,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoseGridScaling(OFString &value, const signed long pos = 0) const; + + /** get DoseGridScaling (3004,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoseGridScaling(Float64 &value, const unsigned long pos = 0) const; + + /** get DoseSummationType (3004,000a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoseSummationType(OFString &value, const signed long pos = 0) const; + + /** get DoseType (3004,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoseType(OFString &value, const signed long pos = 0) const; + + /** get DoseUnits (3004,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDoseUnits(OFString &value, const signed long pos = 0) const; + + /** get EthnicGroup (0010,2160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEthnicGroup(OFString &value, const signed long pos = 0) const; + + /** get FrameIncrementPointer (0028,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameIncrementPointer(OFString &value, const signed long pos = 0) const; + + /** get FrameOfReferenceUID (0020,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceUID(OFString &value, const signed long pos = 0) const; + + /** get GantryID (0018,1008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryID(OFString &value, const signed long pos = 0) const; + + /** get GreenPaletteColorLookupTableData (0028,1202) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGreenPaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get GreenPaletteColorLookupTableDescriptor (0028,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGreenPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get GridFrameOffsetVector (3004,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGridFrameOffsetVector(OFString &value, const signed long pos = 0) const; + + /** get GridFrameOffsetVector (3004,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGridFrameOffsetVector(Float64 &value, const unsigned long pos = 0) const; + + /** get GridFrameOffsetVector (3004,000c) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGridFrameOffsetVector(OFVector &value) const; + + /** get HighBit (0028,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getHighBit(Uint16 &value, const unsigned long pos = 0) const; + + /** get ICCProfile (0028,2000) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getICCProfile(Uint8 *&value, unsigned long *count = NULL) const; + + /** get ImageComments (0020,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageComments(OFString &value, const signed long pos = 0) const; + + /** get ImageFrameOrigin (60xx,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageFrameOrigin(Uint16 &value, const unsigned long pos = 0) const; + + /** get ImageOrientationPatient (0020,0037) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageOrientationPatient(OFString &value, const signed long pos = 0) const; + + /** get ImageOrientationPatient (0020,0037) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageOrientationPatient(Float64 &value, const unsigned long pos = 0) const; + + /** get ImageOrientationPatient (0020,0037) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageOrientationPatient(OFVector &value) const; + + /** get ImagePositionPatient (0020,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePositionPatient(OFString &value, const signed long pos = 0) const; + + /** get ImagePositionPatient (0020,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePositionPatient(Float64 &value, const unsigned long pos = 0) const; + + /** get ImagePositionPatient (0020,0032) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePositionPatient(OFVector &value) const; + + /** get ImageType (0008,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageType(OFString &value, const signed long pos = 0) const; + + /** get ImagesInAcquisition (0020,1002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagesInAcquisition(OFString &value, const signed long pos = 0) const; + + /** get ImagesInAcquisition (0020,1002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagesInAcquisition(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstanceCoercionDateTime (0008,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCoercionDateTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationDate (0008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationTime (0008,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreatorUID (0008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get IrradiationEventUID (0008,3010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIrradiationEventUID(OFString &value, const signed long pos = 0) const; + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get LargestImagePixelValue (0028,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLargestImagePixelValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get LastMenstrualDate (0010,21d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLastMenstrualDate(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalEventType (0012,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalEventType(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalInformationModified (0028,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalInformationModified(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos = 0) const; + + /** get LossyImageCompression (0028,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompression(OFString &value, const signed long pos = 0) const; + + /** get LossyImageCompressionMethod (0028,2114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionMethod(OFString &value, const signed long pos = 0) const; + + /** get LossyImageCompressionRatio (0028,2112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(OFString &value, const signed long pos = 0) const; + + /** get LossyImageCompressionRatio (0028,2112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(Float64 &value, const unsigned long pos = 0) const; + + /** get LossyImageCompressionRatio (0028,2112) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(OFVector &value) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MedicalAlerts (0010,2000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMedicalAlerts(OFString &value, const signed long pos = 0) const; + + /** get Modality (0008,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, const signed long pos = 0) const; + + /** get NameOfPhysiciansReadingStudy (0008,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos = 0) const; + + /** get NormalizationPoint (3004,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNormalizationPoint(OFString &value, const signed long pos = 0) const; + + /** get NormalizationPoint (3004,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNormalizationPoint(Float64 &value, const unsigned long pos = 0) const; + + /** get NormalizationPoint (3004,0008) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNormalizationPoint(OFVector &value) const; + + /** get NumberOfFrames (0028,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFrames(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFrames (0028,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFrames(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfFramesInOverlay (60xx,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFramesInOverlay(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFramesInOverlay (60xx,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFramesInOverlay(Sint32 &value, const unsigned long pos = 0) const; + + /** get Occupation (0010,2180) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOccupation(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OriginalSpecializedSOPClassUID (0008,001b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get OtherPatientNames (0010,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOtherPatientNames(OFString &value, const signed long pos = 0) const; + + /** get OverlayBitPosition (60xx,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayBitPosition(Uint16 &value, const unsigned long pos = 0) const; + + /** get OverlayBitsAllocated (60xx,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayBitsAllocated(Uint16 &value, const unsigned long pos = 0) const; + + /** get OverlayColumns (60xx,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayColumns(Uint16 &value, const unsigned long pos = 0) const; + + /** get OverlayDescription (60xx,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayDescription(OFString &value, const signed long pos = 0) const; + + /** get OverlayLabel (60xx,1500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayLabel(OFString &value, const signed long pos = 0) const; + + /** get OverlayOrigin (60xx,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayOrigin(Sint16 &value, const unsigned long pos = 0) const; + + /** get OverlayRows (60xx,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayRows(Uint16 &value, const unsigned long pos = 0) const; + + /** get OverlaySubtype (60xx,0045) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlaySubtype(OFString &value, const signed long pos = 0) const; + + /** get OverlayType (60xx,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOverlayType(OFString &value, const signed long pos = 0) const; + + /** get PatientAge (0010,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, const signed long pos = 0) const; + + /** get PatientAlternativeCalendar (0010,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDate (0010,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthTime (0010,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthTime(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientBreedDescription (0010,2292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBreedDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientComments (0010,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientComments(OFString &value, const signed long pos = 0) const; + + /** get PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientIdentityRemoved (0012,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientIdentityRemoved(OFString &value, const signed long pos = 0) const; + + /** get PatientName (0010,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, const signed long pos = 0) const; + + /** get PatientOrientation (0020,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientOrientation(OFString &value, const signed long pos = 0) const; + + /** get PatientSex (0010,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, const signed long pos = 0) const; + + /** get PatientSexNeutered (0010,2203) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSexNeutered(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSpeciesDescription (0010,2201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSpeciesDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientState (0038,0500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientState(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get PerformedProcedureStepDescription (0040,0254) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndDate (0040,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndTime (0040,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndTime(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepID (0040,0253) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartDate (0040,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartTime (0040,0245) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartTime(OFString &value, const signed long pos = 0) const; + + /** get PhotometricInterpretation (0028,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhotometricInterpretation(OFString &value, const signed long pos = 0) const; + + /** get PhysiciansOfRecord (0008,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhysiciansOfRecord(OFString &value, const signed long pos = 0) const; + + /** get PixelAspectRatio (0028,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelAspectRatio(OFString &value, const signed long pos = 0) const; + + /** get PixelAspectRatio (0028,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelAspectRatio(Sint32 &value, const unsigned long pos = 0) const; + + /** get PixelDataProviderURL (0028,7fe0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelDataProviderURL(OFString &value, const signed long pos = 0) const; + + /** get PixelPaddingRangeLimit (0028,0121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingRangeLimit(Uint16 &value, const unsigned long pos = 0) const; + + /** get PixelPaddingValue (0028,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PixelRepresentation (0028,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelRepresentation(Uint16 &value, const unsigned long pos = 0) const; + + /** get PixelSpacing (0028,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelSpacing(OFString &value, const signed long pos = 0) const; + + /** get PixelSpacing (0028,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelSpacing(Float64 &value, const unsigned long pos = 0) const; + + /** get PixelSpacing (0028,0030) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelSpacing(OFVector &value) const; + + /** get PlanarConfiguration (0028,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPlanarConfiguration(Uint16 &value, const unsigned long pos = 0) const; + + /** get PositionReferenceIndicator (0020,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPositionReferenceIndicator(OFString &value, const signed long pos = 0) const; + + /** get PregnancyStatus (0010,21c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPregnancyStatus(Uint16 &value, const unsigned long pos = 0) const; + + /** get PresentationLUTShape (2050,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPresentationLUTShape(OFString &value, const signed long pos = 0) const; + + /** get QualityControlImage (0028,0300) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlImage(OFString &value, const signed long pos = 0) const; + + /** get QualityControlSubject (0010,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlSubject(OFString &value, const signed long pos = 0) const; + + /** get QueryRetrieveView (0008,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQueryRetrieveView(OFString &value, const signed long pos = 0) const; + + /** get ROIArea (60xx,1301) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getROIArea(OFString &value, const signed long pos = 0) const; + + /** get ROIArea (60xx,1301) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getROIArea(Sint32 &value, const unsigned long pos = 0) const; + + /** get ROIMean (60xx,1302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getROIMean(OFString &value, const signed long pos = 0) const; + + /** get ROIMean (60xx,1302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getROIMean(Float64 &value, const unsigned long pos = 0) const; + + /** get ROIStandardDeviation (60xx,1303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getROIStandardDeviation(OFString &value, const signed long pos = 0) const; + + /** get ROIStandardDeviation (60xx,1303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getROIStandardDeviation(Float64 &value, const unsigned long pos = 0) const; + + /** get RecognizableVisualFeatures (0028,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRecognizableVisualFeatures(OFString &value, const signed long pos = 0) const; + + /** get RedPaletteColorLookupTableData (0028,1201) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRedPaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get RedPaletteColorLookupTableDescriptor (0028,1101) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRedPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get ReferringPhysicianName (0008,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get RelatedGeneralSOPClassUID (0008,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRelatedGeneralSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get RescaleIntercept (0028,1052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleIntercept(OFString &value, const signed long pos = 0) const; + + /** get RescaleIntercept (0028,1052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleIntercept(Float64 &value, const unsigned long pos = 0) const; + + /** get RescaleSlope (0028,1053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleSlope(OFString &value, const signed long pos = 0) const; + + /** get RescaleSlope (0028,1053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleSlope(Float64 &value, const unsigned long pos = 0) const; + + /** get RescaleType (0028,1054) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleType(OFString &value, const signed long pos = 0) const; + + /** get ResponsibleOrganization (0010,2299) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePerson (0010,2297) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePerson(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePersonRole (0010,2298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePersonRole(OFString &value, const signed long pos = 0) const; + + /** get Rows (0028,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRows(Uint16 &value, const unsigned long pos = 0) const; + + /** get SOPAuthorizationComment (0100,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationComment(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationDateTime (0100,0420) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationDateTime(OFString &value, const signed long pos = 0) const; + + /** get SOPClassUID (0008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceStatus (0100,0410) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceStatus(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceUID (0008,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SamplesPerPixel (0028,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSamplesPerPixel(Uint16 &value, const unsigned long pos = 0) const; + + /** get SeriesDate (0008,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, const signed long pos = 0) const; + + /** get SeriesDescription (0008,103e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SeriesTime (0008,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeDescription (0038,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeDescription(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeID (0038,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeID(OFString &value, const signed long pos = 0) const; + + /** get SliceLocation (0020,1041) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSliceLocation(OFString &value, const signed long pos = 0) const; + + /** get SliceLocation (0020,1041) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSliceLocation(Float64 &value, const unsigned long pos = 0) const; + + /** get SliceThickness (0018,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSliceThickness(OFString &value, const signed long pos = 0) const; + + /** get SliceThickness (0018,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSliceThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get SmallestImagePixelValue (0028,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmallestImagePixelValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get SmokingStatus (0010,21a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmokingStatus(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get SpatialTransformOfDose (3004,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialTransformOfDose(OFString &value, const signed long pos = 0) const; + + /** get SpecificCharacterSet (0008,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, const signed long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get StereoPairsPresent (0022,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStereoPairsPresent(OFString &value, const signed long pos = 0) const; + + /** get StrainAdditionalInformation (0010,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainAdditionalInformation(OFString &value, const signed long pos = 0) const; + + /** get StrainDescription (0010,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainDescription(OFString &value, const signed long pos = 0) const; + + /** get StrainNomenclature (0010,0213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainNomenclature(OFString &value, const signed long pos = 0) const; + + /** get StructureSetDate (3006,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetDate(OFString &value, const signed long pos = 0) const; + + /** get StructureSetDescription (3006,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetDescription(OFString &value, const signed long pos = 0) const; + + /** get StructureSetLabel (3006,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetLabel(OFString &value, const signed long pos = 0) const; + + /** get StructureSetName (3006,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetName(OFString &value, const signed long pos = 0) const; + + /** get StructureSetTime (3006,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetTime(OFString &value, const signed long pos = 0) const; + + /** get StudyDate (0008,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, const signed long pos = 0) const; + + /** get StudyDescription (0008,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, const signed long pos = 0) const; + + /** get StudyID (0020,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyTime (0008,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, const signed long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get TimezoneOffsetFromUTC (0008,0201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, const signed long pos = 0) const; + + /** get TissueHeterogeneityCorrection (3004,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTissueHeterogeneityCorrection(OFString &value, const signed long pos = 0) const; + + // --- get pixel data element --- + + /** get PixelData (7fe0,0010) + * @return reference to pixel data element + */ + DcmPixelData &getPixelData() + { return PixelData; } + + /** get PixelData (7fe0,0010) + * @return const reference to pixel data element + */ + const DcmPixelData &getPixelData() const + { return PixelData; } + + // --- get DICOM sequence attributes --- + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return reference to sequence element + */ + DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() + { return AdmittingDiagnosesCodeSequence; } + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return const reference to sequence element + */ + const DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() const + { return AdmittingDiagnosesCodeSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return reference to sequence element + */ + DRTBreedRegistrationSequence &getBreedRegistrationSequence() + { return BreedRegistrationSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return const reference to sequence element + */ + const DRTBreedRegistrationSequence &getBreedRegistrationSequence() const + { return BreedRegistrationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return reference to sequence element + */ + DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() + { return CodingSchemeIdentificationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return const reference to sequence element + */ + const DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() const + { return CodingSchemeIdentificationSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return reference to sequence element + */ + DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return const reference to sequence element + */ + const DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() const + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return reference to sequence element + */ + DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() + { return ConsultingPhysicianIdentificationSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return const reference to sequence element + */ + const DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() const + { return ConsultingPhysicianIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return reference to sequence element + */ + DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() + { return ContextGroupIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return const reference to sequence element + */ + const DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() const + { return ContextGroupIdentificationSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return reference to sequence element + */ + DRTContributingEquipmentSequence &getContributingEquipmentSequence() + { return ContributingEquipmentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return const reference to sequence element + */ + const DRTContributingEquipmentSequence &getContributingEquipmentSequence() const + { return ContributingEquipmentSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return reference to sequence element + */ + DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() + { return ConversionSourceAttributesSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return const reference to sequence element + */ + const DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() const + { return ConversionSourceAttributesSequence; } + + /** get DVHSequence (3004,0050) + * @return reference to sequence element + */ + DRTDVHSequence &getDVHSequence() + { return DVHSequence; } + + /** get DVHSequence (3004,0050) + * @return const reference to sequence element + */ + const DRTDVHSequence &getDVHSequence() const + { return DVHSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return reference to sequence element + */ + DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() + { return DeidentificationMethodCodeSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return const reference to sequence element + */ + const DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() const + { return DeidentificationMethodCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return reference to sequence element + */ + DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() + { return DigitalSignaturesSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return const reference to sequence element + */ + const DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() const + { return DigitalSignaturesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return reference to sequence element + */ + DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() + { return EncryptedAttributesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return const reference to sequence element + */ + const DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() const + { return EncryptedAttributesSequence; } + + /** get FrameExtractionSequence (0008,1164) + * @return reference to sequence element + */ + DRTFrameExtractionSequence &getFrameExtractionSequence() + { return FrameExtractionSequence; } + + /** get FrameExtractionSequence (0008,1164) + * @return const reference to sequence element + */ + const DRTFrameExtractionSequence &getFrameExtractionSequence() const + { return FrameExtractionSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return reference to sequence element + */ + DRTGeneticModificationsSequence &getGeneticModificationsSequence() + { return GeneticModificationsSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return const reference to sequence element + */ + const DRTGeneticModificationsSequence &getGeneticModificationsSequence() const + { return GeneticModificationsSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return reference to sequence element + */ + DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() + { return GroupOfPatientsIdentificationSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return const reference to sequence element + */ + const DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() const + { return GroupOfPatientsIdentificationSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return reference to sequence element + */ + DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() + { return HL7StructuredDocumentReferenceSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return const reference to sequence element + */ + const DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() const + { return HL7StructuredDocumentReferenceSequence; } + + /** get IconImageSequence (0088,0200) + * @return reference to sequence element + */ + DRTIconImageSequence &getIconImageSequence() + { return IconImageSequence; } + + /** get IconImageSequence (0088,0200) + * @return const reference to sequence element + */ + const DRTIconImageSequence &getIconImageSequence() const + { return IconImageSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return reference to sequence element + */ + DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return const reference to sequence element + */ + const DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() const + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return reference to sequence element + */ + DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() + { return IssuerOfServiceEpisodeIDSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return const reference to sequence element + */ + const DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() const + { return IssuerOfServiceEpisodeIDSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return reference to sequence element + */ + DRTMACParametersSequence &getMACParametersSequence() + { return MACParametersSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return const reference to sequence element + */ + const DRTMACParametersSequence &getMACParametersSequence() const + { return MACParametersSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return reference to sequence element + */ + DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() + { return MappingResourceIdentificationSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return const reference to sequence element + */ + const DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() const + { return MappingResourceIdentificationSequence; } + + /** get ModalityLUTSequence (0028,3000) + * @return reference to sequence element + */ + DRTModalityLUTSequence &getModalityLUTSequence() + { return ModalityLUTSequence; } + + /** get ModalityLUTSequence (0028,3000) + * @return const reference to sequence element + */ + const DRTModalityLUTSequence &getModalityLUTSequence() const + { return ModalityLUTSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return reference to sequence element + */ + DRTOriginalAttributesSequence &getOriginalAttributesSequence() + { return OriginalAttributesSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return const reference to sequence element + */ + const DRTOriginalAttributesSequence &getOriginalAttributesSequence() const + { return OriginalAttributesSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return reference to sequence element + */ + DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() + { return OtherPatientIDsSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return const reference to sequence element + */ + const DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() const + { return OtherPatientIDsSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return reference to sequence element + */ + DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() + { return PatientBreedCodeSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return const reference to sequence element + */ + const DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() const + { return PatientBreedCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return reference to sequence element + */ + DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() + { return PatientSizeCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return const reference to sequence element + */ + const DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() const + { return PatientSizeCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return reference to sequence element + */ + DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() + { return PatientSpeciesCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return const reference to sequence element + */ + const DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() const + { return PatientSpeciesCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return reference to sequence element + */ + DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() + { return PerformedProtocolCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return const reference to sequence element + */ + const DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() const + { return PerformedProtocolCodeSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return reference to sequence element + */ + DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return const reference to sequence element + */ + const DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() const + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return reference to sequence element + */ + DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return const reference to sequence element + */ + const DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() const + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PredecessorStructureSetSequence (3006,0018) + * @return reference to sequence element + */ + DRTPredecessorStructureSetSequence &getPredecessorStructureSetSequence() + { return PredecessorStructureSetSequence; } + + /** get PredecessorStructureSetSequence (3006,0018) + * @return const reference to sequence element + */ + const DRTPredecessorStructureSetSequence &getPredecessorStructureSetSequence() const + { return PredecessorStructureSetSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return reference to sequence element + */ + DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() + { return PrivateDataElementCharacteristicsSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return const reference to sequence element + */ + const DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() const + { return PrivateDataElementCharacteristicsSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return reference to sequence element + */ + DRTProcedureCodeSequence &getProcedureCodeSequence() + { return ProcedureCodeSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return const reference to sequence element + */ + const DRTProcedureCodeSequence &getProcedureCodeSequence() const + { return ProcedureCodeSequence; } + + /** get ROIContourSequence (3006,0039) + * @return reference to sequence element + */ + DRTROIContourSequence &getROIContourSequence() + { return ROIContourSequence; } + + /** get ROIContourSequence (3006,0039) + * @return const reference to sequence element + */ + const DRTROIContourSequence &getROIContourSequence() const + { return ROIContourSequence; } + + /** get RTDoseROISequence (3004,0010) + * @return reference to sequence element + */ + DRTRTDoseROISequence &getRTDoseROISequence() + { return RTDoseROISequence; } + + /** get RTDoseROISequence (3004,0010) + * @return const reference to sequence element + */ + const DRTRTDoseROISequence &getRTDoseROISequence() const + { return RTDoseROISequence; } + + /** get RealWorldValueMappingSequence (0040,9096) + * @return reference to sequence element + */ + DRTRealWorldValueMappingSequence &getRealWorldValueMappingSequence() + { return RealWorldValueMappingSequence; } + + /** get RealWorldValueMappingSequence (0040,9096) + * @return const reference to sequence element + */ + const DRTRealWorldValueMappingSequence &getRealWorldValueMappingSequence() const + { return RealWorldValueMappingSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return reference to sequence element + */ + DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return const reference to sequence element + */ + const DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() const + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReferencedFrameOfReferenceSequence (3006,0010) + * @return reference to sequence element + */ + DRTReferencedFrameOfReferenceSequence &getReferencedFrameOfReferenceSequence() + { return ReferencedFrameOfReferenceSequence; } + + /** get ReferencedFrameOfReferenceSequence (3006,0010) + * @return const reference to sequence element + */ + const DRTReferencedFrameOfReferenceSequence &getReferencedFrameOfReferenceSequence() const + { return ReferencedFrameOfReferenceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return reference to sequence element + */ + DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return const reference to sequence element + */ + const DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() const + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return reference to sequence element + */ + DRTReferencedPatientSequence &getReferencedPatientSequence() + { return ReferencedPatientSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return const reference to sequence element + */ + const DRTReferencedPatientSequence &getReferencedPatientSequence() const + { return ReferencedPatientSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return reference to sequence element + */ + DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return const reference to sequence element + */ + const DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() const + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return reference to sequence element + */ + DRTReferencedRTPlanSequence &getReferencedRTPlanSequence() + { return ReferencedRTPlanSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return const reference to sequence element + */ + const DRTReferencedRTPlanSequence &getReferencedRTPlanSequence() const + { return ReferencedRTPlanSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + /** get ReferencedSpatialRegistrationSequence (0070,0404) + * @return reference to sequence element + */ + DRTReferencedSpatialRegistrationSequence &getReferencedSpatialRegistrationSequence() + { return ReferencedSpatialRegistrationSequence; } + + /** get ReferencedSpatialRegistrationSequence (0070,0404) + * @return const reference to sequence element + */ + const DRTReferencedSpatialRegistrationSequence &getReferencedSpatialRegistrationSequence() const + { return ReferencedSpatialRegistrationSequence; } + + /** get ReferencedStructureSetSequence (300c,0060) + * @return reference to sequence element + */ + DRTReferencedStructureSetSequence &getReferencedStructureSetSequence() + { return ReferencedStructureSetSequence; } + + /** get ReferencedStructureSetSequence (300c,0060) + * @return const reference to sequence element + */ + const DRTReferencedStructureSetSequence &getReferencedStructureSetSequence() const + { return ReferencedStructureSetSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get ReferencedTreatmentRecordSequence (3008,0030) + * @return reference to sequence element + */ + DRTReferencedTreatmentRecordSequenceInRTDoseModule &getReferencedTreatmentRecordSequence() + { return ReferencedTreatmentRecordSequence; } + + /** get ReferencedTreatmentRecordSequence (3008,0030) + * @return const reference to sequence element + */ + const DRTReferencedTreatmentRecordSequenceInRTDoseModule &getReferencedTreatmentRecordSequence() const + { return ReferencedTreatmentRecordSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return reference to sequence element + */ + DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() + { return ReferringPhysicianIdentificationSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return const reference to sequence element + */ + const DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() const + { return ReferringPhysicianIdentificationSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return reference to sequence element + */ + DRTRequestAttributesSequence &getRequestAttributesSequence() + { return RequestAttributesSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return const reference to sequence element + */ + const DRTRequestAttributesSequence &getRequestAttributesSequence() const + { return RequestAttributesSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return reference to sequence element + */ + DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() + { return RequestingServiceCodeSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return const reference to sequence element + */ + const DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() const + { return RequestingServiceCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return reference to sequence element + */ + DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() + { return SeriesDescriptionCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return const reference to sequence element + */ + const DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() const + { return SeriesDescriptionCodeSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return reference to sequence element + */ + DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() + { return SourcePatientGroupIdentificationSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return const reference to sequence element + */ + const DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() const + { return SourcePatientGroupIdentificationSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return reference to sequence element + */ + DRTStrainCodeSequence &getStrainCodeSequence() + { return StrainCodeSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return const reference to sequence element + */ + const DRTStrainCodeSequence &getStrainCodeSequence() const + { return StrainCodeSequence; } + + /** get StrainStockSequence (0010,0216) + * @return reference to sequence element + */ + DRTStrainStockSequence &getStrainStockSequence() + { return StrainStockSequence; } + + /** get StrainStockSequence (0010,0216) + * @return const reference to sequence element + */ + const DRTStrainStockSequence &getStrainStockSequence() const + { return StrainStockSequence; } + + /** get StructureSetROISequence (3006,0020) + * @return reference to sequence element + */ + DRTStructureSetROISequence &getStructureSetROISequence() + { return StructureSetROISequence; } + + /** get StructureSetROISequence (3006,0020) + * @return const reference to sequence element + */ + const DRTStructureSetROISequence &getStructureSetROISequence() const + { return StructureSetROISequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return reference to sequence element + */ + DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return const reference to sequence element + */ + const DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() const + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get UDISequence (0018,100a) + * @return reference to sequence element + */ + DRTUDISequence &getUDISequence() + { return UDISequence; } + + /** get UDISequence (0018,100a) + * @return const reference to sequence element + */ + const DRTUDISequence &getUDISequence() const + { return UDISequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionDate (0008,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDate(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionDateTime (0008,002a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionNumber (0020,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionTime (0008,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionTime(const OFString &value, const OFBool check = OFTrue); + + /** set AdditionalPatientHistory (0010,21b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdditionalPatientHistory(const OFString &value, const OFBool check = OFTrue); + + /** set AdmissionID (0038,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmissionID(const OFString &value, const OFBool check = OFTrue); + + /** set AdmittingDiagnosesDescription (0008,1080) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set Allergies (0010,2110) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAllergies(const OFString &value, const OFBool check = OFTrue); + + /** set AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BitsAllocated (0028,0100) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsAllocated(const Uint16 value, const unsigned long pos = 0); + + /** set BitsStored (0028,0101) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsStored(const Uint16 value, const unsigned long pos = 0); + + /** set BluePaletteColorLookupTableData (0028,1203) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBluePaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set BluePaletteColorLookupTableDescriptor (0028,1103) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBluePaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set BurnedInAnnotation (0028,0301) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBurnedInAnnotation(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolName (0012,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesDescription (0012,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesID (0012,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteID (0012,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteName (0012,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSponsorName (0012,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSponsorName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectID (0012,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectReadingID (0012,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointDescription (0012,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointID (0012,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointID(const OFString &value, const OFBool check = OFTrue); + + /** set ColorSpace (0028,2002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setColorSpace(const OFString &value, const OFBool check = OFTrue); + + /** set Columns (0028,0011) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setColumns(const Uint16 value, const unsigned long pos = 0); + + /** set CommentsOnThePerformedProcedureStep (0040,0280) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check = OFTrue); + + /** set ConsultingPhysicianName (0008,009c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConsultingPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set ContentDate (0008,0023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentDate(const OFString &value, const OFBool check = OFTrue); + + /** set ContentQualification (0018,9004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, const OFBool check = OFTrue); + + /** set ContentTime (0008,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentTime(const OFString &value, const OFBool check = OFTrue); + + /** set DVHNormalizationDoseValue (3004,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDVHNormalizationDoseValue(const OFString &value, const OFBool check = OFTrue); + + /** set DVHNormalizationPoint (3004,0040) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDVHNormalizationPoint(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeidentificationMethod (0012,0063) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeidentificationMethod(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set DoseComment (3004,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoseComment(const OFString &value, const OFBool check = OFTrue); + + /** set DoseGridScaling (3004,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoseGridScaling(const OFString &value, const OFBool check = OFTrue); + + /** set DoseSummationType (3004,000a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoseSummationType(const OFString &value, const OFBool check = OFTrue); + + /** set DoseType (3004,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoseType(const OFString &value, const OFBool check = OFTrue); + + /** set DoseUnits (3004,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDoseUnits(const OFString &value, const OFBool check = OFTrue); + + /** set EthnicGroup (0010,2160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEthnicGroup(const OFString &value, const OFBool check = OFTrue); + + /** set FrameIncrementPointer (0028,0009) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (AT) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameIncrementPointer(const OFString &value, const OFBool check = OFTrue); + + /** set FrameOfReferenceUID (0020,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceUID(const OFString &value, const OFBool check = OFTrue); + + /** set GantryID (0018,1008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryID(const OFString &value, const OFBool check = OFTrue); + + /** set GreenPaletteColorLookupTableData (0028,1202) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGreenPaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set GreenPaletteColorLookupTableDescriptor (0028,1102) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGreenPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set GridFrameOffsetVector (3004,000c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGridFrameOffsetVector(const OFString &value, const OFBool check = OFTrue); + + /** set HighBit (0028,0102) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setHighBit(const Uint16 value, const unsigned long pos = 0); + + /** set ICCProfile (0028,2000) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setICCProfile(const Uint8 *value, const unsigned long count); + + /** set ImageComments (0020,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageComments(const OFString &value, const OFBool check = OFTrue); + + /** set ImageFrameOrigin (60xx,0051) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageFrameOrigin(const Uint16 value, const unsigned long pos = 0); + + /** set ImageOrientationPatient (0020,0037) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (6) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageOrientationPatient(const OFString &value, const OFBool check = OFTrue); + + /** set ImagePositionPatient (0020,0032) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImagePositionPatient(const OFString &value, const OFBool check = OFTrue); + + /** set ImageType (0008,0008) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (2-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageType(const OFString &value, const OFBool check = OFTrue); + + /** set ImagesInAcquisition (0020,1002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImagesInAcquisition(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCoercionDateTime (0008,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCoercionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationDate (0008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationTime (0008,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreatorUID (0008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceNumber (0020,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set IrradiationEventUID (0008,3010) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIrradiationEventUID(const OFString &value, const OFBool check = OFTrue); + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set LargestImagePixelValue (0028,0107) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLargestImagePixelValue(const Uint16 value, const unsigned long pos = 0); + + /** set LastMenstrualDate (0010,21d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLastMenstrualDate(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalEventType (0012,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalEventType(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalInformationModified (0028,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos = 0); + + /** set LossyImageCompression (0028,2110) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompression(const OFString &value, const OFBool check = OFTrue); + + /** set LossyImageCompressionMethod (0028,2114) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionMethod(const OFString &value, const OFBool check = OFTrue); + + /** set LossyImageCompressionRatio (0028,2112) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionRatio(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredAPDimension (0010,1023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredAPDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredLateralDimension (0010,1024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredLateralDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MedicalAlerts (0010,2000) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMedicalAlerts(const OFString &value, const OFBool check = OFTrue); + + /** set Modality (0008,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, const OFBool check = OFTrue); + + /** set NameOfPhysiciansReadingStudy (0008,1060) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check = OFTrue); + + /** set NormalizationPoint (3004,0008) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNormalizationPoint(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFrames (0028,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNumberOfFrames(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFramesInOverlay (60xx,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNumberOfFramesInOverlay(const OFString &value, const OFBool check = OFTrue); + + /** set Occupation (0010,2180) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOccupation(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OriginalSpecializedSOPClassUID (0008,001b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set OtherPatientNames (0010,1001) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOtherPatientNames(const OFString &value, const OFBool check = OFTrue); + + /** set OverlayBitPosition (60xx,0102) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayBitPosition(const Uint16 value, const unsigned long pos = 0); + + /** set OverlayBitsAllocated (60xx,0100) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayBitsAllocated(const Uint16 value, const unsigned long pos = 0); + + /** set OverlayColumns (60xx,0011) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayColumns(const Uint16 value, const unsigned long pos = 0); + + /** set OverlayDescription (60xx,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayDescription(const OFString &value, const OFBool check = OFTrue); + + /** set OverlayLabel (60xx,1500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayLabel(const OFString &value, const OFBool check = OFTrue); + + /** set OverlayOrigin (60xx,0050) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayOrigin(const Sint16 value, const unsigned long pos = 0); + + /** set OverlayRows (60xx,0010) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayRows(const Uint16 value, const unsigned long pos = 0); + + /** set OverlaySubtype (60xx,0045) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlaySubtype(const OFString &value, const OFBool check = OFTrue); + + /** set OverlayType (60xx,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOverlayType(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAge (0010,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAlternativeCalendar (0010,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDate (0010,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthTime (0010,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthTime(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBodyMassIndex (0010,1022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBodyMassIndex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBreedDescription (0010,2292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBreedDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientComments (0010,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientComments(const OFString &value, const OFBool check = OFTrue); + + /** set PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientIdentityRemoved (0012,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientIdentityRemoved(const OFString &value, const OFBool check = OFTrue); + + /** set PatientName (0010,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, const OFBool check = OFTrue); + + /** set PatientOrientation (0020,0020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSex (0010,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSexNeutered (0010,2203) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSexNeutered(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSize (0010,1020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSpeciesDescription (0010,2201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSpeciesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientState (0038,0500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientState(const OFString &value, const OFBool check = OFTrue); + + /** set PatientWeight (0010,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepDescription (0040,0254) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndDate (0040,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndTime (0040,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndTime(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepID (0040,0253) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartDate (0040,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartTime (0040,0245) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set PhotometricInterpretation (0028,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhotometricInterpretation(const OFString &value, const OFBool check = OFTrue); + + /** set PhysiciansOfRecord (0008,1048) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhysiciansOfRecord(const OFString &value, const OFBool check = OFTrue); + + /** set PixelAspectRatio (0028,0034) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelAspectRatio(const OFString &value, const OFBool check = OFTrue); + + /** set PixelDataProviderURL (0028,7fe0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelDataProviderURL(const OFString &value, const OFBool check = OFTrue); + + /** set PixelPaddingRangeLimit (0028,0121) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingRangeLimit(const Uint16 value, const unsigned long pos = 0); + + /** set PixelPaddingValue (0028,0120) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingValue(const Uint16 value, const unsigned long pos = 0); + + /** set PixelRepresentation (0028,0103) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelRepresentation(const Uint16 value, const unsigned long pos = 0); + + /** set PixelSpacing (0028,0030) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelSpacing(const OFString &value, const OFBool check = OFTrue); + + /** set PlanarConfiguration (0028,0006) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPlanarConfiguration(const Uint16 value, const unsigned long pos = 0); + + /** set PositionReferenceIndicator (0020,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPositionReferenceIndicator(const OFString &value, const OFBool check = OFTrue); + + /** set PregnancyStatus (0010,21c0) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPregnancyStatus(const Uint16 value, const unsigned long pos = 0); + + /** set PresentationLUTShape (2050,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPresentationLUTShape(const OFString &value, const OFBool check = OFTrue); + + /** set QualityControlImage (0028,0300) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlImage(const OFString &value, const OFBool check = OFTrue); + + /** set QualityControlSubject (0010,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlSubject(const OFString &value, const OFBool check = OFTrue); + + /** set QueryRetrieveView (0008,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQueryRetrieveView(const OFString &value, const OFBool check = OFTrue); + + /** set ROIArea (60xx,1301) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setROIArea(const OFString &value, const OFBool check = OFTrue); + + /** set ROIMean (60xx,1302) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setROIMean(const OFString &value, const OFBool check = OFTrue); + + /** set ROIStandardDeviation (60xx,1303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setROIStandardDeviation(const OFString &value, const OFBool check = OFTrue); + + /** set RecognizableVisualFeatures (0028,0302) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecognizableVisualFeatures(const OFString &value, const OFBool check = OFTrue); + + /** set RedPaletteColorLookupTableData (0028,1201) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRedPaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set RedPaletteColorLookupTableDescriptor (0028,1101) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRedPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set ReferringPhysicianName (0008,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set RelatedGeneralSOPClassUID (0008,001a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set RescaleIntercept (0028,1052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleIntercept(const OFString &value, const OFBool check = OFTrue); + + /** set RescaleSlope (0028,1053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleSlope(const OFString &value, const OFBool check = OFTrue); + + /** set RescaleType (0028,1054) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleType(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsibleOrganization (0010,2299) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePerson (0010,2297) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePerson(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePersonRole (0010,2298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePersonRole(const OFString &value, const OFBool check = OFTrue); + + /** set Rows (0028,0010) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRows(const Uint16 value, const unsigned long pos = 0); + + /** set SOPAuthorizationComment (0100,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationComment(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationDateTime (0100,0420) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set SOPClassUID (0008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceStatus (0100,0410) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceUID (0008,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SamplesPerPixel (0028,0002) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSamplesPerPixel(const Uint16 value, const unsigned long pos = 0); + + /** set SeriesDate (0008,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDescription (0008,103e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesNumber (0020,0011) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesTime (0008,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeDescription (0038,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeID (0038,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeID(const OFString &value, const OFBool check = OFTrue); + + /** set SliceLocation (0020,1041) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSliceLocation(const OFString &value, const OFBool check = OFTrue); + + /** set SliceThickness (0018,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSliceThickness(const OFString &value, const OFBool check = OFTrue); + + /** set SmallestImagePixelValue (0028,0106) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmallestImagePixelValue(const Uint16 value, const unsigned long pos = 0); + + /** set SmokingStatus (0010,21a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmokingStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialTransformOfDose (3004,0005) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialTransformOfDose(const OFString &value, const OFBool check = OFTrue); + + /** set SpecificCharacterSet (0008,0005) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set StereoPairsPresent (0022,0028) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStereoPairsPresent(const OFString &value, const OFBool check = OFTrue); + + /** set StrainAdditionalInformation (0010,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainAdditionalInformation(const OFString &value, const OFBool check = OFTrue); + + /** set StrainDescription (0010,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StrainNomenclature (0010,0213) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainNomenclature(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetDate (3006,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetDate(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetDescription (3006,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetLabel (3006,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetLabel(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetName (3006,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetName(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetTime (3006,0009) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetTime(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDate (0008,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDescription (0008,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StudyID (0020,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyTime (0008,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set TimezoneOffsetFromUTC (0008,0201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, const OFBool check = OFTrue); + + /** set TissueHeterogeneityCorrection (3004,0014) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTissueHeterogeneityCorrection(const OFString &value, const OFBool check = OFTrue); + + // --- all other attributes (without get/set methods) --- + + // - OverlayData (60xx,3000) + + + protected: + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attribute + * SOPClassUID (0008,0016) with the expected value. Any incorrectness regarding + * this attribute is reported to the log stream (if enabled for error messages). + * @param dataset DICOM dataset to be checked + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset); + + /** update various DICOM attributes + */ + void updateAttributes(); + + private: + + // DICOM attributes are listed ordered by module + + // --- PatientModule (M) --- + + /// PatientName (0010,0010) vr=PN, vm=1, type=2 + DcmPersonName PatientName; + /// PatientID (0010,0020) vr=LO, vm=1, type=2 + DcmLongString PatientID; + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientBirthDate (0010,0030) vr=DA, vm=1, type=2 + DcmDate PatientBirthDate; + /// PatientBirthDateInAlternativeCalendar (0010,0033) vr=LO, vm=1, type=3 + DcmLongString PatientBirthDateInAlternativeCalendar; + /// PatientDeathDateInAlternativeCalendar (0010,0034) vr=LO, vm=1, type=3 + DcmLongString PatientDeathDateInAlternativeCalendar; + /// PatientAlternativeCalendar (0010,0035) vr=CS, vm=1, type=1C + DcmCodeString PatientAlternativeCalendar; + /// PatientSex (0010,0040) vr=CS, vm=1, type=2 + DcmCodeString PatientSex; + /// ReferencedPatientPhotoSequence (0010,1100) vr=SQ, vm=1, type=3 + DRTReferencedPatientPhotoSequence ReferencedPatientPhotoSequence; + /// QualityControlSubject (0010,0200) vr=CS, vm=1, type=3 + DcmCodeString QualityControlSubject; + /// ReferencedPatientSequence (0008,1120) vr=SQ, vm=1, type=3 + DRTReferencedPatientSequence ReferencedPatientSequence; + /// PatientBirthTime (0010,0032) vr=TM, vm=1, type=3 + DcmTime PatientBirthTime; + /// OtherPatientIDsSequence (0010,1002) vr=SQ, vm=1, type=3 + DRTOtherPatientIDsSequence OtherPatientIDsSequence; + /// OtherPatientNames (0010,1001) vr=PN, vm=1-n, type=3 + DcmPersonName OtherPatientNames; + /// EthnicGroup (0010,2160) vr=SH, vm=1, type=3 + DcmShortString EthnicGroup; + /// PatientComments (0010,4000) vr=LT, vm=1, type=3 + DcmLongText PatientComments; + /// PatientSpeciesDescription (0010,2201) vr=LO, vm=1, type=1C + DcmLongString PatientSpeciesDescription; + /// PatientSpeciesCodeSequence (0010,2202) vr=SQ, vm=1, type=1C + DRTPatientSpeciesCodeSequence PatientSpeciesCodeSequence; + /// PatientBreedDescription (0010,2292) vr=LO, vm=1, type=2C + DcmLongString PatientBreedDescription; + /// PatientBreedCodeSequence (0010,2293) vr=SQ, vm=1, type=2C + DRTPatientBreedCodeSequence PatientBreedCodeSequence; + /// BreedRegistrationSequence (0010,2294) vr=SQ, vm=1, type=2C + DRTBreedRegistrationSequence BreedRegistrationSequence; + /// StrainDescription (0010,0212) vr=UC, vm=1, type=3 + DcmUnlimitedCharacters StrainDescription; + /// StrainNomenclature (0010,0213) vr=LO, vm=1, type=3 + DcmLongString StrainNomenclature; + /// StrainCodeSequence (0010,0219) vr=SQ, vm=1, type=3 + DRTStrainCodeSequence StrainCodeSequence; + /// StrainAdditionalInformation (0010,0218) vr=UT, vm=1, type=3 + DcmUnlimitedText StrainAdditionalInformation; + /// StrainStockSequence (0010,0216) vr=SQ, vm=1, type=3 + DRTStrainStockSequence StrainStockSequence; + /// GeneticModificationsSequence (0010,0221) vr=SQ, vm=1, type=3 + DRTGeneticModificationsSequence GeneticModificationsSequence; + /// ResponsiblePerson (0010,2297) vr=PN, vm=1, type=2C + DcmPersonName ResponsiblePerson; + /// ResponsiblePersonRole (0010,2298) vr=CS, vm=1, type=1C + DcmCodeString ResponsiblePersonRole; + /// ResponsibleOrganization (0010,2299) vr=LO, vm=1, type=2C + DcmLongString ResponsibleOrganization; + /// PatientIdentityRemoved (0012,0062) vr=CS, vm=1, type=3 + DcmCodeString PatientIdentityRemoved; + /// DeidentificationMethod (0012,0063) vr=LO, vm=1-n, type=1C + DcmLongString DeidentificationMethod; + /// DeidentificationMethodCodeSequence (0012,0064) vr=SQ, vm=1, type=1C + DRTDeidentificationMethodCodeSequence DeidentificationMethodCodeSequence; + /// SourcePatientGroupIdentificationSequence (0010,0026) vr=SQ, vm=1, type=3 + DRTSourcePatientGroupIdentificationSequence SourcePatientGroupIdentificationSequence; + /// GroupOfPatientsIdentificationSequence (0010,0027) vr=SQ, vm=1, type=3 + DRTGroupOfPatientsIdentificationSequence GroupOfPatientsIdentificationSequence; + + // --- ClinicalTrialSubjectModule (U) --- + + /// ClinicalTrialSponsorName (0012,0010) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialSponsorName; + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialProtocolID; + /// ClinicalTrialProtocolName (0012,0021) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialProtocolName; + /// ClinicalTrialSiteID (0012,0030) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteID; + /// ClinicalTrialSiteName (0012,0031) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteName; + /// ClinicalTrialSubjectID (0012,0040) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectID; + /// ClinicalTrialSubjectReadingID (0012,0042) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectReadingID; + /// ClinicalTrialProtocolEthicsCommitteeName (0012,0081) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolEthicsCommitteeName; + /// ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + + // --- GeneralStudyModule (M) --- + + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + /// StudyDate (0008,0020) vr=DA, vm=1, type=2 + DcmDate StudyDate; + /// StudyTime (0008,0030) vr=TM, vm=1, type=2 + DcmTime StudyTime; + /// ReferringPhysicianName (0008,0090) vr=PN, vm=1, type=2 + DcmPersonName ReferringPhysicianName; + /// ReferringPhysicianIdentificationSequence (0008,0096) vr=SQ, vm=1, type=3 + DRTReferringPhysicianIdentificationSequence ReferringPhysicianIdentificationSequence; + /// ConsultingPhysicianName (0008,009c) vr=PN, vm=1-n, type=3 + DcmPersonName ConsultingPhysicianName; + /// ConsultingPhysicianIdentificationSequence (0008,009d) vr=SQ, vm=1, type=3 + DRTConsultingPhysicianIdentificationSequence ConsultingPhysicianIdentificationSequence; + /// StudyID (0020,0010) vr=SH, vm=1, type=2 + DcmShortString StudyID; + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=2 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// StudyDescription (0008,1030) vr=LO, vm=1, type=3 + DcmLongString StudyDescription; + /// PhysiciansOfRecord (0008,1048) vr=PN, vm=1-n, type=3 + DcmPersonName PhysiciansOfRecord; + /// PhysiciansOfRecordIdentificationSequence (0008,1049) vr=SQ, vm=1, type=3 + DRTPhysiciansOfRecordIdentificationSequence PhysiciansOfRecordIdentificationSequence; + /// NameOfPhysiciansReadingStudy (0008,1060) vr=PN, vm=1-n, type=3 + DcmPersonName NameOfPhysiciansReadingStudy; + /// PhysiciansReadingStudyIdentificationSequence (0008,1062) vr=SQ, vm=1, type=3 + DRTPhysiciansReadingStudyIdentificationSequence PhysiciansReadingStudyIdentificationSequence; + /// RequestingServiceCodeSequence (0032,1034) vr=SQ, vm=1, type=3 + DRTRequestingServiceCodeSequence RequestingServiceCodeSequence; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// ProcedureCodeSequence (0008,1032) vr=SQ, vm=1, type=3 + DRTProcedureCodeSequence ProcedureCodeSequence; + /// ReasonForPerformedProcedureCodeSequence (0040,1012) vr=SQ, vm=1, type=3 + DRTReasonForPerformedProcedureCodeSequence ReasonForPerformedProcedureCodeSequence; + + // --- PatientStudyModule (U) --- + + /// AdmittingDiagnosesDescription (0008,1080) vr=LO, vm=1-n, type=3 + DcmLongString AdmittingDiagnosesDescription; + /// AdmittingDiagnosesCodeSequence (0008,1084) vr=SQ, vm=1, type=3 + DRTAdmittingDiagnosesCodeSequence AdmittingDiagnosesCodeSequence; + /// PatientAge (0010,1010) vr=AS, vm=1, type=3 + DcmAgeString PatientAge; + /// PatientSize (0010,1020) vr=DS, vm=1, type=3 + DcmDecimalString PatientSize; + /// PatientWeight (0010,1030) vr=DS, vm=1, type=3 + DcmDecimalString PatientWeight; + /// PatientBodyMassIndex (0010,1022) vr=DS, vm=1, type=3 + DcmDecimalString PatientBodyMassIndex; + /// MeasuredAPDimension (0010,1023) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredAPDimension; + /// MeasuredLateralDimension (0010,1024) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredLateralDimension; + /// PatientSizeCodeSequence (0010,1021) vr=SQ, vm=1, type=3 + DRTPatientSizeCodeSequence PatientSizeCodeSequence; + /// MedicalAlerts (0010,2000) vr=LO, vm=1-n, type=3 + DcmLongString MedicalAlerts; + /// Allergies (0010,2110) vr=LO, vm=1-n, type=3 + DcmLongString Allergies; + /// SmokingStatus (0010,21a0) vr=CS, vm=1, type=3 + DcmCodeString SmokingStatus; + /// PregnancyStatus (0010,21c0) vr=US, vm=1, type=3 + DcmUnsignedShort PregnancyStatus; + /// LastMenstrualDate (0010,21d0) vr=DA, vm=1, type=3 + DcmDate LastMenstrualDate; + /// PatientState (0038,0500) vr=LO, vm=1, type=3 + DcmLongString PatientState; + /// Occupation (0010,2180) vr=SH, vm=1, type=3 + DcmShortString Occupation; + /// AdditionalPatientHistory (0010,21b0) vr=LT, vm=1, type=3 + DcmLongText AdditionalPatientHistory; + /// AdmissionID (0038,0010) vr=LO, vm=1, type=3 + DcmLongString AdmissionID; + /// IssuerOfAdmissionIDSequence (0038,0014) vr=SQ, vm=1, type=3 + DRTIssuerOfAdmissionIDSequence IssuerOfAdmissionIDSequence; + /// ServiceEpisodeID (0038,0060) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeID; + /// IssuerOfServiceEpisodeIDSequence (0038,0064) vr=SQ, vm=1, type=3 + DRTIssuerOfServiceEpisodeIDSequence IssuerOfServiceEpisodeIDSequence; + /// ServiceEpisodeDescription (0038,0062) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeDescription; + /// PatientSexNeutered (0010,2203) vr=CS, vm=1, type=2C + DcmCodeString PatientSexNeutered; + + // --- ClinicalTrialStudyModule (U) --- + + /// ClinicalTrialTimePointID (0012,0050) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialTimePointID; + /// ClinicalTrialTimePointDescription (0012,0051) vr=ST, vm=1, type=3 + DcmShortText ClinicalTrialTimePointDescription; + /// LongitudinalTemporalOffsetFromEvent (0012,0052) vr=FD, vm=1, type=3 + DcmFloatingPointDouble LongitudinalTemporalOffsetFromEvent; + /// LongitudinalTemporalEventType (0012,0053) vr=CS, vm=1, type=1C + DcmCodeString LongitudinalTemporalEventType; + /// ConsentForClinicalTrialUseSequence (0012,0083) vr=SQ, vm=1, type=3 + DRTConsentForClinicalTrialUseSequence ConsentForClinicalTrialUseSequence; + + // --- RTSeriesModule (M) --- + + /// Modality (0008,0060) vr=CS, vm=1, type=1 + DcmCodeString Modality; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + /// SeriesNumber (0020,0011) vr=IS, vm=1, type=2 + DcmIntegerString SeriesNumber; + /// SeriesDate (0008,0021) vr=DA, vm=1, type=3 + DcmDate SeriesDate; + /// SeriesTime (0008,0031) vr=TM, vm=1, type=3 + DcmTime SeriesTime; + /// SeriesDescription (0008,103e) vr=LO, vm=1, type=3 + DcmLongString SeriesDescription; + /// SeriesDescriptionCodeSequence (0008,103f) vr=SQ, vm=1, type=3 + DRTSeriesDescriptionCodeSequence SeriesDescriptionCodeSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// ReferencedPerformedProcedureStepSequence (0008,1111) vr=SQ, vm=1, type=3 + DRTReferencedPerformedProcedureStepSequence ReferencedPerformedProcedureStepSequence; + /// RequestAttributesSequence (0040,0275) vr=SQ, vm=1, type=3 + DRTRequestAttributesSequence RequestAttributesSequence; + /// PerformedProcedureStepID (0040,0253) vr=SH, vm=1, type=3 + DcmShortString PerformedProcedureStepID; + /// PerformedProcedureStepStartDate (0040,0244) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepStartDate; + /// PerformedProcedureStepStartTime (0040,0245) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepStartTime; + /// PerformedProcedureStepEndDate (0040,0250) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepEndDate; + /// PerformedProcedureStepEndTime (0040,0251) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepEndTime; + /// PerformedProcedureStepDescription (0040,0254) vr=LO, vm=1, type=3 + DcmLongString PerformedProcedureStepDescription; + /// PerformedProtocolCodeSequence (0040,0260) vr=SQ, vm=1, type=3 + DRTPerformedProtocolCodeSequence PerformedProtocolCodeSequence; + /// CommentsOnThePerformedProcedureStep (0040,0280) vr=ST, vm=1, type=3 + DcmShortText CommentsOnThePerformedProcedureStep; + + // --- ClinicalTrialSeriesModule (U) --- + + /// ClinicalTrialCoordinatingCenterName (0012,0060) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialCoordinatingCenterName; + /// ClinicalTrialSeriesID (0012,0071) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesID; + /// ClinicalTrialSeriesDescription (0012,0072) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesDescription; + + // --- FrameOfReferenceModule (M) --- + + /// FrameOfReferenceUID (0020,0052) vr=UI, vm=1, type=1 + DcmUniqueIdentifier FrameOfReferenceUID; + /// PositionReferenceIndicator (0020,1040) vr=LO, vm=1, type=2 + DcmLongString PositionReferenceIndicator; + + // --- GeneralEquipmentModule (M) --- + + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// GantryID (0018,1008) vr=LO, vm=1, type=3 + DcmLongString GantryID; + /// UDISequence (0018,100a) vr=SQ, vm=1, type=3 + DRTUDISequence UDISequence; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + /// PixelPaddingValue (0028,0120) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingValue; + + // --- GeneralImageModule (C) --- + + // InstanceNumber (0020,0013) vr=IS, vm=1, type=2 + // - also defined in: RTDoseModule, StructureSetModule, SOPCommonModule + // DcmIntegerString InstanceNumber; + /// PatientOrientation (0020,0020) vr=CS, vm=2, type=2C + DcmCodeString PatientOrientation; + // ContentDate (0008,0023) vr=DA, vm=1, type=2C + // - also defined in: RTDoseModule + // DcmDate ContentDate; + // ContentTime (0008,0033) vr=TM, vm=1, type=2C + // - also defined in: RTDoseModule + // DcmTime ContentTime; + /// ImageType (0008,0008) vr=CS, vm=2-n, type=3 + DcmCodeString ImageType; + /// AcquisitionNumber (0020,0012) vr=IS, vm=1, type=3 + DcmIntegerString AcquisitionNumber; + /// AcquisitionDate (0008,0022) vr=DA, vm=1, type=3 + DcmDate AcquisitionDate; + /// AcquisitionTime (0008,0032) vr=TM, vm=1, type=3 + DcmTime AcquisitionTime; + /// AcquisitionDateTime (0008,002a) vr=DT, vm=1, type=3 + DcmDateTime AcquisitionDateTime; + /// ImagesInAcquisition (0020,1002) vr=IS, vm=1, type=3 + DcmIntegerString ImagesInAcquisition; + /// ImageComments (0020,4000) vr=LT, vm=1, type=3 + DcmLongText ImageComments; + /// QualityControlImage (0028,0300) vr=CS, vm=1, type=3 + DcmCodeString QualityControlImage; + /// BurnedInAnnotation (0028,0301) vr=CS, vm=1, type=3 + DcmCodeString BurnedInAnnotation; + /// RecognizableVisualFeatures (0028,0302) vr=CS, vm=1, type=3 + DcmCodeString RecognizableVisualFeatures; + /// LossyImageCompression (0028,2110) vr=CS, vm=1, type=3 + DcmCodeString LossyImageCompression; + /// LossyImageCompressionRatio (0028,2112) vr=DS, vm=1-n, type=3 + DcmDecimalString LossyImageCompressionRatio; + /// LossyImageCompressionMethod (0028,2114) vr=CS, vm=1-n, type=3 + DcmCodeString LossyImageCompressionMethod; + /// IconImageSequence (0088,0200) vr=SQ, vm=1, type=3 + DRTIconImageSequence IconImageSequence; + /// PresentationLUTShape (2050,0020) vr=CS, vm=1, type=3 + DcmCodeString PresentationLUTShape; + /// IrradiationEventUID (0008,3010) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier IrradiationEventUID; + /// RealWorldValueMappingSequence (0040,9096) vr=SQ, vm=1, type=3 + DRTRealWorldValueMappingSequence RealWorldValueMappingSequence; + + // --- ImagePlaneModule (C) --- + + /// PixelSpacing (0028,0030) vr=DS, vm=2, type=1 + DcmDecimalString PixelSpacing; + /// ImageOrientationPatient (0020,0037) vr=DS, vm=6, type=1 + DcmDecimalString ImageOrientationPatient; + /// ImagePositionPatient (0020,0032) vr=DS, vm=3, type=1 + DcmDecimalString ImagePositionPatient; + /// SliceThickness (0018,0050) vr=DS, vm=1, type=2 + DcmDecimalString SliceThickness; + /// SliceLocation (0020,1041) vr=DS, vm=1, type=3 + DcmDecimalString SliceLocation; + + // --- ImagePixelModule (C) --- + + // SamplesPerPixel (0028,0002) vr=US, vm=1, type=1 + // - also defined in: RTDoseModule + // DcmUnsignedShort SamplesPerPixel; + // PhotometricInterpretation (0028,0004) vr=CS, vm=1, type=1 + // - also defined in: RTDoseModule + // DcmCodeString PhotometricInterpretation; + /// Rows (0028,0010) vr=US, vm=1, type=1 + DcmUnsignedShort Rows; + /// Columns (0028,0011) vr=US, vm=1, type=1 + DcmUnsignedShort Columns; + // BitsAllocated (0028,0100) vr=US, vm=1, type=1 + // - also defined in: RTDoseModule + // DcmUnsignedShort BitsAllocated; + // BitsStored (0028,0101) vr=US, vm=1, type=1 + // - also defined in: RTDoseModule + // DcmUnsignedShort BitsStored; + // HighBit (0028,0102) vr=US, vm=1, type=1 + // - also defined in: RTDoseModule + // DcmUnsignedShort HighBit; + // PixelRepresentation (0028,0103) vr=US, vm=1, type=1 + // - also defined in: RTDoseModule + // DcmUnsignedShort PixelRepresentation; + /// PlanarConfiguration (0028,0006) vr=US, vm=1, type=1C + DcmUnsignedShort PlanarConfiguration; + /// PixelAspectRatio (0028,0034) vr=IS, vm=2, type=1C + DcmIntegerString PixelAspectRatio; + /// SmallestImagePixelValue (0028,0106) vr=US/SS, vm=1, type=3 + DcmUnsignedShort SmallestImagePixelValue; + /// LargestImagePixelValue (0028,0107) vr=US/SS, vm=1, type=3 + DcmUnsignedShort LargestImagePixelValue; + /// RedPaletteColorLookupTableDescriptor (0028,1101) vr=US/SS, vm=3, type=1C + DcmUnsignedShort RedPaletteColorLookupTableDescriptor; + /// GreenPaletteColorLookupTableDescriptor (0028,1102) vr=US/SS, vm=3, type=1C + DcmUnsignedShort GreenPaletteColorLookupTableDescriptor; + /// BluePaletteColorLookupTableDescriptor (0028,1103) vr=US/SS, vm=3, type=1C + DcmUnsignedShort BluePaletteColorLookupTableDescriptor; + /// RedPaletteColorLookupTableData (0028,1201) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord RedPaletteColorLookupTableData; + /// GreenPaletteColorLookupTableData (0028,1202) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord GreenPaletteColorLookupTableData; + /// BluePaletteColorLookupTableData (0028,1203) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord BluePaletteColorLookupTableData; + /// ICCProfile (0028,2000) vr=OB, vm=1, type=3 + DcmOtherByteOtherWord ICCProfile; + /// ColorSpace (0028,2002) vr=CS, vm=1, type=3 + DcmCodeString ColorSpace; + /// PixelData (7fe0,0010) vr=OB/OW, vm=1, type=1C + DcmPixelData PixelData; + /// PixelDataProviderURL (0028,7fe0) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator PixelDataProviderURL; + /// PixelPaddingRangeLimit (0028,0121) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingRangeLimit; + + // --- MultiFrameModule (C) --- + + /// NumberOfFrames (0028,0008) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfFrames; + /// FrameIncrementPointer (0028,0009) vr=AT, vm=1-n, type=1 + DcmAttributeTag FrameIncrementPointer; + /// StereoPairsPresent (0022,0028) vr=CS, vm=1, type=3 + DcmCodeString StereoPairsPresent; + + // --- OverlayPlaneModule (U) --- + + /// OverlayRows (60xx,0010) vr=US, vm=1, type=1 + DcmUnsignedShort OverlayRows; + /// OverlayColumns (60xx,0011) vr=US, vm=1, type=1 + DcmUnsignedShort OverlayColumns; + /// OverlayType (60xx,0040) vr=CS, vm=1, type=1 + DcmCodeString OverlayType; + /// OverlayOrigin (60xx,0050) vr=SS, vm=2, type=1 + DcmSignedShort OverlayOrigin; + /// OverlayBitsAllocated (60xx,0100) vr=US, vm=1, type=1 + DcmUnsignedShort OverlayBitsAllocated; + /// OverlayBitPosition (60xx,0102) vr=US, vm=1, type=1 + DcmUnsignedShort OverlayBitPosition; + /// OverlayData (60xx,3000) vr=OB/OW, vm=1, type=1 + DcmOtherByteOtherWord OverlayData; + /// OverlayDescription (60xx,0022) vr=LO, vm=1, type=3 + DcmLongString OverlayDescription; + /// OverlaySubtype (60xx,0045) vr=LO, vm=1, type=3 + DcmLongString OverlaySubtype; + /// OverlayLabel (60xx,1500) vr=LO, vm=1, type=3 + DcmLongString OverlayLabel; + /// ROIArea (60xx,1301) vr=IS, vm=1, type=3 + DcmIntegerString ROIArea; + /// ROIMean (60xx,1302) vr=DS, vm=1, type=3 + DcmDecimalString ROIMean; + /// ROIStandardDeviation (60xx,1303) vr=DS, vm=1, type=3 + DcmDecimalString ROIStandardDeviation; + + // --- MultiFrameOverlayModule (U) --- + + /// NumberOfFramesInOverlay (60xx,0015) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfFramesInOverlay; + /// ImageFrameOrigin (60xx,0051) vr=US, vm=1, type=3 + DcmUnsignedShort ImageFrameOrigin; + + // --- ModalityLUTModule (U) --- + + /// ModalityLUTSequence (0028,3000) vr=SQ, vm=1, type=1C + DRTModalityLUTSequence ModalityLUTSequence; + /// RescaleIntercept (0028,1052) vr=DS, vm=1, type=1C + DcmDecimalString RescaleIntercept; + /// RescaleSlope (0028,1053) vr=DS, vm=1, type=1C + DcmDecimalString RescaleSlope; + /// RescaleType (0028,1054) vr=LO, vm=1, type=1C + DcmLongString RescaleType; + + // --- RTDoseModule (M) --- + + /// SamplesPerPixel (0028,0002) vr=US, vm=1, type=1C + /// - also defined in: ImagePixelModule + DcmUnsignedShort SamplesPerPixel; + /// PhotometricInterpretation (0028,0004) vr=CS, vm=1, type=1C + /// - also defined in: ImagePixelModule + DcmCodeString PhotometricInterpretation; + /// BitsAllocated (0028,0100) vr=US, vm=1, type=1C + /// - also defined in: ImagePixelModule + DcmUnsignedShort BitsAllocated; + /// BitsStored (0028,0101) vr=US, vm=1, type=1C + /// - also defined in: ImagePixelModule + DcmUnsignedShort BitsStored; + /// HighBit (0028,0102) vr=US, vm=1, type=1C + /// - also defined in: ImagePixelModule + DcmUnsignedShort HighBit; + /// PixelRepresentation (0028,0103) vr=US, vm=1, type=1C + /// - also defined in: ImagePixelModule + DcmUnsignedShort PixelRepresentation; + /// ContentDate (0008,0023) vr=DA, vm=1, type=3 + /// - also defined in: GeneralImageModule + DcmDate ContentDate; + /// ContentTime (0008,0033) vr=TM, vm=1, type=3 + /// - also defined in: GeneralImageModule + DcmTime ContentTime; + /// DoseUnits (3004,0002) vr=CS, vm=1, type=1 + DcmCodeString DoseUnits; + /// DoseType (3004,0004) vr=CS, vm=1, type=1 + DcmCodeString DoseType; + /// SpatialTransformOfDose (3004,0005) vr=CS, vm=1, type=3 + DcmCodeString SpatialTransformOfDose; + /// ReferencedSpatialRegistrationSequence (0070,0404) vr=SQ, vm=1, type=2C + DRTReferencedSpatialRegistrationSequence ReferencedSpatialRegistrationSequence; + /// InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + /// - also defined in: GeneralImageModule, StructureSetModule, SOPCommonModule + DcmIntegerString InstanceNumber; + /// DoseComment (3004,0006) vr=LO, vm=1, type=3 + DcmLongString DoseComment; + /// NormalizationPoint (3004,0008) vr=DS, vm=3, type=3 + DcmDecimalString NormalizationPoint; + /// DoseSummationType (3004,000a) vr=CS, vm=1, type=1 + DcmCodeString DoseSummationType; + /// ReferencedRTPlanSequence (300c,0002) vr=SQ, vm=1, type=1C + DRTReferencedRTPlanSequence ReferencedRTPlanSequence; + /// ReferencedTreatmentRecordSequence (3008,0030) vr=SQ, vm=1, type=1C + DRTReferencedTreatmentRecordSequenceInRTDoseModule ReferencedTreatmentRecordSequence; + /// GridFrameOffsetVector (3004,000c) vr=DS, vm=2-n, type=1C + DcmDecimalString GridFrameOffsetVector; + /// DoseGridScaling (3004,000e) vr=DS, vm=1, type=1C + DcmDecimalString DoseGridScaling; + /// TissueHeterogeneityCorrection (3004,0014) vr=CS, vm=1-3, type=3 + DcmCodeString TissueHeterogeneityCorrection; + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=3 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + + // --- RTDVHModule (U) --- + + /// ReferencedStructureSetSequence (300c,0060) vr=SQ, vm=1, type=1 + DRTReferencedStructureSetSequence ReferencedStructureSetSequence; + /// DVHNormalizationPoint (3004,0040) vr=DS, vm=3, type=3 + DcmDecimalString DVHNormalizationPoint; + /// DVHNormalizationDoseValue (3004,0042) vr=DS, vm=1, type=3 + DcmDecimalString DVHNormalizationDoseValue; + /// DVHSequence (3004,0050) vr=SQ, vm=1, type=1 + DRTDVHSequence DVHSequence; + + // --- StructureSetModule (C) --- + + /// StructureSetLabel (3006,0002) vr=SH, vm=1, type=1 + DcmShortString StructureSetLabel; + /// StructureSetName (3006,0004) vr=LO, vm=1, type=3 + DcmLongString StructureSetName; + /// StructureSetDescription (3006,0006) vr=ST, vm=1, type=3 + DcmShortText StructureSetDescription; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: GeneralImageModule, RTDoseModule, SOPCommonModule + // DcmIntegerString InstanceNumber; + /// StructureSetDate (3006,0008) vr=DA, vm=1, type=2 + DcmDate StructureSetDate; + /// StructureSetTime (3006,0009) vr=TM, vm=1, type=2 + DcmTime StructureSetTime; + /// ReferencedFrameOfReferenceSequence (3006,0010) vr=SQ, vm=1, type=3 + DRTReferencedFrameOfReferenceSequence ReferencedFrameOfReferenceSequence; + /// StructureSetROISequence (3006,0020) vr=SQ, vm=1, type=1 + DRTStructureSetROISequence StructureSetROISequence; + /// PredecessorStructureSetSequence (3006,0018) vr=SQ, vm=1, type=3 + DRTPredecessorStructureSetSequence PredecessorStructureSetSequence; + + // --- ROIContourModule (C) --- + + /// ROIContourSequence (3006,0039) vr=SQ, vm=1, type=1 + DRTROIContourSequence ROIContourSequence; + + // --- RTDoseROIModule (C) --- + + /// RTDoseROISequence (3004,0010) vr=SQ, vm=1, type=1 + DRTRTDoseROISequence RTDoseROISequence; + + // --- SOPCommonModule (M) --- + + /// SOPClassUID (0008,0016) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPClassUID; + /// SOPInstanceUID (0008,0018) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPInstanceUID; + /// SpecificCharacterSet (0008,0005) vr=CS, vm=1-n, type=1C + DcmCodeString SpecificCharacterSet; + /// InstanceCreationDate (0008,0012) vr=DA, vm=1, type=3 + DcmDate InstanceCreationDate; + /// InstanceCreationTime (0008,0013) vr=TM, vm=1, type=3 + DcmTime InstanceCreationTime; + /// InstanceCoercionDateTime (0008,0015) vr=DT, vm=1, type=3 + DcmDateTime InstanceCoercionDateTime; + /// InstanceCreatorUID (0008,0014) vr=UI, vm=1, type=3 + DcmUniqueIdentifier InstanceCreatorUID; + /// RelatedGeneralSOPClassUID (0008,001a) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier RelatedGeneralSOPClassUID; + /// OriginalSpecializedSOPClassUID (0008,001b) vr=UI, vm=1, type=3 + DcmUniqueIdentifier OriginalSpecializedSOPClassUID; + /// CodingSchemeIdentificationSequence (0008,0110) vr=SQ, vm=1, type=3 + DRTCodingSchemeIdentificationSequence CodingSchemeIdentificationSequence; + /// ContextGroupIdentificationSequence (0008,0123) vr=SQ, vm=1, type=3 + DRTContextGroupIdentificationSequence ContextGroupIdentificationSequence; + /// MappingResourceIdentificationSequence (0008,0124) vr=SQ, vm=1, type=3 + DRTMappingResourceIdentificationSequence MappingResourceIdentificationSequence; + /// TimezoneOffsetFromUTC (0008,0201) vr=SH, vm=1, type=3 + DcmShortString TimezoneOffsetFromUTC; + /// ContributingEquipmentSequence (0018,a001) vr=SQ, vm=1, type=3 + DRTContributingEquipmentSequence ContributingEquipmentSequence; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: GeneralImageModule, RTDoseModule, StructureSetModule + // DcmIntegerString InstanceNumber; + /// SOPInstanceStatus (0100,0410) vr=CS, vm=1, type=3 + DcmCodeString SOPInstanceStatus; + /// SOPAuthorizationDateTime (0100,0420) vr=DT, vm=1, type=3 + DcmDateTime SOPAuthorizationDateTime; + /// SOPAuthorizationComment (0100,0424) vr=LT, vm=1, type=3 + DcmLongText SOPAuthorizationComment; + /// AuthorizationEquipmentCertificationNumber (0100,0426) vr=LO, vm=1, type=3 + DcmLongString AuthorizationEquipmentCertificationNumber; + /// MACParametersSequence (4ffe,0001) vr=SQ, vm=1, type=3 + DRTMACParametersSequence MACParametersSequence; + /// DigitalSignaturesSequence (fffa,fffa) vr=SQ, vm=1, type=3 + DRTDigitalSignaturesSequence DigitalSignaturesSequence; + /// EncryptedAttributesSequence (0400,0500) vr=SQ, vm=1, type=1C + DRTEncryptedAttributesSequence EncryptedAttributesSequence; + /// OriginalAttributesSequence (0400,0561) vr=SQ, vm=1, type=3 + DRTOriginalAttributesSequence OriginalAttributesSequence; + /// HL7StructuredDocumentReferenceSequence (0040,a390) vr=SQ, vm=1, type=1C + DRTHL7StructuredDocumentReferenceSequence HL7StructuredDocumentReferenceSequence; + /// LongitudinalTemporalInformationModified (0028,0303) vr=CS, vm=1, type=3 + DcmCodeString LongitudinalTemporalInformationModified; + /// QueryRetrieveView (0008,0053) vr=CS, vm=1, type=1C + DcmCodeString QueryRetrieveView; + /// ConversionSourceAttributesSequence (0020,9172) vr=SQ, vm=1, type=1C + DRTConversionSourceAttributesSequence ConversionSourceAttributesSequence; + /// ContentQualification (0018,9004) vr=CS, vm=1, type=3 + DcmCodeString ContentQualification; + /// PrivateDataElementCharacteristicsSequence (0008,0300) vr=SQ, vm=1, type=3 + DRTPrivateDataElementCharacteristicsSequence PrivateDataElementCharacteristicsSequence; + + // --- CommonInstanceReferenceModule (U) --- + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1C + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudiesContainingOtherReferencedInstancesSequence (0008,1200) vr=SQ, vm=1, type=1C + DRTStudiesContainingOtherReferencedInstancesSequence StudiesContainingOtherReferencedInstancesSequence; + + // --- FrameExtractionModule (C) --- + + /// FrameExtractionSequence (0008,1164) vr=SQ, vm=1, type=1 + DRTFrameExtractionSequence FrameExtractionSequence; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drtimage.h b/dcmrt/include/dcmtk/dcmrt/drtimage.h new file mode 100644 index 00000000..d655a9dc --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drtimage.h @@ -0,0 +1,5472 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTImageIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIMAGE_H +#define DRTIMAGE_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtadcs.h" // for AdmittingDiagnosesCodeSequence +#include "dcmtk/dcmrt/seq/drtbrs.h" // for BreedRegistrationSequence +#include "dcmtk/dcmrt/seq/drtcsis.h" // for CodingSchemeIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcctus.h" // for ConsentForClinicalTrialUseSequence +#include "dcmtk/dcmrt/seq/drtcpis.h" // for ConsultingPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcgis.h" // for ContextGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcbars.h" // for ContrastBolusAdministrationRouteSequence +#include "dcmtk/dcmrt/seq/drtbas.h" // for ContrastBolusAgentSequence +#include "dcmtk/dcmrt/seq/drtces.h" // for ContributingEquipmentSequence +#include "dcmtk/dcmrt/seq/drtcsas.h" // for ConversionSourceAttributesSequence +#include "dcmtk/dcmrt/seq/drtdimcs.h" // for DeidentificationMethodCodeSequence +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence +#include "dcmtk/dcmrt/seq/drtds.h" // for DeviceSequence +#include "dcmtk/dcmrt/seq/drtdss.h" // for DigitalSignaturesSequence +#include "dcmtk/dcmrt/seq/drteas.h" // for EncryptedAttributesSequence +#include "dcmtk/dcmrt/seq/drtes.h" // for ExposureSequence +#include "dcmtk/dcmrt/seq/drtfms.h" // for FluenceMapSequence +#include "dcmtk/dcmrt/seq/drtfes.h" // for FrameExtractionSequence +#include "dcmtk/dcmrt/seq/drtgms.h" // for GeneticModificationsSequence +#include "dcmtk/dcmrt/seq/drtgpis.h" // for GroupOfPatientsIdentificationSequence +#include "dcmtk/dcmrt/seq/drthsdrs.h" // for HL7StructuredDocumentReferenceSequence +#include "dcmtk/dcmrt/seq/drtiis.h" // for IconImageSequence +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtiais.h" // for IssuerOfAdmissionIDSequence +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence +#include "dcmtk/dcmrt/seq/drtiseis.h" // for IssuerOfServiceEpisodeIDSequence +#include "dcmtk/dcmrt/seq/drtmps.h" // for MACParametersSequence +#include "dcmtk/dcmrt/seq/drtmris.h" // for MappingResourceIdentificationSequence +#include "dcmtk/dcmrt/seq/drtmls.h" // for ModalityLUTSequence +#include "dcmtk/dcmrt/seq/drtmacds.h" // for MultiplexedAudioChannelsDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtoas.h" // for OriginalAttributesSequence +#include "dcmtk/dcmrt/seq/drtopis.h" // for OtherPatientIDsSequence +#include "dcmtk/dcmrt/seq/drtpbcs.h" // for PatientBreedCodeSequence +#include "dcmtk/dcmrt/seq/drtpsics.h" // for PatientSizeCodeSequence +#include "dcmtk/dcmrt/seq/drtpscs.h" // for PatientSpeciesCodeSequence +#include "dcmtk/dcmrt/seq/drtppcs.h" // for PerformedProtocolCodeSequence +#include "dcmtk/dcmrt/seq/drtporis.h" // for PhysiciansOfRecordIdentificationSequence +#include "dcmtk/dcmrt/seq/drtprsis.h" // for PhysiciansReadingStudyIdentificationSequence +#include "dcmtk/dcmrt/seq/drtpdecs.h" // for PrivateDataElementCharacteristicsSequence +#include "dcmtk/dcmrt/seq/drtpcs.h" // for ProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrwvms.h" // for RealWorldValueMappingSequence +#include "dcmtk/dcmrt/seq/drtrppcs.h" // for ReasonForPerformedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrims.h" // for ReferencedImageSequence +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence +#include "dcmtk/dcmrt/seq/drtrpphs.h" // for ReferencedPatientPhotoSequence +#include "dcmtk/dcmrt/seq/drtrps.h" // for ReferencedPatientSequence +#include "dcmtk/dcmrt/seq/drtrppss.h" // for ReferencedPerformedProcedureStepSequence +#include "dcmtk/dcmrt/seq/drtrrtps5.h" // for ReferencedRTPlanSequence +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrpis.h" // for ReferringPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtras.h" // for RequestAttributesSequence +#include "dcmtk/dcmrt/seq/drtrscs.h" // for RequestingServiceCodeSequence +#include "dcmtk/dcmrt/seq/drtsdcs.h" // for SeriesDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtsis.h" // for SourceImageSequence +#include "dcmtk/dcmrt/seq/drtsins.h" // for SourceInstanceSequence +#include "dcmtk/dcmrt/seq/drtspgis.h" // for SourcePatientGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtscs.h" // for StrainCodeSequence +#include "dcmtk/dcmrt/seq/drtsss.h" // for StrainStockSequence +#include "dcmtk/dcmrt/seq/drtscris.h" // for StudiesContainingOtherReferencedInstancesSequence +#include "dcmtk/dcmrt/seq/drtudis.h" // for UDISequence +#include "dcmtk/dcmrt/seq/drtvls.h" // for VOILUTSequence + + +/** Interface class for RTImageIOD + * @note Because of its many member variables, an instance of this class requires quite + * some memory. So be careful when creating automatic variables from this class (the + * stack size might be exceeded); it is probably better to use the heap space. + */ +class DCMTK_DCMRT_EXPORT DRTImageIOD + : protected DRTTypes +{ + + public: + + // --- constructors, destructor and operators --- + + /** default constructor + */ + DRTImageIOD(); + + /** copy constructor + * @param copy IOD object to be copied + */ + DRTImageIOD(const DRTImageIOD ©); + + /** destructor + */ + virtual ~DRTImageIOD(); + + /** assigment operator + * @param copy IOD object to be copied + * @return reference to this object + */ + DRTImageIOD &operator=(const DRTImageIOD ©); + + // --- general methods --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + // --- input/output methods --- + + /** read object from dataset + * @param dataset reference to DICOM dataset from which the object should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** read PatientData from dataset + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset); + + /** read StudyData from dataset. Also reads PatientData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset); + + /** read SeriesData from dataset. Also reads PatientData, StudyData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSeriesData(DcmItem &dataset); + + /** write object to dataset + * @param dataset reference to DICOM dataset to which the object should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // --- check presence of non-mandatory DICOM modules --- + + /** check whether ClinicalTrialSubjectModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSubjectModulePresent(const OFBool complete = OFFalse); + + /** check whether PatientStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isPatientStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialSeriesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSeriesModulePresent(const OFBool complete = OFFalse); + + /** check whether FrameOfReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isFrameOfReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether GeneralReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isGeneralReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether ContrastBolusModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isContrastBolusModulePresent(const OFBool complete = OFFalse); + + /** check whether CineModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCineModulePresent(const OFBool complete = OFFalse); + + /** check whether MultiFrameModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isMultiFrameModulePresent(const OFBool complete = OFFalse); + + /** check whether DeviceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isDeviceModulePresent(const OFBool complete = OFFalse); + + /** check whether ModalityLUTModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isModalityLUTModulePresent(const OFBool complete = OFFalse); + + /** check whether VOILUTModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isVOILUTModulePresent(const OFBool complete = OFFalse); + + /** check whether ApprovalModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isApprovalModulePresent(const OFBool complete = OFFalse); + + /** check whether CommonInstanceReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCommonInstanceReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether FrameExtractionModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isFrameExtractionModulePresent(const OFBool complete = OFFalse); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionDate (0008,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDate(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionDateTime (0008,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionDateTime(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionNumber (0020,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionNumber(OFString &value, const signed long pos = 0) const; + + /** get AcquisitionNumber (0020,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get AcquisitionTime (0008,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionTime(OFString &value, const signed long pos = 0) const; + + /** get ActualFrameDuration (0018,1242) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getActualFrameDuration(OFString &value, const signed long pos = 0) const; + + /** get ActualFrameDuration (0018,1242) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getActualFrameDuration(Sint32 &value, const unsigned long pos = 0) const; + + /** get AdditionalPatientHistory (0010,21b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdditionalPatientHistory(OFString &value, const signed long pos = 0) const; + + /** get AdmissionID (0038,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmissionID(OFString &value, const signed long pos = 0) const; + + /** get AdmittingDiagnosesDescription (0008,1080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString &value, const signed long pos = 0) const; + + /** get Allergies (0010,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAllergies(OFString &value, const signed long pos = 0) const; + + /** get ApprovalStatus (300e,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getApprovalStatus(OFString &value, const signed long pos = 0) const; + + /** get AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBeamLimitingDeviceAngle(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get BitsAllocated (0028,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsAllocated(Uint16 &value, const unsigned long pos = 0) const; + + /** get BitsStored (0028,0101) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBitsStored(Uint16 &value, const unsigned long pos = 0) const; + + /** get BluePaletteColorLookupTableData (0028,1203) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBluePaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get BluePaletteColorLookupTableDescriptor (0028,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBluePaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get BurnedInAnnotation (0028,0301) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBurnedInAnnotation(OFString &value, const signed long pos = 0) const; + + /** get CineRate (0018,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCineRate(OFString &value, const signed long pos = 0) const; + + /** get CineRate (0018,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCineRate(Sint32 &value, const unsigned long pos = 0) const; + + /** get ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolName (0012,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesDescription (0012,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesID (0012,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteID (0012,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteName (0012,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSponsorName (0012,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSponsorName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectID (0012,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectReadingID (0012,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectReadingID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointDescription (0012,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointID (0012,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointID(OFString &value, const signed long pos = 0) const; + + /** get ColorSpace (0028,2002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getColorSpace(OFString &value, const signed long pos = 0) const; + + /** get Columns (0028,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getColumns(Uint16 &value, const unsigned long pos = 0) const; + + /** get CommentsOnThePerformedProcedureStep (0040,0280) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos = 0) const; + + /** get ConsultingPhysicianName (0008,009c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConsultingPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get ContentDate (0008,0023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentDate(OFString &value, const signed long pos = 0) const; + + /** get ContentQualification (0018,9004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, const signed long pos = 0) const; + + /** get ContentTime (0008,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentTime(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusAgent (0018,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusAgent(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusIngredient (0018,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusIngredient(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusIngredientConcentration (0018,1049) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusIngredientConcentration(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusIngredientConcentration (0018,1049) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusIngredientConcentration(Float64 &value, const unsigned long pos = 0) const; + + /** get ContrastBolusRoute (0018,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusRoute(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusStartTime (0018,1042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusStartTime(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusStopTime (0018,1043) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusStopTime(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusTotalDose (0018,1044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusTotalDose(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusTotalDose (0018,1044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusTotalDose(Float64 &value, const unsigned long pos = 0) const; + + /** get ContrastBolusVolume (0018,1041) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusVolume(OFString &value, const signed long pos = 0) const; + + /** get ContrastBolusVolume (0018,1041) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastBolusVolume(Float64 &value, const unsigned long pos = 0) const; + + /** get ContrastFlowDuration (0018,1047) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastFlowDuration(OFString &value, const signed long pos = 0) const; + + /** get ContrastFlowDuration (0018,1047) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastFlowDuration(Float64 &value, const unsigned long pos = 0) const; + + /** get ContrastFlowDuration (0018,1047) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastFlowDuration(OFVector &value) const; + + /** get ContrastFlowRate (0018,1046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastFlowRate(OFString &value, const signed long pos = 0) const; + + /** get ContrastFlowRate (0018,1046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastFlowRate(Float64 &value, const unsigned long pos = 0) const; + + /** get ContrastFlowRate (0018,1046) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContrastFlowRate(OFVector &value) const; + + /** get ConversionType (0008,0064) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConversionType(OFString &value, const signed long pos = 0) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeidentificationMethod (0012,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeidentificationMethod(OFString &value, const signed long pos = 0) const; + + /** get DerivationDescription (0008,2111) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDerivationDescription(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get EffectiveDuration (0018,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEffectiveDuration(OFString &value, const signed long pos = 0) const; + + /** get EffectiveDuration (0018,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEffectiveDuration(Float64 &value, const unsigned long pos = 0) const; + + /** get EndCumulativeMetersetWeight (300c,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEndCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get EndCumulativeMetersetWeight (300c,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEndCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get EthnicGroup (0010,2160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEthnicGroup(OFString &value, const signed long pos = 0) const; + + /** get ExposureTime (0018,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getExposureTime(OFString &value, const signed long pos = 0) const; + + /** get ExposureTime (0018,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getExposureTime(Sint32 &value, const unsigned long pos = 0) const; + + /** get ExposureTimeInms (0018,9328) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getExposureTimeInms(Float64 &value, const unsigned long pos = 0) const; + + /** get FractionNumber (3002,0029) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFractionNumber(OFString &value, const signed long pos = 0) const; + + /** get FractionNumber (3002,0029) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFractionNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get FrameDelay (0018,1066) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameDelay(OFString &value, const signed long pos = 0) const; + + /** get FrameDelay (0018,1066) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameDelay(Float64 &value, const unsigned long pos = 0) const; + + /** get FrameIncrementPointer (0028,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameIncrementPointer(OFString &value, const signed long pos = 0) const; + + /** get FrameOfReferenceUID (0020,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceUID(OFString &value, const signed long pos = 0) const; + + /** get FrameTime (0018,1063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameTime(OFString &value, const signed long pos = 0) const; + + /** get FrameTime (0018,1063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameTime(Float64 &value, const unsigned long pos = 0) const; + + /** get FrameTimeVector (0018,1065) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameTimeVector(OFString &value, const signed long pos = 0) const; + + /** get FrameTimeVector (0018,1065) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameTimeVector(Float64 &value, const unsigned long pos = 0) const; + + /** get FrameTimeVector (0018,1065) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameTimeVector(OFVector &value) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryAngle(OFString &value, const signed long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryID (0018,1008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryID(OFString &value, const signed long pos = 0) const; + + /** get GantryPitchAngle (300a,014a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get GreenPaletteColorLookupTableData (0028,1202) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGreenPaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get GreenPaletteColorLookupTableDescriptor (0028,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGreenPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get HighBit (0028,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getHighBit(Uint16 &value, const unsigned long pos = 0) const; + + /** get ICCProfile (0028,2000) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getICCProfile(Uint8 *&value, unsigned long *count = NULL) const; + + /** get ImageComments (0020,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageComments(OFString &value, const signed long pos = 0) const; + + /** get ImagePlanePixelSpacing (3002,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePlanePixelSpacing(OFString &value, const signed long pos = 0) const; + + /** get ImagePlanePixelSpacing (3002,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePlanePixelSpacing(Float64 &value, const unsigned long pos = 0) const; + + /** get ImagePlanePixelSpacing (3002,0011) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagePlanePixelSpacing(OFVector &value) const; + + /** get ImageTriggerDelay (0018,1067) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageTriggerDelay(OFString &value, const signed long pos = 0) const; + + /** get ImageTriggerDelay (0018,1067) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageTriggerDelay(Float64 &value, const unsigned long pos = 0) const; + + /** get ImageType (0008,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImageType(OFString &value, const signed long pos = 0) const; + + /** get ImagesInAcquisition (0020,1002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagesInAcquisition(OFString &value, const signed long pos = 0) const; + + /** get ImagesInAcquisition (0020,1002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getImagesInAcquisition(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstanceCoercionDateTime (0008,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCoercionDateTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationDate (0008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationTime (0008,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreatorUID (0008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get IrradiationEventUID (0008,3010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIrradiationEventUID(OFString &value, const signed long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIsocenterPosition(OFString &value, const signed long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIsocenterPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIsocenterPosition(OFVector &value) const; + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get LargestImagePixelValue (0028,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLargestImagePixelValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get LastMenstrualDate (0010,21d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLastMenstrualDate(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalEventType (0012,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalEventType(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalInformationModified (0028,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalInformationModified(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos = 0) const; + + /** get LossyImageCompression (0028,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompression(OFString &value, const signed long pos = 0) const; + + /** get LossyImageCompressionMethod (0028,2114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionMethod(OFString &value, const signed long pos = 0) const; + + /** get LossyImageCompressionRatio (0028,2112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(OFString &value, const signed long pos = 0) const; + + /** get LossyImageCompressionRatio (0028,2112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(Float64 &value, const unsigned long pos = 0) const; + + /** get LossyImageCompressionRatio (0028,2112) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLossyImageCompressionRatio(OFVector &value) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MedicalAlerts (0010,2000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMedicalAlerts(OFString &value, const signed long pos = 0) const; + + /** get MetersetExposure (3002,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMetersetExposure(OFString &value, const signed long pos = 0) const; + + /** get MetersetExposure (3002,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMetersetExposure(Float64 &value, const unsigned long pos = 0) const; + + /** get Modality (0008,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, const signed long pos = 0) const; + + /** get NameOfPhysiciansReadingStudy (0008,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFrames (0028,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFrames(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFrames (0028,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFrames(Sint32 &value, const unsigned long pos = 0) const; + + /** get Occupation (0010,2180) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOccupation(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OriginalSpecializedSOPClassUID (0008,001b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get OtherPatientNames (0010,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOtherPatientNames(OFString &value, const signed long pos = 0) const; + + /** get PatientAge (0010,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, const signed long pos = 0) const; + + /** get PatientAlternativeCalendar (0010,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDate (0010,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthTime (0010,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthTime(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientBreedDescription (0010,2292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBreedDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientComments (0010,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientComments(OFString &value, const signed long pos = 0) const; + + /** get PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientIdentityRemoved (0012,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientIdentityRemoved(OFString &value, const signed long pos = 0) const; + + /** get PatientName (0010,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, const signed long pos = 0) const; + + /** get PatientOrientation (0020,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientOrientation(OFString &value, const signed long pos = 0) const; + + /** get PatientPosition (0018,5100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientPosition(OFString &value, const signed long pos = 0) const; + + /** get PatientSex (0010,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, const signed long pos = 0) const; + + /** get PatientSexNeutered (0010,2203) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSexNeutered(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSpeciesDescription (0010,2201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSpeciesDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientState (0038,0500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientState(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSupportAngle(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSupportAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get PerformedProcedureStepDescription (0040,0254) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndDate (0040,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndTime (0040,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndTime(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepID (0040,0253) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartDate (0040,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartTime (0040,0245) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartTime(OFString &value, const signed long pos = 0) const; + + /** get PhotometricInterpretation (0028,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhotometricInterpretation(OFString &value, const signed long pos = 0) const; + + /** get PhysiciansOfRecord (0008,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhysiciansOfRecord(OFString &value, const signed long pos = 0) const; + + /** get PixelAspectRatio (0028,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelAspectRatio(OFString &value, const signed long pos = 0) const; + + /** get PixelAspectRatio (0028,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelAspectRatio(Sint32 &value, const unsigned long pos = 0) const; + + /** get PixelDataProviderURL (0028,7fe0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelDataProviderURL(OFString &value, const signed long pos = 0) const; + + /** get PixelIntensityRelationship (0028,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelIntensityRelationship(OFString &value, const signed long pos = 0) const; + + /** get PixelIntensityRelationshipSign (0028,1041) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelIntensityRelationshipSign(Sint16 &value, const unsigned long pos = 0) const; + + /** get PixelPaddingRangeLimit (0028,0121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingRangeLimit(Uint16 &value, const unsigned long pos = 0) const; + + /** get PixelPaddingValue (0028,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PixelRepresentation (0028,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelRepresentation(Uint16 &value, const unsigned long pos = 0) const; + + /** get PlanarConfiguration (0028,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPlanarConfiguration(Uint16 &value, const unsigned long pos = 0) const; + + /** get PositionReferenceIndicator (0020,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPositionReferenceIndicator(OFString &value, const signed long pos = 0) const; + + /** get PreferredPlaybackSequencing (0018,1244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPreferredPlaybackSequencing(Uint16 &value, const unsigned long pos = 0) const; + + /** get PregnancyStatus (0010,21c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPregnancyStatus(Uint16 &value, const unsigned long pos = 0) const; + + /** get PresentationLUTShape (2050,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPresentationLUTShape(OFString &value, const signed long pos = 0) const; + + /** get PrimaryDosimeterUnit (300a,00b3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPrimaryDosimeterUnit(OFString &value, const signed long pos = 0) const; + + /** get QualityControlImage (0028,0300) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlImage(OFString &value, const signed long pos = 0) const; + + /** get QualityControlSubject (0010,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlSubject(OFString &value, const signed long pos = 0) const; + + /** get QueryRetrieveView (0008,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQueryRetrieveView(OFString &value, const signed long pos = 0) const; + + /** get RTImageDescription (3002,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageDescription(OFString &value, const signed long pos = 0) const; + + /** get RTImageLabel (3002,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageLabel(OFString &value, const signed long pos = 0) const; + + /** get RTImageName (3002,0003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageName(OFString &value, const signed long pos = 0) const; + + /** get RTImageOrientation (3002,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageOrientation(OFString &value, const signed long pos = 0) const; + + /** get RTImageOrientation (3002,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageOrientation(Float64 &value, const unsigned long pos = 0) const; + + /** get RTImageOrientation (3002,0010) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageOrientation(OFVector &value) const; + + /** get RTImagePlane (3002,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImagePlane(OFString &value, const signed long pos = 0) const; + + /** get RTImagePosition (3002,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImagePosition(OFString &value, const signed long pos = 0) const; + + /** get RTImagePosition (3002,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImagePosition(Float64 &value, const unsigned long pos = 0) const; + + /** get RTImagePosition (3002,0012) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImagePosition(OFVector &value) const; + + /** get RTImageSID (3002,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageSID(OFString &value, const signed long pos = 0) const; + + /** get RTImageSID (3002,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTImageSID(Float64 &value, const unsigned long pos = 0) const; + + /** get RadiationMachineName (3002,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRadiationMachineName(OFString &value, const signed long pos = 0) const; + + /** get RadiationMachineSAD (3002,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRadiationMachineSAD(OFString &value, const signed long pos = 0) const; + + /** get RadiationMachineSAD (3002,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRadiationMachineSAD(Float64 &value, const unsigned long pos = 0) const; + + /** get RadiationMachineSSD (3002,0024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRadiationMachineSSD(OFString &value, const signed long pos = 0) const; + + /** get RadiationMachineSSD (3002,0024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRadiationMachineSSD(Float64 &value, const unsigned long pos = 0) const; + + /** get RecognizableVisualFeatures (0028,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRecognizableVisualFeatures(OFString &value, const signed long pos = 0) const; + + /** get RecommendedDisplayFrameRate (0008,2144) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRecommendedDisplayFrameRate(OFString &value, const signed long pos = 0) const; + + /** get RecommendedDisplayFrameRate (0008,2144) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRecommendedDisplayFrameRate(Sint32 &value, const unsigned long pos = 0) const; + + /** get RedPaletteColorLookupTableData (0028,1201) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRedPaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get RedPaletteColorLookupTableDescriptor (0028,1101) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRedPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedBeamNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedBeamNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedFractionGroupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferringPhysicianName (0008,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get RelatedGeneralSOPClassUID (0008,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRelatedGeneralSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReportedValuesOrigin (3002,000a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReportedValuesOrigin(OFString &value, const signed long pos = 0) const; + + /** get RescaleIntercept (0028,1052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleIntercept(OFString &value, const signed long pos = 0) const; + + /** get RescaleIntercept (0028,1052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleIntercept(Float64 &value, const unsigned long pos = 0) const; + + /** get RescaleSlope (0028,1053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleSlope(OFString &value, const signed long pos = 0) const; + + /** get RescaleSlope (0028,1053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleSlope(Float64 &value, const unsigned long pos = 0) const; + + /** get RescaleType (0028,1054) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRescaleType(OFString &value, const signed long pos = 0) const; + + /** get ResponsibleOrganization (0010,2299) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePerson (0010,2297) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePerson(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePersonRole (0010,2298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePersonRole(OFString &value, const signed long pos = 0) const; + + /** get ReviewDate (300e,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewDate(OFString &value, const signed long pos = 0) const; + + /** get ReviewTime (300e,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewTime(OFString &value, const signed long pos = 0) const; + + /** get ReviewerName (300e,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewerName(OFString &value, const signed long pos = 0) const; + + /** get Rows (0028,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRows(Uint16 &value, const unsigned long pos = 0) const; + + /** get SOPAuthorizationComment (0100,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationComment(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationDateTime (0100,0420) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationDateTime(OFString &value, const signed long pos = 0) const; + + /** get SOPClassUID (0008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceStatus (0100,0410) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceStatus(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceUID (0008,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SamplesPerPixel (0028,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSamplesPerPixel(Uint16 &value, const unsigned long pos = 0) const; + + /** get SeriesDate (0008,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, const signed long pos = 0) const; + + /** get SeriesDescription (0008,103e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SeriesTime (0008,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeDescription (0038,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeDescription(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeID (0038,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeID(OFString &value, const signed long pos = 0) const; + + /** get SmallestImagePixelValue (0028,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmallestImagePixelValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get SmokingStatus (0010,21a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmokingStatus(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SourceToReferenceObjectDistance (3002,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSourceToReferenceObjectDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToReferenceObjectDistance (3002,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSourceToReferenceObjectDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecificCharacterSet (0008,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, const signed long pos = 0) const; + + /** get StartCumulativeMetersetWeight (300c,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStartCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get StartCumulativeMetersetWeight (300c,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStartCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get StartTrim (0008,2142) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStartTrim(OFString &value, const signed long pos = 0) const; + + /** get StartTrim (0008,2142) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStartTrim(Sint32 &value, const unsigned long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get StereoPairsPresent (0022,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStereoPairsPresent(OFString &value, const signed long pos = 0) const; + + /** get StopTrim (0008,2143) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStopTrim(OFString &value, const signed long pos = 0) const; + + /** get StopTrim (0008,2143) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStopTrim(Sint32 &value, const unsigned long pos = 0) const; + + /** get StrainAdditionalInformation (0010,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainAdditionalInformation(OFString &value, const signed long pos = 0) const; + + /** get StrainDescription (0010,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainDescription(OFString &value, const signed long pos = 0) const; + + /** get StrainNomenclature (0010,0213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainNomenclature(OFString &value, const signed long pos = 0) const; + + /** get StudyDate (0008,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, const signed long pos = 0) const; + + /** get StudyDescription (0008,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, const signed long pos = 0) const; + + /** get StudyID (0020,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyTime (0008,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, const signed long pos = 0) const; + + /** get TableTopEccentricAngle (300a,0125) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopEccentricAngle(OFString &value, const signed long pos = 0) const; + + /** get TableTopEccentricAngle (300a,0125) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopEccentricAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopEccentricAxisDistance (300a,0124) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopEccentricAxisDistance(OFString &value, const signed long pos = 0) const; + + /** get TableTopEccentricAxisDistance (300a,0124) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopEccentricAxisDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopLateralPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopLateralPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopLongitudinalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchAngle (300a,0140) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopRollAngle (300a,0144) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopRollAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopVerticalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTableTopVerticalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get TimezoneOffsetFromUTC (0008,0201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, const signed long pos = 0) const; + + /** get VOILUTFunction (0028,1056) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVOILUTFunction(OFString &value, const signed long pos = 0) const; + + /** get WindowCenter (0028,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowCenter(OFString &value, const signed long pos = 0) const; + + /** get WindowCenter (0028,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowCenter(Float64 &value, const unsigned long pos = 0) const; + + /** get WindowCenter (0028,1050) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowCenter(OFVector &value) const; + + /** get WindowCenterWidthExplanation (0028,1055) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowCenterWidthExplanation(OFString &value, const signed long pos = 0) const; + + /** get WindowWidth (0028,1051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowWidth(OFString &value, const signed long pos = 0) const; + + /** get WindowWidth (0028,1051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowWidth(Float64 &value, const unsigned long pos = 0) const; + + /** get WindowWidth (0028,1051) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getWindowWidth(OFVector &value) const; + + /** get XRayImageReceptorAngle (3002,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getXRayImageReceptorAngle(OFString &value, const signed long pos = 0) const; + + /** get XRayImageReceptorAngle (3002,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getXRayImageReceptorAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get XRayImageReceptorTranslation (3002,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getXRayImageReceptorTranslation(OFString &value, const signed long pos = 0) const; + + /** get XRayImageReceptorTranslation (3002,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getXRayImageReceptorTranslation(Float64 &value, const unsigned long pos = 0) const; + + /** get XRayImageReceptorTranslation (3002,000d) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getXRayImageReceptorTranslation(OFVector &value) const; + + // --- get pixel data element --- + + /** get PixelData (7fe0,0010) + * @return reference to pixel data element + */ + DcmPixelData &getPixelData() + { return PixelData; } + + /** get PixelData (7fe0,0010) + * @return const reference to pixel data element + */ + const DcmPixelData &getPixelData() const + { return PixelData; } + + // --- get DICOM sequence attributes --- + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return reference to sequence element + */ + DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() + { return AdmittingDiagnosesCodeSequence; } + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return const reference to sequence element + */ + const DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() const + { return AdmittingDiagnosesCodeSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return reference to sequence element + */ + DRTBreedRegistrationSequence &getBreedRegistrationSequence() + { return BreedRegistrationSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return const reference to sequence element + */ + const DRTBreedRegistrationSequence &getBreedRegistrationSequence() const + { return BreedRegistrationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return reference to sequence element + */ + DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() + { return CodingSchemeIdentificationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return const reference to sequence element + */ + const DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() const + { return CodingSchemeIdentificationSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return reference to sequence element + */ + DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return const reference to sequence element + */ + const DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() const + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return reference to sequence element + */ + DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() + { return ConsultingPhysicianIdentificationSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return const reference to sequence element + */ + const DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() const + { return ConsultingPhysicianIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return reference to sequence element + */ + DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() + { return ContextGroupIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return const reference to sequence element + */ + const DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() const + { return ContextGroupIdentificationSequence; } + + /** get ContrastBolusAdministrationRouteSequence (0018,0014) + * @return reference to sequence element + */ + DRTContrastBolusAdministrationRouteSequence &getContrastBolusAdministrationRouteSequence() + { return ContrastBolusAdministrationRouteSequence; } + + /** get ContrastBolusAdministrationRouteSequence (0018,0014) + * @return const reference to sequence element + */ + const DRTContrastBolusAdministrationRouteSequence &getContrastBolusAdministrationRouteSequence() const + { return ContrastBolusAdministrationRouteSequence; } + + /** get ContrastBolusAgentSequence (0018,0012) + * @return reference to sequence element + */ + DRTContrastBolusAgentSequence &getContrastBolusAgentSequence() + { return ContrastBolusAgentSequence; } + + /** get ContrastBolusAgentSequence (0018,0012) + * @return const reference to sequence element + */ + const DRTContrastBolusAgentSequence &getContrastBolusAgentSequence() const + { return ContrastBolusAgentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return reference to sequence element + */ + DRTContributingEquipmentSequence &getContributingEquipmentSequence() + { return ContributingEquipmentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return const reference to sequence element + */ + const DRTContributingEquipmentSequence &getContributingEquipmentSequence() const + { return ContributingEquipmentSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return reference to sequence element + */ + DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() + { return ConversionSourceAttributesSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return const reference to sequence element + */ + const DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() const + { return ConversionSourceAttributesSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return reference to sequence element + */ + DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() + { return DeidentificationMethodCodeSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return const reference to sequence element + */ + const DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() const + { return DeidentificationMethodCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + /** get DeviceSequence (0050,0010) + * @return reference to sequence element + */ + DRTDeviceSequence &getDeviceSequence() + { return DeviceSequence; } + + /** get DeviceSequence (0050,0010) + * @return const reference to sequence element + */ + const DRTDeviceSequence &getDeviceSequence() const + { return DeviceSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return reference to sequence element + */ + DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() + { return DigitalSignaturesSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return const reference to sequence element + */ + const DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() const + { return DigitalSignaturesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return reference to sequence element + */ + DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() + { return EncryptedAttributesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return const reference to sequence element + */ + const DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() const + { return EncryptedAttributesSequence; } + + /** get ExposureSequence (3002,0030) + * @return reference to sequence element + */ + DRTExposureSequence &getExposureSequence() + { return ExposureSequence; } + + /** get ExposureSequence (3002,0030) + * @return const reference to sequence element + */ + const DRTExposureSequence &getExposureSequence() const + { return ExposureSequence; } + + /** get FluenceMapSequence (3002,0040) + * @return reference to sequence element + */ + DRTFluenceMapSequence &getFluenceMapSequence() + { return FluenceMapSequence; } + + /** get FluenceMapSequence (3002,0040) + * @return const reference to sequence element + */ + const DRTFluenceMapSequence &getFluenceMapSequence() const + { return FluenceMapSequence; } + + /** get FrameExtractionSequence (0008,1164) + * @return reference to sequence element + */ + DRTFrameExtractionSequence &getFrameExtractionSequence() + { return FrameExtractionSequence; } + + /** get FrameExtractionSequence (0008,1164) + * @return const reference to sequence element + */ + const DRTFrameExtractionSequence &getFrameExtractionSequence() const + { return FrameExtractionSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return reference to sequence element + */ + DRTGeneticModificationsSequence &getGeneticModificationsSequence() + { return GeneticModificationsSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return const reference to sequence element + */ + const DRTGeneticModificationsSequence &getGeneticModificationsSequence() const + { return GeneticModificationsSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return reference to sequence element + */ + DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() + { return GroupOfPatientsIdentificationSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return const reference to sequence element + */ + const DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() const + { return GroupOfPatientsIdentificationSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return reference to sequence element + */ + DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() + { return HL7StructuredDocumentReferenceSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return const reference to sequence element + */ + const DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() const + { return HL7StructuredDocumentReferenceSequence; } + + /** get IconImageSequence (0088,0200) + * @return reference to sequence element + */ + DRTIconImageSequence &getIconImageSequence() + { return IconImageSequence; } + + /** get IconImageSequence (0088,0200) + * @return const reference to sequence element + */ + const DRTIconImageSequence &getIconImageSequence() const + { return IconImageSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return reference to sequence element + */ + DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return const reference to sequence element + */ + const DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() const + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return reference to sequence element + */ + DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() + { return IssuerOfServiceEpisodeIDSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return const reference to sequence element + */ + const DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() const + { return IssuerOfServiceEpisodeIDSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return reference to sequence element + */ + DRTMACParametersSequence &getMACParametersSequence() + { return MACParametersSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return const reference to sequence element + */ + const DRTMACParametersSequence &getMACParametersSequence() const + { return MACParametersSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return reference to sequence element + */ + DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() + { return MappingResourceIdentificationSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return const reference to sequence element + */ + const DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() const + { return MappingResourceIdentificationSequence; } + + /** get ModalityLUTSequence (0028,3000) + * @return reference to sequence element + */ + DRTModalityLUTSequence &getModalityLUTSequence() + { return ModalityLUTSequence; } + + /** get ModalityLUTSequence (0028,3000) + * @return const reference to sequence element + */ + const DRTModalityLUTSequence &getModalityLUTSequence() const + { return ModalityLUTSequence; } + + /** get MultiplexedAudioChannelsDescriptionCodeSequence (003a,0300) + * @return reference to sequence element + */ + DRTMultiplexedAudioChannelsDescriptionCodeSequence &getMultiplexedAudioChannelsDescriptionCodeSequence() + { return MultiplexedAudioChannelsDescriptionCodeSequence; } + + /** get MultiplexedAudioChannelsDescriptionCodeSequence (003a,0300) + * @return const reference to sequence element + */ + const DRTMultiplexedAudioChannelsDescriptionCodeSequence &getMultiplexedAudioChannelsDescriptionCodeSequence() const + { return MultiplexedAudioChannelsDescriptionCodeSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return reference to sequence element + */ + DRTOriginalAttributesSequence &getOriginalAttributesSequence() + { return OriginalAttributesSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return const reference to sequence element + */ + const DRTOriginalAttributesSequence &getOriginalAttributesSequence() const + { return OriginalAttributesSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return reference to sequence element + */ + DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() + { return OtherPatientIDsSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return const reference to sequence element + */ + const DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() const + { return OtherPatientIDsSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return reference to sequence element + */ + DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() + { return PatientBreedCodeSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return const reference to sequence element + */ + const DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() const + { return PatientBreedCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return reference to sequence element + */ + DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() + { return PatientSizeCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return const reference to sequence element + */ + const DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() const + { return PatientSizeCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return reference to sequence element + */ + DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() + { return PatientSpeciesCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return const reference to sequence element + */ + const DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() const + { return PatientSpeciesCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return reference to sequence element + */ + DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() + { return PerformedProtocolCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return const reference to sequence element + */ + const DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() const + { return PerformedProtocolCodeSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return reference to sequence element + */ + DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return const reference to sequence element + */ + const DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() const + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return reference to sequence element + */ + DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return const reference to sequence element + */ + const DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() const + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return reference to sequence element + */ + DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() + { return PrivateDataElementCharacteristicsSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return const reference to sequence element + */ + const DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() const + { return PrivateDataElementCharacteristicsSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return reference to sequence element + */ + DRTProcedureCodeSequence &getProcedureCodeSequence() + { return ProcedureCodeSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return const reference to sequence element + */ + const DRTProcedureCodeSequence &getProcedureCodeSequence() const + { return ProcedureCodeSequence; } + + /** get RealWorldValueMappingSequence (0040,9096) + * @return reference to sequence element + */ + DRTRealWorldValueMappingSequence &getRealWorldValueMappingSequence() + { return RealWorldValueMappingSequence; } + + /** get RealWorldValueMappingSequence (0040,9096) + * @return const reference to sequence element + */ + const DRTRealWorldValueMappingSequence &getRealWorldValueMappingSequence() const + { return RealWorldValueMappingSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return reference to sequence element + */ + DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return const reference to sequence element + */ + const DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() const + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return reference to sequence element + */ + DRTReferencedImageSequence &getReferencedImageSequence() + { return ReferencedImageSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return const reference to sequence element + */ + const DRTReferencedImageSequence &getReferencedImageSequence() const + { return ReferencedImageSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return reference to sequence element + */ + DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return const reference to sequence element + */ + const DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() const + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return reference to sequence element + */ + DRTReferencedPatientSequence &getReferencedPatientSequence() + { return ReferencedPatientSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return const reference to sequence element + */ + const DRTReferencedPatientSequence &getReferencedPatientSequence() const + { return ReferencedPatientSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return reference to sequence element + */ + DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return const reference to sequence element + */ + const DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() const + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return reference to sequence element + */ + DRTReferencedRTPlanSequenceInRTImageModule &getReferencedRTPlanSequence() + { return ReferencedRTPlanSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return const reference to sequence element + */ + const DRTReferencedRTPlanSequenceInRTImageModule &getReferencedRTPlanSequence() const + { return ReferencedRTPlanSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return reference to sequence element + */ + DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() + { return ReferringPhysicianIdentificationSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return const reference to sequence element + */ + const DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() const + { return ReferringPhysicianIdentificationSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return reference to sequence element + */ + DRTRequestAttributesSequence &getRequestAttributesSequence() + { return RequestAttributesSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return const reference to sequence element + */ + const DRTRequestAttributesSequence &getRequestAttributesSequence() const + { return RequestAttributesSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return reference to sequence element + */ + DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() + { return RequestingServiceCodeSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return const reference to sequence element + */ + const DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() const + { return RequestingServiceCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return reference to sequence element + */ + DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() + { return SeriesDescriptionCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return const reference to sequence element + */ + const DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() const + { return SeriesDescriptionCodeSequence; } + + /** get SourceImageSequence (0008,2112) + * @return reference to sequence element + */ + DRTSourceImageSequence &getSourceImageSequence() + { return SourceImageSequence; } + + /** get SourceImageSequence (0008,2112) + * @return const reference to sequence element + */ + const DRTSourceImageSequence &getSourceImageSequence() const + { return SourceImageSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return reference to sequence element + */ + DRTSourceInstanceSequence &getSourceInstanceSequence() + { return SourceInstanceSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return const reference to sequence element + */ + const DRTSourceInstanceSequence &getSourceInstanceSequence() const + { return SourceInstanceSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return reference to sequence element + */ + DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() + { return SourcePatientGroupIdentificationSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return const reference to sequence element + */ + const DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() const + { return SourcePatientGroupIdentificationSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return reference to sequence element + */ + DRTStrainCodeSequence &getStrainCodeSequence() + { return StrainCodeSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return const reference to sequence element + */ + const DRTStrainCodeSequence &getStrainCodeSequence() const + { return StrainCodeSequence; } + + /** get StrainStockSequence (0010,0216) + * @return reference to sequence element + */ + DRTStrainStockSequence &getStrainStockSequence() + { return StrainStockSequence; } + + /** get StrainStockSequence (0010,0216) + * @return const reference to sequence element + */ + const DRTStrainStockSequence &getStrainStockSequence() const + { return StrainStockSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return reference to sequence element + */ + DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return const reference to sequence element + */ + const DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() const + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get UDISequence (0018,100a) + * @return reference to sequence element + */ + DRTUDISequence &getUDISequence() + { return UDISequence; } + + /** get UDISequence (0018,100a) + * @return const reference to sequence element + */ + const DRTUDISequence &getUDISequence() const + { return UDISequence; } + + /** get VOILUTSequence (0028,3010) + * @return reference to sequence element + */ + DRTVOILUTSequence &getVOILUTSequence() + { return VOILUTSequence; } + + /** get VOILUTSequence (0028,3010) + * @return const reference to sequence element + */ + const DRTVOILUTSequence &getVOILUTSequence() const + { return VOILUTSequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionDate (0008,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDate(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionDateTime (0008,002a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionNumber (0020,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AcquisitionTime (0008,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionTime(const OFString &value, const OFBool check = OFTrue); + + /** set ActualFrameDuration (0018,1242) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setActualFrameDuration(const OFString &value, const OFBool check = OFTrue); + + /** set AdditionalPatientHistory (0010,21b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdditionalPatientHistory(const OFString &value, const OFBool check = OFTrue); + + /** set AdmissionID (0038,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmissionID(const OFString &value, const OFBool check = OFTrue); + + /** set AdmittingDiagnosesDescription (0008,1080) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set Allergies (0010,2110) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAllergies(const OFString &value, const OFBool check = OFTrue); + + /** set ApprovalStatus (300e,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setApprovalStatus(const OFString &value, const OFBool check = OFTrue); + + /** set AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BeamLimitingDeviceAngle (300a,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBeamLimitingDeviceAngle(const OFString &value, const OFBool check = OFTrue); + + /** set BitsAllocated (0028,0100) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsAllocated(const Uint16 value, const unsigned long pos = 0); + + /** set BitsStored (0028,0101) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBitsStored(const Uint16 value, const unsigned long pos = 0); + + /** set BluePaletteColorLookupTableData (0028,1203) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBluePaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set BluePaletteColorLookupTableDescriptor (0028,1103) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBluePaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set BurnedInAnnotation (0028,0301) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBurnedInAnnotation(const OFString &value, const OFBool check = OFTrue); + + /** set CineRate (0018,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCineRate(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolName (0012,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesDescription (0012,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesID (0012,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteID (0012,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteName (0012,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSponsorName (0012,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSponsorName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectID (0012,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectReadingID (0012,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointDescription (0012,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointID (0012,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointID(const OFString &value, const OFBool check = OFTrue); + + /** set ColorSpace (0028,2002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setColorSpace(const OFString &value, const OFBool check = OFTrue); + + /** set Columns (0028,0011) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setColumns(const Uint16 value, const unsigned long pos = 0); + + /** set CommentsOnThePerformedProcedureStep (0040,0280) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check = OFTrue); + + /** set ConsultingPhysicianName (0008,009c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConsultingPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set ContentDate (0008,0023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentDate(const OFString &value, const OFBool check = OFTrue); + + /** set ContentQualification (0018,9004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, const OFBool check = OFTrue); + + /** set ContentTime (0008,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentTime(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusAgent (0018,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusAgent(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusIngredient (0018,1048) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusIngredient(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusIngredientConcentration (0018,1049) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusIngredientConcentration(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusRoute (0018,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusRoute(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusStartTime (0018,1042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusStopTime (0018,1043) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusStopTime(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusTotalDose (0018,1044) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusTotalDose(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastBolusVolume (0018,1041) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastBolusVolume(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastFlowDuration (0018,1047) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastFlowDuration(const OFString &value, const OFBool check = OFTrue); + + /** set ContrastFlowRate (0018,1046) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContrastFlowRate(const OFString &value, const OFBool check = OFTrue); + + /** set ConversionType (0008,0064) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConversionType(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeidentificationMethod (0012,0063) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeidentificationMethod(const OFString &value, const OFBool check = OFTrue); + + /** set DerivationDescription (0008,2111) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDerivationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set EffectiveDuration (0018,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEffectiveDuration(const OFString &value, const OFBool check = OFTrue); + + /** set EndCumulativeMetersetWeight (300c,0009) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEndCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set EthnicGroup (0010,2160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEthnicGroup(const OFString &value, const OFBool check = OFTrue); + + /** set ExposureTime (0018,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setExposureTime(const OFString &value, const OFBool check = OFTrue); + + /** set ExposureTimeInms (0018,9328) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setExposureTimeInms(const Float64 value, const unsigned long pos = 0); + + /** set FractionNumber (3002,0029) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFractionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set FrameDelay (0018,1066) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameDelay(const OFString &value, const OFBool check = OFTrue); + + /** set FrameIncrementPointer (0028,0009) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (AT) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameIncrementPointer(const OFString &value, const OFBool check = OFTrue); + + /** set FrameOfReferenceUID (0020,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceUID(const OFString &value, const OFBool check = OFTrue); + + /** set FrameTime (0018,1063) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameTime(const OFString &value, const OFBool check = OFTrue); + + /** set FrameTimeVector (0018,1065) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameTimeVector(const OFString &value, const OFBool check = OFTrue); + + /** set GantryAngle (300a,011e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryAngle(const OFString &value, const OFBool check = OFTrue); + + /** set GantryID (0018,1008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryID(const OFString &value, const OFBool check = OFTrue); + + /** set GantryPitchAngle (300a,014a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set GreenPaletteColorLookupTableData (0028,1202) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGreenPaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set GreenPaletteColorLookupTableDescriptor (0028,1102) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGreenPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set HighBit (0028,0102) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setHighBit(const Uint16 value, const unsigned long pos = 0); + + /** set ICCProfile (0028,2000) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setICCProfile(const Uint8 *value, const unsigned long count); + + /** set ImageComments (0020,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageComments(const OFString &value, const OFBool check = OFTrue); + + /** set ImagePlanePixelSpacing (3002,0011) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImagePlanePixelSpacing(const OFString &value, const OFBool check = OFTrue); + + /** set ImageTriggerDelay (0018,1067) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageTriggerDelay(const OFString &value, const OFBool check = OFTrue); + + /** set ImageType (0008,0008) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (2-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImageType(const OFString &value, const OFBool check = OFTrue); + + /** set ImagesInAcquisition (0020,1002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setImagesInAcquisition(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCoercionDateTime (0008,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCoercionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationDate (0008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationTime (0008,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreatorUID (0008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceNumber (0020,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set IrradiationEventUID (0008,3010) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIrradiationEventUID(const OFString &value, const OFBool check = OFTrue); + + /** set IsocenterPosition (300a,012c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIsocenterPosition(const OFString &value, const OFBool check = OFTrue); + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set LargestImagePixelValue (0028,0107) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLargestImagePixelValue(const Uint16 value, const unsigned long pos = 0); + + /** set LastMenstrualDate (0010,21d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLastMenstrualDate(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalEventType (0012,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalEventType(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalInformationModified (0028,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos = 0); + + /** set LossyImageCompression (0028,2110) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompression(const OFString &value, const OFBool check = OFTrue); + + /** set LossyImageCompressionMethod (0028,2114) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionMethod(const OFString &value, const OFBool check = OFTrue); + + /** set LossyImageCompressionRatio (0028,2112) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLossyImageCompressionRatio(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredAPDimension (0010,1023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredAPDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredLateralDimension (0010,1024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredLateralDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MedicalAlerts (0010,2000) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMedicalAlerts(const OFString &value, const OFBool check = OFTrue); + + /** set MetersetExposure (3002,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMetersetExposure(const OFString &value, const OFBool check = OFTrue); + + /** set Modality (0008,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, const OFBool check = OFTrue); + + /** set NameOfPhysiciansReadingStudy (0008,1060) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFrames (0028,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNumberOfFrames(const OFString &value, const OFBool check = OFTrue); + + /** set Occupation (0010,2180) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOccupation(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OriginalSpecializedSOPClassUID (0008,001b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set OtherPatientNames (0010,1001) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOtherPatientNames(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAge (0010,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAlternativeCalendar (0010,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDate (0010,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthTime (0010,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthTime(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBodyMassIndex (0010,1022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBodyMassIndex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBreedDescription (0010,2292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBreedDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientComments (0010,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientComments(const OFString &value, const OFBool check = OFTrue); + + /** set PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientIdentityRemoved (0012,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientIdentityRemoved(const OFString &value, const OFBool check = OFTrue); + + /** set PatientName (0010,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, const OFBool check = OFTrue); + + /** set PatientOrientation (0020,0020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set PatientPosition (0018,5100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientPosition(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSex (0010,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSexNeutered (0010,2203) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSexNeutered(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSize (0010,1020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSpeciesDescription (0010,2201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSpeciesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientState (0038,0500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientState(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAngle (300a,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSupportAngle(const OFString &value, const OFBool check = OFTrue); + + /** set PatientWeight (0010,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepDescription (0040,0254) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndDate (0040,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndTime (0040,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndTime(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepID (0040,0253) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartDate (0040,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartTime (0040,0245) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set PhotometricInterpretation (0028,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhotometricInterpretation(const OFString &value, const OFBool check = OFTrue); + + /** set PhysiciansOfRecord (0008,1048) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhysiciansOfRecord(const OFString &value, const OFBool check = OFTrue); + + /** set PixelAspectRatio (0028,0034) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelAspectRatio(const OFString &value, const OFBool check = OFTrue); + + /** set PixelDataProviderURL (0028,7fe0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelDataProviderURL(const OFString &value, const OFBool check = OFTrue); + + /** set PixelIntensityRelationship (0028,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelIntensityRelationship(const OFString &value, const OFBool check = OFTrue); + + /** set PixelIntensityRelationshipSign (0028,1041) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelIntensityRelationshipSign(const Sint16 value, const unsigned long pos = 0); + + /** set PixelPaddingRangeLimit (0028,0121) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingRangeLimit(const Uint16 value, const unsigned long pos = 0); + + /** set PixelPaddingValue (0028,0120) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingValue(const Uint16 value, const unsigned long pos = 0); + + /** set PixelRepresentation (0028,0103) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelRepresentation(const Uint16 value, const unsigned long pos = 0); + + /** set PlanarConfiguration (0028,0006) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPlanarConfiguration(const Uint16 value, const unsigned long pos = 0); + + /** set PositionReferenceIndicator (0020,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPositionReferenceIndicator(const OFString &value, const OFBool check = OFTrue); + + /** set PreferredPlaybackSequencing (0018,1244) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPreferredPlaybackSequencing(const Uint16 value, const unsigned long pos = 0); + + /** set PregnancyStatus (0010,21c0) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPregnancyStatus(const Uint16 value, const unsigned long pos = 0); + + /** set PresentationLUTShape (2050,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPresentationLUTShape(const OFString &value, const OFBool check = OFTrue); + + /** set PrimaryDosimeterUnit (300a,00b3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPrimaryDosimeterUnit(const OFString &value, const OFBool check = OFTrue); + + /** set QualityControlImage (0028,0300) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlImage(const OFString &value, const OFBool check = OFTrue); + + /** set QualityControlSubject (0010,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlSubject(const OFString &value, const OFBool check = OFTrue); + + /** set QueryRetrieveView (0008,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQueryRetrieveView(const OFString &value, const OFBool check = OFTrue); + + /** set RTImageDescription (3002,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTImageDescription(const OFString &value, const OFBool check = OFTrue); + + /** set RTImageLabel (3002,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTImageLabel(const OFString &value, const OFBool check = OFTrue); + + /** set RTImageName (3002,0003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTImageName(const OFString &value, const OFBool check = OFTrue); + + /** set RTImageOrientation (3002,0010) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (6) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTImageOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set RTImagePlane (3002,000c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTImagePlane(const OFString &value, const OFBool check = OFTrue); + + /** set RTImagePosition (3002,0012) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTImagePosition(const OFString &value, const OFBool check = OFTrue); + + /** set RTImageSID (3002,0026) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTImageSID(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationMachineName (3002,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRadiationMachineName(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationMachineSAD (3002,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRadiationMachineSAD(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationMachineSSD (3002,0024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRadiationMachineSSD(const OFString &value, const OFBool check = OFTrue); + + /** set RecognizableVisualFeatures (0028,0302) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecognizableVisualFeatures(const OFString &value, const OFBool check = OFTrue); + + /** set RecommendedDisplayFrameRate (0008,2144) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecommendedDisplayFrameRate(const OFString &value, const OFBool check = OFTrue); + + /** set RedPaletteColorLookupTableData (0028,1201) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRedPaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set RedPaletteColorLookupTableDescriptor (0028,1101) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRedPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set ReferencedBeamNumber (300c,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferencedBeamNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedFractionGroupNumber (300c,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferencedFractionGroupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferringPhysicianName (0008,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set RelatedGeneralSOPClassUID (0008,001a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReportedValuesOrigin (3002,000a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReportedValuesOrigin(const OFString &value, const OFBool check = OFTrue); + + /** set RescaleIntercept (0028,1052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleIntercept(const OFString &value, const OFBool check = OFTrue); + + /** set RescaleSlope (0028,1053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleSlope(const OFString &value, const OFBool check = OFTrue); + + /** set RescaleType (0028,1054) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRescaleType(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsibleOrganization (0010,2299) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePerson (0010,2297) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePerson(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePersonRole (0010,2298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePersonRole(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewDate (300e,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewDate(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewTime (300e,0005) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewTime(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewerName (300e,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewerName(const OFString &value, const OFBool check = OFTrue); + + /** set Rows (0028,0010) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRows(const Uint16 value, const unsigned long pos = 0); + + /** set SOPAuthorizationComment (0100,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationComment(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationDateTime (0100,0420) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set SOPClassUID (0008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceStatus (0100,0410) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceUID (0008,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SamplesPerPixel (0028,0002) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSamplesPerPixel(const Uint16 value, const unsigned long pos = 0); + + /** set SeriesDate (0008,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDescription (0008,103e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesNumber (0020,0011) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesTime (0008,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeDescription (0038,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeID (0038,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeID(const OFString &value, const OFBool check = OFTrue); + + /** set SmallestImagePixelValue (0028,0106) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmallestImagePixelValue(const Uint16 value, const unsigned long pos = 0); + + /** set SmokingStatus (0010,21a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmokingStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToReferenceObjectDistance (3002,0028) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSourceToReferenceObjectDistance(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set SpecificCharacterSet (0008,0005) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, const OFBool check = OFTrue); + + /** set StartCumulativeMetersetWeight (300c,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStartCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set StartTrim (0008,2142) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStartTrim(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set StereoPairsPresent (0022,0028) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStereoPairsPresent(const OFString &value, const OFBool check = OFTrue); + + /** set StopTrim (0008,2143) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStopTrim(const OFString &value, const OFBool check = OFTrue); + + /** set StrainAdditionalInformation (0010,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainAdditionalInformation(const OFString &value, const OFBool check = OFTrue); + + /** set StrainDescription (0010,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StrainNomenclature (0010,0213) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainNomenclature(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDate (0008,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDescription (0008,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StudyID (0020,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyTime (0008,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopEccentricAngle (300a,0125) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableTopEccentricAngle(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopEccentricAxisDistance (300a,0124) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableTopEccentricAxisDistance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLateralPosition (300a,012a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableTopLateralPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalPosition (300a,0129) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableTopLongitudinalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopPitchAngle (300a,0140) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableTopPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopRollAngle (300a,0144) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableTopRollAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopVerticalPosition (300a,0128) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTableTopVerticalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set TimezoneOffsetFromUTC (0008,0201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, const OFBool check = OFTrue); + + /** set VOILUTFunction (0028,1056) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setVOILUTFunction(const OFString &value, const OFBool check = OFTrue); + + /** set WindowCenter (0028,1050) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setWindowCenter(const OFString &value, const OFBool check = OFTrue); + + /** set WindowCenterWidthExplanation (0028,1055) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setWindowCenterWidthExplanation(const OFString &value, const OFBool check = OFTrue); + + /** set WindowWidth (0028,1051) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setWindowWidth(const OFString &value, const OFBool check = OFTrue); + + /** set XRayImageReceptorAngle (3002,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setXRayImageReceptorAngle(const OFString &value, const OFBool check = OFTrue); + + /** set XRayImageReceptorTranslation (3002,000d) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setXRayImageReceptorTranslation(const OFString &value, const OFBool check = OFTrue); + + + protected: + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attribute + * SOPClassUID (0008,0016) with the expected value. Any incorrectness regarding + * this attribute is reported to the log stream (if enabled for error messages). + * @param dataset DICOM dataset to be checked + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset); + + /** update various DICOM attributes + */ + void updateAttributes(); + + private: + + // DICOM attributes are listed ordered by module + + // --- PatientModule (M) --- + + /// PatientName (0010,0010) vr=PN, vm=1, type=2 + DcmPersonName PatientName; + /// PatientID (0010,0020) vr=LO, vm=1, type=2 + DcmLongString PatientID; + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientBirthDate (0010,0030) vr=DA, vm=1, type=2 + DcmDate PatientBirthDate; + /// PatientBirthDateInAlternativeCalendar (0010,0033) vr=LO, vm=1, type=3 + DcmLongString PatientBirthDateInAlternativeCalendar; + /// PatientDeathDateInAlternativeCalendar (0010,0034) vr=LO, vm=1, type=3 + DcmLongString PatientDeathDateInAlternativeCalendar; + /// PatientAlternativeCalendar (0010,0035) vr=CS, vm=1, type=1C + DcmCodeString PatientAlternativeCalendar; + /// PatientSex (0010,0040) vr=CS, vm=1, type=2 + DcmCodeString PatientSex; + /// ReferencedPatientPhotoSequence (0010,1100) vr=SQ, vm=1, type=3 + DRTReferencedPatientPhotoSequence ReferencedPatientPhotoSequence; + /// QualityControlSubject (0010,0200) vr=CS, vm=1, type=3 + DcmCodeString QualityControlSubject; + /// ReferencedPatientSequence (0008,1120) vr=SQ, vm=1, type=3 + DRTReferencedPatientSequence ReferencedPatientSequence; + /// PatientBirthTime (0010,0032) vr=TM, vm=1, type=3 + DcmTime PatientBirthTime; + /// OtherPatientIDsSequence (0010,1002) vr=SQ, vm=1, type=3 + DRTOtherPatientIDsSequence OtherPatientIDsSequence; + /// OtherPatientNames (0010,1001) vr=PN, vm=1-n, type=3 + DcmPersonName OtherPatientNames; + /// EthnicGroup (0010,2160) vr=SH, vm=1, type=3 + DcmShortString EthnicGroup; + /// PatientComments (0010,4000) vr=LT, vm=1, type=3 + DcmLongText PatientComments; + /// PatientSpeciesDescription (0010,2201) vr=LO, vm=1, type=1C + DcmLongString PatientSpeciesDescription; + /// PatientSpeciesCodeSequence (0010,2202) vr=SQ, vm=1, type=1C + DRTPatientSpeciesCodeSequence PatientSpeciesCodeSequence; + /// PatientBreedDescription (0010,2292) vr=LO, vm=1, type=2C + DcmLongString PatientBreedDescription; + /// PatientBreedCodeSequence (0010,2293) vr=SQ, vm=1, type=2C + DRTPatientBreedCodeSequence PatientBreedCodeSequence; + /// BreedRegistrationSequence (0010,2294) vr=SQ, vm=1, type=2C + DRTBreedRegistrationSequence BreedRegistrationSequence; + /// StrainDescription (0010,0212) vr=UC, vm=1, type=3 + DcmUnlimitedCharacters StrainDescription; + /// StrainNomenclature (0010,0213) vr=LO, vm=1, type=3 + DcmLongString StrainNomenclature; + /// StrainCodeSequence (0010,0219) vr=SQ, vm=1, type=3 + DRTStrainCodeSequence StrainCodeSequence; + /// StrainAdditionalInformation (0010,0218) vr=UT, vm=1, type=3 + DcmUnlimitedText StrainAdditionalInformation; + /// StrainStockSequence (0010,0216) vr=SQ, vm=1, type=3 + DRTStrainStockSequence StrainStockSequence; + /// GeneticModificationsSequence (0010,0221) vr=SQ, vm=1, type=3 + DRTGeneticModificationsSequence GeneticModificationsSequence; + /// ResponsiblePerson (0010,2297) vr=PN, vm=1, type=2C + DcmPersonName ResponsiblePerson; + /// ResponsiblePersonRole (0010,2298) vr=CS, vm=1, type=1C + DcmCodeString ResponsiblePersonRole; + /// ResponsibleOrganization (0010,2299) vr=LO, vm=1, type=2C + DcmLongString ResponsibleOrganization; + /// PatientIdentityRemoved (0012,0062) vr=CS, vm=1, type=3 + DcmCodeString PatientIdentityRemoved; + /// DeidentificationMethod (0012,0063) vr=LO, vm=1-n, type=1C + DcmLongString DeidentificationMethod; + /// DeidentificationMethodCodeSequence (0012,0064) vr=SQ, vm=1, type=1C + DRTDeidentificationMethodCodeSequence DeidentificationMethodCodeSequence; + /// SourcePatientGroupIdentificationSequence (0010,0026) vr=SQ, vm=1, type=3 + DRTSourcePatientGroupIdentificationSequence SourcePatientGroupIdentificationSequence; + /// GroupOfPatientsIdentificationSequence (0010,0027) vr=SQ, vm=1, type=3 + DRTGroupOfPatientsIdentificationSequence GroupOfPatientsIdentificationSequence; + + // --- ClinicalTrialSubjectModule (U) --- + + /// ClinicalTrialSponsorName (0012,0010) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialSponsorName; + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialProtocolID; + /// ClinicalTrialProtocolName (0012,0021) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialProtocolName; + /// ClinicalTrialSiteID (0012,0030) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteID; + /// ClinicalTrialSiteName (0012,0031) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteName; + /// ClinicalTrialSubjectID (0012,0040) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectID; + /// ClinicalTrialSubjectReadingID (0012,0042) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectReadingID; + /// ClinicalTrialProtocolEthicsCommitteeName (0012,0081) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolEthicsCommitteeName; + /// ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + + // --- GeneralStudyModule (M) --- + + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + /// StudyDate (0008,0020) vr=DA, vm=1, type=2 + DcmDate StudyDate; + /// StudyTime (0008,0030) vr=TM, vm=1, type=2 + DcmTime StudyTime; + /// ReferringPhysicianName (0008,0090) vr=PN, vm=1, type=2 + DcmPersonName ReferringPhysicianName; + /// ReferringPhysicianIdentificationSequence (0008,0096) vr=SQ, vm=1, type=3 + DRTReferringPhysicianIdentificationSequence ReferringPhysicianIdentificationSequence; + /// ConsultingPhysicianName (0008,009c) vr=PN, vm=1-n, type=3 + DcmPersonName ConsultingPhysicianName; + /// ConsultingPhysicianIdentificationSequence (0008,009d) vr=SQ, vm=1, type=3 + DRTConsultingPhysicianIdentificationSequence ConsultingPhysicianIdentificationSequence; + /// StudyID (0020,0010) vr=SH, vm=1, type=2 + DcmShortString StudyID; + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=2 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// StudyDescription (0008,1030) vr=LO, vm=1, type=3 + DcmLongString StudyDescription; + /// PhysiciansOfRecord (0008,1048) vr=PN, vm=1-n, type=3 + DcmPersonName PhysiciansOfRecord; + /// PhysiciansOfRecordIdentificationSequence (0008,1049) vr=SQ, vm=1, type=3 + DRTPhysiciansOfRecordIdentificationSequence PhysiciansOfRecordIdentificationSequence; + /// NameOfPhysiciansReadingStudy (0008,1060) vr=PN, vm=1-n, type=3 + DcmPersonName NameOfPhysiciansReadingStudy; + /// PhysiciansReadingStudyIdentificationSequence (0008,1062) vr=SQ, vm=1, type=3 + DRTPhysiciansReadingStudyIdentificationSequence PhysiciansReadingStudyIdentificationSequence; + /// RequestingServiceCodeSequence (0032,1034) vr=SQ, vm=1, type=3 + DRTRequestingServiceCodeSequence RequestingServiceCodeSequence; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// ProcedureCodeSequence (0008,1032) vr=SQ, vm=1, type=3 + DRTProcedureCodeSequence ProcedureCodeSequence; + /// ReasonForPerformedProcedureCodeSequence (0040,1012) vr=SQ, vm=1, type=3 + DRTReasonForPerformedProcedureCodeSequence ReasonForPerformedProcedureCodeSequence; + + // --- PatientStudyModule (U) --- + + /// AdmittingDiagnosesDescription (0008,1080) vr=LO, vm=1-n, type=3 + DcmLongString AdmittingDiagnosesDescription; + /// AdmittingDiagnosesCodeSequence (0008,1084) vr=SQ, vm=1, type=3 + DRTAdmittingDiagnosesCodeSequence AdmittingDiagnosesCodeSequence; + /// PatientAge (0010,1010) vr=AS, vm=1, type=3 + DcmAgeString PatientAge; + /// PatientSize (0010,1020) vr=DS, vm=1, type=3 + DcmDecimalString PatientSize; + /// PatientWeight (0010,1030) vr=DS, vm=1, type=3 + DcmDecimalString PatientWeight; + /// PatientBodyMassIndex (0010,1022) vr=DS, vm=1, type=3 + DcmDecimalString PatientBodyMassIndex; + /// MeasuredAPDimension (0010,1023) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredAPDimension; + /// MeasuredLateralDimension (0010,1024) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredLateralDimension; + /// PatientSizeCodeSequence (0010,1021) vr=SQ, vm=1, type=3 + DRTPatientSizeCodeSequence PatientSizeCodeSequence; + /// MedicalAlerts (0010,2000) vr=LO, vm=1-n, type=3 + DcmLongString MedicalAlerts; + /// Allergies (0010,2110) vr=LO, vm=1-n, type=3 + DcmLongString Allergies; + /// SmokingStatus (0010,21a0) vr=CS, vm=1, type=3 + DcmCodeString SmokingStatus; + /// PregnancyStatus (0010,21c0) vr=US, vm=1, type=3 + DcmUnsignedShort PregnancyStatus; + /// LastMenstrualDate (0010,21d0) vr=DA, vm=1, type=3 + DcmDate LastMenstrualDate; + /// PatientState (0038,0500) vr=LO, vm=1, type=3 + DcmLongString PatientState; + /// Occupation (0010,2180) vr=SH, vm=1, type=3 + DcmShortString Occupation; + /// AdditionalPatientHistory (0010,21b0) vr=LT, vm=1, type=3 + DcmLongText AdditionalPatientHistory; + /// AdmissionID (0038,0010) vr=LO, vm=1, type=3 + DcmLongString AdmissionID; + /// IssuerOfAdmissionIDSequence (0038,0014) vr=SQ, vm=1, type=3 + DRTIssuerOfAdmissionIDSequence IssuerOfAdmissionIDSequence; + /// ServiceEpisodeID (0038,0060) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeID; + /// IssuerOfServiceEpisodeIDSequence (0038,0064) vr=SQ, vm=1, type=3 + DRTIssuerOfServiceEpisodeIDSequence IssuerOfServiceEpisodeIDSequence; + /// ServiceEpisodeDescription (0038,0062) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeDescription; + /// PatientSexNeutered (0010,2203) vr=CS, vm=1, type=2C + DcmCodeString PatientSexNeutered; + + // --- ClinicalTrialStudyModule (U) --- + + /// ClinicalTrialTimePointID (0012,0050) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialTimePointID; + /// ClinicalTrialTimePointDescription (0012,0051) vr=ST, vm=1, type=3 + DcmShortText ClinicalTrialTimePointDescription; + /// LongitudinalTemporalOffsetFromEvent (0012,0052) vr=FD, vm=1, type=3 + DcmFloatingPointDouble LongitudinalTemporalOffsetFromEvent; + /// LongitudinalTemporalEventType (0012,0053) vr=CS, vm=1, type=1C + DcmCodeString LongitudinalTemporalEventType; + /// ConsentForClinicalTrialUseSequence (0012,0083) vr=SQ, vm=1, type=3 + DRTConsentForClinicalTrialUseSequence ConsentForClinicalTrialUseSequence; + + // --- RTSeriesModule (M) --- + + /// Modality (0008,0060) vr=CS, vm=1, type=1 + DcmCodeString Modality; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + /// SeriesNumber (0020,0011) vr=IS, vm=1, type=2 + DcmIntegerString SeriesNumber; + /// SeriesDate (0008,0021) vr=DA, vm=1, type=3 + DcmDate SeriesDate; + /// SeriesTime (0008,0031) vr=TM, vm=1, type=3 + DcmTime SeriesTime; + /// SeriesDescription (0008,103e) vr=LO, vm=1, type=3 + DcmLongString SeriesDescription; + /// SeriesDescriptionCodeSequence (0008,103f) vr=SQ, vm=1, type=3 + DRTSeriesDescriptionCodeSequence SeriesDescriptionCodeSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// ReferencedPerformedProcedureStepSequence (0008,1111) vr=SQ, vm=1, type=3 + DRTReferencedPerformedProcedureStepSequence ReferencedPerformedProcedureStepSequence; + /// RequestAttributesSequence (0040,0275) vr=SQ, vm=1, type=3 + DRTRequestAttributesSequence RequestAttributesSequence; + /// PerformedProcedureStepID (0040,0253) vr=SH, vm=1, type=3 + DcmShortString PerformedProcedureStepID; + /// PerformedProcedureStepStartDate (0040,0244) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepStartDate; + /// PerformedProcedureStepStartTime (0040,0245) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepStartTime; + /// PerformedProcedureStepEndDate (0040,0250) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepEndDate; + /// PerformedProcedureStepEndTime (0040,0251) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepEndTime; + /// PerformedProcedureStepDescription (0040,0254) vr=LO, vm=1, type=3 + DcmLongString PerformedProcedureStepDescription; + /// PerformedProtocolCodeSequence (0040,0260) vr=SQ, vm=1, type=3 + DRTPerformedProtocolCodeSequence PerformedProtocolCodeSequence; + /// CommentsOnThePerformedProcedureStep (0040,0280) vr=ST, vm=1, type=3 + DcmShortText CommentsOnThePerformedProcedureStep; + + // --- ClinicalTrialSeriesModule (U) --- + + /// ClinicalTrialCoordinatingCenterName (0012,0060) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialCoordinatingCenterName; + /// ClinicalTrialSeriesID (0012,0071) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesID; + /// ClinicalTrialSeriesDescription (0012,0072) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesDescription; + + // --- FrameOfReferenceModule (U) --- + + /// FrameOfReferenceUID (0020,0052) vr=UI, vm=1, type=1 + DcmUniqueIdentifier FrameOfReferenceUID; + /// PositionReferenceIndicator (0020,1040) vr=LO, vm=1, type=2 + DcmLongString PositionReferenceIndicator; + + // --- GeneralEquipmentModule (M) --- + + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// GantryID (0018,1008) vr=LO, vm=1, type=3 + DcmLongString GantryID; + /// UDISequence (0018,100a) vr=SQ, vm=1, type=3 + DRTUDISequence UDISequence; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + /// PixelPaddingValue (0028,0120) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingValue; + + // --- GeneralImageModule (M) --- + + /// InstanceNumber (0020,0013) vr=IS, vm=1, type=2 + /// - also defined in: SOPCommonModule + DcmIntegerString InstanceNumber; + /// PatientOrientation (0020,0020) vr=CS, vm=2, type=2C + DcmCodeString PatientOrientation; + /// ContentDate (0008,0023) vr=DA, vm=1, type=2C + DcmDate ContentDate; + /// ContentTime (0008,0033) vr=TM, vm=1, type=2C + DcmTime ContentTime; + // ImageType (0008,0008) vr=CS, vm=2-n, type=3 + // - also defined in: RTImageModule + // DcmCodeString ImageType; + /// AcquisitionNumber (0020,0012) vr=IS, vm=1, type=3 + DcmIntegerString AcquisitionNumber; + /// AcquisitionDate (0008,0022) vr=DA, vm=1, type=3 + DcmDate AcquisitionDate; + /// AcquisitionTime (0008,0032) vr=TM, vm=1, type=3 + DcmTime AcquisitionTime; + /// AcquisitionDateTime (0008,002a) vr=DT, vm=1, type=3 + DcmDateTime AcquisitionDateTime; + /// ImagesInAcquisition (0020,1002) vr=IS, vm=1, type=3 + DcmIntegerString ImagesInAcquisition; + /// ImageComments (0020,4000) vr=LT, vm=1, type=3 + DcmLongText ImageComments; + /// QualityControlImage (0028,0300) vr=CS, vm=1, type=3 + DcmCodeString QualityControlImage; + /// BurnedInAnnotation (0028,0301) vr=CS, vm=1, type=3 + DcmCodeString BurnedInAnnotation; + /// RecognizableVisualFeatures (0028,0302) vr=CS, vm=1, type=3 + DcmCodeString RecognizableVisualFeatures; + /// LossyImageCompression (0028,2110) vr=CS, vm=1, type=3 + DcmCodeString LossyImageCompression; + /// LossyImageCompressionRatio (0028,2112) vr=DS, vm=1-n, type=3 + DcmDecimalString LossyImageCompressionRatio; + /// LossyImageCompressionMethod (0028,2114) vr=CS, vm=1-n, type=3 + DcmCodeString LossyImageCompressionMethod; + /// IconImageSequence (0088,0200) vr=SQ, vm=1, type=3 + DRTIconImageSequence IconImageSequence; + /// PresentationLUTShape (2050,0020) vr=CS, vm=1, type=3 + DcmCodeString PresentationLUTShape; + /// IrradiationEventUID (0008,3010) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier IrradiationEventUID; + /// RealWorldValueMappingSequence (0040,9096) vr=SQ, vm=1, type=3 + DRTRealWorldValueMappingSequence RealWorldValueMappingSequence; + + // --- GeneralReferenceModule (U) --- + + /// ReferencedImageSequence (0008,1140) vr=SQ, vm=1, type=3 + DRTReferencedImageSequence ReferencedImageSequence; + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=3 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + /// DerivationDescription (0008,2111) vr=ST, vm=1, type=3 + DcmShortText DerivationDescription; + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// SourceImageSequence (0008,2112) vr=SQ, vm=1, type=3 + DRTSourceImageSequence SourceImageSequence; + /// SourceInstanceSequence (0042,0013) vr=SQ, vm=1, type=3 + DRTSourceInstanceSequence SourceInstanceSequence; + + // --- ImagePixelModule (M) --- + + // SamplesPerPixel (0028,0002) vr=US, vm=1, type=1 + // - also defined in: RTImageModule + // DcmUnsignedShort SamplesPerPixel; + // PhotometricInterpretation (0028,0004) vr=CS, vm=1, type=1 + // - also defined in: RTImageModule + // DcmCodeString PhotometricInterpretation; + /// Rows (0028,0010) vr=US, vm=1, type=1 + DcmUnsignedShort Rows; + /// Columns (0028,0011) vr=US, vm=1, type=1 + DcmUnsignedShort Columns; + // BitsAllocated (0028,0100) vr=US, vm=1, type=1 + // - also defined in: RTImageModule + // DcmUnsignedShort BitsAllocated; + // BitsStored (0028,0101) vr=US, vm=1, type=1 + // - also defined in: RTImageModule + // DcmUnsignedShort BitsStored; + // HighBit (0028,0102) vr=US, vm=1, type=1 + // - also defined in: RTImageModule + // DcmUnsignedShort HighBit; + // PixelRepresentation (0028,0103) vr=US, vm=1, type=1 + // - also defined in: RTImageModule + // DcmUnsignedShort PixelRepresentation; + /// PlanarConfiguration (0028,0006) vr=US, vm=1, type=1C + DcmUnsignedShort PlanarConfiguration; + /// PixelAspectRatio (0028,0034) vr=IS, vm=2, type=1C + DcmIntegerString PixelAspectRatio; + /// SmallestImagePixelValue (0028,0106) vr=US/SS, vm=1, type=3 + DcmUnsignedShort SmallestImagePixelValue; + /// LargestImagePixelValue (0028,0107) vr=US/SS, vm=1, type=3 + DcmUnsignedShort LargestImagePixelValue; + /// RedPaletteColorLookupTableDescriptor (0028,1101) vr=US/SS, vm=3, type=1C + DcmUnsignedShort RedPaletteColorLookupTableDescriptor; + /// GreenPaletteColorLookupTableDescriptor (0028,1102) vr=US/SS, vm=3, type=1C + DcmUnsignedShort GreenPaletteColorLookupTableDescriptor; + /// BluePaletteColorLookupTableDescriptor (0028,1103) vr=US/SS, vm=3, type=1C + DcmUnsignedShort BluePaletteColorLookupTableDescriptor; + /// RedPaletteColorLookupTableData (0028,1201) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord RedPaletteColorLookupTableData; + /// GreenPaletteColorLookupTableData (0028,1202) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord GreenPaletteColorLookupTableData; + /// BluePaletteColorLookupTableData (0028,1203) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord BluePaletteColorLookupTableData; + /// ICCProfile (0028,2000) vr=OB, vm=1, type=3 + DcmOtherByteOtherWord ICCProfile; + /// ColorSpace (0028,2002) vr=CS, vm=1, type=3 + DcmCodeString ColorSpace; + /// PixelData (7fe0,0010) vr=OB/OW, vm=1, type=1C + DcmPixelData PixelData; + /// PixelDataProviderURL (0028,7fe0) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator PixelDataProviderURL; + /// PixelPaddingRangeLimit (0028,0121) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingRangeLimit; + + // --- ContrastBolusModule (C) --- + + /// ContrastBolusAgent (0018,0010) vr=LO, vm=1, type=2 + DcmLongString ContrastBolusAgent; + /// ContrastBolusAgentSequence (0018,0012) vr=SQ, vm=1, type=3 + DRTContrastBolusAgentSequence ContrastBolusAgentSequence; + /// ContrastBolusRoute (0018,1040) vr=LO, vm=1, type=3 + DcmLongString ContrastBolusRoute; + /// ContrastBolusAdministrationRouteSequence (0018,0014) vr=SQ, vm=1, type=3 + DRTContrastBolusAdministrationRouteSequence ContrastBolusAdministrationRouteSequence; + /// ContrastBolusVolume (0018,1041) vr=DS, vm=1, type=3 + DcmDecimalString ContrastBolusVolume; + /// ContrastBolusStartTime (0018,1042) vr=TM, vm=1, type=3 + DcmTime ContrastBolusStartTime; + /// ContrastBolusStopTime (0018,1043) vr=TM, vm=1, type=3 + DcmTime ContrastBolusStopTime; + /// ContrastBolusTotalDose (0018,1044) vr=DS, vm=1, type=3 + DcmDecimalString ContrastBolusTotalDose; + /// ContrastFlowRate (0018,1046) vr=DS, vm=1-n, type=3 + DcmDecimalString ContrastFlowRate; + /// ContrastFlowDuration (0018,1047) vr=DS, vm=1-n, type=3 + DcmDecimalString ContrastFlowDuration; + /// ContrastBolusIngredient (0018,1048) vr=CS, vm=1, type=3 + DcmCodeString ContrastBolusIngredient; + /// ContrastBolusIngredientConcentration (0018,1049) vr=DS, vm=1, type=3 + DcmDecimalString ContrastBolusIngredientConcentration; + + // --- CineModule (C) --- + + /// PreferredPlaybackSequencing (0018,1244) vr=US, vm=1, type=3 + DcmUnsignedShort PreferredPlaybackSequencing; + /// FrameTime (0018,1063) vr=DS, vm=1, type=1C + DcmDecimalString FrameTime; + /// FrameTimeVector (0018,1065) vr=DS, vm=1-n, type=1C + DcmDecimalString FrameTimeVector; + /// StartTrim (0008,2142) vr=IS, vm=1, type=3 + DcmIntegerString StartTrim; + /// StopTrim (0008,2143) vr=IS, vm=1, type=3 + DcmIntegerString StopTrim; + /// RecommendedDisplayFrameRate (0008,2144) vr=IS, vm=1, type=3 + DcmIntegerString RecommendedDisplayFrameRate; + /// CineRate (0018,0040) vr=IS, vm=1, type=3 + DcmIntegerString CineRate; + /// FrameDelay (0018,1066) vr=DS, vm=1, type=3 + DcmDecimalString FrameDelay; + /// ImageTriggerDelay (0018,1067) vr=DS, vm=1, type=3 + DcmDecimalString ImageTriggerDelay; + /// EffectiveDuration (0018,0072) vr=DS, vm=1, type=3 + DcmDecimalString EffectiveDuration; + /// ActualFrameDuration (0018,1242) vr=IS, vm=1, type=3 + DcmIntegerString ActualFrameDuration; + /// MultiplexedAudioChannelsDescriptionCodeSequence (003a,0300) vr=SQ, vm=1, type=2C + DRTMultiplexedAudioChannelsDescriptionCodeSequence MultiplexedAudioChannelsDescriptionCodeSequence; + + // --- MultiFrameModule (C) --- + + /// NumberOfFrames (0028,0008) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfFrames; + /// FrameIncrementPointer (0028,0009) vr=AT, vm=1-n, type=1 + DcmAttributeTag FrameIncrementPointer; + /// StereoPairsPresent (0022,0028) vr=CS, vm=1, type=3 + DcmCodeString StereoPairsPresent; + + // --- DeviceModule (U) --- + + /// DeviceSequence (0050,0010) vr=SQ, vm=1, type=1 + DRTDeviceSequence DeviceSequence; + + // --- RTImageModule (M) --- + + /// SamplesPerPixel (0028,0002) vr=US, vm=1, type=1 + /// - also defined in: ImagePixelModule + DcmUnsignedShort SamplesPerPixel; + /// PhotometricInterpretation (0028,0004) vr=CS, vm=1, type=1 + /// - also defined in: ImagePixelModule + DcmCodeString PhotometricInterpretation; + /// BitsAllocated (0028,0100) vr=US, vm=1, type=1 + /// - also defined in: ImagePixelModule + DcmUnsignedShort BitsAllocated; + /// BitsStored (0028,0101) vr=US, vm=1, type=1 + /// - also defined in: ImagePixelModule + DcmUnsignedShort BitsStored; + /// HighBit (0028,0102) vr=US, vm=1, type=1 + /// - also defined in: ImagePixelModule + DcmUnsignedShort HighBit; + /// PixelRepresentation (0028,0103) vr=US, vm=1, type=1 + /// - also defined in: ImagePixelModule + DcmUnsignedShort PixelRepresentation; + /// PixelIntensityRelationship (0028,1040) vr=CS, vm=1, type=3 + DcmCodeString PixelIntensityRelationship; + /// PixelIntensityRelationshipSign (0028,1041) vr=SS, vm=1, type=1C + DcmSignedShort PixelIntensityRelationshipSign; + /// RTImageLabel (3002,0002) vr=SH, vm=1, type=1 + DcmShortString RTImageLabel; + /// RTImageName (3002,0003) vr=LO, vm=1, type=3 + DcmLongString RTImageName; + /// RTImageDescription (3002,0004) vr=ST, vm=1, type=3 + DcmShortText RTImageDescription; + /// ImageType (0008,0008) vr=CS, vm=2-n, type=1 + /// - also defined in: GeneralImageModule + DcmCodeString ImageType; + /// ConversionType (0008,0064) vr=CS, vm=1, type=2 + DcmCodeString ConversionType; + /// ReportedValuesOrigin (3002,000a) vr=CS, vm=1, type=2C + DcmCodeString ReportedValuesOrigin; + /// RTImagePlane (3002,000c) vr=CS, vm=1, type=1 + DcmCodeString RTImagePlane; + /// XRayImageReceptorTranslation (3002,000d) vr=DS, vm=3, type=3 + DcmDecimalString XRayImageReceptorTranslation; + /// XRayImageReceptorAngle (3002,000e) vr=DS, vm=1, type=2 + DcmDecimalString XRayImageReceptorAngle; + /// RTImageOrientation (3002,0010) vr=DS, vm=6, type=2C + DcmDecimalString RTImageOrientation; + /// ImagePlanePixelSpacing (3002,0011) vr=DS, vm=2, type=2 + DcmDecimalString ImagePlanePixelSpacing; + /// RTImagePosition (3002,0012) vr=DS, vm=2, type=2 + DcmDecimalString RTImagePosition; + /// RadiationMachineName (3002,0020) vr=SH, vm=1, type=2 + DcmShortString RadiationMachineName; + /// PrimaryDosimeterUnit (300a,00b3) vr=CS, vm=1, type=2 + DcmCodeString PrimaryDosimeterUnit; + /// RadiationMachineSAD (3002,0022) vr=DS, vm=1, type=2 + DcmDecimalString RadiationMachineSAD; + /// RadiationMachineSSD (3002,0024) vr=DS, vm=1, type=3 + DcmDecimalString RadiationMachineSSD; + /// RTImageSID (3002,0026) vr=DS, vm=1, type=2 + DcmDecimalString RTImageSID; + /// SourceToReferenceObjectDistance (3002,0028) vr=DS, vm=1, type=3 + DcmDecimalString SourceToReferenceObjectDistance; + /// ReferencedRTPlanSequence (300c,0002) vr=SQ, vm=1, type=3 + DRTReferencedRTPlanSequenceInRTImageModule ReferencedRTPlanSequence; + /// ReferencedBeamNumber (300c,0006) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedBeamNumber; + /// ReferencedFractionGroupNumber (300c,0022) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedFractionGroupNumber; + /// FractionNumber (3002,0029) vr=IS, vm=1, type=3 + DcmIntegerString FractionNumber; + /// StartCumulativeMetersetWeight (300c,0008) vr=DS, vm=1, type=3 + DcmDecimalString StartCumulativeMetersetWeight; + /// EndCumulativeMetersetWeight (300c,0009) vr=DS, vm=1, type=3 + DcmDecimalString EndCumulativeMetersetWeight; + /// ExposureSequence (3002,0030) vr=SQ, vm=1, type=3 + DRTExposureSequence ExposureSequence; + /// FluenceMapSequence (3002,0040) vr=SQ, vm=1, type=1C + DRTFluenceMapSequence FluenceMapSequence; + /// GantryAngle (300a,011e) vr=DS, vm=1, type=3 + DcmDecimalString GantryAngle; + /// GantryPitchAngle (300a,014a) vr=FL, vm=1, type=3 + DcmFloatingPointSingle GantryPitchAngle; + /// BeamLimitingDeviceAngle (300a,0120) vr=DS, vm=1, type=3 + DcmDecimalString BeamLimitingDeviceAngle; + /// PatientSupportAngle (300a,0122) vr=DS, vm=1, type=3 + DcmDecimalString PatientSupportAngle; + /// TableTopEccentricAxisDistance (300a,0124) vr=DS, vm=1, type=3 + DcmDecimalString TableTopEccentricAxisDistance; + /// TableTopEccentricAngle (300a,0125) vr=DS, vm=1, type=3 + DcmDecimalString TableTopEccentricAngle; + /// TableTopPitchAngle (300a,0140) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopPitchAngle; + /// TableTopRollAngle (300a,0144) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopRollAngle; + /// TableTopVerticalPosition (300a,0128) vr=DS, vm=1, type=3 + DcmDecimalString TableTopVerticalPosition; + /// TableTopLongitudinalPosition (300a,0129) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLongitudinalPosition; + /// TableTopLateralPosition (300a,012a) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLateralPosition; + /// IsocenterPosition (300a,012c) vr=DS, vm=3, type=3 + DcmDecimalString IsocenterPosition; + /// PatientPosition (0018,5100) vr=CS, vm=1, type=1C + DcmCodeString PatientPosition; + /// ExposureTime (0018,1150) vr=IS, vm=1, type=3 + DcmIntegerString ExposureTime; + /// ExposureTimeInms (0018,9328) vr=FD, vm=1, type=3 + DcmFloatingPointDouble ExposureTimeInms; + /// MetersetExposure (3002,0032) vr=DS, vm=1, type=3 + DcmDecimalString MetersetExposure; + + // --- ModalityLUTModule (U) --- + + /// ModalityLUTSequence (0028,3000) vr=SQ, vm=1, type=1C + DRTModalityLUTSequence ModalityLUTSequence; + /// RescaleIntercept (0028,1052) vr=DS, vm=1, type=1C + DcmDecimalString RescaleIntercept; + /// RescaleSlope (0028,1053) vr=DS, vm=1, type=1C + DcmDecimalString RescaleSlope; + /// RescaleType (0028,1054) vr=LO, vm=1, type=1C + DcmLongString RescaleType; + + // --- VOILUTModule (U) --- + + /// VOILUTSequence (0028,3010) vr=SQ, vm=1, type=1C + DRTVOILUTSequence VOILUTSequence; + /// WindowCenter (0028,1050) vr=DS, vm=1-n, type=1C + DcmDecimalString WindowCenter; + /// WindowWidth (0028,1051) vr=DS, vm=1-n, type=1C + DcmDecimalString WindowWidth; + /// WindowCenterWidthExplanation (0028,1055) vr=LO, vm=1-n, type=3 + DcmLongString WindowCenterWidthExplanation; + /// VOILUTFunction (0028,1056) vr=CS, vm=1, type=3 + DcmCodeString VOILUTFunction; + + // --- ApprovalModule (U) --- + + /// ApprovalStatus (300e,0002) vr=CS, vm=1, type=1 + DcmCodeString ApprovalStatus; + /// ReviewDate (300e,0004) vr=DA, vm=1, type=2C + DcmDate ReviewDate; + /// ReviewTime (300e,0005) vr=TM, vm=1, type=2C + DcmTime ReviewTime; + /// ReviewerName (300e,0008) vr=PN, vm=1, type=2C + DcmPersonName ReviewerName; + + // --- SOPCommonModule (M) --- + + /// SOPClassUID (0008,0016) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPClassUID; + /// SOPInstanceUID (0008,0018) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPInstanceUID; + /// SpecificCharacterSet (0008,0005) vr=CS, vm=1-n, type=1C + DcmCodeString SpecificCharacterSet; + /// InstanceCreationDate (0008,0012) vr=DA, vm=1, type=3 + DcmDate InstanceCreationDate; + /// InstanceCreationTime (0008,0013) vr=TM, vm=1, type=3 + DcmTime InstanceCreationTime; + /// InstanceCoercionDateTime (0008,0015) vr=DT, vm=1, type=3 + DcmDateTime InstanceCoercionDateTime; + /// InstanceCreatorUID (0008,0014) vr=UI, vm=1, type=3 + DcmUniqueIdentifier InstanceCreatorUID; + /// RelatedGeneralSOPClassUID (0008,001a) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier RelatedGeneralSOPClassUID; + /// OriginalSpecializedSOPClassUID (0008,001b) vr=UI, vm=1, type=3 + DcmUniqueIdentifier OriginalSpecializedSOPClassUID; + /// CodingSchemeIdentificationSequence (0008,0110) vr=SQ, vm=1, type=3 + DRTCodingSchemeIdentificationSequence CodingSchemeIdentificationSequence; + /// ContextGroupIdentificationSequence (0008,0123) vr=SQ, vm=1, type=3 + DRTContextGroupIdentificationSequence ContextGroupIdentificationSequence; + /// MappingResourceIdentificationSequence (0008,0124) vr=SQ, vm=1, type=3 + DRTMappingResourceIdentificationSequence MappingResourceIdentificationSequence; + /// TimezoneOffsetFromUTC (0008,0201) vr=SH, vm=1, type=3 + DcmShortString TimezoneOffsetFromUTC; + /// ContributingEquipmentSequence (0018,a001) vr=SQ, vm=1, type=3 + DRTContributingEquipmentSequence ContributingEquipmentSequence; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: GeneralImageModule + // DcmIntegerString InstanceNumber; + /// SOPInstanceStatus (0100,0410) vr=CS, vm=1, type=3 + DcmCodeString SOPInstanceStatus; + /// SOPAuthorizationDateTime (0100,0420) vr=DT, vm=1, type=3 + DcmDateTime SOPAuthorizationDateTime; + /// SOPAuthorizationComment (0100,0424) vr=LT, vm=1, type=3 + DcmLongText SOPAuthorizationComment; + /// AuthorizationEquipmentCertificationNumber (0100,0426) vr=LO, vm=1, type=3 + DcmLongString AuthorizationEquipmentCertificationNumber; + /// MACParametersSequence (4ffe,0001) vr=SQ, vm=1, type=3 + DRTMACParametersSequence MACParametersSequence; + /// DigitalSignaturesSequence (fffa,fffa) vr=SQ, vm=1, type=3 + DRTDigitalSignaturesSequence DigitalSignaturesSequence; + /// EncryptedAttributesSequence (0400,0500) vr=SQ, vm=1, type=1C + DRTEncryptedAttributesSequence EncryptedAttributesSequence; + /// OriginalAttributesSequence (0400,0561) vr=SQ, vm=1, type=3 + DRTOriginalAttributesSequence OriginalAttributesSequence; + /// HL7StructuredDocumentReferenceSequence (0040,a390) vr=SQ, vm=1, type=1C + DRTHL7StructuredDocumentReferenceSequence HL7StructuredDocumentReferenceSequence; + /// LongitudinalTemporalInformationModified (0028,0303) vr=CS, vm=1, type=3 + DcmCodeString LongitudinalTemporalInformationModified; + /// QueryRetrieveView (0008,0053) vr=CS, vm=1, type=1C + DcmCodeString QueryRetrieveView; + /// ConversionSourceAttributesSequence (0020,9172) vr=SQ, vm=1, type=1C + DRTConversionSourceAttributesSequence ConversionSourceAttributesSequence; + /// ContentQualification (0018,9004) vr=CS, vm=1, type=3 + DcmCodeString ContentQualification; + /// PrivateDataElementCharacteristicsSequence (0008,0300) vr=SQ, vm=1, type=3 + DRTPrivateDataElementCharacteristicsSequence PrivateDataElementCharacteristicsSequence; + + // --- CommonInstanceReferenceModule (U) --- + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1C + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudiesContainingOtherReferencedInstancesSequence (0008,1200) vr=SQ, vm=1, type=1C + DRTStudiesContainingOtherReferencedInstancesSequence StudiesContainingOtherReferencedInstancesSequence; + + // --- FrameExtractionModule (C) --- + + /// FrameExtractionSequence (0008,1164) vr=SQ, vm=1, type=1 + DRTFrameExtractionSequence FrameExtractionSequence; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drtionpl.h b/dcmrt/include/dcmtk/dcmrt/drtionpl.h new file mode 100644 index 00000000..88698e53 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drtionpl.h @@ -0,0 +1,3323 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonPlanIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIONPL_H +#define DRTIONPL_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtadcs.h" // for AdmittingDiagnosesCodeSequence +#include "dcmtk/dcmrt/seq/drtbrs.h" // for BreedRegistrationSequence +#include "dcmtk/dcmrt/seq/drtcsis.h" // for CodingSchemeIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcctus.h" // for ConsentForClinicalTrialUseSequence +#include "dcmtk/dcmrt/seq/drtcpis.h" // for ConsultingPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcgis.h" // for ContextGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtces.h" // for ContributingEquipmentSequence +#include "dcmtk/dcmrt/seq/drtcsas.h" // for ConversionSourceAttributesSequence +#include "dcmtk/dcmrt/seq/drtdimcs.h" // for DeidentificationMethodCodeSequence +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence +#include "dcmtk/dcmrt/seq/drtdss.h" // for DigitalSignaturesSequence +#include "dcmtk/dcmrt/seq/drtdrs.h" // for DoseReferenceSequence +#include "dcmtk/dcmrt/seq/drteas.h" // for EncryptedAttributesSequence +#include "dcmtk/dcmrt/seq/drtfgs.h" // for FractionGroupSequence +#include "dcmtk/dcmrt/seq/drtgms.h" // for GeneticModificationsSequence +#include "dcmtk/dcmrt/seq/drtgpis.h" // for GroupOfPatientsIdentificationSequence +#include "dcmtk/dcmrt/seq/drthsdrs.h" // for HL7StructuredDocumentReferenceSequence +#include "dcmtk/dcmrt/seq/drtibs.h" // for IonBeamSequence +#include "dcmtk/dcmrt/seq/drtitts.h" // for IonToleranceTableSequence +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtiais.h" // for IssuerOfAdmissionIDSequence +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence +#include "dcmtk/dcmrt/seq/drtiseis.h" // for IssuerOfServiceEpisodeIDSequence +#include "dcmtk/dcmrt/seq/drtmps.h" // for MACParametersSequence +#include "dcmtk/dcmrt/seq/drtmris.h" // for MappingResourceIdentificationSequence +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtoas.h" // for OriginalAttributesSequence +#include "dcmtk/dcmrt/seq/drtopis.h" // for OtherPatientIDsSequence +#include "dcmtk/dcmrt/seq/drtpbcs.h" // for PatientBreedCodeSequence +#include "dcmtk/dcmrt/seq/drtpss.h" // for PatientSetupSequence +#include "dcmtk/dcmrt/seq/drtpsics.h" // for PatientSizeCodeSequence +#include "dcmtk/dcmrt/seq/drtpscs.h" // for PatientSpeciesCodeSequence +#include "dcmtk/dcmrt/seq/drtppcs.h" // for PerformedProtocolCodeSequence +#include "dcmtk/dcmrt/seq/drtporis.h" // for PhysiciansOfRecordIdentificationSequence +#include "dcmtk/dcmrt/seq/drtprsis.h" // for PhysiciansReadingStudyIdentificationSequence +#include "dcmtk/dcmrt/seq/drtpdecs.h" // for PrivateDataElementCharacteristicsSequence +#include "dcmtk/dcmrt/seq/drtpcs.h" // for ProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrppcs.h" // for ReasonForPerformedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrds.h" // for ReferencedDoseSequence +#include "dcmtk/dcmrt/seq/drtrims.h" // for ReferencedImageSequence +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence +#include "dcmtk/dcmrt/seq/drtrpphs.h" // for ReferencedPatientPhotoSequence +#include "dcmtk/dcmrt/seq/drtrps.h" // for ReferencedPatientSequence +#include "dcmtk/dcmrt/seq/drtrppss.h" // for ReferencedPerformedProcedureStepSequence +#include "dcmtk/dcmrt/seq/drtrrtps3.h" // for ReferencedRTPlanSequence +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence +#include "dcmtk/dcmrt/seq/drtrsss.h" // for ReferencedStructureSetSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrpis.h" // for ReferringPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtras.h" // for RequestAttributesSequence +#include "dcmtk/dcmrt/seq/drtrscs.h" // for RequestingServiceCodeSequence +#include "dcmtk/dcmrt/seq/drtsdcs.h" // for SeriesDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtsis.h" // for SourceImageSequence +#include "dcmtk/dcmrt/seq/drtsins.h" // for SourceInstanceSequence +#include "dcmtk/dcmrt/seq/drtspgis.h" // for SourcePatientGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtscs.h" // for StrainCodeSequence +#include "dcmtk/dcmrt/seq/drtsss.h" // for StrainStockSequence +#include "dcmtk/dcmrt/seq/drtscris.h" // for StudiesContainingOtherReferencedInstancesSequence +#include "dcmtk/dcmrt/seq/drtudis.h" // for UDISequence + + +/** Interface class for RTIonPlanIOD + * @note Because of its many member variables, an instance of this class requires quite + * some memory. So be careful when creating automatic variables from this class (the + * stack size might be exceeded); it is probably better to use the heap space. + */ +class DCMTK_DCMRT_EXPORT DRTIonPlanIOD + : protected DRTTypes +{ + + public: + + // --- constructors, destructor and operators --- + + /** default constructor + */ + DRTIonPlanIOD(); + + /** copy constructor + * @param copy IOD object to be copied + */ + DRTIonPlanIOD(const DRTIonPlanIOD ©); + + /** destructor + */ + virtual ~DRTIonPlanIOD(); + + /** assigment operator + * @param copy IOD object to be copied + * @return reference to this object + */ + DRTIonPlanIOD &operator=(const DRTIonPlanIOD ©); + + // --- general methods --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + // --- input/output methods --- + + /** read object from dataset + * @param dataset reference to DICOM dataset from which the object should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** read PatientData from dataset + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset); + + /** read StudyData from dataset. Also reads PatientData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset); + + /** read SeriesData from dataset. Also reads PatientData, StudyData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSeriesData(DcmItem &dataset); + + /** write object to dataset + * @param dataset reference to DICOM dataset to which the object should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // --- check presence of non-mandatory DICOM modules --- + + /** check whether ClinicalTrialSubjectModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSubjectModulePresent(const OFBool complete = OFFalse); + + /** check whether PatientStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isPatientStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialSeriesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSeriesModulePresent(const OFBool complete = OFFalse); + + /** check whether RTPrescriptionModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTPrescriptionModulePresent(const OFBool complete = OFFalse); + + /** check whether RTIonToleranceTablesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTIonToleranceTablesModulePresent(const OFBool complete = OFFalse); + + /** check whether RTPatientSetupModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTPatientSetupModulePresent(const OFBool complete = OFFalse); + + /** check whether RTFractionSchemeModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTFractionSchemeModulePresent(const OFBool complete = OFFalse); + + /** check whether RTIonBeamsModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTIonBeamsModulePresent(const OFBool complete = OFFalse); + + /** check whether ApprovalModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isApprovalModulePresent(const OFBool complete = OFFalse); + + /** check whether GeneralReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isGeneralReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether CommonInstanceReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCommonInstanceReferenceModulePresent(const OFBool complete = OFFalse); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get AdditionalPatientHistory (0010,21b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdditionalPatientHistory(OFString &value, const signed long pos = 0) const; + + /** get AdmissionID (0038,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmissionID(OFString &value, const signed long pos = 0) const; + + /** get AdmittingDiagnosesDescription (0008,1080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString &value, const signed long pos = 0) const; + + /** get Allergies (0010,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAllergies(OFString &value, const signed long pos = 0) const; + + /** get ApprovalStatus (300e,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getApprovalStatus(OFString &value, const signed long pos = 0) const; + + /** get AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolName (0012,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesDescription (0012,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesID (0012,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteID (0012,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteName (0012,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSponsorName (0012,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSponsorName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectID (0012,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectReadingID (0012,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectReadingID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointDescription (0012,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointID (0012,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointID(OFString &value, const signed long pos = 0) const; + + /** get CommentsOnThePerformedProcedureStep (0040,0280) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos = 0) const; + + /** get ConsultingPhysicianName (0008,009c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConsultingPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get ContentQualification (0018,9004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, const signed long pos = 0) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeidentificationMethod (0012,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeidentificationMethod(OFString &value, const signed long pos = 0) const; + + /** get DerivationDescription (0008,2111) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDerivationDescription(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get EthnicGroup (0010,2160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEthnicGroup(OFString &value, const signed long pos = 0) const; + + /** get FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix (0070,030b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(Float64 &value, const unsigned long pos = 0) const; + + /** get FrameOfReferenceUID (0020,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceUID(OFString &value, const signed long pos = 0) const; + + /** get GantryID (0018,1008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryID(OFString &value, const signed long pos = 0) const; + + /** get InstanceCoercionDateTime (0008,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCoercionDateTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationDate (0008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationTime (0008,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreatorUID (0008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get LastMenstrualDate (0010,21d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLastMenstrualDate(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalEventType (0012,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalEventType(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalInformationModified (0028,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalInformationModified(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MedicalAlerts (0010,2000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMedicalAlerts(OFString &value, const signed long pos = 0) const; + + /** get Modality (0008,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, const signed long pos = 0) const; + + /** get NameOfPhysiciansReadingStudy (0008,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos = 0) const; + + /** get Occupation (0010,2180) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOccupation(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OriginalSpecializedSOPClassUID (0008,001b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get OtherPatientNames (0010,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOtherPatientNames(OFString &value, const signed long pos = 0) const; + + /** get PatientAge (0010,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, const signed long pos = 0) const; + + /** get PatientAlternativeCalendar (0010,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDate (0010,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthTime (0010,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthTime(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientBreedDescription (0010,2292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBreedDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientComments (0010,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientComments(OFString &value, const signed long pos = 0) const; + + /** get PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientIdentityRemoved (0012,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientIdentityRemoved(OFString &value, const signed long pos = 0) const; + + /** get PatientName (0010,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, const signed long pos = 0) const; + + /** get PatientSex (0010,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, const signed long pos = 0) const; + + /** get PatientSexNeutered (0010,2203) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSexNeutered(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSpeciesDescription (0010,2201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSpeciesDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientState (0038,0500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientState(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get PerformedProcedureStepDescription (0040,0254) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndDate (0040,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndTime (0040,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndTime(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepID (0040,0253) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartDate (0040,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartTime (0040,0245) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartTime(OFString &value, const signed long pos = 0) const; + + /** get PhysiciansOfRecord (0008,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhysiciansOfRecord(OFString &value, const signed long pos = 0) const; + + /** get PixelPaddingValue (0028,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PlanIntent (300a,000a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPlanIntent(OFString &value, const signed long pos = 0) const; + + /** get PositionReferenceIndicator (0020,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPositionReferenceIndicator(OFString &value, const signed long pos = 0) const; + + /** get PregnancyStatus (0010,21c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPregnancyStatus(Uint16 &value, const unsigned long pos = 0) const; + + /** get PrescriptionDescription (300a,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPrescriptionDescription(OFString &value, const signed long pos = 0) const; + + /** get QualityControlSubject (0010,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlSubject(OFString &value, const signed long pos = 0) const; + + /** get QueryRetrieveView (0008,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQueryRetrieveView(OFString &value, const signed long pos = 0) const; + + /** get RTPlanDate (300a,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanDate(OFString &value, const signed long pos = 0) const; + + /** get RTPlanDescription (300a,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanDescription(OFString &value, const signed long pos = 0) const; + + /** get RTPlanGeometry (300a,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanGeometry(OFString &value, const signed long pos = 0) const; + + /** get RTPlanLabel (300a,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanLabel(OFString &value, const signed long pos = 0) const; + + /** get RTPlanName (300a,0003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanName(OFString &value, const signed long pos = 0) const; + + /** get RTPlanTime (300a,0007) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanTime(OFString &value, const signed long pos = 0) const; + + /** get ReferringPhysicianName (0008,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get RelatedGeneralSOPClassUID (0008,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRelatedGeneralSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ResponsibleOrganization (0010,2299) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePerson (0010,2297) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePerson(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePersonRole (0010,2298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePersonRole(OFString &value, const signed long pos = 0) const; + + /** get ReviewDate (300e,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewDate(OFString &value, const signed long pos = 0) const; + + /** get ReviewTime (300e,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewTime(OFString &value, const signed long pos = 0) const; + + /** get ReviewerName (300e,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewerName(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationComment (0100,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationComment(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationDateTime (0100,0420) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationDateTime(OFString &value, const signed long pos = 0) const; + + /** get SOPClassUID (0008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceStatus (0100,0410) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceStatus(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceUID (0008,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesDate (0008,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, const signed long pos = 0) const; + + /** get SeriesDescription (0008,103e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SeriesTime (0008,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeDescription (0038,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeDescription(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeID (0038,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeID(OFString &value, const signed long pos = 0) const; + + /** get SmokingStatus (0010,21a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmokingStatus(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecificCharacterSet (0008,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, const signed long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get StrainAdditionalInformation (0010,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainAdditionalInformation(OFString &value, const signed long pos = 0) const; + + /** get StrainDescription (0010,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainDescription(OFString &value, const signed long pos = 0) const; + + /** get StrainNomenclature (0010,0213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainNomenclature(OFString &value, const signed long pos = 0) const; + + /** get StudyDate (0008,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, const signed long pos = 0) const; + + /** get StudyDescription (0008,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, const signed long pos = 0) const; + + /** get StudyID (0020,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyTime (0008,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, const signed long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get TimezoneOffsetFromUTC (0008,0201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, const signed long pos = 0) const; + + /** get TreatmentProtocols (300a,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentProtocols(OFString &value, const signed long pos = 0) const; + + /** get TreatmentSites (300a,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentSites(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return reference to sequence element + */ + DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() + { return AdmittingDiagnosesCodeSequence; } + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return const reference to sequence element + */ + const DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() const + { return AdmittingDiagnosesCodeSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return reference to sequence element + */ + DRTBreedRegistrationSequence &getBreedRegistrationSequence() + { return BreedRegistrationSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return const reference to sequence element + */ + const DRTBreedRegistrationSequence &getBreedRegistrationSequence() const + { return BreedRegistrationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return reference to sequence element + */ + DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() + { return CodingSchemeIdentificationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return const reference to sequence element + */ + const DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() const + { return CodingSchemeIdentificationSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return reference to sequence element + */ + DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return const reference to sequence element + */ + const DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() const + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return reference to sequence element + */ + DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() + { return ConsultingPhysicianIdentificationSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return const reference to sequence element + */ + const DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() const + { return ConsultingPhysicianIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return reference to sequence element + */ + DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() + { return ContextGroupIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return const reference to sequence element + */ + const DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() const + { return ContextGroupIdentificationSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return reference to sequence element + */ + DRTContributingEquipmentSequence &getContributingEquipmentSequence() + { return ContributingEquipmentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return const reference to sequence element + */ + const DRTContributingEquipmentSequence &getContributingEquipmentSequence() const + { return ContributingEquipmentSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return reference to sequence element + */ + DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() + { return ConversionSourceAttributesSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return const reference to sequence element + */ + const DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() const + { return ConversionSourceAttributesSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return reference to sequence element + */ + DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() + { return DeidentificationMethodCodeSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return const reference to sequence element + */ + const DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() const + { return DeidentificationMethodCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return reference to sequence element + */ + DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() + { return DigitalSignaturesSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return const reference to sequence element + */ + const DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() const + { return DigitalSignaturesSequence; } + + /** get DoseReferenceSequence (300a,0010) + * @return reference to sequence element + */ + DRTDoseReferenceSequence &getDoseReferenceSequence() + { return DoseReferenceSequence; } + + /** get DoseReferenceSequence (300a,0010) + * @return const reference to sequence element + */ + const DRTDoseReferenceSequence &getDoseReferenceSequence() const + { return DoseReferenceSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return reference to sequence element + */ + DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() + { return EncryptedAttributesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return const reference to sequence element + */ + const DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() const + { return EncryptedAttributesSequence; } + + /** get FractionGroupSequence (300a,0070) + * @return reference to sequence element + */ + DRTFractionGroupSequence &getFractionGroupSequence() + { return FractionGroupSequence; } + + /** get FractionGroupSequence (300a,0070) + * @return const reference to sequence element + */ + const DRTFractionGroupSequence &getFractionGroupSequence() const + { return FractionGroupSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return reference to sequence element + */ + DRTGeneticModificationsSequence &getGeneticModificationsSequence() + { return GeneticModificationsSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return const reference to sequence element + */ + const DRTGeneticModificationsSequence &getGeneticModificationsSequence() const + { return GeneticModificationsSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return reference to sequence element + */ + DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() + { return GroupOfPatientsIdentificationSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return const reference to sequence element + */ + const DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() const + { return GroupOfPatientsIdentificationSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return reference to sequence element + */ + DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() + { return HL7StructuredDocumentReferenceSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return const reference to sequence element + */ + const DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() const + { return HL7StructuredDocumentReferenceSequence; } + + /** get IonBeamSequence (300a,03a2) + * @return reference to sequence element + */ + DRTIonBeamSequence &getIonBeamSequence() + { return IonBeamSequence; } + + /** get IonBeamSequence (300a,03a2) + * @return const reference to sequence element + */ + const DRTIonBeamSequence &getIonBeamSequence() const + { return IonBeamSequence; } + + /** get IonToleranceTableSequence (300a,03a0) + * @return reference to sequence element + */ + DRTIonToleranceTableSequence &getIonToleranceTableSequence() + { return IonToleranceTableSequence; } + + /** get IonToleranceTableSequence (300a,03a0) + * @return const reference to sequence element + */ + const DRTIonToleranceTableSequence &getIonToleranceTableSequence() const + { return IonToleranceTableSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return reference to sequence element + */ + DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return const reference to sequence element + */ + const DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() const + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return reference to sequence element + */ + DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() + { return IssuerOfServiceEpisodeIDSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return const reference to sequence element + */ + const DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() const + { return IssuerOfServiceEpisodeIDSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return reference to sequence element + */ + DRTMACParametersSequence &getMACParametersSequence() + { return MACParametersSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return const reference to sequence element + */ + const DRTMACParametersSequence &getMACParametersSequence() const + { return MACParametersSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return reference to sequence element + */ + DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() + { return MappingResourceIdentificationSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return const reference to sequence element + */ + const DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() const + { return MappingResourceIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return reference to sequence element + */ + DRTOriginalAttributesSequence &getOriginalAttributesSequence() + { return OriginalAttributesSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return const reference to sequence element + */ + const DRTOriginalAttributesSequence &getOriginalAttributesSequence() const + { return OriginalAttributesSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return reference to sequence element + */ + DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() + { return OtherPatientIDsSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return const reference to sequence element + */ + const DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() const + { return OtherPatientIDsSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return reference to sequence element + */ + DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() + { return PatientBreedCodeSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return const reference to sequence element + */ + const DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() const + { return PatientBreedCodeSequence; } + + /** get PatientSetupSequence (300a,0180) + * @return reference to sequence element + */ + DRTPatientSetupSequence &getPatientSetupSequence() + { return PatientSetupSequence; } + + /** get PatientSetupSequence (300a,0180) + * @return const reference to sequence element + */ + const DRTPatientSetupSequence &getPatientSetupSequence() const + { return PatientSetupSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return reference to sequence element + */ + DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() + { return PatientSizeCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return const reference to sequence element + */ + const DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() const + { return PatientSizeCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return reference to sequence element + */ + DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() + { return PatientSpeciesCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return const reference to sequence element + */ + const DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() const + { return PatientSpeciesCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return reference to sequence element + */ + DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() + { return PerformedProtocolCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return const reference to sequence element + */ + const DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() const + { return PerformedProtocolCodeSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return reference to sequence element + */ + DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return const reference to sequence element + */ + const DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() const + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return reference to sequence element + */ + DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return const reference to sequence element + */ + const DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() const + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return reference to sequence element + */ + DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() + { return PrivateDataElementCharacteristicsSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return const reference to sequence element + */ + const DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() const + { return PrivateDataElementCharacteristicsSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return reference to sequence element + */ + DRTProcedureCodeSequence &getProcedureCodeSequence() + { return ProcedureCodeSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return const reference to sequence element + */ + const DRTProcedureCodeSequence &getProcedureCodeSequence() const + { return ProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return reference to sequence element + */ + DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return const reference to sequence element + */ + const DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() const + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return reference to sequence element + */ + DRTReferencedDoseSequence &getReferencedDoseSequence() + { return ReferencedDoseSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return const reference to sequence element + */ + const DRTReferencedDoseSequence &getReferencedDoseSequence() const + { return ReferencedDoseSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return reference to sequence element + */ + DRTReferencedImageSequence &getReferencedImageSequence() + { return ReferencedImageSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return const reference to sequence element + */ + const DRTReferencedImageSequence &getReferencedImageSequence() const + { return ReferencedImageSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return reference to sequence element + */ + DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return const reference to sequence element + */ + const DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() const + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return reference to sequence element + */ + DRTReferencedPatientSequence &getReferencedPatientSequence() + { return ReferencedPatientSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return const reference to sequence element + */ + const DRTReferencedPatientSequence &getReferencedPatientSequence() const + { return ReferencedPatientSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return reference to sequence element + */ + DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return const reference to sequence element + */ + const DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() const + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return reference to sequence element + */ + DRTReferencedRTPlanSequenceInRTGeneralPlanModule &getReferencedRTPlanSequence() + { return ReferencedRTPlanSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return const reference to sequence element + */ + const DRTReferencedRTPlanSequenceInRTGeneralPlanModule &getReferencedRTPlanSequence() const + { return ReferencedRTPlanSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + /** get ReferencedStructureSetSequence (300c,0060) + * @return reference to sequence element + */ + DRTReferencedStructureSetSequence &getReferencedStructureSetSequence() + { return ReferencedStructureSetSequence; } + + /** get ReferencedStructureSetSequence (300c,0060) + * @return const reference to sequence element + */ + const DRTReferencedStructureSetSequence &getReferencedStructureSetSequence() const + { return ReferencedStructureSetSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return reference to sequence element + */ + DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() + { return ReferringPhysicianIdentificationSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return const reference to sequence element + */ + const DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() const + { return ReferringPhysicianIdentificationSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return reference to sequence element + */ + DRTRequestAttributesSequence &getRequestAttributesSequence() + { return RequestAttributesSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return const reference to sequence element + */ + const DRTRequestAttributesSequence &getRequestAttributesSequence() const + { return RequestAttributesSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return reference to sequence element + */ + DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() + { return RequestingServiceCodeSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return const reference to sequence element + */ + const DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() const + { return RequestingServiceCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return reference to sequence element + */ + DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() + { return SeriesDescriptionCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return const reference to sequence element + */ + const DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() const + { return SeriesDescriptionCodeSequence; } + + /** get SourceImageSequence (0008,2112) + * @return reference to sequence element + */ + DRTSourceImageSequence &getSourceImageSequence() + { return SourceImageSequence; } + + /** get SourceImageSequence (0008,2112) + * @return const reference to sequence element + */ + const DRTSourceImageSequence &getSourceImageSequence() const + { return SourceImageSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return reference to sequence element + */ + DRTSourceInstanceSequence &getSourceInstanceSequence() + { return SourceInstanceSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return const reference to sequence element + */ + const DRTSourceInstanceSequence &getSourceInstanceSequence() const + { return SourceInstanceSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return reference to sequence element + */ + DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() + { return SourcePatientGroupIdentificationSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return const reference to sequence element + */ + const DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() const + { return SourcePatientGroupIdentificationSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return reference to sequence element + */ + DRTStrainCodeSequence &getStrainCodeSequence() + { return StrainCodeSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return const reference to sequence element + */ + const DRTStrainCodeSequence &getStrainCodeSequence() const + { return StrainCodeSequence; } + + /** get StrainStockSequence (0010,0216) + * @return reference to sequence element + */ + DRTStrainStockSequence &getStrainStockSequence() + { return StrainStockSequence; } + + /** get StrainStockSequence (0010,0216) + * @return const reference to sequence element + */ + const DRTStrainStockSequence &getStrainStockSequence() const + { return StrainStockSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return reference to sequence element + */ + DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return const reference to sequence element + */ + const DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() const + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get UDISequence (0018,100a) + * @return reference to sequence element + */ + DRTUDISequence &getUDISequence() + { return UDISequence; } + + /** get UDISequence (0018,100a) + * @return const reference to sequence element + */ + const DRTUDISequence &getUDISequence() const + { return UDISequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AdditionalPatientHistory (0010,21b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdditionalPatientHistory(const OFString &value, const OFBool check = OFTrue); + + /** set AdmissionID (0038,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmissionID(const OFString &value, const OFBool check = OFTrue); + + /** set AdmittingDiagnosesDescription (0008,1080) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set Allergies (0010,2110) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAllergies(const OFString &value, const OFBool check = OFTrue); + + /** set ApprovalStatus (300e,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setApprovalStatus(const OFString &value, const OFBool check = OFTrue); + + /** set AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolName (0012,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesDescription (0012,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesID (0012,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteID (0012,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteName (0012,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSponsorName (0012,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSponsorName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectID (0012,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectReadingID (0012,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointDescription (0012,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointID (0012,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointID(const OFString &value, const OFBool check = OFTrue); + + /** set CommentsOnThePerformedProcedureStep (0040,0280) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check = OFTrue); + + /** set ConsultingPhysicianName (0008,009c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConsultingPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set ContentQualification (0018,9004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeidentificationMethod (0012,0063) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeidentificationMethod(const OFString &value, const OFBool check = OFTrue); + + /** set DerivationDescription (0008,2111) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDerivationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set EthnicGroup (0010,2160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEthnicGroup(const OFString &value, const OFBool check = OFTrue); + + /** set FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix (0070,030b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=16 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(const Float64 value, const unsigned long pos = 0); + + /** set FrameOfReferenceUID (0020,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceUID(const OFString &value, const OFBool check = OFTrue); + + /** set GantryID (0018,1008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCoercionDateTime (0008,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCoercionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationDate (0008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationTime (0008,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreatorUID (0008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceNumber (0020,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set LastMenstrualDate (0010,21d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLastMenstrualDate(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalEventType (0012,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalEventType(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalInformationModified (0028,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos = 0); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredAPDimension (0010,1023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredAPDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredLateralDimension (0010,1024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredLateralDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MedicalAlerts (0010,2000) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMedicalAlerts(const OFString &value, const OFBool check = OFTrue); + + /** set Modality (0008,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, const OFBool check = OFTrue); + + /** set NameOfPhysiciansReadingStudy (0008,1060) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check = OFTrue); + + /** set Occupation (0010,2180) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOccupation(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OriginalSpecializedSOPClassUID (0008,001b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set OtherPatientNames (0010,1001) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOtherPatientNames(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAge (0010,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAlternativeCalendar (0010,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDate (0010,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthTime (0010,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthTime(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBodyMassIndex (0010,1022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBodyMassIndex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBreedDescription (0010,2292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBreedDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientComments (0010,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientComments(const OFString &value, const OFBool check = OFTrue); + + /** set PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientIdentityRemoved (0012,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientIdentityRemoved(const OFString &value, const OFBool check = OFTrue); + + /** set PatientName (0010,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSex (0010,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSexNeutered (0010,2203) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSexNeutered(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSize (0010,1020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSpeciesDescription (0010,2201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSpeciesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientState (0038,0500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientState(const OFString &value, const OFBool check = OFTrue); + + /** set PatientWeight (0010,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepDescription (0040,0254) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndDate (0040,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndTime (0040,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndTime(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepID (0040,0253) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartDate (0040,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartTime (0040,0245) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set PhysiciansOfRecord (0008,1048) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhysiciansOfRecord(const OFString &value, const OFBool check = OFTrue); + + /** set PixelPaddingValue (0028,0120) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingValue(const Uint16 value, const unsigned long pos = 0); + + /** set PlanIntent (300a,000a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPlanIntent(const OFString &value, const OFBool check = OFTrue); + + /** set PositionReferenceIndicator (0020,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPositionReferenceIndicator(const OFString &value, const OFBool check = OFTrue); + + /** set PregnancyStatus (0010,21c0) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPregnancyStatus(const Uint16 value, const unsigned long pos = 0); + + /** set PrescriptionDescription (300a,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPrescriptionDescription(const OFString &value, const OFBool check = OFTrue); + + /** set QualityControlSubject (0010,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlSubject(const OFString &value, const OFBool check = OFTrue); + + /** set QueryRetrieveView (0008,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQueryRetrieveView(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanDate (300a,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanDate(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanDescription (300a,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanDescription(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanGeometry (300a,000c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanGeometry(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanLabel (300a,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanLabel(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanName (300a,0003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanName(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanTime (300a,0007) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanTime(const OFString &value, const OFBool check = OFTrue); + + /** set ReferringPhysicianName (0008,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set RelatedGeneralSOPClassUID (0008,001a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsibleOrganization (0010,2299) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePerson (0010,2297) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePerson(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePersonRole (0010,2298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePersonRole(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewDate (300e,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewDate(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewTime (300e,0005) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewTime(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewerName (300e,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewerName(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationComment (0100,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationComment(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationDateTime (0100,0420) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set SOPClassUID (0008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceStatus (0100,0410) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceUID (0008,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDate (0008,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDescription (0008,103e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesNumber (0020,0011) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesTime (0008,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeDescription (0038,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeID (0038,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeID(const OFString &value, const OFBool check = OFTrue); + + /** set SmokingStatus (0010,21a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmokingStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set SpecificCharacterSet (0008,0005) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set StrainAdditionalInformation (0010,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainAdditionalInformation(const OFString &value, const OFBool check = OFTrue); + + /** set StrainDescription (0010,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StrainNomenclature (0010,0213) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainNomenclature(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDate (0008,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDescription (0008,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StudyID (0020,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyTime (0008,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set TimezoneOffsetFromUTC (0008,0201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentProtocols (300a,0009) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentProtocols(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentSites (300a,000b) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentSites(const OFString &value, const OFBool check = OFTrue); + + + protected: + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attribute + * SOPClassUID (0008,0016) with the expected value. Any incorrectness regarding + * this attribute is reported to the log stream (if enabled for error messages). + * @param dataset DICOM dataset to be checked + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset); + + /** update various DICOM attributes + */ + void updateAttributes(); + + private: + + // DICOM attributes are listed ordered by module + + // --- PatientModule (M) --- + + /// PatientName (0010,0010) vr=PN, vm=1, type=2 + DcmPersonName PatientName; + /// PatientID (0010,0020) vr=LO, vm=1, type=2 + DcmLongString PatientID; + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientBirthDate (0010,0030) vr=DA, vm=1, type=2 + DcmDate PatientBirthDate; + /// PatientBirthDateInAlternativeCalendar (0010,0033) vr=LO, vm=1, type=3 + DcmLongString PatientBirthDateInAlternativeCalendar; + /// PatientDeathDateInAlternativeCalendar (0010,0034) vr=LO, vm=1, type=3 + DcmLongString PatientDeathDateInAlternativeCalendar; + /// PatientAlternativeCalendar (0010,0035) vr=CS, vm=1, type=1C + DcmCodeString PatientAlternativeCalendar; + /// PatientSex (0010,0040) vr=CS, vm=1, type=2 + DcmCodeString PatientSex; + /// ReferencedPatientPhotoSequence (0010,1100) vr=SQ, vm=1, type=3 + DRTReferencedPatientPhotoSequence ReferencedPatientPhotoSequence; + /// QualityControlSubject (0010,0200) vr=CS, vm=1, type=3 + DcmCodeString QualityControlSubject; + /// ReferencedPatientSequence (0008,1120) vr=SQ, vm=1, type=3 + DRTReferencedPatientSequence ReferencedPatientSequence; + /// PatientBirthTime (0010,0032) vr=TM, vm=1, type=3 + DcmTime PatientBirthTime; + /// OtherPatientIDsSequence (0010,1002) vr=SQ, vm=1, type=3 + DRTOtherPatientIDsSequence OtherPatientIDsSequence; + /// OtherPatientNames (0010,1001) vr=PN, vm=1-n, type=3 + DcmPersonName OtherPatientNames; + /// EthnicGroup (0010,2160) vr=SH, vm=1, type=3 + DcmShortString EthnicGroup; + /// PatientComments (0010,4000) vr=LT, vm=1, type=3 + DcmLongText PatientComments; + /// PatientSpeciesDescription (0010,2201) vr=LO, vm=1, type=1C + DcmLongString PatientSpeciesDescription; + /// PatientSpeciesCodeSequence (0010,2202) vr=SQ, vm=1, type=1C + DRTPatientSpeciesCodeSequence PatientSpeciesCodeSequence; + /// PatientBreedDescription (0010,2292) vr=LO, vm=1, type=2C + DcmLongString PatientBreedDescription; + /// PatientBreedCodeSequence (0010,2293) vr=SQ, vm=1, type=2C + DRTPatientBreedCodeSequence PatientBreedCodeSequence; + /// BreedRegistrationSequence (0010,2294) vr=SQ, vm=1, type=2C + DRTBreedRegistrationSequence BreedRegistrationSequence; + /// StrainDescription (0010,0212) vr=UC, vm=1, type=3 + DcmUnlimitedCharacters StrainDescription; + /// StrainNomenclature (0010,0213) vr=LO, vm=1, type=3 + DcmLongString StrainNomenclature; + /// StrainCodeSequence (0010,0219) vr=SQ, vm=1, type=3 + DRTStrainCodeSequence StrainCodeSequence; + /// StrainAdditionalInformation (0010,0218) vr=UT, vm=1, type=3 + DcmUnlimitedText StrainAdditionalInformation; + /// StrainStockSequence (0010,0216) vr=SQ, vm=1, type=3 + DRTStrainStockSequence StrainStockSequence; + /// GeneticModificationsSequence (0010,0221) vr=SQ, vm=1, type=3 + DRTGeneticModificationsSequence GeneticModificationsSequence; + /// ResponsiblePerson (0010,2297) vr=PN, vm=1, type=2C + DcmPersonName ResponsiblePerson; + /// ResponsiblePersonRole (0010,2298) vr=CS, vm=1, type=1C + DcmCodeString ResponsiblePersonRole; + /// ResponsibleOrganization (0010,2299) vr=LO, vm=1, type=2C + DcmLongString ResponsibleOrganization; + /// PatientIdentityRemoved (0012,0062) vr=CS, vm=1, type=3 + DcmCodeString PatientIdentityRemoved; + /// DeidentificationMethod (0012,0063) vr=LO, vm=1-n, type=1C + DcmLongString DeidentificationMethod; + /// DeidentificationMethodCodeSequence (0012,0064) vr=SQ, vm=1, type=1C + DRTDeidentificationMethodCodeSequence DeidentificationMethodCodeSequence; + /// SourcePatientGroupIdentificationSequence (0010,0026) vr=SQ, vm=1, type=3 + DRTSourcePatientGroupIdentificationSequence SourcePatientGroupIdentificationSequence; + /// GroupOfPatientsIdentificationSequence (0010,0027) vr=SQ, vm=1, type=3 + DRTGroupOfPatientsIdentificationSequence GroupOfPatientsIdentificationSequence; + + // --- ClinicalTrialSubjectModule (U) --- + + /// ClinicalTrialSponsorName (0012,0010) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialSponsorName; + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialProtocolID; + /// ClinicalTrialProtocolName (0012,0021) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialProtocolName; + /// ClinicalTrialSiteID (0012,0030) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteID; + /// ClinicalTrialSiteName (0012,0031) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteName; + /// ClinicalTrialSubjectID (0012,0040) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectID; + /// ClinicalTrialSubjectReadingID (0012,0042) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectReadingID; + /// ClinicalTrialProtocolEthicsCommitteeName (0012,0081) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolEthicsCommitteeName; + /// ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + + // --- GeneralStudyModule (M) --- + + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + /// StudyDate (0008,0020) vr=DA, vm=1, type=2 + DcmDate StudyDate; + /// StudyTime (0008,0030) vr=TM, vm=1, type=2 + DcmTime StudyTime; + /// ReferringPhysicianName (0008,0090) vr=PN, vm=1, type=2 + DcmPersonName ReferringPhysicianName; + /// ReferringPhysicianIdentificationSequence (0008,0096) vr=SQ, vm=1, type=3 + DRTReferringPhysicianIdentificationSequence ReferringPhysicianIdentificationSequence; + /// ConsultingPhysicianName (0008,009c) vr=PN, vm=1-n, type=3 + DcmPersonName ConsultingPhysicianName; + /// ConsultingPhysicianIdentificationSequence (0008,009d) vr=SQ, vm=1, type=3 + DRTConsultingPhysicianIdentificationSequence ConsultingPhysicianIdentificationSequence; + /// StudyID (0020,0010) vr=SH, vm=1, type=2 + DcmShortString StudyID; + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=2 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// StudyDescription (0008,1030) vr=LO, vm=1, type=3 + DcmLongString StudyDescription; + /// PhysiciansOfRecord (0008,1048) vr=PN, vm=1-n, type=3 + DcmPersonName PhysiciansOfRecord; + /// PhysiciansOfRecordIdentificationSequence (0008,1049) vr=SQ, vm=1, type=3 + DRTPhysiciansOfRecordIdentificationSequence PhysiciansOfRecordIdentificationSequence; + /// NameOfPhysiciansReadingStudy (0008,1060) vr=PN, vm=1-n, type=3 + DcmPersonName NameOfPhysiciansReadingStudy; + /// PhysiciansReadingStudyIdentificationSequence (0008,1062) vr=SQ, vm=1, type=3 + DRTPhysiciansReadingStudyIdentificationSequence PhysiciansReadingStudyIdentificationSequence; + /// RequestingServiceCodeSequence (0032,1034) vr=SQ, vm=1, type=3 + DRTRequestingServiceCodeSequence RequestingServiceCodeSequence; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// ProcedureCodeSequence (0008,1032) vr=SQ, vm=1, type=3 + DRTProcedureCodeSequence ProcedureCodeSequence; + /// ReasonForPerformedProcedureCodeSequence (0040,1012) vr=SQ, vm=1, type=3 + DRTReasonForPerformedProcedureCodeSequence ReasonForPerformedProcedureCodeSequence; + + // --- PatientStudyModule (U) --- + + /// AdmittingDiagnosesDescription (0008,1080) vr=LO, vm=1-n, type=3 + DcmLongString AdmittingDiagnosesDescription; + /// AdmittingDiagnosesCodeSequence (0008,1084) vr=SQ, vm=1, type=3 + DRTAdmittingDiagnosesCodeSequence AdmittingDiagnosesCodeSequence; + /// PatientAge (0010,1010) vr=AS, vm=1, type=3 + DcmAgeString PatientAge; + /// PatientSize (0010,1020) vr=DS, vm=1, type=3 + DcmDecimalString PatientSize; + /// PatientWeight (0010,1030) vr=DS, vm=1, type=3 + DcmDecimalString PatientWeight; + /// PatientBodyMassIndex (0010,1022) vr=DS, vm=1, type=3 + DcmDecimalString PatientBodyMassIndex; + /// MeasuredAPDimension (0010,1023) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredAPDimension; + /// MeasuredLateralDimension (0010,1024) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredLateralDimension; + /// PatientSizeCodeSequence (0010,1021) vr=SQ, vm=1, type=3 + DRTPatientSizeCodeSequence PatientSizeCodeSequence; + /// MedicalAlerts (0010,2000) vr=LO, vm=1-n, type=3 + DcmLongString MedicalAlerts; + /// Allergies (0010,2110) vr=LO, vm=1-n, type=3 + DcmLongString Allergies; + /// SmokingStatus (0010,21a0) vr=CS, vm=1, type=3 + DcmCodeString SmokingStatus; + /// PregnancyStatus (0010,21c0) vr=US, vm=1, type=3 + DcmUnsignedShort PregnancyStatus; + /// LastMenstrualDate (0010,21d0) vr=DA, vm=1, type=3 + DcmDate LastMenstrualDate; + /// PatientState (0038,0500) vr=LO, vm=1, type=3 + DcmLongString PatientState; + /// Occupation (0010,2180) vr=SH, vm=1, type=3 + DcmShortString Occupation; + /// AdditionalPatientHistory (0010,21b0) vr=LT, vm=1, type=3 + DcmLongText AdditionalPatientHistory; + /// AdmissionID (0038,0010) vr=LO, vm=1, type=3 + DcmLongString AdmissionID; + /// IssuerOfAdmissionIDSequence (0038,0014) vr=SQ, vm=1, type=3 + DRTIssuerOfAdmissionIDSequence IssuerOfAdmissionIDSequence; + /// ServiceEpisodeID (0038,0060) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeID; + /// IssuerOfServiceEpisodeIDSequence (0038,0064) vr=SQ, vm=1, type=3 + DRTIssuerOfServiceEpisodeIDSequence IssuerOfServiceEpisodeIDSequence; + /// ServiceEpisodeDescription (0038,0062) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeDescription; + /// PatientSexNeutered (0010,2203) vr=CS, vm=1, type=2C + DcmCodeString PatientSexNeutered; + + // --- ClinicalTrialStudyModule (U) --- + + /// ClinicalTrialTimePointID (0012,0050) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialTimePointID; + /// ClinicalTrialTimePointDescription (0012,0051) vr=ST, vm=1, type=3 + DcmShortText ClinicalTrialTimePointDescription; + /// LongitudinalTemporalOffsetFromEvent (0012,0052) vr=FD, vm=1, type=3 + DcmFloatingPointDouble LongitudinalTemporalOffsetFromEvent; + /// LongitudinalTemporalEventType (0012,0053) vr=CS, vm=1, type=1C + DcmCodeString LongitudinalTemporalEventType; + /// ConsentForClinicalTrialUseSequence (0012,0083) vr=SQ, vm=1, type=3 + DRTConsentForClinicalTrialUseSequence ConsentForClinicalTrialUseSequence; + + // --- RTSeriesModule (M) --- + + /// Modality (0008,0060) vr=CS, vm=1, type=1 + DcmCodeString Modality; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + /// SeriesNumber (0020,0011) vr=IS, vm=1, type=2 + DcmIntegerString SeriesNumber; + /// SeriesDate (0008,0021) vr=DA, vm=1, type=3 + DcmDate SeriesDate; + /// SeriesTime (0008,0031) vr=TM, vm=1, type=3 + DcmTime SeriesTime; + /// SeriesDescription (0008,103e) vr=LO, vm=1, type=3 + DcmLongString SeriesDescription; + /// SeriesDescriptionCodeSequence (0008,103f) vr=SQ, vm=1, type=3 + DRTSeriesDescriptionCodeSequence SeriesDescriptionCodeSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// ReferencedPerformedProcedureStepSequence (0008,1111) vr=SQ, vm=1, type=3 + DRTReferencedPerformedProcedureStepSequence ReferencedPerformedProcedureStepSequence; + /// RequestAttributesSequence (0040,0275) vr=SQ, vm=1, type=3 + DRTRequestAttributesSequence RequestAttributesSequence; + /// PerformedProcedureStepID (0040,0253) vr=SH, vm=1, type=3 + DcmShortString PerformedProcedureStepID; + /// PerformedProcedureStepStartDate (0040,0244) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepStartDate; + /// PerformedProcedureStepStartTime (0040,0245) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepStartTime; + /// PerformedProcedureStepEndDate (0040,0250) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepEndDate; + /// PerformedProcedureStepEndTime (0040,0251) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepEndTime; + /// PerformedProcedureStepDescription (0040,0254) vr=LO, vm=1, type=3 + DcmLongString PerformedProcedureStepDescription; + /// PerformedProtocolCodeSequence (0040,0260) vr=SQ, vm=1, type=3 + DRTPerformedProtocolCodeSequence PerformedProtocolCodeSequence; + /// CommentsOnThePerformedProcedureStep (0040,0280) vr=ST, vm=1, type=3 + DcmShortText CommentsOnThePerformedProcedureStep; + + // --- ClinicalTrialSeriesModule (U) --- + + /// ClinicalTrialCoordinatingCenterName (0012,0060) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialCoordinatingCenterName; + /// ClinicalTrialSeriesID (0012,0071) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesID; + /// ClinicalTrialSeriesDescription (0012,0072) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesDescription; + + // --- FrameOfReferenceModule (M) --- + + /// FrameOfReferenceUID (0020,0052) vr=UI, vm=1, type=1 + DcmUniqueIdentifier FrameOfReferenceUID; + /// PositionReferenceIndicator (0020,1040) vr=LO, vm=1, type=2 + DcmLongString PositionReferenceIndicator; + + // --- GeneralEquipmentModule (M) --- + + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// GantryID (0018,1008) vr=LO, vm=1, type=3 + DcmLongString GantryID; + /// UDISequence (0018,100a) vr=SQ, vm=1, type=3 + DRTUDISequence UDISequence; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + /// PixelPaddingValue (0028,0120) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingValue; + + // --- RTGeneralPlanModule (M) --- + + /// RTPlanLabel (300a,0002) vr=SH, vm=1, type=1 + DcmShortString RTPlanLabel; + /// RTPlanName (300a,0003) vr=LO, vm=1, type=3 + DcmLongString RTPlanName; + /// RTPlanDescription (300a,0004) vr=ST, vm=1, type=3 + DcmShortText RTPlanDescription; + /// InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + /// - also defined in: SOPCommonModule + DcmIntegerString InstanceNumber; + /// RTPlanDate (300a,0006) vr=DA, vm=1, type=2 + DcmDate RTPlanDate; + /// RTPlanTime (300a,0007) vr=TM, vm=1, type=2 + DcmTime RTPlanTime; + /// TreatmentProtocols (300a,0009) vr=LO, vm=1-n, type=3 + DcmLongString TreatmentProtocols; + /// PlanIntent (300a,000a) vr=CS, vm=1, type=3 + DcmCodeString PlanIntent; + /// TreatmentSites (300a,000b) vr=LO, vm=1-n, type=3 + DcmLongString TreatmentSites; + /// RTPlanGeometry (300a,000c) vr=CS, vm=1, type=1 + DcmCodeString RTPlanGeometry; + /// ReferencedStructureSetSequence (300c,0060) vr=SQ, vm=1, type=1C + DRTReferencedStructureSetSequence ReferencedStructureSetSequence; + /// ReferencedDoseSequence (300c,0080) vr=SQ, vm=1, type=3 + DRTReferencedDoseSequence ReferencedDoseSequence; + /// ReferencedRTPlanSequence (300c,0002) vr=SQ, vm=1, type=3 + DRTReferencedRTPlanSequenceInRTGeneralPlanModule ReferencedRTPlanSequence; + /// FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix (0070,030b) vr=FD, vm=16, type=3 + DcmFloatingPointDouble FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix; + + // --- RTPrescriptionModule (U) --- + + /// PrescriptionDescription (300a,000e) vr=ST, vm=1, type=3 + DcmShortText PrescriptionDescription; + /// DoseReferenceSequence (300a,0010) vr=SQ, vm=1, type=3 + DRTDoseReferenceSequence DoseReferenceSequence; + + // --- RTIonToleranceTablesModule (U) --- + + /// IonToleranceTableSequence (300a,03a0) vr=SQ, vm=1, type=1 + DRTIonToleranceTableSequence IonToleranceTableSequence; + + // --- RTPatientSetupModule (U) --- + + /// PatientSetupSequence (300a,0180) vr=SQ, vm=1, type=1 + DRTPatientSetupSequence PatientSetupSequence; + + // --- RTFractionSchemeModule (U) --- + + /// FractionGroupSequence (300a,0070) vr=SQ, vm=1, type=1 + DRTFractionGroupSequence FractionGroupSequence; + + // --- RTIonBeamsModule (C) --- + + /// IonBeamSequence (300a,03a2) vr=SQ, vm=1, type=1 + DRTIonBeamSequence IonBeamSequence; + + // --- ApprovalModule (U) --- + + /// ApprovalStatus (300e,0002) vr=CS, vm=1, type=1 + DcmCodeString ApprovalStatus; + /// ReviewDate (300e,0004) vr=DA, vm=1, type=2C + DcmDate ReviewDate; + /// ReviewTime (300e,0005) vr=TM, vm=1, type=2C + DcmTime ReviewTime; + /// ReviewerName (300e,0008) vr=PN, vm=1, type=2C + DcmPersonName ReviewerName; + + // --- GeneralReferenceModule (U) --- + + /// ReferencedImageSequence (0008,1140) vr=SQ, vm=1, type=3 + DRTReferencedImageSequence ReferencedImageSequence; + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=3 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + /// DerivationDescription (0008,2111) vr=ST, vm=1, type=3 + DcmShortText DerivationDescription; + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// SourceImageSequence (0008,2112) vr=SQ, vm=1, type=3 + DRTSourceImageSequence SourceImageSequence; + /// SourceInstanceSequence (0042,0013) vr=SQ, vm=1, type=3 + DRTSourceInstanceSequence SourceInstanceSequence; + + // --- SOPCommonModule (M) --- + + /// SOPClassUID (0008,0016) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPClassUID; + /// SOPInstanceUID (0008,0018) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPInstanceUID; + /// SpecificCharacterSet (0008,0005) vr=CS, vm=1-n, type=1C + DcmCodeString SpecificCharacterSet; + /// InstanceCreationDate (0008,0012) vr=DA, vm=1, type=3 + DcmDate InstanceCreationDate; + /// InstanceCreationTime (0008,0013) vr=TM, vm=1, type=3 + DcmTime InstanceCreationTime; + /// InstanceCoercionDateTime (0008,0015) vr=DT, vm=1, type=3 + DcmDateTime InstanceCoercionDateTime; + /// InstanceCreatorUID (0008,0014) vr=UI, vm=1, type=3 + DcmUniqueIdentifier InstanceCreatorUID; + /// RelatedGeneralSOPClassUID (0008,001a) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier RelatedGeneralSOPClassUID; + /// OriginalSpecializedSOPClassUID (0008,001b) vr=UI, vm=1, type=3 + DcmUniqueIdentifier OriginalSpecializedSOPClassUID; + /// CodingSchemeIdentificationSequence (0008,0110) vr=SQ, vm=1, type=3 + DRTCodingSchemeIdentificationSequence CodingSchemeIdentificationSequence; + /// ContextGroupIdentificationSequence (0008,0123) vr=SQ, vm=1, type=3 + DRTContextGroupIdentificationSequence ContextGroupIdentificationSequence; + /// MappingResourceIdentificationSequence (0008,0124) vr=SQ, vm=1, type=3 + DRTMappingResourceIdentificationSequence MappingResourceIdentificationSequence; + /// TimezoneOffsetFromUTC (0008,0201) vr=SH, vm=1, type=3 + DcmShortString TimezoneOffsetFromUTC; + /// ContributingEquipmentSequence (0018,a001) vr=SQ, vm=1, type=3 + DRTContributingEquipmentSequence ContributingEquipmentSequence; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: RTGeneralPlanModule + // DcmIntegerString InstanceNumber; + /// SOPInstanceStatus (0100,0410) vr=CS, vm=1, type=3 + DcmCodeString SOPInstanceStatus; + /// SOPAuthorizationDateTime (0100,0420) vr=DT, vm=1, type=3 + DcmDateTime SOPAuthorizationDateTime; + /// SOPAuthorizationComment (0100,0424) vr=LT, vm=1, type=3 + DcmLongText SOPAuthorizationComment; + /// AuthorizationEquipmentCertificationNumber (0100,0426) vr=LO, vm=1, type=3 + DcmLongString AuthorizationEquipmentCertificationNumber; + /// MACParametersSequence (4ffe,0001) vr=SQ, vm=1, type=3 + DRTMACParametersSequence MACParametersSequence; + /// DigitalSignaturesSequence (fffa,fffa) vr=SQ, vm=1, type=3 + DRTDigitalSignaturesSequence DigitalSignaturesSequence; + /// EncryptedAttributesSequence (0400,0500) vr=SQ, vm=1, type=1C + DRTEncryptedAttributesSequence EncryptedAttributesSequence; + /// OriginalAttributesSequence (0400,0561) vr=SQ, vm=1, type=3 + DRTOriginalAttributesSequence OriginalAttributesSequence; + /// HL7StructuredDocumentReferenceSequence (0040,a390) vr=SQ, vm=1, type=1C + DRTHL7StructuredDocumentReferenceSequence HL7StructuredDocumentReferenceSequence; + /// LongitudinalTemporalInformationModified (0028,0303) vr=CS, vm=1, type=3 + DcmCodeString LongitudinalTemporalInformationModified; + /// QueryRetrieveView (0008,0053) vr=CS, vm=1, type=1C + DcmCodeString QueryRetrieveView; + /// ConversionSourceAttributesSequence (0020,9172) vr=SQ, vm=1, type=1C + DRTConversionSourceAttributesSequence ConversionSourceAttributesSequence; + /// ContentQualification (0018,9004) vr=CS, vm=1, type=3 + DcmCodeString ContentQualification; + /// PrivateDataElementCharacteristicsSequence (0008,0300) vr=SQ, vm=1, type=3 + DRTPrivateDataElementCharacteristicsSequence PrivateDataElementCharacteristicsSequence; + + // --- CommonInstanceReferenceModule (U) --- + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1C + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudiesContainingOtherReferencedInstancesSequence (0008,1200) vr=SQ, vm=1, type=1C + DRTStudiesContainingOtherReferencedInstancesSequence StudiesContainingOtherReferencedInstancesSequence; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drtiontr.h b/dcmrt/include/dcmtk/dcmrt/drtiontr.h new file mode 100644 index 00000000..ae4e896e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drtiontr.h @@ -0,0 +1,3220 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonBeamsTreatmentRecordIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIONTR_H +#define DRTIONTR_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtadcs.h" // for AdmittingDiagnosesCodeSequence +#include "dcmtk/dcmrt/seq/drtbrs.h" // for BreedRegistrationSequence +#include "dcmtk/dcmrt/seq/drtcdrs.h" // for CalculatedDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtcsis.h" // for CodingSchemeIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcctus.h" // for ConsentForClinicalTrialUseSequence +#include "dcmtk/dcmrt/seq/drtcpis.h" // for ConsultingPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcgis.h" // for ContextGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtces.h" // for ContributingEquipmentSequence +#include "dcmtk/dcmrt/seq/drtcsas.h" // for ConversionSourceAttributesSequence +#include "dcmtk/dcmrt/seq/drtdimcs.h" // for DeidentificationMethodCodeSequence +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence +#include "dcmtk/dcmrt/seq/drtdss.h" // for DigitalSignaturesSequence +#include "dcmtk/dcmrt/seq/drteas.h" // for EncryptedAttributesSequence +#include "dcmtk/dcmrt/seq/drtfgss.h" // for FractionGroupSummarySequence +#include "dcmtk/dcmrt/seq/drtgms.h" // for GeneticModificationsSequence +#include "dcmtk/dcmrt/seq/drtgpis.h" // for GroupOfPatientsIdentificationSequence +#include "dcmtk/dcmrt/seq/drthsdrs.h" // for HL7StructuredDocumentReferenceSequence +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtiais.h" // for IssuerOfAdmissionIDSequence +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence +#include "dcmtk/dcmrt/seq/drtiseis.h" // for IssuerOfServiceEpisodeIDSequence +#include "dcmtk/dcmrt/seq/drtmps.h" // for MACParametersSequence +#include "dcmtk/dcmrt/seq/drtmris.h" // for MappingResourceIdentificationSequence +#include "dcmtk/dcmrt/seq/drtmdrs.h" // for MeasuredDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtoas.h" // for OriginalAttributesSequence +#include "dcmtk/dcmrt/seq/drtopis.h" // for OtherPatientIDsSequence +#include "dcmtk/dcmrt/seq/drtpbcs.h" // for PatientBreedCodeSequence +#include "dcmtk/dcmrt/seq/drtpss.h" // for PatientSetupSequence +#include "dcmtk/dcmrt/seq/drtpsics.h" // for PatientSizeCodeSequence +#include "dcmtk/dcmrt/seq/drtpscs.h" // for PatientSpeciesCodeSequence +#include "dcmtk/dcmrt/seq/drtppcs.h" // for PerformedProtocolCodeSequence +#include "dcmtk/dcmrt/seq/drtporis.h" // for PhysiciansOfRecordIdentificationSequence +#include "dcmtk/dcmrt/seq/drtprsis.h" // for PhysiciansReadingStudyIdentificationSequence +#include "dcmtk/dcmrt/seq/drtpdecs.h" // for PrivateDataElementCharacteristicsSequence +#include "dcmtk/dcmrt/seq/drtpcs.h" // for ProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrppcs.h" // for ReasonForPerformedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrims.h" // for ReferencedImageSequence +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence +#include "dcmtk/dcmrt/seq/drtrpphs.h" // for ReferencedPatientPhotoSequence +#include "dcmtk/dcmrt/seq/drtrps.h" // for ReferencedPatientSequence +#include "dcmtk/dcmrt/seq/drtrppss.h" // for ReferencedPerformedProcedureStepSequence +#include "dcmtk/dcmrt/seq/drtrrtps4.h" // for ReferencedRTPlanSequence +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrtrs4.h" // for ReferencedTreatmentRecordSequence +#include "dcmtk/dcmrt/seq/drtrpis.h" // for ReferringPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtras.h" // for RequestAttributesSequence +#include "dcmtk/dcmrt/seq/drtrscs.h" // for RequestingServiceCodeSequence +#include "dcmtk/dcmrt/seq/drtsdcs.h" // for SeriesDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtsis.h" // for SourceImageSequence +#include "dcmtk/dcmrt/seq/drtsins.h" // for SourceInstanceSequence +#include "dcmtk/dcmrt/seq/drtspgis.h" // for SourcePatientGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtscs.h" // for StrainCodeSequence +#include "dcmtk/dcmrt/seq/drtsss.h" // for StrainStockSequence +#include "dcmtk/dcmrt/seq/drtscris.h" // for StudiesContainingOtherReferencedInstancesSequence +#include "dcmtk/dcmrt/seq/drttms0.h" // for TreatmentMachineSequence +#include "dcmtk/dcmrt/seq/drttsibs.h" // for TreatmentSessionIonBeamSequence +#include "dcmtk/dcmrt/seq/drttscds.h" // for TreatmentSummaryCalculatedDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drttsmds.h" // for TreatmentSummaryMeasuredDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtudis.h" // for UDISequence + + +/** Interface class for RTIonBeamsTreatmentRecordIOD + * @note Because of its many member variables, an instance of this class requires quite + * some memory. So be careful when creating automatic variables from this class (the + * stack size might be exceeded); it is probably better to use the heap space. + */ +class DCMTK_DCMRT_EXPORT DRTIonBeamsTreatmentRecordIOD + : protected DRTTypes +{ + + public: + + // --- constructors, destructor and operators --- + + /** default constructor + */ + DRTIonBeamsTreatmentRecordIOD(); + + /** copy constructor + * @param copy IOD object to be copied + */ + DRTIonBeamsTreatmentRecordIOD(const DRTIonBeamsTreatmentRecordIOD ©); + + /** destructor + */ + virtual ~DRTIonBeamsTreatmentRecordIOD(); + + /** assigment operator + * @param copy IOD object to be copied + * @return reference to this object + */ + DRTIonBeamsTreatmentRecordIOD &operator=(const DRTIonBeamsTreatmentRecordIOD ©); + + // --- general methods --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + // --- input/output methods --- + + /** read object from dataset + * @param dataset reference to DICOM dataset from which the object should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** read PatientData from dataset + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset); + + /** read StudyData from dataset. Also reads PatientData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset); + + /** read SeriesData from dataset. Also reads PatientData, StudyData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSeriesData(DcmItem &dataset); + + /** write object to dataset + * @param dataset reference to DICOM dataset to which the object should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // --- check presence of non-mandatory DICOM modules --- + + /** check whether ClinicalTrialSubjectModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSubjectModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether PatientStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isPatientStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialSeriesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSeriesModulePresent(const OFBool complete = OFFalse); + + /** check whether RTPatientSetupModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTPatientSetupModulePresent(const OFBool complete = OFFalse); + + /** check whether MeasuredDoseReferenceRecordModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isMeasuredDoseReferenceRecordModulePresent(const OFBool complete = OFFalse); + + /** check whether CalculatedDoseReferenceRecordModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCalculatedDoseReferenceRecordModulePresent(const OFBool complete = OFFalse); + + /** check whether RTTreatmentSummaryRecordModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTTreatmentSummaryRecordModulePresent(const OFBool complete = OFFalse); + + /** check whether GeneralReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isGeneralReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether CommonInstanceReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCommonInstanceReferenceModulePresent(const OFBool complete = OFFalse); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get AdditionalPatientHistory (0010,21b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdditionalPatientHistory(OFString &value, const signed long pos = 0) const; + + /** get AdmissionID (0038,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmissionID(OFString &value, const signed long pos = 0) const; + + /** get AdmittingDiagnosesDescription (0008,1080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString &value, const signed long pos = 0) const; + + /** get Allergies (0010,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAllergies(OFString &value, const signed long pos = 0) const; + + /** get AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolName (0012,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesDescription (0012,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesID (0012,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteID (0012,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteName (0012,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSponsorName (0012,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSponsorName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectID (0012,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectReadingID (0012,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectReadingID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointDescription (0012,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointID (0012,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointID(OFString &value, const signed long pos = 0) const; + + /** get CommentsOnThePerformedProcedureStep (0040,0280) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos = 0) const; + + /** get ConsultingPhysicianName (0008,009c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConsultingPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get ContentQualification (0018,9004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, const signed long pos = 0) const; + + /** get CurrentTreatmentStatus (3008,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCurrentTreatmentStatus(OFString &value, const signed long pos = 0) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeidentificationMethod (0012,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeidentificationMethod(OFString &value, const signed long pos = 0) const; + + /** get DerivationDescription (0008,2111) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDerivationDescription(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get EthnicGroup (0010,2160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEthnicGroup(OFString &value, const signed long pos = 0) const; + + /** get FirstTreatmentDate (3008,0054) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFirstTreatmentDate(OFString &value, const signed long pos = 0) const; + + /** get GantryID (0018,1008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryID(OFString &value, const signed long pos = 0) const; + + /** get InstanceCoercionDateTime (0008,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCoercionDateTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationDate (0008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationTime (0008,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreatorUID (0008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get LastMenstrualDate (0010,21d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLastMenstrualDate(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalEventType (0012,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalEventType(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalInformationModified (0028,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalInformationModified(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MedicalAlerts (0010,2000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMedicalAlerts(OFString &value, const signed long pos = 0) const; + + /** get Modality (0008,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, const signed long pos = 0) const; + + /** get MostRecentTreatmentDate (3008,0056) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMostRecentTreatmentDate(OFString &value, const signed long pos = 0) const; + + /** get NameOfPhysiciansReadingStudy (0008,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFractionsPlanned (300a,0078) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFractionsPlanned(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFractionsPlanned (300a,0078) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNumberOfFractionsPlanned(Sint32 &value, const unsigned long pos = 0) const; + + /** get Occupation (0010,2180) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOccupation(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OriginalSpecializedSOPClassUID (0008,001b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get OtherPatientNames (0010,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOtherPatientNames(OFString &value, const signed long pos = 0) const; + + /** get PatientAge (0010,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, const signed long pos = 0) const; + + /** get PatientAlternativeCalendar (0010,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDate (0010,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthTime (0010,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthTime(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientBreedDescription (0010,2292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBreedDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientComments (0010,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientComments(OFString &value, const signed long pos = 0) const; + + /** get PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientIdentityRemoved (0012,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientIdentityRemoved(OFString &value, const signed long pos = 0) const; + + /** get PatientName (0010,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, const signed long pos = 0) const; + + /** get PatientSex (0010,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, const signed long pos = 0) const; + + /** get PatientSexNeutered (0010,2203) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSexNeutered(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSpeciesDescription (0010,2201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSpeciesDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientState (0038,0500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientState(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get PerformedProcedureStepDescription (0040,0254) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndDate (0040,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndTime (0040,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndTime(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepID (0040,0253) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartDate (0040,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartTime (0040,0245) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartTime(OFString &value, const signed long pos = 0) const; + + /** get PhysiciansOfRecord (0008,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhysiciansOfRecord(OFString &value, const signed long pos = 0) const; + + /** get PixelPaddingValue (0028,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PregnancyStatus (0010,21c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPregnancyStatus(Uint16 &value, const unsigned long pos = 0) const; + + /** get PrimaryDosimeterUnit (300a,00b3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPrimaryDosimeterUnit(OFString &value, const signed long pos = 0) const; + + /** get QualityControlSubject (0010,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlSubject(OFString &value, const signed long pos = 0) const; + + /** get QueryRetrieveView (0008,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQueryRetrieveView(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedFractionGroupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferringPhysicianName (0008,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get RelatedGeneralSOPClassUID (0008,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRelatedGeneralSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ResponsibleOrganization (0010,2299) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePerson (0010,2297) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePerson(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePersonRole (0010,2298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePersonRole(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationComment (0100,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationComment(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationDateTime (0100,0420) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationDateTime(OFString &value, const signed long pos = 0) const; + + /** get SOPClassUID (0008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceStatus (0100,0410) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceStatus(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceUID (0008,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesDate (0008,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, const signed long pos = 0) const; + + /** get SeriesDescription (0008,103e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SeriesTime (0008,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeDescription (0038,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeDescription(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeID (0038,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeID(OFString &value, const signed long pos = 0) const; + + /** get SmokingStatus (0010,21a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmokingStatus(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecificCharacterSet (0008,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, const signed long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get StrainAdditionalInformation (0010,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainAdditionalInformation(OFString &value, const signed long pos = 0) const; + + /** get StrainDescription (0010,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainDescription(OFString &value, const signed long pos = 0) const; + + /** get StrainNomenclature (0010,0213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainNomenclature(OFString &value, const signed long pos = 0) const; + + /** get StudyDate (0008,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, const signed long pos = 0) const; + + /** get StudyDescription (0008,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, const signed long pos = 0) const; + + /** get StudyID (0020,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyTime (0008,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, const signed long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get TimezoneOffsetFromUTC (0008,0201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, const signed long pos = 0) const; + + /** get TreatmentDate (3008,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentDate(OFString &value, const signed long pos = 0) const; + + /** get TreatmentStatusComment (3008,0202) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentStatusComment(OFString &value, const signed long pos = 0) const; + + /** get TreatmentTime (3008,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentTime(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return reference to sequence element + */ + DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() + { return AdmittingDiagnosesCodeSequence; } + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return const reference to sequence element + */ + const DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() const + { return AdmittingDiagnosesCodeSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return reference to sequence element + */ + DRTBreedRegistrationSequence &getBreedRegistrationSequence() + { return BreedRegistrationSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return const reference to sequence element + */ + const DRTBreedRegistrationSequence &getBreedRegistrationSequence() const + { return BreedRegistrationSequence; } + + /** get CalculatedDoseReferenceSequence (3008,0070) + * @return reference to sequence element + */ + DRTCalculatedDoseReferenceSequence &getCalculatedDoseReferenceSequence() + { return CalculatedDoseReferenceSequence; } + + /** get CalculatedDoseReferenceSequence (3008,0070) + * @return const reference to sequence element + */ + const DRTCalculatedDoseReferenceSequence &getCalculatedDoseReferenceSequence() const + { return CalculatedDoseReferenceSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return reference to sequence element + */ + DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() + { return CodingSchemeIdentificationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return const reference to sequence element + */ + const DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() const + { return CodingSchemeIdentificationSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return reference to sequence element + */ + DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return const reference to sequence element + */ + const DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() const + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return reference to sequence element + */ + DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() + { return ConsultingPhysicianIdentificationSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return const reference to sequence element + */ + const DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() const + { return ConsultingPhysicianIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return reference to sequence element + */ + DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() + { return ContextGroupIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return const reference to sequence element + */ + const DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() const + { return ContextGroupIdentificationSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return reference to sequence element + */ + DRTContributingEquipmentSequence &getContributingEquipmentSequence() + { return ContributingEquipmentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return const reference to sequence element + */ + const DRTContributingEquipmentSequence &getContributingEquipmentSequence() const + { return ContributingEquipmentSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return reference to sequence element + */ + DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() + { return ConversionSourceAttributesSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return const reference to sequence element + */ + const DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() const + { return ConversionSourceAttributesSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return reference to sequence element + */ + DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() + { return DeidentificationMethodCodeSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return const reference to sequence element + */ + const DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() const + { return DeidentificationMethodCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return reference to sequence element + */ + DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() + { return DigitalSignaturesSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return const reference to sequence element + */ + const DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() const + { return DigitalSignaturesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return reference to sequence element + */ + DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() + { return EncryptedAttributesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return const reference to sequence element + */ + const DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() const + { return EncryptedAttributesSequence; } + + /** get FractionGroupSummarySequence (3008,0220) + * @return reference to sequence element + */ + DRTFractionGroupSummarySequence &getFractionGroupSummarySequence() + { return FractionGroupSummarySequence; } + + /** get FractionGroupSummarySequence (3008,0220) + * @return const reference to sequence element + */ + const DRTFractionGroupSummarySequence &getFractionGroupSummarySequence() const + { return FractionGroupSummarySequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return reference to sequence element + */ + DRTGeneticModificationsSequence &getGeneticModificationsSequence() + { return GeneticModificationsSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return const reference to sequence element + */ + const DRTGeneticModificationsSequence &getGeneticModificationsSequence() const + { return GeneticModificationsSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return reference to sequence element + */ + DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() + { return GroupOfPatientsIdentificationSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return const reference to sequence element + */ + const DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() const + { return GroupOfPatientsIdentificationSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return reference to sequence element + */ + DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() + { return HL7StructuredDocumentReferenceSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return const reference to sequence element + */ + const DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() const + { return HL7StructuredDocumentReferenceSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return reference to sequence element + */ + DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return const reference to sequence element + */ + const DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() const + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return reference to sequence element + */ + DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() + { return IssuerOfServiceEpisodeIDSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return const reference to sequence element + */ + const DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() const + { return IssuerOfServiceEpisodeIDSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return reference to sequence element + */ + DRTMACParametersSequence &getMACParametersSequence() + { return MACParametersSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return const reference to sequence element + */ + const DRTMACParametersSequence &getMACParametersSequence() const + { return MACParametersSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return reference to sequence element + */ + DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() + { return MappingResourceIdentificationSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return const reference to sequence element + */ + const DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() const + { return MappingResourceIdentificationSequence; } + + /** get MeasuredDoseReferenceSequence (3008,0010) + * @return reference to sequence element + */ + DRTMeasuredDoseReferenceSequence &getMeasuredDoseReferenceSequence() + { return MeasuredDoseReferenceSequence; } + + /** get MeasuredDoseReferenceSequence (3008,0010) + * @return const reference to sequence element + */ + const DRTMeasuredDoseReferenceSequence &getMeasuredDoseReferenceSequence() const + { return MeasuredDoseReferenceSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return reference to sequence element + */ + DRTOriginalAttributesSequence &getOriginalAttributesSequence() + { return OriginalAttributesSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return const reference to sequence element + */ + const DRTOriginalAttributesSequence &getOriginalAttributesSequence() const + { return OriginalAttributesSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return reference to sequence element + */ + DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() + { return OtherPatientIDsSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return const reference to sequence element + */ + const DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() const + { return OtherPatientIDsSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return reference to sequence element + */ + DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() + { return PatientBreedCodeSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return const reference to sequence element + */ + const DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() const + { return PatientBreedCodeSequence; } + + /** get PatientSetupSequence (300a,0180) + * @return reference to sequence element + */ + DRTPatientSetupSequence &getPatientSetupSequence() + { return PatientSetupSequence; } + + /** get PatientSetupSequence (300a,0180) + * @return const reference to sequence element + */ + const DRTPatientSetupSequence &getPatientSetupSequence() const + { return PatientSetupSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return reference to sequence element + */ + DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() + { return PatientSizeCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return const reference to sequence element + */ + const DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() const + { return PatientSizeCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return reference to sequence element + */ + DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() + { return PatientSpeciesCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return const reference to sequence element + */ + const DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() const + { return PatientSpeciesCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return reference to sequence element + */ + DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() + { return PerformedProtocolCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return const reference to sequence element + */ + const DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() const + { return PerformedProtocolCodeSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return reference to sequence element + */ + DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return const reference to sequence element + */ + const DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() const + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return reference to sequence element + */ + DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return const reference to sequence element + */ + const DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() const + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return reference to sequence element + */ + DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() + { return PrivateDataElementCharacteristicsSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return const reference to sequence element + */ + const DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() const + { return PrivateDataElementCharacteristicsSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return reference to sequence element + */ + DRTProcedureCodeSequence &getProcedureCodeSequence() + { return ProcedureCodeSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return const reference to sequence element + */ + const DRTProcedureCodeSequence &getProcedureCodeSequence() const + { return ProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return reference to sequence element + */ + DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return const reference to sequence element + */ + const DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() const + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return reference to sequence element + */ + DRTReferencedImageSequence &getReferencedImageSequence() + { return ReferencedImageSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return const reference to sequence element + */ + const DRTReferencedImageSequence &getReferencedImageSequence() const + { return ReferencedImageSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return reference to sequence element + */ + DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return const reference to sequence element + */ + const DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() const + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return reference to sequence element + */ + DRTReferencedPatientSequence &getReferencedPatientSequence() + { return ReferencedPatientSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return const reference to sequence element + */ + const DRTReferencedPatientSequence &getReferencedPatientSequence() const + { return ReferencedPatientSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return reference to sequence element + */ + DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return const reference to sequence element + */ + const DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() const + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return reference to sequence element + */ + DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule &getReferencedRTPlanSequence() + { return ReferencedRTPlanSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return const reference to sequence element + */ + const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule &getReferencedRTPlanSequence() const + { return ReferencedRTPlanSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get ReferencedTreatmentRecordSequence (3008,0030) + * @return reference to sequence element + */ + DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule &getReferencedTreatmentRecordSequence() + { return ReferencedTreatmentRecordSequence; } + + /** get ReferencedTreatmentRecordSequence (3008,0030) + * @return const reference to sequence element + */ + const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule &getReferencedTreatmentRecordSequence() const + { return ReferencedTreatmentRecordSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return reference to sequence element + */ + DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() + { return ReferringPhysicianIdentificationSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return const reference to sequence element + */ + const DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() const + { return ReferringPhysicianIdentificationSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return reference to sequence element + */ + DRTRequestAttributesSequence &getRequestAttributesSequence() + { return RequestAttributesSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return const reference to sequence element + */ + const DRTRequestAttributesSequence &getRequestAttributesSequence() const + { return RequestAttributesSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return reference to sequence element + */ + DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() + { return RequestingServiceCodeSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return const reference to sequence element + */ + const DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() const + { return RequestingServiceCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return reference to sequence element + */ + DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() + { return SeriesDescriptionCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return const reference to sequence element + */ + const DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() const + { return SeriesDescriptionCodeSequence; } + + /** get SourceImageSequence (0008,2112) + * @return reference to sequence element + */ + DRTSourceImageSequence &getSourceImageSequence() + { return SourceImageSequence; } + + /** get SourceImageSequence (0008,2112) + * @return const reference to sequence element + */ + const DRTSourceImageSequence &getSourceImageSequence() const + { return SourceImageSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return reference to sequence element + */ + DRTSourceInstanceSequence &getSourceInstanceSequence() + { return SourceInstanceSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return const reference to sequence element + */ + const DRTSourceInstanceSequence &getSourceInstanceSequence() const + { return SourceInstanceSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return reference to sequence element + */ + DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() + { return SourcePatientGroupIdentificationSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return const reference to sequence element + */ + const DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() const + { return SourcePatientGroupIdentificationSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return reference to sequence element + */ + DRTStrainCodeSequence &getStrainCodeSequence() + { return StrainCodeSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return const reference to sequence element + */ + const DRTStrainCodeSequence &getStrainCodeSequence() const + { return StrainCodeSequence; } + + /** get StrainStockSequence (0010,0216) + * @return reference to sequence element + */ + DRTStrainStockSequence &getStrainStockSequence() + { return StrainStockSequence; } + + /** get StrainStockSequence (0010,0216) + * @return const reference to sequence element + */ + const DRTStrainStockSequence &getStrainStockSequence() const + { return StrainStockSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return reference to sequence element + */ + DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return const reference to sequence element + */ + const DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() const + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get TreatmentMachineSequence (300a,0206) + * @return reference to sequence element + */ + DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule &getTreatmentMachineSequence() + { return TreatmentMachineSequence; } + + /** get TreatmentMachineSequence (300a,0206) + * @return const reference to sequence element + */ + const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule &getTreatmentMachineSequence() const + { return TreatmentMachineSequence; } + + /** get TreatmentSessionIonBeamSequence (3008,0021) + * @return reference to sequence element + */ + DRTTreatmentSessionIonBeamSequence &getTreatmentSessionIonBeamSequence() + { return TreatmentSessionIonBeamSequence; } + + /** get TreatmentSessionIonBeamSequence (3008,0021) + * @return const reference to sequence element + */ + const DRTTreatmentSessionIonBeamSequence &getTreatmentSessionIonBeamSequence() const + { return TreatmentSessionIonBeamSequence; } + + /** get TreatmentSummaryCalculatedDoseReferenceSequence (3008,0050) + * @return reference to sequence element + */ + DRTTreatmentSummaryCalculatedDoseReferenceSequence &getTreatmentSummaryCalculatedDoseReferenceSequence() + { return TreatmentSummaryCalculatedDoseReferenceSequence; } + + /** get TreatmentSummaryCalculatedDoseReferenceSequence (3008,0050) + * @return const reference to sequence element + */ + const DRTTreatmentSummaryCalculatedDoseReferenceSequence &getTreatmentSummaryCalculatedDoseReferenceSequence() const + { return TreatmentSummaryCalculatedDoseReferenceSequence; } + + /** get TreatmentSummaryMeasuredDoseReferenceSequence (3008,00e0) + * @return reference to sequence element + */ + DRTTreatmentSummaryMeasuredDoseReferenceSequence &getTreatmentSummaryMeasuredDoseReferenceSequence() + { return TreatmentSummaryMeasuredDoseReferenceSequence; } + + /** get TreatmentSummaryMeasuredDoseReferenceSequence (3008,00e0) + * @return const reference to sequence element + */ + const DRTTreatmentSummaryMeasuredDoseReferenceSequence &getTreatmentSummaryMeasuredDoseReferenceSequence() const + { return TreatmentSummaryMeasuredDoseReferenceSequence; } + + /** get UDISequence (0018,100a) + * @return reference to sequence element + */ + DRTUDISequence &getUDISequence() + { return UDISequence; } + + /** get UDISequence (0018,100a) + * @return const reference to sequence element + */ + const DRTUDISequence &getUDISequence() const + { return UDISequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AdditionalPatientHistory (0010,21b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdditionalPatientHistory(const OFString &value, const OFBool check = OFTrue); + + /** set AdmissionID (0038,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmissionID(const OFString &value, const OFBool check = OFTrue); + + /** set AdmittingDiagnosesDescription (0008,1080) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set Allergies (0010,2110) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAllergies(const OFString &value, const OFBool check = OFTrue); + + /** set AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolName (0012,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesDescription (0012,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesID (0012,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteID (0012,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteName (0012,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSponsorName (0012,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSponsorName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectID (0012,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectReadingID (0012,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointDescription (0012,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointID (0012,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointID(const OFString &value, const OFBool check = OFTrue); + + /** set CommentsOnThePerformedProcedureStep (0040,0280) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check = OFTrue); + + /** set ConsultingPhysicianName (0008,009c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConsultingPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set ContentQualification (0018,9004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, const OFBool check = OFTrue); + + /** set CurrentTreatmentStatus (3008,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCurrentTreatmentStatus(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeidentificationMethod (0012,0063) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeidentificationMethod(const OFString &value, const OFBool check = OFTrue); + + /** set DerivationDescription (0008,2111) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDerivationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set EthnicGroup (0010,2160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEthnicGroup(const OFString &value, const OFBool check = OFTrue); + + /** set FirstTreatmentDate (3008,0054) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFirstTreatmentDate(const OFString &value, const OFBool check = OFTrue); + + /** set GantryID (0018,1008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCoercionDateTime (0008,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCoercionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationDate (0008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationTime (0008,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreatorUID (0008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceNumber (0020,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set LastMenstrualDate (0010,21d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLastMenstrualDate(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalEventType (0012,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalEventType(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalInformationModified (0028,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos = 0); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredAPDimension (0010,1023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredAPDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredLateralDimension (0010,1024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredLateralDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MedicalAlerts (0010,2000) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMedicalAlerts(const OFString &value, const OFBool check = OFTrue); + + /** set Modality (0008,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, const OFBool check = OFTrue); + + /** set MostRecentTreatmentDate (3008,0056) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMostRecentTreatmentDate(const OFString &value, const OFBool check = OFTrue); + + /** set NameOfPhysiciansReadingStudy (0008,1060) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFractionsPlanned (300a,0078) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNumberOfFractionsPlanned(const OFString &value, const OFBool check = OFTrue); + + /** set Occupation (0010,2180) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOccupation(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OriginalSpecializedSOPClassUID (0008,001b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set OtherPatientNames (0010,1001) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOtherPatientNames(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAge (0010,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAlternativeCalendar (0010,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDate (0010,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthTime (0010,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthTime(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBodyMassIndex (0010,1022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBodyMassIndex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBreedDescription (0010,2292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBreedDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientComments (0010,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientComments(const OFString &value, const OFBool check = OFTrue); + + /** set PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientIdentityRemoved (0012,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientIdentityRemoved(const OFString &value, const OFBool check = OFTrue); + + /** set PatientName (0010,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSex (0010,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSexNeutered (0010,2203) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSexNeutered(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSize (0010,1020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSpeciesDescription (0010,2201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSpeciesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientState (0038,0500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientState(const OFString &value, const OFBool check = OFTrue); + + /** set PatientWeight (0010,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepDescription (0040,0254) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndDate (0040,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndTime (0040,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndTime(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepID (0040,0253) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartDate (0040,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartTime (0040,0245) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set PhysiciansOfRecord (0008,1048) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhysiciansOfRecord(const OFString &value, const OFBool check = OFTrue); + + /** set PixelPaddingValue (0028,0120) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingValue(const Uint16 value, const unsigned long pos = 0); + + /** set PregnancyStatus (0010,21c0) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPregnancyStatus(const Uint16 value, const unsigned long pos = 0); + + /** set PrimaryDosimeterUnit (300a,00b3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPrimaryDosimeterUnit(const OFString &value, const OFBool check = OFTrue); + + /** set QualityControlSubject (0010,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlSubject(const OFString &value, const OFBool check = OFTrue); + + /** set QueryRetrieveView (0008,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQueryRetrieveView(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedFractionGroupNumber (300c,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferencedFractionGroupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferringPhysicianName (0008,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set RelatedGeneralSOPClassUID (0008,001a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsibleOrganization (0010,2299) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePerson (0010,2297) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePerson(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePersonRole (0010,2298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePersonRole(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationComment (0100,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationComment(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationDateTime (0100,0420) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set SOPClassUID (0008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceStatus (0100,0410) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceUID (0008,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDate (0008,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDescription (0008,103e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesNumber (0020,0011) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesTime (0008,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeDescription (0038,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeID (0038,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeID(const OFString &value, const OFBool check = OFTrue); + + /** set SmokingStatus (0010,21a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmokingStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set SpecificCharacterSet (0008,0005) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set StrainAdditionalInformation (0010,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainAdditionalInformation(const OFString &value, const OFBool check = OFTrue); + + /** set StrainDescription (0010,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StrainNomenclature (0010,0213) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainNomenclature(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDate (0008,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDescription (0008,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StudyID (0020,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyTime (0008,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set TimezoneOffsetFromUTC (0008,0201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentDate (3008,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentDate(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentStatusComment (3008,0202) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentStatusComment(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentTime (3008,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentTime(const OFString &value, const OFBool check = OFTrue); + + + protected: + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attribute + * SOPClassUID (0008,0016) with the expected value. Any incorrectness regarding + * this attribute is reported to the log stream (if enabled for error messages). + * @param dataset DICOM dataset to be checked + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset); + + /** update various DICOM attributes + */ + void updateAttributes(); + + private: + + // DICOM attributes are listed ordered by module + + // --- PatientModule (M) --- + + /// PatientName (0010,0010) vr=PN, vm=1, type=2 + DcmPersonName PatientName; + /// PatientID (0010,0020) vr=LO, vm=1, type=2 + DcmLongString PatientID; + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientBirthDate (0010,0030) vr=DA, vm=1, type=2 + DcmDate PatientBirthDate; + /// PatientBirthDateInAlternativeCalendar (0010,0033) vr=LO, vm=1, type=3 + DcmLongString PatientBirthDateInAlternativeCalendar; + /// PatientDeathDateInAlternativeCalendar (0010,0034) vr=LO, vm=1, type=3 + DcmLongString PatientDeathDateInAlternativeCalendar; + /// PatientAlternativeCalendar (0010,0035) vr=CS, vm=1, type=1C + DcmCodeString PatientAlternativeCalendar; + /// PatientSex (0010,0040) vr=CS, vm=1, type=2 + DcmCodeString PatientSex; + /// ReferencedPatientPhotoSequence (0010,1100) vr=SQ, vm=1, type=3 + DRTReferencedPatientPhotoSequence ReferencedPatientPhotoSequence; + /// QualityControlSubject (0010,0200) vr=CS, vm=1, type=3 + DcmCodeString QualityControlSubject; + /// ReferencedPatientSequence (0008,1120) vr=SQ, vm=1, type=3 + DRTReferencedPatientSequence ReferencedPatientSequence; + /// PatientBirthTime (0010,0032) vr=TM, vm=1, type=3 + DcmTime PatientBirthTime; + /// OtherPatientIDsSequence (0010,1002) vr=SQ, vm=1, type=3 + DRTOtherPatientIDsSequence OtherPatientIDsSequence; + /// OtherPatientNames (0010,1001) vr=PN, vm=1-n, type=3 + DcmPersonName OtherPatientNames; + /// EthnicGroup (0010,2160) vr=SH, vm=1, type=3 + DcmShortString EthnicGroup; + /// PatientComments (0010,4000) vr=LT, vm=1, type=3 + DcmLongText PatientComments; + /// PatientSpeciesDescription (0010,2201) vr=LO, vm=1, type=1C + DcmLongString PatientSpeciesDescription; + /// PatientSpeciesCodeSequence (0010,2202) vr=SQ, vm=1, type=1C + DRTPatientSpeciesCodeSequence PatientSpeciesCodeSequence; + /// PatientBreedDescription (0010,2292) vr=LO, vm=1, type=2C + DcmLongString PatientBreedDescription; + /// PatientBreedCodeSequence (0010,2293) vr=SQ, vm=1, type=2C + DRTPatientBreedCodeSequence PatientBreedCodeSequence; + /// BreedRegistrationSequence (0010,2294) vr=SQ, vm=1, type=2C + DRTBreedRegistrationSequence BreedRegistrationSequence; + /// StrainDescription (0010,0212) vr=UC, vm=1, type=3 + DcmUnlimitedCharacters StrainDescription; + /// StrainNomenclature (0010,0213) vr=LO, vm=1, type=3 + DcmLongString StrainNomenclature; + /// StrainCodeSequence (0010,0219) vr=SQ, vm=1, type=3 + DRTStrainCodeSequence StrainCodeSequence; + /// StrainAdditionalInformation (0010,0218) vr=UT, vm=1, type=3 + DcmUnlimitedText StrainAdditionalInformation; + /// StrainStockSequence (0010,0216) vr=SQ, vm=1, type=3 + DRTStrainStockSequence StrainStockSequence; + /// GeneticModificationsSequence (0010,0221) vr=SQ, vm=1, type=3 + DRTGeneticModificationsSequence GeneticModificationsSequence; + /// ResponsiblePerson (0010,2297) vr=PN, vm=1, type=2C + DcmPersonName ResponsiblePerson; + /// ResponsiblePersonRole (0010,2298) vr=CS, vm=1, type=1C + DcmCodeString ResponsiblePersonRole; + /// ResponsibleOrganization (0010,2299) vr=LO, vm=1, type=2C + DcmLongString ResponsibleOrganization; + /// PatientIdentityRemoved (0012,0062) vr=CS, vm=1, type=3 + DcmCodeString PatientIdentityRemoved; + /// DeidentificationMethod (0012,0063) vr=LO, vm=1-n, type=1C + DcmLongString DeidentificationMethod; + /// DeidentificationMethodCodeSequence (0012,0064) vr=SQ, vm=1, type=1C + DRTDeidentificationMethodCodeSequence DeidentificationMethodCodeSequence; + /// SourcePatientGroupIdentificationSequence (0010,0026) vr=SQ, vm=1, type=3 + DRTSourcePatientGroupIdentificationSequence SourcePatientGroupIdentificationSequence; + /// GroupOfPatientsIdentificationSequence (0010,0027) vr=SQ, vm=1, type=3 + DRTGroupOfPatientsIdentificationSequence GroupOfPatientsIdentificationSequence; + + // --- ClinicalTrialSubjectModule (U) --- + + /// ClinicalTrialSponsorName (0012,0010) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialSponsorName; + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialProtocolID; + /// ClinicalTrialProtocolName (0012,0021) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialProtocolName; + /// ClinicalTrialSiteID (0012,0030) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteID; + /// ClinicalTrialSiteName (0012,0031) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteName; + /// ClinicalTrialSubjectID (0012,0040) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectID; + /// ClinicalTrialSubjectReadingID (0012,0042) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectReadingID; + /// ClinicalTrialProtocolEthicsCommitteeName (0012,0081) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolEthicsCommitteeName; + /// ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + + // --- GeneralStudyModule (M) --- + + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + /// StudyDate (0008,0020) vr=DA, vm=1, type=2 + DcmDate StudyDate; + /// StudyTime (0008,0030) vr=TM, vm=1, type=2 + DcmTime StudyTime; + /// ReferringPhysicianName (0008,0090) vr=PN, vm=1, type=2 + DcmPersonName ReferringPhysicianName; + /// ReferringPhysicianIdentificationSequence (0008,0096) vr=SQ, vm=1, type=3 + DRTReferringPhysicianIdentificationSequence ReferringPhysicianIdentificationSequence; + /// ConsultingPhysicianName (0008,009c) vr=PN, vm=1-n, type=3 + DcmPersonName ConsultingPhysicianName; + /// ConsultingPhysicianIdentificationSequence (0008,009d) vr=SQ, vm=1, type=3 + DRTConsultingPhysicianIdentificationSequence ConsultingPhysicianIdentificationSequence; + /// StudyID (0020,0010) vr=SH, vm=1, type=2 + DcmShortString StudyID; + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=2 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// StudyDescription (0008,1030) vr=LO, vm=1, type=3 + DcmLongString StudyDescription; + /// PhysiciansOfRecord (0008,1048) vr=PN, vm=1-n, type=3 + DcmPersonName PhysiciansOfRecord; + /// PhysiciansOfRecordIdentificationSequence (0008,1049) vr=SQ, vm=1, type=3 + DRTPhysiciansOfRecordIdentificationSequence PhysiciansOfRecordIdentificationSequence; + /// NameOfPhysiciansReadingStudy (0008,1060) vr=PN, vm=1-n, type=3 + DcmPersonName NameOfPhysiciansReadingStudy; + /// PhysiciansReadingStudyIdentificationSequence (0008,1062) vr=SQ, vm=1, type=3 + DRTPhysiciansReadingStudyIdentificationSequence PhysiciansReadingStudyIdentificationSequence; + /// RequestingServiceCodeSequence (0032,1034) vr=SQ, vm=1, type=3 + DRTRequestingServiceCodeSequence RequestingServiceCodeSequence; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// ProcedureCodeSequence (0008,1032) vr=SQ, vm=1, type=3 + DRTProcedureCodeSequence ProcedureCodeSequence; + /// ReasonForPerformedProcedureCodeSequence (0040,1012) vr=SQ, vm=1, type=3 + DRTReasonForPerformedProcedureCodeSequence ReasonForPerformedProcedureCodeSequence; + + // --- ClinicalTrialStudyModule (U) --- + + /// ClinicalTrialTimePointID (0012,0050) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialTimePointID; + /// ClinicalTrialTimePointDescription (0012,0051) vr=ST, vm=1, type=3 + DcmShortText ClinicalTrialTimePointDescription; + /// LongitudinalTemporalOffsetFromEvent (0012,0052) vr=FD, vm=1, type=3 + DcmFloatingPointDouble LongitudinalTemporalOffsetFromEvent; + /// LongitudinalTemporalEventType (0012,0053) vr=CS, vm=1, type=1C + DcmCodeString LongitudinalTemporalEventType; + /// ConsentForClinicalTrialUseSequence (0012,0083) vr=SQ, vm=1, type=3 + DRTConsentForClinicalTrialUseSequence ConsentForClinicalTrialUseSequence; + + // --- PatientStudyModule (U) --- + + /// AdmittingDiagnosesDescription (0008,1080) vr=LO, vm=1-n, type=3 + DcmLongString AdmittingDiagnosesDescription; + /// AdmittingDiagnosesCodeSequence (0008,1084) vr=SQ, vm=1, type=3 + DRTAdmittingDiagnosesCodeSequence AdmittingDiagnosesCodeSequence; + /// PatientAge (0010,1010) vr=AS, vm=1, type=3 + DcmAgeString PatientAge; + /// PatientSize (0010,1020) vr=DS, vm=1, type=3 + DcmDecimalString PatientSize; + /// PatientWeight (0010,1030) vr=DS, vm=1, type=3 + DcmDecimalString PatientWeight; + /// PatientBodyMassIndex (0010,1022) vr=DS, vm=1, type=3 + DcmDecimalString PatientBodyMassIndex; + /// MeasuredAPDimension (0010,1023) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredAPDimension; + /// MeasuredLateralDimension (0010,1024) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredLateralDimension; + /// PatientSizeCodeSequence (0010,1021) vr=SQ, vm=1, type=3 + DRTPatientSizeCodeSequence PatientSizeCodeSequence; + /// MedicalAlerts (0010,2000) vr=LO, vm=1-n, type=3 + DcmLongString MedicalAlerts; + /// Allergies (0010,2110) vr=LO, vm=1-n, type=3 + DcmLongString Allergies; + /// SmokingStatus (0010,21a0) vr=CS, vm=1, type=3 + DcmCodeString SmokingStatus; + /// PregnancyStatus (0010,21c0) vr=US, vm=1, type=3 + DcmUnsignedShort PregnancyStatus; + /// LastMenstrualDate (0010,21d0) vr=DA, vm=1, type=3 + DcmDate LastMenstrualDate; + /// PatientState (0038,0500) vr=LO, vm=1, type=3 + DcmLongString PatientState; + /// Occupation (0010,2180) vr=SH, vm=1, type=3 + DcmShortString Occupation; + /// AdditionalPatientHistory (0010,21b0) vr=LT, vm=1, type=3 + DcmLongText AdditionalPatientHistory; + /// AdmissionID (0038,0010) vr=LO, vm=1, type=3 + DcmLongString AdmissionID; + /// IssuerOfAdmissionIDSequence (0038,0014) vr=SQ, vm=1, type=3 + DRTIssuerOfAdmissionIDSequence IssuerOfAdmissionIDSequence; + /// ServiceEpisodeID (0038,0060) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeID; + /// IssuerOfServiceEpisodeIDSequence (0038,0064) vr=SQ, vm=1, type=3 + DRTIssuerOfServiceEpisodeIDSequence IssuerOfServiceEpisodeIDSequence; + /// ServiceEpisodeDescription (0038,0062) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeDescription; + /// PatientSexNeutered (0010,2203) vr=CS, vm=1, type=2C + DcmCodeString PatientSexNeutered; + + // --- RTSeriesModule (M) --- + + /// Modality (0008,0060) vr=CS, vm=1, type=1 + DcmCodeString Modality; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + /// SeriesNumber (0020,0011) vr=IS, vm=1, type=2 + DcmIntegerString SeriesNumber; + /// SeriesDate (0008,0021) vr=DA, vm=1, type=3 + DcmDate SeriesDate; + /// SeriesTime (0008,0031) vr=TM, vm=1, type=3 + DcmTime SeriesTime; + /// SeriesDescription (0008,103e) vr=LO, vm=1, type=3 + DcmLongString SeriesDescription; + /// SeriesDescriptionCodeSequence (0008,103f) vr=SQ, vm=1, type=3 + DRTSeriesDescriptionCodeSequence SeriesDescriptionCodeSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// ReferencedPerformedProcedureStepSequence (0008,1111) vr=SQ, vm=1, type=3 + DRTReferencedPerformedProcedureStepSequence ReferencedPerformedProcedureStepSequence; + /// RequestAttributesSequence (0040,0275) vr=SQ, vm=1, type=3 + DRTRequestAttributesSequence RequestAttributesSequence; + /// PerformedProcedureStepID (0040,0253) vr=SH, vm=1, type=3 + DcmShortString PerformedProcedureStepID; + /// PerformedProcedureStepStartDate (0040,0244) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepStartDate; + /// PerformedProcedureStepStartTime (0040,0245) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepStartTime; + /// PerformedProcedureStepEndDate (0040,0250) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepEndDate; + /// PerformedProcedureStepEndTime (0040,0251) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepEndTime; + /// PerformedProcedureStepDescription (0040,0254) vr=LO, vm=1, type=3 + DcmLongString PerformedProcedureStepDescription; + /// PerformedProtocolCodeSequence (0040,0260) vr=SQ, vm=1, type=3 + DRTPerformedProtocolCodeSequence PerformedProtocolCodeSequence; + /// CommentsOnThePerformedProcedureStep (0040,0280) vr=ST, vm=1, type=3 + DcmShortText CommentsOnThePerformedProcedureStep; + + // --- ClinicalTrialSeriesModule (U) --- + + /// ClinicalTrialCoordinatingCenterName (0012,0060) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialCoordinatingCenterName; + /// ClinicalTrialSeriesID (0012,0071) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesID; + /// ClinicalTrialSeriesDescription (0012,0072) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesDescription; + + // --- GeneralEquipmentModule (M) --- + + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// GantryID (0018,1008) vr=LO, vm=1, type=3 + DcmLongString GantryID; + /// UDISequence (0018,100a) vr=SQ, vm=1, type=3 + DRTUDISequence UDISequence; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + /// PixelPaddingValue (0028,0120) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingValue; + + // --- RTGeneralTreatmentRecordModule (M) --- + + /// InstanceNumber (0020,0013) vr=IS, vm=1, type=1 + /// - also defined in: SOPCommonModule + DcmIntegerString InstanceNumber; + /// TreatmentDate (3008,0250) vr=DA, vm=1, type=2 + DcmDate TreatmentDate; + /// TreatmentTime (3008,0251) vr=TM, vm=1, type=2 + DcmTime TreatmentTime; + /// ReferencedRTPlanSequence (300c,0002) vr=SQ, vm=1, type=2 + DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule ReferencedRTPlanSequence; + /// ReferencedTreatmentRecordSequence (3008,0030) vr=SQ, vm=1, type=3 + DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule ReferencedTreatmentRecordSequence; + + // --- RTPatientSetupModule (U) --- + + /// PatientSetupSequence (300a,0180) vr=SQ, vm=1, type=1 + DRTPatientSetupSequence PatientSetupSequence; + + // --- RTTreatmentMachineRecordModule (M) --- + + /// TreatmentMachineSequence (300a,0206) vr=SQ, vm=1, type=1 + DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule TreatmentMachineSequence; + + // --- MeasuredDoseReferenceRecordModule (U) --- + + /// MeasuredDoseReferenceSequence (3008,0010) vr=SQ, vm=1, type=1 + DRTMeasuredDoseReferenceSequence MeasuredDoseReferenceSequence; + + // --- CalculatedDoseReferenceRecordModule (U) --- + + /// CalculatedDoseReferenceSequence (3008,0070) vr=SQ, vm=1, type=1 + DRTCalculatedDoseReferenceSequence CalculatedDoseReferenceSequence; + + // --- RTIonBeamsSessionRecordModule (M) --- + + /// ReferencedFractionGroupNumber (300c,0022) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedFractionGroupNumber; + /// NumberOfFractionsPlanned (300a,0078) vr=IS, vm=1, type=2 + DcmIntegerString NumberOfFractionsPlanned; + /// PrimaryDosimeterUnit (300a,00b3) vr=CS, vm=1, type=1 + DcmCodeString PrimaryDosimeterUnit; + /// TreatmentSessionIonBeamSequence (3008,0021) vr=SQ, vm=1, type=1 + DRTTreatmentSessionIonBeamSequence TreatmentSessionIonBeamSequence; + + // --- RTTreatmentSummaryRecordModule (U) --- + + /// CurrentTreatmentStatus (3008,0200) vr=CS, vm=1, type=1 + DcmCodeString CurrentTreatmentStatus; + /// TreatmentStatusComment (3008,0202) vr=ST, vm=1, type=3 + DcmShortText TreatmentStatusComment; + /// FirstTreatmentDate (3008,0054) vr=DA, vm=1, type=2 + DcmDate FirstTreatmentDate; + /// MostRecentTreatmentDate (3008,0056) vr=DA, vm=1, type=2 + DcmDate MostRecentTreatmentDate; + /// FractionGroupSummarySequence (3008,0220) vr=SQ, vm=1, type=3 + DRTFractionGroupSummarySequence FractionGroupSummarySequence; + /// TreatmentSummaryMeasuredDoseReferenceSequence (3008,00e0) vr=SQ, vm=1, type=3 + DRTTreatmentSummaryMeasuredDoseReferenceSequence TreatmentSummaryMeasuredDoseReferenceSequence; + /// TreatmentSummaryCalculatedDoseReferenceSequence (3008,0050) vr=SQ, vm=1, type=3 + DRTTreatmentSummaryCalculatedDoseReferenceSequence TreatmentSummaryCalculatedDoseReferenceSequence; + + // --- GeneralReferenceModule (U) --- + + /// ReferencedImageSequence (0008,1140) vr=SQ, vm=1, type=3 + DRTReferencedImageSequence ReferencedImageSequence; + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=3 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + /// DerivationDescription (0008,2111) vr=ST, vm=1, type=3 + DcmShortText DerivationDescription; + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// SourceImageSequence (0008,2112) vr=SQ, vm=1, type=3 + DRTSourceImageSequence SourceImageSequence; + /// SourceInstanceSequence (0042,0013) vr=SQ, vm=1, type=3 + DRTSourceInstanceSequence SourceInstanceSequence; + + // --- SOPCommonModule (M) --- + + /// SOPClassUID (0008,0016) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPClassUID; + /// SOPInstanceUID (0008,0018) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPInstanceUID; + /// SpecificCharacterSet (0008,0005) vr=CS, vm=1-n, type=1C + DcmCodeString SpecificCharacterSet; + /// InstanceCreationDate (0008,0012) vr=DA, vm=1, type=3 + DcmDate InstanceCreationDate; + /// InstanceCreationTime (0008,0013) vr=TM, vm=1, type=3 + DcmTime InstanceCreationTime; + /// InstanceCoercionDateTime (0008,0015) vr=DT, vm=1, type=3 + DcmDateTime InstanceCoercionDateTime; + /// InstanceCreatorUID (0008,0014) vr=UI, vm=1, type=3 + DcmUniqueIdentifier InstanceCreatorUID; + /// RelatedGeneralSOPClassUID (0008,001a) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier RelatedGeneralSOPClassUID; + /// OriginalSpecializedSOPClassUID (0008,001b) vr=UI, vm=1, type=3 + DcmUniqueIdentifier OriginalSpecializedSOPClassUID; + /// CodingSchemeIdentificationSequence (0008,0110) vr=SQ, vm=1, type=3 + DRTCodingSchemeIdentificationSequence CodingSchemeIdentificationSequence; + /// ContextGroupIdentificationSequence (0008,0123) vr=SQ, vm=1, type=3 + DRTContextGroupIdentificationSequence ContextGroupIdentificationSequence; + /// MappingResourceIdentificationSequence (0008,0124) vr=SQ, vm=1, type=3 + DRTMappingResourceIdentificationSequence MappingResourceIdentificationSequence; + /// TimezoneOffsetFromUTC (0008,0201) vr=SH, vm=1, type=3 + DcmShortString TimezoneOffsetFromUTC; + /// ContributingEquipmentSequence (0018,a001) vr=SQ, vm=1, type=3 + DRTContributingEquipmentSequence ContributingEquipmentSequence; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: RTGeneralTreatmentRecordModule + // DcmIntegerString InstanceNumber; + /// SOPInstanceStatus (0100,0410) vr=CS, vm=1, type=3 + DcmCodeString SOPInstanceStatus; + /// SOPAuthorizationDateTime (0100,0420) vr=DT, vm=1, type=3 + DcmDateTime SOPAuthorizationDateTime; + /// SOPAuthorizationComment (0100,0424) vr=LT, vm=1, type=3 + DcmLongText SOPAuthorizationComment; + /// AuthorizationEquipmentCertificationNumber (0100,0426) vr=LO, vm=1, type=3 + DcmLongString AuthorizationEquipmentCertificationNumber; + /// MACParametersSequence (4ffe,0001) vr=SQ, vm=1, type=3 + DRTMACParametersSequence MACParametersSequence; + /// DigitalSignaturesSequence (fffa,fffa) vr=SQ, vm=1, type=3 + DRTDigitalSignaturesSequence DigitalSignaturesSequence; + /// EncryptedAttributesSequence (0400,0500) vr=SQ, vm=1, type=1C + DRTEncryptedAttributesSequence EncryptedAttributesSequence; + /// OriginalAttributesSequence (0400,0561) vr=SQ, vm=1, type=3 + DRTOriginalAttributesSequence OriginalAttributesSequence; + /// HL7StructuredDocumentReferenceSequence (0040,a390) vr=SQ, vm=1, type=1C + DRTHL7StructuredDocumentReferenceSequence HL7StructuredDocumentReferenceSequence; + /// LongitudinalTemporalInformationModified (0028,0303) vr=CS, vm=1, type=3 + DcmCodeString LongitudinalTemporalInformationModified; + /// QueryRetrieveView (0008,0053) vr=CS, vm=1, type=1C + DcmCodeString QueryRetrieveView; + /// ConversionSourceAttributesSequence (0020,9172) vr=SQ, vm=1, type=1C + DRTConversionSourceAttributesSequence ConversionSourceAttributesSequence; + /// ContentQualification (0018,9004) vr=CS, vm=1, type=3 + DcmCodeString ContentQualification; + /// PrivateDataElementCharacteristicsSequence (0008,0300) vr=SQ, vm=1, type=3 + DRTPrivateDataElementCharacteristicsSequence PrivateDataElementCharacteristicsSequence; + + // --- CommonInstanceReferenceModule (U) --- + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1C + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudiesContainingOtherReferencedInstancesSequence (0008,1200) vr=SQ, vm=1, type=1C + DRTStudiesContainingOtherReferencedInstancesSequence StudiesContainingOtherReferencedInstancesSequence; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drtplan.h b/dcmrt/include/dcmtk/dcmrt/drtplan.h new file mode 100644 index 00000000..27ccd819 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drtplan.h @@ -0,0 +1,3419 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPlanIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPLAN_H +#define DRTPLAN_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtadcs.h" // for AdmittingDiagnosesCodeSequence +#include "dcmtk/dcmrt/seq/drtass.h" // for ApplicationSetupSequence +#include "dcmtk/dcmrt/seq/drtbs.h" // for BeamSequence +#include "dcmtk/dcmrt/seq/drtbrs.h" // for BreedRegistrationSequence +#include "dcmtk/dcmrt/seq/drtcsis.h" // for CodingSchemeIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcctus.h" // for ConsentForClinicalTrialUseSequence +#include "dcmtk/dcmrt/seq/drtcpis.h" // for ConsultingPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcgis.h" // for ContextGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtces.h" // for ContributingEquipmentSequence +#include "dcmtk/dcmrt/seq/drtcsas.h" // for ConversionSourceAttributesSequence +#include "dcmtk/dcmrt/seq/drtdimcs.h" // for DeidentificationMethodCodeSequence +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence +#include "dcmtk/dcmrt/seq/drtdss.h" // for DigitalSignaturesSequence +#include "dcmtk/dcmrt/seq/drtdrs.h" // for DoseReferenceSequence +#include "dcmtk/dcmrt/seq/drteas.h" // for EncryptedAttributesSequence +#include "dcmtk/dcmrt/seq/drtfgs.h" // for FractionGroupSequence +#include "dcmtk/dcmrt/seq/drtgms.h" // for GeneticModificationsSequence +#include "dcmtk/dcmrt/seq/drtgpis.h" // for GroupOfPatientsIdentificationSequence +#include "dcmtk/dcmrt/seq/drthsdrs.h" // for HL7StructuredDocumentReferenceSequence +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtiais.h" // for IssuerOfAdmissionIDSequence +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence +#include "dcmtk/dcmrt/seq/drtiseis.h" // for IssuerOfServiceEpisodeIDSequence +#include "dcmtk/dcmrt/seq/drtmps.h" // for MACParametersSequence +#include "dcmtk/dcmrt/seq/drtmris.h" // for MappingResourceIdentificationSequence +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtoas.h" // for OriginalAttributesSequence +#include "dcmtk/dcmrt/seq/drtopis.h" // for OtherPatientIDsSequence +#include "dcmtk/dcmrt/seq/drtpbcs.h" // for PatientBreedCodeSequence +#include "dcmtk/dcmrt/seq/drtpss.h" // for PatientSetupSequence +#include "dcmtk/dcmrt/seq/drtpsics.h" // for PatientSizeCodeSequence +#include "dcmtk/dcmrt/seq/drtpscs.h" // for PatientSpeciesCodeSequence +#include "dcmtk/dcmrt/seq/drtppcs.h" // for PerformedProtocolCodeSequence +#include "dcmtk/dcmrt/seq/drtporis.h" // for PhysiciansOfRecordIdentificationSequence +#include "dcmtk/dcmrt/seq/drtprsis.h" // for PhysiciansReadingStudyIdentificationSequence +#include "dcmtk/dcmrt/seq/drtpdecs.h" // for PrivateDataElementCharacteristicsSequence +#include "dcmtk/dcmrt/seq/drtpcs.h" // for ProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrppcs.h" // for ReasonForPerformedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrds.h" // for ReferencedDoseSequence +#include "dcmtk/dcmrt/seq/drtrims.h" // for ReferencedImageSequence +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence +#include "dcmtk/dcmrt/seq/drtrpphs.h" // for ReferencedPatientPhotoSequence +#include "dcmtk/dcmrt/seq/drtrps.h" // for ReferencedPatientSequence +#include "dcmtk/dcmrt/seq/drtrppss.h" // for ReferencedPerformedProcedureStepSequence +#include "dcmtk/dcmrt/seq/drtrrtps3.h" // for ReferencedRTPlanSequence +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence +#include "dcmtk/dcmrt/seq/drtrsss.h" // for ReferencedStructureSetSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrpis.h" // for ReferringPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtras.h" // for RequestAttributesSequence +#include "dcmtk/dcmrt/seq/drtrscs.h" // for RequestingServiceCodeSequence +#include "dcmtk/dcmrt/seq/drtsdcs.h" // for SeriesDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtsis.h" // for SourceImageSequence +#include "dcmtk/dcmrt/seq/drtsins.h" // for SourceInstanceSequence +#include "dcmtk/dcmrt/seq/drtspgis.h" // for SourcePatientGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtss.h" // for SourceSequence +#include "dcmtk/dcmrt/seq/drtscs.h" // for StrainCodeSequence +#include "dcmtk/dcmrt/seq/drtsss.h" // for StrainStockSequence +#include "dcmtk/dcmrt/seq/drtscris.h" // for StudiesContainingOtherReferencedInstancesSequence +#include "dcmtk/dcmrt/seq/drttts.h" // for ToleranceTableSequence +#include "dcmtk/dcmrt/seq/drttms9.h" // for TreatmentMachineSequence +#include "dcmtk/dcmrt/seq/drtudis.h" // for UDISequence + + +/** Interface class for RTPlanIOD + * @note Because of its many member variables, an instance of this class requires quite + * some memory. So be careful when creating automatic variables from this class (the + * stack size might be exceeded); it is probably better to use the heap space. + */ +class DCMTK_DCMRT_EXPORT DRTPlanIOD + : protected DRTTypes +{ + + public: + + // --- constructors, destructor and operators --- + + /** default constructor + */ + DRTPlanIOD(); + + /** copy constructor + * @param copy IOD object to be copied + */ + DRTPlanIOD(const DRTPlanIOD ©); + + /** destructor + */ + virtual ~DRTPlanIOD(); + + /** assigment operator + * @param copy IOD object to be copied + * @return reference to this object + */ + DRTPlanIOD &operator=(const DRTPlanIOD ©); + + // --- general methods --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + // --- input/output methods --- + + /** read object from dataset + * @param dataset reference to DICOM dataset from which the object should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** read PatientData from dataset + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset); + + /** read StudyData from dataset. Also reads PatientData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset); + + /** read SeriesData from dataset. Also reads PatientData, StudyData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSeriesData(DcmItem &dataset); + + /** write object to dataset + * @param dataset reference to DICOM dataset to which the object should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // --- check presence of non-mandatory DICOM modules --- + + /** check whether ClinicalTrialSubjectModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSubjectModulePresent(const OFBool complete = OFFalse); + + /** check whether PatientStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isPatientStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialSeriesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSeriesModulePresent(const OFBool complete = OFFalse); + + /** check whether FrameOfReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isFrameOfReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether RTPrescriptionModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTPrescriptionModulePresent(const OFBool complete = OFFalse); + + /** check whether RTToleranceTablesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTToleranceTablesModulePresent(const OFBool complete = OFFalse); + + /** check whether RTPatientSetupModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTPatientSetupModulePresent(const OFBool complete = OFFalse); + + /** check whether RTFractionSchemeModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTFractionSchemeModulePresent(const OFBool complete = OFFalse); + + /** check whether RTBeamsModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTBeamsModulePresent(const OFBool complete = OFFalse); + + /** check whether RTBrachyApplicationSetupsModule (C) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isRTBrachyApplicationSetupsModulePresent(const OFBool complete = OFFalse); + + /** check whether ApprovalModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isApprovalModulePresent(const OFBool complete = OFFalse); + + /** check whether GeneralReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isGeneralReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether CommonInstanceReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCommonInstanceReferenceModulePresent(const OFBool complete = OFFalse); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get AdditionalPatientHistory (0010,21b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdditionalPatientHistory(OFString &value, const signed long pos = 0) const; + + /** get AdmissionID (0038,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmissionID(OFString &value, const signed long pos = 0) const; + + /** get AdmittingDiagnosesDescription (0008,1080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString &value, const signed long pos = 0) const; + + /** get Allergies (0010,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAllergies(OFString &value, const signed long pos = 0) const; + + /** get ApprovalStatus (300e,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getApprovalStatus(OFString &value, const signed long pos = 0) const; + + /** get AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos = 0) const; + + /** get BrachyTreatmentTechnique (300a,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBrachyTreatmentTechnique(OFString &value, const signed long pos = 0) const; + + /** get BrachyTreatmentType (300a,0202) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getBrachyTreatmentType(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolName (0012,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesDescription (0012,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesID (0012,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteID (0012,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteName (0012,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSponsorName (0012,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSponsorName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectID (0012,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectReadingID (0012,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectReadingID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointDescription (0012,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointID (0012,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointID(OFString &value, const signed long pos = 0) const; + + /** get CommentsOnThePerformedProcedureStep (0040,0280) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos = 0) const; + + /** get ConsultingPhysicianName (0008,009c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConsultingPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get ContentQualification (0018,9004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, const signed long pos = 0) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeidentificationMethod (0012,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeidentificationMethod(OFString &value, const signed long pos = 0) const; + + /** get DerivationDescription (0008,2111) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDerivationDescription(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get EthnicGroup (0010,2160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEthnicGroup(OFString &value, const signed long pos = 0) const; + + /** get FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix (0070,030b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(Float64 &value, const unsigned long pos = 0) const; + + /** get FrameOfReferenceUID (0020,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceUID(OFString &value, const signed long pos = 0) const; + + /** get GantryID (0018,1008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryID(OFString &value, const signed long pos = 0) const; + + /** get InstanceCoercionDateTime (0008,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCoercionDateTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationDate (0008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationTime (0008,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreatorUID (0008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get LastMenstrualDate (0010,21d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLastMenstrualDate(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalEventType (0012,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalEventType(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalInformationModified (0028,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalInformationModified(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MedicalAlerts (0010,2000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMedicalAlerts(OFString &value, const signed long pos = 0) const; + + /** get Modality (0008,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, const signed long pos = 0) const; + + /** get NameOfPhysiciansReadingStudy (0008,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos = 0) const; + + /** get Occupation (0010,2180) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOccupation(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OriginalSpecializedSOPClassUID (0008,001b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get OtherPatientNames (0010,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOtherPatientNames(OFString &value, const signed long pos = 0) const; + + /** get PatientAge (0010,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, const signed long pos = 0) const; + + /** get PatientAlternativeCalendar (0010,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDate (0010,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthTime (0010,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthTime(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientBreedDescription (0010,2292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBreedDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientComments (0010,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientComments(OFString &value, const signed long pos = 0) const; + + /** get PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientIdentityRemoved (0012,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientIdentityRemoved(OFString &value, const signed long pos = 0) const; + + /** get PatientName (0010,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, const signed long pos = 0) const; + + /** get PatientSex (0010,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, const signed long pos = 0) const; + + /** get PatientSexNeutered (0010,2203) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSexNeutered(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSpeciesDescription (0010,2201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSpeciesDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientState (0038,0500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientState(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get PerformedProcedureStepDescription (0040,0254) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndDate (0040,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndTime (0040,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndTime(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepID (0040,0253) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartDate (0040,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartTime (0040,0245) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartTime(OFString &value, const signed long pos = 0) const; + + /** get PhysiciansOfRecord (0008,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhysiciansOfRecord(OFString &value, const signed long pos = 0) const; + + /** get PixelPaddingValue (0028,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PlanIntent (300a,000a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPlanIntent(OFString &value, const signed long pos = 0) const; + + /** get PositionReferenceIndicator (0020,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPositionReferenceIndicator(OFString &value, const signed long pos = 0) const; + + /** get PregnancyStatus (0010,21c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPregnancyStatus(Uint16 &value, const unsigned long pos = 0) const; + + /** get PrescriptionDescription (300a,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPrescriptionDescription(OFString &value, const signed long pos = 0) const; + + /** get QualityControlSubject (0010,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlSubject(OFString &value, const signed long pos = 0) const; + + /** get QueryRetrieveView (0008,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQueryRetrieveView(OFString &value, const signed long pos = 0) const; + + /** get RTPlanDate (300a,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanDate(OFString &value, const signed long pos = 0) const; + + /** get RTPlanDescription (300a,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanDescription(OFString &value, const signed long pos = 0) const; + + /** get RTPlanGeometry (300a,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanGeometry(OFString &value, const signed long pos = 0) const; + + /** get RTPlanLabel (300a,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanLabel(OFString &value, const signed long pos = 0) const; + + /** get RTPlanName (300a,0003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanName(OFString &value, const signed long pos = 0) const; + + /** get RTPlanTime (300a,0007) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRTPlanTime(OFString &value, const signed long pos = 0) const; + + /** get ReferringPhysicianName (0008,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get RelatedGeneralSOPClassUID (0008,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRelatedGeneralSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ResponsibleOrganization (0010,2299) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePerson (0010,2297) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePerson(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePersonRole (0010,2298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePersonRole(OFString &value, const signed long pos = 0) const; + + /** get ReviewDate (300e,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewDate(OFString &value, const signed long pos = 0) const; + + /** get ReviewTime (300e,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewTime(OFString &value, const signed long pos = 0) const; + + /** get ReviewerName (300e,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewerName(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationComment (0100,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationComment(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationDateTime (0100,0420) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationDateTime(OFString &value, const signed long pos = 0) const; + + /** get SOPClassUID (0008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceStatus (0100,0410) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceStatus(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceUID (0008,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesDate (0008,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, const signed long pos = 0) const; + + /** get SeriesDescription (0008,103e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SeriesTime (0008,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeDescription (0038,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeDescription(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeID (0038,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeID(OFString &value, const signed long pos = 0) const; + + /** get SmokingStatus (0010,21a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmokingStatus(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecificCharacterSet (0008,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, const signed long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get StrainAdditionalInformation (0010,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainAdditionalInformation(OFString &value, const signed long pos = 0) const; + + /** get StrainDescription (0010,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainDescription(OFString &value, const signed long pos = 0) const; + + /** get StrainNomenclature (0010,0213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainNomenclature(OFString &value, const signed long pos = 0) const; + + /** get StudyDate (0008,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, const signed long pos = 0) const; + + /** get StudyDescription (0008,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, const signed long pos = 0) const; + + /** get StudyID (0020,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyTime (0008,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, const signed long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get TimezoneOffsetFromUTC (0008,0201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, const signed long pos = 0) const; + + /** get TreatmentProtocols (300a,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentProtocols(OFString &value, const signed long pos = 0) const; + + /** get TreatmentSites (300a,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentSites(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return reference to sequence element + */ + DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() + { return AdmittingDiagnosesCodeSequence; } + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return const reference to sequence element + */ + const DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() const + { return AdmittingDiagnosesCodeSequence; } + + /** get ApplicationSetupSequence (300a,0230) + * @return reference to sequence element + */ + DRTApplicationSetupSequence &getApplicationSetupSequence() + { return ApplicationSetupSequence; } + + /** get ApplicationSetupSequence (300a,0230) + * @return const reference to sequence element + */ + const DRTApplicationSetupSequence &getApplicationSetupSequence() const + { return ApplicationSetupSequence; } + + /** get BeamSequence (300a,00b0) + * @return reference to sequence element + */ + DRTBeamSequence &getBeamSequence() + { return BeamSequence; } + + /** get BeamSequence (300a,00b0) + * @return const reference to sequence element + */ + const DRTBeamSequence &getBeamSequence() const + { return BeamSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return reference to sequence element + */ + DRTBreedRegistrationSequence &getBreedRegistrationSequence() + { return BreedRegistrationSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return const reference to sequence element + */ + const DRTBreedRegistrationSequence &getBreedRegistrationSequence() const + { return BreedRegistrationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return reference to sequence element + */ + DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() + { return CodingSchemeIdentificationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return const reference to sequence element + */ + const DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() const + { return CodingSchemeIdentificationSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return reference to sequence element + */ + DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return const reference to sequence element + */ + const DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() const + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return reference to sequence element + */ + DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() + { return ConsultingPhysicianIdentificationSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return const reference to sequence element + */ + const DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() const + { return ConsultingPhysicianIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return reference to sequence element + */ + DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() + { return ContextGroupIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return const reference to sequence element + */ + const DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() const + { return ContextGroupIdentificationSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return reference to sequence element + */ + DRTContributingEquipmentSequence &getContributingEquipmentSequence() + { return ContributingEquipmentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return const reference to sequence element + */ + const DRTContributingEquipmentSequence &getContributingEquipmentSequence() const + { return ContributingEquipmentSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return reference to sequence element + */ + DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() + { return ConversionSourceAttributesSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return const reference to sequence element + */ + const DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() const + { return ConversionSourceAttributesSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return reference to sequence element + */ + DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() + { return DeidentificationMethodCodeSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return const reference to sequence element + */ + const DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() const + { return DeidentificationMethodCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return reference to sequence element + */ + DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() + { return DigitalSignaturesSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return const reference to sequence element + */ + const DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() const + { return DigitalSignaturesSequence; } + + /** get DoseReferenceSequence (300a,0010) + * @return reference to sequence element + */ + DRTDoseReferenceSequence &getDoseReferenceSequence() + { return DoseReferenceSequence; } + + /** get DoseReferenceSequence (300a,0010) + * @return const reference to sequence element + */ + const DRTDoseReferenceSequence &getDoseReferenceSequence() const + { return DoseReferenceSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return reference to sequence element + */ + DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() + { return EncryptedAttributesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return const reference to sequence element + */ + const DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() const + { return EncryptedAttributesSequence; } + + /** get FractionGroupSequence (300a,0070) + * @return reference to sequence element + */ + DRTFractionGroupSequence &getFractionGroupSequence() + { return FractionGroupSequence; } + + /** get FractionGroupSequence (300a,0070) + * @return const reference to sequence element + */ + const DRTFractionGroupSequence &getFractionGroupSequence() const + { return FractionGroupSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return reference to sequence element + */ + DRTGeneticModificationsSequence &getGeneticModificationsSequence() + { return GeneticModificationsSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return const reference to sequence element + */ + const DRTGeneticModificationsSequence &getGeneticModificationsSequence() const + { return GeneticModificationsSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return reference to sequence element + */ + DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() + { return GroupOfPatientsIdentificationSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return const reference to sequence element + */ + const DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() const + { return GroupOfPatientsIdentificationSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return reference to sequence element + */ + DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() + { return HL7StructuredDocumentReferenceSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return const reference to sequence element + */ + const DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() const + { return HL7StructuredDocumentReferenceSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return reference to sequence element + */ + DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return const reference to sequence element + */ + const DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() const + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return reference to sequence element + */ + DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() + { return IssuerOfServiceEpisodeIDSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return const reference to sequence element + */ + const DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() const + { return IssuerOfServiceEpisodeIDSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return reference to sequence element + */ + DRTMACParametersSequence &getMACParametersSequence() + { return MACParametersSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return const reference to sequence element + */ + const DRTMACParametersSequence &getMACParametersSequence() const + { return MACParametersSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return reference to sequence element + */ + DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() + { return MappingResourceIdentificationSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return const reference to sequence element + */ + const DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() const + { return MappingResourceIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return reference to sequence element + */ + DRTOriginalAttributesSequence &getOriginalAttributesSequence() + { return OriginalAttributesSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return const reference to sequence element + */ + const DRTOriginalAttributesSequence &getOriginalAttributesSequence() const + { return OriginalAttributesSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return reference to sequence element + */ + DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() + { return OtherPatientIDsSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return const reference to sequence element + */ + const DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() const + { return OtherPatientIDsSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return reference to sequence element + */ + DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() + { return PatientBreedCodeSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return const reference to sequence element + */ + const DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() const + { return PatientBreedCodeSequence; } + + /** get PatientSetupSequence (300a,0180) + * @return reference to sequence element + */ + DRTPatientSetupSequence &getPatientSetupSequence() + { return PatientSetupSequence; } + + /** get PatientSetupSequence (300a,0180) + * @return const reference to sequence element + */ + const DRTPatientSetupSequence &getPatientSetupSequence() const + { return PatientSetupSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return reference to sequence element + */ + DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() + { return PatientSizeCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return const reference to sequence element + */ + const DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() const + { return PatientSizeCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return reference to sequence element + */ + DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() + { return PatientSpeciesCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return const reference to sequence element + */ + const DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() const + { return PatientSpeciesCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return reference to sequence element + */ + DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() + { return PerformedProtocolCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return const reference to sequence element + */ + const DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() const + { return PerformedProtocolCodeSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return reference to sequence element + */ + DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return const reference to sequence element + */ + const DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() const + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return reference to sequence element + */ + DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return const reference to sequence element + */ + const DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() const + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return reference to sequence element + */ + DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() + { return PrivateDataElementCharacteristicsSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return const reference to sequence element + */ + const DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() const + { return PrivateDataElementCharacteristicsSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return reference to sequence element + */ + DRTProcedureCodeSequence &getProcedureCodeSequence() + { return ProcedureCodeSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return const reference to sequence element + */ + const DRTProcedureCodeSequence &getProcedureCodeSequence() const + { return ProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return reference to sequence element + */ + DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return const reference to sequence element + */ + const DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() const + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return reference to sequence element + */ + DRTReferencedDoseSequence &getReferencedDoseSequence() + { return ReferencedDoseSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return const reference to sequence element + */ + const DRTReferencedDoseSequence &getReferencedDoseSequence() const + { return ReferencedDoseSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return reference to sequence element + */ + DRTReferencedImageSequence &getReferencedImageSequence() + { return ReferencedImageSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return const reference to sequence element + */ + const DRTReferencedImageSequence &getReferencedImageSequence() const + { return ReferencedImageSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return reference to sequence element + */ + DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return const reference to sequence element + */ + const DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() const + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return reference to sequence element + */ + DRTReferencedPatientSequence &getReferencedPatientSequence() + { return ReferencedPatientSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return const reference to sequence element + */ + const DRTReferencedPatientSequence &getReferencedPatientSequence() const + { return ReferencedPatientSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return reference to sequence element + */ + DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return const reference to sequence element + */ + const DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() const + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return reference to sequence element + */ + DRTReferencedRTPlanSequenceInRTGeneralPlanModule &getReferencedRTPlanSequence() + { return ReferencedRTPlanSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return const reference to sequence element + */ + const DRTReferencedRTPlanSequenceInRTGeneralPlanModule &getReferencedRTPlanSequence() const + { return ReferencedRTPlanSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + /** get ReferencedStructureSetSequence (300c,0060) + * @return reference to sequence element + */ + DRTReferencedStructureSetSequence &getReferencedStructureSetSequence() + { return ReferencedStructureSetSequence; } + + /** get ReferencedStructureSetSequence (300c,0060) + * @return const reference to sequence element + */ + const DRTReferencedStructureSetSequence &getReferencedStructureSetSequence() const + { return ReferencedStructureSetSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return reference to sequence element + */ + DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() + { return ReferringPhysicianIdentificationSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return const reference to sequence element + */ + const DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() const + { return ReferringPhysicianIdentificationSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return reference to sequence element + */ + DRTRequestAttributesSequence &getRequestAttributesSequence() + { return RequestAttributesSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return const reference to sequence element + */ + const DRTRequestAttributesSequence &getRequestAttributesSequence() const + { return RequestAttributesSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return reference to sequence element + */ + DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() + { return RequestingServiceCodeSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return const reference to sequence element + */ + const DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() const + { return RequestingServiceCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return reference to sequence element + */ + DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() + { return SeriesDescriptionCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return const reference to sequence element + */ + const DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() const + { return SeriesDescriptionCodeSequence; } + + /** get SourceImageSequence (0008,2112) + * @return reference to sequence element + */ + DRTSourceImageSequence &getSourceImageSequence() + { return SourceImageSequence; } + + /** get SourceImageSequence (0008,2112) + * @return const reference to sequence element + */ + const DRTSourceImageSequence &getSourceImageSequence() const + { return SourceImageSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return reference to sequence element + */ + DRTSourceInstanceSequence &getSourceInstanceSequence() + { return SourceInstanceSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return const reference to sequence element + */ + const DRTSourceInstanceSequence &getSourceInstanceSequence() const + { return SourceInstanceSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return reference to sequence element + */ + DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() + { return SourcePatientGroupIdentificationSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return const reference to sequence element + */ + const DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() const + { return SourcePatientGroupIdentificationSequence; } + + /** get SourceSequence (300a,0210) + * @return reference to sequence element + */ + DRTSourceSequence &getSourceSequence() + { return SourceSequence; } + + /** get SourceSequence (300a,0210) + * @return const reference to sequence element + */ + const DRTSourceSequence &getSourceSequence() const + { return SourceSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return reference to sequence element + */ + DRTStrainCodeSequence &getStrainCodeSequence() + { return StrainCodeSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return const reference to sequence element + */ + const DRTStrainCodeSequence &getStrainCodeSequence() const + { return StrainCodeSequence; } + + /** get StrainStockSequence (0010,0216) + * @return reference to sequence element + */ + DRTStrainStockSequence &getStrainStockSequence() + { return StrainStockSequence; } + + /** get StrainStockSequence (0010,0216) + * @return const reference to sequence element + */ + const DRTStrainStockSequence &getStrainStockSequence() const + { return StrainStockSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return reference to sequence element + */ + DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return const reference to sequence element + */ + const DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() const + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get ToleranceTableSequence (300a,0040) + * @return reference to sequence element + */ + DRTToleranceTableSequence &getToleranceTableSequence() + { return ToleranceTableSequence; } + + /** get ToleranceTableSequence (300a,0040) + * @return const reference to sequence element + */ + const DRTToleranceTableSequence &getToleranceTableSequence() const + { return ToleranceTableSequence; } + + /** get TreatmentMachineSequence (300a,0206) + * @return reference to sequence element + */ + DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule &getTreatmentMachineSequence() + { return TreatmentMachineSequence; } + + /** get TreatmentMachineSequence (300a,0206) + * @return const reference to sequence element + */ + const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule &getTreatmentMachineSequence() const + { return TreatmentMachineSequence; } + + /** get UDISequence (0018,100a) + * @return reference to sequence element + */ + DRTUDISequence &getUDISequence() + { return UDISequence; } + + /** get UDISequence (0018,100a) + * @return const reference to sequence element + */ + const DRTUDISequence &getUDISequence() const + { return UDISequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AdditionalPatientHistory (0010,21b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdditionalPatientHistory(const OFString &value, const OFBool check = OFTrue); + + /** set AdmissionID (0038,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmissionID(const OFString &value, const OFBool check = OFTrue); + + /** set AdmittingDiagnosesDescription (0008,1080) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set Allergies (0010,2110) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAllergies(const OFString &value, const OFBool check = OFTrue); + + /** set ApprovalStatus (300e,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setApprovalStatus(const OFString &value, const OFBool check = OFTrue); + + /** set AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyTreatmentTechnique (300a,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBrachyTreatmentTechnique(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyTreatmentType (300a,0202) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setBrachyTreatmentType(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolName (0012,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesDescription (0012,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesID (0012,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteID (0012,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteName (0012,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSponsorName (0012,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSponsorName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectID (0012,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectReadingID (0012,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointDescription (0012,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointID (0012,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointID(const OFString &value, const OFBool check = OFTrue); + + /** set CommentsOnThePerformedProcedureStep (0040,0280) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check = OFTrue); + + /** set ConsultingPhysicianName (0008,009c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConsultingPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set ContentQualification (0018,9004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeidentificationMethod (0012,0063) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeidentificationMethod(const OFString &value, const OFBool check = OFTrue); + + /** set DerivationDescription (0008,2111) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDerivationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set EthnicGroup (0010,2160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEthnicGroup(const OFString &value, const OFBool check = OFTrue); + + /** set FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix (0070,030b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=16 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(const Float64 value, const unsigned long pos = 0); + + /** set FrameOfReferenceUID (0020,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceUID(const OFString &value, const OFBool check = OFTrue); + + /** set GantryID (0018,1008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCoercionDateTime (0008,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCoercionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationDate (0008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationTime (0008,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreatorUID (0008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceNumber (0020,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set LastMenstrualDate (0010,21d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLastMenstrualDate(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalEventType (0012,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalEventType(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalInformationModified (0028,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos = 0); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredAPDimension (0010,1023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredAPDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredLateralDimension (0010,1024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredLateralDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MedicalAlerts (0010,2000) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMedicalAlerts(const OFString &value, const OFBool check = OFTrue); + + /** set Modality (0008,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, const OFBool check = OFTrue); + + /** set NameOfPhysiciansReadingStudy (0008,1060) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check = OFTrue); + + /** set Occupation (0010,2180) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOccupation(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OriginalSpecializedSOPClassUID (0008,001b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set OtherPatientNames (0010,1001) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOtherPatientNames(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAge (0010,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAlternativeCalendar (0010,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDate (0010,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthTime (0010,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthTime(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBodyMassIndex (0010,1022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBodyMassIndex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBreedDescription (0010,2292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBreedDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientComments (0010,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientComments(const OFString &value, const OFBool check = OFTrue); + + /** set PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientIdentityRemoved (0012,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientIdentityRemoved(const OFString &value, const OFBool check = OFTrue); + + /** set PatientName (0010,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSex (0010,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSexNeutered (0010,2203) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSexNeutered(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSize (0010,1020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSpeciesDescription (0010,2201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSpeciesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientState (0038,0500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientState(const OFString &value, const OFBool check = OFTrue); + + /** set PatientWeight (0010,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepDescription (0040,0254) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndDate (0040,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndTime (0040,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndTime(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepID (0040,0253) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartDate (0040,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartTime (0040,0245) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set PhysiciansOfRecord (0008,1048) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhysiciansOfRecord(const OFString &value, const OFBool check = OFTrue); + + /** set PixelPaddingValue (0028,0120) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingValue(const Uint16 value, const unsigned long pos = 0); + + /** set PlanIntent (300a,000a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPlanIntent(const OFString &value, const OFBool check = OFTrue); + + /** set PositionReferenceIndicator (0020,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPositionReferenceIndicator(const OFString &value, const OFBool check = OFTrue); + + /** set PregnancyStatus (0010,21c0) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPregnancyStatus(const Uint16 value, const unsigned long pos = 0); + + /** set PrescriptionDescription (300a,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPrescriptionDescription(const OFString &value, const OFBool check = OFTrue); + + /** set QualityControlSubject (0010,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlSubject(const OFString &value, const OFBool check = OFTrue); + + /** set QueryRetrieveView (0008,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQueryRetrieveView(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanDate (300a,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanDate(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanDescription (300a,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanDescription(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanGeometry (300a,000c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanGeometry(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanLabel (300a,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanLabel(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanName (300a,0003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanName(const OFString &value, const OFBool check = OFTrue); + + /** set RTPlanTime (300a,0007) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRTPlanTime(const OFString &value, const OFBool check = OFTrue); + + /** set ReferringPhysicianName (0008,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set RelatedGeneralSOPClassUID (0008,001a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsibleOrganization (0010,2299) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePerson (0010,2297) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePerson(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePersonRole (0010,2298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePersonRole(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewDate (300e,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewDate(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewTime (300e,0005) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewTime(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewerName (300e,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewerName(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationComment (0100,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationComment(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationDateTime (0100,0420) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set SOPClassUID (0008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceStatus (0100,0410) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceUID (0008,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDate (0008,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDescription (0008,103e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesNumber (0020,0011) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesTime (0008,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeDescription (0038,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeID (0038,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeID(const OFString &value, const OFBool check = OFTrue); + + /** set SmokingStatus (0010,21a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmokingStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set SpecificCharacterSet (0008,0005) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set StrainAdditionalInformation (0010,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainAdditionalInformation(const OFString &value, const OFBool check = OFTrue); + + /** set StrainDescription (0010,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StrainNomenclature (0010,0213) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainNomenclature(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDate (0008,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDescription (0008,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StudyID (0020,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyTime (0008,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set TimezoneOffsetFromUTC (0008,0201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentProtocols (300a,0009) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentProtocols(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentSites (300a,000b) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentSites(const OFString &value, const OFBool check = OFTrue); + + + protected: + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attribute + * SOPClassUID (0008,0016) with the expected value. Any incorrectness regarding + * this attribute is reported to the log stream (if enabled for error messages). + * @param dataset DICOM dataset to be checked + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset); + + /** update various DICOM attributes + */ + void updateAttributes(); + + private: + + // DICOM attributes are listed ordered by module + + // --- PatientModule (M) --- + + /// PatientName (0010,0010) vr=PN, vm=1, type=2 + DcmPersonName PatientName; + /// PatientID (0010,0020) vr=LO, vm=1, type=2 + DcmLongString PatientID; + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientBirthDate (0010,0030) vr=DA, vm=1, type=2 + DcmDate PatientBirthDate; + /// PatientBirthDateInAlternativeCalendar (0010,0033) vr=LO, vm=1, type=3 + DcmLongString PatientBirthDateInAlternativeCalendar; + /// PatientDeathDateInAlternativeCalendar (0010,0034) vr=LO, vm=1, type=3 + DcmLongString PatientDeathDateInAlternativeCalendar; + /// PatientAlternativeCalendar (0010,0035) vr=CS, vm=1, type=1C + DcmCodeString PatientAlternativeCalendar; + /// PatientSex (0010,0040) vr=CS, vm=1, type=2 + DcmCodeString PatientSex; + /// ReferencedPatientPhotoSequence (0010,1100) vr=SQ, vm=1, type=3 + DRTReferencedPatientPhotoSequence ReferencedPatientPhotoSequence; + /// QualityControlSubject (0010,0200) vr=CS, vm=1, type=3 + DcmCodeString QualityControlSubject; + /// ReferencedPatientSequence (0008,1120) vr=SQ, vm=1, type=3 + DRTReferencedPatientSequence ReferencedPatientSequence; + /// PatientBirthTime (0010,0032) vr=TM, vm=1, type=3 + DcmTime PatientBirthTime; + /// OtherPatientIDsSequence (0010,1002) vr=SQ, vm=1, type=3 + DRTOtherPatientIDsSequence OtherPatientIDsSequence; + /// OtherPatientNames (0010,1001) vr=PN, vm=1-n, type=3 + DcmPersonName OtherPatientNames; + /// EthnicGroup (0010,2160) vr=SH, vm=1, type=3 + DcmShortString EthnicGroup; + /// PatientComments (0010,4000) vr=LT, vm=1, type=3 + DcmLongText PatientComments; + /// PatientSpeciesDescription (0010,2201) vr=LO, vm=1, type=1C + DcmLongString PatientSpeciesDescription; + /// PatientSpeciesCodeSequence (0010,2202) vr=SQ, vm=1, type=1C + DRTPatientSpeciesCodeSequence PatientSpeciesCodeSequence; + /// PatientBreedDescription (0010,2292) vr=LO, vm=1, type=2C + DcmLongString PatientBreedDescription; + /// PatientBreedCodeSequence (0010,2293) vr=SQ, vm=1, type=2C + DRTPatientBreedCodeSequence PatientBreedCodeSequence; + /// BreedRegistrationSequence (0010,2294) vr=SQ, vm=1, type=2C + DRTBreedRegistrationSequence BreedRegistrationSequence; + /// StrainDescription (0010,0212) vr=UC, vm=1, type=3 + DcmUnlimitedCharacters StrainDescription; + /// StrainNomenclature (0010,0213) vr=LO, vm=1, type=3 + DcmLongString StrainNomenclature; + /// StrainCodeSequence (0010,0219) vr=SQ, vm=1, type=3 + DRTStrainCodeSequence StrainCodeSequence; + /// StrainAdditionalInformation (0010,0218) vr=UT, vm=1, type=3 + DcmUnlimitedText StrainAdditionalInformation; + /// StrainStockSequence (0010,0216) vr=SQ, vm=1, type=3 + DRTStrainStockSequence StrainStockSequence; + /// GeneticModificationsSequence (0010,0221) vr=SQ, vm=1, type=3 + DRTGeneticModificationsSequence GeneticModificationsSequence; + /// ResponsiblePerson (0010,2297) vr=PN, vm=1, type=2C + DcmPersonName ResponsiblePerson; + /// ResponsiblePersonRole (0010,2298) vr=CS, vm=1, type=1C + DcmCodeString ResponsiblePersonRole; + /// ResponsibleOrganization (0010,2299) vr=LO, vm=1, type=2C + DcmLongString ResponsibleOrganization; + /// PatientIdentityRemoved (0012,0062) vr=CS, vm=1, type=3 + DcmCodeString PatientIdentityRemoved; + /// DeidentificationMethod (0012,0063) vr=LO, vm=1-n, type=1C + DcmLongString DeidentificationMethod; + /// DeidentificationMethodCodeSequence (0012,0064) vr=SQ, vm=1, type=1C + DRTDeidentificationMethodCodeSequence DeidentificationMethodCodeSequence; + /// SourcePatientGroupIdentificationSequence (0010,0026) vr=SQ, vm=1, type=3 + DRTSourcePatientGroupIdentificationSequence SourcePatientGroupIdentificationSequence; + /// GroupOfPatientsIdentificationSequence (0010,0027) vr=SQ, vm=1, type=3 + DRTGroupOfPatientsIdentificationSequence GroupOfPatientsIdentificationSequence; + + // --- ClinicalTrialSubjectModule (U) --- + + /// ClinicalTrialSponsorName (0012,0010) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialSponsorName; + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialProtocolID; + /// ClinicalTrialProtocolName (0012,0021) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialProtocolName; + /// ClinicalTrialSiteID (0012,0030) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteID; + /// ClinicalTrialSiteName (0012,0031) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteName; + /// ClinicalTrialSubjectID (0012,0040) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectID; + /// ClinicalTrialSubjectReadingID (0012,0042) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectReadingID; + /// ClinicalTrialProtocolEthicsCommitteeName (0012,0081) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolEthicsCommitteeName; + /// ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + + // --- GeneralStudyModule (M) --- + + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + /// StudyDate (0008,0020) vr=DA, vm=1, type=2 + DcmDate StudyDate; + /// StudyTime (0008,0030) vr=TM, vm=1, type=2 + DcmTime StudyTime; + /// ReferringPhysicianName (0008,0090) vr=PN, vm=1, type=2 + DcmPersonName ReferringPhysicianName; + /// ReferringPhysicianIdentificationSequence (0008,0096) vr=SQ, vm=1, type=3 + DRTReferringPhysicianIdentificationSequence ReferringPhysicianIdentificationSequence; + /// ConsultingPhysicianName (0008,009c) vr=PN, vm=1-n, type=3 + DcmPersonName ConsultingPhysicianName; + /// ConsultingPhysicianIdentificationSequence (0008,009d) vr=SQ, vm=1, type=3 + DRTConsultingPhysicianIdentificationSequence ConsultingPhysicianIdentificationSequence; + /// StudyID (0020,0010) vr=SH, vm=1, type=2 + DcmShortString StudyID; + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=2 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// StudyDescription (0008,1030) vr=LO, vm=1, type=3 + DcmLongString StudyDescription; + /// PhysiciansOfRecord (0008,1048) vr=PN, vm=1-n, type=3 + DcmPersonName PhysiciansOfRecord; + /// PhysiciansOfRecordIdentificationSequence (0008,1049) vr=SQ, vm=1, type=3 + DRTPhysiciansOfRecordIdentificationSequence PhysiciansOfRecordIdentificationSequence; + /// NameOfPhysiciansReadingStudy (0008,1060) vr=PN, vm=1-n, type=3 + DcmPersonName NameOfPhysiciansReadingStudy; + /// PhysiciansReadingStudyIdentificationSequence (0008,1062) vr=SQ, vm=1, type=3 + DRTPhysiciansReadingStudyIdentificationSequence PhysiciansReadingStudyIdentificationSequence; + /// RequestingServiceCodeSequence (0032,1034) vr=SQ, vm=1, type=3 + DRTRequestingServiceCodeSequence RequestingServiceCodeSequence; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// ProcedureCodeSequence (0008,1032) vr=SQ, vm=1, type=3 + DRTProcedureCodeSequence ProcedureCodeSequence; + /// ReasonForPerformedProcedureCodeSequence (0040,1012) vr=SQ, vm=1, type=3 + DRTReasonForPerformedProcedureCodeSequence ReasonForPerformedProcedureCodeSequence; + + // --- PatientStudyModule (U) --- + + /// AdmittingDiagnosesDescription (0008,1080) vr=LO, vm=1-n, type=3 + DcmLongString AdmittingDiagnosesDescription; + /// AdmittingDiagnosesCodeSequence (0008,1084) vr=SQ, vm=1, type=3 + DRTAdmittingDiagnosesCodeSequence AdmittingDiagnosesCodeSequence; + /// PatientAge (0010,1010) vr=AS, vm=1, type=3 + DcmAgeString PatientAge; + /// PatientSize (0010,1020) vr=DS, vm=1, type=3 + DcmDecimalString PatientSize; + /// PatientWeight (0010,1030) vr=DS, vm=1, type=3 + DcmDecimalString PatientWeight; + /// PatientBodyMassIndex (0010,1022) vr=DS, vm=1, type=3 + DcmDecimalString PatientBodyMassIndex; + /// MeasuredAPDimension (0010,1023) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredAPDimension; + /// MeasuredLateralDimension (0010,1024) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredLateralDimension; + /// PatientSizeCodeSequence (0010,1021) vr=SQ, vm=1, type=3 + DRTPatientSizeCodeSequence PatientSizeCodeSequence; + /// MedicalAlerts (0010,2000) vr=LO, vm=1-n, type=3 + DcmLongString MedicalAlerts; + /// Allergies (0010,2110) vr=LO, vm=1-n, type=3 + DcmLongString Allergies; + /// SmokingStatus (0010,21a0) vr=CS, vm=1, type=3 + DcmCodeString SmokingStatus; + /// PregnancyStatus (0010,21c0) vr=US, vm=1, type=3 + DcmUnsignedShort PregnancyStatus; + /// LastMenstrualDate (0010,21d0) vr=DA, vm=1, type=3 + DcmDate LastMenstrualDate; + /// PatientState (0038,0500) vr=LO, vm=1, type=3 + DcmLongString PatientState; + /// Occupation (0010,2180) vr=SH, vm=1, type=3 + DcmShortString Occupation; + /// AdditionalPatientHistory (0010,21b0) vr=LT, vm=1, type=3 + DcmLongText AdditionalPatientHistory; + /// AdmissionID (0038,0010) vr=LO, vm=1, type=3 + DcmLongString AdmissionID; + /// IssuerOfAdmissionIDSequence (0038,0014) vr=SQ, vm=1, type=3 + DRTIssuerOfAdmissionIDSequence IssuerOfAdmissionIDSequence; + /// ServiceEpisodeID (0038,0060) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeID; + /// IssuerOfServiceEpisodeIDSequence (0038,0064) vr=SQ, vm=1, type=3 + DRTIssuerOfServiceEpisodeIDSequence IssuerOfServiceEpisodeIDSequence; + /// ServiceEpisodeDescription (0038,0062) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeDescription; + /// PatientSexNeutered (0010,2203) vr=CS, vm=1, type=2C + DcmCodeString PatientSexNeutered; + + // --- ClinicalTrialStudyModule (U) --- + + /// ClinicalTrialTimePointID (0012,0050) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialTimePointID; + /// ClinicalTrialTimePointDescription (0012,0051) vr=ST, vm=1, type=3 + DcmShortText ClinicalTrialTimePointDescription; + /// LongitudinalTemporalOffsetFromEvent (0012,0052) vr=FD, vm=1, type=3 + DcmFloatingPointDouble LongitudinalTemporalOffsetFromEvent; + /// LongitudinalTemporalEventType (0012,0053) vr=CS, vm=1, type=1C + DcmCodeString LongitudinalTemporalEventType; + /// ConsentForClinicalTrialUseSequence (0012,0083) vr=SQ, vm=1, type=3 + DRTConsentForClinicalTrialUseSequence ConsentForClinicalTrialUseSequence; + + // --- RTSeriesModule (M) --- + + /// Modality (0008,0060) vr=CS, vm=1, type=1 + DcmCodeString Modality; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + /// SeriesNumber (0020,0011) vr=IS, vm=1, type=2 + DcmIntegerString SeriesNumber; + /// SeriesDate (0008,0021) vr=DA, vm=1, type=3 + DcmDate SeriesDate; + /// SeriesTime (0008,0031) vr=TM, vm=1, type=3 + DcmTime SeriesTime; + /// SeriesDescription (0008,103e) vr=LO, vm=1, type=3 + DcmLongString SeriesDescription; + /// SeriesDescriptionCodeSequence (0008,103f) vr=SQ, vm=1, type=3 + DRTSeriesDescriptionCodeSequence SeriesDescriptionCodeSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// ReferencedPerformedProcedureStepSequence (0008,1111) vr=SQ, vm=1, type=3 + DRTReferencedPerformedProcedureStepSequence ReferencedPerformedProcedureStepSequence; + /// RequestAttributesSequence (0040,0275) vr=SQ, vm=1, type=3 + DRTRequestAttributesSequence RequestAttributesSequence; + /// PerformedProcedureStepID (0040,0253) vr=SH, vm=1, type=3 + DcmShortString PerformedProcedureStepID; + /// PerformedProcedureStepStartDate (0040,0244) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepStartDate; + /// PerformedProcedureStepStartTime (0040,0245) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepStartTime; + /// PerformedProcedureStepEndDate (0040,0250) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepEndDate; + /// PerformedProcedureStepEndTime (0040,0251) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepEndTime; + /// PerformedProcedureStepDescription (0040,0254) vr=LO, vm=1, type=3 + DcmLongString PerformedProcedureStepDescription; + /// PerformedProtocolCodeSequence (0040,0260) vr=SQ, vm=1, type=3 + DRTPerformedProtocolCodeSequence PerformedProtocolCodeSequence; + /// CommentsOnThePerformedProcedureStep (0040,0280) vr=ST, vm=1, type=3 + DcmShortText CommentsOnThePerformedProcedureStep; + + // --- ClinicalTrialSeriesModule (U) --- + + /// ClinicalTrialCoordinatingCenterName (0012,0060) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialCoordinatingCenterName; + /// ClinicalTrialSeriesID (0012,0071) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesID; + /// ClinicalTrialSeriesDescription (0012,0072) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesDescription; + + // --- FrameOfReferenceModule (U) --- + + /// FrameOfReferenceUID (0020,0052) vr=UI, vm=1, type=1 + DcmUniqueIdentifier FrameOfReferenceUID; + /// PositionReferenceIndicator (0020,1040) vr=LO, vm=1, type=2 + DcmLongString PositionReferenceIndicator; + + // --- GeneralEquipmentModule (M) --- + + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// GantryID (0018,1008) vr=LO, vm=1, type=3 + DcmLongString GantryID; + /// UDISequence (0018,100a) vr=SQ, vm=1, type=3 + DRTUDISequence UDISequence; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + /// PixelPaddingValue (0028,0120) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingValue; + + // --- RTGeneralPlanModule (M) --- + + /// RTPlanLabel (300a,0002) vr=SH, vm=1, type=1 + DcmShortString RTPlanLabel; + /// RTPlanName (300a,0003) vr=LO, vm=1, type=3 + DcmLongString RTPlanName; + /// RTPlanDescription (300a,0004) vr=ST, vm=1, type=3 + DcmShortText RTPlanDescription; + /// InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + /// - also defined in: SOPCommonModule + DcmIntegerString InstanceNumber; + /// RTPlanDate (300a,0006) vr=DA, vm=1, type=2 + DcmDate RTPlanDate; + /// RTPlanTime (300a,0007) vr=TM, vm=1, type=2 + DcmTime RTPlanTime; + /// TreatmentProtocols (300a,0009) vr=LO, vm=1-n, type=3 + DcmLongString TreatmentProtocols; + /// PlanIntent (300a,000a) vr=CS, vm=1, type=3 + DcmCodeString PlanIntent; + /// TreatmentSites (300a,000b) vr=LO, vm=1-n, type=3 + DcmLongString TreatmentSites; + /// RTPlanGeometry (300a,000c) vr=CS, vm=1, type=1 + DcmCodeString RTPlanGeometry; + /// ReferencedStructureSetSequence (300c,0060) vr=SQ, vm=1, type=1C + DRTReferencedStructureSetSequence ReferencedStructureSetSequence; + /// ReferencedDoseSequence (300c,0080) vr=SQ, vm=1, type=3 + DRTReferencedDoseSequence ReferencedDoseSequence; + /// ReferencedRTPlanSequence (300c,0002) vr=SQ, vm=1, type=3 + DRTReferencedRTPlanSequenceInRTGeneralPlanModule ReferencedRTPlanSequence; + /// FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix (0070,030b) vr=FD, vm=16, type=3 + DcmFloatingPointDouble FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix; + + // --- RTPrescriptionModule (U) --- + + /// PrescriptionDescription (300a,000e) vr=ST, vm=1, type=3 + DcmShortText PrescriptionDescription; + /// DoseReferenceSequence (300a,0010) vr=SQ, vm=1, type=3 + DRTDoseReferenceSequence DoseReferenceSequence; + + // --- RTToleranceTablesModule (U) --- + + /// ToleranceTableSequence (300a,0040) vr=SQ, vm=1, type=3 + DRTToleranceTableSequence ToleranceTableSequence; + + // --- RTPatientSetupModule (U) --- + + /// PatientSetupSequence (300a,0180) vr=SQ, vm=1, type=1 + DRTPatientSetupSequence PatientSetupSequence; + + // --- RTFractionSchemeModule (U) --- + + /// FractionGroupSequence (300a,0070) vr=SQ, vm=1, type=1 + DRTFractionGroupSequence FractionGroupSequence; + + // --- RTBeamsModule (C) --- + + /// BeamSequence (300a,00b0) vr=SQ, vm=1, type=1 + DRTBeamSequence BeamSequence; + + // --- RTBrachyApplicationSetupsModule (C) --- + + /// BrachyTreatmentTechnique (300a,0200) vr=CS, vm=1, type=1 + DcmCodeString BrachyTreatmentTechnique; + /// BrachyTreatmentType (300a,0202) vr=CS, vm=1, type=1 + DcmCodeString BrachyTreatmentType; + /// TreatmentMachineSequence (300a,0206) vr=SQ, vm=1, type=1 + DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule TreatmentMachineSequence; + /// SourceSequence (300a,0210) vr=SQ, vm=1, type=1 + DRTSourceSequence SourceSequence; + /// ApplicationSetupSequence (300a,0230) vr=SQ, vm=1, type=1 + DRTApplicationSetupSequence ApplicationSetupSequence; + + // --- ApprovalModule (U) --- + + /// ApprovalStatus (300e,0002) vr=CS, vm=1, type=1 + DcmCodeString ApprovalStatus; + /// ReviewDate (300e,0004) vr=DA, vm=1, type=2C + DcmDate ReviewDate; + /// ReviewTime (300e,0005) vr=TM, vm=1, type=2C + DcmTime ReviewTime; + /// ReviewerName (300e,0008) vr=PN, vm=1, type=2C + DcmPersonName ReviewerName; + + // --- GeneralReferenceModule (U) --- + + /// ReferencedImageSequence (0008,1140) vr=SQ, vm=1, type=3 + DRTReferencedImageSequence ReferencedImageSequence; + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=3 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + /// DerivationDescription (0008,2111) vr=ST, vm=1, type=3 + DcmShortText DerivationDescription; + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// SourceImageSequence (0008,2112) vr=SQ, vm=1, type=3 + DRTSourceImageSequence SourceImageSequence; + /// SourceInstanceSequence (0042,0013) vr=SQ, vm=1, type=3 + DRTSourceInstanceSequence SourceInstanceSequence; + + // --- SOPCommonModule (M) --- + + /// SOPClassUID (0008,0016) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPClassUID; + /// SOPInstanceUID (0008,0018) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPInstanceUID; + /// SpecificCharacterSet (0008,0005) vr=CS, vm=1-n, type=1C + DcmCodeString SpecificCharacterSet; + /// InstanceCreationDate (0008,0012) vr=DA, vm=1, type=3 + DcmDate InstanceCreationDate; + /// InstanceCreationTime (0008,0013) vr=TM, vm=1, type=3 + DcmTime InstanceCreationTime; + /// InstanceCoercionDateTime (0008,0015) vr=DT, vm=1, type=3 + DcmDateTime InstanceCoercionDateTime; + /// InstanceCreatorUID (0008,0014) vr=UI, vm=1, type=3 + DcmUniqueIdentifier InstanceCreatorUID; + /// RelatedGeneralSOPClassUID (0008,001a) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier RelatedGeneralSOPClassUID; + /// OriginalSpecializedSOPClassUID (0008,001b) vr=UI, vm=1, type=3 + DcmUniqueIdentifier OriginalSpecializedSOPClassUID; + /// CodingSchemeIdentificationSequence (0008,0110) vr=SQ, vm=1, type=3 + DRTCodingSchemeIdentificationSequence CodingSchemeIdentificationSequence; + /// ContextGroupIdentificationSequence (0008,0123) vr=SQ, vm=1, type=3 + DRTContextGroupIdentificationSequence ContextGroupIdentificationSequence; + /// MappingResourceIdentificationSequence (0008,0124) vr=SQ, vm=1, type=3 + DRTMappingResourceIdentificationSequence MappingResourceIdentificationSequence; + /// TimezoneOffsetFromUTC (0008,0201) vr=SH, vm=1, type=3 + DcmShortString TimezoneOffsetFromUTC; + /// ContributingEquipmentSequence (0018,a001) vr=SQ, vm=1, type=3 + DRTContributingEquipmentSequence ContributingEquipmentSequence; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: RTGeneralPlanModule + // DcmIntegerString InstanceNumber; + /// SOPInstanceStatus (0100,0410) vr=CS, vm=1, type=3 + DcmCodeString SOPInstanceStatus; + /// SOPAuthorizationDateTime (0100,0420) vr=DT, vm=1, type=3 + DcmDateTime SOPAuthorizationDateTime; + /// SOPAuthorizationComment (0100,0424) vr=LT, vm=1, type=3 + DcmLongText SOPAuthorizationComment; + /// AuthorizationEquipmentCertificationNumber (0100,0426) vr=LO, vm=1, type=3 + DcmLongString AuthorizationEquipmentCertificationNumber; + /// MACParametersSequence (4ffe,0001) vr=SQ, vm=1, type=3 + DRTMACParametersSequence MACParametersSequence; + /// DigitalSignaturesSequence (fffa,fffa) vr=SQ, vm=1, type=3 + DRTDigitalSignaturesSequence DigitalSignaturesSequence; + /// EncryptedAttributesSequence (0400,0500) vr=SQ, vm=1, type=1C + DRTEncryptedAttributesSequence EncryptedAttributesSequence; + /// OriginalAttributesSequence (0400,0561) vr=SQ, vm=1, type=3 + DRTOriginalAttributesSequence OriginalAttributesSequence; + /// HL7StructuredDocumentReferenceSequence (0040,a390) vr=SQ, vm=1, type=1C + DRTHL7StructuredDocumentReferenceSequence HL7StructuredDocumentReferenceSequence; + /// LongitudinalTemporalInformationModified (0028,0303) vr=CS, vm=1, type=3 + DcmCodeString LongitudinalTemporalInformationModified; + /// QueryRetrieveView (0008,0053) vr=CS, vm=1, type=1C + DcmCodeString QueryRetrieveView; + /// ConversionSourceAttributesSequence (0020,9172) vr=SQ, vm=1, type=1C + DRTConversionSourceAttributesSequence ConversionSourceAttributesSequence; + /// ContentQualification (0018,9004) vr=CS, vm=1, type=3 + DcmCodeString ContentQualification; + /// PrivateDataElementCharacteristicsSequence (0008,0300) vr=SQ, vm=1, type=3 + DRTPrivateDataElementCharacteristicsSequence PrivateDataElementCharacteristicsSequence; + + // --- CommonInstanceReferenceModule (U) --- + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1C + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudiesContainingOtherReferencedInstancesSequence (0008,1200) vr=SQ, vm=1, type=1C + DRTStudiesContainingOtherReferencedInstancesSequence StudiesContainingOtherReferencedInstancesSequence; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drtstrct.h b/dcmrt/include/dcmtk/dcmrt/drtstrct.h new file mode 100644 index 00000000..8647e4f3 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drtstrct.h @@ -0,0 +1,3141 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTStructureSetIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSTRCT_H +#define DRTSTRCT_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtadcs.h" // for AdmittingDiagnosesCodeSequence +#include "dcmtk/dcmrt/seq/drtbrs.h" // for BreedRegistrationSequence +#include "dcmtk/dcmrt/seq/drtcsis.h" // for CodingSchemeIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcctus.h" // for ConsentForClinicalTrialUseSequence +#include "dcmtk/dcmrt/seq/drtcpis.h" // for ConsultingPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcgis.h" // for ContextGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtces.h" // for ContributingEquipmentSequence +#include "dcmtk/dcmrt/seq/drtcsas.h" // for ConversionSourceAttributesSequence +#include "dcmtk/dcmrt/seq/drtdimcs.h" // for DeidentificationMethodCodeSequence +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence +#include "dcmtk/dcmrt/seq/drtdss.h" // for DigitalSignaturesSequence +#include "dcmtk/dcmrt/seq/drteas.h" // for EncryptedAttributesSequence +#include "dcmtk/dcmrt/seq/drtgms.h" // for GeneticModificationsSequence +#include "dcmtk/dcmrt/seq/drtgpis.h" // for GroupOfPatientsIdentificationSequence +#include "dcmtk/dcmrt/seq/drthsdrs.h" // for HL7StructuredDocumentReferenceSequence +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtiais.h" // for IssuerOfAdmissionIDSequence +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence +#include "dcmtk/dcmrt/seq/drtiseis.h" // for IssuerOfServiceEpisodeIDSequence +#include "dcmtk/dcmrt/seq/drtmps.h" // for MACParametersSequence +#include "dcmtk/dcmrt/seq/drtmris.h" // for MappingResourceIdentificationSequence +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtoas.h" // for OriginalAttributesSequence +#include "dcmtk/dcmrt/seq/drtopis.h" // for OtherPatientIDsSequence +#include "dcmtk/dcmrt/seq/drtpbcs.h" // for PatientBreedCodeSequence +#include "dcmtk/dcmrt/seq/drtpsics.h" // for PatientSizeCodeSequence +#include "dcmtk/dcmrt/seq/drtpscs.h" // for PatientSpeciesCodeSequence +#include "dcmtk/dcmrt/seq/drtppcs.h" // for PerformedProtocolCodeSequence +#include "dcmtk/dcmrt/seq/drtporis.h" // for PhysiciansOfRecordIdentificationSequence +#include "dcmtk/dcmrt/seq/drtprsis.h" // for PhysiciansReadingStudyIdentificationSequence +#include "dcmtk/dcmrt/seq/drtpsss.h" // for PredecessorStructureSetSequence +#include "dcmtk/dcmrt/seq/drtpdecs.h" // for PrivateDataElementCharacteristicsSequence +#include "dcmtk/dcmrt/seq/drtpcs.h" // for ProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrcs.h" // for ROIContourSequence +#include "dcmtk/dcmrt/seq/drtrros.h" // for RTROIObservationsSequence +#include "dcmtk/dcmrt/seq/drtrppcs.h" // for ReasonForPerformedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrfors.h" // for ReferencedFrameOfReferenceSequence +#include "dcmtk/dcmrt/seq/drtrims.h" // for ReferencedImageSequence +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence +#include "dcmtk/dcmrt/seq/drtrpphs.h" // for ReferencedPatientPhotoSequence +#include "dcmtk/dcmrt/seq/drtrps.h" // for ReferencedPatientSequence +#include "dcmtk/dcmrt/seq/drtrppss.h" // for ReferencedPerformedProcedureStepSequence +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrpis.h" // for ReferringPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtras.h" // for RequestAttributesSequence +#include "dcmtk/dcmrt/seq/drtrscs.h" // for RequestingServiceCodeSequence +#include "dcmtk/dcmrt/seq/drtsdcs.h" // for SeriesDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtsis.h" // for SourceImageSequence +#include "dcmtk/dcmrt/seq/drtsins.h" // for SourceInstanceSequence +#include "dcmtk/dcmrt/seq/drtspgis.h" // for SourcePatientGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtscs.h" // for StrainCodeSequence +#include "dcmtk/dcmrt/seq/drtsss.h" // for StrainStockSequence +#include "dcmtk/dcmrt/seq/drtssrs.h" // for StructureSetROISequence +#include "dcmtk/dcmrt/seq/drtscris.h" // for StudiesContainingOtherReferencedInstancesSequence +#include "dcmtk/dcmrt/seq/drtudis.h" // for UDISequence + + +/** Interface class for RTStructureSetIOD + * @note Because of its many member variables, an instance of this class requires quite + * some memory. So be careful when creating automatic variables from this class (the + * stack size might be exceeded); it is probably better to use the heap space. + */ +class DCMTK_DCMRT_EXPORT DRTStructureSetIOD + : protected DRTTypes +{ + + public: + + // --- constructors, destructor and operators --- + + /** default constructor + */ + DRTStructureSetIOD(); + + /** copy constructor + * @param copy IOD object to be copied + */ + DRTStructureSetIOD(const DRTStructureSetIOD ©); + + /** destructor + */ + virtual ~DRTStructureSetIOD(); + + /** assigment operator + * @param copy IOD object to be copied + * @return reference to this object + */ + DRTStructureSetIOD &operator=(const DRTStructureSetIOD ©); + + // --- general methods --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + // --- input/output methods --- + + /** read object from dataset + * @param dataset reference to DICOM dataset from which the object should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** read PatientData from dataset + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset); + + /** read StudyData from dataset. Also reads PatientData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset); + + /** read SeriesData from dataset. Also reads PatientData, StudyData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSeriesData(DcmItem &dataset); + + /** write object to dataset + * @param dataset reference to DICOM dataset to which the object should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // --- check presence of non-mandatory DICOM modules --- + + /** check whether ClinicalTrialSubjectModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSubjectModulePresent(const OFBool complete = OFFalse); + + /** check whether PatientStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isPatientStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialSeriesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSeriesModulePresent(const OFBool complete = OFFalse); + + /** check whether FrameOfReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isFrameOfReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether ApprovalModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isApprovalModulePresent(const OFBool complete = OFFalse); + + /** check whether GeneralReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isGeneralReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether CommonInstanceReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCommonInstanceReferenceModulePresent(const OFBool complete = OFFalse); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get AdditionalPatientHistory (0010,21b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdditionalPatientHistory(OFString &value, const signed long pos = 0) const; + + /** get AdmissionID (0038,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmissionID(OFString &value, const signed long pos = 0) const; + + /** get AdmittingDiagnosesDescription (0008,1080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString &value, const signed long pos = 0) const; + + /** get Allergies (0010,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAllergies(OFString &value, const signed long pos = 0) const; + + /** get ApprovalStatus (300e,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getApprovalStatus(OFString &value, const signed long pos = 0) const; + + /** get AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolName (0012,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesDescription (0012,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesID (0012,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteID (0012,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteName (0012,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSponsorName (0012,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSponsorName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectID (0012,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectReadingID (0012,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectReadingID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointDescription (0012,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointID (0012,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointID(OFString &value, const signed long pos = 0) const; + + /** get CommentsOnThePerformedProcedureStep (0040,0280) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos = 0) const; + + /** get ConsultingPhysicianName (0008,009c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConsultingPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get ContentQualification (0018,9004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, const signed long pos = 0) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeidentificationMethod (0012,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeidentificationMethod(OFString &value, const signed long pos = 0) const; + + /** get DerivationDescription (0008,2111) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDerivationDescription(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get EthnicGroup (0010,2160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEthnicGroup(OFString &value, const signed long pos = 0) const; + + /** get FrameOfReferenceUID (0020,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFrameOfReferenceUID(OFString &value, const signed long pos = 0) const; + + /** get GantryID (0018,1008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryID(OFString &value, const signed long pos = 0) const; + + /** get InstanceCoercionDateTime (0008,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCoercionDateTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationDate (0008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationTime (0008,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreatorUID (0008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get LastMenstrualDate (0010,21d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLastMenstrualDate(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalEventType (0012,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalEventType(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalInformationModified (0028,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalInformationModified(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MedicalAlerts (0010,2000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMedicalAlerts(OFString &value, const signed long pos = 0) const; + + /** get Modality (0008,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, const signed long pos = 0) const; + + /** get NameOfPhysiciansReadingStudy (0008,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos = 0) const; + + /** get Occupation (0010,2180) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOccupation(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OriginalSpecializedSOPClassUID (0008,001b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get OtherPatientNames (0010,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOtherPatientNames(OFString &value, const signed long pos = 0) const; + + /** get PatientAge (0010,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, const signed long pos = 0) const; + + /** get PatientAlternativeCalendar (0010,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDate (0010,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthTime (0010,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthTime(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientBreedDescription (0010,2292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBreedDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientComments (0010,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientComments(OFString &value, const signed long pos = 0) const; + + /** get PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientIdentityRemoved (0012,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientIdentityRemoved(OFString &value, const signed long pos = 0) const; + + /** get PatientName (0010,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, const signed long pos = 0) const; + + /** get PatientSex (0010,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, const signed long pos = 0) const; + + /** get PatientSexNeutered (0010,2203) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSexNeutered(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSpeciesDescription (0010,2201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSpeciesDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientState (0038,0500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientState(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get PerformedProcedureStepDescription (0040,0254) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndDate (0040,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndTime (0040,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndTime(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepID (0040,0253) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartDate (0040,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartTime (0040,0245) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartTime(OFString &value, const signed long pos = 0) const; + + /** get PhysiciansOfRecord (0008,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhysiciansOfRecord(OFString &value, const signed long pos = 0) const; + + /** get PixelPaddingValue (0028,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PositionReferenceIndicator (0020,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPositionReferenceIndicator(OFString &value, const signed long pos = 0) const; + + /** get PregnancyStatus (0010,21c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPregnancyStatus(Uint16 &value, const unsigned long pos = 0) const; + + /** get QualityControlSubject (0010,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlSubject(OFString &value, const signed long pos = 0) const; + + /** get QueryRetrieveView (0008,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQueryRetrieveView(OFString &value, const signed long pos = 0) const; + + /** get ReferringPhysicianName (0008,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get RelatedGeneralSOPClassUID (0008,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRelatedGeneralSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ResponsibleOrganization (0010,2299) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePerson (0010,2297) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePerson(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePersonRole (0010,2298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePersonRole(OFString &value, const signed long pos = 0) const; + + /** get ReviewDate (300e,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewDate(OFString &value, const signed long pos = 0) const; + + /** get ReviewTime (300e,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewTime(OFString &value, const signed long pos = 0) const; + + /** get ReviewerName (300e,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReviewerName(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationComment (0100,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationComment(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationDateTime (0100,0420) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationDateTime(OFString &value, const signed long pos = 0) const; + + /** get SOPClassUID (0008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceStatus (0100,0410) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceStatus(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceUID (0008,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesDate (0008,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, const signed long pos = 0) const; + + /** get SeriesDescription (0008,103e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SeriesTime (0008,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeDescription (0038,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeDescription(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeID (0038,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeID(OFString &value, const signed long pos = 0) const; + + /** get SmokingStatus (0010,21a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmokingStatus(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecificCharacterSet (0008,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, const signed long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get StrainAdditionalInformation (0010,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainAdditionalInformation(OFString &value, const signed long pos = 0) const; + + /** get StrainDescription (0010,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainDescription(OFString &value, const signed long pos = 0) const; + + /** get StrainNomenclature (0010,0213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainNomenclature(OFString &value, const signed long pos = 0) const; + + /** get StructureSetDate (3006,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetDate(OFString &value, const signed long pos = 0) const; + + /** get StructureSetDescription (3006,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetDescription(OFString &value, const signed long pos = 0) const; + + /** get StructureSetLabel (3006,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetLabel(OFString &value, const signed long pos = 0) const; + + /** get StructureSetName (3006,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetName(OFString &value, const signed long pos = 0) const; + + /** get StructureSetTime (3006,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStructureSetTime(OFString &value, const signed long pos = 0) const; + + /** get StudyDate (0008,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, const signed long pos = 0) const; + + /** get StudyDescription (0008,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, const signed long pos = 0) const; + + /** get StudyID (0020,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyTime (0008,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, const signed long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get TimezoneOffsetFromUTC (0008,0201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return reference to sequence element + */ + DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() + { return AdmittingDiagnosesCodeSequence; } + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return const reference to sequence element + */ + const DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() const + { return AdmittingDiagnosesCodeSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return reference to sequence element + */ + DRTBreedRegistrationSequence &getBreedRegistrationSequence() + { return BreedRegistrationSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return const reference to sequence element + */ + const DRTBreedRegistrationSequence &getBreedRegistrationSequence() const + { return BreedRegistrationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return reference to sequence element + */ + DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() + { return CodingSchemeIdentificationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return const reference to sequence element + */ + const DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() const + { return CodingSchemeIdentificationSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return reference to sequence element + */ + DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return const reference to sequence element + */ + const DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() const + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return reference to sequence element + */ + DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() + { return ConsultingPhysicianIdentificationSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return const reference to sequence element + */ + const DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() const + { return ConsultingPhysicianIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return reference to sequence element + */ + DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() + { return ContextGroupIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return const reference to sequence element + */ + const DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() const + { return ContextGroupIdentificationSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return reference to sequence element + */ + DRTContributingEquipmentSequence &getContributingEquipmentSequence() + { return ContributingEquipmentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return const reference to sequence element + */ + const DRTContributingEquipmentSequence &getContributingEquipmentSequence() const + { return ContributingEquipmentSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return reference to sequence element + */ + DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() + { return ConversionSourceAttributesSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return const reference to sequence element + */ + const DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() const + { return ConversionSourceAttributesSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return reference to sequence element + */ + DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() + { return DeidentificationMethodCodeSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return const reference to sequence element + */ + const DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() const + { return DeidentificationMethodCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return reference to sequence element + */ + DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() + { return DigitalSignaturesSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return const reference to sequence element + */ + const DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() const + { return DigitalSignaturesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return reference to sequence element + */ + DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() + { return EncryptedAttributesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return const reference to sequence element + */ + const DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() const + { return EncryptedAttributesSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return reference to sequence element + */ + DRTGeneticModificationsSequence &getGeneticModificationsSequence() + { return GeneticModificationsSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return const reference to sequence element + */ + const DRTGeneticModificationsSequence &getGeneticModificationsSequence() const + { return GeneticModificationsSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return reference to sequence element + */ + DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() + { return GroupOfPatientsIdentificationSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return const reference to sequence element + */ + const DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() const + { return GroupOfPatientsIdentificationSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return reference to sequence element + */ + DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() + { return HL7StructuredDocumentReferenceSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return const reference to sequence element + */ + const DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() const + { return HL7StructuredDocumentReferenceSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return reference to sequence element + */ + DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return const reference to sequence element + */ + const DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() const + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return reference to sequence element + */ + DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() + { return IssuerOfServiceEpisodeIDSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return const reference to sequence element + */ + const DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() const + { return IssuerOfServiceEpisodeIDSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return reference to sequence element + */ + DRTMACParametersSequence &getMACParametersSequence() + { return MACParametersSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return const reference to sequence element + */ + const DRTMACParametersSequence &getMACParametersSequence() const + { return MACParametersSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return reference to sequence element + */ + DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() + { return MappingResourceIdentificationSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return const reference to sequence element + */ + const DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() const + { return MappingResourceIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return reference to sequence element + */ + DRTOriginalAttributesSequence &getOriginalAttributesSequence() + { return OriginalAttributesSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return const reference to sequence element + */ + const DRTOriginalAttributesSequence &getOriginalAttributesSequence() const + { return OriginalAttributesSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return reference to sequence element + */ + DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() + { return OtherPatientIDsSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return const reference to sequence element + */ + const DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() const + { return OtherPatientIDsSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return reference to sequence element + */ + DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() + { return PatientBreedCodeSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return const reference to sequence element + */ + const DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() const + { return PatientBreedCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return reference to sequence element + */ + DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() + { return PatientSizeCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return const reference to sequence element + */ + const DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() const + { return PatientSizeCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return reference to sequence element + */ + DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() + { return PatientSpeciesCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return const reference to sequence element + */ + const DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() const + { return PatientSpeciesCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return reference to sequence element + */ + DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() + { return PerformedProtocolCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return const reference to sequence element + */ + const DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() const + { return PerformedProtocolCodeSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return reference to sequence element + */ + DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return const reference to sequence element + */ + const DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() const + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return reference to sequence element + */ + DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return const reference to sequence element + */ + const DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() const + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PredecessorStructureSetSequence (3006,0018) + * @return reference to sequence element + */ + DRTPredecessorStructureSetSequence &getPredecessorStructureSetSequence() + { return PredecessorStructureSetSequence; } + + /** get PredecessorStructureSetSequence (3006,0018) + * @return const reference to sequence element + */ + const DRTPredecessorStructureSetSequence &getPredecessorStructureSetSequence() const + { return PredecessorStructureSetSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return reference to sequence element + */ + DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() + { return PrivateDataElementCharacteristicsSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return const reference to sequence element + */ + const DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() const + { return PrivateDataElementCharacteristicsSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return reference to sequence element + */ + DRTProcedureCodeSequence &getProcedureCodeSequence() + { return ProcedureCodeSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return const reference to sequence element + */ + const DRTProcedureCodeSequence &getProcedureCodeSequence() const + { return ProcedureCodeSequence; } + + /** get ROIContourSequence (3006,0039) + * @return reference to sequence element + */ + DRTROIContourSequence &getROIContourSequence() + { return ROIContourSequence; } + + /** get ROIContourSequence (3006,0039) + * @return const reference to sequence element + */ + const DRTROIContourSequence &getROIContourSequence() const + { return ROIContourSequence; } + + /** get RTROIObservationsSequence (3006,0080) + * @return reference to sequence element + */ + DRTRTROIObservationsSequence &getRTROIObservationsSequence() + { return RTROIObservationsSequence; } + + /** get RTROIObservationsSequence (3006,0080) + * @return const reference to sequence element + */ + const DRTRTROIObservationsSequence &getRTROIObservationsSequence() const + { return RTROIObservationsSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return reference to sequence element + */ + DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return const reference to sequence element + */ + const DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() const + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReferencedFrameOfReferenceSequence (3006,0010) + * @return reference to sequence element + */ + DRTReferencedFrameOfReferenceSequence &getReferencedFrameOfReferenceSequence() + { return ReferencedFrameOfReferenceSequence; } + + /** get ReferencedFrameOfReferenceSequence (3006,0010) + * @return const reference to sequence element + */ + const DRTReferencedFrameOfReferenceSequence &getReferencedFrameOfReferenceSequence() const + { return ReferencedFrameOfReferenceSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return reference to sequence element + */ + DRTReferencedImageSequence &getReferencedImageSequence() + { return ReferencedImageSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return const reference to sequence element + */ + const DRTReferencedImageSequence &getReferencedImageSequence() const + { return ReferencedImageSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return reference to sequence element + */ + DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return const reference to sequence element + */ + const DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() const + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return reference to sequence element + */ + DRTReferencedPatientSequence &getReferencedPatientSequence() + { return ReferencedPatientSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return const reference to sequence element + */ + const DRTReferencedPatientSequence &getReferencedPatientSequence() const + { return ReferencedPatientSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return reference to sequence element + */ + DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return const reference to sequence element + */ + const DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() const + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return reference to sequence element + */ + DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() + { return ReferringPhysicianIdentificationSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return const reference to sequence element + */ + const DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() const + { return ReferringPhysicianIdentificationSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return reference to sequence element + */ + DRTRequestAttributesSequence &getRequestAttributesSequence() + { return RequestAttributesSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return const reference to sequence element + */ + const DRTRequestAttributesSequence &getRequestAttributesSequence() const + { return RequestAttributesSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return reference to sequence element + */ + DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() + { return RequestingServiceCodeSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return const reference to sequence element + */ + const DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() const + { return RequestingServiceCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return reference to sequence element + */ + DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() + { return SeriesDescriptionCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return const reference to sequence element + */ + const DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() const + { return SeriesDescriptionCodeSequence; } + + /** get SourceImageSequence (0008,2112) + * @return reference to sequence element + */ + DRTSourceImageSequence &getSourceImageSequence() + { return SourceImageSequence; } + + /** get SourceImageSequence (0008,2112) + * @return const reference to sequence element + */ + const DRTSourceImageSequence &getSourceImageSequence() const + { return SourceImageSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return reference to sequence element + */ + DRTSourceInstanceSequence &getSourceInstanceSequence() + { return SourceInstanceSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return const reference to sequence element + */ + const DRTSourceInstanceSequence &getSourceInstanceSequence() const + { return SourceInstanceSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return reference to sequence element + */ + DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() + { return SourcePatientGroupIdentificationSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return const reference to sequence element + */ + const DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() const + { return SourcePatientGroupIdentificationSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return reference to sequence element + */ + DRTStrainCodeSequence &getStrainCodeSequence() + { return StrainCodeSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return const reference to sequence element + */ + const DRTStrainCodeSequence &getStrainCodeSequence() const + { return StrainCodeSequence; } + + /** get StrainStockSequence (0010,0216) + * @return reference to sequence element + */ + DRTStrainStockSequence &getStrainStockSequence() + { return StrainStockSequence; } + + /** get StrainStockSequence (0010,0216) + * @return const reference to sequence element + */ + const DRTStrainStockSequence &getStrainStockSequence() const + { return StrainStockSequence; } + + /** get StructureSetROISequence (3006,0020) + * @return reference to sequence element + */ + DRTStructureSetROISequence &getStructureSetROISequence() + { return StructureSetROISequence; } + + /** get StructureSetROISequence (3006,0020) + * @return const reference to sequence element + */ + const DRTStructureSetROISequence &getStructureSetROISequence() const + { return StructureSetROISequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return reference to sequence element + */ + DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return const reference to sequence element + */ + const DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() const + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get UDISequence (0018,100a) + * @return reference to sequence element + */ + DRTUDISequence &getUDISequence() + { return UDISequence; } + + /** get UDISequence (0018,100a) + * @return const reference to sequence element + */ + const DRTUDISequence &getUDISequence() const + { return UDISequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AdditionalPatientHistory (0010,21b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdditionalPatientHistory(const OFString &value, const OFBool check = OFTrue); + + /** set AdmissionID (0038,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmissionID(const OFString &value, const OFBool check = OFTrue); + + /** set AdmittingDiagnosesDescription (0008,1080) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set Allergies (0010,2110) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAllergies(const OFString &value, const OFBool check = OFTrue); + + /** set ApprovalStatus (300e,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setApprovalStatus(const OFString &value, const OFBool check = OFTrue); + + /** set AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolName (0012,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesDescription (0012,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesID (0012,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteID (0012,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteName (0012,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSponsorName (0012,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSponsorName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectID (0012,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectReadingID (0012,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointDescription (0012,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointID (0012,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointID(const OFString &value, const OFBool check = OFTrue); + + /** set CommentsOnThePerformedProcedureStep (0040,0280) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check = OFTrue); + + /** set ConsultingPhysicianName (0008,009c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConsultingPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set ContentQualification (0018,9004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeidentificationMethod (0012,0063) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeidentificationMethod(const OFString &value, const OFBool check = OFTrue); + + /** set DerivationDescription (0008,2111) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDerivationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set EthnicGroup (0010,2160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEthnicGroup(const OFString &value, const OFBool check = OFTrue); + + /** set FrameOfReferenceUID (0020,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFrameOfReferenceUID(const OFString &value, const OFBool check = OFTrue); + + /** set GantryID (0018,1008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCoercionDateTime (0008,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCoercionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationDate (0008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationTime (0008,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreatorUID (0008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceNumber (0020,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set LastMenstrualDate (0010,21d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLastMenstrualDate(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalEventType (0012,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalEventType(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalInformationModified (0028,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos = 0); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredAPDimension (0010,1023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredAPDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredLateralDimension (0010,1024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredLateralDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MedicalAlerts (0010,2000) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMedicalAlerts(const OFString &value, const OFBool check = OFTrue); + + /** set Modality (0008,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, const OFBool check = OFTrue); + + /** set NameOfPhysiciansReadingStudy (0008,1060) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check = OFTrue); + + /** set Occupation (0010,2180) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOccupation(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OriginalSpecializedSOPClassUID (0008,001b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set OtherPatientNames (0010,1001) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOtherPatientNames(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAge (0010,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAlternativeCalendar (0010,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDate (0010,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthTime (0010,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthTime(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBodyMassIndex (0010,1022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBodyMassIndex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBreedDescription (0010,2292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBreedDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientComments (0010,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientComments(const OFString &value, const OFBool check = OFTrue); + + /** set PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientIdentityRemoved (0012,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientIdentityRemoved(const OFString &value, const OFBool check = OFTrue); + + /** set PatientName (0010,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSex (0010,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSexNeutered (0010,2203) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSexNeutered(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSize (0010,1020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSpeciesDescription (0010,2201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSpeciesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientState (0038,0500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientState(const OFString &value, const OFBool check = OFTrue); + + /** set PatientWeight (0010,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepDescription (0040,0254) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndDate (0040,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndTime (0040,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndTime(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepID (0040,0253) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartDate (0040,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartTime (0040,0245) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set PhysiciansOfRecord (0008,1048) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhysiciansOfRecord(const OFString &value, const OFBool check = OFTrue); + + /** set PixelPaddingValue (0028,0120) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingValue(const Uint16 value, const unsigned long pos = 0); + + /** set PositionReferenceIndicator (0020,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPositionReferenceIndicator(const OFString &value, const OFBool check = OFTrue); + + /** set PregnancyStatus (0010,21c0) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPregnancyStatus(const Uint16 value, const unsigned long pos = 0); + + /** set QualityControlSubject (0010,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlSubject(const OFString &value, const OFBool check = OFTrue); + + /** set QueryRetrieveView (0008,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQueryRetrieveView(const OFString &value, const OFBool check = OFTrue); + + /** set ReferringPhysicianName (0008,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set RelatedGeneralSOPClassUID (0008,001a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsibleOrganization (0010,2299) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePerson (0010,2297) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePerson(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePersonRole (0010,2298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePersonRole(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewDate (300e,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewDate(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewTime (300e,0005) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewTime(const OFString &value, const OFBool check = OFTrue); + + /** set ReviewerName (300e,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReviewerName(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationComment (0100,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationComment(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationDateTime (0100,0420) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set SOPClassUID (0008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceStatus (0100,0410) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceUID (0008,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDate (0008,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDescription (0008,103e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesNumber (0020,0011) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesTime (0008,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeDescription (0038,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeID (0038,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeID(const OFString &value, const OFBool check = OFTrue); + + /** set SmokingStatus (0010,21a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmokingStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set SpecificCharacterSet (0008,0005) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set StrainAdditionalInformation (0010,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainAdditionalInformation(const OFString &value, const OFBool check = OFTrue); + + /** set StrainDescription (0010,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StrainNomenclature (0010,0213) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainNomenclature(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetDate (3006,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetDate(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetDescription (3006,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetLabel (3006,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetLabel(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetName (3006,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetName(const OFString &value, const OFBool check = OFTrue); + + /** set StructureSetTime (3006,0009) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStructureSetTime(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDate (0008,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDescription (0008,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StudyID (0020,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyTime (0008,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set TimezoneOffsetFromUTC (0008,0201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, const OFBool check = OFTrue); + + + protected: + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attribute + * SOPClassUID (0008,0016) with the expected value. Any incorrectness regarding + * this attribute is reported to the log stream (if enabled for error messages). + * @param dataset DICOM dataset to be checked + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset); + + /** update various DICOM attributes + */ + void updateAttributes(); + + private: + + // DICOM attributes are listed ordered by module + + // --- PatientModule (M) --- + + /// PatientName (0010,0010) vr=PN, vm=1, type=2 + DcmPersonName PatientName; + /// PatientID (0010,0020) vr=LO, vm=1, type=2 + DcmLongString PatientID; + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientBirthDate (0010,0030) vr=DA, vm=1, type=2 + DcmDate PatientBirthDate; + /// PatientBirthDateInAlternativeCalendar (0010,0033) vr=LO, vm=1, type=3 + DcmLongString PatientBirthDateInAlternativeCalendar; + /// PatientDeathDateInAlternativeCalendar (0010,0034) vr=LO, vm=1, type=3 + DcmLongString PatientDeathDateInAlternativeCalendar; + /// PatientAlternativeCalendar (0010,0035) vr=CS, vm=1, type=1C + DcmCodeString PatientAlternativeCalendar; + /// PatientSex (0010,0040) vr=CS, vm=1, type=2 + DcmCodeString PatientSex; + /// ReferencedPatientPhotoSequence (0010,1100) vr=SQ, vm=1, type=3 + DRTReferencedPatientPhotoSequence ReferencedPatientPhotoSequence; + /// QualityControlSubject (0010,0200) vr=CS, vm=1, type=3 + DcmCodeString QualityControlSubject; + /// ReferencedPatientSequence (0008,1120) vr=SQ, vm=1, type=3 + DRTReferencedPatientSequence ReferencedPatientSequence; + /// PatientBirthTime (0010,0032) vr=TM, vm=1, type=3 + DcmTime PatientBirthTime; + /// OtherPatientIDsSequence (0010,1002) vr=SQ, vm=1, type=3 + DRTOtherPatientIDsSequence OtherPatientIDsSequence; + /// OtherPatientNames (0010,1001) vr=PN, vm=1-n, type=3 + DcmPersonName OtherPatientNames; + /// EthnicGroup (0010,2160) vr=SH, vm=1, type=3 + DcmShortString EthnicGroup; + /// PatientComments (0010,4000) vr=LT, vm=1, type=3 + DcmLongText PatientComments; + /// PatientSpeciesDescription (0010,2201) vr=LO, vm=1, type=1C + DcmLongString PatientSpeciesDescription; + /// PatientSpeciesCodeSequence (0010,2202) vr=SQ, vm=1, type=1C + DRTPatientSpeciesCodeSequence PatientSpeciesCodeSequence; + /// PatientBreedDescription (0010,2292) vr=LO, vm=1, type=2C + DcmLongString PatientBreedDescription; + /// PatientBreedCodeSequence (0010,2293) vr=SQ, vm=1, type=2C + DRTPatientBreedCodeSequence PatientBreedCodeSequence; + /// BreedRegistrationSequence (0010,2294) vr=SQ, vm=1, type=2C + DRTBreedRegistrationSequence BreedRegistrationSequence; + /// StrainDescription (0010,0212) vr=UC, vm=1, type=3 + DcmUnlimitedCharacters StrainDescription; + /// StrainNomenclature (0010,0213) vr=LO, vm=1, type=3 + DcmLongString StrainNomenclature; + /// StrainCodeSequence (0010,0219) vr=SQ, vm=1, type=3 + DRTStrainCodeSequence StrainCodeSequence; + /// StrainAdditionalInformation (0010,0218) vr=UT, vm=1, type=3 + DcmUnlimitedText StrainAdditionalInformation; + /// StrainStockSequence (0010,0216) vr=SQ, vm=1, type=3 + DRTStrainStockSequence StrainStockSequence; + /// GeneticModificationsSequence (0010,0221) vr=SQ, vm=1, type=3 + DRTGeneticModificationsSequence GeneticModificationsSequence; + /// ResponsiblePerson (0010,2297) vr=PN, vm=1, type=2C + DcmPersonName ResponsiblePerson; + /// ResponsiblePersonRole (0010,2298) vr=CS, vm=1, type=1C + DcmCodeString ResponsiblePersonRole; + /// ResponsibleOrganization (0010,2299) vr=LO, vm=1, type=2C + DcmLongString ResponsibleOrganization; + /// PatientIdentityRemoved (0012,0062) vr=CS, vm=1, type=3 + DcmCodeString PatientIdentityRemoved; + /// DeidentificationMethod (0012,0063) vr=LO, vm=1-n, type=1C + DcmLongString DeidentificationMethod; + /// DeidentificationMethodCodeSequence (0012,0064) vr=SQ, vm=1, type=1C + DRTDeidentificationMethodCodeSequence DeidentificationMethodCodeSequence; + /// SourcePatientGroupIdentificationSequence (0010,0026) vr=SQ, vm=1, type=3 + DRTSourcePatientGroupIdentificationSequence SourcePatientGroupIdentificationSequence; + /// GroupOfPatientsIdentificationSequence (0010,0027) vr=SQ, vm=1, type=3 + DRTGroupOfPatientsIdentificationSequence GroupOfPatientsIdentificationSequence; + + // --- ClinicalTrialSubjectModule (U) --- + + /// ClinicalTrialSponsorName (0012,0010) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialSponsorName; + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialProtocolID; + /// ClinicalTrialProtocolName (0012,0021) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialProtocolName; + /// ClinicalTrialSiteID (0012,0030) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteID; + /// ClinicalTrialSiteName (0012,0031) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteName; + /// ClinicalTrialSubjectID (0012,0040) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectID; + /// ClinicalTrialSubjectReadingID (0012,0042) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectReadingID; + /// ClinicalTrialProtocolEthicsCommitteeName (0012,0081) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolEthicsCommitteeName; + /// ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + + // --- GeneralStudyModule (M) --- + + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + /// StudyDate (0008,0020) vr=DA, vm=1, type=2 + DcmDate StudyDate; + /// StudyTime (0008,0030) vr=TM, vm=1, type=2 + DcmTime StudyTime; + /// ReferringPhysicianName (0008,0090) vr=PN, vm=1, type=2 + DcmPersonName ReferringPhysicianName; + /// ReferringPhysicianIdentificationSequence (0008,0096) vr=SQ, vm=1, type=3 + DRTReferringPhysicianIdentificationSequence ReferringPhysicianIdentificationSequence; + /// ConsultingPhysicianName (0008,009c) vr=PN, vm=1-n, type=3 + DcmPersonName ConsultingPhysicianName; + /// ConsultingPhysicianIdentificationSequence (0008,009d) vr=SQ, vm=1, type=3 + DRTConsultingPhysicianIdentificationSequence ConsultingPhysicianIdentificationSequence; + /// StudyID (0020,0010) vr=SH, vm=1, type=2 + DcmShortString StudyID; + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=2 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// StudyDescription (0008,1030) vr=LO, vm=1, type=3 + DcmLongString StudyDescription; + /// PhysiciansOfRecord (0008,1048) vr=PN, vm=1-n, type=3 + DcmPersonName PhysiciansOfRecord; + /// PhysiciansOfRecordIdentificationSequence (0008,1049) vr=SQ, vm=1, type=3 + DRTPhysiciansOfRecordIdentificationSequence PhysiciansOfRecordIdentificationSequence; + /// NameOfPhysiciansReadingStudy (0008,1060) vr=PN, vm=1-n, type=3 + DcmPersonName NameOfPhysiciansReadingStudy; + /// PhysiciansReadingStudyIdentificationSequence (0008,1062) vr=SQ, vm=1, type=3 + DRTPhysiciansReadingStudyIdentificationSequence PhysiciansReadingStudyIdentificationSequence; + /// RequestingServiceCodeSequence (0032,1034) vr=SQ, vm=1, type=3 + DRTRequestingServiceCodeSequence RequestingServiceCodeSequence; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// ProcedureCodeSequence (0008,1032) vr=SQ, vm=1, type=3 + DRTProcedureCodeSequence ProcedureCodeSequence; + /// ReasonForPerformedProcedureCodeSequence (0040,1012) vr=SQ, vm=1, type=3 + DRTReasonForPerformedProcedureCodeSequence ReasonForPerformedProcedureCodeSequence; + + // --- PatientStudyModule (U) --- + + /// AdmittingDiagnosesDescription (0008,1080) vr=LO, vm=1-n, type=3 + DcmLongString AdmittingDiagnosesDescription; + /// AdmittingDiagnosesCodeSequence (0008,1084) vr=SQ, vm=1, type=3 + DRTAdmittingDiagnosesCodeSequence AdmittingDiagnosesCodeSequence; + /// PatientAge (0010,1010) vr=AS, vm=1, type=3 + DcmAgeString PatientAge; + /// PatientSize (0010,1020) vr=DS, vm=1, type=3 + DcmDecimalString PatientSize; + /// PatientWeight (0010,1030) vr=DS, vm=1, type=3 + DcmDecimalString PatientWeight; + /// PatientBodyMassIndex (0010,1022) vr=DS, vm=1, type=3 + DcmDecimalString PatientBodyMassIndex; + /// MeasuredAPDimension (0010,1023) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredAPDimension; + /// MeasuredLateralDimension (0010,1024) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredLateralDimension; + /// PatientSizeCodeSequence (0010,1021) vr=SQ, vm=1, type=3 + DRTPatientSizeCodeSequence PatientSizeCodeSequence; + /// MedicalAlerts (0010,2000) vr=LO, vm=1-n, type=3 + DcmLongString MedicalAlerts; + /// Allergies (0010,2110) vr=LO, vm=1-n, type=3 + DcmLongString Allergies; + /// SmokingStatus (0010,21a0) vr=CS, vm=1, type=3 + DcmCodeString SmokingStatus; + /// PregnancyStatus (0010,21c0) vr=US, vm=1, type=3 + DcmUnsignedShort PregnancyStatus; + /// LastMenstrualDate (0010,21d0) vr=DA, vm=1, type=3 + DcmDate LastMenstrualDate; + /// PatientState (0038,0500) vr=LO, vm=1, type=3 + DcmLongString PatientState; + /// Occupation (0010,2180) vr=SH, vm=1, type=3 + DcmShortString Occupation; + /// AdditionalPatientHistory (0010,21b0) vr=LT, vm=1, type=3 + DcmLongText AdditionalPatientHistory; + /// AdmissionID (0038,0010) vr=LO, vm=1, type=3 + DcmLongString AdmissionID; + /// IssuerOfAdmissionIDSequence (0038,0014) vr=SQ, vm=1, type=3 + DRTIssuerOfAdmissionIDSequence IssuerOfAdmissionIDSequence; + /// ServiceEpisodeID (0038,0060) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeID; + /// IssuerOfServiceEpisodeIDSequence (0038,0064) vr=SQ, vm=1, type=3 + DRTIssuerOfServiceEpisodeIDSequence IssuerOfServiceEpisodeIDSequence; + /// ServiceEpisodeDescription (0038,0062) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeDescription; + /// PatientSexNeutered (0010,2203) vr=CS, vm=1, type=2C + DcmCodeString PatientSexNeutered; + + // --- ClinicalTrialStudyModule (U) --- + + /// ClinicalTrialTimePointID (0012,0050) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialTimePointID; + /// ClinicalTrialTimePointDescription (0012,0051) vr=ST, vm=1, type=3 + DcmShortText ClinicalTrialTimePointDescription; + /// LongitudinalTemporalOffsetFromEvent (0012,0052) vr=FD, vm=1, type=3 + DcmFloatingPointDouble LongitudinalTemporalOffsetFromEvent; + /// LongitudinalTemporalEventType (0012,0053) vr=CS, vm=1, type=1C + DcmCodeString LongitudinalTemporalEventType; + /// ConsentForClinicalTrialUseSequence (0012,0083) vr=SQ, vm=1, type=3 + DRTConsentForClinicalTrialUseSequence ConsentForClinicalTrialUseSequence; + + // --- RTSeriesModule (M) --- + + /// Modality (0008,0060) vr=CS, vm=1, type=1 + DcmCodeString Modality; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + /// SeriesNumber (0020,0011) vr=IS, vm=1, type=2 + DcmIntegerString SeriesNumber; + /// SeriesDate (0008,0021) vr=DA, vm=1, type=3 + DcmDate SeriesDate; + /// SeriesTime (0008,0031) vr=TM, vm=1, type=3 + DcmTime SeriesTime; + /// SeriesDescription (0008,103e) vr=LO, vm=1, type=3 + DcmLongString SeriesDescription; + /// SeriesDescriptionCodeSequence (0008,103f) vr=SQ, vm=1, type=3 + DRTSeriesDescriptionCodeSequence SeriesDescriptionCodeSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// ReferencedPerformedProcedureStepSequence (0008,1111) vr=SQ, vm=1, type=3 + DRTReferencedPerformedProcedureStepSequence ReferencedPerformedProcedureStepSequence; + /// RequestAttributesSequence (0040,0275) vr=SQ, vm=1, type=3 + DRTRequestAttributesSequence RequestAttributesSequence; + /// PerformedProcedureStepID (0040,0253) vr=SH, vm=1, type=3 + DcmShortString PerformedProcedureStepID; + /// PerformedProcedureStepStartDate (0040,0244) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepStartDate; + /// PerformedProcedureStepStartTime (0040,0245) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepStartTime; + /// PerformedProcedureStepEndDate (0040,0250) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepEndDate; + /// PerformedProcedureStepEndTime (0040,0251) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepEndTime; + /// PerformedProcedureStepDescription (0040,0254) vr=LO, vm=1, type=3 + DcmLongString PerformedProcedureStepDescription; + /// PerformedProtocolCodeSequence (0040,0260) vr=SQ, vm=1, type=3 + DRTPerformedProtocolCodeSequence PerformedProtocolCodeSequence; + /// CommentsOnThePerformedProcedureStep (0040,0280) vr=ST, vm=1, type=3 + DcmShortText CommentsOnThePerformedProcedureStep; + + // --- ClinicalTrialSeriesModule (U) --- + + /// ClinicalTrialCoordinatingCenterName (0012,0060) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialCoordinatingCenterName; + /// ClinicalTrialSeriesID (0012,0071) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesID; + /// ClinicalTrialSeriesDescription (0012,0072) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesDescription; + + // --- GeneralEquipmentModule (M) --- + + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// GantryID (0018,1008) vr=LO, vm=1, type=3 + DcmLongString GantryID; + /// UDISequence (0018,100a) vr=SQ, vm=1, type=3 + DRTUDISequence UDISequence; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + /// PixelPaddingValue (0028,0120) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingValue; + + // --- FrameOfReferenceModule (U) --- + + /// FrameOfReferenceUID (0020,0052) vr=UI, vm=1, type=1 + DcmUniqueIdentifier FrameOfReferenceUID; + /// PositionReferenceIndicator (0020,1040) vr=LO, vm=1, type=2 + DcmLongString PositionReferenceIndicator; + + // --- StructureSetModule (M) --- + + /// StructureSetLabel (3006,0002) vr=SH, vm=1, type=1 + DcmShortString StructureSetLabel; + /// StructureSetName (3006,0004) vr=LO, vm=1, type=3 + DcmLongString StructureSetName; + /// StructureSetDescription (3006,0006) vr=ST, vm=1, type=3 + DcmShortText StructureSetDescription; + /// InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + /// - also defined in: SOPCommonModule + DcmIntegerString InstanceNumber; + /// StructureSetDate (3006,0008) vr=DA, vm=1, type=2 + DcmDate StructureSetDate; + /// StructureSetTime (3006,0009) vr=TM, vm=1, type=2 + DcmTime StructureSetTime; + /// ReferencedFrameOfReferenceSequence (3006,0010) vr=SQ, vm=1, type=3 + DRTReferencedFrameOfReferenceSequence ReferencedFrameOfReferenceSequence; + /// StructureSetROISequence (3006,0020) vr=SQ, vm=1, type=1 + DRTStructureSetROISequence StructureSetROISequence; + /// PredecessorStructureSetSequence (3006,0018) vr=SQ, vm=1, type=3 + DRTPredecessorStructureSetSequence PredecessorStructureSetSequence; + + // --- ROIContourModule (M) --- + + /// ROIContourSequence (3006,0039) vr=SQ, vm=1, type=1 + DRTROIContourSequence ROIContourSequence; + + // --- RTROIObservationsModule (M) --- + + /// RTROIObservationsSequence (3006,0080) vr=SQ, vm=1, type=1 + DRTRTROIObservationsSequence RTROIObservationsSequence; + + // --- ApprovalModule (U) --- + + /// ApprovalStatus (300e,0002) vr=CS, vm=1, type=1 + DcmCodeString ApprovalStatus; + /// ReviewDate (300e,0004) vr=DA, vm=1, type=2C + DcmDate ReviewDate; + /// ReviewTime (300e,0005) vr=TM, vm=1, type=2C + DcmTime ReviewTime; + /// ReviewerName (300e,0008) vr=PN, vm=1, type=2C + DcmPersonName ReviewerName; + + // --- GeneralReferenceModule (U) --- + + /// ReferencedImageSequence (0008,1140) vr=SQ, vm=1, type=3 + DRTReferencedImageSequence ReferencedImageSequence; + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=3 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + /// DerivationDescription (0008,2111) vr=ST, vm=1, type=3 + DcmShortText DerivationDescription; + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// SourceImageSequence (0008,2112) vr=SQ, vm=1, type=3 + DRTSourceImageSequence SourceImageSequence; + /// SourceInstanceSequence (0042,0013) vr=SQ, vm=1, type=3 + DRTSourceInstanceSequence SourceInstanceSequence; + + // --- SOPCommonModule (M) --- + + /// SOPClassUID (0008,0016) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPClassUID; + /// SOPInstanceUID (0008,0018) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPInstanceUID; + /// SpecificCharacterSet (0008,0005) vr=CS, vm=1-n, type=1C + DcmCodeString SpecificCharacterSet; + /// InstanceCreationDate (0008,0012) vr=DA, vm=1, type=3 + DcmDate InstanceCreationDate; + /// InstanceCreationTime (0008,0013) vr=TM, vm=1, type=3 + DcmTime InstanceCreationTime; + /// InstanceCoercionDateTime (0008,0015) vr=DT, vm=1, type=3 + DcmDateTime InstanceCoercionDateTime; + /// InstanceCreatorUID (0008,0014) vr=UI, vm=1, type=3 + DcmUniqueIdentifier InstanceCreatorUID; + /// RelatedGeneralSOPClassUID (0008,001a) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier RelatedGeneralSOPClassUID; + /// OriginalSpecializedSOPClassUID (0008,001b) vr=UI, vm=1, type=3 + DcmUniqueIdentifier OriginalSpecializedSOPClassUID; + /// CodingSchemeIdentificationSequence (0008,0110) vr=SQ, vm=1, type=3 + DRTCodingSchemeIdentificationSequence CodingSchemeIdentificationSequence; + /// ContextGroupIdentificationSequence (0008,0123) vr=SQ, vm=1, type=3 + DRTContextGroupIdentificationSequence ContextGroupIdentificationSequence; + /// MappingResourceIdentificationSequence (0008,0124) vr=SQ, vm=1, type=3 + DRTMappingResourceIdentificationSequence MappingResourceIdentificationSequence; + /// TimezoneOffsetFromUTC (0008,0201) vr=SH, vm=1, type=3 + DcmShortString TimezoneOffsetFromUTC; + /// ContributingEquipmentSequence (0018,a001) vr=SQ, vm=1, type=3 + DRTContributingEquipmentSequence ContributingEquipmentSequence; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: StructureSetModule + // DcmIntegerString InstanceNumber; + /// SOPInstanceStatus (0100,0410) vr=CS, vm=1, type=3 + DcmCodeString SOPInstanceStatus; + /// SOPAuthorizationDateTime (0100,0420) vr=DT, vm=1, type=3 + DcmDateTime SOPAuthorizationDateTime; + /// SOPAuthorizationComment (0100,0424) vr=LT, vm=1, type=3 + DcmLongText SOPAuthorizationComment; + /// AuthorizationEquipmentCertificationNumber (0100,0426) vr=LO, vm=1, type=3 + DcmLongString AuthorizationEquipmentCertificationNumber; + /// MACParametersSequence (4ffe,0001) vr=SQ, vm=1, type=3 + DRTMACParametersSequence MACParametersSequence; + /// DigitalSignaturesSequence (fffa,fffa) vr=SQ, vm=1, type=3 + DRTDigitalSignaturesSequence DigitalSignaturesSequence; + /// EncryptedAttributesSequence (0400,0500) vr=SQ, vm=1, type=1C + DRTEncryptedAttributesSequence EncryptedAttributesSequence; + /// OriginalAttributesSequence (0400,0561) vr=SQ, vm=1, type=3 + DRTOriginalAttributesSequence OriginalAttributesSequence; + /// HL7StructuredDocumentReferenceSequence (0040,a390) vr=SQ, vm=1, type=1C + DRTHL7StructuredDocumentReferenceSequence HL7StructuredDocumentReferenceSequence; + /// LongitudinalTemporalInformationModified (0028,0303) vr=CS, vm=1, type=3 + DcmCodeString LongitudinalTemporalInformationModified; + /// QueryRetrieveView (0008,0053) vr=CS, vm=1, type=1C + DcmCodeString QueryRetrieveView; + /// ConversionSourceAttributesSequence (0020,9172) vr=SQ, vm=1, type=1C + DRTConversionSourceAttributesSequence ConversionSourceAttributesSequence; + /// ContentQualification (0018,9004) vr=CS, vm=1, type=3 + DcmCodeString ContentQualification; + /// PrivateDataElementCharacteristicsSequence (0008,0300) vr=SQ, vm=1, type=3 + DRTPrivateDataElementCharacteristicsSequence PrivateDataElementCharacteristicsSequence; + + // --- CommonInstanceReferenceModule (U) --- + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1C + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudiesContainingOtherReferencedInstancesSequence (0008,1200) vr=SQ, vm=1, type=1C + DRTStudiesContainingOtherReferencedInstancesSequence StudiesContainingOtherReferencedInstancesSequence; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drttreat.h b/dcmrt/include/dcmtk/dcmrt/drttreat.h new file mode 100644 index 00000000..0eb66a22 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drttreat.h @@ -0,0 +1,3036 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTTreatmentSummaryRecordIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTTREAT_H +#define DRTTREAT_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtadcs.h" // for AdmittingDiagnosesCodeSequence +#include "dcmtk/dcmrt/seq/drtbrs.h" // for BreedRegistrationSequence +#include "dcmtk/dcmrt/seq/drtcsis.h" // for CodingSchemeIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcctus.h" // for ConsentForClinicalTrialUseSequence +#include "dcmtk/dcmrt/seq/drtcpis.h" // for ConsultingPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtcgis.h" // for ContextGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtces.h" // for ContributingEquipmentSequence +#include "dcmtk/dcmrt/seq/drtcsas.h" // for ConversionSourceAttributesSequence +#include "dcmtk/dcmrt/seq/drtdimcs.h" // for DeidentificationMethodCodeSequence +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence +#include "dcmtk/dcmrt/seq/drtdss.h" // for DigitalSignaturesSequence +#include "dcmtk/dcmrt/seq/drteas.h" // for EncryptedAttributesSequence +#include "dcmtk/dcmrt/seq/drtfgss.h" // for FractionGroupSummarySequence +#include "dcmtk/dcmrt/seq/drtgms.h" // for GeneticModificationsSequence +#include "dcmtk/dcmrt/seq/drtgpis.h" // for GroupOfPatientsIdentificationSequence +#include "dcmtk/dcmrt/seq/drthsdrs.h" // for HL7StructuredDocumentReferenceSequence +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtiais.h" // for IssuerOfAdmissionIDSequence +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence +#include "dcmtk/dcmrt/seq/drtiseis.h" // for IssuerOfServiceEpisodeIDSequence +#include "dcmtk/dcmrt/seq/drtmps.h" // for MACParametersSequence +#include "dcmtk/dcmrt/seq/drtmris.h" // for MappingResourceIdentificationSequence +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtoas.h" // for OriginalAttributesSequence +#include "dcmtk/dcmrt/seq/drtopis.h" // for OtherPatientIDsSequence +#include "dcmtk/dcmrt/seq/drtpbcs.h" // for PatientBreedCodeSequence +#include "dcmtk/dcmrt/seq/drtpsics.h" // for PatientSizeCodeSequence +#include "dcmtk/dcmrt/seq/drtpscs.h" // for PatientSpeciesCodeSequence +#include "dcmtk/dcmrt/seq/drtppcs.h" // for PerformedProtocolCodeSequence +#include "dcmtk/dcmrt/seq/drtporis.h" // for PhysiciansOfRecordIdentificationSequence +#include "dcmtk/dcmrt/seq/drtprsis.h" // for PhysiciansReadingStudyIdentificationSequence +#include "dcmtk/dcmrt/seq/drtpdecs.h" // for PrivateDataElementCharacteristicsSequence +#include "dcmtk/dcmrt/seq/drtpcs.h" // for ProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrppcs.h" // for ReasonForPerformedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrims.h" // for ReferencedImageSequence +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence +#include "dcmtk/dcmrt/seq/drtrpphs.h" // for ReferencedPatientPhotoSequence +#include "dcmtk/dcmrt/seq/drtrps.h" // for ReferencedPatientSequence +#include "dcmtk/dcmrt/seq/drtrppss.h" // for ReferencedPerformedProcedureStepSequence +#include "dcmtk/dcmrt/seq/drtrrtps4.h" // for ReferencedRTPlanSequence +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrtrs4.h" // for ReferencedTreatmentRecordSequence +#include "dcmtk/dcmrt/seq/drtrpis.h" // for ReferringPhysicianIdentificationSequence +#include "dcmtk/dcmrt/seq/drtras.h" // for RequestAttributesSequence +#include "dcmtk/dcmrt/seq/drtrscs.h" // for RequestingServiceCodeSequence +#include "dcmtk/dcmrt/seq/drtsdcs.h" // for SeriesDescriptionCodeSequence +#include "dcmtk/dcmrt/seq/drtsis.h" // for SourceImageSequence +#include "dcmtk/dcmrt/seq/drtsins.h" // for SourceInstanceSequence +#include "dcmtk/dcmrt/seq/drtspgis.h" // for SourcePatientGroupIdentificationSequence +#include "dcmtk/dcmrt/seq/drtscs.h" // for StrainCodeSequence +#include "dcmtk/dcmrt/seq/drtsss.h" // for StrainStockSequence +#include "dcmtk/dcmrt/seq/drtscris.h" // for StudiesContainingOtherReferencedInstancesSequence +#include "dcmtk/dcmrt/seq/drttscds.h" // for TreatmentSummaryCalculatedDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drttsmds.h" // for TreatmentSummaryMeasuredDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtudis.h" // for UDISequence + + +/** Interface class for RTTreatmentSummaryRecordIOD + * @note Because of its many member variables, an instance of this class requires quite + * some memory. So be careful when creating automatic variables from this class (the + * stack size might be exceeded); it is probably better to use the heap space. + */ +class DCMTK_DCMRT_EXPORT DRTTreatmentSummaryRecordIOD + : protected DRTTypes +{ + + public: + + // --- constructors, destructor and operators --- + + /** default constructor + */ + DRTTreatmentSummaryRecordIOD(); + + /** copy constructor + * @param copy IOD object to be copied + */ + DRTTreatmentSummaryRecordIOD(const DRTTreatmentSummaryRecordIOD ©); + + /** destructor + */ + virtual ~DRTTreatmentSummaryRecordIOD(); + + /** assigment operator + * @param copy IOD object to be copied + * @return reference to this object + */ + DRTTreatmentSummaryRecordIOD &operator=(const DRTTreatmentSummaryRecordIOD ©); + + // --- general methods --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid + * @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + // --- input/output methods --- + + /** read object from dataset + * @param dataset reference to DICOM dataset from which the object should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset); + + /** read PatientData from dataset + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset); + + /** read StudyData from dataset. Also reads PatientData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset); + + /** read SeriesData from dataset. Also reads PatientData, StudyData. + * @param dataset reference to DICOM dataset from which the data should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSeriesData(DcmItem &dataset); + + /** write object to dataset + * @param dataset reference to DICOM dataset to which the object should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset); + + // --- check presence of non-mandatory DICOM modules --- + + /** check whether ClinicalTrialSubjectModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSubjectModulePresent(const OFBool complete = OFFalse); + + /** check whether PatientStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isPatientStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialStudyModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialStudyModulePresent(const OFBool complete = OFFalse); + + /** check whether ClinicalTrialSeriesModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isClinicalTrialSeriesModulePresent(const OFBool complete = OFFalse); + + /** check whether GeneralReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isGeneralReferenceModulePresent(const OFBool complete = OFFalse); + + /** check whether CommonInstanceReferenceModule (U) is present. + * By default, a module is reported as being present if at least one attribute + * from this module has a non-empty value. + * @param complete check for all mandatory attributes of this module if enabled + * @return OFTrue if module is present, OFFalse otherwise + */ + virtual OFBool isCommonInstanceReferenceModulePresent(const OFBool complete = OFFalse); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get AdditionalPatientHistory (0010,21b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdditionalPatientHistory(OFString &value, const signed long pos = 0) const; + + /** get AdmissionID (0038,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmissionID(OFString &value, const signed long pos = 0) const; + + /** get AdmittingDiagnosesDescription (0008,1080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAdmittingDiagnosesDescription(OFString &value, const signed long pos = 0) const; + + /** get Allergies (0010,2110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAllergies(OFString &value, const signed long pos = 0) const; + + /** get AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialProtocolName (0012,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialProtocolName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesDescription (0012,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSeriesID (0012,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSeriesID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteID (0012,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSiteName (0012,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSiteName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSponsorName (0012,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSponsorName(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectID (0012,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialSubjectReadingID (0012,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialSubjectReadingID(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointDescription (0012,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointDescription(OFString &value, const signed long pos = 0) const; + + /** get ClinicalTrialTimePointID (0012,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getClinicalTrialTimePointID(OFString &value, const signed long pos = 0) const; + + /** get CommentsOnThePerformedProcedureStep (0040,0280) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos = 0) const; + + /** get ConsultingPhysicianName (0008,009c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConsultingPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get ContentQualification (0018,9004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentQualification(OFString &value, const signed long pos = 0) const; + + /** get CurrentTreatmentStatus (3008,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCurrentTreatmentStatus(OFString &value, const signed long pos = 0) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeidentificationMethod (0012,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeidentificationMethod(OFString &value, const signed long pos = 0) const; + + /** get DerivationDescription (0008,2111) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDerivationDescription(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get EthnicGroup (0010,2160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getEthnicGroup(OFString &value, const signed long pos = 0) const; + + /** get FirstTreatmentDate (3008,0054) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getFirstTreatmentDate(OFString &value, const signed long pos = 0) const; + + /** get GantryID (0018,1008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getGantryID(OFString &value, const signed long pos = 0) const; + + /** get InstanceCoercionDateTime (0008,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCoercionDateTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationDate (0008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreationTime (0008,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, const signed long pos = 0) const; + + /** get InstanceCreatorUID (0008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, const signed long pos = 0) const; + + /** get InstanceNumber (0020,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get LastMenstrualDate (0010,21d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLastMenstrualDate(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalEventType (0012,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalEventType(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalInformationModified (0028,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalInformationModified(OFString &value, const signed long pos = 0) const; + + /** get LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredAPDimension (0010,1023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredAPDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(OFString &value, const signed long pos = 0) const; + + /** get MeasuredLateralDimension (0010,1024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMeasuredLateralDimension(Float64 &value, const unsigned long pos = 0) const; + + /** get MedicalAlerts (0010,2000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMedicalAlerts(OFString &value, const signed long pos = 0) const; + + /** get Modality (0008,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, const signed long pos = 0) const; + + /** get MostRecentTreatmentDate (3008,0056) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getMostRecentTreatmentDate(OFString &value, const signed long pos = 0) const; + + /** get NameOfPhysiciansReadingStudy (0008,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos = 0) const; + + /** get Occupation (0010,2180) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOccupation(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OriginalSpecializedSOPClassUID (0008,001b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get OtherPatientNames (0010,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getOtherPatientNames(OFString &value, const signed long pos = 0) const; + + /** get PatientAge (0010,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAge(OFString &value, const signed long pos = 0) const; + + /** get PatientAlternativeCalendar (0010,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDate (0010,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientBirthTime (0010,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthTime(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(OFString &value, const signed long pos = 0) const; + + /** get PatientBodyMassIndex (0010,1022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBodyMassIndex(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientBreedDescription (0010,2292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBreedDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientComments (0010,4000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientComments(OFString &value, const signed long pos = 0) const; + + /** get PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientIdentityRemoved (0012,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientIdentityRemoved(OFString &value, const signed long pos = 0) const; + + /** get PatientName (0010,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, const signed long pos = 0) const; + + /** get PatientSex (0010,0040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, const signed long pos = 0) const; + + /** get PatientSexNeutered (0010,2203) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSexNeutered(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(OFString &value, const signed long pos = 0) const; + + /** get PatientSize (0010,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSize(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSpeciesDescription (0010,2201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSpeciesDescription(OFString &value, const signed long pos = 0) const; + + /** get PatientState (0038,0500) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientState(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(OFString &value, const signed long pos = 0) const; + + /** get PatientWeight (0010,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get PerformedProcedureStepDescription (0040,0254) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndDate (0040,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepEndTime (0040,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepEndTime(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepID (0040,0253) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartDate (0040,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartDate(OFString &value, const signed long pos = 0) const; + + /** get PerformedProcedureStepStartTime (0040,0245) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPerformedProcedureStepStartTime(OFString &value, const signed long pos = 0) const; + + /** get PhysiciansOfRecord (0008,1048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPhysiciansOfRecord(OFString &value, const signed long pos = 0) const; + + /** get PixelPaddingValue (0028,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPixelPaddingValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PregnancyStatus (0010,21c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPregnancyStatus(Uint16 &value, const unsigned long pos = 0) const; + + /** get QualityControlSubject (0010,0200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQualityControlSubject(OFString &value, const signed long pos = 0) const; + + /** get QueryRetrieveView (0008,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getQueryRetrieveView(OFString &value, const signed long pos = 0) const; + + /** get ReferringPhysicianName (0008,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, const signed long pos = 0) const; + + /** get RelatedGeneralSOPClassUID (0008,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRelatedGeneralSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ResponsibleOrganization (0010,2299) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePerson (0010,2297) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePerson(OFString &value, const signed long pos = 0) const; + + /** get ResponsiblePersonRole (0010,2298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getResponsiblePersonRole(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationComment (0100,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationComment(OFString &value, const signed long pos = 0) const; + + /** get SOPAuthorizationDateTime (0100,0420) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPAuthorizationDateTime(OFString &value, const signed long pos = 0) const; + + /** get SOPClassUID (0008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceStatus (0100,0410) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceStatus(OFString &value, const signed long pos = 0) const; + + /** get SOPInstanceUID (0008,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesDate (0008,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, const signed long pos = 0) const; + + /** get SeriesDescription (0008,103e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, const signed long pos = 0) const; + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, const signed long pos = 0) const; + + /** get SeriesNumber (0020,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SeriesTime (0008,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeDescription (0038,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeDescription(OFString &value, const signed long pos = 0) const; + + /** get ServiceEpisodeID (0038,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getServiceEpisodeID(OFString &value, const signed long pos = 0) const; + + /** get SmokingStatus (0010,21a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSmokingStatus(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecificCharacterSet (0008,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, const signed long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get StrainAdditionalInformation (0010,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainAdditionalInformation(OFString &value, const signed long pos = 0) const; + + /** get StrainDescription (0010,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainDescription(OFString &value, const signed long pos = 0) const; + + /** get StrainNomenclature (0010,0213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStrainNomenclature(OFString &value, const signed long pos = 0) const; + + /** get StudyDate (0008,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, const signed long pos = 0) const; + + /** get StudyDescription (0008,1030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, const signed long pos = 0) const; + + /** get StudyID (0020,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyTime (0008,0030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, const signed long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get TimezoneOffsetFromUTC (0008,0201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, const signed long pos = 0) const; + + /** get TreatmentDate (3008,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentDate(OFString &value, const signed long pos = 0) const; + + /** get TreatmentStatusComment (3008,0202) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentStatusComment(OFString &value, const signed long pos = 0) const; + + /** get TreatmentTime (3008,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTreatmentTime(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return reference to sequence element + */ + DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() + { return AdmittingDiagnosesCodeSequence; } + + /** get AdmittingDiagnosesCodeSequence (0008,1084) + * @return const reference to sequence element + */ + const DRTAdmittingDiagnosesCodeSequence &getAdmittingDiagnosesCodeSequence() const + { return AdmittingDiagnosesCodeSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return reference to sequence element + */ + DRTBreedRegistrationSequence &getBreedRegistrationSequence() + { return BreedRegistrationSequence; } + + /** get BreedRegistrationSequence (0010,2294) + * @return const reference to sequence element + */ + const DRTBreedRegistrationSequence &getBreedRegistrationSequence() const + { return BreedRegistrationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return reference to sequence element + */ + DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() + { return CodingSchemeIdentificationSequence; } + + /** get CodingSchemeIdentificationSequence (0008,0110) + * @return const reference to sequence element + */ + const DRTCodingSchemeIdentificationSequence &getCodingSchemeIdentificationSequence() const + { return CodingSchemeIdentificationSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return reference to sequence element + */ + DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsentForClinicalTrialUseSequence (0012,0083) + * @return const reference to sequence element + */ + const DRTConsentForClinicalTrialUseSequence &getConsentForClinicalTrialUseSequence() const + { return ConsentForClinicalTrialUseSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return reference to sequence element + */ + DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() + { return ConsultingPhysicianIdentificationSequence; } + + /** get ConsultingPhysicianIdentificationSequence (0008,009d) + * @return const reference to sequence element + */ + const DRTConsultingPhysicianIdentificationSequence &getConsultingPhysicianIdentificationSequence() const + { return ConsultingPhysicianIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return reference to sequence element + */ + DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() + { return ContextGroupIdentificationSequence; } + + /** get ContextGroupIdentificationSequence (0008,0123) + * @return const reference to sequence element + */ + const DRTContextGroupIdentificationSequence &getContextGroupIdentificationSequence() const + { return ContextGroupIdentificationSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return reference to sequence element + */ + DRTContributingEquipmentSequence &getContributingEquipmentSequence() + { return ContributingEquipmentSequence; } + + /** get ContributingEquipmentSequence (0018,a001) + * @return const reference to sequence element + */ + const DRTContributingEquipmentSequence &getContributingEquipmentSequence() const + { return ContributingEquipmentSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return reference to sequence element + */ + DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() + { return ConversionSourceAttributesSequence; } + + /** get ConversionSourceAttributesSequence (0020,9172) + * @return const reference to sequence element + */ + const DRTConversionSourceAttributesSequence &getConversionSourceAttributesSequence() const + { return ConversionSourceAttributesSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return reference to sequence element + */ + DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() + { return DeidentificationMethodCodeSequence; } + + /** get DeidentificationMethodCodeSequence (0012,0064) + * @return const reference to sequence element + */ + const DRTDeidentificationMethodCodeSequence &getDeidentificationMethodCodeSequence() const + { return DeidentificationMethodCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return reference to sequence element + */ + DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() + { return DigitalSignaturesSequence; } + + /** get DigitalSignaturesSequence (fffa,fffa) + * @return const reference to sequence element + */ + const DRTDigitalSignaturesSequence &getDigitalSignaturesSequence() const + { return DigitalSignaturesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return reference to sequence element + */ + DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() + { return EncryptedAttributesSequence; } + + /** get EncryptedAttributesSequence (0400,0500) + * @return const reference to sequence element + */ + const DRTEncryptedAttributesSequence &getEncryptedAttributesSequence() const + { return EncryptedAttributesSequence; } + + /** get FractionGroupSummarySequence (3008,0220) + * @return reference to sequence element + */ + DRTFractionGroupSummarySequence &getFractionGroupSummarySequence() + { return FractionGroupSummarySequence; } + + /** get FractionGroupSummarySequence (3008,0220) + * @return const reference to sequence element + */ + const DRTFractionGroupSummarySequence &getFractionGroupSummarySequence() const + { return FractionGroupSummarySequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return reference to sequence element + */ + DRTGeneticModificationsSequence &getGeneticModificationsSequence() + { return GeneticModificationsSequence; } + + /** get GeneticModificationsSequence (0010,0221) + * @return const reference to sequence element + */ + const DRTGeneticModificationsSequence &getGeneticModificationsSequence() const + { return GeneticModificationsSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return reference to sequence element + */ + DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() + { return GroupOfPatientsIdentificationSequence; } + + /** get GroupOfPatientsIdentificationSequence (0010,0027) + * @return const reference to sequence element + */ + const DRTGroupOfPatientsIdentificationSequence &getGroupOfPatientsIdentificationSequence() const + { return GroupOfPatientsIdentificationSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return reference to sequence element + */ + DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() + { return HL7StructuredDocumentReferenceSequence; } + + /** get HL7StructuredDocumentReferenceSequence (0040,a390) + * @return const reference to sequence element + */ + const DRTHL7StructuredDocumentReferenceSequence &getHL7StructuredDocumentReferenceSequence() const + { return HL7StructuredDocumentReferenceSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return reference to sequence element + */ + DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfAdmissionIDSequence (0038,0014) + * @return const reference to sequence element + */ + const DRTIssuerOfAdmissionIDSequence &getIssuerOfAdmissionIDSequence() const + { return IssuerOfAdmissionIDSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return reference to sequence element + */ + DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() + { return IssuerOfServiceEpisodeIDSequence; } + + /** get IssuerOfServiceEpisodeIDSequence (0038,0064) + * @return const reference to sequence element + */ + const DRTIssuerOfServiceEpisodeIDSequence &getIssuerOfServiceEpisodeIDSequence() const + { return IssuerOfServiceEpisodeIDSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return reference to sequence element + */ + DRTMACParametersSequence &getMACParametersSequence() + { return MACParametersSequence; } + + /** get MACParametersSequence (4ffe,0001) + * @return const reference to sequence element + */ + const DRTMACParametersSequence &getMACParametersSequence() const + { return MACParametersSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return reference to sequence element + */ + DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() + { return MappingResourceIdentificationSequence; } + + /** get MappingResourceIdentificationSequence (0008,0124) + * @return const reference to sequence element + */ + const DRTMappingResourceIdentificationSequence &getMappingResourceIdentificationSequence() const + { return MappingResourceIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return reference to sequence element + */ + DRTOriginalAttributesSequence &getOriginalAttributesSequence() + { return OriginalAttributesSequence; } + + /** get OriginalAttributesSequence (0400,0561) + * @return const reference to sequence element + */ + const DRTOriginalAttributesSequence &getOriginalAttributesSequence() const + { return OriginalAttributesSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return reference to sequence element + */ + DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() + { return OtherPatientIDsSequence; } + + /** get OtherPatientIDsSequence (0010,1002) + * @return const reference to sequence element + */ + const DRTOtherPatientIDsSequence &getOtherPatientIDsSequence() const + { return OtherPatientIDsSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return reference to sequence element + */ + DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() + { return PatientBreedCodeSequence; } + + /** get PatientBreedCodeSequence (0010,2293) + * @return const reference to sequence element + */ + const DRTPatientBreedCodeSequence &getPatientBreedCodeSequence() const + { return PatientBreedCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return reference to sequence element + */ + DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() + { return PatientSizeCodeSequence; } + + /** get PatientSizeCodeSequence (0010,1021) + * @return const reference to sequence element + */ + const DRTPatientSizeCodeSequence &getPatientSizeCodeSequence() const + { return PatientSizeCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return reference to sequence element + */ + DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() + { return PatientSpeciesCodeSequence; } + + /** get PatientSpeciesCodeSequence (0010,2202) + * @return const reference to sequence element + */ + const DRTPatientSpeciesCodeSequence &getPatientSpeciesCodeSequence() const + { return PatientSpeciesCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return reference to sequence element + */ + DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() + { return PerformedProtocolCodeSequence; } + + /** get PerformedProtocolCodeSequence (0040,0260) + * @return const reference to sequence element + */ + const DRTPerformedProtocolCodeSequence &getPerformedProtocolCodeSequence() const + { return PerformedProtocolCodeSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return reference to sequence element + */ + DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansOfRecordIdentificationSequence (0008,1049) + * @return const reference to sequence element + */ + const DRTPhysiciansOfRecordIdentificationSequence &getPhysiciansOfRecordIdentificationSequence() const + { return PhysiciansOfRecordIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return reference to sequence element + */ + DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PhysiciansReadingStudyIdentificationSequence (0008,1062) + * @return const reference to sequence element + */ + const DRTPhysiciansReadingStudyIdentificationSequence &getPhysiciansReadingStudyIdentificationSequence() const + { return PhysiciansReadingStudyIdentificationSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return reference to sequence element + */ + DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() + { return PrivateDataElementCharacteristicsSequence; } + + /** get PrivateDataElementCharacteristicsSequence (0008,0300) + * @return const reference to sequence element + */ + const DRTPrivateDataElementCharacteristicsSequence &getPrivateDataElementCharacteristicsSequence() const + { return PrivateDataElementCharacteristicsSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return reference to sequence element + */ + DRTProcedureCodeSequence &getProcedureCodeSequence() + { return ProcedureCodeSequence; } + + /** get ProcedureCodeSequence (0008,1032) + * @return const reference to sequence element + */ + const DRTProcedureCodeSequence &getProcedureCodeSequence() const + { return ProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return reference to sequence element + */ + DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReasonForPerformedProcedureCodeSequence (0040,1012) + * @return const reference to sequence element + */ + const DRTReasonForPerformedProcedureCodeSequence &getReasonForPerformedProcedureCodeSequence() const + { return ReasonForPerformedProcedureCodeSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return reference to sequence element + */ + DRTReferencedImageSequence &getReferencedImageSequence() + { return ReferencedImageSequence; } + + /** get ReferencedImageSequence (0008,1140) + * @return const reference to sequence element + */ + const DRTReferencedImageSequence &getReferencedImageSequence() const + { return ReferencedImageSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return reference to sequence element + */ + DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientPhotoSequence (0010,1100) + * @return const reference to sequence element + */ + const DRTReferencedPatientPhotoSequence &getReferencedPatientPhotoSequence() const + { return ReferencedPatientPhotoSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return reference to sequence element + */ + DRTReferencedPatientSequence &getReferencedPatientSequence() + { return ReferencedPatientSequence; } + + /** get ReferencedPatientSequence (0008,1120) + * @return const reference to sequence element + */ + const DRTReferencedPatientSequence &getReferencedPatientSequence() const + { return ReferencedPatientSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return reference to sequence element + */ + DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedPerformedProcedureStepSequence (0008,1111) + * @return const reference to sequence element + */ + const DRTReferencedPerformedProcedureStepSequence &getReferencedPerformedProcedureStepSequence() const + { return ReferencedPerformedProcedureStepSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return reference to sequence element + */ + DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule &getReferencedRTPlanSequence() + { return ReferencedRTPlanSequence; } + + /** get ReferencedRTPlanSequence (300c,0002) + * @return const reference to sequence element + */ + const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule &getReferencedRTPlanSequence() const + { return ReferencedRTPlanSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get ReferencedTreatmentRecordSequence (3008,0030) + * @return reference to sequence element + */ + DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule &getReferencedTreatmentRecordSequence() + { return ReferencedTreatmentRecordSequence; } + + /** get ReferencedTreatmentRecordSequence (3008,0030) + * @return const reference to sequence element + */ + const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule &getReferencedTreatmentRecordSequence() const + { return ReferencedTreatmentRecordSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return reference to sequence element + */ + DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() + { return ReferringPhysicianIdentificationSequence; } + + /** get ReferringPhysicianIdentificationSequence (0008,0096) + * @return const reference to sequence element + */ + const DRTReferringPhysicianIdentificationSequence &getReferringPhysicianIdentificationSequence() const + { return ReferringPhysicianIdentificationSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return reference to sequence element + */ + DRTRequestAttributesSequence &getRequestAttributesSequence() + { return RequestAttributesSequence; } + + /** get RequestAttributesSequence (0040,0275) + * @return const reference to sequence element + */ + const DRTRequestAttributesSequence &getRequestAttributesSequence() const + { return RequestAttributesSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return reference to sequence element + */ + DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() + { return RequestingServiceCodeSequence; } + + /** get RequestingServiceCodeSequence (0032,1034) + * @return const reference to sequence element + */ + const DRTRequestingServiceCodeSequence &getRequestingServiceCodeSequence() const + { return RequestingServiceCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return reference to sequence element + */ + DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() + { return SeriesDescriptionCodeSequence; } + + /** get SeriesDescriptionCodeSequence (0008,103f) + * @return const reference to sequence element + */ + const DRTSeriesDescriptionCodeSequence &getSeriesDescriptionCodeSequence() const + { return SeriesDescriptionCodeSequence; } + + /** get SourceImageSequence (0008,2112) + * @return reference to sequence element + */ + DRTSourceImageSequence &getSourceImageSequence() + { return SourceImageSequence; } + + /** get SourceImageSequence (0008,2112) + * @return const reference to sequence element + */ + const DRTSourceImageSequence &getSourceImageSequence() const + { return SourceImageSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return reference to sequence element + */ + DRTSourceInstanceSequence &getSourceInstanceSequence() + { return SourceInstanceSequence; } + + /** get SourceInstanceSequence (0042,0013) + * @return const reference to sequence element + */ + const DRTSourceInstanceSequence &getSourceInstanceSequence() const + { return SourceInstanceSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return reference to sequence element + */ + DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() + { return SourcePatientGroupIdentificationSequence; } + + /** get SourcePatientGroupIdentificationSequence (0010,0026) + * @return const reference to sequence element + */ + const DRTSourcePatientGroupIdentificationSequence &getSourcePatientGroupIdentificationSequence() const + { return SourcePatientGroupIdentificationSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return reference to sequence element + */ + DRTStrainCodeSequence &getStrainCodeSequence() + { return StrainCodeSequence; } + + /** get StrainCodeSequence (0010,0219) + * @return const reference to sequence element + */ + const DRTStrainCodeSequence &getStrainCodeSequence() const + { return StrainCodeSequence; } + + /** get StrainStockSequence (0010,0216) + * @return reference to sequence element + */ + DRTStrainStockSequence &getStrainStockSequence() + { return StrainStockSequence; } + + /** get StrainStockSequence (0010,0216) + * @return const reference to sequence element + */ + const DRTStrainStockSequence &getStrainStockSequence() const + { return StrainStockSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return reference to sequence element + */ + DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get StudiesContainingOtherReferencedInstancesSequence (0008,1200) + * @return const reference to sequence element + */ + const DRTStudiesContainingOtherReferencedInstancesSequence &getStudiesContainingOtherReferencedInstancesSequence() const + { return StudiesContainingOtherReferencedInstancesSequence; } + + /** get TreatmentSummaryCalculatedDoseReferenceSequence (3008,0050) + * @return reference to sequence element + */ + DRTTreatmentSummaryCalculatedDoseReferenceSequence &getTreatmentSummaryCalculatedDoseReferenceSequence() + { return TreatmentSummaryCalculatedDoseReferenceSequence; } + + /** get TreatmentSummaryCalculatedDoseReferenceSequence (3008,0050) + * @return const reference to sequence element + */ + const DRTTreatmentSummaryCalculatedDoseReferenceSequence &getTreatmentSummaryCalculatedDoseReferenceSequence() const + { return TreatmentSummaryCalculatedDoseReferenceSequence; } + + /** get TreatmentSummaryMeasuredDoseReferenceSequence (3008,00e0) + * @return reference to sequence element + */ + DRTTreatmentSummaryMeasuredDoseReferenceSequence &getTreatmentSummaryMeasuredDoseReferenceSequence() + { return TreatmentSummaryMeasuredDoseReferenceSequence; } + + /** get TreatmentSummaryMeasuredDoseReferenceSequence (3008,00e0) + * @return const reference to sequence element + */ + const DRTTreatmentSummaryMeasuredDoseReferenceSequence &getTreatmentSummaryMeasuredDoseReferenceSequence() const + { return TreatmentSummaryMeasuredDoseReferenceSequence; } + + /** get UDISequence (0018,100a) + * @return reference to sequence element + */ + DRTUDISequence &getUDISequence() + { return UDISequence; } + + /** get UDISequence (0018,100a) + * @return const reference to sequence element + */ + const DRTUDISequence &getUDISequence() const + { return UDISequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set AdditionalPatientHistory (0010,21b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdditionalPatientHistory(const OFString &value, const OFBool check = OFTrue); + + /** set AdmissionID (0038,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmissionID(const OFString &value, const OFBool check = OFTrue); + + /** set AdmittingDiagnosesDescription (0008,1080) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAdmittingDiagnosesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set Allergies (0010,2110) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAllergies(const OFString &value, const OFBool check = OFTrue); + + /** set AuthorizationEquipmentCertificationNumber (0100,0426) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialCoordinatingCenterName (0012,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolEthicsCommitteeName (0012,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialProtocolName (0012,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialProtocolName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesDescription (0012,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSeriesID (0012,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSeriesID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteID (0012,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSiteName (0012,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSiteName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSponsorName (0012,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSponsorName(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectID (0012,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialSubjectReadingID (0012,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointDescription (0012,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ClinicalTrialTimePointID (0012,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setClinicalTrialTimePointID(const OFString &value, const OFBool check = OFTrue); + + /** set CommentsOnThePerformedProcedureStep (0040,0280) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check = OFTrue); + + /** set ConsultingPhysicianName (0008,009c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConsultingPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set ContentQualification (0018,9004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentQualification(const OFString &value, const OFBool check = OFTrue); + + /** set CurrentTreatmentStatus (3008,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCurrentTreatmentStatus(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeidentificationMethod (0012,0063) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeidentificationMethod(const OFString &value, const OFBool check = OFTrue); + + /** set DerivationDescription (0008,2111) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDerivationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set EthnicGroup (0010,2160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setEthnicGroup(const OFString &value, const OFBool check = OFTrue); + + /** set FirstTreatmentDate (3008,0054) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setFirstTreatmentDate(const OFString &value, const OFBool check = OFTrue); + + /** set GantryID (0018,1008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setGantryID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCoercionDateTime (0008,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCoercionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationDate (0008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationDate(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreationTime (0008,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreationTime(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceCreatorUID (0008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set InstanceNumber (0020,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set LastMenstrualDate (0010,21d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLastMenstrualDate(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalEventType (0012,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalEventType(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalInformationModified (0028,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check = OFTrue); + + /** set LongitudinalTemporalOffsetFromEvent (0012,0052) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos = 0); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredAPDimension (0010,1023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredAPDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredLateralDimension (0010,1024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMeasuredLateralDimension(const OFString &value, const OFBool check = OFTrue); + + /** set MedicalAlerts (0010,2000) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMedicalAlerts(const OFString &value, const OFBool check = OFTrue); + + /** set Modality (0008,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setModality(const OFString &value, const OFBool check = OFTrue); + + /** set MostRecentTreatmentDate (3008,0056) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setMostRecentTreatmentDate(const OFString &value, const OFBool check = OFTrue); + + /** set NameOfPhysiciansReadingStudy (0008,1060) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check = OFTrue); + + /** set Occupation (0010,2180) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOccupation(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OriginalSpecializedSOPClassUID (0008,001b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set OtherPatientNames (0010,1001) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setOtherPatientNames(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAge (0010,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAge(const OFString &value, const OFBool check = OFTrue); + + /** set PatientAlternativeCalendar (0010,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDate (0010,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthDateInAlternativeCalendar (0010,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBirthTime (0010,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthTime(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBodyMassIndex (0010,1022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBodyMassIndex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientBreedDescription (0010,2292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBreedDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientComments (0010,4000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientComments(const OFString &value, const OFBool check = OFTrue); + + /** set PatientDeathDateInAlternativeCalendar (0010,0034) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientIdentityRemoved (0012,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientIdentityRemoved(const OFString &value, const OFBool check = OFTrue); + + /** set PatientName (0010,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSex (0010,0040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSexNeutered (0010,2203) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSexNeutered(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSize (0010,1020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSize(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSpeciesDescription (0010,2201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSpeciesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PatientState (0038,0500) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientState(const OFString &value, const OFBool check = OFTrue); + + /** set PatientWeight (0010,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientWeight(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepDescription (0040,0254) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndDate (0040,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepEndTime (0040,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepEndTime(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepID (0040,0253) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartDate (0040,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartDate(const OFString &value, const OFBool check = OFTrue); + + /** set PerformedProcedureStepStartTime (0040,0245) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPerformedProcedureStepStartTime(const OFString &value, const OFBool check = OFTrue); + + /** set PhysiciansOfRecord (0008,1048) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPhysiciansOfRecord(const OFString &value, const OFBool check = OFTrue); + + /** set PixelPaddingValue (0028,0120) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPixelPaddingValue(const Uint16 value, const unsigned long pos = 0); + + /** set PregnancyStatus (0010,21c0) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPregnancyStatus(const Uint16 value, const unsigned long pos = 0); + + /** set QualityControlSubject (0010,0200) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQualityControlSubject(const OFString &value, const OFBool check = OFTrue); + + /** set QueryRetrieveView (0008,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setQueryRetrieveView(const OFString &value, const OFBool check = OFTrue); + + /** set ReferringPhysicianName (0008,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, const OFBool check = OFTrue); + + /** set RelatedGeneralSOPClassUID (0008,001a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsibleOrganization (0010,2299) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePerson (0010,2297) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePerson(const OFString &value, const OFBool check = OFTrue); + + /** set ResponsiblePersonRole (0010,2298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setResponsiblePersonRole(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationComment (0100,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationComment(const OFString &value, const OFBool check = OFTrue); + + /** set SOPAuthorizationDateTime (0100,0420) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPAuthorizationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set SOPClassUID (0008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceStatus (0100,0410) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SOPInstanceUID (0008,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDate (0008,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesDescription (0008,103e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesNumber (0020,0011) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SeriesTime (0008,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeDescription (0038,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ServiceEpisodeID (0038,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setServiceEpisodeID(const OFString &value, const OFBool check = OFTrue); + + /** set SmokingStatus (0010,21a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSmokingStatus(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set SpecificCharacterSet (0008,0005) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set StrainAdditionalInformation (0010,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainAdditionalInformation(const OFString &value, const OFBool check = OFTrue); + + /** set StrainDescription (0010,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StrainNomenclature (0010,0213) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStrainNomenclature(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDate (0008,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, const OFBool check = OFTrue); + + /** set StudyDescription (0008,1030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, const OFBool check = OFTrue); + + /** set StudyID (0020,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyTime (0008,0030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set TimezoneOffsetFromUTC (0008,0201) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentDate (3008,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentDate(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentStatusComment (3008,0202) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentStatusComment(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentTime (3008,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreatmentTime(const OFString &value, const OFBool check = OFTrue); + + + protected: + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attribute + * SOPClassUID (0008,0016) with the expected value. Any incorrectness regarding + * this attribute is reported to the log stream (if enabled for error messages). + * @param dataset DICOM dataset to be checked + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset); + + /** update various DICOM attributes + */ + void updateAttributes(); + + private: + + // DICOM attributes are listed ordered by module + + // --- PatientModule (M) --- + + /// PatientName (0010,0010) vr=PN, vm=1, type=2 + DcmPersonName PatientName; + /// PatientID (0010,0020) vr=LO, vm=1, type=2 + DcmLongString PatientID; + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientBirthDate (0010,0030) vr=DA, vm=1, type=2 + DcmDate PatientBirthDate; + /// PatientBirthDateInAlternativeCalendar (0010,0033) vr=LO, vm=1, type=3 + DcmLongString PatientBirthDateInAlternativeCalendar; + /// PatientDeathDateInAlternativeCalendar (0010,0034) vr=LO, vm=1, type=3 + DcmLongString PatientDeathDateInAlternativeCalendar; + /// PatientAlternativeCalendar (0010,0035) vr=CS, vm=1, type=1C + DcmCodeString PatientAlternativeCalendar; + /// PatientSex (0010,0040) vr=CS, vm=1, type=2 + DcmCodeString PatientSex; + /// ReferencedPatientPhotoSequence (0010,1100) vr=SQ, vm=1, type=3 + DRTReferencedPatientPhotoSequence ReferencedPatientPhotoSequence; + /// QualityControlSubject (0010,0200) vr=CS, vm=1, type=3 + DcmCodeString QualityControlSubject; + /// ReferencedPatientSequence (0008,1120) vr=SQ, vm=1, type=3 + DRTReferencedPatientSequence ReferencedPatientSequence; + /// PatientBirthTime (0010,0032) vr=TM, vm=1, type=3 + DcmTime PatientBirthTime; + /// OtherPatientIDsSequence (0010,1002) vr=SQ, vm=1, type=3 + DRTOtherPatientIDsSequence OtherPatientIDsSequence; + /// OtherPatientNames (0010,1001) vr=PN, vm=1-n, type=3 + DcmPersonName OtherPatientNames; + /// EthnicGroup (0010,2160) vr=SH, vm=1, type=3 + DcmShortString EthnicGroup; + /// PatientComments (0010,4000) vr=LT, vm=1, type=3 + DcmLongText PatientComments; + /// PatientSpeciesDescription (0010,2201) vr=LO, vm=1, type=1C + DcmLongString PatientSpeciesDescription; + /// PatientSpeciesCodeSequence (0010,2202) vr=SQ, vm=1, type=1C + DRTPatientSpeciesCodeSequence PatientSpeciesCodeSequence; + /// PatientBreedDescription (0010,2292) vr=LO, vm=1, type=2C + DcmLongString PatientBreedDescription; + /// PatientBreedCodeSequence (0010,2293) vr=SQ, vm=1, type=2C + DRTPatientBreedCodeSequence PatientBreedCodeSequence; + /// BreedRegistrationSequence (0010,2294) vr=SQ, vm=1, type=2C + DRTBreedRegistrationSequence BreedRegistrationSequence; + /// StrainDescription (0010,0212) vr=UC, vm=1, type=3 + DcmUnlimitedCharacters StrainDescription; + /// StrainNomenclature (0010,0213) vr=LO, vm=1, type=3 + DcmLongString StrainNomenclature; + /// StrainCodeSequence (0010,0219) vr=SQ, vm=1, type=3 + DRTStrainCodeSequence StrainCodeSequence; + /// StrainAdditionalInformation (0010,0218) vr=UT, vm=1, type=3 + DcmUnlimitedText StrainAdditionalInformation; + /// StrainStockSequence (0010,0216) vr=SQ, vm=1, type=3 + DRTStrainStockSequence StrainStockSequence; + /// GeneticModificationsSequence (0010,0221) vr=SQ, vm=1, type=3 + DRTGeneticModificationsSequence GeneticModificationsSequence; + /// ResponsiblePerson (0010,2297) vr=PN, vm=1, type=2C + DcmPersonName ResponsiblePerson; + /// ResponsiblePersonRole (0010,2298) vr=CS, vm=1, type=1C + DcmCodeString ResponsiblePersonRole; + /// ResponsibleOrganization (0010,2299) vr=LO, vm=1, type=2C + DcmLongString ResponsibleOrganization; + /// PatientIdentityRemoved (0012,0062) vr=CS, vm=1, type=3 + DcmCodeString PatientIdentityRemoved; + /// DeidentificationMethod (0012,0063) vr=LO, vm=1-n, type=1C + DcmLongString DeidentificationMethod; + /// DeidentificationMethodCodeSequence (0012,0064) vr=SQ, vm=1, type=1C + DRTDeidentificationMethodCodeSequence DeidentificationMethodCodeSequence; + /// SourcePatientGroupIdentificationSequence (0010,0026) vr=SQ, vm=1, type=3 + DRTSourcePatientGroupIdentificationSequence SourcePatientGroupIdentificationSequence; + /// GroupOfPatientsIdentificationSequence (0010,0027) vr=SQ, vm=1, type=3 + DRTGroupOfPatientsIdentificationSequence GroupOfPatientsIdentificationSequence; + + // --- ClinicalTrialSubjectModule (U) --- + + /// ClinicalTrialSponsorName (0012,0010) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialSponsorName; + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1 + DcmLongString ClinicalTrialProtocolID; + /// ClinicalTrialProtocolName (0012,0021) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialProtocolName; + /// ClinicalTrialSiteID (0012,0030) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteID; + /// ClinicalTrialSiteName (0012,0031) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialSiteName; + /// ClinicalTrialSubjectID (0012,0040) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectID; + /// ClinicalTrialSubjectReadingID (0012,0042) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialSubjectReadingID; + /// ClinicalTrialProtocolEthicsCommitteeName (0012,0081) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolEthicsCommitteeName; + /// ClinicalTrialProtocolEthicsCommitteeApprovalNumber (0012,0082) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + + // --- GeneralStudyModule (M) --- + + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + /// StudyDate (0008,0020) vr=DA, vm=1, type=2 + DcmDate StudyDate; + /// StudyTime (0008,0030) vr=TM, vm=1, type=2 + DcmTime StudyTime; + /// ReferringPhysicianName (0008,0090) vr=PN, vm=1, type=2 + DcmPersonName ReferringPhysicianName; + /// ReferringPhysicianIdentificationSequence (0008,0096) vr=SQ, vm=1, type=3 + DRTReferringPhysicianIdentificationSequence ReferringPhysicianIdentificationSequence; + /// ConsultingPhysicianName (0008,009c) vr=PN, vm=1-n, type=3 + DcmPersonName ConsultingPhysicianName; + /// ConsultingPhysicianIdentificationSequence (0008,009d) vr=SQ, vm=1, type=3 + DRTConsultingPhysicianIdentificationSequence ConsultingPhysicianIdentificationSequence; + /// StudyID (0020,0010) vr=SH, vm=1, type=2 + DcmShortString StudyID; + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=2 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// StudyDescription (0008,1030) vr=LO, vm=1, type=3 + DcmLongString StudyDescription; + /// PhysiciansOfRecord (0008,1048) vr=PN, vm=1-n, type=3 + DcmPersonName PhysiciansOfRecord; + /// PhysiciansOfRecordIdentificationSequence (0008,1049) vr=SQ, vm=1, type=3 + DRTPhysiciansOfRecordIdentificationSequence PhysiciansOfRecordIdentificationSequence; + /// NameOfPhysiciansReadingStudy (0008,1060) vr=PN, vm=1-n, type=3 + DcmPersonName NameOfPhysiciansReadingStudy; + /// PhysiciansReadingStudyIdentificationSequence (0008,1062) vr=SQ, vm=1, type=3 + DRTPhysiciansReadingStudyIdentificationSequence PhysiciansReadingStudyIdentificationSequence; + /// RequestingServiceCodeSequence (0032,1034) vr=SQ, vm=1, type=3 + DRTRequestingServiceCodeSequence RequestingServiceCodeSequence; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// ProcedureCodeSequence (0008,1032) vr=SQ, vm=1, type=3 + DRTProcedureCodeSequence ProcedureCodeSequence; + /// ReasonForPerformedProcedureCodeSequence (0040,1012) vr=SQ, vm=1, type=3 + DRTReasonForPerformedProcedureCodeSequence ReasonForPerformedProcedureCodeSequence; + + // --- PatientStudyModule (U) --- + + /// AdmittingDiagnosesDescription (0008,1080) vr=LO, vm=1-n, type=3 + DcmLongString AdmittingDiagnosesDescription; + /// AdmittingDiagnosesCodeSequence (0008,1084) vr=SQ, vm=1, type=3 + DRTAdmittingDiagnosesCodeSequence AdmittingDiagnosesCodeSequence; + /// PatientAge (0010,1010) vr=AS, vm=1, type=3 + DcmAgeString PatientAge; + /// PatientSize (0010,1020) vr=DS, vm=1, type=3 + DcmDecimalString PatientSize; + /// PatientWeight (0010,1030) vr=DS, vm=1, type=3 + DcmDecimalString PatientWeight; + /// PatientBodyMassIndex (0010,1022) vr=DS, vm=1, type=3 + DcmDecimalString PatientBodyMassIndex; + /// MeasuredAPDimension (0010,1023) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredAPDimension; + /// MeasuredLateralDimension (0010,1024) vr=DS, vm=1, type=3 + DcmDecimalString MeasuredLateralDimension; + /// PatientSizeCodeSequence (0010,1021) vr=SQ, vm=1, type=3 + DRTPatientSizeCodeSequence PatientSizeCodeSequence; + /// MedicalAlerts (0010,2000) vr=LO, vm=1-n, type=3 + DcmLongString MedicalAlerts; + /// Allergies (0010,2110) vr=LO, vm=1-n, type=3 + DcmLongString Allergies; + /// SmokingStatus (0010,21a0) vr=CS, vm=1, type=3 + DcmCodeString SmokingStatus; + /// PregnancyStatus (0010,21c0) vr=US, vm=1, type=3 + DcmUnsignedShort PregnancyStatus; + /// LastMenstrualDate (0010,21d0) vr=DA, vm=1, type=3 + DcmDate LastMenstrualDate; + /// PatientState (0038,0500) vr=LO, vm=1, type=3 + DcmLongString PatientState; + /// Occupation (0010,2180) vr=SH, vm=1, type=3 + DcmShortString Occupation; + /// AdditionalPatientHistory (0010,21b0) vr=LT, vm=1, type=3 + DcmLongText AdditionalPatientHistory; + /// AdmissionID (0038,0010) vr=LO, vm=1, type=3 + DcmLongString AdmissionID; + /// IssuerOfAdmissionIDSequence (0038,0014) vr=SQ, vm=1, type=3 + DRTIssuerOfAdmissionIDSequence IssuerOfAdmissionIDSequence; + /// ServiceEpisodeID (0038,0060) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeID; + /// IssuerOfServiceEpisodeIDSequence (0038,0064) vr=SQ, vm=1, type=3 + DRTIssuerOfServiceEpisodeIDSequence IssuerOfServiceEpisodeIDSequence; + /// ServiceEpisodeDescription (0038,0062) vr=LO, vm=1, type=3 + DcmLongString ServiceEpisodeDescription; + /// PatientSexNeutered (0010,2203) vr=CS, vm=1, type=2C + DcmCodeString PatientSexNeutered; + + // --- ClinicalTrialStudyModule (U) --- + + /// ClinicalTrialTimePointID (0012,0050) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialTimePointID; + /// ClinicalTrialTimePointDescription (0012,0051) vr=ST, vm=1, type=3 + DcmShortText ClinicalTrialTimePointDescription; + /// LongitudinalTemporalOffsetFromEvent (0012,0052) vr=FD, vm=1, type=3 + DcmFloatingPointDouble LongitudinalTemporalOffsetFromEvent; + /// LongitudinalTemporalEventType (0012,0053) vr=CS, vm=1, type=1C + DcmCodeString LongitudinalTemporalEventType; + /// ConsentForClinicalTrialUseSequence (0012,0083) vr=SQ, vm=1, type=3 + DRTConsentForClinicalTrialUseSequence ConsentForClinicalTrialUseSequence; + + // --- RTSeriesModule (M) --- + + /// Modality (0008,0060) vr=CS, vm=1, type=1 + DcmCodeString Modality; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + /// SeriesNumber (0020,0011) vr=IS, vm=1, type=2 + DcmIntegerString SeriesNumber; + /// SeriesDate (0008,0021) vr=DA, vm=1, type=3 + DcmDate SeriesDate; + /// SeriesTime (0008,0031) vr=TM, vm=1, type=3 + DcmTime SeriesTime; + /// SeriesDescription (0008,103e) vr=LO, vm=1, type=3 + DcmLongString SeriesDescription; + /// SeriesDescriptionCodeSequence (0008,103f) vr=SQ, vm=1, type=3 + DRTSeriesDescriptionCodeSequence SeriesDescriptionCodeSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// ReferencedPerformedProcedureStepSequence (0008,1111) vr=SQ, vm=1, type=3 + DRTReferencedPerformedProcedureStepSequence ReferencedPerformedProcedureStepSequence; + /// RequestAttributesSequence (0040,0275) vr=SQ, vm=1, type=3 + DRTRequestAttributesSequence RequestAttributesSequence; + /// PerformedProcedureStepID (0040,0253) vr=SH, vm=1, type=3 + DcmShortString PerformedProcedureStepID; + /// PerformedProcedureStepStartDate (0040,0244) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepStartDate; + /// PerformedProcedureStepStartTime (0040,0245) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepStartTime; + /// PerformedProcedureStepEndDate (0040,0250) vr=DA, vm=1, type=3 + DcmDate PerformedProcedureStepEndDate; + /// PerformedProcedureStepEndTime (0040,0251) vr=TM, vm=1, type=3 + DcmTime PerformedProcedureStepEndTime; + /// PerformedProcedureStepDescription (0040,0254) vr=LO, vm=1, type=3 + DcmLongString PerformedProcedureStepDescription; + /// PerformedProtocolCodeSequence (0040,0260) vr=SQ, vm=1, type=3 + DRTPerformedProtocolCodeSequence PerformedProtocolCodeSequence; + /// CommentsOnThePerformedProcedureStep (0040,0280) vr=ST, vm=1, type=3 + DcmShortText CommentsOnThePerformedProcedureStep; + + // --- ClinicalTrialSeriesModule (U) --- + + /// ClinicalTrialCoordinatingCenterName (0012,0060) vr=LO, vm=1, type=2 + DcmLongString ClinicalTrialCoordinatingCenterName; + /// ClinicalTrialSeriesID (0012,0071) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesID; + /// ClinicalTrialSeriesDescription (0012,0072) vr=LO, vm=1, type=3 + DcmLongString ClinicalTrialSeriesDescription; + + // --- GeneralEquipmentModule (M) --- + + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// GantryID (0018,1008) vr=LO, vm=1, type=3 + DcmLongString GantryID; + /// UDISequence (0018,100a) vr=SQ, vm=1, type=3 + DRTUDISequence UDISequence; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + /// PixelPaddingValue (0028,0120) vr=US/SS, vm=1, type=1C + DcmUnsignedShort PixelPaddingValue; + + // --- RTGeneralTreatmentRecordModule (M) --- + + /// InstanceNumber (0020,0013) vr=IS, vm=1, type=1 + /// - also defined in: SOPCommonModule + DcmIntegerString InstanceNumber; + /// TreatmentDate (3008,0250) vr=DA, vm=1, type=2 + DcmDate TreatmentDate; + /// TreatmentTime (3008,0251) vr=TM, vm=1, type=2 + DcmTime TreatmentTime; + /// ReferencedRTPlanSequence (300c,0002) vr=SQ, vm=1, type=2 + DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule ReferencedRTPlanSequence; + /// ReferencedTreatmentRecordSequence (3008,0030) vr=SQ, vm=1, type=3 + DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule ReferencedTreatmentRecordSequence; + + // --- RTTreatmentSummaryRecordModule (M) --- + + /// CurrentTreatmentStatus (3008,0200) vr=CS, vm=1, type=1 + DcmCodeString CurrentTreatmentStatus; + /// TreatmentStatusComment (3008,0202) vr=ST, vm=1, type=3 + DcmShortText TreatmentStatusComment; + /// FirstTreatmentDate (3008,0054) vr=DA, vm=1, type=2 + DcmDate FirstTreatmentDate; + /// MostRecentTreatmentDate (3008,0056) vr=DA, vm=1, type=2 + DcmDate MostRecentTreatmentDate; + /// FractionGroupSummarySequence (3008,0220) vr=SQ, vm=1, type=3 + DRTFractionGroupSummarySequence FractionGroupSummarySequence; + /// TreatmentSummaryMeasuredDoseReferenceSequence (3008,00e0) vr=SQ, vm=1, type=3 + DRTTreatmentSummaryMeasuredDoseReferenceSequence TreatmentSummaryMeasuredDoseReferenceSequence; + /// TreatmentSummaryCalculatedDoseReferenceSequence (3008,0050) vr=SQ, vm=1, type=3 + DRTTreatmentSummaryCalculatedDoseReferenceSequence TreatmentSummaryCalculatedDoseReferenceSequence; + + // --- GeneralReferenceModule (U) --- + + /// ReferencedImageSequence (0008,1140) vr=SQ, vm=1, type=3 + DRTReferencedImageSequence ReferencedImageSequence; + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=3 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + /// DerivationDescription (0008,2111) vr=ST, vm=1, type=3 + DcmShortText DerivationDescription; + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// SourceImageSequence (0008,2112) vr=SQ, vm=1, type=3 + DRTSourceImageSequence SourceImageSequence; + /// SourceInstanceSequence (0042,0013) vr=SQ, vm=1, type=3 + DRTSourceInstanceSequence SourceInstanceSequence; + + // --- SOPCommonModule (M) --- + + /// SOPClassUID (0008,0016) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPClassUID; + /// SOPInstanceUID (0008,0018) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SOPInstanceUID; + /// SpecificCharacterSet (0008,0005) vr=CS, vm=1-n, type=1C + DcmCodeString SpecificCharacterSet; + /// InstanceCreationDate (0008,0012) vr=DA, vm=1, type=3 + DcmDate InstanceCreationDate; + /// InstanceCreationTime (0008,0013) vr=TM, vm=1, type=3 + DcmTime InstanceCreationTime; + /// InstanceCoercionDateTime (0008,0015) vr=DT, vm=1, type=3 + DcmDateTime InstanceCoercionDateTime; + /// InstanceCreatorUID (0008,0014) vr=UI, vm=1, type=3 + DcmUniqueIdentifier InstanceCreatorUID; + /// RelatedGeneralSOPClassUID (0008,001a) vr=UI, vm=1-n, type=3 + DcmUniqueIdentifier RelatedGeneralSOPClassUID; + /// OriginalSpecializedSOPClassUID (0008,001b) vr=UI, vm=1, type=3 + DcmUniqueIdentifier OriginalSpecializedSOPClassUID; + /// CodingSchemeIdentificationSequence (0008,0110) vr=SQ, vm=1, type=3 + DRTCodingSchemeIdentificationSequence CodingSchemeIdentificationSequence; + /// ContextGroupIdentificationSequence (0008,0123) vr=SQ, vm=1, type=3 + DRTContextGroupIdentificationSequence ContextGroupIdentificationSequence; + /// MappingResourceIdentificationSequence (0008,0124) vr=SQ, vm=1, type=3 + DRTMappingResourceIdentificationSequence MappingResourceIdentificationSequence; + /// TimezoneOffsetFromUTC (0008,0201) vr=SH, vm=1, type=3 + DcmShortString TimezoneOffsetFromUTC; + /// ContributingEquipmentSequence (0018,a001) vr=SQ, vm=1, type=3 + DRTContributingEquipmentSequence ContributingEquipmentSequence; + // InstanceNumber (0020,0013) vr=IS, vm=1, type=3 + // - also defined in: RTGeneralTreatmentRecordModule + // DcmIntegerString InstanceNumber; + /// SOPInstanceStatus (0100,0410) vr=CS, vm=1, type=3 + DcmCodeString SOPInstanceStatus; + /// SOPAuthorizationDateTime (0100,0420) vr=DT, vm=1, type=3 + DcmDateTime SOPAuthorizationDateTime; + /// SOPAuthorizationComment (0100,0424) vr=LT, vm=1, type=3 + DcmLongText SOPAuthorizationComment; + /// AuthorizationEquipmentCertificationNumber (0100,0426) vr=LO, vm=1, type=3 + DcmLongString AuthorizationEquipmentCertificationNumber; + /// MACParametersSequence (4ffe,0001) vr=SQ, vm=1, type=3 + DRTMACParametersSequence MACParametersSequence; + /// DigitalSignaturesSequence (fffa,fffa) vr=SQ, vm=1, type=3 + DRTDigitalSignaturesSequence DigitalSignaturesSequence; + /// EncryptedAttributesSequence (0400,0500) vr=SQ, vm=1, type=1C + DRTEncryptedAttributesSequence EncryptedAttributesSequence; + /// OriginalAttributesSequence (0400,0561) vr=SQ, vm=1, type=3 + DRTOriginalAttributesSequence OriginalAttributesSequence; + /// HL7StructuredDocumentReferenceSequence (0040,a390) vr=SQ, vm=1, type=1C + DRTHL7StructuredDocumentReferenceSequence HL7StructuredDocumentReferenceSequence; + /// LongitudinalTemporalInformationModified (0028,0303) vr=CS, vm=1, type=3 + DcmCodeString LongitudinalTemporalInformationModified; + /// QueryRetrieveView (0008,0053) vr=CS, vm=1, type=1C + DcmCodeString QueryRetrieveView; + /// ConversionSourceAttributesSequence (0020,9172) vr=SQ, vm=1, type=1C + DRTConversionSourceAttributesSequence ConversionSourceAttributesSequence; + /// ContentQualification (0018,9004) vr=CS, vm=1, type=3 + DcmCodeString ContentQualification; + /// PrivateDataElementCharacteristicsSequence (0008,0300) vr=SQ, vm=1, type=3 + DRTPrivateDataElementCharacteristicsSequence PrivateDataElementCharacteristicsSequence; + + // --- CommonInstanceReferenceModule (U) --- + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1C + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudiesContainingOtherReferencedInstancesSequence (0008,1200) vr=SQ, vm=1, type=1C + DRTStudiesContainingOtherReferencedInstancesSequence StudiesContainingOtherReferencedInstancesSequence; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/drttypes.h b/dcmrt/include/dcmtk/dcmrt/drttypes.h new file mode 100644 index 00000000..9f9a8ba3 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/drttypes.h @@ -0,0 +1,223 @@ +/* + * + * Copyright (c) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTTypes + * + * Generated manually based on dsrtypes.h + * File created on 2008-12-05 + * Last modified on 2016-02-12 by Riesmeier + * + */ + + +#ifndef DRTTYPES_H +#define DRTTYPES_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/ofstd/ofvector.h" +#include "dcmtk/oflog/oflog.h" + +#include "dcmtk/dcmdata/dctk.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmrt_EXPORTS +#define DCMTK_DCMRT_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMRT_EXPORT DCMTK_DECL_IMPORT +#endif + + +// include this file in doxygen documentation + +/** @file drttypes.h + * @brief type definitions, constants and helper functions for the dcmrt module + */ + + +/*-----------------------* + * contant definitions * + *-----------------------*/ + +/** @name specific error conditions for module dcmrt. + * These error codes can be used in addition to the general purpose + * codes defined in module dcmdata. + */ +//@{ + +/// error: a value is invalid according to the standard +extern DCMTK_DCMRT_EXPORT const OFConditionConst RT_EC_InvalidValue; + +/// error: a value is not supported by this implementation +extern DCMTK_DCMRT_EXPORT const OFConditionConst RT_EC_UnsupportedValue; + +/// error: the object is invalid, see isValid() method in IOD class +extern DCMTK_DCMRT_EXPORT const OFConditionConst RT_EC_InvalidObject; + +//@} + + +// global definitions for logging mechanism provided by the oflog module + +extern DCMTK_DCMRT_EXPORT OFLogger DCM_dcmrtLogger; + +#define DCMRT_TRACE(msg) OFLOG_TRACE(DCM_dcmrtLogger, msg) +#define DCMRT_DEBUG(msg) OFLOG_DEBUG(DCM_dcmrtLogger, msg) +#define DCMRT_INFO(msg) OFLOG_INFO(DCM_dcmrtLogger, msg) +#define DCMRT_WARN(msg) OFLOG_WARN(DCM_dcmrtLogger, msg) +#define DCMRT_ERROR(msg) OFLOG_ERROR(DCM_dcmrtLogger, msg) +#define DCMRT_FATAL(msg) OFLOG_FATAL(DCM_dcmrtLogger, msg) + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** General purpose class hiding global functions, constants and types from the + * global namespace. Some of them might be moved to 'ofstd' or 'dcmdata' later on. + * All functions and constants are static and can, therefore, be accessed without + * creating an instance of this class. + */ +class DCMTK_DCMRT_EXPORT DRTTypes +{ + + public: + + // --- destructor --- + + /** destructor. (only needed to avoid compiler warnings) + */ + virtual ~DRTTypes(); + + + // --- DICOM data structure access functions --- + + /** add given element to the dataset. + * The element is only added if 'result' is EC_Normal and the 'element' pointer is not NULL. + * @param result reference to status variable (checked before adding and updated afterwards!) + * @param dataset reference to DICOM dataset to which the element should be added + * @param element pointer to DICOM element which should be added. deleted if not inserted. + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module name to be printed (default: "RT object" if NULL) + * @return current value of 'result', EC_Normal if successful, an error code otherwise + */ + static OFCondition addElementToDataset(OFCondition &result, + DcmItem &dataset, + DcmElement *element, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL); + + /** get element from dataset + * @param dataset reference to DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param element reference to DICOM element which should be retrieved. The return value + * is also stored in this parameter. + * @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition getElementFromDataset(DcmItem &dataset, + DcmElement &element); + + /** get string value from element + * @param element reference to DICOM element from which the string value should be retrieved + * @param stringValue reference to character string where the result should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return reference character string if successful, empty string otherwise + */ + static OFCondition getStringValueFromElement(const DcmElement &element, + OFString &stringValue, + const signed long pos = 0); + + /** get string value from dataset + * @param dataset reference to DICOM dataset from which the string should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param tagKey DICOM tag specifying the attribute from which the string should be retrieved + * @param stringValue reference to character string in which the result should be stored. + * (This parameter is automatically cleared if the tag could not be found.) + * @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition getStringValueFromDataset(DcmItem &dataset, + const DcmTagKey &tagKey, + OFString &stringValue); + + /** put string value to dataset + * @param dataset reference to DICOM dataset to which the string should be put. + * @param tag DICOM tag specifying the attribute to which the string should be put + * @param stringValue character string specifying the value to be set + * @param allowEmpty allow empty element to be inserted if OFTrue. + * Do not insert empty element otherwise. + * @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition putStringValueToDataset(DcmItem &dataset, + const DcmTag &tag, + const OFString &stringValue, + const OFBool allowEmpty = OFTrue); + + /** check element value for correct value multiplicity and type + * @param element DICOM element to be checked + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param searchCond optional flag indicating the status of a previous 'search' function call + * @param moduleName optional module name to be printed (default: "RT object" if NULL) + * @return OFTrue if element value is correct, OFFalse otherwise + */ + static OFBool checkElementValue(DcmElement &element, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond = EC_Normal, + const char *moduleName = NULL); + + /** get element from dataset and check it for correct value multiplicity and type. + * This functions calls the above one to check the element value. + * @param dataset reference to DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param element DICOM element used to store the value + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if element could be retrieved and value is correct, an error code otherwise + */ + static OFCondition getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement &element, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL); + + /** get string value from dataset and check it for correct value multiplicity and type. + * This functions calls the above one to check the element value. + * @param dataset reference to DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param tagKey DICOM tag specifying the attribute from which the string should be retrieved + * @param stringValue reference to character string in which the result should be stored. + * (This parameter is automatically cleared if the tag could not be found.) + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if element could be retrieved and value is correct, an error code otherwise + */ + static OFCondition getAndCheckStringValueFromDataset(DcmItem &dataset, + const DcmTagKey &tagKey, + OFString &stringValue, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL); +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtaadcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtaadcs.h new file mode 100644 index 00000000..8f5703f1 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtaadcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTAssigningAgencyOrDepartmentCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAADCS_H +#define DRTAADCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for AssigningAgencyOrDepartmentCodeSequence (0040,003a) + */ +class DCMTK_DCMRT_EXPORT DRTAssigningAgencyOrDepartmentCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTAssigningAgencyOrDepartmentCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTAssigningAgencyOrDepartmentCodeSequence(const DRTAssigningAgencyOrDepartmentCodeSequence ©); + + /** destructor + */ + virtual ~DRTAssigningAgencyOrDepartmentCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTAssigningAgencyOrDepartmentCodeSequence &operator=(const DRTAssigningAgencyOrDepartmentCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtadcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtadcs.h new file mode 100644 index 00000000..b2455fb5 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtadcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTAdmittingDiagnosesCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTADCS_H +#define DRTADCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for AdmittingDiagnosesCodeSequence (0008,1084) + */ +class DCMTK_DCMRT_EXPORT DRTAdmittingDiagnosesCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTAdmittingDiagnosesCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTAdmittingDiagnosesCodeSequence(const DRTAdmittingDiagnosesCodeSequence ©); + + /** destructor + */ + virtual ~DRTAdmittingDiagnosesCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTAdmittingDiagnosesCodeSequence &operator=(const DRTAdmittingDiagnosesCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtads.h b/dcmrt/include/dcmtk/dcmrt/seq/drtads.h new file mode 100644 index 00000000..6dcdb3ea --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtads.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTAdditionalDrugSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTADS_H +#define DRTADS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for AdditionalDrugSequence (0018,002a) + */ +class DCMTK_DCMRT_EXPORT DRTAdditionalDrugSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTAdditionalDrugSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTAdditionalDrugSequence(const DRTAdditionalDrugSequence ©); + + /** destructor + */ + virtual ~DRTAdditionalDrugSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTAdditionalDrugSequence &operator=(const DRTAdditionalDrugSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtafs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtafs.h new file mode 100644 index 00000000..77fb4471 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtafs.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTAssigningFacilitySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAFS_H +#define DRTAFS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for AssigningFacilitySequence (0040,0036) + */ +class DCMTK_DCMRT_EXPORT DRTAssigningFacilitySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LocalNamespaceEntityID (0040,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLocalNamespaceEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityID (0040,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityIDType (0040,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityIDType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LocalNamespaceEntityID (0040,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLocalNamespaceEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityID (0040,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityIDType (0040,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityIDType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LocalNamespaceEntityID (0040,0031) vr=UT, vm=1, type=1C + DcmUnlimitedText LocalNamespaceEntityID; + /// UniversalEntityID (0040,0032) vr=UT, vm=1, type=1C + DcmUnlimitedText UniversalEntityID; + /// UniversalEntityIDType (0040,0033) vr=CS, vm=1, type=1C + DcmCodeString UniversalEntityIDType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTAssigningFacilitySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTAssigningFacilitySequence(const DRTAssigningFacilitySequence ©); + + /** destructor + */ + virtual ~DRTAssigningFacilitySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTAssigningFacilitySequence &operator=(const DRTAssigningFacilitySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtags.h b/dcmrt/include/dcmtk/dcmrt/seq/drtags.h new file mode 100644 index 00000000..e0603148 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtags.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTApplicatorGeometrySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAGS_H +#define DRTAGS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ApplicatorGeometrySequence (300a,0431) + */ +class DCMTK_DCMRT_EXPORT DRTApplicatorGeometrySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ApplicatorApertureShape (300a,0432) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorApertureShape(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorOpening (300a,0433) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorOpening(Float32 &value, const unsigned long pos = 0) const; + + /** get ApplicatorOpeningX (300a,0434) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorOpeningX(Float32 &value, const unsigned long pos = 0) const; + + /** get ApplicatorOpeningY (300a,0435) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorOpeningY(Float32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ApplicatorApertureShape (300a,0432) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorApertureShape(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorOpening (300a,0433) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorOpening(const Float32 value, const unsigned long pos = 0); + + /** set ApplicatorOpeningX (300a,0434) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorOpeningX(const Float32 value, const unsigned long pos = 0); + + /** set ApplicatorOpeningY (300a,0435) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorOpeningY(const Float32 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ApplicatorApertureShape (300a,0432) vr=CS, vm=1, type=1 + DcmCodeString ApplicatorApertureShape; + /// ApplicatorOpening (300a,0433) vr=FL, vm=1, type=1C + DcmFloatingPointSingle ApplicatorOpening; + /// ApplicatorOpeningX (300a,0434) vr=FL, vm=1, type=1C + DcmFloatingPointSingle ApplicatorOpeningX; + /// ApplicatorOpeningY (300a,0435) vr=FL, vm=1, type=1C + DcmFloatingPointSingle ApplicatorOpeningY; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTApplicatorGeometrySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTApplicatorGeometrySequence(const DRTApplicatorGeometrySequence ©); + + /** destructor + */ + virtual ~DRTApplicatorGeometrySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTApplicatorGeometrySequence &operator=(const DRTApplicatorGeometrySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtajcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtajcs.h new file mode 100644 index 00000000..c6cb534f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtajcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTAssigningJurisdictionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAJCS_H +#define DRTAJCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for AssigningJurisdictionCodeSequence (0040,0039) + */ +class DCMTK_DCMRT_EXPORT DRTAssigningJurisdictionCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTAssigningJurisdictionCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTAssigningJurisdictionCodeSequence(const DRTAssigningJurisdictionCodeSequence ©); + + /** destructor + */ + virtual ~DRTAssigningJurisdictionCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTAssigningJurisdictionCodeSequence &operator=(const DRTAssigningJurisdictionCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtas1.h b/dcmrt/include/dcmtk/dcmrt/seq/drtas1.h new file mode 100644 index 00000000..bc67f35b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtas1.h @@ -0,0 +1,385 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTApplicatorSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAS1_H +#define DRTAS1_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtags.h" // for ApplicatorGeometrySequence + + +/** Interface class for ApplicatorSequence (300a,0107) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTApplicatorSequenceInRTBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorDescription (300a,010a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorDescription(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorID (300a,0108) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorID(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorType (300a,0109) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorType(OFString &value, const signed long pos = 0) const; + + /** get SourceToApplicatorMountingPositionDistance (300a,0436) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToApplicatorMountingPositionDistance(Float32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ApplicatorGeometrySequence (300a,0431) + * @return reference to sequence element + */ + DRTApplicatorGeometrySequence &getApplicatorGeometrySequence() + { return ApplicatorGeometrySequence; } + + /** get ApplicatorGeometrySequence (300a,0431) + * @return const reference to sequence element + */ + const DRTApplicatorGeometrySequence &getApplicatorGeometrySequence() const + { return ApplicatorGeometrySequence; } + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorDescription (300a,010a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorID (300a,0108) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorID(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorType (300a,0109) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorType(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToApplicatorMountingPositionDistance (300a,0436) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToApplicatorMountingPositionDistance(const Float32 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// ApplicatorDescription (300a,010a) vr=LO, vm=1, type=3 + DcmLongString ApplicatorDescription; + /// ApplicatorGeometrySequence (300a,0431) vr=SQ, vm=1, type=3 + DRTApplicatorGeometrySequence ApplicatorGeometrySequence; + /// ApplicatorID (300a,0108) vr=SH, vm=1, type=1 + DcmShortString ApplicatorID; + /// ApplicatorType (300a,0109) vr=CS, vm=1, type=1 + DcmCodeString ApplicatorType; + /// SourceToApplicatorMountingPositionDistance (300a,0436) vr=FL, vm=1, type=3 + DcmFloatingPointSingle SourceToApplicatorMountingPositionDistance; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTApplicatorSequenceInRTBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTApplicatorSequenceInRTBeamsModule(const DRTApplicatorSequenceInRTBeamsModule ©); + + /** destructor + */ + virtual ~DRTApplicatorSequenceInRTBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTApplicatorSequenceInRTBeamsModule &operator=(const DRTApplicatorSequenceInRTBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtas5.h b/dcmrt/include/dcmtk/dcmrt/seq/drtas5.h new file mode 100644 index 00000000..c1f5801d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtas5.h @@ -0,0 +1,385 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTApplicatorSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAS5_H +#define DRTAS5_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtags.h" // for ApplicatorGeometrySequence + + +/** Interface class for ApplicatorSequence (300a,0107) in RTImageModule + */ +class DCMTK_DCMRT_EXPORT DRTApplicatorSequenceInRTImageModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorDescription (300a,010a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorDescription(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorID (300a,0108) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorID(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorType (300a,0109) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorType(OFString &value, const signed long pos = 0) const; + + /** get SourceToApplicatorMountingPositionDistance (300a,0436) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToApplicatorMountingPositionDistance(Float32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ApplicatorGeometrySequence (300a,0431) + * @return reference to sequence element + */ + DRTApplicatorGeometrySequence &getApplicatorGeometrySequence() + { return ApplicatorGeometrySequence; } + + /** get ApplicatorGeometrySequence (300a,0431) + * @return const reference to sequence element + */ + const DRTApplicatorGeometrySequence &getApplicatorGeometrySequence() const + { return ApplicatorGeometrySequence; } + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorDescription (300a,010a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorID (300a,0108) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorID(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorType (300a,0109) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorType(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToApplicatorMountingPositionDistance (300a,0436) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToApplicatorMountingPositionDistance(const Float32 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// ApplicatorDescription (300a,010a) vr=LO, vm=1, type=3 + DcmLongString ApplicatorDescription; + /// ApplicatorGeometrySequence (300a,0431) vr=SQ, vm=1, type=3 + DRTApplicatorGeometrySequence ApplicatorGeometrySequence; + /// ApplicatorID (300a,0108) vr=SH, vm=1, type=1 + DcmShortString ApplicatorID; + /// ApplicatorType (300a,0109) vr=CS, vm=1, type=1 + DcmCodeString ApplicatorType; + /// SourceToApplicatorMountingPositionDistance (300a,0436) vr=FL, vm=1, type=3 + DcmFloatingPointSingle SourceToApplicatorMountingPositionDistance; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTApplicatorSequenceInRTImageModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTApplicatorSequenceInRTImageModule(const DRTApplicatorSequenceInRTImageModule ©); + + /** destructor + */ + virtual ~DRTApplicatorSequenceInRTImageModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTApplicatorSequenceInRTImageModule &operator=(const DRTApplicatorSequenceInRTImageModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtas6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtas6.h new file mode 100644 index 00000000..8a152461 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtas6.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTApplicatorSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAS6_H +#define DRTAS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ApplicatorSequence (300a,0107) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTApplicatorSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorDescription (300a,010a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorDescription(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorID (300a,0108) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorID(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorType (300a,0109) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorDescription (300a,010a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorID (300a,0108) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorID(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorType (300a,0109) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// ApplicatorDescription (300a,010a) vr=LO, vm=1, type=3 + DcmLongString ApplicatorDescription; + /// ApplicatorID (300a,0108) vr=SH, vm=1, type=1 + DcmShortString ApplicatorID; + /// ApplicatorType (300a,0109) vr=CS, vm=1, type=1 + DcmCodeString ApplicatorType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTApplicatorSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTApplicatorSequenceInRTIonBeamsModule(const DRTApplicatorSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTApplicatorSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTApplicatorSequenceInRTIonBeamsModule &operator=(const DRTApplicatorSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtas7.h b/dcmrt/include/dcmtk/dcmrt/seq/drtas7.h new file mode 100644 index 00000000..e51cdb3a --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtas7.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTApplicatorSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTAS7_H +#define DRTAS7_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ApplicatorSequence (300a,0107) in RTIonBeamsSessionRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTApplicatorSequenceInRTIonBeamsSessionRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorDescription (300a,010a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorDescription(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorID (300a,0108) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorID(OFString &value, const signed long pos = 0) const; + + /** get ApplicatorType (300a,0109) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicatorType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorDescription (300a,010a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorID (300a,0108) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorID(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicatorType (300a,0109) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicatorType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// ApplicatorDescription (300a,010a) vr=LO, vm=1, type=3 + DcmLongString ApplicatorDescription; + /// ApplicatorID (300a,0108) vr=SH, vm=1, type=1 + DcmShortString ApplicatorID; + /// ApplicatorType (300a,0109) vr=CS, vm=1, type=1 + DcmCodeString ApplicatorType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTApplicatorSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTApplicatorSequenceInRTIonBeamsSessionRecordModule(const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule ©); + + /** destructor + */ + virtual ~DRTApplicatorSequenceInRTIonBeamsSessionRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTApplicatorSequenceInRTIonBeamsSessionRecordModule &operator=(const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtass.h b/dcmrt/include/dcmtk/dcmrt/seq/drtass.h new file mode 100644 index 00000000..95ba2669 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtass.h @@ -0,0 +1,484 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTApplicationSetupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTASS_H +#define DRTASS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbads.h" // for BrachyAccessoryDeviceSequence +#include "dcmtk/dcmrt/seq/drtchs.h" // for ChannelSequence +#include "dcmtk/dcmrt/seq/drtrris9.h" // for ReferencedReferenceImageSequence + + +/** Interface class for ApplicationSetupSequence (300a,0230) in RTBrachyApplicationSetupsModule + */ +class DCMTK_DCMRT_EXPORT DRTApplicationSetupSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ApplicationSetupManufacturer (300a,0238) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicationSetupManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ApplicationSetupName (300a,0236) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicationSetupName(OFString &value, const signed long pos = 0) const; + + /** get ApplicationSetupNumber (300a,0234) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicationSetupNumber(OFString &value, const signed long pos = 0) const; + + /** get ApplicationSetupNumber (300a,0234) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicationSetupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ApplicationSetupType (300a,0232) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getApplicationSetupType(OFString &value, const signed long pos = 0) const; + + /** get TemplateName (300a,0244) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTemplateName(OFString &value, const signed long pos = 0) const; + + /** get TemplateNumber (300a,0240) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTemplateNumber(OFString &value, const signed long pos = 0) const; + + /** get TemplateNumber (300a,0240) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTemplateNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get TemplateType (300a,0242) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTemplateType(OFString &value, const signed long pos = 0) const; + + /** get TotalReferenceAirKerma (300a,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalReferenceAirKerma(OFString &value, const signed long pos = 0) const; + + /** get TotalReferenceAirKerma (300a,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalReferenceAirKerma(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BrachyAccessoryDeviceSequence (300a,0260) + * @return reference to sequence element + */ + DRTBrachyAccessoryDeviceSequence &getBrachyAccessoryDeviceSequence() + { return BrachyAccessoryDeviceSequence; } + + /** get BrachyAccessoryDeviceSequence (300a,0260) + * @return const reference to sequence element + */ + const DRTBrachyAccessoryDeviceSequence &getBrachyAccessoryDeviceSequence() const + { return BrachyAccessoryDeviceSequence; } + + /** get ChannelSequence (300a,0280) + * @return reference to sequence element + */ + DRTChannelSequence &getChannelSequence() + { return ChannelSequence; } + + /** get ChannelSequence (300a,0280) + * @return const reference to sequence element + */ + const DRTChannelSequence &getChannelSequence() const + { return ChannelSequence; } + + /** get ReferencedReferenceImageSequence (300c,0042) + * @return reference to sequence element + */ + DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule &getReferencedReferenceImageSequence() + { return ReferencedReferenceImageSequence; } + + /** get ReferencedReferenceImageSequence (300c,0042) + * @return const reference to sequence element + */ + const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule &getReferencedReferenceImageSequence() const + { return ReferencedReferenceImageSequence; } + + // --- set DICOM attribute values --- + + /** set ApplicationSetupManufacturer (300a,0238) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicationSetupManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicationSetupName (300a,0236) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicationSetupName(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicationSetupNumber (300a,0234) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicationSetupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ApplicationSetupType (300a,0232) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setApplicationSetupType(const OFString &value, const OFBool check = OFTrue); + + /** set TemplateName (300a,0244) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTemplateName(const OFString &value, const OFBool check = OFTrue); + + /** set TemplateNumber (300a,0240) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTemplateNumber(const OFString &value, const OFBool check = OFTrue); + + /** set TemplateType (300a,0242) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTemplateType(const OFString &value, const OFBool check = OFTrue); + + /** set TotalReferenceAirKerma (300a,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTotalReferenceAirKerma(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ApplicationSetupManufacturer (300a,0238) vr=LO, vm=1, type=3 + DcmLongString ApplicationSetupManufacturer; + /// ApplicationSetupName (300a,0236) vr=LO, vm=1, type=3 + DcmLongString ApplicationSetupName; + /// ApplicationSetupNumber (300a,0234) vr=IS, vm=1, type=1 + DcmIntegerString ApplicationSetupNumber; + /// ApplicationSetupType (300a,0232) vr=CS, vm=1, type=1 + DcmCodeString ApplicationSetupType; + /// BrachyAccessoryDeviceSequence (300a,0260) vr=SQ, vm=1, type=3 + DRTBrachyAccessoryDeviceSequence BrachyAccessoryDeviceSequence; + /// ChannelSequence (300a,0280) vr=SQ, vm=1, type=1 + DRTChannelSequence ChannelSequence; + /// ReferencedReferenceImageSequence (300c,0042) vr=SQ, vm=1, type=3 + DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule ReferencedReferenceImageSequence; + /// TemplateName (300a,0244) vr=LO, vm=1, type=3 + DcmLongString TemplateName; + /// TemplateNumber (300a,0240) vr=IS, vm=1, type=3 + DcmIntegerString TemplateNumber; + /// TemplateType (300a,0242) vr=SH, vm=1, type=3 + DcmShortString TemplateType; + /// TotalReferenceAirKerma (300a,0250) vr=DS, vm=1, type=1 + DcmDecimalString TotalReferenceAirKerma; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTApplicationSetupSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTApplicationSetupSequence(const DRTApplicationSetupSequence ©); + + /** destructor + */ + virtual ~DRTApplicationSetupSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTApplicationSetupSequence &operator=(const DRTApplicationSetupSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbads.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbads.h new file mode 100644 index 00000000..50c29c48 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbads.h @@ -0,0 +1,444 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBrachyAccessoryDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBADS_H +#define DRTBADS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BrachyAccessoryDeviceSequence (300a,0260) + */ +class DCMTK_DCMRT_EXPORT DRTBrachyAccessoryDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BrachyAccessoryDeviceID (300a,0263) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceID(OFString &value, const signed long pos = 0) const; + + /** get BrachyAccessoryDeviceName (300a,0266) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceName(OFString &value, const signed long pos = 0) const; + + /** get BrachyAccessoryDeviceNominalThickness (300a,026a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceNominalThickness(OFString &value, const signed long pos = 0) const; + + /** get BrachyAccessoryDeviceNominalThickness (300a,026a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceNominalThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get BrachyAccessoryDeviceNominalTransmission (300a,026c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceNominalTransmission(OFString &value, const signed long pos = 0) const; + + /** get BrachyAccessoryDeviceNominalTransmission (300a,026c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceNominalTransmission(Float64 &value, const unsigned long pos = 0) const; + + /** get BrachyAccessoryDeviceNumber (300a,0262) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceNumber(OFString &value, const signed long pos = 0) const; + + /** get BrachyAccessoryDeviceNumber (300a,0262) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get BrachyAccessoryDeviceType (300a,0264) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyAccessoryDeviceType(OFString &value, const signed long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set BrachyAccessoryDeviceID (300a,0263) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyAccessoryDeviceID(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyAccessoryDeviceName (300a,0266) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyAccessoryDeviceName(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyAccessoryDeviceNominalThickness (300a,026a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyAccessoryDeviceNominalThickness(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyAccessoryDeviceNominalTransmission (300a,026c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyAccessoryDeviceNominalTransmission(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyAccessoryDeviceNumber (300a,0262) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyAccessoryDeviceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyAccessoryDeviceType (300a,0264) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyAccessoryDeviceType(const OFString &value, const OFBool check = OFTrue); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BrachyAccessoryDeviceID (300a,0263) vr=SH, vm=1, type=2 + DcmShortString BrachyAccessoryDeviceID; + /// BrachyAccessoryDeviceName (300a,0266) vr=LO, vm=1, type=3 + DcmLongString BrachyAccessoryDeviceName; + /// BrachyAccessoryDeviceNominalThickness (300a,026a) vr=DS, vm=1, type=3 + DcmDecimalString BrachyAccessoryDeviceNominalThickness; + /// BrachyAccessoryDeviceNominalTransmission (300a,026c) vr=DS, vm=1, type=3 + DcmDecimalString BrachyAccessoryDeviceNominalTransmission; + /// BrachyAccessoryDeviceNumber (300a,0262) vr=IS, vm=1, type=2 + DcmIntegerString BrachyAccessoryDeviceNumber; + /// BrachyAccessoryDeviceType (300a,0264) vr=CS, vm=1, type=1 + DcmCodeString BrachyAccessoryDeviceType; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=3 + DcmShortString MaterialID; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=2 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBrachyAccessoryDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBrachyAccessoryDeviceSequence(const DRTBrachyAccessoryDeviceSequence ©); + + /** destructor + */ + virtual ~DRTBrachyAccessoryDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBrachyAccessoryDeviceSequence &operator=(const DRTBrachyAccessoryDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbas.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbas.h new file mode 100644 index 00000000..d94f73f9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbas.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTContrastBolusAgentSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBAS_H +#define DRTBAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ContrastBolusAgentSequence (0018,0012) + */ +class DCMTK_DCMRT_EXPORT DRTContrastBolusAgentSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTContrastBolusAgentSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTContrastBolusAgentSequence(const DRTContrastBolusAgentSequence ©); + + /** destructor + */ + virtual ~DRTContrastBolusAgentSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTContrastBolusAgentSequence &operator=(const DRTContrastBolusAgentSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbcps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbcps.h new file mode 100644 index 00000000..5c2c0014 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbcps.h @@ -0,0 +1,419 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBrachyControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBCPS_H +#define DRTBCPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbrdrs.h" // for BrachyReferencedDoseReferenceSequence + + +/** Interface class for BrachyControlPointSequence (300a,02d0) + */ +class DCMTK_DCMRT_EXPORT DRTBrachyControlPointSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ControlPoint3DPosition (300a,02d4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPoint3DPosition(OFString &value, const signed long pos = 0) const; + + /** get ControlPoint3DPosition (300a,02d4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPoint3DPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get ControlPoint3DPosition (300a,02d4) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPoint3DPosition(OFVector &value) const; + + /** get ControlPointIndex (300a,0112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointIndex(OFString &value, const signed long pos = 0) const; + + /** get ControlPointIndex (300a,0112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointIndex(Sint32 &value, const unsigned long pos = 0) const; + + /** get ControlPointOrientation (300a,0412) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointOrientation(Float32 &value, const unsigned long pos = 0) const; + + /** get ControlPointRelativePosition (300a,02d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointRelativePosition(OFString &value, const signed long pos = 0) const; + + /** get ControlPointRelativePosition (300a,02d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointRelativePosition(Float64 &value, const unsigned long pos = 0) const; + + /** get CumulativeTimeWeight (300a,02d6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeTimeWeight(OFString &value, const signed long pos = 0) const; + + /** get CumulativeTimeWeight (300a,02d6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeTimeWeight(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BrachyReferencedDoseReferenceSequence (300c,0055) + * @return reference to sequence element + */ + DRTBrachyReferencedDoseReferenceSequence &getBrachyReferencedDoseReferenceSequence() + { return BrachyReferencedDoseReferenceSequence; } + + /** get BrachyReferencedDoseReferenceSequence (300c,0055) + * @return const reference to sequence element + */ + const DRTBrachyReferencedDoseReferenceSequence &getBrachyReferencedDoseReferenceSequence() const + { return BrachyReferencedDoseReferenceSequence; } + + // --- set DICOM attribute values --- + + /** set ControlPoint3DPosition (300a,02d4) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setControlPoint3DPosition(const OFString &value, const OFBool check = OFTrue); + + /** set ControlPointIndex (300a,0112) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setControlPointIndex(const OFString &value, const OFBool check = OFTrue); + + /** set ControlPointOrientation (300a,0412) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setControlPointOrientation(const Float32 value, const unsigned long pos = 0); + + /** set ControlPointRelativePosition (300a,02d2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setControlPointRelativePosition(const OFString &value, const OFBool check = OFTrue); + + /** set CumulativeTimeWeight (300a,02d6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeTimeWeight(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BrachyReferencedDoseReferenceSequence (300c,0055) vr=SQ, vm=1, type=3 + DRTBrachyReferencedDoseReferenceSequence BrachyReferencedDoseReferenceSequence; + /// ControlPoint3DPosition (300a,02d4) vr=DS, vm=3, type=3 + DcmDecimalString ControlPoint3DPosition; + /// ControlPointIndex (300a,0112) vr=IS, vm=1, type=1 + DcmIntegerString ControlPointIndex; + /// ControlPointOrientation (300a,0412) vr=FL, vm=3, type=3 + DcmFloatingPointSingle ControlPointOrientation; + /// ControlPointRelativePosition (300a,02d2) vr=DS, vm=1, type=1 + DcmDecimalString ControlPointRelativePosition; + /// CumulativeTimeWeight (300a,02d6) vr=DS, vm=1, type=2 + DcmDecimalString CumulativeTimeWeight; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBrachyControlPointSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBrachyControlPointSequence(const DRTBrachyControlPointSequence ©); + + /** destructor + */ + virtual ~DRTBrachyControlPointSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBrachyControlPointSequence &operator=(const DRTBrachyControlPointSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbl2.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbl2.h new file mode 100644 index 00000000..33379436 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbl2.h @@ -0,0 +1,560 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBlockSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBL2_H +#define DRTBL2_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BlockSequence (300a,00f4) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTBlockSequenceInRTBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(OFString &value, const signed long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(Float64 &value, const unsigned long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(OFVector &value) const; + + /** get BlockDivergence (300a,00fa) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockDivergence(OFString &value, const signed long pos = 0) const; + + /** get BlockMountingPosition (300a,00fb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockMountingPosition(OFString &value, const signed long pos = 0) const; + + /** get BlockName (300a,00fe) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockName(OFString &value, const signed long pos = 0) const; + + /** get BlockNumber (300a,00fc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumber(OFString &value, const signed long pos = 0) const; + + /** get BlockNumber (300a,00fc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get BlockNumberOfPoints (300a,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumberOfPoints(OFString &value, const signed long pos = 0) const; + + /** get BlockNumberOfPoints (300a,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumberOfPoints(Sint32 &value, const unsigned long pos = 0) const; + + /** get BlockThickness (300a,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockThickness(OFString &value, const signed long pos = 0) const; + + /** get BlockThickness (300a,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get BlockTransmission (300a,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockTransmission(OFString &value, const signed long pos = 0) const; + + /** get BlockTransmission (300a,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockTransmission(Float64 &value, const unsigned long pos = 0) const; + + /** get BlockTrayID (300a,00f5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockTrayID(OFString &value, const signed long pos = 0) const; + + /** get BlockType (300a,00f8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockType(OFString &value, const signed long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get SourceToBlockTrayDistance (300a,00f6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBlockTrayDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToBlockTrayDistance (300a,00f6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBlockTrayDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get TrayAccessoryCode (300a,0355) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTrayAccessoryCode(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BlockData (300a,0106) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-2n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockData(const OFString &value, const OFBool check = OFTrue); + + /** set BlockDivergence (300a,00fa) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockDivergence(const OFString &value, const OFBool check = OFTrue); + + /** set BlockMountingPosition (300a,00fb) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockMountingPosition(const OFString &value, const OFBool check = OFTrue); + + /** set BlockName (300a,00fe) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockName(const OFString &value, const OFBool check = OFTrue); + + /** set BlockNumber (300a,00fc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BlockNumberOfPoints (300a,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockNumberOfPoints(const OFString &value, const OFBool check = OFTrue); + + /** set BlockThickness (300a,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockThickness(const OFString &value, const OFBool check = OFTrue); + + /** set BlockTransmission (300a,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockTransmission(const OFString &value, const OFBool check = OFTrue); + + /** set BlockTrayID (300a,00f5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockTrayID(const OFString &value, const OFBool check = OFTrue); + + /** set BlockType (300a,00f8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockType(const OFString &value, const OFBool check = OFTrue); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToBlockTrayDistance (300a,00f6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToBlockTrayDistance(const OFString &value, const OFBool check = OFTrue); + + /** set TrayAccessoryCode (300a,0355) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTrayAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BlockData (300a,0106) vr=DS, vm=2-2n, type=2 + DcmDecimalString BlockData; + /// BlockDivergence (300a,00fa) vr=CS, vm=1, type=2 + DcmCodeString BlockDivergence; + /// BlockMountingPosition (300a,00fb) vr=CS, vm=1, type=3 + DcmCodeString BlockMountingPosition; + /// BlockName (300a,00fe) vr=LO, vm=1, type=3 + DcmLongString BlockName; + /// BlockNumber (300a,00fc) vr=IS, vm=1, type=1 + DcmIntegerString BlockNumber; + /// BlockNumberOfPoints (300a,0104) vr=IS, vm=1, type=2 + DcmIntegerString BlockNumberOfPoints; + /// BlockThickness (300a,0100) vr=DS, vm=1, type=2C + DcmDecimalString BlockThickness; + /// BlockTransmission (300a,0102) vr=DS, vm=1, type=2C + DcmDecimalString BlockTransmission; + /// BlockTrayID (300a,00f5) vr=SH, vm=1, type=3 + DcmShortString BlockTrayID; + /// BlockType (300a,00f8) vr=CS, vm=1, type=1 + DcmCodeString BlockType; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=2 + DcmShortString MaterialID; + /// SourceToBlockTrayDistance (300a,00f6) vr=DS, vm=1, type=2 + DcmDecimalString SourceToBlockTrayDistance; + /// TrayAccessoryCode (300a,0355) vr=LO, vm=1, type=3 + DcmLongString TrayAccessoryCode; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBlockSequenceInRTBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBlockSequenceInRTBeamsModule(const DRTBlockSequenceInRTBeamsModule ©); + + /** destructor + */ + virtual ~DRTBlockSequenceInRTBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBlockSequenceInRTBeamsModule &operator=(const DRTBlockSequenceInRTBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbl5.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbl5.h new file mode 100644 index 00000000..b47979eb --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbl5.h @@ -0,0 +1,537 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBlockSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBL5_H +#define DRTBL5_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BlockSequence (300a,00f4) in RTImageModule + */ +class DCMTK_DCMRT_EXPORT DRTBlockSequenceInRTImageModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(OFString &value, const signed long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(Float64 &value, const unsigned long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(OFVector &value) const; + + /** get BlockDivergence (300a,00fa) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockDivergence(OFString &value, const signed long pos = 0) const; + + /** get BlockMountingPosition (300a,00fb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockMountingPosition(OFString &value, const signed long pos = 0) const; + + /** get BlockName (300a,00fe) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockName(OFString &value, const signed long pos = 0) const; + + /** get BlockNumber (300a,00fc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumber(OFString &value, const signed long pos = 0) const; + + /** get BlockNumber (300a,00fc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get BlockNumberOfPoints (300a,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumberOfPoints(OFString &value, const signed long pos = 0) const; + + /** get BlockNumberOfPoints (300a,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumberOfPoints(Sint32 &value, const unsigned long pos = 0) const; + + /** get BlockThickness (300a,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockThickness(OFString &value, const signed long pos = 0) const; + + /** get BlockThickness (300a,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get BlockTrayID (300a,00f5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockTrayID(OFString &value, const signed long pos = 0) const; + + /** get BlockType (300a,00f8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockType(OFString &value, const signed long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get SourceToBlockTrayDistance (300a,00f6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBlockTrayDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToBlockTrayDistance (300a,00f6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBlockTrayDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get TrayAccessoryCode (300a,0355) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTrayAccessoryCode(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BlockData (300a,0106) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-2n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockData(const OFString &value, const OFBool check = OFTrue); + + /** set BlockDivergence (300a,00fa) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockDivergence(const OFString &value, const OFBool check = OFTrue); + + /** set BlockMountingPosition (300a,00fb) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockMountingPosition(const OFString &value, const OFBool check = OFTrue); + + /** set BlockName (300a,00fe) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockName(const OFString &value, const OFBool check = OFTrue); + + /** set BlockNumber (300a,00fc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BlockNumberOfPoints (300a,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockNumberOfPoints(const OFString &value, const OFBool check = OFTrue); + + /** set BlockThickness (300a,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockThickness(const OFString &value, const OFBool check = OFTrue); + + /** set BlockTrayID (300a,00f5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockTrayID(const OFString &value, const OFBool check = OFTrue); + + /** set BlockType (300a,00f8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockType(const OFString &value, const OFBool check = OFTrue); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToBlockTrayDistance (300a,00f6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToBlockTrayDistance(const OFString &value, const OFBool check = OFTrue); + + /** set TrayAccessoryCode (300a,0355) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTrayAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BlockData (300a,0106) vr=DS, vm=2-2n, type=2 + DcmDecimalString BlockData; + /// BlockDivergence (300a,00fa) vr=CS, vm=1, type=2 + DcmCodeString BlockDivergence; + /// BlockMountingPosition (300a,00fb) vr=CS, vm=1, type=3 + DcmCodeString BlockMountingPosition; + /// BlockName (300a,00fe) vr=LO, vm=1, type=3 + DcmLongString BlockName; + /// BlockNumber (300a,00fc) vr=IS, vm=1, type=1 + DcmIntegerString BlockNumber; + /// BlockNumberOfPoints (300a,0104) vr=IS, vm=1, type=2 + DcmIntegerString BlockNumberOfPoints; + /// BlockThickness (300a,0100) vr=DS, vm=1, type=3 + DcmDecimalString BlockThickness; + /// BlockTrayID (300a,00f5) vr=SH, vm=1, type=3 + DcmShortString BlockTrayID; + /// BlockType (300a,00f8) vr=CS, vm=1, type=1 + DcmCodeString BlockType; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=2 + DcmShortString MaterialID; + /// SourceToBlockTrayDistance (300a,00f6) vr=DS, vm=1, type=2 + DcmDecimalString SourceToBlockTrayDistance; + /// TrayAccessoryCode (300a,0355) vr=LO, vm=1, type=3 + DcmLongString TrayAccessoryCode; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBlockSequenceInRTImageModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBlockSequenceInRTImageModule(const DRTBlockSequenceInRTImageModule ©); + + /** destructor + */ + virtual ~DRTBlockSequenceInRTImageModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBlockSequenceInRTImageModule &operator=(const DRTBlockSequenceInRTImageModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbldls.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbldls.h new file mode 100644 index 00000000..af23c7f0 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbldls.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamLimitingDeviceLeafPairsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBLDLS_H +#define DRTBLDLS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BeamLimitingDeviceLeafPairsSequence (3008,00a0) + */ +class DCMTK_DCMRT_EXPORT DRTBeamLimitingDeviceLeafPairsSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(OFString &value, const signed long pos = 0) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos = 0) const; + + /** get RTBeamLimitingDeviceType (300a,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTBeamLimitingDeviceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set NumberOfLeafJawPairs (300a,00bc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfLeafJawPairs(const OFString &value, const OFBool check = OFTrue); + + /** set RTBeamLimitingDeviceType (300a,00b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTBeamLimitingDeviceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// NumberOfLeafJawPairs (300a,00bc) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfLeafJawPairs; + /// RTBeamLimitingDeviceType (300a,00b8) vr=CS, vm=1, type=1 + DcmCodeString RTBeamLimitingDeviceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamLimitingDeviceLeafPairsSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamLimitingDeviceLeafPairsSequence(const DRTBeamLimitingDeviceLeafPairsSequence ©); + + /** destructor + */ + virtual ~DRTBeamLimitingDeviceLeafPairsSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamLimitingDeviceLeafPairsSequence &operator=(const DRTBeamLimitingDeviceLeafPairsSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbldps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbldps.h new file mode 100644 index 00000000..eba370be --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbldps.h @@ -0,0 +1,333 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamLimitingDevicePositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBLDPS_H +#define DRTBLDPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BeamLimitingDevicePositionSequence (300a,011a) + */ +class DCMTK_DCMRT_EXPORT DRTBeamLimitingDevicePositionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(OFString &value, const signed long pos = 0) const; + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(Float64 &value, const unsigned long pos = 0) const; + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(OFVector &value) const; + + /** get RTBeamLimitingDeviceType (300a,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTBeamLimitingDeviceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LeafJawPositions (300a,011c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-2n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLeafJawPositions(const OFString &value, const OFBool check = OFTrue); + + /** set RTBeamLimitingDeviceType (300a,00b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTBeamLimitingDeviceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LeafJawPositions (300a,011c) vr=DS, vm=2-2n, type=1 + DcmDecimalString LeafJawPositions; + /// RTBeamLimitingDeviceType (300a,00b8) vr=CS, vm=1, type=1 + DcmCodeString RTBeamLimitingDeviceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamLimitingDevicePositionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamLimitingDevicePositionSequence(const DRTBeamLimitingDevicePositionSequence ©); + + /** destructor + */ + virtual ~DRTBeamLimitingDevicePositionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamLimitingDevicePositionSequence &operator=(const DRTBeamLimitingDevicePositionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtblds1.h b/dcmrt/include/dcmtk/dcmrt/seq/drtblds1.h new file mode 100644 index 00000000..17fc23e4 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtblds1.h @@ -0,0 +1,379 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamLimitingDeviceSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBLDS1_H +#define DRTBLDS1_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BeamLimitingDeviceSequence (300a,00b6) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTBeamLimitingDeviceSequenceInRTBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFString &value, const signed long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(Float64 &value, const unsigned long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFVector &value) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(OFString &value, const signed long pos = 0) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos = 0) const; + + /** get RTBeamLimitingDeviceType (300a,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTBeamLimitingDeviceType(OFString &value, const signed long pos = 0) const; + + /** get SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBeamLimitingDeviceDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBeamLimitingDeviceDistance(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LeafPositionBoundaries (300a,00be) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLeafPositionBoundaries(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfLeafJawPairs (300a,00bc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfLeafJawPairs(const OFString &value, const OFBool check = OFTrue); + + /** set RTBeamLimitingDeviceType (300a,00b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTBeamLimitingDeviceType(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToBeamLimitingDeviceDistance(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LeafPositionBoundaries (300a,00be) vr=DS, vm=3-n, type=2C + DcmDecimalString LeafPositionBoundaries; + /// NumberOfLeafJawPairs (300a,00bc) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfLeafJawPairs; + /// RTBeamLimitingDeviceType (300a,00b8) vr=CS, vm=1, type=1 + DcmCodeString RTBeamLimitingDeviceType; + /// SourceToBeamLimitingDeviceDistance (300a,00ba) vr=DS, vm=1, type=3 + DcmDecimalString SourceToBeamLimitingDeviceDistance; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamLimitingDeviceSequenceInRTBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamLimitingDeviceSequenceInRTBeamsModule(const DRTBeamLimitingDeviceSequenceInRTBeamsModule ©); + + /** destructor + */ + virtual ~DRTBeamLimitingDeviceSequenceInRTBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamLimitingDeviceSequenceInRTBeamsModule &operator=(const DRTBeamLimitingDeviceSequenceInRTBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtblds5.h b/dcmrt/include/dcmtk/dcmrt/seq/drtblds5.h new file mode 100644 index 00000000..99b0ed98 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtblds5.h @@ -0,0 +1,408 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamLimitingDeviceSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBLDS5_H +#define DRTBLDS5_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BeamLimitingDeviceSequence (300a,00b6) in RTImageModule + */ +class DCMTK_DCMRT_EXPORT DRTBeamLimitingDeviceSequenceInRTImageModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(OFString &value, const signed long pos = 0) const; + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(Float64 &value, const unsigned long pos = 0) const; + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(OFVector &value) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFString &value, const signed long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(Float64 &value, const unsigned long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFVector &value) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(OFString &value, const signed long pos = 0) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos = 0) const; + + /** get RTBeamLimitingDeviceType (300a,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTBeamLimitingDeviceType(OFString &value, const signed long pos = 0) const; + + /** get SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBeamLimitingDeviceDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBeamLimitingDeviceDistance(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LeafJawPositions (300a,011c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-2n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLeafJawPositions(const OFString &value, const OFBool check = OFTrue); + + /** set LeafPositionBoundaries (300a,00be) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLeafPositionBoundaries(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfLeafJawPairs (300a,00bc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfLeafJawPairs(const OFString &value, const OFBool check = OFTrue); + + /** set RTBeamLimitingDeviceType (300a,00b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTBeamLimitingDeviceType(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToBeamLimitingDeviceDistance(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LeafJawPositions (300a,011c) vr=DS, vm=2-2n, type=1 + DcmDecimalString LeafJawPositions; + /// LeafPositionBoundaries (300a,00be) vr=DS, vm=3-n, type=2C + DcmDecimalString LeafPositionBoundaries; + /// NumberOfLeafJawPairs (300a,00bc) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfLeafJawPairs; + /// RTBeamLimitingDeviceType (300a,00b8) vr=CS, vm=1, type=1 + DcmCodeString RTBeamLimitingDeviceType; + /// SourceToBeamLimitingDeviceDistance (300a,00ba) vr=DS, vm=1, type=3 + DcmDecimalString SourceToBeamLimitingDeviceDistance; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamLimitingDeviceSequenceInRTImageModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamLimitingDeviceSequenceInRTImageModule(const DRTBeamLimitingDeviceSequenceInRTImageModule ©); + + /** destructor + */ + virtual ~DRTBeamLimitingDeviceSequenceInRTImageModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamLimitingDeviceSequenceInRTImageModule &operator=(const DRTBeamLimitingDeviceSequenceInRTImageModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtblds6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtblds6.h new file mode 100644 index 00000000..fe047fc6 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtblds6.h @@ -0,0 +1,408 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamLimitingDeviceSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBLDS6_H +#define DRTBLDS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BeamLimitingDeviceSequence (300a,00b6) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTBeamLimitingDeviceSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(OFString &value, const signed long pos = 0) const; + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(Float64 &value, const unsigned long pos = 0) const; + + /** get LeafJawPositions (300a,011c) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafJawPositions(OFVector &value) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFString &value, const signed long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(Float64 &value, const unsigned long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFVector &value) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(OFString &value, const signed long pos = 0) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos = 0) const; + + /** get RTBeamLimitingDeviceType (300a,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTBeamLimitingDeviceType(OFString &value, const signed long pos = 0) const; + + /** get SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBeamLimitingDeviceDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToBeamLimitingDeviceDistance(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LeafJawPositions (300a,011c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-2n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLeafJawPositions(const OFString &value, const OFBool check = OFTrue); + + /** set LeafPositionBoundaries (300a,00be) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLeafPositionBoundaries(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfLeafJawPairs (300a,00bc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfLeafJawPairs(const OFString &value, const OFBool check = OFTrue); + + /** set RTBeamLimitingDeviceType (300a,00b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTBeamLimitingDeviceType(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToBeamLimitingDeviceDistance (300a,00ba) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToBeamLimitingDeviceDistance(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LeafJawPositions (300a,011c) vr=DS, vm=2-2n, type=1 + DcmDecimalString LeafJawPositions; + /// LeafPositionBoundaries (300a,00be) vr=DS, vm=3-n, type=2C + DcmDecimalString LeafPositionBoundaries; + /// NumberOfLeafJawPairs (300a,00bc) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfLeafJawPairs; + /// RTBeamLimitingDeviceType (300a,00b8) vr=CS, vm=1, type=1 + DcmCodeString RTBeamLimitingDeviceType; + /// SourceToBeamLimitingDeviceDistance (300a,00ba) vr=DS, vm=1, type=3 + DcmDecimalString SourceToBeamLimitingDeviceDistance; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamLimitingDeviceSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamLimitingDeviceSequenceInRTIonBeamsModule(const DRTBeamLimitingDeviceSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTBeamLimitingDeviceSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamLimitingDeviceSequenceInRTIonBeamsModule &operator=(const DRTBeamLimitingDeviceSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbldts.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbldts.h new file mode 100644 index 00000000..3478e578 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbldts.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamLimitingDeviceToleranceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBLDTS_H +#define DRTBLDTS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BeamLimitingDeviceToleranceSequence (300a,0048) + */ +class DCMTK_DCMRT_EXPORT DRTBeamLimitingDeviceToleranceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamLimitingDevicePositionTolerance (300a,004a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDevicePositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDevicePositionTolerance (300a,004a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDevicePositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get RTBeamLimitingDeviceType (300a,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTBeamLimitingDeviceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set BeamLimitingDevicePositionTolerance (300a,004a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDevicePositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set RTBeamLimitingDeviceType (300a,00b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTBeamLimitingDeviceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamLimitingDevicePositionTolerance (300a,004a) vr=DS, vm=1, type=1 + DcmDecimalString BeamLimitingDevicePositionTolerance; + /// RTBeamLimitingDeviceType (300a,00b8) vr=CS, vm=1, type=1 + DcmCodeString RTBeamLimitingDeviceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamLimitingDeviceToleranceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamLimitingDeviceToleranceSequence(const DRTBeamLimitingDeviceToleranceSequence ©); + + /** destructor + */ + virtual ~DRTBeamLimitingDeviceToleranceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamLimitingDeviceToleranceSequence &operator=(const DRTBeamLimitingDeviceToleranceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbrcss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbrcss.h new file mode 100644 index 00000000..ce8a4d6d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbrcss.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBreedRegistryCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBRCSS_H +#define DRTBRCSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for BreedRegistryCodeSequence (0010,2296) + */ +class DCMTK_DCMRT_EXPORT DRTBreedRegistryCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBreedRegistryCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBreedRegistryCodeSequence(const DRTBreedRegistryCodeSequence ©); + + /** destructor + */ + virtual ~DRTBreedRegistryCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBreedRegistryCodeSequence &operator=(const DRTBreedRegistryCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbrdrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbrdrs.h new file mode 100644 index 00000000..d1227143 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbrdrs.h @@ -0,0 +1,334 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBrachyReferencedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBRDRS_H +#define DRTBRDRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BrachyReferencedDoseReferenceSequence (300c,0055) + */ +class DCMTK_DCMRT_EXPORT DRTBrachyReferencedDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CumulativeDoseReferenceCoefficient (300a,010c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseReferenceCoefficient(OFString &value, const signed long pos = 0) const; + + /** get CumulativeDoseReferenceCoefficient (300a,010c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseReferenceCoefficient(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CumulativeDoseReferenceCoefficient (300a,010c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeDoseReferenceCoefficient(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CumulativeDoseReferenceCoefficient (300a,010c) vr=DS, vm=1, type=1 + DcmDecimalString CumulativeDoseReferenceCoefficient; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBrachyReferencedDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBrachyReferencedDoseReferenceSequence(const DRTBrachyReferencedDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTBrachyReferencedDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBrachyReferencedDoseReferenceSequence &operator=(const DRTBrachyReferencedDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbrs.h new file mode 100644 index 00000000..021e4bc7 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbrs.h @@ -0,0 +1,321 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBreedRegistrationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBRS_H +#define DRTBRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbrcss.h" // for BreedRegistryCodeSequence + + +/** Interface class for BreedRegistrationSequence (0010,2294) + */ +class DCMTK_DCMRT_EXPORT DRTBreedRegistrationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BreedRegistrationNumber (0010,2295) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBreedRegistrationNumber(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BreedRegistryCodeSequence (0010,2296) + * @return reference to sequence element + */ + DRTBreedRegistryCodeSequence &getBreedRegistryCodeSequence() + { return BreedRegistryCodeSequence; } + + /** get BreedRegistryCodeSequence (0010,2296) + * @return const reference to sequence element + */ + const DRTBreedRegistryCodeSequence &getBreedRegistryCodeSequence() const + { return BreedRegistryCodeSequence; } + + // --- set DICOM attribute values --- + + /** set BreedRegistrationNumber (0010,2295) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBreedRegistrationNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BreedRegistrationNumber (0010,2295) vr=LO, vm=1, type=1 + DcmLongString BreedRegistrationNumber; + /// BreedRegistryCodeSequence (0010,2296) vr=SQ, vm=1, type=1 + DRTBreedRegistryCodeSequence BreedRegistryCodeSequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBreedRegistrationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBreedRegistrationSequence(const DRTBreedRegistrationSequence ©); + + /** destructor + */ + virtual ~DRTBreedRegistrationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBreedRegistrationSequence &operator=(const DRTBreedRegistrationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbs.h new file mode 100644 index 00000000..be213429 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbs.h @@ -0,0 +1,985 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBS_H +#define DRTBS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtas1.h" // for ApplicatorSequence +#include "dcmtk/dcmrt/seq/drtblds1.h" // for BeamLimitingDeviceSequence +#include "dcmtk/dcmrt/seq/drtbl2.h" // for BlockSequence +#include "dcmtk/dcmrt/seq/drtcos.h" // for CompensatorSequence +#include "dcmtk/dcmrt/seq/drtcps.h" // for ControlPointSequence +#include "dcmtk/dcmrt/seq/drtgas.h" // for GeneralAccessorySequence +#include "dcmtk/dcmrt/seq/drtpvis.h" // for PlannedVerificationImageSequence +#include "dcmtk/dcmrt/seq/drtpfms.h" // for PrimaryFluenceModeSequence +#include "dcmtk/dcmrt/seq/drtrbos1.h" // for ReferencedBolusSequence +#include "dcmtk/dcmrt/seq/drtrdrs1.h" // for ReferencedDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtrds.h" // for ReferencedDoseSequence +#include "dcmtk/dcmrt/seq/drtrris1.h" // for ReferencedReferenceImageSequence +#include "dcmtk/dcmrt/seq/drtws.h" // for WedgeSequence + + +/** Interface class for BeamSequence (300a,00b0) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTBeamSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamDescription (300a,00c3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDescription(OFString &value, const signed long pos = 0) const; + + /** get BeamName (300a,00c2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamName(OFString &value, const signed long pos = 0) const; + + /** get BeamNumber (300a,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamNumber(OFString &value, const signed long pos = 0) const; + + /** get BeamNumber (300a,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get BeamType (300a,00c4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamType(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get FinalCumulativeMetersetWeight (300a,010e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFinalCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get FinalCumulativeMetersetWeight (300a,010e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFinalCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get HighDoseTechniqueType (300a,00c7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHighDoseTechniqueType(OFString &value, const signed long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfBoli (300a,00ed) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBoli(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBoli (300a,00ed) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBoli(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfCompensators (300a,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfCompensators(OFString &value, const signed long pos = 0) const; + + /** get NumberOfCompensators (300a,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfCompensators(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(OFString &value, const signed long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfWedges (300a,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfWedges(OFString &value, const signed long pos = 0) const; + + /** get NumberOfWedges (300a,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfWedges(Sint32 &value, const unsigned long pos = 0) const; + + /** get PrimaryDosimeterUnit (300a,00b3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrimaryDosimeterUnit(OFString &value, const signed long pos = 0) const; + + /** get RadiationType (300a,00c6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationType(OFString &value, const signed long pos = 0) const; + + /** get ReferencedPatientSetupNumber (300c,006a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedPatientSetupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedPatientSetupNumber (300c,006a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedPatientSetupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedToleranceTableNumber (300c,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedToleranceTableNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedToleranceTableNumber (300c,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedToleranceTableNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SourceAxisDistance (300a,00b4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceAxisDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceAxisDistance (300a,00b4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceAxisDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get TotalBlockTrayFactor (300a,00f2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalBlockTrayFactor(OFString &value, const signed long pos = 0) const; + + /** get TotalBlockTrayFactor (300a,00f2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalBlockTrayFactor(Float64 &value, const unsigned long pos = 0) const; + + /** get TotalCompensatorTrayFactor (300a,00e2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalCompensatorTrayFactor(OFString &value, const signed long pos = 0) const; + + /** get TotalCompensatorTrayFactor (300a,00e2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalCompensatorTrayFactor(Float64 &value, const unsigned long pos = 0) const; + + /** get TreatmentDeliveryType (300a,00ce) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentDeliveryType(OFString &value, const signed long pos = 0) const; + + /** get TreatmentMachineName (300a,00b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentMachineName(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ApplicatorSequence (300a,0107) + * @return reference to sequence element + */ + DRTApplicatorSequenceInRTBeamsModule &getApplicatorSequence() + { return ApplicatorSequence; } + + /** get ApplicatorSequence (300a,0107) + * @return const reference to sequence element + */ + const DRTApplicatorSequenceInRTBeamsModule &getApplicatorSequence() const + { return ApplicatorSequence; } + + /** get BeamLimitingDeviceSequence (300a,00b6) + * @return reference to sequence element + */ + DRTBeamLimitingDeviceSequenceInRTBeamsModule &getBeamLimitingDeviceSequence() + { return BeamLimitingDeviceSequence; } + + /** get BeamLimitingDeviceSequence (300a,00b6) + * @return const reference to sequence element + */ + const DRTBeamLimitingDeviceSequenceInRTBeamsModule &getBeamLimitingDeviceSequence() const + { return BeamLimitingDeviceSequence; } + + /** get BlockSequence (300a,00f4) + * @return reference to sequence element + */ + DRTBlockSequenceInRTBeamsModule &getBlockSequence() + { return BlockSequence; } + + /** get BlockSequence (300a,00f4) + * @return const reference to sequence element + */ + const DRTBlockSequenceInRTBeamsModule &getBlockSequence() const + { return BlockSequence; } + + /** get CompensatorSequence (300a,00e3) + * @return reference to sequence element + */ + DRTCompensatorSequence &getCompensatorSequence() + { return CompensatorSequence; } + + /** get CompensatorSequence (300a,00e3) + * @return const reference to sequence element + */ + const DRTCompensatorSequence &getCompensatorSequence() const + { return CompensatorSequence; } + + /** get ControlPointSequence (300a,0111) + * @return reference to sequence element + */ + DRTControlPointSequence &getControlPointSequence() + { return ControlPointSequence; } + + /** get ControlPointSequence (300a,0111) + * @return const reference to sequence element + */ + const DRTControlPointSequence &getControlPointSequence() const + { return ControlPointSequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return reference to sequence element + */ + DRTGeneralAccessorySequence &getGeneralAccessorySequence() + { return GeneralAccessorySequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return const reference to sequence element + */ + const DRTGeneralAccessorySequence &getGeneralAccessorySequence() const + { return GeneralAccessorySequence; } + + /** get PlannedVerificationImageSequence (300a,00ca) + * @return reference to sequence element + */ + DRTPlannedVerificationImageSequence &getPlannedVerificationImageSequence() + { return PlannedVerificationImageSequence; } + + /** get PlannedVerificationImageSequence (300a,00ca) + * @return const reference to sequence element + */ + const DRTPlannedVerificationImageSequence &getPlannedVerificationImageSequence() const + { return PlannedVerificationImageSequence; } + + /** get PrimaryFluenceModeSequence (3002,0050) + * @return reference to sequence element + */ + DRTPrimaryFluenceModeSequence &getPrimaryFluenceModeSequence() + { return PrimaryFluenceModeSequence; } + + /** get PrimaryFluenceModeSequence (3002,0050) + * @return const reference to sequence element + */ + const DRTPrimaryFluenceModeSequence &getPrimaryFluenceModeSequence() const + { return PrimaryFluenceModeSequence; } + + /** get ReferencedBolusSequence (300c,00b0) + * @return reference to sequence element + */ + DRTReferencedBolusSequenceInRTBeamsModule &getReferencedBolusSequence() + { return ReferencedBolusSequence; } + + /** get ReferencedBolusSequence (300c,00b0) + * @return const reference to sequence element + */ + const DRTReferencedBolusSequenceInRTBeamsModule &getReferencedBolusSequence() const + { return ReferencedBolusSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return reference to sequence element + */ + DRTReferencedDoseReferenceSequenceInRTBeamsModule &getReferencedDoseReferenceSequence() + { return ReferencedDoseReferenceSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return const reference to sequence element + */ + const DRTReferencedDoseReferenceSequenceInRTBeamsModule &getReferencedDoseReferenceSequence() const + { return ReferencedDoseReferenceSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return reference to sequence element + */ + DRTReferencedDoseSequence &getReferencedDoseSequence() + { return ReferencedDoseSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return const reference to sequence element + */ + const DRTReferencedDoseSequence &getReferencedDoseSequence() const + { return ReferencedDoseSequence; } + + /** get ReferencedReferenceImageSequence (300c,0042) + * @return reference to sequence element + */ + DRTReferencedReferenceImageSequenceInRTBeamsModule &getReferencedReferenceImageSequence() + { return ReferencedReferenceImageSequence; } + + /** get ReferencedReferenceImageSequence (300c,0042) + * @return const reference to sequence element + */ + const DRTReferencedReferenceImageSequenceInRTBeamsModule &getReferencedReferenceImageSequence() const + { return ReferencedReferenceImageSequence; } + + /** get WedgeSequence (300a,00d1) + * @return reference to sequence element + */ + DRTWedgeSequence &getWedgeSequence() + { return WedgeSequence; } + + /** get WedgeSequence (300a,00d1) + * @return const reference to sequence element + */ + const DRTWedgeSequence &getWedgeSequence() const + { return WedgeSequence; } + + // --- set DICOM attribute values --- + + /** set BeamDescription (300a,00c3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDescription(const OFString &value, const OFBool check = OFTrue); + + /** set BeamName (300a,00c2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamName(const OFString &value, const OFBool check = OFTrue); + + /** set BeamNumber (300a,00c0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BeamType (300a,00c4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamType(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set FinalCumulativeMetersetWeight (300a,010e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFinalCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set HighDoseTechniqueType (300a,00c7) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHighDoseTechniqueType(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBlocks (300a,00f0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBlocks(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBoli (300a,00ed) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBoli(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfCompensators (300a,00e0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfCompensators(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfControlPoints (300a,0110) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfControlPoints(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfWedges (300a,00d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfWedges(const OFString &value, const OFBool check = OFTrue); + + /** set PrimaryDosimeterUnit (300a,00b3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrimaryDosimeterUnit(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationType (300a,00c6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationType(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedPatientSetupNumber (300c,006a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedPatientSetupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedToleranceTableNumber (300c,00a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedToleranceTableNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SourceAxisDistance (300a,00b4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceAxisDistance(const OFString &value, const OFBool check = OFTrue); + + /** set TotalBlockTrayFactor (300a,00f2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTotalBlockTrayFactor(const OFString &value, const OFBool check = OFTrue); + + /** set TotalCompensatorTrayFactor (300a,00e2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTotalCompensatorTrayFactor(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentDeliveryType (300a,00ce) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentDeliveryType(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentMachineName (300a,00b2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentMachineName(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ApplicatorSequence (300a,0107) vr=SQ, vm=1, type=3 + DRTApplicatorSequenceInRTBeamsModule ApplicatorSequence; + /// BeamDescription (300a,00c3) vr=ST, vm=1, type=3 + DcmShortText BeamDescription; + /// BeamLimitingDeviceSequence (300a,00b6) vr=SQ, vm=1, type=1 + DRTBeamLimitingDeviceSequenceInRTBeamsModule BeamLimitingDeviceSequence; + /// BeamName (300a,00c2) vr=LO, vm=1, type=3 + DcmLongString BeamName; + /// BeamNumber (300a,00c0) vr=IS, vm=1, type=1 + DcmIntegerString BeamNumber; + /// BeamType (300a,00c4) vr=CS, vm=1, type=1 + DcmCodeString BeamType; + /// BlockSequence (300a,00f4) vr=SQ, vm=1, type=1C + DRTBlockSequenceInRTBeamsModule BlockSequence; + /// CompensatorSequence (300a,00e3) vr=SQ, vm=1, type=1C + DRTCompensatorSequence CompensatorSequence; + /// ControlPointSequence (300a,0111) vr=SQ, vm=1, type=1 + DRTControlPointSequence ControlPointSequence; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// FinalCumulativeMetersetWeight (300a,010e) vr=DS, vm=1, type=1C + DcmDecimalString FinalCumulativeMetersetWeight; + /// GeneralAccessorySequence (300a,0420) vr=SQ, vm=1, type=3 + DRTGeneralAccessorySequence GeneralAccessorySequence; + /// HighDoseTechniqueType (300a,00c7) vr=CS, vm=1, type=1C + DcmCodeString HighDoseTechniqueType; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// Manufacturer (0008,0070) vr=LO, vm=1, type=3 + DcmLongString Manufacturer; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// NumberOfBlocks (300a,00f0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBlocks; + /// NumberOfBoli (300a,00ed) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBoli; + /// NumberOfCompensators (300a,00e0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfCompensators; + /// NumberOfControlPoints (300a,0110) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfControlPoints; + /// NumberOfWedges (300a,00d0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfWedges; + /// PlannedVerificationImageSequence (300a,00ca) vr=SQ, vm=1, type=3 + DRTPlannedVerificationImageSequence PlannedVerificationImageSequence; + /// PrimaryDosimeterUnit (300a,00b3) vr=CS, vm=1, type=3 + DcmCodeString PrimaryDosimeterUnit; + /// PrimaryFluenceModeSequence (3002,0050) vr=SQ, vm=1, type=3 + DRTPrimaryFluenceModeSequence PrimaryFluenceModeSequence; + /// RadiationType (300a,00c6) vr=CS, vm=1, type=2 + DcmCodeString RadiationType; + /// ReferencedBolusSequence (300c,00b0) vr=SQ, vm=1, type=1C + DRTReferencedBolusSequenceInRTBeamsModule ReferencedBolusSequence; + /// ReferencedDoseReferenceSequence (300c,0050) vr=SQ, vm=1, type=3 + DRTReferencedDoseReferenceSequenceInRTBeamsModule ReferencedDoseReferenceSequence; + /// ReferencedDoseSequence (300c,0080) vr=SQ, vm=1, type=3 + DRTReferencedDoseSequence ReferencedDoseSequence; + /// ReferencedPatientSetupNumber (300c,006a) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedPatientSetupNumber; + /// ReferencedReferenceImageSequence (300c,0042) vr=SQ, vm=1, type=3 + DRTReferencedReferenceImageSequenceInRTBeamsModule ReferencedReferenceImageSequence; + /// ReferencedToleranceTableNumber (300c,00a0) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedToleranceTableNumber; + /// SourceAxisDistance (300a,00b4) vr=DS, vm=1, type=3 + DcmDecimalString SourceAxisDistance; + /// TotalBlockTrayFactor (300a,00f2) vr=DS, vm=1, type=3 + DcmDecimalString TotalBlockTrayFactor; + /// TotalCompensatorTrayFactor (300a,00e2) vr=DS, vm=1, type=3 + DcmDecimalString TotalCompensatorTrayFactor; + /// TreatmentDeliveryType (300a,00ce) vr=CS, vm=1, type=3 + DcmCodeString TreatmentDeliveryType; + /// TreatmentMachineName (300a,00b2) vr=SH, vm=1, type=2 + DcmShortString TreatmentMachineName; + /// WedgeSequence (300a,00d1) vr=SQ, vm=1, type=1C + DRTWedgeSequence WedgeSequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamSequence(const DRTBeamSequence ©); + + /** destructor + */ + virtual ~DRTBeamSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamSequence &operator=(const DRTBeamSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbss.h new file mode 100644 index 00000000..c31576db --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbss.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBlockSlabSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBSS_H +#define DRTBSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BlockSlabSequence (300a,0441) + */ +class DCMTK_DCMRT_EXPORT DRTBlockSlabSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BlockSlabNumber (300a,0443) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockSlabNumber(Uint16 &value, const unsigned long pos = 0) const; + + /** get BlockSlabThickness (300a,0442) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockSlabThickness(OFString &value, const signed long pos = 0) const; + + /** get BlockSlabThickness (300a,0442) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockSlabThickness(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BlockSlabNumber (300a,0443) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockSlabNumber(const Uint16 value, const unsigned long pos = 0); + + /** set BlockSlabThickness (300a,0442) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockSlabThickness(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BlockSlabNumber (300a,0443) vr=US, vm=1, type=1 + DcmUnsignedShort BlockSlabNumber; + /// BlockSlabThickness (300a,0442) vr=DS, vm=1, type=3 + DcmDecimalString BlockSlabThickness; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBlockSlabSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBlockSlabSequence(const DRTBlockSlabSequence ©); + + /** destructor + */ + virtual ~DRTBlockSlabSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBlockSlabSequence &operator=(const DRTBlockSlabSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtbvcps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtbvcps.h new file mode 100644 index 00000000..eae819a9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtbvcps.h @@ -0,0 +1,382 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTBeamDoseVerificationControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTBVCPS_H +#define DRTBVCPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for BeamDoseVerificationControlPointSequence (300a,008c) + */ +class DCMTK_DCMRT_EXPORT DRTBeamDoseVerificationControlPointSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamDosePointDepth (300a,0088) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDosePointDepth(Float32 &value, const unsigned long pos = 0) const; + + /** get BeamDosePointEquivalentDepth (300a,0089) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDosePointEquivalentDepth(Float32 &value, const unsigned long pos = 0) const; + + /** get BeamDosePointSSD (300a,008a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDosePointSSD(Float32 &value, const unsigned long pos = 0) const; + + /** get CumulativeMetersetWeight (300a,0134) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get CumulativeMetersetWeight (300a,0134) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedControlPointIndex (300c,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedControlPointIndex(OFString &value, const signed long pos = 0) const; + + /** get ReferencedControlPointIndex (300c,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedControlPointIndex(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set BeamDosePointDepth (300a,0088) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDosePointDepth(const Float32 value, const unsigned long pos = 0); + + /** set BeamDosePointEquivalentDepth (300a,0089) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDosePointEquivalentDepth(const Float32 value, const unsigned long pos = 0); + + /** set BeamDosePointSSD (300a,008a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDosePointSSD(const Float32 value, const unsigned long pos = 0); + + /** set CumulativeMetersetWeight (300a,0134) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedControlPointIndex (300c,00f0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedControlPointIndex(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamDosePointDepth (300a,0088) vr=FL, vm=1, type=1C + DcmFloatingPointSingle BeamDosePointDepth; + /// BeamDosePointEquivalentDepth (300a,0089) vr=FL, vm=1, type=1C + DcmFloatingPointSingle BeamDosePointEquivalentDepth; + /// BeamDosePointSSD (300a,008a) vr=FL, vm=1, type=1C + DcmFloatingPointSingle BeamDosePointSSD; + /// CumulativeMetersetWeight (300a,0134) vr=DS, vm=1, type=1 + DcmDecimalString CumulativeMetersetWeight; + /// ReferencedControlPointIndex (300c,00f0) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedControlPointIndex; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTBeamDoseVerificationControlPointSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTBeamDoseVerificationControlPointSequence(const DRTBeamDoseVerificationControlPointSequence ©); + + /** destructor + */ + virtual ~DRTBeamDoseVerificationControlPointSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTBeamDoseVerificationControlPointSequence &operator=(const DRTBeamDoseVerificationControlPointSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcbars.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcbars.h new file mode 100644 index 00000000..6706c262 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcbars.h @@ -0,0 +1,560 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTContrastBolusAdministrationRouteSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCBARS_H +#define DRTCBARS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtads.h" // for AdditionalDrugSequence +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ContrastBolusAdministrationRouteSequence (0018,0014) + */ +class DCMTK_DCMRT_EXPORT DRTContrastBolusAdministrationRouteSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get AdditionalDrugSequence (0018,002a) + * @return reference to sequence element + */ + DRTAdditionalDrugSequence &getAdditionalDrugSequence() + { return AdditionalDrugSequence; } + + /** get AdditionalDrugSequence (0018,002a) + * @return const reference to sequence element + */ + const DRTAdditionalDrugSequence &getAdditionalDrugSequence() const + { return AdditionalDrugSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AdditionalDrugSequence (0018,002a) vr=SQ, vm=1, type=3 + DRTAdditionalDrugSequence AdditionalDrugSequence; + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTContrastBolusAdministrationRouteSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTContrastBolusAdministrationRouteSequence(const DRTContrastBolusAdministrationRouteSequence ©); + + /** destructor + */ + virtual ~DRTContrastBolusAdministrationRouteSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTContrastBolusAdministrationRouteSequence &operator=(const DRTContrastBolusAdministrationRouteSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtccs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtccs.h new file mode 100644 index 00000000..5d145655 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtccs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTConceptCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCCS_H +#define DRTCCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ConceptCodeSequence (0040,a168) + */ +class DCMTK_DCMRT_EXPORT DRTConceptCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTConceptCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTConceptCodeSequence(const DRTConceptCodeSequence ©); + + /** destructor + */ + virtual ~DRTConceptCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTConceptCodeSequence &operator=(const DRTConceptCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcctus.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcctus.h new file mode 100644 index 00000000..ea695b09 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcctus.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTConsentForClinicalTrialUseSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCCTUS_H +#define DRTCCTUS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ConsentForClinicalTrialUseSequence (0012,0083) + */ +class DCMTK_DCMRT_EXPORT DRTConsentForClinicalTrialUseSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ClinicalTrialProtocolID (0012,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getClinicalTrialProtocolID(OFString &value, const signed long pos = 0) const; + + /** get ConsentForDistributionFlag (0012,0085) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getConsentForDistributionFlag(OFString &value, const signed long pos = 0) const; + + /** get DistributionType (0012,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDistributionType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ClinicalTrialProtocolID (0012,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setClinicalTrialProtocolID(const OFString &value, const OFBool check = OFTrue); + + /** set ConsentForDistributionFlag (0012,0085) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setConsentForDistributionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set DistributionType (0012,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDistributionType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ClinicalTrialProtocolID (0012,0020) vr=LO, vm=1, type=1C + DcmLongString ClinicalTrialProtocolID; + /// ConsentForDistributionFlag (0012,0085) vr=CS, vm=1, type=1 + DcmCodeString ConsentForDistributionFlag; + /// DistributionType (0012,0084) vr=CS, vm=1, type=1C + DcmCodeString DistributionType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTConsentForClinicalTrialUseSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTConsentForClinicalTrialUseSequence(const DRTConsentForClinicalTrialUseSequence ©); + + /** destructor + */ + virtual ~DRTConsentForClinicalTrialUseSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTConsentForClinicalTrialUseSequence &operator=(const DRTConsentForClinicalTrialUseSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcdrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcdrs.h new file mode 100644 index 00000000..a066dd98 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcdrs.h @@ -0,0 +1,373 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTCalculatedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCDRS_H +#define DRTCDRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for CalculatedDoseReferenceSequence (3008,0070) + */ +class DCMTK_DCMRT_EXPORT DRTCalculatedDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CalculatedDoseReferenceDescription (3008,0074) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedDoseReferenceDescription(OFString &value, const signed long pos = 0) const; + + /** get CalculatedDoseReferenceDoseValue (3008,0076) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedDoseReferenceDoseValue(OFString &value, const signed long pos = 0) const; + + /** get CalculatedDoseReferenceDoseValue (3008,0076) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedDoseReferenceDoseValue(Float64 &value, const unsigned long pos = 0) const; + + /** get CalculatedDoseReferenceNumber (3008,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get CalculatedDoseReferenceNumber (3008,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CalculatedDoseReferenceDescription (3008,0074) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCalculatedDoseReferenceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set CalculatedDoseReferenceDoseValue (3008,0076) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCalculatedDoseReferenceDoseValue(const OFString &value, const OFBool check = OFTrue); + + /** set CalculatedDoseReferenceNumber (3008,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCalculatedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CalculatedDoseReferenceDescription (3008,0074) vr=ST, vm=1, type=3 + DcmShortText CalculatedDoseReferenceDescription; + /// CalculatedDoseReferenceDoseValue (3008,0076) vr=DS, vm=1, type=2 + DcmDecimalString CalculatedDoseReferenceDoseValue; + /// CalculatedDoseReferenceNumber (3008,0072) vr=IS, vm=1, type=1C + DcmIntegerString CalculatedDoseReferenceNumber; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTCalculatedDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTCalculatedDoseReferenceSequence(const DRTCalculatedDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTCalculatedDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTCalculatedDoseReferenceSequence &operator=(const DRTCalculatedDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtces.h b/dcmrt/include/dcmtk/dcmrt/seq/drtces.h new file mode 100644 index 00000000..186db7b5 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtces.h @@ -0,0 +1,551 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTContributingEquipmentSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCES_H +#define DRTCES_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence +#include "dcmtk/dcmrt/seq/drtporcs.h" // for PurposeOfReferenceCodeSequence + + +/** Interface class for ContributingEquipmentSequence (0018,a001) + */ +class DCMTK_DCMRT_EXPORT DRTContributingEquipmentSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ContributionDateTime (0018,a002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContributionDateTime(OFString &value, const signed long pos = 0) const; + + /** get ContributionDescription (0018,a003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContributionDescription(OFString &value, const signed long pos = 0) const; + + /** get DateOfLastCalibration (0018,1200) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDateOfLastCalibration(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get SoftwareVersions (0018,1020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSoftwareVersions(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpatialResolution(OFString &value, const signed long pos = 0) const; + + /** get SpatialResolution (0018,1050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpatialResolution(Float64 &value, const unsigned long pos = 0) const; + + /** get StationName (0008,1010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStationName(OFString &value, const signed long pos = 0) const; + + /** get TimeOfLastCalibration (0018,1201) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTimeOfLastCalibration(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return reference to sequence element + */ + DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() + { return PurposeOfReferenceCodeSequence; } + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return const reference to sequence element + */ + const DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() const + { return PurposeOfReferenceCodeSequence; } + + // --- set DICOM attribute values --- + + /** set ContributionDateTime (0018,a002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContributionDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set ContributionDescription (0018,a003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContributionDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DateOfLastCalibration (0018,1200) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDateOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set SoftwareVersions (0018,1020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSoftwareVersions(const OFString &value, const OFBool check = OFTrue); + + /** set SpatialResolution (0018,1050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpatialResolution(const OFString &value, const OFBool check = OFTrue); + + /** set StationName (0008,1010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStationName(const OFString &value, const OFBool check = OFTrue); + + /** set TimeOfLastCalibration (0018,1201) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTimeOfLastCalibration(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ContributionDateTime (0018,a002) vr=DT, vm=1, type=3 + DcmDateTime ContributionDateTime; + /// ContributionDescription (0018,a003) vr=ST, vm=1, type=3 + DcmShortText ContributionDescription; + /// DateOfLastCalibration (0018,1200) vr=DA, vm=1-n, type=3 + DcmDate DateOfLastCalibration; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// Manufacturer (0008,0070) vr=LO, vm=1, type=1 + DcmLongString Manufacturer; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=3 + DcmPersonName OperatorsName; + /// PurposeOfReferenceCodeSequence (0040,a170) vr=SQ, vm=1, type=1 + DRTPurposeOfReferenceCodeSequence PurposeOfReferenceCodeSequence; + /// SoftwareVersions (0018,1020) vr=LO, vm=1-n, type=3 + DcmLongString SoftwareVersions; + /// SpatialResolution (0018,1050) vr=DS, vm=1, type=3 + DcmDecimalString SpatialResolution; + /// StationName (0008,1010) vr=SH, vm=1, type=3 + DcmShortString StationName; + /// TimeOfLastCalibration (0018,1201) vr=TM, vm=1-n, type=3 + DcmTime TimeOfLastCalibration; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTContributingEquipmentSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTContributingEquipmentSequence(const DRTContributingEquipmentSequence ©); + + /** destructor + */ + virtual ~DRTContributingEquipmentSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTContributingEquipmentSequence &operator=(const DRTContributingEquipmentSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcgis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcgis.h new file mode 100644 index 00000000..e19e1da4 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcgis.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTContextGroupIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCGIS_H +#define DRTCGIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ContextGroupIdentificationSequence (0008,0123) + */ +class DCMTK_DCMRT_EXPORT DRTContextGroupIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1 + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=1 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1 + DcmCodeString MappingResource; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTContextGroupIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTContextGroupIdentificationSequence(const DRTContextGroupIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTContextGroupIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTContextGroupIdentificationSequence &operator=(const DRTContextGroupIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtchs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtchs.h new file mode 100644 index 00000000..f933c1cf --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtchs.h @@ -0,0 +1,869 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTChannelSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCHS_H +#define DRTCHS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbcps.h" // for BrachyControlPointSequence +#include "dcmtk/dcmrt/seq/drtcshs.h" // for ChannelShieldSequence + + +/** Interface class for ChannelSequence (300a,0280) + */ +class DCMTK_DCMRT_EXPORT DRTChannelSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AfterloaderChannelID (300a,0273) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAfterloaderChannelID(OFString &value, const signed long pos = 0) const; + + /** get ChannelEffectiveLength (300a,0271) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelEffectiveLength(OFString &value, const signed long pos = 0) const; + + /** get ChannelEffectiveLength (300a,0271) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelEffectiveLength(Float64 &value, const unsigned long pos = 0) const; + + /** get ChannelInnerLength (300a,0272) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelInnerLength(OFString &value, const signed long pos = 0) const; + + /** get ChannelInnerLength (300a,0272) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelInnerLength(Float64 &value, const unsigned long pos = 0) const; + + /** get ChannelLength (300a,0284) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelLength(OFString &value, const signed long pos = 0) const; + + /** get ChannelLength (300a,0284) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelLength(Float64 &value, const unsigned long pos = 0) const; + + /** get ChannelNumber (300a,0282) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelNumber(OFString &value, const signed long pos = 0) const; + + /** get ChannelNumber (300a,0282) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ChannelTotalTime (300a,0286) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelTotalTime(OFString &value, const signed long pos = 0) const; + + /** get ChannelTotalTime (300a,0286) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelTotalTime(Float64 &value, const unsigned long pos = 0) const; + + /** get FinalCumulativeTimeWeight (300a,02c8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFinalCumulativeTimeWeight(OFString &value, const signed long pos = 0) const; + + /** get FinalCumulativeTimeWeight (300a,02c8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFinalCumulativeTimeWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(OFString &value, const signed long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfPulses (300a,028a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfPulses(OFString &value, const signed long pos = 0) const; + + /** get NumberOfPulses (300a,028a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfPulses(Sint32 &value, const unsigned long pos = 0) const; + + /** get PulseRepetitionInterval (300a,028c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPulseRepetitionInterval(OFString &value, const signed long pos = 0) const; + + /** get PulseRepetitionInterval (300a,028c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPulseRepetitionInterval(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSourceNumber (300c,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSourceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSourceNumber (300c,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSourceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SourceApplicatorID (300a,0291) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorID(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorLength (300a,0296) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorLength(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorLength (300a,0296) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorLength(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceApplicatorManufacturer (300a,0298) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorManufacturer(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorName (300a,0294) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorName(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorNumber (300a,0290) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorNumber(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorNumber (300a,0290) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SourceApplicatorStepSize (300a,02a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorStepSize(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorStepSize (300a,02a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorStepSize(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceApplicatorTipLength (300a,0274) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorTipLength(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorTipLength (300a,0274) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorTipLength(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceApplicatorType (300a,0292) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorType(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorWallNominalThickness (300a,029c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorWallNominalThickness(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorWallNominalThickness (300a,029c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorWallNominalThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceApplicatorWallNominalTransmission (300a,029e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorWallNominalTransmission(OFString &value, const signed long pos = 0) const; + + /** get SourceApplicatorWallNominalTransmission (300a,029e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceApplicatorWallNominalTransmission(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceMovementType (300a,0288) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceMovementType(OFString &value, const signed long pos = 0) const; + + /** get TransferTubeLength (300a,02a4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTransferTubeLength(OFString &value, const signed long pos = 0) const; + + /** get TransferTubeLength (300a,02a4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTransferTubeLength(Float64 &value, const unsigned long pos = 0) const; + + /** get TransferTubeNumber (300a,02a2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTransferTubeNumber(OFString &value, const signed long pos = 0) const; + + /** get TransferTubeNumber (300a,02a2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTransferTubeNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BrachyControlPointSequence (300a,02d0) + * @return reference to sequence element + */ + DRTBrachyControlPointSequence &getBrachyControlPointSequence() + { return BrachyControlPointSequence; } + + /** get BrachyControlPointSequence (300a,02d0) + * @return const reference to sequence element + */ + const DRTBrachyControlPointSequence &getBrachyControlPointSequence() const + { return BrachyControlPointSequence; } + + /** get ChannelShieldSequence (300a,02b0) + * @return reference to sequence element + */ + DRTChannelShieldSequence &getChannelShieldSequence() + { return ChannelShieldSequence; } + + /** get ChannelShieldSequence (300a,02b0) + * @return const reference to sequence element + */ + const DRTChannelShieldSequence &getChannelShieldSequence() const + { return ChannelShieldSequence; } + + // --- set DICOM attribute values --- + + /** set AfterloaderChannelID (300a,0273) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAfterloaderChannelID(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelEffectiveLength (300a,0271) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelEffectiveLength(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelInnerLength (300a,0272) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelInnerLength(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelLength (300a,0284) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelLength(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelNumber (300a,0282) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelTotalTime (300a,0286) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelTotalTime(const OFString &value, const OFBool check = OFTrue); + + /** set FinalCumulativeTimeWeight (300a,02c8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFinalCumulativeTimeWeight(const OFString &value, const OFBool check = OFTrue); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfControlPoints (300a,0110) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfControlPoints(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfPulses (300a,028a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfPulses(const OFString &value, const OFBool check = OFTrue); + + /** set PulseRepetitionInterval (300a,028c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPulseRepetitionInterval(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSourceNumber (300c,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSourceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorID (300a,0291) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorID(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorLength (300a,0296) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorLength(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorManufacturer (300a,0298) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorName (300a,0294) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorName(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorNumber (300a,0290) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorStepSize (300a,02a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorStepSize(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorTipLength (300a,0274) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorTipLength(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorType (300a,0292) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorType(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorWallNominalThickness (300a,029c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorWallNominalThickness(const OFString &value, const OFBool check = OFTrue); + + /** set SourceApplicatorWallNominalTransmission (300a,029e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceApplicatorWallNominalTransmission(const OFString &value, const OFBool check = OFTrue); + + /** set SourceMovementType (300a,0288) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceMovementType(const OFString &value, const OFBool check = OFTrue); + + /** set TransferTubeLength (300a,02a4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTransferTubeLength(const OFString &value, const OFBool check = OFTrue); + + /** set TransferTubeNumber (300a,02a2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTransferTubeNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AfterloaderChannelID (300a,0273) vr=SH, vm=1, type=3 + DcmShortString AfterloaderChannelID; + /// BrachyControlPointSequence (300a,02d0) vr=SQ, vm=1, type=1 + DRTBrachyControlPointSequence BrachyControlPointSequence; + /// ChannelEffectiveLength (300a,0271) vr=DS, vm=1, type=3 + DcmDecimalString ChannelEffectiveLength; + /// ChannelInnerLength (300a,0272) vr=DS, vm=1, type=2C + DcmDecimalString ChannelInnerLength; + /// ChannelLength (300a,0284) vr=DS, vm=1, type=2 + DcmDecimalString ChannelLength; + /// ChannelNumber (300a,0282) vr=IS, vm=1, type=1 + DcmIntegerString ChannelNumber; + /// ChannelShieldSequence (300a,02b0) vr=SQ, vm=1, type=3 + DRTChannelShieldSequence ChannelShieldSequence; + /// ChannelTotalTime (300a,0286) vr=DS, vm=1, type=1 + DcmDecimalString ChannelTotalTime; + /// FinalCumulativeTimeWeight (300a,02c8) vr=DS, vm=1, type=1C + DcmDecimalString FinalCumulativeTimeWeight; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=3 + DcmShortString MaterialID; + /// NumberOfControlPoints (300a,0110) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfControlPoints; + /// NumberOfPulses (300a,028a) vr=IS, vm=1, type=1C + DcmIntegerString NumberOfPulses; + /// PulseRepetitionInterval (300a,028c) vr=DS, vm=1, type=1C + DcmDecimalString PulseRepetitionInterval; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=2C + DcmIntegerString ReferencedROINumber; + /// ReferencedSourceNumber (300c,000e) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedSourceNumber; + /// SourceApplicatorID (300a,0291) vr=SH, vm=1, type=2C + DcmShortString SourceApplicatorID; + /// SourceApplicatorLength (300a,0296) vr=DS, vm=1, type=1C + DcmDecimalString SourceApplicatorLength; + /// SourceApplicatorManufacturer (300a,0298) vr=LO, vm=1, type=3 + DcmLongString SourceApplicatorManufacturer; + /// SourceApplicatorName (300a,0294) vr=LO, vm=1, type=3 + DcmLongString SourceApplicatorName; + /// SourceApplicatorNumber (300a,0290) vr=IS, vm=1, type=3 + DcmIntegerString SourceApplicatorNumber; + /// SourceApplicatorStepSize (300a,02a0) vr=DS, vm=1, type=1C + DcmDecimalString SourceApplicatorStepSize; + /// SourceApplicatorTipLength (300a,0274) vr=DS, vm=1, type=2C + DcmDecimalString SourceApplicatorTipLength; + /// SourceApplicatorType (300a,0292) vr=CS, vm=1, type=1C + DcmCodeString SourceApplicatorType; + /// SourceApplicatorWallNominalThickness (300a,029c) vr=DS, vm=1, type=3 + DcmDecimalString SourceApplicatorWallNominalThickness; + /// SourceApplicatorWallNominalTransmission (300a,029e) vr=DS, vm=1, type=3 + DcmDecimalString SourceApplicatorWallNominalTransmission; + /// SourceMovementType (300a,0288) vr=CS, vm=1, type=1 + DcmCodeString SourceMovementType; + /// TransferTubeLength (300a,02a4) vr=DS, vm=1, type=2C + DcmDecimalString TransferTubeLength; + /// TransferTubeNumber (300a,02a2) vr=IS, vm=1, type=2 + DcmIntegerString TransferTubeNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTChannelSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTChannelSequence(const DRTChannelSequence ©); + + /** destructor + */ + virtual ~DRTChannelSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTChannelSequence &operator=(const DRTChannelSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcims.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcims.h new file mode 100644 index 00000000..4dfacaf8 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcims.h @@ -0,0 +1,555 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTContentItemModifierSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCIMS_H +#define DRTCIMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtccs.h" // for ConceptCodeSequence +#include "dcmtk/dcmrt/seq/drtcncs.h" // for ConceptNameCodeSequence +#include "dcmtk/dcmrt/seq/drtmucs.h" // for MeasurementUnitsCodeSequence +#include "dcmtk/dcmrt/seq/drtrsos.h" // for ReferencedSOPSequence + + +/** Interface class for ContentItemModifierSequence (0040,0441) + */ +class DCMTK_DCMRT_EXPORT DRTContentItemModifierSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get Date (0040,a121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDate(OFString &value, const signed long pos = 0) const; + + /** get DateTime (0040,a120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDateTime(OFString &value, const signed long pos = 0) const; + + /** get FloatingPointValue (0040,a161) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFloatingPointValue(Float64 &value, const unsigned long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(OFString &value, const signed long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(Float64 &value, const unsigned long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(OFVector &value) const; + + /** get ObservationDateTime (0040,a032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getObservationDateTime(OFString &value, const signed long pos = 0) const; + + /** get PersonName (0040,a123) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonName(OFString &value, const signed long pos = 0) const; + + /** get RationalDenominatorValue (0040,a163) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRationalDenominatorValue(Uint32 &value, const unsigned long pos = 0) const; + + /** get RationalNumeratorValue (0040,a162) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRationalNumeratorValue(Sint32 &value, const unsigned long pos = 0) const; + + /** get TextValue (0040,a160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTextValue(OFString &value, const signed long pos = 0) const; + + /** get Time (0040,a122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTime(OFString &value, const signed long pos = 0) const; + + /** get UID (0040,a124) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUID(OFString &value, const signed long pos = 0) const; + + /** get ValueType (0040,a040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValueType(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ConceptCodeSequence (0040,a168) + * @return reference to sequence element + */ + DRTConceptCodeSequence &getConceptCodeSequence() + { return ConceptCodeSequence; } + + /** get ConceptCodeSequence (0040,a168) + * @return const reference to sequence element + */ + const DRTConceptCodeSequence &getConceptCodeSequence() const + { return ConceptCodeSequence; } + + /** get ConceptNameCodeSequence (0040,a043) + * @return reference to sequence element + */ + DRTConceptNameCodeSequence &getConceptNameCodeSequence() + { return ConceptNameCodeSequence; } + + /** get ConceptNameCodeSequence (0040,a043) + * @return const reference to sequence element + */ + const DRTConceptNameCodeSequence &getConceptNameCodeSequence() const + { return ConceptNameCodeSequence; } + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return reference to sequence element + */ + DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() + { return MeasurementUnitsCodeSequence; } + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return const reference to sequence element + */ + const DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() const + { return MeasurementUnitsCodeSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return reference to sequence element + */ + DRTReferencedSOPSequence &getReferencedSOPSequence() + { return ReferencedSOPSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return const reference to sequence element + */ + const DRTReferencedSOPSequence &getReferencedSOPSequence() const + { return ReferencedSOPSequence; } + + // --- set DICOM attribute values --- + + /** set Date (0040,a121) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDate(const OFString &value, const OFBool check = OFTrue); + + /** set DateTime (0040,a120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set FloatingPointValue (0040,a161) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFloatingPointValue(const Float64 value, const unsigned long pos = 0); + + /** set NumericValue (0040,a30a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValue(const OFString &value, const OFBool check = OFTrue); + + /** set ObservationDateTime (0040,a032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setObservationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set PersonName (0040,a123) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonName(const OFString &value, const OFBool check = OFTrue); + + /** set RationalDenominatorValue (0040,a163) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRationalDenominatorValue(const Uint32 value, const unsigned long pos = 0); + + /** set RationalNumeratorValue (0040,a162) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRationalNumeratorValue(const Sint32 value, const unsigned long pos = 0); + + /** set TextValue (0040,a160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTextValue(const OFString &value, const OFBool check = OFTrue); + + /** set Time (0040,a122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTime(const OFString &value, const OFBool check = OFTrue); + + /** set UID (0040,a124) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUID(const OFString &value, const OFBool check = OFTrue); + + /** set ValueType (0040,a040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValueType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ConceptCodeSequence (0040,a168) vr=SQ, vm=1, type=1C + DRTConceptCodeSequence ConceptCodeSequence; + /// ConceptNameCodeSequence (0040,a043) vr=SQ, vm=1, type=1 + DRTConceptNameCodeSequence ConceptNameCodeSequence; + /// Date (0040,a121) vr=DA, vm=1, type=1C + DcmDate Date; + /// DateTime (0040,a120) vr=DT, vm=1, type=1C + DcmDateTime DateTime; + /// FloatingPointValue (0040,a161) vr=FD, vm=1-n, type=1C + DcmFloatingPointDouble FloatingPointValue; + /// MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1C + DRTMeasurementUnitsCodeSequence MeasurementUnitsCodeSequence; + /// NumericValue (0040,a30a) vr=DS, vm=1-n, type=1C + DcmDecimalString NumericValue; + /// ObservationDateTime (0040,a032) vr=DT, vm=1, type=3 + DcmDateTime ObservationDateTime; + /// PersonName (0040,a123) vr=PN, vm=1, type=1C + DcmPersonName PersonName; + /// RationalDenominatorValue (0040,a163) vr=UL, vm=1-n, type=1C + DcmUnsignedLong RationalDenominatorValue; + /// RationalNumeratorValue (0040,a162) vr=SL, vm=1-n, type=1C + DcmSignedLong RationalNumeratorValue; + /// ReferencedSOPSequence (0008,1199) vr=SQ, vm=1, type=1C + DRTReferencedSOPSequence ReferencedSOPSequence; + /// TextValue (0040,a160) vr=UT, vm=1, type=1C + DcmUnlimitedText TextValue; + /// Time (0040,a122) vr=TM, vm=1, type=1C + DcmTime Time; + /// UID (0040,a124) vr=UI, vm=1, type=1C + DcmUniqueIdentifier UID; + /// ValueType (0040,a040) vr=CS, vm=1, type=1 + DcmCodeString ValueType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTContentItemModifierSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTContentItemModifierSequence(const DRTContentItemModifierSequence ©); + + /** destructor + */ + virtual ~DRTContentItemModifierSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTContentItemModifierSequence &operator=(const DRTContentItemModifierSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcis.h new file mode 100644 index 00000000..46ddf78d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcis.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTContourImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCIS_H +#define DRTCIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ContourImageSequence (3006,0016) + */ +class DCMTK_DCMRT_EXPORT DRTContourImageSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSegmentNumber (0062,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSegmentNumber(Uint16 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedFrameNumber (0008,1160) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSegmentNumber (0062,000b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegmentNumber(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C + DcmIntegerString ReferencedFrameNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C + DcmUnsignedShort ReferencedSegmentNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTContourImageSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTContourImageSequence(const DRTContourImageSequence ©); + + /** destructor + */ + virtual ~DRTContourImageSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTContourImageSequence &operator=(const DRTContourImageSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcncs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcncs.h new file mode 100644 index 00000000..94c8d82d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcncs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTConceptNameCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCNCS_H +#define DRTCNCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ConceptNameCodeSequence (0040,a043) + */ +class DCMTK_DCMRT_EXPORT DRTConceptNameCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTConceptNameCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTConceptNameCodeSequence(const DRTConceptNameCodeSequence ©); + + /** destructor + */ + virtual ~DRTConceptNameCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTConceptNameCodeSequence &operator=(const DRTConceptNameCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcos.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcos.h new file mode 100644 index 00000000..73def605 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcos.h @@ -0,0 +1,669 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTCompensatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCOS_H +#define DRTCOS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for CompensatorSequence (300a,00e3) + */ +class DCMTK_DCMRT_EXPORT DRTCompensatorSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get CompensatorColumns (300a,00e8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorColumns(OFString &value, const signed long pos = 0) const; + + /** get CompensatorColumns (300a,00e8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorColumns(Sint32 &value, const unsigned long pos = 0) const; + + /** get CompensatorDescription (300a,02eb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorDescription(OFString &value, const signed long pos = 0) const; + + /** get CompensatorDivergence (300a,02e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorDivergence(OFString &value, const signed long pos = 0) const; + + /** get CompensatorID (300a,00e5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorID(OFString &value, const signed long pos = 0) const; + + /** get CompensatorMountingPosition (300a,02e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorMountingPosition(OFString &value, const signed long pos = 0) const; + + /** get CompensatorNumber (300a,00e4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorNumber(OFString &value, const signed long pos = 0) const; + + /** get CompensatorNumber (300a,00e4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get CompensatorPixelSpacing (300a,00e9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPixelSpacing(OFString &value, const signed long pos = 0) const; + + /** get CompensatorPixelSpacing (300a,00e9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPixelSpacing(Float64 &value, const unsigned long pos = 0) const; + + /** get CompensatorPixelSpacing (300a,00e9) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPixelSpacing(OFVector &value) const; + + /** get CompensatorPosition (300a,00ea) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPosition(OFString &value, const signed long pos = 0) const; + + /** get CompensatorPosition (300a,00ea) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get CompensatorPosition (300a,00ea) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPosition(OFVector &value) const; + + /** get CompensatorRows (300a,00e7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorRows(OFString &value, const signed long pos = 0) const; + + /** get CompensatorRows (300a,00e7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorRows(Sint32 &value, const unsigned long pos = 0) const; + + /** get CompensatorThicknessData (300a,00ec) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorThicknessData(OFString &value, const signed long pos = 0) const; + + /** get CompensatorThicknessData (300a,00ec) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorThicknessData(Float64 &value, const unsigned long pos = 0) const; + + /** get CompensatorThicknessData (300a,00ec) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorThicknessData(OFVector &value) const; + + /** get CompensatorTransmissionData (300a,00eb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorTransmissionData(OFString &value, const signed long pos = 0) const; + + /** get CompensatorTransmissionData (300a,00eb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorTransmissionData(Float64 &value, const unsigned long pos = 0) const; + + /** get CompensatorTransmissionData (300a,00eb) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorTransmissionData(OFVector &value) const; + + /** get CompensatorTrayID (300a,00ef) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorTrayID(OFString &value, const signed long pos = 0) const; + + /** get CompensatorType (300a,00ee) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorType(OFString &value, const signed long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get SourceToCompensatorDistance (300a,02e2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToCompensatorDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToCompensatorDistance (300a,02e2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToCompensatorDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceToCompensatorDistance (300a,02e2) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToCompensatorDistance(OFVector &value) const; + + /** get SourceToCompensatorTrayDistance (300a,00e6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToCompensatorTrayDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToCompensatorTrayDistance (300a,00e6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToCompensatorTrayDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get TrayAccessoryCode (300a,0355) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTrayAccessoryCode(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorColumns (300a,00e8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorColumns(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorDescription (300a,02eb) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorDescription(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorDivergence (300a,02e0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorDivergence(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorID (300a,00e5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorID(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorMountingPosition (300a,02e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorMountingPosition(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorNumber (300a,00e4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorNumber(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorPixelSpacing (300a,00e9) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorPixelSpacing(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorPosition (300a,00ea) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorPosition(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorRows (300a,00e7) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorRows(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorThicknessData (300a,00ec) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorThicknessData(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorTransmissionData (300a,00eb) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorTransmissionData(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorTrayID (300a,00ef) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorTrayID(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorType (300a,00ee) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorType(const OFString &value, const OFBool check = OFTrue); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToCompensatorDistance (300a,02e2) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToCompensatorDistance(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToCompensatorTrayDistance (300a,00e6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToCompensatorTrayDistance(const OFString &value, const OFBool check = OFTrue); + + /** set TrayAccessoryCode (300a,0355) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTrayAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// CompensatorColumns (300a,00e8) vr=IS, vm=1, type=1 + DcmIntegerString CompensatorColumns; + /// CompensatorDescription (300a,02eb) vr=LT, vm=1, type=3 + DcmLongText CompensatorDescription; + /// CompensatorDivergence (300a,02e0) vr=CS, vm=1, type=3 + DcmCodeString CompensatorDivergence; + /// CompensatorID (300a,00e5) vr=SH, vm=1, type=3 + DcmShortString CompensatorID; + /// CompensatorMountingPosition (300a,02e1) vr=CS, vm=1, type=3 + DcmCodeString CompensatorMountingPosition; + /// CompensatorNumber (300a,00e4) vr=IS, vm=1, type=1C + DcmIntegerString CompensatorNumber; + /// CompensatorPixelSpacing (300a,00e9) vr=DS, vm=2, type=1 + DcmDecimalString CompensatorPixelSpacing; + /// CompensatorPosition (300a,00ea) vr=DS, vm=2, type=1 + DcmDecimalString CompensatorPosition; + /// CompensatorRows (300a,00e7) vr=IS, vm=1, type=1 + DcmIntegerString CompensatorRows; + /// CompensatorThicknessData (300a,00ec) vr=DS, vm=1-n, type=1C + DcmDecimalString CompensatorThicknessData; + /// CompensatorTransmissionData (300a,00eb) vr=DS, vm=1-n, type=1C + DcmDecimalString CompensatorTransmissionData; + /// CompensatorTrayID (300a,00ef) vr=SH, vm=1, type=3 + DcmShortString CompensatorTrayID; + /// CompensatorType (300a,00ee) vr=CS, vm=1, type=3 + DcmCodeString CompensatorType; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=2C + DcmShortString MaterialID; + /// SourceToCompensatorDistance (300a,02e2) vr=DS, vm=1-n, type=1C + DcmDecimalString SourceToCompensatorDistance; + /// SourceToCompensatorTrayDistance (300a,00e6) vr=DS, vm=1, type=2 + DcmDecimalString SourceToCompensatorTrayDistance; + /// TrayAccessoryCode (300a,0355) vr=LO, vm=1, type=3 + DcmLongString TrayAccessoryCode; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTCompensatorSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTCompensatorSequence(const DRTCompensatorSequence ©); + + /** destructor + */ + virtual ~DRTCompensatorSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTCompensatorSequence &operator=(const DRTCompensatorSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcpas.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcpas.h new file mode 100644 index 00000000..bc5e9beb --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcpas.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTCorrectedParameterSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCPAS_H +#define DRTCPAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for CorrectedParameterSequence (3008,0068) + */ +class DCMTK_DCMRT_EXPORT DRTCorrectedParameterSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CorrectionValue (3008,006a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCorrectionValue(Float32 &value, const unsigned long pos = 0) const; + + /** get ParameterItemIndex (3008,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterItemIndex(OFString &value, const signed long pos = 0) const; + + /** get ParameterItemIndex (3008,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterItemIndex(Sint32 &value, const unsigned long pos = 0) const; + + /** get ParameterPointer (3008,0065) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterPointer(OFString &value, const signed long pos = 0) const; + + /** get ParameterSequencePointer (3008,0061) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterSequencePointer(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CorrectionValue (3008,006a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCorrectionValue(const Float32 value, const unsigned long pos = 0); + + /** set ParameterItemIndex (3008,0063) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setParameterItemIndex(const OFString &value, const OFBool check = OFTrue); + + /** set ParameterPointer (3008,0065) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setParameterPointer(const OFString &value, const OFBool check = OFTrue); + + /** set ParameterSequencePointer (3008,0061) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setParameterSequencePointer(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CorrectionValue (3008,006a) vr=FL, vm=1, type=1 + DcmFloatingPointSingle CorrectionValue; + /// ParameterItemIndex (3008,0063) vr=IS, vm=1, type=1 + DcmIntegerString ParameterItemIndex; + /// ParameterPointer (3008,0065) vr=AT, vm=1, type=1 + DcmAttributeTag ParameterPointer; + /// ParameterSequencePointer (3008,0061) vr=AT, vm=1, type=1 + DcmAttributeTag ParameterSequencePointer; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTCorrectedParameterSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTCorrectedParameterSequence(const DRTCorrectedParameterSequence ©); + + /** destructor + */ + virtual ~DRTCorrectedParameterSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTCorrectedParameterSequence &operator=(const DRTCorrectedParameterSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcpis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcpis.h new file mode 100644 index 00000000..e75b8708 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcpis.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTConsultingPhysicianIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCPIS_H +#define DRTCPIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtics.h" // for InstitutionCodeSequence +#include "dcmtk/dcmrt/seq/drtpics.h" // for PersonIdentificationCodeSequence + + +/** Interface class for ConsultingPhysicianIdentificationSequence (0008,009d) + */ +class DCMTK_DCMRT_EXPORT DRTConsultingPhysicianIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get PersonAddress (0040,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonAddress(OFString &value, const signed long pos = 0) const; + + /** get PersonTelecomInformation (0040,1104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelecomInformation(OFString &value, const signed long pos = 0) const; + + /** get PersonTelephoneNumbers (0040,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelephoneNumbers(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get InstitutionCodeSequence (0008,0082) + * @return reference to sequence element + */ + DRTInstitutionCodeSequence &getInstitutionCodeSequence() + { return InstitutionCodeSequence; } + + /** get InstitutionCodeSequence (0008,0082) + * @return const reference to sequence element + */ + const DRTInstitutionCodeSequence &getInstitutionCodeSequence() const + { return InstitutionCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return reference to sequence element + */ + DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() + { return PersonIdentificationCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return const reference to sequence element + */ + const DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() const + { return PersonIdentificationCodeSequence; } + + // --- set DICOM attribute values --- + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set PersonAddress (0040,1102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonAddress(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelecomInformation (0040,1104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelecomInformation(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelephoneNumbers (0040,1103) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelephoneNumbers(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionCodeSequence (0008,0082) vr=SQ, vm=1, type=1C + DRTInstitutionCodeSequence InstitutionCodeSequence; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=1C + DcmLongString InstitutionName; + /// PersonAddress (0040,1102) vr=ST, vm=1, type=3 + DcmShortText PersonAddress; + /// PersonIdentificationCodeSequence (0040,1101) vr=SQ, vm=1, type=1 + DRTPersonIdentificationCodeSequence PersonIdentificationCodeSequence; + /// PersonTelecomInformation (0040,1104) vr=LT, vm=1, type=3 + DcmLongText PersonTelecomInformation; + /// PersonTelephoneNumbers (0040,1103) vr=LO, vm=1-n, type=3 + DcmLongString PersonTelephoneNumbers; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTConsultingPhysicianIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTConsultingPhysicianIdentificationSequence(const DRTConsultingPhysicianIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTConsultingPhysicianIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTConsultingPhysicianIdentificationSequence &operator=(const DRTConsultingPhysicianIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcps.h new file mode 100644 index 00000000..5834a03f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcps.h @@ -0,0 +1,899 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCPS_H +#define DRTCPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbldps.h" // for BeamLimitingDevicePositionSequence +#include "dcmtk/dcmrt/seq/drtrdrs1.h" // for ReferencedDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtrds.h" // for ReferencedDoseSequence +#include "dcmtk/dcmrt/seq/drtwps.h" // for WedgePositionSequence + + +/** Interface class for ControlPointSequence (300a,0111) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTControlPointSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamLimitingDeviceRotationDirection (300a,0121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get ControlPointIndex (300a,0112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointIndex(OFString &value, const signed long pos = 0) const; + + /** get ControlPointIndex (300a,0112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointIndex(Sint32 &value, const unsigned long pos = 0) const; + + /** get CumulativeMetersetWeight (300a,0134) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get CumulativeMetersetWeight (300a,0134) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get DoseRateSet (300a,0115) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseRateSet(OFString &value, const signed long pos = 0) const; + + /** get DoseRateSet (300a,0115) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseRateSet(Float64 &value, const unsigned long pos = 0) const; + + /** get ExternalContourEntryPoint (300a,0133) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getExternalContourEntryPoint(Float32 &value, const unsigned long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(OFString &value, const signed long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryPitchAngle (300a,014a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get GantryPitchRotationDirection (300a,014c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get GantryRotationDirection (300a,011f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterPosition(OFString &value, const signed long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterPosition(OFVector &value) const; + + /** get NominalBeamEnergy (300a,0114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalBeamEnergy(OFString &value, const signed long pos = 0) const; + + /** get NominalBeamEnergy (300a,0114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalBeamEnergy(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSupportRotationDirection (300a,0123) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get SourceToExternalContourDistance (300a,0132) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToExternalContourDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get SourceToSurfaceDistance (300a,0130) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToSurfaceDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToSurfaceDistance (300a,0130) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToSurfaceDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get SurfaceEntryPoint (300a,012e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSurfaceEntryPoint(OFString &value, const signed long pos = 0) const; + + /** get SurfaceEntryPoint (300a,012e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSurfaceEntryPoint(Float64 &value, const unsigned long pos = 0) const; + + /** get SurfaceEntryPoint (300a,012e) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSurfaceEntryPoint(OFVector &value) const; + + /** get TableTopEccentricAngle (300a,0125) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopEccentricAngle(OFString &value, const signed long pos = 0) const; + + /** get TableTopEccentricAngle (300a,0125) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopEccentricAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopEccentricAxisDistance (300a,0124) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopEccentricAxisDistance(OFString &value, const signed long pos = 0) const; + + /** get TableTopEccentricAxisDistance (300a,0124) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopEccentricAxisDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopEccentricRotationDirection (300a,0126) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopEccentricRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchAngle (300a,0140) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchRotationDirection (300a,0142) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get TableTopRollAngle (300a,0144) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopRollRotationDirection (300a,0146) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BeamLimitingDevicePositionSequence (300a,011a) + * @return reference to sequence element + */ + DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence() + { return BeamLimitingDevicePositionSequence; } + + /** get BeamLimitingDevicePositionSequence (300a,011a) + * @return const reference to sequence element + */ + const DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence() const + { return BeamLimitingDevicePositionSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return reference to sequence element + */ + DRTReferencedDoseReferenceSequenceInRTBeamsModule &getReferencedDoseReferenceSequence() + { return ReferencedDoseReferenceSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return const reference to sequence element + */ + const DRTReferencedDoseReferenceSequenceInRTBeamsModule &getReferencedDoseReferenceSequence() const + { return ReferencedDoseReferenceSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return reference to sequence element + */ + DRTReferencedDoseSequence &getReferencedDoseSequence() + { return ReferencedDoseSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return const reference to sequence element + */ + const DRTReferencedDoseSequence &getReferencedDoseSequence() const + { return ReferencedDoseSequence; } + + /** get WedgePositionSequence (300a,0116) + * @return reference to sequence element + */ + DRTWedgePositionSequence &getWedgePositionSequence() + { return WedgePositionSequence; } + + /** get WedgePositionSequence (300a,0116) + * @return const reference to sequence element + */ + const DRTWedgePositionSequence &getWedgePositionSequence() const + { return WedgePositionSequence; } + + // --- set DICOM attribute values --- + + /** set BeamLimitingDeviceAngle (300a,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceAngle(const OFString &value, const OFBool check = OFTrue); + + /** set BeamLimitingDeviceRotationDirection (300a,0121) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set ControlPointIndex (300a,0112) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setControlPointIndex(const OFString &value, const OFBool check = OFTrue); + + /** set CumulativeMetersetWeight (300a,0134) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set DoseRateSet (300a,0115) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseRateSet(const OFString &value, const OFBool check = OFTrue); + + /** set ExternalContourEntryPoint (300a,0133) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setExternalContourEntryPoint(const Float32 value, const unsigned long pos = 0); + + /** set GantryAngle (300a,011e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryAngle(const OFString &value, const OFBool check = OFTrue); + + /** set GantryPitchAngle (300a,014a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set GantryPitchRotationDirection (300a,014c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set GantryRotationDirection (300a,011f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set IsocenterPosition (300a,012c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterPosition(const OFString &value, const OFBool check = OFTrue); + + /** set NominalBeamEnergy (300a,0114) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNominalBeamEnergy(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAngle (300a,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAngle(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportRotationDirection (300a,0123) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToExternalContourDistance (300a,0132) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToExternalContourDistance(const Float32 value, const unsigned long pos = 0); + + /** set SourceToSurfaceDistance (300a,0130) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToSurfaceDistance(const OFString &value, const OFBool check = OFTrue); + + /** set SurfaceEntryPoint (300a,012e) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSurfaceEntryPoint(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopEccentricAngle (300a,0125) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopEccentricAngle(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopEccentricAxisDistance (300a,0124) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopEccentricAxisDistance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopEccentricRotationDirection (300a,0126) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopEccentricRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLateralPosition (300a,012a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLateralPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalPosition (300a,0129) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLongitudinalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopPitchAngle (300a,0140) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopPitchRotationDirection (300a,0142) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopRollAngle (300a,0144) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopRollRotationDirection (300a,0146) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopVerticalPosition (300a,0128) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopVerticalPosition(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamLimitingDeviceAngle (300a,0120) vr=DS, vm=1, type=1C + DcmDecimalString BeamLimitingDeviceAngle; + /// BeamLimitingDevicePositionSequence (300a,011a) vr=SQ, vm=1, type=1C + DRTBeamLimitingDevicePositionSequence BeamLimitingDevicePositionSequence; + /// BeamLimitingDeviceRotationDirection (300a,0121) vr=CS, vm=1, type=1C + DcmCodeString BeamLimitingDeviceRotationDirection; + /// ControlPointIndex (300a,0112) vr=IS, vm=1, type=1 + DcmIntegerString ControlPointIndex; + /// CumulativeMetersetWeight (300a,0134) vr=DS, vm=1, type=2 + DcmDecimalString CumulativeMetersetWeight; + /// DoseRateSet (300a,0115) vr=DS, vm=1, type=3 + DcmDecimalString DoseRateSet; + /// ExternalContourEntryPoint (300a,0133) vr=FL, vm=3, type=3 + DcmFloatingPointSingle ExternalContourEntryPoint; + /// GantryAngle (300a,011e) vr=DS, vm=1, type=1C + DcmDecimalString GantryAngle; + /// GantryPitchAngle (300a,014a) vr=FL, vm=1, type=3 + DcmFloatingPointSingle GantryPitchAngle; + /// GantryPitchRotationDirection (300a,014c) vr=CS, vm=1, type=3 + DcmCodeString GantryPitchRotationDirection; + /// GantryRotationDirection (300a,011f) vr=CS, vm=1, type=1C + DcmCodeString GantryRotationDirection; + /// IsocenterPosition (300a,012c) vr=DS, vm=3, type=2C + DcmDecimalString IsocenterPosition; + /// NominalBeamEnergy (300a,0114) vr=DS, vm=1, type=3 + DcmDecimalString NominalBeamEnergy; + /// PatientSupportAngle (300a,0122) vr=DS, vm=1, type=1C + DcmDecimalString PatientSupportAngle; + /// PatientSupportRotationDirection (300a,0123) vr=CS, vm=1, type=1C + DcmCodeString PatientSupportRotationDirection; + /// ReferencedDoseReferenceSequence (300c,0050) vr=SQ, vm=1, type=3 + DRTReferencedDoseReferenceSequenceInRTBeamsModule ReferencedDoseReferenceSequence; + /// ReferencedDoseSequence (300c,0080) vr=SQ, vm=1, type=1C + DRTReferencedDoseSequence ReferencedDoseSequence; + /// SourceToExternalContourDistance (300a,0132) vr=FL, vm=1, type=3 + DcmFloatingPointSingle SourceToExternalContourDistance; + /// SourceToSurfaceDistance (300a,0130) vr=DS, vm=1, type=3 + DcmDecimalString SourceToSurfaceDistance; + /// SurfaceEntryPoint (300a,012e) vr=DS, vm=3, type=3 + DcmDecimalString SurfaceEntryPoint; + /// TableTopEccentricAngle (300a,0125) vr=DS, vm=1, type=1C + DcmDecimalString TableTopEccentricAngle; + /// TableTopEccentricAxisDistance (300a,0124) vr=DS, vm=1, type=3 + DcmDecimalString TableTopEccentricAxisDistance; + /// TableTopEccentricRotationDirection (300a,0126) vr=CS, vm=1, type=1C + DcmCodeString TableTopEccentricRotationDirection; + /// TableTopLateralPosition (300a,012a) vr=DS, vm=1, type=2C + DcmDecimalString TableTopLateralPosition; + /// TableTopLongitudinalPosition (300a,0129) vr=DS, vm=1, type=2C + DcmDecimalString TableTopLongitudinalPosition; + /// TableTopPitchAngle (300a,0140) vr=FL, vm=1, type=1C + DcmFloatingPointSingle TableTopPitchAngle; + /// TableTopPitchRotationDirection (300a,0142) vr=CS, vm=1, type=1C + DcmCodeString TableTopPitchRotationDirection; + /// TableTopRollAngle (300a,0144) vr=FL, vm=1, type=1C + DcmFloatingPointSingle TableTopRollAngle; + /// TableTopRollRotationDirection (300a,0146) vr=CS, vm=1, type=1C + DcmCodeString TableTopRollRotationDirection; + /// TableTopVerticalPosition (300a,0128) vr=DS, vm=1, type=2C + DcmDecimalString TableTopVerticalPosition; + /// WedgePositionSequence (300a,0116) vr=SQ, vm=1, type=1C + DRTWedgePositionSequence WedgePositionSequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTControlPointSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTControlPointSequence(const DRTControlPointSequence ©); + + /** destructor + */ + virtual ~DRTControlPointSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTControlPointSequence &operator=(const DRTControlPointSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcs.h new file mode 100644 index 00000000..981c3508 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcs.h @@ -0,0 +1,471 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTContourSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCS_H +#define DRTCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtcis.h" // for ContourImageSequence + + +/** Interface class for ContourSequence (3006,0040) + */ +class DCMTK_DCMRT_EXPORT DRTContourSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AttachedContours (3006,0049) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAttachedContours(OFString &value, const signed long pos = 0) const; + + /** get AttachedContours (3006,0049) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAttachedContours(Sint32 &value, const unsigned long pos = 0) const; + + /** get ContourData (3006,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourData(OFString &value, const signed long pos = 0) const; + + /** get ContourData (3006,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourData(Float64 &value, const unsigned long pos = 0) const; + + /** get ContourData (3006,0050) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourData(OFVector &value) const; + + /** get ContourGeometricType (3006,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourGeometricType(OFString &value, const signed long pos = 0) const; + + /** get ContourNumber (3006,0048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourNumber(OFString &value, const signed long pos = 0) const; + + /** get ContourNumber (3006,0048) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ContourOffsetVector (3006,0045) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourOffsetVector(OFString &value, const signed long pos = 0) const; + + /** get ContourOffsetVector (3006,0045) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourOffsetVector(Float64 &value, const unsigned long pos = 0) const; + + /** get ContourOffsetVector (3006,0045) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourOffsetVector(OFVector &value) const; + + /** get ContourSlabThickness (3006,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourSlabThickness(OFString &value, const signed long pos = 0) const; + + /** get ContourSlabThickness (3006,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContourSlabThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get NumberOfContourPoints (3006,0046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfContourPoints(OFString &value, const signed long pos = 0) const; + + /** get NumberOfContourPoints (3006,0046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfContourPoints(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ContourImageSequence (3006,0016) + * @return reference to sequence element + */ + DRTContourImageSequence &getContourImageSequence() + { return ContourImageSequence; } + + /** get ContourImageSequence (3006,0016) + * @return const reference to sequence element + */ + const DRTContourImageSequence &getContourImageSequence() const + { return ContourImageSequence; } + + // --- set DICOM attribute values --- + + /** set AttachedContours (3006,0049) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAttachedContours(const OFString &value, const OFBool check = OFTrue); + + /** set ContourData (3006,0050) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3-3n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContourData(const OFString &value, const OFBool check = OFTrue); + + /** set ContourGeometricType (3006,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContourGeometricType(const OFString &value, const OFBool check = OFTrue); + + /** set ContourNumber (3006,0048) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContourNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ContourOffsetVector (3006,0045) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContourOffsetVector(const OFString &value, const OFBool check = OFTrue); + + /** set ContourSlabThickness (3006,0044) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContourSlabThickness(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfContourPoints (3006,0046) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfContourPoints(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AttachedContours (3006,0049) vr=IS, vm=1-n, type=3 + DcmIntegerString AttachedContours; + /// ContourData (3006,0050) vr=DS, vm=3-3n, type=1 + DcmDecimalString ContourData; + /// ContourGeometricType (3006,0042) vr=CS, vm=1, type=1 + DcmCodeString ContourGeometricType; + /// ContourImageSequence (3006,0016) vr=SQ, vm=1, type=3 + DRTContourImageSequence ContourImageSequence; + /// ContourNumber (3006,0048) vr=IS, vm=1, type=3 + DcmIntegerString ContourNumber; + /// ContourOffsetVector (3006,0045) vr=DS, vm=3, type=3 + DcmDecimalString ContourOffsetVector; + /// ContourSlabThickness (3006,0044) vr=DS, vm=1, type=3 + DcmDecimalString ContourSlabThickness; + /// NumberOfContourPoints (3006,0046) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfContourPoints; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTContourSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTContourSequence(const DRTContourSequence ©); + + /** destructor + */ + virtual ~DRTContourSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTContourSequence &operator=(const DRTContourSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcsas.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcsas.h new file mode 100644 index 00000000..b1741fb6 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcsas.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTConversionSourceAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCSAS_H +#define DRTCSAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ConversionSourceAttributesSequence (0020,9172) + */ +class DCMTK_DCMRT_EXPORT DRTConversionSourceAttributesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSegmentNumber (0062,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSegmentNumber(Uint16 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedFrameNumber (0008,1160) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSegmentNumber (0062,000b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegmentNumber(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C + DcmIntegerString ReferencedFrameNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C + DcmUnsignedShort ReferencedSegmentNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTConversionSourceAttributesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTConversionSourceAttributesSequence(const DRTConversionSourceAttributesSequence ©); + + /** destructor + */ + virtual ~DRTConversionSourceAttributesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTConversionSourceAttributesSequence &operator=(const DRTConversionSourceAttributesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcshs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcshs.h new file mode 100644 index 00000000..cdc6c240 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcshs.h @@ -0,0 +1,428 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTChannelShieldSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCSHS_H +#define DRTCSHS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ChannelShieldSequence (300a,02b0) + */ +class DCMTK_DCMRT_EXPORT DRTChannelShieldSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ChannelShieldID (300a,02b3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldID(OFString &value, const signed long pos = 0) const; + + /** get ChannelShieldName (300a,02b4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldName(OFString &value, const signed long pos = 0) const; + + /** get ChannelShieldNominalThickness (300a,02b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldNominalThickness(OFString &value, const signed long pos = 0) const; + + /** get ChannelShieldNominalThickness (300a,02b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldNominalThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get ChannelShieldNominalTransmission (300a,02ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldNominalTransmission(OFString &value, const signed long pos = 0) const; + + /** get ChannelShieldNominalTransmission (300a,02ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldNominalTransmission(Float64 &value, const unsigned long pos = 0) const; + + /** get ChannelShieldNumber (300a,02b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldNumber(OFString &value, const signed long pos = 0) const; + + /** get ChannelShieldNumber (300a,02b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelShieldNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ChannelShieldID (300a,02b3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelShieldID(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelShieldName (300a,02b4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelShieldName(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelShieldNominalThickness (300a,02b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelShieldNominalThickness(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelShieldNominalTransmission (300a,02ba) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelShieldNominalTransmission(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelShieldNumber (300a,02b2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelShieldNumber(const OFString &value, const OFBool check = OFTrue); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ChannelShieldID (300a,02b3) vr=SH, vm=1, type=2 + DcmShortString ChannelShieldID; + /// ChannelShieldName (300a,02b4) vr=LO, vm=1, type=3 + DcmLongString ChannelShieldName; + /// ChannelShieldNominalThickness (300a,02b8) vr=DS, vm=1, type=3 + DcmDecimalString ChannelShieldNominalThickness; + /// ChannelShieldNominalTransmission (300a,02ba) vr=DS, vm=1, type=3 + DcmDecimalString ChannelShieldNominalTransmission; + /// ChannelShieldNumber (300a,02b2) vr=IS, vm=1, type=1 + DcmIntegerString ChannelShieldNumber; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=3 + DcmShortString MaterialID; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=2 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTChannelShieldSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTChannelShieldSequence(const DRTChannelShieldSequence ©); + + /** destructor + */ + virtual ~DRTChannelShieldSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTChannelShieldSequence &operator=(const DRTChannelShieldSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcsis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcsis.h new file mode 100644 index 00000000..26a4715b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcsis.h @@ -0,0 +1,417 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTCodingSchemeIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCSIS_H +#define DRTCSIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtcsrs.h" // for CodingSchemeResourcesSequence + + +/** Interface class for CodingSchemeIdentificationSequence (0008,0110) + */ +class DCMTK_DCMRT_EXPORT DRTCodingSchemeIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeExternalID (0008,0114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeExternalID(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeName (0008,0115) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeName(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeRegistry (0008,0112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeRegistry(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeResponsibleOrganization (0008,0116) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeResponsibleOrganization(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeUID (0008,010c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeUID(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get CodingSchemeResourcesSequence (0008,0109) + * @return reference to sequence element + */ + DRTCodingSchemeResourcesSequence &getCodingSchemeResourcesSequence() + { return CodingSchemeResourcesSequence; } + + /** get CodingSchemeResourcesSequence (0008,0109) + * @return const reference to sequence element + */ + const DRTCodingSchemeResourcesSequence &getCodingSchemeResourcesSequence() const + { return CodingSchemeResourcesSequence; } + + // --- set DICOM attribute values --- + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeExternalID (0008,0114) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeExternalID(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeName (0008,0115) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeName(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeRegistry (0008,0112) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeRegistry(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeResponsibleOrganization (0008,0116) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeResponsibleOrganization(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeUID (0008,010c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeUID(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1 + DcmShortString CodingSchemeDesignator; + /// CodingSchemeExternalID (0008,0114) vr=ST, vm=1, type=2C + DcmShortText CodingSchemeExternalID; + /// CodingSchemeName (0008,0115) vr=ST, vm=1, type=3 + DcmShortText CodingSchemeName; + /// CodingSchemeRegistry (0008,0112) vr=LO, vm=1, type=1C + DcmLongString CodingSchemeRegistry; + /// CodingSchemeResourcesSequence (0008,0109) vr=SQ, vm=1, type=3 + DRTCodingSchemeResourcesSequence CodingSchemeResourcesSequence; + /// CodingSchemeResponsibleOrganization (0008,0116) vr=ST, vm=1, type=3 + DcmShortText CodingSchemeResponsibleOrganization; + /// CodingSchemeUID (0008,010c) vr=UI, vm=1, type=1C + DcmUniqueIdentifier CodingSchemeUID; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=3 + DcmShortString CodingSchemeVersion; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTCodingSchemeIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTCodingSchemeIdentificationSequence(const DRTCodingSchemeIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTCodingSchemeIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTCodingSchemeIdentificationSequence &operator=(const DRTCodingSchemeIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcsrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcsrs.h new file mode 100644 index 00000000..0d88215e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcsrs.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTCodingSchemeResourcesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCSRS_H +#define DRTCSRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for CodingSchemeResourcesSequence (0008,0109) + */ +class DCMTK_DCMRT_EXPORT DRTCodingSchemeResourcesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodingSchemeURL (0008,010e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeURL(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeURLType (0008,010a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeURLType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CodingSchemeURL (0008,010e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeURL(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeURLType (0008,010a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeURLType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodingSchemeURL (0008,010e) vr=UR, vm=1, type=1 + DcmUniversalResourceIdentifierOrLocator CodingSchemeURL; + /// CodingSchemeURLType (0008,010a) vr=CS, vm=1, type=1 + DcmCodeString CodingSchemeURLType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTCodingSchemeResourcesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTCodingSchemeResourcesSequence(const DRTCodingSchemeResourcesSequence ©); + + /** destructor + */ + virtual ~DRTCodingSchemeResourcesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTCodingSchemeResourcesSequence &operator=(const DRTCodingSchemeResourcesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtcss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtcss.h new file mode 100644 index 00000000..bbf8eeb1 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtcss.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTChannelSourceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTCSS_H +#define DRTCSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ChannelSourceSequence (003a,0208) + */ +class DCMTK_DCMRT_EXPORT DRTChannelSourceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTChannelSourceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTChannelSourceSequence(const DRTChannelSourceSequence ©); + + /** destructor + */ + virtual ~DRTChannelSourceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTChannelSourceSequence &operator=(const DRTChannelSourceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdcs.h new file mode 100644 index 00000000..9373578b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDerivationCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDCS_H +#define DRTDCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for DerivationCodeSequence (0008,9215) + */ +class DCMTK_DCMRT_EXPORT DRTDerivationCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDerivationCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDerivationCodeSequence(const DRTDerivationCodeSequence ©); + + /** destructor + */ + virtual ~DRTDerivationCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDerivationCodeSequence &operator=(const DRTDerivationCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdddps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdddps.h new file mode 100644 index 00000000..efe60a6b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdddps.h @@ -0,0 +1,368 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDeliveredDepthDoseParametersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDDDPS_H +#define DRTDDDPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for DeliveredDepthDoseParametersSequence (300a,0506) + */ +class DCMTK_DCMRT_EXPORT DRTDeliveredDepthDoseParametersSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DeliveredDistalDepth (300a,0508) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredDistalDepth(Float32 &value, const unsigned long pos = 0) const; + + /** get DeliveredDistalDepthFraction (300a,0507) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredDistalDepthFraction(Float32 &value, const unsigned long pos = 0) const; + + /** get DeliveredNominalRangeModulatedRegionDepths (300a,0510) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredNominalRangeModulatedRegionDepths(Float32 &value, const unsigned long pos = 0) const; + + /** get DeliveredNominalRangeModulationFractions (300a,0509) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredNominalRangeModulationFractions(Float32 &value, const unsigned long pos = 0) const; + + /** get DeliveredReferenceDoseDefinition (300a,0511) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredReferenceDoseDefinition(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DeliveredDistalDepth (300a,0508) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredDistalDepth(const Float32 value, const unsigned long pos = 0); + + /** set DeliveredDistalDepthFraction (300a,0507) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredDistalDepthFraction(const Float32 value, const unsigned long pos = 0); + + /** set DeliveredNominalRangeModulatedRegionDepths (300a,0510) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredNominalRangeModulatedRegionDepths(const Float32 value, const unsigned long pos = 0); + + /** set DeliveredNominalRangeModulationFractions (300a,0509) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredNominalRangeModulationFractions(const Float32 value, const unsigned long pos = 0); + + /** set DeliveredReferenceDoseDefinition (300a,0511) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredReferenceDoseDefinition(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DeliveredDistalDepth (300a,0508) vr=FL, vm=1, type=1 + DcmFloatingPointSingle DeliveredDistalDepth; + /// DeliveredDistalDepthFraction (300a,0507) vr=FL, vm=1, type=1 + DcmFloatingPointSingle DeliveredDistalDepthFraction; + /// DeliveredNominalRangeModulatedRegionDepths (300a,0510) vr=FL, vm=2, type=1C + DcmFloatingPointSingle DeliveredNominalRangeModulatedRegionDepths; + /// DeliveredNominalRangeModulationFractions (300a,0509) vr=FL, vm=2, type=1C + DcmFloatingPointSingle DeliveredNominalRangeModulationFractions; + /// DeliveredReferenceDoseDefinition (300a,0511) vr=CS, vm=1, type=1 + DcmCodeString DeliveredReferenceDoseDefinition; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDeliveredDepthDoseParametersSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDeliveredDepthDoseParametersSequence(const DRTDeliveredDepthDoseParametersSequence ©); + + /** destructor + */ + virtual ~DRTDeliveredDepthDoseParametersSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDeliveredDepthDoseParametersSequence &operator=(const DRTDeliveredDepthDoseParametersSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtddps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtddps.h new file mode 100644 index 00000000..647af0b9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtddps.h @@ -0,0 +1,368 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDepthDoseParametersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDDPS_H +#define DRTDDPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for DepthDoseParametersSequence (300a,0505) + */ +class DCMTK_DCMRT_EXPORT DRTDepthDoseParametersSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DistalDepth (300a,0502) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDistalDepth(Float32 &value, const unsigned long pos = 0) const; + + /** get DistalDepthFraction (300a,0501) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDistalDepthFraction(Float32 &value, const unsigned long pos = 0) const; + + /** get NominalRangeModulatedRegionDepths (300a,0504) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalRangeModulatedRegionDepths(Float32 &value, const unsigned long pos = 0) const; + + /** get NominalRangeModulationFractions (300a,0503) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalRangeModulationFractions(Float32 &value, const unsigned long pos = 0) const; + + /** get ReferenceDoseDefinition (300a,0512) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferenceDoseDefinition(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DistalDepth (300a,0502) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDistalDepth(const Float32 value, const unsigned long pos = 0); + + /** set DistalDepthFraction (300a,0501) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDistalDepthFraction(const Float32 value, const unsigned long pos = 0); + + /** set NominalRangeModulatedRegionDepths (300a,0504) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNominalRangeModulatedRegionDepths(const Float32 value, const unsigned long pos = 0); + + /** set NominalRangeModulationFractions (300a,0503) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNominalRangeModulationFractions(const Float32 value, const unsigned long pos = 0); + + /** set ReferenceDoseDefinition (300a,0512) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferenceDoseDefinition(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DistalDepth (300a,0502) vr=FL, vm=1, type=1 + DcmFloatingPointSingle DistalDepth; + /// DistalDepthFraction (300a,0501) vr=FL, vm=1, type=1 + DcmFloatingPointSingle DistalDepthFraction; + /// NominalRangeModulatedRegionDepths (300a,0504) vr=FL, vm=2, type=1C + DcmFloatingPointSingle NominalRangeModulatedRegionDepths; + /// NominalRangeModulationFractions (300a,0503) vr=FL, vm=2, type=1C + DcmFloatingPointSingle NominalRangeModulationFractions; + /// ReferenceDoseDefinition (300a,0512) vr=CS, vm=1, type=1 + DcmCodeString ReferenceDoseDefinition; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDepthDoseParametersSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDepthDoseParametersSequence(const DRTDepthDoseParametersSequence ©); + + /** destructor + */ + virtual ~DRTDepthDoseParametersSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDepthDoseParametersSequence &operator=(const DRTDepthDoseParametersSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdias.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdias.h new file mode 100644 index 00000000..c83d4ef8 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdias.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDeidentificationActionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDIAS_H +#define DRTDIAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for DeidentificationActionSequence (0008,0305) + */ +class DCMTK_DCMRT_EXPORT DRTDeidentificationActionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DeidentificationAction (0008,0307) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeidentificationAction(OFString &value, const signed long pos = 0) const; + + /** get IdentifyingPrivateElements (0008,0306) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIdentifyingPrivateElements(Uint16 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DeidentificationAction (0008,0307) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeidentificationAction(const OFString &value, const OFBool check = OFTrue); + + /** set IdentifyingPrivateElements (0008,0306) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIdentifyingPrivateElements(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DeidentificationAction (0008,0307) vr=CS, vm=1, type=1 + DcmCodeString DeidentificationAction; + /// IdentifyingPrivateElements (0008,0306) vr=US, vm=1-n, type=1 + DcmUnsignedShort IdentifyingPrivateElements; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDeidentificationActionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDeidentificationActionSequence(const DRTDeidentificationActionSequence ©); + + /** destructor + */ + virtual ~DRTDeidentificationActionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDeidentificationActionSequence &operator=(const DRTDeidentificationActionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdimcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdimcs.h new file mode 100644 index 00000000..bc3a7c97 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdimcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDeidentificationMethodCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDIMCS_H +#define DRTDIMCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for DeidentificationMethodCodeSequence (0012,0064) + */ +class DCMTK_DCMRT_EXPORT DRTDeidentificationMethodCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDeidentificationMethodCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDeidentificationMethodCodeSequence(const DRTDeidentificationMethodCodeSequence ©); + + /** destructor + */ + virtual ~DRTDeidentificationMethodCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDeidentificationMethodCodeSequence &operator=(const DRTDeidentificationMethodCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdimrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdimrs.h new file mode 100644 index 00000000..306f0bee --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdimrs.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDICOMMediaRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDIMRS_H +#define DRTDIMRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for DICOMMediaRetrievalSequence (0040,e022) + */ +class DCMTK_DCMRT_EXPORT DRTDICOMMediaRetrievalSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get StorageMediaFileSetID (0088,0130) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStorageMediaFileSetID(OFString &value, const signed long pos = 0) const; + + /** get StorageMediaFileSetUID (0088,0140) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStorageMediaFileSetUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set StorageMediaFileSetID (0088,0130) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStorageMediaFileSetID(const OFString &value, const OFBool check = OFTrue); + + /** set StorageMediaFileSetUID (0088,0140) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStorageMediaFileSetUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// StorageMediaFileSetID (0088,0130) vr=SH, vm=1, type=2 + DcmShortString StorageMediaFileSetID; + /// StorageMediaFileSetUID (0088,0140) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StorageMediaFileSetUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDICOMMediaRetrievalSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDICOMMediaRetrievalSequence(const DRTDICOMMediaRetrievalSequence ©); + + /** destructor + */ + virtual ~DRTDICOMMediaRetrievalSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDICOMMediaRetrievalSequence &operator=(const DRTDICOMMediaRetrievalSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdirs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdirs.h new file mode 100644 index 00000000..4e53d18b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdirs.h @@ -0,0 +1,304 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDICOMRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDIRS_H +#define DRTDIRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for DICOMRetrievalSequence (0040,e021) + */ +class DCMTK_DCMRT_EXPORT DRTDICOMRetrievalSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RetrieveAETitle (0008,0054) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRetrieveAETitle(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RetrieveAETitle (0008,0054) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (AE) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRetrieveAETitle(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RetrieveAETitle (0008,0054) vr=AE, vm=1-n, type=1 + DcmApplicationEntity RetrieveAETitle; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDICOMRetrievalSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDICOMRetrievalSequence(const DRTDICOMRetrievalSequence ©); + + /** destructor + */ + virtual ~DRTDICOMRetrievalSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDICOMRetrievalSequence &operator=(const DRTDICOMRetrievalSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdrs.h new file mode 100644 index 00000000..154254fc --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdrs.h @@ -0,0 +1,703 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDRS_H +#define DRTDRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for DoseReferenceSequence (300a,0010) + */ +class DCMTK_DCMRT_EXPORT DRTDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ConstraintWeight (300a,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getConstraintWeight(OFString &value, const signed long pos = 0) const; + + /** get ConstraintWeight (300a,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getConstraintWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get DeliveryMaximumDose (300a,0023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryMaximumDose(OFString &value, const signed long pos = 0) const; + + /** get DeliveryMaximumDose (300a,0023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryMaximumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get DeliveryWarningDose (300a,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryWarningDose(OFString &value, const signed long pos = 0) const; + + /** get DeliveryWarningDose (300a,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryWarningDose(Float64 &value, const unsigned long pos = 0) const; + + /** get DoseReferenceDescription (300a,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceDescription(OFString &value, const signed long pos = 0) const; + + /** get DoseReferenceNumber (300a,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get DoseReferenceNumber (300a,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get DoseReferencePointCoordinates (300a,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferencePointCoordinates(OFString &value, const signed long pos = 0) const; + + /** get DoseReferencePointCoordinates (300a,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferencePointCoordinates(Float64 &value, const unsigned long pos = 0) const; + + /** get DoseReferencePointCoordinates (300a,0018) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferencePointCoordinates(OFVector &value) const; + + /** get DoseReferenceStructureType (300a,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceStructureType(OFString &value, const signed long pos = 0) const; + + /** get DoseReferenceType (300a,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceType(OFString &value, const signed long pos = 0) const; + + /** get DoseReferenceUID (300a,0013) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceUID(OFString &value, const signed long pos = 0) const; + + /** get NominalPriorDose (300a,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalPriorDose(OFString &value, const signed long pos = 0) const; + + /** get NominalPriorDose (300a,001a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalPriorDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskFullVolumeDose (300a,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskFullVolumeDose(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskFullVolumeDose (300a,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskFullVolumeDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskLimitDose (300a,002b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskLimitDose(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskLimitDose (300a,002b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskLimitDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskMaximumDose (300a,002c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskMaximumDose(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskMaximumDose (300a,002c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskMaximumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskOverdoseVolumeFraction (300a,002d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskOverdoseVolumeFraction(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskOverdoseVolumeFraction (300a,002d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskOverdoseVolumeFraction(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get TargetMaximumDose (300a,0027) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMaximumDose(OFString &value, const signed long pos = 0) const; + + /** get TargetMaximumDose (300a,0027) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMaximumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get TargetMinimumDose (300a,0025) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMinimumDose(OFString &value, const signed long pos = 0) const; + + /** get TargetMinimumDose (300a,0025) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMinimumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get TargetPrescriptionDose (300a,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetPrescriptionDose(OFString &value, const signed long pos = 0) const; + + /** get TargetPrescriptionDose (300a,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetPrescriptionDose(Float64 &value, const unsigned long pos = 0) const; + + /** get TargetUnderdoseVolumeFraction (300a,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetUnderdoseVolumeFraction(OFString &value, const signed long pos = 0) const; + + /** get TargetUnderdoseVolumeFraction (300a,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetUnderdoseVolumeFraction(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ConstraintWeight (300a,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setConstraintWeight(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveryMaximumDose (300a,0023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveryMaximumDose(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveryWarningDose (300a,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveryWarningDose(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferenceDescription (300a,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferenceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferenceNumber (300a,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferencePointCoordinates (300a,0018) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferencePointCoordinates(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferenceStructureType (300a,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferenceStructureType(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferenceType (300a,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferenceType(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferenceUID (300a,0013) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferenceUID(const OFString &value, const OFBool check = OFTrue); + + /** set NominalPriorDose (300a,001a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNominalPriorDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskFullVolumeDose (300a,002a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskFullVolumeDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskLimitDose (300a,002b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskLimitDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskMaximumDose (300a,002c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskMaximumDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskOverdoseVolumeFraction (300a,002d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskOverdoseVolumeFraction(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + /** set TargetMaximumDose (300a,0027) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetMaximumDose(const OFString &value, const OFBool check = OFTrue); + + /** set TargetMinimumDose (300a,0025) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetMinimumDose(const OFString &value, const OFBool check = OFTrue); + + /** set TargetPrescriptionDose (300a,0026) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetPrescriptionDose(const OFString &value, const OFBool check = OFTrue); + + /** set TargetUnderdoseVolumeFraction (300a,0028) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetUnderdoseVolumeFraction(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ConstraintWeight (300a,0021) vr=DS, vm=1, type=3 + DcmDecimalString ConstraintWeight; + /// DeliveryMaximumDose (300a,0023) vr=DS, vm=1, type=3 + DcmDecimalString DeliveryMaximumDose; + /// DeliveryWarningDose (300a,0022) vr=DS, vm=1, type=3 + DcmDecimalString DeliveryWarningDose; + /// DoseReferenceDescription (300a,0016) vr=LO, vm=1, type=3 + DcmLongString DoseReferenceDescription; + /// DoseReferenceNumber (300a,0012) vr=IS, vm=1, type=1 + DcmIntegerString DoseReferenceNumber; + /// DoseReferencePointCoordinates (300a,0018) vr=DS, vm=3, type=1C + DcmDecimalString DoseReferencePointCoordinates; + /// DoseReferenceStructureType (300a,0014) vr=CS, vm=1, type=1 + DcmCodeString DoseReferenceStructureType; + /// DoseReferenceType (300a,0020) vr=CS, vm=1, type=1 + DcmCodeString DoseReferenceType; + /// DoseReferenceUID (300a,0013) vr=UI, vm=1, type=3 + DcmUniqueIdentifier DoseReferenceUID; + /// NominalPriorDose (300a,001a) vr=DS, vm=1, type=3 + DcmDecimalString NominalPriorDose; + /// OrganAtRiskFullVolumeDose (300a,002a) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskFullVolumeDose; + /// OrganAtRiskLimitDose (300a,002b) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskLimitDose; + /// OrganAtRiskMaximumDose (300a,002c) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskMaximumDose; + /// OrganAtRiskOverdoseVolumeFraction (300a,002d) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskOverdoseVolumeFraction; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedROINumber; + /// TargetMaximumDose (300a,0027) vr=DS, vm=1, type=3 + DcmDecimalString TargetMaximumDose; + /// TargetMinimumDose (300a,0025) vr=DS, vm=1, type=3 + DcmDecimalString TargetMinimumDose; + /// TargetPrescriptionDose (300a,0026) vr=DS, vm=1, type=3 + DcmDecimalString TargetPrescriptionDose; + /// TargetUnderdoseVolumeFraction (300a,0028) vr=DS, vm=1, type=3 + DcmDecimalString TargetUnderdoseVolumeFraction; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDoseReferenceSequence(const DRTDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDoseReferenceSequence &operator=(const DRTDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtds.h new file mode 100644 index 00000000..5bc24083 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtds.h @@ -0,0 +1,733 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDS_H +#define DRTDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for DeviceSequence (0050,0010) + */ +class DCMTK_DCMRT_EXPORT DRTDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get DeviceDescription (0050,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceDescription(OFString &value, const signed long pos = 0) const; + + /** get DeviceDiameter (0050,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceDiameter(OFString &value, const signed long pos = 0) const; + + /** get DeviceDiameter (0050,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceDiameter(Float64 &value, const unsigned long pos = 0) const; + + /** get DeviceDiameterUnits (0050,0017) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceDiameterUnits(OFString &value, const signed long pos = 0) const; + + /** get DeviceID (0018,1003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceID(OFString &value, const signed long pos = 0) const; + + /** get DeviceLength (0050,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceLength(OFString &value, const signed long pos = 0) const; + + /** get DeviceLength (0050,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceLength(Float64 &value, const unsigned long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get DeviceVolume (0050,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceVolume(OFString &value, const signed long pos = 0) const; + + /** get DeviceVolume (0050,0018) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceVolume(Float64 &value, const unsigned long pos = 0) const; + + /** get InterMarkerDistance (0050,0019) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInterMarkerDistance(OFString &value, const signed long pos = 0) const; + + /** get InterMarkerDistance (0050,0019) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInterMarkerDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceDescription (0050,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceDiameter (0050,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceDiameter(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceDiameterUnits (0050,0017) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceDiameterUnits(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceID (0018,1003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceID(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceLength (0050,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceLength(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceVolume (0050,0018) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceVolume(const OFString &value, const OFBool check = OFTrue); + + /** set InterMarkerDistance (0050,0019) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInterMarkerDistance(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// DeviceDescription (0050,0020) vr=LO, vm=1, type=3 + DcmLongString DeviceDescription; + /// DeviceDiameter (0050,0016) vr=DS, vm=1, type=3 + DcmDecimalString DeviceDiameter; + /// DeviceDiameterUnits (0050,0017) vr=CS, vm=1, type=2C + DcmCodeString DeviceDiameterUnits; + /// DeviceID (0018,1003) vr=LO, vm=1, type=3 + DcmLongString DeviceID; + /// DeviceLength (0050,0014) vr=DS, vm=1, type=3 + DcmDecimalString DeviceLength; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// DeviceVolume (0050,0018) vr=DS, vm=1, type=3 + DcmDecimalString DeviceVolume; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// InterMarkerDistance (0050,0019) vr=DS, vm=1, type=3 + DcmDecimalString InterMarkerDistance; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// Manufacturer (0008,0070) vr=LO, vm=1, type=3 + DcmLongString Manufacturer; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDeviceSequence(const DRTDeviceSequence ©); + + /** destructor + */ + virtual ~DRTDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDeviceSequence &operator=(const DRTDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdspcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdspcs.h new file mode 100644 index 00000000..f6d5464d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdspcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDigitalSignaturePurposeCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDSPCS_H +#define DRTDSPCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for DigitalSignaturePurposeCodeSequence (0400,0401) + */ +class DCMTK_DCMRT_EXPORT DRTDigitalSignaturePurposeCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDigitalSignaturePurposeCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDigitalSignaturePurposeCodeSequence(const DRTDigitalSignaturePurposeCodeSequence ©); + + /** destructor + */ + virtual ~DRTDigitalSignaturePurposeCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDigitalSignaturePurposeCodeSequence &operator=(const DRTDigitalSignaturePurposeCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdss.h new file mode 100644 index 00000000..f1603c08 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdss.h @@ -0,0 +1,433 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDigitalSignaturesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDSS_H +#define DRTDSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtdspcs.h" // for DigitalSignaturePurposeCodeSequence + + +/** Interface class for DigitalSignaturesSequence (fffa,fffa) + */ +class DCMTK_DCMRT_EXPORT DRTDigitalSignaturesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CertificateOfSigner (0400,0115) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCertificateOfSigner(Uint8 *&value, unsigned long *count = NULL) const; + + /** get CertificateType (0400,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCertificateType(OFString &value, const signed long pos = 0) const; + + /** get CertifiedTimestamp (0400,0310) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCertifiedTimestamp(Uint8 *&value, unsigned long *count = NULL) const; + + /** get CertifiedTimestampType (0400,0305) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCertifiedTimestampType(OFString &value, const signed long pos = 0) const; + + /** get DigitalSignatureDateTime (0400,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDigitalSignatureDateTime(OFString &value, const signed long pos = 0) const; + + /** get DigitalSignatureUID (0400,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDigitalSignatureUID(OFString &value, const signed long pos = 0) const; + + /** get MACIDNumber (0400,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMACIDNumber(Uint16 &value, const unsigned long pos = 0) const; + + /** get Signature (0400,0120) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSignature(Uint8 *&value, unsigned long *count = NULL) const; + + // --- get DICOM sequence attributes --- + + /** get DigitalSignaturePurposeCodeSequence (0400,0401) + * @return reference to sequence element + */ + DRTDigitalSignaturePurposeCodeSequence &getDigitalSignaturePurposeCodeSequence() + { return DigitalSignaturePurposeCodeSequence; } + + /** get DigitalSignaturePurposeCodeSequence (0400,0401) + * @return const reference to sequence element + */ + const DRTDigitalSignaturePurposeCodeSequence &getDigitalSignaturePurposeCodeSequence() const + { return DigitalSignaturePurposeCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CertificateOfSigner (0400,0115) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCertificateOfSigner(const Uint8 *value, const unsigned long count); + + /** set CertificateType (0400,0110) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCertificateType(const OFString &value, const OFBool check = OFTrue); + + /** set CertifiedTimestamp (0400,0310) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCertifiedTimestamp(const Uint8 *value, const unsigned long count); + + /** set CertifiedTimestampType (0400,0305) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCertifiedTimestampType(const OFString &value, const OFBool check = OFTrue); + + /** set DigitalSignatureDateTime (0400,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDigitalSignatureDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set DigitalSignatureUID (0400,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDigitalSignatureUID(const OFString &value, const OFBool check = OFTrue); + + /** set MACIDNumber (0400,0005) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMACIDNumber(const Uint16 value, const unsigned long pos = 0); + + /** set Signature (0400,0120) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSignature(const Uint8 *value, const unsigned long count); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CertificateOfSigner (0400,0115) vr=OB, vm=1, type=1 + DcmOtherByteOtherWord CertificateOfSigner; + /// CertificateType (0400,0110) vr=CS, vm=1, type=1 + DcmCodeString CertificateType; + /// CertifiedTimestamp (0400,0310) vr=OB, vm=1, type=3 + DcmOtherByteOtherWord CertifiedTimestamp; + /// CertifiedTimestampType (0400,0305) vr=CS, vm=1, type=1C + DcmCodeString CertifiedTimestampType; + /// DigitalSignatureDateTime (0400,0105) vr=DT, vm=1, type=1 + DcmDateTime DigitalSignatureDateTime; + /// DigitalSignaturePurposeCodeSequence (0400,0401) vr=SQ, vm=1, type=3 + DRTDigitalSignaturePurposeCodeSequence DigitalSignaturePurposeCodeSequence; + /// DigitalSignatureUID (0400,0100) vr=UI, vm=1, type=1 + DcmUniqueIdentifier DigitalSignatureUID; + /// MACIDNumber (0400,0005) vr=US, vm=1, type=1 + DcmUnsignedShort MACIDNumber; + /// Signature (0400,0120) vr=OB, vm=1, type=1 + DcmOtherByteOtherWord Signature; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDigitalSignaturesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDigitalSignaturesSequence(const DRTDigitalSignaturesSequence ©); + + /** destructor + */ + virtual ~DRTDigitalSignaturesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDigitalSignaturesSequence &operator=(const DRTDigitalSignaturesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdvhs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdvhs.h new file mode 100644 index 00000000..4e09143e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdvhs.h @@ -0,0 +1,513 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDVHSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDVHS_H +#define DRTDVHS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtdvrrs.h" // for DVHReferencedROISequence + + +/** Interface class for DVHSequence (3004,0050) + */ +class DCMTK_DCMRT_EXPORT DRTDVHSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DVHData (3004,0058) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHData(OFString &value, const signed long pos = 0) const; + + /** get DVHData (3004,0058) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHData(Float64 &value, const unsigned long pos = 0) const; + + /** get DVHData (3004,0058) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHData(OFVector &value) const; + + /** get DVHDoseScaling (3004,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHDoseScaling(OFString &value, const signed long pos = 0) const; + + /** get DVHDoseScaling (3004,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHDoseScaling(Float64 &value, const unsigned long pos = 0) const; + + /** get DVHMaximumDose (3004,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHMaximumDose(OFString &value, const signed long pos = 0) const; + + /** get DVHMaximumDose (3004,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHMaximumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get DVHMeanDose (3004,0074) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHMeanDose(OFString &value, const signed long pos = 0) const; + + /** get DVHMeanDose (3004,0074) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHMeanDose(Float64 &value, const unsigned long pos = 0) const; + + /** get DVHMinimumDose (3004,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHMinimumDose(OFString &value, const signed long pos = 0) const; + + /** get DVHMinimumDose (3004,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHMinimumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get DVHNumberOfBins (3004,0056) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHNumberOfBins(OFString &value, const signed long pos = 0) const; + + /** get DVHNumberOfBins (3004,0056) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHNumberOfBins(Sint32 &value, const unsigned long pos = 0) const; + + /** get DVHType (3004,0001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHType(OFString &value, const signed long pos = 0) const; + + /** get DVHVolumeUnits (3004,0054) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHVolumeUnits(OFString &value, const signed long pos = 0) const; + + /** get DoseType (3004,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseType(OFString &value, const signed long pos = 0) const; + + /** get DoseUnits (3004,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseUnits(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get DVHReferencedROISequence (3004,0060) + * @return reference to sequence element + */ + DRTDVHReferencedROISequence &getDVHReferencedROISequence() + { return DVHReferencedROISequence; } + + /** get DVHReferencedROISequence (3004,0060) + * @return const reference to sequence element + */ + const DRTDVHReferencedROISequence &getDVHReferencedROISequence() const + { return DVHReferencedROISequence; } + + // --- set DICOM attribute values --- + + /** set DVHData (3004,0058) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-2n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHData(const OFString &value, const OFBool check = OFTrue); + + /** set DVHDoseScaling (3004,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHDoseScaling(const OFString &value, const OFBool check = OFTrue); + + /** set DVHMaximumDose (3004,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHMaximumDose(const OFString &value, const OFBool check = OFTrue); + + /** set DVHMeanDose (3004,0074) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHMeanDose(const OFString &value, const OFBool check = OFTrue); + + /** set DVHMinimumDose (3004,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHMinimumDose(const OFString &value, const OFBool check = OFTrue); + + /** set DVHNumberOfBins (3004,0056) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHNumberOfBins(const OFString &value, const OFBool check = OFTrue); + + /** set DVHType (3004,0001) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHType(const OFString &value, const OFBool check = OFTrue); + + /** set DVHVolumeUnits (3004,0054) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHVolumeUnits(const OFString &value, const OFBool check = OFTrue); + + /** set DoseType (3004,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseType(const OFString &value, const OFBool check = OFTrue); + + /** set DoseUnits (3004,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseUnits(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DVHData (3004,0058) vr=DS, vm=2-2n, type=1 + DcmDecimalString DVHData; + /// DVHDoseScaling (3004,0052) vr=DS, vm=1, type=1 + DcmDecimalString DVHDoseScaling; + /// DVHMaximumDose (3004,0072) vr=DS, vm=1, type=3 + DcmDecimalString DVHMaximumDose; + /// DVHMeanDose (3004,0074) vr=DS, vm=1, type=3 + DcmDecimalString DVHMeanDose; + /// DVHMinimumDose (3004,0070) vr=DS, vm=1, type=3 + DcmDecimalString DVHMinimumDose; + /// DVHNumberOfBins (3004,0056) vr=IS, vm=1, type=1 + DcmIntegerString DVHNumberOfBins; + /// DVHReferencedROISequence (3004,0060) vr=SQ, vm=1, type=1 + DRTDVHReferencedROISequence DVHReferencedROISequence; + /// DVHType (3004,0001) vr=CS, vm=1, type=1 + DcmCodeString DVHType; + /// DVHVolumeUnits (3004,0054) vr=CS, vm=1, type=1 + DcmCodeString DVHVolumeUnits; + /// DoseType (3004,0004) vr=CS, vm=1, type=1 + DcmCodeString DoseType; + /// DoseUnits (3004,0002) vr=CS, vm=1, type=1 + DcmCodeString DoseUnits; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDVHSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDVHSequence(const DRTDVHSequence ©); + + /** destructor + */ + virtual ~DRTDVHSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDVHSequence &operator=(const DRTDVHSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtdvrrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtdvrrs.h new file mode 100644 index 00000000..8067a75e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtdvrrs.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTDVHReferencedROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTDVRRS_H +#define DRTDVRRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for DVHReferencedROISequence (3004,0060) + */ +class DCMTK_DCMRT_EXPORT DRTDVHReferencedROISequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DVHROIContributionType (3004,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDVHROIContributionType(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DVHROIContributionType (3004,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDVHROIContributionType(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DVHROIContributionType (3004,0062) vr=CS, vm=1, type=1 + DcmCodeString DVHROIContributionType; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTDVHReferencedROISequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTDVHReferencedROISequence(const DRTDVHReferencedROISequence ©); + + /** destructor + */ + virtual ~DRTDVHReferencedROISequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTDVHReferencedROISequence &operator=(const DRTDVHReferencedROISequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drteas.h b/dcmrt/include/dcmtk/dcmrt/seq/drteas.h new file mode 100644 index 00000000..5ed36da2 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drteas.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTEncryptedAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTEAS_H +#define DRTEAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for EncryptedAttributesSequence (0400,0500) + */ +class DCMTK_DCMRT_EXPORT DRTEncryptedAttributesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get EncryptedContent (0400,0520) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEncryptedContent(Uint8 *&value, unsigned long *count = NULL) const; + + /** get EncryptedContentTransferSyntaxUID (0400,0510) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEncryptedContentTransferSyntaxUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set EncryptedContent (0400,0520) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEncryptedContent(const Uint8 *value, const unsigned long count); + + /** set EncryptedContentTransferSyntaxUID (0400,0510) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEncryptedContentTransferSyntaxUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// EncryptedContent (0400,0520) vr=OB, vm=1, type=1 + DcmOtherByteOtherWord EncryptedContent; + /// EncryptedContentTransferSyntaxUID (0400,0510) vr=UI, vm=1, type=1 + DcmUniqueIdentifier EncryptedContentTransferSyntaxUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTEncryptedAttributesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTEncryptedAttributesSequence(const DRTEncryptedAttributesSequence ©); + + /** destructor + */ + virtual ~DRTEncryptedAttributesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTEncryptedAttributesSequence &operator=(const DRTEncryptedAttributesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtecs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtecs.h new file mode 100644 index 00000000..738d2388 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtecs.h @@ -0,0 +1,528 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTEquivalentCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTECS_H +#define DRTECS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for EquivalentCodeSequence (0008,0121) + */ +class DCMTK_DCMRT_EXPORT DRTEquivalentCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTEquivalentCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTEquivalentCodeSequence(const DRTEquivalentCodeSequence ©); + + /** destructor + */ + virtual ~DRTEquivalentCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTEquivalentCodeSequence &operator=(const DRTEquivalentCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtes.h b/dcmrt/include/dcmtk/dcmrt/seq/drtes.h new file mode 100644 index 00000000..4106135e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtes.h @@ -0,0 +1,750 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTExposureSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTES_H +#define DRTES_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtas5.h" // for ApplicatorSequence +#include "dcmtk/dcmrt/seq/drtblds5.h" // for BeamLimitingDeviceSequence +#include "dcmtk/dcmrt/seq/drtbl5.h" // for BlockSequence +#include "dcmtk/dcmrt/seq/drtgas.h" // for GeneralAccessorySequence +#include "dcmtk/dcmrt/seq/drtpfms.h" // for PrimaryFluenceModeSequence + + +/** Interface class for ExposureSequence (3002,0030) in RTImageModule + */ +class DCMTK_DCMRT_EXPORT DRTExposureSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get DiaphragmPosition (3002,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDiaphragmPosition(OFString &value, const signed long pos = 0) const; + + /** get DiaphragmPosition (3002,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDiaphragmPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get DiaphragmPosition (3002,0034) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDiaphragmPosition(OFVector &value) const; + + /** get ExposureTime (0018,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getExposureTime(OFString &value, const signed long pos = 0) const; + + /** get ExposureTime (0018,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getExposureTime(Sint32 &value, const unsigned long pos = 0) const; + + /** get ExposureTimeInms (0018,9328) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getExposureTimeInms(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(OFString &value, const signed long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryPitchAngle (300a,014a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get KVP (0018,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getKVP(OFString &value, const signed long pos = 0) const; + + /** get KVP (0018,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getKVP(Float64 &value, const unsigned long pos = 0) const; + + /** get MetersetExposure (3002,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMetersetExposure(OFString &value, const signed long pos = 0) const; + + /** get MetersetExposure (3002,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMetersetExposure(Float64 &value, const unsigned long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(Sint32 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchAngle (300a,0140) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopRollAngle (300a,0144) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get XRayTubeCurrent (0018,1151) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getXRayTubeCurrent(OFString &value, const signed long pos = 0) const; + + /** get XRayTubeCurrent (0018,1151) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getXRayTubeCurrent(Sint32 &value, const unsigned long pos = 0) const; + + /** get XRayTubeCurrentInmA (0018,9330) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getXRayTubeCurrentInmA(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ApplicatorSequence (300a,0107) + * @return reference to sequence element + */ + DRTApplicatorSequenceInRTImageModule &getApplicatorSequence() + { return ApplicatorSequence; } + + /** get ApplicatorSequence (300a,0107) + * @return const reference to sequence element + */ + const DRTApplicatorSequenceInRTImageModule &getApplicatorSequence() const + { return ApplicatorSequence; } + + /** get BeamLimitingDeviceSequence (300a,00b6) + * @return reference to sequence element + */ + DRTBeamLimitingDeviceSequenceInRTImageModule &getBeamLimitingDeviceSequence() + { return BeamLimitingDeviceSequence; } + + /** get BeamLimitingDeviceSequence (300a,00b6) + * @return const reference to sequence element + */ + const DRTBeamLimitingDeviceSequenceInRTImageModule &getBeamLimitingDeviceSequence() const + { return BeamLimitingDeviceSequence; } + + /** get BlockSequence (300a,00f4) + * @return reference to sequence element + */ + DRTBlockSequenceInRTImageModule &getBlockSequence() + { return BlockSequence; } + + /** get BlockSequence (300a,00f4) + * @return const reference to sequence element + */ + const DRTBlockSequenceInRTImageModule &getBlockSequence() const + { return BlockSequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return reference to sequence element + */ + DRTGeneralAccessorySequence &getGeneralAccessorySequence() + { return GeneralAccessorySequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return const reference to sequence element + */ + const DRTGeneralAccessorySequence &getGeneralAccessorySequence() const + { return GeneralAccessorySequence; } + + /** get PrimaryFluenceModeSequence (3002,0050) + * @return reference to sequence element + */ + DRTPrimaryFluenceModeSequence &getPrimaryFluenceModeSequence() + { return PrimaryFluenceModeSequence; } + + /** get PrimaryFluenceModeSequence (3002,0050) + * @return const reference to sequence element + */ + const DRTPrimaryFluenceModeSequence &getPrimaryFluenceModeSequence() const + { return PrimaryFluenceModeSequence; } + + // --- set DICOM attribute values --- + + /** set BeamLimitingDeviceAngle (300a,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceAngle(const OFString &value, const OFBool check = OFTrue); + + /** set DiaphragmPosition (3002,0034) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (4) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDiaphragmPosition(const OFString &value, const OFBool check = OFTrue); + + /** set ExposureTime (0018,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setExposureTime(const OFString &value, const OFBool check = OFTrue); + + /** set ExposureTimeInms (0018,9328) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setExposureTimeInms(const Float64 value, const unsigned long pos = 0); + + /** set GantryAngle (300a,011e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryAngle(const OFString &value, const OFBool check = OFTrue); + + /** set GantryPitchAngle (300a,014a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set KVP (0018,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setKVP(const OFString &value, const OFBool check = OFTrue); + + /** set MetersetExposure (3002,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMetersetExposure(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBlocks (300a,00f0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBlocks(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAngle (300a,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAngle(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedFrameNumber (0008,1160) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameNumber(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLateralPosition (300a,012a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLateralPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalPosition (300a,0129) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLongitudinalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopPitchAngle (300a,0140) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopRollAngle (300a,0144) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopVerticalPosition (300a,0128) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopVerticalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set XRayTubeCurrent (0018,1151) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setXRayTubeCurrent(const OFString &value, const OFBool check = OFTrue); + + /** set XRayTubeCurrentInmA (0018,9330) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setXRayTubeCurrentInmA(const Float64 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ApplicatorSequence (300a,0107) vr=SQ, vm=1, type=3 + DRTApplicatorSequenceInRTImageModule ApplicatorSequence; + /// BeamLimitingDeviceAngle (300a,0120) vr=DS, vm=1, type=3 + DcmDecimalString BeamLimitingDeviceAngle; + /// BeamLimitingDeviceSequence (300a,00b6) vr=SQ, vm=1, type=3 + DRTBeamLimitingDeviceSequenceInRTImageModule BeamLimitingDeviceSequence; + /// BlockSequence (300a,00f4) vr=SQ, vm=1, type=2C + DRTBlockSequenceInRTImageModule BlockSequence; + /// DiaphragmPosition (3002,0034) vr=DS, vm=4, type=3 + DcmDecimalString DiaphragmPosition; + /// ExposureTime (0018,1150) vr=IS, vm=1, type=2C + DcmIntegerString ExposureTime; + /// ExposureTimeInms (0018,9328) vr=FD, vm=1, type=3 + DcmFloatingPointDouble ExposureTimeInms; + /// GantryAngle (300a,011e) vr=DS, vm=1, type=3 + DcmDecimalString GantryAngle; + /// GantryPitchAngle (300a,014a) vr=FL, vm=1, type=3 + DcmFloatingPointSingle GantryPitchAngle; + /// GeneralAccessorySequence (300a,0420) vr=SQ, vm=1, type=3 + DRTGeneralAccessorySequence GeneralAccessorySequence; + /// KVP (0018,0060) vr=DS, vm=1, type=2C + DcmDecimalString KVP; + /// MetersetExposure (3002,0032) vr=DS, vm=1, type=2C + DcmDecimalString MetersetExposure; + /// NumberOfBlocks (300a,00f0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBlocks; + /// PatientSupportAngle (300a,0122) vr=DS, vm=1, type=3 + DcmDecimalString PatientSupportAngle; + /// PrimaryFluenceModeSequence (3002,0050) vr=SQ, vm=1, type=3 + DRTPrimaryFluenceModeSequence PrimaryFluenceModeSequence; + /// ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C + DcmIntegerString ReferencedFrameNumber; + /// TableTopLateralPosition (300a,012a) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLateralPosition; + /// TableTopLongitudinalPosition (300a,0129) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLongitudinalPosition; + /// TableTopPitchAngle (300a,0140) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopPitchAngle; + /// TableTopRollAngle (300a,0144) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopRollAngle; + /// TableTopVerticalPosition (300a,0128) vr=DS, vm=1, type=3 + DcmDecimalString TableTopVerticalPosition; + /// XRayTubeCurrent (0018,1151) vr=IS, vm=1, type=2C + DcmIntegerString XRayTubeCurrent; + /// XRayTubeCurrentInmA (0018,9330) vr=FD, vm=1, type=3 + DcmFloatingPointDouble XRayTubeCurrentInmA; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTExposureSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTExposureSequence(const DRTExposureSequence ©); + + /** destructor + */ + virtual ~DRTExposureSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTExposureSequence &operator=(const DRTExposureSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtfds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtfds.h new file mode 100644 index 00000000..dc784f79 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtfds.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTFixationDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTFDS_H +#define DRTFDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for FixationDeviceSequence (300a,0190) + */ +class DCMTK_DCMRT_EXPORT DRTFixationDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get FixationDeviceDescription (300a,0196) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationDeviceDescription(OFString &value, const signed long pos = 0) const; + + /** get FixationDeviceLabel (300a,0194) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationDeviceLabel(OFString &value, const signed long pos = 0) const; + + /** get FixationDevicePitchAngle (300a,0199) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationDevicePitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get FixationDevicePosition (300a,0198) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationDevicePosition(OFString &value, const signed long pos = 0) const; + + /** get FixationDeviceRollAngle (300a,019a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationDeviceRollAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get FixationDeviceType (300a,0192) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationDeviceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set FixationDeviceDescription (300a,0196) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationDeviceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set FixationDeviceLabel (300a,0194) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationDeviceLabel(const OFString &value, const OFBool check = OFTrue); + + /** set FixationDevicePitchAngle (300a,0199) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationDevicePitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set FixationDevicePosition (300a,0198) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationDevicePosition(const OFString &value, const OFBool check = OFTrue); + + /** set FixationDeviceRollAngle (300a,019a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationDeviceRollAngle(const Float32 value, const unsigned long pos = 0); + + /** set FixationDeviceType (300a,0192) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationDeviceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// FixationDeviceDescription (300a,0196) vr=ST, vm=1, type=3 + DcmShortText FixationDeviceDescription; + /// FixationDeviceLabel (300a,0194) vr=SH, vm=1, type=2 + DcmShortString FixationDeviceLabel; + /// FixationDevicePitchAngle (300a,0199) vr=FL, vm=1, type=3 + DcmFloatingPointSingle FixationDevicePitchAngle; + /// FixationDevicePosition (300a,0198) vr=SH, vm=1, type=3 + DcmShortString FixationDevicePosition; + /// FixationDeviceRollAngle (300a,019a) vr=FL, vm=1, type=3 + DcmFloatingPointSingle FixationDeviceRollAngle; + /// FixationDeviceType (300a,0192) vr=CS, vm=1, type=1 + DcmCodeString FixationDeviceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTFixationDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTFixationDeviceSequence(const DRTFixationDeviceSequence ©); + + /** destructor + */ + virtual ~DRTFixationDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTFixationDeviceSequence &operator=(const DRTFixationDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtfes.h b/dcmrt/include/dcmtk/dcmrt/seq/drtfes.h new file mode 100644 index 00000000..50f621b9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtfes.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTFrameExtractionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTFES_H +#define DRTFES_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for FrameExtractionSequence (0008,1164) + */ +class DCMTK_DCMRT_EXPORT DRTFrameExtractionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CalculatedFrameList (0008,1162) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedFrameList(Uint32 &value, const unsigned long pos = 0) const; + + /** get MultiFrameSourceSOPInstanceUID (0008,1167) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMultiFrameSourceSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get SimpleFrameList (0008,1161) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSimpleFrameList(Uint32 &value, const unsigned long pos = 0) const; + + /** get TimeRange (0008,1163) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTimeRange(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CalculatedFrameList (0008,1162) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3-3n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCalculatedFrameList(const Uint32 value, const unsigned long pos = 0); + + /** set MultiFrameSourceSOPInstanceUID (0008,1167) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMultiFrameSourceSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set SimpleFrameList (0008,1161) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSimpleFrameList(const Uint32 value, const unsigned long pos = 0); + + /** set TimeRange (0008,1163) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTimeRange(const Float64 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CalculatedFrameList (0008,1162) vr=UL, vm=3-3n, type=1C + DcmUnsignedLong CalculatedFrameList; + /// MultiFrameSourceSOPInstanceUID (0008,1167) vr=UI, vm=1, type=1 + DcmUniqueIdentifier MultiFrameSourceSOPInstanceUID; + /// SimpleFrameList (0008,1161) vr=UL, vm=1-n, type=1C + DcmUnsignedLong SimpleFrameList; + /// TimeRange (0008,1163) vr=FD, vm=2, type=1C + DcmFloatingPointDouble TimeRange; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTFrameExtractionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTFrameExtractionSequence(const DRTFrameExtractionSequence ©); + + /** destructor + */ + virtual ~DRTFrameExtractionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTFrameExtractionSequence &operator=(const DRTFrameExtractionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtfgs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtfgs.h new file mode 100644 index 00000000..f6222c81 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtfgs.h @@ -0,0 +1,536 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTFractionGroupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTFGS_H +#define DRTFGS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrbs8.h" // for ReferencedBeamSequence +#include "dcmtk/dcmrt/seq/drtrbas8.h" // for ReferencedBrachyApplicationSetupSequence +#include "dcmtk/dcmrt/seq/drtrdrs8.h" // for ReferencedDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtrds.h" // for ReferencedDoseSequence + + +/** Interface class for FractionGroupSequence (300a,0070) in RTFractionSchemeModule + */ +class DCMTK_DCMRT_EXPORT DRTFractionGroupSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamDoseMeaning (300a,008b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseMeaning(OFString &value, const signed long pos = 0) const; + + /** get FractionGroupDescription (300a,0072) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFractionGroupDescription(OFString &value, const signed long pos = 0) const; + + /** get FractionGroupNumber (300a,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFractionGroupNumber(OFString &value, const signed long pos = 0) const; + + /** get FractionGroupNumber (300a,0071) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFractionGroupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get FractionPattern (300a,007b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFractionPattern(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBeams (300a,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBeams(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBeams (300a,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBeams(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfBrachyApplicationSetups (300a,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBrachyApplicationSetups(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBrachyApplicationSetups (300a,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBrachyApplicationSetups(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfFractionPatternDigitsPerDay (300a,0079) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionPatternDigitsPerDay(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFractionPatternDigitsPerDay (300a,0079) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionPatternDigitsPerDay(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfFractionsPlanned (300a,0078) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionsPlanned(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFractionsPlanned (300a,0078) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionsPlanned(Sint32 &value, const unsigned long pos = 0) const; + + /** get RepeatFractionCycleLength (300a,007a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRepeatFractionCycleLength(OFString &value, const signed long pos = 0) const; + + /** get RepeatFractionCycleLength (300a,007a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRepeatFractionCycleLength(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ReferencedBeamSequence (300c,0004) + * @return reference to sequence element + */ + DRTReferencedBeamSequenceInRTFractionSchemeModule &getReferencedBeamSequence() + { return ReferencedBeamSequence; } + + /** get ReferencedBeamSequence (300c,0004) + * @return const reference to sequence element + */ + const DRTReferencedBeamSequenceInRTFractionSchemeModule &getReferencedBeamSequence() const + { return ReferencedBeamSequence; } + + /** get ReferencedBrachyApplicationSetupSequence (300c,000a) + * @return reference to sequence element + */ + DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule &getReferencedBrachyApplicationSetupSequence() + { return ReferencedBrachyApplicationSetupSequence; } + + /** get ReferencedBrachyApplicationSetupSequence (300c,000a) + * @return const reference to sequence element + */ + const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule &getReferencedBrachyApplicationSetupSequence() const + { return ReferencedBrachyApplicationSetupSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return reference to sequence element + */ + DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule &getReferencedDoseReferenceSequence() + { return ReferencedDoseReferenceSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return const reference to sequence element + */ + const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule &getReferencedDoseReferenceSequence() const + { return ReferencedDoseReferenceSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return reference to sequence element + */ + DRTReferencedDoseSequence &getReferencedDoseSequence() + { return ReferencedDoseSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return const reference to sequence element + */ + const DRTReferencedDoseSequence &getReferencedDoseSequence() const + { return ReferencedDoseSequence; } + + // --- set DICOM attribute values --- + + /** set BeamDoseMeaning (300a,008b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDoseMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set FractionGroupDescription (300a,0072) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFractionGroupDescription(const OFString &value, const OFBool check = OFTrue); + + /** set FractionGroupNumber (300a,0071) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFractionGroupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set FractionPattern (300a,007b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFractionPattern(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBeams (300a,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBeams(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBrachyApplicationSetups (300a,00a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBrachyApplicationSetups(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFractionPatternDigitsPerDay (300a,0079) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfFractionPatternDigitsPerDay(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFractionsPlanned (300a,0078) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfFractionsPlanned(const OFString &value, const OFBool check = OFTrue); + + /** set RepeatFractionCycleLength (300a,007a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRepeatFractionCycleLength(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamDoseMeaning (300a,008b) vr=CS, vm=1, type=3 + DcmCodeString BeamDoseMeaning; + /// FractionGroupDescription (300a,0072) vr=LO, vm=1, type=3 + DcmLongString FractionGroupDescription; + /// FractionGroupNumber (300a,0071) vr=IS, vm=1, type=1 + DcmIntegerString FractionGroupNumber; + /// FractionPattern (300a,007b) vr=LT, vm=1, type=3 + DcmLongText FractionPattern; + /// NumberOfBeams (300a,0080) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBeams; + /// NumberOfBrachyApplicationSetups (300a,00a0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBrachyApplicationSetups; + /// NumberOfFractionPatternDigitsPerDay (300a,0079) vr=IS, vm=1, type=3 + DcmIntegerString NumberOfFractionPatternDigitsPerDay; + /// NumberOfFractionsPlanned (300a,0078) vr=IS, vm=1, type=2 + DcmIntegerString NumberOfFractionsPlanned; + /// ReferencedBeamSequence (300c,0004) vr=SQ, vm=1, type=1C + DRTReferencedBeamSequenceInRTFractionSchemeModule ReferencedBeamSequence; + /// ReferencedBrachyApplicationSetupSequence (300c,000a) vr=SQ, vm=1, type=1C + DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule ReferencedBrachyApplicationSetupSequence; + /// ReferencedDoseReferenceSequence (300c,0050) vr=SQ, vm=1, type=3 + DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule ReferencedDoseReferenceSequence; + /// ReferencedDoseSequence (300c,0080) vr=SQ, vm=1, type=3 + DRTReferencedDoseSequence ReferencedDoseSequence; + /// RepeatFractionCycleLength (300a,007a) vr=IS, vm=1, type=3 + DcmIntegerString RepeatFractionCycleLength; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTFractionGroupSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTFractionGroupSequence(const DRTFractionGroupSequence ©); + + /** destructor + */ + virtual ~DRTFractionGroupSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTFractionGroupSequence &operator=(const DRTFractionGroupSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtfgss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtfgss.h new file mode 100644 index 00000000..ba4bba43 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtfgss.h @@ -0,0 +1,390 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTFractionGroupSummarySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTFGSS_H +#define DRTFGSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtfsss.h" // for FractionStatusSummarySequence + + +/** Interface class for FractionGroupSummarySequence (3008,0220) + */ +class DCMTK_DCMRT_EXPORT DRTFractionGroupSummarySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get FractionGroupType (3008,0224) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFractionGroupType(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFractionsDelivered (3008,005a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionsDelivered(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFractionsDelivered (3008,005a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionsDelivered(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfFractionsPlanned (300a,0078) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionsPlanned(OFString &value, const signed long pos = 0) const; + + /** get NumberOfFractionsPlanned (300a,0078) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfFractionsPlanned(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFractionGroupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get FractionStatusSummarySequence (3008,0240) + * @return reference to sequence element + */ + DRTFractionStatusSummarySequence &getFractionStatusSummarySequence() + { return FractionStatusSummarySequence; } + + /** get FractionStatusSummarySequence (3008,0240) + * @return const reference to sequence element + */ + const DRTFractionStatusSummarySequence &getFractionStatusSummarySequence() const + { return FractionStatusSummarySequence; } + + // --- set DICOM attribute values --- + + /** set FractionGroupType (3008,0224) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFractionGroupType(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFractionsDelivered (3008,005a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfFractionsDelivered(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfFractionsPlanned (300a,0078) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfFractionsPlanned(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedFractionGroupNumber (300c,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFractionGroupNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// FractionGroupType (3008,0224) vr=CS, vm=1, type=2 + DcmCodeString FractionGroupType; + /// FractionStatusSummarySequence (3008,0240) vr=SQ, vm=1, type=3 + DRTFractionStatusSummarySequence FractionStatusSummarySequence; + /// NumberOfFractionsDelivered (3008,005a) vr=IS, vm=1, type=2 + DcmIntegerString NumberOfFractionsDelivered; + /// NumberOfFractionsPlanned (300a,0078) vr=IS, vm=1, type=2 + DcmIntegerString NumberOfFractionsPlanned; + /// ReferencedFractionGroupNumber (300c,0022) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedFractionGroupNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTFractionGroupSummarySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTFractionGroupSummarySequence(const DRTFractionGroupSummarySequence ©); + + /** destructor + */ + virtual ~DRTFractionGroupSummarySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTFractionGroupSummarySequence &operator=(const DRTFractionGroupSummarySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtfms.h b/dcmrt/include/dcmtk/dcmrt/seq/drtfms.h new file mode 100644 index 00000000..6eddc48c --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtfms.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTFluenceMapSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTFMS_H +#define DRTFMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for FluenceMapSequence (3002,0040) + */ +class DCMTK_DCMRT_EXPORT DRTFluenceMapSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get FluenceDataScale (3002,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFluenceDataScale(OFString &value, const signed long pos = 0) const; + + /** get FluenceDataScale (3002,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFluenceDataScale(Float64 &value, const unsigned long pos = 0) const; + + /** get FluenceDataSource (3002,0041) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFluenceDataSource(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set FluenceDataScale (3002,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFluenceDataScale(const OFString &value, const OFBool check = OFTrue); + + /** set FluenceDataSource (3002,0041) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFluenceDataSource(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// FluenceDataScale (3002,0042) vr=DS, vm=1, type=3 + DcmDecimalString FluenceDataScale; + /// FluenceDataSource (3002,0041) vr=CS, vm=1, type=1 + DcmCodeString FluenceDataSource; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTFluenceMapSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTFluenceMapSequence(const DRTFluenceMapSequence ©); + + /** destructor + */ + virtual ~DRTFluenceMapSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTFluenceMapSequence &operator=(const DRTFluenceMapSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtfsss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtfsss.h new file mode 100644 index 00000000..8ad589f9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtfsss.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTFractionStatusSummarySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTFSSS_H +#define DRTFSSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for FractionStatusSummarySequence (3008,0240) + */ +class DCMTK_DCMRT_EXPORT DRTFractionStatusSummarySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedFractionNumber (3008,0223) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFractionNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFractionNumber (3008,0223) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFractionNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get TreatmentDate (3008,0250) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentDate(OFString &value, const signed long pos = 0) const; + + /** get TreatmentTerminationStatus (3008,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentTerminationStatus(OFString &value, const signed long pos = 0) const; + + /** get TreatmentTime (3008,0251) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentTime(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedFractionNumber (3008,0223) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFractionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentDate (3008,0250) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentDate(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentTerminationStatus (3008,002a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentTerminationStatus(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentTime (3008,0251) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentTime(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedFractionNumber (3008,0223) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedFractionNumber; + /// TreatmentDate (3008,0250) vr=DA, vm=1, type=2 + DcmDate TreatmentDate; + /// TreatmentTerminationStatus (3008,002a) vr=CS, vm=1, type=2 + DcmCodeString TreatmentTerminationStatus; + /// TreatmentTime (3008,0251) vr=TM, vm=1, type=2 + DcmTime TreatmentTime; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTFractionStatusSummarySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTFractionStatusSummarySequence(const DRTFractionStatusSummarySequence ©); + + /** destructor + */ + virtual ~DRTFractionStatusSummarySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTFractionStatusSummarySequence &operator=(const DRTFractionStatusSummarySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtgas.h b/dcmrt/include/dcmtk/dcmrt/seq/drtgas.h new file mode 100644 index 00000000..3c4e2283 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtgas.h @@ -0,0 +1,391 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTGeneralAccessorySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTGAS_H +#define DRTGAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for GeneralAccessorySequence (300a,0420) + */ +class DCMTK_DCMRT_EXPORT DRTGeneralAccessorySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get GeneralAccessoryDescription (300a,0422) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGeneralAccessoryDescription(OFString &value, const signed long pos = 0) const; + + /** get GeneralAccessoryID (300a,0421) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGeneralAccessoryID(OFString &value, const signed long pos = 0) const; + + /** get GeneralAccessoryNumber (300a,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGeneralAccessoryNumber(OFString &value, const signed long pos = 0) const; + + /** get GeneralAccessoryNumber (300a,0424) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGeneralAccessoryNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get GeneralAccessoryType (300a,0423) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGeneralAccessoryType(OFString &value, const signed long pos = 0) const; + + /** get SourceToGeneralAccessoryDistance (300a,0425) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToGeneralAccessoryDistance(Float32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set GeneralAccessoryDescription (300a,0422) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGeneralAccessoryDescription(const OFString &value, const OFBool check = OFTrue); + + /** set GeneralAccessoryID (300a,0421) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGeneralAccessoryID(const OFString &value, const OFBool check = OFTrue); + + /** set GeneralAccessoryNumber (300a,0424) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGeneralAccessoryNumber(const OFString &value, const OFBool check = OFTrue); + + /** set GeneralAccessoryType (300a,0423) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGeneralAccessoryType(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToGeneralAccessoryDistance (300a,0425) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToGeneralAccessoryDistance(const Float32 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// GeneralAccessoryDescription (300a,0422) vr=ST, vm=1, type=3 + DcmShortText GeneralAccessoryDescription; + /// GeneralAccessoryID (300a,0421) vr=SH, vm=1, type=1 + DcmShortString GeneralAccessoryID; + /// GeneralAccessoryNumber (300a,0424) vr=IS, vm=1, type=1 + DcmIntegerString GeneralAccessoryNumber; + /// GeneralAccessoryType (300a,0423) vr=CS, vm=1, type=3 + DcmCodeString GeneralAccessoryType; + /// SourceToGeneralAccessoryDistance (300a,0425) vr=FL, vm=1, type=3 + DcmFloatingPointSingle SourceToGeneralAccessoryDistance; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTGeneralAccessorySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTGeneralAccessorySequence(const DRTGeneralAccessorySequence ©); + + /** destructor + */ + virtual ~DRTGeneralAccessorySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTGeneralAccessorySequence &operator=(const DRTGeneralAccessorySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtgmcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtgmcs.h new file mode 100644 index 00000000..dbbd7d8b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtgmcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTGeneticModificationsCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTGMCS_H +#define DRTGMCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for GeneticModificationsCodeSequence (0010,0229) + */ +class DCMTK_DCMRT_EXPORT DRTGeneticModificationsCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTGeneticModificationsCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTGeneticModificationsCodeSequence(const DRTGeneticModificationsCodeSequence ©); + + /** destructor + */ + virtual ~DRTGeneticModificationsCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTGeneticModificationsCodeSequence &operator=(const DRTGeneticModificationsCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtgms.h b/dcmrt/include/dcmtk/dcmrt/seq/drtgms.h new file mode 100644 index 00000000..4370af5c --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtgms.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTGeneticModificationsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTGMS_H +#define DRTGMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtgmcs.h" // for GeneticModificationsCodeSequence + + +/** Interface class for GeneticModificationsSequence (0010,0221) + */ +class DCMTK_DCMRT_EXPORT DRTGeneticModificationsSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get GeneticModificationsDescription (0010,0222) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGeneticModificationsDescription(OFString &value, const signed long pos = 0) const; + + /** get GeneticModificationsNomenclature (0010,0223) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGeneticModificationsNomenclature(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get GeneticModificationsCodeSequence (0010,0229) + * @return reference to sequence element + */ + DRTGeneticModificationsCodeSequence &getGeneticModificationsCodeSequence() + { return GeneticModificationsCodeSequence; } + + /** get GeneticModificationsCodeSequence (0010,0229) + * @return const reference to sequence element + */ + const DRTGeneticModificationsCodeSequence &getGeneticModificationsCodeSequence() const + { return GeneticModificationsCodeSequence; } + + // --- set DICOM attribute values --- + + /** set GeneticModificationsDescription (0010,0222) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGeneticModificationsDescription(const OFString &value, const OFBool check = OFTrue); + + /** set GeneticModificationsNomenclature (0010,0223) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGeneticModificationsNomenclature(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// GeneticModificationsCodeSequence (0010,0229) vr=SQ, vm=1, type=3 + DRTGeneticModificationsCodeSequence GeneticModificationsCodeSequence; + /// GeneticModificationsDescription (0010,0222) vr=UC, vm=1, type=1 + DcmUnlimitedCharacters GeneticModificationsDescription; + /// GeneticModificationsNomenclature (0010,0223) vr=LO, vm=1, type=1 + DcmLongString GeneticModificationsNomenclature; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTGeneticModificationsSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTGeneticModificationsSequence(const DRTGeneticModificationsSequence ©); + + /** destructor + */ + virtual ~DRTGeneticModificationsSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTGeneticModificationsSequence &operator=(const DRTGeneticModificationsSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtgpis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtgpis.h new file mode 100644 index 00000000..5a0ac8da --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtgpis.h @@ -0,0 +1,369 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTGroupOfPatientsIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTGPIS_H +#define DRTGPIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence + + +/** Interface class for GroupOfPatientsIdentificationSequence (0010,0027) + */ +class DCMTK_DCMRT_EXPORT DRTGroupOfPatientsIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientPosition (0018,5100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientPosition(OFString &value, const signed long pos = 0) const; + + /** get SubjectRelativePositionInImage (0010,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSubjectRelativePositionInImage(Uint16 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + // --- set DICOM attribute values --- + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientPosition (0018,5100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientPosition(const OFString &value, const OFBool check = OFTrue); + + /** set SubjectRelativePositionInImage (0010,0028) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSubjectRelativePositionInImage(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientID (0010,0020) vr=LO, vm=1, type=1 + DcmLongString PatientID; + /// PatientPosition (0018,5100) vr=CS, vm=1, type=3 + DcmCodeString PatientPosition; + /// SubjectRelativePositionInImage (0010,0028) vr=US, vm=3, type=3 + DcmUnsignedShort SubjectRelativePositionInImage; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTGroupOfPatientsIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTGroupOfPatientsIdentificationSequence(const DRTGroupOfPatientsIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTGroupOfPatientsIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTGroupOfPatientsIdentificationSequence &operator=(const DRTGroupOfPatientsIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drthsdrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drthsdrs.h new file mode 100644 index 00000000..2461260d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drthsdrs.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTHL7StructuredDocumentReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTHSDRS_H +#define DRTHSDRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for HL7StructuredDocumentReferenceSequence (0040,a390) + */ +class DCMTK_DCMRT_EXPORT DRTHL7StructuredDocumentReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get HL7InstanceIdentifier (0040,e001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHL7InstanceIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get RetrieveURI (0040,e010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRetrieveURI(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set HL7InstanceIdentifier (0040,e001) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHL7InstanceIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set RetrieveURI (0040,e010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRetrieveURI(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// HL7InstanceIdentifier (0040,e001) vr=ST, vm=1, type=1 + DcmShortText HL7InstanceIdentifier; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// RetrieveURI (0040,e010) vr=UR, vm=1, type=3 + DcmUniversalResourceIdentifierOrLocator RetrieveURI; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTHL7StructuredDocumentReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTHL7StructuredDocumentReferenceSequence(const DRTHL7StructuredDocumentReferenceSequence ©); + + /** destructor + */ + virtual ~DRTHL7StructuredDocumentReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTHL7StructuredDocumentReferenceSequence &operator=(const DRTHL7StructuredDocumentReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtiais.h b/dcmrt/include/dcmtk/dcmrt/seq/drtiais.h new file mode 100644 index 00000000..9bd7552e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtiais.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIssuerOfAdmissionIDSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIAIS_H +#define DRTIAIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IssuerOfAdmissionIDSequence (0038,0014) + */ +class DCMTK_DCMRT_EXPORT DRTIssuerOfAdmissionIDSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LocalNamespaceEntityID (0040,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLocalNamespaceEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityID (0040,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityIDType (0040,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityIDType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LocalNamespaceEntityID (0040,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLocalNamespaceEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityID (0040,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityIDType (0040,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityIDType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LocalNamespaceEntityID (0040,0031) vr=UT, vm=1, type=1C + DcmUnlimitedText LocalNamespaceEntityID; + /// UniversalEntityID (0040,0032) vr=UT, vm=1, type=1C + DcmUnlimitedText UniversalEntityID; + /// UniversalEntityIDType (0040,0033) vr=CS, vm=1, type=1C + DcmCodeString UniversalEntityIDType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIssuerOfAdmissionIDSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIssuerOfAdmissionIDSequence(const DRTIssuerOfAdmissionIDSequence ©); + + /** destructor + */ + virtual ~DRTIssuerOfAdmissionIDSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIssuerOfAdmissionIDSequence &operator=(const DRTIssuerOfAdmissionIDSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtians.h b/dcmrt/include/dcmtk/dcmrt/seq/drtians.h new file mode 100644 index 00000000..50542d27 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtians.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIssuerOfAccessionNumberSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIANS_H +#define DRTIANS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IssuerOfAccessionNumberSequence (0008,0051) + */ +class DCMTK_DCMRT_EXPORT DRTIssuerOfAccessionNumberSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LocalNamespaceEntityID (0040,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLocalNamespaceEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityID (0040,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityIDType (0040,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityIDType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LocalNamespaceEntityID (0040,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLocalNamespaceEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityID (0040,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityIDType (0040,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityIDType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LocalNamespaceEntityID (0040,0031) vr=UT, vm=1, type=1C + DcmUnlimitedText LocalNamespaceEntityID; + /// UniversalEntityID (0040,0032) vr=UT, vm=1, type=1C + DcmUnlimitedText UniversalEntityID; + /// UniversalEntityIDType (0040,0033) vr=CS, vm=1, type=1C + DcmCodeString UniversalEntityIDType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIssuerOfAccessionNumberSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIssuerOfAccessionNumberSequence(const DRTIssuerOfAccessionNumberSequence ©); + + /** destructor + */ + virtual ~DRTIssuerOfAccessionNumberSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIssuerOfAccessionNumberSequence &operator=(const DRTIssuerOfAccessionNumberSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtiblds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtiblds.h new file mode 100644 index 00000000..acf6b159 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtiblds.h @@ -0,0 +1,372 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonBeamLimitingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIBLDS_H +#define DRTIBLDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IonBeamLimitingDeviceSequence (300a,03a4) + */ +class DCMTK_DCMRT_EXPORT DRTIonBeamLimitingDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IsocenterToBeamLimitingDeviceDistance (300a,00bb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToBeamLimitingDeviceDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFString &value, const signed long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(Float64 &value, const unsigned long pos = 0) const; + + /** get LeafPositionBoundaries (300a,00be) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLeafPositionBoundaries(OFVector &value) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(OFString &value, const signed long pos = 0) const; + + /** get NumberOfLeafJawPairs (300a,00bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos = 0) const; + + /** get RTBeamLimitingDeviceType (300a,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTBeamLimitingDeviceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set IsocenterToBeamLimitingDeviceDistance (300a,00bb) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToBeamLimitingDeviceDistance(const Float32 value, const unsigned long pos = 0); + + /** set LeafPositionBoundaries (300a,00be) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLeafPositionBoundaries(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfLeafJawPairs (300a,00bc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfLeafJawPairs(const OFString &value, const OFBool check = OFTrue); + + /** set RTBeamLimitingDeviceType (300a,00b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTBeamLimitingDeviceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// IsocenterToBeamLimitingDeviceDistance (300a,00bb) vr=FL, vm=1, type=2 + DcmFloatingPointSingle IsocenterToBeamLimitingDeviceDistance; + /// LeafPositionBoundaries (300a,00be) vr=DS, vm=3-n, type=1C + DcmDecimalString LeafPositionBoundaries; + /// NumberOfLeafJawPairs (300a,00bc) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfLeafJawPairs; + /// RTBeamLimitingDeviceType (300a,00b8) vr=CS, vm=1, type=1 + DcmCodeString RTBeamLimitingDeviceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonBeamLimitingDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonBeamLimitingDeviceSequence(const DRTIonBeamLimitingDeviceSequence ©); + + /** destructor + */ + virtual ~DRTIonBeamLimitingDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonBeamLimitingDeviceSequence &operator=(const DRTIonBeamLimitingDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtibls.h b/dcmrt/include/dcmtk/dcmrt/seq/drtibls.h new file mode 100644 index 00000000..0265c93b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtibls.h @@ -0,0 +1,554 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonBlockSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIBLS_H +#define DRTIBLS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbss.h" // for BlockSlabSequence + + +/** Interface class for IonBlockSequence (300a,03a6) + */ +class DCMTK_DCMRT_EXPORT DRTIonBlockSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(OFString &value, const signed long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(Float64 &value, const unsigned long pos = 0) const; + + /** get BlockData (300a,0106) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockData(OFVector &value) const; + + /** get BlockDivergence (300a,00fa) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockDivergence(OFString &value, const signed long pos = 0) const; + + /** get BlockMountingPosition (300a,00fb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockMountingPosition(OFString &value, const signed long pos = 0) const; + + /** get BlockName (300a,00fe) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockName(OFString &value, const signed long pos = 0) const; + + /** get BlockNumber (300a,00fc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumber(OFString &value, const signed long pos = 0) const; + + /** get BlockNumber (300a,00fc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get BlockNumberOfPoints (300a,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumberOfPoints(OFString &value, const signed long pos = 0) const; + + /** get BlockNumberOfPoints (300a,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockNumberOfPoints(Sint32 &value, const unsigned long pos = 0) const; + + /** get BlockThickness (300a,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockThickness(OFString &value, const signed long pos = 0) const; + + /** get BlockThickness (300a,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get BlockTrayID (300a,00f5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockTrayID(OFString &value, const signed long pos = 0) const; + + /** get BlockType (300a,00f8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockType(OFString &value, const signed long pos = 0) const; + + /** get IsocenterToBlockTrayDistance (300a,00f7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToBlockTrayDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlockSlabItems (300a,0440) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlockSlabItems(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlockSlabItems (300a,0440) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlockSlabItems(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BlockSlabSequence (300a,0441) + * @return reference to sequence element + */ + DRTBlockSlabSequence &getBlockSlabSequence() + { return BlockSlabSequence; } + + /** get BlockSlabSequence (300a,0441) + * @return const reference to sequence element + */ + const DRTBlockSlabSequence &getBlockSlabSequence() const + { return BlockSlabSequence; } + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BlockData (300a,0106) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2-2n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockData(const OFString &value, const OFBool check = OFTrue); + + /** set BlockDivergence (300a,00fa) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockDivergence(const OFString &value, const OFBool check = OFTrue); + + /** set BlockMountingPosition (300a,00fb) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockMountingPosition(const OFString &value, const OFBool check = OFTrue); + + /** set BlockName (300a,00fe) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockName(const OFString &value, const OFBool check = OFTrue); + + /** set BlockNumber (300a,00fc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BlockNumberOfPoints (300a,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockNumberOfPoints(const OFString &value, const OFBool check = OFTrue); + + /** set BlockThickness (300a,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockThickness(const OFString &value, const OFBool check = OFTrue); + + /** set BlockTrayID (300a,00f5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockTrayID(const OFString &value, const OFBool check = OFTrue); + + /** set BlockType (300a,00f8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockType(const OFString &value, const OFBool check = OFTrue); + + /** set IsocenterToBlockTrayDistance (300a,00f7) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToBlockTrayDistance(const Float32 value, const unsigned long pos = 0); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBlockSlabItems (300a,0440) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBlockSlabItems(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BlockData (300a,0106) vr=DS, vm=2-2n, type=1 + DcmDecimalString BlockData; + /// BlockDivergence (300a,00fa) vr=CS, vm=1, type=1 + DcmCodeString BlockDivergence; + /// BlockMountingPosition (300a,00fb) vr=CS, vm=1, type=1 + DcmCodeString BlockMountingPosition; + /// BlockName (300a,00fe) vr=LO, vm=1, type=3 + DcmLongString BlockName; + /// BlockNumber (300a,00fc) vr=IS, vm=1, type=1 + DcmIntegerString BlockNumber; + /// BlockNumberOfPoints (300a,0104) vr=IS, vm=1, type=1 + DcmIntegerString BlockNumberOfPoints; + /// BlockSlabSequence (300a,0441) vr=SQ, vm=1, type=1C + DRTBlockSlabSequence BlockSlabSequence; + /// BlockThickness (300a,0100) vr=DS, vm=1, type=1 + DcmDecimalString BlockThickness; + /// BlockTrayID (300a,00f5) vr=SH, vm=1, type=3 + DcmShortString BlockTrayID; + /// BlockType (300a,00f8) vr=CS, vm=1, type=1 + DcmCodeString BlockType; + /// IsocenterToBlockTrayDistance (300a,00f7) vr=FL, vm=1, type=1 + DcmFloatingPointSingle IsocenterToBlockTrayDistance; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=2 + DcmShortString MaterialID; + /// NumberOfBlockSlabItems (300a,0440) vr=IS, vm=1, type=3 + DcmIntegerString NumberOfBlockSlabItems; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonBlockSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonBlockSequence(const DRTIonBlockSequence ©); + + /** destructor + */ + virtual ~DRTIonBlockSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonBlockSequence &operator=(const DRTIonBlockSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtibs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtibs.h new file mode 100644 index 00000000..354b7448 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtibs.h @@ -0,0 +1,1253 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonBeamSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIBS_H +#define DRTIBS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtas6.h" // for ApplicatorSequence +#include "dcmtk/dcmrt/seq/drtddps.h" // for DepthDoseParametersSequence +#include "dcmtk/dcmrt/seq/drtgas.h" // for GeneralAccessorySequence +#include "dcmtk/dcmrt/seq/drtiblds.h" // for IonBeamLimitingDeviceSequence +#include "dcmtk/dcmrt/seq/drtibls.h" // for IonBlockSequence +#include "dcmtk/dcmrt/seq/drticps.h" // for IonControlPointSequence +#include "dcmtk/dcmrt/seq/drtircs.h" // for IonRangeCompensatorSequence +#include "dcmtk/dcmrt/seq/drtiws.h" // for IonWedgeSequence +#include "dcmtk/dcmrt/seq/drtlsds.h" // for LateralSpreadingDeviceSequence +#include "dcmtk/dcmrt/seq/drtrms.h" // for RangeModulatorSequence +#include "dcmtk/dcmrt/seq/drtrshs.h" // for RangeShifterSequence +#include "dcmtk/dcmrt/seq/drtrbos6.h" // for ReferencedBolusSequence +#include "dcmtk/dcmrt/seq/drtrds.h" // for ReferencedDoseSequence +#include "dcmtk/dcmrt/seq/drtrris6.h" // for ReferencedReferenceImageSequence +#include "dcmtk/dcmrt/seq/drtsns.h" // for SnoutSequence + + +/** Interface class for IonBeamSequence (300a,03a2) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTIonBeamSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamDescription (300a,00c3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDescription(OFString &value, const signed long pos = 0) const; + + /** get BeamName (300a,00c2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamName(OFString &value, const signed long pos = 0) const; + + /** get BeamNumber (300a,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamNumber(OFString &value, const signed long pos = 0) const; + + /** get BeamNumber (300a,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get BeamType (300a,00c4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamType(OFString &value, const signed long pos = 0) const; + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get FinalCumulativeMetersetWeight (300a,010e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFinalCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get FinalCumulativeMetersetWeight (300a,010e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFinalCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get FixationEye (300a,0150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationEye(OFString &value, const signed long pos = 0) const; + + /** get FixationLightAzimuthalAngle (300a,0356) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightAzimuthalAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get FixationLightPolarAngle (300a,0358) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightPolarAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get ModulatedScanModeType (300a,0309) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getModulatedScanModeType(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfBoli (300a,00ed) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBoli(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBoli (300a,00ed) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBoli(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfCompensators (300a,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfCompensators(OFString &value, const signed long pos = 0) const; + + /** get NumberOfCompensators (300a,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfCompensators(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(OFString &value, const signed long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfLateralSpreadingDevices (300a,0330) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLateralSpreadingDevices(OFString &value, const signed long pos = 0) const; + + /** get NumberOfLateralSpreadingDevices (300a,0330) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLateralSpreadingDevices(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfRangeModulators (300a,0340) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeModulators(OFString &value, const signed long pos = 0) const; + + /** get NumberOfRangeModulators (300a,0340) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeModulators(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfRangeShifters (300a,0312) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeShifters(OFString &value, const signed long pos = 0) const; + + /** get NumberOfRangeShifters (300a,0312) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeShifters(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfWedges (300a,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfWedges(OFString &value, const signed long pos = 0) const; + + /** get NumberOfWedges (300a,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfWedges(Sint32 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAccessoryCode (300a,0354) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportID (300a,0352) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportID(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportType (300a,0350) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportType(OFString &value, const signed long pos = 0) const; + + /** get PrimaryDosimeterUnit (300a,00b3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrimaryDosimeterUnit(OFString &value, const signed long pos = 0) const; + + /** get RadiationAtomicNumber (300a,0304) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationAtomicNumber(OFString &value, const signed long pos = 0) const; + + /** get RadiationAtomicNumber (300a,0304) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationAtomicNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get RadiationChargeState (300a,0306) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationChargeState(Sint16 &value, const unsigned long pos = 0) const; + + /** get RadiationMassNumber (300a,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationMassNumber(OFString &value, const signed long pos = 0) const; + + /** get RadiationMassNumber (300a,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationMassNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get RadiationType (300a,00c6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationType(OFString &value, const signed long pos = 0) const; + + /** get ReferencedPatientSetupNumber (300c,006a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedPatientSetupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedPatientSetupNumber (300c,006a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedPatientSetupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedToleranceTableNumber (300c,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedToleranceTableNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedToleranceTableNumber (300c,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedToleranceTableNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ScanMode (300a,0308) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanMode(OFString &value, const signed long pos = 0) const; + + /** get TotalBlockTrayWaterEquivalentThickness (300a,00f3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalBlockTrayWaterEquivalentThickness(Float32 &value, const unsigned long pos = 0) const; + + /** get TotalCompensatorTrayWaterEquivalentThickness (300a,02e3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalCompensatorTrayWaterEquivalentThickness(Float32 &value, const unsigned long pos = 0) const; + + /** get TotalWedgeTrayWaterEquivalentThickness (300a,00d7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTotalWedgeTrayWaterEquivalentThickness(Float32 &value, const unsigned long pos = 0) const; + + /** get TreatmentDeliveryType (300a,00ce) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentDeliveryType(OFString &value, const signed long pos = 0) const; + + /** get TreatmentMachineName (300a,00b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentMachineName(OFString &value, const signed long pos = 0) const; + + /** get VirtualSourceAxisDistances (300a,030a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getVirtualSourceAxisDistances(Float32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ApplicatorSequence (300a,0107) + * @return reference to sequence element + */ + DRTApplicatorSequenceInRTIonBeamsModule &getApplicatorSequence() + { return ApplicatorSequence; } + + /** get ApplicatorSequence (300a,0107) + * @return const reference to sequence element + */ + const DRTApplicatorSequenceInRTIonBeamsModule &getApplicatorSequence() const + { return ApplicatorSequence; } + + /** get DepthDoseParametersSequence (300a,0505) + * @return reference to sequence element + */ + DRTDepthDoseParametersSequence &getDepthDoseParametersSequence() + { return DepthDoseParametersSequence; } + + /** get DepthDoseParametersSequence (300a,0505) + * @return const reference to sequence element + */ + const DRTDepthDoseParametersSequence &getDepthDoseParametersSequence() const + { return DepthDoseParametersSequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return reference to sequence element + */ + DRTGeneralAccessorySequence &getGeneralAccessorySequence() + { return GeneralAccessorySequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return const reference to sequence element + */ + const DRTGeneralAccessorySequence &getGeneralAccessorySequence() const + { return GeneralAccessorySequence; } + + /** get IonBeamLimitingDeviceSequence (300a,03a4) + * @return reference to sequence element + */ + DRTIonBeamLimitingDeviceSequence &getIonBeamLimitingDeviceSequence() + { return IonBeamLimitingDeviceSequence; } + + /** get IonBeamLimitingDeviceSequence (300a,03a4) + * @return const reference to sequence element + */ + const DRTIonBeamLimitingDeviceSequence &getIonBeamLimitingDeviceSequence() const + { return IonBeamLimitingDeviceSequence; } + + /** get IonBlockSequence (300a,03a6) + * @return reference to sequence element + */ + DRTIonBlockSequence &getIonBlockSequence() + { return IonBlockSequence; } + + /** get IonBlockSequence (300a,03a6) + * @return const reference to sequence element + */ + const DRTIonBlockSequence &getIonBlockSequence() const + { return IonBlockSequence; } + + /** get IonControlPointSequence (300a,03a8) + * @return reference to sequence element + */ + DRTIonControlPointSequence &getIonControlPointSequence() + { return IonControlPointSequence; } + + /** get IonControlPointSequence (300a,03a8) + * @return const reference to sequence element + */ + const DRTIonControlPointSequence &getIonControlPointSequence() const + { return IonControlPointSequence; } + + /** get IonRangeCompensatorSequence (300a,02ea) + * @return reference to sequence element + */ + DRTIonRangeCompensatorSequence &getIonRangeCompensatorSequence() + { return IonRangeCompensatorSequence; } + + /** get IonRangeCompensatorSequence (300a,02ea) + * @return const reference to sequence element + */ + const DRTIonRangeCompensatorSequence &getIonRangeCompensatorSequence() const + { return IonRangeCompensatorSequence; } + + /** get IonWedgeSequence (300a,03aa) + * @return reference to sequence element + */ + DRTIonWedgeSequence &getIonWedgeSequence() + { return IonWedgeSequence; } + + /** get IonWedgeSequence (300a,03aa) + * @return const reference to sequence element + */ + const DRTIonWedgeSequence &getIonWedgeSequence() const + { return IonWedgeSequence; } + + /** get LateralSpreadingDeviceSequence (300a,0332) + * @return reference to sequence element + */ + DRTLateralSpreadingDeviceSequence &getLateralSpreadingDeviceSequence() + { return LateralSpreadingDeviceSequence; } + + /** get LateralSpreadingDeviceSequence (300a,0332) + * @return const reference to sequence element + */ + const DRTLateralSpreadingDeviceSequence &getLateralSpreadingDeviceSequence() const + { return LateralSpreadingDeviceSequence; } + + /** get RangeModulatorSequence (300a,0342) + * @return reference to sequence element + */ + DRTRangeModulatorSequence &getRangeModulatorSequence() + { return RangeModulatorSequence; } + + /** get RangeModulatorSequence (300a,0342) + * @return const reference to sequence element + */ + const DRTRangeModulatorSequence &getRangeModulatorSequence() const + { return RangeModulatorSequence; } + + /** get RangeShifterSequence (300a,0314) + * @return reference to sequence element + */ + DRTRangeShifterSequence &getRangeShifterSequence() + { return RangeShifterSequence; } + + /** get RangeShifterSequence (300a,0314) + * @return const reference to sequence element + */ + const DRTRangeShifterSequence &getRangeShifterSequence() const + { return RangeShifterSequence; } + + /** get ReferencedBolusSequence (300c,00b0) + * @return reference to sequence element + */ + DRTReferencedBolusSequenceInRTIonBeamsModule &getReferencedBolusSequence() + { return ReferencedBolusSequence; } + + /** get ReferencedBolusSequence (300c,00b0) + * @return const reference to sequence element + */ + const DRTReferencedBolusSequenceInRTIonBeamsModule &getReferencedBolusSequence() const + { return ReferencedBolusSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return reference to sequence element + */ + DRTReferencedDoseSequence &getReferencedDoseSequence() + { return ReferencedDoseSequence; } + + /** get ReferencedDoseSequence (300c,0080) + * @return const reference to sequence element + */ + const DRTReferencedDoseSequence &getReferencedDoseSequence() const + { return ReferencedDoseSequence; } + + /** get ReferencedReferenceImageSequence (300c,0042) + * @return reference to sequence element + */ + DRTReferencedReferenceImageSequenceInRTIonBeamsModule &getReferencedReferenceImageSequence() + { return ReferencedReferenceImageSequence; } + + /** get ReferencedReferenceImageSequence (300c,0042) + * @return const reference to sequence element + */ + const DRTReferencedReferenceImageSequenceInRTIonBeamsModule &getReferencedReferenceImageSequence() const + { return ReferencedReferenceImageSequence; } + + /** get SnoutSequence (300a,030c) + * @return reference to sequence element + */ + DRTSnoutSequence &getSnoutSequence() + { return SnoutSequence; } + + /** get SnoutSequence (300a,030c) + * @return const reference to sequence element + */ + const DRTSnoutSequence &getSnoutSequence() const + { return SnoutSequence; } + + // --- set DICOM attribute values --- + + /** set BeamDescription (300a,00c3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDescription(const OFString &value, const OFBool check = OFTrue); + + /** set BeamName (300a,00c2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamName(const OFString &value, const OFBool check = OFTrue); + + /** set BeamNumber (300a,00c0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamNumber(const OFString &value, const OFBool check = OFTrue); + + /** set BeamType (300a,00c4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamType(const OFString &value, const OFBool check = OFTrue); + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set FinalCumulativeMetersetWeight (300a,010e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFinalCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set FixationEye (300a,0150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationEye(const OFString &value, const OFBool check = OFTrue); + + /** set FixationLightAzimuthalAngle (300a,0356) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationLightAzimuthalAngle(const Float32 value, const unsigned long pos = 0); + + /** set FixationLightPolarAngle (300a,0358) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationLightPolarAngle(const Float32 value, const unsigned long pos = 0); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set ModulatedScanModeType (300a,0309) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setModulatedScanModeType(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBlocks (300a,00f0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBlocks(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBoli (300a,00ed) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBoli(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfCompensators (300a,00e0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfCompensators(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfControlPoints (300a,0110) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfControlPoints(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfLateralSpreadingDevices (300a,0330) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfLateralSpreadingDevices(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfRangeModulators (300a,0340) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfRangeModulators(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfRangeShifters (300a,0312) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfRangeShifters(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfWedges (300a,00d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfWedges(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAccessoryCode (300a,0354) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportID (300a,0352) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportType (300a,0350) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportType(const OFString &value, const OFBool check = OFTrue); + + /** set PrimaryDosimeterUnit (300a,00b3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrimaryDosimeterUnit(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationAtomicNumber (300a,0304) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationAtomicNumber(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationChargeState (300a,0306) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationChargeState(const Sint16 value, const unsigned long pos = 0); + + /** set RadiationMassNumber (300a,0302) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationMassNumber(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationType (300a,00c6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationType(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedPatientSetupNumber (300c,006a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedPatientSetupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedToleranceTableNumber (300c,00a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedToleranceTableNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ScanMode (300a,0308) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanMode(const OFString &value, const OFBool check = OFTrue); + + /** set TotalBlockTrayWaterEquivalentThickness (300a,00f3) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTotalBlockTrayWaterEquivalentThickness(const Float32 value, const unsigned long pos = 0); + + /** set TotalCompensatorTrayWaterEquivalentThickness (300a,02e3) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTotalCompensatorTrayWaterEquivalentThickness(const Float32 value, const unsigned long pos = 0); + + /** set TotalWedgeTrayWaterEquivalentThickness (300a,00d7) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTotalWedgeTrayWaterEquivalentThickness(const Float32 value, const unsigned long pos = 0); + + /** set TreatmentDeliveryType (300a,00ce) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentDeliveryType(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentMachineName (300a,00b2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentMachineName(const OFString &value, const OFBool check = OFTrue); + + /** set VirtualSourceAxisDistances (300a,030a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setVirtualSourceAxisDistances(const Float32 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ApplicatorSequence (300a,0107) vr=SQ, vm=1, type=3 + DRTApplicatorSequenceInRTIonBeamsModule ApplicatorSequence; + /// BeamDescription (300a,00c3) vr=ST, vm=1, type=3 + DcmShortText BeamDescription; + /// BeamName (300a,00c2) vr=LO, vm=1, type=1 + DcmLongString BeamName; + /// BeamNumber (300a,00c0) vr=IS, vm=1, type=1 + DcmIntegerString BeamNumber; + /// BeamType (300a,00c4) vr=CS, vm=1, type=1 + DcmCodeString BeamType; + /// DepthDoseParametersSequence (300a,0505) vr=SQ, vm=1, type=3 + DRTDepthDoseParametersSequence DepthDoseParametersSequence; + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// FinalCumulativeMetersetWeight (300a,010e) vr=DS, vm=1, type=1C + DcmDecimalString FinalCumulativeMetersetWeight; + /// FixationEye (300a,0150) vr=CS, vm=1, type=3 + DcmCodeString FixationEye; + /// FixationLightAzimuthalAngle (300a,0356) vr=FL, vm=1, type=3 + DcmFloatingPointSingle FixationLightAzimuthalAngle; + /// FixationLightPolarAngle (300a,0358) vr=FL, vm=1, type=3 + DcmFloatingPointSingle FixationLightPolarAngle; + /// GeneralAccessorySequence (300a,0420) vr=SQ, vm=1, type=3 + DRTGeneralAccessorySequence GeneralAccessorySequence; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// IonBeamLimitingDeviceSequence (300a,03a4) vr=SQ, vm=1, type=3 + DRTIonBeamLimitingDeviceSequence IonBeamLimitingDeviceSequence; + /// IonBlockSequence (300a,03a6) vr=SQ, vm=1, type=1C + DRTIonBlockSequence IonBlockSequence; + /// IonControlPointSequence (300a,03a8) vr=SQ, vm=1, type=1 + DRTIonControlPointSequence IonControlPointSequence; + /// IonRangeCompensatorSequence (300a,02ea) vr=SQ, vm=1, type=1C + DRTIonRangeCompensatorSequence IonRangeCompensatorSequence; + /// IonWedgeSequence (300a,03aa) vr=SQ, vm=1, type=1C + DRTIonWedgeSequence IonWedgeSequence; + /// LateralSpreadingDeviceSequence (300a,0332) vr=SQ, vm=1, type=1C + DRTLateralSpreadingDeviceSequence LateralSpreadingDeviceSequence; + /// Manufacturer (0008,0070) vr=LO, vm=1, type=3 + DcmLongString Manufacturer; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// ModulatedScanModeType (300a,0309) vr=CS, vm=1, type=1C + DcmCodeString ModulatedScanModeType; + /// NumberOfBlocks (300a,00f0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBlocks; + /// NumberOfBoli (300a,00ed) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBoli; + /// NumberOfCompensators (300a,00e0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfCompensators; + /// NumberOfControlPoints (300a,0110) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfControlPoints; + /// NumberOfLateralSpreadingDevices (300a,0330) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfLateralSpreadingDevices; + /// NumberOfRangeModulators (300a,0340) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfRangeModulators; + /// NumberOfRangeShifters (300a,0312) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfRangeShifters; + /// NumberOfWedges (300a,00d0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfWedges; + /// PatientSupportAccessoryCode (300a,0354) vr=LO, vm=1, type=3 + DcmLongString PatientSupportAccessoryCode; + /// PatientSupportID (300a,0352) vr=SH, vm=1, type=3 + DcmShortString PatientSupportID; + /// PatientSupportType (300a,0350) vr=CS, vm=1, type=1 + DcmCodeString PatientSupportType; + /// PrimaryDosimeterUnit (300a,00b3) vr=CS, vm=1, type=1 + DcmCodeString PrimaryDosimeterUnit; + /// RadiationAtomicNumber (300a,0304) vr=IS, vm=1, type=1C + DcmIntegerString RadiationAtomicNumber; + /// RadiationChargeState (300a,0306) vr=SS, vm=1, type=1C + DcmSignedShort RadiationChargeState; + /// RadiationMassNumber (300a,0302) vr=IS, vm=1, type=1C + DcmIntegerString RadiationMassNumber; + /// RadiationType (300a,00c6) vr=CS, vm=1, type=1 + DcmCodeString RadiationType; + /// RangeModulatorSequence (300a,0342) vr=SQ, vm=1, type=1C + DRTRangeModulatorSequence RangeModulatorSequence; + /// RangeShifterSequence (300a,0314) vr=SQ, vm=1, type=1C + DRTRangeShifterSequence RangeShifterSequence; + /// ReferencedBolusSequence (300c,00b0) vr=SQ, vm=1, type=1C + DRTReferencedBolusSequenceInRTIonBeamsModule ReferencedBolusSequence; + /// ReferencedDoseSequence (300c,0080) vr=SQ, vm=1, type=3 + DRTReferencedDoseSequence ReferencedDoseSequence; + /// ReferencedPatientSetupNumber (300c,006a) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedPatientSetupNumber; + /// ReferencedReferenceImageSequence (300c,0042) vr=SQ, vm=1, type=3 + DRTReferencedReferenceImageSequenceInRTIonBeamsModule ReferencedReferenceImageSequence; + /// ReferencedToleranceTableNumber (300c,00a0) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedToleranceTableNumber; + /// ScanMode (300a,0308) vr=CS, vm=1, type=1 + DcmCodeString ScanMode; + /// SnoutSequence (300a,030c) vr=SQ, vm=1, type=3 + DRTSnoutSequence SnoutSequence; + /// TotalBlockTrayWaterEquivalentThickness (300a,00f3) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TotalBlockTrayWaterEquivalentThickness; + /// TotalCompensatorTrayWaterEquivalentThickness (300a,02e3) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TotalCompensatorTrayWaterEquivalentThickness; + /// TotalWedgeTrayWaterEquivalentThickness (300a,00d7) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TotalWedgeTrayWaterEquivalentThickness; + /// TreatmentDeliveryType (300a,00ce) vr=CS, vm=1, type=1 + DcmCodeString TreatmentDeliveryType; + /// TreatmentMachineName (300a,00b2) vr=SH, vm=1, type=2 + DcmShortString TreatmentMachineName; + /// VirtualSourceAxisDistances (300a,030a) vr=FL, vm=2, type=1 + DcmFloatingPointSingle VirtualSourceAxisDistances; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonBeamSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonBeamSequence(const DRTIonBeamSequence ©); + + /** destructor + */ + virtual ~DRTIonBeamSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonBeamSequence &operator=(const DRTIonBeamSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drticpds.h b/dcmrt/include/dcmtk/dcmrt/seq/drticpds.h new file mode 100644 index 00000000..18034a99 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drticpds.h @@ -0,0 +1,1076 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonControlPointDeliverySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTICPDS_H +#define DRTICPDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbldps.h" // for BeamLimitingDevicePositionSequence +#include "dcmtk/dcmrt/seq/drtcpas.h" // for CorrectedParameterSequence +#include "dcmtk/dcmrt/seq/drtiwps.h" // for IonWedgePositionSequence +#include "dcmtk/dcmrt/seq/drtlsds7.h" // for LateralSpreadingDeviceSettingsSequence +#include "dcmtk/dcmrt/seq/drtos.h" // for OverrideSequence +#include "dcmtk/dcmrt/seq/drtrmss7.h" // for RangeModulatorSettingsSequence +#include "dcmtk/dcmrt/seq/drtrshs7.h" // for RangeShifterSettingsSequence + + +/** Interface class for IonControlPointDeliverySequence (3008,0041) in RTIonBeamsSessionRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTIonControlPointDeliverySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamLimitingDeviceRotationDirection (300a,0121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get ChairHeadFramePosition (300a,0151) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChairHeadFramePosition(OFString &value, const signed long pos = 0) const; + + /** get ChairHeadFramePosition (300a,0151) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChairHeadFramePosition(Float64 &value, const unsigned long pos = 0) const; + + /** get DeliveredMeterset (3008,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredMeterset(OFString &value, const signed long pos = 0) const; + + /** get DeliveredMeterset (3008,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(OFString &value, const signed long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryPitchAngle (300a,014a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get GantryPitchRotationDirection (300a,014c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get GantryRotationDirection (300a,011f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get HeadFixationAngle (300a,0148) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHeadFixationAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get KVP (0018,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getKVP(OFString &value, const signed long pos = 0) const; + + /** get KVP (0018,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getKVP(Float64 &value, const unsigned long pos = 0) const; + + /** get MetersetRateDelivered (3008,0046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMetersetRateDelivered(Float32 &value, const unsigned long pos = 0) const; + + /** get MetersetRateSet (3008,0045) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMetersetRateSet(Float32 &value, const unsigned long pos = 0) const; + + /** get NominalBeamEnergy (300a,0114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalBeamEnergy(OFString &value, const signed long pos = 0) const; + + /** get NominalBeamEnergy (300a,0114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalBeamEnergy(Float64 &value, const unsigned long pos = 0) const; + + /** get NumberOfPaintings (300a,039a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfPaintings(OFString &value, const signed long pos = 0) const; + + /** get NumberOfPaintings (300a,039a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfPaintings(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfScanSpotPositions (300a,0392) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfScanSpotPositions(OFString &value, const signed long pos = 0) const; + + /** get NumberOfScanSpotPositions (300a,0392) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfScanSpotPositions(Sint32 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSupportRotationDirection (300a,0123) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get ReferencedControlPointIndex (300c,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedControlPointIndex(OFString &value, const signed long pos = 0) const; + + /** get ReferencedControlPointIndex (300c,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedControlPointIndex(Sint32 &value, const unsigned long pos = 0) const; + + /** get ScanSpotMetersetsDelivered (3008,0047) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotMetersetsDelivered(Float32 &value, const unsigned long pos = 0) const; + + /** get ScanSpotPositionMap (300a,0394) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotPositionMap(Float32 &value, const unsigned long pos = 0) const; + + /** get ScanSpotPrescribedIndices (300a,0391) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotPrescribedIndices(OFString &value, const signed long pos = 0) const; + + /** get ScanSpotPrescribedIndices (300a,0391) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotPrescribedIndices(Sint32 &value, const unsigned long pos = 0) const; + + /** get ScanSpotReordered (300a,0393) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotReordered(OFString &value, const signed long pos = 0) const; + + /** get ScanSpotTimeOffset (300a,038f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotTimeOffset(Float32 &value, const unsigned long pos = 0) const; + + /** get ScanSpotTuneID (300a,0390) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotTuneID(OFString &value, const signed long pos = 0) const; + + /** get ScanningSpotSize (300a,0398) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanningSpotSize(Float32 &value, const unsigned long pos = 0) const; + + /** get SnoutPosition (300a,030d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSnoutPosition(Float32 &value, const unsigned long pos = 0) const; + + /** get SpecifiedMeterset (3008,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedMeterset(OFString &value, const signed long pos = 0) const; + + /** get SpecifiedMeterset (3008,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchAngle (300a,0140) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchRotationDirection (300a,0142) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get TableTopRollAngle (300a,0144) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopRollRotationDirection (300a,0146) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TreatmentControlPointDate (3008,0024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentControlPointDate(OFString &value, const signed long pos = 0) const; + + /** get TreatmentControlPointTime (3008,0025) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentControlPointTime(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BeamLimitingDevicePositionSequence (300a,011a) + * @return reference to sequence element + */ + DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence() + { return BeamLimitingDevicePositionSequence; } + + /** get BeamLimitingDevicePositionSequence (300a,011a) + * @return const reference to sequence element + */ + const DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence() const + { return BeamLimitingDevicePositionSequence; } + + /** get CorrectedParameterSequence (3008,0068) + * @return reference to sequence element + */ + DRTCorrectedParameterSequence &getCorrectedParameterSequence() + { return CorrectedParameterSequence; } + + /** get CorrectedParameterSequence (3008,0068) + * @return const reference to sequence element + */ + const DRTCorrectedParameterSequence &getCorrectedParameterSequence() const + { return CorrectedParameterSequence; } + + /** get IonWedgePositionSequence (300a,03ac) + * @return reference to sequence element + */ + DRTIonWedgePositionSequence &getIonWedgePositionSequence() + { return IonWedgePositionSequence; } + + /** get IonWedgePositionSequence (300a,03ac) + * @return const reference to sequence element + */ + const DRTIonWedgePositionSequence &getIonWedgePositionSequence() const + { return IonWedgePositionSequence; } + + /** get LateralSpreadingDeviceSettingsSequence (300a,0370) + * @return reference to sequence element + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule &getLateralSpreadingDeviceSettingsSequence() + { return LateralSpreadingDeviceSettingsSequence; } + + /** get LateralSpreadingDeviceSettingsSequence (300a,0370) + * @return const reference to sequence element + */ + const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule &getLateralSpreadingDeviceSettingsSequence() const + { return LateralSpreadingDeviceSettingsSequence; } + + /** get OverrideSequence (3008,0060) + * @return reference to sequence element + */ + DRTOverrideSequence &getOverrideSequence() + { return OverrideSequence; } + + /** get OverrideSequence (3008,0060) + * @return const reference to sequence element + */ + const DRTOverrideSequence &getOverrideSequence() const + { return OverrideSequence; } + + /** get RangeModulatorSettingsSequence (300a,0380) + * @return reference to sequence element + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeModulatorSettingsSequence() + { return RangeModulatorSettingsSequence; } + + /** get RangeModulatorSettingsSequence (300a,0380) + * @return const reference to sequence element + */ + const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeModulatorSettingsSequence() const + { return RangeModulatorSettingsSequence; } + + /** get RangeShifterSettingsSequence (300a,0360) + * @return reference to sequence element + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeShifterSettingsSequence() + { return RangeShifterSettingsSequence; } + + /** get RangeShifterSettingsSequence (300a,0360) + * @return const reference to sequence element + */ + const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeShifterSettingsSequence() const + { return RangeShifterSettingsSequence; } + + // --- set DICOM attribute values --- + + /** set BeamLimitingDeviceAngle (300a,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceAngle(const OFString &value, const OFBool check = OFTrue); + + /** set BeamLimitingDeviceRotationDirection (300a,0121) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set ChairHeadFramePosition (300a,0151) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChairHeadFramePosition(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveredMeterset (3008,0044) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set GantryAngle (300a,011e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryAngle(const OFString &value, const OFBool check = OFTrue); + + /** set GantryPitchAngle (300a,014a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set GantryPitchRotationDirection (300a,014c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set GantryRotationDirection (300a,011f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set HeadFixationAngle (300a,0148) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHeadFixationAngle(const Float32 value, const unsigned long pos = 0); + + /** set KVP (0018,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setKVP(const OFString &value, const OFBool check = OFTrue); + + /** set MetersetRateDelivered (3008,0046) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMetersetRateDelivered(const Float32 value, const unsigned long pos = 0); + + /** set MetersetRateSet (3008,0045) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMetersetRateSet(const Float32 value, const unsigned long pos = 0); + + /** set NominalBeamEnergy (300a,0114) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNominalBeamEnergy(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfPaintings (300a,039a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfPaintings(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfScanSpotPositions (300a,0392) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfScanSpotPositions(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAngle (300a,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAngle(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportRotationDirection (300a,0123) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedControlPointIndex (300c,00f0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedControlPointIndex(const OFString &value, const OFBool check = OFTrue); + + /** set ScanSpotMetersetsDelivered (3008,0047) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotMetersetsDelivered(const Float32 value, const unsigned long pos = 0); + + /** set ScanSpotPositionMap (300a,0394) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotPositionMap(const Float32 value, const unsigned long pos = 0); + + /** set ScanSpotPrescribedIndices (300a,0391) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotPrescribedIndices(const OFString &value, const OFBool check = OFTrue); + + /** set ScanSpotReordered (300a,0393) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotReordered(const OFString &value, const OFBool check = OFTrue); + + /** set ScanSpotTimeOffset (300a,038f) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotTimeOffset(const Float32 value, const unsigned long pos = 0); + + /** set ScanSpotTuneID (300a,0390) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotTuneID(const OFString &value, const OFBool check = OFTrue); + + /** set ScanningSpotSize (300a,0398) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanningSpotSize(const Float32 value, const unsigned long pos = 0); + + /** set SnoutPosition (300a,030d) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSnoutPosition(const Float32 value, const unsigned long pos = 0); + + /** set SpecifiedMeterset (3008,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpecifiedMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLateralPosition (300a,012a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLateralPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalPosition (300a,0129) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLongitudinalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopPitchAngle (300a,0140) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopPitchRotationDirection (300a,0142) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopRollAngle (300a,0144) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopRollRotationDirection (300a,0146) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopVerticalPosition (300a,0128) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopVerticalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentControlPointDate (3008,0024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentControlPointDate(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentControlPointTime (3008,0025) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentControlPointTime(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamLimitingDeviceAngle (300a,0120) vr=DS, vm=1, type=1C + DcmDecimalString BeamLimitingDeviceAngle; + /// BeamLimitingDevicePositionSequence (300a,011a) vr=SQ, vm=1, type=1C + DRTBeamLimitingDevicePositionSequence BeamLimitingDevicePositionSequence; + /// BeamLimitingDeviceRotationDirection (300a,0121) vr=CS, vm=1, type=1C + DcmCodeString BeamLimitingDeviceRotationDirection; + /// ChairHeadFramePosition (300a,0151) vr=DS, vm=1, type=3 + DcmDecimalString ChairHeadFramePosition; + /// CorrectedParameterSequence (3008,0068) vr=SQ, vm=1, type=3 + DRTCorrectedParameterSequence CorrectedParameterSequence; + /// DeliveredMeterset (3008,0044) vr=DS, vm=1, type=1 + DcmDecimalString DeliveredMeterset; + /// GantryAngle (300a,011e) vr=DS, vm=1, type=1C + DcmDecimalString GantryAngle; + /// GantryPitchAngle (300a,014a) vr=FL, vm=1, type=2C + DcmFloatingPointSingle GantryPitchAngle; + /// GantryPitchRotationDirection (300a,014c) vr=CS, vm=1, type=2C + DcmCodeString GantryPitchRotationDirection; + /// GantryRotationDirection (300a,011f) vr=CS, vm=1, type=1C + DcmCodeString GantryRotationDirection; + /// HeadFixationAngle (300a,0148) vr=FL, vm=1, type=3 + DcmFloatingPointSingle HeadFixationAngle; + /// IonWedgePositionSequence (300a,03ac) vr=SQ, vm=1, type=1C + DRTIonWedgePositionSequence IonWedgePositionSequence; + /// KVP (0018,0060) vr=DS, vm=1, type=1C + DcmDecimalString KVP; + /// LateralSpreadingDeviceSettingsSequence (300a,0370) vr=SQ, vm=1, type=1C + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule LateralSpreadingDeviceSettingsSequence; + /// MetersetRateDelivered (3008,0046) vr=FL, vm=1, type=3 + DcmFloatingPointSingle MetersetRateDelivered; + /// MetersetRateSet (3008,0045) vr=FL, vm=1, type=3 + DcmFloatingPointSingle MetersetRateSet; + /// NominalBeamEnergy (300a,0114) vr=DS, vm=1, type=1C + DcmDecimalString NominalBeamEnergy; + /// NumberOfPaintings (300a,039a) vr=IS, vm=1, type=1C + DcmIntegerString NumberOfPaintings; + /// NumberOfScanSpotPositions (300a,0392) vr=IS, vm=1, type=1C + DcmIntegerString NumberOfScanSpotPositions; + /// OverrideSequence (3008,0060) vr=SQ, vm=1, type=3 + DRTOverrideSequence OverrideSequence; + /// PatientSupportAngle (300a,0122) vr=DS, vm=1, type=1C + DcmDecimalString PatientSupportAngle; + /// PatientSupportRotationDirection (300a,0123) vr=CS, vm=1, type=1C + DcmCodeString PatientSupportRotationDirection; + /// RangeModulatorSettingsSequence (300a,0380) vr=SQ, vm=1, type=1C + DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule RangeModulatorSettingsSequence; + /// RangeShifterSettingsSequence (300a,0360) vr=SQ, vm=1, type=1C + DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule RangeShifterSettingsSequence; + /// ReferencedControlPointIndex (300c,00f0) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedControlPointIndex; + /// ScanSpotMetersetsDelivered (3008,0047) vr=FL, vm=1-n, type=1C + DcmFloatingPointSingle ScanSpotMetersetsDelivered; + /// ScanSpotPositionMap (300a,0394) vr=FL, vm=1-n, type=1C + DcmFloatingPointSingle ScanSpotPositionMap; + /// ScanSpotPrescribedIndices (300a,0391) vr=IS, vm=1-n, type=1C + DcmIntegerString ScanSpotPrescribedIndices; + /// ScanSpotReordered (300a,0393) vr=CS, vm=1, type=3 + DcmCodeString ScanSpotReordered; + /// ScanSpotTimeOffset (300a,038f) vr=FL, vm=1-n, type=3 + DcmFloatingPointSingle ScanSpotTimeOffset; + /// ScanSpotTuneID (300a,0390) vr=SH, vm=1, type=1C + DcmShortString ScanSpotTuneID; + /// ScanningSpotSize (300a,0398) vr=FL, vm=2, type=3 + DcmFloatingPointSingle ScanningSpotSize; + /// SnoutPosition (300a,030d) vr=FL, vm=1, type=2C + DcmFloatingPointSingle SnoutPosition; + /// SpecifiedMeterset (3008,0042) vr=DS, vm=1, type=2 + DcmDecimalString SpecifiedMeterset; + /// TableTopLateralPosition (300a,012a) vr=DS, vm=1, type=2C + DcmDecimalString TableTopLateralPosition; + /// TableTopLongitudinalPosition (300a,0129) vr=DS, vm=1, type=2C + DcmDecimalString TableTopLongitudinalPosition; + /// TableTopPitchAngle (300a,0140) vr=FL, vm=1, type=2C + DcmFloatingPointSingle TableTopPitchAngle; + /// TableTopPitchRotationDirection (300a,0142) vr=CS, vm=1, type=2C + DcmCodeString TableTopPitchRotationDirection; + /// TableTopRollAngle (300a,0144) vr=FL, vm=1, type=2C + DcmFloatingPointSingle TableTopRollAngle; + /// TableTopRollRotationDirection (300a,0146) vr=CS, vm=1, type=2C + DcmCodeString TableTopRollRotationDirection; + /// TableTopVerticalPosition (300a,0128) vr=DS, vm=1, type=2C + DcmDecimalString TableTopVerticalPosition; + /// TreatmentControlPointDate (3008,0024) vr=DA, vm=1, type=1 + DcmDate TreatmentControlPointDate; + /// TreatmentControlPointTime (3008,0025) vr=TM, vm=1, type=1 + DcmTime TreatmentControlPointTime; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonControlPointDeliverySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonControlPointDeliverySequence(const DRTIonControlPointDeliverySequence ©); + + /** destructor + */ + virtual ~DRTIonControlPointDeliverySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonControlPointDeliverySequence &operator=(const DRTIonControlPointDeliverySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drticps.h b/dcmrt/include/dcmtk/dcmrt/seq/drticps.h new file mode 100644 index 00000000..2ada246b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drticps.h @@ -0,0 +1,1025 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTICPS_H +#define DRTICPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbldps.h" // for BeamLimitingDevicePositionSequence +#include "dcmtk/dcmrt/seq/drtiwps.h" // for IonWedgePositionSequence +#include "dcmtk/dcmrt/seq/drtlsds6.h" // for LateralSpreadingDeviceSettingsSequence +#include "dcmtk/dcmrt/seq/drtrmss6.h" // for RangeModulatorSettingsSequence +#include "dcmtk/dcmrt/seq/drtrshs6.h" // for RangeShifterSettingsSequence +#include "dcmtk/dcmrt/seq/drtrdrs6.h" // for ReferencedDoseReferenceSequence + + +/** Interface class for IonControlPointSequence (300a,03a8) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTIonControlPointSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngle (300a,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamLimitingDeviceRotationDirection (300a,0121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get ChairHeadFramePosition (300a,0151) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChairHeadFramePosition(OFString &value, const signed long pos = 0) const; + + /** get ChairHeadFramePosition (300a,0151) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChairHeadFramePosition(Float64 &value, const unsigned long pos = 0) const; + + /** get ControlPointIndex (300a,0112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointIndex(OFString &value, const signed long pos = 0) const; + + /** get ControlPointIndex (300a,0112) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getControlPointIndex(Sint32 &value, const unsigned long pos = 0) const; + + /** get CumulativeMetersetWeight (300a,0134) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get CumulativeMetersetWeight (300a,0134) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get ExternalContourEntryPoint (300a,0133) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getExternalContourEntryPoint(Float32 &value, const unsigned long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(OFString &value, const signed long pos = 0) const; + + /** get GantryAngle (300a,011e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryPitchAngle (300a,014a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get GantryPitchRotationDirection (300a,014c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get GantryRotationDirection (300a,011f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get HeadFixationAngle (300a,0148) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHeadFixationAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterPosition(OFString &value, const signed long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get IsocenterPosition (300a,012c) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterPosition(OFVector &value) const; + + /** get KVP (0018,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getKVP(OFString &value, const signed long pos = 0) const; + + /** get KVP (0018,0060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getKVP(Float64 &value, const unsigned long pos = 0) const; + + /** get MetersetRate (300a,035a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMetersetRate(Float32 &value, const unsigned long pos = 0) const; + + /** get NominalBeamEnergy (300a,0114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalBeamEnergy(OFString &value, const signed long pos = 0) const; + + /** get NominalBeamEnergy (300a,0114) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNominalBeamEnergy(Float64 &value, const unsigned long pos = 0) const; + + /** get NumberOfPaintings (300a,039a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfPaintings(OFString &value, const signed long pos = 0) const; + + /** get NumberOfPaintings (300a,039a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfPaintings(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfScanSpotPositions (300a,0392) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfScanSpotPositions(OFString &value, const signed long pos = 0) const; + + /** get NumberOfScanSpotPositions (300a,0392) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfScanSpotPositions(Sint32 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngle (300a,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSupportRotationDirection (300a,0123) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get ScanSpotMetersetWeights (300a,0396) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotMetersetWeights(Float32 &value, const unsigned long pos = 0) const; + + /** get ScanSpotPositionMap (300a,0394) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotPositionMap(Float32 &value, const unsigned long pos = 0) const; + + /** get ScanSpotReorderingAllowed (300a,0395) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotReorderingAllowed(OFString &value, const signed long pos = 0) const; + + /** get ScanSpotTuneID (300a,0390) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanSpotTuneID(OFString &value, const signed long pos = 0) const; + + /** get ScanningSpotSize (300a,0398) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanningSpotSize(Float32 &value, const unsigned long pos = 0) const; + + /** get SnoutPosition (300a,030d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSnoutPosition(Float32 &value, const unsigned long pos = 0) const; + + /** get SurfaceEntryPoint (300a,012e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSurfaceEntryPoint(OFString &value, const signed long pos = 0) const; + + /** get SurfaceEntryPoint (300a,012e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSurfaceEntryPoint(Float64 &value, const unsigned long pos = 0) const; + + /** get SurfaceEntryPoint (300a,012e) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSurfaceEntryPoint(OFVector &value) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPosition (300a,012a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalPosition (300a,0129) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchAngle (300a,0140) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchRotationDirection (300a,0142) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get TableTopRollAngle (300a,0144) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopRollRotationDirection (300a,0146) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollRotationDirection(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPosition (300a,0128) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPosition(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BeamLimitingDevicePositionSequence (300a,011a) + * @return reference to sequence element + */ + DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence() + { return BeamLimitingDevicePositionSequence; } + + /** get BeamLimitingDevicePositionSequence (300a,011a) + * @return const reference to sequence element + */ + const DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence() const + { return BeamLimitingDevicePositionSequence; } + + /** get IonWedgePositionSequence (300a,03ac) + * @return reference to sequence element + */ + DRTIonWedgePositionSequence &getIonWedgePositionSequence() + { return IonWedgePositionSequence; } + + /** get IonWedgePositionSequence (300a,03ac) + * @return const reference to sequence element + */ + const DRTIonWedgePositionSequence &getIonWedgePositionSequence() const + { return IonWedgePositionSequence; } + + /** get LateralSpreadingDeviceSettingsSequence (300a,0370) + * @return reference to sequence element + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule &getLateralSpreadingDeviceSettingsSequence() + { return LateralSpreadingDeviceSettingsSequence; } + + /** get LateralSpreadingDeviceSettingsSequence (300a,0370) + * @return const reference to sequence element + */ + const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule &getLateralSpreadingDeviceSettingsSequence() const + { return LateralSpreadingDeviceSettingsSequence; } + + /** get RangeModulatorSettingsSequence (300a,0380) + * @return reference to sequence element + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsModule &getRangeModulatorSettingsSequence() + { return RangeModulatorSettingsSequence; } + + /** get RangeModulatorSettingsSequence (300a,0380) + * @return const reference to sequence element + */ + const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule &getRangeModulatorSettingsSequence() const + { return RangeModulatorSettingsSequence; } + + /** get RangeShifterSettingsSequence (300a,0360) + * @return reference to sequence element + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsModule &getRangeShifterSettingsSequence() + { return RangeShifterSettingsSequence; } + + /** get RangeShifterSettingsSequence (300a,0360) + * @return const reference to sequence element + */ + const DRTRangeShifterSettingsSequenceInRTIonBeamsModule &getRangeShifterSettingsSequence() const + { return RangeShifterSettingsSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return reference to sequence element + */ + DRTReferencedDoseReferenceSequenceInRTIonBeamsModule &getReferencedDoseReferenceSequence() + { return ReferencedDoseReferenceSequence; } + + /** get ReferencedDoseReferenceSequence (300c,0050) + * @return const reference to sequence element + */ + const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule &getReferencedDoseReferenceSequence() const + { return ReferencedDoseReferenceSequence; } + + // --- set DICOM attribute values --- + + /** set BeamLimitingDeviceAngle (300a,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceAngle(const OFString &value, const OFBool check = OFTrue); + + /** set BeamLimitingDeviceRotationDirection (300a,0121) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set ChairHeadFramePosition (300a,0151) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChairHeadFramePosition(const OFString &value, const OFBool check = OFTrue); + + /** set ControlPointIndex (300a,0112) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setControlPointIndex(const OFString &value, const OFBool check = OFTrue); + + /** set CumulativeMetersetWeight (300a,0134) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set ExternalContourEntryPoint (300a,0133) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setExternalContourEntryPoint(const Float32 value, const unsigned long pos = 0); + + /** set GantryAngle (300a,011e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryAngle(const OFString &value, const OFBool check = OFTrue); + + /** set GantryPitchAngle (300a,014a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set GantryPitchRotationDirection (300a,014c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set GantryRotationDirection (300a,011f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set HeadFixationAngle (300a,0148) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHeadFixationAngle(const Float32 value, const unsigned long pos = 0); + + /** set IsocenterPosition (300a,012c) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterPosition(const OFString &value, const OFBool check = OFTrue); + + /** set KVP (0018,0060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setKVP(const OFString &value, const OFBool check = OFTrue); + + /** set MetersetRate (300a,035a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMetersetRate(const Float32 value, const unsigned long pos = 0); + + /** set NominalBeamEnergy (300a,0114) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNominalBeamEnergy(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfPaintings (300a,039a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfPaintings(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfScanSpotPositions (300a,0392) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfScanSpotPositions(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAngle (300a,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAngle(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportRotationDirection (300a,0123) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set ScanSpotMetersetWeights (300a,0396) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotMetersetWeights(const Float32 value, const unsigned long pos = 0); + + /** set ScanSpotPositionMap (300a,0394) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotPositionMap(const Float32 value, const unsigned long pos = 0); + + /** set ScanSpotReorderingAllowed (300a,0395) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotReorderingAllowed(const OFString &value, const OFBool check = OFTrue); + + /** set ScanSpotTuneID (300a,0390) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanSpotTuneID(const OFString &value, const OFBool check = OFTrue); + + /** set ScanningSpotSize (300a,0398) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanningSpotSize(const Float32 value, const unsigned long pos = 0); + + /** set SnoutPosition (300a,030d) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSnoutPosition(const Float32 value, const unsigned long pos = 0); + + /** set SurfaceEntryPoint (300a,012e) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSurfaceEntryPoint(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLateralPosition (300a,012a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLateralPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalPosition (300a,0129) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLongitudinalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopPitchAngle (300a,0140) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopPitchRotationDirection (300a,0142) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopRollAngle (300a,0144) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollAngle(const Float32 value, const unsigned long pos = 0); + + /** set TableTopRollRotationDirection (300a,0146) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollRotationDirection(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopVerticalPosition (300a,0128) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopVerticalPosition(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamLimitingDeviceAngle (300a,0120) vr=DS, vm=1, type=1C + DcmDecimalString BeamLimitingDeviceAngle; + /// BeamLimitingDevicePositionSequence (300a,011a) vr=SQ, vm=1, type=1C + DRTBeamLimitingDevicePositionSequence BeamLimitingDevicePositionSequence; + /// BeamLimitingDeviceRotationDirection (300a,0121) vr=CS, vm=1, type=1C + DcmCodeString BeamLimitingDeviceRotationDirection; + /// ChairHeadFramePosition (300a,0151) vr=DS, vm=1, type=3 + DcmDecimalString ChairHeadFramePosition; + /// ControlPointIndex (300a,0112) vr=IS, vm=1, type=1 + DcmIntegerString ControlPointIndex; + /// CumulativeMetersetWeight (300a,0134) vr=DS, vm=1, type=2 + DcmDecimalString CumulativeMetersetWeight; + /// ExternalContourEntryPoint (300a,0133) vr=FL, vm=3, type=3 + DcmFloatingPointSingle ExternalContourEntryPoint; + /// GantryAngle (300a,011e) vr=DS, vm=1, type=1C + DcmDecimalString GantryAngle; + /// GantryPitchAngle (300a,014a) vr=FL, vm=1, type=2C + DcmFloatingPointSingle GantryPitchAngle; + /// GantryPitchRotationDirection (300a,014c) vr=CS, vm=1, type=2C + DcmCodeString GantryPitchRotationDirection; + /// GantryRotationDirection (300a,011f) vr=CS, vm=1, type=1C + DcmCodeString GantryRotationDirection; + /// HeadFixationAngle (300a,0148) vr=FL, vm=1, type=3 + DcmFloatingPointSingle HeadFixationAngle; + /// IonWedgePositionSequence (300a,03ac) vr=SQ, vm=1, type=1C + DRTIonWedgePositionSequence IonWedgePositionSequence; + /// IsocenterPosition (300a,012c) vr=DS, vm=3, type=2C + DcmDecimalString IsocenterPosition; + /// KVP (0018,0060) vr=DS, vm=1, type=1C + DcmDecimalString KVP; + /// LateralSpreadingDeviceSettingsSequence (300a,0370) vr=SQ, vm=1, type=1C + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule LateralSpreadingDeviceSettingsSequence; + /// MetersetRate (300a,035a) vr=FL, vm=1, type=3 + DcmFloatingPointSingle MetersetRate; + /// NominalBeamEnergy (300a,0114) vr=DS, vm=1, type=1C + DcmDecimalString NominalBeamEnergy; + /// NumberOfPaintings (300a,039a) vr=IS, vm=1, type=1C + DcmIntegerString NumberOfPaintings; + /// NumberOfScanSpotPositions (300a,0392) vr=IS, vm=1, type=1C + DcmIntegerString NumberOfScanSpotPositions; + /// PatientSupportAngle (300a,0122) vr=DS, vm=1, type=1C + DcmDecimalString PatientSupportAngle; + /// PatientSupportRotationDirection (300a,0123) vr=CS, vm=1, type=1C + DcmCodeString PatientSupportRotationDirection; + /// RangeModulatorSettingsSequence (300a,0380) vr=SQ, vm=1, type=1C + DRTRangeModulatorSettingsSequenceInRTIonBeamsModule RangeModulatorSettingsSequence; + /// RangeShifterSettingsSequence (300a,0360) vr=SQ, vm=1, type=1C + DRTRangeShifterSettingsSequenceInRTIonBeamsModule RangeShifterSettingsSequence; + /// ReferencedDoseReferenceSequence (300c,0050) vr=SQ, vm=1, type=3 + DRTReferencedDoseReferenceSequenceInRTIonBeamsModule ReferencedDoseReferenceSequence; + /// ScanSpotMetersetWeights (300a,0396) vr=FL, vm=1-n, type=1C + DcmFloatingPointSingle ScanSpotMetersetWeights; + /// ScanSpotPositionMap (300a,0394) vr=FL, vm=1-n, type=1C + DcmFloatingPointSingle ScanSpotPositionMap; + /// ScanSpotReorderingAllowed (300a,0395) vr=CS, vm=1, type=3 + DcmCodeString ScanSpotReorderingAllowed; + /// ScanSpotTuneID (300a,0390) vr=SH, vm=1, type=1C + DcmShortString ScanSpotTuneID; + /// ScanningSpotSize (300a,0398) vr=FL, vm=2, type=3 + DcmFloatingPointSingle ScanningSpotSize; + /// SnoutPosition (300a,030d) vr=FL, vm=1, type=2C + DcmFloatingPointSingle SnoutPosition; + /// SurfaceEntryPoint (300a,012e) vr=DS, vm=3, type=3 + DcmDecimalString SurfaceEntryPoint; + /// TableTopLateralPosition (300a,012a) vr=DS, vm=1, type=2C + DcmDecimalString TableTopLateralPosition; + /// TableTopLongitudinalPosition (300a,0129) vr=DS, vm=1, type=2C + DcmDecimalString TableTopLongitudinalPosition; + /// TableTopPitchAngle (300a,0140) vr=FL, vm=1, type=2C + DcmFloatingPointSingle TableTopPitchAngle; + /// TableTopPitchRotationDirection (300a,0142) vr=CS, vm=1, type=2C + DcmCodeString TableTopPitchRotationDirection; + /// TableTopRollAngle (300a,0144) vr=FL, vm=1, type=2C + DcmFloatingPointSingle TableTopRollAngle; + /// TableTopRollRotationDirection (300a,0146) vr=CS, vm=1, type=2C + DcmCodeString TableTopRollRotationDirection; + /// TableTopVerticalPosition (300a,0128) vr=DS, vm=1, type=2C + DcmDecimalString TableTopVerticalPosition; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonControlPointSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonControlPointSequence(const DRTIonControlPointSequence ©); + + /** destructor + */ + virtual ~DRTIonControlPointSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonControlPointSequence &operator=(const DRTIonControlPointSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtics.h b/dcmrt/include/dcmtk/dcmrt/seq/drtics.h new file mode 100644 index 00000000..9b6a7c75 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtics.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTInstitutionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTICS_H +#define DRTICS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for InstitutionCodeSequence (0008,0082) + */ +class DCMTK_DCMRT_EXPORT DRTInstitutionCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTInstitutionCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTInstitutionCodeSequence(const DRTInstitutionCodeSequence ©); + + /** destructor + */ + virtual ~DRTInstitutionCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTInstitutionCodeSequence &operator=(const DRTInstitutionCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtiis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtiis.h new file mode 100644 index 00000000..ad0f1f4e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtiis.h @@ -0,0 +1,631 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIconImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIIS_H +#define DRTIIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IconImageSequence (0088,0200) + */ +class DCMTK_DCMRT_EXPORT DRTIconImageSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BitsAllocated (0028,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBitsAllocated(Uint16 &value, const unsigned long pos = 0) const; + + /** get BitsStored (0028,0101) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBitsStored(Uint16 &value, const unsigned long pos = 0) const; + + /** get BluePaletteColorLookupTableData (0028,1203) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBluePaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get BluePaletteColorLookupTableDescriptor (0028,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBluePaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get ColorSpace (0028,2002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getColorSpace(OFString &value, const signed long pos = 0) const; + + /** get Columns (0028,0011) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getColumns(Uint16 &value, const unsigned long pos = 0) const; + + /** get GreenPaletteColorLookupTableData (0028,1202) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGreenPaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get GreenPaletteColorLookupTableDescriptor (0028,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGreenPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get HighBit (0028,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHighBit(Uint16 &value, const unsigned long pos = 0) const; + + /** get ICCProfile (0028,2000) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getICCProfile(Uint8 *&value, unsigned long *count = NULL) const; + + /** get LargestImagePixelValue (0028,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLargestImagePixelValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get PhotometricInterpretation (0028,0004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPhotometricInterpretation(OFString &value, const signed long pos = 0) const; + + /** get PixelAspectRatio (0028,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPixelAspectRatio(OFString &value, const signed long pos = 0) const; + + /** get PixelAspectRatio (0028,0034) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPixelAspectRatio(Sint32 &value, const unsigned long pos = 0) const; + + /** get PixelRepresentation (0028,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPixelRepresentation(Uint16 &value, const unsigned long pos = 0) const; + + /** get PlanarConfiguration (0028,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPlanarConfiguration(Uint16 &value, const unsigned long pos = 0) const; + + /** get RedPaletteColorLookupTableData (0028,1201) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRedPaletteColorLookupTableData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get RedPaletteColorLookupTableDescriptor (0028,1101) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRedPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get Rows (0028,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRows(Uint16 &value, const unsigned long pos = 0) const; + + /** get SamplesPerPixel (0028,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSamplesPerPixel(Uint16 &value, const unsigned long pos = 0) const; + + /** get SmallestImagePixelValue (0028,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSmallestImagePixelValue(Uint16 &value, const unsigned long pos = 0) const; + + // --- get pixel data element --- + + /** get PixelData (7fe0,0010) + * @return reference to pixel data element + */ + DcmPixelData &getPixelData() + { return PixelData; } + + /** get PixelData (7fe0,0010) + * @return const reference to pixel data element + */ + const DcmPixelData &getPixelData() const + { return PixelData; } + + // --- set DICOM attribute values --- + + /** set BitsAllocated (0028,0100) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBitsAllocated(const Uint16 value, const unsigned long pos = 0); + + /** set BitsStored (0028,0101) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBitsStored(const Uint16 value, const unsigned long pos = 0); + + /** set BluePaletteColorLookupTableData (0028,1203) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBluePaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set BluePaletteColorLookupTableDescriptor (0028,1103) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBluePaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set ColorSpace (0028,2002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setColorSpace(const OFString &value, const OFBool check = OFTrue); + + /** set Columns (0028,0011) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setColumns(const Uint16 value, const unsigned long pos = 0); + + /** set GreenPaletteColorLookupTableData (0028,1202) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGreenPaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set GreenPaletteColorLookupTableDescriptor (0028,1102) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGreenPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set HighBit (0028,0102) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHighBit(const Uint16 value, const unsigned long pos = 0); + + /** set ICCProfile (0028,2000) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setICCProfile(const Uint8 *value, const unsigned long count); + + /** set LargestImagePixelValue (0028,0107) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLargestImagePixelValue(const Uint16 value, const unsigned long pos = 0); + + /** set PhotometricInterpretation (0028,0004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPhotometricInterpretation(const OFString &value, const OFBool check = OFTrue); + + /** set PixelAspectRatio (0028,0034) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPixelAspectRatio(const OFString &value, const OFBool check = OFTrue); + + /** set PixelRepresentation (0028,0103) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPixelRepresentation(const Uint16 value, const unsigned long pos = 0); + + /** set PlanarConfiguration (0028,0006) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPlanarConfiguration(const Uint16 value, const unsigned long pos = 0); + + /** set RedPaletteColorLookupTableData (0028,1201) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRedPaletteColorLookupTableData(const Uint16 *value, const unsigned long count); + + /** set RedPaletteColorLookupTableDescriptor (0028,1101) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRedPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set Rows (0028,0010) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRows(const Uint16 value, const unsigned long pos = 0); + + /** set SamplesPerPixel (0028,0002) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSamplesPerPixel(const Uint16 value, const unsigned long pos = 0); + + /** set SmallestImagePixelValue (0028,0106) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSmallestImagePixelValue(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BitsAllocated (0028,0100) vr=US, vm=1, type=1 + DcmUnsignedShort BitsAllocated; + /// BitsStored (0028,0101) vr=US, vm=1, type=1 + DcmUnsignedShort BitsStored; + /// BluePaletteColorLookupTableData (0028,1203) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord BluePaletteColorLookupTableData; + /// BluePaletteColorLookupTableDescriptor (0028,1103) vr=US/SS, vm=3, type=1C + DcmUnsignedShort BluePaletteColorLookupTableDescriptor; + /// ColorSpace (0028,2002) vr=CS, vm=1, type=3 + DcmCodeString ColorSpace; + /// Columns (0028,0011) vr=US, vm=1, type=1 + DcmUnsignedShort Columns; + /// GreenPaletteColorLookupTableData (0028,1202) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord GreenPaletteColorLookupTableData; + /// GreenPaletteColorLookupTableDescriptor (0028,1102) vr=US/SS, vm=3, type=1C + DcmUnsignedShort GreenPaletteColorLookupTableDescriptor; + /// HighBit (0028,0102) vr=US, vm=1, type=1 + DcmUnsignedShort HighBit; + /// ICCProfile (0028,2000) vr=OB, vm=1, type=3 + DcmOtherByteOtherWord ICCProfile; + /// LargestImagePixelValue (0028,0107) vr=US/SS, vm=1, type=3 + DcmUnsignedShort LargestImagePixelValue; + /// PhotometricInterpretation (0028,0004) vr=CS, vm=1, type=1 + DcmCodeString PhotometricInterpretation; + /// PixelAspectRatio (0028,0034) vr=IS, vm=2, type=1C + DcmIntegerString PixelAspectRatio; + /// PixelData (7fe0,0010) vr=OB/OW, vm=1, type=1 + DcmPixelData PixelData; + /// PixelRepresentation (0028,0103) vr=US, vm=1, type=1 + DcmUnsignedShort PixelRepresentation; + /// PlanarConfiguration (0028,0006) vr=US, vm=1, type=1C + DcmUnsignedShort PlanarConfiguration; + /// RedPaletteColorLookupTableData (0028,1201) vr=OW, vm=1, type=1C + DcmOtherByteOtherWord RedPaletteColorLookupTableData; + /// RedPaletteColorLookupTableDescriptor (0028,1101) vr=US/SS, vm=3, type=1C + DcmUnsignedShort RedPaletteColorLookupTableDescriptor; + /// Rows (0028,0010) vr=US, vm=1, type=1 + DcmUnsignedShort Rows; + /// SamplesPerPixel (0028,0002) vr=US, vm=1, type=1 + DcmUnsignedShort SamplesPerPixel; + /// SmallestImagePixelValue (0028,0106) vr=US/SS, vm=1, type=3 + DcmUnsignedShort SmallestImagePixelValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIconImageSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIconImageSequence(const DRTIconImageSequence ©); + + /** destructor + */ + virtual ~DRTIconImageSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIconImageSequence &operator=(const DRTIconImageSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtipiqs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtipiqs.h new file mode 100644 index 00000000..e0532ec7 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtipiqs.h @@ -0,0 +1,383 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIssuerOfPatientIDQualifiersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIPIQS_H +#define DRTIPIQS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtaadcs.h" // for AssigningAgencyOrDepartmentCodeSequence +#include "dcmtk/dcmrt/seq/drtafs.h" // for AssigningFacilitySequence +#include "dcmtk/dcmrt/seq/drtajcs.h" // for AssigningJurisdictionCodeSequence + + +/** Interface class for IssuerOfPatientIDQualifiersSequence (0010,0024) + */ +class DCMTK_DCMRT_EXPORT DRTIssuerOfPatientIDQualifiersSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IdentifierTypeCode (0040,0035) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIdentifierTypeCode(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityID (0040,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityIDType (0040,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityIDType(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get AssigningAgencyOrDepartmentCodeSequence (0040,003a) + * @return reference to sequence element + */ + DRTAssigningAgencyOrDepartmentCodeSequence &getAssigningAgencyOrDepartmentCodeSequence() + { return AssigningAgencyOrDepartmentCodeSequence; } + + /** get AssigningAgencyOrDepartmentCodeSequence (0040,003a) + * @return const reference to sequence element + */ + const DRTAssigningAgencyOrDepartmentCodeSequence &getAssigningAgencyOrDepartmentCodeSequence() const + { return AssigningAgencyOrDepartmentCodeSequence; } + + /** get AssigningFacilitySequence (0040,0036) + * @return reference to sequence element + */ + DRTAssigningFacilitySequence &getAssigningFacilitySequence() + { return AssigningFacilitySequence; } + + /** get AssigningFacilitySequence (0040,0036) + * @return const reference to sequence element + */ + const DRTAssigningFacilitySequence &getAssigningFacilitySequence() const + { return AssigningFacilitySequence; } + + /** get AssigningJurisdictionCodeSequence (0040,0039) + * @return reference to sequence element + */ + DRTAssigningJurisdictionCodeSequence &getAssigningJurisdictionCodeSequence() + { return AssigningJurisdictionCodeSequence; } + + /** get AssigningJurisdictionCodeSequence (0040,0039) + * @return const reference to sequence element + */ + const DRTAssigningJurisdictionCodeSequence &getAssigningJurisdictionCodeSequence() const + { return AssigningJurisdictionCodeSequence; } + + // --- set DICOM attribute values --- + + /** set IdentifierTypeCode (0040,0035) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIdentifierTypeCode(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityID (0040,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityIDType (0040,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityIDType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AssigningAgencyOrDepartmentCodeSequence (0040,003a) vr=SQ, vm=1, type=3 + DRTAssigningAgencyOrDepartmentCodeSequence AssigningAgencyOrDepartmentCodeSequence; + /// AssigningFacilitySequence (0040,0036) vr=SQ, vm=1, type=3 + DRTAssigningFacilitySequence AssigningFacilitySequence; + /// AssigningJurisdictionCodeSequence (0040,0039) vr=SQ, vm=1, type=3 + DRTAssigningJurisdictionCodeSequence AssigningJurisdictionCodeSequence; + /// IdentifierTypeCode (0040,0035) vr=CS, vm=1, type=3 + DcmCodeString IdentifierTypeCode; + /// UniversalEntityID (0040,0032) vr=UT, vm=1, type=3 + DcmUnlimitedText UniversalEntityID; + /// UniversalEntityIDType (0040,0033) vr=CS, vm=1, type=1C + DcmCodeString UniversalEntityIDType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIssuerOfPatientIDQualifiersSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIssuerOfPatientIDQualifiersSequence(const DRTIssuerOfPatientIDQualifiersSequence ©); + + /** destructor + */ + virtual ~DRTIssuerOfPatientIDQualifiersSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIssuerOfPatientIDQualifiersSequence &operator=(const DRTIssuerOfPatientIDQualifiersSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtircs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtircs.h new file mode 100644 index 00000000..1747fc47 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtircs.h @@ -0,0 +1,620 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonRangeCompensatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIRCS_H +#define DRTIRCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IonRangeCompensatorSequence (300a,02ea) + */ +class DCMTK_DCMRT_EXPORT DRTIonRangeCompensatorSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get CompensatorColumnOffset (300a,02e5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorColumnOffset(Float32 &value, const unsigned long pos = 0) const; + + /** get CompensatorColumns (300a,00e8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorColumns(OFString &value, const signed long pos = 0) const; + + /** get CompensatorColumns (300a,00e8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorColumns(Sint32 &value, const unsigned long pos = 0) const; + + /** get CompensatorDescription (300a,02eb) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorDescription(OFString &value, const signed long pos = 0) const; + + /** get CompensatorDivergence (300a,02e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorDivergence(OFString &value, const signed long pos = 0) const; + + /** get CompensatorID (300a,00e5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorID(OFString &value, const signed long pos = 0) const; + + /** get CompensatorMillingToolDiameter (300a,02e8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorMillingToolDiameter(Float32 &value, const unsigned long pos = 0) const; + + /** get CompensatorMountingPosition (300a,02e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorMountingPosition(OFString &value, const signed long pos = 0) const; + + /** get CompensatorNumber (300a,00e4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorNumber(OFString &value, const signed long pos = 0) const; + + /** get CompensatorNumber (300a,00e4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get CompensatorPixelSpacing (300a,00e9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPixelSpacing(OFString &value, const signed long pos = 0) const; + + /** get CompensatorPixelSpacing (300a,00e9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPixelSpacing(Float64 &value, const unsigned long pos = 0) const; + + /** get CompensatorPixelSpacing (300a,00e9) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPixelSpacing(OFVector &value) const; + + /** get CompensatorPosition (300a,00ea) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPosition(OFString &value, const signed long pos = 0) const; + + /** get CompensatorPosition (300a,00ea) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPosition(Float64 &value, const unsigned long pos = 0) const; + + /** get CompensatorPosition (300a,00ea) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorPosition(OFVector &value) const; + + /** get CompensatorRelativeStoppingPowerRatio (300a,02e7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorRelativeStoppingPowerRatio(Float32 &value, const unsigned long pos = 0) const; + + /** get CompensatorRows (300a,00e7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorRows(OFString &value, const signed long pos = 0) const; + + /** get CompensatorRows (300a,00e7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorRows(Sint32 &value, const unsigned long pos = 0) const; + + /** get CompensatorThicknessData (300a,00ec) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorThicknessData(OFString &value, const signed long pos = 0) const; + + /** get CompensatorThicknessData (300a,00ec) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorThicknessData(Float64 &value, const unsigned long pos = 0) const; + + /** get CompensatorThicknessData (300a,00ec) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorThicknessData(OFVector &value) const; + + /** get IsocenterToCompensatorDistances (300a,02e6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToCompensatorDistances(Float32 &value, const unsigned long pos = 0) const; + + /** get IsocenterToCompensatorTrayDistance (300a,02e4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToCompensatorTrayDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorColumnOffset (300a,02e5) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorColumnOffset(const Float32 value, const unsigned long pos = 0); + + /** set CompensatorColumns (300a,00e8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorColumns(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorDescription (300a,02eb) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorDescription(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorDivergence (300a,02e0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorDivergence(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorID (300a,00e5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorID(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorMillingToolDiameter (300a,02e8) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorMillingToolDiameter(const Float32 value, const unsigned long pos = 0); + + /** set CompensatorMountingPosition (300a,02e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorMountingPosition(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorNumber (300a,00e4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorNumber(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorPixelSpacing (300a,00e9) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorPixelSpacing(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorPosition (300a,00ea) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorPosition(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorRelativeStoppingPowerRatio (300a,02e7) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorRelativeStoppingPowerRatio(const Float32 value, const unsigned long pos = 0); + + /** set CompensatorRows (300a,00e7) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorRows(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorThicknessData (300a,00ec) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorThicknessData(const OFString &value, const OFBool check = OFTrue); + + /** set IsocenterToCompensatorDistances (300a,02e6) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToCompensatorDistances(const Float32 value, const unsigned long pos = 0); + + /** set IsocenterToCompensatorTrayDistance (300a,02e4) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToCompensatorTrayDistance(const Float32 value, const unsigned long pos = 0); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// CompensatorColumnOffset (300a,02e5) vr=FL, vm=1, type=1C + DcmFloatingPointSingle CompensatorColumnOffset; + /// CompensatorColumns (300a,00e8) vr=IS, vm=1, type=1 + DcmIntegerString CompensatorColumns; + /// CompensatorDescription (300a,02eb) vr=LT, vm=1, type=3 + DcmLongText CompensatorDescription; + /// CompensatorDivergence (300a,02e0) vr=CS, vm=1, type=1 + DcmCodeString CompensatorDivergence; + /// CompensatorID (300a,00e5) vr=SH, vm=1, type=3 + DcmShortString CompensatorID; + /// CompensatorMillingToolDiameter (300a,02e8) vr=FL, vm=1, type=3 + DcmFloatingPointSingle CompensatorMillingToolDiameter; + /// CompensatorMountingPosition (300a,02e1) vr=CS, vm=1, type=1 + DcmCodeString CompensatorMountingPosition; + /// CompensatorNumber (300a,00e4) vr=IS, vm=1, type=1 + DcmIntegerString CompensatorNumber; + /// CompensatorPixelSpacing (300a,00e9) vr=DS, vm=2, type=1 + DcmDecimalString CompensatorPixelSpacing; + /// CompensatorPosition (300a,00ea) vr=DS, vm=2, type=1 + DcmDecimalString CompensatorPosition; + /// CompensatorRelativeStoppingPowerRatio (300a,02e7) vr=FL, vm=1, type=3 + DcmFloatingPointSingle CompensatorRelativeStoppingPowerRatio; + /// CompensatorRows (300a,00e7) vr=IS, vm=1, type=1 + DcmIntegerString CompensatorRows; + /// CompensatorThicknessData (300a,00ec) vr=DS, vm=1-n, type=1 + DcmDecimalString CompensatorThicknessData; + /// IsocenterToCompensatorDistances (300a,02e6) vr=FL, vm=1-n, type=1C + DcmFloatingPointSingle IsocenterToCompensatorDistances; + /// IsocenterToCompensatorTrayDistance (300a,02e4) vr=FL, vm=1, type=1C + DcmFloatingPointSingle IsocenterToCompensatorTrayDistance; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=2 + DcmShortString MaterialID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonRangeCompensatorSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonRangeCompensatorSequence(const DRTIonRangeCompensatorSequence ©); + + /** destructor + */ + virtual ~DRTIonRangeCompensatorSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonRangeCompensatorSequence &operator=(const DRTIonRangeCompensatorSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtiseis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtiseis.h new file mode 100644 index 00000000..f3fef499 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtiseis.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIssuerOfServiceEpisodeIDSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTISEIS_H +#define DRTISEIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IssuerOfServiceEpisodeIDSequence (0038,0064) + */ +class DCMTK_DCMRT_EXPORT DRTIssuerOfServiceEpisodeIDSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LocalNamespaceEntityID (0040,0031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLocalNamespaceEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityID (0040,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityID(OFString &value, const signed long pos = 0) const; + + /** get UniversalEntityIDType (0040,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniversalEntityIDType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LocalNamespaceEntityID (0040,0031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLocalNamespaceEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityID (0040,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityID(const OFString &value, const OFBool check = OFTrue); + + /** set UniversalEntityIDType (0040,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniversalEntityIDType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LocalNamespaceEntityID (0040,0031) vr=UT, vm=1, type=1C + DcmUnlimitedText LocalNamespaceEntityID; + /// UniversalEntityID (0040,0032) vr=UT, vm=1, type=1C + DcmUnlimitedText UniversalEntityID; + /// UniversalEntityIDType (0040,0033) vr=CS, vm=1, type=1C + DcmCodeString UniversalEntityIDType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIssuerOfServiceEpisodeIDSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIssuerOfServiceEpisodeIDSequence(const DRTIssuerOfServiceEpisodeIDSequence ©); + + /** destructor + */ + virtual ~DRTIssuerOfServiceEpisodeIDSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIssuerOfServiceEpisodeIDSequence &operator=(const DRTIssuerOfServiceEpisodeIDSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtitts.h b/dcmrt/include/dcmtk/dcmrt/seq/drtitts.h new file mode 100644 index 00000000..7bcc3de0 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtitts.h @@ -0,0 +1,622 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonToleranceTableSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTITTS_H +#define DRTITTS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbldts.h" // for BeamLimitingDeviceToleranceSequence + + +/** Interface class for IonToleranceTableSequence (300a,03a0) + */ +class DCMTK_DCMRT_EXPORT DRTIonToleranceTableSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamLimitingDeviceAngleTolerance (300a,0046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngleTolerance (300a,0046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get ChairHeadFramePositionTolerance (300a,0153) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChairHeadFramePositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get ChairHeadFramePositionTolerance (300a,0153) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChairHeadFramePositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get FixationLightAzimuthalAngleTolerance (300a,0154) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightAzimuthalAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get FixationLightAzimuthalAngleTolerance (300a,0154) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightAzimuthalAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get FixationLightPolarAngleTolerance (300a,0155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightPolarAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get FixationLightPolarAngleTolerance (300a,0155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightPolarAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryAngleTolerance (300a,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get GantryAngleTolerance (300a,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get HeadFixationAngleTolerance (300a,0152) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHeadFixationAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get HeadFixationAngleTolerance (300a,0152) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHeadFixationAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAngleTolerance (300a,004c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngleTolerance (300a,004c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get SnoutPositionTolerance (300a,004b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSnoutPositionTolerance(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopLateralPositionTolerance (300a,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPositionTolerance (300a,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalPositionTolerance (300a,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalPositionTolerance (300a,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchAngleTolerance (300a,004f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchAngleTolerance(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopRollAngleTolerance (300a,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollAngleTolerance(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopVerticalPositionTolerance (300a,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPositionTolerance (300a,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get ToleranceTableLabel (300a,0043) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getToleranceTableLabel(OFString &value, const signed long pos = 0) const; + + /** get ToleranceTableNumber (300a,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getToleranceTableNumber(OFString &value, const signed long pos = 0) const; + + /** get ToleranceTableNumber (300a,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getToleranceTableNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BeamLimitingDeviceToleranceSequence (300a,0048) + * @return reference to sequence element + */ + DRTBeamLimitingDeviceToleranceSequence &getBeamLimitingDeviceToleranceSequence() + { return BeamLimitingDeviceToleranceSequence; } + + /** get BeamLimitingDeviceToleranceSequence (300a,0048) + * @return const reference to sequence element + */ + const DRTBeamLimitingDeviceToleranceSequence &getBeamLimitingDeviceToleranceSequence() const + { return BeamLimitingDeviceToleranceSequence; } + + // --- set DICOM attribute values --- + + /** set BeamLimitingDeviceAngleTolerance (300a,0046) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set ChairHeadFramePositionTolerance (300a,0153) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChairHeadFramePositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set FixationLightAzimuthalAngleTolerance (300a,0154) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationLightAzimuthalAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set FixationLightPolarAngleTolerance (300a,0155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationLightPolarAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set GantryAngleTolerance (300a,0044) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set HeadFixationAngleTolerance (300a,0152) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHeadFixationAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAngleTolerance (300a,004c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set SnoutPositionTolerance (300a,004b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSnoutPositionTolerance(const Float32 value, const unsigned long pos = 0); + + /** set TableTopLateralPositionTolerance (300a,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLateralPositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalPositionTolerance (300a,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLongitudinalPositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopPitchAngleTolerance (300a,004f) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchAngleTolerance(const Float32 value, const unsigned long pos = 0); + + /** set TableTopRollAngleTolerance (300a,0050) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollAngleTolerance(const Float32 value, const unsigned long pos = 0); + + /** set TableTopVerticalPositionTolerance (300a,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopVerticalPositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set ToleranceTableLabel (300a,0043) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setToleranceTableLabel(const OFString &value, const OFBool check = OFTrue); + + /** set ToleranceTableNumber (300a,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setToleranceTableNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamLimitingDeviceAngleTolerance (300a,0046) vr=DS, vm=1, type=3 + DcmDecimalString BeamLimitingDeviceAngleTolerance; + /// BeamLimitingDeviceToleranceSequence (300a,0048) vr=SQ, vm=1, type=3 + DRTBeamLimitingDeviceToleranceSequence BeamLimitingDeviceToleranceSequence; + /// ChairHeadFramePositionTolerance (300a,0153) vr=DS, vm=1, type=3 + DcmDecimalString ChairHeadFramePositionTolerance; + /// FixationLightAzimuthalAngleTolerance (300a,0154) vr=DS, vm=1, type=3 + DcmDecimalString FixationLightAzimuthalAngleTolerance; + /// FixationLightPolarAngleTolerance (300a,0155) vr=DS, vm=1, type=3 + DcmDecimalString FixationLightPolarAngleTolerance; + /// GantryAngleTolerance (300a,0044) vr=DS, vm=1, type=3 + DcmDecimalString GantryAngleTolerance; + /// HeadFixationAngleTolerance (300a,0152) vr=DS, vm=1, type=3 + DcmDecimalString HeadFixationAngleTolerance; + /// PatientSupportAngleTolerance (300a,004c) vr=DS, vm=1, type=3 + DcmDecimalString PatientSupportAngleTolerance; + /// SnoutPositionTolerance (300a,004b) vr=FL, vm=1, type=3 + DcmFloatingPointSingle SnoutPositionTolerance; + /// TableTopLateralPositionTolerance (300a,0053) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLateralPositionTolerance; + /// TableTopLongitudinalPositionTolerance (300a,0052) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLongitudinalPositionTolerance; + /// TableTopPitchAngleTolerance (300a,004f) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopPitchAngleTolerance; + /// TableTopRollAngleTolerance (300a,0050) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopRollAngleTolerance; + /// TableTopVerticalPositionTolerance (300a,0051) vr=DS, vm=1, type=3 + DcmDecimalString TableTopVerticalPositionTolerance; + /// ToleranceTableLabel (300a,0043) vr=SH, vm=1, type=3 + DcmShortString ToleranceTableLabel; + /// ToleranceTableNumber (300a,0042) vr=IS, vm=1, type=1 + DcmIntegerString ToleranceTableNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonToleranceTableSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonToleranceTableSequence(const DRTIonToleranceTableSequence ©); + + /** destructor + */ + virtual ~DRTIonToleranceTableSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonToleranceTableSequence &operator=(const DRTIonToleranceTableSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtiwps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtiwps.h new file mode 100644 index 00000000..b4b9a827 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtiwps.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonWedgePositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIWPS_H +#define DRTIWPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IonWedgePositionSequence (300a,03ac) + */ +class DCMTK_DCMRT_EXPORT DRTIonWedgePositionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedWedgeNumber (300c,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedWedgeNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedWedgeNumber (300c,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedWedgeNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgePosition (300a,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgePosition(OFString &value, const signed long pos = 0) const; + + /** get WedgeThinEdgePosition (300a,00db) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeThinEdgePosition(Float32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedWedgeNumber (300c,00c0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedWedgeNumber(const OFString &value, const OFBool check = OFTrue); + + /** set WedgePosition (300a,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgePosition(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeThinEdgePosition (300a,00db) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeThinEdgePosition(const Float32 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedWedgeNumber (300c,00c0) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedWedgeNumber; + /// WedgePosition (300a,0118) vr=CS, vm=1, type=1 + DcmCodeString WedgePosition; + /// WedgeThinEdgePosition (300a,00db) vr=FL, vm=1, type=1C + DcmFloatingPointSingle WedgeThinEdgePosition; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonWedgePositionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonWedgePositionSequence(const DRTIonWedgePositionSequence ©); + + /** destructor + */ + virtual ~DRTIonWedgePositionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonWedgePositionSequence &operator=(const DRTIonWedgePositionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtiws.h b/dcmrt/include/dcmtk/dcmrt/seq/drtiws.h new file mode 100644 index 00000000..32e5e102 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtiws.h @@ -0,0 +1,421 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTIonWedgeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTIWS_H +#define DRTIWS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for IonWedgeSequence (300a,03aa) + */ +class DCMTK_DCMRT_EXPORT DRTIonWedgeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get IsocenterToWedgeTrayDistance (300a,00d9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToWedgeTrayDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get WedgeAngle (300a,00d5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeAngle(OFString &value, const signed long pos = 0) const; + + /** get WedgeAngle (300a,00d5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeAngle(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgeID (300a,00d4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeID(OFString &value, const signed long pos = 0) const; + + /** get WedgeNumber (300a,00d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeNumber(OFString &value, const signed long pos = 0) const; + + /** get WedgeNumber (300a,00d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgeOrientation (300a,00d8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeOrientation(OFString &value, const signed long pos = 0) const; + + /** get WedgeOrientation (300a,00d8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeOrientation(Float64 &value, const unsigned long pos = 0) const; + + /** get WedgeType (300a,00d3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set IsocenterToWedgeTrayDistance (300a,00d9) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToWedgeTrayDistance(const Float32 value, const unsigned long pos = 0); + + /** set WedgeAngle (300a,00d5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeAngle(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeID (300a,00d4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeID(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeNumber (300a,00d2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeNumber(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeOrientation (300a,00d8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeType (300a,00d3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// IsocenterToWedgeTrayDistance (300a,00d9) vr=FL, vm=1, type=1 + DcmFloatingPointSingle IsocenterToWedgeTrayDistance; + /// WedgeAngle (300a,00d5) vr=IS, vm=1, type=2 + DcmIntegerString WedgeAngle; + /// WedgeID (300a,00d4) vr=SH, vm=1, type=3 + DcmShortString WedgeID; + /// WedgeNumber (300a,00d2) vr=IS, vm=1, type=1 + DcmIntegerString WedgeNumber; + /// WedgeOrientation (300a,00d8) vr=DS, vm=1, type=2 + DcmDecimalString WedgeOrientation; + /// WedgeType (300a,00d3) vr=CS, vm=1, type=2 + DcmCodeString WedgeType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTIonWedgeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTIonWedgeSequence(const DRTIonWedgeSequence ©); + + /** destructor + */ + virtual ~DRTIonWedgeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTIonWedgeSequence &operator=(const DRTIonWedgeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtlsds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtlsds.h new file mode 100644 index 00000000..50bc8b70 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtlsds.h @@ -0,0 +1,375 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTLateralSpreadingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTLSDS_H +#define DRTLSDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for LateralSpreadingDeviceSequence (300a,0332) + */ +class DCMTK_DCMRT_EXPORT DRTLateralSpreadingDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get LateralSpreadingDeviceDescription (300a,033a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceDescription(OFString &value, const signed long pos = 0) const; + + /** get LateralSpreadingDeviceID (300a,0336) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceID(OFString &value, const signed long pos = 0) const; + + /** get LateralSpreadingDeviceNumber (300a,0334) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceNumber(OFString &value, const signed long pos = 0) const; + + /** get LateralSpreadingDeviceNumber (300a,0334) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get LateralSpreadingDeviceType (300a,0338) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set LateralSpreadingDeviceDescription (300a,033a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set LateralSpreadingDeviceID (300a,0336) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceID(const OFString &value, const OFBool check = OFTrue); + + /** set LateralSpreadingDeviceNumber (300a,0334) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set LateralSpreadingDeviceType (300a,0338) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// LateralSpreadingDeviceDescription (300a,033a) vr=LO, vm=1, type=3 + DcmLongString LateralSpreadingDeviceDescription; + /// LateralSpreadingDeviceID (300a,0336) vr=SH, vm=1, type=1 + DcmShortString LateralSpreadingDeviceID; + /// LateralSpreadingDeviceNumber (300a,0334) vr=IS, vm=1, type=1 + DcmIntegerString LateralSpreadingDeviceNumber; + /// LateralSpreadingDeviceType (300a,0338) vr=CS, vm=1, type=1 + DcmCodeString LateralSpreadingDeviceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTLateralSpreadingDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTLateralSpreadingDeviceSequence(const DRTLateralSpreadingDeviceSequence ©); + + /** destructor + */ + virtual ~DRTLateralSpreadingDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTLateralSpreadingDeviceSequence &operator=(const DRTLateralSpreadingDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtlsds6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtlsds6.h new file mode 100644 index 00000000..1bf36676 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtlsds6.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTLSDS6_H +#define DRTLSDS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for LateralSpreadingDeviceSettingsSequence (300a,0370) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IsocenterToLateralSpreadingDeviceDistance (300a,0374) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToLateralSpreadingDeviceDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get LateralSpreadingDeviceSetting (300a,0372) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceSetting(OFString &value, const signed long pos = 0) const; + + /** get LateralSpreadingDeviceWaterEquivalentThickness (300a,033c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceWaterEquivalentThickness(Float32 &value, const unsigned long pos = 0) const; + + /** get ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedLateralSpreadingDeviceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set IsocenterToLateralSpreadingDeviceDistance (300a,0374) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToLateralSpreadingDeviceDistance(const Float32 value, const unsigned long pos = 0); + + /** set LateralSpreadingDeviceSetting (300a,0372) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceSetting(const OFString &value, const OFBool check = OFTrue); + + /** set LateralSpreadingDeviceWaterEquivalentThickness (300a,033c) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceWaterEquivalentThickness(const Float32 value, const unsigned long pos = 0); + + /** set ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedLateralSpreadingDeviceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// IsocenterToLateralSpreadingDeviceDistance (300a,0374) vr=FL, vm=1, type=3 + DcmFloatingPointSingle IsocenterToLateralSpreadingDeviceDistance; + /// LateralSpreadingDeviceSetting (300a,0372) vr=LO, vm=1, type=1 + DcmLongString LateralSpreadingDeviceSetting; + /// LateralSpreadingDeviceWaterEquivalentThickness (300a,033c) vr=FL, vm=1, type=3 + DcmFloatingPointSingle LateralSpreadingDeviceWaterEquivalentThickness; + /// ReferencedLateralSpreadingDeviceNumber (300c,0102) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedLateralSpreadingDeviceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule &operator=(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtlsds7.h b/dcmrt/include/dcmtk/dcmrt/seq/drtlsds7.h new file mode 100644 index 00000000..19a26034 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtlsds7.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTLSDS7_H +#define DRTLSDS7_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for LateralSpreadingDeviceSettingsSequence (300a,0370) in RTIonBeamsSessionRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LateralSpreadingDeviceSetting (300a,0372) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceSetting(OFString &value, const signed long pos = 0) const; + + /** get ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedLateralSpreadingDeviceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LateralSpreadingDeviceSetting (300a,0372) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceSetting(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedLateralSpreadingDeviceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LateralSpreadingDeviceSetting (300a,0372) vr=LO, vm=1, type=1 + DcmLongString LateralSpreadingDeviceSetting; + /// ReferencedLateralSpreadingDeviceNumber (300c,0102) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedLateralSpreadingDeviceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule ©); + + /** destructor + */ + virtual ~DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule &operator=(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmacds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmacds.h new file mode 100644 index 00000000..64d7f53c --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmacds.h @@ -0,0 +1,344 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTMultiplexedAudioChannelsDescriptionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMACDS_H +#define DRTMACDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtcss.h" // for ChannelSourceSequence + + +/** Interface class for MultiplexedAudioChannelsDescriptionCodeSequence (003a,0300) + */ +class DCMTK_DCMRT_EXPORT DRTMultiplexedAudioChannelsDescriptionCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ChannelIdentificationCode (003a,0301) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelIdentificationCode(OFString &value, const signed long pos = 0) const; + + /** get ChannelIdentificationCode (003a,0301) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelIdentificationCode(Sint32 &value, const unsigned long pos = 0) const; + + /** get ChannelMode (003a,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getChannelMode(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ChannelSourceSequence (003a,0208) + * @return reference to sequence element + */ + DRTChannelSourceSequence &getChannelSourceSequence() + { return ChannelSourceSequence; } + + /** get ChannelSourceSequence (003a,0208) + * @return const reference to sequence element + */ + const DRTChannelSourceSequence &getChannelSourceSequence() const + { return ChannelSourceSequence; } + + // --- set DICOM attribute values --- + + /** set ChannelIdentificationCode (003a,0301) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelIdentificationCode(const OFString &value, const OFBool check = OFTrue); + + /** set ChannelMode (003a,0302) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setChannelMode(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ChannelIdentificationCode (003a,0301) vr=IS, vm=1, type=1 + DcmIntegerString ChannelIdentificationCode; + /// ChannelMode (003a,0302) vr=CS, vm=1, type=1 + DcmCodeString ChannelMode; + /// ChannelSourceSequence (003a,0208) vr=SQ, vm=1, type=1 + DRTChannelSourceSequence ChannelSourceSequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTMultiplexedAudioChannelsDescriptionCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTMultiplexedAudioChannelsDescriptionCodeSequence(const DRTMultiplexedAudioChannelsDescriptionCodeSequence ©); + + /** destructor + */ + virtual ~DRTMultiplexedAudioChannelsDescriptionCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTMultiplexedAudioChannelsDescriptionCodeSequence &operator=(const DRTMultiplexedAudioChannelsDescriptionCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmas.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmas.h new file mode 100644 index 00000000..56d18e33 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmas.h @@ -0,0 +1,284 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTModifiedAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMAS_H +#define DRTMAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ModifiedAttributesSequence (0400,0550) + */ +class DCMTK_DCMRT_EXPORT DRTModifiedAttributesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTModifiedAttributesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTModifiedAttributesSequence(const DRTModifiedAttributesSequence ©); + + /** destructor + */ + virtual ~DRTModifiedAttributesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTModifiedAttributesSequence &operator=(const DRTModifiedAttributesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmdrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmdrs.h new file mode 100644 index 00000000..04a225b3 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmdrs.h @@ -0,0 +1,405 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTMeasuredDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMDRS_H +#define DRTMDRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for MeasuredDoseReferenceSequence (3008,0010) + */ +class DCMTK_DCMRT_EXPORT DRTMeasuredDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DoseUnits (3004,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseUnits(OFString &value, const signed long pos = 0) const; + + /** get MeasuredDoseDescription (3008,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseDescription(OFString &value, const signed long pos = 0) const; + + /** get MeasuredDoseReferenceNumber (3008,0064) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get MeasuredDoseReferenceNumber (3008,0064) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get MeasuredDoseType (3008,0014) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseType(OFString &value, const signed long pos = 0) const; + + /** get MeasuredDoseValue (3008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseValue(OFString &value, const signed long pos = 0) const; + + /** get MeasuredDoseValue (3008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseValue(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DoseUnits (3004,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseUnits(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredDoseDescription (3008,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasuredDoseDescription(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredDoseReferenceNumber (3008,0064) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasuredDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredDoseType (3008,0014) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasuredDoseType(const OFString &value, const OFBool check = OFTrue); + + /** set MeasuredDoseValue (3008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasuredDoseValue(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DoseUnits (3004,0002) vr=CS, vm=1, type=1 + DcmCodeString DoseUnits; + /// MeasuredDoseDescription (3008,0012) vr=ST, vm=1, type=3 + DcmShortText MeasuredDoseDescription; + /// MeasuredDoseReferenceNumber (3008,0064) vr=IS, vm=1, type=1C + DcmIntegerString MeasuredDoseReferenceNumber; + /// MeasuredDoseType (3008,0014) vr=CS, vm=1, type=2 + DcmCodeString MeasuredDoseType; + /// MeasuredDoseValue (3008,0016) vr=DS, vm=1, type=2 + DcmDecimalString MeasuredDoseValue; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTMeasuredDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTMeasuredDoseReferenceSequence(const DRTMeasuredDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTMeasuredDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTMeasuredDoseReferenceSequence &operator=(const DRTMeasuredDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmls.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmls.h new file mode 100644 index 00000000..a3324f7f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmls.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTModalityLUTSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMLS_H +#define DRTMLS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ModalityLUTSequence (0028,3000) + */ +class DCMTK_DCMRT_EXPORT DRTModalityLUTSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LUTData (0028,3006) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get LUTDescriptor (0028,3002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get LUTExplanation (0028,3003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTExplanation(OFString &value, const signed long pos = 0) const; + + /** get ModalityLUTType (0028,3004) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getModalityLUTType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LUTData (0028,3006) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTData(const Uint16 *value, const unsigned long count); + + /** set LUTDescriptor (0028,3002) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set LUTExplanation (0028,3003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTExplanation(const OFString &value, const OFBool check = OFTrue); + + /** set ModalityLUTType (0028,3004) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setModalityLUTType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LUTData (0028,3006) vr=US/OW, vm=1-n, type=1 + DcmOtherByteOtherWord LUTData; + /// LUTDescriptor (0028,3002) vr=US/SS, vm=3, type=1 + DcmUnsignedShort LUTDescriptor; + /// LUTExplanation (0028,3003) vr=LO, vm=1, type=3 + DcmLongString LUTExplanation; + /// ModalityLUTType (0028,3004) vr=LO, vm=1, type=1 + DcmLongString ModalityLUTType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTModalityLUTSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTModalityLUTSequence(const DRTModalityLUTSequence ©); + + /** destructor + */ + virtual ~DRTModalityLUTSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTModalityLUTSequence &operator=(const DRTModalityLUTSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmps.h new file mode 100644 index 00000000..9d295df2 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmps.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTMACParametersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMPS_H +#define DRTMPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for MACParametersSequence (4ffe,0001) + */ +class DCMTK_DCMRT_EXPORT DRTMACParametersSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DataElementsSigned (0400,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDataElementsSigned(OFString &value, const signed long pos = 0) const; + + /** get MACAlgorithm (0400,0015) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMACAlgorithm(OFString &value, const signed long pos = 0) const; + + /** get MACCalculationTransferSyntaxUID (0400,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMACCalculationTransferSyntaxUID(OFString &value, const signed long pos = 0) const; + + /** get MACIDNumber (0400,0005) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMACIDNumber(Uint16 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DataElementsSigned (0400,0020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (AT) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDataElementsSigned(const OFString &value, const OFBool check = OFTrue); + + /** set MACAlgorithm (0400,0015) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMACAlgorithm(const OFString &value, const OFBool check = OFTrue); + + /** set MACCalculationTransferSyntaxUID (0400,0010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMACCalculationTransferSyntaxUID(const OFString &value, const OFBool check = OFTrue); + + /** set MACIDNumber (0400,0005) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMACIDNumber(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DataElementsSigned (0400,0020) vr=AT, vm=1-n, type=1 + DcmAttributeTag DataElementsSigned; + /// MACAlgorithm (0400,0015) vr=CS, vm=1, type=1 + DcmCodeString MACAlgorithm; + /// MACCalculationTransferSyntaxUID (0400,0010) vr=UI, vm=1, type=1 + DcmUniqueIdentifier MACCalculationTransferSyntaxUID; + /// MACIDNumber (0400,0005) vr=US, vm=1, type=1 + DcmUnsignedShort MACIDNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTMACParametersSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTMACParametersSequence(const DRTMACParametersSequence ©); + + /** destructor + */ + virtual ~DRTMACParametersSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTMACParametersSequence &operator=(const DRTMACParametersSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmris.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmris.h new file mode 100644 index 00000000..4c81609c --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmris.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTMappingResourceIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMRIS_H +#define DRTMRIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for MappingResourceIdentificationSequence (0008,0124) + */ +class DCMTK_DCMRT_EXPORT DRTMappingResourceIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// MappingResource (0008,0105) vr=CS, vm=1, type=1 + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTMappingResourceIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTMappingResourceIdentificationSequence(const DRTMappingResourceIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTMappingResourceIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTMappingResourceIdentificationSequence &operator=(const DRTMappingResourceIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmss.h new file mode 100644 index 00000000..790497c0 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmss.h @@ -0,0 +1,352 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTMotionSynchronizationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMSS_H +#define DRTMSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for MotionSynchronizationSequence (300a,0410) + */ +class DCMTK_DCMRT_EXPORT DRTMotionSynchronizationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RespiratoryMotionCompensationTechnique (0018,9170) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRespiratoryMotionCompensationTechnique(OFString &value, const signed long pos = 0) const; + + /** get RespiratoryMotionCompensationTechniqueDescription (0018,9185) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRespiratoryMotionCompensationTechniqueDescription(OFString &value, const signed long pos = 0) const; + + /** get RespiratorySignalSource (0018,9171) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRespiratorySignalSource(OFString &value, const signed long pos = 0) const; + + /** get RespiratorySignalSourceID (0018,9186) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRespiratorySignalSourceID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RespiratoryMotionCompensationTechnique (0018,9170) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRespiratoryMotionCompensationTechnique(const OFString &value, const OFBool check = OFTrue); + + /** set RespiratoryMotionCompensationTechniqueDescription (0018,9185) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRespiratoryMotionCompensationTechniqueDescription(const OFString &value, const OFBool check = OFTrue); + + /** set RespiratorySignalSource (0018,9171) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRespiratorySignalSource(const OFString &value, const OFBool check = OFTrue); + + /** set RespiratorySignalSourceID (0018,9186) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRespiratorySignalSourceID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RespiratoryMotionCompensationTechnique (0018,9170) vr=CS, vm=1, type=1 + DcmCodeString RespiratoryMotionCompensationTechnique; + /// RespiratoryMotionCompensationTechniqueDescription (0018,9185) vr=ST, vm=1, type=3 + DcmShortText RespiratoryMotionCompensationTechniqueDescription; + /// RespiratorySignalSource (0018,9171) vr=CS, vm=1, type=1 + DcmCodeString RespiratorySignalSource; + /// RespiratorySignalSourceID (0018,9186) vr=SH, vm=1, type=3 + DcmShortString RespiratorySignalSourceID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTMotionSynchronizationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTMotionSynchronizationSequence(const DRTMotionSynchronizationSequence ©); + + /** destructor + */ + virtual ~DRTMotionSynchronizationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTMotionSynchronizationSequence &operator=(const DRTMotionSynchronizationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtmucs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtmucs.h new file mode 100644 index 00000000..7551e33b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtmucs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTMeasurementUnitsCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTMUCS_H +#define DRTMUCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for MeasurementUnitsCodeSequence (0040,08ea) + */ +class DCMTK_DCMRT_EXPORT DRTMeasurementUnitsCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTMeasurementUnitsCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTMeasurementUnitsCodeSequence(const DRTMeasurementUnitsCodeSequence ©); + + /** destructor + */ + virtual ~DRTMeasurementUnitsCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTMeasurementUnitsCodeSequence &operator=(const DRTMeasurementUnitsCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtoas.h b/dcmrt/include/dcmtk/dcmrt/seq/drtoas.h new file mode 100644 index 00000000..0f404537 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtoas.h @@ -0,0 +1,369 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTOriginalAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTOAS_H +#define DRTOAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtmas.h" // for ModifiedAttributesSequence + + +/** Interface class for OriginalAttributesSequence (0400,0561) + */ +class DCMTK_DCMRT_EXPORT DRTOriginalAttributesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AttributeModificationDateTime (0400,0562) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAttributeModificationDateTime(OFString &value, const signed long pos = 0) const; + + /** get ModifyingSystem (0400,0563) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getModifyingSystem(OFString &value, const signed long pos = 0) const; + + /** get ReasonForTheAttributeModification (0400,0565) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReasonForTheAttributeModification(OFString &value, const signed long pos = 0) const; + + /** get SourceOfPreviousValues (0400,0564) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceOfPreviousValues(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ModifiedAttributesSequence (0400,0550) + * @return reference to sequence element + */ + DRTModifiedAttributesSequence &getModifiedAttributesSequence() + { return ModifiedAttributesSequence; } + + /** get ModifiedAttributesSequence (0400,0550) + * @return const reference to sequence element + */ + const DRTModifiedAttributesSequence &getModifiedAttributesSequence() const + { return ModifiedAttributesSequence; } + + // --- set DICOM attribute values --- + + /** set AttributeModificationDateTime (0400,0562) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAttributeModificationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set ModifyingSystem (0400,0563) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setModifyingSystem(const OFString &value, const OFBool check = OFTrue); + + /** set ReasonForTheAttributeModification (0400,0565) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReasonForTheAttributeModification(const OFString &value, const OFBool check = OFTrue); + + /** set SourceOfPreviousValues (0400,0564) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceOfPreviousValues(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AttributeModificationDateTime (0400,0562) vr=DT, vm=1, type=1 + DcmDateTime AttributeModificationDateTime; + /// ModifiedAttributesSequence (0400,0550) vr=SQ, vm=1, type=1 + DRTModifiedAttributesSequence ModifiedAttributesSequence; + /// ModifyingSystem (0400,0563) vr=LO, vm=1, type=1 + DcmLongString ModifyingSystem; + /// ReasonForTheAttributeModification (0400,0565) vr=CS, vm=1, type=1 + DcmCodeString ReasonForTheAttributeModification; + /// SourceOfPreviousValues (0400,0564) vr=LO, vm=1, type=2 + DcmLongString SourceOfPreviousValues; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTOriginalAttributesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTOriginalAttributesSequence(const DRTOriginalAttributesSequence ©); + + /** destructor + */ + virtual ~DRTOriginalAttributesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTOriginalAttributesSequence &operator=(const DRTOriginalAttributesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtois.h b/dcmrt/include/dcmtk/dcmrt/seq/drtois.h new file mode 100644 index 00000000..89896311 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtois.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTOperatorIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTOIS_H +#define DRTOIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtics.h" // for InstitutionCodeSequence +#include "dcmtk/dcmrt/seq/drtpics.h" // for PersonIdentificationCodeSequence + + +/** Interface class for OperatorIdentificationSequence (0008,1072) + */ +class DCMTK_DCMRT_EXPORT DRTOperatorIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get PersonAddress (0040,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonAddress(OFString &value, const signed long pos = 0) const; + + /** get PersonTelecomInformation (0040,1104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelecomInformation(OFString &value, const signed long pos = 0) const; + + /** get PersonTelephoneNumbers (0040,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelephoneNumbers(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get InstitutionCodeSequence (0008,0082) + * @return reference to sequence element + */ + DRTInstitutionCodeSequence &getInstitutionCodeSequence() + { return InstitutionCodeSequence; } + + /** get InstitutionCodeSequence (0008,0082) + * @return const reference to sequence element + */ + const DRTInstitutionCodeSequence &getInstitutionCodeSequence() const + { return InstitutionCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return reference to sequence element + */ + DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() + { return PersonIdentificationCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return const reference to sequence element + */ + const DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() const + { return PersonIdentificationCodeSequence; } + + // --- set DICOM attribute values --- + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set PersonAddress (0040,1102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonAddress(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelecomInformation (0040,1104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelecomInformation(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelephoneNumbers (0040,1103) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelephoneNumbers(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionCodeSequence (0008,0082) vr=SQ, vm=1, type=1C + DRTInstitutionCodeSequence InstitutionCodeSequence; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=1C + DcmLongString InstitutionName; + /// PersonAddress (0040,1102) vr=ST, vm=1, type=3 + DcmShortText PersonAddress; + /// PersonIdentificationCodeSequence (0040,1101) vr=SQ, vm=1, type=1 + DRTPersonIdentificationCodeSequence PersonIdentificationCodeSequence; + /// PersonTelecomInformation (0040,1104) vr=LT, vm=1, type=3 + DcmLongText PersonTelecomInformation; + /// PersonTelephoneNumbers (0040,1103) vr=LO, vm=1-n, type=3 + DcmLongString PersonTelephoneNumbers; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTOperatorIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTOperatorIdentificationSequence(const DRTOperatorIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTOperatorIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTOperatorIdentificationSequence &operator=(const DRTOperatorIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtopis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtopis.h new file mode 100644 index 00000000..92accf44 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtopis.h @@ -0,0 +1,353 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTOtherPatientIDsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTOPIS_H +#define DRTOPIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence + + +/** Interface class for OtherPatientIDsSequence (0010,1002) + */ +class DCMTK_DCMRT_EXPORT DRTOtherPatientIDsSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + /** get TypeOfPatientID (0010,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTypeOfPatientID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + // --- set DICOM attribute values --- + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set TypeOfPatientID (0010,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTypeOfPatientID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientID (0010,0020) vr=LO, vm=1, type=1 + DcmLongString PatientID; + /// TypeOfPatientID (0010,0022) vr=CS, vm=1, type=1 + DcmCodeString TypeOfPatientID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTOtherPatientIDsSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTOtherPatientIDsSequence(const DRTOtherPatientIDsSequence ©); + + /** destructor + */ + virtual ~DRTOtherPatientIDsSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTOtherPatientIDsSequence &operator=(const DRTOtherPatientIDsSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtos.h b/dcmrt/include/dcmtk/dcmrt/seq/drtos.h new file mode 100644 index 00000000..6533dbfe --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtos.h @@ -0,0 +1,408 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTOverrideSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTOS_H +#define DRTOS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtois.h" // for OperatorIdentificationSequence + + +/** Interface class for OverrideSequence (3008,0060) + */ +class DCMTK_DCMRT_EXPORT DRTOverrideSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get OperatorsName (0008,1070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOperatorsName(OFString &value, const signed long pos = 0) const; + + /** get OverrideParameterPointer (3008,0062) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOverrideParameterPointer(OFString &value, const signed long pos = 0) const; + + /** get OverrideReason (3008,0066) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOverrideReason(OFString &value, const signed long pos = 0) const; + + /** get ParameterItemIndex (3008,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterItemIndex(OFString &value, const signed long pos = 0) const; + + /** get ParameterItemIndex (3008,0063) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterItemIndex(Sint32 &value, const unsigned long pos = 0) const; + + /** get ParameterSequencePointer (3008,0061) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterSequencePointer(OFString &value, const signed long pos = 0) const; + + /** get ParameterValueNumber (3008,0067) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getParameterValueNumber(Uint16 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get OperatorIdentificationSequence (0008,1072) + * @return reference to sequence element + */ + DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() + { return OperatorIdentificationSequence; } + + /** get OperatorIdentificationSequence (0008,1072) + * @return const reference to sequence element + */ + const DRTOperatorIdentificationSequence &getOperatorIdentificationSequence() const + { return OperatorIdentificationSequence; } + + // --- set DICOM attribute values --- + + /** set OperatorsName (0008,1070) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOperatorsName(const OFString &value, const OFBool check = OFTrue); + + /** set OverrideParameterPointer (3008,0062) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOverrideParameterPointer(const OFString &value, const OFBool check = OFTrue); + + /** set OverrideReason (3008,0066) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOverrideReason(const OFString &value, const OFBool check = OFTrue); + + /** set ParameterItemIndex (3008,0063) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setParameterItemIndex(const OFString &value, const OFBool check = OFTrue); + + /** set ParameterSequencePointer (3008,0061) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (AT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setParameterSequencePointer(const OFString &value, const OFBool check = OFTrue); + + /** set ParameterValueNumber (3008,0067) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setParameterValueNumber(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// OperatorIdentificationSequence (0008,1072) vr=SQ, vm=1, type=3 + DRTOperatorIdentificationSequence OperatorIdentificationSequence; + /// OperatorsName (0008,1070) vr=PN, vm=1-n, type=2 + DcmPersonName OperatorsName; + /// OverrideParameterPointer (3008,0062) vr=AT, vm=1, type=1 + DcmAttributeTag OverrideParameterPointer; + /// OverrideReason (3008,0066) vr=ST, vm=1, type=3 + DcmShortText OverrideReason; + /// ParameterItemIndex (3008,0063) vr=IS, vm=1, type=1 + DcmIntegerString ParameterItemIndex; + /// ParameterSequencePointer (3008,0061) vr=AT, vm=1, type=1 + DcmAttributeTag ParameterSequencePointer; + /// ParameterValueNumber (3008,0067) vr=US, vm=1, type=3 + DcmUnsignedShort ParameterValueNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTOverrideSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTOverrideSequence(const DRTOverrideSequence ©); + + /** destructor + */ + virtual ~DRTOverrideSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTOverrideSequence &operator=(const DRTOverrideSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpbcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpbcs.h new file mode 100644 index 00000000..cb440c0d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpbcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPatientBreedCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPBCS_H +#define DRTPBCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for PatientBreedCodeSequence (0010,2293) + */ +class DCMTK_DCMRT_EXPORT DRTPatientBreedCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPatientBreedCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPatientBreedCodeSequence(const DRTPatientBreedCodeSequence ©); + + /** destructor + */ + virtual ~DRTPatientBreedCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPatientBreedCodeSequence &operator=(const DRTPatientBreedCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpcs.h new file mode 100644 index 00000000..f0cbcc24 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPCS_H +#define DRTPCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ProcedureCodeSequence (0008,1032) + */ +class DCMTK_DCMRT_EXPORT DRTProcedureCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTProcedureCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTProcedureCodeSequence(const DRTProcedureCodeSequence ©); + + /** destructor + */ + virtual ~DRTProcedureCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTProcedureCodeSequence &operator=(const DRTProcedureCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpcxs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpcxs.h new file mode 100644 index 00000000..ff8e68e5 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpcxs.h @@ -0,0 +1,570 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTProtocolContextSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPCXS_H +#define DRTPCXS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtccs.h" // for ConceptCodeSequence +#include "dcmtk/dcmrt/seq/drtcncs.h" // for ConceptNameCodeSequence +#include "dcmtk/dcmrt/seq/drtcims.h" // for ContentItemModifierSequence +#include "dcmtk/dcmrt/seq/drtmucs.h" // for MeasurementUnitsCodeSequence +#include "dcmtk/dcmrt/seq/drtrsos.h" // for ReferencedSOPSequence + + +/** Interface class for ProtocolContextSequence (0040,0440) + */ +class DCMTK_DCMRT_EXPORT DRTProtocolContextSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get Date (0040,a121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDate(OFString &value, const signed long pos = 0) const; + + /** get DateTime (0040,a120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDateTime(OFString &value, const signed long pos = 0) const; + + /** get FloatingPointValue (0040,a161) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFloatingPointValue(Float64 &value, const unsigned long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(OFString &value, const signed long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(Float64 &value, const unsigned long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(OFVector &value) const; + + /** get ObservationDateTime (0040,a032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getObservationDateTime(OFString &value, const signed long pos = 0) const; + + /** get PersonName (0040,a123) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonName(OFString &value, const signed long pos = 0) const; + + /** get RationalDenominatorValue (0040,a163) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRationalDenominatorValue(Uint32 &value, const unsigned long pos = 0) const; + + /** get RationalNumeratorValue (0040,a162) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRationalNumeratorValue(Sint32 &value, const unsigned long pos = 0) const; + + /** get TextValue (0040,a160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTextValue(OFString &value, const signed long pos = 0) const; + + /** get Time (0040,a122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTime(OFString &value, const signed long pos = 0) const; + + /** get UID (0040,a124) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUID(OFString &value, const signed long pos = 0) const; + + /** get ValueType (0040,a040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValueType(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ConceptCodeSequence (0040,a168) + * @return reference to sequence element + */ + DRTConceptCodeSequence &getConceptCodeSequence() + { return ConceptCodeSequence; } + + /** get ConceptCodeSequence (0040,a168) + * @return const reference to sequence element + */ + const DRTConceptCodeSequence &getConceptCodeSequence() const + { return ConceptCodeSequence; } + + /** get ConceptNameCodeSequence (0040,a043) + * @return reference to sequence element + */ + DRTConceptNameCodeSequence &getConceptNameCodeSequence() + { return ConceptNameCodeSequence; } + + /** get ConceptNameCodeSequence (0040,a043) + * @return const reference to sequence element + */ + const DRTConceptNameCodeSequence &getConceptNameCodeSequence() const + { return ConceptNameCodeSequence; } + + /** get ContentItemModifierSequence (0040,0441) + * @return reference to sequence element + */ + DRTContentItemModifierSequence &getContentItemModifierSequence() + { return ContentItemModifierSequence; } + + /** get ContentItemModifierSequence (0040,0441) + * @return const reference to sequence element + */ + const DRTContentItemModifierSequence &getContentItemModifierSequence() const + { return ContentItemModifierSequence; } + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return reference to sequence element + */ + DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() + { return MeasurementUnitsCodeSequence; } + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return const reference to sequence element + */ + const DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() const + { return MeasurementUnitsCodeSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return reference to sequence element + */ + DRTReferencedSOPSequence &getReferencedSOPSequence() + { return ReferencedSOPSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return const reference to sequence element + */ + const DRTReferencedSOPSequence &getReferencedSOPSequence() const + { return ReferencedSOPSequence; } + + // --- set DICOM attribute values --- + + /** set Date (0040,a121) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDate(const OFString &value, const OFBool check = OFTrue); + + /** set DateTime (0040,a120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set FloatingPointValue (0040,a161) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFloatingPointValue(const Float64 value, const unsigned long pos = 0); + + /** set NumericValue (0040,a30a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValue(const OFString &value, const OFBool check = OFTrue); + + /** set ObservationDateTime (0040,a032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setObservationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set PersonName (0040,a123) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonName(const OFString &value, const OFBool check = OFTrue); + + /** set RationalDenominatorValue (0040,a163) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRationalDenominatorValue(const Uint32 value, const unsigned long pos = 0); + + /** set RationalNumeratorValue (0040,a162) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRationalNumeratorValue(const Sint32 value, const unsigned long pos = 0); + + /** set TextValue (0040,a160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTextValue(const OFString &value, const OFBool check = OFTrue); + + /** set Time (0040,a122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTime(const OFString &value, const OFBool check = OFTrue); + + /** set UID (0040,a124) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUID(const OFString &value, const OFBool check = OFTrue); + + /** set ValueType (0040,a040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValueType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ConceptCodeSequence (0040,a168) vr=SQ, vm=1, type=1C + DRTConceptCodeSequence ConceptCodeSequence; + /// ConceptNameCodeSequence (0040,a043) vr=SQ, vm=1, type=1 + DRTConceptNameCodeSequence ConceptNameCodeSequence; + /// ContentItemModifierSequence (0040,0441) vr=SQ, vm=1, type=3 + DRTContentItemModifierSequence ContentItemModifierSequence; + /// Date (0040,a121) vr=DA, vm=1, type=1C + DcmDate Date; + /// DateTime (0040,a120) vr=DT, vm=1, type=1C + DcmDateTime DateTime; + /// FloatingPointValue (0040,a161) vr=FD, vm=1-n, type=1C + DcmFloatingPointDouble FloatingPointValue; + /// MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1C + DRTMeasurementUnitsCodeSequence MeasurementUnitsCodeSequence; + /// NumericValue (0040,a30a) vr=DS, vm=1-n, type=1C + DcmDecimalString NumericValue; + /// ObservationDateTime (0040,a032) vr=DT, vm=1, type=3 + DcmDateTime ObservationDateTime; + /// PersonName (0040,a123) vr=PN, vm=1, type=1C + DcmPersonName PersonName; + /// RationalDenominatorValue (0040,a163) vr=UL, vm=1-n, type=1C + DcmUnsignedLong RationalDenominatorValue; + /// RationalNumeratorValue (0040,a162) vr=SL, vm=1-n, type=1C + DcmSignedLong RationalNumeratorValue; + /// ReferencedSOPSequence (0008,1199) vr=SQ, vm=1, type=1C + DRTReferencedSOPSequence ReferencedSOPSequence; + /// TextValue (0040,a160) vr=UT, vm=1, type=1C + DcmUnlimitedText TextValue; + /// Time (0040,a122) vr=TM, vm=1, type=1C + DcmTime Time; + /// UID (0040,a124) vr=UI, vm=1, type=1C + DcmUniqueIdentifier UID; + /// ValueType (0040,a040) vr=CS, vm=1, type=1 + DcmCodeString ValueType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTProtocolContextSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTProtocolContextSequence(const DRTProtocolContextSequence ©); + + /** destructor + */ + virtual ~DRTProtocolContextSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTProtocolContextSequence &operator=(const DRTProtocolContextSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpdecs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpdecs.h new file mode 100644 index 00000000..a79f044a --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpdecs.h @@ -0,0 +1,384 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPrivateDataElementCharacteristicsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPDECS_H +#define DRTPDECS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtdias.h" // for DeidentificationActionSequence +#include "dcmtk/dcmrt/seq/drtpdeds.h" // for PrivateDataElementDefinitionSequence + + +/** Interface class for PrivateDataElementCharacteristicsSequence (0008,0300) + */ +class DCMTK_DCMRT_EXPORT DRTPrivateDataElementCharacteristicsSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BlockIdentifyingInformationStatus (0008,0303) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockIdentifyingInformationStatus(OFString &value, const signed long pos = 0) const; + + /** get NonidentifyingPrivateElements (0008,0304) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNonidentifyingPrivateElements(Uint16 &value, const unsigned long pos = 0) const; + + /** get PrivateCreatorReference (0008,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateCreatorReference(OFString &value, const signed long pos = 0) const; + + /** get PrivateGroupReference (0008,0301) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateGroupReference(Uint16 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get DeidentificationActionSequence (0008,0305) + * @return reference to sequence element + */ + DRTDeidentificationActionSequence &getDeidentificationActionSequence() + { return DeidentificationActionSequence; } + + /** get DeidentificationActionSequence (0008,0305) + * @return const reference to sequence element + */ + const DRTDeidentificationActionSequence &getDeidentificationActionSequence() const + { return DeidentificationActionSequence; } + + /** get PrivateDataElementDefinitionSequence (0008,0310) + * @return reference to sequence element + */ + DRTPrivateDataElementDefinitionSequence &getPrivateDataElementDefinitionSequence() + { return PrivateDataElementDefinitionSequence; } + + /** get PrivateDataElementDefinitionSequence (0008,0310) + * @return const reference to sequence element + */ + const DRTPrivateDataElementDefinitionSequence &getPrivateDataElementDefinitionSequence() const + { return PrivateDataElementDefinitionSequence; } + + // --- set DICOM attribute values --- + + /** set BlockIdentifyingInformationStatus (0008,0303) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockIdentifyingInformationStatus(const OFString &value, const OFBool check = OFTrue); + + /** set NonidentifyingPrivateElements (0008,0304) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNonidentifyingPrivateElements(const Uint16 value, const unsigned long pos = 0); + + /** set PrivateCreatorReference (0008,0302) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateCreatorReference(const OFString &value, const OFBool check = OFTrue); + + /** set PrivateGroupReference (0008,0301) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateGroupReference(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BlockIdentifyingInformationStatus (0008,0303) vr=CS, vm=1, type=1 + DcmCodeString BlockIdentifyingInformationStatus; + /// DeidentificationActionSequence (0008,0305) vr=SQ, vm=1, type=3 + DRTDeidentificationActionSequence DeidentificationActionSequence; + /// NonidentifyingPrivateElements (0008,0304) vr=US, vm=1-n, type=1C + DcmUnsignedShort NonidentifyingPrivateElements; + /// PrivateCreatorReference (0008,0302) vr=LO, vm=1, type=1 + DcmLongString PrivateCreatorReference; + /// PrivateDataElementDefinitionSequence (0008,0310) vr=SQ, vm=1, type=3 + DRTPrivateDataElementDefinitionSequence PrivateDataElementDefinitionSequence; + /// PrivateGroupReference (0008,0301) vr=US, vm=1, type=1 + DcmUnsignedShort PrivateGroupReference; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPrivateDataElementCharacteristicsSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPrivateDataElementCharacteristicsSequence(const DRTPrivateDataElementCharacteristicsSequence ©); + + /** destructor + */ + virtual ~DRTPrivateDataElementCharacteristicsSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPrivateDataElementCharacteristicsSequence &operator=(const DRTPrivateDataElementCharacteristicsSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpdeds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpdeds.h new file mode 100644 index 00000000..f568e993 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpdeds.h @@ -0,0 +1,432 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPrivateDataElementDefinitionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPDEDS_H +#define DRTPDEDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for PrivateDataElementDefinitionSequence (0008,0310) + */ +class DCMTK_DCMRT_EXPORT DRTPrivateDataElementDefinitionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get PrivateDataElement (0008,0308) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElement(Uint16 &value, const unsigned long pos = 0) const; + + /** get PrivateDataElementDescription (0008,030e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElementDescription(OFString &value, const signed long pos = 0) const; + + /** get PrivateDataElementEncoding (0008,030f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElementEncoding(OFString &value, const signed long pos = 0) const; + + /** get PrivateDataElementKeyword (0008,030d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElementKeyword(OFString &value, const signed long pos = 0) const; + + /** get PrivateDataElementName (0008,030c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElementName(OFString &value, const signed long pos = 0) const; + + /** get PrivateDataElementNumberOfItems (0008,030b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElementNumberOfItems(Uint32 &value, const unsigned long pos = 0) const; + + /** get PrivateDataElementValueMultiplicity (0008,0309) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElementValueMultiplicity(Uint32 &value, const unsigned long pos = 0) const; + + /** get PrivateDataElementValueRepresentation (0008,030a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPrivateDataElementValueRepresentation(OFString &value, const signed long pos = 0) const; + + /** get RetrieveURI (0040,e010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRetrieveURI(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set PrivateDataElement (0008,0308) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElement(const Uint16 value, const unsigned long pos = 0); + + /** set PrivateDataElementDescription (0008,030e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElementDescription(const OFString &value, const OFBool check = OFTrue); + + /** set PrivateDataElementEncoding (0008,030f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElementEncoding(const OFString &value, const OFBool check = OFTrue); + + /** set PrivateDataElementKeyword (0008,030d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElementKeyword(const OFString &value, const OFBool check = OFTrue); + + /** set PrivateDataElementName (0008,030c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElementName(const OFString &value, const OFBool check = OFTrue); + + /** set PrivateDataElementNumberOfItems (0008,030b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-2 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElementNumberOfItems(const Uint32 value, const unsigned long pos = 0); + + /** set PrivateDataElementValueMultiplicity (0008,0309) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElementValueMultiplicity(const Uint32 value, const unsigned long pos = 0); + + /** set PrivateDataElementValueRepresentation (0008,030a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPrivateDataElementValueRepresentation(const OFString &value, const OFBool check = OFTrue); + + /** set RetrieveURI (0040,e010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRetrieveURI(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// PrivateDataElement (0008,0308) vr=US, vm=1, type=1 + DcmUnsignedShort PrivateDataElement; + /// PrivateDataElementDescription (0008,030e) vr=UT, vm=1, type=3 + DcmUnlimitedText PrivateDataElementDescription; + /// PrivateDataElementEncoding (0008,030f) vr=UT, vm=1, type=3 + DcmUnlimitedText PrivateDataElementEncoding; + /// PrivateDataElementKeyword (0008,030d) vr=UC, vm=1, type=1 + DcmUnlimitedCharacters PrivateDataElementKeyword; + /// PrivateDataElementName (0008,030c) vr=UC, vm=1, type=1 + DcmUnlimitedCharacters PrivateDataElementName; + /// PrivateDataElementNumberOfItems (0008,030b) vr=UL, vm=1-2, type=1C + DcmUnsignedLong PrivateDataElementNumberOfItems; + /// PrivateDataElementValueMultiplicity (0008,0309) vr=UL, vm=1-3, type=1 + DcmUnsignedLong PrivateDataElementValueMultiplicity; + /// PrivateDataElementValueRepresentation (0008,030a) vr=CS, vm=1, type=1 + DcmCodeString PrivateDataElementValueRepresentation; + /// RetrieveURI (0040,e010) vr=UR, vm=1, type=3 + DcmUniversalResourceIdentifierOrLocator RetrieveURI; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPrivateDataElementDefinitionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPrivateDataElementDefinitionSequence(const DRTPrivateDataElementDefinitionSequence ©); + + /** destructor + */ + virtual ~DRTPrivateDataElementDefinitionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPrivateDataElementDefinitionSequence &operator=(const DRTPrivateDataElementDefinitionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpfms.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpfms.h new file mode 100644 index 00000000..c007a34e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpfms.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPrimaryFluenceModeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPFMS_H +#define DRTPFMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for PrimaryFluenceModeSequence (3002,0050) + */ +class DCMTK_DCMRT_EXPORT DRTPrimaryFluenceModeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get FluenceMode (3002,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFluenceMode(OFString &value, const signed long pos = 0) const; + + /** get FluenceModeID (3002,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFluenceModeID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set FluenceMode (3002,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFluenceMode(const OFString &value, const OFBool check = OFTrue); + + /** set FluenceModeID (3002,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFluenceModeID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// FluenceMode (3002,0051) vr=CS, vm=1, type=1 + DcmCodeString FluenceMode; + /// FluenceModeID (3002,0052) vr=SH, vm=1, type=1C + DcmShortString FluenceModeID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPrimaryFluenceModeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPrimaryFluenceModeSequence(const DRTPrimaryFluenceModeSequence ©); + + /** destructor + */ + virtual ~DRTPrimaryFluenceModeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPrimaryFluenceModeSequence &operator=(const DRTPrimaryFluenceModeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpics.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpics.h new file mode 100644 index 00000000..89f367f0 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpics.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPersonIdentificationCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPICS_H +#define DRTPICS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for PersonIdentificationCodeSequence (0040,1101) + */ +class DCMTK_DCMRT_EXPORT DRTPersonIdentificationCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPersonIdentificationCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPersonIdentificationCodeSequence(const DRTPersonIdentificationCodeSequence ©); + + /** destructor + */ + virtual ~DRTPersonIdentificationCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPersonIdentificationCodeSequence &operator=(const DRTPersonIdentificationCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtporcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtporcs.h new file mode 100644 index 00000000..b1b27d1a --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtporcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPurposeOfReferenceCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPORCS_H +#define DRTPORCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for PurposeOfReferenceCodeSequence (0040,a170) + */ +class DCMTK_DCMRT_EXPORT DRTPurposeOfReferenceCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPurposeOfReferenceCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPurposeOfReferenceCodeSequence(const DRTPurposeOfReferenceCodeSequence ©); + + /** destructor + */ + virtual ~DRTPurposeOfReferenceCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPurposeOfReferenceCodeSequence &operator=(const DRTPurposeOfReferenceCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtporis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtporis.h new file mode 100644 index 00000000..88402ffd --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtporis.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPhysiciansOfRecordIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPORIS_H +#define DRTPORIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtics.h" // for InstitutionCodeSequence +#include "dcmtk/dcmrt/seq/drtpics.h" // for PersonIdentificationCodeSequence + + +/** Interface class for PhysiciansOfRecordIdentificationSequence (0008,1049) + */ +class DCMTK_DCMRT_EXPORT DRTPhysiciansOfRecordIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get PersonAddress (0040,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonAddress(OFString &value, const signed long pos = 0) const; + + /** get PersonTelecomInformation (0040,1104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelecomInformation(OFString &value, const signed long pos = 0) const; + + /** get PersonTelephoneNumbers (0040,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelephoneNumbers(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get InstitutionCodeSequence (0008,0082) + * @return reference to sequence element + */ + DRTInstitutionCodeSequence &getInstitutionCodeSequence() + { return InstitutionCodeSequence; } + + /** get InstitutionCodeSequence (0008,0082) + * @return const reference to sequence element + */ + const DRTInstitutionCodeSequence &getInstitutionCodeSequence() const + { return InstitutionCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return reference to sequence element + */ + DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() + { return PersonIdentificationCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return const reference to sequence element + */ + const DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() const + { return PersonIdentificationCodeSequence; } + + // --- set DICOM attribute values --- + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set PersonAddress (0040,1102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonAddress(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelecomInformation (0040,1104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelecomInformation(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelephoneNumbers (0040,1103) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelephoneNumbers(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionCodeSequence (0008,0082) vr=SQ, vm=1, type=1C + DRTInstitutionCodeSequence InstitutionCodeSequence; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=1C + DcmLongString InstitutionName; + /// PersonAddress (0040,1102) vr=ST, vm=1, type=3 + DcmShortText PersonAddress; + /// PersonIdentificationCodeSequence (0040,1101) vr=SQ, vm=1, type=1 + DRTPersonIdentificationCodeSequence PersonIdentificationCodeSequence; + /// PersonTelecomInformation (0040,1104) vr=LT, vm=1, type=3 + DcmLongText PersonTelecomInformation; + /// PersonTelephoneNumbers (0040,1103) vr=LO, vm=1-n, type=3 + DcmLongString PersonTelephoneNumbers; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPhysiciansOfRecordIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPhysiciansOfRecordIdentificationSequence(const DRTPhysiciansOfRecordIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTPhysiciansOfRecordIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPhysiciansOfRecordIdentificationSequence &operator=(const DRTPhysiciansOfRecordIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtppcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtppcs.h new file mode 100644 index 00000000..69a8d183 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtppcs.h @@ -0,0 +1,560 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPerformedProtocolCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPPCS_H +#define DRTPPCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence +#include "dcmtk/dcmrt/seq/drtpcxs.h" // for ProtocolContextSequence + + +/** Interface class for PerformedProtocolCodeSequence (0040,0260) + */ +class DCMTK_DCMRT_EXPORT DRTPerformedProtocolCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + /** get ProtocolContextSequence (0040,0440) + * @return reference to sequence element + */ + DRTProtocolContextSequence &getProtocolContextSequence() + { return ProtocolContextSequence; } + + /** get ProtocolContextSequence (0040,0440) + * @return const reference to sequence element + */ + const DRTProtocolContextSequence &getProtocolContextSequence() const + { return ProtocolContextSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// ProtocolContextSequence (0040,0440) vr=SQ, vm=1, type=3 + DRTProtocolContextSequence ProtocolContextSequence; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPerformedProtocolCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPerformedProtocolCodeSequence(const DRTPerformedProtocolCodeSequence ©); + + /** destructor + */ + virtual ~DRTPerformedProtocolCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPerformedProtocolCodeSequence &operator=(const DRTPerformedProtocolCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtprsis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtprsis.h new file mode 100644 index 00000000..5ea10628 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtprsis.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPhysiciansReadingStudyIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPRSIS_H +#define DRTPRSIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtics.h" // for InstitutionCodeSequence +#include "dcmtk/dcmrt/seq/drtpics.h" // for PersonIdentificationCodeSequence + + +/** Interface class for PhysiciansReadingStudyIdentificationSequence (0008,1062) + */ +class DCMTK_DCMRT_EXPORT DRTPhysiciansReadingStudyIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get PersonAddress (0040,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonAddress(OFString &value, const signed long pos = 0) const; + + /** get PersonTelecomInformation (0040,1104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelecomInformation(OFString &value, const signed long pos = 0) const; + + /** get PersonTelephoneNumbers (0040,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelephoneNumbers(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get InstitutionCodeSequence (0008,0082) + * @return reference to sequence element + */ + DRTInstitutionCodeSequence &getInstitutionCodeSequence() + { return InstitutionCodeSequence; } + + /** get InstitutionCodeSequence (0008,0082) + * @return const reference to sequence element + */ + const DRTInstitutionCodeSequence &getInstitutionCodeSequence() const + { return InstitutionCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return reference to sequence element + */ + DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() + { return PersonIdentificationCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return const reference to sequence element + */ + const DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() const + { return PersonIdentificationCodeSequence; } + + // --- set DICOM attribute values --- + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set PersonAddress (0040,1102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonAddress(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelecomInformation (0040,1104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelecomInformation(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelephoneNumbers (0040,1103) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelephoneNumbers(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionCodeSequence (0008,0082) vr=SQ, vm=1, type=1C + DRTInstitutionCodeSequence InstitutionCodeSequence; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=1C + DcmLongString InstitutionName; + /// PersonAddress (0040,1102) vr=ST, vm=1, type=3 + DcmShortText PersonAddress; + /// PersonIdentificationCodeSequence (0040,1101) vr=SQ, vm=1, type=1 + DRTPersonIdentificationCodeSequence PersonIdentificationCodeSequence; + /// PersonTelecomInformation (0040,1104) vr=LT, vm=1, type=3 + DcmLongText PersonTelecomInformation; + /// PersonTelephoneNumbers (0040,1103) vr=LO, vm=1-n, type=3 + DcmLongString PersonTelephoneNumbers; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPhysiciansReadingStudyIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPhysiciansReadingStudyIdentificationSequence(const DRTPhysiciansReadingStudyIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTPhysiciansReadingStudyIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPhysiciansReadingStudyIdentificationSequence &operator=(const DRTPhysiciansReadingStudyIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpscs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpscs.h new file mode 100644 index 00000000..92349bcf --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpscs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPatientSpeciesCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPSCS_H +#define DRTPSCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for PatientSpeciesCodeSequence (0010,2202) + */ +class DCMTK_DCMRT_EXPORT DRTPatientSpeciesCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPatientSpeciesCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPatientSpeciesCodeSequence(const DRTPatientSpeciesCodeSequence ©); + + /** destructor + */ + virtual ~DRTPatientSpeciesCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPatientSpeciesCodeSequence &operator=(const DRTPatientSpeciesCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpsics.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpsics.h new file mode 100644 index 00000000..c015f724 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpsics.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPatientSizeCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPSICS_H +#define DRTPSICS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for PatientSizeCodeSequence (0010,1021) + */ +class DCMTK_DCMRT_EXPORT DRTPatientSizeCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPatientSizeCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPatientSizeCodeSequence(const DRTPatientSizeCodeSequence ©); + + /** destructor + */ + virtual ~DRTPatientSizeCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPatientSizeCodeSequence &operator=(const DRTPatientSizeCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpss.h new file mode 100644 index 00000000..648e2690 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpss.h @@ -0,0 +1,537 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPatientSetupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPSS_H +#define DRTPSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtfds.h" // for FixationDeviceSequence +#include "dcmtk/dcmrt/seq/drtmss.h" // for MotionSynchronizationSequence +#include "dcmtk/dcmrt/seq/drtrsis.h" // for ReferencedSetupImageSequence +#include "dcmtk/dcmrt/seq/drtsds.h" // for SetupDeviceSequence +#include "dcmtk/dcmrt/seq/drtshds.h" // for ShieldingDeviceSequence + + +/** Interface class for PatientSetupSequence (300a,0180) + */ +class DCMTK_DCMRT_EXPORT DRTPatientSetupSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get PatientAdditionalPosition (300a,0184) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientAdditionalPosition(OFString &value, const signed long pos = 0) const; + + /** get PatientPosition (0018,5100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientPosition(OFString &value, const signed long pos = 0) const; + + /** get PatientSetupLabel (300a,0183) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSetupLabel(OFString &value, const signed long pos = 0) const; + + /** get PatientSetupNumber (300a,0182) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSetupNumber(OFString &value, const signed long pos = 0) const; + + /** get PatientSetupNumber (300a,0182) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSetupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SetupTechnique (300a,01b0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupTechnique(OFString &value, const signed long pos = 0) const; + + /** get SetupTechniqueDescription (300a,01b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupTechniqueDescription(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralSetupDisplacement (300a,01d6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralSetupDisplacement(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralSetupDisplacement (300a,01d6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralSetupDisplacement(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalSetupDisplacement (300a,01d4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalSetupDisplacement(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalSetupDisplacement (300a,01d4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalSetupDisplacement(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopVerticalSetupDisplacement (300a,01d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalSetupDisplacement(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalSetupDisplacement (300a,01d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalSetupDisplacement(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get FixationDeviceSequence (300a,0190) + * @return reference to sequence element + */ + DRTFixationDeviceSequence &getFixationDeviceSequence() + { return FixationDeviceSequence; } + + /** get FixationDeviceSequence (300a,0190) + * @return const reference to sequence element + */ + const DRTFixationDeviceSequence &getFixationDeviceSequence() const + { return FixationDeviceSequence; } + + /** get MotionSynchronizationSequence (300a,0410) + * @return reference to sequence element + */ + DRTMotionSynchronizationSequence &getMotionSynchronizationSequence() + { return MotionSynchronizationSequence; } + + /** get MotionSynchronizationSequence (300a,0410) + * @return const reference to sequence element + */ + const DRTMotionSynchronizationSequence &getMotionSynchronizationSequence() const + { return MotionSynchronizationSequence; } + + /** get ReferencedSetupImageSequence (300a,0401) + * @return reference to sequence element + */ + DRTReferencedSetupImageSequence &getReferencedSetupImageSequence() + { return ReferencedSetupImageSequence; } + + /** get ReferencedSetupImageSequence (300a,0401) + * @return const reference to sequence element + */ + const DRTReferencedSetupImageSequence &getReferencedSetupImageSequence() const + { return ReferencedSetupImageSequence; } + + /** get SetupDeviceSequence (300a,01b4) + * @return reference to sequence element + */ + DRTSetupDeviceSequence &getSetupDeviceSequence() + { return SetupDeviceSequence; } + + /** get SetupDeviceSequence (300a,01b4) + * @return const reference to sequence element + */ + const DRTSetupDeviceSequence &getSetupDeviceSequence() const + { return SetupDeviceSequence; } + + /** get ShieldingDeviceSequence (300a,01a0) + * @return reference to sequence element + */ + DRTShieldingDeviceSequence &getShieldingDeviceSequence() + { return ShieldingDeviceSequence; } + + /** get ShieldingDeviceSequence (300a,01a0) + * @return const reference to sequence element + */ + const DRTShieldingDeviceSequence &getShieldingDeviceSequence() const + { return ShieldingDeviceSequence; } + + // --- set DICOM attribute values --- + + /** set PatientAdditionalPosition (300a,0184) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientAdditionalPosition(const OFString &value, const OFBool check = OFTrue); + + /** set PatientPosition (0018,5100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientPosition(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSetupLabel (300a,0183) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSetupLabel(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSetupNumber (300a,0182) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSetupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SetupTechnique (300a,01b0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupTechnique(const OFString &value, const OFBool check = OFTrue); + + /** set SetupTechniqueDescription (300a,01b2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupTechniqueDescription(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLateralSetupDisplacement (300a,01d6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLateralSetupDisplacement(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalSetupDisplacement (300a,01d4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLongitudinalSetupDisplacement(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopVerticalSetupDisplacement (300a,01d2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopVerticalSetupDisplacement(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// FixationDeviceSequence (300a,0190) vr=SQ, vm=1, type=3 + DRTFixationDeviceSequence FixationDeviceSequence; + /// MotionSynchronizationSequence (300a,0410) vr=SQ, vm=1, type=3 + DRTMotionSynchronizationSequence MotionSynchronizationSequence; + /// PatientAdditionalPosition (300a,0184) vr=LO, vm=1, type=1C + DcmLongString PatientAdditionalPosition; + /// PatientPosition (0018,5100) vr=CS, vm=1, type=1C + DcmCodeString PatientPosition; + /// PatientSetupLabel (300a,0183) vr=LO, vm=1, type=3 + DcmLongString PatientSetupLabel; + /// PatientSetupNumber (300a,0182) vr=IS, vm=1, type=1 + DcmIntegerString PatientSetupNumber; + /// ReferencedSetupImageSequence (300a,0401) vr=SQ, vm=1, type=3 + DRTReferencedSetupImageSequence ReferencedSetupImageSequence; + /// SetupDeviceSequence (300a,01b4) vr=SQ, vm=1, type=3 + DRTSetupDeviceSequence SetupDeviceSequence; + /// SetupTechnique (300a,01b0) vr=CS, vm=1, type=3 + DcmCodeString SetupTechnique; + /// SetupTechniqueDescription (300a,01b2) vr=ST, vm=1, type=3 + DcmShortText SetupTechniqueDescription; + /// ShieldingDeviceSequence (300a,01a0) vr=SQ, vm=1, type=3 + DRTShieldingDeviceSequence ShieldingDeviceSequence; + /// TableTopLateralSetupDisplacement (300a,01d6) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLateralSetupDisplacement; + /// TableTopLongitudinalSetupDisplacement (300a,01d4) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLongitudinalSetupDisplacement; + /// TableTopVerticalSetupDisplacement (300a,01d2) vr=DS, vm=1, type=3 + DcmDecimalString TableTopVerticalSetupDisplacement; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPatientSetupSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPatientSetupSequence(const DRTPatientSetupSequence ©); + + /** destructor + */ + virtual ~DRTPatientSetupSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPatientSetupSequence &operator=(const DRTPatientSetupSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpsss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpsss.h new file mode 100644 index 00000000..5285070b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpsss.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPredecessorStructureSetSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPSSS_H +#define DRTPSSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for PredecessorStructureSetSequence (3006,0018) + */ +class DCMTK_DCMRT_EXPORT DRTPredecessorStructureSetSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPredecessorStructureSetSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPredecessorStructureSetSequence(const DRTPredecessorStructureSetSequence ©); + + /** destructor + */ + virtual ~DRTPredecessorStructureSetSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPredecessorStructureSetSequence &operator=(const DRTPredecessorStructureSetSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtpvis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtpvis.h new file mode 100644 index 00000000..c8310780 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtpvis.h @@ -0,0 +1,516 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTPlannedVerificationImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTPVIS_H +#define DRTPVIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for PlannedVerificationImageSequence (300a,00ca) + */ +class DCMTK_DCMRT_EXPORT DRTPlannedVerificationImageSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get EndCumulativeMetersetWeight (300c,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEndCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get EndCumulativeMetersetWeight (300c,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEndCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get ImagingDeviceSpecificAcquisitionParameters (300a,00cc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getImagingDeviceSpecificAcquisitionParameters(OFString &value, const signed long pos = 0) const; + + /** get MetersetExposure (3002,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMetersetExposure(OFString &value, const signed long pos = 0) const; + + /** get MetersetExposure (3002,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMetersetExposure(Float64 &value, const unsigned long pos = 0) const; + + /** get RTImageOrientation (3002,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImageOrientation(OFString &value, const signed long pos = 0) const; + + /** get RTImageOrientation (3002,0010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImageOrientation(Float64 &value, const unsigned long pos = 0) const; + + /** get RTImageOrientation (3002,0010) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImageOrientation(OFVector &value) const; + + /** get RTImagePlane (3002,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImagePlane(OFString &value, const signed long pos = 0) const; + + /** get RTImagePosition (3002,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImagePosition(OFString &value, const signed long pos = 0) const; + + /** get RTImagePosition (3002,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImagePosition(Float64 &value, const unsigned long pos = 0) const; + + /** get RTImagePosition (3002,0012) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImagePosition(OFVector &value) const; + + /** get RTImageSID (3002,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImageSID(OFString &value, const signed long pos = 0) const; + + /** get RTImageSID (3002,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTImageSID(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedReferenceImageNumber (300c,0007) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedReferenceImageNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedReferenceImageNumber (300c,0007) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedReferenceImageNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get StartCumulativeMetersetWeight (300c,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStartCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get StartCumulativeMetersetWeight (300c,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStartCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get XRayImageReceptorAngle (3002,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getXRayImageReceptorAngle(OFString &value, const signed long pos = 0) const; + + /** get XRayImageReceptorAngle (3002,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getXRayImageReceptorAngle(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set EndCumulativeMetersetWeight (300c,0009) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEndCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set ImagingDeviceSpecificAcquisitionParameters (300a,00cc) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setImagingDeviceSpecificAcquisitionParameters(const OFString &value, const OFBool check = OFTrue); + + /** set MetersetExposure (3002,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMetersetExposure(const OFString &value, const OFBool check = OFTrue); + + /** set RTImageOrientation (3002,0010) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (6) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTImageOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set RTImagePlane (3002,000c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTImagePlane(const OFString &value, const OFBool check = OFTrue); + + /** set RTImagePosition (3002,0012) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTImagePosition(const OFString &value, const OFBool check = OFTrue); + + /** set RTImageSID (3002,0026) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTImageSID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedReferenceImageNumber (300c,0007) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedReferenceImageNumber(const OFString &value, const OFBool check = OFTrue); + + /** set StartCumulativeMetersetWeight (300c,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStartCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set XRayImageReceptorAngle (3002,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setXRayImageReceptorAngle(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// EndCumulativeMetersetWeight (300c,0009) vr=DS, vm=1, type=3 + DcmDecimalString EndCumulativeMetersetWeight; + /// ImagingDeviceSpecificAcquisitionParameters (300a,00cc) vr=LO, vm=1-n, type=3 + DcmLongString ImagingDeviceSpecificAcquisitionParameters; + /// MetersetExposure (3002,0032) vr=DS, vm=1, type=3 + DcmDecimalString MetersetExposure; + /// RTImageOrientation (3002,0010) vr=DS, vm=6, type=3 + DcmDecimalString RTImageOrientation; + /// RTImagePlane (3002,000c) vr=CS, vm=1, type=3 + DcmCodeString RTImagePlane; + /// RTImagePosition (3002,0012) vr=DS, vm=2, type=3 + DcmDecimalString RTImagePosition; + /// RTImageSID (3002,0026) vr=DS, vm=1, type=3 + DcmDecimalString RTImageSID; + /// ReferencedReferenceImageNumber (300c,0007) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedReferenceImageNumber; + /// StartCumulativeMetersetWeight (300c,0008) vr=DS, vm=1, type=3 + DcmDecimalString StartCumulativeMetersetWeight; + /// XRayImageReceptorAngle (3002,000e) vr=DS, vm=1, type=3 + DcmDecimalString XRayImageReceptorAngle; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTPlannedVerificationImageSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTPlannedVerificationImageSequence(const DRTPlannedVerificationImageSequence ©); + + /** destructor + */ + virtual ~DRTPlannedVerificationImageSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTPlannedVerificationImageSequence &operator=(const DRTPlannedVerificationImageSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtqds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtqds.h new file mode 100644 index 00000000..278f61d9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtqds.h @@ -0,0 +1,555 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTQuantityDefinitionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTQDS_H +#define DRTQDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtccs.h" // for ConceptCodeSequence +#include "dcmtk/dcmrt/seq/drtcncs.h" // for ConceptNameCodeSequence +#include "dcmtk/dcmrt/seq/drtmucs.h" // for MeasurementUnitsCodeSequence +#include "dcmtk/dcmrt/seq/drtrsos.h" // for ReferencedSOPSequence + + +/** Interface class for QuantityDefinitionSequence (0040,9220) + */ +class DCMTK_DCMRT_EXPORT DRTQuantityDefinitionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get Date (0040,a121) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDate(OFString &value, const signed long pos = 0) const; + + /** get DateTime (0040,a120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDateTime(OFString &value, const signed long pos = 0) const; + + /** get FloatingPointValue (0040,a161) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFloatingPointValue(Float64 &value, const unsigned long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(OFString &value, const signed long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(Float64 &value, const unsigned long pos = 0) const; + + /** get NumericValue (0040,a30a) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(OFVector &value) const; + + /** get ObservationDateTime (0040,a032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getObservationDateTime(OFString &value, const signed long pos = 0) const; + + /** get PersonName (0040,a123) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonName(OFString &value, const signed long pos = 0) const; + + /** get RationalDenominatorValue (0040,a163) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRationalDenominatorValue(Uint32 &value, const unsigned long pos = 0) const; + + /** get RationalNumeratorValue (0040,a162) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRationalNumeratorValue(Sint32 &value, const unsigned long pos = 0) const; + + /** get TextValue (0040,a160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTextValue(OFString &value, const signed long pos = 0) const; + + /** get Time (0040,a122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTime(OFString &value, const signed long pos = 0) const; + + /** get UID (0040,a124) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUID(OFString &value, const signed long pos = 0) const; + + /** get ValueType (0040,a040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValueType(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ConceptCodeSequence (0040,a168) + * @return reference to sequence element + */ + DRTConceptCodeSequence &getConceptCodeSequence() + { return ConceptCodeSequence; } + + /** get ConceptCodeSequence (0040,a168) + * @return const reference to sequence element + */ + const DRTConceptCodeSequence &getConceptCodeSequence() const + { return ConceptCodeSequence; } + + /** get ConceptNameCodeSequence (0040,a043) + * @return reference to sequence element + */ + DRTConceptNameCodeSequence &getConceptNameCodeSequence() + { return ConceptNameCodeSequence; } + + /** get ConceptNameCodeSequence (0040,a043) + * @return const reference to sequence element + */ + const DRTConceptNameCodeSequence &getConceptNameCodeSequence() const + { return ConceptNameCodeSequence; } + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return reference to sequence element + */ + DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() + { return MeasurementUnitsCodeSequence; } + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return const reference to sequence element + */ + const DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() const + { return MeasurementUnitsCodeSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return reference to sequence element + */ + DRTReferencedSOPSequence &getReferencedSOPSequence() + { return ReferencedSOPSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return const reference to sequence element + */ + const DRTReferencedSOPSequence &getReferencedSOPSequence() const + { return ReferencedSOPSequence; } + + // --- set DICOM attribute values --- + + /** set Date (0040,a121) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDate(const OFString &value, const OFBool check = OFTrue); + + /** set DateTime (0040,a120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set FloatingPointValue (0040,a161) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFloatingPointValue(const Float64 value, const unsigned long pos = 0); + + /** set NumericValue (0040,a30a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValue(const OFString &value, const OFBool check = OFTrue); + + /** set ObservationDateTime (0040,a032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setObservationDateTime(const OFString &value, const OFBool check = OFTrue); + + /** set PersonName (0040,a123) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonName(const OFString &value, const OFBool check = OFTrue); + + /** set RationalDenominatorValue (0040,a163) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRationalDenominatorValue(const Uint32 value, const unsigned long pos = 0); + + /** set RationalNumeratorValue (0040,a162) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRationalNumeratorValue(const Sint32 value, const unsigned long pos = 0); + + /** set TextValue (0040,a160) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTextValue(const OFString &value, const OFBool check = OFTrue); + + /** set Time (0040,a122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTime(const OFString &value, const OFBool check = OFTrue); + + /** set UID (0040,a124) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUID(const OFString &value, const OFBool check = OFTrue); + + /** set ValueType (0040,a040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValueType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ConceptCodeSequence (0040,a168) vr=SQ, vm=1, type=1C + DRTConceptCodeSequence ConceptCodeSequence; + /// ConceptNameCodeSequence (0040,a043) vr=SQ, vm=1, type=1 + DRTConceptNameCodeSequence ConceptNameCodeSequence; + /// Date (0040,a121) vr=DA, vm=1, type=1C + DcmDate Date; + /// DateTime (0040,a120) vr=DT, vm=1, type=1C + DcmDateTime DateTime; + /// FloatingPointValue (0040,a161) vr=FD, vm=1-n, type=1C + DcmFloatingPointDouble FloatingPointValue; + /// MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1C + DRTMeasurementUnitsCodeSequence MeasurementUnitsCodeSequence; + /// NumericValue (0040,a30a) vr=DS, vm=1-n, type=1C + DcmDecimalString NumericValue; + /// ObservationDateTime (0040,a032) vr=DT, vm=1, type=3 + DcmDateTime ObservationDateTime; + /// PersonName (0040,a123) vr=PN, vm=1, type=1C + DcmPersonName PersonName; + /// RationalDenominatorValue (0040,a163) vr=UL, vm=1-n, type=1C + DcmUnsignedLong RationalDenominatorValue; + /// RationalNumeratorValue (0040,a162) vr=SL, vm=1-n, type=1C + DcmSignedLong RationalNumeratorValue; + /// ReferencedSOPSequence (0008,1199) vr=SQ, vm=1, type=1C + DRTReferencedSOPSequence ReferencedSOPSequence; + /// TextValue (0040,a160) vr=UT, vm=1, type=1C + DcmUnlimitedText TextValue; + /// Time (0040,a122) vr=TM, vm=1, type=1C + DcmTime Time; + /// UID (0040,a124) vr=UI, vm=1, type=1C + DcmUniqueIdentifier UID; + /// ValueType (0040,a040) vr=CS, vm=1, type=1 + DcmCodeString ValueType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTQuantityDefinitionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTQuantityDefinitionSequence(const DRTQuantityDefinitionSequence ©); + + /** destructor + */ + virtual ~DRTQuantityDefinitionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTQuantityDefinitionSequence &operator=(const DRTQuantityDefinitionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtras.h b/dcmrt/include/dcmtk/dcmrt/seq/drtras.h new file mode 100644 index 00000000..89895943 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtras.h @@ -0,0 +1,477 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRequestAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRAS_H +#define DRTRAS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtians.h" // for IssuerOfAccessionNumberSequence +#include "dcmtk/dcmrt/seq/drtrrpcs.h" // for ReasonForRequestedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtrss.h" // for ReferencedStudySequence +#include "dcmtk/dcmrt/seq/drtrpcs.h" // for RequestedProcedureCodeSequence +#include "dcmtk/dcmrt/seq/drtspcs.h" // for ScheduledProtocolCodeSequence + + +/** Interface class for RequestAttributesSequence (0040,0275) + */ +class DCMTK_DCMRT_EXPORT DRTRequestAttributesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessionNumber (0008,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessionNumber(OFString &value, const signed long pos = 0) const; + + /** get ReasonForTheRequestedProcedure (0040,1002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReasonForTheRequestedProcedure(OFString &value, const signed long pos = 0) const; + + /** get RequestedProcedureDescription (0032,1060) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRequestedProcedureDescription(OFString &value, const signed long pos = 0) const; + + /** get RequestedProcedureID (0040,1001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRequestedProcedureID(OFString &value, const signed long pos = 0) const; + + /** get ScheduledProcedureStepDescription (0040,0007) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScheduledProcedureStepDescription(OFString &value, const signed long pos = 0) const; + + /** get ScheduledProcedureStepID (0040,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScheduledProcedureStepID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return reference to sequence element + */ + DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() + { return IssuerOfAccessionNumberSequence; } + + /** get IssuerOfAccessionNumberSequence (0008,0051) + * @return const reference to sequence element + */ + const DRTIssuerOfAccessionNumberSequence &getIssuerOfAccessionNumberSequence() const + { return IssuerOfAccessionNumberSequence; } + + /** get ReasonForRequestedProcedureCodeSequence (0040,100a) + * @return reference to sequence element + */ + DRTReasonForRequestedProcedureCodeSequence &getReasonForRequestedProcedureCodeSequence() + { return ReasonForRequestedProcedureCodeSequence; } + + /** get ReasonForRequestedProcedureCodeSequence (0040,100a) + * @return const reference to sequence element + */ + const DRTReasonForRequestedProcedureCodeSequence &getReasonForRequestedProcedureCodeSequence() const + { return ReasonForRequestedProcedureCodeSequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return reference to sequence element + */ + DRTReferencedStudySequence &getReferencedStudySequence() + { return ReferencedStudySequence; } + + /** get ReferencedStudySequence (0008,1110) + * @return const reference to sequence element + */ + const DRTReferencedStudySequence &getReferencedStudySequence() const + { return ReferencedStudySequence; } + + /** get RequestedProcedureCodeSequence (0032,1064) + * @return reference to sequence element + */ + DRTRequestedProcedureCodeSequence &getRequestedProcedureCodeSequence() + { return RequestedProcedureCodeSequence; } + + /** get RequestedProcedureCodeSequence (0032,1064) + * @return const reference to sequence element + */ + const DRTRequestedProcedureCodeSequence &getRequestedProcedureCodeSequence() const + { return RequestedProcedureCodeSequence; } + + /** get ScheduledProtocolCodeSequence (0040,0008) + * @return reference to sequence element + */ + DRTScheduledProtocolCodeSequence &getScheduledProtocolCodeSequence() + { return ScheduledProtocolCodeSequence; } + + /** get ScheduledProtocolCodeSequence (0040,0008) + * @return const reference to sequence element + */ + const DRTScheduledProtocolCodeSequence &getScheduledProtocolCodeSequence() const + { return ScheduledProtocolCodeSequence; } + + // --- set DICOM attribute values --- + + /** set AccessionNumber (0008,0050) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReasonForTheRequestedProcedure (0040,1002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReasonForTheRequestedProcedure(const OFString &value, const OFBool check = OFTrue); + + /** set RequestedProcedureDescription (0032,1060) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRequestedProcedureDescription(const OFString &value, const OFBool check = OFTrue); + + /** set RequestedProcedureID (0040,1001) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRequestedProcedureID(const OFString &value, const OFBool check = OFTrue); + + /** set ScheduledProcedureStepDescription (0040,0007) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScheduledProcedureStepDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ScheduledProcedureStepID (0040,0009) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScheduledProcedureStepID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessionNumber (0008,0050) vr=SH, vm=1, type=3 + DcmShortString AccessionNumber; + /// IssuerOfAccessionNumberSequence (0008,0051) vr=SQ, vm=1, type=3 + DRTIssuerOfAccessionNumberSequence IssuerOfAccessionNumberSequence; + /// ReasonForRequestedProcedureCodeSequence (0040,100a) vr=SQ, vm=1, type=3 + DRTReasonForRequestedProcedureCodeSequence ReasonForRequestedProcedureCodeSequence; + /// ReasonForTheRequestedProcedure (0040,1002) vr=LO, vm=1, type=3 + DcmLongString ReasonForTheRequestedProcedure; + /// ReferencedStudySequence (0008,1110) vr=SQ, vm=1, type=3 + DRTReferencedStudySequence ReferencedStudySequence; + /// RequestedProcedureCodeSequence (0032,1064) vr=SQ, vm=1, type=3 + DRTRequestedProcedureCodeSequence RequestedProcedureCodeSequence; + /// RequestedProcedureDescription (0032,1060) vr=LO, vm=1, type=3 + DcmLongString RequestedProcedureDescription; + /// RequestedProcedureID (0040,1001) vr=SH, vm=1, type=1C + DcmShortString RequestedProcedureID; + /// ScheduledProcedureStepDescription (0040,0007) vr=LO, vm=1, type=3 + DcmLongString ScheduledProcedureStepDescription; + /// ScheduledProcedureStepID (0040,0009) vr=SH, vm=1, type=1C + DcmShortString ScheduledProcedureStepID; + /// ScheduledProtocolCodeSequence (0040,0008) vr=SQ, vm=1, type=3 + DRTScheduledProtocolCodeSequence ScheduledProtocolCodeSequence; + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=3 + DcmUniqueIdentifier StudyInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRequestAttributesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRequestAttributesSequence(const DRTRequestAttributesSequence ©); + + /** destructor + */ + virtual ~DRTRequestAttributesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRequestAttributesSequence &operator=(const DRTRequestAttributesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbas2.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbas2.h new file mode 100644 index 00000000..05000d07 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbas2.h @@ -0,0 +1,311 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBAS2_H +#define DRTRBAS2_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedBrachyApplicationSetupSequence (300c,000a) in RTDoseModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedBrachyApplicationSetupNumber (300c,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBrachyApplicationSetupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBrachyApplicationSetupNumber (300c,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBrachyApplicationSetupNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedBrachyApplicationSetupNumber (300c,000c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedBrachyApplicationSetupNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedBrachyApplicationSetupNumber (300c,000c) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedBrachyApplicationSetupNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule(const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule ©); + + /** destructor + */ + virtual ~DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule &operator=(const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbas8.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbas8.h new file mode 100644 index 00000000..a2af4757 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbas8.h @@ -0,0 +1,363 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBAS8_H +#define DRTRBAS8_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedBrachyApplicationSetupSequence (300c,000a) in RTFractionSchemeModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BrachyApplicationSetupDose (300a,00a4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyApplicationSetupDose(OFString &value, const signed long pos = 0) const; + + /** get BrachyApplicationSetupDose (300a,00a4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyApplicationSetupDose(Float64 &value, const unsigned long pos = 0) const; + + /** get BrachyApplicationSetupDoseSpecificationPoint (300a,00a2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyApplicationSetupDoseSpecificationPoint(OFString &value, const signed long pos = 0) const; + + /** get BrachyApplicationSetupDoseSpecificationPoint (300a,00a2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyApplicationSetupDoseSpecificationPoint(Float64 &value, const unsigned long pos = 0) const; + + /** get BrachyApplicationSetupDoseSpecificationPoint (300a,00a2) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBrachyApplicationSetupDoseSpecificationPoint(OFVector &value) const; + + /** get ReferencedBrachyApplicationSetupNumber (300c,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBrachyApplicationSetupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBrachyApplicationSetupNumber (300c,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBrachyApplicationSetupNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set BrachyApplicationSetupDose (300a,00a4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyApplicationSetupDose(const OFString &value, const OFBool check = OFTrue); + + /** set BrachyApplicationSetupDoseSpecificationPoint (300a,00a2) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBrachyApplicationSetupDoseSpecificationPoint(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedBrachyApplicationSetupNumber (300c,000c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedBrachyApplicationSetupNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BrachyApplicationSetupDose (300a,00a4) vr=DS, vm=1, type=3 + DcmDecimalString BrachyApplicationSetupDose; + /// BrachyApplicationSetupDoseSpecificationPoint (300a,00a2) vr=DS, vm=3, type=3 + DcmDecimalString BrachyApplicationSetupDoseSpecificationPoint; + /// ReferencedBrachyApplicationSetupNumber (300c,000c) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedBrachyApplicationSetupNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule(const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule ©); + + /** destructor + */ + virtual ~DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule &operator=(const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbls.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbls.h new file mode 100644 index 00000000..7b0b0f75 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbls.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRecordedBlockSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBLS_H +#define DRTRBLS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RecordedBlockSequence (3008,00d0) + */ +class DCMTK_DCMRT_EXPORT DRTRecordedBlockSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BlockName (300a,00fe) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockName(OFString &value, const signed long pos = 0) const; + + /** get BlockTrayID (300a,00f5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBlockTrayID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBlockNumber (300c,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBlockNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBlockNumber (300c,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBlockNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BlockName (300a,00fe) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockName(const OFString &value, const OFBool check = OFTrue); + + /** set BlockTrayID (300a,00f5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBlockTrayID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedBlockNumber (300c,00e0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedBlockNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BlockName (300a,00fe) vr=LO, vm=1, type=3 + DcmLongString BlockName; + /// BlockTrayID (300a,00f5) vr=SH, vm=1, type=3 + DcmShortString BlockTrayID; + /// ReferencedBlockNumber (300c,00e0) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedBlockNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRecordedBlockSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRecordedBlockSequence(const DRTRecordedBlockSequence ©); + + /** destructor + */ + virtual ~DRTRecordedBlockSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRecordedBlockSequence &operator=(const DRTRecordedBlockSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbos1.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbos1.h new file mode 100644 index 00000000..cd4f68b4 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbos1.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBolusSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBOS1_H +#define DRTRBOS1_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedBolusSequence (300c,00b0) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBolusSequenceInRTBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BolusDescription (300a,00dd) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBolusDescription(OFString &value, const signed long pos = 0) const; + + /** get BolusID (300a,00dc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBolusID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BolusDescription (300a,00dd) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBolusDescription(const OFString &value, const OFBool check = OFTrue); + + /** set BolusID (300a,00dc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBolusID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BolusDescription (300a,00dd) vr=ST, vm=1, type=3 + DcmShortText BolusDescription; + /// BolusID (300a,00dc) vr=SH, vm=1, type=3 + DcmShortString BolusID; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBolusSequenceInRTBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBolusSequenceInRTBeamsModule(const DRTReferencedBolusSequenceInRTBeamsModule ©); + + /** destructor + */ + virtual ~DRTReferencedBolusSequenceInRTBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBolusSequenceInRTBeamsModule &operator=(const DRTReferencedBolusSequenceInRTBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbos6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbos6.h new file mode 100644 index 00000000..6e3ce9e0 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbos6.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBolusSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBOS6_H +#define DRTRBOS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedBolusSequence (300c,00b0) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBolusSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBolusSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBolusSequenceInRTIonBeamsModule(const DRTReferencedBolusSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTReferencedBolusSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBolusSequenceInRTIonBeamsModule &operator=(const DRTReferencedBolusSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbos7.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbos7.h new file mode 100644 index 00000000..87c1cad1 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbos7.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBOS7_H +#define DRTRBOS7_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedBolusSequence (300c,00b0) in RTIonBeamsSessionRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule(const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule ©); + + /** destructor + */ + virtual ~DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule &operator=(const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbs2.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbs2.h new file mode 100644 index 00000000..d87a5ad2 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbs2.h @@ -0,0 +1,328 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBeamSequenceInRTDoseModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBS2_H +#define DRTRBS2_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrcps.h" // for ReferencedControlPointSequence + + +/** Interface class for ReferencedBeamSequence (300c,0004) in RTDoseModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBeamSequenceInRTDoseModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ReferencedControlPointSequence (300c,00f2) + * @return reference to sequence element + */ + DRTReferencedControlPointSequence &getReferencedControlPointSequence() + { return ReferencedControlPointSequence; } + + /** get ReferencedControlPointSequence (300c,00f2) + * @return const reference to sequence element + */ + const DRTReferencedControlPointSequence &getReferencedControlPointSequence() const + { return ReferencedControlPointSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedBeamNumber (300c,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedBeamNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedBeamNumber (300c,0006) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedBeamNumber; + /// ReferencedControlPointSequence (300c,00f2) vr=SQ, vm=1, type=1C + DRTReferencedControlPointSequence ReferencedControlPointSequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBeamSequenceInRTDoseModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBeamSequenceInRTDoseModule(const DRTReferencedBeamSequenceInRTDoseModule ©); + + /** destructor + */ + virtual ~DRTReferencedBeamSequenceInRTDoseModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBeamSequenceInRTDoseModule &operator=(const DRTReferencedBeamSequenceInRTDoseModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbs4.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbs4.h new file mode 100644 index 00000000..13e18022 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbs4.h @@ -0,0 +1,473 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBS4_H +#define DRTRBS4_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedBeamSequence (300c,0004) in RTGeneralTreatmentRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AlternateBeamDose (300a,0091) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAlternateBeamDose(OFString &value, const signed long pos = 0) const; + + /** get AlternateBeamDose (300a,0091) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAlternateBeamDose(Float64 &value, const unsigned long pos = 0) const; + + /** get AlternateBeamDoseType (300a,0092) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAlternateBeamDoseType(OFString &value, const signed long pos = 0) const; + + /** get BeamDeliveryDurationLimit (300a,00c5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDeliveryDurationLimit(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamDose (300a,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDose(OFString &value, const signed long pos = 0) const; + + /** get BeamDose (300a,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDose(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamDoseSpecificationPoint (300a,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseSpecificationPoint(OFString &value, const signed long pos = 0) const; + + /** get BeamDoseSpecificationPoint (300a,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseSpecificationPoint(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamDoseSpecificationPoint (300a,0082) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseSpecificationPoint(OFVector &value) const; + + /** get BeamDoseType (300a,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseType(OFString &value, const signed long pos = 0) const; + + /** get BeamMeterset (300a,0086) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamMeterset(OFString &value, const signed long pos = 0) const; + + /** get BeamMeterset (300a,0086) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceUID (300a,0083) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AlternateBeamDose (300a,0091) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAlternateBeamDose(const OFString &value, const OFBool check = OFTrue); + + /** set AlternateBeamDoseType (300a,0092) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAlternateBeamDoseType(const OFString &value, const OFBool check = OFTrue); + + /** set BeamDeliveryDurationLimit (300a,00c5) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDeliveryDurationLimit(const Float64 value, const unsigned long pos = 0); + + /** set BeamDose (300a,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDose(const OFString &value, const OFBool check = OFTrue); + + /** set BeamDoseSpecificationPoint (300a,0082) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDoseSpecificationPoint(const OFString &value, const OFBool check = OFTrue); + + /** set BeamDoseType (300a,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDoseType(const OFString &value, const OFBool check = OFTrue); + + /** set BeamMeterset (300a,0086) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedBeamNumber (300c,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedBeamNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceUID (300a,0083) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AlternateBeamDose (300a,0091) vr=DS, vm=1, type=3 + DcmDecimalString AlternateBeamDose; + /// AlternateBeamDoseType (300a,0092) vr=CS, vm=1, type=1C + DcmCodeString AlternateBeamDoseType; + /// BeamDeliveryDurationLimit (300a,00c5) vr=FD, vm=1, type=3 + DcmFloatingPointDouble BeamDeliveryDurationLimit; + /// BeamDose (300a,0084) vr=DS, vm=1, type=3 + DcmDecimalString BeamDose; + /// BeamDoseSpecificationPoint (300a,0082) vr=DS, vm=3, type=3 + DcmDecimalString BeamDoseSpecificationPoint; + /// BeamDoseType (300a,0090) vr=CS, vm=1, type=1C + DcmCodeString BeamDoseType; + /// BeamMeterset (300a,0086) vr=DS, vm=1, type=3 + DcmDecimalString BeamMeterset; + /// ReferencedBeamNumber (300c,0006) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedBeamNumber; + /// ReferencedDoseReferenceUID (300a,0083) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ReferencedDoseReferenceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule(const DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule ©); + + /** destructor + */ + virtual ~DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule &operator=(const DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrbs8.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrbs8.h new file mode 100644 index 00000000..ce4a70f9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrbs8.h @@ -0,0 +1,473 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedBeamSequenceInRTFractionSchemeModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRBS8_H +#define DRTRBS8_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedBeamSequence (300c,0004) in RTFractionSchemeModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedBeamSequenceInRTFractionSchemeModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AlternateBeamDose (300a,0091) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAlternateBeamDose(OFString &value, const signed long pos = 0) const; + + /** get AlternateBeamDose (300a,0091) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAlternateBeamDose(Float64 &value, const unsigned long pos = 0) const; + + /** get AlternateBeamDoseType (300a,0092) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAlternateBeamDoseType(OFString &value, const signed long pos = 0) const; + + /** get BeamDeliveryDurationLimit (300a,00c5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDeliveryDurationLimit(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamDose (300a,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDose(OFString &value, const signed long pos = 0) const; + + /** get BeamDose (300a,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDose(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamDoseSpecificationPoint (300a,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseSpecificationPoint(OFString &value, const signed long pos = 0) const; + + /** get BeamDoseSpecificationPoint (300a,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseSpecificationPoint(Float64 &value, const unsigned long pos = 0) const; + + /** get BeamDoseSpecificationPoint (300a,0082) + * @param value reference to variable in which the value(s) should be stored + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseSpecificationPoint(OFVector &value) const; + + /** get BeamDoseType (300a,0090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDoseType(OFString &value, const signed long pos = 0) const; + + /** get BeamMeterset (300a,0086) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamMeterset(OFString &value, const signed long pos = 0) const; + + /** get BeamMeterset (300a,0086) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceUID (300a,0083) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AlternateBeamDose (300a,0091) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAlternateBeamDose(const OFString &value, const OFBool check = OFTrue); + + /** set AlternateBeamDoseType (300a,0092) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAlternateBeamDoseType(const OFString &value, const OFBool check = OFTrue); + + /** set BeamDeliveryDurationLimit (300a,00c5) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDeliveryDurationLimit(const Float64 value, const unsigned long pos = 0); + + /** set BeamDose (300a,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDose(const OFString &value, const OFBool check = OFTrue); + + /** set BeamDoseSpecificationPoint (300a,0082) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDoseSpecificationPoint(const OFString &value, const OFBool check = OFTrue); + + /** set BeamDoseType (300a,0090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDoseType(const OFString &value, const OFBool check = OFTrue); + + /** set BeamMeterset (300a,0086) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedBeamNumber (300c,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedBeamNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceUID (300a,0083) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AlternateBeamDose (300a,0091) vr=DS, vm=1, type=3 + DcmDecimalString AlternateBeamDose; + /// AlternateBeamDoseType (300a,0092) vr=CS, vm=1, type=1C + DcmCodeString AlternateBeamDoseType; + /// BeamDeliveryDurationLimit (300a,00c5) vr=FD, vm=1, type=3 + DcmFloatingPointDouble BeamDeliveryDurationLimit; + /// BeamDose (300a,0084) vr=DS, vm=1, type=3 + DcmDecimalString BeamDose; + /// BeamDoseSpecificationPoint (300a,0082) vr=DS, vm=3, type=3 + DcmDecimalString BeamDoseSpecificationPoint; + /// BeamDoseType (300a,0090) vr=CS, vm=1, type=1C + DcmCodeString BeamDoseType; + /// BeamMeterset (300a,0086) vr=DS, vm=1, type=3 + DcmDecimalString BeamMeterset; + /// ReferencedBeamNumber (300c,0006) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedBeamNumber; + /// ReferencedDoseReferenceUID (300a,0083) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ReferencedDoseReferenceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedBeamSequenceInRTFractionSchemeModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedBeamSequenceInRTFractionSchemeModule(const DRTReferencedBeamSequenceInRTFractionSchemeModule ©); + + /** destructor + */ + virtual ~DRTReferencedBeamSequenceInRTFractionSchemeModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedBeamSequenceInRTFractionSchemeModule &operator=(const DRTReferencedBeamSequenceInRTFractionSchemeModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrcdrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrcdrs.h new file mode 100644 index 00000000..195e2c4b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrcdrs.h @@ -0,0 +1,357 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedCalculatedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRCDRS_H +#define DRTRCDRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedCalculatedDoseReferenceSequence (3008,0090) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedCalculatedDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CalculatedDoseReferenceDoseValue (3008,0076) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedDoseReferenceDoseValue(OFString &value, const signed long pos = 0) const; + + /** get CalculatedDoseReferenceDoseValue (3008,0076) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCalculatedDoseReferenceDoseValue(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedCalculatedDoseReferenceNumber (3008,0092) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedCalculatedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedCalculatedDoseReferenceNumber (3008,0092) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedCalculatedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CalculatedDoseReferenceDoseValue (3008,0076) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCalculatedDoseReferenceDoseValue(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedCalculatedDoseReferenceNumber (3008,0092) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedCalculatedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CalculatedDoseReferenceDoseValue (3008,0076) vr=DS, vm=1, type=1 + DcmDecimalString CalculatedDoseReferenceDoseValue; + /// ReferencedCalculatedDoseReferenceNumber (3008,0092) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedCalculatedDoseReferenceNumber; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedCalculatedDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedCalculatedDoseReferenceSequence(const DRTReferencedCalculatedDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTReferencedCalculatedDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedCalculatedDoseReferenceSequence &operator=(const DRTReferencedCalculatedDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrcos.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrcos.h new file mode 100644 index 00000000..be0b04cd --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrcos.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRecordedCompensatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRCOS_H +#define DRTRCOS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RecordedCompensatorSequence (3008,00c0) + */ +class DCMTK_DCMRT_EXPORT DRTRecordedCompensatorSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get CompensatorID (300a,00e5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompensatorID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedCompensatorNumber (300c,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedCompensatorNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedCompensatorNumber (300c,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedCompensatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set CompensatorID (300a,00e5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompensatorID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedCompensatorNumber (300c,00d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedCompensatorNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// CompensatorID (300a,00e5) vr=SH, vm=1, type=3 + DcmShortString CompensatorID; + /// ReferencedCompensatorNumber (300c,00d0) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedCompensatorNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRecordedCompensatorSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRecordedCompensatorSequence(const DRTRecordedCompensatorSequence ©); + + /** destructor + */ + virtual ~DRTRecordedCompensatorSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRecordedCompensatorSequence &operator=(const DRTRecordedCompensatorSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrcps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrcps.h new file mode 100644 index 00000000..c24a6886 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrcps.h @@ -0,0 +1,334 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRCPS_H +#define DRTRCPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedControlPointSequence (300c,00f2) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedControlPointSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedStartControlPointIndex (300c,00f4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedStartControlPointIndex(OFString &value, const signed long pos = 0) const; + + /** get ReferencedStartControlPointIndex (300c,00f4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedStartControlPointIndex(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedStopControlPointIndex (300c,00f6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedStopControlPointIndex(OFString &value, const signed long pos = 0) const; + + /** get ReferencedStopControlPointIndex (300c,00f6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedStopControlPointIndex(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedStartControlPointIndex (300c,00f4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedStartControlPointIndex(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedStopControlPointIndex (300c,00f6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedStopControlPointIndex(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedStartControlPointIndex (300c,00f4) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedStartControlPointIndex; + /// ReferencedStopControlPointIndex (300c,00f6) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedStopControlPointIndex; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedControlPointSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedControlPointSequence(const DRTReferencedControlPointSequence ©); + + /** destructor + */ + virtual ~DRTReferencedControlPointSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedControlPointSequence &operator=(const DRTReferencedControlPointSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrcs.h new file mode 100644 index 00000000..26268348 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrcs.h @@ -0,0 +1,383 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTROIContourSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRCS_H +#define DRTRCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtcs.h" // for ContourSequence + + +/** Interface class for ROIContourSequence (3006,0039) + */ +class DCMTK_DCMRT_EXPORT DRTROIContourSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ROIDisplayColor (3006,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIDisplayColor(OFString &value, const signed long pos = 0) const; + + /** get ROIDisplayColor (3006,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIDisplayColor(Sint32 &value, const unsigned long pos = 0) const; + + /** get RecommendedDisplayCIELabValue (0062,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRecommendedDisplayCIELabValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get RecommendedDisplayGrayscaleValue (0062,000c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRecommendedDisplayGrayscaleValue(Uint16 &value, const unsigned long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ContourSequence (3006,0040) + * @return reference to sequence element + */ + DRTContourSequence &getContourSequence() + { return ContourSequence; } + + /** get ContourSequence (3006,0040) + * @return const reference to sequence element + */ + const DRTContourSequence &getContourSequence() const + { return ContourSequence; } + + // --- set DICOM attribute values --- + + /** set ROIDisplayColor (3006,002a) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (3) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIDisplayColor(const OFString &value, const OFBool check = OFTrue); + + /** set RecommendedDisplayCIELabValue (0062,000d) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRecommendedDisplayCIELabValue(const Uint16 value, const unsigned long pos = 0); + + /** set RecommendedDisplayGrayscaleValue (0062,000c) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRecommendedDisplayGrayscaleValue(const Uint16 value, const unsigned long pos = 0); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ContourSequence (3006,0040) vr=SQ, vm=1, type=3 + DRTContourSequence ContourSequence; + /// ROIDisplayColor (3006,002a) vr=IS, vm=3, type=3 + DcmIntegerString ROIDisplayColor; + /// RecommendedDisplayCIELabValue (0062,000d) vr=US, vm=3, type=3 + DcmUnsignedShort RecommendedDisplayCIELabValue; + /// RecommendedDisplayGrayscaleValue (0062,000c) vr=US, vm=1, type=3 + DcmUnsignedShort RecommendedDisplayGrayscaleValue; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTROIContourSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTROIContourSequence(const DRTROIContourSequence ©); + + /** destructor + */ + virtual ~DRTROIContourSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTROIContourSequence &operator=(const DRTROIContourSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrdros.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrdros.h new file mode 100644 index 00000000..7abb2a71 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrdros.h @@ -0,0 +1,350 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRTDoseROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRDROS_H +#define DRTRDROS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RTDoseROISequence (3004,0010) + */ +class DCMTK_DCMRT_EXPORT DRTRTDoseROISequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DoseUnits (3004,0002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseUnits(OFString &value, const signed long pos = 0) const; + + /** get DoseValue (3004,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseValue(OFString &value, const signed long pos = 0) const; + + /** get DoseValue (3004,0012) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseValue(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DoseUnits (3004,0002) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseUnits(const OFString &value, const OFBool check = OFTrue); + + /** set DoseValue (3004,0012) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseValue(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DoseUnits (3004,0002) vr=CS, vm=1, type=1 + DcmCodeString DoseUnits; + /// DoseValue (3004,0012) vr=DS, vm=1, type=1 + DcmDecimalString DoseValue; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRTDoseROISequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRTDoseROISequence(const DRTRTDoseROISequence ©); + + /** destructor + */ + virtual ~DRTRTDoseROISequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRTDoseROISequence &operator=(const DRTRTDoseROISequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs1.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs1.h new file mode 100644 index 00000000..0fe6ef6b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs1.h @@ -0,0 +1,344 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedDoseReferenceSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRDRS1_H +#define DRTRDRS1_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbvcps.h" // for BeamDoseVerificationControlPointSequence + + +/** Interface class for ReferencedDoseReferenceSequence (300c,0050) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedDoseReferenceSequenceInRTBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DepthValueAveragingFlag (300a,0093) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDepthValueAveragingFlag(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BeamDoseVerificationControlPointSequence (300a,008c) + * @return reference to sequence element + */ + DRTBeamDoseVerificationControlPointSequence &getBeamDoseVerificationControlPointSequence() + { return BeamDoseVerificationControlPointSequence; } + + /** get BeamDoseVerificationControlPointSequence (300a,008c) + * @return const reference to sequence element + */ + const DRTBeamDoseVerificationControlPointSequence &getBeamDoseVerificationControlPointSequence() const + { return BeamDoseVerificationControlPointSequence; } + + // --- set DICOM attribute values --- + + /** set DepthValueAveragingFlag (300a,0093) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDepthValueAveragingFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamDoseVerificationControlPointSequence (300a,008c) vr=SQ, vm=1, type=1 + DRTBeamDoseVerificationControlPointSequence BeamDoseVerificationControlPointSequence; + /// DepthValueAveragingFlag (300a,0093) vr=CS, vm=1, type=1C + DcmCodeString DepthValueAveragingFlag; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedDoseReferenceSequenceInRTBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedDoseReferenceSequenceInRTBeamsModule(const DRTReferencedDoseReferenceSequenceInRTBeamsModule ©); + + /** destructor + */ + virtual ~DRTReferencedDoseReferenceSequenceInRTBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedDoseReferenceSequenceInRTBeamsModule &operator=(const DRTReferencedDoseReferenceSequenceInRTBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs6.h new file mode 100644 index 00000000..2a14c31f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs6.h @@ -0,0 +1,334 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedDoseReferenceSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRDRS6_H +#define DRTRDRS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedDoseReferenceSequence (300c,0050) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedDoseReferenceSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CumulativeDoseReferenceCoefficient (300a,010c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseReferenceCoefficient(OFString &value, const signed long pos = 0) const; + + /** get CumulativeDoseReferenceCoefficient (300a,010c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseReferenceCoefficient(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CumulativeDoseReferenceCoefficient (300a,010c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeDoseReferenceCoefficient(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CumulativeDoseReferenceCoefficient (300a,010c) vr=DS, vm=1, type=2 + DcmDecimalString CumulativeDoseReferenceCoefficient; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedDoseReferenceSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedDoseReferenceSequenceInRTIonBeamsModule(const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTReferencedDoseReferenceSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedDoseReferenceSequenceInRTIonBeamsModule &operator=(const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs8.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs8.h new file mode 100644 index 00000000..3969ea0a --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrdrs8.h @@ -0,0 +1,564 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRDRS8_H +#define DRTRDRS8_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedDoseReferenceSequence (300c,0050) in RTFractionSchemeModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ConstraintWeight (300a,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getConstraintWeight(OFString &value, const signed long pos = 0) const; + + /** get ConstraintWeight (300a,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getConstraintWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get DeliveryMaximumDose (300a,0023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryMaximumDose(OFString &value, const signed long pos = 0) const; + + /** get DeliveryMaximumDose (300a,0023) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryMaximumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get DeliveryWarningDose (300a,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryWarningDose(OFString &value, const signed long pos = 0) const; + + /** get DeliveryWarningDose (300a,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveryWarningDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskFullVolumeDose (300a,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskFullVolumeDose(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskFullVolumeDose (300a,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskFullVolumeDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskLimitDose (300a,002b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskLimitDose(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskLimitDose (300a,002b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskLimitDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskMaximumDose (300a,002c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskMaximumDose(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskMaximumDose (300a,002c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskMaximumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get OrganAtRiskOverdoseVolumeFraction (300a,002d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskOverdoseVolumeFraction(OFString &value, const signed long pos = 0) const; + + /** get OrganAtRiskOverdoseVolumeFraction (300a,002d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getOrganAtRiskOverdoseVolumeFraction(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get TargetMaximumDose (300a,0027) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMaximumDose(OFString &value, const signed long pos = 0) const; + + /** get TargetMaximumDose (300a,0027) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMaximumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get TargetMinimumDose (300a,0025) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMinimumDose(OFString &value, const signed long pos = 0) const; + + /** get TargetMinimumDose (300a,0025) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetMinimumDose(Float64 &value, const unsigned long pos = 0) const; + + /** get TargetPrescriptionDose (300a,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetPrescriptionDose(OFString &value, const signed long pos = 0) const; + + /** get TargetPrescriptionDose (300a,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetPrescriptionDose(Float64 &value, const unsigned long pos = 0) const; + + /** get TargetUnderdoseVolumeFraction (300a,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetUnderdoseVolumeFraction(OFString &value, const signed long pos = 0) const; + + /** get TargetUnderdoseVolumeFraction (300a,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTargetUnderdoseVolumeFraction(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ConstraintWeight (300a,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setConstraintWeight(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveryMaximumDose (300a,0023) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveryMaximumDose(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveryWarningDose (300a,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveryWarningDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskFullVolumeDose (300a,002a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskFullVolumeDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskLimitDose (300a,002b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskLimitDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskMaximumDose (300a,002c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskMaximumDose(const OFString &value, const OFBool check = OFTrue); + + /** set OrganAtRiskOverdoseVolumeFraction (300a,002d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setOrganAtRiskOverdoseVolumeFraction(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set TargetMaximumDose (300a,0027) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetMaximumDose(const OFString &value, const OFBool check = OFTrue); + + /** set TargetMinimumDose (300a,0025) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetMinimumDose(const OFString &value, const OFBool check = OFTrue); + + /** set TargetPrescriptionDose (300a,0026) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetPrescriptionDose(const OFString &value, const OFBool check = OFTrue); + + /** set TargetUnderdoseVolumeFraction (300a,0028) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTargetUnderdoseVolumeFraction(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ConstraintWeight (300a,0021) vr=DS, vm=1, type=3 + DcmDecimalString ConstraintWeight; + /// DeliveryMaximumDose (300a,0023) vr=DS, vm=1, type=3 + DcmDecimalString DeliveryMaximumDose; + /// DeliveryWarningDose (300a,0022) vr=DS, vm=1, type=3 + DcmDecimalString DeliveryWarningDose; + /// OrganAtRiskFullVolumeDose (300a,002a) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskFullVolumeDose; + /// OrganAtRiskLimitDose (300a,002b) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskLimitDose; + /// OrganAtRiskMaximumDose (300a,002c) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskMaximumDose; + /// OrganAtRiskOverdoseVolumeFraction (300a,002d) vr=DS, vm=1, type=3 + DcmDecimalString OrganAtRiskOverdoseVolumeFraction; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedDoseReferenceNumber; + /// TargetMaximumDose (300a,0027) vr=DS, vm=1, type=3 + DcmDecimalString TargetMaximumDose; + /// TargetMinimumDose (300a,0025) vr=DS, vm=1, type=3 + DcmDecimalString TargetMinimumDose; + /// TargetPrescriptionDose (300a,0026) vr=DS, vm=1, type=3 + DcmDecimalString TargetPrescriptionDose; + /// TargetUnderdoseVolumeFraction (300a,0028) vr=DS, vm=1, type=3 + DcmDecimalString TargetUnderdoseVolumeFraction; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule(const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule ©); + + /** destructor + */ + virtual ~DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule &operator=(const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrds.h new file mode 100644 index 00000000..02914750 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrds.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedDoseSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRDS_H +#define DRTRDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedDoseSequence (300c,0080) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedDoseSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedDoseSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedDoseSequence(const DRTReferencedDoseSequence ©); + + /** destructor + */ + virtual ~DRTReferencedDoseSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedDoseSequence &operator=(const DRTReferencedDoseSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrecs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrecs.h new file mode 100644 index 00000000..9620921d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrecs.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTROIElementalCompositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRECS_H +#define DRTRECS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ROIElementalCompositionSequence (3006,00b6) + */ +class DCMTK_DCMRT_EXPORT DRTROIElementalCompositionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ROIElementalCompositionAtomicMassFraction (3006,00b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIElementalCompositionAtomicMassFraction(Float32 &value, const unsigned long pos = 0) const; + + /** get ROIElementalCompositionAtomicNumber (3006,00b7) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIElementalCompositionAtomicNumber(Uint16 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ROIElementalCompositionAtomicMassFraction (3006,00b8) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIElementalCompositionAtomicMassFraction(const Float32 value, const unsigned long pos = 0); + + /** set ROIElementalCompositionAtomicNumber (3006,00b7) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIElementalCompositionAtomicNumber(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ROIElementalCompositionAtomicMassFraction (3006,00b8) vr=FL, vm=1, type=1 + DcmFloatingPointSingle ROIElementalCompositionAtomicMassFraction; + /// ROIElementalCompositionAtomicNumber (3006,00b7) vr=US, vm=1, type=1 + DcmUnsignedShort ROIElementalCompositionAtomicNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTROIElementalCompositionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTROIElementalCompositionSequence(const DRTROIElementalCompositionSequence ©); + + /** destructor + */ + virtual ~DRTROIElementalCompositionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTROIElementalCompositionSequence &operator=(const DRTROIElementalCompositionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrfgs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrfgs.h new file mode 100644 index 00000000..137b97e9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrfgs.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedFractionGroupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRFGS_H +#define DRTRFGS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrbs2.h" // for ReferencedBeamSequence +#include "dcmtk/dcmrt/seq/drtrbas2.h" // for ReferencedBrachyApplicationSetupSequence + + +/** Interface class for ReferencedFractionGroupSequence (300c,0020) in RTDoseModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedFractionGroupSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFractionGroupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFractionGroupNumber (300c,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ReferencedBeamSequence (300c,0004) + * @return reference to sequence element + */ + DRTReferencedBeamSequenceInRTDoseModule &getReferencedBeamSequence() + { return ReferencedBeamSequence; } + + /** get ReferencedBeamSequence (300c,0004) + * @return const reference to sequence element + */ + const DRTReferencedBeamSequenceInRTDoseModule &getReferencedBeamSequence() const + { return ReferencedBeamSequence; } + + /** get ReferencedBrachyApplicationSetupSequence (300c,000a) + * @return reference to sequence element + */ + DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule &getReferencedBrachyApplicationSetupSequence() + { return ReferencedBrachyApplicationSetupSequence; } + + /** get ReferencedBrachyApplicationSetupSequence (300c,000a) + * @return const reference to sequence element + */ + const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule &getReferencedBrachyApplicationSetupSequence() const + { return ReferencedBrachyApplicationSetupSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedFractionGroupNumber (300c,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFractionGroupNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedBeamSequence (300c,0004) vr=SQ, vm=1, type=1C + DRTReferencedBeamSequenceInRTDoseModule ReferencedBeamSequence; + /// ReferencedBrachyApplicationSetupSequence (300c,000a) vr=SQ, vm=1, type=1C + DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule ReferencedBrachyApplicationSetupSequence; + /// ReferencedFractionGroupNumber (300c,0022) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedFractionGroupNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedFractionGroupSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedFractionGroupSequence(const DRTReferencedFractionGroupSequence ©); + + /** destructor + */ + virtual ~DRTReferencedFractionGroupSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedFractionGroupSequence &operator=(const DRTReferencedFractionGroupSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrfors.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrfors.h new file mode 100644 index 00000000..dada3622 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrfors.h @@ -0,0 +1,321 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedFrameOfReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRFORS_H +#define DRTRFORS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrsts.h" // for RTReferencedStudySequence + + +/** Interface class for ReferencedFrameOfReferenceSequence (3006,0010) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedFrameOfReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get FrameOfReferenceUID (0020,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFrameOfReferenceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get RTReferencedStudySequence (3006,0012) + * @return reference to sequence element + */ + DRTRTReferencedStudySequence &getRTReferencedStudySequence() + { return RTReferencedStudySequence; } + + /** get RTReferencedStudySequence (3006,0012) + * @return const reference to sequence element + */ + const DRTRTReferencedStudySequence &getRTReferencedStudySequence() const + { return RTReferencedStudySequence; } + + // --- set DICOM attribute values --- + + /** set FrameOfReferenceUID (0020,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFrameOfReferenceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// FrameOfReferenceUID (0020,0052) vr=UI, vm=1, type=1 + DcmUniqueIdentifier FrameOfReferenceUID; + /// RTReferencedStudySequence (3006,0012) vr=SQ, vm=1, type=3 + DRTRTReferencedStudySequence RTReferencedStudySequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedFrameOfReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedFrameOfReferenceSequence(const DRTReferencedFrameOfReferenceSequence ©); + + /** destructor + */ + virtual ~DRTReferencedFrameOfReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedFrameOfReferenceSequence &operator=(const DRTReferencedFrameOfReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrics.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrics.h new file mode 100644 index 00000000..74458f92 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrics.h @@ -0,0 +1,560 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRTROIIdentificationCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRICS_H +#define DRTRICS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence +#include "dcmtk/dcmrt/seq/drtsptcs.h" // for SegmentedPropertyTypeModifierCodeSequence + + +/** Interface class for RTROIIdentificationCodeSequence (3006,0086) + */ +class DCMTK_DCMRT_EXPORT DRTRTROIIdentificationCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + /** get SegmentedPropertyTypeModifierCodeSequence (0062,0011) + * @return reference to sequence element + */ + DRTSegmentedPropertyTypeModifierCodeSequence &getSegmentedPropertyTypeModifierCodeSequence() + { return SegmentedPropertyTypeModifierCodeSequence; } + + /** get SegmentedPropertyTypeModifierCodeSequence (0062,0011) + * @return const reference to sequence element + */ + const DRTSegmentedPropertyTypeModifierCodeSequence &getSegmentedPropertyTypeModifierCodeSequence() const + { return SegmentedPropertyTypeModifierCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// SegmentedPropertyTypeModifierCodeSequence (0062,0011) vr=SQ, vm=1, type=3 + DRTSegmentedPropertyTypeModifierCodeSequence SegmentedPropertyTypeModifierCodeSequence; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRTROIIdentificationCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRTROIIdentificationCodeSequence(const DRTRTROIIdentificationCodeSequence ©); + + /** destructor + */ + virtual ~DRTRTROIIdentificationCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRTROIIdentificationCodeSequence &operator=(const DRTRTROIIdentificationCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrims.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrims.h new file mode 100644 index 00000000..7adb2cba --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrims.h @@ -0,0 +1,376 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRIMS_H +#define DRTRIMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtporcs.h" // for PurposeOfReferenceCodeSequence + + +/** Interface class for ReferencedImageSequence (0008,1140) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedImageSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSegmentNumber (0062,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSegmentNumber(Uint16 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return reference to sequence element + */ + DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() + { return PurposeOfReferenceCodeSequence; } + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return const reference to sequence element + */ + const DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() const + { return PurposeOfReferenceCodeSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedFrameNumber (0008,1160) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSegmentNumber (0062,000b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegmentNumber(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// PurposeOfReferenceCodeSequence (0040,a170) vr=SQ, vm=1, type=3 + DRTPurposeOfReferenceCodeSequence PurposeOfReferenceCodeSequence; + /// ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C + DcmIntegerString ReferencedFrameNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C + DcmUnsignedShort ReferencedSegmentNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedImageSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedImageSequence(const DRTReferencedImageSequence ©); + + /** destructor + */ + virtual ~DRTReferencedImageSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedImageSequence &operator=(const DRTReferencedImageSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtris.h b/dcmrt/include/dcmtk/dcmrt/seq/drtris.h new file mode 100644 index 00000000..294ea21a --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtris.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedInstanceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRIS_H +#define DRTRIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtporcs.h" // for PurposeOfReferenceCodeSequence + + +/** Interface class for ReferencedInstanceSequence (0008,114a) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedInstanceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return reference to sequence element + */ + DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() + { return PurposeOfReferenceCodeSequence; } + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return const reference to sequence element + */ + const DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() const + { return PurposeOfReferenceCodeSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// PurposeOfReferenceCodeSequence (0040,a170) vr=SQ, vm=1, type=1 + DRTPurposeOfReferenceCodeSequence PurposeOfReferenceCodeSequence; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedInstanceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedInstanceSequence(const DRTReferencedInstanceSequence ©); + + /** destructor + */ + virtual ~DRTReferencedInstanceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedInstanceSequence &operator=(const DRTReferencedInstanceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrlsds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrlsds.h new file mode 100644 index 00000000..8bfc69af --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrlsds.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRecordedLateralSpreadingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRLSDS_H +#define DRTRLSDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RecordedLateralSpreadingDeviceSequence (3008,00f4) + */ +class DCMTK_DCMRT_EXPORT DRTRecordedLateralSpreadingDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get LateralSpreadingDeviceID (300a,0336) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLateralSpreadingDeviceID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedLateralSpreadingDeviceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set LateralSpreadingDeviceID (300a,0336) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLateralSpreadingDeviceID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedLateralSpreadingDeviceNumber (300c,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedLateralSpreadingDeviceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// LateralSpreadingDeviceID (300a,0336) vr=SH, vm=1, type=1 + DcmShortString LateralSpreadingDeviceID; + /// ReferencedLateralSpreadingDeviceNumber (300c,0102) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedLateralSpreadingDeviceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRecordedLateralSpreadingDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRecordedLateralSpreadingDeviceSequence(const DRTRecordedLateralSpreadingDeviceSequence ©); + + /** destructor + */ + virtual ~DRTRecordedLateralSpreadingDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRecordedLateralSpreadingDeviceSequence &operator=(const DRTRecordedLateralSpreadingDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrmdrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrmdrs.h new file mode 100644 index 00000000..526dfaae --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrmdrs.h @@ -0,0 +1,357 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedMeasuredDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRMDRS_H +#define DRTRMDRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedMeasuredDoseReferenceSequence (3008,0080) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedMeasuredDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get MeasuredDoseValue (3008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseValue(OFString &value, const signed long pos = 0) const; + + /** get MeasuredDoseValue (3008,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMeasuredDoseValue(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedMeasuredDoseReferenceNumber (3008,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedMeasuredDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedMeasuredDoseReferenceNumber (3008,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedMeasuredDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set MeasuredDoseValue (3008,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasuredDoseValue(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedMeasuredDoseReferenceNumber (3008,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedMeasuredDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// MeasuredDoseValue (3008,0016) vr=DS, vm=1, type=1 + DcmDecimalString MeasuredDoseValue; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedDoseReferenceNumber; + /// ReferencedMeasuredDoseReferenceNumber (3008,0082) vr=IS, vm=1, type=1C + DcmIntegerString ReferencedMeasuredDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedMeasuredDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedMeasuredDoseReferenceSequence(const DRTReferencedMeasuredDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTReferencedMeasuredDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedMeasuredDoseReferenceSequence &operator=(const DRTReferencedMeasuredDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrms.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrms.h new file mode 100644 index 00000000..c7de22db --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrms.h @@ -0,0 +1,391 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRangeModulatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRMS_H +#define DRTRMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RangeModulatorSequence (300a,0342) + */ +class DCMTK_DCMRT_EXPORT DRTRangeModulatorSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BeamCurrentModulationID (300a,034c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamCurrentModulationID(OFString &value, const signed long pos = 0) const; + + /** get RangeModulatorDescription (300a,034a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorDescription(OFString &value, const signed long pos = 0) const; + + /** get RangeModulatorID (300a,0346) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorID(OFString &value, const signed long pos = 0) const; + + /** get RangeModulatorNumber (300a,0344) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorNumber(OFString &value, const signed long pos = 0) const; + + /** get RangeModulatorNumber (300a,0344) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get RangeModulatorType (300a,0348) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BeamCurrentModulationID (300a,034c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamCurrentModulationID(const OFString &value, const OFBool check = OFTrue); + + /** set RangeModulatorDescription (300a,034a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorDescription(const OFString &value, const OFBool check = OFTrue); + + /** set RangeModulatorID (300a,0346) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorID(const OFString &value, const OFBool check = OFTrue); + + /** set RangeModulatorNumber (300a,0344) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorNumber(const OFString &value, const OFBool check = OFTrue); + + /** set RangeModulatorType (300a,0348) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BeamCurrentModulationID (300a,034c) vr=SH, vm=1, type=1C + DcmShortString BeamCurrentModulationID; + /// RangeModulatorDescription (300a,034a) vr=LO, vm=1, type=3 + DcmLongString RangeModulatorDescription; + /// RangeModulatorID (300a,0346) vr=SH, vm=1, type=1 + DcmShortString RangeModulatorID; + /// RangeModulatorNumber (300a,0344) vr=IS, vm=1, type=1 + DcmIntegerString RangeModulatorNumber; + /// RangeModulatorType (300a,0348) vr=CS, vm=1, type=1 + DcmCodeString RangeModulatorType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRangeModulatorSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRangeModulatorSequence(const DRTRangeModulatorSequence ©); + + /** destructor + */ + virtual ~DRTRangeModulatorSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRangeModulatorSequence &operator=(const DRTRangeModulatorSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrmss6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrmss6.h new file mode 100644 index 00000000..d04f8de7 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrmss6.h @@ -0,0 +1,391 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRangeModulatorSettingsSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRMSS6_H +#define DRTRMSS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RangeModulatorSettingsSequence (300a,0380) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTRangeModulatorSettingsSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IsocenterToRangeModulatorDistance (300a,038a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToRangeModulatorDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get RangeModulatorGatingStartValue (300a,0382) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorGatingStartValue(Float32 &value, const unsigned long pos = 0) const; + + /** get RangeModulatorGatingStartWaterEquivalentThickness (300a,0386) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorGatingStartWaterEquivalentThickness(Float32 &value, const unsigned long pos = 0) const; + + /** get RangeModulatorGatingStopValue (300a,0384) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorGatingStopValue(Float32 &value, const unsigned long pos = 0) const; + + /** get RangeModulatorGatingStopWaterEquivalentThickness (300a,0388) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorGatingStopWaterEquivalentThickness(Float32 &value, const unsigned long pos = 0) const; + + /** get ReferencedRangeModulatorNumber (300c,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeModulatorNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeModulatorNumber (300c,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeModulatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set IsocenterToRangeModulatorDistance (300a,038a) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToRangeModulatorDistance(const Float32 value, const unsigned long pos = 0); + + /** set RangeModulatorGatingStartValue (300a,0382) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorGatingStartValue(const Float32 value, const unsigned long pos = 0); + + /** set RangeModulatorGatingStartWaterEquivalentThickness (300a,0386) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorGatingStartWaterEquivalentThickness(const Float32 value, const unsigned long pos = 0); + + /** set RangeModulatorGatingStopValue (300a,0384) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorGatingStopValue(const Float32 value, const unsigned long pos = 0); + + /** set RangeModulatorGatingStopWaterEquivalentThickness (300a,0388) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorGatingStopWaterEquivalentThickness(const Float32 value, const unsigned long pos = 0); + + /** set ReferencedRangeModulatorNumber (300c,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedRangeModulatorNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// IsocenterToRangeModulatorDistance (300a,038a) vr=FL, vm=1, type=3 + DcmFloatingPointSingle IsocenterToRangeModulatorDistance; + /// RangeModulatorGatingStartValue (300a,0382) vr=FL, vm=1, type=1C + DcmFloatingPointSingle RangeModulatorGatingStartValue; + /// RangeModulatorGatingStartWaterEquivalentThickness (300a,0386) vr=FL, vm=1, type=3 + DcmFloatingPointSingle RangeModulatorGatingStartWaterEquivalentThickness; + /// RangeModulatorGatingStopValue (300a,0384) vr=FL, vm=1, type=1C + DcmFloatingPointSingle RangeModulatorGatingStopValue; + /// RangeModulatorGatingStopWaterEquivalentThickness (300a,0388) vr=FL, vm=1, type=3 + DcmFloatingPointSingle RangeModulatorGatingStopWaterEquivalentThickness; + /// ReferencedRangeModulatorNumber (300c,0104) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedRangeModulatorNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsModule(const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTRangeModulatorSettingsSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsModule &operator=(const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrmss7.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrmss7.h new file mode 100644 index 00000000..537cb165 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrmss7.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRMSS7_H +#define DRTRMSS7_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RangeModulatorSettingsSequence (300a,0380) in RTIonBeamsSessionRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RangeModulatorGatingStartValue (300a,0382) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorGatingStartValue(Float32 &value, const unsigned long pos = 0) const; + + /** get RangeModulatorGatingStopValue (300a,0384) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorGatingStopValue(Float32 &value, const unsigned long pos = 0) const; + + /** get ReferencedRangeModulatorNumber (300c,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeModulatorNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeModulatorNumber (300c,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeModulatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RangeModulatorGatingStartValue (300a,0382) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorGatingStartValue(const Float32 value, const unsigned long pos = 0); + + /** set RangeModulatorGatingStopValue (300a,0384) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorGatingStopValue(const Float32 value, const unsigned long pos = 0); + + /** set ReferencedRangeModulatorNumber (300c,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedRangeModulatorNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RangeModulatorGatingStartValue (300a,0382) vr=FL, vm=1, type=1C + DcmFloatingPointSingle RangeModulatorGatingStartValue; + /// RangeModulatorGatingStopValue (300a,0384) vr=FL, vm=1, type=1C + DcmFloatingPointSingle RangeModulatorGatingStopValue; + /// ReferencedRangeModulatorNumber (300c,0104) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedRangeModulatorNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule(const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule ©); + + /** destructor + */ + virtual ~DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule &operator=(const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrpcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrpcs.h new file mode 100644 index 00000000..52480db9 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrpcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRequestedProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRPCS_H +#define DRTRPCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for RequestedProcedureCodeSequence (0032,1064) + */ +class DCMTK_DCMRT_EXPORT DRTRequestedProcedureCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRequestedProcedureCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRequestedProcedureCodeSequence(const DRTRequestedProcedureCodeSequence ©); + + /** destructor + */ + virtual ~DRTRequestedProcedureCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRequestedProcedureCodeSequence &operator=(const DRTRequestedProcedureCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrpis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrpis.h new file mode 100644 index 00000000..513a8aac --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrpis.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferringPhysicianIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRPIS_H +#define DRTRPIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtics.h" // for InstitutionCodeSequence +#include "dcmtk/dcmrt/seq/drtpics.h" // for PersonIdentificationCodeSequence + + +/** Interface class for ReferringPhysicianIdentificationSequence (0008,0096) + */ +class DCMTK_DCMRT_EXPORT DRTReferringPhysicianIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get PersonAddress (0040,1102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonAddress(OFString &value, const signed long pos = 0) const; + + /** get PersonTelecomInformation (0040,1104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelecomInformation(OFString &value, const signed long pos = 0) const; + + /** get PersonTelephoneNumbers (0040,1103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPersonTelephoneNumbers(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get InstitutionCodeSequence (0008,0082) + * @return reference to sequence element + */ + DRTInstitutionCodeSequence &getInstitutionCodeSequence() + { return InstitutionCodeSequence; } + + /** get InstitutionCodeSequence (0008,0082) + * @return const reference to sequence element + */ + const DRTInstitutionCodeSequence &getInstitutionCodeSequence() const + { return InstitutionCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return reference to sequence element + */ + DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() + { return PersonIdentificationCodeSequence; } + + /** get PersonIdentificationCodeSequence (0040,1101) + * @return const reference to sequence element + */ + const DRTPersonIdentificationCodeSequence &getPersonIdentificationCodeSequence() const + { return PersonIdentificationCodeSequence; } + + // --- set DICOM attribute values --- + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set PersonAddress (0040,1102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonAddress(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelecomInformation (0040,1104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelecomInformation(const OFString &value, const OFBool check = OFTrue); + + /** set PersonTelephoneNumbers (0040,1103) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPersonTelephoneNumbers(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionCodeSequence (0008,0082) vr=SQ, vm=1, type=1C + DRTInstitutionCodeSequence InstitutionCodeSequence; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=1C + DcmLongString InstitutionName; + /// PersonAddress (0040,1102) vr=ST, vm=1, type=3 + DcmShortText PersonAddress; + /// PersonIdentificationCodeSequence (0040,1101) vr=SQ, vm=1, type=1 + DRTPersonIdentificationCodeSequence PersonIdentificationCodeSequence; + /// PersonTelecomInformation (0040,1104) vr=LT, vm=1, type=3 + DcmLongText PersonTelecomInformation; + /// PersonTelephoneNumbers (0040,1103) vr=LO, vm=1-n, type=3 + DcmLongString PersonTelephoneNumbers; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferringPhysicianIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferringPhysicianIdentificationSequence(const DRTReferringPhysicianIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTReferringPhysicianIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferringPhysicianIdentificationSequence &operator=(const DRTReferringPhysicianIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrppcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrppcs.h new file mode 100644 index 00000000..854836b0 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrppcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReasonForPerformedProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRPPCS_H +#define DRTRPPCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ReasonForPerformedProcedureCodeSequence (0040,1012) + */ +class DCMTK_DCMRT_EXPORT DRTReasonForPerformedProcedureCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReasonForPerformedProcedureCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReasonForPerformedProcedureCodeSequence(const DRTReasonForPerformedProcedureCodeSequence ©); + + /** destructor + */ + virtual ~DRTReasonForPerformedProcedureCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReasonForPerformedProcedureCodeSequence &operator=(const DRTReasonForPerformedProcedureCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrpphs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrpphs.h new file mode 100644 index 00000000..86c81324 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrpphs.h @@ -0,0 +1,428 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedPatientPhotoSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRPPHS_H +#define DRTRPPHS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtdimrs.h" // for DICOMMediaRetrievalSequence +#include "dcmtk/dcmrt/seq/drtdirs.h" // for DICOMRetrievalSequence +#include "dcmtk/dcmrt/seq/drtrsos.h" // for ReferencedSOPSequence +#include "dcmtk/dcmrt/seq/drtwrsrs.h" // for WADORSRetrievalSequence +#include "dcmtk/dcmrt/seq/drtwrs.h" // for WADORetrievalSequence +#include "dcmtk/dcmrt/seq/drtxrs.h" // for XDSRetrievalSequence + + +/** Interface class for ReferencedPatientPhotoSequence (0010,1100) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedPatientPhotoSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get TypeOfInstances (0040,e020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTypeOfInstances(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get DICOMMediaRetrievalSequence (0040,e022) + * @return reference to sequence element + */ + DRTDICOMMediaRetrievalSequence &getDICOMMediaRetrievalSequence() + { return DICOMMediaRetrievalSequence; } + + /** get DICOMMediaRetrievalSequence (0040,e022) + * @return const reference to sequence element + */ + const DRTDICOMMediaRetrievalSequence &getDICOMMediaRetrievalSequence() const + { return DICOMMediaRetrievalSequence; } + + /** get DICOMRetrievalSequence (0040,e021) + * @return reference to sequence element + */ + DRTDICOMRetrievalSequence &getDICOMRetrievalSequence() + { return DICOMRetrievalSequence; } + + /** get DICOMRetrievalSequence (0040,e021) + * @return const reference to sequence element + */ + const DRTDICOMRetrievalSequence &getDICOMRetrievalSequence() const + { return DICOMRetrievalSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return reference to sequence element + */ + DRTReferencedSOPSequence &getReferencedSOPSequence() + { return ReferencedSOPSequence; } + + /** get ReferencedSOPSequence (0008,1199) + * @return const reference to sequence element + */ + const DRTReferencedSOPSequence &getReferencedSOPSequence() const + { return ReferencedSOPSequence; } + + /** get WADORSRetrievalSequence (0040,e025) + * @return reference to sequence element + */ + DRTWADORSRetrievalSequence &getWADORSRetrievalSequence() + { return WADORSRetrievalSequence; } + + /** get WADORSRetrievalSequence (0040,e025) + * @return const reference to sequence element + */ + const DRTWADORSRetrievalSequence &getWADORSRetrievalSequence() const + { return WADORSRetrievalSequence; } + + /** get WADORetrievalSequence (0040,e023) + * @return reference to sequence element + */ + DRTWADORetrievalSequence &getWADORetrievalSequence() + { return WADORetrievalSequence; } + + /** get WADORetrievalSequence (0040,e023) + * @return const reference to sequence element + */ + const DRTWADORetrievalSequence &getWADORetrievalSequence() const + { return WADORetrievalSequence; } + + /** get XDSRetrievalSequence (0040,e024) + * @return reference to sequence element + */ + DRTXDSRetrievalSequence &getXDSRetrievalSequence() + { return XDSRetrievalSequence; } + + /** get XDSRetrievalSequence (0040,e024) + * @return const reference to sequence element + */ + const DRTXDSRetrievalSequence &getXDSRetrievalSequence() const + { return XDSRetrievalSequence; } + + // --- set DICOM attribute values --- + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set TypeOfInstances (0040,e020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTypeOfInstances(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DICOMMediaRetrievalSequence (0040,e022) vr=SQ, vm=1, type=1C + DRTDICOMMediaRetrievalSequence DICOMMediaRetrievalSequence; + /// DICOMRetrievalSequence (0040,e021) vr=SQ, vm=1, type=1C + DRTDICOMRetrievalSequence DICOMRetrievalSequence; + /// ReferencedSOPSequence (0008,1199) vr=SQ, vm=1, type=1 + DRTReferencedSOPSequence ReferencedSOPSequence; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1C + DcmUniqueIdentifier SeriesInstanceUID; + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier StudyInstanceUID; + /// TypeOfInstances (0040,e020) vr=CS, vm=1, type=1 + DcmCodeString TypeOfInstances; + /// WADORSRetrievalSequence (0040,e025) vr=SQ, vm=1, type=1C + DRTWADORSRetrievalSequence WADORSRetrievalSequence; + /// WADORetrievalSequence (0040,e023) vr=SQ, vm=1, type=1C + DRTWADORetrievalSequence WADORetrievalSequence; + /// XDSRetrievalSequence (0040,e024) vr=SQ, vm=1, type=1C + DRTXDSRetrievalSequence XDSRetrievalSequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedPatientPhotoSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedPatientPhotoSequence(const DRTReferencedPatientPhotoSequence ©); + + /** destructor + */ + virtual ~DRTReferencedPatientPhotoSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedPatientPhotoSequence &operator=(const DRTReferencedPatientPhotoSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrpps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrpps.h new file mode 100644 index 00000000..8a60cb56 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrpps.h @@ -0,0 +1,344 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTROIPhysicalPropertiesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRPPS_H +#define DRTRPPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrecs.h" // for ROIElementalCompositionSequence + + +/** Interface class for ROIPhysicalPropertiesSequence (3006,00b0) + */ +class DCMTK_DCMRT_EXPORT DRTROIPhysicalPropertiesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ROIPhysicalProperty (3006,00b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIPhysicalProperty(OFString &value, const signed long pos = 0) const; + + /** get ROIPhysicalPropertyValue (3006,00b4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIPhysicalPropertyValue(OFString &value, const signed long pos = 0) const; + + /** get ROIPhysicalPropertyValue (3006,00b4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIPhysicalPropertyValue(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ROIElementalCompositionSequence (3006,00b6) + * @return reference to sequence element + */ + DRTROIElementalCompositionSequence &getROIElementalCompositionSequence() + { return ROIElementalCompositionSequence; } + + /** get ROIElementalCompositionSequence (3006,00b6) + * @return const reference to sequence element + */ + const DRTROIElementalCompositionSequence &getROIElementalCompositionSequence() const + { return ROIElementalCompositionSequence; } + + // --- set DICOM attribute values --- + + /** set ROIPhysicalProperty (3006,00b2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIPhysicalProperty(const OFString &value, const OFBool check = OFTrue); + + /** set ROIPhysicalPropertyValue (3006,00b4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIPhysicalPropertyValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ROIElementalCompositionSequence (3006,00b6) vr=SQ, vm=1, type=1C + DRTROIElementalCompositionSequence ROIElementalCompositionSequence; + /// ROIPhysicalProperty (3006,00b2) vr=CS, vm=1, type=1 + DcmCodeString ROIPhysicalProperty; + /// ROIPhysicalPropertyValue (3006,00b4) vr=DS, vm=1, type=1 + DcmDecimalString ROIPhysicalPropertyValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTROIPhysicalPropertiesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTROIPhysicalPropertiesSequence(const DRTROIPhysicalPropertiesSequence ©); + + /** destructor + */ + virtual ~DRTROIPhysicalPropertiesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTROIPhysicalPropertiesSequence &operator=(const DRTROIPhysicalPropertiesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrppss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrppss.h new file mode 100644 index 00000000..4b14db0b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrppss.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedPerformedProcedureStepSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRPPSS_H +#define DRTRPPSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedPerformedProcedureStepSequence (0008,1111) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedPerformedProcedureStepSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedPerformedProcedureStepSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedPerformedProcedureStepSequence(const DRTReferencedPerformedProcedureStepSequence ©); + + /** destructor + */ + virtual ~DRTReferencedPerformedProcedureStepSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedPerformedProcedureStepSequence &operator=(const DRTReferencedPerformedProcedureStepSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrps.h new file mode 100644 index 00000000..6cef4157 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrps.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedPatientSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRPS_H +#define DRTRPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedPatientSequence (0008,1120) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedPatientSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedPatientSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedPatientSequence(const DRTReferencedPatientSequence ©); + + /** destructor + */ + virtual ~DRTReferencedPatientSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedPatientSequence &operator=(const DRTReferencedPatientSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrris1.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrris1.h new file mode 100644 index 00000000..20e83985 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrris1.h @@ -0,0 +1,389 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedReferenceImageSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRIS1_H +#define DRTRRIS1_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedReferenceImageSequence (300c,0042) in RTBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedReferenceImageSequenceInRTBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get EndCumulativeMetersetWeight (300c,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEndCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get EndCumulativeMetersetWeight (300c,0009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEndCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferenceImageNumber (300a,00c8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferenceImageNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferenceImageNumber (300a,00c8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferenceImageNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get StartCumulativeMetersetWeight (300c,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStartCumulativeMetersetWeight(OFString &value, const signed long pos = 0) const; + + /** get StartCumulativeMetersetWeight (300c,0008) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStartCumulativeMetersetWeight(Float64 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set EndCumulativeMetersetWeight (300c,0009) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEndCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + /** set ReferenceImageNumber (300a,00c8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferenceImageNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set StartCumulativeMetersetWeight (300c,0008) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStartCumulativeMetersetWeight(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// EndCumulativeMetersetWeight (300c,0009) vr=DS, vm=1, type=3 + DcmDecimalString EndCumulativeMetersetWeight; + /// ReferenceImageNumber (300a,00c8) vr=IS, vm=1, type=1 + DcmIntegerString ReferenceImageNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// StartCumulativeMetersetWeight (300c,0008) vr=DS, vm=1, type=3 + DcmDecimalString StartCumulativeMetersetWeight; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedReferenceImageSequenceInRTBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedReferenceImageSequenceInRTBeamsModule(const DRTReferencedReferenceImageSequenceInRTBeamsModule ©); + + /** destructor + */ + virtual ~DRTReferencedReferenceImageSequenceInRTBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedReferenceImageSequenceInRTBeamsModule &operator=(const DRTReferencedReferenceImageSequenceInRTBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrris6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrris6.h new file mode 100644 index 00000000..e6995740 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrris6.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedReferenceImageSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRIS6_H +#define DRTRRIS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedReferenceImageSequence (300c,0042) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedReferenceImageSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferenceImageNumber (300a,00c8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferenceImageNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferenceImageNumber (300a,00c8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferenceImageNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferenceImageNumber (300a,00c8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferenceImageNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferenceImageNumber (300a,00c8) vr=IS, vm=1, type=1 + DcmIntegerString ReferenceImageNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedReferenceImageSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedReferenceImageSequenceInRTIonBeamsModule(const DRTReferencedReferenceImageSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTReferencedReferenceImageSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedReferenceImageSequenceInRTIonBeamsModule &operator=(const DRTReferencedReferenceImageSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrris9.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrris9.h new file mode 100644 index 00000000..9aef152c --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrris9.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRIS9_H +#define DRTRRIS9_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedReferenceImageSequence (300c,0042) in RTBrachyApplicationSetupsModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule(const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule ©); + + /** destructor + */ + virtual ~DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule &operator=(const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrms.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrms.h new file mode 100644 index 00000000..b0c19f08 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrms.h @@ -0,0 +1,375 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRecordedRangeModulatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRMS_H +#define DRTRRMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RecordedRangeModulatorSequence (3008,00f6) + */ +class DCMTK_DCMRT_EXPORT DRTRecordedRangeModulatorSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get BeamCurrentModulationID (300a,034c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamCurrentModulationID(OFString &value, const signed long pos = 0) const; + + /** get RangeModulatorID (300a,0346) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorID(OFString &value, const signed long pos = 0) const; + + /** get RangeModulatorType (300a,0348) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeModulatorType(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeModulatorNumber (300c,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeModulatorNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeModulatorNumber (300c,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeModulatorNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set BeamCurrentModulationID (300a,034c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamCurrentModulationID(const OFString &value, const OFBool check = OFTrue); + + /** set RangeModulatorID (300a,0346) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorID(const OFString &value, const OFBool check = OFTrue); + + /** set RangeModulatorType (300a,0348) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeModulatorType(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedRangeModulatorNumber (300c,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedRangeModulatorNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// BeamCurrentModulationID (300a,034c) vr=SH, vm=1, type=1C + DcmShortString BeamCurrentModulationID; + /// RangeModulatorID (300a,0346) vr=SH, vm=1, type=1 + DcmShortString RangeModulatorID; + /// RangeModulatorType (300a,0348) vr=CS, vm=1, type=1 + DcmCodeString RangeModulatorType; + /// ReferencedRangeModulatorNumber (300c,0104) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedRangeModulatorNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRecordedRangeModulatorSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRecordedRangeModulatorSequence(const DRTRecordedRangeModulatorSequence ©); + + /** destructor + */ + virtual ~DRTRecordedRangeModulatorSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRecordedRangeModulatorSequence &operator=(const DRTRecordedRangeModulatorSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrros.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrros.h new file mode 100644 index 00000000..6bfda7e7 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrros.h @@ -0,0 +1,491 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRTROIObservationsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRROS_H +#define DRTRROS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrpps.h" // for ROIPhysicalPropertiesSequence +#include "dcmtk/dcmrt/seq/drtrics.h" // for RTROIIdentificationCodeSequence +#include "dcmtk/dcmrt/seq/drtrrs.h" // for RTRelatedROISequence +#include "dcmtk/dcmrt/seq/drtrrros.h" // for RelatedRTROIObservationsSequence +#include "dcmtk/dcmrt/seq/drtspccs.h" // for SegmentedPropertyCategoryCodeSequence + + +/** Interface class for RTROIObservationsSequence (3006,0080) + */ +class DCMTK_DCMRT_EXPORT DRTRTROIObservationsSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get ObservationNumber (3006,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getObservationNumber(OFString &value, const signed long pos = 0) const; + + /** get ObservationNumber (3006,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getObservationNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ROIInterpreter (3006,00a6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIInterpreter(OFString &value, const signed long pos = 0) const; + + /** get ROIObservationDescription (3006,0088) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIObservationDescription(OFString &value, const signed long pos = 0) const; + + /** get ROIObservationLabel (3006,0085) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIObservationLabel(OFString &value, const signed long pos = 0) const; + + /** get RTROIInterpretedType (3006,00a4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTROIInterpretedType(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ROIPhysicalPropertiesSequence (3006,00b0) + * @return reference to sequence element + */ + DRTROIPhysicalPropertiesSequence &getROIPhysicalPropertiesSequence() + { return ROIPhysicalPropertiesSequence; } + + /** get ROIPhysicalPropertiesSequence (3006,00b0) + * @return const reference to sequence element + */ + const DRTROIPhysicalPropertiesSequence &getROIPhysicalPropertiesSequence() const + { return ROIPhysicalPropertiesSequence; } + + /** get RTROIIdentificationCodeSequence (3006,0086) + * @return reference to sequence element + */ + DRTRTROIIdentificationCodeSequence &getRTROIIdentificationCodeSequence() + { return RTROIIdentificationCodeSequence; } + + /** get RTROIIdentificationCodeSequence (3006,0086) + * @return const reference to sequence element + */ + const DRTRTROIIdentificationCodeSequence &getRTROIIdentificationCodeSequence() const + { return RTROIIdentificationCodeSequence; } + + /** get RTRelatedROISequence (3006,0030) + * @return reference to sequence element + */ + DRTRTRelatedROISequence &getRTRelatedROISequence() + { return RTRelatedROISequence; } + + /** get RTRelatedROISequence (3006,0030) + * @return const reference to sequence element + */ + const DRTRTRelatedROISequence &getRTRelatedROISequence() const + { return RTRelatedROISequence; } + + /** get RelatedRTROIObservationsSequence (3006,00a0) + * @return reference to sequence element + */ + DRTRelatedRTROIObservationsSequence &getRelatedRTROIObservationsSequence() + { return RelatedRTROIObservationsSequence; } + + /** get RelatedRTROIObservationsSequence (3006,00a0) + * @return const reference to sequence element + */ + const DRTRelatedRTROIObservationsSequence &getRelatedRTROIObservationsSequence() const + { return RelatedRTROIObservationsSequence; } + + /** get SegmentedPropertyCategoryCodeSequence (0062,0003) + * @return reference to sequence element + */ + DRTSegmentedPropertyCategoryCodeSequence &getSegmentedPropertyCategoryCodeSequence() + { return SegmentedPropertyCategoryCodeSequence; } + + /** get SegmentedPropertyCategoryCodeSequence (0062,0003) + * @return const reference to sequence element + */ + const DRTSegmentedPropertyCategoryCodeSequence &getSegmentedPropertyCategoryCodeSequence() const + { return SegmentedPropertyCategoryCodeSequence; } + + // --- set DICOM attribute values --- + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set ObservationNumber (3006,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setObservationNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ROIInterpreter (3006,00a6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIInterpreter(const OFString &value, const OFBool check = OFTrue); + + /** set ROIObservationDescription (3006,0088) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIObservationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ROIObservationLabel (3006,0085) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIObservationLabel(const OFString &value, const OFBool check = OFTrue); + + /** set RTROIInterpretedType (3006,00a4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTROIInterpretedType(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// MaterialID (300a,00e1) vr=SH, vm=1, type=3 + DcmShortString MaterialID; + /// ObservationNumber (3006,0082) vr=IS, vm=1, type=1 + DcmIntegerString ObservationNumber; + /// ROIInterpreter (3006,00a6) vr=PN, vm=1, type=2 + DcmPersonName ROIInterpreter; + /// ROIObservationDescription (3006,0088) vr=ST, vm=1, type=3 + DcmShortText ROIObservationDescription; + /// ROIObservationLabel (3006,0085) vr=SH, vm=1, type=3 + DcmShortString ROIObservationLabel; + /// ROIPhysicalPropertiesSequence (3006,00b0) vr=SQ, vm=1, type=3 + DRTROIPhysicalPropertiesSequence ROIPhysicalPropertiesSequence; + /// RTROIIdentificationCodeSequence (3006,0086) vr=SQ, vm=1, type=3 + DRTRTROIIdentificationCodeSequence RTROIIdentificationCodeSequence; + /// RTROIInterpretedType (3006,00a4) vr=CS, vm=1, type=2 + DcmCodeString RTROIInterpretedType; + /// RTRelatedROISequence (3006,0030) vr=SQ, vm=1, type=3 + DRTRTRelatedROISequence RTRelatedROISequence; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + /// RelatedRTROIObservationsSequence (3006,00a0) vr=SQ, vm=1, type=3 + DRTRelatedRTROIObservationsSequence RelatedRTROIObservationsSequence; + /// SegmentedPropertyCategoryCodeSequence (0062,0003) vr=SQ, vm=1, type=3 + DRTSegmentedPropertyCategoryCodeSequence SegmentedPropertyCategoryCodeSequence; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRTROIObservationsSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRTROIObservationsSequence(const DRTRTROIObservationsSequence ©); + + /** destructor + */ + virtual ~DRTRTROIObservationsSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRTROIObservationsSequence &operator=(const DRTRTROIObservationsSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrpcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrpcs.h new file mode 100644 index 00000000..bb5647fb --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrpcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReasonForRequestedProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRPCS_H +#define DRTRRPCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for ReasonForRequestedProcedureCodeSequence (0040,100a) + */ +class DCMTK_DCMRT_EXPORT DRTReasonForRequestedProcedureCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReasonForRequestedProcedureCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReasonForRequestedProcedureCodeSequence(const DRTReasonForRequestedProcedureCodeSequence ©); + + /** destructor + */ + virtual ~DRTReasonForRequestedProcedureCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReasonForRequestedProcedureCodeSequence &operator=(const DRTReasonForRequestedProcedureCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrros.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrros.h new file mode 100644 index 00000000..a8bbc1bf --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrros.h @@ -0,0 +1,311 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRelatedRTROIObservationsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRROS_H +#define DRTRRROS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RelatedRTROIObservationsSequence (3006,00a0) + */ +class DCMTK_DCMRT_EXPORT DRTRelatedRTROIObservationsSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ObservationNumber (3006,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getObservationNumber(OFString &value, const signed long pos = 0) const; + + /** get ObservationNumber (3006,0082) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getObservationNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ObservationNumber (3006,0082) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setObservationNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ObservationNumber (3006,0082) vr=IS, vm=1, type=1 + DcmIntegerString ObservationNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRelatedRTROIObservationsSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRelatedRTROIObservationsSequence(const DRTRelatedRTROIObservationsSequence ©); + + /** destructor + */ + virtual ~DRTRelatedRTROIObservationsSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRelatedRTROIObservationsSequence &operator=(const DRTRelatedRTROIObservationsSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrs.h new file mode 100644 index 00000000..c152f4ef --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrs.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRTRelatedROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRS_H +#define DRTRRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RTRelatedROISequence (3006,0030) + */ +class DCMTK_DCMRT_EXPORT DRTRTRelatedROISequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RTROIRelationship (3006,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTROIRelationship(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedROINumber (3006,0084) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedROINumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RTROIRelationship (3006,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTROIRelationship(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedROINumber (3006,0084) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedROINumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RTROIRelationship (3006,0033) vr=CS, vm=1, type=3 + DcmCodeString RTROIRelationship; + /// ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedROINumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRTRelatedROISequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRTRelatedROISequence(const DRTRTRelatedROISequence ©); + + /** destructor + */ + virtual ~DRTRTRelatedROISequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRTRelatedROISequence &operator=(const DRTRTRelatedROISequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrshs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrshs.h new file mode 100644 index 00000000..337c9e58 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrshs.h @@ -0,0 +1,343 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRecordedRangeShifterSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRSHS_H +#define DRTRRSHS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RecordedRangeShifterSequence (3008,00f2) + */ +class DCMTK_DCMRT_EXPORT DRTRecordedRangeShifterSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get RangeShifterID (300a,0318) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeShifterNumber (300c,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeShifterNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeShifterNumber (300c,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeShifterNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set RangeShifterID (300a,0318) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedRangeShifterNumber (300c,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedRangeShifterNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// RangeShifterID (300a,0318) vr=SH, vm=1, type=1 + DcmShortString RangeShifterID; + /// ReferencedRangeShifterNumber (300c,0100) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedRangeShifterNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRecordedRangeShifterSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRecordedRangeShifterSequence(const DRTRecordedRangeShifterSequence ©); + + /** destructor + */ + virtual ~DRTRecordedRangeShifterSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRecordedRangeShifterSequence &operator=(const DRTRecordedRangeShifterSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps.h new file mode 100644 index 00000000..7c76d9a3 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedRTPlanSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRTPS_H +#define DRTRRTPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrfgs.h" // for ReferencedFractionGroupSequence + + +/** Interface class for ReferencedRTPlanSequence (300c,0002) in RTDoseModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedRTPlanSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ReferencedFractionGroupSequence (300c,0020) + * @return reference to sequence element + */ + DRTReferencedFractionGroupSequence &getReferencedFractionGroupSequence() + { return ReferencedFractionGroupSequence; } + + /** get ReferencedFractionGroupSequence (300c,0020) + * @return const reference to sequence element + */ + const DRTReferencedFractionGroupSequence &getReferencedFractionGroupSequence() const + { return ReferencedFractionGroupSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedFractionGroupSequence (300c,0020) vr=SQ, vm=1, type=1C + DRTReferencedFractionGroupSequence ReferencedFractionGroupSequence; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedRTPlanSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedRTPlanSequence(const DRTReferencedRTPlanSequence ©); + + /** destructor + */ + virtual ~DRTReferencedRTPlanSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedRTPlanSequence &operator=(const DRTReferencedRTPlanSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps3.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps3.h new file mode 100644 index 00000000..0af292de --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps3.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedRTPlanSequenceInRTGeneralPlanModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRTPS3_H +#define DRTRRTPS3_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedRTPlanSequence (300c,0002) in RTGeneralPlanModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedRTPlanSequenceInRTGeneralPlanModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RTPlanRelationship (300a,0055) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRTPlanRelationship(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RTPlanRelationship (300a,0055) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRTPlanRelationship(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RTPlanRelationship (300a,0055) vr=CS, vm=1, type=1 + DcmCodeString RTPlanRelationship; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedRTPlanSequenceInRTGeneralPlanModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedRTPlanSequenceInRTGeneralPlanModule(const DRTReferencedRTPlanSequenceInRTGeneralPlanModule ©); + + /** destructor + */ + virtual ~DRTReferencedRTPlanSequenceInRTGeneralPlanModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedRTPlanSequenceInRTGeneralPlanModule &operator=(const DRTReferencedRTPlanSequenceInRTGeneralPlanModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps4.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps4.h new file mode 100644 index 00000000..5f0c7b89 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps4.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRTPS4_H +#define DRTRRTPS4_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedRTPlanSequence (300c,0002) in RTGeneralTreatmentRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule(const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule ©); + + /** destructor + */ + virtual ~DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule &operator=(const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps5.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps5.h new file mode 100644 index 00000000..49836e0f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrrtps5.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedRTPlanSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRRTPS5_H +#define DRTRRTPS5_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedRTPlanSequence (300c,0002) in RTImageModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedRTPlanSequenceInRTImageModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedRTPlanSequenceInRTImageModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedRTPlanSequenceInRTImageModule(const DRTReferencedRTPlanSequenceInRTImageModule ©); + + /** destructor + */ + virtual ~DRTReferencedRTPlanSequenceInRTImageModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedRTPlanSequenceInRTImageModule &operator=(const DRTReferencedRTPlanSequenceInRTImageModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrscs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrscs.h new file mode 100644 index 00000000..b62f9c5c --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrscs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRequestingServiceCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSCS_H +#define DRTRSCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for RequestingServiceCodeSequence (0032,1034) + */ +class DCMTK_DCMRT_EXPORT DRTRequestingServiceCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRequestingServiceCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRequestingServiceCodeSequence(const DRTRequestingServiceCodeSequence ©); + + /** destructor + */ + virtual ~DRTRequestingServiceCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRequestingServiceCodeSequence &operator=(const DRTRequestingServiceCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrsers.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrsers.h new file mode 100644 index 00000000..ddc5aa00 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrsers.h @@ -0,0 +1,321 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedSeriesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSERS_H +#define DRTRSERS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtris.h" // for ReferencedInstanceSequence + + +/** Interface class for ReferencedSeriesSequence (0008,1115) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedSeriesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ReferencedInstanceSequence (0008,114a) + * @return reference to sequence element + */ + DRTReferencedInstanceSequence &getReferencedInstanceSequence() + { return ReferencedInstanceSequence; } + + /** get ReferencedInstanceSequence (0008,114a) + * @return const reference to sequence element + */ + const DRTReferencedInstanceSequence &getReferencedInstanceSequence() const + { return ReferencedInstanceSequence; } + + // --- set DICOM attribute values --- + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedInstanceSequence (0008,114a) vr=SQ, vm=1, type=1 + DRTReferencedInstanceSequence ReferencedInstanceSequence; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedSeriesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedSeriesSequence(const DRTReferencedSeriesSequence ©); + + /** destructor + */ + virtual ~DRTReferencedSeriesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedSeriesSequence &operator=(const DRTReferencedSeriesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrses.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrses.h new file mode 100644 index 00000000..22442301 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrses.h @@ -0,0 +1,321 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRTReferencedSeriesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSES_H +#define DRTRSES_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtcis.h" // for ContourImageSequence + + +/** Interface class for RTReferencedSeriesSequence (3006,0014) + */ +class DCMTK_DCMRT_EXPORT DRTRTReferencedSeriesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get SeriesInstanceUID (0020,000e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSeriesInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ContourImageSequence (3006,0016) + * @return reference to sequence element + */ + DRTContourImageSequence &getContourImageSequence() + { return ContourImageSequence; } + + /** get ContourImageSequence (3006,0016) + * @return const reference to sequence element + */ + const DRTContourImageSequence &getContourImageSequence() const + { return ContourImageSequence; } + + // --- set DICOM attribute values --- + + /** set SeriesInstanceUID (0020,000e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSeriesInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ContourImageSequence (3006,0016) vr=SQ, vm=1, type=1 + DRTContourImageSequence ContourImageSequence; + /// SeriesInstanceUID (0020,000e) vr=UI, vm=1, type=1 + DcmUniqueIdentifier SeriesInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRTReferencedSeriesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRTReferencedSeriesSequence(const DRTRTReferencedSeriesSequence ©); + + /** destructor + */ + virtual ~DRTRTReferencedSeriesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRTReferencedSeriesSequence &operator=(const DRTRTReferencedSeriesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrshs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrshs.h new file mode 100644 index 00000000..440461a4 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrshs.h @@ -0,0 +1,375 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRangeShifterSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSHS_H +#define DRTRSHS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RangeShifterSequence (300a,0314) + */ +class DCMTK_DCMRT_EXPORT DRTRangeShifterSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get RangeShifterDescription (300a,0322) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterDescription(OFString &value, const signed long pos = 0) const; + + /** get RangeShifterID (300a,0318) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterID(OFString &value, const signed long pos = 0) const; + + /** get RangeShifterNumber (300a,0316) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterNumber(OFString &value, const signed long pos = 0) const; + + /** get RangeShifterNumber (300a,0316) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get RangeShifterType (300a,0320) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set RangeShifterDescription (300a,0322) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterDescription(const OFString &value, const OFBool check = OFTrue); + + /** set RangeShifterID (300a,0318) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterID(const OFString &value, const OFBool check = OFTrue); + + /** set RangeShifterNumber (300a,0316) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterNumber(const OFString &value, const OFBool check = OFTrue); + + /** set RangeShifterType (300a,0320) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// RangeShifterDescription (300a,0322) vr=LO, vm=1, type=3 + DcmLongString RangeShifterDescription; + /// RangeShifterID (300a,0318) vr=SH, vm=1, type=1 + DcmShortString RangeShifterID; + /// RangeShifterNumber (300a,0316) vr=IS, vm=1, type=1 + DcmIntegerString RangeShifterNumber; + /// RangeShifterType (300a,0320) vr=CS, vm=1, type=1 + DcmCodeString RangeShifterType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRangeShifterSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRangeShifterSequence(const DRTRangeShifterSequence ©); + + /** destructor + */ + virtual ~DRTRangeShifterSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRangeShifterSequence &operator=(const DRTRangeShifterSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrshs6.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrshs6.h new file mode 100644 index 00000000..53eaa3ef --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrshs6.h @@ -0,0 +1,359 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRangeShifterSettingsSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSHS6_H +#define DRTRSHS6_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RangeShifterSettingsSequence (300a,0360) in RTIonBeamsModule + */ +class DCMTK_DCMRT_EXPORT DRTRangeShifterSettingsSequenceInRTIonBeamsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IsocenterToRangeShifterDistance (300a,0364) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIsocenterToRangeShifterDistance(Float32 &value, const unsigned long pos = 0) const; + + /** get RangeShifterSetting (300a,0362) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterSetting(OFString &value, const signed long pos = 0) const; + + /** get RangeShifterWaterEquivalentThickness (300a,0366) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterWaterEquivalentThickness(Float32 &value, const unsigned long pos = 0) const; + + /** get ReferencedRangeShifterNumber (300c,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeShifterNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeShifterNumber (300c,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeShifterNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set IsocenterToRangeShifterDistance (300a,0364) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIsocenterToRangeShifterDistance(const Float32 value, const unsigned long pos = 0); + + /** set RangeShifterSetting (300a,0362) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterSetting(const OFString &value, const OFBool check = OFTrue); + + /** set RangeShifterWaterEquivalentThickness (300a,0366) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterWaterEquivalentThickness(const Float32 value, const unsigned long pos = 0); + + /** set ReferencedRangeShifterNumber (300c,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedRangeShifterNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// IsocenterToRangeShifterDistance (300a,0364) vr=FL, vm=1, type=3 + DcmFloatingPointSingle IsocenterToRangeShifterDistance; + /// RangeShifterSetting (300a,0362) vr=LO, vm=1, type=1 + DcmLongString RangeShifterSetting; + /// RangeShifterWaterEquivalentThickness (300a,0366) vr=FL, vm=1, type=3 + DcmFloatingPointSingle RangeShifterWaterEquivalentThickness; + /// ReferencedRangeShifterNumber (300c,0100) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedRangeShifterNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsModule(const DRTRangeShifterSettingsSequenceInRTIonBeamsModule ©); + + /** destructor + */ + virtual ~DRTRangeShifterSettingsSequenceInRTIonBeamsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsModule &operator=(const DRTRangeShifterSettingsSequenceInRTIonBeamsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrshs7.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrshs7.h new file mode 100644 index 00000000..1be837eb --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrshs7.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSHS7_H +#define DRTRSHS7_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RangeShifterSettingsSequence (300a,0360) in RTIonBeamsSessionRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RangeShifterSetting (300a,0362) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRangeShifterSetting(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeShifterNumber (300c,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeShifterNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedRangeShifterNumber (300c,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedRangeShifterNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RangeShifterSetting (300a,0362) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRangeShifterSetting(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedRangeShifterNumber (300c,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedRangeShifterNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RangeShifterSetting (300a,0362) vr=LO, vm=1, type=1 + DcmLongString RangeShifterSetting; + /// ReferencedRangeShifterNumber (300c,0100) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedRangeShifterNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule(const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule ©); + + /** destructor + */ + virtual ~DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule &operator=(const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrsis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrsis.h new file mode 100644 index 00000000..5b9defb2 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrsis.h @@ -0,0 +1,375 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedSetupImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSIS_H +#define DRTRSIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedSetupImageSequence (300a,0401) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedSetupImageSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSegmentNumber (0062,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSegmentNumber(Uint16 &value, const unsigned long pos = 0) const; + + /** get SetupImageComment (300a,0402) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupImageComment(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedFrameNumber (0008,1160) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSegmentNumber (0062,000b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegmentNumber(const Uint16 value, const unsigned long pos = 0); + + /** set SetupImageComment (300a,0402) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupImageComment(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C + DcmIntegerString ReferencedFrameNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C + DcmUnsignedShort ReferencedSegmentNumber; + /// SetupImageComment (300a,0402) vr=ST, vm=1, type=3 + DcmShortText SetupImageComment; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedSetupImageSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedSetupImageSequence(const DRTReferencedSetupImageSequence ©); + + /** destructor + */ + virtual ~DRTReferencedSetupImageSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedSetupImageSequence &operator=(const DRTReferencedSetupImageSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrsns.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrsns.h new file mode 100644 index 00000000..63bb3c4d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrsns.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRecordedSnoutSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSNS_H +#define DRTRSNS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RecordedSnoutSequence (3008,00f0) + */ +class DCMTK_DCMRT_EXPORT DRTRecordedSnoutSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get SnoutID (300a,030f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSnoutID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set SnoutID (300a,030f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSnoutID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// SnoutID (300a,030f) vr=SH, vm=1, type=1 + DcmShortString SnoutID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRecordedSnoutSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRecordedSnoutSequence(const DRTRecordedSnoutSequence ©); + + /** destructor + */ + virtual ~DRTRecordedSnoutSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRecordedSnoutSequence &operator=(const DRTRecordedSnoutSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrsos.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrsos.h new file mode 100644 index 00000000..c8242639 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrsos.h @@ -0,0 +1,375 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedSOPSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSOS_H +#define DRTRSOS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedSOPSequence (0008,1199) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedSOPSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get HL7InstanceIdentifier (0040,e001) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHL7InstanceIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSegmentNumber (0062,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSegmentNumber(Uint16 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set HL7InstanceIdentifier (0040,e001) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHL7InstanceIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedFrameNumber (0008,1160) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSegmentNumber (0062,000b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegmentNumber(const Uint16 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// HL7InstanceIdentifier (0040,e001) vr=ST, vm=1, type=1C + DcmShortText HL7InstanceIdentifier; + /// ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C + DcmIntegerString ReferencedFrameNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C + DcmUnsignedShort ReferencedSegmentNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedSOPSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedSOPSequence(const DRTReferencedSOPSequence ©); + + /** destructor + */ + virtual ~DRTReferencedSOPSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedSOPSequence &operator=(const DRTReferencedSOPSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrsrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrsrs.h new file mode 100644 index 00000000..fa499a0e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrsrs.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedSpatialRegistrationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSRS_H +#define DRTRSRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedSpatialRegistrationSequence (0070,0404) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedSpatialRegistrationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedSpatialRegistrationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedSpatialRegistrationSequence(const DRTReferencedSpatialRegistrationSequence ©); + + /** destructor + */ + virtual ~DRTReferencedSpatialRegistrationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedSpatialRegistrationSequence &operator=(const DRTReferencedSpatialRegistrationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrss.h new file mode 100644 index 00000000..582f0247 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrss.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedStudySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSS_H +#define DRTRSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedStudySequence (0008,1110) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedStudySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedStudySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedStudySequence(const DRTReferencedStudySequence ©); + + /** destructor + */ + virtual ~DRTReferencedStudySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedStudySequence &operator=(const DRTReferencedStudySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrsss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrsss.h new file mode 100644 index 00000000..d8720c78 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrsss.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedStructureSetSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSSS_H +#define DRTRSSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedStructureSetSequence (300c,0060) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedStructureSetSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedStructureSetSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedStructureSetSequence(const DRTReferencedStructureSetSequence ©); + + /** destructor + */ + virtual ~DRTReferencedStructureSetSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedStructureSetSequence &operator=(const DRTReferencedStructureSetSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrsts.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrsts.h new file mode 100644 index 00000000..330fc6b8 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrsts.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRTReferencedStudySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRSTS_H +#define DRTRSTS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrses.h" // for RTReferencedSeriesSequence + + +/** Interface class for RTReferencedStudySequence (3006,0012) + */ +class DCMTK_DCMRT_EXPORT DRTRTReferencedStudySequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get RTReferencedSeriesSequence (3006,0014) + * @return reference to sequence element + */ + DRTRTReferencedSeriesSequence &getRTReferencedSeriesSequence() + { return RTReferencedSeriesSequence; } + + /** get RTReferencedSeriesSequence (3006,0014) + * @return const reference to sequence element + */ + const DRTRTReferencedSeriesSequence &getRTReferencedSeriesSequence() const + { return RTReferencedSeriesSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RTReferencedSeriesSequence (3006,0014) vr=SQ, vm=1, type=1 + DRTRTReferencedSeriesSequence RTReferencedSeriesSequence; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRTReferencedStudySequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRTReferencedStudySequence(const DRTRTReferencedStudySequence ©); + + /** destructor + */ + virtual ~DRTRTReferencedStudySequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRTReferencedStudySequence &operator=(const DRTRTReferencedStudySequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrtrs2.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrtrs2.h new file mode 100644 index 00000000..1b3115e2 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrtrs2.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedTreatmentRecordSequenceInRTDoseModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRTRS2_H +#define DRTRTRS2_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrbs2.h" // for ReferencedBeamSequence + + +/** Interface class for ReferencedTreatmentRecordSequence (3008,0030) in RTDoseModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedTreatmentRecordSequenceInRTDoseModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ReferencedBeamSequence (300c,0004) + * @return reference to sequence element + */ + DRTReferencedBeamSequenceInRTDoseModule &getReferencedBeamSequence() + { return ReferencedBeamSequence; } + + /** get ReferencedBeamSequence (300c,0004) + * @return const reference to sequence element + */ + const DRTReferencedBeamSequenceInRTDoseModule &getReferencedBeamSequence() const + { return ReferencedBeamSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedBeamSequence (300c,0004) vr=SQ, vm=1, type=1C + DRTReferencedBeamSequenceInRTDoseModule ReferencedBeamSequence; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedTreatmentRecordSequenceInRTDoseModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedTreatmentRecordSequenceInRTDoseModule(const DRTReferencedTreatmentRecordSequenceInRTDoseModule ©); + + /** destructor + */ + virtual ~DRTReferencedTreatmentRecordSequenceInRTDoseModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedTreatmentRecordSequenceInRTDoseModule &operator=(const DRTReferencedTreatmentRecordSequenceInRTDoseModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrtrs4.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrtrs4.h new file mode 100644 index 00000000..57592c39 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrtrs4.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRTRS4_H +#define DRTRTRS4_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedTreatmentRecordSequence (3008,0030) in RTGeneralTreatmentRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule(const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule ©); + + /** destructor + */ + virtual ~DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule &operator=(const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrvis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrvis.h new file mode 100644 index 00000000..fb1f3f57 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrvis.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTReferencedVerificationImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRVIS_H +#define DRTRVIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ReferencedVerificationImageSequence (300c,0040) + */ +class DCMTK_DCMRT_EXPORT DRTReferencedVerificationImageSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTReferencedVerificationImageSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTReferencedVerificationImageSequence(const DRTReferencedVerificationImageSequence ©); + + /** destructor + */ + virtual ~DRTReferencedVerificationImageSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTReferencedVerificationImageSequence &operator=(const DRTReferencedVerificationImageSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrws.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrws.h new file mode 100644 index 00000000..14a21d61 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrws.h @@ -0,0 +1,405 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRecordedWedgeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRWS_H +#define DRTRWS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for RecordedWedgeSequence (3008,00b0) + */ +class DCMTK_DCMRT_EXPORT DRTRecordedWedgeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get WedgeAngle (300a,00d5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeAngle(OFString &value, const signed long pos = 0) const; + + /** get WedgeAngle (300a,00d5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeAngle(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgeID (300a,00d4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeID(OFString &value, const signed long pos = 0) const; + + /** get WedgeNumber (300a,00d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeNumber(OFString &value, const signed long pos = 0) const; + + /** get WedgeNumber (300a,00d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgeOrientation (300a,00d8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeOrientation(OFString &value, const signed long pos = 0) const; + + /** get WedgeOrientation (300a,00d8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeOrientation(Float64 &value, const unsigned long pos = 0) const; + + /** get WedgeType (300a,00d3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeAngle (300a,00d5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeAngle(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeID (300a,00d4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeID(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeNumber (300a,00d2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeNumber(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeOrientation (300a,00d8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeType (300a,00d3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// WedgeAngle (300a,00d5) vr=IS, vm=1, type=2 + DcmIntegerString WedgeAngle; + /// WedgeID (300a,00d4) vr=SH, vm=1, type=3 + DcmShortString WedgeID; + /// WedgeNumber (300a,00d2) vr=IS, vm=1, type=1 + DcmIntegerString WedgeNumber; + /// WedgeOrientation (300a,00d8) vr=DS, vm=1, type=2 + DcmDecimalString WedgeOrientation; + /// WedgeType (300a,00d3) vr=CS, vm=1, type=2 + DcmCodeString WedgeType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRecordedWedgeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRecordedWedgeSequence(const DRTRecordedWedgeSequence ©); + + /** destructor + */ + virtual ~DRTRecordedWedgeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRecordedWedgeSequence &operator=(const DRTRecordedWedgeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtrwvms.h b/dcmrt/include/dcmtk/dcmrt/seq/drtrwvms.h new file mode 100644 index 00000000..2c834d2e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtrwvms.h @@ -0,0 +1,464 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTRealWorldValueMappingSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTRWVMS_H +#define DRTRWVMS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtmucs.h" // for MeasurementUnitsCodeSequence +#include "dcmtk/dcmrt/seq/drtqds.h" // for QuantityDefinitionSequence + + +/** Interface class for RealWorldValueMappingSequence (0040,9096) + */ +class DCMTK_DCMRT_EXPORT DRTRealWorldValueMappingSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DoubleFloatRealWorldValueFirstValueMapped (0040,9214) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoubleFloatRealWorldValueFirstValueMapped(Float64 &value, const unsigned long pos = 0) const; + + /** get DoubleFloatRealWorldValueLastValueMapped (0040,9213) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoubleFloatRealWorldValueLastValueMapped(Float64 &value, const unsigned long pos = 0) const; + + /** get LUTExplanation (0028,3003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTExplanation(OFString &value, const signed long pos = 0) const; + + /** get LUTLabel (0040,9210) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTLabel(OFString &value, const signed long pos = 0) const; + + /** get RealWorldValueFirstValueMapped (0040,9216) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRealWorldValueFirstValueMapped(Uint16 &value, const unsigned long pos = 0) const; + + /** get RealWorldValueIntercept (0040,9224) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRealWorldValueIntercept(Float64 &value, const unsigned long pos = 0) const; + + /** get RealWorldValueLUTData (0040,9212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRealWorldValueLUTData(Float64 &value, const unsigned long pos = 0) const; + + /** get RealWorldValueLastValueMapped (0040,9211) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRealWorldValueLastValueMapped(Uint16 &value, const unsigned long pos = 0) const; + + /** get RealWorldValueSlope (0040,9225) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRealWorldValueSlope(Float64 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return reference to sequence element + */ + DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() + { return MeasurementUnitsCodeSequence; } + + /** get MeasurementUnitsCodeSequence (0040,08ea) + * @return const reference to sequence element + */ + const DRTMeasurementUnitsCodeSequence &getMeasurementUnitsCodeSequence() const + { return MeasurementUnitsCodeSequence; } + + /** get QuantityDefinitionSequence (0040,9220) + * @return reference to sequence element + */ + DRTQuantityDefinitionSequence &getQuantityDefinitionSequence() + { return QuantityDefinitionSequence; } + + /** get QuantityDefinitionSequence (0040,9220) + * @return const reference to sequence element + */ + const DRTQuantityDefinitionSequence &getQuantityDefinitionSequence() const + { return QuantityDefinitionSequence; } + + // --- set DICOM attribute values --- + + /** set DoubleFloatRealWorldValueFirstValueMapped (0040,9214) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoubleFloatRealWorldValueFirstValueMapped(const Float64 value, const unsigned long pos = 0); + + /** set DoubleFloatRealWorldValueLastValueMapped (0040,9213) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoubleFloatRealWorldValueLastValueMapped(const Float64 value, const unsigned long pos = 0); + + /** set LUTExplanation (0028,3003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTExplanation(const OFString &value, const OFBool check = OFTrue); + + /** set LUTLabel (0040,9210) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTLabel(const OFString &value, const OFBool check = OFTrue); + + /** set RealWorldValueFirstValueMapped (0040,9216) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueFirstValueMapped(const Uint16 value, const unsigned long pos = 0); + + /** set RealWorldValueIntercept (0040,9224) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueIntercept(const Float64 value, const unsigned long pos = 0); + + /** set RealWorldValueLUTData (0040,9212) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueLUTData(const Float64 value, const unsigned long pos = 0); + + /** set RealWorldValueLastValueMapped (0040,9211) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueLastValueMapped(const Uint16 value, const unsigned long pos = 0); + + /** set RealWorldValueSlope (0040,9225) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueSlope(const Float64 value, const unsigned long pos = 0); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DoubleFloatRealWorldValueFirstValueMapped (0040,9214) vr=FD, vm=1, type=1C + DcmFloatingPointDouble DoubleFloatRealWorldValueFirstValueMapped; + /// DoubleFloatRealWorldValueLastValueMapped (0040,9213) vr=FD, vm=1, type=1C + DcmFloatingPointDouble DoubleFloatRealWorldValueLastValueMapped; + /// LUTExplanation (0028,3003) vr=LO, vm=1, type=1 + DcmLongString LUTExplanation; + /// LUTLabel (0040,9210) vr=SH, vm=1, type=1 + DcmShortString LUTLabel; + /// MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1 + DRTMeasurementUnitsCodeSequence MeasurementUnitsCodeSequence; + /// QuantityDefinitionSequence (0040,9220) vr=SQ, vm=1, type=3 + DRTQuantityDefinitionSequence QuantityDefinitionSequence; + /// RealWorldValueFirstValueMapped (0040,9216) vr=US/SS, vm=1, type=1C + DcmUnsignedShort RealWorldValueFirstValueMapped; + /// RealWorldValueIntercept (0040,9224) vr=FD, vm=1, type=1C + DcmFloatingPointDouble RealWorldValueIntercept; + /// RealWorldValueLUTData (0040,9212) vr=FD, vm=1-n, type=1C + DcmFloatingPointDouble RealWorldValueLUTData; + /// RealWorldValueLastValueMapped (0040,9211) vr=US/SS, vm=1, type=1C + DcmUnsignedShort RealWorldValueLastValueMapped; + /// RealWorldValueSlope (0040,9225) vr=FD, vm=1, type=1C + DcmFloatingPointDouble RealWorldValueSlope; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTRealWorldValueMappingSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTRealWorldValueMappingSequence(const DRTRealWorldValueMappingSequence ©); + + /** destructor + */ + virtual ~DRTRealWorldValueMappingSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTRealWorldValueMappingSequence &operator=(const DRTRealWorldValueMappingSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtscris.h b/dcmrt/include/dcmtk/dcmrt/seq/drtscris.h new file mode 100644 index 00000000..7cbc312d --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtscris.h @@ -0,0 +1,321 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTStudiesContainingOtherReferencedInstancesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSCRIS_H +#define DRTSCRIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtrsers.h" // for ReferencedSeriesSequence + + +/** Interface class for StudiesContainingOtherReferencedInstancesSequence (0008,1200) + */ +class DCMTK_DCMRT_EXPORT DRTStudiesContainingOtherReferencedInstancesSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get StudyInstanceUID (0020,000d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStudyInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ReferencedSeriesSequence (0008,1115) + * @return reference to sequence element + */ + DRTReferencedSeriesSequence &getReferencedSeriesSequence() + { return ReferencedSeriesSequence; } + + /** get ReferencedSeriesSequence (0008,1115) + * @return const reference to sequence element + */ + const DRTReferencedSeriesSequence &getReferencedSeriesSequence() const + { return ReferencedSeriesSequence; } + + // --- set DICOM attribute values --- + + /** set StudyInstanceUID (0020,000d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStudyInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedSeriesSequence (0008,1115) vr=SQ, vm=1, type=1 + DRTReferencedSeriesSequence ReferencedSeriesSequence; + /// StudyInstanceUID (0020,000d) vr=UI, vm=1, type=1 + DcmUniqueIdentifier StudyInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTStudiesContainingOtherReferencedInstancesSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTStudiesContainingOtherReferencedInstancesSequence(const DRTStudiesContainingOtherReferencedInstancesSequence ©); + + /** destructor + */ + virtual ~DRTStudiesContainingOtherReferencedInstancesSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTStudiesContainingOtherReferencedInstancesSequence &operator=(const DRTStudiesContainingOtherReferencedInstancesSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtscs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtscs.h new file mode 100644 index 00000000..fe46392b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtscs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTStrainCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSCS_H +#define DRTSCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for StrainCodeSequence (0010,0219) + */ +class DCMTK_DCMRT_EXPORT DRTStrainCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTStrainCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTStrainCodeSequence(const DRTStrainCodeSequence ©); + + /** destructor + */ + virtual ~DRTStrainCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTStrainCodeSequence &operator=(const DRTStrainCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtsdcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtsdcs.h new file mode 100644 index 00000000..342ea593 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtsdcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSeriesDescriptionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSDCS_H +#define DRTSDCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for SeriesDescriptionCodeSequence (0008,103f) + */ +class DCMTK_DCMRT_EXPORT DRTSeriesDescriptionCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSeriesDescriptionCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSeriesDescriptionCodeSequence(const DRTSeriesDescriptionCodeSequence ©); + + /** destructor + */ + virtual ~DRTSeriesDescriptionCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSeriesDescriptionCodeSequence &operator=(const DRTSeriesDescriptionCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtsds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtsds.h new file mode 100644 index 00000000..869a261f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtsds.h @@ -0,0 +1,391 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSetupDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSDS_H +#define DRTSDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for SetupDeviceSequence (300a,01b4) + */ +class DCMTK_DCMRT_EXPORT DRTSetupDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get SetupDeviceDescription (300a,01ba) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupDeviceDescription(OFString &value, const signed long pos = 0) const; + + /** get SetupDeviceLabel (300a,01b8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupDeviceLabel(OFString &value, const signed long pos = 0) const; + + /** get SetupDeviceParameter (300a,01bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupDeviceParameter(OFString &value, const signed long pos = 0) const; + + /** get SetupDeviceParameter (300a,01bc) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupDeviceParameter(Float64 &value, const unsigned long pos = 0) const; + + /** get SetupDeviceType (300a,01b6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupDeviceType(OFString &value, const signed long pos = 0) const; + + /** get SetupReferenceDescription (300a,01d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSetupReferenceDescription(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set SetupDeviceDescription (300a,01ba) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupDeviceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SetupDeviceLabel (300a,01b8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupDeviceLabel(const OFString &value, const OFBool check = OFTrue); + + /** set SetupDeviceParameter (300a,01bc) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupDeviceParameter(const OFString &value, const OFBool check = OFTrue); + + /** set SetupDeviceType (300a,01b6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupDeviceType(const OFString &value, const OFBool check = OFTrue); + + /** set SetupReferenceDescription (300a,01d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSetupReferenceDescription(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// SetupDeviceDescription (300a,01ba) vr=ST, vm=1, type=3 + DcmShortText SetupDeviceDescription; + /// SetupDeviceLabel (300a,01b8) vr=SH, vm=1, type=2 + DcmShortString SetupDeviceLabel; + /// SetupDeviceParameter (300a,01bc) vr=DS, vm=1, type=2 + DcmDecimalString SetupDeviceParameter; + /// SetupDeviceType (300a,01b6) vr=CS, vm=1, type=1 + DcmCodeString SetupDeviceType; + /// SetupReferenceDescription (300a,01d0) vr=ST, vm=1, type=3 + DcmShortText SetupReferenceDescription; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSetupDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSetupDeviceSequence(const DRTSetupDeviceSequence ©); + + /** destructor + */ + virtual ~DRTSetupDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSetupDeviceSequence &operator=(const DRTSetupDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtshds.h b/dcmrt/include/dcmtk/dcmrt/seq/drtshds.h new file mode 100644 index 00000000..1fbe4346 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtshds.h @@ -0,0 +1,368 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTShieldingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSHDS_H +#define DRTSHDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for ShieldingDeviceSequence (300a,01a0) + */ +class DCMTK_DCMRT_EXPORT DRTShieldingDeviceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get ShieldingDeviceDescription (300a,01a6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getShieldingDeviceDescription(OFString &value, const signed long pos = 0) const; + + /** get ShieldingDeviceLabel (300a,01a4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getShieldingDeviceLabel(OFString &value, const signed long pos = 0) const; + + /** get ShieldingDevicePosition (300a,01a8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getShieldingDevicePosition(OFString &value, const signed long pos = 0) const; + + /** get ShieldingDeviceType (300a,01a2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getShieldingDeviceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set ShieldingDeviceDescription (300a,01a6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setShieldingDeviceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ShieldingDeviceLabel (300a,01a4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setShieldingDeviceLabel(const OFString &value, const OFBool check = OFTrue); + + /** set ShieldingDevicePosition (300a,01a8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setShieldingDevicePosition(const OFString &value, const OFBool check = OFTrue); + + /** set ShieldingDeviceType (300a,01a2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setShieldingDeviceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// ShieldingDeviceDescription (300a,01a6) vr=ST, vm=1, type=3 + DcmShortText ShieldingDeviceDescription; + /// ShieldingDeviceLabel (300a,01a4) vr=SH, vm=1, type=2 + DcmShortString ShieldingDeviceLabel; + /// ShieldingDevicePosition (300a,01a8) vr=SH, vm=1, type=3 + DcmShortString ShieldingDevicePosition; + /// ShieldingDeviceType (300a,01a2) vr=CS, vm=1, type=1 + DcmCodeString ShieldingDeviceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTShieldingDeviceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTShieldingDeviceSequence(const DRTShieldingDeviceSequence ©); + + /** destructor + */ + virtual ~DRTShieldingDeviceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTShieldingDeviceSequence &operator=(const DRTShieldingDeviceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtsins.h b/dcmrt/include/dcmtk/dcmrt/seq/drtsins.h new file mode 100644 index 00000000..a66e0ece --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtsins.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSourceInstanceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSINS_H +#define DRTSINS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtporcs.h" // for PurposeOfReferenceCodeSequence + + +/** Interface class for SourceInstanceSequence (0042,0013) + */ +class DCMTK_DCMRT_EXPORT DRTSourceInstanceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return reference to sequence element + */ + DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() + { return PurposeOfReferenceCodeSequence; } + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return const reference to sequence element + */ + const DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() const + { return PurposeOfReferenceCodeSequence; } + + // --- set DICOM attribute values --- + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// PurposeOfReferenceCodeSequence (0040,a170) vr=SQ, vm=1, type=3 + DRTPurposeOfReferenceCodeSequence PurposeOfReferenceCodeSequence; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSourceInstanceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSourceInstanceSequence(const DRTSourceInstanceSequence ©); + + /** destructor + */ + virtual ~DRTSourceInstanceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSourceInstanceSequence &operator=(const DRTSourceInstanceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtsis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtsis.h new file mode 100644 index 00000000..eeab9418 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtsis.h @@ -0,0 +1,408 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSourceImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSIS_H +#define DRTSIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtporcs.h" // for PurposeOfReferenceCodeSequence + + +/** Interface class for SourceImageSequence (0008,2112) + */ +class DCMTK_DCMRT_EXPORT DRTSourceImageSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get PatientOrientation (0020,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientOrientation(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedFrameNumber (0008,1160) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedSOPClassUID (0008,1150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPClassUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSOPInstanceUID (0008,1155) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSOPInstanceUID(OFString &value, const signed long pos = 0) const; + + /** get ReferencedSegmentNumber (0062,000b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedSegmentNumber(Uint16 &value, const unsigned long pos = 0) const; + + /** get SpatialLocationsPreserved (0028,135a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpatialLocationsPreserved(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return reference to sequence element + */ + DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() + { return PurposeOfReferenceCodeSequence; } + + /** get PurposeOfReferenceCodeSequence (0040,a170) + * @return const reference to sequence element + */ + const DRTPurposeOfReferenceCodeSequence &getPurposeOfReferenceCodeSequence() const + { return PurposeOfReferenceCodeSequence; } + + // --- set DICOM attribute values --- + + /** set PatientOrientation (0020,0020) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (2) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedFrameNumber (0008,1160) + * @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1-n) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPClassUID (0008,1150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPClassUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSOPInstanceUID (0008,1155) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSOPInstanceUID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedSegmentNumber (0062,000b) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1-n + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegmentNumber(const Uint16 value, const unsigned long pos = 0); + + /** set SpatialLocationsPreserved (0028,135a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpatialLocationsPreserved(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// PatientOrientation (0020,0020) vr=CS, vm=2, type=1C + DcmCodeString PatientOrientation; + /// PurposeOfReferenceCodeSequence (0040,a170) vr=SQ, vm=1, type=3 + DRTPurposeOfReferenceCodeSequence PurposeOfReferenceCodeSequence; + /// ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C + DcmIntegerString ReferencedFrameNumber; + /// ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPClassUID; + /// ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedSOPInstanceUID; + /// ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C + DcmUnsignedShort ReferencedSegmentNumber; + /// SpatialLocationsPreserved (0028,135a) vr=CS, vm=1, type=3 + DcmCodeString SpatialLocationsPreserved; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSourceImageSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSourceImageSequence(const DRTSourceImageSequence ©); + + /** destructor + */ + virtual ~DRTSourceImageSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSourceImageSequence &operator=(const DRTSourceImageSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtsns.h b/dcmrt/include/dcmtk/dcmrt/seq/drtsns.h new file mode 100644 index 00000000..44f58dae --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtsns.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSnoutSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSNS_H +#define DRTSNS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for SnoutSequence (300a,030c) + */ +class DCMTK_DCMRT_EXPORT DRTSnoutSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get SnoutID (300a,030f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSnoutID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set SnoutID (300a,030f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSnoutID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// SnoutID (300a,030f) vr=SH, vm=1, type=1 + DcmShortString SnoutID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSnoutSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSnoutSequence(const DRTSnoutSequence ©); + + /** destructor + */ + virtual ~DRTSnoutSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSnoutSequence &operator=(const DRTSnoutSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtspccs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtspccs.h new file mode 100644 index 00000000..ab4de945 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtspccs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSegmentedPropertyCategoryCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSPCCS_H +#define DRTSPCCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for SegmentedPropertyCategoryCodeSequence (0062,0003) + */ +class DCMTK_DCMRT_EXPORT DRTSegmentedPropertyCategoryCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSegmentedPropertyCategoryCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSegmentedPropertyCategoryCodeSequence(const DRTSegmentedPropertyCategoryCodeSequence ©); + + /** destructor + */ + virtual ~DRTSegmentedPropertyCategoryCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSegmentedPropertyCategoryCodeSequence &operator=(const DRTSegmentedPropertyCategoryCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtspcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtspcs.h new file mode 100644 index 00000000..b5454be3 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtspcs.h @@ -0,0 +1,560 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTScheduledProtocolCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSPCS_H +#define DRTSPCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence +#include "dcmtk/dcmrt/seq/drtpcxs.h" // for ProtocolContextSequence + + +/** Interface class for ScheduledProtocolCodeSequence (0040,0008) + */ +class DCMTK_DCMRT_EXPORT DRTScheduledProtocolCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + /** get ProtocolContextSequence (0040,0440) + * @return reference to sequence element + */ + DRTProtocolContextSequence &getProtocolContextSequence() + { return ProtocolContextSequence; } + + /** get ProtocolContextSequence (0040,0440) + * @return const reference to sequence element + */ + const DRTProtocolContextSequence &getProtocolContextSequence() const + { return ProtocolContextSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// ProtocolContextSequence (0040,0440) vr=SQ, vm=1, type=3 + DRTProtocolContextSequence ProtocolContextSequence; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTScheduledProtocolCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTScheduledProtocolCodeSequence(const DRTScheduledProtocolCodeSequence ©); + + /** destructor + */ + virtual ~DRTScheduledProtocolCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTScheduledProtocolCodeSequence &operator=(const DRTScheduledProtocolCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtspgis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtspgis.h new file mode 100644 index 00000000..3e53786e --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtspgis.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSourcePatientGroupIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSPGIS_H +#define DRTSPGIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtipiqs.h" // for IssuerOfPatientIDQualifiersSequence + + +/** Interface class for SourcePatientGroupIdentificationSequence (0010,0026) + */ +class DCMTK_DCMRT_EXPORT DRTSourcePatientGroupIdentificationSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get IssuerOfPatientID (0010,0021) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getIssuerOfPatientID(OFString &value, const signed long pos = 0) const; + + /** get PatientID (0010,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return reference to sequence element + */ + DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() + { return IssuerOfPatientIDQualifiersSequence; } + + /** get IssuerOfPatientIDQualifiersSequence (0010,0024) + * @return const reference to sequence element + */ + const DRTIssuerOfPatientIDQualifiersSequence &getIssuerOfPatientIDQualifiersSequence() const + { return IssuerOfPatientIDQualifiersSequence; } + + // --- set DICOM attribute values --- + + /** set IssuerOfPatientID (0010,0021) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIssuerOfPatientID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientID (0010,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=3 + DcmLongString IssuerOfPatientID; + /// IssuerOfPatientIDQualifiersSequence (0010,0024) vr=SQ, vm=1, type=3 + DRTIssuerOfPatientIDQualifiersSequence IssuerOfPatientIDQualifiersSequence; + /// PatientID (0010,0020) vr=LO, vm=1, type=1 + DcmLongString PatientID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSourcePatientGroupIdentificationSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSourcePatientGroupIdentificationSequence(const DRTSourcePatientGroupIdentificationSequence ©); + + /** destructor + */ + virtual ~DRTSourcePatientGroupIdentificationSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSourcePatientGroupIdentificationSequence &operator=(const DRTSourcePatientGroupIdentificationSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtsptcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtsptcs.h new file mode 100644 index 00000000..eb696a13 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtsptcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSegmentedPropertyTypeModifierCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSPTCS_H +#define DRTSPTCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for SegmentedPropertyTypeModifierCodeSequence (0062,0011) + */ +class DCMTK_DCMRT_EXPORT DRTSegmentedPropertyTypeModifierCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSegmentedPropertyTypeModifierCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSegmentedPropertyTypeModifierCodeSequence(const DRTSegmentedPropertyTypeModifierCodeSequence ©); + + /** destructor + */ + virtual ~DRTSegmentedPropertyTypeModifierCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSegmentedPropertyTypeModifierCodeSequence &operator=(const DRTSegmentedPropertyTypeModifierCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtss.h new file mode 100644 index 00000000..af8abe4a --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtss.h @@ -0,0 +1,632 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTSourceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSS_H +#define DRTSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for SourceSequence (300a,0210) + */ +class DCMTK_DCMRT_EXPORT DRTSourceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ActiveSourceDiameter (300a,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getActiveSourceDiameter(OFString &value, const signed long pos = 0) const; + + /** get ActiveSourceDiameter (300a,0218) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getActiveSourceDiameter(Float64 &value, const unsigned long pos = 0) const; + + /** get ActiveSourceLength (300a,021a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getActiveSourceLength(OFString &value, const signed long pos = 0) const; + + /** get ActiveSourceLength (300a,021a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getActiveSourceLength(Float64 &value, const unsigned long pos = 0) const; + + /** get MaterialID (300a,00e1) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMaterialID(OFString &value, const signed long pos = 0) const; + + /** get ReferenceAirKermaRate (300a,022a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferenceAirKermaRate(OFString &value, const signed long pos = 0) const; + + /** get ReferenceAirKermaRate (300a,022a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferenceAirKermaRate(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceDescription (300a,021c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceDescription(OFString &value, const signed long pos = 0) const; + + /** get SourceEncapsulationNominalThickness (300a,0222) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceEncapsulationNominalThickness(OFString &value, const signed long pos = 0) const; + + /** get SourceEncapsulationNominalThickness (300a,0222) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceEncapsulationNominalThickness(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceEncapsulationNominalTransmission (300a,0224) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceEncapsulationNominalTransmission(OFString &value, const signed long pos = 0) const; + + /** get SourceEncapsulationNominalTransmission (300a,0224) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceEncapsulationNominalTransmission(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceIsotopeHalfLife (300a,0228) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceIsotopeHalfLife(OFString &value, const signed long pos = 0) const; + + /** get SourceIsotopeHalfLife (300a,0228) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceIsotopeHalfLife(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceIsotopeName (300a,0226) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceIsotopeName(OFString &value, const signed long pos = 0) const; + + /** get SourceManufacturer (300a,0216) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceManufacturer(OFString &value, const signed long pos = 0) const; + + /** get SourceModelID (300a,021b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceModelID(OFString &value, const signed long pos = 0) const; + + /** get SourceNumber (300a,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceNumber(OFString &value, const signed long pos = 0) const; + + /** get SourceNumber (300a,0212) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get SourceSerialNumber (3008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get SourceStrength (300a,022b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceStrength(OFString &value, const signed long pos = 0) const; + + /** get SourceStrength (300a,022b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceStrength(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceStrengthReferenceDate (300a,022c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceStrengthReferenceDate(OFString &value, const signed long pos = 0) const; + + /** get SourceStrengthReferenceTime (300a,022e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceStrengthReferenceTime(OFString &value, const signed long pos = 0) const; + + /** get SourceStrengthUnits (300a,0229) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceStrengthUnits(OFString &value, const signed long pos = 0) const; + + /** get SourceType (300a,0214) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ActiveSourceDiameter (300a,0218) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setActiveSourceDiameter(const OFString &value, const OFBool check = OFTrue); + + /** set ActiveSourceLength (300a,021a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setActiveSourceLength(const OFString &value, const OFBool check = OFTrue); + + /** set MaterialID (300a,00e1) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMaterialID(const OFString &value, const OFBool check = OFTrue); + + /** set ReferenceAirKermaRate (300a,022a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferenceAirKermaRate(const OFString &value, const OFBool check = OFTrue); + + /** set SourceDescription (300a,021c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set SourceEncapsulationNominalThickness (300a,0222) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceEncapsulationNominalThickness(const OFString &value, const OFBool check = OFTrue); + + /** set SourceEncapsulationNominalTransmission (300a,0224) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceEncapsulationNominalTransmission(const OFString &value, const OFBool check = OFTrue); + + /** set SourceIsotopeHalfLife (300a,0228) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceIsotopeHalfLife(const OFString &value, const OFBool check = OFTrue); + + /** set SourceIsotopeName (300a,0226) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceIsotopeName(const OFString &value, const OFBool check = OFTrue); + + /** set SourceManufacturer (300a,0216) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set SourceModelID (300a,021b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceModelID(const OFString &value, const OFBool check = OFTrue); + + /** set SourceNumber (300a,0212) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SourceSerialNumber (3008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set SourceStrength (300a,022b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceStrength(const OFString &value, const OFBool check = OFTrue); + + /** set SourceStrengthReferenceDate (300a,022c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceStrengthReferenceDate(const OFString &value, const OFBool check = OFTrue); + + /** set SourceStrengthReferenceTime (300a,022e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceStrengthReferenceTime(const OFString &value, const OFBool check = OFTrue); + + /** set SourceStrengthUnits (300a,0229) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceStrengthUnits(const OFString &value, const OFBool check = OFTrue); + + /** set SourceType (300a,0214) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ActiveSourceDiameter (300a,0218) vr=DS, vm=1, type=3 + DcmDecimalString ActiveSourceDiameter; + /// ActiveSourceLength (300a,021a) vr=DS, vm=1, type=3 + DcmDecimalString ActiveSourceLength; + /// MaterialID (300a,00e1) vr=SH, vm=1, type=3 + DcmShortString MaterialID; + /// ReferenceAirKermaRate (300a,022a) vr=DS, vm=1, type=1 + DcmDecimalString ReferenceAirKermaRate; + /// SourceDescription (300a,021c) vr=LO, vm=1, type=3 + DcmLongString SourceDescription; + /// SourceEncapsulationNominalThickness (300a,0222) vr=DS, vm=1, type=3 + DcmDecimalString SourceEncapsulationNominalThickness; + /// SourceEncapsulationNominalTransmission (300a,0224) vr=DS, vm=1, type=3 + DcmDecimalString SourceEncapsulationNominalTransmission; + /// SourceIsotopeHalfLife (300a,0228) vr=DS, vm=1, type=1 + DcmDecimalString SourceIsotopeHalfLife; + /// SourceIsotopeName (300a,0226) vr=LO, vm=1, type=1 + DcmLongString SourceIsotopeName; + /// SourceManufacturer (300a,0216) vr=LO, vm=1, type=3 + DcmLongString SourceManufacturer; + /// SourceModelID (300a,021b) vr=SH, vm=1, type=3 + DcmShortString SourceModelID; + /// SourceNumber (300a,0212) vr=IS, vm=1, type=1 + DcmIntegerString SourceNumber; + /// SourceSerialNumber (3008,0105) vr=LO, vm=1, type=3 + DcmLongString SourceSerialNumber; + /// SourceStrength (300a,022b) vr=DS, vm=1, type=1C + DcmDecimalString SourceStrength; + /// SourceStrengthReferenceDate (300a,022c) vr=DA, vm=1, type=1 + DcmDate SourceStrengthReferenceDate; + /// SourceStrengthReferenceTime (300a,022e) vr=TM, vm=1, type=1 + DcmTime SourceStrengthReferenceTime; + /// SourceStrengthUnits (300a,0229) vr=CS, vm=1, type=1C + DcmCodeString SourceStrengthUnits; + /// SourceType (300a,0214) vr=CS, vm=1, type=1 + DcmCodeString SourceType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTSourceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTSourceSequence(const DRTSourceSequence ©); + + /** destructor + */ + virtual ~DRTSourceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTSourceSequence &operator=(const DRTSourceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtssrcs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtssrcs.h new file mode 100644 index 00000000..e05d9728 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtssrcs.h @@ -0,0 +1,545 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTStrainSourceRegistryCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSSRCS_H +#define DRTSSRCS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtecs.h" // for EquivalentCodeSequence + + +/** Interface class for StrainSourceRegistryCodeSequence (0010,0215) + */ +class DCMTK_DCMRT_EXPORT DRTStrainSourceRegistryCodeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CodeMeaning (0008,0104) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeMeaning(OFString &value, const signed long pos = 0) const; + + /** get CodeValue (0008,0100) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeDesignator (0008,0102) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeDesignator(OFString &value, const signed long pos = 0) const; + + /** get CodingSchemeVersion (0008,0103) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodingSchemeVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionCreatorUID (0008,010d) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionCreatorUID(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupExtensionFlag (0008,010b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupExtensionFlag(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupLocalVersion (0008,0107) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupLocalVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextGroupVersion (0008,0106) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextGroupVersion(OFString &value, const signed long pos = 0) const; + + /** get ContextIdentifier (0008,010f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextIdentifier(OFString &value, const signed long pos = 0) const; + + /** get ContextUID (0008,0117) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getContextUID(OFString &value, const signed long pos = 0) const; + + /** get LongCodeValue (0008,0119) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLongCodeValue(OFString &value, const signed long pos = 0) const; + + /** get MappingResource (0008,0105) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResource(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceName (0008,0122) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceName(OFString &value, const signed long pos = 0) const; + + /** get MappingResourceUID (0008,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getMappingResourceUID(OFString &value, const signed long pos = 0) const; + + /** get URNCodeValue (0008,0120) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getURNCodeValue(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get EquivalentCodeSequence (0008,0121) + * @return reference to sequence element + */ + DRTEquivalentCodeSequence &getEquivalentCodeSequence() + { return EquivalentCodeSequence; } + + /** get EquivalentCodeSequence (0008,0121) + * @return const reference to sequence element + */ + const DRTEquivalentCodeSequence &getEquivalentCodeSequence() const + { return EquivalentCodeSequence; } + + // --- set DICOM attribute values --- + + /** set CodeMeaning (0008,0104) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeMeaning(const OFString &value, const OFBool check = OFTrue); + + /** set CodeValue (0008,0100) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeDesignator (0008,0102) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeDesignator(const OFString &value, const OFBool check = OFTrue); + + /** set CodingSchemeVersion (0008,0103) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionCreatorUID (0008,010d) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupExtensionFlag (0008,010b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupExtensionFlag(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupLocalVersion (0008,0107) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupLocalVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextGroupVersion (0008,0106) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextGroupVersion(const OFString &value, const OFBool check = OFTrue); + + /** set ContextIdentifier (0008,010f) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextIdentifier(const OFString &value, const OFBool check = OFTrue); + + /** set ContextUID (0008,0117) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContextUID(const OFString &value, const OFBool check = OFTrue); + + /** set LongCodeValue (0008,0119) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UC) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLongCodeValue(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResource (0008,0105) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResource(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceName (0008,0122) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceName(const OFString &value, const OFBool check = OFTrue); + + /** set MappingResourceUID (0008,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMappingResourceUID(const OFString &value, const OFBool check = OFTrue); + + /** set URNCodeValue (0008,0120) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setURNCodeValue(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CodeMeaning (0008,0104) vr=LO, vm=1, type=1 + DcmLongString CodeMeaning; + /// CodeValue (0008,0100) vr=SH, vm=1, type=1C + DcmShortString CodeValue; + /// CodingSchemeDesignator (0008,0102) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeDesignator; + /// CodingSchemeVersion (0008,0103) vr=SH, vm=1, type=1C + DcmShortString CodingSchemeVersion; + /// ContextGroupExtensionCreatorUID (0008,010d) vr=UI, vm=1, type=1C + DcmUniqueIdentifier ContextGroupExtensionCreatorUID; + /// ContextGroupExtensionFlag (0008,010b) vr=CS, vm=1, type=3 + DcmCodeString ContextGroupExtensionFlag; + /// ContextGroupLocalVersion (0008,0107) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupLocalVersion; + /// ContextGroupVersion (0008,0106) vr=DT, vm=1, type=1C + DcmDateTime ContextGroupVersion; + /// ContextIdentifier (0008,010f) vr=CS, vm=1, type=3 + DcmCodeString ContextIdentifier; + /// ContextUID (0008,0117) vr=UI, vm=1, type=3 + DcmUniqueIdentifier ContextUID; + /// EquivalentCodeSequence (0008,0121) vr=SQ, vm=1, type=3 + DRTEquivalentCodeSequence EquivalentCodeSequence; + /// LongCodeValue (0008,0119) vr=UC, vm=1, type=1C + DcmUnlimitedCharacters LongCodeValue; + /// MappingResource (0008,0105) vr=CS, vm=1, type=1C + DcmCodeString MappingResource; + /// MappingResourceName (0008,0122) vr=LO, vm=1, type=3 + DcmLongString MappingResourceName; + /// MappingResourceUID (0008,0118) vr=UI, vm=1, type=3 + DcmUniqueIdentifier MappingResourceUID; + /// URNCodeValue (0008,0120) vr=UR, vm=1, type=1C + DcmUniversalResourceIdentifierOrLocator URNCodeValue; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTStrainSourceRegistryCodeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTStrainSourceRegistryCodeSequence(const DRTStrainSourceRegistryCodeSequence ©); + + /** destructor + */ + virtual ~DRTStrainSourceRegistryCodeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTStrainSourceRegistryCodeSequence &operator=(const DRTStrainSourceRegistryCodeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtssrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtssrs.h new file mode 100644 index 00000000..ddc3c5bb --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtssrs.h @@ -0,0 +1,431 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTStructureSetROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSSRS_H +#define DRTSSRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtdcs.h" // for DerivationCodeSequence + + +/** Interface class for StructureSetROISequence (3006,0020) + */ +class DCMTK_DCMRT_EXPORT DRTStructureSetROISequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ROIDescription (3006,0028) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIDescription(OFString &value, const signed long pos = 0) const; + + /** get ROIGenerationAlgorithm (3006,0036) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIGenerationAlgorithm(OFString &value, const signed long pos = 0) const; + + /** get ROIGenerationDescription (3006,0038) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIGenerationDescription(OFString &value, const signed long pos = 0) const; + + /** get ROIName (3006,0026) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIName(OFString &value, const signed long pos = 0) const; + + /** get ROINumber (3006,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROINumber(OFString &value, const signed long pos = 0) const; + + /** get ROINumber (3006,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROINumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ROIVolume (3006,002c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIVolume(OFString &value, const signed long pos = 0) const; + + /** get ROIVolume (3006,002c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getROIVolume(Float64 &value, const unsigned long pos = 0) const; + + /** get ReferencedFrameOfReferenceUID (3006,0024) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedFrameOfReferenceUID(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get DerivationCodeSequence (0008,9215) + * @return reference to sequence element + */ + DRTDerivationCodeSequence &getDerivationCodeSequence() + { return DerivationCodeSequence; } + + /** get DerivationCodeSequence (0008,9215) + * @return const reference to sequence element + */ + const DRTDerivationCodeSequence &getDerivationCodeSequence() const + { return DerivationCodeSequence; } + + // --- set DICOM attribute values --- + + /** set ROIDescription (3006,0028) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ROIGenerationAlgorithm (3006,0036) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIGenerationAlgorithm(const OFString &value, const OFBool check = OFTrue); + + /** set ROIGenerationDescription (3006,0038) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIGenerationDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ROIName (3006,0026) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIName(const OFString &value, const OFBool check = OFTrue); + + /** set ROINumber (3006,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROINumber(const OFString &value, const OFBool check = OFTrue); + + /** set ROIVolume (3006,002c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setROIVolume(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedFrameOfReferenceUID (3006,0024) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedFrameOfReferenceUID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DerivationCodeSequence (0008,9215) vr=SQ, vm=1, type=3 + DRTDerivationCodeSequence DerivationCodeSequence; + /// ROIDescription (3006,0028) vr=ST, vm=1, type=3 + DcmShortText ROIDescription; + /// ROIGenerationAlgorithm (3006,0036) vr=CS, vm=1, type=2 + DcmCodeString ROIGenerationAlgorithm; + /// ROIGenerationDescription (3006,0038) vr=LO, vm=1, type=3 + DcmLongString ROIGenerationDescription; + /// ROIName (3006,0026) vr=LO, vm=1, type=2 + DcmLongString ROIName; + /// ROINumber (3006,0022) vr=IS, vm=1, type=1 + DcmIntegerString ROINumber; + /// ROIVolume (3006,002c) vr=DS, vm=1, type=3 + DcmDecimalString ROIVolume; + /// ReferencedFrameOfReferenceUID (3006,0024) vr=UI, vm=1, type=1 + DcmUniqueIdentifier ReferencedFrameOfReferenceUID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTStructureSetROISequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTStructureSetROISequence(const DRTStructureSetROISequence ©); + + /** destructor + */ + virtual ~DRTStructureSetROISequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTStructureSetROISequence &operator=(const DRTStructureSetROISequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtsss.h b/dcmrt/include/dcmtk/dcmrt/seq/drtsss.h new file mode 100644 index 00000000..3bfc4aa5 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtsss.h @@ -0,0 +1,337 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTStrainStockSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTSSS_H +#define DRTSSS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtssrcs.h" // for StrainSourceRegistryCodeSequence + + +/** Interface class for StrainStockSequence (0010,0216) + */ +class DCMTK_DCMRT_EXPORT DRTStrainStockSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get StrainSource (0010,0217) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStrainSource(OFString &value, const signed long pos = 0) const; + + /** get StrainStockNumber (0010,0214) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getStrainStockNumber(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get StrainSourceRegistryCodeSequence (0010,0215) + * @return reference to sequence element + */ + DRTStrainSourceRegistryCodeSequence &getStrainSourceRegistryCodeSequence() + { return StrainSourceRegistryCodeSequence; } + + /** get StrainSourceRegistryCodeSequence (0010,0215) + * @return const reference to sequence element + */ + const DRTStrainSourceRegistryCodeSequence &getStrainSourceRegistryCodeSequence() const + { return StrainSourceRegistryCodeSequence; } + + // --- set DICOM attribute values --- + + /** set StrainSource (0010,0217) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStrainSource(const OFString &value, const OFBool check = OFTrue); + + /** set StrainStockNumber (0010,0214) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStrainStockNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// StrainSource (0010,0217) vr=LO, vm=1, type=1 + DcmLongString StrainSource; + /// StrainSourceRegistryCodeSequence (0010,0215) vr=SQ, vm=1, type=1 + DRTStrainSourceRegistryCodeSequence StrainSourceRegistryCodeSequence; + /// StrainStockNumber (0010,0214) vr=LO, vm=1, type=1 + DcmLongString StrainStockNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTStrainStockSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTStrainStockSequence(const DRTStrainStockSequence ©); + + /** destructor + */ + virtual ~DRTStrainStockSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTStrainStockSequence &operator=(const DRTStrainStockSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drttms0.h b/dcmrt/include/dcmtk/dcmrt/seq/drttms0.h new file mode 100644 index 00000000..3931d37f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drttms0.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTTMS0_H +#define DRTTMS0_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for TreatmentMachineSequence (300a,0206) in RTTreatmentMachineRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get TreatmentMachineName (300a,00b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentMachineName(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentMachineName (300a,00b2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentMachineName(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=2 + DcmLongString DeviceSerialNumber; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=2 + DcmLongString InstitutionName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// Manufacturer (0008,0070) vr=LO, vm=1, type=2 + DcmLongString Manufacturer; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=2 + DcmLongString ManufacturerModelName; + /// TreatmentMachineName (300a,00b2) vr=SH, vm=1, type=2 + DcmShortString TreatmentMachineName; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule(const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule ©); + + /** destructor + */ + virtual ~DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule &operator=(const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drttms9.h b/dcmrt/include/dcmtk/dcmrt/seq/drttms9.h new file mode 100644 index 00000000..41a76062 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drttms9.h @@ -0,0 +1,400 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTTMS9_H +#define DRTTMS9_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for TreatmentMachineSequence (300a,0206) in RTBrachyApplicationSetupsModule + */ +class DCMTK_DCMRT_EXPORT DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DeviceSerialNumber (0018,1000) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceSerialNumber(OFString &value, const signed long pos = 0) const; + + /** get InstitutionAddress (0008,0081) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionAddress(OFString &value, const signed long pos = 0) const; + + /** get InstitutionName (0008,0080) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionName(OFString &value, const signed long pos = 0) const; + + /** get InstitutionalDepartmentName (0008,1040) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getInstitutionalDepartmentName(OFString &value, const signed long pos = 0) const; + + /** get Manufacturer (0008,0070) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturer(OFString &value, const signed long pos = 0) const; + + /** get ManufacturerModelName (0008,1090) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getManufacturerModelName(OFString &value, const signed long pos = 0) const; + + /** get TreatmentMachineName (300a,00b2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentMachineName(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DeviceSerialNumber (0018,1000) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceSerialNumber(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionAddress (0008,0081) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionAddress(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionName (0008,0080) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionName(const OFString &value, const OFBool check = OFTrue); + + /** set InstitutionalDepartmentName (0008,1040) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setInstitutionalDepartmentName(const OFString &value, const OFBool check = OFTrue); + + /** set Manufacturer (0008,0070) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturer(const OFString &value, const OFBool check = OFTrue); + + /** set ManufacturerModelName (0008,1090) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setManufacturerModelName(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentMachineName (300a,00b2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentMachineName(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DeviceSerialNumber (0018,1000) vr=LO, vm=1, type=3 + DcmLongString DeviceSerialNumber; + /// InstitutionAddress (0008,0081) vr=ST, vm=1, type=3 + DcmShortText InstitutionAddress; + /// InstitutionName (0008,0080) vr=LO, vm=1, type=3 + DcmLongString InstitutionName; + /// InstitutionalDepartmentName (0008,1040) vr=LO, vm=1, type=3 + DcmLongString InstitutionalDepartmentName; + /// Manufacturer (0008,0070) vr=LO, vm=1, type=3 + DcmLongString Manufacturer; + /// ManufacturerModelName (0008,1090) vr=LO, vm=1, type=3 + DcmLongString ManufacturerModelName; + /// TreatmentMachineName (300a,00b2) vr=SH, vm=1, type=2 + DcmShortString TreatmentMachineName; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule(const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule ©); + + /** destructor + */ + virtual ~DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule &operator=(const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drttscds.h b/dcmrt/include/dcmtk/dcmrt/seq/drttscds.h new file mode 100644 index 00000000..6684d28b --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drttscds.h @@ -0,0 +1,350 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTTreatmentSummaryCalculatedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTTSCDS_H +#define DRTTSCDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for TreatmentSummaryCalculatedDoseReferenceSequence (3008,0050) + */ +class DCMTK_DCMRT_EXPORT DRTTreatmentSummaryCalculatedDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CumulativeDoseToDoseReference (3008,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseToDoseReference(OFString &value, const signed long pos = 0) const; + + /** get CumulativeDoseToDoseReference (3008,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseToDoseReference(Float64 &value, const unsigned long pos = 0) const; + + /** get DoseReferenceDescription (300a,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceDescription(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CumulativeDoseToDoseReference (3008,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeDoseToDoseReference(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferenceDescription (300a,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferenceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CumulativeDoseToDoseReference (3008,0052) vr=DS, vm=1, type=1 + DcmDecimalString CumulativeDoseToDoseReference; + /// DoseReferenceDescription (300a,0016) vr=LO, vm=1, type=3 + DcmLongString DoseReferenceDescription; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTTreatmentSummaryCalculatedDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTTreatmentSummaryCalculatedDoseReferenceSequence(const DRTTreatmentSummaryCalculatedDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTTreatmentSummaryCalculatedDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTTreatmentSummaryCalculatedDoseReferenceSequence &operator=(const DRTTreatmentSummaryCalculatedDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drttsibs.h b/dcmrt/include/dcmtk/dcmrt/seq/drttsibs.h new file mode 100644 index 00000000..7ba86b29 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drttsibs.h @@ -0,0 +1,1262 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTTreatmentSessionIonBeamSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTTSIBS_H +#define DRTTSIBS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtas7.h" // for ApplicatorSequence +#include "dcmtk/dcmrt/seq/drtbldls.h" // for BeamLimitingDeviceLeafPairsSequence +#include "dcmtk/dcmrt/seq/drtdddps.h" // for DeliveredDepthDoseParametersSequence +#include "dcmtk/dcmrt/seq/drtgas.h" // for GeneralAccessorySequence +#include "dcmtk/dcmrt/seq/drticpds.h" // for IonControlPointDeliverySequence +#include "dcmtk/dcmrt/seq/drtrbls.h" // for RecordedBlockSequence +#include "dcmtk/dcmrt/seq/drtrcos.h" // for RecordedCompensatorSequence +#include "dcmtk/dcmrt/seq/drtrlsds.h" // for RecordedLateralSpreadingDeviceSequence +#include "dcmtk/dcmrt/seq/drtrrms.h" // for RecordedRangeModulatorSequence +#include "dcmtk/dcmrt/seq/drtrrshs.h" // for RecordedRangeShifterSequence +#include "dcmtk/dcmrt/seq/drtrsns.h" // for RecordedSnoutSequence +#include "dcmtk/dcmrt/seq/drtrws.h" // for RecordedWedgeSequence +#include "dcmtk/dcmrt/seq/drtrbos7.h" // for ReferencedBolusSequence +#include "dcmtk/dcmrt/seq/drtrcdrs.h" // for ReferencedCalculatedDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtrmdrs.h" // for ReferencedMeasuredDoseReferenceSequence +#include "dcmtk/dcmrt/seq/drtrvis.h" // for ReferencedVerificationImageSequence + + +/** Interface class for TreatmentSessionIonBeamSequence (3008,0021) in RTIonBeamsSessionRecordModule + */ +class DCMTK_DCMRT_EXPORT DRTTreatmentSessionIonBeamSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamDescription (300a,00c3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamDescription(OFString &value, const signed long pos = 0) const; + + /** get BeamName (300a,00c2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamName(OFString &value, const signed long pos = 0) const; + + /** get BeamType (300a,00c4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamType(OFString &value, const signed long pos = 0) const; + + /** get CurrentFractionNumber (3008,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentFractionNumber(OFString &value, const signed long pos = 0) const; + + /** get CurrentFractionNumber (3008,0022) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentFractionNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get DeliveredPrimaryMeterset (3008,0036) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredPrimaryMeterset(OFString &value, const signed long pos = 0) const; + + /** get DeliveredPrimaryMeterset (3008,0036) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredPrimaryMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get DeliveredSecondaryMeterset (3008,0037) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredSecondaryMeterset(OFString &value, const signed long pos = 0) const; + + /** get DeliveredSecondaryMeterset (3008,0037) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredSecondaryMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get DeliveredTreatmentTime (3008,003b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredTreatmentTime(OFString &value, const signed long pos = 0) const; + + /** get DeliveredTreatmentTime (3008,003b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeliveredTreatmentTime(Float64 &value, const unsigned long pos = 0) const; + + /** get FixationEye (300a,0150) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationEye(OFString &value, const signed long pos = 0) const; + + /** get FixationLightAzimuthalAngle (300a,0356) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightAzimuthalAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get FixationLightPolarAngle (300a,0358) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getFixationLightPolarAngle(Float32 &value, const unsigned long pos = 0) const; + + /** get ModulatedScanModeType (300a,0309) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getModulatedScanModeType(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBlocks (300a,00f0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBlocks(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfBoli (300a,00ed) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBoli(OFString &value, const signed long pos = 0) const; + + /** get NumberOfBoli (300a,00ed) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfBoli(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfCompensators (300a,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfCompensators(OFString &value, const signed long pos = 0) const; + + /** get NumberOfCompensators (300a,00e0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfCompensators(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(OFString &value, const signed long pos = 0) const; + + /** get NumberOfControlPoints (300a,0110) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfControlPoints(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfLateralSpreadingDevices (300a,0330) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLateralSpreadingDevices(OFString &value, const signed long pos = 0) const; + + /** get NumberOfLateralSpreadingDevices (300a,0330) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfLateralSpreadingDevices(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfRangeModulators (300a,0340) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeModulators(OFString &value, const signed long pos = 0) const; + + /** get NumberOfRangeModulators (300a,0340) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeModulators(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfRangeShifters (300a,0312) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeShifters(OFString &value, const signed long pos = 0) const; + + /** get NumberOfRangeShifters (300a,0312) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfRangeShifters(Sint32 &value, const unsigned long pos = 0) const; + + /** get NumberOfWedges (300a,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfWedges(OFString &value, const signed long pos = 0) const; + + /** get NumberOfWedges (300a,00d0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumberOfWedges(Sint32 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAccessoryCode (300a,0354) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportID (300a,0352) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportID(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportType (300a,0350) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportType(OFString &value, const signed long pos = 0) const; + + /** get RadiationAtomicNumber (300a,0304) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationAtomicNumber(OFString &value, const signed long pos = 0) const; + + /** get RadiationAtomicNumber (300a,0304) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationAtomicNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get RadiationChargeState (300a,0306) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationChargeState(Sint16 &value, const unsigned long pos = 0) const; + + /** get RadiationMassNumber (300a,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationMassNumber(OFString &value, const signed long pos = 0) const; + + /** get RadiationMassNumber (300a,0302) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationMassNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get RadiationType (300a,00c6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRadiationType(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedBeamNumber (300c,0006) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedBeamNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedPatientSetupNumber (300c,006a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedPatientSetupNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedPatientSetupNumber (300c,006a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedPatientSetupNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ReferencedToleranceTableNumber (300c,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedToleranceTableNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedToleranceTableNumber (300c,00a0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedToleranceTableNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get ScanMode (300a,0308) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getScanMode(OFString &value, const signed long pos = 0) const; + + /** get SpecifiedPrimaryMeterset (3008,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedPrimaryMeterset(OFString &value, const signed long pos = 0) const; + + /** get SpecifiedPrimaryMeterset (3008,0032) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedPrimaryMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecifiedSecondaryMeterset (3008,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedSecondaryMeterset(OFString &value, const signed long pos = 0) const; + + /** get SpecifiedSecondaryMeterset (3008,0033) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedSecondaryMeterset(Float64 &value, const unsigned long pos = 0) const; + + /** get SpecifiedTreatmentTime (3008,003a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedTreatmentTime(OFString &value, const signed long pos = 0) const; + + /** get SpecifiedTreatmentTime (3008,003a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpecifiedTreatmentTime(Float64 &value, const unsigned long pos = 0) const; + + /** get TreatmentDeliveryType (300a,00ce) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentDeliveryType(OFString &value, const signed long pos = 0) const; + + /** get TreatmentTerminationCode (3008,002b) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentTerminationCode(OFString &value, const signed long pos = 0) const; + + /** get TreatmentTerminationStatus (3008,002a) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentTerminationStatus(OFString &value, const signed long pos = 0) const; + + /** get TreatmentVerificationStatus (3008,002c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTreatmentVerificationStatus(OFString &value, const signed long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get ApplicatorSequence (300a,0107) + * @return reference to sequence element + */ + DRTApplicatorSequenceInRTIonBeamsSessionRecordModule &getApplicatorSequence() + { return ApplicatorSequence; } + + /** get ApplicatorSequence (300a,0107) + * @return const reference to sequence element + */ + const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule &getApplicatorSequence() const + { return ApplicatorSequence; } + + /** get BeamLimitingDeviceLeafPairsSequence (3008,00a0) + * @return reference to sequence element + */ + DRTBeamLimitingDeviceLeafPairsSequence &getBeamLimitingDeviceLeafPairsSequence() + { return BeamLimitingDeviceLeafPairsSequence; } + + /** get BeamLimitingDeviceLeafPairsSequence (3008,00a0) + * @return const reference to sequence element + */ + const DRTBeamLimitingDeviceLeafPairsSequence &getBeamLimitingDeviceLeafPairsSequence() const + { return BeamLimitingDeviceLeafPairsSequence; } + + /** get DeliveredDepthDoseParametersSequence (300a,0506) + * @return reference to sequence element + */ + DRTDeliveredDepthDoseParametersSequence &getDeliveredDepthDoseParametersSequence() + { return DeliveredDepthDoseParametersSequence; } + + /** get DeliveredDepthDoseParametersSequence (300a,0506) + * @return const reference to sequence element + */ + const DRTDeliveredDepthDoseParametersSequence &getDeliveredDepthDoseParametersSequence() const + { return DeliveredDepthDoseParametersSequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return reference to sequence element + */ + DRTGeneralAccessorySequence &getGeneralAccessorySequence() + { return GeneralAccessorySequence; } + + /** get GeneralAccessorySequence (300a,0420) + * @return const reference to sequence element + */ + const DRTGeneralAccessorySequence &getGeneralAccessorySequence() const + { return GeneralAccessorySequence; } + + /** get IonControlPointDeliverySequence (3008,0041) + * @return reference to sequence element + */ + DRTIonControlPointDeliverySequence &getIonControlPointDeliverySequence() + { return IonControlPointDeliverySequence; } + + /** get IonControlPointDeliverySequence (3008,0041) + * @return const reference to sequence element + */ + const DRTIonControlPointDeliverySequence &getIonControlPointDeliverySequence() const + { return IonControlPointDeliverySequence; } + + /** get RecordedBlockSequence (3008,00d0) + * @return reference to sequence element + */ + DRTRecordedBlockSequence &getRecordedBlockSequence() + { return RecordedBlockSequence; } + + /** get RecordedBlockSequence (3008,00d0) + * @return const reference to sequence element + */ + const DRTRecordedBlockSequence &getRecordedBlockSequence() const + { return RecordedBlockSequence; } + + /** get RecordedCompensatorSequence (3008,00c0) + * @return reference to sequence element + */ + DRTRecordedCompensatorSequence &getRecordedCompensatorSequence() + { return RecordedCompensatorSequence; } + + /** get RecordedCompensatorSequence (3008,00c0) + * @return const reference to sequence element + */ + const DRTRecordedCompensatorSequence &getRecordedCompensatorSequence() const + { return RecordedCompensatorSequence; } + + /** get RecordedLateralSpreadingDeviceSequence (3008,00f4) + * @return reference to sequence element + */ + DRTRecordedLateralSpreadingDeviceSequence &getRecordedLateralSpreadingDeviceSequence() + { return RecordedLateralSpreadingDeviceSequence; } + + /** get RecordedLateralSpreadingDeviceSequence (3008,00f4) + * @return const reference to sequence element + */ + const DRTRecordedLateralSpreadingDeviceSequence &getRecordedLateralSpreadingDeviceSequence() const + { return RecordedLateralSpreadingDeviceSequence; } + + /** get RecordedRangeModulatorSequence (3008,00f6) + * @return reference to sequence element + */ + DRTRecordedRangeModulatorSequence &getRecordedRangeModulatorSequence() + { return RecordedRangeModulatorSequence; } + + /** get RecordedRangeModulatorSequence (3008,00f6) + * @return const reference to sequence element + */ + const DRTRecordedRangeModulatorSequence &getRecordedRangeModulatorSequence() const + { return RecordedRangeModulatorSequence; } + + /** get RecordedRangeShifterSequence (3008,00f2) + * @return reference to sequence element + */ + DRTRecordedRangeShifterSequence &getRecordedRangeShifterSequence() + { return RecordedRangeShifterSequence; } + + /** get RecordedRangeShifterSequence (3008,00f2) + * @return const reference to sequence element + */ + const DRTRecordedRangeShifterSequence &getRecordedRangeShifterSequence() const + { return RecordedRangeShifterSequence; } + + /** get RecordedSnoutSequence (3008,00f0) + * @return reference to sequence element + */ + DRTRecordedSnoutSequence &getRecordedSnoutSequence() + { return RecordedSnoutSequence; } + + /** get RecordedSnoutSequence (3008,00f0) + * @return const reference to sequence element + */ + const DRTRecordedSnoutSequence &getRecordedSnoutSequence() const + { return RecordedSnoutSequence; } + + /** get RecordedWedgeSequence (3008,00b0) + * @return reference to sequence element + */ + DRTRecordedWedgeSequence &getRecordedWedgeSequence() + { return RecordedWedgeSequence; } + + /** get RecordedWedgeSequence (3008,00b0) + * @return const reference to sequence element + */ + const DRTRecordedWedgeSequence &getRecordedWedgeSequence() const + { return RecordedWedgeSequence; } + + /** get ReferencedBolusSequence (300c,00b0) + * @return reference to sequence element + */ + DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule &getReferencedBolusSequence() + { return ReferencedBolusSequence; } + + /** get ReferencedBolusSequence (300c,00b0) + * @return const reference to sequence element + */ + const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule &getReferencedBolusSequence() const + { return ReferencedBolusSequence; } + + /** get ReferencedCalculatedDoseReferenceSequence (3008,0090) + * @return reference to sequence element + */ + DRTReferencedCalculatedDoseReferenceSequence &getReferencedCalculatedDoseReferenceSequence() + { return ReferencedCalculatedDoseReferenceSequence; } + + /** get ReferencedCalculatedDoseReferenceSequence (3008,0090) + * @return const reference to sequence element + */ + const DRTReferencedCalculatedDoseReferenceSequence &getReferencedCalculatedDoseReferenceSequence() const + { return ReferencedCalculatedDoseReferenceSequence; } + + /** get ReferencedMeasuredDoseReferenceSequence (3008,0080) + * @return reference to sequence element + */ + DRTReferencedMeasuredDoseReferenceSequence &getReferencedMeasuredDoseReferenceSequence() + { return ReferencedMeasuredDoseReferenceSequence; } + + /** get ReferencedMeasuredDoseReferenceSequence (3008,0080) + * @return const reference to sequence element + */ + const DRTReferencedMeasuredDoseReferenceSequence &getReferencedMeasuredDoseReferenceSequence() const + { return ReferencedMeasuredDoseReferenceSequence; } + + /** get ReferencedVerificationImageSequence (300c,0040) + * @return reference to sequence element + */ + DRTReferencedVerificationImageSequence &getReferencedVerificationImageSequence() + { return ReferencedVerificationImageSequence; } + + /** get ReferencedVerificationImageSequence (300c,0040) + * @return const reference to sequence element + */ + const DRTReferencedVerificationImageSequence &getReferencedVerificationImageSequence() const + { return ReferencedVerificationImageSequence; } + + // --- set DICOM attribute values --- + + /** set BeamDescription (300a,00c3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamDescription(const OFString &value, const OFBool check = OFTrue); + + /** set BeamName (300a,00c2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamName(const OFString &value, const OFBool check = OFTrue); + + /** set BeamType (300a,00c4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamType(const OFString &value, const OFBool check = OFTrue); + + /** set CurrentFractionNumber (3008,0022) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCurrentFractionNumber(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveredPrimaryMeterset (3008,0036) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredPrimaryMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveredSecondaryMeterset (3008,0037) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredSecondaryMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set DeliveredTreatmentTime (3008,003b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeliveredTreatmentTime(const OFString &value, const OFBool check = OFTrue); + + /** set FixationEye (300a,0150) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationEye(const OFString &value, const OFBool check = OFTrue); + + /** set FixationLightAzimuthalAngle (300a,0356) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationLightAzimuthalAngle(const Float32 value, const unsigned long pos = 0); + + /** set FixationLightPolarAngle (300a,0358) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFixationLightPolarAngle(const Float32 value, const unsigned long pos = 0); + + /** set ModulatedScanModeType (300a,0309) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setModulatedScanModeType(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBlocks (300a,00f0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBlocks(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfBoli (300a,00ed) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfBoli(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfCompensators (300a,00e0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfCompensators(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfControlPoints (300a,0110) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfControlPoints(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfLateralSpreadingDevices (300a,0330) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfLateralSpreadingDevices(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfRangeModulators (300a,0340) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfRangeModulators(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfRangeShifters (300a,0312) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfRangeShifters(const OFString &value, const OFBool check = OFTrue); + + /** set NumberOfWedges (300a,00d0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumberOfWedges(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportAccessoryCode (300a,0354) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportID (300a,0352) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportID(const OFString &value, const OFBool check = OFTrue); + + /** set PatientSupportType (300a,0350) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportType(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationAtomicNumber (300a,0304) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationAtomicNumber(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationChargeState (300a,0306) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationChargeState(const Sint16 value, const unsigned long pos = 0); + + /** set RadiationMassNumber (300a,0302) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationMassNumber(const OFString &value, const OFBool check = OFTrue); + + /** set RadiationType (300a,00c6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRadiationType(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedBeamNumber (300c,0006) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedBeamNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedPatientSetupNumber (300c,006a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedPatientSetupNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedToleranceTableNumber (300c,00a0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedToleranceTableNumber(const OFString &value, const OFBool check = OFTrue); + + /** set ScanMode (300a,0308) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setScanMode(const OFString &value, const OFBool check = OFTrue); + + /** set SpecifiedPrimaryMeterset (3008,0032) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpecifiedPrimaryMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set SpecifiedSecondaryMeterset (3008,0033) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpecifiedSecondaryMeterset(const OFString &value, const OFBool check = OFTrue); + + /** set SpecifiedTreatmentTime (3008,003a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpecifiedTreatmentTime(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentDeliveryType (300a,00ce) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentDeliveryType(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentTerminationCode (3008,002b) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentTerminationCode(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentTerminationStatus (3008,002a) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentTerminationStatus(const OFString &value, const OFBool check = OFTrue); + + /** set TreatmentVerificationStatus (3008,002c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTreatmentVerificationStatus(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ApplicatorSequence (300a,0107) vr=SQ, vm=1, type=1C + DRTApplicatorSequenceInRTIonBeamsSessionRecordModule ApplicatorSequence; + /// BeamDescription (300a,00c3) vr=ST, vm=1, type=3 + DcmShortText BeamDescription; + /// BeamLimitingDeviceLeafPairsSequence (3008,00a0) vr=SQ, vm=1, type=3 + DRTBeamLimitingDeviceLeafPairsSequence BeamLimitingDeviceLeafPairsSequence; + /// BeamName (300a,00c2) vr=LO, vm=1, type=1 + DcmLongString BeamName; + /// BeamType (300a,00c4) vr=CS, vm=1, type=1 + DcmCodeString BeamType; + /// CurrentFractionNumber (3008,0022) vr=IS, vm=1, type=2 + DcmIntegerString CurrentFractionNumber; + /// DeliveredDepthDoseParametersSequence (300a,0506) vr=SQ, vm=1, type=3 + DRTDeliveredDepthDoseParametersSequence DeliveredDepthDoseParametersSequence; + /// DeliveredPrimaryMeterset (3008,0036) vr=DS, vm=1, type=3 + DcmDecimalString DeliveredPrimaryMeterset; + /// DeliveredSecondaryMeterset (3008,0037) vr=DS, vm=1, type=3 + DcmDecimalString DeliveredSecondaryMeterset; + /// DeliveredTreatmentTime (3008,003b) vr=DS, vm=1, type=3 + DcmDecimalString DeliveredTreatmentTime; + /// FixationEye (300a,0150) vr=CS, vm=1, type=3 + DcmCodeString FixationEye; + /// FixationLightAzimuthalAngle (300a,0356) vr=FL, vm=1, type=3 + DcmFloatingPointSingle FixationLightAzimuthalAngle; + /// FixationLightPolarAngle (300a,0358) vr=FL, vm=1, type=3 + DcmFloatingPointSingle FixationLightPolarAngle; + /// GeneralAccessorySequence (300a,0420) vr=SQ, vm=1, type=3 + DRTGeneralAccessorySequence GeneralAccessorySequence; + /// IonControlPointDeliverySequence (3008,0041) vr=SQ, vm=1, type=1 + DRTIonControlPointDeliverySequence IonControlPointDeliverySequence; + /// ModulatedScanModeType (300a,0309) vr=CS, vm=1, type=1C + DcmCodeString ModulatedScanModeType; + /// NumberOfBlocks (300a,00f0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBlocks; + /// NumberOfBoli (300a,00ed) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfBoli; + /// NumberOfCompensators (300a,00e0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfCompensators; + /// NumberOfControlPoints (300a,0110) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfControlPoints; + /// NumberOfLateralSpreadingDevices (300a,0330) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfLateralSpreadingDevices; + /// NumberOfRangeModulators (300a,0340) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfRangeModulators; + /// NumberOfRangeShifters (300a,0312) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfRangeShifters; + /// NumberOfWedges (300a,00d0) vr=IS, vm=1, type=1 + DcmIntegerString NumberOfWedges; + /// PatientSupportAccessoryCode (300a,0354) vr=LO, vm=1, type=3 + DcmLongString PatientSupportAccessoryCode; + /// PatientSupportID (300a,0352) vr=SH, vm=1, type=3 + DcmShortString PatientSupportID; + /// PatientSupportType (300a,0350) vr=CS, vm=1, type=1 + DcmCodeString PatientSupportType; + /// RadiationAtomicNumber (300a,0304) vr=IS, vm=1, type=1C + DcmIntegerString RadiationAtomicNumber; + /// RadiationChargeState (300a,0306) vr=SS, vm=1, type=1C + DcmSignedShort RadiationChargeState; + /// RadiationMassNumber (300a,0302) vr=IS, vm=1, type=1C + DcmIntegerString RadiationMassNumber; + /// RadiationType (300a,00c6) vr=CS, vm=1, type=1 + DcmCodeString RadiationType; + /// RecordedBlockSequence (3008,00d0) vr=SQ, vm=1, type=1C + DRTRecordedBlockSequence RecordedBlockSequence; + /// RecordedCompensatorSequence (3008,00c0) vr=SQ, vm=1, type=1C + DRTRecordedCompensatorSequence RecordedCompensatorSequence; + /// RecordedLateralSpreadingDeviceSequence (3008,00f4) vr=SQ, vm=1, type=1C + DRTRecordedLateralSpreadingDeviceSequence RecordedLateralSpreadingDeviceSequence; + /// RecordedRangeModulatorSequence (3008,00f6) vr=SQ, vm=1, type=1C + DRTRecordedRangeModulatorSequence RecordedRangeModulatorSequence; + /// RecordedRangeShifterSequence (3008,00f2) vr=SQ, vm=1, type=1C + DRTRecordedRangeShifterSequence RecordedRangeShifterSequence; + /// RecordedSnoutSequence (3008,00f0) vr=SQ, vm=1, type=1C + DRTRecordedSnoutSequence RecordedSnoutSequence; + /// RecordedWedgeSequence (3008,00b0) vr=SQ, vm=1, type=1C + DRTRecordedWedgeSequence RecordedWedgeSequence; + /// ReferencedBeamNumber (300c,0006) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedBeamNumber; + /// ReferencedBolusSequence (300c,00b0) vr=SQ, vm=1, type=1C + DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule ReferencedBolusSequence; + /// ReferencedCalculatedDoseReferenceSequence (3008,0090) vr=SQ, vm=1, type=3 + DRTReferencedCalculatedDoseReferenceSequence ReferencedCalculatedDoseReferenceSequence; + /// ReferencedMeasuredDoseReferenceSequence (3008,0080) vr=SQ, vm=1, type=3 + DRTReferencedMeasuredDoseReferenceSequence ReferencedMeasuredDoseReferenceSequence; + /// ReferencedPatientSetupNumber (300c,006a) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedPatientSetupNumber; + /// ReferencedToleranceTableNumber (300c,00a0) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedToleranceTableNumber; + /// ReferencedVerificationImageSequence (300c,0040) vr=SQ, vm=1, type=3 + DRTReferencedVerificationImageSequence ReferencedVerificationImageSequence; + /// ScanMode (300a,0308) vr=CS, vm=1, type=1 + DcmCodeString ScanMode; + /// SpecifiedPrimaryMeterset (3008,0032) vr=DS, vm=1, type=3 + DcmDecimalString SpecifiedPrimaryMeterset; + /// SpecifiedSecondaryMeterset (3008,0033) vr=DS, vm=1, type=3 + DcmDecimalString SpecifiedSecondaryMeterset; + /// SpecifiedTreatmentTime (3008,003a) vr=DS, vm=1, type=3 + DcmDecimalString SpecifiedTreatmentTime; + /// TreatmentDeliveryType (300a,00ce) vr=CS, vm=1, type=2 + DcmCodeString TreatmentDeliveryType; + /// TreatmentTerminationCode (3008,002b) vr=SH, vm=1, type=3 + DcmShortString TreatmentTerminationCode; + /// TreatmentTerminationStatus (3008,002a) vr=CS, vm=1, type=1 + DcmCodeString TreatmentTerminationStatus; + /// TreatmentVerificationStatus (3008,002c) vr=CS, vm=1, type=2 + DcmCodeString TreatmentVerificationStatus; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTTreatmentSessionIonBeamSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTTreatmentSessionIonBeamSequence(const DRTTreatmentSessionIonBeamSequence ©); + + /** destructor + */ + virtual ~DRTTreatmentSessionIonBeamSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTTreatmentSessionIonBeamSequence &operator=(const DRTTreatmentSessionIonBeamSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drttsmds.h b/dcmrt/include/dcmtk/dcmrt/seq/drttsmds.h new file mode 100644 index 00000000..dea494f8 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drttsmds.h @@ -0,0 +1,350 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTTreatmentSummaryMeasuredDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTTSMDS_H +#define DRTTSMDS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for TreatmentSummaryMeasuredDoseReferenceSequence (3008,00e0) + */ +class DCMTK_DCMRT_EXPORT DRTTreatmentSummaryMeasuredDoseReferenceSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get CumulativeDoseToDoseReference (3008,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseToDoseReference(OFString &value, const signed long pos = 0) const; + + /** get CumulativeDoseToDoseReference (3008,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCumulativeDoseToDoseReference(Float64 &value, const unsigned long pos = 0) const; + + /** get DoseReferenceDescription (300a,0016) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDoseReferenceDescription(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedDoseReferenceNumber (300c,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set CumulativeDoseToDoseReference (3008,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCumulativeDoseToDoseReference(const OFString &value, const OFBool check = OFTrue); + + /** set DoseReferenceDescription (300a,0016) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDoseReferenceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set ReferencedDoseReferenceNumber (300c,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedDoseReferenceNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// CumulativeDoseToDoseReference (3008,0052) vr=DS, vm=1, type=1 + DcmDecimalString CumulativeDoseToDoseReference; + /// DoseReferenceDescription (300a,0016) vr=LO, vm=1, type=3 + DcmLongString DoseReferenceDescription; + /// ReferencedDoseReferenceNumber (300c,0051) vr=IS, vm=1, type=3 + DcmIntegerString ReferencedDoseReferenceNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTTreatmentSummaryMeasuredDoseReferenceSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTTreatmentSummaryMeasuredDoseReferenceSequence(const DRTTreatmentSummaryMeasuredDoseReferenceSequence ©); + + /** destructor + */ + virtual ~DRTTreatmentSummaryMeasuredDoseReferenceSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTTreatmentSummaryMeasuredDoseReferenceSequence &operator=(const DRTTreatmentSummaryMeasuredDoseReferenceSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drttts.h b/dcmrt/include/dcmtk/dcmrt/seq/drttts.h new file mode 100644 index 00000000..d61bff5a --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drttts.h @@ -0,0 +1,553 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTToleranceTableSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTTTS_H +#define DRTTTS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class +#include "dcmtk/dcmrt/seq/drtbldts.h" // for BeamLimitingDeviceToleranceSequence + + +/** Interface class for ToleranceTableSequence (300a,0040) + */ +class DCMTK_DCMRT_EXPORT DRTToleranceTableSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get BeamLimitingDeviceAngleTolerance (300a,0046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get BeamLimitingDeviceAngleTolerance (300a,0046) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getBeamLimitingDeviceAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryAngleTolerance (300a,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get GantryAngleTolerance (300a,0044) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get GantryPitchAngleTolerance (300a,014e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getGantryPitchAngleTolerance(Float32 &value, const unsigned long pos = 0) const; + + /** get PatientSupportAngleTolerance (300a,004c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get PatientSupportAngleTolerance (300a,004c) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPatientSupportAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopEccentricAngleTolerance (300a,004e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopEccentricAngleTolerance(OFString &value, const signed long pos = 0) const; + + /** get TableTopEccentricAngleTolerance (300a,004e) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopEccentricAngleTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLateralPositionTolerance (300a,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get TableTopLateralPositionTolerance (300a,0053) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLateralPositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopLongitudinalPositionTolerance (300a,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get TableTopLongitudinalPositionTolerance (300a,0052) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopLongitudinalPositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get TableTopPitchAngleTolerance (300a,004f) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopPitchAngleTolerance(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopRollAngleTolerance (300a,0050) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopRollAngleTolerance(Float32 &value, const unsigned long pos = 0) const; + + /** get TableTopVerticalPositionTolerance (300a,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPositionTolerance(OFString &value, const signed long pos = 0) const; + + /** get TableTopVerticalPositionTolerance (300a,0051) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTableTopVerticalPositionTolerance(Float64 &value, const unsigned long pos = 0) const; + + /** get ToleranceTableLabel (300a,0043) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getToleranceTableLabel(OFString &value, const signed long pos = 0) const; + + /** get ToleranceTableNumber (300a,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getToleranceTableNumber(OFString &value, const signed long pos = 0) const; + + /** get ToleranceTableNumber (300a,0042) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getToleranceTableNumber(Sint32 &value, const unsigned long pos = 0) const; + + // --- get DICOM sequence attributes --- + + /** get BeamLimitingDeviceToleranceSequence (300a,0048) + * @return reference to sequence element + */ + DRTBeamLimitingDeviceToleranceSequence &getBeamLimitingDeviceToleranceSequence() + { return BeamLimitingDeviceToleranceSequence; } + + /** get BeamLimitingDeviceToleranceSequence (300a,0048) + * @return const reference to sequence element + */ + const DRTBeamLimitingDeviceToleranceSequence &getBeamLimitingDeviceToleranceSequence() const + { return BeamLimitingDeviceToleranceSequence; } + + // --- set DICOM attribute values --- + + /** set BeamLimitingDeviceAngleTolerance (300a,0046) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setBeamLimitingDeviceAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set GantryAngleTolerance (300a,0044) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set GantryPitchAngleTolerance (300a,014e) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGantryPitchAngleTolerance(const Float32 value, const unsigned long pos = 0); + + /** set PatientSupportAngleTolerance (300a,004c) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPatientSupportAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopEccentricAngleTolerance (300a,004e) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopEccentricAngleTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLateralPositionTolerance (300a,0053) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLateralPositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopLongitudinalPositionTolerance (300a,0052) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopLongitudinalPositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set TableTopPitchAngleTolerance (300a,004f) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopPitchAngleTolerance(const Float32 value, const unsigned long pos = 0); + + /** set TableTopRollAngleTolerance (300a,0050) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=1 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopRollAngleTolerance(const Float32 value, const unsigned long pos = 0); + + /** set TableTopVerticalPositionTolerance (300a,0051) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTableTopVerticalPositionTolerance(const OFString &value, const OFBool check = OFTrue); + + /** set ToleranceTableLabel (300a,0043) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setToleranceTableLabel(const OFString &value, const OFBool check = OFTrue); + + /** set ToleranceTableNumber (300a,0042) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setToleranceTableNumber(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// BeamLimitingDeviceAngleTolerance (300a,0046) vr=DS, vm=1, type=3 + DcmDecimalString BeamLimitingDeviceAngleTolerance; + /// BeamLimitingDeviceToleranceSequence (300a,0048) vr=SQ, vm=1, type=3 + DRTBeamLimitingDeviceToleranceSequence BeamLimitingDeviceToleranceSequence; + /// GantryAngleTolerance (300a,0044) vr=DS, vm=1, type=3 + DcmDecimalString GantryAngleTolerance; + /// GantryPitchAngleTolerance (300a,014e) vr=FL, vm=1, type=3 + DcmFloatingPointSingle GantryPitchAngleTolerance; + /// PatientSupportAngleTolerance (300a,004c) vr=DS, vm=1, type=3 + DcmDecimalString PatientSupportAngleTolerance; + /// TableTopEccentricAngleTolerance (300a,004e) vr=DS, vm=1, type=3 + DcmDecimalString TableTopEccentricAngleTolerance; + /// TableTopLateralPositionTolerance (300a,0053) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLateralPositionTolerance; + /// TableTopLongitudinalPositionTolerance (300a,0052) vr=DS, vm=1, type=3 + DcmDecimalString TableTopLongitudinalPositionTolerance; + /// TableTopPitchAngleTolerance (300a,004f) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopPitchAngleTolerance; + /// TableTopRollAngleTolerance (300a,0050) vr=FL, vm=1, type=3 + DcmFloatingPointSingle TableTopRollAngleTolerance; + /// TableTopVerticalPositionTolerance (300a,0051) vr=DS, vm=1, type=3 + DcmDecimalString TableTopVerticalPositionTolerance; + /// ToleranceTableLabel (300a,0043) vr=SH, vm=1, type=3 + DcmShortString ToleranceTableLabel; + /// ToleranceTableNumber (300a,0042) vr=IS, vm=1, type=1 + DcmIntegerString ToleranceTableNumber; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTToleranceTableSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTToleranceTableSequence(const DRTToleranceTableSequence ©); + + /** destructor + */ + virtual ~DRTToleranceTableSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTToleranceTableSequence &operator=(const DRTToleranceTableSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtudis.h b/dcmrt/include/dcmtk/dcmrt/seq/drtudis.h new file mode 100644 index 00000000..8f67e76f --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtudis.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTUDISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTUDIS_H +#define DRTUDIS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for UDISequence (0018,100a) + */ +class DCMTK_DCMRT_EXPORT DRTUDISequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get DeviceDescription (0050,0020) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDeviceDescription(OFString &value, const signed long pos = 0) const; + + /** get UniqueDeviceIdentifier (0018,1009) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getUniqueDeviceIdentifier(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set DeviceDescription (0050,0020) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDeviceDescription(const OFString &value, const OFBool check = OFTrue); + + /** set UniqueDeviceIdentifier (0018,1009) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UT) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setUniqueDeviceIdentifier(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// DeviceDescription (0050,0020) vr=LO, vm=1, type=3 + DcmLongString DeviceDescription; + /// UniqueDeviceIdentifier (0018,1009) vr=UT, vm=1, type=1 + DcmUnlimitedText UniqueDeviceIdentifier; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTUDISequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTUDISequence(const DRTUDISequence ©); + + /** destructor + */ + virtual ~DRTUDISequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTUDISequence &operator=(const DRTUDISequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtvls.h b/dcmrt/include/dcmtk/dcmrt/seq/drtvls.h new file mode 100644 index 00000000..b7b881e7 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtvls.h @@ -0,0 +1,336 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTVOILUTSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTVLS_H +#define DRTVLS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for VOILUTSequence (0028,3010) + */ +class DCMTK_DCMRT_EXPORT DRTVOILUTSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get LUTData (0028,3006) + * @param value reference to variable in which the value should be stored + * @param count stores number of items in the result array (if not NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTData(Uint16 *&value, unsigned long *count = NULL) const; + + /** get LUTDescriptor (0028,3002) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTDescriptor(Uint16 &value, const unsigned long pos = 0) const; + + /** get LUTExplanation (0028,3003) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getLUTExplanation(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set LUTData (0028,3006) + * @param value array value to be set (data is copied) + * @param count number of items in the array + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTData(const Uint16 *value, const unsigned long count); + + /** set LUTDescriptor (0028,3002) + * @param value value to be set (should be valid for this VR) + * @param pos index of the value to be set (0..vm-1), vm=3 + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTDescriptor(const Uint16 value, const unsigned long pos = 0); + + /** set LUTExplanation (0028,3003) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLUTExplanation(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// LUTData (0028,3006) vr=US/OW, vm=1-n, type=1 + DcmOtherByteOtherWord LUTData; + /// LUTDescriptor (0028,3002) vr=US/SS, vm=3, type=1 + DcmUnsignedShort LUTDescriptor; + /// LUTExplanation (0028,3003) vr=LO, vm=1, type=3 + DcmLongString LUTExplanation; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTVOILUTSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTVOILUTSequence(const DRTVOILUTSequence ©); + + /** destructor + */ + virtual ~DRTVOILUTSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTVOILUTSequence &operator=(const DRTVOILUTSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtwps.h b/dcmrt/include/dcmtk/dcmrt/seq/drtwps.h new file mode 100644 index 00000000..f689d221 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtwps.h @@ -0,0 +1,327 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTWedgePositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTWPS_H +#define DRTWPS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for WedgePositionSequence (300a,0116) + */ +class DCMTK_DCMRT_EXPORT DRTWedgePositionSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get ReferencedWedgeNumber (300c,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedWedgeNumber(OFString &value, const signed long pos = 0) const; + + /** get ReferencedWedgeNumber (300c,00c0) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getReferencedWedgeNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgePosition (300a,0118) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgePosition(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set ReferencedWedgeNumber (300c,00c0) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedWedgeNumber(const OFString &value, const OFBool check = OFTrue); + + /** set WedgePosition (300a,0118) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgePosition(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// ReferencedWedgeNumber (300c,00c0) vr=IS, vm=1, type=1 + DcmIntegerString ReferencedWedgeNumber; + /// WedgePosition (300a,0118) vr=CS, vm=1, type=1 + DcmCodeString WedgePosition; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTWedgePositionSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTWedgePositionSequence(const DRTWedgePositionSequence ©); + + /** destructor + */ + virtual ~DRTWedgePositionSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTWedgePositionSequence &operator=(const DRTWedgePositionSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtwrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtwrs.h new file mode 100644 index 00000000..4d10c6cf --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtwrs.h @@ -0,0 +1,304 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTWADORetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTWRS_H +#define DRTWRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for WADORetrievalSequence (0040,e023) + */ +class DCMTK_DCMRT_EXPORT DRTWADORetrievalSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RetrieveURI (0040,e010) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRetrieveURI(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RetrieveURI (0040,e010) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRetrieveURI(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RetrieveURI (0040,e010) vr=UR, vm=1, type=1 + DcmUniversalResourceIdentifierOrLocator RetrieveURI; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTWADORetrievalSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTWADORetrievalSequence(const DRTWADORetrievalSequence ©); + + /** destructor + */ + virtual ~DRTWADORetrievalSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTWADORetrievalSequence &operator=(const DRTWADORetrievalSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtwrsrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtwrsrs.h new file mode 100644 index 00000000..cb7dd5e6 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtwrsrs.h @@ -0,0 +1,304 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTWADORSRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTWRSRS_H +#define DRTWRSRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for WADORSRetrievalSequence (0040,e025) + */ +class DCMTK_DCMRT_EXPORT DRTWADORSRetrievalSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get RetrieveURL (0008,1190) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRetrieveURL(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set RetrieveURL (0008,1190) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UR) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRetrieveURL(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// RetrieveURL (0008,1190) vr=UR, vm=1, type=1 + DcmUniversalResourceIdentifierOrLocator RetrieveURL; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTWADORSRetrievalSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTWADORSRetrievalSequence(const DRTWADORSRetrievalSequence ©); + + /** destructor + */ + virtual ~DRTWADORSRetrievalSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTWADORSRetrievalSequence &operator=(const DRTWADORSRetrievalSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtws.h b/dcmrt/include/dcmtk/dcmrt/seq/drtws.h new file mode 100644 index 00000000..5012b262 --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtws.h @@ -0,0 +1,474 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTWedgeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTWS_H +#define DRTWS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for WedgeSequence (300a,00d1) + */ +class DCMTK_DCMRT_EXPORT DRTWedgeSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get AccessoryCode (300a,00f9) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getAccessoryCode(OFString &value, const signed long pos = 0) const; + + /** get EffectiveWedgeAngle (300a,00de) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEffectiveWedgeAngle(OFString &value, const signed long pos = 0) const; + + /** get EffectiveWedgeAngle (300a,00de) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getEffectiveWedgeAngle(Float64 &value, const unsigned long pos = 0) const; + + /** get SourceToWedgeTrayDistance (300a,00da) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToWedgeTrayDistance(OFString &value, const signed long pos = 0) const; + + /** get SourceToWedgeTrayDistance (300a,00da) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSourceToWedgeTrayDistance(Float64 &value, const unsigned long pos = 0) const; + + /** get WedgeAngle (300a,00d5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeAngle(OFString &value, const signed long pos = 0) const; + + /** get WedgeAngle (300a,00d5) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeAngle(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgeFactor (300a,00d6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeFactor(OFString &value, const signed long pos = 0) const; + + /** get WedgeFactor (300a,00d6) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeFactor(Float64 &value, const unsigned long pos = 0) const; + + /** get WedgeID (300a,00d4) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeID(OFString &value, const signed long pos = 0) const; + + /** get WedgeNumber (300a,00d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeNumber(OFString &value, const signed long pos = 0) const; + + /** get WedgeNumber (300a,00d2) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeNumber(Sint32 &value, const unsigned long pos = 0) const; + + /** get WedgeOrientation (300a,00d8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeOrientation(OFString &value, const signed long pos = 0) const; + + /** get WedgeOrientation (300a,00d8) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeOrientation(Float64 &value, const unsigned long pos = 0) const; + + /** get WedgeType (300a,00d3) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWedgeType(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set AccessoryCode (300a,00f9) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAccessoryCode(const OFString &value, const OFBool check = OFTrue); + + /** set EffectiveWedgeAngle (300a,00de) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEffectiveWedgeAngle(const OFString &value, const OFBool check = OFTrue); + + /** set SourceToWedgeTrayDistance (300a,00da) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceToWedgeTrayDistance(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeAngle (300a,00d5) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeAngle(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeFactor (300a,00d6) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeFactor(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeID (300a,00d4) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeID(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeNumber (300a,00d2) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeNumber(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeOrientation (300a,00d8) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeOrientation(const OFString &value, const OFBool check = OFTrue); + + /** set WedgeType (300a,00d3) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWedgeType(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// AccessoryCode (300a,00f9) vr=LO, vm=1, type=3 + DcmLongString AccessoryCode; + /// EffectiveWedgeAngle (300a,00de) vr=DS, vm=1, type=3 + DcmDecimalString EffectiveWedgeAngle; + /// SourceToWedgeTrayDistance (300a,00da) vr=DS, vm=1, type=3 + DcmDecimalString SourceToWedgeTrayDistance; + /// WedgeAngle (300a,00d5) vr=IS, vm=1, type=2 + DcmIntegerString WedgeAngle; + /// WedgeFactor (300a,00d6) vr=DS, vm=1, type=2 + DcmDecimalString WedgeFactor; + /// WedgeID (300a,00d4) vr=SH, vm=1, type=3 + DcmShortString WedgeID; + /// WedgeNumber (300a,00d2) vr=IS, vm=1, type=1 + DcmIntegerString WedgeNumber; + /// WedgeOrientation (300a,00d8) vr=DS, vm=1, type=2 + DcmDecimalString WedgeOrientation; + /// WedgeType (300a,00d3) vr=CS, vm=1, type=2 + DcmCodeString WedgeType; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTWedgeSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTWedgeSequence(const DRTWedgeSequence ©); + + /** destructor + */ + virtual ~DRTWedgeSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTWedgeSequence &operator=(const DRTWedgeSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/include/dcmtk/dcmrt/seq/drtxrs.h b/dcmrt/include/dcmtk/dcmrt/seq/drtxrs.h new file mode 100644 index 00000000..eb996ffd --- /dev/null +++ b/dcmrt/include/dcmtk/dcmrt/seq/drtxrs.h @@ -0,0 +1,320 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class DRTXDSRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#ifndef DRTXRS_H +#define DRTXRS_H + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/ofstd/oflist.h" // for standard list class +#include "dcmtk/dcmrt/drttypes.h" // module-specific helper class + + +/** Interface class for XDSRetrievalSequence (0040,e024) + */ +class DCMTK_DCMRT_EXPORT DRTXDSRetrievalSequence + : protected DRTTypes +{ + + public: + + /** Item class + */ + class DCMTK_DCMRT_EXPORT Item + : protected DRTTypes + { + + public: + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultItem flag used to mark the empty default item + */ + Item(const OFBool emptyDefaultItem = OFFalse); + + /** copy constructor + * @param copy item object to be copied + */ + Item(const Item ©); + + /** destructor + */ + virtual ~Item(); + + /** assigment operator + * @param copy item object to be copied + * @return reference to this object + */ + Item &operator=(const Item ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if item is empty + * @return OFTrue if item is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if item is valid, i.e.\ not the empty default item + * @return OFTrue if item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + // --- input/output methods --- + + /** read elements from sequence item + * @param item reference to DICOM sequence item from which the elements should be read + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &item); + + /** write elements to sequence item + * @param item reference to DICOM sequence item to which the elements should be written + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &item); + + // --- get DICOM attribute values --- + + /** get HomeCommunityID (0040,e031) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getHomeCommunityID(OFString &value, const signed long pos = 0) const; + + /** get RepositoryUniqueID (0040,e030) + * @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getRepositoryUniqueID(OFString &value, const signed long pos = 0) const; + + // --- set DICOM attribute values --- + + /** set HomeCommunityID (0040,e031) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setHomeCommunityID(const OFString &value, const OFBool check = OFTrue); + + /** set RepositoryUniqueID (0040,e030) + * @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRepositoryUniqueID(const OFString &value, const OFBool check = OFTrue); + + private: + + /// internal flag used to mark the empty default item + /*const*/ OFBool EmptyDefaultItem; + + /// HomeCommunityID (0040,e031) vr=UI, vm=1, type=3 + DcmUniqueIdentifier HomeCommunityID; + /// RepositoryUniqueID (0040,e030) vr=UI, vm=1, type=1 + DcmUniqueIdentifier RepositoryUniqueID; + + }; + + // --- constructors, destructor and operators --- + + /** (default) constructor + * @param emptyDefaultSequence internal flag used to mark the empty default sequence + */ + DRTXDSRetrievalSequence(const OFBool emptyDefaultSequence = OFFalse); + + /** copy constructor + * @param copy sequence object to be copied + */ + DRTXDSRetrievalSequence(const DRTXDSRetrievalSequence ©); + + /** destructor + */ + virtual ~DRTXDSRetrievalSequence(); + + /** assigment operator + * @param copy sequence object to be copied + * @return reference to this object + */ + DRTXDSRetrievalSequence &operator=(const DRTXDSRetrievalSequence ©); + + // --- general methods --- + + /** clear all internal member variables + */ + void clear(); + + /** check if sequence is empty + * @return OFTrue if sequence is empty, OFFalse otherwise + */ + OFBool isEmpty(); + + /** check if sequence is valid, i.e.\ not the empty default sequence + * @return OFTrue if sequence is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** get number of items in the sequence + * @return number of items + */ + size_t getNumberOfItems() const; + + /** goto first item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** goto next item in the sequence + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num); + + /** get current item in the sequence + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCurrentItem(Item *&item) const; + + /** get current item in the sequence + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getCurrentItem(); + + /** get current item in the sequence + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getCurrentItem() const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @param item reference to item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t num, Item *&item); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &getItem(const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &getItem(const size_t num) const; + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return reference to specified item if successful, empty default item otherwise + */ + Item &operator[](const size_t num); + + /** get particular item in the sequence + * @param num number of the item to be retrieved (0..num-1) + * @return const reference to specified item if successful, empty default item otherwise + */ + const Item &operator[](const size_t num) const; + + /** add new item to the end of this sequence + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(Item *&item); + + /** insert new item into the sequence + * @param pos position where the new item is to be inserted (0..num) + * @param item reference to new item pointer (result variable) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t pos, Item *&item); + + /** remove particular item from the sequence + * @param pos position of the item to be removed (0..num-1) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t pos); + + // --- input/output methods --- + + /** read sequence of items from dataset + * @param dataset reference to DICOM dataset from which the sequence should be read + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "1C", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + /** write sequence of items to dataset + * @param dataset reference to DICOM dataset to which the sequence should be written + * @param card cardinality (valid range for number of items) + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module/sequence name to be printed (default: "RT object" if NULL) + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName = NULL); + + protected: + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListIterator(Item *) &iterator); + + /** goto particular item in the sequence + * @param num number of the item to be selected (0..num-1) + * @param iterator list iterator storing the position of the item + * @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const size_t num, + OFListConstIterator(Item *) &iterator) const; + + private: + + /// internal flag used to mark the empty default sequence + /*const*/ OFBool EmptyDefaultSequence; + + /// list of items in this sequence + OFList SequenceOfItems; + /// currently selected item + OFListIterator(Item *) CurrentItem; + /// empty default item + Item EmptyItem; + +}; + + +#endif diff --git a/dcmrt/libsrc/CMakeLists.txt b/dcmrt/libsrc/CMakeLists.txt new file mode 100644 index 00000000..b1147766 --- /dev/null +++ b/dcmrt/libsrc/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmrt drtdose drtimage drtplan drtstrct drttreat drtionpl drtiontr drmdose drmimage drmplan drmstrct drttypes drtaadcs drtadcs drtads drtafs drtags drtajcs drtas1 drtas5 drtas6 drtas7 drtass drtbads drtbas drtbcps drtbl2 drtbl5 drtbldls drtbldps drtblds1 drtblds5 drtblds6 drtbldts drtbrcss drtbrdrs drtbrs drtbs drtbss drtbvcps drtcbars drtccs drtcctus drtcdrs drtces drtcgis drtchs drtcims drtcis drtcncs drtcos drtcpas drtcpis drtcps drtcsas drtcs drtcshs drtcsis drtcsrs drtcss drtdcs drtdddps drtddps drtdias drtdimcs drtdimrs drtdirs drtdrs drtds drtdspcs drtdss drtdvhs drtdvrrs drteas drtecs drtes drtfds drtfes drtfgs drtfgss drtfms drtfsss drtgas drtgmcs drtgms drtgpis drthsdrs drtiais drtians drtiblds drtibls drtibs drticpds drticps drtics drtiis drtipiqs drtircs drtiseis drtitts drtiwps drtiws drtlsds6 drtlsds7 drtlsds drtmacds drtmas drtmdrs drtmls drtmps drtmris drtmss drtmucs drtoas drtois drtopis drtos drtpbcs drtpcs drtpcxs drtpdecs drtpdeds drtpfms drtpics drtporcs drtporis drtppcs drtprsis drtpscs drtpsics drtpss drtpsss drtpvis drtqds drtras drtrbas2 drtrbas8 drtrbls drtrbos1 drtrbos6 drtrbos7 drtrbs2 drtrbs4 drtrbs8 drtrcdrs drtrcos drtrcps drtrcs drtrdros drtrdrs1 drtrdrs6 drtrdrs8 drtrds drtrecs drtrfgs drtrfors drtrics drtrims drtris drtrlsds drtrmdrs drtrms drtrmss6 drtrmss7 drtrpcs drtrpis drtrppcs drtrpphs drtrpps drtrppss drtrps drtrris1 drtrris6 drtrris9 drtrrms drtrros drtrrpcs drtrrros drtrrs drtrrshs drtrrtps3 drtrrtps4 drtrrtps5 drtrrtps drtrscs drtrsers drtrses drtrshs6 drtrshs7 drtrshs drtrsis drtrsns drtrsos drtrsrs drtrss drtrsss drtrsts drtrtrs2 drtrtrs4 drtrvis drtwrsrs drtrws drtrwvms drtscris drtscs drtsdcs drtsds drtshds drtsins drtsis drtsns drtspccs drtspcs drtspgis drtsptcs drtss drtssrcs drtssrs drtsss drttms0 drttms9 drttscds drttsibs drttsmds drttts drtudis drtvls drtwps drtwrs drtws drtxrs) + +DCMTK_TARGET_LINK_MODULES(dcmrt ofstd oflog dcmdata dcmimgle) diff --git a/dcmrt/libsrc/Makefile.dep b/dcmrt/libsrc/Makefile.dep new file mode 100644 index 00000000..754a16d8 --- /dev/null +++ b/dcmrt/libsrc/Makefile.dep @@ -0,0 +1,27992 @@ +drmdose.o: drmdose.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drmdose.h ../include/dcmtk/dcmrt/drtdose.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdvhs.h \ + ../include/dcmtk/dcmrt/seq/drtdvrrs.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtfes.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtiis.h ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtmls.h ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpsss.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h ../include/dcmtk/dcmrt/seq/drtrcs.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h ../include/dcmtk/dcmrt/seq/drtcis.h \ + ../include/dcmtk/dcmrt/seq/drtrdros.h \ + ../include/dcmtk/dcmrt/seq/drtrwvms.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrfors.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps.h \ + ../include/dcmtk/dcmrt/seq/drtrfgs.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h \ + ../include/dcmtk/dcmrt/seq/drtrbas2.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs2.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtssrs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h \ + ../../ofstd/include/dcmtk/ofstd/ofbmanip.h +drmimage.o: drmimage.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drmimage.h ../include/dcmtk/dcmrt/drtimage.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h \ + ../include/dcmtk/dcmrt/seq/drtcbars.h \ + ../include/dcmtk/dcmrt/seq/drtads.h ../include/dcmtk/dcmrt/seq/drtbas.h \ + ../include/dcmtk/dcmrt/seq/drtces.h ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtds.h \ + ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtes.h \ + ../include/dcmtk/dcmrt/seq/drtas5.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds5.h \ + ../include/dcmtk/dcmrt/seq/drtbl5.h ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h ../include/dcmtk/dcmrt/seq/drtfms.h \ + ../include/dcmtk/dcmrt/seq/drtfes.h ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtiis.h ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtmls.h \ + ../include/dcmtk/dcmrt/seq/drtmacds.h \ + ../include/dcmtk/dcmrt/seq/drtcss.h ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrwvms.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps5.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrss.h ../include/dcmtk/dcmrt/seq/drtrpis.h \ + ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h ../include/dcmtk/dcmrt/seq/drtvls.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h +drmplan.o: drmplan.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drmplan.h ../include/dcmtk/dcmrt/drtplan.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtass.h ../include/dcmtk/dcmrt/seq/drtbads.h \ + ../include/dcmtk/dcmrt/seq/drtchs.h ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h \ + ../include/dcmtk/dcmrt/seq/drtrris9.h ../include/dcmtk/dcmrt/seq/drtbs.h \ + ../include/dcmtk/dcmrt/seq/drtas1.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds1.h \ + ../include/dcmtk/dcmrt/seq/drtbl2.h ../include/dcmtk/dcmrt/seq/drtcos.h \ + ../include/dcmtk/dcmrt/seq/drtcps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h ../include/dcmtk/dcmrt/seq/drtpvis.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h \ + ../include/dcmtk/dcmrt/seq/drtrbos1.h \ + ../include/dcmtk/dcmrt/seq/drtrris1.h ../include/dcmtk/dcmrt/seq/drtws.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drtdrs.h ../include/dcmtk/dcmrt/seq/drteas.h \ + ../include/dcmtk/dcmrt/seq/drtfgs.h ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h ../include/dcmtk/dcmrt/seq/drtpss.h \ + ../include/dcmtk/dcmrt/seq/drtfds.h ../include/dcmtk/dcmrt/seq/drtmss.h \ + ../include/dcmtk/dcmrt/seq/drtrsis.h ../include/dcmtk/dcmrt/seq/drtsds.h \ + ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps3.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h ../include/dcmtk/dcmrt/seq/drtss.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drttts.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h \ + ../include/dcmtk/dcmrt/seq/drttms9.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h ../include/dcmtk/dcmrt/drmsrch.h +drmstrct.o: drmstrct.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drmstrct.h ../include/dcmtk/dcmrt/drtstrct.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpsss.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h ../include/dcmtk/dcmrt/seq/drtrcs.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h ../include/dcmtk/dcmrt/seq/drtcis.h \ + ../include/dcmtk/dcmrt/seq/drtrros.h \ + ../include/dcmtk/dcmrt/seq/drtrpps.h \ + ../include/dcmtk/dcmrt/seq/drtrecs.h \ + ../include/dcmtk/dcmrt/seq/drtrics.h \ + ../include/dcmtk/dcmrt/seq/drtsptcs.h \ + ../include/dcmtk/dcmrt/seq/drtrrs.h \ + ../include/dcmtk/dcmrt/seq/drtrrros.h \ + ../include/dcmtk/dcmrt/seq/drtspccs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrfors.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrss.h ../include/dcmtk/dcmrt/seq/drtrpis.h \ + ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtssrs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h ../include/dcmtk/dcmrt/drmsrch.h +drtaadcs.o: drtaadcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtadcs.o: drtadcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtads.o: drtads.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtads.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtafs.o: drtafs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtags.o: drtags.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtags.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtajcs.o: drtajcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtas1.o: drtas1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtas1.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtags.h +drtas5.o: drtas5.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtas5.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtags.h +drtas6.o: drtas6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtas6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtas7.o: drtas7.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtas7.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtass.o: drtass.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtass.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbads.h ../include/dcmtk/dcmrt/seq/drtchs.h \ + ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h \ + ../include/dcmtk/dcmrt/seq/drtrris9.h +drtbads.o: drtbads.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbads.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbas.o: drtbas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbas.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtbcps.o: drtbcps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h +drtbl2.o: drtbl2.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbl2.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbl5.o: drtbl5.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbl5.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbldls.o: drtbldls.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbldls.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbldps.o: drtbldps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtblds1.o: drtblds1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtblds1.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtblds5.o: drtblds5.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtblds5.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtblds6.o: drtblds6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtblds6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbldts.o: drtbldts.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbrcss.o: drtbrcss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtbrdrs.o: drtbrdrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbrs.o: drtbrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtbs.o: drtbs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtas1.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds1.h \ + ../include/dcmtk/dcmrt/seq/drtbl2.h ../include/dcmtk/dcmrt/seq/drtcos.h \ + ../include/dcmtk/dcmrt/seq/drtcps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h ../include/dcmtk/dcmrt/seq/drtpvis.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h \ + ../include/dcmtk/dcmrt/seq/drtrbos1.h \ + ../include/dcmtk/dcmrt/seq/drtrris1.h ../include/dcmtk/dcmrt/seq/drtws.h +drtbss.o: drtbss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtbvcps.o: drtbvcps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcbars.o: drtcbars.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcbars.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtads.h ../include/dcmtk/dcmrt/seq/drtecs.h +drtccs.o: drtccs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtcctus.o: drtcctus.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcdrs.o: drtcdrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcdrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtces.o: drtces.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtces.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtois.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h +drtcgis.o: drtcgis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtchs.o: drtchs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtchs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h +drtcims.o: drtcims.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtccs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h +drtcis.o: drtcis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcncs.o: drtcncs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtcos.o: drtcos.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcos.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcpas.o: drtcpas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcpas.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcpis.o: drtcpis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtics.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h +drtcps.o: drtcps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h +drtcs.o: drtcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtcis.h +drtcsas.o: drtcsas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcshs.o: drtcshs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcsis.o: drtcsis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h +drtcsrs.o: drtcsrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtcss.o: drtcss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtcss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtdcs.o: drtdcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtdddps.o: drtdddps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdddps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtddps.o: drtddps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtddps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtdias.o: drtdias.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtdimcs.o: drtdimcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtdimrs.o: drtdimrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtdirs.o: drtdirs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtdose.o: drtdose.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drtdose.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdvhs.h \ + ../include/dcmtk/dcmrt/seq/drtdvrrs.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtfes.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtiis.h ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtmls.h ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpsss.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h ../include/dcmtk/dcmrt/seq/drtrcs.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h ../include/dcmtk/dcmrt/seq/drtcis.h \ + ../include/dcmtk/dcmrt/seq/drtrdros.h \ + ../include/dcmtk/dcmrt/seq/drtrwvms.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrfors.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps.h \ + ../include/dcmtk/dcmrt/seq/drtrfgs.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h \ + ../include/dcmtk/dcmrt/seq/drtrbas2.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs2.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtssrs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h +drtdrs.o: drtdrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtds.o: drtds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtdspcs.o: drtdspcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtdss.o: drtdss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtdvhs.o: drtdvhs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdvhs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtdvrrs.h +drtdvrrs.o: drtdvrrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtdvrrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drteas.o: drteas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drteas.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtecs.o: drtecs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtes.o: drtes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtes.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtas5.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds5.h \ + ../include/dcmtk/dcmrt/seq/drtbl5.h ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h +drtfds.o: drtfds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtfds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtfes.o: drtfes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtfes.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtfgs.o: drtfgs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtfgs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h +drtfgss.o: drtfgss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtfgss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtfsss.h +drtfms.o: drtfms.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtfms.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtfsss.o: drtfsss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtfsss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtgas.o: drtgas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtgmcs.o: drtgmcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtgms.o: drtgms.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h ../include/dcmtk/dcmrt/seq/drtecs.h +drtgpis.o: drtgpis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtafs.h \ + ../include/dcmtk/dcmrt/seq/drtajcs.h +drthsdrs.o: drthsdrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtiais.o: drtiais.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtians.o: drtians.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtiblds.o: drtiblds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtiblds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtibls.o: drtibls.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtibls.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbss.h +drtibs.o: drtibs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtibs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtas6.h ../include/dcmtk/dcmrt/seq/drtddps.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drtiblds.h \ + ../include/dcmtk/dcmrt/seq/drtibls.h ../include/dcmtk/dcmrt/seq/drtbss.h \ + ../include/dcmtk/dcmrt/seq/drticps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../include/dcmtk/dcmrt/seq/drtlsds6.h \ + ../include/dcmtk/dcmrt/seq/drtrmss6.h \ + ../include/dcmtk/dcmrt/seq/drtrshs6.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs6.h \ + ../include/dcmtk/dcmrt/seq/drtircs.h ../include/dcmtk/dcmrt/seq/drtiws.h \ + ../include/dcmtk/dcmrt/seq/drtlsds.h ../include/dcmtk/dcmrt/seq/drtrms.h \ + ../include/dcmtk/dcmrt/seq/drtrshs.h \ + ../include/dcmtk/dcmrt/seq/drtrbos6.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h \ + ../include/dcmtk/dcmrt/seq/drtrris6.h \ + ../include/dcmtk/dcmrt/seq/drtsns.h +drticpds.o: drticpds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drticpds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtcpas.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../include/dcmtk/dcmrt/seq/drtlsds7.h ../include/dcmtk/dcmrt/seq/drtos.h \ + ../include/dcmtk/dcmrt/seq/drtois.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtrmss7.h \ + ../include/dcmtk/dcmrt/seq/drtrshs7.h +drticps.o: drticps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drticps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../include/dcmtk/dcmrt/seq/drtlsds6.h \ + ../include/dcmtk/dcmrt/seq/drtrmss6.h \ + ../include/dcmtk/dcmrt/seq/drtrshs6.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs6.h +drtics.o: drtics.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtics.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtiis.o: drtiis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtiis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtimage.o: drtimage.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drtimage.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h \ + ../include/dcmtk/dcmrt/seq/drtcbars.h \ + ../include/dcmtk/dcmrt/seq/drtads.h ../include/dcmtk/dcmrt/seq/drtbas.h \ + ../include/dcmtk/dcmrt/seq/drtces.h ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtds.h \ + ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtes.h \ + ../include/dcmtk/dcmrt/seq/drtas5.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds5.h \ + ../include/dcmtk/dcmrt/seq/drtbl5.h ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h ../include/dcmtk/dcmrt/seq/drtfms.h \ + ../include/dcmtk/dcmrt/seq/drtfes.h ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtiis.h ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtmls.h \ + ../include/dcmtk/dcmrt/seq/drtmacds.h \ + ../include/dcmtk/dcmrt/seq/drtcss.h ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrwvms.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps5.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrss.h ../include/dcmtk/dcmrt/seq/drtrpis.h \ + ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h ../include/dcmtk/dcmrt/seq/drtvls.h +drtionpl.o: drtionpl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drtionpl.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drtdrs.h ../include/dcmtk/dcmrt/seq/drteas.h \ + ../include/dcmtk/dcmrt/seq/drtfgs.h ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtibs.h ../include/dcmtk/dcmrt/seq/drtas6.h \ + ../include/dcmtk/dcmrt/seq/drtddps.h ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drtiblds.h \ + ../include/dcmtk/dcmrt/seq/drtibls.h ../include/dcmtk/dcmrt/seq/drtbss.h \ + ../include/dcmtk/dcmrt/seq/drticps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../include/dcmtk/dcmrt/seq/drtlsds6.h \ + ../include/dcmtk/dcmrt/seq/drtrmss6.h \ + ../include/dcmtk/dcmrt/seq/drtrshs6.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs6.h \ + ../include/dcmtk/dcmrt/seq/drtircs.h ../include/dcmtk/dcmrt/seq/drtiws.h \ + ../include/dcmtk/dcmrt/seq/drtlsds.h ../include/dcmtk/dcmrt/seq/drtrms.h \ + ../include/dcmtk/dcmrt/seq/drtrshs.h \ + ../include/dcmtk/dcmrt/seq/drtrbos6.h \ + ../include/dcmtk/dcmrt/seq/drtrris6.h \ + ../include/dcmtk/dcmrt/seq/drtsns.h ../include/dcmtk/dcmrt/seq/drtitts.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h ../include/dcmtk/dcmrt/seq/drtpss.h \ + ../include/dcmtk/dcmrt/seq/drtfds.h ../include/dcmtk/dcmrt/seq/drtmss.h \ + ../include/dcmtk/dcmrt/seq/drtrsis.h ../include/dcmtk/dcmrt/seq/drtsds.h \ + ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps3.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h +drtiontr.o: drtiontr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drtiontr.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtfgss.h \ + ../include/dcmtk/dcmrt/seq/drtfsss.h ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtmdrs.h ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h ../include/dcmtk/dcmrt/seq/drtpss.h \ + ../include/dcmtk/dcmrt/seq/drtfds.h ../include/dcmtk/dcmrt/seq/drtmss.h \ + ../include/dcmtk/dcmrt/seq/drtrsis.h ../include/dcmtk/dcmrt/seq/drtsds.h \ + ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps4.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs4.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drttms0.h \ + ../include/dcmtk/dcmrt/seq/drttsibs.h \ + ../include/dcmtk/dcmrt/seq/drtas7.h \ + ../include/dcmtk/dcmrt/seq/drtbldls.h \ + ../include/dcmtk/dcmrt/seq/drtdddps.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drticpds.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtcpas.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../include/dcmtk/dcmrt/seq/drtlsds7.h ../include/dcmtk/dcmrt/seq/drtos.h \ + ../include/dcmtk/dcmrt/seq/drtrmss7.h \ + ../include/dcmtk/dcmrt/seq/drtrshs7.h \ + ../include/dcmtk/dcmrt/seq/drtrbls.h \ + ../include/dcmtk/dcmrt/seq/drtrcos.h \ + ../include/dcmtk/dcmrt/seq/drtrlsds.h \ + ../include/dcmtk/dcmrt/seq/drtrrms.h \ + ../include/dcmtk/dcmrt/seq/drtrrshs.h \ + ../include/dcmtk/dcmrt/seq/drtrsns.h ../include/dcmtk/dcmrt/seq/drtrws.h \ + ../include/dcmtk/dcmrt/seq/drtrbos7.h \ + ../include/dcmtk/dcmrt/seq/drtrcdrs.h \ + ../include/dcmtk/dcmrt/seq/drtrmdrs.h \ + ../include/dcmtk/dcmrt/seq/drtrvis.h \ + ../include/dcmtk/dcmrt/seq/drttscds.h \ + ../include/dcmtk/dcmrt/seq/drttsmds.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h +drtipiqs.o: drtipiqs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtafs.h \ + ../include/dcmtk/dcmrt/seq/drtajcs.h +drtircs.o: drtircs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtircs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtiseis.o: drtiseis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtitts.o: drtitts.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtitts.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h +drtiwps.o: drtiwps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtiws.o: drtiws.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtiws.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtlsds.o: drtlsds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtlsds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtlsds6.o: drtlsds6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtlsds6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtlsds7.o: drtlsds7.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtlsds7.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtmacds.o: drtmacds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmacds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtcss.h ../include/dcmtk/dcmrt/seq/drtecs.h +drtmas.o: drtmas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtmdrs.o: drtmdrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmdrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtmls.o: drtmls.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmls.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtmps.o: drtmps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtmris.o: drtmris.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtmss.o: drtmss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtmucs.o: drtmucs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtoas.o: drtoas.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h +drtois.o: drtois.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtics.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h +drtopis.o: drtopis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtafs.h \ + ../include/dcmtk/dcmrt/seq/drtajcs.h +drtos.o: drtos.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtos.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtois.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtpics.h +drtpbcs.o: drtpbcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtpcs.o: drtpcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtpcxs.o: drtpcxs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtccs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h +drtpdecs.o: drtpdecs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h +drtpdeds.o: drtpdeds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtpfms.o: drtpfms.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtpics.o: drtpics.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtplan.o: drtplan.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drtplan.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtass.h ../include/dcmtk/dcmrt/seq/drtbads.h \ + ../include/dcmtk/dcmrt/seq/drtchs.h ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h \ + ../include/dcmtk/dcmrt/seq/drtrris9.h ../include/dcmtk/dcmrt/seq/drtbs.h \ + ../include/dcmtk/dcmrt/seq/drtas1.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds1.h \ + ../include/dcmtk/dcmrt/seq/drtbl2.h ../include/dcmtk/dcmrt/seq/drtcos.h \ + ../include/dcmtk/dcmrt/seq/drtcps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h ../include/dcmtk/dcmrt/seq/drtpvis.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h \ + ../include/dcmtk/dcmrt/seq/drtrbos1.h \ + ../include/dcmtk/dcmrt/seq/drtrris1.h ../include/dcmtk/dcmrt/seq/drtws.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drtdrs.h ../include/dcmtk/dcmrt/seq/drteas.h \ + ../include/dcmtk/dcmrt/seq/drtfgs.h ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h ../include/dcmtk/dcmrt/seq/drtpss.h \ + ../include/dcmtk/dcmrt/seq/drtfds.h ../include/dcmtk/dcmrt/seq/drtmss.h \ + ../include/dcmtk/dcmrt/seq/drtrsis.h ../include/dcmtk/dcmrt/seq/drtsds.h \ + ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps3.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h ../include/dcmtk/dcmrt/seq/drtss.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drttts.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h \ + ../include/dcmtk/dcmrt/seq/drttms9.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h +drtporcs.o: drtporcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtporis.o: drtporis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtics.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h +drtppcs.o: drtppcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtpcxs.h \ + ../include/dcmtk/dcmrt/seq/drtccs.h ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h +drtprsis.o: drtprsis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtics.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h +drtpscs.o: drtpscs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtpsics.o: drtpsics.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtpss.o: drtpss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtfds.h ../include/dcmtk/dcmrt/seq/drtmss.h \ + ../include/dcmtk/dcmrt/seq/drtrsis.h ../include/dcmtk/dcmrt/seq/drtsds.h \ + ../include/dcmtk/dcmrt/seq/drtshds.h +drtpsss.o: drtpsss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpsss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtpvis.o: drtpvis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtpvis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtqds.o: drtqds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtccs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h +drtras.o: drtras.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtras.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h +drtrbas2.o: drtrbas2.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbas2.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrbas8.o: drtrbas8.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrbls.o: drtrbls.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbls.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrbos1.o: drtrbos1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbos1.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrbos6.o: drtrbos6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbos6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrbos7.o: drtrbos7.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbos7.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrbs2.o: drtrbs2.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h +drtrbs4.o: drtrbs4.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbs4.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrbs8.o: drtrbs8.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrcdrs.o: drtrcdrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrcdrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrcos.o: drtrcos.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrcos.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrcps.o: drtrcps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrcs.o: drtrcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h ../include/dcmtk/dcmrt/seq/drtcis.h +drtrdros.o: drtrdros.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrdros.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrdrs1.o: drtrdrs1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h +drtrdrs6.o: drtrdrs6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrdrs8.o: drtrdrs8.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrds.o: drtrds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrecs.o: drtrecs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrecs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrfgs.o: drtrfgs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrfgs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h \ + ../include/dcmtk/dcmrt/seq/drtrbas2.h +drtrfors.o: drtrfors.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrfors.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h ../include/dcmtk/dcmrt/seq/drtcis.h +drtrics.o: drtrics.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrics.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtsptcs.h +drtrims.o: drtrims.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtris.o: drtris.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtris.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtrlsds.o: drtrlsds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrlsds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrmdrs.o: drtrmdrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrmdrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrms.o: drtrms.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrms.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrmss6.o: drtrmss6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrmss6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrmss7.o: drtrmss7.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrmss7.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrpcs.o: drtrpcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtrpis.o: drtrpis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtics.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h +drtrppcs.o: drtrppcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtrpphs.o: drtrpphs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h +drtrpps.o: drtrpps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrpps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrecs.h +drtrppss.o: drtrppss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrps.o: drtrps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrris1.o: drtrris1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrris1.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrris6.o: drtrris6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrris6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrris9.o: drtrris9.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrris9.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrrms.o: drtrrms.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrms.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrros.o: drtrros.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrros.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrpps.h \ + ../include/dcmtk/dcmrt/seq/drtrecs.h \ + ../include/dcmtk/dcmrt/seq/drtrics.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtsptcs.h \ + ../include/dcmtk/dcmrt/seq/drtrrs.h \ + ../include/dcmtk/dcmrt/seq/drtrrros.h \ + ../include/dcmtk/dcmrt/seq/drtspccs.h +drtrrpcs.o: drtrrpcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtrrros.o: drtrrros.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrros.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrrs.o: drtrrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrrshs.o: drtrrshs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrshs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrrtps.o: drtrrtps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrfgs.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h \ + ../include/dcmtk/dcmrt/seq/drtrbas2.h +drtrrtps3.o: drtrrtps3.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps3.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrrtps4.o: drtrrtps4.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps4.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrrtps5.o: drtrrtps5.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps5.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrscs.o: drtrscs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtrsers.o: drtrsers.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtrses.o: drtrses.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtcis.h +drtrshs.o: drtrshs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrshs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrshs6.o: drtrshs6.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrshs6.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrshs7.o: drtrshs7.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrshs7.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrsis.o: drtrsis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrsis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrsns.o: drtrsns.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrsns.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrsos.o: drtrsos.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrsrs.o: drtrsrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrsrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrss.o: drtrss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrsss.o: drtrsss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrsts.o: drtrsts.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h ../include/dcmtk/dcmrt/seq/drtcis.h +drtrtrs2.o: drtrtrs2.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs2.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h +drtrtrs4.o: drtrtrs4.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs4.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrvis.o: drtrvis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrvis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrws.o: drtrws.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrws.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtrwvms.o: drtrwvms.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtrwvms.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h +drtscris.o: drtscris.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtscs.o: drtscs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtsdcs.o: drtsdcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtsds.o: drtsds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtsds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtshds.o: drtshds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtsins.o: drtsins.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtsis.o: drtsis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtsns.o: drtsns.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtsns.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtspccs.o: drtspccs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtspccs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtspcs.o: drtspcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtpcxs.h \ + ../include/dcmtk/dcmrt/seq/drtccs.h ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h +drtspgis.o: drtspgis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtafs.h \ + ../include/dcmtk/dcmrt/seq/drtajcs.h +drtsptcs.o: drtsptcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtsptcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtss.o: drtss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtssrcs.o: drtssrcs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtssrs.o: drtssrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtssrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtecs.h +drtsss.o: drtsss.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h +drtstrct.o: drtstrct.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drtstrct.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpsss.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h ../include/dcmtk/dcmrt/seq/drtrcs.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h ../include/dcmtk/dcmrt/seq/drtcis.h \ + ../include/dcmtk/dcmrt/seq/drtrros.h \ + ../include/dcmtk/dcmrt/seq/drtrpps.h \ + ../include/dcmtk/dcmrt/seq/drtrecs.h \ + ../include/dcmtk/dcmrt/seq/drtrics.h \ + ../include/dcmtk/dcmrt/seq/drtsptcs.h \ + ../include/dcmtk/dcmrt/seq/drtrrs.h \ + ../include/dcmtk/dcmrt/seq/drtrrros.h \ + ../include/dcmtk/dcmrt/seq/drtspccs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrfors.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrss.h ../include/dcmtk/dcmrt/seq/drtrpis.h \ + ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtssrs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h +drttms0.o: drttms0.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drttms0.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drttms9.o: drttms9.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drttms9.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drttreat.o: drttreat.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drttreat.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtfgss.h \ + ../include/dcmtk/dcmrt/seq/drtfsss.h ../include/dcmtk/dcmrt/seq/drtgms.h \ + ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps4.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs4.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drttscds.h \ + ../include/dcmtk/dcmrt/seq/drttsmds.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h +drttscds.o: drttscds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drttscds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drttsibs.o: drttsibs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drttsibs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtas7.h \ + ../include/dcmtk/dcmrt/seq/drtbldls.h \ + ../include/dcmtk/dcmrt/seq/drtdddps.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drticpds.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtcpas.h \ + ../include/dcmtk/dcmrt/seq/drtiwps.h \ + ../include/dcmtk/dcmrt/seq/drtlsds7.h ../include/dcmtk/dcmrt/seq/drtos.h \ + ../include/dcmtk/dcmrt/seq/drtois.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtecs.h ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtrmss7.h \ + ../include/dcmtk/dcmrt/seq/drtrshs7.h \ + ../include/dcmtk/dcmrt/seq/drtrbls.h \ + ../include/dcmtk/dcmrt/seq/drtrcos.h \ + ../include/dcmtk/dcmrt/seq/drtrlsds.h \ + ../include/dcmtk/dcmrt/seq/drtrrms.h \ + ../include/dcmtk/dcmrt/seq/drtrrshs.h \ + ../include/dcmtk/dcmrt/seq/drtrsns.h ../include/dcmtk/dcmrt/seq/drtrws.h \ + ../include/dcmtk/dcmrt/seq/drtrbos7.h \ + ../include/dcmtk/dcmrt/seq/drtrcdrs.h \ + ../include/dcmtk/dcmrt/seq/drtrmdrs.h \ + ../include/dcmtk/dcmrt/seq/drtrvis.h +drttsmds.o: drttsmds.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drttsmds.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drttts.o: drttts.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drttts.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h +drttypes.o: drttypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtudis.o: drtudis.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtvls.o: drtvls.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtvls.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtwps.o: drtwps.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtwps.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtwrs.o: drtwrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtwrsrs.o: drtwrsrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtws.o: drtws.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtws.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h +drtxrs.o: drtxrs.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h diff --git a/dcmrt/libsrc/Makefile.in b/dcmrt/libsrc/Makefile.in new file mode 100644 index 00000000..51c46437 --- /dev/null +++ b/dcmrt/libsrc/Makefile.in @@ -0,0 +1,85 @@ +# +# Makefile for dcmrt/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include \ + -I$(dcmimgledir)/include +LOCALDEFS = + +objs = drtdose.o drtimage.o drtplan.o drtstrct.o drttreat.o drtionpl.o drtiontr.o \ + drmdose.o drmimage.o drmplan.o drmstrct.o drttypes.o \ + drtaadcs.o drtadcs.o drtads.o drtafs.o drtags.o drtajcs.o drtas1.o \ + drtas5.o drtas6.o drtas7.o drtass.o drtbads.o drtbas.o drtbcps.o \ + drtbl2.o drtbl5.o drtbldls.o drtbldps.o drtblds1.o drtblds5.o drtblds6.o \ + drtbldts.o drtbrcss.o drtbrdrs.o drtbrs.o drtbs.o drtbss.o drtbvcps.o \ + drtcbars.o drtccs.o drtcctus.o drtcdrs.o drtces.o drtcgis.o drtchs.o \ + drtcims.o drtcis.o drtcncs.o drtcos.o drtcpas.o drtcpis.o drtcps.o \ + drtcsas.o drtcs.o drtcshs.o drtcsis.o drtcsrs.o drtcss.o drtdcs.o \ + drtdddps.o drtddps.o drtdias.o drtdimcs.o drtdimrs.o drtdirs.o drtdrs.o \ + drtds.o drtdspcs.o drtdss.o drtdvhs.o drtdvrrs.o drteas.o drtecs.o \ + drtes.o drtfds.o drtfes.o drtfgs.o drtfgss.o drtfms.o drtfsss.o drtgas.o \ + drtgmcs.o drtgms.o drtgpis.o drthsdrs.o drtiais.o drtians.o drtiblds.o \ + drtibls.o drtibs.o drticpds.o drticps.o drtics.o drtiis.o drtipiqs.o \ + drtircs.o drtiseis.o drtitts.o drtiwps.o drtiws.o drtlsds6.o drtlsds7.o \ + drtlsds.o drtmacds.o drtmas.o drtmdrs.o drtmls.o drtmps.o drtmris.o \ + drtmss.o drtmucs.o drtoas.o drtois.o drtopis.o drtos.o drtpbcs.o drtpcs.o \ + drtpcxs.o drtpdecs.o drtpdeds.o drtpfms.o drtpics.o drtporcs.o drtporis.o \ + drtppcs.o drtprsis.o drtpscs.o drtpsics.o drtpss.o drtpsss.o drtpvis.o \ + drtqds.o drtras.o drtrbas2.o drtrbas8.o drtrbls.o drtrbos1.o drtrbos6.o \ + drtrbos7.o drtrbs2.o drtrbs4.o drtrbs8.o drtrcdrs.o drtrcos.o drtrcps.o \ + drtrcs.o drtrdros.o drtrdrs1.o drtrdrs6.o drtrdrs8.o drtrds.o drtrecs.o \ + drtrfgs.o drtrfors.o drtrics.o drtrims.o drtris.o drtrlsds.o drtrmdrs.o \ + drtrms.o drtrmss6.o drtrmss7.o drtrpcs.o drtrpis.o drtrppcs.o drtrpphs.o \ + drtrpps.o drtrppss.o drtrps.o drtrris1.o drtrris6.o drtrris9.o drtrrms.o \ + drtrros.o drtrrpcs.o drtrrros.o drtrrs.o drtrrshs.o drtrrtps3.o \ + drtrrtps4.o drtrrtps5.o drtrrtps.o drtrscs.o drtrsers.o drtrses.o \ + drtrshs6.o drtrshs7.o drtrshs.o drtrsis.o drtrsns.o drtrsos.o drtrsrs.o \ + drtrss.o drtrsss.o drtrsts.o drtrtrs2.o drtrtrs4.o drtrvis.o drtrws.o \ + drtrwvms.o drtscris.o drtscs.o drtsdcs.o drtsds.o drtshds.o drtsins.o \ + drtsis.o drtsns.o drtspccs.o drtspcs.o drtspgis.o drtsptcs.o drtss.o \ + drtssrcs.o drtssrs.o drtsss.o drttms0.o drttms9.o drttscds.o drttsibs.o \ + drttsmds.o drttts.o drtudis.o drtvls.o drtwps.o drtwrs.o drtwrsrs.o \ + drtws.o drtxrs.o + +library = libdcmrt.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmrt/libsrc/drmdose.cc b/dcmrt/libsrc/drmdose.cc new file mode 100644 index 00000000..b9223742 --- /dev/null +++ b/dcmrt/libsrc/drmdose.cc @@ -0,0 +1,342 @@ +/* + * + * Copyright (C) 2012-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Dose objects + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drmdose.h" +#include "dcmtk/ofstd/ofbmanip.h" + +template +class PixelDataAccess { +public: + PixelDataAccess(const DcmPixelData& data, Uint16 pixelRep) + /* We cast away the const so that we get a nicer API where stuff can be const */ + : pixelData_(OFconst_cast(DcmPixelData&, data)) + , pixelRep_(pixelRep) + { + } + + double getPixel(Uint32 pixelNumber) + { + if (pixelRep_ == 1) { + DCMRT_TRACE("Accessing signed dose image data"); + return getPixelSigned(pixelNumber); + } else { + DCMRT_TRACE("Accessing unsigned dose image data"); + return getPixelUnsigned(pixelNumber); + } + } + + OFCondition getScaledPixels(OFVector &result, double scaling, Uint32 offset, Uint32 length) + { + if (pixelRep_ == 1) { + return getScaledPixelsSigned(result, scaling, offset, length); + } else { + return getScaledPixelsUnsigned(result, scaling, offset, length); + } + } + +protected: + // This is supposed to be a template, because getPixelUnsigned has the same + // code, just a different type. MSC6 doesn't support member function templates. + signedT getPixelSigned(Uint32 pixelNumber) + { + signedT result; + if (pixelData_.getPartialValue(&result, OFstatic_cast(Uint32, pixelNumber * sizeof(signedT)), OFstatic_cast(Uint32, sizeof(signedT))).bad()) + return -1; + return result; + } + + unsignedT getPixelUnsigned(Uint32 pixelNumber) + { + unsignedT result; + if (pixelData_.getPartialValue(&result, OFstatic_cast(Uint32, pixelNumber * sizeof(unsignedT)), OFstatic_cast(Uint32, sizeof(unsignedT))).bad()) + return -1; + return result; + } + + // This is supposed to be a template, because getScaledPixelsUnsigned has the same + // code, just a different type. MSC6 doesn't support member function templates. + OFCondition getScaledPixelsSigned(OFVector &result, double scaling, Uint32 offset, Uint32 length) + { + OFCondition cond = EC_Normal; + signedT* tmp = new signedT[length]; + if (!tmp) { + cond = EC_MemoryExhausted; + } else { + // First, get the "raw" pixel data + cond = pixelData_.getPartialValue(tmp, OFstatic_cast(Uint32, offset * sizeof(signedT)), OFstatic_cast(Uint32, length * sizeof(signedT))); + if (cond.good()) { + result.clear(); + result.reserve(length); + // Now convert it to double + for (Uint32 i = 0; i < length; i++) { + result.push_back(scaling * tmp[i]); + } + } + delete[] tmp; + } + + return cond; + } + + OFCondition getScaledPixelsUnsigned(OFVector &result, double scaling, Uint32 offset, Uint32 length) + { + OFCondition cond = EC_Normal; + unsignedT* tmp = new unsignedT[length]; + if (!tmp) { + cond = EC_MemoryExhausted; + } else { + // First, get the "raw" pixel data + cond = pixelData_.getPartialValue(tmp, OFstatic_cast(Uint32, offset * sizeof(unsignedT)), OFstatic_cast(Uint32, length * sizeof(unsignedT))); + if (cond.good()) { + result.clear(); + result.reserve(length); + // Now convert it to double + for (Uint32 i = 0; i < length; i++) { + result.push_back(scaling * tmp[i]); + } + } + delete[] tmp; + } + + return cond; + } + +private: + DcmPixelData &pixelData_; + Uint16 pixelRep_; +}; + +OFCondition DRTDose::loadFile(const OFFilename &filename, + const E_FileReadMode readMode, + const E_TransferSyntax readXfer) +{ + DcmFileFormat format; + OFCondition cond = format.loadFile(filename, readXfer, EGL_noChange, + DCM_MaxReadLength, readMode); + if (cond.good()) + cond = read(*format.getDataset()); + return cond; +} + +double DRTDose::getDose(unsigned int x, unsigned int y, unsigned int frame) const +{ + double result; + if (getDose(result, x, y, frame).bad()) + return 0; + return result; +} + +OFCondition DRTDose::getDose(double &result, unsigned int x, unsigned int y, unsigned int frame) const +{ + double gridScaling; + double dose; + OFCondition cond = getDoseGridScaling(gridScaling); + if (cond.good()) + cond = getUnscaledDose(dose, x, y, frame); + if (cond.good()) + result = gridScaling * dose; + else + result = 0; + return cond; +} + +double DRTDose::getUnscaledDose(unsigned int x, unsigned int y, unsigned int frame) const +{ + double result; + if (getUnscaledDose(result, x, y, frame).bad()) + return 0; + return result; +} + +static OFCondition getImageParameters(const DRTDose& dose, Uint32& frames, Uint16& rows, Uint16& columns, Uint16& bitsAllocated, Uint16& pixelRep) +{ + OFCondition cond = EC_Normal; + Sint32 tmp; + Uint16 bitsStored, highBit; + + // tbd: Would be nice to know which getter failed + if (cond.good()) + cond = dose.getNumberOfFrames(tmp); + if (cond.good()) + cond = dose.getRows(rows); + if (cond.good()) + cond = dose.getColumns(columns); + if (cond.good()) + cond = dose.getBitsAllocated(bitsAllocated); + if (cond.good()) + cond = dose.getBitsStored(bitsStored); + if (cond.good()) + cond = dose.getHighBit(highBit); + if (cond.good()) + cond = dose.getPixelRepresentation(pixelRep); + if (cond.good() && pixelRep != 0 && pixelRep != 1) + { + DCMRT_ERROR("Invalid value for PixelRepresentation (" << pixelRep << "), must be 0 or 1"); + cond = RT_EC_InvalidValue; + } + if (cond.good() && tmp < 0) + { + DCMRT_ERROR("Invalid value for NumberOfFrames (" << tmp << "), must be positive"); + cond = RT_EC_InvalidValue; + } + if (cond.good() && bitsStored != bitsAllocated) + { + DCMRT_ERROR("Different values for BitsStored (" << bitsStored << ") and BitsAllocated (" << bitsAllocated << "), must be the same"); + cond = RT_EC_InvalidValue; + } + if (cond.good() && highBit != bitsStored - 1) + { + DCMRT_ERROR("Invalid value for HighBit (" << highBit << "), must be BitsStored - 1 (" << (bitsStored - 1) << ")"); + cond = RT_EC_InvalidValue; + } + if (cond.good()) + frames = OFstatic_cast(Uint32, tmp); + return cond; +} + +OFCondition DRTDose::getUnscaledDose(double &result, unsigned int x, unsigned int y, unsigned int frame) const +{ + Uint32 frames; + Uint16 rows, columns, bitsAllocated, pixelRep; + OFCondition cond = EC_Normal; + + cond = getImageParameters(*this, frames, rows, columns, bitsAllocated, pixelRep); + if (cond.bad()) + return cond; + if (columns < x || rows < y || frames < frame) + return EC_IllegalParameter; + + Uint32 pixel_number = frame * columns * rows + y * columns + x; + DCMRT_TRACE("Getting pixel (" << x << "," << y << ") of frame " << frame << " (index " << pixel_number << ")"); + if (bitsAllocated == 16) { + DCMRT_TRACE("Dose image uses 16 bit per pixel"); + PixelDataAccess pixel(getPixelData(), pixelRep); + result = pixel.getPixel(pixel_number); + } else if (bitsAllocated == 32) { + DCMRT_TRACE("Dose image uses 32 bit per pixel"); + PixelDataAccess pixel(getPixelData(), pixelRep); + result = pixel.getPixel(pixel_number); + } else { + /* RT Dose Images may only have 16 or 32 bits stored */ + DCMRT_ERROR("Invalid value for BitsAllocated (" << bitsAllocated << "), only 16 and 32 allowed"); + return RT_EC_InvalidValue; + } + + return EC_Normal; +} + +OFCondition DRTDose::getDoseImage(OFVector &result, unsigned int frame) const +{ + Uint32 frames; + Uint32 offset, length; + Uint16 rows, columns, bitsAllocated, pixelRep; + double doseGridScaling; + OFCondition cond = EC_Normal; + + result.clear(); + + cond = getImageParameters(*this, frames, rows, columns, bitsAllocated, pixelRep); + if (cond.good()) + cond = getDoseGridScaling(doseGridScaling); + if (cond.bad()) + return cond; + + if (frame >= frames) + return EC_IllegalParameter; + + length = columns * rows; + offset = frame * length; + DCMRT_TRACE("Getting dose image for frame " << frame << " (offset=" << offset << ", length=" << length << ")"); + + if (bitsAllocated == 16) { + DCMRT_TRACE("Dose image uses 16 bit per pixel"); + PixelDataAccess pixel(getPixelData(), pixelRep); + cond = pixel.getScaledPixels(result, doseGridScaling, offset, length); + } else if (bitsAllocated == 32) { + DCMRT_TRACE("Dose image uses 32 bit per pixel"); + PixelDataAccess pixel(getPixelData(), pixelRep); + cond = pixel.getScaledPixels(result, doseGridScaling, offset, length); + } else { + /* RT Dose Images may only have 16 or 32 bits stored */ + DCMRT_ERROR("Invalid value for BitsAllocated (" << bitsAllocated << "), only 16 and 32 allowed"); + cond = RT_EC_InvalidValue; + } + + return cond; +} + +OFCondition DRTDose::getDoseImages(OFVector > &result) const +{ + Sint32 frames, i; + OFCondition cond = getNumberOfFrames(frames); + + if (cond.good() && frames < 0) + { + DCMRT_ERROR("Invalid value for NumberOfFrames (" << frames << "), must be positive"); + cond = EC_IllegalParameter; + } + if (cond.good()) + result.resize(frames); + + for (i = 0; i < frames; i++) + { + if (cond.good()) + cond = getDoseImage(result[i], i); + } + + if (cond.bad()) + result.clear(); + + return cond; +} + +Uint16 DRTDose::getDoseImageWidth() const +{ + Uint16 result; + if (getColumns(result).bad()) + result = 0; + return result; +} + +Uint16 DRTDose::getDoseImageHeight() const +{ + Uint16 result; + if (getRows(result).bad()) + result = 0; + return result; +} + +OFBool DRTDose::isValid() +{ + Uint32 frames; + Uint16 rows, columns, bitsAllocated, pixelRep; + OFCondition cond = EC_Normal; + + cond = getImageParameters(*this, frames, rows, columns, bitsAllocated, pixelRep); + if (cond.bad()) + return OFFalse; + + if (bitsAllocated != 16 && bitsAllocated != 32) + return OFFalse; + + return OFTrue; +} diff --git a/dcmrt/libsrc/drmimage.cc b/dcmrt/libsrc/drmimage.cc new file mode 100644 index 00000000..4a2f733f --- /dev/null +++ b/dcmrt/libsrc/drmimage.cc @@ -0,0 +1,106 @@ +/* + * + * Copyright (C) 2012-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Image objects + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drmimage.h" + +DRTImage::DRTImage() +: format_() +, dataset_(NULL) +, image_(NULL) +{ +} + +DRTImage::~DRTImage() +{ + reset(); +} + +void DRTImage::reset() +{ + delete image_; + delete dataset_; + format_.clear(); + image_ = NULL; + dataset_ = NULL; +} + +void DRTImage::clear() +{ + reset(); + DRTImageIOD::clear(); +} + +OFCondition DRTImage::loadFile(const OFFilename &filename, + const E_FileReadMode readMode, + const E_TransferSyntax readXfer) +{ + /* get rid of the old image before we mess with its dataset */ + reset(); + + OFCondition cond = format_.loadFile(filename, readXfer, EGL_noChange, + DCM_MaxReadLength, readMode); + if (cond.good()) + { + cond = DRTImageIOD::read(*format_.getDataset()); + if (cond.good()) + { + image_ = new DicomImage(&format_, + format_.getDataset()->getOriginalXfer(), + CIF_MayDetachPixelData); + } + } + if (cond.bad()) + clear(); + return cond; +} + +OFCondition DRTImage::read(DcmItem *dataset) +{ + /* get rid of the old image before we mess with its dataset */ + reset(); + + dataset_ = dataset; + OFCondition cond = DRTImageIOD::read(*format_.getDataset()); + if (cond.good()) + { + image_ = new DicomImage(&format_, + EXS_Unknown, CIF_MayDetachPixelData); + } + else + clear(); + return cond; +} + +OFCondition DRTImage::getOutputData(OFVector& result, const unsigned long frame) +{ + result.clear(); + + if (image_ == NULL) + return RT_EC_UnsupportedValue; + + // For now we can only do 8 bit gray + const int bits = 8; + const unsigned long size = image_->getOutputDataSize(bits); + result.resize(size); + + return statusToCondition(image_->getOutputData(&result[0], size, bits, frame)); +} diff --git a/dcmrt/libsrc/drmplan.cc b/dcmrt/libsrc/drmplan.cc new file mode 100644 index 00000000..bc4bbaa5 --- /dev/null +++ b/dcmrt/libsrc/drmplan.cc @@ -0,0 +1,90 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Plan objects + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drmplan.h" +#include "dcmtk/dcmrt/drmsrch.h" + +OFCondition DRTPlan::loadFile(const OFFilename &filename, + const E_FileReadMode readMode, + const E_TransferSyntax readXfer) +{ + DcmFileFormat format; + OFCondition cond = format.loadFile(filename, readXfer, EGL_noChange, + DCM_MaxReadLength, readMode); + if (cond.good()) + cond = read(*format.getDataset()); + return cond; +} + +DRTFractionGroupSequence::Item& DRTPlan::getFractionGroup(Sint32 fractionGroupNumber) +{ + // First some typedefs to make the following more readable + typedef DRTFractionGroupSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getFractionGroupSequence(), fractionGroupNumber, + &seq::Item::getFractionGroupNumber); +} + +DRTBeamSequence::Item& DRTPlan::getBeam(Sint32 beamNumber) +{ + // First some typedefs to make the following more readable + typedef DRTBeamSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getBeamSequence(), beamNumber, + &seq::Item::getBeamNumber); +} + +DRTDoseReferenceSequence::Item& DRTPlan::getDoseReference(Sint32 referenceNumber) +{ + // First some typedefs to make the following more readable + typedef DRTDoseReferenceSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getDoseReferenceSequence(), referenceNumber, + &seq::Item::getDoseReferenceNumber); +} + +DRTToleranceTableSequence::Item& DRTPlan::getToleranceTable(Sint32 tableNumber) +{ + // First some typedefs to make the following more readable + typedef DRTToleranceTableSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getToleranceTableSequence(), tableNumber, + &seq::Item::getToleranceTableNumber); +} + +DRTPatientSetupSequence::Item& DRTPlan::getPatientSetup(Sint32 setupNumber) +{ + // First some typedefs to make the following more readable + typedef DRTPatientSetupSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getPatientSetupSequence(), setupNumber, + &seq::Item::getPatientSetupNumber); +} + +DRTApplicationSetupSequence::Item& DRTPlan::getApplicationSetup(Sint32 setupNumber) +{ + // First some typedefs to make the following more readable + typedef DRTApplicationSetupSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getApplicationSetupSequence(), setupNumber, + &seq::Item::getApplicationSetupNumber); +} diff --git a/dcmrt/libsrc/drmstrct.cc b/dcmrt/libsrc/drmstrct.cc new file mode 100644 index 00000000..0ddbc580 --- /dev/null +++ b/dcmrt/libsrc/drmstrct.cc @@ -0,0 +1,122 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: Mid-Level API for RT Structure Set objects + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ +#include "dcmtk/dcmrt/drmstrct.h" +#include "dcmtk/dcmrt/drmsrch.h" + +OFCondition DRTStructureSet::loadFile(const OFFilename &filename, + const E_FileReadMode readMode, + const E_TransferSyntax readXfer) +{ + DcmFileFormat format; + OFCondition cond = format.loadFile(filename, readXfer, EGL_noChange, + DCM_MaxReadLength, readMode); + if (cond.good()) + cond = read(*format.getDataset()); + return cond; +} + +DRTReferencedFrameOfReferenceSequence::Item& DRTStructureSet::getFrameOfReference(const OFString& uid) +{ + // First some typedefs to make the following more readable + typedef DRTReferencedFrameOfReferenceSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getReferencedFrameOfReferenceSequence(), uid, + &seq::Item::getFrameOfReferenceUID); +} + +DRTStructureSetROISequence::Item& DRTStructureSet::getROI(Sint32 roiNumber) +{ + // First some typedefs to make the following more readable + typedef DRTStructureSetROISequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getStructureSetROISequence(), roiNumber, + &seq::Item::getROINumber); +} + +DRTRTROIObservationsSequence::Item& DRTStructureSet::getObservation(Sint32 observationNumber) +{ + // First some typedefs to make the following more readable + typedef DRTRTROIObservationsSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getRTROIObservationsSequence(), observationNumber, + &seq::Item::getObservationNumber); +} + +DRTRTROIObservationsSequence::Item& DRTStructureSet::getObservationByROINumber(Sint32 roiNumber) +{ + // First some typedefs to make the following more readable + typedef DRTRTROIObservationsSequence seq; + typedef DRTSearch::searchPropertyEqualHelper helper; + return helper::search(getRTROIObservationsSequence(), roiNumber, + &seq::Item::getReferencedROINumber); +} + +OFCondition DRTStructureSet::getContoursForROINumber(OFVector result, Sint32 roiNumber) +{ + DRTROIContourSequence& seq = getROIContourSequence(); + OFCondition cond = seq.gotoFirstItem(); + + // tbd: This method could easily be turned into a template if needed, + // to avoid code duplication + + // Go through all items in the sequence... + result.clear(); + while (cond.good()) { + Sint32 number; + DRTROIContourSequence::Item& item = seq.getCurrentItem(); + cond = item.getReferencedROINumber(number); + if (cond.bad()) + return cond; + // ...looking for items with the wanted roiNumber + if (number == roiNumber) + result.push_back(&item); + cond = seq.gotoNextItem(); + } + + return EC_Normal; +} + +OFCondition DRTStructureSet::getContoursForROINumber(OFList result, Sint32 roiNumber) +{ + DRTROIContourSequence& seq = getROIContourSequence(); + OFCondition cond = seq.gotoFirstItem(); + + // tbd: This method could easily be turned into a template if needed, + // to avoid code duplication + + // Go through all items in the sequence... + result.clear(); + while (cond.good()) { + Sint32 number; + DRTROIContourSequence::Item& item = seq.getCurrentItem(); + cond = item.getReferencedROINumber(number); + if (cond.bad()) + return cond; + // ...looking for items with the wanted roiNumber + if (number == roiNumber) + result.push_back(&item); + cond = seq.gotoNextItem(); + } + + return EC_Normal; +} diff --git a/dcmrt/libsrc/drtaadcs.cc b/dcmrt/libsrc/drtaadcs.cc new file mode 100644 index 00000000..32e4644e --- /dev/null +++ b/dcmrt/libsrc/drtaadcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTAssigningAgencyOrDepartmentCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtaadcs.h" + + +// --- item class --- + +DRTAssigningAgencyOrDepartmentCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::Item::~Item() +{ +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::Item &DRTAssigningAgencyOrDepartmentCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTAssigningAgencyOrDepartmentCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTAssigningAgencyOrDepartmentCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTAssigningAgencyOrDepartmentCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "AssigningAgencyOrDepartmentCodeSequence"); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTAssigningAgencyOrDepartmentCodeSequence::DRTAssigningAgencyOrDepartmentCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::DRTAssigningAgencyOrDepartmentCodeSequence(const DRTAssigningAgencyOrDepartmentCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTAssigningAgencyOrDepartmentCodeSequence &DRTAssigningAgencyOrDepartmentCodeSequence::operator=(const DRTAssigningAgencyOrDepartmentCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::~DRTAssigningAgencyOrDepartmentCodeSequence() +{ + clear(); +} + + +void DRTAssigningAgencyOrDepartmentCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTAssigningAgencyOrDepartmentCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTAssigningAgencyOrDepartmentCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTAssigningAgencyOrDepartmentCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::Item &DRTAssigningAgencyOrDepartmentCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTAssigningAgencyOrDepartmentCodeSequence::Item &DRTAssigningAgencyOrDepartmentCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::Item &DRTAssigningAgencyOrDepartmentCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTAssigningAgencyOrDepartmentCodeSequence::Item &DRTAssigningAgencyOrDepartmentCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTAssigningAgencyOrDepartmentCodeSequence::Item &DRTAssigningAgencyOrDepartmentCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTAssigningAgencyOrDepartmentCodeSequence::Item &DRTAssigningAgencyOrDepartmentCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_AssigningAgencyOrDepartmentCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_AssigningAgencyOrDepartmentCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTAssigningAgencyOrDepartmentCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_AssigningAgencyOrDepartmentCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtadcs.cc b/dcmrt/libsrc/drtadcs.cc new file mode 100644 index 00000000..aa9012ce --- /dev/null +++ b/dcmrt/libsrc/drtadcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTAdmittingDiagnosesCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtadcs.h" + + +// --- item class --- + +DRTAdmittingDiagnosesCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTAdmittingDiagnosesCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTAdmittingDiagnosesCodeSequence::Item::~Item() +{ +} + + +DRTAdmittingDiagnosesCodeSequence::Item &DRTAdmittingDiagnosesCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTAdmittingDiagnosesCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTAdmittingDiagnosesCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTAdmittingDiagnosesCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "AdmittingDiagnosesCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "AdmittingDiagnosesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "AdmittingDiagnosesCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "AdmittingDiagnosesCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "AdmittingDiagnosesCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "AdmittingDiagnosesCodeSequence"); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTAdmittingDiagnosesCodeSequence::DRTAdmittingDiagnosesCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTAdmittingDiagnosesCodeSequence::DRTAdmittingDiagnosesCodeSequence(const DRTAdmittingDiagnosesCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTAdmittingDiagnosesCodeSequence &DRTAdmittingDiagnosesCodeSequence::operator=(const DRTAdmittingDiagnosesCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTAdmittingDiagnosesCodeSequence::~DRTAdmittingDiagnosesCodeSequence() +{ + clear(); +} + + +void DRTAdmittingDiagnosesCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTAdmittingDiagnosesCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTAdmittingDiagnosesCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTAdmittingDiagnosesCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTAdmittingDiagnosesCodeSequence::Item &DRTAdmittingDiagnosesCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTAdmittingDiagnosesCodeSequence::Item &DRTAdmittingDiagnosesCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTAdmittingDiagnosesCodeSequence::Item &DRTAdmittingDiagnosesCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTAdmittingDiagnosesCodeSequence::Item &DRTAdmittingDiagnosesCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTAdmittingDiagnosesCodeSequence::Item &DRTAdmittingDiagnosesCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTAdmittingDiagnosesCodeSequence::Item &DRTAdmittingDiagnosesCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_AdmittingDiagnosesCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_AdmittingDiagnosesCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTAdmittingDiagnosesCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_AdmittingDiagnosesCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtads.cc b/dcmrt/libsrc/drtads.cc new file mode 100644 index 00000000..99775e6e --- /dev/null +++ b/dcmrt/libsrc/drtads.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTAdditionalDrugSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtads.h" + + +// --- item class --- + +DRTAdditionalDrugSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTAdditionalDrugSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTAdditionalDrugSequence::Item::~Item() +{ +} + + +DRTAdditionalDrugSequence::Item &DRTAdditionalDrugSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTAdditionalDrugSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTAdditionalDrugSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTAdditionalDrugSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTAdditionalDrugSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "AdditionalDrugSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "AdditionalDrugSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "AdditionalDrugSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "AdditionalDrugSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "AdditionalDrugSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "AdditionalDrugSequence"); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTAdditionalDrugSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTAdditionalDrugSequence::DRTAdditionalDrugSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTAdditionalDrugSequence::DRTAdditionalDrugSequence(const DRTAdditionalDrugSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTAdditionalDrugSequence &DRTAdditionalDrugSequence::operator=(const DRTAdditionalDrugSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTAdditionalDrugSequence::~DRTAdditionalDrugSequence() +{ + clear(); +} + + +void DRTAdditionalDrugSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTAdditionalDrugSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTAdditionalDrugSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTAdditionalDrugSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTAdditionalDrugSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTAdditionalDrugSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTAdditionalDrugSequence::Item &DRTAdditionalDrugSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTAdditionalDrugSequence::Item &DRTAdditionalDrugSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTAdditionalDrugSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTAdditionalDrugSequence::Item &DRTAdditionalDrugSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTAdditionalDrugSequence::Item &DRTAdditionalDrugSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTAdditionalDrugSequence::Item &DRTAdditionalDrugSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTAdditionalDrugSequence::Item &DRTAdditionalDrugSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTAdditionalDrugSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_AdditionalDrugSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_AdditionalDrugSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTAdditionalDrugSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_AdditionalDrugSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtafs.cc b/dcmrt/libsrc/drtafs.cc new file mode 100644 index 00000000..8c6fb5d8 --- /dev/null +++ b/dcmrt/libsrc/drtafs.cc @@ -0,0 +1,602 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTAssigningFacilitySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtafs.h" + + +// --- item class --- + +DRTAssigningFacilitySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LocalNamespaceEntityID(DCM_LocalNamespaceEntityID), + UniversalEntityID(DCM_UniversalEntityID), + UniversalEntityIDType(DCM_UniversalEntityIDType) +{ +} + + +DRTAssigningFacilitySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LocalNamespaceEntityID(copy.LocalNamespaceEntityID), + UniversalEntityID(copy.UniversalEntityID), + UniversalEntityIDType(copy.UniversalEntityIDType) +{ +} + + +DRTAssigningFacilitySequence::Item::~Item() +{ +} + + +DRTAssigningFacilitySequence::Item &DRTAssigningFacilitySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LocalNamespaceEntityID = copy.LocalNamespaceEntityID; + UniversalEntityID = copy.UniversalEntityID; + UniversalEntityIDType = copy.UniversalEntityIDType; + } + return *this; +} + + +void DRTAssigningFacilitySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + LocalNamespaceEntityID.clear(); + UniversalEntityID.clear(); + UniversalEntityIDType.clear(); + } +} + + +OFBool DRTAssigningFacilitySequence::Item::isEmpty() +{ + return LocalNamespaceEntityID.isEmpty() && + UniversalEntityID.isEmpty() && + UniversalEntityIDType.isEmpty(); +} + + +OFBool DRTAssigningFacilitySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTAssigningFacilitySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, LocalNamespaceEntityID, "1", "1C", "AssigningFacilitySequence"); + getAndCheckElementFromDataset(item, UniversalEntityID, "1", "1C", "AssigningFacilitySequence"); + getAndCheckElementFromDataset(item, UniversalEntityIDType, "1", "1C", "AssigningFacilitySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnlimitedText(LocalNamespaceEntityID), "1", "1C", "AssigningFacilitySequence"); + addElementToDataset(result, item, new DcmUnlimitedText(UniversalEntityID), "1", "1C", "AssigningFacilitySequence"); + addElementToDataset(result, item, new DcmCodeString(UniversalEntityIDType), "1", "1C", "AssigningFacilitySequence"); + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::Item::getLocalNamespaceEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LocalNamespaceEntityID, value, pos); +} + + +OFCondition DRTAssigningFacilitySequence::Item::getUniversalEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityID, value, pos); +} + + +OFCondition DRTAssigningFacilitySequence::Item::getUniversalEntityIDType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityIDType, value, pos); +} + + +OFCondition DRTAssigningFacilitySequence::Item::setLocalNamespaceEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = LocalNamespaceEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::Item::setUniversalEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = UniversalEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::Item::setUniversalEntityIDType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UniversalEntityIDType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTAssigningFacilitySequence::DRTAssigningFacilitySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTAssigningFacilitySequence::DRTAssigningFacilitySequence(const DRTAssigningFacilitySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTAssigningFacilitySequence &DRTAssigningFacilitySequence::operator=(const DRTAssigningFacilitySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTAssigningFacilitySequence::~DRTAssigningFacilitySequence() +{ + clear(); +} + + +void DRTAssigningFacilitySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTAssigningFacilitySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTAssigningFacilitySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTAssigningFacilitySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTAssigningFacilitySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTAssigningFacilitySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTAssigningFacilitySequence::Item &DRTAssigningFacilitySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTAssigningFacilitySequence::Item &DRTAssigningFacilitySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTAssigningFacilitySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTAssigningFacilitySequence::Item &DRTAssigningFacilitySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTAssigningFacilitySequence::Item &DRTAssigningFacilitySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTAssigningFacilitySequence::Item &DRTAssigningFacilitySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTAssigningFacilitySequence::Item &DRTAssigningFacilitySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTAssigningFacilitySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_AssigningFacilitySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_AssigningFacilitySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTAssigningFacilitySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_AssigningFacilitySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtags.cc b/dcmrt/libsrc/drtags.cc new file mode 100644 index 00000000..c6285b2b --- /dev/null +++ b/dcmrt/libsrc/drtags.cc @@ -0,0 +1,619 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTApplicatorGeometrySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtags.h" + + +// --- item class --- + +DRTApplicatorGeometrySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ApplicatorApertureShape(DCM_ApplicatorApertureShape), + ApplicatorOpening(DCM_ApplicatorOpening), + ApplicatorOpeningX(DCM_ApplicatorOpeningX), + ApplicatorOpeningY(DCM_ApplicatorOpeningY) +{ +} + + +DRTApplicatorGeometrySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ApplicatorApertureShape(copy.ApplicatorApertureShape), + ApplicatorOpening(copy.ApplicatorOpening), + ApplicatorOpeningX(copy.ApplicatorOpeningX), + ApplicatorOpeningY(copy.ApplicatorOpeningY) +{ +} + + +DRTApplicatorGeometrySequence::Item::~Item() +{ +} + + +DRTApplicatorGeometrySequence::Item &DRTApplicatorGeometrySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ApplicatorApertureShape = copy.ApplicatorApertureShape; + ApplicatorOpening = copy.ApplicatorOpening; + ApplicatorOpeningX = copy.ApplicatorOpeningX; + ApplicatorOpeningY = copy.ApplicatorOpeningY; + } + return *this; +} + + +void DRTApplicatorGeometrySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ApplicatorApertureShape.clear(); + ApplicatorOpening.clear(); + ApplicatorOpeningX.clear(); + ApplicatorOpeningY.clear(); + } +} + + +OFBool DRTApplicatorGeometrySequence::Item::isEmpty() +{ + return ApplicatorApertureShape.isEmpty() && + ApplicatorOpening.isEmpty() && + ApplicatorOpeningX.isEmpty() && + ApplicatorOpeningY.isEmpty(); +} + + +OFBool DRTApplicatorGeometrySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTApplicatorGeometrySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ApplicatorApertureShape, "1", "1", "ApplicatorGeometrySequence"); + getAndCheckElementFromDataset(item, ApplicatorOpening, "1", "1C", "ApplicatorGeometrySequence"); + getAndCheckElementFromDataset(item, ApplicatorOpeningX, "1", "1C", "ApplicatorGeometrySequence"); + getAndCheckElementFromDataset(item, ApplicatorOpeningY, "1", "1C", "ApplicatorGeometrySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ApplicatorApertureShape), "1", "1", "ApplicatorGeometrySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ApplicatorOpening), "1", "1C", "ApplicatorGeometrySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ApplicatorOpeningX), "1", "1C", "ApplicatorGeometrySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ApplicatorOpeningY), "1", "1C", "ApplicatorGeometrySequence"); + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::Item::getApplicatorApertureShape(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorApertureShape, value, pos); +} + + +OFCondition DRTApplicatorGeometrySequence::Item::getApplicatorOpening(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ApplicatorOpening).getFloat32(value, pos); +} + + +OFCondition DRTApplicatorGeometrySequence::Item::getApplicatorOpeningX(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ApplicatorOpeningX).getFloat32(value, pos); +} + + +OFCondition DRTApplicatorGeometrySequence::Item::getApplicatorOpeningY(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ApplicatorOpeningY).getFloat32(value, pos); +} + + +OFCondition DRTApplicatorGeometrySequence::Item::setApplicatorApertureShape(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorApertureShape.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::Item::setApplicatorOpening(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ApplicatorOpening.putFloat32(value, pos); +} + + +OFCondition DRTApplicatorGeometrySequence::Item::setApplicatorOpeningX(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ApplicatorOpeningX.putFloat32(value, pos); +} + + +OFCondition DRTApplicatorGeometrySequence::Item::setApplicatorOpeningY(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ApplicatorOpeningY.putFloat32(value, pos); +} + + +// --- sequence class --- + +DRTApplicatorGeometrySequence::DRTApplicatorGeometrySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTApplicatorGeometrySequence::DRTApplicatorGeometrySequence(const DRTApplicatorGeometrySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTApplicatorGeometrySequence &DRTApplicatorGeometrySequence::operator=(const DRTApplicatorGeometrySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTApplicatorGeometrySequence::~DRTApplicatorGeometrySequence() +{ + clear(); +} + + +void DRTApplicatorGeometrySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTApplicatorGeometrySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTApplicatorGeometrySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTApplicatorGeometrySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTApplicatorGeometrySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTApplicatorGeometrySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTApplicatorGeometrySequence::Item &DRTApplicatorGeometrySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTApplicatorGeometrySequence::Item &DRTApplicatorGeometrySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTApplicatorGeometrySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTApplicatorGeometrySequence::Item &DRTApplicatorGeometrySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTApplicatorGeometrySequence::Item &DRTApplicatorGeometrySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTApplicatorGeometrySequence::Item &DRTApplicatorGeometrySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTApplicatorGeometrySequence::Item &DRTApplicatorGeometrySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTApplicatorGeometrySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ApplicatorGeometrySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ApplicatorGeometrySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTApplicatorGeometrySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ApplicatorGeometrySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtajcs.cc b/dcmrt/libsrc/drtajcs.cc new file mode 100644 index 00000000..ed6c27d8 --- /dev/null +++ b/dcmrt/libsrc/drtajcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTAssigningJurisdictionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtajcs.h" + + +// --- item class --- + +DRTAssigningJurisdictionCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTAssigningJurisdictionCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTAssigningJurisdictionCodeSequence::Item::~Item() +{ +} + + +DRTAssigningJurisdictionCodeSequence::Item &DRTAssigningJurisdictionCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTAssigningJurisdictionCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTAssigningJurisdictionCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTAssigningJurisdictionCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "AssigningJurisdictionCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "AssigningJurisdictionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "AssigningJurisdictionCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "AssigningJurisdictionCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "AssigningJurisdictionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "AssigningJurisdictionCodeSequence"); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTAssigningJurisdictionCodeSequence::DRTAssigningJurisdictionCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTAssigningJurisdictionCodeSequence::DRTAssigningJurisdictionCodeSequence(const DRTAssigningJurisdictionCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTAssigningJurisdictionCodeSequence &DRTAssigningJurisdictionCodeSequence::operator=(const DRTAssigningJurisdictionCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTAssigningJurisdictionCodeSequence::~DRTAssigningJurisdictionCodeSequence() +{ + clear(); +} + + +void DRTAssigningJurisdictionCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTAssigningJurisdictionCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTAssigningJurisdictionCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTAssigningJurisdictionCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTAssigningJurisdictionCodeSequence::Item &DRTAssigningJurisdictionCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTAssigningJurisdictionCodeSequence::Item &DRTAssigningJurisdictionCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTAssigningJurisdictionCodeSequence::Item &DRTAssigningJurisdictionCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTAssigningJurisdictionCodeSequence::Item &DRTAssigningJurisdictionCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTAssigningJurisdictionCodeSequence::Item &DRTAssigningJurisdictionCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTAssigningJurisdictionCodeSequence::Item &DRTAssigningJurisdictionCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_AssigningJurisdictionCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_AssigningJurisdictionCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTAssigningJurisdictionCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_AssigningJurisdictionCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtas1.cc b/dcmrt/libsrc/drtas1.cc new file mode 100644 index 00000000..ff3ac9b9 --- /dev/null +++ b/dcmrt/libsrc/drtas1.cc @@ -0,0 +1,663 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTApplicatorSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtas1.h" + + +// --- item class --- + +DRTApplicatorSequenceInRTBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + ApplicatorDescription(DCM_ApplicatorDescription), + ApplicatorGeometrySequence(emptyDefaultItem /*emptyDefaultSequence*/), + ApplicatorID(DCM_ApplicatorID), + ApplicatorType(DCM_ApplicatorType), + SourceToApplicatorMountingPositionDistance(DCM_SourceToApplicatorMountingPositionDistance) +{ +} + + +DRTApplicatorSequenceInRTBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + ApplicatorDescription(copy.ApplicatorDescription), + ApplicatorGeometrySequence(copy.ApplicatorGeometrySequence), + ApplicatorID(copy.ApplicatorID), + ApplicatorType(copy.ApplicatorType), + SourceToApplicatorMountingPositionDistance(copy.SourceToApplicatorMountingPositionDistance) +{ +} + + +DRTApplicatorSequenceInRTBeamsModule::Item::~Item() +{ +} + + +DRTApplicatorSequenceInRTBeamsModule::Item &DRTApplicatorSequenceInRTBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + ApplicatorDescription = copy.ApplicatorDescription; + ApplicatorGeometrySequence = copy.ApplicatorGeometrySequence; + ApplicatorID = copy.ApplicatorID; + ApplicatorType = copy.ApplicatorType; + SourceToApplicatorMountingPositionDistance = copy.SourceToApplicatorMountingPositionDistance; + } + return *this; +} + + +void DRTApplicatorSequenceInRTBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ApplicatorID.clear(); + AccessoryCode.clear(); + ApplicatorType.clear(); + ApplicatorGeometrySequence.clear(); + SourceToApplicatorMountingPositionDistance.clear(); + ApplicatorDescription.clear(); + } +} + + +OFBool DRTApplicatorSequenceInRTBeamsModule::Item::isEmpty() +{ + return ApplicatorID.isEmpty() && + AccessoryCode.isEmpty() && + ApplicatorType.isEmpty() && + ApplicatorGeometrySequence.isEmpty() && + SourceToApplicatorMountingPositionDistance.isEmpty() && + ApplicatorDescription.isEmpty(); +} + + +OFBool DRTApplicatorSequenceInRTBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ApplicatorID, "1", "1", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorType, "1", "1", "ApplicatorSequence"); + ApplicatorGeometrySequence.read(item, "1-n", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, SourceToApplicatorMountingPositionDistance, "1", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorDescription, "1", "3", "ApplicatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(ApplicatorID), "1", "1", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmCodeString(ApplicatorType), "1", "1", "ApplicatorSequence"); + if (result.good()) result = ApplicatorGeometrySequence.write(item, "1-n", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(SourceToApplicatorMountingPositionDistance), "1", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(ApplicatorDescription), "1", "3", "ApplicatorSequence"); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::getApplicatorDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorDescription, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::getApplicatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorID, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::getApplicatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorType, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::getSourceToApplicatorMountingPositionDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, SourceToApplicatorMountingPositionDistance).getFloat32(value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::setApplicatorDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::setApplicatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::setApplicatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::Item::setSourceToApplicatorMountingPositionDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SourceToApplicatorMountingPositionDistance.putFloat32(value, pos); +} + + +// --- sequence class --- + +DRTApplicatorSequenceInRTBeamsModule::DRTApplicatorSequenceInRTBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTApplicatorSequenceInRTBeamsModule::DRTApplicatorSequenceInRTBeamsModule(const DRTApplicatorSequenceInRTBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTApplicatorSequenceInRTBeamsModule &DRTApplicatorSequenceInRTBeamsModule::operator=(const DRTApplicatorSequenceInRTBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTApplicatorSequenceInRTBeamsModule::~DRTApplicatorSequenceInRTBeamsModule() +{ + clear(); +} + + +void DRTApplicatorSequenceInRTBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTApplicatorSequenceInRTBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTApplicatorSequenceInRTBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTApplicatorSequenceInRTBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTApplicatorSequenceInRTBeamsModule::Item &DRTApplicatorSequenceInRTBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTBeamsModule::Item &DRTApplicatorSequenceInRTBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTApplicatorSequenceInRTBeamsModule::Item &DRTApplicatorSequenceInRTBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTBeamsModule::Item &DRTApplicatorSequenceInRTBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTApplicatorSequenceInRTBeamsModule::Item &DRTApplicatorSequenceInRTBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTApplicatorSequenceInRTBeamsModule::Item &DRTApplicatorSequenceInRTBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ApplicatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ApplicatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ApplicatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtas5.cc b/dcmrt/libsrc/drtas5.cc new file mode 100644 index 00000000..d5f33fe9 --- /dev/null +++ b/dcmrt/libsrc/drtas5.cc @@ -0,0 +1,663 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTApplicatorSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtas5.h" + + +// --- item class --- + +DRTApplicatorSequenceInRTImageModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + ApplicatorDescription(DCM_ApplicatorDescription), + ApplicatorGeometrySequence(emptyDefaultItem /*emptyDefaultSequence*/), + ApplicatorID(DCM_ApplicatorID), + ApplicatorType(DCM_ApplicatorType), + SourceToApplicatorMountingPositionDistance(DCM_SourceToApplicatorMountingPositionDistance) +{ +} + + +DRTApplicatorSequenceInRTImageModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + ApplicatorDescription(copy.ApplicatorDescription), + ApplicatorGeometrySequence(copy.ApplicatorGeometrySequence), + ApplicatorID(copy.ApplicatorID), + ApplicatorType(copy.ApplicatorType), + SourceToApplicatorMountingPositionDistance(copy.SourceToApplicatorMountingPositionDistance) +{ +} + + +DRTApplicatorSequenceInRTImageModule::Item::~Item() +{ +} + + +DRTApplicatorSequenceInRTImageModule::Item &DRTApplicatorSequenceInRTImageModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + ApplicatorDescription = copy.ApplicatorDescription; + ApplicatorGeometrySequence = copy.ApplicatorGeometrySequence; + ApplicatorID = copy.ApplicatorID; + ApplicatorType = copy.ApplicatorType; + SourceToApplicatorMountingPositionDistance = copy.SourceToApplicatorMountingPositionDistance; + } + return *this; +} + + +void DRTApplicatorSequenceInRTImageModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ApplicatorID.clear(); + AccessoryCode.clear(); + ApplicatorType.clear(); + ApplicatorGeometrySequence.clear(); + SourceToApplicatorMountingPositionDistance.clear(); + ApplicatorDescription.clear(); + } +} + + +OFBool DRTApplicatorSequenceInRTImageModule::Item::isEmpty() +{ + return ApplicatorID.isEmpty() && + AccessoryCode.isEmpty() && + ApplicatorType.isEmpty() && + ApplicatorGeometrySequence.isEmpty() && + SourceToApplicatorMountingPositionDistance.isEmpty() && + ApplicatorDescription.isEmpty(); +} + + +OFBool DRTApplicatorSequenceInRTImageModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ApplicatorID, "1", "1", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorType, "1", "1", "ApplicatorSequence"); + ApplicatorGeometrySequence.read(item, "1-n", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, SourceToApplicatorMountingPositionDistance, "1", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorDescription, "1", "3", "ApplicatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(ApplicatorID), "1", "1", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmCodeString(ApplicatorType), "1", "1", "ApplicatorSequence"); + if (result.good()) result = ApplicatorGeometrySequence.write(item, "1-n", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(SourceToApplicatorMountingPositionDistance), "1", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(ApplicatorDescription), "1", "3", "ApplicatorSequence"); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::getApplicatorDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorDescription, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::getApplicatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorID, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::getApplicatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorType, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::getSourceToApplicatorMountingPositionDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, SourceToApplicatorMountingPositionDistance).getFloat32(value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::setApplicatorDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::setApplicatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::setApplicatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::Item::setSourceToApplicatorMountingPositionDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SourceToApplicatorMountingPositionDistance.putFloat32(value, pos); +} + + +// --- sequence class --- + +DRTApplicatorSequenceInRTImageModule::DRTApplicatorSequenceInRTImageModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTApplicatorSequenceInRTImageModule::DRTApplicatorSequenceInRTImageModule(const DRTApplicatorSequenceInRTImageModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTApplicatorSequenceInRTImageModule &DRTApplicatorSequenceInRTImageModule::operator=(const DRTApplicatorSequenceInRTImageModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTApplicatorSequenceInRTImageModule::~DRTApplicatorSequenceInRTImageModule() +{ + clear(); +} + + +void DRTApplicatorSequenceInRTImageModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTApplicatorSequenceInRTImageModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTApplicatorSequenceInRTImageModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTApplicatorSequenceInRTImageModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTApplicatorSequenceInRTImageModule::Item &DRTApplicatorSequenceInRTImageModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTImageModule::Item &DRTApplicatorSequenceInRTImageModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTApplicatorSequenceInRTImageModule::Item &DRTApplicatorSequenceInRTImageModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTImageModule::Item &DRTApplicatorSequenceInRTImageModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTApplicatorSequenceInRTImageModule::Item &DRTApplicatorSequenceInRTImageModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTApplicatorSequenceInRTImageModule::Item &DRTApplicatorSequenceInRTImageModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ApplicatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ApplicatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTImageModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ApplicatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtas6.cc b/dcmrt/libsrc/drtas6.cc new file mode 100644 index 00000000..b33f4893 --- /dev/null +++ b/dcmrt/libsrc/drtas6.cc @@ -0,0 +1,631 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTApplicatorSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtas6.h" + + +// --- item class --- + +DRTApplicatorSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + ApplicatorDescription(DCM_ApplicatorDescription), + ApplicatorID(DCM_ApplicatorID), + ApplicatorType(DCM_ApplicatorType) +{ +} + + +DRTApplicatorSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + ApplicatorDescription(copy.ApplicatorDescription), + ApplicatorID(copy.ApplicatorID), + ApplicatorType(copy.ApplicatorType) +{ +} + + +DRTApplicatorSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTApplicatorSequenceInRTIonBeamsModule::Item &DRTApplicatorSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + ApplicatorDescription = copy.ApplicatorDescription; + ApplicatorID = copy.ApplicatorID; + ApplicatorType = copy.ApplicatorType; + } + return *this; +} + + +void DRTApplicatorSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ApplicatorID.clear(); + AccessoryCode.clear(); + ApplicatorType.clear(); + ApplicatorDescription.clear(); + } +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return ApplicatorID.isEmpty() && + AccessoryCode.isEmpty() && + ApplicatorType.isEmpty() && + ApplicatorDescription.isEmpty(); +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ApplicatorID, "1", "1", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorType, "1", "1", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorDescription, "1", "3", "ApplicatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(ApplicatorID), "1", "1", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmCodeString(ApplicatorType), "1", "1", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(ApplicatorDescription), "1", "3", "ApplicatorSequence"); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::getApplicatorDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorDescription, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::getApplicatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorID, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::getApplicatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorType, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::setApplicatorDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::setApplicatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::Item::setApplicatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTApplicatorSequenceInRTIonBeamsModule::DRTApplicatorSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTApplicatorSequenceInRTIonBeamsModule::DRTApplicatorSequenceInRTIonBeamsModule(const DRTApplicatorSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTApplicatorSequenceInRTIonBeamsModule &DRTApplicatorSequenceInRTIonBeamsModule::operator=(const DRTApplicatorSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTApplicatorSequenceInRTIonBeamsModule::~DRTApplicatorSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTApplicatorSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTApplicatorSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTApplicatorSequenceInRTIonBeamsModule::Item &DRTApplicatorSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTIonBeamsModule::Item &DRTApplicatorSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTApplicatorSequenceInRTIonBeamsModule::Item &DRTApplicatorSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTIonBeamsModule::Item &DRTApplicatorSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTApplicatorSequenceInRTIonBeamsModule::Item &DRTApplicatorSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTApplicatorSequenceInRTIonBeamsModule::Item &DRTApplicatorSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ApplicatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ApplicatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ApplicatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtas7.cc b/dcmrt/libsrc/drtas7.cc new file mode 100644 index 00000000..2922045a --- /dev/null +++ b/dcmrt/libsrc/drtas7.cc @@ -0,0 +1,631 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTApplicatorSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtas7.h" + + +// --- item class --- + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + ApplicatorDescription(DCM_ApplicatorDescription), + ApplicatorID(DCM_ApplicatorID), + ApplicatorType(DCM_ApplicatorType) +{ +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + ApplicatorDescription(copy.ApplicatorDescription), + ApplicatorID(copy.ApplicatorID), + ApplicatorType(copy.ApplicatorType) +{ +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::~Item() +{ +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + ApplicatorDescription = copy.ApplicatorDescription; + ApplicatorID = copy.ApplicatorID; + ApplicatorType = copy.ApplicatorType; + } + return *this; +} + + +void DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ApplicatorID.clear(); + AccessoryCode.clear(); + ApplicatorType.clear(); + ApplicatorDescription.clear(); + } +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::isEmpty() +{ + return ApplicatorID.isEmpty() && + AccessoryCode.isEmpty() && + ApplicatorType.isEmpty() && + ApplicatorDescription.isEmpty(); +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ApplicatorID, "1", "1", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorType, "1", "1", "ApplicatorSequence"); + getAndCheckElementFromDataset(item, ApplicatorDescription, "1", "3", "ApplicatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(ApplicatorID), "1", "1", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmCodeString(ApplicatorType), "1", "1", "ApplicatorSequence"); + addElementToDataset(result, item, new DcmLongString(ApplicatorDescription), "1", "3", "ApplicatorSequence"); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::getApplicatorDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorDescription, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::getApplicatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorID, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::getApplicatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicatorType, value, pos); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::setApplicatorDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::setApplicatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item::setApplicatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicatorType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::DRTApplicatorSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::DRTApplicatorSequenceInRTIonBeamsSessionRecordModule(const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::operator=(const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::~DRTApplicatorSequenceInRTIonBeamsSessionRecordModule() +{ + clear(); +} + + +void DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::Item &DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ApplicatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ApplicatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTApplicatorSequenceInRTIonBeamsSessionRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ApplicatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtass.cc b/dcmrt/libsrc/drtass.cc new file mode 100644 index 00000000..d0e96329 --- /dev/null +++ b/dcmrt/libsrc/drtass.cc @@ -0,0 +1,795 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTApplicationSetupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtass.h" + + +// --- item class --- + +DRTApplicationSetupSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ApplicationSetupManufacturer(DCM_ApplicationSetupManufacturer), + ApplicationSetupName(DCM_ApplicationSetupName), + ApplicationSetupNumber(DCM_ApplicationSetupNumber), + ApplicationSetupType(DCM_ApplicationSetupType), + BrachyAccessoryDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ChannelSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedReferenceImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + TemplateName(DCM_TemplateName), + TemplateNumber(DCM_TemplateNumber), + TemplateType(DCM_TemplateType), + TotalReferenceAirKerma(DCM_TotalReferenceAirKerma) +{ +} + + +DRTApplicationSetupSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ApplicationSetupManufacturer(copy.ApplicationSetupManufacturer), + ApplicationSetupName(copy.ApplicationSetupName), + ApplicationSetupNumber(copy.ApplicationSetupNumber), + ApplicationSetupType(copy.ApplicationSetupType), + BrachyAccessoryDeviceSequence(copy.BrachyAccessoryDeviceSequence), + ChannelSequence(copy.ChannelSequence), + ReferencedReferenceImageSequence(copy.ReferencedReferenceImageSequence), + TemplateName(copy.TemplateName), + TemplateNumber(copy.TemplateNumber), + TemplateType(copy.TemplateType), + TotalReferenceAirKerma(copy.TotalReferenceAirKerma) +{ +} + + +DRTApplicationSetupSequence::Item::~Item() +{ +} + + +DRTApplicationSetupSequence::Item &DRTApplicationSetupSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ApplicationSetupManufacturer = copy.ApplicationSetupManufacturer; + ApplicationSetupName = copy.ApplicationSetupName; + ApplicationSetupNumber = copy.ApplicationSetupNumber; + ApplicationSetupType = copy.ApplicationSetupType; + BrachyAccessoryDeviceSequence = copy.BrachyAccessoryDeviceSequence; + ChannelSequence = copy.ChannelSequence; + ReferencedReferenceImageSequence = copy.ReferencedReferenceImageSequence; + TemplateName = copy.TemplateName; + TemplateNumber = copy.TemplateNumber; + TemplateType = copy.TemplateType; + TotalReferenceAirKerma = copy.TotalReferenceAirKerma; + } + return *this; +} + + +void DRTApplicationSetupSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ApplicationSetupType.clear(); + ApplicationSetupNumber.clear(); + ApplicationSetupName.clear(); + ApplicationSetupManufacturer.clear(); + TemplateNumber.clear(); + TemplateType.clear(); + TemplateName.clear(); + ReferencedReferenceImageSequence.clear(); + TotalReferenceAirKerma.clear(); + BrachyAccessoryDeviceSequence.clear(); + ChannelSequence.clear(); + } +} + + +OFBool DRTApplicationSetupSequence::Item::isEmpty() +{ + return ApplicationSetupType.isEmpty() && + ApplicationSetupNumber.isEmpty() && + ApplicationSetupName.isEmpty() && + ApplicationSetupManufacturer.isEmpty() && + TemplateNumber.isEmpty() && + TemplateType.isEmpty() && + TemplateName.isEmpty() && + ReferencedReferenceImageSequence.isEmpty() && + TotalReferenceAirKerma.isEmpty() && + BrachyAccessoryDeviceSequence.isEmpty() && + ChannelSequence.isEmpty(); +} + + +OFBool DRTApplicationSetupSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTApplicationSetupSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ApplicationSetupType, "1", "1", "ApplicationSetupSequence"); + getAndCheckElementFromDataset(item, ApplicationSetupNumber, "1", "1", "ApplicationSetupSequence"); + getAndCheckElementFromDataset(item, ApplicationSetupName, "1", "3", "ApplicationSetupSequence"); + getAndCheckElementFromDataset(item, ApplicationSetupManufacturer, "1", "3", "ApplicationSetupSequence"); + getAndCheckElementFromDataset(item, TemplateNumber, "1", "3", "ApplicationSetupSequence"); + getAndCheckElementFromDataset(item, TemplateType, "1", "3", "ApplicationSetupSequence"); + getAndCheckElementFromDataset(item, TemplateName, "1", "3", "ApplicationSetupSequence"); + ReferencedReferenceImageSequence.read(item, "1-n", "3", "ApplicationSetupSequence"); + getAndCheckElementFromDataset(item, TotalReferenceAirKerma, "1", "1", "ApplicationSetupSequence"); + BrachyAccessoryDeviceSequence.read(item, "1-n", "3", "ApplicationSetupSequence"); + ChannelSequence.read(item, "1-n", "1", "ApplicationSetupSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ApplicationSetupType), "1", "1", "ApplicationSetupSequence"); + addElementToDataset(result, item, new DcmIntegerString(ApplicationSetupNumber), "1", "1", "ApplicationSetupSequence"); + addElementToDataset(result, item, new DcmLongString(ApplicationSetupName), "1", "3", "ApplicationSetupSequence"); + addElementToDataset(result, item, new DcmLongString(ApplicationSetupManufacturer), "1", "3", "ApplicationSetupSequence"); + addElementToDataset(result, item, new DcmIntegerString(TemplateNumber), "1", "3", "ApplicationSetupSequence"); + addElementToDataset(result, item, new DcmShortString(TemplateType), "1", "3", "ApplicationSetupSequence"); + addElementToDataset(result, item, new DcmLongString(TemplateName), "1", "3", "ApplicationSetupSequence"); + if (result.good()) result = ReferencedReferenceImageSequence.write(item, "1-n", "3", "ApplicationSetupSequence"); + addElementToDataset(result, item, new DcmDecimalString(TotalReferenceAirKerma), "1", "1", "ApplicationSetupSequence"); + if (result.good()) result = BrachyAccessoryDeviceSequence.write(item, "1-n", "3", "ApplicationSetupSequence"); + if (result.good()) result = ChannelSequence.write(item, "1-n", "1", "ApplicationSetupSequence"); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::getApplicationSetupManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicationSetupManufacturer, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getApplicationSetupName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicationSetupName, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getApplicationSetupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicationSetupNumber, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getApplicationSetupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ApplicationSetupNumber).getSint32(value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getApplicationSetupType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ApplicationSetupType, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getTemplateName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TemplateName, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getTemplateNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TemplateNumber, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getTemplateNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, TemplateNumber).getSint32(value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getTemplateType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TemplateType, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getTotalReferenceAirKerma(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TotalReferenceAirKerma, value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::getTotalReferenceAirKerma(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TotalReferenceAirKerma).getFloat64(value, pos); +} + + +OFCondition DRTApplicationSetupSequence::Item::setApplicationSetupManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicationSetupManufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::setApplicationSetupName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicationSetupName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::setApplicationSetupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicationSetupNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::setApplicationSetupType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApplicationSetupType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::setTemplateName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TemplateName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::setTemplateNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TemplateNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::setTemplateType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TemplateType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::Item::setTotalReferenceAirKerma(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TotalReferenceAirKerma.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTApplicationSetupSequence::DRTApplicationSetupSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTApplicationSetupSequence::DRTApplicationSetupSequence(const DRTApplicationSetupSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTApplicationSetupSequence &DRTApplicationSetupSequence::operator=(const DRTApplicationSetupSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTApplicationSetupSequence::~DRTApplicationSetupSequence() +{ + clear(); +} + + +void DRTApplicationSetupSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTApplicationSetupSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTApplicationSetupSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTApplicationSetupSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTApplicationSetupSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTApplicationSetupSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTApplicationSetupSequence::Item &DRTApplicationSetupSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTApplicationSetupSequence::Item &DRTApplicationSetupSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTApplicationSetupSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTApplicationSetupSequence::Item &DRTApplicationSetupSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTApplicationSetupSequence::Item &DRTApplicationSetupSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTApplicationSetupSequence::Item &DRTApplicationSetupSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTApplicationSetupSequence::Item &DRTApplicationSetupSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTApplicationSetupSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ApplicationSetupSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ApplicationSetupSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTApplicationSetupSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ApplicationSetupSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbads.cc b/dcmrt/libsrc/drtbads.cc new file mode 100644 index 00000000..60470eaa --- /dev/null +++ b/dcmrt/libsrc/drtbads.cc @@ -0,0 +1,783 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBrachyAccessoryDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbads.h" + + +// --- item class --- + +DRTBrachyAccessoryDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BrachyAccessoryDeviceID(DCM_BrachyAccessoryDeviceID), + BrachyAccessoryDeviceName(DCM_BrachyAccessoryDeviceName), + BrachyAccessoryDeviceNominalThickness(DCM_BrachyAccessoryDeviceNominalThickness), + BrachyAccessoryDeviceNominalTransmission(DCM_BrachyAccessoryDeviceNominalTransmission), + BrachyAccessoryDeviceNumber(DCM_BrachyAccessoryDeviceNumber), + BrachyAccessoryDeviceType(DCM_BrachyAccessoryDeviceType), + MaterialID(DCM_MaterialID), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTBrachyAccessoryDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BrachyAccessoryDeviceID(copy.BrachyAccessoryDeviceID), + BrachyAccessoryDeviceName(copy.BrachyAccessoryDeviceName), + BrachyAccessoryDeviceNominalThickness(copy.BrachyAccessoryDeviceNominalThickness), + BrachyAccessoryDeviceNominalTransmission(copy.BrachyAccessoryDeviceNominalTransmission), + BrachyAccessoryDeviceNumber(copy.BrachyAccessoryDeviceNumber), + BrachyAccessoryDeviceType(copy.BrachyAccessoryDeviceType), + MaterialID(copy.MaterialID), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTBrachyAccessoryDeviceSequence::Item::~Item() +{ +} + + +DRTBrachyAccessoryDeviceSequence::Item &DRTBrachyAccessoryDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BrachyAccessoryDeviceID = copy.BrachyAccessoryDeviceID; + BrachyAccessoryDeviceName = copy.BrachyAccessoryDeviceName; + BrachyAccessoryDeviceNominalThickness = copy.BrachyAccessoryDeviceNominalThickness; + BrachyAccessoryDeviceNominalTransmission = copy.BrachyAccessoryDeviceNominalTransmission; + BrachyAccessoryDeviceNumber = copy.BrachyAccessoryDeviceNumber; + BrachyAccessoryDeviceType = copy.BrachyAccessoryDeviceType; + MaterialID = copy.MaterialID; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTBrachyAccessoryDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BrachyAccessoryDeviceNumber.clear(); + BrachyAccessoryDeviceID.clear(); + BrachyAccessoryDeviceType.clear(); + BrachyAccessoryDeviceName.clear(); + MaterialID.clear(); + BrachyAccessoryDeviceNominalThickness.clear(); + BrachyAccessoryDeviceNominalTransmission.clear(); + ReferencedROINumber.clear(); + } +} + + +OFBool DRTBrachyAccessoryDeviceSequence::Item::isEmpty() +{ + return BrachyAccessoryDeviceNumber.isEmpty() && + BrachyAccessoryDeviceID.isEmpty() && + BrachyAccessoryDeviceType.isEmpty() && + BrachyAccessoryDeviceName.isEmpty() && + MaterialID.isEmpty() && + BrachyAccessoryDeviceNominalThickness.isEmpty() && + BrachyAccessoryDeviceNominalTransmission.isEmpty() && + ReferencedROINumber.isEmpty(); +} + + +OFBool DRTBrachyAccessoryDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BrachyAccessoryDeviceNumber, "1", "2", "BrachyAccessoryDeviceSequence"); + getAndCheckElementFromDataset(item, BrachyAccessoryDeviceID, "1", "2", "BrachyAccessoryDeviceSequence"); + getAndCheckElementFromDataset(item, BrachyAccessoryDeviceType, "1", "1", "BrachyAccessoryDeviceSequence"); + getAndCheckElementFromDataset(item, BrachyAccessoryDeviceName, "1", "3", "BrachyAccessoryDeviceSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "3", "BrachyAccessoryDeviceSequence"); + getAndCheckElementFromDataset(item, BrachyAccessoryDeviceNominalThickness, "1", "3", "BrachyAccessoryDeviceSequence"); + getAndCheckElementFromDataset(item, BrachyAccessoryDeviceNominalTransmission, "1", "3", "BrachyAccessoryDeviceSequence"); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "2", "BrachyAccessoryDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(BrachyAccessoryDeviceNumber), "1", "2", "BrachyAccessoryDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(BrachyAccessoryDeviceID), "1", "2", "BrachyAccessoryDeviceSequence"); + addElementToDataset(result, item, new DcmCodeString(BrachyAccessoryDeviceType), "1", "1", "BrachyAccessoryDeviceSequence"); + addElementToDataset(result, item, new DcmLongString(BrachyAccessoryDeviceName), "1", "3", "BrachyAccessoryDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "3", "BrachyAccessoryDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(BrachyAccessoryDeviceNominalThickness), "1", "3", "BrachyAccessoryDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(BrachyAccessoryDeviceNominalTransmission), "1", "3", "BrachyAccessoryDeviceSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "2", "BrachyAccessoryDeviceSequence"); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyAccessoryDeviceID, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyAccessoryDeviceName, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceNominalThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyAccessoryDeviceNominalThickness, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceNominalThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BrachyAccessoryDeviceNominalThickness).getFloat64(value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceNominalTransmission(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyAccessoryDeviceNominalTransmission, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceNominalTransmission(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BrachyAccessoryDeviceNominalTransmission).getFloat64(value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyAccessoryDeviceNumber, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BrachyAccessoryDeviceNumber).getSint32(value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getBrachyAccessoryDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyAccessoryDeviceType, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setBrachyAccessoryDeviceID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyAccessoryDeviceID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setBrachyAccessoryDeviceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyAccessoryDeviceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setBrachyAccessoryDeviceNominalThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyAccessoryDeviceNominalThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setBrachyAccessoryDeviceNominalTransmission(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyAccessoryDeviceNominalTransmission.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setBrachyAccessoryDeviceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyAccessoryDeviceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setBrachyAccessoryDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyAccessoryDeviceType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBrachyAccessoryDeviceSequence::DRTBrachyAccessoryDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBrachyAccessoryDeviceSequence::DRTBrachyAccessoryDeviceSequence(const DRTBrachyAccessoryDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBrachyAccessoryDeviceSequence &DRTBrachyAccessoryDeviceSequence::operator=(const DRTBrachyAccessoryDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBrachyAccessoryDeviceSequence::~DRTBrachyAccessoryDeviceSequence() +{ + clear(); +} + + +void DRTBrachyAccessoryDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBrachyAccessoryDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBrachyAccessoryDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBrachyAccessoryDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBrachyAccessoryDeviceSequence::Item &DRTBrachyAccessoryDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBrachyAccessoryDeviceSequence::Item &DRTBrachyAccessoryDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBrachyAccessoryDeviceSequence::Item &DRTBrachyAccessoryDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBrachyAccessoryDeviceSequence::Item &DRTBrachyAccessoryDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBrachyAccessoryDeviceSequence::Item &DRTBrachyAccessoryDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBrachyAccessoryDeviceSequence::Item &DRTBrachyAccessoryDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BrachyAccessoryDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BrachyAccessoryDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBrachyAccessoryDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BrachyAccessoryDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbas.cc b/dcmrt/libsrc/drtbas.cc new file mode 100644 index 00000000..22863ad7 --- /dev/null +++ b/dcmrt/libsrc/drtbas.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTContrastBolusAgentSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbas.h" + + +// --- item class --- + +DRTContrastBolusAgentSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTContrastBolusAgentSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTContrastBolusAgentSequence::Item::~Item() +{ +} + + +DRTContrastBolusAgentSequence::Item &DRTContrastBolusAgentSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTContrastBolusAgentSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTContrastBolusAgentSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTContrastBolusAgentSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ContrastBolusAgentSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ContrastBolusAgentSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ContrastBolusAgentSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ContrastBolusAgentSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ContrastBolusAgentSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ContrastBolusAgentSequence"); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTContrastBolusAgentSequence::DRTContrastBolusAgentSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTContrastBolusAgentSequence::DRTContrastBolusAgentSequence(const DRTContrastBolusAgentSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTContrastBolusAgentSequence &DRTContrastBolusAgentSequence::operator=(const DRTContrastBolusAgentSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTContrastBolusAgentSequence::~DRTContrastBolusAgentSequence() +{ + clear(); +} + + +void DRTContrastBolusAgentSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTContrastBolusAgentSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTContrastBolusAgentSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTContrastBolusAgentSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTContrastBolusAgentSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTContrastBolusAgentSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTContrastBolusAgentSequence::Item &DRTContrastBolusAgentSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTContrastBolusAgentSequence::Item &DRTContrastBolusAgentSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTContrastBolusAgentSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTContrastBolusAgentSequence::Item &DRTContrastBolusAgentSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTContrastBolusAgentSequence::Item &DRTContrastBolusAgentSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTContrastBolusAgentSequence::Item &DRTContrastBolusAgentSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTContrastBolusAgentSequence::Item &DRTContrastBolusAgentSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTContrastBolusAgentSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ContrastBolusAgentSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ContrastBolusAgentSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTContrastBolusAgentSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ContrastBolusAgentSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbcps.cc b/dcmrt/libsrc/drtbcps.cc new file mode 100644 index 00000000..a3540204 --- /dev/null +++ b/dcmrt/libsrc/drtbcps.cc @@ -0,0 +1,708 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBrachyControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbcps.h" + + +// --- item class --- + +DRTBrachyControlPointSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BrachyReferencedDoseReferenceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ControlPoint3DPosition(DCM_ControlPoint3DPosition), + ControlPointIndex(DCM_ControlPointIndex), + ControlPointOrientation(DCM_ControlPointOrientation), + ControlPointRelativePosition(DCM_ControlPointRelativePosition), + CumulativeTimeWeight(DCM_CumulativeTimeWeight) +{ +} + + +DRTBrachyControlPointSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BrachyReferencedDoseReferenceSequence(copy.BrachyReferencedDoseReferenceSequence), + ControlPoint3DPosition(copy.ControlPoint3DPosition), + ControlPointIndex(copy.ControlPointIndex), + ControlPointOrientation(copy.ControlPointOrientation), + ControlPointRelativePosition(copy.ControlPointRelativePosition), + CumulativeTimeWeight(copy.CumulativeTimeWeight) +{ +} + + +DRTBrachyControlPointSequence::Item::~Item() +{ +} + + +DRTBrachyControlPointSequence::Item &DRTBrachyControlPointSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BrachyReferencedDoseReferenceSequence = copy.BrachyReferencedDoseReferenceSequence; + ControlPoint3DPosition = copy.ControlPoint3DPosition; + ControlPointIndex = copy.ControlPointIndex; + ControlPointOrientation = copy.ControlPointOrientation; + ControlPointRelativePosition = copy.ControlPointRelativePosition; + CumulativeTimeWeight = copy.CumulativeTimeWeight; + } + return *this; +} + + +void DRTBrachyControlPointSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ControlPointIndex.clear(); + CumulativeTimeWeight.clear(); + ControlPointRelativePosition.clear(); + ControlPoint3DPosition.clear(); + ControlPointOrientation.clear(); + BrachyReferencedDoseReferenceSequence.clear(); + } +} + + +OFBool DRTBrachyControlPointSequence::Item::isEmpty() +{ + return ControlPointIndex.isEmpty() && + CumulativeTimeWeight.isEmpty() && + ControlPointRelativePosition.isEmpty() && + ControlPoint3DPosition.isEmpty() && + ControlPointOrientation.isEmpty() && + BrachyReferencedDoseReferenceSequence.isEmpty(); +} + + +OFBool DRTBrachyControlPointSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBrachyControlPointSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ControlPointIndex, "1", "1", "BrachyControlPointSequence"); + getAndCheckElementFromDataset(item, CumulativeTimeWeight, "1", "2", "BrachyControlPointSequence"); + getAndCheckElementFromDataset(item, ControlPointRelativePosition, "1", "1", "BrachyControlPointSequence"); + getAndCheckElementFromDataset(item, ControlPoint3DPosition, "3", "3", "BrachyControlPointSequence"); + getAndCheckElementFromDataset(item, ControlPointOrientation, "3", "3", "BrachyControlPointSequence"); + BrachyReferencedDoseReferenceSequence.read(item, "1-n", "3", "BrachyControlPointSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ControlPointIndex), "1", "1", "BrachyControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(CumulativeTimeWeight), "1", "2", "BrachyControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(ControlPointRelativePosition), "1", "1", "BrachyControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(ControlPoint3DPosition), "3", "3", "BrachyControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ControlPointOrientation), "3", "3", "BrachyControlPointSequence"); + if (result.good()) result = BrachyReferencedDoseReferenceSequence.write(item, "1-n", "3", "BrachyControlPointSequence"); + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPoint3DPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ControlPoint3DPosition, value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPoint3DPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ControlPoint3DPosition).getFloat64(value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPoint3DPosition(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ControlPoint3DPosition).getFloat64Vector(value); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPointIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ControlPointIndex, value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPointIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ControlPointIndex).getSint32(value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPointOrientation(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ControlPointOrientation).getFloat32(value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPointRelativePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ControlPointRelativePosition, value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getControlPointRelativePosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ControlPointRelativePosition).getFloat64(value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getCumulativeTimeWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeTimeWeight, value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::getCumulativeTimeWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeTimeWeight).getFloat64(value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::setControlPoint3DPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = ControlPoint3DPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::Item::setControlPointIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ControlPointIndex.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::Item::setControlPointOrientation(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ControlPointOrientation.putFloat32(value, pos); +} + + +OFCondition DRTBrachyControlPointSequence::Item::setControlPointRelativePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ControlPointRelativePosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::Item::setCumulativeTimeWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeTimeWeight.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBrachyControlPointSequence::DRTBrachyControlPointSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBrachyControlPointSequence::DRTBrachyControlPointSequence(const DRTBrachyControlPointSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBrachyControlPointSequence &DRTBrachyControlPointSequence::operator=(const DRTBrachyControlPointSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBrachyControlPointSequence::~DRTBrachyControlPointSequence() +{ + clear(); +} + + +void DRTBrachyControlPointSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBrachyControlPointSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBrachyControlPointSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBrachyControlPointSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBrachyControlPointSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBrachyControlPointSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBrachyControlPointSequence::Item &DRTBrachyControlPointSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBrachyControlPointSequence::Item &DRTBrachyControlPointSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBrachyControlPointSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBrachyControlPointSequence::Item &DRTBrachyControlPointSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBrachyControlPointSequence::Item &DRTBrachyControlPointSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBrachyControlPointSequence::Item &DRTBrachyControlPointSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBrachyControlPointSequence::Item &DRTBrachyControlPointSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBrachyControlPointSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BrachyControlPointSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BrachyControlPointSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBrachyControlPointSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BrachyControlPointSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbl2.cc b/dcmrt/libsrc/drtbl2.cc new file mode 100644 index 00000000..37548f82 --- /dev/null +++ b/dcmrt/libsrc/drtbl2.cc @@ -0,0 +1,984 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBlockSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbl2.h" + + +// --- item class --- + +DRTBlockSequenceInRTBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BlockData(DCM_BlockData), + BlockDivergence(DCM_BlockDivergence), + BlockMountingPosition(DCM_BlockMountingPosition), + BlockName(DCM_BlockName), + BlockNumber(DCM_BlockNumber), + BlockNumberOfPoints(DCM_BlockNumberOfPoints), + BlockThickness(DCM_BlockThickness), + BlockTransmission(DCM_BlockTransmission), + BlockTrayID(DCM_BlockTrayID), + BlockType(DCM_BlockType), + MaterialID(DCM_MaterialID), + SourceToBlockTrayDistance(DCM_SourceToBlockTrayDistance), + TrayAccessoryCode(DCM_TrayAccessoryCode) +{ +} + + +DRTBlockSequenceInRTBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BlockData(copy.BlockData), + BlockDivergence(copy.BlockDivergence), + BlockMountingPosition(copy.BlockMountingPosition), + BlockName(copy.BlockName), + BlockNumber(copy.BlockNumber), + BlockNumberOfPoints(copy.BlockNumberOfPoints), + BlockThickness(copy.BlockThickness), + BlockTransmission(copy.BlockTransmission), + BlockTrayID(copy.BlockTrayID), + BlockType(copy.BlockType), + MaterialID(copy.MaterialID), + SourceToBlockTrayDistance(copy.SourceToBlockTrayDistance), + TrayAccessoryCode(copy.TrayAccessoryCode) +{ +} + + +DRTBlockSequenceInRTBeamsModule::Item::~Item() +{ +} + + +DRTBlockSequenceInRTBeamsModule::Item &DRTBlockSequenceInRTBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BlockData = copy.BlockData; + BlockDivergence = copy.BlockDivergence; + BlockMountingPosition = copy.BlockMountingPosition; + BlockName = copy.BlockName; + BlockNumber = copy.BlockNumber; + BlockNumberOfPoints = copy.BlockNumberOfPoints; + BlockThickness = copy.BlockThickness; + BlockTransmission = copy.BlockTransmission; + BlockTrayID = copy.BlockTrayID; + BlockType = copy.BlockType; + MaterialID = copy.MaterialID; + SourceToBlockTrayDistance = copy.SourceToBlockTrayDistance; + TrayAccessoryCode = copy.TrayAccessoryCode; + } + return *this; +} + + +void DRTBlockSequenceInRTBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BlockTrayID.clear(); + TrayAccessoryCode.clear(); + AccessoryCode.clear(); + SourceToBlockTrayDistance.clear(); + BlockType.clear(); + BlockDivergence.clear(); + BlockMountingPosition.clear(); + BlockNumber.clear(); + BlockName.clear(); + MaterialID.clear(); + BlockThickness.clear(); + BlockTransmission.clear(); + BlockNumberOfPoints.clear(); + BlockData.clear(); + } +} + + +OFBool DRTBlockSequenceInRTBeamsModule::Item::isEmpty() +{ + return BlockTrayID.isEmpty() && + TrayAccessoryCode.isEmpty() && + AccessoryCode.isEmpty() && + SourceToBlockTrayDistance.isEmpty() && + BlockType.isEmpty() && + BlockDivergence.isEmpty() && + BlockMountingPosition.isEmpty() && + BlockNumber.isEmpty() && + BlockName.isEmpty() && + MaterialID.isEmpty() && + BlockThickness.isEmpty() && + BlockTransmission.isEmpty() && + BlockNumberOfPoints.isEmpty() && + BlockData.isEmpty(); +} + + +OFBool DRTBlockSequenceInRTBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BlockTrayID, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, TrayAccessoryCode, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, SourceToBlockTrayDistance, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockType, "1", "1", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockDivergence, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockMountingPosition, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockNumber, "1", "1", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockName, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockThickness, "1", "2C", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockTransmission, "1", "2C", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockNumberOfPoints, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockData, "2-2n", "2", "BlockSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(BlockTrayID), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmLongString(TrayAccessoryCode), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToBlockTrayDistance), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockType), "1", "1", "BlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockDivergence), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockMountingPosition), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(BlockNumber), "1", "1", "BlockSequence"); + addElementToDataset(result, item, new DcmLongString(BlockName), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockThickness), "1", "2C", "BlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockTransmission), "1", "2C", "BlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(BlockNumberOfPoints), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockData), "2-2n", "2", "BlockSequence"); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockData, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockData).getFloat64(value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockData).getFloat64Vector(value); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockDivergence(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockDivergence, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockMountingPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockMountingPosition, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockName, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockNumber, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BlockNumber).getSint32(value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockNumberOfPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockNumberOfPoints, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockNumberOfPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BlockNumberOfPoints).getSint32(value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockThickness, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockThickness).getFloat64(value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockTransmission(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockTransmission, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockTransmission(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockTransmission).getFloat64(value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockTrayID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockTrayID, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getBlockType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockType, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getSourceToBlockTrayDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToBlockTrayDistance, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getSourceToBlockTrayDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToBlockTrayDistance).getFloat64(value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::getTrayAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TrayAccessoryCode, value, pos); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2-2n") : EC_Normal; + if (result.good()) + result = BlockData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockDivergence(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockDivergence.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockMountingPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockMountingPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockNumberOfPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockNumberOfPoints.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockTransmission(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockTransmission.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockTrayID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockTrayID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setBlockType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setSourceToBlockTrayDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToBlockTrayDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::Item::setTrayAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TrayAccessoryCode.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBlockSequenceInRTBeamsModule::DRTBlockSequenceInRTBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBlockSequenceInRTBeamsModule::DRTBlockSequenceInRTBeamsModule(const DRTBlockSequenceInRTBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBlockSequenceInRTBeamsModule &DRTBlockSequenceInRTBeamsModule::operator=(const DRTBlockSequenceInRTBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBlockSequenceInRTBeamsModule::~DRTBlockSequenceInRTBeamsModule() +{ + clear(); +} + + +void DRTBlockSequenceInRTBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBlockSequenceInRTBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBlockSequenceInRTBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBlockSequenceInRTBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBlockSequenceInRTBeamsModule::Item &DRTBlockSequenceInRTBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBlockSequenceInRTBeamsModule::Item &DRTBlockSequenceInRTBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBlockSequenceInRTBeamsModule::Item &DRTBlockSequenceInRTBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBlockSequenceInRTBeamsModule::Item &DRTBlockSequenceInRTBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBlockSequenceInRTBeamsModule::Item &DRTBlockSequenceInRTBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBlockSequenceInRTBeamsModule::Item &DRTBlockSequenceInRTBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BlockSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BlockSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBlockSequenceInRTBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BlockSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbl5.cc b/dcmrt/libsrc/drtbl5.cc new file mode 100644 index 00000000..18fa5c34 --- /dev/null +++ b/dcmrt/libsrc/drtbl5.cc @@ -0,0 +1,946 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBlockSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbl5.h" + + +// --- item class --- + +DRTBlockSequenceInRTImageModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BlockData(DCM_BlockData), + BlockDivergence(DCM_BlockDivergence), + BlockMountingPosition(DCM_BlockMountingPosition), + BlockName(DCM_BlockName), + BlockNumber(DCM_BlockNumber), + BlockNumberOfPoints(DCM_BlockNumberOfPoints), + BlockThickness(DCM_BlockThickness), + BlockTrayID(DCM_BlockTrayID), + BlockType(DCM_BlockType), + MaterialID(DCM_MaterialID), + SourceToBlockTrayDistance(DCM_SourceToBlockTrayDistance), + TrayAccessoryCode(DCM_TrayAccessoryCode) +{ +} + + +DRTBlockSequenceInRTImageModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BlockData(copy.BlockData), + BlockDivergence(copy.BlockDivergence), + BlockMountingPosition(copy.BlockMountingPosition), + BlockName(copy.BlockName), + BlockNumber(copy.BlockNumber), + BlockNumberOfPoints(copy.BlockNumberOfPoints), + BlockThickness(copy.BlockThickness), + BlockTrayID(copy.BlockTrayID), + BlockType(copy.BlockType), + MaterialID(copy.MaterialID), + SourceToBlockTrayDistance(copy.SourceToBlockTrayDistance), + TrayAccessoryCode(copy.TrayAccessoryCode) +{ +} + + +DRTBlockSequenceInRTImageModule::Item::~Item() +{ +} + + +DRTBlockSequenceInRTImageModule::Item &DRTBlockSequenceInRTImageModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BlockData = copy.BlockData; + BlockDivergence = copy.BlockDivergence; + BlockMountingPosition = copy.BlockMountingPosition; + BlockName = copy.BlockName; + BlockNumber = copy.BlockNumber; + BlockNumberOfPoints = copy.BlockNumberOfPoints; + BlockThickness = copy.BlockThickness; + BlockTrayID = copy.BlockTrayID; + BlockType = copy.BlockType; + MaterialID = copy.MaterialID; + SourceToBlockTrayDistance = copy.SourceToBlockTrayDistance; + TrayAccessoryCode = copy.TrayAccessoryCode; + } + return *this; +} + + +void DRTBlockSequenceInRTImageModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BlockTrayID.clear(); + TrayAccessoryCode.clear(); + AccessoryCode.clear(); + SourceToBlockTrayDistance.clear(); + BlockType.clear(); + BlockDivergence.clear(); + BlockMountingPosition.clear(); + BlockNumber.clear(); + BlockName.clear(); + MaterialID.clear(); + BlockThickness.clear(); + BlockNumberOfPoints.clear(); + BlockData.clear(); + } +} + + +OFBool DRTBlockSequenceInRTImageModule::Item::isEmpty() +{ + return BlockTrayID.isEmpty() && + TrayAccessoryCode.isEmpty() && + AccessoryCode.isEmpty() && + SourceToBlockTrayDistance.isEmpty() && + BlockType.isEmpty() && + BlockDivergence.isEmpty() && + BlockMountingPosition.isEmpty() && + BlockNumber.isEmpty() && + BlockName.isEmpty() && + MaterialID.isEmpty() && + BlockThickness.isEmpty() && + BlockNumberOfPoints.isEmpty() && + BlockData.isEmpty(); +} + + +OFBool DRTBlockSequenceInRTImageModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BlockTrayID, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, TrayAccessoryCode, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, SourceToBlockTrayDistance, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockType, "1", "1", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockDivergence, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockMountingPosition, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockNumber, "1", "1", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockName, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockThickness, "1", "3", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockNumberOfPoints, "1", "2", "BlockSequence"); + getAndCheckElementFromDataset(item, BlockData, "2-2n", "2", "BlockSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(BlockTrayID), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmLongString(TrayAccessoryCode), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToBlockTrayDistance), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockType), "1", "1", "BlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockDivergence), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockMountingPosition), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(BlockNumber), "1", "1", "BlockSequence"); + addElementToDataset(result, item, new DcmLongString(BlockName), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockThickness), "1", "3", "BlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(BlockNumberOfPoints), "1", "2", "BlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockData), "2-2n", "2", "BlockSequence"); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockData, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockData).getFloat64(value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockData).getFloat64Vector(value); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockDivergence(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockDivergence, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockMountingPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockMountingPosition, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockName, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockNumber, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BlockNumber).getSint32(value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockNumberOfPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockNumberOfPoints, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockNumberOfPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BlockNumberOfPoints).getSint32(value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockThickness, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockThickness).getFloat64(value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockTrayID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockTrayID, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getBlockType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockType, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getSourceToBlockTrayDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToBlockTrayDistance, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getSourceToBlockTrayDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToBlockTrayDistance).getFloat64(value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::getTrayAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TrayAccessoryCode, value, pos); +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2-2n") : EC_Normal; + if (result.good()) + result = BlockData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockDivergence(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockDivergence.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockMountingPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockMountingPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockNumberOfPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockNumberOfPoints.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockTrayID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockTrayID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setBlockType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setSourceToBlockTrayDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToBlockTrayDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::Item::setTrayAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TrayAccessoryCode.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBlockSequenceInRTImageModule::DRTBlockSequenceInRTImageModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBlockSequenceInRTImageModule::DRTBlockSequenceInRTImageModule(const DRTBlockSequenceInRTImageModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBlockSequenceInRTImageModule &DRTBlockSequenceInRTImageModule::operator=(const DRTBlockSequenceInRTImageModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBlockSequenceInRTImageModule::~DRTBlockSequenceInRTImageModule() +{ + clear(); +} + + +void DRTBlockSequenceInRTImageModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBlockSequenceInRTImageModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBlockSequenceInRTImageModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBlockSequenceInRTImageModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBlockSequenceInRTImageModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBlockSequenceInRTImageModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBlockSequenceInRTImageModule::Item &DRTBlockSequenceInRTImageModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBlockSequenceInRTImageModule::Item &DRTBlockSequenceInRTImageModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBlockSequenceInRTImageModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBlockSequenceInRTImageModule::Item &DRTBlockSequenceInRTImageModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBlockSequenceInRTImageModule::Item &DRTBlockSequenceInRTImageModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBlockSequenceInRTImageModule::Item &DRTBlockSequenceInRTImageModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBlockSequenceInRTImageModule::Item &DRTBlockSequenceInRTImageModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBlockSequenceInRTImageModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BlockSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BlockSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBlockSequenceInRTImageModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BlockSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbldls.cc b/dcmrt/libsrc/drtbldls.cc new file mode 100644 index 00000000..dae74eaa --- /dev/null +++ b/dcmrt/libsrc/drtbldls.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamLimitingDeviceLeafPairsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbldls.h" + + +// --- item class --- + +DRTBeamLimitingDeviceLeafPairsSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + NumberOfLeafJawPairs(DCM_NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(DCM_RTBeamLimitingDeviceType) +{ +} + + +DRTBeamLimitingDeviceLeafPairsSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + NumberOfLeafJawPairs(copy.NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(copy.RTBeamLimitingDeviceType) +{ +} + + +DRTBeamLimitingDeviceLeafPairsSequence::Item::~Item() +{ +} + + +DRTBeamLimitingDeviceLeafPairsSequence::Item &DRTBeamLimitingDeviceLeafPairsSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + NumberOfLeafJawPairs = copy.NumberOfLeafJawPairs; + RTBeamLimitingDeviceType = copy.RTBeamLimitingDeviceType; + } + return *this; +} + + +void DRTBeamLimitingDeviceLeafPairsSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RTBeamLimitingDeviceType.clear(); + NumberOfLeafJawPairs.clear(); + } +} + + +OFBool DRTBeamLimitingDeviceLeafPairsSequence::Item::isEmpty() +{ + return RTBeamLimitingDeviceType.isEmpty() && + NumberOfLeafJawPairs.isEmpty(); +} + + +OFBool DRTBeamLimitingDeviceLeafPairsSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RTBeamLimitingDeviceType, "1", "1", "BeamLimitingDeviceLeafPairsSequence"); + getAndCheckElementFromDataset(item, NumberOfLeafJawPairs, "1", "1", "BeamLimitingDeviceLeafPairsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RTBeamLimitingDeviceType), "1", "1", "BeamLimitingDeviceLeafPairsSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfLeafJawPairs), "1", "1", "BeamLimitingDeviceLeafPairsSequence"); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::Item::getNumberOfLeafJawPairs(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfLeafJawPairs, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::Item::getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfLeafJawPairs).getSint32(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::Item::getRTBeamLimitingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTBeamLimitingDeviceType, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::Item::setNumberOfLeafJawPairs(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfLeafJawPairs.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::Item::setRTBeamLimitingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTBeamLimitingDeviceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamLimitingDeviceLeafPairsSequence::DRTBeamLimitingDeviceLeafPairsSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamLimitingDeviceLeafPairsSequence::DRTBeamLimitingDeviceLeafPairsSequence(const DRTBeamLimitingDeviceLeafPairsSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamLimitingDeviceLeafPairsSequence &DRTBeamLimitingDeviceLeafPairsSequence::operator=(const DRTBeamLimitingDeviceLeafPairsSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamLimitingDeviceLeafPairsSequence::~DRTBeamLimitingDeviceLeafPairsSequence() +{ + clear(); +} + + +void DRTBeamLimitingDeviceLeafPairsSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamLimitingDeviceLeafPairsSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamLimitingDeviceLeafPairsSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamLimitingDeviceLeafPairsSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamLimitingDeviceLeafPairsSequence::Item &DRTBeamLimitingDeviceLeafPairsSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceLeafPairsSequence::Item &DRTBeamLimitingDeviceLeafPairsSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamLimitingDeviceLeafPairsSequence::Item &DRTBeamLimitingDeviceLeafPairsSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceLeafPairsSequence::Item &DRTBeamLimitingDeviceLeafPairsSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamLimitingDeviceLeafPairsSequence::Item &DRTBeamLimitingDeviceLeafPairsSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamLimitingDeviceLeafPairsSequence::Item &DRTBeamLimitingDeviceLeafPairsSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamLimitingDeviceLeafPairsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamLimitingDeviceLeafPairsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceLeafPairsSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamLimitingDeviceLeafPairsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbldps.cc b/dcmrt/libsrc/drtbldps.cc new file mode 100644 index 00000000..5f6f8d53 --- /dev/null +++ b/dcmrt/libsrc/drtbldps.cc @@ -0,0 +1,591 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamLimitingDevicePositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbldps.h" + + +// --- item class --- + +DRTBeamLimitingDevicePositionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LeafJawPositions(DCM_LeafJawPositions), + RTBeamLimitingDeviceType(DCM_RTBeamLimitingDeviceType) +{ +} + + +DRTBeamLimitingDevicePositionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LeafJawPositions(copy.LeafJawPositions), + RTBeamLimitingDeviceType(copy.RTBeamLimitingDeviceType) +{ +} + + +DRTBeamLimitingDevicePositionSequence::Item::~Item() +{ +} + + +DRTBeamLimitingDevicePositionSequence::Item &DRTBeamLimitingDevicePositionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LeafJawPositions = copy.LeafJawPositions; + RTBeamLimitingDeviceType = copy.RTBeamLimitingDeviceType; + } + return *this; +} + + +void DRTBeamLimitingDevicePositionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RTBeamLimitingDeviceType.clear(); + LeafJawPositions.clear(); + } +} + + +OFBool DRTBeamLimitingDevicePositionSequence::Item::isEmpty() +{ + return RTBeamLimitingDeviceType.isEmpty() && + LeafJawPositions.isEmpty(); +} + + +OFBool DRTBeamLimitingDevicePositionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RTBeamLimitingDeviceType, "1", "1", "BeamLimitingDevicePositionSequence"); + getAndCheckElementFromDataset(item, LeafJawPositions, "2-2n", "1", "BeamLimitingDevicePositionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RTBeamLimitingDeviceType), "1", "1", "BeamLimitingDevicePositionSequence"); + addElementToDataset(result, item, new DcmDecimalString(LeafJawPositions), "2-2n", "1", "BeamLimitingDevicePositionSequence"); + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::getLeafJawPositions(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LeafJawPositions, value, pos); +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::getLeafJawPositions(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafJawPositions).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::getLeafJawPositions(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafJawPositions).getFloat64Vector(value); +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::getRTBeamLimitingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTBeamLimitingDeviceType, value, pos); +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::setLeafJawPositions(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2-2n") : EC_Normal; + if (result.good()) + result = LeafJawPositions.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::Item::setRTBeamLimitingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTBeamLimitingDeviceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamLimitingDevicePositionSequence::DRTBeamLimitingDevicePositionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamLimitingDevicePositionSequence::DRTBeamLimitingDevicePositionSequence(const DRTBeamLimitingDevicePositionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamLimitingDevicePositionSequence &DRTBeamLimitingDevicePositionSequence::operator=(const DRTBeamLimitingDevicePositionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamLimitingDevicePositionSequence::~DRTBeamLimitingDevicePositionSequence() +{ + clear(); +} + + +void DRTBeamLimitingDevicePositionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamLimitingDevicePositionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamLimitingDevicePositionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamLimitingDevicePositionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamLimitingDevicePositionSequence::Item &DRTBeamLimitingDevicePositionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamLimitingDevicePositionSequence::Item &DRTBeamLimitingDevicePositionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamLimitingDevicePositionSequence::Item &DRTBeamLimitingDevicePositionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamLimitingDevicePositionSequence::Item &DRTBeamLimitingDevicePositionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamLimitingDevicePositionSequence::Item &DRTBeamLimitingDevicePositionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamLimitingDevicePositionSequence::Item &DRTBeamLimitingDevicePositionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamLimitingDevicePositionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamLimitingDevicePositionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamLimitingDevicePositionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamLimitingDevicePositionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtblds1.cc b/dcmrt/libsrc/drtblds1.cc new file mode 100644 index 00000000..7b94c34a --- /dev/null +++ b/dcmrt/libsrc/drtblds1.cc @@ -0,0 +1,667 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamLimitingDeviceSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtblds1.h" + + +// --- item class --- + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LeafPositionBoundaries(DCM_LeafPositionBoundaries), + NumberOfLeafJawPairs(DCM_NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(DCM_RTBeamLimitingDeviceType), + SourceToBeamLimitingDeviceDistance(DCM_SourceToBeamLimitingDeviceDistance) +{ +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LeafPositionBoundaries(copy.LeafPositionBoundaries), + NumberOfLeafJawPairs(copy.NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(copy.RTBeamLimitingDeviceType), + SourceToBeamLimitingDeviceDistance(copy.SourceToBeamLimitingDeviceDistance) +{ +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::~Item() +{ +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LeafPositionBoundaries = copy.LeafPositionBoundaries; + NumberOfLeafJawPairs = copy.NumberOfLeafJawPairs; + RTBeamLimitingDeviceType = copy.RTBeamLimitingDeviceType; + SourceToBeamLimitingDeviceDistance = copy.SourceToBeamLimitingDeviceDistance; + } + return *this; +} + + +void DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RTBeamLimitingDeviceType.clear(); + SourceToBeamLimitingDeviceDistance.clear(); + NumberOfLeafJawPairs.clear(); + LeafPositionBoundaries.clear(); + } +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::isEmpty() +{ + return RTBeamLimitingDeviceType.isEmpty() && + SourceToBeamLimitingDeviceDistance.isEmpty() && + NumberOfLeafJawPairs.isEmpty() && + LeafPositionBoundaries.isEmpty(); +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RTBeamLimitingDeviceType, "1", "1", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, SourceToBeamLimitingDeviceDistance, "1", "3", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, NumberOfLeafJawPairs, "1", "1", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, LeafPositionBoundaries, "3-n", "2C", "BeamLimitingDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RTBeamLimitingDeviceType), "1", "1", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToBeamLimitingDeviceDistance), "1", "3", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfLeafJawPairs), "1", "1", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(LeafPositionBoundaries), "3-n", "2C", "BeamLimitingDeviceSequence"); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getLeafPositionBoundaries(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LeafPositionBoundaries, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getLeafPositionBoundaries(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getLeafPositionBoundaries(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64Vector(value); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getNumberOfLeafJawPairs(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfLeafJawPairs, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfLeafJawPairs).getSint32(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getRTBeamLimitingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTBeamLimitingDeviceType, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getSourceToBeamLimitingDeviceDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToBeamLimitingDeviceDistance, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::getSourceToBeamLimitingDeviceDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToBeamLimitingDeviceDistance).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::setLeafPositionBoundaries(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3-n") : EC_Normal; + if (result.good()) + result = LeafPositionBoundaries.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::setNumberOfLeafJawPairs(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfLeafJawPairs.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::setRTBeamLimitingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTBeamLimitingDeviceType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item::setSourceToBeamLimitingDeviceDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToBeamLimitingDeviceDistance.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::DRTBeamLimitingDeviceSequenceInRTBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::DRTBeamLimitingDeviceSequenceInRTBeamsModule(const DRTBeamLimitingDeviceSequenceInRTBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule &DRTBeamLimitingDeviceSequenceInRTBeamsModule::operator=(const DRTBeamLimitingDeviceSequenceInRTBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::~DRTBeamLimitingDeviceSequenceInRTBeamsModule() +{ + clear(); +} + + +void DRTBeamLimitingDeviceSequenceInRTBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamLimitingDeviceSequenceInRTBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamLimitingDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamLimitingDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamLimitingDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtblds5.cc b/dcmrt/libsrc/drtblds5.cc new file mode 100644 index 00000000..73f4ed00 --- /dev/null +++ b/dcmrt/libsrc/drtblds5.cc @@ -0,0 +1,714 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamLimitingDeviceSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtblds5.h" + + +// --- item class --- + +DRTBeamLimitingDeviceSequenceInRTImageModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LeafJawPositions(DCM_LeafJawPositions), + LeafPositionBoundaries(DCM_LeafPositionBoundaries), + NumberOfLeafJawPairs(DCM_NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(DCM_RTBeamLimitingDeviceType), + SourceToBeamLimitingDeviceDistance(DCM_SourceToBeamLimitingDeviceDistance) +{ +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LeafJawPositions(copy.LeafJawPositions), + LeafPositionBoundaries(copy.LeafPositionBoundaries), + NumberOfLeafJawPairs(copy.NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(copy.RTBeamLimitingDeviceType), + SourceToBeamLimitingDeviceDistance(copy.SourceToBeamLimitingDeviceDistance) +{ +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::Item::~Item() +{ +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::Item &DRTBeamLimitingDeviceSequenceInRTImageModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LeafJawPositions = copy.LeafJawPositions; + LeafPositionBoundaries = copy.LeafPositionBoundaries; + NumberOfLeafJawPairs = copy.NumberOfLeafJawPairs; + RTBeamLimitingDeviceType = copy.RTBeamLimitingDeviceType; + SourceToBeamLimitingDeviceDistance = copy.SourceToBeamLimitingDeviceDistance; + } + return *this; +} + + +void DRTBeamLimitingDeviceSequenceInRTImageModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RTBeamLimitingDeviceType.clear(); + SourceToBeamLimitingDeviceDistance.clear(); + NumberOfLeafJawPairs.clear(); + LeafPositionBoundaries.clear(); + LeafJawPositions.clear(); + } +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTImageModule::Item::isEmpty() +{ + return RTBeamLimitingDeviceType.isEmpty() && + SourceToBeamLimitingDeviceDistance.isEmpty() && + NumberOfLeafJawPairs.isEmpty() && + LeafPositionBoundaries.isEmpty() && + LeafJawPositions.isEmpty(); +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTImageModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RTBeamLimitingDeviceType, "1", "1", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, SourceToBeamLimitingDeviceDistance, "1", "3", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, NumberOfLeafJawPairs, "1", "1", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, LeafPositionBoundaries, "3-n", "2C", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, LeafJawPositions, "2-2n", "1", "BeamLimitingDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RTBeamLimitingDeviceType), "1", "1", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToBeamLimitingDeviceDistance), "1", "3", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfLeafJawPairs), "1", "1", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(LeafPositionBoundaries), "3-n", "2C", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(LeafJawPositions), "2-2n", "1", "BeamLimitingDeviceSequence"); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getLeafJawPositions(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LeafJawPositions, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getLeafJawPositions(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafJawPositions).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getLeafJawPositions(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafJawPositions).getFloat64Vector(value); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getLeafPositionBoundaries(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LeafPositionBoundaries, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getLeafPositionBoundaries(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getLeafPositionBoundaries(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64Vector(value); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getNumberOfLeafJawPairs(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfLeafJawPairs, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfLeafJawPairs).getSint32(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getRTBeamLimitingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTBeamLimitingDeviceType, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getSourceToBeamLimitingDeviceDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToBeamLimitingDeviceDistance, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::getSourceToBeamLimitingDeviceDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToBeamLimitingDeviceDistance).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::setLeafJawPositions(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2-2n") : EC_Normal; + if (result.good()) + result = LeafJawPositions.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::setLeafPositionBoundaries(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3-n") : EC_Normal; + if (result.good()) + result = LeafPositionBoundaries.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::setNumberOfLeafJawPairs(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfLeafJawPairs.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::setRTBeamLimitingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTBeamLimitingDeviceType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::Item::setSourceToBeamLimitingDeviceDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToBeamLimitingDeviceDistance.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamLimitingDeviceSequenceInRTImageModule::DRTBeamLimitingDeviceSequenceInRTImageModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::DRTBeamLimitingDeviceSequenceInRTImageModule(const DRTBeamLimitingDeviceSequenceInRTImageModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule &DRTBeamLimitingDeviceSequenceInRTImageModule::operator=(const DRTBeamLimitingDeviceSequenceInRTImageModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::~DRTBeamLimitingDeviceSequenceInRTImageModule() +{ + clear(); +} + + +void DRTBeamLimitingDeviceSequenceInRTImageModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTImageModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTImageModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamLimitingDeviceSequenceInRTImageModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::Item &DRTBeamLimitingDeviceSequenceInRTImageModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceSequenceInRTImageModule::Item &DRTBeamLimitingDeviceSequenceInRTImageModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::Item &DRTBeamLimitingDeviceSequenceInRTImageModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceSequenceInRTImageModule::Item &DRTBeamLimitingDeviceSequenceInRTImageModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamLimitingDeviceSequenceInRTImageModule::Item &DRTBeamLimitingDeviceSequenceInRTImageModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamLimitingDeviceSequenceInRTImageModule::Item &DRTBeamLimitingDeviceSequenceInRTImageModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamLimitingDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamLimitingDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTImageModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamLimitingDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtblds6.cc b/dcmrt/libsrc/drtblds6.cc new file mode 100644 index 00000000..6eab998f --- /dev/null +++ b/dcmrt/libsrc/drtblds6.cc @@ -0,0 +1,714 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamLimitingDeviceSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtblds6.h" + + +// --- item class --- + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LeafJawPositions(DCM_LeafJawPositions), + LeafPositionBoundaries(DCM_LeafPositionBoundaries), + NumberOfLeafJawPairs(DCM_NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(DCM_RTBeamLimitingDeviceType), + SourceToBeamLimitingDeviceDistance(DCM_SourceToBeamLimitingDeviceDistance) +{ +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LeafJawPositions(copy.LeafJawPositions), + LeafPositionBoundaries(copy.LeafPositionBoundaries), + NumberOfLeafJawPairs(copy.NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(copy.RTBeamLimitingDeviceType), + SourceToBeamLimitingDeviceDistance(copy.SourceToBeamLimitingDeviceDistance) +{ +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LeafJawPositions = copy.LeafJawPositions; + LeafPositionBoundaries = copy.LeafPositionBoundaries; + NumberOfLeafJawPairs = copy.NumberOfLeafJawPairs; + RTBeamLimitingDeviceType = copy.RTBeamLimitingDeviceType; + SourceToBeamLimitingDeviceDistance = copy.SourceToBeamLimitingDeviceDistance; + } + return *this; +} + + +void DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RTBeamLimitingDeviceType.clear(); + SourceToBeamLimitingDeviceDistance.clear(); + NumberOfLeafJawPairs.clear(); + LeafPositionBoundaries.clear(); + LeafJawPositions.clear(); + } +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return RTBeamLimitingDeviceType.isEmpty() && + SourceToBeamLimitingDeviceDistance.isEmpty() && + NumberOfLeafJawPairs.isEmpty() && + LeafPositionBoundaries.isEmpty() && + LeafJawPositions.isEmpty(); +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RTBeamLimitingDeviceType, "1", "1", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, SourceToBeamLimitingDeviceDistance, "1", "3", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, NumberOfLeafJawPairs, "1", "1", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, LeafPositionBoundaries, "3-n", "2C", "BeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, LeafJawPositions, "2-2n", "1", "BeamLimitingDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RTBeamLimitingDeviceType), "1", "1", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToBeamLimitingDeviceDistance), "1", "3", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfLeafJawPairs), "1", "1", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(LeafPositionBoundaries), "3-n", "2C", "BeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(LeafJawPositions), "2-2n", "1", "BeamLimitingDeviceSequence"); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getLeafJawPositions(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LeafJawPositions, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getLeafJawPositions(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafJawPositions).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getLeafJawPositions(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafJawPositions).getFloat64Vector(value); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getLeafPositionBoundaries(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LeafPositionBoundaries, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getLeafPositionBoundaries(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getLeafPositionBoundaries(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64Vector(value); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getNumberOfLeafJawPairs(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfLeafJawPairs, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfLeafJawPairs).getSint32(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getRTBeamLimitingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTBeamLimitingDeviceType, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getSourceToBeamLimitingDeviceDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToBeamLimitingDeviceDistance, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::getSourceToBeamLimitingDeviceDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToBeamLimitingDeviceDistance).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::setLeafJawPositions(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2-2n") : EC_Normal; + if (result.good()) + result = LeafJawPositions.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::setLeafPositionBoundaries(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3-n") : EC_Normal; + if (result.good()) + result = LeafPositionBoundaries.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::setNumberOfLeafJawPairs(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfLeafJawPairs.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::setRTBeamLimitingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTBeamLimitingDeviceType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item::setSourceToBeamLimitingDeviceDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToBeamLimitingDeviceDistance.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::DRTBeamLimitingDeviceSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::DRTBeamLimitingDeviceSequenceInRTIonBeamsModule(const DRTBeamLimitingDeviceSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::operator=(const DRTBeamLimitingDeviceSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::~DRTBeamLimitingDeviceSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::Item &DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamLimitingDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamLimitingDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamLimitingDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbldts.cc b/dcmrt/libsrc/drtbldts.cc new file mode 100644 index 00000000..766b92bd --- /dev/null +++ b/dcmrt/libsrc/drtbldts.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamLimitingDeviceToleranceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbldts.h" + + +// --- item class --- + +DRTBeamLimitingDeviceToleranceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamLimitingDevicePositionTolerance(DCM_BeamLimitingDevicePositionTolerance), + RTBeamLimitingDeviceType(DCM_RTBeamLimitingDeviceType) +{ +} + + +DRTBeamLimitingDeviceToleranceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamLimitingDevicePositionTolerance(copy.BeamLimitingDevicePositionTolerance), + RTBeamLimitingDeviceType(copy.RTBeamLimitingDeviceType) +{ +} + + +DRTBeamLimitingDeviceToleranceSequence::Item::~Item() +{ +} + + +DRTBeamLimitingDeviceToleranceSequence::Item &DRTBeamLimitingDeviceToleranceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamLimitingDevicePositionTolerance = copy.BeamLimitingDevicePositionTolerance; + RTBeamLimitingDeviceType = copy.RTBeamLimitingDeviceType; + } + return *this; +} + + +void DRTBeamLimitingDeviceToleranceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RTBeamLimitingDeviceType.clear(); + BeamLimitingDevicePositionTolerance.clear(); + } +} + + +OFBool DRTBeamLimitingDeviceToleranceSequence::Item::isEmpty() +{ + return RTBeamLimitingDeviceType.isEmpty() && + BeamLimitingDevicePositionTolerance.isEmpty(); +} + + +OFBool DRTBeamLimitingDeviceToleranceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RTBeamLimitingDeviceType, "1", "1", "BeamLimitingDeviceToleranceSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDevicePositionTolerance, "1", "1", "BeamLimitingDeviceToleranceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RTBeamLimitingDeviceType), "1", "1", "BeamLimitingDeviceToleranceSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamLimitingDevicePositionTolerance), "1", "1", "BeamLimitingDeviceToleranceSequence"); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::Item::getBeamLimitingDevicePositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDevicePositionTolerance, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::Item::getBeamLimitingDevicePositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamLimitingDevicePositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::Item::getRTBeamLimitingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTBeamLimitingDeviceType, value, pos); +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::Item::setBeamLimitingDevicePositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDevicePositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::Item::setRTBeamLimitingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTBeamLimitingDeviceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamLimitingDeviceToleranceSequence::DRTBeamLimitingDeviceToleranceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamLimitingDeviceToleranceSequence::DRTBeamLimitingDeviceToleranceSequence(const DRTBeamLimitingDeviceToleranceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamLimitingDeviceToleranceSequence &DRTBeamLimitingDeviceToleranceSequence::operator=(const DRTBeamLimitingDeviceToleranceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamLimitingDeviceToleranceSequence::~DRTBeamLimitingDeviceToleranceSequence() +{ + clear(); +} + + +void DRTBeamLimitingDeviceToleranceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamLimitingDeviceToleranceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamLimitingDeviceToleranceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamLimitingDeviceToleranceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamLimitingDeviceToleranceSequence::Item &DRTBeamLimitingDeviceToleranceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceToleranceSequence::Item &DRTBeamLimitingDeviceToleranceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamLimitingDeviceToleranceSequence::Item &DRTBeamLimitingDeviceToleranceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamLimitingDeviceToleranceSequence::Item &DRTBeamLimitingDeviceToleranceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamLimitingDeviceToleranceSequence::Item &DRTBeamLimitingDeviceToleranceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamLimitingDeviceToleranceSequence::Item &DRTBeamLimitingDeviceToleranceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamLimitingDeviceToleranceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamLimitingDeviceToleranceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamLimitingDeviceToleranceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamLimitingDeviceToleranceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbrcss.cc b/dcmrt/libsrc/drtbrcss.cc new file mode 100644 index 00000000..88856f97 --- /dev/null +++ b/dcmrt/libsrc/drtbrcss.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBreedRegistryCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbrcss.h" + + +// --- item class --- + +DRTBreedRegistryCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTBreedRegistryCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTBreedRegistryCodeSequence::Item::~Item() +{ +} + + +DRTBreedRegistryCodeSequence::Item &DRTBreedRegistryCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTBreedRegistryCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTBreedRegistryCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTBreedRegistryCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "BreedRegistryCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "BreedRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "BreedRegistryCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "BreedRegistryCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "BreedRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "BreedRegistryCodeSequence"); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBreedRegistryCodeSequence::DRTBreedRegistryCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBreedRegistryCodeSequence::DRTBreedRegistryCodeSequence(const DRTBreedRegistryCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBreedRegistryCodeSequence &DRTBreedRegistryCodeSequence::operator=(const DRTBreedRegistryCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBreedRegistryCodeSequence::~DRTBreedRegistryCodeSequence() +{ + clear(); +} + + +void DRTBreedRegistryCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBreedRegistryCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBreedRegistryCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBreedRegistryCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBreedRegistryCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBreedRegistryCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBreedRegistryCodeSequence::Item &DRTBreedRegistryCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBreedRegistryCodeSequence::Item &DRTBreedRegistryCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBreedRegistryCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBreedRegistryCodeSequence::Item &DRTBreedRegistryCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBreedRegistryCodeSequence::Item &DRTBreedRegistryCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBreedRegistryCodeSequence::Item &DRTBreedRegistryCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBreedRegistryCodeSequence::Item &DRTBreedRegistryCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBreedRegistryCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BreedRegistryCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BreedRegistryCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBreedRegistryCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BreedRegistryCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbrdrs.cc b/dcmrt/libsrc/drtbrdrs.cc new file mode 100644 index 00000000..3c4882c6 --- /dev/null +++ b/dcmrt/libsrc/drtbrdrs.cc @@ -0,0 +1,591 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBrachyReferencedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbrdrs.h" + + +// --- item class --- + +DRTBrachyReferencedDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CumulativeDoseReferenceCoefficient(DCM_CumulativeDoseReferenceCoefficient), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTBrachyReferencedDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CumulativeDoseReferenceCoefficient(copy.CumulativeDoseReferenceCoefficient), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTBrachyReferencedDoseReferenceSequence::Item::~Item() +{ +} + + +DRTBrachyReferencedDoseReferenceSequence::Item &DRTBrachyReferencedDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CumulativeDoseReferenceCoefficient = copy.CumulativeDoseReferenceCoefficient; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTBrachyReferencedDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + CumulativeDoseReferenceCoefficient.clear(); + } +} + + +OFBool DRTBrachyReferencedDoseReferenceSequence::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + CumulativeDoseReferenceCoefficient.isEmpty(); +} + + +OFBool DRTBrachyReferencedDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1", "BrachyReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CumulativeDoseReferenceCoefficient, "1", "1", "BrachyReferencedDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1", "BrachyReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(CumulativeDoseReferenceCoefficient), "1", "1", "BrachyReferencedDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::getCumulativeDoseReferenceCoefficient(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeDoseReferenceCoefficient, value, pos); +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::getCumulativeDoseReferenceCoefficient(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeDoseReferenceCoefficient).getFloat64(value, pos); +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::setCumulativeDoseReferenceCoefficient(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeDoseReferenceCoefficient.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBrachyReferencedDoseReferenceSequence::DRTBrachyReferencedDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBrachyReferencedDoseReferenceSequence::DRTBrachyReferencedDoseReferenceSequence(const DRTBrachyReferencedDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBrachyReferencedDoseReferenceSequence &DRTBrachyReferencedDoseReferenceSequence::operator=(const DRTBrachyReferencedDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBrachyReferencedDoseReferenceSequence::~DRTBrachyReferencedDoseReferenceSequence() +{ + clear(); +} + + +void DRTBrachyReferencedDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBrachyReferencedDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBrachyReferencedDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBrachyReferencedDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBrachyReferencedDoseReferenceSequence::Item &DRTBrachyReferencedDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBrachyReferencedDoseReferenceSequence::Item &DRTBrachyReferencedDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBrachyReferencedDoseReferenceSequence::Item &DRTBrachyReferencedDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBrachyReferencedDoseReferenceSequence::Item &DRTBrachyReferencedDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBrachyReferencedDoseReferenceSequence::Item &DRTBrachyReferencedDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBrachyReferencedDoseReferenceSequence::Item &DRTBrachyReferencedDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BrachyReferencedDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BrachyReferencedDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBrachyReferencedDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BrachyReferencedDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbrs.cc b/dcmrt/libsrc/drtbrs.cc new file mode 100644 index 00000000..c4e0e0a6 --- /dev/null +++ b/dcmrt/libsrc/drtbrs.cc @@ -0,0 +1,551 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBreedRegistrationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbrs.h" + + +// --- item class --- + +DRTBreedRegistrationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BreedRegistrationNumber(DCM_BreedRegistrationNumber), + BreedRegistryCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTBreedRegistrationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BreedRegistrationNumber(copy.BreedRegistrationNumber), + BreedRegistryCodeSequence(copy.BreedRegistryCodeSequence) +{ +} + + +DRTBreedRegistrationSequence::Item::~Item() +{ +} + + +DRTBreedRegistrationSequence::Item &DRTBreedRegistrationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BreedRegistrationNumber = copy.BreedRegistrationNumber; + BreedRegistryCodeSequence = copy.BreedRegistryCodeSequence; + } + return *this; +} + + +void DRTBreedRegistrationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BreedRegistrationNumber.clear(); + BreedRegistryCodeSequence.clear(); + } +} + + +OFBool DRTBreedRegistrationSequence::Item::isEmpty() +{ + return BreedRegistrationNumber.isEmpty() && + BreedRegistryCodeSequence.isEmpty(); +} + + +OFBool DRTBreedRegistrationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBreedRegistrationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BreedRegistrationNumber, "1", "1", "BreedRegistrationSequence"); + BreedRegistryCodeSequence.read(item, "1-n", "1", "BreedRegistrationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongString(BreedRegistrationNumber), "1", "1", "BreedRegistrationSequence"); + if (result.good()) result = BreedRegistryCodeSequence.write(item, "1-n", "1", "BreedRegistrationSequence"); + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::Item::getBreedRegistrationNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BreedRegistrationNumber, value, pos); +} + + +OFCondition DRTBreedRegistrationSequence::Item::setBreedRegistrationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BreedRegistrationNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBreedRegistrationSequence::DRTBreedRegistrationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBreedRegistrationSequence::DRTBreedRegistrationSequence(const DRTBreedRegistrationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBreedRegistrationSequence &DRTBreedRegistrationSequence::operator=(const DRTBreedRegistrationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBreedRegistrationSequence::~DRTBreedRegistrationSequence() +{ + clear(); +} + + +void DRTBreedRegistrationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBreedRegistrationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBreedRegistrationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBreedRegistrationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBreedRegistrationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBreedRegistrationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBreedRegistrationSequence::Item &DRTBreedRegistrationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBreedRegistrationSequence::Item &DRTBreedRegistrationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBreedRegistrationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBreedRegistrationSequence::Item &DRTBreedRegistrationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBreedRegistrationSequence::Item &DRTBreedRegistrationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBreedRegistrationSequence::Item &DRTBreedRegistrationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBreedRegistrationSequence::Item &DRTBreedRegistrationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBreedRegistrationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BreedRegistrationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BreedRegistrationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBreedRegistrationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BreedRegistrationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbs.cc b/dcmrt/libsrc/drtbs.cc new file mode 100644 index 00000000..fbbdeb7f --- /dev/null +++ b/dcmrt/libsrc/drtbs.cc @@ -0,0 +1,1468 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbs.h" + + +// --- item class --- + +DRTBeamSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ApplicatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamDescription(DCM_BeamDescription), + BeamLimitingDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamName(DCM_BeamName), + BeamNumber(DCM_BeamNumber), + BeamType(DCM_BeamType), + BlockSequence(emptyDefaultItem /*emptyDefaultSequence*/), + CompensatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ControlPointSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DeviceSerialNumber(DCM_DeviceSerialNumber), + FinalCumulativeMetersetWeight(DCM_FinalCumulativeMetersetWeight), + GeneralAccessorySequence(emptyDefaultItem /*emptyDefaultSequence*/), + HighDoseTechniqueType(DCM_HighDoseTechniqueType), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionName(DCM_InstitutionName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + Manufacturer(DCM_Manufacturer), + ManufacturerModelName(DCM_ManufacturerModelName), + NumberOfBlocks(DCM_NumberOfBlocks), + NumberOfBoli(DCM_NumberOfBoli), + NumberOfCompensators(DCM_NumberOfCompensators), + NumberOfControlPoints(DCM_NumberOfControlPoints), + NumberOfWedges(DCM_NumberOfWedges), + PlannedVerificationImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PrimaryDosimeterUnit(DCM_PrimaryDosimeterUnit), + PrimaryFluenceModeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RadiationType(DCM_RadiationType), + ReferencedBolusSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedDoseReferenceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedDoseSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedPatientSetupNumber(DCM_ReferencedPatientSetupNumber), + ReferencedReferenceImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedToleranceTableNumber(DCM_ReferencedToleranceTableNumber), + SourceAxisDistance(DCM_SourceAxisDistance), + TotalBlockTrayFactor(DCM_TotalBlockTrayFactor), + TotalCompensatorTrayFactor(DCM_TotalCompensatorTrayFactor), + TreatmentDeliveryType(DCM_TreatmentDeliveryType), + TreatmentMachineName(DCM_TreatmentMachineName), + WedgeSequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTBeamSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ApplicatorSequence(copy.ApplicatorSequence), + BeamDescription(copy.BeamDescription), + BeamLimitingDeviceSequence(copy.BeamLimitingDeviceSequence), + BeamName(copy.BeamName), + BeamNumber(copy.BeamNumber), + BeamType(copy.BeamType), + BlockSequence(copy.BlockSequence), + CompensatorSequence(copy.CompensatorSequence), + ControlPointSequence(copy.ControlPointSequence), + DeviceSerialNumber(copy.DeviceSerialNumber), + FinalCumulativeMetersetWeight(copy.FinalCumulativeMetersetWeight), + GeneralAccessorySequence(copy.GeneralAccessorySequence), + HighDoseTechniqueType(copy.HighDoseTechniqueType), + InstitutionAddress(copy.InstitutionAddress), + InstitutionName(copy.InstitutionName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + Manufacturer(copy.Manufacturer), + ManufacturerModelName(copy.ManufacturerModelName), + NumberOfBlocks(copy.NumberOfBlocks), + NumberOfBoli(copy.NumberOfBoli), + NumberOfCompensators(copy.NumberOfCompensators), + NumberOfControlPoints(copy.NumberOfControlPoints), + NumberOfWedges(copy.NumberOfWedges), + PlannedVerificationImageSequence(copy.PlannedVerificationImageSequence), + PrimaryDosimeterUnit(copy.PrimaryDosimeterUnit), + PrimaryFluenceModeSequence(copy.PrimaryFluenceModeSequence), + RadiationType(copy.RadiationType), + ReferencedBolusSequence(copy.ReferencedBolusSequence), + ReferencedDoseReferenceSequence(copy.ReferencedDoseReferenceSequence), + ReferencedDoseSequence(copy.ReferencedDoseSequence), + ReferencedPatientSetupNumber(copy.ReferencedPatientSetupNumber), + ReferencedReferenceImageSequence(copy.ReferencedReferenceImageSequence), + ReferencedToleranceTableNumber(copy.ReferencedToleranceTableNumber), + SourceAxisDistance(copy.SourceAxisDistance), + TotalBlockTrayFactor(copy.TotalBlockTrayFactor), + TotalCompensatorTrayFactor(copy.TotalCompensatorTrayFactor), + TreatmentDeliveryType(copy.TreatmentDeliveryType), + TreatmentMachineName(copy.TreatmentMachineName), + WedgeSequence(copy.WedgeSequence) +{ +} + + +DRTBeamSequence::Item::~Item() +{ +} + + +DRTBeamSequence::Item &DRTBeamSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ApplicatorSequence = copy.ApplicatorSequence; + BeamDescription = copy.BeamDescription; + BeamLimitingDeviceSequence = copy.BeamLimitingDeviceSequence; + BeamName = copy.BeamName; + BeamNumber = copy.BeamNumber; + BeamType = copy.BeamType; + BlockSequence = copy.BlockSequence; + CompensatorSequence = copy.CompensatorSequence; + ControlPointSequence = copy.ControlPointSequence; + DeviceSerialNumber = copy.DeviceSerialNumber; + FinalCumulativeMetersetWeight = copy.FinalCumulativeMetersetWeight; + GeneralAccessorySequence = copy.GeneralAccessorySequence; + HighDoseTechniqueType = copy.HighDoseTechniqueType; + InstitutionAddress = copy.InstitutionAddress; + InstitutionName = copy.InstitutionName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + Manufacturer = copy.Manufacturer; + ManufacturerModelName = copy.ManufacturerModelName; + NumberOfBlocks = copy.NumberOfBlocks; + NumberOfBoli = copy.NumberOfBoli; + NumberOfCompensators = copy.NumberOfCompensators; + NumberOfControlPoints = copy.NumberOfControlPoints; + NumberOfWedges = copy.NumberOfWedges; + PlannedVerificationImageSequence = copy.PlannedVerificationImageSequence; + PrimaryDosimeterUnit = copy.PrimaryDosimeterUnit; + PrimaryFluenceModeSequence = copy.PrimaryFluenceModeSequence; + RadiationType = copy.RadiationType; + ReferencedBolusSequence = copy.ReferencedBolusSequence; + ReferencedDoseReferenceSequence = copy.ReferencedDoseReferenceSequence; + ReferencedDoseSequence = copy.ReferencedDoseSequence; + ReferencedPatientSetupNumber = copy.ReferencedPatientSetupNumber; + ReferencedReferenceImageSequence = copy.ReferencedReferenceImageSequence; + ReferencedToleranceTableNumber = copy.ReferencedToleranceTableNumber; + SourceAxisDistance = copy.SourceAxisDistance; + TotalBlockTrayFactor = copy.TotalBlockTrayFactor; + TotalCompensatorTrayFactor = copy.TotalCompensatorTrayFactor; + TreatmentDeliveryType = copy.TreatmentDeliveryType; + TreatmentMachineName = copy.TreatmentMachineName; + WedgeSequence = copy.WedgeSequence; + } + return *this; +} + + +void DRTBeamSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BeamNumber.clear(); + BeamName.clear(); + BeamDescription.clear(); + BeamType.clear(); + RadiationType.clear(); + PrimaryFluenceModeSequence.clear(); + HighDoseTechniqueType.clear(); + TreatmentMachineName.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + PrimaryDosimeterUnit.clear(); + ReferencedToleranceTableNumber.clear(); + SourceAxisDistance.clear(); + BeamLimitingDeviceSequence.clear(); + ReferencedPatientSetupNumber.clear(); + ReferencedReferenceImageSequence.clear(); + PlannedVerificationImageSequence.clear(); + TreatmentDeliveryType.clear(); + ReferencedDoseSequence.clear(); + NumberOfWedges.clear(); + WedgeSequence.clear(); + NumberOfCompensators.clear(); + TotalCompensatorTrayFactor.clear(); + CompensatorSequence.clear(); + NumberOfBoli.clear(); + ReferencedBolusSequence.clear(); + NumberOfBlocks.clear(); + TotalBlockTrayFactor.clear(); + BlockSequence.clear(); + ApplicatorSequence.clear(); + GeneralAccessorySequence.clear(); + ReferencedDoseReferenceSequence.clear(); + FinalCumulativeMetersetWeight.clear(); + NumberOfControlPoints.clear(); + ControlPointSequence.clear(); + } +} + + +OFBool DRTBeamSequence::Item::isEmpty() +{ + return BeamNumber.isEmpty() && + BeamName.isEmpty() && + BeamDescription.isEmpty() && + BeamType.isEmpty() && + RadiationType.isEmpty() && + PrimaryFluenceModeSequence.isEmpty() && + HighDoseTechniqueType.isEmpty() && + TreatmentMachineName.isEmpty() && + Manufacturer.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionalDepartmentName.isEmpty() && + ManufacturerModelName.isEmpty() && + DeviceSerialNumber.isEmpty() && + PrimaryDosimeterUnit.isEmpty() && + ReferencedToleranceTableNumber.isEmpty() && + SourceAxisDistance.isEmpty() && + BeamLimitingDeviceSequence.isEmpty() && + ReferencedPatientSetupNumber.isEmpty() && + ReferencedReferenceImageSequence.isEmpty() && + PlannedVerificationImageSequence.isEmpty() && + TreatmentDeliveryType.isEmpty() && + ReferencedDoseSequence.isEmpty() && + NumberOfWedges.isEmpty() && + WedgeSequence.isEmpty() && + NumberOfCompensators.isEmpty() && + TotalCompensatorTrayFactor.isEmpty() && + CompensatorSequence.isEmpty() && + NumberOfBoli.isEmpty() && + ReferencedBolusSequence.isEmpty() && + NumberOfBlocks.isEmpty() && + TotalBlockTrayFactor.isEmpty() && + BlockSequence.isEmpty() && + ApplicatorSequence.isEmpty() && + GeneralAccessorySequence.isEmpty() && + ReferencedDoseReferenceSequence.isEmpty() && + FinalCumulativeMetersetWeight.isEmpty() && + NumberOfControlPoints.isEmpty() && + ControlPointSequence.isEmpty(); +} + + +OFBool DRTBeamSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BeamNumber, "1", "1", "BeamSequence"); + getAndCheckElementFromDataset(item, BeamName, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, BeamDescription, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, BeamType, "1", "1", "BeamSequence"); + getAndCheckElementFromDataset(item, RadiationType, "1", "2", "BeamSequence"); + PrimaryFluenceModeSequence.read(item, "1-n", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, HighDoseTechniqueType, "1", "1C", "BeamSequence"); + getAndCheckElementFromDataset(item, TreatmentMachineName, "1", "2", "BeamSequence"); + getAndCheckElementFromDataset(item, Manufacturer, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, InstitutionalDepartmentName, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, ManufacturerModelName, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, DeviceSerialNumber, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, PrimaryDosimeterUnit, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, ReferencedToleranceTableNumber, "1", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, SourceAxisDistance, "1", "3", "BeamSequence"); + BeamLimitingDeviceSequence.read(item, "1-n", "1", "BeamSequence"); + getAndCheckElementFromDataset(item, ReferencedPatientSetupNumber, "1", "3", "BeamSequence"); + ReferencedReferenceImageSequence.read(item, "1-n", "3", "BeamSequence"); + PlannedVerificationImageSequence.read(item, "1-n", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, TreatmentDeliveryType, "1", "3", "BeamSequence"); + ReferencedDoseSequence.read(item, "1-n", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, NumberOfWedges, "1", "1", "BeamSequence"); + WedgeSequence.read(item, "1-n", "1C", "BeamSequence"); + getAndCheckElementFromDataset(item, NumberOfCompensators, "1", "1", "BeamSequence"); + getAndCheckElementFromDataset(item, TotalCompensatorTrayFactor, "1", "3", "BeamSequence"); + CompensatorSequence.read(item, "1-n", "1C", "BeamSequence"); + getAndCheckElementFromDataset(item, NumberOfBoli, "1", "1", "BeamSequence"); + ReferencedBolusSequence.read(item, "1-n", "1C", "BeamSequence"); + getAndCheckElementFromDataset(item, NumberOfBlocks, "1", "1", "BeamSequence"); + getAndCheckElementFromDataset(item, TotalBlockTrayFactor, "1", "3", "BeamSequence"); + BlockSequence.read(item, "1-n", "1C", "BeamSequence"); + ApplicatorSequence.read(item, "1-n", "3", "BeamSequence"); + GeneralAccessorySequence.read(item, "1-n", "3", "BeamSequence"); + ReferencedDoseReferenceSequence.read(item, "1-n", "3", "BeamSequence"); + getAndCheckElementFromDataset(item, FinalCumulativeMetersetWeight, "1", "1C", "BeamSequence"); + getAndCheckElementFromDataset(item, NumberOfControlPoints, "1", "1", "BeamSequence"); + ControlPointSequence.read(item, "1-n", "1", "BeamSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(BeamNumber), "1", "1", "BeamSequence"); + addElementToDataset(result, item, new DcmLongString(BeamName), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmShortText(BeamDescription), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamType), "1", "1", "BeamSequence"); + addElementToDataset(result, item, new DcmCodeString(RadiationType), "1", "2", "BeamSequence"); + if (result.good()) result = PrimaryFluenceModeSequence.write(item, "1-n", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmCodeString(HighDoseTechniqueType), "1", "1C", "BeamSequence"); + addElementToDataset(result, item, new DcmShortString(TreatmentMachineName), "1", "2", "BeamSequence"); + addElementToDataset(result, item, new DcmLongString(Manufacturer), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionalDepartmentName), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmLongString(ManufacturerModelName), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceSerialNumber), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmCodeString(PrimaryDosimeterUnit), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedToleranceTableNumber), "1", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceAxisDistance), "1", "3", "BeamSequence"); + if (result.good()) result = BeamLimitingDeviceSequence.write(item, "1-n", "1", "BeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedPatientSetupNumber), "1", "3", "BeamSequence"); + if (result.good()) result = ReferencedReferenceImageSequence.write(item, "1-n", "3", "BeamSequence"); + if (result.good()) result = PlannedVerificationImageSequence.write(item, "1-n", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmCodeString(TreatmentDeliveryType), "1", "3", "BeamSequence"); + if (result.good()) result = ReferencedDoseSequence.write(item, "1-n", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfWedges), "1", "1", "BeamSequence"); + if (result.good()) result = WedgeSequence.write(item, "1-n", "1C", "BeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfCompensators), "1", "1", "BeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(TotalCompensatorTrayFactor), "1", "3", "BeamSequence"); + if (result.good()) result = CompensatorSequence.write(item, "1-n", "1C", "BeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBoli), "1", "1", "BeamSequence"); + if (result.good()) result = ReferencedBolusSequence.write(item, "1-n", "1C", "BeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBlocks), "1", "1", "BeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(TotalBlockTrayFactor), "1", "3", "BeamSequence"); + if (result.good()) result = BlockSequence.write(item, "1-n", "1C", "BeamSequence"); + if (result.good()) result = ApplicatorSequence.write(item, "1-n", "3", "BeamSequence"); + if (result.good()) result = GeneralAccessorySequence.write(item, "1-n", "3", "BeamSequence"); + if (result.good()) result = ReferencedDoseReferenceSequence.write(item, "1-n", "3", "BeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(FinalCumulativeMetersetWeight), "1", "1C", "BeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfControlPoints), "1", "1", "BeamSequence"); + if (result.good()) result = ControlPointSequence.write(item, "1-n", "1", "BeamSequence"); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::getBeamDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDescription, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getBeamName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamName, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getBeamNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamNumber, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getBeamNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BeamNumber).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getBeamType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamType, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getFinalCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FinalCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getFinalCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, FinalCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getHighDoseTechniqueType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(HighDoseTechniqueType, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getManufacturerModelName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfBlocks(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBlocks, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfBlocks(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBlocks).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfBoli(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBoli, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfBoli(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBoli).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfCompensators(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfCompensators, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfCompensators(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfCompensators).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfControlPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfControlPoints, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfControlPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfControlPoints).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfWedges(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfWedges, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getNumberOfWedges(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfWedges).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getPrimaryDosimeterUnit(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrimaryDosimeterUnit, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getRadiationType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RadiationType, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getReferencedPatientSetupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedPatientSetupNumber, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getReferencedPatientSetupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedPatientSetupNumber).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getReferencedToleranceTableNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedToleranceTableNumber, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getReferencedToleranceTableNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedToleranceTableNumber).getSint32(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getSourceAxisDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceAxisDistance, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getSourceAxisDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceAxisDistance).getFloat64(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getTotalBlockTrayFactor(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TotalBlockTrayFactor, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getTotalBlockTrayFactor(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TotalBlockTrayFactor).getFloat64(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getTotalCompensatorTrayFactor(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TotalCompensatorTrayFactor, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getTotalCompensatorTrayFactor(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TotalCompensatorTrayFactor).getFloat64(value, pos); +} + + +OFCondition DRTBeamSequence::Item::getTreatmentDeliveryType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentDeliveryType, value, pos); +} + + +OFCondition DRTBeamSequence::Item::getTreatmentMachineName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentMachineName, value, pos); +} + + +OFCondition DRTBeamSequence::Item::setBeamDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = BeamDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setBeamName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setBeamNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setBeamType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setFinalCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FinalCumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setHighDoseTechniqueType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = HighDoseTechniqueType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setNumberOfBlocks(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBlocks.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setNumberOfBoli(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBoli.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setNumberOfCompensators(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfCompensators.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setNumberOfControlPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfControlPoints.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setNumberOfWedges(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfWedges.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setPrimaryDosimeterUnit(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrimaryDosimeterUnit.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setRadiationType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setReferencedPatientSetupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedPatientSetupNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setReferencedToleranceTableNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedToleranceTableNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setSourceAxisDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceAxisDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setTotalBlockTrayFactor(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TotalBlockTrayFactor.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setTotalCompensatorTrayFactor(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TotalCompensatorTrayFactor.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setTreatmentDeliveryType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentDeliveryType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamSequence::Item::setTreatmentMachineName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentMachineName.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamSequence::DRTBeamSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamSequence::DRTBeamSequence(const DRTBeamSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamSequence &DRTBeamSequence::operator=(const DRTBeamSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamSequence::~DRTBeamSequence() +{ + clear(); +} + + +void DRTBeamSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamSequence::Item &DRTBeamSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamSequence::Item &DRTBeamSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamSequence::Item &DRTBeamSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamSequence::Item &DRTBeamSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamSequence::Item &DRTBeamSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamSequence::Item &DRTBeamSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbss.cc b/dcmrt/libsrc/drtbss.cc new file mode 100644 index 00000000..935c88b5 --- /dev/null +++ b/dcmrt/libsrc/drtbss.cc @@ -0,0 +1,607 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBlockSlabSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbss.h" + + +// --- item class --- + +DRTBlockSlabSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BlockSlabNumber(DCM_BlockSlabNumber), + BlockSlabThickness(DCM_BlockSlabThickness) +{ +} + + +DRTBlockSlabSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BlockSlabNumber(copy.BlockSlabNumber), + BlockSlabThickness(copy.BlockSlabThickness) +{ +} + + +DRTBlockSlabSequence::Item::~Item() +{ +} + + +DRTBlockSlabSequence::Item &DRTBlockSlabSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BlockSlabNumber = copy.BlockSlabNumber; + BlockSlabThickness = copy.BlockSlabThickness; + } + return *this; +} + + +void DRTBlockSlabSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BlockSlabNumber.clear(); + BlockSlabThickness.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTBlockSlabSequence::Item::isEmpty() +{ + return BlockSlabNumber.isEmpty() && + BlockSlabThickness.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTBlockSlabSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBlockSlabSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BlockSlabNumber, "1", "1", "BlockSlabSequence"); + getAndCheckElementFromDataset(item, BlockSlabThickness, "1", "3", "BlockSlabSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "BlockSlabSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSlabSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(BlockSlabNumber), "1", "1", "BlockSlabSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockSlabThickness), "1", "3", "BlockSlabSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "BlockSlabSequence"); + } + return result; +} + + +OFCondition DRTBlockSlabSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTBlockSlabSequence::Item::getBlockSlabNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, BlockSlabNumber).getUint16(value, pos); +} + + +OFCondition DRTBlockSlabSequence::Item::getBlockSlabThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockSlabThickness, value, pos); +} + + +OFCondition DRTBlockSlabSequence::Item::getBlockSlabThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockSlabThickness).getFloat64(value, pos); +} + + +OFCondition DRTBlockSlabSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBlockSlabSequence::Item::setBlockSlabNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BlockSlabNumber.putUint16(value, pos); +} + + +OFCondition DRTBlockSlabSequence::Item::setBlockSlabThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockSlabThickness.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBlockSlabSequence::DRTBlockSlabSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBlockSlabSequence::DRTBlockSlabSequence(const DRTBlockSlabSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBlockSlabSequence &DRTBlockSlabSequence::operator=(const DRTBlockSlabSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBlockSlabSequence::~DRTBlockSlabSequence() +{ + clear(); +} + + +void DRTBlockSlabSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBlockSlabSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBlockSlabSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBlockSlabSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBlockSlabSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSlabSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBlockSlabSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSlabSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSlabSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBlockSlabSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBlockSlabSequence::Item &DRTBlockSlabSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBlockSlabSequence::Item &DRTBlockSlabSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBlockSlabSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBlockSlabSequence::Item &DRTBlockSlabSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBlockSlabSequence::Item &DRTBlockSlabSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBlockSlabSequence::Item &DRTBlockSlabSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBlockSlabSequence::Item &DRTBlockSlabSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBlockSlabSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBlockSlabSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBlockSlabSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBlockSlabSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BlockSlabSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BlockSlabSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBlockSlabSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BlockSlabSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtbvcps.cc b/dcmrt/libsrc/drtbvcps.cc new file mode 100644 index 00000000..1a5281f2 --- /dev/null +++ b/dcmrt/libsrc/drtbvcps.cc @@ -0,0 +1,666 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTBeamDoseVerificationControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtbvcps.h" + + +// --- item class --- + +DRTBeamDoseVerificationControlPointSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamDosePointDepth(DCM_BeamDosePointDepth), + BeamDosePointEquivalentDepth(DCM_BeamDosePointEquivalentDepth), + BeamDosePointSSD(DCM_BeamDosePointSSD), + CumulativeMetersetWeight(DCM_CumulativeMetersetWeight), + ReferencedControlPointIndex(DCM_ReferencedControlPointIndex) +{ +} + + +DRTBeamDoseVerificationControlPointSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamDosePointDepth(copy.BeamDosePointDepth), + BeamDosePointEquivalentDepth(copy.BeamDosePointEquivalentDepth), + BeamDosePointSSD(copy.BeamDosePointSSD), + CumulativeMetersetWeight(copy.CumulativeMetersetWeight), + ReferencedControlPointIndex(copy.ReferencedControlPointIndex) +{ +} + + +DRTBeamDoseVerificationControlPointSequence::Item::~Item() +{ +} + + +DRTBeamDoseVerificationControlPointSequence::Item &DRTBeamDoseVerificationControlPointSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamDosePointDepth = copy.BeamDosePointDepth; + BeamDosePointEquivalentDepth = copy.BeamDosePointEquivalentDepth; + BeamDosePointSSD = copy.BeamDosePointSSD; + CumulativeMetersetWeight = copy.CumulativeMetersetWeight; + ReferencedControlPointIndex = copy.ReferencedControlPointIndex; + } + return *this; +} + + +void DRTBeamDoseVerificationControlPointSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CumulativeMetersetWeight.clear(); + ReferencedControlPointIndex.clear(); + BeamDosePointDepth.clear(); + BeamDosePointEquivalentDepth.clear(); + BeamDosePointSSD.clear(); + } +} + + +OFBool DRTBeamDoseVerificationControlPointSequence::Item::isEmpty() +{ + return CumulativeMetersetWeight.isEmpty() && + ReferencedControlPointIndex.isEmpty() && + BeamDosePointDepth.isEmpty() && + BeamDosePointEquivalentDepth.isEmpty() && + BeamDosePointSSD.isEmpty(); +} + + +OFBool DRTBeamDoseVerificationControlPointSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CumulativeMetersetWeight, "1", "1", "BeamDoseVerificationControlPointSequence"); + getAndCheckElementFromDataset(item, ReferencedControlPointIndex, "1", "1C", "BeamDoseVerificationControlPointSequence"); + getAndCheckElementFromDataset(item, BeamDosePointDepth, "1", "1C", "BeamDoseVerificationControlPointSequence"); + getAndCheckElementFromDataset(item, BeamDosePointEquivalentDepth, "1", "1C", "BeamDoseVerificationControlPointSequence"); + getAndCheckElementFromDataset(item, BeamDosePointSSD, "1", "1C", "BeamDoseVerificationControlPointSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmDecimalString(CumulativeMetersetWeight), "1", "1", "BeamDoseVerificationControlPointSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedControlPointIndex), "1", "1C", "BeamDoseVerificationControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(BeamDosePointDepth), "1", "1C", "BeamDoseVerificationControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(BeamDosePointEquivalentDepth), "1", "1C", "BeamDoseVerificationControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(BeamDosePointSSD), "1", "1C", "BeamDoseVerificationControlPointSequence"); + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::getBeamDosePointDepth(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, BeamDosePointDepth).getFloat32(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::getBeamDosePointEquivalentDepth(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, BeamDosePointEquivalentDepth).getFloat32(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::getBeamDosePointSSD(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, BeamDosePointSSD).getFloat32(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::getCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::getCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::getReferencedControlPointIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedControlPointIndex, value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::getReferencedControlPointIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedControlPointIndex).getSint32(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::setBeamDosePointDepth(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BeamDosePointDepth.putFloat32(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::setBeamDosePointEquivalentDepth(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BeamDosePointEquivalentDepth.putFloat32(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::setBeamDosePointSSD(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BeamDosePointSSD.putFloat32(value, pos); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::setCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::Item::setReferencedControlPointIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedControlPointIndex.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTBeamDoseVerificationControlPointSequence::DRTBeamDoseVerificationControlPointSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTBeamDoseVerificationControlPointSequence::DRTBeamDoseVerificationControlPointSequence(const DRTBeamDoseVerificationControlPointSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTBeamDoseVerificationControlPointSequence &DRTBeamDoseVerificationControlPointSequence::operator=(const DRTBeamDoseVerificationControlPointSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTBeamDoseVerificationControlPointSequence::~DRTBeamDoseVerificationControlPointSequence() +{ + clear(); +} + + +void DRTBeamDoseVerificationControlPointSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTBeamDoseVerificationControlPointSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTBeamDoseVerificationControlPointSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTBeamDoseVerificationControlPointSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTBeamDoseVerificationControlPointSequence::Item &DRTBeamDoseVerificationControlPointSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTBeamDoseVerificationControlPointSequence::Item &DRTBeamDoseVerificationControlPointSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTBeamDoseVerificationControlPointSequence::Item &DRTBeamDoseVerificationControlPointSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTBeamDoseVerificationControlPointSequence::Item &DRTBeamDoseVerificationControlPointSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTBeamDoseVerificationControlPointSequence::Item &DRTBeamDoseVerificationControlPointSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTBeamDoseVerificationControlPointSequence::Item &DRTBeamDoseVerificationControlPointSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_BeamDoseVerificationControlPointSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_BeamDoseVerificationControlPointSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTBeamDoseVerificationControlPointSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_BeamDoseVerificationControlPointSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcbars.cc b/dcmrt/libsrc/drtcbars.cc new file mode 100644 index 00000000..bf3f4b9c --- /dev/null +++ b/dcmrt/libsrc/drtcbars.cc @@ -0,0 +1,964 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTContrastBolusAdministrationRouteSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcbars.h" + + +// --- item class --- + +DRTContrastBolusAdministrationRouteSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AdditionalDrugSequence(emptyDefaultItem /*emptyDefaultSequence*/), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTContrastBolusAdministrationRouteSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AdditionalDrugSequence(copy.AdditionalDrugSequence), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTContrastBolusAdministrationRouteSequence::Item::~Item() +{ +} + + +DRTContrastBolusAdministrationRouteSequence::Item &DRTContrastBolusAdministrationRouteSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AdditionalDrugSequence = copy.AdditionalDrugSequence; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTContrastBolusAdministrationRouteSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + AdditionalDrugSequence.clear(); + } +} + + +OFBool DRTContrastBolusAdministrationRouteSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty() && + AdditionalDrugSequence.isEmpty(); +} + + +OFBool DRTContrastBolusAdministrationRouteSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ContrastBolusAdministrationRouteSequence"); + AdditionalDrugSequence.read(item, "1-n", "3", "ContrastBolusAdministrationRouteSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ContrastBolusAdministrationRouteSequence"); + if (result.good()) result = AdditionalDrugSequence.write(item, "1-n", "3", "ContrastBolusAdministrationRouteSequence"); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTContrastBolusAdministrationRouteSequence::DRTContrastBolusAdministrationRouteSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTContrastBolusAdministrationRouteSequence::DRTContrastBolusAdministrationRouteSequence(const DRTContrastBolusAdministrationRouteSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTContrastBolusAdministrationRouteSequence &DRTContrastBolusAdministrationRouteSequence::operator=(const DRTContrastBolusAdministrationRouteSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTContrastBolusAdministrationRouteSequence::~DRTContrastBolusAdministrationRouteSequence() +{ + clear(); +} + + +void DRTContrastBolusAdministrationRouteSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTContrastBolusAdministrationRouteSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTContrastBolusAdministrationRouteSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTContrastBolusAdministrationRouteSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTContrastBolusAdministrationRouteSequence::Item &DRTContrastBolusAdministrationRouteSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTContrastBolusAdministrationRouteSequence::Item &DRTContrastBolusAdministrationRouteSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTContrastBolusAdministrationRouteSequence::Item &DRTContrastBolusAdministrationRouteSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTContrastBolusAdministrationRouteSequence::Item &DRTContrastBolusAdministrationRouteSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTContrastBolusAdministrationRouteSequence::Item &DRTContrastBolusAdministrationRouteSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTContrastBolusAdministrationRouteSequence::Item &DRTContrastBolusAdministrationRouteSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ContrastBolusAdministrationRouteSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ContrastBolusAdministrationRouteSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTContrastBolusAdministrationRouteSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ContrastBolusAdministrationRouteSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtccs.cc b/dcmrt/libsrc/drtccs.cc new file mode 100644 index 00000000..a5bd570f --- /dev/null +++ b/dcmrt/libsrc/drtccs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTConceptCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtccs.h" + + +// --- item class --- + +DRTConceptCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTConceptCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTConceptCodeSequence::Item::~Item() +{ +} + + +DRTConceptCodeSequence::Item &DRTConceptCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTConceptCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTConceptCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTConceptCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTConceptCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ConceptCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ConceptCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ConceptCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ConceptCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ConceptCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ConceptCodeSequence"); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTConceptCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTConceptCodeSequence::DRTConceptCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTConceptCodeSequence::DRTConceptCodeSequence(const DRTConceptCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTConceptCodeSequence &DRTConceptCodeSequence::operator=(const DRTConceptCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTConceptCodeSequence::~DRTConceptCodeSequence() +{ + clear(); +} + + +void DRTConceptCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTConceptCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTConceptCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTConceptCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTConceptCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConceptCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConceptCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConceptCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConceptCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTConceptCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTConceptCodeSequence::Item &DRTConceptCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTConceptCodeSequence::Item &DRTConceptCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTConceptCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTConceptCodeSequence::Item &DRTConceptCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTConceptCodeSequence::Item &DRTConceptCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTConceptCodeSequence::Item &DRTConceptCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTConceptCodeSequence::Item &DRTConceptCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTConceptCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTConceptCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTConceptCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConceptCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ConceptCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ConceptCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTConceptCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ConceptCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcctus.cc b/dcmrt/libsrc/drtcctus.cc new file mode 100644 index 00000000..5d631bd1 --- /dev/null +++ b/dcmrt/libsrc/drtcctus.cc @@ -0,0 +1,602 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTConsentForClinicalTrialUseSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcctus.h" + + +// --- item class --- + +DRTConsentForClinicalTrialUseSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ConsentForDistributionFlag(DCM_ConsentForDistributionFlag), + DistributionType(DCM_DistributionType) +{ +} + + +DRTConsentForClinicalTrialUseSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ConsentForDistributionFlag(copy.ConsentForDistributionFlag), + DistributionType(copy.DistributionType) +{ +} + + +DRTConsentForClinicalTrialUseSequence::Item::~Item() +{ +} + + +DRTConsentForClinicalTrialUseSequence::Item &DRTConsentForClinicalTrialUseSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ConsentForDistributionFlag = copy.ConsentForDistributionFlag; + DistributionType = copy.DistributionType; + } + return *this; +} + + +void DRTConsentForClinicalTrialUseSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + DistributionType.clear(); + ClinicalTrialProtocolID.clear(); + ConsentForDistributionFlag.clear(); + } +} + + +OFBool DRTConsentForClinicalTrialUseSequence::Item::isEmpty() +{ + return DistributionType.isEmpty() && + ClinicalTrialProtocolID.isEmpty() && + ConsentForDistributionFlag.isEmpty(); +} + + +OFBool DRTConsentForClinicalTrialUseSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, DistributionType, "1", "1C", "ConsentForClinicalTrialUseSequence"); + getAndCheckElementFromDataset(item, ClinicalTrialProtocolID, "1", "1C", "ConsentForClinicalTrialUseSequence"); + getAndCheckElementFromDataset(item, ConsentForDistributionFlag, "1", "1", "ConsentForClinicalTrialUseSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(DistributionType), "1", "1C", "ConsentForClinicalTrialUseSequence"); + addElementToDataset(result, item, new DcmLongString(ClinicalTrialProtocolID), "1", "1C", "ConsentForClinicalTrialUseSequence"); + addElementToDataset(result, item, new DcmCodeString(ConsentForDistributionFlag), "1", "1", "ConsentForClinicalTrialUseSequence"); + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::getConsentForDistributionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ConsentForDistributionFlag, value, pos); +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::getDistributionType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DistributionType, value, pos); +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::setConsentForDistributionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ConsentForDistributionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::Item::setDistributionType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DistributionType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTConsentForClinicalTrialUseSequence::DRTConsentForClinicalTrialUseSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTConsentForClinicalTrialUseSequence::DRTConsentForClinicalTrialUseSequence(const DRTConsentForClinicalTrialUseSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTConsentForClinicalTrialUseSequence &DRTConsentForClinicalTrialUseSequence::operator=(const DRTConsentForClinicalTrialUseSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTConsentForClinicalTrialUseSequence::~DRTConsentForClinicalTrialUseSequence() +{ + clear(); +} + + +void DRTConsentForClinicalTrialUseSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTConsentForClinicalTrialUseSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTConsentForClinicalTrialUseSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTConsentForClinicalTrialUseSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTConsentForClinicalTrialUseSequence::Item &DRTConsentForClinicalTrialUseSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTConsentForClinicalTrialUseSequence::Item &DRTConsentForClinicalTrialUseSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTConsentForClinicalTrialUseSequence::Item &DRTConsentForClinicalTrialUseSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTConsentForClinicalTrialUseSequence::Item &DRTConsentForClinicalTrialUseSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTConsentForClinicalTrialUseSequence::Item &DRTConsentForClinicalTrialUseSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTConsentForClinicalTrialUseSequence::Item &DRTConsentForClinicalTrialUseSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ConsentForClinicalTrialUseSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ConsentForClinicalTrialUseSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTConsentForClinicalTrialUseSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ConsentForClinicalTrialUseSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcdrs.cc b/dcmrt/libsrc/drtcdrs.cc new file mode 100644 index 00000000..16a47a53 --- /dev/null +++ b/dcmrt/libsrc/drtcdrs.cc @@ -0,0 +1,658 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTCalculatedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcdrs.h" + + +// --- item class --- + +DRTCalculatedDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CalculatedDoseReferenceDescription(DCM_CalculatedDoseReferenceDescription), + CalculatedDoseReferenceDoseValue(DCM_CalculatedDoseReferenceDoseValue), + CalculatedDoseReferenceNumber(DCM_CalculatedDoseReferenceNumber), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTCalculatedDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CalculatedDoseReferenceDescription(copy.CalculatedDoseReferenceDescription), + CalculatedDoseReferenceDoseValue(copy.CalculatedDoseReferenceDoseValue), + CalculatedDoseReferenceNumber(copy.CalculatedDoseReferenceNumber), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTCalculatedDoseReferenceSequence::Item::~Item() +{ +} + + +DRTCalculatedDoseReferenceSequence::Item &DRTCalculatedDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CalculatedDoseReferenceDescription = copy.CalculatedDoseReferenceDescription; + CalculatedDoseReferenceDoseValue = copy.CalculatedDoseReferenceDoseValue; + CalculatedDoseReferenceNumber = copy.CalculatedDoseReferenceNumber; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTCalculatedDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + CalculatedDoseReferenceNumber.clear(); + CalculatedDoseReferenceDoseValue.clear(); + CalculatedDoseReferenceDescription.clear(); + } +} + + +OFBool DRTCalculatedDoseReferenceSequence::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + CalculatedDoseReferenceNumber.isEmpty() && + CalculatedDoseReferenceDoseValue.isEmpty() && + CalculatedDoseReferenceDescription.isEmpty(); +} + + +OFBool DRTCalculatedDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1C", "CalculatedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CalculatedDoseReferenceNumber, "1", "1C", "CalculatedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CalculatedDoseReferenceDoseValue, "1", "2", "CalculatedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CalculatedDoseReferenceDescription, "1", "3", "CalculatedDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1C", "CalculatedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmIntegerString(CalculatedDoseReferenceNumber), "1", "1C", "CalculatedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(CalculatedDoseReferenceDoseValue), "1", "2", "CalculatedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmShortText(CalculatedDoseReferenceDescription), "1", "3", "CalculatedDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::getCalculatedDoseReferenceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CalculatedDoseReferenceDescription, value, pos); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::getCalculatedDoseReferenceDoseValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CalculatedDoseReferenceDoseValue, value, pos); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::getCalculatedDoseReferenceDoseValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CalculatedDoseReferenceDoseValue).getFloat64(value, pos); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::getCalculatedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CalculatedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::getCalculatedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CalculatedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::setCalculatedDoseReferenceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CalculatedDoseReferenceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::setCalculatedDoseReferenceDoseValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CalculatedDoseReferenceDoseValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::setCalculatedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CalculatedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTCalculatedDoseReferenceSequence::DRTCalculatedDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTCalculatedDoseReferenceSequence::DRTCalculatedDoseReferenceSequence(const DRTCalculatedDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTCalculatedDoseReferenceSequence &DRTCalculatedDoseReferenceSequence::operator=(const DRTCalculatedDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTCalculatedDoseReferenceSequence::~DRTCalculatedDoseReferenceSequence() +{ + clear(); +} + + +void DRTCalculatedDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTCalculatedDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTCalculatedDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTCalculatedDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTCalculatedDoseReferenceSequence::Item &DRTCalculatedDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTCalculatedDoseReferenceSequence::Item &DRTCalculatedDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTCalculatedDoseReferenceSequence::Item &DRTCalculatedDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTCalculatedDoseReferenceSequence::Item &DRTCalculatedDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTCalculatedDoseReferenceSequence::Item &DRTCalculatedDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTCalculatedDoseReferenceSequence::Item &DRTCalculatedDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTCalculatedDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_CalculatedDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_CalculatedDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTCalculatedDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_CalculatedDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtces.cc b/dcmrt/libsrc/drtces.cc new file mode 100644 index 00000000..35b976d0 --- /dev/null +++ b/dcmrt/libsrc/drtces.cc @@ -0,0 +1,944 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTContributingEquipmentSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtces.h" + + +// --- item class --- + +DRTContributingEquipmentSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ContributionDateTime(DCM_ContributionDateTime), + ContributionDescription(DCM_ContributionDescription), + DateOfLastCalibration(DCM_DateOfLastCalibration), + DeviceSerialNumber(DCM_DeviceSerialNumber), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionName(DCM_InstitutionName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + Manufacturer(DCM_Manufacturer), + ManufacturerModelName(DCM_ManufacturerModelName), + OperatorIdentificationSequence(emptyDefaultItem /*emptyDefaultSequence*/), + OperatorsName(DCM_OperatorsName), + PurposeOfReferenceCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SoftwareVersions(DCM_SoftwareVersions), + SpatialResolution(DCM_SpatialResolution), + StationName(DCM_StationName), + TimeOfLastCalibration(DCM_TimeOfLastCalibration) +{ +} + + +DRTContributingEquipmentSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ContributionDateTime(copy.ContributionDateTime), + ContributionDescription(copy.ContributionDescription), + DateOfLastCalibration(copy.DateOfLastCalibration), + DeviceSerialNumber(copy.DeviceSerialNumber), + InstitutionAddress(copy.InstitutionAddress), + InstitutionName(copy.InstitutionName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + Manufacturer(copy.Manufacturer), + ManufacturerModelName(copy.ManufacturerModelName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + OperatorsName(copy.OperatorsName), + PurposeOfReferenceCodeSequence(copy.PurposeOfReferenceCodeSequence), + SoftwareVersions(copy.SoftwareVersions), + SpatialResolution(copy.SpatialResolution), + StationName(copy.StationName), + TimeOfLastCalibration(copy.TimeOfLastCalibration) +{ +} + + +DRTContributingEquipmentSequence::Item::~Item() +{ +} + + +DRTContributingEquipmentSequence::Item &DRTContributingEquipmentSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ContributionDateTime = copy.ContributionDateTime; + ContributionDescription = copy.ContributionDescription; + DateOfLastCalibration = copy.DateOfLastCalibration; + DeviceSerialNumber = copy.DeviceSerialNumber; + InstitutionAddress = copy.InstitutionAddress; + InstitutionName = copy.InstitutionName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + Manufacturer = copy.Manufacturer; + ManufacturerModelName = copy.ManufacturerModelName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + OperatorsName = copy.OperatorsName; + PurposeOfReferenceCodeSequence = copy.PurposeOfReferenceCodeSequence; + SoftwareVersions = copy.SoftwareVersions; + SpatialResolution = copy.SpatialResolution; + StationName = copy.StationName; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + } + return *this; +} + + +void DRTContributingEquipmentSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PurposeOfReferenceCodeSequence.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + ContributionDateTime.clear(); + ContributionDescription.clear(); + } +} + + +OFBool DRTContributingEquipmentSequence::Item::isEmpty() +{ + return PurposeOfReferenceCodeSequence.isEmpty() && + Manufacturer.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + StationName.isEmpty() && + InstitutionalDepartmentName.isEmpty() && + OperatorsName.isEmpty() && + OperatorIdentificationSequence.isEmpty() && + ManufacturerModelName.isEmpty() && + DeviceSerialNumber.isEmpty() && + SoftwareVersions.isEmpty() && + SpatialResolution.isEmpty() && + DateOfLastCalibration.isEmpty() && + TimeOfLastCalibration.isEmpty() && + ContributionDateTime.isEmpty() && + ContributionDescription.isEmpty(); +} + + +OFBool DRTContributingEquipmentSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTContributingEquipmentSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + PurposeOfReferenceCodeSequence.read(item, "1-n", "1", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, Manufacturer, "1", "1", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, StationName, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, InstitutionalDepartmentName, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, OperatorsName, "1-n", "3", "ContributingEquipmentSequence"); + OperatorIdentificationSequence.read(item, "1-n", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, ManufacturerModelName, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, DeviceSerialNumber, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, SoftwareVersions, "1-n", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, SpatialResolution, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, DateOfLastCalibration, "1-n", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, TimeOfLastCalibration, "1-n", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, ContributionDateTime, "1", "3", "ContributingEquipmentSequence"); + getAndCheckElementFromDataset(item, ContributionDescription, "1", "3", "ContributingEquipmentSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + if (result.good()) result = PurposeOfReferenceCodeSequence.write(item, "1-n", "1", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmLongString(Manufacturer), "1", "1", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmShortString(StationName), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionalDepartmentName), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmPersonName(OperatorsName), "1-n", "3", "ContributingEquipmentSequence"); + if (result.good()) result = OperatorIdentificationSequence.write(item, "1-n", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmLongString(ManufacturerModelName), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceSerialNumber), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmLongString(SoftwareVersions), "1-n", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmDecimalString(SpatialResolution), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmDate(DateOfLastCalibration), "1-n", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmTime(TimeOfLastCalibration), "1-n", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmDateTime(ContributionDateTime), "1", "3", "ContributingEquipmentSequence"); + addElementToDataset(result, item, new DcmShortText(ContributionDescription), "1", "3", "ContributingEquipmentSequence"); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::getContributionDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContributionDateTime, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getContributionDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContributionDescription, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getManufacturerModelName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getOperatorsName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getSoftwareVersions(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getSpatialResolution(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getStationName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTContributingEquipmentSequence::Item::setContributionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContributionDateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setContributionDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ContributionDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::Item::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTContributingEquipmentSequence::DRTContributingEquipmentSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTContributingEquipmentSequence::DRTContributingEquipmentSequence(const DRTContributingEquipmentSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTContributingEquipmentSequence &DRTContributingEquipmentSequence::operator=(const DRTContributingEquipmentSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTContributingEquipmentSequence::~DRTContributingEquipmentSequence() +{ + clear(); +} + + +void DRTContributingEquipmentSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTContributingEquipmentSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTContributingEquipmentSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTContributingEquipmentSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTContributingEquipmentSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTContributingEquipmentSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTContributingEquipmentSequence::Item &DRTContributingEquipmentSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTContributingEquipmentSequence::Item &DRTContributingEquipmentSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTContributingEquipmentSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTContributingEquipmentSequence::Item &DRTContributingEquipmentSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTContributingEquipmentSequence::Item &DRTContributingEquipmentSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTContributingEquipmentSequence::Item &DRTContributingEquipmentSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTContributingEquipmentSequence::Item &DRTContributingEquipmentSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTContributingEquipmentSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ContributingEquipmentSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ContributingEquipmentSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTContributingEquipmentSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ContributingEquipmentSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcgis.cc b/dcmrt/libsrc/drtcgis.cc new file mode 100644 index 00000000..74c6749e --- /dev/null +++ b/dcmrt/libsrc/drtcgis.cc @@ -0,0 +1,631 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTContextGroupIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcgis.h" + + +// --- item class --- + +DRTContextGroupIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + MappingResource(DCM_MappingResource) +{ +} + + +DRTContextGroupIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + MappingResource(copy.MappingResource) +{ +} + + +DRTContextGroupIdentificationSequence::Item::~Item() +{ +} + + +DRTContextGroupIdentificationSequence::Item &DRTContextGroupIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + MappingResource = copy.MappingResource; + } + return *this; +} + + +void DRTContextGroupIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + ContextGroupVersion.clear(); + } +} + + +OFBool DRTContextGroupIdentificationSequence::Item::isEmpty() +{ + return ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + ContextGroupVersion.isEmpty(); +} + + +OFBool DRTContextGroupIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "1", "ContextGroupIdentificationSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ContextGroupIdentificationSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1", "ContextGroupIdentificationSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1", "ContextGroupIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "1", "ContextGroupIdentificationSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ContextGroupIdentificationSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1", "ContextGroupIdentificationSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1", "ContextGroupIdentificationSequence"); + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTContextGroupIdentificationSequence::DRTContextGroupIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTContextGroupIdentificationSequence::DRTContextGroupIdentificationSequence(const DRTContextGroupIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTContextGroupIdentificationSequence &DRTContextGroupIdentificationSequence::operator=(const DRTContextGroupIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTContextGroupIdentificationSequence::~DRTContextGroupIdentificationSequence() +{ + clear(); +} + + +void DRTContextGroupIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTContextGroupIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTContextGroupIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTContextGroupIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTContextGroupIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTContextGroupIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTContextGroupIdentificationSequence::Item &DRTContextGroupIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTContextGroupIdentificationSequence::Item &DRTContextGroupIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTContextGroupIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTContextGroupIdentificationSequence::Item &DRTContextGroupIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTContextGroupIdentificationSequence::Item &DRTContextGroupIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTContextGroupIdentificationSequence::Item &DRTContextGroupIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTContextGroupIdentificationSequence::Item &DRTContextGroupIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTContextGroupIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ContextGroupIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ContextGroupIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTContextGroupIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ContextGroupIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtchs.cc b/dcmrt/libsrc/drtchs.cc new file mode 100644 index 00000000..004ae081 --- /dev/null +++ b/dcmrt/libsrc/drtchs.cc @@ -0,0 +1,1454 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTChannelSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtchs.h" + + +// --- item class --- + +DRTChannelSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AfterloaderChannelID(DCM_AfterloaderChannelID), + BrachyControlPointSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ChannelEffectiveLength(DCM_ChannelEffectiveLength), + ChannelInnerLength(DCM_ChannelInnerLength), + ChannelLength(DCM_ChannelLength), + ChannelNumber(DCM_ChannelNumber), + ChannelShieldSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ChannelTotalTime(DCM_ChannelTotalTime), + FinalCumulativeTimeWeight(DCM_FinalCumulativeTimeWeight), + MaterialID(DCM_MaterialID), + NumberOfControlPoints(DCM_NumberOfControlPoints), + NumberOfPulses(DCM_NumberOfPulses), + PulseRepetitionInterval(DCM_PulseRepetitionInterval), + ReferencedROINumber(DCM_ReferencedROINumber), + ReferencedSourceNumber(DCM_ReferencedSourceNumber), + SourceApplicatorID(DCM_SourceApplicatorID), + SourceApplicatorLength(DCM_SourceApplicatorLength), + SourceApplicatorManufacturer(DCM_SourceApplicatorManufacturer), + SourceApplicatorName(DCM_SourceApplicatorName), + SourceApplicatorNumber(DCM_SourceApplicatorNumber), + SourceApplicatorStepSize(DCM_SourceApplicatorStepSize), + SourceApplicatorTipLength(DCM_SourceApplicatorTipLength), + SourceApplicatorType(DCM_SourceApplicatorType), + SourceApplicatorWallNominalThickness(DCM_SourceApplicatorWallNominalThickness), + SourceApplicatorWallNominalTransmission(DCM_SourceApplicatorWallNominalTransmission), + SourceMovementType(DCM_SourceMovementType), + TransferTubeLength(DCM_TransferTubeLength), + TransferTubeNumber(DCM_TransferTubeNumber) +{ +} + + +DRTChannelSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AfterloaderChannelID(copy.AfterloaderChannelID), + BrachyControlPointSequence(copy.BrachyControlPointSequence), + ChannelEffectiveLength(copy.ChannelEffectiveLength), + ChannelInnerLength(copy.ChannelInnerLength), + ChannelLength(copy.ChannelLength), + ChannelNumber(copy.ChannelNumber), + ChannelShieldSequence(copy.ChannelShieldSequence), + ChannelTotalTime(copy.ChannelTotalTime), + FinalCumulativeTimeWeight(copy.FinalCumulativeTimeWeight), + MaterialID(copy.MaterialID), + NumberOfControlPoints(copy.NumberOfControlPoints), + NumberOfPulses(copy.NumberOfPulses), + PulseRepetitionInterval(copy.PulseRepetitionInterval), + ReferencedROINumber(copy.ReferencedROINumber), + ReferencedSourceNumber(copy.ReferencedSourceNumber), + SourceApplicatorID(copy.SourceApplicatorID), + SourceApplicatorLength(copy.SourceApplicatorLength), + SourceApplicatorManufacturer(copy.SourceApplicatorManufacturer), + SourceApplicatorName(copy.SourceApplicatorName), + SourceApplicatorNumber(copy.SourceApplicatorNumber), + SourceApplicatorStepSize(copy.SourceApplicatorStepSize), + SourceApplicatorTipLength(copy.SourceApplicatorTipLength), + SourceApplicatorType(copy.SourceApplicatorType), + SourceApplicatorWallNominalThickness(copy.SourceApplicatorWallNominalThickness), + SourceApplicatorWallNominalTransmission(copy.SourceApplicatorWallNominalTransmission), + SourceMovementType(copy.SourceMovementType), + TransferTubeLength(copy.TransferTubeLength), + TransferTubeNumber(copy.TransferTubeNumber) +{ +} + + +DRTChannelSequence::Item::~Item() +{ +} + + +DRTChannelSequence::Item &DRTChannelSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AfterloaderChannelID = copy.AfterloaderChannelID; + BrachyControlPointSequence = copy.BrachyControlPointSequence; + ChannelEffectiveLength = copy.ChannelEffectiveLength; + ChannelInnerLength = copy.ChannelInnerLength; + ChannelLength = copy.ChannelLength; + ChannelNumber = copy.ChannelNumber; + ChannelShieldSequence = copy.ChannelShieldSequence; + ChannelTotalTime = copy.ChannelTotalTime; + FinalCumulativeTimeWeight = copy.FinalCumulativeTimeWeight; + MaterialID = copy.MaterialID; + NumberOfControlPoints = copy.NumberOfControlPoints; + NumberOfPulses = copy.NumberOfPulses; + PulseRepetitionInterval = copy.PulseRepetitionInterval; + ReferencedROINumber = copy.ReferencedROINumber; + ReferencedSourceNumber = copy.ReferencedSourceNumber; + SourceApplicatorID = copy.SourceApplicatorID; + SourceApplicatorLength = copy.SourceApplicatorLength; + SourceApplicatorManufacturer = copy.SourceApplicatorManufacturer; + SourceApplicatorName = copy.SourceApplicatorName; + SourceApplicatorNumber = copy.SourceApplicatorNumber; + SourceApplicatorStepSize = copy.SourceApplicatorStepSize; + SourceApplicatorTipLength = copy.SourceApplicatorTipLength; + SourceApplicatorType = copy.SourceApplicatorType; + SourceApplicatorWallNominalThickness = copy.SourceApplicatorWallNominalThickness; + SourceApplicatorWallNominalTransmission = copy.SourceApplicatorWallNominalTransmission; + SourceMovementType = copy.SourceMovementType; + TransferTubeLength = copy.TransferTubeLength; + TransferTubeNumber = copy.TransferTubeNumber; + } + return *this; +} + + +void DRTChannelSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ChannelNumber.clear(); + ChannelLength.clear(); + ChannelTotalTime.clear(); + SourceMovementType.clear(); + NumberOfPulses.clear(); + PulseRepetitionInterval.clear(); + SourceApplicatorNumber.clear(); + SourceApplicatorID.clear(); + SourceApplicatorType.clear(); + SourceApplicatorName.clear(); + SourceApplicatorLength.clear(); + SourceApplicatorTipLength.clear(); + SourceApplicatorManufacturer.clear(); + MaterialID.clear(); + SourceApplicatorWallNominalThickness.clear(); + SourceApplicatorWallNominalTransmission.clear(); + SourceApplicatorStepSize.clear(); + ReferencedROINumber.clear(); + TransferTubeNumber.clear(); + TransferTubeLength.clear(); + ChannelEffectiveLength.clear(); + ChannelInnerLength.clear(); + AfterloaderChannelID.clear(); + ChannelShieldSequence.clear(); + ReferencedSourceNumber.clear(); + NumberOfControlPoints.clear(); + FinalCumulativeTimeWeight.clear(); + BrachyControlPointSequence.clear(); + } +} + + +OFBool DRTChannelSequence::Item::isEmpty() +{ + return ChannelNumber.isEmpty() && + ChannelLength.isEmpty() && + ChannelTotalTime.isEmpty() && + SourceMovementType.isEmpty() && + NumberOfPulses.isEmpty() && + PulseRepetitionInterval.isEmpty() && + SourceApplicatorNumber.isEmpty() && + SourceApplicatorID.isEmpty() && + SourceApplicatorType.isEmpty() && + SourceApplicatorName.isEmpty() && + SourceApplicatorLength.isEmpty() && + SourceApplicatorTipLength.isEmpty() && + SourceApplicatorManufacturer.isEmpty() && + MaterialID.isEmpty() && + SourceApplicatorWallNominalThickness.isEmpty() && + SourceApplicatorWallNominalTransmission.isEmpty() && + SourceApplicatorStepSize.isEmpty() && + ReferencedROINumber.isEmpty() && + TransferTubeNumber.isEmpty() && + TransferTubeLength.isEmpty() && + ChannelEffectiveLength.isEmpty() && + ChannelInnerLength.isEmpty() && + AfterloaderChannelID.isEmpty() && + ChannelShieldSequence.isEmpty() && + ReferencedSourceNumber.isEmpty() && + NumberOfControlPoints.isEmpty() && + FinalCumulativeTimeWeight.isEmpty() && + BrachyControlPointSequence.isEmpty(); +} + + +OFBool DRTChannelSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTChannelSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ChannelNumber, "1", "1", "ChannelSequence"); + getAndCheckElementFromDataset(item, ChannelLength, "1", "2", "ChannelSequence"); + getAndCheckElementFromDataset(item, ChannelTotalTime, "1", "1", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceMovementType, "1", "1", "ChannelSequence"); + getAndCheckElementFromDataset(item, NumberOfPulses, "1", "1C", "ChannelSequence"); + getAndCheckElementFromDataset(item, PulseRepetitionInterval, "1", "1C", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorNumber, "1", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorID, "1", "2C", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorType, "1", "1C", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorName, "1", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorLength, "1", "1C", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorTipLength, "1", "2C", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorManufacturer, "1", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorWallNominalThickness, "1", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorWallNominalTransmission, "1", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, SourceApplicatorStepSize, "1", "1C", "ChannelSequence"); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "2C", "ChannelSequence"); + getAndCheckElementFromDataset(item, TransferTubeNumber, "1", "2", "ChannelSequence"); + getAndCheckElementFromDataset(item, TransferTubeLength, "1", "2C", "ChannelSequence"); + getAndCheckElementFromDataset(item, ChannelEffectiveLength, "1", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, ChannelInnerLength, "1", "2C", "ChannelSequence"); + getAndCheckElementFromDataset(item, AfterloaderChannelID, "1", "3", "ChannelSequence"); + ChannelShieldSequence.read(item, "1-n", "3", "ChannelSequence"); + getAndCheckElementFromDataset(item, ReferencedSourceNumber, "1", "1", "ChannelSequence"); + getAndCheckElementFromDataset(item, NumberOfControlPoints, "1", "1", "ChannelSequence"); + getAndCheckElementFromDataset(item, FinalCumulativeTimeWeight, "1", "1C", "ChannelSequence"); + BrachyControlPointSequence.read(item, "1-n", "1", "ChannelSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ChannelNumber), "1", "1", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChannelLength), "1", "2", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChannelTotalTime), "1", "1", "ChannelSequence"); + addElementToDataset(result, item, new DcmCodeString(SourceMovementType), "1", "1", "ChannelSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfPulses), "1", "1C", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(PulseRepetitionInterval), "1", "1C", "ChannelSequence"); + addElementToDataset(result, item, new DcmIntegerString(SourceApplicatorNumber), "1", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmShortString(SourceApplicatorID), "1", "2C", "ChannelSequence"); + addElementToDataset(result, item, new DcmCodeString(SourceApplicatorType), "1", "1C", "ChannelSequence"); + addElementToDataset(result, item, new DcmLongString(SourceApplicatorName), "1", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceApplicatorLength), "1", "1C", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceApplicatorTipLength), "1", "2C", "ChannelSequence"); + addElementToDataset(result, item, new DcmLongString(SourceApplicatorManufacturer), "1", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceApplicatorWallNominalThickness), "1", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceApplicatorWallNominalTransmission), "1", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceApplicatorStepSize), "1", "1C", "ChannelSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "2C", "ChannelSequence"); + addElementToDataset(result, item, new DcmIntegerString(TransferTubeNumber), "1", "2", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(TransferTubeLength), "1", "2C", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChannelEffectiveLength), "1", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChannelInnerLength), "1", "2C", "ChannelSequence"); + addElementToDataset(result, item, new DcmShortString(AfterloaderChannelID), "1", "3", "ChannelSequence"); + if (result.good()) result = ChannelShieldSequence.write(item, "1-n", "3", "ChannelSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedSourceNumber), "1", "1", "ChannelSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfControlPoints), "1", "1", "ChannelSequence"); + addElementToDataset(result, item, new DcmDecimalString(FinalCumulativeTimeWeight), "1", "1C", "ChannelSequence"); + if (result.good()) result = BrachyControlPointSequence.write(item, "1-n", "1", "ChannelSequence"); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::getAfterloaderChannelID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AfterloaderChannelID, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelEffectiveLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelEffectiveLength, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelEffectiveLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChannelEffectiveLength).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelInnerLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelInnerLength, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelInnerLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChannelInnerLength).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelLength, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChannelLength).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelNumber, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ChannelNumber).getSint32(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelTotalTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelTotalTime, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getChannelTotalTime(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChannelTotalTime).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getFinalCumulativeTimeWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FinalCumulativeTimeWeight, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getFinalCumulativeTimeWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, FinalCumulativeTimeWeight).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getNumberOfControlPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfControlPoints, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getNumberOfControlPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfControlPoints).getSint32(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getNumberOfPulses(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfPulses, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getNumberOfPulses(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfPulses).getSint32(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getPulseRepetitionInterval(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PulseRepetitionInterval, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getPulseRepetitionInterval(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, PulseRepetitionInterval).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getReferencedSourceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSourceNumber, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getReferencedSourceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedSourceNumber).getSint32(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorID, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorLength, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceApplicatorLength).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorManufacturer, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorName, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorNumber, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, SourceApplicatorNumber).getSint32(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorStepSize(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorStepSize, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorStepSize(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceApplicatorStepSize).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorTipLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorTipLength, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorTipLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceApplicatorTipLength).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorType, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorWallNominalThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorWallNominalThickness, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorWallNominalThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceApplicatorWallNominalThickness).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorWallNominalTransmission(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceApplicatorWallNominalTransmission, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceApplicatorWallNominalTransmission(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceApplicatorWallNominalTransmission).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getSourceMovementType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceMovementType, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getTransferTubeLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TransferTubeLength, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getTransferTubeLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TransferTubeLength).getFloat64(value, pos); +} + + +OFCondition DRTChannelSequence::Item::getTransferTubeNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TransferTubeNumber, value, pos); +} + + +OFCondition DRTChannelSequence::Item::getTransferTubeNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, TransferTubeNumber).getSint32(value, pos); +} + + +OFCondition DRTChannelSequence::Item::setAfterloaderChannelID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AfterloaderChannelID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setChannelEffectiveLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelEffectiveLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setChannelInnerLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelInnerLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setChannelLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setChannelNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setChannelTotalTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelTotalTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setFinalCumulativeTimeWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FinalCumulativeTimeWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setNumberOfControlPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfControlPoints.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setNumberOfPulses(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfPulses.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setPulseRepetitionInterval(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PulseRepetitionInterval.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setReferencedSourceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSourceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorManufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorStepSize(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorStepSize.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorTipLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorTipLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorWallNominalThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorWallNominalThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceApplicatorWallNominalTransmission(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceApplicatorWallNominalTransmission.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setSourceMovementType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceMovementType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setTransferTubeLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TransferTubeLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSequence::Item::setTransferTubeNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TransferTubeNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTChannelSequence::DRTChannelSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTChannelSequence::DRTChannelSequence(const DRTChannelSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTChannelSequence &DRTChannelSequence::operator=(const DRTChannelSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTChannelSequence::~DRTChannelSequence() +{ + clear(); +} + + +void DRTChannelSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTChannelSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTChannelSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTChannelSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTChannelSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTChannelSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTChannelSequence::Item &DRTChannelSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTChannelSequence::Item &DRTChannelSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTChannelSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTChannelSequence::Item &DRTChannelSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTChannelSequence::Item &DRTChannelSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTChannelSequence::Item &DRTChannelSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTChannelSequence::Item &DRTChannelSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTChannelSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTChannelSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTChannelSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ChannelSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ChannelSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTChannelSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ChannelSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcims.cc b/dcmrt/libsrc/drtcims.cc new file mode 100644 index 00000000..6cc3c2e0 --- /dev/null +++ b/dcmrt/libsrc/drtcims.cc @@ -0,0 +1,897 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTContentItemModifierSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcims.h" + + +// --- item class --- + +DRTContentItemModifierSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ConceptCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ConceptNameCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + Date(DCM_Date), + DateTime(DCM_DateTime), + FloatingPointValue(DCM_FloatingPointValue), + MeasurementUnitsCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + NumericValue(DCM_NumericValue), + ObservationDateTime(DCM_ObservationDateTime), + PersonName(DCM_PersonName), + RationalDenominatorValue(DCM_RationalDenominatorValue), + RationalNumeratorValue(DCM_RationalNumeratorValue), + ReferencedSOPSequence(emptyDefaultItem /*emptyDefaultSequence*/), + TextValue(DCM_TextValue), + Time(DCM_Time), + UID(DCM_UID), + ValueType(DCM_ValueType) +{ +} + + +DRTContentItemModifierSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ConceptCodeSequence(copy.ConceptCodeSequence), + ConceptNameCodeSequence(copy.ConceptNameCodeSequence), + Date(copy.Date), + DateTime(copy.DateTime), + FloatingPointValue(copy.FloatingPointValue), + MeasurementUnitsCodeSequence(copy.MeasurementUnitsCodeSequence), + NumericValue(copy.NumericValue), + ObservationDateTime(copy.ObservationDateTime), + PersonName(copy.PersonName), + RationalDenominatorValue(copy.RationalDenominatorValue), + RationalNumeratorValue(copy.RationalNumeratorValue), + ReferencedSOPSequence(copy.ReferencedSOPSequence), + TextValue(copy.TextValue), + Time(copy.Time), + UID(copy.UID), + ValueType(copy.ValueType) +{ +} + + +DRTContentItemModifierSequence::Item::~Item() +{ +} + + +DRTContentItemModifierSequence::Item &DRTContentItemModifierSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ConceptCodeSequence = copy.ConceptCodeSequence; + ConceptNameCodeSequence = copy.ConceptNameCodeSequence; + Date = copy.Date; + DateTime = copy.DateTime; + FloatingPointValue = copy.FloatingPointValue; + MeasurementUnitsCodeSequence = copy.MeasurementUnitsCodeSequence; + NumericValue = copy.NumericValue; + ObservationDateTime = copy.ObservationDateTime; + PersonName = copy.PersonName; + RationalDenominatorValue = copy.RationalDenominatorValue; + RationalNumeratorValue = copy.RationalNumeratorValue; + ReferencedSOPSequence = copy.ReferencedSOPSequence; + TextValue = copy.TextValue; + Time = copy.Time; + UID = copy.UID; + ValueType = copy.ValueType; + } + return *this; +} + + +void DRTContentItemModifierSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ValueType.clear(); + ObservationDateTime.clear(); + ConceptNameCodeSequence.clear(); + DateTime.clear(); + Date.clear(); + Time.clear(); + PersonName.clear(); + UID.clear(); + TextValue.clear(); + ConceptCodeSequence.clear(); + NumericValue.clear(); + FloatingPointValue.clear(); + RationalNumeratorValue.clear(); + RationalDenominatorValue.clear(); + MeasurementUnitsCodeSequence.clear(); + ReferencedSOPSequence.clear(); + } +} + + +OFBool DRTContentItemModifierSequence::Item::isEmpty() +{ + return ValueType.isEmpty() && + ObservationDateTime.isEmpty() && + ConceptNameCodeSequence.isEmpty() && + DateTime.isEmpty() && + Date.isEmpty() && + Time.isEmpty() && + PersonName.isEmpty() && + UID.isEmpty() && + TextValue.isEmpty() && + ConceptCodeSequence.isEmpty() && + NumericValue.isEmpty() && + FloatingPointValue.isEmpty() && + RationalNumeratorValue.isEmpty() && + RationalDenominatorValue.isEmpty() && + MeasurementUnitsCodeSequence.isEmpty() && + ReferencedSOPSequence.isEmpty(); +} + + +OFBool DRTContentItemModifierSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTContentItemModifierSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ValueType, "1", "1", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, ObservationDateTime, "1", "3", "ContentItemModifierSequence"); + ConceptNameCodeSequence.read(item, "1-n", "1", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, DateTime, "1", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, Date, "1", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, Time, "1", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, PersonName, "1", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, UID, "1", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, TextValue, "1", "1C", "ContentItemModifierSequence"); + ConceptCodeSequence.read(item, "1-n", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, NumericValue, "1-n", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, FloatingPointValue, "1-n", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, RationalNumeratorValue, "1-n", "1C", "ContentItemModifierSequence"); + getAndCheckElementFromDataset(item, RationalDenominatorValue, "1-n", "1C", "ContentItemModifierSequence"); + MeasurementUnitsCodeSequence.read(item, "1-n", "1C", "ContentItemModifierSequence"); + ReferencedSOPSequence.read(item, "1-n", "1C", "ContentItemModifierSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ValueType), "1", "1", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmDateTime(ObservationDateTime), "1", "3", "ContentItemModifierSequence"); + if (result.good()) result = ConceptNameCodeSequence.write(item, "1-n", "1", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmDateTime(DateTime), "1", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmDate(Date), "1", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmTime(Time), "1", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmPersonName(PersonName), "1", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(UID), "1", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(TextValue), "1", "1C", "ContentItemModifierSequence"); + if (result.good()) result = ConceptCodeSequence.write(item, "1-n", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmDecimalString(NumericValue), "1-n", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(FloatingPointValue), "1-n", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmSignedLong(RationalNumeratorValue), "1-n", "1C", "ContentItemModifierSequence"); + addElementToDataset(result, item, new DcmUnsignedLong(RationalDenominatorValue), "1-n", "1C", "ContentItemModifierSequence"); + if (result.good()) result = MeasurementUnitsCodeSequence.write(item, "1-n", "1C", "ContentItemModifierSequence"); + if (result.good()) result = ReferencedSOPSequence.write(item, "1-n", "1C", "ContentItemModifierSequence"); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::getDate(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Date, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DateTime, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getFloatingPointValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, FloatingPointValue).getFloat64(value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getNumericValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumericValue, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getNumericValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NumericValue).getFloat64(value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getNumericValue(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NumericValue).getFloat64Vector(value); +} + + +OFCondition DRTContentItemModifierSequence::Item::getObservationDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ObservationDateTime, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getPersonName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonName, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getRationalDenominatorValue(Uint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedLong &, RationalDenominatorValue).getUint32(value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getRationalNumeratorValue(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmSignedLong &, RationalNumeratorValue).getSint32(value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getTextValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TextValue, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Time, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UID, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::getValueType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ValueType, value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::setDate(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Date.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setFloatingPointValue(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FloatingPointValue.putFloat64(value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::setNumericValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NumericValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setObservationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ObservationDateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setPersonName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PersonName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setRationalDenominatorValue(const Uint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RationalDenominatorValue.putUint32(value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::setRationalNumeratorValue(const Sint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RationalNumeratorValue.putSint32(value, pos); +} + + +OFCondition DRTContentItemModifierSequence::Item::setTextValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = TextValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Time.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::Item::setValueType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ValueType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTContentItemModifierSequence::DRTContentItemModifierSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTContentItemModifierSequence::DRTContentItemModifierSequence(const DRTContentItemModifierSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTContentItemModifierSequence &DRTContentItemModifierSequence::operator=(const DRTContentItemModifierSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTContentItemModifierSequence::~DRTContentItemModifierSequence() +{ + clear(); +} + + +void DRTContentItemModifierSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTContentItemModifierSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTContentItemModifierSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTContentItemModifierSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTContentItemModifierSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTContentItemModifierSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTContentItemModifierSequence::Item &DRTContentItemModifierSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTContentItemModifierSequence::Item &DRTContentItemModifierSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTContentItemModifierSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTContentItemModifierSequence::Item &DRTContentItemModifierSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTContentItemModifierSequence::Item &DRTContentItemModifierSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTContentItemModifierSequence::Item &DRTContentItemModifierSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTContentItemModifierSequence::Item &DRTContentItemModifierSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTContentItemModifierSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ContentItemModifierSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ContentItemModifierSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTContentItemModifierSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ContentItemModifierSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcis.cc b/dcmrt/libsrc/drtcis.cc new file mode 100644 index 00000000..79ac761d --- /dev/null +++ b/dcmrt/libsrc/drtcis.cc @@ -0,0 +1,636 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTContourImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcis.h" + + +// --- item class --- + +DRTContourImageSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedFrameNumber(DCM_ReferencedFrameNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + ReferencedSegmentNumber(DCM_ReferencedSegmentNumber) +{ +} + + +DRTContourImageSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedFrameNumber(copy.ReferencedFrameNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + ReferencedSegmentNumber(copy.ReferencedSegmentNumber) +{ +} + + +DRTContourImageSequence::Item::~Item() +{ +} + + +DRTContourImageSequence::Item &DRTContourImageSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedFrameNumber = copy.ReferencedFrameNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + ReferencedSegmentNumber = copy.ReferencedSegmentNumber; + } + return *this; +} + + +void DRTContourImageSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferencedFrameNumber.clear(); + ReferencedSegmentNumber.clear(); + } +} + + +OFBool DRTContourImageSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferencedFrameNumber.isEmpty() && + ReferencedSegmentNumber.isEmpty(); +} + + +OFBool DRTContourImageSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTContourImageSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ContourImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ContourImageSequence"); + getAndCheckElementFromDataset(item, ReferencedFrameNumber, "1-n", "1C", "ContourImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSegmentNumber, "1-n", "1C", "ContourImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContourImageSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ContourImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ContourImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedFrameNumber), "1-n", "1C", "ContourImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(ReferencedSegmentNumber), "1-n", "1C", "ContourImageSequence"); + } + return result; +} + + +OFCondition DRTContourImageSequence::Item::getReferencedFrameNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameNumber, value, pos); +} + + +OFCondition DRTContourImageSequence::Item::getReferencedFrameNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFrameNumber).getSint32(value, pos); +} + + +OFCondition DRTContourImageSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTContourImageSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTContourImageSequence::Item::getReferencedSegmentNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ReferencedSegmentNumber).getUint16(value, pos); +} + + +OFCondition DRTContourImageSequence::Item::setReferencedFrameNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ReferencedFrameNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourImageSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourImageSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourImageSequence::Item::setReferencedSegmentNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ReferencedSegmentNumber.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTContourImageSequence::DRTContourImageSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTContourImageSequence::DRTContourImageSequence(const DRTContourImageSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTContourImageSequence &DRTContourImageSequence::operator=(const DRTContourImageSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTContourImageSequence::~DRTContourImageSequence() +{ + clear(); +} + + +void DRTContourImageSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTContourImageSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTContourImageSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTContourImageSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTContourImageSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContourImageSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContourImageSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContourImageSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContourImageSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTContourImageSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTContourImageSequence::Item &DRTContourImageSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTContourImageSequence::Item &DRTContourImageSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTContourImageSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTContourImageSequence::Item &DRTContourImageSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTContourImageSequence::Item &DRTContourImageSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTContourImageSequence::Item &DRTContourImageSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTContourImageSequence::Item &DRTContourImageSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTContourImageSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTContourImageSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTContourImageSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContourImageSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ContourImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ContourImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTContourImageSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ContourImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcncs.cc b/dcmrt/libsrc/drtcncs.cc new file mode 100644 index 00000000..49d89196 --- /dev/null +++ b/dcmrt/libsrc/drtcncs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTConceptNameCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcncs.h" + + +// --- item class --- + +DRTConceptNameCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTConceptNameCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTConceptNameCodeSequence::Item::~Item() +{ +} + + +DRTConceptNameCodeSequence::Item &DRTConceptNameCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTConceptNameCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTConceptNameCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTConceptNameCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTConceptNameCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ConceptNameCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ConceptNameCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ConceptNameCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ConceptNameCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ConceptNameCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ConceptNameCodeSequence"); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTConceptNameCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTConceptNameCodeSequence::DRTConceptNameCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTConceptNameCodeSequence::DRTConceptNameCodeSequence(const DRTConceptNameCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTConceptNameCodeSequence &DRTConceptNameCodeSequence::operator=(const DRTConceptNameCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTConceptNameCodeSequence::~DRTConceptNameCodeSequence() +{ + clear(); +} + + +void DRTConceptNameCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTConceptNameCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTConceptNameCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTConceptNameCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTConceptNameCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTConceptNameCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTConceptNameCodeSequence::Item &DRTConceptNameCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTConceptNameCodeSequence::Item &DRTConceptNameCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTConceptNameCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTConceptNameCodeSequence::Item &DRTConceptNameCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTConceptNameCodeSequence::Item &DRTConceptNameCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTConceptNameCodeSequence::Item &DRTConceptNameCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTConceptNameCodeSequence::Item &DRTConceptNameCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTConceptNameCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ConceptNameCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ConceptNameCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTConceptNameCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ConceptNameCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcos.cc b/dcmrt/libsrc/drtcos.cc new file mode 100644 index 00000000..9f7626e5 --- /dev/null +++ b/dcmrt/libsrc/drtcos.cc @@ -0,0 +1,1163 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTCompensatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcos.h" + + +// --- item class --- + +DRTCompensatorSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + CompensatorColumns(DCM_CompensatorColumns), + CompensatorDescription(DCM_CompensatorDescription), + CompensatorDivergence(DCM_CompensatorDivergence), + CompensatorID(DCM_CompensatorID), + CompensatorMountingPosition(DCM_CompensatorMountingPosition), + CompensatorNumber(DCM_CompensatorNumber), + CompensatorPixelSpacing(DCM_CompensatorPixelSpacing), + CompensatorPosition(DCM_CompensatorPosition), + CompensatorRows(DCM_CompensatorRows), + CompensatorThicknessData(DCM_CompensatorThicknessData), + CompensatorTransmissionData(DCM_CompensatorTransmissionData), + CompensatorTrayID(DCM_CompensatorTrayID), + CompensatorType(DCM_CompensatorType), + MaterialID(DCM_MaterialID), + SourceToCompensatorDistance(DCM_SourceToCompensatorDistance), + SourceToCompensatorTrayDistance(DCM_SourceToCompensatorTrayDistance), + TrayAccessoryCode(DCM_TrayAccessoryCode) +{ +} + + +DRTCompensatorSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + CompensatorColumns(copy.CompensatorColumns), + CompensatorDescription(copy.CompensatorDescription), + CompensatorDivergence(copy.CompensatorDivergence), + CompensatorID(copy.CompensatorID), + CompensatorMountingPosition(copy.CompensatorMountingPosition), + CompensatorNumber(copy.CompensatorNumber), + CompensatorPixelSpacing(copy.CompensatorPixelSpacing), + CompensatorPosition(copy.CompensatorPosition), + CompensatorRows(copy.CompensatorRows), + CompensatorThicknessData(copy.CompensatorThicknessData), + CompensatorTransmissionData(copy.CompensatorTransmissionData), + CompensatorTrayID(copy.CompensatorTrayID), + CompensatorType(copy.CompensatorType), + MaterialID(copy.MaterialID), + SourceToCompensatorDistance(copy.SourceToCompensatorDistance), + SourceToCompensatorTrayDistance(copy.SourceToCompensatorTrayDistance), + TrayAccessoryCode(copy.TrayAccessoryCode) +{ +} + + +DRTCompensatorSequence::Item::~Item() +{ +} + + +DRTCompensatorSequence::Item &DRTCompensatorSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + CompensatorColumns = copy.CompensatorColumns; + CompensatorDescription = copy.CompensatorDescription; + CompensatorDivergence = copy.CompensatorDivergence; + CompensatorID = copy.CompensatorID; + CompensatorMountingPosition = copy.CompensatorMountingPosition; + CompensatorNumber = copy.CompensatorNumber; + CompensatorPixelSpacing = copy.CompensatorPixelSpacing; + CompensatorPosition = copy.CompensatorPosition; + CompensatorRows = copy.CompensatorRows; + CompensatorThicknessData = copy.CompensatorThicknessData; + CompensatorTransmissionData = copy.CompensatorTransmissionData; + CompensatorTrayID = copy.CompensatorTrayID; + CompensatorType = copy.CompensatorType; + MaterialID = copy.MaterialID; + SourceToCompensatorDistance = copy.SourceToCompensatorDistance; + SourceToCompensatorTrayDistance = copy.SourceToCompensatorTrayDistance; + TrayAccessoryCode = copy.TrayAccessoryCode; + } + return *this; +} + + +void DRTCompensatorSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CompensatorDescription.clear(); + CompensatorNumber.clear(); + CompensatorType.clear(); + MaterialID.clear(); + CompensatorID.clear(); + AccessoryCode.clear(); + CompensatorTrayID.clear(); + TrayAccessoryCode.clear(); + SourceToCompensatorTrayDistance.clear(); + CompensatorDivergence.clear(); + CompensatorMountingPosition.clear(); + CompensatorRows.clear(); + CompensatorColumns.clear(); + CompensatorPixelSpacing.clear(); + CompensatorPosition.clear(); + CompensatorTransmissionData.clear(); + CompensatorThicknessData.clear(); + SourceToCompensatorDistance.clear(); + } +} + + +OFBool DRTCompensatorSequence::Item::isEmpty() +{ + return CompensatorDescription.isEmpty() && + CompensatorNumber.isEmpty() && + CompensatorType.isEmpty() && + MaterialID.isEmpty() && + CompensatorID.isEmpty() && + AccessoryCode.isEmpty() && + CompensatorTrayID.isEmpty() && + TrayAccessoryCode.isEmpty() && + SourceToCompensatorTrayDistance.isEmpty() && + CompensatorDivergence.isEmpty() && + CompensatorMountingPosition.isEmpty() && + CompensatorRows.isEmpty() && + CompensatorColumns.isEmpty() && + CompensatorPixelSpacing.isEmpty() && + CompensatorPosition.isEmpty() && + CompensatorTransmissionData.isEmpty() && + CompensatorThicknessData.isEmpty() && + SourceToCompensatorDistance.isEmpty(); +} + + +OFBool DRTCompensatorSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTCompensatorSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CompensatorDescription, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorNumber, "1", "1C", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorType, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "2C", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorID, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorTrayID, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, TrayAccessoryCode, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, SourceToCompensatorTrayDistance, "1", "2", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorDivergence, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorMountingPosition, "1", "3", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorRows, "1", "1", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorColumns, "1", "1", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorPixelSpacing, "2", "1", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorPosition, "2", "1", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorTransmissionData, "1-n", "1C", "CompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorThicknessData, "1-n", "1C", "CompensatorSequence"); + getAndCheckElementFromDataset(item, SourceToCompensatorDistance, "1-n", "1C", "CompensatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongText(CompensatorDescription), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmIntegerString(CompensatorNumber), "1", "1C", "CompensatorSequence"); + addElementToDataset(result, item, new DcmCodeString(CompensatorType), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "2C", "CompensatorSequence"); + addElementToDataset(result, item, new DcmShortString(CompensatorID), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmShortString(CompensatorTrayID), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmLongString(TrayAccessoryCode), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToCompensatorTrayDistance), "1", "2", "CompensatorSequence"); + addElementToDataset(result, item, new DcmCodeString(CompensatorDivergence), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmCodeString(CompensatorMountingPosition), "1", "3", "CompensatorSequence"); + addElementToDataset(result, item, new DcmIntegerString(CompensatorRows), "1", "1", "CompensatorSequence"); + addElementToDataset(result, item, new DcmIntegerString(CompensatorColumns), "1", "1", "CompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(CompensatorPixelSpacing), "2", "1", "CompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(CompensatorPosition), "2", "1", "CompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(CompensatorTransmissionData), "1-n", "1C", "CompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(CompensatorThicknessData), "1-n", "1C", "CompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToCompensatorDistance), "1-n", "1C", "CompensatorSequence"); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorColumns(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorColumns, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorColumns(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CompensatorColumns).getSint32(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorDescription, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorDivergence(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorDivergence, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorID, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorMountingPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorMountingPosition, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorNumber, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CompensatorNumber).getSint32(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorPixelSpacing(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorPixelSpacing, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorPixelSpacing(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPixelSpacing).getFloat64(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorPixelSpacing(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPixelSpacing).getFloat64Vector(value); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorPosition, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPosition).getFloat64(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorPosition(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPosition).getFloat64Vector(value); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorRows(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorRows, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorRows(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CompensatorRows).getSint32(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorThicknessData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorThicknessData, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorThicknessData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorThicknessData).getFloat64(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorThicknessData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorThicknessData).getFloat64Vector(value); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorTransmissionData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorTransmissionData, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorTransmissionData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorTransmissionData).getFloat64(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorTransmissionData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorTransmissionData).getFloat64Vector(value); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorTrayID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorTrayID, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getCompensatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorType, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getSourceToCompensatorDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToCompensatorDistance, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getSourceToCompensatorDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToCompensatorDistance).getFloat64(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getSourceToCompensatorDistance(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToCompensatorDistance).getFloat64Vector(value); +} + + +OFCondition DRTCompensatorSequence::Item::getSourceToCompensatorTrayDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToCompensatorTrayDistance, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getSourceToCompensatorTrayDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToCompensatorTrayDistance).getFloat64(value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::getTrayAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TrayAccessoryCode, value, pos); +} + + +OFCondition DRTCompensatorSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorColumns(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorColumns.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CompensatorDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorDivergence(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorDivergence.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorMountingPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorMountingPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorPixelSpacing(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = CompensatorPixelSpacing.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = CompensatorPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorRows(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorRows.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorThicknessData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = CompensatorThicknessData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorTransmissionData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = CompensatorTransmissionData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorTrayID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorTrayID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setCompensatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setSourceToCompensatorDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SourceToCompensatorDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setSourceToCompensatorTrayDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToCompensatorTrayDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCompensatorSequence::Item::setTrayAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TrayAccessoryCode.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTCompensatorSequence::DRTCompensatorSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTCompensatorSequence::DRTCompensatorSequence(const DRTCompensatorSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTCompensatorSequence &DRTCompensatorSequence::operator=(const DRTCompensatorSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTCompensatorSequence::~DRTCompensatorSequence() +{ + clear(); +} + + +void DRTCompensatorSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTCompensatorSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTCompensatorSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTCompensatorSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTCompensatorSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCompensatorSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCompensatorSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCompensatorSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCompensatorSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTCompensatorSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTCompensatorSequence::Item &DRTCompensatorSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTCompensatorSequence::Item &DRTCompensatorSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTCompensatorSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTCompensatorSequence::Item &DRTCompensatorSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTCompensatorSequence::Item &DRTCompensatorSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTCompensatorSequence::Item &DRTCompensatorSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTCompensatorSequence::Item &DRTCompensatorSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTCompensatorSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTCompensatorSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTCompensatorSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCompensatorSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_CompensatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_CompensatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTCompensatorSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_CompensatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcpas.cc b/dcmrt/libsrc/drtcpas.cc new file mode 100644 index 00000000..16fd2edf --- /dev/null +++ b/dcmrt/libsrc/drtcpas.cc @@ -0,0 +1,636 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTCorrectedParameterSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcpas.h" + + +// --- item class --- + +DRTCorrectedParameterSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CorrectionValue(DCM_CorrectionValue), + ParameterItemIndex(DCM_ParameterItemIndex), + ParameterPointer(DCM_ParameterPointer), + ParameterSequencePointer(DCM_ParameterSequencePointer) +{ +} + + +DRTCorrectedParameterSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CorrectionValue(copy.CorrectionValue), + ParameterItemIndex(copy.ParameterItemIndex), + ParameterPointer(copy.ParameterPointer), + ParameterSequencePointer(copy.ParameterSequencePointer) +{ +} + + +DRTCorrectedParameterSequence::Item::~Item() +{ +} + + +DRTCorrectedParameterSequence::Item &DRTCorrectedParameterSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CorrectionValue = copy.CorrectionValue; + ParameterItemIndex = copy.ParameterItemIndex; + ParameterPointer = copy.ParameterPointer; + ParameterSequencePointer = copy.ParameterSequencePointer; + } + return *this; +} + + +void DRTCorrectedParameterSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ParameterSequencePointer.clear(); + ParameterItemIndex.clear(); + ParameterPointer.clear(); + CorrectionValue.clear(); + } +} + + +OFBool DRTCorrectedParameterSequence::Item::isEmpty() +{ + return ParameterSequencePointer.isEmpty() && + ParameterItemIndex.isEmpty() && + ParameterPointer.isEmpty() && + CorrectionValue.isEmpty(); +} + + +OFBool DRTCorrectedParameterSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTCorrectedParameterSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ParameterSequencePointer, "1", "1", "CorrectedParameterSequence"); + getAndCheckElementFromDataset(item, ParameterItemIndex, "1", "1", "CorrectedParameterSequence"); + getAndCheckElementFromDataset(item, ParameterPointer, "1", "1", "CorrectedParameterSequence"); + getAndCheckElementFromDataset(item, CorrectionValue, "1", "1", "CorrectedParameterSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmAttributeTag(ParameterSequencePointer), "1", "1", "CorrectedParameterSequence"); + addElementToDataset(result, item, new DcmIntegerString(ParameterItemIndex), "1", "1", "CorrectedParameterSequence"); + addElementToDataset(result, item, new DcmAttributeTag(ParameterPointer), "1", "1", "CorrectedParameterSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(CorrectionValue), "1", "1", "CorrectedParameterSequence"); + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::Item::getCorrectionValue(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, CorrectionValue).getFloat32(value, pos); +} + + +OFCondition DRTCorrectedParameterSequence::Item::getParameterItemIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ParameterItemIndex, value, pos); +} + + +OFCondition DRTCorrectedParameterSequence::Item::getParameterItemIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ParameterItemIndex).getSint32(value, pos); +} + + +OFCondition DRTCorrectedParameterSequence::Item::getParameterPointer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ParameterPointer, value, pos); +} + + +OFCondition DRTCorrectedParameterSequence::Item::getParameterSequencePointer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ParameterSequencePointer, value, pos); +} + + +OFCondition DRTCorrectedParameterSequence::Item::setCorrectionValue(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return CorrectionValue.putFloat32(value, pos); +} + + +OFCondition DRTCorrectedParameterSequence::Item::setParameterItemIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ParameterItemIndex.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::Item::setParameterPointer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmAttributeTag::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ParameterPointer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::Item::setParameterSequencePointer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmAttributeTag::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ParameterSequencePointer.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTCorrectedParameterSequence::DRTCorrectedParameterSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTCorrectedParameterSequence::DRTCorrectedParameterSequence(const DRTCorrectedParameterSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTCorrectedParameterSequence &DRTCorrectedParameterSequence::operator=(const DRTCorrectedParameterSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTCorrectedParameterSequence::~DRTCorrectedParameterSequence() +{ + clear(); +} + + +void DRTCorrectedParameterSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTCorrectedParameterSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTCorrectedParameterSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTCorrectedParameterSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTCorrectedParameterSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTCorrectedParameterSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTCorrectedParameterSequence::Item &DRTCorrectedParameterSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTCorrectedParameterSequence::Item &DRTCorrectedParameterSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTCorrectedParameterSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTCorrectedParameterSequence::Item &DRTCorrectedParameterSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTCorrectedParameterSequence::Item &DRTCorrectedParameterSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTCorrectedParameterSequence::Item &DRTCorrectedParameterSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTCorrectedParameterSequence::Item &DRTCorrectedParameterSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTCorrectedParameterSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_CorrectedParameterSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_CorrectedParameterSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTCorrectedParameterSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_CorrectedParameterSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcpis.cc b/dcmrt/libsrc/drtcpis.cc new file mode 100644 index 00000000..67fcb6cd --- /dev/null +++ b/dcmrt/libsrc/drtcpis.cc @@ -0,0 +1,674 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTConsultingPhysicianIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcpis.h" + + +// --- item class --- + +DRTConsultingPhysicianIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + InstitutionName(DCM_InstitutionName), + PersonAddress(DCM_PersonAddress), + PersonIdentificationCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PersonTelecomInformation(DCM_PersonTelecomInformation), + PersonTelephoneNumbers(DCM_PersonTelephoneNumbers) +{ +} + + +DRTConsultingPhysicianIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + InstitutionAddress(copy.InstitutionAddress), + InstitutionCodeSequence(copy.InstitutionCodeSequence), + InstitutionName(copy.InstitutionName), + PersonAddress(copy.PersonAddress), + PersonIdentificationCodeSequence(copy.PersonIdentificationCodeSequence), + PersonTelecomInformation(copy.PersonTelecomInformation), + PersonTelephoneNumbers(copy.PersonTelephoneNumbers) +{ +} + + +DRTConsultingPhysicianIdentificationSequence::Item::~Item() +{ +} + + +DRTConsultingPhysicianIdentificationSequence::Item &DRTConsultingPhysicianIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + InstitutionAddress = copy.InstitutionAddress; + InstitutionCodeSequence = copy.InstitutionCodeSequence; + InstitutionName = copy.InstitutionName; + PersonAddress = copy.PersonAddress; + PersonIdentificationCodeSequence = copy.PersonIdentificationCodeSequence; + PersonTelecomInformation = copy.PersonTelecomInformation; + PersonTelephoneNumbers = copy.PersonTelephoneNumbers; + } + return *this; +} + + +void DRTConsultingPhysicianIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PersonIdentificationCodeSequence.clear(); + PersonAddress.clear(); + PersonTelephoneNumbers.clear(); + PersonTelecomInformation.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionCodeSequence.clear(); + } +} + + +OFBool DRTConsultingPhysicianIdentificationSequence::Item::isEmpty() +{ + return PersonIdentificationCodeSequence.isEmpty() && + PersonAddress.isEmpty() && + PersonTelephoneNumbers.isEmpty() && + PersonTelecomInformation.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionCodeSequence.isEmpty(); +} + + +OFBool DRTConsultingPhysicianIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + PersonIdentificationCodeSequence.read(item, "1-n", "1", "ConsultingPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonAddress, "1", "3", "ConsultingPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelephoneNumbers, "1-n", "3", "ConsultingPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelecomInformation, "1", "3", "ConsultingPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "1C", "ConsultingPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "ConsultingPhysicianIdentificationSequence"); + InstitutionCodeSequence.read(item, "1-n", "1C", "ConsultingPhysicianIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + if (result.good()) result = PersonIdentificationCodeSequence.write(item, "1-n", "1", "ConsultingPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(PersonAddress), "1", "3", "ConsultingPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(PersonTelephoneNumbers), "1-n", "3", "ConsultingPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmLongText(PersonTelecomInformation), "1", "3", "ConsultingPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "1C", "ConsultingPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "ConsultingPhysicianIdentificationSequence"); + if (result.good()) result = InstitutionCodeSequence.write(item, "1-n", "1C", "ConsultingPhysicianIdentificationSequence"); + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::getPersonAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonAddress, value, pos); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::getPersonTelecomInformation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelecomInformation, value, pos); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::getPersonTelephoneNumbers(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelephoneNumbers, value, pos); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::setPersonAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::setPersonTelecomInformation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonTelecomInformation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::Item::setPersonTelephoneNumbers(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PersonTelephoneNumbers.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTConsultingPhysicianIdentificationSequence::DRTConsultingPhysicianIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTConsultingPhysicianIdentificationSequence::DRTConsultingPhysicianIdentificationSequence(const DRTConsultingPhysicianIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTConsultingPhysicianIdentificationSequence &DRTConsultingPhysicianIdentificationSequence::operator=(const DRTConsultingPhysicianIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTConsultingPhysicianIdentificationSequence::~DRTConsultingPhysicianIdentificationSequence() +{ + clear(); +} + + +void DRTConsultingPhysicianIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTConsultingPhysicianIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTConsultingPhysicianIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTConsultingPhysicianIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTConsultingPhysicianIdentificationSequence::Item &DRTConsultingPhysicianIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTConsultingPhysicianIdentificationSequence::Item &DRTConsultingPhysicianIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTConsultingPhysicianIdentificationSequence::Item &DRTConsultingPhysicianIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTConsultingPhysicianIdentificationSequence::Item &DRTConsultingPhysicianIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTConsultingPhysicianIdentificationSequence::Item &DRTConsultingPhysicianIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTConsultingPhysicianIdentificationSequence::Item &DRTConsultingPhysicianIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ConsultingPhysicianIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ConsultingPhysicianIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTConsultingPhysicianIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ConsultingPhysicianIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcps.cc b/dcmrt/libsrc/drtcps.cc new file mode 100644 index 00000000..4110535a --- /dev/null +++ b/dcmrt/libsrc/drtcps.cc @@ -0,0 +1,1459 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcps.h" + + +// --- item class --- + +DRTControlPointSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamLimitingDeviceAngle(DCM_BeamLimitingDeviceAngle), + BeamLimitingDevicePositionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamLimitingDeviceRotationDirection(DCM_BeamLimitingDeviceRotationDirection), + ControlPointIndex(DCM_ControlPointIndex), + CumulativeMetersetWeight(DCM_CumulativeMetersetWeight), + DoseRateSet(DCM_DoseRateSet), + ExternalContourEntryPoint(DCM_ExternalContourEntryPoint), + GantryAngle(DCM_GantryAngle), + GantryPitchAngle(DCM_GantryPitchAngle), + GantryPitchRotationDirection(DCM_GantryPitchRotationDirection), + GantryRotationDirection(DCM_GantryRotationDirection), + IsocenterPosition(DCM_IsocenterPosition), + NominalBeamEnergy(DCM_NominalBeamEnergy), + PatientSupportAngle(DCM_PatientSupportAngle), + PatientSupportRotationDirection(DCM_PatientSupportRotationDirection), + ReferencedDoseReferenceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedDoseSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SourceToExternalContourDistance(DCM_SourceToExternalContourDistance), + SourceToSurfaceDistance(DCM_SourceToSurfaceDistance), + SurfaceEntryPoint(DCM_SurfaceEntryPoint), + TableTopEccentricAngle(DCM_TableTopEccentricAngle), + TableTopEccentricAxisDistance(DCM_TableTopEccentricAxisDistance), + TableTopEccentricRotationDirection(DCM_TableTopEccentricRotationDirection), + TableTopLateralPosition(DCM_TableTopLateralPosition), + TableTopLongitudinalPosition(DCM_TableTopLongitudinalPosition), + TableTopPitchAngle(DCM_TableTopPitchAngle), + TableTopPitchRotationDirection(DCM_TableTopPitchRotationDirection), + TableTopRollAngle(DCM_TableTopRollAngle), + TableTopRollRotationDirection(DCM_TableTopRollRotationDirection), + TableTopVerticalPosition(DCM_TableTopVerticalPosition), + WedgePositionSequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTControlPointSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamLimitingDeviceAngle(copy.BeamLimitingDeviceAngle), + BeamLimitingDevicePositionSequence(copy.BeamLimitingDevicePositionSequence), + BeamLimitingDeviceRotationDirection(copy.BeamLimitingDeviceRotationDirection), + ControlPointIndex(copy.ControlPointIndex), + CumulativeMetersetWeight(copy.CumulativeMetersetWeight), + DoseRateSet(copy.DoseRateSet), + ExternalContourEntryPoint(copy.ExternalContourEntryPoint), + GantryAngle(copy.GantryAngle), + GantryPitchAngle(copy.GantryPitchAngle), + GantryPitchRotationDirection(copy.GantryPitchRotationDirection), + GantryRotationDirection(copy.GantryRotationDirection), + IsocenterPosition(copy.IsocenterPosition), + NominalBeamEnergy(copy.NominalBeamEnergy), + PatientSupportAngle(copy.PatientSupportAngle), + PatientSupportRotationDirection(copy.PatientSupportRotationDirection), + ReferencedDoseReferenceSequence(copy.ReferencedDoseReferenceSequence), + ReferencedDoseSequence(copy.ReferencedDoseSequence), + SourceToExternalContourDistance(copy.SourceToExternalContourDistance), + SourceToSurfaceDistance(copy.SourceToSurfaceDistance), + SurfaceEntryPoint(copy.SurfaceEntryPoint), + TableTopEccentricAngle(copy.TableTopEccentricAngle), + TableTopEccentricAxisDistance(copy.TableTopEccentricAxisDistance), + TableTopEccentricRotationDirection(copy.TableTopEccentricRotationDirection), + TableTopLateralPosition(copy.TableTopLateralPosition), + TableTopLongitudinalPosition(copy.TableTopLongitudinalPosition), + TableTopPitchAngle(copy.TableTopPitchAngle), + TableTopPitchRotationDirection(copy.TableTopPitchRotationDirection), + TableTopRollAngle(copy.TableTopRollAngle), + TableTopRollRotationDirection(copy.TableTopRollRotationDirection), + TableTopVerticalPosition(copy.TableTopVerticalPosition), + WedgePositionSequence(copy.WedgePositionSequence) +{ +} + + +DRTControlPointSequence::Item::~Item() +{ +} + + +DRTControlPointSequence::Item &DRTControlPointSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamLimitingDeviceAngle = copy.BeamLimitingDeviceAngle; + BeamLimitingDevicePositionSequence = copy.BeamLimitingDevicePositionSequence; + BeamLimitingDeviceRotationDirection = copy.BeamLimitingDeviceRotationDirection; + ControlPointIndex = copy.ControlPointIndex; + CumulativeMetersetWeight = copy.CumulativeMetersetWeight; + DoseRateSet = copy.DoseRateSet; + ExternalContourEntryPoint = copy.ExternalContourEntryPoint; + GantryAngle = copy.GantryAngle; + GantryPitchAngle = copy.GantryPitchAngle; + GantryPitchRotationDirection = copy.GantryPitchRotationDirection; + GantryRotationDirection = copy.GantryRotationDirection; + IsocenterPosition = copy.IsocenterPosition; + NominalBeamEnergy = copy.NominalBeamEnergy; + PatientSupportAngle = copy.PatientSupportAngle; + PatientSupportRotationDirection = copy.PatientSupportRotationDirection; + ReferencedDoseReferenceSequence = copy.ReferencedDoseReferenceSequence; + ReferencedDoseSequence = copy.ReferencedDoseSequence; + SourceToExternalContourDistance = copy.SourceToExternalContourDistance; + SourceToSurfaceDistance = copy.SourceToSurfaceDistance; + SurfaceEntryPoint = copy.SurfaceEntryPoint; + TableTopEccentricAngle = copy.TableTopEccentricAngle; + TableTopEccentricAxisDistance = copy.TableTopEccentricAxisDistance; + TableTopEccentricRotationDirection = copy.TableTopEccentricRotationDirection; + TableTopLateralPosition = copy.TableTopLateralPosition; + TableTopLongitudinalPosition = copy.TableTopLongitudinalPosition; + TableTopPitchAngle = copy.TableTopPitchAngle; + TableTopPitchRotationDirection = copy.TableTopPitchRotationDirection; + TableTopRollAngle = copy.TableTopRollAngle; + TableTopRollRotationDirection = copy.TableTopRollRotationDirection; + TableTopVerticalPosition = copy.TableTopVerticalPosition; + WedgePositionSequence = copy.WedgePositionSequence; + } + return *this; +} + + +void DRTControlPointSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ControlPointIndex.clear(); + CumulativeMetersetWeight.clear(); + ReferencedDoseReferenceSequence.clear(); + ReferencedDoseSequence.clear(); + NominalBeamEnergy.clear(); + DoseRateSet.clear(); + WedgePositionSequence.clear(); + BeamLimitingDevicePositionSequence.clear(); + GantryAngle.clear(); + GantryRotationDirection.clear(); + GantryPitchAngle.clear(); + GantryPitchRotationDirection.clear(); + BeamLimitingDeviceAngle.clear(); + BeamLimitingDeviceRotationDirection.clear(); + PatientSupportAngle.clear(); + PatientSupportRotationDirection.clear(); + TableTopEccentricAxisDistance.clear(); + TableTopEccentricAngle.clear(); + TableTopEccentricRotationDirection.clear(); + TableTopPitchAngle.clear(); + TableTopPitchRotationDirection.clear(); + TableTopRollAngle.clear(); + TableTopRollRotationDirection.clear(); + TableTopVerticalPosition.clear(); + TableTopLongitudinalPosition.clear(); + TableTopLateralPosition.clear(); + IsocenterPosition.clear(); + SurfaceEntryPoint.clear(); + ExternalContourEntryPoint.clear(); + SourceToSurfaceDistance.clear(); + SourceToExternalContourDistance.clear(); + } +} + + +OFBool DRTControlPointSequence::Item::isEmpty() +{ + return ControlPointIndex.isEmpty() && + CumulativeMetersetWeight.isEmpty() && + ReferencedDoseReferenceSequence.isEmpty() && + ReferencedDoseSequence.isEmpty() && + NominalBeamEnergy.isEmpty() && + DoseRateSet.isEmpty() && + WedgePositionSequence.isEmpty() && + BeamLimitingDevicePositionSequence.isEmpty() && + GantryAngle.isEmpty() && + GantryRotationDirection.isEmpty() && + GantryPitchAngle.isEmpty() && + GantryPitchRotationDirection.isEmpty() && + BeamLimitingDeviceAngle.isEmpty() && + BeamLimitingDeviceRotationDirection.isEmpty() && + PatientSupportAngle.isEmpty() && + PatientSupportRotationDirection.isEmpty() && + TableTopEccentricAxisDistance.isEmpty() && + TableTopEccentricAngle.isEmpty() && + TableTopEccentricRotationDirection.isEmpty() && + TableTopPitchAngle.isEmpty() && + TableTopPitchRotationDirection.isEmpty() && + TableTopRollAngle.isEmpty() && + TableTopRollRotationDirection.isEmpty() && + TableTopVerticalPosition.isEmpty() && + TableTopLongitudinalPosition.isEmpty() && + TableTopLateralPosition.isEmpty() && + IsocenterPosition.isEmpty() && + SurfaceEntryPoint.isEmpty() && + ExternalContourEntryPoint.isEmpty() && + SourceToSurfaceDistance.isEmpty() && + SourceToExternalContourDistance.isEmpty(); +} + + +OFBool DRTControlPointSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTControlPointSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ControlPointIndex, "1", "1", "ControlPointSequence"); + getAndCheckElementFromDataset(item, CumulativeMetersetWeight, "1", "2", "ControlPointSequence"); + ReferencedDoseReferenceSequence.read(item, "1-n", "3", "ControlPointSequence"); + ReferencedDoseSequence.read(item, "1-n", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, NominalBeamEnergy, "1", "3", "ControlPointSequence"); + getAndCheckElementFromDataset(item, DoseRateSet, "1", "3", "ControlPointSequence"); + WedgePositionSequence.read(item, "1-n", "1C", "ControlPointSequence"); + BeamLimitingDevicePositionSequence.read(item, "1-n", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, GantryAngle, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, GantryRotationDirection, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, GantryPitchAngle, "1", "3", "ControlPointSequence"); + getAndCheckElementFromDataset(item, GantryPitchRotationDirection, "1", "3", "ControlPointSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceAngle, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceRotationDirection, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, PatientSupportAngle, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, PatientSupportRotationDirection, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopEccentricAxisDistance, "1", "3", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopEccentricAngle, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopEccentricRotationDirection, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopPitchAngle, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopPitchRotationDirection, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopRollAngle, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopRollRotationDirection, "1", "1C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopVerticalPosition, "1", "2C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopLongitudinalPosition, "1", "2C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopLateralPosition, "1", "2C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, IsocenterPosition, "3", "2C", "ControlPointSequence"); + getAndCheckElementFromDataset(item, SurfaceEntryPoint, "3", "3", "ControlPointSequence"); + getAndCheckElementFromDataset(item, ExternalContourEntryPoint, "3", "3", "ControlPointSequence"); + getAndCheckElementFromDataset(item, SourceToSurfaceDistance, "1", "3", "ControlPointSequence"); + getAndCheckElementFromDataset(item, SourceToExternalContourDistance, "1", "3", "ControlPointSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ControlPointIndex), "1", "1", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(CumulativeMetersetWeight), "1", "2", "ControlPointSequence"); + if (result.good()) result = ReferencedDoseReferenceSequence.write(item, "1-n", "3", "ControlPointSequence"); + if (result.good()) result = ReferencedDoseSequence.write(item, "1-n", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(NominalBeamEnergy), "1", "3", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(DoseRateSet), "1", "3", "ControlPointSequence"); + if (result.good()) result = WedgePositionSequence.write(item, "1-n", "1C", "ControlPointSequence"); + if (result.good()) result = BeamLimitingDevicePositionSequence.write(item, "1-n", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(GantryAngle), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(GantryRotationDirection), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(GantryPitchAngle), "1", "3", "ControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(GantryPitchRotationDirection), "1", "3", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamLimitingDeviceAngle), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamLimitingDeviceRotationDirection), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(PatientSupportAngle), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(PatientSupportRotationDirection), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopEccentricAxisDistance), "1", "3", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopEccentricAngle), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(TableTopEccentricRotationDirection), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopPitchAngle), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(TableTopPitchRotationDirection), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopRollAngle), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(TableTopRollRotationDirection), "1", "1C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopVerticalPosition), "1", "2C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLongitudinalPosition), "1", "2C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLateralPosition), "1", "2C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(IsocenterPosition), "3", "2C", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(SurfaceEntryPoint), "3", "3", "ControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ExternalContourEntryPoint), "3", "3", "ControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToSurfaceDistance), "1", "3", "ControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(SourceToExternalContourDistance), "1", "3", "ControlPointSequence"); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::getBeamLimitingDeviceAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceAngle, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamLimitingDeviceAngle).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getBeamLimitingDeviceRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceRotationDirection, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getControlPointIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ControlPointIndex, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getControlPointIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ControlPointIndex).getSint32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getDoseRateSet(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseRateSet, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getDoseRateSet(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DoseRateSet).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getExternalContourEntryPoint(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ExternalContourEntryPoint).getFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getGantryAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryAngle, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getGantryAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, GantryAngle).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getGantryPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, GantryPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getGantryPitchRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryPitchRotationDirection, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getGantryRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryRotationDirection, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getIsocenterPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(IsocenterPosition, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getIsocenterPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, IsocenterPosition).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getIsocenterPosition(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, IsocenterPosition).getFloat64Vector(value); +} + + +OFCondition DRTControlPointSequence::Item::getNominalBeamEnergy(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NominalBeamEnergy, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getNominalBeamEnergy(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NominalBeamEnergy).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getPatientSupportAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAngle, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getPatientSupportAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, PatientSupportAngle).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getPatientSupportRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportRotationDirection, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getSourceToExternalContourDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, SourceToExternalContourDistance).getFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getSourceToSurfaceDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToSurfaceDistance, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getSourceToSurfaceDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToSurfaceDistance).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getSurfaceEntryPoint(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SurfaceEntryPoint, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getSurfaceEntryPoint(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SurfaceEntryPoint).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getSurfaceEntryPoint(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SurfaceEntryPoint).getFloat64Vector(value); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopEccentricAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopEccentricAngle, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopEccentricAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopEccentricAngle).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopEccentricAxisDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopEccentricAxisDistance, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopEccentricAxisDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopEccentricAxisDistance).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopEccentricRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopEccentricRotationDirection, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopLateralPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLateralPosition, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopLateralPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLateralPosition).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopLongitudinalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLongitudinalPosition, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalPosition).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopPitchRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopPitchRotationDirection, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopRollAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopRollAngle).getFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopRollRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopRollRotationDirection, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopVerticalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopVerticalPosition, value, pos); +} + + +OFCondition DRTControlPointSequence::Item::getTableTopVerticalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopVerticalPosition).getFloat64(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::setBeamLimitingDeviceAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setBeamLimitingDeviceRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setControlPointIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ControlPointIndex.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setDoseRateSet(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseRateSet.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setExternalContourEntryPoint(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ExternalContourEntryPoint.putFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::setGantryAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setGantryPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return GantryPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::setGantryPitchRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryPitchRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setGantryRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setIsocenterPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = IsocenterPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setNominalBeamEnergy(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NominalBeamEnergy.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setPatientSupportAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setPatientSupportRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setSourceToExternalContourDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SourceToExternalContourDistance.putFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::setSourceToSurfaceDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToSurfaceDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setSurfaceEntryPoint(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = SurfaceEntryPoint.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopEccentricAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopEccentricAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopEccentricAxisDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopEccentricAxisDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopEccentricRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopEccentricRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopLateralPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopLongitudinalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::setTableTopPitchRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopPitchRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopRollAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopRollAngle.putFloat32(value, pos); +} + + +OFCondition DRTControlPointSequence::Item::setTableTopRollRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopRollRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTControlPointSequence::Item::setTableTopVerticalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalPosition.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTControlPointSequence::DRTControlPointSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTControlPointSequence::DRTControlPointSequence(const DRTControlPointSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTControlPointSequence &DRTControlPointSequence::operator=(const DRTControlPointSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTControlPointSequence::~DRTControlPointSequence() +{ + clear(); +} + + +void DRTControlPointSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTControlPointSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTControlPointSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTControlPointSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTControlPointSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTControlPointSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTControlPointSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTControlPointSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTControlPointSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTControlPointSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTControlPointSequence::Item &DRTControlPointSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTControlPointSequence::Item &DRTControlPointSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTControlPointSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTControlPointSequence::Item &DRTControlPointSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTControlPointSequence::Item &DRTControlPointSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTControlPointSequence::Item &DRTControlPointSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTControlPointSequence::Item &DRTControlPointSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTControlPointSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTControlPointSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTControlPointSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTControlPointSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ControlPointSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ControlPointSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTControlPointSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ControlPointSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcs.cc b/dcmrt/libsrc/drtcs.cc new file mode 100644 index 00000000..7b31e022 --- /dev/null +++ b/dcmrt/libsrc/drtcs.cc @@ -0,0 +1,797 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTContourSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcs.h" + + +// --- item class --- + +DRTContourSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AttachedContours(DCM_AttachedContours), + ContourData(DCM_ContourData), + ContourGeometricType(DCM_ContourGeometricType), + ContourImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ContourNumber(DCM_ContourNumber), + ContourOffsetVector(DCM_ContourOffsetVector), + ContourSlabThickness(DCM_ContourSlabThickness), + NumberOfContourPoints(DCM_NumberOfContourPoints) +{ +} + + +DRTContourSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AttachedContours(copy.AttachedContours), + ContourData(copy.ContourData), + ContourGeometricType(copy.ContourGeometricType), + ContourImageSequence(copy.ContourImageSequence), + ContourNumber(copy.ContourNumber), + ContourOffsetVector(copy.ContourOffsetVector), + ContourSlabThickness(copy.ContourSlabThickness), + NumberOfContourPoints(copy.NumberOfContourPoints) +{ +} + + +DRTContourSequence::Item::~Item() +{ +} + + +DRTContourSequence::Item &DRTContourSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AttachedContours = copy.AttachedContours; + ContourData = copy.ContourData; + ContourGeometricType = copy.ContourGeometricType; + ContourImageSequence = copy.ContourImageSequence; + ContourNumber = copy.ContourNumber; + ContourOffsetVector = copy.ContourOffsetVector; + ContourSlabThickness = copy.ContourSlabThickness; + NumberOfContourPoints = copy.NumberOfContourPoints; + } + return *this; +} + + +void DRTContourSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ContourNumber.clear(); + AttachedContours.clear(); + ContourImageSequence.clear(); + ContourGeometricType.clear(); + ContourSlabThickness.clear(); + ContourOffsetVector.clear(); + NumberOfContourPoints.clear(); + ContourData.clear(); + } +} + + +OFBool DRTContourSequence::Item::isEmpty() +{ + return ContourNumber.isEmpty() && + AttachedContours.isEmpty() && + ContourImageSequence.isEmpty() && + ContourGeometricType.isEmpty() && + ContourSlabThickness.isEmpty() && + ContourOffsetVector.isEmpty() && + NumberOfContourPoints.isEmpty() && + ContourData.isEmpty(); +} + + +OFBool DRTContourSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTContourSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ContourNumber, "1", "3", "ContourSequence"); + getAndCheckElementFromDataset(item, AttachedContours, "1-n", "3", "ContourSequence"); + ContourImageSequence.read(item, "1-n", "3", "ContourSequence"); + getAndCheckElementFromDataset(item, ContourGeometricType, "1", "1", "ContourSequence"); + getAndCheckElementFromDataset(item, ContourSlabThickness, "1", "3", "ContourSequence"); + getAndCheckElementFromDataset(item, ContourOffsetVector, "3", "3", "ContourSequence"); + getAndCheckElementFromDataset(item, NumberOfContourPoints, "1", "1", "ContourSequence"); + getAndCheckElementFromDataset(item, ContourData, "3-3n", "1", "ContourSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContourSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ContourNumber), "1", "3", "ContourSequence"); + addElementToDataset(result, item, new DcmIntegerString(AttachedContours), "1-n", "3", "ContourSequence"); + if (result.good()) result = ContourImageSequence.write(item, "1-n", "3", "ContourSequence"); + addElementToDataset(result, item, new DcmCodeString(ContourGeometricType), "1", "1", "ContourSequence"); + addElementToDataset(result, item, new DcmDecimalString(ContourSlabThickness), "1", "3", "ContourSequence"); + addElementToDataset(result, item, new DcmDecimalString(ContourOffsetVector), "3", "3", "ContourSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfContourPoints), "1", "1", "ContourSequence"); + addElementToDataset(result, item, new DcmDecimalString(ContourData), "3-3n", "1", "ContourSequence"); + } + return result; +} + + +OFCondition DRTContourSequence::Item::getAttachedContours(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AttachedContours, value, pos); +} + + +OFCondition DRTContourSequence::Item::getAttachedContours(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, AttachedContours).getSint32(value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContourData, value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ContourData).getFloat64(value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ContourData).getFloat64Vector(value); +} + + +OFCondition DRTContourSequence::Item::getContourGeometricType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContourGeometricType, value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContourNumber, value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ContourNumber).getSint32(value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourOffsetVector(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContourOffsetVector, value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourOffsetVector(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ContourOffsetVector).getFloat64(value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourOffsetVector(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ContourOffsetVector).getFloat64Vector(value); +} + + +OFCondition DRTContourSequence::Item::getContourSlabThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContourSlabThickness, value, pos); +} + + +OFCondition DRTContourSequence::Item::getContourSlabThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ContourSlabThickness).getFloat64(value, pos); +} + + +OFCondition DRTContourSequence::Item::getNumberOfContourPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfContourPoints, value, pos); +} + + +OFCondition DRTContourSequence::Item::getNumberOfContourPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfContourPoints).getSint32(value, pos); +} + + +OFCondition DRTContourSequence::Item::setAttachedContours(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AttachedContours.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourSequence::Item::setContourData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3-3n") : EC_Normal; + if (result.good()) + result = ContourData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourSequence::Item::setContourGeometricType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContourGeometricType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourSequence::Item::setContourNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContourNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourSequence::Item::setContourOffsetVector(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = ContourOffsetVector.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourSequence::Item::setContourSlabThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContourSlabThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTContourSequence::Item::setNumberOfContourPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfContourPoints.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTContourSequence::DRTContourSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTContourSequence::DRTContourSequence(const DRTContourSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTContourSequence &DRTContourSequence::operator=(const DRTContourSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTContourSequence::~DRTContourSequence() +{ + clear(); +} + + +void DRTContourSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTContourSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTContourSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTContourSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTContourSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContourSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTContourSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContourSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContourSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTContourSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTContourSequence::Item &DRTContourSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTContourSequence::Item &DRTContourSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTContourSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTContourSequence::Item &DRTContourSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTContourSequence::Item &DRTContourSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTContourSequence::Item &DRTContourSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTContourSequence::Item &DRTContourSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTContourSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTContourSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTContourSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTContourSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ContourSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ContourSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTContourSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ContourSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcsas.cc b/dcmrt/libsrc/drtcsas.cc new file mode 100644 index 00000000..ce678449 --- /dev/null +++ b/dcmrt/libsrc/drtcsas.cc @@ -0,0 +1,636 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTConversionSourceAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcsas.h" + + +// --- item class --- + +DRTConversionSourceAttributesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedFrameNumber(DCM_ReferencedFrameNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + ReferencedSegmentNumber(DCM_ReferencedSegmentNumber) +{ +} + + +DRTConversionSourceAttributesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedFrameNumber(copy.ReferencedFrameNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + ReferencedSegmentNumber(copy.ReferencedSegmentNumber) +{ +} + + +DRTConversionSourceAttributesSequence::Item::~Item() +{ +} + + +DRTConversionSourceAttributesSequence::Item &DRTConversionSourceAttributesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedFrameNumber = copy.ReferencedFrameNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + ReferencedSegmentNumber = copy.ReferencedSegmentNumber; + } + return *this; +} + + +void DRTConversionSourceAttributesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferencedFrameNumber.clear(); + ReferencedSegmentNumber.clear(); + } +} + + +OFBool DRTConversionSourceAttributesSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferencedFrameNumber.isEmpty() && + ReferencedSegmentNumber.isEmpty(); +} + + +OFBool DRTConversionSourceAttributesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ConversionSourceAttributesSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ConversionSourceAttributesSequence"); + getAndCheckElementFromDataset(item, ReferencedFrameNumber, "1-n", "1C", "ConversionSourceAttributesSequence"); + getAndCheckElementFromDataset(item, ReferencedSegmentNumber, "1-n", "1C", "ConversionSourceAttributesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ConversionSourceAttributesSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ConversionSourceAttributesSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedFrameNumber), "1-n", "1C", "ConversionSourceAttributesSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(ReferencedSegmentNumber), "1-n", "1C", "ConversionSourceAttributesSequence"); + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::getReferencedFrameNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameNumber, value, pos); +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::getReferencedFrameNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFrameNumber).getSint32(value, pos); +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::getReferencedSegmentNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ReferencedSegmentNumber).getUint16(value, pos); +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::setReferencedFrameNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ReferencedFrameNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::Item::setReferencedSegmentNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ReferencedSegmentNumber.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTConversionSourceAttributesSequence::DRTConversionSourceAttributesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTConversionSourceAttributesSequence::DRTConversionSourceAttributesSequence(const DRTConversionSourceAttributesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTConversionSourceAttributesSequence &DRTConversionSourceAttributesSequence::operator=(const DRTConversionSourceAttributesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTConversionSourceAttributesSequence::~DRTConversionSourceAttributesSequence() +{ + clear(); +} + + +void DRTConversionSourceAttributesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTConversionSourceAttributesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTConversionSourceAttributesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTConversionSourceAttributesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTConversionSourceAttributesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTConversionSourceAttributesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTConversionSourceAttributesSequence::Item &DRTConversionSourceAttributesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTConversionSourceAttributesSequence::Item &DRTConversionSourceAttributesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTConversionSourceAttributesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTConversionSourceAttributesSequence::Item &DRTConversionSourceAttributesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTConversionSourceAttributesSequence::Item &DRTConversionSourceAttributesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTConversionSourceAttributesSequence::Item &DRTConversionSourceAttributesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTConversionSourceAttributesSequence::Item &DRTConversionSourceAttributesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTConversionSourceAttributesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ConversionSourceAttributesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ConversionSourceAttributesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTConversionSourceAttributesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ConversionSourceAttributesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcshs.cc b/dcmrt/libsrc/drtcshs.cc new file mode 100644 index 00000000..5807e96d --- /dev/null +++ b/dcmrt/libsrc/drtcshs.cc @@ -0,0 +1,754 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTChannelShieldSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcshs.h" + + +// --- item class --- + +DRTChannelShieldSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ChannelShieldID(DCM_ChannelShieldID), + ChannelShieldName(DCM_ChannelShieldName), + ChannelShieldNominalThickness(DCM_ChannelShieldNominalThickness), + ChannelShieldNominalTransmission(DCM_ChannelShieldNominalTransmission), + ChannelShieldNumber(DCM_ChannelShieldNumber), + MaterialID(DCM_MaterialID), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTChannelShieldSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ChannelShieldID(copy.ChannelShieldID), + ChannelShieldName(copy.ChannelShieldName), + ChannelShieldNominalThickness(copy.ChannelShieldNominalThickness), + ChannelShieldNominalTransmission(copy.ChannelShieldNominalTransmission), + ChannelShieldNumber(copy.ChannelShieldNumber), + MaterialID(copy.MaterialID), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTChannelShieldSequence::Item::~Item() +{ +} + + +DRTChannelShieldSequence::Item &DRTChannelShieldSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ChannelShieldID = copy.ChannelShieldID; + ChannelShieldName = copy.ChannelShieldName; + ChannelShieldNominalThickness = copy.ChannelShieldNominalThickness; + ChannelShieldNominalTransmission = copy.ChannelShieldNominalTransmission; + ChannelShieldNumber = copy.ChannelShieldNumber; + MaterialID = copy.MaterialID; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTChannelShieldSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ChannelShieldNumber.clear(); + ChannelShieldID.clear(); + ChannelShieldName.clear(); + MaterialID.clear(); + ChannelShieldNominalThickness.clear(); + ChannelShieldNominalTransmission.clear(); + ReferencedROINumber.clear(); + } +} + + +OFBool DRTChannelShieldSequence::Item::isEmpty() +{ + return ChannelShieldNumber.isEmpty() && + ChannelShieldID.isEmpty() && + ChannelShieldName.isEmpty() && + MaterialID.isEmpty() && + ChannelShieldNominalThickness.isEmpty() && + ChannelShieldNominalTransmission.isEmpty() && + ReferencedROINumber.isEmpty(); +} + + +OFBool DRTChannelShieldSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTChannelShieldSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ChannelShieldNumber, "1", "1", "ChannelShieldSequence"); + getAndCheckElementFromDataset(item, ChannelShieldID, "1", "2", "ChannelShieldSequence"); + getAndCheckElementFromDataset(item, ChannelShieldName, "1", "3", "ChannelShieldSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "3", "ChannelShieldSequence"); + getAndCheckElementFromDataset(item, ChannelShieldNominalThickness, "1", "3", "ChannelShieldSequence"); + getAndCheckElementFromDataset(item, ChannelShieldNominalTransmission, "1", "3", "ChannelShieldSequence"); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "2", "ChannelShieldSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ChannelShieldNumber), "1", "1", "ChannelShieldSequence"); + addElementToDataset(result, item, new DcmShortString(ChannelShieldID), "1", "2", "ChannelShieldSequence"); + addElementToDataset(result, item, new DcmLongString(ChannelShieldName), "1", "3", "ChannelShieldSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "3", "ChannelShieldSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChannelShieldNominalThickness), "1", "3", "ChannelShieldSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChannelShieldNominalTransmission), "1", "3", "ChannelShieldSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "2", "ChannelShieldSequence"); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelShieldID, value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelShieldName, value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldNominalThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelShieldNominalThickness, value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldNominalThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChannelShieldNominalThickness).getFloat64(value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldNominalTransmission(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelShieldNominalTransmission, value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldNominalTransmission(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChannelShieldNominalTransmission).getFloat64(value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelShieldNumber, value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getChannelShieldNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ChannelShieldNumber).getSint32(value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTChannelShieldSequence::Item::setChannelShieldID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelShieldID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::setChannelShieldName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelShieldName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::setChannelShieldNominalThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelShieldNominalThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::setChannelShieldNominalTransmission(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelShieldNominalTransmission.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::setChannelShieldNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelShieldNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTChannelShieldSequence::DRTChannelShieldSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTChannelShieldSequence::DRTChannelShieldSequence(const DRTChannelShieldSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTChannelShieldSequence &DRTChannelShieldSequence::operator=(const DRTChannelShieldSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTChannelShieldSequence::~DRTChannelShieldSequence() +{ + clear(); +} + + +void DRTChannelShieldSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTChannelShieldSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTChannelShieldSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTChannelShieldSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTChannelShieldSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelShieldSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelShieldSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelShieldSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelShieldSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTChannelShieldSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTChannelShieldSequence::Item &DRTChannelShieldSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTChannelShieldSequence::Item &DRTChannelShieldSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTChannelShieldSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTChannelShieldSequence::Item &DRTChannelShieldSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTChannelShieldSequence::Item &DRTChannelShieldSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTChannelShieldSequence::Item &DRTChannelShieldSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTChannelShieldSequence::Item &DRTChannelShieldSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTChannelShieldSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTChannelShieldSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTChannelShieldSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelShieldSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ChannelShieldSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ChannelShieldSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTChannelShieldSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ChannelShieldSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcsis.cc b/dcmrt/libsrc/drtcsis.cc new file mode 100644 index 00000000..1ec9f224 --- /dev/null +++ b/dcmrt/libsrc/drtcsis.cc @@ -0,0 +1,725 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTCodingSchemeIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcsis.h" + + +// --- item class --- + +DRTCodingSchemeIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeExternalID(DCM_CodingSchemeExternalID), + CodingSchemeName(DCM_CodingSchemeName), + CodingSchemeRegistry(DCM_CodingSchemeRegistry), + CodingSchemeResourcesSequence(emptyDefaultItem /*emptyDefaultSequence*/), + CodingSchemeResponsibleOrganization(DCM_CodingSchemeResponsibleOrganization), + CodingSchemeUID(DCM_CodingSchemeUID), + CodingSchemeVersion(DCM_CodingSchemeVersion) +{ +} + + +DRTCodingSchemeIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeExternalID(copy.CodingSchemeExternalID), + CodingSchemeName(copy.CodingSchemeName), + CodingSchemeRegistry(copy.CodingSchemeRegistry), + CodingSchemeResourcesSequence(copy.CodingSchemeResourcesSequence), + CodingSchemeResponsibleOrganization(copy.CodingSchemeResponsibleOrganization), + CodingSchemeUID(copy.CodingSchemeUID), + CodingSchemeVersion(copy.CodingSchemeVersion) +{ +} + + +DRTCodingSchemeIdentificationSequence::Item::~Item() +{ +} + + +DRTCodingSchemeIdentificationSequence::Item &DRTCodingSchemeIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeExternalID = copy.CodingSchemeExternalID; + CodingSchemeName = copy.CodingSchemeName; + CodingSchemeRegistry = copy.CodingSchemeRegistry; + CodingSchemeResourcesSequence = copy.CodingSchemeResourcesSequence; + CodingSchemeResponsibleOrganization = copy.CodingSchemeResponsibleOrganization; + CodingSchemeUID = copy.CodingSchemeUID; + CodingSchemeVersion = copy.CodingSchemeVersion; + } + return *this; +} + + +void DRTCodingSchemeIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodingSchemeDesignator.clear(); + CodingSchemeRegistry.clear(); + CodingSchemeUID.clear(); + CodingSchemeExternalID.clear(); + CodingSchemeName.clear(); + CodingSchemeVersion.clear(); + CodingSchemeResponsibleOrganization.clear(); + CodingSchemeResourcesSequence.clear(); + } +} + + +OFBool DRTCodingSchemeIdentificationSequence::Item::isEmpty() +{ + return CodingSchemeDesignator.isEmpty() && + CodingSchemeRegistry.isEmpty() && + CodingSchemeUID.isEmpty() && + CodingSchemeExternalID.isEmpty() && + CodingSchemeName.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodingSchemeResponsibleOrganization.isEmpty() && + CodingSchemeResourcesSequence.isEmpty(); +} + + +OFBool DRTCodingSchemeIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1", "CodingSchemeIdentificationSequence"); + getAndCheckElementFromDataset(item, CodingSchemeRegistry, "1", "1C", "CodingSchemeIdentificationSequence"); + getAndCheckElementFromDataset(item, CodingSchemeUID, "1", "1C", "CodingSchemeIdentificationSequence"); + getAndCheckElementFromDataset(item, CodingSchemeExternalID, "1", "2C", "CodingSchemeIdentificationSequence"); + getAndCheckElementFromDataset(item, CodingSchemeName, "1", "3", "CodingSchemeIdentificationSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "3", "CodingSchemeIdentificationSequence"); + getAndCheckElementFromDataset(item, CodingSchemeResponsibleOrganization, "1", "3", "CodingSchemeIdentificationSequence"); + CodingSchemeResourcesSequence.read(item, "1-n", "3", "CodingSchemeIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1", "CodingSchemeIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(CodingSchemeRegistry), "1", "1C", "CodingSchemeIdentificationSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(CodingSchemeUID), "1", "1C", "CodingSchemeIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(CodingSchemeExternalID), "1", "2C", "CodingSchemeIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(CodingSchemeName), "1", "3", "CodingSchemeIdentificationSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "3", "CodingSchemeIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(CodingSchemeResponsibleOrganization), "1", "3", "CodingSchemeIdentificationSequence"); + if (result.good()) result = CodingSchemeResourcesSequence.write(item, "1-n", "3", "CodingSchemeIdentificationSequence"); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::getCodingSchemeExternalID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeExternalID, value, pos); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::getCodingSchemeName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeName, value, pos); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::getCodingSchemeRegistry(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeRegistry, value, pos); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::getCodingSchemeResponsibleOrganization(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeResponsibleOrganization, value, pos); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::getCodingSchemeUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeUID, value, pos); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::setCodingSchemeExternalID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CodingSchemeExternalID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::setCodingSchemeName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CodingSchemeName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::setCodingSchemeRegistry(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeRegistry.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::setCodingSchemeResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CodingSchemeResponsibleOrganization.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::setCodingSchemeUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTCodingSchemeIdentificationSequence::DRTCodingSchemeIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTCodingSchemeIdentificationSequence::DRTCodingSchemeIdentificationSequence(const DRTCodingSchemeIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTCodingSchemeIdentificationSequence &DRTCodingSchemeIdentificationSequence::operator=(const DRTCodingSchemeIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTCodingSchemeIdentificationSequence::~DRTCodingSchemeIdentificationSequence() +{ + clear(); +} + + +void DRTCodingSchemeIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTCodingSchemeIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTCodingSchemeIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTCodingSchemeIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTCodingSchemeIdentificationSequence::Item &DRTCodingSchemeIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTCodingSchemeIdentificationSequence::Item &DRTCodingSchemeIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTCodingSchemeIdentificationSequence::Item &DRTCodingSchemeIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTCodingSchemeIdentificationSequence::Item &DRTCodingSchemeIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTCodingSchemeIdentificationSequence::Item &DRTCodingSchemeIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTCodingSchemeIdentificationSequence::Item &DRTCodingSchemeIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTCodingSchemeIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_CodingSchemeIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_CodingSchemeIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTCodingSchemeIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_CodingSchemeIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcsrs.cc b/dcmrt/libsrc/drtcsrs.cc new file mode 100644 index 00000000..2782c876 --- /dev/null +++ b/dcmrt/libsrc/drtcsrs.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTCodingSchemeResourcesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcsrs.h" + + +// --- item class --- + +DRTCodingSchemeResourcesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodingSchemeURL(DCM_CodingSchemeURL), + CodingSchemeURLType(DCM_CodingSchemeURLType) +{ +} + + +DRTCodingSchemeResourcesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodingSchemeURL(copy.CodingSchemeURL), + CodingSchemeURLType(copy.CodingSchemeURLType) +{ +} + + +DRTCodingSchemeResourcesSequence::Item::~Item() +{ +} + + +DRTCodingSchemeResourcesSequence::Item &DRTCodingSchemeResourcesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodingSchemeURL = copy.CodingSchemeURL; + CodingSchemeURLType = copy.CodingSchemeURLType; + } + return *this; +} + + +void DRTCodingSchemeResourcesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodingSchemeURLType.clear(); + CodingSchemeURL.clear(); + } +} + + +OFBool DRTCodingSchemeResourcesSequence::Item::isEmpty() +{ + return CodingSchemeURLType.isEmpty() && + CodingSchemeURL.isEmpty(); +} + + +OFBool DRTCodingSchemeResourcesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTCodingSchemeResourcesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodingSchemeURLType, "1", "1", "CodingSchemeResourcesSequence"); + getAndCheckElementFromDataset(item, CodingSchemeURL, "1", "1", "CodingSchemeResourcesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(CodingSchemeURLType), "1", "1", "CodingSchemeResourcesSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(CodingSchemeURL), "1", "1", "CodingSchemeResourcesSequence"); + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::Item::getCodingSchemeURL(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeURL, value, pos); +} + + +OFCondition DRTCodingSchemeResourcesSequence::Item::getCodingSchemeURLType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeURLType, value, pos); +} + + +OFCondition DRTCodingSchemeResourcesSequence::Item::setCodingSchemeURL(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CodingSchemeURL.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::Item::setCodingSchemeURLType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeURLType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTCodingSchemeResourcesSequence::DRTCodingSchemeResourcesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTCodingSchemeResourcesSequence::DRTCodingSchemeResourcesSequence(const DRTCodingSchemeResourcesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTCodingSchemeResourcesSequence &DRTCodingSchemeResourcesSequence::operator=(const DRTCodingSchemeResourcesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTCodingSchemeResourcesSequence::~DRTCodingSchemeResourcesSequence() +{ + clear(); +} + + +void DRTCodingSchemeResourcesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTCodingSchemeResourcesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTCodingSchemeResourcesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTCodingSchemeResourcesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTCodingSchemeResourcesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTCodingSchemeResourcesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTCodingSchemeResourcesSequence::Item &DRTCodingSchemeResourcesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTCodingSchemeResourcesSequence::Item &DRTCodingSchemeResourcesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTCodingSchemeResourcesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTCodingSchemeResourcesSequence::Item &DRTCodingSchemeResourcesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTCodingSchemeResourcesSequence::Item &DRTCodingSchemeResourcesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTCodingSchemeResourcesSequence::Item &DRTCodingSchemeResourcesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTCodingSchemeResourcesSequence::Item &DRTCodingSchemeResourcesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTCodingSchemeResourcesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_CodingSchemeResourcesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_CodingSchemeResourcesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTCodingSchemeResourcesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_CodingSchemeResourcesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtcss.cc b/dcmrt/libsrc/drtcss.cc new file mode 100644 index 00000000..229c0620 --- /dev/null +++ b/dcmrt/libsrc/drtcss.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTChannelSourceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtcss.h" + + +// --- item class --- + +DRTChannelSourceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTChannelSourceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTChannelSourceSequence::Item::~Item() +{ +} + + +DRTChannelSourceSequence::Item &DRTChannelSourceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTChannelSourceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTChannelSourceSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTChannelSourceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTChannelSourceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ChannelSourceSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ChannelSourceSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ChannelSourceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ChannelSourceSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ChannelSourceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ChannelSourceSequence"); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTChannelSourceSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTChannelSourceSequence::DRTChannelSourceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTChannelSourceSequence::DRTChannelSourceSequence(const DRTChannelSourceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTChannelSourceSequence &DRTChannelSourceSequence::operator=(const DRTChannelSourceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTChannelSourceSequence::~DRTChannelSourceSequence() +{ + clear(); +} + + +void DRTChannelSourceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTChannelSourceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTChannelSourceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTChannelSourceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTChannelSourceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelSourceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTChannelSourceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelSourceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelSourceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTChannelSourceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTChannelSourceSequence::Item &DRTChannelSourceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTChannelSourceSequence::Item &DRTChannelSourceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTChannelSourceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTChannelSourceSequence::Item &DRTChannelSourceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTChannelSourceSequence::Item &DRTChannelSourceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTChannelSourceSequence::Item &DRTChannelSourceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTChannelSourceSequence::Item &DRTChannelSourceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTChannelSourceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTChannelSourceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTChannelSourceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTChannelSourceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ChannelSourceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ChannelSourceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTChannelSourceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ChannelSourceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdcs.cc b/dcmrt/libsrc/drtdcs.cc new file mode 100644 index 00000000..d5222b38 --- /dev/null +++ b/dcmrt/libsrc/drtdcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDerivationCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdcs.h" + + +// --- item class --- + +DRTDerivationCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTDerivationCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTDerivationCodeSequence::Item::~Item() +{ +} + + +DRTDerivationCodeSequence::Item &DRTDerivationCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTDerivationCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTDerivationCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTDerivationCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDerivationCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "DerivationCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "DerivationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "DerivationCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "DerivationCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "DerivationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "DerivationCodeSequence"); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTDerivationCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDerivationCodeSequence::DRTDerivationCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDerivationCodeSequence::DRTDerivationCodeSequence(const DRTDerivationCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDerivationCodeSequence &DRTDerivationCodeSequence::operator=(const DRTDerivationCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDerivationCodeSequence::~DRTDerivationCodeSequence() +{ + clear(); +} + + +void DRTDerivationCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDerivationCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDerivationCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDerivationCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDerivationCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDerivationCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDerivationCodeSequence::Item &DRTDerivationCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDerivationCodeSequence::Item &DRTDerivationCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDerivationCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDerivationCodeSequence::Item &DRTDerivationCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDerivationCodeSequence::Item &DRTDerivationCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDerivationCodeSequence::Item &DRTDerivationCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDerivationCodeSequence::Item &DRTDerivationCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDerivationCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DerivationCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DerivationCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDerivationCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DerivationCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdddps.cc b/dcmrt/libsrc/drtdddps.cc new file mode 100644 index 00000000..7a4f351f --- /dev/null +++ b/dcmrt/libsrc/drtdddps.cc @@ -0,0 +1,644 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDeliveredDepthDoseParametersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdddps.h" + + +// --- item class --- + +DRTDeliveredDepthDoseParametersSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DeliveredDistalDepth(DCM_DeliveredDistalDepth), + DeliveredDistalDepthFraction(DCM_DeliveredDistalDepthFraction), + DeliveredNominalRangeModulatedRegionDepths(DCM_DeliveredNominalRangeModulatedRegionDepths), + DeliveredNominalRangeModulationFractions(DCM_DeliveredNominalRangeModulationFractions), + DeliveredReferenceDoseDefinition(DCM_DeliveredReferenceDoseDefinition) +{ +} + + +DRTDeliveredDepthDoseParametersSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DeliveredDistalDepth(copy.DeliveredDistalDepth), + DeliveredDistalDepthFraction(copy.DeliveredDistalDepthFraction), + DeliveredNominalRangeModulatedRegionDepths(copy.DeliveredNominalRangeModulatedRegionDepths), + DeliveredNominalRangeModulationFractions(copy.DeliveredNominalRangeModulationFractions), + DeliveredReferenceDoseDefinition(copy.DeliveredReferenceDoseDefinition) +{ +} + + +DRTDeliveredDepthDoseParametersSequence::Item::~Item() +{ +} + + +DRTDeliveredDepthDoseParametersSequence::Item &DRTDeliveredDepthDoseParametersSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DeliveredDistalDepth = copy.DeliveredDistalDepth; + DeliveredDistalDepthFraction = copy.DeliveredDistalDepthFraction; + DeliveredNominalRangeModulatedRegionDepths = copy.DeliveredNominalRangeModulatedRegionDepths; + DeliveredNominalRangeModulationFractions = copy.DeliveredNominalRangeModulationFractions; + DeliveredReferenceDoseDefinition = copy.DeliveredReferenceDoseDefinition; + } + return *this; +} + + +void DRTDeliveredDepthDoseParametersSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + DeliveredReferenceDoseDefinition.clear(); + DeliveredDistalDepth.clear(); + DeliveredDistalDepthFraction.clear(); + DeliveredNominalRangeModulatedRegionDepths.clear(); + DeliveredNominalRangeModulationFractions.clear(); + } +} + + +OFBool DRTDeliveredDepthDoseParametersSequence::Item::isEmpty() +{ + return DeliveredReferenceDoseDefinition.isEmpty() && + DeliveredDistalDepth.isEmpty() && + DeliveredDistalDepthFraction.isEmpty() && + DeliveredNominalRangeModulatedRegionDepths.isEmpty() && + DeliveredNominalRangeModulationFractions.isEmpty(); +} + + +OFBool DRTDeliveredDepthDoseParametersSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, DeliveredReferenceDoseDefinition, "1", "1", "DeliveredDepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, DeliveredDistalDepth, "1", "1", "DeliveredDepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, DeliveredDistalDepthFraction, "1", "1", "DeliveredDepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, DeliveredNominalRangeModulatedRegionDepths, "2", "1C", "DeliveredDepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, DeliveredNominalRangeModulationFractions, "2", "1C", "DeliveredDepthDoseParametersSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(DeliveredReferenceDoseDefinition), "1", "1", "DeliveredDepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(DeliveredDistalDepth), "1", "1", "DeliveredDepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(DeliveredDistalDepthFraction), "1", "1", "DeliveredDepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(DeliveredNominalRangeModulatedRegionDepths), "2", "1C", "DeliveredDepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(DeliveredNominalRangeModulationFractions), "2", "1C", "DeliveredDepthDoseParametersSequence"); + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::getDeliveredDistalDepth(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, DeliveredDistalDepth).getFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::getDeliveredDistalDepthFraction(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, DeliveredDistalDepthFraction).getFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::getDeliveredNominalRangeModulatedRegionDepths(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, DeliveredNominalRangeModulatedRegionDepths).getFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::getDeliveredNominalRangeModulationFractions(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, DeliveredNominalRangeModulationFractions).getFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::getDeliveredReferenceDoseDefinition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveredReferenceDoseDefinition, value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::setDeliveredDistalDepth(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DeliveredDistalDepth.putFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::setDeliveredDistalDepthFraction(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DeliveredDistalDepthFraction.putFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::setDeliveredNominalRangeModulatedRegionDepths(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DeliveredNominalRangeModulatedRegionDepths.putFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::setDeliveredNominalRangeModulationFractions(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DeliveredNominalRangeModulationFractions.putFloat32(value, pos); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::Item::setDeliveredReferenceDoseDefinition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveredReferenceDoseDefinition.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDeliveredDepthDoseParametersSequence::DRTDeliveredDepthDoseParametersSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDeliveredDepthDoseParametersSequence::DRTDeliveredDepthDoseParametersSequence(const DRTDeliveredDepthDoseParametersSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDeliveredDepthDoseParametersSequence &DRTDeliveredDepthDoseParametersSequence::operator=(const DRTDeliveredDepthDoseParametersSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDeliveredDepthDoseParametersSequence::~DRTDeliveredDepthDoseParametersSequence() +{ + clear(); +} + + +void DRTDeliveredDepthDoseParametersSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDeliveredDepthDoseParametersSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDeliveredDepthDoseParametersSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDeliveredDepthDoseParametersSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDeliveredDepthDoseParametersSequence::Item &DRTDeliveredDepthDoseParametersSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDeliveredDepthDoseParametersSequence::Item &DRTDeliveredDepthDoseParametersSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDeliveredDepthDoseParametersSequence::Item &DRTDeliveredDepthDoseParametersSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDeliveredDepthDoseParametersSequence::Item &DRTDeliveredDepthDoseParametersSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDeliveredDepthDoseParametersSequence::Item &DRTDeliveredDepthDoseParametersSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDeliveredDepthDoseParametersSequence::Item &DRTDeliveredDepthDoseParametersSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DeliveredDepthDoseParametersSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DeliveredDepthDoseParametersSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDeliveredDepthDoseParametersSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DeliveredDepthDoseParametersSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtddps.cc b/dcmrt/libsrc/drtddps.cc new file mode 100644 index 00000000..4227d759 --- /dev/null +++ b/dcmrt/libsrc/drtddps.cc @@ -0,0 +1,644 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDepthDoseParametersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtddps.h" + + +// --- item class --- + +DRTDepthDoseParametersSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DistalDepth(DCM_DistalDepth), + DistalDepthFraction(DCM_DistalDepthFraction), + NominalRangeModulatedRegionDepths(DCM_NominalRangeModulatedRegionDepths), + NominalRangeModulationFractions(DCM_NominalRangeModulationFractions), + ReferenceDoseDefinition(DCM_ReferenceDoseDefinition) +{ +} + + +DRTDepthDoseParametersSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DistalDepth(copy.DistalDepth), + DistalDepthFraction(copy.DistalDepthFraction), + NominalRangeModulatedRegionDepths(copy.NominalRangeModulatedRegionDepths), + NominalRangeModulationFractions(copy.NominalRangeModulationFractions), + ReferenceDoseDefinition(copy.ReferenceDoseDefinition) +{ +} + + +DRTDepthDoseParametersSequence::Item::~Item() +{ +} + + +DRTDepthDoseParametersSequence::Item &DRTDepthDoseParametersSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DistalDepth = copy.DistalDepth; + DistalDepthFraction = copy.DistalDepthFraction; + NominalRangeModulatedRegionDepths = copy.NominalRangeModulatedRegionDepths; + NominalRangeModulationFractions = copy.NominalRangeModulationFractions; + ReferenceDoseDefinition = copy.ReferenceDoseDefinition; + } + return *this; +} + + +void DRTDepthDoseParametersSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferenceDoseDefinition.clear(); + DistalDepth.clear(); + DistalDepthFraction.clear(); + NominalRangeModulatedRegionDepths.clear(); + NominalRangeModulationFractions.clear(); + } +} + + +OFBool DRTDepthDoseParametersSequence::Item::isEmpty() +{ + return ReferenceDoseDefinition.isEmpty() && + DistalDepth.isEmpty() && + DistalDepthFraction.isEmpty() && + NominalRangeModulatedRegionDepths.isEmpty() && + NominalRangeModulationFractions.isEmpty(); +} + + +OFBool DRTDepthDoseParametersSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDepthDoseParametersSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferenceDoseDefinition, "1", "1", "DepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, DistalDepth, "1", "1", "DepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, DistalDepthFraction, "1", "1", "DepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, NominalRangeModulatedRegionDepths, "2", "1C", "DepthDoseParametersSequence"); + getAndCheckElementFromDataset(item, NominalRangeModulationFractions, "2", "1C", "DepthDoseParametersSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ReferenceDoseDefinition), "1", "1", "DepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(DistalDepth), "1", "1", "DepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(DistalDepthFraction), "1", "1", "DepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(NominalRangeModulatedRegionDepths), "2", "1C", "DepthDoseParametersSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(NominalRangeModulationFractions), "2", "1C", "DepthDoseParametersSequence"); + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::Item::getDistalDepth(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, DistalDepth).getFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::getDistalDepthFraction(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, DistalDepthFraction).getFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::getNominalRangeModulatedRegionDepths(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, NominalRangeModulatedRegionDepths).getFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::getNominalRangeModulationFractions(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, NominalRangeModulationFractions).getFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::getReferenceDoseDefinition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferenceDoseDefinition, value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::setDistalDepth(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DistalDepth.putFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::setDistalDepthFraction(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DistalDepthFraction.putFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::setNominalRangeModulatedRegionDepths(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return NominalRangeModulatedRegionDepths.putFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::setNominalRangeModulationFractions(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return NominalRangeModulationFractions.putFloat32(value, pos); +} + + +OFCondition DRTDepthDoseParametersSequence::Item::setReferenceDoseDefinition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferenceDoseDefinition.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDepthDoseParametersSequence::DRTDepthDoseParametersSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDepthDoseParametersSequence::DRTDepthDoseParametersSequence(const DRTDepthDoseParametersSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDepthDoseParametersSequence &DRTDepthDoseParametersSequence::operator=(const DRTDepthDoseParametersSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDepthDoseParametersSequence::~DRTDepthDoseParametersSequence() +{ + clear(); +} + + +void DRTDepthDoseParametersSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDepthDoseParametersSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDepthDoseParametersSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDepthDoseParametersSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDepthDoseParametersSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDepthDoseParametersSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDepthDoseParametersSequence::Item &DRTDepthDoseParametersSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDepthDoseParametersSequence::Item &DRTDepthDoseParametersSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDepthDoseParametersSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDepthDoseParametersSequence::Item &DRTDepthDoseParametersSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDepthDoseParametersSequence::Item &DRTDepthDoseParametersSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDepthDoseParametersSequence::Item &DRTDepthDoseParametersSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDepthDoseParametersSequence::Item &DRTDepthDoseParametersSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDepthDoseParametersSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DepthDoseParametersSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DepthDoseParametersSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDepthDoseParametersSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DepthDoseParametersSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdias.cc b/dcmrt/libsrc/drtdias.cc new file mode 100644 index 00000000..41b64cfa --- /dev/null +++ b/dcmrt/libsrc/drtdias.cc @@ -0,0 +1,569 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDeidentificationActionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdias.h" + + +// --- item class --- + +DRTDeidentificationActionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DeidentificationAction(DCM_DeidentificationAction), + IdentifyingPrivateElements(DCM_IdentifyingPrivateElements) +{ +} + + +DRTDeidentificationActionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DeidentificationAction(copy.DeidentificationAction), + IdentifyingPrivateElements(copy.IdentifyingPrivateElements) +{ +} + + +DRTDeidentificationActionSequence::Item::~Item() +{ +} + + +DRTDeidentificationActionSequence::Item &DRTDeidentificationActionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DeidentificationAction = copy.DeidentificationAction; + IdentifyingPrivateElements = copy.IdentifyingPrivateElements; + } + return *this; +} + + +void DRTDeidentificationActionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + IdentifyingPrivateElements.clear(); + DeidentificationAction.clear(); + } +} + + +OFBool DRTDeidentificationActionSequence::Item::isEmpty() +{ + return IdentifyingPrivateElements.isEmpty() && + DeidentificationAction.isEmpty(); +} + + +OFBool DRTDeidentificationActionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDeidentificationActionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, IdentifyingPrivateElements, "1-n", "1", "DeidentificationActionSequence"); + getAndCheckElementFromDataset(item, DeidentificationAction, "1", "1", "DeidentificationActionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(IdentifyingPrivateElements), "1-n", "1", "DeidentificationActionSequence"); + addElementToDataset(result, item, new DcmCodeString(DeidentificationAction), "1", "1", "DeidentificationActionSequence"); + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::Item::getDeidentificationAction(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeidentificationAction, value, pos); +} + + +OFCondition DRTDeidentificationActionSequence::Item::getIdentifyingPrivateElements(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, IdentifyingPrivateElements).getUint16(value, pos); +} + + +OFCondition DRTDeidentificationActionSequence::Item::setDeidentificationAction(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeidentificationAction.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::Item::setIdentifyingPrivateElements(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IdentifyingPrivateElements.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTDeidentificationActionSequence::DRTDeidentificationActionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDeidentificationActionSequence::DRTDeidentificationActionSequence(const DRTDeidentificationActionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDeidentificationActionSequence &DRTDeidentificationActionSequence::operator=(const DRTDeidentificationActionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDeidentificationActionSequence::~DRTDeidentificationActionSequence() +{ + clear(); +} + + +void DRTDeidentificationActionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDeidentificationActionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDeidentificationActionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDeidentificationActionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDeidentificationActionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDeidentificationActionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDeidentificationActionSequence::Item &DRTDeidentificationActionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDeidentificationActionSequence::Item &DRTDeidentificationActionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDeidentificationActionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDeidentificationActionSequence::Item &DRTDeidentificationActionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDeidentificationActionSequence::Item &DRTDeidentificationActionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDeidentificationActionSequence::Item &DRTDeidentificationActionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDeidentificationActionSequence::Item &DRTDeidentificationActionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDeidentificationActionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DeidentificationActionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DeidentificationActionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDeidentificationActionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DeidentificationActionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdimcs.cc b/dcmrt/libsrc/drtdimcs.cc new file mode 100644 index 00000000..750b3169 --- /dev/null +++ b/dcmrt/libsrc/drtdimcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDeidentificationMethodCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdimcs.h" + + +// --- item class --- + +DRTDeidentificationMethodCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTDeidentificationMethodCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTDeidentificationMethodCodeSequence::Item::~Item() +{ +} + + +DRTDeidentificationMethodCodeSequence::Item &DRTDeidentificationMethodCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTDeidentificationMethodCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTDeidentificationMethodCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTDeidentificationMethodCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "DeidentificationMethodCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "DeidentificationMethodCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "DeidentificationMethodCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "DeidentificationMethodCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "DeidentificationMethodCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "DeidentificationMethodCodeSequence"); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDeidentificationMethodCodeSequence::DRTDeidentificationMethodCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDeidentificationMethodCodeSequence::DRTDeidentificationMethodCodeSequence(const DRTDeidentificationMethodCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDeidentificationMethodCodeSequence &DRTDeidentificationMethodCodeSequence::operator=(const DRTDeidentificationMethodCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDeidentificationMethodCodeSequence::~DRTDeidentificationMethodCodeSequence() +{ + clear(); +} + + +void DRTDeidentificationMethodCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDeidentificationMethodCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDeidentificationMethodCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDeidentificationMethodCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDeidentificationMethodCodeSequence::Item &DRTDeidentificationMethodCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDeidentificationMethodCodeSequence::Item &DRTDeidentificationMethodCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDeidentificationMethodCodeSequence::Item &DRTDeidentificationMethodCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDeidentificationMethodCodeSequence::Item &DRTDeidentificationMethodCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDeidentificationMethodCodeSequence::Item &DRTDeidentificationMethodCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDeidentificationMethodCodeSequence::Item &DRTDeidentificationMethodCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDeidentificationMethodCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DeidentificationMethodCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DeidentificationMethodCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDeidentificationMethodCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DeidentificationMethodCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdimrs.cc b/dcmrt/libsrc/drtdimrs.cc new file mode 100644 index 00000000..8aef4e48 --- /dev/null +++ b/dcmrt/libsrc/drtdimrs.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDICOMMediaRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdimrs.h" + + +// --- item class --- + +DRTDICOMMediaRetrievalSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + StorageMediaFileSetID(DCM_StorageMediaFileSetID), + StorageMediaFileSetUID(DCM_StorageMediaFileSetUID) +{ +} + + +DRTDICOMMediaRetrievalSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + StorageMediaFileSetID(copy.StorageMediaFileSetID), + StorageMediaFileSetUID(copy.StorageMediaFileSetUID) +{ +} + + +DRTDICOMMediaRetrievalSequence::Item::~Item() +{ +} + + +DRTDICOMMediaRetrievalSequence::Item &DRTDICOMMediaRetrievalSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + StorageMediaFileSetID = copy.StorageMediaFileSetID; + StorageMediaFileSetUID = copy.StorageMediaFileSetUID; + } + return *this; +} + + +void DRTDICOMMediaRetrievalSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + StorageMediaFileSetID.clear(); + StorageMediaFileSetUID.clear(); + } +} + + +OFBool DRTDICOMMediaRetrievalSequence::Item::isEmpty() +{ + return StorageMediaFileSetID.isEmpty() && + StorageMediaFileSetUID.isEmpty(); +} + + +OFBool DRTDICOMMediaRetrievalSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, StorageMediaFileSetID, "1", "2", "DICOMMediaRetrievalSequence"); + getAndCheckElementFromDataset(item, StorageMediaFileSetUID, "1", "1", "DICOMMediaRetrievalSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(StorageMediaFileSetID), "1", "2", "DICOMMediaRetrievalSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(StorageMediaFileSetUID), "1", "1", "DICOMMediaRetrievalSequence"); + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::Item::getStorageMediaFileSetID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StorageMediaFileSetID, value, pos); +} + + +OFCondition DRTDICOMMediaRetrievalSequence::Item::getStorageMediaFileSetUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StorageMediaFileSetUID, value, pos); +} + + +OFCondition DRTDICOMMediaRetrievalSequence::Item::setStorageMediaFileSetID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StorageMediaFileSetID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::Item::setStorageMediaFileSetUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StorageMediaFileSetUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDICOMMediaRetrievalSequence::DRTDICOMMediaRetrievalSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDICOMMediaRetrievalSequence::DRTDICOMMediaRetrievalSequence(const DRTDICOMMediaRetrievalSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDICOMMediaRetrievalSequence &DRTDICOMMediaRetrievalSequence::operator=(const DRTDICOMMediaRetrievalSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDICOMMediaRetrievalSequence::~DRTDICOMMediaRetrievalSequence() +{ + clear(); +} + + +void DRTDICOMMediaRetrievalSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDICOMMediaRetrievalSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDICOMMediaRetrievalSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDICOMMediaRetrievalSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDICOMMediaRetrievalSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDICOMMediaRetrievalSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDICOMMediaRetrievalSequence::Item &DRTDICOMMediaRetrievalSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDICOMMediaRetrievalSequence::Item &DRTDICOMMediaRetrievalSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDICOMMediaRetrievalSequence::Item &DRTDICOMMediaRetrievalSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDICOMMediaRetrievalSequence::Item &DRTDICOMMediaRetrievalSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDICOMMediaRetrievalSequence::Item &DRTDICOMMediaRetrievalSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDICOMMediaRetrievalSequence::Item &DRTDICOMMediaRetrievalSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDICOMMediaRetrievalSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DICOMMediaRetrievalSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DICOMMediaRetrievalSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDICOMMediaRetrievalSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DICOMMediaRetrievalSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdirs.cc b/dcmrt/libsrc/drtdirs.cc new file mode 100644 index 00000000..f1fad2c6 --- /dev/null +++ b/dcmrt/libsrc/drtdirs.cc @@ -0,0 +1,544 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDICOMRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdirs.h" + + +// --- item class --- + +DRTDICOMRetrievalSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RetrieveAETitle(DCM_RetrieveAETitle) +{ +} + + +DRTDICOMRetrievalSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RetrieveAETitle(copy.RetrieveAETitle) +{ +} + + +DRTDICOMRetrievalSequence::Item::~Item() +{ +} + + +DRTDICOMRetrievalSequence::Item &DRTDICOMRetrievalSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RetrieveAETitle = copy.RetrieveAETitle; + } + return *this; +} + + +void DRTDICOMRetrievalSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RetrieveAETitle.clear(); + } +} + + +OFBool DRTDICOMRetrievalSequence::Item::isEmpty() +{ + return RetrieveAETitle.isEmpty(); +} + + +OFBool DRTDICOMRetrievalSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDICOMRetrievalSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RetrieveAETitle, "1-n", "1", "DICOMRetrievalSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmApplicationEntity(RetrieveAETitle), "1-n", "1", "DICOMRetrievalSequence"); + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::Item::getRetrieveAETitle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RetrieveAETitle, value, pos); +} + + +OFCondition DRTDICOMRetrievalSequence::Item::setRetrieveAETitle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmApplicationEntity::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RetrieveAETitle.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDICOMRetrievalSequence::DRTDICOMRetrievalSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDICOMRetrievalSequence::DRTDICOMRetrievalSequence(const DRTDICOMRetrievalSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDICOMRetrievalSequence &DRTDICOMRetrievalSequence::operator=(const DRTDICOMRetrievalSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDICOMRetrievalSequence::~DRTDICOMRetrievalSequence() +{ + clear(); +} + + +void DRTDICOMRetrievalSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDICOMRetrievalSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDICOMRetrievalSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDICOMRetrievalSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDICOMRetrievalSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDICOMRetrievalSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDICOMRetrievalSequence::Item &DRTDICOMRetrievalSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDICOMRetrievalSequence::Item &DRTDICOMRetrievalSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDICOMRetrievalSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDICOMRetrievalSequence::Item &DRTDICOMRetrievalSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDICOMRetrievalSequence::Item &DRTDICOMRetrievalSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDICOMRetrievalSequence::Item &DRTDICOMRetrievalSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDICOMRetrievalSequence::Item &DRTDICOMRetrievalSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDICOMRetrievalSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DICOMRetrievalSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DICOMRetrievalSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDICOMRetrievalSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DICOMRetrievalSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdose.cc b/dcmrt/libsrc/drtdose.cc new file mode 100644 index 00000000..9b63bbbd --- /dev/null +++ b/dcmrt/libsrc/drtdose.cc @@ -0,0 +1,5321 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDoseIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drtdose.h" + + +DRTDoseIOD::DRTDoseIOD() + : PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(), + PatientBirthDate(DCM_PatientBirthDate), + PatientBirthDateInAlternativeCalendar(DCM_PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(DCM_PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(DCM_PatientAlternativeCalendar), + PatientSex(DCM_PatientSex), + ReferencedPatientPhotoSequence(), + QualityControlSubject(DCM_QualityControlSubject), + ReferencedPatientSequence(), + PatientBirthTime(DCM_PatientBirthTime), + OtherPatientIDsSequence(), + OtherPatientNames(DCM_OtherPatientNames), + EthnicGroup(DCM_EthnicGroup), + PatientComments(DCM_PatientComments), + PatientSpeciesDescription(DCM_PatientSpeciesDescription), + PatientSpeciesCodeSequence(), + PatientBreedDescription(DCM_PatientBreedDescription), + PatientBreedCodeSequence(), + BreedRegistrationSequence(), + StrainDescription(DCM_StrainDescription), + StrainNomenclature(DCM_StrainNomenclature), + StrainCodeSequence(), + StrainAdditionalInformation(DCM_StrainAdditionalInformation), + StrainStockSequence(), + GeneticModificationsSequence(), + ResponsiblePerson(DCM_ResponsiblePerson), + ResponsiblePersonRole(DCM_ResponsiblePersonRole), + ResponsibleOrganization(DCM_ResponsibleOrganization), + PatientIdentityRemoved(DCM_PatientIdentityRemoved), + DeidentificationMethod(DCM_DeidentificationMethod), + DeidentificationMethodCodeSequence(), + SourcePatientGroupIdentificationSequence(), + GroupOfPatientsIdentificationSequence(), + ClinicalTrialSponsorName(DCM_ClinicalTrialSponsorName), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ClinicalTrialProtocolName(DCM_ClinicalTrialProtocolName), + ClinicalTrialSiteID(DCM_ClinicalTrialSiteID), + ClinicalTrialSiteName(DCM_ClinicalTrialSiteName), + ClinicalTrialSubjectID(DCM_ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(DCM_ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(DCM_ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(), + ConsultingPhysicianName(DCM_ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(), + StudyDescription(DCM_StudyDescription), + PhysiciansOfRecord(DCM_PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(), + NameOfPhysiciansReadingStudy(DCM_NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(), + RequestingServiceCodeSequence(), + ReferencedStudySequence(), + ProcedureCodeSequence(), + ReasonForPerformedProcedureCodeSequence(), + AdmittingDiagnosesDescription(DCM_AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(), + PatientAge(DCM_PatientAge), + PatientSize(DCM_PatientSize), + PatientWeight(DCM_PatientWeight), + PatientBodyMassIndex(DCM_PatientBodyMassIndex), + MeasuredAPDimension(DCM_MeasuredAPDimension), + MeasuredLateralDimension(DCM_MeasuredLateralDimension), + PatientSizeCodeSequence(), + MedicalAlerts(DCM_MedicalAlerts), + Allergies(DCM_Allergies), + SmokingStatus(DCM_SmokingStatus), + PregnancyStatus(DCM_PregnancyStatus), + LastMenstrualDate(DCM_LastMenstrualDate), + PatientState(DCM_PatientState), + Occupation(DCM_Occupation), + AdditionalPatientHistory(DCM_AdditionalPatientHistory), + AdmissionID(DCM_AdmissionID), + IssuerOfAdmissionIDSequence(), + ServiceEpisodeID(DCM_ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(), + ServiceEpisodeDescription(DCM_ServiceEpisodeDescription), + PatientSexNeutered(DCM_PatientSexNeutered), + ClinicalTrialTimePointID(DCM_ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(DCM_ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(DCM_LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(DCM_LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + SeriesDescription(DCM_SeriesDescription), + SeriesDescriptionCodeSequence(), + OperatorsName(DCM_OperatorsName), + OperatorIdentificationSequence(), + ReferencedPerformedProcedureStepSequence(), + RequestAttributesSequence(), + PerformedProcedureStepID(DCM_PerformedProcedureStepID), + PerformedProcedureStepStartDate(DCM_PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(DCM_PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(DCM_PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(DCM_PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(DCM_PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(), + CommentsOnThePerformedProcedureStep(DCM_CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(DCM_ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(DCM_ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(DCM_ClinicalTrialSeriesDescription), + FrameOfReferenceUID(DCM_FrameOfReferenceUID), + PositionReferenceIndicator(DCM_PositionReferenceIndicator), + Manufacturer(DCM_Manufacturer), + InstitutionName(DCM_InstitutionName), + InstitutionAddress(DCM_InstitutionAddress), + StationName(DCM_StationName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + GantryID(DCM_GantryID), + UDISequence(), + SpatialResolution(DCM_SpatialResolution), + DateOfLastCalibration(DCM_DateOfLastCalibration), + TimeOfLastCalibration(DCM_TimeOfLastCalibration), + PixelPaddingValue(DCM_PixelPaddingValue), + PatientOrientation(DCM_PatientOrientation), + ImageType(DCM_ImageType), + AcquisitionNumber(DCM_AcquisitionNumber), + AcquisitionDate(DCM_AcquisitionDate), + AcquisitionTime(DCM_AcquisitionTime), + AcquisitionDateTime(DCM_AcquisitionDateTime), + ImagesInAcquisition(DCM_ImagesInAcquisition), + ImageComments(DCM_ImageComments), + QualityControlImage(DCM_QualityControlImage), + BurnedInAnnotation(DCM_BurnedInAnnotation), + RecognizableVisualFeatures(DCM_RecognizableVisualFeatures), + LossyImageCompression(DCM_LossyImageCompression), + LossyImageCompressionRatio(DCM_LossyImageCompressionRatio), + LossyImageCompressionMethod(DCM_LossyImageCompressionMethod), + IconImageSequence(), + PresentationLUTShape(DCM_PresentationLUTShape), + IrradiationEventUID(DCM_IrradiationEventUID), + RealWorldValueMappingSequence(), + PixelSpacing(DCM_PixelSpacing), + ImageOrientationPatient(DCM_ImageOrientationPatient), + ImagePositionPatient(DCM_ImagePositionPatient), + SliceThickness(DCM_SliceThickness), + SliceLocation(DCM_SliceLocation), + Rows(DCM_Rows), + Columns(DCM_Columns), + PlanarConfiguration(DCM_PlanarConfiguration), + PixelAspectRatio(DCM_PixelAspectRatio), + SmallestImagePixelValue(DCM_SmallestImagePixelValue), + LargestImagePixelValue(DCM_LargestImagePixelValue), + RedPaletteColorLookupTableDescriptor(DCM_RedPaletteColorLookupTableDescriptor), + GreenPaletteColorLookupTableDescriptor(DCM_GreenPaletteColorLookupTableDescriptor), + BluePaletteColorLookupTableDescriptor(DCM_BluePaletteColorLookupTableDescriptor), + RedPaletteColorLookupTableData(DCM_RedPaletteColorLookupTableData), + GreenPaletteColorLookupTableData(DCM_GreenPaletteColorLookupTableData), + BluePaletteColorLookupTableData(DCM_BluePaletteColorLookupTableData), + ICCProfile(DCM_ICCProfile), + ColorSpace(DCM_ColorSpace), + PixelData(DCM_PixelData), + PixelDataProviderURL(DCM_PixelDataProviderURL), + PixelPaddingRangeLimit(DCM_PixelPaddingRangeLimit), + NumberOfFrames(DCM_NumberOfFrames), + FrameIncrementPointer(DCM_FrameIncrementPointer), + StereoPairsPresent(DCM_StereoPairsPresent), + OverlayRows(DCM_OverlayRows), + OverlayColumns(DCM_OverlayColumns), + OverlayType(DCM_OverlayType), + OverlayOrigin(DCM_OverlayOrigin), + OverlayBitsAllocated(DCM_OverlayBitsAllocated), + OverlayBitPosition(DCM_OverlayBitPosition), + OverlayData(DCM_OverlayData), + OverlayDescription(DCM_OverlayDescription), + OverlaySubtype(DCM_OverlaySubtype), + OverlayLabel(DCM_OverlayLabel), + ROIArea(DCM_ROIArea), + ROIMean(DCM_ROIMean), + ROIStandardDeviation(DCM_ROIStandardDeviation), + NumberOfFramesInOverlay(DCM_NumberOfFramesInOverlay), + ImageFrameOrigin(DCM_ImageFrameOrigin), + ModalityLUTSequence(), + RescaleIntercept(DCM_RescaleIntercept), + RescaleSlope(DCM_RescaleSlope), + RescaleType(DCM_RescaleType), + SamplesPerPixel(DCM_SamplesPerPixel), + PhotometricInterpretation(DCM_PhotometricInterpretation), + BitsAllocated(DCM_BitsAllocated), + BitsStored(DCM_BitsStored), + HighBit(DCM_HighBit), + PixelRepresentation(DCM_PixelRepresentation), + ContentDate(DCM_ContentDate), + ContentTime(DCM_ContentTime), + DoseUnits(DCM_DoseUnits), + DoseType(DCM_DoseType), + SpatialTransformOfDose(DCM_SpatialTransformOfDose), + ReferencedSpatialRegistrationSequence(), + InstanceNumber(DCM_InstanceNumber), + DoseComment(DCM_DoseComment), + NormalizationPoint(DCM_NormalizationPoint), + DoseSummationType(DCM_DoseSummationType), + ReferencedRTPlanSequence(), + ReferencedTreatmentRecordSequence(), + GridFrameOffsetVector(DCM_GridFrameOffsetVector), + DoseGridScaling(DCM_DoseGridScaling), + TissueHeterogeneityCorrection(DCM_TissueHeterogeneityCorrection), + DerivationCodeSequence(), + ReferencedInstanceSequence(), + ReferencedStructureSetSequence(), + DVHNormalizationPoint(DCM_DVHNormalizationPoint), + DVHNormalizationDoseValue(DCM_DVHNormalizationDoseValue), + DVHSequence(), + StructureSetLabel(DCM_StructureSetLabel), + StructureSetName(DCM_StructureSetName), + StructureSetDescription(DCM_StructureSetDescription), + StructureSetDate(DCM_StructureSetDate), + StructureSetTime(DCM_StructureSetTime), + ReferencedFrameOfReferenceSequence(), + StructureSetROISequence(), + PredecessorStructureSetSequence(), + ROIContourSequence(), + RTDoseROISequence(), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCoercionDateTime(DCM_InstanceCoercionDateTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + RelatedGeneralSOPClassUID(DCM_RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(DCM_OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(), + ContextGroupIdentificationSequence(), + MappingResourceIdentificationSequence(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + ContributingEquipmentSequence(), + SOPInstanceStatus(DCM_SOPInstanceStatus), + SOPAuthorizationDateTime(DCM_SOPAuthorizationDateTime), + SOPAuthorizationComment(DCM_SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(DCM_AuthorizationEquipmentCertificationNumber), + MACParametersSequence(), + DigitalSignaturesSequence(), + EncryptedAttributesSequence(), + OriginalAttributesSequence(), + HL7StructuredDocumentReferenceSequence(), + LongitudinalTemporalInformationModified(DCM_LongitudinalTemporalInformationModified), + QueryRetrieveView(DCM_QueryRetrieveView), + ConversionSourceAttributesSequence(), + ContentQualification(DCM_ContentQualification), + PrivateDataElementCharacteristicsSequence(), + ReferencedSeriesSequence(), + StudiesContainingOtherReferencedInstancesSequence(), + FrameExtractionSequence() +{ + /* set initial values for a new SOP instance */ + updateAttributes(); +} + + +DRTDoseIOD::DRTDoseIOD(const DRTDoseIOD ©) + : PatientName(copy.PatientName), + PatientID(copy.PatientID), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientBirthDate(copy.PatientBirthDate), + PatientBirthDateInAlternativeCalendar(copy.PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(copy.PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(copy.PatientAlternativeCalendar), + PatientSex(copy.PatientSex), + ReferencedPatientPhotoSequence(copy.ReferencedPatientPhotoSequence), + QualityControlSubject(copy.QualityControlSubject), + ReferencedPatientSequence(copy.ReferencedPatientSequence), + PatientBirthTime(copy.PatientBirthTime), + OtherPatientIDsSequence(copy.OtherPatientIDsSequence), + OtherPatientNames(copy.OtherPatientNames), + EthnicGroup(copy.EthnicGroup), + PatientComments(copy.PatientComments), + PatientSpeciesDescription(copy.PatientSpeciesDescription), + PatientSpeciesCodeSequence(copy.PatientSpeciesCodeSequence), + PatientBreedDescription(copy.PatientBreedDescription), + PatientBreedCodeSequence(copy.PatientBreedCodeSequence), + BreedRegistrationSequence(copy.BreedRegistrationSequence), + StrainDescription(copy.StrainDescription), + StrainNomenclature(copy.StrainNomenclature), + StrainCodeSequence(copy.StrainCodeSequence), + StrainAdditionalInformation(copy.StrainAdditionalInformation), + StrainStockSequence(copy.StrainStockSequence), + GeneticModificationsSequence(copy.GeneticModificationsSequence), + ResponsiblePerson(copy.ResponsiblePerson), + ResponsiblePersonRole(copy.ResponsiblePersonRole), + ResponsibleOrganization(copy.ResponsibleOrganization), + PatientIdentityRemoved(copy.PatientIdentityRemoved), + DeidentificationMethod(copy.DeidentificationMethod), + DeidentificationMethodCodeSequence(copy.DeidentificationMethodCodeSequence), + SourcePatientGroupIdentificationSequence(copy.SourcePatientGroupIdentificationSequence), + GroupOfPatientsIdentificationSequence(copy.GroupOfPatientsIdentificationSequence), + ClinicalTrialSponsorName(copy.ClinicalTrialSponsorName), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ClinicalTrialProtocolName(copy.ClinicalTrialProtocolName), + ClinicalTrialSiteID(copy.ClinicalTrialSiteID), + ClinicalTrialSiteName(copy.ClinicalTrialSiteName), + ClinicalTrialSubjectID(copy.ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(copy.ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(copy.ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(copy.StudyInstanceUID), + StudyDate(copy.StudyDate), + StudyTime(copy.StudyTime), + ReferringPhysicianName(copy.ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(copy.ReferringPhysicianIdentificationSequence), + ConsultingPhysicianName(copy.ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(copy.ConsultingPhysicianIdentificationSequence), + StudyID(copy.StudyID), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + StudyDescription(copy.StudyDescription), + PhysiciansOfRecord(copy.PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(copy.PhysiciansOfRecordIdentificationSequence), + NameOfPhysiciansReadingStudy(copy.NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(copy.PhysiciansReadingStudyIdentificationSequence), + RequestingServiceCodeSequence(copy.RequestingServiceCodeSequence), + ReferencedStudySequence(copy.ReferencedStudySequence), + ProcedureCodeSequence(copy.ProcedureCodeSequence), + ReasonForPerformedProcedureCodeSequence(copy.ReasonForPerformedProcedureCodeSequence), + AdmittingDiagnosesDescription(copy.AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(copy.AdmittingDiagnosesCodeSequence), + PatientAge(copy.PatientAge), + PatientSize(copy.PatientSize), + PatientWeight(copy.PatientWeight), + PatientBodyMassIndex(copy.PatientBodyMassIndex), + MeasuredAPDimension(copy.MeasuredAPDimension), + MeasuredLateralDimension(copy.MeasuredLateralDimension), + PatientSizeCodeSequence(copy.PatientSizeCodeSequence), + MedicalAlerts(copy.MedicalAlerts), + Allergies(copy.Allergies), + SmokingStatus(copy.SmokingStatus), + PregnancyStatus(copy.PregnancyStatus), + LastMenstrualDate(copy.LastMenstrualDate), + PatientState(copy.PatientState), + Occupation(copy.Occupation), + AdditionalPatientHistory(copy.AdditionalPatientHistory), + AdmissionID(copy.AdmissionID), + IssuerOfAdmissionIDSequence(copy.IssuerOfAdmissionIDSequence), + ServiceEpisodeID(copy.ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(copy.IssuerOfServiceEpisodeIDSequence), + ServiceEpisodeDescription(copy.ServiceEpisodeDescription), + PatientSexNeutered(copy.PatientSexNeutered), + ClinicalTrialTimePointID(copy.ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(copy.ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(copy.LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(copy.LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(copy.ConsentForClinicalTrialUseSequence), + Modality(copy.Modality), + SeriesInstanceUID(copy.SeriesInstanceUID), + SeriesNumber(copy.SeriesNumber), + SeriesDate(copy.SeriesDate), + SeriesTime(copy.SeriesTime), + SeriesDescription(copy.SeriesDescription), + SeriesDescriptionCodeSequence(copy.SeriesDescriptionCodeSequence), + OperatorsName(copy.OperatorsName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + ReferencedPerformedProcedureStepSequence(copy.ReferencedPerformedProcedureStepSequence), + RequestAttributesSequence(copy.RequestAttributesSequence), + PerformedProcedureStepID(copy.PerformedProcedureStepID), + PerformedProcedureStepStartDate(copy.PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(copy.PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(copy.PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(copy.PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(copy.PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(copy.PerformedProtocolCodeSequence), + CommentsOnThePerformedProcedureStep(copy.CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(copy.ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(copy.ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(copy.ClinicalTrialSeriesDescription), + FrameOfReferenceUID(copy.FrameOfReferenceUID), + PositionReferenceIndicator(copy.PositionReferenceIndicator), + Manufacturer(copy.Manufacturer), + InstitutionName(copy.InstitutionName), + InstitutionAddress(copy.InstitutionAddress), + StationName(copy.StationName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + ManufacturerModelName(copy.ManufacturerModelName), + DeviceSerialNumber(copy.DeviceSerialNumber), + SoftwareVersions(copy.SoftwareVersions), + GantryID(copy.GantryID), + UDISequence(copy.UDISequence), + SpatialResolution(copy.SpatialResolution), + DateOfLastCalibration(copy.DateOfLastCalibration), + TimeOfLastCalibration(copy.TimeOfLastCalibration), + PixelPaddingValue(copy.PixelPaddingValue), + PatientOrientation(copy.PatientOrientation), + ImageType(copy.ImageType), + AcquisitionNumber(copy.AcquisitionNumber), + AcquisitionDate(copy.AcquisitionDate), + AcquisitionTime(copy.AcquisitionTime), + AcquisitionDateTime(copy.AcquisitionDateTime), + ImagesInAcquisition(copy.ImagesInAcquisition), + ImageComments(copy.ImageComments), + QualityControlImage(copy.QualityControlImage), + BurnedInAnnotation(copy.BurnedInAnnotation), + RecognizableVisualFeatures(copy.RecognizableVisualFeatures), + LossyImageCompression(copy.LossyImageCompression), + LossyImageCompressionRatio(copy.LossyImageCompressionRatio), + LossyImageCompressionMethod(copy.LossyImageCompressionMethod), + IconImageSequence(copy.IconImageSequence), + PresentationLUTShape(copy.PresentationLUTShape), + IrradiationEventUID(copy.IrradiationEventUID), + RealWorldValueMappingSequence(copy.RealWorldValueMappingSequence), + PixelSpacing(copy.PixelSpacing), + ImageOrientationPatient(copy.ImageOrientationPatient), + ImagePositionPatient(copy.ImagePositionPatient), + SliceThickness(copy.SliceThickness), + SliceLocation(copy.SliceLocation), + Rows(copy.Rows), + Columns(copy.Columns), + PlanarConfiguration(copy.PlanarConfiguration), + PixelAspectRatio(copy.PixelAspectRatio), + SmallestImagePixelValue(copy.SmallestImagePixelValue), + LargestImagePixelValue(copy.LargestImagePixelValue), + RedPaletteColorLookupTableDescriptor(copy.RedPaletteColorLookupTableDescriptor), + GreenPaletteColorLookupTableDescriptor(copy.GreenPaletteColorLookupTableDescriptor), + BluePaletteColorLookupTableDescriptor(copy.BluePaletteColorLookupTableDescriptor), + RedPaletteColorLookupTableData(copy.RedPaletteColorLookupTableData), + GreenPaletteColorLookupTableData(copy.GreenPaletteColorLookupTableData), + BluePaletteColorLookupTableData(copy.BluePaletteColorLookupTableData), + ICCProfile(copy.ICCProfile), + ColorSpace(copy.ColorSpace), + PixelData(copy.PixelData), + PixelDataProviderURL(copy.PixelDataProviderURL), + PixelPaddingRangeLimit(copy.PixelPaddingRangeLimit), + NumberOfFrames(copy.NumberOfFrames), + FrameIncrementPointer(copy.FrameIncrementPointer), + StereoPairsPresent(copy.StereoPairsPresent), + OverlayRows(copy.OverlayRows), + OverlayColumns(copy.OverlayColumns), + OverlayType(copy.OverlayType), + OverlayOrigin(copy.OverlayOrigin), + OverlayBitsAllocated(copy.OverlayBitsAllocated), + OverlayBitPosition(copy.OverlayBitPosition), + OverlayData(copy.OverlayData), + OverlayDescription(copy.OverlayDescription), + OverlaySubtype(copy.OverlaySubtype), + OverlayLabel(copy.OverlayLabel), + ROIArea(copy.ROIArea), + ROIMean(copy.ROIMean), + ROIStandardDeviation(copy.ROIStandardDeviation), + NumberOfFramesInOverlay(copy.NumberOfFramesInOverlay), + ImageFrameOrigin(copy.ImageFrameOrigin), + ModalityLUTSequence(copy.ModalityLUTSequence), + RescaleIntercept(copy.RescaleIntercept), + RescaleSlope(copy.RescaleSlope), + RescaleType(copy.RescaleType), + SamplesPerPixel(copy.SamplesPerPixel), + PhotometricInterpretation(copy.PhotometricInterpretation), + BitsAllocated(copy.BitsAllocated), + BitsStored(copy.BitsStored), + HighBit(copy.HighBit), + PixelRepresentation(copy.PixelRepresentation), + ContentDate(copy.ContentDate), + ContentTime(copy.ContentTime), + DoseUnits(copy.DoseUnits), + DoseType(copy.DoseType), + SpatialTransformOfDose(copy.SpatialTransformOfDose), + ReferencedSpatialRegistrationSequence(copy.ReferencedSpatialRegistrationSequence), + InstanceNumber(copy.InstanceNumber), + DoseComment(copy.DoseComment), + NormalizationPoint(copy.NormalizationPoint), + DoseSummationType(copy.DoseSummationType), + ReferencedRTPlanSequence(copy.ReferencedRTPlanSequence), + ReferencedTreatmentRecordSequence(copy.ReferencedTreatmentRecordSequence), + GridFrameOffsetVector(copy.GridFrameOffsetVector), + DoseGridScaling(copy.DoseGridScaling), + TissueHeterogeneityCorrection(copy.TissueHeterogeneityCorrection), + DerivationCodeSequence(copy.DerivationCodeSequence), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + ReferencedStructureSetSequence(copy.ReferencedStructureSetSequence), + DVHNormalizationPoint(copy.DVHNormalizationPoint), + DVHNormalizationDoseValue(copy.DVHNormalizationDoseValue), + DVHSequence(copy.DVHSequence), + StructureSetLabel(copy.StructureSetLabel), + StructureSetName(copy.StructureSetName), + StructureSetDescription(copy.StructureSetDescription), + StructureSetDate(copy.StructureSetDate), + StructureSetTime(copy.StructureSetTime), + ReferencedFrameOfReferenceSequence(copy.ReferencedFrameOfReferenceSequence), + StructureSetROISequence(copy.StructureSetROISequence), + PredecessorStructureSetSequence(copy.PredecessorStructureSetSequence), + ROIContourSequence(copy.ROIContourSequence), + RTDoseROISequence(copy.RTDoseROISequence), + SOPClassUID(copy.SOPClassUID), + SOPInstanceUID(copy.SOPInstanceUID), + SpecificCharacterSet(copy.SpecificCharacterSet), + InstanceCreationDate(copy.InstanceCreationDate), + InstanceCreationTime(copy.InstanceCreationTime), + InstanceCoercionDateTime(copy.InstanceCoercionDateTime), + InstanceCreatorUID(copy.InstanceCreatorUID), + RelatedGeneralSOPClassUID(copy.RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(copy.OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(copy.CodingSchemeIdentificationSequence), + ContextGroupIdentificationSequence(copy.ContextGroupIdentificationSequence), + MappingResourceIdentificationSequence(copy.MappingResourceIdentificationSequence), + TimezoneOffsetFromUTC(copy.TimezoneOffsetFromUTC), + ContributingEquipmentSequence(copy.ContributingEquipmentSequence), + SOPInstanceStatus(copy.SOPInstanceStatus), + SOPAuthorizationDateTime(copy.SOPAuthorizationDateTime), + SOPAuthorizationComment(copy.SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(copy.AuthorizationEquipmentCertificationNumber), + MACParametersSequence(copy.MACParametersSequence), + DigitalSignaturesSequence(copy.DigitalSignaturesSequence), + EncryptedAttributesSequence(copy.EncryptedAttributesSequence), + OriginalAttributesSequence(copy.OriginalAttributesSequence), + HL7StructuredDocumentReferenceSequence(copy.HL7StructuredDocumentReferenceSequence), + LongitudinalTemporalInformationModified(copy.LongitudinalTemporalInformationModified), + QueryRetrieveView(copy.QueryRetrieveView), + ConversionSourceAttributesSequence(copy.ConversionSourceAttributesSequence), + ContentQualification(copy.ContentQualification), + PrivateDataElementCharacteristicsSequence(copy.PrivateDataElementCharacteristicsSequence), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudiesContainingOtherReferencedInstancesSequence(copy.StudiesContainingOtherReferencedInstancesSequence), + FrameExtractionSequence(copy.FrameExtractionSequence) +{ +} + + +DRTDoseIOD::~DRTDoseIOD() +{ +} + + +DRTDoseIOD &DRTDoseIOD::operator=(const DRTDoseIOD ©) +{ + if (this != ©) + { + PatientName = copy.PatientName; + PatientID = copy.PatientID; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientBirthDate = copy.PatientBirthDate; + PatientBirthDateInAlternativeCalendar = copy.PatientBirthDateInAlternativeCalendar; + PatientDeathDateInAlternativeCalendar = copy.PatientDeathDateInAlternativeCalendar; + PatientAlternativeCalendar = copy.PatientAlternativeCalendar; + PatientSex = copy.PatientSex; + ReferencedPatientPhotoSequence = copy.ReferencedPatientPhotoSequence; + QualityControlSubject = copy.QualityControlSubject; + ReferencedPatientSequence = copy.ReferencedPatientSequence; + PatientBirthTime = copy.PatientBirthTime; + OtherPatientIDsSequence = copy.OtherPatientIDsSequence; + OtherPatientNames = copy.OtherPatientNames; + EthnicGroup = copy.EthnicGroup; + PatientComments = copy.PatientComments; + PatientSpeciesDescription = copy.PatientSpeciesDescription; + PatientSpeciesCodeSequence = copy.PatientSpeciesCodeSequence; + PatientBreedDescription = copy.PatientBreedDescription; + PatientBreedCodeSequence = copy.PatientBreedCodeSequence; + BreedRegistrationSequence = copy.BreedRegistrationSequence; + StrainDescription = copy.StrainDescription; + StrainNomenclature = copy.StrainNomenclature; + StrainCodeSequence = copy.StrainCodeSequence; + StrainAdditionalInformation = copy.StrainAdditionalInformation; + StrainStockSequence = copy.StrainStockSequence; + GeneticModificationsSequence = copy.GeneticModificationsSequence; + ResponsiblePerson = copy.ResponsiblePerson; + ResponsiblePersonRole = copy.ResponsiblePersonRole; + ResponsibleOrganization = copy.ResponsibleOrganization; + PatientIdentityRemoved = copy.PatientIdentityRemoved; + DeidentificationMethod = copy.DeidentificationMethod; + DeidentificationMethodCodeSequence = copy.DeidentificationMethodCodeSequence; + SourcePatientGroupIdentificationSequence = copy.SourcePatientGroupIdentificationSequence; + GroupOfPatientsIdentificationSequence = copy.GroupOfPatientsIdentificationSequence; + ClinicalTrialSponsorName = copy.ClinicalTrialSponsorName; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ClinicalTrialProtocolName = copy.ClinicalTrialProtocolName; + ClinicalTrialSiteID = copy.ClinicalTrialSiteID; + ClinicalTrialSiteName = copy.ClinicalTrialSiteName; + ClinicalTrialSubjectID = copy.ClinicalTrialSubjectID; + ClinicalTrialSubjectReadingID = copy.ClinicalTrialSubjectReadingID; + ClinicalTrialProtocolEthicsCommitteeName = copy.ClinicalTrialProtocolEthicsCommitteeName; + ClinicalTrialProtocolEthicsCommitteeApprovalNumber = copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + StudyInstanceUID = copy.StudyInstanceUID; + StudyDate = copy.StudyDate; + StudyTime = copy.StudyTime; + ReferringPhysicianName = copy.ReferringPhysicianName; + ReferringPhysicianIdentificationSequence = copy.ReferringPhysicianIdentificationSequence; + ConsultingPhysicianName = copy.ConsultingPhysicianName; + ConsultingPhysicianIdentificationSequence = copy.ConsultingPhysicianIdentificationSequence; + StudyID = copy.StudyID; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + StudyDescription = copy.StudyDescription; + PhysiciansOfRecord = copy.PhysiciansOfRecord; + PhysiciansOfRecordIdentificationSequence = copy.PhysiciansOfRecordIdentificationSequence; + NameOfPhysiciansReadingStudy = copy.NameOfPhysiciansReadingStudy; + PhysiciansReadingStudyIdentificationSequence = copy.PhysiciansReadingStudyIdentificationSequence; + RequestingServiceCodeSequence = copy.RequestingServiceCodeSequence; + ReferencedStudySequence = copy.ReferencedStudySequence; + ProcedureCodeSequence = copy.ProcedureCodeSequence; + ReasonForPerformedProcedureCodeSequence = copy.ReasonForPerformedProcedureCodeSequence; + AdmittingDiagnosesDescription = copy.AdmittingDiagnosesDescription; + AdmittingDiagnosesCodeSequence = copy.AdmittingDiagnosesCodeSequence; + PatientAge = copy.PatientAge; + PatientSize = copy.PatientSize; + PatientWeight = copy.PatientWeight; + PatientBodyMassIndex = copy.PatientBodyMassIndex; + MeasuredAPDimension = copy.MeasuredAPDimension; + MeasuredLateralDimension = copy.MeasuredLateralDimension; + PatientSizeCodeSequence = copy.PatientSizeCodeSequence; + MedicalAlerts = copy.MedicalAlerts; + Allergies = copy.Allergies; + SmokingStatus = copy.SmokingStatus; + PregnancyStatus = copy.PregnancyStatus; + LastMenstrualDate = copy.LastMenstrualDate; + PatientState = copy.PatientState; + Occupation = copy.Occupation; + AdditionalPatientHistory = copy.AdditionalPatientHistory; + AdmissionID = copy.AdmissionID; + IssuerOfAdmissionIDSequence = copy.IssuerOfAdmissionIDSequence; + ServiceEpisodeID = copy.ServiceEpisodeID; + IssuerOfServiceEpisodeIDSequence = copy.IssuerOfServiceEpisodeIDSequence; + ServiceEpisodeDescription = copy.ServiceEpisodeDescription; + PatientSexNeutered = copy.PatientSexNeutered; + ClinicalTrialTimePointID = copy.ClinicalTrialTimePointID; + ClinicalTrialTimePointDescription = copy.ClinicalTrialTimePointDescription; + LongitudinalTemporalOffsetFromEvent = copy.LongitudinalTemporalOffsetFromEvent; + LongitudinalTemporalEventType = copy.LongitudinalTemporalEventType; + ConsentForClinicalTrialUseSequence = copy.ConsentForClinicalTrialUseSequence; + Modality = copy.Modality; + SeriesInstanceUID = copy.SeriesInstanceUID; + SeriesNumber = copy.SeriesNumber; + SeriesDate = copy.SeriesDate; + SeriesTime = copy.SeriesTime; + SeriesDescription = copy.SeriesDescription; + SeriesDescriptionCodeSequence = copy.SeriesDescriptionCodeSequence; + OperatorsName = copy.OperatorsName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + ReferencedPerformedProcedureStepSequence = copy.ReferencedPerformedProcedureStepSequence; + RequestAttributesSequence = copy.RequestAttributesSequence; + PerformedProcedureStepID = copy.PerformedProcedureStepID; + PerformedProcedureStepStartDate = copy.PerformedProcedureStepStartDate; + PerformedProcedureStepStartTime = copy.PerformedProcedureStepStartTime; + PerformedProcedureStepEndDate = copy.PerformedProcedureStepEndDate; + PerformedProcedureStepEndTime = copy.PerformedProcedureStepEndTime; + PerformedProcedureStepDescription = copy.PerformedProcedureStepDescription; + PerformedProtocolCodeSequence = copy.PerformedProtocolCodeSequence; + CommentsOnThePerformedProcedureStep = copy.CommentsOnThePerformedProcedureStep; + ClinicalTrialCoordinatingCenterName = copy.ClinicalTrialCoordinatingCenterName; + ClinicalTrialSeriesID = copy.ClinicalTrialSeriesID; + ClinicalTrialSeriesDescription = copy.ClinicalTrialSeriesDescription; + FrameOfReferenceUID = copy.FrameOfReferenceUID; + PositionReferenceIndicator = copy.PositionReferenceIndicator; + Manufacturer = copy.Manufacturer; + InstitutionName = copy.InstitutionName; + InstitutionAddress = copy.InstitutionAddress; + StationName = copy.StationName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + ManufacturerModelName = copy.ManufacturerModelName; + DeviceSerialNumber = copy.DeviceSerialNumber; + SoftwareVersions = copy.SoftwareVersions; + GantryID = copy.GantryID; + UDISequence = copy.UDISequence; + SpatialResolution = copy.SpatialResolution; + DateOfLastCalibration = copy.DateOfLastCalibration; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + PixelPaddingValue = copy.PixelPaddingValue; + PatientOrientation = copy.PatientOrientation; + ImageType = copy.ImageType; + AcquisitionNumber = copy.AcquisitionNumber; + AcquisitionDate = copy.AcquisitionDate; + AcquisitionTime = copy.AcquisitionTime; + AcquisitionDateTime = copy.AcquisitionDateTime; + ImagesInAcquisition = copy.ImagesInAcquisition; + ImageComments = copy.ImageComments; + QualityControlImage = copy.QualityControlImage; + BurnedInAnnotation = copy.BurnedInAnnotation; + RecognizableVisualFeatures = copy.RecognizableVisualFeatures; + LossyImageCompression = copy.LossyImageCompression; + LossyImageCompressionRatio = copy.LossyImageCompressionRatio; + LossyImageCompressionMethod = copy.LossyImageCompressionMethod; + IconImageSequence = copy.IconImageSequence; + PresentationLUTShape = copy.PresentationLUTShape; + IrradiationEventUID = copy.IrradiationEventUID; + RealWorldValueMappingSequence = copy.RealWorldValueMappingSequence; + PixelSpacing = copy.PixelSpacing; + ImageOrientationPatient = copy.ImageOrientationPatient; + ImagePositionPatient = copy.ImagePositionPatient; + SliceThickness = copy.SliceThickness; + SliceLocation = copy.SliceLocation; + Rows = copy.Rows; + Columns = copy.Columns; + PlanarConfiguration = copy.PlanarConfiguration; + PixelAspectRatio = copy.PixelAspectRatio; + SmallestImagePixelValue = copy.SmallestImagePixelValue; + LargestImagePixelValue = copy.LargestImagePixelValue; + RedPaletteColorLookupTableDescriptor = copy.RedPaletteColorLookupTableDescriptor; + GreenPaletteColorLookupTableDescriptor = copy.GreenPaletteColorLookupTableDescriptor; + BluePaletteColorLookupTableDescriptor = copy.BluePaletteColorLookupTableDescriptor; + RedPaletteColorLookupTableData = copy.RedPaletteColorLookupTableData; + GreenPaletteColorLookupTableData = copy.GreenPaletteColorLookupTableData; + BluePaletteColorLookupTableData = copy.BluePaletteColorLookupTableData; + ICCProfile = copy.ICCProfile; + ColorSpace = copy.ColorSpace; + PixelData = copy.PixelData; + PixelDataProviderURL = copy.PixelDataProviderURL; + PixelPaddingRangeLimit = copy.PixelPaddingRangeLimit; + NumberOfFrames = copy.NumberOfFrames; + FrameIncrementPointer = copy.FrameIncrementPointer; + StereoPairsPresent = copy.StereoPairsPresent; + OverlayRows = copy.OverlayRows; + OverlayColumns = copy.OverlayColumns; + OverlayType = copy.OverlayType; + OverlayOrigin = copy.OverlayOrigin; + OverlayBitsAllocated = copy.OverlayBitsAllocated; + OverlayBitPosition = copy.OverlayBitPosition; + OverlayData = copy.OverlayData; + OverlayDescription = copy.OverlayDescription; + OverlaySubtype = copy.OverlaySubtype; + OverlayLabel = copy.OverlayLabel; + ROIArea = copy.ROIArea; + ROIMean = copy.ROIMean; + ROIStandardDeviation = copy.ROIStandardDeviation; + NumberOfFramesInOverlay = copy.NumberOfFramesInOverlay; + ImageFrameOrigin = copy.ImageFrameOrigin; + ModalityLUTSequence = copy.ModalityLUTSequence; + RescaleIntercept = copy.RescaleIntercept; + RescaleSlope = copy.RescaleSlope; + RescaleType = copy.RescaleType; + SamplesPerPixel = copy.SamplesPerPixel; + PhotometricInterpretation = copy.PhotometricInterpretation; + BitsAllocated = copy.BitsAllocated; + BitsStored = copy.BitsStored; + HighBit = copy.HighBit; + PixelRepresentation = copy.PixelRepresentation; + ContentDate = copy.ContentDate; + ContentTime = copy.ContentTime; + DoseUnits = copy.DoseUnits; + DoseType = copy.DoseType; + SpatialTransformOfDose = copy.SpatialTransformOfDose; + ReferencedSpatialRegistrationSequence = copy.ReferencedSpatialRegistrationSequence; + InstanceNumber = copy.InstanceNumber; + DoseComment = copy.DoseComment; + NormalizationPoint = copy.NormalizationPoint; + DoseSummationType = copy.DoseSummationType; + ReferencedRTPlanSequence = copy.ReferencedRTPlanSequence; + ReferencedTreatmentRecordSequence = copy.ReferencedTreatmentRecordSequence; + GridFrameOffsetVector = copy.GridFrameOffsetVector; + DoseGridScaling = copy.DoseGridScaling; + TissueHeterogeneityCorrection = copy.TissueHeterogeneityCorrection; + DerivationCodeSequence = copy.DerivationCodeSequence; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + ReferencedStructureSetSequence = copy.ReferencedStructureSetSequence; + DVHNormalizationPoint = copy.DVHNormalizationPoint; + DVHNormalizationDoseValue = copy.DVHNormalizationDoseValue; + DVHSequence = copy.DVHSequence; + StructureSetLabel = copy.StructureSetLabel; + StructureSetName = copy.StructureSetName; + StructureSetDescription = copy.StructureSetDescription; + StructureSetDate = copy.StructureSetDate; + StructureSetTime = copy.StructureSetTime; + ReferencedFrameOfReferenceSequence = copy.ReferencedFrameOfReferenceSequence; + StructureSetROISequence = copy.StructureSetROISequence; + PredecessorStructureSetSequence = copy.PredecessorStructureSetSequence; + ROIContourSequence = copy.ROIContourSequence; + RTDoseROISequence = copy.RTDoseROISequence; + SOPClassUID = copy.SOPClassUID; + SOPInstanceUID = copy.SOPInstanceUID; + SpecificCharacterSet = copy.SpecificCharacterSet; + InstanceCreationDate = copy.InstanceCreationDate; + InstanceCreationTime = copy.InstanceCreationTime; + InstanceCoercionDateTime = copy.InstanceCoercionDateTime; + InstanceCreatorUID = copy.InstanceCreatorUID; + RelatedGeneralSOPClassUID = copy.RelatedGeneralSOPClassUID; + OriginalSpecializedSOPClassUID = copy.OriginalSpecializedSOPClassUID; + CodingSchemeIdentificationSequence = copy.CodingSchemeIdentificationSequence; + ContextGroupIdentificationSequence = copy.ContextGroupIdentificationSequence; + MappingResourceIdentificationSequence = copy.MappingResourceIdentificationSequence; + TimezoneOffsetFromUTC = copy.TimezoneOffsetFromUTC; + ContributingEquipmentSequence = copy.ContributingEquipmentSequence; + SOPInstanceStatus = copy.SOPInstanceStatus; + SOPAuthorizationDateTime = copy.SOPAuthorizationDateTime; + SOPAuthorizationComment = copy.SOPAuthorizationComment; + AuthorizationEquipmentCertificationNumber = copy.AuthorizationEquipmentCertificationNumber; + MACParametersSequence = copy.MACParametersSequence; + DigitalSignaturesSequence = copy.DigitalSignaturesSequence; + EncryptedAttributesSequence = copy.EncryptedAttributesSequence; + OriginalAttributesSequence = copy.OriginalAttributesSequence; + HL7StructuredDocumentReferenceSequence = copy.HL7StructuredDocumentReferenceSequence; + LongitudinalTemporalInformationModified = copy.LongitudinalTemporalInformationModified; + QueryRetrieveView = copy.QueryRetrieveView; + ConversionSourceAttributesSequence = copy.ConversionSourceAttributesSequence; + ContentQualification = copy.ContentQualification; + PrivateDataElementCharacteristicsSequence = copy.PrivateDataElementCharacteristicsSequence; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudiesContainingOtherReferencedInstancesSequence = copy.StudiesContainingOtherReferencedInstancesSequence; + FrameExtractionSequence = copy.FrameExtractionSequence; + } + return *this; +} + + +void DRTDoseIOD::clear() +{ + /* clear all DICOM attributes */ + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + PatientBirthDate.clear(); + PatientBirthDateInAlternativeCalendar.clear(); + PatientDeathDateInAlternativeCalendar.clear(); + PatientAlternativeCalendar.clear(); + PatientSex.clear(); + ReferencedPatientPhotoSequence.clear(); + QualityControlSubject.clear(); + ReferencedPatientSequence.clear(); + PatientBirthTime.clear(); + OtherPatientIDsSequence.clear(); + OtherPatientNames.clear(); + EthnicGroup.clear(); + PatientComments.clear(); + PatientSpeciesDescription.clear(); + PatientSpeciesCodeSequence.clear(); + PatientBreedDescription.clear(); + PatientBreedCodeSequence.clear(); + BreedRegistrationSequence.clear(); + StrainDescription.clear(); + StrainNomenclature.clear(); + StrainCodeSequence.clear(); + StrainAdditionalInformation.clear(); + StrainStockSequence.clear(); + GeneticModificationsSequence.clear(); + ResponsiblePerson.clear(); + ResponsiblePersonRole.clear(); + ResponsibleOrganization.clear(); + PatientIdentityRemoved.clear(); + DeidentificationMethod.clear(); + DeidentificationMethodCodeSequence.clear(); + SourcePatientGroupIdentificationSequence.clear(); + GroupOfPatientsIdentificationSequence.clear(); + ClinicalTrialSponsorName.clear(); + ClinicalTrialProtocolID.clear(); + ClinicalTrialProtocolName.clear(); + ClinicalTrialSiteID.clear(); + ClinicalTrialSiteName.clear(); + ClinicalTrialSubjectID.clear(); + ClinicalTrialSubjectReadingID.clear(); + ClinicalTrialProtocolEthicsCommitteeName.clear(); + ClinicalTrialProtocolEthicsCommitteeApprovalNumber.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + ReferringPhysicianIdentificationSequence.clear(); + ConsultingPhysicianName.clear(); + ConsultingPhysicianIdentificationSequence.clear(); + StudyID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyDescription.clear(); + PhysiciansOfRecord.clear(); + PhysiciansOfRecordIdentificationSequence.clear(); + NameOfPhysiciansReadingStudy.clear(); + PhysiciansReadingStudyIdentificationSequence.clear(); + RequestingServiceCodeSequence.clear(); + ReferencedStudySequence.clear(); + ProcedureCodeSequence.clear(); + ReasonForPerformedProcedureCodeSequence.clear(); + AdmittingDiagnosesDescription.clear(); + AdmittingDiagnosesCodeSequence.clear(); + PatientAge.clear(); + PatientSize.clear(); + PatientWeight.clear(); + PatientBodyMassIndex.clear(); + MeasuredAPDimension.clear(); + MeasuredLateralDimension.clear(); + PatientSizeCodeSequence.clear(); + MedicalAlerts.clear(); + Allergies.clear(); + SmokingStatus.clear(); + PregnancyStatus.clear(); + LastMenstrualDate.clear(); + PatientState.clear(); + Occupation.clear(); + AdditionalPatientHistory.clear(); + AdmissionID.clear(); + IssuerOfAdmissionIDSequence.clear(); + ServiceEpisodeID.clear(); + IssuerOfServiceEpisodeIDSequence.clear(); + ServiceEpisodeDescription.clear(); + PatientSexNeutered.clear(); + ClinicalTrialTimePointID.clear(); + ClinicalTrialTimePointDescription.clear(); + LongitudinalTemporalOffsetFromEvent.clear(); + LongitudinalTemporalEventType.clear(); + ConsentForClinicalTrialUseSequence.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + SeriesDescriptionCodeSequence.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ReferencedPerformedProcedureStepSequence.clear(); + RequestAttributesSequence.clear(); + PerformedProcedureStepID.clear(); + PerformedProcedureStepStartDate.clear(); + PerformedProcedureStepStartTime.clear(); + PerformedProcedureStepEndDate.clear(); + PerformedProcedureStepEndTime.clear(); + PerformedProcedureStepDescription.clear(); + PerformedProtocolCodeSequence.clear(); + CommentsOnThePerformedProcedureStep.clear(); + ClinicalTrialCoordinatingCenterName.clear(); + ClinicalTrialSeriesID.clear(); + ClinicalTrialSeriesDescription.clear(); + FrameOfReferenceUID.clear(); + PositionReferenceIndicator.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + GantryID.clear(); + UDISequence.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + PixelPaddingValue.clear(); + InstanceNumber.clear(); + PatientOrientation.clear(); + ContentDate.clear(); + ContentTime.clear(); + ImageType.clear(); + AcquisitionNumber.clear(); + AcquisitionDate.clear(); + AcquisitionTime.clear(); + AcquisitionDateTime.clear(); + ImagesInAcquisition.clear(); + ImageComments.clear(); + QualityControlImage.clear(); + BurnedInAnnotation.clear(); + RecognizableVisualFeatures.clear(); + LossyImageCompression.clear(); + LossyImageCompressionRatio.clear(); + LossyImageCompressionMethod.clear(); + IconImageSequence.clear(); + PresentationLUTShape.clear(); + IrradiationEventUID.clear(); + RealWorldValueMappingSequence.clear(); + PixelSpacing.clear(); + ImageOrientationPatient.clear(); + ImagePositionPatient.clear(); + SliceThickness.clear(); + SliceLocation.clear(); + SamplesPerPixel.clear(); + PhotometricInterpretation.clear(); + Rows.clear(); + Columns.clear(); + BitsAllocated.clear(); + BitsStored.clear(); + HighBit.clear(); + PixelRepresentation.clear(); + PlanarConfiguration.clear(); + PixelAspectRatio.clear(); + SmallestImagePixelValue.clear(); + LargestImagePixelValue.clear(); + RedPaletteColorLookupTableDescriptor.clear(); + GreenPaletteColorLookupTableDescriptor.clear(); + BluePaletteColorLookupTableDescriptor.clear(); + RedPaletteColorLookupTableData.clear(); + GreenPaletteColorLookupTableData.clear(); + BluePaletteColorLookupTableData.clear(); + ICCProfile.clear(); + ColorSpace.clear(); + PixelData.clear(); + PixelDataProviderURL.clear(); + PixelPaddingRangeLimit.clear(); + NumberOfFrames.clear(); + FrameIncrementPointer.clear(); + StereoPairsPresent.clear(); + OverlayRows.clear(); + OverlayColumns.clear(); + OverlayType.clear(); + OverlayOrigin.clear(); + OverlayBitsAllocated.clear(); + OverlayBitPosition.clear(); + OverlayData.clear(); + OverlayDescription.clear(); + OverlaySubtype.clear(); + OverlayLabel.clear(); + ROIArea.clear(); + ROIMean.clear(); + ROIStandardDeviation.clear(); + NumberOfFramesInOverlay.clear(); + ImageFrameOrigin.clear(); + ModalityLUTSequence.clear(); + RescaleIntercept.clear(); + RescaleSlope.clear(); + RescaleType.clear(); + DoseUnits.clear(); + DoseType.clear(); + SpatialTransformOfDose.clear(); + ReferencedSpatialRegistrationSequence.clear(); + DoseComment.clear(); + NormalizationPoint.clear(); + DoseSummationType.clear(); + ReferencedRTPlanSequence.clear(); + ReferencedTreatmentRecordSequence.clear(); + GridFrameOffsetVector.clear(); + DoseGridScaling.clear(); + TissueHeterogeneityCorrection.clear(); + DerivationCodeSequence.clear(); + ReferencedInstanceSequence.clear(); + ReferencedStructureSetSequence.clear(); + DVHNormalizationPoint.clear(); + DVHNormalizationDoseValue.clear(); + DVHSequence.clear(); + StructureSetLabel.clear(); + StructureSetName.clear(); + StructureSetDescription.clear(); + StructureSetDate.clear(); + StructureSetTime.clear(); + ReferencedFrameOfReferenceSequence.clear(); + StructureSetROISequence.clear(); + PredecessorStructureSetSequence.clear(); + ROIContourSequence.clear(); + RTDoseROISequence.clear(); + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCoercionDateTime.clear(); + InstanceCreatorUID.clear(); + RelatedGeneralSOPClassUID.clear(); + OriginalSpecializedSOPClassUID.clear(); + CodingSchemeIdentificationSequence.clear(); + ContextGroupIdentificationSequence.clear(); + MappingResourceIdentificationSequence.clear(); + TimezoneOffsetFromUTC.clear(); + ContributingEquipmentSequence.clear(); + SOPInstanceStatus.clear(); + SOPAuthorizationDateTime.clear(); + SOPAuthorizationComment.clear(); + AuthorizationEquipmentCertificationNumber.clear(); + MACParametersSequence.clear(); + DigitalSignaturesSequence.clear(); + EncryptedAttributesSequence.clear(); + OriginalAttributesSequence.clear(); + HL7StructuredDocumentReferenceSequence.clear(); + LongitudinalTemporalInformationModified.clear(); + QueryRetrieveView.clear(); + ConversionSourceAttributesSequence.clear(); + ContentQualification.clear(); + PrivateDataElementCharacteristicsSequence.clear(); + ReferencedSeriesSequence.clear(); + StudiesContainingOtherReferencedInstancesSequence.clear(); + FrameExtractionSequence.clear(); +} + + +OFBool DRTDoseIOD::isValid() +{ + /* tbd: check whether object is valid */ + return OFTrue; +} + + +OFCondition DRTDoseIOD::checkDatasetForReading(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* check SOP class UID */ + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + OFString tmpString; + getStringValueFromElement(sopClassUID, tmpString); + if (tmpString != UID_RTDoseStorage) + { + DCMRT_ERROR("Invalid value for attribute SOPClassUID (0008,0016)"); + result = RT_EC_InvalidValue; + } + } + return result; +} + + +void DRTDoseIOD::updateAttributes() +{ + SOPClassUID.putString(UID_RTDoseStorage); +} + + +OFCondition DRTDoseIOD::read(DcmItem &dataset) +{ + /* re-initialize object */ + clear(); + /* check SOP class UID first */ + OFCondition result = checkDatasetForReading(dataset); + /* read data from PatientIE, StudyIE, SeriesIE */ + if (result.good()) + result = readSeriesData(dataset); + if (result.good()) + { + // --- FrameOfReferenceModule (M) --- + getAndCheckElementFromDataset(dataset, FrameOfReferenceUID, "1", "1", "FrameOfReferenceModule"); + getAndCheckElementFromDataset(dataset, PositionReferenceIndicator, "1", "2", "FrameOfReferenceModule"); + + // --- GeneralEquipmentModule (M) --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionAddress, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, StationName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionalDepartmentName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, GantryID, "1", "3", "GeneralEquipmentModule"); + UDISequence.read(dataset, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SpatialResolution, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DateOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, TimeOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingValue, "1", "1C", "GeneralEquipmentModule"); + + // --- GeneralImageModule (C) --- + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "2", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, PatientOrientation, "2", "2C", "GeneralImageModule"); + // getAndCheckElementFromDataset(dataset, ContentDate, "1", "2C", "GeneralImageModule"); + // getAndCheckElementFromDataset(dataset, ContentTime, "1", "2C", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, ImageType, "2-n", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionNumber, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionDate, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionTime, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionDateTime, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, ImagesInAcquisition, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, ImageComments, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, QualityControlImage, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, BurnedInAnnotation, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, RecognizableVisualFeatures, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, LossyImageCompression, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, LossyImageCompressionRatio, "1-n", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, LossyImageCompressionMethod, "1-n", "3", "GeneralImageModule"); + IconImageSequence.read(dataset, "1-n", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, PresentationLUTShape, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, IrradiationEventUID, "1-n", "3", "GeneralImageModule"); + RealWorldValueMappingSequence.read(dataset, "1-n", "3", "GeneralImageModule"); + + // --- ImagePlaneModule (C) --- + if (dataset.tagExists(DCM_PixelSpacing) || + dataset.tagExists(DCM_ImageOrientationPatient) || + dataset.tagExists(DCM_ImagePositionPatient) || + dataset.tagExists(DCM_SliceThickness)) + { + getAndCheckElementFromDataset(dataset, PixelSpacing, "2", "1", "ImagePlaneModule"); + getAndCheckElementFromDataset(dataset, ImageOrientationPatient, "6", "1", "ImagePlaneModule"); + getAndCheckElementFromDataset(dataset, ImagePositionPatient, "3", "1", "ImagePlaneModule"); + getAndCheckElementFromDataset(dataset, SliceThickness, "1", "2", "ImagePlaneModule"); + getAndCheckElementFromDataset(dataset, SliceLocation, "1", "3", "ImagePlaneModule"); + } + + // --- ImagePixelModule (C) --- + if (dataset.tagExists(DCM_Rows) || + dataset.tagExists(DCM_Columns)) + { + // getAndCheckElementFromDataset(dataset, SamplesPerPixel, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, PhotometricInterpretation, "1", "1", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, Rows, "1", "1", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, Columns, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, BitsAllocated, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, BitsStored, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, HighBit, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, PixelRepresentation, "1", "1", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PlanarConfiguration, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelAspectRatio, "2", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, SmallestImagePixelValue, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, LargestImagePixelValue, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, RedPaletteColorLookupTableDescriptor, "3", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, GreenPaletteColorLookupTableDescriptor, "3", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, BluePaletteColorLookupTableDescriptor, "3", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, RedPaletteColorLookupTableData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, GreenPaletteColorLookupTableData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, BluePaletteColorLookupTableData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, ICCProfile, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, ColorSpace, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelDataProviderURL, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingRangeLimit, "1", "1C", "ImagePixelModule"); + } + + // --- MultiFrameModule (C) --- + if (dataset.tagExists(DCM_NumberOfFrames) || + dataset.tagExists(DCM_FrameIncrementPointer)) + { + getAndCheckElementFromDataset(dataset, NumberOfFrames, "1", "1", "MultiFrameModule"); + getAndCheckElementFromDataset(dataset, FrameIncrementPointer, "1-n", "1", "MultiFrameModule"); + getAndCheckElementFromDataset(dataset, StereoPairsPresent, "1", "3", "MultiFrameModule"); + } + + // --- OverlayPlaneModule (U) --- + if (dataset.tagExists(DCM_OverlayRows) || + dataset.tagExists(DCM_OverlayColumns) || + dataset.tagExists(DCM_OverlayType) || + dataset.tagExists(DCM_OverlayOrigin) || + dataset.tagExists(DCM_OverlayBitsAllocated) || + dataset.tagExists(DCM_OverlayBitPosition) || + dataset.tagExists(DCM_OverlayData)) + { + getAndCheckElementFromDataset(dataset, OverlayRows, "1", "1", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayColumns, "1", "1", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayType, "1", "1", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayOrigin, "2", "1", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayBitsAllocated, "1", "1", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayBitPosition, "1", "1", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayData, "1", "1", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayDescription, "1", "3", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlaySubtype, "1", "3", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, OverlayLabel, "1", "3", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, ROIArea, "1", "3", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, ROIMean, "1", "3", "OverlayPlaneModule"); + getAndCheckElementFromDataset(dataset, ROIStandardDeviation, "1", "3", "OverlayPlaneModule"); + } + + // --- MultiFrameOverlayModule (U) --- + if (dataset.tagExists(DCM_NumberOfFramesInOverlay)) + { + getAndCheckElementFromDataset(dataset, NumberOfFramesInOverlay, "1", "1", "MultiFrameOverlayModule"); + getAndCheckElementFromDataset(dataset, ImageFrameOrigin, "1", "3", "MultiFrameOverlayModule"); + } + + // --- ModalityLUTModule (U) --- + ModalityLUTSequence.read(dataset, "1-n", "1C", "ModalityLUTModule"); + getAndCheckElementFromDataset(dataset, RescaleIntercept, "1", "1C", "ModalityLUTModule"); + getAndCheckElementFromDataset(dataset, RescaleSlope, "1", "1C", "ModalityLUTModule"); + getAndCheckElementFromDataset(dataset, RescaleType, "1", "1C", "ModalityLUTModule"); + + // --- RTDoseModule (M) --- + getAndCheckElementFromDataset(dataset, SamplesPerPixel, "1", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, PhotometricInterpretation, "1", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, BitsAllocated, "1", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, BitsStored, "1", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, HighBit, "1", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, PixelRepresentation, "1", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, ContentDate, "1", "3", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, ContentTime, "1", "3", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, DoseUnits, "1", "1", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, DoseType, "1", "1", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, SpatialTransformOfDose, "1", "3", "RTDoseModule"); + ReferencedSpatialRegistrationSequence.read(dataset, "1-n", "2C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, DoseComment, "1", "3", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, NormalizationPoint, "3", "3", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, DoseSummationType, "1", "1", "RTDoseModule"); + ReferencedRTPlanSequence.read(dataset, "1-n", "1C", "RTDoseModule"); + ReferencedTreatmentRecordSequence.read(dataset, "1-n", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, GridFrameOffsetVector, "2-n", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, DoseGridScaling, "1", "1C", "RTDoseModule"); + getAndCheckElementFromDataset(dataset, TissueHeterogeneityCorrection, "1-3", "3", "RTDoseModule"); + DerivationCodeSequence.read(dataset, "1-n", "3", "RTDoseModule"); + ReferencedInstanceSequence.read(dataset, "1-n", "3", "RTDoseModule"); + + // --- RTDVHModule (U) --- + if (dataset.tagExists(DCM_ReferencedStructureSetSequence) || + dataset.tagExists(DCM_DVHSequence)) + { + ReferencedStructureSetSequence.read(dataset, "1-n", "1", "RTDVHModule"); + getAndCheckElementFromDataset(dataset, DVHNormalizationPoint, "3", "3", "RTDVHModule"); + getAndCheckElementFromDataset(dataset, DVHNormalizationDoseValue, "1", "3", "RTDVHModule"); + DVHSequence.read(dataset, "1-n", "1", "RTDVHModule"); + } + + // --- StructureSetModule (C) --- + if (dataset.tagExists(DCM_StructureSetLabel) || + dataset.tagExists(DCM_StructureSetDate) || + dataset.tagExists(DCM_StructureSetTime) || + dataset.tagExists(DCM_StructureSetROISequence)) + { + getAndCheckElementFromDataset(dataset, StructureSetLabel, "1", "1", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetName, "1", "3", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetDescription, "1", "3", "StructureSetModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetDate, "1", "2", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetTime, "1", "2", "StructureSetModule"); + ReferencedFrameOfReferenceSequence.read(dataset, "1-n", "3", "StructureSetModule"); + StructureSetROISequence.read(dataset, "1-n", "1", "StructureSetModule"); + PredecessorStructureSetSequence.read(dataset, "1-n", "3", "StructureSetModule"); + } + + // --- ROIContourModule (C) --- + if (dataset.tagExists(DCM_ROIContourSequence)) + { + ROIContourSequence.read(dataset, "1-n", "1", "ROIContourModule"); + } + + // --- RTDoseROIModule (C) --- + if (dataset.tagExists(DCM_RTDoseROISequence)) + { + RTDoseROISequence.read(dataset, "1-n", "1", "RTDoseROIModule"); + } + + // --- SOPCommonModule (M) --- + getAndCheckElementFromDataset(dataset, SOPClassUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCoercionDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, RelatedGeneralSOPClassUID, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, OriginalSpecializedSOPClassUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + ContextGroupIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + MappingResourceIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + ContributingEquipmentSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceStatus, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationComment, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, AuthorizationEquipmentCertificationNumber, "1", "3", "SOPCommonModule"); + MACParametersSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + DigitalSignaturesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + EncryptedAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + OriginalAttributesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + HL7StructuredDocumentReferenceSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalInformationModified, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, QueryRetrieveView, "1", "1C", "SOPCommonModule"); + ConversionSourceAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, ContentQualification, "1", "3", "SOPCommonModule"); + PrivateDataElementCharacteristicsSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + ReferencedSeriesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + StudiesContainingOtherReferencedInstancesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + + // --- FrameExtractionModule (C) --- + if (dataset.tagExists(DCM_FrameExtractionSequence)) + { + FrameExtractionSequence.read(dataset, "1-n", "1", "FrameExtractionModule"); + } + } + return result; +} + + +OFCondition DRTDoseIOD::readPatientData(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + + // --- PatientModule (M) --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + IssuerOfPatientIDQualifiersSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientDeathDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientAlternativeCalendar, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + ReferencedPatientPhotoSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, QualityControlSubject, "1", "3", "PatientModule"); + ReferencedPatientSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthTime, "1", "3", "PatientModule"); + OtherPatientIDsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, OtherPatientNames, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, EthnicGroup, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientComments, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSpeciesDescription, "1", "1C", "PatientModule"); + PatientSpeciesCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBreedDescription, "1", "2C", "PatientModule"); + PatientBreedCodeSequence.read(dataset, "1-n", "2C", "PatientModule"); + BreedRegistrationSequence.read(dataset, "1-n", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainDescription, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainNomenclature, "1", "3", "PatientModule"); + StrainCodeSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainAdditionalInformation, "1", "3", "PatientModule"); + StrainStockSequence.read(dataset, "1-n", "3", "PatientModule"); + GeneticModificationsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePerson, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePersonRole, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsibleOrganization, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientIdentityRemoved, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, DeidentificationMethod, "1-n", "1C", "PatientModule"); + DeidentificationMethodCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + SourcePatientGroupIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + GroupOfPatientsIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialSponsorName) || + dataset.tagExists(DCM_ClinicalTrialProtocolID) || + dataset.tagExists(DCM_ClinicalTrialProtocolName) || + dataset.tagExists(DCM_ClinicalTrialSiteID) || + dataset.tagExists(DCM_ClinicalTrialSiteName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialSponsorName, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolID, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteID, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectReadingID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeName, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeApprovalNumber, "1", "3", "ClinicalTrialSubjectModule"); + } + return result; +} + + +OFCondition DRTDoseIOD::readStudyData(DcmItem &dataset) +{ + /* read data from PatientIE */ + OFCondition result = readPatientData(dataset); + if (result.good()) + { + // --- GeneralStudyModule (M) --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + ReferringPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ConsultingPhysicianName, "1-n", "3", "GeneralStudyModule"); + ConsultingPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + IssuerOfAccessionNumberSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, PhysiciansOfRecord, "1-n", "3", "GeneralStudyModule"); + PhysiciansOfRecordIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, NameOfPhysiciansReadingStudy, "1-n", "3", "GeneralStudyModule"); + PhysiciansReadingStudyIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + RequestingServiceCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReferencedStudySequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReasonForPerformedProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + getAndCheckElementFromDataset(dataset, AdmittingDiagnosesDescription, "1-n", "3", "PatientStudyModule"); + AdmittingDiagnosesCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientAge, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSize, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientWeight, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientBodyMassIndex, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredAPDimension, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredLateralDimension, "1", "3", "PatientStudyModule"); + PatientSizeCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MedicalAlerts, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Allergies, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, SmokingStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PregnancyStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, LastMenstrualDate, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientState, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Occupation, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdditionalPatientHistory, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdmissionID, "1", "3", "PatientStudyModule"); + IssuerOfAdmissionIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeID, "1", "3", "PatientStudyModule"); + IssuerOfServiceEpisodeIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeDescription, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSexNeutered, "1", "2C", "PatientStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialTimePointID)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointID, "1", "2", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointDescription, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalOffsetFromEvent, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalEventType, "1", "1C", "ClinicalTrialStudyModule"); + ConsentForClinicalTrialUseSequence.read(dataset, "1-n", "3", "ClinicalTrialStudyModule"); + } + } + return result; +} + + +OFCondition DRTDoseIOD::readSeriesData(DcmItem &dataset) +{ + /* read data from PatientIE, StudyIE */ + OFCondition result = readStudyData(dataset); + if (result.good()) + { + // --- RTSeriesModule (M) --- + getAndCheckElementFromDataset(dataset, Modality, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "2", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "RTSeriesModule"); + SeriesDescriptionCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, OperatorsName, "1-n", "2", "RTSeriesModule"); + OperatorIdentificationSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + ReferencedPerformedProcedureStepSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + RequestAttributesSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepID, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepDescription, "1", "3", "RTSeriesModule"); + PerformedProtocolCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, CommentsOnThePerformedProcedureStep, "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialCoordinatingCenterName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialCoordinatingCenterName, "1", "2", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesID, "1", "3", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesDescription, "1", "3", "ClinicalTrialSeriesModule"); + } + } + return result; +} + + +OFCondition DRTDoseIOD::write(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* only write valid objects */ + if (isValid()) + { + /* update various DICOM attributes */ + updateAttributes(); + + // --- PatientModule (M) --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBirthDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientDeathDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientAlternativeCalendar), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + if (result.good()) result = ReferencedPatientPhotoSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlSubject), "1", "3", "PatientModule"); + if (result.good()) result = ReferencedPatientSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmTime(PatientBirthTime), "1", "3", "PatientModule"); + if (result.good()) result = OtherPatientIDsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(OtherPatientNames), "1-n", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmShortString(EthnicGroup), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongText(PatientComments), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientSpeciesDescription), "1", "1C", "PatientModule"); + if (result.good()) result = PatientSpeciesCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBreedDescription), "1", "2C", "PatientModule"); + if (result.good()) result = PatientBreedCodeSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + if (result.good()) result = BreedRegistrationSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedCharacters(StrainDescription), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(StrainNomenclature), "1", "3", "PatientModule"); + if (result.good()) result = StrainCodeSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedText(StrainAdditionalInformation), "1", "3", "PatientModule"); + if (result.good()) result = StrainStockSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GeneticModificationsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(ResponsiblePerson), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(ResponsiblePersonRole), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(ResponsibleOrganization), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientIdentityRemoved), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(DeidentificationMethod), "1-n", "1C", "PatientModule"); + if (result.good()) result = DeidentificationMethodCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + if (result.good()) result = SourcePatientGroupIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GroupOfPatientsIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (isClinicalTrialSubjectModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSponsorName), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolID), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteID), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectReadingID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeName), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeApprovalNumber), "1", "3", "ClinicalTrialSubjectModule"); + } + + // --- GeneralStudyModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + if (result.good()) result = ReferringPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ConsultingPhysicianName), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = ConsultingPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(PhysiciansOfRecord), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansOfRecordIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(NameOfPhysiciansReadingStudy), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansReadingStudyIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = RequestingServiceCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReferencedStudySequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReasonForPerformedProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + if (isPatientStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(AdmittingDiagnosesDescription), "1-n", "3", "PatientStudyModule"); + if (result.good()) result = AdmittingDiagnosesCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmAgeString(PatientAge), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSize), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientWeight), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientBodyMassIndex), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredAPDimension), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredLateralDimension), "1", "3", "PatientStudyModule"); + if (result.good()) result = PatientSizeCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(MedicalAlerts), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(Allergies), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(SmokingStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PregnancyStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDate(LastMenstrualDate), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientState), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(Occupation), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongText(AdditionalPatientHistory), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(AdmissionID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfAdmissionIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfServiceEpisodeIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeDescription), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSexNeutered), "1", "2C", "PatientStudyModule"); + } + + // --- ClinicalTrialStudyModule (U) --- + if (isClinicalTrialStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialTimePointID), "1", "2", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmShortText(ClinicalTrialTimePointDescription), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(LongitudinalTemporalOffsetFromEvent), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalEventType), "1", "1C", "ClinicalTrialStudyModule"); + if (result.good()) result = ConsentForClinicalTrialUseSequence.write(dataset, "1-n" ,"3", "ClinicalTrialStudyModule"); + } + + // --- RTSeriesModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "2", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = SeriesDescriptionCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmPersonName(OperatorsName), "1-n", "2", "RTSeriesModule"); + if (result.good()) result = OperatorIdentificationSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = ReferencedPerformedProcedureStepSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = RequestAttributesSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortString(PerformedProcedureStepID), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepStartDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepStartTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepEndDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepEndTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(PerformedProcedureStepDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = PerformedProtocolCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortText(CommentsOnThePerformedProcedureStep), "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (isClinicalTrialSeriesModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialCoordinatingCenterName), "1", "2", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesID), "1", "3", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesDescription), "1", "3", "ClinicalTrialSeriesModule"); + } + + // --- FrameOfReferenceModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(FrameOfReferenceUID), "1", "1", "FrameOfReferenceModule"); + addElementToDataset(result, dataset, new DcmLongString(PositionReferenceIndicator), "1", "2", "FrameOfReferenceModule"); + + // --- GeneralEquipmentModule (M) --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortText(InstitutionAddress), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortString(StationName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionalDepartmentName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(GantryID), "1", "3", "GeneralEquipmentModule"); + if (result.good()) result = UDISequence.write(dataset, "1-n" ,"3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SpatialResolution), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDate(DateOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmTime(TimeOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingValue), "1", "1C", "GeneralEquipmentModule"); + + // --- GeneralImageModule (C) --- + if (isGeneralImageModulePresent(OFFalse /*complete*/)) + { + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "2", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientOrientation), "2", "2C", "GeneralImageModule"); + // addElementToDataset(result, dataset, new DcmDate(ContentDate), "1", "2C", "GeneralImageModule"); + // addElementToDataset(result, dataset, new DcmTime(ContentTime), "1", "2C", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(ImageType), "2-n", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(AcquisitionNumber), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmDate(AcquisitionDate), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmTime(AcquisitionTime), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmDateTime(AcquisitionDateTime), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(ImagesInAcquisition), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmLongText(ImageComments), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlImage), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(BurnedInAnnotation), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(RecognizableVisualFeatures), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(LossyImageCompression), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(LossyImageCompressionRatio), "1-n", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(LossyImageCompressionMethod), "1-n", "3", "GeneralImageModule"); + if (result.good()) result = IconImageSequence.write(dataset, "1-n" ,"3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PresentationLUTShape), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(IrradiationEventUID), "1-n", "3", "GeneralImageModule"); + if (result.good()) result = RealWorldValueMappingSequence.write(dataset, "1-n" ,"3", "GeneralImageModule"); + } + + // --- ImagePlaneModule (C) --- + if (isImagePlaneModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmDecimalString(PixelSpacing), "2", "1", "ImagePlaneModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ImageOrientationPatient), "6", "1", "ImagePlaneModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ImagePositionPatient), "3", "1", "ImagePlaneModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SliceThickness), "1", "2", "ImagePlaneModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SliceLocation), "1", "3", "ImagePlaneModule"); + } + + // --- ImagePixelModule (C) --- + if (isImagePixelModulePresent(OFFalse /*complete*/)) + { + // addElementToDataset(result, dataset, new DcmUnsignedShort(SamplesPerPixel), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmCodeString(PhotometricInterpretation), "1", "1", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(Rows), "1", "1", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(Columns), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(BitsAllocated), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(BitsStored), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(HighBit), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(PixelRepresentation), "1", "1", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PlanarConfiguration), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmIntegerString(PixelAspectRatio), "2", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(SmallestImagePixelValue), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(LargestImagePixelValue), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(RedPaletteColorLookupTableDescriptor), "3", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(GreenPaletteColorLookupTableDescriptor), "3", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(BluePaletteColorLookupTableDescriptor), "3", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(RedPaletteColorLookupTableData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(GreenPaletteColorLookupTableData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(BluePaletteColorLookupTableData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(ICCProfile), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmCodeString(ColorSpace), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmPixelData(PixelData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUniversalResourceIdentifierOrLocator(PixelDataProviderURL), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingRangeLimit), "1", "1C", "ImagePixelModule"); + } + + // --- MultiFrameModule (C) --- + if (isMultiFrameModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmIntegerString(NumberOfFrames), "1", "1", "MultiFrameModule"); + addElementToDataset(result, dataset, new DcmAttributeTag(FrameIncrementPointer), "1-n", "1", "MultiFrameModule"); + addElementToDataset(result, dataset, new DcmCodeString(StereoPairsPresent), "1", "3", "MultiFrameModule"); + } + + // --- OverlayPlaneModule (U) --- + if (isOverlayPlaneModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmUnsignedShort(OverlayRows), "1", "1", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(OverlayColumns), "1", "1", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmCodeString(OverlayType), "1", "1", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmSignedShort(OverlayOrigin), "2", "1", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(OverlayBitsAllocated), "1", "1", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(OverlayBitPosition), "1", "1", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(OverlayData), "1", "1", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmLongString(OverlayDescription), "1", "3", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmLongString(OverlaySubtype), "1", "3", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmLongString(OverlayLabel), "1", "3", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmIntegerString(ROIArea), "1", "3", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ROIMean), "1", "3", "OverlayPlaneModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ROIStandardDeviation), "1", "3", "OverlayPlaneModule"); + } + + // --- MultiFrameOverlayModule (U) --- + if (isMultiFrameOverlayModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmIntegerString(NumberOfFramesInOverlay), "1", "1", "MultiFrameOverlayModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(ImageFrameOrigin), "1", "3", "MultiFrameOverlayModule"); + } + + // --- ModalityLUTModule (U) --- + if (isModalityLUTModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ModalityLUTSequence.write(dataset, "1-n" ,"1C", "ModalityLUTModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RescaleIntercept), "1", "1C", "ModalityLUTModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RescaleSlope), "1", "1C", "ModalityLUTModule"); + addElementToDataset(result, dataset, new DcmLongString(RescaleType), "1", "1C", "ModalityLUTModule"); + } + + // --- RTDoseModule (M) --- + addElementToDataset(result, dataset, new DcmUnsignedShort(SamplesPerPixel), "1", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmCodeString(PhotometricInterpretation), "1", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(BitsAllocated), "1", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(BitsStored), "1", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(HighBit), "1", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelRepresentation), "1", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmDate(ContentDate), "1", "3", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmTime(ContentTime), "1", "3", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmCodeString(DoseUnits), "1", "1", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmCodeString(DoseType), "1", "1", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpatialTransformOfDose), "1", "3", "RTDoseModule"); + if (result.good()) result = ReferencedSpatialRegistrationSequence.write(dataset, "1-n" ,"2C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmLongString(DoseComment), "1", "3", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmDecimalString(NormalizationPoint), "3", "3", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmCodeString(DoseSummationType), "1", "1", "RTDoseModule"); + if (result.good()) result = ReferencedRTPlanSequence.write(dataset, "1-n" ,"1C", "RTDoseModule"); + if (result.good()) result = ReferencedTreatmentRecordSequence.write(dataset, "1-n" ,"1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmDecimalString(GridFrameOffsetVector), "2-n", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmDecimalString(DoseGridScaling), "1", "1C", "RTDoseModule"); + addElementToDataset(result, dataset, new DcmCodeString(TissueHeterogeneityCorrection), "1-3", "3", "RTDoseModule"); + if (result.good()) result = DerivationCodeSequence.write(dataset, "1-n" ,"3", "RTDoseModule"); + if (result.good()) result = ReferencedInstanceSequence.write(dataset, "1-n" ,"3", "RTDoseModule"); + + // --- RTDVHModule (U) --- + if (isRTDVHModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedStructureSetSequence.write(dataset, "1-n" ,"1", "RTDVHModule"); + addElementToDataset(result, dataset, new DcmDecimalString(DVHNormalizationPoint), "3", "3", "RTDVHModule"); + addElementToDataset(result, dataset, new DcmDecimalString(DVHNormalizationDoseValue), "1", "3", "RTDVHModule"); + if (result.good()) result = DVHSequence.write(dataset, "1-n" ,"1", "RTDVHModule"); + } + + // --- StructureSetModule (C) --- + if (isStructureSetModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmShortString(StructureSetLabel), "1", "1", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmLongString(StructureSetName), "1", "3", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmShortText(StructureSetDescription), "1", "3", "StructureSetModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmDate(StructureSetDate), "1", "2", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmTime(StructureSetTime), "1", "2", "StructureSetModule"); + if (result.good()) result = ReferencedFrameOfReferenceSequence.write(dataset, "1-n" ,"3", "StructureSetModule"); + if (result.good()) result = StructureSetROISequence.write(dataset, "1-n" ,"1", "StructureSetModule"); + if (result.good()) result = PredecessorStructureSetSequence.write(dataset, "1-n" ,"3", "StructureSetModule"); + } + + // --- ROIContourModule (C) --- + if (isROIContourModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ROIContourSequence.write(dataset, "1-n" ,"1", "ROIContourModule"); + } + + // --- RTDoseROIModule (C) --- + if (isRTDoseROIModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = RTDoseROISequence.write(dataset, "1-n" ,"1", "RTDoseROIModule"); + } + + // --- SOPCommonModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(InstanceCoercionDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(RelatedGeneralSOPClassUID), "1-n", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(OriginalSpecializedSOPClassUID), "1", "3", "SOPCommonModule"); + if (result.good()) result = CodingSchemeIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = ContextGroupIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = MappingResourceIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + if (result.good()) result = ContributingEquipmentSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SOPInstanceStatus), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(SOPAuthorizationDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongText(SOPAuthorizationComment), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongString(AuthorizationEquipmentCertificationNumber), "1", "3", "SOPCommonModule"); + if (result.good()) result = MACParametersSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = DigitalSignaturesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = EncryptedAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + if (result.good()) result = OriginalAttributesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = HL7StructuredDocumentReferenceSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalInformationModified), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(QueryRetrieveView), "1", "1C", "SOPCommonModule"); + if (result.good()) result = ConversionSourceAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContentQualification), "1", "3", "SOPCommonModule"); + if (result.good()) result = PrivateDataElementCharacteristicsSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + if (isCommonInstanceReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedSeriesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + if (result.good()) result = StudiesContainingOtherReferencedInstancesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + } + + // --- FrameExtractionModule (C) --- + if (isFrameExtractionModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = FrameExtractionSequence.write(dataset, "1-n" ,"1", "FrameExtractionModule"); + } + } else + result = RT_EC_InvalidObject; + return result; +} + + +OFBool DRTDoseIOD::isClinicalTrialSubjectModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ClinicalTrialSponsorName.isEmpty() && + !ClinicalTrialProtocolID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ClinicalTrialSponsorName.isEmpty() || + !ClinicalTrialProtocolID.isEmpty() || + !ClinicalTrialProtocolName.isEmpty() || + !ClinicalTrialSiteID.isEmpty() || + !ClinicalTrialSiteName.isEmpty() || + !ClinicalTrialSubjectID.isEmpty() || + !ClinicalTrialSubjectReadingID.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeName.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeApprovalNumber.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isPatientStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !AdmittingDiagnosesDescription.isEmpty() || + !AdmittingDiagnosesCodeSequence.isEmpty() || + !PatientAge.isEmpty() || + !PatientSize.isEmpty() || + !PatientWeight.isEmpty() || + !PatientBodyMassIndex.isEmpty() || + !MeasuredAPDimension.isEmpty() || + !MeasuredLateralDimension.isEmpty() || + !PatientSizeCodeSequence.isEmpty() || + !MedicalAlerts.isEmpty() || + !Allergies.isEmpty() || + !SmokingStatus.isEmpty() || + !PregnancyStatus.isEmpty() || + !LastMenstrualDate.isEmpty() || + !PatientState.isEmpty() || + !Occupation.isEmpty() || + !AdditionalPatientHistory.isEmpty() || + !AdmissionID.isEmpty() || + !IssuerOfAdmissionIDSequence.isEmpty() || + !ServiceEpisodeID.isEmpty() || + !IssuerOfServiceEpisodeIDSequence.isEmpty() || + !ServiceEpisodeDescription.isEmpty() || + !PatientSexNeutered.isEmpty(); +} + + +OFBool DRTDoseIOD::isClinicalTrialStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialTimePointID.isEmpty() || + !ClinicalTrialTimePointDescription.isEmpty() || + !LongitudinalTemporalOffsetFromEvent.isEmpty() || + !LongitudinalTemporalEventType.isEmpty() || + !ConsentForClinicalTrialUseSequence.isEmpty(); +} + + +OFBool DRTDoseIOD::isClinicalTrialSeriesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialCoordinatingCenterName.isEmpty() || + !ClinicalTrialSeriesID.isEmpty() || + !ClinicalTrialSeriesDescription.isEmpty(); +} + + +OFBool DRTDoseIOD::isGeneralImageModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !PatientOrientation.isEmpty() || + !ImageType.isEmpty() || + !AcquisitionNumber.isEmpty() || + !AcquisitionDate.isEmpty() || + !AcquisitionTime.isEmpty() || + !AcquisitionDateTime.isEmpty() || + !ImagesInAcquisition.isEmpty() || + !ImageComments.isEmpty() || + !QualityControlImage.isEmpty() || + !BurnedInAnnotation.isEmpty() || + !RecognizableVisualFeatures.isEmpty() || + !LossyImageCompression.isEmpty() || + !LossyImageCompressionRatio.isEmpty() || + !LossyImageCompressionMethod.isEmpty() || + !IconImageSequence.isEmpty() || + !PresentationLUTShape.isEmpty() || + !IrradiationEventUID.isEmpty() || + !RealWorldValueMappingSequence.isEmpty(); +} + + +OFBool DRTDoseIOD::isImagePlaneModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !PixelSpacing.isEmpty() && + !ImageOrientationPatient.isEmpty() && + !ImagePositionPatient.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !PixelSpacing.isEmpty() || + !ImageOrientationPatient.isEmpty() || + !ImagePositionPatient.isEmpty() || + !SliceThickness.isEmpty() || + !SliceLocation.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isImagePixelModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !Rows.isEmpty() && + !Columns.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !Rows.isEmpty() || + !Columns.isEmpty() || + !PlanarConfiguration.isEmpty() || + !PixelAspectRatio.isEmpty() || + !SmallestImagePixelValue.isEmpty() || + !LargestImagePixelValue.isEmpty() || + !RedPaletteColorLookupTableDescriptor.isEmpty() || + !GreenPaletteColorLookupTableDescriptor.isEmpty() || + !BluePaletteColorLookupTableDescriptor.isEmpty() || + !RedPaletteColorLookupTableData.isEmpty() || + !GreenPaletteColorLookupTableData.isEmpty() || + !BluePaletteColorLookupTableData.isEmpty() || + !ICCProfile.isEmpty() || + !ColorSpace.isEmpty() || + !PixelData.isEmpty() || + !PixelDataProviderURL.isEmpty() || + !PixelPaddingRangeLimit.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isMultiFrameModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !NumberOfFrames.isEmpty() && + !FrameIncrementPointer.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !NumberOfFrames.isEmpty() || + !FrameIncrementPointer.isEmpty() || + !StereoPairsPresent.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isOverlayPlaneModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !OverlayRows.isEmpty() && + !OverlayColumns.isEmpty() && + !OverlayType.isEmpty() && + !OverlayOrigin.isEmpty() && + !OverlayBitsAllocated.isEmpty() && + !OverlayBitPosition.isEmpty() && + !OverlayData.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !OverlayRows.isEmpty() || + !OverlayColumns.isEmpty() || + !OverlayType.isEmpty() || + !OverlayOrigin.isEmpty() || + !OverlayBitsAllocated.isEmpty() || + !OverlayBitPosition.isEmpty() || + !OverlayData.isEmpty() || + !OverlayDescription.isEmpty() || + !OverlaySubtype.isEmpty() || + !OverlayLabel.isEmpty() || + !ROIArea.isEmpty() || + !ROIMean.isEmpty() || + !ROIStandardDeviation.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isMultiFrameOverlayModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !NumberOfFramesInOverlay.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !NumberOfFramesInOverlay.isEmpty() || + !ImageFrameOrigin.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isModalityLUTModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ModalityLUTSequence.isEmpty() || + !RescaleIntercept.isEmpty() || + !RescaleSlope.isEmpty() || + !RescaleType.isEmpty(); +} + + +OFBool DRTDoseIOD::isRTDVHModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ReferencedStructureSetSequence.isEmpty() && + !DVHSequence.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ReferencedStructureSetSequence.isEmpty() || + !DVHNormalizationPoint.isEmpty() || + !DVHNormalizationDoseValue.isEmpty() || + !DVHSequence.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isStructureSetModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !StructureSetLabel.isEmpty() && + !StructureSetROISequence.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !StructureSetLabel.isEmpty() || + !StructureSetName.isEmpty() || + !StructureSetDescription.isEmpty() || + !StructureSetDate.isEmpty() || + !StructureSetTime.isEmpty() || + !ReferencedFrameOfReferenceSequence.isEmpty() || + !StructureSetROISequence.isEmpty() || + !PredecessorStructureSetSequence.isEmpty(); + } +} + + +OFBool DRTDoseIOD::isROIContourModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ROIContourSequence.isEmpty(); +} + + +OFBool DRTDoseIOD::isRTDoseROIModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !RTDoseROISequence.isEmpty(); +} + + +OFBool DRTDoseIOD::isCommonInstanceReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedSeriesSequence.isEmpty() || + !StudiesContainingOtherReferencedInstancesSequence.isEmpty(); +} + + +OFBool DRTDoseIOD::isFrameExtractionModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !FrameExtractionSequence.isEmpty(); +} + + +OFCondition DRTDoseIOD::getAccessionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTDoseIOD::getAcquisitionDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionDate, value, pos); +} + + +OFCondition DRTDoseIOD::getAcquisitionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionDateTime, value, pos); +} + + +OFCondition DRTDoseIOD::getAcquisitionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionNumber, value, pos); +} + + +OFCondition DRTDoseIOD::getAcquisitionNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, AcquisitionNumber).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getAcquisitionTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionTime, value, pos); +} + + +OFCondition DRTDoseIOD::getAdditionalPatientHistory(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdditionalPatientHistory, value, pos); +} + + +OFCondition DRTDoseIOD::getAdmissionID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmissionID, value, pos); +} + + +OFCondition DRTDoseIOD::getAdmittingDiagnosesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmittingDiagnosesDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getAllergies(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Allergies, value, pos); +} + + +OFCondition DRTDoseIOD::getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AuthorizationEquipmentCertificationNumber, value, pos); +} + + +OFCondition DRTDoseIOD::getBitsAllocated(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, BitsAllocated).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getBitsStored(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, BitsStored).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getBluePaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, BluePaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, BluePaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + return result; +} + + +OFCondition DRTDoseIOD::getBluePaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, BluePaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getBurnedInAnnotation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(BurnedInAnnotation, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialCoordinatingCenterName, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeApprovalNumber, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeName, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialProtocolName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolName, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialSeriesID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesID, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialSiteID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteID, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialSiteName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteName, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialSponsorName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSponsorName, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialSubjectID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectID, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialSubjectReadingID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectReadingID, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialTimePointDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getClinicalTrialTimePointID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointID, value, pos); +} + + +OFCondition DRTDoseIOD::getColorSpace(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ColorSpace, value, pos); +} + + +OFCondition DRTDoseIOD::getColumns(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, Columns).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CommentsOnThePerformedProcedureStep, value, pos); +} + + +OFCondition DRTDoseIOD::getConsultingPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConsultingPhysicianName, value, pos); +} + + +OFCondition DRTDoseIOD::getContentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentDate, value, pos); +} + + +OFCondition DRTDoseIOD::getContentQualification(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentQualification, value, pos); +} + + +OFCondition DRTDoseIOD::getContentTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentTime, value, pos); +} + + +OFCondition DRTDoseIOD::getDVHNormalizationDoseValue(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DVHNormalizationDoseValue, value, pos); +} + + +OFCondition DRTDoseIOD::getDVHNormalizationDoseValue(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, DVHNormalizationDoseValue).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getDVHNormalizationPoint(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DVHNormalizationPoint, value, pos); +} + + +OFCondition DRTDoseIOD::getDVHNormalizationPoint(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, DVHNormalizationPoint).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getDVHNormalizationPoint(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, DVHNormalizationPoint).getFloat64Vector(value); +} + + +OFCondition DRTDoseIOD::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTDoseIOD::getDeidentificationMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeidentificationMethod, value, pos); +} + + +OFCondition DRTDoseIOD::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTDoseIOD::getDoseComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DoseComment, value, pos); +} + + +OFCondition DRTDoseIOD::getDoseGridScaling(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DoseGridScaling, value, pos); +} + + +OFCondition DRTDoseIOD::getDoseGridScaling(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, DoseGridScaling).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getDoseSummationType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DoseSummationType, value, pos); +} + + +OFCondition DRTDoseIOD::getDoseType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DoseType, value, pos); +} + + +OFCondition DRTDoseIOD::getDoseUnits(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DoseUnits, value, pos); +} + + +OFCondition DRTDoseIOD::getEthnicGroup(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EthnicGroup, value, pos); +} + + +OFCondition DRTDoseIOD::getFrameIncrementPointer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameIncrementPointer, value, pos); +} + + +OFCondition DRTDoseIOD::getFrameOfReferenceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameOfReferenceUID, value, pos); +} + + +OFCondition DRTDoseIOD::getGantryID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryID, value, pos); +} + + +OFCondition DRTDoseIOD::getGreenPaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, GreenPaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, GreenPaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + return result; +} + + +OFCondition DRTDoseIOD::getGreenPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, GreenPaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getGridFrameOffsetVector(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GridFrameOffsetVector, value, pos); +} + + +OFCondition DRTDoseIOD::getGridFrameOffsetVector(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, GridFrameOffsetVector).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getGridFrameOffsetVector(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, GridFrameOffsetVector).getFloat64Vector(value); +} + + +OFCondition DRTDoseIOD::getHighBit(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, HighBit).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getICCProfile(Uint8 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, ICCProfile).getUint8Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, ICCProfile).getLength() / sizeof(Uint8); + else + *count = 0; + } + return result; +} + + +OFCondition DRTDoseIOD::getImageComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImageComments, value, pos); +} + + +OFCondition DRTDoseIOD::getImageFrameOrigin(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, ImageFrameOrigin).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getImageOrientationPatient(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImageOrientationPatient, value, pos); +} + + +OFCondition DRTDoseIOD::getImageOrientationPatient(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ImageOrientationPatient).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getImageOrientationPatient(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, ImageOrientationPatient).getFloat64Vector(value); +} + + +OFCondition DRTDoseIOD::getImagePositionPatient(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImagePositionPatient, value, pos); +} + + +OFCondition DRTDoseIOD::getImagePositionPatient(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ImagePositionPatient).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getImagePositionPatient(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, ImagePositionPatient).getFloat64Vector(value); +} + + +OFCondition DRTDoseIOD::getImageType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImageType, value, pos); +} + + +OFCondition DRTDoseIOD::getImagesInAcquisition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImagesInAcquisition, value, pos); +} + + +OFCondition DRTDoseIOD::getImagesInAcquisition(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ImagesInAcquisition).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getInstanceCoercionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCoercionDateTime, value, pos); +} + + +OFCondition DRTDoseIOD::getInstanceCreationDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DRTDoseIOD::getInstanceCreationTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DRTDoseIOD::getInstanceCreatorUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DRTDoseIOD::getInstanceNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DRTDoseIOD::getInstanceNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, InstanceNumber).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getInstitutionAddress(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTDoseIOD::getInstitutionName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTDoseIOD::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTDoseIOD::getIrradiationEventUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IrradiationEventUID, value, pos); +} + + +OFCondition DRTDoseIOD::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTDoseIOD::getLargestImagePixelValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, LargestImagePixelValue).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getLastMenstrualDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LastMenstrualDate, value, pos); +} + + +OFCondition DRTDoseIOD::getLongitudinalTemporalEventType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalEventType, value, pos); +} + + +OFCondition DRTDoseIOD::getLongitudinalTemporalInformationModified(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalInformationModified, value, pos); +} + + +OFCondition DRTDoseIOD::getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, LongitudinalTemporalOffsetFromEvent).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getLossyImageCompression(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LossyImageCompression, value, pos); +} + + +OFCondition DRTDoseIOD::getLossyImageCompressionMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LossyImageCompressionMethod, value, pos); +} + + +OFCondition DRTDoseIOD::getLossyImageCompressionRatio(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LossyImageCompressionRatio, value, pos); +} + + +OFCondition DRTDoseIOD::getLossyImageCompressionRatio(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, LossyImageCompressionRatio).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getLossyImageCompressionRatio(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, LossyImageCompressionRatio).getFloat64Vector(value); +} + + +OFCondition DRTDoseIOD::getManufacturer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTDoseIOD::getManufacturerModelName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTDoseIOD::getMeasuredAPDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredAPDimension, value, pos); +} + + +OFCondition DRTDoseIOD::getMeasuredAPDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredAPDimension).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getMeasuredLateralDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredLateralDimension, value, pos); +} + + +OFCondition DRTDoseIOD::getMeasuredLateralDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredLateralDimension).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getMedicalAlerts(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MedicalAlerts, value, pos); +} + + +OFCondition DRTDoseIOD::getModality(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DRTDoseIOD::getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NameOfPhysiciansReadingStudy, value, pos); +} + + +OFCondition DRTDoseIOD::getNormalizationPoint(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NormalizationPoint, value, pos); +} + + +OFCondition DRTDoseIOD::getNormalizationPoint(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, NormalizationPoint).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getNormalizationPoint(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, NormalizationPoint).getFloat64Vector(value); +} + + +OFCondition DRTDoseIOD::getNumberOfFrames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NumberOfFrames, value, pos); +} + + +OFCondition DRTDoseIOD::getNumberOfFrames(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, NumberOfFrames).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getNumberOfFramesInOverlay(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NumberOfFramesInOverlay, value, pos); +} + + +OFCondition DRTDoseIOD::getNumberOfFramesInOverlay(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, NumberOfFramesInOverlay).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getOccupation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Occupation, value, pos); +} + + +OFCondition DRTDoseIOD::getOperatorsName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTDoseIOD::getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OriginalSpecializedSOPClassUID, value, pos); +} + + +OFCondition DRTDoseIOD::getOtherPatientNames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OtherPatientNames, value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayBitPosition(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, OverlayBitPosition).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayBitsAllocated(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, OverlayBitsAllocated).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayColumns(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, OverlayColumns).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OverlayDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayLabel(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OverlayLabel, value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayOrigin(Sint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmSignedShort &, OverlayOrigin).getSint16(value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayRows(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, OverlayRows).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getOverlaySubtype(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OverlaySubtype, value, pos); +} + + +OFCondition DRTDoseIOD::getOverlayType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OverlayType, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientAge(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAge, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAlternativeCalendar, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientBirthDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientBirthTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthTime, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientBodyMassIndex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBodyMassIndex, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientBodyMassIndex(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientBodyMassIndex).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getPatientBreedDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBreedDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientComments, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientDeathDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientIdentityRemoved(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientIdentityRemoved, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientOrientation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientOrientation, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientSex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientSexNeutered(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSexNeutered, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientSize(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSize, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientSize(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSize).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getPatientSpeciesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSpeciesDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientState(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientState, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientWeight, value, pos); +} + + +OFCondition DRTDoseIOD::getPatientWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientWeight).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getPerformedProcedureStepDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getPerformedProcedureStepEndDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndDate, value, pos); +} + + +OFCondition DRTDoseIOD::getPerformedProcedureStepEndTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndTime, value, pos); +} + + +OFCondition DRTDoseIOD::getPerformedProcedureStepID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepID, value, pos); +} + + +OFCondition DRTDoseIOD::getPerformedProcedureStepStartDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartDate, value, pos); +} + + +OFCondition DRTDoseIOD::getPerformedProcedureStepStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartTime, value, pos); +} + + +OFCondition DRTDoseIOD::getPhotometricInterpretation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhotometricInterpretation, value, pos); +} + + +OFCondition DRTDoseIOD::getPhysiciansOfRecord(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhysiciansOfRecord, value, pos); +} + + +OFCondition DRTDoseIOD::getPixelAspectRatio(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PixelAspectRatio, value, pos); +} + + +OFCondition DRTDoseIOD::getPixelAspectRatio(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, PixelAspectRatio).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getPixelDataProviderURL(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PixelDataProviderURL, value, pos); +} + + +OFCondition DRTDoseIOD::getPixelPaddingRangeLimit(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingRangeLimit).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getPixelPaddingValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingValue).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getPixelRepresentation(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelRepresentation).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getPixelSpacing(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PixelSpacing, value, pos); +} + + +OFCondition DRTDoseIOD::getPixelSpacing(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PixelSpacing).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getPixelSpacing(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, PixelSpacing).getFloat64Vector(value); +} + + +OFCondition DRTDoseIOD::getPlanarConfiguration(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PlanarConfiguration).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getPositionReferenceIndicator(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PositionReferenceIndicator, value, pos); +} + + +OFCondition DRTDoseIOD::getPregnancyStatus(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PregnancyStatus).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getPresentationLUTShape(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PresentationLUTShape, value, pos); +} + + +OFCondition DRTDoseIOD::getQualityControlImage(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlImage, value, pos); +} + + +OFCondition DRTDoseIOD::getQualityControlSubject(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlSubject, value, pos); +} + + +OFCondition DRTDoseIOD::getQueryRetrieveView(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QueryRetrieveView, value, pos); +} + + +OFCondition DRTDoseIOD::getROIArea(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ROIArea, value, pos); +} + + +OFCondition DRTDoseIOD::getROIArea(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ROIArea).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getROIMean(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ROIMean, value, pos); +} + + +OFCondition DRTDoseIOD::getROIMean(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ROIMean).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getROIStandardDeviation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ROIStandardDeviation, value, pos); +} + + +OFCondition DRTDoseIOD::getROIStandardDeviation(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ROIStandardDeviation).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getRecognizableVisualFeatures(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RecognizableVisualFeatures, value, pos); +} + + +OFCondition DRTDoseIOD::getRedPaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, RedPaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, RedPaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + return result; +} + + +OFCondition DRTDoseIOD::getRedPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, RedPaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getReferringPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DRTDoseIOD::getRelatedGeneralSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RelatedGeneralSOPClassUID, value, pos); +} + + +OFCondition DRTDoseIOD::getRescaleIntercept(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RescaleIntercept, value, pos); +} + + +OFCondition DRTDoseIOD::getRescaleIntercept(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RescaleIntercept).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getRescaleSlope(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RescaleSlope, value, pos); +} + + +OFCondition DRTDoseIOD::getRescaleSlope(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RescaleSlope).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getRescaleType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RescaleType, value, pos); +} + + +OFCondition DRTDoseIOD::getResponsibleOrganization(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsibleOrganization, value, pos); +} + + +OFCondition DRTDoseIOD::getResponsiblePerson(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePerson, value, pos); +} + + +OFCondition DRTDoseIOD::getResponsiblePersonRole(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePersonRole, value, pos); +} + + +OFCondition DRTDoseIOD::getRows(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, Rows).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getSOPAuthorizationComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationComment, value, pos); +} + + +OFCondition DRTDoseIOD::getSOPAuthorizationDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationDateTime, value, pos); +} + + +OFCondition DRTDoseIOD::getSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DRTDoseIOD::getSOPInstanceStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceStatus, value, pos); +} + + +OFCondition DRTDoseIOD::getSOPInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DRTDoseIOD::getSamplesPerPixel(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, SamplesPerPixel).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getSeriesDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DRTDoseIOD::getSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTDoseIOD::getSeriesNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DRTDoseIOD::getSeriesNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, SeriesNumber).getSint32(value, pos); +} + + +OFCondition DRTDoseIOD::getSeriesTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DRTDoseIOD::getServiceEpisodeDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getServiceEpisodeID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeID, value, pos); +} + + +OFCondition DRTDoseIOD::getSliceLocation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SliceLocation, value, pos); +} + + +OFCondition DRTDoseIOD::getSliceLocation(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SliceLocation).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getSliceThickness(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SliceThickness, value, pos); +} + + +OFCondition DRTDoseIOD::getSliceThickness(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SliceThickness).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getSmallestImagePixelValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, SmallestImagePixelValue).getUint16(value, pos); +} + + +OFCondition DRTDoseIOD::getSmokingStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SmokingStatus, value, pos); +} + + +OFCondition DRTDoseIOD::getSoftwareVersions(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTDoseIOD::getSpatialResolution(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTDoseIOD::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::getSpatialTransformOfDose(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialTransformOfDose, value, pos); +} + + +OFCondition DRTDoseIOD::getSpecificCharacterSet(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DRTDoseIOD::getStationName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTDoseIOD::getStereoPairsPresent(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StereoPairsPresent, value, pos); +} + + +OFCondition DRTDoseIOD::getStrainAdditionalInformation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainAdditionalInformation, value, pos); +} + + +OFCondition DRTDoseIOD::getStrainDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getStrainNomenclature(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainNomenclature, value, pos); +} + + +OFCondition DRTDoseIOD::getStructureSetDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetDate, value, pos); +} + + +OFCondition DRTDoseIOD::getStructureSetDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getStructureSetLabel(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetLabel, value, pos); +} + + +OFCondition DRTDoseIOD::getStructureSetName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetName, value, pos); +} + + +OFCondition DRTDoseIOD::getStructureSetTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetTime, value, pos); +} + + +OFCondition DRTDoseIOD::getStudyDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DRTDoseIOD::getStudyDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DRTDoseIOD::getStudyID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DRTDoseIOD::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTDoseIOD::getStudyTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DRTDoseIOD::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTDoseIOD::getTimezoneOffsetFromUTC(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DRTDoseIOD::getTissueHeterogeneityCorrection(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TissueHeterogeneityCorrection, value, pos); +} + + +OFCondition DRTDoseIOD::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAcquisitionDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAcquisitionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAcquisitionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAcquisitionTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAdditionalPatientHistory(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = AdditionalPatientHistory.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAdmissionID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AdmissionID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAdmittingDiagnosesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AdmittingDiagnosesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAllergies(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = Allergies.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AuthorizationEquipmentCertificationNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setBitsAllocated(const Uint16 value, const unsigned long pos) +{ + return BitsAllocated.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setBitsStored(const Uint16 value, const unsigned long pos) +{ + return BitsStored.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setBluePaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + return BluePaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTDoseIOD::setBluePaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + return BluePaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setBurnedInAnnotation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BurnedInAnnotation.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialCoordinatingCenterName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeApprovalNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialProtocolName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialSeriesID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialSiteID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialSiteName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialSponsorName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSponsorName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialSubjectID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectReadingID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialTimePointDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setClinicalTrialTimePointID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setColorSpace(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ColorSpace.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setColumns(const Uint16 value, const unsigned long pos) +{ + return Columns.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CommentsOnThePerformedProcedureStep.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setConsultingPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ConsultingPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setContentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setContentQualification(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentQualification.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setContentTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDVHNormalizationDoseValue(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHNormalizationDoseValue.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDVHNormalizationPoint(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = DVHNormalizationPoint.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDeidentificationMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DeidentificationMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDoseComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDoseGridScaling(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseGridScaling.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDoseSummationType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseSummationType.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDoseType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseType.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setDoseUnits(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseUnits.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setEthnicGroup(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EthnicGroup.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setFrameIncrementPointer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAttributeTag::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = FrameIncrementPointer.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setFrameOfReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameOfReferenceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setGantryID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setGreenPaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + return GreenPaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTDoseIOD::setGreenPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + return GreenPaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setGridFrameOffsetVector(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "2-n") : EC_Normal; + if (result.good()) + result = GridFrameOffsetVector.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setHighBit(const Uint16 value, const unsigned long pos) +{ + return HighBit.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setICCProfile(const Uint8 *value, const unsigned long count) +{ + return ICCProfile.putUint8Array(value, count); +} + + +OFCondition DRTDoseIOD::setImageComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ImageComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setImageFrameOrigin(const Uint16 value, const unsigned long pos) +{ + return ImageFrameOrigin.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setImageOrientationPatient(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "6") : EC_Normal; + if (result.good()) + result = ImageOrientationPatient.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setImagePositionPatient(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = ImagePositionPatient.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setImageType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "2-n") : EC_Normal; + if (result.good()) + result = ImageType.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setImagesInAcquisition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ImagesInAcquisition.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstanceCoercionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCoercionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstanceCreationDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstanceCreationTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstanceCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreatorUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstanceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setIrradiationEventUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = IrradiationEventUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setLargestImagePixelValue(const Uint16 value, const unsigned long pos) +{ + return LargestImagePixelValue.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setLastMenstrualDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LastMenstrualDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setLongitudinalTemporalEventType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalEventType.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalInformationModified.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos) +{ + return LongitudinalTemporalOffsetFromEvent.putFloat64(value, pos); +} + + +OFCondition DRTDoseIOD::setLossyImageCompression(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LossyImageCompression.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setLossyImageCompressionMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = LossyImageCompressionMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setLossyImageCompressionRatio(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = LossyImageCompressionRatio.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setMeasuredAPDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredAPDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setMeasuredLateralDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredLateralDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setMedicalAlerts(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = MedicalAlerts.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setModality(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Modality.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NameOfPhysiciansReadingStudy.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setNormalizationPoint(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = NormalizationPoint.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setNumberOfFrames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFrames.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setNumberOfFramesInOverlay(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFramesInOverlay.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOccupation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Occupation.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OriginalSpecializedSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOtherPatientNames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OtherPatientNames.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOverlayBitPosition(const Uint16 value, const unsigned long pos) +{ + return OverlayBitPosition.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setOverlayBitsAllocated(const Uint16 value, const unsigned long pos) +{ + return OverlayBitsAllocated.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setOverlayColumns(const Uint16 value, const unsigned long pos) +{ + return OverlayColumns.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setOverlayDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OverlayDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOverlayLabel(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OverlayLabel.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOverlayOrigin(const Sint16 value, const unsigned long pos) +{ + return OverlayOrigin.putSint16(value, pos); +} + + +OFCondition DRTDoseIOD::setOverlayRows(const Uint16 value, const unsigned long pos) +{ + return OverlayRows.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setOverlaySubtype(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OverlaySubtype.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setOverlayType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OverlayType.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientAge(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAge.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientBirthDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientBirthTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientBodyMassIndex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBodyMassIndex.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientBreedDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBreedDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PatientComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientDeathDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientIdentityRemoved(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientIdentityRemoved.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = PatientOrientation.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientSex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientSexNeutered(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSexNeutered.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientSize(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSize.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientSpeciesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSpeciesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientState(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientState.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPatientWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPerformedProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPerformedProcedureStepEndDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPerformedProcedureStepEndTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPerformedProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPerformedProcedureStepStartDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPerformedProcedureStepStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPhotometricInterpretation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PhotometricInterpretation.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPhysiciansOfRecord(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PhysiciansOfRecord.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPixelAspectRatio(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = PixelAspectRatio.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPixelDataProviderURL(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PixelDataProviderURL.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPixelPaddingRangeLimit(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingRangeLimit.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setPixelPaddingValue(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingValue.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setPixelRepresentation(const Uint16 value, const unsigned long pos) +{ + return PixelRepresentation.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setPixelSpacing(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = PixelSpacing.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPlanarConfiguration(const Uint16 value, const unsigned long pos) +{ + return PlanarConfiguration.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setPositionReferenceIndicator(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PositionReferenceIndicator.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setPregnancyStatus(const Uint16 value, const unsigned long pos) +{ + return PregnancyStatus.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setPresentationLUTShape(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PresentationLUTShape.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setQualityControlImage(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlImage.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setQualityControlSubject(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlSubject.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setQueryRetrieveView(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QueryRetrieveView.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setROIArea(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIArea.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setROIMean(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIMean.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setROIStandardDeviation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIStandardDeviation.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setRecognizableVisualFeatures(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RecognizableVisualFeatures.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setRedPaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + return RedPaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTDoseIOD::setRedPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + return RedPaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setReferringPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RelatedGeneralSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setRescaleIntercept(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RescaleIntercept.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setRescaleSlope(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RescaleSlope.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setRescaleType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RescaleType.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsibleOrganization.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setResponsiblePerson(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePerson.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setResponsiblePersonRole(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePersonRole.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setRows(const Uint16 value, const unsigned long pos) +{ + return Rows.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setSOPAuthorizationComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SOPAuthorizationComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSOPAuthorizationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPAuthorizationDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSOPInstanceStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSamplesPerPixel(const Uint16 value, const unsigned long pos) +{ + return SamplesPerPixel.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setSeriesDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSeriesNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSeriesTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setServiceEpisodeDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setServiceEpisodeID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSliceLocation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SliceLocation.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSliceThickness(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SliceThickness.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSmallestImagePixelValue(const Uint16 value, const unsigned long pos) +{ + return SmallestImagePixelValue.putUint16(value, pos); +} + + +OFCondition DRTDoseIOD::setSmokingStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SmokingStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSpatialTransformOfDose(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialTransformOfDose.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setSpecificCharacterSet(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SpecificCharacterSet.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStereoPairsPresent(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StereoPairsPresent.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStrainAdditionalInformation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StrainAdditionalInformation.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStrainDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStrainNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainNomenclature.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStructureSetDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStructureSetDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StructureSetDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStructureSetLabel(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetLabel.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStructureSetName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetName.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStructureSetTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStudyDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStudyDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStudyID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setStudyTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setTimezoneOffsetFromUTC(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +OFCondition DRTDoseIOD::setTissueHeterogeneityCorrection(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-3") : EC_Normal; + if (result.good()) + result = TissueHeterogeneityCorrection.putOFStringArray(value); + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdrs.cc b/dcmrt/libsrc/drtdrs.cc new file mode 100644 index 00000000..eb7d44f8 --- /dev/null +++ b/dcmrt/libsrc/drtdrs.cc @@ -0,0 +1,1210 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdrs.h" + + +// --- item class --- + +DRTDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ConstraintWeight(DCM_ConstraintWeight), + DeliveryMaximumDose(DCM_DeliveryMaximumDose), + DeliveryWarningDose(DCM_DeliveryWarningDose), + DoseReferenceDescription(DCM_DoseReferenceDescription), + DoseReferenceNumber(DCM_DoseReferenceNumber), + DoseReferencePointCoordinates(DCM_DoseReferencePointCoordinates), + DoseReferenceStructureType(DCM_DoseReferenceStructureType), + DoseReferenceType(DCM_DoseReferenceType), + DoseReferenceUID(DCM_DoseReferenceUID), + NominalPriorDose(DCM_NominalPriorDose), + OrganAtRiskFullVolumeDose(DCM_OrganAtRiskFullVolumeDose), + OrganAtRiskLimitDose(DCM_OrganAtRiskLimitDose), + OrganAtRiskMaximumDose(DCM_OrganAtRiskMaximumDose), + OrganAtRiskOverdoseVolumeFraction(DCM_OrganAtRiskOverdoseVolumeFraction), + ReferencedROINumber(DCM_ReferencedROINumber), + TargetMaximumDose(DCM_TargetMaximumDose), + TargetMinimumDose(DCM_TargetMinimumDose), + TargetPrescriptionDose(DCM_TargetPrescriptionDose), + TargetUnderdoseVolumeFraction(DCM_TargetUnderdoseVolumeFraction) +{ +} + + +DRTDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ConstraintWeight(copy.ConstraintWeight), + DeliveryMaximumDose(copy.DeliveryMaximumDose), + DeliveryWarningDose(copy.DeliveryWarningDose), + DoseReferenceDescription(copy.DoseReferenceDescription), + DoseReferenceNumber(copy.DoseReferenceNumber), + DoseReferencePointCoordinates(copy.DoseReferencePointCoordinates), + DoseReferenceStructureType(copy.DoseReferenceStructureType), + DoseReferenceType(copy.DoseReferenceType), + DoseReferenceUID(copy.DoseReferenceUID), + NominalPriorDose(copy.NominalPriorDose), + OrganAtRiskFullVolumeDose(copy.OrganAtRiskFullVolumeDose), + OrganAtRiskLimitDose(copy.OrganAtRiskLimitDose), + OrganAtRiskMaximumDose(copy.OrganAtRiskMaximumDose), + OrganAtRiskOverdoseVolumeFraction(copy.OrganAtRiskOverdoseVolumeFraction), + ReferencedROINumber(copy.ReferencedROINumber), + TargetMaximumDose(copy.TargetMaximumDose), + TargetMinimumDose(copy.TargetMinimumDose), + TargetPrescriptionDose(copy.TargetPrescriptionDose), + TargetUnderdoseVolumeFraction(copy.TargetUnderdoseVolumeFraction) +{ +} + + +DRTDoseReferenceSequence::Item::~Item() +{ +} + + +DRTDoseReferenceSequence::Item &DRTDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ConstraintWeight = copy.ConstraintWeight; + DeliveryMaximumDose = copy.DeliveryMaximumDose; + DeliveryWarningDose = copy.DeliveryWarningDose; + DoseReferenceDescription = copy.DoseReferenceDescription; + DoseReferenceNumber = copy.DoseReferenceNumber; + DoseReferencePointCoordinates = copy.DoseReferencePointCoordinates; + DoseReferenceStructureType = copy.DoseReferenceStructureType; + DoseReferenceType = copy.DoseReferenceType; + DoseReferenceUID = copy.DoseReferenceUID; + NominalPriorDose = copy.NominalPriorDose; + OrganAtRiskFullVolumeDose = copy.OrganAtRiskFullVolumeDose; + OrganAtRiskLimitDose = copy.OrganAtRiskLimitDose; + OrganAtRiskMaximumDose = copy.OrganAtRiskMaximumDose; + OrganAtRiskOverdoseVolumeFraction = copy.OrganAtRiskOverdoseVolumeFraction; + ReferencedROINumber = copy.ReferencedROINumber; + TargetMaximumDose = copy.TargetMaximumDose; + TargetMinimumDose = copy.TargetMinimumDose; + TargetPrescriptionDose = copy.TargetPrescriptionDose; + TargetUnderdoseVolumeFraction = copy.TargetUnderdoseVolumeFraction; + } + return *this; +} + + +void DRTDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + DoseReferenceNumber.clear(); + DoseReferenceUID.clear(); + DoseReferenceStructureType.clear(); + DoseReferenceDescription.clear(); + ReferencedROINumber.clear(); + DoseReferencePointCoordinates.clear(); + NominalPriorDose.clear(); + DoseReferenceType.clear(); + ConstraintWeight.clear(); + DeliveryWarningDose.clear(); + DeliveryMaximumDose.clear(); + TargetMinimumDose.clear(); + TargetPrescriptionDose.clear(); + TargetMaximumDose.clear(); + TargetUnderdoseVolumeFraction.clear(); + OrganAtRiskFullVolumeDose.clear(); + OrganAtRiskLimitDose.clear(); + OrganAtRiskMaximumDose.clear(); + OrganAtRiskOverdoseVolumeFraction.clear(); + } +} + + +OFBool DRTDoseReferenceSequence::Item::isEmpty() +{ + return DoseReferenceNumber.isEmpty() && + DoseReferenceUID.isEmpty() && + DoseReferenceStructureType.isEmpty() && + DoseReferenceDescription.isEmpty() && + ReferencedROINumber.isEmpty() && + DoseReferencePointCoordinates.isEmpty() && + NominalPriorDose.isEmpty() && + DoseReferenceType.isEmpty() && + ConstraintWeight.isEmpty() && + DeliveryWarningDose.isEmpty() && + DeliveryMaximumDose.isEmpty() && + TargetMinimumDose.isEmpty() && + TargetPrescriptionDose.isEmpty() && + TargetMaximumDose.isEmpty() && + TargetUnderdoseVolumeFraction.isEmpty() && + OrganAtRiskFullVolumeDose.isEmpty() && + OrganAtRiskLimitDose.isEmpty() && + OrganAtRiskMaximumDose.isEmpty() && + OrganAtRiskOverdoseVolumeFraction.isEmpty(); +} + + +OFBool DRTDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, DoseReferenceNumber, "1", "1", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseReferenceUID, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseReferenceStructureType, "1", "1", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseReferenceDescription, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1C", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseReferencePointCoordinates, "3", "1C", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, NominalPriorDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseReferenceType, "1", "1", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, ConstraintWeight, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, DeliveryWarningDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, DeliveryMaximumDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetMinimumDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetPrescriptionDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetMaximumDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetUnderdoseVolumeFraction, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskFullVolumeDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskLimitDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskMaximumDose, "1", "3", "DoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskOverdoseVolumeFraction, "1", "3", "DoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(DoseReferenceNumber), "1", "1", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(DoseReferenceUID), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmCodeString(DoseReferenceStructureType), "1", "1", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmLongString(DoseReferenceDescription), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1C", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DoseReferencePointCoordinates), "3", "1C", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(NominalPriorDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmCodeString(DoseReferenceType), "1", "1", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(ConstraintWeight), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveryWarningDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveryMaximumDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetMinimumDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetPrescriptionDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetMaximumDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetUnderdoseVolumeFraction), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskFullVolumeDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskLimitDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskMaximumDose), "1", "3", "DoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskOverdoseVolumeFraction), "1", "3", "DoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::getConstraintWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ConstraintWeight, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getConstraintWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ConstraintWeight).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDeliveryMaximumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveryMaximumDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDeliveryMaximumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveryMaximumDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDeliveryWarningDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveryWarningDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDeliveryWarningDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveryWarningDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferenceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferenceDescription, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferenceNumber, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, DoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferencePointCoordinates(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferencePointCoordinates, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferencePointCoordinates(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DoseReferencePointCoordinates).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferencePointCoordinates(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DoseReferencePointCoordinates).getFloat64Vector(value); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferenceStructureType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferenceStructureType, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferenceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferenceType, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getDoseReferenceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferenceUID, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getNominalPriorDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NominalPriorDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getNominalPriorDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NominalPriorDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskFullVolumeDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskFullVolumeDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskFullVolumeDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskFullVolumeDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskLimitDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskLimitDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskLimitDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskLimitDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskMaximumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskMaximumDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskMaximumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskMaximumDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskOverdoseVolumeFraction(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskOverdoseVolumeFraction, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getOrganAtRiskOverdoseVolumeFraction(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskOverdoseVolumeFraction).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetMaximumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetMaximumDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetMaximumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetMaximumDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetMinimumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetMinimumDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetMinimumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetMinimumDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetPrescriptionDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetPrescriptionDose, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetPrescriptionDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetPrescriptionDose).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetUnderdoseVolumeFraction(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetUnderdoseVolumeFraction, value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::getTargetUnderdoseVolumeFraction(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetUnderdoseVolumeFraction).getFloat64(value, pos); +} + + +OFCondition DRTDoseReferenceSequence::Item::setConstraintWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ConstraintWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDeliveryMaximumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveryMaximumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDeliveryWarningDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveryWarningDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDoseReferenceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseReferenceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDoseReferencePointCoordinates(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = DoseReferencePointCoordinates.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDoseReferenceStructureType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseReferenceStructureType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDoseReferenceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseReferenceType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setDoseReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseReferenceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setNominalPriorDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NominalPriorDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setOrganAtRiskFullVolumeDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskFullVolumeDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setOrganAtRiskLimitDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskLimitDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setOrganAtRiskMaximumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskMaximumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setOrganAtRiskOverdoseVolumeFraction(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskOverdoseVolumeFraction.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setTargetMaximumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetMaximumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setTargetMinimumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetMinimumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setTargetPrescriptionDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetPrescriptionDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::Item::setTargetUnderdoseVolumeFraction(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetUnderdoseVolumeFraction.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDoseReferenceSequence::DRTDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDoseReferenceSequence::DRTDoseReferenceSequence(const DRTDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDoseReferenceSequence &DRTDoseReferenceSequence::operator=(const DRTDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDoseReferenceSequence::~DRTDoseReferenceSequence() +{ + clear(); +} + + +void DRTDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDoseReferenceSequence::Item &DRTDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDoseReferenceSequence::Item &DRTDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDoseReferenceSequence::Item &DRTDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDoseReferenceSequence::Item &DRTDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDoseReferenceSequence::Item &DRTDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDoseReferenceSequence::Item &DRTDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtds.cc b/dcmrt/libsrc/drtds.cc new file mode 100644 index 00000000..40c8d5b4 --- /dev/null +++ b/dcmrt/libsrc/drtds.cc @@ -0,0 +1,1283 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtds.h" + + +// --- item class --- + +DRTDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + DeviceDescription(DCM_DeviceDescription), + DeviceDiameter(DCM_DeviceDiameter), + DeviceDiameterUnits(DCM_DeviceDiameterUnits), + DeviceID(DCM_DeviceID), + DeviceLength(DCM_DeviceLength), + DeviceSerialNumber(DCM_DeviceSerialNumber), + DeviceVolume(DCM_DeviceVolume), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + InterMarkerDistance(DCM_InterMarkerDistance), + LongCodeValue(DCM_LongCodeValue), + Manufacturer(DCM_Manufacturer), + ManufacturerModelName(DCM_ManufacturerModelName), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + DeviceDescription(copy.DeviceDescription), + DeviceDiameter(copy.DeviceDiameter), + DeviceDiameterUnits(copy.DeviceDiameterUnits), + DeviceID(copy.DeviceID), + DeviceLength(copy.DeviceLength), + DeviceSerialNumber(copy.DeviceSerialNumber), + DeviceVolume(copy.DeviceVolume), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + InterMarkerDistance(copy.InterMarkerDistance), + LongCodeValue(copy.LongCodeValue), + Manufacturer(copy.Manufacturer), + ManufacturerModelName(copy.ManufacturerModelName), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTDeviceSequence::Item::~Item() +{ +} + + +DRTDeviceSequence::Item &DRTDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + DeviceDescription = copy.DeviceDescription; + DeviceDiameter = copy.DeviceDiameter; + DeviceDiameterUnits = copy.DeviceDiameterUnits; + DeviceID = copy.DeviceID; + DeviceLength = copy.DeviceLength; + DeviceSerialNumber = copy.DeviceSerialNumber; + DeviceVolume = copy.DeviceVolume; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + InterMarkerDistance = copy.InterMarkerDistance; + LongCodeValue = copy.LongCodeValue; + Manufacturer = copy.Manufacturer; + ManufacturerModelName = copy.ManufacturerModelName; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + Manufacturer.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + DeviceID.clear(); + DeviceLength.clear(); + DeviceDiameter.clear(); + DeviceDiameterUnits.clear(); + DeviceVolume.clear(); + InterMarkerDistance.clear(); + DeviceDescription.clear(); + } +} + + +OFBool DRTDeviceSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty() && + Manufacturer.isEmpty() && + ManufacturerModelName.isEmpty() && + DeviceSerialNumber.isEmpty() && + DeviceID.isEmpty() && + DeviceLength.isEmpty() && + DeviceDiameter.isEmpty() && + DeviceDiameterUnits.isEmpty() && + DeviceVolume.isEmpty() && + InterMarkerDistance.isEmpty() && + DeviceDescription.isEmpty(); +} + + +OFBool DRTDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "DeviceSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "DeviceSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "DeviceSequence"); + getAndCheckElementFromDataset(item, Manufacturer, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, ManufacturerModelName, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, DeviceSerialNumber, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, DeviceID, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, DeviceLength, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, DeviceDiameter, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, DeviceDiameterUnits, "1", "2C", "DeviceSequence"); + getAndCheckElementFromDataset(item, DeviceVolume, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, InterMarkerDistance, "1", "3", "DeviceSequence"); + getAndCheckElementFromDataset(item, DeviceDescription, "1", "3", "DeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "DeviceSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "DeviceSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "DeviceSequence"); + addElementToDataset(result, item, new DcmLongString(Manufacturer), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmLongString(ManufacturerModelName), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceSerialNumber), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceID), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeviceLength), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeviceDiameter), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmCodeString(DeviceDiameterUnits), "1", "2C", "DeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeviceVolume), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(InterMarkerDistance), "1", "3", "DeviceSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceDescription), "1", "3", "DeviceSequence"); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceDescription, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceDiameter(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceDiameter, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceDiameter(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeviceDiameter).getFloat64(value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceDiameterUnits(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceDiameterUnits, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceID, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceLength, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeviceLength).getFloat64(value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceVolume(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceVolume, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getDeviceVolume(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeviceVolume).getFloat64(value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getInterMarkerDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InterMarkerDistance, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getInterMarkerDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, InterMarkerDistance).getFloat64(value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getManufacturerModelName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTDeviceSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setDeviceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setDeviceDiameter(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceDiameter.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setDeviceDiameterUnits(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceDiameterUnits.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setDeviceID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setDeviceLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setDeviceVolume(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceVolume.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setInterMarkerDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InterMarkerDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDeviceSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDeviceSequence::DRTDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDeviceSequence::DRTDeviceSequence(const DRTDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDeviceSequence &DRTDeviceSequence::operator=(const DRTDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDeviceSequence::~DRTDeviceSequence() +{ + clear(); +} + + +void DRTDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDeviceSequence::Item &DRTDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDeviceSequence::Item &DRTDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDeviceSequence::Item &DRTDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDeviceSequence::Item &DRTDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDeviceSequence::Item &DRTDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDeviceSequence::Item &DRTDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdspcs.cc b/dcmrt/libsrc/drtdspcs.cc new file mode 100644 index 00000000..e3a9c363 --- /dev/null +++ b/dcmrt/libsrc/drtdspcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDigitalSignaturePurposeCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdspcs.h" + + +// --- item class --- + +DRTDigitalSignaturePurposeCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTDigitalSignaturePurposeCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTDigitalSignaturePurposeCodeSequence::Item::~Item() +{ +} + + +DRTDigitalSignaturePurposeCodeSequence::Item &DRTDigitalSignaturePurposeCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTDigitalSignaturePurposeCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTDigitalSignaturePurposeCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTDigitalSignaturePurposeCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "DigitalSignaturePurposeCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "DigitalSignaturePurposeCodeSequence"); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDigitalSignaturePurposeCodeSequence::DRTDigitalSignaturePurposeCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDigitalSignaturePurposeCodeSequence::DRTDigitalSignaturePurposeCodeSequence(const DRTDigitalSignaturePurposeCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDigitalSignaturePurposeCodeSequence &DRTDigitalSignaturePurposeCodeSequence::operator=(const DRTDigitalSignaturePurposeCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDigitalSignaturePurposeCodeSequence::~DRTDigitalSignaturePurposeCodeSequence() +{ + clear(); +} + + +void DRTDigitalSignaturePurposeCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDigitalSignaturePurposeCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDigitalSignaturePurposeCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDigitalSignaturePurposeCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDigitalSignaturePurposeCodeSequence::Item &DRTDigitalSignaturePurposeCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDigitalSignaturePurposeCodeSequence::Item &DRTDigitalSignaturePurposeCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDigitalSignaturePurposeCodeSequence::Item &DRTDigitalSignaturePurposeCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDigitalSignaturePurposeCodeSequence::Item &DRTDigitalSignaturePurposeCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDigitalSignaturePurposeCodeSequence::Item &DRTDigitalSignaturePurposeCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDigitalSignaturePurposeCodeSequence::Item &DRTDigitalSignaturePurposeCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DigitalSignaturePurposeCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DigitalSignaturePurposeCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDigitalSignaturePurposeCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DigitalSignaturePurposeCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdss.cc b/dcmrt/libsrc/drtdss.cc new file mode 100644 index 00000000..dd10c99d --- /dev/null +++ b/dcmrt/libsrc/drtdss.cc @@ -0,0 +1,768 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDigitalSignaturesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdss.h" + + +// --- item class --- + +DRTDigitalSignaturesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CertificateOfSigner(DCM_CertificateOfSigner), + CertificateType(DCM_CertificateType), + CertifiedTimestamp(DCM_CertifiedTimestamp), + CertifiedTimestampType(DCM_CertifiedTimestampType), + DigitalSignatureDateTime(DCM_DigitalSignatureDateTime), + DigitalSignaturePurposeCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DigitalSignatureUID(DCM_DigitalSignatureUID), + MACIDNumber(DCM_MACIDNumber), + Signature(DCM_Signature) +{ +} + + +DRTDigitalSignaturesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CertificateOfSigner(copy.CertificateOfSigner), + CertificateType(copy.CertificateType), + CertifiedTimestamp(copy.CertifiedTimestamp), + CertifiedTimestampType(copy.CertifiedTimestampType), + DigitalSignatureDateTime(copy.DigitalSignatureDateTime), + DigitalSignaturePurposeCodeSequence(copy.DigitalSignaturePurposeCodeSequence), + DigitalSignatureUID(copy.DigitalSignatureUID), + MACIDNumber(copy.MACIDNumber), + Signature(copy.Signature) +{ +} + + +DRTDigitalSignaturesSequence::Item::~Item() +{ +} + + +DRTDigitalSignaturesSequence::Item &DRTDigitalSignaturesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CertificateOfSigner = copy.CertificateOfSigner; + CertificateType = copy.CertificateType; + CertifiedTimestamp = copy.CertifiedTimestamp; + CertifiedTimestampType = copy.CertifiedTimestampType; + DigitalSignatureDateTime = copy.DigitalSignatureDateTime; + DigitalSignaturePurposeCodeSequence = copy.DigitalSignaturePurposeCodeSequence; + DigitalSignatureUID = copy.DigitalSignatureUID; + MACIDNumber = copy.MACIDNumber; + Signature = copy.Signature; + } + return *this; +} + + +void DRTDigitalSignaturesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + MACIDNumber.clear(); + DigitalSignatureUID.clear(); + DigitalSignatureDateTime.clear(); + CertificateType.clear(); + CertificateOfSigner.clear(); + Signature.clear(); + CertifiedTimestampType.clear(); + CertifiedTimestamp.clear(); + DigitalSignaturePurposeCodeSequence.clear(); + } +} + + +OFBool DRTDigitalSignaturesSequence::Item::isEmpty() +{ + return MACIDNumber.isEmpty() && + DigitalSignatureUID.isEmpty() && + DigitalSignatureDateTime.isEmpty() && + CertificateType.isEmpty() && + CertificateOfSigner.isEmpty() && + Signature.isEmpty() && + CertifiedTimestampType.isEmpty() && + CertifiedTimestamp.isEmpty() && + DigitalSignaturePurposeCodeSequence.isEmpty(); +} + + +OFBool DRTDigitalSignaturesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, MACIDNumber, "1", "1", "DigitalSignaturesSequence"); + getAndCheckElementFromDataset(item, DigitalSignatureUID, "1", "1", "DigitalSignaturesSequence"); + getAndCheckElementFromDataset(item, DigitalSignatureDateTime, "1", "1", "DigitalSignaturesSequence"); + getAndCheckElementFromDataset(item, CertificateType, "1", "1", "DigitalSignaturesSequence"); + getAndCheckElementFromDataset(item, CertificateOfSigner, "1", "1", "DigitalSignaturesSequence"); + getAndCheckElementFromDataset(item, Signature, "1", "1", "DigitalSignaturesSequence"); + getAndCheckElementFromDataset(item, CertifiedTimestampType, "1", "1C", "DigitalSignaturesSequence"); + getAndCheckElementFromDataset(item, CertifiedTimestamp, "1", "3", "DigitalSignaturesSequence"); + DigitalSignaturePurposeCodeSequence.read(item, "1-n", "3", "DigitalSignaturesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(MACIDNumber), "1", "1", "DigitalSignaturesSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(DigitalSignatureUID), "1", "1", "DigitalSignaturesSequence"); + addElementToDataset(result, item, new DcmDateTime(DigitalSignatureDateTime), "1", "1", "DigitalSignaturesSequence"); + addElementToDataset(result, item, new DcmCodeString(CertificateType), "1", "1", "DigitalSignaturesSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(CertificateOfSigner), "1", "1", "DigitalSignaturesSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(Signature), "1", "1", "DigitalSignaturesSequence"); + addElementToDataset(result, item, new DcmCodeString(CertifiedTimestampType), "1", "1C", "DigitalSignaturesSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(CertifiedTimestamp), "1", "3", "DigitalSignaturesSequence"); + if (result.good()) result = DigitalSignaturePurposeCodeSequence.write(item, "1-n", "3", "DigitalSignaturesSequence"); + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getCertificateOfSigner(Uint8 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, CertificateOfSigner).getUint8Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, CertificateOfSigner).getLength() / sizeof(Uint8); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getCertificateType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CertificateType, value, pos); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getCertifiedTimestamp(Uint8 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, CertifiedTimestamp).getUint8Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, CertifiedTimestamp).getLength() / sizeof(Uint8); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getCertifiedTimestampType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CertifiedTimestampType, value, pos); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getDigitalSignatureDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DigitalSignatureDateTime, value, pos); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getDigitalSignatureUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DigitalSignatureUID, value, pos); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getMACIDNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, MACIDNumber).getUint16(value, pos); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::getSignature(Uint8 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, Signature).getUint8Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, Signature).getLength() / sizeof(Uint8); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setCertificateOfSigner(const Uint8 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return CertificateOfSigner.putUint8Array(value, count); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setCertificateType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CertificateType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setCertifiedTimestamp(const Uint8 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return CertifiedTimestamp.putUint8Array(value, count); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setCertifiedTimestampType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CertifiedTimestampType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setDigitalSignatureDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DigitalSignatureDateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setDigitalSignatureUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DigitalSignatureUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setMACIDNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return MACIDNumber.putUint16(value, pos); +} + + +OFCondition DRTDigitalSignaturesSequence::Item::setSignature(const Uint8 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return Signature.putUint8Array(value, count); +} + + +// --- sequence class --- + +DRTDigitalSignaturesSequence::DRTDigitalSignaturesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDigitalSignaturesSequence::DRTDigitalSignaturesSequence(const DRTDigitalSignaturesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDigitalSignaturesSequence &DRTDigitalSignaturesSequence::operator=(const DRTDigitalSignaturesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDigitalSignaturesSequence::~DRTDigitalSignaturesSequence() +{ + clear(); +} + + +void DRTDigitalSignaturesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDigitalSignaturesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDigitalSignaturesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDigitalSignaturesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDigitalSignaturesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDigitalSignaturesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDigitalSignaturesSequence::Item &DRTDigitalSignaturesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDigitalSignaturesSequence::Item &DRTDigitalSignaturesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDigitalSignaturesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDigitalSignaturesSequence::Item &DRTDigitalSignaturesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDigitalSignaturesSequence::Item &DRTDigitalSignaturesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDigitalSignaturesSequence::Item &DRTDigitalSignaturesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDigitalSignaturesSequence::Item &DRTDigitalSignaturesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDigitalSignaturesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DigitalSignaturesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DigitalSignaturesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDigitalSignaturesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DigitalSignaturesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdvhs.cc b/dcmrt/libsrc/drtdvhs.cc new file mode 100644 index 00000000..5757d3d6 --- /dev/null +++ b/dcmrt/libsrc/drtdvhs.cc @@ -0,0 +1,875 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDVHSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdvhs.h" + + +// --- item class --- + +DRTDVHSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DVHData(DCM_DVHData), + DVHDoseScaling(DCM_DVHDoseScaling), + DVHMaximumDose(DCM_DVHMaximumDose), + DVHMeanDose(DCM_DVHMeanDose), + DVHMinimumDose(DCM_DVHMinimumDose), + DVHNumberOfBins(DCM_DVHNumberOfBins), + DVHReferencedROISequence(emptyDefaultItem /*emptyDefaultSequence*/), + DVHType(DCM_DVHType), + DVHVolumeUnits(DCM_DVHVolumeUnits), + DoseType(DCM_DoseType), + DoseUnits(DCM_DoseUnits) +{ +} + + +DRTDVHSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DVHData(copy.DVHData), + DVHDoseScaling(copy.DVHDoseScaling), + DVHMaximumDose(copy.DVHMaximumDose), + DVHMeanDose(copy.DVHMeanDose), + DVHMinimumDose(copy.DVHMinimumDose), + DVHNumberOfBins(copy.DVHNumberOfBins), + DVHReferencedROISequence(copy.DVHReferencedROISequence), + DVHType(copy.DVHType), + DVHVolumeUnits(copy.DVHVolumeUnits), + DoseType(copy.DoseType), + DoseUnits(copy.DoseUnits) +{ +} + + +DRTDVHSequence::Item::~Item() +{ +} + + +DRTDVHSequence::Item &DRTDVHSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DVHData = copy.DVHData; + DVHDoseScaling = copy.DVHDoseScaling; + DVHMaximumDose = copy.DVHMaximumDose; + DVHMeanDose = copy.DVHMeanDose; + DVHMinimumDose = copy.DVHMinimumDose; + DVHNumberOfBins = copy.DVHNumberOfBins; + DVHReferencedROISequence = copy.DVHReferencedROISequence; + DVHType = copy.DVHType; + DVHVolumeUnits = copy.DVHVolumeUnits; + DoseType = copy.DoseType; + DoseUnits = copy.DoseUnits; + } + return *this; +} + + +void DRTDVHSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + DVHReferencedROISequence.clear(); + DVHType.clear(); + DoseUnits.clear(); + DoseType.clear(); + DVHDoseScaling.clear(); + DVHVolumeUnits.clear(); + DVHNumberOfBins.clear(); + DVHData.clear(); + DVHMinimumDose.clear(); + DVHMaximumDose.clear(); + DVHMeanDose.clear(); + } +} + + +OFBool DRTDVHSequence::Item::isEmpty() +{ + return DVHReferencedROISequence.isEmpty() && + DVHType.isEmpty() && + DoseUnits.isEmpty() && + DoseType.isEmpty() && + DVHDoseScaling.isEmpty() && + DVHVolumeUnits.isEmpty() && + DVHNumberOfBins.isEmpty() && + DVHData.isEmpty() && + DVHMinimumDose.isEmpty() && + DVHMaximumDose.isEmpty() && + DVHMeanDose.isEmpty(); +} + + +OFBool DRTDVHSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDVHSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + DVHReferencedROISequence.read(item, "1-n", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHType, "1", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DoseUnits, "1", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DoseType, "1", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHDoseScaling, "1", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHVolumeUnits, "1", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHNumberOfBins, "1", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHData, "2-2n", "1", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHMinimumDose, "1", "3", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHMaximumDose, "1", "3", "DVHSequence"); + getAndCheckElementFromDataset(item, DVHMeanDose, "1", "3", "DVHSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDVHSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + if (result.good()) result = DVHReferencedROISequence.write(item, "1-n", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmCodeString(DVHType), "1", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmCodeString(DoseUnits), "1", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmCodeString(DoseType), "1", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmDecimalString(DVHDoseScaling), "1", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmCodeString(DVHVolumeUnits), "1", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmIntegerString(DVHNumberOfBins), "1", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmDecimalString(DVHData), "2-2n", "1", "DVHSequence"); + addElementToDataset(result, item, new DcmDecimalString(DVHMinimumDose), "1", "3", "DVHSequence"); + addElementToDataset(result, item, new DcmDecimalString(DVHMaximumDose), "1", "3", "DVHSequence"); + addElementToDataset(result, item, new DcmDecimalString(DVHMeanDose), "1", "3", "DVHSequence"); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::getDVHData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHData, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DVHData).getFloat64(value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DVHData).getFloat64Vector(value); +} + + +OFCondition DRTDVHSequence::Item::getDVHDoseScaling(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHDoseScaling, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHDoseScaling(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DVHDoseScaling).getFloat64(value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHMaximumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHMaximumDose, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHMaximumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DVHMaximumDose).getFloat64(value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHMeanDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHMeanDose, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHMeanDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DVHMeanDose).getFloat64(value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHMinimumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHMinimumDose, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHMinimumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DVHMinimumDose).getFloat64(value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHNumberOfBins(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHNumberOfBins, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHNumberOfBins(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, DVHNumberOfBins).getSint32(value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHType, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDVHVolumeUnits(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHVolumeUnits, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDoseType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseType, value, pos); +} + + +OFCondition DRTDVHSequence::Item::getDoseUnits(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseUnits, value, pos); +} + + +OFCondition DRTDVHSequence::Item::setDVHData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2-2n") : EC_Normal; + if (result.good()) + result = DVHData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDVHDoseScaling(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHDoseScaling.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDVHMaximumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHMaximumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDVHMeanDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHMeanDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDVHMinimumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHMinimumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDVHNumberOfBins(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHNumberOfBins.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDVHType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDVHVolumeUnits(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHVolumeUnits.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDoseType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHSequence::Item::setDoseUnits(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseUnits.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDVHSequence::DRTDVHSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDVHSequence::DRTDVHSequence(const DRTDVHSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDVHSequence &DRTDVHSequence::operator=(const DRTDVHSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDVHSequence::~DRTDVHSequence() +{ + clear(); +} + + +void DRTDVHSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDVHSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDVHSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDVHSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDVHSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDVHSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDVHSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDVHSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDVHSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDVHSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDVHSequence::Item &DRTDVHSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDVHSequence::Item &DRTDVHSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDVHSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDVHSequence::Item &DRTDVHSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDVHSequence::Item &DRTDVHSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDVHSequence::Item &DRTDVHSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDVHSequence::Item &DRTDVHSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDVHSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDVHSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDVHSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDVHSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DVHSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DVHSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDVHSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DVHSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtdvrrs.cc b/dcmrt/libsrc/drtdvrrs.cc new file mode 100644 index 00000000..27bbfa9f --- /dev/null +++ b/dcmrt/libsrc/drtdvrrs.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTDVHReferencedROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtdvrrs.h" + + +// --- item class --- + +DRTDVHReferencedROISequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DVHROIContributionType(DCM_DVHROIContributionType), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTDVHReferencedROISequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DVHROIContributionType(copy.DVHROIContributionType), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTDVHReferencedROISequence::Item::~Item() +{ +} + + +DRTDVHReferencedROISequence::Item &DRTDVHReferencedROISequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DVHROIContributionType = copy.DVHROIContributionType; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTDVHReferencedROISequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedROINumber.clear(); + DVHROIContributionType.clear(); + } +} + + +OFBool DRTDVHReferencedROISequence::Item::isEmpty() +{ + return ReferencedROINumber.isEmpty() && + DVHROIContributionType.isEmpty(); +} + + +OFBool DRTDVHReferencedROISequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTDVHReferencedROISequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "DVHReferencedROISequence"); + getAndCheckElementFromDataset(item, DVHROIContributionType, "1", "1", "DVHReferencedROISequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "DVHReferencedROISequence"); + addElementToDataset(result, item, new DcmCodeString(DVHROIContributionType), "1", "1", "DVHReferencedROISequence"); + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::Item::getDVHROIContributionType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DVHROIContributionType, value, pos); +} + + +OFCondition DRTDVHReferencedROISequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTDVHReferencedROISequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTDVHReferencedROISequence::Item::setDVHROIContributionType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DVHROIContributionType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTDVHReferencedROISequence::DRTDVHReferencedROISequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTDVHReferencedROISequence::DRTDVHReferencedROISequence(const DRTDVHReferencedROISequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTDVHReferencedROISequence &DRTDVHReferencedROISequence::operator=(const DRTDVHReferencedROISequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTDVHReferencedROISequence::~DRTDVHReferencedROISequence() +{ + clear(); +} + + +void DRTDVHReferencedROISequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTDVHReferencedROISequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTDVHReferencedROISequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTDVHReferencedROISequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTDVHReferencedROISequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTDVHReferencedROISequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTDVHReferencedROISequence::Item &DRTDVHReferencedROISequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTDVHReferencedROISequence::Item &DRTDVHReferencedROISequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTDVHReferencedROISequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTDVHReferencedROISequence::Item &DRTDVHReferencedROISequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTDVHReferencedROISequence::Item &DRTDVHReferencedROISequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTDVHReferencedROISequence::Item &DRTDVHReferencedROISequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTDVHReferencedROISequence::Item &DRTDVHReferencedROISequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTDVHReferencedROISequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_DVHReferencedROISequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_DVHReferencedROISequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTDVHReferencedROISequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_DVHReferencedROISequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drteas.cc b/dcmrt/libsrc/drteas.cc new file mode 100644 index 00000000..f7b361bf --- /dev/null +++ b/dcmrt/libsrc/drteas.cc @@ -0,0 +1,579 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTEncryptedAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drteas.h" + + +// --- item class --- + +DRTEncryptedAttributesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + EncryptedContent(DCM_EncryptedContent), + EncryptedContentTransferSyntaxUID(DCM_EncryptedContentTransferSyntaxUID) +{ +} + + +DRTEncryptedAttributesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + EncryptedContent(copy.EncryptedContent), + EncryptedContentTransferSyntaxUID(copy.EncryptedContentTransferSyntaxUID) +{ +} + + +DRTEncryptedAttributesSequence::Item::~Item() +{ +} + + +DRTEncryptedAttributesSequence::Item &DRTEncryptedAttributesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + EncryptedContent = copy.EncryptedContent; + EncryptedContentTransferSyntaxUID = copy.EncryptedContentTransferSyntaxUID; + } + return *this; +} + + +void DRTEncryptedAttributesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + EncryptedContentTransferSyntaxUID.clear(); + EncryptedContent.clear(); + } +} + + +OFBool DRTEncryptedAttributesSequence::Item::isEmpty() +{ + return EncryptedContentTransferSyntaxUID.isEmpty() && + EncryptedContent.isEmpty(); +} + + +OFBool DRTEncryptedAttributesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTEncryptedAttributesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, EncryptedContentTransferSyntaxUID, "1", "1", "EncryptedAttributesSequence"); + getAndCheckElementFromDataset(item, EncryptedContent, "1", "1", "EncryptedAttributesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(EncryptedContentTransferSyntaxUID), "1", "1", "EncryptedAttributesSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(EncryptedContent), "1", "1", "EncryptedAttributesSequence"); + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::Item::getEncryptedContent(Uint8 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, EncryptedContent).getUint8Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, EncryptedContent).getLength() / sizeof(Uint8); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::Item::getEncryptedContentTransferSyntaxUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(EncryptedContentTransferSyntaxUID, value, pos); +} + + +OFCondition DRTEncryptedAttributesSequence::Item::setEncryptedContent(const Uint8 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return EncryptedContent.putUint8Array(value, count); +} + + +OFCondition DRTEncryptedAttributesSequence::Item::setEncryptedContentTransferSyntaxUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EncryptedContentTransferSyntaxUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTEncryptedAttributesSequence::DRTEncryptedAttributesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTEncryptedAttributesSequence::DRTEncryptedAttributesSequence(const DRTEncryptedAttributesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTEncryptedAttributesSequence &DRTEncryptedAttributesSequence::operator=(const DRTEncryptedAttributesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTEncryptedAttributesSequence::~DRTEncryptedAttributesSequence() +{ + clear(); +} + + +void DRTEncryptedAttributesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTEncryptedAttributesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTEncryptedAttributesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTEncryptedAttributesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTEncryptedAttributesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTEncryptedAttributesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTEncryptedAttributesSequence::Item &DRTEncryptedAttributesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTEncryptedAttributesSequence::Item &DRTEncryptedAttributesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTEncryptedAttributesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTEncryptedAttributesSequence::Item &DRTEncryptedAttributesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTEncryptedAttributesSequence::Item &DRTEncryptedAttributesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTEncryptedAttributesSequence::Item &DRTEncryptedAttributesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTEncryptedAttributesSequence::Item &DRTEncryptedAttributesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTEncryptedAttributesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_EncryptedAttributesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_EncryptedAttributesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTEncryptedAttributesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_EncryptedAttributesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtecs.cc b/dcmrt/libsrc/drtecs.cc new file mode 100644 index 00000000..35ca822a --- /dev/null +++ b/dcmrt/libsrc/drtecs.cc @@ -0,0 +1,950 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTEquivalentCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtecs.h" + + +// --- item class --- + +DRTEquivalentCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTEquivalentCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTEquivalentCodeSequence::Item::~Item() +{ +} + + +DRTEquivalentCodeSequence::Item &DRTEquivalentCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTEquivalentCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTEquivalentCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTEquivalentCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTEquivalentCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "EquivalentCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "EquivalentCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "EquivalentCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "EquivalentCodeSequence"); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTEquivalentCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTEquivalentCodeSequence::DRTEquivalentCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTEquivalentCodeSequence::DRTEquivalentCodeSequence(const DRTEquivalentCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTEquivalentCodeSequence &DRTEquivalentCodeSequence::operator=(const DRTEquivalentCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTEquivalentCodeSequence::~DRTEquivalentCodeSequence() +{ + clear(); +} + + +void DRTEquivalentCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTEquivalentCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTEquivalentCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTEquivalentCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTEquivalentCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTEquivalentCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTEquivalentCodeSequence::Item &DRTEquivalentCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTEquivalentCodeSequence::Item &DRTEquivalentCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTEquivalentCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTEquivalentCodeSequence::Item &DRTEquivalentCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTEquivalentCodeSequence::Item &DRTEquivalentCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTEquivalentCodeSequence::Item &DRTEquivalentCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTEquivalentCodeSequence::Item &DRTEquivalentCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTEquivalentCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_EquivalentCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_EquivalentCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTEquivalentCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_EquivalentCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtes.cc b/dcmrt/libsrc/drtes.cc new file mode 100644 index 00000000..50eab423 --- /dev/null +++ b/dcmrt/libsrc/drtes.cc @@ -0,0 +1,1178 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTExposureSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtes.h" + + +// --- item class --- + +DRTExposureSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ApplicatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamLimitingDeviceAngle(DCM_BeamLimitingDeviceAngle), + BeamLimitingDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BlockSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DiaphragmPosition(DCM_DiaphragmPosition), + ExposureTime(DCM_ExposureTime), + ExposureTimeInms(DCM_ExposureTimeInms), + GantryAngle(DCM_GantryAngle), + GantryPitchAngle(DCM_GantryPitchAngle), + GeneralAccessorySequence(emptyDefaultItem /*emptyDefaultSequence*/), + KVP(DCM_KVP), + MetersetExposure(DCM_MetersetExposure), + NumberOfBlocks(DCM_NumberOfBlocks), + PatientSupportAngle(DCM_PatientSupportAngle), + PrimaryFluenceModeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedFrameNumber(DCM_ReferencedFrameNumber), + TableTopLateralPosition(DCM_TableTopLateralPosition), + TableTopLongitudinalPosition(DCM_TableTopLongitudinalPosition), + TableTopPitchAngle(DCM_TableTopPitchAngle), + TableTopRollAngle(DCM_TableTopRollAngle), + TableTopVerticalPosition(DCM_TableTopVerticalPosition), + XRayTubeCurrent(DCM_XRayTubeCurrent), + XRayTubeCurrentInmA(DCM_XRayTubeCurrentInmA) +{ +} + + +DRTExposureSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ApplicatorSequence(copy.ApplicatorSequence), + BeamLimitingDeviceAngle(copy.BeamLimitingDeviceAngle), + BeamLimitingDeviceSequence(copy.BeamLimitingDeviceSequence), + BlockSequence(copy.BlockSequence), + DiaphragmPosition(copy.DiaphragmPosition), + ExposureTime(copy.ExposureTime), + ExposureTimeInms(copy.ExposureTimeInms), + GantryAngle(copy.GantryAngle), + GantryPitchAngle(copy.GantryPitchAngle), + GeneralAccessorySequence(copy.GeneralAccessorySequence), + KVP(copy.KVP), + MetersetExposure(copy.MetersetExposure), + NumberOfBlocks(copy.NumberOfBlocks), + PatientSupportAngle(copy.PatientSupportAngle), + PrimaryFluenceModeSequence(copy.PrimaryFluenceModeSequence), + ReferencedFrameNumber(copy.ReferencedFrameNumber), + TableTopLateralPosition(copy.TableTopLateralPosition), + TableTopLongitudinalPosition(copy.TableTopLongitudinalPosition), + TableTopPitchAngle(copy.TableTopPitchAngle), + TableTopRollAngle(copy.TableTopRollAngle), + TableTopVerticalPosition(copy.TableTopVerticalPosition), + XRayTubeCurrent(copy.XRayTubeCurrent), + XRayTubeCurrentInmA(copy.XRayTubeCurrentInmA) +{ +} + + +DRTExposureSequence::Item::~Item() +{ +} + + +DRTExposureSequence::Item &DRTExposureSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ApplicatorSequence = copy.ApplicatorSequence; + BeamLimitingDeviceAngle = copy.BeamLimitingDeviceAngle; + BeamLimitingDeviceSequence = copy.BeamLimitingDeviceSequence; + BlockSequence = copy.BlockSequence; + DiaphragmPosition = copy.DiaphragmPosition; + ExposureTime = copy.ExposureTime; + ExposureTimeInms = copy.ExposureTimeInms; + GantryAngle = copy.GantryAngle; + GantryPitchAngle = copy.GantryPitchAngle; + GeneralAccessorySequence = copy.GeneralAccessorySequence; + KVP = copy.KVP; + MetersetExposure = copy.MetersetExposure; + NumberOfBlocks = copy.NumberOfBlocks; + PatientSupportAngle = copy.PatientSupportAngle; + PrimaryFluenceModeSequence = copy.PrimaryFluenceModeSequence; + ReferencedFrameNumber = copy.ReferencedFrameNumber; + TableTopLateralPosition = copy.TableTopLateralPosition; + TableTopLongitudinalPosition = copy.TableTopLongitudinalPosition; + TableTopPitchAngle = copy.TableTopPitchAngle; + TableTopRollAngle = copy.TableTopRollAngle; + TableTopVerticalPosition = copy.TableTopVerticalPosition; + XRayTubeCurrent = copy.XRayTubeCurrent; + XRayTubeCurrentInmA = copy.XRayTubeCurrentInmA; + } + return *this; +} + + +void DRTExposureSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedFrameNumber.clear(); + KVP.clear(); + PrimaryFluenceModeSequence.clear(); + XRayTubeCurrent.clear(); + XRayTubeCurrentInmA.clear(); + ExposureTime.clear(); + ExposureTimeInms.clear(); + MetersetExposure.clear(); + DiaphragmPosition.clear(); + BeamLimitingDeviceSequence.clear(); + GantryAngle.clear(); + GantryPitchAngle.clear(); + BeamLimitingDeviceAngle.clear(); + PatientSupportAngle.clear(); + TableTopPitchAngle.clear(); + TableTopRollAngle.clear(); + TableTopVerticalPosition.clear(); + TableTopLongitudinalPosition.clear(); + TableTopLateralPosition.clear(); + ApplicatorSequence.clear(); + GeneralAccessorySequence.clear(); + NumberOfBlocks.clear(); + BlockSequence.clear(); + } +} + + +OFBool DRTExposureSequence::Item::isEmpty() +{ + return ReferencedFrameNumber.isEmpty() && + KVP.isEmpty() && + PrimaryFluenceModeSequence.isEmpty() && + XRayTubeCurrent.isEmpty() && + XRayTubeCurrentInmA.isEmpty() && + ExposureTime.isEmpty() && + ExposureTimeInms.isEmpty() && + MetersetExposure.isEmpty() && + DiaphragmPosition.isEmpty() && + BeamLimitingDeviceSequence.isEmpty() && + GantryAngle.isEmpty() && + GantryPitchAngle.isEmpty() && + BeamLimitingDeviceAngle.isEmpty() && + PatientSupportAngle.isEmpty() && + TableTopPitchAngle.isEmpty() && + TableTopRollAngle.isEmpty() && + TableTopVerticalPosition.isEmpty() && + TableTopLongitudinalPosition.isEmpty() && + TableTopLateralPosition.isEmpty() && + ApplicatorSequence.isEmpty() && + GeneralAccessorySequence.isEmpty() && + NumberOfBlocks.isEmpty() && + BlockSequence.isEmpty(); +} + + +OFBool DRTExposureSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTExposureSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedFrameNumber, "1-n", "1C", "ExposureSequence"); + getAndCheckElementFromDataset(item, KVP, "1", "2C", "ExposureSequence"); + PrimaryFluenceModeSequence.read(item, "1-n", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, XRayTubeCurrent, "1", "2C", "ExposureSequence"); + getAndCheckElementFromDataset(item, XRayTubeCurrentInmA, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, ExposureTime, "1", "2C", "ExposureSequence"); + getAndCheckElementFromDataset(item, ExposureTimeInms, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, MetersetExposure, "1", "2C", "ExposureSequence"); + getAndCheckElementFromDataset(item, DiaphragmPosition, "4", "3", "ExposureSequence"); + BeamLimitingDeviceSequence.read(item, "1-n", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, GantryAngle, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, GantryPitchAngle, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceAngle, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, PatientSupportAngle, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, TableTopPitchAngle, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, TableTopRollAngle, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, TableTopVerticalPosition, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, TableTopLongitudinalPosition, "1", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, TableTopLateralPosition, "1", "3", "ExposureSequence"); + ApplicatorSequence.read(item, "1-n", "3", "ExposureSequence"); + GeneralAccessorySequence.read(item, "1-n", "3", "ExposureSequence"); + getAndCheckElementFromDataset(item, NumberOfBlocks, "1", "1", "ExposureSequence"); + BlockSequence.read(item, "1-n", "2C", "ExposureSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTExposureSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedFrameNumber), "1-n", "1C", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(KVP), "1", "2C", "ExposureSequence"); + if (result.good()) result = PrimaryFluenceModeSequence.write(item, "1-n", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmIntegerString(XRayTubeCurrent), "1", "2C", "ExposureSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(XRayTubeCurrentInmA), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmIntegerString(ExposureTime), "1", "2C", "ExposureSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(ExposureTimeInms), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(MetersetExposure), "1", "2C", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(DiaphragmPosition), "4", "3", "ExposureSequence"); + if (result.good()) result = BeamLimitingDeviceSequence.write(item, "1-n", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(GantryAngle), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(GantryPitchAngle), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamLimitingDeviceAngle), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(PatientSupportAngle), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopPitchAngle), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopRollAngle), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopVerticalPosition), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLongitudinalPosition), "1", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLateralPosition), "1", "3", "ExposureSequence"); + if (result.good()) result = ApplicatorSequence.write(item, "1-n", "3", "ExposureSequence"); + if (result.good()) result = GeneralAccessorySequence.write(item, "1-n", "3", "ExposureSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBlocks), "1", "1", "ExposureSequence"); + if (result.good()) result = BlockSequence.write(item, "1-n", "2C", "ExposureSequence"); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::getBeamLimitingDeviceAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceAngle, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamLimitingDeviceAngle).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getDiaphragmPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DiaphragmPosition, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getDiaphragmPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DiaphragmPosition).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getDiaphragmPosition(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DiaphragmPosition).getFloat64Vector(value); +} + + +OFCondition DRTExposureSequence::Item::getExposureTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ExposureTime, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getExposureTime(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ExposureTime).getSint32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getExposureTimeInms(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, ExposureTimeInms).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getGantryAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryAngle, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getGantryAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, GantryAngle).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getGantryPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, GantryPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getKVP(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(KVP, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getKVP(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, KVP).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getMetersetExposure(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MetersetExposure, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getMetersetExposure(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, MetersetExposure).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getNumberOfBlocks(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBlocks, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getNumberOfBlocks(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBlocks).getSint32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getPatientSupportAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAngle, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getPatientSupportAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, PatientSupportAngle).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getReferencedFrameNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameNumber, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getReferencedFrameNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFrameNumber).getSint32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopLateralPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLateralPosition, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopLateralPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLateralPosition).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopLongitudinalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLongitudinalPosition, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalPosition).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopRollAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopRollAngle).getFloat32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopVerticalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopVerticalPosition, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getTableTopVerticalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopVerticalPosition).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getXRayTubeCurrent(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(XRayTubeCurrent, value, pos); +} + + +OFCondition DRTExposureSequence::Item::getXRayTubeCurrent(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, XRayTubeCurrent).getSint32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::getXRayTubeCurrentInmA(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, XRayTubeCurrentInmA).getFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::setBeamLimitingDeviceAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setDiaphragmPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "4") : EC_Normal; + if (result.good()) + result = DiaphragmPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setExposureTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ExposureTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setExposureTimeInms(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ExposureTimeInms.putFloat64(value, pos); +} + + +OFCondition DRTExposureSequence::Item::setGantryAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setGantryPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return GantryPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::setKVP(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = KVP.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setMetersetExposure(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MetersetExposure.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setNumberOfBlocks(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBlocks.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setPatientSupportAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setReferencedFrameNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ReferencedFrameNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setTableTopLateralPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setTableTopLongitudinalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setTableTopPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::setTableTopRollAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopRollAngle.putFloat32(value, pos); +} + + +OFCondition DRTExposureSequence::Item::setTableTopVerticalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setXRayTubeCurrent(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = XRayTubeCurrent.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTExposureSequence::Item::setXRayTubeCurrentInmA(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return XRayTubeCurrentInmA.putFloat64(value, pos); +} + + +// --- sequence class --- + +DRTExposureSequence::DRTExposureSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTExposureSequence::DRTExposureSequence(const DRTExposureSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTExposureSequence &DRTExposureSequence::operator=(const DRTExposureSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTExposureSequence::~DRTExposureSequence() +{ + clear(); +} + + +void DRTExposureSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTExposureSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTExposureSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTExposureSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTExposureSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTExposureSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTExposureSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTExposureSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTExposureSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTExposureSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTExposureSequence::Item &DRTExposureSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTExposureSequence::Item &DRTExposureSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTExposureSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTExposureSequence::Item &DRTExposureSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTExposureSequence::Item &DRTExposureSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTExposureSequence::Item &DRTExposureSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTExposureSequence::Item &DRTExposureSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTExposureSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTExposureSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTExposureSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTExposureSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ExposureSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ExposureSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTExposureSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ExposureSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtfds.cc b/dcmrt/libsrc/drtfds.cc new file mode 100644 index 00000000..91188714 --- /dev/null +++ b/dcmrt/libsrc/drtfds.cc @@ -0,0 +1,710 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTFixationDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtfds.h" + + +// --- item class --- + +DRTFixationDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + FixationDeviceDescription(DCM_FixationDeviceDescription), + FixationDeviceLabel(DCM_FixationDeviceLabel), + FixationDevicePitchAngle(DCM_FixationDevicePitchAngle), + FixationDevicePosition(DCM_FixationDevicePosition), + FixationDeviceRollAngle(DCM_FixationDeviceRollAngle), + FixationDeviceType(DCM_FixationDeviceType) +{ +} + + +DRTFixationDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + FixationDeviceDescription(copy.FixationDeviceDescription), + FixationDeviceLabel(copy.FixationDeviceLabel), + FixationDevicePitchAngle(copy.FixationDevicePitchAngle), + FixationDevicePosition(copy.FixationDevicePosition), + FixationDeviceRollAngle(copy.FixationDeviceRollAngle), + FixationDeviceType(copy.FixationDeviceType) +{ +} + + +DRTFixationDeviceSequence::Item::~Item() +{ +} + + +DRTFixationDeviceSequence::Item &DRTFixationDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + FixationDeviceDescription = copy.FixationDeviceDescription; + FixationDeviceLabel = copy.FixationDeviceLabel; + FixationDevicePitchAngle = copy.FixationDevicePitchAngle; + FixationDevicePosition = copy.FixationDevicePosition; + FixationDeviceRollAngle = copy.FixationDeviceRollAngle; + FixationDeviceType = copy.FixationDeviceType; + } + return *this; +} + + +void DRTFixationDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + FixationDeviceType.clear(); + FixationDeviceLabel.clear(); + FixationDeviceDescription.clear(); + FixationDevicePosition.clear(); + FixationDevicePitchAngle.clear(); + FixationDeviceRollAngle.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTFixationDeviceSequence::Item::isEmpty() +{ + return FixationDeviceType.isEmpty() && + FixationDeviceLabel.isEmpty() && + FixationDeviceDescription.isEmpty() && + FixationDevicePosition.isEmpty() && + FixationDevicePitchAngle.isEmpty() && + FixationDeviceRollAngle.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTFixationDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTFixationDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, FixationDeviceType, "1", "1", "FixationDeviceSequence"); + getAndCheckElementFromDataset(item, FixationDeviceLabel, "1", "2", "FixationDeviceSequence"); + getAndCheckElementFromDataset(item, FixationDeviceDescription, "1", "3", "FixationDeviceSequence"); + getAndCheckElementFromDataset(item, FixationDevicePosition, "1", "3", "FixationDeviceSequence"); + getAndCheckElementFromDataset(item, FixationDevicePitchAngle, "1", "3", "FixationDeviceSequence"); + getAndCheckElementFromDataset(item, FixationDeviceRollAngle, "1", "3", "FixationDeviceSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "FixationDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(FixationDeviceType), "1", "1", "FixationDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(FixationDeviceLabel), "1", "2", "FixationDeviceSequence"); + addElementToDataset(result, item, new DcmShortText(FixationDeviceDescription), "1", "3", "FixationDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(FixationDevicePosition), "1", "3", "FixationDeviceSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(FixationDevicePitchAngle), "1", "3", "FixationDeviceSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(FixationDeviceRollAngle), "1", "3", "FixationDeviceSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "FixationDeviceSequence"); + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::getFixationDeviceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationDeviceDescription, value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::getFixationDeviceLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationDeviceLabel, value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::getFixationDevicePitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, FixationDevicePitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::getFixationDevicePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationDevicePosition, value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::getFixationDeviceRollAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, FixationDeviceRollAngle).getFloat32(value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::getFixationDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationDeviceType, value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::Item::setFixationDeviceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = FixationDeviceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::Item::setFixationDeviceLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FixationDeviceLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::Item::setFixationDevicePitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FixationDevicePitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::setFixationDevicePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FixationDevicePosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::Item::setFixationDeviceRollAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FixationDeviceRollAngle.putFloat32(value, pos); +} + + +OFCondition DRTFixationDeviceSequence::Item::setFixationDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FixationDeviceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTFixationDeviceSequence::DRTFixationDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTFixationDeviceSequence::DRTFixationDeviceSequence(const DRTFixationDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTFixationDeviceSequence &DRTFixationDeviceSequence::operator=(const DRTFixationDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTFixationDeviceSequence::~DRTFixationDeviceSequence() +{ + clear(); +} + + +void DRTFixationDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTFixationDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTFixationDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTFixationDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTFixationDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTFixationDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTFixationDeviceSequence::Item &DRTFixationDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTFixationDeviceSequence::Item &DRTFixationDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTFixationDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTFixationDeviceSequence::Item &DRTFixationDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTFixationDeviceSequence::Item &DRTFixationDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTFixationDeviceSequence::Item &DRTFixationDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTFixationDeviceSequence::Item &DRTFixationDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTFixationDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_FixationDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_FixationDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTFixationDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_FixationDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtfes.cc b/dcmrt/libsrc/drtfes.cc new file mode 100644 index 00000000..f1e4e01c --- /dev/null +++ b/dcmrt/libsrc/drtfes.cc @@ -0,0 +1,619 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTFrameExtractionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtfes.h" + + +// --- item class --- + +DRTFrameExtractionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CalculatedFrameList(DCM_CalculatedFrameList), + MultiFrameSourceSOPInstanceUID(DCM_MultiFrameSourceSOPInstanceUID), + SimpleFrameList(DCM_SimpleFrameList), + TimeRange(DCM_TimeRange) +{ +} + + +DRTFrameExtractionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CalculatedFrameList(copy.CalculatedFrameList), + MultiFrameSourceSOPInstanceUID(copy.MultiFrameSourceSOPInstanceUID), + SimpleFrameList(copy.SimpleFrameList), + TimeRange(copy.TimeRange) +{ +} + + +DRTFrameExtractionSequence::Item::~Item() +{ +} + + +DRTFrameExtractionSequence::Item &DRTFrameExtractionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CalculatedFrameList = copy.CalculatedFrameList; + MultiFrameSourceSOPInstanceUID = copy.MultiFrameSourceSOPInstanceUID; + SimpleFrameList = copy.SimpleFrameList; + TimeRange = copy.TimeRange; + } + return *this; +} + + +void DRTFrameExtractionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + MultiFrameSourceSOPInstanceUID.clear(); + SimpleFrameList.clear(); + CalculatedFrameList.clear(); + TimeRange.clear(); + } +} + + +OFBool DRTFrameExtractionSequence::Item::isEmpty() +{ + return MultiFrameSourceSOPInstanceUID.isEmpty() && + SimpleFrameList.isEmpty() && + CalculatedFrameList.isEmpty() && + TimeRange.isEmpty(); +} + + +OFBool DRTFrameExtractionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTFrameExtractionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, MultiFrameSourceSOPInstanceUID, "1", "1", "FrameExtractionSequence"); + getAndCheckElementFromDataset(item, SimpleFrameList, "1-n", "1C", "FrameExtractionSequence"); + getAndCheckElementFromDataset(item, CalculatedFrameList, "3-3n", "1C", "FrameExtractionSequence"); + getAndCheckElementFromDataset(item, TimeRange, "2", "1C", "FrameExtractionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(MultiFrameSourceSOPInstanceUID), "1", "1", "FrameExtractionSequence"); + addElementToDataset(result, item, new DcmUnsignedLong(SimpleFrameList), "1-n", "1C", "FrameExtractionSequence"); + addElementToDataset(result, item, new DcmUnsignedLong(CalculatedFrameList), "3-3n", "1C", "FrameExtractionSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(TimeRange), "2", "1C", "FrameExtractionSequence"); + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::Item::getCalculatedFrameList(Uint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedLong &, CalculatedFrameList).getUint32(value, pos); +} + + +OFCondition DRTFrameExtractionSequence::Item::getMultiFrameSourceSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MultiFrameSourceSOPInstanceUID, value, pos); +} + + +OFCondition DRTFrameExtractionSequence::Item::getSimpleFrameList(Uint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedLong &, SimpleFrameList).getUint32(value, pos); +} + + +OFCondition DRTFrameExtractionSequence::Item::getTimeRange(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, TimeRange).getFloat64(value, pos); +} + + +OFCondition DRTFrameExtractionSequence::Item::setCalculatedFrameList(const Uint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return CalculatedFrameList.putUint32(value, pos); +} + + +OFCondition DRTFrameExtractionSequence::Item::setMultiFrameSourceSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MultiFrameSourceSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::Item::setSimpleFrameList(const Uint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SimpleFrameList.putUint32(value, pos); +} + + +OFCondition DRTFrameExtractionSequence::Item::setTimeRange(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TimeRange.putFloat64(value, pos); +} + + +// --- sequence class --- + +DRTFrameExtractionSequence::DRTFrameExtractionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTFrameExtractionSequence::DRTFrameExtractionSequence(const DRTFrameExtractionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTFrameExtractionSequence &DRTFrameExtractionSequence::operator=(const DRTFrameExtractionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTFrameExtractionSequence::~DRTFrameExtractionSequence() +{ + clear(); +} + + +void DRTFrameExtractionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTFrameExtractionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTFrameExtractionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTFrameExtractionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTFrameExtractionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTFrameExtractionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTFrameExtractionSequence::Item &DRTFrameExtractionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTFrameExtractionSequence::Item &DRTFrameExtractionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTFrameExtractionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTFrameExtractionSequence::Item &DRTFrameExtractionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTFrameExtractionSequence::Item &DRTFrameExtractionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTFrameExtractionSequence::Item &DRTFrameExtractionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTFrameExtractionSequence::Item &DRTFrameExtractionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTFrameExtractionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_FrameExtractionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_FrameExtractionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTFrameExtractionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_FrameExtractionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtfgs.cc b/dcmrt/libsrc/drtfgs.cc new file mode 100644 index 00000000..d0f1d7be --- /dev/null +++ b/dcmrt/libsrc/drtfgs.cc @@ -0,0 +1,858 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTFractionGroupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtfgs.h" + + +// --- item class --- + +DRTFractionGroupSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamDoseMeaning(DCM_BeamDoseMeaning), + FractionGroupDescription(DCM_FractionGroupDescription), + FractionGroupNumber(DCM_FractionGroupNumber), + FractionPattern(DCM_FractionPattern), + NumberOfBeams(DCM_NumberOfBeams), + NumberOfBrachyApplicationSetups(DCM_NumberOfBrachyApplicationSetups), + NumberOfFractionPatternDigitsPerDay(DCM_NumberOfFractionPatternDigitsPerDay), + NumberOfFractionsPlanned(DCM_NumberOfFractionsPlanned), + ReferencedBeamSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedBrachyApplicationSetupSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedDoseReferenceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedDoseSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RepeatFractionCycleLength(DCM_RepeatFractionCycleLength) +{ +} + + +DRTFractionGroupSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamDoseMeaning(copy.BeamDoseMeaning), + FractionGroupDescription(copy.FractionGroupDescription), + FractionGroupNumber(copy.FractionGroupNumber), + FractionPattern(copy.FractionPattern), + NumberOfBeams(copy.NumberOfBeams), + NumberOfBrachyApplicationSetups(copy.NumberOfBrachyApplicationSetups), + NumberOfFractionPatternDigitsPerDay(copy.NumberOfFractionPatternDigitsPerDay), + NumberOfFractionsPlanned(copy.NumberOfFractionsPlanned), + ReferencedBeamSequence(copy.ReferencedBeamSequence), + ReferencedBrachyApplicationSetupSequence(copy.ReferencedBrachyApplicationSetupSequence), + ReferencedDoseReferenceSequence(copy.ReferencedDoseReferenceSequence), + ReferencedDoseSequence(copy.ReferencedDoseSequence), + RepeatFractionCycleLength(copy.RepeatFractionCycleLength) +{ +} + + +DRTFractionGroupSequence::Item::~Item() +{ +} + + +DRTFractionGroupSequence::Item &DRTFractionGroupSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamDoseMeaning = copy.BeamDoseMeaning; + FractionGroupDescription = copy.FractionGroupDescription; + FractionGroupNumber = copy.FractionGroupNumber; + FractionPattern = copy.FractionPattern; + NumberOfBeams = copy.NumberOfBeams; + NumberOfBrachyApplicationSetups = copy.NumberOfBrachyApplicationSetups; + NumberOfFractionPatternDigitsPerDay = copy.NumberOfFractionPatternDigitsPerDay; + NumberOfFractionsPlanned = copy.NumberOfFractionsPlanned; + ReferencedBeamSequence = copy.ReferencedBeamSequence; + ReferencedBrachyApplicationSetupSequence = copy.ReferencedBrachyApplicationSetupSequence; + ReferencedDoseReferenceSequence = copy.ReferencedDoseReferenceSequence; + ReferencedDoseSequence = copy.ReferencedDoseSequence; + RepeatFractionCycleLength = copy.RepeatFractionCycleLength; + } + return *this; +} + + +void DRTFractionGroupSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + FractionGroupNumber.clear(); + FractionGroupDescription.clear(); + ReferencedDoseSequence.clear(); + ReferencedDoseReferenceSequence.clear(); + NumberOfFractionsPlanned.clear(); + NumberOfFractionPatternDigitsPerDay.clear(); + RepeatFractionCycleLength.clear(); + FractionPattern.clear(); + BeamDoseMeaning.clear(); + NumberOfBeams.clear(); + ReferencedBeamSequence.clear(); + NumberOfBrachyApplicationSetups.clear(); + ReferencedBrachyApplicationSetupSequence.clear(); + } +} + + +OFBool DRTFractionGroupSequence::Item::isEmpty() +{ + return FractionGroupNumber.isEmpty() && + FractionGroupDescription.isEmpty() && + ReferencedDoseSequence.isEmpty() && + ReferencedDoseReferenceSequence.isEmpty() && + NumberOfFractionsPlanned.isEmpty() && + NumberOfFractionPatternDigitsPerDay.isEmpty() && + RepeatFractionCycleLength.isEmpty() && + FractionPattern.isEmpty() && + BeamDoseMeaning.isEmpty() && + NumberOfBeams.isEmpty() && + ReferencedBeamSequence.isEmpty() && + NumberOfBrachyApplicationSetups.isEmpty() && + ReferencedBrachyApplicationSetupSequence.isEmpty(); +} + + +OFBool DRTFractionGroupSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTFractionGroupSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, FractionGroupNumber, "1", "1", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, FractionGroupDescription, "1", "3", "FractionGroupSequence"); + ReferencedDoseSequence.read(item, "1-n", "3", "FractionGroupSequence"); + ReferencedDoseReferenceSequence.read(item, "1-n", "3", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, NumberOfFractionsPlanned, "1", "2", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, NumberOfFractionPatternDigitsPerDay, "1", "3", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, RepeatFractionCycleLength, "1", "3", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, FractionPattern, "1", "3", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, BeamDoseMeaning, "1", "3", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, NumberOfBeams, "1", "1", "FractionGroupSequence"); + ReferencedBeamSequence.read(item, "1-n", "1C", "FractionGroupSequence"); + getAndCheckElementFromDataset(item, NumberOfBrachyApplicationSetups, "1", "1", "FractionGroupSequence"); + ReferencedBrachyApplicationSetupSequence.read(item, "1-n", "1C", "FractionGroupSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(FractionGroupNumber), "1", "1", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmLongString(FractionGroupDescription), "1", "3", "FractionGroupSequence"); + if (result.good()) result = ReferencedDoseSequence.write(item, "1-n", "3", "FractionGroupSequence"); + if (result.good()) result = ReferencedDoseReferenceSequence.write(item, "1-n", "3", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfFractionsPlanned), "1", "2", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfFractionPatternDigitsPerDay), "1", "3", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmIntegerString(RepeatFractionCycleLength), "1", "3", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmLongText(FractionPattern), "1", "3", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamDoseMeaning), "1", "3", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBeams), "1", "1", "FractionGroupSequence"); + if (result.good()) result = ReferencedBeamSequence.write(item, "1-n", "1C", "FractionGroupSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBrachyApplicationSetups), "1", "1", "FractionGroupSequence"); + if (result.good()) result = ReferencedBrachyApplicationSetupSequence.write(item, "1-n", "1C", "FractionGroupSequence"); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::getBeamDoseMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDoseMeaning, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getFractionGroupDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FractionGroupDescription, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getFractionGroupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FractionGroupNumber, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getFractionGroupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, FractionGroupNumber).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getFractionPattern(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FractionPattern, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfBeams(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBeams, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfBeams(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBeams).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfBrachyApplicationSetups(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBrachyApplicationSetups, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfBrachyApplicationSetups(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBrachyApplicationSetups).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfFractionPatternDigitsPerDay(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfFractionPatternDigitsPerDay, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfFractionPatternDigitsPerDay(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfFractionPatternDigitsPerDay).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfFractionsPlanned(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfFractionsPlanned, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getNumberOfFractionsPlanned(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfFractionsPlanned).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getRepeatFractionCycleLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RepeatFractionCycleLength, value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::getRepeatFractionCycleLength(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, RepeatFractionCycleLength).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSequence::Item::setBeamDoseMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamDoseMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setFractionGroupDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FractionGroupDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setFractionGroupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FractionGroupNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setFractionPattern(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = FractionPattern.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setNumberOfBeams(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBeams.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setNumberOfBrachyApplicationSetups(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBrachyApplicationSetups.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setNumberOfFractionPatternDigitsPerDay(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFractionPatternDigitsPerDay.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setNumberOfFractionsPlanned(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFractionsPlanned.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::Item::setRepeatFractionCycleLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RepeatFractionCycleLength.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTFractionGroupSequence::DRTFractionGroupSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTFractionGroupSequence::DRTFractionGroupSequence(const DRTFractionGroupSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTFractionGroupSequence &DRTFractionGroupSequence::operator=(const DRTFractionGroupSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTFractionGroupSequence::~DRTFractionGroupSequence() +{ + clear(); +} + + +void DRTFractionGroupSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTFractionGroupSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTFractionGroupSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTFractionGroupSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTFractionGroupSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionGroupSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionGroupSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionGroupSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionGroupSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTFractionGroupSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTFractionGroupSequence::Item &DRTFractionGroupSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTFractionGroupSequence::Item &DRTFractionGroupSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTFractionGroupSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTFractionGroupSequence::Item &DRTFractionGroupSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTFractionGroupSequence::Item &DRTFractionGroupSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTFractionGroupSequence::Item &DRTFractionGroupSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTFractionGroupSequence::Item &DRTFractionGroupSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTFractionGroupSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTFractionGroupSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTFractionGroupSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionGroupSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_FractionGroupSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_FractionGroupSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTFractionGroupSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_FractionGroupSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtfgss.cc b/dcmrt/libsrc/drtfgss.cc new file mode 100644 index 00000000..c8864be2 --- /dev/null +++ b/dcmrt/libsrc/drtfgss.cc @@ -0,0 +1,665 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTFractionGroupSummarySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtfgss.h" + + +// --- item class --- + +DRTFractionGroupSummarySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + FractionGroupType(DCM_FractionGroupType), + FractionStatusSummarySequence(emptyDefaultItem /*emptyDefaultSequence*/), + NumberOfFractionsDelivered(DCM_NumberOfFractionsDelivered), + NumberOfFractionsPlanned(DCM_NumberOfFractionsPlanned), + ReferencedFractionGroupNumber(DCM_ReferencedFractionGroupNumber) +{ +} + + +DRTFractionGroupSummarySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + FractionGroupType(copy.FractionGroupType), + FractionStatusSummarySequence(copy.FractionStatusSummarySequence), + NumberOfFractionsDelivered(copy.NumberOfFractionsDelivered), + NumberOfFractionsPlanned(copy.NumberOfFractionsPlanned), + ReferencedFractionGroupNumber(copy.ReferencedFractionGroupNumber) +{ +} + + +DRTFractionGroupSummarySequence::Item::~Item() +{ +} + + +DRTFractionGroupSummarySequence::Item &DRTFractionGroupSummarySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + FractionGroupType = copy.FractionGroupType; + FractionStatusSummarySequence = copy.FractionStatusSummarySequence; + NumberOfFractionsDelivered = copy.NumberOfFractionsDelivered; + NumberOfFractionsPlanned = copy.NumberOfFractionsPlanned; + ReferencedFractionGroupNumber = copy.ReferencedFractionGroupNumber; + } + return *this; +} + + +void DRTFractionGroupSummarySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedFractionGroupNumber.clear(); + FractionGroupType.clear(); + NumberOfFractionsPlanned.clear(); + NumberOfFractionsDelivered.clear(); + FractionStatusSummarySequence.clear(); + } +} + + +OFBool DRTFractionGroupSummarySequence::Item::isEmpty() +{ + return ReferencedFractionGroupNumber.isEmpty() && + FractionGroupType.isEmpty() && + NumberOfFractionsPlanned.isEmpty() && + NumberOfFractionsDelivered.isEmpty() && + FractionStatusSummarySequence.isEmpty(); +} + + +OFBool DRTFractionGroupSummarySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTFractionGroupSummarySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedFractionGroupNumber, "1", "3", "FractionGroupSummarySequence"); + getAndCheckElementFromDataset(item, FractionGroupType, "1", "2", "FractionGroupSummarySequence"); + getAndCheckElementFromDataset(item, NumberOfFractionsPlanned, "1", "2", "FractionGroupSummarySequence"); + getAndCheckElementFromDataset(item, NumberOfFractionsDelivered, "1", "2", "FractionGroupSummarySequence"); + FractionStatusSummarySequence.read(item, "1-n", "3", "FractionGroupSummarySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedFractionGroupNumber), "1", "3", "FractionGroupSummarySequence"); + addElementToDataset(result, item, new DcmCodeString(FractionGroupType), "1", "2", "FractionGroupSummarySequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfFractionsPlanned), "1", "2", "FractionGroupSummarySequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfFractionsDelivered), "1", "2", "FractionGroupSummarySequence"); + if (result.good()) result = FractionStatusSummarySequence.write(item, "1-n", "3", "FractionGroupSummarySequence"); + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::Item::getFractionGroupType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FractionGroupType, value, pos); +} + + +OFCondition DRTFractionGroupSummarySequence::Item::getNumberOfFractionsDelivered(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfFractionsDelivered, value, pos); +} + + +OFCondition DRTFractionGroupSummarySequence::Item::getNumberOfFractionsDelivered(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfFractionsDelivered).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSummarySequence::Item::getNumberOfFractionsPlanned(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfFractionsPlanned, value, pos); +} + + +OFCondition DRTFractionGroupSummarySequence::Item::getNumberOfFractionsPlanned(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfFractionsPlanned).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSummarySequence::Item::getReferencedFractionGroupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFractionGroupNumber, value, pos); +} + + +OFCondition DRTFractionGroupSummarySequence::Item::getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFractionGroupNumber).getSint32(value, pos); +} + + +OFCondition DRTFractionGroupSummarySequence::Item::setFractionGroupType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FractionGroupType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::Item::setNumberOfFractionsDelivered(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFractionsDelivered.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::Item::setNumberOfFractionsPlanned(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFractionsPlanned.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::Item::setReferencedFractionGroupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedFractionGroupNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTFractionGroupSummarySequence::DRTFractionGroupSummarySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTFractionGroupSummarySequence::DRTFractionGroupSummarySequence(const DRTFractionGroupSummarySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTFractionGroupSummarySequence &DRTFractionGroupSummarySequence::operator=(const DRTFractionGroupSummarySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTFractionGroupSummarySequence::~DRTFractionGroupSummarySequence() +{ + clear(); +} + + +void DRTFractionGroupSummarySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTFractionGroupSummarySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTFractionGroupSummarySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTFractionGroupSummarySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTFractionGroupSummarySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTFractionGroupSummarySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTFractionGroupSummarySequence::Item &DRTFractionGroupSummarySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTFractionGroupSummarySequence::Item &DRTFractionGroupSummarySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTFractionGroupSummarySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTFractionGroupSummarySequence::Item &DRTFractionGroupSummarySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTFractionGroupSummarySequence::Item &DRTFractionGroupSummarySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTFractionGroupSummarySequence::Item &DRTFractionGroupSummarySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTFractionGroupSummarySequence::Item &DRTFractionGroupSummarySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTFractionGroupSummarySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_FractionGroupSummarySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_FractionGroupSummarySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTFractionGroupSummarySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_FractionGroupSummarySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtfms.cc b/dcmrt/libsrc/drtfms.cc new file mode 100644 index 00000000..7ff101ae --- /dev/null +++ b/dcmrt/libsrc/drtfms.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTFluenceMapSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtfms.h" + + +// --- item class --- + +DRTFluenceMapSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + FluenceDataScale(DCM_FluenceDataScale), + FluenceDataSource(DCM_FluenceDataSource) +{ +} + + +DRTFluenceMapSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + FluenceDataScale(copy.FluenceDataScale), + FluenceDataSource(copy.FluenceDataSource) +{ +} + + +DRTFluenceMapSequence::Item::~Item() +{ +} + + +DRTFluenceMapSequence::Item &DRTFluenceMapSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + FluenceDataScale = copy.FluenceDataScale; + FluenceDataSource = copy.FluenceDataSource; + } + return *this; +} + + +void DRTFluenceMapSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + FluenceDataSource.clear(); + FluenceDataScale.clear(); + } +} + + +OFBool DRTFluenceMapSequence::Item::isEmpty() +{ + return FluenceDataSource.isEmpty() && + FluenceDataScale.isEmpty(); +} + + +OFBool DRTFluenceMapSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTFluenceMapSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, FluenceDataSource, "1", "1", "FluenceMapSequence"); + getAndCheckElementFromDataset(item, FluenceDataScale, "1", "3", "FluenceMapSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFluenceMapSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(FluenceDataSource), "1", "1", "FluenceMapSequence"); + addElementToDataset(result, item, new DcmDecimalString(FluenceDataScale), "1", "3", "FluenceMapSequence"); + } + return result; +} + + +OFCondition DRTFluenceMapSequence::Item::getFluenceDataScale(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FluenceDataScale, value, pos); +} + + +OFCondition DRTFluenceMapSequence::Item::getFluenceDataScale(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, FluenceDataScale).getFloat64(value, pos); +} + + +OFCondition DRTFluenceMapSequence::Item::getFluenceDataSource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FluenceDataSource, value, pos); +} + + +OFCondition DRTFluenceMapSequence::Item::setFluenceDataScale(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FluenceDataScale.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFluenceMapSequence::Item::setFluenceDataSource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FluenceDataSource.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTFluenceMapSequence::DRTFluenceMapSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTFluenceMapSequence::DRTFluenceMapSequence(const DRTFluenceMapSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTFluenceMapSequence &DRTFluenceMapSequence::operator=(const DRTFluenceMapSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTFluenceMapSequence::~DRTFluenceMapSequence() +{ + clear(); +} + + +void DRTFluenceMapSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTFluenceMapSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTFluenceMapSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTFluenceMapSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTFluenceMapSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFluenceMapSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFluenceMapSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFluenceMapSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFluenceMapSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTFluenceMapSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTFluenceMapSequence::Item &DRTFluenceMapSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTFluenceMapSequence::Item &DRTFluenceMapSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTFluenceMapSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTFluenceMapSequence::Item &DRTFluenceMapSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTFluenceMapSequence::Item &DRTFluenceMapSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTFluenceMapSequence::Item &DRTFluenceMapSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTFluenceMapSequence::Item &DRTFluenceMapSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTFluenceMapSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTFluenceMapSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTFluenceMapSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFluenceMapSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_FluenceMapSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_FluenceMapSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTFluenceMapSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_FluenceMapSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtfsss.cc b/dcmrt/libsrc/drtfsss.cc new file mode 100644 index 00000000..d5dfc7e2 --- /dev/null +++ b/dcmrt/libsrc/drtfsss.cc @@ -0,0 +1,640 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTFractionStatusSummarySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtfsss.h" + + +// --- item class --- + +DRTFractionStatusSummarySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedFractionNumber(DCM_ReferencedFractionNumber), + TreatmentDate(DCM_TreatmentDate), + TreatmentTerminationStatus(DCM_TreatmentTerminationStatus), + TreatmentTime(DCM_TreatmentTime) +{ +} + + +DRTFractionStatusSummarySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedFractionNumber(copy.ReferencedFractionNumber), + TreatmentDate(copy.TreatmentDate), + TreatmentTerminationStatus(copy.TreatmentTerminationStatus), + TreatmentTime(copy.TreatmentTime) +{ +} + + +DRTFractionStatusSummarySequence::Item::~Item() +{ +} + + +DRTFractionStatusSummarySequence::Item &DRTFractionStatusSummarySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedFractionNumber = copy.ReferencedFractionNumber; + TreatmentDate = copy.TreatmentDate; + TreatmentTerminationStatus = copy.TreatmentTerminationStatus; + TreatmentTime = copy.TreatmentTime; + } + return *this; +} + + +void DRTFractionStatusSummarySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedFractionNumber.clear(); + TreatmentDate.clear(); + TreatmentTime.clear(); + TreatmentTerminationStatus.clear(); + } +} + + +OFBool DRTFractionStatusSummarySequence::Item::isEmpty() +{ + return ReferencedFractionNumber.isEmpty() && + TreatmentDate.isEmpty() && + TreatmentTime.isEmpty() && + TreatmentTerminationStatus.isEmpty(); +} + + +OFBool DRTFractionStatusSummarySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTFractionStatusSummarySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedFractionNumber, "1", "1", "FractionStatusSummarySequence"); + getAndCheckElementFromDataset(item, TreatmentDate, "1", "2", "FractionStatusSummarySequence"); + getAndCheckElementFromDataset(item, TreatmentTime, "1", "2", "FractionStatusSummarySequence"); + getAndCheckElementFromDataset(item, TreatmentTerminationStatus, "1", "2", "FractionStatusSummarySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedFractionNumber), "1", "1", "FractionStatusSummarySequence"); + addElementToDataset(result, item, new DcmDate(TreatmentDate), "1", "2", "FractionStatusSummarySequence"); + addElementToDataset(result, item, new DcmTime(TreatmentTime), "1", "2", "FractionStatusSummarySequence"); + addElementToDataset(result, item, new DcmCodeString(TreatmentTerminationStatus), "1", "2", "FractionStatusSummarySequence"); + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::Item::getReferencedFractionNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFractionNumber, value, pos); +} + + +OFCondition DRTFractionStatusSummarySequence::Item::getReferencedFractionNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFractionNumber).getSint32(value, pos); +} + + +OFCondition DRTFractionStatusSummarySequence::Item::getTreatmentDate(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentDate, value, pos); +} + + +OFCondition DRTFractionStatusSummarySequence::Item::getTreatmentTerminationStatus(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentTerminationStatus, value, pos); +} + + +OFCondition DRTFractionStatusSummarySequence::Item::getTreatmentTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentTime, value, pos); +} + + +OFCondition DRTFractionStatusSummarySequence::Item::setReferencedFractionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedFractionNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::Item::setTreatmentDate(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentDate.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::Item::setTreatmentTerminationStatus(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentTerminationStatus.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::Item::setTreatmentTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentTime.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTFractionStatusSummarySequence::DRTFractionStatusSummarySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTFractionStatusSummarySequence::DRTFractionStatusSummarySequence(const DRTFractionStatusSummarySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTFractionStatusSummarySequence &DRTFractionStatusSummarySequence::operator=(const DRTFractionStatusSummarySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTFractionStatusSummarySequence::~DRTFractionStatusSummarySequence() +{ + clear(); +} + + +void DRTFractionStatusSummarySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTFractionStatusSummarySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTFractionStatusSummarySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTFractionStatusSummarySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTFractionStatusSummarySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTFractionStatusSummarySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTFractionStatusSummarySequence::Item &DRTFractionStatusSummarySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTFractionStatusSummarySequence::Item &DRTFractionStatusSummarySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTFractionStatusSummarySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTFractionStatusSummarySequence::Item &DRTFractionStatusSummarySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTFractionStatusSummarySequence::Item &DRTFractionStatusSummarySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTFractionStatusSummarySequence::Item &DRTFractionStatusSummarySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTFractionStatusSummarySequence::Item &DRTFractionStatusSummarySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTFractionStatusSummarySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_FractionStatusSummarySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_FractionStatusSummarySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTFractionStatusSummarySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_FractionStatusSummarySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtgas.cc b/dcmrt/libsrc/drtgas.cc new file mode 100644 index 00000000..aa4dc17e --- /dev/null +++ b/dcmrt/libsrc/drtgas.cc @@ -0,0 +1,694 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTGeneralAccessorySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtgas.h" + + +// --- item class --- + +DRTGeneralAccessorySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + GeneralAccessoryDescription(DCM_GeneralAccessoryDescription), + GeneralAccessoryID(DCM_GeneralAccessoryID), + GeneralAccessoryNumber(DCM_GeneralAccessoryNumber), + GeneralAccessoryType(DCM_GeneralAccessoryType), + SourceToGeneralAccessoryDistance(DCM_SourceToGeneralAccessoryDistance) +{ +} + + +DRTGeneralAccessorySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + GeneralAccessoryDescription(copy.GeneralAccessoryDescription), + GeneralAccessoryID(copy.GeneralAccessoryID), + GeneralAccessoryNumber(copy.GeneralAccessoryNumber), + GeneralAccessoryType(copy.GeneralAccessoryType), + SourceToGeneralAccessoryDistance(copy.SourceToGeneralAccessoryDistance) +{ +} + + +DRTGeneralAccessorySequence::Item::~Item() +{ +} + + +DRTGeneralAccessorySequence::Item &DRTGeneralAccessorySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + GeneralAccessoryDescription = copy.GeneralAccessoryDescription; + GeneralAccessoryID = copy.GeneralAccessoryID; + GeneralAccessoryNumber = copy.GeneralAccessoryNumber; + GeneralAccessoryType = copy.GeneralAccessoryType; + SourceToGeneralAccessoryDistance = copy.SourceToGeneralAccessoryDistance; + } + return *this; +} + + +void DRTGeneralAccessorySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + GeneralAccessoryNumber.clear(); + GeneralAccessoryID.clear(); + GeneralAccessoryDescription.clear(); + GeneralAccessoryType.clear(); + AccessoryCode.clear(); + SourceToGeneralAccessoryDistance.clear(); + } +} + + +OFBool DRTGeneralAccessorySequence::Item::isEmpty() +{ + return GeneralAccessoryNumber.isEmpty() && + GeneralAccessoryID.isEmpty() && + GeneralAccessoryDescription.isEmpty() && + GeneralAccessoryType.isEmpty() && + AccessoryCode.isEmpty() && + SourceToGeneralAccessoryDistance.isEmpty(); +} + + +OFBool DRTGeneralAccessorySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTGeneralAccessorySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, GeneralAccessoryNumber, "1", "1", "GeneralAccessorySequence"); + getAndCheckElementFromDataset(item, GeneralAccessoryID, "1", "1", "GeneralAccessorySequence"); + getAndCheckElementFromDataset(item, GeneralAccessoryDescription, "1", "3", "GeneralAccessorySequence"); + getAndCheckElementFromDataset(item, GeneralAccessoryType, "1", "3", "GeneralAccessorySequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "GeneralAccessorySequence"); + getAndCheckElementFromDataset(item, SourceToGeneralAccessoryDistance, "1", "3", "GeneralAccessorySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(GeneralAccessoryNumber), "1", "1", "GeneralAccessorySequence"); + addElementToDataset(result, item, new DcmShortString(GeneralAccessoryID), "1", "1", "GeneralAccessorySequence"); + addElementToDataset(result, item, new DcmShortText(GeneralAccessoryDescription), "1", "3", "GeneralAccessorySequence"); + addElementToDataset(result, item, new DcmCodeString(GeneralAccessoryType), "1", "3", "GeneralAccessorySequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "GeneralAccessorySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(SourceToGeneralAccessoryDistance), "1", "3", "GeneralAccessorySequence"); + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTGeneralAccessorySequence::Item::getGeneralAccessoryDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GeneralAccessoryDescription, value, pos); +} + + +OFCondition DRTGeneralAccessorySequence::Item::getGeneralAccessoryID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GeneralAccessoryID, value, pos); +} + + +OFCondition DRTGeneralAccessorySequence::Item::getGeneralAccessoryNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GeneralAccessoryNumber, value, pos); +} + + +OFCondition DRTGeneralAccessorySequence::Item::getGeneralAccessoryNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, GeneralAccessoryNumber).getSint32(value, pos); +} + + +OFCondition DRTGeneralAccessorySequence::Item::getGeneralAccessoryType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GeneralAccessoryType, value, pos); +} + + +OFCondition DRTGeneralAccessorySequence::Item::getSourceToGeneralAccessoryDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, SourceToGeneralAccessoryDistance).getFloat32(value, pos); +} + + +OFCondition DRTGeneralAccessorySequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::Item::setGeneralAccessoryDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = GeneralAccessoryDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::Item::setGeneralAccessoryID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GeneralAccessoryID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::Item::setGeneralAccessoryNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GeneralAccessoryNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::Item::setGeneralAccessoryType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GeneralAccessoryType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::Item::setSourceToGeneralAccessoryDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SourceToGeneralAccessoryDistance.putFloat32(value, pos); +} + + +// --- sequence class --- + +DRTGeneralAccessorySequence::DRTGeneralAccessorySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTGeneralAccessorySequence::DRTGeneralAccessorySequence(const DRTGeneralAccessorySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTGeneralAccessorySequence &DRTGeneralAccessorySequence::operator=(const DRTGeneralAccessorySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTGeneralAccessorySequence::~DRTGeneralAccessorySequence() +{ + clear(); +} + + +void DRTGeneralAccessorySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTGeneralAccessorySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTGeneralAccessorySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTGeneralAccessorySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTGeneralAccessorySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTGeneralAccessorySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTGeneralAccessorySequence::Item &DRTGeneralAccessorySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTGeneralAccessorySequence::Item &DRTGeneralAccessorySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTGeneralAccessorySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTGeneralAccessorySequence::Item &DRTGeneralAccessorySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTGeneralAccessorySequence::Item &DRTGeneralAccessorySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTGeneralAccessorySequence::Item &DRTGeneralAccessorySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTGeneralAccessorySequence::Item &DRTGeneralAccessorySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTGeneralAccessorySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_GeneralAccessorySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_GeneralAccessorySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTGeneralAccessorySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_GeneralAccessorySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtgmcs.cc b/dcmrt/libsrc/drtgmcs.cc new file mode 100644 index 00000000..99ba839c --- /dev/null +++ b/dcmrt/libsrc/drtgmcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTGeneticModificationsCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtgmcs.h" + + +// --- item class --- + +DRTGeneticModificationsCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTGeneticModificationsCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTGeneticModificationsCodeSequence::Item::~Item() +{ +} + + +DRTGeneticModificationsCodeSequence::Item &DRTGeneticModificationsCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTGeneticModificationsCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTGeneticModificationsCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTGeneticModificationsCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "GeneticModificationsCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "GeneticModificationsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "GeneticModificationsCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "GeneticModificationsCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "GeneticModificationsCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "GeneticModificationsCodeSequence"); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTGeneticModificationsCodeSequence::DRTGeneticModificationsCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTGeneticModificationsCodeSequence::DRTGeneticModificationsCodeSequence(const DRTGeneticModificationsCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTGeneticModificationsCodeSequence &DRTGeneticModificationsCodeSequence::operator=(const DRTGeneticModificationsCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTGeneticModificationsCodeSequence::~DRTGeneticModificationsCodeSequence() +{ + clear(); +} + + +void DRTGeneticModificationsCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTGeneticModificationsCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTGeneticModificationsCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTGeneticModificationsCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTGeneticModificationsCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTGeneticModificationsCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTGeneticModificationsCodeSequence::Item &DRTGeneticModificationsCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTGeneticModificationsCodeSequence::Item &DRTGeneticModificationsCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTGeneticModificationsCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTGeneticModificationsCodeSequence::Item &DRTGeneticModificationsCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTGeneticModificationsCodeSequence::Item &DRTGeneticModificationsCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTGeneticModificationsCodeSequence::Item &DRTGeneticModificationsCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTGeneticModificationsCodeSequence::Item &DRTGeneticModificationsCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTGeneticModificationsCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_GeneticModificationsCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_GeneticModificationsCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTGeneticModificationsCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_GeneticModificationsCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtgms.cc b/dcmrt/libsrc/drtgms.cc new file mode 100644 index 00000000..84d56347 --- /dev/null +++ b/dcmrt/libsrc/drtgms.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTGeneticModificationsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtgms.h" + + +// --- item class --- + +DRTGeneticModificationsSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + GeneticModificationsCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + GeneticModificationsDescription(DCM_GeneticModificationsDescription), + GeneticModificationsNomenclature(DCM_GeneticModificationsNomenclature) +{ +} + + +DRTGeneticModificationsSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + GeneticModificationsCodeSequence(copy.GeneticModificationsCodeSequence), + GeneticModificationsDescription(copy.GeneticModificationsDescription), + GeneticModificationsNomenclature(copy.GeneticModificationsNomenclature) +{ +} + + +DRTGeneticModificationsSequence::Item::~Item() +{ +} + + +DRTGeneticModificationsSequence::Item &DRTGeneticModificationsSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + GeneticModificationsCodeSequence = copy.GeneticModificationsCodeSequence; + GeneticModificationsDescription = copy.GeneticModificationsDescription; + GeneticModificationsNomenclature = copy.GeneticModificationsNomenclature; + } + return *this; +} + + +void DRTGeneticModificationsSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + GeneticModificationsDescription.clear(); + GeneticModificationsNomenclature.clear(); + GeneticModificationsCodeSequence.clear(); + } +} + + +OFBool DRTGeneticModificationsSequence::Item::isEmpty() +{ + return GeneticModificationsDescription.isEmpty() && + GeneticModificationsNomenclature.isEmpty() && + GeneticModificationsCodeSequence.isEmpty(); +} + + +OFBool DRTGeneticModificationsSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTGeneticModificationsSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, GeneticModificationsDescription, "1", "1", "GeneticModificationsSequence"); + getAndCheckElementFromDataset(item, GeneticModificationsNomenclature, "1", "1", "GeneticModificationsSequence"); + GeneticModificationsCodeSequence.read(item, "1-n", "3", "GeneticModificationsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnlimitedCharacters(GeneticModificationsDescription), "1", "1", "GeneticModificationsSequence"); + addElementToDataset(result, item, new DcmLongString(GeneticModificationsNomenclature), "1", "1", "GeneticModificationsSequence"); + if (result.good()) result = GeneticModificationsCodeSequence.write(item, "1-n", "3", "GeneticModificationsSequence"); + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::Item::getGeneticModificationsDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GeneticModificationsDescription, value, pos); +} + + +OFCondition DRTGeneticModificationsSequence::Item::getGeneticModificationsNomenclature(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GeneticModificationsNomenclature, value, pos); +} + + +OFCondition DRTGeneticModificationsSequence::Item::setGeneticModificationsDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GeneticModificationsDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::Item::setGeneticModificationsNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GeneticModificationsNomenclature.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTGeneticModificationsSequence::DRTGeneticModificationsSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTGeneticModificationsSequence::DRTGeneticModificationsSequence(const DRTGeneticModificationsSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTGeneticModificationsSequence &DRTGeneticModificationsSequence::operator=(const DRTGeneticModificationsSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTGeneticModificationsSequence::~DRTGeneticModificationsSequence() +{ + clear(); +} + + +void DRTGeneticModificationsSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTGeneticModificationsSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTGeneticModificationsSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTGeneticModificationsSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTGeneticModificationsSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTGeneticModificationsSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTGeneticModificationsSequence::Item &DRTGeneticModificationsSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTGeneticModificationsSequence::Item &DRTGeneticModificationsSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTGeneticModificationsSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTGeneticModificationsSequence::Item &DRTGeneticModificationsSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTGeneticModificationsSequence::Item &DRTGeneticModificationsSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTGeneticModificationsSequence::Item &DRTGeneticModificationsSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTGeneticModificationsSequence::Item &DRTGeneticModificationsSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTGeneticModificationsSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_GeneticModificationsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_GeneticModificationsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTGeneticModificationsSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_GeneticModificationsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtgpis.cc b/dcmrt/libsrc/drtgpis.cc new file mode 100644 index 00000000..c9cc891a --- /dev/null +++ b/dcmrt/libsrc/drtgpis.cc @@ -0,0 +1,634 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTGroupOfPatientsIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtgpis.h" + + +// --- item class --- + +DRTGroupOfPatientsIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PatientID(DCM_PatientID), + PatientPosition(DCM_PatientPosition), + SubjectRelativePositionInImage(DCM_SubjectRelativePositionInImage) +{ +} + + +DRTGroupOfPatientsIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientID(copy.PatientID), + PatientPosition(copy.PatientPosition), + SubjectRelativePositionInImage(copy.SubjectRelativePositionInImage) +{ +} + + +DRTGroupOfPatientsIdentificationSequence::Item::~Item() +{ +} + + +DRTGroupOfPatientsIdentificationSequence::Item &DRTGroupOfPatientsIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientID = copy.PatientID; + PatientPosition = copy.PatientPosition; + SubjectRelativePositionInImage = copy.SubjectRelativePositionInImage; + } + return *this; +} + + +void DRTGroupOfPatientsIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + SubjectRelativePositionInImage.clear(); + PatientPosition.clear(); + } +} + + +OFBool DRTGroupOfPatientsIdentificationSequence::Item::isEmpty() +{ + return PatientID.isEmpty() && + IssuerOfPatientID.isEmpty() && + IssuerOfPatientIDQualifiersSequence.isEmpty() && + SubjectRelativePositionInImage.isEmpty() && + PatientPosition.isEmpty(); +} + + +OFBool DRTGroupOfPatientsIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, PatientID, "1", "1", "GroupOfPatientsIdentificationSequence"); + getAndCheckElementFromDataset(item, IssuerOfPatientID, "1", "3", "GroupOfPatientsIdentificationSequence"); + IssuerOfPatientIDQualifiersSequence.read(item, "1-n", "3", "GroupOfPatientsIdentificationSequence"); + getAndCheckElementFromDataset(item, SubjectRelativePositionInImage, "3", "3", "GroupOfPatientsIdentificationSequence"); + getAndCheckElementFromDataset(item, PatientPosition, "1", "3", "GroupOfPatientsIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongString(PatientID), "1", "1", "GroupOfPatientsIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(IssuerOfPatientID), "1", "3", "GroupOfPatientsIdentificationSequence"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(item, "1-n", "3", "GroupOfPatientsIdentificationSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(SubjectRelativePositionInImage), "3", "3", "GroupOfPatientsIdentificationSequence"); + addElementToDataset(result, item, new DcmCodeString(PatientPosition), "1", "3", "GroupOfPatientsIdentificationSequence"); + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::getPatientID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::getPatientPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientPosition, value, pos); +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::getSubjectRelativePositionInImage(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, SubjectRelativePositionInImage).getUint16(value, pos); +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::setPatientPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::Item::setSubjectRelativePositionInImage(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SubjectRelativePositionInImage.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTGroupOfPatientsIdentificationSequence::DRTGroupOfPatientsIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTGroupOfPatientsIdentificationSequence::DRTGroupOfPatientsIdentificationSequence(const DRTGroupOfPatientsIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTGroupOfPatientsIdentificationSequence &DRTGroupOfPatientsIdentificationSequence::operator=(const DRTGroupOfPatientsIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTGroupOfPatientsIdentificationSequence::~DRTGroupOfPatientsIdentificationSequence() +{ + clear(); +} + + +void DRTGroupOfPatientsIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTGroupOfPatientsIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTGroupOfPatientsIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTGroupOfPatientsIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTGroupOfPatientsIdentificationSequence::Item &DRTGroupOfPatientsIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTGroupOfPatientsIdentificationSequence::Item &DRTGroupOfPatientsIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTGroupOfPatientsIdentificationSequence::Item &DRTGroupOfPatientsIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTGroupOfPatientsIdentificationSequence::Item &DRTGroupOfPatientsIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTGroupOfPatientsIdentificationSequence::Item &DRTGroupOfPatientsIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTGroupOfPatientsIdentificationSequence::Item &DRTGroupOfPatientsIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_GroupOfPatientsIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_GroupOfPatientsIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTGroupOfPatientsIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_GroupOfPatientsIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drthsdrs.cc b/dcmrt/libsrc/drthsdrs.cc new file mode 100644 index 00000000..97b558e6 --- /dev/null +++ b/dcmrt/libsrc/drthsdrs.cc @@ -0,0 +1,631 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTHL7StructuredDocumentReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drthsdrs.h" + + +// --- item class --- + +DRTHL7StructuredDocumentReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + HL7InstanceIdentifier(DCM_HL7InstanceIdentifier), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + RetrieveURI(DCM_RetrieveURI) +{ +} + + +DRTHL7StructuredDocumentReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + HL7InstanceIdentifier(copy.HL7InstanceIdentifier), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + RetrieveURI(copy.RetrieveURI) +{ +} + + +DRTHL7StructuredDocumentReferenceSequence::Item::~Item() +{ +} + + +DRTHL7StructuredDocumentReferenceSequence::Item &DRTHL7StructuredDocumentReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + HL7InstanceIdentifier = copy.HL7InstanceIdentifier; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + RetrieveURI = copy.RetrieveURI; + } + return *this; +} + + +void DRTHL7StructuredDocumentReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + HL7InstanceIdentifier.clear(); + RetrieveURI.clear(); + } +} + + +OFBool DRTHL7StructuredDocumentReferenceSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + HL7InstanceIdentifier.isEmpty() && + RetrieveURI.isEmpty(); +} + + +OFBool DRTHL7StructuredDocumentReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "HL7StructuredDocumentReferenceSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "HL7StructuredDocumentReferenceSequence"); + getAndCheckElementFromDataset(item, HL7InstanceIdentifier, "1", "1", "HL7StructuredDocumentReferenceSequence"); + getAndCheckElementFromDataset(item, RetrieveURI, "1", "3", "HL7StructuredDocumentReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "HL7StructuredDocumentReferenceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "HL7StructuredDocumentReferenceSequence"); + addElementToDataset(result, item, new DcmShortText(HL7InstanceIdentifier), "1", "1", "HL7StructuredDocumentReferenceSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(RetrieveURI), "1", "3", "HL7StructuredDocumentReferenceSequence"); + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::getHL7InstanceIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(HL7InstanceIdentifier, value, pos); +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::getRetrieveURI(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RetrieveURI, value, pos); +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::setHL7InstanceIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = HL7InstanceIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::Item::setRetrieveURI(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RetrieveURI.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTHL7StructuredDocumentReferenceSequence::DRTHL7StructuredDocumentReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTHL7StructuredDocumentReferenceSequence::DRTHL7StructuredDocumentReferenceSequence(const DRTHL7StructuredDocumentReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTHL7StructuredDocumentReferenceSequence &DRTHL7StructuredDocumentReferenceSequence::operator=(const DRTHL7StructuredDocumentReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTHL7StructuredDocumentReferenceSequence::~DRTHL7StructuredDocumentReferenceSequence() +{ + clear(); +} + + +void DRTHL7StructuredDocumentReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTHL7StructuredDocumentReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTHL7StructuredDocumentReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTHL7StructuredDocumentReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTHL7StructuredDocumentReferenceSequence::Item &DRTHL7StructuredDocumentReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTHL7StructuredDocumentReferenceSequence::Item &DRTHL7StructuredDocumentReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTHL7StructuredDocumentReferenceSequence::Item &DRTHL7StructuredDocumentReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTHL7StructuredDocumentReferenceSequence::Item &DRTHL7StructuredDocumentReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTHL7StructuredDocumentReferenceSequence::Item &DRTHL7StructuredDocumentReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTHL7StructuredDocumentReferenceSequence::Item &DRTHL7StructuredDocumentReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_HL7StructuredDocumentReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_HL7StructuredDocumentReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTHL7StructuredDocumentReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_HL7StructuredDocumentReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtiais.cc b/dcmrt/libsrc/drtiais.cc new file mode 100644 index 00000000..fb686b6e --- /dev/null +++ b/dcmrt/libsrc/drtiais.cc @@ -0,0 +1,602 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIssuerOfAdmissionIDSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtiais.h" + + +// --- item class --- + +DRTIssuerOfAdmissionIDSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LocalNamespaceEntityID(DCM_LocalNamespaceEntityID), + UniversalEntityID(DCM_UniversalEntityID), + UniversalEntityIDType(DCM_UniversalEntityIDType) +{ +} + + +DRTIssuerOfAdmissionIDSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LocalNamespaceEntityID(copy.LocalNamespaceEntityID), + UniversalEntityID(copy.UniversalEntityID), + UniversalEntityIDType(copy.UniversalEntityIDType) +{ +} + + +DRTIssuerOfAdmissionIDSequence::Item::~Item() +{ +} + + +DRTIssuerOfAdmissionIDSequence::Item &DRTIssuerOfAdmissionIDSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LocalNamespaceEntityID = copy.LocalNamespaceEntityID; + UniversalEntityID = copy.UniversalEntityID; + UniversalEntityIDType = copy.UniversalEntityIDType; + } + return *this; +} + + +void DRTIssuerOfAdmissionIDSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + LocalNamespaceEntityID.clear(); + UniversalEntityID.clear(); + UniversalEntityIDType.clear(); + } +} + + +OFBool DRTIssuerOfAdmissionIDSequence::Item::isEmpty() +{ + return LocalNamespaceEntityID.isEmpty() && + UniversalEntityID.isEmpty() && + UniversalEntityIDType.isEmpty(); +} + + +OFBool DRTIssuerOfAdmissionIDSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, LocalNamespaceEntityID, "1", "1C", "IssuerOfAdmissionIDSequence"); + getAndCheckElementFromDataset(item, UniversalEntityID, "1", "1C", "IssuerOfAdmissionIDSequence"); + getAndCheckElementFromDataset(item, UniversalEntityIDType, "1", "1C", "IssuerOfAdmissionIDSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnlimitedText(LocalNamespaceEntityID), "1", "1C", "IssuerOfAdmissionIDSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(UniversalEntityID), "1", "1C", "IssuerOfAdmissionIDSequence"); + addElementToDataset(result, item, new DcmCodeString(UniversalEntityIDType), "1", "1C", "IssuerOfAdmissionIDSequence"); + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::getLocalNamespaceEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LocalNamespaceEntityID, value, pos); +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::getUniversalEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityID, value, pos); +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::getUniversalEntityIDType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityIDType, value, pos); +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::setLocalNamespaceEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = LocalNamespaceEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::setUniversalEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = UniversalEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::Item::setUniversalEntityIDType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UniversalEntityIDType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIssuerOfAdmissionIDSequence::DRTIssuerOfAdmissionIDSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIssuerOfAdmissionIDSequence::DRTIssuerOfAdmissionIDSequence(const DRTIssuerOfAdmissionIDSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIssuerOfAdmissionIDSequence &DRTIssuerOfAdmissionIDSequence::operator=(const DRTIssuerOfAdmissionIDSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIssuerOfAdmissionIDSequence::~DRTIssuerOfAdmissionIDSequence() +{ + clear(); +} + + +void DRTIssuerOfAdmissionIDSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIssuerOfAdmissionIDSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIssuerOfAdmissionIDSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIssuerOfAdmissionIDSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIssuerOfAdmissionIDSequence::Item &DRTIssuerOfAdmissionIDSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIssuerOfAdmissionIDSequence::Item &DRTIssuerOfAdmissionIDSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIssuerOfAdmissionIDSequence::Item &DRTIssuerOfAdmissionIDSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIssuerOfAdmissionIDSequence::Item &DRTIssuerOfAdmissionIDSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIssuerOfAdmissionIDSequence::Item &DRTIssuerOfAdmissionIDSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIssuerOfAdmissionIDSequence::Item &DRTIssuerOfAdmissionIDSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IssuerOfAdmissionIDSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IssuerOfAdmissionIDSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIssuerOfAdmissionIDSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IssuerOfAdmissionIDSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtians.cc b/dcmrt/libsrc/drtians.cc new file mode 100644 index 00000000..3ad028dc --- /dev/null +++ b/dcmrt/libsrc/drtians.cc @@ -0,0 +1,602 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIssuerOfAccessionNumberSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtians.h" + + +// --- item class --- + +DRTIssuerOfAccessionNumberSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LocalNamespaceEntityID(DCM_LocalNamespaceEntityID), + UniversalEntityID(DCM_UniversalEntityID), + UniversalEntityIDType(DCM_UniversalEntityIDType) +{ +} + + +DRTIssuerOfAccessionNumberSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LocalNamespaceEntityID(copy.LocalNamespaceEntityID), + UniversalEntityID(copy.UniversalEntityID), + UniversalEntityIDType(copy.UniversalEntityIDType) +{ +} + + +DRTIssuerOfAccessionNumberSequence::Item::~Item() +{ +} + + +DRTIssuerOfAccessionNumberSequence::Item &DRTIssuerOfAccessionNumberSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LocalNamespaceEntityID = copy.LocalNamespaceEntityID; + UniversalEntityID = copy.UniversalEntityID; + UniversalEntityIDType = copy.UniversalEntityIDType; + } + return *this; +} + + +void DRTIssuerOfAccessionNumberSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + LocalNamespaceEntityID.clear(); + UniversalEntityID.clear(); + UniversalEntityIDType.clear(); + } +} + + +OFBool DRTIssuerOfAccessionNumberSequence::Item::isEmpty() +{ + return LocalNamespaceEntityID.isEmpty() && + UniversalEntityID.isEmpty() && + UniversalEntityIDType.isEmpty(); +} + + +OFBool DRTIssuerOfAccessionNumberSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, LocalNamespaceEntityID, "1", "1C", "IssuerOfAccessionNumberSequence"); + getAndCheckElementFromDataset(item, UniversalEntityID, "1", "1C", "IssuerOfAccessionNumberSequence"); + getAndCheckElementFromDataset(item, UniversalEntityIDType, "1", "1C", "IssuerOfAccessionNumberSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnlimitedText(LocalNamespaceEntityID), "1", "1C", "IssuerOfAccessionNumberSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(UniversalEntityID), "1", "1C", "IssuerOfAccessionNumberSequence"); + addElementToDataset(result, item, new DcmCodeString(UniversalEntityIDType), "1", "1C", "IssuerOfAccessionNumberSequence"); + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::getLocalNamespaceEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LocalNamespaceEntityID, value, pos); +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::getUniversalEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityID, value, pos); +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::getUniversalEntityIDType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityIDType, value, pos); +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::setLocalNamespaceEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = LocalNamespaceEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::setUniversalEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = UniversalEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::Item::setUniversalEntityIDType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UniversalEntityIDType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIssuerOfAccessionNumberSequence::DRTIssuerOfAccessionNumberSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIssuerOfAccessionNumberSequence::DRTIssuerOfAccessionNumberSequence(const DRTIssuerOfAccessionNumberSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIssuerOfAccessionNumberSequence &DRTIssuerOfAccessionNumberSequence::operator=(const DRTIssuerOfAccessionNumberSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIssuerOfAccessionNumberSequence::~DRTIssuerOfAccessionNumberSequence() +{ + clear(); +} + + +void DRTIssuerOfAccessionNumberSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIssuerOfAccessionNumberSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIssuerOfAccessionNumberSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIssuerOfAccessionNumberSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIssuerOfAccessionNumberSequence::Item &DRTIssuerOfAccessionNumberSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIssuerOfAccessionNumberSequence::Item &DRTIssuerOfAccessionNumberSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIssuerOfAccessionNumberSequence::Item &DRTIssuerOfAccessionNumberSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIssuerOfAccessionNumberSequence::Item &DRTIssuerOfAccessionNumberSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIssuerOfAccessionNumberSequence::Item &DRTIssuerOfAccessionNumberSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIssuerOfAccessionNumberSequence::Item &DRTIssuerOfAccessionNumberSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IssuerOfAccessionNumberSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IssuerOfAccessionNumberSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIssuerOfAccessionNumberSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IssuerOfAccessionNumberSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtiblds.cc b/dcmrt/libsrc/drtiblds.cc new file mode 100644 index 00000000..5f3e32f5 --- /dev/null +++ b/dcmrt/libsrc/drtiblds.cc @@ -0,0 +1,654 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonBeamLimitingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtiblds.h" + + +// --- item class --- + +DRTIonBeamLimitingDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + IsocenterToBeamLimitingDeviceDistance(DCM_IsocenterToBeamLimitingDeviceDistance), + LeafPositionBoundaries(DCM_LeafPositionBoundaries), + NumberOfLeafJawPairs(DCM_NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(DCM_RTBeamLimitingDeviceType) +{ +} + + +DRTIonBeamLimitingDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + IsocenterToBeamLimitingDeviceDistance(copy.IsocenterToBeamLimitingDeviceDistance), + LeafPositionBoundaries(copy.LeafPositionBoundaries), + NumberOfLeafJawPairs(copy.NumberOfLeafJawPairs), + RTBeamLimitingDeviceType(copy.RTBeamLimitingDeviceType) +{ +} + + +DRTIonBeamLimitingDeviceSequence::Item::~Item() +{ +} + + +DRTIonBeamLimitingDeviceSequence::Item &DRTIonBeamLimitingDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + IsocenterToBeamLimitingDeviceDistance = copy.IsocenterToBeamLimitingDeviceDistance; + LeafPositionBoundaries = copy.LeafPositionBoundaries; + NumberOfLeafJawPairs = copy.NumberOfLeafJawPairs; + RTBeamLimitingDeviceType = copy.RTBeamLimitingDeviceType; + } + return *this; +} + + +void DRTIonBeamLimitingDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RTBeamLimitingDeviceType.clear(); + IsocenterToBeamLimitingDeviceDistance.clear(); + NumberOfLeafJawPairs.clear(); + LeafPositionBoundaries.clear(); + } +} + + +OFBool DRTIonBeamLimitingDeviceSequence::Item::isEmpty() +{ + return RTBeamLimitingDeviceType.isEmpty() && + IsocenterToBeamLimitingDeviceDistance.isEmpty() && + NumberOfLeafJawPairs.isEmpty() && + LeafPositionBoundaries.isEmpty(); +} + + +OFBool DRTIonBeamLimitingDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RTBeamLimitingDeviceType, "1", "1", "IonBeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, IsocenterToBeamLimitingDeviceDistance, "1", "2", "IonBeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, NumberOfLeafJawPairs, "1", "1", "IonBeamLimitingDeviceSequence"); + getAndCheckElementFromDataset(item, LeafPositionBoundaries, "3-n", "1C", "IonBeamLimitingDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RTBeamLimitingDeviceType), "1", "1", "IonBeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToBeamLimitingDeviceDistance), "1", "2", "IonBeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfLeafJawPairs), "1", "1", "IonBeamLimitingDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(LeafPositionBoundaries), "3-n", "1C", "IonBeamLimitingDeviceSequence"); + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::getIsocenterToBeamLimitingDeviceDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToBeamLimitingDeviceDistance).getFloat32(value, pos); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::getLeafPositionBoundaries(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LeafPositionBoundaries, value, pos); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::getLeafPositionBoundaries(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::getLeafPositionBoundaries(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, LeafPositionBoundaries).getFloat64Vector(value); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::getNumberOfLeafJawPairs(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfLeafJawPairs, value, pos); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::getNumberOfLeafJawPairs(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfLeafJawPairs).getSint32(value, pos); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::getRTBeamLimitingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTBeamLimitingDeviceType, value, pos); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::setIsocenterToBeamLimitingDeviceDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToBeamLimitingDeviceDistance.putFloat32(value, pos); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::setLeafPositionBoundaries(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3-n") : EC_Normal; + if (result.good()) + result = LeafPositionBoundaries.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::setNumberOfLeafJawPairs(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfLeafJawPairs.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::Item::setRTBeamLimitingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTBeamLimitingDeviceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIonBeamLimitingDeviceSequence::DRTIonBeamLimitingDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonBeamLimitingDeviceSequence::DRTIonBeamLimitingDeviceSequence(const DRTIonBeamLimitingDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonBeamLimitingDeviceSequence &DRTIonBeamLimitingDeviceSequence::operator=(const DRTIonBeamLimitingDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonBeamLimitingDeviceSequence::~DRTIonBeamLimitingDeviceSequence() +{ + clear(); +} + + +void DRTIonBeamLimitingDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonBeamLimitingDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonBeamLimitingDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonBeamLimitingDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonBeamLimitingDeviceSequence::Item &DRTIonBeamLimitingDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonBeamLimitingDeviceSequence::Item &DRTIonBeamLimitingDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonBeamLimitingDeviceSequence::Item &DRTIonBeamLimitingDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonBeamLimitingDeviceSequence::Item &DRTIonBeamLimitingDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonBeamLimitingDeviceSequence::Item &DRTIonBeamLimitingDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonBeamLimitingDeviceSequence::Item &DRTIonBeamLimitingDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonBeamLimitingDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonBeamLimitingDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonBeamLimitingDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonBeamLimitingDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtibls.cc b/dcmrt/libsrc/drtibls.cc new file mode 100644 index 00000000..acf50a19 --- /dev/null +++ b/dcmrt/libsrc/drtibls.cc @@ -0,0 +1,949 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonBlockSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtibls.h" + + +// --- item class --- + +DRTIonBlockSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BlockData(DCM_BlockData), + BlockDivergence(DCM_BlockDivergence), + BlockMountingPosition(DCM_BlockMountingPosition), + BlockName(DCM_BlockName), + BlockNumber(DCM_BlockNumber), + BlockNumberOfPoints(DCM_BlockNumberOfPoints), + BlockSlabSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BlockThickness(DCM_BlockThickness), + BlockTrayID(DCM_BlockTrayID), + BlockType(DCM_BlockType), + IsocenterToBlockTrayDistance(DCM_IsocenterToBlockTrayDistance), + MaterialID(DCM_MaterialID), + NumberOfBlockSlabItems(DCM_NumberOfBlockSlabItems) +{ +} + + +DRTIonBlockSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BlockData(copy.BlockData), + BlockDivergence(copy.BlockDivergence), + BlockMountingPosition(copy.BlockMountingPosition), + BlockName(copy.BlockName), + BlockNumber(copy.BlockNumber), + BlockNumberOfPoints(copy.BlockNumberOfPoints), + BlockSlabSequence(copy.BlockSlabSequence), + BlockThickness(copy.BlockThickness), + BlockTrayID(copy.BlockTrayID), + BlockType(copy.BlockType), + IsocenterToBlockTrayDistance(copy.IsocenterToBlockTrayDistance), + MaterialID(copy.MaterialID), + NumberOfBlockSlabItems(copy.NumberOfBlockSlabItems) +{ +} + + +DRTIonBlockSequence::Item::~Item() +{ +} + + +DRTIonBlockSequence::Item &DRTIonBlockSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BlockData = copy.BlockData; + BlockDivergence = copy.BlockDivergence; + BlockMountingPosition = copy.BlockMountingPosition; + BlockName = copy.BlockName; + BlockNumber = copy.BlockNumber; + BlockNumberOfPoints = copy.BlockNumberOfPoints; + BlockSlabSequence = copy.BlockSlabSequence; + BlockThickness = copy.BlockThickness; + BlockTrayID = copy.BlockTrayID; + BlockType = copy.BlockType; + IsocenterToBlockTrayDistance = copy.IsocenterToBlockTrayDistance; + MaterialID = copy.MaterialID; + NumberOfBlockSlabItems = copy.NumberOfBlockSlabItems; + } + return *this; +} + + +void DRTIonBlockSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BlockTrayID.clear(); + AccessoryCode.clear(); + IsocenterToBlockTrayDistance.clear(); + BlockType.clear(); + BlockDivergence.clear(); + BlockMountingPosition.clear(); + BlockNumber.clear(); + BlockName.clear(); + MaterialID.clear(); + BlockThickness.clear(); + BlockNumberOfPoints.clear(); + BlockData.clear(); + NumberOfBlockSlabItems.clear(); + BlockSlabSequence.clear(); + } +} + + +OFBool DRTIonBlockSequence::Item::isEmpty() +{ + return BlockTrayID.isEmpty() && + AccessoryCode.isEmpty() && + IsocenterToBlockTrayDistance.isEmpty() && + BlockType.isEmpty() && + BlockDivergence.isEmpty() && + BlockMountingPosition.isEmpty() && + BlockNumber.isEmpty() && + BlockName.isEmpty() && + MaterialID.isEmpty() && + BlockThickness.isEmpty() && + BlockNumberOfPoints.isEmpty() && + BlockData.isEmpty() && + NumberOfBlockSlabItems.isEmpty() && + BlockSlabSequence.isEmpty(); +} + + +OFBool DRTIonBlockSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonBlockSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BlockTrayID, "1", "3", "IonBlockSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "IonBlockSequence"); + getAndCheckElementFromDataset(item, IsocenterToBlockTrayDistance, "1", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockType, "1", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockDivergence, "1", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockMountingPosition, "1", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockNumber, "1", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockName, "1", "3", "IonBlockSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "2", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockThickness, "1", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockNumberOfPoints, "1", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, BlockData, "2-2n", "1", "IonBlockSequence"); + getAndCheckElementFromDataset(item, NumberOfBlockSlabItems, "1", "3", "IonBlockSequence"); + BlockSlabSequence.read(item, "1-n", "1C", "IonBlockSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(BlockTrayID), "1", "3", "IonBlockSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "IonBlockSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToBlockTrayDistance), "1", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockType), "1", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockDivergence), "1", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockMountingPosition), "1", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(BlockNumber), "1", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmLongString(BlockName), "1", "3", "IonBlockSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "2", "IonBlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockThickness), "1", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(BlockNumberOfPoints), "1", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmDecimalString(BlockData), "2-2n", "1", "IonBlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBlockSlabItems), "1", "3", "IonBlockSequence"); + if (result.good()) result = BlockSlabSequence.write(item, "1-n", "1C", "IonBlockSequence"); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockData, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockData).getFloat64(value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockData).getFloat64Vector(value); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockDivergence(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockDivergence, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockMountingPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockMountingPosition, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockName, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockNumber, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BlockNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockNumberOfPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockNumberOfPoints, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockNumberOfPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BlockNumberOfPoints).getSint32(value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockThickness, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BlockThickness).getFloat64(value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockTrayID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockTrayID, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getBlockType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockType, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getIsocenterToBlockTrayDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToBlockTrayDistance).getFloat32(value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getNumberOfBlockSlabItems(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBlockSlabItems, value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::getNumberOfBlockSlabItems(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBlockSlabItems).getSint32(value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2-2n") : EC_Normal; + if (result.good()) + result = BlockData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockDivergence(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockDivergence.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockMountingPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockMountingPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockNumberOfPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockNumberOfPoints.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockTrayID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockTrayID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setBlockType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setIsocenterToBlockTrayDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToBlockTrayDistance.putFloat32(value, pos); +} + + +OFCondition DRTIonBlockSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBlockSequence::Item::setNumberOfBlockSlabItems(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBlockSlabItems.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIonBlockSequence::DRTIonBlockSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonBlockSequence::DRTIonBlockSequence(const DRTIonBlockSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonBlockSequence &DRTIonBlockSequence::operator=(const DRTIonBlockSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonBlockSequence::~DRTIonBlockSequence() +{ + clear(); +} + + +void DRTIonBlockSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonBlockSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonBlockSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonBlockSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonBlockSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBlockSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBlockSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBlockSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBlockSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonBlockSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonBlockSequence::Item &DRTIonBlockSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonBlockSequence::Item &DRTIonBlockSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonBlockSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonBlockSequence::Item &DRTIonBlockSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonBlockSequence::Item &DRTIonBlockSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonBlockSequence::Item &DRTIonBlockSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonBlockSequence::Item &DRTIonBlockSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonBlockSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonBlockSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonBlockSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBlockSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonBlockSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonBlockSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonBlockSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonBlockSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtibs.cc b/dcmrt/libsrc/drtibs.cc new file mode 100644 index 00000000..feca160d --- /dev/null +++ b/dcmrt/libsrc/drtibs.cc @@ -0,0 +1,1878 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonBeamSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtibs.h" + + +// --- item class --- + +DRTIonBeamSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ApplicatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamDescription(DCM_BeamDescription), + BeamName(DCM_BeamName), + BeamNumber(DCM_BeamNumber), + BeamType(DCM_BeamType), + DepthDoseParametersSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DeviceSerialNumber(DCM_DeviceSerialNumber), + FinalCumulativeMetersetWeight(DCM_FinalCumulativeMetersetWeight), + FixationEye(DCM_FixationEye), + FixationLightAzimuthalAngle(DCM_FixationLightAzimuthalAngle), + FixationLightPolarAngle(DCM_FixationLightPolarAngle), + GeneralAccessorySequence(emptyDefaultItem /*emptyDefaultSequence*/), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionName(DCM_InstitutionName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + IonBeamLimitingDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + IonBlockSequence(emptyDefaultItem /*emptyDefaultSequence*/), + IonControlPointSequence(emptyDefaultItem /*emptyDefaultSequence*/), + IonRangeCompensatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + IonWedgeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LateralSpreadingDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + Manufacturer(DCM_Manufacturer), + ManufacturerModelName(DCM_ManufacturerModelName), + ModulatedScanModeType(DCM_ModulatedScanModeType), + NumberOfBlocks(DCM_NumberOfBlocks), + NumberOfBoli(DCM_NumberOfBoli), + NumberOfCompensators(DCM_NumberOfCompensators), + NumberOfControlPoints(DCM_NumberOfControlPoints), + NumberOfLateralSpreadingDevices(DCM_NumberOfLateralSpreadingDevices), + NumberOfRangeModulators(DCM_NumberOfRangeModulators), + NumberOfRangeShifters(DCM_NumberOfRangeShifters), + NumberOfWedges(DCM_NumberOfWedges), + PatientSupportAccessoryCode(DCM_PatientSupportAccessoryCode), + PatientSupportID(DCM_PatientSupportID), + PatientSupportType(DCM_PatientSupportType), + PrimaryDosimeterUnit(DCM_PrimaryDosimeterUnit), + RadiationAtomicNumber(DCM_RadiationAtomicNumber), + RadiationChargeState(DCM_RadiationChargeState), + RadiationMassNumber(DCM_RadiationMassNumber), + RadiationType(DCM_RadiationType), + RangeModulatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RangeShifterSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedBolusSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedDoseSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedPatientSetupNumber(DCM_ReferencedPatientSetupNumber), + ReferencedReferenceImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedToleranceTableNumber(DCM_ReferencedToleranceTableNumber), + ScanMode(DCM_ScanMode), + SnoutSequence(emptyDefaultItem /*emptyDefaultSequence*/), + TotalBlockTrayWaterEquivalentThickness(DCM_TotalBlockTrayWaterEquivalentThickness), + TotalCompensatorTrayWaterEquivalentThickness(DCM_TotalCompensatorTrayWaterEquivalentThickness), + TotalWedgeTrayWaterEquivalentThickness(DCM_TotalWedgeTrayWaterEquivalentThickness), + TreatmentDeliveryType(DCM_TreatmentDeliveryType), + TreatmentMachineName(DCM_TreatmentMachineName), + VirtualSourceAxisDistances(DCM_VirtualSourceAxisDistances) +{ +} + + +DRTIonBeamSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ApplicatorSequence(copy.ApplicatorSequence), + BeamDescription(copy.BeamDescription), + BeamName(copy.BeamName), + BeamNumber(copy.BeamNumber), + BeamType(copy.BeamType), + DepthDoseParametersSequence(copy.DepthDoseParametersSequence), + DeviceSerialNumber(copy.DeviceSerialNumber), + FinalCumulativeMetersetWeight(copy.FinalCumulativeMetersetWeight), + FixationEye(copy.FixationEye), + FixationLightAzimuthalAngle(copy.FixationLightAzimuthalAngle), + FixationLightPolarAngle(copy.FixationLightPolarAngle), + GeneralAccessorySequence(copy.GeneralAccessorySequence), + InstitutionAddress(copy.InstitutionAddress), + InstitutionName(copy.InstitutionName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + IonBeamLimitingDeviceSequence(copy.IonBeamLimitingDeviceSequence), + IonBlockSequence(copy.IonBlockSequence), + IonControlPointSequence(copy.IonControlPointSequence), + IonRangeCompensatorSequence(copy.IonRangeCompensatorSequence), + IonWedgeSequence(copy.IonWedgeSequence), + LateralSpreadingDeviceSequence(copy.LateralSpreadingDeviceSequence), + Manufacturer(copy.Manufacturer), + ManufacturerModelName(copy.ManufacturerModelName), + ModulatedScanModeType(copy.ModulatedScanModeType), + NumberOfBlocks(copy.NumberOfBlocks), + NumberOfBoli(copy.NumberOfBoli), + NumberOfCompensators(copy.NumberOfCompensators), + NumberOfControlPoints(copy.NumberOfControlPoints), + NumberOfLateralSpreadingDevices(copy.NumberOfLateralSpreadingDevices), + NumberOfRangeModulators(copy.NumberOfRangeModulators), + NumberOfRangeShifters(copy.NumberOfRangeShifters), + NumberOfWedges(copy.NumberOfWedges), + PatientSupportAccessoryCode(copy.PatientSupportAccessoryCode), + PatientSupportID(copy.PatientSupportID), + PatientSupportType(copy.PatientSupportType), + PrimaryDosimeterUnit(copy.PrimaryDosimeterUnit), + RadiationAtomicNumber(copy.RadiationAtomicNumber), + RadiationChargeState(copy.RadiationChargeState), + RadiationMassNumber(copy.RadiationMassNumber), + RadiationType(copy.RadiationType), + RangeModulatorSequence(copy.RangeModulatorSequence), + RangeShifterSequence(copy.RangeShifterSequence), + ReferencedBolusSequence(copy.ReferencedBolusSequence), + ReferencedDoseSequence(copy.ReferencedDoseSequence), + ReferencedPatientSetupNumber(copy.ReferencedPatientSetupNumber), + ReferencedReferenceImageSequence(copy.ReferencedReferenceImageSequence), + ReferencedToleranceTableNumber(copy.ReferencedToleranceTableNumber), + ScanMode(copy.ScanMode), + SnoutSequence(copy.SnoutSequence), + TotalBlockTrayWaterEquivalentThickness(copy.TotalBlockTrayWaterEquivalentThickness), + TotalCompensatorTrayWaterEquivalentThickness(copy.TotalCompensatorTrayWaterEquivalentThickness), + TotalWedgeTrayWaterEquivalentThickness(copy.TotalWedgeTrayWaterEquivalentThickness), + TreatmentDeliveryType(copy.TreatmentDeliveryType), + TreatmentMachineName(copy.TreatmentMachineName), + VirtualSourceAxisDistances(copy.VirtualSourceAxisDistances) +{ +} + + +DRTIonBeamSequence::Item::~Item() +{ +} + + +DRTIonBeamSequence::Item &DRTIonBeamSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ApplicatorSequence = copy.ApplicatorSequence; + BeamDescription = copy.BeamDescription; + BeamName = copy.BeamName; + BeamNumber = copy.BeamNumber; + BeamType = copy.BeamType; + DepthDoseParametersSequence = copy.DepthDoseParametersSequence; + DeviceSerialNumber = copy.DeviceSerialNumber; + FinalCumulativeMetersetWeight = copy.FinalCumulativeMetersetWeight; + FixationEye = copy.FixationEye; + FixationLightAzimuthalAngle = copy.FixationLightAzimuthalAngle; + FixationLightPolarAngle = copy.FixationLightPolarAngle; + GeneralAccessorySequence = copy.GeneralAccessorySequence; + InstitutionAddress = copy.InstitutionAddress; + InstitutionName = copy.InstitutionName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + IonBeamLimitingDeviceSequence = copy.IonBeamLimitingDeviceSequence; + IonBlockSequence = copy.IonBlockSequence; + IonControlPointSequence = copy.IonControlPointSequence; + IonRangeCompensatorSequence = copy.IonRangeCompensatorSequence; + IonWedgeSequence = copy.IonWedgeSequence; + LateralSpreadingDeviceSequence = copy.LateralSpreadingDeviceSequence; + Manufacturer = copy.Manufacturer; + ManufacturerModelName = copy.ManufacturerModelName; + ModulatedScanModeType = copy.ModulatedScanModeType; + NumberOfBlocks = copy.NumberOfBlocks; + NumberOfBoli = copy.NumberOfBoli; + NumberOfCompensators = copy.NumberOfCompensators; + NumberOfControlPoints = copy.NumberOfControlPoints; + NumberOfLateralSpreadingDevices = copy.NumberOfLateralSpreadingDevices; + NumberOfRangeModulators = copy.NumberOfRangeModulators; + NumberOfRangeShifters = copy.NumberOfRangeShifters; + NumberOfWedges = copy.NumberOfWedges; + PatientSupportAccessoryCode = copy.PatientSupportAccessoryCode; + PatientSupportID = copy.PatientSupportID; + PatientSupportType = copy.PatientSupportType; + PrimaryDosimeterUnit = copy.PrimaryDosimeterUnit; + RadiationAtomicNumber = copy.RadiationAtomicNumber; + RadiationChargeState = copy.RadiationChargeState; + RadiationMassNumber = copy.RadiationMassNumber; + RadiationType = copy.RadiationType; + RangeModulatorSequence = copy.RangeModulatorSequence; + RangeShifterSequence = copy.RangeShifterSequence; + ReferencedBolusSequence = copy.ReferencedBolusSequence; + ReferencedDoseSequence = copy.ReferencedDoseSequence; + ReferencedPatientSetupNumber = copy.ReferencedPatientSetupNumber; + ReferencedReferenceImageSequence = copy.ReferencedReferenceImageSequence; + ReferencedToleranceTableNumber = copy.ReferencedToleranceTableNumber; + ScanMode = copy.ScanMode; + SnoutSequence = copy.SnoutSequence; + TotalBlockTrayWaterEquivalentThickness = copy.TotalBlockTrayWaterEquivalentThickness; + TotalCompensatorTrayWaterEquivalentThickness = copy.TotalCompensatorTrayWaterEquivalentThickness; + TotalWedgeTrayWaterEquivalentThickness = copy.TotalWedgeTrayWaterEquivalentThickness; + TreatmentDeliveryType = copy.TreatmentDeliveryType; + TreatmentMachineName = copy.TreatmentMachineName; + VirtualSourceAxisDistances = copy.VirtualSourceAxisDistances; + } + return *this; +} + + +void DRTIonBeamSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BeamNumber.clear(); + BeamName.clear(); + BeamDescription.clear(); + BeamType.clear(); + RadiationType.clear(); + RadiationMassNumber.clear(); + RadiationAtomicNumber.clear(); + RadiationChargeState.clear(); + ScanMode.clear(); + ModulatedScanModeType.clear(); + TreatmentMachineName.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + PrimaryDosimeterUnit.clear(); + ReferencedToleranceTableNumber.clear(); + VirtualSourceAxisDistances.clear(); + DepthDoseParametersSequence.clear(); + IonBeamLimitingDeviceSequence.clear(); + ReferencedPatientSetupNumber.clear(); + ReferencedReferenceImageSequence.clear(); + TreatmentDeliveryType.clear(); + ReferencedDoseSequence.clear(); + NumberOfWedges.clear(); + TotalWedgeTrayWaterEquivalentThickness.clear(); + IonWedgeSequence.clear(); + NumberOfCompensators.clear(); + TotalCompensatorTrayWaterEquivalentThickness.clear(); + IonRangeCompensatorSequence.clear(); + NumberOfBoli.clear(); + ReferencedBolusSequence.clear(); + NumberOfBlocks.clear(); + TotalBlockTrayWaterEquivalentThickness.clear(); + IonBlockSequence.clear(); + SnoutSequence.clear(); + ApplicatorSequence.clear(); + GeneralAccessorySequence.clear(); + NumberOfRangeShifters.clear(); + RangeShifterSequence.clear(); + NumberOfLateralSpreadingDevices.clear(); + LateralSpreadingDeviceSequence.clear(); + NumberOfRangeModulators.clear(); + RangeModulatorSequence.clear(); + PatientSupportType.clear(); + PatientSupportID.clear(); + PatientSupportAccessoryCode.clear(); + FixationLightAzimuthalAngle.clear(); + FixationLightPolarAngle.clear(); + FixationEye.clear(); + FinalCumulativeMetersetWeight.clear(); + NumberOfControlPoints.clear(); + IonControlPointSequence.clear(); + } +} + + +OFBool DRTIonBeamSequence::Item::isEmpty() +{ + return BeamNumber.isEmpty() && + BeamName.isEmpty() && + BeamDescription.isEmpty() && + BeamType.isEmpty() && + RadiationType.isEmpty() && + RadiationMassNumber.isEmpty() && + RadiationAtomicNumber.isEmpty() && + RadiationChargeState.isEmpty() && + ScanMode.isEmpty() && + ModulatedScanModeType.isEmpty() && + TreatmentMachineName.isEmpty() && + Manufacturer.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionalDepartmentName.isEmpty() && + ManufacturerModelName.isEmpty() && + DeviceSerialNumber.isEmpty() && + PrimaryDosimeterUnit.isEmpty() && + ReferencedToleranceTableNumber.isEmpty() && + VirtualSourceAxisDistances.isEmpty() && + DepthDoseParametersSequence.isEmpty() && + IonBeamLimitingDeviceSequence.isEmpty() && + ReferencedPatientSetupNumber.isEmpty() && + ReferencedReferenceImageSequence.isEmpty() && + TreatmentDeliveryType.isEmpty() && + ReferencedDoseSequence.isEmpty() && + NumberOfWedges.isEmpty() && + TotalWedgeTrayWaterEquivalentThickness.isEmpty() && + IonWedgeSequence.isEmpty() && + NumberOfCompensators.isEmpty() && + TotalCompensatorTrayWaterEquivalentThickness.isEmpty() && + IonRangeCompensatorSequence.isEmpty() && + NumberOfBoli.isEmpty() && + ReferencedBolusSequence.isEmpty() && + NumberOfBlocks.isEmpty() && + TotalBlockTrayWaterEquivalentThickness.isEmpty() && + IonBlockSequence.isEmpty() && + SnoutSequence.isEmpty() && + ApplicatorSequence.isEmpty() && + GeneralAccessorySequence.isEmpty() && + NumberOfRangeShifters.isEmpty() && + RangeShifterSequence.isEmpty() && + NumberOfLateralSpreadingDevices.isEmpty() && + LateralSpreadingDeviceSequence.isEmpty() && + NumberOfRangeModulators.isEmpty() && + RangeModulatorSequence.isEmpty() && + PatientSupportType.isEmpty() && + PatientSupportID.isEmpty() && + PatientSupportAccessoryCode.isEmpty() && + FixationLightAzimuthalAngle.isEmpty() && + FixationLightPolarAngle.isEmpty() && + FixationEye.isEmpty() && + FinalCumulativeMetersetWeight.isEmpty() && + NumberOfControlPoints.isEmpty() && + IonControlPointSequence.isEmpty(); +} + + +OFBool DRTIonBeamSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonBeamSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BeamNumber, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, BeamName, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, BeamDescription, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, BeamType, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationType, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationMassNumber, "1", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationAtomicNumber, "1", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationChargeState, "1", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, ScanMode, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, ModulatedScanModeType, "1", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, TreatmentMachineName, "1", "2", "IonBeamSequence"); + getAndCheckElementFromDataset(item, Manufacturer, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, InstitutionalDepartmentName, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, ManufacturerModelName, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, DeviceSerialNumber, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, PrimaryDosimeterUnit, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, ReferencedToleranceTableNumber, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, VirtualSourceAxisDistances, "2", "1", "IonBeamSequence"); + DepthDoseParametersSequence.read(item, "1-n", "3", "IonBeamSequence"); + IonBeamLimitingDeviceSequence.read(item, "1-n", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, ReferencedPatientSetupNumber, "1", "3", "IonBeamSequence"); + ReferencedReferenceImageSequence.read(item, "1-n", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, TreatmentDeliveryType, "1", "1", "IonBeamSequence"); + ReferencedDoseSequence.read(item, "1-n", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfWedges, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, TotalWedgeTrayWaterEquivalentThickness, "1", "3", "IonBeamSequence"); + IonWedgeSequence.read(item, "1-n", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfCompensators, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, TotalCompensatorTrayWaterEquivalentThickness, "1", "3", "IonBeamSequence"); + IonRangeCompensatorSequence.read(item, "1-n", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfBoli, "1", "1", "IonBeamSequence"); + ReferencedBolusSequence.read(item, "1-n", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfBlocks, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, TotalBlockTrayWaterEquivalentThickness, "1", "3", "IonBeamSequence"); + IonBlockSequence.read(item, "1-n", "1C", "IonBeamSequence"); + SnoutSequence.read(item, "1-n", "3", "IonBeamSequence"); + ApplicatorSequence.read(item, "1-n", "3", "IonBeamSequence"); + GeneralAccessorySequence.read(item, "1-n", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfRangeShifters, "1", "1", "IonBeamSequence"); + RangeShifterSequence.read(item, "1-n", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfLateralSpreadingDevices, "1", "1", "IonBeamSequence"); + LateralSpreadingDeviceSequence.read(item, "1-n", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfRangeModulators, "1", "1", "IonBeamSequence"); + RangeModulatorSequence.read(item, "1-n", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, PatientSupportType, "1", "1", "IonBeamSequence"); + getAndCheckElementFromDataset(item, PatientSupportID, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, PatientSupportAccessoryCode, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, FixationLightAzimuthalAngle, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, FixationLightPolarAngle, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, FixationEye, "1", "3", "IonBeamSequence"); + getAndCheckElementFromDataset(item, FinalCumulativeMetersetWeight, "1", "1C", "IonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfControlPoints, "1", "1", "IonBeamSequence"); + IonControlPointSequence.read(item, "1-n", "1", "IonBeamSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(BeamNumber), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(BeamName), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmShortText(BeamDescription), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamType), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(RadiationType), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(RadiationMassNumber), "1", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(RadiationAtomicNumber), "1", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmSignedShort(RadiationChargeState), "1", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(ScanMode), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(ModulatedScanModeType), "1", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmShortString(TreatmentMachineName), "1", "2", "IonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(Manufacturer), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionalDepartmentName), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(ManufacturerModelName), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceSerialNumber), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(PrimaryDosimeterUnit), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedToleranceTableNumber), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(VirtualSourceAxisDistances), "2", "1", "IonBeamSequence"); + if (result.good()) result = DepthDoseParametersSequence.write(item, "1-n", "3", "IonBeamSequence"); + if (result.good()) result = IonBeamLimitingDeviceSequence.write(item, "1-n", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedPatientSetupNumber), "1", "3", "IonBeamSequence"); + if (result.good()) result = ReferencedReferenceImageSequence.write(item, "1-n", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(TreatmentDeliveryType), "1", "1", "IonBeamSequence"); + if (result.good()) result = ReferencedDoseSequence.write(item, "1-n", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfWedges), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TotalWedgeTrayWaterEquivalentThickness), "1", "3", "IonBeamSequence"); + if (result.good()) result = IonWedgeSequence.write(item, "1-n", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfCompensators), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TotalCompensatorTrayWaterEquivalentThickness), "1", "3", "IonBeamSequence"); + if (result.good()) result = IonRangeCompensatorSequence.write(item, "1-n", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBoli), "1", "1", "IonBeamSequence"); + if (result.good()) result = ReferencedBolusSequence.write(item, "1-n", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBlocks), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TotalBlockTrayWaterEquivalentThickness), "1", "3", "IonBeamSequence"); + if (result.good()) result = IonBlockSequence.write(item, "1-n", "1C", "IonBeamSequence"); + if (result.good()) result = SnoutSequence.write(item, "1-n", "3", "IonBeamSequence"); + if (result.good()) result = ApplicatorSequence.write(item, "1-n", "3", "IonBeamSequence"); + if (result.good()) result = GeneralAccessorySequence.write(item, "1-n", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfRangeShifters), "1", "1", "IonBeamSequence"); + if (result.good()) result = RangeShifterSequence.write(item, "1-n", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfLateralSpreadingDevices), "1", "1", "IonBeamSequence"); + if (result.good()) result = LateralSpreadingDeviceSequence.write(item, "1-n", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfRangeModulators), "1", "1", "IonBeamSequence"); + if (result.good()) result = RangeModulatorSequence.write(item, "1-n", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(PatientSupportType), "1", "1", "IonBeamSequence"); + addElementToDataset(result, item, new DcmShortString(PatientSupportID), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(PatientSupportAccessoryCode), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(FixationLightAzimuthalAngle), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(FixationLightPolarAngle), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(FixationEye), "1", "3", "IonBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(FinalCumulativeMetersetWeight), "1", "1C", "IonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfControlPoints), "1", "1", "IonBeamSequence"); + if (result.good()) result = IonControlPointSequence.write(item, "1-n", "1", "IonBeamSequence"); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::getBeamDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDescription, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getBeamName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamName, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getBeamNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamNumber, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getBeamNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, BeamNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getBeamType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamType, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getFinalCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FinalCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getFinalCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, FinalCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getFixationEye(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationEye, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getFixationLightAzimuthalAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, FixationLightAzimuthalAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getFixationLightPolarAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, FixationLightPolarAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getManufacturerModelName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getModulatedScanModeType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ModulatedScanModeType, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfBlocks(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBlocks, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfBlocks(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBlocks).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfBoli(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBoli, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfBoli(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBoli).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfCompensators(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfCompensators, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfCompensators(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfCompensators).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfControlPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfControlPoints, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfControlPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfControlPoints).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfLateralSpreadingDevices(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfLateralSpreadingDevices, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfLateralSpreadingDevices(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfLateralSpreadingDevices).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfRangeModulators(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfRangeModulators, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfRangeModulators(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfRangeModulators).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfRangeShifters(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfRangeShifters, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfRangeShifters(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfRangeShifters).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfWedges(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfWedges, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getNumberOfWedges(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfWedges).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getPatientSupportAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAccessoryCode, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getPatientSupportID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportID, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getPatientSupportType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportType, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getPrimaryDosimeterUnit(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrimaryDosimeterUnit, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getRadiationAtomicNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RadiationAtomicNumber, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getRadiationAtomicNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, RadiationAtomicNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getRadiationChargeState(Sint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmSignedShort &, RadiationChargeState).getSint16(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getRadiationMassNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RadiationMassNumber, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getRadiationMassNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, RadiationMassNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getRadiationType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RadiationType, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getReferencedPatientSetupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedPatientSetupNumber, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getReferencedPatientSetupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedPatientSetupNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getReferencedToleranceTableNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedToleranceTableNumber, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getReferencedToleranceTableNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedToleranceTableNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getScanMode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScanMode, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getTotalBlockTrayWaterEquivalentThickness(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TotalBlockTrayWaterEquivalentThickness).getFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getTotalCompensatorTrayWaterEquivalentThickness(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TotalCompensatorTrayWaterEquivalentThickness).getFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getTotalWedgeTrayWaterEquivalentThickness(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TotalWedgeTrayWaterEquivalentThickness).getFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getTreatmentDeliveryType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentDeliveryType, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getTreatmentMachineName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentMachineName, value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::getVirtualSourceAxisDistances(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, VirtualSourceAxisDistances).getFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::setBeamDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = BeamDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setBeamName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setBeamNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setBeamType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setFinalCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FinalCumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setFixationEye(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FixationEye.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setFixationLightAzimuthalAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FixationLightAzimuthalAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::setFixationLightPolarAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FixationLightPolarAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setModulatedScanModeType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ModulatedScanModeType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfBlocks(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBlocks.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfBoli(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBoli.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfCompensators(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfCompensators.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfControlPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfControlPoints.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfLateralSpreadingDevices(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfLateralSpreadingDevices.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfRangeModulators(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfRangeModulators.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfRangeShifters(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfRangeShifters.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setNumberOfWedges(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfWedges.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setPatientSupportAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setPatientSupportID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setPatientSupportType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setPrimaryDosimeterUnit(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrimaryDosimeterUnit.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setRadiationAtomicNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationAtomicNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setRadiationChargeState(const Sint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RadiationChargeState.putSint16(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::setRadiationMassNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationMassNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setRadiationType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setReferencedPatientSetupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedPatientSetupNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setReferencedToleranceTableNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedToleranceTableNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setScanMode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScanMode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setTotalBlockTrayWaterEquivalentThickness(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TotalBlockTrayWaterEquivalentThickness.putFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::setTotalCompensatorTrayWaterEquivalentThickness(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TotalCompensatorTrayWaterEquivalentThickness.putFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::setTotalWedgeTrayWaterEquivalentThickness(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TotalWedgeTrayWaterEquivalentThickness.putFloat32(value, pos); +} + + +OFCondition DRTIonBeamSequence::Item::setTreatmentDeliveryType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentDeliveryType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setTreatmentMachineName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentMachineName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonBeamSequence::Item::setVirtualSourceAxisDistances(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return VirtualSourceAxisDistances.putFloat32(value, pos); +} + + +// --- sequence class --- + +DRTIonBeamSequence::DRTIonBeamSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonBeamSequence::DRTIonBeamSequence(const DRTIonBeamSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonBeamSequence &DRTIonBeamSequence::operator=(const DRTIonBeamSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonBeamSequence::~DRTIonBeamSequence() +{ + clear(); +} + + +void DRTIonBeamSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonBeamSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonBeamSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonBeamSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonBeamSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBeamSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonBeamSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBeamSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBeamSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonBeamSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonBeamSequence::Item &DRTIonBeamSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonBeamSequence::Item &DRTIonBeamSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonBeamSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonBeamSequence::Item &DRTIonBeamSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonBeamSequence::Item &DRTIonBeamSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonBeamSequence::Item &DRTIonBeamSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonBeamSequence::Item &DRTIonBeamSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonBeamSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonBeamSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonBeamSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonBeamSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonBeamSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonBeamSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonBeamSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonBeamSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drticpds.cc b/dcmrt/libsrc/drticpds.cc new file mode 100644 index 00000000..c21f51de --- /dev/null +++ b/dcmrt/libsrc/drticpds.cc @@ -0,0 +1,1699 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonControlPointDeliverySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drticpds.h" + + +// --- item class --- + +DRTIonControlPointDeliverySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamLimitingDeviceAngle(DCM_BeamLimitingDeviceAngle), + BeamLimitingDevicePositionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamLimitingDeviceRotationDirection(DCM_BeamLimitingDeviceRotationDirection), + ChairHeadFramePosition(DCM_ChairHeadFramePosition), + CorrectedParameterSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DeliveredMeterset(DCM_DeliveredMeterset), + GantryAngle(DCM_GantryAngle), + GantryPitchAngle(DCM_GantryPitchAngle), + GantryPitchRotationDirection(DCM_GantryPitchRotationDirection), + GantryRotationDirection(DCM_GantryRotationDirection), + HeadFixationAngle(DCM_HeadFixationAngle), + IonWedgePositionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + KVP(DCM_KVP), + LateralSpreadingDeviceSettingsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + MetersetRateDelivered(DCM_MetersetRateDelivered), + MetersetRateSet(DCM_MetersetRateSet), + NominalBeamEnergy(DCM_NominalBeamEnergy), + NumberOfPaintings(DCM_NumberOfPaintings), + NumberOfScanSpotPositions(DCM_NumberOfScanSpotPositions), + OverrideSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PatientSupportAngle(DCM_PatientSupportAngle), + PatientSupportRotationDirection(DCM_PatientSupportRotationDirection), + RangeModulatorSettingsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RangeShifterSettingsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedControlPointIndex(DCM_ReferencedControlPointIndex), + ScanSpotMetersetsDelivered(DCM_ScanSpotMetersetsDelivered), + ScanSpotPositionMap(DCM_ScanSpotPositionMap), + ScanSpotPrescribedIndices(DCM_ScanSpotPrescribedIndices), + ScanSpotReordered(DCM_ScanSpotReordered), + ScanSpotTimeOffset(DCM_ScanSpotTimeOffset), + ScanSpotTuneID(DCM_ScanSpotTuneID), + ScanningSpotSize(DCM_ScanningSpotSize), + SnoutPosition(DCM_SnoutPosition), + SpecifiedMeterset(DCM_SpecifiedMeterset), + TableTopLateralPosition(DCM_TableTopLateralPosition), + TableTopLongitudinalPosition(DCM_TableTopLongitudinalPosition), + TableTopPitchAngle(DCM_TableTopPitchAngle), + TableTopPitchRotationDirection(DCM_TableTopPitchRotationDirection), + TableTopRollAngle(DCM_TableTopRollAngle), + TableTopRollRotationDirection(DCM_TableTopRollRotationDirection), + TableTopVerticalPosition(DCM_TableTopVerticalPosition), + TreatmentControlPointDate(DCM_TreatmentControlPointDate), + TreatmentControlPointTime(DCM_TreatmentControlPointTime) +{ +} + + +DRTIonControlPointDeliverySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamLimitingDeviceAngle(copy.BeamLimitingDeviceAngle), + BeamLimitingDevicePositionSequence(copy.BeamLimitingDevicePositionSequence), + BeamLimitingDeviceRotationDirection(copy.BeamLimitingDeviceRotationDirection), + ChairHeadFramePosition(copy.ChairHeadFramePosition), + CorrectedParameterSequence(copy.CorrectedParameterSequence), + DeliveredMeterset(copy.DeliveredMeterset), + GantryAngle(copy.GantryAngle), + GantryPitchAngle(copy.GantryPitchAngle), + GantryPitchRotationDirection(copy.GantryPitchRotationDirection), + GantryRotationDirection(copy.GantryRotationDirection), + HeadFixationAngle(copy.HeadFixationAngle), + IonWedgePositionSequence(copy.IonWedgePositionSequence), + KVP(copy.KVP), + LateralSpreadingDeviceSettingsSequence(copy.LateralSpreadingDeviceSettingsSequence), + MetersetRateDelivered(copy.MetersetRateDelivered), + MetersetRateSet(copy.MetersetRateSet), + NominalBeamEnergy(copy.NominalBeamEnergy), + NumberOfPaintings(copy.NumberOfPaintings), + NumberOfScanSpotPositions(copy.NumberOfScanSpotPositions), + OverrideSequence(copy.OverrideSequence), + PatientSupportAngle(copy.PatientSupportAngle), + PatientSupportRotationDirection(copy.PatientSupportRotationDirection), + RangeModulatorSettingsSequence(copy.RangeModulatorSettingsSequence), + RangeShifterSettingsSequence(copy.RangeShifterSettingsSequence), + ReferencedControlPointIndex(copy.ReferencedControlPointIndex), + ScanSpotMetersetsDelivered(copy.ScanSpotMetersetsDelivered), + ScanSpotPositionMap(copy.ScanSpotPositionMap), + ScanSpotPrescribedIndices(copy.ScanSpotPrescribedIndices), + ScanSpotReordered(copy.ScanSpotReordered), + ScanSpotTimeOffset(copy.ScanSpotTimeOffset), + ScanSpotTuneID(copy.ScanSpotTuneID), + ScanningSpotSize(copy.ScanningSpotSize), + SnoutPosition(copy.SnoutPosition), + SpecifiedMeterset(copy.SpecifiedMeterset), + TableTopLateralPosition(copy.TableTopLateralPosition), + TableTopLongitudinalPosition(copy.TableTopLongitudinalPosition), + TableTopPitchAngle(copy.TableTopPitchAngle), + TableTopPitchRotationDirection(copy.TableTopPitchRotationDirection), + TableTopRollAngle(copy.TableTopRollAngle), + TableTopRollRotationDirection(copy.TableTopRollRotationDirection), + TableTopVerticalPosition(copy.TableTopVerticalPosition), + TreatmentControlPointDate(copy.TreatmentControlPointDate), + TreatmentControlPointTime(copy.TreatmentControlPointTime) +{ +} + + +DRTIonControlPointDeliverySequence::Item::~Item() +{ +} + + +DRTIonControlPointDeliverySequence::Item &DRTIonControlPointDeliverySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamLimitingDeviceAngle = copy.BeamLimitingDeviceAngle; + BeamLimitingDevicePositionSequence = copy.BeamLimitingDevicePositionSequence; + BeamLimitingDeviceRotationDirection = copy.BeamLimitingDeviceRotationDirection; + ChairHeadFramePosition = copy.ChairHeadFramePosition; + CorrectedParameterSequence = copy.CorrectedParameterSequence; + DeliveredMeterset = copy.DeliveredMeterset; + GantryAngle = copy.GantryAngle; + GantryPitchAngle = copy.GantryPitchAngle; + GantryPitchRotationDirection = copy.GantryPitchRotationDirection; + GantryRotationDirection = copy.GantryRotationDirection; + HeadFixationAngle = copy.HeadFixationAngle; + IonWedgePositionSequence = copy.IonWedgePositionSequence; + KVP = copy.KVP; + LateralSpreadingDeviceSettingsSequence = copy.LateralSpreadingDeviceSettingsSequence; + MetersetRateDelivered = copy.MetersetRateDelivered; + MetersetRateSet = copy.MetersetRateSet; + NominalBeamEnergy = copy.NominalBeamEnergy; + NumberOfPaintings = copy.NumberOfPaintings; + NumberOfScanSpotPositions = copy.NumberOfScanSpotPositions; + OverrideSequence = copy.OverrideSequence; + PatientSupportAngle = copy.PatientSupportAngle; + PatientSupportRotationDirection = copy.PatientSupportRotationDirection; + RangeModulatorSettingsSequence = copy.RangeModulatorSettingsSequence; + RangeShifterSettingsSequence = copy.RangeShifterSettingsSequence; + ReferencedControlPointIndex = copy.ReferencedControlPointIndex; + ScanSpotMetersetsDelivered = copy.ScanSpotMetersetsDelivered; + ScanSpotPositionMap = copy.ScanSpotPositionMap; + ScanSpotPrescribedIndices = copy.ScanSpotPrescribedIndices; + ScanSpotReordered = copy.ScanSpotReordered; + ScanSpotTimeOffset = copy.ScanSpotTimeOffset; + ScanSpotTuneID = copy.ScanSpotTuneID; + ScanningSpotSize = copy.ScanningSpotSize; + SnoutPosition = copy.SnoutPosition; + SpecifiedMeterset = copy.SpecifiedMeterset; + TableTopLateralPosition = copy.TableTopLateralPosition; + TableTopLongitudinalPosition = copy.TableTopLongitudinalPosition; + TableTopPitchAngle = copy.TableTopPitchAngle; + TableTopPitchRotationDirection = copy.TableTopPitchRotationDirection; + TableTopRollAngle = copy.TableTopRollAngle; + TableTopRollRotationDirection = copy.TableTopRollRotationDirection; + TableTopVerticalPosition = copy.TableTopVerticalPosition; + TreatmentControlPointDate = copy.TreatmentControlPointDate; + TreatmentControlPointTime = copy.TreatmentControlPointTime; + } + return *this; +} + + +void DRTIonControlPointDeliverySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedControlPointIndex.clear(); + TreatmentControlPointDate.clear(); + TreatmentControlPointTime.clear(); + SpecifiedMeterset.clear(); + DeliveredMeterset.clear(); + MetersetRateSet.clear(); + MetersetRateDelivered.clear(); + NominalBeamEnergy.clear(); + KVP.clear(); + IonWedgePositionSequence.clear(); + BeamLimitingDevicePositionSequence.clear(); + RangeShifterSettingsSequence.clear(); + LateralSpreadingDeviceSettingsSequence.clear(); + RangeModulatorSettingsSequence.clear(); + GantryAngle.clear(); + GantryRotationDirection.clear(); + GantryPitchAngle.clear(); + GantryPitchRotationDirection.clear(); + BeamLimitingDeviceAngle.clear(); + BeamLimitingDeviceRotationDirection.clear(); + ScanSpotTuneID.clear(); + NumberOfScanSpotPositions.clear(); + ScanSpotPositionMap.clear(); + ScanSpotMetersetsDelivered.clear(); + ScanSpotTimeOffset.clear(); + ScanningSpotSize.clear(); + NumberOfPaintings.clear(); + ScanSpotReordered.clear(); + ScanSpotPrescribedIndices.clear(); + PatientSupportAngle.clear(); + PatientSupportRotationDirection.clear(); + TableTopPitchAngle.clear(); + TableTopPitchRotationDirection.clear(); + TableTopRollAngle.clear(); + TableTopRollRotationDirection.clear(); + HeadFixationAngle.clear(); + ChairHeadFramePosition.clear(); + TableTopVerticalPosition.clear(); + TableTopLongitudinalPosition.clear(); + TableTopLateralPosition.clear(); + SnoutPosition.clear(); + CorrectedParameterSequence.clear(); + OverrideSequence.clear(); + } +} + + +OFBool DRTIonControlPointDeliverySequence::Item::isEmpty() +{ + return ReferencedControlPointIndex.isEmpty() && + TreatmentControlPointDate.isEmpty() && + TreatmentControlPointTime.isEmpty() && + SpecifiedMeterset.isEmpty() && + DeliveredMeterset.isEmpty() && + MetersetRateSet.isEmpty() && + MetersetRateDelivered.isEmpty() && + NominalBeamEnergy.isEmpty() && + KVP.isEmpty() && + IonWedgePositionSequence.isEmpty() && + BeamLimitingDevicePositionSequence.isEmpty() && + RangeShifterSettingsSequence.isEmpty() && + LateralSpreadingDeviceSettingsSequence.isEmpty() && + RangeModulatorSettingsSequence.isEmpty() && + GantryAngle.isEmpty() && + GantryRotationDirection.isEmpty() && + GantryPitchAngle.isEmpty() && + GantryPitchRotationDirection.isEmpty() && + BeamLimitingDeviceAngle.isEmpty() && + BeamLimitingDeviceRotationDirection.isEmpty() && + ScanSpotTuneID.isEmpty() && + NumberOfScanSpotPositions.isEmpty() && + ScanSpotPositionMap.isEmpty() && + ScanSpotMetersetsDelivered.isEmpty() && + ScanSpotTimeOffset.isEmpty() && + ScanningSpotSize.isEmpty() && + NumberOfPaintings.isEmpty() && + ScanSpotReordered.isEmpty() && + ScanSpotPrescribedIndices.isEmpty() && + PatientSupportAngle.isEmpty() && + PatientSupportRotationDirection.isEmpty() && + TableTopPitchAngle.isEmpty() && + TableTopPitchRotationDirection.isEmpty() && + TableTopRollAngle.isEmpty() && + TableTopRollRotationDirection.isEmpty() && + HeadFixationAngle.isEmpty() && + ChairHeadFramePosition.isEmpty() && + TableTopVerticalPosition.isEmpty() && + TableTopLongitudinalPosition.isEmpty() && + TableTopLateralPosition.isEmpty() && + SnoutPosition.isEmpty() && + CorrectedParameterSequence.isEmpty() && + OverrideSequence.isEmpty(); +} + + +OFBool DRTIonControlPointDeliverySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedControlPointIndex, "1", "1", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TreatmentControlPointDate, "1", "1", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TreatmentControlPointTime, "1", "1", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, SpecifiedMeterset, "1", "2", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, DeliveredMeterset, "1", "1", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, MetersetRateSet, "1", "3", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, MetersetRateDelivered, "1", "3", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, NominalBeamEnergy, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, KVP, "1", "1C", "IonControlPointDeliverySequence"); + IonWedgePositionSequence.read(item, "1-n", "1C", "IonControlPointDeliverySequence"); + BeamLimitingDevicePositionSequence.read(item, "1-n", "1C", "IonControlPointDeliverySequence"); + RangeShifterSettingsSequence.read(item, "1-n", "1C", "IonControlPointDeliverySequence"); + LateralSpreadingDeviceSettingsSequence.read(item, "1-n", "1C", "IonControlPointDeliverySequence"); + RangeModulatorSettingsSequence.read(item, "1-n", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, GantryAngle, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, GantryRotationDirection, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, GantryPitchAngle, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, GantryPitchRotationDirection, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceAngle, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceRotationDirection, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ScanSpotTuneID, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, NumberOfScanSpotPositions, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ScanSpotPositionMap, "1-n", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ScanSpotMetersetsDelivered, "1-n", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ScanSpotTimeOffset, "1-n", "3", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ScanningSpotSize, "2", "3", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, NumberOfPaintings, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ScanSpotReordered, "1", "3", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ScanSpotPrescribedIndices, "1-n", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, PatientSupportAngle, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, PatientSupportRotationDirection, "1", "1C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TableTopPitchAngle, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TableTopPitchRotationDirection, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TableTopRollAngle, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TableTopRollRotationDirection, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, HeadFixationAngle, "1", "3", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, ChairHeadFramePosition, "1", "3", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TableTopVerticalPosition, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TableTopLongitudinalPosition, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, TableTopLateralPosition, "1", "2C", "IonControlPointDeliverySequence"); + getAndCheckElementFromDataset(item, SnoutPosition, "1", "2C", "IonControlPointDeliverySequence"); + CorrectedParameterSequence.read(item, "1-n", "3", "IonControlPointDeliverySequence"); + OverrideSequence.read(item, "1-n", "3", "IonControlPointDeliverySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedControlPointIndex), "1", "1", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDate(TreatmentControlPointDate), "1", "1", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmTime(TreatmentControlPointTime), "1", "1", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(SpecifiedMeterset), "1", "2", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveredMeterset), "1", "1", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(MetersetRateSet), "1", "3", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(MetersetRateDelivered), "1", "3", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(NominalBeamEnergy), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(KVP), "1", "1C", "IonControlPointDeliverySequence"); + if (result.good()) result = IonWedgePositionSequence.write(item, "1-n", "1C", "IonControlPointDeliverySequence"); + if (result.good()) result = BeamLimitingDevicePositionSequence.write(item, "1-n", "1C", "IonControlPointDeliverySequence"); + if (result.good()) result = RangeShifterSettingsSequence.write(item, "1-n", "1C", "IonControlPointDeliverySequence"); + if (result.good()) result = LateralSpreadingDeviceSettingsSequence.write(item, "1-n", "1C", "IonControlPointDeliverySequence"); + if (result.good()) result = RangeModulatorSettingsSequence.write(item, "1-n", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(GantryAngle), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmCodeString(GantryRotationDirection), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(GantryPitchAngle), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmCodeString(GantryPitchRotationDirection), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamLimitingDeviceAngle), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmCodeString(BeamLimitingDeviceRotationDirection), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmShortString(ScanSpotTuneID), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfScanSpotPositions), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ScanSpotPositionMap), "1-n", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ScanSpotMetersetsDelivered), "1-n", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ScanSpotTimeOffset), "1-n", "3", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ScanningSpotSize), "2", "3", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfPaintings), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmCodeString(ScanSpotReordered), "1", "3", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmIntegerString(ScanSpotPrescribedIndices), "1-n", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(PatientSupportAngle), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmCodeString(PatientSupportRotationDirection), "1", "1C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopPitchAngle), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmCodeString(TableTopPitchRotationDirection), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopRollAngle), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmCodeString(TableTopRollRotationDirection), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(HeadFixationAngle), "1", "3", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(ChairHeadFramePosition), "1", "3", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopVerticalPosition), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLongitudinalPosition), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLateralPosition), "1", "2C", "IonControlPointDeliverySequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(SnoutPosition), "1", "2C", "IonControlPointDeliverySequence"); + if (result.good()) result = CorrectedParameterSequence.write(item, "1-n", "3", "IonControlPointDeliverySequence"); + if (result.good()) result = OverrideSequence.write(item, "1-n", "3", "IonControlPointDeliverySequence"); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getBeamLimitingDeviceAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceAngle, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamLimitingDeviceAngle).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getBeamLimitingDeviceRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getChairHeadFramePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChairHeadFramePosition, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getChairHeadFramePosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChairHeadFramePosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getDeliveredMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveredMeterset, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getDeliveredMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveredMeterset).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getGantryAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryAngle, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getGantryAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, GantryAngle).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getGantryPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, GantryPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getGantryPitchRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryPitchRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getGantryRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getHeadFixationAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, HeadFixationAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getKVP(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(KVP, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getKVP(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, KVP).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getMetersetRateDelivered(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, MetersetRateDelivered).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getMetersetRateSet(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, MetersetRateSet).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getNominalBeamEnergy(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NominalBeamEnergy, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getNominalBeamEnergy(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NominalBeamEnergy).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getNumberOfPaintings(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfPaintings, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getNumberOfPaintings(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfPaintings).getSint32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getNumberOfScanSpotPositions(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfScanSpotPositions, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getNumberOfScanSpotPositions(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfScanSpotPositions).getSint32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getPatientSupportAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAngle, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getPatientSupportAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, PatientSupportAngle).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getPatientSupportRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getReferencedControlPointIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedControlPointIndex, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getReferencedControlPointIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedControlPointIndex).getSint32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanSpotMetersetsDelivered(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ScanSpotMetersetsDelivered).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanSpotPositionMap(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ScanSpotPositionMap).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanSpotPrescribedIndices(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScanSpotPrescribedIndices, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanSpotPrescribedIndices(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ScanSpotPrescribedIndices).getSint32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanSpotReordered(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScanSpotReordered, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanSpotTimeOffset(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ScanSpotTimeOffset).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanSpotTuneID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScanSpotTuneID, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getScanningSpotSize(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ScanningSpotSize).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getSnoutPosition(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, SnoutPosition).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getSpecifiedMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SpecifiedMeterset, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getSpecifiedMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SpecifiedMeterset).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopLateralPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLateralPosition, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopLateralPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLateralPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopLongitudinalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLongitudinalPosition, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopPitchRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopPitchRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopRollAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopRollAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopRollRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopRollRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopVerticalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopVerticalPosition, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTableTopVerticalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopVerticalPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTreatmentControlPointDate(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentControlPointDate, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::getTreatmentControlPointTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentControlPointTime, value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setBeamLimitingDeviceAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setBeamLimitingDeviceRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setChairHeadFramePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChairHeadFramePosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setDeliveredMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveredMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setGantryAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setGantryPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return GantryPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setGantryPitchRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryPitchRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setGantryRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setHeadFixationAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return HeadFixationAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setKVP(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = KVP.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setMetersetRateDelivered(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return MetersetRateDelivered.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setMetersetRateSet(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return MetersetRateSet.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setNominalBeamEnergy(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NominalBeamEnergy.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setNumberOfPaintings(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfPaintings.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setNumberOfScanSpotPositions(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfScanSpotPositions.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setPatientSupportAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setPatientSupportRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setReferencedControlPointIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedControlPointIndex.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setScanSpotMetersetsDelivered(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ScanSpotMetersetsDelivered.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setScanSpotPositionMap(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ScanSpotPositionMap.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setScanSpotPrescribedIndices(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ScanSpotPrescribedIndices.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setScanSpotReordered(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScanSpotReordered.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setScanSpotTimeOffset(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ScanSpotTimeOffset.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setScanSpotTuneID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScanSpotTuneID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setScanningSpotSize(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ScanningSpotSize.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setSnoutPosition(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SnoutPosition.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setSpecifiedMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpecifiedMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTableTopLateralPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTableTopLongitudinalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTableTopPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTableTopPitchRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopPitchRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTableTopRollAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopRollAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTableTopRollRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopRollRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTableTopVerticalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTreatmentControlPointDate(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentControlPointDate.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::Item::setTreatmentControlPointTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentControlPointTime.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIonControlPointDeliverySequence::DRTIonControlPointDeliverySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonControlPointDeliverySequence::DRTIonControlPointDeliverySequence(const DRTIonControlPointDeliverySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonControlPointDeliverySequence &DRTIonControlPointDeliverySequence::operator=(const DRTIonControlPointDeliverySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonControlPointDeliverySequence::~DRTIonControlPointDeliverySequence() +{ + clear(); +} + + +void DRTIonControlPointDeliverySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonControlPointDeliverySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonControlPointDeliverySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonControlPointDeliverySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonControlPointDeliverySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonControlPointDeliverySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonControlPointDeliverySequence::Item &DRTIonControlPointDeliverySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonControlPointDeliverySequence::Item &DRTIonControlPointDeliverySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonControlPointDeliverySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonControlPointDeliverySequence::Item &DRTIonControlPointDeliverySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonControlPointDeliverySequence::Item &DRTIonControlPointDeliverySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonControlPointDeliverySequence::Item &DRTIonControlPointDeliverySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonControlPointDeliverySequence::Item &DRTIonControlPointDeliverySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonControlPointDeliverySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonControlPointDeliverySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonControlPointDeliverySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonControlPointDeliverySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonControlPointDeliverySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drticps.cc b/dcmrt/libsrc/drticps.cc new file mode 100644 index 00000000..8380160b --- /dev/null +++ b/dcmrt/libsrc/drticps.cc @@ -0,0 +1,1627 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drticps.h" + + +// --- item class --- + +DRTIonControlPointSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamLimitingDeviceAngle(DCM_BeamLimitingDeviceAngle), + BeamLimitingDevicePositionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamLimitingDeviceRotationDirection(DCM_BeamLimitingDeviceRotationDirection), + ChairHeadFramePosition(DCM_ChairHeadFramePosition), + ControlPointIndex(DCM_ControlPointIndex), + CumulativeMetersetWeight(DCM_CumulativeMetersetWeight), + ExternalContourEntryPoint(DCM_ExternalContourEntryPoint), + GantryAngle(DCM_GantryAngle), + GantryPitchAngle(DCM_GantryPitchAngle), + GantryPitchRotationDirection(DCM_GantryPitchRotationDirection), + GantryRotationDirection(DCM_GantryRotationDirection), + HeadFixationAngle(DCM_HeadFixationAngle), + IonWedgePositionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + IsocenterPosition(DCM_IsocenterPosition), + KVP(DCM_KVP), + LateralSpreadingDeviceSettingsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + MetersetRate(DCM_MetersetRate), + NominalBeamEnergy(DCM_NominalBeamEnergy), + NumberOfPaintings(DCM_NumberOfPaintings), + NumberOfScanSpotPositions(DCM_NumberOfScanSpotPositions), + PatientSupportAngle(DCM_PatientSupportAngle), + PatientSupportRotationDirection(DCM_PatientSupportRotationDirection), + RangeModulatorSettingsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RangeShifterSettingsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedDoseReferenceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ScanSpotMetersetWeights(DCM_ScanSpotMetersetWeights), + ScanSpotPositionMap(DCM_ScanSpotPositionMap), + ScanSpotReorderingAllowed(DCM_ScanSpotReorderingAllowed), + ScanSpotTuneID(DCM_ScanSpotTuneID), + ScanningSpotSize(DCM_ScanningSpotSize), + SnoutPosition(DCM_SnoutPosition), + SurfaceEntryPoint(DCM_SurfaceEntryPoint), + TableTopLateralPosition(DCM_TableTopLateralPosition), + TableTopLongitudinalPosition(DCM_TableTopLongitudinalPosition), + TableTopPitchAngle(DCM_TableTopPitchAngle), + TableTopPitchRotationDirection(DCM_TableTopPitchRotationDirection), + TableTopRollAngle(DCM_TableTopRollAngle), + TableTopRollRotationDirection(DCM_TableTopRollRotationDirection), + TableTopVerticalPosition(DCM_TableTopVerticalPosition) +{ +} + + +DRTIonControlPointSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamLimitingDeviceAngle(copy.BeamLimitingDeviceAngle), + BeamLimitingDevicePositionSequence(copy.BeamLimitingDevicePositionSequence), + BeamLimitingDeviceRotationDirection(copy.BeamLimitingDeviceRotationDirection), + ChairHeadFramePosition(copy.ChairHeadFramePosition), + ControlPointIndex(copy.ControlPointIndex), + CumulativeMetersetWeight(copy.CumulativeMetersetWeight), + ExternalContourEntryPoint(copy.ExternalContourEntryPoint), + GantryAngle(copy.GantryAngle), + GantryPitchAngle(copy.GantryPitchAngle), + GantryPitchRotationDirection(copy.GantryPitchRotationDirection), + GantryRotationDirection(copy.GantryRotationDirection), + HeadFixationAngle(copy.HeadFixationAngle), + IonWedgePositionSequence(copy.IonWedgePositionSequence), + IsocenterPosition(copy.IsocenterPosition), + KVP(copy.KVP), + LateralSpreadingDeviceSettingsSequence(copy.LateralSpreadingDeviceSettingsSequence), + MetersetRate(copy.MetersetRate), + NominalBeamEnergy(copy.NominalBeamEnergy), + NumberOfPaintings(copy.NumberOfPaintings), + NumberOfScanSpotPositions(copy.NumberOfScanSpotPositions), + PatientSupportAngle(copy.PatientSupportAngle), + PatientSupportRotationDirection(copy.PatientSupportRotationDirection), + RangeModulatorSettingsSequence(copy.RangeModulatorSettingsSequence), + RangeShifterSettingsSequence(copy.RangeShifterSettingsSequence), + ReferencedDoseReferenceSequence(copy.ReferencedDoseReferenceSequence), + ScanSpotMetersetWeights(copy.ScanSpotMetersetWeights), + ScanSpotPositionMap(copy.ScanSpotPositionMap), + ScanSpotReorderingAllowed(copy.ScanSpotReorderingAllowed), + ScanSpotTuneID(copy.ScanSpotTuneID), + ScanningSpotSize(copy.ScanningSpotSize), + SnoutPosition(copy.SnoutPosition), + SurfaceEntryPoint(copy.SurfaceEntryPoint), + TableTopLateralPosition(copy.TableTopLateralPosition), + TableTopLongitudinalPosition(copy.TableTopLongitudinalPosition), + TableTopPitchAngle(copy.TableTopPitchAngle), + TableTopPitchRotationDirection(copy.TableTopPitchRotationDirection), + TableTopRollAngle(copy.TableTopRollAngle), + TableTopRollRotationDirection(copy.TableTopRollRotationDirection), + TableTopVerticalPosition(copy.TableTopVerticalPosition) +{ +} + + +DRTIonControlPointSequence::Item::~Item() +{ +} + + +DRTIonControlPointSequence::Item &DRTIonControlPointSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamLimitingDeviceAngle = copy.BeamLimitingDeviceAngle; + BeamLimitingDevicePositionSequence = copy.BeamLimitingDevicePositionSequence; + BeamLimitingDeviceRotationDirection = copy.BeamLimitingDeviceRotationDirection; + ChairHeadFramePosition = copy.ChairHeadFramePosition; + ControlPointIndex = copy.ControlPointIndex; + CumulativeMetersetWeight = copy.CumulativeMetersetWeight; + ExternalContourEntryPoint = copy.ExternalContourEntryPoint; + GantryAngle = copy.GantryAngle; + GantryPitchAngle = copy.GantryPitchAngle; + GantryPitchRotationDirection = copy.GantryPitchRotationDirection; + GantryRotationDirection = copy.GantryRotationDirection; + HeadFixationAngle = copy.HeadFixationAngle; + IonWedgePositionSequence = copy.IonWedgePositionSequence; + IsocenterPosition = copy.IsocenterPosition; + KVP = copy.KVP; + LateralSpreadingDeviceSettingsSequence = copy.LateralSpreadingDeviceSettingsSequence; + MetersetRate = copy.MetersetRate; + NominalBeamEnergy = copy.NominalBeamEnergy; + NumberOfPaintings = copy.NumberOfPaintings; + NumberOfScanSpotPositions = copy.NumberOfScanSpotPositions; + PatientSupportAngle = copy.PatientSupportAngle; + PatientSupportRotationDirection = copy.PatientSupportRotationDirection; + RangeModulatorSettingsSequence = copy.RangeModulatorSettingsSequence; + RangeShifterSettingsSequence = copy.RangeShifterSettingsSequence; + ReferencedDoseReferenceSequence = copy.ReferencedDoseReferenceSequence; + ScanSpotMetersetWeights = copy.ScanSpotMetersetWeights; + ScanSpotPositionMap = copy.ScanSpotPositionMap; + ScanSpotReorderingAllowed = copy.ScanSpotReorderingAllowed; + ScanSpotTuneID = copy.ScanSpotTuneID; + ScanningSpotSize = copy.ScanningSpotSize; + SnoutPosition = copy.SnoutPosition; + SurfaceEntryPoint = copy.SurfaceEntryPoint; + TableTopLateralPosition = copy.TableTopLateralPosition; + TableTopLongitudinalPosition = copy.TableTopLongitudinalPosition; + TableTopPitchAngle = copy.TableTopPitchAngle; + TableTopPitchRotationDirection = copy.TableTopPitchRotationDirection; + TableTopRollAngle = copy.TableTopRollAngle; + TableTopRollRotationDirection = copy.TableTopRollRotationDirection; + TableTopVerticalPosition = copy.TableTopVerticalPosition; + } + return *this; +} + + +void DRTIonControlPointSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ControlPointIndex.clear(); + CumulativeMetersetWeight.clear(); + ReferencedDoseReferenceSequence.clear(); + NominalBeamEnergy.clear(); + KVP.clear(); + MetersetRate.clear(); + IonWedgePositionSequence.clear(); + RangeShifterSettingsSequence.clear(); + LateralSpreadingDeviceSettingsSequence.clear(); + RangeModulatorSettingsSequence.clear(); + BeamLimitingDevicePositionSequence.clear(); + GantryAngle.clear(); + GantryRotationDirection.clear(); + GantryPitchAngle.clear(); + GantryPitchRotationDirection.clear(); + BeamLimitingDeviceAngle.clear(); + BeamLimitingDeviceRotationDirection.clear(); + ScanSpotTuneID.clear(); + ScanSpotReorderingAllowed.clear(); + NumberOfScanSpotPositions.clear(); + ScanSpotPositionMap.clear(); + ScanSpotMetersetWeights.clear(); + ScanningSpotSize.clear(); + NumberOfPaintings.clear(); + PatientSupportAngle.clear(); + PatientSupportRotationDirection.clear(); + TableTopPitchAngle.clear(); + TableTopPitchRotationDirection.clear(); + TableTopRollAngle.clear(); + TableTopRollRotationDirection.clear(); + HeadFixationAngle.clear(); + ChairHeadFramePosition.clear(); + TableTopVerticalPosition.clear(); + TableTopLongitudinalPosition.clear(); + TableTopLateralPosition.clear(); + SnoutPosition.clear(); + IsocenterPosition.clear(); + SurfaceEntryPoint.clear(); + ExternalContourEntryPoint.clear(); + } +} + + +OFBool DRTIonControlPointSequence::Item::isEmpty() +{ + return ControlPointIndex.isEmpty() && + CumulativeMetersetWeight.isEmpty() && + ReferencedDoseReferenceSequence.isEmpty() && + NominalBeamEnergy.isEmpty() && + KVP.isEmpty() && + MetersetRate.isEmpty() && + IonWedgePositionSequence.isEmpty() && + RangeShifterSettingsSequence.isEmpty() && + LateralSpreadingDeviceSettingsSequence.isEmpty() && + RangeModulatorSettingsSequence.isEmpty() && + BeamLimitingDevicePositionSequence.isEmpty() && + GantryAngle.isEmpty() && + GantryRotationDirection.isEmpty() && + GantryPitchAngle.isEmpty() && + GantryPitchRotationDirection.isEmpty() && + BeamLimitingDeviceAngle.isEmpty() && + BeamLimitingDeviceRotationDirection.isEmpty() && + ScanSpotTuneID.isEmpty() && + ScanSpotReorderingAllowed.isEmpty() && + NumberOfScanSpotPositions.isEmpty() && + ScanSpotPositionMap.isEmpty() && + ScanSpotMetersetWeights.isEmpty() && + ScanningSpotSize.isEmpty() && + NumberOfPaintings.isEmpty() && + PatientSupportAngle.isEmpty() && + PatientSupportRotationDirection.isEmpty() && + TableTopPitchAngle.isEmpty() && + TableTopPitchRotationDirection.isEmpty() && + TableTopRollAngle.isEmpty() && + TableTopRollRotationDirection.isEmpty() && + HeadFixationAngle.isEmpty() && + ChairHeadFramePosition.isEmpty() && + TableTopVerticalPosition.isEmpty() && + TableTopLongitudinalPosition.isEmpty() && + TableTopLateralPosition.isEmpty() && + SnoutPosition.isEmpty() && + IsocenterPosition.isEmpty() && + SurfaceEntryPoint.isEmpty() && + ExternalContourEntryPoint.isEmpty(); +} + + +OFBool DRTIonControlPointSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonControlPointSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ControlPointIndex, "1", "1", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, CumulativeMetersetWeight, "1", "2", "IonControlPointSequence"); + ReferencedDoseReferenceSequence.read(item, "1-n", "3", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, NominalBeamEnergy, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, KVP, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, MetersetRate, "1", "3", "IonControlPointSequence"); + IonWedgePositionSequence.read(item, "1-n", "1C", "IonControlPointSequence"); + RangeShifterSettingsSequence.read(item, "1-n", "1C", "IonControlPointSequence"); + LateralSpreadingDeviceSettingsSequence.read(item, "1-n", "1C", "IonControlPointSequence"); + RangeModulatorSettingsSequence.read(item, "1-n", "1C", "IonControlPointSequence"); + BeamLimitingDevicePositionSequence.read(item, "1-n", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, GantryAngle, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, GantryRotationDirection, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, GantryPitchAngle, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, GantryPitchRotationDirection, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceAngle, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceRotationDirection, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, ScanSpotTuneID, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, ScanSpotReorderingAllowed, "1", "3", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, NumberOfScanSpotPositions, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, ScanSpotPositionMap, "1-n", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, ScanSpotMetersetWeights, "1-n", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, ScanningSpotSize, "2", "3", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, NumberOfPaintings, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, PatientSupportAngle, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, PatientSupportRotationDirection, "1", "1C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopPitchAngle, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopPitchRotationDirection, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopRollAngle, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopRollRotationDirection, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, HeadFixationAngle, "1", "3", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, ChairHeadFramePosition, "1", "3", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopVerticalPosition, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopLongitudinalPosition, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, TableTopLateralPosition, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, SnoutPosition, "1", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, IsocenterPosition, "3", "2C", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, SurfaceEntryPoint, "3", "3", "IonControlPointSequence"); + getAndCheckElementFromDataset(item, ExternalContourEntryPoint, "3", "3", "IonControlPointSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ControlPointIndex), "1", "1", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(CumulativeMetersetWeight), "1", "2", "IonControlPointSequence"); + if (result.good()) result = ReferencedDoseReferenceSequence.write(item, "1-n", "3", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(NominalBeamEnergy), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(KVP), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(MetersetRate), "1", "3", "IonControlPointSequence"); + if (result.good()) result = IonWedgePositionSequence.write(item, "1-n", "1C", "IonControlPointSequence"); + if (result.good()) result = RangeShifterSettingsSequence.write(item, "1-n", "1C", "IonControlPointSequence"); + if (result.good()) result = LateralSpreadingDeviceSettingsSequence.write(item, "1-n", "1C", "IonControlPointSequence"); + if (result.good()) result = RangeModulatorSettingsSequence.write(item, "1-n", "1C", "IonControlPointSequence"); + if (result.good()) result = BeamLimitingDevicePositionSequence.write(item, "1-n", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(GantryAngle), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(GantryRotationDirection), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(GantryPitchAngle), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(GantryPitchRotationDirection), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamLimitingDeviceAngle), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamLimitingDeviceRotationDirection), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmShortString(ScanSpotTuneID), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(ScanSpotReorderingAllowed), "1", "3", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfScanSpotPositions), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ScanSpotPositionMap), "1-n", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ScanSpotMetersetWeights), "1-n", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ScanningSpotSize), "2", "3", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfPaintings), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(PatientSupportAngle), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(PatientSupportRotationDirection), "1", "1C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopPitchAngle), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(TableTopPitchRotationDirection), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopRollAngle), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmCodeString(TableTopRollRotationDirection), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(HeadFixationAngle), "1", "3", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChairHeadFramePosition), "1", "3", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopVerticalPosition), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLongitudinalPosition), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLateralPosition), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(SnoutPosition), "1", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(IsocenterPosition), "3", "2C", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmDecimalString(SurfaceEntryPoint), "3", "3", "IonControlPointSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ExternalContourEntryPoint), "3", "3", "IonControlPointSequence"); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::getBeamLimitingDeviceAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceAngle, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamLimitingDeviceAngle).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getBeamLimitingDeviceRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getChairHeadFramePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChairHeadFramePosition, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getChairHeadFramePosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChairHeadFramePosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getControlPointIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ControlPointIndex, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getControlPointIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ControlPointIndex).getSint32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getExternalContourEntryPoint(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ExternalContourEntryPoint).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getGantryAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryAngle, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getGantryAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, GantryAngle).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getGantryPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, GantryPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getGantryPitchRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryPitchRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getGantryRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getHeadFixationAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, HeadFixationAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getIsocenterPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(IsocenterPosition, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getIsocenterPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, IsocenterPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getIsocenterPosition(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, IsocenterPosition).getFloat64Vector(value); +} + + +OFCondition DRTIonControlPointSequence::Item::getKVP(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(KVP, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getKVP(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, KVP).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getMetersetRate(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, MetersetRate).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getNominalBeamEnergy(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NominalBeamEnergy, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getNominalBeamEnergy(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NominalBeamEnergy).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getNumberOfPaintings(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfPaintings, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getNumberOfPaintings(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfPaintings).getSint32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getNumberOfScanSpotPositions(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfScanSpotPositions, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getNumberOfScanSpotPositions(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfScanSpotPositions).getSint32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getPatientSupportAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAngle, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getPatientSupportAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, PatientSupportAngle).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getPatientSupportRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getScanSpotMetersetWeights(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ScanSpotMetersetWeights).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getScanSpotPositionMap(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ScanSpotPositionMap).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getScanSpotReorderingAllowed(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScanSpotReorderingAllowed, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getScanSpotTuneID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScanSpotTuneID, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getScanningSpotSize(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ScanningSpotSize).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getSnoutPosition(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, SnoutPosition).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getSurfaceEntryPoint(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SurfaceEntryPoint, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getSurfaceEntryPoint(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SurfaceEntryPoint).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getSurfaceEntryPoint(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SurfaceEntryPoint).getFloat64Vector(value); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopLateralPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLateralPosition, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopLateralPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLateralPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopLongitudinalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLongitudinalPosition, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopPitchAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopPitchRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopPitchRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopRollAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopRollAngle).getFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopRollRotationDirection(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopRollRotationDirection, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopVerticalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopVerticalPosition, value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::getTableTopVerticalPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopVerticalPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setBeamLimitingDeviceAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setBeamLimitingDeviceRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setChairHeadFramePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChairHeadFramePosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setControlPointIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ControlPointIndex.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setExternalContourEntryPoint(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ExternalContourEntryPoint.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setGantryAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setGantryPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return GantryPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setGantryPitchRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryPitchRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setGantryRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setHeadFixationAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return HeadFixationAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setIsocenterPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = IsocenterPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setKVP(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = KVP.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setMetersetRate(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return MetersetRate.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setNominalBeamEnergy(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NominalBeamEnergy.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setNumberOfPaintings(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfPaintings.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setNumberOfScanSpotPositions(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfScanSpotPositions.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setPatientSupportAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setPatientSupportRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setScanSpotMetersetWeights(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ScanSpotMetersetWeights.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setScanSpotPositionMap(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ScanSpotPositionMap.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setScanSpotReorderingAllowed(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScanSpotReorderingAllowed.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setScanSpotTuneID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScanSpotTuneID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setScanningSpotSize(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ScanningSpotSize.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setSnoutPosition(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SnoutPosition.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setSurfaceEntryPoint(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = SurfaceEntryPoint.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setTableTopLateralPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setTableTopLongitudinalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setTableTopPitchAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setTableTopPitchRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopPitchRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setTableTopRollAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopRollAngle.putFloat32(value, pos); +} + + +OFCondition DRTIonControlPointSequence::Item::setTableTopRollRotationDirection(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopRollRotationDirection.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::Item::setTableTopVerticalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalPosition.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIonControlPointSequence::DRTIonControlPointSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonControlPointSequence::DRTIonControlPointSequence(const DRTIonControlPointSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonControlPointSequence &DRTIonControlPointSequence::operator=(const DRTIonControlPointSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonControlPointSequence::~DRTIonControlPointSequence() +{ + clear(); +} + + +void DRTIonControlPointSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonControlPointSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonControlPointSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonControlPointSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonControlPointSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonControlPointSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonControlPointSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonControlPointSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonControlPointSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonControlPointSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonControlPointSequence::Item &DRTIonControlPointSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonControlPointSequence::Item &DRTIonControlPointSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonControlPointSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonControlPointSequence::Item &DRTIonControlPointSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonControlPointSequence::Item &DRTIonControlPointSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonControlPointSequence::Item &DRTIonControlPointSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonControlPointSequence::Item &DRTIonControlPointSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonControlPointSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonControlPointSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonControlPointSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonControlPointSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonControlPointSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonControlPointSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonControlPointSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonControlPointSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtics.cc b/dcmrt/libsrc/drtics.cc new file mode 100644 index 00000000..f308acb7 --- /dev/null +++ b/dcmrt/libsrc/drtics.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTInstitutionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtics.h" + + +// --- item class --- + +DRTInstitutionCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTInstitutionCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTInstitutionCodeSequence::Item::~Item() +{ +} + + +DRTInstitutionCodeSequence::Item &DRTInstitutionCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTInstitutionCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTInstitutionCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTInstitutionCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTInstitutionCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "InstitutionCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "InstitutionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "InstitutionCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "InstitutionCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "InstitutionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "InstitutionCodeSequence"); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTInstitutionCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTInstitutionCodeSequence::DRTInstitutionCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTInstitutionCodeSequence::DRTInstitutionCodeSequence(const DRTInstitutionCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTInstitutionCodeSequence &DRTInstitutionCodeSequence::operator=(const DRTInstitutionCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTInstitutionCodeSequence::~DRTInstitutionCodeSequence() +{ + clear(); +} + + +void DRTInstitutionCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTInstitutionCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTInstitutionCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTInstitutionCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTInstitutionCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTInstitutionCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTInstitutionCodeSequence::Item &DRTInstitutionCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTInstitutionCodeSequence::Item &DRTInstitutionCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTInstitutionCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTInstitutionCodeSequence::Item &DRTInstitutionCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTInstitutionCodeSequence::Item &DRTInstitutionCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTInstitutionCodeSequence::Item &DRTInstitutionCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTInstitutionCodeSequence::Item &DRTInstitutionCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTInstitutionCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_InstitutionCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_InstitutionCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTInstitutionCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_InstitutionCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtiis.cc b/dcmrt/libsrc/drtiis.cc new file mode 100644 index 00000000..db2224bc --- /dev/null +++ b/dcmrt/libsrc/drtiis.cc @@ -0,0 +1,1083 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIconImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtiis.h" + + +// --- item class --- + +DRTIconImageSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BitsAllocated(DCM_BitsAllocated), + BitsStored(DCM_BitsStored), + BluePaletteColorLookupTableData(DCM_BluePaletteColorLookupTableData), + BluePaletteColorLookupTableDescriptor(DCM_BluePaletteColorLookupTableDescriptor), + ColorSpace(DCM_ColorSpace), + Columns(DCM_Columns), + GreenPaletteColorLookupTableData(DCM_GreenPaletteColorLookupTableData), + GreenPaletteColorLookupTableDescriptor(DCM_GreenPaletteColorLookupTableDescriptor), + HighBit(DCM_HighBit), + ICCProfile(DCM_ICCProfile), + LargestImagePixelValue(DCM_LargestImagePixelValue), + PhotometricInterpretation(DCM_PhotometricInterpretation), + PixelAspectRatio(DCM_PixelAspectRatio), + PixelData(DCM_PixelData), + PixelRepresentation(DCM_PixelRepresentation), + PlanarConfiguration(DCM_PlanarConfiguration), + RedPaletteColorLookupTableData(DCM_RedPaletteColorLookupTableData), + RedPaletteColorLookupTableDescriptor(DCM_RedPaletteColorLookupTableDescriptor), + Rows(DCM_Rows), + SamplesPerPixel(DCM_SamplesPerPixel), + SmallestImagePixelValue(DCM_SmallestImagePixelValue) +{ +} + + +DRTIconImageSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BitsAllocated(copy.BitsAllocated), + BitsStored(copy.BitsStored), + BluePaletteColorLookupTableData(copy.BluePaletteColorLookupTableData), + BluePaletteColorLookupTableDescriptor(copy.BluePaletteColorLookupTableDescriptor), + ColorSpace(copy.ColorSpace), + Columns(copy.Columns), + GreenPaletteColorLookupTableData(copy.GreenPaletteColorLookupTableData), + GreenPaletteColorLookupTableDescriptor(copy.GreenPaletteColorLookupTableDescriptor), + HighBit(copy.HighBit), + ICCProfile(copy.ICCProfile), + LargestImagePixelValue(copy.LargestImagePixelValue), + PhotometricInterpretation(copy.PhotometricInterpretation), + PixelAspectRatio(copy.PixelAspectRatio), + PixelData(copy.PixelData), + PixelRepresentation(copy.PixelRepresentation), + PlanarConfiguration(copy.PlanarConfiguration), + RedPaletteColorLookupTableData(copy.RedPaletteColorLookupTableData), + RedPaletteColorLookupTableDescriptor(copy.RedPaletteColorLookupTableDescriptor), + Rows(copy.Rows), + SamplesPerPixel(copy.SamplesPerPixel), + SmallestImagePixelValue(copy.SmallestImagePixelValue) +{ +} + + +DRTIconImageSequence::Item::~Item() +{ +} + + +DRTIconImageSequence::Item &DRTIconImageSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BitsAllocated = copy.BitsAllocated; + BitsStored = copy.BitsStored; + BluePaletteColorLookupTableData = copy.BluePaletteColorLookupTableData; + BluePaletteColorLookupTableDescriptor = copy.BluePaletteColorLookupTableDescriptor; + ColorSpace = copy.ColorSpace; + Columns = copy.Columns; + GreenPaletteColorLookupTableData = copy.GreenPaletteColorLookupTableData; + GreenPaletteColorLookupTableDescriptor = copy.GreenPaletteColorLookupTableDescriptor; + HighBit = copy.HighBit; + ICCProfile = copy.ICCProfile; + LargestImagePixelValue = copy.LargestImagePixelValue; + PhotometricInterpretation = copy.PhotometricInterpretation; + PixelAspectRatio = copy.PixelAspectRatio; + PixelData = copy.PixelData; + PixelRepresentation = copy.PixelRepresentation; + PlanarConfiguration = copy.PlanarConfiguration; + RedPaletteColorLookupTableData = copy.RedPaletteColorLookupTableData; + RedPaletteColorLookupTableDescriptor = copy.RedPaletteColorLookupTableDescriptor; + Rows = copy.Rows; + SamplesPerPixel = copy.SamplesPerPixel; + SmallestImagePixelValue = copy.SmallestImagePixelValue; + } + return *this; +} + + +void DRTIconImageSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SamplesPerPixel.clear(); + PhotometricInterpretation.clear(); + Rows.clear(); + Columns.clear(); + BitsAllocated.clear(); + BitsStored.clear(); + HighBit.clear(); + PixelRepresentation.clear(); + PlanarConfiguration.clear(); + PixelAspectRatio.clear(); + SmallestImagePixelValue.clear(); + LargestImagePixelValue.clear(); + RedPaletteColorLookupTableDescriptor.clear(); + GreenPaletteColorLookupTableDescriptor.clear(); + BluePaletteColorLookupTableDescriptor.clear(); + RedPaletteColorLookupTableData.clear(); + GreenPaletteColorLookupTableData.clear(); + BluePaletteColorLookupTableData.clear(); + ICCProfile.clear(); + ColorSpace.clear(); + PixelData.clear(); + } +} + + +OFBool DRTIconImageSequence::Item::isEmpty() +{ + return SamplesPerPixel.isEmpty() && + PhotometricInterpretation.isEmpty() && + Rows.isEmpty() && + Columns.isEmpty() && + BitsAllocated.isEmpty() && + BitsStored.isEmpty() && + HighBit.isEmpty() && + PixelRepresentation.isEmpty() && + PlanarConfiguration.isEmpty() && + PixelAspectRatio.isEmpty() && + SmallestImagePixelValue.isEmpty() && + LargestImagePixelValue.isEmpty() && + RedPaletteColorLookupTableDescriptor.isEmpty() && + GreenPaletteColorLookupTableDescriptor.isEmpty() && + BluePaletteColorLookupTableDescriptor.isEmpty() && + RedPaletteColorLookupTableData.isEmpty() && + GreenPaletteColorLookupTableData.isEmpty() && + BluePaletteColorLookupTableData.isEmpty() && + ICCProfile.isEmpty() && + ColorSpace.isEmpty() && + PixelData.isEmpty(); +} + + +OFBool DRTIconImageSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIconImageSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SamplesPerPixel, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, PhotometricInterpretation, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, Rows, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, Columns, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, BitsAllocated, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, BitsStored, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, HighBit, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, PixelRepresentation, "1", "1", "IconImageSequence"); + getAndCheckElementFromDataset(item, PlanarConfiguration, "1", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, PixelAspectRatio, "2", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, SmallestImagePixelValue, "1", "3", "IconImageSequence"); + getAndCheckElementFromDataset(item, LargestImagePixelValue, "1", "3", "IconImageSequence"); + getAndCheckElementFromDataset(item, RedPaletteColorLookupTableDescriptor, "3", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, GreenPaletteColorLookupTableDescriptor, "3", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, BluePaletteColorLookupTableDescriptor, "3", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, RedPaletteColorLookupTableData, "1", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, GreenPaletteColorLookupTableData, "1", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, BluePaletteColorLookupTableData, "1", "1C", "IconImageSequence"); + getAndCheckElementFromDataset(item, ICCProfile, "1", "3", "IconImageSequence"); + getAndCheckElementFromDataset(item, ColorSpace, "1", "3", "IconImageSequence"); + getAndCheckElementFromDataset(item, PixelData, "1", "1", "IconImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(SamplesPerPixel), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmCodeString(PhotometricInterpretation), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(Rows), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(Columns), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(BitsAllocated), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(BitsStored), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(HighBit), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(PixelRepresentation), "1", "1", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(PlanarConfiguration), "1", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(PixelAspectRatio), "2", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(SmallestImagePixelValue), "1", "3", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(LargestImagePixelValue), "1", "3", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(RedPaletteColorLookupTableDescriptor), "3", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(GreenPaletteColorLookupTableDescriptor), "3", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(BluePaletteColorLookupTableDescriptor), "3", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(RedPaletteColorLookupTableData), "1", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(GreenPaletteColorLookupTableData), "1", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(BluePaletteColorLookupTableData), "1", "1C", "IconImageSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(ICCProfile), "1", "3", "IconImageSequence"); + addElementToDataset(result, item, new DcmCodeString(ColorSpace), "1", "3", "IconImageSequence"); + addElementToDataset(result, item, new DcmPixelData(PixelData), "1", "1", "IconImageSequence"); + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::getBitsAllocated(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, BitsAllocated).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getBitsStored(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, BitsStored).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getBluePaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, BluePaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, BluePaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::getBluePaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, BluePaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getColorSpace(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ColorSpace, value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getColumns(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, Columns).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getGreenPaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, GreenPaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, GreenPaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::getGreenPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, GreenPaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getHighBit(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, HighBit).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getICCProfile(Uint8 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, ICCProfile).getUint8Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, ICCProfile).getLength() / sizeof(Uint8); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::getLargestImagePixelValue(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, LargestImagePixelValue).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getPhotometricInterpretation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PhotometricInterpretation, value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getPixelAspectRatio(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PixelAspectRatio, value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getPixelAspectRatio(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, PixelAspectRatio).getSint32(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getPixelRepresentation(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, PixelRepresentation).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getPlanarConfiguration(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, PlanarConfiguration).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getRedPaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, RedPaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, RedPaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::getRedPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, RedPaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getRows(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, Rows).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getSamplesPerPixel(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, SamplesPerPixel).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::getSmallestImagePixelValue(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, SmallestImagePixelValue).getUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setBitsAllocated(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BitsAllocated.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setBitsStored(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BitsStored.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setBluePaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BluePaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTIconImageSequence::Item::setBluePaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BluePaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setColorSpace(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ColorSpace.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::setColumns(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return Columns.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setGreenPaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return GreenPaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTIconImageSequence::Item::setGreenPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return GreenPaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setHighBit(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return HighBit.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setICCProfile(const Uint8 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ICCProfile.putUint8Array(value, count); +} + + +OFCondition DRTIconImageSequence::Item::setLargestImagePixelValue(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return LargestImagePixelValue.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setPhotometricInterpretation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PhotometricInterpretation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::setPixelAspectRatio(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = PixelAspectRatio.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIconImageSequence::Item::setPixelRepresentation(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return PixelRepresentation.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setPlanarConfiguration(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return PlanarConfiguration.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setRedPaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RedPaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTIconImageSequence::Item::setRedPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RedPaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setRows(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return Rows.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setSamplesPerPixel(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SamplesPerPixel.putUint16(value, pos); +} + + +OFCondition DRTIconImageSequence::Item::setSmallestImagePixelValue(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SmallestImagePixelValue.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTIconImageSequence::DRTIconImageSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIconImageSequence::DRTIconImageSequence(const DRTIconImageSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIconImageSequence &DRTIconImageSequence::operator=(const DRTIconImageSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIconImageSequence::~DRTIconImageSequence() +{ + clear(); +} + + +void DRTIconImageSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIconImageSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIconImageSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIconImageSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIconImageSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIconImageSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIconImageSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIconImageSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIconImageSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIconImageSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIconImageSequence::Item &DRTIconImageSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIconImageSequence::Item &DRTIconImageSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIconImageSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIconImageSequence::Item &DRTIconImageSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIconImageSequence::Item &DRTIconImageSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIconImageSequence::Item &DRTIconImageSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIconImageSequence::Item &DRTIconImageSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIconImageSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIconImageSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIconImageSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIconImageSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IconImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IconImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIconImageSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IconImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtimage.cc b/dcmrt/libsrc/drtimage.cc new file mode 100644 index 00000000..d34aba4d --- /dev/null +++ b/dcmrt/libsrc/drtimage.cc @@ -0,0 +1,6133 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTImageIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drtimage.h" + + +DRTImageIOD::DRTImageIOD() + : PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(), + PatientBirthDate(DCM_PatientBirthDate), + PatientBirthDateInAlternativeCalendar(DCM_PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(DCM_PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(DCM_PatientAlternativeCalendar), + PatientSex(DCM_PatientSex), + ReferencedPatientPhotoSequence(), + QualityControlSubject(DCM_QualityControlSubject), + ReferencedPatientSequence(), + PatientBirthTime(DCM_PatientBirthTime), + OtherPatientIDsSequence(), + OtherPatientNames(DCM_OtherPatientNames), + EthnicGroup(DCM_EthnicGroup), + PatientComments(DCM_PatientComments), + PatientSpeciesDescription(DCM_PatientSpeciesDescription), + PatientSpeciesCodeSequence(), + PatientBreedDescription(DCM_PatientBreedDescription), + PatientBreedCodeSequence(), + BreedRegistrationSequence(), + StrainDescription(DCM_StrainDescription), + StrainNomenclature(DCM_StrainNomenclature), + StrainCodeSequence(), + StrainAdditionalInformation(DCM_StrainAdditionalInformation), + StrainStockSequence(), + GeneticModificationsSequence(), + ResponsiblePerson(DCM_ResponsiblePerson), + ResponsiblePersonRole(DCM_ResponsiblePersonRole), + ResponsibleOrganization(DCM_ResponsibleOrganization), + PatientIdentityRemoved(DCM_PatientIdentityRemoved), + DeidentificationMethod(DCM_DeidentificationMethod), + DeidentificationMethodCodeSequence(), + SourcePatientGroupIdentificationSequence(), + GroupOfPatientsIdentificationSequence(), + ClinicalTrialSponsorName(DCM_ClinicalTrialSponsorName), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ClinicalTrialProtocolName(DCM_ClinicalTrialProtocolName), + ClinicalTrialSiteID(DCM_ClinicalTrialSiteID), + ClinicalTrialSiteName(DCM_ClinicalTrialSiteName), + ClinicalTrialSubjectID(DCM_ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(DCM_ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(DCM_ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(), + ConsultingPhysicianName(DCM_ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(), + StudyDescription(DCM_StudyDescription), + PhysiciansOfRecord(DCM_PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(), + NameOfPhysiciansReadingStudy(DCM_NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(), + RequestingServiceCodeSequence(), + ReferencedStudySequence(), + ProcedureCodeSequence(), + ReasonForPerformedProcedureCodeSequence(), + AdmittingDiagnosesDescription(DCM_AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(), + PatientAge(DCM_PatientAge), + PatientSize(DCM_PatientSize), + PatientWeight(DCM_PatientWeight), + PatientBodyMassIndex(DCM_PatientBodyMassIndex), + MeasuredAPDimension(DCM_MeasuredAPDimension), + MeasuredLateralDimension(DCM_MeasuredLateralDimension), + PatientSizeCodeSequence(), + MedicalAlerts(DCM_MedicalAlerts), + Allergies(DCM_Allergies), + SmokingStatus(DCM_SmokingStatus), + PregnancyStatus(DCM_PregnancyStatus), + LastMenstrualDate(DCM_LastMenstrualDate), + PatientState(DCM_PatientState), + Occupation(DCM_Occupation), + AdditionalPatientHistory(DCM_AdditionalPatientHistory), + AdmissionID(DCM_AdmissionID), + IssuerOfAdmissionIDSequence(), + ServiceEpisodeID(DCM_ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(), + ServiceEpisodeDescription(DCM_ServiceEpisodeDescription), + PatientSexNeutered(DCM_PatientSexNeutered), + ClinicalTrialTimePointID(DCM_ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(DCM_ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(DCM_LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(DCM_LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + SeriesDescription(DCM_SeriesDescription), + SeriesDescriptionCodeSequence(), + OperatorsName(DCM_OperatorsName), + OperatorIdentificationSequence(), + ReferencedPerformedProcedureStepSequence(), + RequestAttributesSequence(), + PerformedProcedureStepID(DCM_PerformedProcedureStepID), + PerformedProcedureStepStartDate(DCM_PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(DCM_PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(DCM_PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(DCM_PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(DCM_PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(), + CommentsOnThePerformedProcedureStep(DCM_CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(DCM_ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(DCM_ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(DCM_ClinicalTrialSeriesDescription), + FrameOfReferenceUID(DCM_FrameOfReferenceUID), + PositionReferenceIndicator(DCM_PositionReferenceIndicator), + Manufacturer(DCM_Manufacturer), + InstitutionName(DCM_InstitutionName), + InstitutionAddress(DCM_InstitutionAddress), + StationName(DCM_StationName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + GantryID(DCM_GantryID), + UDISequence(), + SpatialResolution(DCM_SpatialResolution), + DateOfLastCalibration(DCM_DateOfLastCalibration), + TimeOfLastCalibration(DCM_TimeOfLastCalibration), + PixelPaddingValue(DCM_PixelPaddingValue), + InstanceNumber(DCM_InstanceNumber), + PatientOrientation(DCM_PatientOrientation), + ContentDate(DCM_ContentDate), + ContentTime(DCM_ContentTime), + AcquisitionNumber(DCM_AcquisitionNumber), + AcquisitionDate(DCM_AcquisitionDate), + AcquisitionTime(DCM_AcquisitionTime), + AcquisitionDateTime(DCM_AcquisitionDateTime), + ImagesInAcquisition(DCM_ImagesInAcquisition), + ImageComments(DCM_ImageComments), + QualityControlImage(DCM_QualityControlImage), + BurnedInAnnotation(DCM_BurnedInAnnotation), + RecognizableVisualFeatures(DCM_RecognizableVisualFeatures), + LossyImageCompression(DCM_LossyImageCompression), + LossyImageCompressionRatio(DCM_LossyImageCompressionRatio), + LossyImageCompressionMethod(DCM_LossyImageCompressionMethod), + IconImageSequence(), + PresentationLUTShape(DCM_PresentationLUTShape), + IrradiationEventUID(DCM_IrradiationEventUID), + RealWorldValueMappingSequence(), + ReferencedImageSequence(), + ReferencedInstanceSequence(), + DerivationDescription(DCM_DerivationDescription), + DerivationCodeSequence(), + SourceImageSequence(), + SourceInstanceSequence(), + Rows(DCM_Rows), + Columns(DCM_Columns), + PlanarConfiguration(DCM_PlanarConfiguration), + PixelAspectRatio(DCM_PixelAspectRatio), + SmallestImagePixelValue(DCM_SmallestImagePixelValue), + LargestImagePixelValue(DCM_LargestImagePixelValue), + RedPaletteColorLookupTableDescriptor(DCM_RedPaletteColorLookupTableDescriptor), + GreenPaletteColorLookupTableDescriptor(DCM_GreenPaletteColorLookupTableDescriptor), + BluePaletteColorLookupTableDescriptor(DCM_BluePaletteColorLookupTableDescriptor), + RedPaletteColorLookupTableData(DCM_RedPaletteColorLookupTableData), + GreenPaletteColorLookupTableData(DCM_GreenPaletteColorLookupTableData), + BluePaletteColorLookupTableData(DCM_BluePaletteColorLookupTableData), + ICCProfile(DCM_ICCProfile), + ColorSpace(DCM_ColorSpace), + PixelData(DCM_PixelData), + PixelDataProviderURL(DCM_PixelDataProviderURL), + PixelPaddingRangeLimit(DCM_PixelPaddingRangeLimit), + ContrastBolusAgent(DCM_ContrastBolusAgent), + ContrastBolusAgentSequence(), + ContrastBolusRoute(DCM_ContrastBolusRoute), + ContrastBolusAdministrationRouteSequence(), + ContrastBolusVolume(DCM_ContrastBolusVolume), + ContrastBolusStartTime(DCM_ContrastBolusStartTime), + ContrastBolusStopTime(DCM_ContrastBolusStopTime), + ContrastBolusTotalDose(DCM_ContrastBolusTotalDose), + ContrastFlowRate(DCM_ContrastFlowRate), + ContrastFlowDuration(DCM_ContrastFlowDuration), + ContrastBolusIngredient(DCM_ContrastBolusIngredient), + ContrastBolusIngredientConcentration(DCM_ContrastBolusIngredientConcentration), + PreferredPlaybackSequencing(DCM_PreferredPlaybackSequencing), + FrameTime(DCM_FrameTime), + FrameTimeVector(DCM_FrameTimeVector), + StartTrim(DCM_StartTrim), + StopTrim(DCM_StopTrim), + RecommendedDisplayFrameRate(DCM_RecommendedDisplayFrameRate), + CineRate(DCM_CineRate), + FrameDelay(DCM_FrameDelay), + ImageTriggerDelay(DCM_ImageTriggerDelay), + EffectiveDuration(DCM_EffectiveDuration), + ActualFrameDuration(DCM_ActualFrameDuration), + MultiplexedAudioChannelsDescriptionCodeSequence(), + NumberOfFrames(DCM_NumberOfFrames), + FrameIncrementPointer(DCM_FrameIncrementPointer), + StereoPairsPresent(DCM_StereoPairsPresent), + DeviceSequence(), + SamplesPerPixel(DCM_SamplesPerPixel), + PhotometricInterpretation(DCM_PhotometricInterpretation), + BitsAllocated(DCM_BitsAllocated), + BitsStored(DCM_BitsStored), + HighBit(DCM_HighBit), + PixelRepresentation(DCM_PixelRepresentation), + PixelIntensityRelationship(DCM_PixelIntensityRelationship), + PixelIntensityRelationshipSign(DCM_PixelIntensityRelationshipSign), + RTImageLabel(DCM_RTImageLabel), + RTImageName(DCM_RTImageName), + RTImageDescription(DCM_RTImageDescription), + ImageType(DCM_ImageType), + ConversionType(DCM_ConversionType), + ReportedValuesOrigin(DCM_ReportedValuesOrigin), + RTImagePlane(DCM_RTImagePlane), + XRayImageReceptorTranslation(DCM_XRayImageReceptorTranslation), + XRayImageReceptorAngle(DCM_XRayImageReceptorAngle), + RTImageOrientation(DCM_RTImageOrientation), + ImagePlanePixelSpacing(DCM_ImagePlanePixelSpacing), + RTImagePosition(DCM_RTImagePosition), + RadiationMachineName(DCM_RadiationMachineName), + PrimaryDosimeterUnit(DCM_PrimaryDosimeterUnit), + RadiationMachineSAD(DCM_RadiationMachineSAD), + RadiationMachineSSD(DCM_RadiationMachineSSD), + RTImageSID(DCM_RTImageSID), + SourceToReferenceObjectDistance(DCM_SourceToReferenceObjectDistance), + ReferencedRTPlanSequence(), + ReferencedBeamNumber(DCM_ReferencedBeamNumber), + ReferencedFractionGroupNumber(DCM_ReferencedFractionGroupNumber), + FractionNumber(DCM_FractionNumber), + StartCumulativeMetersetWeight(DCM_StartCumulativeMetersetWeight), + EndCumulativeMetersetWeight(DCM_EndCumulativeMetersetWeight), + ExposureSequence(), + FluenceMapSequence(), + GantryAngle(DCM_GantryAngle), + GantryPitchAngle(DCM_GantryPitchAngle), + BeamLimitingDeviceAngle(DCM_BeamLimitingDeviceAngle), + PatientSupportAngle(DCM_PatientSupportAngle), + TableTopEccentricAxisDistance(DCM_TableTopEccentricAxisDistance), + TableTopEccentricAngle(DCM_TableTopEccentricAngle), + TableTopPitchAngle(DCM_TableTopPitchAngle), + TableTopRollAngle(DCM_TableTopRollAngle), + TableTopVerticalPosition(DCM_TableTopVerticalPosition), + TableTopLongitudinalPosition(DCM_TableTopLongitudinalPosition), + TableTopLateralPosition(DCM_TableTopLateralPosition), + IsocenterPosition(DCM_IsocenterPosition), + PatientPosition(DCM_PatientPosition), + ExposureTime(DCM_ExposureTime), + ExposureTimeInms(DCM_ExposureTimeInms), + MetersetExposure(DCM_MetersetExposure), + ModalityLUTSequence(), + RescaleIntercept(DCM_RescaleIntercept), + RescaleSlope(DCM_RescaleSlope), + RescaleType(DCM_RescaleType), + VOILUTSequence(), + WindowCenter(DCM_WindowCenter), + WindowWidth(DCM_WindowWidth), + WindowCenterWidthExplanation(DCM_WindowCenterWidthExplanation), + VOILUTFunction(DCM_VOILUTFunction), + ApprovalStatus(DCM_ApprovalStatus), + ReviewDate(DCM_ReviewDate), + ReviewTime(DCM_ReviewTime), + ReviewerName(DCM_ReviewerName), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCoercionDateTime(DCM_InstanceCoercionDateTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + RelatedGeneralSOPClassUID(DCM_RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(DCM_OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(), + ContextGroupIdentificationSequence(), + MappingResourceIdentificationSequence(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + ContributingEquipmentSequence(), + SOPInstanceStatus(DCM_SOPInstanceStatus), + SOPAuthorizationDateTime(DCM_SOPAuthorizationDateTime), + SOPAuthorizationComment(DCM_SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(DCM_AuthorizationEquipmentCertificationNumber), + MACParametersSequence(), + DigitalSignaturesSequence(), + EncryptedAttributesSequence(), + OriginalAttributesSequence(), + HL7StructuredDocumentReferenceSequence(), + LongitudinalTemporalInformationModified(DCM_LongitudinalTemporalInformationModified), + QueryRetrieveView(DCM_QueryRetrieveView), + ConversionSourceAttributesSequence(), + ContentQualification(DCM_ContentQualification), + PrivateDataElementCharacteristicsSequence(), + ReferencedSeriesSequence(), + StudiesContainingOtherReferencedInstancesSequence(), + FrameExtractionSequence() +{ + /* set initial values for a new SOP instance */ + updateAttributes(); +} + + +DRTImageIOD::DRTImageIOD(const DRTImageIOD ©) + : PatientName(copy.PatientName), + PatientID(copy.PatientID), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientBirthDate(copy.PatientBirthDate), + PatientBirthDateInAlternativeCalendar(copy.PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(copy.PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(copy.PatientAlternativeCalendar), + PatientSex(copy.PatientSex), + ReferencedPatientPhotoSequence(copy.ReferencedPatientPhotoSequence), + QualityControlSubject(copy.QualityControlSubject), + ReferencedPatientSequence(copy.ReferencedPatientSequence), + PatientBirthTime(copy.PatientBirthTime), + OtherPatientIDsSequence(copy.OtherPatientIDsSequence), + OtherPatientNames(copy.OtherPatientNames), + EthnicGroup(copy.EthnicGroup), + PatientComments(copy.PatientComments), + PatientSpeciesDescription(copy.PatientSpeciesDescription), + PatientSpeciesCodeSequence(copy.PatientSpeciesCodeSequence), + PatientBreedDescription(copy.PatientBreedDescription), + PatientBreedCodeSequence(copy.PatientBreedCodeSequence), + BreedRegistrationSequence(copy.BreedRegistrationSequence), + StrainDescription(copy.StrainDescription), + StrainNomenclature(copy.StrainNomenclature), + StrainCodeSequence(copy.StrainCodeSequence), + StrainAdditionalInformation(copy.StrainAdditionalInformation), + StrainStockSequence(copy.StrainStockSequence), + GeneticModificationsSequence(copy.GeneticModificationsSequence), + ResponsiblePerson(copy.ResponsiblePerson), + ResponsiblePersonRole(copy.ResponsiblePersonRole), + ResponsibleOrganization(copy.ResponsibleOrganization), + PatientIdentityRemoved(copy.PatientIdentityRemoved), + DeidentificationMethod(copy.DeidentificationMethod), + DeidentificationMethodCodeSequence(copy.DeidentificationMethodCodeSequence), + SourcePatientGroupIdentificationSequence(copy.SourcePatientGroupIdentificationSequence), + GroupOfPatientsIdentificationSequence(copy.GroupOfPatientsIdentificationSequence), + ClinicalTrialSponsorName(copy.ClinicalTrialSponsorName), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ClinicalTrialProtocolName(copy.ClinicalTrialProtocolName), + ClinicalTrialSiteID(copy.ClinicalTrialSiteID), + ClinicalTrialSiteName(copy.ClinicalTrialSiteName), + ClinicalTrialSubjectID(copy.ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(copy.ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(copy.ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(copy.StudyInstanceUID), + StudyDate(copy.StudyDate), + StudyTime(copy.StudyTime), + ReferringPhysicianName(copy.ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(copy.ReferringPhysicianIdentificationSequence), + ConsultingPhysicianName(copy.ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(copy.ConsultingPhysicianIdentificationSequence), + StudyID(copy.StudyID), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + StudyDescription(copy.StudyDescription), + PhysiciansOfRecord(copy.PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(copy.PhysiciansOfRecordIdentificationSequence), + NameOfPhysiciansReadingStudy(copy.NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(copy.PhysiciansReadingStudyIdentificationSequence), + RequestingServiceCodeSequence(copy.RequestingServiceCodeSequence), + ReferencedStudySequence(copy.ReferencedStudySequence), + ProcedureCodeSequence(copy.ProcedureCodeSequence), + ReasonForPerformedProcedureCodeSequence(copy.ReasonForPerformedProcedureCodeSequence), + AdmittingDiagnosesDescription(copy.AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(copy.AdmittingDiagnosesCodeSequence), + PatientAge(copy.PatientAge), + PatientSize(copy.PatientSize), + PatientWeight(copy.PatientWeight), + PatientBodyMassIndex(copy.PatientBodyMassIndex), + MeasuredAPDimension(copy.MeasuredAPDimension), + MeasuredLateralDimension(copy.MeasuredLateralDimension), + PatientSizeCodeSequence(copy.PatientSizeCodeSequence), + MedicalAlerts(copy.MedicalAlerts), + Allergies(copy.Allergies), + SmokingStatus(copy.SmokingStatus), + PregnancyStatus(copy.PregnancyStatus), + LastMenstrualDate(copy.LastMenstrualDate), + PatientState(copy.PatientState), + Occupation(copy.Occupation), + AdditionalPatientHistory(copy.AdditionalPatientHistory), + AdmissionID(copy.AdmissionID), + IssuerOfAdmissionIDSequence(copy.IssuerOfAdmissionIDSequence), + ServiceEpisodeID(copy.ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(copy.IssuerOfServiceEpisodeIDSequence), + ServiceEpisodeDescription(copy.ServiceEpisodeDescription), + PatientSexNeutered(copy.PatientSexNeutered), + ClinicalTrialTimePointID(copy.ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(copy.ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(copy.LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(copy.LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(copy.ConsentForClinicalTrialUseSequence), + Modality(copy.Modality), + SeriesInstanceUID(copy.SeriesInstanceUID), + SeriesNumber(copy.SeriesNumber), + SeriesDate(copy.SeriesDate), + SeriesTime(copy.SeriesTime), + SeriesDescription(copy.SeriesDescription), + SeriesDescriptionCodeSequence(copy.SeriesDescriptionCodeSequence), + OperatorsName(copy.OperatorsName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + ReferencedPerformedProcedureStepSequence(copy.ReferencedPerformedProcedureStepSequence), + RequestAttributesSequence(copy.RequestAttributesSequence), + PerformedProcedureStepID(copy.PerformedProcedureStepID), + PerformedProcedureStepStartDate(copy.PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(copy.PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(copy.PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(copy.PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(copy.PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(copy.PerformedProtocolCodeSequence), + CommentsOnThePerformedProcedureStep(copy.CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(copy.ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(copy.ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(copy.ClinicalTrialSeriesDescription), + FrameOfReferenceUID(copy.FrameOfReferenceUID), + PositionReferenceIndicator(copy.PositionReferenceIndicator), + Manufacturer(copy.Manufacturer), + InstitutionName(copy.InstitutionName), + InstitutionAddress(copy.InstitutionAddress), + StationName(copy.StationName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + ManufacturerModelName(copy.ManufacturerModelName), + DeviceSerialNumber(copy.DeviceSerialNumber), + SoftwareVersions(copy.SoftwareVersions), + GantryID(copy.GantryID), + UDISequence(copy.UDISequence), + SpatialResolution(copy.SpatialResolution), + DateOfLastCalibration(copy.DateOfLastCalibration), + TimeOfLastCalibration(copy.TimeOfLastCalibration), + PixelPaddingValue(copy.PixelPaddingValue), + InstanceNumber(copy.InstanceNumber), + PatientOrientation(copy.PatientOrientation), + ContentDate(copy.ContentDate), + ContentTime(copy.ContentTime), + AcquisitionNumber(copy.AcquisitionNumber), + AcquisitionDate(copy.AcquisitionDate), + AcquisitionTime(copy.AcquisitionTime), + AcquisitionDateTime(copy.AcquisitionDateTime), + ImagesInAcquisition(copy.ImagesInAcquisition), + ImageComments(copy.ImageComments), + QualityControlImage(copy.QualityControlImage), + BurnedInAnnotation(copy.BurnedInAnnotation), + RecognizableVisualFeatures(copy.RecognizableVisualFeatures), + LossyImageCompression(copy.LossyImageCompression), + LossyImageCompressionRatio(copy.LossyImageCompressionRatio), + LossyImageCompressionMethod(copy.LossyImageCompressionMethod), + IconImageSequence(copy.IconImageSequence), + PresentationLUTShape(copy.PresentationLUTShape), + IrradiationEventUID(copy.IrradiationEventUID), + RealWorldValueMappingSequence(copy.RealWorldValueMappingSequence), + ReferencedImageSequence(copy.ReferencedImageSequence), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + DerivationDescription(copy.DerivationDescription), + DerivationCodeSequence(copy.DerivationCodeSequence), + SourceImageSequence(copy.SourceImageSequence), + SourceInstanceSequence(copy.SourceInstanceSequence), + Rows(copy.Rows), + Columns(copy.Columns), + PlanarConfiguration(copy.PlanarConfiguration), + PixelAspectRatio(copy.PixelAspectRatio), + SmallestImagePixelValue(copy.SmallestImagePixelValue), + LargestImagePixelValue(copy.LargestImagePixelValue), + RedPaletteColorLookupTableDescriptor(copy.RedPaletteColorLookupTableDescriptor), + GreenPaletteColorLookupTableDescriptor(copy.GreenPaletteColorLookupTableDescriptor), + BluePaletteColorLookupTableDescriptor(copy.BluePaletteColorLookupTableDescriptor), + RedPaletteColorLookupTableData(copy.RedPaletteColorLookupTableData), + GreenPaletteColorLookupTableData(copy.GreenPaletteColorLookupTableData), + BluePaletteColorLookupTableData(copy.BluePaletteColorLookupTableData), + ICCProfile(copy.ICCProfile), + ColorSpace(copy.ColorSpace), + PixelData(copy.PixelData), + PixelDataProviderURL(copy.PixelDataProviderURL), + PixelPaddingRangeLimit(copy.PixelPaddingRangeLimit), + ContrastBolusAgent(copy.ContrastBolusAgent), + ContrastBolusAgentSequence(copy.ContrastBolusAgentSequence), + ContrastBolusRoute(copy.ContrastBolusRoute), + ContrastBolusAdministrationRouteSequence(copy.ContrastBolusAdministrationRouteSequence), + ContrastBolusVolume(copy.ContrastBolusVolume), + ContrastBolusStartTime(copy.ContrastBolusStartTime), + ContrastBolusStopTime(copy.ContrastBolusStopTime), + ContrastBolusTotalDose(copy.ContrastBolusTotalDose), + ContrastFlowRate(copy.ContrastFlowRate), + ContrastFlowDuration(copy.ContrastFlowDuration), + ContrastBolusIngredient(copy.ContrastBolusIngredient), + ContrastBolusIngredientConcentration(copy.ContrastBolusIngredientConcentration), + PreferredPlaybackSequencing(copy.PreferredPlaybackSequencing), + FrameTime(copy.FrameTime), + FrameTimeVector(copy.FrameTimeVector), + StartTrim(copy.StartTrim), + StopTrim(copy.StopTrim), + RecommendedDisplayFrameRate(copy.RecommendedDisplayFrameRate), + CineRate(copy.CineRate), + FrameDelay(copy.FrameDelay), + ImageTriggerDelay(copy.ImageTriggerDelay), + EffectiveDuration(copy.EffectiveDuration), + ActualFrameDuration(copy.ActualFrameDuration), + MultiplexedAudioChannelsDescriptionCodeSequence(copy.MultiplexedAudioChannelsDescriptionCodeSequence), + NumberOfFrames(copy.NumberOfFrames), + FrameIncrementPointer(copy.FrameIncrementPointer), + StereoPairsPresent(copy.StereoPairsPresent), + DeviceSequence(copy.DeviceSequence), + SamplesPerPixel(copy.SamplesPerPixel), + PhotometricInterpretation(copy.PhotometricInterpretation), + BitsAllocated(copy.BitsAllocated), + BitsStored(copy.BitsStored), + HighBit(copy.HighBit), + PixelRepresentation(copy.PixelRepresentation), + PixelIntensityRelationship(copy.PixelIntensityRelationship), + PixelIntensityRelationshipSign(copy.PixelIntensityRelationshipSign), + RTImageLabel(copy.RTImageLabel), + RTImageName(copy.RTImageName), + RTImageDescription(copy.RTImageDescription), + ImageType(copy.ImageType), + ConversionType(copy.ConversionType), + ReportedValuesOrigin(copy.ReportedValuesOrigin), + RTImagePlane(copy.RTImagePlane), + XRayImageReceptorTranslation(copy.XRayImageReceptorTranslation), + XRayImageReceptorAngle(copy.XRayImageReceptorAngle), + RTImageOrientation(copy.RTImageOrientation), + ImagePlanePixelSpacing(copy.ImagePlanePixelSpacing), + RTImagePosition(copy.RTImagePosition), + RadiationMachineName(copy.RadiationMachineName), + PrimaryDosimeterUnit(copy.PrimaryDosimeterUnit), + RadiationMachineSAD(copy.RadiationMachineSAD), + RadiationMachineSSD(copy.RadiationMachineSSD), + RTImageSID(copy.RTImageSID), + SourceToReferenceObjectDistance(copy.SourceToReferenceObjectDistance), + ReferencedRTPlanSequence(copy.ReferencedRTPlanSequence), + ReferencedBeamNumber(copy.ReferencedBeamNumber), + ReferencedFractionGroupNumber(copy.ReferencedFractionGroupNumber), + FractionNumber(copy.FractionNumber), + StartCumulativeMetersetWeight(copy.StartCumulativeMetersetWeight), + EndCumulativeMetersetWeight(copy.EndCumulativeMetersetWeight), + ExposureSequence(copy.ExposureSequence), + FluenceMapSequence(copy.FluenceMapSequence), + GantryAngle(copy.GantryAngle), + GantryPitchAngle(copy.GantryPitchAngle), + BeamLimitingDeviceAngle(copy.BeamLimitingDeviceAngle), + PatientSupportAngle(copy.PatientSupportAngle), + TableTopEccentricAxisDistance(copy.TableTopEccentricAxisDistance), + TableTopEccentricAngle(copy.TableTopEccentricAngle), + TableTopPitchAngle(copy.TableTopPitchAngle), + TableTopRollAngle(copy.TableTopRollAngle), + TableTopVerticalPosition(copy.TableTopVerticalPosition), + TableTopLongitudinalPosition(copy.TableTopLongitudinalPosition), + TableTopLateralPosition(copy.TableTopLateralPosition), + IsocenterPosition(copy.IsocenterPosition), + PatientPosition(copy.PatientPosition), + ExposureTime(copy.ExposureTime), + ExposureTimeInms(copy.ExposureTimeInms), + MetersetExposure(copy.MetersetExposure), + ModalityLUTSequence(copy.ModalityLUTSequence), + RescaleIntercept(copy.RescaleIntercept), + RescaleSlope(copy.RescaleSlope), + RescaleType(copy.RescaleType), + VOILUTSequence(copy.VOILUTSequence), + WindowCenter(copy.WindowCenter), + WindowWidth(copy.WindowWidth), + WindowCenterWidthExplanation(copy.WindowCenterWidthExplanation), + VOILUTFunction(copy.VOILUTFunction), + ApprovalStatus(copy.ApprovalStatus), + ReviewDate(copy.ReviewDate), + ReviewTime(copy.ReviewTime), + ReviewerName(copy.ReviewerName), + SOPClassUID(copy.SOPClassUID), + SOPInstanceUID(copy.SOPInstanceUID), + SpecificCharacterSet(copy.SpecificCharacterSet), + InstanceCreationDate(copy.InstanceCreationDate), + InstanceCreationTime(copy.InstanceCreationTime), + InstanceCoercionDateTime(copy.InstanceCoercionDateTime), + InstanceCreatorUID(copy.InstanceCreatorUID), + RelatedGeneralSOPClassUID(copy.RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(copy.OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(copy.CodingSchemeIdentificationSequence), + ContextGroupIdentificationSequence(copy.ContextGroupIdentificationSequence), + MappingResourceIdentificationSequence(copy.MappingResourceIdentificationSequence), + TimezoneOffsetFromUTC(copy.TimezoneOffsetFromUTC), + ContributingEquipmentSequence(copy.ContributingEquipmentSequence), + SOPInstanceStatus(copy.SOPInstanceStatus), + SOPAuthorizationDateTime(copy.SOPAuthorizationDateTime), + SOPAuthorizationComment(copy.SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(copy.AuthorizationEquipmentCertificationNumber), + MACParametersSequence(copy.MACParametersSequence), + DigitalSignaturesSequence(copy.DigitalSignaturesSequence), + EncryptedAttributesSequence(copy.EncryptedAttributesSequence), + OriginalAttributesSequence(copy.OriginalAttributesSequence), + HL7StructuredDocumentReferenceSequence(copy.HL7StructuredDocumentReferenceSequence), + LongitudinalTemporalInformationModified(copy.LongitudinalTemporalInformationModified), + QueryRetrieveView(copy.QueryRetrieveView), + ConversionSourceAttributesSequence(copy.ConversionSourceAttributesSequence), + ContentQualification(copy.ContentQualification), + PrivateDataElementCharacteristicsSequence(copy.PrivateDataElementCharacteristicsSequence), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudiesContainingOtherReferencedInstancesSequence(copy.StudiesContainingOtherReferencedInstancesSequence), + FrameExtractionSequence(copy.FrameExtractionSequence) +{ +} + + +DRTImageIOD::~DRTImageIOD() +{ +} + + +DRTImageIOD &DRTImageIOD::operator=(const DRTImageIOD ©) +{ + if (this != ©) + { + PatientName = copy.PatientName; + PatientID = copy.PatientID; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientBirthDate = copy.PatientBirthDate; + PatientBirthDateInAlternativeCalendar = copy.PatientBirthDateInAlternativeCalendar; + PatientDeathDateInAlternativeCalendar = copy.PatientDeathDateInAlternativeCalendar; + PatientAlternativeCalendar = copy.PatientAlternativeCalendar; + PatientSex = copy.PatientSex; + ReferencedPatientPhotoSequence = copy.ReferencedPatientPhotoSequence; + QualityControlSubject = copy.QualityControlSubject; + ReferencedPatientSequence = copy.ReferencedPatientSequence; + PatientBirthTime = copy.PatientBirthTime; + OtherPatientIDsSequence = copy.OtherPatientIDsSequence; + OtherPatientNames = copy.OtherPatientNames; + EthnicGroup = copy.EthnicGroup; + PatientComments = copy.PatientComments; + PatientSpeciesDescription = copy.PatientSpeciesDescription; + PatientSpeciesCodeSequence = copy.PatientSpeciesCodeSequence; + PatientBreedDescription = copy.PatientBreedDescription; + PatientBreedCodeSequence = copy.PatientBreedCodeSequence; + BreedRegistrationSequence = copy.BreedRegistrationSequence; + StrainDescription = copy.StrainDescription; + StrainNomenclature = copy.StrainNomenclature; + StrainCodeSequence = copy.StrainCodeSequence; + StrainAdditionalInformation = copy.StrainAdditionalInformation; + StrainStockSequence = copy.StrainStockSequence; + GeneticModificationsSequence = copy.GeneticModificationsSequence; + ResponsiblePerson = copy.ResponsiblePerson; + ResponsiblePersonRole = copy.ResponsiblePersonRole; + ResponsibleOrganization = copy.ResponsibleOrganization; + PatientIdentityRemoved = copy.PatientIdentityRemoved; + DeidentificationMethod = copy.DeidentificationMethod; + DeidentificationMethodCodeSequence = copy.DeidentificationMethodCodeSequence; + SourcePatientGroupIdentificationSequence = copy.SourcePatientGroupIdentificationSequence; + GroupOfPatientsIdentificationSequence = copy.GroupOfPatientsIdentificationSequence; + ClinicalTrialSponsorName = copy.ClinicalTrialSponsorName; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ClinicalTrialProtocolName = copy.ClinicalTrialProtocolName; + ClinicalTrialSiteID = copy.ClinicalTrialSiteID; + ClinicalTrialSiteName = copy.ClinicalTrialSiteName; + ClinicalTrialSubjectID = copy.ClinicalTrialSubjectID; + ClinicalTrialSubjectReadingID = copy.ClinicalTrialSubjectReadingID; + ClinicalTrialProtocolEthicsCommitteeName = copy.ClinicalTrialProtocolEthicsCommitteeName; + ClinicalTrialProtocolEthicsCommitteeApprovalNumber = copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + StudyInstanceUID = copy.StudyInstanceUID; + StudyDate = copy.StudyDate; + StudyTime = copy.StudyTime; + ReferringPhysicianName = copy.ReferringPhysicianName; + ReferringPhysicianIdentificationSequence = copy.ReferringPhysicianIdentificationSequence; + ConsultingPhysicianName = copy.ConsultingPhysicianName; + ConsultingPhysicianIdentificationSequence = copy.ConsultingPhysicianIdentificationSequence; + StudyID = copy.StudyID; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + StudyDescription = copy.StudyDescription; + PhysiciansOfRecord = copy.PhysiciansOfRecord; + PhysiciansOfRecordIdentificationSequence = copy.PhysiciansOfRecordIdentificationSequence; + NameOfPhysiciansReadingStudy = copy.NameOfPhysiciansReadingStudy; + PhysiciansReadingStudyIdentificationSequence = copy.PhysiciansReadingStudyIdentificationSequence; + RequestingServiceCodeSequence = copy.RequestingServiceCodeSequence; + ReferencedStudySequence = copy.ReferencedStudySequence; + ProcedureCodeSequence = copy.ProcedureCodeSequence; + ReasonForPerformedProcedureCodeSequence = copy.ReasonForPerformedProcedureCodeSequence; + AdmittingDiagnosesDescription = copy.AdmittingDiagnosesDescription; + AdmittingDiagnosesCodeSequence = copy.AdmittingDiagnosesCodeSequence; + PatientAge = copy.PatientAge; + PatientSize = copy.PatientSize; + PatientWeight = copy.PatientWeight; + PatientBodyMassIndex = copy.PatientBodyMassIndex; + MeasuredAPDimension = copy.MeasuredAPDimension; + MeasuredLateralDimension = copy.MeasuredLateralDimension; + PatientSizeCodeSequence = copy.PatientSizeCodeSequence; + MedicalAlerts = copy.MedicalAlerts; + Allergies = copy.Allergies; + SmokingStatus = copy.SmokingStatus; + PregnancyStatus = copy.PregnancyStatus; + LastMenstrualDate = copy.LastMenstrualDate; + PatientState = copy.PatientState; + Occupation = copy.Occupation; + AdditionalPatientHistory = copy.AdditionalPatientHistory; + AdmissionID = copy.AdmissionID; + IssuerOfAdmissionIDSequence = copy.IssuerOfAdmissionIDSequence; + ServiceEpisodeID = copy.ServiceEpisodeID; + IssuerOfServiceEpisodeIDSequence = copy.IssuerOfServiceEpisodeIDSequence; + ServiceEpisodeDescription = copy.ServiceEpisodeDescription; + PatientSexNeutered = copy.PatientSexNeutered; + ClinicalTrialTimePointID = copy.ClinicalTrialTimePointID; + ClinicalTrialTimePointDescription = copy.ClinicalTrialTimePointDescription; + LongitudinalTemporalOffsetFromEvent = copy.LongitudinalTemporalOffsetFromEvent; + LongitudinalTemporalEventType = copy.LongitudinalTemporalEventType; + ConsentForClinicalTrialUseSequence = copy.ConsentForClinicalTrialUseSequence; + Modality = copy.Modality; + SeriesInstanceUID = copy.SeriesInstanceUID; + SeriesNumber = copy.SeriesNumber; + SeriesDate = copy.SeriesDate; + SeriesTime = copy.SeriesTime; + SeriesDescription = copy.SeriesDescription; + SeriesDescriptionCodeSequence = copy.SeriesDescriptionCodeSequence; + OperatorsName = copy.OperatorsName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + ReferencedPerformedProcedureStepSequence = copy.ReferencedPerformedProcedureStepSequence; + RequestAttributesSequence = copy.RequestAttributesSequence; + PerformedProcedureStepID = copy.PerformedProcedureStepID; + PerformedProcedureStepStartDate = copy.PerformedProcedureStepStartDate; + PerformedProcedureStepStartTime = copy.PerformedProcedureStepStartTime; + PerformedProcedureStepEndDate = copy.PerformedProcedureStepEndDate; + PerformedProcedureStepEndTime = copy.PerformedProcedureStepEndTime; + PerformedProcedureStepDescription = copy.PerformedProcedureStepDescription; + PerformedProtocolCodeSequence = copy.PerformedProtocolCodeSequence; + CommentsOnThePerformedProcedureStep = copy.CommentsOnThePerformedProcedureStep; + ClinicalTrialCoordinatingCenterName = copy.ClinicalTrialCoordinatingCenterName; + ClinicalTrialSeriesID = copy.ClinicalTrialSeriesID; + ClinicalTrialSeriesDescription = copy.ClinicalTrialSeriesDescription; + FrameOfReferenceUID = copy.FrameOfReferenceUID; + PositionReferenceIndicator = copy.PositionReferenceIndicator; + Manufacturer = copy.Manufacturer; + InstitutionName = copy.InstitutionName; + InstitutionAddress = copy.InstitutionAddress; + StationName = copy.StationName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + ManufacturerModelName = copy.ManufacturerModelName; + DeviceSerialNumber = copy.DeviceSerialNumber; + SoftwareVersions = copy.SoftwareVersions; + GantryID = copy.GantryID; + UDISequence = copy.UDISequence; + SpatialResolution = copy.SpatialResolution; + DateOfLastCalibration = copy.DateOfLastCalibration; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + PixelPaddingValue = copy.PixelPaddingValue; + InstanceNumber = copy.InstanceNumber; + PatientOrientation = copy.PatientOrientation; + ContentDate = copy.ContentDate; + ContentTime = copy.ContentTime; + AcquisitionNumber = copy.AcquisitionNumber; + AcquisitionDate = copy.AcquisitionDate; + AcquisitionTime = copy.AcquisitionTime; + AcquisitionDateTime = copy.AcquisitionDateTime; + ImagesInAcquisition = copy.ImagesInAcquisition; + ImageComments = copy.ImageComments; + QualityControlImage = copy.QualityControlImage; + BurnedInAnnotation = copy.BurnedInAnnotation; + RecognizableVisualFeatures = copy.RecognizableVisualFeatures; + LossyImageCompression = copy.LossyImageCompression; + LossyImageCompressionRatio = copy.LossyImageCompressionRatio; + LossyImageCompressionMethod = copy.LossyImageCompressionMethod; + IconImageSequence = copy.IconImageSequence; + PresentationLUTShape = copy.PresentationLUTShape; + IrradiationEventUID = copy.IrradiationEventUID; + RealWorldValueMappingSequence = copy.RealWorldValueMappingSequence; + ReferencedImageSequence = copy.ReferencedImageSequence; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + DerivationDescription = copy.DerivationDescription; + DerivationCodeSequence = copy.DerivationCodeSequence; + SourceImageSequence = copy.SourceImageSequence; + SourceInstanceSequence = copy.SourceInstanceSequence; + Rows = copy.Rows; + Columns = copy.Columns; + PlanarConfiguration = copy.PlanarConfiguration; + PixelAspectRatio = copy.PixelAspectRatio; + SmallestImagePixelValue = copy.SmallestImagePixelValue; + LargestImagePixelValue = copy.LargestImagePixelValue; + RedPaletteColorLookupTableDescriptor = copy.RedPaletteColorLookupTableDescriptor; + GreenPaletteColorLookupTableDescriptor = copy.GreenPaletteColorLookupTableDescriptor; + BluePaletteColorLookupTableDescriptor = copy.BluePaletteColorLookupTableDescriptor; + RedPaletteColorLookupTableData = copy.RedPaletteColorLookupTableData; + GreenPaletteColorLookupTableData = copy.GreenPaletteColorLookupTableData; + BluePaletteColorLookupTableData = copy.BluePaletteColorLookupTableData; + ICCProfile = copy.ICCProfile; + ColorSpace = copy.ColorSpace; + PixelData = copy.PixelData; + PixelDataProviderURL = copy.PixelDataProviderURL; + PixelPaddingRangeLimit = copy.PixelPaddingRangeLimit; + ContrastBolusAgent = copy.ContrastBolusAgent; + ContrastBolusAgentSequence = copy.ContrastBolusAgentSequence; + ContrastBolusRoute = copy.ContrastBolusRoute; + ContrastBolusAdministrationRouteSequence = copy.ContrastBolusAdministrationRouteSequence; + ContrastBolusVolume = copy.ContrastBolusVolume; + ContrastBolusStartTime = copy.ContrastBolusStartTime; + ContrastBolusStopTime = copy.ContrastBolusStopTime; + ContrastBolusTotalDose = copy.ContrastBolusTotalDose; + ContrastFlowRate = copy.ContrastFlowRate; + ContrastFlowDuration = copy.ContrastFlowDuration; + ContrastBolusIngredient = copy.ContrastBolusIngredient; + ContrastBolusIngredientConcentration = copy.ContrastBolusIngredientConcentration; + PreferredPlaybackSequencing = copy.PreferredPlaybackSequencing; + FrameTime = copy.FrameTime; + FrameTimeVector = copy.FrameTimeVector; + StartTrim = copy.StartTrim; + StopTrim = copy.StopTrim; + RecommendedDisplayFrameRate = copy.RecommendedDisplayFrameRate; + CineRate = copy.CineRate; + FrameDelay = copy.FrameDelay; + ImageTriggerDelay = copy.ImageTriggerDelay; + EffectiveDuration = copy.EffectiveDuration; + ActualFrameDuration = copy.ActualFrameDuration; + MultiplexedAudioChannelsDescriptionCodeSequence = copy.MultiplexedAudioChannelsDescriptionCodeSequence; + NumberOfFrames = copy.NumberOfFrames; + FrameIncrementPointer = copy.FrameIncrementPointer; + StereoPairsPresent = copy.StereoPairsPresent; + DeviceSequence = copy.DeviceSequence; + SamplesPerPixel = copy.SamplesPerPixel; + PhotometricInterpretation = copy.PhotometricInterpretation; + BitsAllocated = copy.BitsAllocated; + BitsStored = copy.BitsStored; + HighBit = copy.HighBit; + PixelRepresentation = copy.PixelRepresentation; + PixelIntensityRelationship = copy.PixelIntensityRelationship; + PixelIntensityRelationshipSign = copy.PixelIntensityRelationshipSign; + RTImageLabel = copy.RTImageLabel; + RTImageName = copy.RTImageName; + RTImageDescription = copy.RTImageDescription; + ImageType = copy.ImageType; + ConversionType = copy.ConversionType; + ReportedValuesOrigin = copy.ReportedValuesOrigin; + RTImagePlane = copy.RTImagePlane; + XRayImageReceptorTranslation = copy.XRayImageReceptorTranslation; + XRayImageReceptorAngle = copy.XRayImageReceptorAngle; + RTImageOrientation = copy.RTImageOrientation; + ImagePlanePixelSpacing = copy.ImagePlanePixelSpacing; + RTImagePosition = copy.RTImagePosition; + RadiationMachineName = copy.RadiationMachineName; + PrimaryDosimeterUnit = copy.PrimaryDosimeterUnit; + RadiationMachineSAD = copy.RadiationMachineSAD; + RadiationMachineSSD = copy.RadiationMachineSSD; + RTImageSID = copy.RTImageSID; + SourceToReferenceObjectDistance = copy.SourceToReferenceObjectDistance; + ReferencedRTPlanSequence = copy.ReferencedRTPlanSequence; + ReferencedBeamNumber = copy.ReferencedBeamNumber; + ReferencedFractionGroupNumber = copy.ReferencedFractionGroupNumber; + FractionNumber = copy.FractionNumber; + StartCumulativeMetersetWeight = copy.StartCumulativeMetersetWeight; + EndCumulativeMetersetWeight = copy.EndCumulativeMetersetWeight; + ExposureSequence = copy.ExposureSequence; + FluenceMapSequence = copy.FluenceMapSequence; + GantryAngle = copy.GantryAngle; + GantryPitchAngle = copy.GantryPitchAngle; + BeamLimitingDeviceAngle = copy.BeamLimitingDeviceAngle; + PatientSupportAngle = copy.PatientSupportAngle; + TableTopEccentricAxisDistance = copy.TableTopEccentricAxisDistance; + TableTopEccentricAngle = copy.TableTopEccentricAngle; + TableTopPitchAngle = copy.TableTopPitchAngle; + TableTopRollAngle = copy.TableTopRollAngle; + TableTopVerticalPosition = copy.TableTopVerticalPosition; + TableTopLongitudinalPosition = copy.TableTopLongitudinalPosition; + TableTopLateralPosition = copy.TableTopLateralPosition; + IsocenterPosition = copy.IsocenterPosition; + PatientPosition = copy.PatientPosition; + ExposureTime = copy.ExposureTime; + ExposureTimeInms = copy.ExposureTimeInms; + MetersetExposure = copy.MetersetExposure; + ModalityLUTSequence = copy.ModalityLUTSequence; + RescaleIntercept = copy.RescaleIntercept; + RescaleSlope = copy.RescaleSlope; + RescaleType = copy.RescaleType; + VOILUTSequence = copy.VOILUTSequence; + WindowCenter = copy.WindowCenter; + WindowWidth = copy.WindowWidth; + WindowCenterWidthExplanation = copy.WindowCenterWidthExplanation; + VOILUTFunction = copy.VOILUTFunction; + ApprovalStatus = copy.ApprovalStatus; + ReviewDate = copy.ReviewDate; + ReviewTime = copy.ReviewTime; + ReviewerName = copy.ReviewerName; + SOPClassUID = copy.SOPClassUID; + SOPInstanceUID = copy.SOPInstanceUID; + SpecificCharacterSet = copy.SpecificCharacterSet; + InstanceCreationDate = copy.InstanceCreationDate; + InstanceCreationTime = copy.InstanceCreationTime; + InstanceCoercionDateTime = copy.InstanceCoercionDateTime; + InstanceCreatorUID = copy.InstanceCreatorUID; + RelatedGeneralSOPClassUID = copy.RelatedGeneralSOPClassUID; + OriginalSpecializedSOPClassUID = copy.OriginalSpecializedSOPClassUID; + CodingSchemeIdentificationSequence = copy.CodingSchemeIdentificationSequence; + ContextGroupIdentificationSequence = copy.ContextGroupIdentificationSequence; + MappingResourceIdentificationSequence = copy.MappingResourceIdentificationSequence; + TimezoneOffsetFromUTC = copy.TimezoneOffsetFromUTC; + ContributingEquipmentSequence = copy.ContributingEquipmentSequence; + SOPInstanceStatus = copy.SOPInstanceStatus; + SOPAuthorizationDateTime = copy.SOPAuthorizationDateTime; + SOPAuthorizationComment = copy.SOPAuthorizationComment; + AuthorizationEquipmentCertificationNumber = copy.AuthorizationEquipmentCertificationNumber; + MACParametersSequence = copy.MACParametersSequence; + DigitalSignaturesSequence = copy.DigitalSignaturesSequence; + EncryptedAttributesSequence = copy.EncryptedAttributesSequence; + OriginalAttributesSequence = copy.OriginalAttributesSequence; + HL7StructuredDocumentReferenceSequence = copy.HL7StructuredDocumentReferenceSequence; + LongitudinalTemporalInformationModified = copy.LongitudinalTemporalInformationModified; + QueryRetrieveView = copy.QueryRetrieveView; + ConversionSourceAttributesSequence = copy.ConversionSourceAttributesSequence; + ContentQualification = copy.ContentQualification; + PrivateDataElementCharacteristicsSequence = copy.PrivateDataElementCharacteristicsSequence; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudiesContainingOtherReferencedInstancesSequence = copy.StudiesContainingOtherReferencedInstancesSequence; + FrameExtractionSequence = copy.FrameExtractionSequence; + } + return *this; +} + + +void DRTImageIOD::clear() +{ + /* clear all DICOM attributes */ + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + PatientBirthDate.clear(); + PatientBirthDateInAlternativeCalendar.clear(); + PatientDeathDateInAlternativeCalendar.clear(); + PatientAlternativeCalendar.clear(); + PatientSex.clear(); + ReferencedPatientPhotoSequence.clear(); + QualityControlSubject.clear(); + ReferencedPatientSequence.clear(); + PatientBirthTime.clear(); + OtherPatientIDsSequence.clear(); + OtherPatientNames.clear(); + EthnicGroup.clear(); + PatientComments.clear(); + PatientSpeciesDescription.clear(); + PatientSpeciesCodeSequence.clear(); + PatientBreedDescription.clear(); + PatientBreedCodeSequence.clear(); + BreedRegistrationSequence.clear(); + StrainDescription.clear(); + StrainNomenclature.clear(); + StrainCodeSequence.clear(); + StrainAdditionalInformation.clear(); + StrainStockSequence.clear(); + GeneticModificationsSequence.clear(); + ResponsiblePerson.clear(); + ResponsiblePersonRole.clear(); + ResponsibleOrganization.clear(); + PatientIdentityRemoved.clear(); + DeidentificationMethod.clear(); + DeidentificationMethodCodeSequence.clear(); + SourcePatientGroupIdentificationSequence.clear(); + GroupOfPatientsIdentificationSequence.clear(); + ClinicalTrialSponsorName.clear(); + ClinicalTrialProtocolID.clear(); + ClinicalTrialProtocolName.clear(); + ClinicalTrialSiteID.clear(); + ClinicalTrialSiteName.clear(); + ClinicalTrialSubjectID.clear(); + ClinicalTrialSubjectReadingID.clear(); + ClinicalTrialProtocolEthicsCommitteeName.clear(); + ClinicalTrialProtocolEthicsCommitteeApprovalNumber.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + ReferringPhysicianIdentificationSequence.clear(); + ConsultingPhysicianName.clear(); + ConsultingPhysicianIdentificationSequence.clear(); + StudyID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyDescription.clear(); + PhysiciansOfRecord.clear(); + PhysiciansOfRecordIdentificationSequence.clear(); + NameOfPhysiciansReadingStudy.clear(); + PhysiciansReadingStudyIdentificationSequence.clear(); + RequestingServiceCodeSequence.clear(); + ReferencedStudySequence.clear(); + ProcedureCodeSequence.clear(); + ReasonForPerformedProcedureCodeSequence.clear(); + AdmittingDiagnosesDescription.clear(); + AdmittingDiagnosesCodeSequence.clear(); + PatientAge.clear(); + PatientSize.clear(); + PatientWeight.clear(); + PatientBodyMassIndex.clear(); + MeasuredAPDimension.clear(); + MeasuredLateralDimension.clear(); + PatientSizeCodeSequence.clear(); + MedicalAlerts.clear(); + Allergies.clear(); + SmokingStatus.clear(); + PregnancyStatus.clear(); + LastMenstrualDate.clear(); + PatientState.clear(); + Occupation.clear(); + AdditionalPatientHistory.clear(); + AdmissionID.clear(); + IssuerOfAdmissionIDSequence.clear(); + ServiceEpisodeID.clear(); + IssuerOfServiceEpisodeIDSequence.clear(); + ServiceEpisodeDescription.clear(); + PatientSexNeutered.clear(); + ClinicalTrialTimePointID.clear(); + ClinicalTrialTimePointDescription.clear(); + LongitudinalTemporalOffsetFromEvent.clear(); + LongitudinalTemporalEventType.clear(); + ConsentForClinicalTrialUseSequence.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + SeriesDescriptionCodeSequence.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ReferencedPerformedProcedureStepSequence.clear(); + RequestAttributesSequence.clear(); + PerformedProcedureStepID.clear(); + PerformedProcedureStepStartDate.clear(); + PerformedProcedureStepStartTime.clear(); + PerformedProcedureStepEndDate.clear(); + PerformedProcedureStepEndTime.clear(); + PerformedProcedureStepDescription.clear(); + PerformedProtocolCodeSequence.clear(); + CommentsOnThePerformedProcedureStep.clear(); + ClinicalTrialCoordinatingCenterName.clear(); + ClinicalTrialSeriesID.clear(); + ClinicalTrialSeriesDescription.clear(); + FrameOfReferenceUID.clear(); + PositionReferenceIndicator.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + GantryID.clear(); + UDISequence.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + PixelPaddingValue.clear(); + InstanceNumber.clear(); + PatientOrientation.clear(); + ContentDate.clear(); + ContentTime.clear(); + ImageType.clear(); + AcquisitionNumber.clear(); + AcquisitionDate.clear(); + AcquisitionTime.clear(); + AcquisitionDateTime.clear(); + ImagesInAcquisition.clear(); + ImageComments.clear(); + QualityControlImage.clear(); + BurnedInAnnotation.clear(); + RecognizableVisualFeatures.clear(); + LossyImageCompression.clear(); + LossyImageCompressionRatio.clear(); + LossyImageCompressionMethod.clear(); + IconImageSequence.clear(); + PresentationLUTShape.clear(); + IrradiationEventUID.clear(); + RealWorldValueMappingSequence.clear(); + ReferencedImageSequence.clear(); + ReferencedInstanceSequence.clear(); + DerivationDescription.clear(); + DerivationCodeSequence.clear(); + SourceImageSequence.clear(); + SourceInstanceSequence.clear(); + SamplesPerPixel.clear(); + PhotometricInterpretation.clear(); + Rows.clear(); + Columns.clear(); + BitsAllocated.clear(); + BitsStored.clear(); + HighBit.clear(); + PixelRepresentation.clear(); + PlanarConfiguration.clear(); + PixelAspectRatio.clear(); + SmallestImagePixelValue.clear(); + LargestImagePixelValue.clear(); + RedPaletteColorLookupTableDescriptor.clear(); + GreenPaletteColorLookupTableDescriptor.clear(); + BluePaletteColorLookupTableDescriptor.clear(); + RedPaletteColorLookupTableData.clear(); + GreenPaletteColorLookupTableData.clear(); + BluePaletteColorLookupTableData.clear(); + ICCProfile.clear(); + ColorSpace.clear(); + PixelData.clear(); + PixelDataProviderURL.clear(); + PixelPaddingRangeLimit.clear(); + ContrastBolusAgent.clear(); + ContrastBolusAgentSequence.clear(); + ContrastBolusRoute.clear(); + ContrastBolusAdministrationRouteSequence.clear(); + ContrastBolusVolume.clear(); + ContrastBolusStartTime.clear(); + ContrastBolusStopTime.clear(); + ContrastBolusTotalDose.clear(); + ContrastFlowRate.clear(); + ContrastFlowDuration.clear(); + ContrastBolusIngredient.clear(); + ContrastBolusIngredientConcentration.clear(); + PreferredPlaybackSequencing.clear(); + FrameTime.clear(); + FrameTimeVector.clear(); + StartTrim.clear(); + StopTrim.clear(); + RecommendedDisplayFrameRate.clear(); + CineRate.clear(); + FrameDelay.clear(); + ImageTriggerDelay.clear(); + EffectiveDuration.clear(); + ActualFrameDuration.clear(); + MultiplexedAudioChannelsDescriptionCodeSequence.clear(); + NumberOfFrames.clear(); + FrameIncrementPointer.clear(); + StereoPairsPresent.clear(); + DeviceSequence.clear(); + PixelIntensityRelationship.clear(); + PixelIntensityRelationshipSign.clear(); + RTImageLabel.clear(); + RTImageName.clear(); + RTImageDescription.clear(); + ConversionType.clear(); + ReportedValuesOrigin.clear(); + RTImagePlane.clear(); + XRayImageReceptorTranslation.clear(); + XRayImageReceptorAngle.clear(); + RTImageOrientation.clear(); + ImagePlanePixelSpacing.clear(); + RTImagePosition.clear(); + RadiationMachineName.clear(); + PrimaryDosimeterUnit.clear(); + RadiationMachineSAD.clear(); + RadiationMachineSSD.clear(); + RTImageSID.clear(); + SourceToReferenceObjectDistance.clear(); + ReferencedRTPlanSequence.clear(); + ReferencedBeamNumber.clear(); + ReferencedFractionGroupNumber.clear(); + FractionNumber.clear(); + StartCumulativeMetersetWeight.clear(); + EndCumulativeMetersetWeight.clear(); + ExposureSequence.clear(); + FluenceMapSequence.clear(); + GantryAngle.clear(); + GantryPitchAngle.clear(); + BeamLimitingDeviceAngle.clear(); + PatientSupportAngle.clear(); + TableTopEccentricAxisDistance.clear(); + TableTopEccentricAngle.clear(); + TableTopPitchAngle.clear(); + TableTopRollAngle.clear(); + TableTopVerticalPosition.clear(); + TableTopLongitudinalPosition.clear(); + TableTopLateralPosition.clear(); + IsocenterPosition.clear(); + PatientPosition.clear(); + ExposureTime.clear(); + ExposureTimeInms.clear(); + MetersetExposure.clear(); + ModalityLUTSequence.clear(); + RescaleIntercept.clear(); + RescaleSlope.clear(); + RescaleType.clear(); + VOILUTSequence.clear(); + WindowCenter.clear(); + WindowWidth.clear(); + WindowCenterWidthExplanation.clear(); + VOILUTFunction.clear(); + ApprovalStatus.clear(); + ReviewDate.clear(); + ReviewTime.clear(); + ReviewerName.clear(); + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCoercionDateTime.clear(); + InstanceCreatorUID.clear(); + RelatedGeneralSOPClassUID.clear(); + OriginalSpecializedSOPClassUID.clear(); + CodingSchemeIdentificationSequence.clear(); + ContextGroupIdentificationSequence.clear(); + MappingResourceIdentificationSequence.clear(); + TimezoneOffsetFromUTC.clear(); + ContributingEquipmentSequence.clear(); + SOPInstanceStatus.clear(); + SOPAuthorizationDateTime.clear(); + SOPAuthorizationComment.clear(); + AuthorizationEquipmentCertificationNumber.clear(); + MACParametersSequence.clear(); + DigitalSignaturesSequence.clear(); + EncryptedAttributesSequence.clear(); + OriginalAttributesSequence.clear(); + HL7StructuredDocumentReferenceSequence.clear(); + LongitudinalTemporalInformationModified.clear(); + QueryRetrieveView.clear(); + ConversionSourceAttributesSequence.clear(); + ContentQualification.clear(); + PrivateDataElementCharacteristicsSequence.clear(); + ReferencedSeriesSequence.clear(); + StudiesContainingOtherReferencedInstancesSequence.clear(); + FrameExtractionSequence.clear(); +} + + +OFBool DRTImageIOD::isValid() +{ + /* tbd: check whether object is valid */ + return OFTrue; +} + + +OFCondition DRTImageIOD::checkDatasetForReading(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* check SOP class UID */ + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + OFString tmpString; + getStringValueFromElement(sopClassUID, tmpString); + if (tmpString != UID_RTImageStorage) + { + DCMRT_ERROR("Invalid value for attribute SOPClassUID (0008,0016)"); + result = RT_EC_InvalidValue; + } + } + return result; +} + + +void DRTImageIOD::updateAttributes() +{ + SOPClassUID.putString(UID_RTImageStorage); +} + + +OFCondition DRTImageIOD::read(DcmItem &dataset) +{ + /* re-initialize object */ + clear(); + /* check SOP class UID first */ + OFCondition result = checkDatasetForReading(dataset); + /* read data from PatientIE, StudyIE, SeriesIE */ + if (result.good()) + result = readSeriesData(dataset); + if (result.good()) + { + // --- FrameOfReferenceModule (U) --- + if (dataset.tagExists(DCM_FrameOfReferenceUID) || + dataset.tagExists(DCM_PositionReferenceIndicator)) + { + getAndCheckElementFromDataset(dataset, FrameOfReferenceUID, "1", "1", "FrameOfReferenceModule"); + getAndCheckElementFromDataset(dataset, PositionReferenceIndicator, "1", "2", "FrameOfReferenceModule"); + } + + // --- GeneralEquipmentModule (M) --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionAddress, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, StationName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionalDepartmentName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, GantryID, "1", "3", "GeneralEquipmentModule"); + UDISequence.read(dataset, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SpatialResolution, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DateOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, TimeOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingValue, "1", "1C", "GeneralEquipmentModule"); + + // --- GeneralImageModule (M) --- + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "2", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, PatientOrientation, "2", "2C", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, ContentDate, "1", "2C", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, ContentTime, "1", "2C", "GeneralImageModule"); + // getAndCheckElementFromDataset(dataset, ImageType, "2-n", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionNumber, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionDate, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionTime, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, AcquisitionDateTime, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, ImagesInAcquisition, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, ImageComments, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, QualityControlImage, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, BurnedInAnnotation, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, RecognizableVisualFeatures, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, LossyImageCompression, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, LossyImageCompressionRatio, "1-n", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, LossyImageCompressionMethod, "1-n", "3", "GeneralImageModule"); + IconImageSequence.read(dataset, "1-n", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, PresentationLUTShape, "1", "3", "GeneralImageModule"); + getAndCheckElementFromDataset(dataset, IrradiationEventUID, "1-n", "3", "GeneralImageModule"); + RealWorldValueMappingSequence.read(dataset, "1-n", "3", "GeneralImageModule"); + + // --- GeneralReferenceModule (U) --- + ReferencedImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + ReferencedInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + getAndCheckElementFromDataset(dataset, DerivationDescription, "1", "3", "GeneralReferenceModule"); + DerivationCodeSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + + // --- ImagePixelModule (M) --- + // getAndCheckElementFromDataset(dataset, SamplesPerPixel, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, PhotometricInterpretation, "1", "1", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, Rows, "1", "1", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, Columns, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, BitsAllocated, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, BitsStored, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, HighBit, "1", "1", "ImagePixelModule"); + // getAndCheckElementFromDataset(dataset, PixelRepresentation, "1", "1", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PlanarConfiguration, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelAspectRatio, "2", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, SmallestImagePixelValue, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, LargestImagePixelValue, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, RedPaletteColorLookupTableDescriptor, "3", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, GreenPaletteColorLookupTableDescriptor, "3", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, BluePaletteColorLookupTableDescriptor, "3", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, RedPaletteColorLookupTableData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, GreenPaletteColorLookupTableData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, BluePaletteColorLookupTableData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, ICCProfile, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, ColorSpace, "1", "3", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelData, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelDataProviderURL, "1", "1C", "ImagePixelModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingRangeLimit, "1", "1C", "ImagePixelModule"); + + // --- ContrastBolusModule (C) --- + if (dataset.tagExists(DCM_ContrastBolusAgent)) + { + getAndCheckElementFromDataset(dataset, ContrastBolusAgent, "1", "2", "ContrastBolusModule"); + ContrastBolusAgentSequence.read(dataset, "1-n", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastBolusRoute, "1", "3", "ContrastBolusModule"); + ContrastBolusAdministrationRouteSequence.read(dataset, "1-n", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastBolusVolume, "1", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastBolusStartTime, "1", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastBolusStopTime, "1", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastBolusTotalDose, "1", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastFlowRate, "1-n", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastFlowDuration, "1-n", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastBolusIngredient, "1", "3", "ContrastBolusModule"); + getAndCheckElementFromDataset(dataset, ContrastBolusIngredientConcentration, "1", "3", "ContrastBolusModule"); + } + + // --- CineModule (C) --- + getAndCheckElementFromDataset(dataset, PreferredPlaybackSequencing, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, FrameTime, "1", "1C", "CineModule"); + getAndCheckElementFromDataset(dataset, FrameTimeVector, "1-n", "1C", "CineModule"); + getAndCheckElementFromDataset(dataset, StartTrim, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, StopTrim, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, RecommendedDisplayFrameRate, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, CineRate, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, FrameDelay, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, ImageTriggerDelay, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, EffectiveDuration, "1", "3", "CineModule"); + getAndCheckElementFromDataset(dataset, ActualFrameDuration, "1", "3", "CineModule"); + MultiplexedAudioChannelsDescriptionCodeSequence.read(dataset, "1-n", "2C", "CineModule"); + + // --- MultiFrameModule (C) --- + if (dataset.tagExists(DCM_NumberOfFrames) || + dataset.tagExists(DCM_FrameIncrementPointer)) + { + getAndCheckElementFromDataset(dataset, NumberOfFrames, "1", "1", "MultiFrameModule"); + getAndCheckElementFromDataset(dataset, FrameIncrementPointer, "1-n", "1", "MultiFrameModule"); + getAndCheckElementFromDataset(dataset, StereoPairsPresent, "1", "3", "MultiFrameModule"); + } + + // --- DeviceModule (U) --- + if (dataset.tagExists(DCM_DeviceSequence)) + { + DeviceSequence.read(dataset, "1-n", "1", "DeviceModule"); + } + + // --- RTImageModule (M) --- + getAndCheckElementFromDataset(dataset, SamplesPerPixel, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, PhotometricInterpretation, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, BitsAllocated, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, BitsStored, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, HighBit, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, PixelRepresentation, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, PixelIntensityRelationship, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, PixelIntensityRelationshipSign, "1", "1C", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RTImageLabel, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RTImageName, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RTImageDescription, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ImageType, "2-n", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ConversionType, "1", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ReportedValuesOrigin, "1", "2C", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RTImagePlane, "1", "1", "RTImageModule"); + getAndCheckElementFromDataset(dataset, XRayImageReceptorTranslation, "3", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, XRayImageReceptorAngle, "1", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RTImageOrientation, "6", "2C", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ImagePlanePixelSpacing, "2", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RTImagePosition, "2", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RadiationMachineName, "1", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, PrimaryDosimeterUnit, "1", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RadiationMachineSAD, "1", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RadiationMachineSSD, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, RTImageSID, "1", "2", "RTImageModule"); + getAndCheckElementFromDataset(dataset, SourceToReferenceObjectDistance, "1", "3", "RTImageModule"); + ReferencedRTPlanSequence.read(dataset, "1-n", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ReferencedBeamNumber, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ReferencedFractionGroupNumber, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, FractionNumber, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, StartCumulativeMetersetWeight, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, EndCumulativeMetersetWeight, "1", "3", "RTImageModule"); + ExposureSequence.read(dataset, "1-n", "3", "RTImageModule"); + FluenceMapSequence.read(dataset, "1-n", "1C", "RTImageModule"); + getAndCheckElementFromDataset(dataset, GantryAngle, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, GantryPitchAngle, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, BeamLimitingDeviceAngle, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, PatientSupportAngle, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, TableTopEccentricAxisDistance, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, TableTopEccentricAngle, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, TableTopPitchAngle, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, TableTopRollAngle, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, TableTopVerticalPosition, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, TableTopLongitudinalPosition, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, TableTopLateralPosition, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, IsocenterPosition, "3", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, PatientPosition, "1", "1C", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ExposureTime, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, ExposureTimeInms, "1", "3", "RTImageModule"); + getAndCheckElementFromDataset(dataset, MetersetExposure, "1", "3", "RTImageModule"); + + // --- ModalityLUTModule (U) --- + ModalityLUTSequence.read(dataset, "1-n", "1C", "ModalityLUTModule"); + getAndCheckElementFromDataset(dataset, RescaleIntercept, "1", "1C", "ModalityLUTModule"); + getAndCheckElementFromDataset(dataset, RescaleSlope, "1", "1C", "ModalityLUTModule"); + getAndCheckElementFromDataset(dataset, RescaleType, "1", "1C", "ModalityLUTModule"); + + // --- VOILUTModule (U) --- + VOILUTSequence.read(dataset, "1-n", "1C", "VOILUTModule"); + getAndCheckElementFromDataset(dataset, WindowCenter, "1-n", "1C", "VOILUTModule"); + getAndCheckElementFromDataset(dataset, WindowWidth, "1-n", "1C", "VOILUTModule"); + getAndCheckElementFromDataset(dataset, WindowCenterWidthExplanation, "1-n", "3", "VOILUTModule"); + getAndCheckElementFromDataset(dataset, VOILUTFunction, "1", "3", "VOILUTModule"); + + // --- ApprovalModule (U) --- + if (dataset.tagExists(DCM_ApprovalStatus)) + { + getAndCheckElementFromDataset(dataset, ApprovalStatus, "1", "1", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewDate, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewTime, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewerName, "1", "2C", "ApprovalModule"); + } + + // --- SOPCommonModule (M) --- + getAndCheckElementFromDataset(dataset, SOPClassUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCoercionDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, RelatedGeneralSOPClassUID, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, OriginalSpecializedSOPClassUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + ContextGroupIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + MappingResourceIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + ContributingEquipmentSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceStatus, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationComment, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, AuthorizationEquipmentCertificationNumber, "1", "3", "SOPCommonModule"); + MACParametersSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + DigitalSignaturesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + EncryptedAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + OriginalAttributesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + HL7StructuredDocumentReferenceSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalInformationModified, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, QueryRetrieveView, "1", "1C", "SOPCommonModule"); + ConversionSourceAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, ContentQualification, "1", "3", "SOPCommonModule"); + PrivateDataElementCharacteristicsSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + ReferencedSeriesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + StudiesContainingOtherReferencedInstancesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + + // --- FrameExtractionModule (C) --- + if (dataset.tagExists(DCM_FrameExtractionSequence)) + { + FrameExtractionSequence.read(dataset, "1-n", "1", "FrameExtractionModule"); + } + } + return result; +} + + +OFCondition DRTImageIOD::readPatientData(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + + // --- PatientModule (M) --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + IssuerOfPatientIDQualifiersSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientDeathDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientAlternativeCalendar, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + ReferencedPatientPhotoSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, QualityControlSubject, "1", "3", "PatientModule"); + ReferencedPatientSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthTime, "1", "3", "PatientModule"); + OtherPatientIDsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, OtherPatientNames, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, EthnicGroup, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientComments, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSpeciesDescription, "1", "1C", "PatientModule"); + PatientSpeciesCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBreedDescription, "1", "2C", "PatientModule"); + PatientBreedCodeSequence.read(dataset, "1-n", "2C", "PatientModule"); + BreedRegistrationSequence.read(dataset, "1-n", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainDescription, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainNomenclature, "1", "3", "PatientModule"); + StrainCodeSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainAdditionalInformation, "1", "3", "PatientModule"); + StrainStockSequence.read(dataset, "1-n", "3", "PatientModule"); + GeneticModificationsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePerson, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePersonRole, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsibleOrganization, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientIdentityRemoved, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, DeidentificationMethod, "1-n", "1C", "PatientModule"); + DeidentificationMethodCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + SourcePatientGroupIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + GroupOfPatientsIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialSponsorName) || + dataset.tagExists(DCM_ClinicalTrialProtocolID) || + dataset.tagExists(DCM_ClinicalTrialProtocolName) || + dataset.tagExists(DCM_ClinicalTrialSiteID) || + dataset.tagExists(DCM_ClinicalTrialSiteName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialSponsorName, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolID, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteID, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectReadingID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeName, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeApprovalNumber, "1", "3", "ClinicalTrialSubjectModule"); + } + return result; +} + + +OFCondition DRTImageIOD::readStudyData(DcmItem &dataset) +{ + /* read data from PatientIE */ + OFCondition result = readPatientData(dataset); + if (result.good()) + { + // --- GeneralStudyModule (M) --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + ReferringPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ConsultingPhysicianName, "1-n", "3", "GeneralStudyModule"); + ConsultingPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + IssuerOfAccessionNumberSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, PhysiciansOfRecord, "1-n", "3", "GeneralStudyModule"); + PhysiciansOfRecordIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, NameOfPhysiciansReadingStudy, "1-n", "3", "GeneralStudyModule"); + PhysiciansReadingStudyIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + RequestingServiceCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReferencedStudySequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReasonForPerformedProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + getAndCheckElementFromDataset(dataset, AdmittingDiagnosesDescription, "1-n", "3", "PatientStudyModule"); + AdmittingDiagnosesCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientAge, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSize, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientWeight, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientBodyMassIndex, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredAPDimension, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredLateralDimension, "1", "3", "PatientStudyModule"); + PatientSizeCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MedicalAlerts, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Allergies, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, SmokingStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PregnancyStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, LastMenstrualDate, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientState, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Occupation, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdditionalPatientHistory, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdmissionID, "1", "3", "PatientStudyModule"); + IssuerOfAdmissionIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeID, "1", "3", "PatientStudyModule"); + IssuerOfServiceEpisodeIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeDescription, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSexNeutered, "1", "2C", "PatientStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialTimePointID)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointID, "1", "2", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointDescription, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalOffsetFromEvent, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalEventType, "1", "1C", "ClinicalTrialStudyModule"); + ConsentForClinicalTrialUseSequence.read(dataset, "1-n", "3", "ClinicalTrialStudyModule"); + } + } + return result; +} + + +OFCondition DRTImageIOD::readSeriesData(DcmItem &dataset) +{ + /* read data from PatientIE, StudyIE */ + OFCondition result = readStudyData(dataset); + if (result.good()) + { + // --- RTSeriesModule (M) --- + getAndCheckElementFromDataset(dataset, Modality, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "2", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "RTSeriesModule"); + SeriesDescriptionCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, OperatorsName, "1-n", "2", "RTSeriesModule"); + OperatorIdentificationSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + ReferencedPerformedProcedureStepSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + RequestAttributesSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepID, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepDescription, "1", "3", "RTSeriesModule"); + PerformedProtocolCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, CommentsOnThePerformedProcedureStep, "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialCoordinatingCenterName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialCoordinatingCenterName, "1", "2", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesID, "1", "3", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesDescription, "1", "3", "ClinicalTrialSeriesModule"); + } + } + return result; +} + + +OFCondition DRTImageIOD::write(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* only write valid objects */ + if (isValid()) + { + /* update various DICOM attributes */ + updateAttributes(); + + // --- PatientModule (M) --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBirthDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientDeathDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientAlternativeCalendar), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + if (result.good()) result = ReferencedPatientPhotoSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlSubject), "1", "3", "PatientModule"); + if (result.good()) result = ReferencedPatientSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmTime(PatientBirthTime), "1", "3", "PatientModule"); + if (result.good()) result = OtherPatientIDsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(OtherPatientNames), "1-n", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmShortString(EthnicGroup), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongText(PatientComments), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientSpeciesDescription), "1", "1C", "PatientModule"); + if (result.good()) result = PatientSpeciesCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBreedDescription), "1", "2C", "PatientModule"); + if (result.good()) result = PatientBreedCodeSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + if (result.good()) result = BreedRegistrationSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedCharacters(StrainDescription), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(StrainNomenclature), "1", "3", "PatientModule"); + if (result.good()) result = StrainCodeSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedText(StrainAdditionalInformation), "1", "3", "PatientModule"); + if (result.good()) result = StrainStockSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GeneticModificationsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(ResponsiblePerson), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(ResponsiblePersonRole), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(ResponsibleOrganization), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientIdentityRemoved), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(DeidentificationMethod), "1-n", "1C", "PatientModule"); + if (result.good()) result = DeidentificationMethodCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + if (result.good()) result = SourcePatientGroupIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GroupOfPatientsIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (isClinicalTrialSubjectModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSponsorName), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolID), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteID), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectReadingID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeName), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeApprovalNumber), "1", "3", "ClinicalTrialSubjectModule"); + } + + // --- GeneralStudyModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + if (result.good()) result = ReferringPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ConsultingPhysicianName), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = ConsultingPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(PhysiciansOfRecord), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansOfRecordIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(NameOfPhysiciansReadingStudy), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansReadingStudyIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = RequestingServiceCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReferencedStudySequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReasonForPerformedProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + if (isPatientStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(AdmittingDiagnosesDescription), "1-n", "3", "PatientStudyModule"); + if (result.good()) result = AdmittingDiagnosesCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmAgeString(PatientAge), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSize), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientWeight), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientBodyMassIndex), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredAPDimension), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredLateralDimension), "1", "3", "PatientStudyModule"); + if (result.good()) result = PatientSizeCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(MedicalAlerts), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(Allergies), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(SmokingStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PregnancyStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDate(LastMenstrualDate), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientState), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(Occupation), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongText(AdditionalPatientHistory), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(AdmissionID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfAdmissionIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfServiceEpisodeIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeDescription), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSexNeutered), "1", "2C", "PatientStudyModule"); + } + + // --- ClinicalTrialStudyModule (U) --- + if (isClinicalTrialStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialTimePointID), "1", "2", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmShortText(ClinicalTrialTimePointDescription), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(LongitudinalTemporalOffsetFromEvent), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalEventType), "1", "1C", "ClinicalTrialStudyModule"); + if (result.good()) result = ConsentForClinicalTrialUseSequence.write(dataset, "1-n" ,"3", "ClinicalTrialStudyModule"); + } + + // --- RTSeriesModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "2", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = SeriesDescriptionCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmPersonName(OperatorsName), "1-n", "2", "RTSeriesModule"); + if (result.good()) result = OperatorIdentificationSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = ReferencedPerformedProcedureStepSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = RequestAttributesSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortString(PerformedProcedureStepID), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepStartDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepStartTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepEndDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepEndTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(PerformedProcedureStepDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = PerformedProtocolCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortText(CommentsOnThePerformedProcedureStep), "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (isClinicalTrialSeriesModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialCoordinatingCenterName), "1", "2", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesID), "1", "3", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesDescription), "1", "3", "ClinicalTrialSeriesModule"); + } + + // --- FrameOfReferenceModule (U) --- + if (isFrameOfReferenceModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmUniqueIdentifier(FrameOfReferenceUID), "1", "1", "FrameOfReferenceModule"); + addElementToDataset(result, dataset, new DcmLongString(PositionReferenceIndicator), "1", "2", "FrameOfReferenceModule"); + } + + // --- GeneralEquipmentModule (M) --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortText(InstitutionAddress), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortString(StationName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionalDepartmentName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(GantryID), "1", "3", "GeneralEquipmentModule"); + if (result.good()) result = UDISequence.write(dataset, "1-n" ,"3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SpatialResolution), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDate(DateOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmTime(TimeOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingValue), "1", "1C", "GeneralEquipmentModule"); + + // --- GeneralImageModule (M) --- + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "2", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientOrientation), "2", "2C", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmDate(ContentDate), "1", "2C", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmTime(ContentTime), "1", "2C", "GeneralImageModule"); + // addElementToDataset(result, dataset, new DcmCodeString(ImageType), "2-n", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(AcquisitionNumber), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmDate(AcquisitionDate), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmTime(AcquisitionTime), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmDateTime(AcquisitionDateTime), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(ImagesInAcquisition), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmLongText(ImageComments), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlImage), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(BurnedInAnnotation), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(RecognizableVisualFeatures), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(LossyImageCompression), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(LossyImageCompressionRatio), "1-n", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(LossyImageCompressionMethod), "1-n", "3", "GeneralImageModule"); + if (result.good()) result = IconImageSequence.write(dataset, "1-n" ,"3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PresentationLUTShape), "1", "3", "GeneralImageModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(IrradiationEventUID), "1-n", "3", "GeneralImageModule"); + if (result.good()) result = RealWorldValueMappingSequence.write(dataset, "1-n" ,"3", "GeneralImageModule"); + + // --- GeneralReferenceModule (U) --- + if (isGeneralReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = ReferencedInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + addElementToDataset(result, dataset, new DcmShortText(DerivationDescription), "1", "3", "GeneralReferenceModule"); + if (result.good()) result = DerivationCodeSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + } + + // --- ImagePixelModule (M) --- + // addElementToDataset(result, dataset, new DcmUnsignedShort(SamplesPerPixel), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmCodeString(PhotometricInterpretation), "1", "1", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(Rows), "1", "1", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(Columns), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(BitsAllocated), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(BitsStored), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(HighBit), "1", "1", "ImagePixelModule"); + // addElementToDataset(result, dataset, new DcmUnsignedShort(PixelRepresentation), "1", "1", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PlanarConfiguration), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmIntegerString(PixelAspectRatio), "2", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(SmallestImagePixelValue), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(LargestImagePixelValue), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(RedPaletteColorLookupTableDescriptor), "3", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(GreenPaletteColorLookupTableDescriptor), "3", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(BluePaletteColorLookupTableDescriptor), "3", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(RedPaletteColorLookupTableData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(GreenPaletteColorLookupTableData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(BluePaletteColorLookupTableData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmOtherByteOtherWord(ICCProfile), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmCodeString(ColorSpace), "1", "3", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmPixelData(PixelData), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUniversalResourceIdentifierOrLocator(PixelDataProviderURL), "1", "1C", "ImagePixelModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingRangeLimit), "1", "1C", "ImagePixelModule"); + + // --- ContrastBolusModule (C) --- + if (isContrastBolusModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ContrastBolusAgent), "1", "2", "ContrastBolusModule"); + if (result.good()) result = ContrastBolusAgentSequence.write(dataset, "1-n" ,"3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmLongString(ContrastBolusRoute), "1", "3", "ContrastBolusModule"); + if (result.good()) result = ContrastBolusAdministrationRouteSequence.write(dataset, "1-n" ,"3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ContrastBolusVolume), "1", "3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmTime(ContrastBolusStartTime), "1", "3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmTime(ContrastBolusStopTime), "1", "3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ContrastBolusTotalDose), "1", "3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ContrastFlowRate), "1-n", "3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ContrastFlowDuration), "1-n", "3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContrastBolusIngredient), "1", "3", "ContrastBolusModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ContrastBolusIngredientConcentration), "1", "3", "ContrastBolusModule"); + } + + // --- CineModule (C) --- + if (isCineModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmUnsignedShort(PreferredPlaybackSequencing), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmDecimalString(FrameTime), "1", "1C", "CineModule"); + addElementToDataset(result, dataset, new DcmDecimalString(FrameTimeVector), "1-n", "1C", "CineModule"); + addElementToDataset(result, dataset, new DcmIntegerString(StartTrim), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmIntegerString(StopTrim), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmIntegerString(RecommendedDisplayFrameRate), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmIntegerString(CineRate), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmDecimalString(FrameDelay), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ImageTriggerDelay), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmDecimalString(EffectiveDuration), "1", "3", "CineModule"); + addElementToDataset(result, dataset, new DcmIntegerString(ActualFrameDuration), "1", "3", "CineModule"); + if (result.good()) result = MultiplexedAudioChannelsDescriptionCodeSequence.write(dataset, "1-n" ,"2C", "CineModule"); + } + + // --- MultiFrameModule (C) --- + if (isMultiFrameModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmIntegerString(NumberOfFrames), "1", "1", "MultiFrameModule"); + addElementToDataset(result, dataset, new DcmAttributeTag(FrameIncrementPointer), "1-n", "1", "MultiFrameModule"); + addElementToDataset(result, dataset, new DcmCodeString(StereoPairsPresent), "1", "3", "MultiFrameModule"); + } + + // --- DeviceModule (U) --- + if (isDeviceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = DeviceSequence.write(dataset, "1-n" ,"1", "DeviceModule"); + } + + // --- RTImageModule (M) --- + addElementToDataset(result, dataset, new DcmUnsignedShort(SamplesPerPixel), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PhotometricInterpretation), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(BitsAllocated), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(BitsStored), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(HighBit), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelRepresentation), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PixelIntensityRelationship), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmSignedShort(PixelIntensityRelationshipSign), "1", "1C", "RTImageModule"); + addElementToDataset(result, dataset, new DcmShortString(RTImageLabel), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmLongString(RTImageName), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmShortText(RTImageDescription), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(ImageType), "2-n", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(ConversionType), "1", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(ReportedValuesOrigin), "1", "2C", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(RTImagePlane), "1", "1", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(XRayImageReceptorTranslation), "3", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(XRayImageReceptorAngle), "1", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RTImageOrientation), "6", "2C", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(ImagePlanePixelSpacing), "2", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RTImagePosition), "2", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmShortString(RadiationMachineName), "1", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PrimaryDosimeterUnit), "1", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RadiationMachineSAD), "1", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RadiationMachineSSD), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RTImageSID), "1", "2", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SourceToReferenceObjectDistance), "1", "3", "RTImageModule"); + if (result.good()) result = ReferencedRTPlanSequence.write(dataset, "1-n" ,"3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(ReferencedBeamNumber), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(ReferencedFractionGroupNumber), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(FractionNumber), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(StartCumulativeMetersetWeight), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(EndCumulativeMetersetWeight), "1", "3", "RTImageModule"); + if (result.good()) result = ExposureSequence.write(dataset, "1-n" ,"3", "RTImageModule"); + if (result.good()) result = FluenceMapSequence.write(dataset, "1-n" ,"1C", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(GantryAngle), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmFloatingPointSingle(GantryPitchAngle), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(BeamLimitingDeviceAngle), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSupportAngle), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(TableTopEccentricAxisDistance), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(TableTopEccentricAngle), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmFloatingPointSingle(TableTopPitchAngle), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmFloatingPointSingle(TableTopRollAngle), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(TableTopVerticalPosition), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(TableTopLongitudinalPosition), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(TableTopLateralPosition), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(IsocenterPosition), "3", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientPosition), "1", "1C", "RTImageModule"); + addElementToDataset(result, dataset, new DcmIntegerString(ExposureTime), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(ExposureTimeInms), "1", "3", "RTImageModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MetersetExposure), "1", "3", "RTImageModule"); + + // --- ModalityLUTModule (U) --- + if (isModalityLUTModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ModalityLUTSequence.write(dataset, "1-n" ,"1C", "ModalityLUTModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RescaleIntercept), "1", "1C", "ModalityLUTModule"); + addElementToDataset(result, dataset, new DcmDecimalString(RescaleSlope), "1", "1C", "ModalityLUTModule"); + addElementToDataset(result, dataset, new DcmLongString(RescaleType), "1", "1C", "ModalityLUTModule"); + } + + // --- VOILUTModule (U) --- + if (isVOILUTModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = VOILUTSequence.write(dataset, "1-n" ,"1C", "VOILUTModule"); + addElementToDataset(result, dataset, new DcmDecimalString(WindowCenter), "1-n", "1C", "VOILUTModule"); + addElementToDataset(result, dataset, new DcmDecimalString(WindowWidth), "1-n", "1C", "VOILUTModule"); + addElementToDataset(result, dataset, new DcmLongString(WindowCenterWidthExplanation), "1-n", "3", "VOILUTModule"); + addElementToDataset(result, dataset, new DcmCodeString(VOILUTFunction), "1", "3", "VOILUTModule"); + } + + // --- ApprovalModule (U) --- + if (isApprovalModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmCodeString(ApprovalStatus), "1", "1", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmDate(ReviewDate), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmTime(ReviewTime), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReviewerName), "1", "2C", "ApprovalModule"); + } + + // --- SOPCommonModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(InstanceCoercionDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(RelatedGeneralSOPClassUID), "1-n", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(OriginalSpecializedSOPClassUID), "1", "3", "SOPCommonModule"); + if (result.good()) result = CodingSchemeIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = ContextGroupIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = MappingResourceIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + if (result.good()) result = ContributingEquipmentSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SOPInstanceStatus), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(SOPAuthorizationDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongText(SOPAuthorizationComment), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongString(AuthorizationEquipmentCertificationNumber), "1", "3", "SOPCommonModule"); + if (result.good()) result = MACParametersSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = DigitalSignaturesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = EncryptedAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + if (result.good()) result = OriginalAttributesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = HL7StructuredDocumentReferenceSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalInformationModified), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(QueryRetrieveView), "1", "1C", "SOPCommonModule"); + if (result.good()) result = ConversionSourceAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContentQualification), "1", "3", "SOPCommonModule"); + if (result.good()) result = PrivateDataElementCharacteristicsSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + if (isCommonInstanceReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedSeriesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + if (result.good()) result = StudiesContainingOtherReferencedInstancesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + } + + // --- FrameExtractionModule (C) --- + if (isFrameExtractionModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = FrameExtractionSequence.write(dataset, "1-n" ,"1", "FrameExtractionModule"); + } + } else + result = RT_EC_InvalidObject; + return result; +} + + +OFBool DRTImageIOD::isClinicalTrialSubjectModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ClinicalTrialSponsorName.isEmpty() && + !ClinicalTrialProtocolID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ClinicalTrialSponsorName.isEmpty() || + !ClinicalTrialProtocolID.isEmpty() || + !ClinicalTrialProtocolName.isEmpty() || + !ClinicalTrialSiteID.isEmpty() || + !ClinicalTrialSiteName.isEmpty() || + !ClinicalTrialSubjectID.isEmpty() || + !ClinicalTrialSubjectReadingID.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeName.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeApprovalNumber.isEmpty(); + } +} + + +OFBool DRTImageIOD::isPatientStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !AdmittingDiagnosesDescription.isEmpty() || + !AdmittingDiagnosesCodeSequence.isEmpty() || + !PatientAge.isEmpty() || + !PatientSize.isEmpty() || + !PatientWeight.isEmpty() || + !PatientBodyMassIndex.isEmpty() || + !MeasuredAPDimension.isEmpty() || + !MeasuredLateralDimension.isEmpty() || + !PatientSizeCodeSequence.isEmpty() || + !MedicalAlerts.isEmpty() || + !Allergies.isEmpty() || + !SmokingStatus.isEmpty() || + !PregnancyStatus.isEmpty() || + !LastMenstrualDate.isEmpty() || + !PatientState.isEmpty() || + !Occupation.isEmpty() || + !AdditionalPatientHistory.isEmpty() || + !AdmissionID.isEmpty() || + !IssuerOfAdmissionIDSequence.isEmpty() || + !ServiceEpisodeID.isEmpty() || + !IssuerOfServiceEpisodeIDSequence.isEmpty() || + !ServiceEpisodeDescription.isEmpty() || + !PatientSexNeutered.isEmpty(); +} + + +OFBool DRTImageIOD::isClinicalTrialStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialTimePointID.isEmpty() || + !ClinicalTrialTimePointDescription.isEmpty() || + !LongitudinalTemporalOffsetFromEvent.isEmpty() || + !LongitudinalTemporalEventType.isEmpty() || + !ConsentForClinicalTrialUseSequence.isEmpty(); +} + + +OFBool DRTImageIOD::isClinicalTrialSeriesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialCoordinatingCenterName.isEmpty() || + !ClinicalTrialSeriesID.isEmpty() || + !ClinicalTrialSeriesDescription.isEmpty(); +} + + +OFBool DRTImageIOD::isFrameOfReferenceModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !FrameOfReferenceUID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !FrameOfReferenceUID.isEmpty() || + !PositionReferenceIndicator.isEmpty(); + } +} + + +OFBool DRTImageIOD::isGeneralReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedImageSequence.isEmpty() || + !ReferencedInstanceSequence.isEmpty() || + !DerivationDescription.isEmpty() || + !DerivationCodeSequence.isEmpty() || + !SourceImageSequence.isEmpty() || + !SourceInstanceSequence.isEmpty(); +} + + +OFBool DRTImageIOD::isContrastBolusModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ContrastBolusAgent.isEmpty() || + !ContrastBolusAgentSequence.isEmpty() || + !ContrastBolusRoute.isEmpty() || + !ContrastBolusAdministrationRouteSequence.isEmpty() || + !ContrastBolusVolume.isEmpty() || + !ContrastBolusStartTime.isEmpty() || + !ContrastBolusStopTime.isEmpty() || + !ContrastBolusTotalDose.isEmpty() || + !ContrastFlowRate.isEmpty() || + !ContrastFlowDuration.isEmpty() || + !ContrastBolusIngredient.isEmpty() || + !ContrastBolusIngredientConcentration.isEmpty(); +} + + +OFBool DRTImageIOD::isCineModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !PreferredPlaybackSequencing.isEmpty() || + !FrameTime.isEmpty() || + !FrameTimeVector.isEmpty() || + !StartTrim.isEmpty() || + !StopTrim.isEmpty() || + !RecommendedDisplayFrameRate.isEmpty() || + !CineRate.isEmpty() || + !FrameDelay.isEmpty() || + !ImageTriggerDelay.isEmpty() || + !EffectiveDuration.isEmpty() || + !ActualFrameDuration.isEmpty() || + !MultiplexedAudioChannelsDescriptionCodeSequence.isEmpty(); +} + + +OFBool DRTImageIOD::isMultiFrameModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !NumberOfFrames.isEmpty() && + !FrameIncrementPointer.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !NumberOfFrames.isEmpty() || + !FrameIncrementPointer.isEmpty() || + !StereoPairsPresent.isEmpty(); + } +} + + +OFBool DRTImageIOD::isDeviceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !DeviceSequence.isEmpty(); +} + + +OFBool DRTImageIOD::isModalityLUTModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ModalityLUTSequence.isEmpty() || + !RescaleIntercept.isEmpty() || + !RescaleSlope.isEmpty() || + !RescaleType.isEmpty(); +} + + +OFBool DRTImageIOD::isVOILUTModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !VOILUTSequence.isEmpty() || + !WindowCenter.isEmpty() || + !WindowWidth.isEmpty() || + !WindowCenterWidthExplanation.isEmpty() || + !VOILUTFunction.isEmpty(); +} + + +OFBool DRTImageIOD::isApprovalModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ApprovalStatus.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ApprovalStatus.isEmpty() || + !ReviewDate.isEmpty() || + !ReviewTime.isEmpty() || + !ReviewerName.isEmpty(); + } +} + + +OFBool DRTImageIOD::isCommonInstanceReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedSeriesSequence.isEmpty() || + !StudiesContainingOtherReferencedInstancesSequence.isEmpty(); +} + + +OFBool DRTImageIOD::isFrameExtractionModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !FrameExtractionSequence.isEmpty(); +} + + +OFCondition DRTImageIOD::getAccessionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTImageIOD::getAcquisitionDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionDate, value, pos); +} + + +OFCondition DRTImageIOD::getAcquisitionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionDateTime, value, pos); +} + + +OFCondition DRTImageIOD::getAcquisitionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionNumber, value, pos); +} + + +OFCondition DRTImageIOD::getAcquisitionNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, AcquisitionNumber).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getAcquisitionTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AcquisitionTime, value, pos); +} + + +OFCondition DRTImageIOD::getActualFrameDuration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ActualFrameDuration, value, pos); +} + + +OFCondition DRTImageIOD::getActualFrameDuration(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ActualFrameDuration).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getAdditionalPatientHistory(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdditionalPatientHistory, value, pos); +} + + +OFCondition DRTImageIOD::getAdmissionID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmissionID, value, pos); +} + + +OFCondition DRTImageIOD::getAdmittingDiagnosesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmittingDiagnosesDescription, value, pos); +} + + +OFCondition DRTImageIOD::getAllergies(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Allergies, value, pos); +} + + +OFCondition DRTImageIOD::getApprovalStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ApprovalStatus, value, pos); +} + + +OFCondition DRTImageIOD::getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AuthorizationEquipmentCertificationNumber, value, pos); +} + + +OFCondition DRTImageIOD::getBeamLimitingDeviceAngle(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(BeamLimitingDeviceAngle, value, pos); +} + + +OFCondition DRTImageIOD::getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, BeamLimitingDeviceAngle).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getBitsAllocated(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, BitsAllocated).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getBitsStored(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, BitsStored).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getBluePaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, BluePaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, BluePaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + return result; +} + + +OFCondition DRTImageIOD::getBluePaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, BluePaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getBurnedInAnnotation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(BurnedInAnnotation, value, pos); +} + + +OFCondition DRTImageIOD::getCineRate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CineRate, value, pos); +} + + +OFCondition DRTImageIOD::getCineRate(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, CineRate).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialCoordinatingCenterName, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeApprovalNumber, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeName, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialProtocolName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolName, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesDescription, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialSeriesID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesID, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialSiteID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteID, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialSiteName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteName, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialSponsorName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSponsorName, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialSubjectID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectID, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialSubjectReadingID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectReadingID, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialTimePointDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointDescription, value, pos); +} + + +OFCondition DRTImageIOD::getClinicalTrialTimePointID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointID, value, pos); +} + + +OFCondition DRTImageIOD::getColorSpace(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ColorSpace, value, pos); +} + + +OFCondition DRTImageIOD::getColumns(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, Columns).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CommentsOnThePerformedProcedureStep, value, pos); +} + + +OFCondition DRTImageIOD::getConsultingPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConsultingPhysicianName, value, pos); +} + + +OFCondition DRTImageIOD::getContentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentDate, value, pos); +} + + +OFCondition DRTImageIOD::getContentQualification(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentQualification, value, pos); +} + + +OFCondition DRTImageIOD::getContentTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentTime, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusAgent(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusAgent, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusIngredient(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusIngredient, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusIngredientConcentration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusIngredientConcentration, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusIngredientConcentration(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ContrastBolusIngredientConcentration).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusRoute(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusRoute, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusStartTime, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusStopTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusStopTime, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusTotalDose(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusTotalDose, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusTotalDose(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ContrastBolusTotalDose).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusVolume(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastBolusVolume, value, pos); +} + + +OFCondition DRTImageIOD::getContrastBolusVolume(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ContrastBolusVolume).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getContrastFlowDuration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastFlowDuration, value, pos); +} + + +OFCondition DRTImageIOD::getContrastFlowDuration(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ContrastFlowDuration).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getContrastFlowDuration(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, ContrastFlowDuration).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getContrastFlowRate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContrastFlowRate, value, pos); +} + + +OFCondition DRTImageIOD::getContrastFlowRate(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ContrastFlowRate).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getContrastFlowRate(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, ContrastFlowRate).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getConversionType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConversionType, value, pos); +} + + +OFCondition DRTImageIOD::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTImageIOD::getDeidentificationMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeidentificationMethod, value, pos); +} + + +OFCondition DRTImageIOD::getDerivationDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DerivationDescription, value, pos); +} + + +OFCondition DRTImageIOD::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTImageIOD::getEffectiveDuration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EffectiveDuration, value, pos); +} + + +OFCondition DRTImageIOD::getEffectiveDuration(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, EffectiveDuration).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getEndCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EndCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTImageIOD::getEndCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, EndCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getEthnicGroup(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EthnicGroup, value, pos); +} + + +OFCondition DRTImageIOD::getExposureTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ExposureTime, value, pos); +} + + +OFCondition DRTImageIOD::getExposureTime(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ExposureTime).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getExposureTimeInms(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, ExposureTimeInms).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getFractionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FractionNumber, value, pos); +} + + +OFCondition DRTImageIOD::getFractionNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, FractionNumber).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getFrameDelay(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameDelay, value, pos); +} + + +OFCondition DRTImageIOD::getFrameDelay(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, FrameDelay).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getFrameIncrementPointer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameIncrementPointer, value, pos); +} + + +OFCondition DRTImageIOD::getFrameOfReferenceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameOfReferenceUID, value, pos); +} + + +OFCondition DRTImageIOD::getFrameTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameTime, value, pos); +} + + +OFCondition DRTImageIOD::getFrameTime(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, FrameTime).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getFrameTimeVector(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameTimeVector, value, pos); +} + + +OFCondition DRTImageIOD::getFrameTimeVector(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, FrameTimeVector).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getFrameTimeVector(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, FrameTimeVector).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getGantryAngle(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryAngle, value, pos); +} + + +OFCondition DRTImageIOD::getGantryAngle(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, GantryAngle).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getGantryID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryID, value, pos); +} + + +OFCondition DRTImageIOD::getGantryPitchAngle(Float32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointSingle &, GantryPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTImageIOD::getGreenPaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, GreenPaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, GreenPaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + return result; +} + + +OFCondition DRTImageIOD::getGreenPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, GreenPaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getHighBit(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, HighBit).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getICCProfile(Uint8 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, ICCProfile).getUint8Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, ICCProfile).getLength() / sizeof(Uint8); + else + *count = 0; + } + return result; +} + + +OFCondition DRTImageIOD::getImageComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImageComments, value, pos); +} + + +OFCondition DRTImageIOD::getImagePlanePixelSpacing(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImagePlanePixelSpacing, value, pos); +} + + +OFCondition DRTImageIOD::getImagePlanePixelSpacing(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ImagePlanePixelSpacing).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getImagePlanePixelSpacing(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, ImagePlanePixelSpacing).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getImageTriggerDelay(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImageTriggerDelay, value, pos); +} + + +OFCondition DRTImageIOD::getImageTriggerDelay(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, ImageTriggerDelay).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getImageType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImageType, value, pos); +} + + +OFCondition DRTImageIOD::getImagesInAcquisition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ImagesInAcquisition, value, pos); +} + + +OFCondition DRTImageIOD::getImagesInAcquisition(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ImagesInAcquisition).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getInstanceCoercionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCoercionDateTime, value, pos); +} + + +OFCondition DRTImageIOD::getInstanceCreationDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DRTImageIOD::getInstanceCreationTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DRTImageIOD::getInstanceCreatorUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DRTImageIOD::getInstanceNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DRTImageIOD::getInstanceNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, InstanceNumber).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getInstitutionAddress(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTImageIOD::getInstitutionName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTImageIOD::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTImageIOD::getIrradiationEventUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IrradiationEventUID, value, pos); +} + + +OFCondition DRTImageIOD::getIsocenterPosition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IsocenterPosition, value, pos); +} + + +OFCondition DRTImageIOD::getIsocenterPosition(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, IsocenterPosition).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getIsocenterPosition(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, IsocenterPosition).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTImageIOD::getLargestImagePixelValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, LargestImagePixelValue).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getLastMenstrualDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LastMenstrualDate, value, pos); +} + + +OFCondition DRTImageIOD::getLongitudinalTemporalEventType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalEventType, value, pos); +} + + +OFCondition DRTImageIOD::getLongitudinalTemporalInformationModified(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalInformationModified, value, pos); +} + + +OFCondition DRTImageIOD::getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, LongitudinalTemporalOffsetFromEvent).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getLossyImageCompression(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LossyImageCompression, value, pos); +} + + +OFCondition DRTImageIOD::getLossyImageCompressionMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LossyImageCompressionMethod, value, pos); +} + + +OFCondition DRTImageIOD::getLossyImageCompressionRatio(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LossyImageCompressionRatio, value, pos); +} + + +OFCondition DRTImageIOD::getLossyImageCompressionRatio(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, LossyImageCompressionRatio).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getLossyImageCompressionRatio(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, LossyImageCompressionRatio).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getManufacturer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTImageIOD::getManufacturerModelName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTImageIOD::getMeasuredAPDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredAPDimension, value, pos); +} + + +OFCondition DRTImageIOD::getMeasuredAPDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredAPDimension).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getMeasuredLateralDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredLateralDimension, value, pos); +} + + +OFCondition DRTImageIOD::getMeasuredLateralDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredLateralDimension).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getMedicalAlerts(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MedicalAlerts, value, pos); +} + + +OFCondition DRTImageIOD::getMetersetExposure(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MetersetExposure, value, pos); +} + + +OFCondition DRTImageIOD::getMetersetExposure(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MetersetExposure).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getModality(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DRTImageIOD::getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NameOfPhysiciansReadingStudy, value, pos); +} + + +OFCondition DRTImageIOD::getNumberOfFrames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NumberOfFrames, value, pos); +} + + +OFCondition DRTImageIOD::getNumberOfFrames(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, NumberOfFrames).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getOccupation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Occupation, value, pos); +} + + +OFCondition DRTImageIOD::getOperatorsName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTImageIOD::getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OriginalSpecializedSOPClassUID, value, pos); +} + + +OFCondition DRTImageIOD::getOtherPatientNames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OtherPatientNames, value, pos); +} + + +OFCondition DRTImageIOD::getPatientAge(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAge, value, pos); +} + + +OFCondition DRTImageIOD::getPatientAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAlternativeCalendar, value, pos); +} + + +OFCondition DRTImageIOD::getPatientBirthDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DRTImageIOD::getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTImageIOD::getPatientBirthTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthTime, value, pos); +} + + +OFCondition DRTImageIOD::getPatientBodyMassIndex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBodyMassIndex, value, pos); +} + + +OFCondition DRTImageIOD::getPatientBodyMassIndex(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientBodyMassIndex).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getPatientBreedDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBreedDescription, value, pos); +} + + +OFCondition DRTImageIOD::getPatientComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientComments, value, pos); +} + + +OFCondition DRTImageIOD::getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientDeathDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTImageIOD::getPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTImageIOD::getPatientIdentityRemoved(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientIdentityRemoved, value, pos); +} + + +OFCondition DRTImageIOD::getPatientName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DRTImageIOD::getPatientOrientation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientOrientation, value, pos); +} + + +OFCondition DRTImageIOD::getPatientPosition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientPosition, value, pos); +} + + +OFCondition DRTImageIOD::getPatientSex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DRTImageIOD::getPatientSexNeutered(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSexNeutered, value, pos); +} + + +OFCondition DRTImageIOD::getPatientSize(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSize, value, pos); +} + + +OFCondition DRTImageIOD::getPatientSize(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSize).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getPatientSpeciesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSpeciesDescription, value, pos); +} + + +OFCondition DRTImageIOD::getPatientState(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientState, value, pos); +} + + +OFCondition DRTImageIOD::getPatientSupportAngle(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSupportAngle, value, pos); +} + + +OFCondition DRTImageIOD::getPatientSupportAngle(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSupportAngle).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getPatientWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientWeight, value, pos); +} + + +OFCondition DRTImageIOD::getPatientWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientWeight).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getPerformedProcedureStepDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepDescription, value, pos); +} + + +OFCondition DRTImageIOD::getPerformedProcedureStepEndDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndDate, value, pos); +} + + +OFCondition DRTImageIOD::getPerformedProcedureStepEndTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndTime, value, pos); +} + + +OFCondition DRTImageIOD::getPerformedProcedureStepID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepID, value, pos); +} + + +OFCondition DRTImageIOD::getPerformedProcedureStepStartDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartDate, value, pos); +} + + +OFCondition DRTImageIOD::getPerformedProcedureStepStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartTime, value, pos); +} + + +OFCondition DRTImageIOD::getPhotometricInterpretation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhotometricInterpretation, value, pos); +} + + +OFCondition DRTImageIOD::getPhysiciansOfRecord(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhysiciansOfRecord, value, pos); +} + + +OFCondition DRTImageIOD::getPixelAspectRatio(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PixelAspectRatio, value, pos); +} + + +OFCondition DRTImageIOD::getPixelAspectRatio(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, PixelAspectRatio).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getPixelDataProviderURL(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PixelDataProviderURL, value, pos); +} + + +OFCondition DRTImageIOD::getPixelIntensityRelationship(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PixelIntensityRelationship, value, pos); +} + + +OFCondition DRTImageIOD::getPixelIntensityRelationshipSign(Sint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmSignedShort &, PixelIntensityRelationshipSign).getSint16(value, pos); +} + + +OFCondition DRTImageIOD::getPixelPaddingRangeLimit(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingRangeLimit).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getPixelPaddingValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingValue).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getPixelRepresentation(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelRepresentation).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getPlanarConfiguration(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PlanarConfiguration).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getPositionReferenceIndicator(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PositionReferenceIndicator, value, pos); +} + + +OFCondition DRTImageIOD::getPreferredPlaybackSequencing(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PreferredPlaybackSequencing).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getPregnancyStatus(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PregnancyStatus).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getPresentationLUTShape(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PresentationLUTShape, value, pos); +} + + +OFCondition DRTImageIOD::getPrimaryDosimeterUnit(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PrimaryDosimeterUnit, value, pos); +} + + +OFCondition DRTImageIOD::getQualityControlImage(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlImage, value, pos); +} + + +OFCondition DRTImageIOD::getQualityControlSubject(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlSubject, value, pos); +} + + +OFCondition DRTImageIOD::getQueryRetrieveView(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QueryRetrieveView, value, pos); +} + + +OFCondition DRTImageIOD::getRTImageDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTImageDescription, value, pos); +} + + +OFCondition DRTImageIOD::getRTImageLabel(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTImageLabel, value, pos); +} + + +OFCondition DRTImageIOD::getRTImageName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTImageName, value, pos); +} + + +OFCondition DRTImageIOD::getRTImageOrientation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTImageOrientation, value, pos); +} + + +OFCondition DRTImageIOD::getRTImageOrientation(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RTImageOrientation).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getRTImageOrientation(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, RTImageOrientation).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getRTImagePlane(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTImagePlane, value, pos); +} + + +OFCondition DRTImageIOD::getRTImagePosition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTImagePosition, value, pos); +} + + +OFCondition DRTImageIOD::getRTImagePosition(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RTImagePosition).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getRTImagePosition(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, RTImagePosition).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getRTImageSID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTImageSID, value, pos); +} + + +OFCondition DRTImageIOD::getRTImageSID(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RTImageSID).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getRadiationMachineName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RadiationMachineName, value, pos); +} + + +OFCondition DRTImageIOD::getRadiationMachineSAD(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RadiationMachineSAD, value, pos); +} + + +OFCondition DRTImageIOD::getRadiationMachineSAD(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RadiationMachineSAD).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getRadiationMachineSSD(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RadiationMachineSSD, value, pos); +} + + +OFCondition DRTImageIOD::getRadiationMachineSSD(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RadiationMachineSSD).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getRecognizableVisualFeatures(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RecognizableVisualFeatures, value, pos); +} + + +OFCondition DRTImageIOD::getRecommendedDisplayFrameRate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RecommendedDisplayFrameRate, value, pos); +} + + +OFCondition DRTImageIOD::getRecommendedDisplayFrameRate(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, RecommendedDisplayFrameRate).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getRedPaletteColorLookupTableData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = OFconst_cast(DcmOtherByteOtherWord &, RedPaletteColorLookupTableData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, RedPaletteColorLookupTableData).getLength() / sizeof(Uint16); + else + *count = 0; + } + return result; +} + + +OFCondition DRTImageIOD::getRedPaletteColorLookupTableDescriptor(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, RedPaletteColorLookupTableDescriptor).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getReferencedBeamNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferencedBeamNumber, value, pos); +} + + +OFCondition DRTImageIOD::getReferencedBeamNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ReferencedBeamNumber).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getReferencedFractionGroupNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferencedFractionGroupNumber, value, pos); +} + + +OFCondition DRTImageIOD::getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ReferencedFractionGroupNumber).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getReferringPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DRTImageIOD::getRelatedGeneralSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RelatedGeneralSOPClassUID, value, pos); +} + + +OFCondition DRTImageIOD::getReportedValuesOrigin(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReportedValuesOrigin, value, pos); +} + + +OFCondition DRTImageIOD::getRescaleIntercept(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RescaleIntercept, value, pos); +} + + +OFCondition DRTImageIOD::getRescaleIntercept(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RescaleIntercept).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getRescaleSlope(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RescaleSlope, value, pos); +} + + +OFCondition DRTImageIOD::getRescaleSlope(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, RescaleSlope).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getRescaleType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RescaleType, value, pos); +} + + +OFCondition DRTImageIOD::getResponsibleOrganization(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsibleOrganization, value, pos); +} + + +OFCondition DRTImageIOD::getResponsiblePerson(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePerson, value, pos); +} + + +OFCondition DRTImageIOD::getResponsiblePersonRole(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePersonRole, value, pos); +} + + +OFCondition DRTImageIOD::getReviewDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewDate, value, pos); +} + + +OFCondition DRTImageIOD::getReviewTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewTime, value, pos); +} + + +OFCondition DRTImageIOD::getReviewerName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewerName, value, pos); +} + + +OFCondition DRTImageIOD::getRows(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, Rows).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getSOPAuthorizationComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationComment, value, pos); +} + + +OFCondition DRTImageIOD::getSOPAuthorizationDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationDateTime, value, pos); +} + + +OFCondition DRTImageIOD::getSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DRTImageIOD::getSOPInstanceStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceStatus, value, pos); +} + + +OFCondition DRTImageIOD::getSOPInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DRTImageIOD::getSamplesPerPixel(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, SamplesPerPixel).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getSeriesDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DRTImageIOD::getSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DRTImageIOD::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTImageIOD::getSeriesNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DRTImageIOD::getSeriesNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, SeriesNumber).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getSeriesTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DRTImageIOD::getServiceEpisodeDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeDescription, value, pos); +} + + +OFCondition DRTImageIOD::getServiceEpisodeID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeID, value, pos); +} + + +OFCondition DRTImageIOD::getSmallestImagePixelValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, SmallestImagePixelValue).getUint16(value, pos); +} + + +OFCondition DRTImageIOD::getSmokingStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SmokingStatus, value, pos); +} + + +OFCondition DRTImageIOD::getSoftwareVersions(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTImageIOD::getSourceToReferenceObjectDistance(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SourceToReferenceObjectDistance, value, pos); +} + + +OFCondition DRTImageIOD::getSourceToReferenceObjectDistance(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SourceToReferenceObjectDistance).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getSpatialResolution(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTImageIOD::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getSpecificCharacterSet(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DRTImageIOD::getStartCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StartCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTImageIOD::getStartCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, StartCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getStartTrim(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StartTrim, value, pos); +} + + +OFCondition DRTImageIOD::getStartTrim(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, StartTrim).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getStationName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTImageIOD::getStereoPairsPresent(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StereoPairsPresent, value, pos); +} + + +OFCondition DRTImageIOD::getStopTrim(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StopTrim, value, pos); +} + + +OFCondition DRTImageIOD::getStopTrim(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, StopTrim).getSint32(value, pos); +} + + +OFCondition DRTImageIOD::getStrainAdditionalInformation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainAdditionalInformation, value, pos); +} + + +OFCondition DRTImageIOD::getStrainDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainDescription, value, pos); +} + + +OFCondition DRTImageIOD::getStrainNomenclature(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainNomenclature, value, pos); +} + + +OFCondition DRTImageIOD::getStudyDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DRTImageIOD::getStudyDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DRTImageIOD::getStudyID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DRTImageIOD::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTImageIOD::getStudyTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DRTImageIOD::getTableTopEccentricAngle(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TableTopEccentricAngle, value, pos); +} + + +OFCondition DRTImageIOD::getTableTopEccentricAngle(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, TableTopEccentricAngle).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getTableTopEccentricAxisDistance(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TableTopEccentricAxisDistance, value, pos); +} + + +OFCondition DRTImageIOD::getTableTopEccentricAxisDistance(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, TableTopEccentricAxisDistance).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getTableTopLateralPosition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TableTopLateralPosition, value, pos); +} + + +OFCondition DRTImageIOD::getTableTopLateralPosition(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, TableTopLateralPosition).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getTableTopLongitudinalPosition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TableTopLongitudinalPosition, value, pos); +} + + +OFCondition DRTImageIOD::getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalPosition).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getTableTopPitchAngle(Float32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointSingle &, TableTopPitchAngle).getFloat32(value, pos); +} + + +OFCondition DRTImageIOD::getTableTopRollAngle(Float32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointSingle &, TableTopRollAngle).getFloat32(value, pos); +} + + +OFCondition DRTImageIOD::getTableTopVerticalPosition(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TableTopVerticalPosition, value, pos); +} + + +OFCondition DRTImageIOD::getTableTopVerticalPosition(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, TableTopVerticalPosition).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTImageIOD::getTimezoneOffsetFromUTC(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DRTImageIOD::getVOILUTFunction(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(VOILUTFunction, value, pos); +} + + +OFCondition DRTImageIOD::getWindowCenter(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(WindowCenter, value, pos); +} + + +OFCondition DRTImageIOD::getWindowCenter(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, WindowCenter).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getWindowCenter(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, WindowCenter).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getWindowCenterWidthExplanation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(WindowCenterWidthExplanation, value, pos); +} + + +OFCondition DRTImageIOD::getWindowWidth(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(WindowWidth, value, pos); +} + + +OFCondition DRTImageIOD::getWindowWidth(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, WindowWidth).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getWindowWidth(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, WindowWidth).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::getXRayImageReceptorAngle(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(XRayImageReceptorAngle, value, pos); +} + + +OFCondition DRTImageIOD::getXRayImageReceptorAngle(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, XRayImageReceptorAngle).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getXRayImageReceptorTranslation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(XRayImageReceptorTranslation, value, pos); +} + + +OFCondition DRTImageIOD::getXRayImageReceptorTranslation(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, XRayImageReceptorTranslation).getFloat64(value, pos); +} + + +OFCondition DRTImageIOD::getXRayImageReceptorTranslation(OFVector &value) const +{ + return OFconst_cast(DcmDecimalString &, XRayImageReceptorTranslation).getFloat64Vector(value); +} + + +OFCondition DRTImageIOD::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAcquisitionDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAcquisitionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAcquisitionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAcquisitionTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setActualFrameDuration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ActualFrameDuration.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAdditionalPatientHistory(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = AdditionalPatientHistory.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAdmissionID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AdmissionID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAdmittingDiagnosesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AdmittingDiagnosesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAllergies(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = Allergies.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setApprovalStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApprovalStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AuthorizationEquipmentCertificationNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setBeamLimitingDeviceAngle(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceAngle.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setBitsAllocated(const Uint16 value, const unsigned long pos) +{ + return BitsAllocated.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setBitsStored(const Uint16 value, const unsigned long pos) +{ + return BitsStored.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setBluePaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + return BluePaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTImageIOD::setBluePaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + return BluePaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setBurnedInAnnotation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BurnedInAnnotation.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setCineRate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CineRate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialCoordinatingCenterName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeApprovalNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialProtocolName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialSeriesID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialSiteID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialSiteName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialSponsorName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSponsorName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialSubjectID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectReadingID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialTimePointDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setClinicalTrialTimePointID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setColorSpace(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ColorSpace.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setColumns(const Uint16 value, const unsigned long pos) +{ + return Columns.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CommentsOnThePerformedProcedureStep.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setConsultingPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ConsultingPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContentQualification(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentQualification.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContentTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusAgent(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusAgent.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusIngredient(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusIngredient.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusIngredientConcentration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusIngredientConcentration.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusRoute(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusRoute.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusStopTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusStopTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusTotalDose(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusTotalDose.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastBolusVolume(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContrastBolusVolume.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastFlowDuration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ContrastFlowDuration.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setContrastFlowRate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ContrastFlowRate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setConversionType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ConversionType.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setDeidentificationMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DeidentificationMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setDerivationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = DerivationDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setEffectiveDuration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EffectiveDuration.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setEndCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EndCumulativeMetersetWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setEthnicGroup(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EthnicGroup.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setExposureTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ExposureTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setExposureTimeInms(const Float64 value, const unsigned long pos) +{ + return ExposureTimeInms.putFloat64(value, pos); +} + + +OFCondition DRTImageIOD::setFractionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FractionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setFrameDelay(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameDelay.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setFrameIncrementPointer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAttributeTag::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = FrameIncrementPointer.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setFrameOfReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameOfReferenceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setFrameTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setFrameTimeVector(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = FrameTimeVector.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setGantryAngle(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryAngle.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setGantryID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setGantryPitchAngle(const Float32 value, const unsigned long pos) +{ + return GantryPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTImageIOD::setGreenPaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + return GreenPaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTImageIOD::setGreenPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + return GreenPaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setHighBit(const Uint16 value, const unsigned long pos) +{ + return HighBit.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setICCProfile(const Uint8 *value, const unsigned long count) +{ + return ICCProfile.putUint8Array(value, count); +} + + +OFCondition DRTImageIOD::setImageComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ImageComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setImagePlanePixelSpacing(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = ImagePlanePixelSpacing.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setImageTriggerDelay(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ImageTriggerDelay.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setImageType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "2-n") : EC_Normal; + if (result.good()) + result = ImageType.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setImagesInAcquisition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ImagesInAcquisition.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstanceCoercionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCoercionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstanceCreationDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstanceCreationTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstanceCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreatorUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstanceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setIrradiationEventUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = IrradiationEventUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setIsocenterPosition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = IsocenterPosition.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setLargestImagePixelValue(const Uint16 value, const unsigned long pos) +{ + return LargestImagePixelValue.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setLastMenstrualDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LastMenstrualDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setLongitudinalTemporalEventType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalEventType.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalInformationModified.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos) +{ + return LongitudinalTemporalOffsetFromEvent.putFloat64(value, pos); +} + + +OFCondition DRTImageIOD::setLossyImageCompression(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LossyImageCompression.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setLossyImageCompressionMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = LossyImageCompressionMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setLossyImageCompressionRatio(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = LossyImageCompressionRatio.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setMeasuredAPDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredAPDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setMeasuredLateralDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredLateralDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setMedicalAlerts(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = MedicalAlerts.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setMetersetExposure(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MetersetExposure.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setModality(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Modality.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NameOfPhysiciansReadingStudy.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setNumberOfFrames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFrames.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setOccupation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Occupation.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OriginalSpecializedSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setOtherPatientNames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OtherPatientNames.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientAge(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAge.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientBirthDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientBirthTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientBodyMassIndex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBodyMassIndex.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientBreedDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBreedDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PatientComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientDeathDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientIdentityRemoved(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientIdentityRemoved.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = PatientOrientation.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientPosition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientPosition.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientSex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientSexNeutered(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSexNeutered.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientSize(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSize.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientSpeciesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSpeciesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientState(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientState.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientSupportAngle(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAngle.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPatientWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPerformedProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPerformedProcedureStepEndDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPerformedProcedureStepEndTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPerformedProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPerformedProcedureStepStartDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPerformedProcedureStepStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPhotometricInterpretation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PhotometricInterpretation.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPhysiciansOfRecord(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PhysiciansOfRecord.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPixelAspectRatio(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = PixelAspectRatio.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPixelDataProviderURL(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PixelDataProviderURL.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPixelIntensityRelationship(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PixelIntensityRelationship.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPixelIntensityRelationshipSign(const Sint16 value, const unsigned long pos) +{ + return PixelIntensityRelationshipSign.putSint16(value, pos); +} + + +OFCondition DRTImageIOD::setPixelPaddingRangeLimit(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingRangeLimit.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setPixelPaddingValue(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingValue.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setPixelRepresentation(const Uint16 value, const unsigned long pos) +{ + return PixelRepresentation.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setPlanarConfiguration(const Uint16 value, const unsigned long pos) +{ + return PlanarConfiguration.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setPositionReferenceIndicator(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PositionReferenceIndicator.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPreferredPlaybackSequencing(const Uint16 value, const unsigned long pos) +{ + return PreferredPlaybackSequencing.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setPregnancyStatus(const Uint16 value, const unsigned long pos) +{ + return PregnancyStatus.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setPresentationLUTShape(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PresentationLUTShape.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setPrimaryDosimeterUnit(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrimaryDosimeterUnit.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setQualityControlImage(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlImage.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setQualityControlSubject(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlSubject.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setQueryRetrieveView(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QueryRetrieveView.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRTImageDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RTImageDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRTImageLabel(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTImageLabel.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRTImageName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTImageName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRTImageOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "6") : EC_Normal; + if (result.good()) + result = RTImageOrientation.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRTImagePlane(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTImagePlane.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRTImagePosition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = RTImagePosition.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRTImageSID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTImageSID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRadiationMachineName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationMachineName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRadiationMachineSAD(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationMachineSAD.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRadiationMachineSSD(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationMachineSSD.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRecognizableVisualFeatures(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RecognizableVisualFeatures.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRecommendedDisplayFrameRate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RecommendedDisplayFrameRate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRedPaletteColorLookupTableData(const Uint16 *value, const unsigned long count) +{ + return RedPaletteColorLookupTableData.putUint16Array(value, count); +} + + +OFCondition DRTImageIOD::setRedPaletteColorLookupTableDescriptor(const Uint16 value, const unsigned long pos) +{ + return RedPaletteColorLookupTableDescriptor.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setReferencedBeamNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBeamNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setReferencedFractionGroupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedFractionGroupNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setReferringPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RelatedGeneralSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setReportedValuesOrigin(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReportedValuesOrigin.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRescaleIntercept(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RescaleIntercept.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRescaleSlope(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RescaleSlope.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRescaleType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RescaleType.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsibleOrganization.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setResponsiblePerson(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePerson.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setResponsiblePersonRole(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePersonRole.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setReviewDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setReviewTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setReviewerName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewerName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setRows(const Uint16 value, const unsigned long pos) +{ + return Rows.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setSOPAuthorizationComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SOPAuthorizationComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSOPAuthorizationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPAuthorizationDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSOPInstanceStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSamplesPerPixel(const Uint16 value, const unsigned long pos) +{ + return SamplesPerPixel.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setSeriesDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSeriesNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSeriesTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setServiceEpisodeDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setServiceEpisodeID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSmallestImagePixelValue(const Uint16 value, const unsigned long pos) +{ + return SmallestImagePixelValue.putUint16(value, pos); +} + + +OFCondition DRTImageIOD::setSmokingStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SmokingStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSourceToReferenceObjectDistance(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToReferenceObjectDistance.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setSpecificCharacterSet(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SpecificCharacterSet.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStartCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StartCumulativeMetersetWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStartTrim(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StartTrim.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStereoPairsPresent(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StereoPairsPresent.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStopTrim(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StopTrim.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStrainAdditionalInformation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StrainAdditionalInformation.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStrainDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStrainNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainNomenclature.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStudyDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStudyDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStudyID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setStudyTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setTableTopEccentricAngle(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopEccentricAngle.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setTableTopEccentricAxisDistance(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopEccentricAxisDistance.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setTableTopLateralPosition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralPosition.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setTableTopLongitudinalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalPosition.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setTableTopPitchAngle(const Float32 value, const unsigned long pos) +{ + return TableTopPitchAngle.putFloat32(value, pos); +} + + +OFCondition DRTImageIOD::setTableTopRollAngle(const Float32 value, const unsigned long pos) +{ + return TableTopRollAngle.putFloat32(value, pos); +} + + +OFCondition DRTImageIOD::setTableTopVerticalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalPosition.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setTimezoneOffsetFromUTC(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setVOILUTFunction(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = VOILUTFunction.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setWindowCenter(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = WindowCenter.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setWindowCenterWidthExplanation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = WindowCenterWidthExplanation.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setWindowWidth(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = WindowWidth.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setXRayImageReceptorAngle(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = XRayImageReceptorAngle.putOFStringArray(value); + return result; +} + + +OFCondition DRTImageIOD::setXRayImageReceptorTranslation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = XRayImageReceptorTranslation.putOFStringArray(value); + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtionpl.cc b/dcmrt/libsrc/drtionpl.cc new file mode 100644 index 00000000..eae31b95 --- /dev/null +++ b/dcmrt/libsrc/drtionpl.cc @@ -0,0 +1,3567 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonPlanIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drtionpl.h" + + +DRTIonPlanIOD::DRTIonPlanIOD() + : PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(), + PatientBirthDate(DCM_PatientBirthDate), + PatientBirthDateInAlternativeCalendar(DCM_PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(DCM_PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(DCM_PatientAlternativeCalendar), + PatientSex(DCM_PatientSex), + ReferencedPatientPhotoSequence(), + QualityControlSubject(DCM_QualityControlSubject), + ReferencedPatientSequence(), + PatientBirthTime(DCM_PatientBirthTime), + OtherPatientIDsSequence(), + OtherPatientNames(DCM_OtherPatientNames), + EthnicGroup(DCM_EthnicGroup), + PatientComments(DCM_PatientComments), + PatientSpeciesDescription(DCM_PatientSpeciesDescription), + PatientSpeciesCodeSequence(), + PatientBreedDescription(DCM_PatientBreedDescription), + PatientBreedCodeSequence(), + BreedRegistrationSequence(), + StrainDescription(DCM_StrainDescription), + StrainNomenclature(DCM_StrainNomenclature), + StrainCodeSequence(), + StrainAdditionalInformation(DCM_StrainAdditionalInformation), + StrainStockSequence(), + GeneticModificationsSequence(), + ResponsiblePerson(DCM_ResponsiblePerson), + ResponsiblePersonRole(DCM_ResponsiblePersonRole), + ResponsibleOrganization(DCM_ResponsibleOrganization), + PatientIdentityRemoved(DCM_PatientIdentityRemoved), + DeidentificationMethod(DCM_DeidentificationMethod), + DeidentificationMethodCodeSequence(), + SourcePatientGroupIdentificationSequence(), + GroupOfPatientsIdentificationSequence(), + ClinicalTrialSponsorName(DCM_ClinicalTrialSponsorName), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ClinicalTrialProtocolName(DCM_ClinicalTrialProtocolName), + ClinicalTrialSiteID(DCM_ClinicalTrialSiteID), + ClinicalTrialSiteName(DCM_ClinicalTrialSiteName), + ClinicalTrialSubjectID(DCM_ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(DCM_ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(DCM_ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(), + ConsultingPhysicianName(DCM_ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(), + StudyDescription(DCM_StudyDescription), + PhysiciansOfRecord(DCM_PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(), + NameOfPhysiciansReadingStudy(DCM_NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(), + RequestingServiceCodeSequence(), + ReferencedStudySequence(), + ProcedureCodeSequence(), + ReasonForPerformedProcedureCodeSequence(), + AdmittingDiagnosesDescription(DCM_AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(), + PatientAge(DCM_PatientAge), + PatientSize(DCM_PatientSize), + PatientWeight(DCM_PatientWeight), + PatientBodyMassIndex(DCM_PatientBodyMassIndex), + MeasuredAPDimension(DCM_MeasuredAPDimension), + MeasuredLateralDimension(DCM_MeasuredLateralDimension), + PatientSizeCodeSequence(), + MedicalAlerts(DCM_MedicalAlerts), + Allergies(DCM_Allergies), + SmokingStatus(DCM_SmokingStatus), + PregnancyStatus(DCM_PregnancyStatus), + LastMenstrualDate(DCM_LastMenstrualDate), + PatientState(DCM_PatientState), + Occupation(DCM_Occupation), + AdditionalPatientHistory(DCM_AdditionalPatientHistory), + AdmissionID(DCM_AdmissionID), + IssuerOfAdmissionIDSequence(), + ServiceEpisodeID(DCM_ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(), + ServiceEpisodeDescription(DCM_ServiceEpisodeDescription), + PatientSexNeutered(DCM_PatientSexNeutered), + ClinicalTrialTimePointID(DCM_ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(DCM_ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(DCM_LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(DCM_LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + SeriesDescription(DCM_SeriesDescription), + SeriesDescriptionCodeSequence(), + OperatorsName(DCM_OperatorsName), + OperatorIdentificationSequence(), + ReferencedPerformedProcedureStepSequence(), + RequestAttributesSequence(), + PerformedProcedureStepID(DCM_PerformedProcedureStepID), + PerformedProcedureStepStartDate(DCM_PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(DCM_PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(DCM_PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(DCM_PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(DCM_PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(), + CommentsOnThePerformedProcedureStep(DCM_CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(DCM_ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(DCM_ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(DCM_ClinicalTrialSeriesDescription), + FrameOfReferenceUID(DCM_FrameOfReferenceUID), + PositionReferenceIndicator(DCM_PositionReferenceIndicator), + Manufacturer(DCM_Manufacturer), + InstitutionName(DCM_InstitutionName), + InstitutionAddress(DCM_InstitutionAddress), + StationName(DCM_StationName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + GantryID(DCM_GantryID), + UDISequence(), + SpatialResolution(DCM_SpatialResolution), + DateOfLastCalibration(DCM_DateOfLastCalibration), + TimeOfLastCalibration(DCM_TimeOfLastCalibration), + PixelPaddingValue(DCM_PixelPaddingValue), + RTPlanLabel(DCM_RTPlanLabel), + RTPlanName(DCM_RTPlanName), + RTPlanDescription(DCM_RTPlanDescription), + InstanceNumber(DCM_InstanceNumber), + RTPlanDate(DCM_RTPlanDate), + RTPlanTime(DCM_RTPlanTime), + TreatmentProtocols(DCM_TreatmentProtocols), + PlanIntent(DCM_PlanIntent), + TreatmentSites(DCM_TreatmentSites), + RTPlanGeometry(DCM_RTPlanGeometry), + ReferencedStructureSetSequence(), + ReferencedDoseSequence(), + ReferencedRTPlanSequence(), + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(DCM_FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix), + PrescriptionDescription(DCM_PrescriptionDescription), + DoseReferenceSequence(), + IonToleranceTableSequence(), + PatientSetupSequence(), + FractionGroupSequence(), + IonBeamSequence(), + ApprovalStatus(DCM_ApprovalStatus), + ReviewDate(DCM_ReviewDate), + ReviewTime(DCM_ReviewTime), + ReviewerName(DCM_ReviewerName), + ReferencedImageSequence(), + ReferencedInstanceSequence(), + DerivationDescription(DCM_DerivationDescription), + DerivationCodeSequence(), + SourceImageSequence(), + SourceInstanceSequence(), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCoercionDateTime(DCM_InstanceCoercionDateTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + RelatedGeneralSOPClassUID(DCM_RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(DCM_OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(), + ContextGroupIdentificationSequence(), + MappingResourceIdentificationSequence(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + ContributingEquipmentSequence(), + SOPInstanceStatus(DCM_SOPInstanceStatus), + SOPAuthorizationDateTime(DCM_SOPAuthorizationDateTime), + SOPAuthorizationComment(DCM_SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(DCM_AuthorizationEquipmentCertificationNumber), + MACParametersSequence(), + DigitalSignaturesSequence(), + EncryptedAttributesSequence(), + OriginalAttributesSequence(), + HL7StructuredDocumentReferenceSequence(), + LongitudinalTemporalInformationModified(DCM_LongitudinalTemporalInformationModified), + QueryRetrieveView(DCM_QueryRetrieveView), + ConversionSourceAttributesSequence(), + ContentQualification(DCM_ContentQualification), + PrivateDataElementCharacteristicsSequence(), + ReferencedSeriesSequence(), + StudiesContainingOtherReferencedInstancesSequence() +{ + /* set initial values for a new SOP instance */ + updateAttributes(); +} + + +DRTIonPlanIOD::DRTIonPlanIOD(const DRTIonPlanIOD ©) + : PatientName(copy.PatientName), + PatientID(copy.PatientID), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientBirthDate(copy.PatientBirthDate), + PatientBirthDateInAlternativeCalendar(copy.PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(copy.PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(copy.PatientAlternativeCalendar), + PatientSex(copy.PatientSex), + ReferencedPatientPhotoSequence(copy.ReferencedPatientPhotoSequence), + QualityControlSubject(copy.QualityControlSubject), + ReferencedPatientSequence(copy.ReferencedPatientSequence), + PatientBirthTime(copy.PatientBirthTime), + OtherPatientIDsSequence(copy.OtherPatientIDsSequence), + OtherPatientNames(copy.OtherPatientNames), + EthnicGroup(copy.EthnicGroup), + PatientComments(copy.PatientComments), + PatientSpeciesDescription(copy.PatientSpeciesDescription), + PatientSpeciesCodeSequence(copy.PatientSpeciesCodeSequence), + PatientBreedDescription(copy.PatientBreedDescription), + PatientBreedCodeSequence(copy.PatientBreedCodeSequence), + BreedRegistrationSequence(copy.BreedRegistrationSequence), + StrainDescription(copy.StrainDescription), + StrainNomenclature(copy.StrainNomenclature), + StrainCodeSequence(copy.StrainCodeSequence), + StrainAdditionalInformation(copy.StrainAdditionalInformation), + StrainStockSequence(copy.StrainStockSequence), + GeneticModificationsSequence(copy.GeneticModificationsSequence), + ResponsiblePerson(copy.ResponsiblePerson), + ResponsiblePersonRole(copy.ResponsiblePersonRole), + ResponsibleOrganization(copy.ResponsibleOrganization), + PatientIdentityRemoved(copy.PatientIdentityRemoved), + DeidentificationMethod(copy.DeidentificationMethod), + DeidentificationMethodCodeSequence(copy.DeidentificationMethodCodeSequence), + SourcePatientGroupIdentificationSequence(copy.SourcePatientGroupIdentificationSequence), + GroupOfPatientsIdentificationSequence(copy.GroupOfPatientsIdentificationSequence), + ClinicalTrialSponsorName(copy.ClinicalTrialSponsorName), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ClinicalTrialProtocolName(copy.ClinicalTrialProtocolName), + ClinicalTrialSiteID(copy.ClinicalTrialSiteID), + ClinicalTrialSiteName(copy.ClinicalTrialSiteName), + ClinicalTrialSubjectID(copy.ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(copy.ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(copy.ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(copy.StudyInstanceUID), + StudyDate(copy.StudyDate), + StudyTime(copy.StudyTime), + ReferringPhysicianName(copy.ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(copy.ReferringPhysicianIdentificationSequence), + ConsultingPhysicianName(copy.ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(copy.ConsultingPhysicianIdentificationSequence), + StudyID(copy.StudyID), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + StudyDescription(copy.StudyDescription), + PhysiciansOfRecord(copy.PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(copy.PhysiciansOfRecordIdentificationSequence), + NameOfPhysiciansReadingStudy(copy.NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(copy.PhysiciansReadingStudyIdentificationSequence), + RequestingServiceCodeSequence(copy.RequestingServiceCodeSequence), + ReferencedStudySequence(copy.ReferencedStudySequence), + ProcedureCodeSequence(copy.ProcedureCodeSequence), + ReasonForPerformedProcedureCodeSequence(copy.ReasonForPerformedProcedureCodeSequence), + AdmittingDiagnosesDescription(copy.AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(copy.AdmittingDiagnosesCodeSequence), + PatientAge(copy.PatientAge), + PatientSize(copy.PatientSize), + PatientWeight(copy.PatientWeight), + PatientBodyMassIndex(copy.PatientBodyMassIndex), + MeasuredAPDimension(copy.MeasuredAPDimension), + MeasuredLateralDimension(copy.MeasuredLateralDimension), + PatientSizeCodeSequence(copy.PatientSizeCodeSequence), + MedicalAlerts(copy.MedicalAlerts), + Allergies(copy.Allergies), + SmokingStatus(copy.SmokingStatus), + PregnancyStatus(copy.PregnancyStatus), + LastMenstrualDate(copy.LastMenstrualDate), + PatientState(copy.PatientState), + Occupation(copy.Occupation), + AdditionalPatientHistory(copy.AdditionalPatientHistory), + AdmissionID(copy.AdmissionID), + IssuerOfAdmissionIDSequence(copy.IssuerOfAdmissionIDSequence), + ServiceEpisodeID(copy.ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(copy.IssuerOfServiceEpisodeIDSequence), + ServiceEpisodeDescription(copy.ServiceEpisodeDescription), + PatientSexNeutered(copy.PatientSexNeutered), + ClinicalTrialTimePointID(copy.ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(copy.ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(copy.LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(copy.LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(copy.ConsentForClinicalTrialUseSequence), + Modality(copy.Modality), + SeriesInstanceUID(copy.SeriesInstanceUID), + SeriesNumber(copy.SeriesNumber), + SeriesDate(copy.SeriesDate), + SeriesTime(copy.SeriesTime), + SeriesDescription(copy.SeriesDescription), + SeriesDescriptionCodeSequence(copy.SeriesDescriptionCodeSequence), + OperatorsName(copy.OperatorsName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + ReferencedPerformedProcedureStepSequence(copy.ReferencedPerformedProcedureStepSequence), + RequestAttributesSequence(copy.RequestAttributesSequence), + PerformedProcedureStepID(copy.PerformedProcedureStepID), + PerformedProcedureStepStartDate(copy.PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(copy.PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(copy.PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(copy.PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(copy.PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(copy.PerformedProtocolCodeSequence), + CommentsOnThePerformedProcedureStep(copy.CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(copy.ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(copy.ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(copy.ClinicalTrialSeriesDescription), + FrameOfReferenceUID(copy.FrameOfReferenceUID), + PositionReferenceIndicator(copy.PositionReferenceIndicator), + Manufacturer(copy.Manufacturer), + InstitutionName(copy.InstitutionName), + InstitutionAddress(copy.InstitutionAddress), + StationName(copy.StationName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + ManufacturerModelName(copy.ManufacturerModelName), + DeviceSerialNumber(copy.DeviceSerialNumber), + SoftwareVersions(copy.SoftwareVersions), + GantryID(copy.GantryID), + UDISequence(copy.UDISequence), + SpatialResolution(copy.SpatialResolution), + DateOfLastCalibration(copy.DateOfLastCalibration), + TimeOfLastCalibration(copy.TimeOfLastCalibration), + PixelPaddingValue(copy.PixelPaddingValue), + RTPlanLabel(copy.RTPlanLabel), + RTPlanName(copy.RTPlanName), + RTPlanDescription(copy.RTPlanDescription), + InstanceNumber(copy.InstanceNumber), + RTPlanDate(copy.RTPlanDate), + RTPlanTime(copy.RTPlanTime), + TreatmentProtocols(copy.TreatmentProtocols), + PlanIntent(copy.PlanIntent), + TreatmentSites(copy.TreatmentSites), + RTPlanGeometry(copy.RTPlanGeometry), + ReferencedStructureSetSequence(copy.ReferencedStructureSetSequence), + ReferencedDoseSequence(copy.ReferencedDoseSequence), + ReferencedRTPlanSequence(copy.ReferencedRTPlanSequence), + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(copy.FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix), + PrescriptionDescription(copy.PrescriptionDescription), + DoseReferenceSequence(copy.DoseReferenceSequence), + IonToleranceTableSequence(copy.IonToleranceTableSequence), + PatientSetupSequence(copy.PatientSetupSequence), + FractionGroupSequence(copy.FractionGroupSequence), + IonBeamSequence(copy.IonBeamSequence), + ApprovalStatus(copy.ApprovalStatus), + ReviewDate(copy.ReviewDate), + ReviewTime(copy.ReviewTime), + ReviewerName(copy.ReviewerName), + ReferencedImageSequence(copy.ReferencedImageSequence), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + DerivationDescription(copy.DerivationDescription), + DerivationCodeSequence(copy.DerivationCodeSequence), + SourceImageSequence(copy.SourceImageSequence), + SourceInstanceSequence(copy.SourceInstanceSequence), + SOPClassUID(copy.SOPClassUID), + SOPInstanceUID(copy.SOPInstanceUID), + SpecificCharacterSet(copy.SpecificCharacterSet), + InstanceCreationDate(copy.InstanceCreationDate), + InstanceCreationTime(copy.InstanceCreationTime), + InstanceCoercionDateTime(copy.InstanceCoercionDateTime), + InstanceCreatorUID(copy.InstanceCreatorUID), + RelatedGeneralSOPClassUID(copy.RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(copy.OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(copy.CodingSchemeIdentificationSequence), + ContextGroupIdentificationSequence(copy.ContextGroupIdentificationSequence), + MappingResourceIdentificationSequence(copy.MappingResourceIdentificationSequence), + TimezoneOffsetFromUTC(copy.TimezoneOffsetFromUTC), + ContributingEquipmentSequence(copy.ContributingEquipmentSequence), + SOPInstanceStatus(copy.SOPInstanceStatus), + SOPAuthorizationDateTime(copy.SOPAuthorizationDateTime), + SOPAuthorizationComment(copy.SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(copy.AuthorizationEquipmentCertificationNumber), + MACParametersSequence(copy.MACParametersSequence), + DigitalSignaturesSequence(copy.DigitalSignaturesSequence), + EncryptedAttributesSequence(copy.EncryptedAttributesSequence), + OriginalAttributesSequence(copy.OriginalAttributesSequence), + HL7StructuredDocumentReferenceSequence(copy.HL7StructuredDocumentReferenceSequence), + LongitudinalTemporalInformationModified(copy.LongitudinalTemporalInformationModified), + QueryRetrieveView(copy.QueryRetrieveView), + ConversionSourceAttributesSequence(copy.ConversionSourceAttributesSequence), + ContentQualification(copy.ContentQualification), + PrivateDataElementCharacteristicsSequence(copy.PrivateDataElementCharacteristicsSequence), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudiesContainingOtherReferencedInstancesSequence(copy.StudiesContainingOtherReferencedInstancesSequence) +{ +} + + +DRTIonPlanIOD::~DRTIonPlanIOD() +{ +} + + +DRTIonPlanIOD &DRTIonPlanIOD::operator=(const DRTIonPlanIOD ©) +{ + if (this != ©) + { + PatientName = copy.PatientName; + PatientID = copy.PatientID; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientBirthDate = copy.PatientBirthDate; + PatientBirthDateInAlternativeCalendar = copy.PatientBirthDateInAlternativeCalendar; + PatientDeathDateInAlternativeCalendar = copy.PatientDeathDateInAlternativeCalendar; + PatientAlternativeCalendar = copy.PatientAlternativeCalendar; + PatientSex = copy.PatientSex; + ReferencedPatientPhotoSequence = copy.ReferencedPatientPhotoSequence; + QualityControlSubject = copy.QualityControlSubject; + ReferencedPatientSequence = copy.ReferencedPatientSequence; + PatientBirthTime = copy.PatientBirthTime; + OtherPatientIDsSequence = copy.OtherPatientIDsSequence; + OtherPatientNames = copy.OtherPatientNames; + EthnicGroup = copy.EthnicGroup; + PatientComments = copy.PatientComments; + PatientSpeciesDescription = copy.PatientSpeciesDescription; + PatientSpeciesCodeSequence = copy.PatientSpeciesCodeSequence; + PatientBreedDescription = copy.PatientBreedDescription; + PatientBreedCodeSequence = copy.PatientBreedCodeSequence; + BreedRegistrationSequence = copy.BreedRegistrationSequence; + StrainDescription = copy.StrainDescription; + StrainNomenclature = copy.StrainNomenclature; + StrainCodeSequence = copy.StrainCodeSequence; + StrainAdditionalInformation = copy.StrainAdditionalInformation; + StrainStockSequence = copy.StrainStockSequence; + GeneticModificationsSequence = copy.GeneticModificationsSequence; + ResponsiblePerson = copy.ResponsiblePerson; + ResponsiblePersonRole = copy.ResponsiblePersonRole; + ResponsibleOrganization = copy.ResponsibleOrganization; + PatientIdentityRemoved = copy.PatientIdentityRemoved; + DeidentificationMethod = copy.DeidentificationMethod; + DeidentificationMethodCodeSequence = copy.DeidentificationMethodCodeSequence; + SourcePatientGroupIdentificationSequence = copy.SourcePatientGroupIdentificationSequence; + GroupOfPatientsIdentificationSequence = copy.GroupOfPatientsIdentificationSequence; + ClinicalTrialSponsorName = copy.ClinicalTrialSponsorName; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ClinicalTrialProtocolName = copy.ClinicalTrialProtocolName; + ClinicalTrialSiteID = copy.ClinicalTrialSiteID; + ClinicalTrialSiteName = copy.ClinicalTrialSiteName; + ClinicalTrialSubjectID = copy.ClinicalTrialSubjectID; + ClinicalTrialSubjectReadingID = copy.ClinicalTrialSubjectReadingID; + ClinicalTrialProtocolEthicsCommitteeName = copy.ClinicalTrialProtocolEthicsCommitteeName; + ClinicalTrialProtocolEthicsCommitteeApprovalNumber = copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + StudyInstanceUID = copy.StudyInstanceUID; + StudyDate = copy.StudyDate; + StudyTime = copy.StudyTime; + ReferringPhysicianName = copy.ReferringPhysicianName; + ReferringPhysicianIdentificationSequence = copy.ReferringPhysicianIdentificationSequence; + ConsultingPhysicianName = copy.ConsultingPhysicianName; + ConsultingPhysicianIdentificationSequence = copy.ConsultingPhysicianIdentificationSequence; + StudyID = copy.StudyID; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + StudyDescription = copy.StudyDescription; + PhysiciansOfRecord = copy.PhysiciansOfRecord; + PhysiciansOfRecordIdentificationSequence = copy.PhysiciansOfRecordIdentificationSequence; + NameOfPhysiciansReadingStudy = copy.NameOfPhysiciansReadingStudy; + PhysiciansReadingStudyIdentificationSequence = copy.PhysiciansReadingStudyIdentificationSequence; + RequestingServiceCodeSequence = copy.RequestingServiceCodeSequence; + ReferencedStudySequence = copy.ReferencedStudySequence; + ProcedureCodeSequence = copy.ProcedureCodeSequence; + ReasonForPerformedProcedureCodeSequence = copy.ReasonForPerformedProcedureCodeSequence; + AdmittingDiagnosesDescription = copy.AdmittingDiagnosesDescription; + AdmittingDiagnosesCodeSequence = copy.AdmittingDiagnosesCodeSequence; + PatientAge = copy.PatientAge; + PatientSize = copy.PatientSize; + PatientWeight = copy.PatientWeight; + PatientBodyMassIndex = copy.PatientBodyMassIndex; + MeasuredAPDimension = copy.MeasuredAPDimension; + MeasuredLateralDimension = copy.MeasuredLateralDimension; + PatientSizeCodeSequence = copy.PatientSizeCodeSequence; + MedicalAlerts = copy.MedicalAlerts; + Allergies = copy.Allergies; + SmokingStatus = copy.SmokingStatus; + PregnancyStatus = copy.PregnancyStatus; + LastMenstrualDate = copy.LastMenstrualDate; + PatientState = copy.PatientState; + Occupation = copy.Occupation; + AdditionalPatientHistory = copy.AdditionalPatientHistory; + AdmissionID = copy.AdmissionID; + IssuerOfAdmissionIDSequence = copy.IssuerOfAdmissionIDSequence; + ServiceEpisodeID = copy.ServiceEpisodeID; + IssuerOfServiceEpisodeIDSequence = copy.IssuerOfServiceEpisodeIDSequence; + ServiceEpisodeDescription = copy.ServiceEpisodeDescription; + PatientSexNeutered = copy.PatientSexNeutered; + ClinicalTrialTimePointID = copy.ClinicalTrialTimePointID; + ClinicalTrialTimePointDescription = copy.ClinicalTrialTimePointDescription; + LongitudinalTemporalOffsetFromEvent = copy.LongitudinalTemporalOffsetFromEvent; + LongitudinalTemporalEventType = copy.LongitudinalTemporalEventType; + ConsentForClinicalTrialUseSequence = copy.ConsentForClinicalTrialUseSequence; + Modality = copy.Modality; + SeriesInstanceUID = copy.SeriesInstanceUID; + SeriesNumber = copy.SeriesNumber; + SeriesDate = copy.SeriesDate; + SeriesTime = copy.SeriesTime; + SeriesDescription = copy.SeriesDescription; + SeriesDescriptionCodeSequence = copy.SeriesDescriptionCodeSequence; + OperatorsName = copy.OperatorsName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + ReferencedPerformedProcedureStepSequence = copy.ReferencedPerformedProcedureStepSequence; + RequestAttributesSequence = copy.RequestAttributesSequence; + PerformedProcedureStepID = copy.PerformedProcedureStepID; + PerformedProcedureStepStartDate = copy.PerformedProcedureStepStartDate; + PerformedProcedureStepStartTime = copy.PerformedProcedureStepStartTime; + PerformedProcedureStepEndDate = copy.PerformedProcedureStepEndDate; + PerformedProcedureStepEndTime = copy.PerformedProcedureStepEndTime; + PerformedProcedureStepDescription = copy.PerformedProcedureStepDescription; + PerformedProtocolCodeSequence = copy.PerformedProtocolCodeSequence; + CommentsOnThePerformedProcedureStep = copy.CommentsOnThePerformedProcedureStep; + ClinicalTrialCoordinatingCenterName = copy.ClinicalTrialCoordinatingCenterName; + ClinicalTrialSeriesID = copy.ClinicalTrialSeriesID; + ClinicalTrialSeriesDescription = copy.ClinicalTrialSeriesDescription; + FrameOfReferenceUID = copy.FrameOfReferenceUID; + PositionReferenceIndicator = copy.PositionReferenceIndicator; + Manufacturer = copy.Manufacturer; + InstitutionName = copy.InstitutionName; + InstitutionAddress = copy.InstitutionAddress; + StationName = copy.StationName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + ManufacturerModelName = copy.ManufacturerModelName; + DeviceSerialNumber = copy.DeviceSerialNumber; + SoftwareVersions = copy.SoftwareVersions; + GantryID = copy.GantryID; + UDISequence = copy.UDISequence; + SpatialResolution = copy.SpatialResolution; + DateOfLastCalibration = copy.DateOfLastCalibration; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + PixelPaddingValue = copy.PixelPaddingValue; + RTPlanLabel = copy.RTPlanLabel; + RTPlanName = copy.RTPlanName; + RTPlanDescription = copy.RTPlanDescription; + InstanceNumber = copy.InstanceNumber; + RTPlanDate = copy.RTPlanDate; + RTPlanTime = copy.RTPlanTime; + TreatmentProtocols = copy.TreatmentProtocols; + PlanIntent = copy.PlanIntent; + TreatmentSites = copy.TreatmentSites; + RTPlanGeometry = copy.RTPlanGeometry; + ReferencedStructureSetSequence = copy.ReferencedStructureSetSequence; + ReferencedDoseSequence = copy.ReferencedDoseSequence; + ReferencedRTPlanSequence = copy.ReferencedRTPlanSequence; + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix = copy.FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix; + PrescriptionDescription = copy.PrescriptionDescription; + DoseReferenceSequence = copy.DoseReferenceSequence; + IonToleranceTableSequence = copy.IonToleranceTableSequence; + PatientSetupSequence = copy.PatientSetupSequence; + FractionGroupSequence = copy.FractionGroupSequence; + IonBeamSequence = copy.IonBeamSequence; + ApprovalStatus = copy.ApprovalStatus; + ReviewDate = copy.ReviewDate; + ReviewTime = copy.ReviewTime; + ReviewerName = copy.ReviewerName; + ReferencedImageSequence = copy.ReferencedImageSequence; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + DerivationDescription = copy.DerivationDescription; + DerivationCodeSequence = copy.DerivationCodeSequence; + SourceImageSequence = copy.SourceImageSequence; + SourceInstanceSequence = copy.SourceInstanceSequence; + SOPClassUID = copy.SOPClassUID; + SOPInstanceUID = copy.SOPInstanceUID; + SpecificCharacterSet = copy.SpecificCharacterSet; + InstanceCreationDate = copy.InstanceCreationDate; + InstanceCreationTime = copy.InstanceCreationTime; + InstanceCoercionDateTime = copy.InstanceCoercionDateTime; + InstanceCreatorUID = copy.InstanceCreatorUID; + RelatedGeneralSOPClassUID = copy.RelatedGeneralSOPClassUID; + OriginalSpecializedSOPClassUID = copy.OriginalSpecializedSOPClassUID; + CodingSchemeIdentificationSequence = copy.CodingSchemeIdentificationSequence; + ContextGroupIdentificationSequence = copy.ContextGroupIdentificationSequence; + MappingResourceIdentificationSequence = copy.MappingResourceIdentificationSequence; + TimezoneOffsetFromUTC = copy.TimezoneOffsetFromUTC; + ContributingEquipmentSequence = copy.ContributingEquipmentSequence; + SOPInstanceStatus = copy.SOPInstanceStatus; + SOPAuthorizationDateTime = copy.SOPAuthorizationDateTime; + SOPAuthorizationComment = copy.SOPAuthorizationComment; + AuthorizationEquipmentCertificationNumber = copy.AuthorizationEquipmentCertificationNumber; + MACParametersSequence = copy.MACParametersSequence; + DigitalSignaturesSequence = copy.DigitalSignaturesSequence; + EncryptedAttributesSequence = copy.EncryptedAttributesSequence; + OriginalAttributesSequence = copy.OriginalAttributesSequence; + HL7StructuredDocumentReferenceSequence = copy.HL7StructuredDocumentReferenceSequence; + LongitudinalTemporalInformationModified = copy.LongitudinalTemporalInformationModified; + QueryRetrieveView = copy.QueryRetrieveView; + ConversionSourceAttributesSequence = copy.ConversionSourceAttributesSequence; + ContentQualification = copy.ContentQualification; + PrivateDataElementCharacteristicsSequence = copy.PrivateDataElementCharacteristicsSequence; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudiesContainingOtherReferencedInstancesSequence = copy.StudiesContainingOtherReferencedInstancesSequence; + } + return *this; +} + + +void DRTIonPlanIOD::clear() +{ + /* clear all DICOM attributes */ + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + PatientBirthDate.clear(); + PatientBirthDateInAlternativeCalendar.clear(); + PatientDeathDateInAlternativeCalendar.clear(); + PatientAlternativeCalendar.clear(); + PatientSex.clear(); + ReferencedPatientPhotoSequence.clear(); + QualityControlSubject.clear(); + ReferencedPatientSequence.clear(); + PatientBirthTime.clear(); + OtherPatientIDsSequence.clear(); + OtherPatientNames.clear(); + EthnicGroup.clear(); + PatientComments.clear(); + PatientSpeciesDescription.clear(); + PatientSpeciesCodeSequence.clear(); + PatientBreedDescription.clear(); + PatientBreedCodeSequence.clear(); + BreedRegistrationSequence.clear(); + StrainDescription.clear(); + StrainNomenclature.clear(); + StrainCodeSequence.clear(); + StrainAdditionalInformation.clear(); + StrainStockSequence.clear(); + GeneticModificationsSequence.clear(); + ResponsiblePerson.clear(); + ResponsiblePersonRole.clear(); + ResponsibleOrganization.clear(); + PatientIdentityRemoved.clear(); + DeidentificationMethod.clear(); + DeidentificationMethodCodeSequence.clear(); + SourcePatientGroupIdentificationSequence.clear(); + GroupOfPatientsIdentificationSequence.clear(); + ClinicalTrialSponsorName.clear(); + ClinicalTrialProtocolID.clear(); + ClinicalTrialProtocolName.clear(); + ClinicalTrialSiteID.clear(); + ClinicalTrialSiteName.clear(); + ClinicalTrialSubjectID.clear(); + ClinicalTrialSubjectReadingID.clear(); + ClinicalTrialProtocolEthicsCommitteeName.clear(); + ClinicalTrialProtocolEthicsCommitteeApprovalNumber.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + ReferringPhysicianIdentificationSequence.clear(); + ConsultingPhysicianName.clear(); + ConsultingPhysicianIdentificationSequence.clear(); + StudyID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyDescription.clear(); + PhysiciansOfRecord.clear(); + PhysiciansOfRecordIdentificationSequence.clear(); + NameOfPhysiciansReadingStudy.clear(); + PhysiciansReadingStudyIdentificationSequence.clear(); + RequestingServiceCodeSequence.clear(); + ReferencedStudySequence.clear(); + ProcedureCodeSequence.clear(); + ReasonForPerformedProcedureCodeSequence.clear(); + AdmittingDiagnosesDescription.clear(); + AdmittingDiagnosesCodeSequence.clear(); + PatientAge.clear(); + PatientSize.clear(); + PatientWeight.clear(); + PatientBodyMassIndex.clear(); + MeasuredAPDimension.clear(); + MeasuredLateralDimension.clear(); + PatientSizeCodeSequence.clear(); + MedicalAlerts.clear(); + Allergies.clear(); + SmokingStatus.clear(); + PregnancyStatus.clear(); + LastMenstrualDate.clear(); + PatientState.clear(); + Occupation.clear(); + AdditionalPatientHistory.clear(); + AdmissionID.clear(); + IssuerOfAdmissionIDSequence.clear(); + ServiceEpisodeID.clear(); + IssuerOfServiceEpisodeIDSequence.clear(); + ServiceEpisodeDescription.clear(); + PatientSexNeutered.clear(); + ClinicalTrialTimePointID.clear(); + ClinicalTrialTimePointDescription.clear(); + LongitudinalTemporalOffsetFromEvent.clear(); + LongitudinalTemporalEventType.clear(); + ConsentForClinicalTrialUseSequence.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + SeriesDescriptionCodeSequence.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ReferencedPerformedProcedureStepSequence.clear(); + RequestAttributesSequence.clear(); + PerformedProcedureStepID.clear(); + PerformedProcedureStepStartDate.clear(); + PerformedProcedureStepStartTime.clear(); + PerformedProcedureStepEndDate.clear(); + PerformedProcedureStepEndTime.clear(); + PerformedProcedureStepDescription.clear(); + PerformedProtocolCodeSequence.clear(); + CommentsOnThePerformedProcedureStep.clear(); + ClinicalTrialCoordinatingCenterName.clear(); + ClinicalTrialSeriesID.clear(); + ClinicalTrialSeriesDescription.clear(); + FrameOfReferenceUID.clear(); + PositionReferenceIndicator.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + GantryID.clear(); + UDISequence.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + PixelPaddingValue.clear(); + RTPlanLabel.clear(); + RTPlanName.clear(); + RTPlanDescription.clear(); + InstanceNumber.clear(); + RTPlanDate.clear(); + RTPlanTime.clear(); + TreatmentProtocols.clear(); + PlanIntent.clear(); + TreatmentSites.clear(); + RTPlanGeometry.clear(); + ReferencedStructureSetSequence.clear(); + ReferencedDoseSequence.clear(); + ReferencedRTPlanSequence.clear(); + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix.clear(); + PrescriptionDescription.clear(); + DoseReferenceSequence.clear(); + IonToleranceTableSequence.clear(); + PatientSetupSequence.clear(); + FractionGroupSequence.clear(); + IonBeamSequence.clear(); + ApprovalStatus.clear(); + ReviewDate.clear(); + ReviewTime.clear(); + ReviewerName.clear(); + ReferencedImageSequence.clear(); + ReferencedInstanceSequence.clear(); + DerivationDescription.clear(); + DerivationCodeSequence.clear(); + SourceImageSequence.clear(); + SourceInstanceSequence.clear(); + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCoercionDateTime.clear(); + InstanceCreatorUID.clear(); + RelatedGeneralSOPClassUID.clear(); + OriginalSpecializedSOPClassUID.clear(); + CodingSchemeIdentificationSequence.clear(); + ContextGroupIdentificationSequence.clear(); + MappingResourceIdentificationSequence.clear(); + TimezoneOffsetFromUTC.clear(); + ContributingEquipmentSequence.clear(); + SOPInstanceStatus.clear(); + SOPAuthorizationDateTime.clear(); + SOPAuthorizationComment.clear(); + AuthorizationEquipmentCertificationNumber.clear(); + MACParametersSequence.clear(); + DigitalSignaturesSequence.clear(); + EncryptedAttributesSequence.clear(); + OriginalAttributesSequence.clear(); + HL7StructuredDocumentReferenceSequence.clear(); + LongitudinalTemporalInformationModified.clear(); + QueryRetrieveView.clear(); + ConversionSourceAttributesSequence.clear(); + ContentQualification.clear(); + PrivateDataElementCharacteristicsSequence.clear(); + ReferencedSeriesSequence.clear(); + StudiesContainingOtherReferencedInstancesSequence.clear(); +} + + +OFBool DRTIonPlanIOD::isValid() +{ + /* tbd: check whether object is valid */ + return OFTrue; +} + + +OFCondition DRTIonPlanIOD::checkDatasetForReading(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* check SOP class UID */ + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + OFString tmpString; + getStringValueFromElement(sopClassUID, tmpString); + if (tmpString != UID_RTIonPlanStorage) + { + DCMRT_ERROR("Invalid value for attribute SOPClassUID (0008,0016)"); + result = RT_EC_InvalidValue; + } + } + return result; +} + + +void DRTIonPlanIOD::updateAttributes() +{ + SOPClassUID.putString(UID_RTIonPlanStorage); +} + + +OFCondition DRTIonPlanIOD::read(DcmItem &dataset) +{ + /* re-initialize object */ + clear(); + /* check SOP class UID first */ + OFCondition result = checkDatasetForReading(dataset); + /* read data from PatientIE, StudyIE, SeriesIE */ + if (result.good()) + result = readSeriesData(dataset); + if (result.good()) + { + // --- FrameOfReferenceModule (M) --- + getAndCheckElementFromDataset(dataset, FrameOfReferenceUID, "1", "1", "FrameOfReferenceModule"); + getAndCheckElementFromDataset(dataset, PositionReferenceIndicator, "1", "2", "FrameOfReferenceModule"); + + // --- GeneralEquipmentModule (M) --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionAddress, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, StationName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionalDepartmentName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, GantryID, "1", "3", "GeneralEquipmentModule"); + UDISequence.read(dataset, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SpatialResolution, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DateOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, TimeOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingValue, "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralPlanModule (M) --- + getAndCheckElementFromDataset(dataset, RTPlanLabel, "1", "1", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanName, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanDescription, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanDate, "1", "2", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanTime, "1", "2", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, TreatmentProtocols, "1-n", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, PlanIntent, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, TreatmentSites, "1-n", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanGeometry, "1", "1", "RTGeneralPlanModule"); + ReferencedStructureSetSequence.read(dataset, "1-n", "1C", "RTGeneralPlanModule"); + ReferencedDoseSequence.read(dataset, "1-n", "3", "RTGeneralPlanModule"); + ReferencedRTPlanSequence.read(dataset, "1-n", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix, "16", "3", "RTGeneralPlanModule"); + + // --- RTPrescriptionModule (U) --- + getAndCheckElementFromDataset(dataset, PrescriptionDescription, "1", "3", "RTPrescriptionModule"); + DoseReferenceSequence.read(dataset, "1-n", "3", "RTPrescriptionModule"); + + // --- RTIonToleranceTablesModule (U) --- + if (dataset.tagExists(DCM_IonToleranceTableSequence)) + { + IonToleranceTableSequence.read(dataset, "1-n", "1", "RTIonToleranceTablesModule"); + } + + // --- RTPatientSetupModule (U) --- + if (dataset.tagExists(DCM_PatientSetupSequence)) + { + PatientSetupSequence.read(dataset, "1-n", "1", "RTPatientSetupModule"); + } + + // --- RTFractionSchemeModule (U) --- + if (dataset.tagExists(DCM_FractionGroupSequence)) + { + FractionGroupSequence.read(dataset, "1-n", "1", "RTFractionSchemeModule"); + } + + // --- RTIonBeamsModule (C) --- + if (dataset.tagExists(DCM_IonBeamSequence)) + { + IonBeamSequence.read(dataset, "1-n", "1", "RTIonBeamsModule"); + } + + // --- ApprovalModule (U) --- + if (dataset.tagExists(DCM_ApprovalStatus)) + { + getAndCheckElementFromDataset(dataset, ApprovalStatus, "1", "1", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewDate, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewTime, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewerName, "1", "2C", "ApprovalModule"); + } + + // --- GeneralReferenceModule (U) --- + ReferencedImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + ReferencedInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + getAndCheckElementFromDataset(dataset, DerivationDescription, "1", "3", "GeneralReferenceModule"); + DerivationCodeSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + + // --- SOPCommonModule (M) --- + getAndCheckElementFromDataset(dataset, SOPClassUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCoercionDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, RelatedGeneralSOPClassUID, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, OriginalSpecializedSOPClassUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + ContextGroupIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + MappingResourceIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + ContributingEquipmentSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceStatus, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationComment, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, AuthorizationEquipmentCertificationNumber, "1", "3", "SOPCommonModule"); + MACParametersSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + DigitalSignaturesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + EncryptedAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + OriginalAttributesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + HL7StructuredDocumentReferenceSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalInformationModified, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, QueryRetrieveView, "1", "1C", "SOPCommonModule"); + ConversionSourceAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, ContentQualification, "1", "3", "SOPCommonModule"); + PrivateDataElementCharacteristicsSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + ReferencedSeriesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + StudiesContainingOtherReferencedInstancesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + } + return result; +} + + +OFCondition DRTIonPlanIOD::readPatientData(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + + // --- PatientModule (M) --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + IssuerOfPatientIDQualifiersSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientDeathDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientAlternativeCalendar, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + ReferencedPatientPhotoSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, QualityControlSubject, "1", "3", "PatientModule"); + ReferencedPatientSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthTime, "1", "3", "PatientModule"); + OtherPatientIDsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, OtherPatientNames, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, EthnicGroup, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientComments, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSpeciesDescription, "1", "1C", "PatientModule"); + PatientSpeciesCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBreedDescription, "1", "2C", "PatientModule"); + PatientBreedCodeSequence.read(dataset, "1-n", "2C", "PatientModule"); + BreedRegistrationSequence.read(dataset, "1-n", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainDescription, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainNomenclature, "1", "3", "PatientModule"); + StrainCodeSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainAdditionalInformation, "1", "3", "PatientModule"); + StrainStockSequence.read(dataset, "1-n", "3", "PatientModule"); + GeneticModificationsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePerson, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePersonRole, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsibleOrganization, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientIdentityRemoved, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, DeidentificationMethod, "1-n", "1C", "PatientModule"); + DeidentificationMethodCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + SourcePatientGroupIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + GroupOfPatientsIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialSponsorName) || + dataset.tagExists(DCM_ClinicalTrialProtocolID) || + dataset.tagExists(DCM_ClinicalTrialProtocolName) || + dataset.tagExists(DCM_ClinicalTrialSiteID) || + dataset.tagExists(DCM_ClinicalTrialSiteName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialSponsorName, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolID, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteID, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectReadingID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeName, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeApprovalNumber, "1", "3", "ClinicalTrialSubjectModule"); + } + return result; +} + + +OFCondition DRTIonPlanIOD::readStudyData(DcmItem &dataset) +{ + /* read data from PatientIE */ + OFCondition result = readPatientData(dataset); + if (result.good()) + { + // --- GeneralStudyModule (M) --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + ReferringPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ConsultingPhysicianName, "1-n", "3", "GeneralStudyModule"); + ConsultingPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + IssuerOfAccessionNumberSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, PhysiciansOfRecord, "1-n", "3", "GeneralStudyModule"); + PhysiciansOfRecordIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, NameOfPhysiciansReadingStudy, "1-n", "3", "GeneralStudyModule"); + PhysiciansReadingStudyIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + RequestingServiceCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReferencedStudySequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReasonForPerformedProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + getAndCheckElementFromDataset(dataset, AdmittingDiagnosesDescription, "1-n", "3", "PatientStudyModule"); + AdmittingDiagnosesCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientAge, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSize, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientWeight, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientBodyMassIndex, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredAPDimension, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredLateralDimension, "1", "3", "PatientStudyModule"); + PatientSizeCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MedicalAlerts, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Allergies, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, SmokingStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PregnancyStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, LastMenstrualDate, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientState, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Occupation, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdditionalPatientHistory, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdmissionID, "1", "3", "PatientStudyModule"); + IssuerOfAdmissionIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeID, "1", "3", "PatientStudyModule"); + IssuerOfServiceEpisodeIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeDescription, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSexNeutered, "1", "2C", "PatientStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialTimePointID)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointID, "1", "2", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointDescription, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalOffsetFromEvent, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalEventType, "1", "1C", "ClinicalTrialStudyModule"); + ConsentForClinicalTrialUseSequence.read(dataset, "1-n", "3", "ClinicalTrialStudyModule"); + } + } + return result; +} + + +OFCondition DRTIonPlanIOD::readSeriesData(DcmItem &dataset) +{ + /* read data from PatientIE, StudyIE */ + OFCondition result = readStudyData(dataset); + if (result.good()) + { + // --- RTSeriesModule (M) --- + getAndCheckElementFromDataset(dataset, Modality, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "2", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "RTSeriesModule"); + SeriesDescriptionCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, OperatorsName, "1-n", "2", "RTSeriesModule"); + OperatorIdentificationSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + ReferencedPerformedProcedureStepSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + RequestAttributesSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepID, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepDescription, "1", "3", "RTSeriesModule"); + PerformedProtocolCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, CommentsOnThePerformedProcedureStep, "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialCoordinatingCenterName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialCoordinatingCenterName, "1", "2", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesID, "1", "3", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesDescription, "1", "3", "ClinicalTrialSeriesModule"); + } + } + return result; +} + + +OFCondition DRTIonPlanIOD::write(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* only write valid objects */ + if (isValid()) + { + /* update various DICOM attributes */ + updateAttributes(); + + // --- PatientModule (M) --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBirthDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientDeathDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientAlternativeCalendar), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + if (result.good()) result = ReferencedPatientPhotoSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlSubject), "1", "3", "PatientModule"); + if (result.good()) result = ReferencedPatientSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmTime(PatientBirthTime), "1", "3", "PatientModule"); + if (result.good()) result = OtherPatientIDsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(OtherPatientNames), "1-n", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmShortString(EthnicGroup), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongText(PatientComments), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientSpeciesDescription), "1", "1C", "PatientModule"); + if (result.good()) result = PatientSpeciesCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBreedDescription), "1", "2C", "PatientModule"); + if (result.good()) result = PatientBreedCodeSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + if (result.good()) result = BreedRegistrationSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedCharacters(StrainDescription), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(StrainNomenclature), "1", "3", "PatientModule"); + if (result.good()) result = StrainCodeSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedText(StrainAdditionalInformation), "1", "3", "PatientModule"); + if (result.good()) result = StrainStockSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GeneticModificationsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(ResponsiblePerson), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(ResponsiblePersonRole), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(ResponsibleOrganization), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientIdentityRemoved), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(DeidentificationMethod), "1-n", "1C", "PatientModule"); + if (result.good()) result = DeidentificationMethodCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + if (result.good()) result = SourcePatientGroupIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GroupOfPatientsIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (isClinicalTrialSubjectModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSponsorName), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolID), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteID), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectReadingID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeName), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeApprovalNumber), "1", "3", "ClinicalTrialSubjectModule"); + } + + // --- GeneralStudyModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + if (result.good()) result = ReferringPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ConsultingPhysicianName), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = ConsultingPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(PhysiciansOfRecord), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansOfRecordIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(NameOfPhysiciansReadingStudy), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansReadingStudyIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = RequestingServiceCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReferencedStudySequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReasonForPerformedProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + if (isPatientStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(AdmittingDiagnosesDescription), "1-n", "3", "PatientStudyModule"); + if (result.good()) result = AdmittingDiagnosesCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmAgeString(PatientAge), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSize), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientWeight), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientBodyMassIndex), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredAPDimension), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredLateralDimension), "1", "3", "PatientStudyModule"); + if (result.good()) result = PatientSizeCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(MedicalAlerts), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(Allergies), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(SmokingStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PregnancyStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDate(LastMenstrualDate), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientState), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(Occupation), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongText(AdditionalPatientHistory), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(AdmissionID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfAdmissionIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfServiceEpisodeIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeDescription), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSexNeutered), "1", "2C", "PatientStudyModule"); + } + + // --- ClinicalTrialStudyModule (U) --- + if (isClinicalTrialStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialTimePointID), "1", "2", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmShortText(ClinicalTrialTimePointDescription), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(LongitudinalTemporalOffsetFromEvent), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalEventType), "1", "1C", "ClinicalTrialStudyModule"); + if (result.good()) result = ConsentForClinicalTrialUseSequence.write(dataset, "1-n" ,"3", "ClinicalTrialStudyModule"); + } + + // --- RTSeriesModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "2", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = SeriesDescriptionCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmPersonName(OperatorsName), "1-n", "2", "RTSeriesModule"); + if (result.good()) result = OperatorIdentificationSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = ReferencedPerformedProcedureStepSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = RequestAttributesSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortString(PerformedProcedureStepID), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepStartDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepStartTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepEndDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepEndTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(PerformedProcedureStepDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = PerformedProtocolCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortText(CommentsOnThePerformedProcedureStep), "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (isClinicalTrialSeriesModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialCoordinatingCenterName), "1", "2", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesID), "1", "3", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesDescription), "1", "3", "ClinicalTrialSeriesModule"); + } + + // --- FrameOfReferenceModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(FrameOfReferenceUID), "1", "1", "FrameOfReferenceModule"); + addElementToDataset(result, dataset, new DcmLongString(PositionReferenceIndicator), "1", "2", "FrameOfReferenceModule"); + + // --- GeneralEquipmentModule (M) --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortText(InstitutionAddress), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortString(StationName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionalDepartmentName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(GantryID), "1", "3", "GeneralEquipmentModule"); + if (result.good()) result = UDISequence.write(dataset, "1-n" ,"3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SpatialResolution), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDate(DateOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmTime(TimeOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingValue), "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralPlanModule (M) --- + addElementToDataset(result, dataset, new DcmShortString(RTPlanLabel), "1", "1", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmLongString(RTPlanName), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmShortText(RTPlanDescription), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmDate(RTPlanDate), "1", "2", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmTime(RTPlanTime), "1", "2", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmLongString(TreatmentProtocols), "1-n", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmCodeString(PlanIntent), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmLongString(TreatmentSites), "1-n", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmCodeString(RTPlanGeometry), "1", "1", "RTGeneralPlanModule"); + if (result.good()) result = ReferencedStructureSetSequence.write(dataset, "1-n" ,"1C", "RTGeneralPlanModule"); + if (result.good()) result = ReferencedDoseSequence.write(dataset, "1-n" ,"3", "RTGeneralPlanModule"); + if (result.good()) result = ReferencedRTPlanSequence.write(dataset, "1-n" ,"3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix), "16", "3", "RTGeneralPlanModule"); + + // --- RTPrescriptionModule (U) --- + if (isRTPrescriptionModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmShortText(PrescriptionDescription), "1", "3", "RTPrescriptionModule"); + if (result.good()) result = DoseReferenceSequence.write(dataset, "1-n" ,"3", "RTPrescriptionModule"); + } + + // --- RTIonToleranceTablesModule (U) --- + if (isRTIonToleranceTablesModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = IonToleranceTableSequence.write(dataset, "1-n" ,"1", "RTIonToleranceTablesModule"); + } + + // --- RTPatientSetupModule (U) --- + if (isRTPatientSetupModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = PatientSetupSequence.write(dataset, "1-n" ,"1", "RTPatientSetupModule"); + } + + // --- RTFractionSchemeModule (U) --- + if (isRTFractionSchemeModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = FractionGroupSequence.write(dataset, "1-n" ,"1", "RTFractionSchemeModule"); + } + + // --- RTIonBeamsModule (C) --- + if (isRTIonBeamsModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = IonBeamSequence.write(dataset, "1-n" ,"1", "RTIonBeamsModule"); + } + + // --- ApprovalModule (U) --- + if (isApprovalModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmCodeString(ApprovalStatus), "1", "1", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmDate(ReviewDate), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmTime(ReviewTime), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReviewerName), "1", "2C", "ApprovalModule"); + } + + // --- GeneralReferenceModule (U) --- + if (isGeneralReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = ReferencedInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + addElementToDataset(result, dataset, new DcmShortText(DerivationDescription), "1", "3", "GeneralReferenceModule"); + if (result.good()) result = DerivationCodeSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + } + + // --- SOPCommonModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(InstanceCoercionDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(RelatedGeneralSOPClassUID), "1-n", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(OriginalSpecializedSOPClassUID), "1", "3", "SOPCommonModule"); + if (result.good()) result = CodingSchemeIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = ContextGroupIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = MappingResourceIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + if (result.good()) result = ContributingEquipmentSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SOPInstanceStatus), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(SOPAuthorizationDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongText(SOPAuthorizationComment), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongString(AuthorizationEquipmentCertificationNumber), "1", "3", "SOPCommonModule"); + if (result.good()) result = MACParametersSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = DigitalSignaturesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = EncryptedAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + if (result.good()) result = OriginalAttributesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = HL7StructuredDocumentReferenceSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalInformationModified), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(QueryRetrieveView), "1", "1C", "SOPCommonModule"); + if (result.good()) result = ConversionSourceAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContentQualification), "1", "3", "SOPCommonModule"); + if (result.good()) result = PrivateDataElementCharacteristicsSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + if (isCommonInstanceReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedSeriesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + if (result.good()) result = StudiesContainingOtherReferencedInstancesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + } + } else + result = RT_EC_InvalidObject; + return result; +} + + +OFBool DRTIonPlanIOD::isClinicalTrialSubjectModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ClinicalTrialSponsorName.isEmpty() && + !ClinicalTrialProtocolID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ClinicalTrialSponsorName.isEmpty() || + !ClinicalTrialProtocolID.isEmpty() || + !ClinicalTrialProtocolName.isEmpty() || + !ClinicalTrialSiteID.isEmpty() || + !ClinicalTrialSiteName.isEmpty() || + !ClinicalTrialSubjectID.isEmpty() || + !ClinicalTrialSubjectReadingID.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeName.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeApprovalNumber.isEmpty(); + } +} + + +OFBool DRTIonPlanIOD::isPatientStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !AdmittingDiagnosesDescription.isEmpty() || + !AdmittingDiagnosesCodeSequence.isEmpty() || + !PatientAge.isEmpty() || + !PatientSize.isEmpty() || + !PatientWeight.isEmpty() || + !PatientBodyMassIndex.isEmpty() || + !MeasuredAPDimension.isEmpty() || + !MeasuredLateralDimension.isEmpty() || + !PatientSizeCodeSequence.isEmpty() || + !MedicalAlerts.isEmpty() || + !Allergies.isEmpty() || + !SmokingStatus.isEmpty() || + !PregnancyStatus.isEmpty() || + !LastMenstrualDate.isEmpty() || + !PatientState.isEmpty() || + !Occupation.isEmpty() || + !AdditionalPatientHistory.isEmpty() || + !AdmissionID.isEmpty() || + !IssuerOfAdmissionIDSequence.isEmpty() || + !ServiceEpisodeID.isEmpty() || + !IssuerOfServiceEpisodeIDSequence.isEmpty() || + !ServiceEpisodeDescription.isEmpty() || + !PatientSexNeutered.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isClinicalTrialStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialTimePointID.isEmpty() || + !ClinicalTrialTimePointDescription.isEmpty() || + !LongitudinalTemporalOffsetFromEvent.isEmpty() || + !LongitudinalTemporalEventType.isEmpty() || + !ConsentForClinicalTrialUseSequence.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isClinicalTrialSeriesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialCoordinatingCenterName.isEmpty() || + !ClinicalTrialSeriesID.isEmpty() || + !ClinicalTrialSeriesDescription.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isRTPrescriptionModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !PrescriptionDescription.isEmpty() || + !DoseReferenceSequence.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isRTIonToleranceTablesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !IonToleranceTableSequence.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isRTPatientSetupModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !PatientSetupSequence.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isRTFractionSchemeModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !FractionGroupSequence.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isRTIonBeamsModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !IonBeamSequence.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isApprovalModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ApprovalStatus.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ApprovalStatus.isEmpty() || + !ReviewDate.isEmpty() || + !ReviewTime.isEmpty() || + !ReviewerName.isEmpty(); + } +} + + +OFBool DRTIonPlanIOD::isGeneralReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedImageSequence.isEmpty() || + !ReferencedInstanceSequence.isEmpty() || + !DerivationDescription.isEmpty() || + !DerivationCodeSequence.isEmpty() || + !SourceImageSequence.isEmpty() || + !SourceInstanceSequence.isEmpty(); +} + + +OFBool DRTIonPlanIOD::isCommonInstanceReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedSeriesSequence.isEmpty() || + !StudiesContainingOtherReferencedInstancesSequence.isEmpty(); +} + + +OFCondition DRTIonPlanIOD::getAccessionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTIonPlanIOD::getAdditionalPatientHistory(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdditionalPatientHistory, value, pos); +} + + +OFCondition DRTIonPlanIOD::getAdmissionID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmissionID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getAdmittingDiagnosesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmittingDiagnosesDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getAllergies(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Allergies, value, pos); +} + + +OFCondition DRTIonPlanIOD::getApprovalStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ApprovalStatus, value, pos); +} + + +OFCondition DRTIonPlanIOD::getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AuthorizationEquipmentCertificationNumber, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialCoordinatingCenterName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeApprovalNumber, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialProtocolName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialSeriesID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialSiteID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialSiteName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialSponsorName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSponsorName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialSubjectID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialSubjectReadingID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectReadingID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialTimePointDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getClinicalTrialTimePointID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CommentsOnThePerformedProcedureStep, value, pos); +} + + +OFCondition DRTIonPlanIOD::getConsultingPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConsultingPhysicianName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getContentQualification(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentQualification, value, pos); +} + + +OFCondition DRTIonPlanIOD::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTIonPlanIOD::getDeidentificationMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeidentificationMethod, value, pos); +} + + +OFCondition DRTIonPlanIOD::getDerivationDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DerivationDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTIonPlanIOD::getEthnicGroup(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EthnicGroup, value, pos); +} + + +OFCondition DRTIonPlanIOD::getFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getFrameOfReferenceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameOfReferenceUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getGantryID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstanceCoercionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCoercionDateTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstanceCreationDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstanceCreationTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstanceCreatorUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstanceNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstanceNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, InstanceNumber).getSint32(value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstitutionAddress(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstitutionName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getLastMenstrualDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LastMenstrualDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getLongitudinalTemporalEventType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalEventType, value, pos); +} + + +OFCondition DRTIonPlanIOD::getLongitudinalTemporalInformationModified(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalInformationModified, value, pos); +} + + +OFCondition DRTIonPlanIOD::getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, LongitudinalTemporalOffsetFromEvent).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getManufacturer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTIonPlanIOD::getManufacturerModelName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getMeasuredAPDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredAPDimension, value, pos); +} + + +OFCondition DRTIonPlanIOD::getMeasuredAPDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredAPDimension).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getMeasuredLateralDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredLateralDimension, value, pos); +} + + +OFCondition DRTIonPlanIOD::getMeasuredLateralDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredLateralDimension).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getMedicalAlerts(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MedicalAlerts, value, pos); +} + + +OFCondition DRTIonPlanIOD::getModality(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DRTIonPlanIOD::getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NameOfPhysiciansReadingStudy, value, pos); +} + + +OFCondition DRTIonPlanIOD::getOccupation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Occupation, value, pos); +} + + +OFCondition DRTIonPlanIOD::getOperatorsName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OriginalSpecializedSOPClassUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getOtherPatientNames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OtherPatientNames, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientAge(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAge, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAlternativeCalendar, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientBirthDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientBirthTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientBodyMassIndex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBodyMassIndex, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientBodyMassIndex(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientBodyMassIndex).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientBreedDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBreedDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientComments, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientDeathDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientIdentityRemoved(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientIdentityRemoved, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientSex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientSexNeutered(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSexNeutered, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientSize(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSize, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientSize(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSize).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientSpeciesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSpeciesDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientState(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientState, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientWeight, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPatientWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientWeight).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getPerformedProcedureStepDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPerformedProcedureStepEndDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPerformedProcedureStepEndTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPerformedProcedureStepID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPerformedProcedureStepStartDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPerformedProcedureStepStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPhysiciansOfRecord(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhysiciansOfRecord, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPixelPaddingValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingValue).getUint16(value, pos); +} + + +OFCondition DRTIonPlanIOD::getPlanIntent(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PlanIntent, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPositionReferenceIndicator(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PositionReferenceIndicator, value, pos); +} + + +OFCondition DRTIonPlanIOD::getPregnancyStatus(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PregnancyStatus).getUint16(value, pos); +} + + +OFCondition DRTIonPlanIOD::getPrescriptionDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PrescriptionDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getQualityControlSubject(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlSubject, value, pos); +} + + +OFCondition DRTIonPlanIOD::getQueryRetrieveView(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QueryRetrieveView, value, pos); +} + + +OFCondition DRTIonPlanIOD::getRTPlanDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getRTPlanDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getRTPlanGeometry(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanGeometry, value, pos); +} + + +OFCondition DRTIonPlanIOD::getRTPlanLabel(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanLabel, value, pos); +} + + +OFCondition DRTIonPlanIOD::getRTPlanName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getRTPlanTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getReferringPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getRelatedGeneralSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RelatedGeneralSOPClassUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getResponsibleOrganization(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsibleOrganization, value, pos); +} + + +OFCondition DRTIonPlanIOD::getResponsiblePerson(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePerson, value, pos); +} + + +OFCondition DRTIonPlanIOD::getResponsiblePersonRole(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePersonRole, value, pos); +} + + +OFCondition DRTIonPlanIOD::getReviewDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getReviewTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getReviewerName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewerName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSOPAuthorizationComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationComment, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSOPAuthorizationDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationDateTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSOPInstanceStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceStatus, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSOPInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSeriesDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSeriesNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSeriesNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, SeriesNumber).getSint32(value, pos); +} + + +OFCondition DRTIonPlanIOD::getSeriesTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getServiceEpisodeDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getServiceEpisodeID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSmokingStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SmokingStatus, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSoftwareVersions(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSpatialResolution(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTIonPlanIOD::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::getSpecificCharacterSet(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStationName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStrainAdditionalInformation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainAdditionalInformation, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStrainDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStrainNomenclature(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainNomenclature, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStudyDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStudyDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStudyID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTIonPlanIOD::getStudyTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DRTIonPlanIOD::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTIonPlanIOD::getTimezoneOffsetFromUTC(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DRTIonPlanIOD::getTreatmentProtocols(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentProtocols, value, pos); +} + + +OFCondition DRTIonPlanIOD::getTreatmentSites(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentSites, value, pos); +} + + +OFCondition DRTIonPlanIOD::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setAdditionalPatientHistory(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = AdditionalPatientHistory.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setAdmissionID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AdmissionID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setAdmittingDiagnosesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AdmittingDiagnosesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setAllergies(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = Allergies.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setApprovalStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApprovalStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AuthorizationEquipmentCertificationNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialCoordinatingCenterName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeApprovalNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialProtocolName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialSeriesID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialSiteID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialSiteName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialSponsorName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSponsorName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialSubjectID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectReadingID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialTimePointDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setClinicalTrialTimePointID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CommentsOnThePerformedProcedureStep.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setConsultingPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ConsultingPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setContentQualification(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentQualification.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setDeidentificationMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DeidentificationMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setDerivationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = DerivationDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setEthnicGroup(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EthnicGroup.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(const Float64 value, const unsigned long pos) +{ + return FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix.putFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::setFrameOfReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameOfReferenceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setGantryID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstanceCoercionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCoercionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstanceCreationDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstanceCreationTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstanceCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreatorUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstanceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setLastMenstrualDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LastMenstrualDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setLongitudinalTemporalEventType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalEventType.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalInformationModified.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos) +{ + return LongitudinalTemporalOffsetFromEvent.putFloat64(value, pos); +} + + +OFCondition DRTIonPlanIOD::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setMeasuredAPDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredAPDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setMeasuredLateralDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredLateralDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setMedicalAlerts(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = MedicalAlerts.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setModality(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Modality.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NameOfPhysiciansReadingStudy.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setOccupation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Occupation.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OriginalSpecializedSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setOtherPatientNames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OtherPatientNames.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientAge(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAge.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientBirthDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientBirthTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientBodyMassIndex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBodyMassIndex.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientBreedDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBreedDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PatientComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientDeathDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientIdentityRemoved(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientIdentityRemoved.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientSex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientSexNeutered(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSexNeutered.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientSize(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSize.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientSpeciesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSpeciesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientState(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientState.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPatientWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPerformedProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPerformedProcedureStepEndDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPerformedProcedureStepEndTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPerformedProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPerformedProcedureStepStartDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPerformedProcedureStepStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPhysiciansOfRecord(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PhysiciansOfRecord.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPixelPaddingValue(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingValue.putUint16(value, pos); +} + + +OFCondition DRTIonPlanIOD::setPlanIntent(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PlanIntent.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPositionReferenceIndicator(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PositionReferenceIndicator.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setPregnancyStatus(const Uint16 value, const unsigned long pos) +{ + return PregnancyStatus.putUint16(value, pos); +} + + +OFCondition DRTIonPlanIOD::setPrescriptionDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PrescriptionDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setQualityControlSubject(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlSubject.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setQueryRetrieveView(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QueryRetrieveView.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setRTPlanDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setRTPlanDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RTPlanDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setRTPlanGeometry(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanGeometry.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setRTPlanLabel(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanLabel.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setRTPlanName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setRTPlanTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setReferringPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RelatedGeneralSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsibleOrganization.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setResponsiblePerson(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePerson.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setResponsiblePersonRole(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePersonRole.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setReviewDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setReviewTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setReviewerName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewerName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSOPAuthorizationComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SOPAuthorizationComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSOPAuthorizationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPAuthorizationDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSOPInstanceStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSeriesDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSeriesNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSeriesTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setServiceEpisodeDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setServiceEpisodeID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSmokingStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SmokingStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setSpecificCharacterSet(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SpecificCharacterSet.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStrainAdditionalInformation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StrainAdditionalInformation.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStrainDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStrainNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainNomenclature.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStudyDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStudyDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStudyID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setStudyTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setTimezoneOffsetFromUTC(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setTreatmentProtocols(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TreatmentProtocols.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonPlanIOD::setTreatmentSites(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TreatmentSites.putOFStringArray(value); + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtiontr.cc b/dcmrt/libsrc/drtiontr.cc new file mode 100644 index 00000000..3b313ddb --- /dev/null +++ b/dcmrt/libsrc/drtiontr.cc @@ -0,0 +1,3403 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonBeamsTreatmentRecordIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drtiontr.h" + + +DRTIonBeamsTreatmentRecordIOD::DRTIonBeamsTreatmentRecordIOD() + : PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(), + PatientBirthDate(DCM_PatientBirthDate), + PatientBirthDateInAlternativeCalendar(DCM_PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(DCM_PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(DCM_PatientAlternativeCalendar), + PatientSex(DCM_PatientSex), + ReferencedPatientPhotoSequence(), + QualityControlSubject(DCM_QualityControlSubject), + ReferencedPatientSequence(), + PatientBirthTime(DCM_PatientBirthTime), + OtherPatientIDsSequence(), + OtherPatientNames(DCM_OtherPatientNames), + EthnicGroup(DCM_EthnicGroup), + PatientComments(DCM_PatientComments), + PatientSpeciesDescription(DCM_PatientSpeciesDescription), + PatientSpeciesCodeSequence(), + PatientBreedDescription(DCM_PatientBreedDescription), + PatientBreedCodeSequence(), + BreedRegistrationSequence(), + StrainDescription(DCM_StrainDescription), + StrainNomenclature(DCM_StrainNomenclature), + StrainCodeSequence(), + StrainAdditionalInformation(DCM_StrainAdditionalInformation), + StrainStockSequence(), + GeneticModificationsSequence(), + ResponsiblePerson(DCM_ResponsiblePerson), + ResponsiblePersonRole(DCM_ResponsiblePersonRole), + ResponsibleOrganization(DCM_ResponsibleOrganization), + PatientIdentityRemoved(DCM_PatientIdentityRemoved), + DeidentificationMethod(DCM_DeidentificationMethod), + DeidentificationMethodCodeSequence(), + SourcePatientGroupIdentificationSequence(), + GroupOfPatientsIdentificationSequence(), + ClinicalTrialSponsorName(DCM_ClinicalTrialSponsorName), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ClinicalTrialProtocolName(DCM_ClinicalTrialProtocolName), + ClinicalTrialSiteID(DCM_ClinicalTrialSiteID), + ClinicalTrialSiteName(DCM_ClinicalTrialSiteName), + ClinicalTrialSubjectID(DCM_ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(DCM_ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(DCM_ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(), + ConsultingPhysicianName(DCM_ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(), + StudyDescription(DCM_StudyDescription), + PhysiciansOfRecord(DCM_PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(), + NameOfPhysiciansReadingStudy(DCM_NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(), + RequestingServiceCodeSequence(), + ReferencedStudySequence(), + ProcedureCodeSequence(), + ReasonForPerformedProcedureCodeSequence(), + ClinicalTrialTimePointID(DCM_ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(DCM_ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(DCM_LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(DCM_LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(), + AdmittingDiagnosesDescription(DCM_AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(), + PatientAge(DCM_PatientAge), + PatientSize(DCM_PatientSize), + PatientWeight(DCM_PatientWeight), + PatientBodyMassIndex(DCM_PatientBodyMassIndex), + MeasuredAPDimension(DCM_MeasuredAPDimension), + MeasuredLateralDimension(DCM_MeasuredLateralDimension), + PatientSizeCodeSequence(), + MedicalAlerts(DCM_MedicalAlerts), + Allergies(DCM_Allergies), + SmokingStatus(DCM_SmokingStatus), + PregnancyStatus(DCM_PregnancyStatus), + LastMenstrualDate(DCM_LastMenstrualDate), + PatientState(DCM_PatientState), + Occupation(DCM_Occupation), + AdditionalPatientHistory(DCM_AdditionalPatientHistory), + AdmissionID(DCM_AdmissionID), + IssuerOfAdmissionIDSequence(), + ServiceEpisodeID(DCM_ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(), + ServiceEpisodeDescription(DCM_ServiceEpisodeDescription), + PatientSexNeutered(DCM_PatientSexNeutered), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + SeriesDescription(DCM_SeriesDescription), + SeriesDescriptionCodeSequence(), + OperatorsName(DCM_OperatorsName), + OperatorIdentificationSequence(), + ReferencedPerformedProcedureStepSequence(), + RequestAttributesSequence(), + PerformedProcedureStepID(DCM_PerformedProcedureStepID), + PerformedProcedureStepStartDate(DCM_PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(DCM_PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(DCM_PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(DCM_PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(DCM_PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(), + CommentsOnThePerformedProcedureStep(DCM_CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(DCM_ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(DCM_ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(DCM_ClinicalTrialSeriesDescription), + Manufacturer(DCM_Manufacturer), + InstitutionName(DCM_InstitutionName), + InstitutionAddress(DCM_InstitutionAddress), + StationName(DCM_StationName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + GantryID(DCM_GantryID), + UDISequence(), + SpatialResolution(DCM_SpatialResolution), + DateOfLastCalibration(DCM_DateOfLastCalibration), + TimeOfLastCalibration(DCM_TimeOfLastCalibration), + PixelPaddingValue(DCM_PixelPaddingValue), + InstanceNumber(DCM_InstanceNumber), + TreatmentDate(DCM_TreatmentDate), + TreatmentTime(DCM_TreatmentTime), + ReferencedRTPlanSequence(), + ReferencedTreatmentRecordSequence(), + PatientSetupSequence(), + TreatmentMachineSequence(), + MeasuredDoseReferenceSequence(), + CalculatedDoseReferenceSequence(), + ReferencedFractionGroupNumber(DCM_ReferencedFractionGroupNumber), + NumberOfFractionsPlanned(DCM_NumberOfFractionsPlanned), + PrimaryDosimeterUnit(DCM_PrimaryDosimeterUnit), + TreatmentSessionIonBeamSequence(), + CurrentTreatmentStatus(DCM_CurrentTreatmentStatus), + TreatmentStatusComment(DCM_TreatmentStatusComment), + FirstTreatmentDate(DCM_FirstTreatmentDate), + MostRecentTreatmentDate(DCM_MostRecentTreatmentDate), + FractionGroupSummarySequence(), + TreatmentSummaryMeasuredDoseReferenceSequence(), + TreatmentSummaryCalculatedDoseReferenceSequence(), + ReferencedImageSequence(), + ReferencedInstanceSequence(), + DerivationDescription(DCM_DerivationDescription), + DerivationCodeSequence(), + SourceImageSequence(), + SourceInstanceSequence(), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCoercionDateTime(DCM_InstanceCoercionDateTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + RelatedGeneralSOPClassUID(DCM_RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(DCM_OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(), + ContextGroupIdentificationSequence(), + MappingResourceIdentificationSequence(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + ContributingEquipmentSequence(), + SOPInstanceStatus(DCM_SOPInstanceStatus), + SOPAuthorizationDateTime(DCM_SOPAuthorizationDateTime), + SOPAuthorizationComment(DCM_SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(DCM_AuthorizationEquipmentCertificationNumber), + MACParametersSequence(), + DigitalSignaturesSequence(), + EncryptedAttributesSequence(), + OriginalAttributesSequence(), + HL7StructuredDocumentReferenceSequence(), + LongitudinalTemporalInformationModified(DCM_LongitudinalTemporalInformationModified), + QueryRetrieveView(DCM_QueryRetrieveView), + ConversionSourceAttributesSequence(), + ContentQualification(DCM_ContentQualification), + PrivateDataElementCharacteristicsSequence(), + ReferencedSeriesSequence(), + StudiesContainingOtherReferencedInstancesSequence() +{ + /* set initial values for a new SOP instance */ + updateAttributes(); +} + + +DRTIonBeamsTreatmentRecordIOD::DRTIonBeamsTreatmentRecordIOD(const DRTIonBeamsTreatmentRecordIOD ©) + : PatientName(copy.PatientName), + PatientID(copy.PatientID), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientBirthDate(copy.PatientBirthDate), + PatientBirthDateInAlternativeCalendar(copy.PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(copy.PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(copy.PatientAlternativeCalendar), + PatientSex(copy.PatientSex), + ReferencedPatientPhotoSequence(copy.ReferencedPatientPhotoSequence), + QualityControlSubject(copy.QualityControlSubject), + ReferencedPatientSequence(copy.ReferencedPatientSequence), + PatientBirthTime(copy.PatientBirthTime), + OtherPatientIDsSequence(copy.OtherPatientIDsSequence), + OtherPatientNames(copy.OtherPatientNames), + EthnicGroup(copy.EthnicGroup), + PatientComments(copy.PatientComments), + PatientSpeciesDescription(copy.PatientSpeciesDescription), + PatientSpeciesCodeSequence(copy.PatientSpeciesCodeSequence), + PatientBreedDescription(copy.PatientBreedDescription), + PatientBreedCodeSequence(copy.PatientBreedCodeSequence), + BreedRegistrationSequence(copy.BreedRegistrationSequence), + StrainDescription(copy.StrainDescription), + StrainNomenclature(copy.StrainNomenclature), + StrainCodeSequence(copy.StrainCodeSequence), + StrainAdditionalInformation(copy.StrainAdditionalInformation), + StrainStockSequence(copy.StrainStockSequence), + GeneticModificationsSequence(copy.GeneticModificationsSequence), + ResponsiblePerson(copy.ResponsiblePerson), + ResponsiblePersonRole(copy.ResponsiblePersonRole), + ResponsibleOrganization(copy.ResponsibleOrganization), + PatientIdentityRemoved(copy.PatientIdentityRemoved), + DeidentificationMethod(copy.DeidentificationMethod), + DeidentificationMethodCodeSequence(copy.DeidentificationMethodCodeSequence), + SourcePatientGroupIdentificationSequence(copy.SourcePatientGroupIdentificationSequence), + GroupOfPatientsIdentificationSequence(copy.GroupOfPatientsIdentificationSequence), + ClinicalTrialSponsorName(copy.ClinicalTrialSponsorName), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ClinicalTrialProtocolName(copy.ClinicalTrialProtocolName), + ClinicalTrialSiteID(copy.ClinicalTrialSiteID), + ClinicalTrialSiteName(copy.ClinicalTrialSiteName), + ClinicalTrialSubjectID(copy.ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(copy.ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(copy.ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(copy.StudyInstanceUID), + StudyDate(copy.StudyDate), + StudyTime(copy.StudyTime), + ReferringPhysicianName(copy.ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(copy.ReferringPhysicianIdentificationSequence), + ConsultingPhysicianName(copy.ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(copy.ConsultingPhysicianIdentificationSequence), + StudyID(copy.StudyID), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + StudyDescription(copy.StudyDescription), + PhysiciansOfRecord(copy.PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(copy.PhysiciansOfRecordIdentificationSequence), + NameOfPhysiciansReadingStudy(copy.NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(copy.PhysiciansReadingStudyIdentificationSequence), + RequestingServiceCodeSequence(copy.RequestingServiceCodeSequence), + ReferencedStudySequence(copy.ReferencedStudySequence), + ProcedureCodeSequence(copy.ProcedureCodeSequence), + ReasonForPerformedProcedureCodeSequence(copy.ReasonForPerformedProcedureCodeSequence), + ClinicalTrialTimePointID(copy.ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(copy.ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(copy.LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(copy.LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(copy.ConsentForClinicalTrialUseSequence), + AdmittingDiagnosesDescription(copy.AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(copy.AdmittingDiagnosesCodeSequence), + PatientAge(copy.PatientAge), + PatientSize(copy.PatientSize), + PatientWeight(copy.PatientWeight), + PatientBodyMassIndex(copy.PatientBodyMassIndex), + MeasuredAPDimension(copy.MeasuredAPDimension), + MeasuredLateralDimension(copy.MeasuredLateralDimension), + PatientSizeCodeSequence(copy.PatientSizeCodeSequence), + MedicalAlerts(copy.MedicalAlerts), + Allergies(copy.Allergies), + SmokingStatus(copy.SmokingStatus), + PregnancyStatus(copy.PregnancyStatus), + LastMenstrualDate(copy.LastMenstrualDate), + PatientState(copy.PatientState), + Occupation(copy.Occupation), + AdditionalPatientHistory(copy.AdditionalPatientHistory), + AdmissionID(copy.AdmissionID), + IssuerOfAdmissionIDSequence(copy.IssuerOfAdmissionIDSequence), + ServiceEpisodeID(copy.ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(copy.IssuerOfServiceEpisodeIDSequence), + ServiceEpisodeDescription(copy.ServiceEpisodeDescription), + PatientSexNeutered(copy.PatientSexNeutered), + Modality(copy.Modality), + SeriesInstanceUID(copy.SeriesInstanceUID), + SeriesNumber(copy.SeriesNumber), + SeriesDate(copy.SeriesDate), + SeriesTime(copy.SeriesTime), + SeriesDescription(copy.SeriesDescription), + SeriesDescriptionCodeSequence(copy.SeriesDescriptionCodeSequence), + OperatorsName(copy.OperatorsName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + ReferencedPerformedProcedureStepSequence(copy.ReferencedPerformedProcedureStepSequence), + RequestAttributesSequence(copy.RequestAttributesSequence), + PerformedProcedureStepID(copy.PerformedProcedureStepID), + PerformedProcedureStepStartDate(copy.PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(copy.PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(copy.PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(copy.PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(copy.PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(copy.PerformedProtocolCodeSequence), + CommentsOnThePerformedProcedureStep(copy.CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(copy.ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(copy.ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(copy.ClinicalTrialSeriesDescription), + Manufacturer(copy.Manufacturer), + InstitutionName(copy.InstitutionName), + InstitutionAddress(copy.InstitutionAddress), + StationName(copy.StationName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + ManufacturerModelName(copy.ManufacturerModelName), + DeviceSerialNumber(copy.DeviceSerialNumber), + SoftwareVersions(copy.SoftwareVersions), + GantryID(copy.GantryID), + UDISequence(copy.UDISequence), + SpatialResolution(copy.SpatialResolution), + DateOfLastCalibration(copy.DateOfLastCalibration), + TimeOfLastCalibration(copy.TimeOfLastCalibration), + PixelPaddingValue(copy.PixelPaddingValue), + InstanceNumber(copy.InstanceNumber), + TreatmentDate(copy.TreatmentDate), + TreatmentTime(copy.TreatmentTime), + ReferencedRTPlanSequence(copy.ReferencedRTPlanSequence), + ReferencedTreatmentRecordSequence(copy.ReferencedTreatmentRecordSequence), + PatientSetupSequence(copy.PatientSetupSequence), + TreatmentMachineSequence(copy.TreatmentMachineSequence), + MeasuredDoseReferenceSequence(copy.MeasuredDoseReferenceSequence), + CalculatedDoseReferenceSequence(copy.CalculatedDoseReferenceSequence), + ReferencedFractionGroupNumber(copy.ReferencedFractionGroupNumber), + NumberOfFractionsPlanned(copy.NumberOfFractionsPlanned), + PrimaryDosimeterUnit(copy.PrimaryDosimeterUnit), + TreatmentSessionIonBeamSequence(copy.TreatmentSessionIonBeamSequence), + CurrentTreatmentStatus(copy.CurrentTreatmentStatus), + TreatmentStatusComment(copy.TreatmentStatusComment), + FirstTreatmentDate(copy.FirstTreatmentDate), + MostRecentTreatmentDate(copy.MostRecentTreatmentDate), + FractionGroupSummarySequence(copy.FractionGroupSummarySequence), + TreatmentSummaryMeasuredDoseReferenceSequence(copy.TreatmentSummaryMeasuredDoseReferenceSequence), + TreatmentSummaryCalculatedDoseReferenceSequence(copy.TreatmentSummaryCalculatedDoseReferenceSequence), + ReferencedImageSequence(copy.ReferencedImageSequence), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + DerivationDescription(copy.DerivationDescription), + DerivationCodeSequence(copy.DerivationCodeSequence), + SourceImageSequence(copy.SourceImageSequence), + SourceInstanceSequence(copy.SourceInstanceSequence), + SOPClassUID(copy.SOPClassUID), + SOPInstanceUID(copy.SOPInstanceUID), + SpecificCharacterSet(copy.SpecificCharacterSet), + InstanceCreationDate(copy.InstanceCreationDate), + InstanceCreationTime(copy.InstanceCreationTime), + InstanceCoercionDateTime(copy.InstanceCoercionDateTime), + InstanceCreatorUID(copy.InstanceCreatorUID), + RelatedGeneralSOPClassUID(copy.RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(copy.OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(copy.CodingSchemeIdentificationSequence), + ContextGroupIdentificationSequence(copy.ContextGroupIdentificationSequence), + MappingResourceIdentificationSequence(copy.MappingResourceIdentificationSequence), + TimezoneOffsetFromUTC(copy.TimezoneOffsetFromUTC), + ContributingEquipmentSequence(copy.ContributingEquipmentSequence), + SOPInstanceStatus(copy.SOPInstanceStatus), + SOPAuthorizationDateTime(copy.SOPAuthorizationDateTime), + SOPAuthorizationComment(copy.SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(copy.AuthorizationEquipmentCertificationNumber), + MACParametersSequence(copy.MACParametersSequence), + DigitalSignaturesSequence(copy.DigitalSignaturesSequence), + EncryptedAttributesSequence(copy.EncryptedAttributesSequence), + OriginalAttributesSequence(copy.OriginalAttributesSequence), + HL7StructuredDocumentReferenceSequence(copy.HL7StructuredDocumentReferenceSequence), + LongitudinalTemporalInformationModified(copy.LongitudinalTemporalInformationModified), + QueryRetrieveView(copy.QueryRetrieveView), + ConversionSourceAttributesSequence(copy.ConversionSourceAttributesSequence), + ContentQualification(copy.ContentQualification), + PrivateDataElementCharacteristicsSequence(copy.PrivateDataElementCharacteristicsSequence), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudiesContainingOtherReferencedInstancesSequence(copy.StudiesContainingOtherReferencedInstancesSequence) +{ +} + + +DRTIonBeamsTreatmentRecordIOD::~DRTIonBeamsTreatmentRecordIOD() +{ +} + + +DRTIonBeamsTreatmentRecordIOD &DRTIonBeamsTreatmentRecordIOD::operator=(const DRTIonBeamsTreatmentRecordIOD ©) +{ + if (this != ©) + { + PatientName = copy.PatientName; + PatientID = copy.PatientID; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientBirthDate = copy.PatientBirthDate; + PatientBirthDateInAlternativeCalendar = copy.PatientBirthDateInAlternativeCalendar; + PatientDeathDateInAlternativeCalendar = copy.PatientDeathDateInAlternativeCalendar; + PatientAlternativeCalendar = copy.PatientAlternativeCalendar; + PatientSex = copy.PatientSex; + ReferencedPatientPhotoSequence = copy.ReferencedPatientPhotoSequence; + QualityControlSubject = copy.QualityControlSubject; + ReferencedPatientSequence = copy.ReferencedPatientSequence; + PatientBirthTime = copy.PatientBirthTime; + OtherPatientIDsSequence = copy.OtherPatientIDsSequence; + OtherPatientNames = copy.OtherPatientNames; + EthnicGroup = copy.EthnicGroup; + PatientComments = copy.PatientComments; + PatientSpeciesDescription = copy.PatientSpeciesDescription; + PatientSpeciesCodeSequence = copy.PatientSpeciesCodeSequence; + PatientBreedDescription = copy.PatientBreedDescription; + PatientBreedCodeSequence = copy.PatientBreedCodeSequence; + BreedRegistrationSequence = copy.BreedRegistrationSequence; + StrainDescription = copy.StrainDescription; + StrainNomenclature = copy.StrainNomenclature; + StrainCodeSequence = copy.StrainCodeSequence; + StrainAdditionalInformation = copy.StrainAdditionalInformation; + StrainStockSequence = copy.StrainStockSequence; + GeneticModificationsSequence = copy.GeneticModificationsSequence; + ResponsiblePerson = copy.ResponsiblePerson; + ResponsiblePersonRole = copy.ResponsiblePersonRole; + ResponsibleOrganization = copy.ResponsibleOrganization; + PatientIdentityRemoved = copy.PatientIdentityRemoved; + DeidentificationMethod = copy.DeidentificationMethod; + DeidentificationMethodCodeSequence = copy.DeidentificationMethodCodeSequence; + SourcePatientGroupIdentificationSequence = copy.SourcePatientGroupIdentificationSequence; + GroupOfPatientsIdentificationSequence = copy.GroupOfPatientsIdentificationSequence; + ClinicalTrialSponsorName = copy.ClinicalTrialSponsorName; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ClinicalTrialProtocolName = copy.ClinicalTrialProtocolName; + ClinicalTrialSiteID = copy.ClinicalTrialSiteID; + ClinicalTrialSiteName = copy.ClinicalTrialSiteName; + ClinicalTrialSubjectID = copy.ClinicalTrialSubjectID; + ClinicalTrialSubjectReadingID = copy.ClinicalTrialSubjectReadingID; + ClinicalTrialProtocolEthicsCommitteeName = copy.ClinicalTrialProtocolEthicsCommitteeName; + ClinicalTrialProtocolEthicsCommitteeApprovalNumber = copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + StudyInstanceUID = copy.StudyInstanceUID; + StudyDate = copy.StudyDate; + StudyTime = copy.StudyTime; + ReferringPhysicianName = copy.ReferringPhysicianName; + ReferringPhysicianIdentificationSequence = copy.ReferringPhysicianIdentificationSequence; + ConsultingPhysicianName = copy.ConsultingPhysicianName; + ConsultingPhysicianIdentificationSequence = copy.ConsultingPhysicianIdentificationSequence; + StudyID = copy.StudyID; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + StudyDescription = copy.StudyDescription; + PhysiciansOfRecord = copy.PhysiciansOfRecord; + PhysiciansOfRecordIdentificationSequence = copy.PhysiciansOfRecordIdentificationSequence; + NameOfPhysiciansReadingStudy = copy.NameOfPhysiciansReadingStudy; + PhysiciansReadingStudyIdentificationSequence = copy.PhysiciansReadingStudyIdentificationSequence; + RequestingServiceCodeSequence = copy.RequestingServiceCodeSequence; + ReferencedStudySequence = copy.ReferencedStudySequence; + ProcedureCodeSequence = copy.ProcedureCodeSequence; + ReasonForPerformedProcedureCodeSequence = copy.ReasonForPerformedProcedureCodeSequence; + ClinicalTrialTimePointID = copy.ClinicalTrialTimePointID; + ClinicalTrialTimePointDescription = copy.ClinicalTrialTimePointDescription; + LongitudinalTemporalOffsetFromEvent = copy.LongitudinalTemporalOffsetFromEvent; + LongitudinalTemporalEventType = copy.LongitudinalTemporalEventType; + ConsentForClinicalTrialUseSequence = copy.ConsentForClinicalTrialUseSequence; + AdmittingDiagnosesDescription = copy.AdmittingDiagnosesDescription; + AdmittingDiagnosesCodeSequence = copy.AdmittingDiagnosesCodeSequence; + PatientAge = copy.PatientAge; + PatientSize = copy.PatientSize; + PatientWeight = copy.PatientWeight; + PatientBodyMassIndex = copy.PatientBodyMassIndex; + MeasuredAPDimension = copy.MeasuredAPDimension; + MeasuredLateralDimension = copy.MeasuredLateralDimension; + PatientSizeCodeSequence = copy.PatientSizeCodeSequence; + MedicalAlerts = copy.MedicalAlerts; + Allergies = copy.Allergies; + SmokingStatus = copy.SmokingStatus; + PregnancyStatus = copy.PregnancyStatus; + LastMenstrualDate = copy.LastMenstrualDate; + PatientState = copy.PatientState; + Occupation = copy.Occupation; + AdditionalPatientHistory = copy.AdditionalPatientHistory; + AdmissionID = copy.AdmissionID; + IssuerOfAdmissionIDSequence = copy.IssuerOfAdmissionIDSequence; + ServiceEpisodeID = copy.ServiceEpisodeID; + IssuerOfServiceEpisodeIDSequence = copy.IssuerOfServiceEpisodeIDSequence; + ServiceEpisodeDescription = copy.ServiceEpisodeDescription; + PatientSexNeutered = copy.PatientSexNeutered; + Modality = copy.Modality; + SeriesInstanceUID = copy.SeriesInstanceUID; + SeriesNumber = copy.SeriesNumber; + SeriesDate = copy.SeriesDate; + SeriesTime = copy.SeriesTime; + SeriesDescription = copy.SeriesDescription; + SeriesDescriptionCodeSequence = copy.SeriesDescriptionCodeSequence; + OperatorsName = copy.OperatorsName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + ReferencedPerformedProcedureStepSequence = copy.ReferencedPerformedProcedureStepSequence; + RequestAttributesSequence = copy.RequestAttributesSequence; + PerformedProcedureStepID = copy.PerformedProcedureStepID; + PerformedProcedureStepStartDate = copy.PerformedProcedureStepStartDate; + PerformedProcedureStepStartTime = copy.PerformedProcedureStepStartTime; + PerformedProcedureStepEndDate = copy.PerformedProcedureStepEndDate; + PerformedProcedureStepEndTime = copy.PerformedProcedureStepEndTime; + PerformedProcedureStepDescription = copy.PerformedProcedureStepDescription; + PerformedProtocolCodeSequence = copy.PerformedProtocolCodeSequence; + CommentsOnThePerformedProcedureStep = copy.CommentsOnThePerformedProcedureStep; + ClinicalTrialCoordinatingCenterName = copy.ClinicalTrialCoordinatingCenterName; + ClinicalTrialSeriesID = copy.ClinicalTrialSeriesID; + ClinicalTrialSeriesDescription = copy.ClinicalTrialSeriesDescription; + Manufacturer = copy.Manufacturer; + InstitutionName = copy.InstitutionName; + InstitutionAddress = copy.InstitutionAddress; + StationName = copy.StationName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + ManufacturerModelName = copy.ManufacturerModelName; + DeviceSerialNumber = copy.DeviceSerialNumber; + SoftwareVersions = copy.SoftwareVersions; + GantryID = copy.GantryID; + UDISequence = copy.UDISequence; + SpatialResolution = copy.SpatialResolution; + DateOfLastCalibration = copy.DateOfLastCalibration; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + PixelPaddingValue = copy.PixelPaddingValue; + InstanceNumber = copy.InstanceNumber; + TreatmentDate = copy.TreatmentDate; + TreatmentTime = copy.TreatmentTime; + ReferencedRTPlanSequence = copy.ReferencedRTPlanSequence; + ReferencedTreatmentRecordSequence = copy.ReferencedTreatmentRecordSequence; + PatientSetupSequence = copy.PatientSetupSequence; + TreatmentMachineSequence = copy.TreatmentMachineSequence; + MeasuredDoseReferenceSequence = copy.MeasuredDoseReferenceSequence; + CalculatedDoseReferenceSequence = copy.CalculatedDoseReferenceSequence; + ReferencedFractionGroupNumber = copy.ReferencedFractionGroupNumber; + NumberOfFractionsPlanned = copy.NumberOfFractionsPlanned; + PrimaryDosimeterUnit = copy.PrimaryDosimeterUnit; + TreatmentSessionIonBeamSequence = copy.TreatmentSessionIonBeamSequence; + CurrentTreatmentStatus = copy.CurrentTreatmentStatus; + TreatmentStatusComment = copy.TreatmentStatusComment; + FirstTreatmentDate = copy.FirstTreatmentDate; + MostRecentTreatmentDate = copy.MostRecentTreatmentDate; + FractionGroupSummarySequence = copy.FractionGroupSummarySequence; + TreatmentSummaryMeasuredDoseReferenceSequence = copy.TreatmentSummaryMeasuredDoseReferenceSequence; + TreatmentSummaryCalculatedDoseReferenceSequence = copy.TreatmentSummaryCalculatedDoseReferenceSequence; + ReferencedImageSequence = copy.ReferencedImageSequence; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + DerivationDescription = copy.DerivationDescription; + DerivationCodeSequence = copy.DerivationCodeSequence; + SourceImageSequence = copy.SourceImageSequence; + SourceInstanceSequence = copy.SourceInstanceSequence; + SOPClassUID = copy.SOPClassUID; + SOPInstanceUID = copy.SOPInstanceUID; + SpecificCharacterSet = copy.SpecificCharacterSet; + InstanceCreationDate = copy.InstanceCreationDate; + InstanceCreationTime = copy.InstanceCreationTime; + InstanceCoercionDateTime = copy.InstanceCoercionDateTime; + InstanceCreatorUID = copy.InstanceCreatorUID; + RelatedGeneralSOPClassUID = copy.RelatedGeneralSOPClassUID; + OriginalSpecializedSOPClassUID = copy.OriginalSpecializedSOPClassUID; + CodingSchemeIdentificationSequence = copy.CodingSchemeIdentificationSequence; + ContextGroupIdentificationSequence = copy.ContextGroupIdentificationSequence; + MappingResourceIdentificationSequence = copy.MappingResourceIdentificationSequence; + TimezoneOffsetFromUTC = copy.TimezoneOffsetFromUTC; + ContributingEquipmentSequence = copy.ContributingEquipmentSequence; + SOPInstanceStatus = copy.SOPInstanceStatus; + SOPAuthorizationDateTime = copy.SOPAuthorizationDateTime; + SOPAuthorizationComment = copy.SOPAuthorizationComment; + AuthorizationEquipmentCertificationNumber = copy.AuthorizationEquipmentCertificationNumber; + MACParametersSequence = copy.MACParametersSequence; + DigitalSignaturesSequence = copy.DigitalSignaturesSequence; + EncryptedAttributesSequence = copy.EncryptedAttributesSequence; + OriginalAttributesSequence = copy.OriginalAttributesSequence; + HL7StructuredDocumentReferenceSequence = copy.HL7StructuredDocumentReferenceSequence; + LongitudinalTemporalInformationModified = copy.LongitudinalTemporalInformationModified; + QueryRetrieveView = copy.QueryRetrieveView; + ConversionSourceAttributesSequence = copy.ConversionSourceAttributesSequence; + ContentQualification = copy.ContentQualification; + PrivateDataElementCharacteristicsSequence = copy.PrivateDataElementCharacteristicsSequence; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudiesContainingOtherReferencedInstancesSequence = copy.StudiesContainingOtherReferencedInstancesSequence; + } + return *this; +} + + +void DRTIonBeamsTreatmentRecordIOD::clear() +{ + /* clear all DICOM attributes */ + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + PatientBirthDate.clear(); + PatientBirthDateInAlternativeCalendar.clear(); + PatientDeathDateInAlternativeCalendar.clear(); + PatientAlternativeCalendar.clear(); + PatientSex.clear(); + ReferencedPatientPhotoSequence.clear(); + QualityControlSubject.clear(); + ReferencedPatientSequence.clear(); + PatientBirthTime.clear(); + OtherPatientIDsSequence.clear(); + OtherPatientNames.clear(); + EthnicGroup.clear(); + PatientComments.clear(); + PatientSpeciesDescription.clear(); + PatientSpeciesCodeSequence.clear(); + PatientBreedDescription.clear(); + PatientBreedCodeSequence.clear(); + BreedRegistrationSequence.clear(); + StrainDescription.clear(); + StrainNomenclature.clear(); + StrainCodeSequence.clear(); + StrainAdditionalInformation.clear(); + StrainStockSequence.clear(); + GeneticModificationsSequence.clear(); + ResponsiblePerson.clear(); + ResponsiblePersonRole.clear(); + ResponsibleOrganization.clear(); + PatientIdentityRemoved.clear(); + DeidentificationMethod.clear(); + DeidentificationMethodCodeSequence.clear(); + SourcePatientGroupIdentificationSequence.clear(); + GroupOfPatientsIdentificationSequence.clear(); + ClinicalTrialSponsorName.clear(); + ClinicalTrialProtocolID.clear(); + ClinicalTrialProtocolName.clear(); + ClinicalTrialSiteID.clear(); + ClinicalTrialSiteName.clear(); + ClinicalTrialSubjectID.clear(); + ClinicalTrialSubjectReadingID.clear(); + ClinicalTrialProtocolEthicsCommitteeName.clear(); + ClinicalTrialProtocolEthicsCommitteeApprovalNumber.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + ReferringPhysicianIdentificationSequence.clear(); + ConsultingPhysicianName.clear(); + ConsultingPhysicianIdentificationSequence.clear(); + StudyID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyDescription.clear(); + PhysiciansOfRecord.clear(); + PhysiciansOfRecordIdentificationSequence.clear(); + NameOfPhysiciansReadingStudy.clear(); + PhysiciansReadingStudyIdentificationSequence.clear(); + RequestingServiceCodeSequence.clear(); + ReferencedStudySequence.clear(); + ProcedureCodeSequence.clear(); + ReasonForPerformedProcedureCodeSequence.clear(); + ClinicalTrialTimePointID.clear(); + ClinicalTrialTimePointDescription.clear(); + LongitudinalTemporalOffsetFromEvent.clear(); + LongitudinalTemporalEventType.clear(); + ConsentForClinicalTrialUseSequence.clear(); + AdmittingDiagnosesDescription.clear(); + AdmittingDiagnosesCodeSequence.clear(); + PatientAge.clear(); + PatientSize.clear(); + PatientWeight.clear(); + PatientBodyMassIndex.clear(); + MeasuredAPDimension.clear(); + MeasuredLateralDimension.clear(); + PatientSizeCodeSequence.clear(); + MedicalAlerts.clear(); + Allergies.clear(); + SmokingStatus.clear(); + PregnancyStatus.clear(); + LastMenstrualDate.clear(); + PatientState.clear(); + Occupation.clear(); + AdditionalPatientHistory.clear(); + AdmissionID.clear(); + IssuerOfAdmissionIDSequence.clear(); + ServiceEpisodeID.clear(); + IssuerOfServiceEpisodeIDSequence.clear(); + ServiceEpisodeDescription.clear(); + PatientSexNeutered.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + SeriesDescriptionCodeSequence.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ReferencedPerformedProcedureStepSequence.clear(); + RequestAttributesSequence.clear(); + PerformedProcedureStepID.clear(); + PerformedProcedureStepStartDate.clear(); + PerformedProcedureStepStartTime.clear(); + PerformedProcedureStepEndDate.clear(); + PerformedProcedureStepEndTime.clear(); + PerformedProcedureStepDescription.clear(); + PerformedProtocolCodeSequence.clear(); + CommentsOnThePerformedProcedureStep.clear(); + ClinicalTrialCoordinatingCenterName.clear(); + ClinicalTrialSeriesID.clear(); + ClinicalTrialSeriesDescription.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + GantryID.clear(); + UDISequence.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + PixelPaddingValue.clear(); + InstanceNumber.clear(); + TreatmentDate.clear(); + TreatmentTime.clear(); + ReferencedRTPlanSequence.clear(); + ReferencedTreatmentRecordSequence.clear(); + PatientSetupSequence.clear(); + TreatmentMachineSequence.clear(); + MeasuredDoseReferenceSequence.clear(); + CalculatedDoseReferenceSequence.clear(); + ReferencedFractionGroupNumber.clear(); + NumberOfFractionsPlanned.clear(); + PrimaryDosimeterUnit.clear(); + TreatmentSessionIonBeamSequence.clear(); + CurrentTreatmentStatus.clear(); + TreatmentStatusComment.clear(); + FirstTreatmentDate.clear(); + MostRecentTreatmentDate.clear(); + FractionGroupSummarySequence.clear(); + TreatmentSummaryMeasuredDoseReferenceSequence.clear(); + TreatmentSummaryCalculatedDoseReferenceSequence.clear(); + ReferencedImageSequence.clear(); + ReferencedInstanceSequence.clear(); + DerivationDescription.clear(); + DerivationCodeSequence.clear(); + SourceImageSequence.clear(); + SourceInstanceSequence.clear(); + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCoercionDateTime.clear(); + InstanceCreatorUID.clear(); + RelatedGeneralSOPClassUID.clear(); + OriginalSpecializedSOPClassUID.clear(); + CodingSchemeIdentificationSequence.clear(); + ContextGroupIdentificationSequence.clear(); + MappingResourceIdentificationSequence.clear(); + TimezoneOffsetFromUTC.clear(); + ContributingEquipmentSequence.clear(); + SOPInstanceStatus.clear(); + SOPAuthorizationDateTime.clear(); + SOPAuthorizationComment.clear(); + AuthorizationEquipmentCertificationNumber.clear(); + MACParametersSequence.clear(); + DigitalSignaturesSequence.clear(); + EncryptedAttributesSequence.clear(); + OriginalAttributesSequence.clear(); + HL7StructuredDocumentReferenceSequence.clear(); + LongitudinalTemporalInformationModified.clear(); + QueryRetrieveView.clear(); + ConversionSourceAttributesSequence.clear(); + ContentQualification.clear(); + PrivateDataElementCharacteristicsSequence.clear(); + ReferencedSeriesSequence.clear(); + StudiesContainingOtherReferencedInstancesSequence.clear(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isValid() +{ + /* tbd: check whether object is valid */ + return OFTrue; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::checkDatasetForReading(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* check SOP class UID */ + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + OFString tmpString; + getStringValueFromElement(sopClassUID, tmpString); + if (tmpString != UID_RTIonBeamsTreatmentRecordStorage) + { + DCMRT_ERROR("Invalid value for attribute SOPClassUID (0008,0016)"); + result = RT_EC_InvalidValue; + } + } + return result; +} + + +void DRTIonBeamsTreatmentRecordIOD::updateAttributes() +{ + SOPClassUID.putString(UID_RTIonBeamsTreatmentRecordStorage); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::read(DcmItem &dataset) +{ + /* re-initialize object */ + clear(); + /* check SOP class UID first */ + OFCondition result = checkDatasetForReading(dataset); + /* read data from PatientIE, StudyIE, SeriesIE */ + if (result.good()) + result = readSeriesData(dataset); + if (result.good()) + { + // --- GeneralEquipmentModule (M) --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionAddress, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, StationName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionalDepartmentName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, GantryID, "1", "3", "GeneralEquipmentModule"); + UDISequence.read(dataset, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SpatialResolution, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DateOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, TimeOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingValue, "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralTreatmentRecordModule (M) --- + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "1", "RTGeneralTreatmentRecordModule"); + getAndCheckElementFromDataset(dataset, TreatmentDate, "1", "2", "RTGeneralTreatmentRecordModule"); + getAndCheckElementFromDataset(dataset, TreatmentTime, "1", "2", "RTGeneralTreatmentRecordModule"); + ReferencedRTPlanSequence.read(dataset, "1-n", "2", "RTGeneralTreatmentRecordModule"); + ReferencedTreatmentRecordSequence.read(dataset, "1-n", "3", "RTGeneralTreatmentRecordModule"); + + // --- RTPatientSetupModule (U) --- + if (dataset.tagExists(DCM_PatientSetupSequence)) + { + PatientSetupSequence.read(dataset, "1-n", "1", "RTPatientSetupModule"); + } + + // --- RTTreatmentMachineRecordModule (M) --- + TreatmentMachineSequence.read(dataset, "1-n", "1", "RTTreatmentMachineRecordModule"); + + // --- MeasuredDoseReferenceRecordModule (U) --- + if (dataset.tagExists(DCM_MeasuredDoseReferenceSequence)) + { + MeasuredDoseReferenceSequence.read(dataset, "1-n", "1", "MeasuredDoseReferenceRecordModule"); + } + + // --- CalculatedDoseReferenceRecordModule (U) --- + if (dataset.tagExists(DCM_CalculatedDoseReferenceSequence)) + { + CalculatedDoseReferenceSequence.read(dataset, "1-n", "1", "CalculatedDoseReferenceRecordModule"); + } + + // --- RTIonBeamsSessionRecordModule (M) --- + getAndCheckElementFromDataset(dataset, ReferencedFractionGroupNumber, "1", "3", "RTIonBeamsSessionRecordModule"); + getAndCheckElementFromDataset(dataset, NumberOfFractionsPlanned, "1", "2", "RTIonBeamsSessionRecordModule"); + getAndCheckElementFromDataset(dataset, PrimaryDosimeterUnit, "1", "1", "RTIonBeamsSessionRecordModule"); + TreatmentSessionIonBeamSequence.read(dataset, "1-n", "1", "RTIonBeamsSessionRecordModule"); + + // --- RTTreatmentSummaryRecordModule (U) --- + if (dataset.tagExists(DCM_CurrentTreatmentStatus) || + dataset.tagExists(DCM_FirstTreatmentDate) || + dataset.tagExists(DCM_MostRecentTreatmentDate)) + { + getAndCheckElementFromDataset(dataset, CurrentTreatmentStatus, "1", "1", "RTTreatmentSummaryRecordModule"); + getAndCheckElementFromDataset(dataset, TreatmentStatusComment, "1", "3", "RTTreatmentSummaryRecordModule"); + getAndCheckElementFromDataset(dataset, FirstTreatmentDate, "1", "2", "RTTreatmentSummaryRecordModule"); + getAndCheckElementFromDataset(dataset, MostRecentTreatmentDate, "1", "2", "RTTreatmentSummaryRecordModule"); + FractionGroupSummarySequence.read(dataset, "1-n", "3", "RTTreatmentSummaryRecordModule"); + TreatmentSummaryMeasuredDoseReferenceSequence.read(dataset, "1-n", "3", "RTTreatmentSummaryRecordModule"); + TreatmentSummaryCalculatedDoseReferenceSequence.read(dataset, "1-n", "3", "RTTreatmentSummaryRecordModule"); + } + + // --- GeneralReferenceModule (U) --- + ReferencedImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + ReferencedInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + getAndCheckElementFromDataset(dataset, DerivationDescription, "1", "3", "GeneralReferenceModule"); + DerivationCodeSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + + // --- SOPCommonModule (M) --- + getAndCheckElementFromDataset(dataset, SOPClassUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCoercionDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, RelatedGeneralSOPClassUID, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, OriginalSpecializedSOPClassUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + ContextGroupIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + MappingResourceIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + ContributingEquipmentSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceStatus, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationComment, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, AuthorizationEquipmentCertificationNumber, "1", "3", "SOPCommonModule"); + MACParametersSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + DigitalSignaturesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + EncryptedAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + OriginalAttributesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + HL7StructuredDocumentReferenceSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalInformationModified, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, QueryRetrieveView, "1", "1C", "SOPCommonModule"); + ConversionSourceAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, ContentQualification, "1", "3", "SOPCommonModule"); + PrivateDataElementCharacteristicsSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + ReferencedSeriesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + StudiesContainingOtherReferencedInstancesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + } + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::readPatientData(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + + // --- PatientModule (M) --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + IssuerOfPatientIDQualifiersSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientDeathDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientAlternativeCalendar, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + ReferencedPatientPhotoSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, QualityControlSubject, "1", "3", "PatientModule"); + ReferencedPatientSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthTime, "1", "3", "PatientModule"); + OtherPatientIDsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, OtherPatientNames, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, EthnicGroup, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientComments, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSpeciesDescription, "1", "1C", "PatientModule"); + PatientSpeciesCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBreedDescription, "1", "2C", "PatientModule"); + PatientBreedCodeSequence.read(dataset, "1-n", "2C", "PatientModule"); + BreedRegistrationSequence.read(dataset, "1-n", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainDescription, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainNomenclature, "1", "3", "PatientModule"); + StrainCodeSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainAdditionalInformation, "1", "3", "PatientModule"); + StrainStockSequence.read(dataset, "1-n", "3", "PatientModule"); + GeneticModificationsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePerson, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePersonRole, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsibleOrganization, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientIdentityRemoved, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, DeidentificationMethod, "1-n", "1C", "PatientModule"); + DeidentificationMethodCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + SourcePatientGroupIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + GroupOfPatientsIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialSponsorName) || + dataset.tagExists(DCM_ClinicalTrialProtocolID) || + dataset.tagExists(DCM_ClinicalTrialProtocolName) || + dataset.tagExists(DCM_ClinicalTrialSiteID) || + dataset.tagExists(DCM_ClinicalTrialSiteName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialSponsorName, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolID, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteID, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectReadingID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeName, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeApprovalNumber, "1", "3", "ClinicalTrialSubjectModule"); + } + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::readStudyData(DcmItem &dataset) +{ + /* read data from PatientIE */ + OFCondition result = readPatientData(dataset); + if (result.good()) + { + // --- GeneralStudyModule (M) --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + ReferringPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ConsultingPhysicianName, "1-n", "3", "GeneralStudyModule"); + ConsultingPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + IssuerOfAccessionNumberSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, PhysiciansOfRecord, "1-n", "3", "GeneralStudyModule"); + PhysiciansOfRecordIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, NameOfPhysiciansReadingStudy, "1-n", "3", "GeneralStudyModule"); + PhysiciansReadingStudyIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + RequestingServiceCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReferencedStudySequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReasonForPerformedProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialTimePointID)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointID, "1", "2", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointDescription, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalOffsetFromEvent, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalEventType, "1", "1C", "ClinicalTrialStudyModule"); + ConsentForClinicalTrialUseSequence.read(dataset, "1-n", "3", "ClinicalTrialStudyModule"); + } + + // --- PatientStudyModule (U) --- + getAndCheckElementFromDataset(dataset, AdmittingDiagnosesDescription, "1-n", "3", "PatientStudyModule"); + AdmittingDiagnosesCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientAge, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSize, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientWeight, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientBodyMassIndex, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredAPDimension, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredLateralDimension, "1", "3", "PatientStudyModule"); + PatientSizeCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MedicalAlerts, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Allergies, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, SmokingStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PregnancyStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, LastMenstrualDate, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientState, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Occupation, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdditionalPatientHistory, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdmissionID, "1", "3", "PatientStudyModule"); + IssuerOfAdmissionIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeID, "1", "3", "PatientStudyModule"); + IssuerOfServiceEpisodeIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeDescription, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSexNeutered, "1", "2C", "PatientStudyModule"); + } + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::readSeriesData(DcmItem &dataset) +{ + /* read data from PatientIE, StudyIE */ + OFCondition result = readStudyData(dataset); + if (result.good()) + { + // --- RTSeriesModule (M) --- + getAndCheckElementFromDataset(dataset, Modality, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "2", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "RTSeriesModule"); + SeriesDescriptionCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, OperatorsName, "1-n", "2", "RTSeriesModule"); + OperatorIdentificationSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + ReferencedPerformedProcedureStepSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + RequestAttributesSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepID, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepDescription, "1", "3", "RTSeriesModule"); + PerformedProtocolCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, CommentsOnThePerformedProcedureStep, "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialCoordinatingCenterName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialCoordinatingCenterName, "1", "2", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesID, "1", "3", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesDescription, "1", "3", "ClinicalTrialSeriesModule"); + } + } + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::write(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* only write valid objects */ + if (isValid()) + { + /* update various DICOM attributes */ + updateAttributes(); + + // --- PatientModule (M) --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBirthDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientDeathDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientAlternativeCalendar), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + if (result.good()) result = ReferencedPatientPhotoSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlSubject), "1", "3", "PatientModule"); + if (result.good()) result = ReferencedPatientSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmTime(PatientBirthTime), "1", "3", "PatientModule"); + if (result.good()) result = OtherPatientIDsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(OtherPatientNames), "1-n", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmShortString(EthnicGroup), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongText(PatientComments), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientSpeciesDescription), "1", "1C", "PatientModule"); + if (result.good()) result = PatientSpeciesCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBreedDescription), "1", "2C", "PatientModule"); + if (result.good()) result = PatientBreedCodeSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + if (result.good()) result = BreedRegistrationSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedCharacters(StrainDescription), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(StrainNomenclature), "1", "3", "PatientModule"); + if (result.good()) result = StrainCodeSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedText(StrainAdditionalInformation), "1", "3", "PatientModule"); + if (result.good()) result = StrainStockSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GeneticModificationsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(ResponsiblePerson), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(ResponsiblePersonRole), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(ResponsibleOrganization), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientIdentityRemoved), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(DeidentificationMethod), "1-n", "1C", "PatientModule"); + if (result.good()) result = DeidentificationMethodCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + if (result.good()) result = SourcePatientGroupIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GroupOfPatientsIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (isClinicalTrialSubjectModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSponsorName), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolID), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteID), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectReadingID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeName), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeApprovalNumber), "1", "3", "ClinicalTrialSubjectModule"); + } + + // --- GeneralStudyModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + if (result.good()) result = ReferringPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ConsultingPhysicianName), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = ConsultingPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(PhysiciansOfRecord), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansOfRecordIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(NameOfPhysiciansReadingStudy), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansReadingStudyIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = RequestingServiceCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReferencedStudySequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReasonForPerformedProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (isClinicalTrialStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialTimePointID), "1", "2", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmShortText(ClinicalTrialTimePointDescription), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(LongitudinalTemporalOffsetFromEvent), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalEventType), "1", "1C", "ClinicalTrialStudyModule"); + if (result.good()) result = ConsentForClinicalTrialUseSequence.write(dataset, "1-n" ,"3", "ClinicalTrialStudyModule"); + } + + // --- PatientStudyModule (U) --- + if (isPatientStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(AdmittingDiagnosesDescription), "1-n", "3", "PatientStudyModule"); + if (result.good()) result = AdmittingDiagnosesCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmAgeString(PatientAge), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSize), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientWeight), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientBodyMassIndex), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredAPDimension), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredLateralDimension), "1", "3", "PatientStudyModule"); + if (result.good()) result = PatientSizeCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(MedicalAlerts), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(Allergies), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(SmokingStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PregnancyStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDate(LastMenstrualDate), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientState), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(Occupation), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongText(AdditionalPatientHistory), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(AdmissionID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfAdmissionIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfServiceEpisodeIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeDescription), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSexNeutered), "1", "2C", "PatientStudyModule"); + } + + // --- RTSeriesModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "2", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = SeriesDescriptionCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmPersonName(OperatorsName), "1-n", "2", "RTSeriesModule"); + if (result.good()) result = OperatorIdentificationSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = ReferencedPerformedProcedureStepSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = RequestAttributesSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortString(PerformedProcedureStepID), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepStartDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepStartTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepEndDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepEndTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(PerformedProcedureStepDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = PerformedProtocolCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortText(CommentsOnThePerformedProcedureStep), "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (isClinicalTrialSeriesModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialCoordinatingCenterName), "1", "2", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesID), "1", "3", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesDescription), "1", "3", "ClinicalTrialSeriesModule"); + } + + // --- GeneralEquipmentModule (M) --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortText(InstitutionAddress), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortString(StationName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionalDepartmentName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(GantryID), "1", "3", "GeneralEquipmentModule"); + if (result.good()) result = UDISequence.write(dataset, "1-n" ,"3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SpatialResolution), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDate(DateOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmTime(TimeOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingValue), "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralTreatmentRecordModule (M) --- + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "1", "RTGeneralTreatmentRecordModule"); + addElementToDataset(result, dataset, new DcmDate(TreatmentDate), "1", "2", "RTGeneralTreatmentRecordModule"); + addElementToDataset(result, dataset, new DcmTime(TreatmentTime), "1", "2", "RTGeneralTreatmentRecordModule"); + if (result.good()) result = ReferencedRTPlanSequence.write(dataset, "1-n" ,"2", "RTGeneralTreatmentRecordModule"); + if (result.good()) result = ReferencedTreatmentRecordSequence.write(dataset, "1-n" ,"3", "RTGeneralTreatmentRecordModule"); + + // --- RTPatientSetupModule (U) --- + if (isRTPatientSetupModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = PatientSetupSequence.write(dataset, "1-n" ,"1", "RTPatientSetupModule"); + } + + // --- RTTreatmentMachineRecordModule (M) --- + if (result.good()) result = TreatmentMachineSequence.write(dataset, "1-n" ,"1", "RTTreatmentMachineRecordModule"); + + // --- MeasuredDoseReferenceRecordModule (U) --- + if (isMeasuredDoseReferenceRecordModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = MeasuredDoseReferenceSequence.write(dataset, "1-n" ,"1", "MeasuredDoseReferenceRecordModule"); + } + + // --- CalculatedDoseReferenceRecordModule (U) --- + if (isCalculatedDoseReferenceRecordModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = CalculatedDoseReferenceSequence.write(dataset, "1-n" ,"1", "CalculatedDoseReferenceRecordModule"); + } + + // --- RTIonBeamsSessionRecordModule (M) --- + addElementToDataset(result, dataset, new DcmIntegerString(ReferencedFractionGroupNumber), "1", "3", "RTIonBeamsSessionRecordModule"); + addElementToDataset(result, dataset, new DcmIntegerString(NumberOfFractionsPlanned), "1", "2", "RTIonBeamsSessionRecordModule"); + addElementToDataset(result, dataset, new DcmCodeString(PrimaryDosimeterUnit), "1", "1", "RTIonBeamsSessionRecordModule"); + if (result.good()) result = TreatmentSessionIonBeamSequence.write(dataset, "1-n" ,"1", "RTIonBeamsSessionRecordModule"); + + // --- RTTreatmentSummaryRecordModule (U) --- + if (isRTTreatmentSummaryRecordModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmCodeString(CurrentTreatmentStatus), "1", "1", "RTTreatmentSummaryRecordModule"); + addElementToDataset(result, dataset, new DcmShortText(TreatmentStatusComment), "1", "3", "RTTreatmentSummaryRecordModule"); + addElementToDataset(result, dataset, new DcmDate(FirstTreatmentDate), "1", "2", "RTTreatmentSummaryRecordModule"); + addElementToDataset(result, dataset, new DcmDate(MostRecentTreatmentDate), "1", "2", "RTTreatmentSummaryRecordModule"); + if (result.good()) result = FractionGroupSummarySequence.write(dataset, "1-n" ,"3", "RTTreatmentSummaryRecordModule"); + if (result.good()) result = TreatmentSummaryMeasuredDoseReferenceSequence.write(dataset, "1-n" ,"3", "RTTreatmentSummaryRecordModule"); + if (result.good()) result = TreatmentSummaryCalculatedDoseReferenceSequence.write(dataset, "1-n" ,"3", "RTTreatmentSummaryRecordModule"); + } + + // --- GeneralReferenceModule (U) --- + if (isGeneralReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = ReferencedInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + addElementToDataset(result, dataset, new DcmShortText(DerivationDescription), "1", "3", "GeneralReferenceModule"); + if (result.good()) result = DerivationCodeSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + } + + // --- SOPCommonModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(InstanceCoercionDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(RelatedGeneralSOPClassUID), "1-n", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(OriginalSpecializedSOPClassUID), "1", "3", "SOPCommonModule"); + if (result.good()) result = CodingSchemeIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = ContextGroupIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = MappingResourceIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + if (result.good()) result = ContributingEquipmentSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SOPInstanceStatus), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(SOPAuthorizationDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongText(SOPAuthorizationComment), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongString(AuthorizationEquipmentCertificationNumber), "1", "3", "SOPCommonModule"); + if (result.good()) result = MACParametersSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = DigitalSignaturesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = EncryptedAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + if (result.good()) result = OriginalAttributesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = HL7StructuredDocumentReferenceSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalInformationModified), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(QueryRetrieveView), "1", "1C", "SOPCommonModule"); + if (result.good()) result = ConversionSourceAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContentQualification), "1", "3", "SOPCommonModule"); + if (result.good()) result = PrivateDataElementCharacteristicsSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + if (isCommonInstanceReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedSeriesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + if (result.good()) result = StudiesContainingOtherReferencedInstancesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + } + } else + result = RT_EC_InvalidObject; + return result; +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isClinicalTrialSubjectModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ClinicalTrialSponsorName.isEmpty() && + !ClinicalTrialProtocolID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ClinicalTrialSponsorName.isEmpty() || + !ClinicalTrialProtocolID.isEmpty() || + !ClinicalTrialProtocolName.isEmpty() || + !ClinicalTrialSiteID.isEmpty() || + !ClinicalTrialSiteName.isEmpty() || + !ClinicalTrialSubjectID.isEmpty() || + !ClinicalTrialSubjectReadingID.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeName.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeApprovalNumber.isEmpty(); + } +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isClinicalTrialStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialTimePointID.isEmpty() || + !ClinicalTrialTimePointDescription.isEmpty() || + !LongitudinalTemporalOffsetFromEvent.isEmpty() || + !LongitudinalTemporalEventType.isEmpty() || + !ConsentForClinicalTrialUseSequence.isEmpty(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isPatientStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !AdmittingDiagnosesDescription.isEmpty() || + !AdmittingDiagnosesCodeSequence.isEmpty() || + !PatientAge.isEmpty() || + !PatientSize.isEmpty() || + !PatientWeight.isEmpty() || + !PatientBodyMassIndex.isEmpty() || + !MeasuredAPDimension.isEmpty() || + !MeasuredLateralDimension.isEmpty() || + !PatientSizeCodeSequence.isEmpty() || + !MedicalAlerts.isEmpty() || + !Allergies.isEmpty() || + !SmokingStatus.isEmpty() || + !PregnancyStatus.isEmpty() || + !LastMenstrualDate.isEmpty() || + !PatientState.isEmpty() || + !Occupation.isEmpty() || + !AdditionalPatientHistory.isEmpty() || + !AdmissionID.isEmpty() || + !IssuerOfAdmissionIDSequence.isEmpty() || + !ServiceEpisodeID.isEmpty() || + !IssuerOfServiceEpisodeIDSequence.isEmpty() || + !ServiceEpisodeDescription.isEmpty() || + !PatientSexNeutered.isEmpty(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isClinicalTrialSeriesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialCoordinatingCenterName.isEmpty() || + !ClinicalTrialSeriesID.isEmpty() || + !ClinicalTrialSeriesDescription.isEmpty(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isRTPatientSetupModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !PatientSetupSequence.isEmpty(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isMeasuredDoseReferenceRecordModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !MeasuredDoseReferenceSequence.isEmpty(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isCalculatedDoseReferenceRecordModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !CalculatedDoseReferenceSequence.isEmpty(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isRTTreatmentSummaryRecordModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !CurrentTreatmentStatus.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !CurrentTreatmentStatus.isEmpty() || + !TreatmentStatusComment.isEmpty() || + !FirstTreatmentDate.isEmpty() || + !MostRecentTreatmentDate.isEmpty() || + !FractionGroupSummarySequence.isEmpty() || + !TreatmentSummaryMeasuredDoseReferenceSequence.isEmpty() || + !TreatmentSummaryCalculatedDoseReferenceSequence.isEmpty(); + } +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isGeneralReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedImageSequence.isEmpty() || + !ReferencedInstanceSequence.isEmpty() || + !DerivationDescription.isEmpty() || + !DerivationCodeSequence.isEmpty() || + !SourceImageSequence.isEmpty() || + !SourceInstanceSequence.isEmpty(); +} + + +OFBool DRTIonBeamsTreatmentRecordIOD::isCommonInstanceReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedSeriesSequence.isEmpty() || + !StudiesContainingOtherReferencedInstancesSequence.isEmpty(); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getAccessionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getAdditionalPatientHistory(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdditionalPatientHistory, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getAdmissionID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmissionID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getAdmittingDiagnosesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmittingDiagnosesDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getAllergies(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Allergies, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AuthorizationEquipmentCertificationNumber, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialCoordinatingCenterName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeApprovalNumber, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialProtocolName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialSeriesID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialSiteID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialSiteName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialSponsorName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSponsorName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialSubjectID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialSubjectReadingID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectReadingID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialTimePointDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getClinicalTrialTimePointID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CommentsOnThePerformedProcedureStep, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getConsultingPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConsultingPhysicianName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getContentQualification(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentQualification, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getCurrentTreatmentStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CurrentTreatmentStatus, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getDeidentificationMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeidentificationMethod, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getDerivationDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DerivationDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getEthnicGroup(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EthnicGroup, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getFirstTreatmentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FirstTreatmentDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getGantryID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstanceCoercionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCoercionDateTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstanceCreationDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstanceCreationTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstanceCreatorUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstanceNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstanceNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, InstanceNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstitutionAddress(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstitutionName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getLastMenstrualDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LastMenstrualDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getLongitudinalTemporalEventType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalEventType, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getLongitudinalTemporalInformationModified(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalInformationModified, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, LongitudinalTemporalOffsetFromEvent).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getManufacturer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getManufacturerModelName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getMeasuredAPDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredAPDimension, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getMeasuredAPDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredAPDimension).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getMeasuredLateralDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredLateralDimension, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getMeasuredLateralDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredLateralDimension).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getMedicalAlerts(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MedicalAlerts, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getModality(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getMostRecentTreatmentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MostRecentTreatmentDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NameOfPhysiciansReadingStudy, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getNumberOfFractionsPlanned(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NumberOfFractionsPlanned, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getNumberOfFractionsPlanned(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, NumberOfFractionsPlanned).getSint32(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getOccupation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Occupation, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getOperatorsName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OriginalSpecializedSOPClassUID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getOtherPatientNames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OtherPatientNames, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientAge(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAge, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAlternativeCalendar, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientBirthDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientBirthTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientBodyMassIndex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBodyMassIndex, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientBodyMassIndex(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientBodyMassIndex).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientBreedDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBreedDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientComments, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientDeathDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientIdentityRemoved(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientIdentityRemoved, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientSex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientSexNeutered(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSexNeutered, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientSize(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSize, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientSize(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSize).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientSpeciesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSpeciesDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientState(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientState, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientWeight, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPatientWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientWeight).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPerformedProcedureStepDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPerformedProcedureStepEndDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPerformedProcedureStepEndTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPerformedProcedureStepID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPerformedProcedureStepStartDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPerformedProcedureStepStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPhysiciansOfRecord(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhysiciansOfRecord, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPixelPaddingValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingValue).getUint16(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPregnancyStatus(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PregnancyStatus).getUint16(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getPrimaryDosimeterUnit(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PrimaryDosimeterUnit, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getQualityControlSubject(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlSubject, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getQueryRetrieveView(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QueryRetrieveView, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getReferencedFractionGroupNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferencedFractionGroupNumber, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, ReferencedFractionGroupNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getReferringPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getRelatedGeneralSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RelatedGeneralSOPClassUID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getResponsibleOrganization(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsibleOrganization, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getResponsiblePerson(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePerson, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getResponsiblePersonRole(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePersonRole, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSOPAuthorizationComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationComment, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSOPAuthorizationDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationDateTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSOPInstanceStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceStatus, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSOPInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSeriesDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSeriesNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSeriesNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, SeriesNumber).getSint32(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSeriesTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getServiceEpisodeDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getServiceEpisodeID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSmokingStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SmokingStatus, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSoftwareVersions(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSpatialResolution(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getSpecificCharacterSet(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStationName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStrainAdditionalInformation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainAdditionalInformation, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStrainDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStrainNomenclature(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainNomenclature, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStudyDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStudyDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStudyID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getStudyTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getTimezoneOffsetFromUTC(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getTreatmentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentDate, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getTreatmentStatusComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentStatusComment, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::getTreatmentTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentTime, value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setAdditionalPatientHistory(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = AdditionalPatientHistory.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setAdmissionID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AdmissionID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setAdmittingDiagnosesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AdmittingDiagnosesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setAllergies(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = Allergies.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AuthorizationEquipmentCertificationNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialCoordinatingCenterName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeApprovalNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialProtocolName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialSeriesID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialSiteID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialSiteName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialSponsorName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSponsorName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialSubjectID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectReadingID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialTimePointDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setClinicalTrialTimePointID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CommentsOnThePerformedProcedureStep.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setConsultingPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ConsultingPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setContentQualification(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentQualification.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setCurrentTreatmentStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CurrentTreatmentStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setDeidentificationMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DeidentificationMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setDerivationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = DerivationDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setEthnicGroup(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EthnicGroup.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setFirstTreatmentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FirstTreatmentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setGantryID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstanceCoercionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCoercionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstanceCreationDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstanceCreationTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstanceCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreatorUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstanceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setLastMenstrualDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LastMenstrualDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setLongitudinalTemporalEventType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalEventType.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalInformationModified.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos) +{ + return LongitudinalTemporalOffsetFromEvent.putFloat64(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setMeasuredAPDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredAPDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setMeasuredLateralDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredLateralDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setMedicalAlerts(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = MedicalAlerts.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setModality(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Modality.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setMostRecentTreatmentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MostRecentTreatmentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NameOfPhysiciansReadingStudy.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setNumberOfFractionsPlanned(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfFractionsPlanned.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setOccupation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Occupation.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OriginalSpecializedSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setOtherPatientNames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OtherPatientNames.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientAge(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAge.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientBirthDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientBirthTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientBodyMassIndex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBodyMassIndex.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientBreedDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBreedDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PatientComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientDeathDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientIdentityRemoved(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientIdentityRemoved.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientSex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientSexNeutered(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSexNeutered.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientSize(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSize.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientSpeciesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSpeciesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientState(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientState.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPatientWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPerformedProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPerformedProcedureStepEndDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPerformedProcedureStepEndTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPerformedProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPerformedProcedureStepStartDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPerformedProcedureStepStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPhysiciansOfRecord(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PhysiciansOfRecord.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPixelPaddingValue(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingValue.putUint16(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPregnancyStatus(const Uint16 value, const unsigned long pos) +{ + return PregnancyStatus.putUint16(value, pos); +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setPrimaryDosimeterUnit(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrimaryDosimeterUnit.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setQualityControlSubject(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlSubject.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setQueryRetrieveView(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QueryRetrieveView.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setReferencedFractionGroupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedFractionGroupNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setReferringPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RelatedGeneralSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsibleOrganization.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setResponsiblePerson(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePerson.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setResponsiblePersonRole(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePersonRole.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSOPAuthorizationComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SOPAuthorizationComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSOPAuthorizationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPAuthorizationDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSOPInstanceStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSeriesDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSeriesNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSeriesTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setServiceEpisodeDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setServiceEpisodeID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSmokingStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SmokingStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setSpecificCharacterSet(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SpecificCharacterSet.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStrainAdditionalInformation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StrainAdditionalInformation.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStrainDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStrainNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainNomenclature.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStudyDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStudyDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStudyID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setStudyTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setTimezoneOffsetFromUTC(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setTreatmentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setTreatmentStatusComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = TreatmentStatusComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTIonBeamsTreatmentRecordIOD::setTreatmentTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentTime.putOFStringArray(value); + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtipiqs.cc b/dcmrt/libsrc/drtipiqs.cc new file mode 100644 index 00000000..191c864b --- /dev/null +++ b/dcmrt/libsrc/drtipiqs.cc @@ -0,0 +1,623 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIssuerOfPatientIDQualifiersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtipiqs.h" + + +// --- item class --- + +DRTIssuerOfPatientIDQualifiersSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AssigningAgencyOrDepartmentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + AssigningFacilitySequence(emptyDefaultItem /*emptyDefaultSequence*/), + AssigningJurisdictionCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + IdentifierTypeCode(DCM_IdentifierTypeCode), + UniversalEntityID(DCM_UniversalEntityID), + UniversalEntityIDType(DCM_UniversalEntityIDType) +{ +} + + +DRTIssuerOfPatientIDQualifiersSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AssigningAgencyOrDepartmentCodeSequence(copy.AssigningAgencyOrDepartmentCodeSequence), + AssigningFacilitySequence(copy.AssigningFacilitySequence), + AssigningJurisdictionCodeSequence(copy.AssigningJurisdictionCodeSequence), + IdentifierTypeCode(copy.IdentifierTypeCode), + UniversalEntityID(copy.UniversalEntityID), + UniversalEntityIDType(copy.UniversalEntityIDType) +{ +} + + +DRTIssuerOfPatientIDQualifiersSequence::Item::~Item() +{ +} + + +DRTIssuerOfPatientIDQualifiersSequence::Item &DRTIssuerOfPatientIDQualifiersSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AssigningAgencyOrDepartmentCodeSequence = copy.AssigningAgencyOrDepartmentCodeSequence; + AssigningFacilitySequence = copy.AssigningFacilitySequence; + AssigningJurisdictionCodeSequence = copy.AssigningJurisdictionCodeSequence; + IdentifierTypeCode = copy.IdentifierTypeCode; + UniversalEntityID = copy.UniversalEntityID; + UniversalEntityIDType = copy.UniversalEntityIDType; + } + return *this; +} + + +void DRTIssuerOfPatientIDQualifiersSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + UniversalEntityID.clear(); + UniversalEntityIDType.clear(); + IdentifierTypeCode.clear(); + AssigningFacilitySequence.clear(); + AssigningJurisdictionCodeSequence.clear(); + AssigningAgencyOrDepartmentCodeSequence.clear(); + } +} + + +OFBool DRTIssuerOfPatientIDQualifiersSequence::Item::isEmpty() +{ + return UniversalEntityID.isEmpty() && + UniversalEntityIDType.isEmpty() && + IdentifierTypeCode.isEmpty() && + AssigningFacilitySequence.isEmpty() && + AssigningJurisdictionCodeSequence.isEmpty() && + AssigningAgencyOrDepartmentCodeSequence.isEmpty(); +} + + +OFBool DRTIssuerOfPatientIDQualifiersSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, UniversalEntityID, "1", "3", "IssuerOfPatientIDQualifiersSequence"); + getAndCheckElementFromDataset(item, UniversalEntityIDType, "1", "1C", "IssuerOfPatientIDQualifiersSequence"); + getAndCheckElementFromDataset(item, IdentifierTypeCode, "1", "3", "IssuerOfPatientIDQualifiersSequence"); + AssigningFacilitySequence.read(item, "1-n", "3", "IssuerOfPatientIDQualifiersSequence"); + AssigningJurisdictionCodeSequence.read(item, "1-n", "3", "IssuerOfPatientIDQualifiersSequence"); + AssigningAgencyOrDepartmentCodeSequence.read(item, "1-n", "3", "IssuerOfPatientIDQualifiersSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnlimitedText(UniversalEntityID), "1", "3", "IssuerOfPatientIDQualifiersSequence"); + addElementToDataset(result, item, new DcmCodeString(UniversalEntityIDType), "1", "1C", "IssuerOfPatientIDQualifiersSequence"); + addElementToDataset(result, item, new DcmCodeString(IdentifierTypeCode), "1", "3", "IssuerOfPatientIDQualifiersSequence"); + if (result.good()) result = AssigningFacilitySequence.write(item, "1-n", "3", "IssuerOfPatientIDQualifiersSequence"); + if (result.good()) result = AssigningJurisdictionCodeSequence.write(item, "1-n", "3", "IssuerOfPatientIDQualifiersSequence"); + if (result.good()) result = AssigningAgencyOrDepartmentCodeSequence.write(item, "1-n", "3", "IssuerOfPatientIDQualifiersSequence"); + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::getIdentifierTypeCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(IdentifierTypeCode, value, pos); +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::getUniversalEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityID, value, pos); +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::getUniversalEntityIDType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityIDType, value, pos); +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::setIdentifierTypeCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IdentifierTypeCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::setUniversalEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = UniversalEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::Item::setUniversalEntityIDType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UniversalEntityIDType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIssuerOfPatientIDQualifiersSequence::DRTIssuerOfPatientIDQualifiersSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIssuerOfPatientIDQualifiersSequence::DRTIssuerOfPatientIDQualifiersSequence(const DRTIssuerOfPatientIDQualifiersSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIssuerOfPatientIDQualifiersSequence &DRTIssuerOfPatientIDQualifiersSequence::operator=(const DRTIssuerOfPatientIDQualifiersSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIssuerOfPatientIDQualifiersSequence::~DRTIssuerOfPatientIDQualifiersSequence() +{ + clear(); +} + + +void DRTIssuerOfPatientIDQualifiersSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIssuerOfPatientIDQualifiersSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIssuerOfPatientIDQualifiersSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIssuerOfPatientIDQualifiersSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIssuerOfPatientIDQualifiersSequence::Item &DRTIssuerOfPatientIDQualifiersSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIssuerOfPatientIDQualifiersSequence::Item &DRTIssuerOfPatientIDQualifiersSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIssuerOfPatientIDQualifiersSequence::Item &DRTIssuerOfPatientIDQualifiersSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIssuerOfPatientIDQualifiersSequence::Item &DRTIssuerOfPatientIDQualifiersSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIssuerOfPatientIDQualifiersSequence::Item &DRTIssuerOfPatientIDQualifiersSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIssuerOfPatientIDQualifiersSequence::Item &DRTIssuerOfPatientIDQualifiersSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IssuerOfPatientIDQualifiersSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IssuerOfPatientIDQualifiersSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIssuerOfPatientIDQualifiersSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IssuerOfPatientIDQualifiersSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtircs.cc b/dcmrt/libsrc/drtircs.cc new file mode 100644 index 00000000..56bf8a91 --- /dev/null +++ b/dcmrt/libsrc/drtircs.cc @@ -0,0 +1,1069 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonRangeCompensatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtircs.h" + + +// --- item class --- + +DRTIonRangeCompensatorSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + CompensatorColumnOffset(DCM_CompensatorColumnOffset), + CompensatorColumns(DCM_CompensatorColumns), + CompensatorDescription(DCM_CompensatorDescription), + CompensatorDivergence(DCM_CompensatorDivergence), + CompensatorID(DCM_CompensatorID), + CompensatorMillingToolDiameter(DCM_CompensatorMillingToolDiameter), + CompensatorMountingPosition(DCM_CompensatorMountingPosition), + CompensatorNumber(DCM_CompensatorNumber), + CompensatorPixelSpacing(DCM_CompensatorPixelSpacing), + CompensatorPosition(DCM_CompensatorPosition), + CompensatorRelativeStoppingPowerRatio(DCM_CompensatorRelativeStoppingPowerRatio), + CompensatorRows(DCM_CompensatorRows), + CompensatorThicknessData(DCM_CompensatorThicknessData), + IsocenterToCompensatorDistances(DCM_IsocenterToCompensatorDistances), + IsocenterToCompensatorTrayDistance(DCM_IsocenterToCompensatorTrayDistance), + MaterialID(DCM_MaterialID) +{ +} + + +DRTIonRangeCompensatorSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + CompensatorColumnOffset(copy.CompensatorColumnOffset), + CompensatorColumns(copy.CompensatorColumns), + CompensatorDescription(copy.CompensatorDescription), + CompensatorDivergence(copy.CompensatorDivergence), + CompensatorID(copy.CompensatorID), + CompensatorMillingToolDiameter(copy.CompensatorMillingToolDiameter), + CompensatorMountingPosition(copy.CompensatorMountingPosition), + CompensatorNumber(copy.CompensatorNumber), + CompensatorPixelSpacing(copy.CompensatorPixelSpacing), + CompensatorPosition(copy.CompensatorPosition), + CompensatorRelativeStoppingPowerRatio(copy.CompensatorRelativeStoppingPowerRatio), + CompensatorRows(copy.CompensatorRows), + CompensatorThicknessData(copy.CompensatorThicknessData), + IsocenterToCompensatorDistances(copy.IsocenterToCompensatorDistances), + IsocenterToCompensatorTrayDistance(copy.IsocenterToCompensatorTrayDistance), + MaterialID(copy.MaterialID) +{ +} + + +DRTIonRangeCompensatorSequence::Item::~Item() +{ +} + + +DRTIonRangeCompensatorSequence::Item &DRTIonRangeCompensatorSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + CompensatorColumnOffset = copy.CompensatorColumnOffset; + CompensatorColumns = copy.CompensatorColumns; + CompensatorDescription = copy.CompensatorDescription; + CompensatorDivergence = copy.CompensatorDivergence; + CompensatorID = copy.CompensatorID; + CompensatorMillingToolDiameter = copy.CompensatorMillingToolDiameter; + CompensatorMountingPosition = copy.CompensatorMountingPosition; + CompensatorNumber = copy.CompensatorNumber; + CompensatorPixelSpacing = copy.CompensatorPixelSpacing; + CompensatorPosition = copy.CompensatorPosition; + CompensatorRelativeStoppingPowerRatio = copy.CompensatorRelativeStoppingPowerRatio; + CompensatorRows = copy.CompensatorRows; + CompensatorThicknessData = copy.CompensatorThicknessData; + IsocenterToCompensatorDistances = copy.IsocenterToCompensatorDistances; + IsocenterToCompensatorTrayDistance = copy.IsocenterToCompensatorTrayDistance; + MaterialID = copy.MaterialID; + } + return *this; +} + + +void DRTIonRangeCompensatorSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CompensatorDescription.clear(); + CompensatorNumber.clear(); + MaterialID.clear(); + CompensatorID.clear(); + AccessoryCode.clear(); + IsocenterToCompensatorTrayDistance.clear(); + CompensatorDivergence.clear(); + CompensatorMountingPosition.clear(); + CompensatorRows.clear(); + CompensatorColumns.clear(); + CompensatorPixelSpacing.clear(); + CompensatorPosition.clear(); + CompensatorColumnOffset.clear(); + CompensatorThicknessData.clear(); + IsocenterToCompensatorDistances.clear(); + CompensatorRelativeStoppingPowerRatio.clear(); + CompensatorMillingToolDiameter.clear(); + } +} + + +OFBool DRTIonRangeCompensatorSequence::Item::isEmpty() +{ + return CompensatorDescription.isEmpty() && + CompensatorNumber.isEmpty() && + MaterialID.isEmpty() && + CompensatorID.isEmpty() && + AccessoryCode.isEmpty() && + IsocenterToCompensatorTrayDistance.isEmpty() && + CompensatorDivergence.isEmpty() && + CompensatorMountingPosition.isEmpty() && + CompensatorRows.isEmpty() && + CompensatorColumns.isEmpty() && + CompensatorPixelSpacing.isEmpty() && + CompensatorPosition.isEmpty() && + CompensatorColumnOffset.isEmpty() && + CompensatorThicknessData.isEmpty() && + IsocenterToCompensatorDistances.isEmpty() && + CompensatorRelativeStoppingPowerRatio.isEmpty() && + CompensatorMillingToolDiameter.isEmpty(); +} + + +OFBool DRTIonRangeCompensatorSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CompensatorDescription, "1", "3", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorNumber, "1", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "2", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorID, "1", "3", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, IsocenterToCompensatorTrayDistance, "1", "1C", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorDivergence, "1", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorMountingPosition, "1", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorRows, "1", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorColumns, "1", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorPixelSpacing, "2", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorPosition, "2", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorColumnOffset, "1", "1C", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorThicknessData, "1-n", "1", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, IsocenterToCompensatorDistances, "1-n", "1C", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorRelativeStoppingPowerRatio, "1", "3", "IonRangeCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorMillingToolDiameter, "1", "3", "IonRangeCompensatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongText(CompensatorDescription), "1", "3", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmIntegerString(CompensatorNumber), "1", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "2", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmShortString(CompensatorID), "1", "3", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToCompensatorTrayDistance), "1", "1C", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmCodeString(CompensatorDivergence), "1", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmCodeString(CompensatorMountingPosition), "1", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmIntegerString(CompensatorRows), "1", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmIntegerString(CompensatorColumns), "1", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(CompensatorPixelSpacing), "2", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(CompensatorPosition), "2", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(CompensatorColumnOffset), "1", "1C", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmDecimalString(CompensatorThicknessData), "1-n", "1", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToCompensatorDistances), "1-n", "1C", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(CompensatorRelativeStoppingPowerRatio), "1", "3", "IonRangeCompensatorSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(CompensatorMillingToolDiameter), "1", "3", "IonRangeCompensatorSequence"); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorColumnOffset(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, CompensatorColumnOffset).getFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorColumns(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorColumns, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorColumns(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CompensatorColumns).getSint32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorDescription, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorDivergence(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorDivergence, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorID, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorMillingToolDiameter(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, CompensatorMillingToolDiameter).getFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorMountingPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorMountingPosition, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorNumber, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CompensatorNumber).getSint32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorPixelSpacing(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorPixelSpacing, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorPixelSpacing(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPixelSpacing).getFloat64(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorPixelSpacing(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPixelSpacing).getFloat64Vector(value); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorPosition, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorPosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPosition).getFloat64(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorPosition(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorPosition).getFloat64Vector(value); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorRelativeStoppingPowerRatio(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, CompensatorRelativeStoppingPowerRatio).getFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorRows(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorRows, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorRows(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CompensatorRows).getSint32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorThicknessData(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorThicknessData, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorThicknessData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorThicknessData).getFloat64(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getCompensatorThicknessData(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CompensatorThicknessData).getFloat64Vector(value); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getIsocenterToCompensatorDistances(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToCompensatorDistances).getFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getIsocenterToCompensatorTrayDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToCompensatorTrayDistance).getFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorColumnOffset(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return CompensatorColumnOffset.putFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorColumns(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorColumns.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CompensatorDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorDivergence(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorDivergence.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorMillingToolDiameter(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return CompensatorMillingToolDiameter.putFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorMountingPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorMountingPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorPixelSpacing(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = CompensatorPixelSpacing.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = CompensatorPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorRelativeStoppingPowerRatio(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return CompensatorRelativeStoppingPowerRatio.putFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorRows(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorRows.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setCompensatorThicknessData(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = CompensatorThicknessData.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setIsocenterToCompensatorDistances(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToCompensatorDistances.putFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setIsocenterToCompensatorTrayDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToCompensatorTrayDistance.putFloat32(value, pos); +} + + +OFCondition DRTIonRangeCompensatorSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIonRangeCompensatorSequence::DRTIonRangeCompensatorSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonRangeCompensatorSequence::DRTIonRangeCompensatorSequence(const DRTIonRangeCompensatorSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonRangeCompensatorSequence &DRTIonRangeCompensatorSequence::operator=(const DRTIonRangeCompensatorSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonRangeCompensatorSequence::~DRTIonRangeCompensatorSequence() +{ + clear(); +} + + +void DRTIonRangeCompensatorSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonRangeCompensatorSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonRangeCompensatorSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonRangeCompensatorSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonRangeCompensatorSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonRangeCompensatorSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonRangeCompensatorSequence::Item &DRTIonRangeCompensatorSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonRangeCompensatorSequence::Item &DRTIonRangeCompensatorSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonRangeCompensatorSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonRangeCompensatorSequence::Item &DRTIonRangeCompensatorSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonRangeCompensatorSequence::Item &DRTIonRangeCompensatorSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonRangeCompensatorSequence::Item &DRTIonRangeCompensatorSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonRangeCompensatorSequence::Item &DRTIonRangeCompensatorSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonRangeCompensatorSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonRangeCompensatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonRangeCompensatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonRangeCompensatorSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonRangeCompensatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtiseis.cc b/dcmrt/libsrc/drtiseis.cc new file mode 100644 index 00000000..29fc8815 --- /dev/null +++ b/dcmrt/libsrc/drtiseis.cc @@ -0,0 +1,602 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIssuerOfServiceEpisodeIDSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtiseis.h" + + +// --- item class --- + +DRTIssuerOfServiceEpisodeIDSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LocalNamespaceEntityID(DCM_LocalNamespaceEntityID), + UniversalEntityID(DCM_UniversalEntityID), + UniversalEntityIDType(DCM_UniversalEntityIDType) +{ +} + + +DRTIssuerOfServiceEpisodeIDSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LocalNamespaceEntityID(copy.LocalNamespaceEntityID), + UniversalEntityID(copy.UniversalEntityID), + UniversalEntityIDType(copy.UniversalEntityIDType) +{ +} + + +DRTIssuerOfServiceEpisodeIDSequence::Item::~Item() +{ +} + + +DRTIssuerOfServiceEpisodeIDSequence::Item &DRTIssuerOfServiceEpisodeIDSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LocalNamespaceEntityID = copy.LocalNamespaceEntityID; + UniversalEntityID = copy.UniversalEntityID; + UniversalEntityIDType = copy.UniversalEntityIDType; + } + return *this; +} + + +void DRTIssuerOfServiceEpisodeIDSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + LocalNamespaceEntityID.clear(); + UniversalEntityID.clear(); + UniversalEntityIDType.clear(); + } +} + + +OFBool DRTIssuerOfServiceEpisodeIDSequence::Item::isEmpty() +{ + return LocalNamespaceEntityID.isEmpty() && + UniversalEntityID.isEmpty() && + UniversalEntityIDType.isEmpty(); +} + + +OFBool DRTIssuerOfServiceEpisodeIDSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, LocalNamespaceEntityID, "1", "1C", "IssuerOfServiceEpisodeIDSequence"); + getAndCheckElementFromDataset(item, UniversalEntityID, "1", "1C", "IssuerOfServiceEpisodeIDSequence"); + getAndCheckElementFromDataset(item, UniversalEntityIDType, "1", "1C", "IssuerOfServiceEpisodeIDSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnlimitedText(LocalNamespaceEntityID), "1", "1C", "IssuerOfServiceEpisodeIDSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(UniversalEntityID), "1", "1C", "IssuerOfServiceEpisodeIDSequence"); + addElementToDataset(result, item, new DcmCodeString(UniversalEntityIDType), "1", "1C", "IssuerOfServiceEpisodeIDSequence"); + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::getLocalNamespaceEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LocalNamespaceEntityID, value, pos); +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::getUniversalEntityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityID, value, pos); +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::getUniversalEntityIDType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniversalEntityIDType, value, pos); +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::setLocalNamespaceEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = LocalNamespaceEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::setUniversalEntityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = UniversalEntityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::Item::setUniversalEntityIDType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UniversalEntityIDType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIssuerOfServiceEpisodeIDSequence::DRTIssuerOfServiceEpisodeIDSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIssuerOfServiceEpisodeIDSequence::DRTIssuerOfServiceEpisodeIDSequence(const DRTIssuerOfServiceEpisodeIDSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIssuerOfServiceEpisodeIDSequence &DRTIssuerOfServiceEpisodeIDSequence::operator=(const DRTIssuerOfServiceEpisodeIDSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIssuerOfServiceEpisodeIDSequence::~DRTIssuerOfServiceEpisodeIDSequence() +{ + clear(); +} + + +void DRTIssuerOfServiceEpisodeIDSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIssuerOfServiceEpisodeIDSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIssuerOfServiceEpisodeIDSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIssuerOfServiceEpisodeIDSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIssuerOfServiceEpisodeIDSequence::Item &DRTIssuerOfServiceEpisodeIDSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIssuerOfServiceEpisodeIDSequence::Item &DRTIssuerOfServiceEpisodeIDSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIssuerOfServiceEpisodeIDSequence::Item &DRTIssuerOfServiceEpisodeIDSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIssuerOfServiceEpisodeIDSequence::Item &DRTIssuerOfServiceEpisodeIDSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIssuerOfServiceEpisodeIDSequence::Item &DRTIssuerOfServiceEpisodeIDSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIssuerOfServiceEpisodeIDSequence::Item &DRTIssuerOfServiceEpisodeIDSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IssuerOfServiceEpisodeIDSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IssuerOfServiceEpisodeIDSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIssuerOfServiceEpisodeIDSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IssuerOfServiceEpisodeIDSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtitts.cc b/dcmrt/libsrc/drtitts.cc new file mode 100644 index 00000000..9f6f1f2d --- /dev/null +++ b/dcmrt/libsrc/drtitts.cc @@ -0,0 +1,1044 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonToleranceTableSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtitts.h" + + +// --- item class --- + +DRTIonToleranceTableSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamLimitingDeviceAngleTolerance(DCM_BeamLimitingDeviceAngleTolerance), + BeamLimitingDeviceToleranceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ChairHeadFramePositionTolerance(DCM_ChairHeadFramePositionTolerance), + FixationLightAzimuthalAngleTolerance(DCM_FixationLightAzimuthalAngleTolerance), + FixationLightPolarAngleTolerance(DCM_FixationLightPolarAngleTolerance), + GantryAngleTolerance(DCM_GantryAngleTolerance), + HeadFixationAngleTolerance(DCM_HeadFixationAngleTolerance), + PatientSupportAngleTolerance(DCM_PatientSupportAngleTolerance), + SnoutPositionTolerance(DCM_SnoutPositionTolerance), + TableTopLateralPositionTolerance(DCM_TableTopLateralPositionTolerance), + TableTopLongitudinalPositionTolerance(DCM_TableTopLongitudinalPositionTolerance), + TableTopPitchAngleTolerance(DCM_TableTopPitchAngleTolerance), + TableTopRollAngleTolerance(DCM_TableTopRollAngleTolerance), + TableTopVerticalPositionTolerance(DCM_TableTopVerticalPositionTolerance), + ToleranceTableLabel(DCM_ToleranceTableLabel), + ToleranceTableNumber(DCM_ToleranceTableNumber) +{ +} + + +DRTIonToleranceTableSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamLimitingDeviceAngleTolerance(copy.BeamLimitingDeviceAngleTolerance), + BeamLimitingDeviceToleranceSequence(copy.BeamLimitingDeviceToleranceSequence), + ChairHeadFramePositionTolerance(copy.ChairHeadFramePositionTolerance), + FixationLightAzimuthalAngleTolerance(copy.FixationLightAzimuthalAngleTolerance), + FixationLightPolarAngleTolerance(copy.FixationLightPolarAngleTolerance), + GantryAngleTolerance(copy.GantryAngleTolerance), + HeadFixationAngleTolerance(copy.HeadFixationAngleTolerance), + PatientSupportAngleTolerance(copy.PatientSupportAngleTolerance), + SnoutPositionTolerance(copy.SnoutPositionTolerance), + TableTopLateralPositionTolerance(copy.TableTopLateralPositionTolerance), + TableTopLongitudinalPositionTolerance(copy.TableTopLongitudinalPositionTolerance), + TableTopPitchAngleTolerance(copy.TableTopPitchAngleTolerance), + TableTopRollAngleTolerance(copy.TableTopRollAngleTolerance), + TableTopVerticalPositionTolerance(copy.TableTopVerticalPositionTolerance), + ToleranceTableLabel(copy.ToleranceTableLabel), + ToleranceTableNumber(copy.ToleranceTableNumber) +{ +} + + +DRTIonToleranceTableSequence::Item::~Item() +{ +} + + +DRTIonToleranceTableSequence::Item &DRTIonToleranceTableSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamLimitingDeviceAngleTolerance = copy.BeamLimitingDeviceAngleTolerance; + BeamLimitingDeviceToleranceSequence = copy.BeamLimitingDeviceToleranceSequence; + ChairHeadFramePositionTolerance = copy.ChairHeadFramePositionTolerance; + FixationLightAzimuthalAngleTolerance = copy.FixationLightAzimuthalAngleTolerance; + FixationLightPolarAngleTolerance = copy.FixationLightPolarAngleTolerance; + GantryAngleTolerance = copy.GantryAngleTolerance; + HeadFixationAngleTolerance = copy.HeadFixationAngleTolerance; + PatientSupportAngleTolerance = copy.PatientSupportAngleTolerance; + SnoutPositionTolerance = copy.SnoutPositionTolerance; + TableTopLateralPositionTolerance = copy.TableTopLateralPositionTolerance; + TableTopLongitudinalPositionTolerance = copy.TableTopLongitudinalPositionTolerance; + TableTopPitchAngleTolerance = copy.TableTopPitchAngleTolerance; + TableTopRollAngleTolerance = copy.TableTopRollAngleTolerance; + TableTopVerticalPositionTolerance = copy.TableTopVerticalPositionTolerance; + ToleranceTableLabel = copy.ToleranceTableLabel; + ToleranceTableNumber = copy.ToleranceTableNumber; + } + return *this; +} + + +void DRTIonToleranceTableSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ToleranceTableNumber.clear(); + ToleranceTableLabel.clear(); + GantryAngleTolerance.clear(); + BeamLimitingDeviceAngleTolerance.clear(); + BeamLimitingDeviceToleranceSequence.clear(); + PatientSupportAngleTolerance.clear(); + TableTopVerticalPositionTolerance.clear(); + TableTopLongitudinalPositionTolerance.clear(); + TableTopLateralPositionTolerance.clear(); + TableTopPitchAngleTolerance.clear(); + TableTopRollAngleTolerance.clear(); + SnoutPositionTolerance.clear(); + HeadFixationAngleTolerance.clear(); + ChairHeadFramePositionTolerance.clear(); + FixationLightAzimuthalAngleTolerance.clear(); + FixationLightPolarAngleTolerance.clear(); + } +} + + +OFBool DRTIonToleranceTableSequence::Item::isEmpty() +{ + return ToleranceTableNumber.isEmpty() && + ToleranceTableLabel.isEmpty() && + GantryAngleTolerance.isEmpty() && + BeamLimitingDeviceAngleTolerance.isEmpty() && + BeamLimitingDeviceToleranceSequence.isEmpty() && + PatientSupportAngleTolerance.isEmpty() && + TableTopVerticalPositionTolerance.isEmpty() && + TableTopLongitudinalPositionTolerance.isEmpty() && + TableTopLateralPositionTolerance.isEmpty() && + TableTopPitchAngleTolerance.isEmpty() && + TableTopRollAngleTolerance.isEmpty() && + SnoutPositionTolerance.isEmpty() && + HeadFixationAngleTolerance.isEmpty() && + ChairHeadFramePositionTolerance.isEmpty() && + FixationLightAzimuthalAngleTolerance.isEmpty() && + FixationLightPolarAngleTolerance.isEmpty(); +} + + +OFBool DRTIonToleranceTableSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonToleranceTableSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ToleranceTableNumber, "1", "1", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, ToleranceTableLabel, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, GantryAngleTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceAngleTolerance, "1", "3", "IonToleranceTableSequence"); + BeamLimitingDeviceToleranceSequence.read(item, "1-n", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, PatientSupportAngleTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopVerticalPositionTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopLongitudinalPositionTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopLateralPositionTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopPitchAngleTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopRollAngleTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, SnoutPositionTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, HeadFixationAngleTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, ChairHeadFramePositionTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, FixationLightAzimuthalAngleTolerance, "1", "3", "IonToleranceTableSequence"); + getAndCheckElementFromDataset(item, FixationLightPolarAngleTolerance, "1", "3", "IonToleranceTableSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ToleranceTableNumber), "1", "1", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmShortString(ToleranceTableLabel), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(GantryAngleTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamLimitingDeviceAngleTolerance), "1", "3", "IonToleranceTableSequence"); + if (result.good()) result = BeamLimitingDeviceToleranceSequence.write(item, "1-n", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(PatientSupportAngleTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopVerticalPositionTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLongitudinalPositionTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLateralPositionTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopPitchAngleTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopRollAngleTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(SnoutPositionTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(HeadFixationAngleTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(ChairHeadFramePositionTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(FixationLightAzimuthalAngleTolerance), "1", "3", "IonToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(FixationLightPolarAngleTolerance), "1", "3", "IonToleranceTableSequence"); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::getBeamLimitingDeviceAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceAngleTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getBeamLimitingDeviceAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamLimitingDeviceAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getChairHeadFramePositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChairHeadFramePositionTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getChairHeadFramePositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ChairHeadFramePositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getFixationLightAzimuthalAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationLightAzimuthalAngleTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getFixationLightAzimuthalAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, FixationLightAzimuthalAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getFixationLightPolarAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationLightPolarAngleTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getFixationLightPolarAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, FixationLightPolarAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getGantryAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryAngleTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getGantryAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, GantryAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getHeadFixationAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(HeadFixationAngleTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getHeadFixationAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, HeadFixationAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getPatientSupportAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAngleTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getPatientSupportAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, PatientSupportAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getSnoutPositionTolerance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, SnoutPositionTolerance).getFloat32(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopLateralPositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLateralPositionTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopLateralPositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLateralPositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopLongitudinalPositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLongitudinalPositionTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopLongitudinalPositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalPositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopPitchAngleTolerance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopPitchAngleTolerance).getFloat32(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopRollAngleTolerance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopRollAngleTolerance).getFloat32(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopVerticalPositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopVerticalPositionTolerance, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getTableTopVerticalPositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopVerticalPositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getToleranceTableLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ToleranceTableLabel, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getToleranceTableNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ToleranceTableNumber, value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::getToleranceTableNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ToleranceTableNumber).getSint32(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::setBeamLimitingDeviceAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setChairHeadFramePositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChairHeadFramePositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setFixationLightAzimuthalAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FixationLightAzimuthalAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setFixationLightPolarAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FixationLightPolarAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setGantryAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setHeadFixationAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = HeadFixationAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setPatientSupportAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setSnoutPositionTolerance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return SnoutPositionTolerance.putFloat32(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::setTableTopLateralPositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralPositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setTableTopLongitudinalPositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalPositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setTableTopPitchAngleTolerance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopPitchAngleTolerance.putFloat32(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::setTableTopRollAngleTolerance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopRollAngleTolerance.putFloat32(value, pos); +} + + +OFCondition DRTIonToleranceTableSequence::Item::setTableTopVerticalPositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalPositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setToleranceTableLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ToleranceTableLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::Item::setToleranceTableNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ToleranceTableNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIonToleranceTableSequence::DRTIonToleranceTableSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonToleranceTableSequence::DRTIonToleranceTableSequence(const DRTIonToleranceTableSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonToleranceTableSequence &DRTIonToleranceTableSequence::operator=(const DRTIonToleranceTableSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonToleranceTableSequence::~DRTIonToleranceTableSequence() +{ + clear(); +} + + +void DRTIonToleranceTableSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonToleranceTableSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonToleranceTableSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonToleranceTableSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonToleranceTableSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonToleranceTableSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonToleranceTableSequence::Item &DRTIonToleranceTableSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonToleranceTableSequence::Item &DRTIonToleranceTableSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonToleranceTableSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonToleranceTableSequence::Item &DRTIonToleranceTableSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonToleranceTableSequence::Item &DRTIonToleranceTableSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonToleranceTableSequence::Item &DRTIonToleranceTableSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonToleranceTableSequence::Item &DRTIonToleranceTableSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonToleranceTableSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonToleranceTableSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonToleranceTableSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonToleranceTableSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonToleranceTableSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtiwps.cc b/dcmrt/libsrc/drtiwps.cc new file mode 100644 index 00000000..c043d21c --- /dev/null +++ b/dcmrt/libsrc/drtiwps.cc @@ -0,0 +1,607 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonWedgePositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtiwps.h" + + +// --- item class --- + +DRTIonWedgePositionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedWedgeNumber(DCM_ReferencedWedgeNumber), + WedgePosition(DCM_WedgePosition), + WedgeThinEdgePosition(DCM_WedgeThinEdgePosition) +{ +} + + +DRTIonWedgePositionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedWedgeNumber(copy.ReferencedWedgeNumber), + WedgePosition(copy.WedgePosition), + WedgeThinEdgePosition(copy.WedgeThinEdgePosition) +{ +} + + +DRTIonWedgePositionSequence::Item::~Item() +{ +} + + +DRTIonWedgePositionSequence::Item &DRTIonWedgePositionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedWedgeNumber = copy.ReferencedWedgeNumber; + WedgePosition = copy.WedgePosition; + WedgeThinEdgePosition = copy.WedgeThinEdgePosition; + } + return *this; +} + + +void DRTIonWedgePositionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedWedgeNumber.clear(); + WedgePosition.clear(); + WedgeThinEdgePosition.clear(); + } +} + + +OFBool DRTIonWedgePositionSequence::Item::isEmpty() +{ + return ReferencedWedgeNumber.isEmpty() && + WedgePosition.isEmpty() && + WedgeThinEdgePosition.isEmpty(); +} + + +OFBool DRTIonWedgePositionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonWedgePositionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedWedgeNumber, "1", "1", "IonWedgePositionSequence"); + getAndCheckElementFromDataset(item, WedgePosition, "1", "1", "IonWedgePositionSequence"); + getAndCheckElementFromDataset(item, WedgeThinEdgePosition, "1", "1C", "IonWedgePositionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedWedgeNumber), "1", "1", "IonWedgePositionSequence"); + addElementToDataset(result, item, new DcmCodeString(WedgePosition), "1", "1", "IonWedgePositionSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(WedgeThinEdgePosition), "1", "1C", "IonWedgePositionSequence"); + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::Item::getReferencedWedgeNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedWedgeNumber, value, pos); +} + + +OFCondition DRTIonWedgePositionSequence::Item::getReferencedWedgeNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedWedgeNumber).getSint32(value, pos); +} + + +OFCondition DRTIonWedgePositionSequence::Item::getWedgePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgePosition, value, pos); +} + + +OFCondition DRTIonWedgePositionSequence::Item::getWedgeThinEdgePosition(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, WedgeThinEdgePosition).getFloat32(value, pos); +} + + +OFCondition DRTIonWedgePositionSequence::Item::setReferencedWedgeNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedWedgeNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::Item::setWedgePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgePosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::Item::setWedgeThinEdgePosition(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return WedgeThinEdgePosition.putFloat32(value, pos); +} + + +// --- sequence class --- + +DRTIonWedgePositionSequence::DRTIonWedgePositionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonWedgePositionSequence::DRTIonWedgePositionSequence(const DRTIonWedgePositionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonWedgePositionSequence &DRTIonWedgePositionSequence::operator=(const DRTIonWedgePositionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonWedgePositionSequence::~DRTIonWedgePositionSequence() +{ + clear(); +} + + +void DRTIonWedgePositionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonWedgePositionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonWedgePositionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonWedgePositionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonWedgePositionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonWedgePositionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonWedgePositionSequence::Item &DRTIonWedgePositionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonWedgePositionSequence::Item &DRTIonWedgePositionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonWedgePositionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonWedgePositionSequence::Item &DRTIonWedgePositionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonWedgePositionSequence::Item &DRTIonWedgePositionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonWedgePositionSequence::Item &DRTIonWedgePositionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonWedgePositionSequence::Item &DRTIonWedgePositionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonWedgePositionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonWedgePositionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonWedgePositionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonWedgePositionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonWedgePositionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtiws.cc b/dcmrt/libsrc/drtiws.cc new file mode 100644 index 00000000..488532d5 --- /dev/null +++ b/dcmrt/libsrc/drtiws.cc @@ -0,0 +1,741 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTIonWedgeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtiws.h" + + +// --- item class --- + +DRTIonWedgeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + IsocenterToWedgeTrayDistance(DCM_IsocenterToWedgeTrayDistance), + WedgeAngle(DCM_WedgeAngle), + WedgeID(DCM_WedgeID), + WedgeNumber(DCM_WedgeNumber), + WedgeOrientation(DCM_WedgeOrientation), + WedgeType(DCM_WedgeType) +{ +} + + +DRTIonWedgeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + IsocenterToWedgeTrayDistance(copy.IsocenterToWedgeTrayDistance), + WedgeAngle(copy.WedgeAngle), + WedgeID(copy.WedgeID), + WedgeNumber(copy.WedgeNumber), + WedgeOrientation(copy.WedgeOrientation), + WedgeType(copy.WedgeType) +{ +} + + +DRTIonWedgeSequence::Item::~Item() +{ +} + + +DRTIonWedgeSequence::Item &DRTIonWedgeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + IsocenterToWedgeTrayDistance = copy.IsocenterToWedgeTrayDistance; + WedgeAngle = copy.WedgeAngle; + WedgeID = copy.WedgeID; + WedgeNumber = copy.WedgeNumber; + WedgeOrientation = copy.WedgeOrientation; + WedgeType = copy.WedgeType; + } + return *this; +} + + +void DRTIonWedgeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + WedgeNumber.clear(); + WedgeType.clear(); + WedgeID.clear(); + AccessoryCode.clear(); + WedgeAngle.clear(); + WedgeOrientation.clear(); + IsocenterToWedgeTrayDistance.clear(); + } +} + + +OFBool DRTIonWedgeSequence::Item::isEmpty() +{ + return WedgeNumber.isEmpty() && + WedgeType.isEmpty() && + WedgeID.isEmpty() && + AccessoryCode.isEmpty() && + WedgeAngle.isEmpty() && + WedgeOrientation.isEmpty() && + IsocenterToWedgeTrayDistance.isEmpty(); +} + + +OFBool DRTIonWedgeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTIonWedgeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, WedgeNumber, "1", "1", "IonWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeType, "1", "2", "IonWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeID, "1", "3", "IonWedgeSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "IonWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeAngle, "1", "2", "IonWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeOrientation, "1", "2", "IonWedgeSequence"); + getAndCheckElementFromDataset(item, IsocenterToWedgeTrayDistance, "1", "1", "IonWedgeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonWedgeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(WedgeNumber), "1", "1", "IonWedgeSequence"); + addElementToDataset(result, item, new DcmCodeString(WedgeType), "1", "2", "IonWedgeSequence"); + addElementToDataset(result, item, new DcmShortString(WedgeID), "1", "3", "IonWedgeSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "IonWedgeSequence"); + addElementToDataset(result, item, new DcmIntegerString(WedgeAngle), "1", "2", "IonWedgeSequence"); + addElementToDataset(result, item, new DcmDecimalString(WedgeOrientation), "1", "2", "IonWedgeSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToWedgeTrayDistance), "1", "1", "IonWedgeSequence"); + } + return result; +} + + +OFCondition DRTIonWedgeSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getIsocenterToWedgeTrayDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToWedgeTrayDistance).getFloat32(value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeAngle, value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeAngle(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, WedgeAngle).getSint32(value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeID, value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeNumber, value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, WedgeNumber).getSint32(value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeOrientation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeOrientation, value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeOrientation(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, WedgeOrientation).getFloat64(value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::getWedgeType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeType, value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonWedgeSequence::Item::setIsocenterToWedgeTrayDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToWedgeTrayDistance.putFloat32(value, pos); +} + + +OFCondition DRTIonWedgeSequence::Item::setWedgeAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonWedgeSequence::Item::setWedgeID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonWedgeSequence::Item::setWedgeNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonWedgeSequence::Item::setWedgeOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeOrientation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTIonWedgeSequence::Item::setWedgeType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTIonWedgeSequence::DRTIonWedgeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTIonWedgeSequence::DRTIonWedgeSequence(const DRTIonWedgeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTIonWedgeSequence &DRTIonWedgeSequence::operator=(const DRTIonWedgeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTIonWedgeSequence::~DRTIonWedgeSequence() +{ + clear(); +} + + +void DRTIonWedgeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTIonWedgeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTIonWedgeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTIonWedgeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTIonWedgeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonWedgeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTIonWedgeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonWedgeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonWedgeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTIonWedgeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTIonWedgeSequence::Item &DRTIonWedgeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTIonWedgeSequence::Item &DRTIonWedgeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTIonWedgeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTIonWedgeSequence::Item &DRTIonWedgeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTIonWedgeSequence::Item &DRTIonWedgeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTIonWedgeSequence::Item &DRTIonWedgeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTIonWedgeSequence::Item &DRTIonWedgeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTIonWedgeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTIonWedgeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTIonWedgeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTIonWedgeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_IonWedgeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_IonWedgeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTIonWedgeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_IonWedgeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtlsds.cc b/dcmrt/libsrc/drtlsds.cc new file mode 100644 index 00000000..ccbe1f56 --- /dev/null +++ b/dcmrt/libsrc/drtlsds.cc @@ -0,0 +1,669 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTLateralSpreadingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtlsds.h" + + +// --- item class --- + +DRTLateralSpreadingDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + LateralSpreadingDeviceDescription(DCM_LateralSpreadingDeviceDescription), + LateralSpreadingDeviceID(DCM_LateralSpreadingDeviceID), + LateralSpreadingDeviceNumber(DCM_LateralSpreadingDeviceNumber), + LateralSpreadingDeviceType(DCM_LateralSpreadingDeviceType) +{ +} + + +DRTLateralSpreadingDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + LateralSpreadingDeviceDescription(copy.LateralSpreadingDeviceDescription), + LateralSpreadingDeviceID(copy.LateralSpreadingDeviceID), + LateralSpreadingDeviceNumber(copy.LateralSpreadingDeviceNumber), + LateralSpreadingDeviceType(copy.LateralSpreadingDeviceType) +{ +} + + +DRTLateralSpreadingDeviceSequence::Item::~Item() +{ +} + + +DRTLateralSpreadingDeviceSequence::Item &DRTLateralSpreadingDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + LateralSpreadingDeviceDescription = copy.LateralSpreadingDeviceDescription; + LateralSpreadingDeviceID = copy.LateralSpreadingDeviceID; + LateralSpreadingDeviceNumber = copy.LateralSpreadingDeviceNumber; + LateralSpreadingDeviceType = copy.LateralSpreadingDeviceType; + } + return *this; +} + + +void DRTLateralSpreadingDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + LateralSpreadingDeviceNumber.clear(); + LateralSpreadingDeviceID.clear(); + AccessoryCode.clear(); + LateralSpreadingDeviceType.clear(); + LateralSpreadingDeviceDescription.clear(); + } +} + + +OFBool DRTLateralSpreadingDeviceSequence::Item::isEmpty() +{ + return LateralSpreadingDeviceNumber.isEmpty() && + LateralSpreadingDeviceID.isEmpty() && + AccessoryCode.isEmpty() && + LateralSpreadingDeviceType.isEmpty() && + LateralSpreadingDeviceDescription.isEmpty(); +} + + +OFBool DRTLateralSpreadingDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceNumber, "1", "1", "LateralSpreadingDeviceSequence"); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceID, "1", "1", "LateralSpreadingDeviceSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "LateralSpreadingDeviceSequence"); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceType, "1", "1", "LateralSpreadingDeviceSequence"); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceDescription, "1", "3", "LateralSpreadingDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(LateralSpreadingDeviceNumber), "1", "1", "LateralSpreadingDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(LateralSpreadingDeviceID), "1", "1", "LateralSpreadingDeviceSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "LateralSpreadingDeviceSequence"); + addElementToDataset(result, item, new DcmCodeString(LateralSpreadingDeviceType), "1", "1", "LateralSpreadingDeviceSequence"); + addElementToDataset(result, item, new DcmLongString(LateralSpreadingDeviceDescription), "1", "3", "LateralSpreadingDeviceSequence"); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::getLateralSpreadingDeviceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LateralSpreadingDeviceDescription, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::getLateralSpreadingDeviceID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LateralSpreadingDeviceID, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::getLateralSpreadingDeviceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LateralSpreadingDeviceNumber, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::getLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, LateralSpreadingDeviceNumber).getSint32(value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::getLateralSpreadingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LateralSpreadingDeviceType, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::setLateralSpreadingDeviceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LateralSpreadingDeviceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::setLateralSpreadingDeviceID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LateralSpreadingDeviceID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::setLateralSpreadingDeviceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LateralSpreadingDeviceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::Item::setLateralSpreadingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LateralSpreadingDeviceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTLateralSpreadingDeviceSequence::DRTLateralSpreadingDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTLateralSpreadingDeviceSequence::DRTLateralSpreadingDeviceSequence(const DRTLateralSpreadingDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTLateralSpreadingDeviceSequence &DRTLateralSpreadingDeviceSequence::operator=(const DRTLateralSpreadingDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTLateralSpreadingDeviceSequence::~DRTLateralSpreadingDeviceSequence() +{ + clear(); +} + + +void DRTLateralSpreadingDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTLateralSpreadingDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTLateralSpreadingDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTLateralSpreadingDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTLateralSpreadingDeviceSequence::Item &DRTLateralSpreadingDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTLateralSpreadingDeviceSequence::Item &DRTLateralSpreadingDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTLateralSpreadingDeviceSequence::Item &DRTLateralSpreadingDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTLateralSpreadingDeviceSequence::Item &DRTLateralSpreadingDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTLateralSpreadingDeviceSequence::Item &DRTLateralSpreadingDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTLateralSpreadingDeviceSequence::Item &DRTLateralSpreadingDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTLateralSpreadingDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_LateralSpreadingDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_LateralSpreadingDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_LateralSpreadingDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtlsds6.cc b/dcmrt/libsrc/drtlsds6.cc new file mode 100644 index 00000000..1003c816 --- /dev/null +++ b/dcmrt/libsrc/drtlsds6.cc @@ -0,0 +1,632 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtlsds6.h" + + +// --- item class --- + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + IsocenterToLateralSpreadingDeviceDistance(DCM_IsocenterToLateralSpreadingDeviceDistance), + LateralSpreadingDeviceSetting(DCM_LateralSpreadingDeviceSetting), + LateralSpreadingDeviceWaterEquivalentThickness(DCM_LateralSpreadingDeviceWaterEquivalentThickness), + ReferencedLateralSpreadingDeviceNumber(DCM_ReferencedLateralSpreadingDeviceNumber) +{ +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + IsocenterToLateralSpreadingDeviceDistance(copy.IsocenterToLateralSpreadingDeviceDistance), + LateralSpreadingDeviceSetting(copy.LateralSpreadingDeviceSetting), + LateralSpreadingDeviceWaterEquivalentThickness(copy.LateralSpreadingDeviceWaterEquivalentThickness), + ReferencedLateralSpreadingDeviceNumber(copy.ReferencedLateralSpreadingDeviceNumber) +{ +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + IsocenterToLateralSpreadingDeviceDistance = copy.IsocenterToLateralSpreadingDeviceDistance; + LateralSpreadingDeviceSetting = copy.LateralSpreadingDeviceSetting; + LateralSpreadingDeviceWaterEquivalentThickness = copy.LateralSpreadingDeviceWaterEquivalentThickness; + ReferencedLateralSpreadingDeviceNumber = copy.ReferencedLateralSpreadingDeviceNumber; + } + return *this; +} + + +void DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedLateralSpreadingDeviceNumber.clear(); + LateralSpreadingDeviceSetting.clear(); + IsocenterToLateralSpreadingDeviceDistance.clear(); + LateralSpreadingDeviceWaterEquivalentThickness.clear(); + } +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return ReferencedLateralSpreadingDeviceNumber.isEmpty() && + LateralSpreadingDeviceSetting.isEmpty() && + IsocenterToLateralSpreadingDeviceDistance.isEmpty() && + LateralSpreadingDeviceWaterEquivalentThickness.isEmpty(); +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedLateralSpreadingDeviceNumber, "1", "1", "LateralSpreadingDeviceSettingsSequence"); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceSetting, "1", "1", "LateralSpreadingDeviceSettingsSequence"); + getAndCheckElementFromDataset(item, IsocenterToLateralSpreadingDeviceDistance, "1", "3", "LateralSpreadingDeviceSettingsSequence"); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceWaterEquivalentThickness, "1", "3", "LateralSpreadingDeviceSettingsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedLateralSpreadingDeviceNumber), "1", "1", "LateralSpreadingDeviceSettingsSequence"); + addElementToDataset(result, item, new DcmLongString(LateralSpreadingDeviceSetting), "1", "1", "LateralSpreadingDeviceSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToLateralSpreadingDeviceDistance), "1", "3", "LateralSpreadingDeviceSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(LateralSpreadingDeviceWaterEquivalentThickness), "1", "3", "LateralSpreadingDeviceSettingsSequence"); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::getIsocenterToLateralSpreadingDeviceDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToLateralSpreadingDeviceDistance).getFloat32(value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::getLateralSpreadingDeviceSetting(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LateralSpreadingDeviceSetting, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::getLateralSpreadingDeviceWaterEquivalentThickness(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, LateralSpreadingDeviceWaterEquivalentThickness).getFloat32(value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::getReferencedLateralSpreadingDeviceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedLateralSpreadingDeviceNumber, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::getReferencedLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedLateralSpreadingDeviceNumber).getSint32(value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::setIsocenterToLateralSpreadingDeviceDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToLateralSpreadingDeviceDistance.putFloat32(value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::setLateralSpreadingDeviceSetting(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LateralSpreadingDeviceSetting.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::setLateralSpreadingDeviceWaterEquivalentThickness(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return LateralSpreadingDeviceWaterEquivalentThickness.putFloat32(value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item::setReferencedLateralSpreadingDeviceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedLateralSpreadingDeviceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::operator=(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::~DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_LateralSpreadingDeviceSettingsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_LateralSpreadingDeviceSettingsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_LateralSpreadingDeviceSettingsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtlsds7.cc b/dcmrt/libsrc/drtlsds7.cc new file mode 100644 index 00000000..a008d3c0 --- /dev/null +++ b/dcmrt/libsrc/drtlsds7.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtlsds7.h" + + +// --- item class --- + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LateralSpreadingDeviceSetting(DCM_LateralSpreadingDeviceSetting), + ReferencedLateralSpreadingDeviceNumber(DCM_ReferencedLateralSpreadingDeviceNumber) +{ +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LateralSpreadingDeviceSetting(copy.LateralSpreadingDeviceSetting), + ReferencedLateralSpreadingDeviceNumber(copy.ReferencedLateralSpreadingDeviceNumber) +{ +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::~Item() +{ +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LateralSpreadingDeviceSetting = copy.LateralSpreadingDeviceSetting; + ReferencedLateralSpreadingDeviceNumber = copy.ReferencedLateralSpreadingDeviceNumber; + } + return *this; +} + + +void DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedLateralSpreadingDeviceNumber.clear(); + LateralSpreadingDeviceSetting.clear(); + } +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::isEmpty() +{ + return ReferencedLateralSpreadingDeviceNumber.isEmpty() && + LateralSpreadingDeviceSetting.isEmpty(); +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedLateralSpreadingDeviceNumber, "1", "1", "LateralSpreadingDeviceSettingsSequence"); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceSetting, "1", "1", "LateralSpreadingDeviceSettingsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedLateralSpreadingDeviceNumber), "1", "1", "LateralSpreadingDeviceSettingsSequence"); + addElementToDataset(result, item, new DcmLongString(LateralSpreadingDeviceSetting), "1", "1", "LateralSpreadingDeviceSettingsSequence"); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getLateralSpreadingDeviceSetting(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LateralSpreadingDeviceSetting, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedLateralSpreadingDeviceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedLateralSpreadingDeviceNumber, value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedLateralSpreadingDeviceNumber).getSint32(value, pos); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::setLateralSpreadingDeviceSetting(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LateralSpreadingDeviceSetting.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item::setReferencedLateralSpreadingDeviceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedLateralSpreadingDeviceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::operator=(const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::~DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule() +{ + clear(); +} + + +void DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_LateralSpreadingDeviceSettingsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_LateralSpreadingDeviceSettingsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_LateralSpreadingDeviceSettingsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmacds.cc b/dcmrt/libsrc/drtmacds.cc new file mode 100644 index 00000000..7e2481ca --- /dev/null +++ b/dcmrt/libsrc/drtmacds.cc @@ -0,0 +1,589 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTMultiplexedAudioChannelsDescriptionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmacds.h" + + +// --- item class --- + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ChannelIdentificationCode(DCM_ChannelIdentificationCode), + ChannelMode(DCM_ChannelMode), + ChannelSourceSequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ChannelIdentificationCode(copy.ChannelIdentificationCode), + ChannelMode(copy.ChannelMode), + ChannelSourceSequence(copy.ChannelSourceSequence) +{ +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::~Item() +{ +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item &DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ChannelIdentificationCode = copy.ChannelIdentificationCode; + ChannelMode = copy.ChannelMode; + ChannelSourceSequence = copy.ChannelSourceSequence; + } + return *this; +} + + +void DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ChannelIdentificationCode.clear(); + ChannelMode.clear(); + ChannelSourceSequence.clear(); + } +} + + +OFBool DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::isEmpty() +{ + return ChannelIdentificationCode.isEmpty() && + ChannelMode.isEmpty() && + ChannelSourceSequence.isEmpty(); +} + + +OFBool DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ChannelIdentificationCode, "1", "1", "MultiplexedAudioChannelsDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, ChannelMode, "1", "1", "MultiplexedAudioChannelsDescriptionCodeSequence"); + ChannelSourceSequence.read(item, "1-n", "1", "MultiplexedAudioChannelsDescriptionCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ChannelIdentificationCode), "1", "1", "MultiplexedAudioChannelsDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ChannelMode), "1", "1", "MultiplexedAudioChannelsDescriptionCodeSequence"); + if (result.good()) result = ChannelSourceSequence.write(item, "1-n", "1", "MultiplexedAudioChannelsDescriptionCodeSequence"); + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::getChannelIdentificationCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelIdentificationCode, value, pos); +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::getChannelIdentificationCode(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ChannelIdentificationCode).getSint32(value, pos); +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::getChannelMode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ChannelMode, value, pos); +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::setChannelIdentificationCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelIdentificationCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item::setChannelMode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ChannelMode.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::DRTMultiplexedAudioChannelsDescriptionCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::DRTMultiplexedAudioChannelsDescriptionCodeSequence(const DRTMultiplexedAudioChannelsDescriptionCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence &DRTMultiplexedAudioChannelsDescriptionCodeSequence::operator=(const DRTMultiplexedAudioChannelsDescriptionCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::~DRTMultiplexedAudioChannelsDescriptionCodeSequence() +{ + clear(); +} + + +void DRTMultiplexedAudioChannelsDescriptionCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTMultiplexedAudioChannelsDescriptionCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTMultiplexedAudioChannelsDescriptionCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTMultiplexedAudioChannelsDescriptionCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item &DRTMultiplexedAudioChannelsDescriptionCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item &DRTMultiplexedAudioChannelsDescriptionCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item &DRTMultiplexedAudioChannelsDescriptionCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item &DRTMultiplexedAudioChannelsDescriptionCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item &DRTMultiplexedAudioChannelsDescriptionCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTMultiplexedAudioChannelsDescriptionCodeSequence::Item &DRTMultiplexedAudioChannelsDescriptionCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_MultiplexedAudioChannelsDescriptionCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_MultiplexedAudioChannelsDescriptionCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTMultiplexedAudioChannelsDescriptionCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_MultiplexedAudioChannelsDescriptionCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmas.cc b/dcmrt/libsrc/drtmas.cc new file mode 100644 index 00000000..001eba23 --- /dev/null +++ b/dcmrt/libsrc/drtmas.cc @@ -0,0 +1,520 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTModifiedAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmas.h" + + +// --- item class --- + +DRTModifiedAttributesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem) +{ +} + + +DRTModifiedAttributesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem) +{ +} + + +DRTModifiedAttributesSequence::Item::~Item() +{ +} + + +DRTModifiedAttributesSequence::Item &DRTModifiedAttributesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + } + return *this; +} + + +void DRTModifiedAttributesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + } +} + + +OFBool DRTModifiedAttributesSequence::Item::isEmpty() +{ + return OFTrue; +} + + +OFBool DRTModifiedAttributesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTModifiedAttributesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + /* avoid compiler warning on unused parameter */ + (void)item; + result = EC_NotYetImplemented; + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* avoid compiler warning on unused parameter */ + (void)item; + result = EC_NotYetImplemented; + } + return result; +} + + +// --- sequence class --- + +DRTModifiedAttributesSequence::DRTModifiedAttributesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTModifiedAttributesSequence::DRTModifiedAttributesSequence(const DRTModifiedAttributesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTModifiedAttributesSequence &DRTModifiedAttributesSequence::operator=(const DRTModifiedAttributesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTModifiedAttributesSequence::~DRTModifiedAttributesSequence() +{ + clear(); +} + + +void DRTModifiedAttributesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTModifiedAttributesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTModifiedAttributesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTModifiedAttributesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTModifiedAttributesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTModifiedAttributesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTModifiedAttributesSequence::Item &DRTModifiedAttributesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTModifiedAttributesSequence::Item &DRTModifiedAttributesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTModifiedAttributesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTModifiedAttributesSequence::Item &DRTModifiedAttributesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTModifiedAttributesSequence::Item &DRTModifiedAttributesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTModifiedAttributesSequence::Item &DRTModifiedAttributesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTModifiedAttributesSequence::Item &DRTModifiedAttributesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTModifiedAttributesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ModifiedAttributesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ModifiedAttributesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTModifiedAttributesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ModifiedAttributesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmdrs.cc b/dcmrt/libsrc/drtmdrs.cc new file mode 100644 index 00000000..931c0022 --- /dev/null +++ b/dcmrt/libsrc/drtmdrs.cc @@ -0,0 +1,716 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTMeasuredDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmdrs.h" + + +// --- item class --- + +DRTMeasuredDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DoseUnits(DCM_DoseUnits), + MeasuredDoseDescription(DCM_MeasuredDoseDescription), + MeasuredDoseReferenceNumber(DCM_MeasuredDoseReferenceNumber), + MeasuredDoseType(DCM_MeasuredDoseType), + MeasuredDoseValue(DCM_MeasuredDoseValue), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTMeasuredDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DoseUnits(copy.DoseUnits), + MeasuredDoseDescription(copy.MeasuredDoseDescription), + MeasuredDoseReferenceNumber(copy.MeasuredDoseReferenceNumber), + MeasuredDoseType(copy.MeasuredDoseType), + MeasuredDoseValue(copy.MeasuredDoseValue), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTMeasuredDoseReferenceSequence::Item::~Item() +{ +} + + +DRTMeasuredDoseReferenceSequence::Item &DRTMeasuredDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DoseUnits = copy.DoseUnits; + MeasuredDoseDescription = copy.MeasuredDoseDescription; + MeasuredDoseReferenceNumber = copy.MeasuredDoseReferenceNumber; + MeasuredDoseType = copy.MeasuredDoseType; + MeasuredDoseValue = copy.MeasuredDoseValue; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTMeasuredDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + MeasuredDoseReferenceNumber.clear(); + DoseUnits.clear(); + MeasuredDoseValue.clear(); + MeasuredDoseType.clear(); + MeasuredDoseDescription.clear(); + } +} + + +OFBool DRTMeasuredDoseReferenceSequence::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + MeasuredDoseReferenceNumber.isEmpty() && + DoseUnits.isEmpty() && + MeasuredDoseValue.isEmpty() && + MeasuredDoseType.isEmpty() && + MeasuredDoseDescription.isEmpty(); +} + + +OFBool DRTMeasuredDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1C", "MeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, MeasuredDoseReferenceNumber, "1", "1C", "MeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseUnits, "1", "1", "MeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, MeasuredDoseValue, "1", "2", "MeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, MeasuredDoseType, "1", "2", "MeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, MeasuredDoseDescription, "1", "3", "MeasuredDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1C", "MeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmIntegerString(MeasuredDoseReferenceNumber), "1", "1C", "MeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmCodeString(DoseUnits), "1", "1", "MeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(MeasuredDoseValue), "1", "2", "MeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmCodeString(MeasuredDoseType), "1", "2", "MeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmShortText(MeasuredDoseDescription), "1", "3", "MeasuredDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getDoseUnits(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseUnits, value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getMeasuredDoseDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MeasuredDoseDescription, value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getMeasuredDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MeasuredDoseReferenceNumber, value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getMeasuredDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, MeasuredDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getMeasuredDoseType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MeasuredDoseType, value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getMeasuredDoseValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MeasuredDoseValue, value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getMeasuredDoseValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, MeasuredDoseValue).getFloat64(value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::setDoseUnits(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseUnits.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::setMeasuredDoseDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = MeasuredDoseDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::setMeasuredDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::setMeasuredDoseType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredDoseType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::setMeasuredDoseValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredDoseValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTMeasuredDoseReferenceSequence::DRTMeasuredDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTMeasuredDoseReferenceSequence::DRTMeasuredDoseReferenceSequence(const DRTMeasuredDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTMeasuredDoseReferenceSequence &DRTMeasuredDoseReferenceSequence::operator=(const DRTMeasuredDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTMeasuredDoseReferenceSequence::~DRTMeasuredDoseReferenceSequence() +{ + clear(); +} + + +void DRTMeasuredDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTMeasuredDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTMeasuredDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTMeasuredDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTMeasuredDoseReferenceSequence::Item &DRTMeasuredDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTMeasuredDoseReferenceSequence::Item &DRTMeasuredDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTMeasuredDoseReferenceSequence::Item &DRTMeasuredDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTMeasuredDoseReferenceSequence::Item &DRTMeasuredDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTMeasuredDoseReferenceSequence::Item &DRTMeasuredDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTMeasuredDoseReferenceSequence::Item &DRTMeasuredDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTMeasuredDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_MeasuredDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_MeasuredDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTMeasuredDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_MeasuredDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmls.cc b/dcmrt/libsrc/drtmls.cc new file mode 100644 index 00000000..81856075 --- /dev/null +++ b/dcmrt/libsrc/drtmls.cc @@ -0,0 +1,633 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTModalityLUTSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmls.h" + + +// --- item class --- + +DRTModalityLUTSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LUTData(DCM_LUTData), + LUTDescriptor(DCM_LUTDescriptor), + LUTExplanation(DCM_LUTExplanation), + ModalityLUTType(DCM_ModalityLUTType) +{ +} + + +DRTModalityLUTSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LUTData(copy.LUTData), + LUTDescriptor(copy.LUTDescriptor), + LUTExplanation(copy.LUTExplanation), + ModalityLUTType(copy.ModalityLUTType) +{ +} + + +DRTModalityLUTSequence::Item::~Item() +{ +} + + +DRTModalityLUTSequence::Item &DRTModalityLUTSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LUTData = copy.LUTData; + LUTDescriptor = copy.LUTDescriptor; + LUTExplanation = copy.LUTExplanation; + ModalityLUTType = copy.ModalityLUTType; + } + return *this; +} + + +void DRTModalityLUTSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + LUTDescriptor.clear(); + LUTExplanation.clear(); + ModalityLUTType.clear(); + LUTData.clear(); + } +} + + +OFBool DRTModalityLUTSequence::Item::isEmpty() +{ + return LUTDescriptor.isEmpty() && + LUTExplanation.isEmpty() && + ModalityLUTType.isEmpty() && + LUTData.isEmpty(); +} + + +OFBool DRTModalityLUTSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTModalityLUTSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, LUTDescriptor, "3", "1", "ModalityLUTSequence"); + getAndCheckElementFromDataset(item, LUTExplanation, "1", "3", "ModalityLUTSequence"); + getAndCheckElementFromDataset(item, ModalityLUTType, "1", "1", "ModalityLUTSequence"); + getAndCheckElementFromDataset(item, LUTData, "1-n", "1", "ModalityLUTSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTModalityLUTSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(LUTDescriptor), "3", "1", "ModalityLUTSequence"); + addElementToDataset(result, item, new DcmLongString(LUTExplanation), "1", "3", "ModalityLUTSequence"); + addElementToDataset(result, item, new DcmLongString(ModalityLUTType), "1", "1", "ModalityLUTSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(LUTData), "1-n", "1", "ModalityLUTSequence"); + } + return result; +} + + +OFCondition DRTModalityLUTSequence::Item::getLUTData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, LUTData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, LUTData).getLength() / sizeof(Uint16); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTModalityLUTSequence::Item::getLUTDescriptor(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, LUTDescriptor).getUint16(value, pos); +} + + +OFCondition DRTModalityLUTSequence::Item::getLUTExplanation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LUTExplanation, value, pos); +} + + +OFCondition DRTModalityLUTSequence::Item::getModalityLUTType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ModalityLUTType, value, pos); +} + + +OFCondition DRTModalityLUTSequence::Item::setLUTData(const Uint16 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return LUTData.putUint16Array(value, count); +} + + +OFCondition DRTModalityLUTSequence::Item::setLUTDescriptor(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return LUTDescriptor.putUint16(value, pos); +} + + +OFCondition DRTModalityLUTSequence::Item::setLUTExplanation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LUTExplanation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTModalityLUTSequence::Item::setModalityLUTType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ModalityLUTType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTModalityLUTSequence::DRTModalityLUTSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTModalityLUTSequence::DRTModalityLUTSequence(const DRTModalityLUTSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTModalityLUTSequence &DRTModalityLUTSequence::operator=(const DRTModalityLUTSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTModalityLUTSequence::~DRTModalityLUTSequence() +{ + clear(); +} + + +void DRTModalityLUTSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTModalityLUTSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTModalityLUTSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTModalityLUTSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTModalityLUTSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTModalityLUTSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTModalityLUTSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTModalityLUTSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTModalityLUTSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTModalityLUTSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTModalityLUTSequence::Item &DRTModalityLUTSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTModalityLUTSequence::Item &DRTModalityLUTSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTModalityLUTSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTModalityLUTSequence::Item &DRTModalityLUTSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTModalityLUTSequence::Item &DRTModalityLUTSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTModalityLUTSequence::Item &DRTModalityLUTSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTModalityLUTSequence::Item &DRTModalityLUTSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTModalityLUTSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTModalityLUTSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTModalityLUTSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTModalityLUTSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ModalityLUTSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ModalityLUTSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTModalityLUTSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ModalityLUTSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmps.cc b/dcmrt/libsrc/drtmps.cc new file mode 100644 index 00000000..b9d4dc39 --- /dev/null +++ b/dcmrt/libsrc/drtmps.cc @@ -0,0 +1,627 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTMACParametersSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmps.h" + + +// --- item class --- + +DRTMACParametersSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DataElementsSigned(DCM_DataElementsSigned), + MACAlgorithm(DCM_MACAlgorithm), + MACCalculationTransferSyntaxUID(DCM_MACCalculationTransferSyntaxUID), + MACIDNumber(DCM_MACIDNumber) +{ +} + + +DRTMACParametersSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DataElementsSigned(copy.DataElementsSigned), + MACAlgorithm(copy.MACAlgorithm), + MACCalculationTransferSyntaxUID(copy.MACCalculationTransferSyntaxUID), + MACIDNumber(copy.MACIDNumber) +{ +} + + +DRTMACParametersSequence::Item::~Item() +{ +} + + +DRTMACParametersSequence::Item &DRTMACParametersSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DataElementsSigned = copy.DataElementsSigned; + MACAlgorithm = copy.MACAlgorithm; + MACCalculationTransferSyntaxUID = copy.MACCalculationTransferSyntaxUID; + MACIDNumber = copy.MACIDNumber; + } + return *this; +} + + +void DRTMACParametersSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + MACIDNumber.clear(); + MACCalculationTransferSyntaxUID.clear(); + MACAlgorithm.clear(); + DataElementsSigned.clear(); + } +} + + +OFBool DRTMACParametersSequence::Item::isEmpty() +{ + return MACIDNumber.isEmpty() && + MACCalculationTransferSyntaxUID.isEmpty() && + MACAlgorithm.isEmpty() && + DataElementsSigned.isEmpty(); +} + + +OFBool DRTMACParametersSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTMACParametersSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, MACIDNumber, "1", "1", "MACParametersSequence"); + getAndCheckElementFromDataset(item, MACCalculationTransferSyntaxUID, "1", "1", "MACParametersSequence"); + getAndCheckElementFromDataset(item, MACAlgorithm, "1", "1", "MACParametersSequence"); + getAndCheckElementFromDataset(item, DataElementsSigned, "1-n", "1", "MACParametersSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMACParametersSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(MACIDNumber), "1", "1", "MACParametersSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MACCalculationTransferSyntaxUID), "1", "1", "MACParametersSequence"); + addElementToDataset(result, item, new DcmCodeString(MACAlgorithm), "1", "1", "MACParametersSequence"); + addElementToDataset(result, item, new DcmAttributeTag(DataElementsSigned), "1-n", "1", "MACParametersSequence"); + } + return result; +} + + +OFCondition DRTMACParametersSequence::Item::getDataElementsSigned(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DataElementsSigned, value, pos); +} + + +OFCondition DRTMACParametersSequence::Item::getMACAlgorithm(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MACAlgorithm, value, pos); +} + + +OFCondition DRTMACParametersSequence::Item::getMACCalculationTransferSyntaxUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MACCalculationTransferSyntaxUID, value, pos); +} + + +OFCondition DRTMACParametersSequence::Item::getMACIDNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, MACIDNumber).getUint16(value, pos); +} + + +OFCondition DRTMACParametersSequence::Item::setDataElementsSigned(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmAttributeTag::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DataElementsSigned.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMACParametersSequence::Item::setMACAlgorithm(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MACAlgorithm.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMACParametersSequence::Item::setMACCalculationTransferSyntaxUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MACCalculationTransferSyntaxUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMACParametersSequence::Item::setMACIDNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return MACIDNumber.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTMACParametersSequence::DRTMACParametersSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTMACParametersSequence::DRTMACParametersSequence(const DRTMACParametersSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTMACParametersSequence &DRTMACParametersSequence::operator=(const DRTMACParametersSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTMACParametersSequence::~DRTMACParametersSequence() +{ + clear(); +} + + +void DRTMACParametersSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTMACParametersSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTMACParametersSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTMACParametersSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTMACParametersSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMACParametersSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMACParametersSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMACParametersSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMACParametersSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTMACParametersSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTMACParametersSequence::Item &DRTMACParametersSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTMACParametersSequence::Item &DRTMACParametersSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTMACParametersSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTMACParametersSequence::Item &DRTMACParametersSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTMACParametersSequence::Item &DRTMACParametersSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTMACParametersSequence::Item &DRTMACParametersSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTMACParametersSequence::Item &DRTMACParametersSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTMACParametersSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTMACParametersSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTMACParametersSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMACParametersSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_MACParametersSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_MACParametersSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTMACParametersSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_MACParametersSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmris.cc b/dcmrt/libsrc/drtmris.cc new file mode 100644 index 00000000..731eb7a4 --- /dev/null +++ b/dcmrt/libsrc/drtmris.cc @@ -0,0 +1,602 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTMappingResourceIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmris.h" + + +// --- item class --- + +DRTMappingResourceIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID) +{ +} + + +DRTMappingResourceIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID) +{ +} + + +DRTMappingResourceIdentificationSequence::Item::~Item() +{ +} + + +DRTMappingResourceIdentificationSequence::Item &DRTMappingResourceIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + } + return *this; +} + + +void DRTMappingResourceIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + } +} + + +OFBool DRTMappingResourceIdentificationSequence::Item::isEmpty() +{ + return MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty(); +} + + +OFBool DRTMappingResourceIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, MappingResource, "1", "1", "MappingResourceIdentificationSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "MappingResourceIdentificationSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "MappingResourceIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1", "MappingResourceIdentificationSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "MappingResourceIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "MappingResourceIdentificationSequence"); + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTMappingResourceIdentificationSequence::DRTMappingResourceIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTMappingResourceIdentificationSequence::DRTMappingResourceIdentificationSequence(const DRTMappingResourceIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTMappingResourceIdentificationSequence &DRTMappingResourceIdentificationSequence::operator=(const DRTMappingResourceIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTMappingResourceIdentificationSequence::~DRTMappingResourceIdentificationSequence() +{ + clear(); +} + + +void DRTMappingResourceIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTMappingResourceIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTMappingResourceIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTMappingResourceIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTMappingResourceIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTMappingResourceIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTMappingResourceIdentificationSequence::Item &DRTMappingResourceIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTMappingResourceIdentificationSequence::Item &DRTMappingResourceIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTMappingResourceIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTMappingResourceIdentificationSequence::Item &DRTMappingResourceIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTMappingResourceIdentificationSequence::Item &DRTMappingResourceIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTMappingResourceIdentificationSequence::Item &DRTMappingResourceIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTMappingResourceIdentificationSequence::Item &DRTMappingResourceIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTMappingResourceIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_MappingResourceIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_MappingResourceIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTMappingResourceIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_MappingResourceIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmss.cc b/dcmrt/libsrc/drtmss.cc new file mode 100644 index 00000000..10b18c7e --- /dev/null +++ b/dcmrt/libsrc/drtmss.cc @@ -0,0 +1,631 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTMotionSynchronizationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmss.h" + + +// --- item class --- + +DRTMotionSynchronizationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RespiratoryMotionCompensationTechnique(DCM_RespiratoryMotionCompensationTechnique), + RespiratoryMotionCompensationTechniqueDescription(DCM_RespiratoryMotionCompensationTechniqueDescription), + RespiratorySignalSource(DCM_RespiratorySignalSource), + RespiratorySignalSourceID(DCM_RespiratorySignalSourceID) +{ +} + + +DRTMotionSynchronizationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RespiratoryMotionCompensationTechnique(copy.RespiratoryMotionCompensationTechnique), + RespiratoryMotionCompensationTechniqueDescription(copy.RespiratoryMotionCompensationTechniqueDescription), + RespiratorySignalSource(copy.RespiratorySignalSource), + RespiratorySignalSourceID(copy.RespiratorySignalSourceID) +{ +} + + +DRTMotionSynchronizationSequence::Item::~Item() +{ +} + + +DRTMotionSynchronizationSequence::Item &DRTMotionSynchronizationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RespiratoryMotionCompensationTechnique = copy.RespiratoryMotionCompensationTechnique; + RespiratoryMotionCompensationTechniqueDescription = copy.RespiratoryMotionCompensationTechniqueDescription; + RespiratorySignalSource = copy.RespiratorySignalSource; + RespiratorySignalSourceID = copy.RespiratorySignalSourceID; + } + return *this; +} + + +void DRTMotionSynchronizationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RespiratoryMotionCompensationTechnique.clear(); + RespiratorySignalSource.clear(); + RespiratoryMotionCompensationTechniqueDescription.clear(); + RespiratorySignalSourceID.clear(); + } +} + + +OFBool DRTMotionSynchronizationSequence::Item::isEmpty() +{ + return RespiratoryMotionCompensationTechnique.isEmpty() && + RespiratorySignalSource.isEmpty() && + RespiratoryMotionCompensationTechniqueDescription.isEmpty() && + RespiratorySignalSourceID.isEmpty(); +} + + +OFBool DRTMotionSynchronizationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTMotionSynchronizationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RespiratoryMotionCompensationTechnique, "1", "1", "MotionSynchronizationSequence"); + getAndCheckElementFromDataset(item, RespiratorySignalSource, "1", "1", "MotionSynchronizationSequence"); + getAndCheckElementFromDataset(item, RespiratoryMotionCompensationTechniqueDescription, "1", "3", "MotionSynchronizationSequence"); + getAndCheckElementFromDataset(item, RespiratorySignalSourceID, "1", "3", "MotionSynchronizationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(RespiratoryMotionCompensationTechnique), "1", "1", "MotionSynchronizationSequence"); + addElementToDataset(result, item, new DcmCodeString(RespiratorySignalSource), "1", "1", "MotionSynchronizationSequence"); + addElementToDataset(result, item, new DcmShortText(RespiratoryMotionCompensationTechniqueDescription), "1", "3", "MotionSynchronizationSequence"); + addElementToDataset(result, item, new DcmShortString(RespiratorySignalSourceID), "1", "3", "MotionSynchronizationSequence"); + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::Item::getRespiratoryMotionCompensationTechnique(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RespiratoryMotionCompensationTechnique, value, pos); +} + + +OFCondition DRTMotionSynchronizationSequence::Item::getRespiratoryMotionCompensationTechniqueDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RespiratoryMotionCompensationTechniqueDescription, value, pos); +} + + +OFCondition DRTMotionSynchronizationSequence::Item::getRespiratorySignalSource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RespiratorySignalSource, value, pos); +} + + +OFCondition DRTMotionSynchronizationSequence::Item::getRespiratorySignalSourceID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RespiratorySignalSourceID, value, pos); +} + + +OFCondition DRTMotionSynchronizationSequence::Item::setRespiratoryMotionCompensationTechnique(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RespiratoryMotionCompensationTechnique.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::Item::setRespiratoryMotionCompensationTechniqueDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RespiratoryMotionCompensationTechniqueDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::Item::setRespiratorySignalSource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RespiratorySignalSource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::Item::setRespiratorySignalSourceID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RespiratorySignalSourceID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTMotionSynchronizationSequence::DRTMotionSynchronizationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTMotionSynchronizationSequence::DRTMotionSynchronizationSequence(const DRTMotionSynchronizationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTMotionSynchronizationSequence &DRTMotionSynchronizationSequence::operator=(const DRTMotionSynchronizationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTMotionSynchronizationSequence::~DRTMotionSynchronizationSequence() +{ + clear(); +} + + +void DRTMotionSynchronizationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTMotionSynchronizationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTMotionSynchronizationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTMotionSynchronizationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTMotionSynchronizationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTMotionSynchronizationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTMotionSynchronizationSequence::Item &DRTMotionSynchronizationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTMotionSynchronizationSequence::Item &DRTMotionSynchronizationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTMotionSynchronizationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTMotionSynchronizationSequence::Item &DRTMotionSynchronizationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTMotionSynchronizationSequence::Item &DRTMotionSynchronizationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTMotionSynchronizationSequence::Item &DRTMotionSynchronizationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTMotionSynchronizationSequence::Item &DRTMotionSynchronizationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTMotionSynchronizationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_MotionSynchronizationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_MotionSynchronizationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTMotionSynchronizationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_MotionSynchronizationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtmucs.cc b/dcmrt/libsrc/drtmucs.cc new file mode 100644 index 00000000..d3e1f6ba --- /dev/null +++ b/dcmrt/libsrc/drtmucs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTMeasurementUnitsCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtmucs.h" + + +// --- item class --- + +DRTMeasurementUnitsCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTMeasurementUnitsCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTMeasurementUnitsCodeSequence::Item::~Item() +{ +} + + +DRTMeasurementUnitsCodeSequence::Item &DRTMeasurementUnitsCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTMeasurementUnitsCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTMeasurementUnitsCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTMeasurementUnitsCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "MeasurementUnitsCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "MeasurementUnitsCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "MeasurementUnitsCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "MeasurementUnitsCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "MeasurementUnitsCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "MeasurementUnitsCodeSequence"); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTMeasurementUnitsCodeSequence::DRTMeasurementUnitsCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTMeasurementUnitsCodeSequence::DRTMeasurementUnitsCodeSequence(const DRTMeasurementUnitsCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTMeasurementUnitsCodeSequence &DRTMeasurementUnitsCodeSequence::operator=(const DRTMeasurementUnitsCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTMeasurementUnitsCodeSequence::~DRTMeasurementUnitsCodeSequence() +{ + clear(); +} + + +void DRTMeasurementUnitsCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTMeasurementUnitsCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTMeasurementUnitsCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTMeasurementUnitsCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTMeasurementUnitsCodeSequence::Item &DRTMeasurementUnitsCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTMeasurementUnitsCodeSequence::Item &DRTMeasurementUnitsCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTMeasurementUnitsCodeSequence::Item &DRTMeasurementUnitsCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTMeasurementUnitsCodeSequence::Item &DRTMeasurementUnitsCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTMeasurementUnitsCodeSequence::Item &DRTMeasurementUnitsCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTMeasurementUnitsCodeSequence::Item &DRTMeasurementUnitsCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTMeasurementUnitsCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_MeasurementUnitsCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_MeasurementUnitsCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTMeasurementUnitsCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_MeasurementUnitsCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtoas.cc b/dcmrt/libsrc/drtoas.cc new file mode 100644 index 00000000..5260165e --- /dev/null +++ b/dcmrt/libsrc/drtoas.cc @@ -0,0 +1,638 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTOriginalAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtoas.h" + + +// --- item class --- + +DRTOriginalAttributesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AttributeModificationDateTime(DCM_AttributeModificationDateTime), + ModifiedAttributesSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ModifyingSystem(DCM_ModifyingSystem), + ReasonForTheAttributeModification(DCM_ReasonForTheAttributeModification), + SourceOfPreviousValues(DCM_SourceOfPreviousValues) +{ +} + + +DRTOriginalAttributesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AttributeModificationDateTime(copy.AttributeModificationDateTime), + ModifiedAttributesSequence(copy.ModifiedAttributesSequence), + ModifyingSystem(copy.ModifyingSystem), + ReasonForTheAttributeModification(copy.ReasonForTheAttributeModification), + SourceOfPreviousValues(copy.SourceOfPreviousValues) +{ +} + + +DRTOriginalAttributesSequence::Item::~Item() +{ +} + + +DRTOriginalAttributesSequence::Item &DRTOriginalAttributesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AttributeModificationDateTime = copy.AttributeModificationDateTime; + ModifiedAttributesSequence = copy.ModifiedAttributesSequence; + ModifyingSystem = copy.ModifyingSystem; + ReasonForTheAttributeModification = copy.ReasonForTheAttributeModification; + SourceOfPreviousValues = copy.SourceOfPreviousValues; + } + return *this; +} + + +void DRTOriginalAttributesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SourceOfPreviousValues.clear(); + AttributeModificationDateTime.clear(); + ModifyingSystem.clear(); + ReasonForTheAttributeModification.clear(); + ModifiedAttributesSequence.clear(); + } +} + + +OFBool DRTOriginalAttributesSequence::Item::isEmpty() +{ + return SourceOfPreviousValues.isEmpty() && + AttributeModificationDateTime.isEmpty() && + ModifyingSystem.isEmpty() && + ReasonForTheAttributeModification.isEmpty() && + ModifiedAttributesSequence.isEmpty(); +} + + +OFBool DRTOriginalAttributesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTOriginalAttributesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SourceOfPreviousValues, "1", "2", "OriginalAttributesSequence"); + getAndCheckElementFromDataset(item, AttributeModificationDateTime, "1", "1", "OriginalAttributesSequence"); + getAndCheckElementFromDataset(item, ModifyingSystem, "1", "1", "OriginalAttributesSequence"); + getAndCheckElementFromDataset(item, ReasonForTheAttributeModification, "1", "1", "OriginalAttributesSequence"); + ModifiedAttributesSequence.read(item, "1-n", "1", "OriginalAttributesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongString(SourceOfPreviousValues), "1", "2", "OriginalAttributesSequence"); + addElementToDataset(result, item, new DcmDateTime(AttributeModificationDateTime), "1", "1", "OriginalAttributesSequence"); + addElementToDataset(result, item, new DcmLongString(ModifyingSystem), "1", "1", "OriginalAttributesSequence"); + addElementToDataset(result, item, new DcmCodeString(ReasonForTheAttributeModification), "1", "1", "OriginalAttributesSequence"); + if (result.good()) result = ModifiedAttributesSequence.write(item, "1-n", "1", "OriginalAttributesSequence"); + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::Item::getAttributeModificationDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AttributeModificationDateTime, value, pos); +} + + +OFCondition DRTOriginalAttributesSequence::Item::getModifyingSystem(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ModifyingSystem, value, pos); +} + + +OFCondition DRTOriginalAttributesSequence::Item::getReasonForTheAttributeModification(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReasonForTheAttributeModification, value, pos); +} + + +OFCondition DRTOriginalAttributesSequence::Item::getSourceOfPreviousValues(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceOfPreviousValues, value, pos); +} + + +OFCondition DRTOriginalAttributesSequence::Item::setAttributeModificationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AttributeModificationDateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::Item::setModifyingSystem(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ModifyingSystem.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::Item::setReasonForTheAttributeModification(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReasonForTheAttributeModification.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::Item::setSourceOfPreviousValues(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceOfPreviousValues.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTOriginalAttributesSequence::DRTOriginalAttributesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTOriginalAttributesSequence::DRTOriginalAttributesSequence(const DRTOriginalAttributesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTOriginalAttributesSequence &DRTOriginalAttributesSequence::operator=(const DRTOriginalAttributesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTOriginalAttributesSequence::~DRTOriginalAttributesSequence() +{ + clear(); +} + + +void DRTOriginalAttributesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTOriginalAttributesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTOriginalAttributesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTOriginalAttributesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTOriginalAttributesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTOriginalAttributesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTOriginalAttributesSequence::Item &DRTOriginalAttributesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTOriginalAttributesSequence::Item &DRTOriginalAttributesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTOriginalAttributesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTOriginalAttributesSequence::Item &DRTOriginalAttributesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTOriginalAttributesSequence::Item &DRTOriginalAttributesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTOriginalAttributesSequence::Item &DRTOriginalAttributesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTOriginalAttributesSequence::Item &DRTOriginalAttributesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTOriginalAttributesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_OriginalAttributesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_OriginalAttributesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTOriginalAttributesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_OriginalAttributesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtois.cc b/dcmrt/libsrc/drtois.cc new file mode 100644 index 00000000..5b543397 --- /dev/null +++ b/dcmrt/libsrc/drtois.cc @@ -0,0 +1,674 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTOperatorIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtois.h" + + +// --- item class --- + +DRTOperatorIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + InstitutionName(DCM_InstitutionName), + PersonAddress(DCM_PersonAddress), + PersonIdentificationCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PersonTelecomInformation(DCM_PersonTelecomInformation), + PersonTelephoneNumbers(DCM_PersonTelephoneNumbers) +{ +} + + +DRTOperatorIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + InstitutionAddress(copy.InstitutionAddress), + InstitutionCodeSequence(copy.InstitutionCodeSequence), + InstitutionName(copy.InstitutionName), + PersonAddress(copy.PersonAddress), + PersonIdentificationCodeSequence(copy.PersonIdentificationCodeSequence), + PersonTelecomInformation(copy.PersonTelecomInformation), + PersonTelephoneNumbers(copy.PersonTelephoneNumbers) +{ +} + + +DRTOperatorIdentificationSequence::Item::~Item() +{ +} + + +DRTOperatorIdentificationSequence::Item &DRTOperatorIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + InstitutionAddress = copy.InstitutionAddress; + InstitutionCodeSequence = copy.InstitutionCodeSequence; + InstitutionName = copy.InstitutionName; + PersonAddress = copy.PersonAddress; + PersonIdentificationCodeSequence = copy.PersonIdentificationCodeSequence; + PersonTelecomInformation = copy.PersonTelecomInformation; + PersonTelephoneNumbers = copy.PersonTelephoneNumbers; + } + return *this; +} + + +void DRTOperatorIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PersonIdentificationCodeSequence.clear(); + PersonAddress.clear(); + PersonTelephoneNumbers.clear(); + PersonTelecomInformation.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionCodeSequence.clear(); + } +} + + +OFBool DRTOperatorIdentificationSequence::Item::isEmpty() +{ + return PersonIdentificationCodeSequence.isEmpty() && + PersonAddress.isEmpty() && + PersonTelephoneNumbers.isEmpty() && + PersonTelecomInformation.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionCodeSequence.isEmpty(); +} + + +OFBool DRTOperatorIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTOperatorIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + PersonIdentificationCodeSequence.read(item, "1-n", "1", "OperatorIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonAddress, "1", "3", "OperatorIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelephoneNumbers, "1-n", "3", "OperatorIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelecomInformation, "1", "3", "OperatorIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "1C", "OperatorIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "OperatorIdentificationSequence"); + InstitutionCodeSequence.read(item, "1-n", "1C", "OperatorIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + if (result.good()) result = PersonIdentificationCodeSequence.write(item, "1-n", "1", "OperatorIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(PersonAddress), "1", "3", "OperatorIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(PersonTelephoneNumbers), "1-n", "3", "OperatorIdentificationSequence"); + addElementToDataset(result, item, new DcmLongText(PersonTelecomInformation), "1", "3", "OperatorIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "1C", "OperatorIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "OperatorIdentificationSequence"); + if (result.good()) result = InstitutionCodeSequence.write(item, "1-n", "1C", "OperatorIdentificationSequence"); + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTOperatorIdentificationSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTOperatorIdentificationSequence::Item::getPersonAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonAddress, value, pos); +} + + +OFCondition DRTOperatorIdentificationSequence::Item::getPersonTelecomInformation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelecomInformation, value, pos); +} + + +OFCondition DRTOperatorIdentificationSequence::Item::getPersonTelephoneNumbers(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelephoneNumbers, value, pos); +} + + +OFCondition DRTOperatorIdentificationSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::Item::setPersonAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::Item::setPersonTelecomInformation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonTelecomInformation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::Item::setPersonTelephoneNumbers(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PersonTelephoneNumbers.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTOperatorIdentificationSequence::DRTOperatorIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTOperatorIdentificationSequence::DRTOperatorIdentificationSequence(const DRTOperatorIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTOperatorIdentificationSequence &DRTOperatorIdentificationSequence::operator=(const DRTOperatorIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTOperatorIdentificationSequence::~DRTOperatorIdentificationSequence() +{ + clear(); +} + + +void DRTOperatorIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTOperatorIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTOperatorIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTOperatorIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTOperatorIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTOperatorIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTOperatorIdentificationSequence::Item &DRTOperatorIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTOperatorIdentificationSequence::Item &DRTOperatorIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTOperatorIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTOperatorIdentificationSequence::Item &DRTOperatorIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTOperatorIdentificationSequence::Item &DRTOperatorIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTOperatorIdentificationSequence::Item &DRTOperatorIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTOperatorIdentificationSequence::Item &DRTOperatorIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTOperatorIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_OperatorIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_OperatorIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTOperatorIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_OperatorIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtopis.cc b/dcmrt/libsrc/drtopis.cc new file mode 100644 index 00000000..7dcb7ed4 --- /dev/null +++ b/dcmrt/libsrc/drtopis.cc @@ -0,0 +1,609 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTOtherPatientIDsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtopis.h" + + +// --- item class --- + +DRTOtherPatientIDsSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PatientID(DCM_PatientID), + TypeOfPatientID(DCM_TypeOfPatientID) +{ +} + + +DRTOtherPatientIDsSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientID(copy.PatientID), + TypeOfPatientID(copy.TypeOfPatientID) +{ +} + + +DRTOtherPatientIDsSequence::Item::~Item() +{ +} + + +DRTOtherPatientIDsSequence::Item &DRTOtherPatientIDsSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientID = copy.PatientID; + TypeOfPatientID = copy.TypeOfPatientID; + } + return *this; +} + + +void DRTOtherPatientIDsSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + TypeOfPatientID.clear(); + } +} + + +OFBool DRTOtherPatientIDsSequence::Item::isEmpty() +{ + return PatientID.isEmpty() && + IssuerOfPatientID.isEmpty() && + IssuerOfPatientIDQualifiersSequence.isEmpty() && + TypeOfPatientID.isEmpty(); +} + + +OFBool DRTOtherPatientIDsSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTOtherPatientIDsSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, PatientID, "1", "1", "OtherPatientIDsSequence"); + getAndCheckElementFromDataset(item, IssuerOfPatientID, "1", "3", "OtherPatientIDsSequence"); + IssuerOfPatientIDQualifiersSequence.read(item, "1-n", "3", "OtherPatientIDsSequence"); + getAndCheckElementFromDataset(item, TypeOfPatientID, "1", "1", "OtherPatientIDsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongString(PatientID), "1", "1", "OtherPatientIDsSequence"); + addElementToDataset(result, item, new DcmLongString(IssuerOfPatientID), "1", "3", "OtherPatientIDsSequence"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(item, "1-n", "3", "OtherPatientIDsSequence"); + addElementToDataset(result, item, new DcmCodeString(TypeOfPatientID), "1", "1", "OtherPatientIDsSequence"); + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::Item::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTOtherPatientIDsSequence::Item::getPatientID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTOtherPatientIDsSequence::Item::getTypeOfPatientID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TypeOfPatientID, value, pos); +} + + +OFCondition DRTOtherPatientIDsSequence::Item::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::Item::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::Item::setTypeOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TypeOfPatientID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTOtherPatientIDsSequence::DRTOtherPatientIDsSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTOtherPatientIDsSequence::DRTOtherPatientIDsSequence(const DRTOtherPatientIDsSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTOtherPatientIDsSequence &DRTOtherPatientIDsSequence::operator=(const DRTOtherPatientIDsSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTOtherPatientIDsSequence::~DRTOtherPatientIDsSequence() +{ + clear(); +} + + +void DRTOtherPatientIDsSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTOtherPatientIDsSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTOtherPatientIDsSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTOtherPatientIDsSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTOtherPatientIDsSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTOtherPatientIDsSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTOtherPatientIDsSequence::Item &DRTOtherPatientIDsSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTOtherPatientIDsSequence::Item &DRTOtherPatientIDsSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTOtherPatientIDsSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTOtherPatientIDsSequence::Item &DRTOtherPatientIDsSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTOtherPatientIDsSequence::Item &DRTOtherPatientIDsSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTOtherPatientIDsSequence::Item &DRTOtherPatientIDsSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTOtherPatientIDsSequence::Item &DRTOtherPatientIDsSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTOtherPatientIDsSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_OtherPatientIDsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_OtherPatientIDsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTOtherPatientIDsSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_OtherPatientIDsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtos.cc b/dcmrt/libsrc/drtos.cc new file mode 100644 index 00000000..b0fadf2b --- /dev/null +++ b/dcmrt/libsrc/drtos.cc @@ -0,0 +1,701 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTOverrideSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtos.h" + + +// --- item class --- + +DRTOverrideSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + OperatorIdentificationSequence(emptyDefaultItem /*emptyDefaultSequence*/), + OperatorsName(DCM_OperatorsName), + OverrideParameterPointer(DCM_OverrideParameterPointer), + OverrideReason(DCM_OverrideReason), + ParameterItemIndex(DCM_ParameterItemIndex), + ParameterSequencePointer(DCM_ParameterSequencePointer), + ParameterValueNumber(DCM_ParameterValueNumber) +{ +} + + +DRTOverrideSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + OperatorsName(copy.OperatorsName), + OverrideParameterPointer(copy.OverrideParameterPointer), + OverrideReason(copy.OverrideReason), + ParameterItemIndex(copy.ParameterItemIndex), + ParameterSequencePointer(copy.ParameterSequencePointer), + ParameterValueNumber(copy.ParameterValueNumber) +{ +} + + +DRTOverrideSequence::Item::~Item() +{ +} + + +DRTOverrideSequence::Item &DRTOverrideSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + OperatorsName = copy.OperatorsName; + OverrideParameterPointer = copy.OverrideParameterPointer; + OverrideReason = copy.OverrideReason; + ParameterItemIndex = copy.ParameterItemIndex; + ParameterSequencePointer = copy.ParameterSequencePointer; + ParameterValueNumber = copy.ParameterValueNumber; + } + return *this; +} + + +void DRTOverrideSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ParameterSequencePointer.clear(); + OverrideParameterPointer.clear(); + ParameterItemIndex.clear(); + ParameterValueNumber.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + OverrideReason.clear(); + } +} + + +OFBool DRTOverrideSequence::Item::isEmpty() +{ + return ParameterSequencePointer.isEmpty() && + OverrideParameterPointer.isEmpty() && + ParameterItemIndex.isEmpty() && + ParameterValueNumber.isEmpty() && + OperatorsName.isEmpty() && + OperatorIdentificationSequence.isEmpty() && + OverrideReason.isEmpty(); +} + + +OFBool DRTOverrideSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTOverrideSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ParameterSequencePointer, "1", "1", "OverrideSequence"); + getAndCheckElementFromDataset(item, OverrideParameterPointer, "1", "1", "OverrideSequence"); + getAndCheckElementFromDataset(item, ParameterItemIndex, "1", "1", "OverrideSequence"); + getAndCheckElementFromDataset(item, ParameterValueNumber, "1", "3", "OverrideSequence"); + getAndCheckElementFromDataset(item, OperatorsName, "1-n", "2", "OverrideSequence"); + OperatorIdentificationSequence.read(item, "1-n", "3", "OverrideSequence"); + getAndCheckElementFromDataset(item, OverrideReason, "1", "3", "OverrideSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOverrideSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmAttributeTag(ParameterSequencePointer), "1", "1", "OverrideSequence"); + addElementToDataset(result, item, new DcmAttributeTag(OverrideParameterPointer), "1", "1", "OverrideSequence"); + addElementToDataset(result, item, new DcmIntegerString(ParameterItemIndex), "1", "1", "OverrideSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(ParameterValueNumber), "1", "3", "OverrideSequence"); + addElementToDataset(result, item, new DcmPersonName(OperatorsName), "1-n", "2", "OverrideSequence"); + if (result.good()) result = OperatorIdentificationSequence.write(item, "1-n", "3", "OverrideSequence"); + addElementToDataset(result, item, new DcmShortText(OverrideReason), "1", "3", "OverrideSequence"); + } + return result; +} + + +OFCondition DRTOverrideSequence::Item::getOperatorsName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTOverrideSequence::Item::getOverrideParameterPointer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OverrideParameterPointer, value, pos); +} + + +OFCondition DRTOverrideSequence::Item::getOverrideReason(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OverrideReason, value, pos); +} + + +OFCondition DRTOverrideSequence::Item::getParameterItemIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ParameterItemIndex, value, pos); +} + + +OFCondition DRTOverrideSequence::Item::getParameterItemIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ParameterItemIndex).getSint32(value, pos); +} + + +OFCondition DRTOverrideSequence::Item::getParameterSequencePointer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ParameterSequencePointer, value, pos); +} + + +OFCondition DRTOverrideSequence::Item::getParameterValueNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ParameterValueNumber).getUint16(value, pos); +} + + +OFCondition DRTOverrideSequence::Item::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOverrideSequence::Item::setOverrideParameterPointer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmAttributeTag::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OverrideParameterPointer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOverrideSequence::Item::setOverrideReason(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = OverrideReason.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOverrideSequence::Item::setParameterItemIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ParameterItemIndex.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOverrideSequence::Item::setParameterSequencePointer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmAttributeTag::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ParameterSequencePointer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTOverrideSequence::Item::setParameterValueNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ParameterValueNumber.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTOverrideSequence::DRTOverrideSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTOverrideSequence::DRTOverrideSequence(const DRTOverrideSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTOverrideSequence &DRTOverrideSequence::operator=(const DRTOverrideSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTOverrideSequence::~DRTOverrideSequence() +{ + clear(); +} + + +void DRTOverrideSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTOverrideSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTOverrideSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTOverrideSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTOverrideSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOverrideSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTOverrideSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOverrideSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOverrideSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTOverrideSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTOverrideSequence::Item &DRTOverrideSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTOverrideSequence::Item &DRTOverrideSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTOverrideSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTOverrideSequence::Item &DRTOverrideSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTOverrideSequence::Item &DRTOverrideSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTOverrideSequence::Item &DRTOverrideSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTOverrideSequence::Item &DRTOverrideSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTOverrideSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTOverrideSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTOverrideSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTOverrideSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_OverrideSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_OverrideSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTOverrideSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_OverrideSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpbcs.cc b/dcmrt/libsrc/drtpbcs.cc new file mode 100644 index 00000000..5076218c --- /dev/null +++ b/dcmrt/libsrc/drtpbcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPatientBreedCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpbcs.h" + + +// --- item class --- + +DRTPatientBreedCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTPatientBreedCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTPatientBreedCodeSequence::Item::~Item() +{ +} + + +DRTPatientBreedCodeSequence::Item &DRTPatientBreedCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTPatientBreedCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTPatientBreedCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTPatientBreedCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "PatientBreedCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "PatientBreedCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "PatientBreedCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "PatientBreedCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "PatientBreedCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "PatientBreedCodeSequence"); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPatientBreedCodeSequence::DRTPatientBreedCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPatientBreedCodeSequence::DRTPatientBreedCodeSequence(const DRTPatientBreedCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPatientBreedCodeSequence &DRTPatientBreedCodeSequence::operator=(const DRTPatientBreedCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPatientBreedCodeSequence::~DRTPatientBreedCodeSequence() +{ + clear(); +} + + +void DRTPatientBreedCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPatientBreedCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPatientBreedCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPatientBreedCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPatientBreedCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPatientBreedCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPatientBreedCodeSequence::Item &DRTPatientBreedCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPatientBreedCodeSequence::Item &DRTPatientBreedCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPatientBreedCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPatientBreedCodeSequence::Item &DRTPatientBreedCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPatientBreedCodeSequence::Item &DRTPatientBreedCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPatientBreedCodeSequence::Item &DRTPatientBreedCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPatientBreedCodeSequence::Item &DRTPatientBreedCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPatientBreedCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PatientBreedCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PatientBreedCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPatientBreedCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PatientBreedCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpcs.cc b/dcmrt/libsrc/drtpcs.cc new file mode 100644 index 00000000..b7a3a85b --- /dev/null +++ b/dcmrt/libsrc/drtpcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpcs.h" + + +// --- item class --- + +DRTProcedureCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTProcedureCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTProcedureCodeSequence::Item::~Item() +{ +} + + +DRTProcedureCodeSequence::Item &DRTProcedureCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTProcedureCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTProcedureCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTProcedureCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTProcedureCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ProcedureCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ProcedureCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ProcedureCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ProcedureCodeSequence"); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTProcedureCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTProcedureCodeSequence::DRTProcedureCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTProcedureCodeSequence::DRTProcedureCodeSequence(const DRTProcedureCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTProcedureCodeSequence &DRTProcedureCodeSequence::operator=(const DRTProcedureCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTProcedureCodeSequence::~DRTProcedureCodeSequence() +{ + clear(); +} + + +void DRTProcedureCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTProcedureCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTProcedureCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTProcedureCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTProcedureCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTProcedureCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTProcedureCodeSequence::Item &DRTProcedureCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTProcedureCodeSequence::Item &DRTProcedureCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTProcedureCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTProcedureCodeSequence::Item &DRTProcedureCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTProcedureCodeSequence::Item &DRTProcedureCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTProcedureCodeSequence::Item &DRTProcedureCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTProcedureCodeSequence::Item &DRTProcedureCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTProcedureCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ProcedureCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ProcedureCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTProcedureCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ProcedureCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpcxs.cc b/dcmrt/libsrc/drtpcxs.cc new file mode 100644 index 00000000..8805176c --- /dev/null +++ b/dcmrt/libsrc/drtpcxs.cc @@ -0,0 +1,904 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTProtocolContextSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpcxs.h" + + +// --- item class --- + +DRTProtocolContextSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ConceptCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ConceptNameCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ContentItemModifierSequence(emptyDefaultItem /*emptyDefaultSequence*/), + Date(DCM_Date), + DateTime(DCM_DateTime), + FloatingPointValue(DCM_FloatingPointValue), + MeasurementUnitsCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + NumericValue(DCM_NumericValue), + ObservationDateTime(DCM_ObservationDateTime), + PersonName(DCM_PersonName), + RationalDenominatorValue(DCM_RationalDenominatorValue), + RationalNumeratorValue(DCM_RationalNumeratorValue), + ReferencedSOPSequence(emptyDefaultItem /*emptyDefaultSequence*/), + TextValue(DCM_TextValue), + Time(DCM_Time), + UID(DCM_UID), + ValueType(DCM_ValueType) +{ +} + + +DRTProtocolContextSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ConceptCodeSequence(copy.ConceptCodeSequence), + ConceptNameCodeSequence(copy.ConceptNameCodeSequence), + ContentItemModifierSequence(copy.ContentItemModifierSequence), + Date(copy.Date), + DateTime(copy.DateTime), + FloatingPointValue(copy.FloatingPointValue), + MeasurementUnitsCodeSequence(copy.MeasurementUnitsCodeSequence), + NumericValue(copy.NumericValue), + ObservationDateTime(copy.ObservationDateTime), + PersonName(copy.PersonName), + RationalDenominatorValue(copy.RationalDenominatorValue), + RationalNumeratorValue(copy.RationalNumeratorValue), + ReferencedSOPSequence(copy.ReferencedSOPSequence), + TextValue(copy.TextValue), + Time(copy.Time), + UID(copy.UID), + ValueType(copy.ValueType) +{ +} + + +DRTProtocolContextSequence::Item::~Item() +{ +} + + +DRTProtocolContextSequence::Item &DRTProtocolContextSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ConceptCodeSequence = copy.ConceptCodeSequence; + ConceptNameCodeSequence = copy.ConceptNameCodeSequence; + ContentItemModifierSequence = copy.ContentItemModifierSequence; + Date = copy.Date; + DateTime = copy.DateTime; + FloatingPointValue = copy.FloatingPointValue; + MeasurementUnitsCodeSequence = copy.MeasurementUnitsCodeSequence; + NumericValue = copy.NumericValue; + ObservationDateTime = copy.ObservationDateTime; + PersonName = copy.PersonName; + RationalDenominatorValue = copy.RationalDenominatorValue; + RationalNumeratorValue = copy.RationalNumeratorValue; + ReferencedSOPSequence = copy.ReferencedSOPSequence; + TextValue = copy.TextValue; + Time = copy.Time; + UID = copy.UID; + ValueType = copy.ValueType; + } + return *this; +} + + +void DRTProtocolContextSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ValueType.clear(); + ObservationDateTime.clear(); + ConceptNameCodeSequence.clear(); + DateTime.clear(); + Date.clear(); + Time.clear(); + PersonName.clear(); + UID.clear(); + TextValue.clear(); + ConceptCodeSequence.clear(); + NumericValue.clear(); + FloatingPointValue.clear(); + RationalNumeratorValue.clear(); + RationalDenominatorValue.clear(); + MeasurementUnitsCodeSequence.clear(); + ReferencedSOPSequence.clear(); + ContentItemModifierSequence.clear(); + } +} + + +OFBool DRTProtocolContextSequence::Item::isEmpty() +{ + return ValueType.isEmpty() && + ObservationDateTime.isEmpty() && + ConceptNameCodeSequence.isEmpty() && + DateTime.isEmpty() && + Date.isEmpty() && + Time.isEmpty() && + PersonName.isEmpty() && + UID.isEmpty() && + TextValue.isEmpty() && + ConceptCodeSequence.isEmpty() && + NumericValue.isEmpty() && + FloatingPointValue.isEmpty() && + RationalNumeratorValue.isEmpty() && + RationalDenominatorValue.isEmpty() && + MeasurementUnitsCodeSequence.isEmpty() && + ReferencedSOPSequence.isEmpty() && + ContentItemModifierSequence.isEmpty(); +} + + +OFBool DRTProtocolContextSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTProtocolContextSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ValueType, "1", "1", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, ObservationDateTime, "1", "3", "ProtocolContextSequence"); + ConceptNameCodeSequence.read(item, "1-n", "1", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, DateTime, "1", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, Date, "1", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, Time, "1", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, PersonName, "1", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, UID, "1", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, TextValue, "1", "1C", "ProtocolContextSequence"); + ConceptCodeSequence.read(item, "1-n", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, NumericValue, "1-n", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, FloatingPointValue, "1-n", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, RationalNumeratorValue, "1-n", "1C", "ProtocolContextSequence"); + getAndCheckElementFromDataset(item, RationalDenominatorValue, "1-n", "1C", "ProtocolContextSequence"); + MeasurementUnitsCodeSequence.read(item, "1-n", "1C", "ProtocolContextSequence"); + ReferencedSOPSequence.read(item, "1-n", "1C", "ProtocolContextSequence"); + ContentItemModifierSequence.read(item, "1-n", "3", "ProtocolContextSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ValueType), "1", "1", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmDateTime(ObservationDateTime), "1", "3", "ProtocolContextSequence"); + if (result.good()) result = ConceptNameCodeSequence.write(item, "1-n", "1", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmDateTime(DateTime), "1", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmDate(Date), "1", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmTime(Time), "1", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmPersonName(PersonName), "1", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(UID), "1", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(TextValue), "1", "1C", "ProtocolContextSequence"); + if (result.good()) result = ConceptCodeSequence.write(item, "1-n", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmDecimalString(NumericValue), "1-n", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(FloatingPointValue), "1-n", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmSignedLong(RationalNumeratorValue), "1-n", "1C", "ProtocolContextSequence"); + addElementToDataset(result, item, new DcmUnsignedLong(RationalDenominatorValue), "1-n", "1C", "ProtocolContextSequence"); + if (result.good()) result = MeasurementUnitsCodeSequence.write(item, "1-n", "1C", "ProtocolContextSequence"); + if (result.good()) result = ReferencedSOPSequence.write(item, "1-n", "1C", "ProtocolContextSequence"); + if (result.good()) result = ContentItemModifierSequence.write(item, "1-n", "3", "ProtocolContextSequence"); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::getDate(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Date, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DateTime, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getFloatingPointValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, FloatingPointValue).getFloat64(value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getNumericValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumericValue, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getNumericValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NumericValue).getFloat64(value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getNumericValue(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NumericValue).getFloat64Vector(value); +} + + +OFCondition DRTProtocolContextSequence::Item::getObservationDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ObservationDateTime, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getPersonName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonName, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getRationalDenominatorValue(Uint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedLong &, RationalDenominatorValue).getUint32(value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getRationalNumeratorValue(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmSignedLong &, RationalNumeratorValue).getSint32(value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getTextValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TextValue, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Time, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UID, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::getValueType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ValueType, value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::setDate(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Date.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setFloatingPointValue(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FloatingPointValue.putFloat64(value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::setNumericValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NumericValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setObservationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ObservationDateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setPersonName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PersonName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setRationalDenominatorValue(const Uint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RationalDenominatorValue.putUint32(value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::setRationalNumeratorValue(const Sint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RationalNumeratorValue.putSint32(value, pos); +} + + +OFCondition DRTProtocolContextSequence::Item::setTextValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = TextValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Time.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::Item::setValueType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ValueType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTProtocolContextSequence::DRTProtocolContextSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTProtocolContextSequence::DRTProtocolContextSequence(const DRTProtocolContextSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTProtocolContextSequence &DRTProtocolContextSequence::operator=(const DRTProtocolContextSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTProtocolContextSequence::~DRTProtocolContextSequence() +{ + clear(); +} + + +void DRTProtocolContextSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTProtocolContextSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTProtocolContextSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTProtocolContextSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTProtocolContextSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTProtocolContextSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTProtocolContextSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTProtocolContextSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTProtocolContextSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTProtocolContextSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTProtocolContextSequence::Item &DRTProtocolContextSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTProtocolContextSequence::Item &DRTProtocolContextSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTProtocolContextSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTProtocolContextSequence::Item &DRTProtocolContextSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTProtocolContextSequence::Item &DRTProtocolContextSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTProtocolContextSequence::Item &DRTProtocolContextSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTProtocolContextSequence::Item &DRTProtocolContextSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTProtocolContextSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTProtocolContextSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTProtocolContextSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTProtocolContextSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ProtocolContextSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ProtocolContextSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTProtocolContextSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ProtocolContextSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpdecs.cc b/dcmrt/libsrc/drtpdecs.cc new file mode 100644 index 00000000..1c00ae75 --- /dev/null +++ b/dcmrt/libsrc/drtpdecs.cc @@ -0,0 +1,637 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPrivateDataElementCharacteristicsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpdecs.h" + + +// --- item class --- + +DRTPrivateDataElementCharacteristicsSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BlockIdentifyingInformationStatus(DCM_BlockIdentifyingInformationStatus), + DeidentificationActionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + NonidentifyingPrivateElements(DCM_NonidentifyingPrivateElements), + PrivateCreatorReference(DCM_PrivateCreatorReference), + PrivateDataElementDefinitionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PrivateGroupReference(DCM_PrivateGroupReference) +{ +} + + +DRTPrivateDataElementCharacteristicsSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BlockIdentifyingInformationStatus(copy.BlockIdentifyingInformationStatus), + DeidentificationActionSequence(copy.DeidentificationActionSequence), + NonidentifyingPrivateElements(copy.NonidentifyingPrivateElements), + PrivateCreatorReference(copy.PrivateCreatorReference), + PrivateDataElementDefinitionSequence(copy.PrivateDataElementDefinitionSequence), + PrivateGroupReference(copy.PrivateGroupReference) +{ +} + + +DRTPrivateDataElementCharacteristicsSequence::Item::~Item() +{ +} + + +DRTPrivateDataElementCharacteristicsSequence::Item &DRTPrivateDataElementCharacteristicsSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BlockIdentifyingInformationStatus = copy.BlockIdentifyingInformationStatus; + DeidentificationActionSequence = copy.DeidentificationActionSequence; + NonidentifyingPrivateElements = copy.NonidentifyingPrivateElements; + PrivateCreatorReference = copy.PrivateCreatorReference; + PrivateDataElementDefinitionSequence = copy.PrivateDataElementDefinitionSequence; + PrivateGroupReference = copy.PrivateGroupReference; + } + return *this; +} + + +void DRTPrivateDataElementCharacteristicsSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PrivateGroupReference.clear(); + PrivateCreatorReference.clear(); + PrivateDataElementDefinitionSequence.clear(); + BlockIdentifyingInformationStatus.clear(); + NonidentifyingPrivateElements.clear(); + DeidentificationActionSequence.clear(); + } +} + + +OFBool DRTPrivateDataElementCharacteristicsSequence::Item::isEmpty() +{ + return PrivateGroupReference.isEmpty() && + PrivateCreatorReference.isEmpty() && + PrivateDataElementDefinitionSequence.isEmpty() && + BlockIdentifyingInformationStatus.isEmpty() && + NonidentifyingPrivateElements.isEmpty() && + DeidentificationActionSequence.isEmpty(); +} + + +OFBool DRTPrivateDataElementCharacteristicsSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, PrivateGroupReference, "1", "1", "PrivateDataElementCharacteristicsSequence"); + getAndCheckElementFromDataset(item, PrivateCreatorReference, "1", "1", "PrivateDataElementCharacteristicsSequence"); + PrivateDataElementDefinitionSequence.read(item, "1-n", "3", "PrivateDataElementCharacteristicsSequence"); + getAndCheckElementFromDataset(item, BlockIdentifyingInformationStatus, "1", "1", "PrivateDataElementCharacteristicsSequence"); + getAndCheckElementFromDataset(item, NonidentifyingPrivateElements, "1-n", "1C", "PrivateDataElementCharacteristicsSequence"); + DeidentificationActionSequence.read(item, "1-n", "3", "PrivateDataElementCharacteristicsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(PrivateGroupReference), "1", "1", "PrivateDataElementCharacteristicsSequence"); + addElementToDataset(result, item, new DcmLongString(PrivateCreatorReference), "1", "1", "PrivateDataElementCharacteristicsSequence"); + if (result.good()) result = PrivateDataElementDefinitionSequence.write(item, "1-n", "3", "PrivateDataElementCharacteristicsSequence"); + addElementToDataset(result, item, new DcmCodeString(BlockIdentifyingInformationStatus), "1", "1", "PrivateDataElementCharacteristicsSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(NonidentifyingPrivateElements), "1-n", "1C", "PrivateDataElementCharacteristicsSequence"); + if (result.good()) result = DeidentificationActionSequence.write(item, "1-n", "3", "PrivateDataElementCharacteristicsSequence"); + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::getBlockIdentifyingInformationStatus(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockIdentifyingInformationStatus, value, pos); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::getNonidentifyingPrivateElements(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, NonidentifyingPrivateElements).getUint16(value, pos); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::getPrivateCreatorReference(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrivateCreatorReference, value, pos); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::getPrivateGroupReference(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, PrivateGroupReference).getUint16(value, pos); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::setBlockIdentifyingInformationStatus(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockIdentifyingInformationStatus.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::setNonidentifyingPrivateElements(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return NonidentifyingPrivateElements.putUint16(value, pos); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::setPrivateCreatorReference(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrivateCreatorReference.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::Item::setPrivateGroupReference(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return PrivateGroupReference.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTPrivateDataElementCharacteristicsSequence::DRTPrivateDataElementCharacteristicsSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPrivateDataElementCharacteristicsSequence::DRTPrivateDataElementCharacteristicsSequence(const DRTPrivateDataElementCharacteristicsSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPrivateDataElementCharacteristicsSequence &DRTPrivateDataElementCharacteristicsSequence::operator=(const DRTPrivateDataElementCharacteristicsSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPrivateDataElementCharacteristicsSequence::~DRTPrivateDataElementCharacteristicsSequence() +{ + clear(); +} + + +void DRTPrivateDataElementCharacteristicsSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPrivateDataElementCharacteristicsSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPrivateDataElementCharacteristicsSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPrivateDataElementCharacteristicsSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPrivateDataElementCharacteristicsSequence::Item &DRTPrivateDataElementCharacteristicsSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPrivateDataElementCharacteristicsSequence::Item &DRTPrivateDataElementCharacteristicsSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPrivateDataElementCharacteristicsSequence::Item &DRTPrivateDataElementCharacteristicsSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPrivateDataElementCharacteristicsSequence::Item &DRTPrivateDataElementCharacteristicsSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPrivateDataElementCharacteristicsSequence::Item &DRTPrivateDataElementCharacteristicsSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPrivateDataElementCharacteristicsSequence::Item &DRTPrivateDataElementCharacteristicsSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PrivateDataElementCharacteristicsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PrivateDataElementCharacteristicsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPrivateDataElementCharacteristicsSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PrivateDataElementCharacteristicsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpdeds.cc b/dcmrt/libsrc/drtpdeds.cc new file mode 100644 index 00000000..a99bf9e2 --- /dev/null +++ b/dcmrt/libsrc/drtpdeds.cc @@ -0,0 +1,764 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPrivateDataElementDefinitionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpdeds.h" + + +// --- item class --- + +DRTPrivateDataElementDefinitionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + PrivateDataElement(DCM_PrivateDataElement), + PrivateDataElementDescription(DCM_PrivateDataElementDescription), + PrivateDataElementEncoding(DCM_PrivateDataElementEncoding), + PrivateDataElementKeyword(DCM_PrivateDataElementKeyword), + PrivateDataElementName(DCM_PrivateDataElementName), + PrivateDataElementNumberOfItems(DCM_PrivateDataElementNumberOfItems), + PrivateDataElementValueMultiplicity(DCM_PrivateDataElementValueMultiplicity), + PrivateDataElementValueRepresentation(DCM_PrivateDataElementValueRepresentation), + RetrieveURI(DCM_RetrieveURI) +{ +} + + +DRTPrivateDataElementDefinitionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + PrivateDataElement(copy.PrivateDataElement), + PrivateDataElementDescription(copy.PrivateDataElementDescription), + PrivateDataElementEncoding(copy.PrivateDataElementEncoding), + PrivateDataElementKeyword(copy.PrivateDataElementKeyword), + PrivateDataElementName(copy.PrivateDataElementName), + PrivateDataElementNumberOfItems(copy.PrivateDataElementNumberOfItems), + PrivateDataElementValueMultiplicity(copy.PrivateDataElementValueMultiplicity), + PrivateDataElementValueRepresentation(copy.PrivateDataElementValueRepresentation), + RetrieveURI(copy.RetrieveURI) +{ +} + + +DRTPrivateDataElementDefinitionSequence::Item::~Item() +{ +} + + +DRTPrivateDataElementDefinitionSequence::Item &DRTPrivateDataElementDefinitionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + PrivateDataElement = copy.PrivateDataElement; + PrivateDataElementDescription = copy.PrivateDataElementDescription; + PrivateDataElementEncoding = copy.PrivateDataElementEncoding; + PrivateDataElementKeyword = copy.PrivateDataElementKeyword; + PrivateDataElementName = copy.PrivateDataElementName; + PrivateDataElementNumberOfItems = copy.PrivateDataElementNumberOfItems; + PrivateDataElementValueMultiplicity = copy.PrivateDataElementValueMultiplicity; + PrivateDataElementValueRepresentation = copy.PrivateDataElementValueRepresentation; + RetrieveURI = copy.RetrieveURI; + } + return *this; +} + + +void DRTPrivateDataElementDefinitionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PrivateDataElement.clear(); + PrivateDataElementValueMultiplicity.clear(); + PrivateDataElementValueRepresentation.clear(); + PrivateDataElementNumberOfItems.clear(); + PrivateDataElementKeyword.clear(); + PrivateDataElementName.clear(); + PrivateDataElementDescription.clear(); + PrivateDataElementEncoding.clear(); + RetrieveURI.clear(); + } +} + + +OFBool DRTPrivateDataElementDefinitionSequence::Item::isEmpty() +{ + return PrivateDataElement.isEmpty() && + PrivateDataElementValueMultiplicity.isEmpty() && + PrivateDataElementValueRepresentation.isEmpty() && + PrivateDataElementNumberOfItems.isEmpty() && + PrivateDataElementKeyword.isEmpty() && + PrivateDataElementName.isEmpty() && + PrivateDataElementDescription.isEmpty() && + PrivateDataElementEncoding.isEmpty() && + RetrieveURI.isEmpty(); +} + + +OFBool DRTPrivateDataElementDefinitionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, PrivateDataElement, "1", "1", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, PrivateDataElementValueMultiplicity, "1-3", "1", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, PrivateDataElementValueRepresentation, "1", "1", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, PrivateDataElementNumberOfItems, "1-2", "1C", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, PrivateDataElementKeyword, "1", "1", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, PrivateDataElementName, "1", "1", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, PrivateDataElementDescription, "1", "3", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, PrivateDataElementEncoding, "1", "3", "PrivateDataElementDefinitionSequence"); + getAndCheckElementFromDataset(item, RetrieveURI, "1", "3", "PrivateDataElementDefinitionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(PrivateDataElement), "1", "1", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmUnsignedLong(PrivateDataElementValueMultiplicity), "1-3", "1", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmCodeString(PrivateDataElementValueRepresentation), "1", "1", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmUnsignedLong(PrivateDataElementNumberOfItems), "1-2", "1C", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(PrivateDataElementKeyword), "1", "1", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(PrivateDataElementName), "1", "1", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(PrivateDataElementDescription), "1", "3", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(PrivateDataElementEncoding), "1", "3", "PrivateDataElementDefinitionSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(RetrieveURI), "1", "3", "PrivateDataElementDefinitionSequence"); + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElement(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, PrivateDataElement).getUint16(value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElementDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrivateDataElementDescription, value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElementEncoding(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrivateDataElementEncoding, value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElementKeyword(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrivateDataElementKeyword, value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElementName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrivateDataElementName, value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElementNumberOfItems(Uint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedLong &, PrivateDataElementNumberOfItems).getUint32(value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElementValueMultiplicity(Uint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedLong &, PrivateDataElementValueMultiplicity).getUint32(value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getPrivateDataElementValueRepresentation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PrivateDataElementValueRepresentation, value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::getRetrieveURI(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RetrieveURI, value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElement(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return PrivateDataElement.putUint16(value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElementDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PrivateDataElementDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElementEncoding(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PrivateDataElementEncoding.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElementKeyword(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrivateDataElementKeyword.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElementName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrivateDataElementName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElementNumberOfItems(const Uint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return PrivateDataElementNumberOfItems.putUint32(value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElementValueMultiplicity(const Uint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return PrivateDataElementValueMultiplicity.putUint32(value, pos); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setPrivateDataElementValueRepresentation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PrivateDataElementValueRepresentation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::Item::setRetrieveURI(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RetrieveURI.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPrivateDataElementDefinitionSequence::DRTPrivateDataElementDefinitionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPrivateDataElementDefinitionSequence::DRTPrivateDataElementDefinitionSequence(const DRTPrivateDataElementDefinitionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPrivateDataElementDefinitionSequence &DRTPrivateDataElementDefinitionSequence::operator=(const DRTPrivateDataElementDefinitionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPrivateDataElementDefinitionSequence::~DRTPrivateDataElementDefinitionSequence() +{ + clear(); +} + + +void DRTPrivateDataElementDefinitionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPrivateDataElementDefinitionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPrivateDataElementDefinitionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPrivateDataElementDefinitionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPrivateDataElementDefinitionSequence::Item &DRTPrivateDataElementDefinitionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPrivateDataElementDefinitionSequence::Item &DRTPrivateDataElementDefinitionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPrivateDataElementDefinitionSequence::Item &DRTPrivateDataElementDefinitionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPrivateDataElementDefinitionSequence::Item &DRTPrivateDataElementDefinitionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPrivateDataElementDefinitionSequence::Item &DRTPrivateDataElementDefinitionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPrivateDataElementDefinitionSequence::Item &DRTPrivateDataElementDefinitionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PrivateDataElementDefinitionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PrivateDataElementDefinitionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPrivateDataElementDefinitionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PrivateDataElementDefinitionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpfms.cc b/dcmrt/libsrc/drtpfms.cc new file mode 100644 index 00000000..1a630558 --- /dev/null +++ b/dcmrt/libsrc/drtpfms.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPrimaryFluenceModeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpfms.h" + + +// --- item class --- + +DRTPrimaryFluenceModeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + FluenceMode(DCM_FluenceMode), + FluenceModeID(DCM_FluenceModeID) +{ +} + + +DRTPrimaryFluenceModeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + FluenceMode(copy.FluenceMode), + FluenceModeID(copy.FluenceModeID) +{ +} + + +DRTPrimaryFluenceModeSequence::Item::~Item() +{ +} + + +DRTPrimaryFluenceModeSequence::Item &DRTPrimaryFluenceModeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + FluenceMode = copy.FluenceMode; + FluenceModeID = copy.FluenceModeID; + } + return *this; +} + + +void DRTPrimaryFluenceModeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + FluenceMode.clear(); + FluenceModeID.clear(); + } +} + + +OFBool DRTPrimaryFluenceModeSequence::Item::isEmpty() +{ + return FluenceMode.isEmpty() && + FluenceModeID.isEmpty(); +} + + +OFBool DRTPrimaryFluenceModeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPrimaryFluenceModeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, FluenceMode, "1", "1", "PrimaryFluenceModeSequence"); + getAndCheckElementFromDataset(item, FluenceModeID, "1", "1C", "PrimaryFluenceModeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(FluenceMode), "1", "1", "PrimaryFluenceModeSequence"); + addElementToDataset(result, item, new DcmShortString(FluenceModeID), "1", "1C", "PrimaryFluenceModeSequence"); + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::Item::getFluenceMode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FluenceMode, value, pos); +} + + +OFCondition DRTPrimaryFluenceModeSequence::Item::getFluenceModeID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FluenceModeID, value, pos); +} + + +OFCondition DRTPrimaryFluenceModeSequence::Item::setFluenceMode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FluenceMode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::Item::setFluenceModeID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FluenceModeID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPrimaryFluenceModeSequence::DRTPrimaryFluenceModeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPrimaryFluenceModeSequence::DRTPrimaryFluenceModeSequence(const DRTPrimaryFluenceModeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPrimaryFluenceModeSequence &DRTPrimaryFluenceModeSequence::operator=(const DRTPrimaryFluenceModeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPrimaryFluenceModeSequence::~DRTPrimaryFluenceModeSequence() +{ + clear(); +} + + +void DRTPrimaryFluenceModeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPrimaryFluenceModeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPrimaryFluenceModeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPrimaryFluenceModeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPrimaryFluenceModeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPrimaryFluenceModeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPrimaryFluenceModeSequence::Item &DRTPrimaryFluenceModeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPrimaryFluenceModeSequence::Item &DRTPrimaryFluenceModeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPrimaryFluenceModeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPrimaryFluenceModeSequence::Item &DRTPrimaryFluenceModeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPrimaryFluenceModeSequence::Item &DRTPrimaryFluenceModeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPrimaryFluenceModeSequence::Item &DRTPrimaryFluenceModeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPrimaryFluenceModeSequence::Item &DRTPrimaryFluenceModeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPrimaryFluenceModeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PrimaryFluenceModeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PrimaryFluenceModeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPrimaryFluenceModeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PrimaryFluenceModeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpics.cc b/dcmrt/libsrc/drtpics.cc new file mode 100644 index 00000000..9ececd0b --- /dev/null +++ b/dcmrt/libsrc/drtpics.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPersonIdentificationCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpics.h" + + +// --- item class --- + +DRTPersonIdentificationCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTPersonIdentificationCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTPersonIdentificationCodeSequence::Item::~Item() +{ +} + + +DRTPersonIdentificationCodeSequence::Item &DRTPersonIdentificationCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTPersonIdentificationCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTPersonIdentificationCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTPersonIdentificationCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "PersonIdentificationCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "PersonIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "PersonIdentificationCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "PersonIdentificationCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "PersonIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "PersonIdentificationCodeSequence"); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPersonIdentificationCodeSequence::DRTPersonIdentificationCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPersonIdentificationCodeSequence::DRTPersonIdentificationCodeSequence(const DRTPersonIdentificationCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPersonIdentificationCodeSequence &DRTPersonIdentificationCodeSequence::operator=(const DRTPersonIdentificationCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPersonIdentificationCodeSequence::~DRTPersonIdentificationCodeSequence() +{ + clear(); +} + + +void DRTPersonIdentificationCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPersonIdentificationCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPersonIdentificationCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPersonIdentificationCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPersonIdentificationCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPersonIdentificationCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPersonIdentificationCodeSequence::Item &DRTPersonIdentificationCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPersonIdentificationCodeSequence::Item &DRTPersonIdentificationCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPersonIdentificationCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPersonIdentificationCodeSequence::Item &DRTPersonIdentificationCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPersonIdentificationCodeSequence::Item &DRTPersonIdentificationCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPersonIdentificationCodeSequence::Item &DRTPersonIdentificationCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPersonIdentificationCodeSequence::Item &DRTPersonIdentificationCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPersonIdentificationCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PersonIdentificationCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PersonIdentificationCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPersonIdentificationCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PersonIdentificationCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtplan.cc b/dcmrt/libsrc/drtplan.cc new file mode 100644 index 00000000..b147317a --- /dev/null +++ b/dcmrt/libsrc/drtplan.cc @@ -0,0 +1,3680 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPlanIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drtplan.h" + + +DRTPlanIOD::DRTPlanIOD() + : PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(), + PatientBirthDate(DCM_PatientBirthDate), + PatientBirthDateInAlternativeCalendar(DCM_PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(DCM_PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(DCM_PatientAlternativeCalendar), + PatientSex(DCM_PatientSex), + ReferencedPatientPhotoSequence(), + QualityControlSubject(DCM_QualityControlSubject), + ReferencedPatientSequence(), + PatientBirthTime(DCM_PatientBirthTime), + OtherPatientIDsSequence(), + OtherPatientNames(DCM_OtherPatientNames), + EthnicGroup(DCM_EthnicGroup), + PatientComments(DCM_PatientComments), + PatientSpeciesDescription(DCM_PatientSpeciesDescription), + PatientSpeciesCodeSequence(), + PatientBreedDescription(DCM_PatientBreedDescription), + PatientBreedCodeSequence(), + BreedRegistrationSequence(), + StrainDescription(DCM_StrainDescription), + StrainNomenclature(DCM_StrainNomenclature), + StrainCodeSequence(), + StrainAdditionalInformation(DCM_StrainAdditionalInformation), + StrainStockSequence(), + GeneticModificationsSequence(), + ResponsiblePerson(DCM_ResponsiblePerson), + ResponsiblePersonRole(DCM_ResponsiblePersonRole), + ResponsibleOrganization(DCM_ResponsibleOrganization), + PatientIdentityRemoved(DCM_PatientIdentityRemoved), + DeidentificationMethod(DCM_DeidentificationMethod), + DeidentificationMethodCodeSequence(), + SourcePatientGroupIdentificationSequence(), + GroupOfPatientsIdentificationSequence(), + ClinicalTrialSponsorName(DCM_ClinicalTrialSponsorName), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ClinicalTrialProtocolName(DCM_ClinicalTrialProtocolName), + ClinicalTrialSiteID(DCM_ClinicalTrialSiteID), + ClinicalTrialSiteName(DCM_ClinicalTrialSiteName), + ClinicalTrialSubjectID(DCM_ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(DCM_ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(DCM_ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(), + ConsultingPhysicianName(DCM_ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(), + StudyDescription(DCM_StudyDescription), + PhysiciansOfRecord(DCM_PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(), + NameOfPhysiciansReadingStudy(DCM_NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(), + RequestingServiceCodeSequence(), + ReferencedStudySequence(), + ProcedureCodeSequence(), + ReasonForPerformedProcedureCodeSequence(), + AdmittingDiagnosesDescription(DCM_AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(), + PatientAge(DCM_PatientAge), + PatientSize(DCM_PatientSize), + PatientWeight(DCM_PatientWeight), + PatientBodyMassIndex(DCM_PatientBodyMassIndex), + MeasuredAPDimension(DCM_MeasuredAPDimension), + MeasuredLateralDimension(DCM_MeasuredLateralDimension), + PatientSizeCodeSequence(), + MedicalAlerts(DCM_MedicalAlerts), + Allergies(DCM_Allergies), + SmokingStatus(DCM_SmokingStatus), + PregnancyStatus(DCM_PregnancyStatus), + LastMenstrualDate(DCM_LastMenstrualDate), + PatientState(DCM_PatientState), + Occupation(DCM_Occupation), + AdditionalPatientHistory(DCM_AdditionalPatientHistory), + AdmissionID(DCM_AdmissionID), + IssuerOfAdmissionIDSequence(), + ServiceEpisodeID(DCM_ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(), + ServiceEpisodeDescription(DCM_ServiceEpisodeDescription), + PatientSexNeutered(DCM_PatientSexNeutered), + ClinicalTrialTimePointID(DCM_ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(DCM_ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(DCM_LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(DCM_LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + SeriesDescription(DCM_SeriesDescription), + SeriesDescriptionCodeSequence(), + OperatorsName(DCM_OperatorsName), + OperatorIdentificationSequence(), + ReferencedPerformedProcedureStepSequence(), + RequestAttributesSequence(), + PerformedProcedureStepID(DCM_PerformedProcedureStepID), + PerformedProcedureStepStartDate(DCM_PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(DCM_PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(DCM_PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(DCM_PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(DCM_PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(), + CommentsOnThePerformedProcedureStep(DCM_CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(DCM_ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(DCM_ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(DCM_ClinicalTrialSeriesDescription), + FrameOfReferenceUID(DCM_FrameOfReferenceUID), + PositionReferenceIndicator(DCM_PositionReferenceIndicator), + Manufacturer(DCM_Manufacturer), + InstitutionName(DCM_InstitutionName), + InstitutionAddress(DCM_InstitutionAddress), + StationName(DCM_StationName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + GantryID(DCM_GantryID), + UDISequence(), + SpatialResolution(DCM_SpatialResolution), + DateOfLastCalibration(DCM_DateOfLastCalibration), + TimeOfLastCalibration(DCM_TimeOfLastCalibration), + PixelPaddingValue(DCM_PixelPaddingValue), + RTPlanLabel(DCM_RTPlanLabel), + RTPlanName(DCM_RTPlanName), + RTPlanDescription(DCM_RTPlanDescription), + InstanceNumber(DCM_InstanceNumber), + RTPlanDate(DCM_RTPlanDate), + RTPlanTime(DCM_RTPlanTime), + TreatmentProtocols(DCM_TreatmentProtocols), + PlanIntent(DCM_PlanIntent), + TreatmentSites(DCM_TreatmentSites), + RTPlanGeometry(DCM_RTPlanGeometry), + ReferencedStructureSetSequence(), + ReferencedDoseSequence(), + ReferencedRTPlanSequence(), + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(DCM_FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix), + PrescriptionDescription(DCM_PrescriptionDescription), + DoseReferenceSequence(), + ToleranceTableSequence(), + PatientSetupSequence(), + FractionGroupSequence(), + BeamSequence(), + BrachyTreatmentTechnique(DCM_BrachyTreatmentTechnique), + BrachyTreatmentType(DCM_BrachyTreatmentType), + TreatmentMachineSequence(), + SourceSequence(), + ApplicationSetupSequence(), + ApprovalStatus(DCM_ApprovalStatus), + ReviewDate(DCM_ReviewDate), + ReviewTime(DCM_ReviewTime), + ReviewerName(DCM_ReviewerName), + ReferencedImageSequence(), + ReferencedInstanceSequence(), + DerivationDescription(DCM_DerivationDescription), + DerivationCodeSequence(), + SourceImageSequence(), + SourceInstanceSequence(), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCoercionDateTime(DCM_InstanceCoercionDateTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + RelatedGeneralSOPClassUID(DCM_RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(DCM_OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(), + ContextGroupIdentificationSequence(), + MappingResourceIdentificationSequence(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + ContributingEquipmentSequence(), + SOPInstanceStatus(DCM_SOPInstanceStatus), + SOPAuthorizationDateTime(DCM_SOPAuthorizationDateTime), + SOPAuthorizationComment(DCM_SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(DCM_AuthorizationEquipmentCertificationNumber), + MACParametersSequence(), + DigitalSignaturesSequence(), + EncryptedAttributesSequence(), + OriginalAttributesSequence(), + HL7StructuredDocumentReferenceSequence(), + LongitudinalTemporalInformationModified(DCM_LongitudinalTemporalInformationModified), + QueryRetrieveView(DCM_QueryRetrieveView), + ConversionSourceAttributesSequence(), + ContentQualification(DCM_ContentQualification), + PrivateDataElementCharacteristicsSequence(), + ReferencedSeriesSequence(), + StudiesContainingOtherReferencedInstancesSequence() +{ + /* set initial values for a new SOP instance */ + updateAttributes(); +} + + +DRTPlanIOD::DRTPlanIOD(const DRTPlanIOD ©) + : PatientName(copy.PatientName), + PatientID(copy.PatientID), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientBirthDate(copy.PatientBirthDate), + PatientBirthDateInAlternativeCalendar(copy.PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(copy.PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(copy.PatientAlternativeCalendar), + PatientSex(copy.PatientSex), + ReferencedPatientPhotoSequence(copy.ReferencedPatientPhotoSequence), + QualityControlSubject(copy.QualityControlSubject), + ReferencedPatientSequence(copy.ReferencedPatientSequence), + PatientBirthTime(copy.PatientBirthTime), + OtherPatientIDsSequence(copy.OtherPatientIDsSequence), + OtherPatientNames(copy.OtherPatientNames), + EthnicGroup(copy.EthnicGroup), + PatientComments(copy.PatientComments), + PatientSpeciesDescription(copy.PatientSpeciesDescription), + PatientSpeciesCodeSequence(copy.PatientSpeciesCodeSequence), + PatientBreedDescription(copy.PatientBreedDescription), + PatientBreedCodeSequence(copy.PatientBreedCodeSequence), + BreedRegistrationSequence(copy.BreedRegistrationSequence), + StrainDescription(copy.StrainDescription), + StrainNomenclature(copy.StrainNomenclature), + StrainCodeSequence(copy.StrainCodeSequence), + StrainAdditionalInformation(copy.StrainAdditionalInformation), + StrainStockSequence(copy.StrainStockSequence), + GeneticModificationsSequence(copy.GeneticModificationsSequence), + ResponsiblePerson(copy.ResponsiblePerson), + ResponsiblePersonRole(copy.ResponsiblePersonRole), + ResponsibleOrganization(copy.ResponsibleOrganization), + PatientIdentityRemoved(copy.PatientIdentityRemoved), + DeidentificationMethod(copy.DeidentificationMethod), + DeidentificationMethodCodeSequence(copy.DeidentificationMethodCodeSequence), + SourcePatientGroupIdentificationSequence(copy.SourcePatientGroupIdentificationSequence), + GroupOfPatientsIdentificationSequence(copy.GroupOfPatientsIdentificationSequence), + ClinicalTrialSponsorName(copy.ClinicalTrialSponsorName), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ClinicalTrialProtocolName(copy.ClinicalTrialProtocolName), + ClinicalTrialSiteID(copy.ClinicalTrialSiteID), + ClinicalTrialSiteName(copy.ClinicalTrialSiteName), + ClinicalTrialSubjectID(copy.ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(copy.ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(copy.ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(copy.StudyInstanceUID), + StudyDate(copy.StudyDate), + StudyTime(copy.StudyTime), + ReferringPhysicianName(copy.ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(copy.ReferringPhysicianIdentificationSequence), + ConsultingPhysicianName(copy.ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(copy.ConsultingPhysicianIdentificationSequence), + StudyID(copy.StudyID), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + StudyDescription(copy.StudyDescription), + PhysiciansOfRecord(copy.PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(copy.PhysiciansOfRecordIdentificationSequence), + NameOfPhysiciansReadingStudy(copy.NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(copy.PhysiciansReadingStudyIdentificationSequence), + RequestingServiceCodeSequence(copy.RequestingServiceCodeSequence), + ReferencedStudySequence(copy.ReferencedStudySequence), + ProcedureCodeSequence(copy.ProcedureCodeSequence), + ReasonForPerformedProcedureCodeSequence(copy.ReasonForPerformedProcedureCodeSequence), + AdmittingDiagnosesDescription(copy.AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(copy.AdmittingDiagnosesCodeSequence), + PatientAge(copy.PatientAge), + PatientSize(copy.PatientSize), + PatientWeight(copy.PatientWeight), + PatientBodyMassIndex(copy.PatientBodyMassIndex), + MeasuredAPDimension(copy.MeasuredAPDimension), + MeasuredLateralDimension(copy.MeasuredLateralDimension), + PatientSizeCodeSequence(copy.PatientSizeCodeSequence), + MedicalAlerts(copy.MedicalAlerts), + Allergies(copy.Allergies), + SmokingStatus(copy.SmokingStatus), + PregnancyStatus(copy.PregnancyStatus), + LastMenstrualDate(copy.LastMenstrualDate), + PatientState(copy.PatientState), + Occupation(copy.Occupation), + AdditionalPatientHistory(copy.AdditionalPatientHistory), + AdmissionID(copy.AdmissionID), + IssuerOfAdmissionIDSequence(copy.IssuerOfAdmissionIDSequence), + ServiceEpisodeID(copy.ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(copy.IssuerOfServiceEpisodeIDSequence), + ServiceEpisodeDescription(copy.ServiceEpisodeDescription), + PatientSexNeutered(copy.PatientSexNeutered), + ClinicalTrialTimePointID(copy.ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(copy.ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(copy.LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(copy.LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(copy.ConsentForClinicalTrialUseSequence), + Modality(copy.Modality), + SeriesInstanceUID(copy.SeriesInstanceUID), + SeriesNumber(copy.SeriesNumber), + SeriesDate(copy.SeriesDate), + SeriesTime(copy.SeriesTime), + SeriesDescription(copy.SeriesDescription), + SeriesDescriptionCodeSequence(copy.SeriesDescriptionCodeSequence), + OperatorsName(copy.OperatorsName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + ReferencedPerformedProcedureStepSequence(copy.ReferencedPerformedProcedureStepSequence), + RequestAttributesSequence(copy.RequestAttributesSequence), + PerformedProcedureStepID(copy.PerformedProcedureStepID), + PerformedProcedureStepStartDate(copy.PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(copy.PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(copy.PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(copy.PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(copy.PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(copy.PerformedProtocolCodeSequence), + CommentsOnThePerformedProcedureStep(copy.CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(copy.ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(copy.ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(copy.ClinicalTrialSeriesDescription), + FrameOfReferenceUID(copy.FrameOfReferenceUID), + PositionReferenceIndicator(copy.PositionReferenceIndicator), + Manufacturer(copy.Manufacturer), + InstitutionName(copy.InstitutionName), + InstitutionAddress(copy.InstitutionAddress), + StationName(copy.StationName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + ManufacturerModelName(copy.ManufacturerModelName), + DeviceSerialNumber(copy.DeviceSerialNumber), + SoftwareVersions(copy.SoftwareVersions), + GantryID(copy.GantryID), + UDISequence(copy.UDISequence), + SpatialResolution(copy.SpatialResolution), + DateOfLastCalibration(copy.DateOfLastCalibration), + TimeOfLastCalibration(copy.TimeOfLastCalibration), + PixelPaddingValue(copy.PixelPaddingValue), + RTPlanLabel(copy.RTPlanLabel), + RTPlanName(copy.RTPlanName), + RTPlanDescription(copy.RTPlanDescription), + InstanceNumber(copy.InstanceNumber), + RTPlanDate(copy.RTPlanDate), + RTPlanTime(copy.RTPlanTime), + TreatmentProtocols(copy.TreatmentProtocols), + PlanIntent(copy.PlanIntent), + TreatmentSites(copy.TreatmentSites), + RTPlanGeometry(copy.RTPlanGeometry), + ReferencedStructureSetSequence(copy.ReferencedStructureSetSequence), + ReferencedDoseSequence(copy.ReferencedDoseSequence), + ReferencedRTPlanSequence(copy.ReferencedRTPlanSequence), + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(copy.FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix), + PrescriptionDescription(copy.PrescriptionDescription), + DoseReferenceSequence(copy.DoseReferenceSequence), + ToleranceTableSequence(copy.ToleranceTableSequence), + PatientSetupSequence(copy.PatientSetupSequence), + FractionGroupSequence(copy.FractionGroupSequence), + BeamSequence(copy.BeamSequence), + BrachyTreatmentTechnique(copy.BrachyTreatmentTechnique), + BrachyTreatmentType(copy.BrachyTreatmentType), + TreatmentMachineSequence(copy.TreatmentMachineSequence), + SourceSequence(copy.SourceSequence), + ApplicationSetupSequence(copy.ApplicationSetupSequence), + ApprovalStatus(copy.ApprovalStatus), + ReviewDate(copy.ReviewDate), + ReviewTime(copy.ReviewTime), + ReviewerName(copy.ReviewerName), + ReferencedImageSequence(copy.ReferencedImageSequence), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + DerivationDescription(copy.DerivationDescription), + DerivationCodeSequence(copy.DerivationCodeSequence), + SourceImageSequence(copy.SourceImageSequence), + SourceInstanceSequence(copy.SourceInstanceSequence), + SOPClassUID(copy.SOPClassUID), + SOPInstanceUID(copy.SOPInstanceUID), + SpecificCharacterSet(copy.SpecificCharacterSet), + InstanceCreationDate(copy.InstanceCreationDate), + InstanceCreationTime(copy.InstanceCreationTime), + InstanceCoercionDateTime(copy.InstanceCoercionDateTime), + InstanceCreatorUID(copy.InstanceCreatorUID), + RelatedGeneralSOPClassUID(copy.RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(copy.OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(copy.CodingSchemeIdentificationSequence), + ContextGroupIdentificationSequence(copy.ContextGroupIdentificationSequence), + MappingResourceIdentificationSequence(copy.MappingResourceIdentificationSequence), + TimezoneOffsetFromUTC(copy.TimezoneOffsetFromUTC), + ContributingEquipmentSequence(copy.ContributingEquipmentSequence), + SOPInstanceStatus(copy.SOPInstanceStatus), + SOPAuthorizationDateTime(copy.SOPAuthorizationDateTime), + SOPAuthorizationComment(copy.SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(copy.AuthorizationEquipmentCertificationNumber), + MACParametersSequence(copy.MACParametersSequence), + DigitalSignaturesSequence(copy.DigitalSignaturesSequence), + EncryptedAttributesSequence(copy.EncryptedAttributesSequence), + OriginalAttributesSequence(copy.OriginalAttributesSequence), + HL7StructuredDocumentReferenceSequence(copy.HL7StructuredDocumentReferenceSequence), + LongitudinalTemporalInformationModified(copy.LongitudinalTemporalInformationModified), + QueryRetrieveView(copy.QueryRetrieveView), + ConversionSourceAttributesSequence(copy.ConversionSourceAttributesSequence), + ContentQualification(copy.ContentQualification), + PrivateDataElementCharacteristicsSequence(copy.PrivateDataElementCharacteristicsSequence), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudiesContainingOtherReferencedInstancesSequence(copy.StudiesContainingOtherReferencedInstancesSequence) +{ +} + + +DRTPlanIOD::~DRTPlanIOD() +{ +} + + +DRTPlanIOD &DRTPlanIOD::operator=(const DRTPlanIOD ©) +{ + if (this != ©) + { + PatientName = copy.PatientName; + PatientID = copy.PatientID; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientBirthDate = copy.PatientBirthDate; + PatientBirthDateInAlternativeCalendar = copy.PatientBirthDateInAlternativeCalendar; + PatientDeathDateInAlternativeCalendar = copy.PatientDeathDateInAlternativeCalendar; + PatientAlternativeCalendar = copy.PatientAlternativeCalendar; + PatientSex = copy.PatientSex; + ReferencedPatientPhotoSequence = copy.ReferencedPatientPhotoSequence; + QualityControlSubject = copy.QualityControlSubject; + ReferencedPatientSequence = copy.ReferencedPatientSequence; + PatientBirthTime = copy.PatientBirthTime; + OtherPatientIDsSequence = copy.OtherPatientIDsSequence; + OtherPatientNames = copy.OtherPatientNames; + EthnicGroup = copy.EthnicGroup; + PatientComments = copy.PatientComments; + PatientSpeciesDescription = copy.PatientSpeciesDescription; + PatientSpeciesCodeSequence = copy.PatientSpeciesCodeSequence; + PatientBreedDescription = copy.PatientBreedDescription; + PatientBreedCodeSequence = copy.PatientBreedCodeSequence; + BreedRegistrationSequence = copy.BreedRegistrationSequence; + StrainDescription = copy.StrainDescription; + StrainNomenclature = copy.StrainNomenclature; + StrainCodeSequence = copy.StrainCodeSequence; + StrainAdditionalInformation = copy.StrainAdditionalInformation; + StrainStockSequence = copy.StrainStockSequence; + GeneticModificationsSequence = copy.GeneticModificationsSequence; + ResponsiblePerson = copy.ResponsiblePerson; + ResponsiblePersonRole = copy.ResponsiblePersonRole; + ResponsibleOrganization = copy.ResponsibleOrganization; + PatientIdentityRemoved = copy.PatientIdentityRemoved; + DeidentificationMethod = copy.DeidentificationMethod; + DeidentificationMethodCodeSequence = copy.DeidentificationMethodCodeSequence; + SourcePatientGroupIdentificationSequence = copy.SourcePatientGroupIdentificationSequence; + GroupOfPatientsIdentificationSequence = copy.GroupOfPatientsIdentificationSequence; + ClinicalTrialSponsorName = copy.ClinicalTrialSponsorName; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ClinicalTrialProtocolName = copy.ClinicalTrialProtocolName; + ClinicalTrialSiteID = copy.ClinicalTrialSiteID; + ClinicalTrialSiteName = copy.ClinicalTrialSiteName; + ClinicalTrialSubjectID = copy.ClinicalTrialSubjectID; + ClinicalTrialSubjectReadingID = copy.ClinicalTrialSubjectReadingID; + ClinicalTrialProtocolEthicsCommitteeName = copy.ClinicalTrialProtocolEthicsCommitteeName; + ClinicalTrialProtocolEthicsCommitteeApprovalNumber = copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + StudyInstanceUID = copy.StudyInstanceUID; + StudyDate = copy.StudyDate; + StudyTime = copy.StudyTime; + ReferringPhysicianName = copy.ReferringPhysicianName; + ReferringPhysicianIdentificationSequence = copy.ReferringPhysicianIdentificationSequence; + ConsultingPhysicianName = copy.ConsultingPhysicianName; + ConsultingPhysicianIdentificationSequence = copy.ConsultingPhysicianIdentificationSequence; + StudyID = copy.StudyID; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + StudyDescription = copy.StudyDescription; + PhysiciansOfRecord = copy.PhysiciansOfRecord; + PhysiciansOfRecordIdentificationSequence = copy.PhysiciansOfRecordIdentificationSequence; + NameOfPhysiciansReadingStudy = copy.NameOfPhysiciansReadingStudy; + PhysiciansReadingStudyIdentificationSequence = copy.PhysiciansReadingStudyIdentificationSequence; + RequestingServiceCodeSequence = copy.RequestingServiceCodeSequence; + ReferencedStudySequence = copy.ReferencedStudySequence; + ProcedureCodeSequence = copy.ProcedureCodeSequence; + ReasonForPerformedProcedureCodeSequence = copy.ReasonForPerformedProcedureCodeSequence; + AdmittingDiagnosesDescription = copy.AdmittingDiagnosesDescription; + AdmittingDiagnosesCodeSequence = copy.AdmittingDiagnosesCodeSequence; + PatientAge = copy.PatientAge; + PatientSize = copy.PatientSize; + PatientWeight = copy.PatientWeight; + PatientBodyMassIndex = copy.PatientBodyMassIndex; + MeasuredAPDimension = copy.MeasuredAPDimension; + MeasuredLateralDimension = copy.MeasuredLateralDimension; + PatientSizeCodeSequence = copy.PatientSizeCodeSequence; + MedicalAlerts = copy.MedicalAlerts; + Allergies = copy.Allergies; + SmokingStatus = copy.SmokingStatus; + PregnancyStatus = copy.PregnancyStatus; + LastMenstrualDate = copy.LastMenstrualDate; + PatientState = copy.PatientState; + Occupation = copy.Occupation; + AdditionalPatientHistory = copy.AdditionalPatientHistory; + AdmissionID = copy.AdmissionID; + IssuerOfAdmissionIDSequence = copy.IssuerOfAdmissionIDSequence; + ServiceEpisodeID = copy.ServiceEpisodeID; + IssuerOfServiceEpisodeIDSequence = copy.IssuerOfServiceEpisodeIDSequence; + ServiceEpisodeDescription = copy.ServiceEpisodeDescription; + PatientSexNeutered = copy.PatientSexNeutered; + ClinicalTrialTimePointID = copy.ClinicalTrialTimePointID; + ClinicalTrialTimePointDescription = copy.ClinicalTrialTimePointDescription; + LongitudinalTemporalOffsetFromEvent = copy.LongitudinalTemporalOffsetFromEvent; + LongitudinalTemporalEventType = copy.LongitudinalTemporalEventType; + ConsentForClinicalTrialUseSequence = copy.ConsentForClinicalTrialUseSequence; + Modality = copy.Modality; + SeriesInstanceUID = copy.SeriesInstanceUID; + SeriesNumber = copy.SeriesNumber; + SeriesDate = copy.SeriesDate; + SeriesTime = copy.SeriesTime; + SeriesDescription = copy.SeriesDescription; + SeriesDescriptionCodeSequence = copy.SeriesDescriptionCodeSequence; + OperatorsName = copy.OperatorsName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + ReferencedPerformedProcedureStepSequence = copy.ReferencedPerformedProcedureStepSequence; + RequestAttributesSequence = copy.RequestAttributesSequence; + PerformedProcedureStepID = copy.PerformedProcedureStepID; + PerformedProcedureStepStartDate = copy.PerformedProcedureStepStartDate; + PerformedProcedureStepStartTime = copy.PerformedProcedureStepStartTime; + PerformedProcedureStepEndDate = copy.PerformedProcedureStepEndDate; + PerformedProcedureStepEndTime = copy.PerformedProcedureStepEndTime; + PerformedProcedureStepDescription = copy.PerformedProcedureStepDescription; + PerformedProtocolCodeSequence = copy.PerformedProtocolCodeSequence; + CommentsOnThePerformedProcedureStep = copy.CommentsOnThePerformedProcedureStep; + ClinicalTrialCoordinatingCenterName = copy.ClinicalTrialCoordinatingCenterName; + ClinicalTrialSeriesID = copy.ClinicalTrialSeriesID; + ClinicalTrialSeriesDescription = copy.ClinicalTrialSeriesDescription; + FrameOfReferenceUID = copy.FrameOfReferenceUID; + PositionReferenceIndicator = copy.PositionReferenceIndicator; + Manufacturer = copy.Manufacturer; + InstitutionName = copy.InstitutionName; + InstitutionAddress = copy.InstitutionAddress; + StationName = copy.StationName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + ManufacturerModelName = copy.ManufacturerModelName; + DeviceSerialNumber = copy.DeviceSerialNumber; + SoftwareVersions = copy.SoftwareVersions; + GantryID = copy.GantryID; + UDISequence = copy.UDISequence; + SpatialResolution = copy.SpatialResolution; + DateOfLastCalibration = copy.DateOfLastCalibration; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + PixelPaddingValue = copy.PixelPaddingValue; + RTPlanLabel = copy.RTPlanLabel; + RTPlanName = copy.RTPlanName; + RTPlanDescription = copy.RTPlanDescription; + InstanceNumber = copy.InstanceNumber; + RTPlanDate = copy.RTPlanDate; + RTPlanTime = copy.RTPlanTime; + TreatmentProtocols = copy.TreatmentProtocols; + PlanIntent = copy.PlanIntent; + TreatmentSites = copy.TreatmentSites; + RTPlanGeometry = copy.RTPlanGeometry; + ReferencedStructureSetSequence = copy.ReferencedStructureSetSequence; + ReferencedDoseSequence = copy.ReferencedDoseSequence; + ReferencedRTPlanSequence = copy.ReferencedRTPlanSequence; + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix = copy.FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix; + PrescriptionDescription = copy.PrescriptionDescription; + DoseReferenceSequence = copy.DoseReferenceSequence; + ToleranceTableSequence = copy.ToleranceTableSequence; + PatientSetupSequence = copy.PatientSetupSequence; + FractionGroupSequence = copy.FractionGroupSequence; + BeamSequence = copy.BeamSequence; + BrachyTreatmentTechnique = copy.BrachyTreatmentTechnique; + BrachyTreatmentType = copy.BrachyTreatmentType; + TreatmentMachineSequence = copy.TreatmentMachineSequence; + SourceSequence = copy.SourceSequence; + ApplicationSetupSequence = copy.ApplicationSetupSequence; + ApprovalStatus = copy.ApprovalStatus; + ReviewDate = copy.ReviewDate; + ReviewTime = copy.ReviewTime; + ReviewerName = copy.ReviewerName; + ReferencedImageSequence = copy.ReferencedImageSequence; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + DerivationDescription = copy.DerivationDescription; + DerivationCodeSequence = copy.DerivationCodeSequence; + SourceImageSequence = copy.SourceImageSequence; + SourceInstanceSequence = copy.SourceInstanceSequence; + SOPClassUID = copy.SOPClassUID; + SOPInstanceUID = copy.SOPInstanceUID; + SpecificCharacterSet = copy.SpecificCharacterSet; + InstanceCreationDate = copy.InstanceCreationDate; + InstanceCreationTime = copy.InstanceCreationTime; + InstanceCoercionDateTime = copy.InstanceCoercionDateTime; + InstanceCreatorUID = copy.InstanceCreatorUID; + RelatedGeneralSOPClassUID = copy.RelatedGeneralSOPClassUID; + OriginalSpecializedSOPClassUID = copy.OriginalSpecializedSOPClassUID; + CodingSchemeIdentificationSequence = copy.CodingSchemeIdentificationSequence; + ContextGroupIdentificationSequence = copy.ContextGroupIdentificationSequence; + MappingResourceIdentificationSequence = copy.MappingResourceIdentificationSequence; + TimezoneOffsetFromUTC = copy.TimezoneOffsetFromUTC; + ContributingEquipmentSequence = copy.ContributingEquipmentSequence; + SOPInstanceStatus = copy.SOPInstanceStatus; + SOPAuthorizationDateTime = copy.SOPAuthorizationDateTime; + SOPAuthorizationComment = copy.SOPAuthorizationComment; + AuthorizationEquipmentCertificationNumber = copy.AuthorizationEquipmentCertificationNumber; + MACParametersSequence = copy.MACParametersSequence; + DigitalSignaturesSequence = copy.DigitalSignaturesSequence; + EncryptedAttributesSequence = copy.EncryptedAttributesSequence; + OriginalAttributesSequence = copy.OriginalAttributesSequence; + HL7StructuredDocumentReferenceSequence = copy.HL7StructuredDocumentReferenceSequence; + LongitudinalTemporalInformationModified = copy.LongitudinalTemporalInformationModified; + QueryRetrieveView = copy.QueryRetrieveView; + ConversionSourceAttributesSequence = copy.ConversionSourceAttributesSequence; + ContentQualification = copy.ContentQualification; + PrivateDataElementCharacteristicsSequence = copy.PrivateDataElementCharacteristicsSequence; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudiesContainingOtherReferencedInstancesSequence = copy.StudiesContainingOtherReferencedInstancesSequence; + } + return *this; +} + + +void DRTPlanIOD::clear() +{ + /* clear all DICOM attributes */ + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + PatientBirthDate.clear(); + PatientBirthDateInAlternativeCalendar.clear(); + PatientDeathDateInAlternativeCalendar.clear(); + PatientAlternativeCalendar.clear(); + PatientSex.clear(); + ReferencedPatientPhotoSequence.clear(); + QualityControlSubject.clear(); + ReferencedPatientSequence.clear(); + PatientBirthTime.clear(); + OtherPatientIDsSequence.clear(); + OtherPatientNames.clear(); + EthnicGroup.clear(); + PatientComments.clear(); + PatientSpeciesDescription.clear(); + PatientSpeciesCodeSequence.clear(); + PatientBreedDescription.clear(); + PatientBreedCodeSequence.clear(); + BreedRegistrationSequence.clear(); + StrainDescription.clear(); + StrainNomenclature.clear(); + StrainCodeSequence.clear(); + StrainAdditionalInformation.clear(); + StrainStockSequence.clear(); + GeneticModificationsSequence.clear(); + ResponsiblePerson.clear(); + ResponsiblePersonRole.clear(); + ResponsibleOrganization.clear(); + PatientIdentityRemoved.clear(); + DeidentificationMethod.clear(); + DeidentificationMethodCodeSequence.clear(); + SourcePatientGroupIdentificationSequence.clear(); + GroupOfPatientsIdentificationSequence.clear(); + ClinicalTrialSponsorName.clear(); + ClinicalTrialProtocolID.clear(); + ClinicalTrialProtocolName.clear(); + ClinicalTrialSiteID.clear(); + ClinicalTrialSiteName.clear(); + ClinicalTrialSubjectID.clear(); + ClinicalTrialSubjectReadingID.clear(); + ClinicalTrialProtocolEthicsCommitteeName.clear(); + ClinicalTrialProtocolEthicsCommitteeApprovalNumber.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + ReferringPhysicianIdentificationSequence.clear(); + ConsultingPhysicianName.clear(); + ConsultingPhysicianIdentificationSequence.clear(); + StudyID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyDescription.clear(); + PhysiciansOfRecord.clear(); + PhysiciansOfRecordIdentificationSequence.clear(); + NameOfPhysiciansReadingStudy.clear(); + PhysiciansReadingStudyIdentificationSequence.clear(); + RequestingServiceCodeSequence.clear(); + ReferencedStudySequence.clear(); + ProcedureCodeSequence.clear(); + ReasonForPerformedProcedureCodeSequence.clear(); + AdmittingDiagnosesDescription.clear(); + AdmittingDiagnosesCodeSequence.clear(); + PatientAge.clear(); + PatientSize.clear(); + PatientWeight.clear(); + PatientBodyMassIndex.clear(); + MeasuredAPDimension.clear(); + MeasuredLateralDimension.clear(); + PatientSizeCodeSequence.clear(); + MedicalAlerts.clear(); + Allergies.clear(); + SmokingStatus.clear(); + PregnancyStatus.clear(); + LastMenstrualDate.clear(); + PatientState.clear(); + Occupation.clear(); + AdditionalPatientHistory.clear(); + AdmissionID.clear(); + IssuerOfAdmissionIDSequence.clear(); + ServiceEpisodeID.clear(); + IssuerOfServiceEpisodeIDSequence.clear(); + ServiceEpisodeDescription.clear(); + PatientSexNeutered.clear(); + ClinicalTrialTimePointID.clear(); + ClinicalTrialTimePointDescription.clear(); + LongitudinalTemporalOffsetFromEvent.clear(); + LongitudinalTemporalEventType.clear(); + ConsentForClinicalTrialUseSequence.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + SeriesDescriptionCodeSequence.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ReferencedPerformedProcedureStepSequence.clear(); + RequestAttributesSequence.clear(); + PerformedProcedureStepID.clear(); + PerformedProcedureStepStartDate.clear(); + PerformedProcedureStepStartTime.clear(); + PerformedProcedureStepEndDate.clear(); + PerformedProcedureStepEndTime.clear(); + PerformedProcedureStepDescription.clear(); + PerformedProtocolCodeSequence.clear(); + CommentsOnThePerformedProcedureStep.clear(); + ClinicalTrialCoordinatingCenterName.clear(); + ClinicalTrialSeriesID.clear(); + ClinicalTrialSeriesDescription.clear(); + FrameOfReferenceUID.clear(); + PositionReferenceIndicator.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + GantryID.clear(); + UDISequence.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + PixelPaddingValue.clear(); + RTPlanLabel.clear(); + RTPlanName.clear(); + RTPlanDescription.clear(); + InstanceNumber.clear(); + RTPlanDate.clear(); + RTPlanTime.clear(); + TreatmentProtocols.clear(); + PlanIntent.clear(); + TreatmentSites.clear(); + RTPlanGeometry.clear(); + ReferencedStructureSetSequence.clear(); + ReferencedDoseSequence.clear(); + ReferencedRTPlanSequence.clear(); + FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix.clear(); + PrescriptionDescription.clear(); + DoseReferenceSequence.clear(); + ToleranceTableSequence.clear(); + PatientSetupSequence.clear(); + FractionGroupSequence.clear(); + BeamSequence.clear(); + BrachyTreatmentTechnique.clear(); + BrachyTreatmentType.clear(); + TreatmentMachineSequence.clear(); + SourceSequence.clear(); + ApplicationSetupSequence.clear(); + ApprovalStatus.clear(); + ReviewDate.clear(); + ReviewTime.clear(); + ReviewerName.clear(); + ReferencedImageSequence.clear(); + ReferencedInstanceSequence.clear(); + DerivationDescription.clear(); + DerivationCodeSequence.clear(); + SourceImageSequence.clear(); + SourceInstanceSequence.clear(); + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCoercionDateTime.clear(); + InstanceCreatorUID.clear(); + RelatedGeneralSOPClassUID.clear(); + OriginalSpecializedSOPClassUID.clear(); + CodingSchemeIdentificationSequence.clear(); + ContextGroupIdentificationSequence.clear(); + MappingResourceIdentificationSequence.clear(); + TimezoneOffsetFromUTC.clear(); + ContributingEquipmentSequence.clear(); + SOPInstanceStatus.clear(); + SOPAuthorizationDateTime.clear(); + SOPAuthorizationComment.clear(); + AuthorizationEquipmentCertificationNumber.clear(); + MACParametersSequence.clear(); + DigitalSignaturesSequence.clear(); + EncryptedAttributesSequence.clear(); + OriginalAttributesSequence.clear(); + HL7StructuredDocumentReferenceSequence.clear(); + LongitudinalTemporalInformationModified.clear(); + QueryRetrieveView.clear(); + ConversionSourceAttributesSequence.clear(); + ContentQualification.clear(); + PrivateDataElementCharacteristicsSequence.clear(); + ReferencedSeriesSequence.clear(); + StudiesContainingOtherReferencedInstancesSequence.clear(); +} + + +OFBool DRTPlanIOD::isValid() +{ + /* tbd: check whether object is valid */ + return OFTrue; +} + + +OFCondition DRTPlanIOD::checkDatasetForReading(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* check SOP class UID */ + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + OFString tmpString; + getStringValueFromElement(sopClassUID, tmpString); + if (tmpString != UID_RTPlanStorage) + { + DCMRT_ERROR("Invalid value for attribute SOPClassUID (0008,0016)"); + result = RT_EC_InvalidValue; + } + } + return result; +} + + +void DRTPlanIOD::updateAttributes() +{ + SOPClassUID.putString(UID_RTPlanStorage); +} + + +OFCondition DRTPlanIOD::read(DcmItem &dataset) +{ + /* re-initialize object */ + clear(); + /* check SOP class UID first */ + OFCondition result = checkDatasetForReading(dataset); + /* read data from PatientIE, StudyIE, SeriesIE */ + if (result.good()) + result = readSeriesData(dataset); + if (result.good()) + { + // --- FrameOfReferenceModule (U) --- + if (dataset.tagExists(DCM_FrameOfReferenceUID) || + dataset.tagExists(DCM_PositionReferenceIndicator)) + { + getAndCheckElementFromDataset(dataset, FrameOfReferenceUID, "1", "1", "FrameOfReferenceModule"); + getAndCheckElementFromDataset(dataset, PositionReferenceIndicator, "1", "2", "FrameOfReferenceModule"); + } + + // --- GeneralEquipmentModule (M) --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionAddress, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, StationName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionalDepartmentName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, GantryID, "1", "3", "GeneralEquipmentModule"); + UDISequence.read(dataset, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SpatialResolution, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DateOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, TimeOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingValue, "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralPlanModule (M) --- + getAndCheckElementFromDataset(dataset, RTPlanLabel, "1", "1", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanName, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanDescription, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanDate, "1", "2", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanTime, "1", "2", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, TreatmentProtocols, "1-n", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, PlanIntent, "1", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, TreatmentSites, "1-n", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, RTPlanGeometry, "1", "1", "RTGeneralPlanModule"); + ReferencedStructureSetSequence.read(dataset, "1-n", "1C", "RTGeneralPlanModule"); + ReferencedDoseSequence.read(dataset, "1-n", "3", "RTGeneralPlanModule"); + ReferencedRTPlanSequence.read(dataset, "1-n", "3", "RTGeneralPlanModule"); + getAndCheckElementFromDataset(dataset, FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix, "16", "3", "RTGeneralPlanModule"); + + // --- RTPrescriptionModule (U) --- + getAndCheckElementFromDataset(dataset, PrescriptionDescription, "1", "3", "RTPrescriptionModule"); + DoseReferenceSequence.read(dataset, "1-n", "3", "RTPrescriptionModule"); + + // --- RTToleranceTablesModule (U) --- + ToleranceTableSequence.read(dataset, "1-n", "3", "RTToleranceTablesModule"); + + // --- RTPatientSetupModule (U) --- + if (dataset.tagExists(DCM_PatientSetupSequence)) + { + PatientSetupSequence.read(dataset, "1-n", "1", "RTPatientSetupModule"); + } + + // --- RTFractionSchemeModule (U) --- + if (dataset.tagExists(DCM_FractionGroupSequence)) + { + FractionGroupSequence.read(dataset, "1-n", "1", "RTFractionSchemeModule"); + } + + // --- RTBeamsModule (C) --- + if (dataset.tagExists(DCM_BeamSequence)) + { + BeamSequence.read(dataset, "1-n", "1", "RTBeamsModule"); + } + + // --- RTBrachyApplicationSetupsModule (C) --- + if (dataset.tagExists(DCM_BrachyTreatmentTechnique) || + dataset.tagExists(DCM_BrachyTreatmentType) || + dataset.tagExists(DCM_TreatmentMachineSequence) || + dataset.tagExists(DCM_SourceSequence) || + dataset.tagExists(DCM_ApplicationSetupSequence)) + { + getAndCheckElementFromDataset(dataset, BrachyTreatmentTechnique, "1", "1", "RTBrachyApplicationSetupsModule"); + getAndCheckElementFromDataset(dataset, BrachyTreatmentType, "1", "1", "RTBrachyApplicationSetupsModule"); + TreatmentMachineSequence.read(dataset, "1-n", "1", "RTBrachyApplicationSetupsModule"); + SourceSequence.read(dataset, "1-n", "1", "RTBrachyApplicationSetupsModule"); + ApplicationSetupSequence.read(dataset, "1-n", "1", "RTBrachyApplicationSetupsModule"); + } + + // --- ApprovalModule (U) --- + if (dataset.tagExists(DCM_ApprovalStatus)) + { + getAndCheckElementFromDataset(dataset, ApprovalStatus, "1", "1", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewDate, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewTime, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewerName, "1", "2C", "ApprovalModule"); + } + + // --- GeneralReferenceModule (U) --- + ReferencedImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + ReferencedInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + getAndCheckElementFromDataset(dataset, DerivationDescription, "1", "3", "GeneralReferenceModule"); + DerivationCodeSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + + // --- SOPCommonModule (M) --- + getAndCheckElementFromDataset(dataset, SOPClassUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCoercionDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, RelatedGeneralSOPClassUID, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, OriginalSpecializedSOPClassUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + ContextGroupIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + MappingResourceIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + ContributingEquipmentSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceStatus, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationComment, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, AuthorizationEquipmentCertificationNumber, "1", "3", "SOPCommonModule"); + MACParametersSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + DigitalSignaturesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + EncryptedAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + OriginalAttributesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + HL7StructuredDocumentReferenceSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalInformationModified, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, QueryRetrieveView, "1", "1C", "SOPCommonModule"); + ConversionSourceAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, ContentQualification, "1", "3", "SOPCommonModule"); + PrivateDataElementCharacteristicsSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + ReferencedSeriesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + StudiesContainingOtherReferencedInstancesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + } + return result; +} + + +OFCondition DRTPlanIOD::readPatientData(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + + // --- PatientModule (M) --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + IssuerOfPatientIDQualifiersSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientDeathDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientAlternativeCalendar, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + ReferencedPatientPhotoSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, QualityControlSubject, "1", "3", "PatientModule"); + ReferencedPatientSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthTime, "1", "3", "PatientModule"); + OtherPatientIDsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, OtherPatientNames, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, EthnicGroup, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientComments, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSpeciesDescription, "1", "1C", "PatientModule"); + PatientSpeciesCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBreedDescription, "1", "2C", "PatientModule"); + PatientBreedCodeSequence.read(dataset, "1-n", "2C", "PatientModule"); + BreedRegistrationSequence.read(dataset, "1-n", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainDescription, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainNomenclature, "1", "3", "PatientModule"); + StrainCodeSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainAdditionalInformation, "1", "3", "PatientModule"); + StrainStockSequence.read(dataset, "1-n", "3", "PatientModule"); + GeneticModificationsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePerson, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePersonRole, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsibleOrganization, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientIdentityRemoved, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, DeidentificationMethod, "1-n", "1C", "PatientModule"); + DeidentificationMethodCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + SourcePatientGroupIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + GroupOfPatientsIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialSponsorName) || + dataset.tagExists(DCM_ClinicalTrialProtocolID) || + dataset.tagExists(DCM_ClinicalTrialProtocolName) || + dataset.tagExists(DCM_ClinicalTrialSiteID) || + dataset.tagExists(DCM_ClinicalTrialSiteName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialSponsorName, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolID, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteID, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectReadingID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeName, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeApprovalNumber, "1", "3", "ClinicalTrialSubjectModule"); + } + return result; +} + + +OFCondition DRTPlanIOD::readStudyData(DcmItem &dataset) +{ + /* read data from PatientIE */ + OFCondition result = readPatientData(dataset); + if (result.good()) + { + // --- GeneralStudyModule (M) --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + ReferringPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ConsultingPhysicianName, "1-n", "3", "GeneralStudyModule"); + ConsultingPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + IssuerOfAccessionNumberSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, PhysiciansOfRecord, "1-n", "3", "GeneralStudyModule"); + PhysiciansOfRecordIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, NameOfPhysiciansReadingStudy, "1-n", "3", "GeneralStudyModule"); + PhysiciansReadingStudyIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + RequestingServiceCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReferencedStudySequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReasonForPerformedProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + getAndCheckElementFromDataset(dataset, AdmittingDiagnosesDescription, "1-n", "3", "PatientStudyModule"); + AdmittingDiagnosesCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientAge, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSize, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientWeight, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientBodyMassIndex, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredAPDimension, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredLateralDimension, "1", "3", "PatientStudyModule"); + PatientSizeCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MedicalAlerts, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Allergies, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, SmokingStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PregnancyStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, LastMenstrualDate, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientState, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Occupation, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdditionalPatientHistory, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdmissionID, "1", "3", "PatientStudyModule"); + IssuerOfAdmissionIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeID, "1", "3", "PatientStudyModule"); + IssuerOfServiceEpisodeIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeDescription, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSexNeutered, "1", "2C", "PatientStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialTimePointID)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointID, "1", "2", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointDescription, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalOffsetFromEvent, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalEventType, "1", "1C", "ClinicalTrialStudyModule"); + ConsentForClinicalTrialUseSequence.read(dataset, "1-n", "3", "ClinicalTrialStudyModule"); + } + } + return result; +} + + +OFCondition DRTPlanIOD::readSeriesData(DcmItem &dataset) +{ + /* read data from PatientIE, StudyIE */ + OFCondition result = readStudyData(dataset); + if (result.good()) + { + // --- RTSeriesModule (M) --- + getAndCheckElementFromDataset(dataset, Modality, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "2", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "RTSeriesModule"); + SeriesDescriptionCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, OperatorsName, "1-n", "2", "RTSeriesModule"); + OperatorIdentificationSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + ReferencedPerformedProcedureStepSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + RequestAttributesSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepID, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepDescription, "1", "3", "RTSeriesModule"); + PerformedProtocolCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, CommentsOnThePerformedProcedureStep, "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialCoordinatingCenterName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialCoordinatingCenterName, "1", "2", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesID, "1", "3", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesDescription, "1", "3", "ClinicalTrialSeriesModule"); + } + } + return result; +} + + +OFCondition DRTPlanIOD::write(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* only write valid objects */ + if (isValid()) + { + /* update various DICOM attributes */ + updateAttributes(); + + // --- PatientModule (M) --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBirthDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientDeathDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientAlternativeCalendar), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + if (result.good()) result = ReferencedPatientPhotoSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlSubject), "1", "3", "PatientModule"); + if (result.good()) result = ReferencedPatientSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmTime(PatientBirthTime), "1", "3", "PatientModule"); + if (result.good()) result = OtherPatientIDsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(OtherPatientNames), "1-n", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmShortString(EthnicGroup), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongText(PatientComments), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientSpeciesDescription), "1", "1C", "PatientModule"); + if (result.good()) result = PatientSpeciesCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBreedDescription), "1", "2C", "PatientModule"); + if (result.good()) result = PatientBreedCodeSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + if (result.good()) result = BreedRegistrationSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedCharacters(StrainDescription), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(StrainNomenclature), "1", "3", "PatientModule"); + if (result.good()) result = StrainCodeSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedText(StrainAdditionalInformation), "1", "3", "PatientModule"); + if (result.good()) result = StrainStockSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GeneticModificationsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(ResponsiblePerson), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(ResponsiblePersonRole), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(ResponsibleOrganization), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientIdentityRemoved), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(DeidentificationMethod), "1-n", "1C", "PatientModule"); + if (result.good()) result = DeidentificationMethodCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + if (result.good()) result = SourcePatientGroupIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GroupOfPatientsIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (isClinicalTrialSubjectModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSponsorName), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolID), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteID), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectReadingID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeName), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeApprovalNumber), "1", "3", "ClinicalTrialSubjectModule"); + } + + // --- GeneralStudyModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + if (result.good()) result = ReferringPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ConsultingPhysicianName), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = ConsultingPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(PhysiciansOfRecord), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansOfRecordIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(NameOfPhysiciansReadingStudy), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansReadingStudyIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = RequestingServiceCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReferencedStudySequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReasonForPerformedProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + if (isPatientStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(AdmittingDiagnosesDescription), "1-n", "3", "PatientStudyModule"); + if (result.good()) result = AdmittingDiagnosesCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmAgeString(PatientAge), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSize), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientWeight), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientBodyMassIndex), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredAPDimension), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredLateralDimension), "1", "3", "PatientStudyModule"); + if (result.good()) result = PatientSizeCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(MedicalAlerts), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(Allergies), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(SmokingStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PregnancyStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDate(LastMenstrualDate), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientState), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(Occupation), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongText(AdditionalPatientHistory), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(AdmissionID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfAdmissionIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfServiceEpisodeIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeDescription), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSexNeutered), "1", "2C", "PatientStudyModule"); + } + + // --- ClinicalTrialStudyModule (U) --- + if (isClinicalTrialStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialTimePointID), "1", "2", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmShortText(ClinicalTrialTimePointDescription), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(LongitudinalTemporalOffsetFromEvent), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalEventType), "1", "1C", "ClinicalTrialStudyModule"); + if (result.good()) result = ConsentForClinicalTrialUseSequence.write(dataset, "1-n" ,"3", "ClinicalTrialStudyModule"); + } + + // --- RTSeriesModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "2", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = SeriesDescriptionCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmPersonName(OperatorsName), "1-n", "2", "RTSeriesModule"); + if (result.good()) result = OperatorIdentificationSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = ReferencedPerformedProcedureStepSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = RequestAttributesSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortString(PerformedProcedureStepID), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepStartDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepStartTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepEndDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepEndTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(PerformedProcedureStepDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = PerformedProtocolCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortText(CommentsOnThePerformedProcedureStep), "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (isClinicalTrialSeriesModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialCoordinatingCenterName), "1", "2", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesID), "1", "3", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesDescription), "1", "3", "ClinicalTrialSeriesModule"); + } + + // --- FrameOfReferenceModule (U) --- + if (isFrameOfReferenceModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmUniqueIdentifier(FrameOfReferenceUID), "1", "1", "FrameOfReferenceModule"); + addElementToDataset(result, dataset, new DcmLongString(PositionReferenceIndicator), "1", "2", "FrameOfReferenceModule"); + } + + // --- GeneralEquipmentModule (M) --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortText(InstitutionAddress), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortString(StationName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionalDepartmentName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(GantryID), "1", "3", "GeneralEquipmentModule"); + if (result.good()) result = UDISequence.write(dataset, "1-n" ,"3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SpatialResolution), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDate(DateOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmTime(TimeOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingValue), "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralPlanModule (M) --- + addElementToDataset(result, dataset, new DcmShortString(RTPlanLabel), "1", "1", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmLongString(RTPlanName), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmShortText(RTPlanDescription), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmDate(RTPlanDate), "1", "2", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmTime(RTPlanTime), "1", "2", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmLongString(TreatmentProtocols), "1-n", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmCodeString(PlanIntent), "1", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmLongString(TreatmentSites), "1-n", "3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmCodeString(RTPlanGeometry), "1", "1", "RTGeneralPlanModule"); + if (result.good()) result = ReferencedStructureSetSequence.write(dataset, "1-n" ,"1C", "RTGeneralPlanModule"); + if (result.good()) result = ReferencedDoseSequence.write(dataset, "1-n" ,"3", "RTGeneralPlanModule"); + if (result.good()) result = ReferencedRTPlanSequence.write(dataset, "1-n" ,"3", "RTGeneralPlanModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix), "16", "3", "RTGeneralPlanModule"); + + // --- RTPrescriptionModule (U) --- + if (isRTPrescriptionModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmShortText(PrescriptionDescription), "1", "3", "RTPrescriptionModule"); + if (result.good()) result = DoseReferenceSequence.write(dataset, "1-n" ,"3", "RTPrescriptionModule"); + } + + // --- RTToleranceTablesModule (U) --- + if (isRTToleranceTablesModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ToleranceTableSequence.write(dataset, "1-n" ,"3", "RTToleranceTablesModule"); + } + + // --- RTPatientSetupModule (U) --- + if (isRTPatientSetupModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = PatientSetupSequence.write(dataset, "1-n" ,"1", "RTPatientSetupModule"); + } + + // --- RTFractionSchemeModule (U) --- + if (isRTFractionSchemeModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = FractionGroupSequence.write(dataset, "1-n" ,"1", "RTFractionSchemeModule"); + } + + // --- RTBeamsModule (C) --- + if (isRTBeamsModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = BeamSequence.write(dataset, "1-n" ,"1", "RTBeamsModule"); + } + + // --- RTBrachyApplicationSetupsModule (C) --- + if (isRTBrachyApplicationSetupsModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmCodeString(BrachyTreatmentTechnique), "1", "1", "RTBrachyApplicationSetupsModule"); + addElementToDataset(result, dataset, new DcmCodeString(BrachyTreatmentType), "1", "1", "RTBrachyApplicationSetupsModule"); + if (result.good()) result = TreatmentMachineSequence.write(dataset, "1-n" ,"1", "RTBrachyApplicationSetupsModule"); + if (result.good()) result = SourceSequence.write(dataset, "1-n" ,"1", "RTBrachyApplicationSetupsModule"); + if (result.good()) result = ApplicationSetupSequence.write(dataset, "1-n" ,"1", "RTBrachyApplicationSetupsModule"); + } + + // --- ApprovalModule (U) --- + if (isApprovalModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmCodeString(ApprovalStatus), "1", "1", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmDate(ReviewDate), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmTime(ReviewTime), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReviewerName), "1", "2C", "ApprovalModule"); + } + + // --- GeneralReferenceModule (U) --- + if (isGeneralReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = ReferencedInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + addElementToDataset(result, dataset, new DcmShortText(DerivationDescription), "1", "3", "GeneralReferenceModule"); + if (result.good()) result = DerivationCodeSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + } + + // --- SOPCommonModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(InstanceCoercionDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(RelatedGeneralSOPClassUID), "1-n", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(OriginalSpecializedSOPClassUID), "1", "3", "SOPCommonModule"); + if (result.good()) result = CodingSchemeIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = ContextGroupIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = MappingResourceIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + if (result.good()) result = ContributingEquipmentSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SOPInstanceStatus), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(SOPAuthorizationDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongText(SOPAuthorizationComment), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongString(AuthorizationEquipmentCertificationNumber), "1", "3", "SOPCommonModule"); + if (result.good()) result = MACParametersSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = DigitalSignaturesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = EncryptedAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + if (result.good()) result = OriginalAttributesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = HL7StructuredDocumentReferenceSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalInformationModified), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(QueryRetrieveView), "1", "1C", "SOPCommonModule"); + if (result.good()) result = ConversionSourceAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContentQualification), "1", "3", "SOPCommonModule"); + if (result.good()) result = PrivateDataElementCharacteristicsSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + if (isCommonInstanceReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedSeriesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + if (result.good()) result = StudiesContainingOtherReferencedInstancesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + } + } else + result = RT_EC_InvalidObject; + return result; +} + + +OFBool DRTPlanIOD::isClinicalTrialSubjectModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ClinicalTrialSponsorName.isEmpty() && + !ClinicalTrialProtocolID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ClinicalTrialSponsorName.isEmpty() || + !ClinicalTrialProtocolID.isEmpty() || + !ClinicalTrialProtocolName.isEmpty() || + !ClinicalTrialSiteID.isEmpty() || + !ClinicalTrialSiteName.isEmpty() || + !ClinicalTrialSubjectID.isEmpty() || + !ClinicalTrialSubjectReadingID.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeName.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeApprovalNumber.isEmpty(); + } +} + + +OFBool DRTPlanIOD::isPatientStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !AdmittingDiagnosesDescription.isEmpty() || + !AdmittingDiagnosesCodeSequence.isEmpty() || + !PatientAge.isEmpty() || + !PatientSize.isEmpty() || + !PatientWeight.isEmpty() || + !PatientBodyMassIndex.isEmpty() || + !MeasuredAPDimension.isEmpty() || + !MeasuredLateralDimension.isEmpty() || + !PatientSizeCodeSequence.isEmpty() || + !MedicalAlerts.isEmpty() || + !Allergies.isEmpty() || + !SmokingStatus.isEmpty() || + !PregnancyStatus.isEmpty() || + !LastMenstrualDate.isEmpty() || + !PatientState.isEmpty() || + !Occupation.isEmpty() || + !AdditionalPatientHistory.isEmpty() || + !AdmissionID.isEmpty() || + !IssuerOfAdmissionIDSequence.isEmpty() || + !ServiceEpisodeID.isEmpty() || + !IssuerOfServiceEpisodeIDSequence.isEmpty() || + !ServiceEpisodeDescription.isEmpty() || + !PatientSexNeutered.isEmpty(); +} + + +OFBool DRTPlanIOD::isClinicalTrialStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialTimePointID.isEmpty() || + !ClinicalTrialTimePointDescription.isEmpty() || + !LongitudinalTemporalOffsetFromEvent.isEmpty() || + !LongitudinalTemporalEventType.isEmpty() || + !ConsentForClinicalTrialUseSequence.isEmpty(); +} + + +OFBool DRTPlanIOD::isClinicalTrialSeriesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialCoordinatingCenterName.isEmpty() || + !ClinicalTrialSeriesID.isEmpty() || + !ClinicalTrialSeriesDescription.isEmpty(); +} + + +OFBool DRTPlanIOD::isFrameOfReferenceModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !FrameOfReferenceUID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !FrameOfReferenceUID.isEmpty() || + !PositionReferenceIndicator.isEmpty(); + } +} + + +OFBool DRTPlanIOD::isRTPrescriptionModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !PrescriptionDescription.isEmpty() || + !DoseReferenceSequence.isEmpty(); +} + + +OFBool DRTPlanIOD::isRTToleranceTablesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ToleranceTableSequence.isEmpty(); +} + + +OFBool DRTPlanIOD::isRTPatientSetupModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !PatientSetupSequence.isEmpty(); +} + + +OFBool DRTPlanIOD::isRTFractionSchemeModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !FractionGroupSequence.isEmpty(); +} + + +OFBool DRTPlanIOD::isRTBeamsModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !BeamSequence.isEmpty(); +} + + +OFBool DRTPlanIOD::isRTBrachyApplicationSetupsModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !BrachyTreatmentTechnique.isEmpty() && + !BrachyTreatmentType.isEmpty() && + !TreatmentMachineSequence.isEmpty() && + !SourceSequence.isEmpty() && + !ApplicationSetupSequence.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !BrachyTreatmentTechnique.isEmpty() || + !BrachyTreatmentType.isEmpty() || + !TreatmentMachineSequence.isEmpty() || + !SourceSequence.isEmpty() || + !ApplicationSetupSequence.isEmpty(); + } +} + + +OFBool DRTPlanIOD::isApprovalModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ApprovalStatus.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ApprovalStatus.isEmpty() || + !ReviewDate.isEmpty() || + !ReviewTime.isEmpty() || + !ReviewerName.isEmpty(); + } +} + + +OFBool DRTPlanIOD::isGeneralReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedImageSequence.isEmpty() || + !ReferencedInstanceSequence.isEmpty() || + !DerivationDescription.isEmpty() || + !DerivationCodeSequence.isEmpty() || + !SourceImageSequence.isEmpty() || + !SourceInstanceSequence.isEmpty(); +} + + +OFBool DRTPlanIOD::isCommonInstanceReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedSeriesSequence.isEmpty() || + !StudiesContainingOtherReferencedInstancesSequence.isEmpty(); +} + + +OFCondition DRTPlanIOD::getAccessionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTPlanIOD::getAdditionalPatientHistory(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdditionalPatientHistory, value, pos); +} + + +OFCondition DRTPlanIOD::getAdmissionID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmissionID, value, pos); +} + + +OFCondition DRTPlanIOD::getAdmittingDiagnosesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmittingDiagnosesDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getAllergies(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Allergies, value, pos); +} + + +OFCondition DRTPlanIOD::getApprovalStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ApprovalStatus, value, pos); +} + + +OFCondition DRTPlanIOD::getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AuthorizationEquipmentCertificationNumber, value, pos); +} + + +OFCondition DRTPlanIOD::getBrachyTreatmentTechnique(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(BrachyTreatmentTechnique, value, pos); +} + + +OFCondition DRTPlanIOD::getBrachyTreatmentType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(BrachyTreatmentType, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialCoordinatingCenterName, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeApprovalNumber, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeName, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialProtocolName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolName, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialSeriesID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesID, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialSiteID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteID, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialSiteName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteName, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialSponsorName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSponsorName, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialSubjectID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectID, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialSubjectReadingID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectReadingID, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialTimePointDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getClinicalTrialTimePointID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointID, value, pos); +} + + +OFCondition DRTPlanIOD::getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CommentsOnThePerformedProcedureStep, value, pos); +} + + +OFCondition DRTPlanIOD::getConsultingPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConsultingPhysicianName, value, pos); +} + + +OFCondition DRTPlanIOD::getContentQualification(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentQualification, value, pos); +} + + +OFCondition DRTPlanIOD::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTPlanIOD::getDeidentificationMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeidentificationMethod, value, pos); +} + + +OFCondition DRTPlanIOD::getDerivationDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DerivationDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTPlanIOD::getEthnicGroup(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EthnicGroup, value, pos); +} + + +OFCondition DRTPlanIOD::getFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getFrameOfReferenceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameOfReferenceUID, value, pos); +} + + +OFCondition DRTPlanIOD::getGantryID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryID, value, pos); +} + + +OFCondition DRTPlanIOD::getInstanceCoercionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCoercionDateTime, value, pos); +} + + +OFCondition DRTPlanIOD::getInstanceCreationDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DRTPlanIOD::getInstanceCreationTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DRTPlanIOD::getInstanceCreatorUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DRTPlanIOD::getInstanceNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DRTPlanIOD::getInstanceNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, InstanceNumber).getSint32(value, pos); +} + + +OFCondition DRTPlanIOD::getInstitutionAddress(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTPlanIOD::getInstitutionName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTPlanIOD::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTPlanIOD::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTPlanIOD::getLastMenstrualDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LastMenstrualDate, value, pos); +} + + +OFCondition DRTPlanIOD::getLongitudinalTemporalEventType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalEventType, value, pos); +} + + +OFCondition DRTPlanIOD::getLongitudinalTemporalInformationModified(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalInformationModified, value, pos); +} + + +OFCondition DRTPlanIOD::getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, LongitudinalTemporalOffsetFromEvent).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getManufacturer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTPlanIOD::getManufacturerModelName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTPlanIOD::getMeasuredAPDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredAPDimension, value, pos); +} + + +OFCondition DRTPlanIOD::getMeasuredAPDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredAPDimension).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getMeasuredLateralDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredLateralDimension, value, pos); +} + + +OFCondition DRTPlanIOD::getMeasuredLateralDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredLateralDimension).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getMedicalAlerts(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MedicalAlerts, value, pos); +} + + +OFCondition DRTPlanIOD::getModality(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DRTPlanIOD::getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NameOfPhysiciansReadingStudy, value, pos); +} + + +OFCondition DRTPlanIOD::getOccupation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Occupation, value, pos); +} + + +OFCondition DRTPlanIOD::getOperatorsName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTPlanIOD::getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OriginalSpecializedSOPClassUID, value, pos); +} + + +OFCondition DRTPlanIOD::getOtherPatientNames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OtherPatientNames, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientAge(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAge, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAlternativeCalendar, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientBirthDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientBirthTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthTime, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientBodyMassIndex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBodyMassIndex, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientBodyMassIndex(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientBodyMassIndex).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getPatientBreedDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBreedDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientComments, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientDeathDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientIdentityRemoved(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientIdentityRemoved, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientSex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientSexNeutered(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSexNeutered, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientSize(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSize, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientSize(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSize).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getPatientSpeciesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSpeciesDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientState(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientState, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientWeight, value, pos); +} + + +OFCondition DRTPlanIOD::getPatientWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientWeight).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getPerformedProcedureStepDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getPerformedProcedureStepEndDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndDate, value, pos); +} + + +OFCondition DRTPlanIOD::getPerformedProcedureStepEndTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndTime, value, pos); +} + + +OFCondition DRTPlanIOD::getPerformedProcedureStepID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepID, value, pos); +} + + +OFCondition DRTPlanIOD::getPerformedProcedureStepStartDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartDate, value, pos); +} + + +OFCondition DRTPlanIOD::getPerformedProcedureStepStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartTime, value, pos); +} + + +OFCondition DRTPlanIOD::getPhysiciansOfRecord(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhysiciansOfRecord, value, pos); +} + + +OFCondition DRTPlanIOD::getPixelPaddingValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingValue).getUint16(value, pos); +} + + +OFCondition DRTPlanIOD::getPlanIntent(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PlanIntent, value, pos); +} + + +OFCondition DRTPlanIOD::getPositionReferenceIndicator(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PositionReferenceIndicator, value, pos); +} + + +OFCondition DRTPlanIOD::getPregnancyStatus(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PregnancyStatus).getUint16(value, pos); +} + + +OFCondition DRTPlanIOD::getPrescriptionDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PrescriptionDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getQualityControlSubject(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlSubject, value, pos); +} + + +OFCondition DRTPlanIOD::getQueryRetrieveView(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QueryRetrieveView, value, pos); +} + + +OFCondition DRTPlanIOD::getRTPlanDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanDate, value, pos); +} + + +OFCondition DRTPlanIOD::getRTPlanDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getRTPlanGeometry(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanGeometry, value, pos); +} + + +OFCondition DRTPlanIOD::getRTPlanLabel(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanLabel, value, pos); +} + + +OFCondition DRTPlanIOD::getRTPlanName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanName, value, pos); +} + + +OFCondition DRTPlanIOD::getRTPlanTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RTPlanTime, value, pos); +} + + +OFCondition DRTPlanIOD::getReferringPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DRTPlanIOD::getRelatedGeneralSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RelatedGeneralSOPClassUID, value, pos); +} + + +OFCondition DRTPlanIOD::getResponsibleOrganization(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsibleOrganization, value, pos); +} + + +OFCondition DRTPlanIOD::getResponsiblePerson(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePerson, value, pos); +} + + +OFCondition DRTPlanIOD::getResponsiblePersonRole(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePersonRole, value, pos); +} + + +OFCondition DRTPlanIOD::getReviewDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewDate, value, pos); +} + + +OFCondition DRTPlanIOD::getReviewTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewTime, value, pos); +} + + +OFCondition DRTPlanIOD::getReviewerName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewerName, value, pos); +} + + +OFCondition DRTPlanIOD::getSOPAuthorizationComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationComment, value, pos); +} + + +OFCondition DRTPlanIOD::getSOPAuthorizationDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationDateTime, value, pos); +} + + +OFCondition DRTPlanIOD::getSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DRTPlanIOD::getSOPInstanceStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceStatus, value, pos); +} + + +OFCondition DRTPlanIOD::getSOPInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DRTPlanIOD::getSeriesDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DRTPlanIOD::getSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTPlanIOD::getSeriesNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DRTPlanIOD::getSeriesNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, SeriesNumber).getSint32(value, pos); +} + + +OFCondition DRTPlanIOD::getSeriesTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DRTPlanIOD::getServiceEpisodeDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getServiceEpisodeID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeID, value, pos); +} + + +OFCondition DRTPlanIOD::getSmokingStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SmokingStatus, value, pos); +} + + +OFCondition DRTPlanIOD::getSoftwareVersions(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTPlanIOD::getSpatialResolution(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTPlanIOD::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::getSpecificCharacterSet(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DRTPlanIOD::getStationName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTPlanIOD::getStrainAdditionalInformation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainAdditionalInformation, value, pos); +} + + +OFCondition DRTPlanIOD::getStrainDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getStrainNomenclature(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainNomenclature, value, pos); +} + + +OFCondition DRTPlanIOD::getStudyDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DRTPlanIOD::getStudyDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DRTPlanIOD::getStudyID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DRTPlanIOD::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTPlanIOD::getStudyTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DRTPlanIOD::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTPlanIOD::getTimezoneOffsetFromUTC(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DRTPlanIOD::getTreatmentProtocols(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentProtocols, value, pos); +} + + +OFCondition DRTPlanIOD::getTreatmentSites(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentSites, value, pos); +} + + +OFCondition DRTPlanIOD::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setAdditionalPatientHistory(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = AdditionalPatientHistory.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setAdmissionID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AdmissionID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setAdmittingDiagnosesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AdmittingDiagnosesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setAllergies(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = Allergies.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setApprovalStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApprovalStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AuthorizationEquipmentCertificationNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setBrachyTreatmentTechnique(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyTreatmentTechnique.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setBrachyTreatmentType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyTreatmentType.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialCoordinatingCenterName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeApprovalNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialProtocolName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialSeriesID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialSiteID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialSiteName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialSponsorName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSponsorName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialSubjectID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectReadingID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialTimePointDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setClinicalTrialTimePointID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CommentsOnThePerformedProcedureStep.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setConsultingPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ConsultingPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setContentQualification(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentQualification.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setDeidentificationMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DeidentificationMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setDerivationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = DerivationDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setEthnicGroup(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EthnicGroup.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setFrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix(const Float64 value, const unsigned long pos) +{ + return FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix.putFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::setFrameOfReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameOfReferenceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setGantryID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstanceCoercionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCoercionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstanceCreationDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstanceCreationTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstanceCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreatorUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstanceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setLastMenstrualDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LastMenstrualDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setLongitudinalTemporalEventType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalEventType.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalInformationModified.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos) +{ + return LongitudinalTemporalOffsetFromEvent.putFloat64(value, pos); +} + + +OFCondition DRTPlanIOD::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setMeasuredAPDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredAPDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setMeasuredLateralDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredLateralDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setMedicalAlerts(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = MedicalAlerts.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setModality(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Modality.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NameOfPhysiciansReadingStudy.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setOccupation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Occupation.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OriginalSpecializedSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setOtherPatientNames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OtherPatientNames.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientAge(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAge.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientBirthDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientBirthTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientBodyMassIndex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBodyMassIndex.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientBreedDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBreedDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PatientComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientDeathDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientIdentityRemoved(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientIdentityRemoved.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientSex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientSexNeutered(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSexNeutered.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientSize(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSize.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientSpeciesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSpeciesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientState(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientState.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPatientWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPerformedProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPerformedProcedureStepEndDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPerformedProcedureStepEndTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPerformedProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPerformedProcedureStepStartDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPerformedProcedureStepStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPhysiciansOfRecord(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PhysiciansOfRecord.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPixelPaddingValue(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingValue.putUint16(value, pos); +} + + +OFCondition DRTPlanIOD::setPlanIntent(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PlanIntent.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPositionReferenceIndicator(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PositionReferenceIndicator.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setPregnancyStatus(const Uint16 value, const unsigned long pos) +{ + return PregnancyStatus.putUint16(value, pos); +} + + +OFCondition DRTPlanIOD::setPrescriptionDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PrescriptionDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setQualityControlSubject(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlSubject.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setQueryRetrieveView(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QueryRetrieveView.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setRTPlanDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setRTPlanDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RTPlanDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setRTPlanGeometry(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanGeometry.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setRTPlanLabel(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanLabel.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setRTPlanName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setRTPlanTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setReferringPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RelatedGeneralSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsibleOrganization.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setResponsiblePerson(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePerson.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setResponsiblePersonRole(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePersonRole.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setReviewDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setReviewTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setReviewerName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewerName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSOPAuthorizationComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SOPAuthorizationComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSOPAuthorizationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPAuthorizationDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSOPInstanceStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSeriesDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSeriesNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSeriesTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setServiceEpisodeDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setServiceEpisodeID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSmokingStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SmokingStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setSpecificCharacterSet(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SpecificCharacterSet.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStrainAdditionalInformation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StrainAdditionalInformation.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStrainDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStrainNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainNomenclature.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStudyDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStudyDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStudyID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setStudyTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setTimezoneOffsetFromUTC(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setTreatmentProtocols(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TreatmentProtocols.putOFStringArray(value); + return result; +} + + +OFCondition DRTPlanIOD::setTreatmentSites(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TreatmentSites.putOFStringArray(value); + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtporcs.cc b/dcmrt/libsrc/drtporcs.cc new file mode 100644 index 00000000..0e8ae045 --- /dev/null +++ b/dcmrt/libsrc/drtporcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPurposeOfReferenceCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtporcs.h" + + +// --- item class --- + +DRTPurposeOfReferenceCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTPurposeOfReferenceCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTPurposeOfReferenceCodeSequence::Item::~Item() +{ +} + + +DRTPurposeOfReferenceCodeSequence::Item &DRTPurposeOfReferenceCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTPurposeOfReferenceCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTPurposeOfReferenceCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTPurposeOfReferenceCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "PurposeOfReferenceCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "PurposeOfReferenceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "PurposeOfReferenceCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "PurposeOfReferenceCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "PurposeOfReferenceCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "PurposeOfReferenceCodeSequence"); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPurposeOfReferenceCodeSequence::DRTPurposeOfReferenceCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPurposeOfReferenceCodeSequence::DRTPurposeOfReferenceCodeSequence(const DRTPurposeOfReferenceCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPurposeOfReferenceCodeSequence &DRTPurposeOfReferenceCodeSequence::operator=(const DRTPurposeOfReferenceCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPurposeOfReferenceCodeSequence::~DRTPurposeOfReferenceCodeSequence() +{ + clear(); +} + + +void DRTPurposeOfReferenceCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPurposeOfReferenceCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPurposeOfReferenceCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPurposeOfReferenceCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPurposeOfReferenceCodeSequence::Item &DRTPurposeOfReferenceCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPurposeOfReferenceCodeSequence::Item &DRTPurposeOfReferenceCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPurposeOfReferenceCodeSequence::Item &DRTPurposeOfReferenceCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPurposeOfReferenceCodeSequence::Item &DRTPurposeOfReferenceCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPurposeOfReferenceCodeSequence::Item &DRTPurposeOfReferenceCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPurposeOfReferenceCodeSequence::Item &DRTPurposeOfReferenceCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PurposeOfReferenceCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PurposeOfReferenceCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPurposeOfReferenceCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PurposeOfReferenceCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtporis.cc b/dcmrt/libsrc/drtporis.cc new file mode 100644 index 00000000..55294207 --- /dev/null +++ b/dcmrt/libsrc/drtporis.cc @@ -0,0 +1,674 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPhysiciansOfRecordIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtporis.h" + + +// --- item class --- + +DRTPhysiciansOfRecordIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + InstitutionName(DCM_InstitutionName), + PersonAddress(DCM_PersonAddress), + PersonIdentificationCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PersonTelecomInformation(DCM_PersonTelecomInformation), + PersonTelephoneNumbers(DCM_PersonTelephoneNumbers) +{ +} + + +DRTPhysiciansOfRecordIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + InstitutionAddress(copy.InstitutionAddress), + InstitutionCodeSequence(copy.InstitutionCodeSequence), + InstitutionName(copy.InstitutionName), + PersonAddress(copy.PersonAddress), + PersonIdentificationCodeSequence(copy.PersonIdentificationCodeSequence), + PersonTelecomInformation(copy.PersonTelecomInformation), + PersonTelephoneNumbers(copy.PersonTelephoneNumbers) +{ +} + + +DRTPhysiciansOfRecordIdentificationSequence::Item::~Item() +{ +} + + +DRTPhysiciansOfRecordIdentificationSequence::Item &DRTPhysiciansOfRecordIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + InstitutionAddress = copy.InstitutionAddress; + InstitutionCodeSequence = copy.InstitutionCodeSequence; + InstitutionName = copy.InstitutionName; + PersonAddress = copy.PersonAddress; + PersonIdentificationCodeSequence = copy.PersonIdentificationCodeSequence; + PersonTelecomInformation = copy.PersonTelecomInformation; + PersonTelephoneNumbers = copy.PersonTelephoneNumbers; + } + return *this; +} + + +void DRTPhysiciansOfRecordIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PersonIdentificationCodeSequence.clear(); + PersonAddress.clear(); + PersonTelephoneNumbers.clear(); + PersonTelecomInformation.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionCodeSequence.clear(); + } +} + + +OFBool DRTPhysiciansOfRecordIdentificationSequence::Item::isEmpty() +{ + return PersonIdentificationCodeSequence.isEmpty() && + PersonAddress.isEmpty() && + PersonTelephoneNumbers.isEmpty() && + PersonTelecomInformation.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionCodeSequence.isEmpty(); +} + + +OFBool DRTPhysiciansOfRecordIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + PersonIdentificationCodeSequence.read(item, "1-n", "1", "PhysiciansOfRecordIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonAddress, "1", "3", "PhysiciansOfRecordIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelephoneNumbers, "1-n", "3", "PhysiciansOfRecordIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelecomInformation, "1", "3", "PhysiciansOfRecordIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "1C", "PhysiciansOfRecordIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "PhysiciansOfRecordIdentificationSequence"); + InstitutionCodeSequence.read(item, "1-n", "1C", "PhysiciansOfRecordIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + if (result.good()) result = PersonIdentificationCodeSequence.write(item, "1-n", "1", "PhysiciansOfRecordIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(PersonAddress), "1", "3", "PhysiciansOfRecordIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(PersonTelephoneNumbers), "1-n", "3", "PhysiciansOfRecordIdentificationSequence"); + addElementToDataset(result, item, new DcmLongText(PersonTelecomInformation), "1", "3", "PhysiciansOfRecordIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "1C", "PhysiciansOfRecordIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "PhysiciansOfRecordIdentificationSequence"); + if (result.good()) result = InstitutionCodeSequence.write(item, "1-n", "1C", "PhysiciansOfRecordIdentificationSequence"); + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::getPersonAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonAddress, value, pos); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::getPersonTelecomInformation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelecomInformation, value, pos); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::getPersonTelephoneNumbers(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelephoneNumbers, value, pos); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::setPersonAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::setPersonTelecomInformation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonTelecomInformation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::Item::setPersonTelephoneNumbers(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PersonTelephoneNumbers.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPhysiciansOfRecordIdentificationSequence::DRTPhysiciansOfRecordIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPhysiciansOfRecordIdentificationSequence::DRTPhysiciansOfRecordIdentificationSequence(const DRTPhysiciansOfRecordIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPhysiciansOfRecordIdentificationSequence &DRTPhysiciansOfRecordIdentificationSequence::operator=(const DRTPhysiciansOfRecordIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPhysiciansOfRecordIdentificationSequence::~DRTPhysiciansOfRecordIdentificationSequence() +{ + clear(); +} + + +void DRTPhysiciansOfRecordIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPhysiciansOfRecordIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPhysiciansOfRecordIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPhysiciansOfRecordIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPhysiciansOfRecordIdentificationSequence::Item &DRTPhysiciansOfRecordIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPhysiciansOfRecordIdentificationSequence::Item &DRTPhysiciansOfRecordIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPhysiciansOfRecordIdentificationSequence::Item &DRTPhysiciansOfRecordIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPhysiciansOfRecordIdentificationSequence::Item &DRTPhysiciansOfRecordIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPhysiciansOfRecordIdentificationSequence::Item &DRTPhysiciansOfRecordIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPhysiciansOfRecordIdentificationSequence::Item &DRTPhysiciansOfRecordIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PhysiciansOfRecordIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PhysiciansOfRecordIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPhysiciansOfRecordIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PhysiciansOfRecordIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtppcs.cc b/dcmrt/libsrc/drtppcs.cc new file mode 100644 index 00000000..eca35b64 --- /dev/null +++ b/dcmrt/libsrc/drtppcs.cc @@ -0,0 +1,964 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPerformedProtocolCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtppcs.h" + + +// --- item class --- + +DRTPerformedProtocolCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + ProtocolContextSequence(emptyDefaultItem /*emptyDefaultSequence*/), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTPerformedProtocolCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + ProtocolContextSequence(copy.ProtocolContextSequence), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTPerformedProtocolCodeSequence::Item::~Item() +{ +} + + +DRTPerformedProtocolCodeSequence::Item &DRTPerformedProtocolCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + ProtocolContextSequence = copy.ProtocolContextSequence; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTPerformedProtocolCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + ProtocolContextSequence.clear(); + } +} + + +OFBool DRTPerformedProtocolCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty() && + ProtocolContextSequence.isEmpty(); +} + + +OFBool DRTPerformedProtocolCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "PerformedProtocolCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "PerformedProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "PerformedProtocolCodeSequence"); + ProtocolContextSequence.read(item, "1-n", "3", "PerformedProtocolCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "PerformedProtocolCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "PerformedProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "PerformedProtocolCodeSequence"); + if (result.good()) result = ProtocolContextSequence.write(item, "1-n", "3", "PerformedProtocolCodeSequence"); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPerformedProtocolCodeSequence::DRTPerformedProtocolCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPerformedProtocolCodeSequence::DRTPerformedProtocolCodeSequence(const DRTPerformedProtocolCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPerformedProtocolCodeSequence &DRTPerformedProtocolCodeSequence::operator=(const DRTPerformedProtocolCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPerformedProtocolCodeSequence::~DRTPerformedProtocolCodeSequence() +{ + clear(); +} + + +void DRTPerformedProtocolCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPerformedProtocolCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPerformedProtocolCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPerformedProtocolCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPerformedProtocolCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPerformedProtocolCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPerformedProtocolCodeSequence::Item &DRTPerformedProtocolCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPerformedProtocolCodeSequence::Item &DRTPerformedProtocolCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPerformedProtocolCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPerformedProtocolCodeSequence::Item &DRTPerformedProtocolCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPerformedProtocolCodeSequence::Item &DRTPerformedProtocolCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPerformedProtocolCodeSequence::Item &DRTPerformedProtocolCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPerformedProtocolCodeSequence::Item &DRTPerformedProtocolCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPerformedProtocolCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PerformedProtocolCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PerformedProtocolCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPerformedProtocolCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PerformedProtocolCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtprsis.cc b/dcmrt/libsrc/drtprsis.cc new file mode 100644 index 00000000..f6063721 --- /dev/null +++ b/dcmrt/libsrc/drtprsis.cc @@ -0,0 +1,674 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPhysiciansReadingStudyIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtprsis.h" + + +// --- item class --- + +DRTPhysiciansReadingStudyIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + InstitutionName(DCM_InstitutionName), + PersonAddress(DCM_PersonAddress), + PersonIdentificationCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PersonTelecomInformation(DCM_PersonTelecomInformation), + PersonTelephoneNumbers(DCM_PersonTelephoneNumbers) +{ +} + + +DRTPhysiciansReadingStudyIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + InstitutionAddress(copy.InstitutionAddress), + InstitutionCodeSequence(copy.InstitutionCodeSequence), + InstitutionName(copy.InstitutionName), + PersonAddress(copy.PersonAddress), + PersonIdentificationCodeSequence(copy.PersonIdentificationCodeSequence), + PersonTelecomInformation(copy.PersonTelecomInformation), + PersonTelephoneNumbers(copy.PersonTelephoneNumbers) +{ +} + + +DRTPhysiciansReadingStudyIdentificationSequence::Item::~Item() +{ +} + + +DRTPhysiciansReadingStudyIdentificationSequence::Item &DRTPhysiciansReadingStudyIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + InstitutionAddress = copy.InstitutionAddress; + InstitutionCodeSequence = copy.InstitutionCodeSequence; + InstitutionName = copy.InstitutionName; + PersonAddress = copy.PersonAddress; + PersonIdentificationCodeSequence = copy.PersonIdentificationCodeSequence; + PersonTelecomInformation = copy.PersonTelecomInformation; + PersonTelephoneNumbers = copy.PersonTelephoneNumbers; + } + return *this; +} + + +void DRTPhysiciansReadingStudyIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PersonIdentificationCodeSequence.clear(); + PersonAddress.clear(); + PersonTelephoneNumbers.clear(); + PersonTelecomInformation.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionCodeSequence.clear(); + } +} + + +OFBool DRTPhysiciansReadingStudyIdentificationSequence::Item::isEmpty() +{ + return PersonIdentificationCodeSequence.isEmpty() && + PersonAddress.isEmpty() && + PersonTelephoneNumbers.isEmpty() && + PersonTelecomInformation.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionCodeSequence.isEmpty(); +} + + +OFBool DRTPhysiciansReadingStudyIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + PersonIdentificationCodeSequence.read(item, "1-n", "1", "PhysiciansReadingStudyIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonAddress, "1", "3", "PhysiciansReadingStudyIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelephoneNumbers, "1-n", "3", "PhysiciansReadingStudyIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelecomInformation, "1", "3", "PhysiciansReadingStudyIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "1C", "PhysiciansReadingStudyIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "PhysiciansReadingStudyIdentificationSequence"); + InstitutionCodeSequence.read(item, "1-n", "1C", "PhysiciansReadingStudyIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + if (result.good()) result = PersonIdentificationCodeSequence.write(item, "1-n", "1", "PhysiciansReadingStudyIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(PersonAddress), "1", "3", "PhysiciansReadingStudyIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(PersonTelephoneNumbers), "1-n", "3", "PhysiciansReadingStudyIdentificationSequence"); + addElementToDataset(result, item, new DcmLongText(PersonTelecomInformation), "1", "3", "PhysiciansReadingStudyIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "1C", "PhysiciansReadingStudyIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "PhysiciansReadingStudyIdentificationSequence"); + if (result.good()) result = InstitutionCodeSequence.write(item, "1-n", "1C", "PhysiciansReadingStudyIdentificationSequence"); + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::getPersonAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonAddress, value, pos); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::getPersonTelecomInformation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelecomInformation, value, pos); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::getPersonTelephoneNumbers(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelephoneNumbers, value, pos); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::setPersonAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::setPersonTelecomInformation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonTelecomInformation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::Item::setPersonTelephoneNumbers(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PersonTelephoneNumbers.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPhysiciansReadingStudyIdentificationSequence::DRTPhysiciansReadingStudyIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPhysiciansReadingStudyIdentificationSequence::DRTPhysiciansReadingStudyIdentificationSequence(const DRTPhysiciansReadingStudyIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPhysiciansReadingStudyIdentificationSequence &DRTPhysiciansReadingStudyIdentificationSequence::operator=(const DRTPhysiciansReadingStudyIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPhysiciansReadingStudyIdentificationSequence::~DRTPhysiciansReadingStudyIdentificationSequence() +{ + clear(); +} + + +void DRTPhysiciansReadingStudyIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPhysiciansReadingStudyIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPhysiciansReadingStudyIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPhysiciansReadingStudyIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPhysiciansReadingStudyIdentificationSequence::Item &DRTPhysiciansReadingStudyIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPhysiciansReadingStudyIdentificationSequence::Item &DRTPhysiciansReadingStudyIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPhysiciansReadingStudyIdentificationSequence::Item &DRTPhysiciansReadingStudyIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPhysiciansReadingStudyIdentificationSequence::Item &DRTPhysiciansReadingStudyIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPhysiciansReadingStudyIdentificationSequence::Item &DRTPhysiciansReadingStudyIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPhysiciansReadingStudyIdentificationSequence::Item &DRTPhysiciansReadingStudyIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PhysiciansReadingStudyIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PhysiciansReadingStudyIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPhysiciansReadingStudyIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PhysiciansReadingStudyIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpscs.cc b/dcmrt/libsrc/drtpscs.cc new file mode 100644 index 00000000..e0c6e875 --- /dev/null +++ b/dcmrt/libsrc/drtpscs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPatientSpeciesCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpscs.h" + + +// --- item class --- + +DRTPatientSpeciesCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTPatientSpeciesCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTPatientSpeciesCodeSequence::Item::~Item() +{ +} + + +DRTPatientSpeciesCodeSequence::Item &DRTPatientSpeciesCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTPatientSpeciesCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTPatientSpeciesCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTPatientSpeciesCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "PatientSpeciesCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "PatientSpeciesCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "PatientSpeciesCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "PatientSpeciesCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "PatientSpeciesCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "PatientSpeciesCodeSequence"); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPatientSpeciesCodeSequence::DRTPatientSpeciesCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPatientSpeciesCodeSequence::DRTPatientSpeciesCodeSequence(const DRTPatientSpeciesCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPatientSpeciesCodeSequence &DRTPatientSpeciesCodeSequence::operator=(const DRTPatientSpeciesCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPatientSpeciesCodeSequence::~DRTPatientSpeciesCodeSequence() +{ + clear(); +} + + +void DRTPatientSpeciesCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPatientSpeciesCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPatientSpeciesCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPatientSpeciesCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPatientSpeciesCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPatientSpeciesCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPatientSpeciesCodeSequence::Item &DRTPatientSpeciesCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPatientSpeciesCodeSequence::Item &DRTPatientSpeciesCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPatientSpeciesCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPatientSpeciesCodeSequence::Item &DRTPatientSpeciesCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPatientSpeciesCodeSequence::Item &DRTPatientSpeciesCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPatientSpeciesCodeSequence::Item &DRTPatientSpeciesCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPatientSpeciesCodeSequence::Item &DRTPatientSpeciesCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPatientSpeciesCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PatientSpeciesCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PatientSpeciesCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPatientSpeciesCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PatientSpeciesCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpsics.cc b/dcmrt/libsrc/drtpsics.cc new file mode 100644 index 00000000..4632ec95 --- /dev/null +++ b/dcmrt/libsrc/drtpsics.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPatientSizeCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpsics.h" + + +// --- item class --- + +DRTPatientSizeCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTPatientSizeCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTPatientSizeCodeSequence::Item::~Item() +{ +} + + +DRTPatientSizeCodeSequence::Item &DRTPatientSizeCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTPatientSizeCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTPatientSizeCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTPatientSizeCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "PatientSizeCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "PatientSizeCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "PatientSizeCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "PatientSizeCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "PatientSizeCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "PatientSizeCodeSequence"); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPatientSizeCodeSequence::DRTPatientSizeCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPatientSizeCodeSequence::DRTPatientSizeCodeSequence(const DRTPatientSizeCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPatientSizeCodeSequence &DRTPatientSizeCodeSequence::operator=(const DRTPatientSizeCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPatientSizeCodeSequence::~DRTPatientSizeCodeSequence() +{ + clear(); +} + + +void DRTPatientSizeCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPatientSizeCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPatientSizeCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPatientSizeCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPatientSizeCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPatientSizeCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPatientSizeCodeSequence::Item &DRTPatientSizeCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPatientSizeCodeSequence::Item &DRTPatientSizeCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPatientSizeCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPatientSizeCodeSequence::Item &DRTPatientSizeCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPatientSizeCodeSequence::Item &DRTPatientSizeCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPatientSizeCodeSequence::Item &DRTPatientSizeCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPatientSizeCodeSequence::Item &DRTPatientSizeCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPatientSizeCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PatientSizeCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PatientSizeCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPatientSizeCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PatientSizeCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpss.cc b/dcmrt/libsrc/drtpss.cc new file mode 100644 index 00000000..e6ce1bda --- /dev/null +++ b/dcmrt/libsrc/drtpss.cc @@ -0,0 +1,847 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPatientSetupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpss.h" + + +// --- item class --- + +DRTPatientSetupSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + FixationDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + MotionSynchronizationSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PatientAdditionalPosition(DCM_PatientAdditionalPosition), + PatientPosition(DCM_PatientPosition), + PatientSetupLabel(DCM_PatientSetupLabel), + PatientSetupNumber(DCM_PatientSetupNumber), + ReferencedSetupImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SetupDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SetupTechnique(DCM_SetupTechnique), + SetupTechniqueDescription(DCM_SetupTechniqueDescription), + ShieldingDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + TableTopLateralSetupDisplacement(DCM_TableTopLateralSetupDisplacement), + TableTopLongitudinalSetupDisplacement(DCM_TableTopLongitudinalSetupDisplacement), + TableTopVerticalSetupDisplacement(DCM_TableTopVerticalSetupDisplacement) +{ +} + + +DRTPatientSetupSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + FixationDeviceSequence(copy.FixationDeviceSequence), + MotionSynchronizationSequence(copy.MotionSynchronizationSequence), + PatientAdditionalPosition(copy.PatientAdditionalPosition), + PatientPosition(copy.PatientPosition), + PatientSetupLabel(copy.PatientSetupLabel), + PatientSetupNumber(copy.PatientSetupNumber), + ReferencedSetupImageSequence(copy.ReferencedSetupImageSequence), + SetupDeviceSequence(copy.SetupDeviceSequence), + SetupTechnique(copy.SetupTechnique), + SetupTechniqueDescription(copy.SetupTechniqueDescription), + ShieldingDeviceSequence(copy.ShieldingDeviceSequence), + TableTopLateralSetupDisplacement(copy.TableTopLateralSetupDisplacement), + TableTopLongitudinalSetupDisplacement(copy.TableTopLongitudinalSetupDisplacement), + TableTopVerticalSetupDisplacement(copy.TableTopVerticalSetupDisplacement) +{ +} + + +DRTPatientSetupSequence::Item::~Item() +{ +} + + +DRTPatientSetupSequence::Item &DRTPatientSetupSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + FixationDeviceSequence = copy.FixationDeviceSequence; + MotionSynchronizationSequence = copy.MotionSynchronizationSequence; + PatientAdditionalPosition = copy.PatientAdditionalPosition; + PatientPosition = copy.PatientPosition; + PatientSetupLabel = copy.PatientSetupLabel; + PatientSetupNumber = copy.PatientSetupNumber; + ReferencedSetupImageSequence = copy.ReferencedSetupImageSequence; + SetupDeviceSequence = copy.SetupDeviceSequence; + SetupTechnique = copy.SetupTechnique; + SetupTechniqueDescription = copy.SetupTechniqueDescription; + ShieldingDeviceSequence = copy.ShieldingDeviceSequence; + TableTopLateralSetupDisplacement = copy.TableTopLateralSetupDisplacement; + TableTopLongitudinalSetupDisplacement = copy.TableTopLongitudinalSetupDisplacement; + TableTopVerticalSetupDisplacement = copy.TableTopVerticalSetupDisplacement; + } + return *this; +} + + +void DRTPatientSetupSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PatientSetupNumber.clear(); + PatientSetupLabel.clear(); + PatientPosition.clear(); + PatientAdditionalPosition.clear(); + ReferencedSetupImageSequence.clear(); + FixationDeviceSequence.clear(); + ShieldingDeviceSequence.clear(); + SetupTechnique.clear(); + SetupTechniqueDescription.clear(); + SetupDeviceSequence.clear(); + TableTopVerticalSetupDisplacement.clear(); + TableTopLongitudinalSetupDisplacement.clear(); + TableTopLateralSetupDisplacement.clear(); + MotionSynchronizationSequence.clear(); + } +} + + +OFBool DRTPatientSetupSequence::Item::isEmpty() +{ + return PatientSetupNumber.isEmpty() && + PatientSetupLabel.isEmpty() && + PatientPosition.isEmpty() && + PatientAdditionalPosition.isEmpty() && + ReferencedSetupImageSequence.isEmpty() && + FixationDeviceSequence.isEmpty() && + ShieldingDeviceSequence.isEmpty() && + SetupTechnique.isEmpty() && + SetupTechniqueDescription.isEmpty() && + SetupDeviceSequence.isEmpty() && + TableTopVerticalSetupDisplacement.isEmpty() && + TableTopLongitudinalSetupDisplacement.isEmpty() && + TableTopLateralSetupDisplacement.isEmpty() && + MotionSynchronizationSequence.isEmpty(); +} + + +OFBool DRTPatientSetupSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPatientSetupSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, PatientSetupNumber, "1", "1", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, PatientSetupLabel, "1", "3", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, PatientPosition, "1", "1C", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, PatientAdditionalPosition, "1", "1C", "PatientSetupSequence"); + ReferencedSetupImageSequence.read(item, "1-n", "3", "PatientSetupSequence"); + FixationDeviceSequence.read(item, "1-n", "3", "PatientSetupSequence"); + ShieldingDeviceSequence.read(item, "1-n", "3", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, SetupTechnique, "1", "3", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, SetupTechniqueDescription, "1", "3", "PatientSetupSequence"); + SetupDeviceSequence.read(item, "1-n", "3", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, TableTopVerticalSetupDisplacement, "1", "3", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, TableTopLongitudinalSetupDisplacement, "1", "3", "PatientSetupSequence"); + getAndCheckElementFromDataset(item, TableTopLateralSetupDisplacement, "1", "3", "PatientSetupSequence"); + MotionSynchronizationSequence.read(item, "1-n", "3", "PatientSetupSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(PatientSetupNumber), "1", "1", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmLongString(PatientSetupLabel), "1", "3", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmCodeString(PatientPosition), "1", "1C", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmLongString(PatientAdditionalPosition), "1", "1C", "PatientSetupSequence"); + if (result.good()) result = ReferencedSetupImageSequence.write(item, "1-n", "3", "PatientSetupSequence"); + if (result.good()) result = FixationDeviceSequence.write(item, "1-n", "3", "PatientSetupSequence"); + if (result.good()) result = ShieldingDeviceSequence.write(item, "1-n", "3", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmCodeString(SetupTechnique), "1", "3", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmShortText(SetupTechniqueDescription), "1", "3", "PatientSetupSequence"); + if (result.good()) result = SetupDeviceSequence.write(item, "1-n", "3", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopVerticalSetupDisplacement), "1", "3", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLongitudinalSetupDisplacement), "1", "3", "PatientSetupSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLateralSetupDisplacement), "1", "3", "PatientSetupSequence"); + if (result.good()) result = MotionSynchronizationSequence.write(item, "1-n", "3", "PatientSetupSequence"); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::getPatientAdditionalPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientAdditionalPosition, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getPatientPosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientPosition, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getPatientSetupLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSetupLabel, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getPatientSetupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSetupNumber, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getPatientSetupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, PatientSetupNumber).getSint32(value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getSetupTechnique(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupTechnique, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getSetupTechniqueDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupTechniqueDescription, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getTableTopLateralSetupDisplacement(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLateralSetupDisplacement, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getTableTopLateralSetupDisplacement(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLateralSetupDisplacement).getFloat64(value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getTableTopLongitudinalSetupDisplacement(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLongitudinalSetupDisplacement, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getTableTopLongitudinalSetupDisplacement(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalSetupDisplacement).getFloat64(value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getTableTopVerticalSetupDisplacement(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopVerticalSetupDisplacement, value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::getTableTopVerticalSetupDisplacement(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopVerticalSetupDisplacement).getFloat64(value, pos); +} + + +OFCondition DRTPatientSetupSequence::Item::setPatientAdditionalPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAdditionalPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setPatientPosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientPosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setPatientSetupLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSetupLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setPatientSetupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSetupNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setSetupTechnique(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SetupTechnique.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setSetupTechniqueDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SetupTechniqueDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setTableTopLateralSetupDisplacement(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralSetupDisplacement.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setTableTopLongitudinalSetupDisplacement(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalSetupDisplacement.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::Item::setTableTopVerticalSetupDisplacement(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalSetupDisplacement.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPatientSetupSequence::DRTPatientSetupSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPatientSetupSequence::DRTPatientSetupSequence(const DRTPatientSetupSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPatientSetupSequence &DRTPatientSetupSequence::operator=(const DRTPatientSetupSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPatientSetupSequence::~DRTPatientSetupSequence() +{ + clear(); +} + + +void DRTPatientSetupSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPatientSetupSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPatientSetupSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPatientSetupSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPatientSetupSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSetupSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPatientSetupSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSetupSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSetupSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPatientSetupSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPatientSetupSequence::Item &DRTPatientSetupSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPatientSetupSequence::Item &DRTPatientSetupSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPatientSetupSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPatientSetupSequence::Item &DRTPatientSetupSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPatientSetupSequence::Item &DRTPatientSetupSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPatientSetupSequence::Item &DRTPatientSetupSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPatientSetupSequence::Item &DRTPatientSetupSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPatientSetupSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPatientSetupSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPatientSetupSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPatientSetupSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PatientSetupSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PatientSetupSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPatientSetupSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PatientSetupSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpsss.cc b/dcmrt/libsrc/drtpsss.cc new file mode 100644 index 00000000..7933cda4 --- /dev/null +++ b/dcmrt/libsrc/drtpsss.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPredecessorStructureSetSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpsss.h" + + +// --- item class --- + +DRTPredecessorStructureSetSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTPredecessorStructureSetSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTPredecessorStructureSetSequence::Item::~Item() +{ +} + + +DRTPredecessorStructureSetSequence::Item &DRTPredecessorStructureSetSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTPredecessorStructureSetSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTPredecessorStructureSetSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTPredecessorStructureSetSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPredecessorStructureSetSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "PredecessorStructureSetSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "PredecessorStructureSetSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "PredecessorStructureSetSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "PredecessorStructureSetSequence"); + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTPredecessorStructureSetSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTPredecessorStructureSetSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPredecessorStructureSetSequence::DRTPredecessorStructureSetSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPredecessorStructureSetSequence::DRTPredecessorStructureSetSequence(const DRTPredecessorStructureSetSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPredecessorStructureSetSequence &DRTPredecessorStructureSetSequence::operator=(const DRTPredecessorStructureSetSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPredecessorStructureSetSequence::~DRTPredecessorStructureSetSequence() +{ + clear(); +} + + +void DRTPredecessorStructureSetSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPredecessorStructureSetSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPredecessorStructureSetSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPredecessorStructureSetSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPredecessorStructureSetSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPredecessorStructureSetSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPredecessorStructureSetSequence::Item &DRTPredecessorStructureSetSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPredecessorStructureSetSequence::Item &DRTPredecessorStructureSetSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPredecessorStructureSetSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPredecessorStructureSetSequence::Item &DRTPredecessorStructureSetSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPredecessorStructureSetSequence::Item &DRTPredecessorStructureSetSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPredecessorStructureSetSequence::Item &DRTPredecessorStructureSetSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPredecessorStructureSetSequence::Item &DRTPredecessorStructureSetSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPredecessorStructureSetSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PredecessorStructureSetSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PredecessorStructureSetSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPredecessorStructureSetSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PredecessorStructureSetSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtpvis.cc b/dcmrt/libsrc/drtpvis.cc new file mode 100644 index 00000000..90b2bade --- /dev/null +++ b/dcmrt/libsrc/drtpvis.cc @@ -0,0 +1,895 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTPlannedVerificationImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtpvis.h" + + +// --- item class --- + +DRTPlannedVerificationImageSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + EndCumulativeMetersetWeight(DCM_EndCumulativeMetersetWeight), + ImagingDeviceSpecificAcquisitionParameters(DCM_ImagingDeviceSpecificAcquisitionParameters), + MetersetExposure(DCM_MetersetExposure), + RTImageOrientation(DCM_RTImageOrientation), + RTImagePlane(DCM_RTImagePlane), + RTImagePosition(DCM_RTImagePosition), + RTImageSID(DCM_RTImageSID), + ReferencedReferenceImageNumber(DCM_ReferencedReferenceImageNumber), + StartCumulativeMetersetWeight(DCM_StartCumulativeMetersetWeight), + XRayImageReceptorAngle(DCM_XRayImageReceptorAngle) +{ +} + + +DRTPlannedVerificationImageSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + EndCumulativeMetersetWeight(copy.EndCumulativeMetersetWeight), + ImagingDeviceSpecificAcquisitionParameters(copy.ImagingDeviceSpecificAcquisitionParameters), + MetersetExposure(copy.MetersetExposure), + RTImageOrientation(copy.RTImageOrientation), + RTImagePlane(copy.RTImagePlane), + RTImagePosition(copy.RTImagePosition), + RTImageSID(copy.RTImageSID), + ReferencedReferenceImageNumber(copy.ReferencedReferenceImageNumber), + StartCumulativeMetersetWeight(copy.StartCumulativeMetersetWeight), + XRayImageReceptorAngle(copy.XRayImageReceptorAngle) +{ +} + + +DRTPlannedVerificationImageSequence::Item::~Item() +{ +} + + +DRTPlannedVerificationImageSequence::Item &DRTPlannedVerificationImageSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + EndCumulativeMetersetWeight = copy.EndCumulativeMetersetWeight; + ImagingDeviceSpecificAcquisitionParameters = copy.ImagingDeviceSpecificAcquisitionParameters; + MetersetExposure = copy.MetersetExposure; + RTImageOrientation = copy.RTImageOrientation; + RTImagePlane = copy.RTImagePlane; + RTImagePosition = copy.RTImagePosition; + RTImageSID = copy.RTImageSID; + ReferencedReferenceImageNumber = copy.ReferencedReferenceImageNumber; + StartCumulativeMetersetWeight = copy.StartCumulativeMetersetWeight; + XRayImageReceptorAngle = copy.XRayImageReceptorAngle; + } + return *this; +} + + +void DRTPlannedVerificationImageSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + StartCumulativeMetersetWeight.clear(); + MetersetExposure.clear(); + EndCumulativeMetersetWeight.clear(); + RTImagePlane.clear(); + XRayImageReceptorAngle.clear(); + RTImageOrientation.clear(); + RTImagePosition.clear(); + RTImageSID.clear(); + ImagingDeviceSpecificAcquisitionParameters.clear(); + ReferencedReferenceImageNumber.clear(); + } +} + + +OFBool DRTPlannedVerificationImageSequence::Item::isEmpty() +{ + return StartCumulativeMetersetWeight.isEmpty() && + MetersetExposure.isEmpty() && + EndCumulativeMetersetWeight.isEmpty() && + RTImagePlane.isEmpty() && + XRayImageReceptorAngle.isEmpty() && + RTImageOrientation.isEmpty() && + RTImagePosition.isEmpty() && + RTImageSID.isEmpty() && + ImagingDeviceSpecificAcquisitionParameters.isEmpty() && + ReferencedReferenceImageNumber.isEmpty(); +} + + +OFBool DRTPlannedVerificationImageSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, StartCumulativeMetersetWeight, "1", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, MetersetExposure, "1", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, EndCumulativeMetersetWeight, "1", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, RTImagePlane, "1", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, XRayImageReceptorAngle, "1", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, RTImageOrientation, "6", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, RTImagePosition, "2", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, RTImageSID, "1", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, ImagingDeviceSpecificAcquisitionParameters, "1-n", "3", "PlannedVerificationImageSequence"); + getAndCheckElementFromDataset(item, ReferencedReferenceImageNumber, "1", "3", "PlannedVerificationImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmDecimalString(StartCumulativeMetersetWeight), "1", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(MetersetExposure), "1", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(EndCumulativeMetersetWeight), "1", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmCodeString(RTImagePlane), "1", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(XRayImageReceptorAngle), "1", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(RTImageOrientation), "6", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(RTImagePosition), "2", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(RTImageSID), "1", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmLongString(ImagingDeviceSpecificAcquisitionParameters), "1-n", "3", "PlannedVerificationImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedReferenceImageNumber), "1", "3", "PlannedVerificationImageSequence"); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getEndCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(EndCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getEndCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, EndCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getImagingDeviceSpecificAcquisitionParameters(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ImagingDeviceSpecificAcquisitionParameters, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getMetersetExposure(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MetersetExposure, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getMetersetExposure(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, MetersetExposure).getFloat64(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImageOrientation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTImageOrientation, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImageOrientation(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, RTImageOrientation).getFloat64(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImageOrientation(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, RTImageOrientation).getFloat64Vector(value); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImagePlane(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTImagePlane, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImagePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTImagePosition, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImagePosition(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, RTImagePosition).getFloat64(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImagePosition(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, RTImagePosition).getFloat64Vector(value); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImageSID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTImageSID, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getRTImageSID(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, RTImageSID).getFloat64(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getReferencedReferenceImageNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedReferenceImageNumber, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getReferencedReferenceImageNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedReferenceImageNumber).getSint32(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getStartCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StartCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getStartCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, StartCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getXRayImageReceptorAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(XRayImageReceptorAngle, value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::getXRayImageReceptorAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, XRayImageReceptorAngle).getFloat64(value, pos); +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setEndCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EndCumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setImagingDeviceSpecificAcquisitionParameters(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ImagingDeviceSpecificAcquisitionParameters.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setMetersetExposure(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MetersetExposure.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setRTImageOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "6") : EC_Normal; + if (result.good()) + result = RTImageOrientation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setRTImagePlane(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTImagePlane.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setRTImagePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = RTImagePosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setRTImageSID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTImageSID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setReferencedReferenceImageNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedReferenceImageNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setStartCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StartCumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::Item::setXRayImageReceptorAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = XRayImageReceptorAngle.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTPlannedVerificationImageSequence::DRTPlannedVerificationImageSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTPlannedVerificationImageSequence::DRTPlannedVerificationImageSequence(const DRTPlannedVerificationImageSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTPlannedVerificationImageSequence &DRTPlannedVerificationImageSequence::operator=(const DRTPlannedVerificationImageSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTPlannedVerificationImageSequence::~DRTPlannedVerificationImageSequence() +{ + clear(); +} + + +void DRTPlannedVerificationImageSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTPlannedVerificationImageSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTPlannedVerificationImageSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTPlannedVerificationImageSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTPlannedVerificationImageSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTPlannedVerificationImageSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTPlannedVerificationImageSequence::Item &DRTPlannedVerificationImageSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTPlannedVerificationImageSequence::Item &DRTPlannedVerificationImageSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTPlannedVerificationImageSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTPlannedVerificationImageSequence::Item &DRTPlannedVerificationImageSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTPlannedVerificationImageSequence::Item &DRTPlannedVerificationImageSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTPlannedVerificationImageSequence::Item &DRTPlannedVerificationImageSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTPlannedVerificationImageSequence::Item &DRTPlannedVerificationImageSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTPlannedVerificationImageSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_PlannedVerificationImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_PlannedVerificationImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTPlannedVerificationImageSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_PlannedVerificationImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtqds.cc b/dcmrt/libsrc/drtqds.cc new file mode 100644 index 00000000..2d6994bb --- /dev/null +++ b/dcmrt/libsrc/drtqds.cc @@ -0,0 +1,897 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTQuantityDefinitionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtqds.h" + + +// --- item class --- + +DRTQuantityDefinitionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ConceptCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ConceptNameCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + Date(DCM_Date), + DateTime(DCM_DateTime), + FloatingPointValue(DCM_FloatingPointValue), + MeasurementUnitsCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + NumericValue(DCM_NumericValue), + ObservationDateTime(DCM_ObservationDateTime), + PersonName(DCM_PersonName), + RationalDenominatorValue(DCM_RationalDenominatorValue), + RationalNumeratorValue(DCM_RationalNumeratorValue), + ReferencedSOPSequence(emptyDefaultItem /*emptyDefaultSequence*/), + TextValue(DCM_TextValue), + Time(DCM_Time), + UID(DCM_UID), + ValueType(DCM_ValueType) +{ +} + + +DRTQuantityDefinitionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ConceptCodeSequence(copy.ConceptCodeSequence), + ConceptNameCodeSequence(copy.ConceptNameCodeSequence), + Date(copy.Date), + DateTime(copy.DateTime), + FloatingPointValue(copy.FloatingPointValue), + MeasurementUnitsCodeSequence(copy.MeasurementUnitsCodeSequence), + NumericValue(copy.NumericValue), + ObservationDateTime(copy.ObservationDateTime), + PersonName(copy.PersonName), + RationalDenominatorValue(copy.RationalDenominatorValue), + RationalNumeratorValue(copy.RationalNumeratorValue), + ReferencedSOPSequence(copy.ReferencedSOPSequence), + TextValue(copy.TextValue), + Time(copy.Time), + UID(copy.UID), + ValueType(copy.ValueType) +{ +} + + +DRTQuantityDefinitionSequence::Item::~Item() +{ +} + + +DRTQuantityDefinitionSequence::Item &DRTQuantityDefinitionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ConceptCodeSequence = copy.ConceptCodeSequence; + ConceptNameCodeSequence = copy.ConceptNameCodeSequence; + Date = copy.Date; + DateTime = copy.DateTime; + FloatingPointValue = copy.FloatingPointValue; + MeasurementUnitsCodeSequence = copy.MeasurementUnitsCodeSequence; + NumericValue = copy.NumericValue; + ObservationDateTime = copy.ObservationDateTime; + PersonName = copy.PersonName; + RationalDenominatorValue = copy.RationalDenominatorValue; + RationalNumeratorValue = copy.RationalNumeratorValue; + ReferencedSOPSequence = copy.ReferencedSOPSequence; + TextValue = copy.TextValue; + Time = copy.Time; + UID = copy.UID; + ValueType = copy.ValueType; + } + return *this; +} + + +void DRTQuantityDefinitionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ValueType.clear(); + ObservationDateTime.clear(); + ConceptNameCodeSequence.clear(); + DateTime.clear(); + Date.clear(); + Time.clear(); + PersonName.clear(); + UID.clear(); + TextValue.clear(); + ConceptCodeSequence.clear(); + NumericValue.clear(); + FloatingPointValue.clear(); + RationalNumeratorValue.clear(); + RationalDenominatorValue.clear(); + MeasurementUnitsCodeSequence.clear(); + ReferencedSOPSequence.clear(); + } +} + + +OFBool DRTQuantityDefinitionSequence::Item::isEmpty() +{ + return ValueType.isEmpty() && + ObservationDateTime.isEmpty() && + ConceptNameCodeSequence.isEmpty() && + DateTime.isEmpty() && + Date.isEmpty() && + Time.isEmpty() && + PersonName.isEmpty() && + UID.isEmpty() && + TextValue.isEmpty() && + ConceptCodeSequence.isEmpty() && + NumericValue.isEmpty() && + FloatingPointValue.isEmpty() && + RationalNumeratorValue.isEmpty() && + RationalDenominatorValue.isEmpty() && + MeasurementUnitsCodeSequence.isEmpty() && + ReferencedSOPSequence.isEmpty(); +} + + +OFBool DRTQuantityDefinitionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ValueType, "1", "1", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, ObservationDateTime, "1", "3", "QuantityDefinitionSequence"); + ConceptNameCodeSequence.read(item, "1-n", "1", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, DateTime, "1", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, Date, "1", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, Time, "1", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, PersonName, "1", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, UID, "1", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, TextValue, "1", "1C", "QuantityDefinitionSequence"); + ConceptCodeSequence.read(item, "1-n", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, NumericValue, "1-n", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, FloatingPointValue, "1-n", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, RationalNumeratorValue, "1-n", "1C", "QuantityDefinitionSequence"); + getAndCheckElementFromDataset(item, RationalDenominatorValue, "1-n", "1C", "QuantityDefinitionSequence"); + MeasurementUnitsCodeSequence.read(item, "1-n", "1C", "QuantityDefinitionSequence"); + ReferencedSOPSequence.read(item, "1-n", "1C", "QuantityDefinitionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ValueType), "1", "1", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmDateTime(ObservationDateTime), "1", "3", "QuantityDefinitionSequence"); + if (result.good()) result = ConceptNameCodeSequence.write(item, "1-n", "1", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmDateTime(DateTime), "1", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmDate(Date), "1", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmTime(Time), "1", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmPersonName(PersonName), "1", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(UID), "1", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmUnlimitedText(TextValue), "1", "1C", "QuantityDefinitionSequence"); + if (result.good()) result = ConceptCodeSequence.write(item, "1-n", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmDecimalString(NumericValue), "1-n", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(FloatingPointValue), "1-n", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmSignedLong(RationalNumeratorValue), "1-n", "1C", "QuantityDefinitionSequence"); + addElementToDataset(result, item, new DcmUnsignedLong(RationalDenominatorValue), "1-n", "1C", "QuantityDefinitionSequence"); + if (result.good()) result = MeasurementUnitsCodeSequence.write(item, "1-n", "1C", "QuantityDefinitionSequence"); + if (result.good()) result = ReferencedSOPSequence.write(item, "1-n", "1C", "QuantityDefinitionSequence"); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getDate(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Date, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DateTime, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getFloatingPointValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, FloatingPointValue).getFloat64(value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getNumericValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumericValue, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getNumericValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NumericValue).getFloat64(value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getNumericValue(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, NumericValue).getFloat64Vector(value); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getObservationDateTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ObservationDateTime, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getPersonName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonName, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getRationalDenominatorValue(Uint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedLong &, RationalDenominatorValue).getUint32(value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getRationalNumeratorValue(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmSignedLong &, RationalNumeratorValue).getSint32(value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getTextValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TextValue, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Time, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UID, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::getValueType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ValueType, value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setDate(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Date.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setFloatingPointValue(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FloatingPointValue.putFloat64(value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setNumericValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NumericValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setObservationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ObservationDateTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setPersonName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PersonName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setRationalDenominatorValue(const Uint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RationalDenominatorValue.putUint32(value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setRationalNumeratorValue(const Sint32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RationalNumeratorValue.putSint32(value, pos); +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setTextValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = TextValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Time.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = UID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::Item::setValueType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ValueType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTQuantityDefinitionSequence::DRTQuantityDefinitionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTQuantityDefinitionSequence::DRTQuantityDefinitionSequence(const DRTQuantityDefinitionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTQuantityDefinitionSequence &DRTQuantityDefinitionSequence::operator=(const DRTQuantityDefinitionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTQuantityDefinitionSequence::~DRTQuantityDefinitionSequence() +{ + clear(); +} + + +void DRTQuantityDefinitionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTQuantityDefinitionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTQuantityDefinitionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTQuantityDefinitionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTQuantityDefinitionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTQuantityDefinitionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTQuantityDefinitionSequence::Item &DRTQuantityDefinitionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTQuantityDefinitionSequence::Item &DRTQuantityDefinitionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTQuantityDefinitionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTQuantityDefinitionSequence::Item &DRTQuantityDefinitionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTQuantityDefinitionSequence::Item &DRTQuantityDefinitionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTQuantityDefinitionSequence::Item &DRTQuantityDefinitionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTQuantityDefinitionSequence::Item &DRTQuantityDefinitionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTQuantityDefinitionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_QuantityDefinitionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_QuantityDefinitionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTQuantityDefinitionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_QuantityDefinitionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtras.cc b/dcmrt/libsrc/drtras.cc new file mode 100644 index 00000000..bbf3ba11 --- /dev/null +++ b/dcmrt/libsrc/drtras.cc @@ -0,0 +1,753 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRequestAttributesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtras.h" + + +// --- item class --- + +DRTRequestAttributesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReasonForRequestedProcedureCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReasonForTheRequestedProcedure(DCM_ReasonForTheRequestedProcedure), + ReferencedStudySequence(emptyDefaultItem /*emptyDefaultSequence*/), + RequestedProcedureCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RequestedProcedureDescription(DCM_RequestedProcedureDescription), + RequestedProcedureID(DCM_RequestedProcedureID), + ScheduledProcedureStepDescription(DCM_ScheduledProcedureStepDescription), + ScheduledProcedureStepID(DCM_ScheduledProcedureStepID), + ScheduledProtocolCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + StudyInstanceUID(DCM_StudyInstanceUID) +{ +} + + +DRTRequestAttributesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + ReasonForRequestedProcedureCodeSequence(copy.ReasonForRequestedProcedureCodeSequence), + ReasonForTheRequestedProcedure(copy.ReasonForTheRequestedProcedure), + ReferencedStudySequence(copy.ReferencedStudySequence), + RequestedProcedureCodeSequence(copy.RequestedProcedureCodeSequence), + RequestedProcedureDescription(copy.RequestedProcedureDescription), + RequestedProcedureID(copy.RequestedProcedureID), + ScheduledProcedureStepDescription(copy.ScheduledProcedureStepDescription), + ScheduledProcedureStepID(copy.ScheduledProcedureStepID), + ScheduledProtocolCodeSequence(copy.ScheduledProtocolCodeSequence), + StudyInstanceUID(copy.StudyInstanceUID) +{ +} + + +DRTRequestAttributesSequence::Item::~Item() +{ +} + + +DRTRequestAttributesSequence::Item &DRTRequestAttributesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + ReasonForRequestedProcedureCodeSequence = copy.ReasonForRequestedProcedureCodeSequence; + ReasonForTheRequestedProcedure = copy.ReasonForTheRequestedProcedure; + ReferencedStudySequence = copy.ReferencedStudySequence; + RequestedProcedureCodeSequence = copy.RequestedProcedureCodeSequence; + RequestedProcedureDescription = copy.RequestedProcedureDescription; + RequestedProcedureID = copy.RequestedProcedureID; + ScheduledProcedureStepDescription = copy.ScheduledProcedureStepDescription; + ScheduledProcedureStepID = copy.ScheduledProcedureStepID; + ScheduledProtocolCodeSequence = copy.ScheduledProtocolCodeSequence; + StudyInstanceUID = copy.StudyInstanceUID; + } + return *this; +} + + +void DRTRequestAttributesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RequestedProcedureID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyInstanceUID.clear(); + ReferencedStudySequence.clear(); + RequestedProcedureDescription.clear(); + RequestedProcedureCodeSequence.clear(); + ReasonForTheRequestedProcedure.clear(); + ReasonForRequestedProcedureCodeSequence.clear(); + ScheduledProcedureStepID.clear(); + ScheduledProcedureStepDescription.clear(); + ScheduledProtocolCodeSequence.clear(); + } +} + + +OFBool DRTRequestAttributesSequence::Item::isEmpty() +{ + return RequestedProcedureID.isEmpty() && + AccessionNumber.isEmpty() && + IssuerOfAccessionNumberSequence.isEmpty() && + StudyInstanceUID.isEmpty() && + ReferencedStudySequence.isEmpty() && + RequestedProcedureDescription.isEmpty() && + RequestedProcedureCodeSequence.isEmpty() && + ReasonForTheRequestedProcedure.isEmpty() && + ReasonForRequestedProcedureCodeSequence.isEmpty() && + ScheduledProcedureStepID.isEmpty() && + ScheduledProcedureStepDescription.isEmpty() && + ScheduledProtocolCodeSequence.isEmpty(); +} + + +OFBool DRTRequestAttributesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRequestAttributesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RequestedProcedureID, "1", "1C", "RequestAttributesSequence"); + getAndCheckElementFromDataset(item, AccessionNumber, "1", "3", "RequestAttributesSequence"); + IssuerOfAccessionNumberSequence.read(item, "1-n", "3", "RequestAttributesSequence"); + getAndCheckElementFromDataset(item, StudyInstanceUID, "1", "3", "RequestAttributesSequence"); + ReferencedStudySequence.read(item, "1-n", "3", "RequestAttributesSequence"); + getAndCheckElementFromDataset(item, RequestedProcedureDescription, "1", "3", "RequestAttributesSequence"); + RequestedProcedureCodeSequence.read(item, "1-n", "3", "RequestAttributesSequence"); + getAndCheckElementFromDataset(item, ReasonForTheRequestedProcedure, "1", "3", "RequestAttributesSequence"); + ReasonForRequestedProcedureCodeSequence.read(item, "1-n", "3", "RequestAttributesSequence"); + getAndCheckElementFromDataset(item, ScheduledProcedureStepID, "1", "1C", "RequestAttributesSequence"); + getAndCheckElementFromDataset(item, ScheduledProcedureStepDescription, "1", "3", "RequestAttributesSequence"); + ScheduledProtocolCodeSequence.read(item, "1-n", "3", "RequestAttributesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(RequestedProcedureID), "1", "1C", "RequestAttributesSequence"); + addElementToDataset(result, item, new DcmShortString(AccessionNumber), "1", "3", "RequestAttributesSequence"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(item, "1-n", "3", "RequestAttributesSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(StudyInstanceUID), "1", "3", "RequestAttributesSequence"); + if (result.good()) result = ReferencedStudySequence.write(item, "1-n", "3", "RequestAttributesSequence"); + addElementToDataset(result, item, new DcmLongString(RequestedProcedureDescription), "1", "3", "RequestAttributesSequence"); + if (result.good()) result = RequestedProcedureCodeSequence.write(item, "1-n", "3", "RequestAttributesSequence"); + addElementToDataset(result, item, new DcmLongString(ReasonForTheRequestedProcedure), "1", "3", "RequestAttributesSequence"); + if (result.good()) result = ReasonForRequestedProcedureCodeSequence.write(item, "1-n", "3", "RequestAttributesSequence"); + addElementToDataset(result, item, new DcmShortString(ScheduledProcedureStepID), "1", "1C", "RequestAttributesSequence"); + addElementToDataset(result, item, new DcmLongString(ScheduledProcedureStepDescription), "1", "3", "RequestAttributesSequence"); + if (result.good()) result = ScheduledProtocolCodeSequence.write(item, "1-n", "3", "RequestAttributesSequence"); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::getAccessionNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTRequestAttributesSequence::Item::getReasonForTheRequestedProcedure(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReasonForTheRequestedProcedure, value, pos); +} + + +OFCondition DRTRequestAttributesSequence::Item::getRequestedProcedureDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RequestedProcedureDescription, value, pos); +} + + +OFCondition DRTRequestAttributesSequence::Item::getRequestedProcedureID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RequestedProcedureID, value, pos); +} + + +OFCondition DRTRequestAttributesSequence::Item::getScheduledProcedureStepDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScheduledProcedureStepDescription, value, pos); +} + + +OFCondition DRTRequestAttributesSequence::Item::getScheduledProcedureStepID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScheduledProcedureStepID, value, pos); +} + + +OFCondition DRTRequestAttributesSequence::Item::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTRequestAttributesSequence::Item::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::setReasonForTheRequestedProcedure(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReasonForTheRequestedProcedure.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::setRequestedProcedureDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RequestedProcedureDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::setRequestedProcedureID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RequestedProcedureID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::setScheduledProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScheduledProcedureStepDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::setScheduledProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScheduledProcedureStepID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::Item::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRequestAttributesSequence::DRTRequestAttributesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRequestAttributesSequence::DRTRequestAttributesSequence(const DRTRequestAttributesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRequestAttributesSequence &DRTRequestAttributesSequence::operator=(const DRTRequestAttributesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRequestAttributesSequence::~DRTRequestAttributesSequence() +{ + clear(); +} + + +void DRTRequestAttributesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRequestAttributesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRequestAttributesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRequestAttributesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRequestAttributesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRequestAttributesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRequestAttributesSequence::Item &DRTRequestAttributesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRequestAttributesSequence::Item &DRTRequestAttributesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRequestAttributesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRequestAttributesSequence::Item &DRTRequestAttributesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRequestAttributesSequence::Item &DRTRequestAttributesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRequestAttributesSequence::Item &DRTRequestAttributesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRequestAttributesSequence::Item &DRTRequestAttributesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRequestAttributesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RequestAttributesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RequestAttributesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRequestAttributesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RequestAttributesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbas2.cc b/dcmrt/libsrc/drtrbas2.cc new file mode 100644 index 00000000..d9007f45 --- /dev/null +++ b/dcmrt/libsrc/drtrbas2.cc @@ -0,0 +1,553 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbas2.h" + + +// --- item class --- + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedBrachyApplicationSetupNumber(DCM_ReferencedBrachyApplicationSetupNumber) +{ +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedBrachyApplicationSetupNumber(copy.ReferencedBrachyApplicationSetupNumber) +{ +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::~Item() +{ +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedBrachyApplicationSetupNumber = copy.ReferencedBrachyApplicationSetupNumber; + } + return *this; +} + + +void DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedBrachyApplicationSetupNumber.clear(); + } +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::isEmpty() +{ + return ReferencedBrachyApplicationSetupNumber.isEmpty(); +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedBrachyApplicationSetupNumber, "1", "1", "ReferencedBrachyApplicationSetupSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedBrachyApplicationSetupNumber), "1", "1", "ReferencedBrachyApplicationSetupSequence"); + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::getReferencedBrachyApplicationSetupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedBrachyApplicationSetupNumber, value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::getReferencedBrachyApplicationSetupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedBrachyApplicationSetupNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item::setReferencedBrachyApplicationSetupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBrachyApplicationSetupNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule(const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::operator=(const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::~DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule() +{ + clear(); +} + + +void DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBrachyApplicationSetupSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBrachyApplicationSetupSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBrachyApplicationSetupSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbas8.cc b/dcmrt/libsrc/drtrbas8.cc new file mode 100644 index 00000000..aabb0171 --- /dev/null +++ b/dcmrt/libsrc/drtrbas8.cc @@ -0,0 +1,638 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbas8.h" + + +// --- item class --- + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BrachyApplicationSetupDose(DCM_BrachyApplicationSetupDose), + BrachyApplicationSetupDoseSpecificationPoint(DCM_BrachyApplicationSetupDoseSpecificationPoint), + ReferencedBrachyApplicationSetupNumber(DCM_ReferencedBrachyApplicationSetupNumber) +{ +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BrachyApplicationSetupDose(copy.BrachyApplicationSetupDose), + BrachyApplicationSetupDoseSpecificationPoint(copy.BrachyApplicationSetupDoseSpecificationPoint), + ReferencedBrachyApplicationSetupNumber(copy.ReferencedBrachyApplicationSetupNumber) +{ +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::~Item() +{ +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BrachyApplicationSetupDose = copy.BrachyApplicationSetupDose; + BrachyApplicationSetupDoseSpecificationPoint = copy.BrachyApplicationSetupDoseSpecificationPoint; + ReferencedBrachyApplicationSetupNumber = copy.ReferencedBrachyApplicationSetupNumber; + } + return *this; +} + + +void DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedBrachyApplicationSetupNumber.clear(); + BrachyApplicationSetupDoseSpecificationPoint.clear(); + BrachyApplicationSetupDose.clear(); + } +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::isEmpty() +{ + return ReferencedBrachyApplicationSetupNumber.isEmpty() && + BrachyApplicationSetupDoseSpecificationPoint.isEmpty() && + BrachyApplicationSetupDose.isEmpty(); +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedBrachyApplicationSetupNumber, "1", "1", "ReferencedBrachyApplicationSetupSequence"); + getAndCheckElementFromDataset(item, BrachyApplicationSetupDoseSpecificationPoint, "3", "3", "ReferencedBrachyApplicationSetupSequence"); + getAndCheckElementFromDataset(item, BrachyApplicationSetupDose, "1", "3", "ReferencedBrachyApplicationSetupSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedBrachyApplicationSetupNumber), "1", "1", "ReferencedBrachyApplicationSetupSequence"); + addElementToDataset(result, item, new DcmDecimalString(BrachyApplicationSetupDoseSpecificationPoint), "3", "3", "ReferencedBrachyApplicationSetupSequence"); + addElementToDataset(result, item, new DcmDecimalString(BrachyApplicationSetupDose), "1", "3", "ReferencedBrachyApplicationSetupSequence"); + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::getBrachyApplicationSetupDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyApplicationSetupDose, value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::getBrachyApplicationSetupDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BrachyApplicationSetupDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::getBrachyApplicationSetupDoseSpecificationPoint(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BrachyApplicationSetupDoseSpecificationPoint, value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::getBrachyApplicationSetupDoseSpecificationPoint(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BrachyApplicationSetupDoseSpecificationPoint).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::getBrachyApplicationSetupDoseSpecificationPoint(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BrachyApplicationSetupDoseSpecificationPoint).getFloat64Vector(value); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::getReferencedBrachyApplicationSetupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedBrachyApplicationSetupNumber, value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::getReferencedBrachyApplicationSetupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedBrachyApplicationSetupNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::setBrachyApplicationSetupDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BrachyApplicationSetupDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::setBrachyApplicationSetupDoseSpecificationPoint(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = BrachyApplicationSetupDoseSpecificationPoint.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item::setReferencedBrachyApplicationSetupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBrachyApplicationSetupNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule(const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::operator=(const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::~DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule() +{ + clear(); +} + + +void DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::Item &DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBrachyApplicationSetupSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBrachyApplicationSetupSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBrachyApplicationSetupSequenceInRTFractionSchemeModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBrachyApplicationSetupSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbls.cc b/dcmrt/libsrc/drtrbls.cc new file mode 100644 index 00000000..defb874d --- /dev/null +++ b/dcmrt/libsrc/drtrbls.cc @@ -0,0 +1,640 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRecordedBlockSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbls.h" + + +// --- item class --- + +DRTRecordedBlockSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BlockName(DCM_BlockName), + BlockTrayID(DCM_BlockTrayID), + ReferencedBlockNumber(DCM_ReferencedBlockNumber) +{ +} + + +DRTRecordedBlockSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BlockName(copy.BlockName), + BlockTrayID(copy.BlockTrayID), + ReferencedBlockNumber(copy.ReferencedBlockNumber) +{ +} + + +DRTRecordedBlockSequence::Item::~Item() +{ +} + + +DRTRecordedBlockSequence::Item &DRTRecordedBlockSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BlockName = copy.BlockName; + BlockTrayID = copy.BlockTrayID; + ReferencedBlockNumber = copy.ReferencedBlockNumber; + } + return *this; +} + + +void DRTRecordedBlockSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + BlockTrayID.clear(); + AccessoryCode.clear(); + ReferencedBlockNumber.clear(); + BlockName.clear(); + } +} + + +OFBool DRTRecordedBlockSequence::Item::isEmpty() +{ + return BlockTrayID.isEmpty() && + AccessoryCode.isEmpty() && + ReferencedBlockNumber.isEmpty() && + BlockName.isEmpty(); +} + + +OFBool DRTRecordedBlockSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRecordedBlockSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, BlockTrayID, "1", "3", "RecordedBlockSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RecordedBlockSequence"); + getAndCheckElementFromDataset(item, ReferencedBlockNumber, "1", "1", "RecordedBlockSequence"); + getAndCheckElementFromDataset(item, BlockName, "1", "3", "RecordedBlockSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(BlockTrayID), "1", "3", "RecordedBlockSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RecordedBlockSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedBlockNumber), "1", "1", "RecordedBlockSequence"); + addElementToDataset(result, item, new DcmLongString(BlockName), "1", "3", "RecordedBlockSequence"); + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRecordedBlockSequence::Item::getBlockName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockName, value, pos); +} + + +OFCondition DRTRecordedBlockSequence::Item::getBlockTrayID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BlockTrayID, value, pos); +} + + +OFCondition DRTRecordedBlockSequence::Item::getReferencedBlockNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedBlockNumber, value, pos); +} + + +OFCondition DRTRecordedBlockSequence::Item::getReferencedBlockNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedBlockNumber).getSint32(value, pos); +} + + +OFCondition DRTRecordedBlockSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::Item::setBlockName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::Item::setBlockTrayID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BlockTrayID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::Item::setReferencedBlockNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBlockNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRecordedBlockSequence::DRTRecordedBlockSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRecordedBlockSequence::DRTRecordedBlockSequence(const DRTRecordedBlockSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRecordedBlockSequence &DRTRecordedBlockSequence::operator=(const DRTRecordedBlockSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRecordedBlockSequence::~DRTRecordedBlockSequence() +{ + clear(); +} + + +void DRTRecordedBlockSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRecordedBlockSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRecordedBlockSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRecordedBlockSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRecordedBlockSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRecordedBlockSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRecordedBlockSequence::Item &DRTRecordedBlockSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRecordedBlockSequence::Item &DRTRecordedBlockSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRecordedBlockSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRecordedBlockSequence::Item &DRTRecordedBlockSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRecordedBlockSequence::Item &DRTRecordedBlockSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRecordedBlockSequence::Item &DRTRecordedBlockSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRecordedBlockSequence::Item &DRTRecordedBlockSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRecordedBlockSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RecordedBlockSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RecordedBlockSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRecordedBlockSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RecordedBlockSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbos1.cc b/dcmrt/libsrc/drtrbos1.cc new file mode 100644 index 00000000..3512f182 --- /dev/null +++ b/dcmrt/libsrc/drtrbos1.cc @@ -0,0 +1,640 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBolusSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbos1.h" + + +// --- item class --- + +DRTReferencedBolusSequenceInRTBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BolusDescription(DCM_BolusDescription), + BolusID(DCM_BolusID), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTReferencedBolusSequenceInRTBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BolusDescription(copy.BolusDescription), + BolusID(copy.BolusID), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTReferencedBolusSequenceInRTBeamsModule::Item::~Item() +{ +} + + +DRTReferencedBolusSequenceInRTBeamsModule::Item &DRTReferencedBolusSequenceInRTBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BolusDescription = copy.BolusDescription; + BolusID = copy.BolusID; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTReferencedBolusSequenceInRTBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedROINumber.clear(); + BolusID.clear(); + BolusDescription.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTReferencedBolusSequenceInRTBeamsModule::Item::isEmpty() +{ + return ReferencedROINumber.isEmpty() && + BolusID.isEmpty() && + BolusDescription.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTReferencedBolusSequenceInRTBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "ReferencedBolusSequence"); + getAndCheckElementFromDataset(item, BolusID, "1", "3", "ReferencedBolusSequence"); + getAndCheckElementFromDataset(item, BolusDescription, "1", "3", "ReferencedBolusSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ReferencedBolusSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "ReferencedBolusSequence"); + addElementToDataset(result, item, new DcmShortString(BolusID), "1", "3", "ReferencedBolusSequence"); + addElementToDataset(result, item, new DcmShortText(BolusDescription), "1", "3", "ReferencedBolusSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ReferencedBolusSequence"); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::getBolusDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BolusDescription, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::getBolusID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BolusID, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::setBolusDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = BolusDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::setBolusID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BolusID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBolusSequenceInRTBeamsModule::DRTReferencedBolusSequenceInRTBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBolusSequenceInRTBeamsModule::DRTReferencedBolusSequenceInRTBeamsModule(const DRTReferencedBolusSequenceInRTBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBolusSequenceInRTBeamsModule &DRTReferencedBolusSequenceInRTBeamsModule::operator=(const DRTReferencedBolusSequenceInRTBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBolusSequenceInRTBeamsModule::~DRTReferencedBolusSequenceInRTBeamsModule() +{ + clear(); +} + + +void DRTReferencedBolusSequenceInRTBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBolusSequenceInRTBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBolusSequenceInRTBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBolusSequenceInRTBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBolusSequenceInRTBeamsModule::Item &DRTReferencedBolusSequenceInRTBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBolusSequenceInRTBeamsModule::Item &DRTReferencedBolusSequenceInRTBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBolusSequenceInRTBeamsModule::Item &DRTReferencedBolusSequenceInRTBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBolusSequenceInRTBeamsModule::Item &DRTReferencedBolusSequenceInRTBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBolusSequenceInRTBeamsModule::Item &DRTReferencedBolusSequenceInRTBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBolusSequenceInRTBeamsModule::Item &DRTReferencedBolusSequenceInRTBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBolusSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBolusSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBolusSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbos6.cc b/dcmrt/libsrc/drtrbos6.cc new file mode 100644 index 00000000..e9367e51 --- /dev/null +++ b/dcmrt/libsrc/drtrbos6.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBolusSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbos6.h" + + +// --- item class --- + +DRTReferencedBolusSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::Item &DRTReferencedBolusSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTReferencedBolusSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedROINumber.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return ReferencedROINumber.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "ReferencedBolusSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ReferencedBolusSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "ReferencedBolusSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ReferencedBolusSequence"); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBolusSequenceInRTIonBeamsModule::DRTReferencedBolusSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::DRTReferencedBolusSequenceInRTIonBeamsModule(const DRTReferencedBolusSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule &DRTReferencedBolusSequenceInRTIonBeamsModule::operator=(const DRTReferencedBolusSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::~DRTReferencedBolusSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTReferencedBolusSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBolusSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::Item &DRTReferencedBolusSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBolusSequenceInRTIonBeamsModule::Item &DRTReferencedBolusSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::Item &DRTReferencedBolusSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBolusSequenceInRTIonBeamsModule::Item &DRTReferencedBolusSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBolusSequenceInRTIonBeamsModule::Item &DRTReferencedBolusSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBolusSequenceInRTIonBeamsModule::Item &DRTReferencedBolusSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBolusSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBolusSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBolusSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbos7.cc b/dcmrt/libsrc/drtrbos7.cc new file mode 100644 index 00000000..ed7176d9 --- /dev/null +++ b/dcmrt/libsrc/drtrbos7.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbos7.h" + + +// --- item class --- + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::~Item() +{ +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedROINumber.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::isEmpty() +{ + return ReferencedROINumber.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "ReferencedBolusSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ReferencedBolusSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "ReferencedBolusSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ReferencedBolusSequence"); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule(const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::operator=(const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::~DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule() +{ + clear(); +} + + +void DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::Item &DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBolusSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBolusSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBolusSequenceInRTIonBeamsSessionRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBolusSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbs2.cc b/dcmrt/libsrc/drtrbs2.cc new file mode 100644 index 00000000..e5928e9a --- /dev/null +++ b/dcmrt/libsrc/drtrbs2.cc @@ -0,0 +1,560 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBeamSequenceInRTDoseModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbs2.h" + + +// --- item class --- + +DRTReferencedBeamSequenceInRTDoseModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedBeamNumber(DCM_ReferencedBeamNumber), + ReferencedControlPointSequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTReferencedBeamSequenceInRTDoseModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedBeamNumber(copy.ReferencedBeamNumber), + ReferencedControlPointSequence(copy.ReferencedControlPointSequence) +{ +} + + +DRTReferencedBeamSequenceInRTDoseModule::Item::~Item() +{ +} + + +DRTReferencedBeamSequenceInRTDoseModule::Item &DRTReferencedBeamSequenceInRTDoseModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedBeamNumber = copy.ReferencedBeamNumber; + ReferencedControlPointSequence = copy.ReferencedControlPointSequence; + } + return *this; +} + + +void DRTReferencedBeamSequenceInRTDoseModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedBeamNumber.clear(); + ReferencedControlPointSequence.clear(); + } +} + + +OFBool DRTReferencedBeamSequenceInRTDoseModule::Item::isEmpty() +{ + return ReferencedBeamNumber.isEmpty() && + ReferencedControlPointSequence.isEmpty(); +} + + +OFBool DRTReferencedBeamSequenceInRTDoseModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedBeamNumber, "1", "1", "ReferencedBeamSequence"); + ReferencedControlPointSequence.read(item, "1-n", "1C", "ReferencedBeamSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedBeamNumber), "1", "1", "ReferencedBeamSequence"); + if (result.good()) result = ReferencedControlPointSequence.write(item, "1-n", "1C", "ReferencedBeamSequence"); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::Item::getReferencedBeamNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedBeamNumber, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::Item::getReferencedBeamNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedBeamNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::Item::setReferencedBeamNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBeamNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBeamSequenceInRTDoseModule::DRTReferencedBeamSequenceInRTDoseModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBeamSequenceInRTDoseModule::DRTReferencedBeamSequenceInRTDoseModule(const DRTReferencedBeamSequenceInRTDoseModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBeamSequenceInRTDoseModule &DRTReferencedBeamSequenceInRTDoseModule::operator=(const DRTReferencedBeamSequenceInRTDoseModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBeamSequenceInRTDoseModule::~DRTReferencedBeamSequenceInRTDoseModule() +{ + clear(); +} + + +void DRTReferencedBeamSequenceInRTDoseModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBeamSequenceInRTDoseModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBeamSequenceInRTDoseModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBeamSequenceInRTDoseModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBeamSequenceInRTDoseModule::Item &DRTReferencedBeamSequenceInRTDoseModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBeamSequenceInRTDoseModule::Item &DRTReferencedBeamSequenceInRTDoseModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBeamSequenceInRTDoseModule::Item &DRTReferencedBeamSequenceInRTDoseModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBeamSequenceInRTDoseModule::Item &DRTReferencedBeamSequenceInRTDoseModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBeamSequenceInRTDoseModule::Item &DRTReferencedBeamSequenceInRTDoseModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBeamSequenceInRTDoseModule::Item &DRTReferencedBeamSequenceInRTDoseModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBeamSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBeamSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTDoseModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBeamSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbs4.cc b/dcmrt/libsrc/drtrbs4.cc new file mode 100644 index 00000000..f1c2ef3c --- /dev/null +++ b/dcmrt/libsrc/drtrbs4.cc @@ -0,0 +1,826 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbs4.h" + + +// --- item class --- + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AlternateBeamDose(DCM_AlternateBeamDose), + AlternateBeamDoseType(DCM_AlternateBeamDoseType), + BeamDeliveryDurationLimit(DCM_BeamDeliveryDurationLimit), + BeamDose(DCM_BeamDose), + BeamDoseSpecificationPoint(DCM_BeamDoseSpecificationPoint), + BeamDoseType(DCM_BeamDoseType), + BeamMeterset(DCM_BeamMeterset), + ReferencedBeamNumber(DCM_ReferencedBeamNumber), + ReferencedDoseReferenceUID(DCM_ReferencedDoseReferenceUID) +{ +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AlternateBeamDose(copy.AlternateBeamDose), + AlternateBeamDoseType(copy.AlternateBeamDoseType), + BeamDeliveryDurationLimit(copy.BeamDeliveryDurationLimit), + BeamDose(copy.BeamDose), + BeamDoseSpecificationPoint(copy.BeamDoseSpecificationPoint), + BeamDoseType(copy.BeamDoseType), + BeamMeterset(copy.BeamMeterset), + ReferencedBeamNumber(copy.ReferencedBeamNumber), + ReferencedDoseReferenceUID(copy.ReferencedDoseReferenceUID) +{ +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::~Item() +{ +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AlternateBeamDose = copy.AlternateBeamDose; + AlternateBeamDoseType = copy.AlternateBeamDoseType; + BeamDeliveryDurationLimit = copy.BeamDeliveryDurationLimit; + BeamDose = copy.BeamDose; + BeamDoseSpecificationPoint = copy.BeamDoseSpecificationPoint; + BeamDoseType = copy.BeamDoseType; + BeamMeterset = copy.BeamMeterset; + ReferencedBeamNumber = copy.ReferencedBeamNumber; + ReferencedDoseReferenceUID = copy.ReferencedDoseReferenceUID; + } + return *this; +} + + +void DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedBeamNumber.clear(); + BeamDoseSpecificationPoint.clear(); + ReferencedDoseReferenceUID.clear(); + BeamDose.clear(); + BeamDoseType.clear(); + AlternateBeamDose.clear(); + AlternateBeamDoseType.clear(); + BeamMeterset.clear(); + BeamDeliveryDurationLimit.clear(); + } +} + + +OFBool DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::isEmpty() +{ + return ReferencedBeamNumber.isEmpty() && + BeamDoseSpecificationPoint.isEmpty() && + ReferencedDoseReferenceUID.isEmpty() && + BeamDose.isEmpty() && + BeamDoseType.isEmpty() && + AlternateBeamDose.isEmpty() && + AlternateBeamDoseType.isEmpty() && + BeamMeterset.isEmpty() && + BeamDeliveryDurationLimit.isEmpty(); +} + + +OFBool DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedBeamNumber, "1", "1", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDoseSpecificationPoint, "3", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceUID, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDose, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDoseType, "1", "1C", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, AlternateBeamDose, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, AlternateBeamDoseType, "1", "1C", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamMeterset, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDeliveryDurationLimit, "1", "3", "ReferencedBeamSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedBeamNumber), "1", "1", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamDoseSpecificationPoint), "3", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedDoseReferenceUID), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamDose), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamDoseType), "1", "1C", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(AlternateBeamDose), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(AlternateBeamDoseType), "1", "1C", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamMeterset), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(BeamDeliveryDurationLimit), "1", "3", "ReferencedBeamSequence"); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getAlternateBeamDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AlternateBeamDose, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getAlternateBeamDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, AlternateBeamDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getAlternateBeamDoseType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AlternateBeamDoseType, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamDeliveryDurationLimit(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, BeamDeliveryDurationLimit).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDose, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamDoseSpecificationPoint(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDoseSpecificationPoint, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamDoseSpecificationPoint(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamDoseSpecificationPoint).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamDoseSpecificationPoint(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamDoseSpecificationPoint).getFloat64Vector(value); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamDoseType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDoseType, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamMeterset, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getBeamMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamMeterset).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getReferencedBeamNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedBeamNumber, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getReferencedBeamNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedBeamNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::getReferencedDoseReferenceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceUID, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setAlternateBeamDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AlternateBeamDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setAlternateBeamDoseType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AlternateBeamDoseType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setBeamDeliveryDurationLimit(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BeamDeliveryDurationLimit.putFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setBeamDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setBeamDoseSpecificationPoint(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = BeamDoseSpecificationPoint.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setBeamDoseType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamDoseType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setBeamMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setReferencedBeamNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBeamNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item::setReferencedDoseReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule(const DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::operator=(const DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::~DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule() +{ + clear(); +} + + +void DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBeamSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBeamSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTGeneralTreatmentRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBeamSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrbs8.cc b/dcmrt/libsrc/drtrbs8.cc new file mode 100644 index 00000000..131cd05b --- /dev/null +++ b/dcmrt/libsrc/drtrbs8.cc @@ -0,0 +1,826 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedBeamSequenceInRTFractionSchemeModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrbs8.h" + + +// --- item class --- + +DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AlternateBeamDose(DCM_AlternateBeamDose), + AlternateBeamDoseType(DCM_AlternateBeamDoseType), + BeamDeliveryDurationLimit(DCM_BeamDeliveryDurationLimit), + BeamDose(DCM_BeamDose), + BeamDoseSpecificationPoint(DCM_BeamDoseSpecificationPoint), + BeamDoseType(DCM_BeamDoseType), + BeamMeterset(DCM_BeamMeterset), + ReferencedBeamNumber(DCM_ReferencedBeamNumber), + ReferencedDoseReferenceUID(DCM_ReferencedDoseReferenceUID) +{ +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AlternateBeamDose(copy.AlternateBeamDose), + AlternateBeamDoseType(copy.AlternateBeamDoseType), + BeamDeliveryDurationLimit(copy.BeamDeliveryDurationLimit), + BeamDose(copy.BeamDose), + BeamDoseSpecificationPoint(copy.BeamDoseSpecificationPoint), + BeamDoseType(copy.BeamDoseType), + BeamMeterset(copy.BeamMeterset), + ReferencedBeamNumber(copy.ReferencedBeamNumber), + ReferencedDoseReferenceUID(copy.ReferencedDoseReferenceUID) +{ +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::~Item() +{ +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AlternateBeamDose = copy.AlternateBeamDose; + AlternateBeamDoseType = copy.AlternateBeamDoseType; + BeamDeliveryDurationLimit = copy.BeamDeliveryDurationLimit; + BeamDose = copy.BeamDose; + BeamDoseSpecificationPoint = copy.BeamDoseSpecificationPoint; + BeamDoseType = copy.BeamDoseType; + BeamMeterset = copy.BeamMeterset; + ReferencedBeamNumber = copy.ReferencedBeamNumber; + ReferencedDoseReferenceUID = copy.ReferencedDoseReferenceUID; + } + return *this; +} + + +void DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedBeamNumber.clear(); + BeamDoseSpecificationPoint.clear(); + ReferencedDoseReferenceUID.clear(); + BeamDose.clear(); + BeamDoseType.clear(); + AlternateBeamDose.clear(); + AlternateBeamDoseType.clear(); + BeamMeterset.clear(); + BeamDeliveryDurationLimit.clear(); + } +} + + +OFBool DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::isEmpty() +{ + return ReferencedBeamNumber.isEmpty() && + BeamDoseSpecificationPoint.isEmpty() && + ReferencedDoseReferenceUID.isEmpty() && + BeamDose.isEmpty() && + BeamDoseType.isEmpty() && + AlternateBeamDose.isEmpty() && + AlternateBeamDoseType.isEmpty() && + BeamMeterset.isEmpty() && + BeamDeliveryDurationLimit.isEmpty(); +} + + +OFBool DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedBeamNumber, "1", "1", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDoseSpecificationPoint, "3", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceUID, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDose, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDoseType, "1", "1C", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, AlternateBeamDose, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, AlternateBeamDoseType, "1", "1C", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamMeterset, "1", "3", "ReferencedBeamSequence"); + getAndCheckElementFromDataset(item, BeamDeliveryDurationLimit, "1", "3", "ReferencedBeamSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedBeamNumber), "1", "1", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamDoseSpecificationPoint), "3", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedDoseReferenceUID), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamDose), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamDoseType), "1", "1C", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(AlternateBeamDose), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(AlternateBeamDoseType), "1", "1C", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamMeterset), "1", "3", "ReferencedBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(BeamDeliveryDurationLimit), "1", "3", "ReferencedBeamSequence"); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getAlternateBeamDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AlternateBeamDose, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getAlternateBeamDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, AlternateBeamDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getAlternateBeamDoseType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AlternateBeamDoseType, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamDeliveryDurationLimit(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, BeamDeliveryDurationLimit).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDose, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamDoseSpecificationPoint(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDoseSpecificationPoint, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamDoseSpecificationPoint(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamDoseSpecificationPoint).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamDoseSpecificationPoint(OFVector &value) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamDoseSpecificationPoint).getFloat64Vector(value); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamDoseType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDoseType, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamMeterset, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getBeamMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamMeterset).getFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getReferencedBeamNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedBeamNumber, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getReferencedBeamNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedBeamNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::getReferencedDoseReferenceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceUID, value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setAlternateBeamDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AlternateBeamDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setAlternateBeamDoseType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AlternateBeamDoseType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setBeamDeliveryDurationLimit(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return BeamDeliveryDurationLimit.putFloat64(value, pos); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setBeamDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setBeamDoseSpecificationPoint(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = BeamDoseSpecificationPoint.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setBeamDoseType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamDoseType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setBeamMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setReferencedBeamNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBeamNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::Item::setReferencedDoseReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedBeamSequenceInRTFractionSchemeModule::DRTReferencedBeamSequenceInRTFractionSchemeModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::DRTReferencedBeamSequenceInRTFractionSchemeModule(const DRTReferencedBeamSequenceInRTFractionSchemeModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule &DRTReferencedBeamSequenceInRTFractionSchemeModule::operator=(const DRTReferencedBeamSequenceInRTFractionSchemeModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::~DRTReferencedBeamSequenceInRTFractionSchemeModule() +{ + clear(); +} + + +void DRTReferencedBeamSequenceInRTFractionSchemeModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedBeamSequenceInRTFractionSchemeModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedBeamSequenceInRTFractionSchemeModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedBeamSequenceInRTFractionSchemeModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &DRTReferencedBeamSequenceInRTFractionSchemeModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &DRTReferencedBeamSequenceInRTFractionSchemeModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &DRTReferencedBeamSequenceInRTFractionSchemeModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &DRTReferencedBeamSequenceInRTFractionSchemeModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &DRTReferencedBeamSequenceInRTFractionSchemeModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &DRTReferencedBeamSequenceInRTFractionSchemeModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedBeamSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedBeamSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedBeamSequenceInRTFractionSchemeModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedBeamSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrcdrs.cc b/dcmrt/libsrc/drtrcdrs.cc new file mode 100644 index 00000000..1ba0ec0e --- /dev/null +++ b/dcmrt/libsrc/drtrcdrs.cc @@ -0,0 +1,629 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedCalculatedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrcdrs.h" + + +// --- item class --- + +DRTReferencedCalculatedDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CalculatedDoseReferenceDoseValue(DCM_CalculatedDoseReferenceDoseValue), + ReferencedCalculatedDoseReferenceNumber(DCM_ReferencedCalculatedDoseReferenceNumber), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTReferencedCalculatedDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CalculatedDoseReferenceDoseValue(copy.CalculatedDoseReferenceDoseValue), + ReferencedCalculatedDoseReferenceNumber(copy.ReferencedCalculatedDoseReferenceNumber), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTReferencedCalculatedDoseReferenceSequence::Item::~Item() +{ +} + + +DRTReferencedCalculatedDoseReferenceSequence::Item &DRTReferencedCalculatedDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CalculatedDoseReferenceDoseValue = copy.CalculatedDoseReferenceDoseValue; + ReferencedCalculatedDoseReferenceNumber = copy.ReferencedCalculatedDoseReferenceNumber; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTReferencedCalculatedDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + ReferencedCalculatedDoseReferenceNumber.clear(); + CalculatedDoseReferenceDoseValue.clear(); + } +} + + +OFBool DRTReferencedCalculatedDoseReferenceSequence::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + ReferencedCalculatedDoseReferenceNumber.isEmpty() && + CalculatedDoseReferenceDoseValue.isEmpty(); +} + + +OFBool DRTReferencedCalculatedDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1C", "ReferencedCalculatedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, ReferencedCalculatedDoseReferenceNumber, "1", "1C", "ReferencedCalculatedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CalculatedDoseReferenceDoseValue, "1", "1", "ReferencedCalculatedDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1C", "ReferencedCalculatedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedCalculatedDoseReferenceNumber), "1", "1C", "ReferencedCalculatedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(CalculatedDoseReferenceDoseValue), "1", "1", "ReferencedCalculatedDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::getCalculatedDoseReferenceDoseValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CalculatedDoseReferenceDoseValue, value, pos); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::getCalculatedDoseReferenceDoseValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CalculatedDoseReferenceDoseValue).getFloat64(value, pos); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::getReferencedCalculatedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedCalculatedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::getReferencedCalculatedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedCalculatedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::setCalculatedDoseReferenceDoseValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CalculatedDoseReferenceDoseValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::setReferencedCalculatedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedCalculatedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedCalculatedDoseReferenceSequence::DRTReferencedCalculatedDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedCalculatedDoseReferenceSequence::DRTReferencedCalculatedDoseReferenceSequence(const DRTReferencedCalculatedDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedCalculatedDoseReferenceSequence &DRTReferencedCalculatedDoseReferenceSequence::operator=(const DRTReferencedCalculatedDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedCalculatedDoseReferenceSequence::~DRTReferencedCalculatedDoseReferenceSequence() +{ + clear(); +} + + +void DRTReferencedCalculatedDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedCalculatedDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedCalculatedDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedCalculatedDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedCalculatedDoseReferenceSequence::Item &DRTReferencedCalculatedDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedCalculatedDoseReferenceSequence::Item &DRTReferencedCalculatedDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedCalculatedDoseReferenceSequence::Item &DRTReferencedCalculatedDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedCalculatedDoseReferenceSequence::Item &DRTReferencedCalculatedDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedCalculatedDoseReferenceSequence::Item &DRTReferencedCalculatedDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedCalculatedDoseReferenceSequence::Item &DRTReferencedCalculatedDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedCalculatedDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedCalculatedDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedCalculatedDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedCalculatedDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrcos.cc b/dcmrt/libsrc/drtrcos.cc new file mode 100644 index 00000000..60dd5d9e --- /dev/null +++ b/dcmrt/libsrc/drtrcos.cc @@ -0,0 +1,611 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRecordedCompensatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrcos.h" + + +// --- item class --- + +DRTRecordedCompensatorSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + CompensatorID(DCM_CompensatorID), + ReferencedCompensatorNumber(DCM_ReferencedCompensatorNumber) +{ +} + + +DRTRecordedCompensatorSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + CompensatorID(copy.CompensatorID), + ReferencedCompensatorNumber(copy.ReferencedCompensatorNumber) +{ +} + + +DRTRecordedCompensatorSequence::Item::~Item() +{ +} + + +DRTRecordedCompensatorSequence::Item &DRTRecordedCompensatorSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + CompensatorID = copy.CompensatorID; + ReferencedCompensatorNumber = copy.ReferencedCompensatorNumber; + } + return *this; +} + + +void DRTRecordedCompensatorSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedCompensatorNumber.clear(); + CompensatorID.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTRecordedCompensatorSequence::Item::isEmpty() +{ + return ReferencedCompensatorNumber.isEmpty() && + CompensatorID.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTRecordedCompensatorSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRecordedCompensatorSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedCompensatorNumber, "1", "1", "RecordedCompensatorSequence"); + getAndCheckElementFromDataset(item, CompensatorID, "1", "3", "RecordedCompensatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RecordedCompensatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedCompensatorNumber), "1", "1", "RecordedCompensatorSequence"); + addElementToDataset(result, item, new DcmShortString(CompensatorID), "1", "3", "RecordedCompensatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RecordedCompensatorSequence"); + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRecordedCompensatorSequence::Item::getCompensatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CompensatorID, value, pos); +} + + +OFCondition DRTRecordedCompensatorSequence::Item::getReferencedCompensatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedCompensatorNumber, value, pos); +} + + +OFCondition DRTRecordedCompensatorSequence::Item::getReferencedCompensatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedCompensatorNumber).getSint32(value, pos); +} + + +OFCondition DRTRecordedCompensatorSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::Item::setCompensatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CompensatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::Item::setReferencedCompensatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedCompensatorNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRecordedCompensatorSequence::DRTRecordedCompensatorSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRecordedCompensatorSequence::DRTRecordedCompensatorSequence(const DRTRecordedCompensatorSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRecordedCompensatorSequence &DRTRecordedCompensatorSequence::operator=(const DRTRecordedCompensatorSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRecordedCompensatorSequence::~DRTRecordedCompensatorSequence() +{ + clear(); +} + + +void DRTRecordedCompensatorSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRecordedCompensatorSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRecordedCompensatorSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRecordedCompensatorSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRecordedCompensatorSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRecordedCompensatorSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRecordedCompensatorSequence::Item &DRTRecordedCompensatorSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRecordedCompensatorSequence::Item &DRTRecordedCompensatorSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRecordedCompensatorSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRecordedCompensatorSequence::Item &DRTRecordedCompensatorSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRecordedCompensatorSequence::Item &DRTRecordedCompensatorSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRecordedCompensatorSequence::Item &DRTRecordedCompensatorSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRecordedCompensatorSequence::Item &DRTRecordedCompensatorSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRecordedCompensatorSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RecordedCompensatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RecordedCompensatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRecordedCompensatorSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RecordedCompensatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrcps.cc b/dcmrt/libsrc/drtrcps.cc new file mode 100644 index 00000000..27460802 --- /dev/null +++ b/dcmrt/libsrc/drtrcps.cc @@ -0,0 +1,591 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedControlPointSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrcps.h" + + +// --- item class --- + +DRTReferencedControlPointSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedStartControlPointIndex(DCM_ReferencedStartControlPointIndex), + ReferencedStopControlPointIndex(DCM_ReferencedStopControlPointIndex) +{ +} + + +DRTReferencedControlPointSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedStartControlPointIndex(copy.ReferencedStartControlPointIndex), + ReferencedStopControlPointIndex(copy.ReferencedStopControlPointIndex) +{ +} + + +DRTReferencedControlPointSequence::Item::~Item() +{ +} + + +DRTReferencedControlPointSequence::Item &DRTReferencedControlPointSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedStartControlPointIndex = copy.ReferencedStartControlPointIndex; + ReferencedStopControlPointIndex = copy.ReferencedStopControlPointIndex; + } + return *this; +} + + +void DRTReferencedControlPointSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedStartControlPointIndex.clear(); + ReferencedStopControlPointIndex.clear(); + } +} + + +OFBool DRTReferencedControlPointSequence::Item::isEmpty() +{ + return ReferencedStartControlPointIndex.isEmpty() && + ReferencedStopControlPointIndex.isEmpty(); +} + + +OFBool DRTReferencedControlPointSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedControlPointSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedStartControlPointIndex, "1", "1", "ReferencedControlPointSequence"); + getAndCheckElementFromDataset(item, ReferencedStopControlPointIndex, "1", "1", "ReferencedControlPointSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedStartControlPointIndex), "1", "1", "ReferencedControlPointSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedStopControlPointIndex), "1", "1", "ReferencedControlPointSequence"); + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::Item::getReferencedStartControlPointIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedStartControlPointIndex, value, pos); +} + + +OFCondition DRTReferencedControlPointSequence::Item::getReferencedStartControlPointIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedStartControlPointIndex).getSint32(value, pos); +} + + +OFCondition DRTReferencedControlPointSequence::Item::getReferencedStopControlPointIndex(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedStopControlPointIndex, value, pos); +} + + +OFCondition DRTReferencedControlPointSequence::Item::getReferencedStopControlPointIndex(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedStopControlPointIndex).getSint32(value, pos); +} + + +OFCondition DRTReferencedControlPointSequence::Item::setReferencedStartControlPointIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedStartControlPointIndex.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::Item::setReferencedStopControlPointIndex(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedStopControlPointIndex.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedControlPointSequence::DRTReferencedControlPointSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedControlPointSequence::DRTReferencedControlPointSequence(const DRTReferencedControlPointSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedControlPointSequence &DRTReferencedControlPointSequence::operator=(const DRTReferencedControlPointSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedControlPointSequence::~DRTReferencedControlPointSequence() +{ + clear(); +} + + +void DRTReferencedControlPointSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedControlPointSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedControlPointSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedControlPointSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedControlPointSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedControlPointSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedControlPointSequence::Item &DRTReferencedControlPointSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedControlPointSequence::Item &DRTReferencedControlPointSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedControlPointSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedControlPointSequence::Item &DRTReferencedControlPointSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedControlPointSequence::Item &DRTReferencedControlPointSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedControlPointSequence::Item &DRTReferencedControlPointSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedControlPointSequence::Item &DRTReferencedControlPointSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedControlPointSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedControlPointSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedControlPointSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedControlPointSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedControlPointSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrcs.cc b/dcmrt/libsrc/drtrcs.cc new file mode 100644 index 00000000..80ac010f --- /dev/null +++ b/dcmrt/libsrc/drtrcs.cc @@ -0,0 +1,648 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTROIContourSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrcs.h" + + +// --- item class --- + +DRTROIContourSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ContourSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ROIDisplayColor(DCM_ROIDisplayColor), + RecommendedDisplayCIELabValue(DCM_RecommendedDisplayCIELabValue), + RecommendedDisplayGrayscaleValue(DCM_RecommendedDisplayGrayscaleValue), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTROIContourSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ContourSequence(copy.ContourSequence), + ROIDisplayColor(copy.ROIDisplayColor), + RecommendedDisplayCIELabValue(copy.RecommendedDisplayCIELabValue), + RecommendedDisplayGrayscaleValue(copy.RecommendedDisplayGrayscaleValue), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTROIContourSequence::Item::~Item() +{ +} + + +DRTROIContourSequence::Item &DRTROIContourSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ContourSequence = copy.ContourSequence; + ROIDisplayColor = copy.ROIDisplayColor; + RecommendedDisplayCIELabValue = copy.RecommendedDisplayCIELabValue; + RecommendedDisplayGrayscaleValue = copy.RecommendedDisplayGrayscaleValue; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTROIContourSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedROINumber.clear(); + ROIDisplayColor.clear(); + RecommendedDisplayGrayscaleValue.clear(); + RecommendedDisplayCIELabValue.clear(); + ContourSequence.clear(); + } +} + + +OFBool DRTROIContourSequence::Item::isEmpty() +{ + return ReferencedROINumber.isEmpty() && + ROIDisplayColor.isEmpty() && + RecommendedDisplayGrayscaleValue.isEmpty() && + RecommendedDisplayCIELabValue.isEmpty() && + ContourSequence.isEmpty(); +} + + +OFBool DRTROIContourSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTROIContourSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "ROIContourSequence"); + getAndCheckElementFromDataset(item, ROIDisplayColor, "3", "3", "ROIContourSequence"); + getAndCheckElementFromDataset(item, RecommendedDisplayGrayscaleValue, "1", "3", "ROIContourSequence"); + getAndCheckElementFromDataset(item, RecommendedDisplayCIELabValue, "3", "3", "ROIContourSequence"); + ContourSequence.read(item, "1-n", "3", "ROIContourSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIContourSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "ROIContourSequence"); + addElementToDataset(result, item, new DcmIntegerString(ROIDisplayColor), "3", "3", "ROIContourSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(RecommendedDisplayGrayscaleValue), "1", "3", "ROIContourSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(RecommendedDisplayCIELabValue), "3", "3", "ROIContourSequence"); + if (result.good()) result = ContourSequence.write(item, "1-n", "3", "ROIContourSequence"); + } + return result; +} + + +OFCondition DRTROIContourSequence::Item::getROIDisplayColor(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIDisplayColor, value, pos); +} + + +OFCondition DRTROIContourSequence::Item::getROIDisplayColor(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ROIDisplayColor).getSint32(value, pos); +} + + +OFCondition DRTROIContourSequence::Item::getRecommendedDisplayCIELabValue(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, RecommendedDisplayCIELabValue).getUint16(value, pos); +} + + +OFCondition DRTROIContourSequence::Item::getRecommendedDisplayGrayscaleValue(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, RecommendedDisplayGrayscaleValue).getUint16(value, pos); +} + + +OFCondition DRTROIContourSequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTROIContourSequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTROIContourSequence::Item::setROIDisplayColor(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "3") : EC_Normal; + if (result.good()) + result = ROIDisplayColor.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTROIContourSequence::Item::setRecommendedDisplayCIELabValue(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RecommendedDisplayCIELabValue.putUint16(value, pos); +} + + +OFCondition DRTROIContourSequence::Item::setRecommendedDisplayGrayscaleValue(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RecommendedDisplayGrayscaleValue.putUint16(value, pos); +} + + +OFCondition DRTROIContourSequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTROIContourSequence::DRTROIContourSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTROIContourSequence::DRTROIContourSequence(const DRTROIContourSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTROIContourSequence &DRTROIContourSequence::operator=(const DRTROIContourSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTROIContourSequence::~DRTROIContourSequence() +{ + clear(); +} + + +void DRTROIContourSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTROIContourSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTROIContourSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTROIContourSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTROIContourSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIContourSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIContourSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIContourSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIContourSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTROIContourSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTROIContourSequence::Item &DRTROIContourSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTROIContourSequence::Item &DRTROIContourSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTROIContourSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTROIContourSequence::Item &DRTROIContourSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTROIContourSequence::Item &DRTROIContourSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTROIContourSequence::Item &DRTROIContourSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTROIContourSequence::Item &DRTROIContourSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTROIContourSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTROIContourSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTROIContourSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIContourSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ROIContourSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ROIContourSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTROIContourSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ROIContourSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrdros.cc b/dcmrt/libsrc/drtrdros.cc new file mode 100644 index 00000000..34a99d9a --- /dev/null +++ b/dcmrt/libsrc/drtrdros.cc @@ -0,0 +1,620 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRTDoseROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrdros.h" + + +// --- item class --- + +DRTRTDoseROISequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DoseUnits(DCM_DoseUnits), + DoseValue(DCM_DoseValue), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTRTDoseROISequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DoseUnits(copy.DoseUnits), + DoseValue(copy.DoseValue), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTRTDoseROISequence::Item::~Item() +{ +} + + +DRTRTDoseROISequence::Item &DRTRTDoseROISequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DoseUnits = copy.DoseUnits; + DoseValue = copy.DoseValue; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTRTDoseROISequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedROINumber.clear(); + DoseUnits.clear(); + DoseValue.clear(); + } +} + + +OFBool DRTRTDoseROISequence::Item::isEmpty() +{ + return ReferencedROINumber.isEmpty() && + DoseUnits.isEmpty() && + DoseValue.isEmpty(); +} + + +OFBool DRTRTDoseROISequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRTDoseROISequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "RTDoseROISequence"); + getAndCheckElementFromDataset(item, DoseUnits, "1", "1", "RTDoseROISequence"); + getAndCheckElementFromDataset(item, DoseValue, "1", "1", "RTDoseROISequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTDoseROISequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "RTDoseROISequence"); + addElementToDataset(result, item, new DcmCodeString(DoseUnits), "1", "1", "RTDoseROISequence"); + addElementToDataset(result, item, new DcmDecimalString(DoseValue), "1", "1", "RTDoseROISequence"); + } + return result; +} + + +OFCondition DRTRTDoseROISequence::Item::getDoseUnits(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseUnits, value, pos); +} + + +OFCondition DRTRTDoseROISequence::Item::getDoseValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseValue, value, pos); +} + + +OFCondition DRTRTDoseROISequence::Item::getDoseValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DoseValue).getFloat64(value, pos); +} + + +OFCondition DRTRTDoseROISequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTRTDoseROISequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTRTDoseROISequence::Item::setDoseUnits(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseUnits.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTDoseROISequence::Item::setDoseValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTDoseROISequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRTDoseROISequence::DRTRTDoseROISequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRTDoseROISequence::DRTRTDoseROISequence(const DRTRTDoseROISequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRTDoseROISequence &DRTRTDoseROISequence::operator=(const DRTRTDoseROISequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRTDoseROISequence::~DRTRTDoseROISequence() +{ + clear(); +} + + +void DRTRTDoseROISequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRTDoseROISequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRTDoseROISequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRTDoseROISequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRTDoseROISequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTDoseROISequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTDoseROISequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTDoseROISequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTDoseROISequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRTDoseROISequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRTDoseROISequence::Item &DRTRTDoseROISequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRTDoseROISequence::Item &DRTRTDoseROISequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRTDoseROISequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRTDoseROISequence::Item &DRTRTDoseROISequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRTDoseROISequence::Item &DRTRTDoseROISequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRTDoseROISequence::Item &DRTRTDoseROISequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRTDoseROISequence::Item &DRTRTDoseROISequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRTDoseROISequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRTDoseROISequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRTDoseROISequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTDoseROISequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RTDoseROISequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RTDoseROISequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRTDoseROISequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RTDoseROISequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrdrs1.cc b/dcmrt/libsrc/drtrdrs1.cc new file mode 100644 index 00000000..8d5e3181 --- /dev/null +++ b/dcmrt/libsrc/drtrdrs1.cc @@ -0,0 +1,589 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedDoseReferenceSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrdrs1.h" + + +// --- item class --- + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamDoseVerificationControlPointSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DepthValueAveragingFlag(DCM_DepthValueAveragingFlag), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamDoseVerificationControlPointSequence(copy.BeamDoseVerificationControlPointSequence), + DepthValueAveragingFlag(copy.DepthValueAveragingFlag), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::~Item() +{ +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamDoseVerificationControlPointSequence = copy.BeamDoseVerificationControlPointSequence; + DepthValueAveragingFlag = copy.DepthValueAveragingFlag; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + DepthValueAveragingFlag.clear(); + BeamDoseVerificationControlPointSequence.clear(); + } +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + DepthValueAveragingFlag.isEmpty() && + BeamDoseVerificationControlPointSequence.isEmpty(); +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, DepthValueAveragingFlag, "1", "1C", "ReferencedDoseReferenceSequence"); + BeamDoseVerificationControlPointSequence.read(item, "1-n", "1", "ReferencedDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmCodeString(DepthValueAveragingFlag), "1", "1C", "ReferencedDoseReferenceSequence"); + if (result.good()) result = BeamDoseVerificationControlPointSequence.write(item, "1-n", "1", "ReferencedDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::getDepthValueAveragingFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DepthValueAveragingFlag, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::setDepthValueAveragingFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DepthValueAveragingFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::DRTReferencedDoseReferenceSequenceInRTBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::DRTReferencedDoseReferenceSequenceInRTBeamsModule(const DRTReferencedDoseReferenceSequenceInRTBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule &DRTReferencedDoseReferenceSequenceInRTBeamsModule::operator=(const DRTReferencedDoseReferenceSequenceInRTBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::~DRTReferencedDoseReferenceSequenceInRTBeamsModule() +{ + clear(); +} + + +void DRTReferencedDoseReferenceSequenceInRTBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedDoseReferenceSequenceInRTBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedDoseReferenceSequenceInRTBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrdrs6.cc b/dcmrt/libsrc/drtrdrs6.cc new file mode 100644 index 00000000..0904f47b --- /dev/null +++ b/dcmrt/libsrc/drtrdrs6.cc @@ -0,0 +1,591 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedDoseReferenceSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrdrs6.h" + + +// --- item class --- + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CumulativeDoseReferenceCoefficient(DCM_CumulativeDoseReferenceCoefficient), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CumulativeDoseReferenceCoefficient(copy.CumulativeDoseReferenceCoefficient), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CumulativeDoseReferenceCoefficient = copy.CumulativeDoseReferenceCoefficient; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + CumulativeDoseReferenceCoefficient.clear(); + } +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + CumulativeDoseReferenceCoefficient.isEmpty(); +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CumulativeDoseReferenceCoefficient, "1", "2", "ReferencedDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(CumulativeDoseReferenceCoefficient), "1", "2", "ReferencedDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::getCumulativeDoseReferenceCoefficient(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeDoseReferenceCoefficient, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::getCumulativeDoseReferenceCoefficient(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeDoseReferenceCoefficient).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::setCumulativeDoseReferenceCoefficient(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeDoseReferenceCoefficient.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::DRTReferencedDoseReferenceSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::DRTReferencedDoseReferenceSequenceInRTIonBeamsModule(const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::operator=(const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::~DRTReferencedDoseReferenceSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::Item &DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrdrs8.cc b/dcmrt/libsrc/drtrdrs8.cc new file mode 100644 index 00000000..7b7cba12 --- /dev/null +++ b/dcmrt/libsrc/drtrdrs8.cc @@ -0,0 +1,971 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrdrs8.h" + + +// --- item class --- + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ConstraintWeight(DCM_ConstraintWeight), + DeliveryMaximumDose(DCM_DeliveryMaximumDose), + DeliveryWarningDose(DCM_DeliveryWarningDose), + OrganAtRiskFullVolumeDose(DCM_OrganAtRiskFullVolumeDose), + OrganAtRiskLimitDose(DCM_OrganAtRiskLimitDose), + OrganAtRiskMaximumDose(DCM_OrganAtRiskMaximumDose), + OrganAtRiskOverdoseVolumeFraction(DCM_OrganAtRiskOverdoseVolumeFraction), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber), + TargetMaximumDose(DCM_TargetMaximumDose), + TargetMinimumDose(DCM_TargetMinimumDose), + TargetPrescriptionDose(DCM_TargetPrescriptionDose), + TargetUnderdoseVolumeFraction(DCM_TargetUnderdoseVolumeFraction) +{ +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ConstraintWeight(copy.ConstraintWeight), + DeliveryMaximumDose(copy.DeliveryMaximumDose), + DeliveryWarningDose(copy.DeliveryWarningDose), + OrganAtRiskFullVolumeDose(copy.OrganAtRiskFullVolumeDose), + OrganAtRiskLimitDose(copy.OrganAtRiskLimitDose), + OrganAtRiskMaximumDose(copy.OrganAtRiskMaximumDose), + OrganAtRiskOverdoseVolumeFraction(copy.OrganAtRiskOverdoseVolumeFraction), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber), + TargetMaximumDose(copy.TargetMaximumDose), + TargetMinimumDose(copy.TargetMinimumDose), + TargetPrescriptionDose(copy.TargetPrescriptionDose), + TargetUnderdoseVolumeFraction(copy.TargetUnderdoseVolumeFraction) +{ +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::~Item() +{ +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ConstraintWeight = copy.ConstraintWeight; + DeliveryMaximumDose = copy.DeliveryMaximumDose; + DeliveryWarningDose = copy.DeliveryWarningDose; + OrganAtRiskFullVolumeDose = copy.OrganAtRiskFullVolumeDose; + OrganAtRiskLimitDose = copy.OrganAtRiskLimitDose; + OrganAtRiskMaximumDose = copy.OrganAtRiskMaximumDose; + OrganAtRiskOverdoseVolumeFraction = copy.OrganAtRiskOverdoseVolumeFraction; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + TargetMaximumDose = copy.TargetMaximumDose; + TargetMinimumDose = copy.TargetMinimumDose; + TargetPrescriptionDose = copy.TargetPrescriptionDose; + TargetUnderdoseVolumeFraction = copy.TargetUnderdoseVolumeFraction; + } + return *this; +} + + +void DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + ConstraintWeight.clear(); + DeliveryWarningDose.clear(); + DeliveryMaximumDose.clear(); + TargetMinimumDose.clear(); + TargetPrescriptionDose.clear(); + TargetMaximumDose.clear(); + TargetUnderdoseVolumeFraction.clear(); + OrganAtRiskFullVolumeDose.clear(); + OrganAtRiskLimitDose.clear(); + OrganAtRiskMaximumDose.clear(); + OrganAtRiskOverdoseVolumeFraction.clear(); + } +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + ConstraintWeight.isEmpty() && + DeliveryWarningDose.isEmpty() && + DeliveryMaximumDose.isEmpty() && + TargetMinimumDose.isEmpty() && + TargetPrescriptionDose.isEmpty() && + TargetMaximumDose.isEmpty() && + TargetUnderdoseVolumeFraction.isEmpty() && + OrganAtRiskFullVolumeDose.isEmpty() && + OrganAtRiskLimitDose.isEmpty() && + OrganAtRiskMaximumDose.isEmpty() && + OrganAtRiskOverdoseVolumeFraction.isEmpty(); +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, ConstraintWeight, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, DeliveryWarningDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, DeliveryMaximumDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetMinimumDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetPrescriptionDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetMaximumDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, TargetUnderdoseVolumeFraction, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskFullVolumeDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskLimitDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskMaximumDose, "1", "3", "ReferencedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, OrganAtRiskOverdoseVolumeFraction, "1", "3", "ReferencedDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(ConstraintWeight), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveryWarningDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveryMaximumDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetMinimumDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetPrescriptionDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetMaximumDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(TargetUnderdoseVolumeFraction), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskFullVolumeDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskLimitDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskMaximumDose), "1", "3", "ReferencedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(OrganAtRiskOverdoseVolumeFraction), "1", "3", "ReferencedDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getConstraintWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ConstraintWeight, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getConstraintWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ConstraintWeight).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getDeliveryMaximumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveryMaximumDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getDeliveryMaximumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveryMaximumDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getDeliveryWarningDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveryWarningDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getDeliveryWarningDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveryWarningDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskFullVolumeDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskFullVolumeDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskFullVolumeDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskFullVolumeDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskLimitDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskLimitDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskLimitDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskLimitDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskMaximumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskMaximumDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskMaximumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskMaximumDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskOverdoseVolumeFraction(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(OrganAtRiskOverdoseVolumeFraction, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getOrganAtRiskOverdoseVolumeFraction(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, OrganAtRiskOverdoseVolumeFraction).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetMaximumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetMaximumDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetMaximumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetMaximumDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetMinimumDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetMinimumDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetMinimumDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetMinimumDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetPrescriptionDose(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetPrescriptionDose, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetPrescriptionDose(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetPrescriptionDose).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetUnderdoseVolumeFraction(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TargetUnderdoseVolumeFraction, value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::getTargetUnderdoseVolumeFraction(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TargetUnderdoseVolumeFraction).getFloat64(value, pos); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setConstraintWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ConstraintWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setDeliveryMaximumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveryMaximumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setDeliveryWarningDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveryWarningDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setOrganAtRiskFullVolumeDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskFullVolumeDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setOrganAtRiskLimitDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskLimitDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setOrganAtRiskMaximumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskMaximumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setOrganAtRiskOverdoseVolumeFraction(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OrganAtRiskOverdoseVolumeFraction.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setTargetMaximumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetMaximumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setTargetMinimumDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetMinimumDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setTargetPrescriptionDose(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetPrescriptionDose.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item::setTargetUnderdoseVolumeFraction(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TargetUnderdoseVolumeFraction.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule(const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::operator=(const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::~DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule() +{ + clear(); +} + + +void DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::Item &DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedDoseReferenceSequenceInRTFractionSchemeModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrds.cc b/dcmrt/libsrc/drtrds.cc new file mode 100644 index 00000000..2fcb68bd --- /dev/null +++ b/dcmrt/libsrc/drtrds.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedDoseSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrds.h" + + +// --- item class --- + +DRTReferencedDoseSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedDoseSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedDoseSequence::Item::~Item() +{ +} + + +DRTReferencedDoseSequence::Item &DRTReferencedDoseSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedDoseSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedDoseSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedDoseSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedDoseSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedDoseSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedDoseSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedDoseSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedDoseSequence"); + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedDoseSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedDoseSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedDoseSequence::DRTReferencedDoseSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedDoseSequence::DRTReferencedDoseSequence(const DRTReferencedDoseSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedDoseSequence &DRTReferencedDoseSequence::operator=(const DRTReferencedDoseSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedDoseSequence::~DRTReferencedDoseSequence() +{ + clear(); +} + + +void DRTReferencedDoseSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedDoseSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedDoseSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedDoseSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedDoseSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedDoseSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedDoseSequence::Item &DRTReferencedDoseSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedDoseSequence::Item &DRTReferencedDoseSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedDoseSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedDoseSequence::Item &DRTReferencedDoseSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedDoseSequence::Item &DRTReferencedDoseSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedDoseSequence::Item &DRTReferencedDoseSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedDoseSequence::Item &DRTReferencedDoseSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedDoseSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedDoseSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedDoseSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedDoseSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedDoseSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrecs.cc b/dcmrt/libsrc/drtrecs.cc new file mode 100644 index 00000000..2707b2b1 --- /dev/null +++ b/dcmrt/libsrc/drtrecs.cc @@ -0,0 +1,565 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTROIElementalCompositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrecs.h" + + +// --- item class --- + +DRTROIElementalCompositionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ROIElementalCompositionAtomicMassFraction(DCM_ROIElementalCompositionAtomicMassFraction), + ROIElementalCompositionAtomicNumber(DCM_ROIElementalCompositionAtomicNumber) +{ +} + + +DRTROIElementalCompositionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ROIElementalCompositionAtomicMassFraction(copy.ROIElementalCompositionAtomicMassFraction), + ROIElementalCompositionAtomicNumber(copy.ROIElementalCompositionAtomicNumber) +{ +} + + +DRTROIElementalCompositionSequence::Item::~Item() +{ +} + + +DRTROIElementalCompositionSequence::Item &DRTROIElementalCompositionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ROIElementalCompositionAtomicMassFraction = copy.ROIElementalCompositionAtomicMassFraction; + ROIElementalCompositionAtomicNumber = copy.ROIElementalCompositionAtomicNumber; + } + return *this; +} + + +void DRTROIElementalCompositionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ROIElementalCompositionAtomicNumber.clear(); + ROIElementalCompositionAtomicMassFraction.clear(); + } +} + + +OFBool DRTROIElementalCompositionSequence::Item::isEmpty() +{ + return ROIElementalCompositionAtomicNumber.isEmpty() && + ROIElementalCompositionAtomicMassFraction.isEmpty(); +} + + +OFBool DRTROIElementalCompositionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTROIElementalCompositionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ROIElementalCompositionAtomicNumber, "1", "1", "ROIElementalCompositionSequence"); + getAndCheckElementFromDataset(item, ROIElementalCompositionAtomicMassFraction, "1", "1", "ROIElementalCompositionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(ROIElementalCompositionAtomicNumber), "1", "1", "ROIElementalCompositionSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(ROIElementalCompositionAtomicMassFraction), "1", "1", "ROIElementalCompositionSequence"); + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::Item::getROIElementalCompositionAtomicMassFraction(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, ROIElementalCompositionAtomicMassFraction).getFloat32(value, pos); +} + + +OFCondition DRTROIElementalCompositionSequence::Item::getROIElementalCompositionAtomicNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ROIElementalCompositionAtomicNumber).getUint16(value, pos); +} + + +OFCondition DRTROIElementalCompositionSequence::Item::setROIElementalCompositionAtomicMassFraction(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ROIElementalCompositionAtomicMassFraction.putFloat32(value, pos); +} + + +OFCondition DRTROIElementalCompositionSequence::Item::setROIElementalCompositionAtomicNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ROIElementalCompositionAtomicNumber.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTROIElementalCompositionSequence::DRTROIElementalCompositionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTROIElementalCompositionSequence::DRTROIElementalCompositionSequence(const DRTROIElementalCompositionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTROIElementalCompositionSequence &DRTROIElementalCompositionSequence::operator=(const DRTROIElementalCompositionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTROIElementalCompositionSequence::~DRTROIElementalCompositionSequence() +{ + clear(); +} + + +void DRTROIElementalCompositionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTROIElementalCompositionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTROIElementalCompositionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTROIElementalCompositionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTROIElementalCompositionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTROIElementalCompositionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTROIElementalCompositionSequence::Item &DRTROIElementalCompositionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTROIElementalCompositionSequence::Item &DRTROIElementalCompositionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTROIElementalCompositionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTROIElementalCompositionSequence::Item &DRTROIElementalCompositionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTROIElementalCompositionSequence::Item &DRTROIElementalCompositionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTROIElementalCompositionSequence::Item &DRTROIElementalCompositionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTROIElementalCompositionSequence::Item &DRTROIElementalCompositionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTROIElementalCompositionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ROIElementalCompositionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ROIElementalCompositionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTROIElementalCompositionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ROIElementalCompositionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrfgs.cc b/dcmrt/libsrc/drtrfgs.cc new file mode 100644 index 00000000..cb5cd4cc --- /dev/null +++ b/dcmrt/libsrc/drtrfgs.cc @@ -0,0 +1,567 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedFractionGroupSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrfgs.h" + + +// --- item class --- + +DRTReferencedFractionGroupSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedBeamSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedBrachyApplicationSetupSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedFractionGroupNumber(DCM_ReferencedFractionGroupNumber) +{ +} + + +DRTReferencedFractionGroupSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedBeamSequence(copy.ReferencedBeamSequence), + ReferencedBrachyApplicationSetupSequence(copy.ReferencedBrachyApplicationSetupSequence), + ReferencedFractionGroupNumber(copy.ReferencedFractionGroupNumber) +{ +} + + +DRTReferencedFractionGroupSequence::Item::~Item() +{ +} + + +DRTReferencedFractionGroupSequence::Item &DRTReferencedFractionGroupSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedBeamSequence = copy.ReferencedBeamSequence; + ReferencedBrachyApplicationSetupSequence = copy.ReferencedBrachyApplicationSetupSequence; + ReferencedFractionGroupNumber = copy.ReferencedFractionGroupNumber; + } + return *this; +} + + +void DRTReferencedFractionGroupSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedFractionGroupNumber.clear(); + ReferencedBeamSequence.clear(); + ReferencedBrachyApplicationSetupSequence.clear(); + } +} + + +OFBool DRTReferencedFractionGroupSequence::Item::isEmpty() +{ + return ReferencedFractionGroupNumber.isEmpty() && + ReferencedBeamSequence.isEmpty() && + ReferencedBrachyApplicationSetupSequence.isEmpty(); +} + + +OFBool DRTReferencedFractionGroupSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedFractionGroupSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedFractionGroupNumber, "1", "1", "ReferencedFractionGroupSequence"); + ReferencedBeamSequence.read(item, "1-n", "1C", "ReferencedFractionGroupSequence"); + ReferencedBrachyApplicationSetupSequence.read(item, "1-n", "1C", "ReferencedFractionGroupSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedFractionGroupNumber), "1", "1", "ReferencedFractionGroupSequence"); + if (result.good()) result = ReferencedBeamSequence.write(item, "1-n", "1C", "ReferencedFractionGroupSequence"); + if (result.good()) result = ReferencedBrachyApplicationSetupSequence.write(item, "1-n", "1C", "ReferencedFractionGroupSequence"); + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::Item::getReferencedFractionGroupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFractionGroupNumber, value, pos); +} + + +OFCondition DRTReferencedFractionGroupSequence::Item::getReferencedFractionGroupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFractionGroupNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedFractionGroupSequence::Item::setReferencedFractionGroupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedFractionGroupNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedFractionGroupSequence::DRTReferencedFractionGroupSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedFractionGroupSequence::DRTReferencedFractionGroupSequence(const DRTReferencedFractionGroupSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedFractionGroupSequence &DRTReferencedFractionGroupSequence::operator=(const DRTReferencedFractionGroupSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedFractionGroupSequence::~DRTReferencedFractionGroupSequence() +{ + clear(); +} + + +void DRTReferencedFractionGroupSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedFractionGroupSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedFractionGroupSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedFractionGroupSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedFractionGroupSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedFractionGroupSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedFractionGroupSequence::Item &DRTReferencedFractionGroupSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedFractionGroupSequence::Item &DRTReferencedFractionGroupSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedFractionGroupSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedFractionGroupSequence::Item &DRTReferencedFractionGroupSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedFractionGroupSequence::Item &DRTReferencedFractionGroupSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedFractionGroupSequence::Item &DRTReferencedFractionGroupSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedFractionGroupSequence::Item &DRTReferencedFractionGroupSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedFractionGroupSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedFractionGroupSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedFractionGroupSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedFractionGroupSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedFractionGroupSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrfors.cc b/dcmrt/libsrc/drtrfors.cc new file mode 100644 index 00000000..310864cc --- /dev/null +++ b/dcmrt/libsrc/drtrfors.cc @@ -0,0 +1,551 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedFrameOfReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrfors.h" + + +// --- item class --- + +DRTReferencedFrameOfReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + FrameOfReferenceUID(DCM_FrameOfReferenceUID), + RTReferencedStudySequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTReferencedFrameOfReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + FrameOfReferenceUID(copy.FrameOfReferenceUID), + RTReferencedStudySequence(copy.RTReferencedStudySequence) +{ +} + + +DRTReferencedFrameOfReferenceSequence::Item::~Item() +{ +} + + +DRTReferencedFrameOfReferenceSequence::Item &DRTReferencedFrameOfReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + FrameOfReferenceUID = copy.FrameOfReferenceUID; + RTReferencedStudySequence = copy.RTReferencedStudySequence; + } + return *this; +} + + +void DRTReferencedFrameOfReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + FrameOfReferenceUID.clear(); + RTReferencedStudySequence.clear(); + } +} + + +OFBool DRTReferencedFrameOfReferenceSequence::Item::isEmpty() +{ + return FrameOfReferenceUID.isEmpty() && + RTReferencedStudySequence.isEmpty(); +} + + +OFBool DRTReferencedFrameOfReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, FrameOfReferenceUID, "1", "1", "ReferencedFrameOfReferenceSequence"); + RTReferencedStudySequence.read(item, "1-n", "3", "ReferencedFrameOfReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(FrameOfReferenceUID), "1", "1", "ReferencedFrameOfReferenceSequence"); + if (result.good()) result = RTReferencedStudySequence.write(item, "1-n", "3", "ReferencedFrameOfReferenceSequence"); + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::Item::getFrameOfReferenceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FrameOfReferenceUID, value, pos); +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::Item::setFrameOfReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameOfReferenceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedFrameOfReferenceSequence::DRTReferencedFrameOfReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedFrameOfReferenceSequence::DRTReferencedFrameOfReferenceSequence(const DRTReferencedFrameOfReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedFrameOfReferenceSequence &DRTReferencedFrameOfReferenceSequence::operator=(const DRTReferencedFrameOfReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedFrameOfReferenceSequence::~DRTReferencedFrameOfReferenceSequence() +{ + clear(); +} + + +void DRTReferencedFrameOfReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedFrameOfReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedFrameOfReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedFrameOfReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedFrameOfReferenceSequence::Item &DRTReferencedFrameOfReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedFrameOfReferenceSequence::Item &DRTReferencedFrameOfReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedFrameOfReferenceSequence::Item &DRTReferencedFrameOfReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedFrameOfReferenceSequence::Item &DRTReferencedFrameOfReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedFrameOfReferenceSequence::Item &DRTReferencedFrameOfReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedFrameOfReferenceSequence::Item &DRTReferencedFrameOfReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedFrameOfReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedFrameOfReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedFrameOfReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedFrameOfReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrics.cc b/dcmrt/libsrc/drtrics.cc new file mode 100644 index 00000000..8ab3882e --- /dev/null +++ b/dcmrt/libsrc/drtrics.cc @@ -0,0 +1,964 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRTROIIdentificationCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrics.h" + + +// --- item class --- + +DRTRTROIIdentificationCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + SegmentedPropertyTypeModifierCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTRTROIIdentificationCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + SegmentedPropertyTypeModifierCodeSequence(copy.SegmentedPropertyTypeModifierCodeSequence), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTRTROIIdentificationCodeSequence::Item::~Item() +{ +} + + +DRTRTROIIdentificationCodeSequence::Item &DRTRTROIIdentificationCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + SegmentedPropertyTypeModifierCodeSequence = copy.SegmentedPropertyTypeModifierCodeSequence; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTRTROIIdentificationCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + SegmentedPropertyTypeModifierCodeSequence.clear(); + } +} + + +OFBool DRTRTROIIdentificationCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty() && + SegmentedPropertyTypeModifierCodeSequence.isEmpty(); +} + + +OFBool DRTRTROIIdentificationCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "RTROIIdentificationCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "RTROIIdentificationCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "RTROIIdentificationCodeSequence"); + SegmentedPropertyTypeModifierCodeSequence.read(item, "1-n", "3", "RTROIIdentificationCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "RTROIIdentificationCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "RTROIIdentificationCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "RTROIIdentificationCodeSequence"); + if (result.good()) result = SegmentedPropertyTypeModifierCodeSequence.write(item, "1-n", "3", "RTROIIdentificationCodeSequence"); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRTROIIdentificationCodeSequence::DRTRTROIIdentificationCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRTROIIdentificationCodeSequence::DRTRTROIIdentificationCodeSequence(const DRTRTROIIdentificationCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRTROIIdentificationCodeSequence &DRTRTROIIdentificationCodeSequence::operator=(const DRTRTROIIdentificationCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRTROIIdentificationCodeSequence::~DRTRTROIIdentificationCodeSequence() +{ + clear(); +} + + +void DRTRTROIIdentificationCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRTROIIdentificationCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRTROIIdentificationCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRTROIIdentificationCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRTROIIdentificationCodeSequence::Item &DRTRTROIIdentificationCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRTROIIdentificationCodeSequence::Item &DRTRTROIIdentificationCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRTROIIdentificationCodeSequence::Item &DRTRTROIIdentificationCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRTROIIdentificationCodeSequence::Item &DRTRTROIIdentificationCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRTROIIdentificationCodeSequence::Item &DRTRTROIIdentificationCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRTROIIdentificationCodeSequence::Item &DRTRTROIIdentificationCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRTROIIdentificationCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RTROIIdentificationCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RTROIIdentificationCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRTROIIdentificationCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RTROIIdentificationCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrims.cc b/dcmrt/libsrc/drtrims.cc new file mode 100644 index 00000000..52352afc --- /dev/null +++ b/dcmrt/libsrc/drtrims.cc @@ -0,0 +1,643 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrims.h" + + +// --- item class --- + +DRTReferencedImageSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + PurposeOfReferenceCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedFrameNumber(DCM_ReferencedFrameNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + ReferencedSegmentNumber(DCM_ReferencedSegmentNumber) +{ +} + + +DRTReferencedImageSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + PurposeOfReferenceCodeSequence(copy.PurposeOfReferenceCodeSequence), + ReferencedFrameNumber(copy.ReferencedFrameNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + ReferencedSegmentNumber(copy.ReferencedSegmentNumber) +{ +} + + +DRTReferencedImageSequence::Item::~Item() +{ +} + + +DRTReferencedImageSequence::Item &DRTReferencedImageSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + PurposeOfReferenceCodeSequence = copy.PurposeOfReferenceCodeSequence; + ReferencedFrameNumber = copy.ReferencedFrameNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + ReferencedSegmentNumber = copy.ReferencedSegmentNumber; + } + return *this; +} + + +void DRTReferencedImageSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferencedFrameNumber.clear(); + ReferencedSegmentNumber.clear(); + PurposeOfReferenceCodeSequence.clear(); + } +} + + +OFBool DRTReferencedImageSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferencedFrameNumber.isEmpty() && + ReferencedSegmentNumber.isEmpty() && + PurposeOfReferenceCodeSequence.isEmpty(); +} + + +OFBool DRTReferencedImageSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedImageSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedImageSequence"); + getAndCheckElementFromDataset(item, ReferencedFrameNumber, "1-n", "1C", "ReferencedImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSegmentNumber, "1-n", "1C", "ReferencedImageSequence"); + PurposeOfReferenceCodeSequence.read(item, "1-n", "3", "ReferencedImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedImageSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedFrameNumber), "1-n", "1C", "ReferencedImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(ReferencedSegmentNumber), "1-n", "1C", "ReferencedImageSequence"); + if (result.good()) result = PurposeOfReferenceCodeSequence.write(item, "1-n", "3", "ReferencedImageSequence"); + } + return result; +} + + +OFCondition DRTReferencedImageSequence::Item::getReferencedFrameNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameNumber, value, pos); +} + + +OFCondition DRTReferencedImageSequence::Item::getReferencedFrameNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFrameNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedImageSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedImageSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedImageSequence::Item::getReferencedSegmentNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ReferencedSegmentNumber).getUint16(value, pos); +} + + +OFCondition DRTReferencedImageSequence::Item::setReferencedFrameNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ReferencedFrameNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedImageSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedImageSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedImageSequence::Item::setReferencedSegmentNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ReferencedSegmentNumber.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTReferencedImageSequence::DRTReferencedImageSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedImageSequence::DRTReferencedImageSequence(const DRTReferencedImageSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedImageSequence &DRTReferencedImageSequence::operator=(const DRTReferencedImageSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedImageSequence::~DRTReferencedImageSequence() +{ + clear(); +} + + +void DRTReferencedImageSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedImageSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedImageSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedImageSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedImageSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedImageSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedImageSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedImageSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedImageSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedImageSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedImageSequence::Item &DRTReferencedImageSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedImageSequence::Item &DRTReferencedImageSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedImageSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedImageSequence::Item &DRTReferencedImageSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedImageSequence::Item &DRTReferencedImageSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedImageSequence::Item &DRTReferencedImageSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedImageSequence::Item &DRTReferencedImageSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedImageSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedImageSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedImageSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedImageSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedImageSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtris.cc b/dcmrt/libsrc/drtris.cc new file mode 100644 index 00000000..e3866568 --- /dev/null +++ b/dcmrt/libsrc/drtris.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedInstanceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtris.h" + + +// --- item class --- + +DRTReferencedInstanceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + PurposeOfReferenceCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedInstanceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + PurposeOfReferenceCodeSequence(copy.PurposeOfReferenceCodeSequence), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedInstanceSequence::Item::~Item() +{ +} + + +DRTReferencedInstanceSequence::Item &DRTReferencedInstanceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + PurposeOfReferenceCodeSequence = copy.PurposeOfReferenceCodeSequence; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedInstanceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + PurposeOfReferenceCodeSequence.clear(); + } +} + + +OFBool DRTReferencedInstanceSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + PurposeOfReferenceCodeSequence.isEmpty(); +} + + +OFBool DRTReferencedInstanceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedInstanceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedInstanceSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedInstanceSequence"); + PurposeOfReferenceCodeSequence.read(item, "1-n", "1", "ReferencedInstanceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedInstanceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedInstanceSequence"); + if (result.good()) result = PurposeOfReferenceCodeSequence.write(item, "1-n", "1", "ReferencedInstanceSequence"); + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedInstanceSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedInstanceSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedInstanceSequence::DRTReferencedInstanceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedInstanceSequence::DRTReferencedInstanceSequence(const DRTReferencedInstanceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedInstanceSequence &DRTReferencedInstanceSequence::operator=(const DRTReferencedInstanceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedInstanceSequence::~DRTReferencedInstanceSequence() +{ + clear(); +} + + +void DRTReferencedInstanceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedInstanceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedInstanceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedInstanceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedInstanceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedInstanceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedInstanceSequence::Item &DRTReferencedInstanceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedInstanceSequence::Item &DRTReferencedInstanceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedInstanceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedInstanceSequence::Item &DRTReferencedInstanceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedInstanceSequence::Item &DRTReferencedInstanceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedInstanceSequence::Item &DRTReferencedInstanceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedInstanceSequence::Item &DRTReferencedInstanceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedInstanceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedInstanceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedInstanceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedInstanceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedInstanceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrlsds.cc b/dcmrt/libsrc/drtrlsds.cc new file mode 100644 index 00000000..23eb33ec --- /dev/null +++ b/dcmrt/libsrc/drtrlsds.cc @@ -0,0 +1,611 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRecordedLateralSpreadingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrlsds.h" + + +// --- item class --- + +DRTRecordedLateralSpreadingDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + LateralSpreadingDeviceID(DCM_LateralSpreadingDeviceID), + ReferencedLateralSpreadingDeviceNumber(DCM_ReferencedLateralSpreadingDeviceNumber) +{ +} + + +DRTRecordedLateralSpreadingDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + LateralSpreadingDeviceID(copy.LateralSpreadingDeviceID), + ReferencedLateralSpreadingDeviceNumber(copy.ReferencedLateralSpreadingDeviceNumber) +{ +} + + +DRTRecordedLateralSpreadingDeviceSequence::Item::~Item() +{ +} + + +DRTRecordedLateralSpreadingDeviceSequence::Item &DRTRecordedLateralSpreadingDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + LateralSpreadingDeviceID = copy.LateralSpreadingDeviceID; + ReferencedLateralSpreadingDeviceNumber = copy.ReferencedLateralSpreadingDeviceNumber; + } + return *this; +} + + +void DRTRecordedLateralSpreadingDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedLateralSpreadingDeviceNumber.clear(); + LateralSpreadingDeviceID.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTRecordedLateralSpreadingDeviceSequence::Item::isEmpty() +{ + return ReferencedLateralSpreadingDeviceNumber.isEmpty() && + LateralSpreadingDeviceID.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTRecordedLateralSpreadingDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedLateralSpreadingDeviceNumber, "1", "1", "RecordedLateralSpreadingDeviceSequence"); + getAndCheckElementFromDataset(item, LateralSpreadingDeviceID, "1", "1", "RecordedLateralSpreadingDeviceSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RecordedLateralSpreadingDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedLateralSpreadingDeviceNumber), "1", "1", "RecordedLateralSpreadingDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(LateralSpreadingDeviceID), "1", "1", "RecordedLateralSpreadingDeviceSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RecordedLateralSpreadingDeviceSequence"); + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::getLateralSpreadingDeviceID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LateralSpreadingDeviceID, value, pos); +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::getReferencedLateralSpreadingDeviceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedLateralSpreadingDeviceNumber, value, pos); +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::getReferencedLateralSpreadingDeviceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedLateralSpreadingDeviceNumber).getSint32(value, pos); +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::setLateralSpreadingDeviceID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LateralSpreadingDeviceID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::Item::setReferencedLateralSpreadingDeviceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedLateralSpreadingDeviceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRecordedLateralSpreadingDeviceSequence::DRTRecordedLateralSpreadingDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRecordedLateralSpreadingDeviceSequence::DRTRecordedLateralSpreadingDeviceSequence(const DRTRecordedLateralSpreadingDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRecordedLateralSpreadingDeviceSequence &DRTRecordedLateralSpreadingDeviceSequence::operator=(const DRTRecordedLateralSpreadingDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRecordedLateralSpreadingDeviceSequence::~DRTRecordedLateralSpreadingDeviceSequence() +{ + clear(); +} + + +void DRTRecordedLateralSpreadingDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRecordedLateralSpreadingDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRecordedLateralSpreadingDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRecordedLateralSpreadingDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRecordedLateralSpreadingDeviceSequence::Item &DRTRecordedLateralSpreadingDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRecordedLateralSpreadingDeviceSequence::Item &DRTRecordedLateralSpreadingDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRecordedLateralSpreadingDeviceSequence::Item &DRTRecordedLateralSpreadingDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRecordedLateralSpreadingDeviceSequence::Item &DRTRecordedLateralSpreadingDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRecordedLateralSpreadingDeviceSequence::Item &DRTRecordedLateralSpreadingDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRecordedLateralSpreadingDeviceSequence::Item &DRTRecordedLateralSpreadingDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RecordedLateralSpreadingDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RecordedLateralSpreadingDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRecordedLateralSpreadingDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RecordedLateralSpreadingDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrmdrs.cc b/dcmrt/libsrc/drtrmdrs.cc new file mode 100644 index 00000000..85164684 --- /dev/null +++ b/dcmrt/libsrc/drtrmdrs.cc @@ -0,0 +1,629 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedMeasuredDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrmdrs.h" + + +// --- item class --- + +DRTReferencedMeasuredDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + MeasuredDoseValue(DCM_MeasuredDoseValue), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber), + ReferencedMeasuredDoseReferenceNumber(DCM_ReferencedMeasuredDoseReferenceNumber) +{ +} + + +DRTReferencedMeasuredDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + MeasuredDoseValue(copy.MeasuredDoseValue), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber), + ReferencedMeasuredDoseReferenceNumber(copy.ReferencedMeasuredDoseReferenceNumber) +{ +} + + +DRTReferencedMeasuredDoseReferenceSequence::Item::~Item() +{ +} + + +DRTReferencedMeasuredDoseReferenceSequence::Item &DRTReferencedMeasuredDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + MeasuredDoseValue = copy.MeasuredDoseValue; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + ReferencedMeasuredDoseReferenceNumber = copy.ReferencedMeasuredDoseReferenceNumber; + } + return *this; +} + + +void DRTReferencedMeasuredDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + ReferencedMeasuredDoseReferenceNumber.clear(); + MeasuredDoseValue.clear(); + } +} + + +OFBool DRTReferencedMeasuredDoseReferenceSequence::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + ReferencedMeasuredDoseReferenceNumber.isEmpty() && + MeasuredDoseValue.isEmpty(); +} + + +OFBool DRTReferencedMeasuredDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "1C", "ReferencedMeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, ReferencedMeasuredDoseReferenceNumber, "1", "1C", "ReferencedMeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, MeasuredDoseValue, "1", "1", "ReferencedMeasuredDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "1C", "ReferencedMeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedMeasuredDoseReferenceNumber), "1", "1C", "ReferencedMeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(MeasuredDoseValue), "1", "1", "ReferencedMeasuredDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::getMeasuredDoseValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MeasuredDoseValue, value, pos); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::getMeasuredDoseValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, MeasuredDoseValue).getFloat64(value, pos); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::getReferencedMeasuredDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedMeasuredDoseReferenceNumber, value, pos); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::getReferencedMeasuredDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedMeasuredDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::setMeasuredDoseValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredDoseValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::Item::setReferencedMeasuredDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedMeasuredDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedMeasuredDoseReferenceSequence::DRTReferencedMeasuredDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedMeasuredDoseReferenceSequence::DRTReferencedMeasuredDoseReferenceSequence(const DRTReferencedMeasuredDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedMeasuredDoseReferenceSequence &DRTReferencedMeasuredDoseReferenceSequence::operator=(const DRTReferencedMeasuredDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedMeasuredDoseReferenceSequence::~DRTReferencedMeasuredDoseReferenceSequence() +{ + clear(); +} + + +void DRTReferencedMeasuredDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedMeasuredDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedMeasuredDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedMeasuredDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedMeasuredDoseReferenceSequence::Item &DRTReferencedMeasuredDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedMeasuredDoseReferenceSequence::Item &DRTReferencedMeasuredDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedMeasuredDoseReferenceSequence::Item &DRTReferencedMeasuredDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedMeasuredDoseReferenceSequence::Item &DRTReferencedMeasuredDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedMeasuredDoseReferenceSequence::Item &DRTReferencedMeasuredDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedMeasuredDoseReferenceSequence::Item &DRTReferencedMeasuredDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedMeasuredDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedMeasuredDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedMeasuredDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedMeasuredDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrms.cc b/dcmrt/libsrc/drtrms.cc new file mode 100644 index 00000000..ec876c86 --- /dev/null +++ b/dcmrt/libsrc/drtrms.cc @@ -0,0 +1,698 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRangeModulatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrms.h" + + +// --- item class --- + +DRTRangeModulatorSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BeamCurrentModulationID(DCM_BeamCurrentModulationID), + RangeModulatorDescription(DCM_RangeModulatorDescription), + RangeModulatorID(DCM_RangeModulatorID), + RangeModulatorNumber(DCM_RangeModulatorNumber), + RangeModulatorType(DCM_RangeModulatorType) +{ +} + + +DRTRangeModulatorSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BeamCurrentModulationID(copy.BeamCurrentModulationID), + RangeModulatorDescription(copy.RangeModulatorDescription), + RangeModulatorID(copy.RangeModulatorID), + RangeModulatorNumber(copy.RangeModulatorNumber), + RangeModulatorType(copy.RangeModulatorType) +{ +} + + +DRTRangeModulatorSequence::Item::~Item() +{ +} + + +DRTRangeModulatorSequence::Item &DRTRangeModulatorSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BeamCurrentModulationID = copy.BeamCurrentModulationID; + RangeModulatorDescription = copy.RangeModulatorDescription; + RangeModulatorID = copy.RangeModulatorID; + RangeModulatorNumber = copy.RangeModulatorNumber; + RangeModulatorType = copy.RangeModulatorType; + } + return *this; +} + + +void DRTRangeModulatorSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RangeModulatorNumber.clear(); + RangeModulatorID.clear(); + AccessoryCode.clear(); + RangeModulatorType.clear(); + RangeModulatorDescription.clear(); + BeamCurrentModulationID.clear(); + } +} + + +OFBool DRTRangeModulatorSequence::Item::isEmpty() +{ + return RangeModulatorNumber.isEmpty() && + RangeModulatorID.isEmpty() && + AccessoryCode.isEmpty() && + RangeModulatorType.isEmpty() && + RangeModulatorDescription.isEmpty() && + BeamCurrentModulationID.isEmpty(); +} + + +OFBool DRTRangeModulatorSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRangeModulatorSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RangeModulatorNumber, "1", "1", "RangeModulatorSequence"); + getAndCheckElementFromDataset(item, RangeModulatorID, "1", "1", "RangeModulatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RangeModulatorSequence"); + getAndCheckElementFromDataset(item, RangeModulatorType, "1", "1", "RangeModulatorSequence"); + getAndCheckElementFromDataset(item, RangeModulatorDescription, "1", "3", "RangeModulatorSequence"); + getAndCheckElementFromDataset(item, BeamCurrentModulationID, "1", "1C", "RangeModulatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(RangeModulatorNumber), "1", "1", "RangeModulatorSequence"); + addElementToDataset(result, item, new DcmShortString(RangeModulatorID), "1", "1", "RangeModulatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RangeModulatorSequence"); + addElementToDataset(result, item, new DcmCodeString(RangeModulatorType), "1", "1", "RangeModulatorSequence"); + addElementToDataset(result, item, new DcmLongString(RangeModulatorDescription), "1", "3", "RangeModulatorSequence"); + addElementToDataset(result, item, new DcmShortString(BeamCurrentModulationID), "1", "1C", "RangeModulatorSequence"); + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRangeModulatorSequence::Item::getBeamCurrentModulationID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamCurrentModulationID, value, pos); +} + + +OFCondition DRTRangeModulatorSequence::Item::getRangeModulatorDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeModulatorDescription, value, pos); +} + + +OFCondition DRTRangeModulatorSequence::Item::getRangeModulatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeModulatorID, value, pos); +} + + +OFCondition DRTRangeModulatorSequence::Item::getRangeModulatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeModulatorNumber, value, pos); +} + + +OFCondition DRTRangeModulatorSequence::Item::getRangeModulatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, RangeModulatorNumber).getSint32(value, pos); +} + + +OFCondition DRTRangeModulatorSequence::Item::getRangeModulatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeModulatorType, value, pos); +} + + +OFCondition DRTRangeModulatorSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::Item::setBeamCurrentModulationID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamCurrentModulationID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::Item::setRangeModulatorDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeModulatorDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::Item::setRangeModulatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeModulatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::Item::setRangeModulatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeModulatorNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::Item::setRangeModulatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeModulatorType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRangeModulatorSequence::DRTRangeModulatorSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRangeModulatorSequence::DRTRangeModulatorSequence(const DRTRangeModulatorSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRangeModulatorSequence &DRTRangeModulatorSequence::operator=(const DRTRangeModulatorSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRangeModulatorSequence::~DRTRangeModulatorSequence() +{ + clear(); +} + + +void DRTRangeModulatorSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRangeModulatorSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRangeModulatorSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRangeModulatorSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRangeModulatorSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRangeModulatorSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRangeModulatorSequence::Item &DRTRangeModulatorSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRangeModulatorSequence::Item &DRTRangeModulatorSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRangeModulatorSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRangeModulatorSequence::Item &DRTRangeModulatorSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRangeModulatorSequence::Item &DRTRangeModulatorSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRangeModulatorSequence::Item &DRTRangeModulatorSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRangeModulatorSequence::Item &DRTRangeModulatorSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRangeModulatorSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RangeModulatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RangeModulatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRangeModulatorSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RangeModulatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrmss6.cc b/dcmrt/libsrc/drtrmss6.cc new file mode 100644 index 00000000..75636e32 --- /dev/null +++ b/dcmrt/libsrc/drtrmss6.cc @@ -0,0 +1,678 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRangeModulatorSettingsSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrmss6.h" + + +// --- item class --- + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + IsocenterToRangeModulatorDistance(DCM_IsocenterToRangeModulatorDistance), + RangeModulatorGatingStartValue(DCM_RangeModulatorGatingStartValue), + RangeModulatorGatingStartWaterEquivalentThickness(DCM_RangeModulatorGatingStartWaterEquivalentThickness), + RangeModulatorGatingStopValue(DCM_RangeModulatorGatingStopValue), + RangeModulatorGatingStopWaterEquivalentThickness(DCM_RangeModulatorGatingStopWaterEquivalentThickness), + ReferencedRangeModulatorNumber(DCM_ReferencedRangeModulatorNumber) +{ +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + IsocenterToRangeModulatorDistance(copy.IsocenterToRangeModulatorDistance), + RangeModulatorGatingStartValue(copy.RangeModulatorGatingStartValue), + RangeModulatorGatingStartWaterEquivalentThickness(copy.RangeModulatorGatingStartWaterEquivalentThickness), + RangeModulatorGatingStopValue(copy.RangeModulatorGatingStopValue), + RangeModulatorGatingStopWaterEquivalentThickness(copy.RangeModulatorGatingStopWaterEquivalentThickness), + ReferencedRangeModulatorNumber(copy.ReferencedRangeModulatorNumber) +{ +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + IsocenterToRangeModulatorDistance = copy.IsocenterToRangeModulatorDistance; + RangeModulatorGatingStartValue = copy.RangeModulatorGatingStartValue; + RangeModulatorGatingStartWaterEquivalentThickness = copy.RangeModulatorGatingStartWaterEquivalentThickness; + RangeModulatorGatingStopValue = copy.RangeModulatorGatingStopValue; + RangeModulatorGatingStopWaterEquivalentThickness = copy.RangeModulatorGatingStopWaterEquivalentThickness; + ReferencedRangeModulatorNumber = copy.ReferencedRangeModulatorNumber; + } + return *this; +} + + +void DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedRangeModulatorNumber.clear(); + RangeModulatorGatingStartValue.clear(); + RangeModulatorGatingStopValue.clear(); + RangeModulatorGatingStartWaterEquivalentThickness.clear(); + RangeModulatorGatingStopWaterEquivalentThickness.clear(); + IsocenterToRangeModulatorDistance.clear(); + } +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return ReferencedRangeModulatorNumber.isEmpty() && + RangeModulatorGatingStartValue.isEmpty() && + RangeModulatorGatingStopValue.isEmpty() && + RangeModulatorGatingStartWaterEquivalentThickness.isEmpty() && + RangeModulatorGatingStopWaterEquivalentThickness.isEmpty() && + IsocenterToRangeModulatorDistance.isEmpty(); +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedRangeModulatorNumber, "1", "1", "RangeModulatorSettingsSequence"); + getAndCheckElementFromDataset(item, RangeModulatorGatingStartValue, "1", "1C", "RangeModulatorSettingsSequence"); + getAndCheckElementFromDataset(item, RangeModulatorGatingStopValue, "1", "1C", "RangeModulatorSettingsSequence"); + getAndCheckElementFromDataset(item, RangeModulatorGatingStartWaterEquivalentThickness, "1", "3", "RangeModulatorSettingsSequence"); + getAndCheckElementFromDataset(item, RangeModulatorGatingStopWaterEquivalentThickness, "1", "3", "RangeModulatorSettingsSequence"); + getAndCheckElementFromDataset(item, IsocenterToRangeModulatorDistance, "1", "3", "RangeModulatorSettingsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedRangeModulatorNumber), "1", "1", "RangeModulatorSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(RangeModulatorGatingStartValue), "1", "1C", "RangeModulatorSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(RangeModulatorGatingStopValue), "1", "1C", "RangeModulatorSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(RangeModulatorGatingStartWaterEquivalentThickness), "1", "3", "RangeModulatorSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(RangeModulatorGatingStopWaterEquivalentThickness), "1", "3", "RangeModulatorSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToRangeModulatorDistance), "1", "3", "RangeModulatorSettingsSequence"); + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::getIsocenterToRangeModulatorDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToRangeModulatorDistance).getFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::getRangeModulatorGatingStartValue(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, RangeModulatorGatingStartValue).getFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::getRangeModulatorGatingStartWaterEquivalentThickness(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, RangeModulatorGatingStartWaterEquivalentThickness).getFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::getRangeModulatorGatingStopValue(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, RangeModulatorGatingStopValue).getFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::getRangeModulatorGatingStopWaterEquivalentThickness(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, RangeModulatorGatingStopWaterEquivalentThickness).getFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::getReferencedRangeModulatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedRangeModulatorNumber, value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::getReferencedRangeModulatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedRangeModulatorNumber).getSint32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::setIsocenterToRangeModulatorDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToRangeModulatorDistance.putFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::setRangeModulatorGatingStartValue(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RangeModulatorGatingStartValue.putFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::setRangeModulatorGatingStartWaterEquivalentThickness(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RangeModulatorGatingStartWaterEquivalentThickness.putFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::setRangeModulatorGatingStopValue(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RangeModulatorGatingStopValue.putFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::setRangeModulatorGatingStopWaterEquivalentThickness(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RangeModulatorGatingStopWaterEquivalentThickness.putFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item::setReferencedRangeModulatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedRangeModulatorNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::DRTRangeModulatorSettingsSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::DRTRangeModulatorSettingsSequenceInRTIonBeamsModule(const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::operator=(const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::~DRTRangeModulatorSettingsSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RangeModulatorSettingsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RangeModulatorSettingsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RangeModulatorSettingsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrmss7.cc b/dcmrt/libsrc/drtrmss7.cc new file mode 100644 index 00000000..f6422d6d --- /dev/null +++ b/dcmrt/libsrc/drtrmss7.cc @@ -0,0 +1,603 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrmss7.h" + + +// --- item class --- + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RangeModulatorGatingStartValue(DCM_RangeModulatorGatingStartValue), + RangeModulatorGatingStopValue(DCM_RangeModulatorGatingStopValue), + ReferencedRangeModulatorNumber(DCM_ReferencedRangeModulatorNumber) +{ +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RangeModulatorGatingStartValue(copy.RangeModulatorGatingStartValue), + RangeModulatorGatingStopValue(copy.RangeModulatorGatingStopValue), + ReferencedRangeModulatorNumber(copy.ReferencedRangeModulatorNumber) +{ +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::~Item() +{ +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RangeModulatorGatingStartValue = copy.RangeModulatorGatingStartValue; + RangeModulatorGatingStopValue = copy.RangeModulatorGatingStopValue; + ReferencedRangeModulatorNumber = copy.ReferencedRangeModulatorNumber; + } + return *this; +} + + +void DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedRangeModulatorNumber.clear(); + RangeModulatorGatingStartValue.clear(); + RangeModulatorGatingStopValue.clear(); + } +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::isEmpty() +{ + return ReferencedRangeModulatorNumber.isEmpty() && + RangeModulatorGatingStartValue.isEmpty() && + RangeModulatorGatingStopValue.isEmpty(); +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedRangeModulatorNumber, "1", "1", "RangeModulatorSettingsSequence"); + getAndCheckElementFromDataset(item, RangeModulatorGatingStartValue, "1", "1C", "RangeModulatorSettingsSequence"); + getAndCheckElementFromDataset(item, RangeModulatorGatingStopValue, "1", "1C", "RangeModulatorSettingsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedRangeModulatorNumber), "1", "1", "RangeModulatorSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(RangeModulatorGatingStartValue), "1", "1C", "RangeModulatorSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(RangeModulatorGatingStopValue), "1", "1C", "RangeModulatorSettingsSequence"); + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getRangeModulatorGatingStartValue(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, RangeModulatorGatingStartValue).getFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getRangeModulatorGatingStopValue(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, RangeModulatorGatingStopValue).getFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedRangeModulatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedRangeModulatorNumber, value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedRangeModulatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedRangeModulatorNumber).getSint32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::setRangeModulatorGatingStartValue(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RangeModulatorGatingStartValue.putFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::setRangeModulatorGatingStopValue(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RangeModulatorGatingStopValue.putFloat32(value, pos); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item::setReferencedRangeModulatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedRangeModulatorNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule(const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::operator=(const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::~DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule() +{ + clear(); +} + + +void DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RangeModulatorSettingsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RangeModulatorSettingsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RangeModulatorSettingsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrpcs.cc b/dcmrt/libsrc/drtrpcs.cc new file mode 100644 index 00000000..68d49a13 --- /dev/null +++ b/dcmrt/libsrc/drtrpcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRequestedProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrpcs.h" + + +// --- item class --- + +DRTRequestedProcedureCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTRequestedProcedureCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTRequestedProcedureCodeSequence::Item::~Item() +{ +} + + +DRTRequestedProcedureCodeSequence::Item &DRTRequestedProcedureCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTRequestedProcedureCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTRequestedProcedureCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTRequestedProcedureCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "RequestedProcedureCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "RequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "RequestedProcedureCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "RequestedProcedureCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "RequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "RequestedProcedureCodeSequence"); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRequestedProcedureCodeSequence::DRTRequestedProcedureCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRequestedProcedureCodeSequence::DRTRequestedProcedureCodeSequence(const DRTRequestedProcedureCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRequestedProcedureCodeSequence &DRTRequestedProcedureCodeSequence::operator=(const DRTRequestedProcedureCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRequestedProcedureCodeSequence::~DRTRequestedProcedureCodeSequence() +{ + clear(); +} + + +void DRTRequestedProcedureCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRequestedProcedureCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRequestedProcedureCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRequestedProcedureCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRequestedProcedureCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRequestedProcedureCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRequestedProcedureCodeSequence::Item &DRTRequestedProcedureCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRequestedProcedureCodeSequence::Item &DRTRequestedProcedureCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRequestedProcedureCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRequestedProcedureCodeSequence::Item &DRTRequestedProcedureCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRequestedProcedureCodeSequence::Item &DRTRequestedProcedureCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRequestedProcedureCodeSequence::Item &DRTRequestedProcedureCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRequestedProcedureCodeSequence::Item &DRTRequestedProcedureCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRequestedProcedureCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RequestedProcedureCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RequestedProcedureCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRequestedProcedureCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RequestedProcedureCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrpis.cc b/dcmrt/libsrc/drtrpis.cc new file mode 100644 index 00000000..34a5fc44 --- /dev/null +++ b/dcmrt/libsrc/drtrpis.cc @@ -0,0 +1,674 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferringPhysicianIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrpis.h" + + +// --- item class --- + +DRTReferringPhysicianIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + InstitutionName(DCM_InstitutionName), + PersonAddress(DCM_PersonAddress), + PersonIdentificationCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PersonTelecomInformation(DCM_PersonTelecomInformation), + PersonTelephoneNumbers(DCM_PersonTelephoneNumbers) +{ +} + + +DRTReferringPhysicianIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + InstitutionAddress(copy.InstitutionAddress), + InstitutionCodeSequence(copy.InstitutionCodeSequence), + InstitutionName(copy.InstitutionName), + PersonAddress(copy.PersonAddress), + PersonIdentificationCodeSequence(copy.PersonIdentificationCodeSequence), + PersonTelecomInformation(copy.PersonTelecomInformation), + PersonTelephoneNumbers(copy.PersonTelephoneNumbers) +{ +} + + +DRTReferringPhysicianIdentificationSequence::Item::~Item() +{ +} + + +DRTReferringPhysicianIdentificationSequence::Item &DRTReferringPhysicianIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + InstitutionAddress = copy.InstitutionAddress; + InstitutionCodeSequence = copy.InstitutionCodeSequence; + InstitutionName = copy.InstitutionName; + PersonAddress = copy.PersonAddress; + PersonIdentificationCodeSequence = copy.PersonIdentificationCodeSequence; + PersonTelecomInformation = copy.PersonTelecomInformation; + PersonTelephoneNumbers = copy.PersonTelephoneNumbers; + } + return *this; +} + + +void DRTReferringPhysicianIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PersonIdentificationCodeSequence.clear(); + PersonAddress.clear(); + PersonTelephoneNumbers.clear(); + PersonTelecomInformation.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionCodeSequence.clear(); + } +} + + +OFBool DRTReferringPhysicianIdentificationSequence::Item::isEmpty() +{ + return PersonIdentificationCodeSequence.isEmpty() && + PersonAddress.isEmpty() && + PersonTelephoneNumbers.isEmpty() && + PersonTelecomInformation.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionCodeSequence.isEmpty(); +} + + +OFBool DRTReferringPhysicianIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + PersonIdentificationCodeSequence.read(item, "1-n", "1", "ReferringPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonAddress, "1", "3", "ReferringPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelephoneNumbers, "1-n", "3", "ReferringPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, PersonTelecomInformation, "1", "3", "ReferringPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "1C", "ReferringPhysicianIdentificationSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "ReferringPhysicianIdentificationSequence"); + InstitutionCodeSequence.read(item, "1-n", "1C", "ReferringPhysicianIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + if (result.good()) result = PersonIdentificationCodeSequence.write(item, "1-n", "1", "ReferringPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(PersonAddress), "1", "3", "ReferringPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(PersonTelephoneNumbers), "1-n", "3", "ReferringPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmLongText(PersonTelecomInformation), "1", "3", "ReferringPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "1C", "ReferringPhysicianIdentificationSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "ReferringPhysicianIdentificationSequence"); + if (result.good()) result = InstitutionCodeSequence.write(item, "1-n", "1C", "ReferringPhysicianIdentificationSequence"); + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::getPersonAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonAddress, value, pos); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::getPersonTelecomInformation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelecomInformation, value, pos); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::getPersonTelephoneNumbers(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PersonTelephoneNumbers, value, pos); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::setPersonAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::setPersonTelecomInformation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PersonTelecomInformation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::Item::setPersonTelephoneNumbers(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PersonTelephoneNumbers.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferringPhysicianIdentificationSequence::DRTReferringPhysicianIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferringPhysicianIdentificationSequence::DRTReferringPhysicianIdentificationSequence(const DRTReferringPhysicianIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferringPhysicianIdentificationSequence &DRTReferringPhysicianIdentificationSequence::operator=(const DRTReferringPhysicianIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferringPhysicianIdentificationSequence::~DRTReferringPhysicianIdentificationSequence() +{ + clear(); +} + + +void DRTReferringPhysicianIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferringPhysicianIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferringPhysicianIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferringPhysicianIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferringPhysicianIdentificationSequence::Item &DRTReferringPhysicianIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferringPhysicianIdentificationSequence::Item &DRTReferringPhysicianIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferringPhysicianIdentificationSequence::Item &DRTReferringPhysicianIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferringPhysicianIdentificationSequence::Item &DRTReferringPhysicianIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferringPhysicianIdentificationSequence::Item &DRTReferringPhysicianIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferringPhysicianIdentificationSequence::Item &DRTReferringPhysicianIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferringPhysicianIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferringPhysicianIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferringPhysicianIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferringPhysicianIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrppcs.cc b/dcmrt/libsrc/drtrppcs.cc new file mode 100644 index 00000000..e8a021bf --- /dev/null +++ b/dcmrt/libsrc/drtrppcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReasonForPerformedProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrppcs.h" + + +// --- item class --- + +DRTReasonForPerformedProcedureCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTReasonForPerformedProcedureCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTReasonForPerformedProcedureCodeSequence::Item::~Item() +{ +} + + +DRTReasonForPerformedProcedureCodeSequence::Item &DRTReasonForPerformedProcedureCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTReasonForPerformedProcedureCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTReasonForPerformedProcedureCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTReasonForPerformedProcedureCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ReasonForPerformedProcedureCodeSequence"); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReasonForPerformedProcedureCodeSequence::DRTReasonForPerformedProcedureCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReasonForPerformedProcedureCodeSequence::DRTReasonForPerformedProcedureCodeSequence(const DRTReasonForPerformedProcedureCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReasonForPerformedProcedureCodeSequence &DRTReasonForPerformedProcedureCodeSequence::operator=(const DRTReasonForPerformedProcedureCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReasonForPerformedProcedureCodeSequence::~DRTReasonForPerformedProcedureCodeSequence() +{ + clear(); +} + + +void DRTReasonForPerformedProcedureCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReasonForPerformedProcedureCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReasonForPerformedProcedureCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReasonForPerformedProcedureCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReasonForPerformedProcedureCodeSequence::Item &DRTReasonForPerformedProcedureCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReasonForPerformedProcedureCodeSequence::Item &DRTReasonForPerformedProcedureCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReasonForPerformedProcedureCodeSequence::Item &DRTReasonForPerformedProcedureCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReasonForPerformedProcedureCodeSequence::Item &DRTReasonForPerformedProcedureCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReasonForPerformedProcedureCodeSequence::Item &DRTReasonForPerformedProcedureCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReasonForPerformedProcedureCodeSequence::Item &DRTReasonForPerformedProcedureCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReasonForPerformedProcedureCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReasonForPerformedProcedureCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReasonForPerformedProcedureCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReasonForPerformedProcedureCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrpphs.cc b/dcmrt/libsrc/drtrpphs.cc new file mode 100644 index 00000000..5f2d84ca --- /dev/null +++ b/dcmrt/libsrc/drtrpphs.cc @@ -0,0 +1,644 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedPatientPhotoSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrpphs.h" + + +// --- item class --- + +DRTReferencedPatientPhotoSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DICOMMediaRetrievalSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DICOMRetrievalSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedSOPSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SeriesInstanceUID(DCM_SeriesInstanceUID), + StudyInstanceUID(DCM_StudyInstanceUID), + TypeOfInstances(DCM_TypeOfInstances), + WADORSRetrievalSequence(emptyDefaultItem /*emptyDefaultSequence*/), + WADORetrievalSequence(emptyDefaultItem /*emptyDefaultSequence*/), + XDSRetrievalSequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTReferencedPatientPhotoSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DICOMMediaRetrievalSequence(copy.DICOMMediaRetrievalSequence), + DICOMRetrievalSequence(copy.DICOMRetrievalSequence), + ReferencedSOPSequence(copy.ReferencedSOPSequence), + SeriesInstanceUID(copy.SeriesInstanceUID), + StudyInstanceUID(copy.StudyInstanceUID), + TypeOfInstances(copy.TypeOfInstances), + WADORSRetrievalSequence(copy.WADORSRetrievalSequence), + WADORetrievalSequence(copy.WADORetrievalSequence), + XDSRetrievalSequence(copy.XDSRetrievalSequence) +{ +} + + +DRTReferencedPatientPhotoSequence::Item::~Item() +{ +} + + +DRTReferencedPatientPhotoSequence::Item &DRTReferencedPatientPhotoSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DICOMMediaRetrievalSequence = copy.DICOMMediaRetrievalSequence; + DICOMRetrievalSequence = copy.DICOMRetrievalSequence; + ReferencedSOPSequence = copy.ReferencedSOPSequence; + SeriesInstanceUID = copy.SeriesInstanceUID; + StudyInstanceUID = copy.StudyInstanceUID; + TypeOfInstances = copy.TypeOfInstances; + WADORSRetrievalSequence = copy.WADORSRetrievalSequence; + WADORetrievalSequence = copy.WADORetrievalSequence; + XDSRetrievalSequence = copy.XDSRetrievalSequence; + } + return *this; +} + + +void DRTReferencedPatientPhotoSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + TypeOfInstances.clear(); + StudyInstanceUID.clear(); + SeriesInstanceUID.clear(); + ReferencedSOPSequence.clear(); + DICOMRetrievalSequence.clear(); + DICOMMediaRetrievalSequence.clear(); + WADORetrievalSequence.clear(); + XDSRetrievalSequence.clear(); + WADORSRetrievalSequence.clear(); + } +} + + +OFBool DRTReferencedPatientPhotoSequence::Item::isEmpty() +{ + return TypeOfInstances.isEmpty() && + StudyInstanceUID.isEmpty() && + SeriesInstanceUID.isEmpty() && + ReferencedSOPSequence.isEmpty() && + DICOMRetrievalSequence.isEmpty() && + DICOMMediaRetrievalSequence.isEmpty() && + WADORetrievalSequence.isEmpty() && + XDSRetrievalSequence.isEmpty() && + WADORSRetrievalSequence.isEmpty(); +} + + +OFBool DRTReferencedPatientPhotoSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, TypeOfInstances, "1", "1", "ReferencedPatientPhotoSequence"); + getAndCheckElementFromDataset(item, StudyInstanceUID, "1", "1C", "ReferencedPatientPhotoSequence"); + getAndCheckElementFromDataset(item, SeriesInstanceUID, "1", "1C", "ReferencedPatientPhotoSequence"); + ReferencedSOPSequence.read(item, "1-n", "1", "ReferencedPatientPhotoSequence"); + DICOMRetrievalSequence.read(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + DICOMMediaRetrievalSequence.read(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + WADORetrievalSequence.read(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + XDSRetrievalSequence.read(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + WADORSRetrievalSequence.read(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(TypeOfInstances), "1", "1", "ReferencedPatientPhotoSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1C", "ReferencedPatientPhotoSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1C", "ReferencedPatientPhotoSequence"); + if (result.good()) result = ReferencedSOPSequence.write(item, "1-n", "1", "ReferencedPatientPhotoSequence"); + if (result.good()) result = DICOMRetrievalSequence.write(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + if (result.good()) result = DICOMMediaRetrievalSequence.write(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + if (result.good()) result = WADORetrievalSequence.write(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + if (result.good()) result = XDSRetrievalSequence.write(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + if (result.good()) result = WADORSRetrievalSequence.write(item, "1-n", "1C", "ReferencedPatientPhotoSequence"); + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::getTypeOfInstances(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TypeOfInstances, value, pos); +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::Item::setTypeOfInstances(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TypeOfInstances.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedPatientPhotoSequence::DRTReferencedPatientPhotoSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedPatientPhotoSequence::DRTReferencedPatientPhotoSequence(const DRTReferencedPatientPhotoSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedPatientPhotoSequence &DRTReferencedPatientPhotoSequence::operator=(const DRTReferencedPatientPhotoSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedPatientPhotoSequence::~DRTReferencedPatientPhotoSequence() +{ + clear(); +} + + +void DRTReferencedPatientPhotoSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedPatientPhotoSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedPatientPhotoSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedPatientPhotoSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedPatientPhotoSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedPatientPhotoSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedPatientPhotoSequence::Item &DRTReferencedPatientPhotoSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedPatientPhotoSequence::Item &DRTReferencedPatientPhotoSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedPatientPhotoSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedPatientPhotoSequence::Item &DRTReferencedPatientPhotoSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedPatientPhotoSequence::Item &DRTReferencedPatientPhotoSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedPatientPhotoSequence::Item &DRTReferencedPatientPhotoSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedPatientPhotoSequence::Item &DRTReferencedPatientPhotoSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedPatientPhotoSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedPatientPhotoSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedPatientPhotoSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedPatientPhotoSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedPatientPhotoSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrpps.cc b/dcmrt/libsrc/drtrpps.cc new file mode 100644 index 00000000..d1c4e25a --- /dev/null +++ b/dcmrt/libsrc/drtrpps.cc @@ -0,0 +1,589 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTROIPhysicalPropertiesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrpps.h" + + +// --- item class --- + +DRTROIPhysicalPropertiesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ROIElementalCompositionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ROIPhysicalProperty(DCM_ROIPhysicalProperty), + ROIPhysicalPropertyValue(DCM_ROIPhysicalPropertyValue) +{ +} + + +DRTROIPhysicalPropertiesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ROIElementalCompositionSequence(copy.ROIElementalCompositionSequence), + ROIPhysicalProperty(copy.ROIPhysicalProperty), + ROIPhysicalPropertyValue(copy.ROIPhysicalPropertyValue) +{ +} + + +DRTROIPhysicalPropertiesSequence::Item::~Item() +{ +} + + +DRTROIPhysicalPropertiesSequence::Item &DRTROIPhysicalPropertiesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ROIElementalCompositionSequence = copy.ROIElementalCompositionSequence; + ROIPhysicalProperty = copy.ROIPhysicalProperty; + ROIPhysicalPropertyValue = copy.ROIPhysicalPropertyValue; + } + return *this; +} + + +void DRTROIPhysicalPropertiesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ROIPhysicalProperty.clear(); + ROIElementalCompositionSequence.clear(); + ROIPhysicalPropertyValue.clear(); + } +} + + +OFBool DRTROIPhysicalPropertiesSequence::Item::isEmpty() +{ + return ROIPhysicalProperty.isEmpty() && + ROIElementalCompositionSequence.isEmpty() && + ROIPhysicalPropertyValue.isEmpty(); +} + + +OFBool DRTROIPhysicalPropertiesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ROIPhysicalProperty, "1", "1", "ROIPhysicalPropertiesSequence"); + ROIElementalCompositionSequence.read(item, "1-n", "1C", "ROIPhysicalPropertiesSequence"); + getAndCheckElementFromDataset(item, ROIPhysicalPropertyValue, "1", "1", "ROIPhysicalPropertiesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ROIPhysicalProperty), "1", "1", "ROIPhysicalPropertiesSequence"); + if (result.good()) result = ROIElementalCompositionSequence.write(item, "1-n", "1C", "ROIPhysicalPropertiesSequence"); + addElementToDataset(result, item, new DcmDecimalString(ROIPhysicalPropertyValue), "1", "1", "ROIPhysicalPropertiesSequence"); + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::Item::getROIPhysicalProperty(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIPhysicalProperty, value, pos); +} + + +OFCondition DRTROIPhysicalPropertiesSequence::Item::getROIPhysicalPropertyValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIPhysicalPropertyValue, value, pos); +} + + +OFCondition DRTROIPhysicalPropertiesSequence::Item::getROIPhysicalPropertyValue(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ROIPhysicalPropertyValue).getFloat64(value, pos); +} + + +OFCondition DRTROIPhysicalPropertiesSequence::Item::setROIPhysicalProperty(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIPhysicalProperty.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::Item::setROIPhysicalPropertyValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIPhysicalPropertyValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTROIPhysicalPropertiesSequence::DRTROIPhysicalPropertiesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTROIPhysicalPropertiesSequence::DRTROIPhysicalPropertiesSequence(const DRTROIPhysicalPropertiesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTROIPhysicalPropertiesSequence &DRTROIPhysicalPropertiesSequence::operator=(const DRTROIPhysicalPropertiesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTROIPhysicalPropertiesSequence::~DRTROIPhysicalPropertiesSequence() +{ + clear(); +} + + +void DRTROIPhysicalPropertiesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTROIPhysicalPropertiesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTROIPhysicalPropertiesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTROIPhysicalPropertiesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTROIPhysicalPropertiesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTROIPhysicalPropertiesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTROIPhysicalPropertiesSequence::Item &DRTROIPhysicalPropertiesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTROIPhysicalPropertiesSequence::Item &DRTROIPhysicalPropertiesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTROIPhysicalPropertiesSequence::Item &DRTROIPhysicalPropertiesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTROIPhysicalPropertiesSequence::Item &DRTROIPhysicalPropertiesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTROIPhysicalPropertiesSequence::Item &DRTROIPhysicalPropertiesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTROIPhysicalPropertiesSequence::Item &DRTROIPhysicalPropertiesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTROIPhysicalPropertiesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ROIPhysicalPropertiesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ROIPhysicalPropertiesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTROIPhysicalPropertiesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ROIPhysicalPropertiesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrppss.cc b/dcmrt/libsrc/drtrppss.cc new file mode 100644 index 00000000..3677adae --- /dev/null +++ b/dcmrt/libsrc/drtrppss.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedPerformedProcedureStepSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrppss.h" + + +// --- item class --- + +DRTReferencedPerformedProcedureStepSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedPerformedProcedureStepSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedPerformedProcedureStepSequence::Item::~Item() +{ +} + + +DRTReferencedPerformedProcedureStepSequence::Item &DRTReferencedPerformedProcedureStepSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedPerformedProcedureStepSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedPerformedProcedureStepSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedPerformedProcedureStepSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedPerformedProcedureStepSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedPerformedProcedureStepSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedPerformedProcedureStepSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedPerformedProcedureStepSequence"); + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedPerformedProcedureStepSequence::DRTReferencedPerformedProcedureStepSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedPerformedProcedureStepSequence::DRTReferencedPerformedProcedureStepSequence(const DRTReferencedPerformedProcedureStepSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedPerformedProcedureStepSequence &DRTReferencedPerformedProcedureStepSequence::operator=(const DRTReferencedPerformedProcedureStepSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedPerformedProcedureStepSequence::~DRTReferencedPerformedProcedureStepSequence() +{ + clear(); +} + + +void DRTReferencedPerformedProcedureStepSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedPerformedProcedureStepSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedPerformedProcedureStepSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedPerformedProcedureStepSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedPerformedProcedureStepSequence::Item &DRTReferencedPerformedProcedureStepSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedPerformedProcedureStepSequence::Item &DRTReferencedPerformedProcedureStepSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedPerformedProcedureStepSequence::Item &DRTReferencedPerformedProcedureStepSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedPerformedProcedureStepSequence::Item &DRTReferencedPerformedProcedureStepSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedPerformedProcedureStepSequence::Item &DRTReferencedPerformedProcedureStepSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedPerformedProcedureStepSequence::Item &DRTReferencedPerformedProcedureStepSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedPerformedProcedureStepSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedPerformedProcedureStepSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedPerformedProcedureStepSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedPerformedProcedureStepSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrps.cc b/dcmrt/libsrc/drtrps.cc new file mode 100644 index 00000000..bdd6743d --- /dev/null +++ b/dcmrt/libsrc/drtrps.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedPatientSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrps.h" + + +// --- item class --- + +DRTReferencedPatientSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedPatientSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedPatientSequence::Item::~Item() +{ +} + + +DRTReferencedPatientSequence::Item &DRTReferencedPatientSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedPatientSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedPatientSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedPatientSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedPatientSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedPatientSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedPatientSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedPatientSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedPatientSequence"); + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedPatientSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedPatientSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedPatientSequence::DRTReferencedPatientSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedPatientSequence::DRTReferencedPatientSequence(const DRTReferencedPatientSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedPatientSequence &DRTReferencedPatientSequence::operator=(const DRTReferencedPatientSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedPatientSequence::~DRTReferencedPatientSequence() +{ + clear(); +} + + +void DRTReferencedPatientSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedPatientSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedPatientSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedPatientSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedPatientSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedPatientSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedPatientSequence::Item &DRTReferencedPatientSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedPatientSequence::Item &DRTReferencedPatientSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedPatientSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedPatientSequence::Item &DRTReferencedPatientSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedPatientSequence::Item &DRTReferencedPatientSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedPatientSequence::Item &DRTReferencedPatientSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedPatientSequence::Item &DRTReferencedPatientSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedPatientSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedPatientSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedPatientSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedPatientSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedPatientSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrris1.cc b/dcmrt/libsrc/drtrris1.cc new file mode 100644 index 00000000..5865b61e --- /dev/null +++ b/dcmrt/libsrc/drtrris1.cc @@ -0,0 +1,687 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedReferenceImageSequenceInRTBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrris1.h" + + +// --- item class --- + +DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + EndCumulativeMetersetWeight(DCM_EndCumulativeMetersetWeight), + ReferenceImageNumber(DCM_ReferenceImageNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + StartCumulativeMetersetWeight(DCM_StartCumulativeMetersetWeight) +{ +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + EndCumulativeMetersetWeight(copy.EndCumulativeMetersetWeight), + ReferenceImageNumber(copy.ReferenceImageNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + StartCumulativeMetersetWeight(copy.StartCumulativeMetersetWeight) +{ +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::~Item() +{ +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + EndCumulativeMetersetWeight = copy.EndCumulativeMetersetWeight; + ReferenceImageNumber = copy.ReferenceImageNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + StartCumulativeMetersetWeight = copy.StartCumulativeMetersetWeight; + } + return *this; +} + + +void DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferenceImageNumber.clear(); + StartCumulativeMetersetWeight.clear(); + EndCumulativeMetersetWeight.clear(); + } +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferenceImageNumber.isEmpty() && + StartCumulativeMetersetWeight.isEmpty() && + EndCumulativeMetersetWeight.isEmpty(); +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedReferenceImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedReferenceImageSequence"); + getAndCheckElementFromDataset(item, ReferenceImageNumber, "1", "1", "ReferencedReferenceImageSequence"); + getAndCheckElementFromDataset(item, StartCumulativeMetersetWeight, "1", "3", "ReferencedReferenceImageSequence"); + getAndCheckElementFromDataset(item, EndCumulativeMetersetWeight, "1", "3", "ReferencedReferenceImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedReferenceImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedReferenceImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferenceImageNumber), "1", "1", "ReferencedReferenceImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(StartCumulativeMetersetWeight), "1", "3", "ReferencedReferenceImageSequence"); + addElementToDataset(result, item, new DcmDecimalString(EndCumulativeMetersetWeight), "1", "3", "ReferencedReferenceImageSequence"); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getEndCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(EndCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getEndCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, EndCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getReferenceImageNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferenceImageNumber, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getReferenceImageNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferenceImageNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getStartCumulativeMetersetWeight(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StartCumulativeMetersetWeight, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::getStartCumulativeMetersetWeight(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, StartCumulativeMetersetWeight).getFloat64(value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::setEndCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EndCumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::setReferenceImageNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferenceImageNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::Item::setStartCumulativeMetersetWeight(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StartCumulativeMetersetWeight.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedReferenceImageSequenceInRTBeamsModule::DRTReferencedReferenceImageSequenceInRTBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::DRTReferencedReferenceImageSequenceInRTBeamsModule(const DRTReferencedReferenceImageSequenceInRTBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule &DRTReferencedReferenceImageSequenceInRTBeamsModule::operator=(const DRTReferencedReferenceImageSequenceInRTBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::~DRTReferencedReferenceImageSequenceInRTBeamsModule() +{ + clear(); +} + + +void DRTReferencedReferenceImageSequenceInRTBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedReferenceImageSequenceInRTBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedReferenceImageSequenceInRTBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedReferenceImageSequenceInRTBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedReferenceImageSequenceInRTBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedReferenceImageSequenceInRTBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedReferenceImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedReferenceImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedReferenceImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrris6.cc b/dcmrt/libsrc/drtrris6.cc new file mode 100644 index 00000000..707c2241 --- /dev/null +++ b/dcmrt/libsrc/drtrris6.cc @@ -0,0 +1,611 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedReferenceImageSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrris6.h" + + +// --- item class --- + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferenceImageNumber(DCM_ReferenceImageNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferenceImageNumber(copy.ReferenceImageNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferenceImageNumber = copy.ReferenceImageNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferenceImageNumber.clear(); + } +} + + +OFBool DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferenceImageNumber.isEmpty(); +} + + +OFBool DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedReferenceImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedReferenceImageSequence"); + getAndCheckElementFromDataset(item, ReferenceImageNumber, "1", "1", "ReferencedReferenceImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedReferenceImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedReferenceImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferenceImageNumber), "1", "1", "ReferencedReferenceImageSequence"); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::getReferenceImageNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferenceImageNumber, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::getReferenceImageNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferenceImageNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::setReferenceImageNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferenceImageNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::DRTReferencedReferenceImageSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::DRTReferencedReferenceImageSequenceInRTIonBeamsModule(const DRTReferencedReferenceImageSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::operator=(const DRTReferencedReferenceImageSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::~DRTReferencedReferenceImageSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTReferencedReferenceImageSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedReferenceImageSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedReferenceImageSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedReferenceImageSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedReferenceImageSequenceInRTIonBeamsModule::Item &DRTReferencedReferenceImageSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedReferenceImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedReferenceImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedReferenceImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrris9.cc b/dcmrt/libsrc/drtrris9.cc new file mode 100644 index 00000000..5c679957 --- /dev/null +++ b/dcmrt/libsrc/drtrris9.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrris9.h" + + +// --- item class --- + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::~Item() +{ +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedReferenceImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedReferenceImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedReferenceImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedReferenceImageSequence"); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule(const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::operator=(const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::~DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule() +{ + clear(); +} + + +void DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::Item &DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedReferenceImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedReferenceImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedReferenceImageSequenceInRTBrachyApplicationSetupsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedReferenceImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrms.cc b/dcmrt/libsrc/drtrrms.cc new file mode 100644 index 00000000..558c87ae --- /dev/null +++ b/dcmrt/libsrc/drtrrms.cc @@ -0,0 +1,669 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRecordedRangeModulatorSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrms.h" + + +// --- item class --- + +DRTRecordedRangeModulatorSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + BeamCurrentModulationID(DCM_BeamCurrentModulationID), + RangeModulatorID(DCM_RangeModulatorID), + RangeModulatorType(DCM_RangeModulatorType), + ReferencedRangeModulatorNumber(DCM_ReferencedRangeModulatorNumber) +{ +} + + +DRTRecordedRangeModulatorSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + BeamCurrentModulationID(copy.BeamCurrentModulationID), + RangeModulatorID(copy.RangeModulatorID), + RangeModulatorType(copy.RangeModulatorType), + ReferencedRangeModulatorNumber(copy.ReferencedRangeModulatorNumber) +{ +} + + +DRTRecordedRangeModulatorSequence::Item::~Item() +{ +} + + +DRTRecordedRangeModulatorSequence::Item &DRTRecordedRangeModulatorSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + BeamCurrentModulationID = copy.BeamCurrentModulationID; + RangeModulatorID = copy.RangeModulatorID; + RangeModulatorType = copy.RangeModulatorType; + ReferencedRangeModulatorNumber = copy.ReferencedRangeModulatorNumber; + } + return *this; +} + + +void DRTRecordedRangeModulatorSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedRangeModulatorNumber.clear(); + RangeModulatorID.clear(); + AccessoryCode.clear(); + RangeModulatorType.clear(); + BeamCurrentModulationID.clear(); + } +} + + +OFBool DRTRecordedRangeModulatorSequence::Item::isEmpty() +{ + return ReferencedRangeModulatorNumber.isEmpty() && + RangeModulatorID.isEmpty() && + AccessoryCode.isEmpty() && + RangeModulatorType.isEmpty() && + BeamCurrentModulationID.isEmpty(); +} + + +OFBool DRTRecordedRangeModulatorSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedRangeModulatorNumber, "1", "1", "RecordedRangeModulatorSequence"); + getAndCheckElementFromDataset(item, RangeModulatorID, "1", "1", "RecordedRangeModulatorSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RecordedRangeModulatorSequence"); + getAndCheckElementFromDataset(item, RangeModulatorType, "1", "1", "RecordedRangeModulatorSequence"); + getAndCheckElementFromDataset(item, BeamCurrentModulationID, "1", "1C", "RecordedRangeModulatorSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedRangeModulatorNumber), "1", "1", "RecordedRangeModulatorSequence"); + addElementToDataset(result, item, new DcmShortString(RangeModulatorID), "1", "1", "RecordedRangeModulatorSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RecordedRangeModulatorSequence"); + addElementToDataset(result, item, new DcmCodeString(RangeModulatorType), "1", "1", "RecordedRangeModulatorSequence"); + addElementToDataset(result, item, new DcmShortString(BeamCurrentModulationID), "1", "1C", "RecordedRangeModulatorSequence"); + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::getBeamCurrentModulationID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamCurrentModulationID, value, pos); +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::getRangeModulatorID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeModulatorID, value, pos); +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::getRangeModulatorType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeModulatorType, value, pos); +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::getReferencedRangeModulatorNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedRangeModulatorNumber, value, pos); +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::getReferencedRangeModulatorNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedRangeModulatorNumber).getSint32(value, pos); +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::setBeamCurrentModulationID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamCurrentModulationID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::setRangeModulatorID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeModulatorID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::setRangeModulatorType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeModulatorType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::Item::setReferencedRangeModulatorNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedRangeModulatorNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRecordedRangeModulatorSequence::DRTRecordedRangeModulatorSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRecordedRangeModulatorSequence::DRTRecordedRangeModulatorSequence(const DRTRecordedRangeModulatorSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRecordedRangeModulatorSequence &DRTRecordedRangeModulatorSequence::operator=(const DRTRecordedRangeModulatorSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRecordedRangeModulatorSequence::~DRTRecordedRangeModulatorSequence() +{ + clear(); +} + + +void DRTRecordedRangeModulatorSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRecordedRangeModulatorSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRecordedRangeModulatorSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRecordedRangeModulatorSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRecordedRangeModulatorSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRecordedRangeModulatorSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRecordedRangeModulatorSequence::Item &DRTRecordedRangeModulatorSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRecordedRangeModulatorSequence::Item &DRTRecordedRangeModulatorSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRecordedRangeModulatorSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRecordedRangeModulatorSequence::Item &DRTRecordedRangeModulatorSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRecordedRangeModulatorSequence::Item &DRTRecordedRangeModulatorSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRecordedRangeModulatorSequence::Item &DRTRecordedRangeModulatorSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRecordedRangeModulatorSequence::Item &DRTRecordedRangeModulatorSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRecordedRangeModulatorSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RecordedRangeModulatorSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RecordedRangeModulatorSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRecordedRangeModulatorSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RecordedRangeModulatorSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrros.cc b/dcmrt/libsrc/drtrros.cc new file mode 100644 index 00000000..5bd13f9c --- /dev/null +++ b/dcmrt/libsrc/drtrros.cc @@ -0,0 +1,771 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRTROIObservationsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrros.h" + + +// --- item class --- + +DRTRTROIObservationsSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + MaterialID(DCM_MaterialID), + ObservationNumber(DCM_ObservationNumber), + ROIInterpreter(DCM_ROIInterpreter), + ROIObservationDescription(DCM_ROIObservationDescription), + ROIObservationLabel(DCM_ROIObservationLabel), + ROIPhysicalPropertiesSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RTROIIdentificationCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RTROIInterpretedType(DCM_RTROIInterpretedType), + RTRelatedROISequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedROINumber(DCM_ReferencedROINumber), + RelatedRTROIObservationsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SegmentedPropertyCategoryCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/) +{ +} + + +DRTRTROIObservationsSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + MaterialID(copy.MaterialID), + ObservationNumber(copy.ObservationNumber), + ROIInterpreter(copy.ROIInterpreter), + ROIObservationDescription(copy.ROIObservationDescription), + ROIObservationLabel(copy.ROIObservationLabel), + ROIPhysicalPropertiesSequence(copy.ROIPhysicalPropertiesSequence), + RTROIIdentificationCodeSequence(copy.RTROIIdentificationCodeSequence), + RTROIInterpretedType(copy.RTROIInterpretedType), + RTRelatedROISequence(copy.RTRelatedROISequence), + ReferencedROINumber(copy.ReferencedROINumber), + RelatedRTROIObservationsSequence(copy.RelatedRTROIObservationsSequence), + SegmentedPropertyCategoryCodeSequence(copy.SegmentedPropertyCategoryCodeSequence) +{ +} + + +DRTRTROIObservationsSequence::Item::~Item() +{ +} + + +DRTRTROIObservationsSequence::Item &DRTRTROIObservationsSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + MaterialID = copy.MaterialID; + ObservationNumber = copy.ObservationNumber; + ROIInterpreter = copy.ROIInterpreter; + ROIObservationDescription = copy.ROIObservationDescription; + ROIObservationLabel = copy.ROIObservationLabel; + ROIPhysicalPropertiesSequence = copy.ROIPhysicalPropertiesSequence; + RTROIIdentificationCodeSequence = copy.RTROIIdentificationCodeSequence; + RTROIInterpretedType = copy.RTROIInterpretedType; + RTRelatedROISequence = copy.RTRelatedROISequence; + ReferencedROINumber = copy.ReferencedROINumber; + RelatedRTROIObservationsSequence = copy.RelatedRTROIObservationsSequence; + SegmentedPropertyCategoryCodeSequence = copy.SegmentedPropertyCategoryCodeSequence; + } + return *this; +} + + +void DRTRTROIObservationsSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ObservationNumber.clear(); + ReferencedROINumber.clear(); + ROIObservationLabel.clear(); + ROIObservationDescription.clear(); + RTRelatedROISequence.clear(); + SegmentedPropertyCategoryCodeSequence.clear(); + RTROIIdentificationCodeSequence.clear(); + RelatedRTROIObservationsSequence.clear(); + RTROIInterpretedType.clear(); + ROIInterpreter.clear(); + MaterialID.clear(); + ROIPhysicalPropertiesSequence.clear(); + } +} + + +OFBool DRTRTROIObservationsSequence::Item::isEmpty() +{ + return ObservationNumber.isEmpty() && + ReferencedROINumber.isEmpty() && + ROIObservationLabel.isEmpty() && + ROIObservationDescription.isEmpty() && + RTRelatedROISequence.isEmpty() && + SegmentedPropertyCategoryCodeSequence.isEmpty() && + RTROIIdentificationCodeSequence.isEmpty() && + RelatedRTROIObservationsSequence.isEmpty() && + RTROIInterpretedType.isEmpty() && + ROIInterpreter.isEmpty() && + MaterialID.isEmpty() && + ROIPhysicalPropertiesSequence.isEmpty(); +} + + +OFBool DRTRTROIObservationsSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRTROIObservationsSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ObservationNumber, "1", "1", "RTROIObservationsSequence"); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "RTROIObservationsSequence"); + getAndCheckElementFromDataset(item, ROIObservationLabel, "1", "3", "RTROIObservationsSequence"); + getAndCheckElementFromDataset(item, ROIObservationDescription, "1", "3", "RTROIObservationsSequence"); + RTRelatedROISequence.read(item, "1-n", "3", "RTROIObservationsSequence"); + SegmentedPropertyCategoryCodeSequence.read(item, "1-n", "3", "RTROIObservationsSequence"); + RTROIIdentificationCodeSequence.read(item, "1-n", "3", "RTROIObservationsSequence"); + RelatedRTROIObservationsSequence.read(item, "1-n", "3", "RTROIObservationsSequence"); + getAndCheckElementFromDataset(item, RTROIInterpretedType, "1", "2", "RTROIObservationsSequence"); + getAndCheckElementFromDataset(item, ROIInterpreter, "1", "2", "RTROIObservationsSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "3", "RTROIObservationsSequence"); + ROIPhysicalPropertiesSequence.read(item, "1-n", "3", "RTROIObservationsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ObservationNumber), "1", "1", "RTROIObservationsSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "RTROIObservationsSequence"); + addElementToDataset(result, item, new DcmShortString(ROIObservationLabel), "1", "3", "RTROIObservationsSequence"); + addElementToDataset(result, item, new DcmShortText(ROIObservationDescription), "1", "3", "RTROIObservationsSequence"); + if (result.good()) result = RTRelatedROISequence.write(item, "1-n", "3", "RTROIObservationsSequence"); + if (result.good()) result = SegmentedPropertyCategoryCodeSequence.write(item, "1-n", "3", "RTROIObservationsSequence"); + if (result.good()) result = RTROIIdentificationCodeSequence.write(item, "1-n", "3", "RTROIObservationsSequence"); + if (result.good()) result = RelatedRTROIObservationsSequence.write(item, "1-n", "3", "RTROIObservationsSequence"); + addElementToDataset(result, item, new DcmCodeString(RTROIInterpretedType), "1", "2", "RTROIObservationsSequence"); + addElementToDataset(result, item, new DcmPersonName(ROIInterpreter), "1", "2", "RTROIObservationsSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "3", "RTROIObservationsSequence"); + if (result.good()) result = ROIPhysicalPropertiesSequence.write(item, "1-n", "3", "RTROIObservationsSequence"); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getObservationNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ObservationNumber, value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getObservationNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ObservationNumber).getSint32(value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getROIInterpreter(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIInterpreter, value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getROIObservationDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIObservationDescription, value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getROIObservationLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIObservationLabel, value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getRTROIInterpretedType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTROIInterpretedType, value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTRTROIObservationsSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::setObservationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ObservationNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::setROIInterpreter(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIInterpreter.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::setROIObservationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ROIObservationDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::setROIObservationLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIObservationLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::setRTROIInterpretedType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTROIInterpretedType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRTROIObservationsSequence::DRTRTROIObservationsSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRTROIObservationsSequence::DRTRTROIObservationsSequence(const DRTRTROIObservationsSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRTROIObservationsSequence &DRTRTROIObservationsSequence::operator=(const DRTRTROIObservationsSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRTROIObservationsSequence::~DRTRTROIObservationsSequence() +{ + clear(); +} + + +void DRTRTROIObservationsSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRTROIObservationsSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRTROIObservationsSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRTROIObservationsSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRTROIObservationsSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRTROIObservationsSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRTROIObservationsSequence::Item &DRTRTROIObservationsSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRTROIObservationsSequence::Item &DRTRTROIObservationsSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRTROIObservationsSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRTROIObservationsSequence::Item &DRTRTROIObservationsSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRTROIObservationsSequence::Item &DRTRTROIObservationsSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRTROIObservationsSequence::Item &DRTRTROIObservationsSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRTROIObservationsSequence::Item &DRTRTROIObservationsSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRTROIObservationsSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RTROIObservationsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RTROIObservationsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRTROIObservationsSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RTROIObservationsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrpcs.cc b/dcmrt/libsrc/drtrrpcs.cc new file mode 100644 index 00000000..52f45990 --- /dev/null +++ b/dcmrt/libsrc/drtrrpcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReasonForRequestedProcedureCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrpcs.h" + + +// --- item class --- + +DRTReasonForRequestedProcedureCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTReasonForRequestedProcedureCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTReasonForRequestedProcedureCodeSequence::Item::~Item() +{ +} + + +DRTReasonForRequestedProcedureCodeSequence::Item &DRTReasonForRequestedProcedureCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTReasonForRequestedProcedureCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTReasonForRequestedProcedureCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTReasonForRequestedProcedureCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ReasonForRequestedProcedureCodeSequence"); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReasonForRequestedProcedureCodeSequence::DRTReasonForRequestedProcedureCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReasonForRequestedProcedureCodeSequence::DRTReasonForRequestedProcedureCodeSequence(const DRTReasonForRequestedProcedureCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReasonForRequestedProcedureCodeSequence &DRTReasonForRequestedProcedureCodeSequence::operator=(const DRTReasonForRequestedProcedureCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReasonForRequestedProcedureCodeSequence::~DRTReasonForRequestedProcedureCodeSequence() +{ + clear(); +} + + +void DRTReasonForRequestedProcedureCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReasonForRequestedProcedureCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReasonForRequestedProcedureCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReasonForRequestedProcedureCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReasonForRequestedProcedureCodeSequence::Item &DRTReasonForRequestedProcedureCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReasonForRequestedProcedureCodeSequence::Item &DRTReasonForRequestedProcedureCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReasonForRequestedProcedureCodeSequence::Item &DRTReasonForRequestedProcedureCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReasonForRequestedProcedureCodeSequence::Item &DRTReasonForRequestedProcedureCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReasonForRequestedProcedureCodeSequence::Item &DRTReasonForRequestedProcedureCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReasonForRequestedProcedureCodeSequence::Item &DRTReasonForRequestedProcedureCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReasonForRequestedProcedureCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReasonForRequestedProcedureCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReasonForRequestedProcedureCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReasonForRequestedProcedureCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrros.cc b/dcmrt/libsrc/drtrrros.cc new file mode 100644 index 00000000..292f13a4 --- /dev/null +++ b/dcmrt/libsrc/drtrrros.cc @@ -0,0 +1,553 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRelatedRTROIObservationsSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrros.h" + + +// --- item class --- + +DRTRelatedRTROIObservationsSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ObservationNumber(DCM_ObservationNumber) +{ +} + + +DRTRelatedRTROIObservationsSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ObservationNumber(copy.ObservationNumber) +{ +} + + +DRTRelatedRTROIObservationsSequence::Item::~Item() +{ +} + + +DRTRelatedRTROIObservationsSequence::Item &DRTRelatedRTROIObservationsSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ObservationNumber = copy.ObservationNumber; + } + return *this; +} + + +void DRTRelatedRTROIObservationsSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ObservationNumber.clear(); + } +} + + +OFBool DRTRelatedRTROIObservationsSequence::Item::isEmpty() +{ + return ObservationNumber.isEmpty(); +} + + +OFBool DRTRelatedRTROIObservationsSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ObservationNumber, "1", "1", "RelatedRTROIObservationsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ObservationNumber), "1", "1", "RelatedRTROIObservationsSequence"); + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::Item::getObservationNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ObservationNumber, value, pos); +} + + +OFCondition DRTRelatedRTROIObservationsSequence::Item::getObservationNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ObservationNumber).getSint32(value, pos); +} + + +OFCondition DRTRelatedRTROIObservationsSequence::Item::setObservationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ObservationNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRelatedRTROIObservationsSequence::DRTRelatedRTROIObservationsSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRelatedRTROIObservationsSequence::DRTRelatedRTROIObservationsSequence(const DRTRelatedRTROIObservationsSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRelatedRTROIObservationsSequence &DRTRelatedRTROIObservationsSequence::operator=(const DRTRelatedRTROIObservationsSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRelatedRTROIObservationsSequence::~DRTRelatedRTROIObservationsSequence() +{ + clear(); +} + + +void DRTRelatedRTROIObservationsSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRelatedRTROIObservationsSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRelatedRTROIObservationsSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRelatedRTROIObservationsSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRelatedRTROIObservationsSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRelatedRTROIObservationsSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRelatedRTROIObservationsSequence::Item &DRTRelatedRTROIObservationsSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRelatedRTROIObservationsSequence::Item &DRTRelatedRTROIObservationsSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRelatedRTROIObservationsSequence::Item &DRTRelatedRTROIObservationsSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRelatedRTROIObservationsSequence::Item &DRTRelatedRTROIObservationsSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRelatedRTROIObservationsSequence::Item &DRTRelatedRTROIObservationsSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRelatedRTROIObservationsSequence::Item &DRTRelatedRTROIObservationsSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRelatedRTROIObservationsSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RelatedRTROIObservationsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RelatedRTROIObservationsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRelatedRTROIObservationsSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RelatedRTROIObservationsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrs.cc b/dcmrt/libsrc/drtrrs.cc new file mode 100644 index 00000000..cb7a1a0f --- /dev/null +++ b/dcmrt/libsrc/drtrrs.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRTRelatedROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrs.h" + + +// --- item class --- + +DRTRTRelatedROISequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RTROIRelationship(DCM_RTROIRelationship), + ReferencedROINumber(DCM_ReferencedROINumber) +{ +} + + +DRTRTRelatedROISequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RTROIRelationship(copy.RTROIRelationship), + ReferencedROINumber(copy.ReferencedROINumber) +{ +} + + +DRTRTRelatedROISequence::Item::~Item() +{ +} + + +DRTRTRelatedROISequence::Item &DRTRTRelatedROISequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RTROIRelationship = copy.RTROIRelationship; + ReferencedROINumber = copy.ReferencedROINumber; + } + return *this; +} + + +void DRTRTRelatedROISequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedROINumber.clear(); + RTROIRelationship.clear(); + } +} + + +OFBool DRTRTRelatedROISequence::Item::isEmpty() +{ + return ReferencedROINumber.isEmpty() && + RTROIRelationship.isEmpty(); +} + + +OFBool DRTRTRelatedROISequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRTRelatedROISequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedROINumber, "1", "1", "RTRelatedROISequence"); + getAndCheckElementFromDataset(item, RTROIRelationship, "1", "3", "RTRelatedROISequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedROINumber), "1", "1", "RTRelatedROISequence"); + addElementToDataset(result, item, new DcmCodeString(RTROIRelationship), "1", "3", "RTRelatedROISequence"); + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::Item::getRTROIRelationship(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTROIRelationship, value, pos); +} + + +OFCondition DRTRTRelatedROISequence::Item::getReferencedROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedROINumber, value, pos); +} + + +OFCondition DRTRTRelatedROISequence::Item::getReferencedROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedROINumber).getSint32(value, pos); +} + + +OFCondition DRTRTRelatedROISequence::Item::setRTROIRelationship(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTROIRelationship.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::Item::setReferencedROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedROINumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRTRelatedROISequence::DRTRTRelatedROISequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRTRelatedROISequence::DRTRTRelatedROISequence(const DRTRTRelatedROISequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRTRelatedROISequence &DRTRTRelatedROISequence::operator=(const DRTRTRelatedROISequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRTRelatedROISequence::~DRTRTRelatedROISequence() +{ + clear(); +} + + +void DRTRTRelatedROISequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRTRelatedROISequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRTRelatedROISequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRTRelatedROISequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRTRelatedROISequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRTRelatedROISequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRTRelatedROISequence::Item &DRTRTRelatedROISequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRTRelatedROISequence::Item &DRTRTRelatedROISequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRTRelatedROISequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRTRelatedROISequence::Item &DRTRTRelatedROISequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRTRelatedROISequence::Item &DRTRTRelatedROISequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRTRelatedROISequence::Item &DRTRTRelatedROISequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRTRelatedROISequence::Item &DRTRTRelatedROISequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRTRelatedROISequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RTRelatedROISequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RTRelatedROISequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRTRelatedROISequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RTRelatedROISequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrshs.cc b/dcmrt/libsrc/drtrrshs.cc new file mode 100644 index 00000000..bc876dcc --- /dev/null +++ b/dcmrt/libsrc/drtrrshs.cc @@ -0,0 +1,611 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRecordedRangeShifterSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrshs.h" + + +// --- item class --- + +DRTRecordedRangeShifterSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + RangeShifterID(DCM_RangeShifterID), + ReferencedRangeShifterNumber(DCM_ReferencedRangeShifterNumber) +{ +} + + +DRTRecordedRangeShifterSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + RangeShifterID(copy.RangeShifterID), + ReferencedRangeShifterNumber(copy.ReferencedRangeShifterNumber) +{ +} + + +DRTRecordedRangeShifterSequence::Item::~Item() +{ +} + + +DRTRecordedRangeShifterSequence::Item &DRTRecordedRangeShifterSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + RangeShifterID = copy.RangeShifterID; + ReferencedRangeShifterNumber = copy.ReferencedRangeShifterNumber; + } + return *this; +} + + +void DRTRecordedRangeShifterSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedRangeShifterNumber.clear(); + RangeShifterID.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTRecordedRangeShifterSequence::Item::isEmpty() +{ + return ReferencedRangeShifterNumber.isEmpty() && + RangeShifterID.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTRecordedRangeShifterSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedRangeShifterNumber, "1", "1", "RecordedRangeShifterSequence"); + getAndCheckElementFromDataset(item, RangeShifterID, "1", "1", "RecordedRangeShifterSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RecordedRangeShifterSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedRangeShifterNumber), "1", "1", "RecordedRangeShifterSequence"); + addElementToDataset(result, item, new DcmShortString(RangeShifterID), "1", "1", "RecordedRangeShifterSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RecordedRangeShifterSequence"); + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::getRangeShifterID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeShifterID, value, pos); +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::getReferencedRangeShifterNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedRangeShifterNumber, value, pos); +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::getReferencedRangeShifterNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedRangeShifterNumber).getSint32(value, pos); +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::setRangeShifterID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeShifterID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::Item::setReferencedRangeShifterNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedRangeShifterNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRecordedRangeShifterSequence::DRTRecordedRangeShifterSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRecordedRangeShifterSequence::DRTRecordedRangeShifterSequence(const DRTRecordedRangeShifterSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRecordedRangeShifterSequence &DRTRecordedRangeShifterSequence::operator=(const DRTRecordedRangeShifterSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRecordedRangeShifterSequence::~DRTRecordedRangeShifterSequence() +{ + clear(); +} + + +void DRTRecordedRangeShifterSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRecordedRangeShifterSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRecordedRangeShifterSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRecordedRangeShifterSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRecordedRangeShifterSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRecordedRangeShifterSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRecordedRangeShifterSequence::Item &DRTRecordedRangeShifterSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRecordedRangeShifterSequence::Item &DRTRecordedRangeShifterSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRecordedRangeShifterSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRecordedRangeShifterSequence::Item &DRTRecordedRangeShifterSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRecordedRangeShifterSequence::Item &DRTRecordedRangeShifterSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRecordedRangeShifterSequence::Item &DRTRecordedRangeShifterSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRecordedRangeShifterSequence::Item &DRTRecordedRangeShifterSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRecordedRangeShifterSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RecordedRangeShifterSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RecordedRangeShifterSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRecordedRangeShifterSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RecordedRangeShifterSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrtps.cc b/dcmrt/libsrc/drtrrtps.cc new file mode 100644 index 00000000..2d54f29d --- /dev/null +++ b/dcmrt/libsrc/drtrrtps.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedRTPlanSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrtps.h" + + +// --- item class --- + +DRTReferencedRTPlanSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedFractionGroupSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedFractionGroupSequence(copy.ReferencedFractionGroupSequence), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequence::Item::~Item() +{ +} + + +DRTReferencedRTPlanSequence::Item &DRTReferencedRTPlanSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedFractionGroupSequence = copy.ReferencedFractionGroupSequence; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedRTPlanSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferencedFractionGroupSequence.clear(); + } +} + + +OFBool DRTReferencedRTPlanSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferencedFractionGroupSequence.isEmpty(); +} + + +OFBool DRTReferencedRTPlanSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedRTPlanSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedRTPlanSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedRTPlanSequence"); + ReferencedFractionGroupSequence.read(item, "1-n", "1C", "ReferencedRTPlanSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedRTPlanSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedRTPlanSequence"); + if (result.good()) result = ReferencedFractionGroupSequence.write(item, "1-n", "1C", "ReferencedRTPlanSequence"); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedRTPlanSequence::DRTReferencedRTPlanSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedRTPlanSequence::DRTReferencedRTPlanSequence(const DRTReferencedRTPlanSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedRTPlanSequence &DRTReferencedRTPlanSequence::operator=(const DRTReferencedRTPlanSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedRTPlanSequence::~DRTReferencedRTPlanSequence() +{ + clear(); +} + + +void DRTReferencedRTPlanSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedRTPlanSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedRTPlanSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedRTPlanSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedRTPlanSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedRTPlanSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedRTPlanSequence::Item &DRTReferencedRTPlanSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequence::Item &DRTReferencedRTPlanSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedRTPlanSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedRTPlanSequence::Item &DRTReferencedRTPlanSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequence::Item &DRTReferencedRTPlanSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedRTPlanSequence::Item &DRTReferencedRTPlanSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedRTPlanSequence::Item &DRTReferencedRTPlanSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedRTPlanSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedRTPlanSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedRTPlanSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedRTPlanSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrtps3.cc b/dcmrt/libsrc/drtrrtps3.cc new file mode 100644 index 00000000..85513b64 --- /dev/null +++ b/dcmrt/libsrc/drtrrtps3.cc @@ -0,0 +1,602 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedRTPlanSequenceInRTGeneralPlanModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrtps3.h" + + +// --- item class --- + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RTPlanRelationship(DCM_RTPlanRelationship), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RTPlanRelationship(copy.RTPlanRelationship), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::~Item() +{ +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RTPlanRelationship = copy.RTPlanRelationship; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + RTPlanRelationship.clear(); + } +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + RTPlanRelationship.isEmpty(); +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedRTPlanSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedRTPlanSequence"); + getAndCheckElementFromDataset(item, RTPlanRelationship, "1", "1", "ReferencedRTPlanSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedRTPlanSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedRTPlanSequence"); + addElementToDataset(result, item, new DcmCodeString(RTPlanRelationship), "1", "1", "ReferencedRTPlanSequence"); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::getRTPlanRelationship(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RTPlanRelationship, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::setRTPlanRelationship(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RTPlanRelationship.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::DRTReferencedRTPlanSequenceInRTGeneralPlanModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::DRTReferencedRTPlanSequenceInRTGeneralPlanModule(const DRTReferencedRTPlanSequenceInRTGeneralPlanModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::operator=(const DRTReferencedRTPlanSequenceInRTGeneralPlanModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::~DRTReferencedRTPlanSequenceInRTGeneralPlanModule() +{ + clear(); +} + + +void DRTReferencedRTPlanSequenceInRTGeneralPlanModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralPlanModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralPlanModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedRTPlanSequenceInRTGeneralPlanModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedRTPlanSequenceInRTGeneralPlanModule::Item &DRTReferencedRTPlanSequenceInRTGeneralPlanModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedRTPlanSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedRTPlanSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralPlanModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedRTPlanSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrtps4.cc b/dcmrt/libsrc/drtrrtps4.cc new file mode 100644 index 00000000..afa0c37e --- /dev/null +++ b/dcmrt/libsrc/drtrrtps4.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrtps4.h" + + +// --- item class --- + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::~Item() +{ +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedRTPlanSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedRTPlanSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedRTPlanSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedRTPlanSequence"); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule(const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::operator=(const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::~DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule() +{ + clear(); +} + + +void DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedRTPlanSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedRTPlanSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTGeneralTreatmentRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedRTPlanSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrrtps5.cc b/dcmrt/libsrc/drtrrtps5.cc new file mode 100644 index 00000000..785aaf0b --- /dev/null +++ b/dcmrt/libsrc/drtrrtps5.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedRTPlanSequenceInRTImageModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrrtps5.h" + + +// --- item class --- + +DRTReferencedRTPlanSequenceInRTImageModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequenceInRTImageModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedRTPlanSequenceInRTImageModule::Item::~Item() +{ +} + + +DRTReferencedRTPlanSequenceInRTImageModule::Item &DRTReferencedRTPlanSequenceInRTImageModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedRTPlanSequenceInRTImageModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedRTPlanSequenceInRTImageModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedRTPlanSequenceInRTImageModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedRTPlanSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedRTPlanSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedRTPlanSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedRTPlanSequence"); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedRTPlanSequenceInRTImageModule::DRTReferencedRTPlanSequenceInRTImageModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedRTPlanSequenceInRTImageModule::DRTReferencedRTPlanSequenceInRTImageModule(const DRTReferencedRTPlanSequenceInRTImageModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedRTPlanSequenceInRTImageModule &DRTReferencedRTPlanSequenceInRTImageModule::operator=(const DRTReferencedRTPlanSequenceInRTImageModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedRTPlanSequenceInRTImageModule::~DRTReferencedRTPlanSequenceInRTImageModule() +{ + clear(); +} + + +void DRTReferencedRTPlanSequenceInRTImageModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedRTPlanSequenceInRTImageModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedRTPlanSequenceInRTImageModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedRTPlanSequenceInRTImageModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedRTPlanSequenceInRTImageModule::Item &DRTReferencedRTPlanSequenceInRTImageModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequenceInRTImageModule::Item &DRTReferencedRTPlanSequenceInRTImageModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedRTPlanSequenceInRTImageModule::Item &DRTReferencedRTPlanSequenceInRTImageModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedRTPlanSequenceInRTImageModule::Item &DRTReferencedRTPlanSequenceInRTImageModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedRTPlanSequenceInRTImageModule::Item &DRTReferencedRTPlanSequenceInRTImageModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedRTPlanSequenceInRTImageModule::Item &DRTReferencedRTPlanSequenceInRTImageModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedRTPlanSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedRTPlanSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedRTPlanSequenceInRTImageModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedRTPlanSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrscs.cc b/dcmrt/libsrc/drtrscs.cc new file mode 100644 index 00000000..7f8de565 --- /dev/null +++ b/dcmrt/libsrc/drtrscs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRequestingServiceCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrscs.h" + + +// --- item class --- + +DRTRequestingServiceCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTRequestingServiceCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTRequestingServiceCodeSequence::Item::~Item() +{ +} + + +DRTRequestingServiceCodeSequence::Item &DRTRequestingServiceCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTRequestingServiceCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTRequestingServiceCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTRequestingServiceCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "RequestingServiceCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "RequestingServiceCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "RequestingServiceCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "RequestingServiceCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "RequestingServiceCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "RequestingServiceCodeSequence"); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRequestingServiceCodeSequence::DRTRequestingServiceCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRequestingServiceCodeSequence::DRTRequestingServiceCodeSequence(const DRTRequestingServiceCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRequestingServiceCodeSequence &DRTRequestingServiceCodeSequence::operator=(const DRTRequestingServiceCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRequestingServiceCodeSequence::~DRTRequestingServiceCodeSequence() +{ + clear(); +} + + +void DRTRequestingServiceCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRequestingServiceCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRequestingServiceCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRequestingServiceCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRequestingServiceCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRequestingServiceCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRequestingServiceCodeSequence::Item &DRTRequestingServiceCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRequestingServiceCodeSequence::Item &DRTRequestingServiceCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRequestingServiceCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRequestingServiceCodeSequence::Item &DRTRequestingServiceCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRequestingServiceCodeSequence::Item &DRTRequestingServiceCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRequestingServiceCodeSequence::Item &DRTRequestingServiceCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRequestingServiceCodeSequence::Item &DRTRequestingServiceCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRequestingServiceCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RequestingServiceCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RequestingServiceCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRequestingServiceCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RequestingServiceCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrsers.cc b/dcmrt/libsrc/drtrsers.cc new file mode 100644 index 00000000..a72557cd --- /dev/null +++ b/dcmrt/libsrc/drtrsers.cc @@ -0,0 +1,551 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedSeriesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrsers.h" + + +// --- item class --- + +DRTReferencedSeriesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedInstanceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SeriesInstanceUID(DCM_SeriesInstanceUID) +{ +} + + +DRTReferencedSeriesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + SeriesInstanceUID(copy.SeriesInstanceUID) +{ +} + + +DRTReferencedSeriesSequence::Item::~Item() +{ +} + + +DRTReferencedSeriesSequence::Item &DRTReferencedSeriesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + SeriesInstanceUID = copy.SeriesInstanceUID; + } + return *this; +} + + +void DRTReferencedSeriesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SeriesInstanceUID.clear(); + ReferencedInstanceSequence.clear(); + } +} + + +OFBool DRTReferencedSeriesSequence::Item::isEmpty() +{ + return SeriesInstanceUID.isEmpty() && + ReferencedInstanceSequence.isEmpty(); +} + + +OFBool DRTReferencedSeriesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedSeriesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SeriesInstanceUID, "1", "1", "ReferencedSeriesSequence"); + ReferencedInstanceSequence.read(item, "1-n", "1", "ReferencedSeriesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "ReferencedSeriesSequence"); + if (result.good()) result = ReferencedInstanceSequence.write(item, "1-n", "1", "ReferencedSeriesSequence"); + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::Item::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTReferencedSeriesSequence::Item::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedSeriesSequence::DRTReferencedSeriesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedSeriesSequence::DRTReferencedSeriesSequence(const DRTReferencedSeriesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedSeriesSequence &DRTReferencedSeriesSequence::operator=(const DRTReferencedSeriesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedSeriesSequence::~DRTReferencedSeriesSequence() +{ + clear(); +} + + +void DRTReferencedSeriesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedSeriesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedSeriesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedSeriesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedSeriesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedSeriesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedSeriesSequence::Item &DRTReferencedSeriesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedSeriesSequence::Item &DRTReferencedSeriesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedSeriesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedSeriesSequence::Item &DRTReferencedSeriesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedSeriesSequence::Item &DRTReferencedSeriesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedSeriesSequence::Item &DRTReferencedSeriesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedSeriesSequence::Item &DRTReferencedSeriesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedSeriesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedSeriesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedSeriesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedSeriesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedSeriesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrses.cc b/dcmrt/libsrc/drtrses.cc new file mode 100644 index 00000000..0945ebd9 --- /dev/null +++ b/dcmrt/libsrc/drtrses.cc @@ -0,0 +1,551 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRTReferencedSeriesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrses.h" + + +// --- item class --- + +DRTRTReferencedSeriesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ContourImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + SeriesInstanceUID(DCM_SeriesInstanceUID) +{ +} + + +DRTRTReferencedSeriesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ContourImageSequence(copy.ContourImageSequence), + SeriesInstanceUID(copy.SeriesInstanceUID) +{ +} + + +DRTRTReferencedSeriesSequence::Item::~Item() +{ +} + + +DRTRTReferencedSeriesSequence::Item &DRTRTReferencedSeriesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ContourImageSequence = copy.ContourImageSequence; + SeriesInstanceUID = copy.SeriesInstanceUID; + } + return *this; +} + + +void DRTRTReferencedSeriesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SeriesInstanceUID.clear(); + ContourImageSequence.clear(); + } +} + + +OFBool DRTRTReferencedSeriesSequence::Item::isEmpty() +{ + return SeriesInstanceUID.isEmpty() && + ContourImageSequence.isEmpty(); +} + + +OFBool DRTRTReferencedSeriesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRTReferencedSeriesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SeriesInstanceUID, "1", "1", "RTReferencedSeriesSequence"); + ContourImageSequence.read(item, "1-n", "1", "RTReferencedSeriesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTReferencedSeriesSequence"); + if (result.good()) result = ContourImageSequence.write(item, "1-n", "1", "RTReferencedSeriesSequence"); + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::Item::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTRTReferencedSeriesSequence::Item::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRTReferencedSeriesSequence::DRTRTReferencedSeriesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRTReferencedSeriesSequence::DRTRTReferencedSeriesSequence(const DRTRTReferencedSeriesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRTReferencedSeriesSequence &DRTRTReferencedSeriesSequence::operator=(const DRTRTReferencedSeriesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRTReferencedSeriesSequence::~DRTRTReferencedSeriesSequence() +{ + clear(); +} + + +void DRTRTReferencedSeriesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRTReferencedSeriesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRTReferencedSeriesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRTReferencedSeriesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRTReferencedSeriesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRTReferencedSeriesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRTReferencedSeriesSequence::Item &DRTRTReferencedSeriesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRTReferencedSeriesSequence::Item &DRTRTReferencedSeriesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRTReferencedSeriesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRTReferencedSeriesSequence::Item &DRTRTReferencedSeriesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRTReferencedSeriesSequence::Item &DRTRTReferencedSeriesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRTReferencedSeriesSequence::Item &DRTRTReferencedSeriesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRTReferencedSeriesSequence::Item &DRTRTReferencedSeriesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRTReferencedSeriesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RTReferencedSeriesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RTReferencedSeriesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRTReferencedSeriesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RTReferencedSeriesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrshs.cc b/dcmrt/libsrc/drtrshs.cc new file mode 100644 index 00000000..2cc059d0 --- /dev/null +++ b/dcmrt/libsrc/drtrshs.cc @@ -0,0 +1,669 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRangeShifterSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrshs.h" + + +// --- item class --- + +DRTRangeShifterSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + RangeShifterDescription(DCM_RangeShifterDescription), + RangeShifterID(DCM_RangeShifterID), + RangeShifterNumber(DCM_RangeShifterNumber), + RangeShifterType(DCM_RangeShifterType) +{ +} + + +DRTRangeShifterSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + RangeShifterDescription(copy.RangeShifterDescription), + RangeShifterID(copy.RangeShifterID), + RangeShifterNumber(copy.RangeShifterNumber), + RangeShifterType(copy.RangeShifterType) +{ +} + + +DRTRangeShifterSequence::Item::~Item() +{ +} + + +DRTRangeShifterSequence::Item &DRTRangeShifterSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + RangeShifterDescription = copy.RangeShifterDescription; + RangeShifterID = copy.RangeShifterID; + RangeShifterNumber = copy.RangeShifterNumber; + RangeShifterType = copy.RangeShifterType; + } + return *this; +} + + +void DRTRangeShifterSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RangeShifterNumber.clear(); + RangeShifterID.clear(); + AccessoryCode.clear(); + RangeShifterType.clear(); + RangeShifterDescription.clear(); + } +} + + +OFBool DRTRangeShifterSequence::Item::isEmpty() +{ + return RangeShifterNumber.isEmpty() && + RangeShifterID.isEmpty() && + AccessoryCode.isEmpty() && + RangeShifterType.isEmpty() && + RangeShifterDescription.isEmpty(); +} + + +OFBool DRTRangeShifterSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRangeShifterSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RangeShifterNumber, "1", "1", "RangeShifterSequence"); + getAndCheckElementFromDataset(item, RangeShifterID, "1", "1", "RangeShifterSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RangeShifterSequence"); + getAndCheckElementFromDataset(item, RangeShifterType, "1", "1", "RangeShifterSequence"); + getAndCheckElementFromDataset(item, RangeShifterDescription, "1", "3", "RangeShifterSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(RangeShifterNumber), "1", "1", "RangeShifterSequence"); + addElementToDataset(result, item, new DcmShortString(RangeShifterID), "1", "1", "RangeShifterSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RangeShifterSequence"); + addElementToDataset(result, item, new DcmCodeString(RangeShifterType), "1", "1", "RangeShifterSequence"); + addElementToDataset(result, item, new DcmLongString(RangeShifterDescription), "1", "3", "RangeShifterSequence"); + } + return result; +} + + +OFCondition DRTRangeShifterSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRangeShifterSequence::Item::getRangeShifterDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeShifterDescription, value, pos); +} + + +OFCondition DRTRangeShifterSequence::Item::getRangeShifterID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeShifterID, value, pos); +} + + +OFCondition DRTRangeShifterSequence::Item::getRangeShifterNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeShifterNumber, value, pos); +} + + +OFCondition DRTRangeShifterSequence::Item::getRangeShifterNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, RangeShifterNumber).getSint32(value, pos); +} + + +OFCondition DRTRangeShifterSequence::Item::getRangeShifterType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeShifterType, value, pos); +} + + +OFCondition DRTRangeShifterSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeShifterSequence::Item::setRangeShifterDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeShifterDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeShifterSequence::Item::setRangeShifterID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeShifterID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeShifterSequence::Item::setRangeShifterNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeShifterNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeShifterSequence::Item::setRangeShifterType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeShifterType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRangeShifterSequence::DRTRangeShifterSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRangeShifterSequence::DRTRangeShifterSequence(const DRTRangeShifterSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRangeShifterSequence &DRTRangeShifterSequence::operator=(const DRTRangeShifterSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRangeShifterSequence::~DRTRangeShifterSequence() +{ + clear(); +} + + +void DRTRangeShifterSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRangeShifterSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRangeShifterSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRangeShifterSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRangeShifterSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRangeShifterSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRangeShifterSequence::Item &DRTRangeShifterSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRangeShifterSequence::Item &DRTRangeShifterSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRangeShifterSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRangeShifterSequence::Item &DRTRangeShifterSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRangeShifterSequence::Item &DRTRangeShifterSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRangeShifterSequence::Item &DRTRangeShifterSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRangeShifterSequence::Item &DRTRangeShifterSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRangeShifterSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRangeShifterSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRangeShifterSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RangeShifterSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RangeShifterSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRangeShifterSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RangeShifterSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrshs6.cc b/dcmrt/libsrc/drtrshs6.cc new file mode 100644 index 00000000..2eba9102 --- /dev/null +++ b/dcmrt/libsrc/drtrshs6.cc @@ -0,0 +1,632 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRangeShifterSettingsSequenceInRTIonBeamsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrshs6.h" + + +// --- item class --- + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + IsocenterToRangeShifterDistance(DCM_IsocenterToRangeShifterDistance), + RangeShifterSetting(DCM_RangeShifterSetting), + RangeShifterWaterEquivalentThickness(DCM_RangeShifterWaterEquivalentThickness), + ReferencedRangeShifterNumber(DCM_ReferencedRangeShifterNumber) +{ +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + IsocenterToRangeShifterDistance(copy.IsocenterToRangeShifterDistance), + RangeShifterSetting(copy.RangeShifterSetting), + RangeShifterWaterEquivalentThickness(copy.RangeShifterWaterEquivalentThickness), + ReferencedRangeShifterNumber(copy.ReferencedRangeShifterNumber) +{ +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::~Item() +{ +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + IsocenterToRangeShifterDistance = copy.IsocenterToRangeShifterDistance; + RangeShifterSetting = copy.RangeShifterSetting; + RangeShifterWaterEquivalentThickness = copy.RangeShifterWaterEquivalentThickness; + ReferencedRangeShifterNumber = copy.ReferencedRangeShifterNumber; + } + return *this; +} + + +void DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedRangeShifterNumber.clear(); + RangeShifterSetting.clear(); + IsocenterToRangeShifterDistance.clear(); + RangeShifterWaterEquivalentThickness.clear(); + } +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::isEmpty() +{ + return ReferencedRangeShifterNumber.isEmpty() && + RangeShifterSetting.isEmpty() && + IsocenterToRangeShifterDistance.isEmpty() && + RangeShifterWaterEquivalentThickness.isEmpty(); +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedRangeShifterNumber, "1", "1", "RangeShifterSettingsSequence"); + getAndCheckElementFromDataset(item, RangeShifterSetting, "1", "1", "RangeShifterSettingsSequence"); + getAndCheckElementFromDataset(item, IsocenterToRangeShifterDistance, "1", "3", "RangeShifterSettingsSequence"); + getAndCheckElementFromDataset(item, RangeShifterWaterEquivalentThickness, "1", "3", "RangeShifterSettingsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedRangeShifterNumber), "1", "1", "RangeShifterSettingsSequence"); + addElementToDataset(result, item, new DcmLongString(RangeShifterSetting), "1", "1", "RangeShifterSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(IsocenterToRangeShifterDistance), "1", "3", "RangeShifterSettingsSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(RangeShifterWaterEquivalentThickness), "1", "3", "RangeShifterSettingsSequence"); + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::getIsocenterToRangeShifterDistance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, IsocenterToRangeShifterDistance).getFloat32(value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::getRangeShifterSetting(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeShifterSetting, value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::getRangeShifterWaterEquivalentThickness(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, RangeShifterWaterEquivalentThickness).getFloat32(value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::getReferencedRangeShifterNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedRangeShifterNumber, value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::getReferencedRangeShifterNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedRangeShifterNumber).getSint32(value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::setIsocenterToRangeShifterDistance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return IsocenterToRangeShifterDistance.putFloat32(value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::setRangeShifterSetting(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeShifterSetting.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::setRangeShifterWaterEquivalentThickness(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RangeShifterWaterEquivalentThickness.putFloat32(value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item::setReferencedRangeShifterNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedRangeShifterNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::DRTRangeShifterSettingsSequenceInRTIonBeamsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::DRTRangeShifterSettingsSequenceInRTIonBeamsModule(const DRTRangeShifterSettingsSequenceInRTIonBeamsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::operator=(const DRTRangeShifterSettingsSequenceInRTIonBeamsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::~DRTRangeShifterSettingsSequenceInRTIonBeamsModule() +{ + clear(); +} + + +void DRTRangeShifterSettingsSequenceInRTIonBeamsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRangeShifterSettingsSequenceInRTIonBeamsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRangeShifterSettingsSequenceInRTIonBeamsModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RangeShifterSettingsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RangeShifterSettingsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RangeShifterSettingsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrshs7.cc b/dcmrt/libsrc/drtrshs7.cc new file mode 100644 index 00000000..45a8e6c6 --- /dev/null +++ b/dcmrt/libsrc/drtrshs7.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrshs7.h" + + +// --- item class --- + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RangeShifterSetting(DCM_RangeShifterSetting), + ReferencedRangeShifterNumber(DCM_ReferencedRangeShifterNumber) +{ +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RangeShifterSetting(copy.RangeShifterSetting), + ReferencedRangeShifterNumber(copy.ReferencedRangeShifterNumber) +{ +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::~Item() +{ +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RangeShifterSetting = copy.RangeShifterSetting; + ReferencedRangeShifterNumber = copy.ReferencedRangeShifterNumber; + } + return *this; +} + + +void DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedRangeShifterNumber.clear(); + RangeShifterSetting.clear(); + } +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::isEmpty() +{ + return ReferencedRangeShifterNumber.isEmpty() && + RangeShifterSetting.isEmpty(); +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedRangeShifterNumber, "1", "1", "RangeShifterSettingsSequence"); + getAndCheckElementFromDataset(item, RangeShifterSetting, "1", "1", "RangeShifterSettingsSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedRangeShifterNumber), "1", "1", "RangeShifterSettingsSequence"); + addElementToDataset(result, item, new DcmLongString(RangeShifterSetting), "1", "1", "RangeShifterSettingsSequence"); + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getRangeShifterSetting(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RangeShifterSetting, value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedRangeShifterNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedRangeShifterNumber, value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::getReferencedRangeShifterNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedRangeShifterNumber).getSint32(value, pos); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::setRangeShifterSetting(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RangeShifterSetting.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item::setReferencedRangeShifterNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedRangeShifterNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule(const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::operator=(const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::~DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule() +{ + clear(); +} + + +void DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::Item &DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RangeShifterSettingsSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RangeShifterSettingsSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RangeShifterSettingsSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrsis.cc b/dcmrt/libsrc/drtrsis.cc new file mode 100644 index 00000000..2bdba75b --- /dev/null +++ b/dcmrt/libsrc/drtrsis.cc @@ -0,0 +1,665 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedSetupImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrsis.h" + + +// --- item class --- + +DRTReferencedSetupImageSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedFrameNumber(DCM_ReferencedFrameNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + ReferencedSegmentNumber(DCM_ReferencedSegmentNumber), + SetupImageComment(DCM_SetupImageComment) +{ +} + + +DRTReferencedSetupImageSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedFrameNumber(copy.ReferencedFrameNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + ReferencedSegmentNumber(copy.ReferencedSegmentNumber), + SetupImageComment(copy.SetupImageComment) +{ +} + + +DRTReferencedSetupImageSequence::Item::~Item() +{ +} + + +DRTReferencedSetupImageSequence::Item &DRTReferencedSetupImageSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedFrameNumber = copy.ReferencedFrameNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + ReferencedSegmentNumber = copy.ReferencedSegmentNumber; + SetupImageComment = copy.SetupImageComment; + } + return *this; +} + + +void DRTReferencedSetupImageSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SetupImageComment.clear(); + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferencedFrameNumber.clear(); + ReferencedSegmentNumber.clear(); + } +} + + +OFBool DRTReferencedSetupImageSequence::Item::isEmpty() +{ + return SetupImageComment.isEmpty() && + ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferencedFrameNumber.isEmpty() && + ReferencedSegmentNumber.isEmpty(); +} + + +OFBool DRTReferencedSetupImageSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedSetupImageSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SetupImageComment, "1", "3", "ReferencedSetupImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedSetupImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedSetupImageSequence"); + getAndCheckElementFromDataset(item, ReferencedFrameNumber, "1-n", "1C", "ReferencedSetupImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSegmentNumber, "1-n", "1C", "ReferencedSetupImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortText(SetupImageComment), "1", "3", "ReferencedSetupImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedSetupImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedSetupImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedFrameNumber), "1-n", "1C", "ReferencedSetupImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(ReferencedSegmentNumber), "1-n", "1C", "ReferencedSetupImageSequence"); + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::Item::getReferencedFrameNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameNumber, value, pos); +} + + +OFCondition DRTReferencedSetupImageSequence::Item::getReferencedFrameNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFrameNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedSetupImageSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedSetupImageSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedSetupImageSequence::Item::getReferencedSegmentNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ReferencedSegmentNumber).getUint16(value, pos); +} + + +OFCondition DRTReferencedSetupImageSequence::Item::getSetupImageComment(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupImageComment, value, pos); +} + + +OFCondition DRTReferencedSetupImageSequence::Item::setReferencedFrameNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ReferencedFrameNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::Item::setReferencedSegmentNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ReferencedSegmentNumber.putUint16(value, pos); +} + + +OFCondition DRTReferencedSetupImageSequence::Item::setSetupImageComment(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SetupImageComment.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedSetupImageSequence::DRTReferencedSetupImageSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedSetupImageSequence::DRTReferencedSetupImageSequence(const DRTReferencedSetupImageSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedSetupImageSequence &DRTReferencedSetupImageSequence::operator=(const DRTReferencedSetupImageSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedSetupImageSequence::~DRTReferencedSetupImageSequence() +{ + clear(); +} + + +void DRTReferencedSetupImageSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedSetupImageSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedSetupImageSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedSetupImageSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedSetupImageSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedSetupImageSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedSetupImageSequence::Item &DRTReferencedSetupImageSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedSetupImageSequence::Item &DRTReferencedSetupImageSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedSetupImageSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedSetupImageSequence::Item &DRTReferencedSetupImageSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedSetupImageSequence::Item &DRTReferencedSetupImageSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedSetupImageSequence::Item &DRTReferencedSetupImageSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedSetupImageSequence::Item &DRTReferencedSetupImageSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedSetupImageSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedSetupImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedSetupImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedSetupImageSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedSetupImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrsns.cc b/dcmrt/libsrc/drtrsns.cc new file mode 100644 index 00000000..8e3753fb --- /dev/null +++ b/dcmrt/libsrc/drtrsns.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRecordedSnoutSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrsns.h" + + +// --- item class --- + +DRTRecordedSnoutSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + SnoutID(DCM_SnoutID) +{ +} + + +DRTRecordedSnoutSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + SnoutID(copy.SnoutID) +{ +} + + +DRTRecordedSnoutSequence::Item::~Item() +{ +} + + +DRTRecordedSnoutSequence::Item &DRTRecordedSnoutSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + SnoutID = copy.SnoutID; + } + return *this; +} + + +void DRTRecordedSnoutSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SnoutID.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTRecordedSnoutSequence::Item::isEmpty() +{ + return SnoutID.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTRecordedSnoutSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRecordedSnoutSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SnoutID, "1", "1", "RecordedSnoutSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RecordedSnoutSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(SnoutID), "1", "1", "RecordedSnoutSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RecordedSnoutSequence"); + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRecordedSnoutSequence::Item::getSnoutID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SnoutID, value, pos); +} + + +OFCondition DRTRecordedSnoutSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::Item::setSnoutID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SnoutID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRecordedSnoutSequence::DRTRecordedSnoutSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRecordedSnoutSequence::DRTRecordedSnoutSequence(const DRTRecordedSnoutSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRecordedSnoutSequence &DRTRecordedSnoutSequence::operator=(const DRTRecordedSnoutSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRecordedSnoutSequence::~DRTRecordedSnoutSequence() +{ + clear(); +} + + +void DRTRecordedSnoutSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRecordedSnoutSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRecordedSnoutSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRecordedSnoutSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRecordedSnoutSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRecordedSnoutSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRecordedSnoutSequence::Item &DRTRecordedSnoutSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRecordedSnoutSequence::Item &DRTRecordedSnoutSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRecordedSnoutSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRecordedSnoutSequence::Item &DRTRecordedSnoutSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRecordedSnoutSequence::Item &DRTRecordedSnoutSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRecordedSnoutSequence::Item &DRTRecordedSnoutSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRecordedSnoutSequence::Item &DRTRecordedSnoutSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRecordedSnoutSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RecordedSnoutSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RecordedSnoutSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRecordedSnoutSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RecordedSnoutSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrsos.cc b/dcmrt/libsrc/drtrsos.cc new file mode 100644 index 00000000..2ac0dd7c --- /dev/null +++ b/dcmrt/libsrc/drtrsos.cc @@ -0,0 +1,665 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedSOPSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrsos.h" + + +// --- item class --- + +DRTReferencedSOPSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + HL7InstanceIdentifier(DCM_HL7InstanceIdentifier), + ReferencedFrameNumber(DCM_ReferencedFrameNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + ReferencedSegmentNumber(DCM_ReferencedSegmentNumber) +{ +} + + +DRTReferencedSOPSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + HL7InstanceIdentifier(copy.HL7InstanceIdentifier), + ReferencedFrameNumber(copy.ReferencedFrameNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + ReferencedSegmentNumber(copy.ReferencedSegmentNumber) +{ +} + + +DRTReferencedSOPSequence::Item::~Item() +{ +} + + +DRTReferencedSOPSequence::Item &DRTReferencedSOPSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + HL7InstanceIdentifier = copy.HL7InstanceIdentifier; + ReferencedFrameNumber = copy.ReferencedFrameNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + ReferencedSegmentNumber = copy.ReferencedSegmentNumber; + } + return *this; +} + + +void DRTReferencedSOPSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + HL7InstanceIdentifier.clear(); + ReferencedFrameNumber.clear(); + ReferencedSegmentNumber.clear(); + } +} + + +OFBool DRTReferencedSOPSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + HL7InstanceIdentifier.isEmpty() && + ReferencedFrameNumber.isEmpty() && + ReferencedSegmentNumber.isEmpty(); +} + + +OFBool DRTReferencedSOPSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedSOPSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedSOPSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedSOPSequence"); + getAndCheckElementFromDataset(item, HL7InstanceIdentifier, "1", "1C", "ReferencedSOPSequence"); + getAndCheckElementFromDataset(item, ReferencedFrameNumber, "1-n", "1C", "ReferencedSOPSequence"); + getAndCheckElementFromDataset(item, ReferencedSegmentNumber, "1-n", "1C", "ReferencedSOPSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedSOPSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedSOPSequence"); + addElementToDataset(result, item, new DcmShortText(HL7InstanceIdentifier), "1", "1C", "ReferencedSOPSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedFrameNumber), "1-n", "1C", "ReferencedSOPSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(ReferencedSegmentNumber), "1-n", "1C", "ReferencedSOPSequence"); + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::Item::getHL7InstanceIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(HL7InstanceIdentifier, value, pos); +} + + +OFCondition DRTReferencedSOPSequence::Item::getReferencedFrameNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameNumber, value, pos); +} + + +OFCondition DRTReferencedSOPSequence::Item::getReferencedFrameNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFrameNumber).getSint32(value, pos); +} + + +OFCondition DRTReferencedSOPSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedSOPSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedSOPSequence::Item::getReferencedSegmentNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ReferencedSegmentNumber).getUint16(value, pos); +} + + +OFCondition DRTReferencedSOPSequence::Item::setHL7InstanceIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = HL7InstanceIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::Item::setReferencedFrameNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ReferencedFrameNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::Item::setReferencedSegmentNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ReferencedSegmentNumber.putUint16(value, pos); +} + + +// --- sequence class --- + +DRTReferencedSOPSequence::DRTReferencedSOPSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedSOPSequence::DRTReferencedSOPSequence(const DRTReferencedSOPSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedSOPSequence &DRTReferencedSOPSequence::operator=(const DRTReferencedSOPSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedSOPSequence::~DRTReferencedSOPSequence() +{ + clear(); +} + + +void DRTReferencedSOPSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedSOPSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedSOPSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedSOPSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedSOPSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedSOPSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedSOPSequence::Item &DRTReferencedSOPSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedSOPSequence::Item &DRTReferencedSOPSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedSOPSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedSOPSequence::Item &DRTReferencedSOPSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedSOPSequence::Item &DRTReferencedSOPSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedSOPSequence::Item &DRTReferencedSOPSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedSOPSequence::Item &DRTReferencedSOPSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedSOPSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedSOPSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedSOPSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedSOPSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedSOPSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrsrs.cc b/dcmrt/libsrc/drtrsrs.cc new file mode 100644 index 00000000..69f0edad --- /dev/null +++ b/dcmrt/libsrc/drtrsrs.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedSpatialRegistrationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrsrs.h" + + +// --- item class --- + +DRTReferencedSpatialRegistrationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedSpatialRegistrationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedSpatialRegistrationSequence::Item::~Item() +{ +} + + +DRTReferencedSpatialRegistrationSequence::Item &DRTReferencedSpatialRegistrationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedSpatialRegistrationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedSpatialRegistrationSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedSpatialRegistrationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedSpatialRegistrationSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedSpatialRegistrationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedSpatialRegistrationSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedSpatialRegistrationSequence"); + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedSpatialRegistrationSequence::DRTReferencedSpatialRegistrationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedSpatialRegistrationSequence::DRTReferencedSpatialRegistrationSequence(const DRTReferencedSpatialRegistrationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedSpatialRegistrationSequence &DRTReferencedSpatialRegistrationSequence::operator=(const DRTReferencedSpatialRegistrationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedSpatialRegistrationSequence::~DRTReferencedSpatialRegistrationSequence() +{ + clear(); +} + + +void DRTReferencedSpatialRegistrationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedSpatialRegistrationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedSpatialRegistrationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedSpatialRegistrationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedSpatialRegistrationSequence::Item &DRTReferencedSpatialRegistrationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedSpatialRegistrationSequence::Item &DRTReferencedSpatialRegistrationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedSpatialRegistrationSequence::Item &DRTReferencedSpatialRegistrationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedSpatialRegistrationSequence::Item &DRTReferencedSpatialRegistrationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedSpatialRegistrationSequence::Item &DRTReferencedSpatialRegistrationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedSpatialRegistrationSequence::Item &DRTReferencedSpatialRegistrationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedSpatialRegistrationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedSpatialRegistrationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedSpatialRegistrationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedSpatialRegistrationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrss.cc b/dcmrt/libsrc/drtrss.cc new file mode 100644 index 00000000..8b276972 --- /dev/null +++ b/dcmrt/libsrc/drtrss.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedStudySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrss.h" + + +// --- item class --- + +DRTReferencedStudySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedStudySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedStudySequence::Item::~Item() +{ +} + + +DRTReferencedStudySequence::Item &DRTReferencedStudySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedStudySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedStudySequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedStudySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedStudySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedStudySequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedStudySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedStudySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedStudySequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedStudySequence"); + } + return result; +} + + +OFCondition DRTReferencedStudySequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedStudySequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedStudySequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedStudySequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedStudySequence::DRTReferencedStudySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedStudySequence::DRTReferencedStudySequence(const DRTReferencedStudySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedStudySequence &DRTReferencedStudySequence::operator=(const DRTReferencedStudySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedStudySequence::~DRTReferencedStudySequence() +{ + clear(); +} + + +void DRTReferencedStudySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedStudySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedStudySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedStudySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedStudySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedStudySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedStudySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedStudySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedStudySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedStudySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedStudySequence::Item &DRTReferencedStudySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedStudySequence::Item &DRTReferencedStudySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedStudySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedStudySequence::Item &DRTReferencedStudySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedStudySequence::Item &DRTReferencedStudySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedStudySequence::Item &DRTReferencedStudySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedStudySequence::Item &DRTReferencedStudySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedStudySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedStudySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedStudySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedStudySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedStudySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedStudySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedStudySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedStudySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrsss.cc b/dcmrt/libsrc/drtrsss.cc new file mode 100644 index 00000000..46e3250c --- /dev/null +++ b/dcmrt/libsrc/drtrsss.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedStructureSetSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrsss.h" + + +// --- item class --- + +DRTReferencedStructureSetSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedStructureSetSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedStructureSetSequence::Item::~Item() +{ +} + + +DRTReferencedStructureSetSequence::Item &DRTReferencedStructureSetSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedStructureSetSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedStructureSetSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedStructureSetSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedStructureSetSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedStructureSetSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedStructureSetSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedStructureSetSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedStructureSetSequence"); + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedStructureSetSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedStructureSetSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedStructureSetSequence::DRTReferencedStructureSetSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedStructureSetSequence::DRTReferencedStructureSetSequence(const DRTReferencedStructureSetSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedStructureSetSequence &DRTReferencedStructureSetSequence::operator=(const DRTReferencedStructureSetSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedStructureSetSequence::~DRTReferencedStructureSetSequence() +{ + clear(); +} + + +void DRTReferencedStructureSetSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedStructureSetSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedStructureSetSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedStructureSetSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedStructureSetSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedStructureSetSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedStructureSetSequence::Item &DRTReferencedStructureSetSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedStructureSetSequence::Item &DRTReferencedStructureSetSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedStructureSetSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedStructureSetSequence::Item &DRTReferencedStructureSetSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedStructureSetSequence::Item &DRTReferencedStructureSetSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedStructureSetSequence::Item &DRTReferencedStructureSetSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedStructureSetSequence::Item &DRTReferencedStructureSetSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedStructureSetSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedStructureSetSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedStructureSetSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedStructureSetSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedStructureSetSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrsts.cc b/dcmrt/libsrc/drtrsts.cc new file mode 100644 index 00000000..7ffb7c80 --- /dev/null +++ b/dcmrt/libsrc/drtrsts.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRTReferencedStudySequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrsts.h" + + +// --- item class --- + +DRTRTReferencedStudySequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RTReferencedSeriesSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTRTReferencedStudySequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RTReferencedSeriesSequence(copy.RTReferencedSeriesSequence), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTRTReferencedStudySequence::Item::~Item() +{ +} + + +DRTRTReferencedStudySequence::Item &DRTRTReferencedStudySequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RTReferencedSeriesSequence = copy.RTReferencedSeriesSequence; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTRTReferencedStudySequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + RTReferencedSeriesSequence.clear(); + } +} + + +OFBool DRTRTReferencedStudySequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + RTReferencedSeriesSequence.isEmpty(); +} + + +OFBool DRTRTReferencedStudySequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRTReferencedStudySequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "RTReferencedStudySequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "RTReferencedStudySequence"); + RTReferencedSeriesSequence.read(item, "1-n", "1", "RTReferencedStudySequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "RTReferencedStudySequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "RTReferencedStudySequence"); + if (result.good()) result = RTReferencedSeriesSequence.write(item, "1-n", "1", "RTReferencedStudySequence"); + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTRTReferencedStudySequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTRTReferencedStudySequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRTReferencedStudySequence::DRTRTReferencedStudySequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRTReferencedStudySequence::DRTRTReferencedStudySequence(const DRTRTReferencedStudySequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRTReferencedStudySequence &DRTRTReferencedStudySequence::operator=(const DRTRTReferencedStudySequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRTReferencedStudySequence::~DRTRTReferencedStudySequence() +{ + clear(); +} + + +void DRTRTReferencedStudySequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRTReferencedStudySequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRTReferencedStudySequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRTReferencedStudySequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRTReferencedStudySequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRTReferencedStudySequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRTReferencedStudySequence::Item &DRTRTReferencedStudySequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRTReferencedStudySequence::Item &DRTRTReferencedStudySequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRTReferencedStudySequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRTReferencedStudySequence::Item &DRTRTReferencedStudySequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRTReferencedStudySequence::Item &DRTRTReferencedStudySequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRTReferencedStudySequence::Item &DRTRTReferencedStudySequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRTReferencedStudySequence::Item &DRTRTReferencedStudySequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRTReferencedStudySequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RTReferencedStudySequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RTReferencedStudySequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRTReferencedStudySequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RTReferencedStudySequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrtrs2.cc b/dcmrt/libsrc/drtrtrs2.cc new file mode 100644 index 00000000..ab4529da --- /dev/null +++ b/dcmrt/libsrc/drtrtrs2.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedTreatmentRecordSequenceInRTDoseModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrtrs2.h" + + +// --- item class --- + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedBeamSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedBeamSequence(copy.ReferencedBeamSequence), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::~Item() +{ +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item &DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedBeamSequence = copy.ReferencedBeamSequence; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferencedBeamSequence.clear(); + } +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferencedBeamSequence.isEmpty(); +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedTreatmentRecordSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedTreatmentRecordSequence"); + ReferencedBeamSequence.read(item, "1-n", "1C", "ReferencedTreatmentRecordSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedTreatmentRecordSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedTreatmentRecordSequence"); + if (result.good()) result = ReferencedBeamSequence.write(item, "1-n", "1C", "ReferencedTreatmentRecordSequence"); + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::DRTReferencedTreatmentRecordSequenceInRTDoseModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::DRTReferencedTreatmentRecordSequenceInRTDoseModule(const DRTReferencedTreatmentRecordSequenceInRTDoseModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule &DRTReferencedTreatmentRecordSequenceInRTDoseModule::operator=(const DRTReferencedTreatmentRecordSequenceInRTDoseModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::~DRTReferencedTreatmentRecordSequenceInRTDoseModule() +{ + clear(); +} + + +void DRTReferencedTreatmentRecordSequenceInRTDoseModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTDoseModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTDoseModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedTreatmentRecordSequenceInRTDoseModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item &DRTReferencedTreatmentRecordSequenceInRTDoseModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item &DRTReferencedTreatmentRecordSequenceInRTDoseModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item &DRTReferencedTreatmentRecordSequenceInRTDoseModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item &DRTReferencedTreatmentRecordSequenceInRTDoseModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item &DRTReferencedTreatmentRecordSequenceInRTDoseModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedTreatmentRecordSequenceInRTDoseModule::Item &DRTReferencedTreatmentRecordSequenceInRTDoseModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedTreatmentRecordSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedTreatmentRecordSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTDoseModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedTreatmentRecordSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrtrs4.cc b/dcmrt/libsrc/drtrtrs4.cc new file mode 100644 index 00000000..fa81902f --- /dev/null +++ b/dcmrt/libsrc/drtrtrs4.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrtrs4.h" + + +// --- item class --- + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::~Item() +{ +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedTreatmentRecordSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedTreatmentRecordSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedTreatmentRecordSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedTreatmentRecordSequence"); + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule(const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::operator=(const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::~DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule() +{ + clear(); +} + + +void DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::Item &DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedTreatmentRecordSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedTreatmentRecordSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedTreatmentRecordSequenceInRTGeneralTreatmentRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedTreatmentRecordSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrvis.cc b/dcmrt/libsrc/drtrvis.cc new file mode 100644 index 00000000..31aa5caa --- /dev/null +++ b/dcmrt/libsrc/drtrvis.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTReferencedVerificationImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrvis.h" + + +// --- item class --- + +DRTReferencedVerificationImageSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedVerificationImageSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTReferencedVerificationImageSequence::Item::~Item() +{ +} + + +DRTReferencedVerificationImageSequence::Item &DRTReferencedVerificationImageSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTReferencedVerificationImageSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + } +} + + +OFBool DRTReferencedVerificationImageSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty(); +} + + +OFBool DRTReferencedVerificationImageSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTReferencedVerificationImageSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "ReferencedVerificationImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "ReferencedVerificationImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "ReferencedVerificationImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "ReferencedVerificationImageSequence"); + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTReferencedVerificationImageSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTReferencedVerificationImageSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTReferencedVerificationImageSequence::DRTReferencedVerificationImageSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTReferencedVerificationImageSequence::DRTReferencedVerificationImageSequence(const DRTReferencedVerificationImageSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTReferencedVerificationImageSequence &DRTReferencedVerificationImageSequence::operator=(const DRTReferencedVerificationImageSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTReferencedVerificationImageSequence::~DRTReferencedVerificationImageSequence() +{ + clear(); +} + + +void DRTReferencedVerificationImageSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTReferencedVerificationImageSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTReferencedVerificationImageSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTReferencedVerificationImageSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTReferencedVerificationImageSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTReferencedVerificationImageSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTReferencedVerificationImageSequence::Item &DRTReferencedVerificationImageSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTReferencedVerificationImageSequence::Item &DRTReferencedVerificationImageSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTReferencedVerificationImageSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTReferencedVerificationImageSequence::Item &DRTReferencedVerificationImageSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTReferencedVerificationImageSequence::Item &DRTReferencedVerificationImageSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTReferencedVerificationImageSequence::Item &DRTReferencedVerificationImageSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTReferencedVerificationImageSequence::Item &DRTReferencedVerificationImageSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTReferencedVerificationImageSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ReferencedVerificationImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ReferencedVerificationImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTReferencedVerificationImageSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ReferencedVerificationImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrws.cc b/dcmrt/libsrc/drtrws.cc new file mode 100644 index 00000000..2484dae8 --- /dev/null +++ b/dcmrt/libsrc/drtrws.cc @@ -0,0 +1,716 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRecordedWedgeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrws.h" + + +// --- item class --- + +DRTRecordedWedgeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + WedgeAngle(DCM_WedgeAngle), + WedgeID(DCM_WedgeID), + WedgeNumber(DCM_WedgeNumber), + WedgeOrientation(DCM_WedgeOrientation), + WedgeType(DCM_WedgeType) +{ +} + + +DRTRecordedWedgeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + WedgeAngle(copy.WedgeAngle), + WedgeID(copy.WedgeID), + WedgeNumber(copy.WedgeNumber), + WedgeOrientation(copy.WedgeOrientation), + WedgeType(copy.WedgeType) +{ +} + + +DRTRecordedWedgeSequence::Item::~Item() +{ +} + + +DRTRecordedWedgeSequence::Item &DRTRecordedWedgeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + WedgeAngle = copy.WedgeAngle; + WedgeID = copy.WedgeID; + WedgeNumber = copy.WedgeNumber; + WedgeOrientation = copy.WedgeOrientation; + WedgeType = copy.WedgeType; + } + return *this; +} + + +void DRTRecordedWedgeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + WedgeNumber.clear(); + WedgeType.clear(); + WedgeID.clear(); + AccessoryCode.clear(); + WedgeAngle.clear(); + WedgeOrientation.clear(); + } +} + + +OFBool DRTRecordedWedgeSequence::Item::isEmpty() +{ + return WedgeNumber.isEmpty() && + WedgeType.isEmpty() && + WedgeID.isEmpty() && + AccessoryCode.isEmpty() && + WedgeAngle.isEmpty() && + WedgeOrientation.isEmpty(); +} + + +OFBool DRTRecordedWedgeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRecordedWedgeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, WedgeNumber, "1", "1", "RecordedWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeType, "1", "2", "RecordedWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeID, "1", "3", "RecordedWedgeSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "RecordedWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeAngle, "1", "2", "RecordedWedgeSequence"); + getAndCheckElementFromDataset(item, WedgeOrientation, "1", "2", "RecordedWedgeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(WedgeNumber), "1", "1", "RecordedWedgeSequence"); + addElementToDataset(result, item, new DcmCodeString(WedgeType), "1", "2", "RecordedWedgeSequence"); + addElementToDataset(result, item, new DcmShortString(WedgeID), "1", "3", "RecordedWedgeSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "RecordedWedgeSequence"); + addElementToDataset(result, item, new DcmIntegerString(WedgeAngle), "1", "2", "RecordedWedgeSequence"); + addElementToDataset(result, item, new DcmDecimalString(WedgeOrientation), "1", "2", "RecordedWedgeSequence"); + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeAngle, value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeAngle(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, WedgeAngle).getSint32(value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeID, value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeNumber, value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, WedgeNumber).getSint32(value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeOrientation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeOrientation, value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeOrientation(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, WedgeOrientation).getFloat64(value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::getWedgeType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeType, value, pos); +} + + +OFCondition DRTRecordedWedgeSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::Item::setWedgeAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::Item::setWedgeID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::Item::setWedgeNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::Item::setWedgeOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeOrientation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::Item::setWedgeType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTRecordedWedgeSequence::DRTRecordedWedgeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRecordedWedgeSequence::DRTRecordedWedgeSequence(const DRTRecordedWedgeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRecordedWedgeSequence &DRTRecordedWedgeSequence::operator=(const DRTRecordedWedgeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRecordedWedgeSequence::~DRTRecordedWedgeSequence() +{ + clear(); +} + + +void DRTRecordedWedgeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRecordedWedgeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRecordedWedgeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRecordedWedgeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRecordedWedgeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRecordedWedgeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRecordedWedgeSequence::Item &DRTRecordedWedgeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRecordedWedgeSequence::Item &DRTRecordedWedgeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRecordedWedgeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRecordedWedgeSequence::Item &DRTRecordedWedgeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRecordedWedgeSequence::Item &DRTRecordedWedgeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRecordedWedgeSequence::Item &DRTRecordedWedgeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRecordedWedgeSequence::Item &DRTRecordedWedgeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRecordedWedgeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RecordedWedgeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RecordedWedgeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRecordedWedgeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RecordedWedgeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtrwvms.cc b/dcmrt/libsrc/drtrwvms.cc new file mode 100644 index 00000000..a65903c5 --- /dev/null +++ b/dcmrt/libsrc/drtrwvms.cc @@ -0,0 +1,762 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTRealWorldValueMappingSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtrwvms.h" + + +// --- item class --- + +DRTRealWorldValueMappingSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DoubleFloatRealWorldValueFirstValueMapped(DCM_DoubleFloatRealWorldValueFirstValueMapped), + DoubleFloatRealWorldValueLastValueMapped(DCM_DoubleFloatRealWorldValueLastValueMapped), + LUTExplanation(DCM_LUTExplanation), + LUTLabel(DCM_LUTLabel), + MeasurementUnitsCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + QuantityDefinitionSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RealWorldValueFirstValueMapped(DCM_RealWorldValueFirstValueMapped), + RealWorldValueIntercept(DCM_RealWorldValueIntercept), + RealWorldValueLUTData(DCM_RealWorldValueLUTData), + RealWorldValueLastValueMapped(DCM_RealWorldValueLastValueMapped), + RealWorldValueSlope(DCM_RealWorldValueSlope) +{ +} + + +DRTRealWorldValueMappingSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DoubleFloatRealWorldValueFirstValueMapped(copy.DoubleFloatRealWorldValueFirstValueMapped), + DoubleFloatRealWorldValueLastValueMapped(copy.DoubleFloatRealWorldValueLastValueMapped), + LUTExplanation(copy.LUTExplanation), + LUTLabel(copy.LUTLabel), + MeasurementUnitsCodeSequence(copy.MeasurementUnitsCodeSequence), + QuantityDefinitionSequence(copy.QuantityDefinitionSequence), + RealWorldValueFirstValueMapped(copy.RealWorldValueFirstValueMapped), + RealWorldValueIntercept(copy.RealWorldValueIntercept), + RealWorldValueLUTData(copy.RealWorldValueLUTData), + RealWorldValueLastValueMapped(copy.RealWorldValueLastValueMapped), + RealWorldValueSlope(copy.RealWorldValueSlope) +{ +} + + +DRTRealWorldValueMappingSequence::Item::~Item() +{ +} + + +DRTRealWorldValueMappingSequence::Item &DRTRealWorldValueMappingSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DoubleFloatRealWorldValueFirstValueMapped = copy.DoubleFloatRealWorldValueFirstValueMapped; + DoubleFloatRealWorldValueLastValueMapped = copy.DoubleFloatRealWorldValueLastValueMapped; + LUTExplanation = copy.LUTExplanation; + LUTLabel = copy.LUTLabel; + MeasurementUnitsCodeSequence = copy.MeasurementUnitsCodeSequence; + QuantityDefinitionSequence = copy.QuantityDefinitionSequence; + RealWorldValueFirstValueMapped = copy.RealWorldValueFirstValueMapped; + RealWorldValueIntercept = copy.RealWorldValueIntercept; + RealWorldValueLUTData = copy.RealWorldValueLUTData; + RealWorldValueLastValueMapped = copy.RealWorldValueLastValueMapped; + RealWorldValueSlope = copy.RealWorldValueSlope; + } + return *this; +} + + +void DRTRealWorldValueMappingSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RealWorldValueFirstValueMapped.clear(); + RealWorldValueLastValueMapped.clear(); + DoubleFloatRealWorldValueFirstValueMapped.clear(); + DoubleFloatRealWorldValueLastValueMapped.clear(); + RealWorldValueIntercept.clear(); + RealWorldValueSlope.clear(); + RealWorldValueLUTData.clear(); + LUTExplanation.clear(); + LUTLabel.clear(); + MeasurementUnitsCodeSequence.clear(); + QuantityDefinitionSequence.clear(); + } +} + + +OFBool DRTRealWorldValueMappingSequence::Item::isEmpty() +{ + return RealWorldValueFirstValueMapped.isEmpty() && + RealWorldValueLastValueMapped.isEmpty() && + DoubleFloatRealWorldValueFirstValueMapped.isEmpty() && + DoubleFloatRealWorldValueLastValueMapped.isEmpty() && + RealWorldValueIntercept.isEmpty() && + RealWorldValueSlope.isEmpty() && + RealWorldValueLUTData.isEmpty() && + LUTExplanation.isEmpty() && + LUTLabel.isEmpty() && + MeasurementUnitsCodeSequence.isEmpty() && + QuantityDefinitionSequence.isEmpty(); +} + + +OFBool DRTRealWorldValueMappingSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RealWorldValueFirstValueMapped, "1", "1C", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, RealWorldValueLastValueMapped, "1", "1C", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, DoubleFloatRealWorldValueFirstValueMapped, "1", "1C", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, DoubleFloatRealWorldValueLastValueMapped, "1", "1C", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, RealWorldValueIntercept, "1", "1C", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, RealWorldValueSlope, "1", "1C", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, RealWorldValueLUTData, "1-n", "1C", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, LUTExplanation, "1", "1", "RealWorldValueMappingSequence"); + getAndCheckElementFromDataset(item, LUTLabel, "1", "1", "RealWorldValueMappingSequence"); + MeasurementUnitsCodeSequence.read(item, "1-n", "1", "RealWorldValueMappingSequence"); + QuantityDefinitionSequence.read(item, "1-n", "3", "RealWorldValueMappingSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(RealWorldValueFirstValueMapped), "1", "1C", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(RealWorldValueLastValueMapped), "1", "1C", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(DoubleFloatRealWorldValueFirstValueMapped), "1", "1C", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(DoubleFloatRealWorldValueLastValueMapped), "1", "1C", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(RealWorldValueIntercept), "1", "1C", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(RealWorldValueSlope), "1", "1C", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmFloatingPointDouble(RealWorldValueLUTData), "1-n", "1C", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmLongString(LUTExplanation), "1", "1", "RealWorldValueMappingSequence"); + addElementToDataset(result, item, new DcmShortString(LUTLabel), "1", "1", "RealWorldValueMappingSequence"); + if (result.good()) result = MeasurementUnitsCodeSequence.write(item, "1-n", "1", "RealWorldValueMappingSequence"); + if (result.good()) result = QuantityDefinitionSequence.write(item, "1-n", "3", "RealWorldValueMappingSequence"); + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getDoubleFloatRealWorldValueFirstValueMapped(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, DoubleFloatRealWorldValueFirstValueMapped).getFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getDoubleFloatRealWorldValueLastValueMapped(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, DoubleFloatRealWorldValueLastValueMapped).getFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getLUTExplanation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LUTExplanation, value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getLUTLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LUTLabel, value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getRealWorldValueFirstValueMapped(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, RealWorldValueFirstValueMapped).getUint16(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getRealWorldValueIntercept(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, RealWorldValueIntercept).getFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getRealWorldValueLUTData(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, RealWorldValueLUTData).getFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getRealWorldValueLastValueMapped(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, RealWorldValueLastValueMapped).getUint16(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::getRealWorldValueSlope(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointDouble &, RealWorldValueSlope).getFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setDoubleFloatRealWorldValueFirstValueMapped(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DoubleFloatRealWorldValueFirstValueMapped.putFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setDoubleFloatRealWorldValueLastValueMapped(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return DoubleFloatRealWorldValueLastValueMapped.putFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setLUTExplanation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LUTExplanation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setLUTLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LUTLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setRealWorldValueFirstValueMapped(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RealWorldValueFirstValueMapped.putUint16(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setRealWorldValueIntercept(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RealWorldValueIntercept.putFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setRealWorldValueLUTData(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RealWorldValueLUTData.putFloat64(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setRealWorldValueLastValueMapped(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RealWorldValueLastValueMapped.putUint16(value, pos); +} + + +OFCondition DRTRealWorldValueMappingSequence::Item::setRealWorldValueSlope(const Float64 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RealWorldValueSlope.putFloat64(value, pos); +} + + +// --- sequence class --- + +DRTRealWorldValueMappingSequence::DRTRealWorldValueMappingSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTRealWorldValueMappingSequence::DRTRealWorldValueMappingSequence(const DRTRealWorldValueMappingSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTRealWorldValueMappingSequence &DRTRealWorldValueMappingSequence::operator=(const DRTRealWorldValueMappingSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTRealWorldValueMappingSequence::~DRTRealWorldValueMappingSequence() +{ + clear(); +} + + +void DRTRealWorldValueMappingSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTRealWorldValueMappingSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTRealWorldValueMappingSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTRealWorldValueMappingSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTRealWorldValueMappingSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTRealWorldValueMappingSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTRealWorldValueMappingSequence::Item &DRTRealWorldValueMappingSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTRealWorldValueMappingSequence::Item &DRTRealWorldValueMappingSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTRealWorldValueMappingSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTRealWorldValueMappingSequence::Item &DRTRealWorldValueMappingSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTRealWorldValueMappingSequence::Item &DRTRealWorldValueMappingSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTRealWorldValueMappingSequence::Item &DRTRealWorldValueMappingSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTRealWorldValueMappingSequence::Item &DRTRealWorldValueMappingSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTRealWorldValueMappingSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_RealWorldValueMappingSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_RealWorldValueMappingSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTRealWorldValueMappingSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_RealWorldValueMappingSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtscris.cc b/dcmrt/libsrc/drtscris.cc new file mode 100644 index 00000000..3e0fef6a --- /dev/null +++ b/dcmrt/libsrc/drtscris.cc @@ -0,0 +1,551 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTStudiesContainingOtherReferencedInstancesSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtscris.h" + + +// --- item class --- + +DRTStudiesContainingOtherReferencedInstancesSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedSeriesSequence(emptyDefaultItem /*emptyDefaultSequence*/), + StudyInstanceUID(DCM_StudyInstanceUID) +{ +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudyInstanceUID(copy.StudyInstanceUID) +{ +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::Item::~Item() +{ +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::Item &DRTStudiesContainingOtherReferencedInstancesSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudyInstanceUID = copy.StudyInstanceUID; + } + return *this; +} + + +void DRTStudiesContainingOtherReferencedInstancesSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + StudyInstanceUID.clear(); + ReferencedSeriesSequence.clear(); + } +} + + +OFBool DRTStudiesContainingOtherReferencedInstancesSequence::Item::isEmpty() +{ + return StudyInstanceUID.isEmpty() && + ReferencedSeriesSequence.isEmpty(); +} + + +OFBool DRTStudiesContainingOtherReferencedInstancesSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, StudyInstanceUID, "1", "1", "StudiesContainingOtherReferencedInstancesSequence"); + ReferencedSeriesSequence.read(item, "1-n", "1", "StudiesContainingOtherReferencedInstancesSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "StudiesContainingOtherReferencedInstancesSequence"); + if (result.good()) result = ReferencedSeriesSequence.write(item, "1-n", "1", "StudiesContainingOtherReferencedInstancesSequence"); + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::Item::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::Item::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTStudiesContainingOtherReferencedInstancesSequence::DRTStudiesContainingOtherReferencedInstancesSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::DRTStudiesContainingOtherReferencedInstancesSequence(const DRTStudiesContainingOtherReferencedInstancesSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTStudiesContainingOtherReferencedInstancesSequence &DRTStudiesContainingOtherReferencedInstancesSequence::operator=(const DRTStudiesContainingOtherReferencedInstancesSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::~DRTStudiesContainingOtherReferencedInstancesSequence() +{ + clear(); +} + + +void DRTStudiesContainingOtherReferencedInstancesSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTStudiesContainingOtherReferencedInstancesSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTStudiesContainingOtherReferencedInstancesSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTStudiesContainingOtherReferencedInstancesSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::Item &DRTStudiesContainingOtherReferencedInstancesSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTStudiesContainingOtherReferencedInstancesSequence::Item &DRTStudiesContainingOtherReferencedInstancesSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::Item &DRTStudiesContainingOtherReferencedInstancesSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTStudiesContainingOtherReferencedInstancesSequence::Item &DRTStudiesContainingOtherReferencedInstancesSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTStudiesContainingOtherReferencedInstancesSequence::Item &DRTStudiesContainingOtherReferencedInstancesSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTStudiesContainingOtherReferencedInstancesSequence::Item &DRTStudiesContainingOtherReferencedInstancesSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_StudiesContainingOtherReferencedInstancesSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_StudiesContainingOtherReferencedInstancesSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTStudiesContainingOtherReferencedInstancesSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_StudiesContainingOtherReferencedInstancesSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtscs.cc b/dcmrt/libsrc/drtscs.cc new file mode 100644 index 00000000..03e75af2 --- /dev/null +++ b/dcmrt/libsrc/drtscs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTStrainCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtscs.h" + + +// --- item class --- + +DRTStrainCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTStrainCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTStrainCodeSequence::Item::~Item() +{ +} + + +DRTStrainCodeSequence::Item &DRTStrainCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTStrainCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTStrainCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTStrainCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTStrainCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "StrainCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "StrainCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "StrainCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "StrainCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "StrainCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "StrainCodeSequence"); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTStrainCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTStrainCodeSequence::DRTStrainCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTStrainCodeSequence::DRTStrainCodeSequence(const DRTStrainCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTStrainCodeSequence &DRTStrainCodeSequence::operator=(const DRTStrainCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTStrainCodeSequence::~DRTStrainCodeSequence() +{ + clear(); +} + + +void DRTStrainCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTStrainCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTStrainCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTStrainCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTStrainCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTStrainCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTStrainCodeSequence::Item &DRTStrainCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTStrainCodeSequence::Item &DRTStrainCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTStrainCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTStrainCodeSequence::Item &DRTStrainCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTStrainCodeSequence::Item &DRTStrainCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTStrainCodeSequence::Item &DRTStrainCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTStrainCodeSequence::Item &DRTStrainCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTStrainCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTStrainCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTStrainCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_StrainCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_StrainCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTStrainCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_StrainCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtsdcs.cc b/dcmrt/libsrc/drtsdcs.cc new file mode 100644 index 00000000..90c8e989 --- /dev/null +++ b/dcmrt/libsrc/drtsdcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSeriesDescriptionCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtsdcs.h" + + +// --- item class --- + +DRTSeriesDescriptionCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTSeriesDescriptionCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTSeriesDescriptionCodeSequence::Item::~Item() +{ +} + + +DRTSeriesDescriptionCodeSequence::Item &DRTSeriesDescriptionCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTSeriesDescriptionCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTSeriesDescriptionCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTSeriesDescriptionCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "SeriesDescriptionCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "SeriesDescriptionCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "SeriesDescriptionCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "SeriesDescriptionCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "SeriesDescriptionCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "SeriesDescriptionCodeSequence"); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSeriesDescriptionCodeSequence::DRTSeriesDescriptionCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSeriesDescriptionCodeSequence::DRTSeriesDescriptionCodeSequence(const DRTSeriesDescriptionCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSeriesDescriptionCodeSequence &DRTSeriesDescriptionCodeSequence::operator=(const DRTSeriesDescriptionCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSeriesDescriptionCodeSequence::~DRTSeriesDescriptionCodeSequence() +{ + clear(); +} + + +void DRTSeriesDescriptionCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSeriesDescriptionCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSeriesDescriptionCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSeriesDescriptionCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSeriesDescriptionCodeSequence::Item &DRTSeriesDescriptionCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSeriesDescriptionCodeSequence::Item &DRTSeriesDescriptionCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSeriesDescriptionCodeSequence::Item &DRTSeriesDescriptionCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSeriesDescriptionCodeSequence::Item &DRTSeriesDescriptionCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSeriesDescriptionCodeSequence::Item &DRTSeriesDescriptionCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSeriesDescriptionCodeSequence::Item &DRTSeriesDescriptionCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSeriesDescriptionCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SeriesDescriptionCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SeriesDescriptionCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSeriesDescriptionCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SeriesDescriptionCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtsds.cc b/dcmrt/libsrc/drtsds.cc new file mode 100644 index 00000000..ceb1dcd6 --- /dev/null +++ b/dcmrt/libsrc/drtsds.cc @@ -0,0 +1,698 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSetupDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtsds.h" + + +// --- item class --- + +DRTSetupDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + SetupDeviceDescription(DCM_SetupDeviceDescription), + SetupDeviceLabel(DCM_SetupDeviceLabel), + SetupDeviceParameter(DCM_SetupDeviceParameter), + SetupDeviceType(DCM_SetupDeviceType), + SetupReferenceDescription(DCM_SetupReferenceDescription) +{ +} + + +DRTSetupDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + SetupDeviceDescription(copy.SetupDeviceDescription), + SetupDeviceLabel(copy.SetupDeviceLabel), + SetupDeviceParameter(copy.SetupDeviceParameter), + SetupDeviceType(copy.SetupDeviceType), + SetupReferenceDescription(copy.SetupReferenceDescription) +{ +} + + +DRTSetupDeviceSequence::Item::~Item() +{ +} + + +DRTSetupDeviceSequence::Item &DRTSetupDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + SetupDeviceDescription = copy.SetupDeviceDescription; + SetupDeviceLabel = copy.SetupDeviceLabel; + SetupDeviceParameter = copy.SetupDeviceParameter; + SetupDeviceType = copy.SetupDeviceType; + SetupReferenceDescription = copy.SetupReferenceDescription; + } + return *this; +} + + +void DRTSetupDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SetupDeviceType.clear(); + SetupDeviceLabel.clear(); + SetupDeviceDescription.clear(); + SetupDeviceParameter.clear(); + SetupReferenceDescription.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTSetupDeviceSequence::Item::isEmpty() +{ + return SetupDeviceType.isEmpty() && + SetupDeviceLabel.isEmpty() && + SetupDeviceDescription.isEmpty() && + SetupDeviceParameter.isEmpty() && + SetupReferenceDescription.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTSetupDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSetupDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SetupDeviceType, "1", "1", "SetupDeviceSequence"); + getAndCheckElementFromDataset(item, SetupDeviceLabel, "1", "2", "SetupDeviceSequence"); + getAndCheckElementFromDataset(item, SetupDeviceDescription, "1", "3", "SetupDeviceSequence"); + getAndCheckElementFromDataset(item, SetupDeviceParameter, "1", "2", "SetupDeviceSequence"); + getAndCheckElementFromDataset(item, SetupReferenceDescription, "1", "3", "SetupDeviceSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "SetupDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(SetupDeviceType), "1", "1", "SetupDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(SetupDeviceLabel), "1", "2", "SetupDeviceSequence"); + addElementToDataset(result, item, new DcmShortText(SetupDeviceDescription), "1", "3", "SetupDeviceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SetupDeviceParameter), "1", "2", "SetupDeviceSequence"); + addElementToDataset(result, item, new DcmShortText(SetupReferenceDescription), "1", "3", "SetupDeviceSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "SetupDeviceSequence"); + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTSetupDeviceSequence::Item::getSetupDeviceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupDeviceDescription, value, pos); +} + + +OFCondition DRTSetupDeviceSequence::Item::getSetupDeviceLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupDeviceLabel, value, pos); +} + + +OFCondition DRTSetupDeviceSequence::Item::getSetupDeviceParameter(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupDeviceParameter, value, pos); +} + + +OFCondition DRTSetupDeviceSequence::Item::getSetupDeviceParameter(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SetupDeviceParameter).getFloat64(value, pos); +} + + +OFCondition DRTSetupDeviceSequence::Item::getSetupDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupDeviceType, value, pos); +} + + +OFCondition DRTSetupDeviceSequence::Item::getSetupReferenceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SetupReferenceDescription, value, pos); +} + + +OFCondition DRTSetupDeviceSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::Item::setSetupDeviceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SetupDeviceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::Item::setSetupDeviceLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SetupDeviceLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::Item::setSetupDeviceParameter(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SetupDeviceParameter.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::Item::setSetupDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SetupDeviceType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::Item::setSetupReferenceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SetupReferenceDescription.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSetupDeviceSequence::DRTSetupDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSetupDeviceSequence::DRTSetupDeviceSequence(const DRTSetupDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSetupDeviceSequence &DRTSetupDeviceSequence::operator=(const DRTSetupDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSetupDeviceSequence::~DRTSetupDeviceSequence() +{ + clear(); +} + + +void DRTSetupDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSetupDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSetupDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSetupDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSetupDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSetupDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSetupDeviceSequence::Item &DRTSetupDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSetupDeviceSequence::Item &DRTSetupDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSetupDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSetupDeviceSequence::Item &DRTSetupDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSetupDeviceSequence::Item &DRTSetupDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSetupDeviceSequence::Item &DRTSetupDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSetupDeviceSequence::Item &DRTSetupDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSetupDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SetupDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SetupDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSetupDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SetupDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtshds.cc b/dcmrt/libsrc/drtshds.cc new file mode 100644 index 00000000..4bc3520c --- /dev/null +++ b/dcmrt/libsrc/drtshds.cc @@ -0,0 +1,660 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTShieldingDeviceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtshds.h" + + +// --- item class --- + +DRTShieldingDeviceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + ShieldingDeviceDescription(DCM_ShieldingDeviceDescription), + ShieldingDeviceLabel(DCM_ShieldingDeviceLabel), + ShieldingDevicePosition(DCM_ShieldingDevicePosition), + ShieldingDeviceType(DCM_ShieldingDeviceType) +{ +} + + +DRTShieldingDeviceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + ShieldingDeviceDescription(copy.ShieldingDeviceDescription), + ShieldingDeviceLabel(copy.ShieldingDeviceLabel), + ShieldingDevicePosition(copy.ShieldingDevicePosition), + ShieldingDeviceType(copy.ShieldingDeviceType) +{ +} + + +DRTShieldingDeviceSequence::Item::~Item() +{ +} + + +DRTShieldingDeviceSequence::Item &DRTShieldingDeviceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + ShieldingDeviceDescription = copy.ShieldingDeviceDescription; + ShieldingDeviceLabel = copy.ShieldingDeviceLabel; + ShieldingDevicePosition = copy.ShieldingDevicePosition; + ShieldingDeviceType = copy.ShieldingDeviceType; + } + return *this; +} + + +void DRTShieldingDeviceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ShieldingDeviceType.clear(); + ShieldingDeviceLabel.clear(); + ShieldingDeviceDescription.clear(); + ShieldingDevicePosition.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTShieldingDeviceSequence::Item::isEmpty() +{ + return ShieldingDeviceType.isEmpty() && + ShieldingDeviceLabel.isEmpty() && + ShieldingDeviceDescription.isEmpty() && + ShieldingDevicePosition.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTShieldingDeviceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTShieldingDeviceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ShieldingDeviceType, "1", "1", "ShieldingDeviceSequence"); + getAndCheckElementFromDataset(item, ShieldingDeviceLabel, "1", "2", "ShieldingDeviceSequence"); + getAndCheckElementFromDataset(item, ShieldingDeviceDescription, "1", "3", "ShieldingDeviceSequence"); + getAndCheckElementFromDataset(item, ShieldingDevicePosition, "1", "3", "ShieldingDeviceSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "ShieldingDeviceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmCodeString(ShieldingDeviceType), "1", "1", "ShieldingDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(ShieldingDeviceLabel), "1", "2", "ShieldingDeviceSequence"); + addElementToDataset(result, item, new DcmShortText(ShieldingDeviceDescription), "1", "3", "ShieldingDeviceSequence"); + addElementToDataset(result, item, new DcmShortString(ShieldingDevicePosition), "1", "3", "ShieldingDeviceSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "ShieldingDeviceSequence"); + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTShieldingDeviceSequence::Item::getShieldingDeviceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ShieldingDeviceDescription, value, pos); +} + + +OFCondition DRTShieldingDeviceSequence::Item::getShieldingDeviceLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ShieldingDeviceLabel, value, pos); +} + + +OFCondition DRTShieldingDeviceSequence::Item::getShieldingDevicePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ShieldingDevicePosition, value, pos); +} + + +OFCondition DRTShieldingDeviceSequence::Item::getShieldingDeviceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ShieldingDeviceType, value, pos); +} + + +OFCondition DRTShieldingDeviceSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::Item::setShieldingDeviceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ShieldingDeviceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::Item::setShieldingDeviceLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ShieldingDeviceLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::Item::setShieldingDevicePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ShieldingDevicePosition.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::Item::setShieldingDeviceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ShieldingDeviceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTShieldingDeviceSequence::DRTShieldingDeviceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTShieldingDeviceSequence::DRTShieldingDeviceSequence(const DRTShieldingDeviceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTShieldingDeviceSequence &DRTShieldingDeviceSequence::operator=(const DRTShieldingDeviceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTShieldingDeviceSequence::~DRTShieldingDeviceSequence() +{ + clear(); +} + + +void DRTShieldingDeviceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTShieldingDeviceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTShieldingDeviceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTShieldingDeviceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTShieldingDeviceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTShieldingDeviceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTShieldingDeviceSequence::Item &DRTShieldingDeviceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTShieldingDeviceSequence::Item &DRTShieldingDeviceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTShieldingDeviceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTShieldingDeviceSequence::Item &DRTShieldingDeviceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTShieldingDeviceSequence::Item &DRTShieldingDeviceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTShieldingDeviceSequence::Item &DRTShieldingDeviceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTShieldingDeviceSequence::Item &DRTShieldingDeviceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTShieldingDeviceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ShieldingDeviceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ShieldingDeviceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTShieldingDeviceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ShieldingDeviceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtsins.cc b/dcmrt/libsrc/drtsins.cc new file mode 100644 index 00000000..519b4842 --- /dev/null +++ b/dcmrt/libsrc/drtsins.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSourceInstanceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtsins.h" + + +// --- item class --- + +DRTSourceInstanceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + PurposeOfReferenceCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID) +{ +} + + +DRTSourceInstanceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + PurposeOfReferenceCodeSequence(copy.PurposeOfReferenceCodeSequence), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID) +{ +} + + +DRTSourceInstanceSequence::Item::~Item() +{ +} + + +DRTSourceInstanceSequence::Item &DRTSourceInstanceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + PurposeOfReferenceCodeSequence = copy.PurposeOfReferenceCodeSequence; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + } + return *this; +} + + +void DRTSourceInstanceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + PurposeOfReferenceCodeSequence.clear(); + } +} + + +OFBool DRTSourceInstanceSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + PurposeOfReferenceCodeSequence.isEmpty(); +} + + +OFBool DRTSourceInstanceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSourceInstanceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "SourceInstanceSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "SourceInstanceSequence"); + PurposeOfReferenceCodeSequence.read(item, "1-n", "3", "SourceInstanceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "SourceInstanceSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "SourceInstanceSequence"); + if (result.good()) result = PurposeOfReferenceCodeSequence.write(item, "1-n", "3", "SourceInstanceSequence"); + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTSourceInstanceSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTSourceInstanceSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSourceInstanceSequence::DRTSourceInstanceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSourceInstanceSequence::DRTSourceInstanceSequence(const DRTSourceInstanceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSourceInstanceSequence &DRTSourceInstanceSequence::operator=(const DRTSourceInstanceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSourceInstanceSequence::~DRTSourceInstanceSequence() +{ + clear(); +} + + +void DRTSourceInstanceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSourceInstanceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSourceInstanceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSourceInstanceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSourceInstanceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSourceInstanceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSourceInstanceSequence::Item &DRTSourceInstanceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSourceInstanceSequence::Item &DRTSourceInstanceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSourceInstanceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSourceInstanceSequence::Item &DRTSourceInstanceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSourceInstanceSequence::Item &DRTSourceInstanceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSourceInstanceSequence::Item &DRTSourceInstanceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSourceInstanceSequence::Item &DRTSourceInstanceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSourceInstanceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SourceInstanceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SourceInstanceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSourceInstanceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SourceInstanceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtsis.cc b/dcmrt/libsrc/drtsis.cc new file mode 100644 index 00000000..ce2fda10 --- /dev/null +++ b/dcmrt/libsrc/drtsis.cc @@ -0,0 +1,701 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSourceImageSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtsis.h" + + +// --- item class --- + +DRTSourceImageSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + PatientOrientation(DCM_PatientOrientation), + PurposeOfReferenceCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedFrameNumber(DCM_ReferencedFrameNumber), + ReferencedSOPClassUID(DCM_ReferencedSOPClassUID), + ReferencedSOPInstanceUID(DCM_ReferencedSOPInstanceUID), + ReferencedSegmentNumber(DCM_ReferencedSegmentNumber), + SpatialLocationsPreserved(DCM_SpatialLocationsPreserved) +{ +} + + +DRTSourceImageSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + PatientOrientation(copy.PatientOrientation), + PurposeOfReferenceCodeSequence(copy.PurposeOfReferenceCodeSequence), + ReferencedFrameNumber(copy.ReferencedFrameNumber), + ReferencedSOPClassUID(copy.ReferencedSOPClassUID), + ReferencedSOPInstanceUID(copy.ReferencedSOPInstanceUID), + ReferencedSegmentNumber(copy.ReferencedSegmentNumber), + SpatialLocationsPreserved(copy.SpatialLocationsPreserved) +{ +} + + +DRTSourceImageSequence::Item::~Item() +{ +} + + +DRTSourceImageSequence::Item &DRTSourceImageSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + PatientOrientation = copy.PatientOrientation; + PurposeOfReferenceCodeSequence = copy.PurposeOfReferenceCodeSequence; + ReferencedFrameNumber = copy.ReferencedFrameNumber; + ReferencedSOPClassUID = copy.ReferencedSOPClassUID; + ReferencedSOPInstanceUID = copy.ReferencedSOPInstanceUID; + ReferencedSegmentNumber = copy.ReferencedSegmentNumber; + SpatialLocationsPreserved = copy.SpatialLocationsPreserved; + } + return *this; +} + + +void DRTSourceImageSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedSOPClassUID.clear(); + ReferencedSOPInstanceUID.clear(); + ReferencedFrameNumber.clear(); + ReferencedSegmentNumber.clear(); + PurposeOfReferenceCodeSequence.clear(); + SpatialLocationsPreserved.clear(); + PatientOrientation.clear(); + } +} + + +OFBool DRTSourceImageSequence::Item::isEmpty() +{ + return ReferencedSOPClassUID.isEmpty() && + ReferencedSOPInstanceUID.isEmpty() && + ReferencedFrameNumber.isEmpty() && + ReferencedSegmentNumber.isEmpty() && + PurposeOfReferenceCodeSequence.isEmpty() && + SpatialLocationsPreserved.isEmpty() && + PatientOrientation.isEmpty(); +} + + +OFBool DRTSourceImageSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSourceImageSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedSOPClassUID, "1", "1", "SourceImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSOPInstanceUID, "1", "1", "SourceImageSequence"); + getAndCheckElementFromDataset(item, ReferencedFrameNumber, "1-n", "1C", "SourceImageSequence"); + getAndCheckElementFromDataset(item, ReferencedSegmentNumber, "1-n", "1C", "SourceImageSequence"); + PurposeOfReferenceCodeSequence.read(item, "1-n", "3", "SourceImageSequence"); + getAndCheckElementFromDataset(item, SpatialLocationsPreserved, "1", "3", "SourceImageSequence"); + getAndCheckElementFromDataset(item, PatientOrientation, "2", "1C", "SourceImageSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceImageSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPClassUID), "1", "1", "SourceImageSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedSOPInstanceUID), "1", "1", "SourceImageSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedFrameNumber), "1-n", "1C", "SourceImageSequence"); + addElementToDataset(result, item, new DcmUnsignedShort(ReferencedSegmentNumber), "1-n", "1C", "SourceImageSequence"); + if (result.good()) result = PurposeOfReferenceCodeSequence.write(item, "1-n", "3", "SourceImageSequence"); + addElementToDataset(result, item, new DcmCodeString(SpatialLocationsPreserved), "1", "3", "SourceImageSequence"); + addElementToDataset(result, item, new DcmCodeString(PatientOrientation), "2", "1C", "SourceImageSequence"); + } + return result; +} + + +OFCondition DRTSourceImageSequence::Item::getPatientOrientation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientOrientation, value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::getReferencedFrameNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameNumber, value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::getReferencedFrameNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedFrameNumber).getSint32(value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::getReferencedSOPClassUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPClassUID, value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::getReferencedSOPInstanceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedSOPInstanceUID, value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::getReferencedSegmentNumber(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, ReferencedSegmentNumber).getUint16(value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::getSpatialLocationsPreserved(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SpatialLocationsPreserved, value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::setPatientOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "2") : EC_Normal; + if (result.good()) + result = PatientOrientation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceImageSequence::Item::setReferencedFrameNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ReferencedFrameNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceImageSequence::Item::setReferencedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPClassUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceImageSequence::Item::setReferencedSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedSOPInstanceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceImageSequence::Item::setReferencedSegmentNumber(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return ReferencedSegmentNumber.putUint16(value, pos); +} + + +OFCondition DRTSourceImageSequence::Item::setSpatialLocationsPreserved(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialLocationsPreserved.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSourceImageSequence::DRTSourceImageSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSourceImageSequence::DRTSourceImageSequence(const DRTSourceImageSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSourceImageSequence &DRTSourceImageSequence::operator=(const DRTSourceImageSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSourceImageSequence::~DRTSourceImageSequence() +{ + clear(); +} + + +void DRTSourceImageSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSourceImageSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSourceImageSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSourceImageSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSourceImageSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceImageSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceImageSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceImageSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceImageSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSourceImageSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSourceImageSequence::Item &DRTSourceImageSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSourceImageSequence::Item &DRTSourceImageSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSourceImageSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSourceImageSequence::Item &DRTSourceImageSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSourceImageSequence::Item &DRTSourceImageSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSourceImageSequence::Item &DRTSourceImageSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSourceImageSequence::Item &DRTSourceImageSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSourceImageSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSourceImageSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSourceImageSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceImageSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SourceImageSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SourceImageSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSourceImageSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SourceImageSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtsns.cc b/dcmrt/libsrc/drtsns.cc new file mode 100644 index 00000000..f181258a --- /dev/null +++ b/dcmrt/libsrc/drtsns.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSnoutSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtsns.h" + + +// --- item class --- + +DRTSnoutSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + SnoutID(DCM_SnoutID) +{ +} + + +DRTSnoutSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + SnoutID(copy.SnoutID) +{ +} + + +DRTSnoutSequence::Item::~Item() +{ +} + + +DRTSnoutSequence::Item &DRTSnoutSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + SnoutID = copy.SnoutID; + } + return *this; +} + + +void DRTSnoutSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SnoutID.clear(); + AccessoryCode.clear(); + } +} + + +OFBool DRTSnoutSequence::Item::isEmpty() +{ + return SnoutID.isEmpty() && + AccessoryCode.isEmpty(); +} + + +OFBool DRTSnoutSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSnoutSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SnoutID, "1", "1", "SnoutSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "SnoutSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSnoutSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(SnoutID), "1", "1", "SnoutSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "SnoutSequence"); + } + return result; +} + + +OFCondition DRTSnoutSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTSnoutSequence::Item::getSnoutID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SnoutID, value, pos); +} + + +OFCondition DRTSnoutSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSnoutSequence::Item::setSnoutID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SnoutID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSnoutSequence::DRTSnoutSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSnoutSequence::DRTSnoutSequence(const DRTSnoutSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSnoutSequence &DRTSnoutSequence::operator=(const DRTSnoutSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSnoutSequence::~DRTSnoutSequence() +{ + clear(); +} + + +void DRTSnoutSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSnoutSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSnoutSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSnoutSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSnoutSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSnoutSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSnoutSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSnoutSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSnoutSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSnoutSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSnoutSequence::Item &DRTSnoutSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSnoutSequence::Item &DRTSnoutSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSnoutSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSnoutSequence::Item &DRTSnoutSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSnoutSequence::Item &DRTSnoutSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSnoutSequence::Item &DRTSnoutSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSnoutSequence::Item &DRTSnoutSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSnoutSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSnoutSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSnoutSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSnoutSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SnoutSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SnoutSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSnoutSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SnoutSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtspccs.cc b/dcmrt/libsrc/drtspccs.cc new file mode 100644 index 00000000..b293c8cf --- /dev/null +++ b/dcmrt/libsrc/drtspccs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSegmentedPropertyCategoryCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtspccs.h" + + +// --- item class --- + +DRTSegmentedPropertyCategoryCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTSegmentedPropertyCategoryCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTSegmentedPropertyCategoryCodeSequence::Item::~Item() +{ +} + + +DRTSegmentedPropertyCategoryCodeSequence::Item &DRTSegmentedPropertyCategoryCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTSegmentedPropertyCategoryCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTSegmentedPropertyCategoryCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTSegmentedPropertyCategoryCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "SegmentedPropertyCategoryCodeSequence"); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSegmentedPropertyCategoryCodeSequence::DRTSegmentedPropertyCategoryCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSegmentedPropertyCategoryCodeSequence::DRTSegmentedPropertyCategoryCodeSequence(const DRTSegmentedPropertyCategoryCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSegmentedPropertyCategoryCodeSequence &DRTSegmentedPropertyCategoryCodeSequence::operator=(const DRTSegmentedPropertyCategoryCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSegmentedPropertyCategoryCodeSequence::~DRTSegmentedPropertyCategoryCodeSequence() +{ + clear(); +} + + +void DRTSegmentedPropertyCategoryCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSegmentedPropertyCategoryCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSegmentedPropertyCategoryCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSegmentedPropertyCategoryCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSegmentedPropertyCategoryCodeSequence::Item &DRTSegmentedPropertyCategoryCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSegmentedPropertyCategoryCodeSequence::Item &DRTSegmentedPropertyCategoryCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSegmentedPropertyCategoryCodeSequence::Item &DRTSegmentedPropertyCategoryCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSegmentedPropertyCategoryCodeSequence::Item &DRTSegmentedPropertyCategoryCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSegmentedPropertyCategoryCodeSequence::Item &DRTSegmentedPropertyCategoryCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSegmentedPropertyCategoryCodeSequence::Item &DRTSegmentedPropertyCategoryCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SegmentedPropertyCategoryCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SegmentedPropertyCategoryCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSegmentedPropertyCategoryCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SegmentedPropertyCategoryCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtspcs.cc b/dcmrt/libsrc/drtspcs.cc new file mode 100644 index 00000000..ac21d60e --- /dev/null +++ b/dcmrt/libsrc/drtspcs.cc @@ -0,0 +1,964 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTScheduledProtocolCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtspcs.h" + + +// --- item class --- + +DRTScheduledProtocolCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + ProtocolContextSequence(emptyDefaultItem /*emptyDefaultSequence*/), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTScheduledProtocolCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + ProtocolContextSequence(copy.ProtocolContextSequence), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTScheduledProtocolCodeSequence::Item::~Item() +{ +} + + +DRTScheduledProtocolCodeSequence::Item &DRTScheduledProtocolCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + ProtocolContextSequence = copy.ProtocolContextSequence; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTScheduledProtocolCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + ProtocolContextSequence.clear(); + } +} + + +OFBool DRTScheduledProtocolCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty() && + ProtocolContextSequence.isEmpty(); +} + + +OFBool DRTScheduledProtocolCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "ScheduledProtocolCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "ScheduledProtocolCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "ScheduledProtocolCodeSequence"); + ProtocolContextSequence.read(item, "1-n", "3", "ScheduledProtocolCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "ScheduledProtocolCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "ScheduledProtocolCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "ScheduledProtocolCodeSequence"); + if (result.good()) result = ProtocolContextSequence.write(item, "1-n", "3", "ScheduledProtocolCodeSequence"); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTScheduledProtocolCodeSequence::DRTScheduledProtocolCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTScheduledProtocolCodeSequence::DRTScheduledProtocolCodeSequence(const DRTScheduledProtocolCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTScheduledProtocolCodeSequence &DRTScheduledProtocolCodeSequence::operator=(const DRTScheduledProtocolCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTScheduledProtocolCodeSequence::~DRTScheduledProtocolCodeSequence() +{ + clear(); +} + + +void DRTScheduledProtocolCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTScheduledProtocolCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTScheduledProtocolCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTScheduledProtocolCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTScheduledProtocolCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTScheduledProtocolCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTScheduledProtocolCodeSequence::Item &DRTScheduledProtocolCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTScheduledProtocolCodeSequence::Item &DRTScheduledProtocolCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTScheduledProtocolCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTScheduledProtocolCodeSequence::Item &DRTScheduledProtocolCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTScheduledProtocolCodeSequence::Item &DRTScheduledProtocolCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTScheduledProtocolCodeSequence::Item &DRTScheduledProtocolCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTScheduledProtocolCodeSequence::Item &DRTScheduledProtocolCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTScheduledProtocolCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ScheduledProtocolCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ScheduledProtocolCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTScheduledProtocolCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ScheduledProtocolCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtspgis.cc b/dcmrt/libsrc/drtspgis.cc new file mode 100644 index 00000000..c873b708 --- /dev/null +++ b/dcmrt/libsrc/drtspgis.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSourcePatientGroupIdentificationSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtspgis.h" + + +// --- item class --- + +DRTSourcePatientGroupIdentificationSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(emptyDefaultItem /*emptyDefaultSequence*/), + PatientID(DCM_PatientID) +{ +} + + +DRTSourcePatientGroupIdentificationSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientID(copy.PatientID) +{ +} + + +DRTSourcePatientGroupIdentificationSequence::Item::~Item() +{ +} + + +DRTSourcePatientGroupIdentificationSequence::Item &DRTSourcePatientGroupIdentificationSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientID = copy.PatientID; + } + return *this; +} + + +void DRTSourcePatientGroupIdentificationSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + } +} + + +OFBool DRTSourcePatientGroupIdentificationSequence::Item::isEmpty() +{ + return PatientID.isEmpty() && + IssuerOfPatientID.isEmpty() && + IssuerOfPatientIDQualifiersSequence.isEmpty(); +} + + +OFBool DRTSourcePatientGroupIdentificationSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, PatientID, "1", "1", "SourcePatientGroupIdentificationSequence"); + getAndCheckElementFromDataset(item, IssuerOfPatientID, "1", "3", "SourcePatientGroupIdentificationSequence"); + IssuerOfPatientIDQualifiersSequence.read(item, "1-n", "3", "SourcePatientGroupIdentificationSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongString(PatientID), "1", "1", "SourcePatientGroupIdentificationSequence"); + addElementToDataset(result, item, new DcmLongString(IssuerOfPatientID), "1", "3", "SourcePatientGroupIdentificationSequence"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(item, "1-n", "3", "SourcePatientGroupIdentificationSequence"); + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::Item::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::Item::getPatientID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::Item::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::Item::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSourcePatientGroupIdentificationSequence::DRTSourcePatientGroupIdentificationSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSourcePatientGroupIdentificationSequence::DRTSourcePatientGroupIdentificationSequence(const DRTSourcePatientGroupIdentificationSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSourcePatientGroupIdentificationSequence &DRTSourcePatientGroupIdentificationSequence::operator=(const DRTSourcePatientGroupIdentificationSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSourcePatientGroupIdentificationSequence::~DRTSourcePatientGroupIdentificationSequence() +{ + clear(); +} + + +void DRTSourcePatientGroupIdentificationSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSourcePatientGroupIdentificationSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSourcePatientGroupIdentificationSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSourcePatientGroupIdentificationSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSourcePatientGroupIdentificationSequence::Item &DRTSourcePatientGroupIdentificationSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSourcePatientGroupIdentificationSequence::Item &DRTSourcePatientGroupIdentificationSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSourcePatientGroupIdentificationSequence::Item &DRTSourcePatientGroupIdentificationSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSourcePatientGroupIdentificationSequence::Item &DRTSourcePatientGroupIdentificationSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSourcePatientGroupIdentificationSequence::Item &DRTSourcePatientGroupIdentificationSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSourcePatientGroupIdentificationSequence::Item &DRTSourcePatientGroupIdentificationSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SourcePatientGroupIdentificationSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SourcePatientGroupIdentificationSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSourcePatientGroupIdentificationSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SourcePatientGroupIdentificationSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtsptcs.cc b/dcmrt/libsrc/drtsptcs.cc new file mode 100644 index 00000000..2f36d5d0 --- /dev/null +++ b/dcmrt/libsrc/drtsptcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSegmentedPropertyTypeModifierCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtsptcs.h" + + +// --- item class --- + +DRTSegmentedPropertyTypeModifierCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::Item::~Item() +{ +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::Item &DRTSegmentedPropertyTypeModifierCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTSegmentedPropertyTypeModifierCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTSegmentedPropertyTypeModifierCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTSegmentedPropertyTypeModifierCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "SegmentedPropertyTypeModifierCodeSequence"); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSegmentedPropertyTypeModifierCodeSequence::DRTSegmentedPropertyTypeModifierCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::DRTSegmentedPropertyTypeModifierCodeSequence(const DRTSegmentedPropertyTypeModifierCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSegmentedPropertyTypeModifierCodeSequence &DRTSegmentedPropertyTypeModifierCodeSequence::operator=(const DRTSegmentedPropertyTypeModifierCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::~DRTSegmentedPropertyTypeModifierCodeSequence() +{ + clear(); +} + + +void DRTSegmentedPropertyTypeModifierCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSegmentedPropertyTypeModifierCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSegmentedPropertyTypeModifierCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSegmentedPropertyTypeModifierCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::Item &DRTSegmentedPropertyTypeModifierCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSegmentedPropertyTypeModifierCodeSequence::Item &DRTSegmentedPropertyTypeModifierCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::Item &DRTSegmentedPropertyTypeModifierCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSegmentedPropertyTypeModifierCodeSequence::Item &DRTSegmentedPropertyTypeModifierCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSegmentedPropertyTypeModifierCodeSequence::Item &DRTSegmentedPropertyTypeModifierCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSegmentedPropertyTypeModifierCodeSequence::Item &DRTSegmentedPropertyTypeModifierCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SegmentedPropertyTypeModifierCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SegmentedPropertyTypeModifierCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSegmentedPropertyTypeModifierCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SegmentedPropertyTypeModifierCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtss.cc b/dcmrt/libsrc/drtss.cc new file mode 100644 index 00000000..e0ef16cf --- /dev/null +++ b/dcmrt/libsrc/drtss.cc @@ -0,0 +1,1109 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTSourceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtss.h" + + +// --- item class --- + +DRTSourceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ActiveSourceDiameter(DCM_ActiveSourceDiameter), + ActiveSourceLength(DCM_ActiveSourceLength), + MaterialID(DCM_MaterialID), + ReferenceAirKermaRate(DCM_ReferenceAirKermaRate), + SourceDescription(DCM_SourceDescription), + SourceEncapsulationNominalThickness(DCM_SourceEncapsulationNominalThickness), + SourceEncapsulationNominalTransmission(DCM_SourceEncapsulationNominalTransmission), + SourceIsotopeHalfLife(DCM_SourceIsotopeHalfLife), + SourceIsotopeName(DCM_SourceIsotopeName), + SourceManufacturer(DCM_SourceManufacturer), + SourceModelID(DCM_SourceModelID), + SourceNumber(DCM_SourceNumber), + SourceSerialNumber(DCM_SourceSerialNumber), + SourceStrength(DCM_SourceStrength), + SourceStrengthReferenceDate(DCM_SourceStrengthReferenceDate), + SourceStrengthReferenceTime(DCM_SourceStrengthReferenceTime), + SourceStrengthUnits(DCM_SourceStrengthUnits), + SourceType(DCM_SourceType) +{ +} + + +DRTSourceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ActiveSourceDiameter(copy.ActiveSourceDiameter), + ActiveSourceLength(copy.ActiveSourceLength), + MaterialID(copy.MaterialID), + ReferenceAirKermaRate(copy.ReferenceAirKermaRate), + SourceDescription(copy.SourceDescription), + SourceEncapsulationNominalThickness(copy.SourceEncapsulationNominalThickness), + SourceEncapsulationNominalTransmission(copy.SourceEncapsulationNominalTransmission), + SourceIsotopeHalfLife(copy.SourceIsotopeHalfLife), + SourceIsotopeName(copy.SourceIsotopeName), + SourceManufacturer(copy.SourceManufacturer), + SourceModelID(copy.SourceModelID), + SourceNumber(copy.SourceNumber), + SourceSerialNumber(copy.SourceSerialNumber), + SourceStrength(copy.SourceStrength), + SourceStrengthReferenceDate(copy.SourceStrengthReferenceDate), + SourceStrengthReferenceTime(copy.SourceStrengthReferenceTime), + SourceStrengthUnits(copy.SourceStrengthUnits), + SourceType(copy.SourceType) +{ +} + + +DRTSourceSequence::Item::~Item() +{ +} + + +DRTSourceSequence::Item &DRTSourceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ActiveSourceDiameter = copy.ActiveSourceDiameter; + ActiveSourceLength = copy.ActiveSourceLength; + MaterialID = copy.MaterialID; + ReferenceAirKermaRate = copy.ReferenceAirKermaRate; + SourceDescription = copy.SourceDescription; + SourceEncapsulationNominalThickness = copy.SourceEncapsulationNominalThickness; + SourceEncapsulationNominalTransmission = copy.SourceEncapsulationNominalTransmission; + SourceIsotopeHalfLife = copy.SourceIsotopeHalfLife; + SourceIsotopeName = copy.SourceIsotopeName; + SourceManufacturer = copy.SourceManufacturer; + SourceModelID = copy.SourceModelID; + SourceNumber = copy.SourceNumber; + SourceSerialNumber = copy.SourceSerialNumber; + SourceStrength = copy.SourceStrength; + SourceStrengthReferenceDate = copy.SourceStrengthReferenceDate; + SourceStrengthReferenceTime = copy.SourceStrengthReferenceTime; + SourceStrengthUnits = copy.SourceStrengthUnits; + SourceType = copy.SourceType; + } + return *this; +} + + +void DRTSourceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + SourceNumber.clear(); + SourceSerialNumber.clear(); + SourceModelID.clear(); + SourceDescription.clear(); + SourceType.clear(); + SourceManufacturer.clear(); + ActiveSourceDiameter.clear(); + ActiveSourceLength.clear(); + MaterialID.clear(); + SourceEncapsulationNominalThickness.clear(); + SourceEncapsulationNominalTransmission.clear(); + SourceIsotopeName.clear(); + SourceIsotopeHalfLife.clear(); + SourceStrengthUnits.clear(); + ReferenceAirKermaRate.clear(); + SourceStrength.clear(); + SourceStrengthReferenceDate.clear(); + SourceStrengthReferenceTime.clear(); + } +} + + +OFBool DRTSourceSequence::Item::isEmpty() +{ + return SourceNumber.isEmpty() && + SourceSerialNumber.isEmpty() && + SourceModelID.isEmpty() && + SourceDescription.isEmpty() && + SourceType.isEmpty() && + SourceManufacturer.isEmpty() && + ActiveSourceDiameter.isEmpty() && + ActiveSourceLength.isEmpty() && + MaterialID.isEmpty() && + SourceEncapsulationNominalThickness.isEmpty() && + SourceEncapsulationNominalTransmission.isEmpty() && + SourceIsotopeName.isEmpty() && + SourceIsotopeHalfLife.isEmpty() && + SourceStrengthUnits.isEmpty() && + ReferenceAirKermaRate.isEmpty() && + SourceStrength.isEmpty() && + SourceStrengthReferenceDate.isEmpty() && + SourceStrengthReferenceTime.isEmpty(); +} + + +OFBool DRTSourceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTSourceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, SourceNumber, "1", "1", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceSerialNumber, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceModelID, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceDescription, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceType, "1", "1", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceManufacturer, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, ActiveSourceDiameter, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, ActiveSourceLength, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, MaterialID, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceEncapsulationNominalThickness, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceEncapsulationNominalTransmission, "1", "3", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceIsotopeName, "1", "1", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceIsotopeHalfLife, "1", "1", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceStrengthUnits, "1", "1C", "SourceSequence"); + getAndCheckElementFromDataset(item, ReferenceAirKermaRate, "1", "1", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceStrength, "1", "1C", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceStrengthReferenceDate, "1", "1", "SourceSequence"); + getAndCheckElementFromDataset(item, SourceStrengthReferenceTime, "1", "1", "SourceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(SourceNumber), "1", "1", "SourceSequence"); + addElementToDataset(result, item, new DcmLongString(SourceSerialNumber), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmShortString(SourceModelID), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmLongString(SourceDescription), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmCodeString(SourceType), "1", "1", "SourceSequence"); + addElementToDataset(result, item, new DcmLongString(SourceManufacturer), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmDecimalString(ActiveSourceDiameter), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmDecimalString(ActiveSourceLength), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmShortString(MaterialID), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceEncapsulationNominalThickness), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceEncapsulationNominalTransmission), "1", "3", "SourceSequence"); + addElementToDataset(result, item, new DcmLongString(SourceIsotopeName), "1", "1", "SourceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceIsotopeHalfLife), "1", "1", "SourceSequence"); + addElementToDataset(result, item, new DcmCodeString(SourceStrengthUnits), "1", "1C", "SourceSequence"); + addElementToDataset(result, item, new DcmDecimalString(ReferenceAirKermaRate), "1", "1", "SourceSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceStrength), "1", "1C", "SourceSequence"); + addElementToDataset(result, item, new DcmDate(SourceStrengthReferenceDate), "1", "1", "SourceSequence"); + addElementToDataset(result, item, new DcmTime(SourceStrengthReferenceTime), "1", "1", "SourceSequence"); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::getActiveSourceDiameter(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ActiveSourceDiameter, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getActiveSourceDiameter(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ActiveSourceDiameter).getFloat64(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getActiveSourceLength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ActiveSourceLength, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getActiveSourceLength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ActiveSourceLength).getFloat64(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getMaterialID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MaterialID, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getReferenceAirKermaRate(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferenceAirKermaRate, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getReferenceAirKermaRate(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ReferenceAirKermaRate).getFloat64(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceDescription, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceEncapsulationNominalThickness(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceEncapsulationNominalThickness, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceEncapsulationNominalThickness(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceEncapsulationNominalThickness).getFloat64(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceEncapsulationNominalTransmission(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceEncapsulationNominalTransmission, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceEncapsulationNominalTransmission(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceEncapsulationNominalTransmission).getFloat64(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceIsotopeHalfLife(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceIsotopeHalfLife, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceIsotopeHalfLife(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceIsotopeHalfLife).getFloat64(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceIsotopeName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceIsotopeName, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceManufacturer, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceModelID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceModelID, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceNumber, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, SourceNumber).getSint32(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceSerialNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceSerialNumber, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceStrength(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceStrength, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceStrength(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceStrength).getFloat64(value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceStrengthReferenceDate(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceStrengthReferenceDate, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceStrengthReferenceTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceStrengthReferenceTime, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceStrengthUnits(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceStrengthUnits, value, pos); +} + + +OFCondition DRTSourceSequence::Item::getSourceType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceType, value, pos); +} + + +OFCondition DRTSourceSequence::Item::setActiveSourceDiameter(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ActiveSourceDiameter.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setActiveSourceLength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ActiveSourceLength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setMaterialID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MaterialID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setReferenceAirKermaRate(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferenceAirKermaRate.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceEncapsulationNominalThickness(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceEncapsulationNominalThickness.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceEncapsulationNominalTransmission(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceEncapsulationNominalTransmission.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceIsotopeHalfLife(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceIsotopeHalfLife.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceIsotopeName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceIsotopeName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceManufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceModelID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceModelID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceSerialNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceStrength(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceStrength.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceStrengthReferenceDate(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceStrengthReferenceDate.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceStrengthReferenceTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceStrengthReferenceTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceStrengthUnits(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceStrengthUnits.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTSourceSequence::Item::setSourceType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTSourceSequence::DRTSourceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTSourceSequence::DRTSourceSequence(const DRTSourceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTSourceSequence &DRTSourceSequence::operator=(const DRTSourceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTSourceSequence::~DRTSourceSequence() +{ + clear(); +} + + +void DRTSourceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTSourceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTSourceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTSourceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTSourceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTSourceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTSourceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTSourceSequence::Item &DRTSourceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTSourceSequence::Item &DRTSourceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTSourceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTSourceSequence::Item &DRTSourceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTSourceSequence::Item &DRTSourceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTSourceSequence::Item &DRTSourceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTSourceSequence::Item &DRTSourceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTSourceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTSourceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTSourceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTSourceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_SourceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_SourceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTSourceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_SourceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtssrcs.cc b/dcmrt/libsrc/drtssrcs.cc new file mode 100644 index 00000000..3443bbfc --- /dev/null +++ b/dcmrt/libsrc/drtssrcs.cc @@ -0,0 +1,957 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTStrainSourceRegistryCodeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtssrcs.h" + + +// --- item class --- + +DRTStrainSourceRegistryCodeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CodeMeaning(DCM_CodeMeaning), + CodeValue(DCM_CodeValue), + CodingSchemeDesignator(DCM_CodingSchemeDesignator), + CodingSchemeVersion(DCM_CodingSchemeVersion), + ContextGroupExtensionCreatorUID(DCM_ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(DCM_ContextGroupExtensionFlag), + ContextGroupLocalVersion(DCM_ContextGroupLocalVersion), + ContextGroupVersion(DCM_ContextGroupVersion), + ContextIdentifier(DCM_ContextIdentifier), + ContextUID(DCM_ContextUID), + EquivalentCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + LongCodeValue(DCM_LongCodeValue), + MappingResource(DCM_MappingResource), + MappingResourceName(DCM_MappingResourceName), + MappingResourceUID(DCM_MappingResourceUID), + URNCodeValue(DCM_URNCodeValue) +{ +} + + +DRTStrainSourceRegistryCodeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CodeMeaning(copy.CodeMeaning), + CodeValue(copy.CodeValue), + CodingSchemeDesignator(copy.CodingSchemeDesignator), + CodingSchemeVersion(copy.CodingSchemeVersion), + ContextGroupExtensionCreatorUID(copy.ContextGroupExtensionCreatorUID), + ContextGroupExtensionFlag(copy.ContextGroupExtensionFlag), + ContextGroupLocalVersion(copy.ContextGroupLocalVersion), + ContextGroupVersion(copy.ContextGroupVersion), + ContextIdentifier(copy.ContextIdentifier), + ContextUID(copy.ContextUID), + EquivalentCodeSequence(copy.EquivalentCodeSequence), + LongCodeValue(copy.LongCodeValue), + MappingResource(copy.MappingResource), + MappingResourceName(copy.MappingResourceName), + MappingResourceUID(copy.MappingResourceUID), + URNCodeValue(copy.URNCodeValue) +{ +} + + +DRTStrainSourceRegistryCodeSequence::Item::~Item() +{ +} + + +DRTStrainSourceRegistryCodeSequence::Item &DRTStrainSourceRegistryCodeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CodeMeaning = copy.CodeMeaning; + CodeValue = copy.CodeValue; + CodingSchemeDesignator = copy.CodingSchemeDesignator; + CodingSchemeVersion = copy.CodingSchemeVersion; + ContextGroupExtensionCreatorUID = copy.ContextGroupExtensionCreatorUID; + ContextGroupExtensionFlag = copy.ContextGroupExtensionFlag; + ContextGroupLocalVersion = copy.ContextGroupLocalVersion; + ContextGroupVersion = copy.ContextGroupVersion; + ContextIdentifier = copy.ContextIdentifier; + ContextUID = copy.ContextUID; + EquivalentCodeSequence = copy.EquivalentCodeSequence; + LongCodeValue = copy.LongCodeValue; + MappingResource = copy.MappingResource; + MappingResourceName = copy.MappingResourceName; + MappingResourceUID = copy.MappingResourceUID; + URNCodeValue = copy.URNCodeValue; + } + return *this; +} + + +void DRTStrainSourceRegistryCodeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + LongCodeValue.clear(); + URNCodeValue.clear(); + EquivalentCodeSequence.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MappingResourceName.clear(); + ContextGroupVersion.clear(); + ContextGroupExtensionFlag.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } +} + + +OFBool DRTStrainSourceRegistryCodeSequence::Item::isEmpty() +{ + return CodeValue.isEmpty() && + CodingSchemeDesignator.isEmpty() && + CodingSchemeVersion.isEmpty() && + CodeMeaning.isEmpty() && + LongCodeValue.isEmpty() && + URNCodeValue.isEmpty() && + EquivalentCodeSequence.isEmpty() && + ContextIdentifier.isEmpty() && + ContextUID.isEmpty() && + MappingResource.isEmpty() && + MappingResourceUID.isEmpty() && + MappingResourceName.isEmpty() && + ContextGroupVersion.isEmpty() && + ContextGroupExtensionFlag.isEmpty() && + ContextGroupLocalVersion.isEmpty() && + ContextGroupExtensionCreatorUID.isEmpty(); +} + + +OFBool DRTStrainSourceRegistryCodeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, CodeValue, "1", "1C", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeDesignator, "1", "1C", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, CodingSchemeVersion, "1", "1C", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, CodeMeaning, "1", "1", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, LongCodeValue, "1", "1C", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, URNCodeValue, "1", "1C", "StrainSourceRegistryCodeSequence"); + EquivalentCodeSequence.read(item, "1-n", "3", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextIdentifier, "1", "3", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextUID, "1", "3", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResource, "1", "1C", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceUID, "1", "3", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, MappingResourceName, "1", "3", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupVersion, "1", "1C", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionFlag, "1", "3", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupLocalVersion, "1", "1C", "StrainSourceRegistryCodeSequence"); + getAndCheckElementFromDataset(item, ContextGroupExtensionCreatorUID, "1", "1C", "StrainSourceRegistryCodeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(CodeValue), "1", "1C", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeDesignator), "1", "1C", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmShortString(CodingSchemeVersion), "1", "1C", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmLongString(CodeMeaning), "1", "1", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUnlimitedCharacters(LongCodeValue), "1", "1C", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(URNCodeValue), "1", "1C", "StrainSourceRegistryCodeSequence"); + if (result.good()) result = EquivalentCodeSequence.write(item, "1-n", "3", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextIdentifier), "1", "3", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextUID), "1", "3", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(MappingResource), "1", "1C", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(MappingResourceUID), "1", "3", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmLongString(MappingResourceName), "1", "3", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupVersion), "1", "1C", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmCodeString(ContextGroupExtensionFlag), "1", "3", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmDateTime(ContextGroupLocalVersion), "1", "1C", "StrainSourceRegistryCodeSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ContextGroupExtensionCreatorUID), "1", "1C", "StrainSourceRegistryCodeSequence"); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getCodeMeaning(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeMeaning, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodeValue, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getCodingSchemeDesignator(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeDesignator, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getCodingSchemeVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CodingSchemeVersion, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getContextGroupExtensionCreatorUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionCreatorUID, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getContextGroupExtensionFlag(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupExtensionFlag, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getContextGroupLocalVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupLocalVersion, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getContextGroupVersion(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextGroupVersion, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getContextIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextIdentifier, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getContextUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ContextUID, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getLongCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LongCodeValue, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getMappingResource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResource, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getMappingResourceName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceName, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getMappingResourceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(MappingResourceUID, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::getURNCodeValue(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(URNCodeValue, value, pos); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setCodeMeaning(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeMeaning.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setCodingSchemeDesignator(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeDesignator.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setCodingSchemeVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CodingSchemeVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setContextGroupExtensionCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionCreatorUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setContextGroupExtensionFlag(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupExtensionFlag.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setContextGroupLocalVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupLocalVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setContextGroupVersion(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextGroupVersion.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setContextIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextIdentifier.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setContextUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContextUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setLongCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongCodeValue.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setMappingResource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setMappingResourceName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setMappingResourceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MappingResourceUID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::Item::setURNCodeValue(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = URNCodeValue.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTStrainSourceRegistryCodeSequence::DRTStrainSourceRegistryCodeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTStrainSourceRegistryCodeSequence::DRTStrainSourceRegistryCodeSequence(const DRTStrainSourceRegistryCodeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTStrainSourceRegistryCodeSequence &DRTStrainSourceRegistryCodeSequence::operator=(const DRTStrainSourceRegistryCodeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTStrainSourceRegistryCodeSequence::~DRTStrainSourceRegistryCodeSequence() +{ + clear(); +} + + +void DRTStrainSourceRegistryCodeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTStrainSourceRegistryCodeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTStrainSourceRegistryCodeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTStrainSourceRegistryCodeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTStrainSourceRegistryCodeSequence::Item &DRTStrainSourceRegistryCodeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTStrainSourceRegistryCodeSequence::Item &DRTStrainSourceRegistryCodeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTStrainSourceRegistryCodeSequence::Item &DRTStrainSourceRegistryCodeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTStrainSourceRegistryCodeSequence::Item &DRTStrainSourceRegistryCodeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTStrainSourceRegistryCodeSequence::Item &DRTStrainSourceRegistryCodeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTStrainSourceRegistryCodeSequence::Item &DRTStrainSourceRegistryCodeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_StrainSourceRegistryCodeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_StrainSourceRegistryCodeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTStrainSourceRegistryCodeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_StrainSourceRegistryCodeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtssrs.cc b/dcmrt/libsrc/drtssrs.cc new file mode 100644 index 00000000..8d050cde --- /dev/null +++ b/dcmrt/libsrc/drtssrs.cc @@ -0,0 +1,743 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTStructureSetROISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtssrs.h" + + +// --- item class --- + +DRTStructureSetROISequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DerivationCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ROIDescription(DCM_ROIDescription), + ROIGenerationAlgorithm(DCM_ROIGenerationAlgorithm), + ROIGenerationDescription(DCM_ROIGenerationDescription), + ROIName(DCM_ROIName), + ROINumber(DCM_ROINumber), + ROIVolume(DCM_ROIVolume), + ReferencedFrameOfReferenceUID(DCM_ReferencedFrameOfReferenceUID) +{ +} + + +DRTStructureSetROISequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DerivationCodeSequence(copy.DerivationCodeSequence), + ROIDescription(copy.ROIDescription), + ROIGenerationAlgorithm(copy.ROIGenerationAlgorithm), + ROIGenerationDescription(copy.ROIGenerationDescription), + ROIName(copy.ROIName), + ROINumber(copy.ROINumber), + ROIVolume(copy.ROIVolume), + ReferencedFrameOfReferenceUID(copy.ReferencedFrameOfReferenceUID) +{ +} + + +DRTStructureSetROISequence::Item::~Item() +{ +} + + +DRTStructureSetROISequence::Item &DRTStructureSetROISequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DerivationCodeSequence = copy.DerivationCodeSequence; + ROIDescription = copy.ROIDescription; + ROIGenerationAlgorithm = copy.ROIGenerationAlgorithm; + ROIGenerationDescription = copy.ROIGenerationDescription; + ROIName = copy.ROIName; + ROINumber = copy.ROINumber; + ROIVolume = copy.ROIVolume; + ReferencedFrameOfReferenceUID = copy.ReferencedFrameOfReferenceUID; + } + return *this; +} + + +void DRTStructureSetROISequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ROINumber.clear(); + ReferencedFrameOfReferenceUID.clear(); + ROIName.clear(); + ROIDescription.clear(); + ROIVolume.clear(); + ROIGenerationAlgorithm.clear(); + ROIGenerationDescription.clear(); + DerivationCodeSequence.clear(); + } +} + + +OFBool DRTStructureSetROISequence::Item::isEmpty() +{ + return ROINumber.isEmpty() && + ReferencedFrameOfReferenceUID.isEmpty() && + ROIName.isEmpty() && + ROIDescription.isEmpty() && + ROIVolume.isEmpty() && + ROIGenerationAlgorithm.isEmpty() && + ROIGenerationDescription.isEmpty() && + DerivationCodeSequence.isEmpty(); +} + + +OFBool DRTStructureSetROISequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTStructureSetROISequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ROINumber, "1", "1", "StructureSetROISequence"); + getAndCheckElementFromDataset(item, ReferencedFrameOfReferenceUID, "1", "1", "StructureSetROISequence"); + getAndCheckElementFromDataset(item, ROIName, "1", "2", "StructureSetROISequence"); + getAndCheckElementFromDataset(item, ROIDescription, "1", "3", "StructureSetROISequence"); + getAndCheckElementFromDataset(item, ROIVolume, "1", "3", "StructureSetROISequence"); + getAndCheckElementFromDataset(item, ROIGenerationAlgorithm, "1", "2", "StructureSetROISequence"); + getAndCheckElementFromDataset(item, ROIGenerationDescription, "1", "3", "StructureSetROISequence"); + DerivationCodeSequence.read(item, "1-n", "3", "StructureSetROISequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ROINumber), "1", "1", "StructureSetROISequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(ReferencedFrameOfReferenceUID), "1", "1", "StructureSetROISequence"); + addElementToDataset(result, item, new DcmLongString(ROIName), "1", "2", "StructureSetROISequence"); + addElementToDataset(result, item, new DcmShortText(ROIDescription), "1", "3", "StructureSetROISequence"); + addElementToDataset(result, item, new DcmDecimalString(ROIVolume), "1", "3", "StructureSetROISequence"); + addElementToDataset(result, item, new DcmCodeString(ROIGenerationAlgorithm), "1", "2", "StructureSetROISequence"); + addElementToDataset(result, item, new DcmLongString(ROIGenerationDescription), "1", "3", "StructureSetROISequence"); + if (result.good()) result = DerivationCodeSequence.write(item, "1-n", "3", "StructureSetROISequence"); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::getROIDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIDescription, value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getROIGenerationAlgorithm(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIGenerationAlgorithm, value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getROIGenerationDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIGenerationDescription, value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getROIName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIName, value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getROINumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROINumber, value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getROINumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ROINumber).getSint32(value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getROIVolume(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ROIVolume, value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getROIVolume(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, ROIVolume).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::getReferencedFrameOfReferenceUID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedFrameOfReferenceUID, value, pos); +} + + +OFCondition DRTStructureSetROISequence::Item::setROIDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ROIDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::setROIGenerationAlgorithm(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIGenerationAlgorithm.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::setROIGenerationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIGenerationDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::setROIName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::setROINumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROINumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::setROIVolume(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ROIVolume.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::Item::setReferencedFrameOfReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedFrameOfReferenceUID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTStructureSetROISequence::DRTStructureSetROISequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTStructureSetROISequence::DRTStructureSetROISequence(const DRTStructureSetROISequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTStructureSetROISequence &DRTStructureSetROISequence::operator=(const DRTStructureSetROISequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTStructureSetROISequence::~DRTStructureSetROISequence() +{ + clear(); +} + + +void DRTStructureSetROISequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTStructureSetROISequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTStructureSetROISequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTStructureSetROISequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTStructureSetROISequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStructureSetROISequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStructureSetROISequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStructureSetROISequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStructureSetROISequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTStructureSetROISequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTStructureSetROISequence::Item &DRTStructureSetROISequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTStructureSetROISequence::Item &DRTStructureSetROISequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTStructureSetROISequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTStructureSetROISequence::Item &DRTStructureSetROISequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTStructureSetROISequence::Item &DRTStructureSetROISequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTStructureSetROISequence::Item &DRTStructureSetROISequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTStructureSetROISequence::Item &DRTStructureSetROISequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTStructureSetROISequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTStructureSetROISequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTStructureSetROISequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStructureSetROISequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_StructureSetROISequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_StructureSetROISequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTStructureSetROISequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_StructureSetROISequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtsss.cc b/dcmrt/libsrc/drtsss.cc new file mode 100644 index 00000000..a50e49a2 --- /dev/null +++ b/dcmrt/libsrc/drtsss.cc @@ -0,0 +1,580 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTStrainStockSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtsss.h" + + +// --- item class --- + +DRTStrainStockSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + StrainSource(DCM_StrainSource), + StrainSourceRegistryCodeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + StrainStockNumber(DCM_StrainStockNumber) +{ +} + + +DRTStrainStockSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + StrainSource(copy.StrainSource), + StrainSourceRegistryCodeSequence(copy.StrainSourceRegistryCodeSequence), + StrainStockNumber(copy.StrainStockNumber) +{ +} + + +DRTStrainStockSequence::Item::~Item() +{ +} + + +DRTStrainStockSequence::Item &DRTStrainStockSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + StrainSource = copy.StrainSource; + StrainSourceRegistryCodeSequence = copy.StrainSourceRegistryCodeSequence; + StrainStockNumber = copy.StrainStockNumber; + } + return *this; +} + + +void DRTStrainStockSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + StrainStockNumber.clear(); + StrainSource.clear(); + StrainSourceRegistryCodeSequence.clear(); + } +} + + +OFBool DRTStrainStockSequence::Item::isEmpty() +{ + return StrainStockNumber.isEmpty() && + StrainSource.isEmpty() && + StrainSourceRegistryCodeSequence.isEmpty(); +} + + +OFBool DRTStrainStockSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTStrainStockSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, StrainStockNumber, "1", "1", "StrainStockSequence"); + getAndCheckElementFromDataset(item, StrainSource, "1", "1", "StrainStockSequence"); + StrainSourceRegistryCodeSequence.read(item, "1-n", "1", "StrainStockSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainStockSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmLongString(StrainStockNumber), "1", "1", "StrainStockSequence"); + addElementToDataset(result, item, new DcmLongString(StrainSource), "1", "1", "StrainStockSequence"); + if (result.good()) result = StrainSourceRegistryCodeSequence.write(item, "1-n", "1", "StrainStockSequence"); + } + return result; +} + + +OFCondition DRTStrainStockSequence::Item::getStrainSource(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StrainSource, value, pos); +} + + +OFCondition DRTStrainStockSequence::Item::getStrainStockNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(StrainStockNumber, value, pos); +} + + +OFCondition DRTStrainStockSequence::Item::setStrainSource(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainSource.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTStrainStockSequence::Item::setStrainStockNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainStockNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTStrainStockSequence::DRTStrainStockSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTStrainStockSequence::DRTStrainStockSequence(const DRTStrainStockSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTStrainStockSequence &DRTStrainStockSequence::operator=(const DRTStrainStockSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTStrainStockSequence::~DRTStrainStockSequence() +{ + clear(); +} + + +void DRTStrainStockSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTStrainStockSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTStrainStockSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTStrainStockSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTStrainStockSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainStockSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTStrainStockSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainStockSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainStockSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTStrainStockSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTStrainStockSequence::Item &DRTStrainStockSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTStrainStockSequence::Item &DRTStrainStockSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTStrainStockSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTStrainStockSequence::Item &DRTStrainStockSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTStrainStockSequence::Item &DRTStrainStockSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTStrainStockSequence::Item &DRTStrainStockSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTStrainStockSequence::Item &DRTStrainStockSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTStrainStockSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTStrainStockSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTStrainStockSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTStrainStockSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_StrainStockSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_StrainStockSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTStrainStockSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_StrainStockSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtstrct.cc b/dcmrt/libsrc/drtstrct.cc new file mode 100644 index 00000000..0e48bbe7 --- /dev/null +++ b/dcmrt/libsrc/drtstrct.cc @@ -0,0 +1,3372 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTStructureSetIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drtstrct.h" + + +DRTStructureSetIOD::DRTStructureSetIOD() + : PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(), + PatientBirthDate(DCM_PatientBirthDate), + PatientBirthDateInAlternativeCalendar(DCM_PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(DCM_PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(DCM_PatientAlternativeCalendar), + PatientSex(DCM_PatientSex), + ReferencedPatientPhotoSequence(), + QualityControlSubject(DCM_QualityControlSubject), + ReferencedPatientSequence(), + PatientBirthTime(DCM_PatientBirthTime), + OtherPatientIDsSequence(), + OtherPatientNames(DCM_OtherPatientNames), + EthnicGroup(DCM_EthnicGroup), + PatientComments(DCM_PatientComments), + PatientSpeciesDescription(DCM_PatientSpeciesDescription), + PatientSpeciesCodeSequence(), + PatientBreedDescription(DCM_PatientBreedDescription), + PatientBreedCodeSequence(), + BreedRegistrationSequence(), + StrainDescription(DCM_StrainDescription), + StrainNomenclature(DCM_StrainNomenclature), + StrainCodeSequence(), + StrainAdditionalInformation(DCM_StrainAdditionalInformation), + StrainStockSequence(), + GeneticModificationsSequence(), + ResponsiblePerson(DCM_ResponsiblePerson), + ResponsiblePersonRole(DCM_ResponsiblePersonRole), + ResponsibleOrganization(DCM_ResponsibleOrganization), + PatientIdentityRemoved(DCM_PatientIdentityRemoved), + DeidentificationMethod(DCM_DeidentificationMethod), + DeidentificationMethodCodeSequence(), + SourcePatientGroupIdentificationSequence(), + GroupOfPatientsIdentificationSequence(), + ClinicalTrialSponsorName(DCM_ClinicalTrialSponsorName), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ClinicalTrialProtocolName(DCM_ClinicalTrialProtocolName), + ClinicalTrialSiteID(DCM_ClinicalTrialSiteID), + ClinicalTrialSiteName(DCM_ClinicalTrialSiteName), + ClinicalTrialSubjectID(DCM_ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(DCM_ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(DCM_ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(), + ConsultingPhysicianName(DCM_ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(), + StudyDescription(DCM_StudyDescription), + PhysiciansOfRecord(DCM_PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(), + NameOfPhysiciansReadingStudy(DCM_NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(), + RequestingServiceCodeSequence(), + ReferencedStudySequence(), + ProcedureCodeSequence(), + ReasonForPerformedProcedureCodeSequence(), + AdmittingDiagnosesDescription(DCM_AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(), + PatientAge(DCM_PatientAge), + PatientSize(DCM_PatientSize), + PatientWeight(DCM_PatientWeight), + PatientBodyMassIndex(DCM_PatientBodyMassIndex), + MeasuredAPDimension(DCM_MeasuredAPDimension), + MeasuredLateralDimension(DCM_MeasuredLateralDimension), + PatientSizeCodeSequence(), + MedicalAlerts(DCM_MedicalAlerts), + Allergies(DCM_Allergies), + SmokingStatus(DCM_SmokingStatus), + PregnancyStatus(DCM_PregnancyStatus), + LastMenstrualDate(DCM_LastMenstrualDate), + PatientState(DCM_PatientState), + Occupation(DCM_Occupation), + AdditionalPatientHistory(DCM_AdditionalPatientHistory), + AdmissionID(DCM_AdmissionID), + IssuerOfAdmissionIDSequence(), + ServiceEpisodeID(DCM_ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(), + ServiceEpisodeDescription(DCM_ServiceEpisodeDescription), + PatientSexNeutered(DCM_PatientSexNeutered), + ClinicalTrialTimePointID(DCM_ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(DCM_ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(DCM_LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(DCM_LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + SeriesDescription(DCM_SeriesDescription), + SeriesDescriptionCodeSequence(), + OperatorsName(DCM_OperatorsName), + OperatorIdentificationSequence(), + ReferencedPerformedProcedureStepSequence(), + RequestAttributesSequence(), + PerformedProcedureStepID(DCM_PerformedProcedureStepID), + PerformedProcedureStepStartDate(DCM_PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(DCM_PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(DCM_PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(DCM_PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(DCM_PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(), + CommentsOnThePerformedProcedureStep(DCM_CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(DCM_ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(DCM_ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(DCM_ClinicalTrialSeriesDescription), + Manufacturer(DCM_Manufacturer), + InstitutionName(DCM_InstitutionName), + InstitutionAddress(DCM_InstitutionAddress), + StationName(DCM_StationName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + GantryID(DCM_GantryID), + UDISequence(), + SpatialResolution(DCM_SpatialResolution), + DateOfLastCalibration(DCM_DateOfLastCalibration), + TimeOfLastCalibration(DCM_TimeOfLastCalibration), + PixelPaddingValue(DCM_PixelPaddingValue), + FrameOfReferenceUID(DCM_FrameOfReferenceUID), + PositionReferenceIndicator(DCM_PositionReferenceIndicator), + StructureSetLabel(DCM_StructureSetLabel), + StructureSetName(DCM_StructureSetName), + StructureSetDescription(DCM_StructureSetDescription), + InstanceNumber(DCM_InstanceNumber), + StructureSetDate(DCM_StructureSetDate), + StructureSetTime(DCM_StructureSetTime), + ReferencedFrameOfReferenceSequence(), + StructureSetROISequence(), + PredecessorStructureSetSequence(), + ROIContourSequence(), + RTROIObservationsSequence(), + ApprovalStatus(DCM_ApprovalStatus), + ReviewDate(DCM_ReviewDate), + ReviewTime(DCM_ReviewTime), + ReviewerName(DCM_ReviewerName), + ReferencedImageSequence(), + ReferencedInstanceSequence(), + DerivationDescription(DCM_DerivationDescription), + DerivationCodeSequence(), + SourceImageSequence(), + SourceInstanceSequence(), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCoercionDateTime(DCM_InstanceCoercionDateTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + RelatedGeneralSOPClassUID(DCM_RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(DCM_OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(), + ContextGroupIdentificationSequence(), + MappingResourceIdentificationSequence(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + ContributingEquipmentSequence(), + SOPInstanceStatus(DCM_SOPInstanceStatus), + SOPAuthorizationDateTime(DCM_SOPAuthorizationDateTime), + SOPAuthorizationComment(DCM_SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(DCM_AuthorizationEquipmentCertificationNumber), + MACParametersSequence(), + DigitalSignaturesSequence(), + EncryptedAttributesSequence(), + OriginalAttributesSequence(), + HL7StructuredDocumentReferenceSequence(), + LongitudinalTemporalInformationModified(DCM_LongitudinalTemporalInformationModified), + QueryRetrieveView(DCM_QueryRetrieveView), + ConversionSourceAttributesSequence(), + ContentQualification(DCM_ContentQualification), + PrivateDataElementCharacteristicsSequence(), + ReferencedSeriesSequence(), + StudiesContainingOtherReferencedInstancesSequence() +{ + /* set initial values for a new SOP instance */ + updateAttributes(); +} + + +DRTStructureSetIOD::DRTStructureSetIOD(const DRTStructureSetIOD ©) + : PatientName(copy.PatientName), + PatientID(copy.PatientID), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientBirthDate(copy.PatientBirthDate), + PatientBirthDateInAlternativeCalendar(copy.PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(copy.PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(copy.PatientAlternativeCalendar), + PatientSex(copy.PatientSex), + ReferencedPatientPhotoSequence(copy.ReferencedPatientPhotoSequence), + QualityControlSubject(copy.QualityControlSubject), + ReferencedPatientSequence(copy.ReferencedPatientSequence), + PatientBirthTime(copy.PatientBirthTime), + OtherPatientIDsSequence(copy.OtherPatientIDsSequence), + OtherPatientNames(copy.OtherPatientNames), + EthnicGroup(copy.EthnicGroup), + PatientComments(copy.PatientComments), + PatientSpeciesDescription(copy.PatientSpeciesDescription), + PatientSpeciesCodeSequence(copy.PatientSpeciesCodeSequence), + PatientBreedDescription(copy.PatientBreedDescription), + PatientBreedCodeSequence(copy.PatientBreedCodeSequence), + BreedRegistrationSequence(copy.BreedRegistrationSequence), + StrainDescription(copy.StrainDescription), + StrainNomenclature(copy.StrainNomenclature), + StrainCodeSequence(copy.StrainCodeSequence), + StrainAdditionalInformation(copy.StrainAdditionalInformation), + StrainStockSequence(copy.StrainStockSequence), + GeneticModificationsSequence(copy.GeneticModificationsSequence), + ResponsiblePerson(copy.ResponsiblePerson), + ResponsiblePersonRole(copy.ResponsiblePersonRole), + ResponsibleOrganization(copy.ResponsibleOrganization), + PatientIdentityRemoved(copy.PatientIdentityRemoved), + DeidentificationMethod(copy.DeidentificationMethod), + DeidentificationMethodCodeSequence(copy.DeidentificationMethodCodeSequence), + SourcePatientGroupIdentificationSequence(copy.SourcePatientGroupIdentificationSequence), + GroupOfPatientsIdentificationSequence(copy.GroupOfPatientsIdentificationSequence), + ClinicalTrialSponsorName(copy.ClinicalTrialSponsorName), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ClinicalTrialProtocolName(copy.ClinicalTrialProtocolName), + ClinicalTrialSiteID(copy.ClinicalTrialSiteID), + ClinicalTrialSiteName(copy.ClinicalTrialSiteName), + ClinicalTrialSubjectID(copy.ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(copy.ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(copy.ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(copy.StudyInstanceUID), + StudyDate(copy.StudyDate), + StudyTime(copy.StudyTime), + ReferringPhysicianName(copy.ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(copy.ReferringPhysicianIdentificationSequence), + ConsultingPhysicianName(copy.ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(copy.ConsultingPhysicianIdentificationSequence), + StudyID(copy.StudyID), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + StudyDescription(copy.StudyDescription), + PhysiciansOfRecord(copy.PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(copy.PhysiciansOfRecordIdentificationSequence), + NameOfPhysiciansReadingStudy(copy.NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(copy.PhysiciansReadingStudyIdentificationSequence), + RequestingServiceCodeSequence(copy.RequestingServiceCodeSequence), + ReferencedStudySequence(copy.ReferencedStudySequence), + ProcedureCodeSequence(copy.ProcedureCodeSequence), + ReasonForPerformedProcedureCodeSequence(copy.ReasonForPerformedProcedureCodeSequence), + AdmittingDiagnosesDescription(copy.AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(copy.AdmittingDiagnosesCodeSequence), + PatientAge(copy.PatientAge), + PatientSize(copy.PatientSize), + PatientWeight(copy.PatientWeight), + PatientBodyMassIndex(copy.PatientBodyMassIndex), + MeasuredAPDimension(copy.MeasuredAPDimension), + MeasuredLateralDimension(copy.MeasuredLateralDimension), + PatientSizeCodeSequence(copy.PatientSizeCodeSequence), + MedicalAlerts(copy.MedicalAlerts), + Allergies(copy.Allergies), + SmokingStatus(copy.SmokingStatus), + PregnancyStatus(copy.PregnancyStatus), + LastMenstrualDate(copy.LastMenstrualDate), + PatientState(copy.PatientState), + Occupation(copy.Occupation), + AdditionalPatientHistory(copy.AdditionalPatientHistory), + AdmissionID(copy.AdmissionID), + IssuerOfAdmissionIDSequence(copy.IssuerOfAdmissionIDSequence), + ServiceEpisodeID(copy.ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(copy.IssuerOfServiceEpisodeIDSequence), + ServiceEpisodeDescription(copy.ServiceEpisodeDescription), + PatientSexNeutered(copy.PatientSexNeutered), + ClinicalTrialTimePointID(copy.ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(copy.ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(copy.LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(copy.LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(copy.ConsentForClinicalTrialUseSequence), + Modality(copy.Modality), + SeriesInstanceUID(copy.SeriesInstanceUID), + SeriesNumber(copy.SeriesNumber), + SeriesDate(copy.SeriesDate), + SeriesTime(copy.SeriesTime), + SeriesDescription(copy.SeriesDescription), + SeriesDescriptionCodeSequence(copy.SeriesDescriptionCodeSequence), + OperatorsName(copy.OperatorsName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + ReferencedPerformedProcedureStepSequence(copy.ReferencedPerformedProcedureStepSequence), + RequestAttributesSequence(copy.RequestAttributesSequence), + PerformedProcedureStepID(copy.PerformedProcedureStepID), + PerformedProcedureStepStartDate(copy.PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(copy.PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(copy.PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(copy.PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(copy.PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(copy.PerformedProtocolCodeSequence), + CommentsOnThePerformedProcedureStep(copy.CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(copy.ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(copy.ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(copy.ClinicalTrialSeriesDescription), + Manufacturer(copy.Manufacturer), + InstitutionName(copy.InstitutionName), + InstitutionAddress(copy.InstitutionAddress), + StationName(copy.StationName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + ManufacturerModelName(copy.ManufacturerModelName), + DeviceSerialNumber(copy.DeviceSerialNumber), + SoftwareVersions(copy.SoftwareVersions), + GantryID(copy.GantryID), + UDISequence(copy.UDISequence), + SpatialResolution(copy.SpatialResolution), + DateOfLastCalibration(copy.DateOfLastCalibration), + TimeOfLastCalibration(copy.TimeOfLastCalibration), + PixelPaddingValue(copy.PixelPaddingValue), + FrameOfReferenceUID(copy.FrameOfReferenceUID), + PositionReferenceIndicator(copy.PositionReferenceIndicator), + StructureSetLabel(copy.StructureSetLabel), + StructureSetName(copy.StructureSetName), + StructureSetDescription(copy.StructureSetDescription), + InstanceNumber(copy.InstanceNumber), + StructureSetDate(copy.StructureSetDate), + StructureSetTime(copy.StructureSetTime), + ReferencedFrameOfReferenceSequence(copy.ReferencedFrameOfReferenceSequence), + StructureSetROISequence(copy.StructureSetROISequence), + PredecessorStructureSetSequence(copy.PredecessorStructureSetSequence), + ROIContourSequence(copy.ROIContourSequence), + RTROIObservationsSequence(copy.RTROIObservationsSequence), + ApprovalStatus(copy.ApprovalStatus), + ReviewDate(copy.ReviewDate), + ReviewTime(copy.ReviewTime), + ReviewerName(copy.ReviewerName), + ReferencedImageSequence(copy.ReferencedImageSequence), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + DerivationDescription(copy.DerivationDescription), + DerivationCodeSequence(copy.DerivationCodeSequence), + SourceImageSequence(copy.SourceImageSequence), + SourceInstanceSequence(copy.SourceInstanceSequence), + SOPClassUID(copy.SOPClassUID), + SOPInstanceUID(copy.SOPInstanceUID), + SpecificCharacterSet(copy.SpecificCharacterSet), + InstanceCreationDate(copy.InstanceCreationDate), + InstanceCreationTime(copy.InstanceCreationTime), + InstanceCoercionDateTime(copy.InstanceCoercionDateTime), + InstanceCreatorUID(copy.InstanceCreatorUID), + RelatedGeneralSOPClassUID(copy.RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(copy.OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(copy.CodingSchemeIdentificationSequence), + ContextGroupIdentificationSequence(copy.ContextGroupIdentificationSequence), + MappingResourceIdentificationSequence(copy.MappingResourceIdentificationSequence), + TimezoneOffsetFromUTC(copy.TimezoneOffsetFromUTC), + ContributingEquipmentSequence(copy.ContributingEquipmentSequence), + SOPInstanceStatus(copy.SOPInstanceStatus), + SOPAuthorizationDateTime(copy.SOPAuthorizationDateTime), + SOPAuthorizationComment(copy.SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(copy.AuthorizationEquipmentCertificationNumber), + MACParametersSequence(copy.MACParametersSequence), + DigitalSignaturesSequence(copy.DigitalSignaturesSequence), + EncryptedAttributesSequence(copy.EncryptedAttributesSequence), + OriginalAttributesSequence(copy.OriginalAttributesSequence), + HL7StructuredDocumentReferenceSequence(copy.HL7StructuredDocumentReferenceSequence), + LongitudinalTemporalInformationModified(copy.LongitudinalTemporalInformationModified), + QueryRetrieveView(copy.QueryRetrieveView), + ConversionSourceAttributesSequence(copy.ConversionSourceAttributesSequence), + ContentQualification(copy.ContentQualification), + PrivateDataElementCharacteristicsSequence(copy.PrivateDataElementCharacteristicsSequence), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudiesContainingOtherReferencedInstancesSequence(copy.StudiesContainingOtherReferencedInstancesSequence) +{ +} + + +DRTStructureSetIOD::~DRTStructureSetIOD() +{ +} + + +DRTStructureSetIOD &DRTStructureSetIOD::operator=(const DRTStructureSetIOD ©) +{ + if (this != ©) + { + PatientName = copy.PatientName; + PatientID = copy.PatientID; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientBirthDate = copy.PatientBirthDate; + PatientBirthDateInAlternativeCalendar = copy.PatientBirthDateInAlternativeCalendar; + PatientDeathDateInAlternativeCalendar = copy.PatientDeathDateInAlternativeCalendar; + PatientAlternativeCalendar = copy.PatientAlternativeCalendar; + PatientSex = copy.PatientSex; + ReferencedPatientPhotoSequence = copy.ReferencedPatientPhotoSequence; + QualityControlSubject = copy.QualityControlSubject; + ReferencedPatientSequence = copy.ReferencedPatientSequence; + PatientBirthTime = copy.PatientBirthTime; + OtherPatientIDsSequence = copy.OtherPatientIDsSequence; + OtherPatientNames = copy.OtherPatientNames; + EthnicGroup = copy.EthnicGroup; + PatientComments = copy.PatientComments; + PatientSpeciesDescription = copy.PatientSpeciesDescription; + PatientSpeciesCodeSequence = copy.PatientSpeciesCodeSequence; + PatientBreedDescription = copy.PatientBreedDescription; + PatientBreedCodeSequence = copy.PatientBreedCodeSequence; + BreedRegistrationSequence = copy.BreedRegistrationSequence; + StrainDescription = copy.StrainDescription; + StrainNomenclature = copy.StrainNomenclature; + StrainCodeSequence = copy.StrainCodeSequence; + StrainAdditionalInformation = copy.StrainAdditionalInformation; + StrainStockSequence = copy.StrainStockSequence; + GeneticModificationsSequence = copy.GeneticModificationsSequence; + ResponsiblePerson = copy.ResponsiblePerson; + ResponsiblePersonRole = copy.ResponsiblePersonRole; + ResponsibleOrganization = copy.ResponsibleOrganization; + PatientIdentityRemoved = copy.PatientIdentityRemoved; + DeidentificationMethod = copy.DeidentificationMethod; + DeidentificationMethodCodeSequence = copy.DeidentificationMethodCodeSequence; + SourcePatientGroupIdentificationSequence = copy.SourcePatientGroupIdentificationSequence; + GroupOfPatientsIdentificationSequence = copy.GroupOfPatientsIdentificationSequence; + ClinicalTrialSponsorName = copy.ClinicalTrialSponsorName; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ClinicalTrialProtocolName = copy.ClinicalTrialProtocolName; + ClinicalTrialSiteID = copy.ClinicalTrialSiteID; + ClinicalTrialSiteName = copy.ClinicalTrialSiteName; + ClinicalTrialSubjectID = copy.ClinicalTrialSubjectID; + ClinicalTrialSubjectReadingID = copy.ClinicalTrialSubjectReadingID; + ClinicalTrialProtocolEthicsCommitteeName = copy.ClinicalTrialProtocolEthicsCommitteeName; + ClinicalTrialProtocolEthicsCommitteeApprovalNumber = copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + StudyInstanceUID = copy.StudyInstanceUID; + StudyDate = copy.StudyDate; + StudyTime = copy.StudyTime; + ReferringPhysicianName = copy.ReferringPhysicianName; + ReferringPhysicianIdentificationSequence = copy.ReferringPhysicianIdentificationSequence; + ConsultingPhysicianName = copy.ConsultingPhysicianName; + ConsultingPhysicianIdentificationSequence = copy.ConsultingPhysicianIdentificationSequence; + StudyID = copy.StudyID; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + StudyDescription = copy.StudyDescription; + PhysiciansOfRecord = copy.PhysiciansOfRecord; + PhysiciansOfRecordIdentificationSequence = copy.PhysiciansOfRecordIdentificationSequence; + NameOfPhysiciansReadingStudy = copy.NameOfPhysiciansReadingStudy; + PhysiciansReadingStudyIdentificationSequence = copy.PhysiciansReadingStudyIdentificationSequence; + RequestingServiceCodeSequence = copy.RequestingServiceCodeSequence; + ReferencedStudySequence = copy.ReferencedStudySequence; + ProcedureCodeSequence = copy.ProcedureCodeSequence; + ReasonForPerformedProcedureCodeSequence = copy.ReasonForPerformedProcedureCodeSequence; + AdmittingDiagnosesDescription = copy.AdmittingDiagnosesDescription; + AdmittingDiagnosesCodeSequence = copy.AdmittingDiagnosesCodeSequence; + PatientAge = copy.PatientAge; + PatientSize = copy.PatientSize; + PatientWeight = copy.PatientWeight; + PatientBodyMassIndex = copy.PatientBodyMassIndex; + MeasuredAPDimension = copy.MeasuredAPDimension; + MeasuredLateralDimension = copy.MeasuredLateralDimension; + PatientSizeCodeSequence = copy.PatientSizeCodeSequence; + MedicalAlerts = copy.MedicalAlerts; + Allergies = copy.Allergies; + SmokingStatus = copy.SmokingStatus; + PregnancyStatus = copy.PregnancyStatus; + LastMenstrualDate = copy.LastMenstrualDate; + PatientState = copy.PatientState; + Occupation = copy.Occupation; + AdditionalPatientHistory = copy.AdditionalPatientHistory; + AdmissionID = copy.AdmissionID; + IssuerOfAdmissionIDSequence = copy.IssuerOfAdmissionIDSequence; + ServiceEpisodeID = copy.ServiceEpisodeID; + IssuerOfServiceEpisodeIDSequence = copy.IssuerOfServiceEpisodeIDSequence; + ServiceEpisodeDescription = copy.ServiceEpisodeDescription; + PatientSexNeutered = copy.PatientSexNeutered; + ClinicalTrialTimePointID = copy.ClinicalTrialTimePointID; + ClinicalTrialTimePointDescription = copy.ClinicalTrialTimePointDescription; + LongitudinalTemporalOffsetFromEvent = copy.LongitudinalTemporalOffsetFromEvent; + LongitudinalTemporalEventType = copy.LongitudinalTemporalEventType; + ConsentForClinicalTrialUseSequence = copy.ConsentForClinicalTrialUseSequence; + Modality = copy.Modality; + SeriesInstanceUID = copy.SeriesInstanceUID; + SeriesNumber = copy.SeriesNumber; + SeriesDate = copy.SeriesDate; + SeriesTime = copy.SeriesTime; + SeriesDescription = copy.SeriesDescription; + SeriesDescriptionCodeSequence = copy.SeriesDescriptionCodeSequence; + OperatorsName = copy.OperatorsName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + ReferencedPerformedProcedureStepSequence = copy.ReferencedPerformedProcedureStepSequence; + RequestAttributesSequence = copy.RequestAttributesSequence; + PerformedProcedureStepID = copy.PerformedProcedureStepID; + PerformedProcedureStepStartDate = copy.PerformedProcedureStepStartDate; + PerformedProcedureStepStartTime = copy.PerformedProcedureStepStartTime; + PerformedProcedureStepEndDate = copy.PerformedProcedureStepEndDate; + PerformedProcedureStepEndTime = copy.PerformedProcedureStepEndTime; + PerformedProcedureStepDescription = copy.PerformedProcedureStepDescription; + PerformedProtocolCodeSequence = copy.PerformedProtocolCodeSequence; + CommentsOnThePerformedProcedureStep = copy.CommentsOnThePerformedProcedureStep; + ClinicalTrialCoordinatingCenterName = copy.ClinicalTrialCoordinatingCenterName; + ClinicalTrialSeriesID = copy.ClinicalTrialSeriesID; + ClinicalTrialSeriesDescription = copy.ClinicalTrialSeriesDescription; + Manufacturer = copy.Manufacturer; + InstitutionName = copy.InstitutionName; + InstitutionAddress = copy.InstitutionAddress; + StationName = copy.StationName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + ManufacturerModelName = copy.ManufacturerModelName; + DeviceSerialNumber = copy.DeviceSerialNumber; + SoftwareVersions = copy.SoftwareVersions; + GantryID = copy.GantryID; + UDISequence = copy.UDISequence; + SpatialResolution = copy.SpatialResolution; + DateOfLastCalibration = copy.DateOfLastCalibration; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + PixelPaddingValue = copy.PixelPaddingValue; + FrameOfReferenceUID = copy.FrameOfReferenceUID; + PositionReferenceIndicator = copy.PositionReferenceIndicator; + StructureSetLabel = copy.StructureSetLabel; + StructureSetName = copy.StructureSetName; + StructureSetDescription = copy.StructureSetDescription; + InstanceNumber = copy.InstanceNumber; + StructureSetDate = copy.StructureSetDate; + StructureSetTime = copy.StructureSetTime; + ReferencedFrameOfReferenceSequence = copy.ReferencedFrameOfReferenceSequence; + StructureSetROISequence = copy.StructureSetROISequence; + PredecessorStructureSetSequence = copy.PredecessorStructureSetSequence; + ROIContourSequence = copy.ROIContourSequence; + RTROIObservationsSequence = copy.RTROIObservationsSequence; + ApprovalStatus = copy.ApprovalStatus; + ReviewDate = copy.ReviewDate; + ReviewTime = copy.ReviewTime; + ReviewerName = copy.ReviewerName; + ReferencedImageSequence = copy.ReferencedImageSequence; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + DerivationDescription = copy.DerivationDescription; + DerivationCodeSequence = copy.DerivationCodeSequence; + SourceImageSequence = copy.SourceImageSequence; + SourceInstanceSequence = copy.SourceInstanceSequence; + SOPClassUID = copy.SOPClassUID; + SOPInstanceUID = copy.SOPInstanceUID; + SpecificCharacterSet = copy.SpecificCharacterSet; + InstanceCreationDate = copy.InstanceCreationDate; + InstanceCreationTime = copy.InstanceCreationTime; + InstanceCoercionDateTime = copy.InstanceCoercionDateTime; + InstanceCreatorUID = copy.InstanceCreatorUID; + RelatedGeneralSOPClassUID = copy.RelatedGeneralSOPClassUID; + OriginalSpecializedSOPClassUID = copy.OriginalSpecializedSOPClassUID; + CodingSchemeIdentificationSequence = copy.CodingSchemeIdentificationSequence; + ContextGroupIdentificationSequence = copy.ContextGroupIdentificationSequence; + MappingResourceIdentificationSequence = copy.MappingResourceIdentificationSequence; + TimezoneOffsetFromUTC = copy.TimezoneOffsetFromUTC; + ContributingEquipmentSequence = copy.ContributingEquipmentSequence; + SOPInstanceStatus = copy.SOPInstanceStatus; + SOPAuthorizationDateTime = copy.SOPAuthorizationDateTime; + SOPAuthorizationComment = copy.SOPAuthorizationComment; + AuthorizationEquipmentCertificationNumber = copy.AuthorizationEquipmentCertificationNumber; + MACParametersSequence = copy.MACParametersSequence; + DigitalSignaturesSequence = copy.DigitalSignaturesSequence; + EncryptedAttributesSequence = copy.EncryptedAttributesSequence; + OriginalAttributesSequence = copy.OriginalAttributesSequence; + HL7StructuredDocumentReferenceSequence = copy.HL7StructuredDocumentReferenceSequence; + LongitudinalTemporalInformationModified = copy.LongitudinalTemporalInformationModified; + QueryRetrieveView = copy.QueryRetrieveView; + ConversionSourceAttributesSequence = copy.ConversionSourceAttributesSequence; + ContentQualification = copy.ContentQualification; + PrivateDataElementCharacteristicsSequence = copy.PrivateDataElementCharacteristicsSequence; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudiesContainingOtherReferencedInstancesSequence = copy.StudiesContainingOtherReferencedInstancesSequence; + } + return *this; +} + + +void DRTStructureSetIOD::clear() +{ + /* clear all DICOM attributes */ + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + PatientBirthDate.clear(); + PatientBirthDateInAlternativeCalendar.clear(); + PatientDeathDateInAlternativeCalendar.clear(); + PatientAlternativeCalendar.clear(); + PatientSex.clear(); + ReferencedPatientPhotoSequence.clear(); + QualityControlSubject.clear(); + ReferencedPatientSequence.clear(); + PatientBirthTime.clear(); + OtherPatientIDsSequence.clear(); + OtherPatientNames.clear(); + EthnicGroup.clear(); + PatientComments.clear(); + PatientSpeciesDescription.clear(); + PatientSpeciesCodeSequence.clear(); + PatientBreedDescription.clear(); + PatientBreedCodeSequence.clear(); + BreedRegistrationSequence.clear(); + StrainDescription.clear(); + StrainNomenclature.clear(); + StrainCodeSequence.clear(); + StrainAdditionalInformation.clear(); + StrainStockSequence.clear(); + GeneticModificationsSequence.clear(); + ResponsiblePerson.clear(); + ResponsiblePersonRole.clear(); + ResponsibleOrganization.clear(); + PatientIdentityRemoved.clear(); + DeidentificationMethod.clear(); + DeidentificationMethodCodeSequence.clear(); + SourcePatientGroupIdentificationSequence.clear(); + GroupOfPatientsIdentificationSequence.clear(); + ClinicalTrialSponsorName.clear(); + ClinicalTrialProtocolID.clear(); + ClinicalTrialProtocolName.clear(); + ClinicalTrialSiteID.clear(); + ClinicalTrialSiteName.clear(); + ClinicalTrialSubjectID.clear(); + ClinicalTrialSubjectReadingID.clear(); + ClinicalTrialProtocolEthicsCommitteeName.clear(); + ClinicalTrialProtocolEthicsCommitteeApprovalNumber.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + ReferringPhysicianIdentificationSequence.clear(); + ConsultingPhysicianName.clear(); + ConsultingPhysicianIdentificationSequence.clear(); + StudyID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyDescription.clear(); + PhysiciansOfRecord.clear(); + PhysiciansOfRecordIdentificationSequence.clear(); + NameOfPhysiciansReadingStudy.clear(); + PhysiciansReadingStudyIdentificationSequence.clear(); + RequestingServiceCodeSequence.clear(); + ReferencedStudySequence.clear(); + ProcedureCodeSequence.clear(); + ReasonForPerformedProcedureCodeSequence.clear(); + AdmittingDiagnosesDescription.clear(); + AdmittingDiagnosesCodeSequence.clear(); + PatientAge.clear(); + PatientSize.clear(); + PatientWeight.clear(); + PatientBodyMassIndex.clear(); + MeasuredAPDimension.clear(); + MeasuredLateralDimension.clear(); + PatientSizeCodeSequence.clear(); + MedicalAlerts.clear(); + Allergies.clear(); + SmokingStatus.clear(); + PregnancyStatus.clear(); + LastMenstrualDate.clear(); + PatientState.clear(); + Occupation.clear(); + AdditionalPatientHistory.clear(); + AdmissionID.clear(); + IssuerOfAdmissionIDSequence.clear(); + ServiceEpisodeID.clear(); + IssuerOfServiceEpisodeIDSequence.clear(); + ServiceEpisodeDescription.clear(); + PatientSexNeutered.clear(); + ClinicalTrialTimePointID.clear(); + ClinicalTrialTimePointDescription.clear(); + LongitudinalTemporalOffsetFromEvent.clear(); + LongitudinalTemporalEventType.clear(); + ConsentForClinicalTrialUseSequence.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + SeriesDescriptionCodeSequence.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ReferencedPerformedProcedureStepSequence.clear(); + RequestAttributesSequence.clear(); + PerformedProcedureStepID.clear(); + PerformedProcedureStepStartDate.clear(); + PerformedProcedureStepStartTime.clear(); + PerformedProcedureStepEndDate.clear(); + PerformedProcedureStepEndTime.clear(); + PerformedProcedureStepDescription.clear(); + PerformedProtocolCodeSequence.clear(); + CommentsOnThePerformedProcedureStep.clear(); + ClinicalTrialCoordinatingCenterName.clear(); + ClinicalTrialSeriesID.clear(); + ClinicalTrialSeriesDescription.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + GantryID.clear(); + UDISequence.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + PixelPaddingValue.clear(); + FrameOfReferenceUID.clear(); + PositionReferenceIndicator.clear(); + StructureSetLabel.clear(); + StructureSetName.clear(); + StructureSetDescription.clear(); + InstanceNumber.clear(); + StructureSetDate.clear(); + StructureSetTime.clear(); + ReferencedFrameOfReferenceSequence.clear(); + StructureSetROISequence.clear(); + PredecessorStructureSetSequence.clear(); + ROIContourSequence.clear(); + RTROIObservationsSequence.clear(); + ApprovalStatus.clear(); + ReviewDate.clear(); + ReviewTime.clear(); + ReviewerName.clear(); + ReferencedImageSequence.clear(); + ReferencedInstanceSequence.clear(); + DerivationDescription.clear(); + DerivationCodeSequence.clear(); + SourceImageSequence.clear(); + SourceInstanceSequence.clear(); + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCoercionDateTime.clear(); + InstanceCreatorUID.clear(); + RelatedGeneralSOPClassUID.clear(); + OriginalSpecializedSOPClassUID.clear(); + CodingSchemeIdentificationSequence.clear(); + ContextGroupIdentificationSequence.clear(); + MappingResourceIdentificationSequence.clear(); + TimezoneOffsetFromUTC.clear(); + ContributingEquipmentSequence.clear(); + SOPInstanceStatus.clear(); + SOPAuthorizationDateTime.clear(); + SOPAuthorizationComment.clear(); + AuthorizationEquipmentCertificationNumber.clear(); + MACParametersSequence.clear(); + DigitalSignaturesSequence.clear(); + EncryptedAttributesSequence.clear(); + OriginalAttributesSequence.clear(); + HL7StructuredDocumentReferenceSequence.clear(); + LongitudinalTemporalInformationModified.clear(); + QueryRetrieveView.clear(); + ConversionSourceAttributesSequence.clear(); + ContentQualification.clear(); + PrivateDataElementCharacteristicsSequence.clear(); + ReferencedSeriesSequence.clear(); + StudiesContainingOtherReferencedInstancesSequence.clear(); +} + + +OFBool DRTStructureSetIOD::isValid() +{ + /* tbd: check whether object is valid */ + return OFTrue; +} + + +OFCondition DRTStructureSetIOD::checkDatasetForReading(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* check SOP class UID */ + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + OFString tmpString; + getStringValueFromElement(sopClassUID, tmpString); + if (tmpString != UID_RTStructureSetStorage) + { + DCMRT_ERROR("Invalid value for attribute SOPClassUID (0008,0016)"); + result = RT_EC_InvalidValue; + } + } + return result; +} + + +void DRTStructureSetIOD::updateAttributes() +{ + SOPClassUID.putString(UID_RTStructureSetStorage); +} + + +OFCondition DRTStructureSetIOD::read(DcmItem &dataset) +{ + /* re-initialize object */ + clear(); + /* check SOP class UID first */ + OFCondition result = checkDatasetForReading(dataset); + /* read data from PatientIE, StudyIE, SeriesIE */ + if (result.good()) + result = readSeriesData(dataset); + if (result.good()) + { + // --- GeneralEquipmentModule (M) --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionAddress, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, StationName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionalDepartmentName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, GantryID, "1", "3", "GeneralEquipmentModule"); + UDISequence.read(dataset, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SpatialResolution, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DateOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, TimeOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingValue, "1", "1C", "GeneralEquipmentModule"); + + // --- FrameOfReferenceModule (U) --- + if (dataset.tagExists(DCM_FrameOfReferenceUID) || + dataset.tagExists(DCM_PositionReferenceIndicator)) + { + getAndCheckElementFromDataset(dataset, FrameOfReferenceUID, "1", "1", "FrameOfReferenceModule"); + getAndCheckElementFromDataset(dataset, PositionReferenceIndicator, "1", "2", "FrameOfReferenceModule"); + } + + // --- StructureSetModule (M) --- + getAndCheckElementFromDataset(dataset, StructureSetLabel, "1", "1", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetName, "1", "3", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetDescription, "1", "3", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetDate, "1", "2", "StructureSetModule"); + getAndCheckElementFromDataset(dataset, StructureSetTime, "1", "2", "StructureSetModule"); + ReferencedFrameOfReferenceSequence.read(dataset, "1-n", "3", "StructureSetModule"); + StructureSetROISequence.read(dataset, "1-n", "1", "StructureSetModule"); + PredecessorStructureSetSequence.read(dataset, "1-n", "3", "StructureSetModule"); + + // --- ROIContourModule (M) --- + ROIContourSequence.read(dataset, "1-n", "1", "ROIContourModule"); + + // --- RTROIObservationsModule (M) --- + RTROIObservationsSequence.read(dataset, "1-n", "1", "RTROIObservationsModule"); + + // --- ApprovalModule (U) --- + if (dataset.tagExists(DCM_ApprovalStatus)) + { + getAndCheckElementFromDataset(dataset, ApprovalStatus, "1", "1", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewDate, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewTime, "1", "2C", "ApprovalModule"); + getAndCheckElementFromDataset(dataset, ReviewerName, "1", "2C", "ApprovalModule"); + } + + // --- GeneralReferenceModule (U) --- + ReferencedImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + ReferencedInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + getAndCheckElementFromDataset(dataset, DerivationDescription, "1", "3", "GeneralReferenceModule"); + DerivationCodeSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + + // --- SOPCommonModule (M) --- + getAndCheckElementFromDataset(dataset, SOPClassUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCoercionDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, RelatedGeneralSOPClassUID, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, OriginalSpecializedSOPClassUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + ContextGroupIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + MappingResourceIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + ContributingEquipmentSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceStatus, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationComment, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, AuthorizationEquipmentCertificationNumber, "1", "3", "SOPCommonModule"); + MACParametersSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + DigitalSignaturesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + EncryptedAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + OriginalAttributesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + HL7StructuredDocumentReferenceSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalInformationModified, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, QueryRetrieveView, "1", "1C", "SOPCommonModule"); + ConversionSourceAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, ContentQualification, "1", "3", "SOPCommonModule"); + PrivateDataElementCharacteristicsSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + ReferencedSeriesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + StudiesContainingOtherReferencedInstancesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + } + return result; +} + + +OFCondition DRTStructureSetIOD::readPatientData(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + + // --- PatientModule (M) --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + IssuerOfPatientIDQualifiersSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientDeathDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientAlternativeCalendar, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + ReferencedPatientPhotoSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, QualityControlSubject, "1", "3", "PatientModule"); + ReferencedPatientSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthTime, "1", "3", "PatientModule"); + OtherPatientIDsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, OtherPatientNames, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, EthnicGroup, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientComments, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSpeciesDescription, "1", "1C", "PatientModule"); + PatientSpeciesCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBreedDescription, "1", "2C", "PatientModule"); + PatientBreedCodeSequence.read(dataset, "1-n", "2C", "PatientModule"); + BreedRegistrationSequence.read(dataset, "1-n", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainDescription, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainNomenclature, "1", "3", "PatientModule"); + StrainCodeSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainAdditionalInformation, "1", "3", "PatientModule"); + StrainStockSequence.read(dataset, "1-n", "3", "PatientModule"); + GeneticModificationsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePerson, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePersonRole, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsibleOrganization, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientIdentityRemoved, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, DeidentificationMethod, "1-n", "1C", "PatientModule"); + DeidentificationMethodCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + SourcePatientGroupIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + GroupOfPatientsIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialSponsorName) || + dataset.tagExists(DCM_ClinicalTrialProtocolID) || + dataset.tagExists(DCM_ClinicalTrialProtocolName) || + dataset.tagExists(DCM_ClinicalTrialSiteID) || + dataset.tagExists(DCM_ClinicalTrialSiteName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialSponsorName, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolID, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteID, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectReadingID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeName, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeApprovalNumber, "1", "3", "ClinicalTrialSubjectModule"); + } + return result; +} + + +OFCondition DRTStructureSetIOD::readStudyData(DcmItem &dataset) +{ + /* read data from PatientIE */ + OFCondition result = readPatientData(dataset); + if (result.good()) + { + // --- GeneralStudyModule (M) --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + ReferringPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ConsultingPhysicianName, "1-n", "3", "GeneralStudyModule"); + ConsultingPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + IssuerOfAccessionNumberSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, PhysiciansOfRecord, "1-n", "3", "GeneralStudyModule"); + PhysiciansOfRecordIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, NameOfPhysiciansReadingStudy, "1-n", "3", "GeneralStudyModule"); + PhysiciansReadingStudyIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + RequestingServiceCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReferencedStudySequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReasonForPerformedProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + getAndCheckElementFromDataset(dataset, AdmittingDiagnosesDescription, "1-n", "3", "PatientStudyModule"); + AdmittingDiagnosesCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientAge, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSize, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientWeight, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientBodyMassIndex, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredAPDimension, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredLateralDimension, "1", "3", "PatientStudyModule"); + PatientSizeCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MedicalAlerts, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Allergies, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, SmokingStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PregnancyStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, LastMenstrualDate, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientState, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Occupation, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdditionalPatientHistory, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdmissionID, "1", "3", "PatientStudyModule"); + IssuerOfAdmissionIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeID, "1", "3", "PatientStudyModule"); + IssuerOfServiceEpisodeIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeDescription, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSexNeutered, "1", "2C", "PatientStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialTimePointID)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointID, "1", "2", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointDescription, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalOffsetFromEvent, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalEventType, "1", "1C", "ClinicalTrialStudyModule"); + ConsentForClinicalTrialUseSequence.read(dataset, "1-n", "3", "ClinicalTrialStudyModule"); + } + } + return result; +} + + +OFCondition DRTStructureSetIOD::readSeriesData(DcmItem &dataset) +{ + /* read data from PatientIE, StudyIE */ + OFCondition result = readStudyData(dataset); + if (result.good()) + { + // --- RTSeriesModule (M) --- + getAndCheckElementFromDataset(dataset, Modality, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "2", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "RTSeriesModule"); + SeriesDescriptionCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, OperatorsName, "1-n", "2", "RTSeriesModule"); + OperatorIdentificationSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + ReferencedPerformedProcedureStepSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + RequestAttributesSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepID, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepDescription, "1", "3", "RTSeriesModule"); + PerformedProtocolCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, CommentsOnThePerformedProcedureStep, "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialCoordinatingCenterName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialCoordinatingCenterName, "1", "2", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesID, "1", "3", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesDescription, "1", "3", "ClinicalTrialSeriesModule"); + } + } + return result; +} + + +OFCondition DRTStructureSetIOD::write(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* only write valid objects */ + if (isValid()) + { + /* update various DICOM attributes */ + updateAttributes(); + + // --- PatientModule (M) --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBirthDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientDeathDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientAlternativeCalendar), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + if (result.good()) result = ReferencedPatientPhotoSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlSubject), "1", "3", "PatientModule"); + if (result.good()) result = ReferencedPatientSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmTime(PatientBirthTime), "1", "3", "PatientModule"); + if (result.good()) result = OtherPatientIDsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(OtherPatientNames), "1-n", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmShortString(EthnicGroup), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongText(PatientComments), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientSpeciesDescription), "1", "1C", "PatientModule"); + if (result.good()) result = PatientSpeciesCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBreedDescription), "1", "2C", "PatientModule"); + if (result.good()) result = PatientBreedCodeSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + if (result.good()) result = BreedRegistrationSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedCharacters(StrainDescription), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(StrainNomenclature), "1", "3", "PatientModule"); + if (result.good()) result = StrainCodeSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedText(StrainAdditionalInformation), "1", "3", "PatientModule"); + if (result.good()) result = StrainStockSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GeneticModificationsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(ResponsiblePerson), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(ResponsiblePersonRole), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(ResponsibleOrganization), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientIdentityRemoved), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(DeidentificationMethod), "1-n", "1C", "PatientModule"); + if (result.good()) result = DeidentificationMethodCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + if (result.good()) result = SourcePatientGroupIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GroupOfPatientsIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (isClinicalTrialSubjectModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSponsorName), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolID), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteID), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectReadingID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeName), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeApprovalNumber), "1", "3", "ClinicalTrialSubjectModule"); + } + + // --- GeneralStudyModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + if (result.good()) result = ReferringPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ConsultingPhysicianName), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = ConsultingPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(PhysiciansOfRecord), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansOfRecordIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(NameOfPhysiciansReadingStudy), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansReadingStudyIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = RequestingServiceCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReferencedStudySequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReasonForPerformedProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + if (isPatientStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(AdmittingDiagnosesDescription), "1-n", "3", "PatientStudyModule"); + if (result.good()) result = AdmittingDiagnosesCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmAgeString(PatientAge), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSize), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientWeight), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientBodyMassIndex), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredAPDimension), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredLateralDimension), "1", "3", "PatientStudyModule"); + if (result.good()) result = PatientSizeCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(MedicalAlerts), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(Allergies), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(SmokingStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PregnancyStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDate(LastMenstrualDate), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientState), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(Occupation), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongText(AdditionalPatientHistory), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(AdmissionID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfAdmissionIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfServiceEpisodeIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeDescription), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSexNeutered), "1", "2C", "PatientStudyModule"); + } + + // --- ClinicalTrialStudyModule (U) --- + if (isClinicalTrialStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialTimePointID), "1", "2", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmShortText(ClinicalTrialTimePointDescription), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(LongitudinalTemporalOffsetFromEvent), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalEventType), "1", "1C", "ClinicalTrialStudyModule"); + if (result.good()) result = ConsentForClinicalTrialUseSequence.write(dataset, "1-n" ,"3", "ClinicalTrialStudyModule"); + } + + // --- RTSeriesModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "2", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = SeriesDescriptionCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmPersonName(OperatorsName), "1-n", "2", "RTSeriesModule"); + if (result.good()) result = OperatorIdentificationSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = ReferencedPerformedProcedureStepSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = RequestAttributesSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortString(PerformedProcedureStepID), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepStartDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepStartTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepEndDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepEndTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(PerformedProcedureStepDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = PerformedProtocolCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortText(CommentsOnThePerformedProcedureStep), "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (isClinicalTrialSeriesModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialCoordinatingCenterName), "1", "2", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesID), "1", "3", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesDescription), "1", "3", "ClinicalTrialSeriesModule"); + } + + // --- GeneralEquipmentModule (M) --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortText(InstitutionAddress), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortString(StationName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionalDepartmentName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(GantryID), "1", "3", "GeneralEquipmentModule"); + if (result.good()) result = UDISequence.write(dataset, "1-n" ,"3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SpatialResolution), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDate(DateOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmTime(TimeOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingValue), "1", "1C", "GeneralEquipmentModule"); + + // --- FrameOfReferenceModule (U) --- + if (isFrameOfReferenceModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmUniqueIdentifier(FrameOfReferenceUID), "1", "1", "FrameOfReferenceModule"); + addElementToDataset(result, dataset, new DcmLongString(PositionReferenceIndicator), "1", "2", "FrameOfReferenceModule"); + } + + // --- StructureSetModule (M) --- + addElementToDataset(result, dataset, new DcmShortString(StructureSetLabel), "1", "1", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmLongString(StructureSetName), "1", "3", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmShortText(StructureSetDescription), "1", "3", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmDate(StructureSetDate), "1", "2", "StructureSetModule"); + addElementToDataset(result, dataset, new DcmTime(StructureSetTime), "1", "2", "StructureSetModule"); + if (result.good()) result = ReferencedFrameOfReferenceSequence.write(dataset, "1-n" ,"3", "StructureSetModule"); + if (result.good()) result = StructureSetROISequence.write(dataset, "1-n" ,"1", "StructureSetModule"); + if (result.good()) result = PredecessorStructureSetSequence.write(dataset, "1-n" ,"3", "StructureSetModule"); + + // --- ROIContourModule (M) --- + if (result.good()) result = ROIContourSequence.write(dataset, "1-n" ,"1", "ROIContourModule"); + + // --- RTROIObservationsModule (M) --- + if (result.good()) result = RTROIObservationsSequence.write(dataset, "1-n" ,"1", "RTROIObservationsModule"); + + // --- ApprovalModule (U) --- + if (isApprovalModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmCodeString(ApprovalStatus), "1", "1", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmDate(ReviewDate), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmTime(ReviewTime), "1", "2C", "ApprovalModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReviewerName), "1", "2C", "ApprovalModule"); + } + + // --- GeneralReferenceModule (U) --- + if (isGeneralReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = ReferencedInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + addElementToDataset(result, dataset, new DcmShortText(DerivationDescription), "1", "3", "GeneralReferenceModule"); + if (result.good()) result = DerivationCodeSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + } + + // --- SOPCommonModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(InstanceCoercionDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(RelatedGeneralSOPClassUID), "1-n", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(OriginalSpecializedSOPClassUID), "1", "3", "SOPCommonModule"); + if (result.good()) result = CodingSchemeIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = ContextGroupIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = MappingResourceIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + if (result.good()) result = ContributingEquipmentSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SOPInstanceStatus), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(SOPAuthorizationDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongText(SOPAuthorizationComment), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongString(AuthorizationEquipmentCertificationNumber), "1", "3", "SOPCommonModule"); + if (result.good()) result = MACParametersSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = DigitalSignaturesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = EncryptedAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + if (result.good()) result = OriginalAttributesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = HL7StructuredDocumentReferenceSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalInformationModified), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(QueryRetrieveView), "1", "1C", "SOPCommonModule"); + if (result.good()) result = ConversionSourceAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContentQualification), "1", "3", "SOPCommonModule"); + if (result.good()) result = PrivateDataElementCharacteristicsSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + if (isCommonInstanceReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedSeriesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + if (result.good()) result = StudiesContainingOtherReferencedInstancesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + } + } else + result = RT_EC_InvalidObject; + return result; +} + + +OFBool DRTStructureSetIOD::isClinicalTrialSubjectModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ClinicalTrialSponsorName.isEmpty() && + !ClinicalTrialProtocolID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ClinicalTrialSponsorName.isEmpty() || + !ClinicalTrialProtocolID.isEmpty() || + !ClinicalTrialProtocolName.isEmpty() || + !ClinicalTrialSiteID.isEmpty() || + !ClinicalTrialSiteName.isEmpty() || + !ClinicalTrialSubjectID.isEmpty() || + !ClinicalTrialSubjectReadingID.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeName.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeApprovalNumber.isEmpty(); + } +} + + +OFBool DRTStructureSetIOD::isPatientStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !AdmittingDiagnosesDescription.isEmpty() || + !AdmittingDiagnosesCodeSequence.isEmpty() || + !PatientAge.isEmpty() || + !PatientSize.isEmpty() || + !PatientWeight.isEmpty() || + !PatientBodyMassIndex.isEmpty() || + !MeasuredAPDimension.isEmpty() || + !MeasuredLateralDimension.isEmpty() || + !PatientSizeCodeSequence.isEmpty() || + !MedicalAlerts.isEmpty() || + !Allergies.isEmpty() || + !SmokingStatus.isEmpty() || + !PregnancyStatus.isEmpty() || + !LastMenstrualDate.isEmpty() || + !PatientState.isEmpty() || + !Occupation.isEmpty() || + !AdditionalPatientHistory.isEmpty() || + !AdmissionID.isEmpty() || + !IssuerOfAdmissionIDSequence.isEmpty() || + !ServiceEpisodeID.isEmpty() || + !IssuerOfServiceEpisodeIDSequence.isEmpty() || + !ServiceEpisodeDescription.isEmpty() || + !PatientSexNeutered.isEmpty(); +} + + +OFBool DRTStructureSetIOD::isClinicalTrialStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialTimePointID.isEmpty() || + !ClinicalTrialTimePointDescription.isEmpty() || + !LongitudinalTemporalOffsetFromEvent.isEmpty() || + !LongitudinalTemporalEventType.isEmpty() || + !ConsentForClinicalTrialUseSequence.isEmpty(); +} + + +OFBool DRTStructureSetIOD::isClinicalTrialSeriesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialCoordinatingCenterName.isEmpty() || + !ClinicalTrialSeriesID.isEmpty() || + !ClinicalTrialSeriesDescription.isEmpty(); +} + + +OFBool DRTStructureSetIOD::isFrameOfReferenceModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !FrameOfReferenceUID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !FrameOfReferenceUID.isEmpty() || + !PositionReferenceIndicator.isEmpty(); + } +} + + +OFBool DRTStructureSetIOD::isApprovalModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ApprovalStatus.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ApprovalStatus.isEmpty() || + !ReviewDate.isEmpty() || + !ReviewTime.isEmpty() || + !ReviewerName.isEmpty(); + } +} + + +OFBool DRTStructureSetIOD::isGeneralReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedImageSequence.isEmpty() || + !ReferencedInstanceSequence.isEmpty() || + !DerivationDescription.isEmpty() || + !DerivationCodeSequence.isEmpty() || + !SourceImageSequence.isEmpty() || + !SourceInstanceSequence.isEmpty(); +} + + +OFBool DRTStructureSetIOD::isCommonInstanceReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedSeriesSequence.isEmpty() || + !StudiesContainingOtherReferencedInstancesSequence.isEmpty(); +} + + +OFCondition DRTStructureSetIOD::getAccessionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTStructureSetIOD::getAdditionalPatientHistory(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdditionalPatientHistory, value, pos); +} + + +OFCondition DRTStructureSetIOD::getAdmissionID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmissionID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getAdmittingDiagnosesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmittingDiagnosesDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getAllergies(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Allergies, value, pos); +} + + +OFCondition DRTStructureSetIOD::getApprovalStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ApprovalStatus, value, pos); +} + + +OFCondition DRTStructureSetIOD::getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AuthorizationEquipmentCertificationNumber, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialCoordinatingCenterName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeApprovalNumber, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialProtocolName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialSeriesID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialSiteID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialSiteName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialSponsorName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSponsorName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialSubjectID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialSubjectReadingID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectReadingID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialTimePointDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getClinicalTrialTimePointID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CommentsOnThePerformedProcedureStep, value, pos); +} + + +OFCondition DRTStructureSetIOD::getConsultingPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConsultingPhysicianName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getContentQualification(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentQualification, value, pos); +} + + +OFCondition DRTStructureSetIOD::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTStructureSetIOD::getDeidentificationMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeidentificationMethod, value, pos); +} + + +OFCondition DRTStructureSetIOD::getDerivationDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DerivationDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTStructureSetIOD::getEthnicGroup(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EthnicGroup, value, pos); +} + + +OFCondition DRTStructureSetIOD::getFrameOfReferenceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FrameOfReferenceUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getGantryID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstanceCoercionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCoercionDateTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstanceCreationDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstanceCreationTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstanceCreatorUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstanceNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstanceNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, InstanceNumber).getSint32(value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstitutionAddress(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstitutionName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getLastMenstrualDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LastMenstrualDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getLongitudinalTemporalEventType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalEventType, value, pos); +} + + +OFCondition DRTStructureSetIOD::getLongitudinalTemporalInformationModified(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalInformationModified, value, pos); +} + + +OFCondition DRTStructureSetIOD::getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, LongitudinalTemporalOffsetFromEvent).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::getManufacturer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTStructureSetIOD::getManufacturerModelName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getMeasuredAPDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredAPDimension, value, pos); +} + + +OFCondition DRTStructureSetIOD::getMeasuredAPDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredAPDimension).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::getMeasuredLateralDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredLateralDimension, value, pos); +} + + +OFCondition DRTStructureSetIOD::getMeasuredLateralDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredLateralDimension).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::getMedicalAlerts(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MedicalAlerts, value, pos); +} + + +OFCondition DRTStructureSetIOD::getModality(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DRTStructureSetIOD::getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NameOfPhysiciansReadingStudy, value, pos); +} + + +OFCondition DRTStructureSetIOD::getOccupation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Occupation, value, pos); +} + + +OFCondition DRTStructureSetIOD::getOperatorsName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OriginalSpecializedSOPClassUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getOtherPatientNames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OtherPatientNames, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientAge(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAge, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAlternativeCalendar, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientBirthDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientBirthTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientBodyMassIndex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBodyMassIndex, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientBodyMassIndex(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientBodyMassIndex).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientBreedDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBreedDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientComments, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientDeathDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientIdentityRemoved(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientIdentityRemoved, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientSex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientSexNeutered(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSexNeutered, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientSize(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSize, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientSize(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSize).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientSpeciesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSpeciesDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientState(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientState, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientWeight, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPatientWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientWeight).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::getPerformedProcedureStepDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPerformedProcedureStepEndDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPerformedProcedureStepEndTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPerformedProcedureStepID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPerformedProcedureStepStartDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPerformedProcedureStepStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPhysiciansOfRecord(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhysiciansOfRecord, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPixelPaddingValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingValue).getUint16(value, pos); +} + + +OFCondition DRTStructureSetIOD::getPositionReferenceIndicator(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PositionReferenceIndicator, value, pos); +} + + +OFCondition DRTStructureSetIOD::getPregnancyStatus(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PregnancyStatus).getUint16(value, pos); +} + + +OFCondition DRTStructureSetIOD::getQualityControlSubject(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlSubject, value, pos); +} + + +OFCondition DRTStructureSetIOD::getQueryRetrieveView(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QueryRetrieveView, value, pos); +} + + +OFCondition DRTStructureSetIOD::getReferringPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getRelatedGeneralSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RelatedGeneralSOPClassUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getResponsibleOrganization(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsibleOrganization, value, pos); +} + + +OFCondition DRTStructureSetIOD::getResponsiblePerson(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePerson, value, pos); +} + + +OFCondition DRTStructureSetIOD::getResponsiblePersonRole(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePersonRole, value, pos); +} + + +OFCondition DRTStructureSetIOD::getReviewDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getReviewTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getReviewerName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReviewerName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSOPAuthorizationComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationComment, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSOPAuthorizationDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationDateTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSOPInstanceStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceStatus, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSOPInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSeriesDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSeriesNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSeriesNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, SeriesNumber).getSint32(value, pos); +} + + +OFCondition DRTStructureSetIOD::getSeriesTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getServiceEpisodeDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getServiceEpisodeID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSmokingStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SmokingStatus, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSoftwareVersions(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSpatialResolution(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTStructureSetIOD::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::getSpecificCharacterSet(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStationName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStrainAdditionalInformation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainAdditionalInformation, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStrainDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStrainNomenclature(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainNomenclature, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStructureSetDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStructureSetDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStructureSetLabel(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetLabel, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStructureSetName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetName, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStructureSetTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StructureSetTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStudyDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStudyDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStudyID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTStructureSetIOD::getStudyTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DRTStructureSetIOD::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTStructureSetIOD::getTimezoneOffsetFromUTC(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DRTStructureSetIOD::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setAdditionalPatientHistory(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = AdditionalPatientHistory.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setAdmissionID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AdmissionID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setAdmittingDiagnosesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AdmittingDiagnosesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setAllergies(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = Allergies.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setApprovalStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ApprovalStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AuthorizationEquipmentCertificationNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialCoordinatingCenterName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeApprovalNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialProtocolName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialSeriesID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialSiteID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialSiteName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialSponsorName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSponsorName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialSubjectID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectReadingID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialTimePointDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setClinicalTrialTimePointID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CommentsOnThePerformedProcedureStep.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setConsultingPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ConsultingPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setContentQualification(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentQualification.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setDeidentificationMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DeidentificationMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setDerivationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = DerivationDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setEthnicGroup(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EthnicGroup.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setFrameOfReferenceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FrameOfReferenceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setGantryID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstanceCoercionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCoercionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstanceCreationDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstanceCreationTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstanceCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreatorUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstanceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setLastMenstrualDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LastMenstrualDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setLongitudinalTemporalEventType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalEventType.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalInformationModified.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos) +{ + return LongitudinalTemporalOffsetFromEvent.putFloat64(value, pos); +} + + +OFCondition DRTStructureSetIOD::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setMeasuredAPDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredAPDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setMeasuredLateralDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredLateralDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setMedicalAlerts(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = MedicalAlerts.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setModality(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Modality.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NameOfPhysiciansReadingStudy.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setOccupation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Occupation.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OriginalSpecializedSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setOtherPatientNames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OtherPatientNames.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientAge(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAge.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientBirthDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientBirthTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientBodyMassIndex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBodyMassIndex.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientBreedDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBreedDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PatientComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientDeathDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientIdentityRemoved(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientIdentityRemoved.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientSex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientSexNeutered(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSexNeutered.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientSize(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSize.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientSpeciesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSpeciesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientState(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientState.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPatientWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPerformedProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPerformedProcedureStepEndDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPerformedProcedureStepEndTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPerformedProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPerformedProcedureStepStartDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPerformedProcedureStepStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPhysiciansOfRecord(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PhysiciansOfRecord.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPixelPaddingValue(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingValue.putUint16(value, pos); +} + + +OFCondition DRTStructureSetIOD::setPositionReferenceIndicator(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PositionReferenceIndicator.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setPregnancyStatus(const Uint16 value, const unsigned long pos) +{ + return PregnancyStatus.putUint16(value, pos); +} + + +OFCondition DRTStructureSetIOD::setQualityControlSubject(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlSubject.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setQueryRetrieveView(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QueryRetrieveView.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setReferringPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RelatedGeneralSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsibleOrganization.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setResponsiblePerson(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePerson.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setResponsiblePersonRole(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePersonRole.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setReviewDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setReviewTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setReviewerName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReviewerName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSOPAuthorizationComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SOPAuthorizationComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSOPAuthorizationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPAuthorizationDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSOPInstanceStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSeriesDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSeriesNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSeriesTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setServiceEpisodeDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setServiceEpisodeID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSmokingStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SmokingStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setSpecificCharacterSet(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SpecificCharacterSet.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStrainAdditionalInformation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StrainAdditionalInformation.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStrainDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStrainNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainNomenclature.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStructureSetDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStructureSetDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StructureSetDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStructureSetLabel(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetLabel.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStructureSetName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetName.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStructureSetTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StructureSetTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStudyDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStudyDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStudyID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setStudyTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTStructureSetIOD::setTimezoneOffsetFromUTC(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttms0.cc b/dcmrt/libsrc/drttms0.cc new file mode 100644 index 00000000..3027753e --- /dev/null +++ b/dcmrt/libsrc/drttms0.cc @@ -0,0 +1,718 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drttms0.h" + + +// --- item class --- + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DeviceSerialNumber(DCM_DeviceSerialNumber), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionName(DCM_InstitutionName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + Manufacturer(DCM_Manufacturer), + ManufacturerModelName(DCM_ManufacturerModelName), + TreatmentMachineName(DCM_TreatmentMachineName) +{ +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DeviceSerialNumber(copy.DeviceSerialNumber), + InstitutionAddress(copy.InstitutionAddress), + InstitutionName(copy.InstitutionName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + Manufacturer(copy.Manufacturer), + ManufacturerModelName(copy.ManufacturerModelName), + TreatmentMachineName(copy.TreatmentMachineName) +{ +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::~Item() +{ +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DeviceSerialNumber = copy.DeviceSerialNumber; + InstitutionAddress = copy.InstitutionAddress; + InstitutionName = copy.InstitutionName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + Manufacturer = copy.Manufacturer; + ManufacturerModelName = copy.ManufacturerModelName; + TreatmentMachineName = copy.TreatmentMachineName; + } + return *this; +} + + +void DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + TreatmentMachineName.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + } +} + + +OFBool DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::isEmpty() +{ + return TreatmentMachineName.isEmpty() && + Manufacturer.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionalDepartmentName.isEmpty() && + ManufacturerModelName.isEmpty() && + DeviceSerialNumber.isEmpty(); +} + + +OFBool DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, TreatmentMachineName, "1", "2", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, Manufacturer, "1", "2", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "2", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, InstitutionalDepartmentName, "1", "3", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, ManufacturerModelName, "1", "2", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, DeviceSerialNumber, "1", "2", "TreatmentMachineSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(TreatmentMachineName), "1", "2", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(Manufacturer), "1", "2", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "2", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionalDepartmentName), "1", "3", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(ManufacturerModelName), "1", "2", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceSerialNumber), "1", "2", "TreatmentMachineSequence"); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::getManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::getManufacturerModelName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::getTreatmentMachineName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentMachineName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item::setTreatmentMachineName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentMachineName.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule(const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::operator=(const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::~DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule() +{ + clear(); +} + + +void DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::Item &DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_TreatmentMachineSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_TreatmentMachineSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTTreatmentMachineRecordModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_TreatmentMachineSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttms9.cc b/dcmrt/libsrc/drttms9.cc new file mode 100644 index 00000000..1d7aa4f7 --- /dev/null +++ b/dcmrt/libsrc/drttms9.cc @@ -0,0 +1,718 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drttms9.h" + + +// --- item class --- + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DeviceSerialNumber(DCM_DeviceSerialNumber), + InstitutionAddress(DCM_InstitutionAddress), + InstitutionName(DCM_InstitutionName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + Manufacturer(DCM_Manufacturer), + ManufacturerModelName(DCM_ManufacturerModelName), + TreatmentMachineName(DCM_TreatmentMachineName) +{ +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DeviceSerialNumber(copy.DeviceSerialNumber), + InstitutionAddress(copy.InstitutionAddress), + InstitutionName(copy.InstitutionName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + Manufacturer(copy.Manufacturer), + ManufacturerModelName(copy.ManufacturerModelName), + TreatmentMachineName(copy.TreatmentMachineName) +{ +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::~Item() +{ +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DeviceSerialNumber = copy.DeviceSerialNumber; + InstitutionAddress = copy.InstitutionAddress; + InstitutionName = copy.InstitutionName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + Manufacturer = copy.Manufacturer; + ManufacturerModelName = copy.ManufacturerModelName; + TreatmentMachineName = copy.TreatmentMachineName; + } + return *this; +} + + +void DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + TreatmentMachineName.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + } +} + + +OFBool DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::isEmpty() +{ + return TreatmentMachineName.isEmpty() && + Manufacturer.isEmpty() && + InstitutionName.isEmpty() && + InstitutionAddress.isEmpty() && + InstitutionalDepartmentName.isEmpty() && + ManufacturerModelName.isEmpty() && + DeviceSerialNumber.isEmpty(); +} + + +OFBool DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, TreatmentMachineName, "1", "2", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, Manufacturer, "1", "3", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, InstitutionName, "1", "3", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, InstitutionAddress, "1", "3", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, InstitutionalDepartmentName, "1", "3", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, ManufacturerModelName, "1", "3", "TreatmentMachineSequence"); + getAndCheckElementFromDataset(item, DeviceSerialNumber, "1", "3", "TreatmentMachineSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmShortString(TreatmentMachineName), "1", "2", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(Manufacturer), "1", "3", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionName), "1", "3", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmShortText(InstitutionAddress), "1", "3", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(InstitutionalDepartmentName), "1", "3", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(ManufacturerModelName), "1", "3", "TreatmentMachineSequence"); + addElementToDataset(result, item, new DcmLongString(DeviceSerialNumber), "1", "3", "TreatmentMachineSequence"); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::getInstitutionAddress(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::getInstitutionName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::getManufacturer(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::getManufacturerModelName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::getTreatmentMachineName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentMachineName, value, pos); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item::setTreatmentMachineName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentMachineName.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule(const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::operator=(const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::~DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule() +{ + clear(); +} + + +void DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::Item &DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_TreatmentMachineSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_TreatmentMachineSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTTreatmentMachineSequenceInRTBrachyApplicationSetupsModule::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_TreatmentMachineSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttreat.cc b/dcmrt/libsrc/drttreat.cc new file mode 100644 index 00000000..08cbad19 --- /dev/null +++ b/dcmrt/libsrc/drttreat.cc @@ -0,0 +1,3212 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTTreatmentSummaryRecordIOD + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/drttreat.h" + + +DRTTreatmentSummaryRecordIOD::DRTTreatmentSummaryRecordIOD() + : PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(), + PatientBirthDate(DCM_PatientBirthDate), + PatientBirthDateInAlternativeCalendar(DCM_PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(DCM_PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(DCM_PatientAlternativeCalendar), + PatientSex(DCM_PatientSex), + ReferencedPatientPhotoSequence(), + QualityControlSubject(DCM_QualityControlSubject), + ReferencedPatientSequence(), + PatientBirthTime(DCM_PatientBirthTime), + OtherPatientIDsSequence(), + OtherPatientNames(DCM_OtherPatientNames), + EthnicGroup(DCM_EthnicGroup), + PatientComments(DCM_PatientComments), + PatientSpeciesDescription(DCM_PatientSpeciesDescription), + PatientSpeciesCodeSequence(), + PatientBreedDescription(DCM_PatientBreedDescription), + PatientBreedCodeSequence(), + BreedRegistrationSequence(), + StrainDescription(DCM_StrainDescription), + StrainNomenclature(DCM_StrainNomenclature), + StrainCodeSequence(), + StrainAdditionalInformation(DCM_StrainAdditionalInformation), + StrainStockSequence(), + GeneticModificationsSequence(), + ResponsiblePerson(DCM_ResponsiblePerson), + ResponsiblePersonRole(DCM_ResponsiblePersonRole), + ResponsibleOrganization(DCM_ResponsibleOrganization), + PatientIdentityRemoved(DCM_PatientIdentityRemoved), + DeidentificationMethod(DCM_DeidentificationMethod), + DeidentificationMethodCodeSequence(), + SourcePatientGroupIdentificationSequence(), + GroupOfPatientsIdentificationSequence(), + ClinicalTrialSponsorName(DCM_ClinicalTrialSponsorName), + ClinicalTrialProtocolID(DCM_ClinicalTrialProtocolID), + ClinicalTrialProtocolName(DCM_ClinicalTrialProtocolName), + ClinicalTrialSiteID(DCM_ClinicalTrialSiteID), + ClinicalTrialSiteName(DCM_ClinicalTrialSiteName), + ClinicalTrialSubjectID(DCM_ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(DCM_ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(DCM_ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(DCM_ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(), + ConsultingPhysicianName(DCM_ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + IssuerOfAccessionNumberSequence(), + StudyDescription(DCM_StudyDescription), + PhysiciansOfRecord(DCM_PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(), + NameOfPhysiciansReadingStudy(DCM_NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(), + RequestingServiceCodeSequence(), + ReferencedStudySequence(), + ProcedureCodeSequence(), + ReasonForPerformedProcedureCodeSequence(), + AdmittingDiagnosesDescription(DCM_AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(), + PatientAge(DCM_PatientAge), + PatientSize(DCM_PatientSize), + PatientWeight(DCM_PatientWeight), + PatientBodyMassIndex(DCM_PatientBodyMassIndex), + MeasuredAPDimension(DCM_MeasuredAPDimension), + MeasuredLateralDimension(DCM_MeasuredLateralDimension), + PatientSizeCodeSequence(), + MedicalAlerts(DCM_MedicalAlerts), + Allergies(DCM_Allergies), + SmokingStatus(DCM_SmokingStatus), + PregnancyStatus(DCM_PregnancyStatus), + LastMenstrualDate(DCM_LastMenstrualDate), + PatientState(DCM_PatientState), + Occupation(DCM_Occupation), + AdditionalPatientHistory(DCM_AdditionalPatientHistory), + AdmissionID(DCM_AdmissionID), + IssuerOfAdmissionIDSequence(), + ServiceEpisodeID(DCM_ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(), + ServiceEpisodeDescription(DCM_ServiceEpisodeDescription), + PatientSexNeutered(DCM_PatientSexNeutered), + ClinicalTrialTimePointID(DCM_ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(DCM_ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(DCM_LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(DCM_LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + SeriesDescription(DCM_SeriesDescription), + SeriesDescriptionCodeSequence(), + OperatorsName(DCM_OperatorsName), + OperatorIdentificationSequence(), + ReferencedPerformedProcedureStepSequence(), + RequestAttributesSequence(), + PerformedProcedureStepID(DCM_PerformedProcedureStepID), + PerformedProcedureStepStartDate(DCM_PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(DCM_PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(DCM_PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(DCM_PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(DCM_PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(), + CommentsOnThePerformedProcedureStep(DCM_CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(DCM_ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(DCM_ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(DCM_ClinicalTrialSeriesDescription), + Manufacturer(DCM_Manufacturer), + InstitutionName(DCM_InstitutionName), + InstitutionAddress(DCM_InstitutionAddress), + StationName(DCM_StationName), + InstitutionalDepartmentName(DCM_InstitutionalDepartmentName), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + GantryID(DCM_GantryID), + UDISequence(), + SpatialResolution(DCM_SpatialResolution), + DateOfLastCalibration(DCM_DateOfLastCalibration), + TimeOfLastCalibration(DCM_TimeOfLastCalibration), + PixelPaddingValue(DCM_PixelPaddingValue), + InstanceNumber(DCM_InstanceNumber), + TreatmentDate(DCM_TreatmentDate), + TreatmentTime(DCM_TreatmentTime), + ReferencedRTPlanSequence(), + ReferencedTreatmentRecordSequence(), + CurrentTreatmentStatus(DCM_CurrentTreatmentStatus), + TreatmentStatusComment(DCM_TreatmentStatusComment), + FirstTreatmentDate(DCM_FirstTreatmentDate), + MostRecentTreatmentDate(DCM_MostRecentTreatmentDate), + FractionGroupSummarySequence(), + TreatmentSummaryMeasuredDoseReferenceSequence(), + TreatmentSummaryCalculatedDoseReferenceSequence(), + ReferencedImageSequence(), + ReferencedInstanceSequence(), + DerivationDescription(DCM_DerivationDescription), + DerivationCodeSequence(), + SourceImageSequence(), + SourceInstanceSequence(), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCoercionDateTime(DCM_InstanceCoercionDateTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + RelatedGeneralSOPClassUID(DCM_RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(DCM_OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(), + ContextGroupIdentificationSequence(), + MappingResourceIdentificationSequence(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + ContributingEquipmentSequence(), + SOPInstanceStatus(DCM_SOPInstanceStatus), + SOPAuthorizationDateTime(DCM_SOPAuthorizationDateTime), + SOPAuthorizationComment(DCM_SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(DCM_AuthorizationEquipmentCertificationNumber), + MACParametersSequence(), + DigitalSignaturesSequence(), + EncryptedAttributesSequence(), + OriginalAttributesSequence(), + HL7StructuredDocumentReferenceSequence(), + LongitudinalTemporalInformationModified(DCM_LongitudinalTemporalInformationModified), + QueryRetrieveView(DCM_QueryRetrieveView), + ConversionSourceAttributesSequence(), + ContentQualification(DCM_ContentQualification), + PrivateDataElementCharacteristicsSequence(), + ReferencedSeriesSequence(), + StudiesContainingOtherReferencedInstancesSequence() +{ + /* set initial values for a new SOP instance */ + updateAttributes(); +} + + +DRTTreatmentSummaryRecordIOD::DRTTreatmentSummaryRecordIOD(const DRTTreatmentSummaryRecordIOD ©) + : PatientName(copy.PatientName), + PatientID(copy.PatientID), + IssuerOfPatientID(copy.IssuerOfPatientID), + IssuerOfPatientIDQualifiersSequence(copy.IssuerOfPatientIDQualifiersSequence), + PatientBirthDate(copy.PatientBirthDate), + PatientBirthDateInAlternativeCalendar(copy.PatientBirthDateInAlternativeCalendar), + PatientDeathDateInAlternativeCalendar(copy.PatientDeathDateInAlternativeCalendar), + PatientAlternativeCalendar(copy.PatientAlternativeCalendar), + PatientSex(copy.PatientSex), + ReferencedPatientPhotoSequence(copy.ReferencedPatientPhotoSequence), + QualityControlSubject(copy.QualityControlSubject), + ReferencedPatientSequence(copy.ReferencedPatientSequence), + PatientBirthTime(copy.PatientBirthTime), + OtherPatientIDsSequence(copy.OtherPatientIDsSequence), + OtherPatientNames(copy.OtherPatientNames), + EthnicGroup(copy.EthnicGroup), + PatientComments(copy.PatientComments), + PatientSpeciesDescription(copy.PatientSpeciesDescription), + PatientSpeciesCodeSequence(copy.PatientSpeciesCodeSequence), + PatientBreedDescription(copy.PatientBreedDescription), + PatientBreedCodeSequence(copy.PatientBreedCodeSequence), + BreedRegistrationSequence(copy.BreedRegistrationSequence), + StrainDescription(copy.StrainDescription), + StrainNomenclature(copy.StrainNomenclature), + StrainCodeSequence(copy.StrainCodeSequence), + StrainAdditionalInformation(copy.StrainAdditionalInformation), + StrainStockSequence(copy.StrainStockSequence), + GeneticModificationsSequence(copy.GeneticModificationsSequence), + ResponsiblePerson(copy.ResponsiblePerson), + ResponsiblePersonRole(copy.ResponsiblePersonRole), + ResponsibleOrganization(copy.ResponsibleOrganization), + PatientIdentityRemoved(copy.PatientIdentityRemoved), + DeidentificationMethod(copy.DeidentificationMethod), + DeidentificationMethodCodeSequence(copy.DeidentificationMethodCodeSequence), + SourcePatientGroupIdentificationSequence(copy.SourcePatientGroupIdentificationSequence), + GroupOfPatientsIdentificationSequence(copy.GroupOfPatientsIdentificationSequence), + ClinicalTrialSponsorName(copy.ClinicalTrialSponsorName), + ClinicalTrialProtocolID(copy.ClinicalTrialProtocolID), + ClinicalTrialProtocolName(copy.ClinicalTrialProtocolName), + ClinicalTrialSiteID(copy.ClinicalTrialSiteID), + ClinicalTrialSiteName(copy.ClinicalTrialSiteName), + ClinicalTrialSubjectID(copy.ClinicalTrialSubjectID), + ClinicalTrialSubjectReadingID(copy.ClinicalTrialSubjectReadingID), + ClinicalTrialProtocolEthicsCommitteeName(copy.ClinicalTrialProtocolEthicsCommitteeName), + ClinicalTrialProtocolEthicsCommitteeApprovalNumber(copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber), + StudyInstanceUID(copy.StudyInstanceUID), + StudyDate(copy.StudyDate), + StudyTime(copy.StudyTime), + ReferringPhysicianName(copy.ReferringPhysicianName), + ReferringPhysicianIdentificationSequence(copy.ReferringPhysicianIdentificationSequence), + ConsultingPhysicianName(copy.ConsultingPhysicianName), + ConsultingPhysicianIdentificationSequence(copy.ConsultingPhysicianIdentificationSequence), + StudyID(copy.StudyID), + AccessionNumber(copy.AccessionNumber), + IssuerOfAccessionNumberSequence(copy.IssuerOfAccessionNumberSequence), + StudyDescription(copy.StudyDescription), + PhysiciansOfRecord(copy.PhysiciansOfRecord), + PhysiciansOfRecordIdentificationSequence(copy.PhysiciansOfRecordIdentificationSequence), + NameOfPhysiciansReadingStudy(copy.NameOfPhysiciansReadingStudy), + PhysiciansReadingStudyIdentificationSequence(copy.PhysiciansReadingStudyIdentificationSequence), + RequestingServiceCodeSequence(copy.RequestingServiceCodeSequence), + ReferencedStudySequence(copy.ReferencedStudySequence), + ProcedureCodeSequence(copy.ProcedureCodeSequence), + ReasonForPerformedProcedureCodeSequence(copy.ReasonForPerformedProcedureCodeSequence), + AdmittingDiagnosesDescription(copy.AdmittingDiagnosesDescription), + AdmittingDiagnosesCodeSequence(copy.AdmittingDiagnosesCodeSequence), + PatientAge(copy.PatientAge), + PatientSize(copy.PatientSize), + PatientWeight(copy.PatientWeight), + PatientBodyMassIndex(copy.PatientBodyMassIndex), + MeasuredAPDimension(copy.MeasuredAPDimension), + MeasuredLateralDimension(copy.MeasuredLateralDimension), + PatientSizeCodeSequence(copy.PatientSizeCodeSequence), + MedicalAlerts(copy.MedicalAlerts), + Allergies(copy.Allergies), + SmokingStatus(copy.SmokingStatus), + PregnancyStatus(copy.PregnancyStatus), + LastMenstrualDate(copy.LastMenstrualDate), + PatientState(copy.PatientState), + Occupation(copy.Occupation), + AdditionalPatientHistory(copy.AdditionalPatientHistory), + AdmissionID(copy.AdmissionID), + IssuerOfAdmissionIDSequence(copy.IssuerOfAdmissionIDSequence), + ServiceEpisodeID(copy.ServiceEpisodeID), + IssuerOfServiceEpisodeIDSequence(copy.IssuerOfServiceEpisodeIDSequence), + ServiceEpisodeDescription(copy.ServiceEpisodeDescription), + PatientSexNeutered(copy.PatientSexNeutered), + ClinicalTrialTimePointID(copy.ClinicalTrialTimePointID), + ClinicalTrialTimePointDescription(copy.ClinicalTrialTimePointDescription), + LongitudinalTemporalOffsetFromEvent(copy.LongitudinalTemporalOffsetFromEvent), + LongitudinalTemporalEventType(copy.LongitudinalTemporalEventType), + ConsentForClinicalTrialUseSequence(copy.ConsentForClinicalTrialUseSequence), + Modality(copy.Modality), + SeriesInstanceUID(copy.SeriesInstanceUID), + SeriesNumber(copy.SeriesNumber), + SeriesDate(copy.SeriesDate), + SeriesTime(copy.SeriesTime), + SeriesDescription(copy.SeriesDescription), + SeriesDescriptionCodeSequence(copy.SeriesDescriptionCodeSequence), + OperatorsName(copy.OperatorsName), + OperatorIdentificationSequence(copy.OperatorIdentificationSequence), + ReferencedPerformedProcedureStepSequence(copy.ReferencedPerformedProcedureStepSequence), + RequestAttributesSequence(copy.RequestAttributesSequence), + PerformedProcedureStepID(copy.PerformedProcedureStepID), + PerformedProcedureStepStartDate(copy.PerformedProcedureStepStartDate), + PerformedProcedureStepStartTime(copy.PerformedProcedureStepStartTime), + PerformedProcedureStepEndDate(copy.PerformedProcedureStepEndDate), + PerformedProcedureStepEndTime(copy.PerformedProcedureStepEndTime), + PerformedProcedureStepDescription(copy.PerformedProcedureStepDescription), + PerformedProtocolCodeSequence(copy.PerformedProtocolCodeSequence), + CommentsOnThePerformedProcedureStep(copy.CommentsOnThePerformedProcedureStep), + ClinicalTrialCoordinatingCenterName(copy.ClinicalTrialCoordinatingCenterName), + ClinicalTrialSeriesID(copy.ClinicalTrialSeriesID), + ClinicalTrialSeriesDescription(copy.ClinicalTrialSeriesDescription), + Manufacturer(copy.Manufacturer), + InstitutionName(copy.InstitutionName), + InstitutionAddress(copy.InstitutionAddress), + StationName(copy.StationName), + InstitutionalDepartmentName(copy.InstitutionalDepartmentName), + ManufacturerModelName(copy.ManufacturerModelName), + DeviceSerialNumber(copy.DeviceSerialNumber), + SoftwareVersions(copy.SoftwareVersions), + GantryID(copy.GantryID), + UDISequence(copy.UDISequence), + SpatialResolution(copy.SpatialResolution), + DateOfLastCalibration(copy.DateOfLastCalibration), + TimeOfLastCalibration(copy.TimeOfLastCalibration), + PixelPaddingValue(copy.PixelPaddingValue), + InstanceNumber(copy.InstanceNumber), + TreatmentDate(copy.TreatmentDate), + TreatmentTime(copy.TreatmentTime), + ReferencedRTPlanSequence(copy.ReferencedRTPlanSequence), + ReferencedTreatmentRecordSequence(copy.ReferencedTreatmentRecordSequence), + CurrentTreatmentStatus(copy.CurrentTreatmentStatus), + TreatmentStatusComment(copy.TreatmentStatusComment), + FirstTreatmentDate(copy.FirstTreatmentDate), + MostRecentTreatmentDate(copy.MostRecentTreatmentDate), + FractionGroupSummarySequence(copy.FractionGroupSummarySequence), + TreatmentSummaryMeasuredDoseReferenceSequence(copy.TreatmentSummaryMeasuredDoseReferenceSequence), + TreatmentSummaryCalculatedDoseReferenceSequence(copy.TreatmentSummaryCalculatedDoseReferenceSequence), + ReferencedImageSequence(copy.ReferencedImageSequence), + ReferencedInstanceSequence(copy.ReferencedInstanceSequence), + DerivationDescription(copy.DerivationDescription), + DerivationCodeSequence(copy.DerivationCodeSequence), + SourceImageSequence(copy.SourceImageSequence), + SourceInstanceSequence(copy.SourceInstanceSequence), + SOPClassUID(copy.SOPClassUID), + SOPInstanceUID(copy.SOPInstanceUID), + SpecificCharacterSet(copy.SpecificCharacterSet), + InstanceCreationDate(copy.InstanceCreationDate), + InstanceCreationTime(copy.InstanceCreationTime), + InstanceCoercionDateTime(copy.InstanceCoercionDateTime), + InstanceCreatorUID(copy.InstanceCreatorUID), + RelatedGeneralSOPClassUID(copy.RelatedGeneralSOPClassUID), + OriginalSpecializedSOPClassUID(copy.OriginalSpecializedSOPClassUID), + CodingSchemeIdentificationSequence(copy.CodingSchemeIdentificationSequence), + ContextGroupIdentificationSequence(copy.ContextGroupIdentificationSequence), + MappingResourceIdentificationSequence(copy.MappingResourceIdentificationSequence), + TimezoneOffsetFromUTC(copy.TimezoneOffsetFromUTC), + ContributingEquipmentSequence(copy.ContributingEquipmentSequence), + SOPInstanceStatus(copy.SOPInstanceStatus), + SOPAuthorizationDateTime(copy.SOPAuthorizationDateTime), + SOPAuthorizationComment(copy.SOPAuthorizationComment), + AuthorizationEquipmentCertificationNumber(copy.AuthorizationEquipmentCertificationNumber), + MACParametersSequence(copy.MACParametersSequence), + DigitalSignaturesSequence(copy.DigitalSignaturesSequence), + EncryptedAttributesSequence(copy.EncryptedAttributesSequence), + OriginalAttributesSequence(copy.OriginalAttributesSequence), + HL7StructuredDocumentReferenceSequence(copy.HL7StructuredDocumentReferenceSequence), + LongitudinalTemporalInformationModified(copy.LongitudinalTemporalInformationModified), + QueryRetrieveView(copy.QueryRetrieveView), + ConversionSourceAttributesSequence(copy.ConversionSourceAttributesSequence), + ContentQualification(copy.ContentQualification), + PrivateDataElementCharacteristicsSequence(copy.PrivateDataElementCharacteristicsSequence), + ReferencedSeriesSequence(copy.ReferencedSeriesSequence), + StudiesContainingOtherReferencedInstancesSequence(copy.StudiesContainingOtherReferencedInstancesSequence) +{ +} + + +DRTTreatmentSummaryRecordIOD::~DRTTreatmentSummaryRecordIOD() +{ +} + + +DRTTreatmentSummaryRecordIOD &DRTTreatmentSummaryRecordIOD::operator=(const DRTTreatmentSummaryRecordIOD ©) +{ + if (this != ©) + { + PatientName = copy.PatientName; + PatientID = copy.PatientID; + IssuerOfPatientID = copy.IssuerOfPatientID; + IssuerOfPatientIDQualifiersSequence = copy.IssuerOfPatientIDQualifiersSequence; + PatientBirthDate = copy.PatientBirthDate; + PatientBirthDateInAlternativeCalendar = copy.PatientBirthDateInAlternativeCalendar; + PatientDeathDateInAlternativeCalendar = copy.PatientDeathDateInAlternativeCalendar; + PatientAlternativeCalendar = copy.PatientAlternativeCalendar; + PatientSex = copy.PatientSex; + ReferencedPatientPhotoSequence = copy.ReferencedPatientPhotoSequence; + QualityControlSubject = copy.QualityControlSubject; + ReferencedPatientSequence = copy.ReferencedPatientSequence; + PatientBirthTime = copy.PatientBirthTime; + OtherPatientIDsSequence = copy.OtherPatientIDsSequence; + OtherPatientNames = copy.OtherPatientNames; + EthnicGroup = copy.EthnicGroup; + PatientComments = copy.PatientComments; + PatientSpeciesDescription = copy.PatientSpeciesDescription; + PatientSpeciesCodeSequence = copy.PatientSpeciesCodeSequence; + PatientBreedDescription = copy.PatientBreedDescription; + PatientBreedCodeSequence = copy.PatientBreedCodeSequence; + BreedRegistrationSequence = copy.BreedRegistrationSequence; + StrainDescription = copy.StrainDescription; + StrainNomenclature = copy.StrainNomenclature; + StrainCodeSequence = copy.StrainCodeSequence; + StrainAdditionalInformation = copy.StrainAdditionalInformation; + StrainStockSequence = copy.StrainStockSequence; + GeneticModificationsSequence = copy.GeneticModificationsSequence; + ResponsiblePerson = copy.ResponsiblePerson; + ResponsiblePersonRole = copy.ResponsiblePersonRole; + ResponsibleOrganization = copy.ResponsibleOrganization; + PatientIdentityRemoved = copy.PatientIdentityRemoved; + DeidentificationMethod = copy.DeidentificationMethod; + DeidentificationMethodCodeSequence = copy.DeidentificationMethodCodeSequence; + SourcePatientGroupIdentificationSequence = copy.SourcePatientGroupIdentificationSequence; + GroupOfPatientsIdentificationSequence = copy.GroupOfPatientsIdentificationSequence; + ClinicalTrialSponsorName = copy.ClinicalTrialSponsorName; + ClinicalTrialProtocolID = copy.ClinicalTrialProtocolID; + ClinicalTrialProtocolName = copy.ClinicalTrialProtocolName; + ClinicalTrialSiteID = copy.ClinicalTrialSiteID; + ClinicalTrialSiteName = copy.ClinicalTrialSiteName; + ClinicalTrialSubjectID = copy.ClinicalTrialSubjectID; + ClinicalTrialSubjectReadingID = copy.ClinicalTrialSubjectReadingID; + ClinicalTrialProtocolEthicsCommitteeName = copy.ClinicalTrialProtocolEthicsCommitteeName; + ClinicalTrialProtocolEthicsCommitteeApprovalNumber = copy.ClinicalTrialProtocolEthicsCommitteeApprovalNumber; + StudyInstanceUID = copy.StudyInstanceUID; + StudyDate = copy.StudyDate; + StudyTime = copy.StudyTime; + ReferringPhysicianName = copy.ReferringPhysicianName; + ReferringPhysicianIdentificationSequence = copy.ReferringPhysicianIdentificationSequence; + ConsultingPhysicianName = copy.ConsultingPhysicianName; + ConsultingPhysicianIdentificationSequence = copy.ConsultingPhysicianIdentificationSequence; + StudyID = copy.StudyID; + AccessionNumber = copy.AccessionNumber; + IssuerOfAccessionNumberSequence = copy.IssuerOfAccessionNumberSequence; + StudyDescription = copy.StudyDescription; + PhysiciansOfRecord = copy.PhysiciansOfRecord; + PhysiciansOfRecordIdentificationSequence = copy.PhysiciansOfRecordIdentificationSequence; + NameOfPhysiciansReadingStudy = copy.NameOfPhysiciansReadingStudy; + PhysiciansReadingStudyIdentificationSequence = copy.PhysiciansReadingStudyIdentificationSequence; + RequestingServiceCodeSequence = copy.RequestingServiceCodeSequence; + ReferencedStudySequence = copy.ReferencedStudySequence; + ProcedureCodeSequence = copy.ProcedureCodeSequence; + ReasonForPerformedProcedureCodeSequence = copy.ReasonForPerformedProcedureCodeSequence; + AdmittingDiagnosesDescription = copy.AdmittingDiagnosesDescription; + AdmittingDiagnosesCodeSequence = copy.AdmittingDiagnosesCodeSequence; + PatientAge = copy.PatientAge; + PatientSize = copy.PatientSize; + PatientWeight = copy.PatientWeight; + PatientBodyMassIndex = copy.PatientBodyMassIndex; + MeasuredAPDimension = copy.MeasuredAPDimension; + MeasuredLateralDimension = copy.MeasuredLateralDimension; + PatientSizeCodeSequence = copy.PatientSizeCodeSequence; + MedicalAlerts = copy.MedicalAlerts; + Allergies = copy.Allergies; + SmokingStatus = copy.SmokingStatus; + PregnancyStatus = copy.PregnancyStatus; + LastMenstrualDate = copy.LastMenstrualDate; + PatientState = copy.PatientState; + Occupation = copy.Occupation; + AdditionalPatientHistory = copy.AdditionalPatientHistory; + AdmissionID = copy.AdmissionID; + IssuerOfAdmissionIDSequence = copy.IssuerOfAdmissionIDSequence; + ServiceEpisodeID = copy.ServiceEpisodeID; + IssuerOfServiceEpisodeIDSequence = copy.IssuerOfServiceEpisodeIDSequence; + ServiceEpisodeDescription = copy.ServiceEpisodeDescription; + PatientSexNeutered = copy.PatientSexNeutered; + ClinicalTrialTimePointID = copy.ClinicalTrialTimePointID; + ClinicalTrialTimePointDescription = copy.ClinicalTrialTimePointDescription; + LongitudinalTemporalOffsetFromEvent = copy.LongitudinalTemporalOffsetFromEvent; + LongitudinalTemporalEventType = copy.LongitudinalTemporalEventType; + ConsentForClinicalTrialUseSequence = copy.ConsentForClinicalTrialUseSequence; + Modality = copy.Modality; + SeriesInstanceUID = copy.SeriesInstanceUID; + SeriesNumber = copy.SeriesNumber; + SeriesDate = copy.SeriesDate; + SeriesTime = copy.SeriesTime; + SeriesDescription = copy.SeriesDescription; + SeriesDescriptionCodeSequence = copy.SeriesDescriptionCodeSequence; + OperatorsName = copy.OperatorsName; + OperatorIdentificationSequence = copy.OperatorIdentificationSequence; + ReferencedPerformedProcedureStepSequence = copy.ReferencedPerformedProcedureStepSequence; + RequestAttributesSequence = copy.RequestAttributesSequence; + PerformedProcedureStepID = copy.PerformedProcedureStepID; + PerformedProcedureStepStartDate = copy.PerformedProcedureStepStartDate; + PerformedProcedureStepStartTime = copy.PerformedProcedureStepStartTime; + PerformedProcedureStepEndDate = copy.PerformedProcedureStepEndDate; + PerformedProcedureStepEndTime = copy.PerformedProcedureStepEndTime; + PerformedProcedureStepDescription = copy.PerformedProcedureStepDescription; + PerformedProtocolCodeSequence = copy.PerformedProtocolCodeSequence; + CommentsOnThePerformedProcedureStep = copy.CommentsOnThePerformedProcedureStep; + ClinicalTrialCoordinatingCenterName = copy.ClinicalTrialCoordinatingCenterName; + ClinicalTrialSeriesID = copy.ClinicalTrialSeriesID; + ClinicalTrialSeriesDescription = copy.ClinicalTrialSeriesDescription; + Manufacturer = copy.Manufacturer; + InstitutionName = copy.InstitutionName; + InstitutionAddress = copy.InstitutionAddress; + StationName = copy.StationName; + InstitutionalDepartmentName = copy.InstitutionalDepartmentName; + ManufacturerModelName = copy.ManufacturerModelName; + DeviceSerialNumber = copy.DeviceSerialNumber; + SoftwareVersions = copy.SoftwareVersions; + GantryID = copy.GantryID; + UDISequence = copy.UDISequence; + SpatialResolution = copy.SpatialResolution; + DateOfLastCalibration = copy.DateOfLastCalibration; + TimeOfLastCalibration = copy.TimeOfLastCalibration; + PixelPaddingValue = copy.PixelPaddingValue; + InstanceNumber = copy.InstanceNumber; + TreatmentDate = copy.TreatmentDate; + TreatmentTime = copy.TreatmentTime; + ReferencedRTPlanSequence = copy.ReferencedRTPlanSequence; + ReferencedTreatmentRecordSequence = copy.ReferencedTreatmentRecordSequence; + CurrentTreatmentStatus = copy.CurrentTreatmentStatus; + TreatmentStatusComment = copy.TreatmentStatusComment; + FirstTreatmentDate = copy.FirstTreatmentDate; + MostRecentTreatmentDate = copy.MostRecentTreatmentDate; + FractionGroupSummarySequence = copy.FractionGroupSummarySequence; + TreatmentSummaryMeasuredDoseReferenceSequence = copy.TreatmentSummaryMeasuredDoseReferenceSequence; + TreatmentSummaryCalculatedDoseReferenceSequence = copy.TreatmentSummaryCalculatedDoseReferenceSequence; + ReferencedImageSequence = copy.ReferencedImageSequence; + ReferencedInstanceSequence = copy.ReferencedInstanceSequence; + DerivationDescription = copy.DerivationDescription; + DerivationCodeSequence = copy.DerivationCodeSequence; + SourceImageSequence = copy.SourceImageSequence; + SourceInstanceSequence = copy.SourceInstanceSequence; + SOPClassUID = copy.SOPClassUID; + SOPInstanceUID = copy.SOPInstanceUID; + SpecificCharacterSet = copy.SpecificCharacterSet; + InstanceCreationDate = copy.InstanceCreationDate; + InstanceCreationTime = copy.InstanceCreationTime; + InstanceCoercionDateTime = copy.InstanceCoercionDateTime; + InstanceCreatorUID = copy.InstanceCreatorUID; + RelatedGeneralSOPClassUID = copy.RelatedGeneralSOPClassUID; + OriginalSpecializedSOPClassUID = copy.OriginalSpecializedSOPClassUID; + CodingSchemeIdentificationSequence = copy.CodingSchemeIdentificationSequence; + ContextGroupIdentificationSequence = copy.ContextGroupIdentificationSequence; + MappingResourceIdentificationSequence = copy.MappingResourceIdentificationSequence; + TimezoneOffsetFromUTC = copy.TimezoneOffsetFromUTC; + ContributingEquipmentSequence = copy.ContributingEquipmentSequence; + SOPInstanceStatus = copy.SOPInstanceStatus; + SOPAuthorizationDateTime = copy.SOPAuthorizationDateTime; + SOPAuthorizationComment = copy.SOPAuthorizationComment; + AuthorizationEquipmentCertificationNumber = copy.AuthorizationEquipmentCertificationNumber; + MACParametersSequence = copy.MACParametersSequence; + DigitalSignaturesSequence = copy.DigitalSignaturesSequence; + EncryptedAttributesSequence = copy.EncryptedAttributesSequence; + OriginalAttributesSequence = copy.OriginalAttributesSequence; + HL7StructuredDocumentReferenceSequence = copy.HL7StructuredDocumentReferenceSequence; + LongitudinalTemporalInformationModified = copy.LongitudinalTemporalInformationModified; + QueryRetrieveView = copy.QueryRetrieveView; + ConversionSourceAttributesSequence = copy.ConversionSourceAttributesSequence; + ContentQualification = copy.ContentQualification; + PrivateDataElementCharacteristicsSequence = copy.PrivateDataElementCharacteristicsSequence; + ReferencedSeriesSequence = copy.ReferencedSeriesSequence; + StudiesContainingOtherReferencedInstancesSequence = copy.StudiesContainingOtherReferencedInstancesSequence; + } + return *this; +} + + +void DRTTreatmentSummaryRecordIOD::clear() +{ + /* clear all DICOM attributes */ + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + IssuerOfPatientIDQualifiersSequence.clear(); + PatientBirthDate.clear(); + PatientBirthDateInAlternativeCalendar.clear(); + PatientDeathDateInAlternativeCalendar.clear(); + PatientAlternativeCalendar.clear(); + PatientSex.clear(); + ReferencedPatientPhotoSequence.clear(); + QualityControlSubject.clear(); + ReferencedPatientSequence.clear(); + PatientBirthTime.clear(); + OtherPatientIDsSequence.clear(); + OtherPatientNames.clear(); + EthnicGroup.clear(); + PatientComments.clear(); + PatientSpeciesDescription.clear(); + PatientSpeciesCodeSequence.clear(); + PatientBreedDescription.clear(); + PatientBreedCodeSequence.clear(); + BreedRegistrationSequence.clear(); + StrainDescription.clear(); + StrainNomenclature.clear(); + StrainCodeSequence.clear(); + StrainAdditionalInformation.clear(); + StrainStockSequence.clear(); + GeneticModificationsSequence.clear(); + ResponsiblePerson.clear(); + ResponsiblePersonRole.clear(); + ResponsibleOrganization.clear(); + PatientIdentityRemoved.clear(); + DeidentificationMethod.clear(); + DeidentificationMethodCodeSequence.clear(); + SourcePatientGroupIdentificationSequence.clear(); + GroupOfPatientsIdentificationSequence.clear(); + ClinicalTrialSponsorName.clear(); + ClinicalTrialProtocolID.clear(); + ClinicalTrialProtocolName.clear(); + ClinicalTrialSiteID.clear(); + ClinicalTrialSiteName.clear(); + ClinicalTrialSubjectID.clear(); + ClinicalTrialSubjectReadingID.clear(); + ClinicalTrialProtocolEthicsCommitteeName.clear(); + ClinicalTrialProtocolEthicsCommitteeApprovalNumber.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + ReferringPhysicianIdentificationSequence.clear(); + ConsultingPhysicianName.clear(); + ConsultingPhysicianIdentificationSequence.clear(); + StudyID.clear(); + AccessionNumber.clear(); + IssuerOfAccessionNumberSequence.clear(); + StudyDescription.clear(); + PhysiciansOfRecord.clear(); + PhysiciansOfRecordIdentificationSequence.clear(); + NameOfPhysiciansReadingStudy.clear(); + PhysiciansReadingStudyIdentificationSequence.clear(); + RequestingServiceCodeSequence.clear(); + ReferencedStudySequence.clear(); + ProcedureCodeSequence.clear(); + ReasonForPerformedProcedureCodeSequence.clear(); + AdmittingDiagnosesDescription.clear(); + AdmittingDiagnosesCodeSequence.clear(); + PatientAge.clear(); + PatientSize.clear(); + PatientWeight.clear(); + PatientBodyMassIndex.clear(); + MeasuredAPDimension.clear(); + MeasuredLateralDimension.clear(); + PatientSizeCodeSequence.clear(); + MedicalAlerts.clear(); + Allergies.clear(); + SmokingStatus.clear(); + PregnancyStatus.clear(); + LastMenstrualDate.clear(); + PatientState.clear(); + Occupation.clear(); + AdditionalPatientHistory.clear(); + AdmissionID.clear(); + IssuerOfAdmissionIDSequence.clear(); + ServiceEpisodeID.clear(); + IssuerOfServiceEpisodeIDSequence.clear(); + ServiceEpisodeDescription.clear(); + PatientSexNeutered.clear(); + ClinicalTrialTimePointID.clear(); + ClinicalTrialTimePointDescription.clear(); + LongitudinalTemporalOffsetFromEvent.clear(); + LongitudinalTemporalEventType.clear(); + ConsentForClinicalTrialUseSequence.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + SeriesDescriptionCodeSequence.clear(); + OperatorsName.clear(); + OperatorIdentificationSequence.clear(); + ReferencedPerformedProcedureStepSequence.clear(); + RequestAttributesSequence.clear(); + PerformedProcedureStepID.clear(); + PerformedProcedureStepStartDate.clear(); + PerformedProcedureStepStartTime.clear(); + PerformedProcedureStepEndDate.clear(); + PerformedProcedureStepEndTime.clear(); + PerformedProcedureStepDescription.clear(); + PerformedProtocolCodeSequence.clear(); + CommentsOnThePerformedProcedureStep.clear(); + ClinicalTrialCoordinatingCenterName.clear(); + ClinicalTrialSeriesID.clear(); + ClinicalTrialSeriesDescription.clear(); + Manufacturer.clear(); + InstitutionName.clear(); + InstitutionAddress.clear(); + StationName.clear(); + InstitutionalDepartmentName.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + GantryID.clear(); + UDISequence.clear(); + SpatialResolution.clear(); + DateOfLastCalibration.clear(); + TimeOfLastCalibration.clear(); + PixelPaddingValue.clear(); + InstanceNumber.clear(); + TreatmentDate.clear(); + TreatmentTime.clear(); + ReferencedRTPlanSequence.clear(); + ReferencedTreatmentRecordSequence.clear(); + CurrentTreatmentStatus.clear(); + TreatmentStatusComment.clear(); + FirstTreatmentDate.clear(); + MostRecentTreatmentDate.clear(); + FractionGroupSummarySequence.clear(); + TreatmentSummaryMeasuredDoseReferenceSequence.clear(); + TreatmentSummaryCalculatedDoseReferenceSequence.clear(); + ReferencedImageSequence.clear(); + ReferencedInstanceSequence.clear(); + DerivationDescription.clear(); + DerivationCodeSequence.clear(); + SourceImageSequence.clear(); + SourceInstanceSequence.clear(); + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCoercionDateTime.clear(); + InstanceCreatorUID.clear(); + RelatedGeneralSOPClassUID.clear(); + OriginalSpecializedSOPClassUID.clear(); + CodingSchemeIdentificationSequence.clear(); + ContextGroupIdentificationSequence.clear(); + MappingResourceIdentificationSequence.clear(); + TimezoneOffsetFromUTC.clear(); + ContributingEquipmentSequence.clear(); + SOPInstanceStatus.clear(); + SOPAuthorizationDateTime.clear(); + SOPAuthorizationComment.clear(); + AuthorizationEquipmentCertificationNumber.clear(); + MACParametersSequence.clear(); + DigitalSignaturesSequence.clear(); + EncryptedAttributesSequence.clear(); + OriginalAttributesSequence.clear(); + HL7StructuredDocumentReferenceSequence.clear(); + LongitudinalTemporalInformationModified.clear(); + QueryRetrieveView.clear(); + ConversionSourceAttributesSequence.clear(); + ContentQualification.clear(); + PrivateDataElementCharacteristicsSequence.clear(); + ReferencedSeriesSequence.clear(); + StudiesContainingOtherReferencedInstancesSequence.clear(); +} + + +OFBool DRTTreatmentSummaryRecordIOD::isValid() +{ + /* tbd: check whether object is valid */ + return OFTrue; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::checkDatasetForReading(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* check SOP class UID */ + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + OFString tmpString; + getStringValueFromElement(sopClassUID, tmpString); + if (tmpString != UID_RTTreatmentSummaryRecordStorage) + { + DCMRT_ERROR("Invalid value for attribute SOPClassUID (0008,0016)"); + result = RT_EC_InvalidValue; + } + } + return result; +} + + +void DRTTreatmentSummaryRecordIOD::updateAttributes() +{ + SOPClassUID.putString(UID_RTTreatmentSummaryRecordStorage); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::read(DcmItem &dataset) +{ + /* re-initialize object */ + clear(); + /* check SOP class UID first */ + OFCondition result = checkDatasetForReading(dataset); + /* read data from PatientIE, StudyIE, SeriesIE */ + if (result.good()) + result = readSeriesData(dataset); + if (result.good()) + { + // --- GeneralEquipmentModule (M) --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionAddress, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, StationName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, InstitutionalDepartmentName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, GantryID, "1", "3", "GeneralEquipmentModule"); + UDISequence.read(dataset, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SpatialResolution, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DateOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, TimeOfLastCalibration, "1-n", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, PixelPaddingValue, "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralTreatmentRecordModule (M) --- + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "1", "RTGeneralTreatmentRecordModule"); + getAndCheckElementFromDataset(dataset, TreatmentDate, "1", "2", "RTGeneralTreatmentRecordModule"); + getAndCheckElementFromDataset(dataset, TreatmentTime, "1", "2", "RTGeneralTreatmentRecordModule"); + ReferencedRTPlanSequence.read(dataset, "1-n", "2", "RTGeneralTreatmentRecordModule"); + ReferencedTreatmentRecordSequence.read(dataset, "1-n", "3", "RTGeneralTreatmentRecordModule"); + + // --- RTTreatmentSummaryRecordModule (M) --- + getAndCheckElementFromDataset(dataset, CurrentTreatmentStatus, "1", "1", "RTTreatmentSummaryRecordModule"); + getAndCheckElementFromDataset(dataset, TreatmentStatusComment, "1", "3", "RTTreatmentSummaryRecordModule"); + getAndCheckElementFromDataset(dataset, FirstTreatmentDate, "1", "2", "RTTreatmentSummaryRecordModule"); + getAndCheckElementFromDataset(dataset, MostRecentTreatmentDate, "1", "2", "RTTreatmentSummaryRecordModule"); + FractionGroupSummarySequence.read(dataset, "1-n", "3", "RTTreatmentSummaryRecordModule"); + TreatmentSummaryMeasuredDoseReferenceSequence.read(dataset, "1-n", "3", "RTTreatmentSummaryRecordModule"); + TreatmentSummaryCalculatedDoseReferenceSequence.read(dataset, "1-n", "3", "RTTreatmentSummaryRecordModule"); + + // --- GeneralReferenceModule (U) --- + ReferencedImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + ReferencedInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + getAndCheckElementFromDataset(dataset, DerivationDescription, "1", "3", "GeneralReferenceModule"); + DerivationCodeSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceImageSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + SourceInstanceSequence.read(dataset, "1-n", "3", "GeneralReferenceModule"); + + // --- SOPCommonModule (M) --- + getAndCheckElementFromDataset(dataset, SOPClassUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCoercionDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, RelatedGeneralSOPClassUID, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, OriginalSpecializedSOPClassUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + ContextGroupIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + MappingResourceIdentificationSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + ContributingEquipmentSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + // getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPInstanceStatus, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationDateTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SOPAuthorizationComment, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, AuthorizationEquipmentCertificationNumber, "1", "3", "SOPCommonModule"); + MACParametersSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + DigitalSignaturesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + EncryptedAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + OriginalAttributesSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + HL7StructuredDocumentReferenceSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalInformationModified, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, QueryRetrieveView, "1", "1C", "SOPCommonModule"); + ConversionSourceAttributesSequence.read(dataset, "1-n", "1C", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, ContentQualification, "1", "3", "SOPCommonModule"); + PrivateDataElementCharacteristicsSequence.read(dataset, "1-n", "3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + ReferencedSeriesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + StudiesContainingOtherReferencedInstancesSequence.read(dataset, "1-n", "1C", "CommonInstanceReferenceModule"); + } + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::readPatientData(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + + // --- PatientModule (M) --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + IssuerOfPatientIDQualifiersSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientDeathDateInAlternativeCalendar, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientAlternativeCalendar, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + ReferencedPatientPhotoSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, QualityControlSubject, "1", "3", "PatientModule"); + ReferencedPatientSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthTime, "1", "3", "PatientModule"); + OtherPatientIDsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, OtherPatientNames, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, EthnicGroup, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientComments, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSpeciesDescription, "1", "1C", "PatientModule"); + PatientSpeciesCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBreedDescription, "1", "2C", "PatientModule"); + PatientBreedCodeSequence.read(dataset, "1-n", "2C", "PatientModule"); + BreedRegistrationSequence.read(dataset, "1-n", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainDescription, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainNomenclature, "1", "3", "PatientModule"); + StrainCodeSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, StrainAdditionalInformation, "1", "3", "PatientModule"); + StrainStockSequence.read(dataset, "1-n", "3", "PatientModule"); + GeneticModificationsSequence.read(dataset, "1-n", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePerson, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsiblePersonRole, "1", "1C", "PatientModule"); + getAndCheckElementFromDataset(dataset, ResponsibleOrganization, "1", "2C", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientIdentityRemoved, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, DeidentificationMethod, "1-n", "1C", "PatientModule"); + DeidentificationMethodCodeSequence.read(dataset, "1-n", "1C", "PatientModule"); + SourcePatientGroupIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + GroupOfPatientsIdentificationSequence.read(dataset, "1-n", "3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialSponsorName) || + dataset.tagExists(DCM_ClinicalTrialProtocolID) || + dataset.tagExists(DCM_ClinicalTrialProtocolName) || + dataset.tagExists(DCM_ClinicalTrialSiteID) || + dataset.tagExists(DCM_ClinicalTrialSiteName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialSponsorName, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolID, "1", "1", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteID, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSiteName, "1", "2", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSubjectReadingID, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeName, "1", "1C", "ClinicalTrialSubjectModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialProtocolEthicsCommitteeApprovalNumber, "1", "3", "ClinicalTrialSubjectModule"); + } + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::readStudyData(DcmItem &dataset) +{ + /* read data from PatientIE */ + OFCondition result = readPatientData(dataset); + if (result.good()) + { + // --- GeneralStudyModule (M) --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + ReferringPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ConsultingPhysicianName, "1-n", "3", "GeneralStudyModule"); + ConsultingPhysicianIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + IssuerOfAccessionNumberSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, PhysiciansOfRecord, "1-n", "3", "GeneralStudyModule"); + PhysiciansOfRecordIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, NameOfPhysiciansReadingStudy, "1-n", "3", "GeneralStudyModule"); + PhysiciansReadingStudyIdentificationSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + RequestingServiceCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReferencedStudySequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + ReasonForPerformedProcedureCodeSequence.read(dataset, "1-n", "3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + getAndCheckElementFromDataset(dataset, AdmittingDiagnosesDescription, "1-n", "3", "PatientStudyModule"); + AdmittingDiagnosesCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientAge, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSize, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientWeight, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientBodyMassIndex, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredAPDimension, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MeasuredLateralDimension, "1", "3", "PatientStudyModule"); + PatientSizeCodeSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, MedicalAlerts, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Allergies, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, SmokingStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PregnancyStatus, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, LastMenstrualDate, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientState, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, Occupation, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdditionalPatientHistory, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, AdmissionID, "1", "3", "PatientStudyModule"); + IssuerOfAdmissionIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeID, "1", "3", "PatientStudyModule"); + IssuerOfServiceEpisodeIDSequence.read(dataset, "1-n", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, ServiceEpisodeDescription, "1", "3", "PatientStudyModule"); + getAndCheckElementFromDataset(dataset, PatientSexNeutered, "1", "2C", "PatientStudyModule"); + + // --- ClinicalTrialStudyModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialTimePointID)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointID, "1", "2", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialTimePointDescription, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalOffsetFromEvent, "1", "3", "ClinicalTrialStudyModule"); + getAndCheckElementFromDataset(dataset, LongitudinalTemporalEventType, "1", "1C", "ClinicalTrialStudyModule"); + ConsentForClinicalTrialUseSequence.read(dataset, "1-n", "3", "ClinicalTrialStudyModule"); + } + } + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::readSeriesData(DcmItem &dataset) +{ + /* read data from PatientIE, StudyIE */ + OFCondition result = readStudyData(dataset); + if (result.good()) + { + // --- RTSeriesModule (M) --- + getAndCheckElementFromDataset(dataset, Modality, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "2", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "RTSeriesModule"); + SeriesDescriptionCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, OperatorsName, "1-n", "2", "RTSeriesModule"); + OperatorIdentificationSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + ReferencedPerformedProcedureStepSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + RequestAttributesSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepID, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepStartTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndDate, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepEndTime, "1", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, PerformedProcedureStepDescription, "1", "3", "RTSeriesModule"); + PerformedProtocolCodeSequence.read(dataset, "1-n", "3", "RTSeriesModule"); + getAndCheckElementFromDataset(dataset, CommentsOnThePerformedProcedureStep, "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (dataset.tagExists(DCM_ClinicalTrialCoordinatingCenterName)) + { + getAndCheckElementFromDataset(dataset, ClinicalTrialCoordinatingCenterName, "1", "2", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesID, "1", "3", "ClinicalTrialSeriesModule"); + getAndCheckElementFromDataset(dataset, ClinicalTrialSeriesDescription, "1", "3", "ClinicalTrialSeriesModule"); + } + } + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::write(DcmItem &dataset) +{ + OFCondition result = EC_Normal; + /* only write valid objects */ + if (isValid()) + { + /* update various DICOM attributes */ + updateAttributes(); + + // --- PatientModule (M) --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + if (result.good()) result = IssuerOfPatientIDQualifiersSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBirthDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientDeathDateInAlternativeCalendar), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientAlternativeCalendar), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + if (result.good()) result = ReferencedPatientPhotoSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(QualityControlSubject), "1", "3", "PatientModule"); + if (result.good()) result = ReferencedPatientSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmTime(PatientBirthTime), "1", "3", "PatientModule"); + if (result.good()) result = OtherPatientIDsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(OtherPatientNames), "1-n", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmShortString(EthnicGroup), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongText(PatientComments), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientSpeciesDescription), "1", "1C", "PatientModule"); + if (result.good()) result = PatientSpeciesCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientBreedDescription), "1", "2C", "PatientModule"); + if (result.good()) result = PatientBreedCodeSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + if (result.good()) result = BreedRegistrationSequence.write(dataset, "1-n" ,"2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedCharacters(StrainDescription), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(StrainNomenclature), "1", "3", "PatientModule"); + if (result.good()) result = StrainCodeSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmUnlimitedText(StrainAdditionalInformation), "1", "3", "PatientModule"); + if (result.good()) result = StrainStockSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GeneticModificationsSequence.write(dataset, "1-n" ,"3", "PatientModule"); + addElementToDataset(result, dataset, new DcmPersonName(ResponsiblePerson), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(ResponsiblePersonRole), "1", "1C", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(ResponsibleOrganization), "1", "2C", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientIdentityRemoved), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(DeidentificationMethod), "1-n", "1C", "PatientModule"); + if (result.good()) result = DeidentificationMethodCodeSequence.write(dataset, "1-n" ,"1C", "PatientModule"); + if (result.good()) result = SourcePatientGroupIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + if (result.good()) result = GroupOfPatientsIdentificationSequence.write(dataset, "1-n" ,"3", "PatientModule"); + + // --- ClinicalTrialSubjectModule (U) --- + if (isClinicalTrialSubjectModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSponsorName), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolID), "1", "1", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteID), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSiteName), "1", "2", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSubjectReadingID), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeName), "1", "1C", "ClinicalTrialSubjectModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialProtocolEthicsCommitteeApprovalNumber), "1", "3", "ClinicalTrialSubjectModule"); + } + + // --- GeneralStudyModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + if (result.good()) result = ReferringPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ConsultingPhysicianName), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = ConsultingPhysicianIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + if (result.good()) result = IssuerOfAccessionNumberSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(PhysiciansOfRecord), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansOfRecordIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(NameOfPhysiciansReadingStudy), "1-n", "3", "GeneralStudyModule"); + if (result.good()) result = PhysiciansReadingStudyIdentificationSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = RequestingServiceCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReferencedStudySequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + if (result.good()) result = ReasonForPerformedProcedureCodeSequence.write(dataset, "1-n" ,"3", "GeneralStudyModule"); + + // --- PatientStudyModule (U) --- + if (isPatientStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(AdmittingDiagnosesDescription), "1-n", "3", "PatientStudyModule"); + if (result.good()) result = AdmittingDiagnosesCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmAgeString(PatientAge), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientSize), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientWeight), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(PatientBodyMassIndex), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredAPDimension), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDecimalString(MeasuredLateralDimension), "1", "3", "PatientStudyModule"); + if (result.good()) result = PatientSizeCodeSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(MedicalAlerts), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(Allergies), "1-n", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(SmokingStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PregnancyStatus), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmDate(LastMenstrualDate), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientState), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(Occupation), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongText(AdditionalPatientHistory), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(AdmissionID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfAdmissionIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeID), "1", "3", "PatientStudyModule"); + if (result.good()) result = IssuerOfServiceEpisodeIDSequence.write(dataset, "1-n" ,"3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(ServiceEpisodeDescription), "1", "3", "PatientStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSexNeutered), "1", "2C", "PatientStudyModule"); + } + + // --- ClinicalTrialStudyModule (U) --- + if (isClinicalTrialStudyModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialTimePointID), "1", "2", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmShortText(ClinicalTrialTimePointDescription), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmFloatingPointDouble(LongitudinalTemporalOffsetFromEvent), "1", "3", "ClinicalTrialStudyModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalEventType), "1", "1C", "ClinicalTrialStudyModule"); + if (result.good()) result = ConsentForClinicalTrialUseSequence.write(dataset, "1-n" ,"3", "ClinicalTrialStudyModule"); + } + + // --- RTSeriesModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "2", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = SeriesDescriptionCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmPersonName(OperatorsName), "1-n", "2", "RTSeriesModule"); + if (result.good()) result = OperatorIdentificationSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = ReferencedPerformedProcedureStepSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + if (result.good()) result = RequestAttributesSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortString(PerformedProcedureStepID), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepStartDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepStartTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(PerformedProcedureStepEndDate), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(PerformedProcedureStepEndTime), "1", "3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(PerformedProcedureStepDescription), "1", "3", "RTSeriesModule"); + if (result.good()) result = PerformedProtocolCodeSequence.write(dataset, "1-n" ,"3", "RTSeriesModule"); + addElementToDataset(result, dataset, new DcmShortText(CommentsOnThePerformedProcedureStep), "1", "3", "RTSeriesModule"); + + // --- ClinicalTrialSeriesModule (U) --- + if (isClinicalTrialSeriesModulePresent(OFFalse /*complete*/)) + { + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialCoordinatingCenterName), "1", "2", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesID), "1", "3", "ClinicalTrialSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ClinicalTrialSeriesDescription), "1", "3", "ClinicalTrialSeriesModule"); + } + + // --- GeneralEquipmentModule (M) --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortText(InstitutionAddress), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmShortString(StationName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(InstitutionalDepartmentName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(GantryID), "1", "3", "GeneralEquipmentModule"); + if (result.good()) result = UDISequence.write(dataset, "1-n" ,"3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDecimalString(SpatialResolution), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmDate(DateOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmTime(TimeOfLastCalibration), "1-n", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmUnsignedShort(PixelPaddingValue), "1", "1C", "GeneralEquipmentModule"); + + // --- RTGeneralTreatmentRecordModule (M) --- + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "1", "RTGeneralTreatmentRecordModule"); + addElementToDataset(result, dataset, new DcmDate(TreatmentDate), "1", "2", "RTGeneralTreatmentRecordModule"); + addElementToDataset(result, dataset, new DcmTime(TreatmentTime), "1", "2", "RTGeneralTreatmentRecordModule"); + if (result.good()) result = ReferencedRTPlanSequence.write(dataset, "1-n" ,"2", "RTGeneralTreatmentRecordModule"); + if (result.good()) result = ReferencedTreatmentRecordSequence.write(dataset, "1-n" ,"3", "RTGeneralTreatmentRecordModule"); + + // --- RTTreatmentSummaryRecordModule (M) --- + addElementToDataset(result, dataset, new DcmCodeString(CurrentTreatmentStatus), "1", "1", "RTTreatmentSummaryRecordModule"); + addElementToDataset(result, dataset, new DcmShortText(TreatmentStatusComment), "1", "3", "RTTreatmentSummaryRecordModule"); + addElementToDataset(result, dataset, new DcmDate(FirstTreatmentDate), "1", "2", "RTTreatmentSummaryRecordModule"); + addElementToDataset(result, dataset, new DcmDate(MostRecentTreatmentDate), "1", "2", "RTTreatmentSummaryRecordModule"); + if (result.good()) result = FractionGroupSummarySequence.write(dataset, "1-n" ,"3", "RTTreatmentSummaryRecordModule"); + if (result.good()) result = TreatmentSummaryMeasuredDoseReferenceSequence.write(dataset, "1-n" ,"3", "RTTreatmentSummaryRecordModule"); + if (result.good()) result = TreatmentSummaryCalculatedDoseReferenceSequence.write(dataset, "1-n" ,"3", "RTTreatmentSummaryRecordModule"); + + // --- GeneralReferenceModule (U) --- + if (isGeneralReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = ReferencedInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + addElementToDataset(result, dataset, new DcmShortText(DerivationDescription), "1", "3", "GeneralReferenceModule"); + if (result.good()) result = DerivationCodeSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceImageSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + if (result.good()) result = SourceInstanceSequence.write(dataset, "1-n" ,"3", "GeneralReferenceModule"); + } + + // --- SOPCommonModule (M) --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(InstanceCoercionDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(RelatedGeneralSOPClassUID), "1-n", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(OriginalSpecializedSOPClassUID), "1", "3", "SOPCommonModule"); + if (result.good()) result = CodingSchemeIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = ContextGroupIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = MappingResourceIdentificationSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + if (result.good()) result = ContributingEquipmentSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + // addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(SOPInstanceStatus), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDateTime(SOPAuthorizationDateTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongText(SOPAuthorizationComment), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmLongString(AuthorizationEquipmentCertificationNumber), "1", "3", "SOPCommonModule"); + if (result.good()) result = MACParametersSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = DigitalSignaturesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = EncryptedAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + if (result.good()) result = OriginalAttributesSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + if (result.good()) result = HL7StructuredDocumentReferenceSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(LongitudinalTemporalInformationModified), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(QueryRetrieveView), "1", "1C", "SOPCommonModule"); + if (result.good()) result = ConversionSourceAttributesSequence.write(dataset, "1-n" ,"1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmCodeString(ContentQualification), "1", "3", "SOPCommonModule"); + if (result.good()) result = PrivateDataElementCharacteristicsSequence.write(dataset, "1-n" ,"3", "SOPCommonModule"); + + // --- CommonInstanceReferenceModule (U) --- + if (isCommonInstanceReferenceModulePresent(OFFalse /*complete*/)) + { + if (result.good()) result = ReferencedSeriesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + if (result.good()) result = StudiesContainingOtherReferencedInstancesSequence.write(dataset, "1-n" ,"1C", "CommonInstanceReferenceModule"); + } + } else + result = RT_EC_InvalidObject; + return result; +} + + +OFBool DRTTreatmentSummaryRecordIOD::isClinicalTrialSubjectModulePresent(const OFBool complete) +{ + if (complete) + { + /* check whether all mandatory attributes are present */ + return !ClinicalTrialSponsorName.isEmpty() && + !ClinicalTrialProtocolID.isEmpty(); + } else { + /* check whether at least one attribute is present */ + return !ClinicalTrialSponsorName.isEmpty() || + !ClinicalTrialProtocolID.isEmpty() || + !ClinicalTrialProtocolName.isEmpty() || + !ClinicalTrialSiteID.isEmpty() || + !ClinicalTrialSiteName.isEmpty() || + !ClinicalTrialSubjectID.isEmpty() || + !ClinicalTrialSubjectReadingID.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeName.isEmpty() || + !ClinicalTrialProtocolEthicsCommitteeApprovalNumber.isEmpty(); + } +} + + +OFBool DRTTreatmentSummaryRecordIOD::isPatientStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !AdmittingDiagnosesDescription.isEmpty() || + !AdmittingDiagnosesCodeSequence.isEmpty() || + !PatientAge.isEmpty() || + !PatientSize.isEmpty() || + !PatientWeight.isEmpty() || + !PatientBodyMassIndex.isEmpty() || + !MeasuredAPDimension.isEmpty() || + !MeasuredLateralDimension.isEmpty() || + !PatientSizeCodeSequence.isEmpty() || + !MedicalAlerts.isEmpty() || + !Allergies.isEmpty() || + !SmokingStatus.isEmpty() || + !PregnancyStatus.isEmpty() || + !LastMenstrualDate.isEmpty() || + !PatientState.isEmpty() || + !Occupation.isEmpty() || + !AdditionalPatientHistory.isEmpty() || + !AdmissionID.isEmpty() || + !IssuerOfAdmissionIDSequence.isEmpty() || + !ServiceEpisodeID.isEmpty() || + !IssuerOfServiceEpisodeIDSequence.isEmpty() || + !ServiceEpisodeDescription.isEmpty() || + !PatientSexNeutered.isEmpty(); +} + + +OFBool DRTTreatmentSummaryRecordIOD::isClinicalTrialStudyModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialTimePointID.isEmpty() || + !ClinicalTrialTimePointDescription.isEmpty() || + !LongitudinalTemporalOffsetFromEvent.isEmpty() || + !LongitudinalTemporalEventType.isEmpty() || + !ConsentForClinicalTrialUseSequence.isEmpty(); +} + + +OFBool DRTTreatmentSummaryRecordIOD::isClinicalTrialSeriesModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ClinicalTrialCoordinatingCenterName.isEmpty() || + !ClinicalTrialSeriesID.isEmpty() || + !ClinicalTrialSeriesDescription.isEmpty(); +} + + +OFBool DRTTreatmentSummaryRecordIOD::isGeneralReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedImageSequence.isEmpty() || + !ReferencedInstanceSequence.isEmpty() || + !DerivationDescription.isEmpty() || + !DerivationCodeSequence.isEmpty() || + !SourceImageSequence.isEmpty() || + !SourceInstanceSequence.isEmpty(); +} + + +OFBool DRTTreatmentSummaryRecordIOD::isCommonInstanceReferenceModulePresent(const OFBool /*complete*/) +{ + /* check whether at least one attribute is present */ + return !ReferencedSeriesSequence.isEmpty() || + !StudiesContainingOtherReferencedInstancesSequence.isEmpty(); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getAccessionNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getAdditionalPatientHistory(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdditionalPatientHistory, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getAdmissionID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmissionID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getAdmittingDiagnosesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AdmittingDiagnosesDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getAllergies(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Allergies, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getAuthorizationEquipmentCertificationNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(AuthorizationEquipmentCertificationNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialCoordinatingCenterName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialCoordinatingCenterName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialProtocolEthicsCommitteeApprovalNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeApprovalNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialProtocolEthicsCommitteeName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolEthicsCommitteeName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialProtocolID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialProtocolName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialProtocolName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialSeriesID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSeriesID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialSiteID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialSiteName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSiteName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialSponsorName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSponsorName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialSubjectID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialSubjectReadingID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialSubjectReadingID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialTimePointDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getClinicalTrialTimePointID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ClinicalTrialTimePointID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getCommentsOnThePerformedProcedureStep(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CommentsOnThePerformedProcedureStep, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getConsultingPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ConsultingPhysicianName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getContentQualification(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ContentQualification, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getCurrentTreatmentStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(CurrentTreatmentStatus, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getDateOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DateOfLastCalibration, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getDeidentificationMethod(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeidentificationMethod, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getDerivationDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DerivationDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getDeviceSerialNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getEthnicGroup(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(EthnicGroup, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getFirstTreatmentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(FirstTreatmentDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getGantryID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(GantryID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstanceCoercionDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCoercionDateTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstanceCreationDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstanceCreationTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstanceCreatorUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstanceNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstanceNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, InstanceNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstitutionAddress(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionAddress, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstitutionName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getInstitutionalDepartmentName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(InstitutionalDepartmentName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getIssuerOfPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getLastMenstrualDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LastMenstrualDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getLongitudinalTemporalEventType(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalEventType, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getLongitudinalTemporalInformationModified(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(LongitudinalTemporalInformationModified, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getLongitudinalTemporalOffsetFromEvent(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmFloatingPointDouble &, LongitudinalTemporalOffsetFromEvent).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getManufacturer(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getManufacturerModelName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getMeasuredAPDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredAPDimension, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getMeasuredAPDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredAPDimension).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getMeasuredLateralDimension(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MeasuredLateralDimension, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getMeasuredLateralDimension(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, MeasuredLateralDimension).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getMedicalAlerts(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MedicalAlerts, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getModality(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getMostRecentTreatmentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(MostRecentTreatmentDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getNameOfPhysiciansReadingStudy(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(NameOfPhysiciansReadingStudy, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getOccupation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(Occupation, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getOperatorsName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OperatorsName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getOriginalSpecializedSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OriginalSpecializedSOPClassUID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getOtherPatientNames(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(OtherPatientNames, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientAge(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAge, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientAlternativeCalendar, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientBirthDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientBirthDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientBirthTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBirthTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientBodyMassIndex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBodyMassIndex, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientBodyMassIndex(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientBodyMassIndex).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientBreedDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientBreedDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientComments(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientComments, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientDeathDateInAlternativeCalendar(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientDeathDateInAlternativeCalendar, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientIdentityRemoved(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientIdentityRemoved, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientSex(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientSexNeutered(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSexNeutered, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientSize(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSize, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientSize(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientSize).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientSpeciesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientSpeciesDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientState(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientState, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientWeight(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PatientWeight, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPatientWeight(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, PatientWeight).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPerformedProcedureStepDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPerformedProcedureStepEndDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPerformedProcedureStepEndTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepEndTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPerformedProcedureStepID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPerformedProcedureStepStartDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPerformedProcedureStepStartTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PerformedProcedureStepStartTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPhysiciansOfRecord(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(PhysiciansOfRecord, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPixelPaddingValue(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PixelPaddingValue).getUint16(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getPregnancyStatus(Uint16 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmUnsignedShort &, PregnancyStatus).getUint16(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getQualityControlSubject(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QualityControlSubject, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getQueryRetrieveView(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(QueryRetrieveView, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getReferringPhysicianName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getRelatedGeneralSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(RelatedGeneralSOPClassUID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getResponsibleOrganization(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsibleOrganization, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getResponsiblePerson(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePerson, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getResponsiblePersonRole(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ResponsiblePersonRole, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSOPAuthorizationComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationComment, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSOPAuthorizationDateTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPAuthorizationDateTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSOPClassUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSOPInstanceStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceStatus, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSOPInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSeriesDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSeriesDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSeriesInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSeriesNumber(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSeriesNumber(Sint32 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmIntegerString &, SeriesNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSeriesTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getServiceEpisodeDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getServiceEpisodeID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(ServiceEpisodeID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSmokingStatus(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SmokingStatus, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSoftwareVersions(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSpatialResolution(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpatialResolution, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSpatialResolution(Float64 &value, const unsigned long pos) const +{ + return OFconst_cast(DcmDecimalString &, SpatialResolution).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getSpecificCharacterSet(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStationName(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StationName, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStrainAdditionalInformation(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainAdditionalInformation, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStrainDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStrainNomenclature(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StrainNomenclature, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStudyDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStudyDescription(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStudyID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStudyInstanceUID(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getStudyTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getTimeOfLastCalibration(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimeOfLastCalibration, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getTimezoneOffsetFromUTC(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getTreatmentDate(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentDate, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getTreatmentStatusComment(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentStatusComment, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::getTreatmentTime(OFString &value, const signed long pos) const +{ + return getStringValueFromElement(TreatmentTime, value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setAccessionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setAdditionalPatientHistory(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = AdditionalPatientHistory.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setAdmissionID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AdmissionID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setAdmittingDiagnosesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = AdmittingDiagnosesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setAllergies(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = Allergies.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setAuthorizationEquipmentCertificationNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AuthorizationEquipmentCertificationNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialCoordinatingCenterName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialCoordinatingCenterName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialProtocolEthicsCommitteeApprovalNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeApprovalNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialProtocolEthicsCommitteeName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolEthicsCommitteeName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialProtocolID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialProtocolName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialSeriesID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSeriesID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialSiteID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialSiteName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSiteName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialSponsorName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSponsorName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialSubjectID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialSubjectReadingID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialSubjectReadingID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialTimePointDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setClinicalTrialTimePointID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ClinicalTrialTimePointID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setCommentsOnThePerformedProcedureStep(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = CommentsOnThePerformedProcedureStep.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setConsultingPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = ConsultingPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setContentQualification(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentQualification.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setCurrentTreatmentStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CurrentTreatmentStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setDateOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DateOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setDeidentificationMethod(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = DeidentificationMethod.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setDerivationDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = DerivationDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setDeviceSerialNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setEthnicGroup(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EthnicGroup.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setFirstTreatmentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FirstTreatmentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setGantryID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstanceCoercionDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCoercionDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstanceCreationDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstanceCreationTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreationTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstanceCreatorUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceCreatorUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstanceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstitutionAddress(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = InstitutionAddress.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstitutionName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setInstitutionalDepartmentName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstitutionalDepartmentName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setIssuerOfPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setLastMenstrualDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LastMenstrualDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setLongitudinalTemporalEventType(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalEventType.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setLongitudinalTemporalInformationModified(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LongitudinalTemporalInformationModified.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setLongitudinalTemporalOffsetFromEvent(const Float64 value, const unsigned long pos) +{ + return LongitudinalTemporalOffsetFromEvent.putFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setManufacturer(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setManufacturerModelName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setMeasuredAPDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredAPDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setMeasuredLateralDimension(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MeasuredLateralDimension.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setMedicalAlerts(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = MedicalAlerts.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setModality(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Modality.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setMostRecentTreatmentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = MostRecentTreatmentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setNameOfPhysiciansReadingStudy(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = NameOfPhysiciansReadingStudy.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setOccupation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = Occupation.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setOperatorsName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OperatorsName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setOriginalSpecializedSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = OriginalSpecializedSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setOtherPatientNames(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = OtherPatientNames.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientAge(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmAgeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAge.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientBirthDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientBirthDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientBirthTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientBodyMassIndex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBodyMassIndex.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientBreedDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBreedDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientComments(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = PatientComments.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientDeathDateInAlternativeCalendar(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientDeathDateInAlternativeCalendar.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientIdentityRemoved(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientIdentityRemoved.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientSex(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientSexNeutered(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSexNeutered.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientSize(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSize.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientSpeciesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSpeciesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientState(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientState.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPatientWeight(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientWeight.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPerformedProcedureStepDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPerformedProcedureStepEndDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPerformedProcedureStepEndTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepEndTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPerformedProcedureStepID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPerformedProcedureStepStartDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPerformedProcedureStepStartTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PerformedProcedureStepStartTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPhysiciansOfRecord(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = PhysiciansOfRecord.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPixelPaddingValue(const Uint16 value, const unsigned long pos) +{ + return PixelPaddingValue.putUint16(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setPregnancyStatus(const Uint16 value, const unsigned long pos) +{ + return PregnancyStatus.putUint16(value, pos); +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setQualityControlSubject(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QualityControlSubject.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setQueryRetrieveView(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = QueryRetrieveView.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setReferringPhysicianName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setRelatedGeneralSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = RelatedGeneralSOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setResponsibleOrganization(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsibleOrganization.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setResponsiblePerson(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePerson.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setResponsiblePersonRole(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ResponsiblePersonRole.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSOPAuthorizationComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = SOPAuthorizationComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSOPAuthorizationDateTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDateTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPAuthorizationDateTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSOPClassUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPClassUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSOPInstanceStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSOPInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SOPInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSeriesDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSeriesDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSeriesInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSeriesNumber(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSeriesTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setServiceEpisodeDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setServiceEpisodeID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ServiceEpisodeID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSmokingStatus(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SmokingStatus.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSoftwareVersions(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSpatialResolution(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpatialResolution.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setSpecificCharacterSet(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = SpecificCharacterSet.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStationName(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StationName.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStrainAdditionalInformation(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = StrainAdditionalInformation.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStrainDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUnlimitedCharacters::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStrainNomenclature(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StrainNomenclature.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStudyDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStudyDescription(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStudyID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStudyInstanceUID(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyInstanceUID.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setStudyTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setTimeOfLastCalibration(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + result = TimeOfLastCalibration.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setTimezoneOffsetFromUTC(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setTreatmentDate(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentDate.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setTreatmentStatusComment(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = TreatmentStatusComment.putOFStringArray(value); + return result; +} + + +OFCondition DRTTreatmentSummaryRecordIOD::setTreatmentTime(const OFString &value, const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentTime.putOFStringArray(value); + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttscds.cc b/dcmrt/libsrc/drttscds.cc new file mode 100644 index 00000000..378b81bd --- /dev/null +++ b/dcmrt/libsrc/drttscds.cc @@ -0,0 +1,620 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTTreatmentSummaryCalculatedDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drttscds.h" + + +// --- item class --- + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CumulativeDoseToDoseReference(DCM_CumulativeDoseToDoseReference), + DoseReferenceDescription(DCM_DoseReferenceDescription), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CumulativeDoseToDoseReference(copy.CumulativeDoseToDoseReference), + DoseReferenceDescription(copy.DoseReferenceDescription), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::~Item() +{ +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item &DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CumulativeDoseToDoseReference = copy.CumulativeDoseToDoseReference; + DoseReferenceDescription = copy.DoseReferenceDescription; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + DoseReferenceDescription.clear(); + CumulativeDoseToDoseReference.clear(); + } +} + + +OFBool DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + DoseReferenceDescription.isEmpty() && + CumulativeDoseToDoseReference.isEmpty(); +} + + +OFBool DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "3", "TreatmentSummaryCalculatedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseReferenceDescription, "1", "3", "TreatmentSummaryCalculatedDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CumulativeDoseToDoseReference, "1", "1", "TreatmentSummaryCalculatedDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "3", "TreatmentSummaryCalculatedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmLongString(DoseReferenceDescription), "1", "3", "TreatmentSummaryCalculatedDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(CumulativeDoseToDoseReference), "1", "1", "TreatmentSummaryCalculatedDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::getCumulativeDoseToDoseReference(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeDoseToDoseReference, value, pos); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::getCumulativeDoseToDoseReference(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeDoseToDoseReference).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::getDoseReferenceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferenceDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::setCumulativeDoseToDoseReference(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeDoseToDoseReference.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::setDoseReferenceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseReferenceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::DRTTreatmentSummaryCalculatedDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::DRTTreatmentSummaryCalculatedDoseReferenceSequence(const DRTTreatmentSummaryCalculatedDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence &DRTTreatmentSummaryCalculatedDoseReferenceSequence::operator=(const DRTTreatmentSummaryCalculatedDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::~DRTTreatmentSummaryCalculatedDoseReferenceSequence() +{ + clear(); +} + + +void DRTTreatmentSummaryCalculatedDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTTreatmentSummaryCalculatedDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTTreatmentSummaryCalculatedDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTTreatmentSummaryCalculatedDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item &DRTTreatmentSummaryCalculatedDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item &DRTTreatmentSummaryCalculatedDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item &DRTTreatmentSummaryCalculatedDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item &DRTTreatmentSummaryCalculatedDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item &DRTTreatmentSummaryCalculatedDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTTreatmentSummaryCalculatedDoseReferenceSequence::Item &DRTTreatmentSummaryCalculatedDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_TreatmentSummaryCalculatedDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_TreatmentSummaryCalculatedDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTTreatmentSummaryCalculatedDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_TreatmentSummaryCalculatedDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttsibs.cc b/dcmrt/libsrc/drttsibs.cc new file mode 100644 index 00000000..88c839e2 --- /dev/null +++ b/dcmrt/libsrc/drttsibs.cc @@ -0,0 +1,1868 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTTreatmentSessionIonBeamSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drttsibs.h" + + +// --- item class --- + +DRTTreatmentSessionIonBeamSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ApplicatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamDescription(DCM_BeamDescription), + BeamLimitingDeviceLeafPairsSequence(emptyDefaultItem /*emptyDefaultSequence*/), + BeamName(DCM_BeamName), + BeamType(DCM_BeamType), + CurrentFractionNumber(DCM_CurrentFractionNumber), + DeliveredDepthDoseParametersSequence(emptyDefaultItem /*emptyDefaultSequence*/), + DeliveredPrimaryMeterset(DCM_DeliveredPrimaryMeterset), + DeliveredSecondaryMeterset(DCM_DeliveredSecondaryMeterset), + DeliveredTreatmentTime(DCM_DeliveredTreatmentTime), + FixationEye(DCM_FixationEye), + FixationLightAzimuthalAngle(DCM_FixationLightAzimuthalAngle), + FixationLightPolarAngle(DCM_FixationLightPolarAngle), + GeneralAccessorySequence(emptyDefaultItem /*emptyDefaultSequence*/), + IonControlPointDeliverySequence(emptyDefaultItem /*emptyDefaultSequence*/), + ModulatedScanModeType(DCM_ModulatedScanModeType), + NumberOfBlocks(DCM_NumberOfBlocks), + NumberOfBoli(DCM_NumberOfBoli), + NumberOfCompensators(DCM_NumberOfCompensators), + NumberOfControlPoints(DCM_NumberOfControlPoints), + NumberOfLateralSpreadingDevices(DCM_NumberOfLateralSpreadingDevices), + NumberOfRangeModulators(DCM_NumberOfRangeModulators), + NumberOfRangeShifters(DCM_NumberOfRangeShifters), + NumberOfWedges(DCM_NumberOfWedges), + PatientSupportAccessoryCode(DCM_PatientSupportAccessoryCode), + PatientSupportID(DCM_PatientSupportID), + PatientSupportType(DCM_PatientSupportType), + RadiationAtomicNumber(DCM_RadiationAtomicNumber), + RadiationChargeState(DCM_RadiationChargeState), + RadiationMassNumber(DCM_RadiationMassNumber), + RadiationType(DCM_RadiationType), + RecordedBlockSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RecordedCompensatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RecordedLateralSpreadingDeviceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RecordedRangeModulatorSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RecordedRangeShifterSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RecordedSnoutSequence(emptyDefaultItem /*emptyDefaultSequence*/), + RecordedWedgeSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedBeamNumber(DCM_ReferencedBeamNumber), + ReferencedBolusSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedCalculatedDoseReferenceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedMeasuredDoseReferenceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ReferencedPatientSetupNumber(DCM_ReferencedPatientSetupNumber), + ReferencedToleranceTableNumber(DCM_ReferencedToleranceTableNumber), + ReferencedVerificationImageSequence(emptyDefaultItem /*emptyDefaultSequence*/), + ScanMode(DCM_ScanMode), + SpecifiedPrimaryMeterset(DCM_SpecifiedPrimaryMeterset), + SpecifiedSecondaryMeterset(DCM_SpecifiedSecondaryMeterset), + SpecifiedTreatmentTime(DCM_SpecifiedTreatmentTime), + TreatmentDeliveryType(DCM_TreatmentDeliveryType), + TreatmentTerminationCode(DCM_TreatmentTerminationCode), + TreatmentTerminationStatus(DCM_TreatmentTerminationStatus), + TreatmentVerificationStatus(DCM_TreatmentVerificationStatus) +{ +} + + +DRTTreatmentSessionIonBeamSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ApplicatorSequence(copy.ApplicatorSequence), + BeamDescription(copy.BeamDescription), + BeamLimitingDeviceLeafPairsSequence(copy.BeamLimitingDeviceLeafPairsSequence), + BeamName(copy.BeamName), + BeamType(copy.BeamType), + CurrentFractionNumber(copy.CurrentFractionNumber), + DeliveredDepthDoseParametersSequence(copy.DeliveredDepthDoseParametersSequence), + DeliveredPrimaryMeterset(copy.DeliveredPrimaryMeterset), + DeliveredSecondaryMeterset(copy.DeliveredSecondaryMeterset), + DeliveredTreatmentTime(copy.DeliveredTreatmentTime), + FixationEye(copy.FixationEye), + FixationLightAzimuthalAngle(copy.FixationLightAzimuthalAngle), + FixationLightPolarAngle(copy.FixationLightPolarAngle), + GeneralAccessorySequence(copy.GeneralAccessorySequence), + IonControlPointDeliverySequence(copy.IonControlPointDeliverySequence), + ModulatedScanModeType(copy.ModulatedScanModeType), + NumberOfBlocks(copy.NumberOfBlocks), + NumberOfBoli(copy.NumberOfBoli), + NumberOfCompensators(copy.NumberOfCompensators), + NumberOfControlPoints(copy.NumberOfControlPoints), + NumberOfLateralSpreadingDevices(copy.NumberOfLateralSpreadingDevices), + NumberOfRangeModulators(copy.NumberOfRangeModulators), + NumberOfRangeShifters(copy.NumberOfRangeShifters), + NumberOfWedges(copy.NumberOfWedges), + PatientSupportAccessoryCode(copy.PatientSupportAccessoryCode), + PatientSupportID(copy.PatientSupportID), + PatientSupportType(copy.PatientSupportType), + RadiationAtomicNumber(copy.RadiationAtomicNumber), + RadiationChargeState(copy.RadiationChargeState), + RadiationMassNumber(copy.RadiationMassNumber), + RadiationType(copy.RadiationType), + RecordedBlockSequence(copy.RecordedBlockSequence), + RecordedCompensatorSequence(copy.RecordedCompensatorSequence), + RecordedLateralSpreadingDeviceSequence(copy.RecordedLateralSpreadingDeviceSequence), + RecordedRangeModulatorSequence(copy.RecordedRangeModulatorSequence), + RecordedRangeShifterSequence(copy.RecordedRangeShifterSequence), + RecordedSnoutSequence(copy.RecordedSnoutSequence), + RecordedWedgeSequence(copy.RecordedWedgeSequence), + ReferencedBeamNumber(copy.ReferencedBeamNumber), + ReferencedBolusSequence(copy.ReferencedBolusSequence), + ReferencedCalculatedDoseReferenceSequence(copy.ReferencedCalculatedDoseReferenceSequence), + ReferencedMeasuredDoseReferenceSequence(copy.ReferencedMeasuredDoseReferenceSequence), + ReferencedPatientSetupNumber(copy.ReferencedPatientSetupNumber), + ReferencedToleranceTableNumber(copy.ReferencedToleranceTableNumber), + ReferencedVerificationImageSequence(copy.ReferencedVerificationImageSequence), + ScanMode(copy.ScanMode), + SpecifiedPrimaryMeterset(copy.SpecifiedPrimaryMeterset), + SpecifiedSecondaryMeterset(copy.SpecifiedSecondaryMeterset), + SpecifiedTreatmentTime(copy.SpecifiedTreatmentTime), + TreatmentDeliveryType(copy.TreatmentDeliveryType), + TreatmentTerminationCode(copy.TreatmentTerminationCode), + TreatmentTerminationStatus(copy.TreatmentTerminationStatus), + TreatmentVerificationStatus(copy.TreatmentVerificationStatus) +{ +} + + +DRTTreatmentSessionIonBeamSequence::Item::~Item() +{ +} + + +DRTTreatmentSessionIonBeamSequence::Item &DRTTreatmentSessionIonBeamSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ApplicatorSequence = copy.ApplicatorSequence; + BeamDescription = copy.BeamDescription; + BeamLimitingDeviceLeafPairsSequence = copy.BeamLimitingDeviceLeafPairsSequence; + BeamName = copy.BeamName; + BeamType = copy.BeamType; + CurrentFractionNumber = copy.CurrentFractionNumber; + DeliveredDepthDoseParametersSequence = copy.DeliveredDepthDoseParametersSequence; + DeliveredPrimaryMeterset = copy.DeliveredPrimaryMeterset; + DeliveredSecondaryMeterset = copy.DeliveredSecondaryMeterset; + DeliveredTreatmentTime = copy.DeliveredTreatmentTime; + FixationEye = copy.FixationEye; + FixationLightAzimuthalAngle = copy.FixationLightAzimuthalAngle; + FixationLightPolarAngle = copy.FixationLightPolarAngle; + GeneralAccessorySequence = copy.GeneralAccessorySequence; + IonControlPointDeliverySequence = copy.IonControlPointDeliverySequence; + ModulatedScanModeType = copy.ModulatedScanModeType; + NumberOfBlocks = copy.NumberOfBlocks; + NumberOfBoli = copy.NumberOfBoli; + NumberOfCompensators = copy.NumberOfCompensators; + NumberOfControlPoints = copy.NumberOfControlPoints; + NumberOfLateralSpreadingDevices = copy.NumberOfLateralSpreadingDevices; + NumberOfRangeModulators = copy.NumberOfRangeModulators; + NumberOfRangeShifters = copy.NumberOfRangeShifters; + NumberOfWedges = copy.NumberOfWedges; + PatientSupportAccessoryCode = copy.PatientSupportAccessoryCode; + PatientSupportID = copy.PatientSupportID; + PatientSupportType = copy.PatientSupportType; + RadiationAtomicNumber = copy.RadiationAtomicNumber; + RadiationChargeState = copy.RadiationChargeState; + RadiationMassNumber = copy.RadiationMassNumber; + RadiationType = copy.RadiationType; + RecordedBlockSequence = copy.RecordedBlockSequence; + RecordedCompensatorSequence = copy.RecordedCompensatorSequence; + RecordedLateralSpreadingDeviceSequence = copy.RecordedLateralSpreadingDeviceSequence; + RecordedRangeModulatorSequence = copy.RecordedRangeModulatorSequence; + RecordedRangeShifterSequence = copy.RecordedRangeShifterSequence; + RecordedSnoutSequence = copy.RecordedSnoutSequence; + RecordedWedgeSequence = copy.RecordedWedgeSequence; + ReferencedBeamNumber = copy.ReferencedBeamNumber; + ReferencedBolusSequence = copy.ReferencedBolusSequence; + ReferencedCalculatedDoseReferenceSequence = copy.ReferencedCalculatedDoseReferenceSequence; + ReferencedMeasuredDoseReferenceSequence = copy.ReferencedMeasuredDoseReferenceSequence; + ReferencedPatientSetupNumber = copy.ReferencedPatientSetupNumber; + ReferencedToleranceTableNumber = copy.ReferencedToleranceTableNumber; + ReferencedVerificationImageSequence = copy.ReferencedVerificationImageSequence; + ScanMode = copy.ScanMode; + SpecifiedPrimaryMeterset = copy.SpecifiedPrimaryMeterset; + SpecifiedSecondaryMeterset = copy.SpecifiedSecondaryMeterset; + SpecifiedTreatmentTime = copy.SpecifiedTreatmentTime; + TreatmentDeliveryType = copy.TreatmentDeliveryType; + TreatmentTerminationCode = copy.TreatmentTerminationCode; + TreatmentTerminationStatus = copy.TreatmentTerminationStatus; + TreatmentVerificationStatus = copy.TreatmentVerificationStatus; + } + return *this; +} + + +void DRTTreatmentSessionIonBeamSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedBeamNumber.clear(); + BeamName.clear(); + BeamDescription.clear(); + BeamType.clear(); + RadiationType.clear(); + RadiationMassNumber.clear(); + RadiationAtomicNumber.clear(); + RadiationChargeState.clear(); + ScanMode.clear(); + ModulatedScanModeType.clear(); + ReferencedToleranceTableNumber.clear(); + BeamLimitingDeviceLeafPairsSequence.clear(); + ReferencedPatientSetupNumber.clear(); + ReferencedVerificationImageSequence.clear(); + ReferencedMeasuredDoseReferenceSequence.clear(); + ReferencedCalculatedDoseReferenceSequence.clear(); + NumberOfWedges.clear(); + RecordedWedgeSequence.clear(); + NumberOfCompensators.clear(); + RecordedCompensatorSequence.clear(); + NumberOfBoli.clear(); + ReferencedBolusSequence.clear(); + NumberOfBlocks.clear(); + RecordedBlockSequence.clear(); + RecordedSnoutSequence.clear(); + ApplicatorSequence.clear(); + GeneralAccessorySequence.clear(); + NumberOfRangeShifters.clear(); + RecordedRangeShifterSequence.clear(); + NumberOfLateralSpreadingDevices.clear(); + RecordedLateralSpreadingDeviceSequence.clear(); + NumberOfRangeModulators.clear(); + RecordedRangeModulatorSequence.clear(); + PatientSupportType.clear(); + PatientSupportID.clear(); + PatientSupportAccessoryCode.clear(); + FixationLightAzimuthalAngle.clear(); + FixationLightPolarAngle.clear(); + FixationEye.clear(); + CurrentFractionNumber.clear(); + TreatmentDeliveryType.clear(); + TreatmentTerminationStatus.clear(); + TreatmentTerminationCode.clear(); + TreatmentVerificationStatus.clear(); + SpecifiedPrimaryMeterset.clear(); + SpecifiedSecondaryMeterset.clear(); + DeliveredPrimaryMeterset.clear(); + DeliveredSecondaryMeterset.clear(); + SpecifiedTreatmentTime.clear(); + DeliveredTreatmentTime.clear(); + DeliveredDepthDoseParametersSequence.clear(); + NumberOfControlPoints.clear(); + IonControlPointDeliverySequence.clear(); + } +} + + +OFBool DRTTreatmentSessionIonBeamSequence::Item::isEmpty() +{ + return ReferencedBeamNumber.isEmpty() && + BeamName.isEmpty() && + BeamDescription.isEmpty() && + BeamType.isEmpty() && + RadiationType.isEmpty() && + RadiationMassNumber.isEmpty() && + RadiationAtomicNumber.isEmpty() && + RadiationChargeState.isEmpty() && + ScanMode.isEmpty() && + ModulatedScanModeType.isEmpty() && + ReferencedToleranceTableNumber.isEmpty() && + BeamLimitingDeviceLeafPairsSequence.isEmpty() && + ReferencedPatientSetupNumber.isEmpty() && + ReferencedVerificationImageSequence.isEmpty() && + ReferencedMeasuredDoseReferenceSequence.isEmpty() && + ReferencedCalculatedDoseReferenceSequence.isEmpty() && + NumberOfWedges.isEmpty() && + RecordedWedgeSequence.isEmpty() && + NumberOfCompensators.isEmpty() && + RecordedCompensatorSequence.isEmpty() && + NumberOfBoli.isEmpty() && + ReferencedBolusSequence.isEmpty() && + NumberOfBlocks.isEmpty() && + RecordedBlockSequence.isEmpty() && + RecordedSnoutSequence.isEmpty() && + ApplicatorSequence.isEmpty() && + GeneralAccessorySequence.isEmpty() && + NumberOfRangeShifters.isEmpty() && + RecordedRangeShifterSequence.isEmpty() && + NumberOfLateralSpreadingDevices.isEmpty() && + RecordedLateralSpreadingDeviceSequence.isEmpty() && + NumberOfRangeModulators.isEmpty() && + RecordedRangeModulatorSequence.isEmpty() && + PatientSupportType.isEmpty() && + PatientSupportID.isEmpty() && + PatientSupportAccessoryCode.isEmpty() && + FixationLightAzimuthalAngle.isEmpty() && + FixationLightPolarAngle.isEmpty() && + FixationEye.isEmpty() && + CurrentFractionNumber.isEmpty() && + TreatmentDeliveryType.isEmpty() && + TreatmentTerminationStatus.isEmpty() && + TreatmentTerminationCode.isEmpty() && + TreatmentVerificationStatus.isEmpty() && + SpecifiedPrimaryMeterset.isEmpty() && + SpecifiedSecondaryMeterset.isEmpty() && + DeliveredPrimaryMeterset.isEmpty() && + DeliveredSecondaryMeterset.isEmpty() && + SpecifiedTreatmentTime.isEmpty() && + DeliveredTreatmentTime.isEmpty() && + DeliveredDepthDoseParametersSequence.isEmpty() && + NumberOfControlPoints.isEmpty() && + IonControlPointDeliverySequence.isEmpty(); +} + + +OFBool DRTTreatmentSessionIonBeamSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedBeamNumber, "1", "1", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, BeamName, "1", "1", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, BeamDescription, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, BeamType, "1", "1", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationType, "1", "1", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationMassNumber, "1", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationAtomicNumber, "1", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, RadiationChargeState, "1", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, ScanMode, "1", "1", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, ModulatedScanModeType, "1", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, ReferencedToleranceTableNumber, "1", "3", "TreatmentSessionIonBeamSequence"); + BeamLimitingDeviceLeafPairsSequence.read(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, ReferencedPatientSetupNumber, "1", "3", "TreatmentSessionIonBeamSequence"); + ReferencedVerificationImageSequence.read(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + ReferencedMeasuredDoseReferenceSequence.read(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + ReferencedCalculatedDoseReferenceSequence.read(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfWedges, "1", "1", "TreatmentSessionIonBeamSequence"); + RecordedWedgeSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfCompensators, "1", "1", "TreatmentSessionIonBeamSequence"); + RecordedCompensatorSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfBoli, "1", "1", "TreatmentSessionIonBeamSequence"); + ReferencedBolusSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfBlocks, "1", "1", "TreatmentSessionIonBeamSequence"); + RecordedBlockSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + RecordedSnoutSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + ApplicatorSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + GeneralAccessorySequence.read(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfRangeShifters, "1", "1", "TreatmentSessionIonBeamSequence"); + RecordedRangeShifterSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfLateralSpreadingDevices, "1", "1", "TreatmentSessionIonBeamSequence"); + RecordedLateralSpreadingDeviceSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfRangeModulators, "1", "1", "TreatmentSessionIonBeamSequence"); + RecordedRangeModulatorSequence.read(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, PatientSupportType, "1", "1", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, PatientSupportID, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, PatientSupportAccessoryCode, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, FixationLightAzimuthalAngle, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, FixationLightPolarAngle, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, FixationEye, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, CurrentFractionNumber, "1", "2", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, TreatmentDeliveryType, "1", "2", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, TreatmentTerminationStatus, "1", "1", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, TreatmentTerminationCode, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, TreatmentVerificationStatus, "1", "2", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, SpecifiedPrimaryMeterset, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, SpecifiedSecondaryMeterset, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, DeliveredPrimaryMeterset, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, DeliveredSecondaryMeterset, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, SpecifiedTreatmentTime, "1", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, DeliveredTreatmentTime, "1", "3", "TreatmentSessionIonBeamSequence"); + DeliveredDepthDoseParametersSequence.read(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + getAndCheckElementFromDataset(item, NumberOfControlPoints, "1", "1", "TreatmentSessionIonBeamSequence"); + IonControlPointDeliverySequence.read(item, "1-n", "1", "TreatmentSessionIonBeamSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedBeamNumber), "1", "1", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(BeamName), "1", "1", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmShortText(BeamDescription), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(BeamType), "1", "1", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(RadiationType), "1", "1", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(RadiationMassNumber), "1", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(RadiationAtomicNumber), "1", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmSignedShort(RadiationChargeState), "1", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(ScanMode), "1", "1", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(ModulatedScanModeType), "1", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedToleranceTableNumber), "1", "3", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = BeamLimitingDeviceLeafPairsSequence.write(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(ReferencedPatientSetupNumber), "1", "3", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = ReferencedVerificationImageSequence.write(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = ReferencedMeasuredDoseReferenceSequence.write(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = ReferencedCalculatedDoseReferenceSequence.write(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfWedges), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = RecordedWedgeSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfCompensators), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = RecordedCompensatorSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBoli), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = ReferencedBolusSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfBlocks), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = RecordedBlockSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = RecordedSnoutSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = ApplicatorSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = GeneralAccessorySequence.write(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfRangeShifters), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = RecordedRangeShifterSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfLateralSpreadingDevices), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = RecordedLateralSpreadingDeviceSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfRangeModulators), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = RecordedRangeModulatorSequence.write(item, "1-n", "1C", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(PatientSupportType), "1", "1", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmShortString(PatientSupportID), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmLongString(PatientSupportAccessoryCode), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(FixationLightAzimuthalAngle), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(FixationLightPolarAngle), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(FixationEye), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(CurrentFractionNumber), "1", "2", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(TreatmentDeliveryType), "1", "2", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(TreatmentTerminationStatus), "1", "1", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmShortString(TreatmentTerminationCode), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmCodeString(TreatmentVerificationStatus), "1", "2", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(SpecifiedPrimaryMeterset), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(SpecifiedSecondaryMeterset), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveredPrimaryMeterset), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveredSecondaryMeterset), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(SpecifiedTreatmentTime), "1", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmDecimalString(DeliveredTreatmentTime), "1", "3", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = DeliveredDepthDoseParametersSequence.write(item, "1-n", "3", "TreatmentSessionIonBeamSequence"); + addElementToDataset(result, item, new DcmIntegerString(NumberOfControlPoints), "1", "1", "TreatmentSessionIonBeamSequence"); + if (result.good()) result = IonControlPointDeliverySequence.write(item, "1-n", "1", "TreatmentSessionIonBeamSequence"); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getBeamDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamDescription, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getBeamName(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamName, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getBeamType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamType, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getCurrentFractionNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CurrentFractionNumber, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getCurrentFractionNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, CurrentFractionNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getDeliveredPrimaryMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveredPrimaryMeterset, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getDeliveredPrimaryMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveredPrimaryMeterset).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getDeliveredSecondaryMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveredSecondaryMeterset, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getDeliveredSecondaryMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveredSecondaryMeterset).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getDeliveredTreatmentTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeliveredTreatmentTime, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getDeliveredTreatmentTime(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, DeliveredTreatmentTime).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getFixationEye(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(FixationEye, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getFixationLightAzimuthalAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, FixationLightAzimuthalAngle).getFloat32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getFixationLightPolarAngle(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, FixationLightPolarAngle).getFloat32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getModulatedScanModeType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ModulatedScanModeType, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfBlocks(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBlocks, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfBlocks(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBlocks).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfBoli(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfBoli, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfBoli(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfBoli).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfCompensators(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfCompensators, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfCompensators(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfCompensators).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfControlPoints(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfControlPoints, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfControlPoints(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfControlPoints).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfLateralSpreadingDevices(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfLateralSpreadingDevices, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfLateralSpreadingDevices(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfLateralSpreadingDevices).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfRangeModulators(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfRangeModulators, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfRangeModulators(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfRangeModulators).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfRangeShifters(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfRangeShifters, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfRangeShifters(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfRangeShifters).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfWedges(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(NumberOfWedges, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getNumberOfWedges(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, NumberOfWedges).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getPatientSupportAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAccessoryCode, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getPatientSupportID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportID, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getPatientSupportType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportType, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getRadiationAtomicNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RadiationAtomicNumber, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getRadiationAtomicNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, RadiationAtomicNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getRadiationChargeState(Sint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmSignedShort &, RadiationChargeState).getSint16(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getRadiationMassNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RadiationMassNumber, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getRadiationMassNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, RadiationMassNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getRadiationType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RadiationType, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getReferencedBeamNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedBeamNumber, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getReferencedBeamNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedBeamNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getReferencedPatientSetupNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedPatientSetupNumber, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getReferencedPatientSetupNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedPatientSetupNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getReferencedToleranceTableNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedToleranceTableNumber, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getReferencedToleranceTableNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedToleranceTableNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getScanMode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ScanMode, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getSpecifiedPrimaryMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SpecifiedPrimaryMeterset, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getSpecifiedPrimaryMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SpecifiedPrimaryMeterset).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getSpecifiedSecondaryMeterset(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SpecifiedSecondaryMeterset, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getSpecifiedSecondaryMeterset(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SpecifiedSecondaryMeterset).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getSpecifiedTreatmentTime(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SpecifiedTreatmentTime, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getSpecifiedTreatmentTime(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SpecifiedTreatmentTime).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getTreatmentDeliveryType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentDeliveryType, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getTreatmentTerminationCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentTerminationCode, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getTreatmentTerminationStatus(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentTerminationStatus, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::getTreatmentVerificationStatus(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TreatmentVerificationStatus, value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setBeamDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = BeamDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setBeamName(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamName.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setBeamType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setCurrentFractionNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CurrentFractionNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setDeliveredPrimaryMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveredPrimaryMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setDeliveredSecondaryMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveredSecondaryMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setDeliveredTreatmentTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeliveredTreatmentTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setFixationEye(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = FixationEye.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setFixationLightAzimuthalAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FixationLightAzimuthalAngle.putFloat32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setFixationLightPolarAngle(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return FixationLightPolarAngle.putFloat32(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setModulatedScanModeType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ModulatedScanModeType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfBlocks(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBlocks.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfBoli(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfBoli.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfCompensators(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfCompensators.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfControlPoints(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfControlPoints.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfLateralSpreadingDevices(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfLateralSpreadingDevices.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfRangeModulators(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfRangeModulators.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfRangeShifters(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfRangeShifters.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setNumberOfWedges(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = NumberOfWedges.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setPatientSupportAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setPatientSupportID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setPatientSupportType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setRadiationAtomicNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationAtomicNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setRadiationChargeState(const Sint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return RadiationChargeState.putSint16(value, pos); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setRadiationMassNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationMassNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setRadiationType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RadiationType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setReferencedBeamNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedBeamNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setReferencedPatientSetupNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedPatientSetupNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setReferencedToleranceTableNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedToleranceTableNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setScanMode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ScanMode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setSpecifiedPrimaryMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpecifiedPrimaryMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setSpecifiedSecondaryMeterset(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpecifiedSecondaryMeterset.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setSpecifiedTreatmentTime(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SpecifiedTreatmentTime.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setTreatmentDeliveryType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentDeliveryType.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setTreatmentTerminationCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentTerminationCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setTreatmentTerminationStatus(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentTerminationStatus.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::Item::setTreatmentVerificationStatus(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TreatmentVerificationStatus.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTTreatmentSessionIonBeamSequence::DRTTreatmentSessionIonBeamSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTTreatmentSessionIonBeamSequence::DRTTreatmentSessionIonBeamSequence(const DRTTreatmentSessionIonBeamSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTTreatmentSessionIonBeamSequence &DRTTreatmentSessionIonBeamSequence::operator=(const DRTTreatmentSessionIonBeamSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTTreatmentSessionIonBeamSequence::~DRTTreatmentSessionIonBeamSequence() +{ + clear(); +} + + +void DRTTreatmentSessionIonBeamSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTTreatmentSessionIonBeamSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTTreatmentSessionIonBeamSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTTreatmentSessionIonBeamSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTTreatmentSessionIonBeamSequence::Item &DRTTreatmentSessionIonBeamSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTTreatmentSessionIonBeamSequence::Item &DRTTreatmentSessionIonBeamSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTTreatmentSessionIonBeamSequence::Item &DRTTreatmentSessionIonBeamSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTTreatmentSessionIonBeamSequence::Item &DRTTreatmentSessionIonBeamSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTTreatmentSessionIonBeamSequence::Item &DRTTreatmentSessionIonBeamSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTTreatmentSessionIonBeamSequence::Item &DRTTreatmentSessionIonBeamSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_TreatmentSessionIonBeamSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_TreatmentSessionIonBeamSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTTreatmentSessionIonBeamSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_TreatmentSessionIonBeamSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttsmds.cc b/dcmrt/libsrc/drttsmds.cc new file mode 100644 index 00000000..f83deb73 --- /dev/null +++ b/dcmrt/libsrc/drttsmds.cc @@ -0,0 +1,620 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTTreatmentSummaryMeasuredDoseReferenceSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drttsmds.h" + + +// --- item class --- + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + CumulativeDoseToDoseReference(DCM_CumulativeDoseToDoseReference), + DoseReferenceDescription(DCM_DoseReferenceDescription), + ReferencedDoseReferenceNumber(DCM_ReferencedDoseReferenceNumber) +{ +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + CumulativeDoseToDoseReference(copy.CumulativeDoseToDoseReference), + DoseReferenceDescription(copy.DoseReferenceDescription), + ReferencedDoseReferenceNumber(copy.ReferencedDoseReferenceNumber) +{ +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::~Item() +{ +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item &DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + CumulativeDoseToDoseReference = copy.CumulativeDoseToDoseReference; + DoseReferenceDescription = copy.DoseReferenceDescription; + ReferencedDoseReferenceNumber = copy.ReferencedDoseReferenceNumber; + } + return *this; +} + + +void DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedDoseReferenceNumber.clear(); + DoseReferenceDescription.clear(); + CumulativeDoseToDoseReference.clear(); + } +} + + +OFBool DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::isEmpty() +{ + return ReferencedDoseReferenceNumber.isEmpty() && + DoseReferenceDescription.isEmpty() && + CumulativeDoseToDoseReference.isEmpty(); +} + + +OFBool DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedDoseReferenceNumber, "1", "3", "TreatmentSummaryMeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, DoseReferenceDescription, "1", "3", "TreatmentSummaryMeasuredDoseReferenceSequence"); + getAndCheckElementFromDataset(item, CumulativeDoseToDoseReference, "1", "1", "TreatmentSummaryMeasuredDoseReferenceSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedDoseReferenceNumber), "1", "3", "TreatmentSummaryMeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmLongString(DoseReferenceDescription), "1", "3", "TreatmentSummaryMeasuredDoseReferenceSequence"); + addElementToDataset(result, item, new DcmDecimalString(CumulativeDoseToDoseReference), "1", "1", "TreatmentSummaryMeasuredDoseReferenceSequence"); + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::getCumulativeDoseToDoseReference(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(CumulativeDoseToDoseReference, value, pos); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::getCumulativeDoseToDoseReference(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, CumulativeDoseToDoseReference).getFloat64(value, pos); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::getDoseReferenceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DoseReferenceDescription, value, pos); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedDoseReferenceNumber, value, pos); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::getReferencedDoseReferenceNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedDoseReferenceNumber).getSint32(value, pos); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::setCumulativeDoseToDoseReference(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = CumulativeDoseToDoseReference.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::setDoseReferenceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DoseReferenceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item::setReferencedDoseReferenceNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedDoseReferenceNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::DRTTreatmentSummaryMeasuredDoseReferenceSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::DRTTreatmentSummaryMeasuredDoseReferenceSequence(const DRTTreatmentSummaryMeasuredDoseReferenceSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence &DRTTreatmentSummaryMeasuredDoseReferenceSequence::operator=(const DRTTreatmentSummaryMeasuredDoseReferenceSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::~DRTTreatmentSummaryMeasuredDoseReferenceSequence() +{ + clear(); +} + + +void DRTTreatmentSummaryMeasuredDoseReferenceSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTTreatmentSummaryMeasuredDoseReferenceSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTTreatmentSummaryMeasuredDoseReferenceSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTTreatmentSummaryMeasuredDoseReferenceSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item &DRTTreatmentSummaryMeasuredDoseReferenceSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item &DRTTreatmentSummaryMeasuredDoseReferenceSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item &DRTTreatmentSummaryMeasuredDoseReferenceSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item &DRTTreatmentSummaryMeasuredDoseReferenceSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item &DRTTreatmentSummaryMeasuredDoseReferenceSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTTreatmentSummaryMeasuredDoseReferenceSequence::Item &DRTTreatmentSummaryMeasuredDoseReferenceSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_TreatmentSummaryMeasuredDoseReferenceSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_TreatmentSummaryMeasuredDoseReferenceSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTTreatmentSummaryMeasuredDoseReferenceSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_TreatmentSummaryMeasuredDoseReferenceSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttts.cc b/dcmrt/libsrc/drttts.cc new file mode 100644 index 00000000..96af4187 --- /dev/null +++ b/dcmrt/libsrc/drttts.cc @@ -0,0 +1,930 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTToleranceTableSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drttts.h" + + +// --- item class --- + +DRTToleranceTableSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + BeamLimitingDeviceAngleTolerance(DCM_BeamLimitingDeviceAngleTolerance), + BeamLimitingDeviceToleranceSequence(emptyDefaultItem /*emptyDefaultSequence*/), + GantryAngleTolerance(DCM_GantryAngleTolerance), + GantryPitchAngleTolerance(DCM_GantryPitchAngleTolerance), + PatientSupportAngleTolerance(DCM_PatientSupportAngleTolerance), + TableTopEccentricAngleTolerance(DCM_TableTopEccentricAngleTolerance), + TableTopLateralPositionTolerance(DCM_TableTopLateralPositionTolerance), + TableTopLongitudinalPositionTolerance(DCM_TableTopLongitudinalPositionTolerance), + TableTopPitchAngleTolerance(DCM_TableTopPitchAngleTolerance), + TableTopRollAngleTolerance(DCM_TableTopRollAngleTolerance), + TableTopVerticalPositionTolerance(DCM_TableTopVerticalPositionTolerance), + ToleranceTableLabel(DCM_ToleranceTableLabel), + ToleranceTableNumber(DCM_ToleranceTableNumber) +{ +} + + +DRTToleranceTableSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + BeamLimitingDeviceAngleTolerance(copy.BeamLimitingDeviceAngleTolerance), + BeamLimitingDeviceToleranceSequence(copy.BeamLimitingDeviceToleranceSequence), + GantryAngleTolerance(copy.GantryAngleTolerance), + GantryPitchAngleTolerance(copy.GantryPitchAngleTolerance), + PatientSupportAngleTolerance(copy.PatientSupportAngleTolerance), + TableTopEccentricAngleTolerance(copy.TableTopEccentricAngleTolerance), + TableTopLateralPositionTolerance(copy.TableTopLateralPositionTolerance), + TableTopLongitudinalPositionTolerance(copy.TableTopLongitudinalPositionTolerance), + TableTopPitchAngleTolerance(copy.TableTopPitchAngleTolerance), + TableTopRollAngleTolerance(copy.TableTopRollAngleTolerance), + TableTopVerticalPositionTolerance(copy.TableTopVerticalPositionTolerance), + ToleranceTableLabel(copy.ToleranceTableLabel), + ToleranceTableNumber(copy.ToleranceTableNumber) +{ +} + + +DRTToleranceTableSequence::Item::~Item() +{ +} + + +DRTToleranceTableSequence::Item &DRTToleranceTableSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + BeamLimitingDeviceAngleTolerance = copy.BeamLimitingDeviceAngleTolerance; + BeamLimitingDeviceToleranceSequence = copy.BeamLimitingDeviceToleranceSequence; + GantryAngleTolerance = copy.GantryAngleTolerance; + GantryPitchAngleTolerance = copy.GantryPitchAngleTolerance; + PatientSupportAngleTolerance = copy.PatientSupportAngleTolerance; + TableTopEccentricAngleTolerance = copy.TableTopEccentricAngleTolerance; + TableTopLateralPositionTolerance = copy.TableTopLateralPositionTolerance; + TableTopLongitudinalPositionTolerance = copy.TableTopLongitudinalPositionTolerance; + TableTopPitchAngleTolerance = copy.TableTopPitchAngleTolerance; + TableTopRollAngleTolerance = copy.TableTopRollAngleTolerance; + TableTopVerticalPositionTolerance = copy.TableTopVerticalPositionTolerance; + ToleranceTableLabel = copy.ToleranceTableLabel; + ToleranceTableNumber = copy.ToleranceTableNumber; + } + return *this; +} + + +void DRTToleranceTableSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ToleranceTableNumber.clear(); + ToleranceTableLabel.clear(); + GantryAngleTolerance.clear(); + GantryPitchAngleTolerance.clear(); + BeamLimitingDeviceAngleTolerance.clear(); + BeamLimitingDeviceToleranceSequence.clear(); + PatientSupportAngleTolerance.clear(); + TableTopEccentricAngleTolerance.clear(); + TableTopPitchAngleTolerance.clear(); + TableTopRollAngleTolerance.clear(); + TableTopVerticalPositionTolerance.clear(); + TableTopLongitudinalPositionTolerance.clear(); + TableTopLateralPositionTolerance.clear(); + } +} + + +OFBool DRTToleranceTableSequence::Item::isEmpty() +{ + return ToleranceTableNumber.isEmpty() && + ToleranceTableLabel.isEmpty() && + GantryAngleTolerance.isEmpty() && + GantryPitchAngleTolerance.isEmpty() && + BeamLimitingDeviceAngleTolerance.isEmpty() && + BeamLimitingDeviceToleranceSequence.isEmpty() && + PatientSupportAngleTolerance.isEmpty() && + TableTopEccentricAngleTolerance.isEmpty() && + TableTopPitchAngleTolerance.isEmpty() && + TableTopRollAngleTolerance.isEmpty() && + TableTopVerticalPositionTolerance.isEmpty() && + TableTopLongitudinalPositionTolerance.isEmpty() && + TableTopLateralPositionTolerance.isEmpty(); +} + + +OFBool DRTToleranceTableSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTToleranceTableSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ToleranceTableNumber, "1", "1", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, ToleranceTableLabel, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, GantryAngleTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, GantryPitchAngleTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, BeamLimitingDeviceAngleTolerance, "1", "3", "ToleranceTableSequence"); + BeamLimitingDeviceToleranceSequence.read(item, "1-n", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, PatientSupportAngleTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopEccentricAngleTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopPitchAngleTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopRollAngleTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopVerticalPositionTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopLongitudinalPositionTolerance, "1", "3", "ToleranceTableSequence"); + getAndCheckElementFromDataset(item, TableTopLateralPositionTolerance, "1", "3", "ToleranceTableSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ToleranceTableNumber), "1", "1", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmShortString(ToleranceTableLabel), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(GantryAngleTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(GantryPitchAngleTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(BeamLimitingDeviceAngleTolerance), "1", "3", "ToleranceTableSequence"); + if (result.good()) result = BeamLimitingDeviceToleranceSequence.write(item, "1-n", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(PatientSupportAngleTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopEccentricAngleTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopPitchAngleTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmFloatingPointSingle(TableTopRollAngleTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopVerticalPositionTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLongitudinalPositionTolerance), "1", "3", "ToleranceTableSequence"); + addElementToDataset(result, item, new DcmDecimalString(TableTopLateralPositionTolerance), "1", "3", "ToleranceTableSequence"); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::getBeamLimitingDeviceAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(BeamLimitingDeviceAngleTolerance, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getBeamLimitingDeviceAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, BeamLimitingDeviceAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getGantryAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(GantryAngleTolerance, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getGantryAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, GantryAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getGantryPitchAngleTolerance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, GantryPitchAngleTolerance).getFloat32(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getPatientSupportAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(PatientSupportAngleTolerance, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getPatientSupportAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, PatientSupportAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopEccentricAngleTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopEccentricAngleTolerance, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopEccentricAngleTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopEccentricAngleTolerance).getFloat64(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopLateralPositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLateralPositionTolerance, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopLateralPositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLateralPositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopLongitudinalPositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopLongitudinalPositionTolerance, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopLongitudinalPositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopLongitudinalPositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopPitchAngleTolerance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopPitchAngleTolerance).getFloat32(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopRollAngleTolerance(Float32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmFloatingPointSingle &, TableTopRollAngleTolerance).getFloat32(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopVerticalPositionTolerance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(TableTopVerticalPositionTolerance, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getTableTopVerticalPositionTolerance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, TableTopVerticalPositionTolerance).getFloat64(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getToleranceTableLabel(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ToleranceTableLabel, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getToleranceTableNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ToleranceTableNumber, value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::getToleranceTableNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ToleranceTableNumber).getSint32(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::setBeamLimitingDeviceAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = BeamLimitingDeviceAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setGantryAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = GantryAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setGantryPitchAngleTolerance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return GantryPitchAngleTolerance.putFloat32(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::setPatientSupportAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSupportAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setTableTopEccentricAngleTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopEccentricAngleTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setTableTopLateralPositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLateralPositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setTableTopLongitudinalPositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopLongitudinalPositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setTableTopPitchAngleTolerance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopPitchAngleTolerance.putFloat32(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::setTableTopRollAngleTolerance(const Float32 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return TableTopRollAngleTolerance.putFloat32(value, pos); +} + + +OFCondition DRTToleranceTableSequence::Item::setTableTopVerticalPositionTolerance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = TableTopVerticalPositionTolerance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setToleranceTableLabel(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ToleranceTableLabel.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::Item::setToleranceTableNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ToleranceTableNumber.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTToleranceTableSequence::DRTToleranceTableSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTToleranceTableSequence::DRTToleranceTableSequence(const DRTToleranceTableSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTToleranceTableSequence &DRTToleranceTableSequence::operator=(const DRTToleranceTableSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTToleranceTableSequence::~DRTToleranceTableSequence() +{ + clear(); +} + + +void DRTToleranceTableSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTToleranceTableSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTToleranceTableSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTToleranceTableSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTToleranceTableSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTToleranceTableSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTToleranceTableSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTToleranceTableSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTToleranceTableSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTToleranceTableSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTToleranceTableSequence::Item &DRTToleranceTableSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTToleranceTableSequence::Item &DRTToleranceTableSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTToleranceTableSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTToleranceTableSequence::Item &DRTToleranceTableSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTToleranceTableSequence::Item &DRTToleranceTableSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTToleranceTableSequence::Item &DRTToleranceTableSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTToleranceTableSequence::Item &DRTToleranceTableSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTToleranceTableSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTToleranceTableSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTToleranceTableSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTToleranceTableSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_ToleranceTableSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_ToleranceTableSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTToleranceTableSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_ToleranceTableSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drttypes.cc b/dcmrt/libsrc/drttypes.cc new file mode 100644 index 00000000..b98a8d30 --- /dev/null +++ b/dcmrt/libsrc/drttypes.cc @@ -0,0 +1,242 @@ +/* + * + * Copyright (c) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTTypes + * + * Generated manually based on dsrtypes.cc + * File created on 2008-12-05 + * Last modified on 2016-02-12 by Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmrt/drttypes.h" + +#include "dcmtk/ofstd/ofstd.h" + +#define INCLUDE_CSTDIO +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + + +/*------------------------* + * constant definitions * + *------------------------*/ + +// conditions +makeOFConditionConst(RT_EC_InvalidValue, OFM_dcmrt, 1, OF_error, "Invalid Value"); +makeOFConditionConst(RT_EC_UnsupportedValue, OFM_dcmrt, 2, OF_error, "Unsupported Value"); +makeOFConditionConst(RT_EC_InvalidObject, OFM_dcmrt, 3, OF_error, "Invalid Object"); +// error code 4 is reserved for medium-level API error messages + + +/*--------------------* + * global variables * + *--------------------*/ + +OFLogger DCM_dcmrtLogger = OFLog::getLogger("dcmtk.dcmrt"); + + +/*------------------* + * implementation * + *------------------*/ + +DRTTypes::~DRTTypes() +{ +} + + +OFCondition DRTTypes::addElementToDataset(OFCondition &result, + DcmItem &dataset, + DcmElement *element, + const OFString &vm, + const OFString &type, + const char *moduleName) +{ + if (element != NULL) + { + OFBool triedToInsert = OFFalse; + if (result.good()) + { + if ((type == "2") || !element->isEmpty()) + { + triedToInsert = OFTrue; + /* insert non-empty element or empty "type 2" element */ + result = dataset.insert(element, OFTrue /*replaceOld*/); + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*element, vm, type, result, moduleName); + } + else if (type == "1") + { + /* empty element value not allowed for "type 1" */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*element, vm, type, result, moduleName); + } + } + /* delete element if not inserted into the dataset */ + if (result.bad() || !triedToInsert) + delete element; + } else + result = EC_MemoryExhausted; + return result; +} + + +OFCondition DRTTypes::getElementFromDataset(DcmItem &dataset, + DcmElement &element) +{ + DcmStack stack; + OFCondition result = dataset.search(element.getTag(), stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + if (result.good()) + { + /* copy object from search stack */ + result = element.copyFrom(*stack.top()); + } + if (result.bad()) + element.clear(); + return result; +} + + +OFCondition DRTTypes::getStringValueFromElement(const DcmElement &element, + OFString &stringValue, + const signed long pos) +{ + OFCondition result = EC_Normal; + if (pos < 0) + result = OFconst_cast(DcmElement &, element).getOFStringArray(stringValue); + else + result = OFconst_cast(DcmElement &, element).getOFString(stringValue, OFstatic_cast(unsigned long, pos)); + if (result.bad()) + stringValue.clear(); + return result; +} + + +OFCondition DRTTypes::getStringValueFromDataset(DcmItem &dataset, + const DcmTagKey &tagKey, + OFString &stringValue) +{ + return dataset.findAndGetOFString(tagKey, stringValue, 0, OFFalse /*searchIntoSub*/); +} + + +OFCondition DRTTypes::putStringValueToDataset(DcmItem &dataset, + const DcmTag &tag, + const OFString &stringValue, + const OFBool allowEmpty) +{ + OFCondition result = EC_Normal; + if (allowEmpty || !stringValue.empty()) + result = dataset.putAndInsertOFStringArray(tag, stringValue, OFTrue /*replaceOld*/); + return result; +} + + +OFBool DRTTypes::checkElementValue(DcmElement &element, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond, + const char *moduleName) +{ + OFBool result = OFTrue; + DcmTag tag = element.getTag(); + const OFString tagName = tag.getTagName(); + const OFString module = (moduleName == NULL) ? "RT object" : moduleName; + /* NB: type 1C and 2C cannot be checked, assuming to be optional = type 3 */ + if (((type == "1") || (type == "2")) && searchCond.bad()) + { + DCMRT_WARN(tagName << " " << tag << " absent in " << module << " (type " << type << ")"); + result = OFFalse; + } + else if (element.isEmpty(OFTrue /*normalize*/)) + { + /* however, type 1C should never be present with empty value */ + if (((type == "1") || (type == "1C")) && searchCond.good()) + { + DCMRT_WARN(tagName << " " << tag << " empty in " << module << " (type " << type << ")"); + result = OFFalse; + } + } else { + const OFCondition checkResult = element.checkValue(vm, OFTrue /*oldFormat*/); + if (checkResult == EC_InvalidCharacter) + { + DCMRT_WARN(tagName << " " << tag << " contains invalid character(s) in " << module); + result = OFFalse; + } + else if (checkResult == EC_ValueRepresentationViolated) + { + DCMRT_WARN(tagName << " " << tag << " violates VR definition in " << module); + result = OFFalse; + } + else if (checkResult == EC_ValueMultiplicityViolated) + { + const OFString vmText = (element.getVR() == EVR_SQ) ? " #items" : " VM"; + DCMRT_WARN(tagName << " " << tag << vmText << " != " << vm << " in " << module); + result = OFFalse; + } + else if (checkResult == EC_MaximumLengthViolated) + { + DCMRT_WARN(tagName << " " << tag << " violates maximum VR length in " << module); + result = OFFalse; + } + else if (checkResult.bad()) + { + DCMRT_DEBUG("INTERNAL ERROR while checking value of " << tagName << " " << tag << " in " << module); + } + } + return result; +} + + +OFCondition DRTTypes::getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement &element, + const OFString &vm, + const OFString &type, + const char *moduleName) +{ + OFCondition result = getElementFromDataset(dataset, element); + if (!checkElementValue(element, vm, type, result, moduleName)) + result = RT_EC_InvalidValue; + return result; +} + + +OFCondition DRTTypes::getAndCheckStringValueFromDataset(DcmItem &dataset, + const DcmTagKey &tagKey, + OFString &stringValue, + const OFString &vm, + const OFString &type, + const char *moduleName) +{ + DcmStack stack; + OFCondition result = dataset.search(tagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); + if (result.good()) + { + DcmElement *element = OFstatic_cast(DcmElement *, stack.top()); + if (element != NULL) + { + if (checkElementValue(*element, vm, type, result, moduleName)) + result = element->getOFString(stringValue, 0); + else + result = RT_EC_InvalidValue; + } else + result = EC_CorruptedData; + } else { + if ((type == "1") || (type == "2")) + { + const OFString tagName = DcmTag(tagKey).getTagName(); + const OFString module = (moduleName == NULL) ? "RT object" : moduleName; + DCMRT_WARN(tagName << " " << tagKey << " absent in " << module << " (type " << type << ")"); + } + } + if (result.bad()) + stringValue.clear(); + return result; +} diff --git a/dcmrt/libsrc/drtudis.cc b/dcmrt/libsrc/drtudis.cc new file mode 100644 index 00000000..b6451398 --- /dev/null +++ b/dcmrt/libsrc/drtudis.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTUDISequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtudis.h" + + +// --- item class --- + +DRTUDISequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + DeviceDescription(DCM_DeviceDescription), + UniqueDeviceIdentifier(DCM_UniqueDeviceIdentifier) +{ +} + + +DRTUDISequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + DeviceDescription(copy.DeviceDescription), + UniqueDeviceIdentifier(copy.UniqueDeviceIdentifier) +{ +} + + +DRTUDISequence::Item::~Item() +{ +} + + +DRTUDISequence::Item &DRTUDISequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + DeviceDescription = copy.DeviceDescription; + UniqueDeviceIdentifier = copy.UniqueDeviceIdentifier; + } + return *this; +} + + +void DRTUDISequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + UniqueDeviceIdentifier.clear(); + DeviceDescription.clear(); + } +} + + +OFBool DRTUDISequence::Item::isEmpty() +{ + return UniqueDeviceIdentifier.isEmpty() && + DeviceDescription.isEmpty(); +} + + +OFBool DRTUDISequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTUDISequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, UniqueDeviceIdentifier, "1", "1", "UDISequence"); + getAndCheckElementFromDataset(item, DeviceDescription, "1", "3", "UDISequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTUDISequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnlimitedText(UniqueDeviceIdentifier), "1", "1", "UDISequence"); + addElementToDataset(result, item, new DcmLongString(DeviceDescription), "1", "3", "UDISequence"); + } + return result; +} + + +OFCondition DRTUDISequence::Item::getDeviceDescription(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(DeviceDescription, value, pos); +} + + +OFCondition DRTUDISequence::Item::getUniqueDeviceIdentifier(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(UniqueDeviceIdentifier, value, pos); +} + + +OFCondition DRTUDISequence::Item::setDeviceDescription(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = DeviceDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTUDISequence::Item::setUniqueDeviceIdentifier(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUnlimitedText::checkStringValue(value) : EC_Normal; + if (result.good()) + result = UniqueDeviceIdentifier.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTUDISequence::DRTUDISequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTUDISequence::DRTUDISequence(const DRTUDISequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTUDISequence &DRTUDISequence::operator=(const DRTUDISequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTUDISequence::~DRTUDISequence() +{ + clear(); +} + + +void DRTUDISequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTUDISequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTUDISequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTUDISequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTUDISequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTUDISequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTUDISequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTUDISequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTUDISequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTUDISequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTUDISequence::Item &DRTUDISequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTUDISequence::Item &DRTUDISequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTUDISequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTUDISequence::Item &DRTUDISequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTUDISequence::Item &DRTUDISequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTUDISequence::Item &DRTUDISequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTUDISequence::Item &DRTUDISequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTUDISequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTUDISequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTUDISequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTUDISequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_UDISequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_UDISequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTUDISequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_UDISequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtvls.cc b/dcmrt/libsrc/drtvls.cc new file mode 100644 index 00000000..f9b291b5 --- /dev/null +++ b/dcmrt/libsrc/drtvls.cc @@ -0,0 +1,604 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTVOILUTSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtvls.h" + + +// --- item class --- + +DRTVOILUTSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + LUTData(DCM_LUTData), + LUTDescriptor(DCM_LUTDescriptor), + LUTExplanation(DCM_LUTExplanation) +{ +} + + +DRTVOILUTSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + LUTData(copy.LUTData), + LUTDescriptor(copy.LUTDescriptor), + LUTExplanation(copy.LUTExplanation) +{ +} + + +DRTVOILUTSequence::Item::~Item() +{ +} + + +DRTVOILUTSequence::Item &DRTVOILUTSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + LUTData = copy.LUTData; + LUTDescriptor = copy.LUTDescriptor; + LUTExplanation = copy.LUTExplanation; + } + return *this; +} + + +void DRTVOILUTSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + LUTDescriptor.clear(); + LUTExplanation.clear(); + LUTData.clear(); + } +} + + +OFBool DRTVOILUTSequence::Item::isEmpty() +{ + return LUTDescriptor.isEmpty() && + LUTExplanation.isEmpty() && + LUTData.isEmpty(); +} + + +OFBool DRTVOILUTSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTVOILUTSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, LUTDescriptor, "3", "1", "VOILUTSequence"); + getAndCheckElementFromDataset(item, LUTExplanation, "1", "3", "VOILUTSequence"); + getAndCheckElementFromDataset(item, LUTData, "1-n", "1", "VOILUTSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTVOILUTSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUnsignedShort(LUTDescriptor), "3", "1", "VOILUTSequence"); + addElementToDataset(result, item, new DcmLongString(LUTExplanation), "1", "3", "VOILUTSequence"); + addElementToDataset(result, item, new DcmOtherByteOtherWord(LUTData), "1-n", "1", "VOILUTSequence"); + } + return result; +} + + +OFCondition DRTVOILUTSequence::Item::getLUTData(Uint16 *&value, unsigned long *count) const +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = OFconst_cast(DcmOtherByteOtherWord &, LUTData).getUint16Array(value); + /* set optional count parameter */ + if (count != NULL) + { + if (result.good()) + *count = OFconst_cast(DcmOtherByteOtherWord &, LUTData).getLength() / sizeof(Uint16); + else + *count = 0; + } + } + return result; +} + + +OFCondition DRTVOILUTSequence::Item::getLUTDescriptor(Uint16 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmUnsignedShort &, LUTDescriptor).getUint16(value, pos); +} + + +OFCondition DRTVOILUTSequence::Item::getLUTExplanation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(LUTExplanation, value, pos); +} + + +OFCondition DRTVOILUTSequence::Item::setLUTData(const Uint16 *value, const unsigned long count) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return LUTData.putUint16Array(value, count); +} + + +OFCondition DRTVOILUTSequence::Item::setLUTDescriptor(const Uint16 value, const unsigned long pos) +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return LUTDescriptor.putUint16(value, pos); +} + + +OFCondition DRTVOILUTSequence::Item::setLUTExplanation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = LUTExplanation.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTVOILUTSequence::DRTVOILUTSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTVOILUTSequence::DRTVOILUTSequence(const DRTVOILUTSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTVOILUTSequence &DRTVOILUTSequence::operator=(const DRTVOILUTSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTVOILUTSequence::~DRTVOILUTSequence() +{ + clear(); +} + + +void DRTVOILUTSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTVOILUTSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTVOILUTSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTVOILUTSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTVOILUTSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTVOILUTSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTVOILUTSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTVOILUTSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTVOILUTSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTVOILUTSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTVOILUTSequence::Item &DRTVOILUTSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTVOILUTSequence::Item &DRTVOILUTSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTVOILUTSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTVOILUTSequence::Item &DRTVOILUTSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTVOILUTSequence::Item &DRTVOILUTSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTVOILUTSequence::Item &DRTVOILUTSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTVOILUTSequence::Item &DRTVOILUTSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTVOILUTSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTVOILUTSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTVOILUTSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTVOILUTSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_VOILUTSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_VOILUTSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTVOILUTSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_VOILUTSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtwps.cc b/dcmrt/libsrc/drtwps.cc new file mode 100644 index 00000000..fdd3185c --- /dev/null +++ b/dcmrt/libsrc/drtwps.cc @@ -0,0 +1,582 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTWedgePositionSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtwps.h" + + +// --- item class --- + +DRTWedgePositionSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + ReferencedWedgeNumber(DCM_ReferencedWedgeNumber), + WedgePosition(DCM_WedgePosition) +{ +} + + +DRTWedgePositionSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + ReferencedWedgeNumber(copy.ReferencedWedgeNumber), + WedgePosition(copy.WedgePosition) +{ +} + + +DRTWedgePositionSequence::Item::~Item() +{ +} + + +DRTWedgePositionSequence::Item &DRTWedgePositionSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + ReferencedWedgeNumber = copy.ReferencedWedgeNumber; + WedgePosition = copy.WedgePosition; + } + return *this; +} + + +void DRTWedgePositionSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + ReferencedWedgeNumber.clear(); + WedgePosition.clear(); + } +} + + +OFBool DRTWedgePositionSequence::Item::isEmpty() +{ + return ReferencedWedgeNumber.isEmpty() && + WedgePosition.isEmpty(); +} + + +OFBool DRTWedgePositionSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTWedgePositionSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, ReferencedWedgeNumber, "1", "1", "WedgePositionSequence"); + getAndCheckElementFromDataset(item, WedgePosition, "1", "1", "WedgePositionSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWedgePositionSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(ReferencedWedgeNumber), "1", "1", "WedgePositionSequence"); + addElementToDataset(result, item, new DcmCodeString(WedgePosition), "1", "1", "WedgePositionSequence"); + } + return result; +} + + +OFCondition DRTWedgePositionSequence::Item::getReferencedWedgeNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(ReferencedWedgeNumber, value, pos); +} + + +OFCondition DRTWedgePositionSequence::Item::getReferencedWedgeNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, ReferencedWedgeNumber).getSint32(value, pos); +} + + +OFCondition DRTWedgePositionSequence::Item::getWedgePosition(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgePosition, value, pos); +} + + +OFCondition DRTWedgePositionSequence::Item::setReferencedWedgeNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ReferencedWedgeNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgePositionSequence::Item::setWedgePosition(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgePosition.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTWedgePositionSequence::DRTWedgePositionSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTWedgePositionSequence::DRTWedgePositionSequence(const DRTWedgePositionSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTWedgePositionSequence &DRTWedgePositionSequence::operator=(const DRTWedgePositionSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTWedgePositionSequence::~DRTWedgePositionSequence() +{ + clear(); +} + + +void DRTWedgePositionSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTWedgePositionSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTWedgePositionSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTWedgePositionSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTWedgePositionSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWedgePositionSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWedgePositionSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWedgePositionSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWedgePositionSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTWedgePositionSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTWedgePositionSequence::Item &DRTWedgePositionSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTWedgePositionSequence::Item &DRTWedgePositionSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTWedgePositionSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTWedgePositionSequence::Item &DRTWedgePositionSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTWedgePositionSequence::Item &DRTWedgePositionSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTWedgePositionSequence::Item &DRTWedgePositionSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTWedgePositionSequence::Item &DRTWedgePositionSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTWedgePositionSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTWedgePositionSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTWedgePositionSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWedgePositionSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_WedgePositionSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_WedgePositionSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTWedgePositionSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_WedgePositionSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtwrs.cc b/dcmrt/libsrc/drtwrs.cc new file mode 100644 index 00000000..4c295e98 --- /dev/null +++ b/dcmrt/libsrc/drtwrs.cc @@ -0,0 +1,544 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTWADORetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtwrs.h" + + +// --- item class --- + +DRTWADORetrievalSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RetrieveURI(DCM_RetrieveURI) +{ +} + + +DRTWADORetrievalSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RetrieveURI(copy.RetrieveURI) +{ +} + + +DRTWADORetrievalSequence::Item::~Item() +{ +} + + +DRTWADORetrievalSequence::Item &DRTWADORetrievalSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RetrieveURI = copy.RetrieveURI; + } + return *this; +} + + +void DRTWADORetrievalSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RetrieveURI.clear(); + } +} + + +OFBool DRTWADORetrievalSequence::Item::isEmpty() +{ + return RetrieveURI.isEmpty(); +} + + +OFBool DRTWADORetrievalSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTWADORetrievalSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RetrieveURI, "1", "1", "WADORetrievalSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(RetrieveURI), "1", "1", "WADORetrievalSequence"); + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::Item::getRetrieveURI(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RetrieveURI, value, pos); +} + + +OFCondition DRTWADORetrievalSequence::Item::setRetrieveURI(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RetrieveURI.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTWADORetrievalSequence::DRTWADORetrievalSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTWADORetrievalSequence::DRTWADORetrievalSequence(const DRTWADORetrievalSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTWADORetrievalSequence &DRTWADORetrievalSequence::operator=(const DRTWADORetrievalSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTWADORetrievalSequence::~DRTWADORetrievalSequence() +{ + clear(); +} + + +void DRTWADORetrievalSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTWADORetrievalSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTWADORetrievalSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTWADORetrievalSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTWADORetrievalSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTWADORetrievalSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTWADORetrievalSequence::Item &DRTWADORetrievalSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTWADORetrievalSequence::Item &DRTWADORetrievalSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTWADORetrievalSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTWADORetrievalSequence::Item &DRTWADORetrievalSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTWADORetrievalSequence::Item &DRTWADORetrievalSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTWADORetrievalSequence::Item &DRTWADORetrievalSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTWADORetrievalSequence::Item &DRTWADORetrievalSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTWADORetrievalSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_WADORetrievalSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_WADORetrievalSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTWADORetrievalSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_WADORetrievalSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtwrsrs.cc b/dcmrt/libsrc/drtwrsrs.cc new file mode 100644 index 00000000..e684b681 --- /dev/null +++ b/dcmrt/libsrc/drtwrsrs.cc @@ -0,0 +1,544 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTWADORSRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtwrsrs.h" + + +// --- item class --- + +DRTWADORSRetrievalSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + RetrieveURL(DCM_RetrieveURL) +{ +} + + +DRTWADORSRetrievalSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + RetrieveURL(copy.RetrieveURL) +{ +} + + +DRTWADORSRetrievalSequence::Item::~Item() +{ +} + + +DRTWADORSRetrievalSequence::Item &DRTWADORSRetrievalSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + RetrieveURL = copy.RetrieveURL; + } + return *this; +} + + +void DRTWADORSRetrievalSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RetrieveURL.clear(); + } +} + + +OFBool DRTWADORSRetrievalSequence::Item::isEmpty() +{ + return RetrieveURL.isEmpty(); +} + + +OFBool DRTWADORSRetrievalSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTWADORSRetrievalSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RetrieveURL, "1", "1", "WADORSRetrievalSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniversalResourceIdentifierOrLocator(RetrieveURL), "1", "1", "WADORSRetrievalSequence"); + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::Item::getRetrieveURL(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RetrieveURL, value, pos); +} + + +OFCondition DRTWADORSRetrievalSequence::Item::setRetrieveURL(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniversalResourceIdentifierOrLocator::checkStringValue(value) : EC_Normal; + if (result.good()) + result = RetrieveURL.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTWADORSRetrievalSequence::DRTWADORSRetrievalSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTWADORSRetrievalSequence::DRTWADORSRetrievalSequence(const DRTWADORSRetrievalSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTWADORSRetrievalSequence &DRTWADORSRetrievalSequence::operator=(const DRTWADORSRetrievalSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTWADORSRetrievalSequence::~DRTWADORSRetrievalSequence() +{ + clear(); +} + + +void DRTWADORSRetrievalSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTWADORSRetrievalSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTWADORSRetrievalSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTWADORSRetrievalSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTWADORSRetrievalSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTWADORSRetrievalSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTWADORSRetrievalSequence::Item &DRTWADORSRetrievalSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTWADORSRetrievalSequence::Item &DRTWADORSRetrievalSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTWADORSRetrievalSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTWADORSRetrievalSequence::Item &DRTWADORSRetrievalSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTWADORSRetrievalSequence::Item &DRTWADORSRetrievalSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTWADORSRetrievalSequence::Item &DRTWADORSRetrievalSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTWADORSRetrievalSequence::Item &DRTWADORSRetrievalSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTWADORSRetrievalSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_WADORSRetrievalSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_WADORSRetrievalSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTWADORSRetrievalSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_WADORSRetrievalSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtws.cc b/dcmrt/libsrc/drtws.cc new file mode 100644 index 00000000..b3b19da0 --- /dev/null +++ b/dcmrt/libsrc/drtws.cc @@ -0,0 +1,830 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTWedgeSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtws.h" + + +// --- item class --- + +DRTWedgeSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + AccessoryCode(DCM_AccessoryCode), + EffectiveWedgeAngle(DCM_EffectiveWedgeAngle), + SourceToWedgeTrayDistance(DCM_SourceToWedgeTrayDistance), + WedgeAngle(DCM_WedgeAngle), + WedgeFactor(DCM_WedgeFactor), + WedgeID(DCM_WedgeID), + WedgeNumber(DCM_WedgeNumber), + WedgeOrientation(DCM_WedgeOrientation), + WedgeType(DCM_WedgeType) +{ +} + + +DRTWedgeSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + AccessoryCode(copy.AccessoryCode), + EffectiveWedgeAngle(copy.EffectiveWedgeAngle), + SourceToWedgeTrayDistance(copy.SourceToWedgeTrayDistance), + WedgeAngle(copy.WedgeAngle), + WedgeFactor(copy.WedgeFactor), + WedgeID(copy.WedgeID), + WedgeNumber(copy.WedgeNumber), + WedgeOrientation(copy.WedgeOrientation), + WedgeType(copy.WedgeType) +{ +} + + +DRTWedgeSequence::Item::~Item() +{ +} + + +DRTWedgeSequence::Item &DRTWedgeSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + AccessoryCode = copy.AccessoryCode; + EffectiveWedgeAngle = copy.EffectiveWedgeAngle; + SourceToWedgeTrayDistance = copy.SourceToWedgeTrayDistance; + WedgeAngle = copy.WedgeAngle; + WedgeFactor = copy.WedgeFactor; + WedgeID = copy.WedgeID; + WedgeNumber = copy.WedgeNumber; + WedgeOrientation = copy.WedgeOrientation; + WedgeType = copy.WedgeType; + } + return *this; +} + + +void DRTWedgeSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + WedgeNumber.clear(); + WedgeType.clear(); + WedgeID.clear(); + AccessoryCode.clear(); + WedgeAngle.clear(); + WedgeFactor.clear(); + WedgeOrientation.clear(); + SourceToWedgeTrayDistance.clear(); + EffectiveWedgeAngle.clear(); + } +} + + +OFBool DRTWedgeSequence::Item::isEmpty() +{ + return WedgeNumber.isEmpty() && + WedgeType.isEmpty() && + WedgeID.isEmpty() && + AccessoryCode.isEmpty() && + WedgeAngle.isEmpty() && + WedgeFactor.isEmpty() && + WedgeOrientation.isEmpty() && + SourceToWedgeTrayDistance.isEmpty() && + EffectiveWedgeAngle.isEmpty(); +} + + +OFBool DRTWedgeSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTWedgeSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, WedgeNumber, "1", "1", "WedgeSequence"); + getAndCheckElementFromDataset(item, WedgeType, "1", "2", "WedgeSequence"); + getAndCheckElementFromDataset(item, WedgeID, "1", "3", "WedgeSequence"); + getAndCheckElementFromDataset(item, AccessoryCode, "1", "3", "WedgeSequence"); + getAndCheckElementFromDataset(item, WedgeAngle, "1", "2", "WedgeSequence"); + getAndCheckElementFromDataset(item, WedgeFactor, "1", "2", "WedgeSequence"); + getAndCheckElementFromDataset(item, WedgeOrientation, "1", "2", "WedgeSequence"); + getAndCheckElementFromDataset(item, SourceToWedgeTrayDistance, "1", "3", "WedgeSequence"); + getAndCheckElementFromDataset(item, EffectiveWedgeAngle, "1", "3", "WedgeSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmIntegerString(WedgeNumber), "1", "1", "WedgeSequence"); + addElementToDataset(result, item, new DcmCodeString(WedgeType), "1", "2", "WedgeSequence"); + addElementToDataset(result, item, new DcmShortString(WedgeID), "1", "3", "WedgeSequence"); + addElementToDataset(result, item, new DcmLongString(AccessoryCode), "1", "3", "WedgeSequence"); + addElementToDataset(result, item, new DcmIntegerString(WedgeAngle), "1", "2", "WedgeSequence"); + addElementToDataset(result, item, new DcmDecimalString(WedgeFactor), "1", "2", "WedgeSequence"); + addElementToDataset(result, item, new DcmDecimalString(WedgeOrientation), "1", "2", "WedgeSequence"); + addElementToDataset(result, item, new DcmDecimalString(SourceToWedgeTrayDistance), "1", "3", "WedgeSequence"); + addElementToDataset(result, item, new DcmDecimalString(EffectiveWedgeAngle), "1", "3", "WedgeSequence"); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::getAccessoryCode(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(AccessoryCode, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getEffectiveWedgeAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(EffectiveWedgeAngle, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getEffectiveWedgeAngle(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, EffectiveWedgeAngle).getFloat64(value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getSourceToWedgeTrayDistance(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(SourceToWedgeTrayDistance, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getSourceToWedgeTrayDistance(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, SourceToWedgeTrayDistance).getFloat64(value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeAngle(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeAngle, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeAngle(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, WedgeAngle).getSint32(value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeFactor(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeFactor, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeFactor(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, WedgeFactor).getFloat64(value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeID, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeNumber(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeNumber, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeNumber(Sint32 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmIntegerString &, WedgeNumber).getSint32(value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeOrientation(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeOrientation, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeOrientation(Float64 &value, const unsigned long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return OFconst_cast(DcmDecimalString &, WedgeOrientation).getFloat64(value, pos); +} + + +OFCondition DRTWedgeSequence::Item::getWedgeType(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(WedgeType, value, pos); +} + + +OFCondition DRTWedgeSequence::Item::setAccessoryCode(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AccessoryCode.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setEffectiveWedgeAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = EffectiveWedgeAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setSourceToWedgeTrayDistance(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SourceToWedgeTrayDistance.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setWedgeAngle(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeAngle.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setWedgeFactor(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeFactor.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setWedgeID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmShortString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setWedgeNumber(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeNumber.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setWedgeOrientation(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmDecimalString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeOrientation.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTWedgeSequence::Item::setWedgeType(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = WedgeType.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTWedgeSequence::DRTWedgeSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTWedgeSequence::DRTWedgeSequence(const DRTWedgeSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTWedgeSequence &DRTWedgeSequence::operator=(const DRTWedgeSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTWedgeSequence::~DRTWedgeSequence() +{ + clear(); +} + + +void DRTWedgeSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTWedgeSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTWedgeSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTWedgeSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTWedgeSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWedgeSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTWedgeSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWedgeSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWedgeSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTWedgeSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTWedgeSequence::Item &DRTWedgeSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTWedgeSequence::Item &DRTWedgeSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTWedgeSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTWedgeSequence::Item &DRTWedgeSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTWedgeSequence::Item &DRTWedgeSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTWedgeSequence::Item &DRTWedgeSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTWedgeSequence::Item &DRTWedgeSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTWedgeSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTWedgeSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTWedgeSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTWedgeSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_WedgeSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_WedgeSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTWedgeSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_WedgeSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/libsrc/drtxrs.cc b/dcmrt/libsrc/drtxrs.cc new file mode 100644 index 00000000..ca042bbc --- /dev/null +++ b/dcmrt/libsrc/drtxrs.cc @@ -0,0 +1,573 @@ +/* + * + * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class DRTXDSRetrievalSequence + * + * Generated automatically from DICOM PS 3.3-2017e + * File created on 2017-12-05 09:30:54 + * + */ + + +#include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first + +#include "dcmtk/dcmrt/seq/drtxrs.h" + + +// --- item class --- + +DRTXDSRetrievalSequence::Item::Item(const OFBool emptyDefaultItem) + : EmptyDefaultItem(emptyDefaultItem), + HomeCommunityID(DCM_HomeCommunityID), + RepositoryUniqueID(DCM_RepositoryUniqueID) +{ +} + + +DRTXDSRetrievalSequence::Item::Item(const Item ©) + : EmptyDefaultItem(copy.EmptyDefaultItem), + HomeCommunityID(copy.HomeCommunityID), + RepositoryUniqueID(copy.RepositoryUniqueID) +{ +} + + +DRTXDSRetrievalSequence::Item::~Item() +{ +} + + +DRTXDSRetrievalSequence::Item &DRTXDSRetrievalSequence::Item::operator=(const Item ©) +{ + if (this != ©) + { + EmptyDefaultItem = copy.EmptyDefaultItem; + HomeCommunityID = copy.HomeCommunityID; + RepositoryUniqueID = copy.RepositoryUniqueID; + } + return *this; +} + + +void DRTXDSRetrievalSequence::Item::clear() +{ + if (!EmptyDefaultItem) + { + /* clear all DICOM attributes */ + RepositoryUniqueID.clear(); + HomeCommunityID.clear(); + } +} + + +OFBool DRTXDSRetrievalSequence::Item::isEmpty() +{ + return RepositoryUniqueID.isEmpty() && + HomeCommunityID.isEmpty(); +} + + +OFBool DRTXDSRetrievalSequence::Item::isValid() const +{ + return !EmptyDefaultItem; +} + + +OFCondition DRTXDSRetrievalSequence::Item::read(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + /* re-initialize object */ + clear(); + getAndCheckElementFromDataset(item, RepositoryUniqueID, "1", "1", "XDSRetrievalSequence"); + getAndCheckElementFromDataset(item, HomeCommunityID, "1", "3", "XDSRetrievalSequence"); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::Item::write(DcmItem &item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = EC_Normal; + addElementToDataset(result, item, new DcmUniqueIdentifier(RepositoryUniqueID), "1", "1", "XDSRetrievalSequence"); + addElementToDataset(result, item, new DcmUniqueIdentifier(HomeCommunityID), "1", "3", "XDSRetrievalSequence"); + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::Item::getHomeCommunityID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(HomeCommunityID, value, pos); +} + + +OFCondition DRTXDSRetrievalSequence::Item::getRepositoryUniqueID(OFString &value, const signed long pos) const +{ + if (EmptyDefaultItem) + return EC_IllegalCall; + else + return getStringValueFromElement(RepositoryUniqueID, value, pos); +} + + +OFCondition DRTXDSRetrievalSequence::Item::setHomeCommunityID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = HomeCommunityID.putOFStringArray(value); + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::Item::setRepositoryUniqueID(const OFString &value, const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultItem) + { + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = RepositoryUniqueID.putOFStringArray(value); + } + return result; +} + + +// --- sequence class --- + +DRTXDSRetrievalSequence::DRTXDSRetrievalSequence(const OFBool emptyDefaultSequence) + : EmptyDefaultSequence(emptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + CurrentItem = SequenceOfItems.end(); +} + + +DRTXDSRetrievalSequence::DRTXDSRetrievalSequence(const DRTXDSRetrievalSequence ©) + : EmptyDefaultSequence(copy.EmptyDefaultSequence), + SequenceOfItems(), + CurrentItem(), + EmptyItem(OFTrue /*emptyDefaultItem*/) +{ + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); +} + + +DRTXDSRetrievalSequence &DRTXDSRetrievalSequence::operator=(const DRTXDSRetrievalSequence ©) +{ + if (this != ©) + { + clear(); + EmptyDefaultSequence = copy.EmptyDefaultSequence; + /* create a copy of the internal sequence of items */ + Item *item = NULL; + OFListConstIterator(Item *) current = copy.SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = copy.SequenceOfItems.end(); + while (current != last) + { + item = new Item(**current); + if (item != NULL) + { + SequenceOfItems.push_back(item); + } else { + /* memory exhausted, there is nothing we can do about it */ + break; + } + ++current; + } + CurrentItem = SequenceOfItems.begin(); + } + return *this; +} + + +DRTXDSRetrievalSequence::~DRTXDSRetrievalSequence() +{ + clear(); +} + + +void DRTXDSRetrievalSequence::clear() +{ + if (!EmptyDefaultSequence) + { + CurrentItem = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* delete all items and free memory */ + while (CurrentItem != last) + { + delete (*CurrentItem); + CurrentItem = SequenceOfItems.erase(CurrentItem); + } + /* make sure that the list is empty */ + SequenceOfItems.clear(); + CurrentItem = SequenceOfItems.end(); + } +} + + +OFBool DRTXDSRetrievalSequence::isEmpty() +{ + return SequenceOfItems.empty(); +} + + +OFBool DRTXDSRetrievalSequence::isValid() const +{ + return !EmptyDefaultSequence; +} + + +size_t DRTXDSRetrievalSequence::getNumberOfItems() const +{ + return SequenceOfItems.size(); +} + + +OFCondition DRTXDSRetrievalSequence::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + CurrentItem = SequenceOfItems.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + ++CurrentItem; + result = EC_Normal; + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::gotoItem(const size_t num, OFListIterator(Item *) &iterator) +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::gotoItem(const size_t num, OFListConstIterator(Item *) &iterator) const +{ + OFCondition result = EC_IllegalCall; + if (!SequenceOfItems.empty()) + { + size_t idx = num + 1; + iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + while ((--idx > 0) && (iterator != last)) + ++iterator; + /* specified list item found? */ + if ((idx == 0) && (iterator != last)) + result = EC_Normal; + else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::gotoItem(const size_t num) +{ + return gotoItem(num, CurrentItem); +} + + +OFCondition DRTXDSRetrievalSequence::getCurrentItem(Item *&item) const +{ + OFCondition result = EC_IllegalCall; + if (CurrentItem != SequenceOfItems.end()) + { + item = *CurrentItem; + result = EC_Normal; + } + return result; +} + + +DRTXDSRetrievalSequence::Item &DRTXDSRetrievalSequence::getCurrentItem() +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +const DRTXDSRetrievalSequence::Item &DRTXDSRetrievalSequence::getCurrentItem() const +{ + if (CurrentItem != SequenceOfItems.end()) + return **CurrentItem; + else + return EmptyItem; +} + + +OFCondition DRTXDSRetrievalSequence::getItem(const size_t num, Item *&item) +{ + OFListIterator(Item *) iterator; + OFCondition result = gotoItem(num, iterator); + if (result.good()) + item = *iterator; + return result; +} + + +DRTXDSRetrievalSequence::Item &DRTXDSRetrievalSequence::getItem(const size_t num) +{ + OFListIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +const DRTXDSRetrievalSequence::Item &DRTXDSRetrievalSequence::getItem(const size_t num) const +{ + OFListConstIterator(Item *) iterator; + if (gotoItem(num, iterator).good()) + return **iterator; + else + return EmptyItem; +} + + +DRTXDSRetrievalSequence::Item &DRTXDSRetrievalSequence::operator[](const size_t num) +{ + return getItem(num); +} + + +const DRTXDSRetrievalSequence::Item &DRTXDSRetrievalSequence::operator[](const size_t num) const +{ + return getItem(num); +} + + +OFCondition DRTXDSRetrievalSequence::addItem(Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.push_back(item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::insertItem(const size_t pos, Item *&item) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + result = gotoItem(pos, iterator); + if (result.good()) + { + item = new Item(); + if (item != NULL) + { + SequenceOfItems.insert(iterator, 1, item); + result = EC_Normal; + } else + result = EC_MemoryExhausted; + } else + result = addItem(item); + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::removeItem(const size_t pos) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + OFListIterator(Item *) iterator; + if (gotoItem(pos, iterator).good()) + { + delete *iterator; + iterator = SequenceOfItems.erase(iterator); + result = EC_Normal; + } else + result = EC_IllegalParameter; + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::read(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + /* re-initialize object */ + clear(); + /* retrieve sequence element from dataset */ + DcmSequenceOfItems *sequence; + result = dataset.findAndGetSequence(DCM_XDSRetrievalSequence, sequence); + if (sequence != NULL) + { + if (checkElementValue(*sequence, card, type, result, moduleName)) + { + DcmStack stack; + OFBool first = OFTrue; + /* iterate over all sequence items */ + while (result.good() && sequence->nextObject(stack, first /*intoSub*/).good()) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, stack.top()); + if (ditem != NULL) + { + Item *item = new Item(); + if (item != NULL) + { + result = item->read(*ditem); + if (result.good()) + { + /* append new item to the end of the list */ + SequenceOfItems.push_back(item); + first = OFFalse; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_CorruptedData; + } + } + } else { + DcmSequenceOfItems element(DCM_XDSRetrievalSequence); + checkElementValue(element, card, type, result, moduleName); + } + } + return result; +} + + +OFCondition DRTXDSRetrievalSequence::write(DcmItem &dataset, + const OFString &card, + const OFString &type, + const char *moduleName) +{ + OFCondition result = EC_IllegalCall; + if (!EmptyDefaultSequence) + { + result = EC_MemoryExhausted; + DcmSequenceOfItems *sequence = new DcmSequenceOfItems(DCM_XDSRetrievalSequence); + if (sequence != NULL) + { + result = EC_Normal; + /* an empty optional sequence is not written */ + if ((type == "2") || !SequenceOfItems.empty()) + { + OFListIterator(Item *) iterator = SequenceOfItems.begin(); + const OFListConstIterator(Item *) last = SequenceOfItems.end(); + /* iterate over all sequence items */ + while (result.good() && (iterator != last)) + { + DcmItem *item = new DcmItem(); + if (item != NULL) + { + /* append new item to the end of the sequence */ + result = sequence->append(item); + if (result.good()) + { + result = (*iterator)->write(*item); + ++iterator; + } else + delete item; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + { + /* insert sequence element into the dataset */ + result = dataset.insert(sequence, OFTrue /*replaceOld*/); + } + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + if (result.good()) + { + /* forget reference to sequence object (avoid deletion below) */ + sequence = NULL; + } + } + else if (type == "1") + { + /* empty type 1 sequence not allowed */ + result = RT_EC_InvalidValue; + if (DCM_dcmrtLogger.isEnabledFor(OFLogger::WARN_LOG_LEVEL)) + checkElementValue(*sequence, card, type, result, moduleName); + } + /* delete sequence (if not inserted into the dataset) */ + delete sequence; + } + } + return result; +} + + +// end of source file diff --git a/dcmrt/tests/CMakeLists.txt b/dcmrt/tests/CMakeLists.txt new file mode 100644 index 00000000..31825005 --- /dev/null +++ b/dcmrt/tests/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare executables +DCMTK_ADD_EXECUTABLE(drttest drttest) +DCMTK_ADD_EXECUTABLE(dcmrt_tests tests tsearch) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(drttest dcmrt dcmdata oflog ofstd) +DCMTK_TARGET_LINK_MODULES(dcmrt_tests dcmrt dcmdata oflog ofstd) + +# This macro parses tests.cc and registers all tests +DCMTK_ADD_TESTS(dcmrt) diff --git a/dcmrt/tests/Makefile.dep b/dcmrt/tests/Makefile.dep new file mode 100644 index 00000000..6c471d3c --- /dev/null +++ b/dcmrt/tests/Makefile.dep @@ -0,0 +1,514 @@ +drttest.o: drttest.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmrt/drtdose.h ../include/dcmtk/dcmrt/drttypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdvhs.h \ + ../include/dcmtk/dcmrt/seq/drtdvrrs.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drteas.h ../include/dcmtk/dcmrt/seq/drtfes.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtiis.h ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtmls.h ../include/dcmtk/dcmrt/seq/drtoas.h \ + ../include/dcmtk/dcmrt/seq/drtmas.h ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpsss.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h ../include/dcmtk/dcmrt/seq/drtrcs.h \ + ../include/dcmtk/dcmrt/seq/drtcs.h ../include/dcmtk/dcmrt/seq/drtcis.h \ + ../include/dcmtk/dcmrt/seq/drtrdros.h \ + ../include/dcmtk/dcmrt/seq/drtrwvms.h \ + ../include/dcmtk/dcmrt/seq/drtqds.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrfors.h \ + ../include/dcmtk/dcmrt/seq/drtrsts.h \ + ../include/dcmtk/dcmrt/seq/drtrses.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps.h \ + ../include/dcmtk/dcmrt/seq/drtrfgs.h \ + ../include/dcmtk/dcmrt/seq/drtrbs2.h \ + ../include/dcmtk/dcmrt/seq/drtrcps.h \ + ../include/dcmtk/dcmrt/seq/drtrbas2.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs2.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtssrs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h ../include/dcmtk/dcmrt/drtimage.h \ + ../include/dcmtk/dcmrt/seq/drtcbars.h \ + ../include/dcmtk/dcmrt/seq/drtads.h ../include/dcmtk/dcmrt/seq/drtbas.h \ + ../include/dcmtk/dcmrt/seq/drtds.h ../include/dcmtk/dcmrt/seq/drtes.h \ + ../include/dcmtk/dcmrt/seq/drtas5.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds5.h \ + ../include/dcmtk/dcmrt/seq/drtbl5.h ../include/dcmtk/dcmrt/seq/drtgas.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h ../include/dcmtk/dcmrt/seq/drtfms.h \ + ../include/dcmtk/dcmrt/seq/drtmacds.h \ + ../include/dcmtk/dcmrt/seq/drtcss.h ../include/dcmtk/dcmrt/seq/drtrims.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps5.h \ + ../include/dcmtk/dcmrt/seq/drtsis.h ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtvls.h ../include/dcmtk/dcmrt/drtplan.h \ + ../include/dcmtk/dcmrt/seq/drtass.h ../include/dcmtk/dcmrt/seq/drtbads.h \ + ../include/dcmtk/dcmrt/seq/drtchs.h ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h \ + ../include/dcmtk/dcmrt/seq/drtrris9.h ../include/dcmtk/dcmrt/seq/drtbs.h \ + ../include/dcmtk/dcmrt/seq/drtas1.h \ + ../include/dcmtk/dcmrt/seq/drtblds1.h \ + ../include/dcmtk/dcmrt/seq/drtbl2.h ../include/dcmtk/dcmrt/seq/drtcos.h \ + ../include/dcmtk/dcmrt/seq/drtcps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h \ + ../include/dcmtk/dcmrt/seq/drtpvis.h \ + ../include/dcmtk/dcmrt/seq/drtrbos1.h \ + ../include/dcmtk/dcmrt/seq/drtrris1.h ../include/dcmtk/dcmrt/seq/drtws.h \ + ../include/dcmtk/dcmrt/seq/drtdrs.h ../include/dcmtk/dcmrt/seq/drtfgs.h \ + ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../include/dcmtk/dcmrt/seq/drtpss.h ../include/dcmtk/dcmrt/seq/drtfds.h \ + ../include/dcmtk/dcmrt/seq/drtmss.h ../include/dcmtk/dcmrt/seq/drtrsis.h \ + ../include/dcmtk/dcmrt/seq/drtsds.h ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps3.h \ + ../include/dcmtk/dcmrt/seq/drtss.h ../include/dcmtk/dcmrt/seq/drttts.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h \ + ../include/dcmtk/dcmrt/seq/drttms9.h ../include/dcmtk/dcmrt/drtstrct.h \ + ../include/dcmtk/dcmrt/seq/drtrros.h \ + ../include/dcmtk/dcmrt/seq/drtrpps.h \ + ../include/dcmtk/dcmrt/seq/drtrecs.h \ + ../include/dcmtk/dcmrt/seq/drtrics.h \ + ../include/dcmtk/dcmrt/seq/drtsptcs.h \ + ../include/dcmtk/dcmrt/seq/drtrrs.h \ + ../include/dcmtk/dcmrt/seq/drtrrros.h \ + ../include/dcmtk/dcmrt/seq/drtspccs.h ../include/dcmtk/dcmrt/drttreat.h \ + ../include/dcmtk/dcmrt/seq/drtfgss.h \ + ../include/dcmtk/dcmrt/seq/drtfsss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps4.h \ + ../include/dcmtk/dcmrt/seq/drtrtrs4.h \ + ../include/dcmtk/dcmrt/seq/drttscds.h \ + ../include/dcmtk/dcmrt/seq/drttsmds.h +tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +tsearch.o: tsearch.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmrt/drmplan.h ../include/dcmtk/dcmrt/drtplan.h \ + ../include/dcmtk/dcmrt/drttypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../include/dcmtk/dcmrt/seq/drtadcs.h ../include/dcmtk/dcmrt/seq/drtecs.h \ + ../include/dcmtk/dcmrt/seq/drtass.h ../include/dcmtk/dcmrt/seq/drtbads.h \ + ../include/dcmtk/dcmrt/seq/drtchs.h ../include/dcmtk/dcmrt/seq/drtbcps.h \ + ../include/dcmtk/dcmrt/seq/drtbrdrs.h \ + ../include/dcmtk/dcmrt/seq/drtcshs.h \ + ../include/dcmtk/dcmrt/seq/drtrris9.h ../include/dcmtk/dcmrt/seq/drtbs.h \ + ../include/dcmtk/dcmrt/seq/drtas1.h ../include/dcmtk/dcmrt/seq/drtags.h \ + ../include/dcmtk/dcmrt/seq/drtblds1.h \ + ../include/dcmtk/dcmrt/seq/drtbl2.h ../include/dcmtk/dcmrt/seq/drtcos.h \ + ../include/dcmtk/dcmrt/seq/drtcps.h \ + ../include/dcmtk/dcmrt/seq/drtbldps.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs1.h \ + ../include/dcmtk/dcmrt/seq/drtbvcps.h \ + ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h \ + ../include/dcmtk/dcmrt/seq/drtgas.h ../include/dcmtk/dcmrt/seq/drtpvis.h \ + ../include/dcmtk/dcmrt/seq/drtpfms.h \ + ../include/dcmtk/dcmrt/seq/drtrbos1.h \ + ../include/dcmtk/dcmrt/seq/drtrris1.h ../include/dcmtk/dcmrt/seq/drtws.h \ + ../include/dcmtk/dcmrt/seq/drtbrs.h \ + ../include/dcmtk/dcmrt/seq/drtbrcss.h \ + ../include/dcmtk/dcmrt/seq/drtcsis.h \ + ../include/dcmtk/dcmrt/seq/drtcsrs.h \ + ../include/dcmtk/dcmrt/seq/drtcctus.h \ + ../include/dcmtk/dcmrt/seq/drtcpis.h ../include/dcmtk/dcmrt/seq/drtics.h \ + ../include/dcmtk/dcmrt/seq/drtpics.h \ + ../include/dcmtk/dcmrt/seq/drtcgis.h ../include/dcmtk/dcmrt/seq/drtces.h \ + ../include/dcmtk/dcmrt/seq/drtois.h \ + ../include/dcmtk/dcmrt/seq/drtporcs.h \ + ../include/dcmtk/dcmrt/seq/drtcsas.h \ + ../include/dcmtk/dcmrt/seq/drtdimcs.h \ + ../include/dcmtk/dcmrt/seq/drtdcs.h ../include/dcmtk/dcmrt/seq/drtdss.h \ + ../include/dcmtk/dcmrt/seq/drtdspcs.h \ + ../include/dcmtk/dcmrt/seq/drtdrs.h ../include/dcmtk/dcmrt/seq/drteas.h \ + ../include/dcmtk/dcmrt/seq/drtfgs.h ../include/dcmtk/dcmrt/seq/drtrbs8.h \ + ../include/dcmtk/dcmrt/seq/drtrbas8.h \ + ../include/dcmtk/dcmrt/seq/drtrdrs8.h \ + ../include/dcmtk/dcmrt/seq/drtgms.h ../include/dcmtk/dcmrt/seq/drtgmcs.h \ + ../include/dcmtk/dcmrt/seq/drtgpis.h \ + ../include/dcmtk/dcmrt/seq/drtipiqs.h \ + ../include/dcmtk/dcmrt/seq/drtaadcs.h \ + ../include/dcmtk/dcmrt/seq/drtafs.h ../include/dcmtk/dcmrt/seq/drtajcs.h \ + ../include/dcmtk/dcmrt/seq/drthsdrs.h \ + ../include/dcmtk/dcmrt/seq/drtians.h \ + ../include/dcmtk/dcmrt/seq/drtiais.h \ + ../include/dcmtk/dcmrt/seq/drtiseis.h \ + ../include/dcmtk/dcmrt/seq/drtmps.h ../include/dcmtk/dcmrt/seq/drtmris.h \ + ../include/dcmtk/dcmrt/seq/drtoas.h ../include/dcmtk/dcmrt/seq/drtmas.h \ + ../include/dcmtk/dcmrt/seq/drtopis.h \ + ../include/dcmtk/dcmrt/seq/drtpbcs.h ../include/dcmtk/dcmrt/seq/drtpss.h \ + ../include/dcmtk/dcmrt/seq/drtfds.h ../include/dcmtk/dcmrt/seq/drtmss.h \ + ../include/dcmtk/dcmrt/seq/drtrsis.h ../include/dcmtk/dcmrt/seq/drtsds.h \ + ../include/dcmtk/dcmrt/seq/drtshds.h \ + ../include/dcmtk/dcmrt/seq/drtpsics.h \ + ../include/dcmtk/dcmrt/seq/drtpscs.h \ + ../include/dcmtk/dcmrt/seq/drtppcs.h \ + ../include/dcmtk/dcmrt/seq/drtpcxs.h ../include/dcmtk/dcmrt/seq/drtccs.h \ + ../include/dcmtk/dcmrt/seq/drtcncs.h \ + ../include/dcmtk/dcmrt/seq/drtcims.h \ + ../include/dcmtk/dcmrt/seq/drtmucs.h \ + ../include/dcmtk/dcmrt/seq/drtrsos.h \ + ../include/dcmtk/dcmrt/seq/drtporis.h \ + ../include/dcmtk/dcmrt/seq/drtprsis.h \ + ../include/dcmtk/dcmrt/seq/drtpdecs.h \ + ../include/dcmtk/dcmrt/seq/drtdias.h \ + ../include/dcmtk/dcmrt/seq/drtpdeds.h \ + ../include/dcmtk/dcmrt/seq/drtpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrppcs.h \ + ../include/dcmtk/dcmrt/seq/drtrims.h ../include/dcmtk/dcmrt/seq/drtris.h \ + ../include/dcmtk/dcmrt/seq/drtrpphs.h \ + ../include/dcmtk/dcmrt/seq/drtdimrs.h \ + ../include/dcmtk/dcmrt/seq/drtdirs.h \ + ../include/dcmtk/dcmrt/seq/drtwrsrs.h \ + ../include/dcmtk/dcmrt/seq/drtwrs.h ../include/dcmtk/dcmrt/seq/drtxrs.h \ + ../include/dcmtk/dcmrt/seq/drtrps.h \ + ../include/dcmtk/dcmrt/seq/drtrppss.h \ + ../include/dcmtk/dcmrt/seq/drtrrtps3.h \ + ../include/dcmtk/dcmrt/seq/drtrsers.h \ + ../include/dcmtk/dcmrt/seq/drtrsss.h ../include/dcmtk/dcmrt/seq/drtrss.h \ + ../include/dcmtk/dcmrt/seq/drtrpis.h ../include/dcmtk/dcmrt/seq/drtras.h \ + ../include/dcmtk/dcmrt/seq/drtrrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtrpcs.h \ + ../include/dcmtk/dcmrt/seq/drtspcs.h \ + ../include/dcmtk/dcmrt/seq/drtrscs.h \ + ../include/dcmtk/dcmrt/seq/drtsdcs.h ../include/dcmtk/dcmrt/seq/drtsis.h \ + ../include/dcmtk/dcmrt/seq/drtsins.h \ + ../include/dcmtk/dcmrt/seq/drtspgis.h ../include/dcmtk/dcmrt/seq/drtss.h \ + ../include/dcmtk/dcmrt/seq/drtscs.h ../include/dcmtk/dcmrt/seq/drtsss.h \ + ../include/dcmtk/dcmrt/seq/drtssrcs.h \ + ../include/dcmtk/dcmrt/seq/drtscris.h \ + ../include/dcmtk/dcmrt/seq/drttts.h \ + ../include/dcmtk/dcmrt/seq/drtbldts.h \ + ../include/dcmtk/dcmrt/seq/drttms9.h \ + ../include/dcmtk/dcmrt/seq/drtudis.h diff --git a/dcmrt/tests/Makefile.in b/dcmrt/tests/Makefile.in new file mode 100644 index 00000000..63f9b3a0 --- /dev/null +++ b/dcmrt/tests/Makefile.in @@ -0,0 +1,59 @@ +# +# Makefile for dcmrt/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle + +LOCALINCLUDES = -I$(dcmdatadir)/include -I$(oflogdir)/include -I$(ofstddir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(dcmimgledir)/libsrc -L$(dcmdatadir)/libsrc \ + -L$(oflogdir)/libsrc -L$(ofstddir)/libsrc +LOCALLIBS = -ldcmrt -ldcmimgle -ldcmdata -loflog -lofstd \ + $(TIFFLIBS) $(PNGLIBS) $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS) + +test_objs = tests.o tsearch.o +objs = drttest.o $(test_objs) +progs = drttest tests + + +all: $(progs) + +drttest: drttest.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + +tests: $(test_objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $(test_objs) $(LOCALLIBS) $(LIBS) + +install: all + + +check: tests + ./tests + +check-exhaustive: tests + ./tests -x + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmrt/tests/drttest.cc b/dcmrt/tests/drttest.cc new file mode 100644 index 00000000..e1988104 --- /dev/null +++ b/dcmrt/tests/drttest.cc @@ -0,0 +1,131 @@ +/* + * + * Copyright (c) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Test read and write methods of DICOM RT classes + * + * Generated manually + * File created on 2008-12-08 + * Last modified on 2012-10-09 by Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmrt/drtdose.h" +#include "dcmtk/dcmrt/drtimage.h" +#include "dcmtk/dcmrt/drtplan.h" +#include "dcmtk/dcmrt/drtstrct.h" +#include "dcmtk/dcmrt/drttreat.h" + +#include "dcmtk/dcmdata/dcfilefo.h" + +#define TEST_COPY_CONSTRUCTOR +#define TEST_ASSIGNMENT_OPERATOR + +#define RTDOSE_FILENAME "/share/dicom/images/dkfz-rt/Phantom/RD1.3.6.1.4.1.2452.6.2742071499.1301053063.852537260.1034784.dcm" +#define RTIMAGE_FILENAME "/share/dicom/images/dkfz-rt/Phantom/RI1.3.6.1.4.1.2452.6.2440400960.1328333180.1418898622.324303.dcm" +#define RTPLAN_FILENAME "/share/dicom/images/dkfz-rt/Phantom/RP1.3.6.1.4.1.2452.6.998701572.1323706291.2356805512.4049491.dcm" +#define RTSTRUCT_FILENAME "/share/dicom/images/dkfz-rt/Phantom/RS1.3.6.1.4.1.2452.6.2951369053.1166013784.715527822.1679960.dcm" +#define RTTREAT_FILENAME "/share/dicom/images/dkfz-rt/rt_set_20090707/RT_RECORD/SER01/IMG004" + + +int main() +{ + OFCondition status; + DcmFileFormat fileformat; + OFLog::configure(OFLogger::INFO_LOG_LEVEL); + DCMRT_INFO("DCMRT Test Program" << OFendl << "------------------" << OFendl); + + /* test RT dose */ + DRTDoseIOD rtdose; + status = fileformat.loadFile(RTDOSE_FILENAME); + if (status.good()) + status = rtdose.read(*fileformat.getDataset()); + DCMRT_INFO("Read RT Dose: " << status.text()); + + fileformat.clear(); + status = rtdose.write(*fileformat.getDataset()); + DCMRT_INFO("Save RT Dose: " << status.text()); + if (status.good()) + status = fileformat.saveFile("rtdose.dcm"); + DCMRT_INFO("Write RT Dose: " << status.text() << OFendl); + +#ifdef TEST_COPY_CONSTRUCTOR + DRTDoseIOD rtdose2(rtdose); + fileformat.clear(); + status = rtdose2.write(*fileformat.getDataset()); + DCMRT_INFO("Write copy of RT Dose: " << status.text()); + if (status.good()) + status = fileformat.saveFile("rtdose2.dcm"); + DCMRT_INFO("Save copy of RT Dose: " << status.text() << OFendl); +#endif + + /* test RT image */ + DRTImageIOD rtimage; + status = fileformat.loadFile(RTIMAGE_FILENAME); + if (status.good()) + status = rtimage.read(*fileformat.getDataset()); + DCMRT_INFO("Read RT Image: " << status.text()); + fileformat.clear(); + status = rtimage.write(*fileformat.getDataset()); + DCMRT_INFO("Write RT Image: " << status.text()); + if (status.good()) + status = fileformat.saveFile("rtimage.dcm"); + DCMRT_INFO("Save RT Image: " << status.text() << OFendl); + + /* test RT plan */ + DRTPlanIOD rtplan; + status = fileformat.loadFile(RTPLAN_FILENAME); + if (status.good()) + status = rtplan.read(*fileformat.getDataset()); + DCMRT_INFO("Read RT Plan: " << status.text()); + fileformat.clear(); + status = rtplan.write(*fileformat.getDataset()); + DCMRT_INFO("Write RT Plan: " << status.text()); + if (status.good()) + status = fileformat.saveFile("rtplan.dcm"); + DCMRT_INFO("Save RT Plan: " << status.text() << OFendl); + +#ifdef TEST_ASSIGNMENT_OPERATOR + DRTPlanIOD rtplan2 = rtplan; + fileformat.clear(); + status = rtplan2.write(*fileformat.getDataset()); + DCMRT_INFO("Write copy of RT Plan: " << status.text()); + if (status.good()) + status = fileformat.saveFile("rtplan2.dcm"); + DCMRT_INFO("Save copy of RT Plan: " << status.text() << OFendl); +#endif + + /* test RT structure set */ + DRTStructureSetIOD rtstruct; + status = fileformat.loadFile(RTSTRUCT_FILENAME); + if (status.good()) + status = rtstruct.read(*fileformat.getDataset()); + DCMRT_INFO("Read RT Structure Set: " << status.text()); + fileformat.clear(); + status = rtstruct.write(*fileformat.getDataset()); + DCMRT_INFO("Write RT Structure Set: " << status.text()); + if (status.good()) + status = fileformat.saveFile("rtstruct.dcm"); + DCMRT_INFO("Save RT Structure Set: " << status.text() << OFendl); + + /* test RT treatment summary record */ + DRTTreatmentSummaryRecordIOD rttreat; + status = fileformat.loadFile(RTTREAT_FILENAME); + if (status.good()) + status = rttreat.read(*fileformat.getDataset()); + DCMRT_INFO("Read RT Treatment Summary Record: " << status.text()); + fileformat.clear(); + rttreat.getRequestAttributesSequence().clear(); + DCMRT_INFO("Fix invalid sequence elements: " << status.text()); + status = rttreat.write(*fileformat.getDataset()); + DCMRT_INFO("Write RT Treatment Summary Record: " << status.text()); + if (status.good()) + status = fileformat.saveFile("rttreat.dcm"); + DCMRT_INFO("Save RT Treatment Summary Record: " << status.text() << OFendl); + + return 0; +} diff --git a/dcmrt/tests/tests.cc b/dcmrt/tests/tests.cc new file mode 100644 index 00000000..40840d2c --- /dev/null +++ b/dcmrt/tests/tests.cc @@ -0,0 +1,27 @@ +/* + * + * Copyright (C) 2012-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: main test program + * + */ + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/oftest.h" + +OFTEST_REGISTER(dcmrt_search); +OFTEST_MAIN("dcmrt") diff --git a/dcmrt/tests/tsearch.cc b/dcmrt/tests/tsearch.cc new file mode 100644 index 00000000..5d9bf42f --- /dev/null +++ b/dcmrt/tests/tsearch.cc @@ -0,0 +1,49 @@ +/* + * + * Copyright (C) 2012, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmrt + * + * Author: Uli Schlachter + * + * Purpose: test program for the search helper classes + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmrt/drmplan.h" + + +OFTEST(dcmrt_search) +{ + DRTPlan plan; + DRTBeamSequence &seq = plan.getBeamSequence(); + DRTBeamSequence::Item *item1, *item2, *item3; + // Get the empty default item + DRTBeamSequence::Item &empty = seq.getCurrentItem(); + + // Add some elements + OFCHECK(seq.addItem(item1).good()); + OFCHECK(item1->setBeamNumber("42").good()); + OFCHECK(seq.addItem(item2).good()); + OFCHECK(item2->setBeamNumber("1337").good()); + OFCHECK(seq.addItem(item3).good()); + OFCHECK(item3->setBeamNumber("21").good()); + + // Check if finding works correctly + OFCHECK_EQUAL(&plan.getBeam(1337), item2); + OFCHECK_EQUAL(&plan.getBeam(42), item1); + OFCHECK_EQUAL(&plan.getBeam(21), item3); + OFCHECK_EQUAL(&plan.getBeam(100), &empty); +} diff --git a/dcmseg/CMakeLists.txt b/dcmseg/CMakeLists.txt new file mode 100644 index 00000000..37bd9d6c --- /dev/null +++ b/dcmseg/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmseg) + +# declare include directories which hold for all subdirectories +include_directories("${dcmseg_SOURCE_DIR}/include" "${dcmfg_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc include tests) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmseg/Makefile.in b/dcmseg/Makefile.in new file mode 100644 index 00000000..f1c79ee8 --- /dev/null +++ b/dcmseg/Makefile.in @@ -0,0 +1,86 @@ +# +# Makefile for dcmseg +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all tests-all + +install: install-doc install-support + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmseg/configure b/dcmseg/configure new file mode 100755 index 00000000..3877a6a1 --- /dev/null +++ b/dcmseg/configure @@ -0,0 +1,53 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + diff --git a/dcmseg/data/Makefile.in b/dcmseg/data/Makefile.in new file mode 100644 index 00000000..8b4b2aa3 --- /dev/null +++ b/dcmseg/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmseg/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmseg/docs/Makefile.in b/dcmseg/docs/Makefile.in new file mode 100644 index 00000000..852743e7 --- /dev/null +++ b/dcmseg/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmseg/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmseg/docs/dcmseg.dox b/dcmseg/docs/dcmseg.dox new file mode 100644 index 00000000..7b1a47e9 --- /dev/null +++ b/dcmseg/docs/dcmseg.dox @@ -0,0 +1,16 @@ +/*! + +\page mod_dcmseg dcmseg: a library for working with segmentation objects + +This module contains classes to deal with DICOM Segmentation objects. It can +handle shared and fractional segmentations and is able to create, load, modify +and save them. Several checks (as possible) make sure that only valid +Segmentations objects can be written. This module makes heavy use of the +\ref mod_dcmiod "dcmiod" module for managing common IOD attribute as well as +the \ref mod_dcmfg "dcmfg" module to manage the functional groups required for +Segmentation objects. + +The main class of this module is: +\li \b DcmSegmentation + +*/ diff --git a/dcmseg/etc/Makefile.in b/dcmseg/etc/Makefile.in new file mode 100644 index 00000000..9788a373 --- /dev/null +++ b/dcmseg/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmseg/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmseg/include/CMakeLists.txt b/dcmseg/include/CMakeLists.txt new file mode 100644 index 00000000..3dd090ae --- /dev/null +++ b/dcmseg/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmseg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmseg/include/Makefile.in b/dcmseg/include/Makefile.in new file mode 100644 index 00000000..71ea61af --- /dev/null +++ b/dcmseg/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmseg/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmseg + for file in dcmtk/dcmseg/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmseg ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmseg/include/dcmtk/dcmseg/segdef.h b/dcmseg/include/dcmtk/dcmseg/segdef.h new file mode 100644 index 00000000..657a6881 --- /dev/null +++ b/dcmseg/include/dcmtk/dcmseg/segdef.h @@ -0,0 +1,37 @@ +/* + * + * Copyright (C) 2015, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef SEGDEF_H +#define SEGDEF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/ofdefine.h" + +// definitions for DLL/shared library exports + +#ifdef dcmseg_EXPORTS +#define DCMTK_DCMSEG_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMSEG_EXPORT DCMTK_DECL_IMPORT +#endif + +#endif diff --git a/dcmseg/include/dcmtk/dcmseg/segdoc.h b/dcmseg/include/dcmtk/dcmseg/segdoc.h new file mode 100644 index 00000000..edd82e8e --- /dev/null +++ b/dcmseg/include/dcmtk/dcmseg/segdoc.h @@ -0,0 +1,685 @@ +/* + * + * Copyright (C) 2015-2019, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Class representing a Segmentation object + * + */ + +#ifndef SEGDOC_H +#define SEGDOC_H + +#include "dcmtk/config/osconfig.h" // include OS configuration first +#include "dcmtk/ofstd/ofvector.h" // for OFVector +#include "dcmtk/dcmiod/iodimage.h" // common image IOD attribute access +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmiod/modimagepixel.h" +#include "dcmtk/dcmiod/modsegmentationseries.h" // for segmentation series module +#include "dcmtk/dcmiod/modenhequipment.h" // for enhanced general equipment module + +#include "dcmtk/dcmiod/modmultiframefg.h" // for multi-frame functional group module +#include "dcmtk/dcmiod/modmultiframedimension.h"// for multi-frame dimension module +#include "dcmtk/dcmdata/dcvrui.h" + +#include "dcmtk/dcmfg/fginterface.h" // for multi-frame functional group interface +#include "dcmtk/dcmfg/fgfracon.h" // for frame content functional group macro + +#include "dcmtk/dcmseg/segtypes.h" // for segmentation data types +#include "dcmtk/dcmseg/segdef.h" + + +// Forward declarations +class DcmSegment; +class FGSegmentation; +class FGDerivationImage; + +/** Class representing an object of the "Segmentation SOP Class". + */ +class DCMTK_DCMSEG_EXPORT DcmSegmentation +: public DcmIODImage > +{ + +public: + + // -------------------- destruction ------------------------------- + + /** Destructor, frees memory + */ + virtual ~DcmSegmentation(); + + // -------------------- loading and saving --------------------- + + /** Static method to load a Segmentation object from a file. + * The memory of the resulting Segmentation object has to be freed by the + * caller. + * @param filename The file to read from + * @param segmentation The resulting segmentation object. NULL if dataset + * could not be read successfully. + * @return EC_Normal if reading was successful, error otherwise + */ + static OFCondition loadFile(const OFString& filename, + DcmSegmentation*& segmentation); + + /** Static method to load a Segmentation object from a dataset object. + * The memory of the resulting Segmentation object has to be freed by the + * caller. + * @param dataset The dataset to read from + * @param segmentation The resulting segmentation object. NULL if dataset + * could not be read successfully. + * @return EC_Normal if reading was successful, error otherwise + */ + static OFCondition loadDataset(DcmDataset& dataset, + DcmSegmentation*& segmentation); + + /** Save current object to given filename + * @param filename The file to write to + * @param writeXfer The transfer syntax to be used + * @return EC_Normal if writing was successful, error otherwise. + */ + OFCondition saveFile(const OFString& filename, + const E_TransferSyntax writeXfer = EXS_LittleEndianExplicit); + + /** Write current object to given item + * @param dataset The item to write to + * @return EC_Normal if writing was successful, error otherwise. + */ + OFCondition writeDataset(DcmItem& dataset); + + /** If enabled, functional group structure is checked before actual writing + * is performed in the write() method. Checking might be time consuming + * on functional groups with many frames, though disabling might result in + * invalid functional group structures. Disabling should only be done if the + * user knows that the functional groups are valid, wants to to adapt the + * functional groups manually after calling write() or knows what he's doing + * otherwise.
+ * Per default, checking is enabled. + * @param doCheck If OFTrue, checking will be performed. If OFFalse, + * no checks are performed. + */ + virtual void setCheckFGOnWrite(const OFBool doCheck); + + /** Returns whether functional group structure is checked before actual + * writing is performed in the write() method. + * @return OFTrue if checking is performed, OFFalse otherwise + */ + virtual OFBool getCheckFGOnWrite(); + + + // -------------------- creation --------------------- + + /** Factory method to create a binary segmentation object from the minimal + * set of information required. The actual segments and the frame data is + * added separately. + * The memory of the resulting Segmentation object has to be freed by the + * caller. + * @param segmentation The resulting segmentation object if provided data is + * valid. Otherwise NULL is returned. + * @param rows Number of rows of segmentation frame data + * @param columns Number of rows of segmentation frame data + * @param equipmentInfo Equipment that is responsible for creating the + * segmentation + * @param contentIdentification Basic content identification information + * @return EC_Normal if creation was successful, error otherwise + */ + static OFCondition createBinarySegmentation(DcmSegmentation*& segmentation, + const Uint16 rows, + const Uint16 columns, + const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification); + + /** Factory method to create a fractional segmentation object from the minimal + * set of information required. The actual segments and the frame data is + * added separately. + * The memory of the resulting Segmentation object has to be freed by the + * caller. + * @param segmentation The resulting segmentation object if provided data is + * valid. Otherwise NULL is returned. + * @param rows Number of rows of segmentation frame data + * @param columns Number of rows of segmentation frame data + * @param fractType Either probability (SFT_PROBABILITY) or + * occupancy (SFT_OCCUPANCY) + * @param maxFractionalValue The value inside the frame data of this + * segmentation that represents 100% occupancy/probability + * @param equipmentInfo Equipment that is responsible for creating the + * segmentation + * @param contentIdentification Basic content identification information + * @return EC_Normal if creation was successful, error otherwise + */ + static OFCondition createFractionalSegmentation(DcmSegmentation*& segmentation, + const Uint16 rows, + const Uint16 columns, + const DcmSegTypes::E_SegmentationFractionalType fractType, + const Uint16& maxFractionalValue, + const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification); + + /** Helps to create a valid Derivation Image Functional Group Macro + * The memory of the resulting functional group object has to be freed by the + * caller. + * @param derivationImages to image SOP instances + * @param derivationDescription Free text describing how the derivation was + * achieved. + * @return The created functional group, or NULL if not successful + */ + static FGDerivationImage* createDerivationImageFG(const OFVector& derivationImages, + const OFString& derivationDescription); + + // -------------------- access --------------------- + + /** Get number of frames, based on the number of items in the shared + * functional functional groups sequence (i.e.\ the attribute Number of + * Frames) is not trusted). + * @return The number of frames handled by this object + */ + size_t getNumberOfFrames(); + + /** Get Segmentation Type + * @return Type of the segmentation, as defined by DcmSegTypes::E_SegmentationType + */ + DcmSegTypes::E_SegmentationType getSegmentationType() + { + return this->m_SegmentationType; + } + + /** Get Fractional Segmentation Type + * @return Type of the segmentation, as defined by + * DcmSegTypes::E_SegmentationFractionalTypes (returns SFT_UNKNOWN if not + * fractional at all) + */ + DcmSegTypes::E_SegmentationFractionalType getSegmentationFractionalType() + { + return this->m_SegmentationFractionalType; + } + + /** Get the Number of Segments + * @return The number of segments handled by this object + */ + size_t getNumberOfSegments(); + + /** Perform some basic checking. This method is also invoked when + * writing the object to a DICOM dataset or file. + * @param checkFGStructure If OFTrue (default), structure of functional + * groups is checked, too. + * @return OFTrue, if no errors were found, OFFalse otherwise. + */ + virtual OFBool check(const OFBool checkFGStructure = OFTrue); + + /** Get access to functional groups. This is meant for reading data from + * functional groups that are not actively managed, i.e.\ made accessible by + * DcmSegmentation. In rare cases, however, it makes sense to access it + * for writing too, e.g.\ in order to add Stacks; use with care! + * @return Reference to the functional groups + */ + virtual FGInterface& getFunctionalGroups(); + + /** Get General Equipment Module + * @return General Equipment Module + */ + virtual IODGeneralEquipmentModule& getEquipment(); + + /** Get Segmentation Series Module + * @return Segmentation Series Module + */ + virtual IODSegmentationSeriesModule& getSegmentationSeriesModule(); + + /** Get modality (overwrite from DcmIODCommon. We always return "SEG" here) + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get. Not evaluated (here for + * consistency with other setter functions). + * @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, + const signed long pos = 0) const; + + /** Get segment by providing the logical segment number + * @param segmentNumber The logical segment number + * @return The segment if segment number is valid, NULL otherwise + */ + virtual DcmSegment* getSegment(const unsigned int segmentNumber); + + /** Get logical segment number by providing a pointer to a given segment + * @param segment The segment to find the logical segment number for + * @param segmentNumber The segment number. 0 if segment could not be found. + * @return OFTrue if segment could be found, OFFalse otherwise. + */ + virtual OFBool getSegmentNumber(const DcmSegment* segment, + unsigned int& segmentNumber); + + /** Reference to the Performed Procedure Step that led to the creation of this + * segmentation object. This is required if this object is created in an MPPS + * or GPPS workflow. + * @return Reference to the referenced PPS object + */ + virtual SOPInstanceReferenceMacro& getReferencedPPS(); + + /** Get (const) frame data of a specific frame + * @param frameNo The number of the frame to get (starting with 0) + * @return The frame requested or NULL if not existing + */ + virtual const DcmIODTypes::Frame* getFrame(const size_t& frameNo); + + /** Get the frame numbers that belong to a specific segment number + * @param segmentNumber The segment to search frames for + * @param frameNumbers The frame numbers belonging to that segment + */ + virtual void getFramesForSegment(const size_t& segmentNumber, + OFVector& frameNumbers); + + // -------------------- modification --------------------- + + /** Add segment to segmentation object + * @param seg The segment that should be added + * @param segmentNumber The logical segment number that was assigned for + * this segment. Contains 0 if adding failed. + * @return EC_Normal if adding was successful, error otherwise + */ + virtual OFCondition addSegment(DcmSegment* seg, + Uint16& segmentNumber); + + /** Add a functional group for all frames + * @param group The group to be added as shared functional group. The + * @return EC_Normal if adding was successful, error otherwise + */ + virtual OFCondition addForAllFrames(const FGBase& group); + + /** Add frame to segmentation object + * @param pixData Pixel data to be added. Length must be rows*columns bytes. + * For binary segmentations (bit depth i.e.\ Bits + * Allocated/Stored=1), each byte equal to 0 will be interpreted as + * "not set", while every other value is interpreted as "set". For + * fractional segmentations the full byte is copied as is. + * @param segmentNumber The logical segment number (>=1) this frame refers to. + * The segment identified by the segmentNumber must already exist. + * @param perFrameInformation The functional groups that identify this frame (i.e. + * which are planned to be not common for all other frames). The + * functional groups are copied, so ownership of each group stays + * with the caller no matter what the method returns. + * @return EC_Normal if adding was successful, error otherwise + */ + virtual OFCondition addFrame(Uint8* pixData, + const Uint16 segmentNumber, + const OFVector& perFrameInformation); + + /** Return reference to content content identification of this segmentation object + * @return Reference to content identification data + */ + virtual ContentIdentificationMacro& getContentIdentification(); + + /** Return reference to multi-fame dimension module + * @return Reference to multi-frame dimension module + */ + virtual IODMultiframeDimensionModule& getDimensions(); + + /** Set lossy compression flag of the segmentation object to "01". If one of the + * source images of this segmentation has undergone lossy compression then + * this function should be called. + * @param ratios Compression ratios (separated by backslash) of the applied + * lossy compression steps. Only one value (and no backslash) if only + * one step was performed. + * @param methods Methods (separated by backslash) of the applied + * lossy compression steps. Only one value (and no backslash) if only + * one step was performed. + * @param checkValues If OFTrue, the data provided is checked for validity + * @return EC_Normal if lossy compression info could be set, error code otherwise + */ + virtual OFCondition setLossyImageCompressionFlag(const OFString& ratios, + const OFString& methods, + const OFBool checkValues = OFTrue); + + /** Set equipment info for this segmentation object + * @param equipmentInfo The description of the equipment used to create + * this segmentation + * @param checkValue If OFTrue, the data provided is checked for validity + * @return EC_Normal if equipment information could be set successfully, error otherwise + */ + virtual OFCondition setEquipmentInfo(const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const OFBool checkValue = OFTrue); + + /** Set content identification info for this segmentation object + * @param contentIdentification The content identification of this segmentation + * @param checkValue If OFTrue, the data provided is checked for validity + * (as possible) + * @return EC_Normal if content identification could be set correctly, OFFalse otherwise + */ + virtual OFCondition setContentIdentification(const ContentIdentificationMacro& contentIdentification, + const OFBool checkValue = OFTrue); + + /** Import Patient, Study, and Frame of Reference level information from the + * given item. The method does only import Frame of Reference if Frame of + * Reference (FoR) UID is found in the image (and no error is reported if not). + * The reason is that if the source images of the segmentation do have an + * FoR, the segmentation object must have the same one, so we must import it. + * If the images do not have an FoR, we must not try at all importing it. + * If the log stream is set and valid the, the reason for any error might be + * obtained from the error/warning output. + * @param dataset Reference to DICOM dataset from which the document + * should be read + * @param takeOverCharset If OFTrue (default), Specific Character Set is + * taken over from imported dataset. If it's not + * present or empty (invalid), the attribute will + * not be present in this class either. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition importFromSourceImage(DcmItem& dataset, + const OFBool takeOverCharset = OFTrue); + + /** Import Patient, Study, and Frame of Reference level information from the + * given item. The method does only import Frame of Reference if Frame of + * Reference UID is found in the image (and no error is reported if not). + * The reason is that if the source images of the segmentation do have an + * FoR, the segmentation object must have the same one, so we must import it. + * If the images do not have an FoR, we must not try at all importing it. + * The current content of this object is not deleted before reading. + * If the log stream is set and valid the, the reason for any error might be + * obtained from the error/warning output. + * @param filename Reference to DICOM dataset from which the document + * should be read + * @param takeOverCharset If OFTrue (default), Specific Character Set is + * taken over from imported dataset. If it's not + * present or empty (invalid), the attribute will + * not be present in this class either. + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition importFromSourceImage(const OFString& filename, + const OFBool takeOverCharset = OFTrue); + +protected: + + /** Protected default constructor. Library users should the factory create..() + * method in order to create an object from scratch + */ + DcmSegmentation(); + + /** Overwrites DcmIODImage::read() + * @param dataset The dataset to read from + * @return EC_Normal if reading succeeded, error otherwise + */ + OFCondition read(DcmItem &dataset); + + /** Overwrites DcmIODImage::write() + * @param dataset The dataset to write to + * @return EC_Normal if writing succeeded, error otherwise + */ + OFCondition write(DcmItem &dataset); + + /** Create those data structures common for binary and fractional + * segmentations + * @param segmentation The segmentation object created + * @param rows The number of rows for the segmentation + * @param columns The number of columns for the segmentation + * @param equipmentInfo Equipment information + * @param contentIdentification Content meta information + * @return EC_Normal if creation was successful, error otherwise + */ + static OFCondition createCommon(DcmSegmentation*& segmentation, + const Uint16 rows, + const Uint16 columns, + const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification); + + /** Hide same function from IODImage since do not want the user to access + * the image pixel module manually. + * @return The Image Pixel Module + */ + virtual IODImagePixelModule& getImagePixel(); + + /** Initialize IOD rules + */ + virtual void initIODRules(); + + /** Read segments from given item + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition readSegments(DcmItem& item); + + /** Write fractional frames to given item + * @param dataset The item to write to, usually main dataset level + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeFractionalFrames(DcmItem& dataset); + + /** Write binary frames to given item + * @param dataset The item to write to, usually main dataset level + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeBinaryFrames(DcmItem& dataset); + + + /** Write Segmentation Image Module + * @param dataset The item to write to, usually main dataset level + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeSegmentationImageModule(DcmItem& dataset); + + /** Write Segments + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeSegments(DcmItem& item); + + /** Write Multi-Frame Functional Groups + * @param dataset The item to write to, usually main dataset level + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeMultiFrameFunctionalGroupsModule(DcmItem& dataset); + + /** Write Multi-Frame Dimension Module + * @param dataset The item to write to, usually main dataset level + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeMultiFrameDimensionModule(DcmItem& dataset); + + /** Read frames + * @param dataset Item to read from, usually main dataset level + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition readFrames(DcmItem& dataset); + + /** Get Image Pixel module attributes and perform some basic checking + * @param dataset Item to read from, usually main dataset level + * @param allocated Bits Allocated + * @param stored Bits Stored + * @param high High Bit + * @param spp Samples Per Pixel + * @param pixelRep Pixel Representation + * @param rows Rows + * @param cols Columns + * @param numberOfFrames The number of frames (as set in the dataset) + * @param colorModel The color model used + * @return EC_Normal if reading/checking was successful, error otherwise + */ + virtual OFCondition getAndCheckImagePixelAttributes(DcmItem& dataset, + Uint16& allocated, + Uint16& stored, + Uint16& high, + Uint16& spp, + Uint16& pixelRep, + Uint16& rows, + Uint16& cols, + Uint16& numberOfFrames, + OFString& colorModel); + + /** Extracts Frame structures from the given pixel data element. Only + * applicable for binary segmentations. Within the pixel data element, all + * frames are packed next to each other, with the end of one frame and the + * beginning of the next frame packed bit by bit next to each other. The + * resulting Frames are a bit-by-bit copy of their original counterpart. + * However, their first bit is aligned to the first bit/byte in the Frame, + * and the unused bits in the last byte (if any) are zeroed out. + * @param pixData The pixel data to read from + * @param numFrames The number of frames to read + * @param bitsPerFrame The number of bits per frame (usually rows * columns) + * @param results The resulting frames. Memory for the frames is allocated + * by the method, so the Vector can/should be empty before calling. + * @result Return EC_Normal on success, error otherwise + */ + virtual OFCondition extractFrames(Uint8* pixData, + const size_t numFrames, + const size_t bitsPerFrame, + OFVector< DcmIODTypes::Frame* >& results); + + /** This is the counterpart to the extractFrames() function. It takes a number + * of frames that are in binary segmentation format (i.e. "bit-packed") and + * concatenates them together so the resulting memory block fits the Pixel + * Data format for binary segmentations. Thus method ensure that frames + * are aligned bit for bit concatenated to each other with only (if + * applicable) having unused bits after the last frame. + * @param frames The source frames + * @param pixData The pixel data element data to be filled. Size must be + * at least bitsPerFrame * number of frames. + * @param bitsPerFrame Bits required per frame, usually rows * columns + */ + virtual void concatFrames(OFVector< DcmIODTypes::Frame* > frames, + Uint8* pixData, + const size_t bitsPerFrame); + + /** Add frame to segmentation object. + * @param pixData Pixel data to be added. Length must be rows*columns bytes. + * Pixel data is copied so it must be freed by the caller. + * @return EC_Normal if adding was successful, error otherwise + */ + virtual OFCondition addFrame(Uint8* pixData); + +private: + + // Modules supported: + // + // Patient Module (through DcmIODImage) + // Patient Study Module (through DcmIODImage) + // General Study Module (through DcmIODImage) + // General Series Module (through DcmIODImage) + // Segmentation Series Module + // Frame of Reference Module (through DcmIODImage) + // General Equipment Module (through DcmIODImage) + // Enhanced General Equipment Module (through DcmIODImage) + // General Image Module (through DcmIODImage) + // Image Pixel Module (through DcmIODImage) + // Segmentation Image Module (through this class) + // Multi-frame Functional Group Module + // Multi-Frame Dimension Module + // SOP Common Module (through DcmIODImage) + // Common Instance Reference Module (through DcmIODImage) + + /// Segmentation Series Module + IODSegmentationSeriesModule m_SegmentationSeries; + + /// IODEnhancedEquipmentModule + IODEnhGeneralEquipmentModule m_EnhancedGeneralEquipmentModule; + + /// Multi-frame Functional Groups module + IODMultiFrameFGModule m_FG; + + /// Multi-frame Dimension Module + IODMultiframeDimensionModule m_DimensionModule; + + /// Binary frame data + OFVector m_Frames; + + /* Image level information */ + + /// Image Type: (CS, VM 2-n, Type 1), in Segmentations fixed to "DERIVED\PRIMARY" + const OFString m_ImageType; + + // Instance Number: (IS, VM 1, Type 1) + + /// Content Identification Macro + ContentIdentificationMacro m_ContentIdentificationMacro; + + /// Segmentation Type: (CS, 1, 1) + DcmSegTypes::E_SegmentationType m_SegmentationType; + + /// Segmentation Fractional Type: (CS, 1, 1C) (required if FRACTIONAL) + DcmSegTypes::E_SegmentationFractionalType m_SegmentationFractionalType; + + /// Maximum Fractional Value: (US, 1, 1C) (required if fractional type is FRACTIONAL) + DcmUnsignedShort m_MaximumFractionalValue; + + /// Segment descriptions from Segment Sequence + OFVector m_Segments; + + /// Multi-frame Functional Groups high level interface + FGInterface m_FGInterface; + + // --------------- private helper functions ------------------- + + /** Clear old data + */ + void clearData(); + + /** Check the length of the pixel data + * @param pixelData The Pixel Data element + * @param rows Number of rows + * @param cols Number of columns + * @param numberOfFrames Number of frames + * @result OFTrue if length is valid, OFFalse otherwise + */ + OFBool checkPixDataLength(DcmElement* pixelData, + const Uint16 rows, + const Uint16 cols, + const Uint16& numberOfFrames); + + /** Loads file + * @param dcmff The file format to load into + * @param filename The filename of the file to load + * @param dset Pointer to dataset after loading + * @return EC_Normal if loading was successful, error otherwise + */ + static OFCondition loadFile(DcmFileFormat& dcmff, + const OFString& filename, + DcmDataset*& dset); + + /** Computes the number of total bytes required for the frame data of this + * segmentation object. Takes into account dimensions and number of frames, + * as well as the type of segmentation (member variables). May file if + * size_t type is not able to hold the result of intermediate computations. + * @param rows Number of rows of a frame + * @param cols Number of cols of a frame + * @param numberOfFrames The number of frames of the object + * @param bytesRequired Will hold the result of the computation, + * if successful. Does not any padding into account. + * @return EC_Normal if computation was possible, EC_TooManyBytesRequested + * otherwise. + */ + OFCondition getTotalBytesRequired(const Uint16& rows, + const Uint16& cols, + const Uint32& numberOfFrames, + size_t& bytesRequired); + + /** Read Fractional Type of segmentation. + * @param item The item to read from + * @return EC_Normal if type could be read, EC_TagNotFound if tag is not present, + * error otherwise + */ + OFCondition readSegmentationFractionalType(DcmItem& item); + + /** Read Segmentation Type of segmentation object + * @param item The item to read from + * @return EC_Normal if type could be read, EC_TagNotFound if tag is not present, + * error otherwise + */ + OFCondition readSegmentationType(DcmItem& item); + + /** Decompress the given dataset + * @param dset The dataset to be decompressed + * @return EC_Normal if decompression worked (or dataset has already been + * decompressed), IOD_EC_CannotDecompress otherwise + */ + static OFCondition decompress(DcmDataset& dset); + +}; + +#endif // SEGDOC_H diff --git a/dcmseg/include/dcmtk/dcmseg/segment.h b/dcmseg/include/dcmtk/dcmseg/segment.h new file mode 100644 index 00000000..f2f0d444 --- /dev/null +++ b/dcmseg/include/dcmtk/dcmseg/segment.h @@ -0,0 +1,338 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Class representing a Segment from the Segment Ident. Sequence + * + */ + +#ifndef SEGMENT_H +#define SEGMENT_H + +#include "dcmtk/config/osconfig.h" // include OS configuration first +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmseg/segtypes.h" +#include "dcmtk/dcmseg/segdoc.h" + +/** Class representing a segment from the Segment Identification Sequence, + * as used within the Segmentation Image Module. It includes the Segment + * Description Macro. + */ + +class DCMTK_DCMSEG_EXPORT DcmSegment +{ + +public: + + // -------------- constructors/destructors -------------------- + + // constructor is protected + + /** Destructor, frees memory + */ + virtual ~DcmSegment(); + + /** Clears all data + */ + virtual void clearData(); + + // -------------- creation -------------------- + + /** Factory method to create a Segment that expects the minimal parameters + * required. + * @param segment Pointer to the resulting segment if creation was + * successful; memory is allocated by the function + * @param segmentLabel Free text label for the segment + * @param segmentedPropertyCategory The segmented property category. + * Baseline CID 7150 “Segmentation Property Categories” should be + * used. + * @param segmentedPropertyType The segmented property type. Baseline CID + * 7151 “Segmentation Property Types” + * @param algoType The algorithm type used for segmenting this segment + * @param algoName Algorithm name (required if algoType is not MANUAL) + * @return EC_Normal if creation was successful, error otherwise + */ + static OFCondition create(DcmSegment*& segment, + const OFString& segmentLabel, + const CodeSequenceMacro& segmentedPropertyCategory, + const CodeSequenceMacro& segmentedPropertyType, + const DcmSegTypes::E_SegmentAlgoType algoType, + const OFString& algoName = ""); + + // ---------------- writing -------------------- + + /** Write segment to given item which is usually contained within + * within the Segment Sequence + * @param item The item to write to + * @return EC_Normal if successful, error otherwise + */ + OFCondition write(DcmItem& item); + + // ---------------- reading -------------------- + + /** Read segment from given item + * @param item The item to read from (must be item as found in the + * Segment Identification Sequence) + * @param clearOldData If true, old data is deleted first + * @return EC_Normal if reading was successful, error otherwise + */ + OFCondition read(DcmItem& item, + const OFBool clearOldData = OFTrue); + + // ---------------- access -------------------- + + /** Get Segment Number + * @return The Segment number + */ + virtual unsigned int getSegmentNumber(); + + /** Get Segment Label + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSegmentLabel(OFString& value, + const signed long pos = 0); + + /** Get Segment Description + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSegmentDescription(OFString& value, + const signed long pos = 0); + + /** Get the Segment Algorithm Type. + * @return The Algorithm Type + */ + virtual DcmSegTypes::E_SegmentAlgoType getSegmentAlgorithmType(); + + /** Get the Segment Algorithm Name + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSegmentAlgorithmName(OFString& value, + const signed long pos = 0); + + /** Get General Anatomy Code + * @return Reference to the General Anatomy Macro, may be unset + */ + virtual GeneralAnatomyMacro& getGeneralAnatomyCode(); + + /** Get Segmented Property Category Code + * @return Reference to the Segmented Property Category Code, may be unset + */ + virtual CodeSequenceMacro& getSegmentedPropertyCategoryCode(); + + /** Get Segmented Property Type Code + * @return Reference to the Segmented Property Type Code, may be unset + */ + virtual CodeSequenceMacro& getSegmentedPropertyTypeCode(); + + /** Get Segmented Property Type Modifier Code + * @return Reference to the Segmented Property Type Modifier Code, may + * be unset + */ + virtual OFVector& getSegmentedPropertyTypeModifierCode(); + + /** Get Segmentation Algorithm Identification + * @warning This method has earlier been named getSegmentSurfaceGenerationAlgorithmIdentification() + * which has changed due to DICOM CP-1597. The code value returned is now + * taken from the "Segmentation Algorithm Identification Sequence" instead of the + * "Segment Surface Generation Algorithm Identification Sequence". + * @return Reference to the Segmentation Algorithm Identification + * Identification, may be unset + */ + virtual AlgorithmIdentificationMacro& getSegmentationAlgorithmIdentification(); + + /** Get Recommended Display Grayscale Value + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1) + * @return EC_Normal if successful, an error code otherwise + */ virtual OFCondition getRecommendedDisplayGrayscaleValue(Uint16& value, + const unsigned long pos = 0); + + /** Returns Recommended Display CIELab Value + * @param L The L component + * @param a The a* component + * @param b The b* component + * @return EC_Normal if values could be returned + */ + virtual OFCondition getRecommendedDisplayCIELabValue(Uint16& L, + Uint16& a, + Uint16& b); + + /** Get Tracking ID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTrackingID(OFString& value, + const signed long pos = 0); + + /** Get Tracking UID + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTrackingUID(OFString& value, + const signed long pos = 0); + + + // -------------- setters -------------------- + + /** Set Segment Label + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSegmentLabel(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Segment Label + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (ST) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSegmentDescription(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Segment Algorithm + * @param algoType Algorithm type used to find segment + * @param algoName Name of the algorithm used (required if algorithm type + * is not MANUAL + * @param checkValue If OFTrue, input is checked for validity + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setSegmentAlgorithm(const DcmSegTypes::E_SegmentAlgoType algoType, + const OFString& algoName, + const OFBool checkValue = OFTrue); + + /** Set Segmentation Algorithm Identification + * @warning This method has earlier been named setSegmentSurfaceGenerationAlgorithmIdentification() + * which has changed due to DICOM CP-1597. The resulting code value is now + * written to the "Segmentation Algorithm Identification Sequence" instead of the + * "Segment Surface Generation Algorithm Identification Sequence". + * @param value The algorithm identification + * @param checkValue If OFTrue, value undergoes some validity checks + * @return EC_Normal if setting was successful, error otherwise + */ + virtual OFCondition setSegmentationAlgorithmIdentification(const AlgorithmIdentificationMacro& value, + const OFBool checkValue = OFTrue); + + /** Set Recommended Display Grayscale Value + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for validity if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecommendedDisplayGrayscaleValue(const Uint16 value, + const OFBool checkValue = OFTrue); + + /** Set Recommended Display CIELab Value + * @param L L component + * @param a a component + * @param b b component + * @param checkValue Check 'value' for validity if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRecommendedDisplayCIELabValue(const Uint16 L, + const Uint16 a, + const Uint16 b, + const OFBool checkValue = OFTrue); + + /** Set Tracking ID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTrackingID(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Tracking UID + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (UI) and VM (1) if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTrackingUID(const OFString& value, + const OFBool checkValue = OFTrue); + + /// The utility class must access the protected default constructor + friend class DcmIODUtil; + +protected: + + /** Protected default constructor + */ + DcmSegment(); + + /** Initialize IOD rules for this component + */ + virtual void initIODRules(); + + /** Set reference to the Segmentation object that this segment belongs to. + * This is used to find the Segment Number this Segment has within the + * Segmentation. + * @param doc Pointer to the Segmentation object + */ + void referenceSegmentationDoc(DcmSegmentation* doc); + + +private: + + /** Private undefined copy constructor + */ + DcmSegment(const DcmSegment&); + + /** Private undefined assignment operator + * @return Reference to "this" class + */ + DcmSegment& operator=(const DcmSegment&); + + /// The segmentation document where this segment is located in + DcmSegmentation* m_SegmentationDoc; + + /// Segment Description Macro + SegmentDescriptionMacro m_SegmentDescription; + + /// Segment Algorithm Name: (LO, 1, 1C) + DcmLongString m_SegmentAlgorithmName; + + /// Segmentation Algorithm Identification (SQ, 1, 3). + /// This attribute has earlier been named m_SegmentationSurfaceGenerationAlgorithmIdentification + /// representing the related sequence. This has been changed in favor of the + /// Segmentation Algorithm Identification Sequence due to DICOM CP-1597. + AlgorithmIdentificationMacro m_SegmentationAlgorithmIdentification; + + /// Recommended Display Grayscale Value (US, 1, 3) + DcmUnsignedShort m_RecommendedDisplayGrayscaleValue; + + /// Recommended Display CIELab Value (US, 3, 3) + DcmUnsignedShort m_RecommendedDisplayCIELabValue; + + /// Tracking ID (UT, 1, 1C) + DcmUnlimitedText m_TrackingID; + + /// Tracking UID (UI, 1, 1C) + DcmUniqueIdentifier m_TrackingUID; + + /// Rules for data elements within this IOD + IODRules m_Rules; +}; + +#endif // SEGMENT_H diff --git a/dcmseg/include/dcmtk/dcmseg/segtypes.h b/dcmseg/include/dcmtk/dcmseg/segtypes.h new file mode 100644 index 00000000..283beb4d --- /dev/null +++ b/dcmseg/include/dcmtk/dcmseg/segtypes.h @@ -0,0 +1,363 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Class managing various segmentation-typical types + * + */ + +#ifndef SEGTYPES_H +#define SEGTYPES_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmseg/segdef.h" + +/* + * * Logging + */ + +extern OFString c; +extern DCMTK_DCMSEG_EXPORT OFLogger DCM_dcmsegLogger; + +#define DCMSEG_TRACE(msg) OFLOG_TRACE(DCM_dcmsegLogger, msg) +#define DCMSEG_DEBUG(msg) OFLOG_DEBUG(DCM_dcmsegLogger, msg) +#define DCMSEG_INFO(msg) OFLOG_INFO(DCM_dcmsegLogger, msg) +#define DCMSEG_WARN(msg) OFLOG_WARN(DCM_dcmsegLogger, msg) +#define DCMSEG_ERROR(msg) OFLOG_ERROR(DCM_dcmsegLogger, msg) +#define DCMSEG_FATAL(msg) OFLOG_FATAL(DCM_dcmsegLogger, msg) + +// include this file in doxygen documentation + +/** @file segtypes.h + * @brief type definitions, constants and helper classes for the dcmseg module + */ + +/*-----------------------* + * constant definitions * + *-----------------------*/ + +/** DICOM assigns unique number to each Segment within the Segmentation object + * using an unsigned 16 Bit Integer within "Segment Number" starting with 1. + * Thus maximally 65535 segments can be stored. + */ +const Uint32 DCM_SEG_MAX_SEGMENTS = 65535; + +/** @name Specific error conditions for module dcmseg + * These error codes can be used in addition to the general purpose + * codes defined in module dcmdata. + */ +//@{ + +/// error: specified functional group is already existing +extern DCMTK_DCMSEG_EXPORT const OFConditionConst SG_EC_MaxSegmentsReached; +/// error: specified segment does not exist +extern DCMTK_DCMSEG_EXPORT const OFConditionConst SG_EC_NoSuchSegment; +/// error: unknown segmentation type +extern DCMTK_DCMSEG_EXPORT const OFConditionConst SG_EC_UnknownSegmentationType; +/// error: invalid value +extern DCMTK_DCMSEG_EXPORT const OFConditionConst SG_EC_InvalidValue; +/// error: not enough data +extern DCMTK_DCMSEG_EXPORT const OFConditionConst SG_EC_NotEnoughData; + +/** General purpose class hiding global functions, constants and types in the + * segmentation context from the global namespace. + */ +class DCMTK_DCMSEG_EXPORT DcmSegTypes +{ + + public: + + /** Segmentation object types + */ + enum E_SegmentationType + { + /// Unknown (e.g.\ not initialized) + ST_UNKNOWN, + /// Binary segmentation with 1 bit depth denoting whether a pixel + /// belongs to a segmentation or not. + ST_BINARY, + /// Fractional segmentation where fraction specifies how much of voxel + /// is occupied by the segment + ST_FRACTIONAL + }; + + /** Segment Algorithm Type + */ + enum E_SegmentAlgoType + { + /// Unknown (e.g.\ not initialized) + SAT_UNKNOWN, + /// Calculated segment + SAT_AUTOMATIC, + /// Calculated segment with user interaction + SAT_SEMIAUTOMATIC, + /// Manual segment creation + SAT_MANUAL + }; + + + /** Segmentation object Fractional Type + */ + enum E_SegmentationFractionalType + { + /// Unknown (e.g.\ not initialized) + SFT_UNKNOWN, + /// For fractional segmentations, a value defines probability that pixel belongs to segment + SFT_PROBABILITY, + /// For fractional segmentations, a value defines how much of the pixel is covered by the segment + SFT_OCCUPANCY + }; + + + // -- helper functions -- + + /** Return string representation of algorithm type + * @param algo The algorithm type + * @return The algorithm type as a string + */ + static OFString algoType2OFString(E_SegmentAlgoType algo ); + + /** Return enum representation of algorithm type string as found in + * segmentation objects + * @param algoType The algorithm type as a string + * @return The algorithm type as enum value + */ + static E_SegmentAlgoType OFString2AlgoType(const OFString& algoType); + + /** Return enum representation of segmentation type string as found in + * segmentation objects + * @param value The segmentation type as a string + * @return The segmentation type as enum value + */ + static DcmSegTypes::E_SegmentationType OFString2Segtype( const OFString& value ); + + /** Return string representation from segmentation enum type + * @param value The segmentation type as enum value + * @return The segmentation type as a string + */ + static OFString segtype2OFString( const DcmSegTypes::E_SegmentationType& value ); + + /** Return enum representation of fractional type string as found in + * segmentation objects + * @param value The fractional type as a string + * @return The fractional type as enum value + */ + static DcmSegTypes::E_SegmentationFractionalType OFString2FractionalType( const OFString& value ); +}; + +/** Class representing the Segmented Property Type Code and Segmented + * Property Type Code Modifier Code Sequence + */ +class DCMTK_DCMSEG_EXPORT SegmentedPropertyTypeCodeItem +{ + +public: + + /// Easy access to containing class + friend class SegmentDescriptionMacro; + + /** Constructor + */ + SegmentedPropertyTypeCodeItem(); + + /** Virtual destructor, frees memory + */ + virtual ~SegmentedPropertyTypeCodeItem(); + + /** Clear all data + */ + virtual void clearData(); + + /** Check whether class has valid data + * @param quiet If OFTrue, check will not produce any warnings or errors + * on the logger. Default is OFFalse. + * @return EC_Normal if data is valid, error otherwise + */ + virtual OFCondition check(const OFBool quiet = OFFalse); + + /** Read data from given item + * @param item The item to read from + * @param clearOldData If OFTrue, old data is cleared before reading + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item, + const OFBool clearOldData = OFTrue); + + /** Write data to given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + +protected: + + /** Check whether the modifier codes are ok + * @param quiet If OFTrue, no warnings or errors will be printed to the + * loggers. Default is OFFalse. + * @return EC_Normal if data is ok, error otherwise + */ + OFCondition checkModifiers(const OFBool quiet = OFFalse); + +private: + + /// Segmented Property Type Code (SQ,1,1) + /// Baseline CID 7151 + CodeSequenceMacro m_SegmentedPropertyTypeCode; + + /// Segmented Property Type Modifier Code (SQ, VM 1-n, Type 3) + OFVector m_SegmentedPropertyTypeModifierCode; +}; + +/** Class representing the Segment Description Macro + */ +class DCMTK_DCMSEG_EXPORT SegmentDescriptionMacro +{ + +public: + + /** Constructor + */ + SegmentDescriptionMacro(); + + /** Virtual destructor, frees memory + */ + virtual ~SegmentDescriptionMacro(); + + /** Clear all data + */ + virtual void clearData(); + + /** Read class data from given item + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition read(DcmItem& item); + + /** Writes the data from this class to given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition write(DcmItem& item); + + /** Get Segment Label + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSegmentLabel(OFString& value, + const signed long pos = 0); + + /** Get Segment Description + * @param value Reference to variable in which the value should be stored + * @param pos Index of the value to get (0..vm-1), -1 for all components + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSegmentDescription(OFString& value, + const signed long pos = 0); + + /** Get Segment Algorithm Type + * @return The algorithm type + */ + virtual DcmSegTypes::E_SegmentAlgoType getSegmentAlgorithmType(); + + /** Get reference to General Anatomy Code + * @return Reference to General Anatomy Code + */ + virtual GeneralAnatomyMacro& getGeneralAnatomyCode(); + + /** Get Reference to Segmented Property Category Code + * @return Reference to Segmented Property Category Code + */ + virtual CodeSequenceMacro& getSegmentedPropertyCategoryCode(); + + /** Get Reference to Segmented Property Type Code + * @return Reference to Segmented Property Type Code + */ + virtual CodeSequenceMacro& getSegmentedPropertyTypeCode(); + + /** Get Reference to Segmented Property Type Modifier Codes + * @return Reference to Segmented Property Type Modifier Codes + */ + virtual OFVector& getSegmentedPropertyTypeModifier(); + + /** Set Segment Label + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value' for conformance with VR (LO) and VM (1) + * if enabled + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSegmentLabel(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Segment Description + * @param value Value to be set (single value only) or "" for no value + * @param checkValue Check 'value'. Not evaluated (here for consistency + * with other setter functions). + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSegmentDescription(const OFString& value, + const OFBool checkValue = OFTrue); + + /** Set Segment Algorithm Type + * @param value Value to be set + * @return EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSegmentAlgorithmType(const DcmSegTypes::E_SegmentAlgoType value); + +protected: + + /** Read Segment Algorithm Type from given item + * @param item The item to read from + * @return EC_Normal if reading was successful, error otherwise + */ + virtual OFCondition readSegmentAlgorithmType(DcmItem& item); + + /** Write Segment Algorithm Type to given item + * @param item The item to write to + * @return EC_Normal if writing was successful, error otherwise + */ + virtual OFCondition writeSegmentAlgorithmType(DcmItem& item); + + +private: + + // Segment Number: (US, VM 1, Type 1): Computed by position in vector of DcmSegmentation + // DcmUnsignedShort m_SegmentNumber; + /// Segment Number: (LO, VM 1, Type 1) + DcmLongString m_SegmentLabel; + + /// Segment Description: (ST, 1, Type 3) + DcmShortText m_SegmentDescription; + + /// Segment Algorithm Type: (CS, 1, Type 1) + DcmSegTypes::E_SegmentAlgoType m_SegmentAlgorithmType; + + /// General Anatomy Mandatory Macro + GeneralAnatomyMacro m_GeneralAnatomyCode; + + /// Segment Property Category Code (SQ, 1, 1) + /// Baseline CID 7150 + CodeSequenceMacro m_SegmentedPropertyCategoryCode; + + /// Segmented Property Type Code + SegmentedPropertyTypeCodeItem m_SegmentedPropertyType; + +}; + + +#endif // SEGTYPES_H diff --git a/dcmseg/include/dcmtk/dcmseg/segutils.h b/dcmseg/include/dcmtk/dcmseg/segutils.h new file mode 100644 index 00000000..91d4cde1 --- /dev/null +++ b/dcmseg/include/dcmtk/dcmseg/segutils.h @@ -0,0 +1,135 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Helper functions for the dcmseg module + * + */ + +#ifndef SEGUTILS_H +#define SEGUTILS_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmseg/segdef.h" +#include "dcmtk/dcmseg/segtypes.h" + +/** Class that contains helper functionality for the dcmseg module + */ +class DCMTK_DCMSEG_EXPORT DcmSegUtils +{ + +public: + + /** Pack the given segmentation pixel data, provided "unpacked", into + * the packed format expected by DICOM + * @param pixelData Pixel data in unpacked format + * @param rows Number of rows in the pixel data + * @param columns The number of columns in the pixel data + * @return The frame data if successful, NULL if an error occurs + */ + static DcmIODTypes::Frame* packBinaryFrame(const Uint8* pixelData, + const Uint16 rows, + const Uint16 columns); + + /** Compute the number of bytes required for a binary pixel data frame, + * given the number of pixels + * @param numPixels The total number of pixels + * @return The number of bytes required to pack the data into a binary + * segmentation frame + */ + static size_t getBytesForBinaryFrame(const size_t& numPixels); + + /** Unpacks a binary segmentation frame into a "sparse" pixel data frame where + * every resulting byte represents a single bit of the frame being either + * 0 (not set) or 1 (set). + * @param frame The input buffer with the frame in packed format + * @param rows The rows of the frame + * @param cols The cols of the frame + * @return The segmentation frame in unpacked format. NULL in case of error. + */ + static DcmIODTypes::Frame* unpackBinaryFrame(const DcmIODTypes::Frame* frame, + Uint16 rows, + Uint16 cols); + + /** Aligns 1 bit per pixel frame data to make the frame start at a + * specific bit position within the first byte. This is used in the context + * that dcmseg holds the frames in memory aligned to exact byte positions, + * while the DICOM encoding might require a frame to start at an arbitrary + * bit position since all (1 bit per pixel) frames are directly concatenated + * one after another (i.e. if one frame does not occupy a number of bits + * dividable by 8, not all frames will be aligned at exact byte positions). + * Note that each byte is filled from the right, i.e. the first pixel will + * represented by the bit at the very right of the first byte, and the 9th + * pixel will be in the very right position of the following byte. + * This is not a regular bit shift operation since the bits from the previous + * frame are on the left of the byte, but must be aligned at the right. The + * current frame starts from the first bit, occupying the unused bits of + * the last frame and then continuing in the next byte at the first bit + * from the left. + * Example for two bit shift: + * Input buffer bytes: hgfedcba 87654321 + * Result: fedcba00 654321hg + * The 00 in the first byte must be handled by the caller (will + * contain the two bits of the previous frame). + * See also dcmseg/tests/tutils.cc for more examples. + * @param buf The address of the memory buffer to shift + * @param bufLen The length of the buf memory block in bytes + * @param numBits The number of bits to shift. Must be 0 <= numBits <= 7. + */ + static void alignFrameOnBitPosition(Uint8* buf, + size_t bufLen, + Uint8 numBits); + + /** Aligns 1 bit per pixel frame data starting at a given bit position in the + * provided buffer with the start of that buffer. This is used to create + * a frame structure where all the bytes (including the first one) only + * contain data from the frame at hand. + * Note that each byte is filled from the right, i.e. the first pixel will + * represented by the bit at the very right of the first byte, and the 9th + * pixel will be in the very right position of the following byte. + * Example: + * 3 bytes input buffer: edcbaZYX mlkjihgf utsrqpon + * Result after aligning 3 bits: fghedcba ponmlkji 000utsrq + * The 000 are unused bits and therefore zeroed out in the last byte. Bits + * ZYX will be shifted out which is ok since it does not belong to the + * current frame. See also dcmseg/tests/tutils.cc for more examples. + * @param buf The address of the memory buffer to shift + * @param bufLen The length of the buf memory block in bytes + * @param numBits The number of bits to shift. Must be 0 <= numBits <= 7. + */ + static void alignFrameOnByteBoundary(Uint8* buf, + size_t bufLen, + Uint8 numBits); + + /** Dumps a byte as binary number to a string. Only useful for + * debugging purposes. + * @param b The byte to dump + * @return A string containing b as a binary number + */ + static OFString debugByte2Bin(Uint8 b); + + /** Dumps a memory block byte for byte to the debug log stream. Only useful + * for debugging purposes. + * @param buffer The address of the memory block to dump + * @param length The length of memory to be dumped + * @param what String describing what is dumped. + */ + static void debugDumpBin(Uint8* buffer, + size_t length, + const char* what); +}; + +#endif // SEGUTILS_H diff --git a/dcmseg/libsrc/CMakeLists.txt b/dcmseg/libsrc/CMakeLists.txt new file mode 100644 index 00000000..a315d539 --- /dev/null +++ b/dcmseg/libsrc/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmseg segdoc segment segtypes segutils) + +DCMTK_TARGET_LINK_MODULES(dcmseg dcmfg dcmiod dcmdata ofstd oflog) diff --git a/dcmseg/libsrc/Makefile.dep b/dcmseg/libsrc/Makefile.dep new file mode 100644 index 00000000..c3e4e7b1 --- /dev/null +++ b/dcmseg/libsrc/Makefile.dep @@ -0,0 +1,570 @@ +segdoc.o: segdoc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../include/dcmtk/dcmseg/segdoc.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodimage.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../ofstd/include/dcmtk/ofstd/ofvriant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/variant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/helpers.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../ofstd/include/dcmtk/ofstd/ofdiag.h \ + ../../ofstd/include/dcmtk/ofstd/diag/push.def \ + ../../ofstd/include/dcmtk/ofstd/diag/cnvrsn.def \ + ../../ofstd/include/dcmtk/ofstd/diag/vsprfw.def \ + ../../ofstd/include/dcmtk/ofstd/diag/pop.def \ + ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfor.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \ + ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralimage.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixel.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsegmentationseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modenhequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframefg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h \ + ../../dcmfg/include/dcmtk/dcmfg/fginterface.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmfg/include/dcmtk/dcmfg/fg.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgbase.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgfracon.h \ + ../include/dcmtk/dcmseg/segtypes.h ../include/dcmtk/dcmseg/segdef.h \ + ../include/dcmtk/dcmseg/segment.h ../include/dcmtk/dcmseg/segutils.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgseg.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgplanpo.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgplanor.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgfact.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgderimg.h +segment.o: segment.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../include/dcmtk/dcmseg/segment.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmseg/segtypes.h ../include/dcmtk/dcmseg/segdef.h \ + ../include/dcmtk/dcmseg/segdoc.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodimage.h \ + ../../ofstd/include/dcmtk/ofstd/ofvriant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/variant.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/helpers.h \ + ../../ofstd/include/dcmtk/ofstd/ofalign.h \ + ../../ofstd/include/dcmtk/ofstd/ofdiag.h \ + ../../ofstd/include/dcmtk/ofstd/diag/push.def \ + ../../ofstd/include/dcmtk/ofstd/diag/cnvrsn.def \ + ../../ofstd/include/dcmtk/ofstd/diag/vsprfw.def \ + ../../ofstd/include/dcmtk/ofstd/diag/pop.def \ + ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \ + ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \ + ../../ofstd/include/dcmtk/ofstd/ofoption.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \ + ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modfor.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \ + ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h \ + ../../dcmiod/include/dcmtk/dcmiod/modgeneralimage.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelvariant.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixelbase.h \ + ../../dcmiod/include/dcmtk/dcmiod/modimagepixel.h \ + ../../dcmiod/include/dcmtk/dcmiod/modsegmentationseries.h \ + ../../dcmiod/include/dcmtk/dcmiod/modenhequipment.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframefg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modmultiframedimension.h \ + ../../dcmfg/include/dcmtk/dcmfg/fginterface.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgtypes.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgdefine.h \ + ../../dcmfg/include/dcmtk/dcmfg/fg.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgbase.h \ + ../../dcmfg/include/dcmtk/dcmfg/fgfracon.h +segtypes.o: segtypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h \ + ../include/dcmtk/dcmseg/segtypes.h ../include/dcmtk/dcmseg/segdef.h +segutils.o: segutils.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmseg/segutils.h ../include/dcmtk/dcmseg/segdef.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmseg/segtypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h diff --git a/dcmseg/libsrc/Makefile.in b/dcmseg/libsrc/Makefile.in new file mode 100644 index 00000000..fc2515d6 --- /dev/null +++ b/dcmseg/libsrc/Makefile.in @@ -0,0 +1,56 @@ +# +# Makefile for dcmseg/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmioddir = $(top_srcdir)/../dcmiod +dcmfgdir = $(top_srcdir)/../dcmfg + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmioddir)/include \ + -I$(dcmfgdir)/include + +LOCALDEFS = + +objs = segdoc.o segment.o segtypes.o segutils.o + + +library = libdcmseg.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmseg/libsrc/segdoc.cc b/dcmseg/libsrc/segdoc.cc new file mode 100644 index 00000000..482c9319 --- /dev/null +++ b/dcmseg/libsrc/segdoc.cc @@ -0,0 +1,1480 @@ +/* + * + * Copyright (C) 2015-2019, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Class representing a Segmentation object + * + */ +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmseg/segdoc.h" +#include "dcmtk/dcmseg/segment.h" +#include "dcmtk/dcmseg/segutils.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmfg/fgseg.h" +#include "dcmtk/dcmfg/fgplanpo.h" +#include "dcmtk/dcmfg/fgplanor.h" +#include "dcmtk/dcmfg/fgfracon.h" +#include "dcmtk/dcmfg/fgfact.h" +#include "dcmtk/dcmfg/fgderimg.h" + +// default constructor (protected, instance creation via create() function) +DcmSegmentation::DcmSegmentation() +: DcmSegmentation::IODImage(OFin_place >), + m_SegmentationSeries(DcmSegmentation::IODImage::getData(), DcmSegmentation::IODImage::getRules()), + m_EnhancedGeneralEquipmentModule(DcmSegmentation::IODImage::getData(), DcmSegmentation::IODImage::getRules()), + m_FG(DcmSegmentation::IODImage::getData(), DcmSegmentation::IODImage::getRules()), + m_DimensionModule(DcmSegmentation::IODImage::getData(), DcmSegmentation::IODImage::getRules()), + m_Frames(), + m_ImageType("DERIVED\\PRIMARY"), + m_ContentIdentificationMacro(), + m_SegmentationType(DcmSegTypes::ST_BINARY), + m_SegmentationFractionalType(DcmSegTypes::SFT_OCCUPANCY), + m_MaximumFractionalValue(DCM_MaximumFractionalValue), + m_Segments(), + m_FGInterface() +{ + DcmSegmentation::initIODRules(); +} + + +void DcmSegmentation::initIODRules() +{ + // ------------ Segmentation Image Module ------------- + + // Partly overrides rules from General Image Module + getRules()->addRule(new IODRule(DCM_ImageType, "2","1", "SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + getRules()->addRule(new IODRule(DCM_SegmentationType, "1","1", "SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + getRules()->addRule(new IODRule(DCM_SegmentationFractionalType, "1","1C", "SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + getRules()->addRule(new IODRule(DCM_MaximumFractionalValue, "1","1C", "SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + + // Re-use General Image Module instead of Segmentation Image Module + getRules()->addRule(new IODRule(DCM_LossyImageCompression, "1","1", "GeneralImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + getRules()->addRule(new IODRule(DCM_LossyImageCompressionMethod, "1-n", "1C", "GeneralImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + getRules()->addRule(new IODRule(DCM_LossyImageCompressionRatio, "1-n","1C", "GeneralImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + + // Override rule from General Series Module + getRules()->addRule(new IODRule(DCM_ReferencedPerformedProcedureStepSequence, "1","1C", "SegmentationSeriesModule", DcmIODTypes::IE_SERIES), OFTrue); + getRules()->addRule(new IODRule(DCM_SeriesNumber, "1","1", "SegmentationSeriesModule", DcmIODTypes::IE_SERIES), OFTrue); + + // Instance Number is also used within Content Identification Macro, disable it there + m_ContentIdentificationMacro.getIODRules().deleteRule(DCM_InstanceNumber); +} + + +DcmSegmentation::~DcmSegmentation() +{ + clearData(); +} + + +// static method for loading segmentation objects +OFCondition DcmSegmentation::loadFile(const OFString& filename, + DcmSegmentation*& segmentation) +{ + DcmFileFormat dcmff; + DcmDataset *dataset = NULL; + OFCondition result = loadFile(dcmff, filename, dataset); + if (result.bad()) + return result; + + return loadDataset(*dataset, segmentation); +} + + +// static method for loading segmentation objects +OFCondition DcmSegmentation::loadDataset(DcmDataset& dataset, + DcmSegmentation*& segmentation) +{ + OFCondition result = DcmSegmentation::decompress(dataset); + if (result.bad()) + return result; + + segmentation = new DcmSegmentation(); + if (segmentation == NULL) + { + return EC_MemoryExhausted; + } + + return segmentation->read(dataset); + +} + + +OFCondition DcmSegmentation::createBinarySegmentation(DcmSegmentation*& segmentation, + const Uint16 rows, + const Uint16 columns, + const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification) +{ + + OFCondition result = createCommon(segmentation, rows, columns, equipmentInfo, contentIdentification); + if (result.bad()) + return result; + + segmentation->m_SegmentationType = DcmSegTypes::ST_BINARY; + + return result; +} + + +OFCondition DcmSegmentation::createFractionalSegmentation(DcmSegmentation*& segmentation, + const Uint16 rows, + const Uint16 columns, + const DcmSegTypes::E_SegmentationFractionalType fractType, + const Uint16& maxFractionalValue, + const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification) +{ + OFCondition result = createCommon(segmentation, rows, columns, equipmentInfo, contentIdentification); + if (result.bad()) + return result; + + segmentation->m_SegmentationType = DcmSegTypes::ST_FRACTIONAL; + segmentation->m_SegmentationFractionalType = fractType; + segmentation->m_MaximumFractionalValue.putUint16(maxFractionalValue); + + return result; +} + + +OFCondition DcmSegmentation::createCommon(DcmSegmentation*& segmentation, + const Uint16 rows, + const Uint16 columns, + const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const ContentIdentificationMacro& contentIdentification) +{ + if ( (rows == 0) || (columns == 0) ) + { + DCMSEG_ERROR("Segmentation must have at least 1 row and 1 column"); + return EC_IllegalParameter; + } + + segmentation = new DcmSegmentation(); + if (segmentation == NULL) + return EC_MemoryExhausted; + + segmentation->getImagePixel().setRows(rows); + segmentation->getImagePixel().setColumns(columns); + + OFCondition result = segmentation->setContentIdentification(contentIdentification); + if (result.good()) + { + OFString tempstr; + contentIdentification.getInstanceNumber(tempstr); + result = segmentation->getGeneralImage().setInstanceNumber(tempstr); + if (result.bad()) + { + delete segmentation; + segmentation = NULL; + return EC_InvalidValue; + } + + DcmIODUtil::setContentDateAndTimeNow(segmentation->getGeneralImage()); + result = segmentation->setEquipmentInfo(equipmentInfo, OFTrue /* check */); + } + + if (result.bad()) + { + delete segmentation; + segmentation = NULL; + } + + return result; +} + + +FGDerivationImage* DcmSegmentation::createDerivationImageFG(const OFVector< ImageSOPInstanceReferenceMacro >& derivationImages, + const OFString& derivationDescription) +{ + CodeSequenceMacro derivationCode("113076", "DCM", "Segmentation"); + CodeSequenceMacro purpose("121322", "DCM", "Source Image for Image Processing Operation"); + return FGDerivationImage::createMinimal(derivationImages, + derivationDescription, + derivationCode, + purpose); +} + + +OFCondition DcmSegmentation::read(DcmItem &dataset) +{ + + OFString sopClass; + if (DcmIODUtil::checkSOPClass(&dataset, UID_SegmentationStorage, sopClass).bad()) + { + DCMSEG_ERROR("Given file does not seem to be a segmentation storage object since SOP class is: " << sopClass); + return IOD_EC_WrongSOPClass; + } + + // Read attributes in base classes + DcmSegmentation::IODImage::read(dataset); + + // Read Segmentation Series Module + m_SegmentationSeries.read(dataset); + + // Read Enhanced General Equipment (i.e. make sure all type 1 elements are + // there, which is not checked in General Equipment Module being part of + // DcmIODImage. + m_EnhancedGeneralEquipmentModule.read(dataset); + + // Read functional groups module + m_FG.read(dataset); + + // Read functional groups itself + m_FGInterface.read(dataset); + + // Read dimension information + m_DimensionModule.read(dataset); + + readSegmentationType(dataset); + + readSegments(dataset); + + readFrames(dataset); + + readSegmentationFractionalType(dataset); + + m_ContentIdentificationMacro.read(dataset); + + // Read specific segmentation elements + DcmIODUtil::getAndCheckElementFromDataset(dataset, m_MaximumFractionalValue, getRules()->getByTag(DCM_MaximumFractionalValue)); + + return EC_Normal; +} + + +void DcmSegmentation::setCheckFGOnWrite(const OFBool doCheck) +{ + m_FGInterface.setCheckOnWrite(doCheck); +} + + +OFBool DcmSegmentation::getCheckFGOnWrite() +{ + return m_FGInterface.getCheckOnWrite(); +} + + +OFCondition DcmSegmentation::write(DcmItem &dataset) +{ + // FGInterface::write() will know whether it has to check FG structure + // so we do not need to check FG structure here (OFFalse). + if (!check(OFFalse)) + { + return IOD_EC_InvalidObject; + } + + OFCondition result; + + // -- Set constant default values written by external modules -- + getGeneralImage().setLossyImageCompression("00"); + getGeneralImage().setImageType(m_ImageType); + getSOPCommon().setSOPClassUID(UID_SegmentationStorage); + + // -- Extra Study level data -- + + // Enhanced Equipment Module + if (result.good()) result = m_EnhancedGeneralEquipmentModule.write(dataset); + + // -- Extra Series level data -- + + // Write segmentation-specific series level attribute (Segmentation Series Module) + if (result.good()) result = m_SegmentationSeries.write(dataset); + + // -- Extra Image level data -- + + // Write Multi-Frame Functional Groups Module + if (result.good()) result = writeMultiFrameFunctionalGroupsModule(dataset); + + // Write Multi-Frame Dimension Module + if (result.good()) result = writeMultiFrameDimensionModule(dataset); + + // Write segmentation image module and image pixel module + if (result.good()) result = writeSegmentationImageModule(dataset); + + // -- Write common multi frame image IOD attributes -- + + // Patient Module + // General Study Module + // General Series Module + // Frame of Reference Module + // General Equipment Module + // General Image Module + // Multi-frame Functional Groups Module (except functional groups itself) + // SOP Common Module + // Common Instance Reference Module + if (result.good()) result = DcmSegmentation::IODImage::write(dataset); + + return result; +} + + +FGInterface& DcmSegmentation::getFunctionalGroups() +{ + return m_FGInterface; +} + + +size_t DcmSegmentation::getNumberOfFrames() +{ + return m_FGInterface.getNumberOfFrames(); +} + + + +size_t DcmSegmentation::getNumberOfSegments() +{ + return m_Segments.size(); +} + + +IODGeneralEquipmentModule& DcmSegmentation::getEquipment() +{ + return DcmSegmentation::IODImage::getEquipment(); +} + + +IODSegmentationSeriesModule & DcmSegmentation::getSegmentationSeriesModule() +{ + return m_SegmentationSeries; +} + + +OFCondition DcmSegmentation::addSegment(DcmSegment* seg, + Uint16& segmentNumber) +{ + segmentNumber = 0; + if (seg == NULL) + return EC_IllegalParameter; + + if (m_Segments.size() >= DCM_SEG_MAX_SEGMENTS) + { + return SG_EC_MaxSegmentsReached; + } + + // Casting is safe since we made sure number of segments fits into 16 bit + segmentNumber = OFstatic_cast(Uint16, m_Segments.size() + 1); + m_Segments.push_back(seg); + return EC_Normal; +} + + +OFCondition DcmSegmentation::addFrame(Uint8* pixData) +{ + OFCondition result; + + Uint16 rows, cols; + if (getImagePixel().getRows(rows).good() && getImagePixel().getColumns(cols).good()) + { + DcmIODTypes::Frame* frame = NULL; + if (m_SegmentationType == DcmSegTypes::ST_BINARY) + { + frame = DcmSegUtils::packBinaryFrame(pixData, rows, cols); + if (!frame) + { + result = IOD_EC_CannotInsertFrame; + } + } + else // fractional + { + frame = new DcmIODTypes::Frame(); + if (frame) + { + frame->length = rows*cols; + frame->pixData = new Uint8[frame->length]; + if (frame->pixData) + { + memcpy(frame->pixData, pixData, frame->length); + } + else + { + delete frame; + result = EC_MemoryExhausted; + } + } + else + result = EC_MemoryExhausted; + } + if (result.good()) + { + m_Frames.push_back(frame); + } + } + else + { + DCMSEG_ERROR("Cannot add frame since rows and/or columns are unknown"); + result = IOD_EC_CannotInsertFrame; + } + return result; +} + + +SOPInstanceReferenceMacro& DcmSegmentation::getReferencedPPS() +{ + return getSeries().getReferencedPPS(); +} + + +const DcmIODTypes::Frame* DcmSegmentation::getFrame(const size_t& frameNo) +{ + if (frameNo > m_Frames.size() - 1) + { + return NULL; + } + + return m_Frames[frameNo]; +} + + +void DcmSegmentation::getFramesForSegment(const size_t& segmentNumber, + OFVector& frameNumbers) +{ + size_t numFrames = getNumberOfFrames(); + for (size_t count = 0; count < numFrames; count++) + { + FGSegmentation* fg = OFstatic_cast(FGSegmentation*, m_FGInterface.get(OFstatic_cast(Uint32, count), DcmFGTypes::EFG_SEGMENTATION)); + if (fg == NULL) + { + DCMSEG_ERROR("Cannot get segmentation functional group for frame " << count); + return; + } + Uint16 refSeg; + if (fg->getReferencedSegmentNumber(refSeg).good()) + { + if (refSeg == segmentNumber) + { + frameNumbers.push_back(count); + } + } + } +} + + +OFCondition DcmSegmentation::addForAllFrames(const FGBase& group) +{ + return m_FGInterface.addShared(group); +} + + +OFCondition DcmSegmentation::addFrame(Uint8* pixData, + const Uint16 segmentNumber, + const OFVector& perFrameInformation) +{ + Uint32 frameNo = OFstatic_cast(Uint32, m_Frames.size()); // will be the index of the frame (counted from 0) + OFCondition result; + + // Check input parameters + if ( pixData == NULL ) + { + DCMSEG_ERROR("No pixel data provided or zero length"); + result = EC_IllegalParameter; + } + if (segmentNumber > m_Segments.size() ) + { + DCMSEG_ERROR("Cannot add frame: Segment with given number " << segmentNumber << " does not exist"); + result = SG_EC_NoSuchSegment; + } + if (result.bad()) + return result; + + OFVector::const_iterator it = perFrameInformation.begin(); + while (it != perFrameInformation.end()) + { + result = (*it)->check(); + if (result.bad()) + { + DCMSEG_ERROR("Could not add new frame since functional group of type: " << (*it)->getType() << " is invalid: " << result.text()); + break; + } + result = m_FGInterface.addPerFrame(frameNo, *(*it)); + if (result.bad()) + { + DCMSEG_ERROR("Could not add new frame since functional group of type " << (*it)->getType() << ": " << result.text()); + break; + } + it++; + } + + // Now also add Segmentation Functional Group + if (result.good()) + { + FGSegmentation seg; + result = seg.setReferencedSegmentNumber(segmentNumber); + if (result.good()) + { + result = m_FGInterface.addPerFrame(frameNo, seg); + } + else + { + DCMSEG_ERROR("Could not add new frame, invalid segment number " << segmentNumber << ": " << result.text()); + } + } + + // Insert pixel data + if (result.good()) + { + result = addFrame(pixData); + } + + // Cleanup any per-frame groups that might have been inserted and return + if (result.bad()) + { + for (OFVector::const_iterator it2 = perFrameInformation.begin(); it2 != perFrameInformation.end(); it2++ ) + { + m_FGInterface.deletePerFrame(frameNo, (*it2)->getType()); + } + } + + return result; +} + + +ContentIdentificationMacro& DcmSegmentation::getContentIdentification() +{ + return m_ContentIdentificationMacro; +} + + +IODMultiframeDimensionModule& DcmSegmentation::getDimensions() +{ + return m_DimensionModule; +} + + +OFCondition DcmSegmentation::setLossyImageCompressionFlag(const OFString& ratios, + const OFString& methods, + const OFBool checkValues) +{ + OFCondition result = getGeneralImage().setLossyImageCompression("01"); + if (result.good() || !checkValues) + result = getGeneralImage().setLossyImageCompressionMethod(methods); + if (result.good() || !checkValues) + result = getGeneralImage().setLossyImageCompressionRatio(ratios); + + if (checkValues) + return result; + else + return EC_Normal; +} + + +OFCondition DcmSegmentation::saveFile(const OFString& filename, + const E_TransferSyntax writeXfer) +{ + if ( (writeXfer != EXS_LittleEndianExplicit) + && (writeXfer != EXS_BigEndianExplicit) + && (writeXfer != EXS_LittleEndianImplicit) +#ifdef WITH_ZLIB + && (writeXfer != EXS_DeflatedLittleEndianExplicit) +#endif + ) + { + DcmXfer ts(writeXfer); +#ifdef WITH_ZLIB + DCMSEG_ERROR("Cannot write transfer syntax: " << ts.getXferName() << ": Can only write uncompressed or Deflated)"); +#else + if (writeXfer == EXS_DeflatedLittleEndianExplicit) + { + DCMSEG_ERROR("Cannot write transfer syntax: " << ts.getXferName() << ": Deflate (ZLIB) support disabled, can only write uncompressed"); + } +#endif + return EC_CannotChangeRepresentation; + } + + DcmFileFormat dcmff; + OFCondition result = write( *(dcmff.getDataset()) ); + if (result.good()) + { + result = dcmff.saveFile(filename.c_str(), writeXfer); + } + if (result.bad()) + { + DCMSEG_ERROR("Cannot save segmentation document to file " << filename << ": " << result.text()); + } + + return result; +} + + +/* -- Setter for DICOM attributes -- */ + +OFCondition DcmSegmentation::setEquipmentInfo(const IODGeneralEquipmentModule::EquipmentInfo& equipmentInfo, + const OFBool checkValue) +{ + + if (checkValue) + { + if ( equipmentInfo.m_Manufacturer.empty() + || equipmentInfo.m_ManufacturerModelName.empty() + || equipmentInfo.m_DeviceSerialNumber.empty() + || equipmentInfo.m_SoftwareVersions.empty() ) + { + return EC_InvalidValue; + } + } + + OFCondition result = getEquipment().setManufacturer(equipmentInfo.m_Manufacturer, checkValue); + if ( result.good() ) + result = getEquipment().setManufacturerModelName(equipmentInfo.m_ManufacturerModelName, checkValue); + if (result.good()) + result = getEquipment().setDeviceSerialNumber(equipmentInfo.m_DeviceSerialNumber, checkValue); + if (result.good()) + result = getEquipment().setSoftwareVersions(equipmentInfo.m_SoftwareVersions, checkValue); + + return result; +} + + +OFCondition DcmSegmentation::setContentIdentification(const ContentIdentificationMacro& contentIdentification, + const OFBool checkValue) +{ + // Instance Number and Content Label must be filled out, rest can be empty + OFCondition result; + if (checkValue) + { + result = OFconst_cast(ContentIdentificationMacro*,&contentIdentification)->check(); + } + if (result.bad()) + return result; + + m_ContentIdentificationMacro = contentIdentification; + + return result; +} + + + +/* -- Getter for DICOM attributes -- */ + +DcmSegment* DcmSegmentation::getSegment(const unsigned int segmentNumber) +{ + // check for invalid index + if ( (segmentNumber == 0) || (segmentNumber > m_Segments.size()) ) + { + return NULL; + } + + // logical segment numbering starts with 1, so subtract 1 for vector index + return m_Segments[segmentNumber-1]; +} + + +OFBool DcmSegmentation::getSegmentNumber(const DcmSegment* segment, + unsigned int& segmentNumber) +{ + segmentNumber = 0; + size_t max = m_Segments.size(); + for (size_t count = 0; count < max; count++) + { + if (m_Segments.at(count) == segment) + { + // logical segment numbering starts with 1 but vector index with 0 + segmentNumber = OFstatic_cast(unsigned int, count + 1); + return OFTrue; + } + } + // not found + return OFFalse; +} + + +OFCondition DcmSegmentation::getModality(OFString& value, + const long signed int pos) const +{ + (void)pos; + // Fixed for Segmentations to value "SEG" + value = "SEG"; + return EC_Normal; +} + + +OFCondition DcmSegmentation::importFromSourceImage(const OFString& filename, + const bool takeOverCharset) +{ + DcmFileFormat dcmff; + OFCondition result = dcmff.loadFile(filename); + if (result.good()) + { + return importFromSourceImage(*(dcmff.getDataset()), takeOverCharset); + } + return result; +} + + +OFCondition DcmSegmentation::importFromSourceImage(DcmItem& dataset, + const bool takeOverCharset) +{ + OFString FoR; + dataset.findAndGetOFStringArray(DCM_FrameOfReferenceUID, FoR); + return DcmIODCommon::importHierarchy( + dataset, + OFTrue, // Patient + OFTrue, // Study + !FoR.empty(), // Frame of Reference + OFFalse, // Series + takeOverCharset); +} + + +/* protected functions */ + +OFCondition DcmSegmentation::writeSegments(DcmItem& item) +{ + OFCondition result; + DcmIODUtil::writeSubSequence >(result, DCM_SegmentSequence, m_Segments, item, "1-n", "1", "SegmentationImageModule"); + return result; +} + + +OFCondition DcmSegmentation::readSegments(DcmItem& item) +{ + return DcmIODUtil::readSubSequence >(item, DCM_SegmentSequence, m_Segments, "1-n", "1", "SegmentationImageModule"); +} + + +OFCondition DcmSegmentation::readFrames(DcmItem& dataset) +{ + OFCondition result; + Uint16 allocated, stored, high, spp, pixelRep, rows, cols, numberOfFrames; + allocated = stored = high = spp = rows = cols = numberOfFrames = 0; + pixelRep = 2; // invalid value for this attribute + OFString colorModel; + + /* check the typical image pixel attributes and get correct(ed) values */ + result = getAndCheckImagePixelAttributes(dataset, allocated, stored, high, spp, pixelRep, rows, cols, numberOfFrames, colorModel); + if (result.bad()) + return result; + + /* Check length of pixel data element */ + DcmElement* pixelData = NULL; + if (dataset.findAndGetElement(DCM_PixelData, pixelData).bad()) + return IOD_EC_InvalidPixelData; + if (!checkPixDataLength(pixelData, rows, cols, numberOfFrames)) + return IOD_EC_InvalidPixelData; + + /* Get pixel data values */ + Uint8* pixels = NULL; + result = pixelData->getUint8Array(pixels); + if (result.bad()) + { + DCMSEG_ERROR("Cannot read pixel data"); + return result; + } + + /* Read all frames into dedicated data structure */ + size_t pixelsPerFrame = OFstatic_cast(size_t, rows) * cols; + if (m_SegmentationType == DcmSegTypes::ST_BINARY) + { + result = extractFrames(pixels, numberOfFrames, pixelsPerFrame, m_Frames); + if (result.bad()) + { + return result; + } + } + else if (m_SegmentationType == DcmSegTypes::ST_FRACTIONAL) + { + for (size_t count = 0; count < numberOfFrames; count++) + { + DcmIODTypes::Frame *frame = new DcmIODTypes::Frame(); + if (!frame) return EC_MemoryExhausted; + frame->length = pixelsPerFrame; + frame->pixData= new Uint8[pixelsPerFrame]; + if (!frame->pixData) + { + delete frame; + return EC_MemoryExhausted; + } + memcpy(frame->pixData, pixels + count* pixelsPerFrame, pixelsPerFrame); + m_Frames.push_back(frame); + } + } + + return result; +} + + + +OFCondition DcmSegmentation::getAndCheckImagePixelAttributes(DcmItem& dataset, + Uint16& allocated, + Uint16& stored, + Uint16& high, + Uint16& spp, + Uint16& pixelRep, + Uint16& rows, + Uint16& cols, + Uint16& numberOfFrames, + OFString& colorModel) +{ + OFBool fail = OFFalse; + dataset.findAndGetUint16(DCM_BitsAllocated, allocated); + dataset.findAndGetUint16(DCM_BitsStored, stored); + dataset.findAndGetUint16(DCM_HighBit, high); + dataset.findAndGetUint16(DCM_PixelRepresentation, pixelRep); + dataset.findAndGetUint16(DCM_SamplesPerPixel, spp); + dataset.findAndGetOFStringArray(DCM_PhotometricInterpretation, colorModel); + + /* Rows and Columns */ + OFCondition result = getImagePixel().getRows(rows); + if (result.good()) + result = getImagePixel().getColumns(cols); + if (result.bad()) + { + DCMSEG_ERROR("Cannot find Rows or Columns in dataset"); + fail = OFTrue; + } + + /* Number of Frames */ + Sint32 numFrames = 0; + result = m_FG.getNumberOfFrames(numFrames); + if (result.bad()) + { + DCMSEG_ERROR("Number of Frames not set"); + fail = OFTrue; + } + else + { + if ( numFrames < 0 ) + { + DCMSEG_ERROR("Number of Frames must be greater than 0"); + fail = OFTrue; + } + else + { + numberOfFrames = OFstatic_cast(Uint16, numFrames); + } + } + + Uint16 depth = 0; + if (m_SegmentationType == DcmSegTypes::ST_BINARY) + depth = 1; + else + depth = 8; + + if (allocated != depth) + { + DCMSEG_WARN("Bits Allocated is not set correctly (" << allocated << ", ignored), assuming value " << depth << " as required for " << DcmSegTypes::segtype2OFString(m_SegmentationType) << " segmentation objects"); + allocated = depth; + } + if (stored != depth) + { + DCMSEG_WARN("Bits Stored is not set correctly (" << stored << ", ignored), assuming value " << depth << " as required for " << DcmSegTypes::segtype2OFString(m_SegmentationType) << " segmentation objects"); + stored = depth; + } + if (high != depth-1) + { + DCMSEG_WARN("High Bit is not set correctly (" << high << ", ignored), assuming value " << depth-1 << " as required for " << DcmSegTypes::segtype2OFString(m_SegmentationType) << " segmentation objects"); + high = depth -1; + } + if (spp != 1) + { + DCMSEG_WARN("Samples per Pixel is not set correctly (" << spp << ", ignored), assuming value 1 as required for segmentation objects"); + spp = 1; + } + if (pixelRep != 0) + { + DCMSEG_WARN("Pixel Representation is not set correctly (" << pixelRep << ", ignored), assuming value 0 as required for segmentation objects"); + pixelRep = 0; + } + if (colorModel != "MONOCHROME2") + { + DCMSEG_WARN("Photometric Interpretation is not set correctly (ignored), assuming value MONOCHROME2 as required for segmentation objects"); + colorModel = "MONOCHROME2"; + } + if (rows == 0) + { + DCMSEG_ERROR("Rows is not set correctly (0)"); + fail = OFTrue; + } + if (cols == 0) + { + DCMSEG_ERROR("Columns is not set correctly (0)"); + fail = OFTrue; + } + + if (fail) + return EC_InvalidValue; + + return EC_Normal; +} + + +OFCondition DcmSegmentation::writeDataset(DcmItem& dataset) +{ + return write(dataset); +} + + +OFCondition DcmSegmentation::writeMultiFrameFunctionalGroupsModule(DcmItem& dataset) +{ + Uint32 numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 2147483647 frames provided, limiting Number of Frames to 2147483647"); + m_FG.setNumberOfFrames(numFrames); + OFCondition result = m_FG.write(dataset); + if (result.good()) + m_FGInterface.write(dataset); + return result; +} + + +OFCondition DcmSegmentation::writeMultiFrameDimensionModule(DcmItem& dataset) +{ + OFCondition result = m_DimensionModule.checkDimensions(&dataset); + if (result.good()) + { + result = m_DimensionModule.write(dataset); + } + return result; +} + + +OFCondition DcmSegmentation::writeFractionalFrames(DcmItem& dataset) +{ + Uint32 numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 2147483647 frames provided, will only write 2147483647"); + OFCondition result; + Uint16 rows,cols; + rows = cols = 0; + getImagePixel().getRows(rows); + getImagePixel().getColumns(cols); + size_t numBytes = 0; + result = getTotalBytesRequired(rows, cols, numFrames, numBytes); + if (result.bad()) return result; + if (numBytes >= 4294967295UL) + { + DCMSEG_ERROR("Cannot store Segmentation objects with more than 4 GB pixel data (compression for writing not supported)"); + return EC_TooManyBytesRequested; + } + Uint8* pixdata = new Uint8[numBytes]; + OFVector::iterator it = m_Frames.begin(); + // Just copy bytes for each frame as is + for (size_t count = 0; it != m_Frames.end(); count++) + { + memcpy(pixdata + count*(*it)->length, (*it)->pixData, (*it)->length); + it++; + } + dataset.putAndInsertUint8Array(DCM_PixelData, pixdata, OFstatic_cast(unsigned long, numBytes), OFTrue); + delete[] pixdata; + return result; +} + + +OFCondition DcmSegmentation::writeBinaryFrames(DcmItem& dataset) +{ + Uint16 rows, cols; + rows = cols = 0; + Uint32 numFrames = 0; + numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 2147483647 frames provided, will only write 2147483647"); + OFCondition result; + getImagePixel().getRows(rows); + getImagePixel().getColumns(cols); + size_t numBytes = 0; + result = getTotalBytesRequired(rows, cols, numFrames, numBytes); + if (result.bad()) return result; + if (numBytes >= 4294967295UL) + { + DCMSEG_ERROR("Cannot store Segmentation objects with more than 4 GB pixel data (compression for writing not supported)"); + return EC_TooManyBytesRequested; + } + // Holds the pixels for all frames. Each bit represents a pixel which is either + // 1 (part of segment) or 0 (not part of segment. All frames are directly + // concatenated, i.e. there are no unused bits between the frames. + Uint8* pixdata = new Uint8[numBytes]; + memset(pixdata, 0, numBytes); + + // Fill Pixel Data Element + concatFrames(m_Frames, pixdata, rows*cols); + result = dataset.putAndInsertUint8Array(DCM_PixelData, pixdata, OFstatic_cast(unsigned long, numBytes), OFTrue); + delete [] pixdata; + return result; +} + + +OFCondition DcmSegmentation::writeSegmentationImageModule(DcmItem& dataset) +{ + dataset.putAndInsertOFStringArray(DCM_ImageType, "DERIVED\\PRIMARY"); + + OFCondition result = m_ContentIdentificationMacro.write(dataset); + + /* Write hardcoded values */ + if (result.good()) + { + getImagePixel().setSamplesPerPixel(1); + getImagePixel().setPhotometricInterpretation("MONOCHROME2"); + getImagePixel().setPixelRepresentation(0); + + /* Write Bits Allocated/Stored, High Bit, Segmentation Fractional Type, + * Segmentation Type, Maximum Fractional Value + */ + switch (m_SegmentationType) + { + case DcmSegTypes::ST_BINARY: + { + getImagePixel().setBitsAllocated(1); + getImagePixel().setBitsStored(1); + getImagePixel().setHighBit(0); + dataset.putAndInsertOFStringArray(DCM_SegmentationType, "BINARY"); + break; + } + case DcmSegTypes::ST_FRACTIONAL: + { + getImagePixel().setBitsAllocated(8); + getImagePixel().setBitsStored(8); + getImagePixel().setHighBit(7); + dataset.putAndInsertOFStringArray(DCM_SegmentationType, "FRACTIONAL"); + if (m_SegmentationFractionalType == DcmSegTypes::SFT_OCCUPANCY) + { + dataset.putAndInsertOFStringArray(DCM_SegmentationFractionalType, "OCCUPANCY"); + } + else + { + dataset.putAndInsertOFStringArray(DCM_SegmentationFractionalType, "PROBABILITY"); + } + // Maximum Fractional Value: Attribute is type 1C but "required if .. FRACTIONAL", i.e. write type 1 + DcmIODUtil::copyElementToDataset(result, dataset, m_MaximumFractionalValue, "1", "1", "SegmentationImageModule"); + break; + } + case DcmSegTypes::ST_UNKNOWN: + { DCMSEG_ERROR("Internal error, segmentation type not set"); + result = EC_InternalError; + break; + } + } + } + + /* Write segments */ + OFVector segmentItems; + if (result.good()) + { + OFVector::iterator it = m_Segments.begin(); + dataset.findAndDeleteElement(DCM_SegmentSequence); + for ( Uint16 itemCount = 0; (it != m_Segments.end()) && result.good(); itemCount++) + { + DcmItem* segmentItem = NULL; + dataset.findOrCreateSequenceItem(DCM_SegmentSequence, segmentItem, itemCount); + if (segmentItem) + { + result = (*it)->write(*segmentItem); + /* Insert segment number for the segment, starting from 1 and increasing monotonically. */ + if (result.good()) + { + segmentItem->putAndInsertUint16(DCM_SegmentNumber, itemCount+1); + } + } + else + { + DCMIOD_ERROR("Cannot create/get item in Segment Sequence (internal error)"); + result = EC_InternalError; + } + it++; + } + } + + /* Write frame pixel data */ + if (result.good()) + { + if (m_SegmentationType == DcmSegTypes::ST_BINARY) result = writeBinaryFrames(dataset); + else if (m_SegmentationType == DcmSegTypes::ST_FRACTIONAL) result = writeFractionalFrames(dataset); + else result = SG_EC_UnknownSegmentationType; + } + + return result; +} + +// -- private helpers -- + +void DcmSegmentation::clearData() +{ + DcmSegmentation::IODImage::clearData(); + m_FG.clearData(); + m_FGInterface.clear(); + DcmIODUtil::freeContainer(m_Frames); + DcmIODUtil::freeContainer(m_Segments); + m_MaximumFractionalValue.clear(); + m_SegmentationFractionalType = DcmSegTypes::SFT_UNKNOWN; + m_SegmentationType = DcmSegTypes::ST_UNKNOWN; +} + + +OFBool DcmSegmentation::checkPixDataLength(DcmElement* pixelData, + const Uint16 rows, + const Uint16 cols, + const Uint16& numberOfFrames) +{ + // Get actual length of pixel data in bytes + size_t length = pixelData->getLengthField(); + + // Find out how many bytes are needed + size_t bytesRequired = 0; + OFCondition result = getTotalBytesRequired(rows, cols, numberOfFrames, bytesRequired); + if (result.bad()) return OFFalse; + // Length found in Pixel Data element is always even + if (bytesRequired % 2 == 1) bytesRequired++; + /* Compare expected and actual length */ + if (length < bytesRequired) + { + DCMSEG_ERROR("Not enough bytes found in Pixel Data element. Found " << length << " bytes but " << bytesRequired << " bytes expected"); + return OFFalse; + } + else if (length > bytesRequired) + { + DCMSEG_WARN("Too many bytes found in Pixel Data element. Found " << length << " bytes but " << bytesRequired << " bytes expected"); + return OFTrue; + } + else + { + DCMSEG_TRACE("Found " << length << " bytes in Pixel Data element as expected"); + } + return OFTrue; +} + + +OFCondition DcmSegmentation::getTotalBytesRequired(const Uint16& rows, + const Uint16& cols, + const Uint32& numberOfFrames, + size_t& bytesRequired) +{ + OFBool ok = OFStandard::safeMult(OFstatic_cast(size_t, rows), OFstatic_cast(size_t, cols), bytesRequired); + if (ok) OFStandard::safeMult(bytesRequired, OFstatic_cast(size_t, numberOfFrames), bytesRequired); + if (!ok) + { + DCMSEG_ERROR("Cannot compute number of bytes required for Pixel Data since size_t type is too small"); + return EC_TooManyBytesRequested; + } + + /* for binary, we only need one bit per pixel */ + size_t remainder = 0; + if (m_SegmentationType == DcmSegTypes::ST_BINARY) + { + // check whether the 1-bit pixels exactly fit into bytes + remainder = (OFstatic_cast(size_t, rows) * cols) % 8; + // number of bytes that work on an exact fit + bytesRequired = bytesRequired / 8; + // add one byte if we have a remainder + if (remainder > 0) + { + bytesRequired++; + } + } + return EC_Normal; +} + + +OFCondition DcmSegmentation::loadFile(DcmFileFormat& dcmff, + const OFString& filename, + DcmDataset*& dset) +{ + dset = NULL; + OFCondition result = dcmff.loadFile(filename.c_str()); + if (result.bad()) + { + DCMSEG_ERROR("Could not load file " << filename << ": " << result.text()); + return result; + } + dset = dcmff.getDataset(); + if (dset == NULL) + { + DCMSEG_ERROR("Could not load file " << filename << ": No dataset"); + return IOD_EC_InvalidObject; + } + return result; +} + + +OFCondition DcmSegmentation::readSegmentationFractionalType(DcmItem& item) +{ + m_SegmentationFractionalType = DcmSegTypes::SFT_UNKNOWN; + if (!item.tagExists(DCM_SegmentationFractionalType)) + { + return EC_TagNotFound; + } + DcmCodeString element(DCM_SegmentationFractionalType); + OFCondition result = DcmIODUtil::getAndCheckElementFromDataset(item, element, getRules()->getByTag(DCM_SegmentationFractionalType)); + OFString str; + if (result.good()) + { + element.getOFStringArray(str); + m_SegmentationFractionalType = DcmSegTypes::OFString2FractionalType(str); + } + + if (m_SegmentationFractionalType == DcmSegTypes::SFT_UNKNOWN) + { + DCMSEG_ERROR("Invalid value for attribute Segmentation Fractional Type: " << str); + return EC_InvalidValue; + } + else + return EC_Normal; +} + + +OFCondition DcmSegmentation::readSegmentationType(DcmItem& item) +{ + m_SegmentationType = DcmSegTypes::ST_UNKNOWN; + if (!item.tagExists(DCM_SegmentationType)) + { + return EC_TagNotFound; + } + + DcmCodeString element(DCM_SegmentationType); + OFCondition result = DcmIODUtil::getAndCheckElementFromDataset(item, element, getRules()->getByTag(DCM_SegmentationType)); + OFString str; + if (result.good()) + { + element.getOFStringArray(str); + m_SegmentationType = DcmSegTypes::OFString2Segtype(str); + } + + if (m_SegmentationType == DcmSegTypes::ST_UNKNOWN) + { + DCMSEG_ERROR("Invalid value for attribute Segmentation Type: " << str); + result = EC_InvalidValue; + } + + return result; +} + + +// protected override of public base class function +IODImagePixelModule& DcmSegmentation::getImagePixel() +{ + return *OFget >( &DcmSegmentation::IODImage::getImagePixel() ); +} + + +OFBool DcmSegmentation::check(const OFBool checkFGStructure) +{ + if (m_Frames.size() == 0) + { + DCMSEG_ERROR("No frame data available"); + return OFFalse; + } + if (m_Segments.size() == 0) + { + DCMSEG_ERROR("No segments defined"); + return OFFalse; + } + if (m_Segments.size() > m_Frames.size()) + { + DCMSEG_ERROR("There are more segments than frames defined"); + return OFFalse; + } + + if (checkFGStructure) + { + if (!m_FGInterface.check()) + return OFFalse; + } + + // Check rules around Frame of Reference + + // 1. If Derivation Image FG is not present, Frame of Reference is required. + OFBool frameOfRefRequired = OFFalse; + FGBase* group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_DERIVATIONIMAGE); + if (group == NULL) + { + // Derivation Image FG is not present, FoR is required + frameOfRefRequired = OFTrue; + } + else + { + // Derivation Image FG present, Frame of Reference is not required + frameOfRefRequired = OFFalse; + } + OFString frameOfRef; + getFrameOfReference().getFrameOfReferenceUID(frameOfRef); + if (frameOfRefRequired && frameOfRef.empty()) + { + DCMSEG_ERROR("Frame of Reference UID is not set for Segmentation but is required"); + return OFFalse; + } + + // 2. When a Frame of Reference UID is present the segment shall be specified + // within that coordinate system, using the Pixel Measures, Plane Position + // (Patient) and Plane Orientation (Patient) Functional Groups. + if (!frameOfRef.empty()) + { + // Check that each of above FGs is present. We do not check this for + // all frames since if it exists for one frame it must exist for all others. + // This is a general rule and applies for all FGs, so it is not checked here. + group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_PIXELMEASURES); + if (!group) + { + DCMSEG_ERROR("Frame of Reference UID is present but Pixel Measures FG is missing"); + return OFFalse; + } + group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_PLANEPOSPATIENT); + if (!group) + { + DCMSEG_ERROR("Frame of Reference UID is present but Plane Position (Patient) FG is missing"); + return OFFalse; + } + group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_PLANEORIENTPATIENT); + if (!group) + { + DCMSEG_ERROR("Frame of Reference UID is present but Plane Orientation (Patient) FG is missing"); + return OFFalse; + } + } + // Another condition cannot be checked since we do not have access to the + // datasets of the source images: + // 3. If FoR is present but not the same in images this segmentation applies to, + // (those in Derivation Image FG), each pixel of the segmentation shall + // correspond to a pixel in a referenced image (i.e. they must share the same + // size and resolution). + + return OFTrue; +} + + +OFCondition DcmSegmentation::decompress(DcmDataset& dset) +{ + DcmXfer xfer = dset.getOriginalXfer(); + OFCondition result; + // If the original transfer syntax could have been lossy, print warning + if (dset.hasRepresentation(EXS_LittleEndianExplicit, NULL)) + { + if ( xfer.isEncapsulated() && (xfer.getXfer() != EXS_RLELossless) && (xfer.getXfer() != EXS_DeflatedLittleEndianExplicit) ) + { + DCMSEG_WARN("Dataset has been compressed using a (possibly) lossy compression scheme (ignored)"); + } + } + // If the original transfer is encapsulated and we do not already have an uncompressed version, decompress or reject the file + else if (xfer.isEncapsulated()) + { + // RLE compression is fine (truly lossless). Deflated is handled internally by DCMTK. + if (xfer.getXfer() == EXS_RLELossless) + { + DCMSEG_DEBUG("DICOM file is RLE-compressed, converting to uncompressed transfer syntax first"); + result = DcmIODUtil::decompress(dset); + } + else // We do not accept any transfer syntax that could be lossy compressed + { + DCMSEG_ERROR("Transfer syntax " << DcmXfer(xfer).getXferName() << " uses lossy compression, not supported for Segmentation objects!"); + result = IOD_EC_CannotDecompress; + } + } + return result; +} + + +OFCondition DcmSegmentation::extractFrames(Uint8* pixData, + const size_t numFrames, + const size_t bitsPerFrame, + OFVector< DcmIODTypes::Frame* >& results) +{ + // Will hold the bit position (0-7) that the current frame starts from. The + // first frame will always start at bit 0. + Uint8 bitShift = 0; + // Compute length in bytes we need to consider for each frame. + size_t frameLengthBytes = bitsPerFrame / 8; + // If the number of bits is not dividable by 8, we need part of an extra + // byte in the end. Since we like to set the unused bits to 0 in such a last + // byte to 0, remember the number. + size_t overlapBits = (8 - (bitsPerFrame % 8)) % 8; + // Add an extra byte if we we fill a partial byte in the end + if (overlapBits != 0) frameLengthBytes++; + // Points to current reading position within pixData + Uint8* readPos = pixData; + // Loop over each frame and copy it to Frame structures + for (size_t f = 0; f < numFrames; f++) + { + // Create frame with correct length and copy 1:1 from pixel data + DcmIODTypes::Frame* frame = new DcmIODTypes::Frame(); + frame->length = frameLengthBytes; + frame->pixData = new Uint8[frameLengthBytes]; + if (!frame->pixData) + { + return EC_MemoryExhausted; + } + memcpy(frame->pixData, readPos, frame->length); + // If we have been copying too much, i.e the first bits of the frame + // actually belong to the former frame, shift the whole frame this amount + // of bits to the left in order to shift the superfluous bits out, i.e. + // make frame start at byte boundary. + if (bitShift > 0) + { + DcmSegUtils::alignFrameOnByteBoundary(frame->pixData, frame->length, 8-bitShift); + } + // Adapt last byte by masking out unused bits (i.e. those belonging to next frame). + // A reader should ignore those unused bits anyway. + frame->pixData[frame->length-1] = (frame->pixData[frame->length-1] << (overlapBits)) >> (overlapBits); + // Store frame + results.push_back(frame); + // Compute the bitshift created by this frame + bitShift = ( 8- ((f+1) * bitsPerFrame) % 8 ) % 8; + // If the previous byte read has not been used completely, i.e. it contains + // also bytes of the next frame, rewind read position to the previous byte + // that was partially read. Otherwise skip to the next full byte. + if (bitShift > 0) + { + readPos = readPos + frame->length - 1; + } + else + { + readPos = readPos + frame->length; + } + } + return EC_Normal; +} + + +void DcmSegmentation::concatFrames(OFVector< DcmIODTypes::Frame* > frames, + Uint8* pixData, + const size_t bitsPerFrame) +{ + // Writing position within the pixData memory + Uint8 *writePos = pixData; + OFVector::iterator frame = frames.begin(); + Uint8 freeBits = 0; + Uint8 firstByte = 0; + // Iterate over frames and copy each to pixData memory + for (size_t f = 0; frame != frames.end(); f++) + { + DCMSEG_DEBUG("Packing segmentation frame #" << f+1 << "/" << frames.size()); + // Backup first byte of the destination since it may contain bits of the + // previous frame; mask out those bits not belonging to previous frame. + // This will potentially create some empty bits on the left of the byte, + // that the current frame can use to store the its own first bits. + firstByte = (writePos[0] << freeBits) >> freeBits; + memcpy(writePos, (*frame)->pixData, (*frame)->length); + // If the previous frame left over some unused bits, shift the current frame + // that number of bits to the left, and restore the original bits of the + // previous frame that are overwritten by the shifting operation. + if (freeBits > 0) + { + DcmSegUtils::alignFrameOnBitPosition(writePos, (*frame)->length, 8-freeBits); + writePos[0] |= firstByte; + } + // Compute free bits left over from this frame in the previous byte written + freeBits = (8 - (( (f+1) * bitsPerFrame ) % 8)) % 8; + // If we have free bits, the previous byte written to will be the first byte + // we write to for the next frame. Otherwise start with a fresh destination + // byte. + if (freeBits > 0) + { + writePos = writePos + (*frame)->length - 1; + } + else + { + writePos = writePos + (*frame)->length; + } + // Next frame + frame++; + } + // Through shifting we can have non-zero bits within the unused bits of the + // last byte. Fill them with zeros (though not required by the standard). + if (freeBits > 0) + { + *writePos = (*writePos >> freeBits) << freeBits; + } +} diff --git a/dcmseg/libsrc/segment.cc b/dcmseg/libsrc/segment.cc new file mode 100644 index 00000000..de0ef59f --- /dev/null +++ b/dcmseg/libsrc/segment.cc @@ -0,0 +1,396 @@ +/* + * + * Copyright (C) 2015-2017, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Class representing a Segment from the Segment Ident. Sequence + * + */ +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmseg/segment.h" +#include "dcmtk/dcmseg/segtypes.h" +#include "dcmtk/dcmseg/segdoc.h" + + +OFCondition DcmSegment::create(DcmSegment*& segment, + const OFString& segmentLabel, + const CodeSequenceMacro& segmentedPropertyCategory, + const CodeSequenceMacro& segmentedPropertyType, + const DcmSegTypes::E_SegmentAlgoType algoType, + const OFString& algoName) + +{ + segment = new DcmSegment(); + if (segment == NULL) + return EC_MemoryExhausted; + + OFCondition result = segment->setSegmentLabel(segmentLabel, OFTrue /* check value */); + + if (result.good()) + { + segment->m_SegmentDescription.getSegmentedPropertyCategoryCode() = segmentedPropertyCategory; + result = segment->m_SegmentDescription.getSegmentedPropertyCategoryCode().check(); + } + + if (result.good()) + { + segment->m_SegmentDescription.getSegmentedPropertyTypeCode() = segmentedPropertyType; + result = segment->getSegmentedPropertyTypeCode().check(); + } + + + if (result.good()) + { + result = segment->setSegmentAlgorithm(algoType, algoName, OFTrue); + } + + if ( result.bad() ) + { + delete segment; + segment = NULL; + } + + return result; +} + + + +OFCondition DcmSegment::read(DcmItem& item, + const OFBool clearOldData) +{ + if (clearOldData) + clearData(); + + m_SegmentDescription.read(item); + DcmIODUtil::getAndCheckElementFromDataset(item, m_SegmentAlgorithmName, m_Rules.getByTag(DCM_SegmentAlgorithmName)); + + DcmIODUtil::readSingleItem( + item, + DCM_SegmentationAlgorithmIdentificationSequence, + m_SegmentationAlgorithmIdentification, + "3", + "Segmentation Image Module"); + + DcmIODUtil::getAndCheckElementFromDataset(item, m_RecommendedDisplayGrayscaleValue, m_Rules.getByTag(DCM_RecommendedDisplayGrayscaleValue)); + DcmIODUtil::getAndCheckElementFromDataset(item, m_RecommendedDisplayCIELabValue, m_Rules.getByTag(DCM_RecommendedDisplayCIELabValue)); + DcmIODUtil::getAndCheckElementFromDataset(item, m_TrackingID, m_Rules.getByTag(DCM_TrackingID)); + DcmIODUtil::getAndCheckElementFromDataset(item, m_TrackingUID, m_Rules.getByTag(DCM_TrackingUID)); + + return EC_Normal; +} + + +OFCondition DcmSegment::write(DcmItem& item) +{ + OFCondition result; + result = m_SegmentDescription.write(item); + DcmIODUtil::copyElementToDataset(result, item, m_SegmentAlgorithmName, m_Rules.getByTag(DCM_SegmentAlgorithmName)); + + if (result.good() && m_SegmentationAlgorithmIdentification.check(OFTrue /* quiet */).good()) + { + DcmIODUtil::writeSingleItem( + result, + DCM_SegmentationAlgorithmIdentificationSequence, + m_SegmentationAlgorithmIdentification, + item, + "3", + "Segmentation Image Module"); + } + + DcmIODUtil::copyElementToDataset(result, item, m_RecommendedDisplayGrayscaleValue, m_Rules.getByTag(DCM_RecommendedDisplayGrayscaleValue)); + DcmIODUtil::copyElementToDataset(result, item, m_RecommendedDisplayCIELabValue, m_Rules.getByTag(DCM_RecommendedDisplayCIELabValue)); + DcmIODUtil::copyElementToDataset(result, item, m_TrackingID, m_Rules.getByTag(DCM_TrackingID)); + DcmIODUtil::copyElementToDataset(result, item, m_TrackingUID, m_Rules.getByTag(DCM_TrackingUID)); + + return result; +} + + + +void DcmSegment::clearData() +{ + m_SegmentDescription.clearData(); + m_SegmentAlgorithmName.clear(); + m_SegmentationAlgorithmIdentification.clearData(); + m_RecommendedDisplayGrayscaleValue.clear(); + m_RecommendedDisplayCIELabValue.clear(); + m_TrackingID.clear(); + m_TrackingUID.clear(); +} + + + +DcmSegment::~DcmSegment() +{ + clearData(); +} + + +// protected default constructor +DcmSegment::DcmSegment() : + m_SegmentationDoc(NULL), + m_SegmentDescription(), + m_SegmentAlgorithmName(DCM_SegmentAlgorithmName), + m_SegmentationAlgorithmIdentification(), + m_RecommendedDisplayGrayscaleValue(DCM_RecommendedDisplayGrayscaleValue), + m_RecommendedDisplayCIELabValue(DCM_RecommendedDisplayCIELabValue), + m_TrackingID(DCM_TrackingID), + m_TrackingUID(DCM_TrackingUID), + m_Rules() +{ + initIODRules(); +} + + +void DcmSegment::initIODRules() +{ + m_Rules.addRule(new IODRule(DCM_SegmentAlgorithmName, "1","1C","SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules.addRule(new IODRule(DCM_RecommendedDisplayGrayscaleValue, "1","3","SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules.addRule(new IODRule(DCM_RecommendedDisplayCIELabValue, "3","3","SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules.addRule(new IODRule(DCM_TrackingID, "1","1C","SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); + m_Rules.addRule(new IODRule(DCM_TrackingUID, "1","1C","SegmentationImageModule", DcmIODTypes::IE_IMAGE), OFTrue); +} + + +// -------------- getters -------------------- + +unsigned int DcmSegment::getSegmentNumber() +{ + unsigned int value = 0; + if (m_SegmentationDoc != NULL) + { + m_SegmentationDoc->getSegmentNumber(this, value); + } + return value; +} + + +OFCondition DcmSegment::getSegmentLabel(OFString& value, + const signed long pos) +{ + return m_SegmentDescription.getSegmentLabel(value, pos); +} + + +OFCondition DcmSegment::getSegmentDescription(OFString& value, + const signed long pos) +{ + return m_SegmentDescription.getSegmentDescription(value, pos); +} + + +DcmSegTypes::E_SegmentAlgoType DcmSegment::getSegmentAlgorithmType() +{ + return m_SegmentDescription.getSegmentAlgorithmType(); +} + +OFCondition DcmSegment::getSegmentAlgorithmName(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_SegmentAlgorithmName, value, pos); +} + + +GeneralAnatomyMacro& DcmSegment::getGeneralAnatomyCode() +{ + return m_SegmentDescription.getGeneralAnatomyCode(); +} + + +AlgorithmIdentificationMacro& DcmSegment::getSegmentationAlgorithmIdentification() +{ + return m_SegmentationAlgorithmIdentification; +} + + +CodeSequenceMacro& DcmSegment::getSegmentedPropertyCategoryCode() +{ + return m_SegmentDescription.getSegmentedPropertyCategoryCode(); +} + + +CodeSequenceMacro& DcmSegment::getSegmentedPropertyTypeCode() +{ + return m_SegmentDescription.getSegmentedPropertyTypeCode(); +} + + +OFVector< CodeSequenceMacro* >& DcmSegment::getSegmentedPropertyTypeModifierCode() +{ + return m_SegmentDescription.getSegmentedPropertyTypeModifier(); +} + + + +OFCondition DcmSegment::getRecommendedDisplayGrayscaleValue(Uint16& value, + const unsigned long pos) +{ + return m_RecommendedDisplayGrayscaleValue.getUint16(value, pos); +} + + +OFCondition DcmSegment::getRecommendedDisplayCIELabValue(Uint16& L, + Uint16& a, + Uint16& b) +{ + OFCondition result = m_RecommendedDisplayCIELabValue.getUint16(L, 0); + if (result.good()) + result = m_RecommendedDisplayCIELabValue.getUint16(a, 1); + + if (result.good()) + result = m_RecommendedDisplayCIELabValue.getUint16(b, 2); + + return result; +} + + +OFCondition DcmSegment::getTrackingID(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_TrackingID, value, pos); +} + + +OFCondition DcmSegment::getTrackingUID(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_TrackingUID, value, pos); +} + + +// -------------- setters -------------------- + + +OFCondition DcmSegment::setSegmentLabel(const OFString& value, + const OFBool checkValue) +{ + return m_SegmentDescription.setSegmentLabel(value, checkValue); +} + + +OFCondition DcmSegment::setSegmentDescription(const OFString& value, + const OFBool checkValue) +{ + return m_SegmentDescription.setSegmentDescription(value, checkValue); +} + + +OFCondition DcmSegment::setSegmentAlgorithm(const DcmSegTypes::E_SegmentAlgoType algoType, + const OFString& algoName, + const OFBool checkValue) +{ + if (checkValue && algoType == DcmSegTypes::SAT_UNKNOWN) + { + DCMSEG_ERROR("Algorithm type must be initialized to a valid value"); + return EC_InvalidValue; + } + + OFCondition result; + // Set algorithm name if algorithm type is not manual (otherwise do not set it at all) + if (algoType != DcmSegTypes::SAT_MANUAL) + { + if ( checkValue && algoName.empty() ) + { + DCMSEG_ERROR("Algorithm name must be provided if Algorithm Type is not 'MANUAL'"); + return EC_MissingValue; + } + if (!algoName.empty()) + { + result = (checkValue) ? DcmLongString::checkStringValue(algoName, "1") : EC_Normal; + if (result.good()) + { + result = m_SegmentAlgorithmName.putOFStringArray(algoName); + } + } + } + // Set algorithm type + if (result.good()) + { + result = m_SegmentDescription.setSegmentAlgorithmType(algoType); + } + return result; +} + + +OFCondition DcmSegment::setSegmentationAlgorithmIdentification(const AlgorithmIdentificationMacro& value, + const OFBool checkValue) +{ + m_SegmentationAlgorithmIdentification = value; + OFCondition result; + if (checkValue) + { + result = m_SegmentationAlgorithmIdentification.check(); + } + + if (result.bad()) + { + m_SegmentationAlgorithmIdentification.clearData(); + } + + return result; +} + + +OFCondition DcmSegment::setRecommendedDisplayGrayscaleValue(const Uint16 value, + const OFBool) +{ + return m_RecommendedDisplayGrayscaleValue.putUint16(value, 0); +} + + +OFCondition DcmSegment::setRecommendedDisplayCIELabValue(const Uint16 r, + const Uint16 g, + const Uint16 b, + const OFBool) +{ + OFCondition result = m_RecommendedDisplayCIELabValue.putUint16(r, 0); + if (result.good()) + result = m_RecommendedDisplayCIELabValue.putUint16(g, 1); + if (result.good()) + result = m_RecommendedDisplayCIELabValue.putUint16(b, 2); + return result; +} + + +OFCondition DcmSegment::setTrackingID(const OFString& value, + const OFBool checkValue) +{ + // avoid compile warning on unused variable + (void)checkValue; + return m_TrackingID.putOFStringArray(value); +} + + +OFCondition DcmSegment::setTrackingUID(const OFString& value, + const OFBool checkValue) +{ + OFCondition result; + if (checkValue) + { + result = DcmUniqueIdentifier::checkStringValue(value, "1"); + } + if (result.good()) + { + result = m_TrackingUID.putOFStringArray(value); + } + return result; +} + + +void DcmSegment::referenceSegmentationDoc(DcmSegmentation* doc) +{ + this->m_SegmentationDoc = doc; +} diff --git a/dcmseg/libsrc/segtypes.cc b/dcmseg/libsrc/segtypes.cc new file mode 100644 index 00000000..43dbf19a --- /dev/null +++ b/dcmseg/libsrc/segtypes.cc @@ -0,0 +1,358 @@ +/* + * + * Copyright (C) 2015-2016, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Class for managing common segmentation specific types. + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmdata/dcerror.h" +#include "dcmtk/dcmiod/iodutil.h" +#include "dcmtk/dcmiod/iodmacro.h" +#include "dcmtk/dcmseg/segtypes.h" + +OFLogger DCM_dcmsegLogger = OFLog::getLogger("dcmtk.dcmseg"); + +/*---------------------------------* + * constant definitions + *---------------------------------*/ + +// conditions +makeOFConditionConst(SG_EC_MaxSegmentsReached, OFM_dcmseg, 1, OF_error, "Maximum Number of Functional Groups reached"); +makeOFConditionConst(SG_EC_NoSuchSegment, OFM_dcmseg, 2, OF_error, "No such segment"); +makeOFConditionConst(SG_EC_UnknownSegmentationType, OFM_dcmseg, 3, OF_error, "Unknown Segmentation Type"); +makeOFConditionConst(SG_EC_InvalidValue, OFM_dcmseg, 4, OF_error, "Invalid value for Segmentation SOP Class"); +makeOFConditionConst(SG_EC_NotEnoughData, OFM_dcmseg, 5, OF_error, "Not enough data"); + + +DcmSegTypes::E_SegmentationType DcmSegTypes::OFString2Segtype(const OFString& value) +{ + if (value == "BINARY") + return DcmSegTypes::ST_BINARY; + if (value == "FRACTIONAL") + return DcmSegTypes::ST_FRACTIONAL; + else + return DcmSegTypes::ST_UNKNOWN; +} + + +OFString DcmSegTypes::segtype2OFString(const DcmSegTypes::E_SegmentationType& value) +{ + switch(value) + { + case DcmSegTypes::ST_BINARY: return "BINARY"; + case DcmSegTypes::ST_FRACTIONAL: return "FRACTIONAL"; + case DcmSegTypes::ST_UNKNOWN: return "UNKNOWN"; + default: return "Invalid segmentation type (internal error)"; + } +} + + +DcmSegTypes::E_SegmentationFractionalType DcmSegTypes::OFString2FractionalType(const OFString& value) +{ + if (value == "PROBABILITY") + return DcmSegTypes::SFT_PROBABILITY; + if (value == "OCCUPANCY") + return DcmSegTypes::SFT_OCCUPANCY; + else + return DcmSegTypes::SFT_UNKNOWN; +} + + + +OFString DcmSegTypes::algoType2OFString(DcmSegTypes::E_SegmentAlgoType algo) +{ + switch (algo) + { + case SAT_AUTOMATIC: return "AUTOMATIC"; break; + case SAT_SEMIAUTOMATIC: return "SEMIAUTOMATIC"; break; + case SAT_MANUAL: return "MANUAL"; break; + default: return ""; + } +} + + +DcmSegTypes::E_SegmentAlgoType DcmSegTypes::OFString2AlgoType(const OFString& algoType) +{ + if (algoType == "AUTOMATIC") + return DcmSegTypes::SAT_AUTOMATIC; + if (algoType == "MANUAL") + return DcmSegTypes::SAT_MANUAL; + if (algoType == "SEMIAUTOMATIC") + return DcmSegTypes::SAT_SEMIAUTOMATIC; + else + return DcmSegTypes::SAT_UNKNOWN; +} + +SegmentDescriptionMacro::SegmentDescriptionMacro() : + m_SegmentLabel(DCM_SegmentLabel), + m_SegmentDescription(DCM_SegmentDescription), + m_SegmentAlgorithmType(DcmSegTypes::SAT_UNKNOWN), + m_GeneralAnatomyCode("3" /* General Anatomy Optional Macro* */), + m_SegmentedPropertyCategoryCode(), + m_SegmentedPropertyType() +{ +} + + +SegmentDescriptionMacro::~SegmentDescriptionMacro() +{ +} + + +void SegmentDescriptionMacro::clearData() +{ + m_SegmentLabel.clear(); + m_SegmentDescription.clear(); + m_SegmentAlgorithmType = DcmSegTypes::SAT_UNKNOWN; + m_GeneralAnatomyCode.clearData(); + m_SegmentedPropertyCategoryCode.clearData(); + m_SegmentedPropertyType.clearData(); +} + + +OFCondition SegmentDescriptionMacro::read(DcmItem& item) +{ + /* re-initialize object */ + clearData(); + + DcmIODUtil::getAndCheckElementFromDataset(item, m_SegmentLabel, "1", "1", "SegmentDescriptionMacro"); + DcmIODUtil::getAndCheckElementFromDataset(item, m_SegmentDescription, "1", "3", "SegmentDescriptionMacro"); + readSegmentAlgorithmType(item); + m_GeneralAnatomyCode.read(item); + DcmIODUtil::readSingleItem(item, DCM_SegmentedPropertyCategoryCodeSequence, m_SegmentedPropertyCategoryCode, "1", "SegmentDescriptionMacro"); + DcmIODUtil::readSingleItem(item, DCM_SegmentedPropertyTypeCodeSequence, m_SegmentedPropertyType, "1", "SegmentDescriptionMacro"); + + return EC_Normal; +} + + +OFCondition SegmentDescriptionMacro::write(DcmItem& item) +{ + OFCondition result = EC_Normal; + + /* copy all elements to dataset */ + DcmIODUtil::copyElementToDataset(result, item, m_SegmentLabel, "1" /* VM */, "1" /* Type */, "SegmentDescriptionMacro"); + DcmIODUtil::copyElementToDataset(result, item, m_SegmentDescription, "1", "3", "SegmentDescriptionMacro"); + if (result.good()) result = writeSegmentAlgorithmType(item); + if (result.good()) + { + if (m_GeneralAnatomyCode.check(OFTrue /* quiet */).good()) + { + result = m_GeneralAnatomyCode.write(item); + } + } + DcmIODUtil::writeSingleItem(result, DCM_SegmentedPropertyCategoryCodeSequence, m_SegmentedPropertyCategoryCode, item, "1", "SegmentDescriptionMacro"); + DcmIODUtil::writeSingleItem(result, DCM_SegmentedPropertyTypeCodeSequence, m_SegmentedPropertyType, item, "1", "SegmentDescriptionMacro"); + return result; +} + + +OFCondition SegmentDescriptionMacro::getSegmentLabel(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_SegmentLabel, value, pos); +} + + +OFCondition SegmentDescriptionMacro::getSegmentDescription(OFString& value, + const signed long pos) +{ + return DcmIODUtil::getStringValueFromElement(m_SegmentDescription, value, pos); +} + + +DcmSegTypes::E_SegmentAlgoType SegmentDescriptionMacro::getSegmentAlgorithmType() +{ + return m_SegmentAlgorithmType; +} + + +GeneralAnatomyMacro& SegmentDescriptionMacro::getGeneralAnatomyCode() +{ + return m_GeneralAnatomyCode; +} + + +CodeSequenceMacro& SegmentDescriptionMacro::getSegmentedPropertyCategoryCode() +{ + return m_SegmentedPropertyCategoryCode; +} + + +CodeSequenceMacro& SegmentDescriptionMacro::getSegmentedPropertyTypeCode() +{ + return m_SegmentedPropertyType.m_SegmentedPropertyTypeCode; +} + + +OFVector< CodeSequenceMacro* >& SegmentDescriptionMacro::getSegmentedPropertyTypeModifier() +{ + return m_SegmentedPropertyType.m_SegmentedPropertyTypeModifierCode; +} + + +OFCondition SegmentDescriptionMacro::setSegmentLabel(const OFString& value, + const OFBool checkValue) +{ + OFCondition result = (checkValue) ? DcmLongString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = m_SegmentLabel.putOFStringArray(value); + return result; +} + + +OFCondition SegmentDescriptionMacro::setSegmentDescription(const OFString& value, + const OFBool checkValue) +{ + (void)checkValue; + return m_SegmentDescription.putOFStringArray(value); +} + + +OFCondition SegmentDescriptionMacro::setSegmentAlgorithmType(const DcmSegTypes::E_SegmentAlgoType value) +{ + m_SegmentAlgorithmType = value; + return EC_Normal; +} + + +OFCondition SegmentDescriptionMacro::readSegmentAlgorithmType(DcmItem& item) +{ + DcmCodeString element(DCM_SegmentAlgorithmType); + OFCondition result = DcmIODUtil::getAndCheckElementFromDataset(item, element, "1", "1", "SegmentDescriptionMacro"); + OFString str; + if (result.good()) + { + element.getOFStringArray(str); + m_SegmentAlgorithmType = DcmSegTypes::OFString2AlgoType(str); + } + + if (m_SegmentAlgorithmType == DcmSegTypes::SAT_UNKNOWN) + { + DCMSEG_ERROR("Invalid value for attribute Segmentation Algorithm Type: " << str); + return SG_EC_InvalidValue; + } + else + return EC_Normal; +} + + +OFCondition SegmentDescriptionMacro::writeSegmentAlgorithmType(DcmItem& item) +{ + if (m_SegmentAlgorithmType == DcmSegTypes::SAT_UNKNOWN) + { + DCMSEG_ERROR("Segment Algorithm Type not set"); + return SG_EC_InvalidValue; + } + + OFString str = DcmSegTypes::algoType2OFString(m_SegmentAlgorithmType); + return item.putAndInsertOFStringArray(DCM_SegmentAlgorithmType, str); +} + + +SegmentedPropertyTypeCodeItem::SegmentedPropertyTypeCodeItem() : + m_SegmentedPropertyTypeCode(), + m_SegmentedPropertyTypeModifierCode() +{ + +} + + +SegmentedPropertyTypeCodeItem::~SegmentedPropertyTypeCodeItem() +{ + DcmIODUtil::freeContainer(m_SegmentedPropertyTypeModifierCode); +} + + +OFCondition SegmentedPropertyTypeCodeItem::check(const OFBool quiet) +{ + OFCondition result = m_SegmentedPropertyTypeCode.check(quiet); + if (result.good()) + { + result = checkModifiers(quiet); + } + return result; +} + + +OFCondition SegmentedPropertyTypeCodeItem::checkModifiers(const OFBool quiet) +{ + OFCondition result; + OFVector::iterator it = m_SegmentedPropertyTypeModifierCode.begin(); + while (it != m_SegmentedPropertyTypeModifierCode.end()) + { + result = (*it)->check(quiet); + if (result.bad()) + return result; + it++; + } + return EC_Normal; +} + + +void SegmentedPropertyTypeCodeItem::clearData() +{ + DcmIODUtil::freeContainer(m_SegmentedPropertyTypeModifierCode); + m_SegmentedPropertyTypeCode.clearData(); +} + + +OFCondition SegmentedPropertyTypeCodeItem::read(DcmItem& item, + const OFBool clearOldData) +{ + OFCondition result; + if (clearOldData) + clearData(); + + m_SegmentedPropertyTypeCode.read(item); + DcmIODUtil::readSubSequence + ( + item, + DCM_SegmentedPropertyTypeModifierCodeSequence, + m_SegmentedPropertyTypeModifierCode, + "1-n", + "3", + "SegmentDescriptionMacro" + ); + return result; +} + + + +OFCondition SegmentedPropertyTypeCodeItem::write(DcmItem& item) +{ + OFCondition result = m_SegmentedPropertyTypeCode.write(item); + if (result.good()) + { + result = checkModifiers(); + if (result.good()) + { + DcmIODUtil::writeSubSequence > + ( + result, + DCM_SegmentedPropertyTypeModifierCodeSequence, + m_SegmentedPropertyTypeModifierCode, + item, + "1-n", + "3", + "SegmentDescriptionMacro" + ); + } + } + return result; +} diff --git a/dcmseg/libsrc/segutils.cc b/dcmseg/libsrc/segutils.cc new file mode 100644 index 00000000..b2b647c4 --- /dev/null +++ b/dcmseg/libsrc/segutils.cc @@ -0,0 +1,206 @@ +/* + * + * Copyright (C) 2015-2018, Open Connections GmbH + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: Helper functions for the dcmseg module + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmseg/segutils.h" +#include "dcmtk/dcmseg/segdef.h" + + +DcmIODTypes::Frame* DcmSegUtils::packBinaryFrame(const Uint8* pixelData, + const Uint16 rows, + const Uint16 columns) +{ + // Sanity checking + const size_t numPixels = OFstatic_cast(size_t, rows) * columns; + if (numPixels == 0) + { + DCMSEG_ERROR("Unable to pack binary segmentation frame: Rows or Columns is 0"); + return NULL; + } + if (!pixelData) + { + DCMSEG_ERROR("Unable to pack binary segmentation frame: No pixel data provided"); + return NULL; + } + DcmIODTypes::Frame* frame = new DcmIODTypes::Frame(); + if (frame == NULL) + { + DCMSEG_ERROR("Could not pack binary segmentation frame: Memory exhausted"); + return NULL; + } + frame->length = getBytesForBinaryFrame(numPixels); + frame->pixData = new Uint8[frame->length]; + if (frame->pixData == 0) + { + delete frame; + return NULL; + } + memset(frame->pixData, 0, frame->length); + + size_t bytePos = 0; + for (size_t count = 0; count < numPixels; count++) + { + // Compute byte position + bytePos = count / 8; + frame->pixData[bytePos] |= (pixelData[count] != 0) /* value to set */ << (count % 8 /* bit position (0-7) within byte */); + } + return frame; +} + + +DcmIODTypes::Frame* DcmSegUtils::unpackBinaryFrame(const DcmIODTypes::Frame* frame, + Uint16 rows, + Uint16 cols) +{ + // Sanity checking + if ( (frame == NULL) || (rows == 0) || (cols == 0) ) + { + DCMSEG_ERROR("Cannot unpack binary frame, invalid input data"); + return NULL; + } + + // Create result frame in memory + size_t numBits = OFstatic_cast(size_t, rows) * cols; + DcmIODTypes::Frame* result = new DcmIODTypes::Frame(); + if (result) + { + result->pixData = new Uint8[numBits]; + if (!result->pixData) + { + delete result; + return NULL; + } + result->length = numBits; + } + if ( !result || !(result->pixData) ) + { + DCMSEG_ERROR("Cannot unpack binary frame, memory exhausted"); + return NULL; + } + memset(result->pixData, 0, result->length); + + // Transform and copy from packed frame to unpacked result frame + size_t bytePos = 0; + for (size_t count = 0; count < numBits; count++) + { + // Compute byte position + bytePos = count / 8; + // Bit position (0-7) within byte + Uint8 bitpos = (count % 8); + if ( (frame->pixData[bytePos] & (1 << bitpos) /* check whether bit at bitpos is set*/) ) + { + result->pixData[count] = 1; + } + else + { + result->pixData[count] = 0; + } + } + return result; +} + + +size_t DcmSegUtils::getBytesForBinaryFrame(const size_t& numPixels) +{ + // check whether the 1-bit pixels exactly fit into bytes + size_t remainder = numPixels % 8; + // number of bytes that work on an exact fit + size_t bytesRequired = numPixels / 8; + // add one byte if we have a remainder + if (remainder > 0) bytesRequired++; + return bytesRequired; +} + + +void DcmSegUtils::alignFrameOnBitPosition(Uint8* buf, + size_t bufLen, + Uint8 numBits) +{ + if (numBits > 7) + { + DCMSEG_ERROR("Invalid input data: shiftFrameBitsLeft() can only shift 0-7 bits"); + return; + } + Uint8 carryOver = 0; + for (size_t x = 0; x < bufLen; x++) + { + // Store current byte since we need to restore its first bits later + Uint8 current = buf[x]; + // Shift pixels given num bits to the left, creating (8 - num bits) + // empty bits at the right + buf[x] <<= numBits; + // If there is a carry over from the previous byte, add it in again (will always be at the end, + // see carry over calculation in next step) + buf[x] |= carryOver; + // Compute carry over bits for next byte to be handled, i.e. those bits at the left that will be + // overwritten in the next byte + carryOver = current >> (8-numBits); + } +} + + +void DcmSegUtils::alignFrameOnByteBoundary(Uint8* buf, + size_t bufLen, + Uint8 numBits) +{ + if (numBits > 7) + { + DCMSEG_ERROR("Invalid input data: alignFrameOnByteBoundary() can only shift 0-7 bits"); + return; + } + for (size_t x = 0; x < bufLen-1; x++) + { + // Shift current byte + buf[x] = buf[x] >> numBits; + // isolate portion of next byte that must be shifted into current byte + Uint8 next = (buf[x+1] << (8-numBits)); + // Take over portion from next byte + buf[x] |= next; + } + // Shift last byte manually + buf[bufLen-1] >>= numBits; +} + + +void DcmSegUtils::debugDumpBin(Uint8* buffer, + size_t length, + const char* what) +{ + for (size_t n=0; n= 0; i--) + { + result[i]= (b & 1) + '0'; + + b >>= 1; + } + return result; +} diff --git a/dcmseg/tests/CMakeLists.txt b/dcmseg/tests/CMakeLists.txt new file mode 100644 index 00000000..75e108df --- /dev/null +++ b/dcmseg/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +# declare executables +DCMTK_ADD_EXECUTABLE(dcmseg_tests tests tutils) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(dcmseg_tests dcmseg dcmfg dcmiod dcmdata oflog ofstd) + +# This macro parses tests.cc and registers all tests +DCMTK_ADD_TESTS(dcmseg) diff --git a/dcmseg/tests/Makefile.dep b/dcmseg/tests/Makefile.dep new file mode 100644 index 00000000..b9945927 --- /dev/null +++ b/dcmseg/tests/Makefile.dep @@ -0,0 +1,177 @@ +tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h +tutils.o: tutils.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/oftest.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmseg/segutils.h ../include/dcmtk/dcmseg/segdef.h \ + ../include/dcmtk/dcmseg/segtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \ + ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \ + ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \ + ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \ + ../../dcmiod/include/dcmtk/dcmiod/modbase.h diff --git a/dcmseg/tests/Makefile.in b/dcmseg/tests/Makefile.in new file mode 100644 index 00000000..12ce44f3 --- /dev/null +++ b/dcmseg/tests/Makefile.in @@ -0,0 +1,59 @@ +# +# Makefile for dcmseg/tests +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmioddir = $(top_srcdir)/../dcmiod +dcmfgdir = $(top_srcdir)/../dcmfg + +LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc \ + -L$(dcmdatadir)/libsrc -L$(dcmioddir)/libsrc -L$(dcmfgdir)/libsrc +LOCALLIBS = -ldcmseg -ldcmfg -ldcmiod -ldcmdata -loflog -lofstd $(ZLIBLIBS) \ + $(CHARCONVLIBS) $(MATHLIBS) +LOCALINCLUDES = -I$(top_srcdir)/include -I$(ofstddir)/include -I$(oflogdir)/include \ + -I$(dcmdatadir)/include -I$(dcmioddir)/include -I$(dcmfgdir)/include \ + +test_objs = tests.o tutils.o +objs = $(test_objs) +progs = tests + + +all: $(progs) + +tests: $(test_objs) + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $(test_objs) $(LOCALLIBS) $(LIBS) + + +check: tests + ./tests + +check-exhaustive: tests + ./tests -x + + +install: all + + +clean: + rm -f $(objs) $(progs) $(LOCALTRASH) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(LOCALTRASH) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmseg/tests/tests.cc b/dcmseg/tests/tests.cc new file mode 100644 index 00000000..6e7b4626 --- /dev/null +++ b/dcmseg/tests/tests.cc @@ -0,0 +1,26 @@ +/* + * + * Copyright (C) 2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: main test program + * + */ + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/ofstd/oftest.h" + +OFTEST_REGISTER(dcmseg_utils); +OFTEST_MAIN("dcmseg") diff --git a/dcmseg/tests/tutils.cc b/dcmseg/tests/tutils.cc new file mode 100644 index 00000000..4eaf1f86 --- /dev/null +++ b/dcmseg/tests/tutils.cc @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 2015-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmseg + * + * Author: Michael Onken + * + * Purpose: tests for dcmseg's DcmSegUtils functionalities + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/oftest.h" +#include "dcmtk/dcmseg/segutils.h" + + +#define bufLen 4 + +static void resetBuf(Uint8* buf, const size_t length) +{ + if (length != bufLen) return; + buf[0] = 170; // 10101010 + buf[1] = 204; // 11001100 + buf[2] = 240; // 11110000 + buf[3] = 15; // 00001111 +} + +OFTEST(dcmseg_utils) +{ + // buf, always initialized/reset with: 10101010 11001100 11110000 00001111 + Uint8 buf[bufLen]; + + resetBuf(buf, bufLen); + DcmSegUtils::alignFrameOnBitPosition(buf, 4, 2); + OFCHECK(buf[0] == 168); // 10101000 + OFCHECK(buf[1] == 50); // 00110010 + OFCHECK(buf[2] == 195); // 11000011 + OFCHECK(buf[3] == 63); // 00111111 + + resetBuf(buf, bufLen); + DcmSegUtils::alignFrameOnByteBoundary(buf, 4, 2); + OFCHECK(buf[0] == 42); // 00101010 + OFCHECK(buf[1] == 51); // 00110011 + OFCHECK(buf[2] == 252); // 11111100 + OFCHECK(buf[3] == 3); // 00000011 + + resetBuf(buf, bufLen); + DcmSegUtils::alignFrameOnBitPosition(buf, 4, 7); + OFCHECK(buf[0] == 0); + OFCHECK(buf[1] == 85); // 01010101 + OFCHECK(buf[2] == 102); // 01100110 + OFCHECK(buf[3] == 248); // 11111000 + + resetBuf(buf, bufLen); + DcmSegUtils::alignFrameOnByteBoundary(buf, 4, 7); + OFCHECK(buf[0] == 153); // 10011001 + OFCHECK(buf[1] == 225); // 11100001 + OFCHECK(buf[2] == 31); // 00011111 + OFCHECK(buf[3] == 0); + +} diff --git a/dcmsign/CMakeLists.txt b/dcmsign/CMakeLists.txt new file mode 100644 index 00000000..68205cbc --- /dev/null +++ b/dcmsign/CMakeLists.txt @@ -0,0 +1,10 @@ +# declare project +project(dcmsign) + +# declare include directories which hold for all subdirectories +include_directories("${dcmsign_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR}) + +# recurse into subdirectories +foreach(SUBDIR libsrc apps include) + add_subdirectory(${SUBDIR}) +endforeach() diff --git a/dcmsign/Makefile.in b/dcmsign/Makefile.in new file mode 100644 index 00000000..03731f58 --- /dev/null +++ b/dcmsign/Makefile.in @@ -0,0 +1,97 @@ +# +# Makefile for dcmsign +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: include-all libsrc-all apps-all tests-all + +install: install-bin install-doc install-support + +install-bin: apps-install + +install-doc: docs-install + +install-data: data-install + +install-etc: etc-install + +install-include: include-install + +install-lib: libsrc-install install-include + +install-support: install-data install-etc + + +include-all: + (cd include && $(MAKE) ARCH="$(ARCH)" all) + +libsrc-all: include-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" all) + +apps-all: libsrc-all + (cd apps && $(MAKE) ARCH="$(ARCH)" all) + +tests-all: libsrc-all + (cd tests && $(MAKE) ARCH="$(ARCH)" all) + + +check: tests-all + (cd tests && $(MAKE) check) + +check-exhaustive: tests-all + (cd tests && $(MAKE) check-exhaustive) + + +include-install: + (cd include && $(MAKE) ARCH="$(ARCH)" install) + +libsrc-install: libsrc-all + (cd libsrc && $(MAKE) ARCH="$(ARCH)" install) + +apps-install: apps-all + (cd apps && $(MAKE) ARCH="$(ARCH)" install) + +docs-install: + (cd docs && $(MAKE) install) + +data-install: + (cd data && $(MAKE) install) + +etc-install: + (cd etc && $(MAKE) install) + + +clean: + (cd include && $(MAKE) clean) + (cd libsrc && $(MAKE) clean) + (cd apps && $(MAKE) clean) + (cd tests && $(MAKE) clean) + (cd docs && $(MAKE) clean) + (cd data && $(MAKE) clean) + (cd etc && $(MAKE) clean) + rm -f $(TRASH) + +distclean: + (cd include && $(MAKE) distclean) + (cd libsrc && $(MAKE) distclean) + (cd apps && $(MAKE) distclean) + (cd tests && $(MAKE) distclean) + (cd docs && $(MAKE) distclean) + (cd data && $(MAKE) distclean) + (cd etc && $(MAKE) distclean) + rm -f $(DISTTRASH) + +dependencies: + (cd libsrc && touch $(DEP) && $(MAKE) dependencies) + (cd apps && touch $(DEP) && $(MAKE) dependencies) +# (cd tests && touch $(DEP) && $(MAKE) dependencies) diff --git a/dcmsign/apps/CMakeLists.txt b/dcmsign/apps/CMakeLists.txt new file mode 100644 index 00000000..2ac47a80 --- /dev/null +++ b/dcmsign/apps/CMakeLists.txt @@ -0,0 +1,6 @@ +# declare directories containing used libraries +# declare executables +DCMTK_ADD_EXECUTABLE(dcmsign dcmsign) + +# make sure executables are linked to the corresponding libraries +DCMTK_TARGET_LINK_MODULES(dcmsign dcmdsig dcmdata oflog ofstd) diff --git a/dcmsign/apps/Makefile.dep b/dcmsign/apps/Makefile.dep new file mode 100644 index 00000000..a836795b --- /dev/null +++ b/dcmsign/apps/Makefile.dep @@ -0,0 +1,128 @@ +dcmsign.o: dcmsign.cc ../../config/include/dcmtk/config/osconfig.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../ofstd/include/dcmtk/ofstd/ofconapp.h \ + ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/ofconsol.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../ofstd/include/dcmtk/ofstd/ofexit.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../include/dcmtk/dcmsign/dcsignat.h ../include/dcmtk/dcmsign/sitypes.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../include/dcmtk/dcmsign/sinullpr.h ../include/dcmtk/dcmsign/sisprof.h \ + ../include/dcmtk/dcmsign/sibrsapr.h ../include/dcmtk/dcmsign/siautopr.h \ + ../include/dcmtk/dcmsign/sicreapr.h ../include/dcmtk/dcmsign/simac.h \ + ../include/dcmtk/dcmsign/simd5.h ../include/dcmtk/dcmsign/sisha1.h \ + ../include/dcmtk/dcmsign/sisha256.h ../include/dcmtk/dcmsign/sisha384.h \ + ../include/dcmtk/dcmsign/sisha512.h ../include/dcmtk/dcmsign/siripemd.h \ + ../include/dcmtk/dcmsign/siprivat.h ../include/dcmtk/dcmsign/sicert.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctk.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \ + ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruv.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrov.h diff --git a/dcmsign/apps/Makefile.in b/dcmsign/apps/Makefile.in new file mode 100644 index 00000000..9ef70f50 --- /dev/null +++ b/dcmsign/apps/Makefile.in @@ -0,0 +1,52 @@ +# +# Makefile for dcmsign/apps +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include +LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc \ + -L$(dcmdatadir)/libsrc +LOCALLIBS = -ldcmdsig -ldcmdata -loflog -lofstd $(ZLIBLIBS) $(OPENSSLLIBS) \ + $(CHARCONVLIBS) $(MATHLIBS) + +objs = dcmsign.o +progs = dcmsign + + +all: $(progs) + +dcmsign: dcmsign.o + $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS) + + +install: all + $(configdir)/mkinstalldirs $(DESTDIR)$(bindir) + for prog in $(progs); do \ + $(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\ + done + + +clean: + rm -f $(objs) $(progs) $(TRASH) + +distclean: + rm -f $(objs) $(progs) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmsign/apps/dcmsign.cc b/dcmsign/apps/dcmsign.cc new file mode 100644 index 00000000..2097ce8d --- /dev/null +++ b/dcmsign/apps/dcmsign.cc @@ -0,0 +1,1175 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: Create and Verify DICOM Digital Signatures + * + */ + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDIO +#define INCLUDE_CSTRING +#define INCLUDE_CCTYPE +#include "dcmtk/ofstd/ofstdinc.h" + +#include "dcmtk/dcmdata/cmdlnarg.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/ofstd/ofconapp.h" +#include "dcmtk/dcmdata/dcuid.h" /* for dcmtk version name */ + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dcmsign" + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + +static OFLogger dcmsignLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +#define APPLICATION_ABSTRACT "Sign and Verify DICOM Files" + + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/dcsignat.h" +#include "dcmtk/dcmsign/sinullpr.h" +#include "dcmtk/dcmsign/sibrsapr.h" +#include "dcmtk/dcmsign/siautopr.h" +#include "dcmtk/dcmsign/sicreapr.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/simd5.h" +#include "dcmtk/dcmsign/sisha1.h" +#include "dcmtk/dcmsign/sisha256.h" +#include "dcmtk/dcmsign/sisha384.h" +#include "dcmtk/dcmsign/sisha512.h" +#include "dcmtk/dcmsign/siripemd.h" +#include "dcmtk/dcmsign/siprivat.h" +#include "dcmtk/dcmsign/sicert.h" +#include "dcmtk/dcmdata/dctk.h" + + +BEGIN_EXTERN_C +#include +END_EXTERN_C + +// ******************************************** + +enum DcmSignOperation +{ + DSO_verify, + DSO_sign, + DSO_signItem, + DSO_remove, + DSO_removeAll +}; + +/* reads an attribute tag in the form "gggg,eeee" and adds it + * to the given attribute tag list + * @param c input string + * @param tagList list to be added to + * @return true if successful, false otherwise + */ +static OFBool addTag(const char *c, DcmAttributeTag& tagList) +{ + OFBool result = OFFalse; + unsigned int group = 0xffff; + unsigned int elem = 0xffff; + if (sscanf(c, "%x,%x", &group, &elem ) != 2 ) + { + /* it is a name */ + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(c); + if (dicent) + { + if (EC_Normal == tagList.putTagVal(dicent->getKey(), tagList.getVM())) result = OFTrue; + } + dcmDataDict.rdunlock(); + } else { + if (EC_Normal == tagList.putTagVal(DcmTagKey(group,elem), tagList.getVM())) result = OFTrue; + } + return result; +} + +/* scans a token from the given string and returns it. Ignores leading whitespace. + * @param c string to parse + * @param pos position within string, modified after successful scan + * @param key tag key returned in this parameter if return value is "tag key". + * @param idx index returned in this parameter if return value is "index". + * @return -1 for "EOF", 0 for "parse error", 1 for "tag key", 2 for "index", 3 for "period" + */ +static int readNextToken(const char *c, int& pos, DcmTagKey& key, Uint32& idx) +{ + OFString aString; + int lpos = pos; + int spos = 0; + while(isspace(OFstatic_cast(unsigned char, c[lpos]))) ++lpos; // ignore leading space + + if (c[lpos]=='\0') return -1; // EOF + if (c[lpos]=='.') + { + ++pos; + return 3; // period + } + if (c[lpos]=='[') + { + spos = ++lpos; + while ((c[lpos] >= '0')&&(c[lpos] <= '9')) ++lpos; + if (c[lpos] != ']') return 0; // parse error + unsigned long newindex = 0; + if (1 != sscanf(c+spos,"%lu", &newindex)) return 0; // parse error + idx = OFstatic_cast(Uint32, newindex); + pos = ++lpos; + return 2; // index + } + if (c[lpos]=='(') + { + spos = ++lpos; + while ((c[lpos] != ')')&&(c[lpos] != '\0')) ++lpos; + if (c[lpos] != ')') return 0; // parse error + unsigned int group=0; + unsigned int elem=0; + if (2 != sscanf(c+spos,"%x,%x", &group, &elem)) return 0; // parse error + key = DcmTagKey(group,elem); + pos = ++lpos; + return 1; // tag key + } + spos = lpos; + while ( ((c[lpos] >= 'a')&&(c[lpos] <= 'z')) || ((c[lpos] >= 'A')&&(c[lpos] <= 'Z')) || ((c[lpos] >= '0')&&(c[lpos] <= '9'))) ++lpos; + aString.append(c + spos, (lpos-spos)); + const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock(); + const DcmDictEntry *dicent = globalDataDict.findEntry(aString.c_str()); + if (dicent) + { + key = dicent->getKey(); + dcmDataDict.rdunlock(); + pos = lpos; + return 1; // tag key; + } + dcmDataDict.rdunlock(); + OFLOG_ERROR(dcmsignLogger, "attribute name '" << aString.c_str() << "' unknown."); + return 0; // parse error +} + +/* reads a complete text file (max 64K) into a memory block + * and returns a pointer to the memory block. + * memory must be freed by called. + * @param filename file to be read + * @return pointer to memory block if successful, NULL otherwise. + */ +static char *readTextFile(const char *filename) +{ + char *result = NULL; + FILE *file = fopen(filename, "rb"); + if (file) + { + fseek(file, 0, SEEK_END); + long numBytes = ftell(file); + fseek(file, 0, SEEK_SET); + if (numBytes > 65536) + { + OFLOG_WARN(dcmsignLogger, "text file too large, ignoring everything beyond 64K."); + numBytes = 65536; + } + result = new char[numBytes]; + if (result) + { + if (OFstatic_cast(size_t, numBytes) != fread(result, 1, OFstatic_cast(size_t, numBytes), file)) + { + OFLOG_WARN(dcmsignLogger, "read error in file " << filename); + delete[] result; + result = NULL; + } + } + fclose(file); + } else { + OFLOG_ERROR(dcmsignLogger, "file not found: " << filename); + } + return result; +} + +/* reads a list of attributes from a text file. + * The attributes can be in the form (gggg,eeee) or can be dictionary names, + * separated by arbitrary whitespace. + * @param filename file to be read from + * @param tagList attribute tags are added to this list + * @return 0 if successful, a program exit code otherwise + */ +static int parseTextFile(const char *filename, DcmAttributeTag& tagList) +{ + char *c=readTextFile(filename); + if (c==NULL) return 10; // bail out + int position = 0; + int token = 0; + Uint32 idx = 0; + DcmTagKey key; + int result = 0; + do + { + token = readNextToken(c, position, key, idx); + if (token == 1) // we have read a tag key + { + if (EC_Normal != tagList.putTagVal(key, tagList.getVM())) + { + result = 10; + token = -1; + } + } + else if (token >= 0) + { + OFLOG_ERROR(dcmsignLogger, "parse error in text file '" << filename << "'"); + result = 10; + token = -1; + } + } while (token >= 0); + delete[] c; + return result; +} + + +/* locates a specific item within the given dataset. + * @param dataset dataset to be searched + * @param location location string. Format is "sequence[item]{.sequence[item]}*" + * Where sequence can be (gggg,eeee) or a dictionary name and items + * within sequences are counted from zero. + * @return pointer to the item searched if found, NULL otherwise + */ +static DcmItem *locateItemforSignatureCreation(DcmItem& dataset, const char *location) +{ + DcmTagKey key; + Uint32 idx; + int pos = 0; + int token = 0; + int expected = 1; + OFBool finished = OFFalse; + DcmItem *result = &dataset; + DcmSequenceOfItems *sq = NULL; + DcmStack stack; + do + { + token = readNextToken(location, pos, key, idx); + if ((token != expected)&&(token != -1)) + { + OFLOG_ERROR(dcmsignLogger, "parse error in item location string '" << location << "'"); + return NULL; + } + if (token == -1) + { + if (! finished) + { + OFLOG_ERROR(dcmsignLogger, "item location string '" << location << "' incomplete."); + return NULL; + } + return result; + } + if (token == 1) + { + // we have read a tag key + stack.clear(); + if (EC_Normal != result->search(key, stack, ESM_fromHere, OFFalse)) + { + OFLOG_ERROR(dcmsignLogger, "attribute " << key << " not found in dataset (item location string is '" << location << "')"); + return NULL; + } + if (stack.top()->ident() == EVR_SQ) + { + sq = OFstatic_cast(DcmSequenceOfItems *, (stack.top())); + } else { + OFLOG_ERROR(dcmsignLogger, "attribute " << key << " is not a sequence (item location string is '" << location << "')"); + return NULL; + } + expected = 2; + finished = OFFalse; + } + else if (token == 2) + { + // we have read an index + if (sq == NULL) + { + OFLOG_ERROR(dcmsignLogger, "sequence not found in item location string '" << location << "'"); + return NULL; + } + if (idx >= sq->card()) + { + OFLOG_ERROR(dcmsignLogger, "sequence " << sq->getTag() << " only has " << sq->card() + << " items, cannot locate item " << idx << " (item location string is '" << location << "')"); + return NULL; + } + result = sq->getItem(idx); + if (result == NULL) + { + OFLOG_ERROR(dcmsignLogger, "item not found in item location string '" << location << "'"); + return NULL; + } + expected = 3; + finished = OFTrue; + } + else if (token == 3) + { + // we have read a period + expected = 1; + finished = OFFalse; + } + } while (token > 0); + return NULL; +} + +/* performs a signature operation on a given dataset + * @param dataset to sign + * @param key private key for signature + * @param cert certificate for signature + * @param opt_mac MAC for signature + * @param opt_profile security profile for signature + * @param opt_tagList list of attribute tags, may be NULL + * @return 0 if successful, a program exit code otherwise + */ +static int do_sign( + DcmItem *dataset, + SiPrivateKey& key, + SiCertificate& cert, + SiMAC *opt_mac, + SiSecurityProfile *opt_profile, + DcmAttributeTag *opt_tagList, + E_TransferSyntax opt_signatureXfer, + FILE *dumpFile) +{ + OFCondition sicond = EC_Normal; + DcmSignature signer; + signer.attach(dataset); + signer.setDumpFile(dumpFile); + sicond = signer.createSignature(key, cert, *opt_mac, *opt_profile, opt_signatureXfer, opt_tagList); + if (sicond != EC_Normal) + { + OFLOG_ERROR(dcmsignLogger, sicond.text() << ": while creating signature in main dataset"); + return 1; + } + return 0; +} + +/* print the location stack into the given stack. + * It is assumed that the stack top is a DigitalSignatureSequence which is not printed + * and that the stack bottom is the main dataset, which is also not printed. + * @param stack search stack, as returned by DcmSignature::findFirstSignatureItem() etc. + * @param str printable text returned in this string. + */ +static void printSignatureItemPosition(DcmStack& stack, OFString& str) +{ + str.clear(); + DcmObject *elem = NULL; + DcmSequenceOfItems *sq = NULL; + unsigned long sqCard=0; + const char *tagname = NULL; + unsigned long m=0; + char buf[20]; + + if (stack.card() > 2) + { + // signature is located within a sequence + for (unsigned long l=stack.card()-2; l>0; --l) // loop over all elements except the stack top and bottom + { + elem = stack.elem(l); + if (elem) + { + if ((elem->ident() == EVR_item) && sq) + { + sqCard = sq->card(); + for (m=0; mgetItem(m) == elem) + { + sprintf(buf, "[%lu]", m); + str.append(buf); + } + } + } + else + { + if (str.size() > 0) str.append("."); + sq = OFstatic_cast(DcmSequenceOfItems *, elem); + DcmTag currentTag(elem->getTag()); + tagname = currentTag.getTagName(); + if (tagname) str.append(tagname); else + { + sprintf(buf, "(%04x,%04x)", elem->getTag().getGroup(), elem->getTag().getElement()); + str.append(buf); + } + if (elem->ident() == EVR_SQ) sq = OFstatic_cast(DcmSequenceOfItems *, elem); else sq = NULL; + } + } + } + } else { + // signature is located in the main dataset + str = "Main Dataset"; + } +} + +/* performs a signature operation on a sub-item within a dataset + * @param dataset in which to sign + * @param key private key for signature + * @param cert certificate for signature + * @param opt_mac MAC for signature + * @param opt_profile security profile for signature + * @param opt_tagList list of attribute tags, may be NULL + * @param location location string. Format is "sequence[item]{.sequence[item]}*" + * Where sequence can be (gggg,eeee) or a dictionary name and items + * within sequences are counted from zero. + * @return 0 if successful, a program exit code otherwise + */ +static int do_sign_item( + DcmItem *dataset, + SiPrivateKey& key, + SiCertificate& cert, + SiMAC *opt_mac, + SiSecurityProfile *opt_profile, + DcmAttributeTag *opt_tagList, + const char *opt_location, + E_TransferSyntax opt_signatureXfer, + FILE *dumpFile) +{ + OFCondition sicond = EC_Normal; + DcmSignature signer; + DcmItem *sigItem = locateItemforSignatureCreation(*dataset, opt_location); + if (sigItem == NULL) return 1; + + signer.detach(); + signer.attach(sigItem); + signer.setDumpFile(dumpFile); + sicond = signer.createSignature(key, cert, *opt_mac, *opt_profile, opt_signatureXfer, opt_tagList); + if (sicond != EC_Normal) + { + OFLOG_ERROR(dcmsignLogger, sicond.text() << ": while creating signature in item '" << opt_location << "'"); + return 1; + } + signer.detach(); + return 0; +} + +/* verify all signatures in the given dataset and print results to COUT. + * @param dataset dataset to verify + * @return 0 if successful, a program exit code otherwise + */ +static int do_verify( + DcmItem *dataset) +{ + OFCondition sicond = EC_Normal; + DcmStack stack; + DcmSignature signer; + OFString aString; + int counter = 0; + int corrupt_counter = 0; + unsigned long numSignatures = 0; + unsigned long l=0; + Uint16 macID = 0; + DcmAttributeTag at(DCM_DataElementsSigned); + DcmItem *sigItem = DcmSignature::findFirstSignatureItem(*dataset, stack); + DcmTagKey tagkey; + DcmTag tag; + const char *tagName = NULL; + + while (sigItem) + { + signer.attach(sigItem); + numSignatures = signer.numberOfSignatures(); + for (l=0; lgetKeyType()==EKT_none)) + OFLOG_INFO(dcmsignLogger, " none"); + else + { + OFLOG_INFO(dcmsignLogger, " X.509v" << cert->getX509Version()); + cert->getCertSubjectName(aString); + OFLOG_INFO(dcmsignLogger, " Subject : " << aString); + + cert->getCertIssuerName(aString); + OFLOG_INFO(dcmsignLogger, " Issued by : " << aString); + OFLOG_INFO(dcmsignLogger, " Serial no. : " << cert->getCertSerialNo()); + cert->getCertValidityNotBefore(aString); + OFLOG_INFO(dcmsignLogger, " Validity : not before " << aString); + cert->getCertValidityNotAfter(aString); + OFLOG_INFO(dcmsignLogger, " Validity : not after " << aString); + switch (cert->getKeyType()) + { + case EKT_RSA: + OFLOG_INFO(dcmsignLogger, " Public key : RSA, " << cert->getCertKeyBits() << " bits"); + break; + case EKT_DSA: + OFLOG_INFO(dcmsignLogger, " Public key : DSA, " << cert->getCertKeyBits() << " bits"); + break; + case EKT_DH: + OFLOG_INFO(dcmsignLogger, " Public key : DH, " << cert->getCertKeyBits() << " bits"); + break; + case EKT_none: // should never happen + OFLOG_INFO(dcmsignLogger, " Public key : none"); + break; + } + } + aString = " Verification : "; + } else { + OFLOG_INFO(dcmsignLogger, " Location : " << aString); + aString = " Verification : "; + } + sicond = signer.verifyCurrent(); + if (sicond.good()) + { + OFLOG_WARN(dcmsignLogger, aString << "OK\n"); + } else { + corrupt_counter++; + OFLOG_WARN(dcmsignLogger, aString << sicond.text() << "\n"); + } + } + } + signer.detach(); + sigItem = DcmSignature::findNextSignatureItem(*dataset, stack); + } + if (counter == 0) + OFLOG_WARN(dcmsignLogger, "no signatures found in dataset."); + else + OFLOG_INFO(dcmsignLogger, counter << " signatures verified in dataset, " << corrupt_counter << " corrupted."); + return 0; +} + +/* remove all signatures from the given dataset, print action details. + * @param dataset dataset to modify + * @return 0 if successful, a program exit code otherwise + */ +static int do_remove_all( + DcmItem *dataset) +{ + OFCondition sicond = EC_Normal; + DcmSignature signer; + int counter = 0; + OFString aString; + DcmStack stack; + DcmItem *sigItem = DcmSignature::findFirstSignatureItem(*dataset, stack); + while (sigItem) + { + signer.attach(sigItem); + while (signer.numberOfSignatures() > 0) + { + ++counter; + if (EC_Normal == signer.selectSignature(0)) + { + if (EC_Normal == signer.getCurrentSignatureUID(aString)) + OFLOG_WARN(dcmsignLogger, "Signature #" << counter << " UID=" << aString); + else + OFLOG_WARN(dcmsignLogger, "Signature #" << counter << " UID=(unknown)"); + printSignatureItemPosition(stack, aString); + OFLOG_WARN(dcmsignLogger, " Location : " << aString); + } + sicond = signer.removeSignature(0); + if (sicond != EC_Normal) + { + OFLOG_ERROR(dcmsignLogger, sicond.text() << ": while removing signature"); + return 1; + } + } + signer.detach(); + stack.pop(); // remove pointer to the Digital Signatures Sequence that we've just deleted. + sigItem = DcmSignature::findNextSignatureItem(*dataset, stack); + } + + OFLOG_INFO(dcmsignLogger, counter << " signatures found and removed from dataset."); + return 0; +} + +/* remove the signature with the given UID from the dataset, print action details. + * @param dataset dataset to modify + * @param opt_location Digital Signature UID of the signature to remove + * @return 0 if successful, a program exit code otherwise + */ +static int do_remove( + DcmItem *dataset, + const char *opt_location) +{ + OFCondition sicond = EC_Normal; + DcmSignature signer; + OFString aString; + DcmStack stack; + unsigned long cardSQ; + unsigned long i; + DcmItem *sigItem = DcmSignature::findFirstSignatureItem(*dataset, stack); + while (sigItem) + { + signer.attach(sigItem); + cardSQ = signer.numberOfSignatures(); + for (i=0; i 1) cmd.getParam(2, opt_ofname); + + OFLog::configureFromCommandLine(cmd, app); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--verify")) + { + opt_operation = DSO_verify; + } + if (cmd.findOption("--sign")) + { + opt_operation = DSO_sign; + if (opt_ofname == NULL) app.printError("parameter dcmfile-out required for --sign"); + app.checkValue(cmd.getValue(opt_keyfile)); + app.checkValue(cmd.getValue(opt_certfile)); + } + if (cmd.findOption("--sign-item")) + { + opt_operation = DSO_signItem; + if (opt_ofname == NULL) app.printError("parameter dcmfile-out required for --sign-item"); + app.checkValue(cmd.getValue(opt_keyfile)); + app.checkValue(cmd.getValue(opt_certfile)); + app.checkValue(cmd.getValue(opt_location)); + } + if (cmd.findOption("--remove")) + { + opt_operation = DSO_remove; + if (opt_ofname == NULL) app.printError("parameter dcmfile-out required for --remove"); + app.checkValue(cmd.getValue(opt_location)); + } + if (cmd.findOption("--remove-all")) + { + opt_operation = DSO_removeAll; + if (opt_ofname == NULL) app.printError("parameter dcmfile-out required for --remove-all"); + } + cmd.endOptionBlock(); + + if ((opt_operation == DSO_verify) && opt_ofname) app.printError("parameter dcmfile-out not allowed for --verify"); + + cmd.beginOptionBlock(); + if (cmd.findOption("--std-passwd")) + { + app.checkDependence("--std-passwd", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_passwd = NULL; + } + if (cmd.findOption("--use-passwd")) + { + app.checkDependence("--use-passwd", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + app.checkValue(cmd.getValue(opt_passwd)); + } + if (cmd.findOption("--null-passwd")) + { + app.checkDependence("--null-passwd", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_passwd = ""; + } + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--pem-keys")) opt_keyFileFormat = X509_FILETYPE_PEM; + if (cmd.findOption("--der-keys")) opt_keyFileFormat = X509_FILETYPE_ASN1; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--profile-none")) + { + app.checkDependence("--profile-none", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_profile = new SiNullProfile(); + } + if (cmd.findOption("--profile-base")) + { + app.checkDependence("--profile-base", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_profile = new SiBaseRSAProfile(); + } + if (cmd.findOption("--profile-creator")) + { + app.checkDependence("--profile-creator", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_profile = new SiCreatorProfile(); + } + if (cmd.findOption("--profile-auth")) + { + app.checkDependence("--profile-auth", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_profile = new SiAuthorizationProfile(); + } + cmd.endOptionBlock(); + if (opt_profile == NULL) opt_profile = new SiNullProfile(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--mac-ripemd160")) + { + app.checkDependence("--mac-ripemd160", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_mac = new SiRIPEMD160(); + } + if (cmd.findOption("--mac-sha1")) + { + app.checkDependence("--mac-sha1", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_mac = new SiSHA1(); + } + if (cmd.findOption("--mac-md5")) + { + app.checkDependence("--mac-md5", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_mac = new SiMD5(); + } + if (cmd.findOption("--mac-sha256")) + { + app.checkDependence("--mac-sha256", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_mac = new SiSHA256(); + } + if (cmd.findOption("--mac-sha384")) + { + app.checkDependence("--mac-sha384", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_mac = new SiSHA384(); + } + if (cmd.findOption("--mac-sha512")) + { + app.checkDependence("--mac-sha512", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + opt_mac = new SiSHA512(); + } + + cmd.endOptionBlock(); + if (opt_mac == NULL) opt_mac = new SiRIPEMD160(); + + if (cmd.findOption("--tag-file")) + { + app.checkValue(cmd.getValue(opt_tagFile)); + opt_tagList = new DcmAttributeTag(DCM_DataElementsSigned); + result = parseTextFile(opt_tagFile, *opt_tagList); + if (result > 0) + { + OFLOG_FATAL(dcmsignLogger, "Error while reading tag file '" << opt_tagFile << "', giving up."); + return result; + } + } + + if (cmd.findOption("--tag", 0, OFCommandLine::FOM_First)) + { + const char *current=NULL; + if (opt_tagList == NULL) opt_tagList = new DcmAttributeTag(DCM_DataElementsSigned); + do + { + app.checkValue(cmd.getValue(current)); + if (! addTag(current, *opt_tagList)) + { + OFLOG_FATAL(dcmsignLogger, "unknown attribute tag '" << current << "'"); + return 10; + } + } while (cmd.findOption("--tag", 0, OFCommandLine::FOM_Next)); + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--format-new")) dcmEnableOldSignatureFormat.set(OFFalse); + if (cmd.findOption("--format-old")) dcmEnableOldSignatureFormat.set(OFTrue); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-same")) opt_oxfer = EXS_Unknown; + if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + if (cmd.findOption("--dump")) + { + app.checkDependence("--dump", "--sign or --sign-item", (opt_operation == DSO_sign) || (opt_operation == DSO_signItem)); + const char *fileName = NULL; + app.checkValue(cmd.getValue(fileName)); + opt_dumpFile = fopen(fileName, "wb"); + if (opt_dumpFile == NULL) + { + OFLOG_FATAL(dcmsignLogger, "unable to create dump file '" << fileName << "'"); + return 10; + } + } + } + + /* print resource identifier */ + OFLOG_DEBUG(dcmsignLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dcmsignLogger, "no data dictionary loaded, " + << "check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // open inputfile + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(dcmsignLogger, "invalid filename: "); + return 1; + } + + OFLOG_INFO(dcmsignLogger, "open input file " << opt_ifname); + + DcmFileFormat *fileformat = new DcmFileFormat; + + OFCondition sicond = fileformat->loadFile(opt_ifname, opt_ixfer, EGL_noChange, DCM_MaxReadLength, opt_readMode); + if (sicond.bad()) + { + OFLOG_FATAL(dcmsignLogger, sicond.text() << ": reading file: " << opt_ifname); + return 1; + } + + DcmDataset *dataset = fileformat->getDataset(); + + SiCertificate cert; + SiPrivateKey key; + + if (opt_certfile) + { + sicond = cert.loadCertificate(opt_certfile, opt_keyFileFormat); + if (sicond != EC_Normal) + { + OFLOG_FATAL(dcmsignLogger, sicond.text() << ": while loading certificate file '" << opt_certfile << "'"); + return 1; + } + } + + if (opt_keyfile) + { + if (opt_passwd) key.setPrivateKeyPasswd(opt_passwd); + sicond = key.loadPrivateKey(opt_keyfile, opt_keyFileFormat); + if (sicond != EC_Normal) + { + OFLOG_FATAL(dcmsignLogger, sicond.text() << ": while loading private key file '" << opt_keyfile << "'"); + return 1; + } + } + + // need to load all data into memory before signing the document, + // otherwise the pixel data would be empty for compressed images + fileformat->loadAllDataIntoMemory(); + + // select transfer syntax in which digital signatures are created + opt_signatureXfer = dataset->getOriginalXfer(); + + // use Little Endian Explicit for uncompressed files + if ((opt_signatureXfer == EXS_LittleEndianImplicit) || + (opt_signatureXfer == EXS_BigEndianExplicit)) + opt_signatureXfer = EXS_LittleEndianExplicit; + + // now do the real work + switch (opt_operation) + { + case DSO_verify: + OFLOG_INFO(dcmsignLogger, "verifying all signatures."); + result = do_verify(dataset); + if (result != 0) return result; + break; + case DSO_sign: + OFLOG_INFO(dcmsignLogger, "create signature in main object."); + result = do_sign(dataset, key, cert, opt_mac, opt_profile, opt_tagList, opt_signatureXfer, opt_dumpFile); + if (result != 0) return result; + break; + case DSO_signItem: + OFLOG_INFO(dcmsignLogger, "create signature in sequence item."); + result = do_sign_item(dataset, key, cert, opt_mac, opt_profile, opt_tagList, opt_location, opt_signatureXfer, opt_dumpFile); + if (result != 0) return result; + break; + case DSO_remove: + OFLOG_INFO(dcmsignLogger, "removing signature from sequence item."); + result = do_remove(dataset, opt_location); + if (result != 0) return result; + break; + case DSO_removeAll: + OFLOG_INFO(dcmsignLogger, "removing all signatures."); + result = do_remove_all(dataset); + if (result != 0) return result; + break; + } + + if (opt_dumpFile) + { + if (0 != fclose(opt_dumpFile)) + { + OFLOG_FATAL(dcmsignLogger, "Error while closing dump file, content may be incomplete."); + } + opt_dumpFile = NULL; + } + + if (opt_ofname) + { + OFLOG_INFO(dcmsignLogger, "create output file " << opt_ofname); + + if (opt_oxfer == EXS_Unknown) opt_oxfer = dataset->getOriginalXfer(); + DcmXfer opt_oxferSyn(opt_oxfer); + if (dataset->chooseRepresentation(opt_oxfer, NULL).bad() || (! dataset->canWriteXfer(opt_oxfer))) + { + OFLOG_FATAL(dcmsignLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!"); + return 1; + } + + sicond = fileformat->saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc, OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad)); + if (sicond.bad()) + { + OFLOG_FATAL(dcmsignLogger, sicond.text() << ": writing file: " << opt_ofname); + return 1; + } + } + + delete opt_mac; + delete opt_profile; + delete opt_tagList; + return 0; +} + +#else /* WITH_OPENSSL */ + +int main(int, char *[]) +{ + CERR << rcsid << OFendl << APPLICATION_ABSTRACT << OFendl << OFendl + << OFFIS_CONSOLE_APPLICATION " requires the OpenSSL library." << OFendl + << "This " OFFIS_CONSOLE_APPLICATION " has been configured and compiled without OpenSSL." << OFendl + << "Please reconfigure your system and recompile if appropriate." << OFendl; + return 0; +} + +#endif /* WITH_OPENSSL */ diff --git a/dcmsign/configure b/dcmsign/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmsign/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmsign/data/Makefile.in b/dcmsign/data/Makefile.in new file mode 100644 index 00000000..64da468d --- /dev/null +++ b/dcmsign/data/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmsign/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsign/docs/Makefile.in b/dcmsign/docs/Makefile.in new file mode 100644 index 00000000..38340e96 --- /dev/null +++ b/dcmsign/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmsign/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsign/docs/dcmsign.dox b/dcmsign/docs/dcmsign.dox new file mode 100644 index 00000000..bc3ee3ce --- /dev/null +++ b/dcmsign/docs/dcmsign.dox @@ -0,0 +1,90 @@ +/*! + +\page mod_dcmsign dcmsign: a digital signature library and utility apps + +This module contains classes to create digital signatures in DICOM data sets, to +verify and to remove signatures. Signatures are conforming to the DICOM "Digital +Signatures" extension (formerly Supplement 41). This module requires the +external OpenSSL library. + +The main interface classes are: +\li \b DcmSignature +\li \b SiSecurityProfile +\li \b SiCertificate +\li \b SiPrivateKey +\li \b SiMAC + +\section Tools + +This module contains the following command line tool: +\li \ref dcmsign + +\section Examples + +The following example shows how to verify all signatures in a DICOM file: + +\code +DcmFileFormat fileformat; +if (fileformat.loadFile("test.dcm").good()) +{ + int counter = 0; // counts the signatures in the DICOM file + int corrupt_counter = 0; // counts signatures that failed verification + + DcmDataset *dataset = fileformat.getDataset(); + DcmStack stack; // stores current location within file + DcmSignature signer; // signature handler + DcmItem *sigItem = DcmSignature::findFirstSignatureItem(*dataset, stack); + while (sigItem) // browse through items that contain digital signatures + { + signer.attach(sigItem); // each item may contain multiple signatures + for (unsigned long l=0; l < signer.numberOfSignatures(); ++l) + { + if (signer.selectSignature(l).good()) + { + ++counter; + if (signer.verifyCurrent().bad()) // verify signature + corrupt_counter++; + } + } + signer.detach(); + sigItem = DcmSignature::findNextSignatureItem(*dataset, stack); + } + if (counter == 0) + cerr << "no signatures found in dataset." << endl; + else + cerr << counter << " signatures verified in dataset, " + << corrupt_counter << " corrupted." << endl; +} +\endcode + +The following example shows how to sign a DICOM file: + +\code +DcmFileFormat fileformat; +if (fileformat.loadFile("test.dcm").good()) +{ + DcmDataset *dataset = fileformat.getDataset(); + SiCreatorProfile profile; // select the "RSA Creator Profile" + SiRIPEMD160 mac; // use RIPEMD160 as MAC algorithm + DcmSignature signer; // signature handler + SiCertificate cert; // our certificate + if (cert.loadCertificate("certificate.pem", X509_FILETYPE_PEM).bad()) + { + cerr << "unable to load certificate" << endl; + return; + } + SiPrivateKey key; // private key, must be unencrypted here + if (key.loadPrivateKey("privkey.pem", X509_FILETYPE_PEM).bad()) + { + cerr << "unable to load private key" << endl; + return; + } + signer.attach(dataset); // connect handler to data set + if (signer.createSignature(key, cert, mac, profile).good()) + { + fileformat.saveFile("test_signed.dcm"); // write back + } +} +\endcode + +*/ diff --git a/dcmsign/docs/dcmsign.man b/dcmsign/docs/dcmsign.man new file mode 100644 index 00000000..5acae9a7 --- /dev/null +++ b/dcmsign/docs/dcmsign.man @@ -0,0 +1,333 @@ +/*! + +\if MANPAGES +\page dcmsign Sign and Verify DICOM Files +\else +\page dcmsign dcmsign: Sign and Verify DICOM Files +\endif + +\section dcmsign_synopsis SYNOPSIS + +\verbatim +dcmsign [options] dcmfile-in [dcmfile-out] +\endverbatim + +\section dcmsign_description DESCRIPTION + +The \b dcmsign utility reads a DICOM file (\e dcmfile-in), performs a digital +signature operation and, if any modification has taken place, writes the DICOM +object to an output file (\e dcmfile-out). + +Five digital signature operations are supported: + +\li verification of all signatures in the DICOM file +\li creation of a new digital signature located in the main dataset, +\li creation of a new digital signature in an item of a sequence embedded + within the dataset, +\li removal of a single digital signature from the DICOM file, and +\li removal of all digital signatures from the DICOM file. + +\section dcmsign_parameters PARAMETERS + +\verbatim +dcmfile-in DICOM input filename to be processed + +dcmfile-out DICOM output filename +\endverbatim + +\section dcmsign_options OPTIONS + +\subsection dcmsign_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dcmsign_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dcmsign_signature_commands signature commands +\verbatim + --verify + verify all signatures (default) + + +s --sign [p]rivate key file, [c]ertificate file: string + create signature in main object + + +si --sign-item [k]eyfile, [c]ertfile, [i]tem location: string + create signature in sequence item + + +r --remove [s]ignature UID: string + remove signature + + +ra --remove-all + remove all signatures from data set +\endverbatim + +\subsection dcmsign_signature_creation_options signature creation options (only with --sign or --sign-item): +\verbatim +private key password: + + +ps --std-passwd + prompt user to type password on stdin (default) + + +pw --use-passwd [p]assword: string + use specified password + + -pw --null-passwd + use empty string as password + +key and certificate file format: + + -pem --pem-keys + read keys/certificates as PEM file (default) + + -der --der-keys + read keys/certificates as DER file + +digital signature profile: + + -pf --profile-none + don't enforce any signature profile (default) + + +pb --profile-base + enforce base RSA signature profile + + +pc --profile-creator + enforce creator RSA signature profile + + +pa --profile-auth + enforce authorization signature profile + +MAC algorithm: + + +mr --mac-ripemd160 + use RIPEMD 160 (default) + + +ms --mac-sha1 + use SHA-1 + + +mm --mac-md5 + use MD 5 + +tag selection: + + -t --tag + [t]ag: "gggg,eeee" or dictionary name + sign only specified tag + (this option can be specified multiple times) + + -tf --tag-file [f]ilename: string + read list of tags from text file + +signature format: + + -fn --format-new + use correct DICOM signature format (default) + + -fo --format-old + use old (pre-3.5.4) DCMTK signature format, non-conformant + if signature includes compressed pixel data +\endverbatim + +\subsection dcmsign_output_options output options +\verbatim +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +other output options: + + +d --dump [f]ilename: string + dump byte stream fed into the MAC codec to file + (only with --sign or --sign-item) +\endverbatim + +\section dcmsign_notes NOTES + +\subsection dcmsign_files_and_parameters Files and Parameters + +The \b dcmsign utility reads and writes a number of files and file formats +which are described in this section. + +Public Key Certificates are expected in X.509v3 format, either with PEM or DER +encoding. The dcmsign utility currently supports RSA and DSA public keys, +although only RSA keys are defines in the Security Profiles of the DICOM +standard. + +Private Keys are expected in PEM or DER encoding. PEM is recommended (and +default) because this allows one to keep private keys in encrypted form. Command +line options control the behavior of \b dcmsign when an encrypted PEM key is +opened (see above). In general it is not recommended to specify the encryption +password in the command line because the command line may be visible to other +processes in the system, e.g. "ps -ef". + +The list of data elements to sign can either be read from a file or specified +on the command line or both (in this case the keys are combined). + +On the command line, attribute keys are specified as + +\verbatim +--tag "gggg,eeee" where gggg and eeee are the hexadecimal group + and element numbers +--tag "Name" where 'Name' is a symbolic attribute name from + the DICOM dictionary (see below). +\endverbatim + +When attribute tags are read from file with the \e --tag-file option, a plain +text file of max. 64 kbyte is expected. Tags within the file are either +symbolic names from the data dictionary or have the format (gggg,eeee) (with +braces). Tags are separated by one or more whitespace characters. + +The \e --sign-item operation requires a location string that describes in which +sequence item a signature is to be created. The location string has the +following format: + +\verbatim +SequenceName[index].SequenceName[index].SequenceName[index](...) +\endverbatim + +where SequenceName is either a symbolic attribute name from the data dictionary +or a numeric tag in the format (gggg,eeee) and index is an unsigned decimal +integer for the item number, starting with zero for the first item in a +sequence. As an example, the following location string + +\verbatim +ReferencedSeriesSequence[0].ReferencedImageSequence[1] +\endverbatim + +would cause a digital signature to be created in the second item of the +ReferencedImageSequence (0008,1140) which is located in the first item of the +ReferencedSeriesSequence (0008,1115) which is located in the main DICOM +dataset. + +\section dcmsign_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dcmsign_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dcmsign_environment ENVIRONMENT + +The \b dcmsign utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dcmsign_copyright COPYRIGHT + +Copyright (C) 2000-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmsign/etc/Makefile.in b/dcmsign/etc/Makefile.in new file mode 100644 index 00000000..37b8f761 --- /dev/null +++ b/dcmsign/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmsign/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsign/include/CMakeLists.txt b/dcmsign/include/CMakeLists.txt new file mode 100644 index 00000000..c3146954 --- /dev/null +++ b/dcmsign/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmsign DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmsign/include/Makefile.in b/dcmsign/include/Makefile.in new file mode 100644 index 00000000..0632b329 --- /dev/null +++ b/dcmsign/include/Makefile.in @@ -0,0 +1,27 @@ +# +# Makefile for dcmsign/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/dcmsign + for file in dcmtk/dcmsign/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/dcmsign ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsign/include/dcmtk/dcmsign/dcsignat.h b/dcmsign/include/dcmtk/dcmsign/dcsignat.h new file mode 100644 index 00000000..9da04117 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/dcsignat.h @@ -0,0 +1,265 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DcmSignature + * + */ + +#ifndef DCMSIGN_H +#define DCMSIGN_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */ + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +class DcmItem; +class DcmStack; +class DcmSequenceOfItems; +class DcmAttributeTag; +class SiPrivateKey; +class SiCertificate; +class SiSecurityProfile; +class SiMAC; +class SiTimeStamp; + +/** this class provides the main interface to the dcmsign module - it allows + * to create, examine and verify digital signatures in DICOM datasets or + * items. The methods in this class do not handle digital signatures + * embedded in sequence items within the dataset, other than providing + * helper functions that allow to locate and attach the sub-items + * separately. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT DcmSignature +{ +public: + /** initializes the dcmsign library including the underlying OpenSSL library. + * this method should be called by main() before any object of the dcmsign + * library is created or used. + */ + static void initializeLibrary(); + + /// default constructor + DcmSignature(); + + /// destructor + virtual ~DcmSignature(); + + /** attaches a DICOM dataset or item to the signature object. + * The dataset is detached by a call to detach() or by destruction + * of the signature object. This object may modify but never deletes + * an attached dataset. + * @param dataset dataset or item to be attached + */ + void attach(DcmItem *dataset); + + /** detaches an attached DICOM dataset from the signature object. + */ + void detach(); + + /** creates a new digital signature in the current dataset. + * Checks whether private and public key match and whether + * all requirements of the given security profile are fulfilled. + * @param key private key for signature creation + * @param cert certificate with public key + * @param mac MAC algorithm to be used for signature creation + * @param profile security profile for signature creation + * @param xfer transfer syntax to use when serializing DICOM data + * @param tagList pointer to list of attribute tags to sign, may be NULL. + * If this parameter is nonzero, it contains a list of attribute sign. + * The real list of attributes signed is derived from this parameter plus the + * requirements of the security profile. If NULL, a universal match is assumed, + * i.e. all signable attributes in the data set are signed. + * @param timeStamp pointer to time stamp client used to create timestamps + * for the digital signature. + * @return status code + */ + OFCondition createSignature( + SiPrivateKey& key, + SiCertificate& cert, + SiMAC& mac, + SiSecurityProfile& profile, + E_TransferSyntax xfer=EXS_LittleEndianExplicit, + const DcmAttributeTag *tagList=NULL, + SiTimeStamp *timeStamp=NULL); + + /** returns the number of signatures in the dataset. Does not count + * signatures embedded in sequence items within the dataset. + */ + unsigned long numberOfSignatures(); + + /** removes a signature from the dataset. + * @param i index, must be < numberOfSignatures(). + * @return status code + */ + OFCondition removeSignature(unsigned long i); + + /** selects one of the digital signatures from the attached dataset for reading. + * @param i index, must be < numberOfSignatures() + * @return status code + */ + OFCondition selectSignature(unsigned long i); + + /** verifies the current signature. + * Current signature must be selected with selectSignature(). + * @return SI_EC_Normal if signature is complete and valid, an error code + * describing the type of verification failure otherwise. + */ + OFCondition verifyCurrent(); + + /** returns the MAC ID of the current signature. + * Current signature must be selected with selectSignature(). + * @param macID MAC ID returned in this parameter upon success + * @return status code + */ + OFCondition getCurrentMacID(Uint16& macID); + + /** returns the MAC Calculation Transfer Syntax of the current signature. + * If the transfer syntax is well-known, the UID is replaced by the + * transfer syntax name preceded by '='. + * Current signature must be selected with selectSignature(). + * @param str transfer syntax name or UID returned in this parameter upon success + * @return status code + */ + OFCondition getCurrentMacXferSyntaxName(OFString& str); + + /** returns the MAC Algorithm Name of the current signature. + * Current signature must be selected with selectSignature(). + * @param str MAC algorithm name returned in this parameter upon success + * @return status code + */ + OFCondition getCurrentMacName(OFString& str); + + /** returns the Digital Signature UID of the current signature. + * Current signature must be selected with selectSignature(). + * @param str signature UID returned in this parameter upon success + * @return status code + */ + OFCondition getCurrentSignatureUID(OFString& str); + + /** returns the Signature Date/Time of the current signature. + * Current signature must be selected with selectSignature(). + * @param str signature date/time returned in this parameter upon success + * @return status code + */ + OFCondition getCurrentSignatureDateTime(OFString& str); + + /** returns the Data Elements Signed attribute of the current signature if present. + * Current signature must be selected with selectSignature(). + * If a valid signature is selected but the signature does not contain + * the Data Elements Signed element (i.e. all attributes are signed), this method + * returns an error code. + * @param desig data elements signed returned in this parameter upon success + * @return status code + */ + OFCondition getCurrentDataElementsSigned(DcmAttributeTag& desig); + + /** returns the certificate of the current signature if present. + * Current signature must be selected with selectSignature(). + * May return NULL if certificate is unavailable. + * @return pointer to current certificate, NULL if unavailable. + */ + SiCertificate *getCurrentCertificate(); + + /** dump all data that is fed into the MAC algorithm into the given file, + * which must be opened and closed by caller. + * @param f pointer to file already opened for writing; may be NULL. + */ + void setDumpFile(FILE *f); + + /** recursively browses through the given dataset and searches the first + * occurence of the DigitalSignaturesSequence. If found, returns + * a pointer to the Item in which the sequence is contained. + * @param item dataset to be browsed + * @param stack search stack, must be passed to findNextSignatureItem() later on. + * @return pointer to Item containing a DigitalSignatureSequence if found, NULL otherwise. + */ + static DcmItem *findFirstSignatureItem(DcmItem& item, DcmStack& stack); + + /** recursively browses through the given dataset and searches the next + * occurence of the DigitalSignaturesSequence. If found, returns + * a pointer to the Item in which the sequence is contained. + * @param item dataset to be browsed + * @param stack search stack as returned by findFirstSignatureItem() or the last call to this method. + * @return pointer to Item containing a DigitalSignatureSequence if found, NULL otherwise. + */ + static DcmItem *findNextSignatureItem(DcmItem& item, DcmStack& stack); + +private: + + /// private undefined copy constructor + DcmSignature(DcmSignature& arg); + + /// private undefined copy assignment operator + DcmSignature& operator=(DcmSignature& arg); + + /// removes the selection of a current signature if present + void deselect(); + + /** allocates a new mac ID number for a new signature. + * examines all mac ID numbers in the digital signatures sequence + * and in the mac parameters sequence and returns an unused number. + * @param newID upon successful return, new number is passed in this parameter + * @return status code + */ + OFCondition allocateMACID(Uint16& newID); + + /** searches a given item for the DCM_MACIDnumber element and returns + * its value if present, otherwise returns 0. + * @param item item to be searched + * @return MAC ID number in item or zero if absent. + */ + static Uint16 getMACIDnumber(DcmItem &item); + + /** returns the current date and time as a DICOM DT string. + * @param str date/time returned in this string. + */ + static void currentDateTime(OFString &str); + + /// pointer to current item if attached, NULL otherwise + DcmItem *currentItem; + + /// pointer to mac parameters sequence of attached item, may be NULL if not attached or not yet present + DcmSequenceOfItems *macParametersSq; + + /// pointer to digital signatures sequence of attached item, may be NULL if not attached or not yet present + DcmSequenceOfItems *signatureSq; + + /// if nonzero, the data fed to the MAC algorithm is also stored in this file. + FILE *dumpFile; + + /// pointer to currently selected signature item + DcmItem *selectedSignatureItem; + + /// pointer to currently selected mac parameters item + DcmItem *selectedMacParametersItem; + + /// pointer to certificate for currently selected signature item + SiCertificate *selectedCertificate; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sialgo.h b/dcmsign/include/dcmtk/dcmsign/sialgo.h new file mode 100644 index 00000000..2b3d39ac --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sialgo.h @@ -0,0 +1,102 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiAlgorithm + * + */ + +#ifndef SIALGO_H +#define SIALGO_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/ofstd/oftypes.h" + +/** + * pure virtual base class of the public key crypto systems used for + * signature creation and verification. + * All public key algorithm classes should inherit from this class. + * Instances of derived classes contain a single private or public key. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiAlgorithm +{ +public: + + /// default constructor + SiAlgorithm() { } + + /// destructor + virtual ~SiAlgorithm() { } + + /** creates a signature. + * @param inputHash array of hash key bytes that are to be signed + * @param inputHashSize length of hash key array in bytes + * @param inputHashAlgorithm MAC algorithm used for creation of hash key. + * Required for creation of PKCS#1 RSA signature padding. + * @param outputSignature pointer to array of at least getSize() which must be allocated by caller. + * @param outputSignatureSize returns the number of bytes written to outputSignature. + * @return SI_EC_Normal if successful, errorcode otherwise. + */ + virtual OFCondition sign( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + unsigned char *outputSignature, + unsigned long &outputSignatureSize) = 0; + + /** verifies a signature. + * @param inputHash array of bytes containing hash key to be verified against signature + * @param inputHashSize length of hash key array in bytes + * @param inputHashAlgorithm MAC algorithm used for creation of hash key. + * Required for creation of PKCS#1 RSA signature padding. + * @param inputSignature array of bytes containing signature to be verified + * @param inputSignatureSize length of signature array in bytes + * @param verified returns whether the signature was successfully verified + * @return SI_EC_Normal if successful, errorcode otherwise. + */ + virtual OFCondition verify( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + const unsigned char *inputSignature, + unsigned long inputSignatureSize, + OFBool &verified) = 0; + + /** returns the size of a block of encrypted/decrypted ciphertext in bytes. + * The result depends on the public key algorithm, key size and padding scheme. + * In general the input to decrypt() or encrypt() must be less than or equal + * to this block size. The output of decrypt() or encrypt() is always equal + * to this block size. + * @return block size for this public key cryptosystem and key + */ + virtual unsigned long getSize() const = 0; + + /** returns the type of public key algorithm computed by this object + * @return type of public key algorithm + */ + virtual E_KeyType keyType() const = 0; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/siautopr.h b/dcmsign/include/dcmtk/dcmsign/siautopr.h new file mode 100644 index 00000000..9f37e834 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/siautopr.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiAuthorizationProfile + * + */ + +#ifndef SIAUTOPR_H +#define SIAUTOPR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sibrsapr.h" /* for SiBaseRSAProfile */ + +#ifdef WITH_OPENSSL + +/** Authorization Digital Signature Profile + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiAuthorizationProfile: public SiBaseRSAProfile +{ +public: + + /// default constructor + SiAuthorizationProfile() { } + + /// destructor + virtual ~SiAuthorizationProfile() { } + + /** checks whether an attribute with the given tag is required to be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if required, false otherwise. + */ + virtual OFBool attributeRequired(const DcmTagKey& key) const; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sibrsapr.h b/dcmsign/include/dcmtk/dcmsign/sibrsapr.h new file mode 100644 index 00000000..423e9b33 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sibrsapr.h @@ -0,0 +1,80 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiBaseRSAProfile + * + */ + +#ifndef SIBRSAPR_H +#define SIBRSAPR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sisprof.h" /* for SiSecurityProfile */ + +#ifdef WITH_OPENSSL + +/** Base RSA Digital Signature Profile + * @remark This class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiBaseRSAProfile: public SiSecurityProfile +{ +public: + + /// default constructor + SiBaseRSAProfile() { } + + /// destructor + virtual ~SiBaseRSAProfile() { } + + /** checks whether the given MAC type can be used with this security profile. + * @param macType MAC type to be checked + * @return true if MAC type is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableMACType(E_MACType macType) const; + + /** checks whether the given public/private key algorithm can be used with this security profile. + * @param keyType public key algorithm type to be checked + * @return true if public key algorithm is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableAlgorithmType(E_KeyType keyType) const; + + /** checks whether the given transfer syntax can be used with this security profile + * @param xfer transfer syntax to be checked + * @return true if transfer syntax is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableTransferSyntax(E_TransferSyntax xfer) const; + + /** checks whether an attribute with the given tag is required to be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if required, false otherwise. + */ + virtual OFBool attributeRequired(const DcmTagKey& key) const; + + /** checks whether an attribute with the given tag must not be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if attribute must not be signed, false otherwise. + */ + virtual OFBool attributeForbidden(const DcmTagKey& key) const; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sicert.h b/dcmsign/include/dcmtk/dcmsign/sicert.h new file mode 100644 index 00000000..c587f30b --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sicert.h @@ -0,0 +1,146 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen + * + * Purpose: + * classes: SiCertificate + * + */ + +#ifndef SICERT_H +#define SICERT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/ofstd/ofstring.h" /* for class OFString */ + +class DcmItem; +class SiAlgorithm; +struct x509_st; +typedef struct x509_st X509; + +/** a class representing X.509 public key certificates. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiCertificate +{ +public: + + /// default constructor + SiCertificate(); + + ///destructor + virtual ~SiCertificate(); + + /** loads an X.509 certificate from file. + * @param filename file name of X.509 certificate + * @param filetype file format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1 + * @return status code + */ + OFCondition loadCertificate(const char *filename, int filetype); + + /** reads an X.509 certificate from an item of the Digital Signatures Sequence + * and checks the certificate type information in the item. + * @param item item of the DigitalSignatureSQ from which the certificate is read + * @return status code + */ + OFCondition read(DcmItem& item); + + /** writes the current X.509 certificate into an item of the Digital Signatures Sequence + * and creates the certificate type information in the item. + * @param item item of the DigitalSignatureSQ to which the certificate is written + * @return dcmdata OFCondition status code + */ + OFCondition write(DcmItem& item); + + /** returns the type of public key stored in this certificate + */ + E_KeyType getKeyType(); + + /** creates an SiAlgorithm object for the public key contained in this certificate. + * If no certificate loaded or operation fails, returns NULL. + * New SiAlgorithm object must be deleted by caller. + * @return pointer to new SiAlgorithm object + */ + SiAlgorithm *createAlgorithmForPublicKey(); + + /** returns the format version of the X.509 certificate. + * If no certificate is loaded, returns 0. + * @return X.509 certificate version + */ + long getX509Version(); + + /** returns the subject name (distinguished name) of the current certificate. + * If no certificate is loaded, returns an empty string. + * @param str subject name returned in this string. + */ + void getCertSubjectName(OFString& str); + + /** returns the issuer name (distinguished name) of the current certificate. + * If no certificate is loaded, returns an empty string. + * @param str issuer name returned in this string. + */ + void getCertIssuerName(OFString& str); + + /** returns the serial number of the X.509 certificate. + * If no certificate is loaded, returns -1. + * @return X.509 certificate serial number + */ + long getCertSerialNo(); + + /** returns the start of validity of the current certificate in human readable form. + * If no certificate is loaded, returns an empty string. + * @param str start of validity returned in this string. + */ + void getCertValidityNotBefore(OFString& str); + + /** returns the end of validity of the current certificate in human readable form. + * If no certificate is loaded, returns an empty string. + * @param str end of validity returned in this string. + */ + void getCertValidityNotAfter(OFString& str); + + /** returns the strength (number of bits) of the public key contained + * in the current certificate. + * If no certificate is loaded, returns 0. + * @return key strength in bits. + */ + long getCertKeyBits(); + + /** returns a pointer to the raw certificate structure or NULL if no + * certificate present. Should not be called by users of this library. + */ + X509 *getRawCertificate(); + +private: + + /// private undefined copy constructor + SiCertificate(SiCertificate& arg); + + /// private undefined copy assignment operator + SiCertificate& operator=(SiCertificate& arg); + + /// OpenSSL X.509 structure + X509* x509; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sicertvf.h b/dcmsign/include/dcmtk/dcmsign/sicertvf.h new file mode 100644 index 00000000..3473ae23 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sicertvf.h @@ -0,0 +1,105 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiCertificateVerifier + * + */ + +#ifndef SICERTVF_H +#define SICERTVF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +class SiCertificate; +struct x509_store_st; +typedef struct x509_store_st X509_STORE; + +/** a class representing X.509 public key certificates. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiCertificateVerifier +{ +public: + + /// default constructor + SiCertificateVerifier(); + + ///destructor + virtual ~SiCertificateVerifier(); + + /** loads a certificate from a file and adds it to the pool of trusted certificates. + * @param fileName path to the certificate file + * @param filetype file format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1 + * @return SI_EC_Normal if successful, an error code otherwise + */ + OFCondition addTrustedCertificateFile(const char *fileName, int fileType); + + /** loads all files as certificates from the specified directory and adds them + * to the pool of trusted certificates. + * @param fileName path to the directory containing certificate files + * @param filetype file format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1 + * @return SI_EC_Normal if successful, an error code otherwise + */ + OFCondition addTrustedCertificateDir(const char *pathName, int fileType); + + /** loads a certificate revocation list (CRL) in X.509 format from a file and + * adds it to the pool of trusted certificates and CRLs. + * @param fileName path to the CRL file + * @param filetype file format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1 + * @return SI_EC_Normal if successful, an error code otherwise + */ + OFCondition addCertificateRevocationList(const char *fileName, int fileType); + + /** verifies a certificate against the known trusted CA certificates + * and certificate revocation lists. Returns a status flag and stores + * a detailed error description that can be retrieved with lastError(). + * @param certificate the certificate to verify + * @return SI_EC_Normal if successful, an error code otherwise. + * If the certificate could not be verified, returns SI_EC_VerificationFailed_NoTrust. + */ + OFCondition verifyCertificate(SiCertificate& certificate); + + /** returns an error string containing a textual description of the result + * of the last call to verifyCertificate() if that call returned + * SI_EC_VerificationFailed_NoTrust. + * @return text string + */ + const char *lastError() const; + +private: + + /// private undefined copy constructor + SiCertificateVerifier(SiCertificateVerifier& arg); + + /// private undefined copy assignment operator + SiCertificateVerifier& operator=(SiCertificateVerifier& arg); + + /// OpenSSL X.509 certificate store + X509_STORE* x509store; + + /// OpenSSL X.509 certificate verification error code for the last operation + long errorCode; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sicreapr.h b/dcmsign/include/dcmtk/dcmsign/sicreapr.h new file mode 100644 index 00000000..189b5585 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sicreapr.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiCreatorProfile + * + */ + +#ifndef SICREAPR_H +#define SICREAPR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sibrsapr.h" /* for SiBaseRSAProfile */ + +#ifdef WITH_OPENSSL + +/** Creator RSA Digital Signature Profile + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiCreatorProfile: public SiBaseRSAProfile +{ +public: + + /// default constructor + SiCreatorProfile() { } + + /// destructor + virtual ~SiCreatorProfile() { } + + /** checks whether an attribute with the given tag is required to be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if required, false otherwise. + */ + virtual OFBool attributeRequired(const DcmTagKey& key) const; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sidefine.h b/dcmsign/include/dcmtk/dcmsign/sidefine.h new file mode 100644 index 00000000..38d35b22 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sidefine.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (C) 2011, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmimgle + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef SIDEFINE_H +#define SIDEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmdsig_EXPORTS +#define DCMTK_DCMSIGN_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMSIGN_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sidsa.h b/dcmsign/include/dcmtk/dcmsign/sidsa.h new file mode 100644 index 00000000..02759347 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sidsa.h @@ -0,0 +1,115 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiDSA + * + */ + +#ifndef SIDSA_H +#define SIDSA_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sialgo.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/ofstd/oftypes.h" + +class SiPrivateKey; +struct dsa_st; +typedef struct dsa_st DSA; + +/** + * This class implements the DSA public key crypto algorithms. + * @remark This class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ + +class DCMTK_DCMSIGN_EXPORT SiDSA : public SiAlgorithm +{ +public: + + /** constructor + * @param pointer to public DSA key + */ + SiDSA(DSA *key); + + /// destructor + virtual ~SiDSA(); + + /** creates a signature. + * @param inputHash array of hash key bytes that are to be signed + * @param inputHashSize length of hash key array in bytes + * @param inputHashAlgorithm MAC algorithm used for creation of hash key. Ignored for DSA signatures. + * @param outputSignature pointer to array of at least getSize() which must be allocated by caller. + * @param outputSignatureSize returns the number of bytes written to outputSignature. + * @return SI_EC_Normal if successful, errorcode otherwise. + */ + virtual OFCondition sign( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + unsigned char *outputSignature, + unsigned long &outputSignatureSize); + + /** verifies a signature. + * @param inputHash array of bytes containing hash key to be verified against signature + * @param inputHashSize length of hash key array in bytes + * @param inputHashAlgorithm MAC algorithm used for creation of hash key. Ignored for DSA signatures. + * @param inputSignature array of bytes containing signature to be verified + * @param inputSignatureSize length of signature array in bytes + * @param verified returns whether the signature was successfully verified + * @return SI_EC_Normal if successful, errorcode otherwise. + */ + virtual OFCondition verify( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + const unsigned char *inputSignature, + unsigned long inputSignatureSize, + OFBool &verified); + + /** returns the size of a block of encrypted/decrypted ciphertext in bytes. + * The result depends on the public key algorithm, key size and padding scheme. + * In general the input to decrypt() or encrypt() must be less than or equal + * to this block size. The output of decrypt() or encrypt() is always equal + * to this block size. + * @return block size for this public key cryptosystem and key + */ + virtual unsigned long getSize() const; + + /** returns the type of public key algorithm computed by this object + * @return type of public key algorithm + */ + virtual E_KeyType keyType() const; + +private: + + /// private undefined copy constructor + SiDSA(SiDSA& arg); + + /// private undefined copy assignment operator + SiDSA& operator=(SiDSA& arg); + + /// DSA key used for signature/verification + DSA *dsa; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/simac.h b/dcmsign/include/dcmtk/dcmsign/simac.h new file mode 100644 index 00000000..4101404c --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/simac.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiMAC + * + */ + +#ifndef SIMAC_H +#define SIMAC_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +/** + * a base class for all classes that implement hash functions. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiMAC +{ +public: + + /// default constructor + SiMAC() { } + + /// destructor + virtual ~SiMAC() { } + + /** initializes the MAC algorithm. + * @return status code + */ + virtual OFCondition initialize() = 0; + + /** feeds data into the MAC algorithm + * @param data pointer to raw data to be fed into the MAC, must not be NULL + * @param length number of bytes in raw data array + * @return status code + */ + virtual OFCondition digest(const unsigned char *data, unsigned long length) = 0; + + /** finalizes the MAC and writes it to the given output array, + * which must be at least getSize() bytes large. + * After a call to finalize, the MAC algorithm must be initialized + * again, see initialize(). + * @param result pointer to array of getSize() bytes into which the MAC is written + * @return status code + */ + virtual OFCondition finalize(unsigned char *result) = 0; + + /** returns the size of a MAC in bytes. + * @return block size for this MAC algorithm + */ + virtual unsigned long getSize() const = 0; + + /** returns the type of MAC algorithm computed by this object + * @return type of MAC algorithm + */ + virtual E_MACType macType() const = 0; + + /** returns the DICOM identifier for this MAC algorithm + * @return DICOM defined term for algorithm + */ + virtual const char *getDefinedTerm() const = 0; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/simaccon.h b/dcmsign/include/dcmtk/dcmsign/simaccon.h new file mode 100644 index 00000000..035e3e51 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/simaccon.h @@ -0,0 +1,166 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiMACConstructor + * + */ + +#ifndef SIMACCON_H +#define SIMACCON_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmdata/dcostrmb.h" /* for DcmOutputBufferStream */ +#include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */ +#include "dcmtk/dcmdata/dcdeftag.h" + +#define INCLUDE_CSTDIO +#include "dcmtk/ofstd/ofstdinc.h" + +class SiMAC; +class DcmItem; +class DcmElement; +class DcmAttributeTag; + +/** a class that allows to feed selected parts of a DICOM dataset into the MAC generation code + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiMACConstructor +{ +public: + + /// constructor + SiMACConstructor(); + + /// destructor + virtual ~SiMACConstructor(); + + /** encodes a DICOM dataset (or parts of it) as a byte stream in the format + * required for DICOM digital signatures and feeds the byte stream into + * the given MAC codec. + * If a dump file was set with setDumpFile(), the byte stream is written + * to file as well. + * @param item the DICOM dataset to be encoded + * @param mac the MAC codec into which the resulting byte stream is fed + * @param oxfer the transfer syntax to be used when encoding the dataset. + * The caller might wish to use DcmItem::canWriteXfer() to check beforehand + * whether this transfer syntax can be used. + * @param tagListOut upon return this parameter contains the list of attribute + * tags which were fed into the MAC codec. For sequences, only the sequence + * attribute tag is contained in this list; the items and elements within the items + * are not encoded. + * @param tagListIn optional parameter restricting the parts of the dataset + * to be encoded. Only elements which are present in this list of tags, + * which are signable (see DcmTagKey::isSignable()) and are present in the dataset + * are encoded. Upon verification of a signature the caller might wish to compare + * tagListIn and tagListOut after successful return to see whether the lists of + * attributes are the same. + * If parameter is absent or NULL, a global match is assumed, i.e. all elements + * of the dataset which are present and signable are encoded. + * @return status code + */ + OFCondition encodeDataset( + DcmItem& item, + SiMAC& mac, + E_TransferSyntax oxfer, + DcmAttributeTag &tagListOut, + DcmAttributeTag *tagListIn = NULL); + + /** encodes the contents of the digital signature sequence + * except CertificateOfSigner, Signature, CertifiedTimestampType + * and CertifiedTimestamp as a byte stream in the format + * required for DICOM digital signatures and feeds the byte stream into + * the given MAC codec. + * If a dump file was set with setDumpFile(), the byte stream is written + * to file as well. + * @param signatureItem the DICOM digital signature item to be encoded + * @param mac the MAC codec into which the resulting byte stream is fed + * @param oxfer the transfer syntax to be used when encoding the dataset. + * The caller might wish to use DcmItem::canWriteXfer() to check beforehand + * whether this transfer syntax can be used. + * @return status code + */ + OFCondition encodeDigitalSignatureItem( + DcmItem& signatureItem, + SiMAC& mac, + E_TransferSyntax oxfer); + + /** flushes all buffers inside this object, finalizing the MAC code + * @param mac the MAC codec into which the resulting byte stream is fed + * @return status code + */ + OFCondition flush(SiMAC& mac); + + /** dump all data that is fed into the MAC algorithm into the given file, + * which must be opened and closed by caller. + * @param f pointer to file already opened for writing; may be NULL. + */ + void setDumpFile(FILE *f); + +private: + + /// private undefined copy constructor + SiMACConstructor(SiMACConstructor& arg); + + /// private undefined copy assignment operator + SiMACConstructor& operator=(SiMACConstructor& arg); + + /** flushes the internal buffer to the given MAC and to dumpFile if open + * @param mac MAC to which the buffer content is added + * @return error code from MAC + */ + OFCondition flushBuffer(SiMAC& mac); + + /** feeds a DcmElement into the MAC data stream if is signable. + * If the element is a sequence, all signable elements from all items are added. + * @param element pointer to element, must not be NULL + * @param mac MAC to use + * @param oxfer transfer syntax in which data is encoded + * @return status code + */ + OFCondition encodeElement(DcmElement *element, SiMAC& mac, E_TransferSyntax oxfer); + + /** checks whether the attribute tag of the given DcmElement is contained + * in the given list of tags. If the list is absent (NULL), a universal match + * is assumed, i.e. always returns true if element is nonzero. + * Does not check whether an element is signable. + * @param element pointer to element to check + * @param tagList pointer to list of attribute tags, may be NULL + * @return true if attribute is in tag list, false otherwise + */ + static OFBool inTagList(const DcmElement *element, DcmAttributeTag *tagList); + + /// the buffer to which data is written + unsigned char *buf; + + /// the internal buffer stream + DcmOutputBufferStream stream; + + /** if nonzero, the data fed to the MAC algorithm + * is also stored in this file. + */ + FILE *dumpFile; +}; + + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/simd5.h b/dcmsign/include/dcmtk/dcmsign/simd5.h new file mode 100644 index 00000000..06048e5d --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/simd5.h @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiMD5 + * + */ + +#ifndef SIMD5_H +#define SIMD5_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +struct MD5state_st; +typedef struct MD5state_st MD5_CTX; + +/** + * a class implementing the hash function MD5 + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiMD5 : public SiMAC +{ +public: + /// default constructor + SiMD5(); + + /// destructor + virtual ~SiMD5(); + + /** initializes the MAC algorithm. + * @return status code + */ + virtual OFCondition initialize(); + + /** feeds data into the MAC algorithm + * @param data pointer to raw data to be fed into the MAC, must not be NULL + * @param length number of bytes in raw data array + * @return status code + */ + virtual OFCondition digest(const unsigned char *data, unsigned long length); + + /** finalizes the MAC and writes it to the given output array, + * which must be at least getSize() bytes large. + * After a call to finalize, the MAC algorithm must be initialized + * again, see initialize(). + * @param result pointer to array of getSize() bytes into which the MAC is written + * @return status code + */ + virtual OFCondition finalize(unsigned char *result); + + /** returns the size of a MAC in bytes. + * @return block size for this MAC algorithm + */ + virtual unsigned long getSize() const; + + /** returns the type of MAC algorithm computed by this object + * @return type of MAC algorithm + */ + virtual E_MACType macType() const; + + /** returns the DICOM identifier for this MAC algorithm + * @return DICOM defined term for algorithm + */ + virtual const char *getDefinedTerm() const; + +private: + + /// private undefined copy constructor + SiMD5(SiMD5& arg); + + /// private undefined copy assignment operator + SiMD5& operator=(SiMD5& arg); + + /// OpenSSL MD5 context + MD5_CTX *ctx; +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sinullpr.h b/dcmsign/include/dcmtk/dcmsign/sinullpr.h new file mode 100644 index 00000000..6a711490 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sinullpr.h @@ -0,0 +1,82 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiNullProfile + * + */ + +#ifndef SINULLPR_H +#define SINULLPR_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sisprof.h" /* for SiSecurityProfile */ + +#ifdef WITH_OPENSSL + +/** defines a "null" security profile that does not require or forbid any + * MAC algorithm, signature algorithm, or attribute tag. This class can be + * used to clean up a proposed attribute list against a dataset. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiNullProfile: public SiSecurityProfile +{ +public: + + /// default constructor + SiNullProfile() { } + + /// destructor + virtual ~SiNullProfile() { } + + /** checks whether the given MAC type can be used with this security profile. + * @param macType MAC type to be checked + * @return true if MAC type is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableMACType(E_MACType macType) const; + + /** checks whether the given public/private key algorithm can be used with this security profile. + * @param keyType public key algorithm type to be checked + * @return true if public key algorithm is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableAlgorithmType(E_KeyType keyType) const; + + /** checks whether the given transfer syntax can be used with this security profile + * @param xfer transfer syntax to be checked + * @return true if transfer syntax is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableTransferSyntax(E_TransferSyntax xfer) const; + + /** checks whether an attribute with the given tag is required to be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if required, false otherwise. + */ + virtual OFBool attributeRequired(const DcmTagKey& key) const; + + /** checks whether an attribute with the given tag must not be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if attribute must not be signed, false otherwise. + */ + virtual OFBool attributeForbidden(const DcmTagKey& key) const; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/siprivat.h b/dcmsign/include/dcmtk/dcmsign/siprivat.h new file mode 100644 index 00000000..ad96a449 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/siprivat.h @@ -0,0 +1,116 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiPrivateKey + * + */ + +#ifndef SIPRIVAT_H +#define SIPRIVAT_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/ofstd/ofstring.h" + +class SiAlgorithm; +class SiCertificate; +struct evp_pkey_st; +typedef struct evp_pkey_st EVP_PKEY; + + +/** a class representing a private key. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiPrivateKey +{ +public: + /// default constructor + SiPrivateKey(); + + ///destructor + virtual ~SiPrivateKey(); + + /** sets the password string to be used when loading an + * encrypted private key file in PEM format (ASN.1/DER encoded files are never encrypted). + * Must be called prior to loadPrivateKey() in order to be effective. + * @param thePasswd password string, may be "" or NULL in which case an empty + * password is assumed. + */ + void setPrivateKeyPasswd(const char *thePasswd); + + /** sets the password string to be used when loading an + * encrypted private key file to be read from the console stdin. + */ + void setPrivateKeyPasswdFromConsole(); + + /** loads a private key from file. If the private key is in encrypted PEM + * format, the password is either read from console (default) or taken + * from an internal setting created with setPrivateKeyPasswd(). + * @param filename file name of key + * @param filetype file format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1 + * @return status code + */ + OFCondition loadPrivateKey(const char *filename, int filetype); + + /** returns the type of public key stored in this certificate + */ + E_KeyType getKeyType() const; + + /** creates an SiAlgorithm object for the private key contained in this certificate. + * If no key is loaded or operation fails, returns NULL. + * New SiAlgorithm object must be deleted by caller. + * @return pointer to new SiAlgorithm object + */ + SiAlgorithm *createAlgorithmForPrivateKey(); + + /** checks if the private key and the certificate set using setPrivateKeyFile() + * and setCertificateFile() match, i.e. if they establish a private/public key pair. + * @return OFTrue if private key and certificate match, OFFalse otherwise. + */ + OFBool matchesCertificate(SiCertificate& cert); + + /** provides access to the raw private key in OpenSSL format. Use with care! + * @return raw private key in OpenSSL format + */ + EVP_PKEY *getRawPrivateKey(); + +private: + + /// private undefined copy constructor + SiPrivateKey(SiPrivateKey& arg); + + /// private undefined copy assignment operator + SiPrivateKey& operator=(SiPrivateKey& arg); + + /// contains the password for the private key if set on command line + OFString privateKeyPasswd; + + /// true if the privateKeyPasswd contains the password, false otherwise. + OFBool usePrivateKeyPassword; + + /// the private key managed by this object, may be NULL if not loaded yet + EVP_PKEY* pkey; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/siripemd.h b/dcmsign/include/dcmtk/dcmsign/siripemd.h new file mode 100644 index 00000000..2cfadba4 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/siripemd.h @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiRIPEMD160 + * + */ + +#ifndef SIRIPEMD_H +#define SIRIPEMD_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +struct RIPEMD160state_st; +typedef struct RIPEMD160state_st RIPEMD160_CTX; + +/** + * a class implementing the hash function RIPEMD160 + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiRIPEMD160 : public SiMAC +{ +public: + /// default constructor + SiRIPEMD160(); + + /// destructor + virtual ~SiRIPEMD160(); + + /** initializes the MAC algorithm. + * @return status code + */ + virtual OFCondition initialize(); + + /** feeds data into the MAC algorithm + * @param data pointer to raw data to be fed into the MAC, must not be NULL + * @param length number of bytes in raw data array + * @return status code + */ + virtual OFCondition digest(const unsigned char *data, unsigned long length); + + /** finalizes the MAC and writes it to the given output array, + * which must be at least getSize() bytes large. + * After a call to finalize, the MAC algorithm must be initialized + * again, see initialize(). + * @param result pointer to array of getSize() bytes into which the MAC is written + * @return status code + */ + virtual OFCondition finalize(unsigned char *result); + + /** returns the size of a MAC in bytes. + * @return block size for this MAC algorithm + */ + virtual unsigned long getSize() const; + + /** returns the type of MAC algorithm computed by this object + * @return type of MAC algorithm + */ + virtual E_MACType macType() const; + + /** returns the DICOM identifier for this MAC algorithm + * @return DICOM defined term for algorithm + */ + virtual const char *getDefinedTerm() const; + +private: + + /// private undefined copy constructor + SiRIPEMD160(SiRIPEMD160& arg); + + /// private undefined copy assignment operator + SiRIPEMD160& operator=(SiRIPEMD160& arg); + + /// OpenSSL RIPEMD 160 context + RIPEMD160_CTX *ctx; +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sirsa.h b/dcmsign/include/dcmtk/dcmsign/sirsa.h new file mode 100644 index 00000000..d71a5c09 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sirsa.h @@ -0,0 +1,117 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiRSA + * + */ + +#ifndef SIRSA_H +#define SIRSA_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sialgo.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/ofstd/oftypes.h" + +class SiPrivateKey; +struct rsa_st; +typedef struct rsa_st RSA; + +/** + * This class implements the RSA public key crypto algorithms. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ + +class DCMTK_DCMSIGN_EXPORT SiRSA : public SiAlgorithm +{ +public: + + /** constructor + * @param pointer to public RSA key + */ + SiRSA(RSA *key); + + /// destructor + virtual ~SiRSA(); + + /** creates a signature. + * @param inputHash array of hash key bytes that are to be signed + * @param inputHashSize length of hash key array in bytes + * @param inputHashAlgorithm MAC algorithm used for creation of hash key. + * Required for creation of PKCS#1 RSA signature padding. + * @param outputSignature pointer to array of at least getSize() which must be allocated by caller. + * @param outputSignatureSize returns the number of bytes written to outputSignature. + * @return SI_EC_Normal if successful, errorcode otherwise. + */ + virtual OFCondition sign( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + unsigned char *outputSignature, + unsigned long &outputSignatureSize); + + /** verifies a signature. + * @param inputHash array of bytes containing hash key to be verified against signature + * @param inputHashSize length of hash key array in bytes + * @param inputHashAlgorithm MAC algorithm used for creation of hash key. + * Required for creation of PKCS#1 RSA signature padding. + * @param inputSignature array of bytes containing signature to be verified + * @param inputSignatureSize length of signature array in bytes + * @param verified returns whether the signature was successfully verified + * @return SI_EC_Normal if successful, errorcode otherwise. + */ + virtual OFCondition verify( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + const unsigned char *inputSignature, + unsigned long inputSignatureSize, + OFBool &verified); + + /** returns the size of a block of encrypted/decrypted ciphertext in bytes. + * The result depends on the public key algorithm, key size and padding scheme. + * In general the input to decrypt() or encrypt() must be less than or equal + * to this block size. The output of decrypt() or encrypt() is always equal + * to this block size. + * @return block size for this public key cryptosystem and key + */ + virtual unsigned long getSize() const; + + /** returns the type of public key algorithm computed by this object + * @return type of public key algorithm + */ + virtual E_KeyType keyType() const; + +private: + + /// private undefined copy constructor + SiRSA(SiRSA& arg); + + /// private undefined copy assignment operator + SiRSA& operator=(SiRSA& arg); + + /// RSA key used for signature/verification + RSA *rsa; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sisha1.h b/dcmsign/include/dcmtk/dcmsign/sisha1.h new file mode 100644 index 00000000..98b78a3d --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sisha1.h @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiSHA1 + * + */ + +#ifndef SISHA1_H +#define SISHA1_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +struct SHAstate_st; +typedef struct SHAstate_st SHA_CTX; + +/** + * a class implementing the hash function SHA1 + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiSHA1 : public SiMAC +{ +public: + /// default constructor + SiSHA1(); + + /// destructor + virtual ~SiSHA1(); + + /** initializes the MAC algorithm. + * @return status code + */ + virtual OFCondition initialize(); + + /** feeds data into the MAC algorithm + * @param data pointer to raw data to be fed into the MAC, must not be NULL + * @param length number of bytes in raw data array + * @return status code + */ + virtual OFCondition digest(const unsigned char *data, unsigned long length); + + /** finalizes the MAC and writes it to the given output array, + * which must be at least getSize() bytes large. + * After a call to finalize, the MAC algorithm must be initialized + * again, see initialize(). + * @param result pointer to array of getSize() bytes into which the MAC is written + * @return status code + */ + virtual OFCondition finalize(unsigned char *result); + + /** returns the size of a MAC in bytes. + * @return block size for this MAC algorithm + */ + virtual unsigned long getSize() const; + + /** returns the type of MAC algorithm computed by this object + * @return type of MAC algorithm + */ + virtual E_MACType macType() const; + + /** returns the DICOM identifier for this MAC algorithm + * @return DICOM defined term for algorithm + */ + virtual const char *getDefinedTerm() const; + +private: + + /// private undefined copy constructor + SiSHA1(SiSHA1& arg); + + /// private undefined copy assignment operator + SiSHA1& operator=(SiSHA1& arg); + + /// OpenSSL SHA1 context + SHA_CTX *ctx; +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sisha256.h b/dcmsign/include/dcmtk/dcmsign/sisha256.h new file mode 100644 index 00000000..a8915871 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sisha256.h @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 2016-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiSHA256 + * + */ + +#ifndef SISHA256_H +#define SISHA256_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +struct SHA256state_st; +typedef struct SHA256state_st SHA256_CTX; + +/** + * a class implementing the hash function SHA256 + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiSHA256 : public SiMAC +{ +public: + /// default constructor + SiSHA256(); + + /// destructor + virtual ~SiSHA256(); + + /** initializes the MAC algorithm. + * @return status code + */ + virtual OFCondition initialize(); + + /** feeds data into the MAC algorithm + * @param data pointer to raw data to be fed into the MAC, must not be NULL + * @param length number of bytes in raw data array + * @return status code + */ + virtual OFCondition digest(const unsigned char *data, unsigned long length); + + /** finalizes the MAC and writes it to the given output array, + * which must be at least getSize() bytes large. + * After a call to finalize, the MAC algorithm must be initialized + * again, see initialize(). + * @param result pointer to array of getSize() bytes into which the MAC is written + * @return status code + */ + virtual OFCondition finalize(unsigned char *result); + + /** returns the size of a MAC in bytes. + * @return block size for this MAC algorithm + */ + virtual unsigned long getSize() const; + + /** returns the type of MAC algorithm computed by this object + * @return type of MAC algorithm + */ + virtual E_MACType macType() const; + + /** returns the DICOM identifier for this MAC algorithm + * @return DICOM defined term for algorithm + */ + virtual const char *getDefinedTerm() const; + +private: + + /// private undefined copy constructor + SiSHA256(SiSHA256& arg); + + /// private undefined copy assignment operator + SiSHA256& operator=(SiSHA256& arg); + + /// OpenSSL SHA256 context + SHA256_CTX *ctx; +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sisha384.h b/dcmsign/include/dcmtk/dcmsign/sisha384.h new file mode 100644 index 00000000..fef7f8c3 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sisha384.h @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 2016-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiSHA384 + * + */ + +#ifndef SISHA384_H +#define SISHA384_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +struct SHA512state_st; +typedef struct SHA512state_st SHA512_CTX; + +/** + * a class implementing the hash function SHA384 + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiSHA384 : public SiMAC +{ +public: + /// default constructor + SiSHA384(); + + /// destructor + virtual ~SiSHA384(); + + /** initializes the MAC algorithm. + * @return status code + */ + virtual OFCondition initialize(); + + /** feeds data into the MAC algorithm + * @param data pointer to raw data to be fed into the MAC, must not be NULL + * @param length number of bytes in raw data array + * @return status code + */ + virtual OFCondition digest(const unsigned char *data, unsigned long length); + + /** finalizes the MAC and writes it to the given output array, + * which must be at least getSize() bytes large. + * After a call to finalize, the MAC algorithm must be initialized + * again, see initialize(). + * @param result pointer to array of getSize() bytes into which the MAC is written + * @return status code + */ + virtual OFCondition finalize(unsigned char *result); + + /** returns the size of a MAC in bytes. + * @return block size for this MAC algorithm + */ + virtual unsigned long getSize() const; + + /** returns the type of MAC algorithm computed by this object + * @return type of MAC algorithm + */ + virtual E_MACType macType() const; + + /** returns the DICOM identifier for this MAC algorithm + * @return DICOM defined term for algorithm + */ + virtual const char *getDefinedTerm() const; + +private: + + /// private undefined copy constructor + SiSHA384(SiSHA384& arg); + + /// private undefined copy assignment operator + SiSHA384& operator=(SiSHA384& arg); + + /// OpenSSL SHA384 context + SHA512_CTX *ctx; +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sisha512.h b/dcmsign/include/dcmtk/dcmsign/sisha512.h new file mode 100644 index 00000000..19b05e8e --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sisha512.h @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 2016-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiSHA512 + * + */ + +#ifndef SISHA512_H +#define SISHA512_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +struct SHA512state_st; +typedef struct SHA512state_st SHA512_CTX; + +/** + * a class implementing the hash function SHA512 + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiSHA512 : public SiMAC +{ +public: + /// default constructor + SiSHA512(); + + /// destructor + virtual ~SiSHA512(); + + /** initializes the MAC algorithm. + * @return status code + */ + virtual OFCondition initialize(); + + /** feeds data into the MAC algorithm + * @param data pointer to raw data to be fed into the MAC, must not be NULL + * @param length number of bytes in raw data array + * @return status code + */ + virtual OFCondition digest(const unsigned char *data, unsigned long length); + + /** finalizes the MAC and writes it to the given output array, + * which must be at least getSize() bytes large. + * After a call to finalize, the MAC algorithm must be initialized + * again, see initialize(). + * @param result pointer to array of getSize() bytes into which the MAC is written + * @return status code + */ + virtual OFCondition finalize(unsigned char *result); + + /** returns the size of a MAC in bytes. + * @return block size for this MAC algorithm + */ + virtual unsigned long getSize() const; + + /** returns the type of MAC algorithm computed by this object + * @return type of MAC algorithm + */ + virtual E_MACType macType() const; + + /** returns the DICOM identifier for this MAC algorithm + * @return DICOM defined term for algorithm + */ + virtual const char *getDefinedTerm() const; + +private: + + /// private undefined copy constructor + SiSHA512(SiSHA512& arg); + + /// private undefined copy assignment operator + SiSHA512& operator=(SiSHA512& arg); + + /// OpenSSL SHA512 context + SHA512_CTX *ctx; +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sisprof.h b/dcmsign/include/dcmtk/dcmsign/sisprof.h new file mode 100644 index 00000000..e81aad05 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sisprof.h @@ -0,0 +1,132 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiSecurityProfile + * + */ + +#ifndef SISPROF_H +#define SISPROF_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" /* for E_KeyType */ + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */ + +class SiAlgorithm; +class DcmItem; +class DcmAttributeTag; +class SiMAC; +class DcmTagKey; + +/** abstract base class for all security profiles. + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiSecurityProfile +{ +public: + + /// default constructor + SiSecurityProfile() { } + + /// destructor + virtual ~SiSecurityProfile() { } + + /** checks whether the given MAC type can be used with this security profile. + * @param macType MAC type to be checked + * @return true if MAC type is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableMACType(E_MACType macType) const = 0; + + /** checks whether the given MAC object can be used with this security profile. + * @param macType object to be checked + * @return true if object is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableMAC(const SiMAC& mac) const; + + /** checks whether the given public/private key algorithm can be used with this security profile. + * @param keyType public key algorithm type to be checked + * @return true if public key algorithm is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableAlgorithmType(E_KeyType keyType) const = 0; + + /** checks whether the given public/private key object can be used with this security profile. + * @param algo object to be checked + * @return true if object is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableAlgorithm(const SiAlgorithm& algo) const; + + /** checks whether the given transfer syntax can be used with this security profile + * @param xfer transfer syntax to be checked + * @return true if transfer syntax is allowable for this profile, false otherwise. + */ + virtual OFBool isAllowableTransferSyntax(E_TransferSyntax xfer) const = 0; + + /** checks whether an attribute with the given tag is required to be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if required, false otherwise. + */ + virtual OFBool attributeRequired(const DcmTagKey& key) const = 0; + + /** checks whether an attribute with the given tag must not be signed + * for the current security profile. + * @param key tag key to be checked + * @return true if attribute must not be signed, false otherwise. + */ + virtual OFBool attributeForbidden(const DcmTagKey& key) const = 0; + + /** updates the given list of attribute tags according to the + * requirements of the current security profile. For all elements present in the + * dataset, the attribute tag is inserted or removed from the list if required by the profile. + * @param item dataset to be handled + * @param tagList attribute tag list to be updated + * @return status code + */ + virtual OFCondition updateAttributeList(DcmItem &item, DcmAttributeTag& tagList); + + /** checks whether the given list of attribute tags fulfils the requirements + * of the current security profile for the given dataset. + * @param item dataset to be checked + * @param tagList attribute tag list. + * @return true if minimum requirements for profile are fulfilled, false otherwise. + */ + virtual OFBool checkAttributeList(DcmItem &item, DcmAttributeTag& tagList); + + /** checks if the given tag key is contained in the given list. + * @param tagList list of tag keys + * @param key tag key + * @return true if tag key is present in list, false otherwise. + */ + static OFBool containsTag(DcmAttributeTag& tagList, const DcmTagKey& key); + +private: + + /// private undefined copy constructor + SiSecurityProfile(SiSecurityProfile& arg); + + /// private undefined copy assignment operator + SiSecurityProfile& operator=(SiSecurityProfile& arg); + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sitstamp.h b/dcmsign/include/dcmtk/dcmsign/sitstamp.h new file mode 100644 index 00000000..de144dd4 --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sitstamp.h @@ -0,0 +1,68 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiTimeStamp + * + */ + +#ifndef SITSTAMP_H +#define SITSTAMP_H + +#include "dcmtk/config/osconfig.h" +#include "dcmtk/dcmsign/sitypes.h" + +#ifdef WITH_OPENSSL + +class DcmItem; + +/** pure virtual base class for a timestamp client. + * Instances of derived classes are able to request timestamps from a timestamp service. + * Timestamps are not supported (yet). + * @remark this class is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +class DCMTK_DCMSIGN_EXPORT SiTimeStamp +{ +public: + + /// default constructor + SiTimeStamp() { } + + /// destructor + virtual ~SiTimeStamp() { } + + /** takes a block of raw data and requests a time stamp for this raw data. + * @param inputData pointer to raw data + * @param inputDataSize length of raw data block in bytes + * @return status code + */ + virtual OFCondition stamp( + const unsigned char *inputData, + unsigned long inputDataSize) = 0; + + /** writes the current timestamp into an item of the Digital Signatures Sequence + * and creates the timestamp type information in the item. + * @param item item of the DigitalSignatureSQ to which the timestamp is written + * @return dcmdata OFCondition status code + */ + virtual OFCondition write(DcmItem& item) = 0; + +}; + +#endif +#endif diff --git a/dcmsign/include/dcmtk/dcmsign/sitypes.h b/dcmsign/include/dcmtk/dcmsign/sitypes.h new file mode 100644 index 00000000..bb99401d --- /dev/null +++ b/dcmsign/include/dcmtk/dcmsign/sitypes.h @@ -0,0 +1,192 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * consts, typedefs and enums for dcmsign + * + */ + +#ifndef SITYPES_H +#define SITYPES_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#ifdef WITH_OPENSSL + +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/oflog/oflog.h" +#include "dcmtk/dcmsign/sidefine.h" + +/* +** Logging +*/ + +extern DCMTK_DCMSIGN_EXPORT OFLogger DCM_dcmsignLogger; + +#define DCMSIGN_TRACE(msg) OFLOG_TRACE(DCM_dcmsignLogger, msg) +#define DCMSIGN_DEBUG(msg) OFLOG_DEBUG(DCM_dcmsignLogger, msg) +#define DCMSIGN_INFO(msg) OFLOG_INFO(DCM_dcmsignLogger, msg) +#define DCMSIGN_WARN(msg) OFLOG_WARN(DCM_dcmsignLogger, msg) +#define DCMSIGN_ERROR(msg) OFLOG_ERROR(DCM_dcmsignLogger, msg) +#define DCMSIGN_FATAL(msg) OFLOG_FATAL(DCM_dcmsignLogger, msg) + + +// DICOM defined terms for MAC algorithms, certificate and timestamp types +#define SI_DEFTERMS_RIPEMD160 "RIPEMD160" +#define SI_DEFTERMS_SHA1 "SHA1" +#define SI_DEFTERMS_MD5 "MD5" +#define SI_DEFTERMS_X509CERT "X509_1993_SIG" +#define SI_DEFTERMS_CMS_TS "CMS_TS" +#define SI_DEFTERMS_SHA256 "SHA256" +#define SI_DEFTERMS_SHA384 "SHA384" +#define SI_DEFTERMS_SHA512 "SHA512" + + +// include this file in doxygen documentation + +/** @file sitypes.h + * @brief type definitions and constants for the dcmsign module + */ + + +/** type of key for public key cryptosystem + * @remark this enum is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +enum E_KeyType +{ + /// RSA key + EKT_RSA, + + /// DSA key + EKT_DSA, + + /// DH key + EKT_DH, + + /// no key present + EKT_none +}; + + +/** type of MAC algorithm + * @remark this enum is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +enum E_MACType +{ + /// SHA-1 + EMT_SHA1, + + /// RIPEMD160 + EMT_RIPEMD160, + + /// MD5 + EMT_MD5, + + /// SHA-256 + EMT_SHA256, + + /// SHA-384 + EMT_SHA384, + + /// SHA-512 + EMT_SHA512 +}; + +/* + * specific error conditions for module dcmsign + */ + +/// object initialization failed +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_InitializationFailed; + +/// an OpenSSL call has failed +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_OpenSSLFailure; + +/// file cannot be read +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_CannotRead; + +/// unable to use the selected transfer syntax for MAC computation +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_WrongTransferSyntax; + +/// no more MAC ID numbers available +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_MacIDsExhausted; + +/// certificate and private key do not match +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_CertificateDoesNotMatchPrivateKey; + +/// MAC algorithm not allowed for the current security profile +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_MacDoesNotMatchProfile; + +/// Signature algorithm not allowed for the current security profile +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_AlgorithmDoesNotMatchProfile; + +/// Transfer syntax not allowed for the current security profile +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_TransferSyntaxDoesNotMatchProfile; + +/** signature verification failed because the certificate is missing + * or cannot be read (e.g. unsupported format) + * @remark this constant is only available if DCMTK is compiled with + * OpenSSL support enabled. + */ +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoCertificate; + +/// signature verification failed because the corresponding MAC parameters item could not be found or is incomplete +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoMAC; + +/// signature verification failed because the corresponding signature item is incomplete +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoSignature; + +/// signature verification failed because the MAC algorithm is not supported +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_UnsupportedMACAlgorithm; + +/// signature verification failed because the signature is invalid (document corrupted) +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_Corrupted; + +/// signature verification failed because the certificate was issued by an untrusted (unknown) CA +/// @remark this constant is only available if DCMTK is compiled with +/// OpenSSL support enabled. +extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoTrust; + +#endif +#endif diff --git a/dcmsign/libsrc/CMakeLists.txt b/dcmsign/libsrc/CMakeLists.txt new file mode 100644 index 00000000..d3812810 --- /dev/null +++ b/dcmsign/libsrc/CMakeLists.txt @@ -0,0 +1,5 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmdsig dcsignat siautopr sibrsapr sicert sicertvf sicreapr sidsa simaccon simd5 sinullpr siprivat siripemd sirsa sisha1 sisprof sitypes sisha256 sisha384 sisha512) + +DCMTK_TARGET_LINK_MODULES(dcmdsig ofstd dcmdata) +DCMTK_TARGET_LINK_LIBRARIES(dcmdsig ${OPENSSL_LIBS}) diff --git a/dcmsign/libsrc/Makefile.dep b/dcmsign/libsrc/Makefile.dep new file mode 100644 index 00000000..5e03274a --- /dev/null +++ b/dcmsign/libsrc/Makefile.dep @@ -0,0 +1,865 @@ +dcsignat.o: dcsignat.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/dcsignat.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../include/dcmtk/dcmsign/sialgo.h ../include/dcmtk/dcmsign/sicert.h \ + ../include/dcmtk/dcmsign/simac.h ../include/dcmtk/dcmsign/simaccon.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmb.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../include/dcmtk/dcmsign/simd5.h ../include/dcmtk/dcmsign/siprivat.h \ + ../include/dcmtk/dcmsign/siripemd.h ../include/dcmtk/dcmsign/sisha1.h \ + ../include/dcmtk/dcmsign/sisha256.h ../include/dcmtk/dcmsign/sisha384.h \ + ../include/dcmtk/dcmsign/sisha512.h ../include/dcmtk/dcmsign/sisprof.h \ + ../include/dcmtk/dcmsign/sitstamp.h +siautopr.o: siautopr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/siautopr.h ../include/dcmtk/dcmsign/sibrsapr.h \ + ../include/dcmtk/dcmsign/sisprof.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h +sibrsapr.o: sibrsapr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sibrsapr.h ../include/dcmtk/dcmsign/sisprof.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h +sicert.o: sicert.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sicert.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sirsa.h \ + ../include/dcmtk/dcmsign/sialgo.h ../include/dcmtk/dcmsign/sidsa.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +sicertvf.o: sicertvf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sicert.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sicertvf.h +sicreapr.o: sicreapr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sicreapr.h ../include/dcmtk/dcmsign/sibrsapr.h \ + ../include/dcmtk/dcmsign/sisprof.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h +sidsa.o: sidsa.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sidsa.h ../include/dcmtk/dcmsign/sialgo.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sicert.h \ + ../include/dcmtk/dcmsign/siprivat.h +simaccon.o: simaccon.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/simaccon.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrmb.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../include/dcmtk/dcmsign/simac.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcwcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h +simd5.o: simd5.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/simd5.h ../include/dcmtk/dcmsign/simac.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +sinullpr.o: sinullpr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sinullpr.h ../include/dcmtk/dcmsign/sisprof.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h +siprivat.o: siprivat.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/siprivat.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sirsa.h \ + ../include/dcmtk/dcmsign/sialgo.h ../include/dcmtk/dcmsign/sidsa.h \ + ../include/dcmtk/dcmsign/sicert.h +siripemd.o: siripemd.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/siripemd.h ../include/dcmtk/dcmsign/simac.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +sirsa.o: sirsa.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sirsa.h ../include/dcmtk/dcmsign/sialgo.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sicert.h \ + ../include/dcmtk/dcmsign/siprivat.h +sisha1.o: sisha1.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sisha1.h ../include/dcmtk/dcmsign/simac.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +sisha256.o: sisha256.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sisha256.h ../include/dcmtk/dcmsign/simac.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +sisha384.o: sisha384.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sisha384.h ../include/dcmtk/dcmsign/simac.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +sisha512.o: sisha512.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sisha512.h ../include/dcmtk/dcmsign/simac.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +sisprof.o: sisprof.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sisprof.h ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../include/dcmtk/dcmsign/simac.h ../include/dcmtk/dcmsign/sialgo.h +sitypes.o: sitypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsign/sitypes.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsign/sidefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h diff --git a/dcmsign/libsrc/Makefile.in b/dcmsign/libsrc/Makefile.in new file mode 100644 index 00000000..4576b165 --- /dev/null +++ b/dcmsign/libsrc/Makefile.in @@ -0,0 +1,51 @@ +# +# Makefile for dcmsign/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include +LOCALDEFS = + +objs = dcsignat.o sicert.o sidsa.o simd5.o siprivat.o sirsa.o sisprof.o \ + siautopr.o sicreapr.o simaccon.o sinullpr.o siripemd.o sisha1.o \ + sitypes.o sicertvf.o sibrsapr.o sisha256.o sisha384.o sisha512.o +library = libdcmdsig.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmsign/libsrc/dcsignat.cc b/dcmsign/libsrc/dcsignat.cc new file mode 100644 index 00000000..19393cf8 --- /dev/null +++ b/dcmsign/libsrc/dcsignat.cc @@ -0,0 +1,825 @@ +/* + * + * Copyright (C) 2000-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: DcmSignature + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/dcsignat.h" +#include "dcmtk/dcmdata/dcstack.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcvrus.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcsequen.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +#include "dcmtk/dcmsign/sialgo.h" +#include "dcmtk/dcmsign/sicert.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmsign/simaccon.h" +#include "dcmtk/dcmsign/simd5.h" +#include "dcmtk/dcmsign/siprivat.h" +#include "dcmtk/dcmsign/siripemd.h" +#include "dcmtk/dcmsign/sisha1.h" +#include "dcmtk/dcmsign/sisha256.h" +#include "dcmtk/dcmsign/sisha384.h" +#include "dcmtk/dcmsign/sisha512.h" +#include "dcmtk/dcmsign/sisprof.h" +#include "dcmtk/dcmsign/sitstamp.h" + +BEGIN_EXTERN_C +#include +#include +END_EXTERN_C + + +/* static helper methods */ + +void DcmSignature::initializeLibrary() +{ + OpenSSL_add_all_algorithms(); + ERR_load_crypto_strings(); +} + + +Uint16 DcmSignature::getMACIDnumber(DcmItem &item) +{ + Uint16 macIDnumber = 0; + DcmStack stack; + if (item.search(DCM_MACIDNumber, stack, ESM_fromHere, OFFalse).good() && (stack.top()->isLeaf())) + { + ((DcmElement *)(stack.top()))->getUint16(macIDnumber); + } + return macIDnumber; +} + + +void DcmSignature::currentDateTime(OFString &str) +{ + DcmDateTime::getCurrentDateTime(str, OFTrue /*seconds*/, OFTrue /*fraction*/, OFTrue /*timeZone*/); +} + + +/* DcmSignature non-static methods */ + + +DcmSignature::DcmSignature() +: currentItem(NULL) +, macParametersSq(NULL) +, signatureSq(NULL) +, dumpFile(NULL) +, selectedSignatureItem(NULL) +, selectedMacParametersItem(NULL) +, selectedCertificate(NULL) +{ +} + + +DcmSignature::~DcmSignature() +{ + deselect(); +} + + +void DcmSignature::deselect() +{ + selectedSignatureItem = NULL; + selectedMacParametersItem = NULL; + delete selectedCertificate; + selectedCertificate = NULL; +} + + +void DcmSignature::setDumpFile(FILE *f) +{ + dumpFile = f; +} + + +void DcmSignature::attach(DcmItem *dataset) +{ + deselect(); + currentItem = dataset; + DcmStack stack; + if (currentItem) + { + if ((currentItem->search(DCM_MACParametersSequence, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->ident() == EVR_SQ)) + { + macParametersSq = (DcmSequenceOfItems *)stack.top(); + } else macParametersSq = NULL; + stack.clear(); + if ((currentItem->search(DCM_DigitalSignaturesSequence, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->ident() == EVR_SQ)) + { + signatureSq = (DcmSequenceOfItems *)stack.top(); + } else signatureSq = NULL; + } else { + macParametersSq = NULL; + signatureSq = NULL; + } + return; +} + + +void DcmSignature::detach() +{ + deselect(); + currentItem = NULL; + macParametersSq = NULL; + signatureSq = NULL; +} + + +unsigned long DcmSignature::numberOfSignatures() +{ + if (signatureSq) return signatureSq->card(); else return 0; +} + + +OFCondition DcmSignature::removeSignature(unsigned long i) +{ + if (signatureSq == NULL) return EC_IllegalCall; + unsigned long seqCard = signatureSq->card(); + if (i >= seqCard) return EC_IllegalCall; + DcmItem *removalItem = signatureSq->getItem(i); + if (removalItem == NULL) return EC_IllegalCall; // should never happen + + // check mac ID number and whether it is unique + Uint16 macIDnumber = getMACIDnumber(*removalItem); + OFBool macIDunique = OFTrue; + DcmItem *tmpItem=NULL; + unsigned long j=0; + for (j=0; j < seqCard; ++j) + { + tmpItem = signatureSq->getItem(j); + if ((i != j) && tmpItem && (macIDnumber == getMACIDnumber(*tmpItem))) macIDunique = OFFalse; + } + + // delete signature item + delete signatureSq->remove(i); + + // delete MAC item if appropriate + if (macParametersSq && macIDunique) + { + j = 0; + while (j < macParametersSq->card()) + { + tmpItem = macParametersSq->getItem(j); + if (tmpItem && (macIDnumber == getMACIDnumber(*tmpItem))) delete macParametersSq->remove(j); else ++j; + } + } + + if (signatureSq->card() == 0) + { + delete currentItem->remove(signatureSq); + signatureSq = NULL; + } + + if (macParametersSq && macParametersSq->card() == 0) + { + delete currentItem->remove(macParametersSq); + macParametersSq = NULL; + } + + return EC_Normal; +} + + +OFCondition DcmSignature::allocateMACID(Uint16& newID) +{ + newID = 0xffff; + if (currentItem == NULL) return EC_IllegalCall; + if ((signatureSq==NULL)&&(macParametersSq == NULL)) + { + newID = 0; // no signature yet, can use 0. + return EC_Normal; + } + + unsigned long i; + DcmItem *tmpItem = NULL; + char *isAllocated = new char[65536]; + if (isAllocated==NULL) return EC_MemoryExhausted; + + OFCondition result = SI_EC_MacIDsExhausted; + + for (i=0; i < 65536; ++i) isAllocated[i]=0; + if (signatureSq) + { + unsigned long sqCard = signatureSq->card(); + for (i=0; i < sqCard; ++i) + { + tmpItem = signatureSq->getItem(i); + if (tmpItem) isAllocated[getMACIDnumber(*tmpItem)] = 1; + } + } + if (macParametersSq) + { + unsigned long macCard = macParametersSq->card(); + for (i=0; i < macCard; ++i) + { + tmpItem = macParametersSq->getItem(i); + if (tmpItem) isAllocated[getMACIDnumber(*tmpItem)] = 1; + } + } + i = 0; + while (i<65536) + { + if (!isAllocated[i]) + { + newID = (Uint16)i; + i = 65536; + result = EC_Normal; + } else ++i; + } + delete[] isAllocated; + return result; +} + + +OFCondition DcmSignature::createSignature( + SiPrivateKey& key, + SiCertificate& cert, + SiMAC& mac, + SiSecurityProfile& profile, + E_TransferSyntax xfer, + const DcmAttributeTag *tagList, + SiTimeStamp *timeStamp) +{ + // do some checks first + if (currentItem == NULL) return EC_IllegalCall; + if (! key.matchesCertificate(cert)) return SI_EC_CertificateDoesNotMatchPrivateKey; + if (! profile.isAllowableMAC(mac)) return SI_EC_MacDoesNotMatchProfile; + if (! profile.isAllowableAlgorithmType(key.getKeyType())) return SI_EC_AlgorithmDoesNotMatchProfile; + if (! profile.isAllowableTransferSyntax(xfer)) return SI_EC_TransferSyntaxDoesNotMatchProfile; + + OFCondition result = EC_Normal; + + // update tag list if present + DcmAttributeTag *updatedTagList = NULL; + if (tagList) + { + updatedTagList = new DcmAttributeTag(*tagList); + if (updatedTagList == NULL) result = EC_MemoryExhausted; + else result = profile.updateAttributeList(*currentItem, *updatedTagList); + } + + // make sure we have a MAC parameter sequence + if ((result.good()) && (macParametersSq == NULL)) + { + macParametersSq = new DcmSequenceOfItems(DCM_MACParametersSequence); + if (macParametersSq == NULL) result = EC_MemoryExhausted; + else + { + result = currentItem->insert(macParametersSq, OFTrue); + } + } + + // make sure we have a digital signature sequence + if ((result.good()) && (signatureSq == NULL)) + { + signatureSq = new DcmSequenceOfItems(DCM_DigitalSignaturesSequence); + if (signatureSq == NULL) result = EC_MemoryExhausted; + else + { + result = currentItem->insert(signatureSq, OFTrue); + } + } + + // allocate MAC ID + Uint16 macID = 0; + if (result.good()) result = allocateMACID(macID); + + // create initial part of digital signature sequence item + // which has to be included into the MAC calculation + DcmItem *seqItem = NULL; + if (result.good()) + { + seqItem = new DcmItem(); + if (seqItem) + { + // MAC ID Number + if (result.good()) + { + DcmUnsignedShort *elemMacID = new DcmUnsignedShort(DCM_MACIDNumber); + if (elemMacID) + { + result = elemMacID->putUint16(macID); + if (result.good()) result = seqItem->insert(elemMacID, OFTrue); + if (result.bad()) + { + delete elemMacID; + } + } else result = EC_MemoryExhausted; + } + + // Digital Signature UID + if (result.good()) + { + char newUID[66]; + dcmGenerateUniqueIdentifier(newUID); + DcmUniqueIdentifier *elemSigUID = new DcmUniqueIdentifier(DCM_DigitalSignatureUID); + if (elemSigUID) + { + result = elemSigUID->putString(newUID); + if (result.good()) result = seqItem->insert(elemSigUID, OFTrue); + if (result.bad()) + { + delete elemSigUID; + } + } else result = EC_MemoryExhausted; + } + + // Digital Signature Date/Time + if (result.good()) + { + OFString aString; + currentDateTime(aString); + DcmDateTime *elemDT = new DcmDateTime(DCM_DigitalSignatureDateTime); + if (elemDT) + { + result = elemDT->putOFStringArray(aString); + if (result.good()) result = seqItem->insert(elemDT, OFTrue); + if (result.bad()) + { + delete elemDT; + } + } else result = EC_MemoryExhausted; + } + + // Certificate of Signer and Certificate Type + if (result.good()) + { + result = cert.write(*seqItem); + } + + } else result = EC_MemoryExhausted; + } + + // now create MAC of DICOM object + SiAlgorithm *algorithm = NULL; + SiMACConstructor constructor; + if (dumpFile) constructor.setDumpFile(dumpFile); + DcmAttributeTag *tagListOut = new DcmAttributeTag(DCM_DataElementsSigned); + if (tagListOut == NULL) result = EC_MemoryExhausted; + unsigned long sigLength = 0; + unsigned char *signature = NULL; + + if (result.good()) + { + algorithm = key.createAlgorithmForPrivateKey(); + if (algorithm) + { + mac.initialize(); + sigLength = algorithm->getSize(); + signature = new unsigned char[sigLength]; + if (signature == NULL) result = EC_MemoryExhausted; + else + { + // encode main dataset + result = constructor.encodeDataset(*currentItem, mac, xfer, *tagListOut, updatedTagList); + // encode required attributes from the digital signatures sequence + if (result.good()) result = constructor.encodeDigitalSignatureItem(*seqItem, mac, xfer); + // flush stream constructor + if (result.good()) result = constructor.flush(mac); + } + } else result = EC_MemoryExhausted; + } + + // sign MAC + if (result.good()) + { + unsigned long digestLength = mac.getSize(); + unsigned char *digest = new unsigned char[digestLength]; + if (digest == NULL) result = EC_MemoryExhausted; + else + { + result = mac.finalize(digest); + if (result.good()) result = algorithm->sign(digest, digestLength, mac.macType(), signature, sigLength); + delete[] digest; + } + } + + // complete and write digital signature sequence item + if (result.good()) + { + if (seqItem) + { + + // Signature + if (result.good()) + { + DcmOtherByteOtherWord *elemSig = new DcmOtherByteOtherWord(DCM_Signature); + if (elemSig) + { + elemSig->setVR(EVR_OB); + result = elemSig->putUint8Array((Uint8 *) signature, sigLength); + if (result.good()) result = seqItem->insert(elemSig, OFTrue); + if (result.bad()) + { + delete elemSig; + } + } else result = EC_MemoryExhausted; + } + + // Timestamp and Timestamp Type + if (result.good()) + { + if (timeStamp) + { + // this would be the right time to request the time stamp + result = timeStamp->stamp(signature, sigLength); + if (result.good()) + { + result = timeStamp->write(*seqItem); + } + } + } + + if (result.good()) + { + result = signatureSq->append(seqItem); + if (result.bad()) + { + delete seqItem; + } + } + } else result = EC_MemoryExhausted; + } + + // write MAC parameters sequence item + if (result.good()) + { + DcmItem *macItem = new DcmItem(); + if (macItem) + { + // MAC ID Number + if (result.good()) + { + DcmUnsignedShort *elemMacID = new DcmUnsignedShort(DCM_MACIDNumber); + if (elemMacID) + { + result = elemMacID->putUint16(macID); + if (result.good()) result = macItem->insert(elemMacID, OFTrue); + if (result.bad()) + { + delete elemMacID; + } + } else result = EC_MemoryExhausted; + } + + // MAC Calculation Transfer Syntax UID + if (result.good()) + { + DcmUniqueIdentifier *elemXferUID = new DcmUniqueIdentifier(DCM_MACCalculationTransferSyntaxUID); + if (elemXferUID) + { + DcmXfer xid(xfer); + result = elemXferUID->putString(xid.getXferID()); + if (result.good()) result = macItem->insert(elemXferUID, OFTrue); + if (result.bad()) + { + delete elemXferUID; + } + } else result = EC_MemoryExhausted; + } + + // MAC Algorithm Identifier + if (result.good()) + { + DcmCodeString *elemMacAlgo = new DcmCodeString(DCM_MACAlgorithm); + if (elemMacAlgo) + { + result = elemMacAlgo->putString(mac.getDefinedTerm()); + if (result.good()) result = macItem->insert(elemMacAlgo, OFTrue); + if (result.bad()) + { + delete elemMacAlgo; + } + } else result = EC_MemoryExhausted; + } + + // Data Elements Signed + if (result.good()) + { + result = macItem->insert(tagListOut, OFTrue); + if (result.good()) + { + tagListOut = NULL; // make sure we don't delete tagListOut later + } + } + + if (result.good()) + { + result = macParametersSq->append(macItem); + if (result.bad()) + { + delete macItem; + } + } + } else result = EC_MemoryExhausted; + } + + delete[] signature; + delete tagListOut; + delete updatedTagList; + delete algorithm; + return result; +} + + +OFCondition DcmSignature::selectSignature(unsigned long i) +{ + deselect(); + if ((signatureSq == NULL) || (i >= signatureSq->card())) return EC_IllegalCall; + + selectedSignatureItem = signatureSq->getItem(i); + if (selectedSignatureItem == NULL) return EC_IllegalCall; + Uint16 macID = getMACIDnumber(*selectedSignatureItem); + if (macParametersSq) + { + DcmItem *tmpItem=NULL; + unsigned long cardMac = macParametersSq->card(); + for (unsigned long j=0; jgetItem(j); + if (macID == getMACIDnumber(*tmpItem)) + { + selectedMacParametersItem = tmpItem; + break; + } + } + } + selectedCertificate = new SiCertificate(); + if (selectedCertificate == NULL) return EC_MemoryExhausted; + selectedCertificate->read(*selectedSignatureItem); + return EC_Normal; +} + +OFCondition DcmSignature::verifyCurrent() +{ + if (NULL == selectedSignatureItem) return EC_IllegalCall; + if (selectedMacParametersItem == NULL) return SI_EC_VerificationFailed_NoMAC; + if ((selectedCertificate == NULL)||(selectedCertificate->getKeyType() == EKT_none)) return SI_EC_VerificationFailed_NoCertificate; + + OFCondition result = EC_Normal; + DcmAttributeTag *tagList = NULL; + SiMAC *mac = NULL; + E_TransferSyntax xfer = EXS_Unknown; + DcmStack stack; + DcmOtherByteOtherWord *signature = NULL; + + // read MAC Calculation Transfer Syntax UID + if (result.good()) + { + if ((selectedMacParametersItem->search(DCM_MACCalculationTransferSyntaxUID, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf())) + { + char *uid = NULL; + if ((((DcmElement *)(stack.top()))->getString(uid)).good()) + { + DcmXfer xf(uid); + xfer = xf.getXfer(); + if (xfer == EXS_Unknown) result = SI_EC_WrongTransferSyntax; + } else result = SI_EC_VerificationFailed_NoMAC; + } else result = SI_EC_VerificationFailed_NoMAC; + } + + // read MAC Algorithm + if (result.good()) + { + stack.clear(); + if ((selectedMacParametersItem->search(DCM_MACAlgorithm, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf())) + { + OFString macidentifier; + if ((((DcmElement *)(stack.top()))->getOFString(macidentifier, 0)).good()) + { + if (macidentifier == SI_DEFTERMS_RIPEMD160) mac = new SiRIPEMD160(); + else if (macidentifier == SI_DEFTERMS_SHA1) mac = new SiSHA1(); + else if (macidentifier == SI_DEFTERMS_MD5) mac = new SiMD5(); + else if (macidentifier == SI_DEFTERMS_SHA256) mac = new SiSHA256(); + else if (macidentifier == SI_DEFTERMS_SHA384) mac = new SiSHA384(); + else if (macidentifier == SI_DEFTERMS_SHA512) mac = new SiSHA512(); + if (mac == NULL) result = SI_EC_VerificationFailed_UnsupportedMACAlgorithm; + } else result = SI_EC_VerificationFailed_NoMAC; + } else result = SI_EC_VerificationFailed_NoMAC; + } + + // read Data Elements Signed + if (result.good()) + { + stack.clear(); + if ((selectedMacParametersItem->search(DCM_DataElementsSigned, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->ident() == EVR_AT)) + { + tagList = new DcmAttributeTag(*((DcmAttributeTag *)(stack.top()))); + if (tagList == NULL) result = EC_MemoryExhausted; + } + } + + // read Signature + if (result.good()) + { + stack.clear(); + if ((selectedSignatureItem->search(DCM_Signature, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf())) + { + signature = new DcmOtherByteOtherWord(*((DcmOtherByteOtherWord *)(stack.top()))); + if (signature == NULL) result = EC_MemoryExhausted; + } else result = SI_EC_VerificationFailed_NoSignature; + } + + // create MAC + if (result.good()) + { + DcmAttributeTag tagListOut(DCM_DataElementsSigned); + SiMACConstructor constructor; + if (dumpFile) constructor.setDumpFile(dumpFile); + + // encode main dataset + result = constructor.encodeDataset(*currentItem, *mac, xfer, tagListOut, tagList); + + // encode required attributes from the digital signatures sequence + if (result.good()) result = constructor.encodeDigitalSignatureItem(*selectedSignatureItem, *mac, xfer); + + // flush stream constructor + if (result.good()) result = constructor.flush(*mac); + } + + // finally verify signature + if (result.good()) + { + SiAlgorithm *algorithm = selectedCertificate->createAlgorithmForPublicKey(); + if (algorithm) + { + OFBool verified = OFTrue; + Uint32 sigLength = signature->getLength(); + Uint8 *sigData = NULL; + if ((signature->getUint8Array(sigData)).bad() || (sigData == NULL)) result = SI_EC_VerificationFailed_NoSignature; + else + { + unsigned long digestLength = mac->getSize(); + unsigned char *digest = new unsigned char[digestLength]; + if (digest == NULL) result = EC_MemoryExhausted; + else + { + result = mac->finalize(digest); + if (result.good()) + { + result = algorithm->verify(digest, digestLength, mac->macType(), sigData, sigLength, verified); + if ((result.good()) && (! verified)) result = SI_EC_VerificationFailed_Corrupted; + } + delete[] digest; + } + } + delete algorithm; + } else result = SI_EC_VerificationFailed_NoCertificate; + } + + delete signature; + delete tagList; + delete mac; + return result; +} + + +DcmItem *DcmSignature::findFirstSignatureItem(DcmItem& item, DcmStack& stack) +{ + stack.clear(); + stack.push(&item); + return findNextSignatureItem(item, stack); +} + +DcmItem *DcmSignature::findNextSignatureItem(DcmItem& item, DcmStack& stack) +{ + if (item.search(DCM_DigitalSignaturesSequence, stack, ESM_afterStackTop, OFTrue).good()) + { + DcmObject *nextItem = stack.elem(1); + if (nextItem && ((nextItem->ident() == EVR_item) || (nextItem->ident() == EVR_dataset))) return (DcmItem *)nextItem; + } + return NULL; +} + +OFCondition DcmSignature::getCurrentMacID(Uint16& macID) +{ + if (NULL == selectedSignatureItem) return EC_IllegalCall; + macID = getMACIDnumber(*selectedSignatureItem); + return EC_Normal; +} + +OFCondition DcmSignature::getCurrentMacXferSyntaxName(OFString& str) +{ + str.clear(); + if ((NULL == selectedSignatureItem)||(NULL == selectedMacParametersItem)) return EC_IllegalCall; + OFCondition result = EC_Normal; + DcmStack stack; + + // read MAC Calculation Transfer Syntax UID + if ((selectedMacParametersItem->search(DCM_MACCalculationTransferSyntaxUID, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf())) + { + char *uid = NULL; + if ((((DcmElement *)(stack.top()))->getString(uid)).good()) + { + DcmXfer xf(uid); + if (xf.getXfer() == EXS_Unknown) str=uid; else + { + str = "="; + str.append(xf.getXferName()); + } + } else result = SI_EC_VerificationFailed_NoMAC; + } else result = SI_EC_VerificationFailed_NoMAC; + return result; +} + +OFCondition DcmSignature::getCurrentMacName(OFString& str) +{ + str.clear(); + if ((NULL == selectedSignatureItem)||(NULL == selectedMacParametersItem)) return EC_IllegalCall; + OFCondition result = SI_EC_VerificationFailed_NoMAC; + DcmStack stack; + + // read MAC Algorithm + if ((selectedMacParametersItem->search(DCM_MACAlgorithm, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf())) + { + if ((((DcmElement *)(stack.top()))->getOFString(str, 0)).good()) result = EC_Normal; + } + return result; +} + +OFCondition DcmSignature::getCurrentSignatureUID(OFString& str) +{ + str.clear(); + if (NULL == selectedSignatureItem) return EC_IllegalCall; + OFCondition result = SI_EC_VerificationFailed_NoSignature; + DcmStack stack; + + // read signature UID + if ((selectedSignatureItem->search(DCM_DigitalSignatureUID, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf())) + { + if ((((DcmElement *)(stack.top()))->getOFString(str, 0)).good()) result = EC_Normal; + } + return result; +} + +OFCondition DcmSignature::getCurrentSignatureDateTime(OFString& str) +{ + str.clear(); + if (NULL == selectedSignatureItem) return EC_IllegalCall; + OFCondition result = SI_EC_VerificationFailed_NoSignature; + DcmStack stack; + + // read signature date/time + if ((selectedSignatureItem->search(DCM_DigitalSignatureDateTime, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf())) + { + if ((((DcmElement *)(stack.top()))->getOFString(str, 0)).good()) result = EC_Normal; + } + return result; +} + +SiCertificate *DcmSignature::getCurrentCertificate() +{ + return selectedCertificate; +} + +OFCondition DcmSignature::getCurrentDataElementsSigned(DcmAttributeTag& desig) +{ + desig.clear(); + if ((NULL == selectedSignatureItem)||(NULL == selectedMacParametersItem)) return EC_IllegalCall; + OFCondition result = SI_EC_VerificationFailed_NoMAC; + DcmStack stack; + + // read Data Elements Signed + if ((selectedMacParametersItem->search(DCM_DataElementsSigned, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->ident() == EVR_AT)) + { + desig = *((DcmAttributeTag *)(stack.top())); + result = EC_Normal; + } + return result; +} + +#else /* WITH_OPENSSL */ + +#include "dcmtk/dcmsign/sidefine.h" + +DCMTK_DCMSIGN_EXPORT int dcmsign_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/siautopr.cc b/dcmsign/libsrc/siautopr.cc new file mode 100644 index 00000000..e5ec78f1 --- /dev/null +++ b/dcmsign/libsrc/siautopr.cc @@ -0,0 +1,79 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiAuthorizationProfile + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/siautopr.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +OFBool SiAuthorizationProfile::attributeRequired(const DcmTagKey& key) const +{ + /* SOP Class and Instance UIDs */ + if (key == DCM_SOPClassUID) return OFTrue; + if (key == DCM_SOPInstanceUID) return OFTrue; + + /* Study and Series Instance UIDs */ + if (key == DCM_StudyInstanceUID) return OFTrue; + if (key == DCM_SeriesInstanceUID) return OFTrue; + + /* Any overlay data present */ + if ((key.getGroup() >= 0x6000) && (key.getGroup() < 0x6020) && ((key.getGroup() & 0x0001) == 0)) return OFTrue; + + /* Any image data present - we assume this means the Image Pixel Module and not just PixelData */ + if (key.getGroup() == 0x0028) + { + Uint16 elem = key.getElement(); + if (elem == 0x0002) return OFTrue; // DCM_SamplesPerPixel + if (elem == 0x0004) return OFTrue; // DCM_PhotometricInterpretation + if (elem == 0x0006) return OFTrue; // DCM_PlanarConfiguration + if (elem == 0x0010) return OFTrue; // DCM_Rows + if (elem == 0x0011) return OFTrue; // DCM_Columns + if (elem == 0x0034) return OFTrue; // DCM_PixelAspectRatio + if (elem == 0x0100) return OFTrue; // DCM_BitsAllocated + if (elem == 0x0101) return OFTrue; // DCM_BitsStored + if (elem == 0x0102) return OFTrue; // DCM_HighBit + if (elem == 0x0103) return OFTrue; // DCM_PixelRepresentation + if (elem == 0x0106) return OFTrue; // DCM_SmallestImagePixelValue + if (elem == 0x0107) return OFTrue; // DCM_LargestImagePixelValue + if (elem == 0x1101) return OFTrue; // DCM_RedPaletteColorLookupTableDescriptor + if (elem == 0x1102) return OFTrue; // DCM_GreenPaletteColorLookupTableDescriptor + if (elem == 0x1103) return OFTrue; // DCM_BluePaletteColorLookupTableDescriptor + if (elem == 0x1201) return OFTrue; // DCM_RedPaletteColorLookupTableData + if (elem == 0x1202) return OFTrue; // DCM_GreenPaletteColorLookupTableData + if (elem == 0x1203) return OFTrue; // DCM_BluePaletteColorLookupTableData + } + if (key == DCM_PixelData) return OFTrue; + + /* Any attributes whose values are verifiable by the technician or physician + * (e.g., their values are displayed to the technician or physician) + * This is obviously application dependent. We don't handle that here. + */ + return OFFalse; +} + +#else /* WITH_OPENSSL */ + +int siautopr_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sibrsapr.cc b/dcmsign/libsrc/sibrsapr.cc new file mode 100644 index 00000000..073e45bb --- /dev/null +++ b/dcmsign/libsrc/sibrsapr.cc @@ -0,0 +1,82 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiBaseRSAProfile + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sibrsapr.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +OFBool SiBaseRSAProfile::isAllowableMACType(E_MACType macType) const +{ + OFBool result = OFFalse; + switch (macType) + { + case EMT_RIPEMD160: + case EMT_SHA1: + case EMT_MD5: + result = OFTrue; + break; + default: + /* nothing */ + break; + } + return result; +} + +OFBool SiBaseRSAProfile::isAllowableAlgorithmType(E_KeyType keyType) const +{ + OFBool result = OFFalse; + switch (keyType) + { + case EKT_RSA: + result = OFTrue; + break; + default: + /* nothing */ + break; + } + return result; +} + +OFBool SiBaseRSAProfile::attributeRequired(const DcmTagKey& /* key */) const +{ + return OFFalse; +} + +OFBool SiBaseRSAProfile::attributeForbidden(const DcmTagKey& /* key */) const +{ + return OFFalse; +} + +OFBool SiBaseRSAProfile::isAllowableTransferSyntax(E_TransferSyntax xfer) const +{ + if ((xfer == EXS_LittleEndianImplicit)||(xfer == EXS_BigEndianExplicit)) return OFFalse; + return OFTrue; +} + +#else /* WITH_OPENSSL */ + +int sibrsapr_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sicert.cc b/dcmsign/libsrc/sicert.cc new file mode 100644 index 00000000..ea025fcd --- /dev/null +++ b/dcmsign/libsrc/sicert.cc @@ -0,0 +1,308 @@ +/* + * + * Copyright (C) 1998-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen + * + * Purpose: + * classes: SiCertificate + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sicert.h" +#include "dcmtk/dcmsign/sirsa.h" /* for class SiRSA */ +#include "dcmtk/dcmsign/sidsa.h" /* for class SiDSA */ +#include "dcmtk/dcmdata/dcstack.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrobow.h" +#include "dcmtk/dcmdata/dcdeftag.h" + +BEGIN_EXTERN_C +#include +#include +#include +END_EXTERN_C + +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#define EVP_PKEY_id(key) key->type +#endif + +SiCertificate::SiCertificate() +: x509(NULL) +{ +} + +SiCertificate::~SiCertificate() +{ + if (x509) X509_free(x509); +} + +E_KeyType SiCertificate::getKeyType() +{ + E_KeyType result = EKT_none; + if (x509) + { + EVP_PKEY *pkey = X509_extract_key(x509); + if (pkey) + { + switch(EVP_PKEY_id(pkey)) + { + case EVP_PKEY_RSA: + result = EKT_RSA; + break; + case EVP_PKEY_DSA: + result = EKT_DSA; + break; + case EVP_PKEY_DH: + result = EKT_DH; + break; + default: + /* nothing */ + break; + } + EVP_PKEY_free(pkey); + } + } + return result; +} + +SiAlgorithm *SiCertificate::createAlgorithmForPublicKey() +{ + if (x509) + { + EVP_PKEY *pkey = X509_extract_key(x509); + if (pkey) + { + switch(EVP_PKEY_id(pkey)) + { + case EVP_PKEY_RSA: + return new SiRSA(EVP_PKEY_get1_RSA(pkey)); + /* break; */ + case EVP_PKEY_DSA: + return new SiDSA(EVP_PKEY_get1_DSA(pkey)); + /* break; */ + case EVP_PKEY_DH: + default: + /* nothing */ + break; + } + EVP_PKEY_free(pkey); + } + } + return NULL; +} + +OFCondition SiCertificate::loadCertificate(const char *filename, int filetype) +{ + OFCondition result = SI_EC_CannotRead; + if (x509) X509_free(x509); + x509 = NULL; + if (filename) + { + BIO *in = BIO_new(BIO_s_file()); + if (in) + { + if (BIO_read_filename(in, filename) > 0) + { + if (filetype == X509_FILETYPE_ASN1) + { + x509 = d2i_X509_bio(in, NULL); + if (x509) result = EC_Normal; + } else { + x509 = PEM_read_bio_X509(in, NULL, NULL, NULL); + if (x509) result = EC_Normal; + } + } + BIO_free(in); + } + } + return result; +} + + +OFCondition SiCertificate::read(DcmItem& item) +{ + OFCondition result = EC_Normal; + OFString aString; + DcmStack stack; + result = item.search(DCM_CertificateType, stack, ESM_fromHere, OFFalse); + if (result.good()) + { + result = ((DcmElement *)(stack.top()))->getOFString(aString, 0); + if (result.good()) + { + if (aString == SI_DEFTERMS_X509CERT) + { + stack.clear(); + result = item.search(DCM_CertificateOfSigner, stack, ESM_fromHere, OFFalse); + if (result.good()) + { + DcmElement *cert = (DcmElement *)stack.top(); + Uint8 *data = NULL; + result = cert->getUint8Array(data); + if (result.good()) + { + if (data) + { +#if OPENSSL_VERSION_NUMBER >= 0x00908000L + // incompatible API change in OpenSSL 0.9.8 + const Uint8 *cdata = data; + x509 = d2i_X509(NULL, &cdata, cert->getLength()); +#else + x509 = d2i_X509(NULL, &data, cert->getLength()); +#endif + if (x509 == NULL) result = EC_IllegalCall; + } else result = EC_IllegalCall; + } + } + } else result = EC_IllegalCall; + } + } + return result; +} + +OFCondition SiCertificate::write(DcmItem& item) +{ + if (x509 == NULL) return EC_IllegalCall; + + OFCondition result = EC_Normal; + DcmElement *elem = new DcmCodeString(DCM_CertificateType); + if (elem) + { + result = elem->putString(SI_DEFTERMS_X509CERT); + if (result.good()) item.insert(elem, OFTrue); else delete elem; + } else result = EC_MemoryExhausted; + if (result.good()) + { + elem = new DcmOtherByteOtherWord(DCM_CertificateOfSigner); + if (elem) + { + int certLength = i2d_X509(x509, NULL); + unsigned char *data = new unsigned char[certLength]; + if (data) + { + unsigned char *data2 = data; + i2d_X509(x509, &data2); // data2 now points to the last element of the byte array + result = elem->putUint8Array((Uint8 *)data, certLength); + delete[] data; + if (result.good()) item.insert(elem, OFTrue); else delete elem; + } else { + delete elem; + result = EC_MemoryExhausted; + } + } else result = EC_MemoryExhausted; + } + return result; +} + +X509 *SiCertificate::getRawCertificate() +{ + return x509; +} + +long SiCertificate::getX509Version() +{ + if (x509 == NULL) return 0; + return X509_get_version(x509)+1; +} + +void SiCertificate::getCertSubjectName(OFString& str) +{ + if (x509) + { + char certSubjectName[2048]; /* certificate subject name (DN) */ + certSubjectName[0]= '\0'; + X509_NAME_oneline(X509_get_subject_name(x509), certSubjectName, 2048); + str = certSubjectName; + } else str.clear(); +} + +void SiCertificate::getCertIssuerName(OFString& str) +{ + if (x509) + { + char certIssuerName[2048]; /* certificate issuer name (DN) */ + certIssuerName[0]= '\0'; + X509_NAME_oneline(X509_get_issuer_name(x509), certIssuerName, 2048); + str = certIssuerName; + } else str.clear(); +} + +long SiCertificate::getCertSerialNo() +{ + if (x509 == NULL) return -1; + return ASN1_INTEGER_get(X509_get_serialNumber(x509)); +} + +void SiCertificate::getCertValidityNotBefore(OFString& str) +{ + str.clear(); + if (x509) + { + char *bufptr = NULL; + BIO *certValidNotBeforeBIO = BIO_new(BIO_s_mem()); + if (certValidNotBeforeBIO) + { + ASN1_UTCTIME_print(certValidNotBeforeBIO, X509_get_notBefore(x509)); + BIO_write(certValidNotBeforeBIO,"\0",1); + BIO_get_mem_data(certValidNotBeforeBIO, (char *)(&bufptr)); + if (bufptr) str = bufptr; + BIO_free(certValidNotBeforeBIO); + } + } +} + +void SiCertificate::getCertValidityNotAfter(OFString& str) +{ + str.clear(); + if (x509) + { + char *bufptr = NULL; + BIO *certValidNotAfterBIO = BIO_new(BIO_s_mem()); + if (certValidNotAfterBIO) + { + ASN1_UTCTIME_print(certValidNotAfterBIO, X509_get_notAfter(x509)); + BIO_write(certValidNotAfterBIO,"\0",1); + BIO_get_mem_data(certValidNotAfterBIO, (char *)(&bufptr)); + if (bufptr) str = bufptr; + BIO_free(certValidNotAfterBIO); + } + } +} + +long SiCertificate::getCertKeyBits() +{ + long certPubKeyBits = 0; /* certificate number of bits in public key */ + if (x509) + { + EVP_PKEY *pubkey = X509_get_pubkey(x509); // creates copy of public key + if (pubkey) + { + certPubKeyBits = EVP_PKEY_bits(pubkey); + EVP_PKEY_free(pubkey); + } + } + return certPubKeyBits; +} + +#else /* WITH_OPENSSL */ + +int sicert_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sicertvf.cc b/dcmsign/libsrc/sicertvf.cc new file mode 100644 index 00000000..5de5efb9 --- /dev/null +++ b/dcmsign/libsrc/sicertvf.cc @@ -0,0 +1,135 @@ +/* + * + * Copyright (C) 1998-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiCertificateVerifier + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sicert.h" +#include "dcmtk/dcmsign/sicertvf.h" + +BEGIN_EXTERN_C +#include +#include +END_EXTERN_C + + +SiCertificateVerifier::SiCertificateVerifier() +: x509store(NULL) +, errorCode(0) +{ + x509store = X509_STORE_new(); +} + +SiCertificateVerifier::~SiCertificateVerifier() +{ + if (x509store) X509_STORE_free(x509store); +} + + +OFCondition SiCertificateVerifier::addTrustedCertificateFile(const char *fileName, int fileType) +{ + /* fileType should be X509_FILETYPE_PEM or X509_FILETYPE_ASN1 */ + X509_LOOKUP *x509_lookup = X509_STORE_add_lookup(x509store, X509_LOOKUP_file()); + if (x509_lookup == NULL) return SI_EC_OpenSSLFailure; + if (! X509_LOOKUP_load_file(x509_lookup, fileName, fileType)) return SI_EC_CannotRead; + return EC_Normal; +} + + +OFCondition SiCertificateVerifier::addTrustedCertificateDir(const char *pathName, int fileType) +{ + /* fileType should be X509_FILETYPE_PEM or X509_FILETYPE_ASN1 */ + X509_LOOKUP *x509_lookup = X509_STORE_add_lookup(x509store, X509_LOOKUP_hash_dir()); + if (x509_lookup == NULL) return SI_EC_OpenSSLFailure; + if (! X509_LOOKUP_add_dir(x509_lookup, pathName, fileType)) return SI_EC_CannotRead; + return EC_Normal; +} + + +OFCondition SiCertificateVerifier::addCertificateRevocationList(const char *fileName, int fileType) +{ + OFCondition result = SI_EC_CannotRead; + X509_CRL *x509crl = NULL; + if (fileName) + { + BIO *in = BIO_new(BIO_s_file()); + if (in) + { + if (BIO_read_filename(in, fileName) > 0) + { + if (fileType == X509_FILETYPE_ASN1) + { + x509crl = d2i_X509_CRL_bio(in, NULL); + if (x509crl) + { + X509_STORE_add_crl(x509store, x509crl); + result = EC_Normal; + } + } else { + x509crl = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); + if (x509crl) + { + X509_STORE_add_crl(x509store, x509crl); + result = EC_Normal; + } + } + } + BIO_free(in); + } + } + return result; +} + + +OFCondition SiCertificateVerifier::verifyCertificate(SiCertificate& certificate) +{ + errorCode = 0; + X509 *rawcert = certificate.getRawCertificate(); + if (rawcert == NULL) return SI_EC_VerificationFailed_NoCertificate; + + X509_STORE_CTX *ctx = X509_STORE_CTX_new(); + X509_STORE_CTX_init(ctx, x509store, rawcert, NULL); + + // If a complete chain can be built and validated X509_verify_cert() returns 1, + // otherwise it returns zero, in exceptional circumstances it can also return a negative code. + int ok = X509_verify_cert(ctx); + + errorCode = X509_STORE_CTX_get_error(ctx); + X509_STORE_CTX_cleanup(ctx); + X509_STORE_CTX_free(ctx); + + if (ok == 1) return EC_Normal; else return SI_EC_VerificationFailed_NoTrust; +} + + +const char *SiCertificateVerifier::lastError() const +{ + return X509_verify_cert_error_string(errorCode); +} + + +#else /* WITH_OPENSSL */ + +int sicertvf_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sicreapr.cc b/dcmsign/libsrc/sicreapr.cc new file mode 100644 index 00000000..843f1042 --- /dev/null +++ b/dcmsign/libsrc/sicreapr.cc @@ -0,0 +1,95 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiCreatorProfile + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sicreapr.h" +#include "dcmtk/dcmdata/dcdeftag.h" + + +OFBool SiCreatorProfile::attributeRequired(const DcmTagKey& key) const +{ + /* SOP Class and Instance UIDs */ + if (key == DCM_SOPClassUID) return OFTrue; + if (key == DCM_SOPInstanceUID) return OFTrue; + + /* SOP Creation Date and Time, if present */ + if (key == DCM_InstanceCreationDate) return OFTrue; + if (key == DCM_InstanceCreationTime) return OFTrue; + + /* Study and Series Instance UIDs */ + if (key == DCM_StudyInstanceUID) return OFTrue; + if (key == DCM_SeriesInstanceUID) return OFTrue; + + /* Any attributes of the General Equipment module that are present */ + + if (key == DCM_Manufacturer) return OFTrue; + if (key == DCM_InstitutionName) return OFTrue; + if (key == DCM_InstitutionAddress) return OFTrue; + if (key == DCM_StationName) return OFTrue; + if (key == DCM_InstitutionalDepartmentName) return OFTrue; + if (key == DCM_ManufacturerModelName) return OFTrue; + if (key == DCM_DeviceSerialNumber) return OFTrue; + if (key == DCM_SoftwareVersions) return OFTrue; + if (key == DCM_SpatialResolution) return OFTrue; + if (key == DCM_DateOfLastCalibration) return OFTrue; + if (key == DCM_TimeOfLastCalibration) return OFTrue; + if (key == DCM_PixelPaddingValue) return OFTrue; + + /* Any overlay data present */ + if ((key.getGroup() >= 0x6000) && (key.getGroup() < 0x6020) && ((key.getGroup() & 0x0001) == 0)) return OFTrue; + + /* Any image data present - we assume this means the Image Pixel Module and not just PixelData */ + if (key.getGroup() == 0x0028) + { + Uint16 elem = key.getElement(); + if (elem == 0x0002) return OFTrue; // DCM_SamplesPerPixel + if (elem == 0x0004) return OFTrue; // DCM_PhotometricInterpretation + if (elem == 0x0006) return OFTrue; // DCM_PlanarConfiguration + if (elem == 0x0010) return OFTrue; // DCM_Rows + if (elem == 0x0011) return OFTrue; // DCM_Columns + if (elem == 0x0034) return OFTrue; // DCM_PixelAspectRatio + if (elem == 0x0100) return OFTrue; // DCM_BitsAllocated + if (elem == 0x0101) return OFTrue; // DCM_BitsStored + if (elem == 0x0102) return OFTrue; // DCM_HighBit + if (elem == 0x0103) return OFTrue; // DCM_PixelRepresentation + if (elem == 0x0106) return OFTrue; // DCM_SmallestImagePixelValue + if (elem == 0x0107) return OFTrue; // DCM_LargestImagePixelValue + if (elem == 0x1101) return OFTrue; // DCM_RedPaletteColorLookupTableDescriptor + if (elem == 0x1102) return OFTrue; // DCM_GreenPaletteColorLookupTableDescriptor + if (elem == 0x1103) return OFTrue; // DCM_BluePaletteColorLookupTableDescriptor + if (elem == 0x1201) return OFTrue; // DCM_RedPaletteColorLookupTableData + if (elem == 0x1202) return OFTrue; // DCM_GreenPaletteColorLookupTableData + if (elem == 0x1203) return OFTrue; // DCM_BluePaletteColorLookupTableData + } + if (key == DCM_PixelData) return OFTrue; + + return OFFalse; +} + +#else /* WITH_OPENSSL */ + +int sicreapr_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sidsa.cc b/dcmsign/libsrc/sidsa.cc new file mode 100644 index 00000000..a2dc3844 --- /dev/null +++ b/dcmsign/libsrc/sidsa.cc @@ -0,0 +1,143 @@ +/* + * + * Copyright (C) 1998-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiDSA + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sidsa.h" +#include "dcmtk/dcmsign/sicert.h" +#include "dcmtk/dcmsign/siprivat.h" + +BEGIN_EXTERN_C +#include +#include +#include +END_EXTERN_C + +SiDSA::SiDSA(DSA *key) +: dsa(key) +{ +} + + +SiDSA::~SiDSA() +{ + if (dsa) DSA_free(dsa); +} + + +OFCondition SiDSA::sign( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + unsigned char *outputSignature, + unsigned long &outputSignatureSize) +{ + if (dsa==NULL) return SI_EC_InitializationFailed; + int openSSLmac = 0; + switch (inputHashAlgorithm) + { + case EMT_SHA1: + openSSLmac = NID_sha1; + break; + case EMT_RIPEMD160: + openSSLmac = NID_ripemd160; + break; + case EMT_MD5: + openSSLmac = NID_md5; + break; + case EMT_SHA256: + openSSLmac = NID_sha256; + break; + case EMT_SHA384: + openSSLmac = NID_sha384; + break; + case EMT_SHA512: + openSSLmac = NID_sha512; + break; + } + unsigned int sigLen = 0; + int error = DSA_sign(openSSLmac, inputHash, (unsigned int)inputHashSize, outputSignature, &sigLen, dsa); + outputSignatureSize = sigLen; + if (error < 0) return SI_EC_OpenSSLFailure; + return EC_Normal; +} + + +OFCondition SiDSA::verify( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + const unsigned char *inputSignature, + unsigned long inputSignatureSize, + OFBool &verified) +{ + verified = OFFalse; + if (dsa==NULL) return SI_EC_InitializationFailed; + int openSSLmac = 0; + switch (inputHashAlgorithm) + { + case EMT_SHA1: + openSSLmac = NID_sha1; + break; + case EMT_RIPEMD160: + openSSLmac = NID_ripemd160; + break; + case EMT_MD5: + openSSLmac = NID_md5; + break; + case EMT_SHA256: + openSSLmac = NID_sha256; + break; + case EMT_SHA384: + openSSLmac = NID_sha384; + break; + case EMT_SHA512: + openSSLmac = NID_sha512; + break; + } + + // we have to cast away const on inputSignature yet because of OpenSSL limitations + int error = DSA_verify(openSSLmac, inputHash, (unsigned int)inputHashSize, (unsigned char *)inputSignature, (unsigned int)inputSignatureSize, dsa); + if (error < 0) return SI_EC_OpenSSLFailure; else if (error > 0) verified = OFTrue; + return EC_Normal; +} + + +unsigned long SiDSA::getSize() const +{ + if (dsa == NULL) return 0; + return DSA_size(dsa); +} + + +E_KeyType SiDSA::keyType() const +{ + return EKT_DSA; +} + +#else /* WITH_OPENSSL */ + +int sidsa_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/simaccon.cc b/dcmsign/libsrc/simaccon.cc new file mode 100644 index 00000000..cdd91a60 --- /dev/null +++ b/dcmsign/libsrc/simaccon.cc @@ -0,0 +1,205 @@ +/* + * + * Copyright (C) 1998-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiMACConstructor + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/simaccon.h" +#include "dcmtk/dcmsign/simac.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcvrat.h" +#include "dcmtk/dcmdata/dcwcache.h" + +// block size used for the memory buffer +#define SiMACConstructor_BlockSize 16384 + + +SiMACConstructor::SiMACConstructor() +: buf(new unsigned char[SiMACConstructor_BlockSize]) +, stream(buf, SiMACConstructor_BlockSize) +, dumpFile(NULL) +{ +} + + +SiMACConstructor::~SiMACConstructor() +{ + delete[] buf; +} + +void SiMACConstructor::setDumpFile(FILE *f) +{ + dumpFile = f; +} + + +OFCondition SiMACConstructor::flushBuffer(SiMAC& mac) +{ + OFCondition result = EC_Normal; + void *bufptr = NULL; + offile_off_t bufLen = 0; + stream.flushBuffer(bufptr, bufLen); + if (bufLen > 0) + { + if (dumpFile) + { + if (fwrite(bufptr, 1, OFstatic_cast(size_t, bufLen), dumpFile) != OFstatic_cast(size_t, bufLen)) + { + // We are apparently unable to write the byte stream to a dump file. + // This does not prevent us, however, from creating a valid digital signature. + // Therefore, issue a warning but continue. + DCMSIGN_WARN("Write error while dumping byte stream to file"); + } + } + result = mac.digest((unsigned char *)bufptr, (unsigned long)bufLen); + } + return result; +} + + +OFCondition SiMACConstructor::encodeElement(DcmElement *element, SiMAC& mac, E_TransferSyntax oxfer) +{ + if (element == NULL) return EC_IllegalCall; + DcmWriteCache wcache; + OFCondition result = EC_Normal; + OFBool last = OFFalse; + element->transferInit(); + while (!last) + { + result = element->writeSignatureFormat(stream, oxfer, EET_ExplicitLength, &wcache); + if (result == EC_StreamNotifyClient) result = flushBuffer(mac); + else + { + last=OFTrue; + } + } + element->transferEnd(); + return result; +} + + +OFCondition SiMACConstructor::flush(SiMAC& mac) +{ + OFCondition result = EC_Normal; + while (! stream.isFlushed() && result.good()) + { + stream.flush(); + result = flushBuffer(mac); + } + return result; +} + + +OFBool SiMACConstructor::inTagList(const DcmElement *element, DcmAttributeTag *tagList) +{ + if (element == NULL) return OFFalse; + if (tagList == NULL) return OFTrue; // tag list absent, use all tags + + DcmTagKey key; + const DcmTag &elementTag = element->getTag(); + unsigned long vm = tagList->getVM(); + for (unsigned long i=0; i < vm; i++) + { + if ((tagList->getTagVal(key, i)).good() && (key == elementTag)) return OFTrue; + } + return OFFalse; +} + +OFCondition SiMACConstructor::encodeDigitalSignatureItem( + DcmItem& signatureItem, + SiMAC& mac, + E_TransferSyntax oxfer) +{ + if (! signatureItem.canWriteXfer(oxfer, EXS_Unknown)) return SI_EC_WrongTransferSyntax; + OFCondition result = EC_Normal; + signatureItem.transferInit(); + unsigned long numElements = signatureItem.card(); + DcmElement *element; + DcmTagKey tagkey; + for (unsigned long i=0; i < numElements; i++) + { + element = signatureItem.getElement(i); + if (result.good()) + { + if (element->isSignable()) + { + tagkey = element->getTag().getXTag(); + if ((tagkey != DCM_CertificateOfSigner) && + (tagkey != DCM_Signature) && + (tagkey != DCM_CertifiedTimestampType) && + (tagkey != DCM_CertifiedTimestamp)) + { + result = encodeElement(element, mac, oxfer); + } + } + } + } + + /* done, flush stream buffer */ + result = flushBuffer(mac); + signatureItem.transferEnd(); + return result; +} + + +OFCondition SiMACConstructor::encodeDataset( + DcmItem& item, + SiMAC& mac, + E_TransferSyntax oxfer, + DcmAttributeTag &tagListOut, + DcmAttributeTag *tagListIn) +{ + tagListOut.clear(); + if (! item.canWriteXfer(oxfer, EXS_Unknown)) return SI_EC_WrongTransferSyntax; + OFCondition result = EC_Normal; + item.transferInit(); + unsigned long numElements = item.card(); + DcmElement *element; + for (unsigned long i=0; i < numElements; i++) + { + element = item.getElement(i); + if (result.good() && (inTagList(element, tagListIn))) + { + // if the element is signable, we should encode it + if (element->isSignable()) + { + result = encodeElement(element, mac, oxfer); + if (result.good()) + { + result = tagListOut.putTagVal(element->getTag(), tagListOut.getVM()); + } + } + } + } + + /* done, flush stream buffer */ + result = flushBuffer(mac); + item.transferEnd(); + return result; +} + +#else /* WITH_OPENSSL */ + +int simaccon_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/simd5.cc b/dcmsign/libsrc/simd5.cc new file mode 100644 index 00000000..204d246e --- /dev/null +++ b/dcmsign/libsrc/simd5.cc @@ -0,0 +1,90 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiMD5 + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/simd5.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include +END_EXTERN_C + + +SiMD5::SiMD5() +: ctx(new MD5_CTX()) +{ + initialize(); +} + +SiMD5::~SiMD5() +{ + delete ctx; +} + +unsigned long SiMD5::getSize() const +{ + return MD5_DIGEST_LENGTH; +} + +OFCondition SiMD5::initialize() +{ + MD5_Init(ctx); + return EC_Normal; +} + +OFCondition SiMD5::digest(const unsigned char *data, unsigned long length) +{ + if (length == 0) return EC_Normal; + if ((data == NULL)||(ctx == NULL)) return EC_IllegalCall; + MD5_Update(ctx, data, length); + return EC_Normal; +} + +OFCondition SiMD5::finalize(unsigned char *result) +{ + if ((result == NULL)||(ctx == NULL)) return EC_IllegalCall; + MD5_Final(result, ctx); + return EC_Normal; +} + +E_MACType SiMD5::macType() const +{ + return EMT_MD5; +} + +const char *SiMD5::getDefinedTerm() const +{ + return SI_DEFTERMS_MD5; +} + + +#else /* WITH_OPENSSL */ + +int simd5_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sinullpr.cc b/dcmsign/libsrc/sinullpr.cc new file mode 100644 index 00000000..43d09c8b --- /dev/null +++ b/dcmsign/libsrc/sinullpr.cc @@ -0,0 +1,60 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author:Marco Eichelberg + * + * Purpose: + * classes: SiNullProfile + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sinullpr.h" + +OFBool SiNullProfile::isAllowableMACType(E_MACType /* macType */) const +{ + return OFTrue; +} + +OFBool SiNullProfile::isAllowableAlgorithmType(E_KeyType keyType) const +{ + if (keyType == EKT_none) return OFFalse; + return OFTrue; +} + +OFBool SiNullProfile::attributeRequired(const DcmTagKey& /* key */) const +{ + return OFFalse; +} + +OFBool SiNullProfile::attributeForbidden(const DcmTagKey& /* key */) const +{ + return OFFalse; +} + +OFBool SiNullProfile::isAllowableTransferSyntax(E_TransferSyntax xfer) const +{ + if ((xfer == EXS_LittleEndianImplicit)||(xfer == EXS_BigEndianExplicit)) return OFFalse; + return OFTrue; +} + +#else /* WITH_OPENSSL */ + +int sinullpr_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/siprivat.cc b/dcmsign/libsrc/siprivat.cc new file mode 100644 index 00000000..6e012794 --- /dev/null +++ b/dcmsign/libsrc/siprivat.cc @@ -0,0 +1,192 @@ +/* + * + * Copyright (C) 1998-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiPrivateKey + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/siprivat.h" +#include "dcmtk/dcmsign/sirsa.h" +#include "dcmtk/dcmsign/sidsa.h" +#include "dcmtk/dcmsign/sicert.h" + +#define INCLUDE_CSTRING +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include +#include +#include +END_EXTERN_C + +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#define EVP_PKEY_id(key) key->type +#endif + +/* buf : buffer to write password into + * size : length of buffer in bytes + * rwflag : nonzero if the password will be used as a new password, i.e. user should be asked to repeat the password + * userdata: arbitrary pointer that can be set with SSL_CTX_set_default_passwd_cb_userdata() + * returns : number of bytes written to password buffer, -1 upon error + */ +extern "C" int SiPrivateKey_passwordCallback(char *buf, int size, int rwflag, void *userdata); + +int SiPrivateKey_passwordCallback(char *buf, int size, int /* rwflag */, void *userdata) +{ + if (userdata == NULL) return -1; + OFString *password = (OFString *)userdata; + int passwordSize = OFstatic_cast(int, password->length()); + if (passwordSize > size) passwordSize = size; + strncpy(buf, password->c_str(), passwordSize); + return passwordSize; +} + + +SiPrivateKey::SiPrivateKey() +: privateKeyPasswd() +, usePrivateKeyPassword(OFFalse) +, pkey(NULL) +{ +} + + +SiPrivateKey::~SiPrivateKey() +{ + if (pkey) EVP_PKEY_free(pkey); +} + + +void SiPrivateKey::setPrivateKeyPasswd(const char *thePasswd) +{ + if (thePasswd) privateKeyPasswd = thePasswd; + else privateKeyPasswd.clear(); + usePrivateKeyPassword = OFTrue; + return; +} + + +void SiPrivateKey::setPrivateKeyPasswdFromConsole() +{ + privateKeyPasswd.clear(); + usePrivateKeyPassword = OFFalse; + return; +} + + +OFCondition SiPrivateKey::loadPrivateKey(const char *filename, int filetype) +{ + OFCondition result = SI_EC_CannotRead; + if (pkey) EVP_PKEY_free(pkey); + pkey = NULL; + if (filename) + { + BIO *in = BIO_new(BIO_s_file()); + if (in) + { + if (BIO_read_filename(in, filename) > 0) + { + if (filetype == X509_FILETYPE_ASN1) + { + // ASN.1/DER encoded keys are never encrypted, thus no callback here. + pkey = d2i_PrivateKey_bio(in, NULL); + if (pkey) result = EC_Normal; + } else { + if (usePrivateKeyPassword) + pkey = PEM_read_bio_PrivateKey(in, NULL, SiPrivateKey_passwordCallback, &privateKeyPasswd); + else pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, NULL); // read password from console + if (pkey) result = EC_Normal; + } + } + BIO_free(in); + } + } + return result; +} + + +E_KeyType SiPrivateKey::getKeyType() const +{ + E_KeyType result = EKT_none; + if (pkey) + { + switch(EVP_PKEY_id(pkey)) + { + case EVP_PKEY_RSA: + result = EKT_RSA; + break; + case EVP_PKEY_DSA: + result = EKT_DSA; + break; + case EVP_PKEY_DH: + result = EKT_DH; + break; + default: + /* nothing */ + break; + } + } + return result; +} + + +SiAlgorithm *SiPrivateKey::createAlgorithmForPrivateKey() +{ + if (pkey) + { + switch(EVP_PKEY_id(pkey)) + { + case EVP_PKEY_RSA: + return new SiRSA(EVP_PKEY_get1_RSA(pkey)); + /* break; */ + case EVP_PKEY_DSA: + return new SiDSA(EVP_PKEY_get1_DSA(pkey)); + /* break; */ + case EVP_PKEY_DH: + default: + /* nothing */ + break; + } + } + return NULL; +} + + +OFBool SiPrivateKey::matchesCertificate(SiCertificate& cert) +{ + X509 *x509 = cert.getRawCertificate(); + if ((x509 == NULL)||(pkey == NULL)) return OFFalse; + if (X509_check_private_key(x509, pkey)) return OFTrue; + return OFFalse; +} + + +EVP_PKEY *SiPrivateKey::getRawPrivateKey() +{ + return pkey; +} + + +#else /* WITH_OPENSSL */ + +int siprivat_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/siripemd.cc b/dcmsign/libsrc/siripemd.cc new file mode 100644 index 00000000..ba629429 --- /dev/null +++ b/dcmsign/libsrc/siripemd.cc @@ -0,0 +1,88 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiRIPEMD160 + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/siripemd.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include +END_EXTERN_C + +SiRIPEMD160::SiRIPEMD160() +: ctx(new RIPEMD160_CTX()) +{ + initialize(); +} + +SiRIPEMD160::~SiRIPEMD160() +{ + delete ctx; +} + +unsigned long SiRIPEMD160::getSize() const +{ + return RIPEMD160_DIGEST_LENGTH; +} + +OFCondition SiRIPEMD160::initialize() +{ + RIPEMD160_Init(ctx); + return EC_Normal; +} + +OFCondition SiRIPEMD160::digest(const unsigned char *data, unsigned long length) +{ + if (length == 0) return EC_Normal; + if ((data == NULL)||(ctx == NULL)) return EC_IllegalCall; + RIPEMD160_Update(ctx, data, length); + return EC_Normal; +} + +OFCondition SiRIPEMD160::finalize(unsigned char *result) +{ + if ((result == NULL)||(ctx == NULL)) return EC_IllegalCall; + RIPEMD160_Final(result, ctx); + return EC_Normal; +} + +E_MACType SiRIPEMD160::macType() const +{ + return EMT_RIPEMD160; +} + +const char *SiRIPEMD160::getDefinedTerm() const +{ + return SI_DEFTERMS_RIPEMD160; +} + +#else /* WITH_OPENSSL */ + +int siripemd_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sirsa.cc b/dcmsign/libsrc/sirsa.cc new file mode 100644 index 00000000..ab7605a2 --- /dev/null +++ b/dcmsign/libsrc/sirsa.cc @@ -0,0 +1,143 @@ +/* + * + * Copyright (C) 1998-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiRSA + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sirsa.h" +#include "dcmtk/dcmsign/sicert.h" +#include "dcmtk/dcmsign/siprivat.h" + +BEGIN_EXTERN_C +#include +#include +#include /* for RSA */ +END_EXTERN_C + +SiRSA::SiRSA(RSA *key) +: rsa(key) +{ +} + +SiRSA::~SiRSA() +{ + if (rsa) RSA_free(rsa); +} + + +OFCondition SiRSA::sign( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + unsigned char *outputSignature, + unsigned long &outputSignatureSize) +{ + if (rsa==NULL) return SI_EC_InitializationFailed; + int openSSLmac = 0; + switch (inputHashAlgorithm) + { + case EMT_SHA1: + openSSLmac = NID_sha1; + break; + case EMT_RIPEMD160: + openSSLmac = NID_ripemd160; + break; + case EMT_MD5: + openSSLmac = NID_md5; + break; + case EMT_SHA256: + openSSLmac = NID_sha256; + break; + case EMT_SHA384: + openSSLmac = NID_sha384; + break; + case EMT_SHA512: + openSSLmac = NID_sha512; + break; + } + unsigned int sigLen = 0; + // we have to cast away const on inputHash yet because of OpenSSL limitations + int error = RSA_sign(openSSLmac, (unsigned char *)inputHash, (unsigned int)inputHashSize, outputSignature, &sigLen, rsa); + outputSignatureSize = sigLen; + if (error < 0) return SI_EC_OpenSSLFailure; + return EC_Normal; +} + + +OFCondition SiRSA::verify( + const unsigned char *inputHash, + unsigned long inputHashSize, + E_MACType inputHashAlgorithm, + const unsigned char *inputSignature, + unsigned long inputSignatureSize, + OFBool &verified) +{ + verified = OFFalse; + if (rsa==NULL) return SI_EC_InitializationFailed; + + int openSSLmac = 0; + switch (inputHashAlgorithm) + { + case EMT_SHA1: + openSSLmac = NID_sha1; + break; + case EMT_RIPEMD160: + openSSLmac = NID_ripemd160; + break; + case EMT_MD5: + openSSLmac = NID_md5; + break; + case EMT_SHA256: + openSSLmac = NID_sha256; + break; + case EMT_SHA384: + openSSLmac = NID_sha384; + break; + case EMT_SHA512: + openSSLmac = NID_sha512; + break; + } + // we have to cast away const on inputHash yet because of OpenSSL limitations + // we have to cast away const on inputSignature yet because of OpenSSL limitations + int error = RSA_verify(openSSLmac, (unsigned char *)inputHash, (unsigned int)inputHashSize, (unsigned char *)inputSignature, (unsigned int)inputSignatureSize, rsa); + if (error < 0) return SI_EC_OpenSSLFailure; else if (error > 0) verified = OFTrue; + return EC_Normal; +} + +unsigned long SiRSA::getSize() const +{ + if (rsa == NULL) return 0; + return RSA_size(rsa); +} + + +E_KeyType SiRSA::keyType() const +{ + return EKT_RSA; +} + +#else /* WITH_OPENSSL */ + +int sirsa_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sisha1.cc b/dcmsign/libsrc/sisha1.cc new file mode 100644 index 00000000..109e6fce --- /dev/null +++ b/dcmsign/libsrc/sisha1.cc @@ -0,0 +1,89 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiSHA1 + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sisha1.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include +END_EXTERN_C + + +SiSHA1::SiSHA1() +: ctx(new SHA_CTX()) +{ + initialize(); +} + +SiSHA1::~SiSHA1() +{ + delete ctx; +} + +unsigned long SiSHA1::getSize() const +{ + return SHA_DIGEST_LENGTH; +} + +OFCondition SiSHA1::initialize() +{ + SHA1_Init(ctx); + return EC_Normal; +} + +OFCondition SiSHA1::digest(const unsigned char *data, unsigned long length) +{ + if (length == 0) return EC_Normal; + if ((data == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA1_Update(ctx, data, length); + return EC_Normal; +} + +OFCondition SiSHA1::finalize(unsigned char *result) +{ + if ((result == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA1_Final(result, ctx); + return EC_Normal; +} + +E_MACType SiSHA1::macType() const +{ + return EMT_SHA1; +} + +const char *SiSHA1::getDefinedTerm() const +{ + return SI_DEFTERMS_SHA1; +} + +#else /* WITH_OPENSSL */ + +int sisha1_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sisha256.cc b/dcmsign/libsrc/sisha256.cc new file mode 100644 index 00000000..0900ec77 --- /dev/null +++ b/dcmsign/libsrc/sisha256.cc @@ -0,0 +1,89 @@ +/* + * + * Copyright (C) 2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiSHA256 + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sisha256.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include +END_EXTERN_C + + +SiSHA256::SiSHA256() +: ctx(new SHA256_CTX()) +{ + initialize(); +} + +SiSHA256::~SiSHA256() +{ + delete ctx; +} + +unsigned long SiSHA256::getSize() const +{ + return SHA256_DIGEST_LENGTH; +} + +OFCondition SiSHA256::initialize() +{ + SHA256_Init(ctx); + return EC_Normal; +} + +OFCondition SiSHA256::digest(const unsigned char *data, unsigned long length) +{ + if (length == 0) return EC_Normal; + if ((data == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA256_Update(ctx, data, length); + return EC_Normal; +} + +OFCondition SiSHA256::finalize(unsigned char *result) +{ + if ((result == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA256_Final(result, ctx); + return EC_Normal; +} + +E_MACType SiSHA256::macType() const +{ + return EMT_SHA256; +} + +const char *SiSHA256::getDefinedTerm() const +{ + return SI_DEFTERMS_SHA256; +} + +#else /* WITH_OPENSSL */ + +int sisha256_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sisha384.cc b/dcmsign/libsrc/sisha384.cc new file mode 100644 index 00000000..67ca32dc --- /dev/null +++ b/dcmsign/libsrc/sisha384.cc @@ -0,0 +1,89 @@ +/* + * + * Copyright (C) 2016-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiSHA384 + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sisha384.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include +END_EXTERN_C + + +SiSHA384::SiSHA384() +: ctx(new SHA512_CTX()) +{ + initialize(); +} + +SiSHA384::~SiSHA384() +{ + delete ctx; +} + +unsigned long SiSHA384::getSize() const +{ + return SHA384_DIGEST_LENGTH; +} + +OFCondition SiSHA384::initialize() +{ + SHA384_Init(ctx); + return EC_Normal; +} + +OFCondition SiSHA384::digest(const unsigned char *data, unsigned long length) +{ + if (length == 0) return EC_Normal; + if ((data == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA384_Update(ctx, data, length); + return EC_Normal; +} + +OFCondition SiSHA384::finalize(unsigned char *result) +{ + if ((result == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA384_Final(result, ctx); + return EC_Normal; +} + +E_MACType SiSHA384::macType() const +{ + return EMT_SHA384; +} + +const char *SiSHA384::getDefinedTerm() const +{ + return SI_DEFTERMS_SHA384; +} + +#else /* WITH_OPENSSL */ + +int sisha384_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sisha512.cc b/dcmsign/libsrc/sisha512.cc new file mode 100644 index 00000000..3b08cf1c --- /dev/null +++ b/dcmsign/libsrc/sisha512.cc @@ -0,0 +1,89 @@ +/* + * + * Copyright (C) 2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Marco Eichelberg + * + * Purpose: + * classes: SiSHA512 + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sisha512.h" +#include "dcmtk/dcmdata/dcerror.h" + +#define INCLUDE_CSTDLIB +#include "dcmtk/ofstd/ofstdinc.h" + +BEGIN_EXTERN_C +#include +END_EXTERN_C + + +SiSHA512::SiSHA512() +: ctx(new SHA512_CTX()) +{ + initialize(); +} + +SiSHA512::~SiSHA512() +{ + delete ctx; +} + +unsigned long SiSHA512::getSize() const +{ + return SHA512_DIGEST_LENGTH; +} + +OFCondition SiSHA512::initialize() +{ + SHA512_Init(ctx); + return EC_Normal; +} + +OFCondition SiSHA512::digest(const unsigned char *data, unsigned long length) +{ + if (length == 0) return EC_Normal; + if ((data == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA512_Update(ctx, data, length); + return EC_Normal; +} + +OFCondition SiSHA512::finalize(unsigned char *result) +{ + if ((result == NULL)||(ctx == NULL)) return EC_IllegalCall; + SHA512_Final(result, ctx); + return EC_Normal; +} + +E_MACType SiSHA512::macType() const +{ + return EMT_SHA512; +} + +const char *SiSHA512::getDefinedTerm() const +{ + return SI_DEFTERMS_SHA512; +} + +#else /* WITH_OPENSSL */ + +int sisha512_cc_dummy_to_keep_linker_from_moaning = 0; + +#endif diff --git a/dcmsign/libsrc/sisprof.cc b/dcmsign/libsrc/sisprof.cc new file mode 100644 index 00000000..ca2d3d8d --- /dev/null +++ b/dcmsign/libsrc/sisprof.cc @@ -0,0 +1,139 @@ +/* + * + * Copyright (C) 1998-2010, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsign + * + * Author: Norbert Loxen, Marco Eichelberg + * + * Purpose: + * classes: SiSecurityProfile + * + */ + +#include "dcmtk/config/osconfig.h" + +#ifdef WITH_OPENSSL + +#include "dcmtk/dcmsign/sisprof.h" +#include "dcmtk/dcmdata/dcitem.h" /* for DcmItem */ +#include "dcmtk/dcmdata/dcvrat.h" /* for DcmAttributeTag */ +#include "dcmtk/dcmsign/simac.h" /* for SiMAC */ +#include "dcmtk/dcmsign/sialgo.h" /* for SiAlgorithm */ + +OFBool SiSecurityProfile::isAllowableMAC(const SiMAC& mac) const +{ + return isAllowableMACType(mac.macType()); +} + + +OFBool SiSecurityProfile::isAllowableAlgorithm(const SiAlgorithm& algo) const +{ + return isAllowableAlgorithmType(algo.keyType()); +} + + +OFCondition SiSecurityProfile::updateAttributeList(DcmItem &item, DcmAttributeTag& tagList) +{ + OFCondition result = EC_Normal; + unsigned long card = item.card(); + if (card == 0) + { + // nothing to sign + tagList.clear(); + return result; + } + unsigned long maxArray = 2*card; + Uint16 *array = new Uint16[maxArray]; + if (array == NULL) return EC_MemoryExhausted; + unsigned long i=0; + for (i=0; igetTag(); + if (key.isSignableTag()) + { + if ((attributeRequired(key))||((containsTag(tagList, key))&&(! attributeForbidden(key)))) + { + array[2*i] = key.getGroup(); + array[2*i+1] = key.getElement(); + } + } + } + + // pack array + unsigned long j=0; + i = 0; + while (i < maxArray) + { + if (array[i] > 0) + { + array [j++] = array[i++]; + array [j++] = array[i++]; + } else i += 2; + } + + // now copy nonzero entries from array to tagList + tagList.clear(); + if (j > 0) + { + result = tagList.putUint16Array(array, j>>1); + } + return result; +} + + +OFBool SiSecurityProfile::checkAttributeList(DcmItem &item, DcmAttributeTag& tagList) +{ + DcmElement *elem = NULL; + unsigned long card = item.card(); + for (unsigned long i=0; igetTag(); + if (key.isSignableTag()) + { + if (containsTag(tagList, key)) + { + if (attributeForbidden(key)) return OFFalse; // attribute is signed but forbidden + } else { + if (attributeRequired(key)) return OFFalse; // attribute is required but unsigned + } + } else { + if (containsTag(tagList, key)) return OFFalse; // unsignable tag contained in list + } + } + return OFTrue; +} + + +OFBool SiSecurityProfile::containsTag(DcmAttributeTag& tagList, const DcmTagKey& key) +{ + unsigned long vm = tagList.getVM(); + DcmTagKey current; + for (unsigned long i=0; i $(DEP) + +include $(DEP) diff --git a/dcmsr/apps/dsr2html.cc b/dcmsr/apps/dsr2html.cc new file mode 100644 index 00000000..25395d9c --- /dev/null +++ b/dcmsr/apps/dsr2html.cc @@ -0,0 +1,491 @@ +/* + * + * Copyright (C) 2000-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * render the contents of a DICOM structured reporting file in HTML format + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoc.h" /* for main interface class DSRDocument */ + +#include "dcmtk/dcmdata/dctk.h" /* for typical set of "dcmdata" headers */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dsr2html" + +static OFLogger dsr2htmlLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +// ******************************************** + + +static OFCondition renderFile(STD_NAMESPACE ostream &out, + const char *ifname, + const char *cssName, + const char *defaultCharset, + const E_FileReadMode readMode, + const E_TransferSyntax xfer, + const size_t readFlags, + const size_t renderFlags, + const OFBool checkAllStrings, + const OFBool convertToUTF8) +{ + OFCondition result = EC_Normal; + + if ((ifname == NULL) || (strlen(ifname) == 0)) + { + OFLOG_FATAL(dsr2htmlLogger, OFFIS_CONSOLE_APPLICATION << ": invalid filename: "); + return EC_IllegalParameter; + } + + DcmFileFormat *dfile = new DcmFileFormat(); + if (dfile != NULL) + { + if (readMode == ERM_dataset) + result = dfile->getDataset()->loadFile(ifname, xfer); + else + result = dfile->loadFile(ifname, xfer); + if (result.bad()) + { + OFLOG_FATAL(dsr2htmlLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << result.text() + << ") reading file: " << ifname); + } + } else + result = EC_MemoryExhausted; + +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + /* convert all DICOM strings to UTF-8 (if requested) */ + if (result.good() && convertToUTF8) + { + DcmDataset *dset = dfile->getDataset(); + OFLOG_INFO(dsr2htmlLogger, "converting all element values that are affected by SpecificCharacterSet (0008,0005) to UTF-8"); + // check whether SpecificCharacterSet is absent but needed + if ((defaultCharset != NULL) && !dset->tagExistsWithValue(DCM_SpecificCharacterSet) && + dset->containsExtendedCharacters(OFFalse /*checkAllStrings*/)) + { + // use the manually specified source character set + result = dset->convertCharacterSet(defaultCharset, OFString("ISO_IR 192")); + } else { + // expect that SpecificCharacterSet contains the correct value + result = dset->convertToUTF8(); + } + if (result.bad()) + { + OFLOG_FATAL(dsr2htmlLogger, result.text() << ": converting file to UTF-8: " << ifname); + } + } +#else + // avoid compiler warning on unused variable + (void)convertToUTF8; +#endif + if (result.good()) + { + result = EC_CorruptedData; + DcmDataset *dset = dfile->getDataset(); + DSRDocument *dsrdoc = new DSRDocument(); + if (dsrdoc != NULL) + { + result = dsrdoc->read(*dset, readFlags); + if (result.good()) + { + // check extended character set + OFString charset; + if ((dsrdoc->getSpecificCharacterSet(charset).bad() || charset.empty()) && + dset->containsExtendedCharacters(checkAllStrings)) + { + // we have an unspecified extended character set + if (defaultCharset == NULL) + { + // the dataset contains non-ASCII characters that really should not be there + OFLOG_FATAL(dsr2htmlLogger, OFFIS_CONSOLE_APPLICATION << ": SpecificCharacterSet (0008,0005) " + << "element absent but extended characters used in file: " << ifname); + OFLOG_DEBUG(dsr2htmlLogger, "use option --charset-assume to manually specify an appropriate character set"); + result = EC_IllegalCall; + } else { + // use the default character set specified by the user + result = dsrdoc->setSpecificCharacterSet(defaultCharset); + if (dsrdoc->getSpecificCharacterSetType() == DSRTypes::CS_unknown) + { + OFLOG_FATAL(dsr2htmlLogger, OFFIS_CONSOLE_APPLICATION << ": Character set '" + << defaultCharset << "' specified with option --charset-assume not supported"); + result = EC_IllegalCall; + } + else if (result.bad()) + { + OFLOG_FATAL(dsr2htmlLogger, OFFIS_CONSOLE_APPLICATION << ": Cannot use character set '" + << defaultCharset << "' specified with option --charset-assume: " << result.text()); + } + } + } + if (result.good()) + result = dsrdoc->renderHTML(out, renderFlags, cssName); + } else { + OFLOG_FATAL(dsr2htmlLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << result.text() + << ") parsing file: " << ifname); + } + } + delete dsrdoc; + } + delete dfile; + + return result; +} + + +#define SHORTCOL 3 +#define LONGCOL 22 + + +int main(int argc, char *argv[]) +{ + size_t opt_readFlags = 0; + size_t opt_renderFlags = DSRTypes::HF_renderDcmtkFootnote; + const char *opt_cssName = NULL; + const char *opt_defaultCharset = NULL; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + OFBool opt_checkAllStrings = OFFalse; + OFBool opt_convertToUTF8 = OFFalse; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Render DICOM SR file and data set to HTML/XHTML", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dsrfile-in", "DICOM SR input filename to be rendered", OFCmdParam::PM_Mandatory); + cmd.addParam("htmlfile-out", "HTML/XHTML output filename (default: stdout)", OFCmdParam::PM_Optional); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("additional information:"); + cmd.addOption("--processing-details", "-Ip", "show currently processed content item"); + cmd.addSubGroup("error handling:"); + cmd.addOption("--unknown-relationship", "-Er", "accept unknown/missing relationship type"); + cmd.addOption("--invalid-item-value", "-Ev", "accept invalid content item value\n(e.g. violation of VR or VM definition)"); + cmd.addOption("--ignore-constraints", "-Ec", "ignore relationship content constraints"); + cmd.addOption("--ignore-item-errors", "-Ee", "do not abort on content item errors, just warn\n(e.g. missing value type specific attributes)"); + cmd.addOption("--skip-invalid-items", "-Ei", "skip invalid content items (incl. sub-tree)"); + cmd.addOption("--disable-vr-checker", "-Dv", "disable check for VR-conformant string values"); + cmd.addSubGroup("character set:"); + cmd.addOption("--charset-require", "+Cr", "require declaration of ext. charset (default)"); + cmd.addOption("--charset-assume", "+Ca", 1, "[c]harset: string", + "assume charset c if no extended charset declared"); + cmd.addOption("--charset-check-all", "check all data elements with string values\n(default: only PN, LO, LT, SH, ST, UC and UT)"); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.addOption("--convert-to-utf8", "+U8", "convert all element values that are affected\nby Specific Character Set (0008,0005) to UTF-8"); +#endif + cmd.addGroup("output options:"); + cmd.addSubGroup("HTML/XHTML compatibility:"); + cmd.addOption("--html-3.2", "+H3", "use only HTML version 3.2 compatible features"); + cmd.addOption("--html-4.0", "+H4", "allow all HTML version 4.01 features (default)"); + cmd.addOption("--xhtml-1.1", "+X1", "comply with XHTML version 1.1 specification"); + cmd.addOption("--add-document-type", "+Hd", "add reference to SGML document type definition"); + cmd.addSubGroup("cascading style sheet (CSS), not with HTML 3.2:"); + cmd.addOption("--css-reference", "+Sr", 1, "URL: string", + "add reference to specified CSS to document"); + cmd.addOption("--css-file", "+Sf", 1, "[f]ilename: string", + "embed content of specified CSS into document"); + cmd.addSubGroup("general rendering:"); + cmd.addOption("--expand-inline", "+Ri", "expand short content items inline (default)"); + cmd.addOption("--never-expand-inline", "-Ri", "never expand content items inline"); + cmd.addOption("--always-expand-inline", "+Ra", "always expand content items inline"); + cmd.addOption("--render-full-data", "+Rd", "render full data of content items"); + cmd.addOption("--section-title-inline", "+Rt", "render section titles inline, not separately"); + cmd.addSubGroup("document rendering:"); + cmd.addOption("--document-type-title", "+Dt", "use document type as document title (default)"); + cmd.addOption("--patient-info-title", "+Dp", "use patient information as document title"); + cmd.addOption("--no-document-header", "-Dh", "do not render general document information"); + cmd.addSubGroup("code rendering:"); + cmd.addOption("--render-inline-codes", "+Ci", "render codes in continuous text blocks"); + cmd.addOption("--concept-name-codes", "+Cn", "render code of concept names"); + cmd.addOption("--numeric-unit-codes", "+Cu", "render code of numeric measurement units"); + cmd.addOption("--code-value-unit", "+Cv", "use code value as measurement unit (default)"); + cmd.addOption("--code-meaning-unit", "+Cm", "use code meaning as measurement unit"); + cmd.addOption("--render-all-codes", "+Cc", "render all codes (implies +Ci, +Cn and +Cu)"); + cmd.addOption("--code-details-tooltip", "+Ct", "render code details as a tooltip (implies +Cc)"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* general options */ + + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + /* processing options */ + + if (cmd.findOption("--processing-details")) + { + app.checkDependence("--processing-details", "verbose mode", dsr2htmlLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_readFlags |= DSRTypes::RF_showCurrentlyProcessedItem; + } + if (cmd.findOption("--unknown-relationship")) + opt_readFlags |= DSRTypes::RF_acceptUnknownRelationshipType; + if (cmd.findOption("--invalid-item-value")) + opt_readFlags |= DSRTypes::RF_acceptInvalidContentItemValue; + if (cmd.findOption("--ignore-constraints")) + opt_readFlags |= DSRTypes::RF_ignoreRelationshipConstraints; + if (cmd.findOption("--ignore-item-errors")) + opt_readFlags |= DSRTypes::RF_ignoreContentItemErrors; + if (cmd.findOption("--skip-invalid-items")) + opt_readFlags |= DSRTypes::RF_skipInvalidContentItems; + if (cmd.findOption("--disable-vr-checker")) + dcmEnableVRCheckerForStringValues.set(OFFalse); + + /* character set options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--charset-require")) + opt_defaultCharset = NULL; + if (cmd.findOption("--charset-assume")) + app.checkValue(cmd.getValue(opt_defaultCharset)); + cmd.endOptionBlock(); + if (cmd.findOption("--charset-check-all")) + opt_checkAllStrings = OFTrue; +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (cmd.findOption("--convert-to-utf8")) + opt_convertToUTF8 = OFTrue; +#endif + + /* output options */ + + /* HTML compatibility */ + cmd.beginOptionBlock(); + if (cmd.findOption("--html-3.2")) + opt_renderFlags = (opt_renderFlags & ~DSRTypes::HF_XHTML11Compatibility) | DSRTypes::HF_HTML32Compatibility; + if (cmd.findOption("--html-4.0")) + opt_renderFlags = (opt_renderFlags & ~(DSRTypes::HF_XHTML11Compatibility | DSRTypes::HF_HTML32Compatibility)); + if (cmd.findOption("--xhtml-1.1")) + opt_renderFlags = (opt_renderFlags & ~DSRTypes::HF_HTML32Compatibility) | DSRTypes::HF_XHTML11Compatibility | DSRTypes::HF_addDocumentTypeReference; + cmd.endOptionBlock(); + + if (cmd.findOption("--add-document-type")) + opt_renderFlags |= DSRTypes::HF_addDocumentTypeReference; + + /* cascading style sheet */ + cmd.beginOptionBlock(); + if (cmd.findOption("--css-reference")) + { + app.checkConflict("--css-reference", "--html-3.2", (opt_renderFlags & DSRTypes::HF_HTML32Compatibility) > 0); + opt_renderFlags &= ~DSRTypes::HF_copyStyleSheetContent; + app.checkValue(cmd.getValue(opt_cssName)); + } + if (cmd.findOption("--css-file")) + { + app.checkConflict("--css-file", "--html-3.2", (opt_renderFlags & DSRTypes::HF_HTML32Compatibility) > 0); + opt_renderFlags |= DSRTypes::HF_copyStyleSheetContent; + app.checkValue(cmd.getValue(opt_cssName)); + } + cmd.endOptionBlock(); + + /* general rendering */ + cmd.beginOptionBlock(); + if (cmd.findOption("--expand-inline")) + { + /* default */ + } + if (cmd.findOption("--never-expand-inline")) + opt_renderFlags |= DSRTypes::HF_neverExpandChildrenInline; + if (cmd.findOption("--always-expand-inline")) + opt_renderFlags |= DSRTypes::HF_alwaysExpandChildrenInline; + cmd.endOptionBlock(); + + if (cmd.findOption("--render-full-data")) + opt_renderFlags |= DSRTypes::HF_renderFullData; + + if (cmd.findOption("--section-title-inline")) + opt_renderFlags |= DSRTypes::HF_renderSectionTitlesInline; + + /* document rendering */ + cmd.beginOptionBlock(); + if (cmd.findOption("--document-type-title")) + { + /* default */ + } + if (cmd.findOption("--patient-info-title")) + opt_renderFlags |= DSRTypes::HF_renderPatientTitle; + cmd.endOptionBlock(); + + if (cmd.findOption("--no-document-header")) + opt_renderFlags |= DSRTypes::HF_renderNoDocumentHeader; + + /* code rendering */ + if (cmd.findOption("--render-inline-codes")) + opt_renderFlags |= DSRTypes::HF_renderInlineCodes; + if (cmd.findOption("--concept-name-codes")) + opt_renderFlags |= DSRTypes::HF_renderConceptNameCodes; + if (cmd.findOption("--numeric-unit-codes")) + opt_renderFlags |= DSRTypes::HF_renderNumericUnitCodes; + if (cmd.findOption("--code-value-unit")) + opt_renderFlags &= ~DSRTypes::HF_useCodeMeaningAsUnit; + if (cmd.findOption("--code-meaning-unit")) + opt_renderFlags |= DSRTypes::HF_useCodeMeaningAsUnit; + if (cmd.findOption("--render-all-codes")) + opt_renderFlags |= DSRTypes::HF_renderAllCodes; + if (cmd.findOption("--code-details-tooltip")) + { + app.checkConflict("--code-details-tooltip", "--html-3.2", (opt_renderFlags & DSRTypes::HF_HTML32Compatibility) > 0); + opt_renderFlags |= DSRTypes::HF_useCodeDetailsTooltip; + } + } + + /* print resource identifier */ + OFLOG_DEBUG(dsr2htmlLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dsr2htmlLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + // map "old" charset names to DICOM defined terms + if (opt_defaultCharset != NULL) + { + OFString charset(opt_defaultCharset); + if (charset == "latin-1") + opt_defaultCharset = "ISO_IR 100"; + else if (charset == "latin-2") + opt_defaultCharset = "ISO_IR 101"; + else if (charset == "latin-3") + opt_defaultCharset = "ISO_IR 109"; + else if (charset == "latin-4") + opt_defaultCharset = "ISO_IR 110"; + else if (charset == "latin-5") + opt_defaultCharset = "ISO_IR 148"; + else if (charset == "cyrillic") + opt_defaultCharset = "ISO_IR 144"; + else if (charset == "arabic") + opt_defaultCharset = "ISO_IR 127"; + else if (charset == "greek") + opt_defaultCharset = "ISO_IR 126"; + else if (charset == "hebrew") + opt_defaultCharset = "ISO_IR 138"; + } + + int result = 0; + const char *ifname = NULL; + /* first parameter is treated as the input filename */ + cmd.getParam(1, ifname); + if (cmd.getParamCount() == 2) + { + /* second parameter specifies the output filename */ + const char *ofname = NULL; + cmd.getParam(2, ofname); + STD_NAMESPACE ofstream stream(ofname); + if (stream.good()) + { + if (renderFile(stream, ifname, opt_cssName, opt_defaultCharset, opt_readMode, opt_ixfer, opt_readFlags, + opt_renderFlags, opt_checkAllStrings, opt_convertToUTF8).bad()) + { + result = 2; + } + } else + result = 1; + } else { + /* use standard output */ + if (renderFile(COUT, ifname, opt_cssName, opt_defaultCharset, opt_readMode, opt_ixfer, opt_readFlags, + opt_renderFlags, opt_checkAllStrings, opt_convertToUTF8).bad()) + { + result = 3; + } + } + + return result; +} diff --git a/dcmsr/apps/dsr2xml.cc b/dcmsr/apps/dsr2xml.cc new file mode 100644 index 00000000..85bc0b44 --- /dev/null +++ b/dcmsr/apps/dsr2xml.cc @@ -0,0 +1,411 @@ +/* + * + * Copyright (C) 2000-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * convert the contents of a DICOM structured reporting file to XML format + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoc.h" /* for main interface class DSRDocument */ + +#include "dcmtk/dcmdata/dctk.h" /* for typical set of "dcmdata" headers */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "dsr2xml" + +static OFLogger dsr2xmlLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +// ******************************************** + + +static OFCondition writeFile(STD_NAMESPACE ostream &out, + const char *ifname, + DcmDataset *dset, + const size_t readFlags, + const size_t writeFlags, + const char *defaultCharset, + const OFBool checkAllStrings) +{ + OFCondition result = EC_IllegalParameter; + if ((ifname != NULL) && (dset != NULL)) + { + DSRDocument *dsrdoc = new DSRDocument(); + if (dsrdoc != NULL) + { + result = dsrdoc->read(*dset, readFlags); + if (result.good()) + { + // check extended character set + OFString charset; + if ((dsrdoc->getSpecificCharacterSet(charset).bad() || charset.empty()) && + dset->containsExtendedCharacters(checkAllStrings)) + { + // we have an unspecified extended character set + if (defaultCharset == NULL) + { + // the dataset contains non-ASCII characters that really should not be there + OFLOG_FATAL(dsr2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": SpecificCharacterSet (0008,0005) " + << "element absent but extended characters used in file: " << ifname); + OFLOG_DEBUG(dsr2xmlLogger, "use option --charset-assume to manually specify an appropriate character set"); + result = EC_IllegalCall; + } else { + // use the default character set specified by the user + result = dsrdoc->setSpecificCharacterSet(defaultCharset); + if (dsrdoc->getSpecificCharacterSetType() == DSRTypes::CS_unknown) + { + OFLOG_FATAL(dsr2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": Character set '" + << defaultCharset << "' specified with option --charset-assume not supported"); + result = EC_IllegalCall; + } + else if (result.bad()) + { + OFLOG_FATAL(dsr2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": Cannot use character set '" + << defaultCharset << "' specified with option --charset-assume: " << result.text()); + } + } + } + if (result.good()) + result = dsrdoc->writeXML(out, writeFlags); + } else { + OFLOG_FATAL(dsr2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << result.text() + << ") parsing file: " << ifname); + } + } else + result = EC_MemoryExhausted; + delete dsrdoc; + } + return result; +} + + +#define SHORTCOL 3 +#define LONGCOL 22 + + +int main(int argc, char *argv[]) +{ + size_t opt_readFlags = 0; + size_t opt_writeFlags = 0; + const char *opt_defaultCharset = NULL; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + OFBool opt_checkAllStrings = OFFalse; +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + OFBool opt_convertToUTF8 = OFFalse; +#endif + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Convert DICOM SR file and data set to XML", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dsrfile-in", "DICOM SR input filename to be converted", OFCmdParam::PM_Mandatory); + cmd.addParam("xmlfile-out", "XML output filename (default: stdout)", OFCmdParam::PM_Optional); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("error handling:"); + cmd.addOption("--unknown-relationship", "-Er", "accept unknown/missing relationship type"); + cmd.addOption("--invalid-item-value", "-Ev", "accept invalid content item value\n(e.g. violation of VR or VM definition)"); + cmd.addOption("--ignore-constraints", "-Ec", "ignore relationship content constraints"); + cmd.addOption("--ignore-item-errors", "-Ee", "do not abort on content item errors, just warn\n(e.g. missing value type specific attributes)"); + cmd.addOption("--skip-invalid-items", "-Ei", "skip invalid content items (incl. sub-tree)"); + cmd.addOption("--disable-vr-checker", "-Dv", "disable check for VR-conformant string values"); + cmd.addSubGroup("specific character set:"); + cmd.addOption("--charset-require", "+Cr", "require declaration of ext. charset (default)"); + cmd.addOption("--charset-assume", "+Ca", 1, "[c]harset: string", + "assume charset c if no extended charset declared"); + cmd.addOption("--charset-check-all", "+Cc", "check all data elements with string values\n(default: only PN, LO, LT, SH, ST, UC and UT)"); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.addOption("--convert-to-utf8", "+U8", "convert all element values that are affected\nby Specific Character Set (0008,0005) to UTF-8"); +#endif + cmd.addGroup("output options:"); + cmd.addSubGroup("encoding:"); + cmd.addOption("--attr-all", "+Ea", "encode everything as XML attribute\n(shortcut for +Ec, +Er, +Ev and +Et)"); + cmd.addOption("--attr-code", "+Ec", "encode code value, coding scheme designator\nand coding scheme version as XML attribute"); + cmd.addOption("--attr-relationship", "+Er", "encode relationship type as XML attribute"); + cmd.addOption("--attr-value-type", "+Ev", "encode value type as XML attribute"); + cmd.addOption("--attr-template-id", "+Et", "encode template id as XML attribute"); + cmd.addOption("--template-envelope", "+Ee", "template element encloses content items\n(requires +Wt, implies +Et)"); + cmd.addSubGroup("XML structure:"); + cmd.addOption("--add-schema-reference", "+Xs", "add reference to XML Schema \"" DCMSR_XML_XSD_FILE "\"\n(not with +Ea, +Ec, +Er, +Ev, +Et, +Ee, +We)"); + cmd.addOption("--use-xml-namespace", "+Xn", "add XML namespace declaration to root element"); + cmd.addSubGroup("writing:"); + cmd.addOption("--write-empty-tags", "+We", "write all tags even if their value is empty"); + cmd.addOption("--write-item-id", "+Wi", "always write item identifier"); + cmd.addOption("--write-template-id", "+Wt", "write template identification information"); + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + /* processing options */ + if (cmd.findOption("--unknown-relationship")) + opt_readFlags |= DSRTypes::RF_acceptUnknownRelationshipType; + if (cmd.findOption("--invalid-item-value")) + opt_readFlags |= DSRTypes::RF_acceptInvalidContentItemValue; + if (cmd.findOption("--ignore-constraints")) + opt_readFlags |= DSRTypes::RF_ignoreRelationshipConstraints; + if (cmd.findOption("--ignore-item-errors")) + opt_readFlags |= DSRTypes::RF_ignoreContentItemErrors; + if (cmd.findOption("--skip-invalid-items")) + opt_readFlags |= DSRTypes::RF_skipInvalidContentItems; + if (cmd.findOption("--disable-vr-checker")) + dcmEnableVRCheckerForStringValues.set(OFFalse); + cmd.beginOptionBlock(); + if (cmd.findOption("--charset-require")) + opt_defaultCharset = NULL; + if (cmd.findOption("--charset-assume")) + app.checkValue(cmd.getValue(opt_defaultCharset)); + cmd.endOptionBlock(); + if (cmd.findOption("--charset-check-all")) + opt_checkAllStrings = OFTrue; +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (cmd.findOption("--convert-to-utf8")) + opt_convertToUTF8 = OFTrue; +#endif + + /* output options */ + if (cmd.findOption("--attr-all")) + opt_writeFlags |= DSRTypes::XF_encodeEverythingAsAttribute; + if (cmd.findOption("--attr-code")) + opt_writeFlags |= DSRTypes::XF_codeComponentsAsAttribute; + if (cmd.findOption("--attr-relationship")) + opt_writeFlags |= DSRTypes::XF_relationshipTypeAsAttribute; + if (cmd.findOption("--attr-value-type")) + opt_writeFlags |= DSRTypes::XF_valueTypeAsAttribute; + if (cmd.findOption("--attr-template-id")) + opt_writeFlags |= DSRTypes::XF_templateIdentifierAsAttribute; + if (cmd.findOption("--template-envelope")) + opt_writeFlags |= DSRTypes::XF_templateElementEnclosesItems; + + if (cmd.findOption("--add-schema-reference")) + opt_writeFlags |= DSRTypes::XF_addSchemaReference; + if (cmd.findOption("--use-xml-namespace")) + opt_writeFlags |= DSRTypes::XF_useDcmsrNamespace; + + if (cmd.findOption("--write-empty-tags")) + opt_writeFlags |= DSRTypes::XF_writeEmptyTags; + if (cmd.findOption("--write-item-id")) + opt_writeFlags |= DSRTypes::XF_alwaysWriteItemIdentifier; + if (cmd.findOption("--write-template-id")) + opt_writeFlags |= DSRTypes::XF_writeTemplateIdentification; + + /* check conflicts and dependencies */ + if (opt_writeFlags & DSRTypes::XF_addSchemaReference) + { + app.checkConflict("--add-schema-reference", "--attr-all", (opt_writeFlags & DSRTypes::XF_encodeEverythingAsAttribute) == DSRTypes::XF_encodeEverythingAsAttribute); + app.checkConflict("--add-schema-reference", "--attr-code", (opt_writeFlags & DSRTypes::XF_codeComponentsAsAttribute) > 0); + app.checkConflict("--add-schema-reference", "--attr-relationship", (opt_writeFlags & DSRTypes::XF_relationshipTypeAsAttribute) > 0); + app.checkConflict("--add-schema-reference", "--attr-value-type", (opt_writeFlags & DSRTypes::XF_valueTypeAsAttribute) > 0); + app.checkConflict("--add-schema-reference", "--attr-template-id", (opt_writeFlags & DSRTypes::XF_templateIdentifierAsAttribute) > 0); + app.checkConflict("--add-schema-reference", "--template-envelope", (opt_writeFlags & DSRTypes::XF_templateElementEnclosesItems) > 0); + app.checkConflict("--add-schema-reference", "--write-empty-tags", (opt_writeFlags & DSRTypes::XF_writeEmptyTags) > 0); + } + if (opt_writeFlags & DSRTypes::XF_templateIdentifierAsAttribute) + app.checkDependence("--attr-template-id", "--write-template-id", (opt_writeFlags & DSRTypes::XF_writeTemplateIdentification) > 0); + if (opt_writeFlags & DSRTypes::XF_templateElementEnclosesItems) + app.checkDependence("--template-envelope", "--write-template-id", (opt_writeFlags & DSRTypes::XF_writeTemplateIdentification) > 0); + } + + /* print resource identifier */ + OFLOG_DEBUG(dsr2xmlLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dsr2xmlLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + int result = 0; + /* first parameter is treated as the input filename */ + const char *ifname = NULL; + cmd.getParam(1, ifname); + /* check input file */ + if ((ifname != NULL) && (strlen(ifname) > 0)) + { + /* read DICOM file or data set */ + DcmFileFormat dfile; + OFCondition status = dfile.loadFile(ifname, opt_ixfer); + if (status.good()) + { + DcmDataset *dset = dfile.getDataset(); + // map "old" charset names to DICOM defined terms + if (opt_defaultCharset != NULL) + { + OFString charset(opt_defaultCharset); + if (charset == "latin-1") + opt_defaultCharset = "ISO_IR 100"; + else if (charset == "latin-2") + opt_defaultCharset = "ISO_IR 101"; + else if (charset == "latin-3") + opt_defaultCharset = "ISO_IR 109"; + else if (charset == "latin-4") + opt_defaultCharset = "ISO_IR 110"; + else if (charset == "latin-5") + opt_defaultCharset = "ISO_IR 148"; + else if (charset == "cyrillic") + opt_defaultCharset = "ISO_IR 144"; + else if (charset == "arabic") + opt_defaultCharset = "ISO_IR 127"; + else if (charset == "greek") + opt_defaultCharset = "ISO_IR 126"; + else if (charset == "hebrew") + opt_defaultCharset = "ISO_IR 138"; + } +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + /* convert all DICOM strings to UTF-8 (if requested) */ + if (opt_convertToUTF8) + { + OFLOG_INFO(dsr2xmlLogger, "converting all element values that are affected by SpecificCharacterSet (0008,0005) to UTF-8"); + // check whether SpecificCharacterSet is absent but needed + if ((opt_defaultCharset != NULL) && !dset->tagExistsWithValue(DCM_SpecificCharacterSet) && + dset->containsExtendedCharacters(OFFalse /*checkAllStrings*/)) + { + // use the manually specified source character set + status = dset->convertCharacterSet(opt_defaultCharset, OFString("ISO_IR 192")); + } else { + // expect that SpecificCharacterSet contains the correct value + status = dset->convertToUTF8(); + } + if (status.bad()) + { + OFLOG_FATAL(dsr2xmlLogger, status.text() << ": converting file to UTF-8: " << ifname); + result = 4; + } + } +#endif + if (result == 0) + { + /* if second parameter is present, it is treated as the output filename ("stdout" otherwise) */ + if (cmd.getParamCount() == 2) + { + const char *ofname = NULL; + cmd.getParam(2, ofname); + STD_NAMESPACE ofstream stream(ofname); + if (stream.good()) + { + /* write content in XML format to file */ + if (writeFile(stream, ifname, dset, opt_readFlags, opt_writeFlags, opt_defaultCharset, opt_checkAllStrings).bad()) + result = 2; + } else + result = 1; + } else { + /* write content in XML format to standard output */ + if (writeFile(COUT, ifname, dset, opt_readFlags, opt_writeFlags, opt_defaultCharset, opt_checkAllStrings).bad()) + result = 3; + } + } + } else { + OFLOG_FATAL(dsr2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << status.text() + << ") reading file: " << ifname); + result = 5; + } + } else { + OFLOG_FATAL(dsr2xmlLogger, OFFIS_CONSOLE_APPLICATION << ": invalid filename: "); + result = 6; + } + + return result; +} diff --git a/dcmsr/apps/dsrdump.cc b/dcmsr/apps/dsrdump.cc new file mode 100644 index 00000000..c73e59a9 --- /dev/null +++ b/dcmsr/apps/dsrdump.cc @@ -0,0 +1,379 @@ +/* + * + * Copyright (C) 2000-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * list the contents of a DICOM structured reporting file + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoc.h" /* for main interface class DSRDocument */ + +#include "dcmtk/dcmdata/dctk.h" /* for typical set of "dcmdata" headers */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION +#include "dcmtk/ofstd/ofchrenc.h" /* for OFCharacterEncoding */ +#endif + +#ifndef HAVE_WINDOWS_H +#define ANSI_ESCAPE_CODES_AVAILABLE +#endif + +#define OFFIS_CONSOLE_APPLICATION "dsrdump" + +static OFLogger dsrdumpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +// ******************************************** + + +static OFCondition dumpFile(STD_NAMESPACE ostream &out, + const char *ifname, + const E_FileReadMode readMode, + const E_TransferSyntax xfer, + const size_t readFlags, + const size_t printFlags, + const OFBool convertToUTF8) +{ + OFCondition result = EC_Normal; + + if ((ifname == NULL) || (strlen(ifname) == 0)) + { + OFLOG_FATAL(dsrdumpLogger, OFFIS_CONSOLE_APPLICATION << ": invalid filename: "); + return EC_IllegalParameter; + } + + DcmFileFormat *dfile = new DcmFileFormat(); + if (dfile != NULL) + { + if (readMode == ERM_dataset) + result = dfile->getDataset()->loadFile(ifname, xfer); + else + result = dfile->loadFile(ifname, xfer); + if (result.bad()) + { + OFLOG_FATAL(dsrdumpLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << result.text() + << ") reading file: " << ifname); + } + } else + result = EC_MemoryExhausted; + +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (result.good()) + { + if (convertToUTF8) + { + OFLOG_INFO(dsrdumpLogger, "converting all element values that are affected by Specific Character Set (0008,0005) to UTF-8"); + result = dfile->convertToUTF8(); + if (result.bad()) + { + OFLOG_FATAL(dsrdumpLogger, result.text() << ": converting file to UTF-8: " << ifname); + } + } + } +#else + // avoid compiler warning on unused variable + (void)convertToUTF8; +#endif + if (result.good()) + { + result = EC_CorruptedData; + DSRDocument *dsrdoc = new DSRDocument(); + if (dsrdoc != NULL) + { + result = dsrdoc->read(*dfile->getDataset(), readFlags); + if (result.good()) + { + result = dsrdoc->print(out, printFlags); + out << OFendl; + } + else + { + OFLOG_FATAL(dsrdumpLogger, OFFIS_CONSOLE_APPLICATION << ": error (" << result.text() + << ") parsing file: " << ifname); + } + } + delete dsrdoc; + } + delete dfile; + + return result; +} + + +#define SHORTCOL 4 +#define LONGCOL 22 + + +int main(int argc, char *argv[]) +{ + size_t opt_readFlags = 0; + size_t opt_printFlags = DSRTypes::PF_shortenLongItemValues; + OFBool opt_printFilename = OFFalse; + E_FileReadMode opt_readMode = ERM_autoDetect; + E_TransferSyntax opt_ixfer = EXS_Unknown; + OFBool opt_convertToUTF8 = OFFalse; + + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Dump DICOM SR file and data set", rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("dsrfile-in", "DICOM SR input filename to be dumped", OFCmdParam::PM_MultiMandatory); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("input file format:"); + cmd.addOption("--read-file", "+f", "read file format or data set (default)"); + cmd.addOption("--read-file-only", "+fo", "read file format only"); + cmd.addOption("--read-dataset", "-f", "read data set without file meta information"); + cmd.addSubGroup("input transfer syntax:"); + cmd.addOption("--read-xfer-auto", "-t=", "use TS recognition (default)"); + cmd.addOption("--read-xfer-detect", "-td", "ignore TS specified in the file meta header"); + cmd.addOption("--read-xfer-little", "-te", "read with explicit VR little endian TS"); + cmd.addOption("--read-xfer-big", "-tb", "read with explicit VR big endian TS"); + cmd.addOption("--read-xfer-implicit", "-ti", "read with implicit VR little endian TS"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("additional information:"); + cmd.addOption("--processing-details", "-Ip", "show currently processed content item"); + cmd.addSubGroup("error handling:"); + cmd.addOption("--unknown-relationship", "-Er", "accept unknown/missing relationship type"); + cmd.addOption("--invalid-item-value", "-Ev", "accept invalid content item value\n(e.g. violation of VR or VM definition)"); + cmd.addOption("--ignore-constraints", "-Ec", "ignore relationship content constraints"); + cmd.addOption("--ignore-item-errors", "-Ee", "do not abort on content item errors, just warn\n(e.g. missing value type specific attributes)"); + cmd.addOption("--skip-invalid-items", "-Ei", "skip invalid content items (incl. sub-tree)"); + cmd.addOption("--disable-vr-checker", "-Dv", "disable check for VR-conformant string values"); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + cmd.addSubGroup("specific character set:"); + cmd.addOption("--convert-to-utf8", "+U8", "convert all element values that are affected\nby Specific Character Set (0008,0005) to UTF-8"); +#endif + + cmd.addGroup("output options:"); + cmd.addSubGroup("general printing:"); + cmd.addOption("--print-filename", "+Pf", "print header with filename for each document"); + cmd.addOption("--no-document-header", "-Ph", "do not print general document information"); + cmd.addOption("--number-nested-items", "+Pn", "print position string in front of each line"); + cmd.addOption("--indent-nested-items", "-Pn", "indent nested items by spaces (default)"); + cmd.addSubGroup("printing values:"); + cmd.addOption("--print-long-values", "+Pl", "print long item values completely"); + cmd.addOption("--shorten-long-values", "-Pl", "print long item values shortened (default)"); + cmd.addOption("--print-instance-uid", "+Pu", "print SOP instance UID of referenced objects"); + cmd.addOption("--print-sopclass-short", "-Ps", "print short SOP class name of referenced\nimage objects, e.g. \"CT image\" (default)"); + cmd.addOption("--print-sopclass-long", "+Ps", "print long SOP class name of ref. objects"); + cmd.addOption("--print-sopclass-uid", "+Psu", "print SOP class UID of referenced objects"); + cmd.addOption("--print-all-codes", "+Pc", "print all codes (incl. concept name codes)"); + cmd.addOption("--print-invalid-codes", "+Pi", "print invalid codes (for debugging purposes)"); + cmd.addOption("--no-invalid-codes", "-Pi", "print text \"invalid code\" instead (default)"); + cmd.addOption("--print-template-id", "+Pt", "print template identification information"); + cmd.addSubGroup("enhanced encoding mode:"); + cmd.addOption("--indicate-enhanced", "+Pe", "indicate that enhanced mode is used for codes"); + cmd.addOption("--no-enhanced-mode", "-Pe", "do not indicate enhanced mode (default)"); +#ifdef ANSI_ESCAPE_CODES_AVAILABLE + cmd.addSubGroup("color:"); + cmd.addOption("--print-color", "+C", "use ANSI escape codes for colored output"); + cmd.addOption("--no-color", "-C", "do not use any ANSI escape codes (default)"); +#endif + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:"; +#if !defined(WITH_ZLIB) && !defined(DCMTK_ENABLE_CHARSET_CONVERSION) + COUT << " none" << OFendl; +#else + COUT << OFendl; +#endif +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect; + if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly; + if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--read-xfer-auto")) + opt_ixfer = EXS_Unknown; + if (cmd.findOption("--read-xfer-detect")) + dcmAutoDetectDatasetXfer.set(OFTrue); + if (cmd.findOption("--read-xfer-little")) + { + app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianExplicit; + } + if (cmd.findOption("--read-xfer-big")) + { + app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_BigEndianExplicit; + } + if (cmd.findOption("--read-xfer-implicit")) + { + app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset); + opt_ixfer = EXS_LittleEndianImplicit; + } + cmd.endOptionBlock(); + + /* processing options */ + if (cmd.findOption("--processing-details")) + { + app.checkDependence("--processing-details", "verbose mode", dsrdumpLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL)); + opt_readFlags |= DSRTypes::RF_showCurrentlyProcessedItem; + } + if (cmd.findOption("--unknown-relationship")) + opt_readFlags |= DSRTypes::RF_acceptUnknownRelationshipType; + if (cmd.findOption("--invalid-item-value")) + opt_readFlags |= DSRTypes::RF_acceptInvalidContentItemValue; + if (cmd.findOption("--ignore-constraints")) + opt_readFlags |= DSRTypes::RF_ignoreRelationshipConstraints; + if (cmd.findOption("--ignore-item-errors")) + opt_readFlags |= DSRTypes::RF_ignoreContentItemErrors; + if (cmd.findOption("--skip-invalid-items")) + opt_readFlags |= DSRTypes::RF_skipInvalidContentItems; + if (cmd.findOption("--disable-vr-checker")) + dcmEnableVRCheckerForStringValues.set(OFFalse); +#ifdef DCMTK_ENABLE_CHARSET_CONVERSION + if (cmd.findOption("--convert-to-utf8")) opt_convertToUTF8 = OFTrue; +#endif + + /* output options */ + if (cmd.findOption("--print-filename")) + opt_printFilename = OFTrue; + if (cmd.findOption("--no-document-header")) + opt_printFlags |= DSRTypes::PF_printNoDocumentHeader; + + cmd.beginOptionBlock(); + if (cmd.findOption("--number-nested-items")) + opt_printFlags |= DSRTypes::PF_printItemPosition; + if (cmd.findOption("--indent-nested-items")) + opt_printFlags &= ~DSRTypes::PF_printItemPosition; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-long-values")) + opt_printFlags &= ~DSRTypes::PF_shortenLongItemValues; + if (cmd.findOption("--shorten-long-values")) + opt_printFlags |= DSRTypes::PF_shortenLongItemValues; + cmd.endOptionBlock(); + + if (cmd.findOption("--print-instance-uid")) + opt_printFlags |= DSRTypes::PF_printSOPInstanceUID; + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-sopclass-short")) + opt_printFlags = (opt_printFlags & ~(DSRTypes::PF_printLongSOPClassName | DSRTypes::PF_printSOPClassUID)); + if (cmd.findOption("--print-sopclass-long")) + opt_printFlags = (opt_printFlags & ~DSRTypes::PF_printSOPClassUID) | DSRTypes::PF_printLongSOPClassName; + if (cmd.findOption("--print-sopclass-uid")) + opt_printFlags = (opt_printFlags & ~DSRTypes::PF_printLongSOPClassName) | DSRTypes::PF_printSOPClassUID; + cmd.endOptionBlock(); + + if (cmd.findOption("--print-all-codes")) + opt_printFlags |= DSRTypes::PF_printAllCodes; + + cmd.beginOptionBlock(); + if (cmd.findOption("--print-invalid-codes")) + opt_printFlags |= DSRTypes::PF_printInvalidCodes; + if (cmd.findOption("--no-invalid-codes")) + opt_printFlags &= ~DSRTypes::PF_printInvalidCodes; + cmd.endOptionBlock(); + + if (cmd.findOption("--print-template-id")) + opt_printFlags |= DSRTypes::PF_printTemplateIdentification; + + cmd.beginOptionBlock(); + if (cmd.findOption("--indicate-enhanced")) + opt_printFlags |= DSRTypes::PF_indicateEnhancedEncodingMode; + if (cmd.findOption("--no-enhanced-mode")) + opt_printFlags &= ~DSRTypes::PF_indicateEnhancedEncodingMode; + cmd.endOptionBlock(); + +#ifdef ANSI_ESCAPE_CODES_AVAILABLE + cmd.beginOptionBlock(); + if (cmd.findOption("--print-color")) + opt_printFlags |= DSRTypes::PF_useANSIEscapeCodes; + if (cmd.findOption("--no-color")) + opt_printFlags &= ~DSRTypes::PF_useANSIEscapeCodes; + cmd.endOptionBlock(); +#endif + } + + /* print resource identifier */ + OFLOG_DEBUG(dsrdumpLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(dsrdumpLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + int errorCount = 0; + const int count = cmd.getParamCount(); + const char *current = NULL; + for (int i = 1; i <= count; i++) + { + cmd.getParam(i, current); + if (opt_printFilename) + { + if (i > 1) + COUT << OFString(79, '-') << OFendl; + COUT << OFFIS_CONSOLE_APPLICATION << " (" << i << "/" << count << "): " << current << OFendl << OFendl; + } + if (dumpFile(COUT, current, opt_readMode, opt_ixfer, opt_readFlags, opt_printFlags, opt_convertToUTF8).bad()) + errorCount++; + } + +#ifdef DEBUG + dcmDataDict.clear(); /* useful for debugging with dmalloc */ +#endif + return errorCount; +} diff --git a/dcmsr/apps/xml2dsr.cc b/dcmsr/apps/xml2dsr.cc new file mode 100644 index 00000000..83eaeb56 --- /dev/null +++ b/dcmsr/apps/xml2dsr.cc @@ -0,0 +1,396 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * convert the contents of an XML document to a DICOM structured reporting file + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoc.h" /* for main interface class DSRDocument */ + +#include "dcmtk/dcmdata/dctk.h" /* for typical set of "dcmdata" headers */ +#include "dcmtk/dcmdata/dcostrmz.h" /* for dcmZlibCompressionLevel */ + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofconapp.h" + +#ifdef WITH_ZLIB +#include /* for zlibVersion() */ +#endif + +#define OFFIS_CONSOLE_APPLICATION "xml2dsr" +#define OFFIS_CONSOLE_DESCRIPTION "Convert XML document to DICOM SR file" + +static OFLogger xml2dsrLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); + +static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" + OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; + + +// ******************************************** + + +#ifdef WITH_LIBXML + +#ifdef __ibmxl__ +// IBM xlC defines __GNUC__ but does not support the GNUC extension +// __attribute__ ((format (printf, 2, 3))). +// This avoids a compiler warning in . +#define LIBXML_ATTR_FORMAT(fmt,args) +#endif + +// The libxml library also uses unicode. So we have to reuse some +// workarounds for the ICU library here as well. +// The type char16_t is only supported since C++11. +#ifndef HAVE_CHAR16_T +#define UCHAR_TYPE uint16_t +#endif + +//If U_NOEXCEPT is not defined, ICU falls back to NOEXCEPT. +#ifndef HAVE_CXX11 +#define U_NOEXCEPT +#endif + +#include + + +#define SHORTCOL 3 +#define LONGCOL 21 + + +int main(int argc, char *argv[]) +{ + OFBool opt_generateUIDs = OFFalse; + OFBool opt_overwriteUIDs = OFFalse; + size_t opt_readFlags = 0; + E_TransferSyntax opt_xfer = EXS_LittleEndianExplicit; + E_EncodingType opt_enctype = EET_ExplicitLength; + E_GrpLenEncoding opt_glenc = EGL_recalcGL; + E_PaddingEncoding opt_padenc = EPD_withoutPadding; + E_FileWriteMode opt_writeMode = EWM_fileformat; + OFCmdUnsignedInt opt_filepad = 0; + OFCmdUnsignedInt opt_itempad = 0; + + /* set-up command line parameters and options */ + OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, OFFIS_CONSOLE_DESCRIPTION, rcsid); + OFCommandLine cmd; + cmd.setOptionColumns(LONGCOL, SHORTCOL); + cmd.setParamColumn(LONGCOL + SHORTCOL + 4); + + cmd.addParam("xmlfile-in", "XML input filename to be converted (stdin: \"-\")", OFCmdParam::PM_Mandatory); + cmd.addParam("dsrfile-out", "DICOM SR output filename", OFCmdParam::PM_Mandatory); + + cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2); + cmd.addOption("--help", "-h", "print this help text and exit", OFCommandLine::AF_Exclusive); + cmd.addOption("--version", "print version information and exit", OFCommandLine::AF_Exclusive); + OFLog::addOptions(cmd); + + cmd.addGroup("input options:"); + cmd.addSubGroup("encoding:"); + cmd.addOption("--template-envelope", "+Ee", "template element encloses content items"); + + cmd.addGroup("processing options:"); + cmd.addSubGroup("validation:"); +#ifdef LIBXML_SCHEMAS_ENABLED + cmd.addOption("--validate-schema", "+Vs", "validate XML document against Schema\n(not with --template-envelope)"); +#endif + cmd.addOption("--check-namespace", "+Vn", "check XML namespace in document root"); + cmd.addSubGroup("unique identifiers:"); + cmd.addOption("--generate-new-uids", "+Ug", "generate new Study/Series/SOP Instance UID"); + cmd.addOption("--dont-overwrite-uids", "-Uo", "do not overwrite existing UIDs (default)"); + cmd.addOption("--overwrite-uids", "+Uo", "overwrite existing UIDs"); + + cmd.addGroup("output options:"); + cmd.addSubGroup("output file format:"); + cmd.addOption("--write-file", "+F", "write file format (default)"); + cmd.addOption("--write-dataset", "-F", "write data set without file meta information"); + cmd.addSubGroup("output transfer syntax:"); + cmd.addOption("--write-xfer-little", "+te", "write with explicit VR little endian TS (def.)"); + cmd.addOption("--write-xfer-big", "+tb", "write with explicit VR big endian TS"); + cmd.addOption("--write-xfer-implicit", "+ti", "write with implicit VR little endian TS"); +#ifdef WITH_ZLIB + cmd.addOption("--write-xfer-deflated", "+td", "write with deflated expl. VR little endian TS"); +#endif + cmd.addSubGroup("post-1993 value representations:"); + cmd.addOption("--enable-new-vr", "+u", "enable support for new VRs (UN/UT) (default)"); + cmd.addOption("--disable-new-vr", "-u", "disable support for new VRs, convert to OB"); + cmd.addSubGroup("group length encoding:"); + cmd.addOption("--group-length-recalc", "+g=", "recalculate group lengths if present (default)"); + cmd.addOption("--group-length-create", "+g", "always write with group length elements"); + cmd.addOption("--group-length-remove", "-g", "always write without group length elements"); + cmd.addSubGroup("length encoding in sequences and items:"); + cmd.addOption("--length-explicit", "+e", "write with explicit lengths (default)"); + cmd.addOption("--length-undefined", "-e", "write with undefined lengths"); + cmd.addSubGroup("data set trailing padding (not with --write-dataset):"); + cmd.addOption("--padding-retain", "-p=", "do not change padding\n(default if not --write-dataset)"); + cmd.addOption("--padding-off", "-p", "no padding (implicit if --write-dataset)"); + cmd.addOption("--padding-create", "+p", 2, "[f]ile-pad [i]tem-pad: integer", + "align file on multiple of f bytes\nand items on multiple of i bytes"); +#ifdef WITH_ZLIB + cmd.addSubGroup("deflate compression level (only with --write-xfer-deflated):"); + cmd.addOption("--compression-level", "+cl", 1, "[l]evel: integer (default: 6)", + "0=uncompressed, 1=fastest, 9=best compression"); +#endif + + /* evaluate command line */ + prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION); + if (app.parseCommandLine(cmd, argc, argv)) + { + /* check exclusive options first */ + if (cmd.hasExclusiveOption()) + { + if (cmd.findOption("--version")) + { + app.printHeader(OFTrue /*print host identifier*/); + COUT << OFendl << "External libraries used:" << OFendl; +#ifdef WITH_ZLIB + COUT << "- ZLIB, Version " << zlibVersion() << OFendl; +#endif + COUT << "- LIBXML, Version " << LIBXML_DOTTED_VERSION << OFendl; +#ifndef LIBXML_SCHEMAS_ENABLED + COUT << " without XML Schema support" << OFendl; +#endif +#if defined(LIBXML_ICONV_ENABLED) && defined(LIBXML_ZLIB_ENABLED) + COUT << " with built-in LIBICONV and ZLIB support" << OFendl; +#elif defined(LIBXML_ICONV_ENABLED) + COUT << " with built-in LIBICONV support" << OFendl; +#elif defined(LIBXML_ZLIB_ENABLED) + COUT << " with built-in ZLIB support" << OFendl; +#endif + return 0; + } + } + + /* general options */ + OFLog::configureFromCommandLine(cmd, app); + + /* input options */ + if (cmd.findOption("--template-envelope")) + opt_readFlags |= DSRTypes::XF_templateElementEnclosesItems; + + /* processing options */ +#ifdef LIBXML_SCHEMAS_ENABLED + if (cmd.findOption("--validate-schema")) + opt_readFlags |= DSRTypes::XF_validateSchema; +#endif + if (cmd.findOption("--check-namespace")) + opt_readFlags |= DSRTypes::XF_useDcmsrNamespace; + + if (cmd.findOption("--generate-new-uids")) + { + opt_generateUIDs = OFTrue; + opt_readFlags |= DSRTypes::XF_acceptEmptyStudySeriesInstanceUID; + } + + cmd.beginOptionBlock(); + if (cmd.findOption("--dont-overwrite-uids")) + { + app.checkDependence("--dont-overwrite-uids", "--generate-new-uids", opt_generateUIDs); + opt_overwriteUIDs = OFFalse; + } + if (cmd.findOption("--overwrite-uids")) + { + app.checkDependence("--overwrite-uids", "--generate-new-uids", opt_generateUIDs); + opt_overwriteUIDs = OFTrue; + } + cmd.endOptionBlock(); + + /* output options */ + cmd.beginOptionBlock(); + if (cmd.findOption("--write-file")) + opt_writeMode = EWM_fileformat; + if (cmd.findOption("--write-dataset")) + opt_writeMode = EWM_dataset; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--write-xfer-little")) + opt_xfer = EXS_LittleEndianExplicit; + if (cmd.findOption("--write-xfer-big")) + opt_xfer = EXS_BigEndianExplicit; + if (cmd.findOption("--write-xfer-implicit")) + opt_xfer = EXS_LittleEndianImplicit; +#ifdef WITH_ZLIB + if (cmd.findOption("--write-xfer-deflated")) + opt_xfer = EXS_DeflatedLittleEndianExplicit; +#endif + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--enable-new-vr")) + dcmEnableGenerationOfNewVRs(); + if (cmd.findOption("--disable-new-vr")) + dcmDisableGenerationOfNewVRs(); + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--group-length-recalc")) + opt_glenc = EGL_recalcGL; + if (cmd.findOption("--group-length-create")) + opt_glenc = EGL_withGL; + if (cmd.findOption("--group-length-remove")) + opt_glenc = EGL_withoutGL; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--length-explicit")) + opt_enctype = EET_ExplicitLength; + if (cmd.findOption("--length-undefined")) + opt_enctype = EET_UndefinedLength; + cmd.endOptionBlock(); + + cmd.beginOptionBlock(); + if (cmd.findOption("--padding-retain")) + { + app.checkConflict("--padding-retain", "--write-dataset", opt_writeMode == EWM_dataset); + opt_padenc = EPD_noChange; + } + if (cmd.findOption("--padding-off")) + opt_padenc = EPD_withoutPadding; + if (cmd.findOption("--padding-create")) + { + app.checkConflict("--padding-create", "--write-dataset", opt_writeMode == EWM_dataset); + app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0)); + app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0)); + opt_padenc = EPD_withPadding; + } + cmd.endOptionBlock(); + +#ifdef WITH_ZLIB + if (cmd.findOption("--compression-level")) + { + OFCmdUnsignedInt comprLevel = 0; + app.checkDependence("--compression-level", "--write-xfer-deflated", opt_xfer == EXS_DeflatedLittleEndianExplicit); + app.checkValue(cmd.getValueAndCheckMinMax(comprLevel, 0, 9)); + dcmZlibCompressionLevel.set(OFstatic_cast(int, comprLevel)); + } +#endif + + /* check conflicts and dependencies */ + if (opt_readFlags & DSRTypes::XF_validateSchema) + app.checkConflict("--validate-schema", "--template-envelope", (opt_readFlags & DSRTypes::XF_templateElementEnclosesItems) > 0); + } + + /* print resource identifier */ + OFLOG_DEBUG(xml2dsrLogger, rcsid << OFendl); + + /* make sure data dictionary is loaded */ + if (!dcmDataDict.isDictionaryLoaded()) + { + OFLOG_WARN(xml2dsrLogger, "no data dictionary loaded, check environment variable: " + << DCM_DICT_ENVIRONMENT_VARIABLE); + } + + /* check for compatible libxml version */ + LIBXML_TEST_VERSION + /* initialize the XML library (only required for MT-safety) */ + xmlInitParser(); + + OFCondition result = EC_Normal; + const char *opt_ifname = NULL; + const char *opt_ofname = NULL; + cmd.getParam(1, opt_ifname); + cmd.getParam(2, opt_ofname); + + /* check filenames */ + if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0)) + { + OFLOG_FATAL(xml2dsrLogger, OFFIS_CONSOLE_APPLICATION << ": invalid input filename: "); + result = EC_IllegalParameter; + } + if ((opt_ofname == NULL) || (strlen(opt_ofname) == 0)) + { + OFLOG_FATAL(xml2dsrLogger, OFFIS_CONSOLE_APPLICATION << ": invalid output filename: "); + result = EC_IllegalParameter; + } + + if (result.good()) + { + /* create new SR document */ + DSRDocument *dsrdoc = new DSRDocument(); + if (dsrdoc != NULL) + { + DcmFileFormat fileformat; +#ifdef LIBXML_SCHEMAS_ENABLED + if (opt_readFlags & DSRTypes::XF_validateSchema) + OFLOG_INFO(xml2dsrLogger, "reading and validating XML input file: " << opt_ifname); + else +#endif + OFLOG_INFO(xml2dsrLogger, "reading XML input file: " << opt_ifname); + /* read XML file and feed data into DICOM fileformat */ + result = dsrdoc->readXML(opt_ifname, opt_readFlags); + if (result.good()) + { + DcmDataset *dataset = fileformat.getDataset(); + OFLOG_INFO(xml2dsrLogger, "writing DICOM SR output file: " << opt_ofname); + /* write SR document to dataset */ + result = dsrdoc->write(*dataset); + /* generate new UIDs (if required) */ + if (opt_generateUIDs) + { + char uid[100]; + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_StudyInstanceUID)) + { + OFLOG_INFO(xml2dsrLogger, "generating new Study Instance UID"); + dataset->putAndInsertString(DCM_StudyInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT)); + } + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_SeriesInstanceUID)) + { + OFLOG_INFO(xml2dsrLogger, "generating new Series Instance UID"); + dataset->putAndInsertString(DCM_SeriesInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT)); + } + if (opt_overwriteUIDs || !dataset->tagExistsWithValue(DCM_SOPInstanceUID)) + { + OFLOG_INFO(xml2dsrLogger, "generating new SOP Instance UID"); + dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT)); + } + } + /* write DICOM file */ + if (result.good()) + { + result = fileformat.saveFile(opt_ofname, opt_xfer, opt_enctype, opt_glenc, opt_padenc, + OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad), opt_writeMode); + } + if (result.bad()) + OFLOG_FATAL(xml2dsrLogger, result.text() << ": writing file: " << opt_ofname); + } else + OFLOG_FATAL(xml2dsrLogger, result.text() << ": reading file: " << opt_ifname); + } + delete dsrdoc; + } + + /* clean up XML library before quitting */ + xmlCleanupParser(); + + return result.status(); +} + +#else /* WITH_LIBXML */ + +int main(int, char *[]) +{ + CERR << rcsid << OFendl << OFFIS_CONSOLE_DESCRIPTION << OFendl << OFendl + << OFFIS_CONSOLE_APPLICATION " requires the libxml library." << OFendl + << "This " OFFIS_CONSOLE_APPLICATION " has been configured and compiled without libxml." << OFendl + << "Please reconfigure your system and recompile if appropriate." << OFendl; + return 0; +} + +#endif /* WITH_LIBXML */ diff --git a/dcmsr/configure b/dcmsr/configure new file mode 100755 index 00000000..396668ee --- /dev/null +++ b/dcmsr/configure @@ -0,0 +1,56 @@ +#! /bin/sh + +parentdir=`pwd` +thisdir=$parentdir + +# The following test constructs relative path from the module +# directory to the configuration directory. If you know this path +# you can substitute this with +# configdir= +# It is very important that the configdir path is relative. + +configdir="configdir" + +while test "$parentdir" != "/" -a "$configdir" = "configdir"; do + if test -d "$parentdir/config" ; then + configdir=$parentdir/config + else + parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'` + fi +done + +if test "$configdir" = "configdir" ; then + echo "Cannot find configure directory" + exit 1 +fi + +if test $# != 0; then + case $1 in + -a) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + cd $thisdir + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + -c) + shift + cd "$configdir" + echo "running configure in config-directory" + ./configure $* + ;; + *) + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* + ;; + esac +else + echo "running configure for this module" + sh "$configdir/confmod" --srcdir=. $* +fi + + + + diff --git a/dcmsr/data/CMakeLists.txt b/dcmsr/data/CMakeLists.txt new file mode 100644 index 00000000..e6c175fe --- /dev/null +++ b/dcmsr/data/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(FILES dsr2xml.xsd report.css reportx.css DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data) diff --git a/dcmsr/data/Makefile.in b/dcmsr/data/Makefile.in new file mode 100644 index 00000000..0825d73c --- /dev/null +++ b/dcmsr/data/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmsr/data +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +files = dsr2xml.xsd report.css reportx.css + + +all: + +install: + $(configdir)/mkinstalldirs $(DESTDIR)$(datadir) + for file in $(files); do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(datadir) ;\ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsr/data/dsr2xml.xsd b/dcmsr/data/dsr2xml.xsd new file mode 100644 index 00000000..1c8b44c7 --- /dev/null +++ b/dcmsr/data/dsr2xml.xsd @@ -0,0 +1,1025 @@ + + + + + + + + + XML Schema for DCMTK tools dsr2xml and xml2dsr. + Copyright (C) 2003-2019, OFFIS e.V. and J. Riesmeier + All rights reserved. See COPYRIGHT file for details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dcmsr/data/report.css b/dcmsr/data/report.css new file mode 100644 index 00000000..dcf03b3b --- /dev/null +++ b/dcmsr/data/report.css @@ -0,0 +1,91 @@ +/* Copyright (C) 2000-2010, OFFIS e.V. + All rights reserved. See COPYRIGHT file for details. + Sample CSS for HTML output of "dsr2html" +*/ + +body { + background-color: #dddddd; + font-family: sans-serif; +} + +h1, h2, h3, h4, h5, h6 { + background-color: #000099; + color: white; + width: 100%; +} + +h1 { + padding: 4px; + font-size: x-large; + font-weight: bold; +} + +h2 { + padding: 3px; + font-size: large; +} + +h3, h4, h5, h6 { + padding: 2px; +} + +h4, h5, h6 { + font-size: medium; +} + +h2 a[name] { + color: white; + text-decoration: none; +} + +div { + background-color: white; + text-align: justify; +} + +div small { + width: 100%; + color: black; + text-align: left; +} + +td { + background-color: #ccccff; + font-family: sans-serif; + padding: 4px; +} + +a[href] { + color: maroon; +} + +a:hover { + color: red; +} + +a[name]:hover { + text-decoration: underline; +} + +div.footnote { + background-color: #dddddd; + color: gray; +} + +div.footnote a, div.footnote small { + color: gray; +} + +div.footnote a:hover { + color: black; +} + +span.under { + text-decoration: underline; +} + +hr { + color: silver; + background: transparent; + border: thin; +} diff --git a/dcmsr/data/reportx.css b/dcmsr/data/reportx.css new file mode 100644 index 00000000..56b34fa0 --- /dev/null +++ b/dcmsr/data/reportx.css @@ -0,0 +1,104 @@ +/* Copyright (C) 2000-2010, OFFIS e.V. + All rights reserved. See COPYRIGHT file for details. + Sample CSS for XHTML output of "dsr2html" +*/ + +body { + background-color: #dddddd; + font-family: sans-serif; +} + +h1, h2, h3, h4, h5, h6 { + background-color: #000099; + color: white; + width: 100%; +} + +h1 { + padding: 4px; + font-size: x-large; + font-weight: bold; +} + +h2 { + padding: 3px; + font-size: large; +} + +h3, h4, h5, h6 { + padding: 2px; +} + +h4, h5, h6 { + font-size: medium; +} + +h2 a[id] { + color: white; + text-decoration: none; +} + +td { + background-color: #ccccff; + font-family: sans-serif; + padding: 4px; +} + +a[href] { + color: maroon; +} + +a:hover { + color: red; +} + +a[id]:hover { + text-decoration: underline; +} + +div.para { + background-color: white; + text-align: justify; + margin-bottom: 1em; +} + +div.small { + width: 100%; + color: black; + text-align: left; + font-size: small; +} + +div.footnote { + background-color: #dddddd; + color: gray; + font-size: small; +} + +div.footnote a { + color: gray; +} + +div.footnote a:hover { + color: black; +} + +span.under, span.relation, span.date, span.time, span.datetime, span.pname, span.num, span.code { + text-decoration: underline; +} + +span.observe { + color: gray; + font-size: small; +} + +span.super { + font-size: x-small; + vertical-align: super; +} + +hr { + color: silver; + background: transparent; + border: thin; +} diff --git a/dcmsr/docs/Makefile.in b/dcmsr/docs/Makefile.in new file mode 100644 index 00000000..270d58d7 --- /dev/null +++ b/dcmsr/docs/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmsr/docs +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsr/docs/dcmsr.dox b/dcmsr/docs/dcmsr.dox new file mode 100644 index 00000000..2b70bd8b --- /dev/null +++ b/dcmsr/docs/dcmsr.dox @@ -0,0 +1,178 @@ +/*! + +\page mod_dcmsr dcmsr: a structured reporting library and utility apps + +This module contains classes to read, write, create, modify, access, print and +render DICOM Structured Reporting (SR) documents. The list of supported SOP +classes is provided in DSRTypes::E_DocumentType. + +The main interface classes are: +\li \b DSRDocument +\li \b DSRDocumentTree +\li \b DSRDocumentSubTree +\li \b DSRDocumentTreeNode +\li \b DSRContentItem +\li \b DSRCodedEntryValue + +Here are some further classes that are useful when implementing SR templates: +\li \b DSRBasicCodedEntry +\li \b DSRContextGroup +\li \b DSRRootTemplate +\li \b DSRSubTemplate + +Currently, the following SR templates are implemented (see notes for details): +\li \b TID300_Measurement +\li \b TID1001_ObservationContext +\li \b TID1204_LanguageOfContentItemAndDescendants +\li \b TID1411_VolumetricROIMeasurements +\li \b TID1419_ROIMeasurements_Measurement +\li \b TID1500_MeasurementReport +\li \b TID1501_MeasurementGroup +\li \b TID1600_ImageLibrary +\li \b TID4019_AlgorithmIdentification + +\section Tools + +This module contains the following command line tools: +\li \ref dsr2html +\li \ref dsr2xml +\li \ref dsrdump +\li \ref xml2dsr + +\section Examples + +The following example shows how to load a DICOM Structured Report and render +its content in HTML format: + +\code +DcmFileFormat fileformat; +OFCondition status = fileformat.loadFile("test.dcm"); +if (status.good()) +{ + DSRDocument document; + status = document.read(*fileformat.getDataset()); + if (status.good()) + { + status = document.renderHTML(cout); + if (status.bad()) + cerr << "Error: cannot render SR document (" << status.text() << ")" << endl; + } else + cerr << "Error: cannot read SR document (" << status.text() << ")" << endl; +} else + cerr << "Error: cannot load DICOM file (" << status.text() << ")" << endl; +\endcode + +The following example shows how to create a DICOM Structured Report and save +it to a file (further details can be found in the \ref src_mkreport "mkreport" +source file): + +\code +DSRDocument document; +document.setPatientName("Doe^John"); +/* ... */ +DSRDocumentTree &tree = document.getTree(); +tree.addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container); +tree.getCurrentContentItem().setConceptName(DSRCodedEntryValue(/* some code */)); +tree.addChildContentItem(DSRTypes::RT_hasObsContext, DSRTypes::VT_Code, CODE_DCM_ObserverType); +tree.getCurrentContentItem().setCodeValue(CODE_DCM_Person); +/* ... */ +DcmFileFormat fileformat; +OFCondition status = document.write(*fileformat.getDataset()) +if (status.good()) +{ + status = fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit); + if (status.bad()) + cerr << "Error: cannot save DICOM file (" << status.text() << ")" << endl; +} else + cerr << "Error: cannot write SR document (" << status.text() << ")" << endl; +\endcode + +Alternatively, many properties of the document tree can be accessed and +modified directly as the following example shows: + +\code +DSRDocument document(DSRTypes::DT_KeyObjectSelectionDocument); +/* ... */ +DSRDocumentTree &tree = document.getTree(); +tree.addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container); +DSRCodedEntryValue *codePtr = tree.getCurrentContentItem().getConceptNamePtr(); +if (codePtr != NULL) + codePtr->setCode("113000", "DCM", "Of Interest"); +/* ... */ +tree.addContentItem(DSRTypes::RT_contains, DSRTypes::VT_Image); +DSRImageReferenceValue *imagePtr = tree.getCurrentContentItem().getImageReferencePtr(); +if (imagePtr != NULL) +{ + imagePtr->setValue(DSRImageReferenceValue(UID_UltrasoundMultiframeImageStorage, /* image UID */)); + imagePtr->setPresentationState(DSRCompositeReferenceValue(UID_GrayscaleSoftcopyPresentationStateStorage, /* GSPS UID */)); + imagePtr->getFrameList().addItem(2); + imagePtr->getFrameList().addItem(5); +} +/* ... */ +\endcode + +In addition, there are specific DSRDocumentTree::addContentItem() and +DSRDocumentTree::addChildContentItem() methods that expect a pointer to a newly +created DSRDocumentTreeNode instance. + +Iterating over a document tree and searching for content items that meet +certain criteria can be achieved in various ways. Here are two of them: + +\code +DSRDocument document; +/* ... */ +DSRDocumentTree &tree = document.getTree(); +/* #1: search for content items with a certain concept name */ +if (tree.gotoNamedNode(CODE_DCM_ProcedureReported)) +{ + do { + const DSRDocumentTreeNode *node = tree.getNode(); + /* and check for expected value type */ + if ((node != NULL) && (node->getValueType() == DSRTypes::VT_Code)) + { + /* do something useful with the CODE content item */ + } + } while (tree.gotoNextNamedNode(CODE_DCM_ProcedureReported, OFFalse /*searchIntoSub*/)); +} +/* #2: search for content items using a more complex filter */ +DSRDocumentTreeNodeAndFilter filter; +filter.addFilter(new DSRDocumentTreeNodeValueTypeFilter(DSRTypes::VT_Code)); +filter.addFilter(new DSRDocumentTreeNodeRelationshipTypeFilter(DSRTypes::RT_hasConceptMod)); +filter.addFilter(new DSRDocumentTreeNodeHasChildrenFilter()); +if (tree.gotoMatchingNode(filter)) +{ + /* found first "has concept mod CODE" content item that has children */ +} +\endcode + +The final example shows how to deal with SR templates, e.g. when creating a +DICOM Structured Report that is based on TID 1500 (Measurement Report): + +\code +TID1500_MeasurementReport report(CMR_CID7021::ImagingMeasurementReport); +report.setLanguage(CID5000_Languages::English); +report.getObservationContext().addPersonObserver("Doe^Jane", "Some Organization"); +/* ... */ +CMR_TID1411_in_TID1500 &volumetric = report.getVolumetricROIMeasurements(); +volumetric.setActivitySession("1"); +volumetric.setTrackingIdentifier("aorta reference region"); +/* ... */ +CMR_TID1419_in_TID1411_in_TID1500 &measurement = volumetric.getMeasurement(); +measurement.createNewMeasurement(CMR_CID7469::Volume, CMR_TID1419_in_TID1411_in_TID1500::MeasurementValue("15", CMR_CID7181::CubicMillimeter)); +measurement.setDerivation(CMR_CID7464::StandardDeviation); +/* ... */ +DSRDocument document; +document.setPatientName("Last Name^First Name"); +/* ... */ +if (document.setTreeFromRootTemplate(report).good()) + document.print(cout, DSRTypes::PF_printTemplateIdentification); +else + cerr << "Error: cannot set template content as document tree" << endl; +\endcode + +*/ + +/*! + \page src_mkreport mkreport source code + \include mkreport.cc +*/ diff --git a/dcmsr/docs/dsr2html.man b/dcmsr/docs/dsr2html.man new file mode 100644 index 00000000..1a62fb1a --- /dev/null +++ b/dcmsr/docs/dsr2html.man @@ -0,0 +1,361 @@ +/*! + +\if MANPAGES +\page dsr2html Render DICOM SR file and data set to HTML/XHTML +\else +\page dsr2html dsr2html: Render DICOM SR file and data set to HTML/XHTML +\endif + +\section dsr2html_synopsis SYNOPSIS + +\verbatim +dsr2html [options] dsrfile-in [htmlfile-out] +\endverbatim + +\section dsr2html_description DESCRIPTION + +The \b dsr2html utility renders the contents of a DICOM Structured Reporting +(SR) document (file format or raw data set) to HTML (Hyper Text Markup +Language) version 3.2 or 4.01 as well as to XHTML (Extensible Hyper Text Markup +Language) version 1.1. + +If \b dsr2html reads a raw data set (DICOM data without a file format +meta-header) it will attempt to guess the transfer syntax by examining the +first few bytes of the file. It is not always possible to correctly guess the +transfer syntax and it is better to convert a data set to a file format +whenever possible (using the \b dcmconv utility). It is also possible to use +the \e -f and -t[ieb] options to force \b dsr2html to read a dataset +with a particular transfer syntax. + +\section dsr2html_parameters PARAMETERS + +\verbatim +dsrfile-in DICOM SR input filename to be rendered + +htmlfile-out HTML/XHTML output filename (default: stdout) +\endverbatim + +\section dsr2html_options OPTIONS + +\subsection dsr2html_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dsr2html_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dsr2html_processing_options processing options +\verbatim +additional information: + + -Ip --processing-details + show currently processed content item + +error handling: + + -Er --unknown-relationship + accept unknown/missing relationship type + + -Ev --invalid-item-value + accept invalid content item value + (e.g. violation of VR or VM definition) + + -Ec --ignore-constraints + ignore relationship content constraints + + -Ee --ignore-item-errors + do not abort on content item errors, just warn + (e.g. missing value type specific attributes) + + -Ei --skip-invalid-items + skip invalid content items (incl. sub-tree) + + -Dv --disable-vr-checker + disable check for VR-conformant string values + +specific character set: + + +Cr --charset-require + require declaration of extended charset (default) + + +Ca --charset-assume [c]harset: string + assume charset c if no extended charset declared + + --charset-check-all + check all data elements with string values + (default: only PN, LO, LT, SH, ST, UC and UT) + + # this option is only used for the mapping to an appropriate + # HTML/XHTML character encoding, but not for the conversion + # to UTF-8 + + +U8 --convert-to-utf8 + convert all element values that are affected + by Specific Character Set (0008,0005) to UTF-8 + + # requires support from an underlying character encoding library + # (see output of --version on which one is available) +\endverbatim + +\subsection dsr2html_output_options output options +\verbatim +HTML/XHTML compatibility: + + +H3 --html-3.2 + use only HTML version 3.2 compatible features + + +H4 --html-4.0 + allow all HTML version 4.01 features (default) + + +X1 --xhtml-1.1 + comply with XHTML version 1.1 specification + + +Hd --add-document-type + add reference to SGML document type definition + +cascading style sheet (CSS), not with HTML 3.2: + + +Sr --css-reference URL: string + add reference to specified CSS to document + + +Sf --css-file [f]ilename: string + embed content of specified CSS into document + +general rendering: + + +Ri --expand-inline + expand short content items inline (default) + + -Ri --never-expand-inline + never expand content items inline + + +Ra --always-expand-inline + always expand content items inline + + +Rd --render-full-data + render full data of content items + + +Rt --section-title-inline + render section titles inline, not separately + +document rendering: + + +Dt --document-type-title + use document type as document title (default) + + +Dp --patient-info-title + use patient information as document title + + -Dh --no-document-header + do not render general document information + +code rendering: + + +Ci --render-inline-codes + render codes in continuous text blocks + + +Cn --concept-name-codes + render code of concept names + + +Cu --numeric-unit-codes + render code of numeric measurement units + + +Cv --code-value-unit + use code value as measurement unit (default) + + +Cm --code-meaning-unit + use code meaning as measurement unit + + +Cc --render-all-codes + render all codes (implies +Ci, +Cn and +Cu) + + +Ct --code-details-tooltip + render code details as a tooltip (implies +Cc) +\endverbatim + +\section dsr2html_notes NOTES + +\subsection dsr2html_dicom_conformance DICOM Conformance + +The \b dsr2html utility supports the following SOP Classes: + +\verbatim +SpectaclePrescriptionReportStorage 1.2.840.10008.5.1.4.1.1.78.6 +MacularGridThicknessAndVolumeReportStorage 1.2.840.10008.5.1.4.1.1.79.1 +BasicTextSRStorage 1.2.840.10008.5.1.4.1.1.88.11 +EnhancedSRStorage 1.2.840.10008.5.1.4.1.1.88.22 +ComprehensiveSRStorage 1.2.840.10008.5.1.4.1.1.88.33 +Comprehensive3DSRStorage 1.2.840.10008.5.1.4.1.1.88.34 +ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40 +MammographyCADSRStorage 1.2.840.10008.5.1.4.1.1.88.50 +KeyObjectSelectionDocumentStorage 1.2.840.10008.5.1.4.1.1.88.59 +ChestCADSRStorage 1.2.840.10008.5.1.4.1.1.88.65 +XRayRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.67 +RadiopharmaceuticalRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.68 +ColonCADSRStorage 1.2.840.10008.5.1.4.1.1.88.69 +ImplantationPlanSRDocumentStorage 1.2.840.10008.5.1.4.1.1.88.70 +AcquisitionContextSRStorage 1.2.840.10008.5.1.4.1.1.88.71 +SimplifiedAdultEchoSRStorage 1.2.840.10008.5.1.4.1.1.88.72 +PatientRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.73 +PlannedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.74 +PerformedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.75 +\endverbatim + +\subsection dsr2html_character_encoding Character Encoding + +The HTML/XHTML encoding is determined automatically from the DICOM attribute +(0008,0005) "Specific Character Set" using the following mapping: + +\verbatim +ASCII (ISO_IR 6) => (none) +UTF-8 "ISO_IR 192" => "UTF-8" +ISO Latin 1 "ISO_IR 100" => "ISO-8859-1" +ISO Latin 2 "ISO_IR 101" => "ISO-8859-2" +ISO Latin 3 "ISO_IR 109" => "ISO-8859-3" +ISO Latin 4 "ISO_IR 110" => "ISO-8859-4" +ISO Latin 5 "ISO_IR 148" => "ISO-8859-9" +Cyrillic "ISO_IR 144" => "ISO-8859-5" +Arabic "ISO_IR 127" => "ISO-8859-6" +Greek "ISO_IR 126" => "ISO-8859-7" +Hebrew "ISO_IR 138" => "ISO-8859-8" +Thai "ISO_IR 166" => "TIS-620" +Japanese "ISO 2022 IR 13\ISO 2022 IR 87" => "ISO-2022-JP" +Korean "ISO 2022 IR 6\ISO 2022 IR 149" => "ISO-2022-KR" +Chinese "ISO 2022 IR 6\ISO 2022 IR 58" => "ISO-2022-CN" +Chinese "GB18030" => "GB18030" +Chinese "GBK" => "GBK" +\endverbatim + +If this DICOM attribute is missing in the input file, although needed, option +\e --charset-assume can be used to specify an appropriate character set +manually (using one of the DICOM defined terms). For reasons of backward +compatibility with previous versions of this tool, the following terms are also +supported and mapped automatically to the associated DICOM defined terms: +latin-1, latin-2, latin-3, latin-4, latin-5, cyrillic, arabic, greek, hebrew. + +Option \e --convert-to-utf8 can be used to convert the DICOM file or data set +to UTF-8 encoding prior to the rendering to HTML/XHTML format. + +\section dsr2html_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dsr2html_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dsr2html_environment ENVIRONMENT + +The \b dsr2html utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dsr2html_files FILES + +\/report.css - Sample Cascading Stylesheet file for HTML +\/reportx.css - Sample Cascading Stylesheet file for XHTML + +\section dsr2html_see_also SEE ALSO + +dcmconv(1) + +\section dsr2html_copyright COPYRIGHT + +Copyright (C) 2000-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmsr/docs/dsr2xml.man b/dcmsr/docs/dsr2xml.man new file mode 100644 index 00000000..233d1168 --- /dev/null +++ b/dcmsr/docs/dsr2xml.man @@ -0,0 +1,349 @@ +/*! + +\if MANPAGES +\page dsr2xml Convert DICOM SR file and data set to XML +\else +\page dsr2xml dsr2xml: Convert DICOM SR file and data set to XML +\endif + +\section dsr2xml_synopsis SYNOPSIS + +\verbatim +dsr2xml [options] dsrfile-in [xmlfile-out] +\endverbatim + +\section dsr2xml_description DESCRIPTION + +The \b dsr2xml utility converts the contents of a DICOM Structured Reporting +(SR) document (file format or raw data set) to XML (Extensible Markup +Language). The XML Schema dsr2xml.xsd does not yet follow any +standard format. However, the \b dsr2xml application might be enhanced in +this aspect in the future (e.g. by supporting HL7/CDA - Clinical Document +Architecture). + +If \b dsr2xml reads a raw data set (DICOM data without a file format +meta-header) it will attempt to guess the transfer syntax by examining the +first few bytes of the file. It is not always possible to correctly guess the +transfer syntax and it is better to convert a data set to a file format +whenever possible (using the \b dcmconv utility). It is also possible to use +the \e -f and -t[ieb] options to force \b dsr2xml to read a dataset +with a particular transfer syntax. + +\section dsr2xml_parameters PARAMETERS + +\verbatim +dsrfile-in DICOM SR input filename to be converted + +xmlfile-out XML output filename (default: stdout) +\endverbatim + +\section dsr2xml_options OPTIONS + +\subsection dsr2xml_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dsr2xml_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dsr2xml_processing_options processing options +\verbatim +error handling: + + -Er --unknown-relationship + accept unknown/missing relationship type + + -Ev --invalid-item-value + accept invalid content item value + (e.g. violation of VR or VM definition) + + -Ec --ignore-constraints + ignore relationship content constraints + + -Ee --ignore-item-errors + do not abort on content item errors, just warn + (e.g. missing value type specific attributes) + + -Ei --skip-invalid-items + skip invalid content items (including sub-tree) + + -Dv --disable-vr-checker + disable check for VR-conformant string values + +specific character set: + + +Cr --charset-require + require declaration of extended charset (default) + + +Ca --charset-assume [c]harset: string + assume charset c if no extended charset declared + + +Cc --charset-check-all + check all data elements with string values + (default: only PN, LO, LT, SH, ST, UC and UT) + + # this option is only used for the mapping to an appropriate + # XML character encoding, but not for the conversion to UTF-8 + + +U8 --convert-to-utf8 + convert all element values that are affected + by Specific Character Set (0008,0005) to UTF-8 + + # requires support from an underlying character encoding library + # (see output of --version on which one is available) +\endverbatim + +\subsection dsr2xml_output_options output options +\verbatim +encoding: + + +Ea --attr-all + encode everything as XML attribute + (shortcut for +Ec, +Er, +Ev and +Et) + + +Ec --attr-code + encode code value, coding scheme designator + and coding scheme version as XML attribute + + +Er --attr-relationship + encode relationship type as XML attribute + + +Ev --attr-value-type + encode value type as XML attribute + + +Et --attr-template-id + encode template id as XML attribute + + +Ee --template-envelope + template element encloses content items + (requires +Wt, implies +Et) + +XML structure: + + +Xs --add-schema-reference + add reference to XML Schema "dsr2xml.xsd" + (not with +Ea, +Ec, +Er, +Ev, +Et, +Ee, +We) + + +Xn --use-xml-namespace + add XML namespace declaration to root element + +writing: + + +We --write-empty-tags + write all tags even if their value is empty + + +Wi --write-item-id + always write item identifier + + +Wt --write-template-id + write template identification information +\endverbatim + +\section dsr2xml_notes NOTES + +\subsection dsr2xml_dicom_conformance DICOM Conformance + +The \b dsr2xml utility supports the following SOP Classes: + +\verbatim +SpectaclePrescriptionReportStorage 1.2.840.10008.5.1.4.1.1.78.6 +MacularGridThicknessAndVolumeReportStorage 1.2.840.10008.5.1.4.1.1.79.1 +BasicTextSRStorage 1.2.840.10008.5.1.4.1.1.88.11 +EnhancedSRStorage 1.2.840.10008.5.1.4.1.1.88.22 +ComprehensiveSRStorage 1.2.840.10008.5.1.4.1.1.88.33 +Comprehensive3DSRStorage 1.2.840.10008.5.1.4.1.1.88.34 +ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40 +MammographyCADSRStorage 1.2.840.10008.5.1.4.1.1.88.50 +KeyObjectSelectionDocumentStorage 1.2.840.10008.5.1.4.1.1.88.59 +ChestCADSRStorage 1.2.840.10008.5.1.4.1.1.88.65 +XRayRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.67 +RadiopharmaceuticalRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.68 +ColonCADSRStorage 1.2.840.10008.5.1.4.1.1.88.69 +ImplantationPlanSRDocumentStorage 1.2.840.10008.5.1.4.1.1.88.70 +AcquisitionContextSRStorage 1.2.840.10008.5.1.4.1.1.88.71 +SimplifiedAdultEchoSRStorage 1.2.840.10008.5.1.4.1.1.88.72 +PatientRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.73 +PlannedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.74 +PerformedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.75 +\endverbatim + +Please note that currently only mandatory and some optional attributes are +supported. + +\subsection dsr2xml_character_encoding Character Encoding + +The XML encoding is determined automatically from the DICOM attribute +(0008,0005) "Specific Character Set" using the following mapping: + +\verbatim +ASCII (ISO_IR 6) => "UTF-8" +UTF-8 "ISO_IR 192" => "UTF-8" +ISO Latin 1 "ISO_IR 100" => "ISO-8859-1" +ISO Latin 2 "ISO_IR 101" => "ISO-8859-2" +ISO Latin 3 "ISO_IR 109" => "ISO-8859-3" +ISO Latin 4 "ISO_IR 110" => "ISO-8859-4" +ISO Latin 5 "ISO_IR 148" => "ISO-8859-9" +Cyrillic "ISO_IR 144" => "ISO-8859-5" +Arabic "ISO_IR 127" => "ISO-8859-6" +Greek "ISO_IR 126" => "ISO-8859-7" +Hebrew "ISO_IR 138" => "ISO-8859-8" +Thai "ISO_IR 166" => "TIS-620" +Japanese "ISO 2022 IR 13\ISO 2022 IR 87" => "ISO-2022-JP" +Korean "ISO 2022 IR 6\ISO 2022 IR 149" => "ISO-2022-KR" +Chinese "ISO 2022 IR 6\ISO 2022 IR 58" => "ISO-2022-CN" +Chinese "GB18030" => "GB18030" +Chinese "GBK" => "GBK" +\endverbatim + +If this DICOM attribute is missing in the input file, although needed, option +\e --charset-assume can be used to specify an appropriate character set +manually (using one of the DICOM defined terms). For reasons of backward +compatibility with previous versions of this tool, the following terms are also +supported and mapped automatically to the associated DICOM defined terms: +latin-1, latin-2, latin-3, latin-4, latin-5, cyrillic, arabic, greek, hebrew. + +Option \e --convert-to-utf8 can be used to convert the DICOM file or data set +to UTF-8 encoding prior to the conversion to XML format. + +If no mapping is defined and option \e --convert-to-utf8 is not used, non-ASCII +characters and those below #32 are stored as "&#nnn;" where "nnn" refers to the +numeric character code. This might lead to invalid character entity references +(such as "" for ESC) and will cause most XML parsers to reject the document. + +\subsection dsr2xml_error_handling Error Handling + +Please be careful with the processing options \e --unknown-relationship, +\e --invalid-item-value, \e --ignore-constraints, \e --ignore-item-errors and +\e --skip-invalid-items since they disable certain validation checks on the +DICOM SR input file and, therefore, might result in non-standard conformant +output. However, there might be reasons for using one or more of these +options, e.g. in order to read and process an incorrectly encoded SR document. + +\subsection dsr2xml_limitations Limitations + +The XML Schema dsr2xml.xsd does not support all variations of the +\b dsr2xml output format. However, the default output format (plus option +\e --use-xml-namespace) should work. + +\section dsr2xml_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dsr2xml_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dsr2xml_environment ENVIRONMENT + +The \b dsr2xml utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dsr2xml_files FILES + +\/dsr2xml.xsd - XML Schema file + +\section dsr2xml_see_also SEE ALSO + +xml2dsr(1), dcmconv(1) + +\section dsr2xml_copyright COPYRIGHT + +Copyright (C) 2000-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmsr/docs/dsrdump.man b/dcmsr/docs/dsrdump.man new file mode 100644 index 00000000..56dac7a3 --- /dev/null +++ b/dcmsr/docs/dsrdump.man @@ -0,0 +1,299 @@ +/*! + +\if MANPAGES +\page dsrdump Dump DICOM SR file and data set +\else +\page dsrdump dsrdump: Dump DICOM SR file and data set +\endif + +\section dsrdump_synopsis SYNOPSIS + +\verbatim +dsrdump [options] dsrfile-in... +\endverbatim + +\section dsrdump_description DESCRIPTION + +The \b dsrdump utility dumps the contents of a DICOM Structured Reporting (SR) +document (file format or raw data set) to stdout in textual form. The output +of the document content follows the format proposed in David Clunie's book +"DICOM Structured Reporting" (PixelMed Publishing, 2000). + +If \b dsrdump reads a raw data set (DICOM data without a file format +meta-header) it will attempt to guess the transfer syntax by examining the +first few bytes of the file. It is not always possible to correctly guess the +transfer syntax and it is better to convert a data set to a file format +whenever possible (using the \b dcmconv utility). It is also possible to use +the \e -f and -t[ieb] options to force \b dsrdump to read a dataset +with a particular transfer syntax. + +\section dsrdump_parameters PARAMETERS + +\verbatim +dsrfile-in DICOM SR input filename to be dumped +\endverbatim + +\section dsrdump_options OPTIONS + +\subsection dsrdump_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection dsrdump_input_options input options +\verbatim +input file format: + + +f --read-file + read file format or data set (default) + + +fo --read-file-only + read file format only + + -f --read-dataset + read data set without file meta information + +input transfer syntax: + + -t= --read-xfer-auto + use TS recognition (default) + + -td --read-xfer-detect + ignore TS specified in the file meta header + + -te --read-xfer-little + read with explicit VR little endian TS + + -tb --read-xfer-big + read with explicit VR big endian TS + + -ti --read-xfer-implicit + read with implicit VR little endian TS +\endverbatim + +\subsection dsrdump_processing_options processing options +\verbatim +additional information: + + -Ip --processing-details + show currently processed content item + +error handling: + + -Er --unknown-relationship + accept unknown/missing relationship type + + -Ev --invalid-item-value + accept invalid content item value + (e.g. violation of VR or VM definition) + + -Ec --ignore-constraints + ignore relationship content constraints + + -Ee --ignore-item-errors + do not abort on content item errors, just warn + (e.g. missing value type specific attributes) + + -Ei --skip-invalid-items + skip invalid content items (including sub-tree) + + -Dv --disable-vr-checker + disable check for VR-conformant string values + +specific character set: + + +U8 --convert-to-utf8 + convert all element values that are affected + by Specific Character Set (0008,0005) to UTF-8 + + # requires support from an underlying character encoding library + # (see output of --version on which one is available) +\endverbatim + +\subsection dsrdump_output_options output options +\verbatim +general printing: + + +Pf --print-filename + print header with filename for each document + + -Ph --no-document-header + do not print general document information + + +Pn --number-nested-items + print position string in front of each line + + -Pn --indent-nested-items + indent nested items by spaces (default) + +printing values: + + +Pl --print-long-values + print long item values completely + + -Pl --shorten-long-values + print long item values shortened (default) + + +Pu --print-instance-uid + print SOP instance UID of referenced objects + + -Ps --print-sopclass-short + print short SOP class name of referenced image objects, + e.g. "CT image" (default) + + +Ps --print-sopclass-long + print long SOP class name of referenced objects + + +Psu --print-sopclass-uid + print SOP class UID of referenced objects + + +Pc --print-all-codes + print all codes (including concept name codes) + + +Pi --print-invalid-codes + print invalid codes (for debugging purposes) + + -Pi --no-invalid-codes + print text "invalid code" instead (default) + + +Pt --print-template-id + print template identification information + +enhanced encoding mode: + + +Pe --indicate-enhanced + indicate that enhanced mode is used for codes + + -Pe --no-enhanced-mode + do not indicate enhanced mode (default) + +color: + + +C --print-color + use ANSI escape codes for colored output + + # not available on Windows systems + + -C --no-color + do not use any ANSI escape codes (default) + + # not available on Windows systems +\endverbatim + +\section dsrdump_notes NOTES + +\subsection dsrdump_dicom_conformance DICOM Conformance + +The \b dsrdump utility supports the following SOP Classes: + +\verbatim +SpectaclePrescriptionReportStorage 1.2.840.10008.5.1.4.1.1.78.6 +MacularGridThicknessAndVolumeReportStorage 1.2.840.10008.5.1.4.1.1.79.1 +BasicTextSRStorage 1.2.840.10008.5.1.4.1.1.88.11 +EnhancedSRStorage 1.2.840.10008.5.1.4.1.1.88.22 +ComprehensiveSRStorage 1.2.840.10008.5.1.4.1.1.88.33 +Comprehensive3DSRStorage 1.2.840.10008.5.1.4.1.1.88.34 +ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40 +MammographyCADSRStorage 1.2.840.10008.5.1.4.1.1.88.50 +KeyObjectSelectionDocumentStorage 1.2.840.10008.5.1.4.1.1.88.59 +ChestCADSRStorage 1.2.840.10008.5.1.4.1.1.88.65 +XRayRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.67 +RadiopharmaceuticalRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.68 +ColonCADSRStorage 1.2.840.10008.5.1.4.1.1.88.69 +ImplantationPlanSRDocumentStorage 1.2.840.10008.5.1.4.1.1.88.70 +AcquisitionContextSRStorage 1.2.840.10008.5.1.4.1.1.88.71 +SimplifiedAdultEchoSRStorage 1.2.840.10008.5.1.4.1.1.88.72 +PatientRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.73 +PlannedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.74 +PerformedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.75 +\endverbatim + +\section dsrdump_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section dsrdump_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section dsrdump_environment ENVIRONMENT + +The \b dsrdump utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section dsrdump_see_also SEE ALSO + +dcmconv(1) + +\section dsrdump_copyright COPYRIGHT + +Copyright (C) 2000-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmsr/docs/xml2dsr.man b/dcmsr/docs/xml2dsr.man new file mode 100644 index 00000000..e73e6f67 --- /dev/null +++ b/dcmsr/docs/xml2dsr.man @@ -0,0 +1,315 @@ +/*! + +\if MANPAGES +\page xml2dsr Convert XML document to DICOM SR file +\else +\page xml2dsr xml2dsr: Convert XML document to DICOM SR file +\endif + +\section xml2dsr_synopsis SYNOPSIS + +\verbatim +xml2dsr [options] xmlfile-in dsrfile-out +\endverbatim + +\section xml2dsr_description DESCRIPTION + +The \b xml2dsr utility converts the contents of an XML (Extensible Markup +Language) document to DICOM Structured Reporting (SR) format (file format +or raw data set). The XML Schema dsr2xml.xsd does not yet follow +any standard format. However, the \b xml2dsr application might be enhanced +in this aspect in the future (e. g. by supporting HL7/CDA - Clinical +Document Architecture). + +An appropriate XML file can be created using the \b dsr2xml tool (option +\e +Xn recommended to add XML namespace declaration to the root element). + +\section xml2dsr_parameters PARAMETERS + +\verbatim +xmlfile-in XML input filename to be converted (stdin: "-") + +dsrfile-out DICOM SR output filename +\endverbatim + +\section xml2dsr_options OPTIONS + +\subsection xml2dsr_general_options general options +\verbatim + -h --help + print this help text and exit + + --version + print version information and exit + + --arguments + print expanded command line arguments + + -q --quiet + quiet mode, print no warnings and errors + + -v --verbose + verbose mode, print processing details + + -d --debug + debug mode, print debug information + + -ll --log-level [l]evel: string constant + (fatal, error, warn, info, debug, trace) + use level l for the logger + + -lc --log-config [f]ilename: string + use config file f for the logger +\endverbatim + +\subsection xml2dsr_input_options input options +\verbatim +encoding: + + +Ee --template-envelope + template element encloses content items +\endverbatim + +\subsection xml2dsr_processing_options processing options +\verbatim +validation: + + +Vs --validate-schema + validate XML document against Schema + (not with --template-envelope) + + # requires libxml to be compiled with XML Schema support + + +Vn --check-namespace + check XML namespace in document root + +unique identifiers: + + +Ug --generate-new-uids + generate new Study/Series/SOP Instance UID + + -Uo --dont-overwrite-uids + do not overwrite existing UIDs (default) + + +Uo --overwrite-uids + overwrite existing UIDs +\endverbatim + +\subsection xml2dsr_output_options output options +\verbatim +output file format: + + +F --write-file + write file format (default) + + -F --write-dataset + write data set without file meta information + +output transfer syntax: + + +t= --write-xfer-same + write with same TS as input (default) + + +te --write-xfer-little + write with explicit VR little endian TS + + +tb --write-xfer-big + write with explicit VR big endian TS + + +ti --write-xfer-implicit + write with implicit VR little endian TS + + +td --write-xfer-deflated + write with deflated explicit VR little endian TS + +post-1993 value representations: + + +u --enable-new-vr + enable support for new VRs (UN/UT) (default) + + -u --disable-new-vr + disable support for new VRs, convert to OB + +group length encoding: + + +g= --group-length-recalc + recalculate group lengths if present (default) + + +g --group-length-create + always write with group length elements + + -g --group-length-remove + always write without group length elements + +length encoding in sequences and items: + + +e --length-explicit + write with explicit lengths (default) + + -e --length-undefined + write with undefined lengths + +data set trailing padding (not with --write-dataset): + + -p= --padding-retain + do not change padding (default if not --write-dataset) + + -p --padding-off + no padding (implicit if --write-dataset) + + +p --padding-create [f]ile-pad [i]tem-pad: integer + align file on multiple of f bytes + and items on multiple of i bytes + +deflate compression level (only with --write-xfer-deflated): + + +cl --compression-level [l]evel: integer (default: 6) + 0=uncompressed, 1=fastest, 9=best compression +\endverbatim + +\section xml2dsr_notes NOTES + +\subsection xml2dsr_dicom_conformance DICOM Conformance + +The \b xml2dsr utility supports the following SOP Classes: + +\verbatim +SpectaclePrescriptionReportStorage 1.2.840.10008.5.1.4.1.1.78.6 +MacularGridThicknessAndVolumeReportStorage 1.2.840.10008.5.1.4.1.1.79.1 +BasicTextSRStorage 1.2.840.10008.5.1.4.1.1.88.11 +EnhancedSRStorage 1.2.840.10008.5.1.4.1.1.88.22 +ComprehensiveSRStorage 1.2.840.10008.5.1.4.1.1.88.33 +Comprehensive3DSRStorage 1.2.840.10008.5.1.4.1.1.88.34 +ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40 +MammographyCADSRStorage 1.2.840.10008.5.1.4.1.1.88.50 +KeyObjectSelectionDocumentStorage 1.2.840.10008.5.1.4.1.1.88.59 +ChestCADSRStorage 1.2.840.10008.5.1.4.1.1.88.65 +XRayRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.67 +RadiopharmaceuticalRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.68 +ColonCADSRStorage 1.2.840.10008.5.1.4.1.1.88.69 +ImplantationPlanSRDocumentStorage 1.2.840.10008.5.1.4.1.1.88.70 +AcquisitionContextSRStorage 1.2.840.10008.5.1.4.1.1.88.71 +SimplifiedAdultEchoSRStorage 1.2.840.10008.5.1.4.1.1.88.72 +PatientRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.73 +PlannedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.74 +PerformedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.75 +\endverbatim + +Please note that currently only mandatory and some optional attributes are +supported. + +\subsection xml2dsr_character_encoding Character Encoding + +The DICOM character encoding is determined automatically from the element with +tag "0008,0005" (Specific Character Set) - if present. The following +character sets are currently supported (requires \b libxml to include \b iconv +support, see \e --version output): + +\verbatim +ASCII (ISO_IR 6) (UTF-8) +UTF-8 "ISO_IR 192" (UTF-8) +ISO Latin 1 "ISO_IR 100" (ISO-8859-1) +ISO Latin 2 "ISO_IR 101" (ISO-8859-2) +ISO Latin 3 "ISO_IR 109" (ISO-8859-3) +ISO Latin 4 "ISO_IR 110" (ISO-8859-4) +ISO Latin 5 "ISO_IR 148" (ISO-8859-9) +Cyrillic "ISO_IR 144" (ISO-8859-5) +Arabic "ISO_IR 127" (ISO-8859-6) +Greek "ISO_IR 126" (ISO-8859-7) +Hebrew "ISO_IR 138" (ISO-8859-8) +Thai "ISO_IR 166" (TIS-620) +Japanese "ISO 2022 IR 13\ISO 2022 IR 87" (ISO-2022-JP) +Korean "ISO 2022 IR 6\ISO 2022 IR 149" (ISO-2022-KR) +Chinese "ISO 2022 IR 6\ISO 2022 IR 58" (ISO-2022-CN) +Chinese "GB18030" (GB18030) +Chinese "GBK" (GBK) +\endverbatim + +\subsection xml2dsr_compression Compression + +If libxml is compiled with zlib support, the input file (\e xmlfile-in) can +also be compressed with ZIP, which usually results in much smaller files. See +output of option \e --version in order to check whether zlib support is +available. + +\subsection xml2dsr_limitations Limitations + +The XML Schema dsr2xml.xsd does not support all variations of the +\b dsr2xml output format. However, the default output format (plus option +\e --use-xml-namespace) should work. + +Different versions of libxml seem to have different limits for the maximum +length of an XML element value. Therefore, it should be avoided to use very +long element values. A typical limit for libxml version 2.7.3 (and above) is +10 MB for a single element value. + +\section xml2dsr_logging LOGGING + +The level of logging output of the various command line tools and underlying +libraries can be specified by the user. By default, only errors and warnings +are written to the standard error stream. Using option \e --verbose also +informational messages like processing details are reported. Option +\e --debug can be used to get more details on the internal activity, e.g. for +debugging purposes. Other logging levels can be selected using option +\e --log-level. In \e --quiet mode only fatal errors are reported. In such +very severe error events, the application will usually terminate. For more +details on the different logging levels, see documentation of module "oflog". + +In case the logging output should be written to file (optionally with logfile +rotation), to syslog (Unix) or the event log (Windows) option \e --log-config +can be used. This configuration file also allows for directing only certain +messages to a particular output stream and for filtering certain messages +based on the module or application where they are generated. An example +configuration file is provided in \/logger.cfg. + +\section xml2dsr_command_line COMMAND LINE + +All command line tools use the following notation for parameters: square +brackets enclose optional values (0-1), three trailing dots indicate that +multiple values are allowed (1-n), a combination of both means 0 to n values. + +Command line options are distinguished from parameters by a leading '+' or '-' +sign, respectively. Usually, order and position of command line options are +arbitrary (i.e. they can appear anywhere). However, if options are mutually +exclusive the rightmost appearance is used. This behavior conforms to the +standard evaluation rules of common Unix shells. + +In addition, one or more command files can be specified using an '@' sign as a +prefix to the filename (e.g. \@command.txt). Such a command argument +is replaced by the content of the corresponding text file (multiple +whitespaces are treated as a single separator unless they appear between two +quotation marks) prior to any further evaluation. Please note that a command +file cannot contain another command file. This simple but effective approach +allows one to summarize common combinations of options/parameters and avoids +longish and confusing command lines (an example is provided in file +\/dumppat.txt). + +\section xml2dsr_environment ENVIRONMENT + +The \b xml2dsr utility will attempt to load DICOM data dictionaries specified +in the \e DCMDICTPATH environment variable. By default, i.e. if the +\e DCMDICTPATH environment variable is not set, the file +\/dicom.dic will be loaded unless the dictionary is built +into the application (default for Windows). + +The default behavior should be preferred and the \e DCMDICTPATH environment +variable only used when alternative data dictionaries are required. The +\e DCMDICTPATH environment variable has the same format as the Unix shell +\e PATH variable in that a colon (":") separates entries. On Windows systems, +a semicolon (";") is used as a separator. The data dictionary code will +attempt to load each file specified in the \e DCMDICTPATH environment variable. +It is an error if no data dictionary can be loaded. + +\section xml2dsr_files FILES + +\/dsr2xml.xsd - XML Schema file + +\section xml2dsr_see_also SEE ALSO + +dsr2xml(1) + +\section xml2dsr_copyright COPYRIGHT + +Copyright (C) 2003-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. + +*/ diff --git a/dcmsr/etc/Makefile.in b/dcmsr/etc/Makefile.in new file mode 100644 index 00000000..726207e2 --- /dev/null +++ b/dcmsr/etc/Makefile.in @@ -0,0 +1,23 @@ +# +# Makefile for dcmsr/etc +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsr/include/CMakeLists.txt b/dcmsr/include/CMakeLists.txt new file mode 100644 index 00000000..436f36d8 --- /dev/null +++ b/dcmsr/include/CMakeLists.txt @@ -0,0 +1,2 @@ +# declare installation files +install(DIRECTORY dcmtk/dcmsr DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h") diff --git a/dcmsr/include/Makefile.in b/dcmsr/include/Makefile.in new file mode 100644 index 00000000..c044edca --- /dev/null +++ b/dcmsr/include/Makefile.in @@ -0,0 +1,29 @@ +# +# Makefile for dcmsr/include +# + +@SET_MAKE@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + + +all: + +install: + for dir in dcmsr dcmsr/cmr dcmsr/codes ; do \ + $(configdir)/mkinstalldirs $(DESTDIR)$(includedir)/dcmtk/$$dir ;\ + for file in dcmtk/$$dir/*.h ; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/dcmtk/$$dir ;\ + done \ + done + +clean: + rm -f $(TRASH) + +distclean: + rm -f $(DISTTRASH) diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid100.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid100.h new file mode 100644 index 00000000..17017b5d --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid100.h @@ -0,0 +1,190 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID100_QuantitativeDiagnosticImagingProcedures + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:14 by J. Riesmeier + * + */ + + +#ifndef CMR_CID100_H +#define CMR_CID100_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 100 - Quantitative Diagnostic Imaging Procedures. + * (type: extensible, version: 20190121) + */ +class DCMTK_CMR_EXPORT CID100_QuantitativeDiagnosticImagingProcedures + : public DSRContextGroup +{ + + public: + + /** types of quantitative diagnostic imaging procedures + */ + enum EnumType + { + /// (363679005,SCT,"Imaging procedure") + ImagingProcedure, + /// (258177008,SCT,"Magnetic resonance imaging guidance") + MagneticResonanceImagingGuidance, + /// (126020,DCM,"Multiparametric MRI") + MultiparametricMRI, + /// (126021,DCM,"Multiparametric MRI of prostate") + MultiparametricMRIOfProstate, + /// (126022,DCM,"Multiparametric MRI of whole body") + MultiparametricMRIOfWholeBody, + /// (433139009,SCT,"Dynamic magnetic resonance imaging of knee") + DynamicMagneticResonanceImagingOfKnee, + /// (446315002,SCT,"Dynamic magnetic resonance imaging of pelvis") + DynamicMagneticResonanceImagingOfPelvis, + /// (25045-6,LN,"CT unspecified body region") + CTUnspecifiedBodyRegion, + /// (25056-3,LN,"MRI unspecified body region") + MRIUnspecifiedBodyRegion, + /// (49118-3,LN,"NM unspecified body region") + NMUnspecifiedBodyRegion, + /// (44136-0,LN,"PET unspecified body region") + PETUnspecifiedBodyRegion, + /// (44139-4,LN,"PET whole body") + PETWholeBody, + /// (443271005,SCT,"PET/CT FDG imaging of whole body") + PETCT_FDGImagingOfWholeBody, + /// (443844003,SCT,"PET/CT MET imaging of whole body") + PETCT_METImagingOfWholeBody, + /// (39142-5,LN,"CT perfusion head with contrast IV") + CTPerfusionHeadWithContrastIV, + /// (39632-5,LN,"SPECT brain") + SPECTBrain, + /// (RPID5427,RADLEX,"NM head perfusion brain PET-CT AV-45") + NMHeadPerfusionBrainPET_CT_AV45 + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID100_QuantitativeDiagnosticImagingProcedures(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID100_QuantitativeDiagnosticImagingProcedures(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID100_QuantitativeDiagnosticImagingProcedures CMR_CID100; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h new file mode 100644 index 00000000..b9044e1b --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h @@ -0,0 +1,168 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID10013_CTAcquisitionType + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:39 by J. Riesmeier + * + */ + + +#ifndef CMR_CID10013_H +#define CMR_CID10013_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 10013 - CT Acquisition Type. + * (type: extensible, version: 20160314) + */ +class DCMTK_CMR_EXPORT CID10013_CTAcquisitionType + : public DSRContextGroup +{ + + public: + + /** types of CT acquisition type + */ + enum EnumType + { + /// (113804,DCM,"Sequenced Acquisition") + SequencedAcquisition, + /// (116152004,SCT,"Spiral Acquisition") + SpiralAcquisition, + /// (113805,DCM,"Constant Angle Acquisition") + ConstantAngleAcquisition, + /// (113806,DCM,"Stationary Acquisition") + StationaryAcquisition, + /// (113807,DCM,"Free Acquisition") + FreeAcquisition, + /// (702569007,SCT,"Cone Beam Acquisition") + ConeBeamAcquisition + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID10013_CTAcquisitionType(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID10013_CTAcquisitionType(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID10013_CTAcquisitionType CMR_CID10013; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid10013e.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid10013e.h new file mode 100644 index 00000000..5bde25a5 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid10013e.h @@ -0,0 +1,103 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID10013e_CTAcquisitionType + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_CID10013E_H +#define CMR_CID10013E_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid10013.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** DCMR Context Group with enhanced functionality: + * CID 10013 - CT Acquisition Type. + */ +class DCMTK_CMR_EXPORT CID10013e_CTAcquisitionType + : public CID10013_CTAcquisitionType +{ + + public: + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID10013e_CTAcquisitionType(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID10013e_CTAcquisitionType(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** constructor + ** @param selectedValue defined term for Acquisition Type (0018,9302) mapped + * to a coded entry that is selected as the current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID10013e_CTAcquisitionType(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its associated defined term as the current value + ** @param selectedValue defined term for Acquisition Type (0018,9302) mapped + * to a coded entry that is selected as the current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** map a defined term for Acquisition Type (0018,9302) to the associated coded entry + ** @param definedTerm defined term that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given defined term, or an empty + * value if none was found + */ + static DSRCodedEntryValue mapAcquisitionType(const OFString &definedTerm, + const OFBool enhancedEncodingMode = OFFalse); + + /** map a defined term for Acquisition Type (0018,9302) to the associated coded entry + ** @param definedTerm defined term that should be mapped to a coded entry + * @param codedEntryValue reference to variable where the resulting coded entry is + * stored. This variable is not cleared in case of error. + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition mapAcquisitionType(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce method from base class + + using CID10013_CTAcquisitionType::selectValue; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID10013e_CTAcquisitionType CMR_CID10013e; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h new file mode 100644 index 00000000..dc4b0209 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h @@ -0,0 +1,160 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID10033_CTReconstructionAlgorithm + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:41 by J. Riesmeier + * + */ + + +#ifndef CMR_CID10033_H +#define CMR_CID10033_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 10033 - CT Reconstruction Algorithm. + * (type: extensible, version: 20130207) + */ +class DCMTK_CMR_EXPORT CID10033_CTReconstructionAlgorithm + : public DSRContextGroup +{ + + public: + + /** types of CT reconstruction algorithm + */ + enum EnumType + { + /// (113962,DCM,"Filtered Back Projection") + FilteredBackProjection, + /// (113963,DCM,"Iterative Reconstruction") + IterativeReconstruction + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID10033_CTReconstructionAlgorithm(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID10033_CTReconstructionAlgorithm(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID10033_CTReconstructionAlgorithm CMR_CID10033; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid10033e.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid10033e.h new file mode 100644 index 00000000..09e1ba18 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid10033e.h @@ -0,0 +1,107 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID10033e_CTReconstructionAlgorithm + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_CID10033E_H +#define CMR_CID10033E_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid10033.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** DCMR Context Group with enhanced functionality: + * CID 10033 - CT Reconstruction Algorithm. + */ +class DCMTK_CMR_EXPORT CID10033e_CTReconstructionAlgorithm + : public CID10033_CTReconstructionAlgorithm +{ + + public: + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID10033e_CTReconstructionAlgorithm(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID10033e_CTReconstructionAlgorithm(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** constructor + ** @param selectedValue defined term for Reconstruction Algorithm (0018,9315) + * mapped to a coded entry that is selected as the current + * value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID10033e_CTReconstructionAlgorithm(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its associated defined term as the current value + ** @param selectedValue defined term for Reconstruction Algorithm (0018,9315) + * mapped to a coded entry that is selected as the current + * value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** map a defined term for Reconstruction Algorithm (0018,9315) to the associated coded + * entry + ** @param definedTerm defined term that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given defined term, or an empty + * value if none was found + */ + static DSRCodedEntryValue mapReconstructionAlgorithm(const OFString &definedTerm, + const OFBool enhancedEncodingMode = OFFalse); + + /** map a defined term for Reconstruction Algorithm (0018,9315) to the associated coded + * entry + ** @param definedTerm defined term that should be mapped to a coded entry + * @param codedEntryValue reference to variable where the resulting coded entry is + * stored. This variable is not cleared in case of error. + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition mapReconstructionAlgorithm(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce method from base class + + using CID10033_CTReconstructionAlgorithm::selectValue; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID10033e_CTReconstructionAlgorithm CMR_CID10033e; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid11.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid11.h new file mode 100644 index 00000000..1a7af6e2 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid11.h @@ -0,0 +1,206 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID11_RouteOfAdministration + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:09 by J. Riesmeier + * + */ + + +#ifndef CMR_CID11_H +#define CMR_CID11_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 11 - Route of Administration. + * (type: extensible, version: 20160314) + */ +class DCMTK_CMR_EXPORT CID11_RouteOfAdministration + : public DSRContextGroup +{ + + public: + + /** types of route of administration + */ + enum EnumType + { + /// (47625008,SCT,"Intravenous route") + IntravenousRoute, + /// (58100008,SCT,"Intra-arterial route") + IntraArterialRoute, + /// (78421000,SCT,"Intramuscular route") + IntramuscularRoute, + /// (34206005,SCT,"Subcutaneous route") + SubcutaneousRoute, + /// (372464004,SCT,"Intracutaneous route") + IntracutaneousRoute, + /// (38239002,SCT,"Intraperitoneal route") + IntraperitonealRoute, + /// (60213007,SCT,"Intramedullary route") + IntramedullaryRoute, + /// (72607000,SCT,"Intrathecal route") + IntrathecalRoute, + /// (12130007,SCT,"Intra-articular route") + IntraArticularRoute, + /// (C38244,NCIt,"Intraepithelial route") + IntraepithelialRoute, + /// (6064005,SCT,"Topical route") + TopicalRoute, + /// (26643006,SCT,"Oral route") + OralRoute, + /// (C38306,NCIt,"Transluminal route") + TransluminalRoute, + /// (37737002,SCT,"Intraluminal route") + IntraluminalRoute, + /// (C38213,NCIt,"Extraluminal route") + ExtraluminalRoute, + /// (446406008,SCT,"By inhalation") + ByInhalation, + /// (37161004,SCT,"Per rectum") + PerRectum, + /// (16857009,SCT,"Vaginal route") + VaginalRoute, + /// (372463005,SCT,"Intracoronary route") + IntracoronaryRoute, + /// (372460008,SCT,"Intracardiac route") + IntracardiacRoute, + /// (420287000,SCT,"Intraventricular route - cardiac") + IntraventricularRouteCardiac, + /// (127070,DCM,"Retro-orbital route") + RetroOrbitalRoute, + /// (46713006,SCT,"Nasal route") + NasalRoute, + /// (372464004,SCT,"Intradermal route") + IntradermalRoute, + /// (447122006,SCT,"Intratumor route") + IntratumorRoute + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID11_RouteOfAdministration(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID11_RouteOfAdministration(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID11_RouteOfAdministration CMR_CID11; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid244.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid244.h new file mode 100644 index 00000000..ac89b3c2 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid244.h @@ -0,0 +1,164 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID244_Laterality + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:16 by J. Riesmeier + * + */ + + +#ifndef CMR_CID244_H +#define CMR_CID244_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 244 - Laterality. + * (type: extensible, version: 20030108) + */ +class DCMTK_CMR_EXPORT CID244_Laterality + : public DSRContextGroup +{ + + public: + + /** types of laterality + */ + enum EnumType + { + /// (24028007,SCT,"Right") + Right, + /// (7771000,SCT,"Left") + Left, + /// (51440002,SCT,"Bilateral") + Bilateral, + /// (66459002,SCT,"Unilateral") + Unilateral + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID244_Laterality(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID244_Laterality(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID244_Laterality CMR_CID244; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid244e.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid244e.h new file mode 100644 index 00000000..951ec3d8 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid244e.h @@ -0,0 +1,103 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID244e_Laterality + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_CID244E_H +#define CMR_CID244E_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid244.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** DCMR Context Group with enhanced functionality: + * CID 244 - Laterality. + */ +class DCMTK_CMR_EXPORT CID244e_Laterality + : public CID244_Laterality +{ + + public: + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID244e_Laterality(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID244e_Laterality(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** constructor + ** @param selectedValue enumerated value for Image Laterality (0020,0062) mapped + * to a coded entry that is selected as the current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID244e_Laterality(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its associated enumerated value as the current value + ** @param selectedValue enumerated value for Image Laterality (0020,0062) mapped + * to a coded entry that is selected as the current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** map an enumerated value for Image Laterality (0020,0062) to the associated coded entry + ** @param enumeratedValue enumerated value that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given enumerated value, or an empty + * value if none was found + */ + static DSRCodedEntryValue mapImageLaterality(const OFString &enumeratedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** map an enumerated value for Image Laterality (0020,0062) to the associated coded entry + ** @param enumeratedValue enumerated value that should be mapped to a coded entry + * @param codedEntryValue reference to variable where the resulting coded entry is + * stored. This variable is not cleared in case of error. + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition mapImageLaterality(const OFString &enumeratedValue, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce method from base class + + using CID244_Laterality::selectValue; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID244e_Laterality CMR_CID244e; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid29.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid29.h new file mode 100644 index 00000000..c4351d39 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid29.h @@ -0,0 +1,244 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID29_AcquisitionModality + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:11 by J. Riesmeier + * + */ + + +#ifndef CMR_CID29_H +#define CMR_CID29_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 29 - Acquisition Modality. + * (type: extensible, version: 20190327) + */ +class DCMTK_CMR_EXPORT CID29_AcquisitionModality + : public DSRContextGroup +{ + + public: + + /** types of acquisition modality + */ + enum EnumType + { + /// (AR,DCM,"Autorefraction") + Autorefraction, + /// (BDUS,DCM,"Ultrasound Bone Densitometry") + UltrasoundBoneDensitometry, + /// (BI,DCM,"Biomagnetic Imaging") + BiomagneticImaging, + /// (BMD,DCM,"Bone Mineral Densitometry") + BoneMineralDensitometry, + /// (CR,DCM,"Computed Radiography") + ComputedRadiography, + /// (CT,DCM,"Computed Tomography") + ComputedTomography, + /// (DG,DCM,"Diaphanography") + Diaphanography, + /// (DX,DCM,"Digital Radiography") + DigitalRadiography, + /// (ECG,DCM,"Electrocardiography") + Electrocardiography, + /// (EPS,DCM,"Cardiac Electrophysiology") + CardiacElectrophysiology, + /// (ES,DCM,"Endoscopy") + Endoscopy, + /// (GM,DCM,"General Microscopy") + GeneralMicroscopy, + /// (HD,DCM,"Hemodynamic Waveform") + HemodynamicWaveform, + /// (IO,DCM,"Intra-oral Radiography") + IntraOralRadiography, + /// (IVOCT,DCM,"Intravascular Optical Coherence Tomography") + IntravascularOpticalCoherenceTomography, + /// (IVUS,DCM,"Intravascular Ultrasound") + IntravascularUltrasound, + /// (KER,DCM,"Keratometry") + Keratometry, + /// (LEN,DCM,"Lensometry") + Lensometry, + /// (LS,DCM,"Laser Scan") + LaserScan, + /// (MG,DCM,"Mammography") + Mammography, + /// (MR,DCM,"Magnetic Resonance") + MagneticResonance, + /// (NM,DCM,"Nuclear Medicine") + NuclearMedicine, + /// (OAM,DCM,"Ophthalmic Axial Measurements") + OphthalmicAxialMeasurements, + /// (OCT,DCM,"Optical Coherence Tomography") + OpticalCoherenceTomography, + /// (OP,DCM,"Ophthalmic Photography") + OphthalmicPhotography, + /// (OPM,DCM,"Ophthalmic Mapping") + OphthalmicMapping, + /// (OPT,DCM,"Ophthalmic Tomography") + OphthalmicTomography, + /// (OPTBSV,DCM,"Ophthalmic Tomography B-scan Volume Analysis") + OphthalmicTomographyBScanVolumeAnalysis, + /// (OPTENF,DCM,"Ophthalmic Tomography En Face") + OphthalmicTomographyEnFace, + /// (OPV,DCM,"Ophthalmic Visual Field") + OphthalmicVisualField, + /// (OSS,DCM,"Optical Surface Scanner") + OpticalSurfaceScanner, + /// (PT,DCM,"Positron emission tomography") + PositronEmissionTomography, + /// (PX,DCM,"Panoramic X-Ray") + PanoramicXRay, + /// (RESP,DCM,"Respiratory Waveform") + RespiratoryWaveform, + /// (RF,DCM,"Radiofluoroscopy") + Radiofluoroscopy, + /// (RG,DCM,"Radiographic imaging") + RadiographicImaging, + /// (RTIMAGE,DCM,"RT Image") + RTImage, + /// (SM,DCM,"Slide Microscopy") + SlideMicroscopy, + /// (SRF,DCM,"Subjective Refraction") + SubjectiveRefraction, + /// (TG,DCM,"Thermography") + Thermography, + /// (US,DCM,"Ultrasound") + Ultrasound, + /// (VA,DCM,"Visual Acuity") + VisualAcuity, + /// (XA,DCM,"X-Ray Angiography") + XRayAngiography, + /// (XC,DCM,"External-camera Photography") + ExternalCameraPhotography + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID29_AcquisitionModality(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID29_AcquisitionModality(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID29_AcquisitionModality CMR_CID29; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid29e.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid29e.h new file mode 100644 index 00000000..c7ee8549 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid29e.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID29e_AcquisitionModality + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_CID29E_H +#define CMR_CID29E_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid29.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** DCMR Context Group with enhanced functionality: + * CID 29 - Acquisition Modality. + */ +class DCMTK_CMR_EXPORT CID29e_AcquisitionModality + : public CID29_AcquisitionModality +{ + + public: + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID29e_AcquisitionModality(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID29e_AcquisitionModality(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its associated defined term as the current value + ** @param selectedValue defined term for Modality (0008,0060) mapped to a coded + * entry that is selected as the current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** map a defined term for Modality (0008,0060) to the associated coded entry + ** @param definedTerm defined term that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given defined term, or an empty value + * if none was found + */ + DSRCodedEntryValue mapModality(const OFString &definedTerm, + const OFBool enhancedEncodingMode = OFFalse) const; + + + /** map a defined term for Modality (0008,0060) to the associated coded entry + ** @param definedTerm defined term that should be mapped to a coded entry + * @param codedEntryValue reference to variable where the resulting coded entry is + * stored. This variable is not cleared in case of error. + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition mapModality(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- reintroduce method from base class + + using CID29_AcquisitionModality::selectValue; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID29e_AcquisitionModality CMR_CID29e; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h new file mode 100644 index 00000000..8bc448dd --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h @@ -0,0 +1,228 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID4020_PETRadionuclide + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:18 by J. Riesmeier + * + */ + + +#ifndef CMR_CID4020_H +#define CMR_CID4020_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 4020 - PET Radionuclide. + * (type: extensible, version: 20160119) + */ +class DCMTK_CMR_EXPORT CID4020_PETRadionuclide + : public DSRContextGroup +{ + + public: + + /** types of PET radionuclide + */ + enum EnumType + { + /// (40565003,SCT,"^11^Carbon") + _11_Carbon, + /// (21576001,SCT,"^13^Nitrogen") + _13_Nitrogen, + /// (424875009,SCT,"^14^Oxygen") + _14_Oxygen, + /// (129504001,SCT,"^15^Oxygen") + _15_Oxygen, + /// (77004003,SCT,"^18^Fluorine") + _18_Fluorine, + /// (71633006,SCT,"^22^Sodium") + _22_Sodium, + /// (423764008,SCT,"^38^Potassium") + _38_Potassium, + /// (126605,DCM,"^43^Scandium") + _43_Scandium, + /// (126600,DCM,"^44^Scandium") + _44_Scandium, + /// (75696008,SCT,"^45^Titanium") + _45_Titanium, + /// (126601,DCM,"^51^Manganese") + _51_Manganese, + /// (69089000,SCT,"^52^Iron") + _52_Iron, + /// (37225000,SCT,"^52^Manganese") + _52_Manganese, + /// (126607,DCM,"^52m^Manganese") + _52m_Manganese, + /// (425364008,SCT,"^60^Copper") + _60_Copper, + /// (71425003,SCT,"^61^Copper") + _61_Copper, + /// (422934004,SCT,"^62^Copper") + _62_Copper, + /// (65054007,SCT,"^62^Zinc") + _62_Zinc, + /// (3932008,SCT,"^64^Copper") + _64_Copper, + /// (79477007,SCT,"^66^Gallium") + _66_Gallium, + /// (35337001,SCT,"^68^Gallium") + _68_Gallium, + /// (53315004,SCT,"^68^Germanium") + _68_Germanium, + /// (126602,DCM,"^70^Arsenic") + _70_Arsenic, + /// (2705002,SCT,"^72^Arsenic") + _72_Arsenic, + /// (87437000,SCT,"^73^Selenium") + _73_Selenium, + /// (17910003,SCT,"^75^Bromine") + _75_Bromine, + /// (79523006,SCT,"^76^Bromine") + _76_Bromine, + /// (86521004,SCT,"^77^Bromine") + _77_Bromine, + /// (79197006,SCT,"^82^Rubidium") + _82_Rubidium, + /// (10738001,SCT,"^86^Yttrium") + _86_Yttrium, + /// (63360001,SCT,"^89^Zirconium") + _89_Zirconium, + /// (126603,DCM,"^90^Niobium") + _90_Niobium, + /// (14691008,SCT,"^90^Yttrium") + _90_Yttrium, + /// (424079002,SCT,"^94m^Technetium") + _94m_Technetium, + /// (40937006,SCT,"^124^Iodine") + _124_Iodine, + /// (126606,DCM,"^152^Terbium") + _152_Terbium + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID4020_PETRadionuclide(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID4020_PETRadionuclide(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID4020_PETRadionuclide CMR_CID4020; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h new file mode 100644 index 00000000..3a3a968e --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h @@ -0,0 +1,410 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID4021_PETRadiopharmaceutical + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:20 by J. Riesmeier + * + */ + + +#ifndef CMR_CID4021_H +#define CMR_CID4021_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 4021 - PET Radiopharmaceutical. + * (type: extensible, version: 20190124) + */ +class DCMTK_CMR_EXPORT CID4021_PETRadiopharmaceutical + : public DSRContextGroup +{ + + public: + + /** types of PET radiopharmaceutical + */ + enum EnumType + { + /// (126752,DCM,"28H1 ^89^Zr") + _28H1_89Zr, + /// (126713,DCM,"2FA F^18^") + _2FA_F18, + /// (126751,DCM,"7D12 ^89^Zr") + _7D12_89Zr, + /// (126750,DCM,"7E11 ^89^Zr") + _7E11_89Zr, + /// (129513004,SCT,"Acetate C^11^") + Acetate_C11, + /// (126729,DCM,"AGN-150998 ^89^Zr") + AGN150998_89Zr, + /// (129508003,SCT,"Ammonia N^13^") + Ammonia_N13, + /// (126754,DCM,"Anti-B220 ^89^Zr") + AntiB220_89Zr, + /// (126700,DCM,"ATSM Cu^60^") + ATSM_Cu60, + /// (126701,DCM,"ATSM Cu^61^") + ATSM_Cu61, + /// (126702,DCM,"ATSM Cu^62^") + ATSM_Cu62, + /// (422855001,SCT,"ATSM Cu^64^") + ATSM_Cu64, + /// (126722,DCM,"Benralizumab ^89^Zr") + Benralizumab_89Zr, + /// (126516,DCM,"Bevacizumab ^89^Zr") + Bevacizumab_89Zr, + /// (126727,DCM,"Blinatumomab ^89^Zr") + Blinatumomab_89Zr, + /// (126735,DCM,"Brentuximab ^89^Zr") + Brentuximab_89Zr, + /// (422540000,SCT,"Butanol O^15^") + Butanol_O15, + /// (129507008,SCT,"Carbon dioxide O^15^") + CarbonDioxide_O15, + /// (129515006,SCT,"Carbon monoxide C^11^") + CarbonMonoxide_C11, + /// (129506004,SCT,"Carbon monoxide O^15^") + CarbonMonoxide_O15, + /// (129511002,SCT,"Carfentanil C^11^") + Carfentanil_C11, + /// (126513,DCM,"Cetuximab ^89^Zr") + Cetuximab_89Zr, + /// (126517,DCM,"cG250-F(ab')(2) ^89^Zr") + CG250Fab2_89Zr, + /// (126703,DCM,"Choline C^11^") + Choline_C11, + /// (126715,DCM,"CLR1404 I^124^") + CLR1404_I124, + /// (126716,DCM,"CLR1404 I^131^") + CLR1404_I131, + /// (126746,DCM,"cMAb U36 ^89^Zr") + CMAbU36_89Zr, + /// (126515,DCM,"cU36 ^89^Zr") + CU36_89Zr, + /// (C96234,NCIt,"DCFBC F^18^") + DCFBC_F18, + /// (C116352,NCIt,"DCFPyL F^18^") + DCFPyL_F18, + /// (126762,DCM,"Df-[FK](2) ^89^Zr") + DfFK2_89Zr, + /// (126763,DCM,"Df-[FK](2)-3PEG(4) ^89^Zr") + DfFK23PEG4_89Zr, + /// (126520,DCM,"Df-CD45 ^89^Zr") + DfCD45_89Zr, + /// (126760,DCM,"Df-FK ^89^Zr") + DfFK_89Zr, + /// (126761,DCM,"Df-FK-PEG(3) ^89^Zr") + DfFKPEG3_89Zr, + /// (126747,DCM,"DN30 ^89^Zr") + DN30_89Zr, + /// (126519,DCM,"E4G10 ^89^Zr") + E4G10_89Zr, + /// (126732,DCM,"Ecromeximab ^89^Zr") + Ecromeximab_89Zr, + /// (C2713594,UMLS,"Edotreotide Ga^68^") + Edotreotide_Ga68, + /// (423498000,SCT,"EDTA Ga^68^") + EDTA_Ga68, + /// (126704,DCM,"Fallypride C^11^") + Fallypride_C11, + /// (126705,DCM,"Fallypride F^18^") + Fallypride_F18, + /// (126706,DCM,"FLB 457 C^11^") + FLB457_C11, + /// (712736002,SCT,"Florbetaben F^18^") + Florbetaben_F18, + /// (456995000,SCT,"Florbetapir F^18^") + Florbetapir_F18, + /// (C4547429,UMLS,"Flortaucipir F^18^") + Flortaucipir_F18, + /// (126503,DCM,"Flubatine F^18^") + Flubatine_F18, + /// (456999006,SCT,"Fluciclatide F^18^") + Fluciclatide_F18, + /// (457000009,SCT,"Fluciclovine F^18^") + Fluciclovine_F18, + /// (423543007,SCT,"Flumazenil C^11^") + Flumazenil_C11, + /// (422975006,SCT,"Flumazenil F^18^") + Flumazenil_F18, + /// (424708001,SCT,"Fluorethyltyrosin F^18^") + Fluorethyltyrosin_F18, + /// (423546004,SCT,"Fluorobenzothiazole F^18^") + Fluorobenzothiazole_F18, + /// (456992002,SCT,"Fluorocholine F^18^") + Fluorocholine_F18, + /// (35321007,SCT,"Fluorodeoxyglucose F^18^") + Fluorodeoxyglucose_F18, + /// (C1831937,UMLS,"Fluoroestradiol (FES) F^18^") + FluoroestradiolFES_F18, + /// (C1541539,UMLS,"Fluoroetanidazole F^18^") + Fluoroetanidazole_F18, + /// (129500005,SCT,"Fluoro-L-dopa F^18^") + FluoroLDopa_F18, + /// (422763008,SCT,"Fluoromethane F^18^") + Fluoromethane_F18, + /// (422598008,SCT,"Fluoromisonidazole F^18^") + Fluoromisonidazole_F18, + /// (C2934038,UMLS,"Fluoropropyl-dihydrotetrabenazine (DTBZ) F^18^") + FluoropropylDihydrotetrabenazineDTBZ_F18, + /// (126707,DCM,"Fluorotriopride F^18^") + Fluorotriopride_F18, + /// (425236000,SCT,"Fluorouracil F^18^") + Fluorouracil_F18, + /// (126718,DCM,"Flurpiridaz F^18^") + Flurpiridaz_F18, + /// (456997008,SCT,"Flutemetamol F^18^") + Flutemetamol_F18, + /// (126748,DCM,"Fresolimumab ^89^Zr") + Fresolimumab_89Zr, + /// (126731,DCM,"GA201 ^89^Zr") + GA201_89Zr, + /// (129516007,SCT,"Germanium Ge^68^") + Germanium_Ge68, + /// (126724,DCM,"Glembatumumab vedotin ^89^Zr") + GlembatumumabVedotin_89Zr, + /// (129509006,SCT,"Glutamate N^13^") + Glutamate_N13, + /// (126709,DCM,"Glutamine C^11^") + Glutamine_C11, + /// (126710,DCM,"Glutamine C^14^") + Glutamine_C14, + /// (126711,DCM,"Glutamine F^18^") + Glutamine_F18, + /// (C2981788,UMLS,"ISO-1 F^18^") + ISO1_F18, + /// (126514,DCM,"J591 ^89^Zr") + J591_89Zr, + /// (126740,DCM,"Margetuximab ^89^Zr") + Margetuximab_89Zr, + /// (126730,DCM,"MEDI-551 ^89^Zr") + MEDI551_89Zr, + /// (424789007,SCT,"Mespiperone C^11^") + Mespiperone_C11, + /// (129510001,SCT,"Methionine C^11^") + Methionine_C11, + /// (C4506764,UMLS,"MK-6240 F^18^") + MK6240_F18, + /// (126738,DCM,"Mogamulizumab ^89^Zr") + Mogamulizumab_89Zr, + /// (126510,DCM,"Monoclonal Antibody (mAb) ^64^Cu") + MonoclonalAntibodymAb_64Cu, + /// (126511,DCM,"Monoclonal Antibody (mAb) ^89^Zr") + MonoclonalAntibodymAb_89Zr, + /// (424874008,SCT,"Monoclonal antibody I^124^") + MonoclonalAntibody_I124, + /// (126753,DCM,"Nanocolloidal albumin ^89^Zr") + NanocolloidalAlbumin_89Zr, + /// (126714,DCM,"Nifene F^18^") + Nifene_F18, + /// (126721,DCM,"Obinituzimab ^89^Zr") + Obinituzimab_89Zr, + /// (126723,DCM,"Ocaratuzumab ^89^Zr") + Ocaratuzumab_89Zr, + /// (129504001,SCT,"Oxygen O^15^") + Oxygen_O15, + /// (129505000,SCT,"Oxygen-water O^15^") + OxygenWater_O15, + /// (129514005,SCT,"Palmitate C^11^") + Palmitate_C11, + /// (126736,DCM,"Panitumumab ^89^Zr") + Panitumumab_89Zr, + /// (126728,DCM,"Pegdinetanib ^89^Zr") + Pegdinetanib_89Zr, + /// (126725,DCM,"Pinatuzumab vedotin ^89^Zr") + PinatuzumabVedotin_89Zr, + /// (126500,DCM,"Pittsburgh compound B C^11^") + PittsburghCompoundB_C11, + /// (126726,DCM,"Polatuzumab vedotin ^89^Zr") + PolatuzumabVedotin_89Zr, + /// (126758,DCM,"PSMA-1007 F^18^") + PSMA1007_F18, + /// (C118961,NCIt,"PSMA-11 Ga^68^") + PSMA11_Ga68, + /// (126759,DCM,"PSMA-617 Ga^68^") + PSMA617_Ga68, + /// (422789008,SCT,"PTSM Cu^62^") + PTSM_Cu62, + /// (126518,DCM,"R1507 ^89^Zr") + R1507_89Zr, + /// (129512009,SCT,"Raclopride C^11^") + Raclopride_C11, + /// (126742,DCM,"Ranibizumab ^89^Zr") + Ranibizumab_89Zr, + /// (126737,DCM,"Rituximab ^89^Zr") + Rituximab_89Zr, + /// (126755,DCM,"RO5323441 ^89^Zr") + RO5323441_89Zr, + /// (126756,DCM,"RO542908 ^89^Zr") + RO542908_89Zr, + /// (126719,DCM,"RO6924963 ^11^C") + RO6924963_11C, + /// (126720,DCM,"RO6931643 ^11^C") + RO6931643_11C, + /// (126757,DCM,"RO6958948 ^18^F") + RO6958948_18F, + /// (126733,DCM,"Roledumab ^89^Zr") + Roledumab_89Zr, + /// (129503007,SCT,"Rubidium chloride Rb^82^") + RubidiumChloride_Rb82, + /// (126741,DCM,"SAR3419 ^89^Zr") + SAR3419_89Zr, + /// (C122684,NCIt,"Sarcosine C^11^") + Sarcosine_C11, + /// (129501009,SCT,"Sodium fluoride F^18^") + SodiumFluoride_F18, + /// (422980002,SCT,"Sodium iodide I^124^") + SodiumIodide_I124, + /// (129517003,SCT,"Sodium Na^22^") + Sodium_Na22, + /// (129499001,SCT,"Spiperone F^18^") + Spiperone_F18, + /// (126502,DCM,"T807 F^18^") + T807_F18, + /// (C4550127,UMLS,"THK5317 F^18^") + THK5317_F18, + /// (C4279748,UMLS,"THK5351 F^18^") + THK5351_F18, + /// (129502002,SCT,"Thymidine (FLT) F^18^") + ThymidineFLT_F18, + /// (126512,DCM,"Trastuzumab ^89^Zr") + Trastuzumab_89Zr, + /// (126749,DCM,"TRC105 ^89^Zr") + TRC105_89Zr, + /// (C1742831,UMLS,"tyrosine-3-octreotate Ga^68^") + Tyrosine3Octreotate_Ga68, + /// (126739,DCM,"Ublituximab ^89^Zr") + Ublituximab_89Zr, + /// (C4506788,UMLS,"UCB-J C^11^") + UCBJ_C11, + /// (126734,DCM,"XmAb5574 ^89^Zr") + XmAb5574_89Zr + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID4021_PETRadiopharmaceutical(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID4021_PETRadiopharmaceutical(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID4021_PETRadiopharmaceutical CMR_CID4021; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h new file mode 100644 index 00000000..d82bf0ba --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h @@ -0,0 +1,370 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID4031_CommonAnatomicRegions + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:22 by J. Riesmeier + * + */ + + +#ifndef CMR_CID4031_H +#define CMR_CID4031_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 4031 - Common Anatomic Regions. + * (type: extensible, version: 20170914) + */ +class DCMTK_CMR_EXPORT CID4031_CommonAnatomicRegions + : public DSRContextGroup +{ + + public: + + /** types of common anatomic regions + */ + enum EnumType + { + /// (113345001,SCT,"Abdomen") + Abdomen, + /// (416949008,SCT,"Abdomen and Pelvis") + AbdomenAndPelvis, + /// (85856004,SCT,"Acromioclavicular joint") + AcromioclavicularJoint, + /// (70258002,SCT,"Ankle joint") + AnkleJoint, + /// (53505006,SCT,"Anus") + Anus, + /// (86598002,SCT,"Apex of Lung") + ApexOfLung, + /// (28273000,SCT,"Bile duct") + BileDuct, + /// (89837001,SCT,"Bladder") + Bladder, + /// (72001000,SCT,"Bone of lower limb") + BoneOfLowerLimb, + /// (371195002,SCT,"Bone of upper limb") + BoneOfUpperLimb, + /// (76752008,SCT,"Breast") + Breast, + /// (955009,SCT,"Bronchus") + Bronchus, + /// (80144004,SCT,"Calcaneus") + Calcaneus, + /// (122494005,SCT,"Cervical spine") + CervicalSpine, + /// (297171002,SCT,"Cervico-thoracic spine") + CervicoThoracicSpine, + /// (51185008,SCT,"Chest") + Chest, + /// (416550000,SCT,"Chest and Abdomen") + ChestAndAbdomen, + /// (416775004,SCT,"Chest, Abdomen and Pelvis") + ChestAbdomenAndPelvis, + /// (51299004,SCT,"Clavicle") + Clavicle, + /// (64688005,SCT,"Coccyx") + Coccyx, + /// (71854001,SCT,"Colon") + Colon, + /// (38848004,SCT,"Duodenum") + Duodenum, + /// (16953009,SCT,"Elbow joint") + ElbowJoint, + /// (38266002,SCT,"Entire body") + EntireBody, + /// (32849002,SCT,"Esophagus") + Esophagus, + /// (110861005,SCT,"Esophagus, stomach and duodenum") + EsophagusStomachAndDuodenum, + /// (66019005,SCT,"Extremity") + Extremity, + /// (81745001,SCT,"Eye") + Eye, + /// (371398005,SCT,"Eye region") + EyeRegion, + /// (91397008,SCT,"Facial bones") + FacialBones, + /// (71341001,SCT,"Femur") + Femur, + /// (87342007,SCT,"Fibula") + Fibula, + /// (7569003,SCT,"Finger") + Finger, + /// (56459004,SCT,"Foot") + Foot, + /// (14975008,SCT,"Forearm") + Forearm, + /// (28231008,SCT,"Gallbladder") + Gallbladder, + /// (85562004,SCT,"Hand") + Hand, + /// (69536005,SCT,"Head") + Head, + /// (774007,SCT,"Head and Neck") + HeadAndNeck, + /// (80891009,SCT,"Heart") + Heart, + /// (29836001,SCT,"Hip joint") + HipJoint, + /// (85050009,SCT,"Humerus") + Humerus, + /// (34516001,SCT,"Ileum") + Ileum, + /// (22356005,SCT,"Ilium") + Ilium, + /// (361078006,SCT,"Internal Auditory Canal") + InternalAuditoryCanal, + /// (661005,SCT,"Jaw region") + JawRegion, + /// (21306003,SCT,"Jejunum") + Jejunum, + /// (72696002,SCT,"Knee") + Knee, + /// (14742008,SCT,"Large intestine") + LargeIntestine, + /// (4596009,SCT,"Larynx") + Larynx, + /// (30021000,SCT,"Lower leg") + LowerLeg, + /// (61685007,SCT,"Lower limb") + LowerLimb, + /// (122496007,SCT,"Lumbar spine") + LumbarSpine, + /// (297173004,SCT,"Lumbo-sacral spine") + LumboSacralSpine, + /// (91609006,SCT,"Mandible") + Mandible, + /// (59066005,SCT,"Mastoid bone") + MastoidBone, + /// (70925003,SCT,"Maxilla") + Maxilla, + /// (72410000,SCT,"Mediastinum") + Mediastinum, + /// (102292000,SCT,"Muscle of lower limb") + MuscleOfLowerLimb, + /// (30608006,SCT,"Muscle of upper limb") + MuscleOfUpperLimb, + /// (74386004,SCT,"Nasal bone") + NasalBone, + /// (45048000,SCT,"Neck") + Neck, + /// (417437006,SCT,"Neck and Chest") + NeckAndChest, + /// (416152001,SCT,"Neck, Chest and Abdomen") + NeckChestAndAbdomen, + /// (416319003,SCT,"Neck, Chest, Abdomen and Pelvis") + NeckChestAbdomenAndPelvis, + /// (55024004,SCT,"Optic canal") + OpticCanal, + /// (363654007,SCT,"Orbital structure") + OrbitalStructure, + /// (110621006,SCT,"Pancreatic duct and bile duct systems") + PancreaticDuctAndBileDuctSystems, + /// (2095001,SCT,"Paranasal sinus") + ParanasalSinus, + /// (45289007,SCT,"Parotid gland") + ParotidGland, + /// (64234005,SCT,"Patella") + Patella, + /// (12921003,SCT,"Pelvis") + Pelvis, + /// (416631005,SCT,"Pelvis and lower extremities") + PelvisAndLowerExtremities, + /// (113681,DCM,"Phantom") + Phantom, + /// (41216001,SCT,"Prostate") + Prostate, + /// (34402009,SCT,"Rectum") + Rectum, + /// (113197003,SCT,"Rib") + Rib, + /// (39723000,SCT,"Sacroiliac joint") + SacroiliacJoint, + /// (54735007,SCT,"Sacrum") + Sacrum, + /// (79601000,SCT,"Scapula") + Scapula, + /// (42575006,SCT,"Sella turcica") + SellaTurcica, + /// (58742003,SCT,"Sesamoid bones of foot") + SesamoidBonesOfFoot, + /// (16982005,SCT,"Shoulder") + Shoulder, + /// (89546000,SCT,"Skull") + Skull, + /// (30315005,SCT,"Small intestine") + SmallIntestine, + /// (421060004,SCT,"Spine") + Spine, + /// (7844006,SCT,"Sternoclavicular joint") + SternoclavicularJoint, + /// (56873002,SCT,"Sternum") + Sternum, + /// (69695003,SCT,"Stomach") + Stomach, + /// (54019009,SCT,"Submandibular gland") + SubmandibularGland, + /// (27949001,SCT,"Tarsal joint") + TarsalJoint, + /// (53620006,SCT,"Temporomandibular joint") + TemporomandibularJoint, + /// (68367000,SCT,"Thigh") + Thigh, + /// (122495006,SCT,"Thoracic spine") + ThoracicSpine, + /// (297172009,SCT,"Thoraco-lumbar spine") + ThoracoLumbarSpine, + /// (76505004,SCT,"Thumb") + Thumb, + /// (29707007,SCT,"Toe") + Toe, + /// (44567001,SCT,"Trachea") + Trachea, + /// (40983000,SCT,"Upper arm") + UpperArm, + /// (53120007,SCT,"Upper limb") + UpperLimb, + /// (431491007,SCT,"Upper urinary tract") + UpperUrinaryTract, + /// (87953007,SCT,"Ureter") + Ureter, + /// (13648007,SCT,"Urethra") + Urethra, + /// (110639002,SCT,"Uterus and fallopian tubes") + UterusAndFallopianTubes, + /// (110517009,SCT,"Vertebral column and cranium") + VertebralColumnAndCranium, + /// (74670003,SCT,"Wrist joint") + WristJoint, + /// (13881006,SCT,"Zygoma") + Zygoma + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID4031_CommonAnatomicRegions(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID4031_CommonAnatomicRegions(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID4031_CommonAnatomicRegions CMR_CID4031; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid4031e.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid4031e.h new file mode 100644 index 00000000..0ccd6ef6 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid4031e.h @@ -0,0 +1,107 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID4031_CommonAnatomicRegions_Enhanced + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_CID4031E_H +#define CMR_CID4031E_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid4031.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** DCMR Context Group with enhanced functionality: + * CID 4031 - Common Anatomic Regions. + */ +class DCMTK_CMR_EXPORT CID4031e_CommonAnatomicRegions + : public CID4031_CommonAnatomicRegions +{ + + public: + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID4031e_CommonAnatomicRegions(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID4031e_CommonAnatomicRegions(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** constructor + ** @param selectedValue defined term for Body Part Examined (0018,0015) mapped + * to a coded entry that is selected as the current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID4031e_CommonAnatomicRegions(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its associated defined term as the current value + ** @param selectedValue defined term for Body Part Examined (0018,0015) mapped + * to a coded entry that is selected as the current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** map a defined term for Body Part Examined (0018,0015) to the associated coded entry. + * See DICOM PS 3.16 Annex L (Correspondence of Anatomic Region Codes and Body Part + * Examined Defined Terms) for details on this mapping. + ** @param definedTerm defined term that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given defined term, or an empty value + * if none was found + */ + static DSRCodedEntryValue mapBodyPartExamined(const OFString &definedTerm, + const OFBool enhancedEncodingMode = OFFalse); + + /** map a defined term for Body Part Examined (0018,0015) to the associated coded entry. + * See DICOM PS 3.16 Annex L (Correspondence of Anatomic Region Codes and Body Part + * Examined Defined Terms) for details on this mapping. + ** @param definedTerm defined term that should be mapped to a coded entry + * @param codedEntryValue reference to variable where the resulting coded entry is + * stored. This variable is not cleared in case of error. + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition mapBodyPartExamined(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce method from base class + + using CID4031_CommonAnatomicRegions::selectValue; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID4031e_CommonAnatomicRegions CMR_CID4031e; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid42.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid42.h new file mode 100644 index 00000000..feb3501d --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid42.h @@ -0,0 +1,180 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID42_NumericValueQualifier + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:12 by J. Riesmeier + * + */ + + +#ifndef CMR_CID42_H +#define CMR_CID42_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 42 - Numeric Value Qualifier. + * (type: extensible, version: 20020114) + */ +class DCMTK_CMR_EXPORT CID42_NumericValueQualifier + : public DSRContextGroup +{ + + public: + + /** types of numeric value qualifier + */ + enum EnumType + { + /// (114000,DCM,"Not a number") + NotANumber, + /// (114001,DCM,"Negative Infinity") + NegativeInfinity, + /// (114002,DCM,"Positive Infinity") + PositiveInfinity, + /// (114003,DCM,"Divide by zero") + DivideByZero, + /// (114004,DCM,"Underflow") + Underflow, + /// (114005,DCM,"Overflow") + Overflow, + /// (114006,DCM,"Measurement failure") + MeasurementFailure, + /// (114007,DCM,"Measurement not attempted") + MeasurementNotAttempted, + /// (114008,DCM,"Calculation failure") + CalculationFailure, + /// (114009,DCM,"Value out of range") + ValueOutOfRange, + /// (114010,DCM,"Value unknown") + ValueUnknown, + /// (114011,DCM,"Value indeterminate") + ValueIndeterminate + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID42_NumericValueQualifier(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID42_NumericValueQualifier(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID42_NumericValueQualifier CMR_CID42; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid5000.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid5000.h new file mode 100644 index 00000000..01757988 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid5000.h @@ -0,0 +1,170 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID5000_Languages + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_CID5000_H +#define CMR_CID5000_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 5000 - Languages. + */ +class DCMTK_CMR_EXPORT CID5000_Languages + : public DSRContextGroup +{ + + public: + + /** available languages (in alphabetical order). + * There are also variants that include the country. + * Please note that this list is everything but complete. + */ + enum EnumType + { + /// (eng,RFC5646,"English") + English, + /// (en-CA,RFC5646,"English (CA)") + English_CA, + /// (en-GB,RFC5646,"English (GB)") + English_GB, + /// (en-US,RFC5646,"English (US)") + English_US, + /// (fra,RFC5646,"French") + French, + /// (fr-CA,RFC5646,"French (CA)") + French_CA, + /// (fr-CH,RFC5646,"French (CH)") + French_CH, + /// (fr-FR,RFC5646,"French (FR)") + French_FR, + /// (deu,RFC5646,"German") + German, + /// (de-AT,RFC5646,"German (AT)") + German_AT, + /// (de-CH,RFC5646,"German (CH)") + German_CH, + /// (de-DE,RFC5646,"German (DE)") + German_DE + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. should be based on RFC 4646. + */ + CID5000_Languages(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue language mapped to a coded entry that is selected as + * the current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID5000_Languages(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue language mapped to a coded entry that is selected as + * the current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given language to the associated coded entry + ** @param value language that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid5001.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid5001.h new file mode 100644 index 00000000..c1f534ce --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid5001.h @@ -0,0 +1,159 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID5001_Countries + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_CID5001_H +#define CMR_CID5001_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 5001 - Countries. + */ +class DCMTK_CMR_EXPORT CID5001_Countries + : public DSRContextGroup +{ + + public: + + /** available countries (in alphabetical order). + * Please note that this list is everything but complete. + */ + enum EnumType + { + /// (AT,ISO3166_1,"Austria") + Austria, + /// (CA,ISO3166_1,"Canada") + Canada, + /// (FR,ISO3166_1,"France") + France, + /// (DE,ISO3166_1,"Germany") + Germany, + /// (CH,ISO3166_1,"Switzerland") + Switzerland, + /// (GB,ISO3166_1,"United Kingdom of Great Britain and Northern Ireland") + UnitedKingdom, + /// (US,ISO3166_1,"United States of America") + UnitedStates + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. should be based on ISO 3166. + */ + CID5001_Countries(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue country mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID5001_Countries(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue country mapped to a coded entry that is selected as + * the current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given country to the associated coded entry + ** @param value country that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h new file mode 100644 index 00000000..4c51a00f --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h @@ -0,0 +1,164 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID6147_ResponseCriteria + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:24 by J. Riesmeier + * + */ + + +#ifndef CMR_CID6147_H +#define CMR_CID6147_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 6147 - Response Criteria. + * (type: extensible, version: 20141110) + */ +class DCMTK_CMR_EXPORT CID6147_ResponseCriteria + : public DSRContextGroup +{ + + public: + + /** types of response criteria + */ + enum EnumType + { + /// (112029,DCM,"WHO") + WHO, + /// (126080,DCM,"RECIST 1.0") + RECIST10, + /// (126081,DCM,"RECIST 1.1") + RECIST11, + /// (C114879,NCIt,"RANO") + RANO + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID6147_ResponseCriteria(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID6147_ResponseCriteria(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID6147_ResponseCriteria CMR_CID6147; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h new file mode 100644 index 00000000..2f2e0053 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h @@ -0,0 +1,164 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID7021_MeasurementReportDocumentTitles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:26 by J. Riesmeier + * + */ + + +#ifndef CMR_CID7021_H +#define CMR_CID7021_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 7021 - Measurement Report Document Titles. + * (type: extensible, version: 20141110) + */ +class DCMTK_CMR_EXPORT CID7021_MeasurementReportDocumentTitles + : public DSRContextGroup +{ + + public: + + /** types of measurement report document titles + */ + enum EnumType + { + /// (126000,DCM,"Imaging Measurement Report") + ImagingMeasurementReport, + /// (126001,DCM,"Oncology Measurement Report") + OncologyMeasurementReport, + /// (126002,DCM,"Dynamic Contrast MR Measurement Report") + DynamicContrastMRMeasurementReport, + /// (126003,DCM,"PET Measurement Report") + PETMeasurementReport + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID7021_MeasurementReportDocumentTitles(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID7021_MeasurementReportDocumentTitles(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID7021_MeasurementReportDocumentTitles CMR_CID7021; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h new file mode 100644 index 00000000..4a539f58 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h @@ -0,0 +1,286 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID7181_AbstractMultiDimensionalImageModelComponentUnits + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:28 by J. Riesmeier + * + */ + + +#ifndef CMR_CID7181_H +#define CMR_CID7181_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 7181 - Abstract Multi-dimensional Image Model Component Units. + * (type: extensible, version: 20180605) + */ +class DCMTK_CMR_EXPORT CID7181_AbstractMultiDimensionalImageModelComponentUnits + : public DSRContextGroup +{ + + public: + + /** types of abstract multi-dimensional image model component units + */ + enum EnumType + { + /// (mm[Hg],UCUM,"mmHg"), included from CID 3500 + MmHg, + /// (kPa,UCUM,"kPa"), included from CID 3500 + KPa, + /// ([PRU],UCUM,"P.R.U."), included from CID 3502 + PRU, + /// ([wood'U],UCUM,"Wood U"), included from CID 3502 + WoodU, + /// (dyn.s.cm-5,UCUM,"dyn.s.cm-5"), included from CID 3502 + Dynscm5, + /// ([PRU]/m2,UCUM,"P.R.U./m2"), included from CID 3503 + PRUPerM2, + /// ([wood'U]/m2,UCUM,"Wood U/m2"), included from CID 3503 + WoodUPerM2, + /// (dyn.s.cm-5/m2,UCUM,"dyn.s.cm-5/m2"), included from CID 3503 + Dynscm5PerM2, + /// (cm,UCUM,"centimeter"), included from CID 7460 + Centimeter, + /// (mm,UCUM,"millimeter"), included from CID 7460 + Millimeter, + /// (um,UCUM,"micrometer"), included from CID 7460 + Micrometer, + /// (cm2,UCUM,"square centimeter"), included from CID 7461 + SquareCentimeter, + /// (mm2,UCUM,"square millimeter"), included from CID 7461 + SquareMillimeter, + /// (um2,UCUM,"square micrometer"), included from CID 7461 + SquareMicrometer, + /// (dm3,UCUM,"cubic decimeter"), included from CID 7462 + CubicDecimeter, + /// (cm3,UCUM,"cubic centimeter"), included from CID 7462 + CubicCentimeter, + /// (mm3,UCUM,"cubic millimeter"), included from CID 7462 + CubicMillimeter, + /// (um3,UCUM,"cubic micrometer"), included from CID 7462 + CubicMicrometer, + /// (g/ml{SUVbw},UCUM,"Standardized Uptake Value body weight"), included from CID 85 + StandardizedUptakeValueBodyWeight, + /// (g/ml{SUVlbm},UCUM,"Standardized Uptake Value lean body mass (James)"), included from CID 85 + StandardizedUptakeValueLeanBodyMassJames, + /// (g/ml{SUVlbm(James128)},UCUM,"Standardized Uptake Value lean body mass (James 128 multiplier)"), included from CID 85 + StandardizedUptakeValueLeanBodyMassJames128Multiplier, + /// (g/ml{SUVlbm(Janma)},UCUM,"Standardized Uptake Value lean body mass (Janma)"), included from CID 85 + StandardizedUptakeValueLeanBodyMassJanma, + /// (cm2/ml{SUVbsa},UCUM,"Standardized Uptake Value body surface area"), included from CID 85 + StandardizedUptakeValueBodySurfaceArea, + /// (g/ml{SUVibw},UCUM,"Standardized Uptake Value ideal body weight"), included from CID 85 + StandardizedUptakeValueIdealBodyWeight, + /// ({counts},UCUM,"Counts"), included from CID 84 + Counts, + /// ({counts}/s,UCUM,"Counts per second"), included from CID 84 + CountsPerSecond, + /// ({propcounts},UCUM,"Proportional to counts"), included from CID 84 + ProportionalToCounts, + /// ({propcounts}/s,UCUM,"Proportional to counts per second"), included from CID 84 + ProportionalToCountsPerSecond, + /// (cm2/ml,UCUM,"Centimeter**2/milliliter"), included from CID 84 + SquareCentimeterPerMilliliter, + /// (%,UCUM,"Percent"), included from CID 84 + Percent, + /// (Bq/ml,UCUM,"Becquerels/milliliter"), included from CID 84 + BecquerelsPerMilliliter, + /// (mg/min/ml,UCUM,"Milligrams/minute/milliliter"), included from CID 84 + MilligramsPerMinutePerMilliliter, + /// (umol/min/ml,UCUM,"Micromole/minute/milliliter"), included from CID 84 + MicromolePerMinutePerMilliliter, + /// (ml/min/g,UCUM,"Milliliter/minute/gram"), included from CID 84 + MilliliterPerMinutePerGram, + /// (ml/g,UCUM,"Milliliter/gram"), included from CID 84 + MilliliterPerGram, + /// (/cm,UCUM,"/Centimeter"), included from CID 84 + PerCentimeter, + /// (umol/ml,UCUM,"Micromole/milliliter"), included from CID 84 + MicromolePerMilliliter, + /// (mm2/s,UCUM,"mm2/s"), included from CID 7277 + Mm2PerS, + /// (um2/ms,UCUM,"um2/ms"), included from CID 7277 + Um2PerMs, + /// (um2/s,UCUM,"um2/s"), included from CID 7277 + Um2PerS, + /// (10-6.mm2/s,UCUM,"10-6.mm2/s"), included from CID 7277 + _106mm2PerS, + /// (Gy,UCUM,"Gy"), included from CID 10071 + Gy, + /// (Sv,UCUM,"Sv"), included from CID 10071 + Sv, + /// (1,UCUM,"no units") + NoUnits, + /// ({ratio},UCUM,"ratio") + Ratio, + /// ([hnsf'U],UCUM,"Hounsfield Unit") + HounsfieldUnit, + /// ([arb'U],UCUM,"arbitrary unit") + ArbitraryUnit, + /// (ppm,UCUM,"ppm") + Ppm, + /// (cm/s,UCUM,"centimeter/second") + CentimeterPerSecond, + /// (mm/s,UCUM,"millimeter/second") + MillimeterPerSecond, + /// (dB,UCUM,"decibel") + Decibel, + /// (Cel,UCUM,"degrees Celsius") + DegreesCelsius, + /// (ml/min,UCUM,"milliliter per minute") + MilliliterPerMinute, + /// (ml/s,UCUM,"milliliter per second") + MilliliterPerSecond, + /// (ms,UCUM,"millisecond") + Millisecond, + /// (s,UCUM,"second") + Second, + /// (Hz,UCUM,"Hertz") + Hertz, + /// (mT,UCUM,"milliTesla") + MilliTesla, + /// ({Particles}/[100]g{Tissue},UCUM,"number particles per 100 gram of tissue") + NumberParticlesPer100GramOfTissue, + /// (s/mm2,UCUM,"second per square millimeter") + SecondPerSquareMillimeter, + /// (ml/[100]g/min,UCUM,"milliliter per 100 gram per minute") + MilliliterPer100GramPerMinute, + /// (ml/[100]ml,UCUM,"milliliter per 100 milliliter") + MilliliterPer100Milliliter, + /// (mmol/kg{WetWeight},UCUM,"millimoles per kg wet weight") + MillimolesPerKgWetWeight, + /// (/min,UCUM,"/min") + PerMin, + /// (/s,UCUM,"/s") + PerS + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID7181_AbstractMultiDimensionalImageModelComponentUnits(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID7181_AbstractMultiDimensionalImageModelComponentUnits(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID7181_AbstractMultiDimensionalImageModelComponentUnits CMR_CID7181; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h new file mode 100644 index 00000000..bc33721b --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h @@ -0,0 +1,162 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID7445_DeviceParticipatingRoles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:30 by J. Riesmeier + * + */ + + +#ifndef CMR_CID7445_H +#define CMR_CID7445_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 7445 - Device Participating Roles. + * (type: extensible, version: 20120406) + */ +class DCMTK_CMR_EXPORT CID7445_DeviceParticipatingRoles + : public DSRContextGroup +{ + + public: + + /** types of device participating roles + */ + enum EnumType + { + /// (113859,DCM,"Irradiating Device") + IrradiatingDevice, + /// (121097,DCM,"Recording") + Recording, + /// (113942,DCM,"X-Ray Reading Device") + XRayReadingDevice + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID7445_DeviceParticipatingRoles(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID7445_DeviceParticipatingRoles(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID7445_DeviceParticipatingRoles CMR_CID7445; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h new file mode 100644 index 00000000..84603773 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h @@ -0,0 +1,208 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID7452_OrganizationalRoles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:32 by J. Riesmeier + * + */ + + +#ifndef CMR_CID7452_H +#define CMR_CID7452_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 7452 - Organizational Roles. + * (type: extensible, version: 20170626) + */ +class DCMTK_CMR_EXPORT CID7452_OrganizationalRoles + : public DSRContextGroup +{ + + public: + + /** types of organizational roles + */ + enum EnumType + { + /// (158965000,SCT,"Medical Practitioner") + MedicalPractitioner, + /// (309343006,SCT,"Physician") + Physician, + /// (128670,DCM,"Head of Radiology") + HeadOfRadiology, + /// (128671,DCM,"Chair of Protocol Committee") + ChairOfProtocolCommittee, + /// (128676,DCM,"Representative of Protocol Committee") + RepresentativeOfProtocolCommittee, + /// (128677,DCM,"Representative of Ethics Committee") + RepresentativeOfEthicsCommittee, + /// (128675,DCM,"Head of Cardiology") + HeadOfCardiology, + /// (128673,DCM,"Administrator of Radiology Department") + AdministratorOfRadiologyDepartment, + /// (106292003,SCT,"Nurse") + Nurse, + /// (159016003,SCT,"Radiologic Technologist") + RadiologicTechnologist, + /// (128674,DCM,"Lead Radiologic Technologist") + LeadRadiologicTechnologist, + /// (3430008,SCT,"Radiation Therapist") + RadiationTherapist, + /// (159016003,SCT,"Radiographer") + Radiographer, + /// (C1144859,UMLS,"Intern") + Intern, + /// (405277009,SCT,"Resident") + Resident, + /// (158971006,SCT,"Registrar") + Registrar, + /// (121088,DCM,"Fellow") + Fellow, + /// (405279007,SCT,"Attending") + Attending, + /// (309390008,SCT,"Consultant") + Consultant, + /// (C1441532,UMLS,"Consulting Physician") + ConsultingPhysician, + /// (415506007,SCT,"Scrub nurse") + ScrubNurse, + /// (304292004,SCT,"Surgeon") + Surgeon, + /// (121092,DCM,"Sonologist") + Sonologist, + /// (C1954848,UMLS,"Sonographer") + Sonographer, + /// (C2985483,UMLS,"Radiation Physicist") + RadiationPhysicist, + /// (C1708969,UMLS,"Medical Physicist") + MedicalPhysicist + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID7452_OrganizationalRoles(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID7452_OrganizationalRoles(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID7452_OrganizationalRoles CMR_CID7452; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h new file mode 100644 index 00000000..9536a07c --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h @@ -0,0 +1,190 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID7453_PerformingRoles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:33 by J. Riesmeier + * + */ + + +#ifndef CMR_CID7453_H +#define CMR_CID7453_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 7453 - Performing Roles. + * (type: extensible, version: 20180326) + */ +class DCMTK_CMR_EXPORT CID7453_PerformingRoles + : public DSRContextGroup +{ + + public: + + /** types of performing roles + */ + enum EnumType + { + /// (121094,DCM,"Performing") + Performing, + /// (C1709880,UMLS,"Referring") + Referring, + /// (121096,DCM,"Requesting") + Requesting, + /// (121097,DCM,"Recording") + Recording, + /// (121098,DCM,"Verifying") + Verifying, + /// (121099,DCM,"Assisting") + Assisting, + /// (413854007,SCT,"Circulating Nurse") + CirculatingNurse, + /// (121101,DCM,"Standby") + Standby, + /// (113850,DCM,"Irradiation Authorizing") + IrradiationAuthorizing, + /// (113851,DCM,"Irradiation Administering") + IrradiationAdministering, + /// (C28747,NCIt,"Reader") + Reader, + /// (129001,DCM,"Eligibility Reader") + EligibilityReader, + /// (C96561,NCIt,"Adjudicator") + Adjudicator, + /// (C54634,NCIt,"Reviewer") + Reviewer, + /// (129002,DCM,"Designator") + Designator, + /// (129003,DCM,"Image Quality Controller") + ImageQualityController, + /// (129004,DCM,"Results Quality Controller") + ResultsQualityController + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID7453_PerformingRoles(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID7453_PerformingRoles(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID7453_PerformingRoles CMR_CID7453; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h new file mode 100644 index 00000000..4edd30a0 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h @@ -0,0 +1,182 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID7464_GeneralRegionOfInterestMeasurementModifiers + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:35 by J. Riesmeier + * + */ + + +#ifndef CMR_CID7464_H +#define CMR_CID7464_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 7464 - General Region of Interest Measurement Modifiers. + * (type: extensible, version: 20121101) + */ +class DCMTK_CMR_EXPORT CID7464_GeneralRegionOfInterestMeasurementModifiers + : public DSRContextGroup +{ + + public: + + /** types of general region of interest measurement modifiers + */ + enum EnumType + { + /// (56851009,SCT,"Maximum"), included from CID 3488 + Maximum, + /// (255605001,SCT,"Minimum"), included from CID 3488 + Minimum, + /// (373098007,SCT,"Mean"), included from CID 3488 + Mean, + /// (386136009,SCT,"Standard Deviation") + StandardDeviation, + /// (255619001,SCT,"Total") + Total, + /// (373099004,SCT,"Median") + Median, + /// (373100007,SCT,"Mode") + Mode, + /// (126031,DCM,"Peak Value Within ROI") + PeakValueWithinROI, + /// (C0681921,UMLS,"Coefficient of Variance") + CoefficientOfVariance, + /// (126051,DCM,"Skewness") + Skewness, + /// (126052,DCM,"Kurtosis") + Kurtosis, + /// (C1711260,UMLS,"Variance") + Variance, + /// (C2347976,UMLS,"Root Mean Square") + RootMeanSquare + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID7464_GeneralRegionOfInterestMeasurementModifiers(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID7464_GeneralRegionOfInterestMeasurementModifiers(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID7464_GeneralRegionOfInterestMeasurementModifiers CMR_CID7464; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h b/dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h new file mode 100644 index 00000000..2d38e554 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h @@ -0,0 +1,530 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CID7469_GenericIntensityAndSizeMeasurements + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:37 by J. Riesmeier + * + */ + + +#ifndef CMR_CID7469_H +#define CMR_CID7469_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" +#include "dcmtk/dcmsr/cmr/define.h" + +#include "dcmtk/ofstd/ofmap.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Context Group: + * CID 7469 - Generic Intensity and Size Measurements. + * (type: extensible, version: 20141110) + */ +class DCMTK_CMR_EXPORT CID7469_GenericIntensityAndSizeMeasurements + : public DSRContextGroup +{ + + public: + + /** types of generic intensity and size measurements + */ + enum EnumType + { + /// (115391007,SCT,"N-acetylaspartate"), included from CID 4033 + NAcetylaspartate, + /// (59351004,SCT,"Citrate"), included from CID 4033 + Citrate, + /// (65123005,SCT,"Choline"), included from CID 4033 + Choline, + /// (14804005,SCT,"Creatine"), included from CID 4033 + Creatine, + /// (113094,DCM,"Creatine and Choline"), included from CID 4033 + CreatineAndCholine, + /// (83036002,SCT,"Lactate"), included from CID 4033 + Lactate, + /// (70106000,SCT,"Lipid"), included from CID 4033 + Lipid, + /// (113095,DCM,"Lipid and Lactate"), included from CID 4033 + LipidAndLactate, + /// (113080,DCM,"Glutamate and glutamine"), included from CID 4033 + GlutamateAndGlutamine, + /// (25761002,SCT,"Glutamine"), included from CID 4033 + Glutamine, + /// (10944007,SCT,"Tuarine"), included from CID 4033 + Tuarine, + /// (72164009,SCT,"Inositol"), included from CID 4033 + Inositol, + /// (113081,DCM,"Choline/Creatine Ratio"), included from CID 4033 + CholinePerCreatineRatio, + /// (113082,DCM,"N-acetylaspartate/Creatine Ratio"), included from CID 4033 + NAcetylaspartatePerCreatineRatio, + /// (113083,DCM,"N-acetylaspartate/Choline Ratio"), included from CID 4033 + NAcetylaspartatePerCholineRatio, + /// (113096,DCM,"Creatine+Choline/Citrate Ratio"), included from CID 4033 + CreatinePlusCholinePerCitrateRatio, + /// (113063,DCM,"T1"), included from CID 7180 + T1, + /// (113065,DCM,"T2"), included from CID 7180 + T2, + /// (113064,DCM,"T2*"), included from CID 7180 + T2Star, + /// (113058,DCM,"Proton Density"), included from CID 7180 + ProtonDensity, + /// (110800,DCM,"Spin Tagging Perfusion MR Signal Intensity"), included from CID 7180 + SpinTaggingPerfusionMRSignalIntensity, + /// (113070,DCM,"Velocity encoded"), included from CID 7180 + VelocityEncoded, + /// (113067,DCM,"Temperature encoded"), included from CID 7180 + TemperatureEncoded, + /// (110801,DCM,"Contrast Agent Angio MR Signal Intensity"), included from CID 7180 + ContrastAgentAngioMRSignalIntensity, + /// (110802,DCM,"Time Of Flight Angio MR Signal Intensity"), included from CID 7180 + TimeOfFlightAngioMRSignalIntensity, + /// (110803,DCM,"Proton Density Weighted MR Signal Intensity"), included from CID 7180 + ProtonDensityWeightedMRSignalIntensity, + /// (110804,DCM,"T1 Weighted MR Signal Intensity"), included from CID 7180 + T1WeightedMRSignalIntensity, + /// (110805,DCM,"T2 Weighted MR Signal Intensity"), included from CID 7180 + T2WeightedMRSignalIntensity, + /// (110806,DCM,"T2* Weighted MR Signal Intensity"), included from CID 7180 + T2StarWeightedMRSignalIntensity, + /// (113043,DCM,"Diffusion weighted"), included from CID 7270 + DiffusionWeighted, + /// (110810,DCM,"Volumetric Diffusion Dxx Component"), included from CID 7270 + VolumetricDiffusionDxxComponent, + /// (110811,DCM,"Volumetric Diffusion Dxy Component"), included from CID 7270 + VolumetricDiffusionDxyComponent, + /// (110812,DCM,"Volumetric Diffusion Dxz Component"), included from CID 7270 + VolumetricDiffusionDxzComponent, + /// (110813,DCM,"Volumetric Diffusion Dyy Component"), included from CID 7270 + VolumetricDiffusionDyyComponent, + /// (110814,DCM,"Volumetric Diffusion Dyz Component"), included from CID 7270 + VolumetricDiffusionDyzComponent, + /// (110815,DCM,"Volumetric Diffusion Dzz Component"), included from CID 7270 + VolumetricDiffusionDzzComponent, + /// (110808,DCM,"Fractional Anisotropy"), included from CID 7271 + FractionalAnisotropy, + /// (110809,DCM,"Relative Anisotropy"), included from CID 7271 + RelativeAnisotropy, + /// (113288,DCM,"Volume Ratio"), included from CID 7271 + VolumeRatio, + /// (113041,DCM,"Apparent Diffusion Coefficient"), included from CID 7272 + ApparentDiffusionCoefficient, + /// (113289,DCM,"Diffusion Coefficient"), included from CID 7272 + DiffusionCoefficient, + /// (113290,DCM,"Mono-exponential Apparent Diffusion Coefficient"), included from CID 7272 + MonoExponentialApparentDiffusionCoefficient, + /// (113291,DCM,"Slow Diffusion Coefficient"), included from CID 7272 + SlowDiffusionCoefficient, + /// (113292,DCM,"Fast Diffusion Coefficient"), included from CID 7272 + FastDiffusionCoefficient, + /// (113293,DCM,"Fast Diffusion Coefficient Fraction"), included from CID 7272 + FastDiffusionCoefficientFraction, + /// (113294,DCM,"Kurtosis Diffusion Coefficient"), included from CID 7272 + KurtosisDiffusionCoefficient, + /// (113295,DCM,"Gamma Distribution Scale Parameter"), included from CID 7272 + GammaDistributionScaleParameter, + /// (113296,DCM,"Gamma Distribution Shape Parameter"), included from CID 7272 + GammaDistributionShapeParameter, + /// (113297,DCM,"Gamma Distribution Mode"), included from CID 7272 + GammaDistributionMode, + /// (113298,DCM,"Distributed Diffusion Coefficient"), included from CID 7272 + DistributedDiffusionCoefficient, + /// (113299,DCM,"Anomalous Exponent Parameter"), included from CID 7272 + AnomalousExponentParameter, + /// (110807,DCM,"Field Map MR Signal Intensity"), included from CID 7180 + FieldMapMRSignalIntensity, + /// (110816,DCM,"T1 Weighted Dynamic Contrast Enhanced MR Signal Intensity"), included from CID 7180 + T1WeightedDynamicContrastEnhancedMRSignalIntensity, + /// (110817,DCM,"T2 Weighted Dynamic Contrast Enhanced MR Signal Intensity"), included from CID 7180 + T2WeightedDynamicContrastEnhancedMRSignalIntensity, + /// (110818,DCM,"T2* Weighted Dynamic Contrast Enhanced MR Signal Intensity"), included from CID 7180 + T2StarWeightedDynamicContrastEnhancedMRSignalIntensity, + /// (110819,DCM,"Blood Oxygenation Level"), included from CID 7180 + BloodOxygenationLevel, + /// (110820,DCM,"Nuclear Medicine Projection Activity"), included from CID 7180 + NuclearMedicineProjectionActivity, + /// (110821,DCM,"Nuclear Medicine Tomographic Activity"), included from CID 7180 + NuclearMedicineTomographicActivity, + /// (110822,DCM,"Spatial Displacement X Component"), included from CID 7180 + SpatialDisplacementXComponent, + /// (110823,DCM,"Spatial Displacement Y Component"), included from CID 7180 + SpatialDisplacementYComponent, + /// (110824,DCM,"Spatial Displacement Z Component"), included from CID 7180 + SpatialDisplacementZComponent, + /// (110825,DCM,"Hemodynamic Resistance"), included from CID 7180 + HemodynamicResistance, + /// (110826,DCM,"Indexed Hemodynamic Resistance"), included from CID 7180 + IndexedHemodynamicResistance, + /// (112031,DCM,"Attenuation Coefficient"), included from CID 7180 + AttenuationCoefficient, + /// (110827,DCM,"Tissue Velocity"), included from CID 7180 + TissueVelocity, + /// (110828,DCM,"Flow Velocity"), included from CID 7180 + FlowVelocity, + /// (425704008,SCT,"Power Doppler"), included from CID 7180 + PowerDoppler, + /// (110829,DCM,"Flow Variance"), included from CID 7180 + FlowVariance, + /// (110830,DCM,"Elasticity"), included from CID 7180 + Elasticity, + /// (110831,DCM,"Perfusion"), included from CID 7180 + Perfusion, + /// (110832,DCM,"Speed of sound"), included from CID 7180 + SpeedOfSound, + /// (110833,DCM,"Ultrasound Attenuation"), included from CID 7180 + UltrasoundAttenuation, + /// (113068,DCM,"Student's T-test"), included from CID 7180 + StudentsTTest, + /// (113071,DCM,"Z-score"), included from CID 7180 + ZScore, + /// (113057,DCM,"R-Coefficient"), included from CID 7180 + RCoefficient, + /// (126220,DCM,"R2-Coefficient"), included from CID 7180 + R2Coefficient, + /// (126221,DCM,"Chi-square"), included from CID 7180 + ChiSquare, + /// (126222,DCM,"D-W"), included from CID 7180 + DW, + /// (126223,DCM,"AIC"), included from CID 7180 + AIC, + /// (126224,DCM,"BIC"), included from CID 7180 + BIC, + /// (110834,DCM,"RGB R Component"), included from CID 7180 + RGBRComponent, + /// (110835,DCM,"RGB G Component"), included from CID 7180 + RGBGComponent, + /// (110836,DCM,"RGB B Component"), included from CID 7180 + RGBBComponent, + /// (110837,DCM,"YBR FULL Y Component"), included from CID 7180 + YBR_FULLYComponent, + /// (110838,DCM,"YBR FULL CB Component"), included from CID 7180 + YBR_FULL_CBComponent, + /// (110839,DCM,"YBR FULL CR Component"), included from CID 7180 + YBR_FULL_CRComponent, + /// (110840,DCM,"YBR PARTIAL Y Component"), included from CID 7180 + YBR_PARTIALYComponent, + /// (110841,DCM,"YBR PARTIAL CB Component"), included from CID 7180 + YBR_PARTIAL_CBComponent, + /// (110842,DCM,"YBR PARTIAL CR Component"), included from CID 7180 + YBR_PARTIAL_CRComponent, + /// (110843,DCM,"YBR ICT Y Component"), included from CID 7180 + YBR_ICTYComponent, + /// (110844,DCM,"YBR ICT CB Component"), included from CID 7180 + YBR_ICT_CBComponent, + /// (110845,DCM,"YBR ICT CR Component"), included from CID 7180 + YBR_ICT_CRComponent, + /// (110846,DCM,"YBR RCT Y Component"), included from CID 7180 + YBR_RCTYComponent, + /// (110847,DCM,"YBR RCT CB Component"), included from CID 7180 + YBR_RCT_CBComponent, + /// (110848,DCM,"YBR RCT CR Component"), included from CID 7180 + YBR_RCT_CRComponent, + /// (110849,DCM,"Echogenicity"), included from CID 7180 + Echogenicity, + /// (110850,DCM,"X-Ray Attenuation"), included from CID 7180 + XRayAttenuation, + /// (110852,DCM,"MR signal intensity"), included from CID 7180 + MRSignalIntensity, + /// (110853,DCM,"Binary Segmentation"), included from CID 7180 + BinarySegmentation, + /// (110854,DCM,"Fractional Probabilistic Segmentation"), included from CID 7180 + FractionalProbabilisticSegmentation, + /// (110855,DCM,"Fractional Occupancy Segmentation"), included from CID 7180 + FractionalOccupancySegmentation, + /// (126393,DCM,"R1"), included from CID 7180 + R1, + /// (126394,DCM,"R2"), included from CID 7180 + R2, + /// (126395,DCM,"R2*"), included from CID 7180 + R2Star, + /// (113098,DCM,"Magnetization Transfer Ratio"), included from CID 7180 + MagnetizationTransferRatio, + /// (126396,DCM,"Magnetic Susceptibility"), included from CID 7180 + MagneticSusceptibility, + /// (126312,DCM,"Ktrans"), included from CID 4107 + Ktrans, + /// (126313,DCM,"kep"), included from CID 4107 + Kep, + /// (126314,DCM,"ve"), included from CID 4107 + Ve, + /// (126330,DCM,"tau_m"), included from CID 4107 + Tau_m, + /// (126331,DCM,"vp"), included from CID 4107 + Vp, + /// (126390,DCM,"Absolute Regional Blood Flow"), included from CID 4108 + AbsoluteRegionalBloodFlow, + /// (126391,DCM,"Absolute Regional Blood Volume"), included from CID 4108 + AbsoluteRegionalBloodVolume, + /// (126397,DCM,"Relative Regional Blood Flow"), included from CID 4108 + RelativeRegionalBloodFlow, + /// (126398,DCM,"Relative Regional Blood Volume"), included from CID 4108 + RelativeRegionalBloodVolume, + /// (113052,DCM,"Mean Transit Time"), included from CID 4108 + MeanTransitTime, + /// (113069,DCM,"Time To Peak"), included from CID 4108 + TimeToPeak, + /// (126392,DCM,"Oxygen Extraction Fraction"), included from CID 4108 + OxygenExtractionFraction, + /// (113084,DCM,"Tmax"), included from CID 4108 + Tmax, + /// (126320,DCM,"IAUC"), included from CID 4109 + IAUC, + /// (126321,DCM,"IAUC60"), included from CID 4109 + IAUC60, + /// (126322,DCM,"IAUC90"), included from CID 4109 + IAUC90, + /// (126323,DCM,"IAUC180"), included from CID 4109 + IAUC180, + /// (126324,DCM,"IAUCBN"), included from CID 4109 + IAUCBN, + /// (126325,DCM,"IAUC60BN"), included from CID 4109 + IAUC60BN, + /// (126326,DCM,"IAUC90BN"), included from CID 4109 + IAUC90BN, + /// (126327,DCM,"IAUC180BN"), included from CID 4109 + IAUC180BN, + /// (126370,DCM,"Time of Peak Concentration"), included from CID 4109 + TimeOfPeakConcentration, + /// (126372,DCM,"Time of Leading Half-Peak Concentration"), included from CID 4109 + TimeOfLeadingHalfPeakConcentration, + /// (126371,DCM,"Bolus Arrival Time"), included from CID 4109 + BolusArrivalTime, + /// (126374,DCM,"Temporal Derivative Threshold"), included from CID 4109 + TemporalDerivativeThreshold, + /// (126375,DCM,"Maximum Slope"), included from CID 4109 + MaximumSlope, + /// (126376,DCM,"Maximum Difference"), included from CID 4109 + MaximumDifference, + /// (126377,DCM,"Tracer Concentration"), included from CID 4109 + TracerConcentration, + /// (126400,DCM,"Standardized Uptake Value"), included from CID 7180 + StandardizedUptakeValue, + /// (126401,DCM,"SUVbw"), included from CID 7180 + SUVbw, + /// (126402,DCM,"SUVlbm"), included from CID 7180 + SUVlbm, + /// (126406,DCM,"SUVlbm(James128)"), included from CID 7180 + SUVlbmJames128, + /// (126405,DCM,"SUVlbm(Janma)"), included from CID 7180 + SUVlbmJanma, + /// (126403,DCM,"SUVbsa"), included from CID 7180 + SUVbsa, + /// (126404,DCM,"SUVibw"), included from CID 7180 + SUVibw, + /// (128513,DCM,"Absorbed Dose"), included from CID 10070 + AbsorbedDose, + /// (128512,DCM,"Equivalent Dose"), included from CID 10070 + EquivalentDose, + /// (256674009,SCT,"Fat"), included from CID 7180 + Fat, + /// (129100,DCM,"Fat fraction"), included from CID 7180 + FatFraction, + /// (129101,DCM,"Water/fat in phase"), included from CID 7180 + WaterPerFatInPhase, + /// (129102,DCM,"Water/fat out of phase"), included from CID 7180 + WaterPerFatOutOfPhase, + /// (113054,DCM,"Negative enhancement integral"), included from CID 7180 + NegativeEnhancementIntegral, + /// (113059,DCM,"Signal change"), included from CID 7180 + SignalChange, + /// (113060,DCM,"Signal to noise"), included from CID 7180 + SignalToNoise, + /// (113066,DCM,"Time course of signal"), included from CID 7180 + TimeCourseOfSignal, + /// (11713004,SCT,"Water"), included from CID 7180 + Water, + /// (129103,DCM,"Water fraction"), included from CID 7180 + WaterFraction, + /// (130086,DCM,"Relative Linear Stopping Power"), included from CID 7180 + RelativeLinearStoppingPower, + /// (410668003,SCT,"Length"), included from CID 7470 + Length, + /// (121211,DCM,"Path length"), included from CID 7470 + PathLength, + /// (121206,DCM,"Distance"), included from CID 7470 + Distance, + /// (103355008,SCT,"Width"), included from CID 7470 + Width, + /// (131197000,SCT,"Depth"), included from CID 7470 + Depth, + /// (81827009,SCT,"Diameter"), included from CID 7470 + Diameter, + /// (103339001,SCT,"Long Axis"), included from CID 7470 + LongAxis, + /// (103340004,SCT,"Short Axis"), included from CID 7470 + ShortAxis, + /// (131187009,SCT,"Major Axis"), included from CID 7470 + MajorAxis, + /// (131188004,SCT,"Minor Axis"), included from CID 7470 + MinorAxis, + /// (131189007,SCT,"Perpendicular Axis"), included from CID 7470 + PerpendicularAxis, + /// (131190003,SCT,"Radius"), included from CID 7470 + Radius, + /// (131191004,SCT,"Perimeter"), included from CID 7470 + Perimeter, + /// (74551000,SCT,"Circumference"), included from CID 7470 + Circumference, + /// (131192006,SCT,"Diameter of circumscribed circle"), included from CID 7470 + DiameterOfCircumscribedCircle, + /// (121207,DCM,"Height"), included from CID 7470 + Height, + /// (L0JK,IBSI,"Maximum 3D Diameter of a Mesh"), included from CID 7470 + Maximum3DDiameterOfAMesh, + /// (TDIC,IBSI,"Major Axis in 3D Length"), included from CID 7470 + MajorAxisIn3DLength, + /// (P9VJ,IBSI,"Minor Axis in 3D Length"), included from CID 7470 + MinorAxisIn3DLength, + /// (7J51,IBSI,"Least Axis in 3D Length"), included from CID 7470 + LeastAxisIn3DLength, + /// (42798000,SCT,"Area"), included from CID 7471 + Area, + /// (131184002,SCT,"Area of defined region"), included from CID 7471 + AreaOfDefinedRegion, + /// (C0JK,IBSI,"Surface Area of Mesh"), included from CID 7471 + SurfaceAreaOfMesh, + /// (118565006,SCT,"Volume"), included from CID 7472 + Volume, + /// (121216,DCM,"Volume estimated from single 2D region"), included from CID 7472 + VolumeEstimatedFromSingle2DRegion, + /// (121218,DCM,"Volume estimated from two non-coplanar 2D regions"), included from CID 7472 + VolumeEstimatedFromTwoNonCoplanar2DRegions, + /// (121217,DCM,"Volume estimated from three or more non-coplanar 2D regions"), included from CID 7472 + VolumeEstimatedFromThreeOrMoreNonCoplanar2DRegions, + /// (121222,DCM,"Volume of sphere"), included from CID 7472 + VolumeOfSphere, + /// (121221,DCM,"Volume of ellipsoid"), included from CID 7472 + VolumeOfEllipsoid, + /// (121220,DCM,"Volume of circumscribed sphere"), included from CID 7472 + VolumeOfCircumscribedSphere, + /// (121219,DCM,"Volume of bounding three dimensional region"), included from CID 7472 + VolumeOfBoundingThreeDimensionalRegion, + /// (RNU0,IBSI,"Volume of Mesh"), included from CID 7472 + VolumeOfMesh, + /// (YEKZ,IBSI,"Volume from Voxel Summation"), included from CID 7472 + VolumeFromVoxelSummation + }; + + /** (default) constructor + ** @param selectedValue coded entry to be selected as the current value (optional). + * Should be a valid code according to the DICOM definitions + * for this context group, i.e. no checks are performed. + * Call DSRContextGroup::checkSelectedValue() if needed. + */ + CID7469_GenericIntensityAndSizeMeasurements(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** constructor + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + */ + CID7469_GenericIntensityAndSizeMeasurements(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + /** select a coded entry given by its type as the current value + ** @param selectedValue type mapped to a coded entry that is selected as the + * current value + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode = OFFalse); + + // --- static helper functions --- + + /** initialize this context group explicitly. Internally, the list of standard coded + * entries is created and initialized by calling getCodes(). + ** @note This function can be called multiple times but in case of multi-threaded + * applications should be called at least once before any instance of this class + * is actually used. For single-threaded applications, there is no need to call + * it since the initialization is done implicitly. + */ + static void initialize(); + + /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. + * Usually, there is no need to call this method, but it might be useful in order to + * explicitly free the associated memory, e.g. when checking for memory leaks. The list + * will be recreated automatically when needed (or when initialize() is called). + */ + static void cleanup(); + + /** map a given type to the associated coded entry + ** @param value type that should be mapped to a coded entry + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return coded entry that is associated with the given type + */ + static DSRCodedEntryValue getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode = OFFalse); + + // --- reintroduce methods from base class + + using DSRContextGroup::selectValue; + using DSRContextGroup::findCodedEntry; + + + protected: + + /// type used for storing and managing the coded entries + typedef OFMap CodeList; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + // --- static helper function --- + + /** get list of standard coded entries that are managed by this context group. + * Internally, the singleton pattern is used, so the list is initialized only once. + * Please note that this function is not thread-safe. Therefore, the initialize() + * function can be called before any instance of this class is actually used. + ** @return reference to list of coded entries managed by this context group + */ + static CodeList &getCodes(); + + /** set the "Enhanced Encoding Mode" for a given coded entry + ** @param codedEntryValue coded entry for which the enhanced encoding mode is set + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); + + + private: + + /// pointer to internal code list (use a static variable for singleton pattern) + static CodeList *Codes; +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the context group class +typedef CID7469_GenericIntensityAndSizeMeasurements CMR_CID7469; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/define.h b/dcmsr/include/dcmtk/dcmsr/cmr/define.h new file mode 100644 index 00000000..86c5b1d8 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/define.h @@ -0,0 +1,28 @@ +/* + * + * Copyright (C) 2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with preprocessor definitions for submodule "dcmsr/cmr" + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_DEFINE_H +#define CMR_DEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef cmr_EXPORTS +#define DCMTK_CMR_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_CMR_EXPORT DCMTK_DECL_IMPORT +#endif + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/init.h b/dcmsr/include/dcmtk/dcmsr/cmr/init.h new file mode 100644 index 00000000..7cbf4813 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/init.h @@ -0,0 +1,76 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CMR_ContentMappingResource + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_INIT_H +#define CMR_INIT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/define.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** General purpose class hiding global functions used for the "Content Mapping Resource" + * (CMR) from the global namespace. + * All functions are static and can, therefore, be accessed without creating an instance + * of this class. + */ +class DCMTK_CMR_EXPORT CMR_ContentMappingResource +{ + + public: + + /** initialize \e all supported context groups of the "Content Mapping Resource" + * explicitly. Currently, the following context group classes are supported: + * - CID11_RouteOfAdministration + * - CID29_AcquisitionModality + * - CID42_NumericValueQualifier + * - CID100_QuantitativeDiagnosticImagingProcedures + * - CID244_Laterality + * - CID4020_PETRadionuclide + * - CID4021_PETRadiopharmaceutical + * - CID4031_CommonAnatomicRegions + * - CID5000_Languages + * - CID5001_Countries + * - CID6147_ResponseCriteria + * - CID7021_MeasurementReportDocumentTitles + * - CID7181_AbstractMultiDimensionalImageModelComponentUnits + * - CID7445_DeviceParticipatingRoles + * - CID7452_OrganizationalRoles + * - CID7453_PerformingRoles + * - CID7464_GeneralRegionOfInterestMeasurementModifiers + * - CID7469_GenericIntensityAndSizeMeasurements + * - CID10013_CTAcquisitionType + * - CID10033_CTReconstructionAlgorithm + * + ** @note In case of multi-threaded applications, this function could be called + * before any context group is actually used. This might be easier than + * calling the initialize() function of the respective context group classes + * separately. However, since the list of supported context groups is + * increasing over time, the additional resource requirements should be + * considered. That means, if only a few context groups are used, it is + * recommended to call the individual initialize() functions instead. + */ + static void initializeAllContextGroups(); + + /** cleanup \e all supported context groups of the "Content Mapping Resource". + * Usually, there is no need to call this method, but it might be useful in order + * to explicitly free the associated memory, e.g. when checking for memory leaks. + * See initializeAllContextGroups() for a list of supported context groups. + */ + static void cleanupAllContextGroups(); +}; + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/logger.h b/dcmsr/include/dcmtk/dcmsr/cmr/logger.h new file mode 100644 index 00000000..90f24f96 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/logger.h @@ -0,0 +1,35 @@ +/* + * + * Copyright (C) 2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with logger definition for submodule "dcmsr/cmr" + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_LOGGER_H +#define CMR_LOGGER_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/oflog/oflog.h" + +#include "dcmtk/dcmsr/cmr/define.h" + + +// global definitions for logging mechanism provided by the oflog module + +extern DCMTK_CMR_EXPORT OFLogger DCM_dcmsrCmrLogger; + +#define DCMSR_CMR_TRACE(msg) OFLOG_TRACE(DCM_dcmsrCmrLogger, msg) +#define DCMSR_CMR_DEBUG(msg) OFLOG_DEBUG(DCM_dcmsrCmrLogger, msg) +#define DCMSR_CMR_INFO(msg) OFLOG_INFO(DCM_dcmsrCmrLogger, msg) +#define DCMSR_CMR_WARN(msg) OFLOG_WARN(DCM_dcmsrCmrLogger, msg) +#define DCMSR_CMR_ERROR(msg) OFLOG_ERROR(DCM_dcmsrCmrLogger, msg) +#define DCMSR_CMR_FATAL(msg) OFLOG_FATAL(DCM_dcmsrCmrLogger, msg) + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/srnumvl.h b/dcmsr/include/dcmtk/dcmsr/cmr/srnumvl.h new file mode 100644 index 00000000..8a1cd56e --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/srnumvl.h @@ -0,0 +1,165 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CMR_SRNumericMeasurementValue + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_SRNUMVL_H +#define CMR_SRNUMVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrnumvl.h" +#include "dcmtk/dcmsr/cmr/cid42.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for SR numeric values and measurements + * (extended version with additional support of the DICOM Content Mapping Resource). + * This class checks whether the optional value qualifier uses a coded entry from the + * Defined Context Group 42 (Numeric Value Qualifier), see DICOM PS 3.3 Table C.18.1-1. + */ +class DCMTK_CMR_EXPORT CMR_SRNumericMeasurementValue + : public DSRNumericMeasurementValue +{ + + public: + + /** default constructor + */ + CMR_SRNumericMeasurementValue(); + + /** constructor + ** @param numericValue numeric value (VR=DS, mandatory) + * @param measurementUnit code representing the units of measurement (mandatory) + * @param check if enabled, check 'numericValue' and 'measurementUnit' for + * validity before setting them. See corresponding setValue() + * method for details. + */ + CMR_SRNumericMeasurementValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const OFBool check = OFTrue); + + /** constructor + ** @param valueQualifier code representing the numeric value qualifier. Used to + * specify the reason for the absence of the measured value + * sequence, i.e. why the numeric value and measurement unit + * are empty. + * @param check if enabled, check value for validity before setting it. + * See corresponding setValue() method for details. + */ + CMR_SRNumericMeasurementValue(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + /** constructor + ** @param numericValue numeric value (VR=DS, mandatory) + * @param measurementUnit code representing the units of measurement (mandatory) + * @param valueQualifier code representing the numeric value qualifier (optional). + * Can also be used to specify the reason for the absence of + * the measured value sequence (where 'numericValue' and + * 'measurementUnit' are stored). + * @param check if enabled, check values for validity before setting them. + * See corresponding setValue() method for details. + */ + CMR_SRNumericMeasurementValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + /** copy constructor + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + */ + CMR_SRNumericMeasurementValue(const CMR_SRNumericMeasurementValue &numericMeasurement); + + /** copy constructor + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + */ + CMR_SRNumericMeasurementValue(const DSRNumericMeasurementValue &numericMeasurement); + + /** destructor + */ + virtual ~CMR_SRNumericMeasurementValue(); + + /** assignment operator + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + ** @return reference to this numeric value after 'numericMeasurement' has been copied + */ + CMR_SRNumericMeasurementValue &operator=(const CMR_SRNumericMeasurementValue &numericMeasurement); + + /** set empty numeric value and measurement unit with a numeric value qualifier. + * Before setting the value, it is usually checked. If the value is invalid, the + * current numeric measurement value is not replaced and remains unchanged. + ** @param valueQualifier numeric value qualifier to be set. Used to specify the + * reason for the absence of the measured value sequence, + * i.e. why the numeric value and measurement unit are empty. + * @param check if enabled, check value for validity before setting it. + * See checkNumericValueQualifier() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + /** set numeric value, measurement unit and numeric value qualifier. + * Before setting the values, they are usually checked. Please note that both + * 'numericValue' and 'measurementUnit' either have to be empty or non-empty. + * If one of the three values is invalid, the current numeric measurement value is not + * replaced and remains unchanged. If the values are replaced, the optional floating + * point and rational representations are cleared, i.e. they have to be set manually if + * needed. + ** @param numericValue numeric value to be set (VR=DS, mandatory) + * @param measurementUnit measurement unit to be set (mandatory) + * @param valueQualifier numeric value qualifier to be set (optional). Can also be + * used to specify the reason for the absence of the measured + * value sequence (where 'numericValue' and 'measurementUnit' + * are stored). Use an empty code to remove the current value. + * @param check if enabled, check values for validity before setting them. + * See checkXXX() methods for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + /** set numeric value qualifier. + * This optional code specifies the qualification of the Numeric Value in the Measured + * Value Sequence, or the reason for the absence of the Measured Value Sequence Item. + * Before setting the code, it is usually checked. If the code is invalid the current + * code is not replaced and remains unchanged. + ** @param valueQualifier numeric value qualifier to be set (optional). Use an empty + * code to remove the current value. + * @param check if enabled, check value for validity before setting it. + * See checkNumericValueQualifier() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValueQualifier(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + // --- reintroduce method from base class + + using DSRNumericMeasurementValue::setValue; + using DSRNumericMeasurementValue::setNumericValueQualifier; + + + protected: + + /** check the specified numeric value qualifier for validity. + * In addition to DSRNumericMeasurementValue::checkNumericValueQualifier(), this method + * also checks the conformance with the Context Group 42 (see CID42_NumericValueQualifier). + ** @param valueQualifier numeric value qualifier to be checked + ** @return status, EC_Normal if value qualifier is valid, an error code otherwise + */ + virtual OFCondition checkNumericValueQualifier(const DSRCodedEntryValue &valueQualifier) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/srnumvlu.h b/dcmsr/include/dcmtk/dcmsr/cmr/srnumvlu.h new file mode 100644 index 00000000..2838da00 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/srnumvlu.h @@ -0,0 +1,319 @@ +/* + * + * Copyright (C) 2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class CMR_SRNumericMeasurementValueWithUnits + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_SRNUMVLU_H +#define CMR_SRNUMVLU_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/srnumvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for SR numeric values and measurements + * (extended version with additional support of the DICOM Content Mapping Resource). + * This class checks whether the optional value qualifier uses a coded entry from the + * Defined Context Group 42 (Numeric Value Qualifier), see DICOM PS 3.3 Table C.18.1-1. + * It also provides a means of specifying the Context Group for the measurement unit + * as a C++ template type parameter. Both Baseline (BCID) and Defined Context Groups + * (DCID) are supported. + ** @tparam T_Units template type used for the measurement units (context group) + * @tparam T_DefinedGroup flag indicating whether 'T_Units' is used as a baseline + * (default) or defined context group + */ +template +class CMR_SRNumericMeasurementValueWithUnits + : public CMR_SRNumericMeasurementValue +{ + + public: + + /** default constructor + */ + CMR_SRNumericMeasurementValueWithUnits(); + + /** constructor + ** @param numericValue numeric value (VR=DS, mandatory) + * @param measurementUnit code representing the units of measurement (mandatory) + * @param check if enabled, check 'numericValue' and 'measurementUnit' for + * validity before setting them. See corresponding setValue() + * method for details. + */ + CMR_SRNumericMeasurementValueWithUnits(const OFString &numericValue, + const T_Units &measurementUnit, + const OFBool check = OFTrue); + + /** constructor + ** @param valueQualifier code representing the numeric value qualifier. Used to + * specify the reason for the absence of the measured value + * sequence, i.e. why the numeric value and measurement unit + * are empty. + * @param check if enabled, check value for validity before setting it. + * See corresponding setValue() method for details. + */ + CMR_SRNumericMeasurementValueWithUnits(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + /** constructor + ** @param numericValue numeric value (VR=DS, mandatory) + * @param measurementUnit code representing the units of measurement (mandatory) + * @param valueQualifier code representing the numeric value qualifier (optional). + * Can also be used to specify the reason for the absence of + * the measured value sequence (where 'numericValue' and + * 'measurementUnit' are stored). + * @param check if enabled, check values for validity before setting them. + * See corresponding setValue() method for details. + */ + CMR_SRNumericMeasurementValueWithUnits(const OFString &numericValue, + const T_Units &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + /** copy constructor + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + */ + CMR_SRNumericMeasurementValueWithUnits(const CMR_SRNumericMeasurementValueWithUnits &numericMeasurement); + + /** copy constructor + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + */ + CMR_SRNumericMeasurementValueWithUnits(const CMR_SRNumericMeasurementValue &numericMeasurement); + + /** destructor + */ + virtual ~CMR_SRNumericMeasurementValueWithUnits(); + + /** assignment operator + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + ** @return reference to this numeric value after 'numericMeasurement' has been copied + */ + CMR_SRNumericMeasurementValueWithUnits &operator=(const CMR_SRNumericMeasurementValueWithUnits &numericMeasurement); + + /** set numeric value and measurement unit. + * Before setting the values, they are usually checked. Please note that both values + * (i.e. 'numericValue' and 'measurementUnit') either have to be empty or non-empty. + * If the value pair is invalid, the current value pair is not replaced and remains + * unchanged. If the value pair is replaced, the optional floating point and rational + * representations are cleared, i.e. they have to be set manually if needed. + ** @param numericValue numeric value to be set (VR=DS, mandatory) + * @param measurementUnit measurement unit to be set (mandatory) + * @param check if enabled, check values for validity before setting them. + * See checkXXX() methods for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const OFString &numericValue, + const T_Units &measurementUnit, + const OFBool check = OFTrue); + + /** set numeric value, measurement unit and numeric value qualifier. + * Before setting the values, they are usually checked. Please note that both + * 'numericValue' and 'measurementUnit' either have to be empty or non-empty. + * If one of the three values is invalid, the current numeric measurement value is not + * replaced and remains unchanged. If the values are replaced, the optional floating + * point and rational representations are cleared, i.e. they have to be set manually if + * needed. + ** @param numericValue numeric value to be set (VR=DS, mandatory) + * @param measurementUnit measurement unit to be set (mandatory) + * @param valueQualifier numeric value qualifier to be set (optional). Can also be + * used to specify the reason for the absence of the measured + * value sequence (where 'numericValue' and 'measurementUnit' + * are stored). Use an empty code to remove the current value. + * @param check if enabled, check values for validity before setting them. + * See checkXXX() methods for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const OFString &numericValue, + const T_Units &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check = OFTrue); + + /** set measurement unit. + * Before setting the code, it is usually checked. If the code is invalid the current + * code is not replaced and remains unchanged. + ** @param measurementUnit measurement unit to be set (mandatory) + * @param check if enabled, check value for validity before setting it. + * See checkMeasurementUnit() method for details. An empty + * value is never accepted, use the clear() method instead. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasurementUnit(const T_Units &measurementUnit, + const OFBool check = OFTrue); + + + protected: + + /** check the specified measurement unit for validity. + * First, the inherited method CMR_SRNumericMeasurementValue::checkMeasurementUnit() + * is called. Then, conformance with any Defined Context Group (T_Units) is checked. + ** @param measurementUnit measurement unit to be checked + ** @return status, EC_Normal if measurement unit is valid, an error code otherwise + */ + virtual OFCondition checkMeasurementUnit(const DSRCodedEntryValue &measurementUnit) const; + + /** check the specified measurement unit for validity. + * This method also checks conformance with any Defined Context Group (T_Units). + ** @param measurementUnit measurement unit to be checked + ** @return status, EC_Normal if measurement unit is valid, an error code otherwise + */ + virtual OFCondition checkMeasurementUnit(const T_Units &measurementUnit) const; +}; + + +/*------------------* + * implementation * + *------------------*/ + +template +CMR_SRNumericMeasurementValueWithUnits::CMR_SRNumericMeasurementValueWithUnits() + : CMR_SRNumericMeasurementValue() +{ +} + +template +CMR_SRNumericMeasurementValueWithUnits::CMR_SRNumericMeasurementValueWithUnits(const OFString &numericValue, + const T_Units &measurementUnit, + const OFBool check) + : CMR_SRNumericMeasurementValue() +{ + /* use this method in order to pass T_Units parameter */ + setValue(numericValue, measurementUnit, check); +} + + +template +CMR_SRNumericMeasurementValueWithUnits::CMR_SRNumericMeasurementValueWithUnits(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) + : CMR_SRNumericMeasurementValue(valueQualifier, check) +{ +} + + +template +CMR_SRNumericMeasurementValueWithUnits::CMR_SRNumericMeasurementValueWithUnits(const OFString &numericValue, + const T_Units &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) + : CMR_SRNumericMeasurementValue() +{ + /* use this method in order to pass T_Units parameter */ + setValue(numericValue, measurementUnit, valueQualifier, check); +} + + +template +CMR_SRNumericMeasurementValueWithUnits::CMR_SRNumericMeasurementValueWithUnits(const CMR_SRNumericMeasurementValueWithUnits &numericMeasurement) + : CMR_SRNumericMeasurementValue(numericMeasurement) +{ +} + + +template +CMR_SRNumericMeasurementValueWithUnits::CMR_SRNumericMeasurementValueWithUnits(const CMR_SRNumericMeasurementValue &numericMeasurement) + : CMR_SRNumericMeasurementValue(numericMeasurement) +{ +} + + +template +CMR_SRNumericMeasurementValueWithUnits::~CMR_SRNumericMeasurementValueWithUnits() +{ +} + + +template +CMR_SRNumericMeasurementValueWithUnits &CMR_SRNumericMeasurementValueWithUnits::operator=(const CMR_SRNumericMeasurementValueWithUnits &numericMeasurement) +{ + CMR_SRNumericMeasurementValue::operator=(numericMeasurement); + return *this; +} + + +template +OFCondition CMR_SRNumericMeasurementValueWithUnits::setValue(const OFString &numericValue, + const T_Units &measurementUnit, + const OFBool check) +{ + const DSRCodedEntryValue valueQualifier; + /* call the function doing the real work */ + return CMR_SRNumericMeasurementValueWithUnits::setValue(numericValue, measurementUnit, valueQualifier, check); +} + + +template +OFCondition CMR_SRNumericMeasurementValueWithUnits::setValue(const OFString &numericValue, + const T_Units &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) +{ + OFCondition result = EC_Normal; + if (check) + { + /* only check if at least one of the two values is non-empty */ + if (!numericValue.empty() || !measurementUnit.hasSelectedValue()) + { + /* check whether the passed values are valid */ + result = checkNumericValue(numericValue); + if (result.good()) + result = checkMeasurementUnit(measurementUnit); + } + if (result.good()) + result = checkNumericValueQualifier(valueQualifier); + } + /* set the value (without checking all the details again) */ + if (result.good()) + result = CMR_SRNumericMeasurementValue::setValue(numericValue, measurementUnit, valueQualifier, OFFalse /*check*/); + return result; +} + + +template +OFCondition CMR_SRNumericMeasurementValueWithUnits::setMeasurementUnit(const T_Units &measurementUnit, + const OFBool check) +{ + /* first, check given measurement unit for validity (if not disabled) */ + OFCondition result = (check) ? checkMeasurementUnit(measurementUnit) : EC_Normal; + /* then, set the measurement unit (without checking the coded entry again) */ + if (result.good()) + result = CMR_SRNumericMeasurementValue::setMeasurementUnit(measurementUnit, OFFalse /*check*/); + return result; +} + + +template +OFCondition CMR_SRNumericMeasurementValueWithUnits::checkMeasurementUnit(const DSRCodedEntryValue &measurementUnit) const +{ + /* first, check coded entry for basic validity */ + OFCondition result = CMR_SRNumericMeasurementValue::checkMeasurementUnit(measurementUnit); + /* then, check whether coded entry is allowed (if defined context group) */ + if (result.good() && T_DefinedGroup) + { + const T_Units contextGroup; + if (!contextGroup.hasCodedEntry(measurementUnit)) + result = SR_EC_CodedEntryNotInContextGroup; + } + return result; +} + + +template +OFCondition CMR_SRNumericMeasurementValueWithUnits::checkMeasurementUnit(const T_Units &measurementUnit) const +{ + /* measurement unit should never be empty */ + return measurementUnit.hasSelectedValue() ? measurementUnit.checkSelectedValue(T_DefinedGroup) + : SR_EC_InvalidValue; +} + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid1001.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid1001.h new file mode 100644 index 00000000..cca17e3e --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid1001.h @@ -0,0 +1,120 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID1001_ObservationContext + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID1001_H +#define CMR_TID1001_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/cid7445.h" +#include "dcmtk/dcmsr/cmr/cid7452.h" +#include "dcmtk/dcmsr/cmr/cid7453.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 1001 - Observation Context (and included templates 1002-1004). + * All added content items are annotated with a text in the format "TID 1001 - Row [n]". + ** @note Please note that the included templates 1005-1010 are not yet supported. + */ +class DCMTK_CMR_EXPORT TID1001_ObservationContext + : public DSRSubTemplate +{ + + public: + + /// type used for storing and managing a list of device participating roles + typedef OFList DeviceParticipatingRolesList; + + /** default constructor + */ + TID1001_ObservationContext(); + + /** add content items for TID 1002 (Observer Context) with Observer Type being "Person". + * This also includes the content items from TID 1003 (Person Observer Identifying + * Attributes). + ** @param personName name of human observer that created the observations + * (mandatory) + * @param organizationName organization or institution with which the human observer + * is affiliated for the context of the current observation + * (optional) + * @param organizationRole organizational role of human observer for the context of + * the current observation (optional) + * @param procedureRole procedural role of human observer for the context of the + * current observation (optional) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addPersonObserver(const OFString &personName, + const OFString &organizationName = "", + const CID7452_OrganizationalRoles &organizationRole = CID7452_OrganizationalRoles(), + const CID7453_PerformingRoles &procedureRole = CID7453_PerformingRoles(), + const OFBool check = OFTrue); + + /** add content items for TID 1002 (Observer Context) with Observer Type being "Device". + * This also includes the content items from TID 1004 (Device Observer Identifying + * Attributes). + ** @param deviceUID unique identifier of automated device that created the + * observations (mandatory) + * @param deviceName institution-provided identifier of automated device that + * created the observations (optional) + * @param manufacturer manufacturer of automated device that created the + * observations (optional) + * @param modelName manufacturer-provided model name of automated device that + * created the observations (optional) + * @param serialNumber manufacturer-provided serial number of automated device + * that created the observations (optional) + * @param physicalLocation location of automated device that created the observations + * whilst the observations were being made (optional) + * @param procedureRoles the roles played by a device in a procedure (optional, + * multiple values allowed) + * @param stationAEtitle application entity title of the device (optional) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addDeviceObserver(const OFString &deviceUID, + const OFString &deviceName = "", + const OFString &manufacturer = "", + const OFString &modelName = "", + const OFString &serialNumber = "", + const OFString &physicalLocation = "", + const DeviceParticipatingRolesList &procedureRoles = DeviceParticipatingRolesList(), + const OFString &stationAEtitle = "", + const OFBool check = OFTrue); + + /** add content items for TID 1005 (Procedure Context) + ** @return always returns EC_NotYetImplemented since this methods has not been implemented yet + */ + OFCondition addProcedureContext(); + + /** add content items for TID 1006 (Subject Context), and included TID 1007-1010 + ** @return always returns EC_NotYetImplemented since this methods has not been implemented yet + */ + OFCondition addSubjectContext(); +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the SR template class +typedef TID1001_ObservationContext CMR_TID1001; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid1204.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid1204.h new file mode 100644 index 00000000..d8f31a3e --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid1204.h @@ -0,0 +1,66 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID1204_LanguageOfContentItemAndDescendants + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID1204_H +#define CMR_TID1204_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/cid5000.h" +#include "dcmtk/dcmsr/cmr/cid5001.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 1204 - Language of Content Item and Descendants. + * All added content items are annotated with a text in the format "TID 1204 - Row [n]". + */ +class DCMTK_CMR_EXPORT TID1204_LanguageOfContentItemAndDescendants + : public DSRSubTemplate +{ + + public: + + /** default constructor + */ + TID1204_LanguageOfContentItemAndDescendants(); + + /** set language, either by adding one content item (language only) or two content + * items (language and country). Please note that there are also language variants + * that include the country. See DICOM standard for more details. + ** @param language language of the content, being a language that is primarily + * used for human communication + * @param country country-specific variant of language (optional) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLanguage(const CID5000_Languages &language, + const CID5001_Countries &country = CID5001_Countries(), + const OFBool check = OFTrue); +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the SR template class +typedef TID1204_LanguageOfContentItemAndDescendants CMR_TID1204; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid1411.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid1411.h new file mode 100644 index 00000000..98a653b5 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid1411.h @@ -0,0 +1,382 @@ +/* + * + * Copyright (C) 2016-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID1411_VolumetricROIMeasurements + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID1411_H +#define CMR_TID1411_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/srnumvlu.h" +#include "dcmtk/dcmsr/cmr/tid1419m.h" +#include "dcmtk/dcmsr/cmr/cid6147.h" +#include "dcmtk/dcmsr/cmr/cid7181.h" +#include "dcmtk/dcmsr/cmr/cid7464.h" +#include "dcmtk/dcmsr/cmr/cid7469.h" + + +// include this file in doxygen documentation + +/** @file tid1411.h + * @brief Interface class for TID 1411 in module dcmsr/cmr + */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 1411 - Volumetric ROI Measurements (and included templates 1502 and 1419). + * All added content items are annotated with a text in the format "TID 1411 - Row [n]". + ** @tparam T_Measurement concept names for the numeric measurements (context group) + * @tparam T_Units units of the numeric measurement values (context group) + * @tparam T_Method methods used for measuring the values (context group) + * @tparam T_Derivation methods of deriving or calculating the values (context group) + ** @note Please note that currently only the mandatory and some optional/conditional + * content items and included templates are supported. + * @note Also note that this template class requires explicit instantiation for those + * combinations of the template parameters that are actually used. This is + * because the implementation is "hidden" in a separate source file, which has + * some advantages over the usual header-only approach. + */ +template +class DCMTK_CMR_EXPORT TID1411_VolumetricROIMeasurements + : public DSRSubTemplate +{ + + public: + + // type definition + typedef CMR_SRNumericMeasurementValueWithUnits MeasurementValue; + + + typedef TID1419_ROIMeasurements_Measurement + TID1419_Measurement; + + /** (default) constructor + ** @param createGroup flag indicating whether to create an empty measurement group + * by calling createMeasurementGroup() during startup + */ + TID1411_VolumetricROIMeasurements(const OFBool createGroup = OFFalse); + + /** clear internal member variables. + * Also see notes on the clear() method of the base class. + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * That means, whether the base class is valid and whether all mandatory content + * items and included templates are valid (present), i.e. hasMeasurementGroup(), + * hasTrackingIdentifier(), hasTrackingUniqueIdentifier(), hasReferencedSegment(), + * hasSourceSeriesForSegmentation() and hasROIMeasurements() return true. + ** @return OFTrue if valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** check whether the 'Measurement Group' content item (TID 1411 - Row 1) is present. + * This mandatory content item can be created by the constructor of this class (if + * not disabled, which is the default) or internally by createMeasurementGroup(). + * After clear() has been called, the content item has to be recreated, which is + * done automatically when needed. + ** @param checkChildren optional flag indicating whether to also check for any + * children, i.e.\ whether the respective content item has + * child nodes. By default, the presence of the higher-level + * CONTAINER is checked only. + ** @return OFTrue if the measurement group is present, OFFalse otherwise + */ + OFBool hasMeasurementGroup(const OFBool checkChildren = OFFalse) const; + + /** check whether the 'Tracking Identifier' content item (TID 1411 - Row 2) is + * present. This content item is mandatory, i.e. should be present with a value. + ** @return OFTrue if the tracking identifier is present, OFFalse otherwise + */ + OFBool hasTrackingIdentifier() const; + + /** check whether the 'Tracking Unique Identifier' content item (TID 1411 - Row 3) is + * present. This content item is mandatory, i.e. should be present with a value. + ** @return OFTrue if the tracking unique identifier is present, OFFalse otherwise + */ + OFBool hasTrackingUniqueIdentifier() const; + + /** check whether the 'Referenced Segment' content item (TID 1411 - Row 7) is present. + * This content item is conditional, but should be present to meet the conditions. + ** @return OFTrue if the referenced segment is present, OFFalse otherwise + */ + OFBool hasReferencedSegment() const; + + /** check whether the 'Source Series for Segmentation' content item (TID 1411 - + * Row 12) is present. This content item is conditional, but should be present to + * meet the conditions. + ** @return OFTrue if source series for segmentation is present, OFFalse otherwise + */ + OFBool hasSourceSeriesForSegmentation() const; + + /** check whether there is an included 'ROI Measurements' template (TID 1411 - + * Row 15) in this measurement template. Initially, this mandatory sub-template + * is created and included by the constructor of this class. After clear() has + * been called, the content item has to be recreated, which is done automatically + * when needed. + ** @param checkChildren flag, which is enabled by default, indicating whether to + * check for any children, i.e.\ whether the respective + * sub-template has any content (child nodes). If OFFalse, + * the "included template" content item is checked only. + ** @return OFTrue if measurements are present, OFFalse otherwise + */ + OFBool hasMeasurements(const OFBool checkChildren = OFTrue) const; + + /** get current measurement value of this measurement group as defined by TID 1419 + * (ROI Measurements), i.e.\ the current instance of TID 1411 - Row 15. + * This included template is mandatory, i.e. should be present and not be empty. + * Further instances can be added by calling addMeasurement(). + ** @return reference to internally managed SR template (current instance) + */ + inline TID1419_Measurement &getMeasurement() const + { + return *OFstatic_cast(TID1419_Measurement *, Measurement.get()); + } + + /** set the value of the 'Activity Session' content item (TID 1411 - Row 1b). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param session identifier of the session during which the measurements were made + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setActivitySession(const OFString &session, + const OFBool check = OFTrue); + + /** set the value of the 'Tracking Identifier' content item (TID 1411 - Row 2). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param trackingID a text label used for tracking a finding or feature + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTrackingIdentifier(const OFString &trackingID, + const OFBool check = OFTrue); + + /** set the value of the 'Tracking Unique Identifier' content item (TID 1411 - Row 3). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param trackingUID a unique identifier used for tracking a finding or feature + * (associated DICOM VR=UI) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTrackingUniqueIdentifier(const OFString &trackingUID, + const OFBool check = OFTrue); + + /** set the value of the 'Finding' content item (TID 1411 - Row 3b). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param finding coded entry that describes the type of the finding + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFinding(const DSRCodedEntryValue &finding, + const OFBool check = OFTrue); + + /** set the value of the 'Time Point' content item (TID 1502 - Row 3). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param timePoint a short pre-defined label that is human-readable + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTimePoint(const OFString &timePoint, + const OFBool check = OFTrue); + + /** set the value of the 'Referenced Segment' content item (TID 1411 - Row 7). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param segment reference to a segmentation object with a single selected + * segment; specifically the pixels or voxels identified as + * belonging to the classification of the identified segment + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegment(const DSRImageReferenceValue &segment, + const OFBool check = OFTrue); + + /** set the value of the 'Referenced Segment' content item (TID 1411 - Row 7). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + * If 'copyTracking' is enabled and the 'dataset' contains appropriate tracking + * information for the given 'segmentNumber', setTrackingIdentifier() and + * setTrackingUniqueIdentifier() are also called by this method. + ** @param dataset DICOM dataset from which the values for the referenced + * segment (e.g. SOP class UID and SOP instance UID) should + * be retrieved + * @param segmentNumber number of the segment that should be referenced. The + * value is only checked when 'copyTracking' is enabled. + * @param copyTracking flag indicating whether to copy tracking information + * (tracking ID and UID) from the 'dataset', if available + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReferencedSegment(DcmItem &dataset, + const Uint16 segmentNumber, + const OFBool copyTracking = OFTrue, + const OFBool check = OFTrue); + + /** set the value of the 'Source series for segmentation' content item (TID 1411 - + * Row 12). A measurement group is created automatically (if none is present). + * If the content item already exists, its value is overwritten. + ** @param seriesUID the unique identifier of the source series of images that + * were segmented to identify the ROI (associated DICOM VR=UI) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSourceSeriesForSegmentation(const OFString &seriesUID, + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 1411 - Row 14). A measurement group is created automatically (if none is + * present). If the content item already exists, its value is overwritten. + ** @param valueMap reference to a real world value mapping object applied to the + * stored image pixel values before their use for a measurement + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 1411 - Row 14). A measurement group is created automatically (if none is + * present). If the content item already exists, its value is overwritten. + ** @param dataset DICOM dataset from which the values for the reference to a + * real world value mapping object (SOP class UID and SOP instance + * UID) should be retrieved + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(DcmItem &dataset, + const OFBool check = OFTrue); + + /** set the value of the 'Measurement Method' content item (TID 1419 - Row 1). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param method coded entry describing the method used for measuring the values + * in the group (e.g.\ from the given context group 'T_Method') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasurementMethod(const T_Method &method, + const OFBool check = OFTrue); + + /** add a 'Finding Site' content item (TID 1419 - Row 2, 3 and 4). + * A measurement group is created automatically (if none is present). + * @note Originally, the associated content item had the value multiplicity "1" and + * thus the method was called setFindingSite(). This changed with CP-1591. The + * value multiplicity is now "1-n". The requirement type is still "User option". + ** @param site coded entry describing the anatomic location of the + * measurements in the current group + * @param laterality laterality associated with the 'site' (optional) + * @param siteModifier coded entry describing the topographical modifier of the + * 'site' (optional) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality = CID244e_Laterality(), + const DSRCodedEntryValue &siteModifier = DSRCodedEntryValue(), + const OFBool check = OFTrue); + + /** add a measurement as defined in 'ROI Measurements' (TID 1419 - Row 5). + * A measurement group is created automatically (if none is present). There should + * be at least a single instance of the associated template. Access to the current + * instance is available through getMeasurement(). + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + ** @param checkEmpty by default, it is checked whether the current instance of + * TID 1419 is empty, and thus no new instance is created. + * Setting this parameter to OFFalse disables this check and + * always creates and adds a new instance of this sub-template. + * @param checkValue if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool checkEmpty = OFTrue, + const OFBool checkValue = OFTrue); + + /** add a qualitative evaluation related to the subject of the measurement group as a + * coded entry (TID 1411 - Row 16). + * A measurement group is created automatically (if none is present). + ** @param conceptName coded entry to be set as the concept name + * @param codeValue coded entry to be set as the value of the new content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFBool check = OFTrue); + + /** add a qualitative evaluation related to the subject of the measurement group in + * text form (TID 1411 - Row 17). + * A measurement group is created automatically (if none is present). + ** @param conceptName coded entry to be set as the concept name + * @param stringValue character string to be set as the value of the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFBool check = OFTrue); + + + protected: + + /** create the mandatory root content item of this template, i.e.\ TID 1411 - Row 1. + * It is expected that the tree is currently empty. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createMeasurementGroup(); + + /** add a new or replace an existing content item with a given node ID. + * If the content item does not exist, it is added to the measurement group, i.e. + * below the root node. If it does exist, both the 'valueType' and 'conceptName' + * are checked before replacing the value. However, the value is not replaced by + * this method. This is up to the caller after this method returned with success. + ** @param nodePos index of the list entry that stores the ID of the node + * to search for + * @param relationshipType relationship type of the content item to be added/replaced + * @param valueType value type of the content item to be added/replaced + * @param conceptName concept name of the content item to be added/replaced + * @param annotationText optional text used to annotate the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check); + + + private: + + // shared pointer to included template "ROI Measurements" (TID 1419, Row 5) + DSRSharedSubTemplate Measurement; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid1419m.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid1419m.h new file mode 100644 index 00000000..23bd0944 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid1419m.h @@ -0,0 +1,270 @@ +/* + * + * Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID1419_ROIMeasurements_Measurement + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID1419M_H +#define CMR_TID1419M_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/srnumvlu.h" +#include "dcmtk/dcmsr/cmr/tid4019.h" +#include "dcmtk/dcmsr/cmr/cid244e.h" + + +// include this file in doxygen documentation + +/** @file tid1419m.h + * @brief Interface class for TID 1419 in module dcmsr/cmr + */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of the DCMR Template: + * TID 1419 - ROI Measurements (only the "Measurement" content item and its children). + * All added content items are annotated with a text in the format "TID 1419 - Row [n]". + ** @tparam T_Measurement concept names for the numeric measurements (context group) + * @tparam T_Units units of the numeric measurement values (context group) + * @tparam T_Method methods used for measuring the values (context group) + * @tparam T_Derivation methods of deriving or calculating the values (context group) + ** @note Please note that currently only the mandatory and some optional/conditional + * content items and included templates are supported. + * @note Also note that this template class requires explicit instantiation for those + * combinations of the template parameters that are actually used. This is + * because the implementation is "hidden" in a separate source file, which has + * some advantages over the usual header-only approach. + */ +template +class DCMTK_CMR_EXPORT TID1419_ROIMeasurements_Measurement + : public DSRSubTemplate +{ + + public: + + // type definition + typedef CMR_SRNumericMeasurementValueWithUnits MeasurementValue; + + /** default constructor + */ + TID1419_ROIMeasurements_Measurement(); + + /** constructor. + * Also creates an initial measurement by calling createMeasurement() internally. + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + * @param check if enabled, check value for validity before setting it + */ + TID1419_ROIMeasurements_Measurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check = OFTrue); + + /** clear internal member variables. + * Also see notes on the clear() method of the base class. + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * That means, whether the base class is valid and whether all mandatory content + * items and included templates are valid, i.e. hasMeasurements() returns true. + ** @return OFTrue if valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** check whether the 'Measurement' content item (TID 1419 - Row 5) is present. + * This content item is mandatory, i.e. should be present with a value. + ** @return OFTrue if a measurement is present, OFFalse otherwise + */ + OFBool hasMeasurement() const; + + /** get algorithm identification as defined by TID 4019 (Algorithm Identification). + * This included template (TID 1419 - Row 20) is optional, i.e. might be empty. + ** @return reference to internally managed SR template + */ + inline TID4019_AlgorithmIdentification &getAlgorithmIdentification() const + { + return *OFstatic_cast(TID4019_AlgorithmIdentification *, AlgorithmIdentification.get()); + } + + /** create a new measurement. + * Clear the entire measurement and create the mandatory (and other supported) content + * items of this template, i.e.\ TID 1419 - Row 5 and 20. + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createNewMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check = OFTrue); + + /** add a 'Modifier' content item (TID 1419 - Row 6) with its concept name and value + ** @param conceptName coded entry describing the modifier type for the concept + * name of the measurement + * @param modifier coded entry describing the modifier value for the concept + * name of the measurement + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addModifier(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &modifier, + const OFBool check = OFTrue); + + /** set the value of the 'Measurement Method' content item (TID 1419 - Row 7). + * If the content item already exists, its value is overwritten. + ** @param method coded entry describing the method used for measuring the value + * (e.g.\ from the given context group 'T_Method') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasurementMethod(const T_Method &method, + const OFBool check = OFTrue); + + /** set the value of the 'Derivation' content item (TID 1419 - Row 8). + * If the content item already exists, its value is overwritten. + ** @param derivation coded entry describing the method of deriving or calculating + * the value (e.g.\ from the context group 'T_Derivation') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDerivation(const T_Derivation &derivation, + const OFBool check = OFTrue); + + /** add a 'Finding Site' content item (TID 1419 - Row 9, 10 and 11) + ** @param site coded entry describing the anatomic location of the + * measurement + * @param laterality laterality associated with the 'site' (optional) + * @param siteModifier coded entry describing the topographical modifier of the + * 'site' (optional) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality = CID244e_Laterality(), + const DSRCodedEntryValue &siteModifier = DSRCodedEntryValue(), + const OFBool check = OFTrue); + + /** add a 'Derivation Parameter' content item (TID 1419 - Row 13). + * This is a by-value relationship. + ** @param conceptName coded entry describing the concept name of the derivation + * parameter + * @param numericValue numeric measurement value of the derivation parameter + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addDerivationParameter(const DSRCodedEntryValue &conceptName, + const CMR_SRNumericMeasurementValue &numericValue, + const OFBool check = OFTrue); + + + /** set the value of the 'Equivalent Meaning of Concept Name' content item (TID 1419 - + * Row 18). + * If the content item already exists, its value is overwritten. + ** @param meaning human-readable meaning of the concept name of the measurement + * that is equivalent to the post-coordinated meaning conveyed by + * the coded name and its concept modifier children + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEquivalentMeaningOfConceptName(const OFString &meaning, + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 1419 - Row 19). + * If the content item already exists, its value is overwritten. + ** @param valueMap reference to a real world value mapping object applied to the + * stored image pixel values before their use for a measurement + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 1419 - Row 19). + * If the content item already exists, its value is overwritten. + ** @param dataset DICOM dataset from which the values for the reference to a + * real world value mapping object (SOP class UID and SOP instance + * UID) should be retrieved + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(DcmItem &dataset, + const OFBool check = OFTrue); + + /** set the value of the mandatory content items for 'Algorithm Identification' + * (TID 1419 - Row 20). Further details can be specified by accessing the included + * template TID 4019 with getAlgorithmIdentification(). + * If the content items already exist, their value is overwritten. + ** @param algorithmName name assigned by the manufacturer to the software algorithm + * @param algorithmVersion version identifier assigned to the software algorithm + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAlgorithmIdentification(const OFString &algorithmName, + const OFString &algorithmVersion, + const OFBool check = OFTrue); + + + protected: + + /** create the mandatory root content item of this template, i.e.\ TID 1419 - Row 5. + * It is expected that the tree is currently empty. + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check); + + /** add a new or replace an existing content item with a given node ID. + * If the content item does not exist, it is added to the measurement, i.e. below + * the root node. If it does exist, both the 'valueType' and 'conceptName' are + * checked before replacing the value. However, the value is not replaced by this + * method. This is up to the caller after this method returned with success. + ** @param nodePos index of the list entry that stores the ID of the node + * to search for + * @param relationshipType relationship type of the content item to be added/replaced + * @param valueType value type of the content item to be added/replaced + * @param conceptName concept name of the content item to be added/replaced + * @param annotationText optional text used to annotate the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check); + + + private: + + // shared pointer to included template "Algorithm Identification" (TID 4019) + DSRSharedSubTemplate AlgorithmIdentification; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid1500.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid1500.h new file mode 100644 index 00000000..9892b8d7 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid1500.h @@ -0,0 +1,358 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID1500_MeasurementReport + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID1500_H +#define CMR_TID1500_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrrtpl.h" +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/tid1001.h" +#include "dcmtk/dcmsr/cmr/tid1204.h" +#include "dcmtk/dcmsr/cmr/tid1411.h" +#include "dcmtk/dcmsr/cmr/tid1501.h" +#include "dcmtk/dcmsr/cmr/tid1600.h" +#include "dcmtk/dcmsr/cmr/cid100.h" +#include "dcmtk/dcmsr/cmr/cid6147.h" +#include "dcmtk/dcmsr/cmr/cid7021.h" +#include "dcmtk/dcmsr/cmr/cid7181.h" +#include "dcmtk/dcmsr/cmr/cid7464.h" +#include "dcmtk/dcmsr/cmr/cid7469.h" + + +// include this file in doxygen documentation + +/** @file tid1500.h + * @brief Interface class for TID 1500 in module dcmsr/cmr + */ + + +/*------------------------* + * constant definitions * + *------------------------*/ + +/** @name specific error conditions for TID 1500 (and included templates) in module dcmsr/cmr + */ +//@{ + +/// error: there is no measurement report to add content items to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoMeasurementReport; +/// error: there is no measurement group to add entries to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoMeasurementGroup; +/// error: the given segmentation object does not conform to the template constraints +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_InvalidSegmentationObject; +/// error: the given DICOM object is not a real world value mapping object +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_InvalidRealWorldValueMappingObject; + +//@} + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 1500 - Measurement Report (and included templates 1204, 1001, 1600, 1411, 1501). + * All added content items are annotated with a text in the format "TID 1500 - Row [n]". + ** @note Please note that currently only the mandatory and some optional/conditional + * content items and included templates are supported. + */ +class DCMTK_CMR_EXPORT TID1500_MeasurementReport + : public DSRRootTemplate +{ + + public: + + // type definitions + typedef TID1411_VolumetricROIMeasurements + TID1411_Measurements; + + typedef TID1501_MeasurementGroup + TID1501_Measurements; + + /** (default) constructor. + * Also creates an initial, almost empty measurement report by calling + * createNewMeasurementReport(), but only if a non-empty 'title' is passed. + ** @param title optional document title to be set (from CID 7021 - Measurement + * Report Document Titles), i.e.\ the concept name of the root node + * @param check if enabled, check value for validity before setting it + */ + TID1500_MeasurementReport(const CID7021_MeasurementReportDocumentTitles &title = CID7021_MeasurementReportDocumentTitles(), + const OFBool check = OFTrue); + + /** clear internal member variables. + * Also see notes on the clear() method of the base class. + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * That means, check whether the base class is valid, the mandatory included + * templates TID 1204, 1001 and 1600 are valid, and whether hasProcedureReported() + * as well as hasImagingMeasurements() or hasQualitativeEvaluations() return true. + * In addition, each of the included templates TID 1411 and 1501 should either be + * empty or valid. + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether there are any 'Procedure reported' content items (TID 1500 - Row 4) + * in this measurement report. This content item is mandatory, i.e. one or more + * instances of the associated content item should be present. + ** @return OFTrue if at least one procedure reported is present, OFFalse otherwise + */ + OFBool hasProcedureReported() const; + + /** check whether there is an 'Imaging Measurements' content item (TID 1500 - Row 6) + * in this measurement report. Initially, this conditional content item is created + * by the constructor of this class. After clear() has been called or no document + * title is passed to the constructor, it can be created again by calling + * createNewMeasurementReport(). + ** @param checkChildren optional flag indicating whether to also check for any + * children, i.e.\ whether the respective content item has + * child nodes. By default, the presence of the higher-level + * CONTAINER is checked only. + ** @return OFTrue if imaging measurements are present, OFFalse otherwise + */ + OFBool hasImagingMeasurements(const OFBool checkChildren = OFFalse) const; + + /** check whether there is an included 'Volumetric ROI Measurements' template + * (TID 1500 - Row 8) in this measurement report. Initially, this optional + * sub-template is created and included by the constructor of this class. After + * clear() has been called or no document title is passed to the constructor, it + * can be created again by calling createNewMeasurementReport(). + ** @param checkChildren optional flag indicating whether to also check for any + * children, i.e.\ whether the respective sub-template has + * any content (child nodes). By default, the presence of + * the "included template" content item is checked only. + ** @return OFTrue if volumetric ROI measurements are present, OFFalse otherwise + */ + OFBool hasVolumetricROIMeasurements(const OFBool checkChildren = OFFalse) const; + + /** check whether there is an included 'Measurement Group' template (TID 1500 - + * Row 9) in this measurement report. Initially, this optional sub-template is + * created and included by the constructor of this class. After clear() has been + * called or no document title is passed to the constructor, it can be created again + * by calling createNewMeasurementReport(). + ** @param checkChildren optional flag indicating whether to also check for any + * children, i.e.\ whether the respective sub-template has + * any content (child nodes). By default, the presence of + * the "included template" content item is checked only. + ** @return OFTrue if volumetric ROI measurements are present, OFFalse otherwise + */ + OFBool hasIndividualMeasurements(const OFBool checkChildren = OFFalse) const; + + /** check whether there is an 'Qualitative Evaluations' content item (TID 1500 - + * Row 12) in this measurement report + ** @param checkChildren optional flag indicating whether to also check for any + * children, i.e.\ whether the respective content item has + * child nodes. By default, the presence of the higher-level + * CONTAINER is checked only. + ** @return OFTrue if qualitative evaluations are present, OFFalse otherwise + */ + OFBool hasQualitativeEvaluations(const OFBool checkChildren = OFFalse) const; + + /** get language of this report as defined by TID 1204 (Language of Content Item and + * Descendants). This included template is mandatory, i.e. should not be empty. + ** @return reference to internally managed SR template + */ + inline TID1204_LanguageOfContentItemAndDescendants &getLanguage() const + { + return *OFstatic_cast(TID1204_LanguageOfContentItemAndDescendants *, Language.get()); + } + + /** get observation context of this report as defined by TID 1001 (Observation + * Context). This included template is mandatory, i.e. should not be empty. + ** @return reference to internally managed SR template + */ + inline TID1001_ObservationContext &getObservationContext() const + { + return *OFstatic_cast(TID1001_ObservationContext *, ObservationContext.get()); + } + + /** get image library of this report as defined by TID 1600 (Image Library). + * This included template is mandatory, i.e. should not be empty. + ** @return reference to internally managed SR template + */ + inline TID1600_ImageLibrary &getImageLibrary() const + { + return *OFstatic_cast(TID1600_ImageLibrary *, ImageLibrary.get()); + } + + /** get volumetric ROI measurements of this report as defined by TID 1411 (Volumetric + * ROI Measurements), i.e.\ the current instance of TID 1500 - Row 8. + * This included template is optional, i.e. might be empty (but not absent). + * Further instances can be added by calling addVolumetricROIMeasurements(). + ** @return reference to internally managed SR template (current instance) + */ + inline TID1411_Measurements &getVolumetricROIMeasurements() const + { + return *OFstatic_cast(TID1411_Measurements *, VolumetricROIMeasurements.get()); + } + + /** get individual measurements of this report as defined by TID 1501 (Measurement + * Group), i.e.\ the current instance of TID 1500 - Row 9. + * This included template is optional, i.e. might be empty (but not absent). + * Further instances can be added by calling addIndividualMeasurements(). + ** @return reference to internally managed SR template (current instance) + */ + inline TID1501_Measurements &getIndividualMeasurements() const + { + return *OFstatic_cast(TID1501_Measurements *, MeasurementGroup.get()); + } + + /** get document title of this report, i.e.\ the concept name of the root node + ** @param titleCode coded entry that specifies the document title of this report + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getDocumentTitle(DSRCodedEntryValue &titleCode); + + /** create a new measurement report. + * Clear the report and create the mandatory (and other supported) content items of + * this template, i.e.\ TID 1500 - Row 1 to 6 and 8 to 9. + ** @param title document title to be set (from CID 7021 - Measurement Report + * Document Titles), i.e.\ the concept name of the root node + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createNewMeasurementReport(const CID7021_MeasurementReportDocumentTitles &title, + const OFBool check = OFTrue); + + /** set language of this report as defined by TID 1204 (Language of Content Item and + * Descendants) + ** @param language language of the report, being a language that is primarily + * used for human communication (from CID 5000 - Languages) + * @param country coded entry that describes the country-specific variant of + * 'language' (optional, from CID 5001 - Countries) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setLanguage(const CID5000_Languages &language, + const CID5001_Countries &country = CID5001_Countries(), + const OFBool check = OFTrue); + + /** add the imaging procedure whose results are reported (TID 1500 - Row 4). + * There should be at least a single instance of the associated content item. + ** @param procedure coded entry that describes the imaging procedure to be added + * (from CID 100 - Quantitative Diagnostic Imaging Procedures) + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addProcedureReported(const CID100_QuantitativeDiagnosticImagingProcedures &procedure, + const OFBool check = OFTrue); + + /** create another instance of TID 1411 (Volumetric ROI Measurements) and add it as + * an included template to this report (TID 1500 - Row 8). A first instance of + * TID 1411 is created and added by calling createNewMeasurementReport(). Access + * to the current instance is available through getVolumetricROIMeasurements(). + ** @param checkEmpty by default, it is checked whether the current instance of + * TID 1411 is empty, and thus no new instance is created. + * Setting this parameter to OFFalse disables this check and + * always creates and adds a new instance of this sub-template. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addVolumetricROIMeasurements(const OFBool checkEmpty = OFTrue); + + /** create another instance of TID 1501 (Measurement Group) and add it as an included + * template to this report (TID 1500 - Row 9). A first instance of TID 1501 is + * created and added by calling createNewMeasurementReport(). Access to the current + * instance is available through getIndividualMeasurements(). + * Please note that a new instance of TID 1501 is only added if the current one is + * not empty! + ** @param checkEmpty by default, it is checked whether the current instance of + * TID 1501 is empty, and thus no new instance is created. + * Setting this parameter to OFFalse disables this check and + * always creates and adds a new instance of this sub-template. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addIndividualMeasurements(const OFBool checkEmpty = OFTrue); + + /** add a qualitative evaluation related to the entire subject of the report as a + * coded entry (TID 1500 - Row 13). The higher-level CONTAINER (Row 12) is created + * automatically (if none is present). + ** @param conceptName coded entry to be set as the concept name + * @param codeValue coded entry to be set as the value of the new content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFBool check = OFTrue); + + /** add a qualitative evaluation related to the entire subject of the report in + * text form (TID 1500 - Row 14). The higher-level CONTAINER (Row 12) is created + * automatically (if none is present). + ** @param conceptName coded entry to be set as the concept name + * @param stringValue character string to be set as the value of the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFBool check = OFTrue); + + + protected: + + /** create the mandatory (and other supported) content items of this template, + * i.e.\ TID 1500 - Row 1 to 6 and 8. It is expected that the tree is currently + * empty. + ** @param title coded entry that specifies the document title to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createMeasurementReport(const CID7021_MeasurementReportDocumentTitles &title, + const OFBool check); + + /** create the 'Qualitative Evaluations' content item (TID 1500 - Row 12) if not + * existing yet + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createQualitativeEvaluations(); + + + private: + + // shared pointer to included template "Language of Content Item and Descendants" (TID 1204) + DSRSharedSubTemplate Language; + // shared pointer to included template "Observation Context" (TID 1001) + DSRSharedSubTemplate ObservationContext; + // shared pointer to included template "Image Library" (TID 1600) + DSRSharedSubTemplate ImageLibrary; + // shared pointer to included template "Volumetric ROI Measurements" (TID 1411) + DSRSharedSubTemplate VolumetricROIMeasurements; + // shared pointer to included template "Measurement Group" (TID 1501) + DSRSharedSubTemplate MeasurementGroup; +}; + + +/*--------------------* + * type definitions * + *--------------------*/ + +// define short names for the SR template classes +typedef TID1500_MeasurementReport CMR_TID1500; +typedef TID1500_MeasurementReport::TID1411_Measurements CMR_TID1411_in_TID1500; +typedef TID1500_MeasurementReport::TID1411_Measurements::TID1419_Measurement CMR_TID1419_in_TID1411_in_TID1500; +typedef TID1500_MeasurementReport::TID1501_Measurements CMR_TID1501_in_TID1500; +typedef TID1500_MeasurementReport::TID1501_Measurements::TID300_Measurement CMR_TID300_in_TID1501_in_TID1500; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid1501.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid1501.h new file mode 100644 index 00000000..b9349e73 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid1501.h @@ -0,0 +1,318 @@ +/* + * + * Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID1501_MeasurementGroup + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID1501_H +#define CMR_TID1501_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/tid300.h" +#include "dcmtk/dcmsr/cmr/cid244e.h" +#include "dcmtk/dcmsr/cmr/cid6147.h" +#include "dcmtk/dcmsr/cmr/cid7181.h" +#include "dcmtk/dcmsr/cmr/cid7464.h" +#include "dcmtk/dcmsr/cmr/cid7469.h" + + +// include this file in doxygen documentation + +/** @file tid1501.h + * @brief Interface class for TID 1501 in module dcmsr/cmr + */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 1501 - Measurement Group (and included templates 1502 and 300). + * All added content items are annotated with a text in the format "TID 1501 - Row [n]". + ** @tparam T_Measurement concept names for the numeric measurements (context group) + * @tparam T_Units units of the numeric measurement values (context group) + * @tparam T_Method methods used for measuring the values (context group) + * @tparam T_Derivation methods of deriving or calculating the values (context group) + * @note Please note that this template class requires explicit instantiation for those + * combinations of the template parameters that are actually used. This is + * because the implementation is "hidden" in a separate source file, which has + * some advantages over the usual header-only approach. + */ +template +class DCMTK_CMR_EXPORT TID1501_MeasurementGroup + : public DSRSubTemplate +{ + + public: + + // type definitions + typedef CMR_SRNumericMeasurementValueWithUnits MeasurementValue; + + typedef ::TID300_Measurement + TID300_Measurement; + + /** (default) constructor + ** @param createGroup flag indicating whether to create an empty measurement group + * by calling createMeasurementGroup() during startup + */ + TID1501_MeasurementGroup(const OFBool createGroup = OFFalse); + + /** clear internal member variables. + * Also see notes on the clear() method of the base class. + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * That means, whether the base class is valid and whether all mandatory content + * items and included templates are valid (present), i.e. hasMeasurementGroup(), + * hasTrackingIdentifier(), hasTrackingUniqueIdentifier() and hasMeasurements() + * return true. + ** @return OFTrue if valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** check whether the 'Measurement Group' content item (TID 1501 - Row 1) is present. + * This mandatory content item can be created by the constructor of this class (if + * not disabled, which is the default) or internally by createMeasurementGroup(). + * After clear() has been called, the content item has to be recreated, which is + * done automatically when needed. + ** @param checkChildren optional flag indicating whether to also check for any + * children, i.e.\ whether the respective content item has + * child nodes. By default, the presence of the higher-level + * CONTAINER is checked only. + ** @return OFTrue if the measurement group is present, OFFalse otherwise + */ + OFBool hasMeasurementGroup(const OFBool checkChildren = OFFalse) const; + + /** check whether the 'Tracking Identifier' content item (TID 1501 - Row 2) is + * present. This content item is mandatory, i.e. should be present with a value. + ** @return OFTrue if the tracking identifier is present, OFFalse otherwise + */ + OFBool hasTrackingIdentifier() const; + + /** check whether the 'Tracking Unique Identifier' content item (TID 1501 - Row 3) is + * present. This content item is mandatory, i.e. should be present with a value. + ** @return OFTrue if the tracking unique identifier is present, OFFalse otherwise + */ + OFBool hasTrackingUniqueIdentifier() const; + + /** check whether there is an included 'Measurement' template (TID 1501 - Row 10) in + * this measurement template. Initially, this mandatory sub-template is created and + * included by the constructor of this class. After clear() has been called, the + * content item has to be recreated, which is done automatically when needed. + ** @param checkChildren flag, which is enabled by default, indicating whether to + * check for any children, i.e.\ whether the respective + * sub-template has any content (child nodes). If OFFalse, + * the "included template" content item is checked only. + ** @return OFTrue if measurements are present, OFFalse otherwise + */ + OFBool hasMeasurements(const OFBool checkChildren = OFTrue) const; + + /** get current measurement value of this measurement group as defined by TID 300 + * (Measurement), i.e.\ the current instance of TID 1501 - Row 10. + * This included template is mandatory, i.e. should be present and not be empty. + * Further instances can be added by calling addMeasurement(). + ** @return reference to internally managed SR template (current instance) + */ + inline TID300_Measurement &getMeasurement() const + { + return *OFstatic_cast(TID300_Measurement *, Measurement.get()); + } + + /** set the value of the 'Activity Session' content item (TID 1501 - Row 1b). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param session identifier of the session during which the measurements were made + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setActivitySession(const OFString &session, + const OFBool check = OFTrue); + + /** set the value of the 'Tracking Identifier' content item (TID 1501 - Row 2). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param trackingID a text label used for tracking a finding or feature + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTrackingIdentifier(const OFString &trackingID, + const OFBool check = OFTrue); + + /** set the value of the 'Tracking Unique Identifier' content item (TID 1501 - Row 3). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param trackingUID a unique identifier used for tracking a finding or feature + * (associated DICOM VR=UI) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTrackingUniqueIdentifier(const OFString &trackingUID, + const OFBool check = OFTrue); + + /** set the value of the 'Finding' content item (TID 1501 - Row 3b). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param finding coded entry that describes the type of the finding + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFinding(const DSRCodedEntryValue &finding, + const OFBool check = OFTrue); + + /** set the value of the 'Time Point' content item (TID 1502 - Row 3). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param timePoint a short pre-defined label that is human-readable + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTimePoint(const OFString &timePoint, + const OFBool check = OFTrue); + + /** set the value of the 'Measurement Method' content item (TID 1501 - Row 5). + * A measurement group is created automatically (if none is present). If the + * content item already exists, its value is overwritten. + ** @param method coded entry describing the method used for measuring the values + * in the group (e.g.\ from the given context group 'T_Method') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasurementMethod(const T_Method &method, + const OFBool check = OFTrue); + + /** add a 'Finding Site' content item (TID 1501 - Row 6, 7 and 8). + * A measurement group is created automatically (if none is present). + ** @param site coded entry describing the anatomic location of the + * measurements in the current group + * @param laterality laterality associated with the 'site' (optional) + * @param siteModifier coded entry describing the topographical modifier of the + * 'site' (optional) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality = CID244e_Laterality(), + const DSRCodedEntryValue &siteModifier = DSRCodedEntryValue(), + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 1501 - Row 9). A measurement group is created automatically (if none is + * present). If the content item already exists, its value is overwritten. + ** @param valueMap reference to a real world value mapping object applied to the + * stored image pixel values before their use for a measurement + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 1501 - Row 9). A measurement group is created automatically (if none is + * present). If the content item already exists, its value is overwritten. + ** @param dataset DICOM dataset from which the values for the reference to a + * real world value mapping object (SOP class UID and SOP instance + * UID) should be retrieved + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(DcmItem &dataset, + const OFBool check = OFTrue); + + /** add a measurement as defined in 'Measurement' (TID 300 - Row 1). + * A measurement group is created automatically (if none is present). There should + * be at least a single instance of the associated template. Access to the current + * instance is available through getMeasurement(). + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + ** @param checkEmpty by default, it is checked whether the current instance of + * TID 300 is empty, and thus no new instance is created. + * Setting this parameter to OFFalse disables this check and + * always creates and adds a new instance of this sub-template. + * @param checkValue if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool checkEmpty = OFTrue, + const OFBool checkValue = OFTrue); + + /** add a qualitative evaluation related to the subject of the measurement group as a + * coded entry (TID 1501 - Row 11). + * A measurement group is created automatically (if none is present). + ** @param conceptName coded entry to be set as the concept name + * @param codeValue coded entry to be set as the value of the new content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFBool check = OFTrue); + + /** add a qualitative evaluation related to the subject of the measurement group in + * text form (TID 1501 - Row 12). + * A measurement group is created automatically (if none is present). + ** @param conceptName coded entry to be set as the concept name + * @param stringValue character string to be set as the value of the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFBool check = OFTrue); + + + protected: + + /** create the mandatory root content item of this template, i.e.\ TID 1501 - Row 1. + * It is expected that the tree is currently empty. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createMeasurementGroup(); + + /** add a new or replace an existing content item with a given node ID. + * If the content item does not exist, it is added to the measurement group, i.e. + * below the root node. If it does exist, both the 'valueType' and 'conceptName' + * are checked before replacing the value. However, the value is not replaced by + * this method. This is up to the caller after this method returned with success. + ** @param nodePos index of the list entry that stores the ID of the node + * to search for + * @param relationshipType relationship type of the content item to be added/replaced + * @param valueType value type of the content item to be added/replaced + * @param conceptName concept name of the content item to be added/replaced + * @param annotationText optional text used to annotate the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check); + + + private: + + // shared pointer to included template "Measurement" (TID 300) + DSRSharedSubTemplate Measurement; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid15def.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid15def.h new file mode 100644 index 00000000..26702cb1 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid15def.h @@ -0,0 +1,50 @@ +/* + * + * Copyright (C) 2016-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for common error constants used in TID 14xx/15xx + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID15DEF_H +#define CMR_TID15DEF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/dcmsr/cmr/define.h" + + +// include this file in doxygen documentation + +/** @file tid15def.h + * @brief Error constants for TID 14xx/15xx in module dcmsr/cmr + */ + + +/*------------------------* + * constant definitions * + *------------------------*/ + +/** @name specific error conditions for TID 1500 (and included templates) in module dcmsr/cmr + */ +//@{ + +/// error: there is no measurement report to add content items to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoMeasurementReport; +/// error: there is no measurement group to add entries to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoMeasurementGroup; +/// error: there is no measurement to add entries to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoMeasurement; +/// error: the given segmentation object does not conform to the template constraints +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_InvalidSegmentationObject; +/// error: the given DICOM object is not a real world value mapping object +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_InvalidRealWorldValueMappingObject; + +//@} + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid1600.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid1600.h new file mode 100644 index 00000000..490c7cbd --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid1600.h @@ -0,0 +1,528 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID1600_ImageLibrary + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID1600_H +#define CMR_TID1600_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/cid4020.h" +#include "dcmtk/dcmsr/cmr/cid4021.h" +#include "dcmtk/dcmsr/cmr/srnumvl.h" + + +// include this file in doxygen documentation + +/** @file tid1600.h + * @brief Interface class and error constants for TID 1600 in module dcmsr/cmr + */ + + +/*------------------------* + * constant definitions * + *------------------------*/ + +/** @name specific error conditions for TID 1600 in module dcmsr/cmr + */ +//@{ + +/// error: there is no image library to add image groups to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoImageLibrary; +/// error: there is no image library group to add image entries to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoImageLibraryGroup; +/// error: there is no image library entry to add descriptors to +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoImageLibraryEntry; +/// error: cannot add multiple image library group descriptors (see TID 1600 Row 3) +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_CannotAddMultipleImageLibraryGroupDescriptors; +/// error: the current (most recently added) image library entry has no modality descriptor +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_MissingImageLibraryEntryDescriptorModality; +/// error: the current (most recently added) image library entry has the wrong modality descriptor +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_WrongImageLibraryEntryDescriptorModality; +/// normal: there are no image library entry descriptors to be added (copied from the dataset) +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoImageLibraryEntryDescriptorsToBeAdded; +/// normal: there are no (common) image library entry descriptors to be moved (to the image group) +extern DCMTK_CMR_EXPORT const OFConditionConst CMR_EC_NoImageLibraryEntryDescriptorsToBeMoved; + +//@} + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 1600 - Image Library (and included templates 1601-1607). + * All added content items are annotated with a text in the format "TID 1600 - Row [n]". + ** @note Please note that most DICOM element values are copied from the main dataset + * only and not yet from the respective functional group macros. + */ +class DCMTK_CMR_EXPORT TID1600_ImageLibrary + : public DSRSubTemplate +{ + + public: + + // type definition + typedef OFList ConceptNameList; + + /** add mode for image entries + */ + enum AddImageMode + { + /// add image entry without descriptors + withoutDescriptors, + /// add image entry with all descriptors from TID 1602 (and included templates) + withAllDescriptors, + /// add image entry with selected descriptors only (from given list of concept names) + withSelectedDescriptors, + /// add image entry with all but the selected descriptors (from given list of concept names) + withoutSelectedDescriptors + }; + + /** (default) constructor + ** @param createLibrary flag indicating whether to create an empty image library + * by calling createImageLibrary() during startup (default) + */ + TID1600_ImageLibrary(const OFBool createLibrary = OFTrue); + + /** check whether the current internal state is valid. + * That means, whether the base class is valid and hasImageLibrary() returns true. + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the content item 'Image Library' (TID 1600 - Row 1) is present. + * Initially, this mandatory content item is created by the constructor of this + * class (if not disabled). After clear() has been called, it can be created again + * by calling createNewImageLibrary(). + ** @return OFTrue if the image library is present, OFFalse otherwise + */ + OFBool hasImageLibrary() const; + + /** check whether there is an image group in this image library (TID 1600 - Row 2) + ** @return OFTrue if at least one image group is present, OFFalse otherwise + */ + OFBool hasImageLibraryGroup() const; + + /** clear the internally stored tree of content items and create the mandatory + * content item 'Image Library' (TID 1600 - Row 1) as the root node of this template + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createNewImageLibrary(); + + /** add an image group to the image library. + * Image descriptors that are common to all images in this group can be added by + * calling addImageGroupDescriptors(). + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addImageGroup(); + + /** add an image entry to the current image group, i.e.\ add content items for + * TID 1601 (Image Library Entry). The values of the content items (including + * the image reference) are copied from the data elements of the given 'dataset'. + * If no descriptors were added, CMR_EC_NoImageLibraryEntryDescriptorsToBeAdded + * is returned, which is not regarded as an error. + ** @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors optional list with concept names of descriptors. Its use + * and interpretation depends on the value of 'mode'. + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise. If no + * image group exists, CMR_EC_NoImageLibraryGroup is returned. + */ + OFCondition addImageEntry(DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors = ConceptNameList(), + const OFBool check = OFTrue); + + /** add common image descriptors to the current image group, i.e.\ add content items + * items for TID 1602 (Image Library Entry Descriptors) and included templates. + * The values of the content items are copied from the data elements of the given + * 'dataset'. If none were added, CMR_EC_NoImageLibraryEntryDescriptorsToBeAdded + * is returned, which is not regarded as an error. + * Please note that this method should be called only once for each image group. + * Alternatively, moveCommonImageDescriptorsToImageGroups() could be called to move + * common image descriptors to their respective image groups automatically. + ** @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors optional list with concept names of descriptors. Its use + * and interpretation depends on the value of 'mode'. + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise. If no + * image group exists, CMR_EC_NoImageLibraryGroup is returned. + */ + OFCondition addImageGroupDescriptors(DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors = ConceptNameList(), + const OFBool check = OFTrue); + + /** go to the most recently added image library entry and get the value of the + * descriptor 'Modality' (TID 1602 - Row 1) + ** @param modalityCode reference to coded entry that will store the result + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getImageEntryModality(DSRCodedEntryValue &modalityCode); + + /** move common image descriptors from all image entries in this image library to + * their respective image groups. This method should usually be called after all + * image entries have been added using addImageEntry(). If no descriptors were + * moved, CMR_EC_NoImageLibraryEntryDescriptorsToBeMoved is returned, which is not + * regarded as an error. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition moveCommonImageDescriptorsToImageGroups(); + + // --- set modality-specific content manually --- + + /** set the value of the descriptor 'Radionuclide' (TID 1607 - Row 1) for the current + * (most recently added) PET image library entry. + * If the content item already exists, its value is overwritten. Otherwise, a new + * content item is added to the end of the list of image library entry descriptors. + ** @param radionuclide coded entry to be set (from CID 4020 - PET Radionuclide) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPETImageRadionuclide(const CID4020_PETRadionuclide &radionuclide, + const OFBool check = OFTrue); + + /** set the value of the descriptor 'Radiopharmaceutical Agent' (TID 1607 - Row 2) + * for the current (most recently added) PET image library entry. + * If the content item already exists, its value is overwritten. Otherwise, a new + * content item is added to the end of the list of image library entry descriptors. + ** @param agent coded entry to be set (from CID 4021 - PET Radiopharmaceutical) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPETImageRadiopharmaceuticalAgent(const CID4021_PETRadiopharmaceutical &agent, + const OFBool check = OFTrue); + + /** set the value of the descriptor 'Radiopharmaceutical Start Date Time' (TID 1607 - + * Row 4) for the current (most recently added) PET image library entry. + * If the content item already exists, its value is overwritten. Otherwise, a new + * content item is added to the end of the list of image library entry descriptors. + ** @param dateTime date/time value to be set (associated DICOM VR=DT) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPETImageRadiopharmaceuticalStartDateTime(const OFString &dateTime, + const OFBool check = OFTrue); + + /** set the value of the descriptor 'Radiopharmaceutical Stop Date Time' (TID 1607 - + * Row 5) for the current (most recently added) PET image library entry. + * If the content item already exists, its value is overwritten. Otherwise, a new + * content item is added to the end of the list of image library entry descriptors. + ** @param dateTime date/time value to be set (associated DICOM VR=DT) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPETImageRadiopharmaceuticalStopDateTime(const OFString &dateTime, + const OFBool check = OFTrue); + + /** set the value of the descriptor 'Radiopharmaceutical Volume' (TID 1607 - Row 6) + * for the current (most recently added) PET image library entry. + * If the content item already exists, its value is overwritten. Otherwise, a new + * content item is added to the end of the list of image library entry descriptors. + ** @param volume numeric measurement value to be set (measurement unit should be + * CODE_UCUM_cm3 or a coded entry that is identical to this) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPETImageRadiopharmaceuticalVolume(const CMR_SRNumericMeasurementValue &volume, + const OFBool check = OFTrue); + + /** set the value of the descriptor 'Radiopharmaceutical Total Dose' (TID 1607 - + * Row 7) for the current (most recently added) PET image library entry. + * If the content item already exists, its value is overwritten. Otherwise, a new + * content item is added to the end of the list of image library entry descriptors. + ** @param totalDose numeric measurement value to be set (measurement unit should + * be CODE_UCUM_Bq or a coded entry that is identical to this) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPETImageRadionuclideTotalDose(const CMR_SRNumericMeasurementValue &totalDose, + const OFBool check = OFTrue); + + + protected: + + /** create the mandatory content item 'Image Library' (TID 1600 - Row 1) as the root + * node of this template. It is expected that the tree is currently empty. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createImageLibrary(); + + /** add image library entry descriptors (TID 1602) to given document subtree. + * This method also calls addModalitySpecificDescriptors() in order to add the + * included templates (TID 1603 to 1607). + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addImageEntryDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check); + + /** add image library entry descriptors (TID 1603 to 1607) to given document + * subtree depending on the given 'modality'. + * @warning The mapping of modality to included templates is probably not perfect + * yet. Also please note that most DICOM element values are copied from + * the main dataset and not from the respective functional group macros. + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param modality value of the Modality (0008,0060) attribute from 'dataset' + * @param mode mode specifying which optional content items are to be added + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addModalitySpecificDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const OFString &modality, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check); + + /** add image library entry descriptors for projection radiography (TID 1603) + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addProjectionRadiographyDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check); + + /** add image library entry descriptors for cross-sectional modalities (TID 1604) + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addCrossSectionalModalitiesDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check); + + /** add image library entry descriptors for CT (TID 1605) + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addComputedTomographyDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check); + + /** add image library entry descriptors for MR (TID 1606) + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addMagneticResonanceDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check); + + /** add image library entry descriptors for PET (TID 1607). + * @note The template rows 10 to 15 are not yet supported by this method. + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param mode mode specifying which optional content items are to be added + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addPositronEmissionTomographyDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check); + + /** go to the most recently added image library entry and check the value of the + * associated descriptor 'Modality' (TID 1602 - Row 1) + ** @param modalityCode coded entry (from CID 29) associated with the modality. + * Used to check the image library entry. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition goAndCheckImageLibraryEntry(const DSRCodedEntryValue &modalityCode); + + /** search for a particular content item (given by the concept name and value type) + * and set its string value. If not found, a new content item is added to the + * current position and the value is set. + ** @param valueType value type of the content item to be set/added + * @param conceptName concept name of the content item to be set/added + * @param stringValue string value of the content item to be set/added + * @param annotationText text used to annotate the content item (might be empty) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStringContentItemFromValue(const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFString &annotationText, + const OFBool check); + + /** search for a particular CODE content item (given by the concept name) and set its + * coded entry value. If not found, a new content item is added to the current + * position and the value is set. + ** @param conceptName concept name of the content item to be set/added + * @param codeValue coded entry value of the content item to be set/added + * @param annotationText text used to annotate the content item (might be empty) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeContentItemFromValue(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFString &annotationText, + const OFBool check); + + /** search for a particular NUM content item (given by the concept name) and set its + * numeric measurement value. If not found, a new content item is added to the + * current position and the value is set. + ** @param conceptName concept name of the content item to be set/added + * @param numericValue numeric measurement value of the content item to be + * set/added + * @param measurementUnit measurement unit that should be used by 'numericValue' + * (optional, might be empty). Used for checking purposes. + * @param annotationText text used to annotate the content item (might be empty) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericContentItemFromValue(const DSRCodedEntryValue &conceptName, + const DSRNumericMeasurementValue &numericValue, + const DSRCodedEntryValue &measurementUnit, + const OFString &annotationText, + const OFBool check); + + // --- static helper functions --- + + /** check whether there are any descriptors to be added (based on given parameters) + ** @param mode mode specifying what should be checked and how + * @param descriptors list with concept names of descriptors (depends on 'mode') + * @return OFTrue if there are any descriptors to be added, OFFalse if not + */ + static OFBool anyDescriptorsToBeAdded(const AddImageMode mode, + const ConceptNameList &descriptors); + + /** check whether a given descriptor should be added (based on further parameters) + ** @param conceptName concept name of the descriptor to be checked + * @param mode mode specifying what should be checked and how + * @param descriptors list with concept names of descriptors to be checked + * (depending on the given 'mode') + * @return OFTrue if given descriptor should be added, OFFalse if not + */ + static OFBool checkDescriptorToBeAdded(const DSRBasicCodedEntry &conceptName, + const AddImageMode mode, + const ConceptNameList &descriptors); + + /** add a content item with a string value copied from the given dataset. + * The content item is only created and added to the subtree if the specified data + * element is present in the 'dataset' and its string value is not empty. + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param tagKey DICOM tag specifying the attribute from which the string + * value should be retrieved + * @param pos index of the value to get (0..vm-1), -1 for all components + * @param valueType value type of the content item to be added + * @param conceptName concept name of the content item to be added + * @param annotationText optional text used to annotate the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition addStringContentItemFromDataset(DSRDocumentSubTree &tree, + DcmItem &dataset, + const DcmTagKey &tagKey, + const signed long pos, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check); + + /** add a CODE content item with a coded entry value copied from the given dataset. + * The content item is only created and added to the subtree if the specified code + * sequence is present in the 'dataset' and its value is valid (not empty). + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param tagKey DICOM tag specifying the code sequence attribute from which + * the coded entry should be retrieved + * @param conceptName concept name of the content item to be added + * @param annotationText optional text used to annotate the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition addCodeContentItemFromDataset(DSRDocumentSubTree &tree, + DcmItem &dataset, + const DcmTagKey &tagKey, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check); + + /** add a NUM content item with a numeric value copied from the given dataset. + * The content item is only created and added to the subtree if the specified data + * element is present in the 'dataset' and its value (retrieved as a string) is not + * empty. + ** @param tree subtree to which the content items should be added + * @param dataset DICOM dataset from which the values should be copied + * @param tagKey DICOM tag specifying the attribute from which the string + * value should be retrieved + * @param pos index of the value to get (0..vm-1), -1 for all + * components + * @param conceptName concept name of the content item to be added + * @param measurementUnit measurement unit to be used for the numeric content item + * @param annotationText optional text used to annotate the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition addNumericContentItemFromDataset(DSRDocumentSubTree &tree, + DcmItem &dataset, + const DcmTagKey &tagKey, + const signed long pos, + const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &measurementUnit, + const OFString &annotationText, + const OFBool check); +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the SR template class +typedef TID1600_ImageLibrary CMR_TID1600; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid300.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid300.h new file mode 100644 index 00000000..67d619e9 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid300.h @@ -0,0 +1,278 @@ +/* + * + * Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID300_Measurement + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID300_H +#define CMR_TID300_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" +#include "dcmtk/dcmsr/cmr/srnumvlu.h" +#include "dcmtk/dcmsr/cmr/cid244e.h" + + +// include this file in doxygen documentation + +/** @file tid300.h + * @brief Interface class for TID 300 in module dcmsr/cmr + */ + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 300 - Measurement (and included template 320). + * All added content items are annotated with a text in the format "TID 300 - Row [n]". + ** @tparam T_Measurement concept names for the numeric measurements (context group) + * @tparam T_Units units of the numeric measurement values (context group) + * @tparam T_Method methods used for measuring the values (context group) + * @tparam T_Derivation methods of deriving or calculating the values (context group) + ** @note Please note that currently only the mandatory and some optional/conditional + * content items and included templates are supported. + * @note Also note that this template class requires explicit instantiation for those + * combinations of the template parameters that are actually used. This is + * because the implementation is "hidden" in a separate source file, which has + * some advantages over the usual header-only approach. + */ +template +class DCMTK_CMR_EXPORT TID300_Measurement + : public DSRSubTemplate +{ + + public: + + // type definition + typedef CMR_SRNumericMeasurementValueWithUnits MeasurementValue; + + /** default constructor + */ + TID300_Measurement(); + + /** constructor. + * Also creates an initial measurement by calling createMeasurement() internally. + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + * @param check if enabled, check value for validity before setting it + */ + TID300_Measurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check = OFTrue); + + /** clear internal member variables. + * Also see notes on the clear() method of the base class. + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * That means, whether the base class is valid and whether all mandatory content + * items and included templates are valid, i.e. hasMeasurement() returns true. + ** @return OFTrue if valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** check whether the 'Measurement' content item (TID 300 - Row 1) is present. + * This content item is mandatory, i.e. should be present with a value. + ** @return OFTrue if the measurement is present, OFFalse otherwise + */ + OFBool hasMeasurement() const; + + /** create a new measurement. + * Clear the entire measurement and create the mandatory content item of this + * template, i.e.\ TID 300 - Row 1. + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createNewMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check = OFTrue); + + /** add a 'Modifier' content item (TID 300 - Row 2) with its concept name and value + ** @param conceptName coded entry describing the modifier type for the concept + * name of the measurement + * @param modifier coded entry describing the modifier value for the concept + * name of the measurement + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addModifier(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &modifier, + const OFBool check = OFTrue); + + /** set the value of the 'Measurement Method' content item (TID 300 - Row 3). + * If the content item already exists, its value is overwritten. + ** @param method coded entry describing the method used for measuring the value + * (e.g.\ from the given context group 'T_Method') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasurementMethod(const T_Method &method, + const OFBool check = OFTrue); + + /** set the value of the 'Derivation' content item (TID 300 - Row 4). + * If the content item already exists, its value is overwritten. + ** @param derivation coded entry describing the method of deriving or calculating + * the value (e.g.\ from the context group 'T_Derivation') + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setDerivation(const T_Derivation &derivation, + const OFBool check = OFTrue); + + /** add a 'Finding Site' content item (TID 300 - Row 5, 6 and 7) + ** @param site coded entry describing the anatomic location of the + * measurement + * @param laterality laterality associated with the 'site' (optional) + * @param siteModifier coded entry describing the topographical modifier of the + * 'site' (optional) + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality = CID244e_Laterality(), + const DSRCodedEntryValue &siteModifier = DSRCodedEntryValue(), + const OFBool check = OFTrue); + + /** add a 'Derivation Parameter' content item (TID 300 - Row 9). + * This is a by-value relationship. + ** @param conceptName coded entry describing the concept name of the derivation + * parameter + * @param numericValue numeric measurement value of the derivation parameter + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addDerivationParameter(const DSRCodedEntryValue &conceptName, + const CMR_SRNumericMeasurementValue &numericValue, + const OFBool check = OFTrue); + + /** add an 'Image' content item (TID 320 - Row 1) referencing the image used as a + * source of the measurement. This is a by-value relationship. + ** @param conceptName coded entry describing the purpose of reference + * @param imageReference reference to image used as a source of the measurement + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addImage(const DSRCodedEntryValue &conceptName, + const DSRImageReferenceValue &imageReference, + const OFBool check = OFTrue); + + /** add an 'Image' content item (TID 320 - Row 1) referencing the image used as a + * source of the measurement. This is a by-value relationship. + ** @param conceptName coded entry describing the purpose of reference + * @param dataset DICOM dataset from which the values for the reference to an + * image (SOP class UID and SOP instance UID), which was used + * as a source of the measurement, should be retrieved + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addImage(const DSRCodedEntryValue &conceptName, + DcmItem &dataset, + const OFBool check = OFTrue); + + /** add a 'Spatial Coordinates' content item (TID 320 - Row 3 and 4) referencing the + * image used as a source of the measurement. This is a by-value relationship. + ** @param conceptName coded entry describing the purpose of reference + * @param coordinatesValue spatial coordinates used as a source of the measurement + * @param imageReference reference to image the spatial coordinates are selected + * from + * @param check if enabled, check values for validity before setting + * them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addSpatialCoordinates(const DSRCodedEntryValue &conceptName, + const DSRSpatialCoordinatesValue &coordinatesValue, + const DSRImageReferenceValue &imageReference, + const OFBool check = OFTrue); + + /** set the value of the 'Equivalent Meaning of Concept Name' content item (TID 300 - + * Row 16). If the content item already exists, its value is overwritten. + ** @param meaning human-readable meaning of the concept name of the measurement + * that is equivalent to the post-coordinated meaning conveyed by + * the coded name and its concept modifier children + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEquivalentMeaningOfConceptName(const OFString &meaning, + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 300 - Row 18). + * If the content item already exists, its value is overwritten. + ** @param valueMap reference to a real world value mapping object applied to the + * stored image pixel values before their use for a measurement + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check = OFTrue); + + /** set the value of the 'Real World Value Map used for measurement' content item + * (TID 300 - Row 18). + * If the content item already exists, its value is overwritten. + ** @param dataset DICOM dataset from which the values for the reference to a + * real world value mapping object (SOP class UID and SOP instance + * UID) should be retrieved + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMap(DcmItem &dataset, + const OFBool check = OFTrue); + + + protected: + + /** create the mandatory root content item of this template, i.e.\ TID 300 - Row 1. + * It is expected that the tree is currently empty. + ** @param conceptName coded entry specifying the concept name of the measurement + * (e.g.\ from the given context group 'T_Measurement') + * @param numericValue numeric measurement value to be set. The measurement unit + * could be taken from the baseline context group 'T_Units'. + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check); + + /** add a new or replace an existing content item with a given node ID. + * If the content item does not exist, it is added to the measurement, i.e. below + * the root node. If it does exist, both the 'valueType' and 'conceptName' are + * checked before replacing the value. However, the value is not replaced by this + * method. This is up to the caller after this method returned with success. + ** @param nodePos index of the list entry that stores the ID of the node + * to search for + * @param relationshipType relationship type of the content item to be added/replaced + * @param valueType value type of the content item to be added/replaced + * @param conceptName concept name of the content item to be added/replaced + * @param annotationText optional text used to annotate the content item + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h new file mode 100644 index 00000000..da430372 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (C) 2018, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file for class TID4019_AlgorithmIdentification + * + * Author: Joerg Riesmeier + * + */ + + +#ifndef CMR_TID4019_H +#define CMR_TID4019_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrstpl.h" + +#include "dcmtk/dcmsr/cmr/define.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Implementation of DCMR Template: + * TID 4019 - Algorithm Identification. + * All added content items are annotated with a text in the format "TID 4019 - Row [n]". + */ +class DCMTK_CMR_EXPORT TID4019_AlgorithmIdentification + : public DSRSubTemplate +{ + + public: + + /** default constructor + */ + TID4019_AlgorithmIdentification(); + + /** set mandatory identification of the algorithm (according to TID 4019 Row 1 and 2). + * Any previously added algorithm parameters are removed if the passed values are valid. + ** @param algorithmName name assigned by the manufacturer to the software algorithm + * @param algorithmVersion version identifier assigned to the software algorithm + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setIdentification(const OFString &algorithmName, + const OFString &algorithmVersion, + const OFBool check = OFTrue); + + /** add optional algorithm parameter (according to TID 4019 Row 3). + * Calling this method requires that the mandatory identification has already been set. + ** @param algorithmParameter input parameter used to configure the behavior of the + * software algorithm + * @param check if enabled, check values for validity before setting them + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addParameter(const OFString &algorithmParameter, + const OFBool check = OFTrue); +}; + + +/*-------------------* + * type definition * + *-------------------*/ + +// define short name for the SR template class +typedef TID4019_AlgorithmIdentification CMR_TID4019; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/codes/dcm.h b/dcmsr/include/dcmtk/dcmsr/codes/dcm.h new file mode 100644 index 00000000..21a284a3 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/codes/dcm.h @@ -0,0 +1,4270 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with DICOM Controlled Terminology Code Definitions (Coding Scheme "DCM", Version "01") + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 16:52:41 by J. Riesmeier + * + */ + + +#ifndef CODES_DCM_H +#define CODES_DCM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*-----------------------* + * general information * + *-----------------------*/ + +#define CODE_DCM_CodingSchemeDesignator "DCM" +#define CODE_DCM_CodingSchemeName "DICOM Controlled Terminology" +#define CODE_DCM_CodingSchemeDescription "PS3.16 Content Mapping Resource, Annex D" +#define CODE_DCM_CodingSchemeResponsibleOrganization "DICOM" +#define CODE_DCM_CodingSchemeUID "1.2.840.10008.2.16.4" + + +/*--------------------* + * code definitions * + *--------------------*/ + +// total number of codes: 4218 +// - retired: 194 +// - no name: 27 +// - not unique: 17 + +// The basic scheme for creating the names is as follows: +// 'CODE_' + + ['_RETIRED'] + '_' + +// where is "DCM" and is either +// - a cleaned camel-case version of the code meaning (if unique within this coding scheme) or +// - a cleaned camel-case version of the code meaning with an underscore and the code value appended or +// - simply the code value with an underscore character appended (if code meaning contains an equation). +// The "cleaned camel-case version of the code meaning" is an attempt to map the free text +// description of the code meaning to a compiler-friendly but still human-readable representation. + +#define CODE_DCM_Autorefraction DSRBasicCodedEntry("AR", "DCM", "Autorefraction") +#define CODE_DCM_Archive DSRBasicCodedEntry("ARCHIVE", "DCM", "Archive") +#define CODE_DCM_RETIRED_Angioscopy DSRBasicCodedEntry("AS", "DCM", "Angioscopy") +#define CODE_DCM_ContentAssessmentResult DSRBasicCodedEntry("ASMT", "DCM", "Content Assessment Result") +#define CODE_DCM_Audio DSRBasicCodedEntry("AU", "DCM", "Audio") +#define CODE_DCM_UltrasoundBoneDensitometry DSRBasicCodedEntry("BDUS", "DCM", "Ultrasound Bone Densitometry") +#define CODE_DCM_BiomagneticImaging DSRBasicCodedEntry("BI", "DCM", "Biomagnetic imaging") +#define CODE_DCM_BoneMineralDensitometry DSRBasicCodedEntry("BMD", "DCM", "Bone Mineral Densitometry") +#define CODE_DCM_ComputerAssistedDetectionDiagnosis DSRBasicCodedEntry("CAD", "DCM", "Computer Assisted Detection/Diagnosis") +#define CODE_DCM_ImageCapture DSRBasicCodedEntry("CAPTURE", "DCM", "Image Capture") +#define CODE_DCM_RETIRED_ColorFlowDoppler DSRBasicCodedEntry("CD", "DCM", "Color flow Doppler") +#define CODE_DCM_RETIRED_Cinefluorography DSRBasicCodedEntry("CF", "DCM", "Cinefluorography") +#define CODE_DCM_ComputationServer DSRBasicCodedEntry("COMP", "DCM", "Computation Server") +#define CODE_DCM_RETIRED_Culposcopy DSRBasicCodedEntry("CP", "DCM", "Culposcopy") +#define CODE_DCM_ComputedRadiography DSRBasicCodedEntry("CR", "DCM", "Computed Radiography") +#define CODE_DCM_RETIRED_Cystoscopy DSRBasicCodedEntry("CS", "DCM", "Cystoscopy") +#define CODE_DCM_ComputedTomography DSRBasicCodedEntry("CT", "DCM", "Computed Tomography") +#define CODE_DCM_CTProtocol DSRBasicCodedEntry("CTPROTOCOL", "DCM", "CT Protocol") +#define CODE_DCM_RETIRED_DuplexDoppler DSRBasicCodedEntry("DD", "DCM", "Duplex Doppler") +#define CODE_DCM_RETIRED_DigitalFluoroscopy DSRBasicCodedEntry("DF", "DCM", "Digital fluoroscopy") +#define CODE_DCM_Diaphanography DSRBasicCodedEntry("DG", "DCM", "Diaphanography") +#define CODE_DCM_RETIRED_DigitalMicroscopy DSRBasicCodedEntry("DM", "DCM", "Digital microscopy") +#define CODE_DCM_Document_DOC DSRBasicCodedEntry("DOC", "DCM", "Document") +#define CODE_DCM_DocumentDigitizerEquipment DSRBasicCodedEntry("DOCD", "DCM", "Document Digitizer Equipment") +#define CODE_DCM_RETIRED_DigitalSubtractionAngiography DSRBasicCodedEntry("DS", "DCM", "Digital Subtraction Angiography") +#define CODE_DCM_DepartmentSystemScheduler DSRBasicCodedEntry("DSS", "DCM", "Department System Scheduler") +#define CODE_DCM_DigitalRadiography DSRBasicCodedEntry("DX", "DCM", "Digital Radiography") +#define CODE_DCM_RETIRED_Echocardiography DSRBasicCodedEntry("EC", "DCM", "Echocardiography") +#define CODE_DCM_Electrocardiography DSRBasicCodedEntry("ECG", "DCM", "Electrocardiography") +#define CODE_DCM_CardiacElectrophysiology DSRBasicCodedEntry("EPS", "DCM", "Cardiac Electrophysiology") +#define CODE_DCM_Endoscopy DSRBasicCodedEntry("ES", "DCM", "Endoscopy") +#define CODE_DCM_Female DSRBasicCodedEntry("F", "DCM", "Female") +#define CODE_DCM_RETIRED_FluoresceinAngiography DSRBasicCodedEntry("FA", "DCM", "Fluorescein angiography") +#define CODE_DCM_FemaleChangedToMale DSRBasicCodedEntry("FC", "DCM", "Female changed to Male") +#define CODE_DCM_SpatialFiducials_FID DSRBasicCodedEntry("FID", "DCM", "Spatial Fiducials") +#define CODE_DCM_FilmDigitizer DSRBasicCodedEntry("FILMD", "DCM", "Film Digitizer") +#define CODE_DCM_FemalePseudohermaphrodite DSRBasicCodedEntry("FP", "DCM", "Female Pseudohermaphrodite") +#define CODE_DCM_RETIRED_Fundoscopy DSRBasicCodedEntry("FS", "DCM", "Fundoscopy") +#define CODE_DCM_GeneralMicroscopy DSRBasicCodedEntry("GM", "DCM", "General Microscopy") +#define CODE_DCM_Hermaphrodite DSRBasicCodedEntry("H", "DCM", "Hermaphrodite") +#define CODE_DCM_HardCopy DSRBasicCodedEntry("HC", "DCM", "Hard Copy") +#define CODE_DCM_HemodynamicWaveform DSRBasicCodedEntry("HD", "DCM", "Hemodynamic Waveform") +#define CODE_DCM_IntraOralRadiography DSRBasicCodedEntry("IO", "DCM", "Intra-oral Radiography") +#define CODE_DCM_IntraocularLensCalculation DSRBasicCodedEntry("IOL", "DCM", "Intraocular Lens Calculation") +#define CODE_DCM_IntravascularOpticalCoherenceTomography DSRBasicCodedEntry("IVOCT", "DCM", "Intravascular Optical Coherence Tomography") +#define CODE_DCM_IntravascularUltrasound DSRBasicCodedEntry("IVUS", "DCM", "Intravascular Ultrasound") +#define CODE_DCM_Keratometry DSRBasicCodedEntry("KER", "DCM", "Keratometry") +#define CODE_DCM_KeyObjectSelection DSRBasicCodedEntry("KO", "DCM", "Key Object Selection") +#define CODE_DCM_Lensometry DSRBasicCodedEntry("LEN", "DCM", "Lensometry") +#define CODE_DCM_ProcedureLogging DSRBasicCodedEntry("LOG", "DCM", "Procedure Logging") +#define CODE_DCM_RETIRED_Laparoscopy DSRBasicCodedEntry("LP", "DCM", "Laparoscopy") +#define CODE_DCM_LaserSurfaceScan DSRBasicCodedEntry("LS", "DCM", "Laser surface scan") +#define CODE_DCM_Male DSRBasicCodedEntry("M", "DCM", "Male") +#define CODE_DCM_3DManufacturingModelingSystem DSRBasicCodedEntry("M3D", "DCM", "3D Manufacturing Modeling System") +#define CODE_DCM_RETIRED_MagneticResonanceAngiography DSRBasicCodedEntry("MA", "DCM", "Magnetic resonance angiography") +#define CODE_DCM_MaleChangedToFemale DSRBasicCodedEntry("MC", "DCM", "Male changed to Female") +#define CODE_DCM_MediaCreationDevice DSRBasicCodedEntry("MCD", "DCM", "Media Creation Device") +#define CODE_DCM_PortableMediaImporterEquipment DSRBasicCodedEntry("MEDIM", "DCM", "Portable Media Importer Equipment") +#define CODE_DCM_Mammography DSRBasicCodedEntry("MG", "DCM", "Mammography") +#define CODE_DCM_MalePseudohermaphrodite DSRBasicCodedEntry("MP", "DCM", "Male Pseudohermaphrodite") +#define CODE_DCM_MagneticResonance DSRBasicCodedEntry("MR", "DCM", "Magnetic Resonance") +#define CODE_DCM_RETIRED_MagneticResonanceSpectroscopy DSRBasicCodedEntry("MS", "DCM", "Magnetic resonance spectroscopy") +#define CODE_DCM_Nearline DSRBasicCodedEntry("NEARLINE", "DCM", "Nearline") +#define CODE_DCM_NuclearMedicine DSRBasicCodedEntry("NM", "DCM", "Nuclear Medicine") +#define CODE_DCM_OphthalmicAxialMeasurements DSRBasicCodedEntry("OAM", "DCM", "Ophthalmic Axial Measurements") +#define CODE_DCM_OpticalCoherenceTomography DSRBasicCodedEntry("OCT", "DCM", "Optical Coherence Tomography") +#define CODE_DCM_Offline DSRBasicCodedEntry("OFFLINE", "DCM", "Offline") +#define CODE_DCM_Online DSRBasicCodedEntry("ONLINE", "DCM", "Online") +#define CODE_DCM_OphthalmicPhotography DSRBasicCodedEntry("OP", "DCM", "Ophthalmic photography") +#define CODE_DCM_OphthalmicMapping DSRBasicCodedEntry("OPM", "DCM", "Ophthalmic Mapping") +#define CODE_DCM_OphthalmicRefraction DSRBasicCodedEntry("OPR", "DCM", "Ophthalmic Refraction") +#define CODE_DCM_OphthalmicTomography DSRBasicCodedEntry("OPT", "DCM", "Ophthalmic Tomography") +#define CODE_DCM_OphthalmicTomographyBScanVolumeAnalysis DSRBasicCodedEntry("OPTBSV", "DCM", "Ophthalmic Tomography B-scan Volume Analysis") +#define CODE_DCM_OphthalmicTomographyEnFace DSRBasicCodedEntry("OPTENF", "DCM", "Ophthalmic Tomography En Face") +#define CODE_DCM_OphthalmicVisualField DSRBasicCodedEntry("OPV", "DCM", "Ophthalmic Visual Field") +#define CODE_DCM_OpticalSurfaceScanner DSRBasicCodedEntry("OSS", "DCM", "Optical Surface Scanner") +#define CODE_DCM_OtherModality DSRBasicCodedEntry("OT", "DCM", "Other Modality") +#define CODE_DCM_Plan DSRBasicCodedEntry("PLAN", "DCM", "Plan") +#define CODE_DCM_PresentationState DSRBasicCodedEntry("PR", "DCM", "Presentation State") +#define CODE_DCM_HardCopyPrintServer DSRBasicCodedEntry("PRINT", "DCM", "Hard Copy Print Server") +#define CODE_DCM_PositronEmissionTomography DSRBasicCodedEntry("PT", "DCM", "Positron emission tomography") +#define CODE_DCM_PanoramicXRay DSRBasicCodedEntry("PX", "DCM", "Panoramic X-Ray") +#define CODE_DCM_Registration DSRBasicCodedEntry("REG", "DCM", "Registration") +#define CODE_DCM_RespiratoryWaveform DSRBasicCodedEntry("RESP", "DCM", "Respiratory Waveform") +#define CODE_DCM_Radiofluoroscopy DSRBasicCodedEntry("RF", "DCM", "Radiofluoroscopy") +#define CODE_DCM_RadiographicImaging DSRBasicCodedEntry("RG", "DCM", "Radiographic imaging") +#define CODE_DCM_RadiationTherapyDevice DSRBasicCodedEntry("RT", "DCM", "Radiation Therapy Device") +#define CODE_DCM_RadiotherapyDose DSRBasicCodedEntry("RTDOSE", "DCM", "Radiotherapy Dose") +#define CODE_DCM_RadiotherapyImage DSRBasicCodedEntry("RTIMAGE", "DCM", "Radiotherapy Image") +#define CODE_DCM_RadiotherapyPlan DSRBasicCodedEntry("RTPLAN", "DCM", "Radiotherapy Plan") +#define CODE_DCM_RadiotherapyTreatmentRecord DSRBasicCodedEntry("RTRECORD", "DCM", "Radiotherapy Treatment Record") +#define CODE_DCM_RadiotherapyStructureSet DSRBasicCodedEntry("RTSTRUCT", "DCM", "Radiotherapy Structure Set") +#define CODE_DCM_RealWorldValueMap DSRBasicCodedEntry("RWV", "DCM", "Real World Value Map") +#define CODE_DCM_Segmentation_SEG DSRBasicCodedEntry("SEG", "DCM", "Segmentation") +#define CODE_DCM_SlideMicroscopy_SM DSRBasicCodedEntry("SM", "DCM", "Slide Microscopy") +#define CODE_DCM_StereometricRelationship DSRBasicCodedEntry("SMR", "DCM", "Stereometric Relationship") +#define CODE_DCM_StructuredReportDocument DSRBasicCodedEntry("SR", "DCM", "Structured Report Document") +#define CODE_DCM_SubjectiveRefraction DSRBasicCodedEntry("SRF", "DCM", "Subjective Refraction") +#define CODE_DCM_RETIRED_SinglePhotonEmissionComputedTomography DSRBasicCodedEntry("ST", "DCM", "Single-photon emission computed tomography") +#define CODE_DCM_AutomatedSlideStainer DSRBasicCodedEntry("STAIN", "DCM", "Automated Slide Stainer") +#define CODE_DCM_Thermography DSRBasicCodedEntry("TG", "DCM", "Thermography") +#define CODE_DCM_UnknownSex DSRBasicCodedEntry("U", "DCM", "Unknown Sex") +#define CODE_DCM_Unavailable DSRBasicCodedEntry("UNAVAILABLE", "DCM", "Unavailable") +#define CODE_DCM_Ultrasound DSRBasicCodedEntry("US", "DCM", "Ultrasound") +#define CODE_DCM_VisualAcuity DSRBasicCodedEntry("VA", "DCM", "Visual Acuity") +#define CODE_DCM_RETIRED_Videofluorography DSRBasicCodedEntry("VF", "DCM", "Videofluorography") +#define CODE_DCM_VideoTapeDigitizerEquipment DSRBasicCodedEntry("VIDD", "DCM", "Video Tape Digitizer Equipment") +#define CODE_DCM_Workstation DSRBasicCodedEntry("WSD", "DCM", "Workstation") +#define CODE_DCM_XRayAngiography DSRBasicCodedEntry("XA", "DCM", "X-Ray Angiography") +#define CODE_DCM_ExternalCameraPhotography DSRBasicCodedEntry("XC", "DCM", "External-camera Photography") +#define CODE_DCM_DigitalTimecode_NOS DSRBasicCodedEntry("109001", "DCM", "Digital timecode (NOS)") +#define CODE_DCM_ECGBasedGatingSignal_processed DSRBasicCodedEntry("109002", "DCM", "ECG-based gating signal, processed") +#define CODE_DCM_IRIGBTimecode DSRBasicCodedEntry("109003", "DCM", "IRIG-B timecode") +#define CODE_DCM_XRayFluoroscopyOnSignal DSRBasicCodedEntry("109004", "DCM", "X-Ray Fluoroscopy On Signal") +#define CODE_DCM_XRayOnTrigger DSRBasicCodedEntry("109005", "DCM", "X-Ray On Trigger") +#define CODE_DCM_DifferentialSignal DSRBasicCodedEntry("109006", "DCM", "Differential signal") +#define CODE_DCM_HisBundleElectrogram DSRBasicCodedEntry("109007", "DCM", "His bundle electrogram") +#define CODE_DCM_MonopoleSignal DSRBasicCodedEntry("109008", "DCM", "Monopole signal") +#define CODE_DCM_Pacing_electrical_stimulus_voltage DSRBasicCodedEntry("109009", "DCM", "Pacing (electrical) stimulus, voltage") +#define CODE_DCM_RadioFrequencyAblation_power DSRBasicCodedEntry("109010", "DCM", "Radio frequency ablation, power") +#define CODE_DCM_VoltageMeasurementByBasketCatheter DSRBasicCodedEntry("109011", "DCM", "Voltage measurement by basket catheter") +#define CODE_DCM_VoltageMeasurementByMappingCatheter DSRBasicCodedEntry("109012", "DCM", "Voltage measurement by mapping catheter") +#define CODE_DCM_VoltageMeasurement DSRBasicCodedEntry("109013", "DCM", "Voltage measurement") +#define CODE_DCM_35PercentOfThermalCO DSRBasicCodedEntry("109014", "DCM", "35% of thermal CO") +#define CODE_DCM_70PercentOfThermalCO DSRBasicCodedEntry("109015", "DCM", "70% of thermal CO") +#define CODE_DCM_AWavePeakPressure DSRBasicCodedEntry("109016", "DCM", "A wave peak pressure") +#define CODE_DCM_AWavePressure_average DSRBasicCodedEntry("109017", "DCM", "A wave pressure, average") +#define CODE_DCM_BeatDetected_accepted DSRBasicCodedEntry("109018", "DCM", "Beat detected (accepted)") +#define CODE_DCM_BeatDetected_rejected DSRBasicCodedEntry("109019", "DCM", "Beat detected (rejected)") +#define CODE_DCM_RETIRED_DiastolicPressure_average DSRBasicCodedEntry("109020", "DCM", "Diastolic pressure, average") +#define CODE_DCM_RETIRED_DiastolicPressureNadir DSRBasicCodedEntry("109021", "DCM", "Diastolic pressure nadir") +#define CODE_DCM_RETIRED_EndDiastole DSRBasicCodedEntry("109022", "DCM", "End diastole") +#define CODE_DCM_EndOfExpiration DSRBasicCodedEntry("109023", "DCM", "End of expiration") +#define CODE_DCM_EndOfInspiration DSRBasicCodedEntry("109024", "DCM", "End of inspiration") +#define CODE_DCM_MaxDpDt DSRBasicCodedEntry("109025", "DCM", "Max dp/dt") +#define CODE_DCM_MaxNegDpDt DSRBasicCodedEntry("109026", "DCM", "Max neg dp/dt") +#define CODE_DCM_RETIRED_MeanBloodPressure DSRBasicCodedEntry("109027", "DCM", "Mean blood pressure") +#define CODE_DCM_PeakOfThermalCardiacOutputBolus DSRBasicCodedEntry("109028", "DCM", "Peak of thermal cardiac output bolus") +#define CODE_DCM_StartOfExpiration DSRBasicCodedEntry("109029", "DCM", "Start of expiration") +#define CODE_DCM_StartOfInspiration DSRBasicCodedEntry("109030", "DCM", "Start of inspiration") +#define CODE_DCM_StartOfThermalCardiacOutputBolus DSRBasicCodedEntry("109031", "DCM", "Start of thermal cardiac output bolus") +#define CODE_DCM_RETIRED_SystolicPressure_average DSRBasicCodedEntry("109032", "DCM", "Systolic pressure, average") +#define CODE_DCM_RETIRED_SystolicPeakPressure DSRBasicCodedEntry("109033", "DCM", "Systolic peak pressure") +#define CODE_DCM_VWavePeakPressure DSRBasicCodedEntry("109034", "DCM", "V wave peak pressure") +#define CODE_DCM_VWavePressure_average DSRBasicCodedEntry("109035", "DCM", "V wave pressure, average") +#define CODE_DCM_ValveClose DSRBasicCodedEntry("109036", "DCM", "Valve close") +#define CODE_DCM_ValveOpen DSRBasicCodedEntry("109037", "DCM", "Valve open") +#define CODE_DCM_AblationOff DSRBasicCodedEntry("109038", "DCM", "Ablation off") +#define CODE_DCM_Ablationon DSRBasicCodedEntry("109039", "DCM", "Ablation on") +#define CODE_DCM_HISBundleWave DSRBasicCodedEntry("109040", "DCM", "HIS bundle wave") +#define CODE_DCM_PWave DSRBasicCodedEntry("109041", "DCM", "P wave") +#define CODE_DCM_QWave DSRBasicCodedEntry("109042", "DCM", "Q wave") +#define CODE_DCM_RWave DSRBasicCodedEntry("109043", "DCM", "R wave") +#define CODE_DCM_SWave DSRBasicCodedEntry("109044", "DCM", "S wave") +#define CODE_DCM_StartOfAtrialContraction DSRBasicCodedEntry("109045", "DCM", "Start of atrial contraction") +#define CODE_DCM_StartOfAtrialContraction_subsequent DSRBasicCodedEntry("109046", "DCM", "Start of atrial contraction (subsequent)") +#define CODE_DCM_StimulationAtRate1Interval DSRBasicCodedEntry("109047", "DCM", "Stimulation at rate 1 interval") +#define CODE_DCM_StimulationAtRate2Interval DSRBasicCodedEntry("109048", "DCM", "Stimulation at rate 2 interval") +#define CODE_DCM_StimulationAtRate3Interval DSRBasicCodedEntry("109049", "DCM", "Stimulation at rate 3 interval") +#define CODE_DCM_StimulationAtRate4Interval DSRBasicCodedEntry("109050", "DCM", "Stimulation at rate 4 interval") +#define CODE_DCM_TWave DSRBasicCodedEntry("109051", "DCM", "T wave") +#define CODE_DCM_VWave DSRBasicCodedEntry("109052", "DCM", "V wave") +#define CODE_DCM_VWaveOfNextBeat DSRBasicCodedEntry("109053", "DCM", "V wave of next beat") +#define CODE_DCM_PatientState DSRBasicCodedEntry("109054", "DCM", "Patient State") +#define CODE_DCM_ProtocolStage DSRBasicCodedEntry("109055", "DCM", "Protocol Stage") +#define CODE_DCM_StressProtocol DSRBasicCodedEntry("109056", "DCM", "Stress Protocol") +#define CODE_DCM_RETIRED_CatheterizationProcedurePhase DSRBasicCodedEntry("109057", "DCM", "Catheterization Procedure Phase") +#define CODE_DCM_ContrastPhase DSRBasicCodedEntry("109058", "DCM", "Contrast Phase") +#define CODE_DCM_PhysiologicalChallenges DSRBasicCodedEntry("109059", "DCM", "Physiological challenges") +#define CODE_DCM_ProcedureStepNumber DSRBasicCodedEntry("109060", "DCM", "Procedure Step Number") +#define CODE_DCM_EPProcedurePhase DSRBasicCodedEntry("109061", "DCM", "EP Procedure Phase") +#define CODE_DCM_PulseTrainDefinition DSRBasicCodedEntry("109063", "DCM", "Pulse train definition") +#define CODE_DCM_RETIRED_EndOfSystole DSRBasicCodedEntry("109070", "DCM", "End of systole") +#define CODE_DCM_IndicatorMeanTransitTime DSRBasicCodedEntry("109071", "DCM", "Indicator mean transit time") +#define CODE_DCM_Tau DSRBasicCodedEntry("109072", "DCM", "Tau") +#define CODE_DCM_VMaxMyocardial DSRBasicCodedEntry("109073", "DCM", "V max myocardial") +#define CODE_DCM_RealTimeAcquisition DSRBasicCodedEntry("109080", "DCM", "Real time acquisition") +#define CODE_DCM_ProspectiveGating DSRBasicCodedEntry("109081", "DCM", "Prospective gating") +#define CODE_DCM_RetrospectiveGating DSRBasicCodedEntry("109082", "DCM", "Retrospective gating") +#define CODE_DCM_Paced DSRBasicCodedEntry("109083", "DCM", "Paced") +#define CODE_DCM_RETIRED_CardiacStressState DSRBasicCodedEntry("109091", "DCM", "Cardiac Stress State") +#define CODE_DCM_ReinjectionState DSRBasicCodedEntry("109092", "DCM", "Reinjection State") +#define CODE_DCM_RedistributionState DSRBasicCodedEntry("109093", "DCM", "Redistribution State") +#define CODE_DCM_DelayedRedistributionState DSRBasicCodedEntry("109094", "DCM", "Delayed Redistribution State") +#define CODE_DCM_RETIRED_PeakStressState DSRBasicCodedEntry("109095", "DCM", "Peak stress state") +#define CODE_DCM_RETIRED_RecoveryState DSRBasicCodedEntry("109096", "DCM", "Recovery state") +#define CODE_DCM_AcquisitionEquipment DSRBasicCodedEntry("109101", "DCM", "Acquisition Equipment") +#define CODE_DCM_ProcessingEquipment DSRBasicCodedEntry("109102", "DCM", "Processing Equipment") +#define CODE_DCM_ModifyingEquipment DSRBasicCodedEntry("109103", "DCM", "Modifying Equipment") +#define CODE_DCM_DeIdentifyingEquipment DSRBasicCodedEntry("109104", "DCM", "De-identifying Equipment") +#define CODE_DCM_FrameExtractingEquipment DSRBasicCodedEntry("109105", "DCM", "Frame Extracting Equipment") +#define CODE_DCM_EnhancedMultiFrameConversionEquipment DSRBasicCodedEntry("109106", "DCM", "Enhanced Multi-frame Conversion Equipment") +#define CODE_DCM_Voice DSRBasicCodedEntry("109110", "DCM", "Voice") +#define CODE_DCM_OperatorNarrative DSRBasicCodedEntry("109111", "DCM", "Operator's narrative") +#define CODE_DCM_AmbientRoomEnvironment DSRBasicCodedEntry("109112", "DCM", "Ambient room environment") +#define CODE_DCM_DopplerAudio DSRBasicCodedEntry("109113", "DCM", "Doppler audio") +#define CODE_DCM_Phonocardiogram DSRBasicCodedEntry("109114", "DCM", "Phonocardiogram") +#define CODE_DCM_PhysiologicalAudioSignal DSRBasicCodedEntry("109115", "DCM", "Physiological audio signal") +#define CODE_DCM_ArterialPulseWaveform DSRBasicCodedEntry("109116", "DCM", "Arterial Pulse Waveform") +#define CODE_DCM_RespirationWaveform DSRBasicCodedEntry("109117", "DCM", "Respiration Waveform") +#define CODE_DCM_OnAdmissionToUnit DSRBasicCodedEntry("109120", "DCM", "On admission to unit") +#define CODE_DCM_OnDischarge DSRBasicCodedEntry("109121", "DCM", "On discharge") +#define CODE_DCM_OnDischargeFromUnit DSRBasicCodedEntry("109122", "DCM", "On discharge from unit") +#define CODE_DCM_PreIntervention DSRBasicCodedEntry("109123", "DCM", "Pre-intervention") +#define CODE_DCM_PostIntervention DSRBasicCodedEntry("109124", "DCM", "Post-intervention") +#define CODE_DCM_AtLastAppointment DSRBasicCodedEntry("109125", "DCM", "At last appointment") +#define CODE_DCM_JointPositionMethod DSRBasicCodedEntry("109132", "DCM", "Joint position method") +#define CODE_DCM_PhysicalForce DSRBasicCodedEntry("109133", "DCM", "Physical force") +#define CODE_DCM_PriorToVoiding DSRBasicCodedEntry("109134", "DCM", "Prior to voiding") +#define CODE_DCM_PostVoiding DSRBasicCodedEntry("109135", "DCM", "Post voiding") +#define CODE_DCM_NeutralMusculoskeletalPosition DSRBasicCodedEntry("109136", "DCM", "Neutral musculoskeletal position") +#define CODE_DCM_DuringVoiding DSRBasicCodedEntry("109137", "DCM", "During voiding") +#define CODE_DCM_AmericaKennelClub DSRBasicCodedEntry("109200", "DCM", "America Kennel Club") +#define CODE_DCM_AmericaPetRegistryInc DSRBasicCodedEntry("109201", "DCM", "America's Pet Registry Inc.") +#define CODE_DCM_AmericanCanineAssociation DSRBasicCodedEntry("109202", "DCM", "American Canine Association") +#define CODE_DCM_AmericanPurebredRegistry DSRBasicCodedEntry("109203", "DCM", "American Purebred Registry") +#define CODE_DCM_AmericanRareBreedAssociation DSRBasicCodedEntry("109204", "DCM", "American Rare Breed Association") +#define CODE_DCM_AnimalRegistryUnlimited DSRBasicCodedEntry("109205", "DCM", "Animal Registry Unlimited") +#define CODE_DCM_AnimalResearchFoundation DSRBasicCodedEntry("109206", "DCM", "Animal Research Foundation") +#define CODE_DCM_CanadianBorderCollieAssociation DSRBasicCodedEntry("109207", "DCM", "Canadian Border Collie Association") +#define CODE_DCM_CanadianKennelClub DSRBasicCodedEntry("109208", "DCM", "Canadian Kennel Club") +#define CODE_DCM_CanadianLivestockRecordsAssociation DSRBasicCodedEntry("109209", "DCM", "Canadian Livestock Records Association") +#define CODE_DCM_CanineFederationOfCanada DSRBasicCodedEntry("109210", "DCM", "Canine Federation of Canada") +#define CODE_DCM_ContinentalKennelClub DSRBasicCodedEntry("109211", "DCM", "Continental Kennel Club") +#define CODE_DCM_DogRegistryOfAmerica DSRBasicCodedEntry("109212", "DCM", "Dog Registry of America") +#define CODE_DCM_FederationOfInternationalCanines DSRBasicCodedEntry("109213", "DCM", "Federation of International Canines") +#define CODE_DCM_InternationalProgressiveDogBreedersAlliance DSRBasicCodedEntry("109214", "DCM", "International Progressive Dog Breeders' Alliance") +#define CODE_DCM_NationalKennelClub DSRBasicCodedEntry("109215", "DCM", "National Kennel Club") +#define CODE_DCM_NorthAmericanPurebredDogRegistry DSRBasicCodedEntry("109216", "DCM", "North American Purebred Dog Registry") +#define CODE_DCM_UnitedAllBreedRegistry DSRBasicCodedEntry("109217", "DCM", "United All Breed Registry") +#define CODE_DCM_UnitedKennelClub DSRBasicCodedEntry("109218", "DCM", "United Kennel Club") +#define CODE_DCM_UniversalKennelClubInternational DSRBasicCodedEntry("109219", "DCM", "Universal Kennel Club International") +#define CODE_DCM_WorkingCanineAssociationOfCanada DSRBasicCodedEntry("109220", "DCM", "Working Canine Association of Canada") +#define CODE_DCM_WorldKennelClub DSRBasicCodedEntry("109221", "DCM", "World Kennel Club") +#define CODE_DCM_WorldWideKennelClub DSRBasicCodedEntry("109222", "DCM", "World Wide Kennel Club") +#define CODE_DCM_OverallImageQualityEvaluation DSRBasicCodedEntry("109701", "DCM", "Overall image quality evaluation") +#define CODE_DCM_GrayscaleResolutionEvaluation DSRBasicCodedEntry("109702", "DCM", "Grayscale resolution evaluation") +#define CODE_DCM_LuminanceResponseEvaluation DSRBasicCodedEntry("109703", "DCM", "Luminance response evaluation") +#define CODE_DCM_LuminanceUniformityEvaluation DSRBasicCodedEntry("109704", "DCM", "Luminance uniformity evaluation") +#define CODE_DCM_ChromaticityEvaluation DSRBasicCodedEntry("109705", "DCM", "Chromaticity evaluation") +#define CODE_DCM_PixelFaultsEvaluation DSRBasicCodedEntry("109706", "DCM", "Pixel faults evaluation") +#define CODE_DCM_VeilingGlareEvaluation DSRBasicCodedEntry("109707", "DCM", "Veiling glare evaluation") +#define CODE_DCM_GeometricalImageEvaluation DSRBasicCodedEntry("109708", "DCM", "Geometrical image evaluation") +#define CODE_DCM_AngularViewingEvaluation DSRBasicCodedEntry("109709", "DCM", "Angular viewing evaluation") +#define CODE_DCM_ClinicalEvaluation DSRBasicCodedEntry("109710", "DCM", "Clinical evaluation") +#define CODE_DCM_TG18_QCPattern DSRBasicCodedEntry("109801", "DCM", "TG18-QC Pattern") +#define CODE_DCM_TG18_BRPattern DSRBasicCodedEntry("109802", "DCM", "TG18-BR Pattern") +#define CODE_DCM_TG18_PQCPattern DSRBasicCodedEntry("109803", "DCM", "TG18-PQC Pattern") +#define CODE_DCM_TG18_CTPattern DSRBasicCodedEntry("109804", "DCM", "TG18-CT Pattern") +#define CODE_DCM_TG18_LN801Pattern DSRBasicCodedEntry("109805", "DCM", "TG18-LN8-01 Pattern") +#define CODE_DCM_TG18_LN802Pattern DSRBasicCodedEntry("109806", "DCM", "TG18-LN8-02 Pattern") +#define CODE_DCM_TG18_LN803Pattern DSRBasicCodedEntry("109807", "DCM", "TG18-LN8-03 Pattern") +#define CODE_DCM_TG18_LN804Pattern DSRBasicCodedEntry("109808", "DCM", "TG18-LN8-04 Pattern") +#define CODE_DCM_TG18_LN805Pattern DSRBasicCodedEntry("109809", "DCM", "TG18-LN8-05 Pattern") +#define CODE_DCM_TG18_LN806Pattern DSRBasicCodedEntry("109810", "DCM", "TG18-LN8-06 Pattern") +#define CODE_DCM_TG18_LN807Pattern DSRBasicCodedEntry("109811", "DCM", "TG18-LN8-07 Pattern") +#define CODE_DCM_TG18_LN808Pattern DSRBasicCodedEntry("109812", "DCM", "TG18-LN8-08 Pattern") +#define CODE_DCM_TG18_LN809Pattern DSRBasicCodedEntry("109813", "DCM", "TG18-LN8-09 Pattern") +#define CODE_DCM_TG18_LN810Pattern DSRBasicCodedEntry("109814", "DCM", "TG18-LN8-10 Pattern") +#define CODE_DCM_TG18_LN811Pattern DSRBasicCodedEntry("109815", "DCM", "TG18-LN8-11 Pattern") +#define CODE_DCM_TG18_LN812Pattern DSRBasicCodedEntry("109816", "DCM", "TG18-LN8-12 Pattern") +#define CODE_DCM_TG18_LN813Pattern DSRBasicCodedEntry("109817", "DCM", "TG18-LN8-13 Pattern") +#define CODE_DCM_TG18_LN814Pattern DSRBasicCodedEntry("109818", "DCM", "TG18-LN8-14 Pattern") +#define CODE_DCM_TG18_LN815Pattern DSRBasicCodedEntry("109819", "DCM", "TG18-LN8-15 Pattern") +#define CODE_DCM_TG18_LN816Pattern DSRBasicCodedEntry("109820", "DCM", "TG18-LN8-16 Pattern") +#define CODE_DCM_TG18_LN817Pattern DSRBasicCodedEntry("109821", "DCM", "TG18-LN8-17 Pattern") +#define CODE_DCM_TG18_LN818Pattern DSRBasicCodedEntry("109822", "DCM", "TG18-LN8-18 Pattern") +#define CODE_DCM_TG18_LN1201Pattern DSRBasicCodedEntry("109823", "DCM", "TG18-LN12-01 Pattern") +#define CODE_DCM_TG18_LN1202Pattern DSRBasicCodedEntry("109824", "DCM", "TG18-LN12-02 Pattern") +#define CODE_DCM_TG18_LN1203Pattern DSRBasicCodedEntry("109825", "DCM", "TG18-LN12-03 Pattern") +#define CODE_DCM_TG18_LN1204Pattern DSRBasicCodedEntry("109826", "DCM", "TG18-LN12-04 Pattern") +#define CODE_DCM_TG18_LN1205Pattern DSRBasicCodedEntry("109827", "DCM", "TG18-LN12-05 Pattern") +#define CODE_DCM_TG18_LN1206Pattern DSRBasicCodedEntry("109828", "DCM", "TG18-LN12-06 Pattern") +#define CODE_DCM_TG18_LN1207Pattern DSRBasicCodedEntry("109829", "DCM", "TG18-LN12-07 Pattern") +#define CODE_DCM_TG18_LN1208Pattern DSRBasicCodedEntry("109830", "DCM", "TG18-LN12-08 Pattern") +#define CODE_DCM_TG18_LN1209Pattern DSRBasicCodedEntry("109831", "DCM", "TG18-LN12-09 Pattern") +#define CODE_DCM_TG18_LN1210Pattern DSRBasicCodedEntry("109832", "DCM", "TG18-LN12-10 Pattern") +#define CODE_DCM_TG18_LN1211Pattern DSRBasicCodedEntry("109833", "DCM", "TG18-LN12-11 Pattern") +#define CODE_DCM_TG18_LN1212Pattern DSRBasicCodedEntry("109834", "DCM", "TG18-LN12-12 Pattern") +#define CODE_DCM_TG18_LN1213Pattern DSRBasicCodedEntry("109835", "DCM", "TG18-LN12-13 Pattern") +#define CODE_DCM_TG18_LN1214Pattern DSRBasicCodedEntry("109836", "DCM", "TG18-LN12-14 Pattern") +#define CODE_DCM_TG18_LN1215Pattern DSRBasicCodedEntry("109837", "DCM", "TG18-LN12-15 Pattern") +#define CODE_DCM_TG18_LN1216Pattern DSRBasicCodedEntry("109838", "DCM", "TG18-LN12-16 Pattern") +#define CODE_DCM_TG18_LN1217Pattern DSRBasicCodedEntry("109839", "DCM", "TG18-LN12-17 Pattern") +#define CODE_DCM_TG18_LN1218Pattern DSRBasicCodedEntry("109840", "DCM", "TG18-LN12-18 Pattern") +#define CODE_DCM_TG18_UN10Pattern DSRBasicCodedEntry("109841", "DCM", "TG18-UN10 Pattern") +#define CODE_DCM_TG18_UN80Pattern DSRBasicCodedEntry("109842", "DCM", "TG18-UN80 Pattern") +#define CODE_DCM_TG18_UNL10Pattern DSRBasicCodedEntry("109843", "DCM", "TG18-UNL10 Pattern") +#define CODE_DCM_TG18_UNL80Pattern DSRBasicCodedEntry("109844", "DCM", "TG18-UNL80 Pattern") +#define CODE_DCM_TG18_ADPattern DSRBasicCodedEntry("109845", "DCM", "TG18-AD Pattern") +#define CODE_DCM_TG18_MPPattern DSRBasicCodedEntry("109846", "DCM", "TG18-MP Pattern") +#define CODE_DCM_TG18_RH10Pattern DSRBasicCodedEntry("109847", "DCM", "TG18-RH10 Pattern") +#define CODE_DCM_TG18_RH50Pattern DSRBasicCodedEntry("109848", "DCM", "TG18-RH50 Pattern") +#define CODE_DCM_TG18_RH89Pattern DSRBasicCodedEntry("109849", "DCM", "TG18-RH89 Pattern") +#define CODE_DCM_TG18_RV10Pattern DSRBasicCodedEntry("109850", "DCM", "TG18-RV10 Pattern") +#define CODE_DCM_TG18_RV50Pattern DSRBasicCodedEntry("109851", "DCM", "TG18-RV50 Pattern") +#define CODE_DCM_TG18_RV89Pattern DSRBasicCodedEntry("109852", "DCM", "TG18-RV89 Pattern") +#define CODE_DCM_TG18_PXPattern DSRBasicCodedEntry("109853", "DCM", "TG18-PX Pattern") +#define CODE_DCM_TG18_CXPattern DSRBasicCodedEntry("109854", "DCM", "TG18-CX Pattern") +#define CODE_DCM_TG18_LPH10Pattern DSRBasicCodedEntry("109855", "DCM", "TG18-LPH10 Pattern") +#define CODE_DCM_TG18_LPH50Pattern DSRBasicCodedEntry("109856", "DCM", "TG18-LPH50 Pattern") +#define CODE_DCM_TG18_LPH89Pattern DSRBasicCodedEntry("109857", "DCM", "TG18-LPH89 Pattern") +#define CODE_DCM_TG18_LPV10Pattern DSRBasicCodedEntry("109858", "DCM", "TG18-LPV10 Pattern") +#define CODE_DCM_TG18_LPV50Pattern DSRBasicCodedEntry("109859", "DCM", "TG18-LPV50 Pattern") +#define CODE_DCM_TG18_LPV89Pattern DSRBasicCodedEntry("109860", "DCM", "TG18-LPV89 Pattern") +#define CODE_DCM_TG18_AFCPattern DSRBasicCodedEntry("109861", "DCM", "TG18-AFC Pattern") +#define CODE_DCM_TG18_NS10Pattern DSRBasicCodedEntry("109862", "DCM", "TG18-NS10 Pattern") +#define CODE_DCM_TG18_NS50Pattern DSRBasicCodedEntry("109863", "DCM", "TG18-NS50 Pattern") +#define CODE_DCM_TG18_NS89Pattern DSRBasicCodedEntry("109864", "DCM", "TG18-NS89 Pattern") +#define CODE_DCM_TG18_GVPattern DSRBasicCodedEntry("109865", "DCM", "TG18-GV Pattern") +#define CODE_DCM_TG18_GVNPattern DSRBasicCodedEntry("109866", "DCM", "TG18-GVN Pattern") +#define CODE_DCM_TG18_GQPattern DSRBasicCodedEntry("109867", "DCM", "TG18-GQ Pattern") +#define CODE_DCM_TG18_GQNPattern DSRBasicCodedEntry("109868", "DCM", "TG18-GQN Pattern") +#define CODE_DCM_TG18_GQBPattern DSRBasicCodedEntry("109869", "DCM", "TG18-GQB Pattern") +#define CODE_DCM_TG18_GA03Pattern DSRBasicCodedEntry("109870", "DCM", "TG18-GA03 Pattern") +#define CODE_DCM_TG18_GA05Pattern DSRBasicCodedEntry("109871", "DCM", "TG18-GA05 Pattern") +#define CODE_DCM_TG18_GA08Pattern DSRBasicCodedEntry("109872", "DCM", "TG18-GA08 Pattern") +#define CODE_DCM_TG18_GA10Pattern DSRBasicCodedEntry("109873", "DCM", "TG18-GA10 Pattern") +#define CODE_DCM_TG18_GA15Pattern DSRBasicCodedEntry("109874", "DCM", "TG18-GA15 Pattern") +#define CODE_DCM_TG18_GA20Pattern DSRBasicCodedEntry("109875", "DCM", "TG18-GA20 Pattern") +#define CODE_DCM_TG18_GA25Pattern DSRBasicCodedEntry("109876", "DCM", "TG18-GA25 Pattern") +#define CODE_DCM_TG18_GA30Pattern DSRBasicCodedEntry("109877", "DCM", "TG18-GA30 Pattern") +#define CODE_DCM_TG18_CHImage DSRBasicCodedEntry("109878", "DCM", "TG18-CH Image") +#define CODE_DCM_TG18_KNImage DSRBasicCodedEntry("109879", "DCM", "TG18-KN Image") +#define CODE_DCM_TG18_MM1Image DSRBasicCodedEntry("109880", "DCM", "TG18-MM1 Image") +#define CODE_DCM_TG18_MM2Image DSRBasicCodedEntry("109881", "DCM", "TG18-MM2 Image") +#define CODE_DCM_OIQPattern DSRBasicCodedEntry("109901", "DCM", "OIQ Pattern") +#define CODE_DCM_ANGPattern DSRBasicCodedEntry("109902", "DCM", "ANG Pattern") +#define CODE_DCM_GDPattern DSRBasicCodedEntry("109903", "DCM", "GD Pattern") +#define CODE_DCM_BN01Pattern DSRBasicCodedEntry("109904", "DCM", "BN01 Pattern") +#define CODE_DCM_BN02Pattern DSRBasicCodedEntry("109905", "DCM", "BN02 Pattern") +#define CODE_DCM_BN03Pattern DSRBasicCodedEntry("109906", "DCM", "BN03 Pattern") +#define CODE_DCM_BN04Pattern DSRBasicCodedEntry("109907", "DCM", "BN04 Pattern") +#define CODE_DCM_BN05Pattern DSRBasicCodedEntry("109908", "DCM", "BN05 Pattern") +#define CODE_DCM_BN06Pattern DSRBasicCodedEntry("109909", "DCM", "BN06 Pattern") +#define CODE_DCM_BN07Pattern DSRBasicCodedEntry("109910", "DCM", "BN07 Pattern") +#define CODE_DCM_BN08Pattern DSRBasicCodedEntry("109911", "DCM", "BN08 Pattern") +#define CODE_DCM_BN09Pattern DSRBasicCodedEntry("109912", "DCM", "BN09 Pattern") +#define CODE_DCM_BN10Pattern DSRBasicCodedEntry("109913", "DCM", "BN10 Pattern") +#define CODE_DCM_BN11Pattern DSRBasicCodedEntry("109914", "DCM", "BN11 Pattern") +#define CODE_DCM_BN12Pattern DSRBasicCodedEntry("109915", "DCM", "BN12 Pattern") +#define CODE_DCM_BN13Pattern DSRBasicCodedEntry("109916", "DCM", "BN13 Pattern") +#define CODE_DCM_BN14Pattern DSRBasicCodedEntry("109917", "DCM", "BN14 Pattern") +#define CODE_DCM_BN15Pattern DSRBasicCodedEntry("109918", "DCM", "BN15 Pattern") +#define CODE_DCM_BN16Pattern DSRBasicCodedEntry("109919", "DCM", "BN16 Pattern") +#define CODE_DCM_BN17Pattern DSRBasicCodedEntry("109920", "DCM", "BN17 Pattern") +#define CODE_DCM_BN18Pattern DSRBasicCodedEntry("109921", "DCM", "BN18 Pattern") +#define CODE_DCM_DINGrayscalePattern DSRBasicCodedEntry("109931", "DCM", "DIN Grayscale Pattern") +#define CODE_DCM_DINGeometryPattern DSRBasicCodedEntry("109932", "DCM", "DIN Geometry Pattern") +#define CODE_DCM_DINResolutionPattern DSRBasicCodedEntry("109933", "DCM", "DIN Resolution Pattern") +#define CODE_DCM_WhitePattern DSRBasicCodedEntry("109941", "DCM", "White Pattern") +#define CODE_DCM_SMPTEPattern DSRBasicCodedEntry("109943", "DCM", "SMPTE Pattern") +#define CODE_DCM_CRTDisplay DSRBasicCodedEntry("109991", "DCM", "CRT Display") +#define CODE_DCM_LiquidCrystalDisplay DSRBasicCodedEntry("109992", "DCM", "Liquid Crystal Display") +#define CODE_DCM_PlasmaDisplay DSRBasicCodedEntry("109993", "DCM", "Plasma Display") +#define CODE_DCM_OLED DSRBasicCodedEntry("109994", "DCM", "OLED") +#define CODE_DCM_DLPRearProjectionSystem DSRBasicCodedEntry("109995", "DCM", "DLP Rear Projection System") +#define CODE_DCM_DLPFrontProjectionSystem DSRBasicCodedEntry("109996", "DCM", "DLP Front Projection System") +#define CODE_DCM_CRTRearProjectionSystem DSRBasicCodedEntry("109997", "DCM", "CRT Rear Projection System") +#define CODE_DCM_CRTFrontProjectionSystem DSRBasicCodedEntry("109998", "DCM", "CRT Front Projection System") +#define CODE_DCM_OtherProjectionSystem DSRBasicCodedEntry("109999", "DCM", "Other Projection System") +#define CODE_DCM_ImageProcessing DSRBasicCodedEntry("110001", "DCM", "Image Processing") +#define CODE_DCM_QualityControl DSRBasicCodedEntry("110002", "DCM", "Quality Control") +#define CODE_DCM_ComputerAidedDiagnosis DSRBasicCodedEntry("110003", "DCM", "Computer Aided Diagnosis") +#define CODE_DCM_ComputerAidedDetection DSRBasicCodedEntry("110004", "DCM", "Computer Aided Detection") +#define CODE_DCM_Interpretation DSRBasicCodedEntry("110005", "DCM", "Interpretation") +#define CODE_DCM_Transcription_110006 DSRBasicCodedEntry("110006", "DCM", "Transcription") +#define CODE_DCM_ReportVerification DSRBasicCodedEntry("110007", "DCM", "Report Verification") +#define CODE_DCM_Print DSRBasicCodedEntry("110008", "DCM", "Print") +#define CODE_DCM_NoSubsequentWorkitems DSRBasicCodedEntry("110009", "DCM", "No subsequent Workitems") +#define CODE_DCM_Film_110010 DSRBasicCodedEntry("110010", "DCM", "Film") +#define CODE_DCM_Dictation DSRBasicCodedEntry("110011", "DCM", "Dictation") +#define CODE_DCM_Transcription_110012 DSRBasicCodedEntry("110012", "DCM", "Transcription") +#define CODE_DCM_MediaImport DSRBasicCodedEntry("110013", "DCM", "Media Import") +#define CODE_DCM_SheetFilmDigitized DSRBasicCodedEntry("110020", "DCM", "Sheet Film Digitized") +#define CODE_DCM_CineFilmDigitized DSRBasicCodedEntry("110021", "DCM", "Cine Film Digitized") +#define CODE_DCM_VideoTapeDigitized DSRBasicCodedEntry("110022", "DCM", "Video Tape Digitized") +#define CODE_DCM_PaperDigitized DSRBasicCodedEntry("110023", "DCM", "Paper Digitized") +#define CODE_DCM_CDImported DSRBasicCodedEntry("110024", "DCM", "CD Imported") +#define CODE_DCM_DVDImported DSRBasicCodedEntry("110025", "DCM", "DVD Imported") +#define CODE_DCM_MODImported DSRBasicCodedEntry("110026", "DCM", "MOD Imported") +#define CODE_DCM_StudiesImported DSRBasicCodedEntry("110027", "DCM", "Studies Imported") +#define CODE_DCM_InstancesImported DSRBasicCodedEntry("110028", "DCM", "Instances Imported") +#define CODE_DCM_USBDiskEmulation DSRBasicCodedEntry("110030", "DCM", "USB Disk Emulation") +#define CODE_DCM_Email DSRBasicCodedEntry("110031", "DCM", "Email") +#define CODE_DCM_CD DSRBasicCodedEntry("110032", "DCM", "CD") +#define CODE_DCM_DVD DSRBasicCodedEntry("110033", "DCM", "DVD") +#define CODE_DCM_CompactFlash DSRBasicCodedEntry("110034", "DCM", "Compact Flash") +#define CODE_DCM_MultiMediaCard DSRBasicCodedEntry("110035", "DCM", "Multi-media Card") +#define CODE_DCM_SecureDigitalCard DSRBasicCodedEntry("110036", "DCM", "Secure Digital Card") +#define CODE_DCM_URI DSRBasicCodedEntry("110037", "DCM", "URI") +#define CODE_DCM_PaperDocument DSRBasicCodedEntry("110038", "DCM", "Paper Document") +#define CODE_DCM_ApplicationActivity DSRBasicCodedEntry("110100", "DCM", "Application Activity") +#define CODE_DCM_AuditLogUsed DSRBasicCodedEntry("110101", "DCM", "Audit Log Used") +#define CODE_DCM_BeginTransferringDICOMInstances DSRBasicCodedEntry("110102", "DCM", "Begin Transferring DICOM Instances") +#define CODE_DCM_DICOMInstancesAccessed DSRBasicCodedEntry("110103", "DCM", "DICOM Instances Accessed") +#define CODE_DCM_DICOMInstancesTransferred DSRBasicCodedEntry("110104", "DCM", "DICOM Instances Transferred") +#define CODE_DCM_DICOMStudyDeleted DSRBasicCodedEntry("110105", "DCM", "DICOM Study Deleted") +#define CODE_DCM_Export DSRBasicCodedEntry("110106", "DCM", "Export") +#define CODE_DCM_Import DSRBasicCodedEntry("110107", "DCM", "Import") +#define CODE_DCM_NetworkEntry DSRBasicCodedEntry("110108", "DCM", "Network Entry") +#define CODE_DCM_OrderRecord DSRBasicCodedEntry("110109", "DCM", "Order Record") +#define CODE_DCM_PatientRecord DSRBasicCodedEntry("110110", "DCM", "Patient Record") +#define CODE_DCM_ProcedureRecord DSRBasicCodedEntry("110111", "DCM", "Procedure Record") +#define CODE_DCM_Query DSRBasicCodedEntry("110112", "DCM", "Query") +#define CODE_DCM_SecurityAlert DSRBasicCodedEntry("110113", "DCM", "Security Alert") +#define CODE_DCM_UserAuthentication DSRBasicCodedEntry("110114", "DCM", "User Authentication") +#define CODE_DCM_StationAETitle DSRBasicCodedEntry("110119", "DCM", "Station AE Title") +#define CODE_DCM_ApplicationStart DSRBasicCodedEntry("110120", "DCM", "Application Start") +#define CODE_DCM_ApplicationStop DSRBasicCodedEntry("110121", "DCM", "Application Stop") +#define CODE_DCM_Login DSRBasicCodedEntry("110122", "DCM", "Login") +#define CODE_DCM_Logout DSRBasicCodedEntry("110123", "DCM", "Logout") +#define CODE_DCM_Attach DSRBasicCodedEntry("110124", "DCM", "Attach") +#define CODE_DCM_Detach DSRBasicCodedEntry("110125", "DCM", "Detach") +#define CODE_DCM_NodeAuthentication DSRBasicCodedEntry("110126", "DCM", "Node Authentication") +#define CODE_DCM_EmergencyOverrideStarted DSRBasicCodedEntry("110127", "DCM", "Emergency Override Started") +#define CODE_DCM_NetworkConfiguration DSRBasicCodedEntry("110128", "DCM", "Network Configuration") +#define CODE_DCM_SecurityConfiguration DSRBasicCodedEntry("110129", "DCM", "Security Configuration") +#define CODE_DCM_HardwareConfiguration DSRBasicCodedEntry("110130", "DCM", "Hardware Configuration") +#define CODE_DCM_SoftwareConfiguration DSRBasicCodedEntry("110131", "DCM", "Software Configuration") +#define CODE_DCM_UseOfRestrictedFunction DSRBasicCodedEntry("110132", "DCM", "Use of Restricted Function") +#define CODE_DCM_AuditRecordingStopped DSRBasicCodedEntry("110133", "DCM", "Audit Recording Stopped") +#define CODE_DCM_AuditRecordingStarted DSRBasicCodedEntry("110134", "DCM", "Audit Recording Started") +#define CODE_DCM_ObjectSecurityAttributesChanged DSRBasicCodedEntry("110135", "DCM", "Object Security Attributes Changed") +#define CODE_DCM_SecurityRolesChanged DSRBasicCodedEntry("110136", "DCM", "Security Roles Changed") +#define CODE_DCM_UserSecurityAttributesChanged DSRBasicCodedEntry("110137", "DCM", "User security Attributes Changed") +#define CODE_DCM_EmergencyOverrideStopped DSRBasicCodedEntry("110138", "DCM", "Emergency Override Stopped") +#define CODE_DCM_RemoteServiceOperationStarted DSRBasicCodedEntry("110139", "DCM", "Remote Service Operation Started") +#define CODE_DCM_RemoteServiceOperationStopped DSRBasicCodedEntry("110140", "DCM", "Remote Service Operation Stopped") +#define CODE_DCM_LocalServiceOperationStarted DSRBasicCodedEntry("110141", "DCM", "Local Service Operation Started") +#define CODE_DCM_LocalServiceOperationStopped DSRBasicCodedEntry("110142", "DCM", "Local Service Operation Stopped") +#define CODE_DCM_AuthenticationDecision DSRBasicCodedEntry("110143", "DCM", "Authentication Decision") +#define CODE_DCM_AuthorizationDecision DSRBasicCodedEntry("110144", "DCM", "Authorization Decision") +#define CODE_DCM_SessionStart DSRBasicCodedEntry("110145", "DCM", "Session start") +#define CODE_DCM_SessionStop DSRBasicCodedEntry("110146", "DCM", "Session stop") +#define CODE_DCM_AccessControlDecision DSRBasicCodedEntry("110147", "DCM", "Access Control Decision") +#define CODE_DCM_Application DSRBasicCodedEntry("110150", "DCM", "Application") +#define CODE_DCM_ApplicationLauncher DSRBasicCodedEntry("110151", "DCM", "Application Launcher") +#define CODE_DCM_DestinationRoleID DSRBasicCodedEntry("110152", "DCM", "Destination Role ID") +#define CODE_DCM_SourceRoleID DSRBasicCodedEntry("110153", "DCM", "Source Role ID") +#define CODE_DCM_DestinationMedia DSRBasicCodedEntry("110154", "DCM", "Destination Media") +#define CODE_DCM_SourceMedia DSRBasicCodedEntry("110155", "DCM", "Source Media") +#define CODE_DCM_StudyInstanceUID DSRBasicCodedEntry("110180", "DCM", "Study Instance UID") +#define CODE_DCM_SOPClassUID DSRBasicCodedEntry("110181", "DCM", "SOP Class UID") +#define CODE_DCM_NodeID DSRBasicCodedEntry("110182", "DCM", "Node ID") +#define CODE_DCM_IssuerOfIdentifier DSRBasicCodedEntry("110190", "DCM", "Issuer of Identifier") +#define CODE_DCM_DoctorCanceledProcedure DSRBasicCodedEntry("110500", "DCM", "Doctor canceled procedure") +#define CODE_DCM_EquipmentFailure DSRBasicCodedEntry("110501", "DCM", "Equipment failure") +#define CODE_DCM_IncorrectProcedureOrdered DSRBasicCodedEntry("110502", "DCM", "Incorrect procedure ordered") +#define CODE_DCM_PatientAllergicToMediaContrast DSRBasicCodedEntry("110503", "DCM", "Patient allergic to media/contrast") +#define CODE_DCM_PatientDied DSRBasicCodedEntry("110504", "DCM", "Patient died") +#define CODE_DCM_PatientRefusedToContinueProcedure DSRBasicCodedEntry("110505", "DCM", "Patient refused to continue procedure") +#define CODE_DCM_PatientTakenForTreatmentOrSurgery DSRBasicCodedEntry("110506", "DCM", "Patient taken for treatment or surgery") +#define CODE_DCM_PatientDidNotArrive DSRBasicCodedEntry("110507", "DCM", "Patient did not arrive") +#define CODE_DCM_PatientPregnant DSRBasicCodedEntry("110508", "DCM", "Patient pregnant") +#define CODE_DCM_ChangeOfProcedureForCorrectCharging DSRBasicCodedEntry("110509", "DCM", "Change of procedure for correct charging") +#define CODE_DCM_DuplicateOrder DSRBasicCodedEntry("110510", "DCM", "Duplicate order") +#define CODE_DCM_NursingUnitCancel DSRBasicCodedEntry("110511", "DCM", "Nursing unit cancel") +#define CODE_DCM_IncorrectSideOrdered DSRBasicCodedEntry("110512", "DCM", "Incorrect side ordered") +#define CODE_DCM_DiscontinuedForUnspecifiedReason DSRBasicCodedEntry("110513", "DCM", "Discontinued for unspecified reason") +#define CODE_DCM_IncorrectWorklistEntrySelected DSRBasicCodedEntry("110514", "DCM", "Incorrect worklist entry selected") +#define CODE_DCM_PatientConditionPreventedContinuing DSRBasicCodedEntry("110515", "DCM", "Patient condition prevented continuing") +#define CODE_DCM_EquipmentChange DSRBasicCodedEntry("110516", "DCM", "Equipment change") +#define CODE_DCM_PatientMovement DSRBasicCodedEntry("110518", "DCM", "Patient Movement") +#define CODE_DCM_OperatorError DSRBasicCodedEntry("110519", "DCM", "Operator Error") +#define CODE_DCM_ObjectsIncorrectlyFormatted DSRBasicCodedEntry("110521", "DCM", "Objects incorrectly formatted") +#define CODE_DCM_ObjectTypesNotSupported DSRBasicCodedEntry("110522", "DCM", "Object Types not supported") +#define CODE_DCM_ObjectSetIncomplete DSRBasicCodedEntry("110523", "DCM", "Object Set incomplete") +#define CODE_DCM_MediaFailure DSRBasicCodedEntry("110524", "DCM", "Media Failure") +#define CODE_DCM_ResourcePreEmpted DSRBasicCodedEntry("110526", "DCM", "Resource pre-empted") +#define CODE_DCM_ResourceInadequate DSRBasicCodedEntry("110527", "DCM", "Resource inadequate") +#define CODE_DCM_DiscontinuedProcedureStepRescheduled DSRBasicCodedEntry("110528", "DCM", "Discontinued Procedure Step rescheduled") +#define CODE_DCM_DiscontinuedProcedureStepReschedulingRecommended DSRBasicCodedEntry("110529", "DCM", "Discontinued Procedure Step rescheduling recommended") +#define CODE_DCM_WorkitemAssignmentRejectedByAssignedResource DSRBasicCodedEntry("110530", "DCM", "Workitem assignment rejected by assigned resource") +#define CODE_DCM_InsufficientQualityForInterpretation DSRBasicCodedEntry("110531", "DCM", "Insufficient quality for interpretation") +#define CODE_DCM_InterpretationRequiresSpecialistExpertise DSRBasicCodedEntry("110532", "DCM", "Interpretation requires specialist expertise") +#define CODE_DCM_WorkitemExpired DSRBasicCodedEntry("110533", "DCM", "Workitem expired") +#define CODE_DCM_VentralDiencephalon DSRBasicCodedEntry("110700", "DCM", "Ventral Diencephalon") +#define CODE_DCM_WhiteMatterT1Hypointensity DSRBasicCodedEntry("110701", "DCM", "White Matter T1 Hypointensity") +#define CODE_DCM_WhiteMatterT2Hyperintensity DSRBasicCodedEntry("110702", "DCM", "White Matter T2 Hyperintensity") +#define CODE_DCM_SuperiorLongitudinalFasciculusI DSRBasicCodedEntry("110703", "DCM", "superior longitudinal fasciculus I") +#define CODE_DCM_SuperiorLongitudinalFasciculusII DSRBasicCodedEntry("110704", "DCM", "superior longitudinal fasciculus II") +#define CODE_DCM_SuperiorLongitudinalFasciculusIII DSRBasicCodedEntry("110705", "DCM", "superior longitudinal fasciculus III") +#define CODE_DCM_PerilesionalWhiteMatter DSRBasicCodedEntry("110706", "DCM", "Perilesional White Matter") +#define CODE_DCM_SpinTaggingPerfusionMRSignalIntensity DSRBasicCodedEntry("110800", "DCM", "Spin Tagging Perfusion MR Signal Intensity") +#define CODE_DCM_ContrastAgentAngioMRSignalIntensity DSRBasicCodedEntry("110801", "DCM", "Contrast Agent Angio MR Signal Intensity") +#define CODE_DCM_TimeOfFlightAngioMRSignalIntensity DSRBasicCodedEntry("110802", "DCM", "Time Of Flight Angio MR Signal Intensity") +#define CODE_DCM_ProtonDensityWeightedMRSignalIntensity DSRBasicCodedEntry("110803", "DCM", "Proton Density Weighted MR Signal Intensity") +#define CODE_DCM_T1WeightedMRSignalIntensity DSRBasicCodedEntry("110804", "DCM", "T1 Weighted MR Signal Intensity") +#define CODE_DCM_T2WeightedMRSignalIntensity DSRBasicCodedEntry("110805", "DCM", "T2 Weighted MR Signal Intensity") +#define CODE_DCM_T2StarWeightedMRSignalIntensity DSRBasicCodedEntry("110806", "DCM", "T2* Weighted MR Signal Intensity") +#define CODE_DCM_FieldMapMRSignalIntensity DSRBasicCodedEntry("110807", "DCM", "Field Map MR Signal Intensity") +#define CODE_DCM_FractionalAnisotropy DSRBasicCodedEntry("110808", "DCM", "Fractional Anisotropy") +#define CODE_DCM_RelativeAnisotropy DSRBasicCodedEntry("110809", "DCM", "Relative Anisotropy") +#define CODE_DCM_VolumetricDiffusionDxxComponent DSRBasicCodedEntry("110810", "DCM", "Volumetric Diffusion Dxx Component") +#define CODE_DCM_VolumetricDiffusionDxyComponent DSRBasicCodedEntry("110811", "DCM", "Volumetric Diffusion Dxy Component") +#define CODE_DCM_VolumetricDiffusionDxzComponent DSRBasicCodedEntry("110812", "DCM", "Volumetric Diffusion Dxz Component") +#define CODE_DCM_VolumetricDiffusionDyyComponent DSRBasicCodedEntry("110813", "DCM", "Volumetric Diffusion Dyy Component") +#define CODE_DCM_VolumetricDiffusionDyzComponent DSRBasicCodedEntry("110814", "DCM", "Volumetric Diffusion Dyz Component") +#define CODE_DCM_VolumetricDiffusionDzzComponent DSRBasicCodedEntry("110815", "DCM", "Volumetric Diffusion Dzz Component") +#define CODE_DCM_T1WeightedDynamicContrastEnhancedMRSignalIntensity DSRBasicCodedEntry("110816", "DCM", "T1 Weighted Dynamic Contrast Enhanced MR Signal Intensity") +#define CODE_DCM_T2WeightedDynamicContrastEnhancedMRSignalIntensity DSRBasicCodedEntry("110817", "DCM", "T2 Weighted Dynamic Contrast Enhanced MR Signal Intensity") +#define CODE_DCM_T2StarWeightedDynamicContrastEnhancedMRSignalIntensity DSRBasicCodedEntry("110818", "DCM", "T2* Weighted Dynamic Contrast Enhanced MR Signal Intensity") +#define CODE_DCM_BloodOxygenationLevel DSRBasicCodedEntry("110819", "DCM", "Blood Oxygenation Level") +#define CODE_DCM_NuclearMedicineProjectionActivity DSRBasicCodedEntry("110820", "DCM", "Nuclear Medicine Projection Activity") +#define CODE_DCM_NuclearMedicineTomographicActivity DSRBasicCodedEntry("110821", "DCM", "Nuclear Medicine Tomographic Activity") +#define CODE_DCM_SpatialDisplacementXComponent DSRBasicCodedEntry("110822", "DCM", "Spatial Displacement X Component") +#define CODE_DCM_SpatialDisplacementYComponent DSRBasicCodedEntry("110823", "DCM", "Spatial Displacement Y Component") +#define CODE_DCM_SpatialDisplacementZComponent DSRBasicCodedEntry("110824", "DCM", "Spatial Displacement Z Component") +#define CODE_DCM_HemodynamicResistance DSRBasicCodedEntry("110825", "DCM", "Hemodynamic Resistance") +#define CODE_DCM_IndexedHemodynamicResistance DSRBasicCodedEntry("110826", "DCM", "Indexed Hemodynamic Resistance") +#define CODE_DCM_TissueVelocity DSRBasicCodedEntry("110827", "DCM", "Tissue Velocity") +#define CODE_DCM_FlowVelocity DSRBasicCodedEntry("110828", "DCM", "Flow Velocity") +#define CODE_DCM_FlowVariance DSRBasicCodedEntry("110829", "DCM", "Flow Variance") +#define CODE_DCM_Elasticity DSRBasicCodedEntry("110830", "DCM", "Elasticity") +#define CODE_DCM_Perfusion DSRBasicCodedEntry("110831", "DCM", "Perfusion") +#define CODE_DCM_SpeedOfSound DSRBasicCodedEntry("110832", "DCM", "Speed of sound") +#define CODE_DCM_UltrasoundAttenuation DSRBasicCodedEntry("110833", "DCM", "Ultrasound Attenuation") +#define CODE_DCM_RGBRComponent DSRBasicCodedEntry("110834", "DCM", "RGB R Component") +#define CODE_DCM_RGBGComponent DSRBasicCodedEntry("110835", "DCM", "RGB G Component") +#define CODE_DCM_RGBBComponent DSRBasicCodedEntry("110836", "DCM", "RGB B Component") +#define CODE_DCM_YBRFULLYComponent DSRBasicCodedEntry("110837", "DCM", "YBR FULL Y Component") +#define CODE_DCM_YBRFULLCBComponent DSRBasicCodedEntry("110838", "DCM", "YBR FULL CB Component") +#define CODE_DCM_YBRFULLCRComponent DSRBasicCodedEntry("110839", "DCM", "YBR FULL CR Component") +#define CODE_DCM_YBRPARTIALYComponent DSRBasicCodedEntry("110840", "DCM", "YBR PARTIAL Y Component") +#define CODE_DCM_YBRPARTIALCBComponent DSRBasicCodedEntry("110841", "DCM", "YBR PARTIAL CB Component") +#define CODE_DCM_YBRPARTIALCRComponent DSRBasicCodedEntry("110842", "DCM", "YBR PARTIAL CR Component") +#define CODE_DCM_YBRICTYComponent DSRBasicCodedEntry("110843", "DCM", "YBR ICT Y Component") +#define CODE_DCM_YBRICTCBComponent DSRBasicCodedEntry("110844", "DCM", "YBR ICT CB Component") +#define CODE_DCM_YBRICTCRComponent DSRBasicCodedEntry("110845", "DCM", "YBR ICT CR Component") +#define CODE_DCM_YBRRCTYComponent DSRBasicCodedEntry("110846", "DCM", "YBR RCT Y Component") +#define CODE_DCM_YBRRCTCBComponent DSRBasicCodedEntry("110847", "DCM", "YBR RCT CB Component") +#define CODE_DCM_YBRRCTCRComponent DSRBasicCodedEntry("110848", "DCM", "YBR RCT CR Component") +#define CODE_DCM_Echogenicity DSRBasicCodedEntry("110849", "DCM", "Echogenicity") +#define CODE_DCM_XRayAttenuation DSRBasicCodedEntry("110850", "DCM", "X-Ray Attenuation") +#define CODE_DCM_RETIRED_XRayAttenuationCoefficient DSRBasicCodedEntry("110851", "DCM", "X-Ray Attenuation Coefficient") +#define CODE_DCM_MRSignalIntensity DSRBasicCodedEntry("110852", "DCM", "MR signal intensity") +#define CODE_DCM_BinarySegmentation DSRBasicCodedEntry("110853", "DCM", "Binary Segmentation") +#define CODE_DCM_FractionalProbabilisticSegmentation DSRBasicCodedEntry("110854", "DCM", "Fractional Probabilistic Segmentation") +#define CODE_DCM_FractionalOccupancySegmentation DSRBasicCodedEntry("110855", "DCM", "Fractional Occupancy Segmentation") +#define CODE_DCM_LinearDisplacement DSRBasicCodedEntry("110856", "DCM", "Linear Displacement") +#define CODE_DCM_PhotonEnergy DSRBasicCodedEntry("110857", "DCM", "Photon Energy") +#define CODE_DCM_Time DSRBasicCodedEntry("110858", "DCM", "Time") +#define CODE_DCM_Angle DSRBasicCodedEntry("110859", "DCM", "Angle") +#define CODE_DCM_LeftRightAxis DSRBasicCodedEntry("110860", "DCM", "Left-Right Axis") +#define CODE_DCM_HeadFootAxis DSRBasicCodedEntry("110861", "DCM", "Head-Foot Axis") +#define CODE_DCM_AnteriorPosteriorAxis DSRBasicCodedEntry("110862", "DCM", "Anterior-Posterior Axis") +#define CODE_DCM_ApexBaseAxis DSRBasicCodedEntry("110863", "DCM", "Apex-Base Axis") +#define CODE_DCM_AnteriorInferiorAxis DSRBasicCodedEntry("110864", "DCM", "Anterior-Inferior Axis") +#define CODE_DCM_SeptumWallAxis DSRBasicCodedEntry("110865", "DCM", "Septum-Wall Axis") +#define CODE_DCM_RightToLeft DSRBasicCodedEntry("110866", "DCM", "Right To Left") +#define CODE_DCM_LeftToRight DSRBasicCodedEntry("110867", "DCM", "Left To Right") +#define CODE_DCM_HeadToFoot DSRBasicCodedEntry("110868", "DCM", "Head To Foot") +#define CODE_DCM_FootToHead DSRBasicCodedEntry("110869", "DCM", "Foot To Head") +#define CODE_DCM_AnteriorToPosterior DSRBasicCodedEntry("110870", "DCM", "Anterior To Posterior") +#define CODE_DCM_PosteriorToAnterior DSRBasicCodedEntry("110871", "DCM", "Posterior To Anterior") +#define CODE_DCM_ApexToBase DSRBasicCodedEntry("110872", "DCM", "Apex To Base") +#define CODE_DCM_BaseToApex DSRBasicCodedEntry("110873", "DCM", "Base To Apex") +#define CODE_DCM_AnteriorToInferior DSRBasicCodedEntry("110874", "DCM", "Anterior To Inferior") +#define CODE_DCM_InferiorToAnterior DSRBasicCodedEntry("110875", "DCM", "Inferior To Anterior") +#define CODE_DCM_SeptumToWall DSRBasicCodedEntry("110876", "DCM", "Septum To Wall") +#define CODE_DCM_WallToSeptum DSRBasicCodedEntry("110877", "DCM", "Wall To Septum") +#define CODE_DCM_ImagePosition_Patient_X DSRBasicCodedEntry("110901", "DCM", "Image Position (Patient) X") +#define CODE_DCM_ImagePosition_Patient_Y DSRBasicCodedEntry("110902", "DCM", "Image Position (Patient) Y") +#define CODE_DCM_ImagePosition_Patient_Z DSRBasicCodedEntry("110903", "DCM", "Image Position (Patient) Z") +#define CODE_DCM_ImageOrientation_Patient_RowX DSRBasicCodedEntry("110904", "DCM", "Image Orientation (Patient) Row X") +#define CODE_DCM_ImageOrientation_Patient_RowY DSRBasicCodedEntry("110905", "DCM", "Image Orientation (Patient) Row Y") +#define CODE_DCM_ImageOrientation_Patient_RowZ DSRBasicCodedEntry("110906", "DCM", "Image Orientation (Patient) Row Z") +#define CODE_DCM_ImageOrientation_Patient_ColumnX DSRBasicCodedEntry("110907", "DCM", "Image Orientation (Patient) Column X") +#define CODE_DCM_ImageOrientation_Patient_ColumnY DSRBasicCodedEntry("110908", "DCM", "Image Orientation (Patient) Column Y") +#define CODE_DCM_ImageOrientation_Patient_ColumnZ DSRBasicCodedEntry("110909", "DCM", "Image Orientation (Patient) Column Z") +#define CODE_DCM_PixelDataRows DSRBasicCodedEntry("110910", "DCM", "Pixel Data Rows") +#define CODE_DCM_PixelDataColumns DSRBasicCodedEntry("110911", "DCM", "Pixel Data Columns") +#define CODE_DCM_AlgorithmName DSRBasicCodedEntry("111001", "DCM", "Algorithm Name") +#define CODE_DCM_AlgorithmParameters DSRBasicCodedEntry("111002", "DCM", "Algorithm Parameters") +#define CODE_DCM_AlgorithmVersion DSRBasicCodedEntry("111003", "DCM", "Algorithm Version") +#define CODE_DCM_AnalysisPerformed DSRBasicCodedEntry("111004", "DCM", "Analysis Performed") +#define CODE_DCM_AssessmentCategory DSRBasicCodedEntry("111005", "DCM", "Assessment Category") +#define CODE_DCM_RETIRED_BreastComposition DSRBasicCodedEntry("111006", "DCM", "Breast composition") +#define CODE_DCM_BreastOutlineIncludingPectoralMuscleTissue DSRBasicCodedEntry("111007", "DCM", "Breast Outline including Pectoral Muscle Tissue") +#define CODE_DCM_CalcificationDistribution DSRBasicCodedEntry("111008", "DCM", "Calcification Distribution") +#define CODE_DCM_CalcificationType DSRBasicCodedEntry("111009", "DCM", "Calcification Type") +#define CODE_DCM_Center DSRBasicCodedEntry("111010", "DCM", "Center") +#define CODE_DCM_CertaintyOfFeature DSRBasicCodedEntry("111011", "DCM", "Certainty of Feature") +#define CODE_DCM_CertaintyOfFinding DSRBasicCodedEntry("111012", "DCM", "Certainty of Finding") +#define CODE_DCM_CertaintyOfImpression DSRBasicCodedEntry("111013", "DCM", "Certainty of Impression") +#define CODE_DCM_ClockfaceOrRegion DSRBasicCodedEntry("111014", "DCM", "Clockface or region") +#define CODE_DCM_CompositeFeature DSRBasicCodedEntry("111015", "DCM", "Composite Feature") +#define CODE_DCM_CompositeType DSRBasicCodedEntry("111016", "DCM", "Composite type") +#define CODE_DCM_CADProcessingAndFindingsSummary DSRBasicCodedEntry("111017", "DCM", "CAD Processing and Findings Summary") +#define CODE_DCM_ContentDate DSRBasicCodedEntry("111018", "DCM", "Content Date") +#define CODE_DCM_ContentTime DSRBasicCodedEntry("111019", "DCM", "Content Time") +#define CODE_DCM_Depth DSRBasicCodedEntry("111020", "DCM", "Depth") +#define CODE_DCM_DescriptionOfChange DSRBasicCodedEntry("111021", "DCM", "Description of Change") +#define CODE_DCM_DetectionPerformed DSRBasicCodedEntry("111022", "DCM", "Detection Performed") +#define CODE_DCM_DifferentialDiagnosisImpression DSRBasicCodedEntry("111023", "DCM", "Differential Diagnosis/Impression") +#define CODE_DCM_FailedAnalyses DSRBasicCodedEntry("111024", "DCM", "Failed Analyses") +#define CODE_DCM_FailedDetections DSRBasicCodedEntry("111025", "DCM", "Failed Detections") +#define CODE_DCM_HorizontalPixelSpacing DSRBasicCodedEntry("111026", "DCM", "Horizontal Pixel Spacing") +#define CODE_DCM_ImageLaterality DSRBasicCodedEntry("111027", "DCM", "Image Laterality") +#define CODE_DCM_ImageLibrary DSRBasicCodedEntry("111028", "DCM", "Image Library") +#define CODE_DCM_ImageQualityRating DSRBasicCodedEntry("111029", "DCM", "Image Quality Rating") +#define CODE_DCM_ImageRegion DSRBasicCodedEntry("111030", "DCM", "Image Region") +#define CODE_DCM_ImageView DSRBasicCodedEntry("111031", "DCM", "Image View") +#define CODE_DCM_ImageViewModifier DSRBasicCodedEntry("111032", "DCM", "Image View Modifier") +#define CODE_DCM_ImpressionDescription DSRBasicCodedEntry("111033", "DCM", "Impression Description") +#define CODE_DCM_IndividualImpressionRecommendation DSRBasicCodedEntry("111034", "DCM", "Individual Impression/Recommendation") +#define CODE_DCM_LesionDensity DSRBasicCodedEntry("111035", "DCM", "Lesion Density") +#define CODE_DCM_MammographyCADReport DSRBasicCodedEntry("111036", "DCM", "Mammography CAD Report") +#define CODE_DCM_Margins DSRBasicCodedEntry("111037", "DCM", "Margins") +#define CODE_DCM_NumberOfCalcifications DSRBasicCodedEntry("111038", "DCM", "Number of calcifications") +#define CODE_DCM_ObjectType DSRBasicCodedEntry("111039", "DCM", "Object type") +#define CODE_DCM_OriginalSource DSRBasicCodedEntry("111040", "DCM", "Original Source") +#define CODE_DCM_Outline DSRBasicCodedEntry("111041", "DCM", "Outline") +#define CODE_DCM_Pathology DSRBasicCodedEntry("111042", "DCM", "Pathology") +#define CODE_DCM_PatientOrientationColumn DSRBasicCodedEntry("111043", "DCM", "Patient Orientation Column") +#define CODE_DCM_PatientOrientationRow DSRBasicCodedEntry("111044", "DCM", "Patient Orientation Row") +#define CODE_DCM_PectoralMuscleOutline DSRBasicCodedEntry("111045", "DCM", "Pectoral Muscle Outline") +#define CODE_DCM_PercentFibroglandularTissue DSRBasicCodedEntry("111046", "DCM", "Percent Fibroglandular Tissue") +#define CODE_DCM_ProbabilityOfCancer DSRBasicCodedEntry("111047", "DCM", "Probability of cancer") +#define CODE_DCM_QuadrantLocation DSRBasicCodedEntry("111048", "DCM", "Quadrant location") +#define CODE_DCM_QualitativeDifference DSRBasicCodedEntry("111049", "DCM", "Qualitative Difference") +#define CODE_DCM_QualityAssessment DSRBasicCodedEntry("111050", "DCM", "Quality Assessment") +#define CODE_DCM_QualityControlStandard DSRBasicCodedEntry("111051", "DCM", "Quality Control Standard") +#define CODE_DCM_QualityFinding DSRBasicCodedEntry("111052", "DCM", "Quality Finding") +#define CODE_DCM_RecommendedFollowUp DSRBasicCodedEntry("111053", "DCM", "Recommended Follow-up") +#define CODE_DCM_RecommendedFollowUpDate DSRBasicCodedEntry("111054", "DCM", "Recommended Follow-up Date") +#define CODE_DCM_RecommendedFollowUpInterval DSRBasicCodedEntry("111055", "DCM", "Recommended Follow-up Interval") +#define CODE_DCM_RenderingIntent DSRBasicCodedEntry("111056", "DCM", "Rendering Intent") +#define CODE_DCM_ScopeOfFeature DSRBasicCodedEntry("111057", "DCM", "Scope of Feature") +#define CODE_DCM_SelectedRegionDescription DSRBasicCodedEntry("111058", "DCM", "Selected Region Description") +#define CODE_DCM_SingleImageFinding DSRBasicCodedEntry("111059", "DCM", "Single Image Finding") +#define CODE_DCM_StudyDate DSRBasicCodedEntry("111060", "DCM", "Study Date") +#define CODE_DCM_StudyTime DSRBasicCodedEntry("111061", "DCM", "Study Time") +#define CODE_DCM_SuccessfulAnalyses DSRBasicCodedEntry("111062", "DCM", "Successful Analyses") +#define CODE_DCM_SuccessfulDetections DSRBasicCodedEntry("111063", "DCM", "Successful Detections") +#define CODE_DCM_SummaryOfDetections DSRBasicCodedEntry("111064", "DCM", "Summary of Detections") +#define CODE_DCM_SummaryOfAnalyses DSRBasicCodedEntry("111065", "DCM", "Summary of Analyses") +#define CODE_DCM_VerticalPixelSpacing DSRBasicCodedEntry("111066", "DCM", "Vertical Pixel Spacing") +#define CODE_DCM_Crosstable DSRBasicCodedEntry("111069", "DCM", "Crosstable") +#define CODE_DCM_CADOperatingPoint DSRBasicCodedEntry("111071", "DCM", "CAD Operating Point") +#define CODE_DCM_MaximumCADOperatingPoint DSRBasicCodedEntry("111072", "DCM", "Maximum CAD Operating Point") +#define CODE_DCM_CADOperatingPointDescription DSRBasicCodedEntry("111081", "DCM", "CAD Operating Point Description") +#define CODE_DCM_FalseMarkersPerImage DSRBasicCodedEntry("111086", "DCM", "False Markers per Image") +#define CODE_DCM_FalseMarkersPerCase DSRBasicCodedEntry("111087", "DCM", "False Markers per Case") +#define CODE_DCM_CaseSensitivity DSRBasicCodedEntry("111088", "DCM", "Case Sensitivity") +#define CODE_DCM_LesionSensitivity DSRBasicCodedEntry("111089", "DCM", "Lesion Sensitivity") +#define CODE_DCM_CaseSpecificity DSRBasicCodedEntry("111090", "DCM", "Case Specificity") +#define CODE_DCM_ImageSpecificity DSRBasicCodedEntry("111091", "DCM", "Image Specificity") +#define CODE_DCM_RecommendedCADOperatingPoint DSRBasicCodedEntry("111092", "DCM", "Recommended CAD Operating Point") +#define CODE_DCM_CADOperatingPointTable DSRBasicCodedEntry("111093", "DCM", "CAD Operating Point Table") +#define CODE_DCM_SelectedRegion DSRBasicCodedEntry("111099", "DCM", "Selected region") +#define CODE_DCM_BreastGeometry DSRBasicCodedEntry("111100", "DCM", "Breast geometry") +#define CODE_DCM_ImageQuality DSRBasicCodedEntry("111101", "DCM", "Image Quality") +#define CODE_DCM_NonLesion DSRBasicCodedEntry("111102", "DCM", "Non-lesion") +#define CODE_DCM_RETIRED_Density DSRBasicCodedEntry("111103", "DCM", "Density") +#define CODE_DCM_RETIRED_IndividualCalcification DSRBasicCodedEntry("111104", "DCM", "Individual Calcification") +#define CODE_DCM_RETIRED_CalcificationCluster DSRBasicCodedEntry("111105", "DCM", "Calcification Cluster") +#define CODE_DCM_CooperLigamentChanges DSRBasicCodedEntry("111111", "DCM", "Cooper's ligament changes") +#define CODE_DCM_MassInTheSkin DSRBasicCodedEntry("111112", "DCM", "Mass in the skin") +#define CODE_DCM_MassonTheSkin DSRBasicCodedEntry("111113", "DCM", "Mass on the skin") +#define CODE_DCM_PostProcedureMammogramsForMarkerPlacement DSRBasicCodedEntry("111120", "DCM", "Post Procedure Mammograms for Marker Placement") +#define CODE_DCM_FollowUpPostBiopsyAsDirectedByClinician DSRBasicCodedEntry("111121", "DCM", "Follow-up post biopsy as directed by clinician") +#define CODE_DCM_KnownBiopsyProvenMalignancy_takeAppropriateAction DSRBasicCodedEntry("111122", "DCM", "Known biopsy proven malignancy - take appropriate action") +#define CODE_DCM_MarkerPlacement DSRBasicCodedEntry("111123", "DCM", "Marker placement") +#define CODE_DCM_PersonalHistoryOfBreastCancerWithMastectomy DSRBasicCodedEntry("111124", "DCM", "Personal history of breast cancer with mastectomy") +#define CODE_DCM_KnownBiopsyProvenMalignancy DSRBasicCodedEntry("111125", "DCM", "Known biopsy proven malignancy") +#define CODE_DCM_ImageDetectedMass DSRBasicCodedEntry("111126", "DCM", "Image detected mass") +#define CODE_DCM_Targeted DSRBasicCodedEntry("111127", "DCM", "Targeted") +#define CODE_DCM_Survey DSRBasicCodedEntry("111128", "DCM", "Survey") +#define CODE_DCM_ClusteredMicrocysts DSRBasicCodedEntry("111129", "DCM", "Clustered microcysts") +#define CODE_DCM_ComplicatedCyst DSRBasicCodedEntry("111130", "DCM", "Complicated cyst") +#define CODE_DCM_AdditionalProjections DSRBasicCodedEntry("111135", "DCM", "Additional projections") +#define CODE_DCM_SpotMagnificationViews DSRBasicCodedEntry("111136", "DCM", "Spot magnification view(s)") +#define CODE_DCM_RETIRED_Ultrasound DSRBasicCodedEntry("111137", "DCM", "Ultrasound") +#define CODE_DCM_OldFilmsForComparison DSRBasicCodedEntry("111138", "DCM", "Old films for comparison") +#define CODE_DCM_RETIRED_Ductography DSRBasicCodedEntry("111139", "DCM", "Ductography") +#define CODE_DCM_NormalIntervalFollowUp DSRBasicCodedEntry("111140", "DCM", "Normal interval follow-up") +#define CODE_DCM_AnyDecisionToBiopsyShouldBeBasedonClinicalAssessment DSRBasicCodedEntry("111141", "DCM", "Any decision to biopsy should be based on clinical assessment") +#define CODE_DCM_FollowUpAtShortInterval_1to11Months DSRBasicCodedEntry("111142", "DCM", "Follow-up at short interval (1-11 months)") +#define CODE_DCM_BiopsyShouldBeConsidered DSRBasicCodedEntry("111143", "DCM", "Biopsy should be considered") +#define CODE_DCM_NeedleLocalizationAndBiopsy DSRBasicCodedEntry("111144", "DCM", "Needle localization and biopsy") +#define CODE_DCM_HistologyUsingCoreBiopsy DSRBasicCodedEntry("111145", "DCM", "Histology using core biopsy") +#define CODE_DCM_SuggestiveOfMalignancy_takeAppropriateAction DSRBasicCodedEntry("111146", "DCM", "Suggestive of malignancy - take appropriate action") +#define CODE_DCM_CytologicAnalysis DSRBasicCodedEntry("111147", "DCM", "Cytologic analysis") +#define CODE_DCM_BiopsyShouldBeStronglyConsidered DSRBasicCodedEntry("111148", "DCM", "Biopsy should be strongly considered") +#define CODE_DCM_HighlySuggestiveOfMalignancy_takeAppropriateAction DSRBasicCodedEntry("111149", "DCM", "Highly suggestive of malignancy - take appropriate action") +#define CODE_DCM_PresentationRequired_RenderingDeviceIsExpectedToPresent DSRBasicCodedEntry("111150", "DCM", "Presentation Required: Rendering device is expected to present") +#define CODE_DCM_PresentationOptional_RenderingDeviceMayPresent DSRBasicCodedEntry("111151", "DCM", "Presentation Optional: Rendering device may present") +#define CODE_DCM_NotForPresentation_RenderingDeviceExpectedNotToPresent DSRBasicCodedEntry("111152", "DCM", "Not for Presentation: Rendering device expected not to present") +#define CODE_DCM_TargetContentItemsAreRelatedTemporally DSRBasicCodedEntry("111153", "DCM", "Target content items are related temporally") +#define CODE_DCM_TargetContentItemsAreRelatedSpatially DSRBasicCodedEntry("111154", "DCM", "Target content items are related spatially") +#define CODE_DCM_TargetContentItemsAreRelatedContraLaterally DSRBasicCodedEntry("111155", "DCM", "Target content items are related contra-laterally") +#define CODE_DCM_FeatureDetectedonTheOnlyImage DSRBasicCodedEntry("111156", "DCM", "Feature detected on the only image") +#define CODE_DCM_FeatureDetectedonOnlyOneOfTheImages DSRBasicCodedEntry("111157", "DCM", "Feature detected on only one of the images") +#define CODE_DCM_FeatureDetectedonMultipleImages DSRBasicCodedEntry("111158", "DCM", "Feature detected on multiple images") +#define CODE_DCM_FeatureDetectedonImagesFromMultipleModalities DSRBasicCodedEntry("111159", "DCM", "Feature detected on images from multiple modalities") +#define CODE_DCM_RETIRED_ScarTissue DSRBasicCodedEntry("111168", "DCM", "Scar tissue") +#define CODE_DCM_RETIRED_JWire DSRBasicCodedEntry("111170", "DCM", "J Wire") +#define CODE_DCM_RETIRED_Pacemaker DSRBasicCodedEntry("111171", "DCM", "Pacemaker") +#define CODE_DCM_RETIRED_Paddle DSRBasicCodedEntry("111172", "DCM", "Paddle") +#define CODE_DCM_RETIRED_Collimator DSRBasicCodedEntry("111173", "DCM", "Collimator") +#define CODE_DCM_RETIRED_IDPlate DSRBasicCodedEntry("111174", "DCM", "ID Plate") +#define CODE_DCM_OtherMarker DSRBasicCodedEntry("111175", "DCM", "Other Marker") +#define CODE_DCM_Unspecified DSRBasicCodedEntry("111176", "DCM", "Unspecified") +#define CODE_DCM_ViewAndLateralityMarkerIsMissing DSRBasicCodedEntry("111177", "DCM", "View and Laterality Marker is missing") +#define CODE_DCM_ViewAndLateralityMarkerDoesNotHaveBothViewAndLaterality DSRBasicCodedEntry("111178", "DCM", "View and Laterality Marker does not have both view and laterality") +#define CODE_DCM_ViewAndLateralityMarkerDoesNotHaveApprovedCodes DSRBasicCodedEntry("111179", "DCM", "View and Laterality Marker does not have approved codes") +#define CODE_DCM_ViewAndLateralityMarkerIsNotNearTheAxilla DSRBasicCodedEntry("111180", "DCM", "View and Laterality Marker is not near the axilla") +#define CODE_DCM_ViewAndLateralityMarkerOverlapsBreastTissue DSRBasicCodedEntry("111181", "DCM", "View and Laterality Marker overlaps breast tissue") +#define CODE_DCM_ViewAndLateralityMarkerIsPartiallyObscured DSRBasicCodedEntry("111182", "DCM", "View and Laterality Marker is partially obscured") +#define CODE_DCM_ViewAndLateralityMarkerIsIncorrect DSRBasicCodedEntry("111183", "DCM", "View and Laterality Marker is incorrect") +#define CODE_DCM_ViewAndLateralityMarkerIsOffImage DSRBasicCodedEntry("111184", "DCM", "View and Laterality Marker is off image") +#define CODE_DCM_FlashIsNotNearEdgeOfFilm DSRBasicCodedEntry("111185", "DCM", "Flash is not near edge of film") +#define CODE_DCM_FlashIsIllegible_doesNotFit_orIsLopsided DSRBasicCodedEntry("111186", "DCM", "Flash is illegible, does not fit, or is lopsided") +#define CODE_DCM_FlashDoesntIncludePatientNameAndAdditionalPatientId DSRBasicCodedEntry("111187", "DCM", "Flash doesn't include patient name and additional patient id") +#define CODE_DCM_FlashDoesntIncludeDateOfExamination DSRBasicCodedEntry("111188", "DCM", "Flash doesn't include date of examination") +#define CODE_DCM_FlashDoesntIncludeFacilityNameAndLocation DSRBasicCodedEntry("111189", "DCM", "Flash doesn't include facility name and location") +#define CODE_DCM_FlashDoesntIncludeTechnologistIdentification DSRBasicCodedEntry("111190", "DCM", "Flash doesn't include technologist identification") +#define CODE_DCM_FlashDoesntIncludeCassetteScreenDetectorIdentification DSRBasicCodedEntry("111191", "DCM", "Flash doesn't include cassette/screen/detector identification") +#define CODE_DCM_FlashDoesntIncludeMammographyUnitIdentification DSRBasicCodedEntry("111192", "DCM", "Flash doesn't include mammography unit identification") +#define CODE_DCM_DateStickerIsMissing DSRBasicCodedEntry("111193", "DCM", "Date sticker is missing") +#define CODE_DCM_TechnicalFactorsMissing DSRBasicCodedEntry("111194", "DCM", "Technical factors missing") +#define CODE_DCM_CollimationTooCloseToBreast DSRBasicCodedEntry("111195", "DCM", "Collimation too close to breast") +#define CODE_DCM_InadequateCompression DSRBasicCodedEntry("111196", "DCM", "Inadequate compression") +#define CODE_DCM_MLOInsufficientPectoralMuscle DSRBasicCodedEntry("111197", "DCM", "MLO Insufficient pectoral muscle") +#define CODE_DCM_MLONoFatIsVisualizedPosteriorToFibroglandularTissues DSRBasicCodedEntry("111198", "DCM", "MLO No fat is visualized posterior to fibroglandular tissues") +#define CODE_DCM_MLOPoorSeparationOfDeepAndSuperficialBreastTissues DSRBasicCodedEntry("111199", "DCM", "MLO Poor separation of deep and superficial breast tissues") +#define CODE_DCM_MLOEvidenceOfMotionBlur DSRBasicCodedEntry("111200", "DCM", "MLO Evidence of motion blur") +#define CODE_DCM_MLOInframammaryFoldIsNotOpen DSRBasicCodedEntry("111201", "DCM", "MLO Inframammary fold is not open") +#define CODE_DCM_CCNotAllMedialTissueVisualized DSRBasicCodedEntry("111202", "DCM", "CC Not all medial tissue visualized") +#define CODE_DCM_CCNippleNotCenteredonImage DSRBasicCodedEntry("111203", "DCM", "CC Nipple not centered on image") +#define CODE_DCM_CCPosteriorNippleLineDoesNotMeasureWithin1cmOfMLO DSRBasicCodedEntry("111204", "DCM", "CC Posterior nipple line does not measure within 1 cm of MLO") +#define CODE_DCM_NippleNotInProfile DSRBasicCodedEntry("111205", "DCM", "Nipple not in profile") +#define CODE_DCM_InsufficientImplantDisplacementIncorrect DSRBasicCodedEntry("111206", "DCM", "Insufficient implant displacement incorrect") +#define CODE_DCM_ImageArtifacts DSRBasicCodedEntry("111207", "DCM", "Image artifact(s)") +#define CODE_DCM_GridArtifacts DSRBasicCodedEntry("111208", "DCM", "Grid artifact(s)") +#define CODE_DCM_Positioning DSRBasicCodedEntry("111209", "DCM", "Positioning") +#define CODE_DCM_MotionBlur DSRBasicCodedEntry("111210", "DCM", "Motion blur") +#define CODE_DCM_UnderExposed DSRBasicCodedEntry("111211", "DCM", "Under exposed") +#define CODE_DCM_OverExposed DSRBasicCodedEntry("111212", "DCM", "Over exposed") +#define CODE_DCM_NoImage DSRBasicCodedEntry("111213", "DCM", "No image") +#define CODE_DCM_DetectorArtifacts DSRBasicCodedEntry("111214", "DCM", "Detector artifact(s)") +#define CODE_DCM_Artifacts_otherThanGridOrDetectorArtifact DSRBasicCodedEntry("111215", "DCM", "Artifact(s) other than grid or detector artifact") +#define CODE_DCM_MechanicalFailure DSRBasicCodedEntry("111216", "DCM", "Mechanical failure") +#define CODE_DCM_ElectricalFailure DSRBasicCodedEntry("111217", "DCM", "Electrical failure") +#define CODE_DCM_SoftwareFailure DSRBasicCodedEntry("111218", "DCM", "Software failure") +#define CODE_DCM_InappropriateImageProcessing DSRBasicCodedEntry("111219", "DCM", "Inappropriate image processing") +#define CODE_DCM_OtherFailure DSRBasicCodedEntry("111220", "DCM", "Other failure") +#define CODE_DCM_UnknownFailure DSRBasicCodedEntry("111221", "DCM", "Unknown failure") +#define CODE_DCM_Succeeded DSRBasicCodedEntry("111222", "DCM", "Succeeded") +#define CODE_DCM_PartiallySucceeded DSRBasicCodedEntry("111223", "DCM", "Partially Succeeded") +#define CODE_DCM_Failed DSRBasicCodedEntry("111224", "DCM", "Failed") +#define CODE_DCM_NotAttempted DSRBasicCodedEntry("111225", "DCM", "Not Attempted") +#define CODE_DCM_IndividualImpressionRecommendationAnalysis DSRBasicCodedEntry("111233", "DCM", "Individual Impression / Recommendation Analysis") +#define CODE_DCM_OverallImpressionRecommendationAnalysis DSRBasicCodedEntry("111234", "DCM", "Overall Impression / Recommendation Analysis") +#define CODE_DCM_Unusable_QualityRendersImageUnusable DSRBasicCodedEntry("111235", "DCM", "Unusable - Quality renders image unusable") +#define CODE_DCM_Usable_DoesNotMeetTheQualityControlStandard DSRBasicCodedEntry("111236", "DCM", "Usable - Does not meet the quality control standard") +#define CODE_DCM_Usable_MeetsTheQualityControlStandard DSRBasicCodedEntry("111237", "DCM", "Usable - Meets the quality control standard") +#define CODE_DCM_MammographyQualityControlManual1999_ACR DSRBasicCodedEntry("111238", "DCM", "Mammography Quality Control Manual 1999, ACR") +#define CODE_DCM_Title21CFRSection900_SubpartB DSRBasicCodedEntry("111239", "DCM", "Title 21 CFR Section 900, Subpart B") +#define CODE_DCM_InstitutionallyDefinedQualityControlStandard DSRBasicCodedEntry("111240", "DCM", "Institutionally defined quality control standard") +#define CODE_DCM_AllAlgorithmsSucceeded_withoutFindings DSRBasicCodedEntry("111241", "DCM", "All algorithms succeeded; without findings") +#define CODE_DCM_AllAlgorithmsSucceeded_withFindings DSRBasicCodedEntry("111242", "DCM", "All algorithms succeeded; with findings") +#define CODE_DCM_NotAllAlgorithmsSucceeded_withoutFindings DSRBasicCodedEntry("111243", "DCM", "Not all algorithms succeeded; without findings") +#define CODE_DCM_NotAllAlgorithmsSucceeded_withFindings DSRBasicCodedEntry("111244", "DCM", "Not all algorithms succeeded; with findings") +#define CODE_DCM_NoAlgorithmsSucceeded_withoutFindings DSRBasicCodedEntry("111245", "DCM", "No algorithms succeeded; without findings") +#define CODE_DCM_RETIRED_Adenolipoma DSRBasicCodedEntry("111248", "DCM", "Adenolipoma") +#define CODE_DCM_RETIRED_DuctalHyperplasia DSRBasicCodedEntry("111249", "DCM", "Ductal hyperplasia") +#define CODE_DCM_RETIRED_Adenomyoepithelioma DSRBasicCodedEntry("111250", "DCM", "Adenomyoepithelioma") +#define CODE_DCM_NormalAxillaryNode DSRBasicCodedEntry("111251", "DCM", "Normal axillary node") +#define CODE_DCM_AxillaryNodeWithCalcifications DSRBasicCodedEntry("111252", "DCM", "Axillary node with calcifications") +#define CODE_DCM_AxillaryNodeHyperplasia DSRBasicCodedEntry("111253", "DCM", "Axillary node hyperplasia") +#define CODE_DCM_RETIRED_AsynchronousInvolution DSRBasicCodedEntry("111254", "DCM", "Asynchronous involution") +#define CODE_DCM_BenignCystWithBlood DSRBasicCodedEntry("111255", "DCM", "Benign cyst with blood") +#define CODE_DCM_BenignCalcifications DSRBasicCodedEntry("111256", "DCM", "Benign Calcifications") +#define CODE_DCM_RETIRED_IntracysticPapilloma DSRBasicCodedEntry("111257", "DCM", "Intracystic papilloma") +#define CODE_DCM_DuctalAdenoma DSRBasicCodedEntry("111258", "DCM", "Ductal adenoma") +#define CODE_DCM_DiabeticFibrousMastopathy DSRBasicCodedEntry("111259", "DCM", "Diabetic fibrous mastopathy") +#define CODE_DCM_RETIRED_ExtraAbdominalDesmoid DSRBasicCodedEntry("111260", "DCM", "Extra abdominal desmoid") +#define CODE_DCM_RETIRED_EpidermalInclusionCyst DSRBasicCodedEntry("111262", "DCM", "Epidermal inclusion cyst") +#define CODE_DCM_FibroadenomatoidHyperplasia DSRBasicCodedEntry("111263", "DCM", "Fibroadenomatoid hyperplasia") +#define CODE_DCM_Fibroadenolipoma DSRBasicCodedEntry("111264", "DCM", "Fibroadenolipoma") +#define CODE_DCM_RETIRED_ForeignBody_reaction DSRBasicCodedEntry("111265", "DCM", "Foreign body (reaction)") +#define CODE_DCM_RETIRED_Galactocele DSRBasicCodedEntry("111269", "DCM", "Galactocele") +#define CODE_DCM_RETIRED_Hemangioma_nonparenchymal_subcutaneous DSRBasicCodedEntry("111271", "DCM", "Hemangioma - nonparenchymal, subcutaneous") +#define CODE_DCM_RETIRED_Hyperplasia_usual DSRBasicCodedEntry("111273", "DCM", "Hyperplasia, usual") +#define CODE_DCM_JuvenilePapillomatosis DSRBasicCodedEntry("111277", "DCM", "Juvenile papillomatosis") +#define CODE_DCM_RETIRED_LactatingAdenoma DSRBasicCodedEntry("111278", "DCM", "Lactating adenoma") +#define CODE_DCM_LactationalChange DSRBasicCodedEntry("111279", "DCM", "Lactational change") +#define CODE_DCM_LargeDuctPapilloma DSRBasicCodedEntry("111281", "DCM", "Large duct papilloma") +#define CODE_DCM_RETIRED_Myofibroblastoma DSRBasicCodedEntry("111283", "DCM", "Myofibroblastoma") +#define CODE_DCM_MicroglandularAdenosis DSRBasicCodedEntry("111284", "DCM", "Microglandular adenosis") +#define CODE_DCM_MultipleIntraductalPapillomas DSRBasicCodedEntry("111285", "DCM", "Multiple Intraductal Papillomas") +#define CODE_DCM_NoAbnormality DSRBasicCodedEntry("111286", "DCM", "No abnormality") +#define CODE_DCM_NormalBreastTissue DSRBasicCodedEntry("111287", "DCM", "Normal breast tissue") +#define CODE_DCM_RETIRED_Neurofibromatosis DSRBasicCodedEntry("111288", "DCM", "Neurofibromatosis") +#define CODE_DCM_OilCyst_fatNecrosisCyst DSRBasicCodedEntry("111290", "DCM", "Oil cyst (fat necrosis cyst)") +#define CODE_DCM_PostReductionMammoplasty DSRBasicCodedEntry("111291", "DCM", "Post reduction mammoplasty") +#define CODE_DCM_PseudoangiomatousStromalHyperplasia DSRBasicCodedEntry("111292", "DCM", "Pseudoangiomatous stromal hyperplasia") +#define CODE_DCM_RETIRED_RadialScar DSRBasicCodedEntry("111293", "DCM", "Radial scar") +#define CODE_DCM_RETIRED_SclerosingAdenosis DSRBasicCodedEntry("111294", "DCM", "Sclerosing adenosis") +#define CODE_DCM_SiliconeGranuloma DSRBasicCodedEntry("111296", "DCM", "Silicone granuloma") +#define CODE_DCM_NippleCharacteristic DSRBasicCodedEntry("111297", "DCM", "Nipple Characteristic") +#define CODE_DCM_VirginalHyperplasia DSRBasicCodedEntry("111298", "DCM", "Virginal hyperplasia") +#define CODE_DCM_PeripheralDuctPapillomas DSRBasicCodedEntry("111299", "DCM", "Peripheral duct papillomas") +#define CODE_DCM_AxillaryNodeWithLymphoma DSRBasicCodedEntry("111300", "DCM", "Axillary node with lymphoma") +#define CODE_DCM_AxillaryNodalMetastases DSRBasicCodedEntry("111301", "DCM", "Axillary nodal metastases") +#define CODE_DCM_RETIRED_Angiosarcoma DSRBasicCodedEntry("111302", "DCM", "Angiosarcoma") +#define CODE_DCM_BloodVessel_vascular_invasion DSRBasicCodedEntry("111303", "DCM", "Blood vessel (vascular) invasion") +#define CODE_DCM_CarcinomaInChildren DSRBasicCodedEntry("111304", "DCM", "Carcinoma in children") +#define CODE_DCM_CarcinomaInEctopicBreast DSRBasicCodedEntry("111305", "DCM", "Carcinoma in ectopic breast") +#define CODE_DCM_CarcinomaWithEndocrineDifferentiation DSRBasicCodedEntry("111306", "DCM", "Carcinoma with endocrine differentiation") +#define CODE_DCM_BasalCellCarcinomaOfNipple DSRBasicCodedEntry("111307", "DCM", "Basal cell carcinoma of nipple") +#define CODE_DCM_RETIRED_CarcinomaWithMetaplasia DSRBasicCodedEntry("111308", "DCM", "Carcinoma with metaplasia") +#define CODE_DCM_CartilaginousAndOsseousChange DSRBasicCodedEntry("111309", "DCM", "Cartilaginous and osseous change") +#define CODE_DCM_CarcinomaInPregnancyAndLactation DSRBasicCodedEntry("111310", "DCM", "Carcinoma in pregnancy and lactation") +#define CODE_DCM_RETIRED_Carcinosarcoma DSRBasicCodedEntry("111311", "DCM", "Carcinosarcoma") +#define CODE_DCM_IntraductalComedocarcinomaWithNecrosis DSRBasicCodedEntry("111312", "DCM", "Intraductal comedocarcinoma with necrosis") +#define CODE_DCM_IntraductalCarcinoma_lowGrade DSRBasicCodedEntry("111313", "DCM", "Intraductal carcinoma, low grade") +#define CODE_DCM_RETIRED_IntraductalCarcinomaMicroPapillary DSRBasicCodedEntry("111314", "DCM", "Intraductal carcinoma micro-papillary") +#define CODE_DCM_IntracysticPapillaryCarcinoma DSRBasicCodedEntry("111315", "DCM", "Intracystic papillary carcinoma") +#define CODE_DCM_InvasiveAndInSituCarcinoma DSRBasicCodedEntry("111316", "DCM", "Invasive and in-situ carcinoma") +#define CODE_DCM_RETIRED_InvasiveLobularCarcinoma DSRBasicCodedEntry("111317", "DCM", "Invasive lobular carcinoma") +#define CODE_DCM_LeukemicInfiltration DSRBasicCodedEntry("111318", "DCM", "Leukemic infiltration") +#define CODE_DCM_LympathicVesselInvasion DSRBasicCodedEntry("111320", "DCM", "Lympathic vessel invasion") +#define CODE_DCM_RETIRED_Lymphoma DSRBasicCodedEntry("111321", "DCM", "Lymphoma") +#define CODE_DCM_OccultCarcinomaPresentingWithAxillaryLymphNodeMetastases DSRBasicCodedEntry("111322", "DCM", "Occult carcinoma presenting with axillary lymph node metastases") +#define CODE_DCM_MetastaticCancerToTheBreast DSRBasicCodedEntry("111323", "DCM", "Metastatic cancer to the breast") +#define CODE_DCM_MetastaticCancerToTheBreastFromTheColon DSRBasicCodedEntry("111324", "DCM", "Metastatic cancer to the breast from the colon") +#define CODE_DCM_MetastaticCancerToTheBreastFromTheLung DSRBasicCodedEntry("111325", "DCM", "Metastatic cancer to the breast from the lung") +#define CODE_DCM_MetastaticMelanomaToTheBreast DSRBasicCodedEntry("111326", "DCM", "Metastatic melanoma to the breast") +#define CODE_DCM_MetastaticCancerToTheBreastFromTheOvary DSRBasicCodedEntry("111327", "DCM", "Metastatic cancer to the breast from the ovary") +#define CODE_DCM_MetastaticSarcomaToTheBreast DSRBasicCodedEntry("111328", "DCM", "Metastatic sarcoma to the breast") +#define CODE_DCM_MultifocalIntraductalCarcinoma DSRBasicCodedEntry("111329", "DCM", "Multifocal intraductal carcinoma") +#define CODE_DCM_MetastaticDiseaseToAxillaryNode DSRBasicCodedEntry("111330", "DCM", "Metastatic disease to axillary node") +#define CODE_DCM_RETIRED_MalignantFibrousHistiocytoma DSRBasicCodedEntry("111331", "DCM", "Malignant fibrous histiocytoma") +#define CODE_DCM_MultifocalInvasiveDuctalCarcinoma DSRBasicCodedEntry("111332", "DCM", "Multifocal invasive ductal carcinoma") +#define CODE_DCM_MetastasisToAnIntramammaryLymphNode DSRBasicCodedEntry("111333", "DCM", "Metastasis to an intramammary lymph node") +#define CODE_DCM_MalignantMelanomaOfNipple DSRBasicCodedEntry("111334", "DCM", "Malignant melanoma of nipple") +#define CODE_DCM_RETIRED_NeoplasmOfTheMammarySkin DSRBasicCodedEntry("111335", "DCM", "Neoplasm of the mammary skin") +#define CODE_DCM_RETIRED_PapillaryCarcinomaInSitu DSRBasicCodedEntry("111336", "DCM", "Papillary carcinoma in-situ") +#define CODE_DCM_RecurrentMalignancy DSRBasicCodedEntry("111338", "DCM", "Recurrent malignancy") +#define CODE_DCM_SquamousCellCarcinomaOfTheNipple DSRBasicCodedEntry("111340", "DCM", "Squamous cell carcinoma of the nipple") +#define CODE_DCM_IntraductalCarcinoma_highGrade DSRBasicCodedEntry("111341", "DCM", "Intraductal carcinoma, high grade") +#define CODE_DCM_RETIRED_InvasiveCribriformCarcinoma DSRBasicCodedEntry("111342", "DCM", "Invasive cribriform carcinoma") +#define CODE_DCM_AngularMargins DSRBasicCodedEntry("111343", "DCM", "Angular margins") +#define CODE_DCM_FinePleomorphicCalcification DSRBasicCodedEntry("111344", "DCM", "Fine pleomorphic calcification") +#define CODE_DCM_Macrocalcifications DSRBasicCodedEntry("111345", "DCM", "Macrocalcifications") +#define CODE_DCM_CalcificationsWithinAMass DSRBasicCodedEntry("111346", "DCM", "Calcifications within a mass") +#define CODE_DCM_CalcificationsOutsideOfAMass DSRBasicCodedEntry("111347", "DCM", "Calcifications outside of a mass") +#define CODE_DCM_BreastBackgroundEchotexture DSRBasicCodedEntry("111350", "DCM", "Breast background echotexture") +#define CODE_DCM_HomogeneousFatEchotexture DSRBasicCodedEntry("111351", "DCM", "Homogeneous fat echotexture") +#define CODE_DCM_HomogeneousFibroglandularEchotexture DSRBasicCodedEntry("111352", "DCM", "Homogeneous fibroglandular echotexture") +#define CODE_DCM_HeterogeneousEchotexture DSRBasicCodedEntry("111353", "DCM", "Heterogeneous echotexture") +#define CODE_DCM_Orientation DSRBasicCodedEntry("111354", "DCM", "Orientation") +#define CODE_DCM_Parallel DSRBasicCodedEntry("111355", "DCM", "Parallel") +#define CODE_DCM_NotParallel DSRBasicCodedEntry("111356", "DCM", "Not parallel") +#define CODE_DCM_LesionBoundary DSRBasicCodedEntry("111357", "DCM", "Lesion boundary") +#define CODE_DCM_AbruptInterface DSRBasicCodedEntry("111358", "DCM", "Abrupt interface") +#define CODE_DCM_EchogenicHalo DSRBasicCodedEntry("111359", "DCM", "Echogenic halo") +#define CODE_DCM_EchoPattern DSRBasicCodedEntry("111360", "DCM", "Echo pattern") +#define CODE_DCM_Anechoic DSRBasicCodedEntry("111361", "DCM", "Anechoic") +#define CODE_DCM_Hyperechoic DSRBasicCodedEntry("111362", "DCM", "Hyperechoic") +#define CODE_DCM_Complex DSRBasicCodedEntry("111363", "DCM", "Complex") +#define CODE_DCM_Hypoechoic DSRBasicCodedEntry("111364", "DCM", "Hypoechoic") +#define CODE_DCM_Isoechoic DSRBasicCodedEntry("111365", "DCM", "Isoechoic") +#define CODE_DCM_PosteriorAcousticFeatures DSRBasicCodedEntry("111366", "DCM", "Posterior acoustic features") +#define CODE_DCM_NoPosteriorAcousticFeatures DSRBasicCodedEntry("111367", "DCM", "No posterior acoustic features") +#define CODE_DCM_PosteriorEnhancement DSRBasicCodedEntry("111368", "DCM", "Posterior enhancement") +#define CODE_DCM_PosteriorShadowing DSRBasicCodedEntry("111369", "DCM", "Posterior shadowing") +#define CODE_DCM_CombinedPosteriorEnhancementAndShadowing DSRBasicCodedEntry("111370", "DCM", "Combined posterior enhancement and shadowing") +#define CODE_DCM_IdentifiableEffectonSurroundingTissues DSRBasicCodedEntry("111371", "DCM", "Identifiable effect on surrounding tissues") +#define CODE_DCM_Vascularity DSRBasicCodedEntry("111372", "DCM", "Vascularity") +#define CODE_DCM_VascularityNotPresent DSRBasicCodedEntry("111373", "DCM", "Vascularity not present") +#define CODE_DCM_VascularityNotAssessed DSRBasicCodedEntry("111374", "DCM", "Vascularity not assessed") +#define CODE_DCM_VascularityPresentInLesion DSRBasicCodedEntry("111375", "DCM", "Vascularity present in lesion") +#define CODE_DCM_VascularityPresentImmediatelyAdjacentToLesion DSRBasicCodedEntry("111376", "DCM", "Vascularity present immediately adjacent to lesion") +#define CODE_DCM_DiffuselyIncreasedVascularityInSurroundingTissue DSRBasicCodedEntry("111377", "DCM", "Diffusely increased vascularity in surrounding tissue") +#define CODE_DCM_CorrelationToOtherFindings DSRBasicCodedEntry("111380", "DCM", "Correlation to other Findings") +#define CODE_DCM_CorrelatesToPhysicalExamFindings DSRBasicCodedEntry("111381", "DCM", "Correlates to physical exam findings") +#define CODE_DCM_CorrelatesToMammographyFindings DSRBasicCodedEntry("111382", "DCM", "Correlates to mammography findings") +#define CODE_DCM_CorrelatesToMRIFindings DSRBasicCodedEntry("111383", "DCM", "Correlates to MRI findings") +#define CODE_DCM_CorrelatesToUltrasoundFindings DSRBasicCodedEntry("111384", "DCM", "Correlates to ultrasound findings") +#define CODE_DCM_CorrelatesToOtherImagingFindings DSRBasicCodedEntry("111385", "DCM", "Correlates to other imaging findings") +#define CODE_DCM_NoCorrelationToOtherImagingFindings DSRBasicCodedEntry("111386", "DCM", "No correlation to other imaging findings") +#define CODE_DCM_NoCorrelationToClinicalFindings DSRBasicCodedEntry("111387", "DCM", "No correlation to clinical findings") +#define CODE_DCM_MalignancyType DSRBasicCodedEntry("111388", "DCM", "Malignancy Type") +#define CODE_DCM_InvasiveBreastCarcinoma DSRBasicCodedEntry("111389", "DCM", "Invasive breast carcinoma") +#define CODE_DCM_OtherMalignancyType DSRBasicCodedEntry("111390", "DCM", "Other malignancy type") +#define CODE_DCM_MenstrualCyclePhase DSRBasicCodedEntry("111391", "DCM", "Menstrual Cycle Phase") +#define CODE_DCM_1stWeek DSRBasicCodedEntry("111392", "DCM", "1st week") +#define CODE_DCM_2ndWeek DSRBasicCodedEntry("111393", "DCM", "2nd week") +#define CODE_DCM_3rdWeek DSRBasicCodedEntry("111394", "DCM", "3rd week") +#define CODE_DCM_EstimatedTimeframe DSRBasicCodedEntry("111395", "DCM", "Estimated Timeframe") +#define CODE_DCM_LessThan3MonthsAgo DSRBasicCodedEntry("111396", "DCM", "< 3 months ago") +#define CODE_DCM_4MonthsTo1YearAgo DSRBasicCodedEntry("111397", "DCM", "4 months to 1 year ago") +#define CODE_DCM_GreaterThan1YearAgo DSRBasicCodedEntry("111398", "DCM", "> 1 year ago") +#define CODE_DCM_TimeframeUncertain DSRBasicCodedEntry("111399", "DCM", "Timeframe uncertain") +#define CODE_DCM_BreastImagingReport DSRBasicCodedEntry("111400", "DCM", "Breast Imaging Report") +#define CODE_DCM_ReasonForProcedure DSRBasicCodedEntry("111401", "DCM", "Reason for procedure") +#define CODE_DCM_ClinicalFinding DSRBasicCodedEntry("111402", "DCM", "Clinical Finding") +#define CODE_DCM_BaselineScreeningMammogram DSRBasicCodedEntry("111403", "DCM", "Baseline screening mammogram") +#define CODE_DCM_FirstMammogramEver DSRBasicCodedEntry("111404", "DCM", "First mammogram ever") +#define CODE_DCM_ImplantType DSRBasicCodedEntry("111405", "DCM", "Implant type") +#define CODE_DCM_NumberOfSimilarFindings DSRBasicCodedEntry("111406", "DCM", "Number of similar findings") +#define CODE_DCM_ImplantFinding DSRBasicCodedEntry("111407", "DCM", "Implant finding") +#define CODE_DCM_FilmScreenMammography DSRBasicCodedEntry("111408", "DCM", "Film Screen Mammography") +#define CODE_DCM_DigitalMammography DSRBasicCodedEntry("111409", "DCM", "Digital Mammography") +#define CODE_DCM_SurgicalConsult DSRBasicCodedEntry("111410", "DCM", "Surgical consult") +#define CODE_DCM_MammographyCAD DSRBasicCodedEntry("111411", "DCM", "Mammography CAD") +#define CODE_DCM_NarrativeSummary DSRBasicCodedEntry("111412", "DCM", "Narrative Summary") +#define CODE_DCM_OverallAssessment DSRBasicCodedEntry("111413", "DCM", "Overall Assessment") +#define CODE_DCM_SupplementaryData DSRBasicCodedEntry("111414", "DCM", "Supplementary Data") +#define CODE_DCM_AdditionalEvaluationRequestedFromPriorStudy DSRBasicCodedEntry("111415", "DCM", "Additional evaluation requested from prior study") +#define CODE_DCM_FollowUpAtShortIntervalFromPriorStudy DSRBasicCodedEntry("111416", "DCM", "Follow-up at short interval from prior study") +#define CODE_DCM_HistoryOfBreastAugmentation_asymptomatic DSRBasicCodedEntry("111417", "DCM", "History of breast augmentation, asymptomatic") +#define CODE_DCM_ReviewOfAnOutsideStudy DSRBasicCodedEntry("111418", "DCM", "Review of an outside study") +#define CODE_DCM_AdditionalEvaluationRequestedFromAbnormalScreeningExam DSRBasicCodedEntry("111419", "DCM", "Additional evaluation requested from abnormal screening exam") +#define CODE_DCM_HistoryOfBenignBreastBiopsy DSRBasicCodedEntry("111420", "DCM", "History of benign breast biopsy") +#define CODE_DCM_PersonalHistoryOfBreastCancerWithBreastConservationTherapy DSRBasicCodedEntry("111421", "DCM", "Personal history of breast cancer with breast conservation therapy") +#define CODE_DCM_PhysicalExaminationResults DSRBasicCodedEntry("111423", "DCM", "Physical Examination Results") +#define CODE_DCM_ComparisonToPreviousFindings DSRBasicCodedEntry("111424", "DCM", "Comparison to previous findings") +#define CODE_DCM_IntraluminalFillingDefect DSRBasicCodedEntry("111425", "DCM", "Intraluminal filling defect") +#define CODE_DCM_MultipleFillingDefect DSRBasicCodedEntry("111426", "DCM", "Multiple filling defect") +#define CODE_DCM_AbruptDuctTermination DSRBasicCodedEntry("111427", "DCM", "Abrupt duct termination") +#define CODE_DCM_Extravasation DSRBasicCodedEntry("111428", "DCM", "Extravasation") +#define CODE_DCM_DuctNarrowing DSRBasicCodedEntry("111429", "DCM", "Duct narrowing") +#define CODE_DCM_CystFill DSRBasicCodedEntry("111430", "DCM", "Cyst fill") +#define CODE_DCM_InstrumentApproach DSRBasicCodedEntry("111431", "DCM", "Instrument Approach") +#define CODE_DCM_InferolateralToSuperomedial DSRBasicCodedEntry("111432", "DCM", "Inferolateral to superomedial") +#define CODE_DCM_InferomedialToSuperolateral DSRBasicCodedEntry("111433", "DCM", "Inferomedial to superolateral") +#define CODE_DCM_SuperolateralToInferomedial DSRBasicCodedEntry("111434", "DCM", "Superolateral to inferomedial") +#define CODE_DCM_SuperomedialToInferolateral DSRBasicCodedEntry("111435", "DCM", "Superomedial to inferolateral") +#define CODE_DCM_NumberOfPasses DSRBasicCodedEntry("111436", "DCM", "Number of passes") +#define CODE_DCM_NumberOfSpecimens DSRBasicCodedEntry("111437", "DCM", "Number of specimens") +#define CODE_DCM_NeedleInTarget DSRBasicCodedEntry("111438", "DCM", "Needle in target") +#define CODE_DCM_NumberOfNeedlesAroundTarget DSRBasicCodedEntry("111439", "DCM", "Number of needles around target") +#define CODE_DCM_IncisionMade DSRBasicCodedEntry("111440", "DCM", "Incision made") +#define CODE_DCM_RETIRED_MicroclipPlaced DSRBasicCodedEntry("111441", "DCM", "Microclip placed") +#define CODE_DCM_ConfirmationOfTarget DSRBasicCodedEntry("111442", "DCM", "Confirmation of target") +#define CODE_DCM_TargetCompletelyContainedInTheSpecimen DSRBasicCodedEntry("111443", "DCM", "Target completely contained in the specimen") +#define CODE_DCM_TargetPartiallyObtainedInTheSpecimen DSRBasicCodedEntry("111444", "DCM", "Target partially obtained in the specimen") +#define CODE_DCM_TargetNotInTheSpecimen DSRBasicCodedEntry("111445", "DCM", "Target not in the specimen") +#define CODE_DCM_CalcificationsSeenInTheCore DSRBasicCodedEntry("111446", "DCM", "Calcifications seen in the core") +#define CODE_DCM_LesionCompletelyRemoved DSRBasicCodedEntry("111447", "DCM", "Lesion completely removed") +#define CODE_DCM_LesionPartiallyRemoved DSRBasicCodedEntry("111448", "DCM", "Lesion partially removed") +#define CODE_DCM_FluidObtained DSRBasicCodedEntry("111449", "DCM", "Fluid obtained") +#define CODE_DCM_LightBrownColor DSRBasicCodedEntry("111450", "DCM", "Light brown color") +#define CODE_DCM_DarkRedColor DSRBasicCodedEntry("111451", "DCM", "Dark red color") +#define CODE_DCM_DarkBrownColor DSRBasicCodedEntry("111452", "DCM", "Dark brown color") +#define CODE_DCM_BrightRedColor DSRBasicCodedEntry("111453", "DCM", "Bright red color") +#define CODE_DCM_BloodTingedColor DSRBasicCodedEntry("111454", "DCM", "Blood tinged color") +#define CODE_DCM_OccultBloodTestResult DSRBasicCodedEntry("111455", "DCM", "Occult blood test result") +#define CODE_DCM_ActiononFluid DSRBasicCodedEntry("111456", "DCM", "Action on fluid") +#define CODE_DCM_SentForAnalysis DSRBasicCodedEntry("111457", "DCM", "Sent for analysis") +#define CODE_DCM_Discarded DSRBasicCodedEntry("111458", "DCM", "Discarded") +#define CODE_DCM_MassWithCalcifications DSRBasicCodedEntry("111459", "DCM", "Mass with calcifications") +#define CODE_DCM_ComplexCyst DSRBasicCodedEntry("111460", "DCM", "Complex cyst") +#define CODE_DCM_IntracysticLesion DSRBasicCodedEntry("111461", "DCM", "Intracystic lesion") +#define CODE_DCM_SolidMass DSRBasicCodedEntry("111462", "DCM", "Solid mass") +#define CODE_DCM_SupplementaryDataForIntervention DSRBasicCodedEntry("111463", "DCM", "Supplementary Data for Intervention") +#define CODE_DCM_ProcedureModifier DSRBasicCodedEntry("111464", "DCM", "Procedure Modifier") +#define CODE_DCM_NeedleGauge DSRBasicCodedEntry("111465", "DCM", "Needle Gauge") +#define CODE_DCM_SeverityOfComplication DSRBasicCodedEntry("111466", "DCM", "Severity of Complication") +#define CODE_DCM_NeedleLength DSRBasicCodedEntry("111467", "DCM", "Needle Length") +#define CODE_DCM_PathologyResults DSRBasicCodedEntry("111468", "DCM", "Pathology Results") +#define CODE_DCM_SamplingDateTime DSRBasicCodedEntry("111469", "DCM", "Sampling DateTime") +#define CODE_DCM_Uninvolved DSRBasicCodedEntry("111470", "DCM", "Uninvolved") +#define CODE_DCM_Involved DSRBasicCodedEntry("111471", "DCM", "Involved") +#define CODE_DCM_NippleInvolved DSRBasicCodedEntry("111472", "DCM", "Nipple involved") +#define CODE_DCM_NumberOfNodesRemoved DSRBasicCodedEntry("111473", "DCM", "Number of nodes removed") +#define CODE_DCM_NumberOfNodesPositive DSRBasicCodedEntry("111474", "DCM", "Number of nodes positive") +#define CODE_DCM_EstrogenReceptor DSRBasicCodedEntry("111475", "DCM", "Estrogen receptor") +#define CODE_DCM_ProgesteroneReceptor DSRBasicCodedEntry("111476", "DCM", "Progesterone receptor") +#define CODE_DCM_SPhase DSRBasicCodedEntry("111477", "DCM", "S Phase") +#define CODE_DCM_NonBloodyDischarge_fromNipple DSRBasicCodedEntry("111478", "DCM", "Non-bloody discharge (from nipple)") +#define CODE_DCM_DifficultPhysicalClinicalExamination DSRBasicCodedEntry("111479", "DCM", "Difficult physical/clinical examination") +#define CODE_DCM_CancerElsewhere DSRBasicCodedEntry("111480", "DCM", "Cancer elsewhere") +#define CODE_DCM_SalineImplant DSRBasicCodedEntry("111481", "DCM", "Saline implant") +#define CODE_DCM_PolyurethaneImplant DSRBasicCodedEntry("111482", "DCM", "Polyurethane implant") +#define CODE_DCM_PercutaneousSiliconeInjection DSRBasicCodedEntry("111483", "DCM", "Percutaneous silicone injection") +#define CODE_DCM_CombinationImplant DSRBasicCodedEntry("111484", "DCM", "Combination implant") +#define CODE_DCM_PrePectoralImplant DSRBasicCodedEntry("111485", "DCM", "Pre-pectoral implant") +#define CODE_DCM_RetroPectoralImplant DSRBasicCodedEntry("111486", "DCM", "Retro-pectoral implant") +#define CODE_DCM_Mammographic_crosshair DSRBasicCodedEntry("111487", "DCM", "Mammographic (crosshair)") +#define CODE_DCM_Mammographic_grid DSRBasicCodedEntry("111488", "DCM", "Mammographic (grid)") +#define CODE_DCM_PalpationGuided DSRBasicCodedEntry("111489", "DCM", "Palpation guided") +#define CODE_DCM_VacuumAssisted DSRBasicCodedEntry("111490", "DCM", "Vacuum assisted") +#define CODE_DCM_AbnormalDischarge DSRBasicCodedEntry("111491", "DCM", "Abnormal discharge") +#define CODE_DCM_NoComplications DSRBasicCodedEntry("111492", "DCM", "No complications") +#define CODE_DCM_Stage0 DSRBasicCodedEntry("111494", "DCM", "Stage 0") +#define CODE_DCM_StageI DSRBasicCodedEntry("111495", "DCM", "Stage I") +#define CODE_DCM_StageIIA DSRBasicCodedEntry("111496", "DCM", "Stage IIA") +#define CODE_DCM_StageIIB DSRBasicCodedEntry("111497", "DCM", "Stage IIB") +#define CODE_DCM_StageIIIA DSRBasicCodedEntry("111498", "DCM", "Stage IIIA") +#define CODE_DCM_StageIIIB DSRBasicCodedEntry("111499", "DCM", "Stage IIIB") +#define CODE_DCM_StageIIIC DSRBasicCodedEntry("111500", "DCM", "Stage IIIC") +#define CODE_DCM_StageIV DSRBasicCodedEntry("111501", "DCM", "Stage IV") +#define CODE_DCM_BloomRichardsonGrade DSRBasicCodedEntry("111502", "DCM", "Bloom-Richardson Grade") +#define CODE_DCM_NormalImplants DSRBasicCodedEntry("111503", "DCM", "Normal implants") +#define CODE_DCM_AsymmetricImplants DSRBasicCodedEntry("111504", "DCM", "Asymmetric implants") +#define CODE_DCM_CalcifiedImplant DSRBasicCodedEntry("111505", "DCM", "Calcified implant") +#define CODE_DCM_DistortedImplant DSRBasicCodedEntry("111506", "DCM", "Distorted implant") +#define CODE_DCM_SiliconeLadenLymphNodes DSRBasicCodedEntry("111507", "DCM", "Silicone-laden lymph nodes") +#define CODE_DCM_FreeSilicone DSRBasicCodedEntry("111508", "DCM", "Free silicone") +#define CODE_DCM_HerniatedImplant DSRBasicCodedEntry("111509", "DCM", "Herniated implant") +#define CODE_DCM_Explantation DSRBasicCodedEntry("111510", "DCM", "Explantation") +#define CODE_DCM_RelevantPatientInformationForBreastImaging DSRBasicCodedEntry("111511", "DCM", "Relevant Patient Information for Breast Imaging") +#define CODE_DCM_RETIRED_MedicationHistory DSRBasicCodedEntry("111512", "DCM", "Medication History") +#define CODE_DCM_RelevantPreviousProcedures DSRBasicCodedEntry("111513", "DCM", "Relevant Previous Procedures") +#define CODE_DCM_RETIRED_RelevantIndicatedProblems DSRBasicCodedEntry("111514", "DCM", "Relevant Indicated Problems") +#define CODE_DCM_RelevantRiskFactors DSRBasicCodedEntry("111515", "DCM", "Relevant Risk Factors") +#define CODE_DCM_MedicationType DSRBasicCodedEntry("111516", "DCM", "Medication Type") +#define CODE_DCM_RelevantPatientInformation DSRBasicCodedEntry("111517", "DCM", "Relevant Patient Information") +#define CODE_DCM_AgeWhenFirstMenstrualPeriodOccurred DSRBasicCodedEntry("111518", "DCM", "Age when first menstrual period occurred") +#define CODE_DCM_AgeAtFirstFullTermPregnancy DSRBasicCodedEntry("111519", "DCM", "Age at First Full Term Pregnancy") +#define CODE_DCM_AgeAtMenopause DSRBasicCodedEntry("111520", "DCM", "Age at Menopause") +#define CODE_DCM_AgeWhenHysterectomyPerformed DSRBasicCodedEntry("111521", "DCM", "Age when hysterectomy performed") +#define CODE_DCM_AgeWhenLeftOvaryRemoved DSRBasicCodedEntry("111522", "DCM", "Age when left ovary removed") +#define CODE_DCM_AgeWhenRightOvaryRemoved DSRBasicCodedEntry("111523", "DCM", "Age when right ovary removed") +#define CODE_DCM_AgeStarted DSRBasicCodedEntry("111524", "DCM", "Age Started") +#define CODE_DCM_AgeEnded DSRBasicCodedEntry("111525", "DCM", "Age Ended") +#define CODE_DCM_DateTimeStarted DSRBasicCodedEntry("111526", "DCM", "DateTime Started") +#define CODE_DCM_DateTimeEnded DSRBasicCodedEntry("111527", "DCM", "DateTime Ended") +#define CODE_DCM_Ongoing DSRBasicCodedEntry("111528", "DCM", "Ongoing") +#define CODE_DCM_BrandName DSRBasicCodedEntry("111529", "DCM", "Brand Name") +#define CODE_DCM_RiskFactorModifier DSRBasicCodedEntry("111530", "DCM", "Risk Factor modifier") +#define CODE_DCM_PreviousProcedure DSRBasicCodedEntry("111531", "DCM", "Previous Procedure") +#define CODE_DCM_RETIRED_PregnancyStatus DSRBasicCodedEntry("111532", "DCM", "Pregnancy Status") +#define CODE_DCM_IndicatedProblem DSRBasicCodedEntry("111533", "DCM", "Indicated Problem") +#define CODE_DCM_RoleOfPersonReporting DSRBasicCodedEntry("111534", "DCM", "Role of person reporting") +#define CODE_DCM_DateTimeProblemObserved DSRBasicCodedEntry("111535", "DCM", "DateTime problem observed") +#define CODE_DCM_DateTimeOfLastEvaluation DSRBasicCodedEntry("111536", "DCM", "DateTime of last evaluation") +#define CODE_DCM_FamilyMemberWithRiskFactor DSRBasicCodedEntry("111537", "DCM", "Family Member with Risk Factor") +#define CODE_DCM_AgeAtOccurrence DSRBasicCodedEntry("111538", "DCM", "Age at Occurrence") +#define CODE_DCM_MenopausalPhase DSRBasicCodedEntry("111539", "DCM", "Menopausal phase") +#define CODE_DCM_SideOfFamily DSRBasicCodedEntry("111540", "DCM", "Side of Family") +#define CODE_DCM_Maternal DSRBasicCodedEntry("111541", "DCM", "Maternal") +#define CODE_DCM_UnspecifiedGynecologicalHormone DSRBasicCodedEntry("111542", "DCM", "Unspecified gynecological hormone") +#define CODE_DCM_BreastFeedingHistory DSRBasicCodedEntry("111543", "DCM", "Breast feeding history") +#define CODE_DCM_AverageBreastFeedingPeriod DSRBasicCodedEntry("111544", "DCM", "Average breast feeding period") +#define CODE_DCM_SubstanceUseHistory DSRBasicCodedEntry("111545", "DCM", "Substance Use History") +#define CODE_DCM_UsedSubstanceType DSRBasicCodedEntry("111546", "DCM", "Used Substance Type") +#define CODE_DCM_EnvironmentalExposureHistory DSRBasicCodedEntry("111547", "DCM", "Environmental Exposure History") +#define CODE_DCM_EnvironmentalFactor DSRBasicCodedEntry("111548", "DCM", "Environmental Factor") +#define CODE_DCM_PreviousReports DSRBasicCodedEntry("111549", "DCM", "Previous Reports") +#define CODE_DCM_PersonalBreastCancerHistory DSRBasicCodedEntry("111550", "DCM", "Personal breast cancer history") +#define CODE_DCM_HistoryOfEndometrialCancer DSRBasicCodedEntry("111551", "DCM", "History of endometrial cancer") +#define CODE_DCM_HistoryOfOvarianCancer DSRBasicCodedEntry("111552", "DCM", "History of ovarian cancer") +#define CODE_DCM_HistoryOfHighRiskLesiononPreviousBiopsy DSRBasicCodedEntry("111553", "DCM", "History of high risk lesion on previous biopsy") +#define CODE_DCM_PostMenopausalPatient DSRBasicCodedEntry("111554", "DCM", "Post menopausal patient") +#define CODE_DCM_LateChildBearing_after30 DSRBasicCodedEntry("111555", "DCM", "Late child bearing (after 30)") +#define CODE_DCM_BRCA1BreastCancerGene DSRBasicCodedEntry("111556", "DCM", "BRCA1 breast cancer gene") +#define CODE_DCM_BRCA2BreastCancerGene DSRBasicCodedEntry("111557", "DCM", "BRCA2 breast cancer gene") +#define CODE_DCM_BRCA3BreastCancerGene DSRBasicCodedEntry("111558", "DCM", "BRCA3 breast cancer gene") +#define CODE_DCM_WeakFamilyHistoryOfBreastCancer DSRBasicCodedEntry("111559", "DCM", "Weak family history of breast cancer") +#define CODE_DCM_IntermediateFamilyHistoryOfBreastCancer DSRBasicCodedEntry("111560", "DCM", "Intermediate family history of breast cancer") +#define CODE_DCM_VeryStrongFamilyHistoryOfBreastCancer DSRBasicCodedEntry("111561", "DCM", "Very strong family history of breast cancer") +#define CODE_DCM_FamilyHistoryOfProstateCancer DSRBasicCodedEntry("111562", "DCM", "Family history of prostate cancer") +#define CODE_DCM_FamilyHistoryUnknown DSRBasicCodedEntry("111563", "DCM", "Family history unknown") +#define CODE_DCM_NippleDischargeCytology DSRBasicCodedEntry("111564", "DCM", "Nipple discharge cytology") +#define CODE_DCM_UterineMalformations DSRBasicCodedEntry("111565", "DCM", "Uterine malformations") +#define CODE_DCM_SpontaneousAbortion DSRBasicCodedEntry("111566", "DCM", "Spontaneous Abortion") +#define CODE_DCM_GynecologicCondition DSRBasicCodedEntry("111567", "DCM", "Gynecologic condition") +#define CODE_DCM_GynecologicSurgery DSRBasicCodedEntry("111568", "DCM", "Gynecologic surgery") +#define CODE_DCM_PreviousLBWOrIUGRBirth DSRBasicCodedEntry("111569", "DCM", "Previous LBW or IUGR birth") +#define CODE_DCM_PreviousFetalMalformationSyndrome DSRBasicCodedEntry("111570", "DCM", "Previous fetal malformation/syndrome") +#define CODE_DCM_PreviousRHNegativeOrBloodDyscrasiaAtBirth DSRBasicCodedEntry("111571", "DCM", "Previous RH negative or blood dyscrasia at birth") +#define CODE_DCM_HistoryOfMultipleFetuses DSRBasicCodedEntry("111572", "DCM", "History of multiple fetuses") +#define CODE_DCM_CurrentPregnancy_knownOrSuspectedMalformationsSyndromes DSRBasicCodedEntry("111573", "DCM", "Current pregnancy, known or suspected malformations/syndromes") +#define CODE_DCM_FamilyHistory_fetalMalformationSyndrome DSRBasicCodedEntry("111574", "DCM", "Family history, fetal malformation/syndrome") +#define CODE_DCM_High DSRBasicCodedEntry("111575", "DCM", "High") +#define CODE_DCM_Medium DSRBasicCodedEntry("111576", "DCM", "Medium") +#define CODE_DCM_Low DSRBasicCodedEntry("111577", "DCM", "Low") +#define CODE_DCM_DoseFrequency DSRBasicCodedEntry("111578", "DCM", "Dose frequency") +#define CODE_DCM_RateOfExposure DSRBasicCodedEntry("111579", "DCM", "Rate of exposure") +#define CODE_DCM_VolumeOfUse DSRBasicCodedEntry("111580", "DCM", "Volume of use") +#define CODE_DCM_RelativeDoseAmount DSRBasicCodedEntry("111581", "DCM", "Relative dose amount") +#define CODE_DCM_RelativeAmountOfExposure DSRBasicCodedEntry("111582", "DCM", "Relative amount of exposure") +#define CODE_DCM_RelativeAmountOfUse DSRBasicCodedEntry("111583", "DCM", "Relative amount of use") +#define CODE_DCM_RelativeDoseFrequency DSRBasicCodedEntry("111584", "DCM", "Relative dose frequency") +#define CODE_DCM_RelativeFrequencyOfExposure DSRBasicCodedEntry("111585", "DCM", "Relative frequency of exposure") +#define CODE_DCM_RelativeFrequencyOfUse DSRBasicCodedEntry("111586", "DCM", "Relative frequency of use") +#define CODE_DCM_NoKnownExposure DSRBasicCodedEntry("111587", "DCM", "No known exposure") +#define CODE_DCM_RecallForTechnicalReasons DSRBasicCodedEntry("111590", "DCM", "Recall for technical reasons") +#define CODE_DCM_RecallForImagingFindings DSRBasicCodedEntry("111591", "DCM", "Recall for imaging findings") +#define CODE_DCM_RecallForPatientSymptomsClinicalFindings DSRBasicCodedEntry("111592", "DCM", "Recall for patient symptoms/ clinical findings") +#define CODE_DCM_LBWOrIUGR DSRBasicCodedEntry("111593", "DCM", "LBW or IUGR") +#define CODE_DCM_RETIRED_GreenFilter DSRBasicCodedEntry("111601", "DCM", "Green filter") +#define CODE_DCM_RETIRED_RedFilter DSRBasicCodedEntry("111602", "DCM", "Red filter") +#define CODE_DCM_RETIRED_BlueFilter DSRBasicCodedEntry("111603", "DCM", "Blue filter") +#define CODE_DCM_RETIRED_YellowGreenFilter DSRBasicCodedEntry("111604", "DCM", "Yellow-green filter") +#define CODE_DCM_RETIRED_BlueGreenFilter DSRBasicCodedEntry("111605", "DCM", "Blue-green filter") +#define CODE_DCM_RETIRED_InfraredFilter DSRBasicCodedEntry("111606", "DCM", "Infrared filter") +#define CODE_DCM_RETIRED_PolarizingFilter DSRBasicCodedEntry("111607", "DCM", "Polarizing filter") +#define CODE_DCM_NoFilter DSRBasicCodedEntry("111609", "DCM", "No filter") +#define CODE_DCM_Field1ForJoslin3Field DSRBasicCodedEntry("111621", "DCM", "Field 1 for Joslin 3 field") +#define CODE_DCM_Field2ForJoslin3Field DSRBasicCodedEntry("111622", "DCM", "Field 2 for Joslin 3 field") +#define CODE_DCM_Field3ForJoslin3Field DSRBasicCodedEntry("111623", "DCM", "Field 3 for Joslin 3 field") +#define CODE_DCM_DiffuseDirectIllumination DSRBasicCodedEntry("111625", "DCM", "Diffuse direct illumination") +#define CODE_DCM_ScheimpflugCamera DSRBasicCodedEntry("111626", "DCM", "Scheimpflug Camera") +#define CODE_DCM_ScotopicLight DSRBasicCodedEntry("111627", "DCM", "Scotopic light") +#define CODE_DCM_MesopicLight DSRBasicCodedEntry("111628", "DCM", "Mesopic light") +#define CODE_DCM_PhotopicLight DSRBasicCodedEntry("111629", "DCM", "Photopic light") +#define CODE_DCM_DynamicLight DSRBasicCodedEntry("111630", "DCM", "Dynamic light") +#define CODE_DCM_AverageGlandularDose DSRBasicCodedEntry("111631", "DCM", "Average Glandular Dose") +#define CODE_DCM_AnodeTargetMaterial DSRBasicCodedEntry("111632", "DCM", "Anode Target Material") +#define CODE_DCM_CompressionThickness DSRBasicCodedEntry("111633", "DCM", "Compression Thickness") +#define CODE_DCM_HalfValueLayer DSRBasicCodedEntry("111634", "DCM", "Half Value Layer") +#define CODE_DCM_XRayGrid DSRBasicCodedEntry("111635", "DCM", "X-Ray Grid") +#define CODE_DCM_EntranceExposureAtRP DSRBasicCodedEntry("111636", "DCM", "Entrance Exposure at RP") +#define CODE_DCM_AccumulatedAverageGlandularDose DSRBasicCodedEntry("111637", "DCM", "Accumulated Average Glandular Dose") +#define CODE_DCM_PatientEquivalentThickness DSRBasicCodedEntry("111638", "DCM", "Patient Equivalent Thickness") +#define CODE_DCM_FixedGrid DSRBasicCodedEntry("111641", "DCM", "Fixed grid") +#define CODE_DCM_FocusedGrid DSRBasicCodedEntry("111642", "DCM", "Focused grid") +#define CODE_DCM_ReciprocatingGrid DSRBasicCodedEntry("111643", "DCM", "Reciprocating grid") +#define CODE_DCM_ParallelGrid DSRBasicCodedEntry("111644", "DCM", "Parallel grid") +#define CODE_DCM_CrossedGrid DSRBasicCodedEntry("111645", "DCM", "Crossed grid") +#define CODE_DCM_NoGrid DSRBasicCodedEntry("111646", "DCM", "No grid") +#define CODE_DCM_CompressionForce DSRBasicCodedEntry("111647", "DCM", "Compression Force") +#define CODE_DCM_CompressionPressure DSRBasicCodedEntry("111648", "DCM", "Compression Pressure") +#define CODE_DCM_CompressionContactArea DSRBasicCodedEntry("111649", "DCM", "Compression Contact Area") +#define CODE_DCM_SpectaclePrescriptionReport DSRBasicCodedEntry("111671", "DCM", "Spectacle Prescription Report") +#define CODE_DCM_AddNear DSRBasicCodedEntry("111672", "DCM", "Add Near") +#define CODE_DCM_AddIntermediate DSRBasicCodedEntry("111673", "DCM", "Add Intermediate") +#define CODE_DCM_AddOther DSRBasicCodedEntry("111674", "DCM", "Add Other") +#define CODE_DCM_HorizontalPrismPower DSRBasicCodedEntry("111675", "DCM", "Horizontal Prism Power") +#define CODE_DCM_HorizontalPrismBase DSRBasicCodedEntry("111676", "DCM", "Horizontal Prism Base") +#define CODE_DCM_VerticalPrismPower DSRBasicCodedEntry("111677", "DCM", "Vertical Prism Power") +#define CODE_DCM_VerticalPrismBase DSRBasicCodedEntry("111678", "DCM", "Vertical Prism Base") +#define CODE_DCM_DistancePupillaryDistance DSRBasicCodedEntry("111679", "DCM", "Distance Pupillary Distance") +#define CODE_DCM_NearPupillaryDistance DSRBasicCodedEntry("111680", "DCM", "Near Pupillary Distance") +#define CODE_DCM_SMILE DSRBasicCodedEntry("111681", "DCM", "SMILE") +#define CODE_DCM_AutorefractionVisualAcuity DSRBasicCodedEntry("111685", "DCM", "Autorefraction Visual Acuity") +#define CODE_DCM_HabitualVisualAcuity DSRBasicCodedEntry("111686", "DCM", "Habitual Visual Acuity") +#define CODE_DCM_PrescriptionVisualAcuity DSRBasicCodedEntry("111687", "DCM", "Prescription Visual Acuity") +#define CODE_DCM_RightEyeRx DSRBasicCodedEntry("111688", "DCM", "Right Eye Rx") +#define CODE_DCM_LeftEyeRx DSRBasicCodedEntry("111689", "DCM", "Left Eye Rx") +#define CODE_DCM_MacularGridThicknessAndVolumeReport DSRBasicCodedEntry("111690", "DCM", "Macular Grid Thickness and Volume Report") +#define CODE_DCM_NumberOfImagesUsedForMacularMeasurements DSRBasicCodedEntry("111691", "DCM", "Number of Images Used for Macular Measurements") +#define CODE_DCM_NumberOfSamplesUsedPerImage DSRBasicCodedEntry("111692", "DCM", "Number of Samples Used per Image") +#define CODE_DCM_AnalysisQualityRating DSRBasicCodedEntry("111693", "DCM", "Analysis Quality Rating") +#define CODE_DCM_ImageSetQualityRating DSRBasicCodedEntry("111694", "DCM", "Image Set Quality Rating") +#define CODE_DCM_InterferingTearsOrDrops DSRBasicCodedEntry("111695", "DCM", "Interfering Tears or Drops") +#define CODE_DCM_VisualFixationQualityDuringAcquisition DSRBasicCodedEntry("111696", "DCM", "Visual Fixation Quality During Acquisition") +#define CODE_DCM_VisualFixationQualityProblem DSRBasicCodedEntry("111697", "DCM", "Visual Fixation Quality Problem") +#define CODE_DCM_OphthalmicMacularGridProblem DSRBasicCodedEntry("111698", "DCM", "Ophthalmic Macular Grid Problem") +#define CODE_DCM_SpecimenContainerIdentifier DSRBasicCodedEntry("111700", "DCM", "Specimen Container Identifier") +#define CODE_DCM_ProcessingType DSRBasicCodedEntry("111701", "DCM", "Processing type") +#define CODE_DCM_DateTimeOfProcessing DSRBasicCodedEntry("111702", "DCM", "DateTime of processing") +#define CODE_DCM_ProcessingStepDescription DSRBasicCodedEntry("111703", "DCM", "Processing step description") +#define CODE_DCM_SamplingMethod DSRBasicCodedEntry("111704", "DCM", "Sampling Method") +#define CODE_DCM_ParentSpecimenIdentifier DSRBasicCodedEntry("111705", "DCM", "Parent Specimen Identifier") +#define CODE_DCM_IssuerOfParentSpecimenIdentifier DSRBasicCodedEntry("111706", "DCM", "Issuer of Parent Specimen Identifier") +#define CODE_DCM_ParentSpecimenType DSRBasicCodedEntry("111707", "DCM", "Parent specimen type") +#define CODE_DCM_PositionFrameOfReference DSRBasicCodedEntry("111708", "DCM", "Position Frame of Reference") +#define CODE_DCM_LocationOfSamplingSite DSRBasicCodedEntry("111709", "DCM", "Location of sampling site") +#define CODE_DCM_LocationOfSamplingSiteXOffset DSRBasicCodedEntry("111710", "DCM", "Location of sampling site X offset") +#define CODE_DCM_LocationOfSamplingSiteYOffset DSRBasicCodedEntry("111711", "DCM", "Location of sampling site Y offset") +#define CODE_DCM_LocationOfSamplingSiteZOffset DSRBasicCodedEntry("111712", "DCM", "Location of sampling site Z offset") +#define CODE_DCM_LocationOfSpecimen DSRBasicCodedEntry("111718", "DCM", "Location of Specimen") +#define CODE_DCM_LocationOfSpecimenXOffset DSRBasicCodedEntry("111719", "DCM", "Location of Specimen X offset") +#define CODE_DCM_LocationOfSpecimenYOffset DSRBasicCodedEntry("111720", "DCM", "Location of Specimen Y offset") +#define CODE_DCM_LocationOfSpecimenZOffset DSRBasicCodedEntry("111721", "DCM", "Location of Specimen Z offset") +#define CODE_DCM_VisualMarkingOfSpecimen DSRBasicCodedEntry("111723", "DCM", "Visual Marking of Specimen") +#define CODE_DCM_IssuerOfSpecimenIdentifier DSRBasicCodedEntry("111724", "DCM", "Issuer of Specimen Identifier") +#define CODE_DCM_DissectionWithEntireSpecimenSubmission DSRBasicCodedEntry("111726", "DCM", "Dissection with entire specimen submission") +#define CODE_DCM_DissectionWithRepresentativeSectionsSubmission DSRBasicCodedEntry("111727", "DCM", "Dissection with representative sections submission") +#define CODE_DCM_SpecimenStorage DSRBasicCodedEntry("111729", "DCM", "Specimen storage") +#define CODE_DCM_TransmissionIllumination DSRBasicCodedEntry("111741", "DCM", "Transmission illumination") +#define CODE_DCM_ReflectionIllumination DSRBasicCodedEntry("111742", "DCM", "Reflection illumination") +#define CODE_DCM_EpifluorescenceIllumination DSRBasicCodedEntry("111743", "DCM", "Epifluorescence illumination") +#define CODE_DCM_BrightfieldIllumination DSRBasicCodedEntry("111744", "DCM", "Brightfield illumination") +#define CODE_DCM_DarkfieldIllumination DSRBasicCodedEntry("111745", "DCM", "Darkfield illumination") +#define CODE_DCM_ObliqueIllumination DSRBasicCodedEntry("111746", "DCM", "Oblique illumination") +#define CODE_DCM_PhaseContrastIllumination DSRBasicCodedEntry("111747", "DCM", "Phase contrast illumination") +#define CODE_DCM_DifferentialInterferenceContrast DSRBasicCodedEntry("111748", "DCM", "Differential interference contrast") +#define CODE_DCM_TotalInternalReflectionFluorescence DSRBasicCodedEntry("111749", "DCM", "Total internal reflection fluorescence") +#define CODE_DCM_UltrasoundContact DSRBasicCodedEntry("111750", "DCM", "Ultrasound Contact") +#define CODE_DCM_UltrasoundImmersion DSRBasicCodedEntry("111751", "DCM", "Ultrasound Immersion") +#define CODE_DCM_Optical DSRBasicCodedEntry("111752", "DCM", "Optical") +#define CODE_DCM_ManualKeratometry DSRBasicCodedEntry("111753", "DCM", "Manual Keratometry") +#define CODE_DCM_AutoKeratometry DSRBasicCodedEntry("111754", "DCM", "Auto Keratometry") +#define CODE_DCM_SimulatedKeratometry DSRBasicCodedEntry("111755", "DCM", "Simulated Keratometry") +#define CODE_DCM_EquivalentKReading DSRBasicCodedEntry("111756", "DCM", "Equivalent K-reading") +#define CODE_DCM_KeratometryMeasurementsSOPInstance DSRBasicCodedEntry("111757", "DCM", "Keratometry Measurements SOP Instance") +#define CODE_DCM_TotalCorneaPowerMeasurementMethod DSRBasicCodedEntry("111758", "DCM", "Total Cornea Power Measurement Method") +#define CODE_DCM_PosteriorCorneaSurfaceMeasurementMethod DSRBasicCodedEntry("111759", "DCM", "Posterior Cornea Surface Measurement Method") +#define CODE_DCM_Haigis DSRBasicCodedEntry("111760", "DCM", "Haigis") +#define CODE_DCM_HaigisL DSRBasicCodedEntry("111761", "DCM", "Haigis-L") +#define CODE_DCM_Holladay1 DSRBasicCodedEntry("111762", "DCM", "Holladay 1") +#define CODE_DCM_Holladay2 DSRBasicCodedEntry("111763", "DCM", "Holladay 2") +#define CODE_DCM_HofferQ DSRBasicCodedEntry("111764", "DCM", "Hoffer Q") +#define CODE_DCM_Olsen DSRBasicCodedEntry("111765", "DCM", "Olsen") +#define CODE_DCM_SRKII DSRBasicCodedEntry("111766", "DCM", "SRKII") +#define CODE_DCM_SRKT DSRBasicCodedEntry("111767", "DCM", "SRK-T") +#define CODE_DCM_ACDConstant DSRBasicCodedEntry("111768", "DCM", "ACD Constant") +#define CODE_DCM_HaigisA0 DSRBasicCodedEntry("111769", "DCM", "Haigis a0") +#define CODE_DCM_HaigisA1 DSRBasicCodedEntry("111770", "DCM", "Haigis a1") +#define CODE_DCM_HaigisA2 DSRBasicCodedEntry("111771", "DCM", "Haigis a2") +#define CODE_DCM_HofferPACDConstant DSRBasicCodedEntry("111772", "DCM", "Hoffer pACD Constant") +#define CODE_DCM_SurgeonFactor DSRBasicCodedEntry("111773", "DCM", "Surgeon Factor") +#define CODE_DCM_FrontOfCorneaToFrontOfLens DSRBasicCodedEntry("111776", "DCM", "Front Of Cornea To Front Of Lens") +#define CODE_DCM_BackOfCorneaToFrontOfLens DSRBasicCodedEntry("111777", "DCM", "Back Of Cornea To Front Of Lens") +#define CODE_DCM_SingleOrAnteriorLens DSRBasicCodedEntry("111778", "DCM", "Single or Anterior Lens") +#define CODE_DCM_PosteriorLens DSRBasicCodedEntry("111779", "DCM", "Posterior Lens") +#define CODE_DCM_MeasurementFromThisDevice DSRBasicCodedEntry("111780", "DCM", "Measurement From This Device") +#define CODE_DCM_ExternalDataSource DSRBasicCodedEntry("111781", "DCM", "External Data Source") +#define CODE_DCM_AxialMeasurementsSOPInstance DSRBasicCodedEntry("111782", "DCM", "Axial Measurements SOP Instance") +#define CODE_DCM_RefractiveMeasurementsSOPInstance DSRBasicCodedEntry("111783", "DCM", "Refractive Measurements SOP Instance") +#define CODE_DCM_AutorefractionMeasurementsSOPInstance DSRBasicCodedEntry("111784", "DCM", "Autorefraction Measurements SOP Instance") +#define CODE_DCM_StandardDeviationOfMeasurementsUsed DSRBasicCodedEntry("111786", "DCM", "Standard Deviation of measurements used") +#define CODE_DCM_SignalToNoiseRatio DSRBasicCodedEntry("111787", "DCM", "Signal to Noise Ratio") +#define CODE_DCM_SphericalProjection DSRBasicCodedEntry("111791", "DCM", "Spherical projection") +#define CODE_DCM_SurfaceContourMapping DSRBasicCodedEntry("111792", "DCM", "Surface contour mapping") +#define CODE_DCM_VisualField242TestPattern DSRBasicCodedEntry("111800", "DCM", "Visual Field 24-2 Test Pattern") +#define CODE_DCM_VisualField102TestPattern DSRBasicCodedEntry("111801", "DCM", "Visual Field 10-2 Test Pattern") +#define CODE_DCM_VisualField302TestPattern DSRBasicCodedEntry("111802", "DCM", "Visual Field 30-2 Test Pattern") +#define CODE_DCM_VisualField604TestPattern DSRBasicCodedEntry("111803", "DCM", "Visual Field 60-4 Test Pattern") +#define CODE_DCM_VisualFieldMaculaTestPattern DSRBasicCodedEntry("111804", "DCM", "Visual Field Macula Test Pattern") +#define CODE_DCM_VisualFieldCentral40PointTestPattern DSRBasicCodedEntry("111805", "DCM", "Visual Field Central 40 Point Test Pattern") +#define CODE_DCM_VisualFieldCentral76PointTestPattern DSRBasicCodedEntry("111806", "DCM", "Visual Field Central 76 Point Test Pattern") +#define CODE_DCM_VisualFieldPeripheral60PointTestPattern DSRBasicCodedEntry("111807", "DCM", "Visual Field Peripheral 60 Point Test Pattern") +#define CODE_DCM_VisualFieldFullField81PointTestPattern DSRBasicCodedEntry("111808", "DCM", "Visual Field Full Field 81 Point Test Pattern") +#define CODE_DCM_VisualFieldFullField120PointTestPattern DSRBasicCodedEntry("111809", "DCM", "Visual Field Full Field 120 Point Test Pattern") +#define CODE_DCM_VisualFieldGTestPattern DSRBasicCodedEntry("111810", "DCM", "Visual Field G Test Pattern") +#define CODE_DCM_VisualFieldMTestPattern DSRBasicCodedEntry("111811", "DCM", "Visual Field M Test Pattern") +#define CODE_DCM_VisualField07TestPattern DSRBasicCodedEntry("111812", "DCM", "Visual Field 07 Test Pattern") +#define CODE_DCM_VisualFieldLVCTestPattern DSRBasicCodedEntry("111813", "DCM", "Visual Field LVC Test Pattern") +#define CODE_DCM_VisualFieldCentralTestPattern DSRBasicCodedEntry("111814", "DCM", "Visual Field Central Test Pattern") +#define CODE_DCM_VisualFieldSITAStandardTestStrategy DSRBasicCodedEntry("111815", "DCM", "Visual Field SITA-Standard Test Strategy") +#define CODE_DCM_VisualFieldSITASWAPTestStrategy DSRBasicCodedEntry("111816", "DCM", "Visual Field SITA-SWAP Test Strategy") +#define CODE_DCM_VisualFieldSITAFastTestStrategy DSRBasicCodedEntry("111817", "DCM", "Visual Field SITA-Fast Test Strategy") +#define CODE_DCM_VisualFieldFullThresholdTestStrategy DSRBasicCodedEntry("111818", "DCM", "Visual Field Full Threshold Test Strategy") +#define CODE_DCM_VisualFieldFastPacTestStrategy DSRBasicCodedEntry("111819", "DCM", "Visual Field FastPac Test Strategy") +#define CODE_DCM_VisualFieldFullFromPriorTestStrategy DSRBasicCodedEntry("111820", "DCM", "Visual Field Full From Prior Test Strategy") +#define CODE_DCM_VisualFieldOptimaTestStrategy DSRBasicCodedEntry("111821", "DCM", "Visual Field Optima Test Strategy") +#define CODE_DCM_VisualFieldTwoZoneTestStrategy DSRBasicCodedEntry("111822", "DCM", "Visual Field Two-Zone Test Strategy") +#define CODE_DCM_VisualFieldThreeZoneTestStrategy DSRBasicCodedEntry("111823", "DCM", "Visual Field Three-Zone Test Strategy") +#define CODE_DCM_VisualFieldQuantifyDefectsTestStrategy DSRBasicCodedEntry("111824", "DCM", "Visual Field Quantify-Defects Test Strategy") +#define CODE_DCM_VisualFieldTOPTestStrategy DSRBasicCodedEntry("111825", "DCM", "Visual Field TOP Test Strategy") +#define CODE_DCM_VisualFieldDynamicTestStrategy DSRBasicCodedEntry("111826", "DCM", "Visual Field Dynamic Test Strategy") +#define CODE_DCM_VisualFieldNormalTestStrategy DSRBasicCodedEntry("111827", "DCM", "Visual Field Normal Test Strategy") +#define CODE_DCM_VisualField1LTTestStrategy DSRBasicCodedEntry("111828", "DCM", "Visual Field 1-LT Test Strategy") +#define CODE_DCM_VisualField2LTTestStrategy DSRBasicCodedEntry("111829", "DCM", "Visual Field 2-LT Test Strategy") +#define CODE_DCM_VisualFieldLVSTestStrategy DSRBasicCodedEntry("111830", "DCM", "Visual Field LVS Test Strategy") +#define CODE_DCM_VisualFieldGATETestStrategy DSRBasicCodedEntry("111831", "DCM", "Visual Field GATE Test Strategy") +#define CODE_DCM_VisualFieldGATEiTestStrategy DSRBasicCodedEntry("111832", "DCM", "Visual Field GATEi Test Strategy") +#define CODE_DCM_VisualField2LTDynamicTestStrategy DSRBasicCodedEntry("111833", "DCM", "Visual Field 2LT-Dynamic Test Strategy") +#define CODE_DCM_VisualField2LTNormalTestStrategy DSRBasicCodedEntry("111834", "DCM", "Visual Field 2LT-Normal Test Strategy") +#define CODE_DCM_VisualFieldFastThresholdTestStrategy DSRBasicCodedEntry("111835", "DCM", "Visual Field Fast Threshold Test Strategy") +#define CODE_DCM_VisualFieldCLIPTestStrategy DSRBasicCodedEntry("111836", "DCM", "Visual Field CLIP Test Strategy") +#define CODE_DCM_VisualFieldCLASSStrategy DSRBasicCodedEntry("111837", "DCM", "Visual Field CLASS Strategy") +#define CODE_DCM_AgeCorrected DSRBasicCodedEntry("111838", "DCM", "Age corrected") +#define CODE_DCM_ThresholdRelated DSRBasicCodedEntry("111839", "DCM", "Threshold related") +#define CODE_DCM_SingleLuminance DSRBasicCodedEntry("111840", "DCM", "Single luminance") +#define CODE_DCM_FovealSensitivityRelated DSRBasicCodedEntry("111841", "DCM", "Foveal sensitivity related") +#define CODE_DCM_RelatedToNonMacularSensitivity DSRBasicCodedEntry("111842", "DCM", "Related to non macular sensitivity") +#define CODE_DCM_AutomatedOptical DSRBasicCodedEntry("111843", "DCM", "Automated Optical") +#define CODE_DCM_BlindSpotMonitoring DSRBasicCodedEntry("111844", "DCM", "Blind Spot Monitoring") +#define CODE_DCM_MacularFixationTesting DSRBasicCodedEntry("111845", "DCM", "Macular Fixation Testing") +#define CODE_DCM_ObservationByExaminer DSRBasicCodedEntry("111846", "DCM", "Observation by Examiner") +#define CODE_DCM_OutsideNormalLimits DSRBasicCodedEntry("111847", "DCM", "Outside normal limits") +#define CODE_DCM_Borderline DSRBasicCodedEntry("111848", "DCM", "Borderline") +#define CODE_DCM_AbnormallyHighSensitivity DSRBasicCodedEntry("111849", "DCM", "Abnormally high sensitivity") +#define CODE_DCM_GeneralReductionInSensitivity DSRBasicCodedEntry("111850", "DCM", "General reduction in sensitivity") +#define CODE_DCM_BorderlineAndGeneralReductionInSensitivity DSRBasicCodedEntry("111851", "DCM", "Borderline and general reduction in sensitivity") +#define CODE_DCM_VisualFieldIndex DSRBasicCodedEntry("111852", "DCM", "Visual Field Index") +#define CODE_DCM_VisualFieldLossDueToDiffuseDefect DSRBasicCodedEntry("111853", "DCM", "Visual Field Loss Due to Diffuse Defect") +#define CODE_DCM_VisualFieldLossDueToLocalDefect DSRBasicCodedEntry("111854", "DCM", "Visual Field Loss Due to Local Defect") +#define CODE_DCM_GlaucomaHemifieldTestAnalysis DSRBasicCodedEntry("111855", "DCM", "Glaucoma Hemifield Test Analysis") +#define CODE_DCM_OpticalFixationMeasurements DSRBasicCodedEntry("111856", "DCM", "Optical Fixation Measurements") +#define CODE_DCM_HaigisToric DSRBasicCodedEntry("111860", "DCM", "Haigis Toric") +#define CODE_DCM_HaigisLToric DSRBasicCodedEntry("111861", "DCM", "Haigis-L Toric") +#define CODE_DCM_BarrettToric DSRBasicCodedEntry("111862", "DCM", "Barrett Toric") +#define CODE_DCM_BarrettTrueK DSRBasicCodedEntry("111863", "DCM", "Barrett True-K") +#define CODE_DCM_BarrettTrueKToric DSRBasicCodedEntry("111864", "DCM", "Barrett True-K Toric") +#define CODE_DCM_BarrettUniversalII DSRBasicCodedEntry("111865", "DCM", "Barrett Universal II") +#define CODE_DCM_BarrettLensFactor DSRBasicCodedEntry("111866", "DCM", "Barrett Lens Factor") +#define CODE_DCM_BarrettDesignFactor DSRBasicCodedEntry("111867", "DCM", "Barrett Design Factor") +#define CODE_DCM_MaculaCentered DSRBasicCodedEntry("111900", "DCM", "Macula centered") +#define CODE_DCM_DiscCentered DSRBasicCodedEntry("111901", "DCM", "Disc centered") +#define CODE_DCM_LesionCentered DSRBasicCodedEntry("111902", "DCM", "Lesion centered") +#define CODE_DCM_DiscMaculaCentered DSRBasicCodedEntry("111903", "DCM", "Disc-macula centered") +#define CODE_DCM_MidPeripheralSuperior DSRBasicCodedEntry("111904", "DCM", "Mid-peripheral-superior") +#define CODE_DCM_MidPeripheralSuperiorTemporal DSRBasicCodedEntry("111905", "DCM", "Mid-peripheral-superior temporal") +#define CODE_DCM_MidPeripheralTemporal DSRBasicCodedEntry("111906", "DCM", "Mid-peripheral-temporal") +#define CODE_DCM_MidPeripheralInferiorTemporal DSRBasicCodedEntry("111907", "DCM", "Mid-peripheral-inferior temporal") +#define CODE_DCM_MidPeripheralInferior DSRBasicCodedEntry("111908", "DCM", "Mid-peripheral-inferior") +#define CODE_DCM_MidPeripheralInferiorNasal DSRBasicCodedEntry("111909", "DCM", "Mid-peripheral-inferior nasal") +#define CODE_DCM_MidPeripheralNasal DSRBasicCodedEntry("111910", "DCM", "Mid-peripheral-nasal") +#define CODE_DCM_MidPeripheralSuperiorNasal DSRBasicCodedEntry("111911", "DCM", "Mid-peripheral-superior nasal") +#define CODE_DCM_PeripheralSuperior DSRBasicCodedEntry("111912", "DCM", "Peripheral-superior") +#define CODE_DCM_PeripheralSuperiorTemporal DSRBasicCodedEntry("111913", "DCM", "Peripheral-superior temporal") +#define CODE_DCM_PeripheralTemporal DSRBasicCodedEntry("111914", "DCM", "Peripheral-temporal") +#define CODE_DCM_PeripheralInferiorTemporal DSRBasicCodedEntry("111915", "DCM", "Peripheral-inferior temporal") +#define CODE_DCM_PeripheralInferior DSRBasicCodedEntry("111916", "DCM", "Peripheral-inferior") +#define CODE_DCM_PeripheralInferiorNasal DSRBasicCodedEntry("111917", "DCM", "Peripheral-inferior nasal") +#define CODE_DCM_PeripheralNasal DSRBasicCodedEntry("111918", "DCM", "Peripheral-nasal") +#define CODE_DCM_PeripheralSuperiorNasal DSRBasicCodedEntry("111919", "DCM", "Peripheral-superior nasal") +#define CODE_DCM_TimeDomain DSRBasicCodedEntry("111920", "DCM", "Time domain") +#define CODE_DCM_SpectralDomain DSRBasicCodedEntry("111921", "DCM", "Spectral domain") +#define CODE_DCM_NoCornealCompensation DSRBasicCodedEntry("111922", "DCM", "No corneal compensation") +#define CODE_DCM_CornealBirefringenceCompensation DSRBasicCodedEntry("111923", "DCM", "Corneal birefringence compensation") +#define CODE_DCM_RetinalTopography DSRBasicCodedEntry("111924", "DCM", "Retinal topography") +#define CODE_DCM_RetinalNerveFiberLayerThickness DSRBasicCodedEntry("111925", "DCM", "Retinal nerve fiber layer thickness") +#define CODE_DCM_GanglionCellComplexThickness DSRBasicCodedEntry("111926", "DCM", "Ganglion cell complex thickness") +#define CODE_DCM_TotalRetinalThickness_ILMToISOS DSRBasicCodedEntry("111927", "DCM", "Total retinal thickness (ILM to IS-OS)") +#define CODE_DCM_TotalRetinalThickness_ILMToRPE DSRBasicCodedEntry("111928", "DCM", "Total retinal thickness (ILM to RPE)") +#define CODE_DCM_TotalRetinalThickness_ILMToBM DSRBasicCodedEntry("111929", "DCM", "Total retinal thickness (ILM to BM)") +#define CODE_DCM_AbsoluteOphthalmicThickness DSRBasicCodedEntry("111930", "DCM", "Absolute ophthalmic thickness") +#define CODE_DCM_ThicknessDeviationCategoryFromNormativeData DSRBasicCodedEntry("111931", "DCM", "Thickness deviation category from normative data") +#define CODE_DCM_ThicknessDeviationFromNormativeData DSRBasicCodedEntry("111932", "DCM", "Thickness deviation from normative data") +#define CODE_DCM_RelatedOphthalmicThicknessMap DSRBasicCodedEntry("111933", "DCM", "Related ophthalmic thickness map") +#define CODE_DCM_DiscFovea DSRBasicCodedEntry("111934", "DCM", "Disc-Fovea") +#define CODE_DCM_PGreaterThan5Percent DSRBasicCodedEntry("111935", "DCM", "p>5%") +#define CODE_DCM_PLessThan5Percent DSRBasicCodedEntry("111936", "DCM", "p<5%") +#define CODE_DCM_PLessThan2Percent DSRBasicCodedEntry("111937", "DCM", "p<2%") +#define CODE_DCM_PLessThan1Percent DSRBasicCodedEntry("111938", "DCM", "p<1%") +#define CODE_DCM_PLessThan0dot5Percent DSRBasicCodedEntry("111939", "DCM", "p<0.5%") +#define CODE_DCM_CornealAxialPowerMap DSRBasicCodedEntry("111940", "DCM", "Corneal axial power map") +#define CODE_DCM_CornealInstantaneousPowerMap DSRBasicCodedEntry("111941", "DCM", "Corneal instantaneous power map") +#define CODE_DCM_CornealRefractivePowerMap DSRBasicCodedEntry("111942", "DCM", "Corneal refractive power map") +#define CODE_DCM_CornealElevationMap DSRBasicCodedEntry("111943", "DCM", "Corneal elevation map") +#define CODE_DCM_CornealWavefrontMap DSRBasicCodedEntry("111944", "DCM", "Corneal wavefront map") +#define CODE_DCM_ElevationBasedCornealTomographer DSRBasicCodedEntry("111945", "DCM", "Elevation-based corneal tomographer") +#define CODE_DCM_ReflectionBasedCornealTopographer DSRBasicCodedEntry("111946", "DCM", "Reflection-based corneal topographer") +#define CODE_DCM_InterferometryBasedCornealTomographer DSRBasicCodedEntry("111947", "DCM", "Interferometry-based corneal tomographer") +#define CODE_DCM_ChestCADReport DSRBasicCodedEntry("112000", "DCM", "Chest CAD Report") +#define CODE_DCM_Opacity DSRBasicCodedEntry("112001", "DCM", "Opacity") +#define CODE_DCM_SeriesInstanceUID DSRBasicCodedEntry("112002", "DCM", "Series Instance UID") +#define CODE_DCM_AssociatedChestComponent DSRBasicCodedEntry("112003", "DCM", "Associated Chest Component") +#define CODE_DCM_AbnormalInterstitialPattern DSRBasicCodedEntry("112004", "DCM", "Abnormal interstitial pattern") +#define CODE_DCM_RadiographicAnatomy DSRBasicCodedEntry("112005", "DCM", "Radiographic anatomy") +#define CODE_DCM_DistributionDescriptor DSRBasicCodedEntry("112006", "DCM", "Distribution Descriptor") +#define CODE_DCM_BorderDefinition DSRBasicCodedEntry("112007", "DCM", "Border definition") +#define CODE_DCM_SiteInvolvement DSRBasicCodedEntry("112008", "DCM", "Site involvement") +#define CODE_DCM_TypeOfContent DSRBasicCodedEntry("112009", "DCM", "Type of Content") +#define CODE_DCM_TextureDescriptor DSRBasicCodedEntry("112010", "DCM", "Texture Descriptor") +#define CODE_DCM_PositionerPrimaryAngle DSRBasicCodedEntry("112011", "DCM", "Positioner Primary Angle") +#define CODE_DCM_PositionerSecondaryAngle DSRBasicCodedEntry("112012", "DCM", "Positioner Secondary Angle") +#define CODE_DCM_LocationInChest DSRBasicCodedEntry("112013", "DCM", "Location in Chest") +#define CODE_DCM_OrientationDescriptor DSRBasicCodedEntry("112014", "DCM", "Orientation Descriptor") +#define CODE_DCM_BorderShape DSRBasicCodedEntry("112015", "DCM", "Border shape") +#define CODE_DCM_BaselineCategory DSRBasicCodedEntry("112016", "DCM", "Baseline Category") +#define CODE_DCM_CavityExtentAsPercentOfVolume DSRBasicCodedEntry("112017", "DCM", "Cavity extent as percent of volume") +#define CODE_DCM_CalcificationExtentAsPercentOfSurface DSRBasicCodedEntry("112018", "DCM", "Calcification extent as percent of surface") +#define CODE_DCM_CalcificationExtentAsPercentOfVolume DSRBasicCodedEntry("112019", "DCM", "Calcification extent as percent of volume") +#define CODE_DCM_ResponseEvaluation DSRBasicCodedEntry("112020", "DCM", "Response Evaluation") +#define CODE_DCM_ResponseEvaluationMethod DSRBasicCodedEntry("112021", "DCM", "Response Evaluation Method") +#define CODE_DCM_RECIST DSRBasicCodedEntry("112022", "DCM", "RECIST") +#define CODE_DCM_CompositeFeatureModifier DSRBasicCodedEntry("112023", "DCM", "Composite Feature Modifier") +#define CODE_DCM_SingleImageFindingModifier DSRBasicCodedEntry("112024", "DCM", "Single Image Finding Modifier") +#define CODE_DCM_SizeDescriptor DSRBasicCodedEntry("112025", "DCM", "Size Descriptor") +#define CODE_DCM_WidthDescriptor DSRBasicCodedEntry("112026", "DCM", "Width Descriptor") +#define CODE_DCM_OpacityDescriptor DSRBasicCodedEntry("112027", "DCM", "Opacity Descriptor") +#define CODE_DCM_AbnormalDistributionOfAnatomicStructure DSRBasicCodedEntry("112028", "DCM", "Abnormal Distribution of Anatomic Structure") +#define CODE_DCM_WHO DSRBasicCodedEntry("112029", "DCM", "WHO") +#define CODE_DCM_CalcificationDescriptor DSRBasicCodedEntry("112030", "DCM", "Calcification Descriptor") +#define CODE_DCM_AttenuationCoefficient DSRBasicCodedEntry("112031", "DCM", "Attenuation Coefficient") +#define CODE_DCM_ThresholdAttenuationCoefficient DSRBasicCodedEntry("112032", "DCM", "Threshold Attenuation Coefficient") +#define CODE_DCM_AbnormalOpacity DSRBasicCodedEntry("112033", "DCM", "Abnormal opacity") +#define CODE_DCM_CalculationDescription DSRBasicCodedEntry("112034", "DCM", "Calculation Description") +#define CODE_DCM_PerformanceOfPediatricAndAdultChestRadiography_ACR DSRBasicCodedEntry("112035", "DCM", "Performance of Pediatric and Adult Chest Radiography, ACR") +#define CODE_DCM_ACRPositionStatement DSRBasicCodedEntry("112036", "DCM", "ACR Position Statement") +#define CODE_DCM_NonLesionModifier DSRBasicCodedEntry("112037", "DCM", "Non-lesion Modifier") +#define CODE_DCM_OsseousModifier DSRBasicCodedEntry("112038", "DCM", "Osseous Modifier") +#define CODE_DCM_TrackingIdentifier DSRBasicCodedEntry("112039", "DCM", "Tracking Identifier") +#define CODE_DCM_TrackingUniqueIdentifier DSRBasicCodedEntry("112040", "DCM", "Tracking Unique Identifier") +#define CODE_DCM_TargetLesionCompleteResponse DSRBasicCodedEntry("112041", "DCM", "Target Lesion Complete Response") +#define CODE_DCM_TargetLesionPartialResponse DSRBasicCodedEntry("112042", "DCM", "Target Lesion Partial Response") +#define CODE_DCM_TargetLesionProgressiveDisease DSRBasicCodedEntry("112043", "DCM", "Target Lesion Progressive Disease") +#define CODE_DCM_TargetLesionStableDisease DSRBasicCodedEntry("112044", "DCM", "Target Lesion Stable Disease") +#define CODE_DCM_NonTargetLesionCompleteResponse DSRBasicCodedEntry("112045", "DCM", "Non-Target Lesion Complete Response") +#define CODE_DCM_NonTargetLesionIncompleteResponseOrStableDisease DSRBasicCodedEntry("112046", "DCM", "Non-Target Lesion Incomplete Response or Stable Disease") +#define CODE_DCM_NonTargetLesionProgressiveDisease DSRBasicCodedEntry("112047", "DCM", "Non-Target Lesion Progressive Disease") +#define CODE_DCM_CurrentResponse DSRBasicCodedEntry("112048", "DCM", "Current Response") +#define CODE_DCM_BestOverallResponse DSRBasicCodedEntry("112049", "DCM", "Best Overall Response") +#define CODE_DCM_AnatomicIdentifier DSRBasicCodedEntry("112050", "DCM", "Anatomic Identifier") +#define CODE_DCM_MeasurementOfResponse DSRBasicCodedEntry("112051", "DCM", "Measurement of Response") +#define CODE_DCM_Bronchovascular DSRBasicCodedEntry("112052", "DCM", "Bronchovascular") +#define CODE_DCM_Osseous DSRBasicCodedEntry("112053", "DCM", "Osseous") +#define CODE_DCM_SecondaryPulmonaryLobule DSRBasicCodedEntry("112054", "DCM", "Secondary pulmonary lobule") +#define CODE_DCM_AgatstonScoringMethod DSRBasicCodedEntry("112055", "DCM", "Agatston scoring method") +#define CODE_DCM_VolumeScoringMethod DSRBasicCodedEntry("112056", "DCM", "Volume scoring method") +#define CODE_DCM_MassScoringMethod DSRBasicCodedEntry("112057", "DCM", "Mass scoring method") +#define CODE_DCM_CalciumScore DSRBasicCodedEntry("112058", "DCM", "Calcium score") +#define CODE_DCM_PrimaryComplex DSRBasicCodedEntry("112059", "DCM", "Primary complex") +#define CODE_DCM_Oligemia DSRBasicCodedEntry("112060", "DCM", "Oligemia") +#define CODE_DCM_AbnormalLines_1D DSRBasicCodedEntry("112061", "DCM", "Abnormal lines (1D)") +#define CODE_DCM_AbnormalLucency DSRBasicCodedEntry("112062", "DCM", "Abnormal lucency") +#define CODE_DCM_AbnormalCalcifications DSRBasicCodedEntry("112063", "DCM", "Abnormal calcifications") +#define CODE_DCM_AbnormalTexture DSRBasicCodedEntry("112064", "DCM", "Abnormal texture") +#define CODE_DCM_ReticulonodularPattern DSRBasicCodedEntry("112065", "DCM", "Reticulonodular pattern") +#define CODE_DCM_BeadedSeptumSign DSRBasicCodedEntry("112066", "DCM", "Beaded septum sign") +#define CODE_DCM_NodularPattern DSRBasicCodedEntry("112067", "DCM", "Nodular pattern") +#define CODE_DCM_Pseudoplaque DSRBasicCodedEntry("112068", "DCM", "Pseudoplaque") +#define CODE_DCM_SignetRingSign DSRBasicCodedEntry("112069", "DCM", "Signet-ring sign") +#define CODE_DCM_AirBronchiologram DSRBasicCodedEntry("112070", "DCM", "Air bronchiologram") +#define CODE_DCM_AirBronchogram DSRBasicCodedEntry("112071", "DCM", "Air bronchogram") +#define CODE_DCM_AirCrescent DSRBasicCodedEntry("112072", "DCM", "Air crescent") +#define CODE_DCM_HaloSign DSRBasicCodedEntry("112073", "DCM", "Halo sign") +#define CODE_DCM_TargetLesionAtBaseline DSRBasicCodedEntry("112074", "DCM", "Target Lesion at Baseline") +#define CODE_DCM_NonTargetLesionAtBaseline DSRBasicCodedEntry("112075", "DCM", "Non-Target Lesion at Baseline") +#define CODE_DCM_NonLesionAtBaseline DSRBasicCodedEntry("112076", "DCM", "Non-Lesion at Baseline") +#define CODE_DCM_Vasoconstriction DSRBasicCodedEntry("112077", "DCM", "Vasoconstriction") +#define CODE_DCM_Vasodilation DSRBasicCodedEntry("112078", "DCM", "Vasodilation") +#define CODE_DCM_ArchitecturalDistortion DSRBasicCodedEntry("112079", "DCM", "Architectural distortion") +#define CODE_DCM_MosaicPerfusion DSRBasicCodedEntry("112080", "DCM", "Mosaic perfusion") +#define CODE_DCM_Pleonemia DSRBasicCodedEntry("112081", "DCM", "Pleonemia") +#define CODE_DCM_Interface DSRBasicCodedEntry("112082", "DCM", "Interface") +#define CODE_DCM_Line DSRBasicCodedEntry("112083", "DCM", "Line") +#define CODE_DCM_Lucency DSRBasicCodedEntry("112084", "DCM", "Lucency") +#define CODE_DCM_MidlungWindow DSRBasicCodedEntry("112085", "DCM", "Midlung window") +#define CODE_DCM_CarinaAngle DSRBasicCodedEntry("112086", "DCM", "Carina angle") +#define CODE_DCM_CentrilobularStructures DSRBasicCodedEntry("112087", "DCM", "Centrilobular structures") +#define CODE_DCM_AnteriorJunctionLine DSRBasicCodedEntry("112088", "DCM", "Anterior junction line") +#define CODE_DCM_PosteriorJunctionLine DSRBasicCodedEntry("112089", "DCM", "Posterior junction line") +#define CODE_DCM_AzygoesophagealRecessInterface DSRBasicCodedEntry("112090", "DCM", "Azygoesophageal recess interface") +#define CODE_DCM_ParaspinalLine DSRBasicCodedEntry("112091", "DCM", "Paraspinal line") +#define CODE_DCM_PosteriorTrachealStripe DSRBasicCodedEntry("112092", "DCM", "Posterior tracheal stripe") +#define CODE_DCM_RightTrachealStripe DSRBasicCodedEntry("112093", "DCM", "Right tracheal stripe") +#define CODE_DCM_Stripe DSRBasicCodedEntry("112094", "DCM", "Stripe") +#define CODE_DCM_Hiatus DSRBasicCodedEntry("112095", "DCM", "Hiatus") +#define CODE_DCM_RibScaleneTubercle DSRBasicCodedEntry("112096", "DCM", "Rib Scalene Tubercle") +#define CODE_DCM_VertebralIntervertebralNotch DSRBasicCodedEntry("112097", "DCM", "Vertebral Intervertebral Notch") +#define CODE_DCM_SubscapularFossa DSRBasicCodedEntry("112098", "DCM", "Subscapular Fossa") +#define CODE_DCM_ScapularSpine DSRBasicCodedEntry("112099", "DCM", "Scapular Spine") +#define CODE_DCM_ScapularSupraspinatusFossa DSRBasicCodedEntry("112100", "DCM", "Scapular Supraspinatus Fossa") +#define CODE_DCM_ScapularInfraspinatusFossa DSRBasicCodedEntry("112101", "DCM", "Scapular Infraspinatus Fossa") +#define CODE_DCM_AorticKnob DSRBasicCodedEntry("112102", "DCM", "Aortic knob") +#define CODE_DCM_ArchOfTheAzygosVein DSRBasicCodedEntry("112103", "DCM", "Arch of the Azygos vein") +#define CODE_DCM_AirFluidLevel DSRBasicCodedEntry("112104", "DCM", "Air-fluid level") +#define CODE_DCM_CoronaRadiata DSRBasicCodedEntry("112105", "DCM", "Corona radiata") +#define CODE_DCM_HoneycombPattern DSRBasicCodedEntry("112106", "DCM", "Honeycomb pattern") +#define CODE_DCM_FleischnerLines DSRBasicCodedEntry("112107", "DCM", "Fleischner's line(s)") +#define CODE_DCM_IntralobularLines DSRBasicCodedEntry("112108", "DCM", "Intralobular lines") +#define CODE_DCM_KerleyALine DSRBasicCodedEntry("112109", "DCM", "Kerley A line") +#define CODE_DCM_KerleyBLine DSRBasicCodedEntry("112110", "DCM", "Kerley B line") +#define CODE_DCM_KerleyCLines DSRBasicCodedEntry("112111", "DCM", "Kerley C lines") +#define CODE_DCM_ParenchymalBand DSRBasicCodedEntry("112112", "DCM", "Parenchymal band") +#define CODE_DCM_ReticularPattern DSRBasicCodedEntry("112113", "DCM", "Reticular pattern") +#define CODE_DCM_SeptalLines DSRBasicCodedEntry("112114", "DCM", "Septal line(s)") +#define CODE_DCM_SubpleuralLine DSRBasicCodedEntry("112115", "DCM", "Subpleural line") +#define CODE_DCM_TramlineShadow DSRBasicCodedEntry("112116", "DCM", "Tramline shadow") +#define CODE_DCM_TubularShadow DSRBasicCodedEntry("112117", "DCM", "Tubular shadow") +#define CODE_DCM_Density DSRBasicCodedEntry("112118", "DCM", "Density") +#define CODE_DCM_DependentOpacity DSRBasicCodedEntry("112119", "DCM", "Dependent opacity") +#define CODE_DCM_GroundGlassOpacity DSRBasicCodedEntry("112120", "DCM", "Ground glass opacity") +#define CODE_DCM_Infiltrate DSRBasicCodedEntry("112121", "DCM", "Infiltrate") +#define CODE_DCM_Micronodule DSRBasicCodedEntry("112122", "DCM", "Micronodule") +#define CODE_DCM_PhantomTumor_pseudotumor DSRBasicCodedEntry("112123", "DCM", "Phantom tumor (pseudotumor)") +#define CODE_DCM_Shadow DSRBasicCodedEntry("112124", "DCM", "Shadow") +#define CODE_DCM_SmallIrregularOpacities DSRBasicCodedEntry("112125", "DCM", "Small irregular opacities") +#define CODE_DCM_SmallRoundedOpacities DSRBasicCodedEntry("112126", "DCM", "Small rounded opacities") +#define CODE_DCM_TreeInBudSign DSRBasicCodedEntry("112127", "DCM", "Tree-in-bud sign") +#define CODE_DCM_GranularPattern DSRBasicCodedEntry("112128", "DCM", "Granular pattern") +#define CODE_DCM_MiliaryPattern DSRBasicCodedEntry("112129", "DCM", "Miliary pattern") +#define CODE_DCM_MosaicPattern DSRBasicCodedEntry("112130", "DCM", "Mosaic pattern") +#define CODE_DCM_ExtremelySmall DSRBasicCodedEntry("112131", "DCM", "Extremely small") +#define CODE_DCM_VerySmall DSRBasicCodedEntry("112132", "DCM", "Very small") +#define CODE_DCM_TooSmall DSRBasicCodedEntry("112133", "DCM", "Too small") +#define CODE_DCM_Elliptic DSRBasicCodedEntry("112134", "DCM", "Elliptic") +#define CODE_DCM_Lobulated DSRBasicCodedEntry("112135", "DCM", "Lobulated") +#define CODE_DCM_Spiculated DSRBasicCodedEntry("112136", "DCM", "Spiculated") +#define CODE_DCM_SharplyDefined DSRBasicCodedEntry("112137", "DCM", "Sharply defined") +#define CODE_DCM_DistinctlyDefined DSRBasicCodedEntry("112138", "DCM", "Distinctly defined") +#define CODE_DCM_WellDemarcated DSRBasicCodedEntry("112139", "DCM", "Well demarcated") +#define CODE_DCM_SharplyDemarcated DSRBasicCodedEntry("112140", "DCM", "Sharply demarcated") +#define CODE_DCM_PoorlyDemarcated DSRBasicCodedEntry("112141", "DCM", "Poorly demarcated") +#define CODE_DCM_RETIRED_Circumscribed DSRBasicCodedEntry("112142", "DCM", "Circumscribed") +#define CODE_DCM_Air DSRBasicCodedEntry("112143", "DCM", "Air") +#define CODE_DCM_SoftTissue DSRBasicCodedEntry("112144", "DCM", "Soft tissue") +#define CODE_DCM_Calcium DSRBasicCodedEntry("112145", "DCM", "Calcium") +#define CODE_DCM_Acinar DSRBasicCodedEntry("112146", "DCM", "Acinar") +#define CODE_DCM_AirSpace DSRBasicCodedEntry("112147", "DCM", "Air space") +#define CODE_DCM_Fibronodular DSRBasicCodedEntry("112148", "DCM", "Fibronodular") +#define CODE_DCM_Fluffy DSRBasicCodedEntry("112149", "DCM", "Fluffy") +#define CODE_DCM_Linear DSRBasicCodedEntry("112150", "DCM", "Linear") +#define CODE_DCM_Profusion DSRBasicCodedEntry("112151", "DCM", "Profusion") +#define CODE_DCM_SilhouetteSign DSRBasicCodedEntry("112152", "DCM", "Silhouette sign") +#define CODE_DCM_Subpleural DSRBasicCodedEntry("112153", "DCM", "Subpleural") +#define CODE_DCM_BatWingDistribution DSRBasicCodedEntry("112154", "DCM", "Bat's wing distribution") +#define CODE_DCM_ButterflyDistribution DSRBasicCodedEntry("112155", "DCM", "Butterfly distribution") +#define CODE_DCM_Centrilobular DSRBasicCodedEntry("112156", "DCM", "Centrilobular") +#define CODE_DCM_Coalescent DSRBasicCodedEntry("112157", "DCM", "Coalescent") +#define CODE_DCM_Lobar DSRBasicCodedEntry("112158", "DCM", "Lobar") +#define CODE_DCM_HyperAcute DSRBasicCodedEntry("112159", "DCM", "Hyper-acute") +#define CODE_DCM_Homogeneous_uniformOpacity DSRBasicCodedEntry("112160", "DCM", "Homogeneous (uniform opacity)") +#define CODE_DCM_Inhomogeneous DSRBasicCodedEntry("112161", "DCM", "Inhomogeneous") +#define CODE_DCM_Target DSRBasicCodedEntry("112162", "DCM", "Target") +#define CODE_DCM_Fibrocalcific DSRBasicCodedEntry("112163", "DCM", "Fibrocalcific") +#define CODE_DCM_Flocculent DSRBasicCodedEntry("112164", "DCM", "Flocculent") +#define CODE_DCM_RETIRED_DifferenceInBorderShape DSRBasicCodedEntry("112165", "DCM", "Difference in border shape") +#define CODE_DCM_RETIRED_DifferenceInBorderDefinition DSRBasicCodedEntry("112166", "DCM", "Difference in border definition") +#define CODE_DCM_RETIRED_DifferenceInDistribution DSRBasicCodedEntry("112167", "DCM", "Difference in distribution") +#define CODE_DCM_RETIRED_DifferenceInSiteInvolvement DSRBasicCodedEntry("112168", "DCM", "Difference in site involvement") +#define CODE_DCM_RETIRED_DifferenceInTypeOfContent DSRBasicCodedEntry("112169", "DCM", "Difference in Type of Content") +#define CODE_DCM_RETIRED_DifferenceInTexture DSRBasicCodedEntry("112170", "DCM", "Difference in Texture") +#define CODE_DCM_FiducialMark DSRBasicCodedEntry("112171", "DCM", "Fiducial mark") +#define CODE_DCM_Portacath DSRBasicCodedEntry("112172", "DCM", "Portacath") +#define CODE_DCM_ChestTube DSRBasicCodedEntry("112173", "DCM", "Chest tube") +#define CODE_DCM_CentralLine DSRBasicCodedEntry("112174", "DCM", "Central line") +#define CODE_DCM_KidneyStent DSRBasicCodedEntry("112175", "DCM", "Kidney stent") +#define CODE_DCM_PancreaticStent DSRBasicCodedEntry("112176", "DCM", "Pancreatic stent") +#define CODE_DCM_NippleRing DSRBasicCodedEntry("112177", "DCM", "Nipple ring") +#define CODE_DCM_Coin DSRBasicCodedEntry("112178", "DCM", "Coin") +#define CODE_DCM_MinimumAttenuationCoefficient DSRBasicCodedEntry("112179", "DCM", "Minimum Attenuation Coefficient") +#define CODE_DCM_MaximumAttenuationCoefficient DSRBasicCodedEntry("112180", "DCM", "Maximum Attenuation Coefficient") +#define CODE_DCM_MeanAttenuationCoefficient DSRBasicCodedEntry("112181", "DCM", "Mean Attenuation Coefficient") +#define CODE_DCM_MedianAttenuationCoefficient DSRBasicCodedEntry("112182", "DCM", "Median Attenuation Coefficient") +#define CODE_DCM_StandardDeviationOfAttenuationCoefficient DSRBasicCodedEntry("112183", "DCM", "Standard Deviation of Attenuation Coefficient") +#define CODE_DCM_PerformanceOfPediatricAndAdultThoracicCT DSRBasicCodedEntry("112184", "DCM", "Performance of Pediatric and Adult Thoracic CT") +#define CODE_DCM_PerformanceOfCTForDetectionOfPulmonaryEmbolismInAdults DSRBasicCodedEntry("112185", "DCM", "Performance of CT for Detection of Pulmonary Embolism in Adults") +#define CODE_DCM_PerformanceOfHighResolutionCTOfTheLungsInAdults DSRBasicCodedEntry("112186", "DCM", "Performance of High-Resolution CT of the Lungs in Adults") +#define CODE_DCM_UnspecifiedMethodOfCalculation DSRBasicCodedEntry("112187", "DCM", "Unspecified method of calculation") +#define CODE_DCM_TwoDimensionalMethod DSRBasicCodedEntry("112188", "DCM", "Two-dimensional method") +#define CODE_DCM_ThreeDimensionalMethod DSRBasicCodedEntry("112189", "DCM", "Three-dimensional method") +#define CODE_DCM_BreastTissueDensity DSRBasicCodedEntry("112191", "DCM", "Breast tissue density") +#define CODE_DCM_VolumeOfParenchymalTissue DSRBasicCodedEntry("112192", "DCM", "Volume of parenchymal tissue") +#define CODE_DCM_VolumeOfBreast DSRBasicCodedEntry("112193", "DCM", "Volume of breast") +#define CODE_DCM_MassOfParenchymalTissue DSRBasicCodedEntry("112194", "DCM", "Mass of parenchymal tissue") +#define CODE_DCM_MassOfBreast DSRBasicCodedEntry("112195", "DCM", "Mass of breast") +#define CODE_DCM_AreaOfVascularCalcification DSRBasicCodedEntry("112196", "DCM", "Area of Vascular Calcification") +#define CODE_DCM_VolumeOfVascularCalcification DSRBasicCodedEntry("112197", "DCM", "Volume of Vascular Calcification") +#define CODE_DCM_PercentageOfVascularCalcification DSRBasicCodedEntry("112198", "DCM", "Percentage of Vascular Calcification") +#define CODE_DCM_MassOfVascularCalcification DSRBasicCodedEntry("112199", "DCM", "Mass of Vascular Calcification") +#define CODE_DCM_AverageCalcificationDistanceInACalcificationCluster DSRBasicCodedEntry("112200", "DCM", "Average calcification distance in a calcification cluster") +#define CODE_DCM_StandardDeviationDistanceOfCalcificationsInACluster DSRBasicCodedEntry("112201", "DCM", "Standard deviation distance of calcifications in a cluster") +#define CODE_DCM_ColonCADReport DSRBasicCodedEntry("112220", "DCM", "Colon CAD Report") +#define CODE_DCM_ColonOverallAssessment DSRBasicCodedEntry("112222", "DCM", "Colon Overall Assessment") +#define CODE_DCM_ImageSetProperties DSRBasicCodedEntry("112224", "DCM", "Image Set Properties") +#define CODE_DCM_SliceThickness DSRBasicCodedEntry("112225", "DCM", "Slice Thickness") +#define CODE_DCM_SpacingBetweenSlices DSRBasicCodedEntry("112226", "DCM", "Spacing between slices") +#define CODE_DCM_FrameOfReferenceUID DSRBasicCodedEntry("112227", "DCM", "Frame of Reference UID") +#define CODE_DCM_RecumbentPatientPositionWithRespectToGravity DSRBasicCodedEntry("112228", "DCM", "Recumbent Patient Position with respect to gravity") +#define CODE_DCM_IdentifyingSegment DSRBasicCodedEntry("112229", "DCM", "Identifying Segment") +#define CODE_DCM_PolypStalkWidth DSRBasicCodedEntry("112232", "DCM", "Polyp stalk width") +#define CODE_DCM_DistanceFromAnus DSRBasicCodedEntry("112233", "DCM", "Distance from anus") +#define CODE_DCM_AnatomicNonColon DSRBasicCodedEntry("112238", "DCM", "Anatomic non-colon") +#define CODE_DCM_C0_InadequateStudyAwaitingPriorComparisons DSRBasicCodedEntry("112240", "DCM", "C0 - Inadequate Study/Awaiting Prior Comparisons") +#define CODE_DCM_C1_NormalColonOrBenignLesion DSRBasicCodedEntry("112241", "DCM", "C1 - Normal Colon or Benign Lesion") +#define CODE_DCM_C2_IntermediatePolypOrIndeterminateFinding DSRBasicCodedEntry("112242", "DCM", "C2 - Intermediate Polyp or Indeterminate Finding") +#define CODE_DCM_C3_Polyp_PossiblyAdvancedAdenoma DSRBasicCodedEntry("112243", "DCM", "C3 - Polyp, Possibly Advanced Adenoma") +#define CODE_DCM_C4_ColonicMass_LikelyMalignant DSRBasicCodedEntry("112244", "DCM", "C4 - Colonic Mass, Likely Malignant") +#define CODE_DCM_ACRGuideline_PerformanceOfAdultCTColonography DSRBasicCodedEntry("112248", "DCM", "ACR Guideline, Performance of Adult CT Colonography") +#define CODE_DCM_ACRStandard_CTMedicalPhysicsPerformanceMonitoring DSRBasicCodedEntry("112249", "DCM", "ACR Standard, CT medical physics performance monitoring") +#define CODE_DCM_APplus45 DSRBasicCodedEntry("112300", "DCM", "AP+45") +#define CODE_DCM_APminus45 DSRBasicCodedEntry("112301", "DCM", "AP-45") +#define CODE_DCM_AnatomicalAxisOfFemur DSRBasicCodedEntry("112302", "DCM", "Anatomical axis of femur") +#define CODE_DCM_AcetabularCenterOfRotation DSRBasicCodedEntry("112303", "DCM", "Acetabular Center of Rotation") +#define CODE_DCM_FemurHeadCenterOfRotation DSRBasicCodedEntry("112304", "DCM", "Femur Head Center of Rotation") +#define CODE_DCM_AcetabularCupShell DSRBasicCodedEntry("112305", "DCM", "Acetabular Cup Shell") +#define CODE_DCM_AcetabularCupInsert DSRBasicCodedEntry("112306", "DCM", "Acetabular Cup Insert") +#define CODE_DCM_AcetabularCupMonoblock DSRBasicCodedEntry("112307", "DCM", "Acetabular Cup Monoblock") +#define CODE_DCM_FemoralHeadBallComponent DSRBasicCodedEntry("112308", "DCM", "Femoral Head Ball Component") +#define CODE_DCM_FemoralHeadConeTaperComponent DSRBasicCodedEntry("112309", "DCM", "Femoral Head Cone Taper Component") +#define CODE_DCM_FemoralStem DSRBasicCodedEntry("112310", "DCM", "Femoral Stem") +#define CODE_DCM_FemoralStemDistalComponent DSRBasicCodedEntry("112311", "DCM", "Femoral Stem Distal Component") +#define CODE_DCM_FemoralStemProximalComponent DSRBasicCodedEntry("112312", "DCM", "Femoral Stem Proximal Component") +#define CODE_DCM_FemoralStemComponent DSRBasicCodedEntry("112313", "DCM", "Femoral Stem Component") +#define CODE_DCM_NeckComponent DSRBasicCodedEntry("112314", "DCM", "Neck Component") +#define CODE_DCM_MonoblockStem DSRBasicCodedEntry("112315", "DCM", "Monoblock Stem") +#define CODE_DCM_ProstheticShaftAugment DSRBasicCodedEntry("112316", "DCM", "Prosthetic Shaft Augment") +#define CODE_DCM_FemoralHeadResurfacingComponent DSRBasicCodedEntry("112317", "DCM", "Femoral Head Resurfacing Component") +#define CODE_DCM_Pinning DSRBasicCodedEntry("112318", "DCM", "Pinning") +#define CODE_DCM_Sewing DSRBasicCodedEntry("112319", "DCM", "Sewing") +#define CODE_DCM_Bolting DSRBasicCodedEntry("112320", "DCM", "Bolting") +#define CODE_DCM_Wedging DSRBasicCodedEntry("112321", "DCM", "Wedging") +#define CODE_DCM_DistalCentralizer DSRBasicCodedEntry("112325", "DCM", "Distal Centralizer") +#define CODE_DCM_Generic2DPlanning DSRBasicCodedEntry("112340", "DCM", "Generic 2D Planning") +#define CODE_DCM_Generic3DPlanning DSRBasicCodedEntry("112341", "DCM", "Generic 3D Planning") +#define CODE_DCM_GenericPlanningForHipReplacement DSRBasicCodedEntry("112342", "DCM", "Generic Planning for Hip Replacement") +#define CODE_DCM_GenericPlanningForKneeReplacement DSRBasicCodedEntry("112343", "DCM", "Generic Planning for Knee Replacement") +#define CODE_DCM_MuellerMethodPlanningForHipReplacement DSRBasicCodedEntry("112344", "DCM", "Müller Method Planning for Hip Replacement") +#define CODE_DCM_ImplantationPlan DSRBasicCodedEntry("112345", "DCM", "Implantation Plan") +#define CODE_DCM_SelectedImplantComponent DSRBasicCodedEntry("112346", "DCM", "Selected Implant Component") +#define CODE_DCM_ComponentID DSRBasicCodedEntry("112347", "DCM", "Component ID") +#define CODE_DCM_ImplantTemplate DSRBasicCodedEntry("112348", "DCM", "Implant Template") +#define CODE_DCM_ComponentConnection DSRBasicCodedEntry("112350", "DCM", "Component Connection") +#define CODE_DCM_MatingFeatureSetID DSRBasicCodedEntry("112351", "DCM", "Mating Feature Set ID") +#define CODE_DCM_MatingFeatureID DSRBasicCodedEntry("112352", "DCM", "Mating Feature ID") +#define CODE_DCM_SpatialRegistration DSRBasicCodedEntry("112353", "DCM", "Spatial Registration") +#define CODE_DCM_PatientImage DSRBasicCodedEntry("112354", "DCM", "Patient Image") +#define CODE_DCM_Assembly DSRBasicCodedEntry("112355", "DCM", "Assembly") +#define CODE_DCM_UserSelectedFiducial DSRBasicCodedEntry("112356", "DCM", "User Selected Fiducial") +#define CODE_DCM_DerivedFiducial DSRBasicCodedEntry("112357", "DCM", "Derived Fiducial") +#define CODE_DCM_InformationUsedForPlanning DSRBasicCodedEntry("112358", "DCM", "Information used for planning") +#define CODE_DCM_SupportingInformation DSRBasicCodedEntry("112359", "DCM", "Supporting Information") +#define CODE_DCM_ImplantComponentList DSRBasicCodedEntry("112360", "DCM", "Implant Component List") +#define CODE_DCM_PatientDataUsedDuringPlanning DSRBasicCodedEntry("112361", "DCM", "Patient Data Used During Planning") +#define CODE_DCM_DegreesOfFreedomSpecification DSRBasicCodedEntry("112362", "DCM", "Degrees of Freedom Specification") +#define CODE_DCM_DegreeOfFreedomID DSRBasicCodedEntry("112363", "DCM", "Degree of Freedom ID") +#define CODE_DCM_RelatedPatientDataNotUsedDuringPlanning DSRBasicCodedEntry("112364", "DCM", "Related Patient Data Not Used During Planning") +#define CODE_DCM_RelatedImplantationReports DSRBasicCodedEntry("112365", "DCM", "Related Implantation Reports") +#define CODE_DCM_ImplantAssemblyTemplate DSRBasicCodedEntry("112366", "DCM", "Implant Assembly Template") +#define CODE_DCM_PlanningInformationForIntraoperativeUsage DSRBasicCodedEntry("112367", "DCM", "Planning Information for Intraoperative Usage") +#define CODE_DCM_ImplantationPatientPositioning DSRBasicCodedEntry("112368", "DCM", "Implantation Patient Positioning") +#define CODE_DCM_FiducialIntent DSRBasicCodedEntry("112369", "DCM", "Fiducial Intent") +#define CODE_DCM_ComponentType DSRBasicCodedEntry("112370", "DCM", "Component Type") +#define CODE_DCM_ManufacturerImplantTemplate DSRBasicCodedEntry("112371", "DCM", "Manufacturer Implant Template") +#define CODE_DCM_DerivedPlanningImages DSRBasicCodedEntry("112372", "DCM", "Derived Planning Images") +#define CODE_DCM_OtherDerivedPlanningData DSRBasicCodedEntry("112373", "DCM", "Other Derived Planning Data") +#define CODE_DCM_ConnectedImplantationPlanComponent DSRBasicCodedEntry("112374", "DCM", "Connected Implantation Plan Component") +#define CODE_DCM_PlanningMethod DSRBasicCodedEntry("112375", "DCM", "Planning Method") +#define CODE_DCM_DegreeOfFreedomExactTranslationalValue DSRBasicCodedEntry("112376", "DCM", "Degree of Freedom Exact Translational Value") +#define CODE_DCM_DegreeOfFreedomMinimumTranslationalValue DSRBasicCodedEntry("112377", "DCM", "Degree of Freedom Minimum Translational Value") +#define CODE_DCM_DegreeOfFreedomMaximumTranslationalValue DSRBasicCodedEntry("112378", "DCM", "Degree of Freedom Maximum Translational Value") +#define CODE_DCM_DegreeOfFreedomExactRotationalTranslationValue DSRBasicCodedEntry("112379", "DCM", "Degree of Freedom Exact Rotational Translation Value") +#define CODE_DCM_DegreeOfFreedomMinimumRotationalValue DSRBasicCodedEntry("112380", "DCM", "Degree of Freedom Minimum Rotational Value") +#define CODE_DCM_DegreeOfFreedomMaximumRotationalValue DSRBasicCodedEntry("112381", "DCM", "Degree of Freedom Maximum Rotational Value") +#define CODE_DCM_PeriOperativePhotographicImaging DSRBasicCodedEntry("112700", "DCM", "Peri-operative Photographic Imaging") +#define CODE_DCM_GrossSpecimenImaging DSRBasicCodedEntry("112701", "DCM", "Gross Specimen Imaging") +#define CODE_DCM_SlideMicroscopy_112702 DSRBasicCodedEntry("112702", "DCM", "Slide Microscopy") +#define CODE_DCM_WholeSlideImaging DSRBasicCodedEntry("112703", "DCM", "Whole Slide Imaging") +#define CODE_DCM_WSI20XRGB DSRBasicCodedEntry("112704", "DCM", "WSI 20X RGB") +#define CODE_DCM_WSI40XRGB DSRBasicCodedEntry("112705", "DCM", "WSI 40X RGB") +#define CODE_DCM_IlluminationMethod DSRBasicCodedEntry("112706", "DCM", "Illumination Method") +#define CODE_DCM_NumberOfFocalPlanes DSRBasicCodedEntry("112707", "DCM", "Number of focal planes") +#define CODE_DCM_FocalPlaneZOffset DSRBasicCodedEntry("112708", "DCM", "Focal plane Z offset") +#define CODE_DCM_MagnificationSelection DSRBasicCodedEntry("112709", "DCM", "Magnification selection") +#define CODE_DCM_IlluminationWavelength DSRBasicCodedEntry("112710", "DCM", "Illumination wavelength") +#define CODE_DCM_IlluminationSpectralBand DSRBasicCodedEntry("112711", "DCM", "Illumination spectral band") +#define CODE_DCM_OpticalFilterType DSRBasicCodedEntry("112712", "DCM", "Optical filter type") +#define CODE_DCM_TissueSelectionMethod DSRBasicCodedEntry("112713", "DCM", "Tissue selection method") +#define CODE_DCM_MultiplePlanes DSRBasicCodedEntry("112714", "DCM", "Multiple planes") +#define CODE_DCM_5X DSRBasicCodedEntry("112715", "DCM", "5X") +#define CODE_DCM_10X DSRBasicCodedEntry("112716", "DCM", "10X") +#define CODE_DCM_20X DSRBasicCodedEntry("112717", "DCM", "20X") +#define CODE_DCM_40X DSRBasicCodedEntry("112718", "DCM", "40X") +#define CODE_DCM_NominalEmptyTileSuppression DSRBasicCodedEntry("112719", "DCM", "Nominal empty tile suppression") +#define CODE_DCM_HighThresholdEmptyTileSuppression DSRBasicCodedEntry("112720", "DCM", "High threshold empty tile suppression") +#define CODE_DCM_NoEmptyTileSuppression DSRBasicCodedEntry("112721", "DCM", "No empty tile suppression") +#define CODE_DCM_OfInterest DSRBasicCodedEntry("113000", "DCM", "Of Interest") +#define CODE_DCM_RejectedForQualityReasons DSRBasicCodedEntry("113001", "DCM", "Rejected for Quality Reasons") +#define CODE_DCM_ForReferringProvider DSRBasicCodedEntry("113002", "DCM", "For Referring Provider") +#define CODE_DCM_ForSurgery DSRBasicCodedEntry("113003", "DCM", "For Surgery") +#define CODE_DCM_ForTeaching DSRBasicCodedEntry("113004", "DCM", "For Teaching") +#define CODE_DCM_ForConference DSRBasicCodedEntry("113005", "DCM", "For Conference") +#define CODE_DCM_ForTherapy DSRBasicCodedEntry("113006", "DCM", "For Therapy") +#define CODE_DCM_ForPatient DSRBasicCodedEntry("113007", "DCM", "For Patient") +#define CODE_DCM_ForPeerReview DSRBasicCodedEntry("113008", "DCM", "For Peer Review") +#define CODE_DCM_ForResearch DSRBasicCodedEntry("113009", "DCM", "For Research") +#define CODE_DCM_QualityIssue DSRBasicCodedEntry("113010", "DCM", "Quality Issue") +#define CODE_DCM_DocumentTitleModifier DSRBasicCodedEntry("113011", "DCM", "Document Title Modifier") +#define CODE_DCM_KeyObjectDescription DSRBasicCodedEntry("113012", "DCM", "Key Object Description") +#define CODE_DCM_BestInSet DSRBasicCodedEntry("113013", "DCM", "Best In Set") +#define CODE_DCM_Study DSRBasicCodedEntry("113014", "DCM", "Study") +#define CODE_DCM_Series DSRBasicCodedEntry("113015", "DCM", "Series") +#define CODE_DCM_PerformedProcedureStep DSRBasicCodedEntry("113016", "DCM", "Performed Procedure Step") +#define CODE_DCM_StageView DSRBasicCodedEntry("113017", "DCM", "Stage-View") +#define CODE_DCM_ForPrinting DSRBasicCodedEntry("113018", "DCM", "For Printing") +#define CODE_DCM_ForReportAttachment DSRBasicCodedEntry("113020", "DCM", "For Report Attachment") +#define CODE_DCM_ForLitigation DSRBasicCodedEntry("113021", "DCM", "For Litigation") +#define CODE_DCM_CollectionOfPresentationStates DSRBasicCodedEntry("113022", "DCM", "Collection of Presentation States") +#define CODE_DCM_DoubleExposure DSRBasicCodedEntry("113026", "DCM", "Double exposure") +#define CODE_DCM_Manifest DSRBasicCodedEntry("113030", "DCM", "Manifest") +#define CODE_DCM_SignedManifest DSRBasicCodedEntry("113031", "DCM", "Signed Manifest") +#define CODE_DCM_CompleteStudyContent DSRBasicCodedEntry("113032", "DCM", "Complete Study Content") +#define CODE_DCM_SignedCompleteStudyContent DSRBasicCodedEntry("113033", "DCM", "Signed Complete Study Content") +#define CODE_DCM_CompleteAcquisitionContent DSRBasicCodedEntry("113034", "DCM", "Complete Acquisition Content") +#define CODE_DCM_SignedCompleteAcquisitionContent DSRBasicCodedEntry("113035", "DCM", "Signed Complete Acquisition Content") +#define CODE_DCM_GroupOfFramesForDisplay DSRBasicCodedEntry("113036", "DCM", "Group of Frames for Display") +#define CODE_DCM_RejectedForPatientSafetyReasons DSRBasicCodedEntry("113037", "DCM", "Rejected for Patient Safety Reasons") +#define CODE_DCM_IncorrectModalityWorklistEntry DSRBasicCodedEntry("113038", "DCM", "Incorrect Modality Worklist Entry") +#define CODE_DCM_DataRetentionPolicyExpired DSRBasicCodedEntry("113039", "DCM", "Data Retention Policy Expired") +#define CODE_DCM_LossyCompression DSRBasicCodedEntry("113040", "DCM", "Lossy Compression") +#define CODE_DCM_ApparentDiffusionCoefficient DSRBasicCodedEntry("113041", "DCM", "Apparent Diffusion Coefficient") +#define CODE_DCM_PixelByPixelAddition DSRBasicCodedEntry("113042", "DCM", "Pixel by pixel addition") +#define CODE_DCM_DiffusionWeighted DSRBasicCodedEntry("113043", "DCM", "Diffusion weighted") +#define CODE_DCM_DiffusionAnisotropy DSRBasicCodedEntry("113044", "DCM", "Diffusion Anisotropy") +#define CODE_DCM_DiffusionAttenuated DSRBasicCodedEntry("113045", "DCM", "Diffusion Attenuated") +#define CODE_DCM_PixelByPixelDivision DSRBasicCodedEntry("113046", "DCM", "Pixel by pixel division") +#define CODE_DCM_PixelByPixelMask DSRBasicCodedEntry("113047", "DCM", "Pixel by pixel mask") +#define CODE_DCM_PixelByPixelMaximum DSRBasicCodedEntry("113048", "DCM", "Pixel by pixel Maximum") +#define CODE_DCM_PixelByPixelMean DSRBasicCodedEntry("113049", "DCM", "Pixel by pixel mean") +#define CODE_DCM_MetaboliteMapsFromSpectroscopyData DSRBasicCodedEntry("113050", "DCM", "Metabolite Maps from spectroscopy data") +#define CODE_DCM_PixelByPixelMinimum DSRBasicCodedEntry("113051", "DCM", "Pixel by pixel Minimum") +#define CODE_DCM_MeanTransitTime DSRBasicCodedEntry("113052", "DCM", "Mean Transit Time") +#define CODE_DCM_PixelByPixelMultiplication DSRBasicCodedEntry("113053", "DCM", "Pixel by pixel multiplication") +#define CODE_DCM_NegativeEnhancementIntegral DSRBasicCodedEntry("113054", "DCM", "Negative Enhancement Integral") +#define CODE_DCM_RETIRED_RegionalCerebralBloodFlow DSRBasicCodedEntry("113055", "DCM", "Regional Cerebral Blood Flow") +#define CODE_DCM_RETIRED_RegionalCerebralBloodVolume DSRBasicCodedEntry("113056", "DCM", "Regional Cerebral Blood Volume") +#define CODE_DCM_RCoefficient DSRBasicCodedEntry("113057", "DCM", "R-Coefficient") +#define CODE_DCM_ProtonDensity DSRBasicCodedEntry("113058", "DCM", "Proton Density") +#define CODE_DCM_SignalChange DSRBasicCodedEntry("113059", "DCM", "Signal Change") +#define CODE_DCM_SignalToNoise DSRBasicCodedEntry("113060", "DCM", "Signal to Noise") +#define CODE_DCM_StandardDeviation DSRBasicCodedEntry("113061", "DCM", "Standard Deviation") +#define CODE_DCM_PixelByPixelSubtraction DSRBasicCodedEntry("113062", "DCM", "Pixel by pixel subtraction") +#define CODE_DCM_T1 DSRBasicCodedEntry("113063", "DCM", "T1") +#define CODE_DCM_T2Star DSRBasicCodedEntry("113064", "DCM", "T2*") +#define CODE_DCM_T2 DSRBasicCodedEntry("113065", "DCM", "T2") +#define CODE_DCM_TimeCourseOfSignal DSRBasicCodedEntry("113066", "DCM", "Time Course of Signal") +#define CODE_DCM_TemperatureEncoded DSRBasicCodedEntry("113067", "DCM", "Temperature encoded") +#define CODE_DCM_StudentTTest DSRBasicCodedEntry("113068", "DCM", "Student's T-Test") +#define CODE_DCM_TimeToPeak DSRBasicCodedEntry("113069", "DCM", "Time To Peak") +#define CODE_DCM_VelocityEncoded DSRBasicCodedEntry("113070", "DCM", "Velocity encoded") +#define CODE_DCM_ZScore DSRBasicCodedEntry("113071", "DCM", "Z-Score") +#define CODE_DCM_MultiplanarReformatting DSRBasicCodedEntry("113072", "DCM", "Multiplanar reformatting") +#define CODE_DCM_CurvedMultiplanarReformatting DSRBasicCodedEntry("113073", "DCM", "Curved multiplanar reformatting") +#define CODE_DCM_VolumeRendering DSRBasicCodedEntry("113074", "DCM", "Volume rendering") +#define CODE_DCM_SurfaceRendering DSRBasicCodedEntry("113075", "DCM", "Surface rendering") +#define CODE_DCM_Segmentation_113076 DSRBasicCodedEntry("113076", "DCM", "Segmentation") +#define CODE_DCM_VolumeEditing DSRBasicCodedEntry("113077", "DCM", "Volume editing") +#define CODE_DCM_MaximumIntensityProjection DSRBasicCodedEntry("113078", "DCM", "Maximum intensity projection") +#define CODE_DCM_MinimumIntensityProjection DSRBasicCodedEntry("113079", "DCM", "Minimum intensity projection") +#define CODE_DCM_GlutamateAndGlutamine DSRBasicCodedEntry("113080", "DCM", "Glutamate and glutamine") +#define CODE_DCM_CholineCreatineRatio DSRBasicCodedEntry("113081", "DCM", "Choline/Creatine Ratio") +#define CODE_DCM_NAcetylaspartateCreatineRatio DSRBasicCodedEntry("113082", "DCM", "N-acetylaspartate /Creatine Ratio") +#define CODE_DCM_NAcetylaspartateCholineRatio DSRBasicCodedEntry("113083", "DCM", "N-acetylaspartate /Choline Ratio") +#define CODE_DCM_Tmax DSRBasicCodedEntry("113084", "DCM", "Tmax") +#define CODE_DCM_SpatialResampling DSRBasicCodedEntry("113085", "DCM", "Spatial resampling") +#define CODE_DCM_EdgeEnhancement DSRBasicCodedEntry("113086", "DCM", "Edge enhancement") +#define CODE_DCM_Smoothing DSRBasicCodedEntry("113087", "DCM", "Smoothing") +#define CODE_DCM_GaussianBlur DSRBasicCodedEntry("113088", "DCM", "Gaussian blur") +#define CODE_DCM_UnsharpMask DSRBasicCodedEntry("113089", "DCM", "Unsharp mask") +#define CODE_DCM_ImageStitching DSRBasicCodedEntry("113090", "DCM", "Image stitching") +#define CODE_DCM_SpatiallyRelatedFramesExtractedFromTheVolume DSRBasicCodedEntry("113091", "DCM", "Spatially-related frames extracted from the volume") +#define CODE_DCM_TemporallyRelatedFramesExtractedFromTheSetOfVolumes DSRBasicCodedEntry("113092", "DCM", "Temporally-related frames extracted from the set of volumes") +#define CODE_DCM_PolarToRectangularScanConversion DSRBasicCodedEntry("113093", "DCM", "Polar to Rectangular Scan Conversion") +#define CODE_DCM_CreatineAndCholine DSRBasicCodedEntry("113094", "DCM", "Creatine and Choline") +#define CODE_DCM_LipidAndLactate DSRBasicCodedEntry("113095", "DCM", "Lipid and Lactate") +#define CODE_DCM_CreatinePlusCholineCitrateRatio DSRBasicCodedEntry("113096", "DCM", "Creatine+Choline/ Citrate Ratio") +#define CODE_DCM_MultiEnergyProportionalWeighting DSRBasicCodedEntry("113097", "DCM", "Multi-energy proportional weighting") +#define CODE_DCM_MagnetizationTransferRatio DSRBasicCodedEntry("113098", "DCM", "Magnetization Transfer Ratio") +#define CODE_DCM_BasicApplicationConfidentialityProfile DSRBasicCodedEntry("113100", "DCM", "Basic Application Confidentiality Profile") +#define CODE_DCM_CleanPixelDataOption DSRBasicCodedEntry("113101", "DCM", "Clean Pixel Data Option") +#define CODE_DCM_CleanRecognizableVisualFeaturesOption DSRBasicCodedEntry("113102", "DCM", "Clean Recognizable Visual Features Option") +#define CODE_DCM_CleanGraphicsOption DSRBasicCodedEntry("113103", "DCM", "Clean Graphics Option") +#define CODE_DCM_CleanStructuredContentOption DSRBasicCodedEntry("113104", "DCM", "Clean Structured Content Option") +#define CODE_DCM_CleanDescriptorsOption DSRBasicCodedEntry("113105", "DCM", "Clean Descriptors Option") +#define CODE_DCM_RetainLongitudinalTemporalInformationFullDatesOption DSRBasicCodedEntry("113106", "DCM", "Retain Longitudinal Temporal Information Full Dates Option") +#define CODE_DCM_RetainLongitudinalTemporalInformationModifiedDatesOption DSRBasicCodedEntry("113107", "DCM", "Retain Longitudinal Temporal Information Modified Dates Option") +#define CODE_DCM_RetainPatientCharacteristicsOption DSRBasicCodedEntry("113108", "DCM", "Retain Patient Characteristics Option") +#define CODE_DCM_RetainDeviceIdentityOption DSRBasicCodedEntry("113109", "DCM", "Retain Device Identity Option") +#define CODE_DCM_RetainUIDsOption DSRBasicCodedEntry("113110", "DCM", "Retain UIDs Option") +#define CODE_DCM_RetainSafePrivateOption DSRBasicCodedEntry("113111", "DCM", "Retain Safe Private Option") +#define CODE_DCM_RetainInstitutionIdentityOption DSRBasicCodedEntry("113112", "DCM", "Retain Institution Identity Option") +#define CODE_DCM_PredecessorContainingGroupOfImagingSubjects DSRBasicCodedEntry("113130", "DCM", "Predecessor containing group of imaging subjects") +#define CODE_DCM_ExtractionOfIndividualSubjectFromGroup DSRBasicCodedEntry("113131", "DCM", "Extraction of individual subject from group") +#define CODE_DCM_SingleSubjectSelectedFromGroup DSRBasicCodedEntry("113132", "DCM", "Single subject selected from group") +#define CODE_DCM_Trace DSRBasicCodedEntry("113201", "DCM", "Trace") +#define CODE_DCM_MeanDiffusivity DSRBasicCodedEntry("113202", "DCM", "Mean Diffusivity") +#define CODE_DCM_RadialDiffusivity DSRBasicCodedEntry("113203", "DCM", "Radial Diffusivity") +#define CODE_DCM_AxialDiffusivity DSRBasicCodedEntry("113204", "DCM", "Axial Diffusivity") +#define CODE_DCM_MeanKurtosis DSRBasicCodedEntry("113205", "DCM", "Mean Kurtosis") +#define CODE_DCM_ApparentKurtosisCoefficient DSRBasicCodedEntry("113206", "DCM", "Apparent Kurtosis Coefficient") +#define CODE_DCM_RadialKurtosis DSRBasicCodedEntry("113207", "DCM", "Radial Kurtosis") +#define CODE_DCM_AxialKurtosis DSRBasicCodedEntry("113208", "DCM", "Axial Kurtosis") +#define CODE_DCM_FractionalKurtosisAnisotropy DSRBasicCodedEntry("113209", "DCM", "Fractional Kurtosis Anisotropy") +#define CODE_DCM_DeterministicTrackingAlgorithm DSRBasicCodedEntry("113211", "DCM", "Deterministic Tracking Algorithm") +#define CODE_DCM_ProbabilisticTrackingAlgorithm DSRBasicCodedEntry("113212", "DCM", "Probabilistic Tracking Algorithm") +#define CODE_DCM_GlobalTrackingAlgorithm DSRBasicCodedEntry("113213", "DCM", "Global Tracking Algorithm") +#define CODE_DCM_FACT DSRBasicCodedEntry("113214", "DCM", "FACT") +#define CODE_DCM_Streamline DSRBasicCodedEntry("113215", "DCM", "Streamline") +#define CODE_DCM_TEND DSRBasicCodedEntry("113216", "DCM", "TEND") +#define CODE_DCM_BootstrapTrackingAlgorithm DSRBasicCodedEntry("113217", "DCM", "Bootstrap Tracking Algorithm") +#define CODE_DCM_Euler DSRBasicCodedEntry("113218", "DCM", "Euler") +#define CODE_DCM_RungeKutta DSRBasicCodedEntry("113219", "DCM", "Runge-Kutta") +#define CODE_DCM_HARDI DSRBasicCodedEntry("113221", "DCM", "HARDI") +#define CODE_DCM_DKI DSRBasicCodedEntry("113222", "DCM", "DKI") +#define CODE_DCM_DTI DSRBasicCodedEntry("113223", "DCM", "DTI") +#define CODE_DCM_DSI DSRBasicCodedEntry("113224", "DCM", "DSI") +#define CODE_DCM_LSDI DSRBasicCodedEntry("113225", "DCM", "LSDI") +#define CODE_DCM_SingleShotEPI DSRBasicCodedEntry("113226", "DCM", "Single Shot EPI") +#define CODE_DCM_MultiShotEPI DSRBasicCodedEntry("113227", "DCM", "Multi Shot EPI") +#define CODE_DCM_ParallelImaging DSRBasicCodedEntry("113228", "DCM", "Parallel Imaging") +#define CODE_DCM_SingleTensor DSRBasicCodedEntry("113231", "DCM", "Single Tensor") +#define CODE_DCM_MultiTensor DSRBasicCodedEntry("113232", "DCM", "Multi Tensor") +#define CODE_DCM_ModelFree DSRBasicCodedEntry("113233", "DCM", "Model Free") +#define CODE_DCM_CHARMED DSRBasicCodedEntry("113234", "DCM", "CHARMED") +#define CODE_DCM_DOT DSRBasicCodedEntry("113236", "DCM", "DOT") +#define CODE_DCM_PAS DSRBasicCodedEntry("113237", "DCM", "PAS") +#define CODE_DCM_SphericalDeconvolution DSRBasicCodedEntry("113238", "DCM", "Spherical Deconvolution") +#define CODE_DCM_SourceImageDiffusionBValue DSRBasicCodedEntry("113240", "DCM", "Source image diffusion b-value") +#define CODE_DCM_ModelFittingMethod DSRBasicCodedEntry("113241", "DCM", "Model fitting method") +#define CODE_DCM_MonoExponentialDiffusionModel DSRBasicCodedEntry("113250", "DCM", "Mono-exponential diffusion model") +#define CODE_DCM_BiExponential_IVIM_diffusionModel DSRBasicCodedEntry("113251", "DCM", "Bi-exponential (IVIM) diffusion model") +#define CODE_DCM_KurtosisDiffusionModel DSRBasicCodedEntry("113252", "DCM", "Kurtosis diffusion model") +#define CODE_DCM_GammaDistributionModel DSRBasicCodedEntry("113253", "DCM", "Gamma distribution model") +#define CODE_DCM_StretchedExponentialDiffusionModel DSRBasicCodedEntry("113254", "DCM", "Stretched exponential diffusion model") +#define CODE_DCM_TruncatedGaussianDiffusionModel DSRBasicCodedEntry("113255", "DCM", "Truncated Gaussian diffusion model") +#define CODE_DCM_LogOfRatioOfTwoSamples DSRBasicCodedEntry("113260", "DCM", "Log of ratio of two samples") +#define CODE_DCM_LeastSquaresFitOfMultipleSamples DSRBasicCodedEntry("113261", "DCM", "Least squares fit of multiple samples") +#define CODE_DCM_LevenbergMarquardt DSRBasicCodedEntry("113265", "DCM", "Levenberg-Marquardt") +#define CODE_DCM_TrustRegion DSRBasicCodedEntry("113266", "DCM", "Trust-Region") +#define CODE_DCM_FixedDp DSRBasicCodedEntry("113267", "DCM", "Fixed-Dp") +#define CODE_DCM_SegmentedUnconstrained DSRBasicCodedEntry("113268", "DCM", "Segmented-Unconstrained") +#define CODE_DCM_SegmentedConstrained DSRBasicCodedEntry("113269", "DCM", "Segmented-Constrained") +#define CODE_DCM_BayesianProbability DSRBasicCodedEntry("113270", "DCM", "Bayesian-Probability") +#define CODE_DCM_DotDotDot DSRBasicCodedEntry("...", "DCM", "...") +#define CODE_DCM_VoxelwiseSelectionOfBValue DSRBasicCodedEntry("113285", "DCM", "Voxelwise selection of b-value") +#define CODE_DCM_VolumeRatio DSRBasicCodedEntry("113288", "DCM", "Volume Ratio") +#define CODE_DCM_DiffusionCoefficient DSRBasicCodedEntry("113289", "DCM", "Diffusion Coefficient") +#define CODE_DCM_MonoExponentialApparentDiffusionCoefficient DSRBasicCodedEntry("113290", "DCM", "Mono-exponential Apparent Diffusion Coefficient") +#define CODE_DCM_SlowDiffusionCoefficient DSRBasicCodedEntry("113291", "DCM", "Slow Diffusion Coefficient") +#define CODE_DCM_FastDiffusionCoefficient DSRBasicCodedEntry("113292", "DCM", "Fast Diffusion Coefficient") +#define CODE_DCM_FastDiffusionCoefficientFraction DSRBasicCodedEntry("113293", "DCM", "Fast Diffusion Coefficient Fraction") +#define CODE_DCM_KurtosisDiffusionCoefficient DSRBasicCodedEntry("113294", "DCM", "Kurtosis Diffusion Coefficient") +#define CODE_DCM_GammaDistributionScaleParameter DSRBasicCodedEntry("113295", "DCM", "Gamma Distribution Scale Parameter") +#define CODE_DCM_GammaDistributionShapeParameter DSRBasicCodedEntry("113296", "DCM", "Gamma Distribution Shape Parameter") +#define CODE_DCM_GammaDistributionMode DSRBasicCodedEntry("113297", "DCM", "Gamma Distribution Mode") +#define CODE_DCM_DistributedDiffusionCoefficient DSRBasicCodedEntry("113298", "DCM", "Distributed Diffusion Coefficient") +#define CODE_DCM_AnomalousExponentParameter DSRBasicCodedEntry("113299", "DCM", "Anomalous Exponent Parameter") +#define CODE_DCM_RadiopharmaceuticalRadiationDoseReport DSRBasicCodedEntry("113500", "DCM", "Radiopharmaceutical Radiation Dose Report") +#define CODE_DCM_RadiopharmaceuticalAdministration DSRBasicCodedEntry("113502", "DCM", "Radiopharmaceutical Administration") +#define CODE_DCM_RadiopharmaceuticalAdministrationEventUID DSRBasicCodedEntry("113503", "DCM", "Radiopharmaceutical Administration Event UID") +#define CODE_DCM_IntravenousExtravasationSymptoms DSRBasicCodedEntry("113505", "DCM", "Intravenous Extravasation Symptoms") +#define CODE_DCM_EstimatedExtravasationActivity DSRBasicCodedEntry("113506", "DCM", "Estimated Extravasation Activity") +#define CODE_DCM_AdministeredActivity DSRBasicCodedEntry("113507", "DCM", "Administered activity") +#define CODE_DCM_PreAdministrationMeasuredActivity DSRBasicCodedEntry("113508", "DCM", "Pre-Administration Measured Activity") +#define CODE_DCM_PostAdministrationMeasuredActivity DSRBasicCodedEntry("113509", "DCM", "Post-Administration Measured Activity") +#define CODE_DCM_DrugProductIdentifier DSRBasicCodedEntry("113510", "DCM", "Drug Product Identifier") +#define CODE_DCM_RadiopharmaceuticalDispenseUnitIdentifier DSRBasicCodedEntry("113511", "DCM", "Radiopharmaceutical Dispense Unit Identifier") +#define CODE_DCM_RadiopharmaceuticalLotIdentifier DSRBasicCodedEntry("113512", "DCM", "Radiopharmaceutical Lot Identifier") +#define CODE_DCM_ReagentVialIdentifier DSRBasicCodedEntry("113513", "DCM", "Reagent Vial Identifier") +#define CODE_DCM_RadionuclideVialIdentifier DSRBasicCodedEntry("113514", "DCM", "Radionuclide Vial Identifier") +#define CODE_DCM_PrescriptionIdentifier DSRBasicCodedEntry("113516", "DCM", "Prescription Identifier") +#define CODE_DCM_OrganDoseInformation DSRBasicCodedEntry("113517", "DCM", "Organ Dose Information") +#define CODE_DCM_OrganDose DSRBasicCodedEntry("113518", "DCM", "Organ Dose") +#define CODE_DCM_MIRDPamphlet1 DSRBasicCodedEntry("113520", "DCM", "MIRD Pamphlet 1") +#define CODE_DCM_ICRPPublication53 DSRBasicCodedEntry("113521", "DCM", "ICRP Publication 53") +#define CODE_DCM_ICRPPublication80 DSRBasicCodedEntry("113522", "DCM", "ICRP Publication 80") +#define CODE_DCM_ICRPPublication106 DSRBasicCodedEntry("113523", "DCM", "ICRP Publication 106") +#define CODE_DCM_MIRDOSE DSRBasicCodedEntry("113526", "DCM", "MIRDOSE") +#define CODE_DCM_OLINDAEXM DSRBasicCodedEntry("113527", "DCM", "OLINDA-EXM") +#define CODE_DCM_PackageInsert DSRBasicCodedEntry("113528", "DCM", "Package Insert") +#define CODE_DCM_InstitutionallyApprovedEstimates DSRBasicCodedEntry("113529", "DCM", "Institutionally Approved Estimates") +#define CODE_DCM_InvestigationalNewDrug DSRBasicCodedEntry("113530", "DCM", "Investigational New Drug") +#define CODE_DCM_ActivityMeasurementDevice DSRBasicCodedEntry("113540", "DCM", "Activity Measurement Device") +#define CODE_DCM_DoseCalibrator DSRBasicCodedEntry("113541", "DCM", "Dose Calibrator") +#define CODE_DCM_InfusionSystem DSRBasicCodedEntry("113542", "DCM", "Infusion System") +#define CODE_DCM_Generator DSRBasicCodedEntry("113543", "DCM", "Generator") +#define CODE_DCM_FastingDuration DSRBasicCodedEntry("113550", "DCM", "Fasting Duration") +#define CODE_DCM_HydrationVolume DSRBasicCodedEntry("113551", "DCM", "Hydration Volume") +#define CODE_DCM_RecentPhysicalActivity DSRBasicCodedEntry("113552", "DCM", "Recent Physical Activity") +#define CODE_DCM_AcuteUnilateralRenalBlockage DSRBasicCodedEntry("113560", "DCM", "Acute unilateral renal blockage") +#define CODE_DCM_LowThyroidUptake DSRBasicCodedEntry("113561", "DCM", "Low Thyroid Uptake") +#define CODE_DCM_HighThyroidUptake DSRBasicCodedEntry("113562", "DCM", "High Thyroid Uptake") +#define CODE_DCM_SeverelyJaundiced DSRBasicCodedEntry("113563", "DCM", "Severely Jaundiced") +#define CODE_DCM_ExtravasationVisibleInImage DSRBasicCodedEntry("113568", "DCM", "Extravasation visible in image") +#define CODE_DCM_CockroftGaultFormulaEstimationOfGFR DSRBasicCodedEntry("113570", "DCM", "Cockroft-Gault Formula estimation of GFR") +#define CODE_DCM_CKDEPIFormulaEstimationOfGFR DSRBasicCodedEntry("113571", "DCM", "CKD-EPI Formula estimation of GFR") +#define CODE_DCM_GlomerularFiltrationRate_MDRD DSRBasicCodedEntry("113572", "DCM", "Glomerular Filtration Rate (MDRD)") +#define CODE_DCM_GlomerularFiltrationRateNonBlack_MDRD DSRBasicCodedEntry("113573", "DCM", "Glomerular Filtration Rate non-black (MDRD)") +#define CODE_DCM_GlomerularFiltrationRateBlack_MDRD DSRBasicCodedEntry("113574", "DCM", "Glomerular Filtration Rate black (MDRD)") +#define CODE_DCM_GlomerularFiltrationRateFemale_MDRD DSRBasicCodedEntry("113575", "DCM", "Glomerular Filtration Rate female (MDRD)") +#define CODE_DCM_GlomerularFiltrationRateCystatinBasedFormula DSRBasicCodedEntry("113576", "DCM", "Glomerular Filtration Rate Cystatin-based formula") +#define CODE_DCM_GlomerularFiltrationRateCreatinineBasedFormula_Schwartz DSRBasicCodedEntry("113577", "DCM", "Glomerular Filtration Rate Creatinine-based formula (Schwartz)") +#define CODE_DCM_Small_LessThan32cmLateralThickness DSRBasicCodedEntry("113601", "DCM", "Small: < 32.0 cm lateral thickness") +#define CODE_DCM_Medium_32to38cmLateralThickness DSRBasicCodedEntry("113602", "DCM", "Medium: 32.0-38.0 cm lateral thickness") +#define CODE_DCM_Large_GreaterThan38cmLateralThickness DSRBasicCodedEntry("113603", "DCM", "Large: > 38.0 cm lateral thickness") +#define CODE_DCM_IrradiationEventLabel DSRBasicCodedEntry("113605", "DCM", "Irradiation Event Label") +#define CODE_DCM_LabelType DSRBasicCodedEntry("113606", "DCM", "Label Type") +#define CODE_DCM_SeriesNumber DSRBasicCodedEntry("113607", "DCM", "Series Number") +#define CODE_DCM_AcquisitionNumber DSRBasicCodedEntry("113608", "DCM", "Acquisition Number") +#define CODE_DCM_InstanceNumber DSRBasicCodedEntry("113609", "DCM", "Instance Number") +#define CODE_DCM_StationaryAcquisition_113611 DSRBasicCodedEntry("113611", "DCM", "Stationary Acquisition") +#define CODE_DCM_SteppingAcquisition DSRBasicCodedEntry("113612", "DCM", "Stepping Acquisition") +#define CODE_DCM_RotationalAcquisition DSRBasicCodedEntry("113613", "DCM", "Rotational Acquisition") +#define CODE_DCM_PlaneA DSRBasicCodedEntry("113620", "DCM", "Plane A") +#define CODE_DCM_PlaneB DSRBasicCodedEntry("113621", "DCM", "Plane B") +#define CODE_DCM_SinglePlane DSRBasicCodedEntry("113622", "DCM", "Single Plane") +#define CODE_DCM_Continuous DSRBasicCodedEntry("113630", "DCM", "Continuous") +#define CODE_DCM_Pulsed DSRBasicCodedEntry("113631", "DCM", "Pulsed") +#define CODE_DCM_StripFilter DSRBasicCodedEntry("113650", "DCM", "Strip filter") +#define CODE_DCM_WedgeFilter DSRBasicCodedEntry("113651", "DCM", "Wedge filter") +#define CODE_DCM_ButterflyFilter DSRBasicCodedEntry("113652", "DCM", "Butterfly filter") +#define CODE_DCM_FlatFilter DSRBasicCodedEntry("113653", "DCM", "Flat filter") +#define CODE_DCM_OutlineOfLobulations DSRBasicCodedEntry("113661", "DCM", "Outline of lobulations") +#define CODE_DCM_InnerLimitsOfFuzzyMargin DSRBasicCodedEntry("113662", "DCM", "Inner limits of fuzzy margin") +#define CODE_DCM_OuterLimitsOfFuzzyMargin DSRBasicCodedEntry("113663", "DCM", "Outer limits of fuzzy margin") +#define CODE_DCM_OutlineOfSpiculations DSRBasicCodedEntry("113664", "DCM", "Outline of spiculations") +#define CODE_DCM_LinearSpiculation DSRBasicCodedEntry("113665", "DCM", "Linear spiculation") +#define CODE_DCM_PixelatedSpiculations DSRBasicCodedEntry("113666", "DCM", "Pixelated spiculations") +#define CODE_DCM_OrthogonalLocationArc DSRBasicCodedEntry("113669", "DCM", "Orthogonal location arc") +#define CODE_DCM_OrthogonalLocationArcInnerMargin DSRBasicCodedEntry("113670", "DCM", "Orthogonal location arc inner margin") +#define CODE_DCM_OrthogonalLocationArcOuterMargin DSRBasicCodedEntry("113671", "DCM", "Orthogonal location arc outer margin") +#define CODE_DCM_QualityControlIntent DSRBasicCodedEntry("113680", "DCM", "Quality Control Intent") +#define CODE_DCM_Phantom DSRBasicCodedEntry("113681", "DCM", "Phantom") +#define CODE_DCM_ACRAccreditationPhantom_CT DSRBasicCodedEntry("113682", "DCM", "ACR Accreditation Phantom - CT") +#define CODE_DCM_ACRAccreditationPhantom_MR DSRBasicCodedEntry("113683", "DCM", "ACR Accreditation Phantom - MR") +#define CODE_DCM_ACRAccreditationPhantom_Mammography DSRBasicCodedEntry("113684", "DCM", "ACR Accreditation Phantom - Mammography") +#define CODE_DCM_ACRAccreditationPhantom_StereotacticBreastBiopsy DSRBasicCodedEntry("113685", "DCM", "ACR Accreditation Phantom - Stereotactic Breast Biopsy") +#define CODE_DCM_ACRAccreditationPhantom_ECT DSRBasicCodedEntry("113686", "DCM", "ACR Accreditation Phantom - ECT") +#define CODE_DCM_ACRAccreditationPhantom_PET DSRBasicCodedEntry("113687", "DCM", "ACR Accreditation Phantom - PET") +#define CODE_DCM_ACRAccreditationPhantom_ECTPET DSRBasicCodedEntry("113688", "DCM", "ACR Accreditation Phantom - ECT/PET") +#define CODE_DCM_ACRAccreditationPhantom_PETFaceplate DSRBasicCodedEntry("113689", "DCM", "ACR Accreditation Phantom - PET Faceplate") +#define CODE_DCM_IECHeadDosimetryPhantom DSRBasicCodedEntry("113690", "DCM", "IEC Head Dosimetry Phantom") +#define CODE_DCM_IECBodyDosimetryPhantom DSRBasicCodedEntry("113691", "DCM", "IEC Body Dosimetry Phantom") +#define CODE_DCM_NEMAXR212000Phantom DSRBasicCodedEntry("113692", "DCM", "NEMA XR21-2000 Phantom") +#define CODE_DCM_XRayRadiationDoseReport DSRBasicCodedEntry("113701", "DCM", "X-Ray Radiation Dose Report") +#define CODE_DCM_AccumulatedXRayDoseData DSRBasicCodedEntry("113702", "DCM", "Accumulated X-Ray Dose Data") +#define CODE_DCM_ProjectionXRay DSRBasicCodedEntry("113704", "DCM", "Projection X-Ray") +#define CODE_DCM_ScopeOfAccumulation DSRBasicCodedEntry("113705", "DCM", "Scope of Accumulation") +#define CODE_DCM_IrradiationEventXRayData DSRBasicCodedEntry("113706", "DCM", "Irradiation Event X-Ray Data") +#define CODE_DCM_RETIRED_NiobiumOrNiobiumCompound DSRBasicCodedEntry("113710", "DCM", "Niobium or Niobium compound") +#define CODE_DCM_RETIRED_EuropiumOrEuropiumCompound DSRBasicCodedEntry("113711", "DCM", "Europium or Europium compound") +#define CODE_DCM_CalibrationProtocol DSRBasicCodedEntry("113720", "DCM", "Calibration Protocol") +#define CODE_DCM_IrradiationEventType DSRBasicCodedEntry("113721", "DCM", "Irradiation Event Type") +#define CODE_DCM_DoseAreaProductTotal DSRBasicCodedEntry("113722", "DCM", "Dose Area Product Total") +#define CODE_DCM_CalibrationDateTime DSRBasicCodedEntry("113723", "DCM", "Calibration DateTime") +#define CODE_DCM_CalibrationResponsibleParty DSRBasicCodedEntry("113724", "DCM", "Calibration Responsible Party") +#define CODE_DCM_Dose_RP_Total DSRBasicCodedEntry("113725", "DCM", "Dose (RP) Total") +#define CODE_DCM_FluoroDoseAreaProductTotal DSRBasicCodedEntry("113726", "DCM", "Fluoro Dose Area Product Total") +#define CODE_DCM_AcquisitionDoseAreaProductTotal DSRBasicCodedEntry("113727", "DCM", "Acquisition Dose Area Product Total") +#define CODE_DCM_FluoroDose_RP_Total DSRBasicCodedEntry("113728", "DCM", "Fluoro Dose (RP) Total") +#define CODE_DCM_AcquisitionDose_RP_Total DSRBasicCodedEntry("113729", "DCM", "Acquisition Dose (RP) Total") +#define CODE_DCM_TotalFluoroTime DSRBasicCodedEntry("113730", "DCM", "Total Fluoro Time") +#define CODE_DCM_TotalNumberOfRadiographicFrames DSRBasicCodedEntry("113731", "DCM", "Total Number of Radiographic Frames") +#define CODE_DCM_FluoroMode DSRBasicCodedEntry("113732", "DCM", "Fluoro Mode") +#define CODE_DCM_KVP DSRBasicCodedEntry("113733", "DCM", "KVP") +#define CODE_DCM_XRayTubeCurrent DSRBasicCodedEntry("113734", "DCM", "X-Ray Tube Current") +#define CODE_DCM_RETIRED_ExposureTime DSRBasicCodedEntry("113735", "DCM", "Exposure Time") +#define CODE_DCM_Exposure DSRBasicCodedEntry("113736", "DCM", "Exposure") +#define CODE_DCM_DistanceSourceToReferencePoint DSRBasicCodedEntry("113737", "DCM", "Distance Source to Reference Point") +#define CODE_DCM_Dose_RP DSRBasicCodedEntry("113738", "DCM", "Dose (RP)") +#define CODE_DCM_PositionerPrimaryEndAngle DSRBasicCodedEntry("113739", "DCM", "Positioner Primary End Angle") +#define CODE_DCM_PositionerSecondaryEndAngle DSRBasicCodedEntry("113740", "DCM", "Positioner Secondary End Angle") +#define CODE_DCM_IrradiationDuration DSRBasicCodedEntry("113742", "DCM", "Irradiation Duration") +#define CODE_DCM_PatientOrientation DSRBasicCodedEntry("113743", "DCM", "Patient Orientation") +#define CODE_DCM_PatientOrientationModifier DSRBasicCodedEntry("113744", "DCM", "Patient Orientation Modifier") +#define CODE_DCM_PatientTableRelationship DSRBasicCodedEntry("113745", "DCM", "Patient Table Relationship") +#define CODE_DCM_DistanceSourceToIsocenter DSRBasicCodedEntry("113748", "DCM", "Distance Source to Isocenter") +#define CODE_DCM_DistanceSourceToDetector DSRBasicCodedEntry("113750", "DCM", "Distance Source to Detector") +#define CODE_DCM_TableLongitudinalPosition DSRBasicCodedEntry("113751", "DCM", "Table Longitudinal Position") +#define CODE_DCM_TableLateralPosition DSRBasicCodedEntry("113752", "DCM", "Table Lateral Position") +#define CODE_DCM_TableHeightPosition DSRBasicCodedEntry("113753", "DCM", "Table Height Position") +#define CODE_DCM_TableHeadTiltAngle DSRBasicCodedEntry("113754", "DCM", "Table Head Tilt Angle") +#define CODE_DCM_TableHorizontalRotationAngle DSRBasicCodedEntry("113755", "DCM", "Table Horizontal Rotation Angle") +#define CODE_DCM_TableCradleTiltAngle DSRBasicCodedEntry("113756", "DCM", "Table Cradle Tilt Angle") +#define CODE_DCM_XRayFilterMaterial DSRBasicCodedEntry("113757", "DCM", "X-Ray Filter Material") +#define CODE_DCM_XRayFilterThicknessMinimum DSRBasicCodedEntry("113758", "DCM", "X-Ray Filter Thickness Minimum") +#define CODE_DCM_TableLongitudinalEndPosition DSRBasicCodedEntry("113759", "DCM", "Table Longitudinal End Position") +#define CODE_DCM_TableLateralEndPosition DSRBasicCodedEntry("113760", "DCM", "Table Lateral End Position") +#define CODE_DCM_TableHeightEndPosition DSRBasicCodedEntry("113761", "DCM", "Table Height End Position") +#define CODE_DCM_CalibrationUncertainty DSRBasicCodedEntry("113763", "DCM", "Calibration Uncertainty") +#define CODE_DCM_AcquisitionPlane DSRBasicCodedEntry("113764", "DCM", "Acquisition Plane") +#define CODE_DCM_FocalSpotSize DSRBasicCodedEntry("113766", "DCM", "Focal Spot Size") +#define CODE_DCM_AverageXRayTubeCurrent DSRBasicCodedEntry("113767", "DCM", "Average X-Ray Tube Current") +#define CODE_DCM_NumberOfPulses DSRBasicCodedEntry("113768", "DCM", "Number of Pulses") +#define CODE_DCM_IrradiationEventUID DSRBasicCodedEntry("113769", "DCM", "Irradiation Event UID") +#define CODE_DCM_ColumnAngulation DSRBasicCodedEntry("113770", "DCM", "Column Angulation") +#define CODE_DCM_XRayFilters DSRBasicCodedEntry("113771", "DCM", "X-Ray Filters") +#define CODE_DCM_XRayFilterType DSRBasicCodedEntry("113772", "DCM", "X-Ray Filter Type") +#define CODE_DCM_XRayFilterThicknessMaximum DSRBasicCodedEntry("113773", "DCM", "X-Ray Filter Thickness Maximum") +#define CODE_DCM_ReferencePointDefinition DSRBasicCodedEntry("113780", "DCM", "Reference Point Definition") +#define CODE_DCM_CollimatedFieldHeight DSRBasicCodedEntry("113788", "DCM", "Collimated Field Height") +#define CODE_DCM_CollimatedFieldWidth DSRBasicCodedEntry("113789", "DCM", "Collimated Field Width") +#define CODE_DCM_CollimatedFieldArea DSRBasicCodedEntry("113790", "DCM", "Collimated Field Area") +#define CODE_DCM_PulseRate DSRBasicCodedEntry("113791", "DCM", "Pulse Rate") +#define CODE_DCM_DistanceSourceToTablePlane DSRBasicCodedEntry("113792", "DCM", "Distance Source to Table Plane") +#define CODE_DCM_PulseWidth DSRBasicCodedEntry("113793", "DCM", "Pulse Width") +#define CODE_DCM_DoseMeasurementDevice DSRBasicCodedEntry("113794", "DCM", "Dose Measurement Device") +#define CODE_DCM_AcquiredImage DSRBasicCodedEntry("113795", "DCM", "Acquired Image") +#define CODE_DCM_DLPToEConversionViaMCComputation DSRBasicCodedEntry("113800", "DCM", "DLP to E conversion via MC computation") +#define CODE_DCM_CTDIfreeairToEConversionViaMCComputation DSRBasicCodedEntry("113801", "DCM", "CTDIfreeair to E conversion via MC computation") +#define CODE_DCM_DLPToEConversionViaMeasurement DSRBasicCodedEntry("113802", "DCM", "DLP to E conversion via measurement") +#define CODE_DCM_CTDIfreeairToEConversionViaMeasurement DSRBasicCodedEntry("113803", "DCM", "CTDIfreeair to E conversion via measurement") +#define CODE_DCM_SequencedAcquisition DSRBasicCodedEntry("113804", "DCM", "Sequenced Acquisition") +#define CODE_DCM_ConstantAngleAcquisition DSRBasicCodedEntry("113805", "DCM", "Constant Angle Acquisition") +#define CODE_DCM_StationaryAcquisition_113806 DSRBasicCodedEntry("113806", "DCM", "Stationary Acquisition") +#define CODE_DCM_FreeAcquisition DSRBasicCodedEntry("113807", "DCM", "Free Acquisition") +#define CODE_DCM_ICRPPub60 DSRBasicCodedEntry("113808", "DCM", "ICRP Pub 60") +#define CODE_DCM_StartOfXRayIrradiation DSRBasicCodedEntry("113809", "DCM", "Start of X-Ray Irradiation") +#define CODE_DCM_EndOfXRayIrradiation DSRBasicCodedEntry("113810", "DCM", "End of X-Ray Irradiation") +#define CODE_DCM_CTAccumulatedDoseData DSRBasicCodedEntry("113811", "DCM", "CT Accumulated Dose Data") +#define CODE_DCM_TotalNumberOfIrradiationEvents DSRBasicCodedEntry("113812", "DCM", "Total Number of Irradiation Events") +#define CODE_DCM_CTDoseLengthProductTotal DSRBasicCodedEntry("113813", "DCM", "CT Dose Length Product Total") +#define CODE_DCM_CTEffectiveDoseTotal DSRBasicCodedEntry("113814", "DCM", "CT Effective Dose Total") +#define CODE_DCM_PatientModel DSRBasicCodedEntry("113815", "DCM", "Patient Model") +#define CODE_DCM_ConditionEffectiveDoseMeasured DSRBasicCodedEntry("113816", "DCM", "Condition Effective Dose measured") +#define CODE_DCM_EffectiveDosePhantomType DSRBasicCodedEntry("113817", "DCM", "Effective Dose Phantom Type") +#define CODE_DCM_DosimeterType DSRBasicCodedEntry("113818", "DCM", "Dosimeter Type") +#define CODE_DCM_CTAcquisition DSRBasicCodedEntry("113819", "DCM", "CT Acquisition") +#define CODE_DCM_CTAcquisitionType DSRBasicCodedEntry("113820", "DCM", "CT Acquisition Type") +#define CODE_DCM_XRayFilterAluminumEquivalent DSRBasicCodedEntry("113821", "DCM", "X-Ray Filter Aluminum Equivalent") +#define CODE_DCM_CTAcquisitionParameters DSRBasicCodedEntry("113822", "DCM", "CT Acquisition Parameters") +#define CODE_DCM_NumberOfXRaySources DSRBasicCodedEntry("113823", "DCM", "Number of X-Ray Sources") +#define CODE_DCM_ExposureTime DSRBasicCodedEntry("113824", "DCM", "Exposure Time") +#define CODE_DCM_ScanningLength DSRBasicCodedEntry("113825", "DCM", "Scanning Length") +#define CODE_DCM_NominalSingleCollimationWidth DSRBasicCodedEntry("113826", "DCM", "Nominal Single Collimation Width") +#define CODE_DCM_NominalTotalCollimationWidth DSRBasicCodedEntry("113827", "DCM", "Nominal Total Collimation Width") +#define CODE_DCM_PitchFactor DSRBasicCodedEntry("113828", "DCM", "Pitch Factor") +#define CODE_DCM_CTDose DSRBasicCodedEntry("113829", "DCM", "CT Dose") +#define CODE_DCM_MeanCTDIvol DSRBasicCodedEntry("113830", "DCM", "Mean CTDIvol") +#define CODE_DCM_CTXRaySourceParameters DSRBasicCodedEntry("113831", "DCM", "CT X-Ray Source Parameters") +#define CODE_DCM_IdentificationOfTheXRaySource DSRBasicCodedEntry("113832", "DCM", "Identification of the X-Ray Source") +#define CODE_DCM_MaximumXRayTubeCurrent DSRBasicCodedEntry("113833", "DCM", "Maximum X-Ray Tube Current") +#define CODE_DCM_ExposureTimePerRotation DSRBasicCodedEntry("113834", "DCM", "Exposure Time per Rotation") +#define CODE_DCM_CTDIwPhantomType DSRBasicCodedEntry("113835", "DCM", "CTDIw Phantom Type") +#define CODE_DCM_CTDIfreeairCalculationFactor DSRBasicCodedEntry("113836", "DCM", "CTDIfreeair Calculation Factor") +#define CODE_DCM_MeanCTDIfreeair DSRBasicCodedEntry("113837", "DCM", "Mean CTDIfreeair") +#define CODE_DCM_DLP DSRBasicCodedEntry("113838", "DCM", "DLP") +#define CODE_DCM_EffectiveDose DSRBasicCodedEntry("113839", "DCM", "Effective Dose") +#define CODE_DCM_EffectiveDoseConversionFactor DSRBasicCodedEntry("113840", "DCM", "Effective Dose Conversion Factor") +#define CODE_DCM_ICRPPub103 DSRBasicCodedEntry("113841", "DCM", "ICRP Pub 103") +#define CODE_DCM_XRayModulationType DSRBasicCodedEntry("113842", "DCM", "X-Ray Modulation Type") +#define CODE_DCM_ExposureIndex DSRBasicCodedEntry("113845", "DCM", "Exposure Index") +#define CODE_DCM_TargetExposureIndex DSRBasicCodedEntry("113846", "DCM", "Target Exposure Index") +#define CODE_DCM_DeviationIndex DSRBasicCodedEntry("113847", "DCM", "Deviation Index") +#define CODE_DCM_IrradiationAuthorizing DSRBasicCodedEntry("113850", "DCM", "Irradiation Authorizing") +#define CODE_DCM_IrradiationAdministering DSRBasicCodedEntry("113851", "DCM", "Irradiation Administering") +#define CODE_DCM_IrradiationEvent DSRBasicCodedEntry("113852", "DCM", "Irradiation Event") +#define CODE_DCM_RETIRED_IrradiationEventUID DSRBasicCodedEntry("113853", "DCM", "Irradiation Event UID") +#define CODE_DCM_SourceOfDoseInformation DSRBasicCodedEntry("113854", "DCM", "Source of Dose Information") +#define CODE_DCM_TotalAcquisitionTime DSRBasicCodedEntry("113855", "DCM", "Total Acquisition Time") +#define CODE_DCM_AutomatedDataCollection DSRBasicCodedEntry("113856", "DCM", "Automated Data Collection") +#define CODE_DCM_ManualEntry DSRBasicCodedEntry("113857", "DCM", "Manual Entry") +#define CODE_DCM_MPPSContent DSRBasicCodedEntry("113858", "DCM", "MPPS Content") +#define CODE_DCM_IrradiatingDevice DSRBasicCodedEntry("113859", "DCM", "Irradiating Device") +#define CODE_DCM_15cmFromIsocenterTowardSource DSRBasicCodedEntry("113860", "DCM", "15cm from Isocenter toward Source") +#define CODE_DCM_30cmInFrontOfImageInputSurface DSRBasicCodedEntry("113861", "DCM", "30cm in Front of Image Input Surface") +#define CODE_DCM_1cmAboveTabletop DSRBasicCodedEntry("113862", "DCM", "1cm above Tabletop") +#define CODE_DCM_30cmAboveTabletop DSRBasicCodedEntry("113863", "DCM", "30cm above Tabletop") +#define CODE_DCM_15cmFromTableCenterline DSRBasicCodedEntry("113864", "DCM", "15cm from Table Centerline") +#define CODE_DCM_EntranceExposureToA4dot2cmBreastThickness DSRBasicCodedEntry("113865", "DCM", "Entrance exposure to a 4.2 cm breast thickness") +#define CODE_DCM_CopiedFromImageAttributes DSRBasicCodedEntry("113866", "DCM", "Copied From Image Attributes") +#define CODE_DCM_ComputedFromImageAttributes DSRBasicCodedEntry("113867", "DCM", "Computed From Image Attributes") +#define CODE_DCM_DerivedFromHumanReadableReports DSRBasicCodedEntry("113868", "DCM", "Derived From Human-Readable Reports") +#define CODE_DCM_PersonName DSRBasicCodedEntry("113870", "DCM", "Person Name") +#define CODE_DCM_PersonID DSRBasicCodedEntry("113871", "DCM", "Person ID") +#define CODE_DCM_PersonIDIssuer DSRBasicCodedEntry("113872", "DCM", "Person ID Issuer") +#define CODE_DCM_OrganizationName DSRBasicCodedEntry("113873", "DCM", "Organization Name") +#define CODE_DCM_PersonRoleInOrganization DSRBasicCodedEntry("113874", "DCM", "Person Role in Organization") +#define CODE_DCM_PersonRoleInProcedure DSRBasicCodedEntry("113875", "DCM", "Person Role in Procedure") +#define CODE_DCM_DeviceRoleInProcedure DSRBasicCodedEntry("113876", "DCM", "Device Role in Procedure") +#define CODE_DCM_DeviceName DSRBasicCodedEntry("113877", "DCM", "Device Name") +#define CODE_DCM_DeviceManufacturer DSRBasicCodedEntry("113878", "DCM", "Device Manufacturer") +#define CODE_DCM_DeviceModelName DSRBasicCodedEntry("113879", "DCM", "Device Model Name") +#define CODE_DCM_DeviceSerialNumber DSRBasicCodedEntry("113880", "DCM", "Device Serial Number") +#define CODE_DCM_AllPlanes DSRBasicCodedEntry("113890", "DCM", "All Planes") +#define CODE_DCM_LengthOfReconstructableVolume DSRBasicCodedEntry("113893", "DCM", "Length of Reconstructable Volume") +#define CODE_DCM_TopZLocationOfReconstructableVolume DSRBasicCodedEntry("113895", "DCM", "Top Z Location of Reconstructable Volume") +#define CODE_DCM_BottomZLocationOfReconstructableVolume DSRBasicCodedEntry("113896", "DCM", "Bottom Z Location of Reconstructable Volume") +#define CODE_DCM_TopZLocationOfScanningLength DSRBasicCodedEntry("113897", "DCM", "Top Z Location of Scanning Length") +#define CODE_DCM_BottomZLocationOfScanningLength DSRBasicCodedEntry("113898", "DCM", "Bottom Z Location of Scanning Length") +#define CODE_DCM_ExposedRange DSRBasicCodedEntry("113899", "DCM", "Exposed Range") +#define CODE_DCM_DoseCheckAlertDetails DSRBasicCodedEntry("113900", "DCM", "Dose Check Alert Details") +#define CODE_DCM_DLPAlertValueConfigured DSRBasicCodedEntry("113901", "DCM", "DLP Alert Value Configured") +#define CODE_DCM_CTDIvolAlertValueConfigured DSRBasicCodedEntry("113902", "DCM", "CTDIvol Alert Value Configured") +#define CODE_DCM_DLPAlertValue DSRBasicCodedEntry("113903", "DCM", "DLP Alert Value") +#define CODE_DCM_CTDIvolAlertValue DSRBasicCodedEntry("113904", "DCM", "CTDIvol Alert Value") +#define CODE_DCM_AccumulatedDLPForwardEstimate DSRBasicCodedEntry("113905", "DCM", "Accumulated DLP Forward Estimate") +#define CODE_DCM_AccumulatedCTDIvolForwardEstimate DSRBasicCodedEntry("113906", "DCM", "Accumulated CTDIvol Forward Estimate") +#define CODE_DCM_ReasonForProceeding DSRBasicCodedEntry("113907", "DCM", "Reason for Proceeding") +#define CODE_DCM_DoseCheckNotificationDetails DSRBasicCodedEntry("113908", "DCM", "Dose Check Notification Details") +#define CODE_DCM_DLPNotificationValueConfigured DSRBasicCodedEntry("113909", "DCM", "DLP Notification Value Configured") +#define CODE_DCM_CTDIvolNotificationValueConfigured DSRBasicCodedEntry("113910", "DCM", "CTDIvol Notification Value Configured") +#define CODE_DCM_DLPNotificationValue DSRBasicCodedEntry("113911", "DCM", "DLP Notification Value") +#define CODE_DCM_CTDIvolNotificationValue DSRBasicCodedEntry("113912", "DCM", "CTDIvol Notification Value") +#define CODE_DCM_DLPForwardEstimate DSRBasicCodedEntry("113913", "DCM", "DLP Forward Estimate") +#define CODE_DCM_CTDIvolForwardEstimate DSRBasicCodedEntry("113914", "DCM", "CTDIvol Forward Estimate") +#define CODE_DCM_RadiationExposure DSRBasicCodedEntry("113921", "DCM", "Radiation Exposure") +#define CODE_DCM_RETIRED_RadioactiveSubstanceAdministered DSRBasicCodedEntry("113922", "DCM", "Radioactive Substance Administered") +#define CODE_DCM_RETIRED_RadiationExposureAndProtectionInformation DSRBasicCodedEntry("113923", "DCM", "Radiation Exposure and Protection Information") +#define CODE_DCM_SizeSpecificDoseEstimation DSRBasicCodedEntry("113930", "DCM", "Size Specific Dose Estimation") +#define CODE_DCM_MeasuredLateralDimension DSRBasicCodedEntry("113931", "DCM", "Measured Lateral Dimension") +#define CODE_DCM_MeasuredAPDimension DSRBasicCodedEntry("113932", "DCM", "Measured AP Dimension") +#define CODE_DCM_DerivedEffectiveDiameter DSRBasicCodedEntry("113933", "DCM", "Derived Effective Diameter") +#define CODE_DCM_AAPM204LateralDimension DSRBasicCodedEntry("113934", "DCM", "AAPM 204 Lateral Dimension") +#define CODE_DCM_AAPM204APDimension DSRBasicCodedEntry("113935", "DCM", "AAPM 204 AP Dimension") +#define CODE_DCM_AAPM204SumOfLateralAndAPDimension DSRBasicCodedEntry("113936", "DCM", "AAPM 204 Sum of Lateral and AP Dimension") +#define CODE_DCM_AAPM204EffectiveDiameterEstimatedFromPatientAge DSRBasicCodedEntry("113937", "DCM", "AAPM 204 Effective Diameter Estimated From Patient Age") +#define CODE_DCM_SystemCalculated DSRBasicCodedEntry("113940", "DCM", "System Calculated") +#define CODE_DCM_InDetectorPlane DSRBasicCodedEntry("113941", "DCM", "In Detector Plane") +#define CODE_DCM_XRayReadingDevice DSRBasicCodedEntry("113942", "DCM", "X-Ray Reading Device") +#define CODE_DCM_XRaySourceDataAvailable DSRBasicCodedEntry("113943", "DCM", "X-Ray Source Data Available") +#define CODE_DCM_XRayMechanicalDataAvailable DSRBasicCodedEntry("113944", "DCM", "X-Ray Mechanical Data Available") +#define CODE_DCM_XRayDetectorDataAvailable DSRBasicCodedEntry("113945", "DCM", "X-Ray Detector Data Available") +#define CODE_DCM_ProjectionEponymousName DSRBasicCodedEntry("113946", "DCM", "Projection Eponymous Name") +#define CODE_DCM_DetectorType DSRBasicCodedEntry("113947", "DCM", "Detector Type") +#define CODE_DCM_DirectDetector DSRBasicCodedEntry("113948", "DCM", "Direct Detector") +#define CODE_DCM_IndirectDetector DSRBasicCodedEntry("113949", "DCM", "Indirect Detector") +#define CODE_DCM_StorageDetector DSRBasicCodedEntry("113950", "DCM", "Storage Detector") +#define CODE_DCM_Film_113951 DSRBasicCodedEntry("113951", "DCM", "Film") +#define CODE_DCM_TableMount DSRBasicCodedEntry("113952", "DCM", "Table Mount") +#define CODE_DCM_UnmountedDetector DSRBasicCodedEntry("113953", "DCM", "Unmounted Detector") +#define CODE_DCM_UprightStandMount DSRBasicCodedEntry("113954", "DCM", "Upright Stand Mount") +#define CODE_DCM_CArmMount DSRBasicCodedEntry("113955", "DCM", "C-Arm Mount") +#define CODE_DCM_CRDRMechanicalConfiguration DSRBasicCodedEntry("113956", "DCM", "CR/DR Mechanical Configuration") +#define CODE_DCM_FluoroscopyGuidedProjectionRadiographySystem DSRBasicCodedEntry("113957", "DCM", "Fluoroscopy-Guided Projection Radiography System") +#define CODE_DCM_IntegratedProjectionRadiographySystem DSRBasicCodedEntry("113958", "DCM", "Integrated Projection Radiography System") +#define CODE_DCM_CassetteBasedProjectionRadiographySystem DSRBasicCodedEntry("113959", "DCM", "Cassette-based Projection Radiography System") +#define CODE_DCM_ReconstructionAlgorithm DSRBasicCodedEntry("113961", "DCM", "Reconstruction Algorithm") +#define CODE_DCM_FilteredBackProjection DSRBasicCodedEntry("113962", "DCM", "Filtered Back Projection") +#define CODE_DCM_IterativeReconstruction DSRBasicCodedEntry("113963", "DCM", "Iterative Reconstruction") +#define CODE_DCM_AtSurfaceOfPatient DSRBasicCodedEntry("113964", "DCM", "At Surface of Patient") +#define CODE_DCM_ProcedureStepToThisPoint DSRBasicCodedEntry("113970", "DCM", "Procedure Step To This Point") +#define CODE_DCM_WaterEquivalentDiameter DSRBasicCodedEntry("113980", "DCM", "Water Equivalent Diameter") +#define CODE_DCM_WaterEquivalentDiameterRepresentativeValue DSRBasicCodedEntry("113981", "DCM", "Water Equivalent Diameter Representative Value") +#define CODE_DCM_WaterEquivalentDiameterIntegratedAcrossScanRange DSRBasicCodedEntry("113982", "DCM", "Water Equivalent Diameter Integrated Across Scan Range") +#define CODE_DCM_WaterEquivalentDiameterFromRawData DSRBasicCodedEntry("113983", "DCM", "Water Equivalent Diameter From Raw Data") +#define CODE_DCM_WaterEquivalentDiameterFromLocalizer DSRBasicCodedEntry("113984", "DCM", "Water Equivalent Diameter From Localizer") +#define CODE_DCM_SeriesOrInstanceUsedForWaterEquivalentDiameterEstimation DSRBasicCodedEntry("113985", "DCM", "Series or Instance used for Water Equivalent Diameter estimation") +#define CODE_DCM_ZValueOfLocationOfWaterEquivalentDiameterEstimation DSRBasicCodedEntry("113986", "DCM", "Z value of location of Water Equivalent Diameter estimation") +#define CODE_DCM_AAPM220 DSRBasicCodedEntry("113987", "DCM", "AAPM 220") +#define CODE_DCM_NotANumber DSRBasicCodedEntry("114000", "DCM", "Not a number") +#define CODE_DCM_NegativeInfinity DSRBasicCodedEntry("114001", "DCM", "Negative Infinity") +#define CODE_DCM_PositiveInfinity DSRBasicCodedEntry("114002", "DCM", "Positive Infinity") +#define CODE_DCM_DivideByZero DSRBasicCodedEntry("114003", "DCM", "Divide by zero") +#define CODE_DCM_Underflow DSRBasicCodedEntry("114004", "DCM", "Underflow") +#define CODE_DCM_Overflow DSRBasicCodedEntry("114005", "DCM", "Overflow") +#define CODE_DCM_MeasurementFailure DSRBasicCodedEntry("114006", "DCM", "Measurement failure") +#define CODE_DCM_MeasurementNotAttempted DSRBasicCodedEntry("114007", "DCM", "Measurement not attempted") +#define CODE_DCM_CalculationFailure DSRBasicCodedEntry("114008", "DCM", "Calculation failure") +#define CODE_DCM_ValueOutOfRange DSRBasicCodedEntry("114009", "DCM", "Value out of range") +#define CODE_DCM_ValueUnknown DSRBasicCodedEntry("114010", "DCM", "Value unknown") +#define CODE_DCM_ValueIndeterminate DSRBasicCodedEntry("114011", "DCM", "Value indeterminate") +#define CODE_DCM_TimeOfFlight DSRBasicCodedEntry("114201", "DCM", "Time of flight") +#define CODE_DCM_Interferometry DSRBasicCodedEntry("114202", "DCM", "Interferometry") +#define CODE_DCM_LaserScanning DSRBasicCodedEntry("114203", "DCM", "Laser scanning") +#define CODE_DCM_PatternProjection DSRBasicCodedEntry("114204", "DCM", "Pattern projection") +#define CODE_DCM_ShapeFromShading DSRBasicCodedEntry("114205", "DCM", "Shape from shading") +#define CODE_DCM_ShapeFromMotion DSRBasicCodedEntry("114206", "DCM", "Shape from motion") +#define CODE_DCM_ConfocalImaging DSRBasicCodedEntry("114207", "DCM", "Confocal imaging") +#define CODE_DCM_PointCloudAlgorithmic DSRBasicCodedEntry("114208", "DCM", "Point Cloud Algorithmic") +#define CODE_DCM_TurntableScanMethod DSRBasicCodedEntry("114209", "DCM", "Turntable Scan Method") +#define CODE_DCM_HighResolution DSRBasicCodedEntry("114210", "DCM", "High resolution") +#define CODE_DCM_FastMode DSRBasicCodedEntry("114211", "DCM", "Fast mode") +#define CODE_DCM_IterativeClosestPoint DSRBasicCodedEntry("114213", "DCM", "Iterative Closest Point") +#define CODE_DCM_Freehand DSRBasicCodedEntry("114215", "DCM", "Freehand") +#define CODE_DCM_Checkerboard DSRBasicCodedEntry("114216", "DCM", "Checkerboard") +#define CODE_DCM_QuotationMode DSRBasicCodedEntry("121001", "DCM", "Quotation Mode") +#define CODE_DCM_QuotedSource DSRBasicCodedEntry("121002", "DCM", "Quoted Source") +#define CODE_DCM_Document_121003 DSRBasicCodedEntry("121003", "DCM", "Document") +#define CODE_DCM_Verbal DSRBasicCodedEntry("121004", "DCM", "Verbal") +#define CODE_DCM_ObserverType DSRBasicCodedEntry("121005", "DCM", "Observer Type") +#define CODE_DCM_Person DSRBasicCodedEntry("121006", "DCM", "Person") +#define CODE_DCM_Device DSRBasicCodedEntry("121007", "DCM", "Device") +#define CODE_DCM_PersonObserverName DSRBasicCodedEntry("121008", "DCM", "Person Observer Name") +#define CODE_DCM_PersonObserverOrganizationName DSRBasicCodedEntry("121009", "DCM", "Person Observer's Organization Name") +#define CODE_DCM_PersonObserverRoleInTheOrganization DSRBasicCodedEntry("121010", "DCM", "Person Observer's Role in the Organization") +#define CODE_DCM_PersonObserverRoleInThisProcedure DSRBasicCodedEntry("121011", "DCM", "Person Observer's Role in this Procedure") +#define CODE_DCM_DeviceObserverUID DSRBasicCodedEntry("121012", "DCM", "Device Observer UID") +#define CODE_DCM_DeviceObserverName DSRBasicCodedEntry("121013", "DCM", "Device Observer Name") +#define CODE_DCM_DeviceObserverManufacturer DSRBasicCodedEntry("121014", "DCM", "Device Observer Manufacturer") +#define CODE_DCM_DeviceObserverModelName DSRBasicCodedEntry("121015", "DCM", "Device Observer Model Name") +#define CODE_DCM_DeviceObserverSerialNumber DSRBasicCodedEntry("121016", "DCM", "Device Observer Serial Number") +#define CODE_DCM_DeviceObserverPhysicalLocationDuringObservation DSRBasicCodedEntry("121017", "DCM", "Device Observer Physical Location During Observation") +#define CODE_DCM_ProcedureStudyInstanceUID DSRBasicCodedEntry("121018", "DCM", "Procedure Study Instance UID") +#define CODE_DCM_ProcedureStudyComponentUID DSRBasicCodedEntry("121019", "DCM", "Procedure Study Component UID") +#define CODE_DCM_PlacerNumber DSRBasicCodedEntry("121020", "DCM", "Placer Number") +#define CODE_DCM_FillerNumber DSRBasicCodedEntry("121021", "DCM", "Filler Number") +#define CODE_DCM_AccessionNumber DSRBasicCodedEntry("121022", "DCM", "Accession Number") +#define CODE_DCM_ProcedureCode DSRBasicCodedEntry("121023", "DCM", "Procedure Code") +#define CODE_DCM_SubjectClass DSRBasicCodedEntry("121024", "DCM", "Subject Class") +#define CODE_DCM_Patient DSRBasicCodedEntry("121025", "DCM", "Patient") +#define CODE_DCM_Fetus DSRBasicCodedEntry("121026", "DCM", "Fetus") +#define CODE_DCM_Specimen DSRBasicCodedEntry("121027", "DCM", "Specimen") +#define CODE_DCM_SubjectUID DSRBasicCodedEntry("121028", "DCM", "Subject UID") +#define CODE_DCM_SubjectName DSRBasicCodedEntry("121029", "DCM", "Subject Name") +#define CODE_DCM_SubjectID DSRBasicCodedEntry("121030", "DCM", "Subject ID") +#define CODE_DCM_SubjectBirthDate DSRBasicCodedEntry("121031", "DCM", "Subject Birth Date") +#define CODE_DCM_SubjectSex DSRBasicCodedEntry("121032", "DCM", "Subject Sex") +#define CODE_DCM_SubjectAge DSRBasicCodedEntry("121033", "DCM", "Subject Age") +#define CODE_DCM_SubjectSpecies DSRBasicCodedEntry("121034", "DCM", "Subject Species") +#define CODE_DCM_SubjectBreed DSRBasicCodedEntry("121035", "DCM", "Subject Breed") +#define CODE_DCM_MotherOfFetus DSRBasicCodedEntry("121036", "DCM", "Mother of fetus") +#define CODE_DCM_RETIRED_FetusNumber DSRBasicCodedEntry("121037", "DCM", "Fetus number") +#define CODE_DCM_RETIRED_NumberOfFetuses DSRBasicCodedEntry("121038", "DCM", "Number of Fetuses") +#define CODE_DCM_SpecimenUID DSRBasicCodedEntry("121039", "DCM", "Specimen UID") +#define CODE_DCM_RETIRED_SpecimenAccessionNumber DSRBasicCodedEntry("121040", "DCM", "Specimen Accession Number") +#define CODE_DCM_SpecimenIdentifier DSRBasicCodedEntry("121041", "DCM", "Specimen Identifier") +#define CODE_DCM_RETIRED_SpecimenType DSRBasicCodedEntry("121042", "DCM", "Specimen Type") +#define CODE_DCM_RETIRED_SlideIdentifier DSRBasicCodedEntry("121043", "DCM", "Slide Identifier") +#define CODE_DCM_RETIRED_SlideUID DSRBasicCodedEntry("121044", "DCM", "Slide UID") +#define CODE_DCM_Language DSRBasicCodedEntry("121045", "DCM", "Language") +#define CODE_DCM_CountryOfLanguage DSRBasicCodedEntry("121046", "DCM", "Country of Language") +#define CODE_DCM_LanguageOfValue DSRBasicCodedEntry("121047", "DCM", "Language of Value") +#define CODE_DCM_LanguageOfNameAndValue DSRBasicCodedEntry("121048", "DCM", "Language of Name and Value") +#define CODE_DCM_LanguageOfContentItemAndDescendants DSRBasicCodedEntry("121049", "DCM", "Language of Content Item and Descendants") +#define CODE_DCM_EquivalentMeaningOfConceptName DSRBasicCodedEntry("121050", "DCM", "Equivalent Meaning of Concept Name") +#define CODE_DCM_EquivalentMeaningOfValue DSRBasicCodedEntry("121051", "DCM", "Equivalent Meaning of Value") +#define CODE_DCM_PresenceOfProperty DSRBasicCodedEntry("121052", "DCM", "Presence of property") +#define CODE_DCM_RETIRED_Present DSRBasicCodedEntry("121053", "DCM", "Present") +#define CODE_DCM_RETIRED_Absent DSRBasicCodedEntry("121054", "DCM", "Absent") +#define CODE_DCM_Path DSRBasicCodedEntry("121055", "DCM", "Path") +#define CODE_DCM_AreaOutline DSRBasicCodedEntry("121056", "DCM", "Area outline") +#define CODE_DCM_PerimeterOutline DSRBasicCodedEntry("121057", "DCM", "Perimeter outline") +#define CODE_DCM_ProcedureReported DSRBasicCodedEntry("121058", "DCM", "Procedure reported") +#define CODE_DCM_RETIRED_PresenceUndetermined DSRBasicCodedEntry("121059", "DCM", "Presence Undetermined") +#define CODE_DCM_RETIRED_History DSRBasicCodedEntry("121060", "DCM", "History") +#define CODE_DCM_RETIRED_Request DSRBasicCodedEntry("121062", "DCM", "Request") +#define CODE_DCM_RETIRED_CurrentProcedureDescriptions DSRBasicCodedEntry("121064", "DCM", "Current Procedure Descriptions") +#define CODE_DCM_ProcedureDescription DSRBasicCodedEntry("121065", "DCM", "Procedure Description") +#define CODE_DCM_RETIRED_PriorProcedureDescriptions DSRBasicCodedEntry("121066", "DCM", "Prior Procedure Descriptions") +#define CODE_DCM_RETIRED_PreviousFindings DSRBasicCodedEntry("121068", "DCM", "Previous Findings") +#define CODE_DCM_PreviousFinding DSRBasicCodedEntry("121069", "DCM", "Previous Finding") +#define CODE_DCM_RETIRED_Findings DSRBasicCodedEntry("121070", "DCM", "Findings") +#define CODE_DCM_Finding DSRBasicCodedEntry("121071", "DCM", "Finding") +#define CODE_DCM_RETIRED_Impressions DSRBasicCodedEntry("121072", "DCM", "Impressions") +#define CODE_DCM_Impression DSRBasicCodedEntry("121073", "DCM", "Impression") +#define CODE_DCM_RETIRED_Recommendations DSRBasicCodedEntry("121074", "DCM", "Recommendations") +#define CODE_DCM_Recommendation DSRBasicCodedEntry("121075", "DCM", "Recommendation") +#define CODE_DCM_RETIRED_Conclusions DSRBasicCodedEntry("121076", "DCM", "Conclusions") +#define CODE_DCM_Conclusion DSRBasicCodedEntry("121077", "DCM", "Conclusion") +#define CODE_DCM_RETIRED_Addendum DSRBasicCodedEntry("121078", "DCM", "Addendum") +#define CODE_DCM_Baseline DSRBasicCodedEntry("121079", "DCM", "Baseline") +#define CODE_DCM_BestIllustrationOfFinding DSRBasicCodedEntry("121080", "DCM", "Best illustration of finding") +#define CODE_DCM_RETIRED_Physician DSRBasicCodedEntry("121081", "DCM", "Physician") +#define CODE_DCM_RETIRED_Nurse DSRBasicCodedEntry("121082", "DCM", "Nurse") +#define CODE_DCM_RETIRED_Technologist DSRBasicCodedEntry("121083", "DCM", "Technologist") +#define CODE_DCM_RETIRED_Radiographer DSRBasicCodedEntry("121084", "DCM", "Radiographer") +#define CODE_DCM_RETIRED_Intern DSRBasicCodedEntry("121085", "DCM", "Intern") +#define CODE_DCM_RETIRED_Resident DSRBasicCodedEntry("121086", "DCM", "Resident") +#define CODE_DCM_RETIRED_Registrar DSRBasicCodedEntry("121087", "DCM", "Registrar") +#define CODE_DCM_Fellow DSRBasicCodedEntry("121088", "DCM", "Fellow") +#define CODE_DCM_RETIRED_AttendingConsultant DSRBasicCodedEntry("121089", "DCM", "Attending [Consultant]") +#define CODE_DCM_RETIRED_ScrubNurse DSRBasicCodedEntry("121090", "DCM", "Scrub nurse") +#define CODE_DCM_RETIRED_Surgeon DSRBasicCodedEntry("121091", "DCM", "Surgeon") +#define CODE_DCM_Sonologist DSRBasicCodedEntry("121092", "DCM", "Sonologist") +#define CODE_DCM_RETIRED_Sonographer DSRBasicCodedEntry("121093", "DCM", "Sonographer") +#define CODE_DCM_Performing DSRBasicCodedEntry("121094", "DCM", "Performing") +#define CODE_DCM_RETIRED_Referring DSRBasicCodedEntry("121095", "DCM", "Referring") +#define CODE_DCM_Requesting DSRBasicCodedEntry("121096", "DCM", "Requesting") +#define CODE_DCM_Recording DSRBasicCodedEntry("121097", "DCM", "Recording") +#define CODE_DCM_Verifying DSRBasicCodedEntry("121098", "DCM", "Verifying") +#define CODE_DCM_Assisting DSRBasicCodedEntry("121099", "DCM", "Assisting") +#define CODE_DCM_RETIRED_Circulating DSRBasicCodedEntry("121100", "DCM", "Circulating") +#define CODE_DCM_Standby DSRBasicCodedEntry("121101", "DCM", "Standby") +#define CODE_DCM_OtherSex DSRBasicCodedEntry("121102", "DCM", "Other sex") +#define CODE_DCM_UndeterminedSex DSRBasicCodedEntry("121103", "DCM", "Undetermined sex") +#define CODE_DCM_AmbiguousSex DSRBasicCodedEntry("121104", "DCM", "Ambiguous sex") +#define CODE_DCM_RETIRED_RadiationPhysicist DSRBasicCodedEntry("121105", "DCM", "Radiation Physicist") +#define CODE_DCM_Comment DSRBasicCodedEntry("121106", "DCM", "Comment") +#define CODE_DCM_RETIRED_IndicationsForProcedure DSRBasicCodedEntry("121109", "DCM", "Indications for Procedure") +#define CODE_DCM_RETIRED_PatientPresentation DSRBasicCodedEntry("121110", "DCM", "Patient Presentation") +#define CODE_DCM_RETIRED_Summary DSRBasicCodedEntry("121111", "DCM", "Summary") +#define CODE_DCM_SourceOfMeasurement DSRBasicCodedEntry("121112", "DCM", "Source of Measurement") +#define CODE_DCM_RETIRED_Complications DSRBasicCodedEntry("121113", "DCM", "Complications") +#define CODE_DCM_PerformingPhysician DSRBasicCodedEntry("121114", "DCM", "Performing Physician") +#define CODE_DCM_DischargeSummary DSRBasicCodedEntry("121115", "DCM", "Discharge Summary") +#define CODE_DCM_ProximalFindingSite DSRBasicCodedEntry("121116", "DCM", "Proximal Finding Site") +#define CODE_DCM_DistalFindingSite DSRBasicCodedEntry("121117", "DCM", "Distal Finding Site") +#define CODE_DCM_PatientCharacteristics DSRBasicCodedEntry("121118", "DCM", "Patient Characteristics") +#define CODE_DCM_CathLabProcedureLog DSRBasicCodedEntry("121120", "DCM", "Cath Lab Procedure Log") +#define CODE_DCM_RoomIdentification DSRBasicCodedEntry("121121", "DCM", "Room identification") +#define CODE_DCM_EquipmentIdentification DSRBasicCodedEntry("121122", "DCM", "Equipment Identification") +#define CODE_DCM_PatientStatusOrEvent DSRBasicCodedEntry("121123", "DCM", "Patient Status or Event") +#define CODE_DCM_ProcedureActionItemID DSRBasicCodedEntry("121124", "DCM", "Procedure Action Item ID") +#define CODE_DCM_DateTimeOfRecordingOfLogEntry DSRBasicCodedEntry("121125", "DCM", "DateTime of Recording of Log Entry") +#define CODE_DCM_PerformedProcedureStepSOPInstanceUID DSRBasicCodedEntry("121126", "DCM", "Performed Procedure Step SOP Instance UID") +#define CODE_DCM_PerformedProcedureStepSOPClassUID DSRBasicCodedEntry("121127", "DCM", "Performed Procedure Step SOP Class UID") +#define CODE_DCM_ProcedureActionDuration DSRBasicCodedEntry("121128", "DCM", "Procedure Action Duration") +#define CODE_DCM_StartProcedureActionItem DSRBasicCodedEntry("121130", "DCM", "Start Procedure Action Item") +#define CODE_DCM_EndProcedureActionItem DSRBasicCodedEntry("121131", "DCM", "End Procedure Action Item") +#define CODE_DCM_SuspendProcedureActionItem DSRBasicCodedEntry("121132", "DCM", "Suspend Procedure Action Item") +#define CODE_DCM_ResumeProcedureActionItem DSRBasicCodedEntry("121133", "DCM", "Resume Procedure Action Item") +#define CODE_DCM_ObservationDateTimeQualifier DSRBasicCodedEntry("121135", "DCM", "Observation DateTime Qualifier") +#define CODE_DCM_DateTimeUnsynchronized DSRBasicCodedEntry("121136", "DCM", "DateTime Unsynchronized") +#define CODE_DCM_DateTimeEstimated DSRBasicCodedEntry("121137", "DCM", "DateTime Estimated") +#define CODE_DCM_ImageAcquired DSRBasicCodedEntry("121138", "DCM", "Image Acquired") +#define CODE_DCM_Modality DSRBasicCodedEntry("121139", "DCM", "Modality") +#define CODE_DCM_NumberOfFrames DSRBasicCodedEntry("121140", "DCM", "Number of Frames") +#define CODE_DCM_ImageType DSRBasicCodedEntry("121141", "DCM", "Image Type") +#define CODE_DCM_AcquisitionDuration DSRBasicCodedEntry("121142", "DCM", "Acquisition Duration") +#define CODE_DCM_WaveformAcquired DSRBasicCodedEntry("121143", "DCM", "Waveform Acquired") +#define CODE_DCM_DocumentTitle DSRBasicCodedEntry("121144", "DCM", "Document Title") +#define CODE_DCM_DescriptionOfMaterial DSRBasicCodedEntry("121145", "DCM", "Description of Material") +#define CODE_DCM_QuantityOfMaterial DSRBasicCodedEntry("121146", "DCM", "Quantity of Material") +#define CODE_DCM_BillingCode DSRBasicCodedEntry("121147", "DCM", "Billing Code") +#define CODE_DCM_UnitSerialIdentifier DSRBasicCodedEntry("121148", "DCM", "Unit Serial Identifier") +#define CODE_DCM_LotIdentifier DSRBasicCodedEntry("121149", "DCM", "Lot Identifier") +#define CODE_DCM_DeviceCode DSRBasicCodedEntry("121150", "DCM", "Device Code") +#define CODE_DCM_LesionIdentifier DSRBasicCodedEntry("121151", "DCM", "Lesion Identifier") +#define CODE_DCM_PersonAdministeringDrugContrast DSRBasicCodedEntry("121152", "DCM", "Person administering drug/contrast") +#define CODE_DCM_LesionRisk DSRBasicCodedEntry("121153", "DCM", "Lesion Risk") +#define CODE_DCM_InterventionAttemptIdentifier DSRBasicCodedEntry("121154", "DCM", "Intervention attempt identifier") +#define CODE_DCM_Deployment DSRBasicCodedEntry("121155", "DCM", "Deployment") +#define CODE_DCM_PercutaneousEntryAction DSRBasicCodedEntry("121156", "DCM", "Percutaneous Entry Action") +#define CODE_DCM_BeginCirculatorySupport DSRBasicCodedEntry("121157", "DCM", "Begin Circulatory Support") +#define CODE_DCM_EndCirculatorySupport DSRBasicCodedEntry("121158", "DCM", "End Circulatory Support") +#define CODE_DCM_OxygenAdministrationRate DSRBasicCodedEntry("121160", "DCM", "Oxygen Administration Rate") +#define CODE_DCM_BeginOxygenAdministration DSRBasicCodedEntry("121161", "DCM", "Begin Oxygen Administration") +#define CODE_DCM_EndOxygenAdministration DSRBasicCodedEntry("121162", "DCM", "End oxygen administration") +#define CODE_DCM_ByVentilator DSRBasicCodedEntry("121163", "DCM", "By ventilator") +#define CODE_DCM_PatientAssessmentPerformed DSRBasicCodedEntry("121165", "DCM", "Patient Assessment Performed") +#define CODE_DCM_BeginPacing DSRBasicCodedEntry("121166", "DCM", "Begin Pacing") +#define CODE_DCM_EndPacing DSRBasicCodedEntry("121167", "DCM", "End Pacing") +#define CODE_DCM_BeginVentilation DSRBasicCodedEntry("121168", "DCM", "Begin Ventilation") +#define CODE_DCM_EndVentilation DSRBasicCodedEntry("121169", "DCM", "End Ventilation") +#define CODE_DCM_TechNote DSRBasicCodedEntry("121171", "DCM", "Tech Note") +#define CODE_DCM_NursingNote DSRBasicCodedEntry("121172", "DCM", "Nursing Note") +#define CODE_DCM_PhysicianNote DSRBasicCodedEntry("121173", "DCM", "Physician Note") +#define CODE_DCM_ProcedureNote DSRBasicCodedEntry("121174", "DCM", "Procedure Note") +#define CODE_DCM_RETIRED_KeyImages DSRBasicCodedEntry("121180", "DCM", "Key Images") +#define CODE_DCM_DICOMObjectCatalog DSRBasicCodedEntry("121181", "DCM", "DICOM Object Catalog") +#define CODE_DCM_ReferencedFrames DSRBasicCodedEntry("121190", "DCM", "Referenced Frames") +#define CODE_DCM_ReferencedSegment DSRBasicCodedEntry("121191", "DCM", "Referenced Segment") +#define CODE_DCM_DeviceSubject DSRBasicCodedEntry("121192", "DCM", "Device Subject") +#define CODE_DCM_DeviceSubjectName DSRBasicCodedEntry("121193", "DCM", "Device Subject Name") +#define CODE_DCM_DeviceSubjectManufacturer DSRBasicCodedEntry("121194", "DCM", "Device Subject Manufacturer") +#define CODE_DCM_DeviceSubjectModelName DSRBasicCodedEntry("121195", "DCM", "Device Subject Model Name") +#define CODE_DCM_DeviceSubjectSerialNumber DSRBasicCodedEntry("121196", "DCM", "Device Subject Serial Number") +#define CODE_DCM_DeviceSubjectPhysicalLocationDuringObservation DSRBasicCodedEntry("121197", "DCM", "Device Subject Physical Location during observation") +#define CODE_DCM_DeviceSubjectUID DSRBasicCodedEntry("121198", "DCM", "Device Subject UID") +#define CODE_DCM_IllustrationOfROI DSRBasicCodedEntry("121200", "DCM", "Illustration of ROI") +#define CODE_DCM_RETIRED_AreaOutline DSRBasicCodedEntry("121201", "DCM", "Area Outline") +#define CODE_DCM_RETIRED_AreaOfDefinedRegion DSRBasicCodedEntry("121202", "DCM", "Area of Defined Region") +#define CODE_DCM_Distance DSRBasicCodedEntry("121206", "DCM", "Distance") +#define CODE_DCM_Height DSRBasicCodedEntry("121207", "DCM", "Height") +#define CODE_DCM_InterMarkerDistance DSRBasicCodedEntry("121208", "DCM", "Inter-Marker Distance") +#define CODE_DCM_RETIRED_Path DSRBasicCodedEntry("121210", "DCM", "Path") +#define CODE_DCM_PathLength DSRBasicCodedEntry("121211", "DCM", "Path length") +#define CODE_DCM_RETIRED_PerimeterOutline DSRBasicCodedEntry("121213", "DCM", "Perimeter Outline") +#define CODE_DCM_ReferencedSegmentationFrame DSRBasicCodedEntry("121214", "DCM", "Referenced Segmentation Frame") +#define CODE_DCM_VolumeEstimatedFromSingle2DRegion DSRBasicCodedEntry("121216", "DCM", "Volume estimated from single 2D region") +#define CODE_DCM_VolumeEstimatedFromThreeOrMoreNonCoplanar2DRegions DSRBasicCodedEntry("121217", "DCM", "Volume estimated from three or more non-coplanar 2D regions") +#define CODE_DCM_VolumeEstimatedFromTwoNonCoplanar2DRegions DSRBasicCodedEntry("121218", "DCM", "Volume estimated from two non-coplanar 2D regions") +#define CODE_DCM_VolumeOfBoundingThreeDimensionalRegion DSRBasicCodedEntry("121219", "DCM", "Volume of bounding three dimensional region") +#define CODE_DCM_VolumeOfCircumscribedSphere DSRBasicCodedEntry("121220", "DCM", "Volume of circumscribed sphere") +#define CODE_DCM_VolumeOfEllipsoid DSRBasicCodedEntry("121221", "DCM", "Volume of ellipsoid") +#define CODE_DCM_VolumeOfSphere DSRBasicCodedEntry("121222", "DCM", "Volume of sphere") +#define CODE_DCM_PathVertex DSRBasicCodedEntry("121230", "DCM", "Path Vertex") +#define CODE_DCM_VolumeSurface DSRBasicCodedEntry("121231", "DCM", "Volume Surface") +#define CODE_DCM_SourceSeriesForSegmentation DSRBasicCodedEntry("121232", "DCM", "Source series for segmentation") +#define CODE_DCM_SourceImageForSegmentation DSRBasicCodedEntry("121233", "DCM", "Source image for segmentation") +#define CODE_DCM_DistanceFromNipple DSRBasicCodedEntry("121242", "DCM", "Distance from nipple") +#define CODE_DCM_DistanceFromSkin DSRBasicCodedEntry("121243", "DCM", "Distance from skin") +#define CODE_DCM_DistanceFromChestWall DSRBasicCodedEntry("121244", "DCM", "Distance from chest wall") +#define CODE_DCM_PatientExposureToIonizingRadiation DSRBasicCodedEntry("121290", "DCM", "Patient exposure to ionizing radiation") +#define CODE_DCM_ResultsCommunicated DSRBasicCodedEntry("121291", "DCM", "Results communicated") +#define CODE_DCM_SimultaneousDoppler DSRBasicCodedEntry("121301", "DCM", "Simultaneous Doppler") +#define CODE_DCM_SimultaneousHemodynamic DSRBasicCodedEntry("121302", "DCM", "Simultaneous Hemodynamic") +#define CODE_DCM_SimultaneousECG DSRBasicCodedEntry("121303", "DCM", "Simultaneous ECG") +#define CODE_DCM_SimultaneousVoiceNarrative DSRBasicCodedEntry("121304", "DCM", "Simultaneous Voice Narrative") +#define CODE_DCM_SimultaneousRespiratoryWaveform DSRBasicCodedEntry("121305", "DCM", "Simultaneous Respiratory Waveform") +#define CODE_DCM_SimultaneousArterialPulseWaveform DSRBasicCodedEntry("121306", "DCM", "Simultaneous Arterial Pulse Waveform") +#define CODE_DCM_SimultaneousPhonocardiographicWaveform DSRBasicCodedEntry("121307", "DCM", "Simultaneous Phonocardiographic Waveform") +#define CODE_DCM_RTTreatmentPlanForThePositionBeingVerified DSRBasicCodedEntry("121310", "DCM", "RT treatment plan for the position being verified") +#define CODE_DCM_Localizer DSRBasicCodedEntry("121311", "DCM", "Localizer") +#define CODE_DCM_BiopsyLocalizer DSRBasicCodedEntry("121312", "DCM", "Biopsy localizer") +#define CODE_DCM_OtherPartialViews DSRBasicCodedEntry("121313", "DCM", "Other partial views") +#define CODE_DCM_OtherImageOfBiplanePair DSRBasicCodedEntry("121314", "DCM", "Other image of biplane pair") +#define CODE_DCM_OtherImageOfStereoscopicPair DSRBasicCodedEntry("121315", "DCM", "Other image of stereoscopic pair") +#define CODE_DCM_ImagesRelatedToStandaloneObject DSRBasicCodedEntry("121316", "DCM", "Images related to standalone object") +#define CODE_DCM_Spectroscopy DSRBasicCodedEntry("121317", "DCM", "Spectroscopy") +#define CODE_DCM_SpectroscopyDataForWaterPhaseCorrection DSRBasicCodedEntry("121318", "DCM", "Spectroscopy Data for Water Phase Correction") +#define CODE_DCM_UncompressedPredecessor DSRBasicCodedEntry("121320", "DCM", "Uncompressed predecessor") +#define CODE_DCM_MaskImageForImageProcessingOperation DSRBasicCodedEntry("121321", "DCM", "Mask image for image processing operation") +#define CODE_DCM_SourceImageForImageProcessingOperation DSRBasicCodedEntry("121322", "DCM", "Source image for image processing operation") +#define CODE_DCM_SourceSeriesForImageProcessingOperation DSRBasicCodedEntry("121323", "DCM", "Source series for image processing operation") +#define CODE_DCM_SourceImage DSRBasicCodedEntry("121324", "DCM", "Source Image") +#define CODE_DCM_LossyCompressedImage DSRBasicCodedEntry("121325", "DCM", "Lossy compressed image") +#define CODE_DCM_AlternateSOPClassInstance DSRBasicCodedEntry("121326", "DCM", "Alternate SOP Class instance") +#define CODE_DCM_FullFidelityImage DSRBasicCodedEntry("121327", "DCM", "Full fidelity image") +#define CODE_DCM_AlternatePhotometricInterpretationImage DSRBasicCodedEntry("121328", "DCM", "Alternate Photometric Interpretation image") +#define CODE_DCM_SourceImageForMontage DSRBasicCodedEntry("121329", "DCM", "Source image for montage") +#define CODE_DCM_LossyCompressedPredecessor DSRBasicCodedEntry("121330", "DCM", "Lossy compressed predecessor") +#define CODE_DCM_EquivalentCDADocument DSRBasicCodedEntry("121331", "DCM", "Equivalent CDA Document") +#define CODE_DCM_CompleteRenderingForPresentation DSRBasicCodedEntry("121332", "DCM", "Complete Rendering for Presentation") +#define CODE_DCM_PartialRenderingForPresentation DSRBasicCodedEntry("121333", "DCM", "Partial Rendering for Presentation") +#define CODE_DCM_ExtendedRenderingForPresentation DSRBasicCodedEntry("121334", "DCM", "Extended Rendering for Presentation") +#define CODE_DCM_SourceDocument DSRBasicCodedEntry("121335", "DCM", "Source Document") +#define CODE_DCM_AnatomicImage DSRBasicCodedEntry("121338", "DCM", "Anatomic image") +#define CODE_DCM_FunctionalImage DSRBasicCodedEntry("121339", "DCM", "Functional image") +#define CODE_DCM_SpectralFilteredImage DSRBasicCodedEntry("121340", "DCM", "Spectral filtered image") +#define CODE_DCM_DeviceLocalizer DSRBasicCodedEntry("121341", "DCM", "Device localizer") +#define CODE_DCM_DoseImage DSRBasicCodedEntry("121342", "DCM", "Dose Image") +#define CODE_DCM_AcquisitionFramesCorrespondingToVolume DSRBasicCodedEntry("121346", "DCM", "Acquisition frames corresponding to volume") +#define CODE_DCM_VolumeCorrespondingToSpatiallyRelatedAcquisitionFrames DSRBasicCodedEntry("121347", "DCM", "Volume corresponding to spatially-related acquisition frames") +#define CODE_DCM_TemporalPredecessor DSRBasicCodedEntry("121348", "DCM", "Temporal Predecessor") +#define CODE_DCM_TemporalSuccessor DSRBasicCodedEntry("121349", "DCM", "Temporal Successor") +#define CODE_DCM_SameAcquisitionAtLowerResolution DSRBasicCodedEntry("121350", "DCM", "Same acquisition at lower resolution") +#define CODE_DCM_SameAcquisitionAtHigherResolution DSRBasicCodedEntry("121351", "DCM", "Same acquisition at higher resolution") +#define CODE_DCM_SameAcquisitionAtDifferentFocalDepth DSRBasicCodedEntry("121352", "DCM", "Same acquisition at different focal depth") +#define CODE_DCM_SameAcquisitionAtDifferentSpectralBand DSRBasicCodedEntry("121353", "DCM", "Same acquisition at different spectral band") +#define CODE_DCM_ImagedContainerLabel DSRBasicCodedEntry("121354", "DCM", "Imaged container label") +#define CODE_DCM_ForProcessingPredecessor DSRBasicCodedEntry("121358", "DCM", "For Processing predecessor") +#define CODE_DCM_ReplacedReport DSRBasicCodedEntry("121360", "DCM", "Replaced report") +#define CODE_DCM_AddendedReport DSRBasicCodedEntry("121361", "DCM", "Addended report") +#define CODE_DCM_PreliminaryReport DSRBasicCodedEntry("121362", "DCM", "Preliminary report") +#define CODE_DCM_PartialReport DSRBasicCodedEntry("121363", "DCM", "Partial report") +#define CODE_DCM_ComposedFromPriorDoses DSRBasicCodedEntry("121370", "DCM", "Composed from prior doses") +#define CODE_DCM_ComposedFromPriorDosesAndCurrentPlan DSRBasicCodedEntry("121371", "DCM", "Composed from prior doses and current plan") +#define CODE_DCM_SourceDoseForComposingCurrentDose DSRBasicCodedEntry("121372", "DCM", "Source dose for composing current dose") +#define CODE_DCM_RTPreTreatmentDoseCheck DSRBasicCodedEntry("121373", "DCM", "RT Pre-Treatment Dose Check") +#define CODE_DCM_RTPreTreatmentConsistencyCheck DSRBasicCodedEntry("121374", "DCM", "RT Pre-Treatment Consistency Check") +#define CODE_DCM_AssessmentByComparison DSRBasicCodedEntry("121375", "DCM", "Assessment By Comparison") +#define CODE_DCM_AssessmentByRules DSRBasicCodedEntry("121376", "DCM", "Assessment By Rules") +#define CODE_DCM_ActiveIngredientUndilutedConcentration DSRBasicCodedEntry("121380", "DCM", "Active Ingredient Undiluted Concentration") +#define CODE_DCM_ContrastBolusIngredientOpaque DSRBasicCodedEntry("121381", "DCM", "Contrast/Bolus Ingredient Opaque") +#define CODE_DCM_QuantityAdministered DSRBasicCodedEntry("121382", "DCM", "Quantity administered") +#define CODE_DCM_MassAdministered DSRBasicCodedEntry("121383", "DCM", "Mass administered") +#define CODE_DCM_Derivation DSRBasicCodedEntry("121401", "DCM", "Derivation") +#define CODE_DCM_Normality DSRBasicCodedEntry("121402", "DCM", "Normality") +#define CODE_DCM_LevelOfSignificance DSRBasicCodedEntry("121403", "DCM", "Level of Significance") +#define CODE_DCM_SelectionStatus DSRBasicCodedEntry("121404", "DCM", "Selection Status") +#define CODE_DCM_PopulationDescription DSRBasicCodedEntry("121405", "DCM", "Population description") +#define CODE_DCM_ReferenceAuthority DSRBasicCodedEntry("121406", "DCM", "Reference Authority") +#define CODE_DCM_NormalRangeDescription DSRBasicCodedEntry("121407", "DCM", "Normal Range description") +#define CODE_DCM_NormalRangeAuthority DSRBasicCodedEntry("121408", "DCM", "Normal Range Authority") +#define CODE_DCM_UserChosenValue DSRBasicCodedEntry("121410", "DCM", "User chosen value") +#define CODE_DCM_MostRecentValueChosen DSRBasicCodedEntry("121411", "DCM", "Most recent value chosen") +#define CODE_DCM_MeanValueChosen DSRBasicCodedEntry("121412", "DCM", "Mean value chosen") +#define CODE_DCM_StandardDeviationOfPopulation DSRBasicCodedEntry("121414", "DCM", "Standard deviation of population") +#define CODE_DCM_PercentileRankingOfMeasurement DSRBasicCodedEntry("121415", "DCM", "Percentile Ranking of measurement") +#define CODE_DCM_ZScoreOfMeasurement DSRBasicCodedEntry("121416", "DCM", "Z-Score of measurement") +#define CODE_DCM_2SigmaDeviationOfPopulation DSRBasicCodedEntry("121417", "DCM", "2 Sigma deviation of population") +#define CODE_DCM_Equation DSRBasicCodedEntry("121420", "DCM", "Equation") +#define CODE_DCM_EquationCitation DSRBasicCodedEntry("121421", "DCM", "Equation Citation") +#define CODE_DCM_TableOfValuesCitation DSRBasicCodedEntry("121422", "DCM", "Table of Values Citation") +#define CODE_DCM_MethodCitation DSRBasicCodedEntry("121423", "DCM", "Method Citation") +#define CODE_DCM_TableOfValues DSRBasicCodedEntry("121424", "DCM", "Table of Values") +#define CODE_DCM_Index DSRBasicCodedEntry("121425", "DCM", "Index") +#define CODE_DCM_RETIRED_Estimated DSRBasicCodedEntry("121427", "DCM", "Estimated") +#define CODE_DCM_RETIRED_Calculated DSRBasicCodedEntry("121428", "DCM", "Calculated") +#define CODE_DCM_Concern DSRBasicCodedEntry("121430", "DCM", "Concern") +#define CODE_DCM_DateTimeConcernNoted DSRBasicCodedEntry("121431", "DCM", "DateTime Concern Noted") +#define CODE_DCM_DateTimeConcernResolved DSRBasicCodedEntry("121432", "DCM", "DateTime Concern Resolved") +#define CODE_DCM_DateTimeProblemResolved DSRBasicCodedEntry("121433", "DCM", "DateTime Problem Resolved") +#define CODE_DCM_ServiceDeliveryLocation DSRBasicCodedEntry("121434", "DCM", "Service Delivery Location") +#define CODE_DCM_ServicePerformer DSRBasicCodedEntry("121435", "DCM", "Service Performer") +#define CODE_DCM_MedicalDeviceUsed DSRBasicCodedEntry("121436", "DCM", "Medical Device Used") +#define CODE_DCM_RETIRED_PharmacologicAndExerciseStressTest DSRBasicCodedEntry("121437", "DCM", "Pharmacologic and exercise stress test") +#define CODE_DCM_RETIRED_PacedStressTest DSRBasicCodedEntry("121438", "DCM", "Paced stress test") +#define CODE_DCM_RETIRED_CorrectionOfCongenitalCardiovascularDeformity DSRBasicCodedEntry("121439", "DCM", "Correction of congenital cardiovascular deformity") +#define CODE_DCM_RTPatientSetup DSRBasicCodedEntry("121701", "DCM", "RT Patient Setup") +#define CODE_DCM_RTPatientPositionAcquisition_singlePlaneMV DSRBasicCodedEntry("121702", "DCM", "RT Patient Position Acquisition, single plane MV") +#define CODE_DCM_RTPatientPositionAcquisition_dualPlaneMV DSRBasicCodedEntry("121703", "DCM", "RT Patient Position Acquisition, dual plane MV") +#define CODE_DCM_RTPatientPositionAcquisition_singlePlaneKV DSRBasicCodedEntry("121704", "DCM", "RT Patient Position Acquisition, single plane kV") +#define CODE_DCM_RTPatientPositionAcquisition_dualPlaneKV DSRBasicCodedEntry("121705", "DCM", "RT Patient Position Acquisition, dual plane kV") +#define CODE_DCM_RTPatientPositionAcquisition_dualPlaneKVMV DSRBasicCodedEntry("121706", "DCM", "RT Patient Position Acquisition, dual plane kV/MV") +#define CODE_DCM_RTPatientPositionAcquisition_CTKV DSRBasicCodedEntry("121707", "DCM", "RT Patient Position Acquisition, CT kV") +#define CODE_DCM_RTPatientPositionAcquisition_CTMV DSRBasicCodedEntry("121708", "DCM", "RT Patient Position Acquisition, CT MV") +#define CODE_DCM_RTPatientPositionAcquisition_Optical DSRBasicCodedEntry("121709", "DCM", "RT Patient Position Acquisition, Optical") +#define CODE_DCM_RTPatientPositionAcquisition_Ultrasound DSRBasicCodedEntry("121710", "DCM", "RT Patient Position Acquisition, Ultrasound") +#define CODE_DCM_RTPatientPositionAcquisition_SpatialFiducials DSRBasicCodedEntry("121711", "DCM", "RT Patient Position Acquisition, Spatial Fiducials") +#define CODE_DCM_RTPatientPositionRegistration_singlePlane DSRBasicCodedEntry("121712", "DCM", "RT Patient Position Registration, single plane") +#define CODE_DCM_RTPatientPositionRegistration_dualPlane DSRBasicCodedEntry("121713", "DCM", "RT Patient Position Registration, dual plane") +#define CODE_DCM_RTPatientPositionRegistration_3DCTGeneral DSRBasicCodedEntry("121714", "DCM", "RT Patient Position Registration, 3D CT general") +#define CODE_DCM_RTPatientPositionRegistration_3DCTMarkerBased DSRBasicCodedEntry("121715", "DCM", "RT Patient Position Registration, 3D CT marker-based") +#define CODE_DCM_RTPatientPositionRegistration_3DCTVolumeBased DSRBasicCodedEntry("121716", "DCM", "RT Patient Position Registration, 3D CT volume-based") +#define CODE_DCM_RTPatientPositionRegistration_3Don2DReference DSRBasicCodedEntry("121717", "DCM", "RT Patient Position Registration, 3D on 2D reference") +#define CODE_DCM_RTPatientPositionRegistration_2Don3DReference DSRBasicCodedEntry("121718", "DCM", "RT Patient Position Registration, 2D on 3D reference") +#define CODE_DCM_RTPatientPositionRegistration_Optical DSRBasicCodedEntry("121719", "DCM", "RT Patient Position Registration, Optical") +#define CODE_DCM_RTPatientPositionRegistration_Ultrasound DSRBasicCodedEntry("121720", "DCM", "RT Patient Position Registration, Ultrasound") +#define CODE_DCM_RTPatientPositionRegistration_SpatialFiducials DSRBasicCodedEntry("121721", "DCM", "RT Patient Position Registration, Spatial Fiducials") +#define CODE_DCM_RTPatientPositionAdjustment DSRBasicCodedEntry("121722", "DCM", "RT Patient Position Adjustment") +#define CODE_DCM_RTPatientPositionInTreatmentSessionReview DSRBasicCodedEntry("121723", "DCM", "RT Patient Position In-treatment-session Review") +#define CODE_DCM_RTTreatmentSimulationWithInternalVerification DSRBasicCodedEntry("121724", "DCM", "RT Treatment Simulation with Internal Verification") +#define CODE_DCM_RTTreatmentSimulationWithExternalVerification DSRBasicCodedEntry("121725", "DCM", "RT Treatment Simulation with External Verification") +#define CODE_DCM_RTTreatmentWithInternalVerification DSRBasicCodedEntry("121726", "DCM", "RT Treatment with Internal Verification") +#define CODE_DCM_RTTreatmentWithExternalVerification DSRBasicCodedEntry("121727", "DCM", "RT Treatment with External Verification") +#define CODE_DCM_RTTreatmentQAWithInternalVerification DSRBasicCodedEntry("121728", "DCM", "RT Treatment QA with Internal Verification") +#define CODE_DCM_RTTreatmentQAWithExternalVerification DSRBasicCodedEntry("121729", "DCM", "RT Treatment QA with External Verification") +#define CODE_DCM_RTMachineQA DSRBasicCodedEntry("121730", "DCM", "RT Machine QA") +#define CODE_DCM_RTTreatmentQAByRTPlanDoseCheck DSRBasicCodedEntry("121731", "DCM", "RT Treatment QA by RT Plan Dose Check") +#define CODE_DCM_RTTreatmentQAByRTPlanDifferenceCheck DSRBasicCodedEntry("121732", "DCM", "RT Treatment QA by RT Plan Difference Check") +#define CODE_DCM_RTTreatmentQAByRTIonPlanDoseCheck DSRBasicCodedEntry("121733", "DCM", "RT Treatment QA by RT Ion Plan Dose Check") +#define CODE_DCM_RTTreatmentQAWithRTIonPlanDifferenceCheck DSRBasicCodedEntry("121734", "DCM", "RT Treatment QA with RT Ion Plan Difference Check") +#define CODE_DCM_RTBrachyTreatment DSRBasicCodedEntry("121735", "DCM", "RT Brachy Treatment") +#define CODE_DCM_TreatmentDeliveryType DSRBasicCodedEntry("121740", "DCM", "Treatment Delivery Type") +#define CODE_DCM_PatientCalledToProcedureRoom DSRBasicCodedEntry("122001", "DCM", "Patient called to procedure room") +#define CODE_DCM_PatientAdmittedToProcedureRoom DSRBasicCodedEntry("122002", "DCM", "Patient admitted to procedure room") +#define CODE_DCM_PatientGivenPreProcedureInstruction DSRBasicCodedEntry("122003", "DCM", "Patient given pre-procedure instruction") +#define CODE_DCM_PatientInformedConsentGiven DSRBasicCodedEntry("122004", "DCM", "Patient informed consent given") +#define CODE_DCM_PatientAdvanceDirectiveGiven DSRBasicCodedEntry("122005", "DCM", "Patient advance directive given") +#define CODE_DCM_NilPerOs_NPO_statusConfirmed DSRBasicCodedEntry("122006", "DCM", "Nil Per Os (NPO) status confirmed") +#define CODE_DCM_PatientAssistedToTable DSRBasicCodedEntry("122007", "DCM", "Patient assisted to table") +#define CODE_DCM_PatientPreppedAndDraped DSRBasicCodedEntry("122008", "DCM", "Patient prepped and draped") +#define CODE_DCM_PatientConnectedToContinuousMonitoring DSRBasicCodedEntry("122009", "DCM", "Patient connected to continuous monitoring") +#define CODE_DCM_PatientTransferredToHoldingArea DSRBasicCodedEntry("122010", "DCM", "Patient transferred to holding area") +#define CODE_DCM_PatientTransferredToSurgery DSRBasicCodedEntry("122011", "DCM", "Patient transferred to surgery") +#define CODE_DCM_PatientTransferredToCCU DSRBasicCodedEntry("122012", "DCM", "Patient transferred to CCU") +#define CODE_DCM_PatientDisoriented DSRBasicCodedEntry("122020", "DCM", "Patient disoriented") +#define CODE_DCM_PatientReportsNausea DSRBasicCodedEntry("122021", "DCM", "Patient reports nausea") +#define CODE_DCM_PatientReportsDiscomfort DSRBasicCodedEntry("122022", "DCM", "Patient reports discomfort") +#define CODE_DCM_PatientReportsChestPain DSRBasicCodedEntry("122023", "DCM", "Patient reports chest pain") +#define CODE_DCM_PatientReportsNoPain DSRBasicCodedEntry("122024", "DCM", "Patient reports no pain") +#define CODE_DCM_PatientAlert DSRBasicCodedEntry("122025", "DCM", "Patient alert") +#define CODE_DCM_PatientRestless DSRBasicCodedEntry("122026", "DCM", "Patient restless") +#define CODE_DCM_PatientSedated DSRBasicCodedEntry("122027", "DCM", "Patient sedated") +#define CODE_DCM_PatientAsleep DSRBasicCodedEntry("122028", "DCM", "Patient asleep") +#define CODE_DCM_PatientUnresponsive DSRBasicCodedEntry("122029", "DCM", "Patient unresponsive") +#define CODE_DCM_PatientHasRespiratoryDifficulty DSRBasicCodedEntry("122030", "DCM", "Patient has respiratory difficulty") +#define CODE_DCM_PatientCoughed DSRBasicCodedEntry("122031", "DCM", "Patient coughed") +#define CODE_DCM_PatientDisconnectedFromContinuousMonitoring DSRBasicCodedEntry("122032", "DCM", "Patient disconnected from continuous monitoring") +#define CODE_DCM_HemostasisAchieved DSRBasicCodedEntry("122033", "DCM", "Hemostasis achieved") +#define CODE_DCM_HemostasisNotAchieved_oozing DSRBasicCodedEntry("122034", "DCM", "Hemostasis not achieved - oozing") +#define CODE_DCM_HemostasisNotAchieved_activelyBleeding DSRBasicCodedEntry("122035", "DCM", "Hemostasis not achieved - actively bleeding") +#define CODE_DCM_PatientGivenPostProcedureInstruction DSRBasicCodedEntry("122036", "DCM", "Patient given post-procedure instruction") +#define CODE_DCM_PatientDischargedFromDepartment DSRBasicCodedEntry("122037", "DCM", "Patient discharged from department") +#define CODE_DCM_PatientPronouncedDead DSRBasicCodedEntry("122038", "DCM", "Patient pronounced dead") +#define CODE_DCM_PatientTransferredToMorgue DSRBasicCodedEntry("122039", "DCM", "Patient transferred to morgue") +#define CODE_DCM_PersonnelArrived DSRBasicCodedEntry("122041", "DCM", "Personnel Arrived") +#define CODE_DCM_PersonnelDeparted DSRBasicCodedEntry("122042", "DCM", "Personnel Departed") +#define CODE_DCM_PageSentTo DSRBasicCodedEntry("122043", "DCM", "Page Sent To") +#define CODE_DCM_ConsultationWith DSRBasicCodedEntry("122044", "DCM", "Consultation With") +#define CODE_DCM_OfficeCalled DSRBasicCodedEntry("122045", "DCM", "Office called") +#define CODE_DCM_RETIRED_EquipmentFailure DSRBasicCodedEntry("122046", "DCM", "Equipment failure") +#define CODE_DCM_EquipmentBroughtToProcedureRoom DSRBasicCodedEntry("122047", "DCM", "Equipment brought to procedure room") +#define CODE_DCM_EquipmentReady DSRBasicCodedEntry("122048", "DCM", "Equipment ready") +#define CODE_DCM_EquipmentRemoved DSRBasicCodedEntry("122049", "DCM", "Equipment removed") +#define CODE_DCM_Bioptome DSRBasicCodedEntry("122052", "DCM", "Bioptome") +#define CODE_DCM_ValvularIntervention DSRBasicCodedEntry("122053", "DCM", "Valvular Intervention") +#define CODE_DCM_AorticIntervention DSRBasicCodedEntry("122054", "DCM", "Aortic Intervention") +#define CODE_DCM_SeptalDefectIntervention DSRBasicCodedEntry("122055", "DCM", "Septal Defect Intervention") +#define CODE_DCM_VascularIntervention DSRBasicCodedEntry("122056", "DCM", "Vascular Intervention") +#define CODE_DCM_MyocardialBiopsy DSRBasicCodedEntry("122057", "DCM", "Myocardial biopsy") +#define CODE_DCM_ArterialConduitAngiography DSRBasicCodedEntry("122058", "DCM", "Arterial conduit angiography") +#define CODE_DCM_SinglePlaneAngiography DSRBasicCodedEntry("122059", "DCM", "Single plane Angiography") +#define CODE_DCM_BiPlaneAngiography DSRBasicCodedEntry("122060", "DCM", "Bi-plane Angiography") +#define CODE_DCM_PercutaneousCoronaryIntervention DSRBasicCodedEntry("122061", "DCM", "Percutaneous Coronary Intervention") +#define CODE_DCM_RETIRED_15LeadECG DSRBasicCodedEntry("122062", "DCM", "15-Lead ECG") +#define CODE_DCM_PreProcedureLog DSRBasicCodedEntry("122072", "DCM", "Pre-procedure log") +#define CODE_DCM_CurrentProcedureEvidence DSRBasicCodedEntry("122073", "DCM", "Current procedure evidence") +#define CODE_DCM_PriorReportForCurrentPatient DSRBasicCodedEntry("122075", "DCM", "Prior report for current patient") +#define CODE_DCM_ConsumableTakenFromInventory DSRBasicCodedEntry("122076", "DCM", "Consumable taken from inventory") +#define CODE_DCM_ConsumableReturnedToInventory DSRBasicCodedEntry("122077", "DCM", "Consumable returned to inventory") +#define CODE_DCM_RemainingConsumableDisposed DSRBasicCodedEntry("122078", "DCM", "Remaining consumable disposed") +#define CODE_DCM_ConsumableUnusable DSRBasicCodedEntry("122079", "DCM", "Consumable unusable") +#define CODE_DCM_DrugStart DSRBasicCodedEntry("122081", "DCM", "Drug start") +#define CODE_DCM_DrugEnd DSRBasicCodedEntry("122082", "DCM", "Drug end") +#define CODE_DCM_DrugAdministered DSRBasicCodedEntry("122083", "DCM", "Drug administered") +#define CODE_DCM_ContrastStart DSRBasicCodedEntry("122084", "DCM", "Contrast start") +#define CODE_DCM_ContrastEnd DSRBasicCodedEntry("122085", "DCM", "Contrast end") +#define CODE_DCM_ContrastAdministered DSRBasicCodedEntry("122086", "DCM", "Contrast administered") +#define CODE_DCM_InfusateStart DSRBasicCodedEntry("122087", "DCM", "Infusate start") +#define CODE_DCM_InfusateEnd DSRBasicCodedEntry("122088", "DCM", "Infusate end") +#define CODE_DCM_DeviceCrossedLesion DSRBasicCodedEntry("122089", "DCM", "Device crossed lesion") +#define CODE_DCM_InterventionAction DSRBasicCodedEntry("122090", "DCM", "Intervention Action") +#define CODE_DCM_VolumeAdministered DSRBasicCodedEntry("122091", "DCM", "Volume administered") +#define CODE_DCM_UndilutedDoseAdministered DSRBasicCodedEntry("122092", "DCM", "Undiluted dose administered") +#define CODE_DCM_Concentration DSRBasicCodedEntry("122093", "DCM", "Concentration") +#define CODE_DCM_RateOfAdministration DSRBasicCodedEntry("122094", "DCM", "Rate of administration") +#define CODE_DCM_DurationOfAdministration DSRBasicCodedEntry("122095", "DCM", "Duration of administration") +#define CODE_DCM_VolumeUnadministeredOrDiscarded DSRBasicCodedEntry("122096", "DCM", "Volume unadministered or discarded") +#define CODE_DCM_CatheterCurve DSRBasicCodedEntry("122097", "DCM", "Catheter Curve") +#define CODE_DCM_TransmitFrequency DSRBasicCodedEntry("122098", "DCM", "Transmit Frequency") +#define CODE_DCM_STChangeFromBaseline DSRBasicCodedEntry("122099", "DCM", "ST change from baseline") +#define CODE_DCM_AneurysmonCitedVessel DSRBasicCodedEntry("122101", "DCM", "Aneurysm on cited vessel") +#define CODE_DCM_GraftToCitedSegment_proximalSection DSRBasicCodedEntry("122102", "DCM", "Graft to cited segment, proximal section") +#define CODE_DCM_GraftToCitedSegment_midSection DSRBasicCodedEntry("122103", "DCM", "Graft to cited segment, mid section") +#define CODE_DCM_GraftToCitedSegment_distalSection DSRBasicCodedEntry("122104", "DCM", "Graft to cited segment, distal section") +#define CODE_DCM_DateTimeOfIntervention DSRBasicCodedEntry("122105", "DCM", "DateTime of Intervention") +#define CODE_DCM_DurationOfIntervention DSRBasicCodedEntry("122106", "DCM", "Duration of Intervention") +#define CODE_DCM_RETIRED_BaselineStenosisMeasurement DSRBasicCodedEntry("122107", "DCM", "Baseline Stenosis Measurement") +#define CODE_DCM_RETIRED_PostInterventionStenosisMeasurement DSRBasicCodedEntry("122108", "DCM", "Post-Intervention Stenosis Measurement") +#define CODE_DCM_BaselineTIMIFlow DSRBasicCodedEntry("122109", "DCM", "Baseline TIMI Flow") +#define CODE_DCM_PostInterventionTIMIFlow DSRBasicCodedEntry("122110", "DCM", "Post-Intervention TIMI Flow") +#define CODE_DCM_PrimaryInterventionDevice DSRBasicCodedEntry("122111", "DCM", "Primary Intervention Device") +#define CODE_DCM_NormalMyocardium DSRBasicCodedEntry("122112", "DCM", "Normal Myocardium") +#define CODE_DCM_ScarredMyocardium DSRBasicCodedEntry("122113", "DCM", "Scarred Myocardium") +#define CODE_DCM_ThinningMyocardium DSRBasicCodedEntry("122114", "DCM", "Thinning Myocardium") +#define CODE_DCM_HemodynamicsReport DSRBasicCodedEntry("122120", "DCM", "Hemodynamics Report") +#define CODE_DCM_AtrialPressureMeasurements DSRBasicCodedEntry("122121", "DCM", "Atrial pressure measurements") +#define CODE_DCM_VentricularPressureMeasurements DSRBasicCodedEntry("122122", "DCM", "Ventricular pressure measurements") +#define CODE_DCM_GradientAssessment DSRBasicCodedEntry("122123", "DCM", "Gradient assessment") +#define CODE_DCM_BloodVelocityMeasurements DSRBasicCodedEntry("122124", "DCM", "Blood velocity measurements") +#define CODE_DCM_BloodLabMeasurements DSRBasicCodedEntry("122125", "DCM", "Blood lab measurements") +#define CODE_DCM_DerivedHemodynamicMeasurements DSRBasicCodedEntry("122126", "DCM", "Derived Hemodynamic Measurements") +#define CODE_DCM_ClinicalContext DSRBasicCodedEntry("122127", "DCM", "Clinical Context") +#define CODE_DCM_PatientTransferredFrom DSRBasicCodedEntry("122128", "DCM", "Patient Transferred From") +#define CODE_DCM_PCIDuringThisProcedure DSRBasicCodedEntry("122129", "DCM", "PCI during this procedure") +#define CODE_DCM_DoseAreaProduct DSRBasicCodedEntry("122130", "DCM", "Dose Area Product") +#define CODE_DCM_DegreeOfThrombus DSRBasicCodedEntry("122131", "DCM", "Degree of Thrombus") +#define CODE_DCM_SeverityOfCalcification DSRBasicCodedEntry("122132", "DCM", "Severity of Calcification") +#define CODE_DCM_LesionMorphology DSRBasicCodedEntry("122133", "DCM", "Lesion Morphology") +#define CODE_DCM_VesselMorphology DSRBasicCodedEntry("122134", "DCM", "Vessel Morphology") +#define CODE_DCM_CirculatorySupport DSRBasicCodedEntry("122138", "DCM", "Circulatory Support") +#define CODE_DCM_ReasonForExam DSRBasicCodedEntry("122139", "DCM", "Reason for Exam") +#define CODE_DCM_ComparisonWithPriorExamDone DSRBasicCodedEntry("122140", "DCM", "Comparison with Prior Exam Done") +#define CODE_DCM_ElectrodePlacement DSRBasicCodedEntry("122141", "DCM", "Electrode Placement") +#define CODE_DCM_AcquisitionDeviceType DSRBasicCodedEntry("122142", "DCM", "Acquisition Device Type") +#define CODE_DCM_AcquisitionDeviceID DSRBasicCodedEntry("122143", "DCM", "Acquisition Device ID") +#define CODE_DCM_QuantitativeAnalysis DSRBasicCodedEntry("122144", "DCM", "Quantitative Analysis") +#define CODE_DCM_QualitativeAnalysis DSRBasicCodedEntry("122145", "DCM", "Qualitative Analysis") +#define CODE_DCM_ProcedureDateTime DSRBasicCodedEntry("122146", "DCM", "Procedure DateTime") +#define CODE_DCM_ClinicalInterpretation DSRBasicCodedEntry("122147", "DCM", "Clinical Interpretation") +#define CODE_DCM_LeadID DSRBasicCodedEntry("122148", "DCM", "Lead ID") +#define CODE_DCM_BeatNumber DSRBasicCodedEntry("122149", "DCM", "Beat Number") +#define CODE_DCM_CompoundStatement DSRBasicCodedEntry("122150", "DCM", "Compound Statement") +#define CODE_DCM_Trend DSRBasicCodedEntry("122151", "DCM", "Trend") +#define CODE_DCM_Statement DSRBasicCodedEntry("122152", "DCM", "Statement") +#define CODE_DCM_StatementModifier DSRBasicCodedEntry("122153", "DCM", "Statement Modifier") +#define CODE_DCM_ConjunctiveTerm DSRBasicCodedEntry("122154", "DCM", "Conjunctive Term") +#define CODE_DCM_Probability DSRBasicCodedEntry("122157", "DCM", "Probability") +#define CODE_DCM_ECGGlobalMeasurements DSRBasicCodedEntry("122158", "DCM", "ECG Global Measurements") +#define CODE_DCM_ECGLeadMeasurements DSRBasicCodedEntry("122159", "DCM", "ECG Lead Measurements") +#define CODE_DCM_DerivedArea_NonValve DSRBasicCodedEntry("122160", "DCM", "Derived Area, Non-Valve") +#define CODE_DCM_PulmonaryFlow DSRBasicCodedEntry("122161", "DCM", "Pulmonary Flow") +#define CODE_DCM_SystemicFlow DSRBasicCodedEntry("122162", "DCM", "Systemic Flow") +#define CODE_DCM_DischargeDateTime DSRBasicCodedEntry("122163", "DCM", "Discharge DateTime") +#define CODE_DCM_CoronaryArteryBypassDuringThisAdmission DSRBasicCodedEntry("122164", "DCM", "Coronary Artery Bypass During This Admission") +#define CODE_DCM_DateTimeOfDeath DSRBasicCodedEntry("122165", "DCM", "DateTime of Death") +#define CODE_DCM_DeathDuringThisAdmission DSRBasicCodedEntry("122166", "DCM", "Death During This Admission") +#define CODE_DCM_DeathDuringCatheterization DSRBasicCodedEntry("122167", "DCM", "Death During Catheterization") +#define CODE_DCM_TypeOfMyocardialInfarction DSRBasicCodedEntry("122170", "DCM", "Type of Myocardial Infarction") +#define CODE_DCM_CoronaryLesionGreaterThanOrEqual50PercentStenosis DSRBasicCodedEntry("122171", "DCM", "Coronary lesion > = 50% stenosis") +#define CODE_DCM_AcuteMIPresent DSRBasicCodedEntry("122172", "DCM", "Acute MI Present") +#define CODE_DCM_STElevationOnsetDateTime DSRBasicCodedEntry("122173", "DCM", "ST Elevation Onset DateTime") +#define CODE_DCM_NumberOfLesionInterventionsAttempted DSRBasicCodedEntry("122175", "DCM", "Number of lesion interventions attempted") +#define CODE_DCM_NumberOfLesionInterventionsSuccessful DSRBasicCodedEntry("122176", "DCM", "Number of lesion interventions successful") +#define CODE_DCM_ProcedureResult DSRBasicCodedEntry("122177", "DCM", "Procedure Result") +#define CODE_DCM_LesionInterventionInformation DSRBasicCodedEntry("122178", "DCM", "Lesion Intervention Information") +#define CODE_DCM_PeriProceduralMIOccurred DSRBasicCodedEntry("122179", "DCM", "Peri-procedural MI occurred") +#define CODE_DCM_CKMBBaseline DSRBasicCodedEntry("122180", "DCM", "CK-MB baseline") +#define CODE_DCM_CKMBPeak DSRBasicCodedEntry("122181", "DCM", "CK-MB peak") +#define CODE_DCM_RRInterval DSRBasicCodedEntry("122182", "DCM", "R-R interval") +#define CODE_DCM_BloodTemperature DSRBasicCodedEntry("122183", "DCM", "Blood temperature") +#define CODE_DCM_BloodOxygenContent DSRBasicCodedEntry("122185", "DCM", "Blood Oxygen content") +#define CODE_DCM_BloodCarbonDioxideSaturation DSRBasicCodedEntry("122187", "DCM", "Blood Carbon dioxide saturation") +#define CODE_DCM_PulmonaryArterialContent_FCpa DSRBasicCodedEntry("122188", "DCM", "Pulmonary Arterial Content (FCpa)") +#define CODE_DCM_PulmonaryVenousContent_FCpv DSRBasicCodedEntry("122189", "DCM", "Pulmonary Venous Content (FCpv)") +#define CODE_DCM_MaxDpDtP DSRBasicCodedEntry("122190", "DCM", "Max dp/dt/P") +#define CODE_DCM_VentricularEndDiastolicPressure DSRBasicCodedEntry("122191", "DCM", "Ventricular End Diastolic pressure") +#define CODE_DCM_IndicatorAppearanceTime DSRBasicCodedEntry("122192", "DCM", "Indicator appearance time") +#define CODE_DCM_MaximumPressureAcceleration DSRBasicCodedEntry("122193", "DCM", "Maximum pressure acceleration") +#define CODE_DCM_VentricularSystolicBloodPressure DSRBasicCodedEntry("122194", "DCM", "Ventricular Systolic blood pressure") +#define CODE_DCM_PulseStrength DSRBasicCodedEntry("122195", "DCM", "Pulse Strength") +#define CODE_DCM_CWavePressure DSRBasicCodedEntry("122196", "DCM", "C wave pressure") +#define CODE_DCM_GradientPressure_average DSRBasicCodedEntry("122197", "DCM", "Gradient pressure, average") +#define CODE_DCM_GradientPressure_peak DSRBasicCodedEntry("122198", "DCM", "Gradient pressure, peak") +#define CODE_DCM_PressureAtDpDtMax DSRBasicCodedEntry("122199", "DCM", "Pressure at dp/dt max") +#define CODE_DCM_DiastolicBloodVelocity_mean DSRBasicCodedEntry("122201", "DCM", "Diastolic blood velocity, mean") +#define CODE_DCM_DiastolicBloodVelocity_peak DSRBasicCodedEntry("122202", "DCM", "Diastolic blood velocity, peak") +#define CODE_DCM_SystolicBloodVelocity_mean DSRBasicCodedEntry("122203", "DCM", "Systolic blood velocity, mean") +#define CODE_DCM_SystolicBloodVelocity_peak DSRBasicCodedEntry("122204", "DCM", "Systolic blood velocity, peak") +#define CODE_DCM_BloodVelocity_mean DSRBasicCodedEntry("122205", "DCM", "Blood velocity, mean") +#define CODE_DCM_BloodVelocity_minimum DSRBasicCodedEntry("122206", "DCM", "Blood velocity, minimum") +#define CODE_DCM_BloodVelocity_peak DSRBasicCodedEntry("122207", "DCM", "Blood velocity, peak") +#define CODE_DCM_XDescentPressure DSRBasicCodedEntry("122208", "DCM", "x-descent pressure") +#define CODE_DCM_YDescentPressure DSRBasicCodedEntry("122209", "DCM", "y-descent pressure") +#define CODE_DCM_ZPointPressure DSRBasicCodedEntry("122210", "DCM", "z-point pressure") +#define CODE_DCM_LeftVentricularEjectionTime DSRBasicCodedEntry("122211", "DCM", "Left Ventricular ejection time") +#define CODE_DCM_LeftVentricularFillingTime DSRBasicCodedEntry("122212", "DCM", "Left Ventricular filling time") +#define CODE_DCM_RightVentricularEjectionTime DSRBasicCodedEntry("122213", "DCM", "Right Ventricular ejection time") +#define CODE_DCM_RightVentricularFillingTime DSRBasicCodedEntry("122214", "DCM", "Right Ventricular filling time") +#define CODE_DCM_TotalPulmonaryResistance DSRBasicCodedEntry("122215", "DCM", "Total Pulmonary Resistance") +#define CODE_DCM_TotalVascularResistance DSRBasicCodedEntry("122216", "DCM", "Total Vascular Resistance") +#define CODE_DCM_CoronaryFlowReserve DSRBasicCodedEntry("122217", "DCM", "Coronary Flow reserve") +#define CODE_DCM_DiastolicSystolicVelocityRatio DSRBasicCodedEntry("122218", "DCM", "Diastolic/Systolic velocity ratio") +#define CODE_DCM_HyperemicRatio DSRBasicCodedEntry("122219", "DCM", "Hyperemic ratio") +#define CODE_DCM_HemodynamicResistanceIndex DSRBasicCodedEntry("122220", "DCM", "Hemodynamic Resistance Index") +#define CODE_DCM_ThoraxDiameter_sagittal DSRBasicCodedEntry("122221", "DCM", "Thorax diameter, sagittal") +#define CODE_DCM_ProcedureEnvironmentalCharacteristics DSRBasicCodedEntry("122222", "DCM", "Procedure Environmental Characteristics") +#define CODE_DCM_RoomOxygenConcentration DSRBasicCodedEntry("122223", "DCM", "Room oxygen concentration") +#define CODE_DCM_RoomTemperature DSRBasicCodedEntry("122224", "DCM", "Room temperature") +#define CODE_DCM_RoomBarometricPressure DSRBasicCodedEntry("122225", "DCM", "Room Barometric pressure") +#define CODE_DCM_LeftToRightFlow DSRBasicCodedEntry("122227", "DCM", "Left to Right Flow") +#define CODE_DCM_RightToLeftFlow DSRBasicCodedEntry("122228", "DCM", "Right to Left Flow") +#define CODE_DCM_ArteriovenousDifference DSRBasicCodedEntry("122229", "DCM", "Arteriovenous difference") +#define CODE_DCM_10YearCHDRisk DSRBasicCodedEntry("122230", "DCM", "10 Year CHD Risk") +#define CODE_DCM_ComparativeAverage10YearCHDRisk DSRBasicCodedEntry("122231", "DCM", "Comparative Average10 Year CHD Risk") +#define CODE_DCM_ComparativeLow10YearCHDRisk DSRBasicCodedEntry("122232", "DCM", "Comparative Low10 Year CHD Risk") +#define CODE_DCM_LDLCholesterolScoreSheetForMen DSRBasicCodedEntry("122233", "DCM", "LDL Cholesterol Score Sheet for Men") +#define CODE_DCM_LDLCholesterolScoreSheetForWomen DSRBasicCodedEntry("122234", "DCM", "LDL Cholesterol Score Sheet for Women") +#define CODE_DCM_TotalCholesterolScoreSheetForMen DSRBasicCodedEntry("122235", "DCM", "Total Cholesterol Score Sheet for Men") +#define CODE_DCM_TotalCholesterolScoreSheetForWomen DSRBasicCodedEntry("122236", "DCM", "Total Cholesterol Score Sheet for Women") +#define CODE_DCM_CorrectedSinusNodeRecoveryTime DSRBasicCodedEntry("122237", "DCM", "Corrected Sinus Node Recovery Time") +#define CODE_DCM_MaxVolumeNormalizedTo50mmHgPulsePressure DSRBasicCodedEntry("122238", "DCM", "Max volume normalized to 50mmHg pulse pressure") +#define CODE_DCM_OxygenConsumption DSRBasicCodedEntry("122239", "DCM", "Oxygen Consumption") +#define CODE_DCM_122240 DSRBasicCodedEntry("122240", "DCM", "BSA = 3.207*WT^(0.7285-0.0188 log (WT)) *HT^0.3") +#define CODE_DCM_122241 DSRBasicCodedEntry("122241", "DCM", "BSA = 0.007184*WT^ 0.425*HT^0.725") +#define CODE_DCM_122242 DSRBasicCodedEntry("122242", "DCM", "BSA = 0.0235*WT^0.51456*HT^ 0.42246") +#define CODE_DCM_122243 DSRBasicCodedEntry("122243", "DCM", "BSA = 0.024265*WT^0.5378*HT^0.3964") +#define CODE_DCM_122244 DSRBasicCodedEntry("122244", "DCM", "BSA = (HT * WT/36) ^0.5") +#define CODE_DCM_122245 DSRBasicCodedEntry("122245", "DCM", "BSA = 1321+0.3433*WT") +#define CODE_DCM_122246 DSRBasicCodedEntry("122246", "DCM", "BSA = 0.0004688 * WT ^ (0.8168 - 0.0154 * log(WT))") +#define CODE_DCM_122247 DSRBasicCodedEntry("122247", "DCM", "VO2male = BSA (138.1 - 11.49 * loge(age) + 0.378 * HRf)") +#define CODE_DCM_122248 DSRBasicCodedEntry("122248", "DCM", "VO2female = BSA (138.1 - 17.04 * loge(age) + 0.378 * HRf)") +#define CODE_DCM_122249 DSRBasicCodedEntry("122249", "DCM", "VO2 = VeSTPD * 10 * (FIO2 - FE02)") +#define CODE_DCM_122250 DSRBasicCodedEntry("122250", "DCM", "VO2 = 152 * BSA") +#define CODE_DCM_122251 DSRBasicCodedEntry("122251", "DCM", "VO2 = 175 * BSA") +#define CODE_DCM_122252 DSRBasicCodedEntry("122252", "DCM", "VO2 = 176 * BSA") +#define CODE_DCM_RobertsonAndReidTable DSRBasicCodedEntry("122253", "DCM", "Robertson & Reid table") +#define CODE_DCM_FleischTable DSRBasicCodedEntry("122254", "DCM", "Fleisch table") +#define CODE_DCM_BoothbyTable DSRBasicCodedEntry("122255", "DCM", "Boothby table") +#define CODE_DCM_122256 DSRBasicCodedEntry("122256", "DCM", "if (prem age< 3days) P50 = 19.9") +#define CODE_DCM_122257 DSRBasicCodedEntry("122257", "DCM", "if (age < 1day) P50 = 21.6") +#define CODE_DCM_122258 DSRBasicCodedEntry("122258", "DCM", "if (age < 30day) P50 = 24.6") +#define CODE_DCM_122259 DSRBasicCodedEntry("122259", "DCM", "if (age < 18y) P50 = 27.2") +#define CODE_DCM_122260 DSRBasicCodedEntry("122260", "DCM", "if (age < 40y) P50 = 27.4") +#define CODE_DCM_122261 DSRBasicCodedEntry("122261", "DCM", "if (age > 60y) P50 = 29.3") +#define CODE_DCM_122262 DSRBasicCodedEntry("122262", "DCM", "Area = Flow / 44.5 * sqrt(Gradient[mmHg])") +#define CODE_DCM_122263 DSRBasicCodedEntry("122263", "DCM", "MVA = Flow / 38.0 * sqrt(Gradient[mmHg])") +#define CODE_DCM_122265 DSRBasicCodedEntry("122265", "DCM", "BMI = Wt / Ht ^ 2") +#define CODE_DCM_122266 DSRBasicCodedEntry("122266", "DCM", "BSA = 0.007358 * WT ^ 0.425 * HT ^ 0.725") +#define CODE_DCM_122267 DSRBasicCodedEntry("122267", "DCM", "BSA = 0.010265 * WT ^ 0.423 * HT ^ 0.651") +#define CODE_DCM_122268 DSRBasicCodedEntry("122268", "DCM", "BSA = 0.008883 * WT ^ 0.444 * HT ^ 0.663") +#define CODE_DCM_122269 DSRBasicCodedEntry("122269", "DCM", "BSA = 0.038189 * WT ^ 0.423 * HT ^ 0.362") +#define CODE_DCM_122270 DSRBasicCodedEntry("122270", "DCM", "BSA = 0.009568 * WT ^ 0.473 * HT ^ 0.655") +#define CODE_DCM_SkinConditionWarm DSRBasicCodedEntry("122271", "DCM", "Skin Condition Warm") +#define CODE_DCM_SkinConditionCool DSRBasicCodedEntry("122272", "DCM", "Skin Condition Cool") +#define CODE_DCM_SkinConditionCold DSRBasicCodedEntry("122273", "DCM", "Skin Condition Cold") +#define CODE_DCM_SkinConditionDry DSRBasicCodedEntry("122274", "DCM", "Skin Condition Dry") +#define CODE_DCM_SkinConditionClammy DSRBasicCodedEntry("122275", "DCM", "Skin Condition Clammy") +#define CODE_DCM_SkinConditionDiaphoretic DSRBasicCodedEntry("122276", "DCM", "Skin Condition Diaphoretic") +#define CODE_DCM_SkinConditionFlush DSRBasicCodedEntry("122277", "DCM", "Skin Condition Flush") +#define CODE_DCM_SkinConditionMottled DSRBasicCodedEntry("122278", "DCM", "Skin Condition Mottled") +#define CODE_DCM_SkinConditionPale DSRBasicCodedEntry("122279", "DCM", "Skin Condition Pale") +#define CODE_DCM_AirwayUnobstructed DSRBasicCodedEntry("122281", "DCM", "Airway unobstructed") +#define CODE_DCM_AirwayPartiallyObstructed DSRBasicCodedEntry("122282", "DCM", "Airway partially obstructed") +#define CODE_DCM_AirwaySeverelyObstructed DSRBasicCodedEntry("122283", "DCM", "Airway severely obstructed") +#define CODE_DCM_NotVisualized DSRBasicCodedEntry("122288", "DCM", "Not Visualized") +#define CODE_DCM_QuantitativeArteriographyReport DSRBasicCodedEntry("122291", "DCM", "Quantitative Arteriography Report") +#define CODE_DCM_QuantitativeVentriculographyReport DSRBasicCodedEntry("122292", "DCM", "Quantitative Ventriculography Report") +#define CODE_DCM_GuidewireCrossingLesionUnsuccessful DSRBasicCodedEntry("122301", "DCM", "Guidewire crossing lesion unsuccessful") +#define CODE_DCM_GuidewireCrossingLesionSuccessful DSRBasicCodedEntry("122302", "DCM", "Guidewire crossing lesion successful") +#define CODE_DCM_AngioplastyBalloonInflated DSRBasicCodedEntry("122303", "DCM", "Angioplasty balloon inflated") +#define CODE_DCM_AngioplastyBalloonDeflated DSRBasicCodedEntry("122304", "DCM", "Angioplasty balloon deflated") +#define CODE_DCM_DeviceDeployed DSRBasicCodedEntry("122305", "DCM", "Device deployed") +#define CODE_DCM_StentReExpanded DSRBasicCodedEntry("122306", "DCM", "Stent re-expanded") +#define CODE_DCM_ObjectRemoved DSRBasicCodedEntry("122307", "DCM", "Object removed") +#define CODE_DCM_RadiationApplied DSRBasicCodedEntry("122308", "DCM", "Radiation applied") +#define CODE_DCM_RadiationRemoved DSRBasicCodedEntry("122309", "DCM", "Radiation removed") +#define CODE_DCM_InterventionalDevicePlacementUnsuccessful DSRBasicCodedEntry("122310", "DCM", "Interventional device placement unsuccessful") +#define CODE_DCM_InterventionalDevicePlaced DSRBasicCodedEntry("122311", "DCM", "Interventional device placed") +#define CODE_DCM_InterventionPerformed DSRBasicCodedEntry("122312", "DCM", "Intervention performed") +#define CODE_DCM_InterventionalDeviceWithdrawn DSRBasicCodedEntry("122313", "DCM", "Interventional device withdrawn") +#define CODE_DCM_CatheterSize DSRBasicCodedEntry("122319", "DCM", "Catheter Size") +#define CODE_DCM_InjectateTemperature DSRBasicCodedEntry("122320", "DCM", "Injectate Temperature") +#define CODE_DCM_InjectateVolume DSRBasicCodedEntry("122321", "DCM", "Injectate Volume") +#define CODE_DCM_CalibrationFactor DSRBasicCodedEntry("122322", "DCM", "Calibration Factor") +#define CODE_DCM_IVUSReport DSRBasicCodedEntry("122325", "DCM", "IVUS Report") +#define CODE_DCM_EEMDiameter DSRBasicCodedEntry("122330", "DCM", "EEM Diameter") +#define CODE_DCM_PlaquePlusMediaThickness DSRBasicCodedEntry("122331", "DCM", "Plaque Plus Media Thickness") +#define CODE_DCM_LumenPerimeter DSRBasicCodedEntry("122332", "DCM", "Lumen Perimeter") +#define CODE_DCM_EEMCrossSectionalArea DSRBasicCodedEntry("122333", "DCM", "EEM Cross-Sectional Area") +#define CODE_DCM_PlaquePlusMediaCrossSectionalArea DSRBasicCodedEntry("122334", "DCM", "Plaque plus Media Cross-Sectional Area") +#define CODE_DCM_InStentNeointimalCrossSectionalArea DSRBasicCodedEntry("122335", "DCM", "In-Stent Neointimal Cross-Sectional Area") +#define CODE_DCM_VascularVolumeMeasurementLength DSRBasicCodedEntry("122336", "DCM", "Vascular Volume measurement length") +#define CODE_DCM_RelativePosition DSRBasicCodedEntry("122337", "DCM", "Relative position") +#define CODE_DCM_StentVolumeObstruction DSRBasicCodedEntry("122339", "DCM", "Stent Volume Obstruction") +#define CODE_DCM_FiducialFeature DSRBasicCodedEntry("122340", "DCM", "Fiducial feature") +#define CODE_DCM_CalciumLength DSRBasicCodedEntry("122341", "DCM", "Calcium Length") +#define CODE_DCM_LumenEccentricityIndex DSRBasicCodedEntry("122343", "DCM", "Lumen Eccentricity Index") +#define CODE_DCM_PlaquePlusMediaEccentricityIndex DSRBasicCodedEntry("122344", "DCM", "Plaque plus Media Eccentricity Index") +#define CODE_DCM_RemodelingIndex DSRBasicCodedEntry("122345", "DCM", "Remodeling Index") +#define CODE_DCM_StentSymmetryIndex DSRBasicCodedEntry("122346", "DCM", "Stent Symmetry Index") +#define CODE_DCM_StentExpansionIndex DSRBasicCodedEntry("122347", "DCM", "Stent Expansion Index") +#define CODE_DCM_LumenShapeIndex DSRBasicCodedEntry("122348", "DCM", "Lumen Shape Index") +#define CODE_DCM_LumenDiameterRatio DSRBasicCodedEntry("122350", "DCM", "Lumen Diameter Ratio") +#define CODE_DCM_StentDiameterRatio DSRBasicCodedEntry("122351", "DCM", "Stent Diameter Ratio") +#define CODE_DCM_EEMDiameterRatio DSRBasicCodedEntry("122352", "DCM", "EEM Diameter Ratio") +#define CODE_DCM_PlaqueBurden DSRBasicCodedEntry("122354", "DCM", "Plaque Burden") +#define CODE_DCM_ArcOfCalcium DSRBasicCodedEntry("122355", "DCM", "Arc of Calcium") +#define CODE_DCM_SoftPlaque DSRBasicCodedEntry("122356", "DCM", "Soft plaque") +#define CODE_DCM_InStentNeointima DSRBasicCodedEntry("122357", "DCM", "In-Stent Neointima") +#define CODE_DCM_TrueLumen DSRBasicCodedEntry("122360", "DCM", "True Lumen") +#define CODE_DCM_FalseLumen DSRBasicCodedEntry("122361", "DCM", "False Lumen") +#define CODE_DCM_PlaqueRupture DSRBasicCodedEntry("122363", "DCM", "Plaque Rupture") +#define CODE_DCM_StentGap DSRBasicCodedEntry("122364", "DCM", "Stent Gap") +#define CODE_DCM_T1Worst DSRBasicCodedEntry("122367", "DCM", "T-1 Worst") +#define CODE_DCM_T2Secondary DSRBasicCodedEntry("122368", "DCM", "T-2 Secondary") +#define CODE_DCM_T3Secondary DSRBasicCodedEntry("122369", "DCM", "T-3 Secondary") +#define CODE_DCM_T4Secondary DSRBasicCodedEntry("122370", "DCM", "T-4 Secondary") +#define CODE_DCM_EEMVolume DSRBasicCodedEntry("122371", "DCM", "EEM Volume") +#define CODE_DCM_LumenVolume DSRBasicCodedEntry("122372", "DCM", "Lumen Volume") +#define CODE_DCM_InStentNeointimalVolume DSRBasicCodedEntry("122374", "DCM", "In-Stent Neointimal Volume") +#define CODE_DCM_NativePlaqueVolume DSRBasicCodedEntry("122375", "DCM", "Native Plaque Volume") +#define CODE_DCM_TotalPlaqueVolume DSRBasicCodedEntry("122376", "DCM", "Total Plaque Volume") +#define CODE_DCM_ProximalReference DSRBasicCodedEntry("122380", "DCM", "Proximal Reference") +#define CODE_DCM_DistalReference DSRBasicCodedEntry("122381", "DCM", "Distal Reference") +#define CODE_DCM_SiteOfLumenMinimum DSRBasicCodedEntry("122382", "DCM", "Site of Lumen Minimum") +#define CODE_DCM_EntirePullback DSRBasicCodedEntry("122383", "DCM", "Entire Pullback") +#define CODE_DCM_StentedRegion DSRBasicCodedEntry("122384", "DCM", "Stented Region") +#define CODE_DCM_ProximalStentMargin DSRBasicCodedEntry("122385", "DCM", "Proximal Stent Margin") +#define CODE_DCM_DistalStentMargin DSRBasicCodedEntry("122386", "DCM", "Distal Stent Margin") +#define CODE_DCM_DissectionClassification DSRBasicCodedEntry("122387", "DCM", "Dissection Classification") +#define CODE_DCM_IntraStentDissection DSRBasicCodedEntry("122388", "DCM", "Intra-stent Dissection") +#define CODE_DCM_VulnerablePlaque DSRBasicCodedEntry("122389", "DCM", "Vulnerable Plaque") +#define CODE_DCM_ErodedPlaque DSRBasicCodedEntry("122390", "DCM", "Eroded Plaque") +#define CODE_DCM_RelativeStenosisSeverity DSRBasicCodedEntry("122391", "DCM", "Relative Stenosis Severity") +#define CODE_DCM_RestenoticLesion DSRBasicCodedEntry("122393", "DCM", "Restenotic Lesion") +#define CODE_DCM_FibroLipidicPlaque DSRBasicCodedEntry("122394", "DCM", "Fibro-Lipidic Plaque") +#define CODE_DCM_NecroticLipidicPlaque DSRBasicCodedEntry("122395", "DCM", "Necrotic-Lipidic Plaque") +#define CODE_DCM_AdventitialDissection DSRBasicCodedEntry("122397", "DCM", "Adventitial Dissection") +#define CODE_DCM_IntimalDissection DSRBasicCodedEntry("122398", "DCM", "Intimal Dissection") +#define CODE_DCM_MedialDissection DSRBasicCodedEntry("122399", "DCM", "Medial Dissection") +#define CODE_DCM_SimultaneouslyAcquired DSRBasicCodedEntry("122400", "DCM", "Simultaneously Acquired") +#define CODE_DCM_SameAnatomy DSRBasicCodedEntry("122401", "DCM", "Same Anatomy") +#define CODE_DCM_SameIndication DSRBasicCodedEntry("122402", "DCM", "Same Indication") +#define CODE_DCM_ForAttenuationCorrection DSRBasicCodedEntry("122403", "DCM", "For Attenuation Correction") +#define CODE_DCM_Reconstructed DSRBasicCodedEntry("122404", "DCM", "Reconstructed") +#define CODE_DCM_AlgorithmManufacturer DSRBasicCodedEntry("122405", "DCM", "Algorithm Manufacturer") +#define CODE_DCM_LeftAtrialEjectionFractionByAngiography DSRBasicCodedEntry("122406", "DCM", "Left Atrial Ejection Fraction by Angiography") +#define CODE_DCM_LeftAtrialEDVolume DSRBasicCodedEntry("122407", "DCM", "Left Atrial ED Volume") +#define CODE_DCM_LeftAtrialESVolume DSRBasicCodedEntry("122408", "DCM", "Left Atrial ES Volume") +#define CODE_DCM_ContourRealignment DSRBasicCodedEntry("122410", "DCM", "Contour Realignment") +#define CODE_DCM_ThresholdValue DSRBasicCodedEntry("122411", "DCM", "Threshold Value") +#define CODE_DCM_RegionalAbnormalWallMotion DSRBasicCodedEntry("122417", "DCM", "Regional Abnormal Wall Motion") +#define CODE_DCM_CalibrationObject DSRBasicCodedEntry("122421", "DCM", "Calibration Object") +#define CODE_DCM_CalibrationMethod DSRBasicCodedEntry("122422", "DCM", "Calibration Method") +#define CODE_DCM_CalibrationObjectSize DSRBasicCodedEntry("122423", "DCM", "Calibration Object Size") +#define CODE_DCM_AreaLengthMethod DSRBasicCodedEntry("122428", "DCM", "Area Length Method") +#define CODE_DCM_VolumeMethod DSRBasicCodedEntry("122429", "DCM", "Volume Method") +#define CODE_DCM_ReferenceMethod DSRBasicCodedEntry("122430", "DCM", "Reference Method") +#define CODE_DCM_RegressionSlopeED DSRBasicCodedEntry("122431", "DCM", "Regression Slope ED") +#define CODE_DCM_RegressionOffsetED DSRBasicCodedEntry("122432", "DCM", "Regression Offset ED") +#define CODE_DCM_RegressionSlopeES DSRBasicCodedEntry("122433", "DCM", "Regression Slope ES") +#define CODE_DCM_RegressionOffsetES DSRBasicCodedEntry("122434", "DCM", "Regression Offset ES") +#define CODE_DCM_RegressionVolumeExponent DSRBasicCodedEntry("122435", "DCM", "Regression Volume Exponent") +#define CODE_DCM_ReferencePoints DSRBasicCodedEntry("122438", "DCM", "Reference Points") +#define CODE_DCM_WallThickness DSRBasicCodedEntry("122445", "DCM", "Wall Thickness") +#define CODE_DCM_WallVolume DSRBasicCodedEntry("122446", "DCM", "Wall Volume") +#define CODE_DCM_WallMass DSRBasicCodedEntry("122447", "DCM", "Wall Mass") +#define CODE_DCM_WallStress DSRBasicCodedEntry("122448", "DCM", "Wall Stress") +#define CODE_DCM_CenterlineWallMotionAnalysis DSRBasicCodedEntry("122449", "DCM", "Centerline Wall Motion Analysis") +#define CODE_DCM_NormalizedChordLength DSRBasicCodedEntry("122450", "DCM", "Normalized Chord Length") +#define CODE_DCM_AbnormalRegion DSRBasicCodedEntry("122451", "DCM", "Abnormal Region") +#define CODE_DCM_FirstChordOfAbnormalRegion DSRBasicCodedEntry("122452", "DCM", "First Chord of Abnormal Region") +#define CODE_DCM_LastChordOfAbnormalRegion DSRBasicCodedEntry("122453", "DCM", "Last Chord of Abnormal Region") +#define CODE_DCM_TerritoryRegionSeverity DSRBasicCodedEntry("122459", "DCM", "Territory Region Severity") +#define CODE_DCM_OppositeRegionSeverity DSRBasicCodedEntry("122461", "DCM", "Opposite Region Severity") +#define CODE_DCM_LADRegionInRAOProjection DSRBasicCodedEntry("122464", "DCM", "LAD Region in RAO Projection") +#define CODE_DCM_RCARegionInROAProjection DSRBasicCodedEntry("122465", "DCM", "RCA Region in ROA Projection") +#define CODE_DCM_SingleLADRegionInRAOProjection DSRBasicCodedEntry("122466", "DCM", "Single LAD Region in RAO Projection") +#define CODE_DCM_SingleRCARegionInRAOProjection DSRBasicCodedEntry("122467", "DCM", "Single RCA Region in RAO Projection") +#define CODE_DCM_MultipleLADRegionInRAOProjection DSRBasicCodedEntry("122468", "DCM", "Multiple LAD Region in RAO Projection") +#define CODE_DCM_MultipleRCARegionInRAOProjection DSRBasicCodedEntry("122469", "DCM", "Multiple RCA Region in RAO Projection") +#define CODE_DCM_LADRegionInLAOProjection DSRBasicCodedEntry("122470", "DCM", "LAD Region in LAO Projection") +#define CODE_DCM_RCARegionInLAOProjection DSRBasicCodedEntry("122471", "DCM", "RCA Region in LAO Projection") +#define CODE_DCM_CFXRegionInLAOProjection DSRBasicCodedEntry("122472", "DCM", "CFX Region in LAO Projection") +#define CODE_DCM_CircularMethod DSRBasicCodedEntry("122473", "DCM", "Circular Method") +#define CODE_DCM_DensitometricMethod DSRBasicCodedEntry("122474", "DCM", "Densitometric Method") +#define CODE_DCM_CenterOfGravity DSRBasicCodedEntry("122475", "DCM", "Center of Gravity") +#define CODE_DCM_LongAxisBased DSRBasicCodedEntry("122476", "DCM", "Long Axis Based") +#define CODE_DCM_NoRealignment DSRBasicCodedEntry("122477", "DCM", "No Realignment") +#define CODE_DCM_VesselLumenCrossSectionalArea DSRBasicCodedEntry("122480", "DCM", "Vessel Lumen Cross-Sectional Area") +#define CODE_DCM_ContourStart DSRBasicCodedEntry("122481", "DCM", "Contour Start") +#define CODE_DCM_ContourEnd DSRBasicCodedEntry("122482", "DCM", "Contour End") +#define CODE_DCM_Sphere DSRBasicCodedEntry("122485", "DCM", "Sphere") +#define CODE_DCM_GeometricIsocenter DSRBasicCodedEntry("122486", "DCM", "Geometric Isocenter") +#define CODE_DCM_GeometricNonIsocenter DSRBasicCodedEntry("122487", "DCM", "Geometric Non-Isocenter") +#define CODE_DCM_CalibrationObjectUsed DSRBasicCodedEntry("122488", "DCM", "Calibration Object Used") +#define CODE_DCM_CurveFittedReference DSRBasicCodedEntry("122489", "DCM", "Curve Fitted Reference") +#define CODE_DCM_InterpolatedLocalReference DSRBasicCodedEntry("122490", "DCM", "Interpolated Local Reference") +#define CODE_DCM_MeanLocalReference DSRBasicCodedEntry("122491", "DCM", "Mean Local Reference") +#define CODE_DCM_RadialBasedWallMotionAnalysis DSRBasicCodedEntry("122493", "DCM", "Radial Based Wall Motion Analysis") +#define CODE_DCM_RegionalContributionToEjectionFraction DSRBasicCodedEntry("122495", "DCM", "Regional Contribution to Ejection Fraction") +#define CODE_DCM_RadialShortening DSRBasicCodedEntry("122496", "DCM", "Radial Shortening") +#define CODE_DCM_LandmarkBasedWallMotionAnalysis DSRBasicCodedEntry("122497", "DCM", "Landmark Based Wall Motion Analysis") +#define CODE_DCM_SliceContributionToEjectionFraction DSRBasicCodedEntry("122498", "DCM", "Slice Contribution to Ejection Fraction") +#define CODE_DCM_FrameToFrameAnalysis DSRBasicCodedEntry("122499", "DCM", "Frame to Frame Analysis") +#define CODE_DCM_AreaOfClosedIrregularPolygon DSRBasicCodedEntry("122501", "DCM", "Area of closed irregular polygon") +#define CODE_DCM_AreaOfAClosedNURBS DSRBasicCodedEntry("122502", "DCM", "Area of a closed NURBS") +#define CODE_DCM_IntegrationOfSumOfClosedAreasonContiguousSlices DSRBasicCodedEntry("122503", "DCM", "Integration of sum of closed areas on contiguous slices") +#define CODE_DCM_Calibration DSRBasicCodedEntry("122505", "DCM", "Calibration") +#define CODE_DCM_LeftContour DSRBasicCodedEntry("122507", "DCM", "Left Contour") +#define CODE_DCM_RightContour DSRBasicCodedEntry("122508", "DCM", "Right Contour") +#define CODE_DCM_DiameterGraph DSRBasicCodedEntry("122509", "DCM", "Diameter Graph") +#define CODE_DCM_LengthLuminalSegment DSRBasicCodedEntry("122510", "DCM", "Length Luminal Segment") +#define CODE_DCM_GraphIncrement DSRBasicCodedEntry("122511", "DCM", "Graph Increment") +#define CODE_DCM_SiteOfMaximumLuminal DSRBasicCodedEntry("122516", "DCM", "Site of Maximum Luminal") +#define CODE_DCM_DensitometricLuminalCrossSectionalAreaGraph DSRBasicCodedEntry("122517", "DCM", "Densitometric Luminal Cross-sectional Area Graph") +#define CODE_DCM_PositionOfProximalBorder DSRBasicCodedEntry("122528", "DCM", "Position of Proximal Border") +#define CODE_DCM_PositionOfDistalBorder DSRBasicCodedEntry("122529", "DCM", "Position of Distal Border") +#define CODE_DCM_PlaqueArea DSRBasicCodedEntry("122542", "DCM", "Plaque Area") +#define CODE_DCM_DiameterSymmetry DSRBasicCodedEntry("122544", "DCM", "Diameter Symmetry") +#define CODE_DCM_AreaSymmetry DSRBasicCodedEntry("122545", "DCM", "Area Symmetry") +#define CODE_DCM_InflowAngle DSRBasicCodedEntry("122546", "DCM", "Inflow Angle") +#define CODE_DCM_OutflowAngle DSRBasicCodedEntry("122547", "DCM", "Outflow Angle") +#define CODE_DCM_StenoticFlowReserve DSRBasicCodedEntry("122548", "DCM", "Stenotic Flow Reserve") +#define CODE_DCM_PoiseuilleResistance DSRBasicCodedEntry("122549", "DCM", "Poiseuille Resistance") +#define CODE_DCM_TurbulenceResistance DSRBasicCodedEntry("122550", "DCM", "Turbulence Resistance") +#define CODE_DCM_PressureDropAtSFR DSRBasicCodedEntry("122551", "DCM", "Pressure Drop at SFR") +#define CODE_DCM_SegmentationMethod DSRBasicCodedEntry("122554", "DCM", "Segmentation Method") +#define CODE_DCM_EstimatedNormalFlow DSRBasicCodedEntry("122555", "DCM", "Estimated Normal Flow") +#define CODE_DCM_AreaLengthKennedy DSRBasicCodedEntry("122558", "DCM", "Area Length Kennedy") +#define CODE_DCM_AreaLengthDodge DSRBasicCodedEntry("122559", "DCM", "Area Length Dodge") +#define CODE_DCM_AreaLengthWynne DSRBasicCodedEntry("122560", "DCM", "Area Length Wynne") +#define CODE_DCM_MultipleSlices DSRBasicCodedEntry("122562", "DCM", "Multiple Slices") +#define CODE_DCM_Boak DSRBasicCodedEntry("122563", "DCM", "Boak") +#define CODE_DCM_TSPyramid DSRBasicCodedEntry("122564", "DCM", "TS Pyramid") +#define CODE_DCM_TwoChamber DSRBasicCodedEntry("122565", "DCM", "Two Chamber") +#define CODE_DCM_Parallelepiped DSRBasicCodedEntry("122566", "DCM", "Parallelepiped") +#define CODE_DCM_BSA1dot219 DSRBasicCodedEntry("122572", "DCM", "BSA^1.219") +#define CODE_DCM_EquidistantMethod DSRBasicCodedEntry("122574", "DCM", "Equidistant method") +#define CODE_DCM_UserSelectedMethod DSRBasicCodedEntry("122575", "DCM", "User selected method") +#define CODE_DCM_LeftVentricularPosterobasalSegment DSRBasicCodedEntry("122582", "DCM", "Left ventricular posterobasal segment") +#define CODE_DCM_CardiovascularAnalysisReport DSRBasicCodedEntry("122600", "DCM", "Cardiovascular Analysis Report") +#define CODE_DCM_VentricularAnalysis DSRBasicCodedEntry("122601", "DCM", "Ventricular Analysis") +#define CODE_DCM_MyocardialPerfusionAnalysis DSRBasicCodedEntry("122602", "DCM", "Myocardial Perfusion Analysis") +#define CODE_DCM_CalciumScoringAnalysis DSRBasicCodedEntry("122603", "DCM", "Calcium Scoring Analysis") +#define CODE_DCM_FlowQuantification DSRBasicCodedEntry("122604", "DCM", "Flow Quantification") +#define CODE_DCM_VascularMorphologicalAnalysis DSRBasicCodedEntry("122605", "DCM", "Vascular Morphological Analysis") +#define CODE_DCM_VascularFunctionalAnalysis DSRBasicCodedEntry("122606", "DCM", "Vascular Functional Analysis") +#define CODE_DCM_ThickeningAnalysis DSRBasicCodedEntry("122607", "DCM", "Thickening Analysis") +#define CODE_DCM_AbsoluteValuesOfVentricularMeasurements DSRBasicCodedEntry("122608", "DCM", "Absolute Values Of Ventricular Measurements") +#define CODE_DCM_NormalizedValuesOfVentricularMeasurements DSRBasicCodedEntry("122609", "DCM", "Normalized Values Of Ventricular Measurements") +#define CODE_DCM_ReferencePoint DSRBasicCodedEntry("122611", "DCM", "Reference Point") +#define CODE_DCM_CentralBreathingPosition DSRBasicCodedEntry("122612", "DCM", "Central breathing position") +#define CODE_DCM_PeakEjectionRate DSRBasicCodedEntry("122616", "DCM", "Peak Ejection Rate") +#define CODE_DCM_PeakEjectionTime DSRBasicCodedEntry("122617", "DCM", "Peak Ejection Time") +#define CODE_DCM_PeakFillingRate DSRBasicCodedEntry("122618", "DCM", "Peak Filling Rate") +#define CODE_DCM_PeakFillingTime DSRBasicCodedEntry("122619", "DCM", "Peak Filling Time") +#define CODE_DCM_PapillaryMuscleExcluded DSRBasicCodedEntry("122620", "DCM", "Papillary Muscle Excluded") +#define CODE_DCM_PapillaryMuscleIncluded DSRBasicCodedEntry("122621", "DCM", "Papillary Muscle Included") +#define CODE_DCM_WallThicknessRatioEndSystolicToEndDiastolic DSRBasicCodedEntry("122624", "DCM", "Wall Thickness Ratio end-systolic to end-diastolic") +#define CODE_DCM_CurveFitMethod DSRBasicCodedEntry("122627", "DCM", "Curve Fit Method") +#define CODE_DCM_BaselineResultCorrection DSRBasicCodedEntry("122628", "DCM", "Baseline Result Correction") +#define CODE_DCM_SignalEarliestPeakTime DSRBasicCodedEntry("122631", "DCM", "Signal Earliest Peak Time") +#define CODE_DCM_SignalIncreaseStartTime DSRBasicCodedEntry("122633", "DCM", "Signal Increase Start Time") +#define CODE_DCM_SignalTimeToPeak DSRBasicCodedEntry("122634", "DCM", "Signal Time to Peak") +#define CODE_DCM_MRPerfusionPeak DSRBasicCodedEntry("122635", "DCM", "MR Perfusion Peak") +#define CODE_DCM_MRPerfusionSlope DSRBasicCodedEntry("122636", "DCM", "MR Perfusion Slope") +#define CODE_DCM_MRPerfusionTimeIntegral DSRBasicCodedEntry("122637", "DCM", "MR Perfusion Time Integral") +#define CODE_DCM_SignalBaselineStart DSRBasicCodedEntry("122638", "DCM", "Signal Baseline Start") +#define CODE_DCM_SignalBaselineEnd DSRBasicCodedEntry("122639", "DCM", "Signal Baseline End") +#define CODE_DCM_ImageInterval DSRBasicCodedEntry("122640", "DCM", "Image Interval") +#define CODE_DCM_VelocityEncodingMinimumValue DSRBasicCodedEntry("122642", "DCM", "Velocity Encoding Minimum Value") +#define CODE_DCM_VelocityEncodingMaximumValue DSRBasicCodedEntry("122643", "DCM", "Velocity Encoding Maximum Value") +#define CODE_DCM_NetForwardVolume DSRBasicCodedEntry("122645", "DCM", "Net Forward Volume") +#define CODE_DCM_AreaBasedMethod DSRBasicCodedEntry("122650", "DCM", "Area Based Method") +#define CODE_DCM_DiameterBasedMethod DSRBasicCodedEntry("122651", "DCM", "Diameter Based Method") +#define CODE_DCM_VolumeBasedMethod DSRBasicCodedEntry("122652", "DCM", "Volume Based Method") +#define CODE_DCM_NASCET DSRBasicCodedEntry("122655", "DCM", "NASCET") +#define CODE_DCM_ECST DSRBasicCodedEntry("122656", "DCM", "ECST") +#define CODE_DCM_AgatstonScoreThreshold DSRBasicCodedEntry("122657", "DCM", "Agatston Score Threshold") +#define CODE_DCM_CalciumMassThreshold DSRBasicCodedEntry("122658", "DCM", "Calcium Mass Threshold") +#define CODE_DCM_CalciumScoringCalibration DSRBasicCodedEntry("122659", "DCM", "Calcium Scoring Calibration") +#define CODE_DCM_CalciumVolume DSRBasicCodedEntry("122660", "DCM", "Calcium Volume") +#define CODE_DCM_CalciumMass DSRBasicCodedEntry("122661", "DCM", "Calcium Mass") +#define CODE_DCM_LateContrastEnhancement DSRBasicCodedEntry("122664", "DCM", "Late Contrast Enhancement") +#define CODE_DCM_TimeIntervalSinceInjectionOfContrastMedia DSRBasicCodedEntry("122665", "DCM", "Time interval since injection of contrast media") +#define CODE_DCM_TimeRelativeToRWavePeak DSRBasicCodedEntry("122666", "DCM", "Time relative to R-wave peak") +#define CODE_DCM_BloodVelocityVsTimeOfCardiacCycle DSRBasicCodedEntry("122667", "DCM", "Blood velocity vs. time of cardiac cycle") +#define CODE_DCM_TimeIntervalSinceDetectionOfContrastBolus DSRBasicCodedEntry("122668", "DCM", "Time interval since detection of contrast bolus") +#define CODE_DCM_PapillaryMuscleIncludedExcluded DSRBasicCodedEntry("122670", "DCM", "Papillary Muscle Included/Excluded") +#define CODE_DCM_AnteriorPosterior DSRBasicCodedEntry("122675", "DCM", "Anterior-Posterior") +#define CODE_DCM_Endoleak DSRBasicCodedEntry("122680", "DCM", "endoleak") +#define CODE_DCM_StentFracture DSRBasicCodedEntry("122683", "DCM", "Stent Fracture") +#define CODE_DCM_StentDisintegration DSRBasicCodedEntry("122684", "DCM", "Stent Disintegration") +#define CODE_DCM_StentComposition DSRBasicCodedEntry("122685", "DCM", "Stent Composition") +#define CODE_DCM_ParentVesselFinding DSRBasicCodedEntry("122686", "DCM", "Parent Vessel Finding") +#define CODE_DCM_SiteOfLumenMaximum DSRBasicCodedEntry("122687", "DCM", "Site of Lumen Maximum") +#define CODE_DCM_XConcept DSRBasicCodedEntry("122698", "DCM", "X-Concept") +#define CODE_DCM_YConcept DSRBasicCodedEntry("122699", "DCM", "Y-Concept") +#define CODE_DCM_IndicationsForPharmacologicalStress DSRBasicCodedEntry("122700", "DCM", "Indications for Pharmacological Stress") +#define CODE_DCM_ProcedureTimeBase DSRBasicCodedEntry("122701", "DCM", "Procedure time base") +#define CODE_DCM_TreadmillSpeed DSRBasicCodedEntry("122702", "DCM", "Treadmill speed") +#define CODE_DCM_TreadmillGradient DSRBasicCodedEntry("122703", "DCM", "Treadmill gradient") +#define CODE_DCM_ErgometerPower DSRBasicCodedEntry("122704", "DCM", "Ergometer power") +#define CODE_DCM_PharmacologicalStressAgentDoseRate DSRBasicCodedEntry("122705", "DCM", "Pharmacological Stress Agent Dose Rate") +#define CODE_DCM_RatingOfPerceivedExertion DSRBasicCodedEntry("122706", "DCM", "Rating of Perceived Exertion") +#define CODE_DCM_NumberOfEctopicBeats DSRBasicCodedEntry("122707", "DCM", "Number of Ectopic Beats") +#define CODE_DCM_DoubleProduct DSRBasicCodedEntry("122708", "DCM", "Double Product") +#define CODE_DCM_ActivityWorkload DSRBasicCodedEntry("122709", "DCM", "Activity workload") +#define CODE_DCM_TimeSinceStartOfStage DSRBasicCodedEntry("122710", "DCM", "Time since start of stage") +#define CODE_DCM_ExerciseDurationAfterStressAgentInjection DSRBasicCodedEntry("122711", "DCM", "Exercise duration after stress agent injection") +#define CODE_DCM_ImagingStartDateTime DSRBasicCodedEntry("122712", "DCM", "Imaging Start DateTime") +#define CODE_DCM_AttenuationCorrectionMethod DSRBasicCodedEntry("122713", "DCM", "Attenuation correction method") +#define CODE_DCM_PharmacologicalStressAgentDose DSRBasicCodedEntry("122715", "DCM", "Pharmacological Stress Agent Dose") +#define CODE_DCM_MaximumPowerOutputAchieved DSRBasicCodedEntry("122716", "DCM", "Maximum Power Output Achieved") +#define CODE_DCM_PeakActivityWorkload DSRBasicCodedEntry("122717", "DCM", "Peak activity workload") +#define CODE_DCM_PeakDoubleProduct DSRBasicCodedEntry("122718", "DCM", "Peak Double Product") +#define CODE_DCM_OSEMAlgorithm DSRBasicCodedEntry("122720", "DCM", "OSEM algorithm") +#define CODE_DCM_ChangMethod DSRBasicCodedEntry("122721", "DCM", "Chang method") +#define CODE_DCM_AlgorithmicAttenuationCorrection DSRBasicCodedEntry("122726", "DCM", "Algorithmic attenuation correction") +#define CODE_DCM_NMTransmissionAttenuationCorrection DSRBasicCodedEntry("122727", "DCM", "NM transmission attenuation correction") +#define CODE_DCM_CTBasedAttenuationCorrection DSRBasicCodedEntry("122728", "DCM", "CT-based attenuation correction") +#define CODE_DCM_NoAttenuationCorrection DSRBasicCodedEntry("122729", "DCM", "No Attenuation Correction") +#define CODE_DCM_BazettQTcAlgorithm DSRBasicCodedEntry("122730", "DCM", "Bazett QTc Algorithm") +#define CODE_DCM_HodgesQTcAlgorithm DSRBasicCodedEntry("122731", "DCM", "Hodges QTc Algorithm") +#define CODE_DCM_FridericiaQTcAlgorithm DSRBasicCodedEntry("122732", "DCM", "Fridericia QTc Algorithm") +#define CODE_DCM_FraminghamQTcAlgorithm DSRBasicCodedEntry("122733", "DCM", "Framingham QTc Algorithm") +#define CODE_DCM_BorgRPEScale DSRBasicCodedEntry("122734", "DCM", "Borg RPE Scale") +#define CODE_DCM_BorgCR10Scale DSRBasicCodedEntry("122735", "DCM", "Borg CR10 Scale") +#define CODE_DCM_OverallStudyQuality DSRBasicCodedEntry("122739", "DCM", "Overall study quality") +#define CODE_DCM_ExcellentImageQuality DSRBasicCodedEntry("122740", "DCM", "Excellent image quality") +#define CODE_DCM_GoodImageQuality DSRBasicCodedEntry("122741", "DCM", "Good image quality") +#define CODE_DCM_PoorImageQuality DSRBasicCodedEntry("122742", "DCM", "Poor image quality") +#define CODE_DCM_BodyHabitusAttenuation DSRBasicCodedEntry("122743", "DCM", "Body habitus attenuation") +#define CODE_DCM_BreastAttenuation DSRBasicCodedEntry("122744", "DCM", "Breast attenuation") +#define CODE_DCM_DiaphragmaticAttenuation DSRBasicCodedEntry("122745", "DCM", "Diaphragmatic attenuation") +#define CODE_DCM_FalsePositiveDefectFinding DSRBasicCodedEntry("122748", "DCM", "False positive defect finding") +#define CODE_DCM_NonDiagnostic_lowHeartRate DSRBasicCodedEntry("122750", "DCM", "Non-diagnostic - low heart rate") +#define CODE_DCM_NonDiagnostic_restingSTAbnormalities DSRBasicCodedEntry("122751", "DCM", "Non-diagnostic - resting ST abnormalities") +#define CODE_DCM_NonDiagnostic_ventricularPacingOrLBBB DSRBasicCodedEntry("122752", "DCM", "Non-diagnostic - ventricular pacing or LBBB") +#define CODE_DCM_NonDiagnosticECG DSRBasicCodedEntry("122753", "DCM", "Non-diagnostic ECG") +#define CODE_DCM_StronglyPositive DSRBasicCodedEntry("122755", "DCM", "Strongly positive") +#define CODE_DCM_StronglyPositive_STElevation DSRBasicCodedEntry("122756", "DCM", "Strongly positive - ST elevation") +#define CODE_DCM_STDepression_Horizontal DSRBasicCodedEntry("122757", "DCM", "ST Depression - Horizontal") +#define CODE_DCM_STDepression_Upsloping DSRBasicCodedEntry("122758", "DCM", "ST Depression - Upsloping") +#define CODE_DCM_STDepression_Downsloping DSRBasicCodedEntry("122759", "DCM", "ST Depression - Downsloping") +#define CODE_DCM_StressTestScore DSRBasicCodedEntry("122760", "DCM", "Stress test score") +#define CODE_DCM_NumberOfDiseasedVesselTerritories DSRBasicCodedEntry("122762", "DCM", "Number of diseased vessel territories") +#define CODE_DCM_WeightExceedsEquipmentLimit DSRBasicCodedEntry("122764", "DCM", "Weight exceeds equipment limit") +#define CODE_DCM_DifferenceInEjectionFraction DSRBasicCodedEntry("122768", "DCM", "Difference in Ejection Fraction") +#define CODE_DCM_DifferenceInEDLVVolume DSRBasicCodedEntry("122769", "DCM", "Difference in ED LV Volume") +#define CODE_DCM_RatioOfAchievedToPredictedMaximalOxygenConsumption DSRBasicCodedEntry("122770", "DCM", "Ratio of achieved to predicted maximal oxygen consumption") +#define CODE_DCM_RatioOfAchievedToPredictedFunctionalCapacity DSRBasicCodedEntry("122771", "DCM", "Ratio of achieved to predicted functional capacity") +#define CODE_DCM_AerobicIndex DSRBasicCodedEntry("122772", "DCM", "Aerobic index") +#define CODE_DCM_STHRIndex DSRBasicCodedEntry("122773", "DCM", "ST/HR Index") +#define CODE_DCM_AgreementWithPriorFindings DSRBasicCodedEntry("122775", "DCM", "Agreement with prior findings") +#define CODE_DCM_DisagreementWithPriorFindings DSRBasicCodedEntry("122776", "DCM", "Disagreement with prior findings") +#define CODE_DCM_RestThalliumStressTechnetiumProcedure DSRBasicCodedEntry("122781", "DCM", "Rest thallium/stress technetium procedure") +#define CODE_DCM_RestTechnetiumStressTechnetium1DayProcedure DSRBasicCodedEntry("122782", "DCM", "Rest technetium/stress technetium 1 day procedure") +#define CODE_DCM_RestTechnetiumStressTechnetium2DayProcedure DSRBasicCodedEntry("122783", "DCM", "Rest technetium/stress technetium 2 day procedure") +#define CODE_DCM_StressTechnetiumRestTechnetium1DayProcedure DSRBasicCodedEntry("122784", "DCM", "Stress technetium/rest technetium 1 day procedure") +#define CODE_DCM_NMMyocardialViabilityProcedure DSRBasicCodedEntry("122785", "DCM", "NM Myocardial Viability procedure") +#define CODE_DCM_PETMyocardialPerfusion_RestOnly DSRBasicCodedEntry("122791", "DCM", "PET Myocardial Perfusion, Rest only") +#define CODE_DCM_PETMyocardialPerfusion_StressOnly DSRBasicCodedEntry("122792", "DCM", "PET Myocardial Perfusion, Stress only") +#define CODE_DCM_PETMyocardialPerfusion_RestAndStress DSRBasicCodedEntry("122793", "DCM", "PET Myocardial Perfusion, Rest and Stress") +#define CODE_DCM_PETMyocardialViability_RestOnly DSRBasicCodedEntry("122795", "DCM", "PET Myocardial Viability, Rest only") +#define CODE_DCM_PETMyocardialViability_StressOnly DSRBasicCodedEntry("122796", "DCM", "PET Myocardial Viability, Stress only") +#define CODE_DCM_PETMyocardialViability_RestAndStress DSRBasicCodedEntry("122797", "DCM", "PET Myocardial Viability, Rest and Stress") +#define CODE_DCM_AnginalEquivalent DSRBasicCodedEntry("122799", "DCM", "Anginal Equivalent") +#define CODE_DCM_RETIRED_Radiopharmaceutical DSRBasicCodedEntry("123001", "DCM", "Radiopharmaceutical") +#define CODE_DCM_RadiopharmaceuticalStartDateTime DSRBasicCodedEntry("123003", "DCM", "Radiopharmaceutical Start DateTime") +#define CODE_DCM_RadiopharmaceuticalStopDateTime DSRBasicCodedEntry("123004", "DCM", "Radiopharmaceutical Stop DateTime") +#define CODE_DCM_RadiopharmaceuticalVolume DSRBasicCodedEntry("123005", "DCM", "Radiopharmaceutical Volume") +#define CODE_DCM_RadionuclideTotalDose DSRBasicCodedEntry("123006", "DCM", "Radionuclide Total Dose") +#define CODE_DCM_RadiopharmaceuticalSpecificActivity DSRBasicCodedEntry("123007", "DCM", "Radiopharmaceutical Specific Activity") +#define CODE_DCM_RadionuclideSyringeCounts DSRBasicCodedEntry("123009", "DCM", "Radionuclide Syringe Counts") +#define CODE_DCM_RadionuclideResidualSyringeCounts DSRBasicCodedEntry("123010", "DCM", "Radionuclide Residual Syringe Counts") +#define CODE_DCM_ContrastBolusAgent DSRBasicCodedEntry("123011", "DCM", "Contrast/Bolus Agent") +#define CODE_DCM_PreMedication DSRBasicCodedEntry("123012", "DCM", "Pre-Medication") +#define CODE_DCM_TargetRegion DSRBasicCodedEntry("123014", "DCM", "Target Region") +#define CODE_DCM_ImagingDirection DSRBasicCodedEntry("123015", "DCM", "Imaging Direction") +#define CODE_DCM_ImagingConditions DSRBasicCodedEntry("123016", "DCM", "Imaging Conditions") +#define CODE_DCM_Caudal10DegreeDistalCranioproximalOblique DSRBasicCodedEntry("123019", "DCM", "Caudal 10 degree distal-cranioproximal oblique") +#define CODE_DCM_NeighborhoodAnalysis DSRBasicCodedEntry("123101", "DCM", "Neighborhood Analysis") +#define CODE_DCM_AdaptiveFiltering DSRBasicCodedEntry("123102", "DCM", "Adaptive Filtering") +#define CODE_DCM_EdgeDetection DSRBasicCodedEntry("123103", "DCM", "Edge Detection") +#define CODE_DCM_MorphologicalOperations DSRBasicCodedEntry("123104", "DCM", "Morphological Operations") +#define CODE_DCM_HistogramAnalysis DSRBasicCodedEntry("123105", "DCM", "Histogram Analysis") +#define CODE_DCM_MultiScaleResolutionFiltering DSRBasicCodedEntry("123106", "DCM", "Multi-Scale/Resolution Filtering") +#define CODE_DCM_ClusterAnalysis DSRBasicCodedEntry("123107", "DCM", "Cluster Analysis") +#define CODE_DCM_MultispectralProcessing DSRBasicCodedEntry("123108", "DCM", "Multispectral Processing") +#define CODE_DCM_ManualProcessing DSRBasicCodedEntry("123109", "DCM", "Manual Processing") +#define CODE_DCM_ArtificialIntelligence DSRBasicCodedEntry("123110", "DCM", "Artificial Intelligence") +#define CODE_DCM_DeformableModels DSRBasicCodedEntry("123111", "DCM", "Deformable Models") +#define CODE_DCM_OBGYNUltrasoundProcedureReport DSRBasicCodedEntry("125000", "DCM", "OB-GYN Ultrasound Procedure Report") +#define CODE_DCM_FetalBiometryRatios DSRBasicCodedEntry("125001", "DCM", "Fetal Biometry Ratios") +#define CODE_DCM_FetalBiometry DSRBasicCodedEntry("125002", "DCM", "Fetal Biometry") +#define CODE_DCM_FetalLongBones DSRBasicCodedEntry("125003", "DCM", "Fetal Long Bones") +#define CODE_DCM_FetalCranium DSRBasicCodedEntry("125004", "DCM", "Fetal Cranium") +#define CODE_DCM_BiometryGroup DSRBasicCodedEntry("125005", "DCM", "Biometry Group") +#define CODE_DCM_BiophysicalProfile DSRBasicCodedEntry("125006", "DCM", "Biophysical Profile") +#define CODE_DCM_MeasurementGroup DSRBasicCodedEntry("125007", "DCM", "Measurement Group") +#define CODE_DCM_FetusSummary DSRBasicCodedEntry("125008", "DCM", "Fetus Summary") +#define CODE_DCM_EarlyGestation DSRBasicCodedEntry("125009", "DCM", "Early Gestation") +#define CODE_DCM_Identifier DSRBasicCodedEntry("125010", "DCM", "Identifier") +#define CODE_DCM_PelvisAndUterus DSRBasicCodedEntry("125011", "DCM", "Pelvis and Uterus") +#define CODE_DCM_GrowthPercentileRank DSRBasicCodedEntry("125012", "DCM", "Growth Percentile rank") +#define CODE_DCM_GrowthZScore DSRBasicCodedEntry("125013", "DCM", "Growth Z-score") +#define CODE_DCM_FetusCharacteristics DSRBasicCodedEntry("125015", "DCM", "Fetus Characteristics") +#define CODE_DCM_FetalMeasurements DSRBasicCodedEntry("125016", "DCM", "Fetal Measurements") +#define CODE_DCM_FrameOfReferenceIdentity DSRBasicCodedEntry("125021", "DCM", "Frame of Reference Identity") +#define CODE_DCM_FiducialAlignment DSRBasicCodedEntry("125022", "DCM", "Fiducial Alignment") +#define CODE_DCM_AcquisitionEquipmentAlignment DSRBasicCodedEntry("125023", "DCM", "Acquisition Equipment Alignment") +#define CODE_DCM_ImageContentBasedAlignment DSRBasicCodedEntry("125024", "DCM", "Image Content-based Alignment") +#define CODE_DCM_VisualAlignment DSRBasicCodedEntry("125025", "DCM", "Visual Alignment") +#define CODE_DCM_InterHemisphericPlane DSRBasicCodedEntry("125030", "DCM", "Inter-Hemispheric Plane") +#define CODE_DCM_RightHemisphereMostAnterior DSRBasicCodedEntry("125031", "DCM", "Right Hemisphere Most Anterior") +#define CODE_DCM_RightHemisphereMostPosterior DSRBasicCodedEntry("125032", "DCM", "Right Hemisphere Most Posterior") +#define CODE_DCM_RightHemisphereMostSuperior DSRBasicCodedEntry("125033", "DCM", "Right Hemisphere Most Superior") +#define CODE_DCM_RightHemisphereMostInferior DSRBasicCodedEntry("125034", "DCM", "Right Hemisphere Most Inferior") +#define CODE_DCM_LeftHemisphereMostAnterior DSRBasicCodedEntry("125035", "DCM", "Left Hemisphere Most Anterior") +#define CODE_DCM_LeftHemisphereMostPosterior DSRBasicCodedEntry("125036", "DCM", "Left Hemisphere Most Posterior") +#define CODE_DCM_LeftHemisphereMostSuperior DSRBasicCodedEntry("125037", "DCM", "Left Hemisphere Most Superior") +#define CODE_DCM_LeftHemisphereMostInferior DSRBasicCodedEntry("125038", "DCM", "Left Hemisphere Most Inferior") +#define CODE_DCM_Background DSRBasicCodedEntry("125040", "DCM", "Background") +#define CODE_DCM_RegistrationInput DSRBasicCodedEntry("125041", "DCM", "Registration Input") +#define CODE_DCM_VascularUltrasoundProcedureReport DSRBasicCodedEntry("125100", "DCM", "Vascular Ultrasound Procedure Report") +#define CODE_DCM_VesselBranch DSRBasicCodedEntry("125101", "DCM", "Vessel Branch") +#define CODE_DCM_GraftType DSRBasicCodedEntry("125102", "DCM", "Graft Type") +#define CODE_DCM_MeasurementOrientation DSRBasicCodedEntry("125105", "DCM", "Measurement Orientation") +#define CODE_DCM_DopplerAngle DSRBasicCodedEntry("125106", "DCM", "Doppler Angle") +#define CODE_DCM_SampleVolumeDepth DSRBasicCodedEntry("125107", "DCM", "Sample Volume Depth") +#define CODE_DCM_PediatricCardiacUltrasoundReport DSRBasicCodedEntry("125195", "DCM", "Pediatric Cardiac Ultrasound Report") +#define CODE_DCM_FetalCardiacUltrasoundReport DSRBasicCodedEntry("125196", "DCM", "Fetal Cardiac Ultrasound Report") +#define CODE_DCM_AdultCongenitalCardiacUltrasoundReport DSRBasicCodedEntry("125197", "DCM", "Adult Congenital Cardiac Ultrasound Report") +#define CODE_DCM_AdultEchocardiographyProcedureReport DSRBasicCodedEntry("125200", "DCM", "Adult Echocardiography Procedure Report") +#define CODE_DCM_IllustrationOfFinding DSRBasicCodedEntry("125201", "DCM", "Illustration of Finding") +#define CODE_DCM_LVWallMotionScoreIndex DSRBasicCodedEntry("125202", "DCM", "LV Wall Motion Score Index") +#define CODE_DCM_AcquisitionProtocol DSRBasicCodedEntry("125203", "DCM", "Acquisition Protocol") +#define CODE_DCM_AreaLengthBiplane DSRBasicCodedEntry("125204", "DCM", "Area-length biplane") +#define CODE_DCM_AreaLengthSinglePlane DSRBasicCodedEntry("125205", "DCM", "Area-Length Single Plane") +#define CODE_DCM_Cube DSRBasicCodedEntry("125206", "DCM", "Cube") +#define CODE_DCM_MethodOfDisks_Biplane DSRBasicCodedEntry("125207", "DCM", "Method of Disks, Biplane") +#define CODE_DCM_MethodOfDisks_SinglePlane DSRBasicCodedEntry("125208", "DCM", "Method of Disks, Single Plane") +#define CODE_DCM_Teichholz DSRBasicCodedEntry("125209", "DCM", "Teichholz") +#define CODE_DCM_AreaByPressureHalfTime DSRBasicCodedEntry("125210", "DCM", "Area by Pressure Half-Time") +#define CODE_DCM_BiplaneEllipse DSRBasicCodedEntry("125211", "DCM", "Biplane Ellipse") +#define CODE_DCM_ContinuityEquation DSRBasicCodedEntry("125212", "DCM", "Continuity Equation") +#define CODE_DCM_ContinuityEquationByMeanVelocity DSRBasicCodedEntry("125213", "DCM", "Continuity Equation by Mean Velocity") +#define CODE_DCM_ContinuityEquationByPeakVelocity DSRBasicCodedEntry("125214", "DCM", "Continuity Equation by Peak Velocity") +#define CODE_DCM_ContinuityEquationByVelocityTimeIntegral DSRBasicCodedEntry("125215", "DCM", "Continuity Equation by Velocity Time Integral") +#define CODE_DCM_ProximalIsovelocitySurfaceArea DSRBasicCodedEntry("125216", "DCM", "Proximal Isovelocity Surface Area") +#define CODE_DCM_FullBernoulli DSRBasicCodedEntry("125217", "DCM", "Full Bernoulli") +#define CODE_DCM_SimplifiedBernoulli DSRBasicCodedEntry("125218", "DCM", "Simplified Bernoulli") +#define CODE_DCM_DopplerVolumeFlow DSRBasicCodedEntry("125219", "DCM", "Doppler Volume Flow") +#define CODE_DCM_Planimetry DSRBasicCodedEntry("125220", "DCM", "Planimetry") +#define CODE_DCM_LeftVentricleMassByMMode DSRBasicCodedEntry("125221", "DCM", "Left Ventricle Mass by M-mode") +#define CODE_DCM_LeftVentricleMassByTruncatedEllipse DSRBasicCodedEntry("125222", "DCM", "Left Ventricle Mass by Truncated Ellipse") +#define CODE_DCM_4PointSegmentFindingScale DSRBasicCodedEntry("125223", "DCM", "4 Point Segment Finding Scale") +#define CODE_DCM_5PointSegmentFindingScale DSRBasicCodedEntry("125224", "DCM", "5 Point Segment Finding Scale") +#define CODE_DCM_5PointSegmentFindingScaleWithGradedHypokinesis DSRBasicCodedEntry("125225", "DCM", "5 Point Segment Finding Scale With Graded Hypokinesis") +#define CODE_DCM_SinglePlaneEllipse DSRBasicCodedEntry("125226", "DCM", "Single Plane Ellipse") +#define CODE_DCM_ModifiedSimpson DSRBasicCodedEntry("125227", "DCM", "Modified Simpson") +#define CODE_DCM_BulletMethod DSRBasicCodedEntry("125228", "DCM", "Bullet Method") +#define CODE_DCM_RETIRED_PowerDoppler DSRBasicCodedEntry("125230", "DCM", "Power Doppler") +#define CODE_DCM_RETIRED_3DMode DSRBasicCodedEntry("125231", "DCM", "3D mode") +#define CODE_DCM_StartOfDrugDoseAdministration DSRBasicCodedEntry("125233", "DCM", "Start of drug dose administration") +#define CODE_DCM_StartOfContrastAgentAdministration DSRBasicCodedEntry("125234", "DCM", "Start of contrast agent administration") +#define CODE_DCM_DestructionOfMicrobubbles DSRBasicCodedEntry("125235", "DCM", "Destruction of microbubbles") +#define CODE_DCM_OnsetOfExercise DSRBasicCodedEntry("125236", "DCM", "Onset of exercise") +#define CODE_DCM_CessationOfExercise DSRBasicCodedEntry("125237", "DCM", "Cessation of exercise") +#define CODE_DCM_OnsetOfStimulation DSRBasicCodedEntry("125238", "DCM", "Onset of stimulation") +#define CODE_DCM_CessationOfStimulation DSRBasicCodedEntry("125239", "DCM", "Cessation of stimulation") +#define CODE_DCM_LineScanPattern DSRBasicCodedEntry("125240", "DCM", "Line scan pattern") +#define CODE_DCM_PlaneScanPattern DSRBasicCodedEntry("125241", "DCM", "Plane scan pattern") +#define CODE_DCM_VolumeScanPattern DSRBasicCodedEntry("125242", "DCM", "Volume scan pattern") +#define CODE_DCM_NonImagingDopplerUltrasoundTransducerGeometry DSRBasicCodedEntry("125251", "DCM", "Non-imaging Doppler ultrasound transducer geometry") +#define CODE_DCM_LinearUltrasoundTransducerGeometry DSRBasicCodedEntry("125252", "DCM", "Linear ultrasound transducer geometry") +#define CODE_DCM_CurvedLinearUltrasoundTransducerGeometry DSRBasicCodedEntry("125253", "DCM", "Curved linear ultrasound transducer geometry") +#define CODE_DCM_SectorUltrasoundTransducerGeometry DSRBasicCodedEntry("125254", "DCM", "Sector ultrasound transducer geometry") +#define CODE_DCM_RadialUltrasoundTransducerGeometry DSRBasicCodedEntry("125255", "DCM", "Radial ultrasound transducer geometry") +#define CODE_DCM_RingUltrasoundTransducerGeometry DSRBasicCodedEntry("125256", "DCM", "Ring ultrasound transducer geometry") +#define CODE_DCM_FixedBeamDirection DSRBasicCodedEntry("125257", "DCM", "Fixed beam direction") +#define CODE_DCM_MechanicalBeamSteering DSRBasicCodedEntry("125258", "DCM", "Mechanical beam steering") +#define CODE_DCM_PhasedBeamSteering DSRBasicCodedEntry("125259", "DCM", "Phased beam steering") +#define CODE_DCM_ExternalTransducer DSRBasicCodedEntry("125261", "DCM", "External Transducer") +#define CODE_DCM_TransesophagealTransducer DSRBasicCodedEntry("125262", "DCM", "Transesophageal Transducer") +#define CODE_DCM_EndovaginalTransducer DSRBasicCodedEntry("125263", "DCM", "Endovaginal Transducer") +#define CODE_DCM_EndorectalTransducer DSRBasicCodedEntry("125264", "DCM", "Endorectal Transducer") +#define CODE_DCM_IntravascularTransducer DSRBasicCodedEntry("125265", "DCM", "Intravascular Transducer") +#define CODE_DCM_LeftVentricleMassByAreaLength DSRBasicCodedEntry("125270", "DCM", "Left Ventricle Mass by Area Length") +#define CODE_DCM_LeftVentricleMassByMMode_adjustedByHeight DSRBasicCodedEntry("125271", "DCM", "Left Ventricle Mass by M-mode - adjusted by Height") +#define CODE_DCM_LeftVentricleMassByTruncatedEllipse_adjustedByHeight DSRBasicCodedEntry("125272", "DCM", "Left Ventricle Mass by Truncated Ellipse - adjusted by Height") +#define CODE_DCM_LeftVentricleMassByAreaLength_adjustedByHeight DSRBasicCodedEntry("125273", "DCM", "Left Ventricle Mass by Area Length - adjusted by Height") +#define CODE_DCM_PreCoordinatedMeasurements DSRBasicCodedEntry("125301", "DCM", "Pre-coordinated Measurements") +#define CODE_DCM_PostCoordinatedMeasurements DSRBasicCodedEntry("125302", "DCM", "Post-coordinated Measurements") +#define CODE_DCM_AdhocMeasurements DSRBasicCodedEntry("125303", "DCM", "Adhoc Measurements") +#define CODE_DCM_UntrackableMeasurement DSRBasicCodedEntry("125304", "DCM", "Untrackable Measurement") +#define CODE_DCM_FindingObservationType DSRBasicCodedEntry("125305", "DCM", "Finding Observation Type") +#define CODE_DCM_MeasurementType DSRBasicCodedEntry("125306", "DCM", "Measurement Type") +#define CODE_DCM_MeasuredProperty DSRBasicCodedEntry("125307", "DCM", "Measured Property") +#define CODE_DCM_MeasurementDivisor DSRBasicCodedEntry("125308", "DCM", "Measurement Divisor") +#define CODE_DCM_ShortLabel DSRBasicCodedEntry("125309", "DCM", "Short Label") +#define CODE_DCM_StagedMeasurements DSRBasicCodedEntry("125310", "DCM", "Staged Measurements") +#define CODE_DCM_StructureOfTheFindingSite DSRBasicCodedEntry("125311", "DCM", "Structure of the Finding Site") +#define CODE_DCM_BehaviorOfTheFindingSite DSRBasicCodedEntry("125312", "DCM", "Behavior of the Finding Site") +#define CODE_DCM_Indexed DSRBasicCodedEntry("125313", "DCM", "Indexed") +#define CODE_DCM_FractionalChange DSRBasicCodedEntry("125314", "DCM", "Fractional Change") +#define CODE_DCM_Calculated DSRBasicCodedEntry("125315", "DCM", "Calculated") +#define CODE_DCM_DirectlyMeasured DSRBasicCodedEntry("125316", "DCM", "Directly measured") +#define CODE_DCM_RightVentricleOutflowTract_Distal DSRBasicCodedEntry("125317", "DCM", "Right Ventricle Outflow Tract, Distal") +#define CODE_DCM_RightVentricleOutflowTract_Proximal DSRBasicCodedEntry("125318", "DCM", "Right Ventricle Outflow Tract, Proximal") +#define CODE_DCM_RightVentricleAnteriorWall DSRBasicCodedEntry("125319", "DCM", "Right Ventricle Anterior Wall") +#define CODE_DCM_ElectromechanicalDelay DSRBasicCodedEntry("125320", "DCM", "Electromechanical Delay") +#define CODE_DCM_PreEjectionPeriod DSRBasicCodedEntry("125321", "DCM", "Pre-ejection Period") +#define CODE_DCM_AtrialDiastolicFilling_DWave DSRBasicCodedEntry("125322", "DCM", "Atrial Diastolic Filling (D-wave)") +#define CODE_DCM_ARWave DSRBasicCodedEntry("125323", "DCM", "AR-wave") +#define CODE_DCM_FullCardiacCycle DSRBasicCodedEntry("125324", "DCM", "Full Cardiac Cycle") +#define CODE_DCM_DyssynchronyIndex DSRBasicCodedEntry("125325", "DCM", "Dyssynchrony Index") +#define CODE_DCM_EffectiveOrificeArea DSRBasicCodedEntry("125326", "DCM", "Effective Orifice Area") +#define CODE_DCM_ExcursionDistance DSRBasicCodedEntry("125327", "DCM", "Excursion Distance") +#define CODE_DCM_MaximumOrificeArea DSRBasicCodedEntry("125328", "DCM", "Maximum Orifice Area") +#define CODE_DCM_PeakBloodPressure DSRBasicCodedEntry("125329", "DCM", "Peak Blood Pressure") +#define CODE_DCM_PeakTissueVelocity DSRBasicCodedEntry("125330", "DCM", "Peak Tissue Velocity") +#define CODE_DCM_PISARadius DSRBasicCodedEntry("125331", "DCM", "PISA Radius") +#define CODE_DCM_RegurgitationJetArea DSRBasicCodedEntry("125332", "DCM", "Regurgitation Jet Area") +#define CODE_DCM_RegurgitationJetWidth DSRBasicCodedEntry("125333", "DCM", "Regurgitation Jet Width") +#define CODE_DCM_VenaContractaWidth DSRBasicCodedEntry("125334", "DCM", "Vena Contracta Width") +#define CODE_DCM_CARDIOsphere DSRBasicCodedEntry("125901", "DCM", "CARDIOsphere") +#define CODE_DCM_Echovist DSRBasicCodedEntry("125902", "DCM", "Echovist") +#define CODE_DCM_Imagify DSRBasicCodedEntry("125903", "DCM", "Imagify") +#define CODE_DCM_Levovist DSRBasicCodedEntry("125904", "DCM", "Levovist") +#define CODE_DCM_Sonazoid DSRBasicCodedEntry("125905", "DCM", "Sonazoid") +#define CODE_DCM_SonoVue DSRBasicCodedEntry("125906", "DCM", "SonoVue") +#define CODE_DCM_TargestarB DSRBasicCodedEntry("125907", "DCM", "Targestar-B") +#define CODE_DCM_TargestarP DSRBasicCodedEntry("125908", "DCM", "Targestar-P") +#define CODE_DCM_ImagingMeasurementReport DSRBasicCodedEntry("126000", "DCM", "Imaging Measurement Report") +#define CODE_DCM_OncologyMeasurementReport DSRBasicCodedEntry("126001", "DCM", "Oncology Measurement Report") +#define CODE_DCM_DynamicContrastMRMeasurementReport DSRBasicCodedEntry("126002", "DCM", "Dynamic Contrast MR Measurement Report") +#define CODE_DCM_PETMeasurementReport DSRBasicCodedEntry("126003", "DCM", "PET Measurement Report") +#define CODE_DCM_ImagingMeasurements DSRBasicCodedEntry("126010", "DCM", "Imaging Measurements") +#define CODE_DCM_DerivedImagingMeasurements DSRBasicCodedEntry("126011", "DCM", "Derived Imaging Measurements") +#define CODE_DCM_MultiparametricMRI DSRBasicCodedEntry("126020", "DCM", "Multiparametric MRI") +#define CODE_DCM_MultiparametricMRIOfProstate DSRBasicCodedEntry("126021", "DCM", "Multiparametric MRI of prostate") +#define CODE_DCM_MultiparametricMRIOfWholeBody DSRBasicCodedEntry("126022", "DCM", "Multiparametric MRI of whole body") +#define CODE_DCM_SumOfSegmentedVoxelVolumes DSRBasicCodedEntry("126030", "DCM", "Sum of segmented voxel volumes") +#define CODE_DCM_PeakValueWithinROI DSRBasicCodedEntry("126031", "DCM", "Peak Value Within ROI") +#define CODE_DCM_MetabolicVolume DSRBasicCodedEntry("126032", "DCM", "Metabolic Volume") +#define CODE_DCM_TotalLesionGlycolysis DSRBasicCodedEntry("126033", "DCM", "Total Lesion Glycolysis") +#define CODE_DCM_Glycolysis DSRBasicCodedEntry("126034", "DCM", "Glycolysis") +#define CODE_DCM_TotalLesionProliferation DSRBasicCodedEntry("126035", "DCM", "Total Lesion Proliferation") +#define CODE_DCM_ProliferativeActivity DSRBasicCodedEntry("126036", "DCM", "Proliferative Activity") +#define CODE_DCM_StandardizedAddedMetabolicActivity_SAM DSRBasicCodedEntry("126037", "DCM", "Standardized Added Metabolic Activity (SAM)") +#define CODE_DCM_StandardizedAddedMetabolicActivity_SAM_Background DSRBasicCodedEntry("126038", "DCM", "Standardized Added Metabolic Activity (SAM) Background") +#define CODE_DCM_LesionToBackgroundSUVRatio DSRBasicCodedEntry("126039", "DCM", "Lesion to Background SUV Ratio") +#define CODE_DCM_BackgroundForLesionToBackgroundSUVRatio DSRBasicCodedEntry("126040", "DCM", "Background for Lesion to Background SUV Ratio") +#define CODE_DCM_FractalDimension DSRBasicCodedEntry("126050", "DCM", "Fractal Dimension") +#define CODE_DCM_Skewness DSRBasicCodedEntry("126051", "DCM", "Skewness") +#define CODE_DCM_Kurtosis DSRBasicCodedEntry("126052", "DCM", "Kurtosis") +#define CODE_DCM_RETIRED_JointEntropyOfGLCM DSRBasicCodedEntry("126060", "DCM", "Joint Entropy of GLCM") +#define CODE_DCM_RootAngularSecondMomentOfGLCM DSRBasicCodedEntry("126061", "DCM", "Root Angular Second Moment of GLCM") +#define CODE_DCM_InverseDifferenceMomentOfGLCM DSRBasicCodedEntry("126062", "DCM", "Inverse Difference Moment of GLCM") +#define CODE_DCM_ContrastOfGLCM DSRBasicCodedEntry("126063", "DCM", "Contrast of GLCM") +#define CODE_DCM_DissimilarityOfGLCM DSRBasicCodedEntry("126064", "DCM", "Dissimilarity of GLCM") +#define CODE_DCM_AngularSecondMomentOfGLCM DSRBasicCodedEntry("126065", "DCM", "Angular Second Moment of GLCM") +#define CODE_DCM_CorrelationOfGLCM DSRBasicCodedEntry("126066", "DCM", "Correlation of GLCM") +#define CODE_DCM_GrayLevelCoOccurrenceMatrix DSRBasicCodedEntry("126067", "DCM", "Gray Level Co-occurrence Matrix") +#define CODE_DCM_SubjectTimePointIdentifier DSRBasicCodedEntry("126070", "DCM", "Subject Time Point Identifier") +#define CODE_DCM_ProtocolTimePointIdentifier DSRBasicCodedEntry("126071", "DCM", "Protocol Time Point Identifier") +#define CODE_DCM_TimePointType DSRBasicCodedEntry("126072", "DCM", "Time Point Type") +#define CODE_DCM_TimePointOrder DSRBasicCodedEntry("126073", "DCM", "Time Point Order") +#define CODE_DCM_Posttreatment DSRBasicCodedEntry("126074", "DCM", "Posttreatment") +#define CODE_DCM_Eligibility DSRBasicCodedEntry("126075", "DCM", "Eligibility") +#define CODE_DCM_RECIST1dot0 DSRBasicCodedEntry("126080", "DCM", "RECIST 1.0") +#define CODE_DCM_RECIST1dot1 DSRBasicCodedEntry("126081", "DCM", "RECIST 1.1") +#define CODE_DCM_RealWorldValueMapUsedForMeasurement DSRBasicCodedEntry("126100", "DCM", "Real World Value Map used for measurement") +#define CODE_DCM_ImageLibraryGroup DSRBasicCodedEntry("126200", "DCM", "Image Library Group") +#define CODE_DCM_AcquisitionDate DSRBasicCodedEntry("126201", "DCM", "Acquisition Date") +#define CODE_DCM_AcquisitionTime DSRBasicCodedEntry("126202", "DCM", "Acquisition Time") +#define CODE_DCM_PETRadionuclideIncubationTime DSRBasicCodedEntry("126203", "DCM", "PET Radionuclide Incubation Time") +#define CODE_DCM_R2Coefficient DSRBasicCodedEntry("126220", "DCM", "R2-Coefficient") +#define CODE_DCM_ChiSquare DSRBasicCodedEntry("126221", "DCM", "Chi-square") +#define CODE_DCM_DW DSRBasicCodedEntry("126222", "DCM", "D-W") +#define CODE_DCM_AIC DSRBasicCodedEntry("126223", "DCM", "AIC") +#define CODE_DCM_BIC DSRBasicCodedEntry("126224", "DCM", "BIC") +#define CODE_DCM_PerfusionAnalysisByStableXenonCTTechnique DSRBasicCodedEntry("126300", "DCM", "Perfusion analysis by Stable Xenon CT technique") +#define CODE_DCM_PerfusionAnalysisByIVIodinatedContrastCTTechnique DSRBasicCodedEntry("126301", "DCM", "Perfusion analysis by IV Iodinated Contrast CT technique") +#define CODE_DCM_PerfusionAnalysisByArterialSpinLabelingMRTechnique DSRBasicCodedEntry("126302", "DCM", "Perfusion analysis by Arterial Spin Labeling MR technique") +#define CODE_DCM_PerfusionAnalysisBySusceptibilityMRTechnique DSRBasicCodedEntry("126303", "DCM", "Perfusion analysis by Susceptibility MR technique") +#define CODE_DCM_LeastMeanSquare_LMS_deconvolution DSRBasicCodedEntry("126310", "DCM", "Least Mean Square (LMS) deconvolution") +#define CODE_DCM_SingularValueDecomposition_SVD_deconvolution DSRBasicCodedEntry("126311", "DCM", "Singular Value Decomposition (SVD) deconvolution") +#define CODE_DCM_Ktrans DSRBasicCodedEntry("126312", "DCM", "Ktrans") +#define CODE_DCM_Kep DSRBasicCodedEntry("126313", "DCM", "kep") +#define CODE_DCM_Ve DSRBasicCodedEntry("126314", "DCM", "ve") +#define CODE_DCM_IAUC DSRBasicCodedEntry("126320", "DCM", "IAUC") +#define CODE_DCM_IAUC60 DSRBasicCodedEntry("126321", "DCM", "IAUC60") +#define CODE_DCM_IAUC90 DSRBasicCodedEntry("126322", "DCM", "IAUC90") +#define CODE_DCM_IAUC180 DSRBasicCodedEntry("126323", "DCM", "IAUC180") +#define CODE_DCM_IAUCBN DSRBasicCodedEntry("126324", "DCM", "IAUCBN") +#define CODE_DCM_IAUCBN60 DSRBasicCodedEntry("126325", "DCM", "IAUCBN60") +#define CODE_DCM_IAUCBN90 DSRBasicCodedEntry("126326", "DCM", "IAUCBN90") +#define CODE_DCM_AUCBN180 DSRBasicCodedEntry("126327", "DCM", "AUCBN180") +#define CODE_DCM_Tau_m DSRBasicCodedEntry("126330", "DCM", "tau_m") +#define CODE_DCM_Vp DSRBasicCodedEntry("126331", "DCM", "vp") +#define CODE_DCM_StandardToftsModel DSRBasicCodedEntry("126340", "DCM", "Standard Tofts Model") +#define CODE_DCM_ExtendedToftsModel DSRBasicCodedEntry("126341", "DCM", "Extended Tofts Model") +#define CODE_DCM_ModelFreeConcentrationTimeQuantitification DSRBasicCodedEntry("126342", "DCM", "Model-free concentration-time quantitification") +#define CODE_DCM_FirstPassLeakageProfile_FPLP_Model DSRBasicCodedEntry("126343", "DCM", "First Pass Leakage Profile (FPLP) Model") +#define CODE_DCM_ShutterSpeedModel_SSM DSRBasicCodedEntry("126344", "DCM", "Shutter-Speed Model (SSM)") +#define CODE_DCM_GammaCapillaryTransitTime_GCCT_Model DSRBasicCodedEntry("126345", "DCM", "Gamma Capillary Transit Time (GCCT) Model") +#define CODE_DCM_AdiabaticTissueHomogeneity_ATH_Model DSRBasicCodedEntry("126346", "DCM", "Adiabatic Tissue Homogeneity (ATH) Model") +#define CODE_DCM_TwoCompartmentExchange_2CX_Model DSRBasicCodedEntry("126347", "DCM", "Two Compartment Exchange (2CX) Model") +#define CODE_DCM_T1ByMultipleFlipAngles DSRBasicCodedEntry("126350", "DCM", "T1 by Multiple Flip Angles") +#define CODE_DCM_T1ByInversionRecovery DSRBasicCodedEntry("126351", "DCM", "T1 by Inversion Recovery") +#define CODE_DCM_T1ByFixedValue DSRBasicCodedEntry("126352", "DCM", "T1 by Fixed Value") +#define CODE_DCM_T1UsedForCalculation DSRBasicCodedEntry("126353", "DCM", "T1 Used For Calculation") +#define CODE_DCM_AIFIgnored DSRBasicCodedEntry("126360", "DCM", "AIF Ignored") +#define CODE_DCM_PopulationAveragedAIF DSRBasicCodedEntry("126361", "DCM", "Population Averaged AIF") +#define CODE_DCM_UserDefinedAIFROI DSRBasicCodedEntry("126362", "DCM", "User-defined AIF ROI") +#define CODE_DCM_AutomaticallyDetectedAIFROI DSRBasicCodedEntry("126363", "DCM", "Automatically Detected AIF ROI") +#define CODE_DCM_BlindEstimationOfAIF DSRBasicCodedEntry("126364", "DCM", "Blind Estimation of AIF") +#define CODE_DCM_TimeOfPeakConcentration DSRBasicCodedEntry("126370", "DCM", "Time of Peak Concentration") +#define CODE_DCM_BolusArrivalTime DSRBasicCodedEntry("126371", "DCM", "Bolus Arrival Time") +#define CODE_DCM_TimeOfLeadingHalfPeakConcentration DSRBasicCodedEntry("126372", "DCM", "Time of Leading Half-Peak Concentration") +#define CODE_DCM_TemporalDerivativeExceedsThreshold DSRBasicCodedEntry("126373", "DCM", "Temporal Derivative Exceeds Threshold") +#define CODE_DCM_TemporalDerivativeThreshold DSRBasicCodedEntry("126374", "DCM", "Temporal Derivative Threshold") +#define CODE_DCM_MaximumSlope DSRBasicCodedEntry("126375", "DCM", "Maximum Slope") +#define CODE_DCM_MaximumDifference DSRBasicCodedEntry("126376", "DCM", "Maximum Difference") +#define CODE_DCM_TracerConcentration DSRBasicCodedEntry("126377", "DCM", "Tracer Concentration") +#define CODE_DCM_ContrastLongitudinalRelaxivity DSRBasicCodedEntry("126380", "DCM", "Contrast Longitudinal Relaxivity") +#define CODE_DCM_AbsoluteRegionalBloodFlow DSRBasicCodedEntry("126390", "DCM", "Absolute Regional Blood Flow") +#define CODE_DCM_AbsoluteRegionalBloodVolume DSRBasicCodedEntry("126391", "DCM", "Absolute Regional Blood Volume") +#define CODE_DCM_OxygenExtractionFraction DSRBasicCodedEntry("126392", "DCM", "Oxygen Extraction Fraction") +#define CODE_DCM_R1 DSRBasicCodedEntry("126393", "DCM", "R1") +#define CODE_DCM_R2 DSRBasicCodedEntry("126394", "DCM", "R2") +#define CODE_DCM_R2Star DSRBasicCodedEntry("126395", "DCM", "R2*") +#define CODE_DCM_MagneticSusceptibility DSRBasicCodedEntry("126396", "DCM", "Magnetic Susceptibility") +#define CODE_DCM_RelativeRegionalBloodFlow DSRBasicCodedEntry("126397", "DCM", "Relative Regional Blood Flow") +#define CODE_DCM_RelativeRegionalBloodVolume DSRBasicCodedEntry("126398", "DCM", "Relative Regional Blood Volume") +#define CODE_DCM_StandardizedUptakeValue DSRBasicCodedEntry("126400", "DCM", "Standardized Uptake Value") +#define CODE_DCM_SUVbw DSRBasicCodedEntry("126401", "DCM", "SUVbw") +#define CODE_DCM_SUVlbm DSRBasicCodedEntry("126402", "DCM", "SUVlbm") +#define CODE_DCM_SUVbsa DSRBasicCodedEntry("126403", "DCM", "SUVbsa") +#define CODE_DCM_SUVibw DSRBasicCodedEntry("126404", "DCM", "SUVibw") +#define CODE_DCM_SUVlbmJanma DSRBasicCodedEntry("126405", "DCM", "SUVlbm(Janma)") +#define CODE_DCM_SUVlbmJames128 DSRBasicCodedEntry("126406", "DCM", "SUVlbm(James128)") +#define CODE_DCM_SUVBodyWeightCalculationMethod DSRBasicCodedEntry("126410", "DCM", "SUV body weight calculation method") +#define CODE_DCM_SUVLeanBodyMassCalculationMethod DSRBasicCodedEntry("126411", "DCM", "SUV lean body mass calculation method") +#define CODE_DCM_SUVBodySurfaceAreaCalculationMethod DSRBasicCodedEntry("126412", "DCM", "SUV body surface area calculation method") +#define CODE_DCM_SUVIdealBodyWeightCalculationMethod DSRBasicCodedEntry("126413", "DCM", "SUV ideal body weight calculation method") +#define CODE_DCM_SUVLeanBodyMassCalculationJanmahasatianMethod DSRBasicCodedEntry("126414", "DCM", "SUV lean body mass calculation Janmahasatian method") +#define CODE_DCM_SUVLeanBodyMassCalculationMethodUsing128Multiplier DSRBasicCodedEntry("126415", "DCM", "SUV lean body mass calculation method using 128 multiplier") +#define CODE_DCM_PittsburghCompoundB_C11 DSRBasicCodedEntry("126500", "DCM", "Pittsburgh compound B C^11^") +#define CODE_DCM_Florbetaben_F18 DSRBasicCodedEntry("126501", "DCM", "Florbetaben F^18^") +#define CODE_DCM_T807_F18 DSRBasicCodedEntry("126502", "DCM", "T807 F^18^") +#define CODE_DCM_Flubatine_F18 DSRBasicCodedEntry("126503", "DCM", "Flubatine F^18^") +#define CODE_DCM_MonoclonalAntibody_mAb_64Cu DSRBasicCodedEntry("126510", "DCM", "Monoclonal Antibody (mAb) ^64^Cu") +#define CODE_DCM_MonoclonalAntibody_mAb_89Zr DSRBasicCodedEntry("126511", "DCM", "Monoclonal Antibody (mAb) ^89^Zr") +#define CODE_DCM_Trastuzumab_89Zr DSRBasicCodedEntry("126512", "DCM", "Trastuzumab ^89^Zr") +#define CODE_DCM_Cetuximab_89Zr DSRBasicCodedEntry("126513", "DCM", "Cetuximab ^89^Zr") +#define CODE_DCM_J591_89Zr DSRBasicCodedEntry("126514", "DCM", "J591 ^89^Zr") +#define CODE_DCM_CU36_89Zr DSRBasicCodedEntry("126515", "DCM", "cU36 ^89^Zr") +#define CODE_DCM_Bevacizumab_89Zr DSRBasicCodedEntry("126516", "DCM", "Bevacizumab ^89^Zr") +#define CODE_DCM_CG250Fab2_89Zr DSRBasicCodedEntry("126517", "DCM", "cG250-F(ab')(2) ^89^Zr") +#define CODE_DCM_R1507_89Zr DSRBasicCodedEntry("126518", "DCM", "R1507 ^89^Zr") +#define CODE_DCM_E4G10_89Zr DSRBasicCodedEntry("126519", "DCM", "E4G10 ^89^Zr") +#define CODE_DCM_DfCD45_89Zr DSRBasicCodedEntry("126520", "DCM", "Df-CD45 ^89^Zr") +#define CODE_DCM_44Scandium DSRBasicCodedEntry("126600", "DCM", "^44^Scandium") +#define CODE_DCM_51Manganese DSRBasicCodedEntry("126601", "DCM", "^51^Manganese") +#define CODE_DCM_70Arsenic DSRBasicCodedEntry("126602", "DCM", "^70^Arsenic") +#define CODE_DCM_90Niobium DSRBasicCodedEntry("126603", "DCM", "^90^Niobium") +#define CODE_DCM_191mIridium DSRBasicCodedEntry("126604", "DCM", "^191m^Iridium") +#define CODE_DCM_43Scandium DSRBasicCodedEntry("126605", "DCM", "^43^Scandium") +#define CODE_DCM_152Terbium DSRBasicCodedEntry("126606", "DCM", "^152^Terbium") +#define CODE_DCM_52mManganese DSRBasicCodedEntry("126607", "DCM", "^52m^Manganese") +#define CODE_DCM_ATSM_Cu60 DSRBasicCodedEntry("126700", "DCM", "ATSM Cu^60^") +#define CODE_DCM_ATSM_Cu61 DSRBasicCodedEntry("126701", "DCM", "ATSM Cu^61^") +#define CODE_DCM_ATSM_Cu62 DSRBasicCodedEntry("126702", "DCM", "ATSM Cu^62^") +#define CODE_DCM_Choline_C11 DSRBasicCodedEntry("126703", "DCM", "Choline C^11^") +#define CODE_DCM_Fallypride_C11 DSRBasicCodedEntry("126704", "DCM", "Fallypride C^11^") +#define CODE_DCM_Fallypride_F18 DSRBasicCodedEntry("126705", "DCM", "Fallypride F^18^") +#define CODE_DCM_FLB457_C11 DSRBasicCodedEntry("126706", "DCM", "FLB 457 C^11^") +#define CODE_DCM_Fluorotriopride_F18 DSRBasicCodedEntry("126707", "DCM", "Fluorotriopride F^18^") +#define CODE_DCM_Fluoromisonidazole_FMISO_F18 DSRBasicCodedEntry("126708", "DCM", "Fluoromisonidazole (FMISO) F^18^") +#define CODE_DCM_Glutamine_C11 DSRBasicCodedEntry("126709", "DCM", "Glutamine C^11^") +#define CODE_DCM_Glutamine_C14 DSRBasicCodedEntry("126710", "DCM", "Glutamine C^14^") +#define CODE_DCM_Glutamine_F18 DSRBasicCodedEntry("126711", "DCM", "Glutamine F^18^") +#define CODE_DCM_RETIRED_Flubatine_F18 DSRBasicCodedEntry("126712", "DCM", "Flubatine F^18^") +#define CODE_DCM_2FA_F18 DSRBasicCodedEntry("126713", "DCM", "2FA F^18^") +#define CODE_DCM_Nifene_F18 DSRBasicCodedEntry("126714", "DCM", "Nifene F^18^") +#define CODE_DCM_CLR1404_I124 DSRBasicCodedEntry("126715", "DCM", "CLR1404 I^124^") +#define CODE_DCM_CLR1404_I131 DSRBasicCodedEntry("126716", "DCM", "CLR1404 I^131^") +#define CODE_DCM_RETIRED_THK5351_F18 DSRBasicCodedEntry("126717", "DCM", "THK5351 F^18^") +#define CODE_DCM_Flurpiridaz_F18 DSRBasicCodedEntry("126718", "DCM", "Flurpiridaz F^18^") +#define CODE_DCM_RO6924963_11C DSRBasicCodedEntry("126719", "DCM", "RO6924963 ^11^C") +#define CODE_DCM_RO6931643_11C DSRBasicCodedEntry("126720", "DCM", "RO6931643 ^11^C") +#define CODE_DCM_Obinituzimab_89Zr DSRBasicCodedEntry("126721", "DCM", "Obinituzimab ^89^Zr") +#define CODE_DCM_Benralizumab_89Zr DSRBasicCodedEntry("126722", "DCM", "Benralizumab ^89^Zr") +#define CODE_DCM_Ocaratuzumab_89Zr DSRBasicCodedEntry("126723", "DCM", "Ocaratuzumab ^89^Zr") +#define CODE_DCM_GlembatumumabVedotin_89Zr DSRBasicCodedEntry("126724", "DCM", "Glembatumumab vedotin ^89^Zr") +#define CODE_DCM_PinatuzumabVedotin_89Zr DSRBasicCodedEntry("126725", "DCM", "Pinatuzumab vedotin ^89^Zr") +#define CODE_DCM_PolatuzumabVedotin_89Zr DSRBasicCodedEntry("126726", "DCM", "Polatuzumab vedotin ^89^Zr") +#define CODE_DCM_Blinatumomab_89Zr DSRBasicCodedEntry("126727", "DCM", "Blinatumomab ^89^Zr") +#define CODE_DCM_Pegdinetanib_89Zr DSRBasicCodedEntry("126728", "DCM", "Pegdinetanib ^89^Zr") +#define CODE_DCM_AGN150998_89Zr DSRBasicCodedEntry("126729", "DCM", "AGN-150998 ^89^Zr") +#define CODE_DCM_MEDI551_89Zr DSRBasicCodedEntry("126730", "DCM", "MEDI-551 ^89^Zr") +#define CODE_DCM_GA201_89Zr DSRBasicCodedEntry("126731", "DCM", "GA201 ^89^Zr") +#define CODE_DCM_Ecromeximab_89Zr DSRBasicCodedEntry("126732", "DCM", "Ecromeximab ^89^Zr") +#define CODE_DCM_Roledumab_89Zr DSRBasicCodedEntry("126733", "DCM", "Roledumab ^89^Zr") +#define CODE_DCM_XmAb5574_89Zr DSRBasicCodedEntry("126734", "DCM", "XmAb5574 ^89^Zr") +#define CODE_DCM_Brentuximab_89Zr DSRBasicCodedEntry("126735", "DCM", "Brentuximab ^89^Zr") +#define CODE_DCM_Panitumumab_89Zr DSRBasicCodedEntry("126736", "DCM", "Panitumumab ^89^Zr") +#define CODE_DCM_Rituximab_89Zr DSRBasicCodedEntry("126737", "DCM", "Rituximab ^89^Zr") +#define CODE_DCM_Mogamulizumab_89Zr DSRBasicCodedEntry("126738", "DCM", "Mogamulizumab ^89^Zr") +#define CODE_DCM_Ublituximab_89Zr DSRBasicCodedEntry("126739", "DCM", "Ublituximab ^89^Zr") +#define CODE_DCM_Margetuximab_89Zr DSRBasicCodedEntry("126740", "DCM", "Margetuximab ^89^Zr") +#define CODE_DCM_SAR3419_89Zr DSRBasicCodedEntry("126741", "DCM", "SAR3419 ^89^Zr") +#define CODE_DCM_Ranibizumab_89Zr DSRBasicCodedEntry("126742", "DCM", "Ranibizumab ^89^Zr") +#define CODE_DCM_CMAbU36_89Zr DSRBasicCodedEntry("126746", "DCM", "cMAb U36 ^89^Zr") +#define CODE_DCM_DN30_89Zr DSRBasicCodedEntry("126747", "DCM", "DN30 ^89^Zr") +#define CODE_DCM_Fresolimumab_89Zr DSRBasicCodedEntry("126748", "DCM", "Fresolimumab ^89^Zr") +#define CODE_DCM_TRC105_89Zr DSRBasicCodedEntry("126749", "DCM", "TRC105 ^89^Zr") +#define CODE_DCM_7E11_89Zr DSRBasicCodedEntry("126750", "DCM", "7E11 ^89^Zr") +#define CODE_DCM_7D12_89Zr DSRBasicCodedEntry("126751", "DCM", "7D12 ^89^Zr") +#define CODE_DCM_28H1_89Zr DSRBasicCodedEntry("126752", "DCM", "28H1 ^89^Zr") +#define CODE_DCM_NanocolloidalAlbumin_89Zr DSRBasicCodedEntry("126753", "DCM", "Nanocolloidal albumin ^89^Zr") +#define CODE_DCM_AntiB220_89Zr DSRBasicCodedEntry("126754", "DCM", "Anti-B220 ^89^Zr") +#define CODE_DCM_RO5323441_89Zr DSRBasicCodedEntry("126755", "DCM", "RO5323441 ^89^Zr") +#define CODE_DCM_RO542908_89Zr DSRBasicCodedEntry("126756", "DCM", "RO542908 ^89^Zr") +#define CODE_DCM_RO6958948_18F DSRBasicCodedEntry("126757", "DCM", "RO6958948 ^18^F") +#define CODE_DCM_PSMA1007_F18 DSRBasicCodedEntry("126758", "DCM", "PSMA-1007 F^18^") +#define CODE_DCM_PSMA617_Ga68 DSRBasicCodedEntry("126759", "DCM", "PSMA-617 Ga^68^") +#define CODE_DCM_DfFK_89Zr DSRBasicCodedEntry("126760", "DCM", "Df-FK ^89^Zr") +#define CODE_DCM_DfFKPEG3_89Zr DSRBasicCodedEntry("126761", "DCM", "Df-FK-PEG(3) ^89^Zr") +#define CODE_DCM_DfFK2_89Zr DSRBasicCodedEntry("126762", "DCM", "Df-[FK](2) ^89^Zr") +#define CODE_DCM_DfFK23PEG4_89Zr DSRBasicCodedEntry("126763", "DCM", "Df-[FK](2)-3PEG(4) ^89^Zr") +#define CODE_DCM_IEC61217PatientSupportContinuousAngle DSRBasicCodedEntry("126801", "DCM", "IEC61217 Patient Support Continuous Angle") +#define CODE_DCM_IEC61217TableTopContinuousPitchAngle DSRBasicCodedEntry("126802", "DCM", "IEC61217 Table Top Continuous Pitch Angle") +#define CODE_DCM_IEC61217TableTopContinuousRollAngle DSRBasicCodedEntry("126803", "DCM", "IEC61217 Table Top Continuous Roll Angle") +#define CODE_DCM_IEC61217TableTopEccentricAxisDistance DSRBasicCodedEntry("126804", "DCM", "IEC61217 Table Top Eccentric Axis Distance") +#define CODE_DCM_IEC61217TableTopContinuousEccentricAngle DSRBasicCodedEntry("126805", "DCM", "IEC61217 Table Top Continuous Eccentric Angle") +#define CODE_DCM_IEC61217TableTopLateralPosition DSRBasicCodedEntry("126806", "DCM", "IEC61217 Table Top Lateral Position") +#define CODE_DCM_IEC61217TableTopLongitudinalPosition DSRBasicCodedEntry("126807", "DCM", "IEC61217 Table Top Longitudinal Position") +#define CODE_DCM_IEC61217TableTopVerticalPosition DSRBasicCodedEntry("126808", "DCM", "IEC61217 Table Top Vertical Position") +#define CODE_DCM_IEC61217GantryContinuousRollAngle DSRBasicCodedEntry("126809", "DCM", "IEC61217 Gantry Continuous Roll Angle") +#define CODE_DCM_IEC61217GantryContinuousPitchAngle DSRBasicCodedEntry("126810", "DCM", "IEC61217 Gantry Continuous Pitch Angle") +#define CODE_DCM_IEC61217GantryContinuousYawAngle DSRBasicCodedEntry("126811", "DCM", "IEC61217 Gantry Continuous Yaw Angle") +#define CODE_DCM_LeftFirst DSRBasicCodedEntry("126830", "DCM", "left first") +#define CODE_DCM_RightFirst DSRBasicCodedEntry("126831", "DCM", "right first") +#define CODE_DCM_PosteriorFirst DSRBasicCodedEntry("126832", "DCM", "posterior first") +#define CODE_DCM_AnteriorFirst DSRBasicCodedEntry("126833", "DCM", "anterior first") +#define CODE_DCM_ILCR DSRBasicCodedEntry("126850", "DCM", "ILCR") +#define CODE_DCM_PreclinicalSmallAnimalImagingAcquisitionContext DSRBasicCodedEntry("127001", "DCM", "Preclinical Small Animal Imaging Acquisition Context") +#define CODE_DCM_AnimalHandlingDuringSpecifiedPhase DSRBasicCodedEntry("127005", "DCM", "Animal handling during specified phase") +#define CODE_DCM_PhaseOfAnimalHandling DSRBasicCodedEntry("127006", "DCM", "Phase of animal handling") +#define CODE_DCM_BiosafetyConditions DSRBasicCodedEntry("127010", "DCM", "Biosafety conditions") +#define CODE_DCM_ReasonForBiosafetyControls DSRBasicCodedEntry("127011", "DCM", "Reason for biosafety controls") +#define CODE_DCM_HeatingConditions DSRBasicCodedEntry("127040", "DCM", "Heating conditions") +#define CODE_DCM_CircadianEffects DSRBasicCodedEntry("127050", "DCM", "Circadian effects") +#define CODE_DCM_NoseCone DSRBasicCodedEntry("127060", "DCM", "Nose cone") +#define CODE_DCM_NasalCannula DSRBasicCodedEntry("127061", "DCM", "Nasal cannula") +#define CODE_DCM_RetroOrbitalRoute DSRBasicCodedEntry("127070", "DCM", "Retro-orbital route") +#define CODE_DCM_InHomeCage DSRBasicCodedEntry("127101", "DCM", "In home cage") +#define CODE_DCM_DuringTransport DSRBasicCodedEntry("127102", "DCM", "During transport") +#define CODE_DCM_StagingPriorToImaging DSRBasicCodedEntry("127103", "DCM", "Staging prior to imaging") +#define CODE_DCM_PreparationForImaging DSRBasicCodedEntry("127104", "DCM", "Preparation for imaging") +#define CODE_DCM_HousingRole DSRBasicCodedEntry("127110", "DCM", "Housing role") +#define CODE_DCM_AnimalHousing DSRBasicCodedEntry("127120", "DCM", "Animal housing") +#define CODE_DCM_AnimalRoomType DSRBasicCodedEntry("127121", "DCM", "Animal room type") +#define CODE_DCM_AnimalRoomIdentifier DSRBasicCodedEntry("127122", "DCM", "Animal room identifier") +#define CODE_DCM_HousingManufacturer DSRBasicCodedEntry("127125", "DCM", "Housing manufacturer") +#define CODE_DCM_HousingRackProductName DSRBasicCodedEntry("127126", "DCM", "Housing rack product name") +#define CODE_DCM_HousingRackProductCode DSRBasicCodedEntry("127127", "DCM", "Housing rack product code") +#define CODE_DCM_HousingUnitProductName DSRBasicCodedEntry("127128", "DCM", "Housing unit product name") +#define CODE_DCM_HousingUnitProductCode DSRBasicCodedEntry("127129", "DCM", "Housing unit product code") +#define CODE_DCM_HousingUnitLidProductName DSRBasicCodedEntry("127130", "DCM", "Housing unit lid product name") +#define CODE_DCM_HousingUnitLidProductCode DSRBasicCodedEntry("127131", "DCM", "Housing unit lid product code") +#define CODE_DCM_NumberOfRacksPerRoom DSRBasicCodedEntry("127140", "DCM", "Number of racks per room") +#define CODE_DCM_NumberOfHousingUnitsPerRack DSRBasicCodedEntry("127141", "DCM", "Number of housing units per rack") +#define CODE_DCM_HousingUnitLocationInRack DSRBasicCodedEntry("127142", "DCM", "Housing unit location in rack") +#define CODE_DCM_NumberOfAnimalsWithinSameHousingUnit DSRBasicCodedEntry("127143", "DCM", "Number of animals within same housing unit") +#define CODE_DCM_SexOfAnimalsWithinSameHousingUnit DSRBasicCodedEntry("127144", "DCM", "Sex of animals within same housing unit") +#define CODE_DCM_SexOfHandler DSRBasicCodedEntry("127145", "DCM", "Sex of handler") +#define CODE_DCM_MixedSex DSRBasicCodedEntry("127146", "DCM", "Mixed sex") +#define CODE_DCM_TotalDurationInHousing DSRBasicCodedEntry("127150", "DCM", "Total duration in housing") +#define CODE_DCM_HousingChangeInterval DSRBasicCodedEntry("127151", "DCM", "Housing change interval") +#define CODE_DCM_ManualHandlingInterval DSRBasicCodedEntry("127152", "DCM", "Manual handling interval") +#define CODE_DCM_HousingUnitMovement DSRBasicCodedEntry("127153", "DCM", "Housing unit movement") +#define CODE_DCM_HousingUnitWidth DSRBasicCodedEntry("127160", "DCM", "Housing unit width") +#define CODE_DCM_HousingUnitHeight DSRBasicCodedEntry("127161", "DCM", "Housing unit height") +#define CODE_DCM_HousingUnitLength DSRBasicCodedEntry("127162", "DCM", "Housing unit length") +#define CODE_DCM_HousingIndividuallyVentilated DSRBasicCodedEntry("127170", "DCM", "Housing individually ventilated") +#define CODE_DCM_AirChanges DSRBasicCodedEntry("127172", "DCM", "Air changes") +#define CODE_DCM_HousingUnitReuse DSRBasicCodedEntry("127175", "DCM", "Housing unit reuse") +#define CODE_DCM_Unused DSRBasicCodedEntry("127177", "DCM", "Unused") +#define CODE_DCM_Reused DSRBasicCodedEntry("127178", "DCM", "Reused") +#define CODE_DCM_BeddingManufacturer DSRBasicCodedEntry("127180", "DCM", "Bedding manufacturer") +#define CODE_DCM_BeddingProductName DSRBasicCodedEntry("127181", "DCM", "Bedding product name") +#define CODE_DCM_BeddingProductCode DSRBasicCodedEntry("127182", "DCM", "Bedding product code") +#define CODE_DCM_BeddingVolume DSRBasicCodedEntry("127183", "DCM", "Bedding volume") +#define CODE_DCM_BeddingMass DSRBasicCodedEntry("127184", "DCM", "Bedding mass") +#define CODE_DCM_BeddingDepth DSRBasicCodedEntry("127185", "DCM", "Bedding depth") +#define CODE_DCM_EnrichmentMaterial DSRBasicCodedEntry("127190", "DCM", "Enrichment material") +#define CODE_DCM_EnrichmentManufacturer DSRBasicCodedEntry("127191", "DCM", "Enrichment manufacturer") +#define CODE_DCM_EnrichmentMaterialPresent DSRBasicCodedEntry("127192", "DCM", "Enrichment material present") +#define CODE_DCM_ExerciserDevicePresent DSRBasicCodedEntry("127193", "DCM", "Exerciser device present") +#define CODE_DCM_ShelterType DSRBasicCodedEntry("127195", "DCM", "Shelter type") +#define CODE_DCM_ShelterManufacturer DSRBasicCodedEntry("127196", "DCM", "Shelter manufacturer") +#define CODE_DCM_ShelterProductName DSRBasicCodedEntry("127197", "DCM", "Shelter product name") +#define CODE_DCM_ShelterProductCode DSRBasicCodedEntry("127198", "DCM", "Shelter product code") +#define CODE_DCM_FeedManufacturer DSRBasicCodedEntry("127200", "DCM", "Feed manufacturer") +#define CODE_DCM_FeedProductName DSRBasicCodedEntry("127201", "DCM", "Feed product name") +#define CODE_DCM_FeedProductCode DSRBasicCodedEntry("127202", "DCM", "Feed product code") +#define CODE_DCM_FeedSource DSRBasicCodedEntry("127205", "DCM", "Feed source") +#define CODE_DCM_FeedbackTemperatureRegulation DSRBasicCodedEntry("127210", "DCM", "Feedback temperature regulation") +#define CODE_DCM_TotalDurationOfLightDarkCycle DSRBasicCodedEntry("127214", "DCM", "Total duration of light-dark cycle") +#define CODE_DCM_LightsonTimeOfDay DSRBasicCodedEntry("127215", "DCM", "Lights on time of day") +#define CODE_DCM_Igloo DSRBasicCodedEntry("127220", "DCM", "Igloo") +#define CODE_DCM_RedTranslucentIgloo DSRBasicCodedEntry("127221", "DCM", "Red translucent igloo") +#define CODE_DCM_AspenChipBedding DSRBasicCodedEntry("127230", "DCM", "Aspen chip bedding") +#define CODE_DCM_AspenShavingBedding DSRBasicCodedEntry("127231", "DCM", "Aspen shaving bedding") +#define CODE_DCM_CornCobBedding DSRBasicCodedEntry("127232", "DCM", "Corn cob bedding") +#define CODE_DCM_PaperBasedBedding DSRBasicCodedEntry("127233", "DCM", "Paper-based bedding") +#define CODE_DCM_PineChipBedding DSRBasicCodedEntry("127234", "DCM", "Pine chip bedding") +#define CODE_DCM_PineShavingBedding DSRBasicCodedEntry("127235", "DCM", "Pine shaving bedding") +#define CODE_DCM_CarrierTemperatureSensor DSRBasicCodedEntry("127240", "DCM", "Carrier temperature sensor") +#define CODE_DCM_ForcedAirHeater DSRBasicCodedEntry("127250", "DCM", "Forced air heater") +#define CODE_DCM_HeatedImagingDevice DSRBasicCodedEntry("127251", "DCM", "Heated imaging device") +#define CODE_DCM_HeatedPatientSupport DSRBasicCodedEntry("127252", "DCM", "Heated patient support") +#define CODE_DCM_HeatedWaterBlanket DSRBasicCodedEntry("127253", "DCM", "Heated water blanket") +#define CODE_DCM_PreHeatedPad DSRBasicCodedEntry("127254", "DCM", "Pre-heated pad") +#define CODE_DCM_Unheated DSRBasicCodedEntry("127255", "DCM", "Unheated") +#define CODE_DCM_NIH31 DSRBasicCodedEntry("127270", "DCM", "NIH31") +#define CODE_DCM_NIH07 DSRBasicCodedEntry("127271", "DCM", "NIH07") +#define CODE_DCM_AIN76 DSRBasicCodedEntry("127272", "DCM", "AIN76") +#define CODE_DCM_AIN93G DSRBasicCodedEntry("127273", "DCM", "AIN93G") +#define CODE_DCM_AIN93M DSRBasicCodedEntry("127274", "DCM", "AIN93M") +#define CODE_DCM_ReverseOsmosisPurifiedWater DSRBasicCodedEntry("127290", "DCM", "Reverse osmosis purified water") +#define CODE_DCM_ReverseOsmosisPurified_HClAcidifiedWater DSRBasicCodedEntry("127291", "DCM", "Reverse osmosis purified, HCl acidified water") +#define CODE_DCM_AnesthesiaMethodSet DSRBasicCodedEntry("127300", "DCM", "Anesthesia Method Set") +#define CODE_DCM_AnesthesiaMethod DSRBasicCodedEntry("127301", "DCM", "Anesthesia Method") +#define CODE_DCM_AnesthesiaCategory DSRBasicCodedEntry("127302", "DCM", "Anesthesia Category") +#define CODE_DCM_AnesthesiaSubCategory DSRBasicCodedEntry("127303", "DCM", "Anesthesia SubCategory") +#define CODE_DCM_AirwayManagementSet DSRBasicCodedEntry("127310", "DCM", "Airway Management Set") +#define CODE_DCM_AirwayManagementMethod DSRBasicCodedEntry("127312", "DCM", "Airway Management Method") +#define CODE_DCM_AirwaySubManagementMethod DSRBasicCodedEntry("127313", "DCM", "Airway Sub-Management Method") +#define CODE_DCM_MedicationsSet DSRBasicCodedEntry("127320", "DCM", "Medications Set") +#define CODE_DCM_CarrierGas DSRBasicCodedEntry("127330", "DCM", "Carrier gas") +#define CODE_DCM_AnimalHousingRoom DSRBasicCodedEntry("127370", "DCM", "Animal housing room") +#define CODE_DCM_PreparationRoom DSRBasicCodedEntry("127371", "DCM", "Preparation room") +#define CODE_DCM_ImagingProcedureRoom DSRBasicCodedEntry("127372", "DCM", "Imaging procedure room") +#define CODE_DCM_LocallyManufacturedProduct DSRBasicCodedEntry("127390", "DCM", "Locally manufactured product") +#define CODE_DCM_FoodTreat DSRBasicCodedEntry("127391", "DCM", "Food treat") +#define CODE_DCM_ExogenousSubstance DSRBasicCodedEntry("127400", "DCM", "Exogenous substance") +#define CODE_DCM_TissueOfOrigin DSRBasicCodedEntry("127401", "DCM", "Tissue of origin") +#define CODE_DCM_TaxonomicRankOfOrigin DSRBasicCodedEntry("127402", "DCM", "Taxonomic rank of origin") +#define CODE_DCM_Strain DSRBasicCodedEntry("127411", "DCM", "Strain") +#define CODE_DCM_StrainDescription DSRBasicCodedEntry("127412", "DCM", "Strain description") +#define CODE_DCM_Nomenclature DSRBasicCodedEntry("127413", "DCM", "Nomenclature") +#define CODE_DCM_GeneticModifications DSRBasicCodedEntry("127414", "DCM", "Genetic modifications") +#define CODE_DCM_GeneticModificationsDescription DSRBasicCodedEntry("127415", "DCM", "Genetic modifications description") +#define CODE_DCM_StereotacticCoordinates DSRBasicCodedEntry("127450", "DCM", "Stereotactic coordinates") +#define CODE_DCM_PositionReferenceIndicator DSRBasicCodedEntry("127451", "DCM", "Position reference indicator") +#define CODE_DCM_TumorGraft DSRBasicCodedEntry("127460", "DCM", "Tumor graft") +#define CODE_DCM_EmbryonicKidney DSRBasicCodedEntry("127801", "DCM", "Embryonic Kidney") +#define CODE_DCM_HumanAlphaSynucleinPreformedFibrils DSRBasicCodedEntry("127851", "DCM", "Human alpha synuclein preformed fibrils") +#define CODE_DCM_MouseAlphaSynucleinPreformedFibrils DSRBasicCodedEntry("127852", "DCM", "Mouse alpha synuclein preformed fibrils") +#define CODE_DCM_HumanTauPreformedFibrils DSRBasicCodedEntry("127853", "DCM", "Human Tau preformed fibrils") +#define CODE_DCM_MouseTauPreformedFibrils DSRBasicCodedEntry("127854", "DCM", "Mouse Tau preformed fibrils") +#define CODE_DCM_NonIonicIodinatedContrastAgent DSRBasicCodedEntry("127855", "DCM", "Non-ionic iodinated contrast agent") +#define CODE_DCM_HeartValveFlail DSRBasicCodedEntry("127856", "DCM", "Heart valve flail") +#define CODE_DCM_GlucoseMeasurementDate DSRBasicCodedEntry("127857", "DCM", "Glucose Measurement Date") +#define CODE_DCM_GlucoseMeasurementTime DSRBasicCodedEntry("127858", "DCM", "Glucose Measurement Time") +#define CODE_DCM_SPECTOfWholeBody DSRBasicCodedEntry("127901", "DCM", "SPECT of whole body") +#define CODE_DCM_SPECTCTOfWholeBody DSRBasicCodedEntry("127902", "DCM", "SPECT CT of whole body") +#define CODE_DCM_AddAddendumToReport DSRBasicCodedEntry("128001", "DCM", "Add Addendum to Report") +#define CODE_DCM_ModalityToRead DSRBasicCodedEntry("128002", "DCM", "Modality to Read") +#define CODE_DCM_ReaderSpecialty DSRBasicCodedEntry("128003", "DCM", "Reader Specialty") +#define CODE_DCM_ReportRequested DSRBasicCodedEntry("128004", "DCM", "Report Requested") +#define CODE_DCM_FinalReport DSRBasicCodedEntry("128005", "DCM", "Final Report") +#define CODE_DCM_AbdominalImagingSpecialty DSRBasicCodedEntry("128006", "DCM", "Abdominal Imaging Specialty") +#define CODE_DCM_CardiacImagingSpecialty DSRBasicCodedEntry("128007", "DCM", "Cardiac Imaging Specialty") +#define CODE_DCM_HeadAndNeckImagingSpecialty DSRBasicCodedEntry("128008", "DCM", "Head and Neck Imaging Specialty") +#define CODE_DCM_MusculoskeletalImagingSpecialty DSRBasicCodedEntry("128009", "DCM", "Musculoskeletal Imaging Specialty") +#define CODE_DCM_NeurologySpecialty DSRBasicCodedEntry("128010", "DCM", "Neurology Specialty") +#define CODE_DCM_NeuroradiologicImagingSpecialty DSRBasicCodedEntry("128011", "DCM", "Neuroradiologic Imaging Specialty") +#define CODE_DCM_OBGynImagingSpecialty DSRBasicCodedEntry("128012", "DCM", "OB/Gyn Imaging Specialty") +#define CODE_DCM_OncologicImagingSpecialty DSRBasicCodedEntry("128013", "DCM", "Oncologic Imaging Specialty") +#define CODE_DCM_OncologySpecialty DSRBasicCodedEntry("128014", "DCM", "Oncology Specialty") +#define CODE_DCM_ThoracicImagingSpecialty DSRBasicCodedEntry("128015", "DCM", "Thoracic Imaging Specialty") +#define CODE_DCM_PediatricImagingSpecialty DSRBasicCodedEntry("128016", "DCM", "Pediatric Imaging Specialty") +#define CODE_DCM_VascularImagingSpecialty DSRBasicCodedEntry("128017", "DCM", "Vascular Imaging Specialty") +#define CODE_DCM_FWPByGA_Campbell_1991 DSRBasicCodedEntry("128040", "DCM", "FWP by GA, Campbell, 1991") +#define CODE_DCM_FWPByGA_Hadlock_1991 DSRBasicCodedEntry("128041", "DCM", "FWP by GA, Hadlock, 1991") +#define CODE_DCM_PlaneThroughSuperiorExtent DSRBasicCodedEntry("128120", "DCM", "Plane through Superior Extent") +#define CODE_DCM_PlaneThroughInferiorExtent DSRBasicCodedEntry("128121", "DCM", "Plane through Inferior Extent") +#define CODE_DCM_PlaneThroughProximalExtent DSRBasicCodedEntry("128122", "DCM", "Plane through Proximal Extent") +#define CODE_DCM_PlaneThroughDistalExtent DSRBasicCodedEntry("128123", "DCM", "Plane through Distal Extent") +#define CODE_DCM_PlaneThroughMedialExtent DSRBasicCodedEntry("128124", "DCM", "Plane through Medial Extent") +#define CODE_DCM_PlaneThroughLateralExtent DSRBasicCodedEntry("128125", "DCM", "Plane through Lateral Extent") +#define CODE_DCM_PlaneThroughLeftmostExtent DSRBasicCodedEntry("128126", "DCM", "Plane through Leftmost Extent") +#define CODE_DCM_PlaneThroughRightmostExtent DSRBasicCodedEntry("128127", "DCM", "Plane through Rightmost Extent") +#define CODE_DCM_PlaneThroughAnteriorExtent DSRBasicCodedEntry("128128", "DCM", "Plane through Anterior Extent") +#define CODE_DCM_PlaneThroughPosteriorExtent DSRBasicCodedEntry("128129", "DCM", "Plane through Posterior Extent") +#define CODE_DCM_PlaneThroughCenter DSRBasicCodedEntry("128130", "DCM", "Plane through Center") +#define CODE_DCM_GeometricCenterpoint DSRBasicCodedEntry("128137", "DCM", "Geometric Centerpoint") +#define CODE_DCM_CenterOfMass DSRBasicCodedEntry("128138", "DCM", "Center of Mass") +#define CODE_DCM_ImpairedRenalFunction DSRBasicCodedEntry("128144", "DCM", "Impaired Renal Function") +#define CODE_DCM_LaserCrossHairs DSRBasicCodedEntry("128151", "DCM", "Laser Cross-hairs") +#define CODE_DCM_AcquiredVolume DSRBasicCodedEntry("128160", "DCM", "Acquired Volume") +#define CODE_DCM_AbdominalRadiology DSRBasicCodedEntry("128170", "DCM", "Abdominal Radiology") +#define CODE_DCM_BiomedicalEngineering DSRBasicCodedEntry("128171", "DCM", "Biomedical Engineering") +#define CODE_DCM_CardiovascularRadiology DSRBasicCodedEntry("128172", "DCM", "Cardiovascular Radiology") +#define CODE_DCM_InformationTechnology DSRBasicCodedEntry("128173", "DCM", "Information Technology") +#define CODE_DCM_MedicalPhysics DSRBasicCodedEntry("128174", "DCM", "Medical Physics") +#define CODE_DCM_MusculoskeletalRadiology DSRBasicCodedEntry("128175", "DCM", "Musculoskeletal Radiology") +#define CODE_DCM_PediatricRadiology DSRBasicCodedEntry("128177", "DCM", "Pediatric Radiology") +#define CODE_DCM_ThoracicRadiology DSRBasicCodedEntry("128179", "DCM", "Thoracic Radiology") +#define CODE_DCM_ForRTWorkflow DSRBasicCodedEntry("128180", "DCM", "For RT Workflow") +#define CODE_DCM_DiagnosticSourceImages DSRBasicCodedEntry("128181", "DCM", "Diagnostic Source Images") +#define CODE_DCM_SegmentationResult DSRBasicCodedEntry("128182", "DCM", "Segmentation Result") +#define CODE_DCM_RegistrationResult DSRBasicCodedEntry("128183", "DCM", "Registration Result") +#define CODE_DCM_PrePlanningResult DSRBasicCodedEntry("128184", "DCM", "Pre-Planning Result") +#define CODE_DCM_RTPrescriptionResult DSRBasicCodedEntry("128185", "DCM", "RT Prescription Result") +#define CODE_DCM_DoseCalculationImageSeries DSRBasicCodedEntry("128186", "DCM", "Dose Calculation Image Series") +#define CODE_DCM_CoordinateAlignmentImageSeries DSRBasicCodedEntry("128187", "DCM", "Coordinate Alignment Image Series") +#define CODE_DCM_RTTreatmentSimulationResult DSRBasicCodedEntry("128188", "DCM", "RT Treatment Simulation Result") +#define CODE_DCM_RTPlanningResult DSRBasicCodedEntry("128189", "DCM", "RT Planning Result") +#define CODE_DCM_DosimetricResult DSRBasicCodedEntry("128190", "DCM", "Dosimetric Result") +#define CODE_DCM_PatientSetupVerificationResult DSRBasicCodedEntry("128191", "DCM", "Patient Setup Verification Result") +#define CODE_DCM_RTTreatmentSessionResult DSRBasicCodedEntry("128192", "DCM", "RT Treatment Session Result") +#define CODE_DCM_RTTreatmentCourseSummary DSRBasicCodedEntry("128193", "DCM", "RT Treatment Course Summary") +#define CODE_DCM_RTTreatmentQAResult DSRBasicCodedEntry("128194", "DCM", "RT Treatment QA Result") +#define CODE_DCM_ForDiagnosis DSRBasicCodedEntry("128195", "DCM", "For Diagnosis") +#define CODE_DCM_ForSegmentation DSRBasicCodedEntry("128196", "DCM", "For Segmentation") +#define CODE_DCM_ForRTPrescription DSRBasicCodedEntry("128197", "DCM", "For RT Prescription") +#define CODE_DCM_ForRTTreatmentPlanning DSRBasicCodedEntry("128198", "DCM", "For RT Treatment Planning") +#define CODE_DCM_ForPlanComparison DSRBasicCodedEntry("128199", "DCM", "For Plan Comparison") +#define CODE_DCM_ForRTPlanSummation DSRBasicCodedEntry("128200", "DCM", "For RT Plan Summation") +#define CODE_DCM_ForPhysicianReview DSRBasicCodedEntry("128201", "DCM", "For Physician Review") +#define CODE_DCM_ForPhysicistReview DSRBasicCodedEntry("128202", "DCM", "For Physicist Review") +#define CODE_DCM_ForTumorBoard DSRBasicCodedEntry("128203", "DCM", "For Tumor Board") +#define CODE_DCM_ForPlanQualityAssurance DSRBasicCodedEntry("128204", "DCM", "For Plan Quality Assurance") +#define CODE_DCM_ForMachineQualityAssurance DSRBasicCodedEntry("128205", "DCM", "For Machine Quality Assurance") +#define CODE_DCM_ForPatientSetupVerification DSRBasicCodedEntry("128206", "DCM", "For Patient Setup Verification") +#define CODE_DCM_ForClinicalTrialSubmission DSRBasicCodedEntry("128207", "DCM", "For Clinical Trial Submission") +#define CODE_DCM_ForTumorRegistry DSRBasicCodedEntry("128208", "DCM", "For Tumor Registry") +#define CODE_DCM_RTWorkflowInputUsed DSRBasicCodedEntry("128209", "DCM", "RT Workflow Input Used") +#define CODE_DCM_RTPrescriptionInputUsed DSRBasicCodedEntry("128210", "DCM", "RT Prescription Input Used") +#define CODE_DCM_RTTreatmentPlanningInputUsed DSRBasicCodedEntry("128211", "DCM", "RT Treatment Planning Input Used") +#define CODE_DCM_RTPlanSummationInputUsed DSRBasicCodedEntry("128212", "DCM", "RT Plan Summation Input Used") +#define CODE_DCM_PhysicianReviewInputUsed DSRBasicCodedEntry("128213", "DCM", "Physician Review Input Used") +#define CODE_DCM_PhysicistReviewInputUsed DSRBasicCodedEntry("128214", "DCM", "Physicist Review Input Used") +#define CODE_DCM_PlanQualityAssuranceInputUsed DSRBasicCodedEntry("128215", "DCM", "Plan Quality Assurance Input Used") +#define CODE_DCM_MachineQualityAssuranceInputUsed DSRBasicCodedEntry("128216", "DCM", "Machine Quality Assurance Input Used") +#define CODE_DCM_PatientSetupVerificationInputUsed DSRBasicCodedEntry("128217", "DCM", "Patient Setup Verification Input Used") +#define CODE_DCM_DiagnosisInputUsed DSRBasicCodedEntry("128218", "DCM", "Diagnosis Input Used") +#define CODE_DCM_ContouringInputUsed DSRBasicCodedEntry("128219", "DCM", "Contouring Input Used") +#define CODE_DCM_PlanComparisonInputUsed DSRBasicCodedEntry("128220", "DCM", "Plan Comparison Input Used") +#define CODE_DCM_TumorBoardInputUsed DSRBasicCodedEntry("128221", "DCM", "Tumor Board Input Used") +#define CODE_DCM_TumorRegistryInputUsed DSRBasicCodedEntry("128222", "DCM", "Tumor Registry Input Used") +#define CODE_DCM_ClinicalTrialSubmissionInputUsed DSRBasicCodedEntry("128223", "DCM", "Clinical Trial Submission Input Used") +#define CODE_DCM_SourceMeasurement DSRBasicCodedEntry("128224", "DCM", "Source measurement") +#define CODE_DCM_SourceReport DSRBasicCodedEntry("128225", "DCM", "Source report") +#define CODE_DCM_SourceRawData DSRBasicCodedEntry("128226", "DCM", "Source raw data") +#define CODE_DCM_SourceRealWorldValueMap DSRBasicCodedEntry("128227", "DCM", "Source real world value map") +#define CODE_DCM_PulseSequenceName DSRBasicCodedEntry("128230", "DCM", "Pulse Sequence Name") +#define CODE_DCM_StructuralImageForImageProcessing DSRBasicCodedEntry("128250", "DCM", "Structural image for image processing") +#define CODE_DCM_FlowImageForImageProcessing DSRBasicCodedEntry("128251", "DCM", "Flow image for image processing") +#define CODE_DCM_OCTAAmplitudeDecorrelation DSRBasicCodedEntry("128252", "DCM", "OCT-A amplitude decorrelation") +#define CODE_DCM_OCTAComplexVariance DSRBasicCodedEntry("128253", "DCM", "OCT-A complex variance") +#define CODE_DCM_OCTASpeckleVariance DSRBasicCodedEntry("128254", "DCM", "OCT-A speckle variance") +#define CODE_DCM_OCTACorrelationMapping DSRBasicCodedEntry("128255", "DCM", "OCT-A correlation mapping") +#define CODE_DCM_DopplerOCTA DSRBasicCodedEntry("128256", "DCM", "Doppler OCT-A") +#define CODE_DCM_RetinaDepthEncodedVasculatureFlow DSRBasicCodedEntry("128257", "DCM", "Retina depth encoded vasculature flow") +#define CODE_DCM_RetinaDepthEncodedStructuralReflectanceMap DSRBasicCodedEntry("128258", "DCM", "Retina depth encoded structural reflectance map") +#define CODE_DCM_RetinaVasculatureFlow DSRBasicCodedEntry("128259", "DCM", "Retina vasculature flow") +#define CODE_DCM_RetinaStructuralReflectanceMap DSRBasicCodedEntry("128260", "DCM", "Retina structural reflectance map") +#define CODE_DCM_VitreousVasculatureFlow DSRBasicCodedEntry("128261", "DCM", "Vitreous vasculature flow") +#define CODE_DCM_VitreousStructuralReflectanceMap DSRBasicCodedEntry("128262", "DCM", "Vitreous structural reflectance map") +#define CODE_DCM_RadialPeripapillaryVasculatureFlow DSRBasicCodedEntry("128263", "DCM", "Radial peripapillary vasculature flow") +#define CODE_DCM_RadialPeripapillaryStructuralReflectanceMap DSRBasicCodedEntry("128264", "DCM", "Radial peripapillary structural reflectance map") +#define CODE_DCM_SuperficialRetinaVasculatureFlow DSRBasicCodedEntry("128265", "DCM", "Superficial retina vasculature flow") +#define CODE_DCM_SuperficialRetinaStructuralReflectanceMap DSRBasicCodedEntry("128266", "DCM", "Superficial retina structural reflectance map") +#define CODE_DCM_MiddleInnerRetinaVasculatureFlow DSRBasicCodedEntry("128267", "DCM", "Middle inner retina vasculature flow") +#define CODE_DCM_MiddleInnerStructuralReflectanceMap DSRBasicCodedEntry("128268", "DCM", "Middle inner structural reflectance map") +#define CODE_DCM_DeepRetinaVasculatureFlow DSRBasicCodedEntry("128269", "DCM", "Deep retina vasculature flow") +#define CODE_DCM_DeepRetinaStructuralReflectanceMap DSRBasicCodedEntry("128270", "DCM", "Deep retina structural reflectance map") +#define CODE_DCM_OuterRetinaVasculatureFlow DSRBasicCodedEntry("128271", "DCM", "Outer retina vasculature flow") +#define CODE_DCM_OuterRetinaStructuralReflectanceMap DSRBasicCodedEntry("128272", "DCM", "Outer retina structural reflectance map") +#define CODE_DCM_ChoriocapillarisVasculatureFlow DSRBasicCodedEntry("128273", "DCM", "Choriocapillaris vasculature flow") +#define CODE_DCM_ChoriocapillarisStructuralReflectanceMap DSRBasicCodedEntry("128274", "DCM", "Choriocapillaris structural reflectance map") +#define CODE_DCM_ChoroidVasculatureFlow DSRBasicCodedEntry("128275", "DCM", "Choroid vasculature flow") +#define CODE_DCM_ChoroidStructuralReflectanceMap DSRBasicCodedEntry("128276", "DCM", "Choroid structural reflectance map") +#define CODE_DCM_WholeEyeVasculatureFlow DSRBasicCodedEntry("128277", "DCM", "Whole eye vasculature flow") +#define CODE_DCM_WholeEyeStructuralReflectanceMap DSRBasicCodedEntry("128278", "DCM", "Whole eye structural reflectance map") +#define CODE_DCM_CubeBScanPattern DSRBasicCodedEntry("128279", "DCM", "Cube B-scan pattern") +#define CODE_DCM_RasterBScanPattern DSRBasicCodedEntry("128280", "DCM", "Raster B-scan pattern") +#define CODE_DCM_LineBScanPattern DSRBasicCodedEntry("128281", "DCM", "Line B-scan pattern") +#define CODE_DCM_RadialBScanPattern DSRBasicCodedEntry("128282", "DCM", "Radial B-scan pattern") +#define CODE_DCM_CrossBScanPattern DSRBasicCodedEntry("128283", "DCM", "Cross B-scan pattern") +#define CODE_DCM_CircleBScanPattern DSRBasicCodedEntry("128284", "DCM", "Circle B-scan pattern") +#define CODE_DCM_ConcentricCircleBScanPattern DSRBasicCodedEntry("128285", "DCM", "Concentric circle B-scan pattern") +#define CODE_DCM_CircleRasterBScanPattern DSRBasicCodedEntry("128286", "DCM", "Circle-raster B-scan pattern") +#define CODE_DCM_CircleRadialBScanPattern DSRBasicCodedEntry("128287", "DCM", "Circle-radial B-scan pattern") +#define CODE_DCM_GridBScanPattern DSRBasicCodedEntry("128288", "DCM", "Grid B-scan pattern") +#define CODE_DCM_OuterSurfaceOfRNFL DSRBasicCodedEntry("128289", "DCM", "Outer surface of RNFL") +#define CODE_DCM_OuterSurfaceOfGCL DSRBasicCodedEntry("128290", "DCM", "Outer surface of GCL") +#define CODE_DCM_OuterSurfaceOfIPL DSRBasicCodedEntry("128291", "DCM", "Outer surface of IPL") +#define CODE_DCM_OuterSurfaceOfINL DSRBasicCodedEntry("128292", "DCM", "Outer surface of INL") +#define CODE_DCM_OuterSurfaceOfOPL DSRBasicCodedEntry("128293", "DCM", "Outer surface of OPL") +#define CODE_DCM_OuterSurfaceOfHFL DSRBasicCodedEntry("128294", "DCM", "Outer surface of HFL") +#define CODE_DCM_SurfaceBetweenInnerAndOuterSegmentsOfThePhotoreceptors DSRBasicCodedEntry("128295", "DCM", "Surface between Inner and Outer Segments of the photoreceptors") +#define CODE_DCM_SurfaceOfTheInterdigitatingZoneBetweenRetinaAndRPE DSRBasicCodedEntry("128296", "DCM", "Surface of the interdigitating zone between retina and RPE") +#define CODE_DCM_AnteriorSurfaceOfTheRPE DSRBasicCodedEntry("128297", "DCM", "Anterior surface of the RPE") +#define CODE_DCM_SurfaceOfTheCenterOfTheRPE DSRBasicCodedEntry("128298", "DCM", "Surface of the center of the RPE") +#define CODE_DCM_PosteriorSurfaceOfTheRPE DSRBasicCodedEntry("128299", "DCM", "Posterior surface of the RPE") +#define CODE_DCM_OuterSurfaceOfTheBM DSRBasicCodedEntry("128300", "DCM", "Outer surface of the BM") +#define CODE_DCM_SurfaceOfTheChoroidScleraInterface DSRBasicCodedEntry("128301", "DCM", "Surface of the choroid-sclera interface") +#define CODE_DCM_OuterSurfaceOfTheCC DSRBasicCodedEntry("128302", "DCM", "Outer surface of the CC") +#define CODE_DCM_OCTBScanAnalysis DSRBasicCodedEntry("128303", "DCM", "OCT B-scan analysis") +#define CODE_DCM_OCTAOneSidedRatio_lesser DSRBasicCodedEntry("128304", "DCM", "OCT-A one-sided ratio (lesser)") +#define CODE_DCM_OCTAOneSidedRatio_greater DSRBasicCodedEntry("128305", "DCM", "OCT-A one-sided ratio (greater)") +#define CODE_DCM_PatientRadiationDoseReport DSRBasicCodedEntry("128401", "DCM", "Patient Radiation Dose Report") +#define CODE_DCM_RadiationDoseEstimate DSRBasicCodedEntry("128402", "DCM", "Radiation Dose Estimate") +#define CODE_DCM_RadiationDoseEstimateName DSRBasicCodedEntry("128403", "DCM", "Radiation Dose Estimate Name") +#define CODE_DCM_AnthropomorphicModel DSRBasicCodedEntry("128404", "DCM", "Anthropomorphic Model") +#define CODE_DCM_BreastThickness DSRBasicCodedEntry("128405", "DCM", "Breast Thickness") +#define CODE_DCM_BREPRadiationTransportModel DSRBasicCodedEntry("128406", "DCM", "BREP Radiation Transport Model") +#define CODE_DCM_DgN DSRBasicCodedEntry("128407", "DCM", "DgN") +#define CODE_DCM_PatientAPDimension DSRBasicCodedEntry("128408", "DCM", "Patient AP Dimension") +#define CODE_DCM_PatientLateralDimension DSRBasicCodedEntry("128409", "DCM", "Patient Lateral Dimension") +#define CODE_DCM_SSDEConversionFactor DSRBasicCodedEntry("128410", "DCM", "SSDE Conversion Factor") +#define CODE_DCM_Backscatter DSRBasicCodedEntry("128411", "DCM", "Backscatter") +#define CODE_DCM_RadiationDoseEstimateRepresentation DSRBasicCodedEntry("128412", "DCM", "Radiation Dose Estimate Representation") +#define CODE_DCM_DistributionRepresentation DSRBasicCodedEntry("128413", "DCM", "Distribution Representation") +#define CODE_DCM_RadiationDoseRepresentationData DSRBasicCodedEntry("128414", "DCM", "Radiation Dose Representation Data") +#define CODE_DCM_RadiationDoseEstimateMethodology DSRBasicCodedEntry("128415", "DCM", "Radiation Dose Estimate Methodology") +#define CODE_DCM_SRInstanceUsed DSRBasicCodedEntry("128416", "DCM", "SR Instance Used") +#define CODE_DCM_PatientModelType DSRBasicCodedEntry("128417", "DCM", "Patient Model Type") +#define CODE_DCM_SimpleObjectModel DSRBasicCodedEntry("128418", "DCM", "Simple Object Model") +#define CODE_DCM_RadiationTransportModelType DSRBasicCodedEntry("128420", "DCM", "Radiation Transport Model Type") +#define CODE_DCM_GeometricRadiationTransportModel DSRBasicCodedEntry("128421", "DCM", "Geometric Radiation Transport Model") +#define CODE_DCM_VoxelizedRadiationTransportModel DSRBasicCodedEntry("128422", "DCM", "Voxelized Radiation Transport Model") +#define CODE_DCM_MeshRadiationTransportModel DSRBasicCodedEntry("128423", "DCM", "Mesh Radiation Transport Model") +#define CODE_DCM_NURBSRadiationTransportModel DSRBasicCodedEntry("128424", "DCM", "NURBS Radiation Transport Model") +#define CODE_DCM_PatientRadiationDoseModelData DSRBasicCodedEntry("128425", "DCM", "Patient Radiation Dose Model Data") +#define CODE_DCM_PatientRadiationDoseModelReference DSRBasicCodedEntry("128426", "DCM", "Patient Radiation Dose Model Reference") +#define CODE_DCM_PatientModelDemographics DSRBasicCodedEntry("128427", "DCM", "Patient Model Demographics") +#define CODE_DCM_ModelMinimumAge DSRBasicCodedEntry("128428", "DCM", "Model Minimum Age") +#define CODE_DCM_EventUIDUsed DSRBasicCodedEntry("128429", "DCM", "Event UID Used") +#define CODE_DCM_ModelMaximumAge DSRBasicCodedEntry("128430", "DCM", "Model Maximum Age") +#define CODE_DCM_BeamBlock DSRBasicCodedEntry("128431", "DCM", "Beam Block") +#define CODE_DCM_TissueAirRatio DSRBasicCodedEntry("128433", "DCM", "Tissue Air Ratio") +#define CODE_DCM_RadiationDoseEstimateParameters DSRBasicCodedEntry("128434", "DCM", "Radiation Dose Estimate Parameters") +#define CODE_DCM_RadiationDoseCompositeParameters DSRBasicCodedEntry("128436", "DCM", "Radiation Dose Composite Parameters") +#define CODE_DCM_ModelPatientSex DSRBasicCodedEntry("128437", "DCM", "Model Patient Sex") +#define CODE_DCM_ModelMinimumWeight DSRBasicCodedEntry("128438", "DCM", "Model Minimum Weight") +#define CODE_DCM_ModelMinimumHeight DSRBasicCodedEntry("128439", "DCM", "Model Minimum Height") +#define CODE_DCM_ModelMaximumWeight DSRBasicCodedEntry("128441", "DCM", "Model Maximum Weight") +#define CODE_DCM_ModelMaximumHeight DSRBasicCodedEntry("128442", "DCM", "Model Maximum Height") +#define CODE_DCM_SpatialRegistrationReference DSRBasicCodedEntry("128444", "DCM", "Spatial Registration Reference") +#define CODE_DCM_RegistrationMethod DSRBasicCodedEntry("128446", "DCM", "Registration Method") +#define CODE_DCM_SpatialFiducials_128447 DSRBasicCodedEntry("128447", "DCM", "Spatial Fiducials") +#define CODE_DCM_CorrectionFactor DSRBasicCodedEntry("128452", "DCM", "Correction Factor") +#define CODE_DCM_CurveFitParameter DSRBasicCodedEntry("128453", "DCM", "Curve Fit Parameter") +#define CODE_DCM_HomogeneityFactor DSRBasicCodedEntry("128455", "DCM", "Homogeneity Factor") +#define CODE_DCM_PatientModelRegistration DSRBasicCodedEntry("128456", "DCM", "Patient Model Registration") +#define CODE_DCM_XRayBeamAttenuator DSRBasicCodedEntry("128457", "DCM", "X-Ray Beam Attenuator") +#define CODE_DCM_AttenuatorCategory DSRBasicCodedEntry("128458", "DCM", "Attenuator Category") +#define CODE_DCM_Table DSRBasicCodedEntry("128459", "DCM", "Table") +#define CODE_DCM_TableCore DSRBasicCodedEntry("128460", "DCM", "Table Core") +#define CODE_DCM_TableOuterLiner DSRBasicCodedEntry("128461", "DCM", "Table Outer Liner") +#define CODE_DCM_TablePad DSRBasicCodedEntry("128462", "DCM", "Table Pad") +#define CODE_DCM_RadiationDoseEstimationParameterType DSRBasicCodedEntry("128464", "DCM", "Radiation Dose Estimation Parameter Type") +#define CODE_DCM_EquivalentAttenuatorMaterial DSRBasicCodedEntry("128465", "DCM", "Equivalent Attenuator Material") +#define CODE_DCM_AttenuatorDescription DSRBasicCodedEntry("128468", "DCM", "Attenuator Description") +#define CODE_DCM_EquivalentAttenuatorThickness DSRBasicCodedEntry("128469", "DCM", "Equivalent Attenuator Thickness") +#define CODE_DCM_XRayAttenuatorModelData DSRBasicCodedEntry("128470", "DCM", "X-Ray Attenuator Model Data") +#define CODE_DCM_XRayBeamAttenuatorModel DSRBasicCodedEntry("128472", "DCM", "X-Ray Beam Attenuator Model") +#define CODE_DCM_XRayBeamAttenuatorModelReference DSRBasicCodedEntry("128474", "DCM", "X-Ray Beam Attenuator Model Reference") +#define CODE_DCM_XRayBeamAttenuatorModelRegistration DSRBasicCodedEntry("128475", "DCM", "X-Ray Beam Attenuator Model Registration") +#define CODE_DCM_RadiationDoseEstimateMethod DSRBasicCodedEntry("128476", "DCM", "Radiation Dose Estimate Method") +#define CODE_DCM_RadiationDoseEstimateMethodType DSRBasicCodedEntry("128477", "DCM", "Radiation Dose Estimate Method Type") +#define CODE_DCM_TabularDataAlgorithm DSRBasicCodedEntry("128479", "DCM", "Tabular Data Algorithm") +#define CODE_DCM_AnalyticalAlgorithm DSRBasicCodedEntry("128480", "DCM", "Analytical Algorithm") +#define CODE_DCM_EmpiricalAlgorithm DSRBasicCodedEntry("128481", "DCM", "Empirical Algorithm") +#define CODE_DCM_RadiationDoseEstimateMethodReference DSRBasicCodedEntry("128482", "DCM", "Radiation Dose Estimate Method Reference") +#define CODE_DCM_Isodose DSRBasicCodedEntry("128484", "DCM", "Isodose") +#define CODE_DCM_SkinDoseMap DSRBasicCodedEntry("128485", "DCM", "Skin Dose Map") +#define CODE_DCM_3DDoseMap DSRBasicCodedEntry("128487", "DCM", "3D Dose Map") +#define CODE_DCM_DoseGradient DSRBasicCodedEntry("128488", "DCM", "Dose Gradient") +#define CODE_DCM_PhysicalSupport DSRBasicCodedEntry("128492", "DCM", "Physical Support") +#define CODE_DCM_PatientSegmentedModel DSRBasicCodedEntry("128494", "DCM", "Patient Segmented Model") +#define CODE_DCM_DosePointCloud DSRBasicCodedEntry("128496", "DCM", "Dose Point Cloud") +#define CODE_DCM_MeasuredRadiationDose DSRBasicCodedEntry("128497", "DCM", "Measured Radiation Dose") +#define CODE_DCM_PatientRadiationDoseModel DSRBasicCodedEntry("128500", "DCM", "Patient Radiation Dose Model") +#define CODE_DCM_ReferenceToUncertaintyDeterminationMethod DSRBasicCodedEntry("128511", "DCM", "Reference to Uncertainty Determination Method") +#define CODE_DCM_EquivalentDose DSRBasicCodedEntry("128512", "DCM", "Equivalent Dose") +#define CODE_DCM_AbsorbedDose DSRBasicCodedEntry("128513", "DCM", "Absorbed Dose") +#define CODE_DCM_NormalizationFactor DSRBasicCodedEntry("128522", "DCM", "Normalization Factor") +#define CODE_DCM_OffsetFactor DSRBasicCodedEntry("128523", "DCM", "Offset Factor") +#define CODE_DCM_TissueFraction DSRBasicCodedEntry("128526", "DCM", "Tissue Fraction") +#define CODE_DCM_DistanceCorrection DSRBasicCodedEntry("128527", "DCM", "Distance Correction") +#define CODE_DCM_ConversionFactor DSRBasicCodedEntry("128528", "DCM", "Conversion Factor") +#define CODE_DCM_MaximumAbsorbedRadiationDose DSRBasicCodedEntry("128531", "DCM", "Maximum Absorbed Radiation Dose") +#define CODE_DCM_MinimumAbsorbedRadiationDose DSRBasicCodedEntry("128532", "DCM", "Minimum Absorbed Radiation Dose") +#define CODE_DCM_MeanAbsorbedRadiationDose DSRBasicCodedEntry("128533", "DCM", "Mean Absorbed Radiation Dose") +#define CODE_DCM_ModeAbsorbedRadiationDose DSRBasicCodedEntry("128534", "DCM", "Mode Absorbed Radiation Dose") +#define CODE_DCM_MaximumEquivalentRadiationDose DSRBasicCodedEntry("128535", "DCM", "Maximum Equivalent Radiation Dose") +#define CODE_DCM_MinimumEquivalentRadiationDose DSRBasicCodedEntry("128536", "DCM", "Minimum Equivalent Radiation Dose") +#define CODE_DCM_MeanEquivalentRadiationDose DSRBasicCodedEntry("128537", "DCM", "Mean Equivalent Radiation Dose") +#define CODE_DCM_ModeEquivalentRadiationDose DSRBasicCodedEntry("128538", "DCM", "Mode Equivalent Radiation Dose") +#define CODE_DCM_MedianAbsorbedRadiationDose DSRBasicCodedEntry("128539", "DCM", "Median Absorbed Radiation Dose") +#define CODE_DCM_MedianEquivalentRadiationDose DSRBasicCodedEntry("128540", "DCM", "Median Equivalent Radiation Dose") +#define CODE_DCM_IsRepeatedAcquisition DSRBasicCodedEntry("128551", "DCM", "Is Repeated Acquisition") +#define CODE_DCM_ReasonForRepeatingAcquisition DSRBasicCodedEntry("128552", "DCM", "Reason for Repeating Acquisition") +#define CODE_DCM_PatientMotion DSRBasicCodedEntry("128553", "DCM", "Patient motion") +#define CODE_DCM_SuboptimalContrastTiming DSRBasicCodedEntry("128554", "DCM", "Suboptimal contrast timing") +#define CODE_DCM_AppropriateForTheIndications DSRBasicCodedEntry("128601", "DCM", "Appropriate for the indications") +#define CODE_DCM_ConsistentWithLabelingOfTheDevice DSRBasicCodedEntry("128602", "DCM", "Consistent with labeling of the device") +#define CODE_DCM_ApprovedForUseAtTheInstitution DSRBasicCodedEntry("128603", "DCM", "Approved for use at the institution") +#define CODE_DCM_ApprovedForUseInTheClinicalTrial DSRBasicCodedEntry("128604", "DCM", "Approved for use in the clinical trial") +#define CODE_DCM_ApprovedForUseonPregnantPatients DSRBasicCodedEntry("128605", "DCM", "Approved for use on pregnant patients") +#define CODE_DCM_AppropriateForTheDevice DSRBasicCodedEntry("128606", "DCM", "Appropriate for the device") +#define CODE_DCM_InsideOperationalLimitsOfTheDevice DSRBasicCodedEntry("128607", "DCM", "Inside operational limits of the device") +#define CODE_DCM_OptimizedForTheDeviceInstance DSRBasicCodedEntry("128608", "DCM", "Optimized for the device instance") +#define CODE_DCM_DisapprovedForAnyUse DSRBasicCodedEntry("128609", "DCM", "Disapproved for any use") +#define CODE_DCM_DeprecatedProtocol DSRBasicCodedEntry("128610", "DCM", "Deprecated protocol") +#define CODE_DCM_ApprovedForExperimentalUse DSRBasicCodedEntry("128611", "DCM", "Approved for experimental use") +#define CODE_DCM_DisapprovedForExperimentalUse DSRBasicCodedEntry("128612", "DCM", "Disapproved for experimental use") +#define CODE_DCM_EligibleForReimbursement DSRBasicCodedEntry("128613", "DCM", "Eligible for reimbursement") +#define CODE_DCM_EligibleForReimbursementonPerPatientBasis DSRBasicCodedEntry("128614", "DCM", "Eligible for reimbursement on per patient basis") +#define CODE_DCM_IneligibleForReimbursement DSRBasicCodedEntry("128615", "DCM", "Ineligible for reimbursement") +#define CODE_DCM_DisapprovedForUseonPregnantPatients DSRBasicCodedEntry("128617", "DCM", "Disapproved for use on pregnant patients") +#define CODE_DCM_InappropriateForTheDevice DSRBasicCodedEntry("128618", "DCM", "Inappropriate for the device") +#define CODE_DCM_OutsideOperationalLimitsOfTheDevice DSRBasicCodedEntry("128619", "DCM", "Outside operational limits of the device") +#define CODE_DCM_NotOptimizedForTheDeviceInstance DSRBasicCodedEntry("128620", "DCM", "Not optimized for the device instance") +#define CODE_DCM_InappropriateForTheIndications DSRBasicCodedEntry("128621", "DCM", "Inappropriate for the indications") +#define CODE_DCM_InconsistentWithLabelingOfTheDevice DSRBasicCodedEntry("128622", "DCM", "Inconsistent with labeling of the device") +#define CODE_DCM_DisapprovedForUseAtTheInstitution DSRBasicCodedEntry("128623", "DCM", "Disapproved for use at the institution") +#define CODE_DCM_DisapprovedForUseInTheClinicalTrial DSRBasicCodedEntry("128624", "DCM", "Disapproved for use in the clinical trial") +#define CODE_DCM_HeadOfRadiology DSRBasicCodedEntry("128670", "DCM", "Head of Radiology") +#define CODE_DCM_ChairOfProtocolCommittee DSRBasicCodedEntry("128671", "DCM", "Chair of Protocol Committee") +#define CODE_DCM_AdministratorOfRadiologyDepartment DSRBasicCodedEntry("128673", "DCM", "Administrator of Radiology Department") +#define CODE_DCM_LeadRadiologicTechnologist DSRBasicCodedEntry("128674", "DCM", "Lead Radiologic Technologist") +#define CODE_DCM_HeadOfCardiology DSRBasicCodedEntry("128675", "DCM", "Head of Cardiology") +#define CODE_DCM_RepresentativeOfProtocolCommittee DSRBasicCodedEntry("128676", "DCM", "Representative of Protocol Committee") +#define CODE_DCM_RepresentativeOfEthicsCommittee DSRBasicCodedEntry("128677", "DCM", "Representative of Ethics Committee") +#define CODE_DCM_3DGel DSRBasicCodedEntry("128701", "DCM", "3D Gel") +#define CODE_DCM_DiodeArray DSRBasicCodedEntry("128702", "DCM", "Diode Array") +#define CODE_DCM_IonChamberArray DSRBasicCodedEntry("128703", "DCM", "Ion Chamber Array") +#define CODE_DCM_Diode DSRBasicCodedEntry("128704", "DCM", "Diode") +#define CODE_DCM_LiquidIonChamber DSRBasicCodedEntry("128705", "DCM", "Liquid Ion Chamber") +#define CODE_DCM_OSLD DSRBasicCodedEntry("128706", "DCM", "OSLD") +#define CODE_DCM_IonChamber DSRBasicCodedEntry("128707", "DCM", "Ion Chamber") +#define CODE_DCM_DiamondDetector DSRBasicCodedEntry("128708", "DCM", "Diamond Detector") +#define CODE_DCM_ForTeachingFileExport DSRBasicCodedEntry("128710", "DCM", "For Teaching File Export") +#define CODE_DCM_ForClinicalTrialExport DSRBasicCodedEntry("128711", "DCM", "For Clinical Trial Export") +#define CODE_DCM_AdditionalTeachingFileInformation DSRBasicCodedEntry("128712", "DCM", "Additional Teaching File Information") +#define CODE_DCM_ForResearchCollectionExport DSRBasicCodedEntry("128713", "DCM", "For Research Collection Export") +#define CODE_DCM_ForPublicationExport DSRBasicCodedEntry("128714", "DCM", "For Publication Export") +#define CODE_DCM_DelayExportUntilFinalReportIsAvailable DSRBasicCodedEntry("128715", "DCM", "Delay export until final report is available") +#define CODE_DCM_DelayExportUntilClinicalInformationIsAvailable DSRBasicCodedEntry("128716", "DCM", "Delay export until clinical information is available") +#define CODE_DCM_DelayExportUntilConfirmationOfDiagnosisIsAvailable DSRBasicCodedEntry("128717", "DCM", "Delay export until confirmation of diagnosis is available") +#define CODE_DCM_DelayExportUntilHistopathologyIsAvailable DSRBasicCodedEntry("128718", "DCM", "Delay export until histopathology is available") +#define CODE_DCM_DelayExportUntilOtherLaboratoryResultsAreAvailable DSRBasicCodedEntry("128719", "DCM", "Delay export until other laboratory results are available") +#define CODE_DCM_DelayExportUntilPatientIsDischarged DSRBasicCodedEntry("128720", "DCM", "Delay export until patient is discharged") +#define CODE_DCM_DelayExportUntilPatientDies DSRBasicCodedEntry("128721", "DCM", "Delay export until patient dies") +#define CODE_DCM_DelayExportUntilExpertReviewIsAvailable DSRBasicCodedEntry("128722", "DCM", "Delay export until expert review is available") +#define CODE_DCM_TeachingFileCategory DSRBasicCodedEntry("128723", "DCM", "Teaching File Category") +#define CODE_DCM_LevelOfDifficulty DSRBasicCodedEntry("128724", "DCM", "Level of Difficulty") +#define CODE_DCM_PrimaryLevel DSRBasicCodedEntry("128725", "DCM", "Primary level") +#define CODE_DCM_IntermediateLevel DSRBasicCodedEntry("128726", "DCM", "Intermediate level") +#define CODE_DCM_AdvancedLevel DSRBasicCodedEntry("128727", "DCM", "Advanced level") +#define CODE_DCM_MusculoskeletalImagingSubjectMatter DSRBasicCodedEntry("128728", "DCM", "Musculoskeletal imaging subject matter") +#define CODE_DCM_PulmonaryImagingSubjectMatter DSRBasicCodedEntry("128729", "DCM", "Pulmonary imaging subject matter") +#define CODE_DCM_CardiovascularImagingSubjectMatter DSRBasicCodedEntry("128730", "DCM", "Cardiovascular imaging subject matter") +#define CODE_DCM_GastrointestinalImagingSubjectMatter DSRBasicCodedEntry("128731", "DCM", "Gastrointestinal imaging subject matter") +#define CODE_DCM_GenitourinaryImagingSubjectMatter DSRBasicCodedEntry("128732", "DCM", "Genitourinary imaging subject matter") +#define CODE_DCM_NeuroimagingSubjectMatter DSRBasicCodedEntry("128733", "DCM", "Neuroimaging subject matter") +#define CODE_DCM_VascularAndInterventionalImagingSubjectMatter DSRBasicCodedEntry("128734", "DCM", "Vascular and interventional imaging subject matter") +#define CODE_DCM_NuclearMedicineImagingSubjectMatter DSRBasicCodedEntry("128735", "DCM", "Nuclear medicine imaging subject matter") +#define CODE_DCM_UltrasoundImagingSubjectMatter DSRBasicCodedEntry("128736", "DCM", "Ultrasound imaging subject matter") +#define CODE_DCM_PediatricImagingSubjectMatter DSRBasicCodedEntry("128737", "DCM", "Pediatric imaging subject matter") +#define CODE_DCM_BreastImagingSubjectMatter DSRBasicCodedEntry("128738", "DCM", "Breast imaging subject matter") +#define CODE_DCM_UDI DSRBasicCodedEntry("128739", "DCM", "UDI") +#define CODE_DCM_LongitudinalTemporalOffsetFromEvent DSRBasicCodedEntry("128740", "DCM", "Longitudinal Temporal Offset from Event") +#define CODE_DCM_LongitudinalTemporalEventType DSRBasicCodedEntry("128741", "DCM", "Longitudinal Temporal Event Type") +#define CODE_DCM_EquipmentLandmark DSRBasicCodedEntry("128750", "DCM", "Equipment Landmark") +#define CODE_DCM_CenterOfTableHead DSRBasicCodedEntry("128751", "DCM", "Center of Table Head") +#define CODE_DCM_EquipmentLandmarkXPosition DSRBasicCodedEntry("128752", "DCM", "Equipment Landmark X Position") +#define CODE_DCM_EquipmentLandmarkZPosition DSRBasicCodedEntry("128753", "DCM", "Equipment Landmark Z Position") +#define CODE_DCM_PatientLocationFiducial DSRBasicCodedEntry("128754", "DCM", "Patient Location Fiducial") +#define CODE_DCM_EquipmentLandmarkToPatientFiducialZDistance DSRBasicCodedEntry("128756", "DCM", "Equipment Landmark to Patient Fiducial Z Distance") +#define CODE_DCM_PositionerIsocenterPrimaryAngle DSRBasicCodedEntry("128757", "DCM", "Positioner Isocenter Primary Angle") +#define CODE_DCM_PositionerIsocenterSecondaryAngle DSRBasicCodedEntry("128758", "DCM", "Positioner Isocenter Secondary Angle") +#define CODE_DCM_PositionerIsocenterDetectorRotationAngle DSRBasicCodedEntry("128759", "DCM", "Positioner Isocenter Detector Rotation Angle") +#define CODE_DCM_PositionerIsocenterPrimaryEndAngle DSRBasicCodedEntry("128760", "DCM", "Positioner Isocenter Primary End Angle") +#define CODE_DCM_PositionerIsocenterSecondaryEndAngle DSRBasicCodedEntry("128761", "DCM", "Positioner Isocenter Secondary End Angle") +#define CODE_DCM_PositionerIsocenterDetectorRotationEndAngle DSRBasicCodedEntry("128762", "DCM", "Positioner Isocenter Detector Rotation End Angle") +#define CODE_DCM_TableHeadTiltEndAngle DSRBasicCodedEntry("128763", "DCM", "Table Head Tilt End Angle") +#define CODE_DCM_TableHorizontalRotationEndAngle DSRBasicCodedEntry("128764", "DCM", "Table Horizontal Rotation End Angle") +#define CODE_DCM_TableCradleTiltEndAngle DSRBasicCodedEntry("128765", "DCM", "Table Cradle Tilt End Angle") +#define CODE_DCM_TableXPositionToIsocenter DSRBasicCodedEntry("128766", "DCM", "Table X Position to Isocenter") +#define CODE_DCM_TableYPositionToIsocenter DSRBasicCodedEntry("128767", "DCM", "Table Y Position to Isocenter") +#define CODE_DCM_TableZPositionToIsocenter DSRBasicCodedEntry("128768", "DCM", "Table Z Position to Isocenter") +#define CODE_DCM_TableXEndPositionToIsocenter DSRBasicCodedEntry("128769", "DCM", "Table X End Position to Isocenter") +#define CODE_DCM_TableYEndPositionToIsocenter DSRBasicCodedEntry("128770", "DCM", "Table Y End Position to Isocenter") +#define CODE_DCM_TableZEndPositionToIsocenter DSRBasicCodedEntry("128771", "DCM", "Table Z End Position to Isocenter") +#define CODE_DCM_ReferenceBasis DSRBasicCodedEntry("128772", "DCM", "Reference Basis") +#define CODE_DCM_ReferenceGeometry DSRBasicCodedEntry("128773", "DCM", "Reference Geometry") +#define CODE_DCM_PersonObserverLoginName DSRBasicCodedEntry("128774", "DCM", "Person Observer's Login Name") +#define CODE_DCM_IdentifierWithinPersonObserverRole DSRBasicCodedEntry("128775", "DCM", "Identifier within Person Observer's Role") +#define CODE_DCM_GrayLevelRunLengthMatrix DSRBasicCodedEntry("128776", "DCM", "Gray Level Run Length Matrix") +#define CODE_DCM_GrayLevelSizeZoneMatrix DSRBasicCodedEntry("128777", "DCM", "Gray Level Size Zone Matrix") +#define CODE_DCM_GrayLevelDistanceZoneMatrix DSRBasicCodedEntry("128778", "DCM", "Gray Level Distance Zone Matrix") +#define CODE_DCM_NeighbourhoodGreyToneDifferenceMatrix DSRBasicCodedEntry("128779", "DCM", "Neighbourhood Grey Tone Difference Matrix") +#define CODE_DCM_NeighbouringGreyLevelDependenceMatrix DSRBasicCodedEntry("128780", "DCM", "Neighbouring Grey Level Dependence Matrix") +#define CODE_DCM_RETIRED_JointMaximumOfGLCM DSRBasicCodedEntry("128781", "DCM", "Joint Maximum of GLCM") +#define CODE_DCM_RETIRED_JointAverageOfGLCM DSRBasicCodedEntry("128782", "DCM", "Joint Average of GLCM") +#define CODE_DCM_RETIRED_JointVarianceOfGLCM DSRBasicCodedEntry("128783", "DCM", "Joint Variance of GLCM") +#define CODE_DCM_RETIRED_DifferenceAverageOfGLCM DSRBasicCodedEntry("128784", "DCM", "Difference Average of GLCM") +#define CODE_DCM_RETIRED_DifferenceVarianceOfGLCM DSRBasicCodedEntry("128785", "DCM", "Difference Variance of GLCM") +#define CODE_DCM_RETIRED_DifferenceEntropyOfGLCM DSRBasicCodedEntry("128786", "DCM", "Difference Entropy of GLCM") +#define CODE_DCM_RETIRED_SumAverageOfGLCM DSRBasicCodedEntry("128787", "DCM", "Sum Average of GLCM") +#define CODE_DCM_RETIRED_SumVarianceOfGLCM DSRBasicCodedEntry("128788", "DCM", "Sum Variance of GLCM") +#define CODE_DCM_RETIRED_SumEntropyOfGLCM DSRBasicCodedEntry("128789", "DCM", "Sum Entropy of GLCM") +#define CODE_DCM_InverseDifferenceOfGLCM DSRBasicCodedEntry("128790", "DCM", "Inverse Difference of GLCM") +#define CODE_DCM_InverseDifferenceNormalizedOfGLCM DSRBasicCodedEntry("128791", "DCM", "Inverse Difference Normalized of GLCM") +#define CODE_DCM_InverseDifferenceMomentNormalizedOfGLCM DSRBasicCodedEntry("128792", "DCM", "Inverse Difference Moment Normalized of GLCM") +#define CODE_DCM_RETIRED_InverseVarianceOfGLCM DSRBasicCodedEntry("128793", "DCM", "Inverse Variance of GLCM") +#define CODE_DCM_RETIRED_AutocorrelationOfGLCM DSRBasicCodedEntry("128794", "DCM", "Autocorrelation of GLCM") +#define CODE_DCM_RETIRED_ClusterTendencyOfGLCM DSRBasicCodedEntry("128795", "DCM", "Cluster Tendency of GLCM") +#define CODE_DCM_RETIRED_ClusterShadeOfGLCM DSRBasicCodedEntry("128796", "DCM", "Cluster Shade of GLCM") +#define CODE_DCM_RETIRED_ClusterProminenceOfGLCM DSRBasicCodedEntry("128797", "DCM", "Cluster Prominence of GLCM") +#define CODE_DCM_RETIRED_FirstMeasureOfInformationCorrelationOfGLCM DSRBasicCodedEntry("128798", "DCM", "First Measure of Information Correlation of GLCM") +#define CODE_DCM_RETIRED_SecondMeasureOfInformationCorrelationOfGLCM DSRBasicCodedEntry("128799", "DCM", "Second Measure of Information Correlation of GLCM") +#define CODE_DCM_RETIRED_ShortRunsEmphasis DSRBasicCodedEntry("128801", "DCM", "Short Runs Emphasis") +#define CODE_DCM_RETIRED_LongRunsEmphasis DSRBasicCodedEntry("128802", "DCM", "Long Runs Emphasis") +#define CODE_DCM_RETIRED_LowGrayLevelRunEmphasis DSRBasicCodedEntry("128803", "DCM", "Low Gray Level Run Emphasis") +#define CODE_DCM_RETIRED_HighGrayLevelRunEmphasis DSRBasicCodedEntry("128804", "DCM", "High Gray Level Run Emphasis") +#define CODE_DCM_RETIRED_ShortRunLowGrayLevelEmphasis DSRBasicCodedEntry("128805", "DCM", "Short Run Low Gray Level Emphasis") +#define CODE_DCM_RETIRED_ShortRunHighGrayLevelEmphasis DSRBasicCodedEntry("128806", "DCM", "Short Run High Gray Level Emphasis") +#define CODE_DCM_RETIRED_LongRunLowGrayLevelEmphasis DSRBasicCodedEntry("128807", "DCM", "Long Run Low Gray Level Emphasis") +#define CODE_DCM_RETIRED_LongRunHighGrayLevelEmphasis DSRBasicCodedEntry("128808", "DCM", "Long Run High Gray Level Emphasis") +#define CODE_DCM_RETIRED_GrayLevelNonuniformityInRuns DSRBasicCodedEntry("128809", "DCM", "Gray Level Nonuniformity in Runs") +#define CODE_DCM_GrayLevelNonuniformityInRunsNormalized DSRBasicCodedEntry("128810", "DCM", "Gray Level Nonuniformity in Runs Normalized") +#define CODE_DCM_RETIRED_RunLengthNonuniformity DSRBasicCodedEntry("128811", "DCM", "Run Length Nonuniformity") +#define CODE_DCM_RunLengthNonuniformityNormalized DSRBasicCodedEntry("128812", "DCM", "Run Length Nonuniformity Normalized") +#define CODE_DCM_RETIRED_RunPercentage DSRBasicCodedEntry("128813", "DCM", "Run Percentage") +#define CODE_DCM_RETIRED_GrayLevelVarianceInRuns DSRBasicCodedEntry("128814", "DCM", "Gray Level Variance in Runs") +#define CODE_DCM_RETIRED_RunLengthVariance DSRBasicCodedEntry("128815", "DCM", "Run Length Variance") +#define CODE_DCM_RETIRED_RunEntropy DSRBasicCodedEntry("128816", "DCM", "Run Entropy") +#define CODE_DCM_RETIRED_SmallZoneEmphasis DSRBasicCodedEntry("128821", "DCM", "Small Zone Emphasis") +#define CODE_DCM_RETIRED_LargeZoneEmphasis DSRBasicCodedEntry("128822", "DCM", "Large Zone Emphasis") +#define CODE_DCM_RETIRED_LowGrayLevelZoneEmphasis DSRBasicCodedEntry("128823", "DCM", "Low Gray Level Zone Emphasis") +#define CODE_DCM_RETIRED_HighGrayLevelZoneEmphasis DSRBasicCodedEntry("128824", "DCM", "High Gray Level Zone Emphasis") +#define CODE_DCM_RETIRED_SmallZoneLowGrayLevelEmphasis DSRBasicCodedEntry("128825", "DCM", "Small Zone Low Gray Level Emphasis") +#define CODE_DCM_RETIRED_SmallZoneHighGrayLevelEmphasis DSRBasicCodedEntry("128826", "DCM", "Small Zone High Gray Level Emphasis") +#define CODE_DCM_RETIRED_LargeZoneLowGrayLevelEmphasis DSRBasicCodedEntry("128827", "DCM", "Large Zone Low Gray Level Emphasis") +#define CODE_DCM_RETIRED_LargeZoneHighGrayLevelEmphasis DSRBasicCodedEntry("128828", "DCM", "Large Zone High Gray Level Emphasis") +#define CODE_DCM_RETIRED_GrayLevelNonuniformityOfZoneCounts DSRBasicCodedEntry("128829", "DCM", "Gray Level Nonuniformity of Zone Counts") +#define CODE_DCM_GrayLevelNonuniformityOfZoneCountsNormalized DSRBasicCodedEntry("128830", "DCM", "Gray Level Nonuniformity of Zone Counts Normalized") +#define CODE_DCM_RETIRED_ZoneSizeNonuniformity DSRBasicCodedEntry("128831", "DCM", "Zone Size Nonuniformity") +#define CODE_DCM_ZoneSizeNonuniformityNormalized DSRBasicCodedEntry("128832", "DCM", "Zone Size Nonuniformity Normalized") +#define CODE_DCM_RETIRED_ZonePercentage DSRBasicCodedEntry("128833", "DCM", "Zone Percentage") +#define CODE_DCM_RETIRED_GrayLevelVarianceInZones DSRBasicCodedEntry("128834", "DCM", "Gray Level Variance in Zones") +#define CODE_DCM_RETIRED_ZoneSizeVariance DSRBasicCodedEntry("128835", "DCM", "Zone Size Variance") +#define CODE_DCM_RETIRED_ZoneSizeEntropy DSRBasicCodedEntry("128836", "DCM", "Zone Size Entropy") +#define CODE_DCM_EligibilityReader DSRBasicCodedEntry("129001", "DCM", "Eligibility Reader") +#define CODE_DCM_Designator DSRBasicCodedEntry("129002", "DCM", "Designator") +#define CODE_DCM_ImageQualityController DSRBasicCodedEntry("129003", "DCM", "Image Quality Controller") +#define CODE_DCM_ResultsQualityController DSRBasicCodedEntry("129004", "DCM", "Results Quality Controller") +#define CODE_DCM_EditedModel DSRBasicCodedEntry("129010", "DCM", "Edited Model") +#define CODE_DCM_ComponentModel DSRBasicCodedEntry("129011", "DCM", "Component Model") +#define CODE_DCM_EducationalIntent DSRBasicCodedEntry("129012", "DCM", "Educational Intent") +#define CODE_DCM_PlanningIntent DSRBasicCodedEntry("129013", "DCM", "Planning Intent") +#define CODE_DCM_ToolFabrication DSRBasicCodedEntry("129014", "DCM", "Tool Fabrication") +#define CODE_DCM_ProstheticFabrication DSRBasicCodedEntry("129015", "DCM", "Prosthetic Fabrication") +#define CODE_DCM_ImplantFabrication DSRBasicCodedEntry("129016", "DCM", "Implant Fabrication") +#define CODE_DCM_SimulationIntent DSRBasicCodedEntry("129017", "DCM", "Simulation Intent") +#define CODE_DCM_US3DCAMModel DSRBasicCodedEntry("129018", "DCM", "US 3D CAM model") +#define CODE_DCM_MixedModality3DCAMModel DSRBasicCodedEntry("129019", "DCM", "Mixed Modality 3D CAM model") +#define CODE_DCM_PhotogrammetricImaging3DCAMModel DSRBasicCodedEntry("129020", "DCM", "Photogrammetric Imaging 3D CAM model") +#define CODE_DCM_LaserScanning3DCAMModel DSRBasicCodedEntry("129021", "DCM", "Laser Scanning 3D CAM model") +#define CODE_DCM_FatFraction DSRBasicCodedEntry("129100", "DCM", "Fat fraction") +#define CODE_DCM_WaterFatInPhase DSRBasicCodedEntry("129101", "DCM", "Water/fat in phase") +#define CODE_DCM_WaterFatOutOfPhase DSRBasicCodedEntry("129102", "DCM", "Water/fat out of phase") +#define CODE_DCM_WaterFraction DSRBasicCodedEntry("129103", "DCM", "Water fraction") +#define CODE_DCM_PerfusionImageAnalysis DSRBasicCodedEntry("129104", "DCM", "Perfusion image analysis") +#define CODE_DCM_DiffusionImageAnalysis DSRBasicCodedEntry("129105", "DCM", "Diffusion image analysis") +#define CODE_DCM_DiffusionTractography DSRBasicCodedEntry("129106", "DCM", "Diffusion tractography") +#define CODE_DCM_ImageUsedForTreatmentPlanning DSRBasicCodedEntry("129201", "DCM", "Image used for Treatment Planning") +#define CODE_DCM_ImageUsedForDoseCalculation DSRBasicCodedEntry("129202", "DCM", "Image used for Dose Calculation") +#define CODE_DCM_ImageAcquiredDuringTreatment DSRBasicCodedEntry("129203", "DCM", "Image Acquired during Treatment") +#define CODE_DCM_ImageUsedAsReferenceImageForTreatment DSRBasicCodedEntry("129204", "DCM", "Image used as Reference Image for Treatment") +#define CODE_DCM_RegistrationUsedInPlanning DSRBasicCodedEntry("129210", "DCM", "Registration used in Planning") +#define CODE_DCM_RegistrationCreatedDuringTreatment DSRBasicCodedEntry("129211", "DCM", "Registration created during Treatment") +#define CODE_DCM_CoilMarker DSRBasicCodedEntry("129301", "DCM", "Coil Marker") +#define CODE_DCM_CylinderMarker DSRBasicCodedEntry("129303", "DCM", "Cylinder Marker") +#define CODE_DCM_WireMarker DSRBasicCodedEntry("129305", "DCM", "Wire Marker") +#define CODE_DCM_TransponderMarker DSRBasicCodedEntry("129306", "DCM", "Transponder Marker") +#define CODE_DCM_MRMarker DSRBasicCodedEntry("129308", "DCM", "MR Marker") +#define CODE_DCM_InfraredReflectorMarker DSRBasicCodedEntry("129309", "DCM", "Infrared Reflector Marker") +#define CODE_DCM_VisibleReflectorMarker DSRBasicCodedEntry("129310", "DCM", "Visible Reflector Marker") +#define CODE_DCM_EffectiveAtomicNumber DSRBasicCodedEntry("129320", "DCM", "Effective Atomic Number") +#define CODE_DCM_ModifiedHounsfieldUnit DSRBasicCodedEntry("129321", "DCM", "Modified Hounsfield Unit") +#define CODE_DCM_ValueBasedImage DSRBasicCodedEntry("129322", "DCM", "Value-based Image") +#define CODE_DCM_MaterialSpecificImage DSRBasicCodedEntry("129323", "DCM", "Material Specific Image") +#define CODE_DCM_MaterialRemovedImage DSRBasicCodedEntry("129324", "DCM", "Material Removed Image") +#define CODE_DCM_MaterialHighlightedImage DSRBasicCodedEntry("129325", "DCM", "Material Highlighted Image") +#define CODE_DCM_MaterialSuppressedImage DSRBasicCodedEntry("129326", "DCM", "Material Suppressed Image") +#define CODE_DCM_MaterialRecalculatedImage DSRBasicCodedEntry("129327", "DCM", "Material Recalculated Image") +#define CODE_DCM_VolumeOccupancyImage DSRBasicCodedEntry("129328", "DCM", "Volume Occupancy Image") +#define CODE_DCM_MassOccupancyImage DSRBasicCodedEntry("129329", "DCM", "Mass Occupancy Image") +#define CODE_DCM_MinimumSurfaceRadiationDose DSRBasicCodedEntry("130001", "DCM", "Minimum Surface Radiation Dose") +#define CODE_DCM_MaximumSurfaceRadiationDose DSRBasicCodedEntry("130002", "DCM", "Maximum Surface Radiation Dose") +#define CODE_DCM_MinimumRadiationDose DSRBasicCodedEntry("130003", "DCM", "Minimum Radiation Dose") +#define CODE_DCM_MaximumRadiationDose DSRBasicCodedEntry("130004", "DCM", "Maximum Radiation Dose") +#define CODE_DCM_MinimumMeanRadiationDose DSRBasicCodedEntry("130005", "DCM", "Minimum Mean Radiation Dose") +#define CODE_DCM_MaximumMeanRadiationDose DSRBasicCodedEntry("130006", "DCM", "Maximum Mean Radiation Dose") +#define CODE_DCM_MinimumEquivalentUniformDose DSRBasicCodedEntry("130007", "DCM", "Minimum Equivalent Uniform Dose") +#define CODE_DCM_MaximumEquivalentUniformDose DSRBasicCodedEntry("130008", "DCM", "Maximum Equivalent Uniform Dose") +#define CODE_DCM_PrescriptionRadiationDose DSRBasicCodedEntry("130009", "DCM", "Prescription Radiation Dose") +#define CODE_DCM_MinimumConformityIndex DSRBasicCodedEntry("130010", "DCM", "Minimum Conformity Index") +#define CODE_DCM_MinimumHealthyTissueConformityIndex DSRBasicCodedEntry("130011", "DCM", "Minimum Healthy Tissue Conformity Index") +#define CODE_DCM_MinimumConformationNumber DSRBasicCodedEntry("130012", "DCM", "Minimum Conformation Number") +#define CODE_DCM_MaximumHomogeneityIndex DSRBasicCodedEntry("130013", "DCM", "Maximum Homogeneity Index") +#define CODE_DCM_MinimumPercentVolumeAtRadiationDose DSRBasicCodedEntry("130014", "DCM", "Minimum Percent Volume at Radiation Dose") +#define CODE_DCM_MaximumPercentVolumeAtRadiationDose DSRBasicCodedEntry("130015", "DCM", "Maximum Percent Volume at Radiation Dose") +#define CODE_DCM_MinimumAbsoluteVolumeAtRadiationDose DSRBasicCodedEntry("130016", "DCM", "Minimum Absolute Volume at Radiation Dose") +#define CODE_DCM_MaximumAbsoluteVolumeAtRadiationDose DSRBasicCodedEntry("130017", "DCM", "Maximum Absolute Volume at Radiation Dose") +#define CODE_DCM_MinimizeMeterset DSRBasicCodedEntry("130018", "DCM", "Minimize Meterset") +#define CODE_DCM_SpecifiedRadiationDose DSRBasicCodedEntry("130019", "DCM", "Specified Radiation Dose") +#define CODE_DCM_SpecifiedVolumeSize DSRBasicCodedEntry("130020", "DCM", "Specified Volume Size") +#define CODE_DCM_SpecifiedVolumePercentage DSRBasicCodedEntry("130021", "DCM", "Specified Volume Percentage") +#define CODE_DCM_RadiationCharacteristicsNote DSRBasicCodedEntry("130022", "DCM", "Radiation Characteristics Note") +#define CODE_DCM_BeamShapingNote DSRBasicCodedEntry("130023", "DCM", "Beam Shaping Note") +#define CODE_DCM_TreatmentPlanningNote DSRBasicCodedEntry("130024", "DCM", "Treatment Planning Note") +#define CODE_DCM_SpecialProcedureNote DSRBasicCodedEntry("130025", "DCM", "Special Procedure Note") +#define CODE_DCM_PatientPositioningNote DSRBasicCodedEntry("130026", "DCM", "Patient Positioning Note") +#define CODE_DCM_4DRadiationTreatmentNote DSRBasicCodedEntry("130027", "DCM", "4D Radiation Treatment Note") +#define CODE_DCM_PatientSetupNote DSRBasicCodedEntry("130028", "DCM", "Patient Setup Note") +#define CODE_DCM_PreviousTreatmentNote DSRBasicCodedEntry("130029", "DCM", "Previous Treatment Note") +#define CODE_DCM_PlanningImagingNote DSRBasicCodedEntry("130030", "DCM", "Planning Imaging Note") +#define CODE_DCM_DeliveryVerificationNote DSRBasicCodedEntry("130031", "DCM", "Delivery Verification Note") +#define CODE_DCM_SimulationNote DSRBasicCodedEntry("130032", "DCM", "Simulation Note") +#define CODE_DCM_RadiationTherapyParticle DSRBasicCodedEntry("130033", "DCM", "Radiation Therapy Particle") +#define CODE_DCM_RTBeamEnergy DSRBasicCodedEntry("130034", "DCM", "RT Beam Energy") +#define CODE_DCM_PatientPositioningProcedureNote DSRBasicCodedEntry("130035", "DCM", "Patient Positioning Procedure Note") +#define CODE_DCM_QAProcessNote DSRBasicCodedEntry("130036", "DCM", "QA Process Note") +#define CODE_DCM_IonTherapyParticle DSRBasicCodedEntry("130037", "DCM", "Ion Therapy Particle") +#define CODE_DCM_BrachytherapyIsotope DSRBasicCodedEntry("130038", "DCM", "Brachytherapy Isotope") +#define CODE_DCM_AdaptiveRadiationTherapyNote DSRBasicCodedEntry("130039", "DCM", "Adaptive Radiation Therapy Note") +#define CODE_DCM_TeletherapyIsotope DSRBasicCodedEntry("130040", "DCM", "Teletherapy Isotope") +#define CODE_DCM_RTTarget DSRBasicCodedEntry("130041", "DCM", "RT Target") +#define CODE_DCM_RTDoseCalculationStructure DSRBasicCodedEntry("130042", "DCM", "RT Dose Calculation Structure") +#define CODE_DCM_RTGeometricInformation DSRBasicCodedEntry("130043", "DCM", "RT Geometric Information") +#define CODE_DCM_FixationOrPositioningDevice DSRBasicCodedEntry("130044", "DCM", "Fixation or Positioning Device") +#define CODE_DCM_BrachytherapyDevice DSRBasicCodedEntry("130045", "DCM", "Brachytherapy Device") +#define CODE_DCM_NonSpecificVolume DSRBasicCodedEntry("130046", "DCM", "Non-specific Volume") +#define CODE_DCM_ExternalBodyStructure DSRBasicCodedEntry("130047", "DCM", "External Body Structure") +#define CODE_DCM_UnclassifiedVolume DSRBasicCodedEntry("130048", "DCM", "Unclassified Volume") +#define CODE_DCM_CTVNodal DSRBasicCodedEntry("130049", "DCM", "CTV Nodal") +#define CODE_DCM_CTVPrimary DSRBasicCodedEntry("130050", "DCM", "CTV Primary") +#define CODE_DCM_GTVNodal DSRBasicCodedEntry("130051", "DCM", "GTV Nodal") +#define CODE_DCM_GTVPrimary DSRBasicCodedEntry("130052", "DCM", "GTV Primary") +#define CODE_DCM_PTVNodal DSRBasicCodedEntry("130053", "DCM", "PTV Nodal") +#define CODE_DCM_PTVPrimary DSRBasicCodedEntry("130054", "DCM", "PTV Primary") +#define CODE_DCM_EntireBodyTargetVolume DSRBasicCodedEntry("130055", "DCM", "Entire Body Target Volume") +#define CODE_DCM_ITV DSRBasicCodedEntry("130056", "DCM", "ITV") +#define CODE_DCM_PlanningOrganAtRiskVolume DSRBasicCodedEntry("130057", "DCM", "Planning Organ At Risk Volume") +#define CODE_DCM_AvoidanceVolume DSRBasicCodedEntry("130058", "DCM", "Avoidance Volume") +#define CODE_DCM_TreatedVolume DSRBasicCodedEntry("130059", "DCM", "Treated Volume") +#define CODE_DCM_OrganAtRisk DSRBasicCodedEntry("130060", "DCM", "Organ At Risk") +#define CODE_DCM_RadiationDoseShapingVolume DSRBasicCodedEntry("130061", "DCM", "Radiation Dose Shaping Volume") +#define CODE_DCM_ConformalityShell DSRBasicCodedEntry("130062", "DCM", "Conformality Shell") +#define CODE_DCM_RadiationDoseNormalizationPoint DSRBasicCodedEntry("130063", "DCM", "Radiation Dose Normalization Point") +#define CODE_DCM_RadiationDoseReferencePoint DSRBasicCodedEntry("130064", "DCM", "Radiation Dose Reference Point") +#define CODE_DCM_DoseCalculationBoundingVolume DSRBasicCodedEntry("130065", "DCM", "Dose Calculation Bounding Volume") +#define CODE_DCM_RadiationInteractionVolume DSRBasicCodedEntry("130066", "DCM", "Radiation Interaction Volume") +#define CODE_DCM_PatientAnatomyModel DSRBasicCodedEntry("130067", "DCM", "Patient Anatomy Model") +#define CODE_DCM_ExtendedPatientAnatomyModel DSRBasicCodedEntry("130068", "DCM", "Extended Patient Anatomy Model") +#define CODE_DCM_PatientSetupPoint DSRBasicCodedEntry("130069", "DCM", "Patient Setup Point") +#define CODE_DCM_RoomLaserPatientSetupPoint DSRBasicCodedEntry("130070", "DCM", "Room Laser Patient Setup Point") +#define CODE_DCM_MoveableLaserPatientSetupPoint DSRBasicCodedEntry("130071", "DCM", "Moveable Laser Patient Setup Point") +#define CODE_DCM_ReferenceAcquisitionPoint DSRBasicCodedEntry("130072", "DCM", "Reference Acquisition Point") +#define CODE_DCM_IsocentricTreatmentLocationPoint DSRBasicCodedEntry("130073", "DCM", "Isocentric Treatment Location Point") +#define CODE_DCM_SpecifiedConformityIndex DSRBasicCodedEntry("130074", "DCM", "Specified Conformity Index") +#define CODE_DCM_SpecifiedHealthyTissueConformityIndex DSRBasicCodedEntry("130075", "DCM", "Specified Healthy Tissue Conformity Index") +#define CODE_DCM_SpecifiedConformationNumber DSRBasicCodedEntry("130076", "DCM", "Specified Conformation Number") +#define CODE_DCM_SpecifiedHomogeneityIndex DSRBasicCodedEntry("130077", "DCM", "Specified Homogeneity Index") +#define CODE_DCM_BrachytherapySourceApplicator DSRBasicCodedEntry("130078", "DCM", "Brachytherapy Source Applicator") +#define CODE_DCM_BrachytherapyChannelShield DSRBasicCodedEntry("130079", "DCM", "Brachytherapy Channel Shield") +#define CODE_DCM_BrachytherapyChannel DSRBasicCodedEntry("130080", "DCM", "Brachytherapy Channel") +#define CODE_DCM_UnclassifiedCombination DSRBasicCodedEntry("130081", "DCM", "Unclassified Combination") +#define CODE_DCM_RelativeMassDensity DSRBasicCodedEntry("130082", "DCM", "Relative Mass Density") +#define CODE_DCM_RelativeElectronDensity DSRBasicCodedEntry("130083", "DCM", "Relative Electron Density") +#define CODE_DCM_EffectiveZ DSRBasicCodedEntry("130084", "DCM", "Effective Z") +#define CODE_DCM_EffectiveZPerA DSRBasicCodedEntry("130085", "DCM", "Effective Z per A") +#define CODE_DCM_RelativeLinearStoppingPower DSRBasicCodedEntry("130086", "DCM", "Relative Linear Stopping Power") +#define CODE_DCM_ReferenceEnergy DSRBasicCodedEntry("130087", "DCM", "Reference Energy") +#define CODE_DCM_LinearCellKillFactor DSRBasicCodedEntry("130088", "DCM", "Linear Cell Kill Factor") +#define CODE_DCM_QuadraticCellKillFactor DSRBasicCodedEntry("130089", "DCM", "Quadratic Cell Kill Factor") +#define CODE_DCM_HighDoseFractionLinearCellKillFactor DSRBasicCodedEntry("130090", "DCM", "High Dose Fraction Linear Cell Kill Factor") +#define CODE_DCM_HalfTimeForTissueRepair DSRBasicCodedEntry("130091", "DCM", "Half-time for Tissue Repair") +#define CODE_DCM_HighDoseFractionTransitionDose DSRBasicCodedEntry("130092", "DCM", "High Dose Fraction Transition Dose") +#define CODE_DCM_AtomicNumber DSRBasicCodedEntry("130093", "DCM", "Atomic Number") +#define CODE_DCM_ElementalCompositionAtomicMassFraction DSRBasicCodedEntry("130094", "DCM", "Elemental Composition Atomic Mass Fraction") +#define CODE_DCM_AlphaGEUDValue DSRBasicCodedEntry("130095", "DCM", "alpha gEUD Value") +#define CODE_DCM_SingleFraction DSRBasicCodedEntry("130096", "DCM", "Single Fraction") +#define CODE_DCM_StandardFractionation DSRBasicCodedEntry("130097", "DCM", "Standard Fractionation") +#define CODE_DCM_HypoFractionation DSRBasicCodedEntry("130098", "DCM", "Hypo-fractionation") +#define CODE_DCM_HyperFractionation DSRBasicCodedEntry("130099", "DCM", "Hyper-fractionation") +#define CODE_DCM_ContinuousTemporary DSRBasicCodedEntry("130100", "DCM", "Continuous Temporary") +#define CODE_DCM_ContinuousPermanent DSRBasicCodedEntry("130101", "DCM", "Continuous Permanent") +#define CODE_DCM_StaticBeam DSRBasicCodedEntry("130102", "DCM", "Static Beam") +#define CODE_DCM_ArcBeam DSRBasicCodedEntry("130103", "DCM", "Arc Beam") +#define CODE_DCM_ConformalArcBeam DSRBasicCodedEntry("130104", "DCM", "Conformal Arc Beam") +#define CODE_DCM_StepAndShootBeam DSRBasicCodedEntry("130105", "DCM", "Step and Shoot Beam") +#define CODE_DCM_SlidingWindowBeam DSRBasicCodedEntry("130106", "DCM", "Sliding Window Beam") +#define CODE_DCM_VMAT DSRBasicCodedEntry("130107", "DCM", "VMAT") +#define CODE_DCM_HelicalBeam DSRBasicCodedEntry("130108", "DCM", "Helical Beam") +#define CODE_DCM_TopographicBeam DSRBasicCodedEntry("130109", "DCM", "Topographic Beam") +#define CODE_DCM_Headframe DSRBasicCodedEntry("130110", "DCM", "Headframe") +#define CODE_DCM_HeadMask DSRBasicCodedEntry("130111", "DCM", "Head Mask") +#define CODE_DCM_HeadAndNeckMask DSRBasicCodedEntry("130112", "DCM", "Head and Neck Mask") +#define CODE_DCM_Mold DSRBasicCodedEntry("130113", "DCM", "Mold") +#define CODE_DCM_Cast DSRBasicCodedEntry("130114", "DCM", "Cast") +#define CODE_DCM_BreastBoard DSRBasicCodedEntry("130116", "DCM", "Breast Board") +#define CODE_DCM_BodyFrame DSRBasicCodedEntry("130117", "DCM", "Body Frame") +#define CODE_DCM_VacuumMold DSRBasicCodedEntry("130118", "DCM", "Vacuum Mold") +#define CODE_DCM_WholeBodyPod DSRBasicCodedEntry("130119", "DCM", "Whole Body Pod") +#define CODE_DCM_RectalBalloon DSRBasicCodedEntry("130120", "DCM", "Rectal Balloon") +#define CODE_DCM_VaginalCylinder DSRBasicCodedEntry("130121", "DCM", "Vaginal Cylinder") +#define CODE_DCM_ApertureBlock DSRBasicCodedEntry("130123", "DCM", "Aperture Block") +#define CODE_DCM_AccessoryTray DSRBasicCodedEntry("130124", "DCM", "Accessory Tray") +#define CODE_DCM_RadiotherapyApplicator DSRBasicCodedEntry("130125", "DCM", "Radiotherapy Applicator") +#define CODE_DCM_RadiationTransportBasedMethods DSRBasicCodedEntry("130126", "DCM", "Radiation transport-based methods") +#define CODE_DCM_FractionationBasedOrTemporallyBasedMethods DSRBasicCodedEntry("130127", "DCM", "Fractionation-based or temporally-based methods") +#define CODE_DCM_LocalEffectModel DSRBasicCodedEntry("130128", "DCM", "Local Effect Model") +#define CODE_DCM_MicrodosimetricKineticModel DSRBasicCodedEntry("130129", "DCM", "Microdosimetric Kinetic Model") +#define CODE_DCM_Equivalent2GrayFractionsModel DSRBasicCodedEntry("130130", "DCM", "Equivalent 2-Gray Fractions Model") +#define CODE_DCM_LinearQuadraticModel DSRBasicCodedEntry("130131", "DCM", "Linear-Quadratic Model") +#define CODE_DCM_LinearQuadraticModelWithTimeFactor DSRBasicCodedEntry("130132", "DCM", "Linear-Quadratic Model with Time Factor") +#define CODE_DCM_LinearQuadraticLinearModel DSRBasicCodedEntry("130133", "DCM", "Linear-Quadratic-Linear Model") +#define CODE_DCM_LinearQuadraticModelForLowDoseRateBrachytherapy DSRBasicCodedEntry("130134", "DCM", "Linear-Quadratic Model for Low-Dose Rate Brachytherapy") +#define CODE_DCM_HistoricalRTPrescription DSRBasicCodedEntry("130135", "DCM", "Historical RT Prescription") +#define CODE_DCM_RTPrescriptionInputImages DSRBasicCodedEntry("130136", "DCM", "RT Prescription Input Images") +#define CODE_DCM_RTTreatmentPlanningInputImages DSRBasicCodedEntry("130137", "DCM", "RT Treatment Planning Input Images") +#define CODE_DCM_MultipleFixedSources DSRBasicCodedEntry("130138", "DCM", "Multiple Fixed Sources") +#define CODE_DCM_SynchronizedRoboticTreatment DSRBasicCodedEntry("130139", "DCM", "Synchronized Robotic Treatment") +#define CODE_DCM_NonSynchronizedRoboticTreatment DSRBasicCodedEntry("130140", "DCM", "Non-Synchronized Robotic Treatment") +#define CODE_DCM_3HeliumNucleus DSRBasicCodedEntry("130141", "DCM", "^3^Helium nucleus") +#define CODE_DCM_4HeliumNucleus DSRBasicCodedEntry("130142", "DCM", "^4^Helium nucleus") +#define CODE_DCM_12CarbonNucleus DSRBasicCodedEntry("130143", "DCM", "^12^Carbon nucleus") +#define CODE_DCM_16OxygenNucleus DSRBasicCodedEntry("130144", "DCM", "^16^Oxygen nucleus") +#define CODE_DCM_PressureAboveWarningLimit DSRBasicCodedEntry("130150", "DCM", "Pressure above warning limit") +#define CODE_DCM_PressureAboveAdjustmentLimit DSRBasicCodedEntry("130151", "DCM", "Pressure above adjustment limit") +#define CODE_DCM_FlowRateAboveWarningLimit DSRBasicCodedEntry("130152", "DCM", "Flow rate above warning limit") +#define CODE_DCM_FlowRateAboveAdjustmentLimit DSRBasicCodedEntry("130153", "DCM", "Flow rate above adjustment limit") +#define CODE_DCM_TerminatedDueToRequestFromOperator DSRBasicCodedEntry("130154", "DCM", "Terminated due to request from operator") +#define CODE_DCM_FixedDurationPauseEnded DSRBasicCodedEntry("130155", "DCM", "Fixed duration pause ended") +#define CODE_DCM_TerminatedDueToPressureAboveTerminationLimit DSRBasicCodedEntry("130156", "DCM", "Terminated due to pressure above termination limit") +#define CODE_DCM_TerminatedDueToFlowRateAboveTerminationLimit DSRBasicCodedEntry("130157", "DCM", "Terminated due to flow rate above termination limit") +#define CODE_DCM_TerminatedDueToExcessiveDurationPause DSRBasicCodedEntry("130158", "DCM", "Terminated due to excessive duration pause") +#define CODE_DCM_TerminatedDueToInjectorCommunicationLoss DSRBasicCodedEntry("130159", "DCM", "Terminated due to injector communication loss") +#define CODE_DCM_TerminatedDueToUnspecifiedInjectorFailure DSRBasicCodedEntry("130160", "DCM", "Terminated due to unspecified injector failure") +#define CODE_DCM_KeepVeinOpenStarted DSRBasicCodedEntry("130161", "DCM", "Keep vein open started") +#define CODE_DCM_KeepVeinOpenEnded DSRBasicCodedEntry("130162", "DCM", "Keep vein open ended") +#define CODE_DCM_SyringeAttached DSRBasicCodedEntry("130163", "DCM", "Syringe attached") +#define CODE_DCM_SyringeDetached DSRBasicCodedEntry("130164", "DCM", "Syringe detached") +#define CODE_DCM_TotalKeepVeinOpenVolumeAdministered DSRBasicCodedEntry("130165", "DCM", "Total Keep Vein Open Volume Administered") +#define CODE_DCM_AutomaticAdministrationPhase DSRBasicCodedEntry("130168", "DCM", "Automatic Administration Phase") +#define CODE_DCM_AutomaticProgrammedHoldPhase DSRBasicCodedEntry("130169", "DCM", "Automatic Programmed Hold Phase") +#define CODE_DCM_AutomaticWithManualHoldPhase DSRBasicCodedEntry("130170", "DCM", "Automatic with Manual Hold Phase") +#define CODE_DCM_AutomaticWithManualInjectPhase DSRBasicCodedEntry("130171", "DCM", "Automatic with Manual Inject Phase") +#define CODE_DCM_ManuallyTriggeredInjectionInformation DSRBasicCodedEntry("130172", "DCM", "Manually Triggered Injection Information") +#define CODE_DCM_AutomatedAdministration DSRBasicCodedEntry("130173", "DCM", "Automated Administration") +#define CODE_DCM_ManualAdministration DSRBasicCodedEntry("130174", "DCM", "Manual Administration") +#define CODE_DCM_AirDetected DSRBasicCodedEntry("130175", "DCM", "Air detected") +#define CODE_DCM_TerminatedDueToAirDetected DSRBasicCodedEntry("130176", "DCM", "Terminated due to air detected") +#define CODE_DCM_TerminatedByScanner DSRBasicCodedEntry("130177", "DCM", "Terminated by scanner") +#define CODE_DCM_TerminatedDueToCriticalBatteryLevel DSRBasicCodedEntry("130178", "DCM", "Terminated due to critical battery level") +#define CODE_DCM_TerminatedDueToConsumableRemoval DSRBasicCodedEntry("130179", "DCM", "Terminated due to consumable removal") +#define CODE_DCM_AdministrationMode DSRBasicCodedEntry("130181", "DCM", "Administration Mode") +#define CODE_DCM_PlannedImagingAgentAdministrationProcedureReport DSRBasicCodedEntry("130182", "DCM", "Planned Imaging Agent Administration Procedure Report") +#define CODE_DCM_ImagingAgentInformation DSRBasicCodedEntry("130183", "DCM", "Imaging Agent Information") +#define CODE_DCM_OsmolalityAt37C DSRBasicCodedEntry("130184", "DCM", "Osmolality at 37C") +#define CODE_DCM_OsmolarityAt37C DSRBasicCodedEntry("130185", "DCM", "Osmolarity at 37C") +#define CODE_DCM_ViscosityAt37C DSRBasicCodedEntry("130186", "DCM", "Viscosity at 37C") +#define CODE_DCM_ImagingAgentWarmed DSRBasicCodedEntry("130187", "DCM", "Imaging Agent Warmed") +#define CODE_DCM_ContrastTransverseRelaxivity DSRBasicCodedEntry("130188", "DCM", "Contrast Transverse Relaxivity") +#define CODE_DCM_IsIonic DSRBasicCodedEntry("130189", "DCM", "Is Ionic") +#define CODE_DCM_DosingFactor DSRBasicCodedEntry("130190", "DCM", "Dosing Factor") +#define CODE_DCM_ImagingAgentComponentUsage DSRBasicCodedEntry("130191", "DCM", "Imaging Agent Component Usage") +#define CODE_DCM_ImagingAgentAdministrationSteps DSRBasicCodedEntry("130192", "DCM", "Imaging Agent Administration Steps") +#define CODE_DCM_PressureLimit DSRBasicCodedEntry("130193", "DCM", "Pressure Limit") +#define CODE_DCM_TimeAfterTheStartOfInjection DSRBasicCodedEntry("130194", "DCM", "Time after the start of injection") +#define CODE_DCM_ImagingAgentAdministrationStep DSRBasicCodedEntry("130195", "DCM", "Imaging Agent Administration Step") +#define CODE_DCM_ImagingAgentAdministrationStepIdentifier DSRBasicCodedEntry("130196", "DCM", "Imaging Agent Administration Step Identifier") +#define CODE_DCM_ImagingAgentAdministrationDelay DSRBasicCodedEntry("130197", "DCM", "Imaging Agent Administration Delay") +#define CODE_DCM_ScanDelay DSRBasicCodedEntry("130198", "DCM", "Scan Delay") +#define CODE_DCM_ImagingAgentAdministrationStepsDescription DSRBasicCodedEntry("130199", "DCM", "Imaging Agent Administration Steps Description") +#define CODE_DCM_ImagingAgentAdministrationProtocolName DSRBasicCodedEntry("130200", "DCM", "Imaging Agent Administration Protocol Name") +#define CODE_DCM_ImagingAgentAdministrationPhase DSRBasicCodedEntry("130202", "DCM", "Imaging Agent Administration Phase") +#define CODE_DCM_ImagingAgentAdministrationPhaseIdentifier DSRBasicCodedEntry("130203", "DCM", "Imaging Agent Administration Phase Identifier") +#define CODE_DCM_ImagingAgentAdministrationPhaseType DSRBasicCodedEntry("130204", "DCM", "Imaging Agent Administration Phase Type") +#define CODE_DCM_InitialVolumeOfImagingAgentInContainer DSRBasicCodedEntry("130205", "DCM", "Initial Volume of Imaging Agent in Container") +#define CODE_DCM_ResidualVolumeOfImagingAgentInContainer DSRBasicCodedEntry("130206", "DCM", "Residual Volume of Imaging Agent in Container") +#define CODE_DCM_RiseTime DSRBasicCodedEntry("130207", "DCM", "Rise Time") +#define CODE_DCM_StartingFlowRateOfAdministration DSRBasicCodedEntry("130208", "DCM", "Starting Flow Rate of administration") +#define CODE_DCM_EndingFlowRateOfAdministration DSRBasicCodedEntry("130209", "DCM", "Ending Flow Rate of administration") +#define CODE_DCM_BolusShapingCurve DSRBasicCodedEntry("130210", "DCM", "Bolus Shaping Curve") +#define CODE_DCM_ImagingAgentAdministrationCompletionStatus DSRBasicCodedEntry("130211", "DCM", "Imaging Agent Administration Completion Status") +#define CODE_DCM_ImagingAgentAdministrationAdverseEvents DSRBasicCodedEntry("130212", "DCM", "Imaging Agent Administration Adverse Events") +#define CODE_DCM_EstimatedExtravasationVolume DSRBasicCodedEntry("130214", "DCM", "Estimated Extravasation Volume") +#define CODE_DCM_AdverseEventDetectionDateTime DSRBasicCodedEntry("130215", "DCM", "Adverse Event Detection DateTime") +#define CODE_DCM_ReferencedImagingAgentAdministrationStepUID DSRBasicCodedEntry("130216", "DCM", "Referenced Imaging Agent Administration Step UID") +#define CODE_DCM_ReferencedImagingAgentAdministrationPhaseIdentifier DSRBasicCodedEntry("130217", "DCM", "Referenced Imaging Agent Administration Phase Identifier") +#define CODE_DCM_ProgrammableDevice DSRBasicCodedEntry("130218", "DCM", "Programmable Device") +#define CODE_DCM_NumberOfInjectorHeads DSRBasicCodedEntry("130219", "DCM", "Number of Injector Heads") +#define CODE_DCM_AdministrationDiscontinued DSRBasicCodedEntry("130220", "DCM", "Administration discontinued") +#define CODE_DCM_ImagingAgentVolumePerUnitOfPresentation DSRBasicCodedEntry("130221", "DCM", "Imaging Agent Volume per Unit of Presentation") +#define CODE_DCM_ImagingAgentAdministrationConsumable DSRBasicCodedEntry("130222", "DCM", "Imaging Agent Administration Consumable") +#define CODE_DCM_ImagingAgentAdministrationConsumableType DSRBasicCodedEntry("130223", "DCM", "Imaging Agent Administration Consumable Type") +#define CODE_DCM_ConsumableIsNew DSRBasicCodedEntry("130224", "DCM", "Consumable is New") +#define CODE_DCM_PlannedImagingAgentAdministration DSRBasicCodedEntry("130226", "DCM", "Planned Imaging Agent Administration") +#define CODE_DCM_PerformedImagingAgentAdministration DSRBasicCodedEntry("130227", "DCM", "Performed Imaging Agent Administration") +#define CODE_DCM_ContrastVolumeLimit DSRBasicCodedEntry("130228", "DCM", "Contrast Volume Limit") +#define CODE_DCM_FlowRateVsTime DSRBasicCodedEntry("130229", "DCM", "Flow Rate vs Time") +#define CODE_DCM_PressureVsTime DSRBasicCodedEntry("130230", "DCM", "Pressure vs Time") +#define CODE_DCM_BarcodeValue DSRBasicCodedEntry("130231", "DCM", "Barcode Value") +#define CODE_DCM_ImagingAgentAdministrationGraph DSRBasicCodedEntry("130232", "DCM", "Imaging Agent Administration Graph") +#define CODE_DCM_ImagingAgentAdministrationInjectorEvents DSRBasicCodedEntry("130233", "DCM", "Imaging Agent Administration Injector Events") +#define CODE_DCM_ImagingAgentAdministrationInjectorEventType DSRBasicCodedEntry("130234", "DCM", "Imaging Agent Administration Injector Event Type") +#define CODE_DCM_InjectorEventDetectionDateTime DSRBasicCodedEntry("130235", "DCM", "Injector Event Detection DateTime") +#define CODE_DCM_PlannedImagingAgentAdministrationSOPInstance DSRBasicCodedEntry("130236", "DCM", "Planned Imaging Agent Administration SOP Instance") +#define CODE_DCM_ImagingAgentAdministrationSyringePumpPhaseActivity DSRBasicCodedEntry("130237", "DCM", "Imaging Agent Administration Syringe/Pump Phase Activity") +#define CODE_DCM_ImagingAgentComponent DSRBasicCodedEntry("130238", "DCM", "Imaging Agent Component") +#define CODE_DCM_ComponentVolume DSRBasicCodedEntry("130239", "DCM", "Component Volume") +#define CODE_DCM_TotalPhaseVolumeAdministered DSRBasicCodedEntry("130240", "DCM", "Total Phase Volume Administered") +#define CODE_DCM_TotalStepVolumeAdministered DSRBasicCodedEntry("130241", "DCM", "Total Step Volume Administered") +#define CODE_DCM_TotalNumberOfManuallyTriggeredInjections DSRBasicCodedEntry("130242", "DCM", "Total number of manually triggered injections") +#define CODE_DCM_PeakFlowRateInPhaseActivity DSRBasicCodedEntry("130244", "DCM", "Peak Flow Rate in Phase Activity") +#define CODE_DCM_PeakPressureInPhaseActivity DSRBasicCodedEntry("130245", "DCM", "Peak Pressure in Phase Activity") +#define CODE_DCM_ImagingAgentAdministrationPerformedStepUID DSRBasicCodedEntry("130246", "DCM", "Imaging Agent Administration Performed Step UID") +#define CODE_DCM_PatencyTestInjection DSRBasicCodedEntry("130247", "DCM", "Patency Test Injection") +#define CODE_DCM_TransitTimeTestInjection DSRBasicCodedEntry("130248", "DCM", "Transit Time Test Injection") +#define CODE_DCM_DiagnosticAdministration DSRBasicCodedEntry("130249", "DCM", "Diagnostic Administration") +#define CODE_DCM_AdministrationStepType DSRBasicCodedEntry("130250", "DCM", "Administration Step Type") +#define CODE_DCM_FlushAdministration DSRBasicCodedEntry("130251", "DCM", "Flush Administration") +#define CODE_DCM_NegativeExponential DSRBasicCodedEntry("130252", "DCM", "Negative exponential") +#define CODE_DCM_LinearCurve DSRBasicCodedEntry("130253", "DCM", "Linear Curve") +#define CODE_DCM_ImagingAgentIdentifier DSRBasicCodedEntry("130254", "DCM", "Imaging Agent Identifier") +#define CODE_DCM_ReferencedImagingAgentIdentifier DSRBasicCodedEntry("130255", "DCM", "Referenced Imaging Agent Identifier") +#define CODE_DCM_ConsumableCatheterType DSRBasicCodedEntry("130257", "DCM", "Consumable Catheter Type") +#define CODE_DCM_ContrastReactionProphylacticAgent DSRBasicCodedEntry("130259", "DCM", "Contrast Reaction Prophylactic Agent") +#define CODE_DCM_ImagingAgentAdministrationPerformedPhaseUID DSRBasicCodedEntry("130261", "DCM", "Imaging Agent Administration Performed Phase UID") +#define CODE_DCM_ReferencedImagingAgentAdministrationPhaseUID DSRBasicCodedEntry("130262", "DCM", "Referenced Imaging Agent Administration Phase UID") +#define CODE_DCM_SkinOfParaspinalAreaOfTheNeck DSRBasicCodedEntry("130300", "DCM", "Skin of paraspinal area of the neck") +#define CODE_DCM_SkinOfParaspinalAreaOfTheSuperiorBack DSRBasicCodedEntry("130301", "DCM", "Skin of paraspinal area of the superior back") +#define CODE_DCM_SkinOfUpperParaspinalRegion DSRBasicCodedEntry("130302", "DCM", "Skin of upper paraspinal region") +#define CODE_DCM_SkinOfMidParaspinalRegion DSRBasicCodedEntry("130303", "DCM", "Skin of mid paraspinal region") +#define CODE_DCM_SkinOfLowerParaspinalRegion DSRBasicCodedEntry("130304", "DCM", "Skin of lower paraspinal region") +#define CODE_DCM_SkinOfAnteriorHelixOfEar DSRBasicCodedEntry("130305", "DCM", "Skin of anterior helix of ear") +#define CODE_DCM_SkinOfCaruncleOfEye DSRBasicCodedEntry("130306", "DCM", "Skin of caruncle of eye") +#define CODE_DCM_SkinOfInferiorHelixOfEar DSRBasicCodedEntry("130307", "DCM", "Skin of inferior helix of ear") +#define CODE_DCM_SkinOfInferiorPosteriorSurfaceOfThePinna DSRBasicCodedEntry("130308", "DCM", "Skin of inferior posterior surface of the pinna") +#define CODE_DCM_SkinOfLateralPartOfDorsumOfFoot DSRBasicCodedEntry("130309", "DCM", "Skin of lateral part of dorsum of foot") +#define CODE_DCM_SkinOfLowerAntihelixOfEar DSRBasicCodedEntry("130310", "DCM", "Skin of lower antihelix of ear") +#define CODE_DCM_SkinOfLowerEyelidMargin DSRBasicCodedEntry("130311", "DCM", "Skin of lower eyelid margin") +#define CODE_DCM_SkinOfInfraalarGroove DSRBasicCodedEntry("130312", "DCM", "Skin of infraalar groove") +#define CODE_DCM_SkinOfMedialPartOfDorsumOfFoot DSRBasicCodedEntry("130313", "DCM", "Skin of medial part of dorsum of foot") +#define CODE_DCM_SkinOfParanasalCheek DSRBasicCodedEntry("130314", "DCM", "Skin of paranasal cheek") +#define CODE_DCM_SkinOfPosteriorHelixOfEar DSRBasicCodedEntry("130315", "DCM", "Skin of posterior helix of ear") +#define CODE_DCM_SkinOfPosteriorLobuleOfTheEar DSRBasicCodedEntry("130316", "DCM", "Skin of posterior lobule of the ear") +#define CODE_DCM_SkinOfSoleOfForefoot DSRBasicCodedEntry("130317", "DCM", "Skin of sole of forefoot") +#define CODE_DCM_SkinOfSuperiorAntihelixOfEar DSRBasicCodedEntry("130318", "DCM", "Skin of superior antihelix of ear") +#define CODE_DCM_SkinOfSuperiorPosteriorHelixOfEar DSRBasicCodedEntry("130319", "DCM", "Skin of superior posterior helix of ear") +#define CODE_DCM_SkinOfSuperiorPosteriorSurfaceOfThePinna DSRBasicCodedEntry("130320", "DCM", "Skin of superior posterior surface of the pinna") +#define CODE_DCM_SkinOfUpperAntihelixOfEar DSRBasicCodedEntry("130321", "DCM", "Skin of upper antihelix of ear") +#define CODE_DCM_SkinOfUpperEyelidMargin DSRBasicCodedEntry("130322", "DCM", "Skin of upper eyelid margin") +#define CODE_DCM_SkinOfMidBack DSRBasicCodedEntry("130323", "DCM", "Skin of mid back") + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/codes/ncit.h b/dcmsr/include/dcmtk/dcmsr/codes/ncit.h new file mode 100644 index 00000000..c64cf327 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/codes/ncit.h @@ -0,0 +1,88 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with NCI Thesaurus Code Definitions (Coding Scheme "NCIt") + * + * Generated automatically from DICOM PS 3.16-2019c + * File created on 2019-06-19 17:38:36 by J. Riesmeier + * + */ + + +#ifndef CODES_NCIT_H +#define CODES_NCIT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*-----------------------* + * general information * + *-----------------------*/ + +#define CODE_NCIt_CodingSchemeDesignator "NCIt" +#define CODE_NCIt_CodingSchemeName "NCI Thesaurus" +#define CODE_NCIt_CodingSchemeDescription "NCI Thesaurus" +#define CODE_NCIt_CodingSchemeResponsibleOrganization "NCI" +#define CODE_NCIt_CodingSchemeUID "2.16.840.1.113883.3.26.1.1" + + +/*--------------------* + * code definitions * + *--------------------*/ + +// total number of codes: 36 +// - retired: 0 +// - no name: 0 +// - not unique: 0 + +// The basic scheme for creating the names is as follows: +// 'CODE_' + + ['_RETIRED'] + '_' + +// where is "NCIt" and is either +// - a cleaned camel-case version of the code meaning (if unique within this coding scheme) or +// - a cleaned camel-case version of the code meaning with an underscore and the code value appended or +// - simply the code value with an underscore character appended (if code meaning contains an equation). +// The "cleaned camel-case version of the code meaning" is an attempt to map the free text +// description of the code meaning to a compiler-friendly but still human-readable representation. + +#define CODE_NCIt_EnhancingLesion DSRBasicCodedEntry("C113842", "NCIt", "Enhancing Lesion") +#define CODE_NCIt_RANO DSRBasicCodedEntry("C114879", "NCIt", "RANO") +#define CODE_NCIt_DCFPyL_F18 DSRBasicCodedEntry("C116352", "NCIt", "DCFPyL F^18^") +#define CODE_NCIt_Technetium99mTrofolastat DSRBasicCodedEntry("C116887", "NCIt", "Technetium^99m Trofolastat") +#define CODE_NCIt_PSMA11_Ga68 DSRBasicCodedEntry("C118961", "NCIt", "PSMA-11 Ga^68^") +#define CODE_NCIt_Sarcosine_C11 DSRBasicCodedEntry("C122684", "NCIt", "Sarcosine C^11^") +#define CODE_NCIt_MouseMammaryFatPad DSRBasicCodedEntry("C22550", "NCIt", "Mouse mammary fat pad") +#define CODE_NCIt_Middle DSRBasicCodedEntry("C25569", "NCIt", "Middle") +#define CODE_NCIt_Reader DSRBasicCodedEntry("C28747", "NCIt", "Reader") +#define CODE_NCIt_BronchioloalveolarAdenocarcinoma DSRBasicCodedEntry("C2923", "NCIt", "Bronchioloalveolar adenocarcinoma") +#define CODE_NCIt_ClinicalCourseOfDisease DSRBasicCodedEntry("C35461", "NCIt", "Clinical course of disease") +#define CODE_NCIt_Enrollment DSRBasicCodedEntry("C37948", "NCIt", "Enrollment") +#define CODE_NCIt_RecurrentDisease DSRBasicCodedEntry("C38155", "NCIt", "Recurrent Disease") +#define CODE_NCIt_ExtraluminalRoute DSRBasicCodedEntry("C38213", "NCIt", "Extraluminal route") +#define CODE_NCIt_IntraepithelialRoute DSRBasicCodedEntry("C38244", "NCIt", "Intraepithelial route") +#define CODE_NCIt_TransluminalRoute DSRBasicCodedEntry("C38306", "NCIt", "Transluminal route") +#define CODE_NCIt_NoEvidenceOfDisease DSRBasicCodedEntry("C40413", "NCIt", "No Evidence of Disease") +#define CODE_NCIt_NativeHawaiianOrOtherPacificIslander DSRBasicCodedEntry("C41219", "NCIt", "Native Hawaiian or other Pacific Islander") +#define CODE_NCIt_AdverseEvent DSRBasicCodedEntry("C41331", "NCIt", "Adverse Event") +#define CODE_NCIt_TemperatureSensorDeviceComponent DSRBasicCodedEntry("C50304", "NCIt", "Temperature sensor device component") +#define CODE_NCIt_Reviewer DSRBasicCodedEntry("C54634", "NCIt", "Reviewer") +#define CODE_NCIt_AdLibitum DSRBasicCodedEntry("C64636", "NCIt", "ad libitum") +#define CODE_NCIt_ActivitySession DSRBasicCodedEntry("C67447", "NCIt", "Activity Session") +#define CODE_NCIt_UnitConversionFactor DSRBasicCodedEntry("C70774", "NCIt", "Unit Conversion Factor") +#define CODE_NCIt_MedicalProductExpirationDate DSRBasicCodedEntry("C70854", "NCIt", "Medical Product Expiration Date") +#define CODE_NCIt_NonEnhancingLesion DSRBasicCodedEntry("C81175", "NCIt", "Non-Enhancing Lesion") +#define CODE_NCIt_Erect DSRBasicCodedEntry("C86043", "NCIt", "erect") +#define CODE_NCIt_BeddingChange DSRBasicCodedEntry("C90365", "NCIt", "Bedding change") +#define CODE_NCIt_BeddingMaterial DSRBasicCodedEntry("C90366", "NCIt", "Bedding material") +#define CODE_NCIt_EnvironmentalTemperature DSRBasicCodedEntry("C90380", "NCIt", "Environmental temperature") +#define CODE_NCIt_HousingHumidity DSRBasicCodedEntry("C90395", "NCIt", "Housing humidity") +#define CODE_NCIt_LightCycle DSRBasicCodedEntry("C90419", "NCIt", "Light cycle") +#define CODE_NCIt_WaterDelivery DSRBasicCodedEntry("C90486", "NCIt", "Water delivery") +#define CODE_NCIt_ReferenceRegion DSRBasicCodedEntry("C94970", "NCIt", "Reference Region") +#define CODE_NCIt_DCFBC_F18 DSRBasicCodedEntry("C96234", "NCIt", "DCFBC F^18^") +#define CODE_NCIt_Adjudicator DSRBasicCodedEntry("C96561", "NCIt", "Adjudicator") + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/codes/sct.h b/dcmsr/include/dcmtk/dcmsr/codes/sct.h new file mode 100644 index 00000000..1ca5d6f0 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/codes/sct.h @@ -0,0 +1,68 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with SNOMED-CT Code Definitions (Coding Scheme "SCT") + * + * Generated semi-automatically from DICOM PS 3.16-2015c (for "SRT") + * File created on 2019-04-11 by J. Riesmeier + * Last modified on 2019-04-11 by J. Riesmeier + * + * NB: This file does not yet contain all codes defined in PS 3.16 since the + * mapping of the code meaning to a compiler-friendly representation is + * much more complex than for other coding schemes. + * + */ + + +#ifndef CODES_SCT_H +#define CODES_SCT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*-----------------------* + * general information * + *-----------------------*/ + +#define CODE_SCT_CodingSchemeDesignator "SCT" +#define CODE_SCT_CodingSchemeName "SNOMED CT" +#define CODE_SCT_CodingSchemeDescription "SNOMED, using the CT code values" +#define CODE_SCT_CodingSchemeUID "2.16.840.1.113883.6.96" + + +/*--------------------* + * code definitions * + *--------------------*/ + +// The basic scheme for creating the names is as follows: +// 'CODE_' + + ['_RETIRED'] + '_' + +// where is "SCT" and is either +// - a cleaned camel-case version of the code meaning (if unique within this coding scheme) or +// - a cleaned camel-case version of the code meaning with an underscore and the code value appended or +// - simply the code value with an underscore character appended (if code meaning contains an equation). +// The "cleaned camel-case version of the code meaning" is an attempt to map the free text +// description of the code meaning to a compiler-friendly but still human-readable representation. + +#define CODE_SCT_Radionuclide DSRBasicCodedEntry("89457008", "SCT", "Radionuclide") +#define CODE_SCT_18_Fluorine DSRBasicCodedEntry("77004003", "SCT", "^18^Fluorine") +#define CODE_SCT_Fluorodeoxyglucose_F18 DSRBasicCodedEntry("35321007", "SCT", "Fluorodeoxyglucose F^18^") +#define CODE_SCT_RadiopharmaceuticalAgent DSRBasicCodedEntry("417881006", "SCT", "Radiopharmaceutical agent") +#define CODE_SCT_TopographicalModifier DSRBasicCodedEntry("106233006", "SCT", "Topographical modifier") +#define CODE_SCT_MeasurementMethod DSRBasicCodedEntry("370129005", "SCT", "Measurement Method") +#define CODE_SCT_FindingSite DSRBasicCodedEntry("363698007", "SCT", "Finding Site") +#define CODE_SCT_Laterality DSRBasicCodedEntry("272741003", "SCT", "Laterality") +#define CODE_SCT_RouteOfAdministration DSRBasicCodedEntry("410675002", "SCT", "Route of Administration") +#define CODE_SCT_Neoplasm_Primary DSRBasicCodedEntry("86049000", "SCT", "Neoplasm, Primary") +#define CODE_SCT_Neoplasm_Secondary DSRBasicCodedEntry("14799000", "SCT", "Neoplasm, Secondary") +#define CODE_SCT_ImagingProcedure DSRBasicCodedEntry("363679005", "SCT", "Imaging procedure") +#define CODE_SCT_HalfLifeOfRadiopharmaceutical DSRBasicCodedEntry("304283002", "SCT", "Half-life of radiopharmaceutical") +#define CODE_SCT_AorticArch DSRBasicCodedEntry("57034009", "SCT", "Aortic arch") +#define CODE_SCT_Liver DSRBasicCodedEntry("10200004", "SCT", "Liver") +#define CODE_SCT_Cerebellum DSRBasicCodedEntry("113305005", "SCT", "Cerebellum") +#define CODE_SCT_LymphNode DSRBasicCodedEntry("59441001", "SCT", "Lymph node") + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/codes/srt.h b/dcmsr/include/dcmtk/dcmsr/codes/srt.h new file mode 100644 index 00000000..0045329b --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/codes/srt.h @@ -0,0 +1,73 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with SNOMED-RT Code Definitions (Coding Scheme "SRT") + * + * Generated semi-automatically from DICOM PS 3.16-2015c + * File created on 2015-08-24 by J. Riesmeier + * Last modified on 2019-04-11 by J. Riesmeier + * + * NB: This file does not yet contain all codes defined in PS 3.16 since the + * mapping of the code meaning to a compiler-friendly representation is + * much more complex than for other coding schemes. + * + */ + + +#ifndef CODES_SRT_H +#define CODES_SRT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*-----------------------* + * general information * + *-----------------------*/ + +// DICOM PS3.16 states: +// "This coding scheme is deprecated. The use of 'SNOMED-RT style' code values +// is no longer authorized by SNOMED except for creation by legacy devices, +// legacy objects in archives, and receiving systems that need to understand them." + +#define CODE_SRT_CodingSchemeDesignator "SRT" +#define CODE_SRT_CodingSchemeName "SNOMED RT" +#define CODE_SRT_CodingSchemeDescription "SNOMED, using the 'SNOMED-RT style' code values" +#define CODE_SRT_CodingSchemeUID "2.16.840.1.113883.6.96" + + +/*--------------------* + * code definitions * + *--------------------*/ + +// The basic scheme for creating the names is as follows: +// 'CODE_' + + ['_RETIRED'] + '_' + +// where is "SRT" and is either +// - a cleaned camel-case version of the code meaning (if unique within this coding scheme) or +// - a cleaned camel-case version of the code meaning with an underscore and the code value appended or +// - simply the code value with an underscore character appended (if code meaning contains an equation). +// The "cleaned camel-case version of the code meaning" is an attempt to map the free text +// description of the code meaning to a compiler-friendly but still human-readable representation. + +#define CODE_SRT_Radionuclide DSRBasicCodedEntry("C-10072", "SRT", "Radionuclide") +#define CODE_SRT_18_Fluorine DSRBasicCodedEntry("C-111A1", "SRT", "^18^Fluorine") +#define CODE_SRT_Fluorodeoxyglucose_F18 DSRBasicCodedEntry("C-B1031", "SRT", "Fluorodeoxyglucose F^18^") +#define CODE_SRT_RadiopharmaceuticalAgent DSRBasicCodedEntry("F-61FDB", "SRT", "Radiopharmaceutical agent") +#define CODE_SRT_TopographicalModifier DSRBasicCodedEntry("G-A1F8", "SRT", "Topographical modifier") +#define CODE_SRT_MeasurementMethod DSRBasicCodedEntry("G-C036", "SRT", "Measurement Method") +#define CODE_SRT_FindingSite DSRBasicCodedEntry("G-C0E3", "SRT", "Finding Site") +#define CODE_SRT_Laterality DSRBasicCodedEntry("G-C171", "SRT", "Laterality") +#define CODE_SRT_RouteOfAdministration DSRBasicCodedEntry("G-C340", "SRT", "Route of Administration") +#define CODE_SRT_Neoplasm_Primary DSRBasicCodedEntry("M-80003", "SRT", "Neoplasm, Primary") +#define CODE_SRT_Neoplasm_Secondary DSRBasicCodedEntry("M-80006", "SRT", "Neoplasm, Secondary") +#define CODE_SRT_ImagingProcedure DSRBasicCodedEntry("P0-0099A", "SRT", "Imaging procedure") +#define CODE_SRT_HalfLifeOfRadiopharmaceutical DSRBasicCodedEntry("R-42806", "SRT", "Half-life of radiopharmaceutical") +#define CODE_SRT_AorticArch DSRBasicCodedEntry("T-42300", "SRT", "Aortic arch") +#define CODE_SRT_Liver DSRBasicCodedEntry("T-62000", "SRT", "Liver") +#define CODE_SRT_Cerebellum DSRBasicCodedEntry("T-A6000", "SRT", "Cerebellum") +#define CODE_SRT_LymphNode DSRBasicCodedEntry("T-C4000", "SRT", "Lymph node") + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/codes/ucum.h b/dcmsr/include/dcmtk/dcmsr/codes/ucum.h new file mode 100644 index 00000000..8e1a9a6f --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/codes/ucum.h @@ -0,0 +1,64 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with UCUM Code Definitions (Coding Scheme "UCUM") + * + * Generated semi-automatically from DICOM PS 3.16-2015c + * File created on 2015-08-24 by J. Riesmeier + * Last modified on 2017-03-08 by J. Riesmeier + * + * NB: This file does not yet contain all codes defined in PS 3.16 since the + * mapping of the code meaning to a compiler-friendly representation is + * much more complex than for other coding schemes. + * + */ + + +#ifndef CODES_UCUM_H +#define CODES_UCUM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*-----------------------* + * general information * + *-----------------------*/ + +#define CODE_UCUM_CodingSchemeDesignator "UCUM" +#define CODE_UCUM_CodingSchemeName "UCUM" +#define CODE_UCUM_CodingSchemeDescription "Unified Code for Units of Measure" +#define CODE_UCUM_CodingSchemeUID "2.16.840.1.113883.6.8" + + +/*--------------------* + * code definitions * + *--------------------*/ + +// The basic scheme for creating the names is as follows: +// 'CODE_' + + ['_RETIRED'] + '_' + +// where is "UCUM" and is either +// - a cleaned camel-case version of the code meaning (if unique within this coding scheme) or +// - a cleaned camel-case version of the code meaning with an underscore and the code value appended or +// - simply the code value with an underscore character appended (if code meaning contains an equation). +// The "cleaned camel-case version of the code meaning" is an attempt to map the free text +// description of the code meaning to a compiler-friendly but still human-readable representation. + +#define CODE_UCUM_Pixels DSRBasicCodedEntry("{pixels}", "UCUM", "pixels") +#define CODE_UCUM_Degrees DSRBasicCodedEntry("deg", "UCUM", "deg") +#define CODE_UCUM_Minus1To1 DSRBasicCodedEntry("{-1:1}", "UCUM", "{-1:1}") +#define CODE_UCUM_Millimeter DSRBasicCodedEntry("mm", "UCUM", "millimeter") +#define CODE_UCUM_Centimeter DSRBasicCodedEntry("cm", "UCUM", "centimeter") +#define CODE_UCUM_cm3 DSRBasicCodedEntry("cm3", "UCUM", "cm3") +#define CODE_UCUM_ml DSRBasicCodedEntry("ml", "UCUM", "ml") +#define CODE_UCUM_s DSRBasicCodedEntry("s", "UCUM", "s") +#define CODE_UCUM_min DSRBasicCodedEntry("min", "UCUM", "min") +#define CODE_UCUM_Bq DSRBasicCodedEntry("Bq", "UCUM", "Bq") +#define CODE_UCUM_BqPerMol DSRBasicCodedEntry("Bq/mol", "UCUM", "Bq/mol") +#define CODE_UCUM_mmolPerL DSRBasicCodedEntry("mmol/l", "UCUM", "mmol/l") +#define CODE_UCUM_CountsPerSecond DSRBasicCodedEntry("{counts}/s", "UCUM", "counts/s") + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/codes/umls.h b/dcmsr/include/dcmtk/dcmsr/codes/umls.h new file mode 100644 index 00000000..b6fcb095 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/codes/umls.h @@ -0,0 +1,102 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Header file with UMLS Code Definitions (Coding Scheme "UMLS") + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 16:52:49 by J. Riesmeier + * + */ + + +#ifndef CODES_UMLS_H +#define CODES_UMLS_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*-----------------------* + * general information * + *-----------------------*/ + +#define CODE_UMLS_CodingSchemeDesignator "UMLS" +#define CODE_UMLS_CodingSchemeName "UMLS" +#define CODE_UMLS_CodingSchemeDescription "UMLS codes as CUIs making up the values in a coding system" +#define CODE_UMLS_CodingSchemeResponsibleOrganization "NLM" +#define CODE_UMLS_CodingSchemeUID "2.16.840.1.113883.6.86" + + +/*--------------------* + * code definitions * + *--------------------*/ + +// total number of codes: 50 +// - retired: 0 +// - no name: 0 +// - not unique: 0 + +// The basic scheme for creating the names is as follows: +// 'CODE_' + + ['_RETIRED'] + '_' + +// where is "UMLS" and is either +// - a cleaned camel-case version of the code meaning (if unique within this coding scheme) or +// - a cleaned camel-case version of the code meaning with an underscore and the code value appended or +// - simply the code value with an underscore character appended (if code meaning contains an equation). +// The "cleaned camel-case version of the code meaning" is an attempt to map the free text +// description of the code meaning to a compiler-friendly but still human-readable representation. + +#define CODE_UMLS_AnesthesiaRecoveryPeriod DSRBasicCodedEntry("C0002908", "UMLS", "Anesthesia recovery period") +#define CODE_UMLS_TransgenicAnimal DSRBasicCodedEntry("C0003069", "UMLS", "Transgenic animal") +#define CODE_UMLS_FeedingMethod DSRBasicCodedEntry("C0015746", "UMLS", "Feeding method") +#define CODE_UMLS_Heating DSRBasicCodedEntry("C0018851", "UMLS", "Heating") +#define CODE_UMLS_H2Antagonist DSRBasicCodedEntry("C0019593", "UMLS", "H2 antagonist") +#define CODE_UMLS_EthidiumBromide DSRBasicCodedEntry("C0019873", "UMLS", "Ethidium Bromide") +#define CODE_UMLS_Mastectomy DSRBasicCodedEntry("C0024881", "UMLS", "Mastectomy") +#define CODE_UMLS_Metomidate DSRBasicCodedEntry("C0025856", "UMLS", "Metomidate") +#define CODE_UMLS_NarcoticAnalgesic DSRBasicCodedEntry("C0027409", "UMLS", "Narcotic analgesic") +#define CODE_UMLS_QualitativeEvaluations DSRBasicCodedEntry("C0034375", "UMLS", "Qualitative Evaluations") +#define CODE_UMLS_Thermography DSRBasicCodedEntry("C0039810", "UMLS", "Thermography") +#define CODE_UMLS_Alphaxalone DSRBasicCodedEntry("C0051482", "UMLS", "Alphaxalone") +#define CODE_UMLS_Fluanisone DSRBasicCodedEntry("C0060473", "UMLS", "Fluanisone") +#define CODE_UMLS_HeatLamp DSRBasicCodedEntry("C0181514", "UMLS", "Heat lamp") +#define CODE_UMLS_UnknownPrimaryNeoplasiaSite DSRBasicCodedEntry("C0221297", "UMLS", "unknown primary neoplasia site") +#define CODE_UMLS_RestrictedDiet DSRBasicCodedEntry("C0425422", "UMLS", "Restricted diet") +#define CODE_UMLS_Duration DSRBasicCodedEntry("C0449238", "UMLS", "Duration") +#define CODE_UMLS_InfantOfMotherWithGestationalDiabetes DSRBasicCodedEntry("C0456029", "UMLS", "Infant of mother with gestational diabetes") +#define CODE_UMLS_CoefficientOfVariance DSRBasicCodedEntry("C0681921", "UMLS", "Coefficient of Variance") +#define CODE_UMLS_ManufacturerName DSRBasicCodedEntry("C0947322", "UMLS", "Manufacturer Name") +#define CODE_UMLS_Intern DSRBasicCodedEntry("C1144859", "UMLS", "Intern") +#define CODE_UMLS_ConsultingPhysician DSRBasicCodedEntry("C1441532", "UMLS", "Consulting Physician") +#define CODE_UMLS_Baseline DSRBasicCodedEntry("C1442488", "UMLS", "Baseline") +#define CODE_UMLS_Fluoroetanidazole_F18 DSRBasicCodedEntry("C1541539", "UMLS", "Fluoroetanidazole F^18^") +#define CODE_UMLS_CommercialProduct DSRBasicCodedEntry("C1547887", "UMLS", "Commercial product") +#define CODE_UMLS_Antihypoglycemic DSRBasicCodedEntry("C1579431", "UMLS", "Antihypoglycemic") +#define CODE_UMLS_Unscheduled DSRBasicCodedEntry("C1699701", "UMLS", "Unscheduled") +#define CODE_UMLS_Nadir DSRBasicCodedEntry("C1708760", "UMLS", "Nadir") +#define CODE_UMLS_MedicalPhysicist DSRBasicCodedEntry("C1708969", "UMLS", "Medical Physicist") +#define CODE_UMLS_Referring DSRBasicCodedEntry("C1709880", "UMLS", "Referring") +#define CODE_UMLS_Variance DSRBasicCodedEntry("C1711260", "UMLS", "Variance") +#define CODE_UMLS_Tyrosine3Octreotate_Ga68 DSRBasicCodedEntry("C1742831", "UMLS", "tyrosine-3-octreotate Ga^68^") +#define CODE_UMLS_Fluoroestradiol_FES_F18 DSRBasicCodedEntry("C1831937", "UMLS", "Fluoroestradiol (FES) F^18^") +#define CODE_UMLS_Sonographer DSRBasicCodedEntry("C1954848", "UMLS", "Sonographer") +#define CODE_UMLS_Neuroradiology DSRBasicCodedEntry("C2183225", "UMLS", "Neuroradiology") +#define CODE_UMLS_InverseRatioVentilation DSRBasicCodedEntry("C2223982", "UMLS", "Inverse ratio ventilation") +#define CODE_UMLS_RootMeanSquare DSRBasicCodedEntry("C2347976", "UMLS", "Root Mean Square") +#define CODE_UMLS_TimePoint DSRBasicCodedEntry("C2348792", "UMLS", "Time Point") +#define CODE_UMLS_Edotreotide_Ga68 DSRBasicCodedEntry("C2713594", "UMLS", "Edotreotide Ga^68^") +#define CODE_UMLS_FluoropropylDihydrotetrabenazine_DTBZ_F18 DSRBasicCodedEntry("C2934038", "UMLS", "Fluoropropyl-dihydrotetrabenazine (DTBZ) F^18^") +#define CODE_UMLS_ISO1_F18 DSRBasicCodedEntry("C2981788", "UMLS", "ISO-1 F^18^") +#define CODE_UMLS_RadiationPhysicist DSRBasicCodedEntry("C2985483", "UMLS", "Radiation Physicist") +#define CODE_UMLS_Pretreatment DSRBasicCodedEntry("C3539075", "UMLS", "Pretreatment") +#define CODE_UMLS_DistalPhalanx DSRBasicCodedEntry("C3669027", "UMLS", "Distal phalanx") +#define CODE_UMLS_RoomAir DSRBasicCodedEntry("C3846005", "UMLS", "Room air") +#define CODE_UMLS_THK5351_F18 DSRBasicCodedEntry("C4279748", "UMLS", "THK5351 F^18^") +#define CODE_UMLS_MK6240_F18 DSRBasicCodedEntry("C4506764", "UMLS", "MK-6240 F^18^") +#define CODE_UMLS_UCBJ_C11 DSRBasicCodedEntry("C4506788", "UMLS", "UCB-J C^11^") +#define CODE_UMLS_Flortaucipir_F18 DSRBasicCodedEntry("C4547429", "UMLS", "Flortaucipir F^18^") +#define CODE_UMLS_THK5317_F18 DSRBasicCodedEntry("C4550127", "UMLS", "THK5317 F^18^") + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsdefine.h b/dcmsr/include/dcmtk/dcmsr/dsdefine.h new file mode 100644 index 00000000..08c80714 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsdefine.h @@ -0,0 +1,46 @@ +/* + * + * Copyright (C) 2012-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Uli Schlachter + * + * Purpose: Contains preprocessor definitions + * + */ + + +#ifndef DSDEFINE_H +#define DSDEFINE_H + +#include "dcmtk/config/osconfig.h" + +#include "dcmtk/ofstd/ofdefine.h" + + +#ifdef dcmsr_EXPORTS +#define DCMTK_DCMSR_EXPORT DCMTK_DECL_EXPORT +#else +#define DCMTK_DCMSR_EXPORT DCMTK_DECL_IMPORT +#endif + +#ifndef DCMTK_EXPLICIT_SPECIALIZATION +#ifdef HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION +#define DCMTK_EXPLICIT_SPECIALIZATION template<> +#else +#define DCMTK_EXPLICIT_SPECIALIZATION +#endif +#endif + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsracqcc.h b/dcmsr/include/dcmtk/dcmsr/dsracqcc.h new file mode 100644 index 00000000..9168baa2 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsracqcc.h @@ -0,0 +1,95 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRAcquisitionContextSRConstraintChecker + * + */ + + +#ifndef DSRACQCC_H +#define DSRACQCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Acquisition Context + * SR IOD. + * According to DICOM PS 3.3: "The document may be constructed from Baseline TID 8001 + * (Preclinical Small Animal Image Acquisition Context) invoked at the root node. + * Note: This IOD may be used with other Templates defined for Acquisition Context." + */ +class DCMTK_DCMSR_EXPORT DSRAcquisitionContextSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRAcquisitionContextSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRAcquisitionContextSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_AcquisitionContextSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrbascc.h b/dcmsr/include/dcmtk/dcmsr/dsrbascc.h new file mode 100644 index 00000000..2d9e599c --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrbascc.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRBasicTextSRConstraintChecker + * + */ + + +#ifndef DSRBASCC_H +#define DSRBASCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Basic Text SR IOD + */ +class DCMTK_DCMSR_EXPORT DSRBasicTextSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRBasicTextSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRBasicTextSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_BasicTextSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrc3dcc.h b/dcmsr/include/dcmtk/dcmsr/dsrc3dcc.h new file mode 100644 index 00000000..e2c75179 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrc3dcc.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2013-2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRComprehensive3DSRConstraintChecker + * + */ + + +#ifndef DSRC3DCC_H +#define DSRC3DCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Comprehensive 3D SR IOD + */ +class DCMTK_DCMSR_EXPORT DSRComprehensive3DSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRComprehensive3DSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRComprehensive3DSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFTrue, i.e. by-reference relationships are allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_Comprehensive3DSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrchecc.h b/dcmsr/include/dcmtk/dcmsr/dsrchecc.h new file mode 100644 index 00000000..b1b775c6 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrchecc.h @@ -0,0 +1,95 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRChestCadSRConstraintChecker + * + */ + + +#ifndef DSRCHECC_H +#define DSRCHECC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Chest CAD SR IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 4100 + * (Chest CAD Document Root) invoked at the root node. When a content item sub-tree + * from a prior document is duplicated by-value, its observation context shall be + * defined by TID 1001 (Observation Context) and its subordinate templates." + */ +class DCMTK_DCMSR_EXPORT DSRChestCadSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRChestCadSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRChestCadSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFTrue, i.e. by-reference relationships are allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_ChestCadSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcitem.h b/dcmsr/include/dcmtk/dcmsr/dsrcitem.h new file mode 100644 index 00000000..0f42da18 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcitem.h @@ -0,0 +1,633 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRContentItem + * + */ + + +#ifndef DSRCITEM_H +#define DSRCITEM_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrcodvl.h" +#include "dcmtk/dcmsr/dsrnumvl.h" +#include "dcmtk/dcmsr/dsrscovl.h" +#include "dcmtk/dcmsr/dsrsc3vl.h" +#include "dcmtk/dcmsr/dsrtcovl.h" +#include "dcmtk/dcmsr/dsrcomvl.h" +#include "dcmtk/dcmsr/dsrimgvl.h" +#include "dcmtk/dcmsr/dsrwavvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Interface class for content items. + * This class allows to access the document tree nodes without using any pointers. + */ +class DCMTK_DCMSR_EXPORT DSRContentItem + : protected DSRTypes +{ + // allow DSRDocumentSubTree to access protected method setTreeNode() + friend class DSRDocumentSubTree; + + public: + + /** copy constructor. + * Internally, the copy constructor of the respective tree node class is used, so the + * corresponding comments apply. This also means that the copy describes a separate + * content item, i.e. without relationships to other content items. + ** @param item content item to be copied + */ + DSRContentItem(const DSRContentItem &item); + + /** destructor + */ + virtual ~DSRContentItem(); + + /** comparison operator "equal". + * Two content items are regarded as equal if the comparison operator of the referenced + * document tree nodes says so. + ** @param item content item that should be compared to the current one + ** @return OFTrue if both content items are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRContentItem &item) const; + + /** comparison operator "not equal". + * Two content items are regarded as not equal if the comparison operator of the + * referenced document tree nodes says so. + ** @param item content item that should be compared to the current one + ** @return OFTrue if both content items are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRContentItem &item) const; + + /** check for validity/completeness. + * Applicable to all content items. + ** @return OFTrue if current content item is valid, OFFalse otherwise + */ + OFBool isValid() const; + + /** check for mark flag. + * Applicable to all content items. + ** @return OFTrue if current content item is marked, OFFalse otherwise + */ + OFBool isMarked() const; + + /** mark/unmark item. + * Applicable to all content items. + ** @param flag mark item if OFTrue, unmark otherwise + */ + void setMark(const OFBool flag); + + /** get value type. + * Applicable to all content items. + ** @return value type of current content item if valid, DSRTypes::VT_invalid otherwise + */ + E_ValueType getValueType() const; + + /** get relationship type. + * Applicable to all content items. + ** @return relationship type of current content item if valid, DSRTypes::RT_invalid + * otherwise + */ + E_RelationshipType getRelationshipType() const; + + /** get ID of the referenced node. + * Applicable to: by-reference relationships + ** @return ID of the referenced node if valid, 0 otherwise + */ + size_t getReferencedNodeID() const; + + /** get string value. + * Applicable to: TEXT, DATETIME, DATE, TIME, UIDREF, PNAME + ** @return string value of current content item if valid, EmptyString otherwise + */ + const OFString &getStringValue() const; + + /** set string value. + * Please use the correct format for the string value depending on the corresponding + * content item (value type). + * + * Applicable to: TEXT, DATETIME, DATE, TIME, UIDREF, PNAME + ** @param stringValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStringValue(const OFString &stringValue, + const OFBool check = OFTrue); + + /** get pointer to code value. + * Applicable to: CODE + ** @return pointer to code value of current content item if valid, NULL otherwise + */ + DSRCodedEntryValue *getCodeValuePtr(); + + /** get code value. + * Applicable to: CODE + ** @return coded entry value of current content item if valid, EmptyCodedEntry otherwise + */ + const DSRCodedEntryValue &getCodeValue() const; + + /** get copy of code value. + * Applicable to: CODE + ** @param codeValue variable where the copy should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCodeValue(DSRCodedEntryValue &codeValue) const; + + /** set code value. + * Applicable to: CODE + ** @param codeValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodeValue(const DSRCodedEntryValue &codeValue, + const OFBool check = OFTrue); + + /** get pointer to numeric value. + * Applicable to: NUM + ** @return pointer to numeric value of current content item if valid, NULL otherwise + */ + DSRNumericMeasurementValue *getNumericValuePtr(); + + /** get numeric value. + * Applicable to: NUM + ** @return numeric measurement value of current content item if valid, + * EmptyNumericMeasurement otherwise + */ + const DSRNumericMeasurementValue &getNumericValue() const; + + /** get copy of numeric value. + * Applicable to: NUM + ** @param numericValue variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getNumericValue(DSRNumericMeasurementValue &numericValue) const; + + /** set numeric value. + * Applicable to: NUM + ** @param numericValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValue(const DSRNumericMeasurementValue &numericValue, + const OFBool check = OFTrue); + + /** get pointer to spatial coordinates. + * Applicable to: SCOORD + ** @return pointer to spatial coordinates value of current content item if valid, + * NULL otherwise + */ + DSRSpatialCoordinatesValue *getSpatialCoordinatesPtr(); + + /** get spatial coordinates. + * Applicable to: SCOORD + ** @return spatial coordinates value of current content item if valid, + * EmptySpatialCoordinates otherwise + */ + const DSRSpatialCoordinatesValue &getSpatialCoordinates() const; + + /** get copy of spatial coordinates. + * Applicable to: SCOORD + ** @param coordinatesValue variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpatialCoordinates(DSRSpatialCoordinatesValue &coordinatesValue) const; + + /** set spatial coordinates. + * Applicable to: SCOORD + ** @param coordinatesValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpatialCoordinates(const DSRSpatialCoordinatesValue &coordinatesValue, + const OFBool check = OFTrue); + + /** get pointer to spatial coordinates 3D. + * Applicable to: SCOORD3D + ** @return pointer to spatial coordinates 3D value of current content item if valid, + * NULL otherwise + */ + DSRSpatialCoordinates3DValue *getSpatialCoordinates3DPtr(); + + /** get spatial coordinates 3D. + * Applicable to: SCOORD3D + ** @return spatial coordinates 3D value of current content item if valid, + * EmptySpatialCoordinates3D otherwise + */ + const DSRSpatialCoordinates3DValue &getSpatialCoordinates3D() const; + + /** get copy of spatial coordinates 3D. + * Applicable to: SCOORD3D + ** @param coordinatesValue variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getSpatialCoordinates3D(DSRSpatialCoordinates3DValue &coordinatesValue) const; + + /** set spatial coordinates 3D. + * Applicable to: SCOORD3D + ** @param coordinatesValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpatialCoordinates3D(const DSRSpatialCoordinates3DValue &coordinatesValue, + const OFBool check = OFTrue); + + /** get pointer to temporal coordinates. + * Applicable to: TCOORD + ** @return pointer to temporal coordinates value of current content item if valid, + * NULL otherwise + */ + DSRTemporalCoordinatesValue *getTemporalCoordinatesPtr(); + + /** get temporal coordinates. + * Applicable to: TCOORD + ** @return temporal coordinates value of current content item if valid, + * EmptyTemporalCoordinates otherwise + */ + const DSRTemporalCoordinatesValue &getTemporalCoordinates() const; + + /** get copy of temporal coordinates. + * Applicable to: TCOORD + ** @param coordinatesValue variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTemporalCoordinates(DSRTemporalCoordinatesValue &coordinatesValue) const; + + /** set temporal coordinates. + * Applicable to: TCOORD + ** @param coordinatesValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTemporalCoordinates(const DSRTemporalCoordinatesValue &coordinatesValue, + const OFBool check = OFTrue); + + /** get pointer to composite reference. + * Applicable to: COMPOSITE + ** @return pointer to reference value of current content item if valid, NULL otherwise + */ + DSRCompositeReferenceValue *getCompositeReferencePtr(); + + /** get composite reference. + * Applicable to: COMPOSITE + ** @return reference value of current content item if valid, EmptyReference otherwise + */ + const DSRCompositeReferenceValue &getCompositeReference() const; + + /** get copy of composite reference. + * Applicable to: COMPOSITE + ** @param referenceValue variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getCompositeReference(DSRCompositeReferenceValue &referenceValue) const; + + /** set composite reference. + * Applicable to: COMPOSITE + ** @param referenceValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCompositeReference(const DSRCompositeReferenceValue &referenceValue, + const OFBool check = OFTrue); + + /** get pointer to image reference. + * Applicable to: IMAGE + ** @return pointer to image reference value of current content item if valid, + * NULL otherwise + */ + DSRImageReferenceValue *getImageReferencePtr(); + + /** get image reference. + * Applicable to: IMAGE + ** @return image reference value of current content item if valid, + * EmptyImageReference otherwise + */ + const DSRImageReferenceValue &getImageReference() const; + + /** get copy of image reference. + * Applicable to: IMAGE + ** @param referenceValue variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getImageReference(DSRImageReferenceValue &referenceValue) const; + + /** set image reference. + * Applicable to: IMAGE + ** @param referenceValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setImageReference(const DSRImageReferenceValue &referenceValue, + const OFBool check = OFTrue); + + /** get pointer to waveform reference. + * Applicable to: WAVEFORM + ** @return pointer to waveform reference value of current content item if valid, + * NULL otherwise + */ + DSRWaveformReferenceValue *getWaveformReferencePtr(); + + /** get waveform reference. + * Applicable to: WAVEFORM + ** @return waveform reference value of current content item if valid, + * EmptyWaveformReference otherwise + */ + const DSRWaveformReferenceValue &getWaveformReference() const; + + /** get copy of waveform reference. + * Applicable to: WAVEFORM + ** @param referenceValue variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getWaveformReference(DSRWaveformReferenceValue &referenceValue) const; + + /** set waveform reference. + * Applicable to: WAVEFORM + ** @param referenceValue value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setWaveformReference(const DSRWaveformReferenceValue &referenceValue, + const OFBool check = OFTrue); + + /** get continuity of content flag. + * This flag specifies whether or not its contained content items (child nodes) are + * logically linked in a continuous textual flow, or are separate items. + * + * Applicable to: CONTAINER + ** @return continuity of content flag if successful, DSRTypes::COC_invalid otherwise + */ + E_ContinuityOfContent getContinuityOfContent() const; + + /** set continuity of content flag. + * This flag specifies whether or not its contained content items (child nodes) are + * logically linked in a continuous textual flow, or are separate items. + * + * Applicable to: CONTAINER + ** @param continuityOfContent value to be set + * (should be different from DSRTypes::COC_invalid) + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContinuityOfContent(const E_ContinuityOfContent continuityOfContent, + const OFBool check = OFTrue); + + /** get template identifier and mapping resource. + * This value pair identifies the template that was used to create this content item + * (and its children). According to the DICOM standard this is "required if a template + * was used to define the content of this Item, and the template consists of a single + * CONTAINER with nested content, and it is the outermost invocation of a set of + * nested templates that start with the same CONTAINER." + * The identification is valid if both values are either present (non-empty) or absent + * (empty). + * + * Applicable to: CONTAINER + ** @param templateIdentifier identifier of the template (might be empty) + * @param mappingResource mapping resource that defines the template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get template identifier and mapping resource and optional mapping resource UID. + * This value triple identifies the template that was used to create this content item + * (and its children). According to the DICOM standard, this is "required if a template + * was used to define the content of this Item, and the template consists of a single + * CONTAINER with nested content, and it is the outermost invocation of a set of + * nested templates that start with the same CONTAINER." + * The identification is valid if the first two values are either present (non-empty) or + * all three are absent (empty). + * + * Applicable to: CONTAINER + ** @param templateIdentifier identifier of the template (might be empty) + * @param mappingResource mapping resource that defines the template + * (might be empty) + * @param mappingResourceUID uniquely identifies the mapping resource + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource, + OFString &mappingResourceUID) const; + + /** set template identifier and mapping resource. + * The identification is valid if the first two values are either present (non-empty) + * or all three values are absent (empty). See getTemplateIdentification() for details. + * Please use the correct DICOM format for all values (VR=CS,CS,UI). + * + * Applicable to: CONTAINER + ** @param templateIdentifier identifier of the template to be set + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional) + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "", + const OFBool check = OFTrue); + + /** get pointer to concept name. + * Code describing the concept represented by this content item. Also conveys the value + * of document title and section headings in documents. + * Applicable to all content items (by-value only). + ** @return pointer to concept name value of current content item if valid, NULL otherwise + */ + DSRCodedEntryValue *getConceptNamePtr(); + + /** get concept name. + * Code describing the concept represented by this content item. Also conveys the value + * of document title and section headings in documents. + * + * Applicable to all content items (by-value only). + ** @return concept name value of current content item if valid, EmptyCodedEntry otherwise + */ + const DSRCodedEntryValue &getConceptName() const; + + /** get copy of concept name. + * Code describing the concept represented by this content item. Also conveys the value + * of document title and section headings in documents. + * + * Applicable to all content items (by-value only). + ** @param conceptName variable where the copy should be stored + * (cleared if an error occurs) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getConceptName(DSRCodedEntryValue &conceptName) const; + + /** set concept name. + * Code describing the concept represented by this content item. Also conveys the value + * of document title and section headings in documents. + * + * Applicable to all content items (by-value only, optional/conditional for some value + * types). + ** @param conceptName value to be set + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setConceptName(const DSRCodedEntryValue &conceptName, + const OFBool check = OFTrue); + + /** get observation date/time. + * This is the date and time on which this content item was completed. Might be empty + * if the date and time do not differ from the content date and time, see DSRDocument. + * + * Applicable to all content items (by-value only, optional attribute). + ** @return observation date/time of current content item if valid, EmptyString otherwise + */ + const OFString &getObservationDateTime() const; + + /** set observation date/time. + * This is the date and time on which this content item was completed. Might be empty + * if the date and time do not differ from the content date and time, see DSRDocument. + * Please use the correct DICOM format (VR=DT). + * + * Applicable to all content items (by-value only). + ** @param observationDateTime value to be set (might be an empty string) + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setObservationDateTime(const OFString &observationDateTime, + const OFBool check = OFTrue); + + /** get observation unique identifier. + * The UID represents the semantic content of the observation; an encoding of the same + * observation with the same context into another representation may use the same UID. + * + * Applicable to all content items (by-value only, optional attribute). + ** @return observation unique identifier of current content item if valid, + * EmptyString otherwise + */ + const OFString &getObservationUID() const; + + /** set observation unique identifier. + * The UID represents the semantic content of the observation; an encoding of the same + * observation with the same context into another representation may use the same UID. + * Please use the correct DICOM format (VR=UI). + * + * Applicable to all content items (by-value only). + ** @param observationUID value to be set (might be an empty string) + * @param check if enabled, check value for validity before setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setObservationUID(const OFString &observationUID, + const OFBool check = OFTrue); + + /** get annotation text. + * The optional annotation text allows for labeling a content item with an arbitrary + * character string. This might be useful to navigate more easily within the document + * tree. + * + * Applicable to all content items (optional). + ** @return annotation text of current content item if valid, EmptyString otherwise + */ + const OFString &getAnnotationText() const; + + /** set annotation text. + * The optional annotation text allows for labeling a content item with an arbitrary + * character string. This might be useful to navigate more easily within the document + * tree. + * + * Applicable to all content items (optional). + ** @param annotationText value to be set (might be an empty string) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setAnnotationText(const OFString &annotationText) const; + + + protected: + + /** default constructor (protected) + */ + DSRContentItem(); + + /** set internal tree node pointer (protected) + ** @param node pointer to the document tree node (content item) + */ + inline void setTreeNode(DSRDocumentTreeNode *node) + { + TreeNode = node; + } + + /** fast, non-throwing swap function. + * The time complexity of this function is constant. + ** @param item content item to swap with + */ + void swap(DSRContentItem &item); + + + private: + + /// internal tree node pointer to current content item + DSRDocumentTreeNode *TreeNode; + /// flag indicating whether to delete the 'TreeNode' during destruction (or not) + /*const*/ OFBool DeleteTreeNode; // removed "const" to support swap() method + + /// empty numeric measurement value. Used as default return value for getNumericValue(). + /// A static member variable (as for the other values below) cannot be used because this + /// class contains members that again contain OFCondition instances that cannot be defined + /// before the main() function starts. + const DSRNumericMeasurementValue EmptyNumericMeasurement; + + /// empty string value. + /// Used as default return value for getStringValue() + static const OFString EmptyString; + /// empty coded entry value. + /// Used as default return value for getCodeValue() and getConceptName() + static const DSRCodedEntryValue EmptyCodedEntry; + /// empty spatial coordinates value. + /// Used as default return value for getSpatialCoordinates() + static const DSRSpatialCoordinatesValue EmptySpatialCoordinates; + /// empty spatial coordinates 3D value. + /// Used as default return value for getSpatialCoordinates3D() + static const DSRSpatialCoordinates3DValue EmptySpatialCoordinates3D; + /// empty temporal coordinates value. + /// Used as default return value for getTemporalCoordinates() + static const DSRTemporalCoordinatesValue EmptyTemporalCoordinates; + /// empty composite reference value. + /// Used as default return value for getCompositeReference() + static const DSRCompositeReferenceValue EmptyCompositeReference; + /// empty image reference value. + /// Used as default return value for getImageReference() + static const DSRImageReferenceValue EmptyImageReference; + /// empty waveform reference value. + /// Used as default return value for getWaveformReference() + static const DSRWaveformReferenceValue EmptyWaveformReference; + + + // --- declaration of assignment operator + + DSRContentItem &operator=(const DSRContentItem &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcodtn.h b/dcmsr/include/dcmtk/dcmsr/dsrcodtn.h new file mode 100644 index 00000000..a7f8cadb --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcodtn.h @@ -0,0 +1,174 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCodeTreeNode + * + */ + + +#ifndef DSRCODTN_H +#define DSRCODTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item CODE + */ +class DCMTK_DCMSR_EXPORT DSRCodeTreeNode + : public DSRDocumentTreeNode, + public DSRCodedEntryValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRCodeTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRCodeTreeNode(const DSRCodeTreeNode &node); + + /** destructor + */ + virtual ~DSRCodeTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRCodeTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes and the concept name are valid. + * This check includes the value of the content item, which can also be checked separately + * with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the coded entry value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: has concept mod CODE:(,,"Code")=(1234,99_OFFIS_DCMTK, + * "Code Meaning"). Also see DSRCodedEntryValue::print() method for some more details. + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRCodeTreeNode(); + DSRCodeTreeNode &operator=(const DSRCodeTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcodvl.h b/dcmsr/include/dcmtk/dcmsr/dsrcodvl.h new file mode 100644 index 00000000..347e8e27 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcodvl.h @@ -0,0 +1,753 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRBasicCodedEntry, DSRCodedEntryValue + * + */ + + +#ifndef DSRCODVL_H +#define DSRCODVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" + +#include "dcmtk/ofstd/ofexbl.h" + + +/*----------------------* + * class declarations * + *----------------------*/ + +/** Class for storing the "Basic Coded Entry Attributes". + * This class should be used to define code constants since it is a lightweight structure + * that does not carry any overhead and also does not perform any unnecessary checks on the + * data passed to it. Furthermore, the individual values cannot be modified after an instance + * of this class has been constructed. Therefore, the members can be accessed publicly. + */ +class DCMTK_DCMSR_EXPORT DSRBasicCodedEntry +{ + public: + + /** constructor. + * To be used when the code to be set consists of three values (code value, coding scheme + * designator and code meaning). + ** @param codeValue identifier of the code to be set that is unambiguous + * within the coding scheme. (VR=SH/UC/UR, mandatory) + * @param codingSchemeDesignator identifier of the coding scheme in which the code for + * a term is defined. (VR=SH, conditional) + * @param codeMeaning human-readable translation of the 'codeValue'. Can be + * used for display when code dictionary is not available. + * (VR=LO, mandatory) + * @param codeValueType type of 'codeValue' (short, long or URN) used to map + * the value to the correct DICOM value representation + * (VR). The default value is the one most often used + * (DSRTypes::CVT_Short). + */ + DSRBasicCodedEntry(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType = DSRTypes::CVT_Short); + + /** constructor. + * To be used when the code to be set consists of four values (code value, coding scheme + * designator, coding scheme version and code meaning). + ** @param codeValue identifier of the code to be set that is unambiguous + * within the coding scheme. (VR=SH/UC/UR, mandatory) + * @param codingSchemeDesignator identifier of the coding scheme in which the code for + * a term is defined. (VR=SH, conditional) + * @param codingSchemeVersion version of the coding scheme. May be used to identify + * the version of a coding scheme if necessary to resolve + * ambiguity in the 'codeValue' or 'codeMeaning'. (VR=SH, + * optional) + * @param codeMeaning human-readable translation of the 'codeValue'. Can be + * used for display when code dictionary is not available. + * (VR=LO, mandatory) + * @param codeValueType type of 'codeValue' (short, long or URN) used to map + * the value to the correct DICOM value representation + * (VR). The default value is the one most often used + * (DSRTypes::CVT_Short). + */ + DSRBasicCodedEntry(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType = DSRTypes::CVT_Short); + + // --- public but constant members + + /// type of 'CodeValue': short (SH), long (UC) or Uniform Resource Name (UR) + const DSRTypes::E_CodeValueType CodeValueType; + /// Code Value (VR=SH/UC/UR, type 1) + const OFString CodeValue; + /// Coding Scheme Designator (VR=SH, type 1C) + const OFString CodingSchemeDesignator; + /// Coding Scheme Version (VR=SH, type 1C) + const OFString CodingSchemeVersion; + /// Code Meaning (VR=LO, type 1) + const OFString CodeMeaning; +}; + + +/** Class for handling coded entry values, i.e.\ unambiguous machine-readable codes. + * This class supports both the "Basic Coded Entry Attributes" and the "Enhanced Encoding + * Mode". There are also some basic checks that make sure that a given code is valid. + */ +class DCMTK_DCMSR_EXPORT DSRCodedEntryValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRCodedEntryValue(); + + /** constructor. + * To be used for code constants defined by an instance of the DSRBasicCodedEntry class. + ** @param basicCodedEntry code to be set, defined by its "Basic Coded Entry Attributes" + * @param check if enabled, check code for validity before setting it. + * See checkCode() for details. Empty values are never accepted. + */ + DSRCodedEntryValue(const DSRBasicCodedEntry &basicCodedEntry, + const OFBool check = OFFalse); + + /** constructor. + * To be used when the code to be set consists of three values (code value, coding scheme + * designator and code meaning). + ** @param codeValue identifier of the code to be set that is unambiguous + * within the coding scheme. (VR=SH/UC/UR, mandatory) + * @param codingSchemeDesignator identifier of the coding scheme in which the code for + * a term is defined. (VR=SH, conditional) + * @param codeMeaning human-readable translation of the 'codeValue'. Can be + * used for display when code dictionary is not available. + * (VR=LO, mandatory) + * @param codeValueType type of 'codeValue' (short, long or URN) used to map + * the value to the correct DICOM value representation + * (VR). By default, the type is determined automatically + * (see determineCodeValueType()). + * @param check if enabled, check code for validity before setting it. + * See checkCode() for details. Empty values are never + * accepted. + */ + DSRCodedEntryValue(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType = DSRTypes::CVT_auto, + const OFExplicitBool check = OFTrue); + + /** constructor. + * To be used when the code to be set consists of four values (code value, coding scheme + * designator, coding scheme version and code meaning). + ** @param codeValue identifier of the code to be set that is unambiguous + * within the coding scheme. (VR=SH/UC/UR, mandatory) + * @param codingSchemeDesignator identifier of the coding scheme in which the code for + * a term is defined. (VR=SH, conditional) + * @param codingSchemeVersion version of the coding scheme. May be used to identify + * the version of a coding scheme if necessary to resolve + * ambiguity in the 'codeValue' or 'codeMeaning'. (VR=SH, + * optional) + * @param codeMeaning human-readable translation of the 'codeValue'. Can be + * used for display when code dictionary is not available. + * (VR=LO, mandatory) + * @param codeValueType type of 'codeValue' (short, long or URN) used to map + * the value to the correct DICOM value representation + * (VR). By default, the type is determined automatically + * (see determineCodeValueType()). + * @param check if enabled, check code for validity before setting it. + * See checkCode() for details. Empty values are only + * accepted for non-mandatory attributes. + */ + DSRCodedEntryValue(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType = DSRTypes::CVT_auto, + const OFBool check = OFTrue); + + /** copy constructor + ** @param codedEntryValue code to be copied (not checked !) + */ + DSRCodedEntryValue(const DSRCodedEntryValue &codedEntryValue); + + /** destructor + */ + virtual ~DSRCodedEntryValue(); + + /** assignment operator + ** @param codedEntryValue code to be copied (not checked !) + ** @return reference to this code after 'codedEntryValue' has been copied + */ + DSRCodedEntryValue &operator=(const DSRCodedEntryValue &codedEntryValue); + + /** comparison operator "equal". + * Two codes are equal if the code value, the coding scheme designator and the (optional) + * coding scheme version are equal. The code meaning or attributes from the "Enhanced + * Encoding Mode" are not used for this check. + ** @param codedEntryValue code that should be compared to the current one + ** @return OFTrue if both codes are equal, OFFalse otherwise + */ + OFBool operator==(const DSRCodedEntryValue &codedEntryValue) const; + + /** comparison operator "not equal". + * Two codes are not equal if either the code value or the coding scheme designator + * or the (optional) coding scheme version are not equal. The code meaning is not + * used for this check. + ** @param codedEntryValue code that should be compared to the current one + ** @return OFTrue if both codes are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRCodedEntryValue &codedEntryValue) const; + + /** comparison operator "equal". + * Two codes are equal if the code value, the coding scheme designator and the (optional) + * coding scheme version are equal. The code meaning is not used for this check. + ** @param basicCodedEntry code that should be compared to the current one + ** @return OFTrue if both codes are equal, OFFalse otherwise + */ + OFBool operator==(const DSRBasicCodedEntry &basicCodedEntry) const; + + /** comparison operator "not equal". + * Two codes are not equal if either the code value or the coding scheme designator + * or the (optional) coding scheme version are not equal. The code meaning is not + * used for this check. + ** @param basicCodedEntry code that should be compared to the current one + ** @return OFTrue if both codes are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRBasicCodedEntry &basicCodedEntry) const; + + /** clear all internal variables. + * Since an empty code is invalid the code becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the current code is valid. This check only covers the "Basic Coded Entry + * Attributes". An empty code is not valid. See checkCode() for details. + ** @return OFTrue if code is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the current code is empty, i.e.\ whether all four components of the code + * ("Basic Coded Entry Attributes") are empty. + ** @return OFTrue if code is empty, OFFalse otherwise + */ + virtual OFBool isEmpty() const; + + /** check whether the current code is complete, i.e.\ whether the three (two for URN code + * value) mandatory components of the code are non-empty. This is just a basic check + * that might be useful for "validating" input data. See isValid() for a more + * sophisticated way of checking the current code. + ** @return OFTrue if code is complete, OFFalse otherwise + */ + virtual OFBool isComplete() const; + + /** print code. + * The output of a typical code triple looks like this: (1234,99_OFFIS_DCMTK,"Code + * Meaning"). The optional coding scheme version is printed in square brackets directly + * after the coding scheme designator, e.g.: (cm,UCUM[1.4],"centimeter"). + * Please note that only the "Basic Coded Entry Attributes" are supported by this method. + ** @param stream output stream to which the code should be printed + * @param printCodeValue flag indicating whether the code value and coding scheme + * designator should be printed (default) or not. If OFFalse, + * the output looks like this: (,,"Code Meaning") + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + */ + void print(STD_NAMESPACE ostream &stream, + const OFBool printCodeValue = OFTrue, + const size_t flags = 0) const; + + /** read code sequence from dataset. + * The number of items within the code sequence is checked. If error/warning output are + * enabled, a warning message is printed if the sequence is empty or contains more items + * than specified in the 'vm ' parameter (1 by default, which applies to most use cases). + * However, this method always reads the first item from the given sequence. If another + * item should be read (e.g. a modifier), the method readSequenceItem() should be used. + ** @param dataset DICOM dataset from which the code sequence should be read + * @param tagKey DICOM tag specifying the attribute (= sequence) that should be read + * @param type value type of the sequence (valid value: "1", "2", something else). + * This parameter is used for checking purpose, any difference is + * reported. + * @param flags optional flag used to customize the reading process (see + * DSRTypes::RF_xxx) + * @param vm value multiplicity to be checked, interpreted as cardinality (number + * of items). See DcmElement::checkVM() for a list of valid values. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readSequence(DcmItem &dataset, + const DcmTagKey &tagKey, + const OFString &type, + const size_t flags = 0, + const OFString &vm = "1"); + + /** read code from sequence item + ** @param item DICOM sequence item from which the code should be read + * @param tagKey DICOM tag specifying the sequence in which this item is contained + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readSequenceItem(DcmItem &item, + const DcmTagKey &tagKey, + const size_t flags = 0); + + /** write code sequence to dataset + ** @param dataset DICOM dataset to which the code sequence should be written + * @param tagKey DICOM tag specifying the attribute (= sequence) that should be + * written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeSequence(DcmItem &dataset, + const DcmTagKey &tagKey) const; + + /** write code to sequence item + ** @param item DICOM sequence item to which the code should be written + * @param tagKey DICOM tag specifying the sequence in which this item is contained + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeSequenceItem(DcmItem &item, + const DcmTagKey &tagKey) const; + + /** read code from XML document. + * Please note that only the "Basic Coded Entry Attributes" are supported by this method. + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write code in XML format. + * Please note that only the "Basic Coded Entry Attributes" are supported by this method. + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render code in HTML/XHTML format. + * Please note that only the "Basic Coded Entry Attributes" are supported by this method. + ** @param stream output stream to which the HTML/XHTML document is written + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + * @param fullCode optional flag indicating whether to render the full code tuple + * or the code value/meaning only + * @param valueFirst optional flag indicating whether to render the code value or + * meaning first (outside the brackets) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition renderHTML(STD_NAMESPACE ostream &stream, + const size_t flags, + const OFBool fullCode = OFTrue, + const OFBool valueFirst = OFFalse) const; + + /** get reference to the code + ** @return reference to the code + */ + inline const DSRCodedEntryValue &getValue() const + { + return *this; + } + + /** get copy of the code + ** @param codedEntryValue reference to variable in which the code should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValue(DSRCodedEntryValue &codedEntryValue) const; + + /** get code value. + * This is an identifier of the code that is unambiguous within the coding scheme. + ** @return current code value (might be invalid or an empty string) + */ + inline const OFString &getCodeValue() const + { + return CodeValue; + } + + /** get type of code value, i.e.\ short, long or Uniform Resource Name (URN). + * The type is used to map the value to the correct DICOM value representation (VR). + ** @return type of code value. Should never be DSRTypes::CVT_auto for non-empty value. + */ + inline DSRTypes::E_CodeValueType getCodeValueType() const + { + return CodeValueType; + } + + /** get coding scheme designator. + * This is an identifier of the coding scheme in which the code for a term is defined. + * Designators beginning with "99" and the designator "L" are defined to be private or + * local coding schemes. More details on the coding scheme might be retrieved via the + * DSRDocument::getCodingSchemeIdentification() method. + ** @return current coding scheme designator (might be invalid or an empty string) + */ + inline const OFString &getCodingSchemeDesignator() const + { + return CodingSchemeDesignator; + } + + /** get coding scheme version. + * Optional - May be used to identify the version of a coding scheme if necessary to + * resolve ambiguity in the code value or code meaning. Coding scheme version is not + * required for backward-compatible revisions of a coding scheme. + ** @return current coding scheme version (might be invalid or an empty string) + */ + inline const OFString &getCodingSchemeVersion() const + { + return CodingSchemeVersion; + } + + /** get code meaning. + * Human-readable translation of the code value. Can be used for display when code + * dictionary is not available. + ** @return current code meaning (might be invalid or an empty string) + */ + inline const OFString &getCodeMeaning() const + { + return CodeMeaning; + } + + /** get context identifier. + * Optional - Identifier of the context group defined by a mapping resource from which + * the code was selected, or to which the code has been added as a private context group + * extension. This attribute is part of the "Enhanced Encoding Mode". + ** @return current context identifier (might be invalid or an empty string) + */ + inline const OFString &getContextIdentifier() const + { + return ContextIdentifier; + } + + /** get context UID. + * Optional - Uniquely identifies the context group. This attribute is part of the + * "Enhanced Encoding Mode". + ** @return current context UID (might be invalid or an empty string) + */ + inline const OFString &getContextUID() const + { + return ContextUID; + } + + /** get mapping resource. + * Optional - Message/Terminology mapping resource that specifies the context group with + * the given identifier. This attribute is part of the "Enhanced Encoding Mode". + ** @return current mapping resource (might be invalid or an empty string) + */ + inline const OFString &getMappingResource() const + { + return MappingResource; + } + + /** get context group version. + * Optional - Version of the context group. This attribute is part of the "Enhanced + * Encoding Mode". + ** @return current context group version (might be invalid or an empty string) + */ + inline const OFString &getContextGroupVersion() const + { + return ContextGroupVersion; + } + + /** get context group local version. + * Optional - Implementation-specific version of a context group that contains private + * extensions. This attribute is part of the "Enhanced Encoding Mode". + ** @return current context group local version (might be invalid or an empty string) + */ + inline const OFString &getContextGroupLocalVersion() const + { + return ContextGroupLocalVersion; + } + + /** get context group extension creator UID. + * Optional - Identifies the person or organization who created the extension to the + * context group. This attribute is part of the "Enhanced Encoding Mode". + ** @return current context group extension creator UID (might be invalid or an empty + * string) + */ + inline const OFString &getContextGroupExtensionCreatorUID() const + { + return ContextGroupExtensionCreatorUID; + } + + /** set code. + * Before setting the code, it is usually checked. If the code is invalid, the current + * code is not replaced and remains unchanged. + ** @param codedEntryValue code to be set + * @param check if enabled, check code for validity before setting it. + * See checkCode() for details. Empty values are only accepted + * for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRCodedEntryValue &codedEntryValue, + const OFBool check = OFTrue); + + /** set code. + * To be used for code constants defined by an instance of the DSRBasicCodedEntry class. + ** @param basicCodedEntry code to be set, defined by its "Basic Coded Entry Attributes" + * @param check if enabled, check code for validity before setting it. + * See checkCode() for details. Empty values are never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCode(const DSRBasicCodedEntry &basicCodedEntry, + const OFBool check = OFFalse); + + /** set code. + * To be used when the code to be set consists of three values (code value, coding scheme + * designator and code meaning). The attributes from the "Enhanced Encoding Mode" are set + * by one of the setEnhancedEncodingMode() methods. + * Before setting the code, it is usually checked. If the code is invalid, the current + * code is not replaced and remains unchanged. Additional information on the coding + * scheme can be provided via the DSRDocument::getCodingSchemeIdentification() method + * (highly recommended for private coding schemes). + ** @param codeValue identifier of the code to be set that is unambiguous + * within the coding scheme. (VR=SH/UC/UR, mandatory) + * @param codingSchemeDesignator identifier of the coding scheme in which the code for + * a term is defined. (VR=SH, conditional) + * Designators beginning with "99" and the designator + * "L" are defined to be private or local coding schemes. + * @param codeMeaning human-readable translation of the 'codeValue'. Can be + * used for display when code dictionary is not available. + * (VR=LO, mandatory) + * @param codeValueType type of 'codeValue' (short, long or URN) used to map + * the value to the correct DICOM value representation + * (VR). By default, the type is determined automatically + * (see determineCodeValueType()). + * @param check if enabled, check code for validity before setting it. + * See checkCode() for details. Empty values are only + * accepted for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCode(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType = DSRTypes::CVT_auto, + const OFExplicitBool check = OFTrue); + + /** set code. + * To be used when the code to be set consists of four values (code value, coding scheme + * designator, coding scheme version and code meaning). The attributes from the "Enhanced + * Encoding Mode" are set by one of the setEnhancedEncodingMode() methods. + * Before setting the code, it is usually checked. If the code is invalid, the current + * code is not replaced and remains unchanged. Additional information on the coding + * scheme can be provided via the DSRDocument::getCodingSchemeIdentification() method + * (highly recommended for private coding schemes). + ** @param codeValue identifier of the code to be set that is unambiguous + * within the coding scheme. (VR=SH, mandatory) + * @param codingSchemeDesignator identifier of the coding scheme in which the code for + * a term is defined. (VR=SH, conditional) + * Designators beginning with "99" and the designator + * "L" are defined to be private or local coding schemes. + * @param codingSchemeVersion version of the coding scheme. May be used to identify + * the version of a coding scheme if necessary to resolve + * ambiguity in the 'codeValue' or 'codeMeaning. (VR=SH, + * optional) + * @param codeMeaning human-readable translation of the 'codeValue'. Can be + * used for display when code dictionary is not available. + * (VR=LO, mandatory) + * @param codeValueType type of 'codeValue' (short, long or URN) used to map + * the value to the correct DICOM value representation + * (VR). By default, the type is determined automatically + * (see determineCodeValueType()). + * @param check if enabled, check code for validity before setting it. + * See checkCode() for details. Empty values are only + * accepted for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCode(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType = DSRTypes::CVT_auto, + const OFBool check = OFTrue); + + /** check whether the "Enhanced Encoding Mode" is used for this code. + * Currently, the only check that is performed is that either the context identifier or + * the context UID have a non-empty value. + ** @return OFTrue if the "Enhanced Encoding Mode" is used, OFFalse otherwise + */ + OFBool usesEnhancedEncodingMode() const; + + /** remove the "Enhanced Encoding Mode" from this code. + * Internally, all elements that belong to this mode are cleared. + */ + void removeEnhancedEncodingMode(); + + /** specify the "Enhanced Encoding Mode" for this code. + * This method should be used for private context groups, which are not identified by a + * context identifier and mapping resource. + ** @param contextUID uniquely identifies the context group. (VR=UI, mandatory) + * @param check if enabled, the given value is checked for validity (conformance + * with corresponding VR and VM) before setting it. An empty value + * is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEnhancedEncodingMode(const OFString &contextUID, + const OFBool check = OFTrue); + + /** specify the "Enhanced Encoding Mode" for this code. + * This method should be used for codes from or extensions to non-private context groups, + * e.g. from the DICOM Content Mapping Resource (DCMR). + ** @param contextIdentifier identifier of the context group defined by + * 'mappingResource' from which the code was selected, or to + * which the code has been added as a private context group + * extension. (VR=CS, mandatory) + * @param mappingResource message/terminology mapping resource that specifies the + * context group with the given identifier. (VR=CS, + * mandatory) + * @param contextGroupVersion version of the context group. (VR=DT, mandatory) + * @param contextUID uniquely identifies the context group. (VR=UI, optional) + * @param localVersion implementation-specific version of a context group that + * contains private extensions. (VR=DT, conditional) + * @param extensionCreatorUID identifies the person or organization who created the + * extension to the context group. (VR=UI, conditional) + * Should be specified if 'localVersion' is non-empty. + * @param check if enabled, the given values are checked for validity + * (conformance with corresponding VR and VM) before setting + * them. Empty values are only accepted for non-mandatory + * attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEnhancedEncodingMode(const OFString &contextIdentifier, + const OFString &mappingResource, + const OFString &contextGroupVersion, + const OFString &contextUID = "", + const OFString &localVersion = "", + const OFString &extensionCreatorUID = "", + const OFBool check = OFTrue); + + /** check the currently stored code for validity. + * See below checkCode() method for details. + ** @return status, EC_Normal if current value is valid, an error code otherwise + */ + OFCondition checkCurrentValue() const; + + + protected: + + /** get pointer to this code + ** @return pointer to this code (never NULL) + */ + inline DSRCodedEntryValue *getValuePtr() + { + return this; + } + + /** read code from dataset. + * This method also supports the attributes from the "Enhanced Encoding Mode". + ** @param dataset DICOM dataset from which the code should be read + * @param moduleName module name (sequence) from which the item is read. If NULL, + * the default value "SR document" is used for output messages. + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readItem(DcmItem &dataset, + const char *moduleName, + const size_t flags); + + /** write code to dataset. + * This method also supports the attributes from the "Enhanced Encoding Mode". + ** @param dataset DICOM dataset to which the code should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeItem(DcmItem &dataset) const; + + // --- static helper functions --- + + /** check the specified code for validity. + * Currently, the only checks performed are that the three (two for URN code value) + * mandatory string values are non-empty and that all four values conform to the + * corresponding VR and VM. Later on, it might also be checked whether the specified + * code really belongs to the coding + * scheme, etc. This requires the presence of the relevant code dictionaries, though. + ** @param codeValue code value to be checked + * @param codingSchemeDesignator coding scheme designator to be checked + * @param codingSchemeVersion coding scheme version to be checked (might be empty) + * @param codeMeaning code meaning to be checked + * @param codeValueType type of 'codeValue' (short, long or URN). + * Never use DSRTypes::CVT_auto for this function. + ** @return status, EC_Normal if code is valid, an error code otherwise + */ + static OFCondition checkCode(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType); + + /** try to determine the type of the given code value. + * Please note that the check that is currently performed is very simple. So, the user + * is advised to passed the correct type (short, long or URN) to the appropriate method + * and should not rely on this automatic detection. Specifically, URN values are only + * detected by the prefix "urn:" or by the substring "://". The maximum length of a + * short code value is determined based on the number of bytes (not characters, since + * the character set is unknown to this function - and to this class). + ** @param codeValue code value to be checked + ** @return automatically determined type that should be used for the given code value + */ + static DSRTypes::E_CodeValueType determineCodeValueType(const OFString &codeValue); + + + private: + + // -- Basic Coded Entry Attributes -- + + /// type of 'CodeValue': short (SH), long (UC) or Uniform Resource Name (UR) + DSRTypes::E_CodeValueType CodeValueType; + /// Code Value (VR=SH/UC/UR, type 1) + OFString CodeValue; + /// Coding Scheme Designator (VR=SH, type 1C) + OFString CodingSchemeDesignator; + /// Coding Scheme Version (VR=SH, type 1C) + OFString CodingSchemeVersion; + /// Code Meaning (VR=LO, type 1) + OFString CodeMeaning; + + /// tbd: Equivalent Code Sequence (VR=SQ, type 3) not yet supported + + // -- Enhanced Encoding Mode -- + + /// Context Identifier (VR=CS, type 3) + OFString ContextIdentifier; + /// Context UID (VR=UI, type 2) + OFString ContextUID; + /// Mapping Resource (VR=CS, type 1C) + OFString MappingResource; + /// Mapping Resource UID (VR=UI, type 3) + // - tbd: optional attribute not yet supported + /// Mapping Resource Name (VR=LO, type 3) + // - tbd: optional attribute not yet supported + /// Context Group Version (VR=DT, type 1C) + OFString ContextGroupVersion; + /// Context Group Local Version (VR=DT, type 1C) + OFString ContextGroupLocalVersion; + /// Context Group Extension Creator UID (VR=UI, type 1C) + OFString ContextGroupExtensionCreatorUID; +}; + + +/** output stream operator for coded entry values. + * Internally, the DSRCodedEntryValue::print() method is used, i.e. the output looks + * like this: (1234,99_OFFIS_DCMTK,"Code Meaning") or (cm,UCUM[1.4],"centimeter") + * @param stream output stream to which the coded entry value is printed + * @param codedEntryValue coded entry value to be printed + * @return reference to output stream + */ +DCMTK_DCMSR_EXPORT STD_NAMESPACE ostream &operator<<(STD_NAMESPACE ostream &stream, + const DSRCodedEntryValue& codedEntryValue); + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcolcc.h b/dcmsr/include/dcmtk/dcmsr/dsrcolcc.h new file mode 100644 index 00000000..7daa2424 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcolcc.h @@ -0,0 +1,93 @@ +/* + * + * Copyright (C) 2010-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRColonCadSRConstraintChecker + * + */ + + +#ifndef DSRCOLCC_H +#define DSRCOLCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Colon CAD SR IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 4120 + * (Colon CAD Document Root) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRColonCadSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRColonCadSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRColonCadSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFTrue, i.e. by-reference relationships are allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_ColonCadSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcomcc.h b/dcmsr/include/dcmtk/dcmsr/dsrcomcc.h new file mode 100644 index 00000000..d35a8ca1 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcomcc.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRComprehensiveSRConstraintChecker + * + */ + + +#ifndef DSRCOMCC_H +#define DSRCOMCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Comprehensive SR IOD + */ +class DCMTK_DCMSR_EXPORT DSRComprehensiveSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRComprehensiveSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRComprehensiveSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFTrue, i.e. by-reference relationships are allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_ComprehensiveSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcomtn.h b/dcmsr/include/dcmtk/dcmsr/dsrcomtn.h new file mode 100644 index 00000000..8a354172 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcomtn.h @@ -0,0 +1,172 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCompositeTreeNode + * + */ + + +#ifndef DSRCOMTN_H +#define DSRCOMTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrcomvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item COMPOSITE + */ +class DCMTK_DCMSR_EXPORT DSRCompositeTreeNode + : public DSRDocumentTreeNode, + public DSRCompositeReferenceValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRCompositeTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRCompositeTreeNode(const DSRCompositeTreeNode &node); + + /** destructor + */ + virtual ~DSRCompositeTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRCompositeTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes are valid. This check includes the value + * of the content item, which can also be checked separately with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the composite reference value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: contains COMPOSITE:=(BasicTextSR,"1.2.3") + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRCompositeTreeNode(); + DSRCompositeTreeNode &operator=(const DSRCompositeTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcomvl.h b/dcmsr/include/dcmtk/dcmsr/dsrcomvl.h new file mode 100644 index 00000000..59d1de5a --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcomvl.h @@ -0,0 +1,393 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCompositeReferenceValue + * + */ + + +#ifndef DSRCOMVL_H +#define DSRCOMVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for composite reference values + */ +class DCMTK_DCMSR_EXPORT DSRCompositeReferenceValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRCompositeReferenceValue(); + + /** constructor + ** @param sopClassUID referenced SOP class UID of the composite object. + * (VR=UI, mandatory) + * @param sopInstanceUID referenced SOP instance UID of the composite object. + * (VR=UI, mandatory) + * @param check if enabled, check 'sopClassUID' and 'sopInstanceUID' for + * validity before setting them. See checkXXX() for details. + * Empty values are never accepted. + */ + DSRCompositeReferenceValue(const OFString &sopClassUID, + const OFString &sopInstanceUID, + const OFBool check = OFTrue); + + /** copy constructor + ** @param referenceValue reference value to be copied (not checked !) + */ + DSRCompositeReferenceValue(const DSRCompositeReferenceValue &referenceValue); + + /** destructor + */ + virtual ~DSRCompositeReferenceValue(); + + /** assignment operator + ** @param referenceValue reference value to be copied (not checked !) + ** @return reference to this reference value after 'referenceValue' has been copied + */ + DSRCompositeReferenceValue &operator=(const DSRCompositeReferenceValue &referenceValue); + + /** comparison operator "equal" + ** @param referenceValue reference value that should be compared to the current one + ** @return OFTrue if both composite reference values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRCompositeReferenceValue &referenceValue) const; + + /** comparison operator "not equal" + ** @param referenceValue reference value that should be compared to the current one + ** @return OFTrue if both composite reference values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRCompositeReferenceValue &referenceValue) const; + + /** clear all internal variables. + * Since an empty reference value is invalid the reference becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the current reference value is valid. + * The reference value is valid if SOP class UID and SOP instance UID are valid. See + * checkSOPClassUID() and checkSOPInstanceUID() methods for details. + ** @return OFTrue if reference value is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the current reference value is empty. + * Checks whether both mandatory UIDs of the reference value are empty. + ** @return OFTrue if value is empty, OFFalse otherwise + */ + virtual OFBool isEmpty() const; + + /** check whether the current reference value is complete, i.e.\ whether both + * mandatory UIDs are non-empty. This is just a basic check that might be useful + * for "validating" input data. See isValid() for a more sophisticated way of + * checking the current reference value. + ** @return OFTrue if value is complete, OFFalse otherwise + */ + virtual OFBool isComplete() const; + + /** print reference value. + * The output of a typical composite reference value looks like this: (BasicTextSR,"1.2.3"). + * If the SOP class UID is unknown, the UID is printed instead of the related name. + ** @param stream output stream to which the reference value should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read reference value from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write reference value in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read referenced SOP sequence from dataset. + * The number of items within the sequence is checked. If error/warning output are + * enabled, a warning message is printed if the sequence is absent or contains more than + * one item. + ** @param dataset DICOM dataset from which the sequence should be read + * @param tagKey DICOM tag specifying the attribute (= sequence) that should be read + * @param type value type of the sequence (valid value: "1", "2", something else) + * This parameter is used for checking purpose, any difference is reported. + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSequence(DcmItem &dataset, + const DcmTagKey &tagKey, + const OFString &type, + const size_t flags); + + /** write referenced SOP sequence to dataset. + * If the value is empty an empty sequence (without any items) is written. + ** @param dataset DICOM dataset to which the sequence should be written + * @param tagKey DICOM tag specifying the attribute (= sequence) that should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSequence(DcmItem &dataset, + const DcmTagKey &tagKey) const; + + /** render composite reference value in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + size_t &annexNumber, + const size_t flags) const; + + /** get SOP class UID + ** @return current SOP class UID (might be invalid or an empty string) + */ + inline const OFString &getSOPClassUID() const + { + return SOPClassUID; + } + + /** get name associated with the SOP class UID (if any) + ** @param defaultName string value that is returned if the SOP class UID is unknown + ** @return name associated with the current SOP class UID (might be empty, e.g. in case + * the SOP class UID is empty or 'defaultName' is an empty string) + */ + const OFString getSOPClassName(const OFString &defaultName = "unknown SOP Class UID") const; + + /** get SOP instance UID + ** @return current SOP instance UID (might be invalid or an empty string) + */ + inline const OFString &getSOPInstanceUID() const + { + return SOPInstanceUID; + } + + /** get reference to composite reference value + ** @return reference to composite reference value + */ + inline const DSRCompositeReferenceValue &getValue() const + { + return *this; + } + + /** get copy of composite reference value + ** @param referenceValue reference to variable in which the value should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValue(DSRCompositeReferenceValue &referenceValue) const; + + /** set composite reference value. + * Before setting the reference, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param referenceValue value to be set + * @param check if enabled, check value for validity before setting it. + * See checkXXX() for details. Empty values are never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRCompositeReferenceValue &referenceValue, + const OFBool check = OFTrue); + + /** set SOP class UID and SOP instance UID value. + * Before setting the values, they are usually checked. If the value pair is invalid + * the current value pair is not replaced and remains unchanged. + ** @param sopClassUID referenced SOP class UID to be set. (VR=UI, mandatory) + * @param sopInstanceUID referenced SOP instance UID to be set. (VR=UI, mandatory) + * @param check if enabled, check 'sopClassUID' and 'sopInstanceUID' for + * validity before setting them. See checkXXX() for details. + * Empty values are never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReference(const OFString &sopClassUID, + const OFString &sopInstanceUID, + const OFBool check = OFTrue); + + /** set SOP class UID and SOP instance UID value from dataset. + * Internally, the methods setSOPClassUID() and setSOPInstanceUID() are called with the + * given 'dataset' and the tags DCM_SOPClassUID and DCM_SOPInstanceUID, respectively. + * I.e., the SOP class UID might be set even if the SOP instance UID value is invalid. + ** @param dataset DICOM dataset from which the UID values should be retrieved + * @param check if enabled, check retrieved UID values for validity before setting + * them. See checkXXX() for details. Empty values are never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setReference(DcmItem &dataset, + const OFBool check = OFTrue); + + /** set SOP class UID value. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. + ** @param sopClassUID SOP class UID to be set + * @param check if enabled, check 'sopClassUID' for validity before setting it. + * See checkSOPClassUID() for details. Am empty value is never + * accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSOPClassUID(const OFString &sopClassUID, + const OFBool check = OFTrue); + + /** set SOP class UID value from element. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. + ** @param delem DICOM element from which the UID value should be retrieved + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check UID value for validity before setting it. See + * checkSOPClassUID() for details. An empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSOPClassUID(const DcmElement &delem, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set SOP class UID value from dataset. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. + ** @param dataset DICOM dataset from which the UID value should be retrieved + * @param tagKey DICOM tag specifying the attribute from which the value should be + * retrieved. The search is limited to the top-level of the dataset. + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check UID value for validity before setting it. See + * checkSOPClassUID() for details. An empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSOPClassUID(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set SOP instance UID value. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. + ** @param sopInstanceUID SOP instance UID to be set + * @param check if enabled, check 'sopInstanceUID' for validity before setting + * it. See checkSOPInstanceUID() for details. An empty value is + * never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSOPInstanceUID(const OFString &sopInstanceUID, + const OFBool check = OFTrue); + + /** set SOP instance UID value from element. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. + ** @param delem DICOM element from which the UID value should be retrieved + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check UID value for validity before setting it. See + * checkSOPInstanceUID() for details. An empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSOPInstanceUID(const DcmElement &delem, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set SOP instance UID value from dataset. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. + ** @param dataset DICOM dataset from which the UID value should be retrieved + * @param tagKey DICOM tag specifying the attribute from which the value should be + * retrieved. The search is limited to the top-level of the dataset. + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check UID value for validity before setting it. See + * checkSOPInstanceUID() for details. An empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSOPInstanceUID(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + + protected: + + /** get pointer to reference value + ** @return pointer to reference value (never NULL) + */ + inline DSRCompositeReferenceValue *getValuePtr() + { + return this; + } + + /** read reference value from dataset + ** @param dataset DICOM dataset from which the value should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readItem(DcmItem &dataset, + const size_t flags); + + /** write reference value to dataset + ** @param dataset DICOM dataset to which the value should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeItem(DcmItem &dataset) const; + + /** check the specified SOP class UID for validity. + * The only checks performed are that the UID is non-empty and that it conforms to the + * corresponding VR (UI) and VM (1). Derived classes should overwrite this method for + * more specific tests (e.g. allowing only particular SOP classes). + ** @param sopClassUID SOP class UID to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkSOPClassUID(const OFString &sopClassUID) const; + + /** check the specified SOP instance UID for validity. + * The only checks performed are that the UID is non-empty and that it conforms to the + * corresponding VR (UI) and VM (1). Derived classes should overwrite this method for + * more specific tests. + * @param sopInstanceUID SOP instance UID to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkSOPInstanceUID(const OFString &sopInstanceUID) const; + + /** check the currently stored reference value for validity. + * See above checkXXX() methods for details. + ** @return status, EC_Normal if current value is valid, an error code otherwise + */ + OFCondition checkCurrentValue() const; + + /// reference SOP class UID (VR=UI, type 1) + OFString SOPClassUID; + /// reference SOP instance UID (VR=UI, type 1) + OFString SOPInstanceUID; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcontn.h b/dcmsr/include/dcmtk/dcmsr/dsrcontn.h new file mode 100644 index 00000000..8314c376 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcontn.h @@ -0,0 +1,225 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRContainerTreeNode + * + */ + + +#ifndef DSRCONTN_H +#define DSRCONTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item CONTAINER + */ +class DCMTK_DCMSR_EXPORT DSRContainerTreeNode + : public DSRDocumentTreeNode +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param continuityOfContent Continuity of content flag (default: separate). + * Should be different from DSRTypes::COC_invalid. + */ + DSRContainerTreeNode(const E_RelationshipType relationshipType, + const E_ContinuityOfContent continuityOfContent = COC_Separate); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRContainerTreeNode(const DSRContainerTreeNode &node); + + /** destructor + */ + virtual ~DSRContainerTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRContainerTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base class is valid, the value is valid (see hasValidValue()), + * and the concept name is valid or the content item is not the root item. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the continuity of content flag, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * A container content item is defined to be never short (return always OFFalse). + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: CONTAINER:(,,"Diagnosis")=SEPARATE for the root node + * and contains CONTAINER:=CONTINUOUS for a "normal" content item. + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render content item in HTML/XHTML format. + * After rendering the current content item all child nodes (if any) are also rendered + * (see renderHTMLChildNodes() for details). This method overwrites the one specified in + * base class DSRDocumentTreeNode since the rendering of the child nodes depends on the + * value of the flag 'ContinuityOfContent'. + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** get continuity of content flag. + * This flag specifies whether or not its contained content items (child nodes) are + * logically linked in a continuous textual flow, or are separate items. + ** @return continuity of content flag if successful, DSRTypes::COC_invalid otherwise + */ + inline E_ContinuityOfContent getContinuityOfContent() const + { + return ContinuityOfContent; + } + + /** set continuity of content flag. + * This flag specifies whether or not its contained content items (child nodes) are + * logically linked in a continuous textual flow, or are separate items. + ** @param continuityOfContent value to be set + * (should be different from DSRTypes::COC_invalid) + * @param check dummy parameter (currently not used) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setContinuityOfContent(const E_ContinuityOfContent continuityOfContent, + const OFBool check = OFTrue); + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + + /// continuity of content flag (associated DICOM VR=CS, mandatory) + E_ContinuityOfContent ContinuityOfContent; + + + // --- declaration of default constructor and assignment operator + + DSRContainerTreeNode(); + DSRContainerTreeNode &operator=(const DSRContainerTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrcsidl.h b/dcmsr/include/dcmtk/dcmsr/dsrcsidl.h new file mode 100644 index 00000000..116fb728 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrcsidl.h @@ -0,0 +1,366 @@ +/* + * + * Copyright (C) 2003-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCodingSchemeIdentificationList + * + */ + + +#ifndef DSRCSIDL_H +#define DSRCSIDL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" + +#include "dcmtk/ofstd/oflist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class that maps Coding Scheme Designators to an external coding + * system registration, or to a private or local coding scheme. + * Implementation of Coding Scheme Identification Sequence. + */ +class DCMTK_DCMSR_EXPORT DSRCodingSchemeIdentificationList + : public DSRTypes +{ + + public: + + /** constructor (default) + */ + DSRCodingSchemeIdentificationList(); + + /** destructor + */ + ~DSRCodingSchemeIdentificationList(); + + /** clear the list + */ + void clear(); + + /** check whether list is empty + ** @return OFTrue if list is empty, OFFalse otherwise + */ + OFBool isEmpty() const; + + /** get number of items stored in the list + ** @return number of items + */ + size_t getNumberOfItems() const; + + /** read list of items from the coding scheme identification sequence + ** @param dataset DICOM dataset from which the data should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of items to the coding scheme identification sequence. + * Does nothing if list is empty. + ** @param dataset DICOM dataset to which the data should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** read list of items from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write current list in XML format + ** @param stream output stream to which the XML data is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** set specific character set, which is used for checking the affected element values. + * Please note that this method does not return an error if the given 'value' is not + * defined by the DICOM standard or not supported by this implementation. + ** @param value value to be set (single or multiple values) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpecificCharacterSet(const OFString &value, + const OFBool check = OFTrue); + + /** add private OFFIS DCMTK coding scheme entry to the list. + * Please note that any information previously stored under the defined coding scheme + * designator "99_OFFIS_DCMTK" is replaced! + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addPrivateDcmtkCodingScheme(); + + /** add the specified coding scheme to the list. + * Internally, the item is inserted into the list of coding scheme designators if + * not already contained in the list. In any case, the specified item is selected as + * the current one. Additional information can be set using the below setXXX() methods. + ** @param codingSchemeDesignator coding scheme designator of the item to be added. + * Designators beginning with "99" and the designator + * "L" are defined to be private or local coding schemes. + * @param check check 'codingSchemeDesignator' for conformance with + * VR (SH) and VM (1) if enabled. An empty value is + * never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &codingSchemeDesignator, + const OFBool check = OFTrue); + + /** add the specified coding scheme (with additional information) to the list. + * Internally, the item is inserted into the list of coding scheme designators if not + * already contained in the list, and the additional information is set. In any case, + * the specified item is selected as the current one. Further information can be set + * using the below setXXX() methods. + * Please note that any information previously stored under the given coding scheme + * designator is replaced! + ** @param codingSchemeDesignator coding scheme designator of the item to be added. + * (VR=SH, mandatory). Designators beginning with "99" + * and the designator "L" are defined to be private or + * local coding schemes. + * @param codingSchemeUID coding scheme UID of the item to be added. (VR=UI, + * conditional) + * @param codingSchemeName coding scheme name of the item to be added. (VR=ST, + * optional) + * @param responsibleOrganization coding scheme responsible organization of the item to + * be added. (VR=ST, optional) + * @param check check given values for conformance with associated VR + * and VM if enabled. An empty 'codingSchemeDesignator' + * is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &codingSchemeDesignator, + const OFString &codingSchemeUID, + const OFString &codingSchemeName, + const OFString &responsibleOrganization = "", + const OFBool check = OFTrue); + + /** remove the current item from the list. + * After successful removal the cursor is set to the next valid position. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(); + + /** remove the specified item from the list. + * After successful removal the cursor is set to the next valid position. + ** @param codingSchemeDesignator coding scheme designator of the item to be removed + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const OFString &codingSchemeDesignator); + + /** select the specified item as the current one + ** @param codingSchemeDesignator coding scheme designator of the item to be selected + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const OFString &codingSchemeDesignator); + + /** select the first item in the list + ** @return status, EC_Normal if successful, an error code otherwise. + * (e.g. if the list is empty) + */ + OFCondition gotoFirstItem(); + + /** select the next item in the list + ** @return status, EC_Normal if successful, an error code otherwise. + * (e.g. if the end of the list has been reached) + */ + OFCondition gotoNextItem(); + + /** get the coding scheme designator of the currently selected item. + * Designators beginning with "99" and the designator "L" are defined to be private + * or local coding schemes. + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty if no item is selected) + */ + const OFString &getCodingSchemeDesignator(OFString &stringValue) const; + + /** get the coding scheme registry of the currently selected item + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getCodingSchemeRegistry(OFString &stringValue) const; + + /** get the coding scheme UID of the currently selected item + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getCodingSchemeUID(OFString &stringValue) const; + + /** get the coding scheme external ID of the currently selected item + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getCodingSchemeExternalID(OFString &stringValue) const; + + /** get the coding scheme name of the currently selected item + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getCodingSchemeName(OFString &stringValue) const; + + /** get the coding scheme version of the currently selected item + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getCodingSchemeVersion(OFString &stringValue) const; + + /** get the coding scheme responsible organization of the currently selected item + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getCodingSchemeResponsibleOrganization(OFString &stringValue) const; + + /** set the coding scheme registry of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeRegistry(const OFString &value, + const OFBool check = OFTrue); + + /** set the coding scheme UID of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeUID(const OFString &value, + const OFBool check = OFTrue); + + /** set the coding scheme external ID of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeExternalID(const OFString &value, + const OFBool check = OFTrue); + + /** set the coding scheme name of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeName(const OFString &value, + const OFBool check = OFTrue); + + /** set the coding scheme version of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeVersion(const OFString &value, + const OFBool check = OFTrue); + + /** set the coding scheme responsible organization of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (ST) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setCodingSchemeResponsibleOrganization(const OFString &value, + const OFBool check = OFTrue); + + + protected: + + /** Internal structure defining the list items + */ + struct DCMTK_DCMSR_EXPORT ItemStruct + { + /** constructor + ** @param codingSchemeDesignator Coding Scheme Designator + */ + ItemStruct(const OFString &codingSchemeDesignator) + : CodingSchemeDesignator(codingSchemeDesignator), + CodingSchemeRegistry(), + CodingSchemeUID(), + CodingSchemeExternalID(), + CodingSchemeName(), + CodingSchemeVersion(), + CodingSchemeResponsibleOrganization() + {} + + /** clear additional information + */ + void clear() + { + CodingSchemeRegistry.clear(); + CodingSchemeUID.clear(); + CodingSchemeExternalID.clear(); + CodingSchemeName.clear(); + CodingSchemeVersion.clear(); + CodingSchemeResponsibleOrganization.clear(); + } + + /// Coding Scheme Designator (VR=SH, type 1) + const OFString CodingSchemeDesignator; + /// Coding Scheme Registry (VR=LO, type 1C) + OFString CodingSchemeRegistry; + /// Coding Scheme UID (VR=UI, type 1C) + OFString CodingSchemeUID; + /// Coding Scheme External ID (VR=ST, type 2C) + OFString CodingSchemeExternalID; + /// Coding Scheme Name (VR=ST, type 3) + OFString CodingSchemeName; + /// Coding Scheme Version (VR=SH, type 3) + OFString CodingSchemeVersion; + /// Coding Scheme Responsible Organization (VR=ST, type 3) + OFString CodingSchemeResponsibleOrganization; + /// Coding Scheme Resources Sequence (VR=SQ, type 3) + // - tbd: optional attribute not yet supported + }; + + /** add the specified coding scheme to the list (if not existent) + ** @param codingSchemeDesignator coding scheme designator of the item to be added + * @param item reference to item pointer (result variable) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &codingSchemeDesignator, + ItemStruct *&item); + + /** get pointer to currently selected item structure (if any) + ** @return pointer to the item structure if successful, NULL otherwise + */ + ItemStruct *getCurrentItem() const; + + + private: + + /// list of items + OFList ItemList; + /// internal cursor to current (selected) list item + OFListIterator(ItemStruct *) Iterator; + /// specific character set used for checking purposes + OFString SpecificCharacterSet; + + // copy constructor - not implemented! + DSRCodingSchemeIdentificationList(const DSRCodingSchemeIdentificationList &); + // assignment operator - not implemented! + DSRCodingSchemeIdentificationList &operator=(const DSRCodingSchemeIdentificationList &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrctpl.h b/dcmsr/include/dcmtk/dcmsr/dsrctpl.h new file mode 100644 index 00000000..be7a741a --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrctpl.h @@ -0,0 +1,238 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTemplateCommon + * + */ + + +#ifndef DSRCTPL_H +#define DSRCTPL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrdncsr.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DSRDocumentSubTree; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class managing common information on an SR template. + * This class is used as a base class only. + */ +class DCMTK_DCMSR_EXPORT DSRTemplateCommon +{ + + public: + + /** clear non-static member variables + */ + virtual void clear(); + + /** check whether template identification is set + ** @return OFTrue if set, OFFalse otherwise + */ + virtual OFBool hasTemplateIdentification() const; + + /** check whether template identification is valid + ** @param check check internally stored values for conformance with VR and VM + * if enabled + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isTemplateIdentificationValid(const OFBool check = OFTrue) const; + + /** check whether template is extensible + ** @return OFTrue if extensible, OFFalse otherwise + */ + virtual OFBool isExtensible() const + { + return ExtensibleMode; + } + + /** check whether the order of content items in this template is significant + ** @return OFTrue if order is significant, OFFalse otherwise + */ + virtual OFBool isOrderSignificant() const + { + return OrderSignificantMode; + } + + /** compare template identification with given values + ** @param templateIdentifier template identifier to compare with + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional). + * Not used for comparison if the value is empty. + ** @result OFTrue if template identification is identical, OFFalse otherwise + */ + virtual OFBool compareTemplateIdentication(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "") const; + + /** get template identifier + ** @return identifier of the template + */ + inline const OFString &getTemplateIdentifier() const + { + return TemplateIdentifier; + } + + /** get mapping resource + ** @return mapping resource that defines the template + */ + inline const OFString &getMappingResource() const + { + return MappingResource; + } + + /** get optional mapping resource UID + ** @return unique identifier of the mapping resource (might be empty) + */ + inline const OFString &getMappingResourceUID() const + { + return MappingResourceUID; + } + + /** change mode specifying whether the template is extensible or non-extensible + ** @param mode set template type to extensible if OFTrue (default) + */ + virtual void setExtensible(const OFBool mode = OFTrue) + { + ExtensibleMode = mode; + } + + /** change mode specifying whether the order of content items in this template is + * significant or non-significant + ** @param mode set order of content items to significant if OFTrue (default) + */ + virtual void setOrderSignificant(const OFBool mode = OFTrue) + { + OrderSignificantMode = mode; + } + + + protected: + + /** constructor + ** @param templateIdentifier identifier of the template + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional) + */ + DSRTemplateCommon(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = ""); + + /** destructor + */ + virtual ~DSRTemplateCommon(); + + /** clear all entries in the list of node IDs, i.e.\ set them to their initial value, + * which is 0 + */ + void clearEntriesInNodeList(); + + /** reserve a certain number of entries in the list of node IDs. Using this method + * can help to avoid unwanted memory allocations and copying of list entries. + ** @param count number of entries to be reserved (for later use) + * @param initialize initialize all entries with a value of 0 if OFTrue, just + * reserve but do not create them otherwise (default) + */ + void reserveEntriesInNodeList(const size_t count, + const OFBool initialize = OFFalse); + + /** store given entry at a certain position in the list of node IDs + ** @param pos index of the list entry to use for storage (starting from 0) + * @param nodeID ID of the node that should be stored at the given position + */ + void storeEntryInNodeList(const size_t pos, + const size_t nodeID); + + /** get a particular entry from the list of node IDs + ** @param pos index of the list entry to retrieve (starting from 0) + ** @return node ID that is stored at the given position, 0 if not found or set + */ + size_t getEntryFromNodeList(const size_t pos) const; + + /** set given cursor to a specific node + ** @param cursor reference to document tree node cursor that is used to start + * searching the node from and that is set afterwards + * @param pos index of the list entry that stores the ID of the node + ** @return ID of the new current node within the tree if successful, 0 otherwise + */ + size_t gotoEntryFromNodeList(DSRDocumentTreeNodeCursor &cursor, + const size_t pos) const; + + /** set internal cursor of a given document tree to a specific node + ** @param tree pointer to document tree where nodes and cursor are stored + * @param pos index of the list entry that stores the ID of the node + ** @return ID of the new current node within the tree if successful, 0 otherwise + */ + size_t gotoEntryFromNodeList(DSRDocumentSubTree *tree, + const size_t pos); + + /** set internal cursor of a given document tree to a particular node. + * The node is determined from the list of node IDs, starting from the entry + * specified by the parameter 'lastPos'. The reverse search stops if either an + * entry with a non-zero value (valid node ID) is found or the first list entry + * is reached. This approach in particular supports handling of template tables + * where the order of content items is significant. + ** @param tree pointer to document tree where nodes and cursor are stored + * @param lastPos index of the last node list entry to start searching from + * @param firstPos optional index of the node list entry to stop searching + ** @return ID of the new current node within the tree if successful, 0 otherwise + */ + size_t gotoLastEntryFromNodeList(DSRDocumentSubTree *tree, + const size_t lastPos, + const size_t firstPos = 0); + + + private: + + /// template identifier (VR=CS, mandatory) + const OFString TemplateIdentifier; + /// mapping resource (VR=CS, mandatory) + const OFString MappingResource; + /// mapping resource UID (VR=UI, optional) + const OFString MappingResourceUID; + /// mode indicating whether template is extensible (default: false) + OFBool ExtensibleMode; + /// mode indicating whether the order of content items in this template is + /// significant (default: false) + OFBool OrderSignificantMode; + + /// list of node IDs used to remember certain positions in the template + OFVector NodeList; + + // --- declaration of default constructor and assignment operator + // --- (the assignment operator is defined implicitly) + + DSRTemplateCommon(); + DSRTemplateCommon &operator=(const DSRTemplateCommon &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrctxgr.h b/dcmsr/include/dcmtk/dcmsr/dsrctxgr.h new file mode 100644 index 00000000..a82c56c1 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrctxgr.h @@ -0,0 +1,287 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRContextGroup + * + */ + + +#ifndef DSRCTXGR_H +#define DSRCTXGR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class managing common information on a context group. + * This class is used as a base class only. + */ +class DCMTK_DCMSR_EXPORT DSRContextGroup +{ + + public: + + /** conversion operator that returns the currently selected coded entry value + * (might be empty if none is selected) + */ + operator const DSRCodedEntryValue &() const + { + return getSelectedValue(); + } + + /** clear list of extended coded entries and forget about the currently selected + * coded entry + */ + virtual void clear(); + + /** check whether context group is extensible + ** @return OFTrue if extensible, OFFalse otherwise + */ + inline OFBool isExtensible() const + { + return ExtensibleMode; + } + + /** change mode specifying whether the context group is extensible or non-extensible + ** @param mode set context group type to extensible if OFTrue (default) + */ + inline void setExtensible(const OFBool mode = OFTrue) + { + ExtensibleMode = mode; + } + + /** get context identifier + ** @return identifier of the context group + */ + inline const OFString &getIdentifier() const + { + return Identifier; + } + + /** get mapping resource + ** @return mapping resource that defines the context group + */ + inline const OFString &getMappingResource() const + { + return MappingResource; + } + + /** get context group version (optional) + ** @return version of the context group (might be empty) + */ + inline const OFString &getVersion() const + { + return Version; + } + + /** get context group UID (optional) + ** @return unique identifier of the context group (might be empty) + */ + inline const OFString &getUID() const + { + return UID; + } + + /** check whether a coded entry is selected as the current value + ** @return OFTrue if a value is selected, OFFalse otherwise + */ + virtual OFBool hasSelectedValue() const; + + /** get currently selected coded entry value (optional) + ** @return current value (might be empty if none is selected) + */ + inline const DSRCodedEntryValue &getSelectedValue() const + { + return SelectedValue; + } + + /** select a given coded entry as the current value + ** @param codedEntryValue coded entry to be selected as the current value + * @param check if enabled, check 'codedEntryValue' for validity and + * appropriateness before selecting it as the current + * value. See checkSelectedValue() for details. + * @param definedContextGroup flag indicating whether this context group is used as + * a baseline (default) or defined context group. The + * first means that the list of coded entries in this + * context group is just a suggestion. The latter + * means that one of the coded entries should be used. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition selectValue(const DSRCodedEntryValue &codedEntryValue, + const OFBool check = OFTrue, + const OFBool definedContextGroup = OFFalse); + + /** check whether a given coded entry is contained in this context group. + * Internally, the method findCodedEntry() is used for this purpose. + ** @param codedEntryValue coded entry to be checked + ** @return OFTrue if coded entry is part of this context group, OFFalse otherwise + */ + virtual OFBool hasCodedEntry(const DSRCodedEntryValue &codedEntryValue) const; + + /** search for a given coded entry in this context group. If found, the type of the + * entry (standard or extension) is returned: + * - SR_EC_CodedEntryInStandardContextGroup + * - SR_EC_CodedEntryIsExtensionOfContextGroup + * + ** @param codedEntryValue coded entry to be searched for + ** @return result of the search process, SR_EC_CodedEntryNotInContextGroup if coded + * entry could not be found. Use OFCondition::good() or OFCondition::bad() + * if not interested in the type of the entry. + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &codedEntryValue) const; + + /** check whether this context group has any extended coded entries. + * Extended coded entries are those non-standard codes added by addCodedEntry(). + ** @return OFTrue if there are any extended coded entries, OFFalse otherwise + */ + virtual OFBool hasExtendedCodedEntries() const; + + /** add a coded entry to this context group as an extension, i.e.\ as a non-standard + * code. Adding a new coded entry by this method only works for extensible context + * groups. Please note that the 'codedEntryValue' is not checked for validity. + ** @param codedEntryValue coded entry to be added to this context group + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition addCodedEntry(const DSRCodedEntryValue &codedEntryValue); + + /** search for a given coded entry in this context group and, if found, replace its + * value with the one found in the context group. This method can, therefore, be + * used to lookup the "official" code meaning or to set the "enhanced encoding mode". + ** @param codedEntryValue coded entry to be searched for. Should be a valid + * code, i.e. at least the three mandatory components + * have to be non-empty. Also used to store the retrieved + * coded entry. + * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) + ** @return result of the search process, see findCodedEntry() for details + */ + virtual OFCondition lookupCodedEntry(DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode = OFFalse) const; + + /** print contents of this context group, i.e.\ a general header, the currently + * selected coded entry value (if any) and all coded entries that are contained + * in this context group (both standard and extended ones). + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void print(STD_NAMESPACE ostream &stream) const; + + /** check whether the currently selected coded entry is valid. + * Internally, the method hasCodedEntry() is used if 'definedContextGroup' is OFTrue. + ** @param definedContextGroup flag indicating whether this context group is used as + * a baseline (default) or defined context group. The + * first means that the list of coded entries in this + * context group is just a suggestion. The latter + * means that one of the coded entries should be used. + ** @return status, EC_Normal if either no coded entry is selected or the selected one + * is both valid and allowed for this context group, an error code otherwise + */ + virtual OFCondition checkSelectedValue(const OFBool definedContextGroup = OFFalse) const; + + + protected: + + /** constructor + ** @param contextIdentifier identifier of the context group + * @param mappingResource mapping resource that defines the context group + * @param contextGroupVersion version of the context group (optional) + * @param contextGroupUID unique identifier of the context group (optional) + * @param selectedValue coded entry to be selected as the current value + * (optional) + */ + DSRContextGroup(const OFString &contextIdentifier, + const OFString &mappingResource, + const OFString &contextGroupVersion = "", + const OFString &contextGroupUID = "", + const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); + + /** destructor + */ + virtual ~DSRContextGroup(); + + /** print header with some general information on this context group + ** @param stream stream to which the output should be printed + */ + virtual void printHeader(STD_NAMESPACE ostream &stream) const; + + /** print details on coded entries that are contained in this context group. + * See DSRCodedEntryValue::print() for details of the coded entry output. + ** @param stream stream to which the output should be printed + */ + virtual void printCodes(STD_NAMESPACE ostream &stream) const; + + /** search for a given coded entry in this context group + ** @param searchForCodedEntry coded entry to be searched for + * @param foundCodedEntry pointer to variable that will store the coded entry + * (if found and pointer is not NULL) + * @param enhancedEncodingMode set enhanced encoding mode for coded entry + * (not used for this class, only in derived classes) + ** @return result of the search process, also defines the type of the entry + */ + virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode = OFFalse) const; + + /** check whether a given coded entry is valid. + * Internally, the method hasCodedEntry() is used if 'definedContextGroup' is OFTrue. + ** @param codedEntryValue coded entry to be checked + * @param definedContextGroup flag indicating whether this context group is used as + * a baseline (default) or defined context group. The + * first means that the list of coded entries in this + * context group is just a suggestion. The latter + * means that one of the coded entries should be used. + ** @return status, EC_Normal if either no coded entry is selected or the selected one + * is both valid and allowed for this context group, an error code otherwise + */ + virtual OFCondition checkCodedEntry(const DSRCodedEntryValue &codedEntryValue, + const OFBool definedContextGroup) const; + + + private: + + /// type used for storing and managing coded entries + typedef OFList CodeList; + + /// context identifier (VR=CS, mandatory) + const OFString Identifier; + /// mapping resource (VR=CS, mandatory) + const OFString MappingResource; + /// context group version (VR=DT, optional) + const OFString Version; + /// context group UID (VR=UI, optional) + const OFString UID; + + /// coded entry selected as the current value (optional, might be empty) + DSRCodedEntryValue SelectedValue; + /// mode indicating whether context group is extensible (default: false) + OFBool ExtensibleMode; + /// extended coded entries (e.g. private or implementation-specific ones) + CodeList ExtendedCodes; + + // --- declaration of default constructor and assignment operator + + DSRContextGroup(); + DSRContextGroup &operator=(const DSRContextGroup &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdattn.h b/dcmsr/include/dcmtk/dcmsr/dsrdattn.h new file mode 100644 index 00000000..5fa0206d --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdattn.h @@ -0,0 +1,208 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDateTreeNode + * + */ + + +#ifndef DSRDATTN_H +#define DSRDATTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrstrvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item DATE + */ +class DCMTK_DCMSR_EXPORT DSRDateTreeNode + : public DSRDocumentTreeNode, + public DSRStringValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRDateTreeNode(const E_RelationshipType relationshipType); + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param dateValue initial value to be set (VR=DA, mandatory) + * @param check if enabled, check 'dateValue' for validity before setting + * it. See checkValue() for details. An empty value is never + * accepted. + */ + DSRDateTreeNode(const E_RelationshipType relationshipType, + const OFString &dateValue, + const OFBool check = OFTrue); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRDateTreeNode(const DSRDateTreeNode &node); + + /** destructor + */ + virtual ~DSRDateTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRDateTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base classes, the concept name and the currently stored + * value (see hasValidValue()) are valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the stored date value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: contains DATE:(,,"Code")="20001010" + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format. Uses ISO formatted date value. + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + // --- static helper function --- + + /** get DICOM date value from given XML element. + * The DICOM Date (DA) value is expected to be stored in ISO format as created by + * writeXML(). + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the corresponding node + * @param dateValue reference to string object in which the value should be stored + * @param clearString flag specifying whether to clear the 'dateTimeValue' or not + ** @return reference to string object (might be empty) + */ + static OFString &getValueFromXMLNodeContent(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + OFString &dateValue, + const OFBool clearString = OFTrue); + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** check the specified date value for validity. + * In addition to the base class check for a non-empty value, this method also checks + * whether the given value conforms to the corresponding VR (DA) and VM (1). + ** @param dateValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &dateValue) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRDateTreeNode(); + DSRDateTreeNode &operator=(const DSRDateTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdncsr.h b/dcmsr/include/dcmtk/dcmsr/dsrdncsr.h new file mode 100644 index 00000000..dac6f5a8 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdncsr.h @@ -0,0 +1,119 @@ +/* + * + * Copyright (C) 2016-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentTreeNodeCursor + * + */ + + +#ifndef DSRDNCSR_H +#define DSRDNCSR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsdefine.h" +#include "dcmtk/dcmsr/dsrtncsr.h" +#include "dcmtk/dcmsr/dsrdnflt.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DSRDocumentTreeNode; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class implementing a document tree node cursor. + * Included sub-templates are not supported by this type of cursor, i.e. the subtree + * that is managed by an instance of DSRIncludedTemplateTreeNode is not iterated. + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeCursor + : public DSRTreeNodeCursor +{ + + public: + + /** default constructor + */ + DSRDocumentTreeNodeCursor(); + + /** copy constructor + ** @param cursor object to be copied + */ + DSRDocumentTreeNodeCursor(const DSRDocumentTreeNodeCursor &cursor); + + /** copy constructor (for base class) + ** @param cursor object to be copied + */ + DSRDocumentTreeNodeCursor(const DSRTreeNodeCursor &cursor); + + /** constructor. + * See comments on DSRTreeNodeCursor<>::setCursor() method. + ** @param node pointer to tree node used to initialize the cursor + * @param position optional pointer to position counter that should be used to + * initialize the internal counter + */ + DSRDocumentTreeNodeCursor(DSRDocumentTreeNode *node, + const DSRPositionCounter *position = NULL); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeCursor(); + + /** assignment operator + ** @param cursor object to be copied + ** @return reference to modified cursor (this object) + */ + DSRDocumentTreeNodeCursor &operator=(const DSRDocumentTreeNodeCursor &cursor); + + /** assignment operator. + * See comments on DSRTreeNodeCursor<>::setCursor() method. + ** @param node node to which the cursor should be set + ** @return reference to modified cursor (this object) + */ + DSRDocumentTreeNodeCursor &operator=(DSRDocumentTreeNode *node); + + /** set internal cursor to a matching node (starting from current position). + * If more than one node exists matching the given filter, the first one will be + * selected. Use gotoNextMatchingNode() in order to go to the next matching node. + ** @param filter matching criterion based on a single or multiple filters + * @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool searchIntoSub = OFTrue); + + /** set internal cursor to the next matching node. + * Starts from "next" node, i.e. either the first child of the current node or the + * first sibling following the current node. + ** @param filter matching criterion based on a single or multiple filters + * @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoNextMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool searchIntoSub = OFTrue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdnflt.h b/dcmsr/include/dcmtk/dcmsr/dsrdnflt.h new file mode 100644 index 00000000..bb9a8477 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdnflt.h @@ -0,0 +1,502 @@ +/* + * + * Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentTreeNodeFilter and derived implementations + * + */ + + +#ifndef DSRDNFLT_H +#define DSRDNFLT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsdefine.h" +#include "dcmtk/dcmsr/dsrcodvl.h" +#include "dcmtk/dcmsr/dsrtnant.h" +#include "dcmtk/dcmsr/dsrtypes.h" + +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofdatime.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DSRDocumentTreeNode; + + + +/*----------------------* + * class declarations * + *----------------------*/ + +/** Base class for a single document tree node filter + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeFilter +{ + + public: + + /** destructor + */ + virtual ~DSRDocumentTreeNodeFilter(); + + /** check whether given node matches the filter criterion (abstract) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const = 0; +}; + + +/** Base class for a list of document tree node filters + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeFilterList + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** default constructor + */ + DSRDocumentTreeNodeFilterList(); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeFilterList(); + + /** add a document tree node filter to the list + ** @param filter pointer to a single filter or to a list of filters to be added. + * Ownership is passed to this list, i.e. memory is deleted by the + * destructor. Therefore, the instance has to be created with new(). + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addFilter(DSRDocumentTreeNodeFilter *filter); + + /** check whether given node matches the filter criteria in the list (abstract) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criteria, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const = 0; + + + protected: + + /// list of pointers to filter criteria + OFList FilterList; + + + private: + + // --- declaration of copy constructor and assignment operator + + DSRDocumentTreeNodeFilterList(const DSRDocumentTreeNodeFilterList &); + DSRDocumentTreeNodeFilterList &operator=(const DSRDocumentTreeNodeFilterList &); +}; + + +/** Class implementing a list of document tree node filters that are combined with AND + * (conjunction) + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeAndFilter + : public DSRDocumentTreeNodeFilterList +{ + + public: + + /** destructor + */ + virtual ~DSRDocumentTreeNodeAndFilter(); + + /** check whether given node matches all filter criteria in the list + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criteria, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; +}; + + +/** Class implementing a list of document tree node filters that are combined with OR + * (disjunction) + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeOrFilter + : public DSRDocumentTreeNodeFilterList +{ + + public: + + /** destructor + */ + virtual ~DSRDocumentTreeNodeOrFilter(); + + /** check whether given node matches at least a single filter criterion in the list + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criteria, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; +}; + + +/** Class implementing a document tree node filter that checks for the presence (or + * absence) of child nodes + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeHasChildrenFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** (default) constructor + ** @param hasChildren mode specifying whether the filter matches on the presence + * (default) or absence of child nodes + */ + DSRDocumentTreeNodeHasChildrenFilter(const OFBool hasChildren = OFTrue); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeHasChildrenFilter(); + + /** check whether given node matches the filter criterion + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// mode specifying whether the filter matches on the presence or absence of child + /// nodes + const OFBool HasChildren; +}; + + +/** Class implementing a document tree node filter that checks for the presence (or + * absence) of sibling nodes + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeHasSiblingsFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** (default) constructor + ** @param hasSiblings mode specifying whether the filter matches on the presence + * (default) or absence of sibling nodes + */ + DSRDocumentTreeNodeHasSiblingsFilter(const OFBool hasSiblings = OFTrue); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeHasSiblingsFilter(); + + /** check whether given node matches the filter criterion + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// mode specifying whether the filter matches on the presence or absence of sibling + /// nodes + const OFBool HasSiblings; +}; + + +/** Class implementing a document tree node filter that checks for the presence (or + * absence) of a concept name. An empty concept name is treated as absent. + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeHasConceptNameFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor + ** @param hasConceptName mode specifying whether the filter matches on the + * presence (default) or absence of a concept name + */ + DSRDocumentTreeNodeHasConceptNameFilter(const OFBool hasConceptName = OFTrue); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeHasConceptNameFilter(); + + /** check whether given node matches the filter criterion + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// mode specifying whether the filter matches on the presence or absence of a + /// concept name + const OFBool HasConceptName; +}; + + +/** Class implementing a document tree node filter that checks for a given concept name + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeConceptNameFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor + ** @param conceptName concept name to check for + */ + DSRDocumentTreeNodeConceptNameFilter(const DSRCodedEntryValue &conceptName); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeConceptNameFilter(); + + /** check whether given node matches the filter criterion (concept name) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// concept name to check for + const DSRCodedEntryValue ConceptName; +}; + + +/** Class implementing a document tree node filter that checks for a given value type + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeValueTypeFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor + ** @param valueType value type to check for + */ + DSRDocumentTreeNodeValueTypeFilter(const DSRTypes::E_ValueType &valueType); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeValueTypeFilter(); + + /** check whether given node matches the filter criterion (value type) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// value type to check for + const DSRTypes::E_ValueType ValueType; +}; + + +/** Class implementing a document tree node filter that checks for a given relationship + * type + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeRelationshipTypeFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor + ** @param relationshipType relationship type to check for + */ + DSRDocumentTreeNodeRelationshipTypeFilter(const DSRTypes::E_RelationshipType &relationshipType); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeRelationshipTypeFilter(); + + /** check whether given node matches the filter criterion (relationship type) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// relationship type to check for + const DSRTypes::E_RelationshipType RelationshipType; +}; + + +/** Class implementing a document tree node filter that checks for a given annotation + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeAnnotationFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor + ** @param annotation annotation to check for + */ + DSRDocumentTreeNodeAnnotationFilter(const DSRTreeNodeAnnotation &annotation); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeAnnotationFilter(); + + /** check whether given node matches the filter criterion (annotation) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// annotation to check for + const DSRTreeNodeAnnotation Annotation; +}; + + +/** Class implementing a document tree node filter that checks for a given range of + * observation date/time values + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeObservationDateTimeFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor. + * Empty date/time values are not used for checking. E.g. if only 'fromDateTime' is + * specified (non-empty) all moments in time subsequent to and including it match. + * If both date/time values are empty, only an empty observation date/time of the + * document tree node matches. + ** @param fromDateTime start observation date/time to check for (might be empty) + * @param toDateTime end observation date/time to check for (might be empty) + */ + DSRDocumentTreeNodeObservationDateTimeFilter(const OFString &fromDateTime, + const OFString &toDateTime); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeObservationDateTimeFilter(); + + /** check whether given node matches the filter criterion (observation date/time) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// start observation date/time to check for (as a string, might be empty) + const OFString FromDateTime; + /// end observation date/time to check for (as a string, might be empty) + const OFString ToDateTime; + /// start observation date/time to check for (as a converted OFDateTime instance) + OFDateTime FromDateTimeValue; + /// end observation date/time to check for (as a converted OFDateTime instance) + OFDateTime ToDateTimeValue; +}; + + +/** Class implementing a document tree node filter that checks for a given observation + * unique identifier + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeObservationUIDFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor + ** @param observationUID observation unique identifier to check for + */ + DSRDocumentTreeNodeObservationUIDFilter(const OFString &observationUID); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeObservationUIDFilter(); + + /** check whether given node matches the filter criterion (observation unique + * identifier) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// observation unique identifier to check for + const OFString ObservationUID; +}; + + +/** Class implementing a document tree node filter that checks for a given template + * identification + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeTemplateIdentificationFilter + : public DSRDocumentTreeNodeFilter +{ + + public: + + /** constructor + ** @param templateIdentifier template identifier to check for + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional). + * Not used for comparison if the value is empty. + */ + DSRDocumentTreeNodeTemplateIdentificationFilter(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = ""); + + /** destructor + */ + virtual ~DSRDocumentTreeNodeTemplateIdentificationFilter(); + + /** check whether given node matches the filter criterion (template identification) + ** @param node pointer to the node to be checked + ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise + */ + virtual OFBool matches(const DSRDocumentTreeNode *node) const; + + + private: + + /// template identifier to check for + const OFString TemplateIdentifier; + /// mapping resource to check for + const OFString MappingResource; + /// mapping resource unique identifier to check for (if not empty) + const OFString MappingResourceUID; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdoc.h b/dcmsr/include/dcmtk/dcmsr/dsrdoc.h new file mode 100644 index 00000000..b61fc6cb --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdoc.h @@ -0,0 +1,1467 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocument + * + */ + + +#ifndef DSRDOC_H +#define DSRDOC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctr.h" +#include "dcmtk/dcmsr/dsrrtpl.h" +#include "dcmtk/dcmsr/dsrsoprf.h" +#include "dcmtk/dcmsr/dsrrefin.h" +#include "dcmtk/dcmsr/dsrcsidl.h" + +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrda.h" +#include "dcmtk/dcmdata/dcvris.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrpn.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcvrtm.h" +#include "dcmtk/dcmdata/dcvrui.h" + +#include "dcmtk/ofstd/ofstream.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Interface class for 'dcmsr' (DICOM Structured Reporting Documents). + * This class supports reading, writing, creation, printing and rendering of DICOM + * Structured Reporting (SR) documents. + * The list of supported SOP classes is available in file "dsrtypes.h". Also see + * DSRTypes::E_DocumentType. + */ +class DCMTK_DCMSR_EXPORT DSRDocument + : protected DSRTypes +{ + + public: + + // --- constructors and destructor --- + + /** (default) constructor. + * The parameter 'documentType' is optional and has a default value. + ** @param documentType type of the SR document (see DSRTypes::E_DocumentType) + */ + DSRDocument(const E_DocumentType documentType = DT_BasicTextSR); + + /** destructor + */ + virtual ~DSRDocument(); + + + // --- misc routines --- + + /** clear all internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * The SR document is valid if the corresponding document tree is valid and + * the SOP instance UID as well as the SOP class UID are not "empty". + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid(); + + /** check whether the document is finalized. + * A new document is originally not finalized but can be finalized using the method + * finalizeDocument(). This flag is e.g. used to indicate whether the entire document + * is digitally signed and, therefore, each newly added verifying observer would corrupt + * all previous signatures. + ** @return OFTrue if finalized, OFFalse otherwise + */ + virtual OFBool isFinalized() const; + + + // --- input and output --- + + /** print current SR document to specified output stream. + * The output format is identical to that of the dsrdump command line tool. + ** @param stream output stream (e.g.\ COUT from "ofconsol.h") + * @param flags optional flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0); + + /** read SR document from DICOM dataset. + * Please note that the current document is also deleted if the reading process fails. + * If logging is enabled, the reason for any error might be obtained from the log output. + * Also warning and debug messages are reported if the respective logger is enabled. + ** @param dataset reference to DICOM dataset from which the document should be read + * @param flags optional flag used to customize the reading process (see + * DSRTypes::RF_xxx). E.g. DSRTypes::RF_readDigitalSignatures indicates + * whether to read the digital signatures from the dataset or not. If set, + * the MACParametersSequence and the DigitalSignaturesSequence are read for + * the general document header (equivalent to top-level content item) and + * each content item of the document tree. + * If not removed manually (with DSRDocumentTree::removeSignatures()), + * the signatures are written back to the dataset when the write() method + * is called. + * Please note that the two signature sequences for any other sequence + * (e.g. VerifyingObserver or PredecessorDocuments) are never read. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset, + const size_t flags = 0); + + /** read patient data from DICOM dataset. + * The list of data elements that are read can be found under "Patient Module" in the + * member variable section of this class. Other data is not changed, so be careful + * when using this method. + * @param dataset reference to DICOM dataset from which the data should be read + * @param flags optional flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readPatientData(DcmItem &dataset, + const size_t flags = 0); + + /** read study data from DICOM dataset. Also reads patient data. + * The list of data elements that are read can be found under "Patient Module" and + * "General Study Module" in the member variable section of this class. Other data + * is not changed, so be careful when using this method. + * @param dataset reference to DICOM dataset from which the data should be read + * @param flags optional flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readStudyData(DcmItem &dataset, + const size_t flags = 0); + + /** write current SR document to DICOM dataset. + * Please note that the ContentTemplateSequence for the root content item is not written + * automatically for particular SOP Classes (e.g. Key Object Selection Document). + * Instead, the template identification has to be set manually for the root CONTAINER + * (see DSRDocumentTreeNode::setTemplateIdentification()). This is because the template + * constraints cannot be checked yet. + * If logging is enabled, warning and debug messages are reported to the log output. + ** @param dataset reference to DICOM dataset to which the current document should be + * written. The 'dataset' is not cleared before writing to it! + * @param markedItems optional stack where pointers to all 'marked' content items + * (DICOM datasets/items) are added to during the write process. + * Can be used to digitally sign parts of the document tree. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset, + DcmStack *markedItems = NULL); + + /** read SR document from XML file. + * The format (Schema) of the XML document is expected to conform to the output format + * of the writeXML() method. In addition, the document can be validated against an XML + * Schema by setting the flag DSRTypes::XF_validateSchema. + * Digital signatures in the XML document are not yet supported. + * Please note that the current document is also deleted if the parsing process fails. + ** @param filename name of the file from which the XML document is read ("-" for stdin) + * @param flags optional flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const OFString &filename, + const size_t flags = 0); + + /** write current SR document in XML format. + * The output format is identical to that of the dsr2xml command line tool. Digital + * signatures in the XML document are not yet supported. + ** @param stream output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags = 0); + + /** render current SR document in HTML/XHTML format. + * The output format is identical to that of the dsr2html command line tool. + ** @param stream output stream to which the HTML/XHTML document is written + * @param flags optional flag used to customize the output (see DSRTypes::HF_xxx) + * @param styleSheet optional filename/URL of a Cascading Style Sheet (CSS) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char *styleSheet = NULL); + + + // --- get/set misc attributes --- + + /** get the current SR document type + ** @return document type (might be DSRTypes::DT_invalid if read from dataset) + */ + virtual E_DocumentType getDocumentType() const; + + /** get document tree + ** @return reference to the document tree + */ + inline DSRDocumentTree &getTree() + { + return DocumentTree; + } + + /** set document tree. + * Replace the currently stored document tree with the given one. Please note that the + * given 'tree' is checked before setting it, i.e. only a valid document tree is accepted. + * However, a new SOP instance is never created. If needed, this has to be done with + * createNewSOPInstance() in addition to or with createNewDocument() before this method + * is called. + ** @param tree document tree to be set (content will be copied) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTree(const DSRDocumentTree &tree); + + /** set document tree from root template. + * Replace the currently stored document tree with the one from the given root template. + * By default, this method expands the tree, i.e. instances of DSRIncludedTemplateTreeNode + * that were added to the tree with DSRDocumentSubTree::includeTemplate() are replaced by + * their content, i.e. by the internally managed subtree. + * Please note that the additional comments on the above setTree() method also apply. + ** @param rootTemplate template specifying the document tree to be set (content will be + * copied). This parameter cannot be "const" because of + * DSRRootTemplate::getTree(), which is called internally and which + * modifies the tree. + * @param expandTree optional flag that allows for disabling the expanding of the + * document tree before setting it. Please note that various + * output methods like write() or renderHTML() do not yet work on + * such trees. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTreeFromRootTemplate(DSRRootTemplate &rootTemplate, + const OFBool expandTree = OFTrue); + + /** get specific character set type. + * If the type is unknown, the original DICOM defined term can be retrieved + * with the method getSpecificCharacterSet(). + ** @return character set type (might be DSRTypes::CS_invalid or DSRTypes::CS_unknown) + */ + virtual E_CharacterSet getSpecificCharacterSetType() const; + + /** set specific character set type. + * The DICOM defined term (see member variable SpecificCharacterSet) is set accordingly. + ** @param characterSet specific character set to be set (use DSRTypes::CS_invalid to reset + * to the default value, which is "unspecified") + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSetType(const E_CharacterSet characterSet); + + /** get document preliminary flag. + * @note Not applicable to Key Object Selection Documents. + ** @return preliminary flag (might be DSRTypes::PF_invalid if not specified) + */ + virtual E_PreliminaryFlag getPreliminaryFlag() const; + + /** set document preliminary flag. + * According to the DICOM standard, the concept of "completeness" is independent of the + * concept of "preliminary" or "final". Therefore, this flag can be specified separately. + * @note Not applicable to Key Object Selection Documents. + ** @param flag preliminary flag to be set (use DSRTypes::PF_invalid to omit this optional + * value) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPreliminaryFlag(const E_PreliminaryFlag flag); + + /** get document completion flag. + * According to the DICOM standard, this flag describes the estimated degree of completeness + * of an SR Document. See DICOM standard for details. + * @note Not applicable to Key Object Selection Documents. + ** @return completion flag (might be DSRTypes::CF_invalid if read from dataset) + */ + virtual E_CompletionFlag getCompletionFlag() const; + + /** get document verification flag. + * @note Not applicable to Key Object Selection Documents. + ** @return verification flag (might be DSRTypes::VF_invalid if read from dataset) + */ + virtual E_VerificationFlag getVerificationFlag() const; + + /** check whether there are one or more verifying observers. + * @note Not applicable to Key Object Selection Documents. + ** @return OFTrue if there is at least one verifying observer, OFFalse otherwise + */ + virtual OFBool hasVerifyingObservers() const; + + /** get number of verifying observers. + * A document can be verified more than once. The verification flag should be VERIFIED + * if any verifying observer is specified. The details on the observer can be retrieved + * using the getVerifyingObserver() methods. + * @note Not applicable to Key Object Selection Documents. + ** @return number of verifying observers (if any), 0 otherwise + */ + virtual size_t getNumberOfVerifyingObservers() const; + + /** get information about a verifying observer. + * All reference variables are cleared before the information is retrieved, i.e. if an error + * occurs (return value != EC_Normal) non-empty variables do contain valid (empty) data. + * @note Not applicable to Key Object Selection Documents. + ** @param idx index of the verifying observer to be retrieved (starting with 1). + * Use getNumberOfVerifyingObservers() to get the maximum value. + * @param dateTime reference to variable where the date and time when this document + * has been verified should be stored (required) + * @param observerName reference to variable where the name of the person who has verified + * this document should be stored (required) + * @param organization reference to variable where the name of the organization to which + * the observer belongs should be stored (required) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVerifyingObserver(const size_t idx, + OFString &dateTime, + OFString &observerName, + OFString &organization); + + /** get information about a verifying observer. + * All reference variables are cleared before the information is retrieved, i.e. if an error + * occurs (return value != EC_Normal) non-empty variables do contain valid (empty) data. + * @note Not applicable to Key Object Selection Documents. + ** @param idx index of the verifying observer to be retrieved (starting with 1). + * Use getNumberOfVerifyingObservers() to get the maximum value. + * @param dateTime reference to variable where the date and time when this document + * has been verified should be stored (required) + * @param observerName reference to variable where the name of the person who has verified + * this document should be stored (required) + * @param observerCode reference to variable where the observer code should be stored. + * code identifying the verifying observer (optional, see previous method) + * @param organization reference to variable where the name of the organization to which + * the observer belongs should be stored (required) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getVerifyingObserver(const size_t idx, + OFString &dateTime, + OFString &observerName, + DSRCodedEntryValue &observerCode, + OFString &organization); + + /** get list of predecessor documents. + * A document can have more than one (direct) predecessor document. This is e.g. the case + * when two or more documents have been merged to create it. The corresponding method + * createRevisedVersion() automatically adds a reference to the current document. + * The DICOM standard states: "[The Predecessor Documents Sequence] Shall refer to SR SOP + * Instances (e.g. prior or provisional reports) whose content has been wholly or partially + * included in this document with or without modification." and "[...] the use of the + * Predecessor Document Sequence allows tracing back to the input SR Document, which in this + * case is the previous version." + * @note Not applicable to Key Object Selection Documents. + ** @return reference to list object + */ + virtual DSRSOPInstanceReferenceList &getPredecessorDocuments(); + + /** get list of identical documents. + * Please note that currently the user is responsible for filling and modifying the content of + * this list. However, the list is automatically cleared when a new instance is created (incl. + * a revised version of the current document). Possibly, there will be a createDuplicate() + * method or the like in the future which creates an identical copy of the current document in + * a new study/series. + * The DICOM standard states: "If identical copies of an SR Document are to be included in + * multiple Studies then the entire SR Document shall be duplicated with appropriate changes + * for inclusion into the different Studies (i.e. Study Instance UID, Series Instance UID, SOP + * Instance UID, Identical Documents Sequence etc.). The Identical Documents Sequence Attribute + * in each SOP Instance shall contain references to all other duplicate SOP Instances." + ** @return reference to list object + */ + virtual DSRSOPInstanceReferenceList &getIdenticalDocuments(); + + /** get list of referenced SOP instances (Current Requested Procedure Evidence). + * The DICOM standard states: "The intent of the Current Requested Procedure Evidence Sequence + * is to reference all evidence created in order to satisfy the current Requested Procedure(s) + * for this SR Document. This shall include, but is not limited to, all current evidence + * referenced in the content tree." and "For a completed SR Document satisfying (i.e., being + * the final report for) the current Requested Procedure(s), this sequence shall list the full + * set of Composite SOP Instances created for the current Requested Procedure(s). For other + * SOP Instances that include the SR Document General Module, this sequence shall contain at + * minimum the set of Composite SOP Instances from the current Requested Procedure(s) that are + * referenced in the content tree." and "In the context of the Key Object Selection, the + * current evidence is considered to be only the set of instances referenced within the Key + * Object Selection." + ** @return reference to list object + */ + virtual DSRSOPInstanceReferenceList &getCurrentRequestedProcedureEvidence(); + + /** get list of referenced SOP instances (Pertinent Other Evidence). + * The DICOM standard states: "The Pertinent Other Evidence Sequence attribute is used to + * reference all other evidence considered pertinent for this SR Document that is not listed + * in the Current Requested Procedure Evidence Sequence. This requires that the same SOP + * Instance shall not be referenced in both of these Sequences." + * @note Not applicable to Key Object Selection Documents. + ** @return reference to list object + */ + virtual DSRSOPInstanceReferenceList &getPertinentOtherEvidence(); + + /** get list of referenced SOP instances significantly related to the current SOP instance. + * The DICOM standard states: "Such referenced Instances may include equivalent documents or + * renderings of this document. [...] Required if the identity of a CDA Document equivalent + * to the current SOP Instance is known at the time of creation of this SOP instance. May be + * present otherwise." The Purpose of Reference Code should be taken from Defined Context + * Group 7006 (SR Document Purposes of Reference). + * Note: An equivalent rendering of the document might be provided as an "Encapsulated PDF" + * DICOM object. + * @note Not applicable to Key Object Selection Documents. + ** @return reference to list object + */ + virtual DSRReferencedInstanceList &getReferencedInstances(); + + /** get list of coding schemes used (Coding Scheme Identification). + * The Coding Scheme Identification Sequence maps Coding Scheme Designators to an external coding + * system registration, or to a private or local coding scheme. See DICOM standard for details. + ** @return reference to list object + */ + virtual DSRCodingSchemeIdentificationList &getCodingSchemeIdentification(); + + + // --- get DICOM string attributes --- + + /** get specific character set + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSpecificCharacterSet(OFString &value, + const signed long pos = 0) const; + + /** get completion flag description. + * @note Not applicable to Key Object Selection Documents. + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getCompletionFlagDescription(OFString &value, + const signed long pos = 0) const; + + /** get modality + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getModality(OFString &value, + const signed long pos = 0) const; + + /** get SOP class UID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPClassUID(OFString &value, + const signed long pos = 0) const; + + /** get study instance UID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** get series instance UID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** get SOP instance UID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSOPInstanceUID(OFString &value, + const signed long pos = 0) const; + + /** get instance creator UID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreatorUID(OFString &value, + const signed long pos = 0) const; + + /** get timezone offset from UTC + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTimezoneOffsetFromUTC(OFString &value, + const signed long pos = 0) const; + + /** get patient's name + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientName(OFString &value, + const signed long pos = 0) const; + + /** get patient's birth date + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientBirthDate(OFString &value, + const signed long pos = 0) const; + + /** get patient's sex + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientSex(OFString &value, + const signed long pos = 0) const; + + /** get referring physician's name + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getReferringPhysicianName(OFString &value, + const signed long pos = 0) const; + + /** get study description + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDescription(OFString &value, + const signed long pos = 0) const; + + /** get series description + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDescription(OFString &value, + const signed long pos = 0) const; + + /** get protocol name + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getProtocolName(OFString &value, + const signed long pos = 0) const; + + /** get manufacturer + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturer(OFString &value, + const signed long pos = 0) const; + + /** get manufacturer's model name + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getManufacturerModelName(OFString &value, + const signed long pos = 0) const; + + /** get device serial number + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getDeviceSerialNumber(OFString &value, + const signed long pos = 0) const; + + /** get software version(s) + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSoftwareVersions(OFString &value, + const signed long pos = 0) const; + + /** get synchronization frame of reference UID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSynchronizationFrameOfReferenceUID(OFString &value, + const signed long pos = 0) const; + + /** get synchronization trigger + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSynchronizationTrigger(OFString &value, + const signed long pos = 0) const; + + /** get acquisition time synchronized + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAcquisitionTimeSynchronized(OFString &value, + const signed long pos = 0) const; + + /** get study date + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyDate(OFString &value, + const signed long pos = 0) const; + + /** get study time + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyTime(OFString &value, + const signed long pos = 0) const; + + /** get series date + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesDate(OFString &value, + const signed long pos = 0) const; + + /** get series time + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesTime(OFString &value, + const signed long pos = 0) const; + + /** get instance creation date + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationDate(OFString &value, + const signed long pos = 0) const; + + /** get instance creation time + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceCreationTime(OFString &value, + const signed long pos = 0) const; + + /** get content date + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentDate(OFString &value, + const signed long pos = 0) const; + + /** get content time + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getContentTime(OFString &value, + const signed long pos = 0) const; + + /** get study ID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getStudyID(OFString &value, + const signed long pos = 0) const; + + /** get patient ID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getPatientID(OFString &value, + const signed long pos = 0) const; + + /** get issuer of patient ID + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getIssuerOfPatientID(OFString &value, + const signed long pos = 0) const; + + /** get series number + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getSeriesNumber(OFString &value, + const signed long pos = 0) const; + + /** get instance number + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getInstanceNumber(OFString &value, + const signed long pos = 0) const; + + /** get accession number + ** @param value reference to variable in which the value should be stored + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getAccessionNumber(OFString &value, + const signed long pos = 0) const; + + + // --- set DICOM string attributes --- + + /** set specific character set. The internal enumerated value is set accordingly. + * Please note that this method does not return an error if the given 'value' is not + * defined by the DICOM standard or not supported by this class, e.g. when no mapping + * to the character set names needed for HTML/XHTML or XML output is defined. + * If needed, check the return value of the method getSpecificCharacterSetType() for + * DSRTypes::CS_invalid or DSRTypes::CS_unknown after calling this method. + ** @param value value to be set (single or multiple values) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSpecificCharacterSet(const OFString &value, + const OFBool check = OFTrue); + + /** set completion flag description. + * @note Not applicable to Key Object Selection Documents. + ** @param value explanation of the value that is set for completion flag. If an empty + * string is passed, the description is removed from the dataset (type 3). + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setCompletionFlagDescription(const OFString &value, + const OFBool check = OFTrue); + + /** set timezone offset from UTC + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled. + * Please note that it is not checked whether the 'value' conforms + * to the requirements of a valid timezone offset (see DICOM PS3.3). + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTimezoneOffsetFromUTC(const OFString &value, + const OFBool check = OFTrue); + + /** set patient's name + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientName(const OFString &value, + const OFBool check = OFTrue); + + /** set patient's birth date + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientBirthDate(const OFString &value, + const OFBool check = OFTrue); + + /** set patient's sex + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientSex(const OFString &value, + const OFBool check = OFTrue); + + /** set referring physician's name + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (PN) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setReferringPhysicianName(const OFString &value, + const OFBool check = OFTrue); + + /** set study description + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDescription(const OFString &value, + const OFBool check = OFTrue); + + /** set series description + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDescription(const OFString &value, + const OFBool check = OFTrue); + + /** set protocol name + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setProtocolName(const OFString &value, + const OFBool check = OFTrue); + + /** set manufacturer + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturer(const OFString &value, + const OFBool check = OFTrue); + + /** set manufacturer's model name + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setManufacturerModelName(const OFString &value, + const OFBool check = OFTrue); + + /** set device serial number + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setDeviceSerialNumber(const OFString &value, + const OFBool check = OFTrue); + + /** set software version(s) + ** @param value value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1-n) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSoftwareVersions(const OFString &value, + const OFBool check = OFTrue); + + /** set synchronization frame of reference UID + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSynchronizationFrameOfReferenceUID(const OFString &value, + const OFBool check = OFTrue); + /** set synchronization trigger + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSynchronizationTrigger(const OFString &value, + const OFBool check = OFTrue); + + /** set acquisition time synchronized + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAcquisitionTimeSynchronized(const OFString &value, + const OFBool check = OFTrue); + + /** set content date + ** @param value value to be set (single value only). If an empty string is passed, + * the current date is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentDate(const OFString &value, + const OFBool check = OFTrue); + + /** set content time + ** @param value value to be set (single value only). If an empty string is passed, + * the current time is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setContentTime(const OFString &value, + const OFBool check = OFTrue); + + /** set study date + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyDate(const OFString &value, + const OFBool check = OFTrue); + + /** set study time + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyTime(const OFString &value, + const OFBool check = OFTrue); + + /** set series date + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (DA) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesDate(const OFString &value, + const OFBool check = OFTrue); + + /** set series time + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (TM) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesTime(const OFString &value, + const OFBool check = OFTrue); + + /** set study ID + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setStudyID(const OFString &value, + const OFBool check = OFTrue); + + /** set patient ID + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setPatientID(const OFString &value, + const OFBool check = OFTrue); + + /** set issuer of patient ID + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (LO) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setIssuerOfPatientID(const OFString &value, + const OFBool check = OFTrue); + + /** set series number + ** @param value value to be set (single value only). If an empty string is passed, + * the value "1" is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setSeriesNumber(const OFString &value, + const OFBool check = OFTrue); + + /** set instance number + ** @param value value to be set (single value only). If an empty string is passed, + * the value "1" is set when displaying or writing the document since + * the corresponding DICOM attribute is mandatory. + * @param check check 'value' for conformance with VR (IS) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setInstanceNumber(const OFString &value, + const OFBool check = OFTrue); + + /** set accession number + ** @param value value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setAccessionNumber(const OFString &value, + const OFBool check = OFTrue); + + + // --- document management functions --- + + /** create new study. + * After generating a new study instance UID the method createNewSeries() is called, + * i.e. also a new series instance UID and SOP instance UID are generated. This is + * a requirement of the DICOM standard. All other study-related attributes are + * cleared. + */ + virtual void createNewStudy(); + + /** create a new series. + * After generating a new series instance UID the method createNewSOPInstance() is + * called, i.e. also a new SOP instance UID is generated. This is a requirement of + * the DICOM standard. All other series-related attributes are cleared. + */ + virtual void createNewSeries(); + + /** create a new series within a given study. + * After generating a new series instance UID within the given study the method + * createNewSOPInstance() is called, i.e. also a SOP instance UID is generated. + * This is a requirement of the DICOM standard. + * NB: There is no mechanism that makes sure that the study-related attributes are + * consistent for all series of a study. This either has to be done manually + * or readStudyData() should be used in combination with createNewSeries(). + ** @param studyUID study instance UID to be set (should be a valid UID) + * @param check check 'studyUID' for conformance with VR and VM if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createNewSeriesInStudy(const OFString &studyUID, + const OFBool check = OFTrue); + + /** create a new SOP instance. + * Generate a new SOP instance UID, set the instance creation date/time and reset the + * finalized flag (OFFalse). + * This method is used internally for createNewDocument(), createRevisedVersion() + * and during object initialization. + * It could also be used explicitly from the calling application if a new UID should + * be created (this is the case if the study instance UID or series instance UID has + * changed as well as any other attribute within the SR Document General Module or + * SR Document Content Module, see DICOM standard for details). + * This method also updates other DICOM header attributes (by calling updateAttributes()). + * However, instance-level attributes other than the SOP instance UID are usually not + * changed (if already set), e.g. the current instance number or content date/time. + */ + virtual void createNewSOPInstance(); + + /** create a new document. + * A new SOP instance is only created if the current document type was valid/supported. + * Please note that the current document is deleted (cleared). + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createNewDocument(); + + /** create a new document of the specified type. + * A new SOP instance is only created if the current document type was valid/supported. + * Please note that the current document is deleted by this method. + ** @param documentType type of the new SR document (see DSRTypes::E_DocumentType) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createNewDocument(const E_DocumentType documentType); + + /** change the type of the current document. + * Please note that only the type of the SR document is changed (if possible) but no new + * SOP instance is created. If needed, this has to be done with createNewSOPInstance() + * in addition to this method or by calling createNewDocument() instead of this method. + * Before changing the document type, it is checked whether the currently stored document + * tree complies with the relationship content constraints of the new SR IOD. + ** @param documentType new type of the SR document (see DSRTypes::E_DocumentType) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition changeDocumentType(const E_DocumentType documentType); + + /** create a revised version of the current document. + * A revised version can only be created if the current document is already completed + * (see completion flag). If so, a reference to the current document is added to the + * predecessor documents sequence. If all revised versions of a SR document are + * stored (written to datasets/files) it is possible to trace back the full chain of + * previous versions. + * A new SOP instance is created and the content date/time are set automatically. + * Furthermore, the verifying observer and identical documents sequence are deleted, + * the verification flag is set to UNVERIFIED, the completion flag is set to PARTIAL + * (i.e. not complete), the completion flag description is deleted, all digital + * signatures contained in the document tree are deleted and the finalized flag is + * reset (OFFalse). The preliminary flag is not modified by this method. Also the + * various lists of referenced instances remain unchanged, i.e. they have to be + * adapted manually if needed. + * @note Not applicable to Key Object Selection Documents. + * @param clearList clear list of predecessor documents before adding the current + * document if OFTrue. Append current document to existing list + * otherwise. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createRevisedVersion(const OFBool clearList = OFTrue); + + /** complete the current document. + * Sets the completion flag to COMPLETE if not already done (fails otherwise). This flag + * describes the estimated degree of completeness of an SR Document (see DICOM standard + * for details). The completion flag description is set to an empty string (i.e. absent + * in DICOM dataset). + * @note Not applicable to Key Object Selection Documents. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition completeDocument(); + + /** complete the current document and set a completion description. + * Sets the completion flag to COMPLETE if not already done (fails otherwise). This flag + * describes the estimated degree of completeness of an SR Document (see DICOM standard + * for details). The completion flag description can be modified independently from the + * flag by means of the method setCompletionFlagDescription() - see above. + * @note Not applicable to Key Object Selection Documents. + ** @param description explanation of the value set for completion flag. + * (optional, see previous method, VR=LO) + * @param check check 'description' for conformance with VR and VM if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition completeDocument(const OFString &description, + const OFBool check = OFTrue); + + /** verify the current document by a specific observer. + * A document can be verified more than once. The observer information is added to a + * sequence stored in the dataset. The verification flag is automatically set to + * VERIFIED (if not already done) and the finalized flag is reset (set to OFFalse). + * Please note that only completed documents (see completion flag) can be verified and that + * a new SOP instance UID has to be generated (manually) according to the DICOM standard when + * creating a dataset/file from this document. + * @note Not applicable to Key Object Selection Documents. + ** @param observerName name of the person who has verified this document (required, VR=PN) + * @param organization name of the organization to which the observer belongs (required, VR=LO) + * @param dateTime verification date time (optional). If empty/absent the current date and + * time are used. + * @param check check 'observerName', 'organization' and 'dateTime' for conformance with + * VR and VM if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition verifyDocument(const OFString &observerName, + const OFString &organization, + const OFString &dateTime = "", + const OFBool check = OFTrue); + + /** verify the current document by a specific observer. + * A document can be verified more than once. The observer information is added to a + * sequence stored in the dataset. The verification flag is automatically set to + * VERIFIED (if not already done) and the finalized flag is reset (set to OFFalse). + * Please note that only completed documents (see completion flag) can be verified and that + * a new SOP instance UID has to be generated (manually) according to the DICOM standard when + * creating a dataset/file from this document. + * @note Not applicable to Key Object Selection Documents. + ** @param observerName name of the person who has verified this document (required, VR=PN) + * @param observerCode code identifying the verifying observer (optional, see previous method) + * @param organization name of the organization to which the observer belongs (required, VR=LO) + * @param dateTime verification date time (optional). If empty/absent the current date and + * time are used. + * @param check check 'observerName', 'observerCode', 'organization' and 'dateTime' for + * conformance with VR and VM if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition verifyDocument(const OFString &observerName, + const DSRCodedEntryValue &observerCode, + const OFString &organization, + const OFString &dateTime = "", + const OFBool check = OFTrue); + + /** remove verification information. + * The list of verifying observers is cleared, the verification flag is set to UNVERIFIED and + * the finalized flag is reset (set to OFFalse). + * Normally, there should be no need to call this method. On the other hand, it is useful to + * guarantee a consistent state when processing documents which have not been created with this + * module/toolkit. + */ + virtual void removeVerification(); + + /** finalize the current state of the document. + * A new document is originally not finalized but can be finalized using this method. + * This internal flag is e.g. used to indicate whether the entire document is digitally signed + * and, therefore, each newly added verifying observer would corrupt all previous signatures. + * NB: A document needs to be completed first in order to be finalized. Some of the above + * document management functions do reset the flag (i.e. set the FinalizedFlag to OFFalse), + * other methods (e.g. setXXX) do not change the flag though the state of the document is + * not finalized any more after they have been called. + * @note Not applicable to Key Object Selection Documents since there's no completion flag in + * this type of SR document. Please note that this method has nothing to do with the + * preliminary flag. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition finalizeDocument(); + + + protected: + + /** read XML document header + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXMLDocumentHeader(DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** read XML "patient" data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXMLPatientData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** read XML "study" data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXMLStudyData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** read XML "series" data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXMLSeriesData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** read XML "instance" data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXMLInstanceData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** read XML "document" data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXMLDocumentData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** read XML verifying observer data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXMLVerifyingObserverData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render patient name, sex, birthdate and ID in HTML/XHTML format + ** @param stream output stream to which the HTML/XHTML document is written + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + */ + void renderHTMLPatientData(STD_NAMESPACE ostream &stream, + const size_t flags); + + /** render list of referenced SOP instances in HTML/XHTML format + ** @param stream output stream to which the HTML/XHTML document is written + * @param refList list of referenced SOP instances to be rendered + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + */ + void renderHTMLReferenceList(STD_NAMESPACE ostream &stream, + DSRSOPInstanceReferenceList &refList, + const size_t flags); + + /** render list of referenced SOP instances in HTML/XHTML format + ** @param stream output stream to which the HTML/XHTML document is written + * @param refList list of referenced SOP instances to be rendered + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + */ + void renderHTMLReferenceList(STD_NAMESPACE ostream &stream, + DSRReferencedInstanceList &refList, + const size_t flags); + + /** check the given dataset before reading. + * This methods checks whether the dataset contains at least the DICOM attributes SOP class UID + * and modality. Any incorrectness regarding these two attributes is reported to the logger. + * Currently unsupported SOP classes are also reported as an error. + ** @param dataset DICOM dataset to be checked + * @param documentType SR document type retrieved from the SOP class UID + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition checkDatasetForReading(DcmItem &dataset, + E_DocumentType &documentType); + + /** get current value of specific character set + ** @return pointer to character string (never NULL) + */ + const char *getSpecificCharacterSet() const; + + /** update various DICOM attributes. + * (e.g. set the modality and SOP class UID, generate a new Study, Series and SOP instance UID + * if required, set date/time values, etc.) + ** @param updateAll flag indicating whether all DICOM attributes should be updated or only + * the IOD-specific ones. (e.g. set DICOM defined terms from enum values) + * @param verboseMode report (more) processing details to the logger if enabled (default) + */ + void updateAttributes(const OFBool updateAll = OFTrue, + const OFBool verboseMode = OFTrue); + + + private: + + /// SR document tree + DSRDocumentTree DocumentTree; + + /// flag indicating whether this document is finalized or not + OFBool FinalizedFlag; + /// enumerated value: preliminary, final + E_PreliminaryFlag PreliminaryFlagEnum; + /// enumerated value: partial, complete + E_CompletionFlag CompletionFlagEnum; + /// enumerated value: unverified, verified + E_VerificationFlag VerificationFlagEnum; + /// defined term: see class DSRTypes + E_CharacterSet SpecificCharacterSetEnum; + + // DICOM attributes are listed ordered by Module. + // The comments for each attribute describe "Name: (VR, VM, Type)". + // Please note that for particular SR documents (e.g. Key Object Selection) + // other rules might apply. See DICOM standard for further reference. + + // --- SOP Common Module (M) --- + // (see SR Document General Module) + + /// SOP Class UID: (UI, 1, 1) + DcmUniqueIdentifier SOPClassUID; + /// SOP Instance UID: (UI, 1, 1) + DcmUniqueIdentifier SOPInstanceUID; + /// Specific Character Set: (CS, 1-n, 1C) + DcmCodeString SpecificCharacterSet; + /// Instance Creation Date: (DA, 1, 3) + DcmDate InstanceCreationDate; + /// Instance Creation Time: (TM, 1, 3) + DcmTime InstanceCreationTime; + /// Instance Creator UID: (UI, 1, 3) + DcmUniqueIdentifier InstanceCreatorUID; + /// Coding Scheme Identification Sequence: (SQ, 1-n, 3) + DSRCodingSchemeIdentificationList CodingSchemeIdentification; + /// Context Group Identification Sequence: (SQ, 1-n, 3) + // - tbd: optional attribute not yet supported + /// Mapping Resource Identification Sequence: (SQ, 1-n, 3) + // - tbd: optional attribute not yet supported + /// Timezone Offset from UTC: (SH, 1, 3) + DcmShortString TimezoneOffsetFromUTC; + + // --- General Study Module (M) --- + + /// Study Instance UID: (UI, 1, 1) + DcmUniqueIdentifier StudyInstanceUID; + /// Study Date: (DA, 1, 2) + DcmDate StudyDate; + /// Study Time: (TM, 1, 2) + DcmTime StudyTime; + /// Referring Physician's Name: (PN, 1, 2) + DcmPersonName ReferringPhysicianName; + /// Study ID: (SH, 1, 2) + DcmShortString StudyID; + /// Accession Number: (SH, 1, 2) + DcmShortString AccessionNumber; + /// Study Description: (LO, 1, 3) + DcmLongString StudyDescription; + + // --- Patient Module (M) --- + + /// Patient's Name: (PN, 1, 2) + DcmPersonName PatientName; + /// Patient ID: (LO, 1, 2) + DcmLongString PatientID; + /// Issuer of Patient ID: (LO, 1, 3) + DcmLongString IssuerOfPatientID; + /// Patient's Birth Date: (DA, 1, 2) + DcmDate PatientBirthDate; + /// Patient's Sex: (CS, 1, 2) + DcmCodeString PatientSex; + + // --- General Equipment Module (M) --- + + /// Manufacturer: (LO, 1, 2) + DcmLongString Manufacturer; + /// Manufacturer's Model Name: (LO, 1, 3) + DcmLongString ManufacturerModelName; + /// Device Serial Number: (LO, 1, 3) + DcmLongString DeviceSerialNumber; + /// Software Version(s): (LO, 1-n, 3) + DcmLongString SoftwareVersions; + + // --- Enhanced General Equipment Module (M - for some IODs) --- + + // Manufacturer: (LO, 1, 1) + // - see 'General Equipment Module' + // Manufacturer's Model Name: (LO, 1, 1) + // - see 'General Equipment Module' + // Device Serial Number: (LO, 1, 1) + // - see 'General Equipment Module' + // Software Version(s): (LO, 1-n, 1) + // - see 'General Equipment Module' + + // --- Synchronization Module (M/C/U - for some IODs) --- + + /// Synchronization Frame of Reference UID: (UI, 1, 1) + DcmUniqueIdentifier SynchronizationFrameOfReferenceUID; + /// Synchronization Trigger: (CS, 1, 1) + DcmCodeString SynchronizationTrigger; + /// Acquisition Time Synchronized: (CS, 1, 1) + DcmCodeString AcquisitionTimeSynchronized; + + // --- SR Document Series / Key Object Document Series Module (M) --- + + /// Modality: (CS, 1, 1) + DcmCodeString Modality; + /// Series Instance Number: (UI, 1, 1) + DcmUniqueIdentifier SeriesInstanceUID; + /// Series Number: (IS, 1, 1) + DcmIntegerString SeriesNumber; + /// Series Date: (DA, 1, 3) + DcmDate SeriesDate; + /// Series Time: (TM, 1, 3) + DcmTime SeriesTime; + /// Protocol Name: (LO, 1, 3) + DcmLongString ProtocolName; + /// Series Description: (LO, 1, 3) + DcmLongString SeriesDescription; + /// Series Description Code Sequence: (SQ, 1, 3) + // - tbd: optional attribute not yet supported + /// Referenced Performed Procedure Step Sequence: (SQ, 1, 2) + DcmSequenceOfItems ReferencedPerformedProcedureStep; + + // --- SR Document General Module (M) --- + + /// Instance Number: (IS, 1, 1) + DcmIntegerString InstanceNumber; + /// Preliminary Flag: (CS, 1, 3) + DcmCodeString PreliminaryFlag; + /// Completion Flag: (CS, 1, 1) + DcmCodeString CompletionFlag; + /// Completion Flag Description: (LO, 1, 3) + DcmLongString CompletionFlagDescription; + /// Verification Flag: (CS, 1, 1) + DcmCodeString VerificationFlag; + /// Content Date: (DA, 1, 1) + DcmDate ContentDate; + /// Content Time: (TM, 1, 1) + DcmTime ContentTime; + /// Verifying Observer Sequence: (SQ, 1-n, 1C) + DcmSequenceOfItems VerifyingObserver; + /// Author Observer Sequence: (SQ, 1-n, 3) + // - tbd: optional attribute not yet supported + /// Participant Sequence: (SQ, 1-n, 3) + // - tbd: optional attribute not yet supported + /// Custodial Organization Sequence: (SQ, 1, 3) + // - tbd: optional attribute not yet supported + /// Predecessor Documents Sequence: (SQ, 1-n, 1C) + DSRSOPInstanceReferenceList PredecessorDocuments; + /// Identical Documents Sequence: (SQ, 1-n, 1C) + DSRSOPInstanceReferenceList IdenticalDocuments; + // Referenced Request Sequence: (SQ, 1-n, 1C) + // - tbd: conditional attribute not yet supported + /// Performed Procedure Code Sequence: (SQ, 1-n, 2) + DcmSequenceOfItems PerformedProcedureCode; + /// Current Requested Procedure Evidence Sequence: (SQ, 1-n, 1C) + DSRSOPInstanceReferenceList CurrentRequestedProcedureEvidence; + /// Pertinent Other Evidence Sequence: (SQ, 1-n, 1C) + DSRSOPInstanceReferenceList PertinentOtherEvidence; + /// Referenced Instance Sequence: (SQ, 1-n, 1C) + DSRReferencedInstanceList ReferencedInstances; + + // --- Timezone Module (M - for some IODs) --- + + // Timezone Offset from UTC: (SH, 1, 1) + // - see 'SOP Common Module' + + // --- declaration of copy constructor and assignment operator --- + + DSRDocument(const DSRDocument &); + DSRDocument &operator=(const DSRDocument &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdocst.h b/dcmsr/include/dcmtk/dcmsr/dsrdocst.h new file mode 100644 index 00000000..4d321a17 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdocst.h @@ -0,0 +1,817 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentSubTree + * + */ + + +#ifndef DSRDOCST_H +#define DSRDOCST_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtree.h" +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrdncsr.h" +#include "dcmtk/dcmsr/dsritcsr.h" +#include "dcmtk/dcmsr/dsrcitem.h" + +#include "dcmtk/ofstd/ofmem.h" + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DSRIODConstraintChecker; +class DSRSubTemplate; + + +/*-------------------* + * type definition * + *-------------------*/ + +typedef OFshared_ptr DSRSharedSubTemplate; + + +/*--------------------------* + * template instantiation * + *--------------------------*/ + +// the following is required in order to help older Clang compilers, +// e.g. Clang 3.0 and 3.1 on Mac OS X when building with shared libs +#if defined(__clang__) +template class DSRTree; +#endif + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class managing a SR document subtree. + * A subtree represents an extract of an SR document tree. Compared to the "SR Document + * Content Tree" that is defined in the DICOM standard, there are almost no restrictions + * regarding the value and relationship types. It is also possible to have multiple nodes + * on the top-level, i.e. no dedicated root, or to use "unknown" relationship types. + */ +class DCMTK_DCMSR_EXPORT DSRDocumentSubTree + : public DSRTree +{ + + public: + + /** default constructor + */ + DSRDocumentSubTree(); + + /** copy constructor. + * Please note that the internal cursor is not copied but reset, i.e. set to the root + * node. Also the IOD constraint checker is not copied by this class but recreated + * by the derived class DSRDocumentTree (based on the corresponding document type). + * This constructor also updates any by-reference relationships, i.e. translates the + * references from the source 'tree' (based on the position string) to the IDs of the + * newly created nodes. + ** @param tree subtree to be copied + */ + DSRDocumentSubTree(const DSRDocumentSubTree &tree); + + /** destructor + */ + virtual ~DSRDocumentSubTree(); + + /** assignment operator. + * Please note that internally the copy constructor is used, so the same comments apply. + ** @param tree subtree to be copied + ** @return reference to this subtree after copying + */ + DSRDocumentSubTree &operator=(DSRDocumentSubTree tree); + + /** clone this subtree. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this subtree + */ + virtual DSRDocumentSubTree *clone() const; + + /** clear internal member variables + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * A subtree is valid if it is not empty. + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the internal cursor, which points to the current content item, is valid + ** @return OFTrue if cursor is valid, OFFalse otherwise + */ + virtual OFBool isCursorValid() const; + + /** check whether this subtree is a valid document tree. + * In order to be a valid document tree, there should be a single root node only, with + * the value type "CONTAINER", and the internal relationship type of this node should be + * DSRTypes::RT_isRoot. + ** @param defaultRelType default relationship type that is used if the one of the + * top-level node (root node) is "unknown" + ** @return OFTrue if subtree is a valid document tree, OFFalse otherwise + */ + virtual OFBool isValidDocumentTree(const E_RelationshipType defaultRelType = RT_unknown) const; + + /** check whether this subtree is an expanded document tree. + * Expanded means that no instances of DSRIncludedTemplateTreeNode exist in the document + * tree, i.e. no templates were included or all of them were replaced by their content + * (subtree). + ** @return OFTrue if subtree is an expanded document tree, OFFalse otherwise + */ + virtual OFBool isExpandedDocumentTree() const; + + /** check whether template identification is set + ** @return OFTrue if template identification is set, OFFalse otherwise + */ + virtual OFBool hasTemplateIdentification() const; + + /** check whether template identification is possible at all. + * According to the DICOM standard, it can be used if "the template consists of a single + * CONTAINER with nested content, and it is the outermost invocation of a set of nested + * templates that start with the same CONTAINER." + * With other words, the tree should have a single root node with value type "CONTAINER". + ** @return OFTrue if template identification is possible, OFFalse otherwise + */ + virtual OFBool canUseTemplateIdentification() const; + + /** print current SR document tree to specified output stream + ** @param stream output stream + * @param flags optional flag used to customize the output (see DSRTypes::PF_xxx) + * @param posCounter optional pointer to position counter that should be used to + * initialize the counter for line indentation or numbering of + * nested content items + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const DSRPositionCounter *posCounter = NULL); + + /** write current SR document tree in XML format + ** @param stream output stream to which the XML document is written + * @param flags optional flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags = 0); + + /** get reference to current content item. + * This mechanism allows to access all content items without using pointers. + ** @return reference to current content item (might be invalid) + */ + virtual DSRContentItem &getCurrentContentItem(); + + /** get read-only access to current node (content item) + ** @return pointer to current node (might be NULL) + */ + virtual const DSRDocumentTreeNode *getCurrentNode() const; + + /** get a cursor to the root node of this document tree. + * This cursor can be used to iterate over the nodes of the document tree without + * changing the internal cursor. Please note that the cursor might become invalid, + * e.g. by pointing to a non-existing node if the content of the document tree is + * modified after the cursor has been retrieved. + * Included sub-templates are not supported by this type of cursor, i.e. the subtree + * that is managed by an instance of DSRIncludedTemplateTreeNode is not iterated. + ** @param cursor reference to variable where the cursor is stored + ** @return OFTrue is the returned 'cursor' is valid, OFFalse otherwise + */ + virtual OFBool getCursorToRootNode(DSRDocumentTreeNodeCursor &cursor) const; + + /** get a cursor to the root node of this document tree. + * This cursor can be used to iterate over the nodes of the document tree without + * changing the internal cursor. Please note that the cursor might become invalid, + * e.g. by pointing to a non-existing node if the content of the document tree is + * modified after the cursor has been retrieved. + * This type of cursor also supports included sub-templates, i.e. the subtree that + * is managed by an instance of DSRIncludedTemplateTreeNode is also iterated. + ** @param cursor reference to variable where the cursor is stored + ** @return OFTrue is the returned 'cursor' is valid, OFFalse otherwise + */ + virtual OFBool getCursorToRootNode(DSRIncludedTemplateNodeCursor &cursor) const; + + /** get a cursor to the current node of this document tree. + * This cursor can be used to iterate over the nodes of the document subtree that + * starts at the current node without changing the internal cursor. Please note + * that the cursor might become invalid, e.g. by pointing to a non-existing node if + * the content of the document tree is modified after the cursor has been retrieved. + * Included sub-templates are not supported by this type of cursor, i.e. the subtree + * that is managed by an instance of DSRIncludedTemplateTreeNode is not iterated. + ** @param cursor reference to variable where the cursor is stored + ** @return OFTrue is the returned 'cursor' is valid, OFFalse otherwise + */ + virtual OFBool getCursorToCurrentNode(DSRDocumentTreeNodeCursor &cursor) const; + + /** get a cursor to the subtree below the current node. + * This cursor can be used to iterate over the nodes of the selected subtree without + * changing the internal cursor. Please note that the cursor might become invalid, + * e.g. by pointing to a non-existing node if the content of the document tree is + * modified after the cursor has been retrieved. + * Included sub-templates are not supported by this type of cursor, i.e. the subtree + * that is managed by an instance of DSRIncludedTemplateTreeNode is not iterated. + ** @param cursor reference to variable where the cursor is stored + ** @return OFTrue is the returned 'cursor' is valid, OFFalse otherwise + */ + virtual OFBool getCursorToSubTree(DSRDocumentTreeNodeCursor &cursor) const; + + /** count number of content items (nodes) in the document tree. + * This method iterates over all nodes that are stored in the document tree. + * By default, included sub-templates are counted as a single node (see options). + ** @param searchIntoSubTemplates optional flag indicating whether to also + * count the content of included sub-templates + * (i.e.\ the nodes of the managed subtrees) + * @param countIncludedTemplateNodes optional flag indicating whether to count + * the DSRIncludedTemplateTreeNode instances + * as nodes. See includeTemplate() for details. + ** @return number of nodes, 0 if document tree is empty + */ + size_t countNodes(const OFBool searchIntoSubTemplates = OFFalse, + const OFBool countIncludedTemplateNodes = OFTrue) const; + + /** set internal cursor to a matching node. + * If more than one node exists matching the given filter, the first one will be + * selected. Use gotoNextMatchingNode() in order to go to the next matching node. + ** @param filter matching criterion based on a single or multiple filters + * @param startFromRoot flag indicating whether to start from the root node or + * the current one + * @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool startFromRoot = OFTrue, + const OFBool searchIntoSub = OFTrue); + + /** set internal cursor to the next matching node. + * Starts from "next" node, i.e. either the first child of the current node or the + * first sibling following the current node. + ** @param filter matching criterion based on a single or multiple filters + * @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoNextMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool searchIntoSub = OFTrue); + + /** set internal cursor to a named node. + * If more than one node exists with the given concept name, the first one will + * be selected. Use gotoNextNamedNode() in order to go to the next matching node. + ** @param conceptName concept name of the node to be searched for + * @param startFromRoot flag indicating whether to start from the root node or + * the current one + * @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoNamedNode(const DSRCodedEntryValue &conceptName, + const OFBool startFromRoot = OFTrue, + const OFBool searchIntoSub = OFTrue); + + /** set internal cursor to a named node (starting from the first child of the + * current node and searching on this level only). + * This is just a shortcut for calling gotoChild() followed by gotoNamedNode() + * with 'searchIntoSub' being OFFalse, i.e. only the first sub-level is checked. + * If more than one node exists with the given concept name, the first one will + * be selected. + ** @param conceptName concept name of the node to be searched for + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoNamedChildNode(const DSRCodedEntryValue &conceptName); + + /** set internal cursor to a named node in the subtree below the current node. + * If more than one node exists with the given concept name, the first one will + * be selected. If the current node has no children, the cursor is not moved. + ** @param conceptName concept name of the node to be searched for + * @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the first sub-level only + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoNamedNodeInSubTree(const DSRCodedEntryValue &conceptName, + const OFBool searchIntoSub = OFTrue); + + /** set internal cursor to the next named node. + * Starts from "next" node, i.e. either the first child of the current node + * or the first sibling following the current node. + ** @param conceptName concept name of the node to be searched for + * @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoNextNamedNode(const DSRCodedEntryValue &conceptName, + const OFBool searchIntoSub = OFTrue); + + /** set internal cursor to an annotated node. + * If more than one node exists with the given annotation text, the first one will + * be selected. Use gotoNextAnnotatedNode() in order to go to the next matching + * node. In contrast to gotoNamedNode(), a "deep search" is always performed. + ** @param annotationText annotation text of the node to be searched for + * @param startFromRoot flag indicating whether to start from the root node or + * the current one + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoAnnotatedNode(const OFString &annotationText, + const OFBool startFromRoot = OFTrue); + + /** set internal cursor to the next annotated node. + * Starts from "next" node, i.e. either the first child of the current node + * or the first sibling following the current node. + ** @param annotationText annotation text of the node to be searched for + ** @return ID of the new current node if successful, 0 otherwise + */ + virtual size_t gotoNextAnnotatedNode(const OFString &annotationText); + + /** check whether specified content item can be added to the current one. + * This method can be used to decide which type of content items can be added prior + * to really doing so. Please note that only by-value relationships are supported. + * Always returns true if no constraint checker is available but 'relationshipType' + * and 'valueType' have valid values. + ** @param relationshipType relationship type of node to be checked with regard to + * the current one + * @param valueType value type of node to be checked + * @param addMode flag specifying at which position the new node would + * be added (e.g. after or below the current node) + ** @return OFTrue if specified node can be added, OFFalse otherwise + */ + virtual OFBool canAddContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const E_AddMode addMode = AM_afterCurrent) const; + + /** check whether specified by-reference relationship can be added to the current + * content item. + * Always returns true if no constraint checker is available but 'relationshipType' and + * 'targetValueType' have valid values. The value type DSRTypes::VT_includedTemplate is + * never allowed for the target content item. + ** @param relationshipType type of relationship between current and target node + * @param targetValueType value type of the referenced node (target content item) + ** @return OFTrue if specified by-reference relationship can be added, OFFalse otherwise + */ + virtual OFBool canAddByReferenceRelationship(const E_RelationshipType relationshipType, + const E_ValueType targetValueType) const; + + /** add specified content item to the current one. + * If possible, this method creates a new node as specified and adds it to the current + * one. The method canAddContentItem() is called internally to check parameters first. + * If the node could be added successfully, the cursor is set to it automatically. + ** @param relationshipType relationship type of node to be added with regard to + * the current one + * @param valueType value type of node to be added + * @param addMode flag specifying at which position to add the new node + * (e.g. after or below the current node) + ** @return ID of new node if successful, 0 otherwise + */ + virtual size_t addContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const E_AddMode addMode = AM_afterCurrent); + + /** add specified content item to the current one. + * If possible, this method adds a given new node to the current one. The method + * canAddContentItem() is called internally to check parameters first. If the + * node could be added successfully, the cursor is set to it automatically. + * Please note that no copy of the given node is created. Therefore, the node + * has to be created with new() or with DSRTypes::createDocumentTreeNode() - do + * not use a reference to a local variable and do not delete it a second time. + ** @param node pointer to the new node to be added (should not be empty). + * Reference remains valid after successful insertion. + * @param addMode flag specifying at which position to add the new node + * (e.g. after or below the current node) + * @param deleteIfFail flag specifying whether to delete the given 'node' if + * adding fails. By default, the item is not deleted, i.e. + * in case of error it has to be deleted by the caller. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition addContentItem(DSRDocumentTreeNode *node, + const E_AddMode addMode = AM_afterCurrent, + const OFBool deleteIfFail = OFFalse); + + /** add specified content item after the current one. + * If possible, this method creates a new node as specified and adds it after the current + * one, i.e. on the same level. Internally, the first variant of the addContentItem() + * method is called with the third parameter being DSRTypes::AM_afterCurrent. If + * successful, the given concept name is set for the new node, and the cursor is updated. + * @note This is a convenience function that avoids calling several other functions. + ** @param relationshipType relationship type of node to be added with regard to + * the current one + * @param valueType value type of node to be added + * @param conceptName concept name of the node to be added + * @param check if enabled, check 'conceptName for validity before + * setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition addContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFBool check = OFTrue); + + /** add specified content item below the current one. + * If possible, this method creates a new node as specified and adds it below the current + * one, i.e. as a child. Internally, the first variant of the addContentItem() method + * is called with the third parameter being DSRTypes::AM_belowCurrent. If successful, + * the given concept name is set for the new node, and the cursor is updated. + * @note This is a convenience function that avoids calling several other functions. + ** @param relationshipType relationship type of node to be added with regard to + * the current one + * @param valueType value type of node to be added + * @param conceptName concept name of the node to be added + * @param check if enabled, check 'conceptName for validity before + * setting it + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition addChildContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFBool check = OFTrue); + + /** add specified by-reference relationship to the current content item. + * If possible, this method creates a new pseudo-node (relationship) and adds it to the + * current one. The method canAddByReferenceRelationship() is called internally to check + * parameters first. The internal cursor is automatically re-set to the current node. + ** @param relationshipType relationship type between current and referenced node + * @param referencedNodeID ID of the referenced node (target content item) + ** @return ID of new pseudo-node if successful, 0 otherwise + */ + virtual size_t addByReferenceRelationship(const E_RelationshipType relationshipType, + const size_t referencedNodeID); + + /** update the position strings used to encode by-reference relationships (if any). + * Internally, this method calls checkByReferenceRelationships() with the 'mode' + * parameter being DSRTypes::CM_updatePositionString. It should be called before + * this subtree is cloned in order to make sure that the by-reference relationships + * (if any) still work on the cloned subtree. This method should also be called + * before accessing the position string of a referenced content item, see + * DSRByReferenceTreeNode::getReferencedContentItem(). + ** @param updateIncludedTemplates optional flag indicating whether to also update + * the subtrees managed by included sub-templates + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition updateByReferenceRelationships(const OFBool updateIncludedTemplates = OFFalse); + + /** check whether specified subtree can be inserted at the current position, i.e.\ added + * to the current content item. Internally, the method canAddContentItem() is used for + * all top-level nodes of the document subtree. In addition, if a constraint checker + * is available, the remaining nodes of the given subtree are also checked for their + * compliance with the relationship content constraints of the underlying SR IOD. + ** @param tree pointer to new subtree to be inserted (should not be empty) + * @param addMode flag specifying at which position the new subtree would + * be added (e.g. after or below the current node) + * @param defaultRelType default relationship type between the top-level nodes of + * the given subtree and the current node. This relationship + * type is used if the one of a top-level node is "unknown". + ** @return OFTrue if specified subtree can be inserted, OFFalse otherwise + */ + virtual OFBool canInsertSubTree(const DSRDocumentSubTree *tree, + const E_AddMode addMode = AM_belowCurrent, + const E_RelationshipType defaultRelType = RT_unknown) const; + + /** insert specified subtree to this tree, i.e.\ add it to the current content item. + * If possible, this method adds a given new subtree to the current content item. + * The method canInsertSubTree() is called internally to check the parameters first. + * Please note that no copy of the given subtree is created. Therefore, the subtree + * has to be created with new() or with cloneSubTree() - do not use a reference to a + * local variable and do not delete it a second time. + ** @param tree pointer to new subtree to be inserted (should not be empty). + * Reference becomes invalid after successful insertion! + * @param addMode flag specifying at which position to add the new subtree + * (e.g. after or below the current node) + * @param defaultRelType default relationship type between the top-level nodes of + * the given subtree and the current node. This relationship + * type is used if the one of a top-level node is "unknown". + * @param deleteIfFail flag specifying whether to delete the given 'tree' if + * adding fails. By default, the tree is not deleted, i.e. + * in case of error it has to be deleted by the caller. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition insertSubTree(DSRDocumentSubTree *tree, + const E_AddMode addMode = AM_belowCurrent, + const E_RelationshipType defaultRelType = RT_unknown, + const OFBool deleteIfFail = OFFalse); + + /** extract a subtree, i.e.\ a fragment from this tree. + * The subtree is specified by the current node, which becomes the root of the subtree. + * In contrast to cloneSubTree(), this method also makes sure that the by-reference + * relationships are preserved (as long as both source and target node are contained + * in the same tree). Please note that the returned subtree has to be deleted by the + * caller if it is not inserted into the document tree using insertSubTree(). + ** @return pointer to the extracted subtree, NULL in case of error + */ + virtual DSRDocumentSubTree *extractSubTree(); + + /** remove current content item from tree. + * Please note that not only the specified node but also all of its child nodes are + * removed from the tree and then deleted. The internal cursor is set automatically + * to a new valid position. + ** @return ID of the node which became the current one after deletion, 0 if an error + * occurred or the tree is now empty. + */ + virtual size_t removeCurrentContentItem(); + + /** remove a subtree from this tree. + * The subtree to be removed (and deleted) is either specified by the current node or by + * the node with the given ID. Afterwards, the internal cursor is set automatically to + * a new valid position. It would be an error to remove a subtree from an empty tree. + ** @param searchID ID of the root node specifying the subtree to be removed. + * By default (0), the current node is used. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition removeSubTree(const size_t searchID = 0); + + /** clone the current tree node. + * Internally, the copy constructor of the respective tree node class is used, so the + * corresponding comments apply. Please note that the returned tree node has to be + * deleted by the caller if it is not added to the document tree using addContentItem(). + ** @return pointer to a copy of the current tree node, NULL in case of error + */ + virtual DSRDocumentTreeNode *cloneCurrentTreeNode() const; + + /** clone a subtree, i.e.\ a fragment of this tree. + * The cloning starts with the current node and ends with the given node. + * Please note that the returned subtree has to be deleted by the caller if it is not + * inserted into the document tree using insertSubTree(). + ** @param stopAfterNodeID ID of the node after which the cloning should stop. + * By default (0), the process ends after cloning the + * current node with all of its child nodes (if any). + ** @return pointer to a copy of the specified subtree, NULL in case of error + */ + virtual DSRDocumentSubTree *cloneSubTree(const size_t stopAfterNodeID = 0) const; + + /** created an expanded version of this (sub)tree. + * Expanded means that no instance of DSRIncludedTemplateTreeNode will exist in the new + * document tree, i.e. all of them are replaced by their content (subtree). Please note + * that the returned subtree has to be deleted by the caller if it is not inserted into + * the document tree using insertSubTree(). + ** @param tree variable that will store the pointer to the new subtree + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition createExpandedSubTree(DSRDocumentSubTree *&tree) const; + + /** set observation date/time for all content items in the document tree. + * Calling this method might be useful when a (sub)tree is copied into a new document, + * since content date and time of the new document are likely to be different than the + * date and time of the original observation. + ** @param observationDateTime value to be set (might be an empty string) + * @param check check 'observationDateTime' for conformance with VR (DT) + * and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setObservationDateTime(const OFString &observationDateTime, + const OFBool check = OFTrue); + + /** compare template identification of the root node with given values. + * Please note that the comparison only takes place if there is a single node at the + * root of the tree and its value type is CONTAINER. + ** @param templateIdentifier template identifier to compare with + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional). + * Not used for comparison if the value is empty. + ** @result OFTrue if template identification can be compared and the values are + * identical, OFFalse otherwise + */ + virtual OFBool compareTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "") const; + + /** get template identifier and mapping resource from the root node of this tree. + * See DSRDocumentTreeNode::getTemplateIdentification() for details on template + * identification. + * Please note that the template identification is only retrieved if there is a single + * node at the root of the tree and its value type is CONTAINER. + ** @param templateIdentifier identifier of the template (might be empty) + * @param mappingResource mapping resource that defines the template (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get template identifier, mapping resource and optional mapping resource UID from the + * root node of this tree. See DSRDocumentTreeNode::getTemplateIdentification() for + * details on template identification. + * Please note that the template identification is only retrieved if there is a single + * node at the root of the tree and its value type is CONTAINER. + ** @param templateIdentifier identifier of the template (might be empty) + * @param mappingResource mapping resource that defines the template (might be empty) + * @param mappingResourceUID uniquely identifies the mapping resource (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource, + OFString &mappingResourceUID) const; + + /** set template identifier and mapping resource to the root node of this tree. + * The identification is valid if the first two values are either present (non-empty) or + * all three values are absent (empty). See DSRDocumentTreeNode::getTemplateIdentification() + * for details. + * Please note that the template identification is only set if there is a single node at + * the root of the tree and its value type is CONTAINER. + ** @param templateIdentifier identifier of the template to be set + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional) + * @param check check 'templateIdentifier', 'mappingResource' and + * 'mappingResourceUID' for conformance with VR (CS,UI) and + * VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "", + const OFBool check = OFTrue); + + + protected: + + /** special constructor that receives a pointer to the root node. + * Please note that the 'rootNode' and the associated tree is not copied! + ** @param rootNode pointer to the root node of the "new" tree + */ + DSRDocumentSubTree(DSRDocumentTreeNode *rootNode); + + /** special copy constructor that clones a particular subtree only + ** @param startCursor cursor pointing to first node of the subtree to be copied + * @param stopAfterNodeID ID of the node after which the cloning should stop + */ + DSRDocumentSubTree(const DSRDocumentTreeNodeCursor &startCursor, + size_t stopAfterNodeID); + + /** fast, non-throwing swap function. + * The time complexity of this function is constant. + ** @param tree subtree to swap with + */ + void swap(DSRDocumentSubTree &tree); + + /** get pointer to current node. + * Hide this inherited method from the public interface. + ** @return pointer to current node (might be NULL) + */ + virtual DSRDocumentTreeNode *getNode() const; + + /** add new node to the current one. + * Please note that no copy of the given node is created. Therefore, the node + * has to be created with new() - do not use a reference to a local variable. + * If the node could be added successfully, the cursor is set to it automatically. + ** @param node pointer to the new node to be added + * @param addMode flag specifying at which position to add the new node + * (e.g. after or below the current node) + ** @return ID of the new node if successful, 0 otherwise + */ + virtual size_t addNode(DSRDocumentTreeNode *node, + const E_AddMode addMode = AM_afterCurrent); + + /** replace current node by the given one. + * Please note that no copy of the given node is created. Therefore, the node + * should be created with new() - do not use a reference to a local variable. If + * the node could be replaced successfully, the "old" node (and all of its child + * nodes) are deleted, and the cursor is set to the new one. + ** @param node pointer to the new node to replace the current one + ** @return ID of the new node if successful, 0 otherwise + */ + virtual size_t replaceNode(DSRDocumentTreeNode *node); + + /** extract current node from tree. + * Please note that not only the specified node but also all of its child nodes are + * extracted from the tree. The cursor is set automatically to a new valid position. + ** @return pointer to extracted node, NULL in case of error (or the tree was empty) + */ + virtual DSRDocumentTreeNode *extractNode(); + + /** get pointer to root node and "forget" the internal reference to this node. + * In other words: after calling this method, the stored tree will be empty. + * This also means that the caller is responsible for deleting the allocated memory. + ** @return pointer to root node, might be NULL (empty tree) + */ + virtual DSRDocumentTreeNode *getAndRemoveRootNode(); + + /** remove current node from tree. + * Please note that not only the specified node but also all of his child nodes are + * removed from the tree and deleted afterwards. The cursor is set automatically to + * a new valid position. + ** @return ID of the node which became the current one after deletion, 0 if an error + * occurred or the tree is now empty. + */ + virtual size_t removeNode(); + + /** include specified sub-template, i.e.\ add a new DSRIncludedTemplateTreeNode, which + * references this template, to the current content item. + * Please note that no checks are performed that would make sure that the template + * with its top-level nodes can actually be added, e.g. by using an IOD constraint + * checker. This is also the reason why this method is "protected" and not "public", + * i.e. it can only be used by derived classes, e.g. DSRSubTemplate and its children. + ** @param subTemplate shared pointer to a sub-template that should be included + * into this tree (at the current position) + * @param addMode flag specifying at which position to add the 'subTemplate' + * (e.g. after or below the current node) + * @param defaultRelType default relationship type that will be used when the + * subtree that is managed by the 'subTemplate' is inserted + * into this tree and the relationship type of one of the + * top-level nodes is "unknown". Also see documentation of + * createExpandedSubTree(). + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition includeTemplate(const DSRSharedSubTemplate &subTemplate, + const E_AddMode addMode = AM_belowCurrent, + const E_RelationshipType defaultRelType = RT_unknown); + + /** expand all "included template" content items in a given (sub)tree. + * Expanding means that all instances of DSRIncludedTemplateTreeNode are replaced by + * their content (subtree). + * Please note that the internal cursor of the given 'tree' is set to the root node + * if no error occurred. Otherwise, the cursor points to the content item that + * caused the problem. + ** @param tree pointer to the subtree that should be expanded + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition expandIncludedTemplates(DSRDocumentSubTree *tree) const; + + /** check the by-reference relationships (if any) for validity. + * This function checks whether all by-reference relationships possibly contained + * in the document tree are valid according to the following restrictions: source + * and target node are not identical and the target node is not an ancestor of the + * source node (requirement from the DICOM standard to prevent loops -> directed + * acyclic graph, though this is not 100% true - see "reportlp.dcm" example). + * In addition, the position strings (used to encode by-reference relationships + * according to the DICOM standard) OR the node IDs (used internally to uniquely + * identify nodes) can be updated. + * Please note that the checking modes DSRTypes::CM_updatePositionString and + * DSRTypes::CM_updateNodeID are mutually exclusive. + ** @tparam T_Cursor template type used for the cursor iterating the document (sub)tree + ** @param mode mode used to customize the checking process (see DSRTypes::CM_xxx) + * @param flags flag used to customize the reading (see DSRTypes::RF_xxx) and/or + * printing process (see DSRTypes::PF_xxx). Conflicting definitions + * are avoided using the appropriate bit mask (see DSRTypes::CB_xxx). + ** @return status, EC_Normal if successful, an error code otherwise + */ + template + OFCondition checkByReferenceRelationships(const size_t mode = 0, + const size_t flags = 0); + + /** reset flag for all content items whether they are target of a by-reference relationship. + * This function calls 'setReferenceTarget(OFFalse)' for all content items in the tree. + */ + virtual void resetReferenceTargetFlag(); + + /** update the tree for subsequent output, e.g.\ for being printed or added to an SR + * document. By default, this virtual function does nothing but is called automatically + * by the affected output methods and should be overwritten in derived classes. + */ + virtual void updateTreeForOutput(); + + /** check whether the given subtree complies with the constraints of the given checker + ** @param tree pointer to subtree that should be checked + * @param checker pointer to relationship content constraints checker to be used. + * If NULL, no checks are performed by this method. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition checkSubTreeConstraints(const DSRDocumentSubTree *tree, + const DSRIODConstraintChecker *checker) const; + + + // --- static helper function --- + + /** check whether a by-reference relationship from a given source to a target node + * (specified by the position strings) is valid, i.e.\ is allowed according to the + * DICOM standard. This check should prevent loops (directed acyclic graphs). + ** @param sourcePosition position string of the source content item to be checked + * @param targetPosition position string of the target content item to be checked + ** @return OFTrue if by-reference relationship is allowed, OFFalse otherwise + */ + virtual OFBool validByReferenceRelationship(const OFString &sourcePosition, + const OFString &targetPosition); + + /** clone a particular subtree, i.e.\ a fragment of a tree + ** @param startCursor cursor pointing to first node of the subtree to be copied + * @param stopAfterNodeID ID of the node after which the cloning should stop + ** @return pointer to a copy of the specified subtree, NULL in case of error + */ + static DSRDocumentSubTree *cloneSubTree(const DSRDocumentTreeNodeCursor &startCursor, + const size_t stopAfterNodeID = 0); + + /// check relationship content constraints of the associated IOD + DSRIODConstraintChecker *ConstraintChecker; + + + private: + + /// current content item. Introduced to avoid the external use of pointers. + DSRContentItem CurrentContentItem; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdoctn.h b/dcmsr/include/dcmtk/dcmsr/dsrdoctn.h new file mode 100644 index 00000000..14e95d49 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdoctn.h @@ -0,0 +1,783 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentTreeNode + * + */ + + +#ifndef DSRDOCTN_H +#define DSRDOCTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtree.h" +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DSRIODConstraintChecker; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Base class for content items + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTreeNode + : public DSRTreeNode +{ + // allow direct access to protected methods + friend class DSRTree; + friend class DSRTreeNodeCursor; + // also for the derived cursor classes + friend class DSRDocumentTreeNodeCursor; + friend class DSRIncludedTemplateNodeCursor; + + // allow access to getConceptNamePtr() + friend class DSRContentItem; + + public: + + /** constructor. + * The 'valueType' can never be changed after the tree node has been created + * (therefore, the corresponding member variable is declared "const"). + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid, and DSRTypes::RT_isRoot + * only for the root node. + * @param valueType value type of the associated content item. Should not + * be DSRTypes::VT_invalid. + */ + DSRDocumentTreeNode(const E_RelationshipType relationshipType, + const E_ValueType valueType); + + /** copy constructor. + * Please note that the member variables of the base class DSRTreeNode are not copied + * because the new tree node is not (yet) part of a document tree. Furthermore, the + * following member variables of this class are also not copied but initialized with + * their respective default values: + * - ReferenceTarget + * - MACParameters + * - DigitalSignatures + * + ** @param node tree node to be copied + */ + DSRDocumentTreeNode(const DSRDocumentTreeNode &node); + + /** destructor + */ + virtual ~DSRDocumentTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are regarded as equal if the relationship type, the value type and the + * concept name are equal. Other information is not used unless implemented in a derived + * class. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are regarded as not equal if either the relationship type or the value + * type or the concept name are not equal. Other information is not used unless implemented + * in a derived class. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node (abstract). + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRDocumentTreeNode *clone() const = 0; + + /** clear all member variables. + * This does not apply to the relationship and value type since they are never changed. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the relationship type and the value type are both not invalid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item is valid. See derived classes for details. + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * This method is used to check whether the rendered output of this content item can be + * expanded inline or not (used for renderHTML()). This base class always returns OFTrue. + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** check whether template identification is set + ** @return OFTrue if template identification is set, OFFalse otherwise + */ + virtual OFBool hasTemplateIdentification() const; + + /** print content item. + * The output of a content item depends on its value type. This general method prints + * only those parts which all derived classes (= value types) do have in common, i.e. the + * type of relationship, the value type and the (optional) concept name. + * A typical output looks like this: has concept mod CODE: (,,"Concept") + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** print extended information on the content item. + * The following details are printed (if present and output is enabled): observation + * date/time (in curly brackets), annotation text (in quotation marks) and template + * identification (after a hash mark). This method is intended to be called after + * the general print() method, e.g. like it is done by DSRDocumentSubTree::print(). + ** @param stream output stream to which the extended information should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition printExtended(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read content item from dataset. + * A number of readXXX() methods are called (see "protected" part) in order to retrieve all + * possibly nested content items from the dataset. + ** @param dataset DICOM dataset from which the content item should be read + * @param constraintChecker checks relationship content constraints of the associated IOD + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset, + const DSRIODConstraintChecker *constraintChecker, + const size_t flags); + + /** write content item to dataset. + * A number of writeXXX() methods are called (see "protected" part) in order to write all + * possibly nested content items to the dataset. + ** @param dataset DICOM dataset to which the content item should be written + * @param markedItems optional stack where pointers to all 'marked' content items + * (DICOM datasets/items) are added to during the write process. + * Can be used to digitally sign parts of the document tree. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset, + DcmStack *markedItems = NULL); + + /** read general XML document tree node data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param documentType type of the document to be read (used for debug output only) + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const E_DocumentType documentType, + const size_t flags); + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render content item in HTML/XHTML format. + * After rendering the current content item all child nodes (if any) are also rendered (see + * renderHTMLChildNodes() for details). + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** check whether content item is digitally signed. + * A content item is signed if the DigitalSignaturesSequence exists. This sequence is read + * from the dataset if present and the 'signature' flag for the 'read' method is turned on. + ** @return OFTrue if content item is signed, OFFalse otherwise + */ + inline OFBool isSigned() + { + return !DigitalSignatures.isEmpty(); + } + + /** check whether content item is marked. + * Use method setMark() to mark and unmark the current content item. + * Pointers to the DICOM dataset/item of marked content items are added to the optional + * stack when calling the DSRDocument::write() method. This mechanism can e.g. be used + * to digitally sign particular content items. + ** @return OFTrue if content item is marked, OFFalse otherwise + */ + inline OFBool isMarked() const + { + return MarkFlag; + } + + /** mark/unmark the current content item. + * See explanation for method isMarked() for details. + * @param flag mark item if OFTrue, unmark otherwise + */ + inline void setMark(const OFBool flag) + { + MarkFlag = flag; + } + + /** check whether the current content item is target of a by-reference relationship + ** @return OFTrue if the content item is target, OFFalse otherwise + */ + inline OFBool isReferenceTarget() const + { + return ReferenceTarget; + } + + /** specify whether the current content item is target of a by-reference relationship + ** @param isTarget OFTrue if the content item is target (default), OFFalse otherwise + */ + inline void setReferenceTarget(const OFBool isTarget = OFTrue) + { + ReferenceTarget = isTarget; + } + + /** check whether the current content item has any children + ** @return OFTrue if there are any child nodes, OFFalse otherwise + */ + inline OFBool hasChildNodes() const + { + return (getDown() != NULL); + } + + /** check whether the current content item has any siblings + ** @return OFTrue if there are any sibling nodes, OFFalse otherwise + */ + inline OFBool hasSiblingNodes() const + { + return (getPrev() != NULL) || (getNext() != NULL); + } + + /** get ID of the current tree node + ** @return ID of the current tree node (should never be 0) + */ + inline size_t getNodeID() const + { + return getIdent(); + } + + /** get relationship type of the current content item + ** @return relationship type of the current content item (might be DSRTypes::RT_invalid) + */ + inline E_RelationshipType getRelationshipType() const + { + return RelationshipType; + } + + /** set relationship type of the current content item (if previously unknown). + * Please note that changing the relationship type (which was originally passed to the + * constructor of this class) only works if the current value is DSRTypes::RT_unknown. + * This is needed for inserting document subtrees where the top-level nodes might have an + * "unknown" relationship to the parent node (see DSRDocumentSubTree::insertSubTree()). + ** @param relationshipType type of relationship to the parent tree node. Should not be + * DSRTypes::RT_invalid or DSRTypes::RT_unknown. Be careful + * with DSRTypes::RT_isRoot, use it for root nodes only. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setRelationshipType(const E_RelationshipType relationshipType); + + /** get value type of the current content item + ** @return value type of the current content item (might be DSRTypes::VT_invalid) + */ + inline E_ValueType getValueType() const + { + return ValueType; + } + + /** get reference to the concept name + ** @return reference to the concept name (code, might be empty/invalid) + */ + inline const DSRCodedEntryValue &getConceptName() const + { + return ConceptName; + } + + /** get copy of the concept name. + * Code describing the concept represented by this content item. Also conveys the value + * of document title and section headings in documents. + ** @param conceptName reference to a variable where the code should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getConceptName(DSRCodedEntryValue &conceptName) const; + + /** set the concept name. + * Code describing the concept represented by this content item. Also conveys the value + * of document title and section headings in documents. + * If the new code is invalid the current one is not replaced. An empty code can + * be used to clear the current concept name. + ** @param conceptName code to be set as the new concept name (checked before set) + * @param check check 'conceptName' for validity if enabled. See + * DSRCodedEntryValue::checkCode() for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setConceptName(const DSRCodedEntryValue &conceptName, + const OFBool check = OFTrue); + + /** get observation date/time. + * This is the date and time on which this content item was completed. Might be empty + * if the date and time do not differ from the content date and time, see DSRDocument. + ** @return observation date/time of current content item (might be empty/invalid) + */ + inline const OFString &getObservationDateTime() const + { + return ObservationDateTime; + } + + /** set observation date/time. + * This is the date and time on which this content item was completed. Might be empty + * if the date and time do not differ from the content date and time, see DSRDocument. + ** @param observationDateTime value to be set (might be an empty string) + * @param check check 'observationDateTime' for conformance with VR (DT) + * and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setObservationDateTime(const OFString &observationDateTime, + const OFBool check = OFTrue); + + /** set observation date/time from element. + * This is the date and time on which this content item was completed. Might be empty + * if the date and time do not differ from the content date and time, see DSRDocument. + ** @param delem DICOM element from which the date/time value should be retrieved + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check check date/time value for conformance with VR (DT) and VM (1) if + * enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setObservationDateTime(const DcmElement &delem, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set observation date/time from dataset. + * This is the date and time on which this content item was completed. Might be empty + * if the date and time do not differ from the content date and time, see DSRDocument. + ** @param dataset DICOM dataset from which the date/time value should be retrieved + * @param tagKey DICOM tag specifying the attribute from which the value should be + * retrieved. The search is limited to the top-level of the dataset. + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check check date/time value for conformance with VR (DT) and VM (1) if + * enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setObservationDateTime(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** get observation unique identifier. + * The UID represents the semantic content of the observation; an encoding of the same + * observation with the same context into another representation may use the same UID. + ** @return observation unique identifier of current content item (might be empty/invalid) + */ + inline const OFString &getObservationUID() const + { + return ObservationUID; + } + + /** set observation unique identifier. + * The UID represents the semantic content of the observation; an encoding of the same + * observation with the same context into another representation may use the same UID. + ** @param observationUID value to be set (might be an empty string) + * @param check check 'observationUID' for conformance with VR (UI) and VM (1) + * if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setObservationUID(const OFString &observationUID, + const OFBool check = OFTrue); + + /** compare template identification with given values + ** @param templateIdentifier template identifier to compare with + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional). + * Not used for comparison if the value is empty. + ** @result OFTrue if template identification is identical, OFFalse otherwise + */ + virtual OFBool compareTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "") const; + + /** get template identifier and mapping resource. + * This value pair identifies the template that was used to create this content item + * (and its children). According to the DICOM standard, it is "required if a template + * was used to define the content of this Item, and the template consists of a single + * CONTAINER with nested content, and it is the outermost invocation of a set of + * nested templates that start with the same CONTAINER." The identification is valid + * if both values are either present (non-empty) or absent (empty). + ** @param templateIdentifier identifier of the template (might be empty) + * @param mappingResource mapping resource that defines the template (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get template identifier, mapping resource and optional mapping resource UID. + * This value triple identifies the template that was used to create this content item + * (and its children). According to the DICOM standard, it is "required if a template + * was used to define the content of this Item, and the template consists of a single + * CONTAINER with nested content, and it is the outermost invocation of a set of + * nested templates that start with the same CONTAINER." The identification is valid + * if the first two values are either present (non-empty) or all three are absent (empty). + ** @param templateIdentifier identifier of the template (might be empty) + * @param mappingResource mapping resource that defines the template (might be empty) + * @param mappingResourceUID uniquely identifies the mapping resource (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource, + OFString &mappingResourceUID) const; + + /** set template identifier and mapping resource. + * The identification is valid if the first two values are either present (non-empty) or + * all three values are absent (empty). See getTemplateIdentification() for details. + * A warning message is reported to the logger if a template identification is specified + * for a content item that is not a CONTAINER. + ** @param templateIdentifier identifier of the template to be set + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional) + * @param check check 'templateIdentifier', 'mappingResource' and + * 'mappingResourceUID' for conformance with VR (CS,UI) and + * VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "", + const OFBool check = OFTrue); + + /** remove digital signatures from content item. + * This method clears the MACParametersSequence and the DigitalSignaturesSequence for + * the current content item which have been filled during reading. + */ + void removeSignatures(); + + + protected: + + /** get pointer to the concept name + ** @return pointer to the concept name (never NULL) + */ + inline DSRCodedEntryValue *getConceptNamePtr() + { + return &ConceptName; + } + + /** get pointer to previous tree node + ** @return pointer to previous tree node (might be NULL) + */ + inline DSRDocumentTreeNode *getPrev() const + { + return OFstatic_cast(DSRDocumentTreeNode *, DSRTreeNode::getPrev()); + } + + /** get pointer to next tree node + ** @return pointer to next tree node (might be NULL) + */ + inline DSRDocumentTreeNode *getNext() const + { + return OFstatic_cast(DSRDocumentTreeNode *, DSRTreeNode::getNext()); + } + + /** get pointer to first child node + ** @return pointer to first child node (might be NULL) + */ + inline DSRDocumentTreeNode *getDown() const + { + return OFstatic_cast(DSRDocumentTreeNode *, DSRTreeNode::getDown()); + } + + /** get unique identifier of this node + ** @return unique identifier of this node + */ + inline size_t getIdent() const + { + return DSRTreeNode::getIdent(); + } + + /** create a new node and append it to the current one + ** @param previousNode reference to the pointer to the previous node (sibling). + * Used to decide whether the new node is a child (value=NULL) + * or a sibling (!=NULL). NB: The value might be modified + * inside this method (to store a reference to the previous node). + * @param relationshipType relationship type of the new node with regard to the + * current one + * @param valueType value type of node to be added + * @param constraintChecker checks relationship content constraints of the associated IOD + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createAndAppendNewNode(DSRDocumentTreeNode *&previousNode, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRIODConstraintChecker *constraintChecker = NULL); + + /** read content item (value) from dataset. + * This method does nothing for this base class, but derived classes overwrite it to read + * the contents according to their value type. + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset. + * This method does nothing for this base class, but derived classes overwrite it to write + * the contents according to their value type. + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data. + * This method does nothing for this base class, but derived classes overwrite it to read + * the contents according to their value type. + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format. + * This method does nothing for this base class, but derived classes overwrite it to render + * the contents according to their value type. + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** write common item start (XML tag) + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + * @param closingBracket write closing bracket of XML start tag if OFTrue, otherwise the + * bracket has to be closed in the calling method + */ + void writeXMLItemStart(STD_NAMESPACE ostream &stream, + const size_t flags, + const OFBool closingBracket = OFTrue) const; + + /** write common item start (XML tag) + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + */ + void writeXMLItemEnd(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read SR document content module + ** @param dataset DICOM dataset from which the data should be read + * @param constraintChecker checks relationship content constraints of the associated IOD + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readSRDocumentContentModule(DcmItem &dataset, + const DSRIODConstraintChecker *constraintChecker, + const size_t flags); + + /** write SR document content module + ** @param dataset DICOM dataset to which the data should be written + * @param markedItems optional stack where pointers to all 'marked' content items + * (DICOM datasets/items) are added to during the write process. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeSRDocumentContentModule(DcmItem &dataset, + DcmStack *markedItems); + + /** read document relationship macro + ** @param dataset DICOM dataset from which the data should be read + * @param constraintChecker checks relationship content constraints of the associated IOD + * @param posString location of the current content item (e.g.\ "1.2.3") + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readDocumentRelationshipMacro(DcmItem &dataset, + const DSRIODConstraintChecker *constraintChecker, + const OFString &posString, + const size_t flags); + + /** write document relationship macro + ** @param dataset DICOM dataset to which the data should be written + * @param markedItems optional stack where pointers to all 'marked' content items + * (DICOM datasets/items) are added to during the write process. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeDocumentRelationshipMacro(DcmItem &dataset, + DcmStack *markedItems); + + /** read document content macro + ** @param dataset DICOM dataset from which the data should be read + * @param posString location of the current content item (e.g.\ "1.2.3") + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readDocumentContentMacro(DcmItem &dataset, + const OFString &posString, + const size_t flags); + + /** write document content macro + ** @param dataset DICOM dataset to which the data should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeDocumentContentMacro(DcmItem &dataset) const; + + /** read content sequence + ** @param dataset DICOM dataset from which the data should be read + * @param constraintChecker checks relationship content constraints of the associated IOD + * @param posString location of the current content item (e.g.\ "1.2.3") + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readContentSequence(DcmItem &dataset, + const DSRIODConstraintChecker *constraintChecker, + const OFString &posString, + const size_t flags); + + /** write content sequence + ** @param dataset DICOM dataset to which the data should be written + * @param markedItems optional stack where pointers to all 'marked' content items + * (DICOM datasets/items) are added to during the write process. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeContentSequence(DcmItem &dataset, + DcmStack *markedItems) const; + + /** render concept name in HTML/XHTML format. + * If the optional observation date/time field is non-empty, it is also rendered. + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition renderHTMLConceptName(STD_NAMESPACE ostream &docStream, + const size_t flags) const; + + /** render child nodes in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition renderHTMLChildNodes(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + // --- static function --- + + /** convert relationship type into a text used for HTML rendering + ** @param relationshipType type of relationship to be converted + * @param relationshipText reference to string variable where the resulting text should be + * stored. Value is cleared if 'relationshipType' is invalid or not + * supported. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return reference to the 'relationshipText' string (might be empty) + */ + static const OFString &getRelationshipText(const E_RelationshipType relationshipType, + OFString &relationshipText, + const size_t flags); + + /** check the specified template identification values for validity. + * The identification is valid if the first two values are either present (non-empty) or + * absent (empty). In the latter case, the third (optional) parameter also has to be empty. + ** @param templateIdentifier identifier of the template + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional) + ** @return OFTrue if template identification is valid, OFFalse otherwise + */ + static OFBool checkTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID); + + + private: + + /// flag indicating whether the content item is marked (e.g.\ used for digital signatures). + /// The default value is OFFalse. + OFBool MarkFlag; + /// flag indicating whether the content item is referenced (by-reference relationship). + /// The default value is OFFalse. + OFBool ReferenceTarget; + + /// relationship type to the parent node (associated DICOM VR=CS, mandatory) + E_RelationshipType RelationshipType; + /// value type (associated DICOM VR=CS, mandatory) + const E_ValueType ValueType; + + /// concept name (VR=SQ, conditional) + DSRCodedEntryValue ConceptName; + /// observation date/time (VR=DT, conditional) + OFString ObservationDateTime; + /// observation unique identifier (VR=UI, optional) + OFString ObservationUID; + + /// template identifier (VR=CS, mandatory in ContentTemplateSequence) + OFString TemplateIdentifier; + /// mapping resource (VR=CS, mandatory in ContentTemplateSequence) + OFString MappingResource; + /// mapping resource UID (VR=UI, optional in ContentTemplateSequence) + OFString MappingResourceUID; + + /// MAC parameters sequence (VR=SQ, optional) + DcmSequenceOfItems MACParameters; + /// digital signatures sequence (VR=SQ, optional) + DcmSequenceOfItems DigitalSignatures; + + // --- declaration of default constructor and assignment operator + + DSRDocumentTreeNode(); + DSRDocumentTreeNode &operator=(const DSRDocumentTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdoctr.h b/dcmsr/include/dcmtk/dcmsr/dsrdoctr.h new file mode 100644 index 00000000..8629002f --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdoctr.h @@ -0,0 +1,265 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentTree + * + */ + + +#ifndef DSRDOCTR_H +#define DSRDOCTR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdocst.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class managing the SR document tree. + * This tree structure consists of content items (nodes) that are related to each other. + * It is called "SR Document Content Tree" in the DICOM standard. There is always a + * single node at the root, which has the value type CONTAINER. Depending on the + * document type, certain restrictions apply on which value and relationship types are + * allowed. The rules are specified and checked by a so-called IOD constraint checker. + */ +class DCMTK_DCMSR_EXPORT DSRDocumentTree + : public DSRDocumentSubTree +{ + + public: + + /** constructor + ** @param documentType document type of the associated document + */ + DSRDocumentTree(const E_DocumentType documentType); + + /** copy constructor. + * Please note that the internal cursor is not copied but reset, i.e. set to the + * root node. + ** @param tree tree to be copied + */ + DSRDocumentTree(const DSRDocumentTree &tree); + + /** destructor + */ + virtual ~DSRDocumentTree(); + + /** assignment operator. + * Please note that internally the copy constructor is used, so the same comments + * apply. + ** @param tree tree to be copied + ** @return reference to this tree after copying + */ + DSRDocumentTree &operator=(DSRDocumentTree tree); + + /** clone this tree. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree + */ + virtual DSRDocumentTree *clone() const; + + /** clear internal member variables. + * The document type is not changed (e.g. set to DSRTypes::DT_invalid). + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * The SR document tree is valid if the document type is supported, the tree is + * not empty, the root item is a container and has the internal relationship type + * DSRTypes::RT_isRoot. Also see DSRDocumentSubTree::isValidDocumentTree(). + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** print current SR document tree to specified output stream + ** @param stream output stream + * @param flags optional flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0); + + /** read SR document tree from DICOM dataset. + * Please note that the current document tree is also deleted if the reading fails. + * If logging is enabled, the reason for any error might be obtained from the + * error/warning output. + ** @param dataset reference to DICOM dataset where the tree should be read from + * @param documentType document type of the SR document from which the tree is read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset, + const E_DocumentType documentType, + const size_t flags = 0); + + /** write current SR document tree to DICOM dataset. + * Please note that included (non-expanded) sub-templates are not supported. + ** @param dataset reference to DICOM dataset where the current tree should be + * written to. The 'dataset' is not cleared before writing to it! + * @param markedItems optional stack where pointers to all 'marked' content items + * (DICOM datasets/items) are added to during the write process. + * Can be used to digitally sign parts of the document tree. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset, + DcmStack *markedItems = NULL); + + /** read XML document tree + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render current SR document tree in HTML/XHTML format. + * Please note that included (non-expanded) sub-templates are not supported. + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param flags optional flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t flags = 0); + + /** get document type + ** @return current document type (might be DSRTypes::DT_invalid) + */ + inline E_DocumentType getDocumentType() const + { + return DocumentType; + } + + /** change document type. + * First, it is checked whether the specified 'documentType' is supported at all. If so, + * the currently stored document tree is either deleted (see 'deleteTree' parameter) or + * it is checked whether the tree also complies with the relationship content constraints + * of the new SR IOD. Otherwise the current document remains in force. + * Please note that the 'documentType' is not compared with the type of the currently + * stored document tree, i.e. the above described process is always performed, even if + * the document type does not change. + ** @param documentType new document type to be set (should not be DSRTypes::DT_invalid) + * @param deleteTree delete the currently stored document tree if OFTrue. + * Otherwise, it is checked whether the tree can be preserved. + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition changeDocumentType(const E_DocumentType documentType, + const OFBool deleteTree); + + /** check whether specified content item can be added to the current one. + * This method can be used to decide which type of content items can be added prior + * to really doing so. + * If the tree is currently empty, only a CONTAINER with the internal relationship + * type DSRTypes::RT_isRoot is allowed (as the new root node). Always returns true + * if no constraint checker is available but 'relationshipType' and 'valueType' have + * valid values. + ** @param relationshipType relationship type of node to be checked with regard + * to the current one + * @param valueType value type of node to be checked + * @param addMode flag specifying at which position the new node would + * be added (e.g. after or below the current node) + ** @return OFTrue if specified node can be added, OFFalse otherwise + */ + virtual OFBool canAddContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const E_AddMode addMode = AM_afterCurrent) const; + + /** check whether specified subtree can be inserted at the current position, i.e.\ added + * to the current content item. + * If this tree is currently empty, only a CONTAINER with the internal relationship + * type DSRTypes::RT_isRoot is allowed as the new root node (of the given subtree). + * In all other cases, the method DSRDocumentSubTree::canInsertSubTree() is called. + ** @param tree pointer to new subtree to be inserted (should not be empty) + * @param addMode flag specifying at which position the new subtree would + * be added (e.g. after or below the current node) + * @param defaultRelType default relationship type between the top-level nodes of + * the given subtree and the current node. This relationship + * type is used if the one of a top-level node is "unknown". + ** @return OFTrue if specified subtree can be inserted, OFFalse otherwise + */ + virtual OFBool canInsertSubTree(const DSRDocumentSubTree *tree, + const E_AddMode addMode = AM_belowCurrent, + const E_RelationshipType defaultRelType = RT_unknown) const; + + /** check whether the document tree complies with the constraints of the given checker. + * This method also checks whether the currently stored document tree is either empty + * or valid, and whether the template identification of the root node (if any) is as + * expected. However, the latter only results in a warning message to the logger. + ** @param checker pointer to relationship content constraints checker to be used + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition checkDocumentTreeConstraints(DSRIODConstraintChecker *checker); + + /** unmark all content items in the document tree. + * Use method DSRDocumentTreeNode::setMark() to mark and unmark a single content item. + * Pointers to the DICOM dataset/item of marked content items are added to the optional + * stack when calling the DSRDocument::write() method. This mechanism can e.g. be used + * to digitally sign particular content items. + */ + void unmarkAllContentItems(); + + /** remove digital signatures from the document tree. + * This method clears the MACParametersSequence and the DigitalSignaturesSequence for + * all content items which have been filled during reading. + */ + void removeSignatures(); + + + protected: + + /** fast, non-throwing swap function. + * The time complexity of this function is constant. + ** @param tree tree to swap with + */ + void swap(DSRDocumentTree &tree); + + /** print current SR document tree to specified output stream. + * This method is only needed to avoid compiler warnings regarding an "overloaded + * virtual function" hiding DSRDocumentSubTree::print() from the base class, which + * has different parameters than the public print() method of this class. + ** @param stream output stream + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param posCounter pointer to position counter that should be used to initialize + * the counter for line indentation or numbering of nested + * content items + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags, + const DSRPositionCounter *posCounter); + + + private: + + /// document type of the associated SR document + E_DocumentType DocumentType; + + + // --- declaration of default constructor + + DSRDocumentTree(); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrdtitn.h b/dcmsr/include/dcmtk/dcmsr/dsrdtitn.h new file mode 100644 index 00000000..631b353b --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrdtitn.h @@ -0,0 +1,208 @@ +/* + * + * Copyright (C) 2000-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDateTimeTreeNode + * + */ + + +#ifndef DSRDTITN_H +#define DSRDTITN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrstrvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item DATETIME + */ +class DCMTK_DCMSR_EXPORT DSRDateTimeTreeNode + : public DSRDocumentTreeNode, + public DSRStringValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRDateTimeTreeNode(const E_RelationshipType relationshipType); + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param dateTimeValue initial value to be set (VR=DT, mandatory) + * @param check if enabled, check 'dateTimeValue' for validity before setting + * it. See checkValue() for details. An empty value is never + * accepted. + */ + DSRDateTimeTreeNode(const E_RelationshipType relationshipType, + const OFString &dateTimeValue, + const OFBool check = OFTrue); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRDateTimeTreeNode(const DSRDateTimeTreeNode &node); + + /** destructor + */ + virtual ~DSRDateTimeTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRDateTimeTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base classes, the concept name and the currently stored + * value (see hasValidValue()) are valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the stored date/time value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: contains DATETIME:(,,"Code")="2000101012000000" + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format. Uses ISO formatted date/time value. + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + // --- static helper function --- + + /** get DICOM date/time value from given XML element. + * The DICOM DateTime (DT) value is expected to be stored in ISO format as created by + * writeXML(). + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the corresponding node + * @param dateTimeValue reference to string object in which the value should be stored + * @param clearString flag specifying whether to clear the 'dateTimeValue' or not + ** @return reference to string object (might be empty) + */ + static OFString &getValueFromXMLNodeContent(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + OFString &dateTimeValue, + const OFBool clearString = OFTrue); + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** check the specified date/time value for validity. + * In addition to the base class check for a non-empty value, this method also checks + * whether the given value conforms to the corresponding VR (DT) and VM (1). + ** @param dateTimeValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &dateTimeValue) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRDateTimeTreeNode(); + DSRDateTimeTreeNode &operator=(const DSRDateTimeTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrenhcc.h b/dcmsr/include/dcmtk/dcmsr/dsrenhcc.h new file mode 100644 index 00000000..86b3c282 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrenhcc.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2003-2014, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSREnhancedSRConstraintChecker + * + */ + + +#ifndef DSRENHCC_H +#define DSRENHCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Enhanced SR IOD + */ +class DCMTK_DCMSR_EXPORT DSREnhancedSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSREnhancedSRConstraintChecker(); + + /** destructor + */ + virtual ~DSREnhancedSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_EnhancedSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrimgfr.h b/dcmsr/include/dcmtk/dcmsr/dsrimgfr.h new file mode 100644 index 00000000..7c6f0aa2 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrimgfr.h @@ -0,0 +1,99 @@ +/* + * + * Copyright (C) 2000-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRImageFrameList + * + */ + + +#ifndef DSRIMGFR_H +#define DSRIMGFR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for image frame number list + */ +class DCMTK_DCMSR_EXPORT DSRImageFrameList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRImageFrameList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRImageFrameList(const DSRImageFrameList &lst); + + /** destructor + */ + virtual ~DSRImageFrameList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRImageFrameList &operator=(const DSRImageFrameList &lst); + + /** print list of referenced frame numbers. + * The output of a typical list looks like this: 1,2,3 or 1,... if shortened. + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param separator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char separator = ',') const; + + /** read list of referenced frame numbers + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of referenced frame numbers + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** put list of referenced frame numbers as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of numerical values. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrimgse.h b/dcmsr/include/dcmtk/dcmsr/dsrimgse.h new file mode 100644 index 00000000..5602d879 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrimgse.h @@ -0,0 +1,99 @@ +/* + * + * Copyright (C) 2013-2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRImageSegmentList + * + */ + + +#ifndef DSRIMGSE_H +#define DSRIMGSE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for image segment number list + */ +class DCMTK_DCMSR_EXPORT DSRImageSegmentList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRImageSegmentList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRImageSegmentList(const DSRImageSegmentList &lst); + + /** destructor + */ + virtual ~DSRImageSegmentList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRImageSegmentList &operator=(const DSRImageSegmentList &lst); + + /** print list of referenced segment numbers. + * The output of a typical list looks like this: 1,2,3 or 1,... if shortened. + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param separator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char separator = ',') const; + + /** read list of referenced segment numbers + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of referenced segment numbers + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** put list of referenced segment numbers as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of numerical values. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrimgtn.h b/dcmsr/include/dcmtk/dcmsr/dsrimgtn.h new file mode 100644 index 00000000..98573b34 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrimgtn.h @@ -0,0 +1,183 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRImageTreeNode + * + */ + + +#ifndef DSRIMGTN_H +#define DSRIMGTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrimgvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item IMAGE + */ +class DCMTK_DCMSR_EXPORT DSRImageTreeNode + : public DSRDocumentTreeNode, + public DSRImageReferenceValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRImageTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRImageTreeNode(const DSRImageTreeNode &node); + + /** destructor + */ + virtual ~DSRImageTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRImageTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes are valid. This check includes the value + * of the content item, which can also be checked separately with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the image reference value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * The method isShort() from the base class DSRImageReferenceValue is called. + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: contains IMAGE:=(CT image,"1.2.3") or + * (CT image,"1.2.3"),(GSPS,"1.2.3.4") if a presentation state is present. + * If the SOP class UID is unknown, the UID is printed instead of the related name. + * Also, the list of referenced frame numbers is shown, but not the UIDs of the + * real world value mapping object (if referenced). + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRImageTreeNode(); + DSRImageTreeNode &operator=(const DSRImageTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrimgvl.h b/dcmsr/include/dcmtk/dcmsr/dsrimgvl.h new file mode 100644 index 00000000..20e7a3c1 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrimgvl.h @@ -0,0 +1,507 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRImageReferenceValue + * + */ + + +#ifndef DSRIMGVL_H +#define DSRIMGVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcomvl.h" +#include "dcmtk/dcmsr/dsrimgfr.h" +#include "dcmtk/dcmsr/dsrimgse.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DicomImage; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for image reference values + */ +class DCMTK_DCMSR_EXPORT DSRImageReferenceValue + : public DSRCompositeReferenceValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRImageReferenceValue(); + + /** constructor. Accepts reference to an image object. + ** @param sopClassUID referenced SOP class UID of the image object. + * (VR=UI, mandatory) + * @param sopInstanceUID referenced SOP instance UID of the image object. + * (VR=UI, mandatory) + * @param check if enabled, check 'sopClassUID' and 'sopInstanceUID' for + * validity before setting them. See checkXXX() for details. + * Empty values are never accepted. + */ + DSRImageReferenceValue(const OFString &sopClassUID, + const OFString &sopInstanceUID, + const OFBool check = OFTrue); + + /** constructor. Accepts reference to both an image and presentation state object. + ** @param imageSOPClassUID referenced SOP class UID of the image object. + * (VR=UI, mandatory) + * @param imageSOPInstanceUID referenced SOP instance UID of the image object. + * (VR=UI, mandatory) + * @param pstateSOPClassUID referenced SOP class UID of the presentation state + * object. (VR=UI, optional) + * @param pstateSOPInstanceUID referenced SOP instance UID of the presentation state + * object. (VR=UI, optional) + * @param check if enabled, check all four UID values for validity + * before setting them. See checkXXX() for details. + * Empty values are never accepted. + */ + DSRImageReferenceValue(const OFString &imageSOPClassUID, + const OFString &imageSOPInstanceUID, + const OFString &pstateSOPClassUID, + const OFString &pstateSOPInstanceUID, + const OFBool check = OFTrue); + + /** copy constructor + ** @param referenceValue image reference value to be copied (not checked !) + */ + DSRImageReferenceValue(const DSRImageReferenceValue &referenceValue); + + /** copy constructor + ** @param imageReferenceValue reference to image object to be copied (not checked !) + * @param pstateReferenceValue reference to presentation state object to be copied + * (not checked !) + */ + DSRImageReferenceValue(const DSRCompositeReferenceValue &imageReferenceValue, + const DSRCompositeReferenceValue &pstateReferenceValue); + + /** destructor + */ + virtual ~DSRImageReferenceValue(); + + /** assignment operator + ** @param referenceValue image reference value to be copied (not checked !) + ** @return reference to this image reference value after 'referenceValue' has been copied + */ + DSRImageReferenceValue &operator=(const DSRImageReferenceValue &referenceValue); + + /** comparison operator "equal". + * Please note that the optional icon image is not used for comparing the two values. + ** @param referenceValue image reference value that should be compared to the current one + ** @return OFTrue if both image reference values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRImageReferenceValue &referenceValue) const; + + /** comparison operator "not equal". + * Please note that the optional icon image is not used for comparing the two values. + ** @param referenceValue image reference value that should be compared to the current one + ** @return OFTrue if both image reference values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRImageReferenceValue &referenceValue) const; + + /** clear all internal variables. + * Since an empty image reference is invalid the reference becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the current image reference value is valid. + * The reference value is valid if both SOP class UID and SOP instance UID are valid (see + * checkSOPClassUID() and checkSOPInstanceUID() for details), as well as the optional + * presentation state and real world value mapping objects (see checkPresentationState() + * and checkRealWorldValueMapping(), respectively). Also the presence of the optional + * list of frame and segment numbers is checked using checkListData(). + ** @return OFTrue if reference value is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the content is short. + * This method is used to check whether the rendered output of this content item can be + * expanded inline or not (used for renderHTML()). + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** check whether the current image reference points to a DICOM segmentation object + ** @return OFTrue if a segmentation object is referenced, OFFalse otherwise + */ + virtual OFBool isSegmentation() const; + + /** print image reference. + * The output of a typical image reference value looks like this: (CT image,"1.2.3") or + * (CT image,"1.2.3"),(GSPS,"1.2.3.4") if a presentation state is present. + * If the SOP class UID is unknown, the UID is printed instead of the related name. + * Also, the list of referenced frame/segment numbers is shown, but not the two UIDs of + * the real world value mapping object (if referenced). + ** @param stream output stream to which the image reference value should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read image reference from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write image reference in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render image reference value in HTML/XHTML format. + * Please note that the optional icon image is never shown in the rendered output. + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param annexNumber reference to the variable where the current annex number is + * stored. Value is increased automatically by 1 after a new entry + * has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + size_t &annexNumber, + const size_t flags) const; + + /** create an icon image from the given DICOM image and associate it with this image + * reference. + * According to the DICOM standard, this icon image should be representative of the + * referenced image and the size of the icon image "may be no greater than 128 rows by + * 128 columns". For monochrome images, either the first stored or an automatically + * computed min-max VOI window is selected. Color images are converted automatically to + * the photometric interpretation "PALETTE COLOR" (with 256 colors) when written to the + * DICOM dataset. + * Please note that this icon image is only used in readItem() and writeItem() but not + * in the other input/output methods. + ** @param filename name of the DICOM image file to be used to create the icon image + * @param frame number of the frame to be used to create the icon image + * (0 = 1st frame) + * @param width width of the icon image (in pixels). If 0 this value will be + * calculated automatically based on the given 'height'. + * @param height height of the icon image (in pixels). If 0 this value will be + * calculated automatically based on the given 'width'. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createIconImage(const OFString &filename, + const unsigned long frame = 0, + const unsigned long width = 64, + const unsigned long height = 64); + + /** create an icon image from the given DICOM image and associate it with this image + * reference. + * According to the DICOM standard, this icon image should be representative of the + * referenced image and the size of the icon image "may be no greater than 128 rows by + * 128 columns". For monochrome images, either the first stored or an automatically + * computed min-max VOI window is selected. Color images are converted automatically to + * the photometric interpretation "PALETTE COLOR" (with 256 colors) when written to the + * DICOM dataset. + * Please note that this icon image is only used in readItem() and writeItem() but not + * in the other input/output methods. + ** @param object pointer to DICOM data structures (fileformat, dataset or item) that + * contain the DICOM image to be used to create the icon image + * @param xfer transfer syntax of the 'object'. In case of a fileformat or dataset, + * the value EXS_Unknown is also allowed. + * @param frame number of the frame to be used to create the icon image (0 = 1st frame) + * @param width width of the icon image (in pixels). If 0 this value will be + * calculated automatically based on the given 'height'. + * @param height height of the icon image (in pixels). If 0 this value will be + * calculated automatically based on the given 'width'. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createIconImage(DcmObject *object, + const E_TransferSyntax xfer = EXS_Unknown, + const unsigned long frame = 0, + const unsigned long width = 64, + const unsigned long height = 64); + + /** create an icon image from the given DICOM image and associate it with this image + * reference. + * According to the DICOM standard, this icon image should be representative of the + * referenced image and the size of the icon image "may be no greater than 128 rows by + * 128 columns". Color images are converted automatically to the photometric + * interpretation "PALETTE COLOR" (with 256 colors) when written to the DICOM dataset. + * Please note that this icon image is only used in readItem() and writeItem() but not + * in the other input/output methods. + ** @param image pointer to DICOM image to be used to create the icon image. Only + * single frame images should be passed since only the first frame is + * used. + * @param width width of the icon image (in pixels). If 0 this value will be + * calculated automatically based on the given 'height'. + * @param height height of the icon image (in pixels). If 0 this value will be + * calculated automatically based on the given 'width'. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition createIconImage(const DicomImage *image, + const unsigned long width = 64, + const unsigned long height = 64); + + /** delete the currently stored icon image, i.e.\ free the associated memory and "forget" + * the internal reference to it + */ + void deleteIconImage(); + + /** get reference to icon image associated with this image reference value (if any). + * Please note that the icon image might be invalid even if the pointer is not NULL. + * Therefore, the DicomImage::getStatus() method should always be called to check the + * status of the image. + ** @return reference to icon image or NULL if none is present + */ + const DicomImage *getIconImage() const + { + return IconImage; + } + + /** get reference to image reference value + ** @return reference to image reference value + */ + inline const DSRImageReferenceValue &getValue() const + { + return *this; + } + + /** get copy of image reference value + ** @param referenceValue reference to variable in which the value should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValue(DSRImageReferenceValue &referenceValue) const; + + /** set image reference value. + * Before setting the reference, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param referenceValue value to be set + * @param check if enabled, check value for validity before setting it. + * See checkXXX() for details. Empty values are never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRImageReferenceValue &referenceValue, + const OFBool check = OFTrue); + + /** get reference to presentation state object + ** @return reference to presentation state object (might be empty or invalid) + */ + inline const DSRCompositeReferenceValue &getPresentationState() const + { + return PresentationState; + } + + /** set reference to presentation state object. + * Before setting the reference, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param pstateValue value to be set + * @param check If enabled, check value for validity before setting it. See + * checkPresentationState() for details. Empty UID values are + * accepted for disabling the optional presentation state. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPresentationState(const DSRCompositeReferenceValue &pstateValue, + const OFBool check = OFTrue); + + /** get reference to real world value mapping object + ** @return reference to real world value mapping object (might be empty or invalid) + */ + inline const DSRCompositeReferenceValue &getRealWorldValueMapping() const + { + return RealWorldValueMapping; + } + + /** set reference to real world value mapping object. + * Before setting the reference, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param mappingValue value to be set + * @param check If enabled, check value for validity before setting it. See + * checkRealWorldValueMapping() for details. Empty UID values + * are accepted for disabling the optional presentation state. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRealWorldValueMapping(const DSRCompositeReferenceValue &mappingValue, + const OFBool check = OFTrue); + + /** get reference to list of referenced frame numbers. + * According to the DICOM standard, this list is required if the referenced image has + * multiple frames, and the reference does not apply to all frames and the list of + * referenced segment numbers is empty/absent. + ** @return reference to frame list + */ + inline DSRImageFrameList &getFrameList() + { + return FrameList; + } + + /** get read-only access to list of referenced frame numbers + ** @return constant reference to frame list + */ + inline const DSRImageFrameList &getFrameList() const + { + return FrameList; + } + + /** get reference to list of referenced segment numbers. + * According to the DICOM standard, this list is required if the referenced image is + * a segmentation object, and the reference does not apply to all segments and the list + * of referenced frame numbers is empty/absent. + ** @return reference to segment list + */ + inline DSRImageSegmentList &getSegmentList() + { + return SegmentList; + } + + /** get read-only access to list of referenced segment numbers + ** @return constant reference to segment list + */ + inline const DSRImageSegmentList &getSegmentList() const + { + return SegmentList; + } + + /** check whether the image reference applies to a specific frame. + * The image reference applies to a frame (of multiframe images) if the list of + * referenced frame numbers is empty or the frame number is part of the list. + ** @param frameNumber number of the frame to be checked + ** @return OFTrue if reference applies to the specified frame, OFFalse otherwise + */ + OFBool appliesToFrame(const Sint32 frameNumber) const; + + /** check whether the image reference applies to a specific segment. + * The image reference applies to a segment (of a segmentation image) if the list of + * referenced segment numbers is empty or the segment number is part of the list. + ** @param segmentNumber number of the segment to be checked + ** @return OFTrue if reference applies to the specified segment, OFFalse otherwise + */ + OFBool appliesToSegment(const Uint16 segmentNumber) const; + + + protected: + + /** get pointer to image reference value + ** @return pointer to image reference value (never NULL) + */ + inline DSRImageReferenceValue *getValuePtr() + { + return this; + } + + /** read image reference value from dataset + ** @param dataset DICOM dataset from which the value should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readItem(DcmItem &dataset, + const size_t flags); + + /** write image reference value to dataset + ** @param dataset DICOM dataset to which the value should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeItem(DcmItem &dataset) const; + + /** check whether the given SOP class UID refers to a DICOM segmentation object + ** @param sopClassUID SOP class UID to be checked + ** @return OFTrue if the UID refers to a segmentation object, OFFalse otherwise + */ + virtual OFBool isSegmentationObject(const OFString &sopClassUID) const; + + /** check the specified SOP class UID for validity. + * This method further specializes the checks performed in the base class + * DSRCompositeReferenceValue. All image and segmentation SOP classes that + * are defined in DICOM PS 3.6-2017e are allowed. + ** @param sopClassUID SOP class UID to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkSOPClassUID(const OFString &sopClassUID) const; + + /** check the given reference to a presentation state object for validity. + * The reference is "valid" if both UIDs are empty or both are not empty and + * SOP class UID refers to a softcopy presentation state object (see + * DSRTypes::E_PresentationStateType for a list of supported SOP classes). + ** @param referenceValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkPresentationState(const DSRCompositeReferenceValue &referenceValue) const; + + /** check the given reference to a real world value mapping object for validity. + * The reference is "valid" if both UIDs are empty or both are not empty and + * SOP class UID refers to the "Real World Value Mapping Storage SOP Class". + ** @param referenceValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkRealWorldValueMapping(const DSRCompositeReferenceValue &referenceValue) const; + + /** check the given list of frame and segment numbers for validity. + * Either both lists have to be empty or only one of them has to be non-empty, + * because otherwise the "type 1C" condition would be violated. Also the list + * of segment numbers should only be non-empty for one of the DICOM segmentation + * objects (see isSegmentationObject()). + ** @param sopClassUID SOP class UID of the image object to be checked + * @param frameList list of referenced frame numbers to be checked + * @param segmentList list of referenced segment numbers to be checked + * @param reportWarnings if enabled, report a warning message on each deviation + * from an expected value to the logger + ** @return status, EC_Normal if checked data is valid, an error code otherwise + */ + OFCondition checkListData(const OFString &sopClassUID, + const DSRImageFrameList &frameList, + const DSRImageSegmentList &segmentList, + const OFBool reportWarnings = OFFalse) const; + + /** check the currently stored image reference value for validity. + * See above checkXXX() methods and DSRCompositeReferenceValue::checkCurrentValue() + * for details. + ** @return status, EC_Normal if current value is valid, an error code otherwise + */ + OFCondition checkCurrentValue() const; + + + private: + + /// list of referenced frame numbers (associated DICOM VR=IS, VM=1-n, type 1C) + DSRImageFrameList FrameList; + /// list of referenced segment numbers (associated DICOM VR=US, VM=1-n, type 1C) + DSRImageSegmentList SegmentList; + /// composite reference value (UIDs) to presentation state object (optional) + DSRCompositeReferenceValue PresentationState; + /// composite reference value (UIDs) to real world value mapping object (optional) + DSRCompositeReferenceValue RealWorldValueMapping; + /// icon image from Icon Image Sequence (optional) + DicomImage *IconImage; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrimpcc.h b/dcmsr/include/dcmtk/dcmsr/dsrimpcc.h new file mode 100644 index 00000000..5c72fe9b --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrimpcc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2010-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRImplantationPlanSRDocumentConstraintChecker + * + */ + + +#ifndef DSRIMPCC_H +#define DSRIMPCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Implantation Plan + * SR Document IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 7000 + * (Implantation Plan) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRImplantationPlanSRDocumentConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRImplantationPlanSRDocumentConstraintChecker(); + + /** destructor + */ + virtual ~DSRImplantationPlanSRDocumentConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_ImplantationPlanSRDocument) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsriodcc.h b/dcmsr/include/dcmtk/dcmsr/dsriodcc.h new file mode 100644 index 00000000..fd137814 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsriodcc.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRIODConstraintChecker + * + */ + + +#ifndef DSRIODCC_H +#define DSRIODCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of an SR IOD (abstract) + */ +class DCMTK_DCMSR_EXPORT DSRIODConstraintChecker + : public DSRTypes +{ + + public: + + /** default constructor + */ + DSRIODConstraintChecker(); + + /** destructor + */ + virtual ~DSRIODConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD (abstract) + ** @return OFTrue if by-reference relationships are allowed, OFFalse otherwise + */ + virtual OFBool isByReferenceAllowed() const = 0; + + /** check whether this SR IOD requires template support (abstract) + ** @return OFTrue if template support is required, OFFalse otherwise + */ + virtual OFBool isTemplateSupportRequired() const = 0; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const = 0; + + /** get the associated document type of the SR IOD (abstract) + ** @return document type (see DSRTypes::E_DocumentType) + */ + virtual E_DocumentType getDocumentType() const = 0; + + /** check whether specified content relationship is allowed for this IOD (abstract) + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const = 0; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsritcsr.h b/dcmsr/include/dcmtk/dcmsr/dsritcsr.h new file mode 100644 index 00000000..a8e64a88 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsritcsr.h @@ -0,0 +1,111 @@ +/* + * + * Copyright (C) 2016-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRIncludedTemplateNodeCursor + * + */ + + +#ifndef DSRITCSR_H +#define DSRITCSR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsdefine.h" +#include "dcmtk/dcmsr/dsrtncsr.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class implementing a document tree node cursor. + * This type of cursor also supports included sub-templates, i.e. the subtree that is + * managed by an instance of DSRIncludedTemplateTreeNode is also iterated. + */ +class DCMTK_DCMSR_EXPORT DSRIncludedTemplateNodeCursor + : public DSRTreeNodeCursor +{ + + public: + + /** default constructor + */ + DSRIncludedTemplateNodeCursor(); + + /** copy constructor + ** @param cursor object to be copied + */ + DSRIncludedTemplateNodeCursor(const DSRIncludedTemplateNodeCursor &cursor); + + /** constructor. + * See comments on DSRTreeNodeCursor<>::setCursor() method. + ** @param node pointer to tree node used to initialize the cursor + * @param position optional pointer to position counter that should be used to + * initialize the internal counter + */ + DSRIncludedTemplateNodeCursor(DSRDocumentTreeNode *node, + const DSRPositionCounter *position = NULL); + + /** destructor + */ + virtual ~DSRIncludedTemplateNodeCursor(); + + /** assignment operator + ** @param cursor object to be copied + ** @return reference to modified cursor (this object) + */ + DSRIncludedTemplateNodeCursor &operator=(const DSRIncludedTemplateNodeCursor &cursor); + + /** assignment operator. + * See comments on DSRTreeNodeCursor<>::setCursor() method. + ** @param node node to which the cursor should be set + ** @return reference to modified cursor (this object) + */ + DSRIncludedTemplateNodeCursor &operator=(DSRDocumentTreeNode *node); + + /** get pointer to first child node. + * Can be used to have a lookup to the first child node without changing the cursor. + ** @return pointer to first child node (if any), NULL otherwise + */ + virtual const DSRDocumentTreeNode *getChildNode() const; + + /** count number of children of the current node. + * This method iterates over all children of the current node, either on all + * sub-levels or on the first child level only. + ** @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the first child level only + ** @return number of children of the current node, 0 if none + */ + virtual size_t countChildNodes(const OFBool searchIntoSub = OFTrue) const; + + /** goto first child node (one level down) + ** @return ID of the first child node if successful, 0 otherwise + */ + virtual size_t goDown(); + + /** iterate over all nodes (starting from current position) + ** @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the next node if successful, 0 otherwise + */ + virtual size_t iterate(const OFBool searchIntoSub = OFTrue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrkeycc.h b/dcmsr/include/dcmtk/dcmsr/dsrkeycc.h new file mode 100644 index 00000000..4ad28360 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrkeycc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRKeyObjectSelectionDocumentConstraintChecker + * + */ + + +#ifndef DSRKEYCC_H +#define DSRKEYCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Key Object + * Selection Document IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 2010 + * (Key Object Selection) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRKeyObjectSelectionDocumentConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRKeyObjectSelectionDocumentConstraintChecker(); + + /** destructor + */ + virtual ~DSRKeyObjectSelectionDocumentConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_KeyObjectSelectionDocument) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrmaccc.h b/dcmsr/include/dcmtk/dcmsr/dsrmaccc.h new file mode 100644 index 00000000..66c742ba --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrmaccc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2010-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRMacularGridThicknessAndVolumeReportConstraintChecker + * + */ + + +#ifndef DSRMACCC_H +#define DSRMACCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Macular Grid + * Thickness And Volume Report IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 2100 + * (Macular Grid Thickness and Volume Report) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRMacularGridThicknessAndVolumeReportConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRMacularGridThicknessAndVolumeReportConstraintChecker(); + + /** destructor + */ + virtual ~DSRMacularGridThicknessAndVolumeReportConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_MacularGridThicknessAndVolumeReport) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrmamcc.h b/dcmsr/include/dcmtk/dcmsr/dsrmamcc.h new file mode 100644 index 00000000..7335f370 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrmamcc.h @@ -0,0 +1,96 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRMammographyCadSRConstraintChecker + * + */ + + +#ifndef DSRMAMCC_H +#define DSRMAMCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Mammography CAD SR + * IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 4000 + * (Mammography CAD Document Root) invoked at the root node. When a content item + * sub-tree from a prior document is duplicated by-value, its observation context + * shall be defined by TID 1001 (Observation Context) and its subordinate templates." + */ +class DCMTK_DCMSR_EXPORT DSRMammographyCadSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRMammographyCadSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRMammographyCadSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFTrue, i.e. by-reference relationships are allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_MammographyCadSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrnumtn.h b/dcmsr/include/dcmtk/dcmsr/dsrnumtn.h new file mode 100644 index 00000000..d0e11d3d --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrnumtn.h @@ -0,0 +1,174 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRNumTreeNode + * + */ + + +#ifndef DSRNUMTN_H +#define DSRNUMTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrnumvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item NUM + */ +class DCMTK_DCMSR_EXPORT DSRNumTreeNode + : public DSRDocumentTreeNode, + public DSRNumericMeasurementValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRNumTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRNumTreeNode(const DSRNumTreeNode &node); + + /** destructor + */ + virtual ~DSRNumTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRNumTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes and the concept name are valid. + * This check includes the value of the content item, which can also be checked separately + * with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the numeric measurement value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: contains NUM:(,,"Diameter")="3" (cm,99_OFFIS_DCMTK, + * "Length Unit") + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRNumTreeNode(); + DSRNumTreeNode &operator=(const DSRNumTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrnumvl.h b/dcmsr/include/dcmtk/dcmsr/dsrnumvl.h new file mode 100644 index 00000000..6ac6812b --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrnumvl.h @@ -0,0 +1,565 @@ +/* + * + * Copyright (C) 2000-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRNumericMeasurementValue + * + */ + + +#ifndef DSRNUMVL_H +#define DSRNUMVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcodvl.h" + +#include "dcmtk/dcmdata/dcvrfd.h" +#include "dcmtk/dcmdata/dcvrsl.h" +#include "dcmtk/dcmdata/dcvrul.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for numeric values and measurements + */ +class DCMTK_DCMSR_EXPORT DSRNumericMeasurementValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRNumericMeasurementValue(); + + /** constructor + ** @param numericValue numeric value (VR=DS, mandatory) + * @param measurementUnit code representing the units of measurement (mandatory) + * @param check if enabled, check 'numericValue' and 'measurementUnit' for + * validity before setting them. See corresponding setValue() + * method for details. + */ + DSRNumericMeasurementValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const OFBool check = OFTrue); + + /** constructor + ** @param valueQualifier code representing the numeric value qualifier. Used to + * specify the reason for the absence of the measured value + * sequence, i.e. why the numeric value and measurement unit + * are empty. + * @param check if enabled, check value for validity before setting it. + * See corresponding setValue() method for details. + */ + DSRNumericMeasurementValue(const DSRCodedEntryValue &valueQualifier, + const OFBool check = OFTrue); + + /** constructor + ** @param numericValue numeric value (VR=DS, mandatory) + * @param measurementUnit code representing the units of measurement (mandatory) + * @param valueQualifier code representing the numeric value qualifier (optional). + * Can also be used to specify the reason for the absence of + * the measured value sequence (where 'numericValue' and + * 'measurementUnit' are stored). + * @param check if enabled, check values for validity before setting them. + * See corresponding setValue() method for details. + */ + DSRNumericMeasurementValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const DSRCodedEntryValue &valueQualifier, + const OFBool check = OFTrue); + + /** copy constructor + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + */ + DSRNumericMeasurementValue(const DSRNumericMeasurementValue &numericMeasurement); + + /** destructor + */ + virtual ~DSRNumericMeasurementValue(); + + /** assignment operator + ** @param numericMeasurement numeric measurement value to be copied (not checked !) + ** @return reference to this numeric value after 'numericMeasurement' has been copied + */ + DSRNumericMeasurementValue &operator=(const DSRNumericMeasurementValue &numericMeasurement); + + /** comparison operator "equal". + * Two numeric measurement values are equal if the numeric value, the measurement unit + * and the value qualifier are equal. Other (additional) information is not used. + ** @param numericMeasurement numeric measurement value that should be compared to the + * current one + ** @return OFTrue if both numeric measurement values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRNumericMeasurementValue &numericMeasurement) const; + + /** comparison operator "not equal". + * Two numeric measurement values are not equal if either the numeric value or the + * measurement unit or the value qualifier are not equal. Other (additional) information + * is not used for comparison. + ** @param numericMeasurement numeric measurement value that should be compared to the + * current one + ** @return OFTrue if both numeric measurement values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRNumericMeasurementValue &numericMeasurement) const; + + /** clear all internal variables. + * Use this method to create an empty numeric measurement value. + */ + virtual void clear(); + + /** check whether the current numeric measurement value is valid. + * The value is valid if isEmpty() is true or both the numeric value and the measurement + * unit contain a valid value, and the value qualifier is valid (see checkXXX() methods). + * The possibly available additional representations of the numeric value are never + * checked. + ** @return OFTrue if value is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the current numeric measurement value is empty. + * Checks whether both the numeric value and the measurement are empty. The optional + * value qualifier is not checked since it might contain the reason for the absence of + * the measured value sequence. + ** @return OFTrue if value is empty, OFFalse otherwise + */ + virtual OFBool isEmpty() const; + + /** check whether the current numeric measurement value is complete, i.e.\ whether the + * numeric value is non-empty and the measurement unit is complete, or whether the + * value qualifier is complete. This is just a basic check that might be useful for + * "validating" input data. See isValid() for a more sophisticated way of checking + * the current numeric measurement value. + ** @return OFTrue if value is complete, OFFalse otherwise + */ + virtual OFBool isComplete() const; + + /** print numeric measurement value. + * The output of a typical numeric measurement value looks like this: + * "3.5" (cm,UCUM[1.4],"centimeter"). If the value is empty, the text "empty" is printed + * instead, followed by the numeric value qualifier (if present). The possibly available + * additional floating point and rational representations of the numeric value are never + * printed. + ** @param stream output stream to which the numeric measurement value should be printed + * @param flags flag used to customize the output (not used) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read numeric measurement value from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write numeric measurement value in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read measured value sequence and numeric value qualifier code sequence from dataset. + * The number of items within the sequences is checked. If error/warning output are + * enabled, a warning message is printed if a sequence is absent or contains more than + * one item. + ** @param dataset DICOM dataset from which the sequences should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readSequence(DcmItem &dataset, + const size_t flags); + + /** write measured value sequence and numeric value qualifier code sequence to dataset. + * The measured value sequence is always written (might be empty, though). The numeric + * value qualifier code sequence is optional and, therefore, only written if non-empty. + ** @param dataset DICOM dataset to which the sequences should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeSequence(DcmItem &dataset) const; + + /** render numeric measurement value in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + size_t &annexNumber, + const size_t flags) const; + + /** get reference to numeric measurement value + ** @return reference to numeric measurement value + */ + inline const DSRNumericMeasurementValue &getValue() const + { + return *this; + } + + /** get copy of numeric measurement value + ** @param numericMeasurement reference to variable in which the value should be stored + ** @return always returns EC_Normal + */ + OFCondition getValue(DSRNumericMeasurementValue &numericMeasurement) const; + + /** get numeric value + ** @return current numeric value (might be invalid or an empty string) + */ + inline const OFString &getNumericValue() const + { + return NumericValue; + } + + /** get measurement unit + ** @return reference to current measurement unit code (might be invalid or empty) + */ + inline const DSRCodedEntryValue &getMeasurementUnit() const + { + return MeasurementUnit; + } + + /** get numeric value qualifier (optional) + ** @return reference to current numeric value qualifier code (might be invalid or empty) + */ + inline const DSRCodedEntryValue &getNumericValueQualifier() const + { + return ValueQualifier; + } + + /** get copy of measurement unit + ** @param measurementUnit reference to variable in which the code should be stored + ** @return always returns EC_Normal + */ + OFCondition getMeasurementUnit(DSRCodedEntryValue &measurementUnit) const; + + /** get copy of numeric value qualifier (optional). + * Can be used to specify the reason for the absence of the measured value sequence. + ** @param valueQualifier reference to variable in which the code should be stored + ** @return always returns EC_Normal + */ + OFCondition getNumericValueQualifier(DSRCodedEntryValue &valueQualifier) const; + + /** get floating point representation of the numeric value (optional) + ** @param floatingPoint reference to variable in which the floating point representation + * should be stored + ** @return status, EC_Normal if successful, an error code otherwise. Returns + * SR_EC_RepresentationNotAvailable if floating point representation is not available. + */ + OFCondition getFloatingPointRepresentation(Float64 &floatingPoint) const; + + /** get rational representation of the numeric value (optional) + ** @param rationalNumerator reference to variable in which the integer numerator of + * the rational representation should be stored + ** @param rationalDenominator reference to variable in which the integer denominator of + * the rational representation should be stored + ** @return status, EC_Normal if successful, an error code otherwise. Returns + * SR_EC_RepresentationNotAvailable if rational representation is not available. + */ + OFCondition getRationalRepresentation(Sint32 &rationalNumerator, + Uint32 &rationalDenominator) const; + + /** set numeric measurement value. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. + ** @param numericMeasurement value to be set + * @param check if enabled, check value for validity before setting it. + * See checkXXX() methods for details. Empty values are only + * accepted for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRNumericMeasurementValue &numericMeasurement, + const OFBool check = OFTrue); + + /** set numeric value and measurement unit. + * Before setting the values, they are usually checked. Please note that both values + * (i.e. 'numericValue' and 'measurementUnit') either have to be empty or non-empty. + * If the value pair is invalid, the current value pair is not replaced and remains + * unchanged. If the value pair is replaced, the optional floating point and rational + * representations are cleared, i.e. they have to be set manually if needed. + ** @param numericValue numeric value to be set (VR=DS, mandatory) + * @param measurementUnit measurement unit to be set (mandatory) + * @param check if enabled, check values for validity before setting them. + * See checkXXX() methods for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const OFBool check = OFTrue); + + /** set empty numeric value and measurement unit with a numeric value qualifier. + * Before setting the value, it is usually checked. If the value is invalid, the + * current numeric measurement value is not replaced and remains unchanged. + ** @param valueQualifier numeric value qualifier to be set. Used to specify the + * reason for the absence of the measured value sequence, + * i.e. why the numeric value and measurement unit are empty. + * @param check if enabled, check value for validity before setting it. + * See checkNumericValueQualifier() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRCodedEntryValue &valueQualifier, + const OFBool check = OFTrue); + + /** set numeric value, measurement unit and numeric value qualifier. + * Before setting the values, they are usually checked. Please note that both + * 'numericValue' and 'measurementUnit' either have to be empty or non-empty. + * If one of the three values is invalid, the current numeric measurement value is not + * replaced and remains unchanged. If the values are replaced, the optional floating + * point and rational representations are cleared, i.e. they have to be set manually if + * needed. + ** @param numericValue numeric value to be set (VR=DS, mandatory) + * @param measurementUnit measurement unit to be set (mandatory) + * @param valueQualifier numeric value qualifier to be set (optional). Can also be + * used to specify the reason for the absence of the measured + * value sequence (where 'numericValue' and 'measurementUnit' + * are stored). Use an empty code to remove the current value. + * @param check if enabled, check values for validity before setting them. + * See checkXXX() methods for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const DSRCodedEntryValue &valueQualifier, + const OFBool check = OFTrue); + + /** set numeric value. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. If the value is replaced, the optional + * floating point and rational representations are cleared, i.e. they have to be set + * manually if needed. + ** @param numericValue numeric value to be set (VR=DS, mandatory) + * @param check if enabled, check value for validity before setting it. + * See checkNumericValue() method for details. An empty value is + * never accepted, use the clear() method instead. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValue(const OFString &numericValue, + const OFBool check = OFTrue); + + /** set numeric value from element. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. If the value is replaced, the optional + * floating point and rational representations are cleared, i.e. they have to be set + * manually if needed. + ** @param delem DICOM element from which the numeric value should be retrieved + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check numeric value for validity before setting it. See + * checkNumericValue() method for details. An empty value is never + * accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValue(const DcmElement &delem, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set numeric value from dataset. + * Before setting the value, it is usually checked. If the value is invalid, the current + * value is not replaced and remains unchanged. If the value is replaced, the optional + * floating point and rational representations are cleared, i.e. they have to be set + * manually if needed. + ** @param dataset DICOM dataset from which the numeric value should be retrieved + * @param tagKey DICOM tag specifying the attribute from which the value should be + * retrieved. The search is limited to the top-level of the dataset. + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check numeric value for validity before setting it. + * See checkNumericValue() method for details. An empty value is + * never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValue(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set measurement unit. + * Before setting the code, it is usually checked. If the code is invalid the current + * code is not replaced and remains unchanged. + ** @param measurementUnit measurement unit to be set (mandatory) + * @param check if enabled, check value for validity before setting it. + * See checkMeasurementUnit() method for details. An empty + * value is never accepted, use the clear() method instead. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setMeasurementUnit(const DSRCodedEntryValue &measurementUnit, + const OFBool check = OFTrue); + + /** set numeric value qualifier. + * This optional code specifies the qualification of the Numeric Value in the Measured + * Value Sequence, or the reason for the absence of the Measured Value Sequence Item. + * Before setting the code, it is usually checked. If the code is invalid the current + * code is not replaced and remains unchanged. + ** @param valueQualifier numeric value qualifier to be set (optional). Use an empty + * code to remove the current value. + * @param check if enabled, check value for validity before setting it. + * See checkNumericValueQualifier() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setNumericValueQualifier(const DSRCodedEntryValue &valueQualifier, + const OFBool check = OFTrue); + + /** set floating point representation of the numeric value. + * According to the DICOM standard, this value is "required if the numeric value has + * insufficient precision to represent the value as a string. May be present otherwise." + * Please note that it is not checked whether this representation is consistent with the + * numeric value stored as a string. + ** @param floatingPoint floating point representation of the numeric value + * @param check dummy parameter (currently not used) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFloatingPointRepresentation(const Float64 floatingPoint, + const OFBool check = OFTrue); + + /** set rational representation of the numeric value. + * According to the DICOM standard, this value is "required if the numeric value has + * insufficient precision to represent a rational value as a string. May be present + * otherwise." Please note that it is not checked whether this representation is + * consistent with the numeric value stored as a string. + ** @param rationalNumerator integer numerator of a rational representation of the + * numeric value (encoded as a signed integer value) + * @param rationalDenominator integer denominator of a rational representation of the + * numeric value (encoded as a non-zero unsigned integer + * value) + * @param check if enabled, check values for validity before setting them. + * See checkRationalRepresentation() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRationalRepresentation(const Sint32 rationalNumerator, + const Uint32 rationalDenominator, + const OFBool check = OFTrue); + + /** remove floating point representation of the numeric value (if any). + * Internally, all elements that belong to this representation are cleared. + */ + void removeFloatingPointRepresentation(); + + /** remove rational representation of the numeric value (if any). + * Internally, all elements that belong to this representation are cleared. + */ + void removeRationalRepresentation(); + + + protected: + + /** get pointer to numeric measurement value + ** @return pointer to numeric measurement value (never NULL) + */ + inline DSRNumericMeasurementValue *getValuePtr() + { + return this; + } + + /** read numeric measurement value from dataset + ** @param dataset DICOM dataset from which the value should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readItem(DcmItem &dataset, + const size_t flags); + + /** write numeric measurement value to dataset + ** @param dataset DICOM dataset to which the value should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeItem(DcmItem &dataset) const; + + /** check the specified numeric value for validity. + * Currently, the only checks performed are that the string is non-empty and that the + * given value conforms to the corresponding VR (DS) and VM (1). + ** @param numericValue numeric value to be checked + ** @return status, EC_Normal if numeric value is valid, an error code otherwise + */ + virtual OFCondition checkNumericValue(const OFString &numericValue) const; + + /** check the specified measurement unit for validity. + * Internally, the methods DSRCodedEntryValue::isEmpty() and + * DSRCodedEntryValue::checkCurrentValue() are used for this purpose. Conformance + * with the Context Group 82 (as defined in the DICOM standard) is not yet checked. + ** @param measurementUnit measurement unit to be checked + ** @return status, EC_Normal if measurement unit is valid, an error code otherwise + */ + virtual OFCondition checkMeasurementUnit(const DSRCodedEntryValue &measurementUnit) const; + + /** check the specified numeric value qualifier for validity. + * Internally, DSRCodedEntryValue::isEmpty() and DSRCodedEntryValue::checkCurrentValue() + * are used for this purpose. Conformance with the Context Group 42 (as defined in the + * DICOM standard) is not checked; see class CMR_SRNumericMeasurementValue if needed, + * which supports such additional checks. + ** @param valueQualifier numeric value qualifier to be checked + ** @return status, EC_Normal if value qualifier is valid, an error code otherwise + */ + virtual OFCondition checkNumericValueQualifier(const DSRCodedEntryValue &valueQualifier) const; + + /** check the specified rational representation for validity. + * The only check that is performed is that the 'rationalDenominator' is not zero, i.e. + * it is not checked whether this representation is consistent with the numeric value + * stored as a string. + ** @param rationalNumerator numerator of the rational representation to be checked + * @param rationalDenominator denominator of a rational representation to be checked + ** @return status, EC_Normal if rational representation is valid, an error code otherwise + */ + virtual OFCondition checkRationalRepresentation(const Sint32 rationalNumerator, + const Uint32 rationalDenominator) const; + + /** check the currently stored numeric measurement value for validity. + * See above checkXXX() methods for details. + ** @return status, EC_Normal if current value is valid, an error code otherwise + */ + virtual OFCondition checkCurrentValue() const; + + + private: + + /// Numeric Value (VR=DS, type 1 within a type 2 sequence) + OFString NumericValue; + /// Measurement Unit (type 1 within a type 2 sequence) + DSRCodedEntryValue MeasurementUnit; + /// Numeric Value Qualifier (type 3) + DSRCodedEntryValue ValueQualifier; + /// Floating Point Value (VR=FD, type 1C) + DcmFloatingPointDouble FloatingPointValue; + /// Rational Numerator Value (VR=SL, type 1C) + DcmSignedLong RationalNumeratorValue; + /// Rational Denominator Value (VR=UL, type 1C) + DcmUnsignedLong RationalDenominatorValue; +}; + + +/** output stream operator for numeric measurement values. + * Internally, the DSRNumericMeasurementValue::print() method is used, i.e. the output + * looks like this: "3.5" (cm,UCUM[1.4],"centimeter") or "empty" (if the value is empty) + * @param stream output stream to which the numeric measurement value is + * printed + * @param numericMeasurement numeric measurement value to be printed + * @return reference to output stream + */ +DCMTK_DCMSR_EXPORT STD_NAMESPACE ostream &operator<<(STD_NAMESPACE ostream &stream, + const DSRNumericMeasurementValue &numericMeasurement); + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrpficc.h b/dcmsr/include/dcmtk/dcmsr/dsrpficc.h new file mode 100644 index 00000000..7c648dd3 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrpficc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRPerformedImagingAgentAdministrationSRConstraintChecker + * + */ + + +#ifndef DSRPFICC_H +#define DSRPFICC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Performed Imaging Agent + * Administration SR IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 11020 + * (Performed Imaging Agent Administration) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRPerformedImagingAgentAdministrationSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRPerformedImagingAgentAdministrationSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRPerformedImagingAgentAdministrationSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_PerformedImagingAgentAdministrationSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrplicc.h b/dcmsr/include/dcmtk/dcmsr/dsrplicc.h new file mode 100644 index 00000000..716a2b72 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrplicc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRPlannedImagingAgentAdministrationSRConstraintChecker + * + */ + + +#ifndef DSRPLICC_H +#define DSRPLICC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Planned Imaging Agent + * Administration SR IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 11001 + * (Planned Imaging Agent Administration) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRPlannedImagingAgentAdministrationSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRPlannedImagingAgentAdministrationSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRPlannedImagingAgentAdministrationSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_PlannedImagingAgentAdministrationSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrpnmtn.h b/dcmsr/include/dcmtk/dcmsr/dsrpnmtn.h new file mode 100644 index 00000000..3e758f04 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrpnmtn.h @@ -0,0 +1,207 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRPNameTreeNode + * + */ + + +#ifndef DSRPNMTN_H +#define DSRPNMTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrstrvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item PNAME + */ +class DCMTK_DCMSR_EXPORT DSRPNameTreeNode + : public DSRDocumentTreeNode, + public DSRStringValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRPNameTreeNode(const E_RelationshipType relationshipType); + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param personNameValue initial value to be set (VR=PN, mandatory) + * @param check if enabled, check 'personNameValue' for validity before + * setting it. See checkValue() for details. An empty value + * is never accepted. + */ + DSRPNameTreeNode(const E_RelationshipType relationshipType, + const OFString &personNameValue, + const OFBool check = OFTrue); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRPNameTreeNode(const DSRPNameTreeNode &node); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRPNameTreeNode *clone() const; + + /** destructor + */ + virtual ~DSRPNameTreeNode(); + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base classes, the concept name and the currently + * stored value (see hasValidValue()) are valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the stored person name, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: contains PNAME:(,,"Code")="Riesmeier^Joerg" + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + // --- static helper function --- + + /** get DICOM Person Name from XML elements. + * The five components of a DICOM Person Name (PN) are expected to be stored in the + * XML elements "prefix", "first", "middle", "last" and "suffix" as created by + * writeXML(). + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param nameValue reference to string object in which the value should be stored + ** @return reference to string object (might be empty) + */ + static OFString &getValueFromXMLNodeContent(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + OFString &nameValue); + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** check the specified person name value for validity. + * In addition to the base class check for a non-empty value, this method also checks + * whether the given value conforms to the corresponding VR (PN) and VM (1). + ** @param personNameValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &personNameValue) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRPNameTreeNode(); + DSRPNameTreeNode &operator=(const DSRPNameTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrposcn.h b/dcmsr/include/dcmtk/dcmsr/dsrposcn.h new file mode 100644 index 00000000..6a4fd46f --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrposcn.h @@ -0,0 +1,169 @@ +/* + * + * Copyright (C) 2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRPositionCounter + * + */ + + +#ifndef DSRPOSCN_H +#define DSRPOSCN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsdefine.h" + +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/oflist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class implementing a position counter to be used for iterating a tree of nodes + */ +class DCMTK_DCMSR_EXPORT DSRPositionCounter +{ + public: + + /** (default) constructor + ** @param flags optional flags used to customize the processing of the counter. + * These flags are only stored but not evaluated by this class. + */ + DSRPositionCounter(const size_t flags = 0); + + /** copy constructor + ** @param counter object to be copied + */ + DSRPositionCounter(const DSRPositionCounter &counter); + + /** destructor + */ + virtual ~DSRPositionCounter(); + + /** assignment operator + ** @param counter object to be copied + ** @return reference to modified cursor (this object) + */ + DSRPositionCounter &operator=(const DSRPositionCounter &counter); + + /** conversion operator that returns the position on the current level + * (0 if the position counter is invalid) + */ + inline operator size_t () const + { + return Position; + } + + /** pre-increment operator. Increases the position on the current level by 1. + * Also makes the position counter valid if it was invalid before. + ** @return reference to modified cursor (this object) + */ + inline DSRPositionCounter &operator++() + { + ++Position; + return *this; + } + + /** pre-decrement operator. Decreases the position on the current level by 1. + * This makes the position counter invalid if the position was 1 before. + ** @return reference to modified cursor (this object) + */ + inline DSRPositionCounter &operator--() + { + /* avoid underflow */ + if (Position > 0) --Position; + return *this; + } + + /** clear all member variables. + * The position counter becomes invalid afterwards (same state as after default + * construction). Also see initialize(). + */ + void clear(); + + /** initialize the position counter + ** @param valid flag specifying whether the counter should be initialized as + * valid (default) or invalid + * @param flags optional flags used to customize the processing of the counter. + * These flags are only stored but not evaluated by this class. + */ + void initialize(const OFBool valid = OFTrue, + const size_t flags = 0); + + /** check whether position counter is valid (i.e.\ has been initialized) + ** @return OFTrue if valid, OFFalse otherwise + */ + inline OFBool isValid() const + { + return (Position > 0); + } + + /** go one level up, i.e.\ restore the position on the next upper level and forget + * about the current level + ** @return OFTrue if successful, OFFalse otherwise + */ + OFBool goUp(); + + /** go one level down, i.e.\ store the position on the current level and start with + * 1 on the new level + ** @return OFTrue if successful, OFFalse otherwise + */ + OFBool goDown(); + + /** get specified flags that can be used to customize the counter + ** @return flags used to customize the counter + */ + inline size_t getFlags() const + { + return Flags; + } + + /** get current level of the position counter. + * The top most (root) level is 1, the next lower level is 2, etc. + ** @return number of the current level if valid, 0 otherwise + */ + inline size_t getLevel() const + { + /* check for valid counter */ + return isValid() ? PositionList.size() + 1 : 0; + } + + /** get string representing the current state of the position counter. + * See DSRTreeNodeCursor::getPosition() for details. + ** @param position variable where the position string should be stored + * @param separator character used to separate the figures (default: '.') + ** @return reference to the resulting position string (empty if invalid) + */ + const OFString &getString(OFString &position, + const char separator = '.') const; + + + private: + + /// current position within the current level + size_t Position; + /// list of position counters in upper levels + OFList PositionList; + /// flags used to customize the counter + size_t Flags; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrprdcc.h b/dcmsr/include/dcmtk/dcmsr/dsrprdcc.h new file mode 100644 index 00000000..5b36055d --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrprdcc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRPatientRadiationDoseSRConstraintChecker + * + */ + + +#ifndef DSRPRDCC_H +#define DSRPRDCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Patient Radiation Dose + * SR IOD. + * According to DICOM PS 3.3: "The document shall be constructed from Baseline TID 10030 + * (Patient Radiation Dose) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRPatientRadiationDoseSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRPatientRadiationDoseSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRPatientRadiationDoseSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_PatientRadiationDoseSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrprocc.h b/dcmsr/include/dcmtk/dcmsr/dsrprocc.h new file mode 100644 index 00000000..55626dd2 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrprocc.h @@ -0,0 +1,93 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRProcedureLogConstraintChecker + * + */ + + +#ifndef DSRPROCC_H +#define DSRPROCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Procedure Log IOD. + * According to DICOM PS 3.3: "The document may be constructed from Baseline TID 3001 + * (Procedure Log) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRProcedureLogConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRProcedureLogConstraintChecker(); + + /** destructor + */ + virtual ~DSRProcedureLogConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_ProcedureLog) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrrefin.h b/dcmsr/include/dcmtk/dcmsr/dsrrefin.h new file mode 100644 index 00000000..fff87ef8 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrrefin.h @@ -0,0 +1,266 @@ +/* + * + * Copyright (C) 2011-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRReferencedInstanceList + * + */ + + +#ifndef DSRREFIN_H +#define DSRREFIN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcodvl.h" + +#include "dcmtk/ofstd/oflist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class that manages a list of SOP instances significantly related to the current + * SR document. This is an implementation of the Referenced Instance Sequence. + */ +class DCMTK_DCMSR_EXPORT DSRReferencedInstanceList + : public DSRTypes +{ + + public: + + /** constructor (default) + */ + DSRReferencedInstanceList(); + + /** destructor + */ + ~DSRReferencedInstanceList(); + + /** clear the list + */ + void clear(); + + /** check whether list is empty + ** @return OFTrue if list is empty, OFFalse otherwise + */ + OFBool isEmpty() const; + + /** get number of items stored in the list + ** @return number of items + */ + size_t getNumberOfItems() const; + + /** read list of items from the referenced instance sequence + ** @param dataset DICOM dataset from which the data should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of items to the referenced instance sequence. + * Does nothing if list is empty. + ** @param dataset DICOM dataset to which the data should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** read list of items from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write current list in XML format + ** @param stream output stream to which the XML data is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** add new entry to the list of instances (if not already existent). + * Before adding (or searching for) the entry, the given UID values are usually + * checked. If one of the values is invalid, nothing is done but an error is + * returned. If successful, the specified item is selected as the current one. + ** @param sopClassUID SOP class UID of the entry to be added (VR=UI, mandatory) + * @param instanceUID SOP instance UID of the entry to be added (VR=UI, mandatory) + * @param check if enabled, check values for validity before adding them. + * See checkSOPInstance() method for details. An empty value + * is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &sopClassUID, + const OFString &instanceUID, + const OFBool check = OFTrue); + + /** remove the current item from the list. + * After successful removal the cursor is set to the next valid position. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(); + + /** remove the specified item from the list. + * After successful removal the cursor is set to the next valid position. + ** @param sopClassUID SOP class UID of the item to be removed + * @param instanceUID SOP instance UID of the item to be removed + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const OFString &sopClassUID, + const OFString &instanceUID); + + /** select the specified item as the current one + ** @param sopClassUID SOP class UID of the item to be selected + * @param instanceUID SOP instance UID of the item to be selected + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const OFString &sopClassUID, + const OFString &instanceUID); + + /** select the first item in the list + ** @return status, EC_Normal if successful, an error code otherwise. + * (e.g. if the list is empty) + */ + OFCondition gotoFirstItem(); + + /** select the next item in the list + ** @return status, EC_Normal if successful, an error code otherwise. + * (e.g. if the end of the list has been reached) + */ + OFCondition gotoNextItem(); + + /** get the SOP class UID of the currently selected entry + ** @param sopClassUID reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getSOPClassUID(OFString &sopClassUID) const; + + /** get the SOP instance UID of the currently selected entry + ** @param instanceUID reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getSOPInstanceUID(OFString &instanceUID) const; + + /** get purpose of reference code of the currently selected entry + ** @param purposeOfReference variable where a copy of the code should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPurposeOfReference(DSRCodedEntryValue &purposeOfReference) const; + + /** set purpose of reference code of the currently selected entry. + * Before setting the value, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param purposeOfReference value to be set (mandatory) + * @param check if enabled, check value for validity before setting it. + * See checkPurposeOfReference() method for details. An + * empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPurposeOfReference(const DSRCodedEntryValue &purposeOfReference, + const OFBool check = OFTrue); + + + protected: + + /** Internal structure defining the list items + */ + struct DCMTK_DCMSR_EXPORT ItemStruct + { + /** constructor + ** @param sopClassUID SOP class UID + ** @param instanceUID SOP instance UID + */ + ItemStruct(const OFString &sopClassUID, + const OFString &instanceUID) + : SOPClassUID(sopClassUID), + InstanceUID(instanceUID), + PurposeOfReference() + {} + + /** clear additional information + */ + void clear() + { + // an empty code is invalid + PurposeOfReference.clear(); + } + + /// SOP Class UID (VR=UI, type 1) + const OFString SOPClassUID; + /// SOP Instance UID (VR=UI, type 1) + const OFString InstanceUID; + /// Purpose of Reference Code Sequence (VR=SQ, type 1) + DSRCodedEntryValue PurposeOfReference; + }; + + /** add the specified SOP instance to the list (if not existent) + ** @param sopClassUID SOP class UID of the entry to be added + * @param instanceUID SOP instance UID of the entry to be added + * @param item reference to item pointer (result variable) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &sopClassUID, + const OFString &instanceUID, + ItemStruct *&item); + + /** get pointer to currently selected item structure (if any) + ** @return pointer to the item structure if successful, NULL otherwise + */ + ItemStruct *getCurrentItem() const; + + /** check the specified SOP class UID and SOP instance UID for validity. + * Currently, the only checks performed are that the strings are non-empty and that + * the given values conform to the corresponding VR (UI) and VM (1). + ** @param sopClassUID SOP class UID to be checked + * @param instanceUID SOP instance UID to be checked + ** @return status, EC_Normal if all values are valid, an error code otherwise + */ + OFCondition checkSOPInstance(const OFString &sopClassUID, + const OFString &instanceUID) const; + + /** check the specified purpose of reference code for validity. + * Internally, the methods DSRCodedEntryValue::isEmpty() and + * DSRCodedEntryValue::checkCurrentValue() are used for this purpose. Conformance + * with the Context Group 7006 (as defined in the DICOM standard) is not yet checked. + ** @param purposeOfReference purpose of reference code to be checked + ** @return status, EC_Normal if code is valid, an error code otherwise + */ + OFCondition checkPurposeOfReference(const DSRCodedEntryValue &purposeOfReference) const; + + + private: + + /// list of items + OFList ItemList; + /// internal cursor to current (selected) list item + OFListIterator(ItemStruct *) Iterator; + + // copy constructor - not implemented! + DSRReferencedInstanceList(const DSRReferencedInstanceList &); + // assignment operator - not implemented! + DSRReferencedInstanceList &operator=(const DSRReferencedInstanceList &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrreftn.h b/dcmsr/include/dcmtk/dcmsr/dsrreftn.h new file mode 100644 index 00000000..54396a9a --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrreftn.h @@ -0,0 +1,319 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRByReferenceTreeNode + * + */ + + +#ifndef DSRREFTN_H +#define DSRREFTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for by-reference relationships + */ +class DCMTK_DCMSR_EXPORT DSRByReferenceTreeNode + : public DSRDocumentTreeNode +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent/source tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRByReferenceTreeNode(const E_RelationshipType relationshipType); + + /** constructor. + * The passed values are stored but the reference stays invalid until updated by + * updateReference(). + ** @param relationshipType type of relationship to the parent/source tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param referencedNodeID ID of the node to be referenced (target content item) + * @param targetValueType value type of the node to be referenced, i.e.\ the target + */ + DSRByReferenceTreeNode(const E_RelationshipType relationshipType, + const size_t referencedNodeID, + const E_ValueType targetValueType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. Furthermore, the following member variables of + * this class are also not copied but initialized with their default values: + * - ValidReference + * - ReferencedNodeID + * - TargetValueType + * + * As a result, the contained by-reference relationship becomes invalid and should + * be updated by updateReference() after the node has been added to a document tree. + ** @param node tree node to be copied + */ + DSRByReferenceTreeNode(const DSRByReferenceTreeNode &node); + + /** destructor + */ + virtual ~DSRByReferenceTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + * In this case, the IDs of the referenced nodes are used (if the references are valid). + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. In this case, the IDs of the referenced nodes are + * used (if the references are valid). + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRByReferenceTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base class is valid, the concept name is empty and + * the reference (see hasValidValue()) is valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the reference (which has been + * checked from outside of this class), is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: inferred from 1.2.3. If the position string + * of the referenced target content item is empty, a "?" (question mark) is printed. + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** get ID of the referenced node (target content item) + ** @return ID of the referenced node if valid, 0 otherwise + */ + size_t getReferencedNodeID() const + { + return ReferencedNodeID; + } + + /** get position string of the referenced node (target content item) + ** @return position string of the referenced node if valid, an empty string otherwise + */ + const OFString &getReferencedContentItem() const + { + return ReferencedContentItem; + } + + /** get value type of the referenced node (target content item) + ** @return value type of the referenced node if valid, DSRTypes::VT_invalid otherwise + */ + E_ValueType getTargetValueType() const + { + return TargetValueType; + } + + /** invalidate reference to the target content item. + * Sets the internal flag accordingly, see isValid() method. + */ + void invalidateReference(); + + /** update reference to the target content item (using the node ID). + * Also sets the internal flag accordingly, see isValid() method. Please note, however, + * that it is not checked whether the referenced content item really exists. This is + * done later on by DSRDocumentSubTree::checkByReferenceRelationships(). + ** @param referencedNodeID ID of the node to be referenced (target content item) + * @param targetValueType value type of the node to be referenced, i.e.\ the target + ** @return OFTrue if the reference is valid, OFFalse otherwise + */ + OFBool updateReference(const size_t referencedNodeID, + const E_ValueType targetValueType); + + /** update reference the target content item (using the position string). + * Also sets the internal flag accordingly, see isValid() method. Please note, however, + * that it is not checked whether the referenced content item really exists. This is + * done later on by DSRDocumentSubTree::checkByReferenceRelationships(). + ** @param referencedContentItem position string of the node to be referenced + ** @return OFTrue if the reference is valid, OFFalse otherwise + */ + OFBool updateReference(const OFString &referencedContentItem); + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** set the concept name + ** @param conceptName dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this content item has no concept name + */ + virtual OFCondition setConceptName(const DSRCodedEntryValue &conceptName, + const OFBool check = OFTrue); + + /** set observation date/time + ** @param observationDateTime dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this content item has no observation + * date and time (part of Document Relationship Macro) + */ + virtual OFCondition setObservationDateTime(const OFString &observationDateTime, + const OFBool check = OFTrue); + + /** set observation date/time from element + ** @param delem dummy parameter + * @param pos dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this content item has no observation + * date and time (part of Document Relationship Macro) + */ + virtual OFCondition setObservationDateTime(const DcmElement &delem, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set observation date/time from dataset + ** @param dataset dummy parameter + * @param tagKey dummy parameter + * @param pos dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this content item has no observation + * date and time (part of Document Relationship Macro) + */ + virtual OFCondition setObservationDateTime(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set observation unique identifier + ** @param observationUID dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this content item has no observation + * unique identifier (part of Document Relationship Macro) + */ + virtual OFCondition setObservationUID(const OFString &observationUID, + const OFBool check = OFTrue); + + /** set template identifier and mapping resource + ** @param templateIdentifier dummy parameter + * @param mappingResource dummy parameter + * @param mappingResourceUID dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this content item has no template + * identification (part of Document Relationship Macro) + */ + virtual OFCondition setTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "", + const OFBool check = OFTrue); + + + private: + + /// flag indicating whether the reference is valid or not (i.e. checked). + /// The default value is OFFalse. + OFBool ValidReference; + /// position string of the referenced nodes (target content item). + /// The default value is en empty string. + OFString ReferencedContentItem; + /// node ID of the referenced node (target content item). + /// The default value is 0. + size_t ReferencedNodeID; + /// value type of the referenced node (target content item). + /// The default value is DSRTypes::VT_invalid. + E_ValueType TargetValueType; + + + // --- declaration of default constructor and assignment operator + + DSRByReferenceTreeNode(); + DSRByReferenceTreeNode &operator=(const DSRByReferenceTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrrrdcc.h b/dcmsr/include/dcmtk/dcmsr/dsrrrdcc.h new file mode 100644 index 00000000..c9ea5cbb --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrrrdcc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2014-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRRadiopharmaceuticalRadiationDoseSRConstraintChecker + * + */ + + +#ifndef DSRRRDCC_H +#define DSRRRDCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Radiopharmaceutical + * Radiation Dose SR IOD. + * According to DICOM PS 3.3: "The document may be constructed from Baseline TID 10021 + * (Radiopharmaceutical Radiation Dose) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRRadiopharmaceuticalRadiationDoseSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRRadiopharmaceuticalRadiationDoseSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRRadiopharmaceuticalRadiationDoseSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_RadiopharmaceuticalRadiationDoseSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrrtpl.h b/dcmsr/include/dcmtk/dcmsr/dsrrtpl.h new file mode 100644 index 00000000..e64ef134 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrrtpl.h @@ -0,0 +1,219 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRRootTemplate + * + */ + + +#ifndef DSRRTPL_H +#define DSRRTPL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctr.h" +#include "dcmtk/dcmsr/dsrctpl.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DSRSubTemplate; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class managing an SR document tree that is based on an SR root template. + * This class provides a more template-specific API than the general document tree class + * and should be used for root templates only. + ** @note The main focus of this class currently lies in the creation of SR documents that + * are based on an SR root template. Support for reading SR documents into the + * underlying structures might be added in the future. + */ +class DCMTK_DCMSR_EXPORT DSRRootTemplate + : protected DSRDocumentTree, + public DSRTemplateCommon +{ + + public: + + /** constructor + ** @param documentType document type of the associated document + * @param templateIdentifier identifier of the template + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional) + */ + DSRRootTemplate(const E_DocumentType documentType, + const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = ""); + + /** copy constructor. + * Also see notes on DSRDocumentTree's copy constructor. + ** @param rootTemplate template to be copied + */ + DSRRootTemplate(const DSRRootTemplate &rootTemplate); + + /** destructor + */ + virtual ~DSRRootTemplate(); + + /** clone this template. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this template + */ + virtual DSRRootTemplate *clone() const; + + /** clone the internally stored document tree of this template. + * Internally, the copy constructor of DSRDocumentTree is used, so the corresponding + * comments apply. In addition, the template identification is set for the root node + * of the cloned tree (if applicable). + ** @return copy of the internally stored document tree + */ + virtual DSRDocumentTree *cloneTree() const; + + /** clear internal member variables. + * Also see notes on the clear() method of the base classes. + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * That means, whether both the internally stored document tree and the template + * identification are valid. + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether this template is a root template, i.e.\ describes a complete SR + * document tree starting from the root node + ** @return always returns OFTrue since this class handles root templates + */ + inline OFBool isRootTemplate() const + { + return OFTrue; + } + + /** get read-only access to internally stored document tree. + * This method is not "const" because the template identification is set/updated + * automatically for the root node of the document tree (if applicable). + ** @return constant reference to internally stored document tree + */ + virtual const DSRDocumentTree &getTree(); + + /** add extra content item to the current one (if the template is extensible). + * See DSRDocumentTree::addContentItem() for details. + ** @param relationshipType relationship type of node to be added with regard to + * the current one + * @param valueType value type of node to be added + * @param addMode flag specifying at which position to add the new node + * (e.g. after or below the current node) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition addExtraContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const E_AddMode addMode = AM_afterCurrent); + + /** insert tree from given extra template to internally stored document tree. + * If possible, this method adds a copy of the given tree to the current content item. + * However, in case this template is non-extensible, an error code will be returned. + ** @param subTemplate template that contains the tree that should be inserted + * @param addMode flag specifying at which position to add the new subtree + * (e.g. after or below the current node) + * @param defaultRelType default relationship type between the top-level nodes of + * the given subtree and the current node. This relationship + * type is used if the one of a top-level node is "unknown". + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition insertExtraTemplate(const DSRSubTemplate &subTemplate, + const E_AddMode addMode = AM_belowCurrent, + const E_RelationshipType defaultRelType = RT_unknown); + + + // --- introduce some methods from base class to public API + + using DSRDocumentTree::isEmpty; + using DSRDocumentTree::isCursorValid; + using DSRDocumentTree::getDocumentType; + using DSRDocumentTree::print; + using DSRDocumentTree::writeXML; + using DSRDocumentTree::countNodes; + using DSRDocumentTree::countChildNodes; + using DSRDocumentTree::hasParentNode; + using DSRDocumentTree::hasChildNodes; + using DSRDocumentTree::hasPreviousNode; + using DSRDocumentTree::hasNextNode; + using DSRDocumentTree::hasSiblingNodes; + using DSRDocumentTree::iterate; + using DSRDocumentTree::gotoRoot; + using DSRDocumentTree::gotoFirst; + using DSRDocumentTree::gotoLast; + using DSRDocumentTree::gotoPrevious; + using DSRDocumentTree::gotoNext; + using DSRDocumentTree::gotoParent; + using DSRDocumentTree::gotoChild; + using DSRDocumentTree::gotoNamedNode; + using DSRDocumentTree::gotoNextNamedNode; + using DSRDocumentTree::gotoAnnotatedNode; + using DSRDocumentTree::gotoNextAnnotatedNode; + using DSRDocumentTree::getCurrentContentItem; + using DSRDocumentTree::updateByReferenceRelationships; + + + protected: + + /** read SR document tree from DICOM dataset + ** @param dataset dummy parameter + * @param documentType dummy parameter + * @param flags dummy parameter + ** @return always returns EC_IllegalCall since this method is not yet implemented and + * should, therefore, never be called for this class + */ + virtual OFCondition read(DcmItem &dataset, + const E_DocumentType documentType, + const size_t flags = 0); + + /** read XML document tree + ** @param doc dummy parameter + * @param cursor dummy parameter + * @param flags dummy parameter + ** @return always returns EC_IllegalCall since this method is not yet implemented and + * should, therefore, never be called for this class + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** update the tree for subsequent output, e.g.\ for being printed or added to an SR + * document. This function is called automatically by the affected output methods. + */ + virtual void updateTreeForOutput(); + + + private: + + // --- declaration of default constructor and assignment operator + + DSRRootTemplate(); + DSRRootTemplate &operator=(const DSRRootTemplate &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrsaecc.h b/dcmsr/include/dcmtk/dcmsr/dsrsaecc.h new file mode 100644 index 00000000..903fbbb3 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrsaecc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSimplifiedAdultEchoSRConstraintChecker + * + */ + + +#ifndef DSRSAECC_H +#define DSRSAECC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Simplified Adult Echo + * SR IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 5300 + * (Simplified Echo Procedure Report) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRSimplifiedAdultEchoSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRSimplifiedAdultEchoSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRSimplifiedAdultEchoSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_SimplifiedAdultEchoSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrsc3gr.h b/dcmsr/include/dcmtk/dcmsr/dsrsc3gr.h new file mode 100644 index 00000000..f5eab672 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrsc3gr.h @@ -0,0 +1,177 @@ +/* + * + * Copyright (C) 2010-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRGraphicData3DItem, DSRGraphicData3DList + * + */ + + +#ifndef DSRSC3GR_H +#define DSRSC3GR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for graphic data (3D) items + */ +class DCMTK_DCMSR_EXPORT DSRGraphicData3DItem +{ + public: + + /** (default) constructor + ** @param x optional x value + * @param y optional y value + * @param z optional z value + */ + DSRGraphicData3DItem(const Float32 x = 0, + const Float32 y = 0, + const Float32 z = 0) + : XCoord(x), + YCoord(y), + ZCoord(z) + { + } + + /** comparison operator + ** @param item item with which the (x,y,z) triplet should be compared + ** @return OFTrue if both triplets are equal, OFFalse otherwise + */ + inline OFBool operator==(const DSRGraphicData3DItem &item) const + { + return (item.XCoord == XCoord) && (item.YCoord == YCoord) && (item.ZCoord == ZCoord); + } + + /** comparison operator + ** @param item item with which the (x,y,z) triplet should be compared + ** @return true if not equal, false if equal + */ + inline OFBool operator!=(const DSRGraphicData3DItem &item) const + { + return (item.XCoord != XCoord) || (item.YCoord != YCoord) || (item.ZCoord != ZCoord); + } + + /* copy constructor and assignment operator are defined implicitly */ + + /// x value (VR=FL) + Float32 XCoord; + /// y value (VR=FL) + Float32 YCoord; + /// z value (VR=FL) + Float32 ZCoord; +}; + + +/** Class for graphic data (3D) lists + */ +class DCMTK_DCMSR_EXPORT DSRGraphicData3DList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRGraphicData3DList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRGraphicData3DList(const DSRGraphicData3DList &lst); + + /** destructor + */ + virtual ~DSRGraphicData3DList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRGraphicData3DList &operator=(const DSRGraphicData3DList &lst); + + /** print list of graphic data. + * The output of a typical list looks like this: 0/0/0,127/127/127,255/255/255 + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param tripletSeparator character specifying the separator between the value triplets + * @param itemSeparator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char tripletSeparator = '/', + const char itemSeparator = ',') const; + + /** read list of graphic data + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of graphic data + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** get reference to the specified item + ** @param idx index of the item to be returned (starting from 1) + ** @return reference to the specified item if successful, EmptyItem otherwise + */ + const DSRGraphicData3DItem &getItem(const size_t idx) const; + + /** get copy of the specified value triplet + ** @param idx index of the value triplet to be returned (starting from 1) + * @param x x value of the specified index (set to 0 first) + * @param y y value of the specified index (set to 0 first) + * @param z z value of the specified index (set to 0 first) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t idx, + Float32 &x, + Float32 &y, + Float32 &z) const; + + /** add value triplet to the list + ** @param x x value to be added + * @param y y value to be added + * @param z z value to be added + */ + void addItem(const Float32 x, + const Float32 y, + const Float32 z); + + /** put list of graphic data as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of numerical value triplets. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrsc3tn.h b/dcmsr/include/dcmtk/dcmsr/dsrsc3tn.h new file mode 100644 index 00000000..5597aa56 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrsc3tn.h @@ -0,0 +1,180 @@ +/* + * + * Copyright (C) 2010-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSCoord3DTreeNode + * + */ + + +#ifndef DSRSC3TN_H +#define DSRSC3TN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrsc3vl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item SCOORD3D + */ +class DCMTK_DCMSR_EXPORT DSRSCoord3DTreeNode + : public DSRDocumentTreeNode, + public DSRSpatialCoordinates3DValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRSCoord3DTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRSCoord3DTreeNode(const DSRSCoord3DTreeNode &node); + + /** destructor + */ + virtual ~DSRSCoord3DTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRSCoord3DTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes are valid. This check includes the value + * of the content item, which can also be checked separately with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the spatial coordinates value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * The method isShort() from the base class DSRSpatialCoordinates3DValue is called. + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: has properties SCOORD3D:(,,"SCoord3D Code")= + * (POINT,100/100/100) + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + +// --- declaration of default constructor and assignment operator + + DSRSCoord3DTreeNode(); + DSRSCoord3DTreeNode &operator=(const DSRSCoord3DTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h b/dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h new file mode 100644 index 00000000..f7bcbe95 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h @@ -0,0 +1,312 @@ +/* + * + * Copyright (C) 2010-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSpatialCoordinates3DValue + * + */ + + +#ifndef DSRSC3VL_H +#define DSRSC3VL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrsc3gr.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for spatial coordinate (3D) values + */ +class DCMTK_DCMSR_EXPORT DSRSpatialCoordinates3DValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRSpatialCoordinates3DValue(); + + /** constructor + ** @param graphicType graphic type specifying the geometry of the coordinates + */ + DSRSpatialCoordinates3DValue(const DSRTypes::E_GraphicType3D graphicType); + + /** copy constructor + ** @param coordinatesValue spatial coordinates value to be copied (not checked !) + */ + DSRSpatialCoordinates3DValue(const DSRSpatialCoordinates3DValue &coordinatesValue); + + /** destructor + */ + virtual ~DSRSpatialCoordinates3DValue(); + + /** assignment operator + ** @param coordinatesValue spatial coordinates value to be copied (not checked !) + ** @return reference to this spatial coordinates value after 'coordinatesValue' has + * been copied + */ + DSRSpatialCoordinates3DValue &operator=(const DSRSpatialCoordinates3DValue &coordinatesValue); + + /** comparison operator "equal" + ** @param coordinatesValue spatial coordinates value that should be compared to the + * current one + ** @return OFTrue if both spatial coordinates values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRSpatialCoordinates3DValue &coordinatesValue) const; + + /** comparison operator "not equal" + ** @param coordinatesValue spatial coordinates value that should be compared to the + * current one + ** @return OFTrue if both spatial coordinates values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRSpatialCoordinates3DValue &coordinatesValue) const; + + /** clear all internal variables. + * Graphic type is set to DSRTypes::GT3_invalid. Since an empty list of graphic data is + * invalid the spatial coordinates value becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the current spatial coordinates value is valid. + * The value is valid if the graphic type is not DSRTypes::GT3_invalid and the graphic data + * as well as the referenced frame of reference UID are valid. See checkXXX() methods for + * details. + ** @return OFTrue if reference value is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the content is short. + * This method is used to check whether the rendered output of this content item can be + * expanded inline or not (used for renderHTML()). + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print spatial coordinates. + * The output of a typical spatial coordinates value looks like this: (POINT,,100/100/100). + ** @param stream output stream to which the spatial coordinates value should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read spatial coordinates value from dataset + ** @param dataset DICOM dataset from which the value should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write spatial coordinates reference value to dataset + ** @param dataset DICOM dataset to which the value should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset) const; + + /** read spatial coordinates value from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write spatial coordinates value in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render spatial coordinates value in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param annexNumber reference to the variable where the current annex number is + * stored. Value is increased automatically by 1 after a new entry + * has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + size_t &annexNumber, + const size_t flags) const; + + /** get copy of spatial coordinates value + ** @param coordinatesValue reference to variable in which the value should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValue(DSRSpatialCoordinates3DValue &coordinatesValue) const; + + /** get reference to spatial coordinates value + ** @return reference to spatial coordinates value + */ + inline const DSRSpatialCoordinates3DValue &getValue() const + { + return *this; + } + + /** get current graphic type. + * The graphic type specifies the geometry of the coordinates stored in the graphic data + * list. + ** @return graphic type (might be DSRTypes::GT3_invalid) + */ + inline DSRTypes::E_GraphicType3D getGraphicType() const + { + return GraphicType; + } + + /** get reference to graphic data list. + * This list contains an ordered set of (x,y,z) triplets that denote positions in + * an image. The allowed number of triplets is depending on the graphic type. + ** @return reference to graphic data list + */ + inline DSRGraphicData3DList &getGraphicDataList() + { + return GraphicDataList; + } + + /** get referenced frame of reference UID. + * Uniquely identifies the frame of reference within which the coordinates are defined. + ** @return referenced frame of reference UID (might be invalid or an empty string) + */ + inline const OFString &getFrameOfReferenceUID() const + { + return FrameOfReferenceUID; + } + + /** get fiducial UID. + * Optional - This is the globally unique identifier for this fiducial item. It can be + * used to associate these spatial coordinates with other content items. + ** @return fiducial UID (might be invalid or an empty string) + */ + inline const OFString &getFiducialUID() const + { + return FiducialUID; + } + + /** set spatial coordinates value. + * Before setting the value, the graphic type, graphic data and frame of reference UID + * are usually checked. If the value is invalid, the current value is not replaced and + * remains unchanged. + ** @param coordinatesValue value to be set + * @param check if enabled, check values for validity before setting them. + * See checkXXX() methods for details. Empty values are only + * accepted for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRSpatialCoordinates3DValue &coordinatesValue, + const OFBool check = OFTrue); + + /** set current graphic type. + * The graphic type specifies the geometry of the coordinates stored in the graphic data + * list. + ** @param graphicType graphic type to be set (DSRTypes::GT3_invalid is not allowed) + * @param check dummy parameter (currently not used) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGraphicType(const DSRTypes::E_GraphicType3D graphicType, + const OFBool check = OFTrue); + + /** set current referenced frame of reference UID. + * Uniquely identifies the frame of reference within which the coordinates are defined. + ** @param frameOfReferenceUID value to be set (VR=UI, mandatory) + * @param check if enabled, check value for validity before setting it. + * See checkFrameOfReferenceUID() method for details. An + * empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFrameOfReferenceUID(const OFString &frameOfReferenceUID, + const OFBool check = OFTrue); + + /** set current fiducial UID. + * Globally unique identifier that can be used to associate these spatial coordinates + * with other content items. + ** @param fiducialUID value to be set (VR=UI, optional) + * @param check if enabled, check value for validity before setting it. See + * checkFiducialUID() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFiducialUID(const OFString &fiducialUID, + const OFBool check = OFTrue); + + + protected: + + /** get pointer to spatial coordinates value + ** @return pointer to spatial coordinates value (never NULL) + */ + inline DSRSpatialCoordinates3DValue *getValuePtr() + { + return this; + } + + /** check the specified graphic type and data for validity. + * If 'graphicType' is valid, the number of entries in the 'graphicDatalist' are checked. + * A POINT needs exactly 1 value triplets (x,y,z), a MULTIPOINT at least 1?, a POLYLINE + * at least 1?, a POLYGON at least 1? where the first and last triplet are equal, an + * ELLIPSE exactly 4 and an ELLIPSOID exactly 6. + ** @param graphicType graphic type to be checked + * @param graphicDataList list of graphic data to be checked + * @param reportWarnings if enabled, report a warning message on each deviation from + * an expected value to the logger + ** @return status, EC_Normal if graphic type and data are valid, an error code otherwise + */ + OFCondition checkGraphicData(const DSRTypes::E_GraphicType3D graphicType, + const DSRGraphicData3DList &graphicDataList, + const OFBool reportWarnings = OFFalse) const; + + /** check the specified frame of reference UID for validity + ** @param frameOfReferenceUID referenced frame of reference UID to be checked + ** @return status, EC_Normal if frame of reference UID is valid, an error code otherwise + */ + OFCondition checkFrameOfReferenceUID(const OFString &frameOfReferenceUID) const; + + /** check the specified fiducial UID for validity + ** @param fiducialUID fiducial UID to be checked + ** @return status, EC_Normal if fiducial UID is valid, an error code otherwise + */ + OFCondition checkFiducialUID(const OFString &fiducialUID) const; + + + private: + + /// Graphic Type (associated DICOM VR=CS, type 1) + DSRTypes::E_GraphicType3D GraphicType; + /// Graphic Data (associated DICOM VR=FL, VM=2-n, type 1) + DSRGraphicData3DList GraphicDataList; + /// Referenced Frame of Reference UID (VR=UI, VM=1, type 1) + OFString FrameOfReferenceUID; + /// Fiducial UID (VR=UI, VM=1, type 3) + OFString FiducialUID; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrscogr.h b/dcmsr/include/dcmtk/dcmsr/dsrscogr.h new file mode 100644 index 00000000..6d28ea66 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrscogr.h @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 2000-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRGraphicDataItem, DSRGraphicDataList + * + */ + + +#ifndef DSRSCOGR_H +#define DSRSCOGR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for graphic data items + */ +class DCMTK_DCMSR_EXPORT DSRGraphicDataItem +{ + public: + + /** (default) constructor + ** @param column optional column value + * @param row optional row value + */ + DSRGraphicDataItem(const Float32 column = 0, + const Float32 row = 0) + : Column(column), + Row(row) + { + } + + /** comparison operator + ** @param item item with which the (column,row) pair should be compared + ** @return OFTrue if both pairs are equal, OFFalse otherwise + */ + inline OFBool operator==(const DSRGraphicDataItem &item) const + { + return (item.Column == Column) && (item.Row == Row); + } + + /** comparison operator + ** @param item item with which the (column,row) pair should be compared + ** @return true if not equal, false if equal + */ + inline OFBool operator!=(const DSRGraphicDataItem &item) const + { + return (item.Column != Column) || (item.Row != Row); + } + + /** comparison operator + ** @param item item with which the (column,row) pair should be compared + ** @return true if smaller. Row takes precedence over column. + */ + inline OFBool operator<(const DSRGraphicDataItem &item) const + { + return (Row < item.Row) || ((Row == item.Row) && (Column < item.Column)); + } + + /** comparison operator + ** @param item item with which the (column,row) pair should be compared + ** @return true if greater. Row takes precedence over column. + */ + inline OFBool operator>(const DSRGraphicDataItem &item) const + { + return (Row > item.Row) || ((Row == item.Row) && (Column > item.Column)); + } + + /* copy constructor and assignment operator are defined implicitly */ + + /// column value (VR=FL) + Float32 Column; + /// row value (VR=FL) + Float32 Row; +}; + + +/** Class for graphic data lists + */ +class DCMTK_DCMSR_EXPORT DSRGraphicDataList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRGraphicDataList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRGraphicDataList(const DSRGraphicDataList &lst); + + /** destructor + */ + virtual ~DSRGraphicDataList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRGraphicDataList &operator=(const DSRGraphicDataList &lst); + + /** print list of graphic data. + * The output of a typical list looks like this: 0/0,127/127,255/255 + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param pairSeparator character specifying the separator between the value pairs + * @param itemSeparator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char pairSeparator = '/', + const char itemSeparator = ',') const; + + /** read list of graphic data + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of graphic data + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** get reference to the specified item + ** @param idx index of the item to be returned (starting from 1) + ** @return reference to the specified item if successful, EmptyItem otherwise + */ + const DSRGraphicDataItem &getItem(const size_t idx) const; + + /** get copy of the specified value pair + ** @param idx index of the value pair to be returned (starting from 1) + * @param column column value of the specified index (set to 0 first) + * @param row row value of the specified index (set to 0 first) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t idx, + Float32 &column, + Float32 &row) const; + + /** add value pair to the list + ** @param column column value to be added + * @param row row value to be added + */ + void addItem(const Float32 column, + const Float32 row); + + /** put list of graphic data as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of numerical value pairs. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrscotn.h b/dcmsr/include/dcmtk/dcmsr/dsrscotn.h new file mode 100644 index 00000000..d1260d5a --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrscotn.h @@ -0,0 +1,180 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSCoordTreeNode + * + */ + + +#ifndef DSRSCOTN_H +#define DSRSCOTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrscovl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item SCOORD + */ +class DCMTK_DCMSR_EXPORT DSRSCoordTreeNode + : public DSRDocumentTreeNode, + public DSRSpatialCoordinatesValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid orDSRTypes:: RT_isRoot. + */ + DSRSCoordTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRSCoordTreeNode(const DSRSCoordTreeNode &node); + + /** destructor + */ + virtual ~DSRSCoordTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRSCoordTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes are valid. This check includes the value + * of the content item, which can also be checked separately with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the spatial coordinates value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * The method isShort() from the base class DSRSpatialCoordinatesValue is called. + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: has properties SCOORD:(,,"SCoord Code")= + * (CIRCLE,0/0,255/255) + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + +// --- declaration of default constructor and assignment operator + + DSRSCoordTreeNode(); + DSRSCoordTreeNode &operator=(const DSRSCoordTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrscovl.h b/dcmsr/include/dcmtk/dcmsr/dsrscovl.h new file mode 100644 index 00000000..081ac855 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrscovl.h @@ -0,0 +1,283 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSpatialCoordinatesValue + * + */ + + +#ifndef DSRSCOVL_H +#define DSRSCOVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrscogr.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for spatial coordinate values + */ +class DCMTK_DCMSR_EXPORT DSRSpatialCoordinatesValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRSpatialCoordinatesValue(); + + /** constructor + ** @param graphicType graphic type specifying the geometry of the coordinates + */ + DSRSpatialCoordinatesValue(const DSRTypes::E_GraphicType graphicType); + + /** copy constructor + ** @param coordinatesValue spatial coordinates value to be copied (not checked !) + */ + DSRSpatialCoordinatesValue(const DSRSpatialCoordinatesValue &coordinatesValue); + + /** destructor + */ + virtual ~DSRSpatialCoordinatesValue(); + + /** assignment operator + ** @param coordinatesValue spatial coordinates value to be copied (not checked !) + ** @return reference to this spatial coordinates value after 'coordinatesValue' has + * been copied + */ + DSRSpatialCoordinatesValue &operator=(const DSRSpatialCoordinatesValue &coordinatesValue); + + /** comparison operator "equal" + ** @param coordinatesValue spatial coordinates value that should be compared to the + * current one + ** @return OFTrue if both spatial coordinates values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRSpatialCoordinatesValue &coordinatesValue) const; + + /** comparison operator "not equal" + ** @param coordinatesValue spatial coordinates value that should be compared to the + * current one + ** @return OFTrue if both spatial coordinates values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRSpatialCoordinatesValue &coordinatesValue) const; + + /** clear all internal variables. + * Graphic type is set to DSRTypes::GT_invalid. Since an empty list of graphic data is + * invalid the spatial coordinates value becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the current spatial coordinates value is valid. + * The value is valid if the graphic type is not DSRTypes::GT_invalid and the graphic data + * is valid. See checkGraphicData() method for details. + ** @return OFTrue if reference value is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the content is short. + * This method is used to check whether the rendered output of this content item can be + * expanded inline or not (used for renderHTML()). + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print spatial coordinates. + * The output of a typical spatial coordinates value looks like this: (CIRCLE,0/0,255/255). + ** @param stream output stream to which the spatial coordinates value should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read spatial coordinates value from dataset + ** @param dataset DICOM dataset from which the value should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write spatial coordinates reference value to dataset + ** @param dataset DICOM dataset to which the value should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset) const; + + /** read spatial coordinates value from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write spatial coordinates value in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render spatial coordinates value in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param annexNumber reference to the variable where the current annex number is + * stored. Value is increased automatically by 1 after a new entry + * has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + size_t &annexNumber, + const size_t flags) const; + + /** get copy of spatial coordinates value + ** @param coordinatesValue reference to variable in which the value should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValue(DSRSpatialCoordinatesValue &coordinatesValue) const; + + /** get reference to spatial coordinates value + ** @return reference to spatial coordinates value + */ + inline const DSRSpatialCoordinatesValue &getValue() const + { + return *this; + } + + /** get current graphic type. + * The graphic type specifies the geometry of the coordinates stored in the graphic data + * list. + ** @return graphic type (might be DSRTypes::GT_invalid) + */ + inline DSRTypes::E_GraphicType getGraphicType() const + { + return GraphicType; + } + + /** get reference to graphic data list. + * This list contains an ordered set of (columns,rows) pairs that denote positions in an + * image. The allowed number of pairs is depending on the graphic type. + ** @return reference to graphic data list + */ + inline DSRGraphicDataList &getGraphicDataList() + { + return GraphicDataList; + } + + /** get fiducial UID. + * Optional - This is the globally unique identifier for this fiducial item. It can be + * used to associate these spatial coordinates with other content items. + ** @return fiducial UID (might be invalid or an empty string) + */ + inline const OFString &getFiducialUID() const + { + return FiducialUID; + } + + /** set spatial coordinates value. + * Before setting the value, the graphic type and data are usually checked. If the value + * is invalid, the current value is not replaced and remains unchanged. + ** @param coordinatesValue value to be set + * @param check if enabled, check values for validity before setting them. + * See checkXXX() methods for details. Empty values are only + * accepted for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRSpatialCoordinatesValue &coordinatesValue, + const OFBool check = OFTrue); + + /** set current graphic type. + * The graphic type specifies the geometry of the coordinates stored in the graphic data + * list. + ** @param graphicType graphic type to be set (DSRTypes::GT_invalid is not allowed) + * @param check dummy parameter (currently not used) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setGraphicType(const DSRTypes::E_GraphicType graphicType, + const OFBool check = OFTrue); + + /** set current fiducial UID. + * Globally unique identifier that can be used to associate these spatial coordinates + * with other content items. + ** @param fiducialUID value to be set (VR=UI, optional) + * @param check if enabled, check value for validity before setting it. See + * checkFiducialUID() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setFiducialUID(const OFString &fiducialUID, + const OFBool check = OFTrue); + + + protected: + + /** get pointer to spatial coordinates value + ** @return pointer to spatial coordinates value (never NULL) + */ + inline DSRSpatialCoordinatesValue *getValuePtr() + { + return this; + } + + /** check the specified graphic type and data for validity. + * If 'graphicType' is valid, the number of entries in the 'graphicDatalist' are checked. + * A POINT needs exactly 1 value pair (column,row), a MULTIPOINT at least 1?, a POLYLINE + * at least 1?, a CIRCLE exactly 2 and an ELLIPSE exactly 4. + ** @param graphicType graphic type to be checked + * @param graphicDataList list of graphic data to be checked + * @param reportWarnings if enabled, report a warning message on each deviation from + * an expected value to the logger + ** @return status, EC_Normal if graphic type and data are valid, an error code otherwise + */ + OFCondition checkGraphicData(const DSRTypes::E_GraphicType graphicType, + const DSRGraphicDataList &graphicDataList, + const OFBool reportWarnings = OFFalse) const; + + /** check the specified fiducial UID for validity + ** @param fiducialUID fiducial UID to be checked + ** @return status, EC_Normal if fiducial UID is valid, an error code otherwise + */ + OFCondition checkFiducialUID(const OFString &fiducialUID) const; + + + private: + + /// Graphic Type (associated DICOM VR=CS, type 1) + DSRTypes::E_GraphicType GraphicType; + /// Graphic Data (associated DICOM VR=FL, VM=2-n, type 1) + DSRGraphicDataList GraphicDataList; + /// Fiducial UID (VR=UI, VM=1, type 3) + OFString FiducialUID; + /// Pixel Origin Interpretation (VR=CS, VM=1, type 1C) + // - tbd: conditional attribute not yet supported +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrsoprf.h b/dcmsr/include/dcmtk/dcmsr/dsrsoprf.h new file mode 100644 index 00000000..bad5f0ac --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrsoprf.h @@ -0,0 +1,639 @@ +/* + * + * Copyright (C) 2002-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSOPInstanceReferenceList + * - InstanceStruct, SeriesStruct, StudyStruct + * + */ + + +#ifndef DSRSOPRF_H +#define DSRSOPRF_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcodvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for SOP instance reference lists + */ +class DCMTK_DCMSR_EXPORT DSRSOPInstanceReferenceList + : public DSRTypes +{ + + public: + + /** constructor + ** @param sequence DICOM tag specifying the attribute (sequence) of the reference list + */ + DSRSOPInstanceReferenceList(const DcmTagKey &sequence); + + /** destructor + */ + ~DSRSOPInstanceReferenceList(); + + /** clear list of references + */ + void clear(); + + /** check whether list of references is empty + ** @return OFTrue if list is empty, OFFalse otherwise + */ + OFBool isEmpty() const; + + /** get number of instance stored in the list of references + ** @return number of instances + */ + size_t getNumberOfInstances() const; + + /** read list of referenced SOP instances. + * The hierarchical structure is automatically reorganized in a way that each study, + * each series (within a study) and each instance (within a series) only exist once, + * i.e. the structure might look different when written back to a dataset. However, + * the content is identical and this way of storing information saves storage space. + ** @param dataset DICOM dataset from which the data should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of referenced SOP instances. + * Does nothing if list is empty. + ** @param dataset DICOM dataset to which the data should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** read list of references from XML document. + * The hierarchical structure is automatically reorganized in a way that each study, + * each series (within a study) and each instance (within a series) only exist once, + * i.e. the structure might look different when written back to a dataset. However, + * the content is identical and this way of storing information saves storage space. + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write current list of references in XML format + ** @param stream output stream to which the XML data is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** set specific character set, which is used for checking the affected element values. + * Please note that this method does not return an error if the given 'value' is not + * defined by the DICOM standard or not supported by this implementation. + ** @param value value to be set (single or multiple values) or "" for no value + * @param check check 'value' for conformance with VR (CS) and VM (1-n) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setSpecificCharacterSet(const OFString &value, + const OFBool check = OFTrue); + + /** add the specified item to the list of references. + * Before adding the item, the given UID values are usually checked. If one of the + * values is invalid, nothing is done but an error is returned. If successful, the + * item is inserted into the hierarchical structure of studies, series and instances, + * if not already contained in the list. In any case, the specified item is selected + * as the current one. + ** @param studyUID study instance UID of the entry to be added + * @param seriesUID series instance UID of the entry to be added + * @param sopClassUID SOP class UID of the entry to be added + * @param instanceUID SOP instance UID of the entry to be added + * @param check if enabled, check values for validity before adding them. + * See checkSOPInstance() method for details. Empty values are + * never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &studyUID, + const OFString &seriesUID, + const OFString &sopClassUID, + const OFString &instanceUID, + const OFBool check = OFTrue); + + /** add item from specified DICOM dataset to the list of references. + * Internally, an item representing the given dataset is inserted into the hierarchical + * structure of studies, series and instances, if not already contained in the list. + * In any case, the specified item is selected as the current one. + ** @param dataset reference to DICOM dataset from which the relevant UIDs are retrieved + * @param check if enabled, check values for validity before adding them. See + * checkSOPInstance() method for details. An empty value is never + * accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(DcmItem &dataset, + const OFBool check = OFTrue); + + /** remove the current item from the list of referenced SOP instances. + * After successful removal the cursor is set to the next valid position. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(); + + /** remove the specified item from the list of references. + * After successful removal the cursor is set to the next valid position. + ** @param sopClassUID SOP class UID of the item to be removed + * @param instanceUID SOP instance UID of the item to be removed + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const OFString &sopClassUID, + const OFString &instanceUID); + + /** remove the specified item from the list of references. + * After successful removal the cursor is set to the next valid position. + ** @param studyUID study instance UID of the item to be removed + * @param seriesUID series instance UID of the item to be removed + * @param instanceUID SOP instance UID of the item to be removed + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const OFString &studyUID, + const OFString &seriesUID, + const OFString &instanceUID); + + /** select the specified item as the current one + ** @param sopClassUID SOP class UID of the item to be selected + * @param instanceUID SOP instance UID of the item to be selected + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const OFString &sopClassUID, + const OFString &instanceUID); + + /** select the specified item as the current one + ** @param studyUID study instance UID of the item to be selected + * @param seriesUID series instance UID of the item to be selected + * @param instanceUID SOP instance UID of the item to be selected + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoItem(const OFString &studyUID, + const OFString &seriesUID, + const OFString &instanceUID); + + /** select the first item in the list. + * That means the first instance in the first series of the first study + * is selected (if available). + ** @return status, EC_Normal if successful, an error code otherwise. + * (e.g. if the list is empty) + */ + OFCondition gotoFirstItem(); + + /** select the next item in the list. + * That means the next instance in the current series, or the first instance + * in the next series, or the first instance in the first series of the next + * study is selected (if available). The combination of this function and + * gotoFirstItem() allows to iterate over all referenced SOP instances. + ** @return status, EC_Normal if successful, an error code otherwise. + * (e.g. if the end of the list has been reached) + */ + OFCondition gotoNextItem(); + + /** get the study instance UID of the currently selected entry + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getStudyInstanceUID(OFString &stringValue) const; + + /** get the series instance UID of the currently selected entry + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getSeriesInstanceUID(OFString &stringValue) const; + + /** get the SOP instance UID of the currently selected entry + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getSOPInstanceUID(OFString &stringValue) const; + + /** get the SOP class UID of the currently selected entry + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getSOPClassUID(OFString &stringValue) const; + + /** get name associated with the SOP class UID of the currently selected entry + ** @param stringValue reference to string variable in which the result is stored + * @param defaultName string value that is returned if the SOP class UID is unknown + ** @return reference to the resulting string (might be empty even if 'defaultName' is + * non-empty, e.g. in case no entry is currently selected) + */ + const OFString &getSOPClassName(OFString &stringValue, + const OFString &defaultName = "unknown SOP Class UID") const; + + /** get the retrieve application entity title of the currently selected entry (optional). + * The resulting string may contain multiple values separated by a backslash ("\"). + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getRetrieveAETitle(OFString &stringValue) const; + + /** get the retrieve location UID of the currently selected entry (optional) + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getRetrieveLocationUID(OFString &stringValue) const; + + /** get the storage media file set ID of the currently selected entry (optional) + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getStorageMediaFileSetID(OFString &stringValue) const; + + /** get the storage media file set UID of the currently selected entry (optional) + ** @param stringValue reference to string variable in which the result is stored + ** @return reference to the resulting string (might be empty) + */ + const OFString &getStorageMediaFileSetUID(OFString &stringValue) const; + + /** get purpose of reference code of the currently selected entry (optional) + ** @param codeValue variable where a copy of the code should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getPurposeOfReference(DSRCodedEntryValue &codeValue) const; + + /** set the retrieve application entity title of the currently selected entry + ** @param value string value to be set (possibly multi-valued) or "" for no value + * @param check check 'value' for conformance with VR (AE) and VM (1-n) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRetrieveAETitle(const OFString &value, + const OFBool check = OFTrue); + + /** set the retrieve location UID of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setRetrieveLocationUID(const OFString &value, + const OFBool check = OFTrue); + + /** set the storage media file set ID of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (SH) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStorageMediaFileSetID(const OFString &value, + const OFBool check = OFTrue); + + /** set the storage media file set UID of the currently selected entry + ** @param value string value to be set (single value only) or "" for no value + * @param check check 'value' for conformance with VR (UI) and VM (1) if enabled + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setStorageMediaFileSetUID(const OFString &value, + const OFBool check = OFTrue); + + /** set purpose of reference code of the currently selected entry. + * Before setting the value, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param codeValue value to be set (optional). Use an empty code to remove the + * current value. + * @param check if enabled, check value for validity before setting it. See + * checkPurposeOfReference() method for details. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setPurposeOfReference(const DSRCodedEntryValue &codeValue, + const OFBool check = OFTrue); + + + protected: + + /** Internal structure defining the instance list items + */ + struct DCMTK_DCMSR_EXPORT InstanceStruct + { + /** constructor + ** @param sopClassUID SOP class UID + ** @param instanceUID SOP instance UID + */ + InstanceStruct(const OFString &sopClassUID, + const OFString &instanceUID); + + /** clear additional information + */ + void clear(); + + /// SOP Class UID (VR=UI, type 1) + const OFString SOPClassUID; + /// SOP Instance UID (VR=UI, type 1) + const OFString InstanceUID; + /// Purpose of Reference Code Sequence (VR=SQ, type 3). + /// NB: According to the DICOM standard, "One or more Items are permitted in this + /// sequence." However, the current implementation only supports a single + /// item. Also see documentation of DSRCodedEntryValue::readSequence(). + DSRCodedEntryValue PurposeOfReference; + }; + + /** Internal structure defining the series list items + */ + struct DCMTK_DCMSR_EXPORT SeriesStruct + { + /** constructor + ** @param seriesUID series instance UID + */ + SeriesStruct(const OFString &seriesUID); + + /** destructor + */ + ~SeriesStruct(); + + /** get number of instance stored in the list of instances + ** @return number of instances + */ + size_t getNumberOfInstances() const; + + /** read instance level attributes from dataset + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write series and instance level attributes to dataset + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** read series and instance level attributes from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write series and instance level attributes in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** set cursor to the specified instance (if existent) + ** @param instanceUID SOP instance UID of the entry to be searched for + ** @return pointer to the instance structure if successful, NULL otherwise + */ + InstanceStruct *gotoInstance(const OFString &instanceUID); + + /** select the first item in the list. + * That means the first instance in the current series. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** select the next item in the list. + * That means the next instance in the current series (if available). + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** add new entry to the list of instances (if not already existent). + * Finally, the specified item is selected as the current one. + ** @param sopClassUID SOP class UID of the entry to be added + * @param instanceUID SOP instance UID of the entry to be added + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &sopClassUID, + const OFString &instanceUID); + + /** remove the current item from the list of instances. + * After successful removal the cursor is set to the next valid position. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(); + + /// Series Instance UID (VR=UI, VM=1, type 1) + const OFString SeriesUID; + /// Retrieve Application Entity Title (VR=AE, VM=1-n, type 3) + OFString RetrieveAETitle; + /// Retrieve Location UID (VR=UI, VM=1, type 3) + OFString RetrieveLocationUID; + /// Storage Media File Set ID (VR=SH, VM=1, type 3) + OFString StorageMediaFileSetID; + /// Storage Media File Set UID (VR=UI, VM=1, type 3) + OFString StorageMediaFileSetUID; + + /// list of referenced instances + OFList InstanceList; + /// currently selected instance (cursor) + OFListIterator(InstanceStruct *) Iterator; + }; + + /** To make VC6 happy. + */ + friend struct SeriesStruct; + + /** Internal structure defining the study list items + */ + struct DCMTK_DCMSR_EXPORT StudyStruct + { + /** constructor + ** @param studyUID study instance UID + */ + StudyStruct(const OFString &studyUID); + + /** destructor + */ + ~StudyStruct(); + + /** get number of instance stored in the list of series + ** @return number of instances + */ + size_t getNumberOfInstances() const; + + /** read series and instance level from dataset + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write study, series and instance level attributes to dataset + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** read study, series and instance level attributes from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write study, series and instance level attributes in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** set cursor to the specified series entry (if existent) + ** @param seriesUID series instance UID of the entry to be searched for + ** @return pointer to the series structure if successful, NULL otherwise + */ + SeriesStruct *gotoSeries(const OFString &seriesUID); + + /** set cursor to the specified instance entry (if existent) + ** @param instanceUID SOP instance UID of the entry to be searched for + ** @return pointer to the instance structure if successful, NULL otherwise + */ + InstanceStruct *gotoInstance(const OFString &instanceUID); + + /** select the first item in the list. + * That means the first instance in the first series of the current study. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoFirstItem(); + + /** select the next item in the list. + * That means the next instance in the current series, or the first instance + * in the next series (if available). + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition gotoNextItem(); + + /** add new entry to the list of series and instances (if not already existent). + * Finally, the specified items are selected as the current one. + ** @param seriesUID series instance UID of the entry to be added + * @param sopClassUID SOP class UID of the entry to be added + * @param instanceUID SOP instance UID of the entry to be added + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition addItem(const OFString &seriesUID, + const OFString &sopClassUID, + const OFString &instanceUID); + + /** remove the current item from the list of series and instances. + * After successful removal the cursors are set to the next valid position. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(); + + /** remove empty/incomplete items from the list. + * (e.g. series with no instances) + * Please note that this function modifies the value of 'Iterator'. + */ + void removeIncompleteItems(); + + /// Study Instance UID (VR=UI, type 1) + const OFString StudyUID; + + /// list of referenced series + OFList SeriesList; + /// currently selected series (cursor) + OFListIterator(SeriesStruct *) Iterator; + }; + + /** To make VC6 happy. + */ + friend struct StudyStruct; + + /** set cursor to the specified study entry (if existent) + ** @param studyUID study instance UID of the entry to be searched for + ** @return pointer to the study structure if successful, NULL otherwise + */ + StudyStruct *gotoStudy(const OFString &studyUID); + + /** get pointer to currently selected study structure (if any) + ** @return pointer to the study structure if successful, NULL otherwise + */ + StudyStruct *getCurrentStudy() const; + + /** get pointer to currently selected series structure (if any) + ** @return pointer to the series structure if successful, NULL otherwise + */ + SeriesStruct *getCurrentSeries() const; + + /** get pointer to currently selected instance structure (if any) + ** @return pointer to the instance structure if successful, NULL otherwise + */ + InstanceStruct *getCurrentInstance() const; + + /** remove empty/incomplete items from the list. + * (e.g. series with no instances or studies with no series) + * Please note that this function modifies the value of 'Iterator'. + */ + void removeIncompleteItems(); + + /** check the four specified UID values for validity. + * Currently, the only checks performed are that the strings are non-empty and that + * the given values conform to the corresponding VR (UI) and VM (1). + ** @param studyUID study instance UID to be checked + * @param seriesUID series instance UID to be checked + * @param sopClassUID SOP class UID to be checked + * @param instanceUID SOP instance UID to be checked + ** @return status, EC_Normal if all values are valid, an error code otherwise + */ + OFCondition checkSOPInstance(const OFString &studyUID, + const OFString &seriesUID, + const OFString &sopClassUID, + const OFString &instanceUID) const; + + /** check the specified purpose of reference code for validity. + * Internally, the method DSRCodedEntryValue::checkCurrentValue() + * is used for this purpose (if the code is not empty). + ** @param purposeOfReference purpose of reference code to be checked + ** @return status, EC_Normal if code is valid, an error code otherwise + */ + OFCondition checkPurposeOfReference(const DSRCodedEntryValue &purposeOfReference) const; + + + private: + + /// DICOM tag specifying the attribute (sequence) of the reference list + const DcmTagKey SequenceTag; + + /// list of studies + OFList StudyList; + /// internal cursor to current (selected) list item + OFListIterator(StudyStruct *) Iterator; + /// specific character set used for checking purposes + OFString SpecificCharacterSet; + + // default constructor - not implemented! + DSRSOPInstanceReferenceList(); + // copy constructor - not implemented! + DSRSOPInstanceReferenceList(const DSRSOPInstanceReferenceList &); + // assignment operator - not implemented! + DSRSOPInstanceReferenceList &operator=(const DSRSOPInstanceReferenceList &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrspecc.h b/dcmsr/include/dcmtk/dcmsr/dsrspecc.h new file mode 100644 index 00000000..ca723c39 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrspecc.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (C) 2010-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSpectaclePrescriptionReportConstraintChecker + * + */ + + +#ifndef DSRSPECC_H +#define DSRSPECC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the Spectacle + * Prescription Report IOD. + * According to DICOM PS 3.3: "The document shall be constructed from TID 2020 + * (Spectacle Prescription Report) invoked at the root node." + */ +class DCMTK_DCMSR_EXPORT DSRSpectaclePrescriptionReportConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRSpectaclePrescriptionReportConstraintChecker(); + + /** destructor + */ + virtual ~DSRSpectaclePrescriptionReportConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFTrue, i.e. template support is required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_SpectaclePrescriptionReport) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrstpl.h b/dcmsr/include/dcmtk/dcmsr/dsrstpl.h new file mode 100644 index 00000000..f158986a --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrstpl.h @@ -0,0 +1,189 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRSubTemplate + * + */ + + +#ifndef DSRSTPL_H +#define DSRSTPL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctr.h" +#include "dcmtk/dcmsr/dsrctpl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class managing an SR document tree that is based on an arbitrary SR template. + * This class provides a more template-specific API than the general subtree class and + * should be used for non-root templates only. + ** @note The main focus of this class currently lies in the creation of SR documents that + * are based on an SR non-root template. Support for reading SR documents into the + * underlying structures might be added in the future. + */ +class DCMTK_DCMSR_EXPORT DSRSubTemplate + : protected DSRDocumentSubTree, + public DSRTemplateCommon +{ + // allow direct access to inherited getRoot() method + friend class DSRIncludedTemplateNodeCursor; + + public: + + /** constructor + ** @param templateIdentifier identifier of the template + * @param mappingResource mapping resource that defines the template + * @param mappingResourceUID uniquely identifies the mapping resource (optional) + */ + DSRSubTemplate(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = ""); + + /** copy constructor. + * Also see notes on DSRDocumentSubTree's copy constructor. + ** @param subTemplate template to be copied + */ + DSRSubTemplate(const DSRSubTemplate &subTemplate); + + /** destructor + */ + virtual ~DSRSubTemplate(); + + /** clone this template. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this template + */ + virtual DSRSubTemplate *clone() const; + + /** clone the internally stored subtree of this template. + * Internally, the copy constructor of DSRDocumentSubTree is used, so the corresponding + * comments apply. In addition, the template identification is set for the root node + * of the cloned subtree (if applicable). + ** @return copy of the internally stored subtree + */ + virtual DSRDocumentSubTree *cloneTree() const; + + /** clear internal member variables. + * Also see notes on the clear() method of the base classes. + */ + virtual void clear(); + + /** check whether the current internal state is valid. + * That means, whether both the internally stored subtree and the template + * identification are valid. + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether this template is a root template, i.e.\ describes a complete SR + * document tree starting from the root node + ** @return always returns OFFalse since this class handles non-root templates only + */ + inline OFBool isRootTemplate() const + { + return OFFalse; + } + + /** get read-only access to internally stored subtree. + * This method is not "const" because the template identification is set/updated + * automatically for the root node of the subtree (if applicable). + ** @return constant reference to internally stored subtree + */ + virtual const DSRDocumentSubTree &getTree(); + + /** add extra content item to the current one (if the template is extensible). + * See DSRDocumentSubTree::addContentItem() for details. + ** @param relationshipType relationship type of node to be added with regard to + * the current one + * @param valueType value type of node to be added + * @param addMode flag specifying at which position to add the new node + * (e.g. after or below the current node) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition addExtraContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const E_AddMode addMode = AM_afterCurrent); + + /** insert tree from given extra template to internally stored subtree. + * If possible, this method adds a copy of the given tree to the current content item. + * However, in case this template is non-extensible, an error code will be returned. + ** @param subTemplate template that contains the tree that should be inserted + * @param addMode flag specifying at which position to add the new subtree + * (e.g. after or below the current node) + * @param defaultRelType default relationship type between the top-level nodes of + * the given subtree and the current node. This relationship + * type is used if the one of a top-level node is "unknown". + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition insertExtraTemplate(const DSRSubTemplate &subTemplate, + const E_AddMode addMode = AM_belowCurrent, + const E_RelationshipType defaultRelType = RT_unknown); + + + // --- introduce some methods from base class to public API + + using DSRDocumentSubTree::isEmpty; + using DSRDocumentSubTree::isCursorValid; + using DSRDocumentSubTree::print; + using DSRDocumentSubTree::writeXML; + using DSRDocumentSubTree::countNodes; + using DSRDocumentSubTree::countChildNodes; + using DSRDocumentSubTree::hasParentNode; + using DSRDocumentSubTree::hasChildNodes; + using DSRDocumentSubTree::hasPreviousNode; + using DSRDocumentSubTree::hasNextNode; + using DSRDocumentSubTree::hasSiblingNodes; + using DSRDocumentSubTree::iterate; + using DSRDocumentSubTree::gotoRoot; + using DSRDocumentSubTree::gotoFirst; + using DSRDocumentSubTree::gotoLast; + using DSRDocumentSubTree::gotoPrevious; + using DSRDocumentSubTree::gotoNext; + using DSRDocumentSubTree::gotoParent; + using DSRDocumentSubTree::gotoChild; + using DSRDocumentSubTree::gotoNamedNode; + using DSRDocumentSubTree::gotoNextNamedNode; + using DSRDocumentSubTree::gotoAnnotatedNode; + using DSRDocumentSubTree::gotoNextAnnotatedNode; + using DSRDocumentSubTree::getCurrentContentItem; + using DSRDocumentSubTree::updateByReferenceRelationships; + + + protected: + + /** update the tree for subsequent output, e.g.\ for being printed or added to an SR + * document. This function is called automatically by the affected output methods. + */ + virtual void updateTreeForOutput(); + + + private: + + // --- declaration of default constructor and assignment operator + + DSRSubTemplate(); + DSRSubTemplate &operator=(const DSRSubTemplate &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrstrvl.h b/dcmsr/include/dcmtk/dcmsr/dsrstrvl.h new file mode 100644 index 00000000..e0a7e3da --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrstrvl.h @@ -0,0 +1,225 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRStringValue + * + */ + + +#ifndef DSRSTRVL_H +#define DSRSTRVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for string values + */ +class DCMTK_DCMSR_EXPORT DSRStringValue +{ + + public: + + /** default constructor + */ + DSRStringValue(); + + /** constructor + ** @param stringValue initial value to be set + * @param check if enabled, check 'stringValue' for validity before setting it. + * See checkValue() for details. An empty value is never accepted. + */ + DSRStringValue(const OFString &stringValue, + const OFBool check = OFTrue); + + /** copy constructor + ** @param stringValue string value to be copied (not checked !) + */ + DSRStringValue(const DSRStringValue &stringValue); + + /** destructor + */ + virtual ~DSRStringValue(); + + /** assignment operator + ** @param stringValue string value to be copied (not checked !) + ** @return reference to this string value after 'stringValue' has been copied + */ + DSRStringValue &operator=(const DSRStringValue &stringValue); + + /** comparison operator "equal". + * Please note that padding or other non-significant characters are not removed before + * comparing the two values, i.e. a simple character-by-character comparison is used. + ** @param stringValue string value that should be compared to the current one + ** @return OFTrue if both string values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRStringValue &stringValue) const; + + /** comparison operator "not equal". + * Please note that padding or other non-significant characters are not removed before + * comparing the two values, i.e. a simple character-by-character comparison is used. + ** @param stringValue string value that should be compared to the current one + ** @return OFTrue if both string values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRStringValue &stringValue) const; + + /** clear all internal variables. + * Please note that the string value might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the current code is valid. + * See checkValue() for details. + ** @return OFTrue if code is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** print string value. + * The output of a typical string value looks like this: "Short text" or "Very long t..." + * (incl. the quotation marks). + ** @param stream output stream to which the string value should be printed + * @param maxLength maximum number of characters to be printed. If the string value is + * longer the output is shortened automatically and three dots "..." are + * added. The value of 'maxLength' includes these three trailing char's. + * A value of 0 turns this mechanism off (default), i.e. the full string + * value is printed. + */ + void print(STD_NAMESPACE ostream &stream, + const size_t maxLength = 0) const; + + /** read string value from dataset. + * If error/warning output is enabled, a warning message is printed if the string value + * does not conform with the type (1), value multiplicity (1) and/or value representation. + ** @param dataset DICOM dataset from which the string value should be read + * @param tagKey DICOM tag specifying the attribute that should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const DcmTagKey &tagKey, + const size_t flags); + + /** write string value to dataset + ** @param dataset DICOM dataset to which the string value should be written + * @param tagKey DICOM tag specifying the attribute that should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset, + const DcmTagKey &tagKey) const; + + /** read string value from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + * @param encoding use encoding handler if OFTrue, ignore character set otherwise + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags, + const OFBool encoding = OFFalse); + + /** render string value in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + const size_t flags) const; + + /** get string value + ** @return reference to string value + */ + inline const OFString &getValue() const + { + return Value; + } + + /** set string value. + * Before setting the string value, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. Use the clear() method to empty + * the string value (which becomes invalid afterwards). + ** @param stringValue value to be set (various VRs, mandatory) + * @param check if enabled, check value for validity before setting it. See + * checkValue() method for details. An empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const OFString &stringValue, + const OFBool check = OFTrue); + + /** set string value from element. + * Before setting the string value, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param delem DICOM element from which the string value should be retrieved + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check string value for validity before setting it. See + * checkValue() method for details. An empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DcmElement &delem, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set string value from dataset. + * Before setting the string value, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param dataset DICOM dataset from which the string value should be retrieved + * @param tagKey DICOM tag specifying the attribute from which the value should be + * retrieved. The search is limited to the top-level of the dataset. + * @param pos index of the value in case of multi-valued elements (0..vm-1) + * @param check if enabled, check string value for validity before setting it. See + * checkValue() method for details. An empty value is never accepted. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + + protected: + + /** check the specified string value for validity. + * This base class just checks that the string value is not empty (since all corresponding + * DICOM attributes are type 1). Derived classes should overwrite this method to perform + * more sophisticated tests. + ** @param stringValue value to be checked + ** @return status, EC_Normal if current value is valid, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &stringValue) const; + + /** check the currently stored string value for validity. + * See above checkValue() method for details. + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + OFCondition checkCurrentValue() const; + + + private: + + /// string value (various VRs, type 1) + OFString Value; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtcodt.h b/dcmsr/include/dcmtk/dcmsr/dsrtcodt.h new file mode 100644 index 00000000..2565a577 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtcodt.h @@ -0,0 +1,100 @@ +/* + * + * Copyright (C) 2000-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRReferencedDateTimeList + * + */ + + +#ifndef DSRTCODT_H +#define DSRTCODT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for referenced date/time list + */ +class DCMTK_DCMSR_EXPORT DSRReferencedDateTimeList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRReferencedDateTimeList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRReferencedDateTimeList(const DSRReferencedDateTimeList &lst); + + /** destructor + */ + virtual ~DSRReferencedDateTimeList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRReferencedDateTimeList &operator=(const DSRReferencedDateTimeList &lst); + + /** print list of referenced date/time. + * The output of a typical list looks like this: 20001010120000, ... + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param separator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char separator = ',') const; + + /** read list of referenced date/time + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of referenced date/time + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** put list of referenced date/time as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of date/time values. The conformance of each value to the Date Time + * (DT) value representation is not checked. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtcosp.h b/dcmsr/include/dcmtk/dcmsr/dsrtcosp.h new file mode 100644 index 00000000..4193e529 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtcosp.h @@ -0,0 +1,99 @@ +/* + * + * Copyright (C) 2000-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRReferencedSamplePositionList + * + */ + + +#ifndef DSRTCOSP_H +#define DSRTCOSP_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for referenced sample position list + */ +class DCMTK_DCMSR_EXPORT DSRReferencedSamplePositionList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRReferencedSamplePositionList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRReferencedSamplePositionList(const DSRReferencedSamplePositionList &lst); + + /** destructor + */ + virtual ~DSRReferencedSamplePositionList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRReferencedSamplePositionList &operator=(const DSRReferencedSamplePositionList &lst); + + /** print list of referenced sample positions. + * The output of a typical list looks like this: 1,2,3 or 1,... if shortened. + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param separator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char separator = ',') const; + + /** read list of referenced sample positions + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of referenced sample positions + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** put list of referenced sample positions as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of numerical values. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtcotn.h b/dcmsr/include/dcmtk/dcmsr/dsrtcotn.h new file mode 100644 index 00000000..1ec34d72 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtcotn.h @@ -0,0 +1,180 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTCoordTreeNode + * + */ + + +#ifndef DSRTCOTN_H +#define DSRTCOTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrtcovl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item TCOORD + */ +class DCMTK_DCMSR_EXPORT DSRTCoordTreeNode + : public DSRDocumentTreeNode, + public DSRTemporalCoordinatesValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRTCoordTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRTCoordTreeNode(const DSRTCoordTreeNode &node); + + /** destructor + */ + virtual ~DSRTCoordTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRTCoordTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes are valid. This check includes the value + * of the content item, which can also be checked separately with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the temporal coordinates value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * The method isShort() from the base class DSRTemporalCoordinatesValue is called. + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: has properties TCOORD:(,,"TCoord Code")= + * (SEGMENT,1,2.5,...) + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + +// --- declaration of default constructor and assignment operator + + DSRTCoordTreeNode(); + DSRTCoordTreeNode &operator=(const DSRTCoordTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtcoto.h b/dcmsr/include/dcmtk/dcmsr/dsrtcoto.h new file mode 100644 index 00000000..8d3729ca --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtcoto.h @@ -0,0 +1,99 @@ +/* + * + * Copyright (C) 2000-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRReferencedTimeOffsetList + * + */ + + +#ifndef DSRTCOTO_H +#define DSRTCOTO_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for referenced time offset list + */ +class DCMTK_DCMSR_EXPORT DSRReferencedTimeOffsetList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRReferencedTimeOffsetList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRReferencedTimeOffsetList(const DSRReferencedTimeOffsetList &lst); + + /** destructor + */ + virtual ~DSRReferencedTimeOffsetList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRReferencedTimeOffsetList &operator=(const DSRReferencedTimeOffsetList &lst); + + /** print list of referenced time offsets. + * The output of a typical list looks like this: 1,2.5 or 1,... if shortened. + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param separator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char separator = ',') const; + + /** read list of referenced time offsets + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of referenced time offsets + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** put list of referenced time offsets as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of numerical values. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtcovl.h b/dcmsr/include/dcmtk/dcmsr/dsrtcovl.h new file mode 100644 index 00000000..3bf99b91 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtcovl.h @@ -0,0 +1,280 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTemporalCoordinatesValue + * + */ + + +#ifndef DSRTCOVL_H +#define DSRTCOVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtcodt.h" +#include "dcmtk/dcmsr/dsrtcosp.h" +#include "dcmtk/dcmsr/dsrtcoto.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for temporal coordinates values + */ +class DCMTK_DCMSR_EXPORT DSRTemporalCoordinatesValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRTemporalCoordinatesValue(); + + /** constructor + ** @param temporalRangeType type of temporal extent of the region of interest + */ + DSRTemporalCoordinatesValue(const DSRTypes::E_TemporalRangeType temporalRangeType); + + /** copy constructor + ** @param coordinatesValue temporal coordinates value to be copied (not checked !) + */ + DSRTemporalCoordinatesValue(const DSRTemporalCoordinatesValue &coordinatesValue); + + /** destructor + */ + virtual ~DSRTemporalCoordinatesValue(); + + /** assignment operator + ** @param coordinatesValue temporal coordinates value to be copied (not checked !) + ** @return reference to this temporal coordinates value after 'coordinatesValue' has + * been copied + */ + DSRTemporalCoordinatesValue &operator=(const DSRTemporalCoordinatesValue &coordinatesValue); + + /** comparison operator "equal" + ** @param coordinatesValue temporal coordinates value that should be compared to the + * current one + ** @return OFTrue if both temporal coordinates values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRTemporalCoordinatesValue &coordinatesValue) const; + + /** comparison operator "not equal" + ** @param coordinatesValue temporal coordinates value that should be compared to the + * current one + ** @return OFTrue if both temporal coordinates values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRTemporalCoordinatesValue &coordinatesValue) const; + + /** clear all internal variables. + * Temporal range type is set to DSRTypes::TRT_invalid. Since an empty list of graphic data + * is invalid the temporal coordinates value becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the current temporal coordinates value is valid. + * The value is valid if the temporal range type is not DSRTypes::TRT_invalid and the other + * data is valid. See checkData() method for details. + ** @return OFTrue if reference value is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the content is short. + * This method is used to check whether the rendered output of this content item can be + * expanded inline or not (used for renderHTML()). + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print temporal coordinates. + * The output of a typical temporal coordinates value looks like this (depending on the + * referenced data list): (SEGMENT,1,2,3) or (SEGMENT,1,2.5,3.1) or (POINT,20001010120000) + ** @param stream output stream to which the temporal coordinates value should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read temporal coordinates value from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write temporal coordinates value in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render temporal coordinates value in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + size_t &annexNumber, + const size_t flags) const; + + /** get reference to temporal coordinates value + ** @return reference to temporal coordinates value + */ + inline const DSRTemporalCoordinatesValue &getValue() const + { + return *this; + } + + /** get copy of temporal coordinates value + ** @param coordinatesValue reference to variable in which the value should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValue(DSRTemporalCoordinatesValue &coordinatesValue) const; + + /** set temporal coordinates value. + * Before setting the value, the temporal range type and other data are checked (see + * checkData()). If the value is invalid, the current value is not replaced and remains + * unchanged. + ** @param coordinatesValue value to be set + * @param check if enabled, check values for validity before setting them. + * See checkData() method for details. Empty values are only + * accepted for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRTemporalCoordinatesValue &coordinatesValue, + const OFBool check = OFTrue); + + /** get current temporal range type. + * This value represents the type of temporal extent of the region of interest. + ** @return region type (might be DSRTypes::TRT_invalid) + */ + inline DSRTypes::E_TemporalRangeType getTemporalRangeType() const + { + return TemporalRangeType; + } + + /** set current temporal range type. + * This value represents the type of temporal extent of the region of interest. + ** @param temporalRangeType temporal range type to be set (DSRTypes::TRT_invalid is not + * allowed) + * @param check dummy parameter (currently not used) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setTemporalRangeType(const DSRTypes::E_TemporalRangeType temporalRangeType, + const OFBool check = OFTrue); + + /** get reference to list of referenced date/time + ** @return reference to list + */ + inline DSRReferencedDateTimeList &getDateTimeList() + { + return DateTimeList; + } + + /** get reference to list of referenced sample positions + ** @return reference to list + */ + inline DSRReferencedSamplePositionList &getSamplePositionList() + { + return SamplePositionList; + } + + /** get reference to list of referenced time offsets + ** @return reference to list + */ + inline DSRReferencedTimeOffsetList &getTimeOffsetList() + { + return TimeOffsetList; + } + + + protected: + + /** get pointer to temporal coordinates value + ** @return pointer to temporal coordinates value (never NULL) + */ + inline DSRTemporalCoordinatesValue *getValuePtr() + { + return this; + } + + /** read temporal coordinates value from dataset. + * Please note that all three lists are (tried to) read from the dataset. If more than + * one list is present a warning message is reported. + ** @param dataset DICOM dataset from which the value should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write temporal coordinates reference value to dataset. + * Please note that only one of the three lists is actually written to the dataset. + ** @param dataset DICOM dataset to which the value should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition write(DcmItem &dataset) const; + + /** check the temporal range type and other data for validity. + * The data is valid if the 'temporalRangeType' is valid and at least one of the three + * lists are non-empty. If more than one list is non-empty, a warning is reported (if + * enabled) since they are mutually exclusive (type 1C). + ** @param temporalRangeType temporal range type to be checked + * @param samplePositionList list of referenced sample positions to be checked + * @param timeOffsetList list of referenced time offsets to be checked + * @param dateTimeList list of referenced date/time to be checked + * @param reportWarnings if enabled, report a warning message on each deviation + * from an expected value to the logger + ** @return status, EC_Normal if checked data is valid, an error code otherwise + */ + OFCondition checkData(const DSRTypes::E_TemporalRangeType temporalRangeType, + const DSRReferencedSamplePositionList &samplePositionList, + const DSRReferencedTimeOffsetList &timeOffsetList, + const DSRReferencedDateTimeList &dateTimeList, + const OFBool reportWarnings = OFFalse) const; + + + private: + + /// temporal range type (associated DICOM VR=CS, type 1) + DSRTypes::E_TemporalRangeType TemporalRangeType; + + /// list of referenced sample positions (associated DICOM VR=UL, VM=1-n, type 1C) + DSRReferencedSamplePositionList SamplePositionList; + /// list of referenced time offsets (associated DICOM VR=DS, VM=1-n, type 1C) + DSRReferencedTimeOffsetList TimeOffsetList; + /// list of referenced date/time (associated DICOM VR=DT, VM=1-n, type 1C) + DSRReferencedDateTimeList DateTimeList; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtextn.h b/dcmsr/include/dcmtk/dcmsr/dsrtextn.h new file mode 100644 index 00000000..183ec4aa --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtextn.h @@ -0,0 +1,201 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTextTreeNode + * + */ + + +#ifndef DSRTEXTN_H +#define DSRTEXTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrstrvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item TEXT + */ +class DCMTK_DCMSR_EXPORT DSRTextTreeNode + : public DSRDocumentTreeNode, + public DSRStringValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRTextTreeNode(const E_RelationshipType relationshipType); + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param textValue initial value to be set (VR=UT, mandatory) + * @param check if enabled, check 'textValue' for validity before setting + * it. See checkValue() for details. An empty value is never + * accepted. + */ + DSRTextTreeNode(const E_RelationshipType relationshipType, + const OFString &textValue, + const OFBool check = OFTrue); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRTextTreeNode(const DSRTextTreeNode &node); + + /** destructor + */ + virtual ~DSRTextTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRTextTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base classes, the concept name and the currently + * stored value (see hasValidValue()) are valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the stored text value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * A text is short if the length is <= 40 characters. + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: contains TEXT:(,,"Text Code")="This is a Text." + * If the 'flag' DSRTypes::PF_shortenLongItemValues is set, the text is limited to + * 40 characters (incl. trailing "..."). + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** check the specified text value for validity. + * In addition to the base class check for a non-empty value, this method also checks + * whether the given value conforms to the corresponding VR (UT). + ** @param textValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &textValue) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRTextTreeNode(); + DSRTextTreeNode &operator=(const DSRTextTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtimtn.h b/dcmsr/include/dcmtk/dcmsr/dsrtimtn.h new file mode 100644 index 00000000..4822c7bb --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtimtn.h @@ -0,0 +1,208 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTimeTreeNode + * + */ + + +#ifndef DSRTIMTN_H +#define DSRTIMTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrstrvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item TIME + */ +class DCMTK_DCMSR_EXPORT DSRTimeTreeNode + : public DSRDocumentTreeNode, + public DSRStringValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRTimeTreeNode(const E_RelationshipType relationshipType); + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param timeValue initial value to be set (VR=TM, mandatory) + * @param check if enabled, check 'timeValue' for validity before setting + * it. See checkValue() for details. An empty value is never + * accepted. + */ + DSRTimeTreeNode(const E_RelationshipType relationshipType, + const OFString &timeValue, + const OFBool check = OFTrue); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRTimeTreeNode(const DSRTimeTreeNode &node); + + /** destructor + */ + virtual ~DSRTimeTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRTimeTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base classes, the concept name and the currently stored + * value (see hasValidValue()) are valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the stored time value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: contains TIME:(,,"Code")="12000000" + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format. Uses ISO formatted time value. + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + // --- static helper function --- + + /** get DICOM time value from given XML element. + * The DICOM Time (TM) value is expected to be stored in ISO format as created by + * writeXML(). + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the corresponding node + * @param timeValue reference to string object in which the value should be stored + * @param clearString flag specifying whether to clear the 'dateTimeValue' or not + ** @return reference to string object (might be empty) + */ + static OFString &getValueFromXMLNodeContent(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + OFString &timeValue, + const OFBool clearString = OFTrue); + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** check the specified time value for validity. + * In addition to the base class check for a non-empty value, this method also checks + * whether the given value conforms to the corresponding VR (TM) and VM (1). + ** @param timeValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &timeValue) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRTimeTreeNode(); + DSRTimeTreeNode &operator=(const DSRTimeTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtlist.h b/dcmsr/include/dcmtk/dcmsr/dsrtlist.h new file mode 100644 index 00000000..5ec109ac --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtlist.h @@ -0,0 +1,356 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRListOfItems + * + */ + + +#ifndef DSRTLIST_H +#define DSRTLIST_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmdata/dcerror.h" + +#include "dcmtk/ofstd/oflist.h" +#include "dcmtk/ofstd/ofvector.h" + + +/** get the default item which is returned in DSRListOfItems::getItem() if the index is invalid. + * This function needs to be specialized and instantiated for each different use of DSRListOfItems. + * @tparam T the type of the object that will be returned. + * @return a reference to an object of type T. + */ +template +const T& DSRgetEmptyItem(); + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Template class to store and access items in a list structure. + * For instances of this class T needs to have at least a default constructor, + * assignment and comparison operator. + */ +template class DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRListOfItems() + : ItemList() + { + } + + /** copy constructor + ** @param lst list to be copied + */ + DSRListOfItems(const DSRListOfItems &lst) + : ItemList(lst.ItemList) + { + } + + /** destructor + */ + virtual ~DSRListOfItems() + { + } + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + inline DSRListOfItems &operator=(const DSRListOfItems &lst) + { + /* check for self-assignment, which would not work */ + if (this != &lst) + { + /* class OFList has no overloaded assignment operator */ + ItemList.clear(); + const OFLIST_TYPENAME OFListConstIterator(T) endPos = lst.ItemList.end(); + OFLIST_TYPENAME OFListConstIterator(T) iterator = lst.ItemList.begin(); + while (iterator != endPos) + { + ItemList.push_back(*iterator); + iterator++; + } + } + return *this; + } + + /** comparison operator "equal" + ** @param lst list that should be compared to the current one + ** @return OFTrue if both lists are equal, OFFalse otherwise + */ + OFBool operator==(const DSRListOfItems &lst) const + { + /* first check whether the size of both lists is equal */ + OFBool result = (ItemList.size() == lst.ItemList.size()); + /* then iterate over all list entries (if any) */ + if (result && !ItemList.empty()) + { + /* since OFList does not implement a comparison operator we need the following */ + const OFLIST_TYPENAME OFListConstIterator(T) endPos = ItemList.end(); + OFLIST_TYPENAME OFListConstIterator(T) iterator = ItemList.begin(); + OFLIST_TYPENAME OFListConstIterator(T) lstIter = lst.ItemList.begin(); + do { + result = (*iterator == *lstIter); + iterator++; + lstIter++; + } while (result && (iterator != endPos)); + } + return result; + } + + /** comparison operator "not equal" + ** @param lst list that should be compared to the current one + ** @return OFTrue if both lists are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRListOfItems &lst) const + { + /* first check whether the size of both lists is not equal */ + OFBool result = (ItemList.size() != lst.ItemList.size()); + /* then iterate over all list entries (if any) */ + if (!result && !ItemList.empty()) + { + /* since OFList does not implement a comparison operator we need the following */ + const OFLIST_TYPENAME OFListConstIterator(T) endPos = ItemList.end(); + OFLIST_TYPENAME OFListConstIterator(T) iterator = ItemList.begin(); + OFLIST_TYPENAME OFListConstIterator(T) lstIter = lst.ItemList.begin(); + do { + result = (*iterator != *lstIter); + iterator++; + lstIter++; + } while (!result && (iterator != endPos)); + } + return result; + } + + /** clear all internal variables + */ + inline void clear() + { + ItemList.clear(); + } + + /** check whether the list is empty + ** @return OFTrue if the list is empty, OFFalse otherwise + */ + inline OFBool isEmpty() const + { + return ItemList.empty(); + } + + /** get number of items contained in the list + ** @return number of items if any, 0 otherwise + */ + inline size_t getNumberOfItems() const + { + return ItemList.size(); + } + + /** check whether specified item is contained in the list + ** @param item item to be checked + ** @return OFTrue if the item is in the list, OFFalse otherwise + */ + OFBool isElement(const T &item) const + { + OFLIST_TYPENAME OFListConstIterator(T) iterator = ItemList.begin(); + return gotoItem(item, iterator); + } + + /** get reference to the specified item + ** @param idx index of the item to be returned (starting from 1) + ** @return reference to the specified item if successful, EmptyItem otherwise + */ + const T &getItem(const size_t idx) const + { + OFLIST_TYPENAME OFListConstIterator(T) iterator = ItemList.begin(); + if (gotoItemPos(idx, iterator)) + return *iterator; + else + return DSRgetEmptyItem(); + } + + /** get copy of the specified item + ** @param idx index of the item to be returned (starting from 1) + * @param item reference to a variable where the result should be stored. + * (not changed/cleared if an error occurs!) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t idx, + T &item) const + { + OFCondition result = EC_IllegalParameter; + OFLIST_TYPENAME OFListConstIterator(T) iterator = ItemList.begin(); + if (gotoItemPos(idx, iterator)) + { + item = *iterator; + result = EC_Normal; + } + return result; + } + + /** get copy of all items (as a vector) + ** @param items reference to a variable where the result should be stored. + * (always cleared before items are added) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItems(OFVector &items) const + { + items.clear(); + if (!ItemList.empty()) + { + /* avoid re-allocations */ + items.reserve(ItemList.size()); + /* iterate over all list items */ + const OFLIST_TYPENAME OFListConstIterator(T) endPos = ItemList.end(); + OFLIST_TYPENAME OFListConstIterator(T) iterator = ItemList.begin(); + while (iterator != endPos) + { + /* and copy them to the passed vector */ + items.push_back(*iterator); + iterator++; + } + } + /* always return OK */ + return EC_Normal; + } + + /** add item to the list + ** @param item item to be added + */ + inline void addItem(const T &item) + { + ItemList.push_back(item); + } + + /** add item to the list only if it's not already contained + ** @param item item to be added + */ + inline void addOnlyNewItem(const T &item) + { + if (!isElement(item)) + ItemList.push_back(item); + } + + /** add items to the list + ** @param items items to be added (stored as a vector) + */ + inline void addItems(const OFVector &items) + { + const OFTypename OFVector::const_iterator endPos = items.end(); + OFTypename OFVector::const_iterator iterator = items.begin(); + while (iterator != endPos) + { + ItemList.push_back(*iterator); + iterator++; + } + } + + /** insert item at specified position to the list + ** @param idx index of the item before the new one should be inserted (starting from 1) + * @param item item to be inserted + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition insertItem(const size_t idx, + const T &item) + { + OFCondition result = EC_IllegalParameter; + if (idx == ItemList.size() + 1) + { + /* append to the end of the list */ + ItemList.push_back(item); + result = EC_Normal; + } else { + OFLIST_TYPENAME OFListIterator(T) iterator = ItemList.begin(); + if (gotoItemPos(idx, iterator)) + { + ItemList.insert(iterator, 1, item); + result = EC_Normal; + } + } + return result; + } + + /** remove item from the list + ** @param idx index of the item to be removed (starting from 1) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition removeItem(const size_t idx) + { + OFCondition result = EC_IllegalParameter; + OFLIST_TYPENAME OFListIterator(T) iterator = ItemList.begin(); + if (gotoItemPos(idx, iterator)) + { + ItemList.erase(iterator); + result = EC_Normal; + } + return result; + } + + + protected: + + /** goto specified item position + ** @param idx index of the item to go to (starting from 1) + * @param iterator list iterator storing the position of the item + ** @return OFTrue if specified item was found, OFFalse otherwise + */ + OFBool gotoItemPos(size_t idx, + OFLIST_TYPENAME OFListConstIterator(T) &iterator) const + { + OFBool result = OFFalse; + if (idx > 0) + { + const OFLIST_TYPENAME OFListConstIterator(T) endPos = ItemList.end(); + while ((--idx > 0) && (iterator != endPos)) + iterator++; + /* index found? */ + result = (idx == 0); + } + return result; + } + + /** goto specified item + ** @param item value of the item to go to (starting from 1) + * @param iterator list iterator storing the position of the item + ** @return OFTrue if specified item was found, OFFalse otherwise + */ + OFBool gotoItem(const T &item, + OFLIST_TYPENAME OFListConstIterator(T) &iterator) const + { + const OFLIST_TYPENAME OFListConstIterator(T) endPos = ItemList.end(); + /* operator== is used to reduce requirements for class T */ + while ((iterator != endPos) && (!(*iterator == item))) + iterator++; + return (iterator != endPos); + } + + protected: + + /// the list maintained by this class + OFList ItemList; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtnant.h b/dcmsr/include/dcmtk/dcmsr/dsrtnant.h new file mode 100644 index 00000000..8f4a93ca --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtnant.h @@ -0,0 +1,126 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTreeNodeAnnotation + * + */ + + +#ifndef DSRTNANT_H +#define DSRTNANT_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsdefine.h" +#include "dcmtk/dcmsr/dsrtypes.h" + + +/** Base class for tree node annotations. + * Currently, this class supports textual annotations only. + */ +class DSRTreeNodeAnnotation +{ + + public: + + /** (default) constructor + ** @param text optional character string that should be set as the initial value + * of the annotation text + */ + DSRTreeNodeAnnotation(const OFString &text = OFString()) + : Text(text) + { + } + + /** destructor + */ + virtual ~DSRTreeNodeAnnotation() + { + } + + /** conversion operator that returns the currently stored annotation text + */ + operator const OFString &() const + { + return Text; + } + + /** comparison operator. + * Two annotations are equal, if the internally stored character strings (text) + * have the same value. + ** @param annotation annotation that should be compared to the current one + ** @return OFTrue if both annotations are equal, OFFalse otherwise + */ + OFBool operator==(const DSRTreeNodeAnnotation &annotation) const + { + return (Text == annotation.Text); + } + + /** comparison operator. + * Two annotations are not equal, if the internally stored character strings + * (text) have different values. + ** @param annotation annotation that should be compared to the current one + ** @return OFTrue if both annotations are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRTreeNodeAnnotation &annotation) const + { + return (Text != annotation.Text); + } + + /** clear the currently stored annotation text + */ + inline void clear() + { + Text.clear(); + } + + /** check whether the annotation is empty, i.e.\ whether the internally stored + * character string (text) has an empty value + ** @return OFTrue if the annotation is empty, OFFalse otherwise + */ + inline OFBool isEmpty() const + { + return Text.empty(); + } + + /** get annotation text, i.e.\ the internally stored character string + ** @return internally stored character string (text), might be empty + */ + inline const OFString &getText() const + { + return Text; + } + + /** set annotation text, i.e.\ the internally stored character string + ** @param text character string that should be set as the current value of the + * annotation text. Use an empty string ("") to delete the value. + */ + inline void setText(const OFString &text) + { + Text = text; + } + + + private: + + /// internally stored character strings (text) + OFString Text; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtncsr.h b/dcmsr/include/dcmtk/dcmsr/dsrtncsr.h new file mode 100644 index 00000000..544b1661 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtncsr.h @@ -0,0 +1,858 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTreeNodeCursor + * + */ + + +#ifndef DSRTNCSR_H +#define DSRTNCSR_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrposcn.h" +#include "dcmtk/dcmsr/dsrtnant.h" + +#include "dcmtk/ofstd/ofstack.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DSRTreeNode; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class implementing a tree node cursor. + ** @tparam T template type used for the tree node pointers + */ +template +class DSRTreeNodeCursor +{ + + public: + + /** default constructor + */ + DSRTreeNodeCursor(); + + /** copy constructor + ** @param cursor object to be copied + */ + DSRTreeNodeCursor(const DSRTreeNodeCursor &cursor); + + /** constructor. + * See comments on setCursor(T*) method. + ** @param node pointer to tree node used to initialize the cursor + * @param position optional pointer to position counter that should be used to + * initialize the internal counter + */ + DSRTreeNodeCursor(T *node, + const DSRPositionCounter *position = NULL); + + /** destructor + */ + virtual ~DSRTreeNodeCursor(); + + /** assignment operator + ** @param cursor object to be copied + ** @return reference to modified cursor (this object) + */ + DSRTreeNodeCursor &operator=(const DSRTreeNodeCursor &cursor); + + /** assignment operator. + * See comments on setCursor(T*) method. + ** @param node node to which the cursor should be set + ** @return reference to modified cursor (this object) + */ + DSRTreeNodeCursor &operator=(T *node); + + /** clear all member variables. + * The cursor becomes invalid afterwards (same state as after default construction). + */ + virtual void clear(); + + /** check whether cursor currently points to a valid node + ** @return OFTrue if valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** count number of children of the current node. + * This method iterates over all children of the current node, either on all + * sub-levels or on the first child level only. + ** @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the first child level only + ** @return number of children of the current node, 0 if none + */ + virtual size_t countChildNodes(const OFBool searchIntoSub = OFTrue) const; + + /** check whether the current node has a parent + ** @return OFTrue if the current node has a parent, OFFalse otherwise + */ + inline OFBool hasParentNode() const; + + /** check whether the current node has any children + ** @return OFTrue if the current node has any children, OFFalse otherwise + */ + inline OFBool hasChildNodes() const; + + /** check whether the current node has a preceding sibling + ** @return OFTrue if the current node has a preceding sibling, OFFalse otherwise + */ + inline OFBool hasPreviousNode() const; + + /** check whether the current node has a following sibling + ** @return OFTrue if the current node has a following sibling, OFFalse otherwise + */ + inline OFBool hasNextNode() const; + + /** check whether the current node has any siblings + ** @return OFTrue if the current node has any siblings, OFFalse otherwise + */ + inline OFBool hasSiblingNodes() const; + + /** get pointer to current node + ** @return pointer to current node (might be NULL) + */ + virtual T *getNode() const; + + /** get pointer to parent node. + * Can be used to have a lookup to the parent node without changing the cursor. + ** @return pointer to parent node (if any), NULL otherwise + */ + virtual const T *getParentNode() const; + + /** get pointer to first child node. + * Can be used to have a lookup to the first child node without changing the cursor. + ** @return pointer to first child node (if any), NULL otherwise + */ + virtual const T *getChildNode() const; + + /** get pointer to previous node. + * Can be used to have a lookup to the previous node without changing the cursor. + ** @return pointer to previous node (if any), NULL otherwise + */ + virtual const T *getPreviousNode() const; + + /** get pointer to next node. + * Can be used to have a lookup to the next node without changing the cursor. + ** @return pointer to next node (if any), NULL otherwise + */ + virtual const T *getNextNode() const; + + /** goto first node on the same level (first sibling). + * Please note that the first node might be identical to the current node. + ** @return ID of the first node if successful, 0 otherwise + */ + virtual size_t gotoFirst(); + + /** goto last node on the same level (last sibling). + * Please note that the last node might be identical to the current node. + ** @return ID of the last node if successful, 0 otherwise + */ + virtual size_t gotoLast(); + + /** goto previous node on the same level (preceding sibling) + ** @return ID of the previous node if successful, 0 otherwise + */ + virtual size_t gotoPrevious(); + + /** goto next node on the same level (following sibling) + ** @return ID of the next node if successful, 0 otherwise + */ + virtual size_t gotoNext(); + + /** goto parent node (one level up) + ** @return ID of the parent node if successful, 0 otherwise + */ + virtual size_t goUp(); + + /** goto first child node (one level down) + ** @return ID of the first child node if successful, 0 otherwise + */ + virtual size_t goDown(); + + /** @copydoc goUp() + */ + virtual size_t gotoParent(); + + /** @copydoc goDown() + */ + virtual size_t gotoChild(); + + /** iterate over all nodes (starting from current position!) + ** @param searchIntoSub flag indicating whether to search into sub-trees + * ("deep search") or on the current level only + ** @return ID of the next node if successful, 0 otherwise + */ + virtual size_t iterate(const OFBool searchIntoSub = OFTrue); + + /** set cursor to specified node. Starts search from current position. + ** @param searchID ID of the node to set the cursor to + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const size_t searchID); + + /** set cursor to specified node. Starts search from current position. + ** @param position position string of the node to set the cursor to. + * (the format is e.g. "1.2.3" for the third child of the + * second child of the first node - see getPosition()). + * @param separator character used to separate the figures (default: '.') + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const OFString &position, + const char separator = '.'); + + /** set cursor to specified node. Starts search from current position. + ** @param annotation annotation of the node to set the cursor to + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const DSRTreeNodeAnnotation &annotation); + + /** set cursor to specified node. Starts search from current position. + * This method requires that T implements the comparison operator "not equal". + ** @param nodeValue value of the node to set the cursor to + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const T &nodeValue); + + /** get current node ID. + * The node ID uniquely identifies a content item in the document tree. Most of + * the navigation methods above do return this ID too. + ** @return ID of the current node if valid, 0 otherwise + */ + inline size_t getNodeID() const; + + /** get current level. + * The level starts with 1 for the root node, then 2 for its child nodes, etc. + ** @return number of the current level if valid, 0 otherwise + */ + inline size_t getLevel() const; + + /** get reference to internal position counter. + * Please note that this method allows for manipulating the internal position + * counter, so handle with care! + ** @return reference to internal position counter + */ + inline DSRPositionCounter &getPositionCounter(); + + /** get position string of the current node. + * Specifies the position of each node by means of a dot separated string of + * position counters. The first figure of this string specifies the position + * within the first level (e.g. "1"), the second one the position in the second + * level (e.g. "2"), the third one the position in the third level (e.g. "3"), + * etc. A position string of "1.2.3" would, therefore, point to the third child + * of the second child of the first node. + ** @param position variable where the position string should be stored + * @param separator character used to separate the figures (default: '.') + ** @return reference to the resulting position string (empty if invalid) + */ + inline const OFString &getPosition(OFString &position, + const char separator = '.') const; + + + protected: + + /** fast, non-throwing swap function. + * The time complexity of this function is constant. + ** @param cursor cursor to swap with + */ + void swap(DSRTreeNodeCursor &cursor); + + /** clear the internal node cursor stack + */ + void clearNodeCursorStack(); + + /** get cursor + ** @return reference to cursor (this object) + */ + inline const DSRTreeNodeCursor &getCursor() const; + + /** set cursor to specified object + ** @param cursor object to set this cursor to + */ + inline void setCursor(const DSRTreeNodeCursor &cursor); + + /** set cursor to specified node. + * Clears the internal position counter and sets the position of the current level + * to 1 (if the passed 'node' is valid) or 0 (if the 'node' is invalid). + ** @param node node to which the cursor should be set + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t setCursor(T *node); + + /** get pointer to first child node + ** @return pointer to first child node (if any), NULL otherwise + */ + T *getChild() const; + + /// pointer to current node + T *NodeCursor; + /// stack of node pointers. Used to store the cursor position of upper levels. + OFStack NodeCursorStack; + + /// counter for the current position within the current level and on upper levels + DSRPositionCounter Position; +}; + + +/*------------------* + * implementation * + *------------------*/ + +template +DSRTreeNodeCursor::DSRTreeNodeCursor() + : NodeCursor(NULL), + NodeCursorStack(), + Position() +{ +} + + +template +DSRTreeNodeCursor::DSRTreeNodeCursor(const DSRTreeNodeCursor &cursor) + : NodeCursor(cursor.NodeCursor), + NodeCursorStack(cursor.NodeCursorStack), + Position(cursor.Position) +{ +} + + +template +DSRTreeNodeCursor::DSRTreeNodeCursor(T *node, + const DSRPositionCounter *position) + : NodeCursor(node), + NodeCursorStack(), + Position() +{ + /* check whether a valid position counter is given */ + if (position != NULL) + { + if (position->isValid()) + Position = *position; + else + Position.initialize(NodeCursor != NULL, position->getFlags()); + } else + Position.initialize(NodeCursor != NULL); +} + + +template +DSRTreeNodeCursor::~DSRTreeNodeCursor() +{ +} + + +template +DSRTreeNodeCursor &DSRTreeNodeCursor::operator=(const DSRTreeNodeCursor &cursor) +{ + setCursor(cursor); + return *this; +} + + +template +DSRTreeNodeCursor &DSRTreeNodeCursor::operator=(T *node) +{ + setCursor(node); + return *this; +} + + +template +void DSRTreeNodeCursor::clear() +{ + NodeCursor = NULL; + clearNodeCursorStack(); + Position.clear(); +} + + +template +OFBool DSRTreeNodeCursor::isValid() const +{ + return (NodeCursor != NULL); +} + + +template +size_t DSRTreeNodeCursor::countChildNodes(const OFBool searchIntoSub) const +{ + size_t count = 0; + if (NodeCursor != NULL) + { + /* do we have any children at all? */ + DSRTreeNodeCursor cursor(NodeCursor->getDown()); + if (cursor.isValid()) + { + /* iterate over all child nodes */ + do { + ++count; + } while (cursor.iterate(searchIntoSub)); + } + } + return count; +} + + +template +OFBool DSRTreeNodeCursor::hasParentNode() const +{ + return ((NodeCursor != NULL) && !NodeCursorStack.empty()); +} + + +template +OFBool DSRTreeNodeCursor::hasChildNodes() const +{ + return (getChildNode() != NULL); +} + + +template +OFBool DSRTreeNodeCursor::hasPreviousNode() const +{ + return (getPreviousNode() != NULL); +} + + +template +OFBool DSRTreeNodeCursor::hasNextNode() const +{ + return (getNextNode() != NULL); +} + + +template +OFBool DSRTreeNodeCursor::hasSiblingNodes() const +{ + return (getPreviousNode() != NULL) || (getNextNode() != NULL); +} + + +template +T *DSRTreeNodeCursor::getNode() const +{ + return NodeCursor; +} + + +template +const T *DSRTreeNodeCursor::getParentNode() const +{ + T *node = NULL; + if (hasParentNode()) + node = NodeCursorStack.top(); + return node; +} + + +template +const T *DSRTreeNodeCursor::getChildNode() const +{ + T *node = NULL; + if (NodeCursor != NULL) + node = NodeCursor->getDown(); + return node; +} + + +template +const T *DSRTreeNodeCursor::getPreviousNode() const +{ + T *node = NULL; + if (NodeCursor != NULL) + node = NodeCursor->getPrev(); + return node; +} + + +template +const T *DSRTreeNodeCursor::getNextNode() const +{ + T *node = NULL; + if (NodeCursor != NULL) + node = NodeCursor->getNext(); + return node; +} + + +template +size_t DSRTreeNodeCursor::gotoFirst() +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + while (NodeCursor->getPrev() != NULL) + { + NodeCursor = NodeCursor->getPrev(); + --Position; + } + nodeID = NodeCursor->getIdent(); + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoLast() +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + while (NodeCursor->getNext() != NULL) + { + NodeCursor = NodeCursor->getNext(); + ++Position; + } + nodeID = NodeCursor->getIdent(); + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoPrevious() +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + if (NodeCursor->getPrev() != NULL) + { + NodeCursor = NodeCursor->getPrev(); + nodeID = NodeCursor->getIdent(); + --Position; + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoNext() +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + if (NodeCursor->getNext() != NULL) + { + NodeCursor = NodeCursor->getNext(); + nodeID = NodeCursor->getIdent(); + ++Position; + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::goUp() +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + if (!NodeCursorStack.empty()) + { + T *cursor = NodeCursorStack.top(); + NodeCursorStack.pop(); + if (cursor != NULL) + { + NodeCursor = cursor; + nodeID = NodeCursor->getIdent(); + Position.goUp(); + } + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::goDown() +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + if (NodeCursor->getDown() != NULL) + { + NodeCursorStack.push(NodeCursor); + NodeCursor = NodeCursor->getDown(); + nodeID = NodeCursor->getIdent(); + Position.goDown(); + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoParent() +{ + return goUp(); +} + + +template +size_t DSRTreeNodeCursor::gotoChild() +{ + return goDown(); +} + + +template +size_t DSRTreeNodeCursor::iterate(const OFBool searchIntoSub) +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + /* perform "deep search", if specified */ + if (searchIntoSub && (NodeCursor->getDown() != NULL)) + { + NodeCursorStack.push(NodeCursor); + NodeCursor = NodeCursor->getDown(); + nodeID = NodeCursor->getIdent(); + Position.goDown(); + } + else if (NodeCursor->getNext() != NULL) + { + NodeCursor = NodeCursor->getNext(); + nodeID = NodeCursor->getIdent(); + ++Position; + } + else if (searchIntoSub && !NodeCursorStack.empty()) + { + do { + if (!NodeCursorStack.empty()) + { + NodeCursor = NodeCursorStack.top(); + NodeCursorStack.pop(); + Position.goUp(); + } else + NodeCursor = NULL; + } while ((NodeCursor != NULL) && (NodeCursor->getNext() == NULL)); + if (NodeCursor != NULL) + { + if (NodeCursor->getNext() != NULL) + { + NodeCursor = NodeCursor->getNext(); + nodeID = NodeCursor->getIdent(); + ++Position; + } + } + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoNode(const size_t searchID) +{ + size_t nodeID = 0; + if (searchID > 0) + { + if (NodeCursor != NULL) + { + nodeID = NodeCursor->getIdent(); + while ((nodeID > 0) && (nodeID != searchID)) + nodeID = iterate(); + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoNode(const OFString &position, + const char separator) +{ + size_t nodeID = 0; + if (!position.empty()) + { + if (NodeCursor != NULL) + { + nodeID = NodeCursor->getIdent(); + size_t posStart = 0; + size_t posEnd = 0; + size_t goCount = 0; + do { + /* go down after first valid substring/segment */ + if (posStart > 0) + nodeID = goDown(); + /* current node still valid? */ + if (nodeID > 0) + { + /* search for next separator */ + posEnd = position.find(separator, posStart); + /* is last segment? */ + if (posEnd == OFString_npos) + goCount = DSRTypes::stringToNumber(position.substr(posStart).c_str()); + else { + goCount = DSRTypes::stringToNumber(position.substr(posStart, posEnd - posStart).c_str()); + posStart = posEnd + 1; + } + /* is valid number? */ + if (goCount > 0) + { + while ((nodeID > 0) && (goCount > 1)) + { + nodeID = gotoNext(); + goCount--; + } + } else + nodeID = 0; + } + } while ((nodeID > 0) && (posEnd != OFString_npos)); + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoNode(const DSRTreeNodeAnnotation &annotation) +{ + size_t nodeID = 0; + if (!annotation.isEmpty()) + { + if (NodeCursor != NULL) + { + nodeID = NodeCursor->getIdent(); + while ((nodeID > 0) && (NodeCursor->getAnnotation() != annotation)) + nodeID = iterate(); + } + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::gotoNode(const T &nodeValue) +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + { + nodeID = NodeCursor->getIdent(); + while ((nodeID > 0) && (*NodeCursor != nodeValue)) + nodeID = iterate(); + } + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::getNodeID() const +{ + size_t nodeID = 0; + if (NodeCursor != NULL) + nodeID = NodeCursor->getIdent(); + return nodeID; +} + + +template +size_t DSRTreeNodeCursor::getLevel() const +{ + size_t level = 0; + if (NodeCursor != NULL) + level = NodeCursorStack.size() + 1; + return level; +} + + +template +DSRPositionCounter &DSRTreeNodeCursor::getPositionCounter() +{ + return Position; +} + + +template +const OFString &DSRTreeNodeCursor::getPosition(OFString &position, + const char separator) const +{ + return Position.getString(position, separator); +} + + +// protected methods + +template +void DSRTreeNodeCursor::swap(DSRTreeNodeCursor &cursor) +{ + /* swap all members */ + OFswap(NodeCursor, cursor.NodeCursor); + OFswap(NodeCursorStack, cursor.NodeCursorStack); + OFswap(Position, cursor.Position); +} + + +template +void DSRTreeNodeCursor::clearNodeCursorStack() +{ + while (!NodeCursorStack.empty()) + NodeCursorStack.pop(); +} + + +template +const DSRTreeNodeCursor &DSRTreeNodeCursor::getCursor() const +{ + return *this; +} + + +template +void DSRTreeNodeCursor::setCursor(const DSRTreeNodeCursor &cursor) +{ + NodeCursor = cursor.NodeCursor; + NodeCursorStack = cursor.NodeCursorStack; + Position = cursor.Position; +} + + +template +size_t DSRTreeNodeCursor::setCursor(T *node) +{ + size_t nodeID = 0; + NodeCursor = node; + if (NodeCursor != NULL) + nodeID = NodeCursor->getIdent(); + clearNodeCursorStack(); + Position.initialize(NodeCursor != NULL); + return nodeID; +} + + +template +T *DSRTreeNodeCursor::getChild() const +{ + T *node = NULL; + if (NodeCursor != NULL) + node = NodeCursor->getDown(); + return node; +} + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtpltn.h b/dcmsr/include/dcmtk/dcmsr/dsrtpltn.h new file mode 100644 index 00000000..8e82e6c7 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtpltn.h @@ -0,0 +1,265 @@ +/* + * + * Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRIncludedTemplateTreeNode + * + */ + + +#ifndef DSRTPLTN_H +#define DSRTPLTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrstpl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for managing included templates (internal) + */ +class DCMTK_DCMSR_EXPORT DSRIncludedTemplateTreeNode + : public DSRDocumentTreeNode +{ + + public: + + /** constructor. + * Also sets the template identification if available from 'referencedTemplate'. + ** @param referencedTemplate shared pointer to template that should be managed + * @param defaultRelType default relationship type of the included template + */ + DSRIncludedTemplateTreeNode(const DSRSharedSubTemplate &referencedTemplate, + const E_RelationshipType defaultRelType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRIncludedTemplateTreeNode(const DSRIncludedTemplateTreeNode &node); + + /** destructor + */ + virtual ~DSRIncludedTemplateTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRIncludedTemplateTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base class is valid and the reference to the + * included template is valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the reference to the included + * template is valid. See getValue(). + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * This method is used to check whether the rendered output of this content item can + * be expanded inline or not (used for renderHTML()). + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: # INCLUDE TID 1600 (DCMR) + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content of included template in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful (or included template is empty, so there + * is nothing to do), an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** get reference to included template, i.e.\ the value of this content item + ** @return reference to included template. The managed pointer might be NULL. + */ + inline const DSRSharedSubTemplate &getValue() const + { + return ReferencedTemplate; + } + + /** set reference to included template, i.e.\ the value of this content item. + * Currently, no checks are performed on the passed 'referencedTemplate' parameter. + ** @param referencedTemplate shared pointer to template that should be managed + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition setValue(const DSRSharedSubTemplate &referencedTemplate); + + + protected: + + /** read content item from dataset + ** @param dataset dummy parameter + * @param constraintChecker dummy parameter + * @param flags dummy parameter + ** @return always returns SR_EC_CannotProcessIncludedTemplates + */ + virtual OFCondition read(DcmItem &dataset, + const DSRIODConstraintChecker *constraintChecker, + const size_t flags); + + /** write content item to dataset + ** @param dataset dummy parameter + * @param markedItems dummy parameter + ** @return always returns SR_EC_CannotProcessIncludedTemplates + */ + virtual OFCondition write(DcmItem &dataset, + DcmStack *markedItems = NULL); + + /** read general XML document tree node data + ** @param doc dummy parameter + * @param cursor dummy parameter + * @param documentType dummy parameter + * @param flags dummy parameter + ** @return always returns SR_EC_CannotProcessIncludedTemplates + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const E_DocumentType documentType, + const size_t flags); + + /** render content item in HTML/XHTML format + ** @param docStream dummy parameter + * @param annexStream dummy parameter + * @param nestingLevel dummy parameter + * @param annexNumber dummy parameter + * @param flags dummy parameter + ** @return always returns SR_EC_CannotProcessIncludedTemplates + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** set the concept name + ** @param conceptName dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this method should not be called + */ + virtual OFCondition setConceptName(const DSRCodedEntryValue &conceptName, + const OFBool check = OFTrue); + + /** set observation date/time + ** @param observationDateTime dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this method should not be called + */ + virtual OFCondition setObservationDateTime(const OFString &observationDateTime, + const OFBool check = OFTrue); + + /** set observation date/time from element + ** @param delem dummy parameter + * @param pos dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this method should not be called + */ + virtual OFCondition setObservationDateTime(const DcmElement &delem, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set observation date/time from dataset + ** @param dataset dummy parameter + * @param tagKey dummy parameter + * @param pos dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this method should not be called + */ + virtual OFCondition setObservationDateTime(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos = 0, + const OFBool check = OFTrue); + + /** set observation unique identifier + ** @param observationUID dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this method should not be called + */ + virtual OFCondition setObservationUID(const OFString &observationUID, + const OFBool check = OFTrue); + + /** set template identifier and mapping resource + ** @param templateIdentifier dummy parameter + * @param mappingResource dummy parameter + * @param mappingResourceUID dummy parameter + * @param check dummy parameter + ** @return always returns EC_IllegalCall, since this method should not be called + */ + virtual OFCondition setTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID = "", + const OFBool check = OFTrue); + + + private: + + /// shared pointer to included template that is managed by this class + DSRSharedSubTemplate ReferencedTemplate; + + + // --- declaration of default constructor and assignment operator + + DSRIncludedTemplateTreeNode(); + DSRIncludedTemplateTreeNode &operator=(const DSRIncludedTemplateTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtree.h b/dcmsr/include/dcmtk/dcmsr/dsrtree.h new file mode 100644 index 00000000..39be261d --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtree.h @@ -0,0 +1,988 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTreeNode, DSRTree + * + */ + + +#ifndef DSRTREE_H +#define DSRTREE_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtncsr.h" + +#include "dcmtk/ofstd/ofutil.h" + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +template class DSRTree; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for tree nodes + */ +class DCMTK_DCMSR_EXPORT DSRTreeNode + : protected DSRTypes +{ + // allow direct access to member variables + friend class DSRTree; + friend class DSRTree; + + public: + + /** (default) constructor + ** @param annotation optional annotation that should be set as the initial value + */ + DSRTreeNode(const DSRTreeNodeAnnotation &annotation = DSRTreeNodeAnnotation()) + : Prev(NULL), + Next(NULL), + Down(NULL), + Annotation(annotation), + Ident(IdentCounter++) // tbc: is this MT-safe? + { + } + + /** destructor + */ + virtual ~DSRTreeNode() + { + } + + /** clone this tree node. + * Actually, a new tree node is created since the pointer members are not needed. + * Only the optional annotation is copied. + ** @return copy of this tree node + */ + virtual DSRTreeNode *clone() const + { + return new DSRTreeNode(Annotation); + } + + /** get pointer to previous tree node + ** @return pointer to previous tree node (might be NULL) + */ + inline DSRTreeNode *getPrev() const + { + return Prev; + } + + /** get pointer to next tree node + ** @return pointer to next tree node (might be NULL) + */ + inline DSRTreeNode *getNext() const + { + return Next; + } + + /** get pointer to first child node + ** @return pointer to first child node (might be NULL) + */ + inline DSRTreeNode *getDown() const + { + return Down; + } + + /** get unique identifier of this node + ** @return unique identifier of this node + */ + inline size_t getIdent() const + { + return Ident; + } + + /** check whether this node has a (non-empty) annotation + ** @return OFTrue if this node has a (non-empty) annotation, OFFalse otherwise + */ + inline OFBool hasAnnotation() const + { + return !Annotation.isEmpty(); + } + + /** clear annotation of this node + */ + inline void clearAnnotation() + { + Annotation.clear(); + } + + /** get annotation of this node (optional) + ** @return annotation of this node (might be empty) + */ + inline const DSRTreeNodeAnnotation &getAnnotation() const + { + return Annotation; + } + + /** set annotation of this node (optional) + ** @param annotation annotation to be set + */ + inline void setAnnotation(const DSRTreeNodeAnnotation &annotation) + { + Annotation = annotation; + } + + + protected: + + /** get current value of global node counter + ** @return current value of global node counter + */ + inline static size_t getIdentCounter() + { + return IdentCounter; + } + + /// pointer to previous tree node (if any) + DSRTreeNode *Prev; + /// pointer to next tree node (if any) + DSRTreeNode *Next; + /// pointer to first child node (if any) + DSRTreeNode *Down; + + /// annotation of the tree node (optional) + DSRTreeNodeAnnotation Annotation; + + + private: + + /// unique identifier (created automatically) + const size_t Ident; + + /// global counter used to create the unique identifiers + static size_t IdentCounter; + + + // --- declaration of copy constructor and assignment operator + + DSRTreeNode(const DSRTreeNode &); + DSRTreeNode &operator=(const DSRTreeNode &); +}; + + +/** Class managing a tree of nodes + */ +template class DSRTree + : public DSRTreeNodeCursor, + protected DSRTypes +{ + + public: + + /** default constructor + */ + DSRTree(); + + /** copy constructor. + * Please note that the internal cursor is not copied but reset, i.e. set to the + * root node. + ** @param tree tree to be copied + */ + DSRTree(const DSRTree &tree); + + /** destructor + */ + virtual ~DSRTree(); + + /** assignment operator. + * Please note that internally the copy constructor is used, so the same comments + * apply. + ** @param tree tree to be copied + ** @return reference to this tree after copying + */ + DSRTree &operator=(DSRTree tree); + + /** clear all member variables, i.e.\ the tree with all nodes + */ + virtual void clear(); + + /** clear annotations of all tree nodes + */ + void clearAnnotations(); + + /** check whether tree has any nodes + ** @return OFTrue if tree is empty, OFFalse otherwise + */ + inline OFBool isEmpty() const; + + /** count number of nodes in the tree. + * This method iterates over all nodes that are stored in the tree. + ** @return number of nodes, 0 if tree is empty + */ + size_t countNodes() const; + + /** get ID of the next node to be created. + * The node ID uniquely identifies a content item in the document tree. + ** @return ID of the next node to be created (should never be 0) + */ + inline size_t getNextNodeID() const; + + /** set internal cursor to root node + ** @return ID of root node if successful, 0 otherwise + */ + inline size_t gotoRoot(); + + /** set internal cursor to specified node + ** @param searchID ID of the node to set the cursor to + * @param startFromRoot flag indicating whether to start from the root node + * or the current one + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const size_t searchID, + const OFBool startFromRoot = OFTrue); + + /** set internal cursor to specified node + ** @param reference position string of the node to set the cursor to. + * (the format is e.g. "1.2.3" for the third child of the + * second child of the first node - see DSRTreeNodeCursor). + * @param startFromRoot flag indicating whether to start from the root node + * or the current one + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const OFString &reference, + const OFBool startFromRoot = OFTrue); + + /** set internal cursor to specified node + ** @param annotation annotation of the node to set the cursor to + * @param startFromRoot flag indicating whether to start from the root node + * or the current one + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const DSRTreeNodeAnnotation &annotation, + const OFBool startFromRoot = OFTrue); + + /** set internal cursor to specified node (given by its value). + * This method requires that T implements the comparison operator "not equal". + ** @param nodeValue value of the node to set the cursor to + * @param startFromRoot flag indicating whether to start from the root node + * or the current one + ** @return ID of the new current node if successful, 0 otherwise + */ + size_t gotoNode(const T &nodeValue, + const OFBool startFromRoot = OFTrue); + + /** add new node to the current one. + * Please note that no copy of the given node is created. Therefore, the node + * should be created with new() - do not use a reference to a local variable. + * If the node could be added successfully, the cursor is set to it automatically. + ** @param node pointer to the new node to be added + * @param addMode flag specifying at which position to add the new node + ** @return ID of the new node if successful, 0 otherwise + */ + virtual size_t addNode(T *node, + const E_AddMode addMode = AM_afterCurrent); + + /** replace current node by the given one. + * Please note that no copy of the given node is created. Therefore, the node + * should be created with new() - do not use a reference to a local variable. If + * the node could be replaced successfully, the "old" node (and all of its child + * nodes) are deleted, and the cursor is set to the new one. + ** @param node pointer to the new node to replace the current one + ** @return ID of the new node if successful, 0 otherwise + */ + virtual size_t replaceNode(T *node); + + /** extract current node from tree. + * Please note that not only the specified node but also all of its child nodes are + * extracted from the tree. The cursor is set automatically to a new valid position. + ** @return pointer to extracted node, NULL in case of error (or the tree was empty) + */ + virtual T *extractNode(); + + /** get pointer to root node and "forget" the internal reference to this node. + * In other words: after calling this method, the stored tree will be empty. + * This also means that the caller is responsible for deleting the allocated memory. + ** @return pointer to root node, might be NULL (empty tree) + */ + virtual T *getAndRemoveRootNode(); + + /** remove current node from tree. + * Please note that not only the specified node but also all of its child nodes are + * removed from the tree and then deleted. The cursor is set automatically to a new + * valid position. + ** @return ID of the node which became the current one after deletion, 0 if an error + * occurred or the tree is now empty. + */ + virtual size_t removeNode(); + + /** extract a subtree, i.e.\ a fragment from this tree. + * The subtree is specified by the current node, which becomes the root of the subtree. + ** @return pointer to the extracted subtree, NULL in case of error + */ + virtual DSRTree *extractSubTree(); + + /** clone a subtree, i.e.\ a fragment of this tree. + * The cloning starts with the current node and ends with the given node. + ** @param stopAfterNodeID ID of the node after which the cloning should stop. + * By default (0), the process ends after cloning the + * current node with all of its child nodes (if any). + ** @return pointer to a copy of the specified subtree, NULL in case of error + */ + virtual DSRTree *cloneSubTree(const size_t stopAfterNodeID = 0) const; + + + protected: + + /** special constructor that receives a pointer to the root node. + * Please note that the 'rootNode' and the associated tree is not copied! + ** @param rootNode pointer to the root node of the "new" tree + */ + DSRTree(T *rootNode); + + /** special copy constructor that clones a particular subtree only + ** @param startCursor cursor pointing to first node of the subtree to be + * copied + * @param stopAfterNodeID ID of the node after which the cloning should stop + */ + DSRTree(const DSRTreeNodeCursor &startCursor, + size_t stopAfterNodeID); + + /** fast, non-throwing swap function. + * The time complexity of this function is constant. + ** @param tree tree to swap with + */ + void swap(DSRTree &tree); + + /** get pointer to root node + ** @return pointer to root node, might be NULL (empty tree) + */ + virtual T *getRoot() const; + + /** delete a tree given by its root node. + * Please note that the given 'rootNode' pointer becomes invalid afterwards. + ** @param rootNode pointer to the root node of the tree to be deleted + */ + virtual void deleteTreeFromRootNode(T *rootNode); + + + private: + + /// pointer to the root tree node + T *RootNode; +}; + + +/*------------------* + * implementation * + *------------------*/ + +template +DSRTree::DSRTree() + : DSRTreeNodeCursor(), + RootNode(NULL) +{ +} + + +template +DSRTree::DSRTree(const DSRTree &tree) + : DSRTreeNodeCursor(), + RootNode(NULL) +{ + if (!tree.isEmpty()) + { + E_AddMode addMode = AM_afterCurrent; + T *newNode = NULL; + T *nodeCursor = tree.getRoot(); + OFStack nodeCursorStack; + /* perform a "deep search", just like DSRTreeNodeCursor<>::iterate() */ + while (nodeCursor != NULL) + { + /* clone current node and add it to the tree */ + if (addNode(newNode = nodeCursor->clone(), addMode) == 0) + { + /* failed to add node, so delete it and exit the loop */ + delete newNode; + break; + } + /* then goto to the next node to be copied */ + if (nodeCursor->Down != NULL) + { + /* go one level down to the first child node */ + nodeCursorStack.push(nodeCursor); + nodeCursor = nodeCursor->getDown(); + addMode = AM_belowCurrent; + } + else if (nodeCursor->Next != NULL) + { + /* proceed with the following sibling */ + nodeCursor = nodeCursor->getNext(); + addMode = AM_afterCurrent; + } else { + /* check whether there are any siblings on higher levels */ + do { + if (!nodeCursorStack.empty()) + { + nodeCursor = nodeCursorStack.top(); + nodeCursorStack.pop(); + this->goUp(); + } else + nodeCursor = NULL; + } while ((nodeCursor != NULL) && (nodeCursor->Next == NULL)); + if (nodeCursor != NULL) + { + nodeCursor = nodeCursor->getNext(); + addMode = AM_afterCurrent; + } + } + } + /* initialize the cursor */ + gotoRoot(); + } +} + + +template +DSRTree::DSRTree(T *rootNode) + : DSRTreeNodeCursor(), + RootNode(rootNode) +{ + /* initialize the cursor */ + gotoRoot(); +} + + +template +DSRTree::DSRTree(const DSRTreeNodeCursor &startCursor, + size_t stopAfterNodeID) + : DSRTreeNodeCursor(), + RootNode(NULL) +{ + T *nodeCursor = startCursor.getNode(); + /* since we start from a particular node, we need to check it first */ + if (nodeCursor != NULL) + { + E_AddMode addMode = AM_afterCurrent; + T *newNode = NULL; + OFStack nodeCursorStack; + /* use current node if none was specified */ + if (stopAfterNodeID == 0) + stopAfterNodeID = nodeCursor->getIdent(); + /* perform a "deep search", just like DSRTreeNodeCursor<>::iterate() */ + while (nodeCursor != NULL) + { + /* clone current node and add it to the tree */ + if (addNode(newNode = nodeCursor->clone(), addMode) == 0) + { + /* failed to add node, so delete it and exit the loop */ + delete newNode; + break; + } + /* then goto to the next node to be copied */ + if (nodeCursor->Down != NULL) + { + /* go one level down to the first child node */ + nodeCursorStack.push(nodeCursor); + nodeCursor = nodeCursor->getDown(); + addMode = AM_belowCurrent; + } + else if (nodeCursor->Next != NULL) + { + /* check whether the last node has been processed */ + if (nodeCursor->getIdent() == stopAfterNodeID) + { + /* exit the loop */ + nodeCursor = NULL; + } else { + /* proceed with the following sibling */ + nodeCursor = nodeCursor->getNext(); + addMode = AM_afterCurrent; + } + } else { + /* check whether there are any siblings on higher levels */ + do { + if (!nodeCursorStack.empty()) + { + nodeCursor = nodeCursorStack.top(); + nodeCursorStack.pop(); + this->goUp(); + /* check whether the last node has been processed */ + if ((nodeCursor != NULL) && (nodeCursor->getIdent() == stopAfterNodeID)) + { + /* exit the loop */ + nodeCursor = NULL; + } + } else + nodeCursor = NULL; + } while ((nodeCursor != NULL) && (nodeCursor->Next == NULL)); + if (nodeCursor != NULL) + { + nodeCursor = nodeCursor->getNext(); + addMode = AM_afterCurrent; + } + } + } + /* initialize the cursor */ + gotoRoot(); + } +} + + +template +DSRTree::~DSRTree() +{ + clear(); +} + + +template +DSRTree &DSRTree::operator=(DSRTree tree) +{ + /* by-value parameter serves as a temporary */ + swap(tree); + return *this; +} + + +template +void DSRTree::clear() +{ + if (gotoRoot()) + { + size_t nodeID = 0; + /* there might be more than one node at top-level */ + do { + /* so delete them all */ + nodeID = removeNode(); + } while (nodeID > 0); + } +} + + +template +void DSRTree::clearAnnotations() +{ + DSRTreeNodeCursor cursor(RootNode); + if (cursor.isValid()) + { + /* iterate over all nodes */ + do { + cursor.getNode()->clearAnnotation(); + } while (cursor.iterate()); + } +} + + +template +OFBool DSRTree::isEmpty() const +{ + return (RootNode == NULL); +} + + +template +size_t DSRTree::countNodes() const +{ + size_t count = 0; + DSRTreeNodeCursor cursor(RootNode); + if (cursor.isValid()) + { + /* iterate over all nodes */ + do { + ++count; + } while (cursor.iterate()); + } + return count; +} + + +template +size_t DSRTree::getNextNodeID() const +{ + /* current value of the counter used to create unique identifiers */ + return DSRTreeNode::getIdentCounter(); +} + + +template +size_t DSRTree::gotoRoot() +{ + return this->setCursor(RootNode); +} + + +template +size_t DSRTree::gotoNode(const size_t searchID, + const OFBool startFromRoot) +{ + size_t nodeID = 0; + if (searchID > 0) + { + if (startFromRoot) + gotoRoot(); + /* call the real function */ + nodeID = DSRTreeNodeCursor::gotoNode(searchID); + } + return nodeID; +} + + +template +size_t DSRTree::gotoNode(const OFString &reference, + const OFBool startFromRoot) +{ + size_t nodeID = 0; + if (!reference.empty()) + { + if (startFromRoot) + gotoRoot(); + /* call the real function */ + nodeID = DSRTreeNodeCursor::gotoNode(reference); + } + return nodeID; +} + + +template +size_t DSRTree::gotoNode(const DSRTreeNodeAnnotation &annotation, + const OFBool startFromRoot) +{ + size_t nodeID = 0; + if (!annotation.isEmpty()) + { + if (startFromRoot) + gotoRoot(); + /* call the real function */ + nodeID = DSRTreeNodeCursor::gotoNode(annotation); + } + return nodeID; +} + + +template +size_t DSRTree::gotoNode(const T &nodeValue, + const OFBool startFromRoot) +{ + if (startFromRoot) + gotoRoot(); + /* call the real function */ + return DSRTreeNodeCursor::gotoNode(nodeValue); +} + + +template +size_t DSRTree::addNode(T *node, + const E_AddMode addMode) +{ + size_t nodeID = 0; + /* make sure that 'node' points to a single node or to the "root" of a subtree */ + if ((node != NULL) && (node->Prev == NULL)) + { + if (this->NodeCursor != NULL) + { + DSRTreeNode *lastNode = node; + /* update references based on 'addMode' */ + switch (addMode) + { + case AM_afterCurrent: + node->Prev = this->NodeCursor; + /* goto last node (sibling), if any */ + while (lastNode->Next != NULL) + lastNode = lastNode->Next; + lastNode->Next = this->NodeCursor->Next; + /* connect to current node */ + if (this->NodeCursor->Next != NULL) + (this->NodeCursor->Next)->Prev = lastNode; + this->NodeCursor->Next = node; + ++this->Position; + break; + case AM_beforeCurrent: + node->Prev = this->NodeCursor->Prev; + /* goto last node (sibling), if any */ + while (lastNode->Next != NULL) + lastNode = lastNode->Next; + lastNode->Next = this->NodeCursor; + /* connect to current node */ + if ((this->NodeCursor->Prev != NULL) && (this->Position > 1)) + (this->NodeCursor->Prev)->Next = node; + else if (!this->NodeCursorStack.empty() && (this->Position == 1)) + this->NodeCursorStack.top()->Down = node; + this->NodeCursor->Prev = lastNode; + /* check whether root node has been replaced */ + if (this->NodeCursor == this->RootNode) + this->RootNode = node; + break; + case AM_belowCurrent: + /* store old position */ + this->Position.goDown(); + this->NodeCursorStack.push(this->NodeCursor); + /* parent node has already child nodes */ + if (this->NodeCursor->Down != NULL) + { + DSRTreeNode *tempNode = this->NodeCursor->Down; + /* goto last node (sibling) */ + while (tempNode->Next != NULL) + { + tempNode = tempNode->Next; + ++this->Position; + } + /* connect to last child */ + tempNode->Next = node; + node->Prev = tempNode; + ++this->Position; + } else + this->NodeCursor->Down = node; + break; + case AM_belowCurrentBeforeFirstChild: + /* store old position */ + this->Position.goDown(); + this->NodeCursorStack.push(this->NodeCursor); + /* parent node has already child nodes */ + if (this->NodeCursor->Down != NULL) + { + /* goto last node (sibling), if any */ + while (lastNode->Next != NULL) + lastNode = lastNode->Next; + /* connect to (current) first child */ + lastNode->Next = this->NodeCursor->Down; + (this->NodeCursor->Down)->Prev = lastNode; + } + this->NodeCursor->Down = node; + break; + } + this->NodeCursor = node; + } else { + /* originally, the tree was empty */ + this->RootNode = this->NodeCursor = node; + this->Position.initialize(); + } + nodeID = this->NodeCursor->getIdent(); + } + return nodeID; +} + + +template +size_t DSRTree::replaceNode(T *node) +{ + size_t nodeID = 0; + /* make sure that 'node' points to a single node or to the "root" of a subtree */ + if ((node != NULL) && (node->Prev == NULL)) + { + if (this->NodeCursor != NULL) + { + /* connect to previous node */ + if (this->NodeCursor->Prev != NULL) + { + (this->NodeCursor->Prev)->Next = node; + /* remove reference to former sibling */ + this->NodeCursor->Prev = NULL; + } else { + /* is there any direct parent node? */ + if (!this->NodeCursorStack.empty()) + { + DSRTreeNode *parent = this->NodeCursorStack.top(); + if (parent != NULL) + parent->Down = node; + } + } + /* connect to next node */ + if (this->NodeCursor->Next != NULL) + { + DSRTreeNode *lastNode = node; + /* goto last node (sibling), if any */ + while (lastNode->Next != NULL) + lastNode = lastNode->Next; + (this->NodeCursor->Next)->Prev = lastNode; + lastNode->Next = this->NodeCursor->Next; + /* remove reference to former sibling */ + this->NodeCursor->Next = NULL; + } + /* check whether root node has been replaced */ + if (this->NodeCursor == this->RootNode) + this->RootNode = node; + /* free memory of old (now replaced) node */ + deleteTreeFromRootNode(this->NodeCursor); + /* set cursor to new node */ + this->NodeCursor = node; + nodeID = node->getIdent(); + } + } + return nodeID; +} + + +template +T *DSRTree::extractNode() +{ + T *cursor = this->NodeCursor; + /* extract current node (incl. subtree) from tree */ + if (cursor != NULL) + { + /* are there any siblings? */ + if ((cursor->Prev != NULL) || (cursor->Next != NULL)) + { + /* connect to previous node */ + if (cursor->Prev != NULL) + (cursor->Prev)->Next = cursor->Next; + else + { + /* is there any direct parent node? */ + if (!this->NodeCursorStack.empty()) + { + DSRTreeNode *parent = this->NodeCursorStack.top(); + if (parent != NULL) + parent->Down = cursor->Next; + } + } + /* connect to next node */ + if (cursor->Next != NULL) + { + (cursor->Next)->Prev = cursor->Prev; + if (this->NodeCursor == this->RootNode) + this->RootNode = cursor->getNext(); // old root node deleted + this->NodeCursor = cursor->getNext(); + } else { + /* set cursor to previous node since there is no next node */ + this->NodeCursor = cursor->getPrev(); + --this->Position; + } + } else { + /* no siblings: check for child nodes */ + if (!this->NodeCursorStack.empty()) + { + this->NodeCursor = this->NodeCursorStack.top(); + this->NodeCursorStack.pop(); + this->Position.goUp(); + /* should never be NULL, but ... */ + if (this->NodeCursor != NULL) + this->NodeCursor->Down = NULL; + else + { + this->RootNode = NULL; // tree is now empty + this->Position.clear(); + } + } else { + this->RootNode = this->NodeCursor = NULL; // tree is now empty + this->Position.clear(); + } + } + /* remove references to former siblings */ + cursor->Prev = NULL; + cursor->Next = NULL; + } + return cursor; +} + + +template +T *DSRTree::getAndRemoveRootNode() +{ + T *root = RootNode; + /* "forget" reference to root node */ + RootNode = NULL; + return root; +} + + +template +size_t DSRTree::removeNode() +{ + size_t nodeID = 0; + /* extract current node (incl. subtree) from tree */ + T *cursor = extractNode(); + if (cursor != NULL) + { + /* delete all nodes from extracted subtree */ + /* (could also use the "new" DSRTreeNodeCursor class) */ + T *delNode = NULL; + OFStack cursorStack; + while (cursor != NULL) + { + delNode = cursor; + if (cursor->Down != NULL) + { + if (cursor->Next != NULL) + cursorStack.push(cursor->getNext()); + cursor = cursor->getDown(); + } + else if (cursor->Next != NULL) + cursor = cursor->getNext(); + else if (!cursorStack.empty()) + { + cursor = cursorStack.top(); + cursorStack.pop(); + } else + cursor = NULL; + delete delNode; + } + /* return identifier of (new) current node */ + if (this->NodeCursor != NULL) + nodeID = this->NodeCursor->getIdent(); + } + return nodeID; +} + + +template +DSRTree *DSRTree::extractSubTree() +{ + DSRTree *tree = NULL; + /* extract current node from tree and create a new tree object (with this root) */ + T *node = extractNode(); + if (node != NULL) + tree = new DSRTree(node); + return tree; +} + + +template +DSRTree *DSRTree::cloneSubTree(const size_t stopAfterNodeID) const +{ + /* create a copy of the specified subtree */ + return new DSRTree(this->NodeCursor, stopAfterNodeID); +} + + +// protected methods + +template +void DSRTree::swap(DSRTree &tree) +{ + /* swap inherited node cursor */ + DSRTreeNodeCursor::swap(tree); + /* swap pointer to the root tree node */ + OFswap(RootNode, tree.RootNode); +} + + +template +T *DSRTree::getRoot() const +{ + return RootNode; +} + + +template +void DSRTree::deleteTreeFromRootNode(T *rootNode) +{ + /* create a temporary tree object from the given node, */ + /* the content will be deleted during destruction */ + DSRTree tree(rootNode); +} + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrtypes.h b/dcmsr/include/dcmtk/dcmsr/dsrtypes.h new file mode 100644 index 00000000..d3915ac9 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrtypes.h @@ -0,0 +1,1600 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTypes + * + */ + + +#ifndef DSRTYPES_H +#define DSRTYPES_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsdefine.h" + +#include "dcmtk/dcmdata/dcelem.h" +#include "dcmtk/dcmdata/dcitem.h" +#include "dcmtk/dcmdata/dcsequen.h" + +#include "dcmtk/ofstd/ofstream.h" +#include "dcmtk/ofstd/ofstring.h" +#include "dcmtk/ofstd/oftypes.h" +#include "dcmtk/ofstd/ofcond.h" +#include "dcmtk/oflog/oflog.h" + + +// global definitions for logging mechanism provided by the oflog module + +extern DCMTK_DCMSR_EXPORT OFLogger DCM_dcmsrLogger; + +#define DCMSR_TRACE(msg) OFLOG_TRACE(DCM_dcmsrLogger, msg) +#define DCMSR_DEBUG(msg) OFLOG_DEBUG(DCM_dcmsrLogger, msg) +#define DCMSR_INFO(msg) OFLOG_INFO(DCM_dcmsrLogger, msg) +#define DCMSR_WARN(msg) OFLOG_WARN(DCM_dcmsrLogger, msg) +#define DCMSR_ERROR(msg) OFLOG_ERROR(DCM_dcmsrLogger, msg) +#define DCMSR_FATAL(msg) OFLOG_FATAL(DCM_dcmsrLogger, msg) + + +// include this file in doxygen documentation + +/** @file dsrtypes.h + * @brief type definitions, constants and helper functions for the dcmsr module + */ + + +/*---------------------* + * macro definitions * + *---------------------*/ + +// private coding scheme designator used for internal codes +#define OFFIS_CODING_SCHEME_DESIGNATOR "99_OFFIS_DCMTK" +// name of the private coding scheme +#define OFFIS_CODING_SCHEME_NAME "OFFIS DCMTK Coding Scheme" +// organization responsible for the private coding scheme +#define OFFIS_CODING_SCHEME_RESPONSIBLE_ORGANIZATION "OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany" + +// protocol, hostname and CGI script name used for HTML hyperlinks to composite objects +#define HTML_HYPERLINK_PREFIX_FOR_CGI "http://localhost/dicom.cgi" +// URL of the DICOM toolkit DCMTK +#define DCMTK_INTERNET_URL "http://dicom.offis.de/dcmtk" + +// XML namespace URI for dcmsr module +#define DCMSR_XML_NAMESPACE_URI "http://dicom.offis.de/dcmsr" +// XML Schema file for dcmsr module +#define DCMSR_XML_XSD_FILE "dsr2xml.xsd" +// XML Schema Instance URI +#define XML_SCHEMA_INSTANCE_URI "http://www.w3.org/2001/XMLSchema-instance" + +// ANSI escape codes for color output of the print() method +#define DCMSR_ANSI_ESCAPE_CODE_RESET "\033[0m" +#define DCMSR_ANSI_ESCAPE_CODE_DOCUMENT_TYPE "\033[22m\033[35m" +#define DCMSR_ANSI_ESCAPE_CODE_HEADER_NAME "\033[1m\033[34m" +#define DCMSR_ANSI_ESCAPE_CODE_HEADER_VALUE "\033[1m\033[37m" +#define DCMSR_ANSI_ESCAPE_CODE_ITEM_POSITION "\033[22m\033[36m" +#define DCMSR_ANSI_ESCAPE_CODE_VALUE_TYPE "\033[22m\033[31m" +#define DCMSR_ANSI_ESCAPE_CODE_RELATIONSHIP_TYPE "\033[22m\033[32m" +#define DCMSR_ANSI_ESCAPE_CODE_CONCEPT_NAME "\033[22m\033[33m" +#define DCMSR_ANSI_ESCAPE_CODE_ITEM_VALUE "\033[1m\033[37m" +#define DCMSR_ANSI_ESCAPE_CODE_TEMPLATE_ID "\033[22m\033[35m" +#define DCMSR_ANSI_ESCAPE_CODE_ANNOTATION "\033[22m\033[36m" +#define DCMSR_ANSI_ESCAPE_CODE_DELIMITER "\033[1m\033[30m" + +// helper macro for the conditional usage of ANSI escape codes +#define DCMSR_PRINT_ANSI_ESCAPE_CODE(ansi_code) \ + if (flags & PF_useANSIEscapeCodes) \ + { \ + stream << ansi_code; \ + } + + +/*------------------------* + * forward declarations * + *------------------------*/ + +class DSRXMLCursor; +class DSRXMLDocument; +class DSRDocumentTreeNode; +class DSRIODConstraintChecker; + + +/*-----------------------* + * constant definitions * + *-----------------------*/ + +/** @name specific error conditions for module dcmsr. + * These error codes can be used in addition to the general purpose + * codes defined in module dcmdata. + */ +//@{ + +/// error: the document type (SOP class UID) is unknown or not supported +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_UnknownDocumentType; + +/// error: the document status is invalid +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidDocument; + +/// error: the document tree is invalid (e.g. corrupted structure) +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidDocumentTree; + +/// error: a mandatory attribute is missing +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_MandatoryAttributeMissing; + +/// error: a value is invalid according to the DICOM standard +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidValue; + +/// error: a value is not supported by this implementation +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_UnsupportedValue; + +/// error: an unknown value type is used +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_UnknownValueType; + +/// error: an unknown relationship type is used +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_UnknownRelationshipType; + +/// error: the by-value relationship between two content items is not allowed +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidByValueRelationship; + +/// error: the by-reference relationship between two content items is not allowed +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidByReferenceRelationship; + +/// error: the specified SOP instance could not be found +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_SOPInstanceNotFound; + +/// error: a SOP instance has different SOP classes +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_DifferentSOPClassesForAnInstance; + +/// error: the specified coding scheme designator could not be found +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CodingSchemeNotFound; + +/// error: the XML structure is corrupted (XML parser error) +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CorruptedXMLStructure; + +/// error: the requested representation is not available +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_RepresentationNotAvailable; + +/// error: an icon image could not be created from the given DICOM image +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CannotCreateIconImage; + +/// error: a new content item could not be added to the current one +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CannotAddContentItem; + +/// error: an invalid concept name code has been passed or is used +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidConceptName; + +/// error: a given subtree could not be inserted at the current node +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CannotInsertSubTree; + +/// error: the current relationship type cannot be replaced by the given one +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CannotChangeRelationshipType; + +/// error: the document tree does not comply with the given SR IOD constraints +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_IncompatibleDocumentTree; + +/// error: the specified content item (node) could not be found +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_ContentItemNotFound; + +/// error: the specified subtree could not be removed from the document tree +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CannotRemoveSubTree; + +/// error: the document tree is empty (and this is not allowed in this context) +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_EmptyDocumentTree; + +/// error: the content item is invalid, e.g. the concept name or the stored value +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidContentItem; + +/// error: template identification cannot be used, i.e. requirements are not fulfilled +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CannotUseTemplateIdentification; + +/// error: cannot add content item or insert subtree to non-extensible template +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_NonExtensibleTemplate; + +/// error: cannot add coded entry to non-extensible context group +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_NonExtensibleContextGroup; + +/// error: a given coded entry in not contained in the context group +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CodedEntryNotInContextGroup; + +/// normal: a given coded entry is contained in the context group (i.e. a standard code) +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CodedEntryInStandardContextGroup; + +/// normal: a given coded entry is known as an extension of the context group +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CodedEntryIsExtensionOfContextGroup; + +/// error: a value violates the value set constraint of a particular template row +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_ValueSetConstraintViolated; + +/// error: the internally managed structure of a template class is invalid +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_InvalidTemplateStructure; + +/// error: cannot process document tree with included templates +extern DCMTK_DCMSR_EXPORT const OFConditionConst SR_EC_CannotProcessIncludedTemplates; + +//@} + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** General purpose class hiding global functions, constants and types from the + * global namespace. Some of them might be moved to 'ofstd' later on. + * All functions and constants are static and can, therefore, be accessed without + * creating an instance of this class. + */ +class DCMTK_DCMSR_EXPORT DSRTypes +{ + + public: + + // --- constant declarations --- + + /** @name read() flags + * These flags can be combined and passed to the read() methods. + * The 'shortcut' flags can be used for common combinations. + */ + //@{ + + /// read digital signatures from dataset + static const size_t RF_readDigitalSignatures; + + /// accept unknown/missing relationship type + static const size_t RF_acceptUnknownRelationshipType; + + /// accept invalid content item value (e.g. violation of VR or VM definition) + static const size_t RF_acceptInvalidContentItemValue; + + /// ignore relationship constraints for this document class + static const size_t RF_ignoreRelationshipConstraints; + + /// do not abort on content item errors (e.g. missing value type specific attributes) + static const size_t RF_ignoreContentItemErrors; + + /// do not abort when detecting an invalid content item, skip invalid sub-tree instead + static const size_t RF_skipInvalidContentItems; + + /// show the currently processed content item (e.g. "1.2.3") + static const size_t RF_showCurrentlyProcessedItem; + //@} + + + /** @name renderHTML() flags + * These flags can be combined and passed to the renderHMTL() methods. + * Please note that only the 'external' flags can be used from outside + * this library. The 'shortcut' flags can be used for common combinations. + */ + //@{ + + /// external: never expand child nodes inline + static const size_t HF_neverExpandChildrenInline; + + /// external: always expand child nodes inline + static const size_t HF_alwaysExpandChildrenInline; + + /// external: render codes even if they appear inline + static const size_t HF_renderInlineCodes; + + /// external: render code details as a tooltip (not with HTML 3.2) + static const size_t HF_useCodeDetailsTooltip; + + /// external: render concept name codes (default: code meaning only) + static const size_t HF_renderConceptNameCodes; + + /// external: render the code of the numeric measurement unit + static const size_t HF_renderNumericUnitCodes; + + /// external: use code meaning for the numeric measurement unit (default: code value) + static const size_t HF_useCodeMeaningAsUnit; + + /// external: use patient information as document title (default: document type) + static const size_t HF_renderPatientTitle; + + /// external: render no general document information (header) + static const size_t HF_renderNoDocumentHeader; + + /// external: render dcmtk/dcmsr comment at the end of the document + static const size_t HF_renderDcmtkFootnote; + + /// external: render the full data of all content items + static const size_t HF_renderFullData; + + /// external: render section titles inline (default: separate paragraph) + static const size_t HF_renderSectionTitlesInline; + + /// external: copy Cascading Style Sheet (CSS) content to HTML file + static const size_t HF_copyStyleSheetContent; + + /// external: output compatible to HTML version 3.2 (default: 4.01) + static const size_t HF_HTML32Compatibility; + + /// external: output compatible to XHTML version 1.1 (default: HTML 4.01) + static const size_t HF_XHTML11Compatibility; + + /// external: add explicit reference to HTML document type (DTD) + static const size_t HF_addDocumentTypeReference; + + /// external: omit generator meta element referring to the DCMTK + static const size_t HF_omitGeneratorMetaElement; + + /// internal: render items separately (for container with SEPARATE flag) + static const size_t HF_renderItemsSeparately; + + /// internal: expand items inline when they are short and have no child nodes + static const size_t HF_renderItemInline; + + /// internal: content item is rendered fully inside the annex + static const size_t HF_currentlyInsideAnnex; + + /// internal: create footnote references + static const size_t HF_createFootnoteReferences; + + /// internal: convert non-ASCII characters (> #127) to &\#nnn; + static const size_t HF_convertNonASCIICharacters; + + /// shortcut: render all codes + static const size_t HF_renderAllCodes; + + /// shortcut: filter all flags that are only used internally + static const size_t HF_internalUseOnly; + //@} + + + /** @name read/writeXML() flags + * These flags can be combined and passed to the read/writeXML() methods. + * The 'shortcut' flags can be used for common combinations. + */ + //@{ + + /// write: write all tags even if their value is empty + static const size_t XF_writeEmptyTags; + + /// write: write template identification information (TID and mapping resource) + static const size_t XF_writeTemplateIdentification; + + /// write: always write item identifier "id", not only when item is referenced + static const size_t XF_alwaysWriteItemIdentifier; + + /// write: encode code value, coding scheme designator and coding scheme version as attribute instead of element text + static const size_t XF_codeComponentsAsAttribute; + + /// write: encode relationship type as attribute instead of element text + static const size_t XF_relationshipTypeAsAttribute; + + /// write: encode value type as attribute instead of element text + static const size_t XF_valueTypeAsAttribute; + + /// write: encode template identifier as attribute instead of element text + static const size_t XF_templateIdentifierAsAttribute; + + /// write: add DCMSR namespace declaration to the XML output + static const size_t XF_useDcmsrNamespace; + + /// write: add Schema reference to XML document + static const size_t XF_addSchemaReference; + + /// read: validate content of XML document against Schema + static const size_t XF_validateSchema; + + /// read/write: template identification element encloses content items + static const size_t XF_templateElementEnclosesItems; + + /// write: add comments with details at beginning/end of included template (might be useful for debugging purposes) + static const size_t XF_addCommentsForIncludedTemplate; + + /// read: accept empty Study/Series/SOP Instance UID attribute values (must be filled later) + static const size_t XF_acceptEmptyStudySeriesInstanceUID; + + /// shortcut: combines all XF_xxxAsAttribute write flags (see above) + static const size_t XF_encodeEverythingAsAttribute; + //@} + + + /** @name print() flags + * These flags can be combined and passed to the print() methods. + * The 'shortcut' flags can be used for common combinations. + */ + //@{ + + /// print item position ("1.2.3") instead of line indentation + static const size_t PF_printItemPosition; + + /// shorten long item value (e.g. long texts) + static const size_t PF_shortenLongItemValues; + + /// print SOP instance UID of referenced objects + static const size_t PF_printSOPInstanceUID; + + /// print coding scheme designator/version and code value of concept names + static const size_t PF_printConceptNameCodes; + + /// print no general document information (header) + static const size_t PF_printNoDocumentHeader; + + /// print template identification (TID and mapping resource) + static const size_t PF_printTemplateIdentification; + + /// use ANSI escape codes for output + static const size_t PF_useANSIEscapeCodes; + + /// print long SOP class name of referenced objects (default: short name for images) + static const size_t PF_printLongSOPClassName; + + /// print SOP class UID of referenced objects (instead of the name) + static const size_t PF_printSOPClassUID; + + /// print code triple for invalid codes (instead of the text "invalid code") + static const size_t PF_printInvalidCodes; + + /// print node ID at the beginning of each line (might be useful for debugging purposes) + static const size_t PF_printNodeID; + + /// indicate with a "*" that the "enhanced encoding mode" is used for codes + static const size_t PF_indicateEnhancedEncodingMode; + + /// print annotation of a content item (optional, e.g. user-defined information) + static const size_t PF_printAnnotation; + + /// do not print internal "included template" nodes (position counter is still increased) + static const size_t PF_hideIncludedTemplateNodes; + + /// do not count internal "included template" nodes (only with PF_hideIncludedTemplateNodes) + static const size_t PF_dontCountIncludedTemplateNodes; + + /// print text "empty code" for empty codes (instead of "invalid code") + static const size_t PF_printEmptyCodes; + + /// shortcut: print all codes (combines all PF_printXxxCodes flags, see above) + static const size_t PF_printAllCodes; + //@} + + + /** @name checkByReferenceRelationships() modes + * These modes can be combined and passed to the checkByReferenceRelationships() method. + */ + //@{ + + /// update the position string using the node ID + static const size_t CM_updatePositionString; + + /// update the node ID using the position string + static const size_t CM_updateNodeID; + + /// reset the reference target flag for all nodes + static const size_t CM_resetReferenceTargetFlag; + //@} + + + /** @name checkByReferenceRelationships() bit masks + * These bit masks are used to "filter" valid flags passed to checkByReferenceRelationships(). + */ + //@{ + + /// bit mask (filter) for valid print flags (see PF_xxx) + static const size_t CB_maskPrintFlags; + + /// bit mask (filter) for valid read flags (see RF_xxx) + static const size_t CB_maskReadFlags; + + //@} + + + // --- type definitions --- + + /** SR document types + */ + enum E_DocumentType + { + /// internal type used to indicate an error + DT_invalid, + /// internal type used to indicate an unknown/unsupported document type + DT_unknown = DT_invalid, + /// DICOM IOD: Basic Text SR + DT_BasicTextSR, + /// DICOM IOD: Enhanced SR + DT_EnhancedSR, + /// DICOM IOD: Comprehensive SR + DT_ComprehensiveSR, + /// DICOM IOD: Key Object Selection Document + DT_KeyObjectSelectionDocument, + /// DICOM IOD: Mammography CAD SR + DT_MammographyCadSR, + /// DICOM IOD: Chest CAD SR + DT_ChestCadSR, + /// DICOM IOD: Colon CAD SR + DT_ColonCadSR, + /// DICOM IOD: Procedure Log + DT_ProcedureLog, + /// DICOM IOD: X-Ray Radiation Dose SR + DT_XRayRadiationDoseSR, + /// DICOM IOD: Spectacle Prescription Report + DT_SpectaclePrescriptionReport, + /// DICOM IOD: Macular Grid Thickness and Volume Report + DT_MacularGridThicknessAndVolumeReport, + /// DICOM IOD: Implantation Plan SR Document + DT_ImplantationPlanSRDocument, + /// DICOM IOD: Comprehensive 3D SR + DT_Comprehensive3DSR, + /// DICOM IOD: Radiopharmaceutical Radiation Dose SR + DT_RadiopharmaceuticalRadiationDoseSR, + /// DICOM IOD: Extensible SR (not yet implemented) + DT_ExtensibleSR, + /// DICOM IOD: Acquisition Context SR + DT_AcquisitionContextSR, + /// DICOM IOD: Simplified Adult Echo SR + DT_SimplifiedAdultEchoSR, + /// DICOM IOD: Patient Radiation Dose SR + DT_PatientRadiationDoseSR, + /// DICOM IOD: Performed Imaging Agent Administration SR + DT_PerformedImagingAgentAdministrationSR, + /// DICOM IOD: Planned Imaging Agent Administration SR + DT_PlannedImagingAgentAdministrationSR, + /// internal type used to mark the last entry + DT_last = DT_PlannedImagingAgentAdministrationSR + }; + + /** SR relationship types + */ + enum E_RelationshipType + { + /// internal type used to indicate an error + RT_invalid, + /// internal type used to indicate an unknown relationship type (defined term) + RT_unknown, + /// internal type used for the document root + RT_isRoot, + /// DICOM Relationship Type: CONTAINS + RT_contains, + /// DICOM Relationship Type: HAS OBS CONTEXT + RT_hasObsContext, + /// DICOM Relationship Type: HAS ACQ CONTEXT + RT_hasAcqContext, + /// DICOM Relationship Type: HAS CONCEPT MOD + RT_hasConceptMod, + /// DICOM Relationship Type: HAS PROPERTIES + RT_hasProperties, + /// DICOM Relationship Type: INFERRED FROM + RT_inferredFrom, + /// DICOM Relationship Type: SELECTED FROM + RT_selectedFrom, + /// internal type used to mark the last entry + RT_last = RT_selectedFrom + }; + + /** SR value types + */ + enum E_ValueType + { + /// internal type used to indicate an error + VT_invalid, + /// DICOM Value Type: TEXT + VT_Text, + /// DICOM Value Type: CODE + VT_Code, + /// DICOM Value Type: NUM + VT_Num, + /// DICOM Value Type: DATETIME + VT_DateTime, + /// DICOM Value Type: DATE + VT_Date, + /// DICOM Value Type: TIME + VT_Time, + /// DICOM Value Type: UIDREF + VT_UIDRef, + /// DICOM Value Type: PNAME + VT_PName, + /// DICOM Value Type: SCOORD + VT_SCoord, + /// DICOM Value Type: SCOORD3D + VT_SCoord3D, + /// DICOM Value Type: TCOORD + VT_TCoord, + /// DICOM Value Type: COMPOSITE + VT_Composite, + /// DICOM Value Type: IMAGE + VT_Image, + /// DICOM Value Type: WAVEFORM + VT_Waveform, + /// DICOM Value Type: CONTAINER + VT_Container, + /// internal type used to indicate by-reference relationships + VT_byReference, + /// internal type used to indicate (enclose) included templates + VT_includedTemplate, + /// internal type used to mark the last entry + VT_last = VT_includedTemplate + }; + + /** Softcopy presentation state types. Used for content item IMAGE. + */ + enum E_PresentationStateType + { + /// internal type used to indicate an error + PT_invalid, + /// internal type used to indicate an unknown presentation state type (SOP class) + PT_unknown = PT_invalid, + /// Grayscale Softcopy Presentation State (GSPS) + PT_Grayscale, + /// Color Softcopy Presentation State (CSPS) + PT_Color, + /// Pseudo-Color Softcopy Presentation State (PCSPS) + PT_PseudoColor, + /// Blending Softcopy Presentation State (BSPS) + PT_Blending, + /// XA/XRF Grayscale Softcopy Presentation State (XGSPS) + PT_XAXRFGrayscale, + /// Grayscale Planar MPR Volumetric Presentation State (GP-VPS) + PT_GrayscalePlanarMPR, + /// Compositing Planar MPR Volumetric Presentation State (CP-VPS) + PT_CompositingPlanarMPR, + /// Advanced Blending Presentation State (ABPS) + PT_AdvancedBlending, + /// Volume Rendering Volumetric Presentation State (VR-VPS) + PT_VolumeRendering, + /// Segmented Volume Rendering Volumetric Presentation State (SVR-VPS) + PT_SegmentedVolumeRendering, + /// Multiple Volume Rendering Volumetric Presentation State (MVR-VPS) + PT_MultipleVolumeRendering, + /// internal type used to mark the last entry + PT_last = PT_MultipleVolumeRendering + }; + + /** SR graphic types. Used for content item SCOORD. + */ + enum E_GraphicType + { + /// internal type used to indicate an error + GT_invalid, + /// internal type used to indicate an unknown graphic type (defined term) + GT_unknown = GT_invalid, + /// DICOM Graphic Type: POINT + GT_Point, + /// DICOM Graphic Type: MULTIPOINT + GT_Multipoint, + /// DICOM Graphic Type: POLYLINE + GT_Polyline, + /// DICOM Graphic Type: CIRCLE + GT_Circle, + /// DICOM Graphic Type: ELLIPSE + GT_Ellipse, + /// internal type used to mark the last entry + GT_last = GT_Ellipse + }; + + /** SR graphic types (3D). Used for content item SCOORD3D. + */ + enum E_GraphicType3D + { + /// internal type used to indicate an error + GT3_invalid, + /// internal type used to indicate an unknown graphic type (defined term) + GT3_unknown = GT3_invalid, + /// DICOM Graphic Type: POINT + GT3_Point, + /// DICOM Graphic Type: MULTIPOINT + GT3_Multipoint, + /// DICOM Graphic Type: POLYLINE + GT3_Polyline, + /// DICOM Graphic Type: POLYGON + GT3_Polygon, + /// DICOM Graphic Type: ELLIPSE + GT3_Ellipse, + /// DICOM Graphic Type: ELLIPSOID + GT3_Ellipsoid, + /// internal type used to mark the last entry + GT3_last = GT3_Ellipsoid + }; + + /** SR temporal range types. Used for content item TCOORD. + */ + enum E_TemporalRangeType + { + /// internal type used to indicate an error + TRT_invalid, + /// internal type used to indicate an unknown range type (defined term) + TRT_unknown = TRT_invalid, + /// DICOM Temporal Range Type: POINT + TRT_Point, + /// DICOM Temporal Range Type: MULTIPOINT + TRT_Multipoint, + /// DICOM Temporal Range Type: SEGMENT + TRT_Segment, + /// DICOM Temporal Range Type: MULTISEGMENT + TRT_Multisegment, + /// DICOM Temporal Range Type: BEGIN + TRT_Begin, + /// DICOM Temporal Range Type: END + TRT_End, + /// internal type used to mark the last entry + TRT_last = TRT_End + }; + + /** SR continuity of content flag. Used for content item CONTAINER. + */ + enum E_ContinuityOfContent + { + /// internal type used to indicate an error + COC_invalid, + /// DICOM enumerated value: SEPARATE + COC_Separate, + /// DICOM enumerated value: CONTINUOUS + COC_Continuous, + /// internal type used to mark the last entry + COC_last = COC_Continuous + }; + + /** SR document preliminary flag + */ + enum E_PreliminaryFlag + { + /// internal type used to indicate an error or the absence of this flag + PF_invalid, + /// DICOM enumerated value: PRELIMINARY + PF_Preliminary, + /// DICOM enumerated value: FINAL + PF_Final, + /// internal type used to mark the last entry + PF_last = PF_Final + }; + + /** SR document completion flag + */ + enum E_CompletionFlag + { + /// internal type used to indicate an error + CF_invalid, + /// DICOM enumerated value: PARTIAL + CF_Partial, + /// DICOM enumerated value: COMPLETE + CF_Complete, + /// internal type used to mark the last entry + CF_last = CF_Complete + }; + + /** SR document verification flag + */ + enum E_VerificationFlag + { + /// internal type used to indicate an error + VF_invalid, + /// DICOM enumerated value: UNVERIFIED + VF_Unverified, + /// DICOM enumerated value: VERIFIED + VF_Verified, + /// internal type used to mark the last entry + VF_last = VF_Verified + }; + + /** Specific character set + */ + enum E_CharacterSet + { + /// internal type used to indicate an error + CS_invalid, + /// internal type used to indicate an unknown/unsupported character set + CS_unknown = CS_invalid, + /// ISO 646 (ISO-IR 6): ASCII + CS_ASCII, + /// internal type used to indicate the default character set + CS_default = CS_ASCII, + /// ISO-IR 100: Latin alphabet No. 1 + CS_Latin1, + /// ISO-IR 101: Latin alphabet No. 2 + CS_Latin2, + /// ISO-IR 109: Latin alphabet No. 3 + CS_Latin3, + /// ISO-IR 110: Latin alphabet No. 4 + CS_Latin4, + /// ISO-IR 144: Cyrillic + CS_Cyrillic, + /// ISO-IR 127: Arabic + CS_Arabic, + /// ISO-IR 126: Greek + CS_Greek, + /// ISO-IR 138: Hebrew + CS_Hebrew, + /// ISO-IR 148: Latin alphabet No. 5 + CS_Latin5, + /// ISO-IR 166: Thai + CS_Thai, + /// ISO-IR 13/87: Japanese (Katakana/Romaji/Kanji) + CS_Japanese, + /// ISO-IR 6/149: Korean (Hangul/Hanja) + CS_Korean, + /// ISO-IR 6/58: Chinese + CS_ChineseISO, + /// GB18030: Chinese + CS_ChineseGB18030, + /// GBK: Chinese + CS_ChineseGBK, + /// UTF-8: Unicode in UTF-8 + CS_UTF8, + /// internal type used to mark the last entry + CS_last = CS_UTF8 + }; + + /** Code value type + */ + enum E_CodeValueType + { + /// determine code value type automatically + CVT_auto, + /// short code value (VR=SH) + CVT_Short, + /// long code value (VR=UC) + CVT_Long, + /// URN code value (VR=UR) + CVT_URN + }; + + /** Add node mode + */ + enum E_AddMode + { + /// add new node after current one (sibling) + AM_afterCurrent, + /// add new node before current one (sibling) + AM_beforeCurrent, + /// add new node below current one (after last child) + AM_belowCurrent, + /// add new node below current one (before first child) + AM_belowCurrentBeforeFirstChild + }; + + + // --- destructor --- + + /** destructor. (only needed to avoid compiler warnings) + */ + virtual ~DSRTypes(); + + + // --- conversion functions --- + + /** convert SR document type to SOP class UID + ** @param documentType SR document type to be converted + ** @return SOP class UID if type is valid, empty string otherwise (never NULL) + */ + static const char *documentTypeToSOPClassUID(const E_DocumentType documentType); + + /** convert SR document type to modality + ** @param documentType SR document type to be converted + ** @return modality if type is valid, empty string otherwise (never NULL) + */ + static const char *documentTypeToModality(const E_DocumentType documentType); + + /** convert SR document type to readable name. + * Such a readable name is better suited for printing/rendering. + ** @param documentType SR document type to be converted + ** @return readable name if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *documentTypeToReadableName(const E_DocumentType documentType); + + /** convert SR document type to document title. + * This document title is used for printing/rendering. + ** @param documentType SR document type to be converted + * @param documentTitle reference to variable where the resulting string is stored + ** @return document title if type is valid, empty string otherwise (never NULL) + */ + static const char *documentTypeToDocumentTitle(const E_DocumentType documentType, + OFString &documentTitle); + + /** check whether SR document type requires Enhanced General Equipment Module + ** @param documentType SR document type to be checked + ** @return OFTrue if Enhanced General Equipment Module is required, OFFalse otherwise + */ + static OFBool requiresEnhancedEquipmentModule(const E_DocumentType documentType); + + /** check whether SR document type requires Timezone Module + ** @param documentType SR document type to be checked + ** @return OFTrue if Timezone Module is required, OFFalse otherwise + */ + static OFBool requiresTimezoneModule(const E_DocumentType documentType); + + /** check whether SR document type requires Synchronization Module + ** @param documentType SR document type to be checked + ** @return OFTrue if Synchronization Module is required, OFFalse otherwise + */ + static OFBool requiresSynchronizationModule(const E_DocumentType documentType); + + /** convert relationship type to DICOM defined term + ** @param relationshipType relationship type to be converted + ** @return defined term if type is valid, empty string otherwise (never NULL) + */ + static const char *relationshipTypeToDefinedTerm(const E_RelationshipType relationshipType); + + /** convert relationship type to readable name. + * Such a readable name is better suited for printing/rendering. + ** @param relationshipType relationship type to be converted + ** @return readable name if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *relationshipTypeToReadableName(const E_RelationshipType relationshipType); + + /** convert value type to DICOM defined term + ** @param valueType value type to be converted + ** @return defined term if type is valid, empty string otherwise (never NULL) + */ + static const char *valueTypeToDefinedTerm(const E_ValueType valueType); + + /** convert value type to XML tag name + ** @param valueType value type to be converted + ** @return XML tag name if type is valid, "item" otherwise (never NULL) + */ + static const char *valueTypeToXMLTagName(const E_ValueType valueType); + + /** convert value type to readable name. + * Such a readable name is better suited for printing/rendering. + ** @param valueType value type to be converted + ** @return readable name if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *valueTypeToReadableName(const E_ValueType valueType); + + /** convert presentation state type to short name. + * Such a short name (e.g. "GSPS") is better suited for printing/rendering than a UID. + ** @param pstateType presentation state type to be converted + ** @return short name if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *presentationStateTypeToShortName(const E_PresentationStateType pstateType); + + /** convert graphic type to DICOM enumerated value + ** @param graphicType graphic type to be converted + ** @return enumerated value if type is valid, empty string otherwise (never NULL) + */ + static const char *graphicTypeToEnumeratedValue(const E_GraphicType graphicType); + + /** convert graphic type to readable name. + * Such a readable name is better suited for printing/rendering. + ** @param graphicType graphic type to be converted + ** @return readable name if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *graphicTypeToReadableName(const E_GraphicType graphicType); + + /** convert graphic type (3D) to DICOM enumerated value + ** @param graphicType graphic type (3D) to be converted + ** @return enumerated value if type is valid, empty string otherwise (never NULL) + */ + static const char *graphicType3DToEnumeratedValue(const E_GraphicType3D graphicType); + + /** convert graphic type (3D) to readable name. + * Such a readable name is better suited for printing/rendering. + ** @param graphicType graphic type (3D) to be converted + ** @return readable name if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *graphicType3DToReadableName(const E_GraphicType3D graphicType); + + /** convert temporal range type to DICOM enumerated value + ** @param temporalRangeType temporal range type to be converted + ** @return enumerated value if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *temporalRangeTypeToEnumeratedValue(const E_TemporalRangeType temporalRangeType); + + /** convert temporal range type to readable name. + * Such a readable name is better suited for printing/rendering. + ** @param temporalRangeType temporal range type to be converted + ** @return readable name if type is valid, "invalid ..." string otherwise (never NULL) + */ + static const char *temporalRangeTypeToReadableName(const E_TemporalRangeType temporalRangeType); + + /** convert continuity of content flag to DICOM enumerated value + ** @param continuityOfContent continuity of content flag to be converted + ** @return enumerated value if flag is valid, empty string otherwise (never NULL) + */ + static const char *continuityOfContentToEnumeratedValue(const E_ContinuityOfContent continuityOfContent); + + /** convert preliminary flag to DICOM enumerated value + ** @param preliminaryFlag preliminary flag to be converted + ** @return enumerated value if flag is valid, empty string otherwise (never NULL) + */ + static const char *preliminaryFlagToEnumeratedValue(const E_PreliminaryFlag preliminaryFlag); + + /** convert completion flag to DICOM enumerated value + ** @param completionFlag completion flag to be converted + ** @return enumerated value if successful, empty string otherwise (never NULL) + */ + static const char *completionFlagToEnumeratedValue(const E_CompletionFlag completionFlag); + + /** convert verification flag to DICOM enumerated value + ** @param verificationFlag verification flag to be converted + ** @return enumerated value if flag is valid, empty string otherwise (never NULL) + */ + static const char *verificationFlagToEnumeratedValue(const E_VerificationFlag verificationFlag); + + /** convert character set to DICOM defined term + ** @param characterSet character set to be converted + ** @return defined term if character set is valid, empty string otherwise (never NULL) + */ + static const char *characterSetToDefinedTerm(const E_CharacterSet characterSet); + + /** convert character set to HTML name. + * This HTML (IANA) name is used to specify the character set in an HTML document. + ** @param characterSet character set to be converted + ** @return HTML name if character set is valid, empty string or "?" otherwise (never NULL) + */ + static const char *characterSetToHTMLName(const E_CharacterSet characterSet); + + /** convert character set to XML name. + * This XML name is used to specify the character set in an XML document. + ** @param characterSet character set to be converted + ** @return XML name if character set is valid, empty string or "?" otherwise (never NULL) + */ + static const char *characterSetToXMLName(const E_CharacterSet characterSet); + + /** convert SOP class UID to SR document type + ** @param sopClassUID SOP class UID to be converted + ** @return SR document type if successful, DSRTypes::DT_invalid otherwise + */ + static E_DocumentType sopClassUIDToDocumentType(const OFString &sopClassUID); + + /** convert DICOM defined term to relationship type + ** @param definedTerm defined term to be converted + ** @return relationship type if successful, DSRTypes::RT_invalid otherwise + */ + static E_RelationshipType definedTermToRelationshipType(const OFString &definedTerm); + + /** convert DICOM defined term to value type + ** @param definedTerm defined term to be converted + ** @return value type if successful, DSRTypes::VT_invalid otherwise + */ + static E_ValueType definedTermToValueType(const OFString &definedTerm); + + /** convert SOP class UID to presentation state type + ** @param sopClassUID SOP class UID to be converted + ** @return presentation state type if successful, DSRTypes::PT_invalid otherwise + */ + static E_PresentationStateType sopClassUIDToPresentationStateType(const OFString &sopClassUID); + + /** convert XML tag name to value type + ** @param xmlTagName XML tag name to be converted + ** @return value type if successful, DSRTypes::VT_invalid otherwise + */ + static E_ValueType xmlTagNameToValueType(const OFString &xmlTagName); + + /** convert DICOM enumerated value to graphic type + ** @param enumeratedValue enumerated value to be converted + ** @return graphic type if successful, DSRTypes::GT_invalid otherwise + */ + static E_GraphicType enumeratedValueToGraphicType(const OFString &enumeratedValue); + + /** convert DICOM enumerated value to graphic type (3D) + ** @param enumeratedValue enumerated value to be converted + ** @return graphic type if successful, DSRTypes::GT3_invalid otherwise + */ + static E_GraphicType3D enumeratedValueToGraphicType3D(const OFString &enumeratedValue); + + /** convert DICOM enumerated value to temporal range type + ** @param enumeratedValue enumerated value to be converted + ** @return temporal range type if successful, DSRTypes::TRT_invalid otherwise + */ + static E_TemporalRangeType enumeratedValueToTemporalRangeType(const OFString &enumeratedValue); + + /** convert DICOM enumerated value to continuity of content flag + ** @param enumeratedValue enumerated value to be converted + ** @return continuity of content flag type if successful, DSRTypes::COC_invalid otherwise + */ + static E_ContinuityOfContent enumeratedValueToContinuityOfContent(const OFString &enumeratedValue); + + /** convert DICOM enumerated value to preliminary flag + ** @param enumeratedValue enumerated value to be converted + ** @return preliminary flag type if successful, DSRTypes::PF_invalid otherwise + */ + static E_PreliminaryFlag enumeratedValueToPreliminaryFlag(const OFString &enumeratedValue); + + /** convert DICOM enumerated value to completion flag + ** @param enumeratedValue enumerated value to be converted + ** @return completion flag type if successful, DSRTypes::CF_invalid otherwise + */ + static E_CompletionFlag enumeratedValueToCompletionFlag(const OFString &enumeratedValue); + + /** convert DICOM enumerated value to verification flag + ** @param enumeratedValue enumerated value to be converted + ** @return verification flag type if successful, DSRTypes::VF_invalid otherwise + */ + static E_VerificationFlag enumeratedValueToVerificationFlag(const OFString &enumeratedValue); + + /** convert DICOM defined term to character set. + * An empty defined term is mapped to DSRTypes::CS_default (which is ASCII). + ** @param definedTerm defined term to be converted + ** @return character set if successful, DSRTypes::CS_invalid otherwise + */ + static E_CharacterSet definedTermToCharacterSet(const OFString &definedTerm); + + + // --- misc helper functions --- + + /** check whether specified SR document type is supported by this library + ** @param documentType SR document type to be checked + ** @return status, OFTrue if SR document type is supported, OFFalse otherwise + */ + static OFBool isDocumentTypeSupported(const E_DocumentType documentType); + + /** get current date in DICOM 'DA' format. (YYYYMMDD) + ** @param dateString string used to store the current date. + * ('19000101' if current date could not be retrieved) + ** @return resulting character string (see 'dateString') + */ + static const OFString ¤tDate(OFString &dateString); + + /** get current time in DICOM 'TM' format. (HHMMSS) + ** @param timeString string used to store the current time + * ('000000' if current time could not be retrieved) + ** @return resulting character string (see 'timeString') + */ + static const OFString ¤tTime(OFString &timeString); + + /** get current date and time in DICOM 'DT' format. (YYYYMMDDHHMMSS) + * The optional UTC notation (e.g. +0100) as well as the optional fractional second + * part are currently not supported. + ** @param dateTimeString string used to store the current date and time + * ('19000101000000' if current date/time could not + * be retrieved) + ** @return resulting character string (see 'dateTimeString') + */ + static const OFString ¤tDateTime(OFString &dateTimeString); + + /** get local timezone in DICOM format. (&ZZXX) + ** @param timezoneString string used to store the local timezone + * ('+0000' if timezone could not be retrieved) + ** @return resulting character string (see 'timezoneString') + */ + static const OFString &localTimezone(OFString &timezoneString); + + /** convert DICOM date string to readable format. + * The ISO format "YYYY-MM-DD" is used for the readable format. + ** @param dicomDate date in DICOM DA format (YYYYMMDD) + * @param readableDate reference to variable where the resulting string is stored + ** @return reference to resulting string (might be empty) + */ + static const OFString &dicomToReadableDate(const OFString &dicomDate, + OFString &readableDate); + + /** convert DICOM time string to readable format. + * The ISO format "HH:MM" or "HH:MM:SS" (if seconds are available) is used for the + * readable format. + ** @param dicomTime time in DICOM TM format (HHMM or HHMMSS...) + * @param readableTime reference to variable where the resulting string is stored + ** @return reference to resulting string (might be empty) + */ + static const OFString &dicomToReadableTime(const OFString &dicomTime, + OFString &readableTime); + + /** convert DICOM date time string to readable format. + * The format "YYYY-MM-DD, HH:MM" or "YYYY-MM-DD, HH:MM:SS" is used for the readable format. + ** @param dicomDateTime time in DICOM DT format (YYYYMMDDHHMMSS...). Possible suffixes + * (fractional second or UTC notation) are currently ignored. + * @param readableDateTime reference to variable where the resulting string is stored + ** @return reference to resulting string (might be empty) + */ + static const OFString &dicomToReadableDateTime(const OFString &dicomDateTime, + OFString &readableDateTime); + + /** convert DICOM person name to readable format. + * The format " , " is used for the + * readable format. + * Please note that only the first component group (characters before the first '=') of + * the DICOM person name is used - see DcmPersonName::getNameComponents() for details. + ** @param dicomPersonName person name in DICOM PN format (ln^fn^mn^p^s) + * @param readablePersonName reference to variable where the resulting string is stored + ** @return reference to resulting string (might be empty) + */ + static const OFString &dicomToReadablePersonName(const OFString &dicomPersonName, + OFString &readablePersonName); + + /** convert DICOM person name to XML format. + * The tags \, \, \, \ and \ are used for the XML + * format of a person name. The string is automatically converted to the markup notation + * (see convertToMarkupString()). Two tags are separated by a newline. + * Please note that only the first component group (characters before the first '=') of + * the DICOM person name is used - see DcmPersonName::getNameComponents() for details. + ** @param dicomPersonName person name in DICOM PN format (ln^fn^mn^p^s) + * @param xmlPersonName reference to variable where the resulting string is stored + * @param writeEmptyValue optional flag indicating whether an empty value should be written + ** @return reference to resulting string (might be empty) + */ + static const OFString &dicomToXMLPersonName(const OFString &dicomPersonName, + OFString &xmlPersonName, + const OFBool writeEmptyValue = OFFalse); + + /** convert unsigned integer number to character string + ** @param number unsigned integer number to be converted + * @param stringValue character string used to store the result + ** @return pointer to the first character of the resulting string + * (may be NULL if 'string' was NULL) + */ + static const char *numberToString(const size_t number, + char *stringValue); + + /** convert string to unsigned integer number + ** @param stringValue character string to be converted + ** @return resulting unsigned integer number if successful, 0 otherwise + */ + static size_t stringToNumber(const char *stringValue); + + /** convert character string to print string. + * This method is used to convert character strings for text "print" output. Newline characters + * "\n" are replaced by "\\n", return characters "\r" by "\\r", etc. + ** @param sourceString source string to be converted + * @param printString reference to variable where the result should be stored + ** @return reference to resulting 'printString' (might be empty if 'sourceString' was empty) + */ + static const OFString &convertToPrintString(const OFString &sourceString, + OFString &printString); + + /** convert character string to HTML mnenonic string. + * Characters with special meaning for HTML (e.g. '<' and '&') are replace by the corresponding + * mnenonics (e.g. "<" and "&"). + * If flag DSRTypes::HF_convertNonASCIICharacters is set, all characters > #127 are also converted + * (useful if only HTML 3.2 is supported which does not allow to specify the character set). + ** @param sourceString source string to be converted + * @param markupString reference to variable where the result should be stored + * @param flags optional flags, only checking DSRTypes::HF_convertNonASCIICharacters, + * DSRTypes::HF_HTML32Compatibility and DSRTypes::HF_XHTML11Compatibility + * @param newlineAllowed optional flag indicating whether newlines are allowed or not. + * If they are allowed the text "
" is used, "¶" otherwise. + * The following combinations are accepted: LF, CR, LF CR, CF LF. + ** @return reference to resulting 'markupString' (might be empty if 'sourceString' was empty) + */ + static const OFString &convertToHTMLString(const OFString &sourceString, + OFString &markupString, + const size_t flags = 0, + const OFBool newlineAllowed = OFFalse); + + /** convert character string to XML mnenonic string. + * Characters with special meaning for XML (e.g. '<' and '&') are replace by the + * corresponding mnenonics (e.g. "<" and "&"). + ** @param sourceString source string to be converted + * @param markupString reference to variable where the result should be stored + ** @return reference to resulting 'markupString' (might be empty if 'sourceString' was empty) + */ + static const OFString &convertToXMLString(const OFString &sourceString, + OFString &markupString); + + /** check string for valid reference (as used for by-reference relationships). + * The string should be non-empty and consist of integer numbers only separated by a "." where + * the first and the last character of the string are always figures (0..9). Example: 1 or 1.2.3. + * Both the integer number 0 and a leading 0 for the numbers are forbidden. + ** @param stringValue character string to be checked + ** @result OFTrue if 'string' conforms to UID format, OFFalse otherwise + */ + static OFBool checkForValidReference(const OFString &stringValue); + + /** create specified SR IOD content relationship constraint checker object. + * Please note that the created object has to be deleted by the caller. + ** @param documentType associated SR document type for which the checker object is created + ** @return pointer to new IOD checker object if successful, NULL if document type is not supported + */ + static DSRIODConstraintChecker *createIODConstraintChecker(const E_DocumentType documentType); + + /** create specified document tree node. + * This is a shortcut and the only location where document tree nodes are created. + * It facilitates the introduction of new relationship/value types and the maintenance. + ** @param relationshipType relationship type of the node to be created + * @param valueType value type of the node to be created + ** @return pointer to the new document tree node if successful, NULL otherwise + */ + static DSRDocumentTreeNode *createDocumentTreeNode(const E_RelationshipType relationshipType, + const E_ValueType valueType); + + + // --- DICOM data structure access functions --- + + /** add given element to the dataset. + * The element is only added if 'result' is EC_Normal and the 'delem' pointer is not NULL. + ** @param result reference to status variable (checked before adding and updated afterwards!) + * @param dataset reference to DICOM dataset to which the element should be added + * @param delem pointer to DICOM element which should be added. deleted if not inserted. + * @param vm value multiplicity (according to the data dictionary) to be checked for. + * (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "2" or something else which is not checked) + * @param moduleName optional module name to be printed (default: "SR document" if NULL) + ** @return current value of 'result', EC_Normal if successful, an error code otherwise + */ + static OFCondition addElementToDataset(OFCondition &result, + DcmItem &dataset, + DcmElement *delem, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL); + + /** remove given attribute from the sequence. + * All occurrences of the attribute in all items of the sequence are removed. + ** @param sequence reference to DICOM sequence from which the attribute should be removed + * @param tagKey DICOM tag specifying the attribute which should be removed + */ + static void removeAttributeFromSequence(DcmSequenceOfItems &sequence, + const DcmTagKey &tagKey); + + /** get element from dataset + ** @param dataset reference to DICOM dataset from which the element should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param delem reference to DICOM element which should be retrieved. The return value + * is also stored in this parameter. + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition getElementFromDataset(DcmItem &dataset, + DcmElement &delem); + + /** get string value from element + ** @param delem DICOM element from which the string value should be retrieved + ** @return pointer to character string if successful, NULL otherwise + */ + static const char *getStringValueFromElement(const DcmElement &delem); + + /** get string value from element. + * Please note that only the first element value is retrieved (in case of multiple values). + ** @param delem DICOM element from which the string value should be retrieved + * @param stringValue reference to variable where the result should be stored + ** @return reference character string if successful, empty string otherwise + */ + static const OFString &getStringValueFromElement(const DcmElement &delem, + OFString &stringValue); + + /** get string value from element + ** @param delem DICOM element from which the string value should be retrieved + * @param stringValue reference to variable in which the result should be stored + * (This parameter is automatically cleared if an error occurs.) + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition getStringValueFromElement(const DcmElement &delem, + OFString &stringValue, + const signed long pos); + + /** get string value from element and convert to "print" format. + * Please note that only the first element value is retrieved (in case of multiple values). + ** @param delem DICOM element from which the string value should be retrieved + * @param stringValue reference to variable in which the result should be stored + ** @return reference character string if successful, empty string otherwise + */ + static const OFString &getPrintStringFromElement(const DcmElement &delem, + OFString &stringValue); + + /** get string value from element and convert to HTML/XML. + * Please note that only the first element value is retrieved (in case of multiple values). + ** @param delem DICOM element from which the string value should be retrieved + * @param stringValue reference to variable in which the result should be stored + * @param convertNonASCII convert non-ASCII characters (> #127) to numeric value (&\#nnn;) if OFTrue + ** @return reference character string if successful, empty string otherwise + */ + static const OFString &getMarkupStringFromElement(const DcmElement &delem, + OFString &stringValue, + const OFBool convertNonASCII = OFFalse); + + /** get string value from dataset + ** @param dataset DICOM dataset from which the string should be retrieved. + * (Would be 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param tagKey DICOM tag specifying the attribute from which the string should be retrieved + * @param stringValue reference to variable in which the result should be stored + * (This parameter is automatically cleared if the tag could not be found.) + * @param pos index of the value to get (0..vm-1), -1 for all components + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition getStringValueFromDataset(DcmItem &dataset, + const DcmTagKey &tagKey, + OFString &stringValue, + const signed long pos = 0); + + /** put string value to dataset + ** @param dataset reference to DICOM dataset to which the string should be put. + * @param tag DICOM tag specifying the attribute to which the string should be put + * @param stringValue character string specifying the value to be set + * @param allowEmpty allow empty element to be inserted if OFTrue. + * Do not insert empty element otherwise. + ** @return status, EC_Normal if successful, an error code otherwise + */ + static OFCondition putStringValueToDataset(DcmItem &dataset, + const DcmTag &tag, + const OFString &stringValue, + const OFBool allowEmpty = OFTrue); + + /** check element value for correct value multiplicity and type. + ** @param delem pointer to DICOM element to be checked (might be NULL) + * @param tagKey DICOM tag of the DICOM element the parameter 'delem' points to + * @param vm value multiplicity (according to the data dictionary) to be checked + * for. (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "1C", "2", something else) + * @param searchCond optional flag indicating the status of a previous search() call + * @param moduleName optional module name to be printed (default: "SR document" if NULL) + * @param acceptViolation accept certain violations regarding the VR and VM if OFTrue. + * A warning message will always be reported if the value in incorrect. + ** @return OFTrue if element value is correct, OFFalse otherwise + */ + static OFBool checkElementValue(DcmElement *delem, + const DcmTagKey &tagKey, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond = EC_Normal, + const char *moduleName = NULL, + const OFBool acceptViolation = OFFalse); + + /** check element value for correct value multiplicity and type. + ** @param delem DICOM element to be checked + * @param vm value multiplicity (according to the data dictionary) to be checked + * for. (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "1C", "2", something else) + * @param searchCond optional flag indicating the status of a previous search() call + * @param moduleName optional module name to be printed (default: "SR document" if NULL) + * @param acceptViolation accept certain violations regarding the VR and VM if OFTrue. + * A warning message will always be reported if the value in incorrect. + ** @return OFTrue if element value is correct, OFFalse otherwise + */ + static OFBool checkElementValue(DcmElement &delem, + const OFString &vm, + const OFString &type, + const OFCondition &searchCond = EC_Normal, + const char *moduleName = NULL, + const OFBool acceptViolation = OFFalse); + + /** get element from dataset and check it for correct value multiplicity and type. + ** @param dataset DICOM dataset from which the element should be retrieved. (Would be + * 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param delem DICOM element used to store the value (always creates a copy!) + * @param vm value multiplicity (according to the data dictionary) to be checked + * for. (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "1C", "2", something else which is not + * checked) + * @param moduleName optional module name to be printed (default: "SR document" if NULL) + * @param acceptViolation accept certain violations regarding the VR and VM if OFTrue. + * A warning message will always be reported if the value in incorrect. + ** @return status, EC_Normal if element could be retrieved and value is correct, an error code + * otherwise + */ + static OFCondition getAndCheckElementFromDataset(DcmItem &dataset, + DcmElement &delem, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL, + const OFBool acceptViolation = OFFalse); + + /** get string value from dataset and check it for correct value multiplicity and type. + ** @param dataset DICOM dataset from which the element should be retrieved. (Would be + * 'const' if the methods from 'dcmdata' would also be 'const'.) + * @param tagKey DICOM tag specifying the attribute from which the string should be + * retrieved + * @param stringValue reference to variable in which the result should be stored. + * (This parameter is automatically cleared if the tag could not be found. + * It is not cleared if the retrieved string is invalid, e.g. violates VR + * or VM definition.) + * @param vm value multiplicity (according to the data dictionary) to be checked + * for. (See DcmElement::checkVM() for a list of valid values.) + * Interpreted as cardinality (number of items) for sequence attributes. + * @param type value type (valid value: "1", "1C", "2", something else which is not + * checked) + * @param moduleName optional module name to be printed (default: "SR document" if NULL) + * @param acceptViolation accept certain violations regarding the VR and VM if OFTrue. + * A warning message will always be reported if the value in incorrect. + ** @return status, EC_Normal if element could be retrieved and value is correct, an error code + * otherwise + */ + static OFCondition getAndCheckStringValueFromDataset(DcmItem &dataset, + const DcmTagKey &tagKey, + OFString &stringValue, + const OFString &vm, + const OFString &type, + const char *moduleName = NULL, + const OFBool acceptViolation = OFFalse); + + // --- output functions --- + + /** print the warning message that the current content item is invalid/incomplete. + * The value type (for DEBUG mode also the node ID) is added if the 'node' if specified. + * @param action text describing the current action (e.g. 'Reading'), 'Processing' if NULL + * @param node pointer to document tree node for which the message should be printed + * @param location position of the affected content item (e.g. '1.2.3', not printed if NULL) + */ + static void printInvalidContentItemMessage(const char *action, + const DSRDocumentTreeNode *node, + const char *location = NULL); + + /** print an error message for the current content item. + * The value type (for DEBUG mode also the node ID) is added if the 'node' if specified. + * @param action text describing the current action (e.g. 'Reading'), 'Processing' if NULL + * @param result status used to print more information on the error (no message if EC_Normal) + * @param node pointer to document tree node for which the message should be printed + * @param location position of the affected content item (e.g. '1.2.3', not printed if NULL) + */ + static void printContentItemErrorMessage(const char *action, + const OFCondition &result, + const DSRDocumentTreeNode *node, + const char *location = NULL); + + /** print a warning message that an unknown/unsupported value has been determined + * @param valueName name of the unknown/unsupported value + * @param readValue value that has been read (optional) + * @param action text describing the current action (default: 'Reading'), 'Processing' if NULL + */ + static void printUnknownValueWarningMessage(const char *valueName, + const char *readValue = NULL, + const char *action = "Reading"); + + /** write string value to XML output stream. + * The output looks like this: "<" tagName ">" stringValue "" + ** @param stream output stream to which the XML document is written + * @param stringValue string value to be written + * @param tagName name of the XML tag used to surround the string value + * @param writeEmptyValue optional flag indicating whether an empty value should be written + ** @return OFTrue if tag/value has been written, OFFalse otherwise + */ + static OFBool writeStringValueToXML(STD_NAMESPACE ostream &stream, + const OFString &stringValue, + const OFString &tagName, + const OFBool writeEmptyValue = OFFalse); + + /** write string value from DICOM element to XML output stream. + * The output looks like this: "<" tagName ">" stringValue "" + * For elements with DICOM VR=PN the function dicomToXMLPersonName() is used internally. + ** @param stream output stream to which the XML document is written + * @param delem DICOM element from which the value is retrieved + * @param tagName name of the XML tag used to surround the string value + * @param writeEmptyValue optional flag indicating whether an empty value should be written + ** @return OFTrue if tag/value has been written, OFFalse otherwise + */ + static OFBool writeStringFromElementToXML(STD_NAMESPACE ostream &stream, + DcmElement &delem, + const OFString &tagName, + const OFBool writeEmptyValue = OFFalse); + + /** create an HTML annex entry with hyperlinks. + * A reference text is added to the main document and a new annex entry to the document annex + * with HTML hyperlinks between both. Example for a reference: '[for details see Annex 1]' + ** @param docStream output stream used for the main document + * @param annexStream output stream used for the document annex + * @param referenceText optional text added to the main document (e.g. 'for details see') + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after the new entry has been added. + * @param flags optional flag used to customize the output (see DSRTypes::HF_xxx) + ** @return current annex number after the new entry has been added + */ + static size_t createHTMLAnnexEntry(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const OFString &referenceText, + size_t &annexNumber, + const size_t flags = 0); + + /** create an HTML footnote with hyperlinks + ** @param docStream output stream used for the main document + * @param footnoteStream output stream used for the footnote text + * @param footnoteNumber reference to the variable where the current footnote number is stored. + * Value is increased automatically by 1 after the new entry has been added. + * @param nodeID unique numerical identifier of the current node for which this footnote + * is created. Used to create a unique name for the hyperlink. + * @param flags optional flag used to customize the output (see DSRTypes::HF_xxx) + ** @return current footnote number after the new entry has been added + */ + static size_t createHTMLFootnote(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &footnoteStream, + size_t &footnoteNumber, + const size_t nodeID, + const size_t flags = 0); + + /** append one output stream to another. + ** @param mainStream stream to which the other should be added + * @param tempStream (string) stream to be added to the other + * @param heading (optional) string which is added to the 'mainStream' before the 'tempStream'. + * This string is only added if 'tempStream' is not empty. + ** @return status, EC_Normal if stream has been added successfully, an error code otherwise + */ + static OFCondition appendStream(STD_NAMESPACE ostream &mainStream, + OFOStringStream &tempStream, + const char *heading = NULL); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsruidtn.h b/dcmsr/include/dcmtk/dcmsr/dsruidtn.h new file mode 100644 index 00000000..5c1ea061 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsruidtn.h @@ -0,0 +1,192 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRUIDRefTreeNode + * + */ + + +#ifndef DSRUIDTN_H +#define DSRUIDTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrstrvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item UIDREF + */ +class DCMTK_DCMSR_EXPORT DSRUIDRefTreeNode + : public DSRDocumentTreeNode, + public DSRStringValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRUIDRefTreeNode(const E_RelationshipType relationshipType); + + /** constructor. + ** @param relationshipType type of relationship to the parent tree node. + * Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + * @param uidValue initial value to be set (VR=UI, mandatory) + * @param check if enabled, check 'uidValue' for validity before setting + * it. See checkValue() for details. An empty value is never + * accepted. + */ + DSRUIDRefTreeNode(const E_RelationshipType relationshipType, + const OFString &uidValue, + const OFBool check = OFTrue); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRUIDRefTreeNode(const DSRUIDRefTreeNode &node); + + /** destructor + */ + virtual ~DSRUIDRefTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRUIDRefTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the base classes, the concept name and the currently stored + * value (see hasValidValue()) are valid. + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the stored UID reference, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** print content item. + * A typical output looks like this: contains UIDREF:(,,"Code")="1.2.3.4.5" + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + /** check the specified UID value for validity. + * In addition to the base class check for a non-empty value, this method also checks + * whether the given value conforms to the corresponding VR (UI) and VM (1). + ** @param uidValue value to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkValue(const OFString &uidValue) const; + + + private: + + // --- declaration of default constructor and assignment operator + + DSRUIDRefTreeNode(); + DSRUIDRefTreeNode &operator=(const DSRUIDRefTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrwavch.h b/dcmsr/include/dcmtk/dcmsr/dsrwavch.h new file mode 100644 index 00000000..81a0bdf4 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrwavch.h @@ -0,0 +1,188 @@ +/* + * + * Copyright (C) 2000-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRWaveformChannelItem, DSRWaveformChannelList + * + */ + + +#ifndef DSRWAVCH_H +#define DSRWAVCH_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrtlist.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for waveform channel items + */ +class DCMTK_DCMSR_EXPORT DSRWaveformChannelItem +{ + public: + + /** (default) constructor + ** @param multiplexGroupNumber optional multiplex group number + * @param channelNumber optional channel number + */ + DSRWaveformChannelItem(const Uint16 multiplexGroupNumber = 0, + const Uint16 channelNumber = 0) + : MultiplexGroupNumber(multiplexGroupNumber), + ChannelNumber(channelNumber) + { + } + + /** comparison operator + ** @param item item with which the (m,c) pair should be compared + ** @return OFTrue if both pairs are equal, OFFalse otherwise + */ + inline OFBool operator==(const DSRWaveformChannelItem &item) const + { + return (item.MultiplexGroupNumber == MultiplexGroupNumber) && (item.ChannelNumber == ChannelNumber); + } + + /** comparison operator + ** @param item item with which the (m,c) pair should be compared + ** @return true if not equal, false if equal + */ + inline OFBool operator!=(const DSRWaveformChannelItem &item) const + { + return (item.MultiplexGroupNumber != MultiplexGroupNumber) || (item.ChannelNumber != ChannelNumber); + } + + /** comparison operator + ** @param item item with which the (m,c) pair should be compared + ** @return true if smaller. ChannelNumber takes precedence over MultiplexGroupNumber. + */ + inline OFBool operator<(const DSRWaveformChannelItem &item) const + { + return (ChannelNumber < item.ChannelNumber) || ((ChannelNumber == item.ChannelNumber) && (MultiplexGroupNumber < item.MultiplexGroupNumber)); + } + + /** comparison operator + ** @param item item with which the (m,c) pair should be compared + ** @return true if greater. ChannelNumber takes precedence over MultiplexGroupNumber. + */ + inline OFBool operator>(const DSRWaveformChannelItem &item) const + { + return (ChannelNumber > item.ChannelNumber) || ((ChannelNumber == item.ChannelNumber) && (MultiplexGroupNumber > item.MultiplexGroupNumber)); + } + + /* copy constructor and assignment operator are defined implicitly */ + + /// multiplex group number value (VR=US) + Uint16 MultiplexGroupNumber; + /// channel number value (VR=US) + Uint16 ChannelNumber; +}; + + +/** Class for waveform channel lists + */ +class DCMTK_DCMSR_EXPORT DSRWaveformChannelList + : public DSRListOfItems +{ + + public: + + /** default constructor + */ + DSRWaveformChannelList(); + + /** copy constructor + ** @param lst list to be copied + */ + DSRWaveformChannelList(const DSRWaveformChannelList &lst); + + /** destructor + */ + virtual ~DSRWaveformChannelList(); + + /** assignment operator + ** @param lst list to be copied + ** @return reference to this list after 'lst' has been copied + */ + DSRWaveformChannelList &operator=(const DSRWaveformChannelList &lst); + + /** print list of waveform channels. + * The output of a typical list looks like this: 1/2,3/4,5/6 + ** @param stream output stream to which the list should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + * @param pairSeparator character specifying the separator between the value pairs + * @param itemSeparator character specifying the separator between the list items + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags = 0, + const char pairSeparator = '/', + const char itemSeparator = ',') const; + + /** read list of waveform channels + ** @param dataset DICOM dataset from which the list should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(DcmItem &dataset, + const size_t flags); + + /** write list of waveform channels + ** @param dataset DICOM dataset to which the list should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition write(DcmItem &dataset) const; + + /** check whether specified value pair is contained in the list + ** @param multiplexGroupNumber multiplex group number to be checked + * @param channelNumber channel number to be checked + ** @return OFTrue if the value pair is in the list, OFFalse otherwise + */ + OFBool isElement(const Uint16 multiplexGroupNumber, + const Uint16 channelNumber) const; + + /** get copy of the specified value pair + ** @param idx index of the value pair to be returned (starting from 1) + * @param multiplexGroupNumber multiplex group number of the specified index (set to 0) + * @param channelNumber channel number of the specified index (set to 0 first) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getItem(const size_t idx, + Uint16 &multiplexGroupNumber, + Uint16 &channelNumber) const; + + /** add value pair to the list + ** @param multiplexGroupNumber multiplex group number to be added + * @param channelNumber channel number to be added + */ + void addItem(const Uint16 multiplexGroupNumber, + const Uint16 channelNumber); + + /** put list of waveform channels as a string. + * This function expects the same input format as created by print(), i.e. a comma + * separated list of numerical value pairs. + ** @param stringValue string value to be set + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition putString(const char *stringValue); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrwavtn.h b/dcmsr/include/dcmtk/dcmsr/dsrwavtn.h new file mode 100644 index 00000000..87be60aa --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrwavtn.h @@ -0,0 +1,180 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRWaveformTreeNode + * + */ + + +#ifndef DSRWAVTN_H +#define DSRWAVTN_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrwavvl.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for content item WAVEFORM + */ +class DCMTK_DCMSR_EXPORT DSRWaveformTreeNode + : public DSRDocumentTreeNode, + public DSRWaveformReferenceValue +{ + + public: + + /** constructor + ** @param relationshipType type of relationship to the parent tree node. Should + * not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot. + */ + DSRWaveformTreeNode(const E_RelationshipType relationshipType); + + /** copy constructor. + * Please note that the comments on the copy constructor of the base class + * DSRDocumentTreeNode apply. + ** @param node tree node to be copied + */ + DSRWaveformTreeNode(const DSRWaveformTreeNode &node); + + /** destructor + */ + virtual ~DSRWaveformTreeNode(); + + /** comparison operator "equal". + * Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode + * regards them as "equal" (same types and concept names) and the stored values are equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are equal, OFFalse otherwise + */ + virtual OFBool operator==(const DSRDocumentTreeNode &node) const; + + /** comparison operator "not equal". + * Two tree nodes are not equal if either the comparison operator of the base class + * DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or + * the stored values are not equal. + ** @param node tree node that should be compared to the current one + ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise + */ + virtual OFBool operator!=(const DSRDocumentTreeNode &node) const; + + /** clone this tree node. + * Internally, the copy constructor is used, so the corresponding comments apply. + ** @return copy of this tree node + */ + virtual DSRWaveformTreeNode *clone() const; + + /** clear all member variables. + * Please note that the content item might become invalid afterwards. + */ + virtual void clear(); + + /** check whether the content item is valid. + * The content item is valid if the two base classes are valid. This check includes the value + * of the content item, which can also be checked separately with hasValidValue(). + ** @return OFTrue if tree node is valid, OFFalse otherwise + */ + virtual OFBool isValid() const; + + /** check whether the value of the content item, i.e.\ the waveform reference value, is valid + ** @return OFTrue if the value is valid, OFFalse otherwise + */ + virtual OFBool hasValidValue() const; + + /** check whether the content is short. + * The method isShort() from the base class DSRWaveformReferenceValue is called. + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print content item. + * A typical output looks like this: has properties WAVEFORM:=(HemodynamicWaveform + * Storage,"1.2.3") + ** @param stream output stream to which the content item should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** write content item in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + + protected: + + /** read content item (value) from dataset + ** @param dataset DICOM dataset from which the content item should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readContentItem(DcmItem &dataset, + const size_t flags); + + /** write content item (value) to dataset + ** @param dataset DICOM dataset to which the content item should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeContentItem(DcmItem &dataset) const; + + /** read content item specific XML data + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** render content item (value) in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param nestingLevel current nesting level. Used to render section headings. + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const; + + + private: + +// --- declaration of default constructor and assignment operator + + DSRWaveformTreeNode(); + DSRWaveformTreeNode &operator=(const DSRWaveformTreeNode &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrwavvl.h b/dcmsr/include/dcmtk/dcmsr/dsrwavvl.h new file mode 100644 index 00000000..c8b457d2 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrwavvl.h @@ -0,0 +1,233 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRWaveformReferenceValue + * + */ + + +#ifndef DSRWAVVL_H +#define DSRWAVVL_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcomvl.h" +#include "dcmtk/dcmsr/dsrwavch.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for waveform reference values + */ +class DCMTK_DCMSR_EXPORT DSRWaveformReferenceValue + : public DSRCompositeReferenceValue +{ + // allow access to getValuePtr() + friend class DSRContentItem; + + public: + + /** default constructor + */ + DSRWaveformReferenceValue(); + + /** constructor + ** @param sopClassUID referenced SOP class UID of the waveform object. + * (VR=UI, mandatory) + * @param sopInstanceUID referenced SOP instance UID of the waveform object. + * (VR=UI, mandatory) + * @param check if enabled, check 'sopClassUID' and 'sopInstanceUID' for + * validity before setting them. See checkXXX() for details. + * Empty values are never accepted. + */ + DSRWaveformReferenceValue(const OFString &sopClassUID, + const OFString &sopInstanceUID, + const OFBool check = OFTrue); + + /** copy constructor + ** @param referenceValue waveform reference value to be copied (not checked !) + */ + DSRWaveformReferenceValue(const DSRWaveformReferenceValue &referenceValue); + + /** destructor + */ + virtual ~DSRWaveformReferenceValue(); + + /** assignment operator + ** @param referenceValue waveform reference value to be copied (not checked !) + ** @return reference to this waveform reference value after 'referenceValue' has been copied + */ + DSRWaveformReferenceValue &operator=(const DSRWaveformReferenceValue &referenceValue); + + /** comparison operator "equal" + ** @param referenceValue waveform reference value that should be compared to the current one + ** @return OFTrue if both waveform reference values are equal, OFFalse otherwise + */ + OFBool operator==(const DSRWaveformReferenceValue &referenceValue) const; + + /** comparison operator "not equal" + ** @param referenceValue waveform reference value that should be compared to the current one + ** @return OFTrue if both waveform reference values are not equal, OFFalse otherwise + */ + OFBool operator!=(const DSRWaveformReferenceValue &referenceValue) const; + + /** clear all internal variables. + * Since an empty waveform reference is invalid the reference becomes invalid afterwards. + */ + virtual void clear(); + + /** check whether the content is short. + * This method is used to check whether the rendered output of this content item can be + * expanded inline or not (used for renderHTML()). + ** @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return OFTrue if the content is short, OFFalse otherwise + */ + virtual OFBool isShort(const size_t flags) const; + + /** print waveform reference. + * The output of a typical waveform reference value looks like this: + * (HemodynamicWaveformStorage,"1.2.3") + * If the SOP class UID is unknown, the UID is printed instead of the related name. + ** @param stream output stream to which the image reference value should be printed + * @param flags flag used to customize the output (see DSRTypes::PF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition print(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** read waveform reference from XML document + ** @param doc document containing the XML file content + * @param cursor cursor pointing to the starting node + * @param flags flag used to customize the reading process (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags); + + /** write waveform reference in XML format + ** @param stream output stream to which the XML document is written + * @param flags flag used to customize the output (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const; + + /** render waveform reference value in HTML/XHTML format + ** @param docStream output stream to which the main HTML/XHTML document is written + * @param annexStream output stream to which the HTML/XHTML document annex is written + * @param annexNumber reference to the variable where the current annex number is stored. + * Value is increased automatically by 1 after a new entry has been added. + * @param flags flag used to customize the output (see DSRTypes::HF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + size_t &annexNumber, + const size_t flags) const; + + /** get reference to waveform reference value + ** @return reference to waveform reference value + */ + inline const DSRWaveformReferenceValue &getValue() const + { + return *this; + } + + /** get copy of waveform reference value + ** @param referenceValue reference to variable in which the value should be stored + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getValue(DSRWaveformReferenceValue &referenceValue) const; + + /** set waveform reference value. + * Before setting the reference, it is usually checked. If the value is invalid, the + * current value is not replaced and remains unchanged. + ** @param referenceValue value to be set + * @param check if enabled, check value for validity before setting it. + * See checkXXX() for details. Empty values are only accepted + * for non-mandatory attributes. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setValue(const DSRWaveformReferenceValue &referenceValue, + const OFBool check = OFTrue); + + /** get reference to list of referenced waveform channels + ** @return reference to channel list + */ + inline DSRWaveformChannelList &getChannelList() + { + return ChannelList; + } + + /** check whether the waveform reference applies to a specific channel. + * The waveform reference applies to a channel if the list of referenced waveform + * channels is empty or the group/channel pair is part of the list. + ** @param multiplexGroupNumber multiplex group number of the referenced channel + * @param channelNumber channel number of the referenced channel + ** @return OFTrue if reference applies to the specified channel, OFFalse otherwise + */ + OFBool appliesToChannel(const Uint16 multiplexGroupNumber, + const Uint16 channelNumber) const; + + + protected: + + /** get pointer to waveform reference value + ** @return pointer to waveform reference value (never NULL) + */ + inline DSRWaveformReferenceValue *getValuePtr() + { + return this; + } + + /** read waveform reference value from dataset + ** @param dataset DICOM dataset from which the value should be read + * @param flags flag used to customize the reading process (see DSRTypes::RF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition readItem(DcmItem &dataset, + const size_t flags); + + /** write waveform reference value to dataset + ** @param dataset DICOM dataset to which the value should be written + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition writeItem(DcmItem &dataset) const; + + /** check the specified SOP class UID for validity. + * This method further specializes the checks performed in the base class + * DSRCompositeReferenceValue. All waveform SOP classes that are defined + * in DICOM PS 3.6-2017e are allowed. + ** @param sopClassUID SOP class UID to be checked + ** @return status, EC_Normal if value is valid, an error code otherwise + */ + virtual OFCondition checkSOPClassUID(const OFString &sopClassUID) const; + + + private: + + /// list of referenced waveform channels (associated DICOM VR=US, VM=2-2n, type 1C) + DSRWaveformChannelList ChannelList; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrxmlc.h b/dcmsr/include/dcmtk/dcmsr/dsrxmlc.h new file mode 100644 index 00000000..f2a2a1cb --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrxmlc.h @@ -0,0 +1,157 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRXMLCursor + * + */ + + +#ifndef DSRXMLC_H +#define DSRXMLC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsdefine.h" + +#include "dcmtk/ofstd/oftypes.h" /* for definition of OFBool */ + +#define INCLUDE_CSTDLIB +#define INCLUDE_CSTDDEF +#include "dcmtk/ofstd/ofstdinc.h" + +#ifdef WITH_LIBXML + +#ifdef __ibmxl__ +// IBM xlC defines __GNUC__ but does not support the GNUC extension +// __attribute__ ((format (printf, 2, 3))). +// This avoids a compiler warning in . +#define LIBXML_ATTR_FORMAT(fmt,args) +#endif + +// The libxml library also uses unicode. So we have to reuse some +// workarounds for the ICU library here as well. +// The type char16_t is only supported since C++11. +#ifndef HAVE_CHAR16_T +#define UCHAR_TYPE uint16_t +#endif + +//If U_NOEXCEPT is not defined, ICU falls back to NOEXCEPT. +#ifndef HAVE_CXX11 +#define U_NOEXCEPT +#endif + +#include +#endif + + +/*--------------------* + * type definitions * + *--------------------*/ + +#ifndef WITH_LIBXML +// define pointer type if 'libxml' absent +typedef void (*xmlNodePtr); +#endif + + +/*-----------------------* + * forward declaration * + *-----------------------*/ + +class DSRXMLDocument; + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for XML document cursors. + * This class encapsulates the access to the 'libxml' node pointer and, + * therefore, allows to replace the XML library with little effort (if + * required). + */ +class DCMTK_DCMSR_EXPORT DSRXMLCursor +{ + + // allow DSRXMLDocument to access private member variable 'Node' directly + friend class DSRXMLDocument; + + + public: + + /** default constructor + */ + DSRXMLCursor(); + + /** copy constructor + ** @param cursor cursor object to be copied + */ + DSRXMLCursor(const DSRXMLCursor &cursor); + + /** destructor + */ + virtual ~DSRXMLCursor(); + + /** assignment operator + ** @param cursor cursor object to be copied + ** @return reference to this cursor object after 'cursor' has been copied + */ + DSRXMLCursor &operator=(const DSRXMLCursor &cursor); + + /** check whether cursor is valid. + * Valid means that the cursor points to a valid XML node. + ** @return OFTrue if valid, OFFalse otherwise + */ + inline OFBool valid() const + { + return (Node != NULL); + } + + /** set cursor to next XML node (same level). + * Blank (empty or whitespace only) nodes are ignored/skipped. + ** @return reference to this cursor object (might be invalid) + */ + DSRXMLCursor &gotoNext(); + + /** set cursor to first XML child node (next lower level). + * Blank (empty or whitespace only) nodes are ignored/skipped. + ** @return reference to this cursor object (might be invalid) + */ + DSRXMLCursor &gotoChild(); + + /** get cursor pointing to next XML node (same level). + * This cursor object is not modified. + ** @return copy of the requested cursor object (might be invalid) + */ + DSRXMLCursor getNext() const; + + /** get cursor pointing to first XML child node (next lower level). + * This cursor object is not modified. + ** @return copy of the requested cursor object (might be invalid) + */ + DSRXMLCursor getChild() const; + + + private: + + /// pointer to the associated 'libxml' node + xmlNodePtr Node; +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrxmld.h b/dcmsr/include/dcmtk/dcmsr/dsrxmld.h new file mode 100644 index 00000000..5b0880b5 --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrxmld.h @@ -0,0 +1,319 @@ +/* + * + * Copyright (C) 2003-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRXMLDocument + * + */ + + +#ifndef DSRXMLD_H +#define DSRXMLD_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrxmlc.h" + + +/*--------------------* + * type definitions * + *--------------------*/ + +#ifndef WITH_LIBXML +// define types if 'libxml' absent +typedef void (*xmlDocPtr); +typedef void (*xmlCharEncodingHandlerPtr); +typedef char xmlChar; +#endif + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for XML documents. + * This class encapsulates the access to the 'libxml' routines. Since the + * public interface of this class does not use any 'libxml' specific data + * structures it should be possible to replace the XML library with little + * effort (if required). + */ +class DCMTK_DCMSR_EXPORT DSRXMLDocument + : protected DSRTypes +{ + + public: + + // --- constructors and destructor --- + + /** default constructor + */ + DSRXMLDocument(); + + /** destructor + */ + virtual ~DSRXMLDocument(); + + + // --- misc routines --- + + /** clear all internal member variables + */ + void clear(); + + /** check whether the current internal state is valid + ** @return OFTrue if valid, OFFalse otherwise + */ + OFBool valid() const; + + // --- input and output --- + + /** read XML document from file. + * In order to enable the optional Schema validation the flag DSRTypes::XF_validateSchema + * has to be set. + ** @param filename name of the file from which the XML document is read + * ("-" for stdin) + * @param flags optional flag used to customize the reading process + * (see DSRTypes::XF_xxx) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition read(const OFString &filename, + const size_t flags = 0); + + + // --- character encoding --- + + /** check whether the currently set character encoding handler is valid. + * If no encoding handler is set this is equivalent to an invalid handler. + ** @return OFTrue if handler is valid, OFFalse otherwise + */ + OFBool encodingHandlerValid() const; + + /** set character encoding handler for converting internally stored character strings + * (UTF-8) to a particular character set. This conversion is only done when requested, + * e.g. when calling getStringFromAttribute() with the 'encoding' parameter being OFTrue. + * NB: 'libxml' relies on GNU 'libiconv' for most character sets. + ** @param charset XML name of the character set (e.g. "ISO-8859-1" for ISO Latin-1) + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition setEncodingHandler(const char *charset); + + + // --- navigation and checking --- + + /** get root node of the document + ** @return cursor pointing to the root node if successful, invalid cursor otherwise + */ + DSRXMLCursor getRootNode() const; + + /** get a particular named node of the document. + * Please note that the search process is limited to the current node level, i.e. no + * deep search is performed. + ** @param cursor cursor pointing to the node where to start from + * @param name name of the node (XML element) to be searched for + * @param required flag specifying whether the node is required or not. If the node + * is required to be present an error message is reported. + ** @return cursor pointing to the named node if successful, invalid cursor otherwise + */ + DSRXMLCursor getNamedNode(const DSRXMLCursor &cursor, + const char *name, + const OFBool required = OFTrue) const; + + /** get a particular named child node of the document. + * Please note that the search process is limited to the first level below the current + * one, i.e. no deep search is performed. + ** @param cursor cursor pointing to the parent of the node where to start from + * @param name name of the node (XML element) to be searched for + * @param required flag specifying whether the node is required or not. If the node + * is required to be present an error message is reported. + ** @return cursor pointing to the named node if successful, invalid cursor otherwise + */ + DSRXMLCursor getNamedChildNode(const DSRXMLCursor &cursor, + const char *name, + const OFBool required = OFTrue) const; + + /** check whether particular node matches a given name + ** @param cursor cursor pointing to the particular node + * @param name name of the node (XML element) to be checked + ** @return OFTrue if name matches, OFFalse otherwise + */ + OFBool matchNode(const DSRXMLCursor &cursor, + const char *name) const; + + /** check whether particular node matches a given name and report an error if not + ** @param cursor cursor pointing to the particular node + * @param name name of the node (XML element) to be checked + ** @return OFTrue if name matches, OFFalse otherwise + */ + OFCondition checkNode(const DSRXMLCursor &cursor, + const char *name) const; + + + // --- get attributes and node content --- + + /** check whether particular node has a specific attribute + ** @param cursor cursor pointing to the particular node + * @param name name of the XML attribute to be checked + ** @return OFTrue if attribute is present, OFFalse otherwise + */ + OFBool hasAttribute(const DSRXMLCursor &cursor, + const char *name) const; + + /** get string value from particular XML attribute. + * The result variable 'stringValue' is automatically cleared at the beginning. + ** @param cursor cursor pointing to the particular node + * @param stringValue reference to string object in which the value should be stored + * @param name name of the XML attribute to be retrieved + * @param encoding use encoding handler if OFTrue, ignore character set otherwise + * @param required flag specifying whether the attribute is required or not. If the + * attribute is required to be present an error message is reported + * in case it is not found. + ** @return reference to string object (might be empty) + */ + OFString &getStringFromAttribute(const DSRXMLCursor &cursor, + OFString &stringValue, + const char *name, + const OFBool encoding = OFFalse, + const OFBool required = OFTrue) const; + + /** get element value from particular XML attribute + ** @param cursor cursor pointing to the particular node + * @param delem DICOM element in which the attribute value is stored + * @param name name of the XML attribute to be retrieved + * @param encoding use encoding handler if OFTrue, ignore character set otherwise + * @param required flag specifying whether the attribute is required or not. If the + * attribute is required to be present an error message is reported + * in case it is not found. + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getElementFromAttribute(const DSRXMLCursor &cursor, + DcmElement &delem, + const char *name, + const OFBool encoding = OFFalse, + const OFBool required = OFTrue) const; + + /** get string value from particular XML element + ** @param cursor cursor pointing to the particular node + * @param stringValue reference to string object in which the value should be stored + * @param name name of the XML element to be retrieved + * @param encoding use encoding handler if OFTrue, ignore character set otherwise + * @param clearString flag specifying whether to clear the 'stringValue' at first or not + ** @return reference to string object (might be empty) + */ + OFString &getStringFromNodeContent(const DSRXMLCursor &cursor, + OFString &stringValue, + const char *name = NULL, + const OFBool encoding = OFFalse, + const OFBool clearString = OFTrue) const; + + /** get element value from particular XML element + ** @param cursor cursor pointing to the particular node + * @param delem DICOM element in which the element value is stored + * @param name name of the XML element to be retrieved + * @param encoding use encoding handler if OFTrue, ignore character set otherwise + ** @return status, EC_Normal if successful, an error code otherwise + */ + OFCondition getElementFromNodeContent(const DSRXMLCursor &cursor, + DcmElement &delem, + const char *name = NULL, + const OFBool encoding = OFFalse) const; + + /** get value type from particular node. + * The value type is either stored as the element name or in the attribute "valType". + * Additionally, by-reference relationships are also supported (either by attribute + * "ref" being present or element named "reference"). + ** @param cursor cursor pointing to the particular node + ** @return value type (incl. by-reference) if successful, DSRTypes::VT_invalid otherwise + */ + E_ValueType getValueTypeFromNode(const DSRXMLCursor &cursor) const; + + /** get relationship type from particular node. + * The relationship type is either stored in the element "relationship" or in the + * attribute "relType". + ** @param cursor cursor pointing to the particular node + ** @return relationship type if successful, DSRTypes::RT_invalid or DSRTypes::RT_unknown + * otherwise + */ + E_RelationshipType getRelationshipTypeFromNode(const DSRXMLCursor &cursor) const; + + + // --- error/warning messages --- + + /** print warning message for unexpected node + ** @param cursor cursor pointing to the unexpected node + */ + void printUnexpectedNodeWarning(const DSRXMLCursor &cursor) const; + + /** print warning message for missing attribute + ** @param cursor cursor pointing to the relevant node + * @param name name of the XML attribute + */ + void printMissingAttributeWarning(const DSRXMLCursor &cursor, + const char *name) const; + + /** print general node error message + ** @param cursor cursor pointing to the unexpected node + * @param result status used to print details on the error (no message if EC_Normal) + */ + void printGeneralNodeError(const DSRXMLCursor &cursor, + const OFCondition &result) const; + + protected: + + /** convert given string from 'libxml' format (UTF8) to current character set + ** @param fromString character string to be converted + * @param toString reference to string object in which the result should be stored + ** @return OFTrue if successful, OFFalse otherwise (e.g. no handler selected) + */ + OFBool convertUtf8ToCharset(const xmlChar *fromString, + OFString &toString) const; + + /** print error message for missing attribute + ** @param cursor cursor pointing to the relevant node + * @param name name of the XML attribute + */ + void printMissingAttributeError(const DSRXMLCursor &cursor, + const char *name) const; + + // --- static function --- + + /** get the full path (incl.\ all predecessors) to the current node + ** @param cursor cursor pointing to the relevant node + * @param stringValue reference to string object in which the result should be stored + * @param omitCurrent flag indicating whether to omit the current node or not + ** @return resulting character string, set to "" in case of an invalid 'cursor' + */ + static OFString &getFullNodePath(const DSRXMLCursor &cursor, + OFString &stringValue, + const OFBool omitCurrent = OFFalse); + + + private: + + /// pointer to the internal representation of the XML document (libxml) + xmlDocPtr Document; + /// pointer to the currently selected character encoding handler (libxml) + xmlCharEncodingHandlerPtr EncodingHandler; + +// --- declaration copy constructor and assignment operator + + DSRXMLDocument(const DSRXMLDocument &); + DSRXMLDocument &operator=(const DSRXMLDocument &); +}; + + +#endif diff --git a/dcmsr/include/dcmtk/dcmsr/dsrxrdcc.h b/dcmsr/include/dcmtk/dcmsr/dsrxrdcc.h new file mode 100644 index 00000000..5b1fb82e --- /dev/null +++ b/dcmsr/include/dcmtk/dcmsr/dsrxrdcc.h @@ -0,0 +1,97 @@ +/* + * + * Copyright (C) 2005-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRXRayRadiationDoseSRConstraintChecker + * + */ + + +#ifndef DSRXRDCC_H +#define DSRXRDCC_H + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsriodcc.h" + + +/*---------------------* + * class declaration * + *---------------------*/ + +/** Class for checking the relationship content constraints of the X-Ray Radiation Dose + * SR IOD. + * According to DICOM PS 3.3: "The document may be constructed from Baseline TID 10001 + * (Projection X-Ray Radiation Dose) or Baseline TID 10011 (CT Radiation Dose) invoked + * at the root node. Note: This IOD maybe used with other Templates defined for Dose + * Reporting. Such other Templates may be specialized for specific modalities or + * future dose measurement techniques." + */ +class DCMTK_DCMSR_EXPORT DSRXRayRadiationDoseSRConstraintChecker + : public DSRIODConstraintChecker +{ + + public: + + /** default constructor + */ + DSRXRayRadiationDoseSRConstraintChecker(); + + /** destructor + */ + virtual ~DSRXRayRadiationDoseSRConstraintChecker(); + + /** check whether by-reference relationships are allowed for this SR IOD + ** @return always returns OFFalse, i.e. by-reference relationships are not allowed + */ + virtual OFBool isByReferenceAllowed() const; + + /** check whether this SR IOD requires template support + ** @return always returns OFFalse, i.e. template support is not required + */ + virtual OFBool isTemplateSupportRequired() const; + + /** get identifier and mapping resource of the root template (if any) + ** @param templateIdentifier identifier of the root template (might be empty) + * @param mappingResource mapping resource that defines the root template + * (might be empty) + ** @return status, EC_Normal if successful, an error code otherwise + */ + virtual OFCondition getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const; + + /** get the associated document type of the SR IOD + ** @return document type (DSRTypes::DT_XRayRadiationDoseSR) + */ + virtual E_DocumentType getDocumentType() const; + + /** check whether specified content relationship is allowed for this IOD + ** @param sourceValueType value type of the source content item to be checked + * @param relationshipType type of relationship between source and target item + * @param targetValueType value type of the target content item to be checked + * @param byReference optional flag indicating whether the node/relationship + * should be added by-value (default) or by-reference + ** @return OFTrue if content relationship is allowed, OFFalse otherwise + */ + virtual OFBool checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference = OFFalse) const; +}; + + +#endif diff --git a/dcmsr/libcmr/CMakeLists.txt b/dcmsr/libcmr/CMakeLists.txt new file mode 100644 index 00000000..a1f4cb19 --- /dev/null +++ b/dcmsr/libcmr/CMakeLists.txt @@ -0,0 +1,4 @@ +# create library from source files +DCMTK_ADD_LIBRARY(cmr init logger srnumvl tid300 tid1001 tid1204 tid1411 tid1419m tid1500 tid1501 tid15def tid1600 tid4019 cid11 cid29 cid29e cid42 cid100 cid244 cid244e cid4020 cid4021 cid4031 cid4031e cid5000 cid5001 cid6147 cid7021 cid7181 cid7445 cid7452 cid7453 cid7464 cid7469 cid10013 cid10013e cid10033 cid10033e) + +DCMTK_TARGET_LINK_MODULES(cmr dcmsr) diff --git a/dcmsr/libcmr/Makefile.dep b/dcmsr/libcmr/Makefile.dep new file mode 100644 index 00000000..60123a94 --- /dev/null +++ b/dcmsr/libcmr/Makefile.dep @@ -0,0 +1,2606 @@ +cid100.o: cid100.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid100.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid10013.o: cid10013.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid10013.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid10013e.o: cid10013e.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid10013e.h \ + ../include/dcmtk/dcmsr/cmr/cid10013.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid10033.o: cid10033.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid10033.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid10033e.o: cid10033e.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid10033e.h \ + ../include/dcmtk/dcmsr/cmr/cid10033.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid11.o: cid11.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid11.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid244.o: cid244.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid244.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid244e.o: cid244e.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid29.o: cid29.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid29.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid29e.o: cid29e.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid29e.h ../include/dcmtk/dcmsr/cmr/cid29.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/codes/dcm.h +cid4020.o: cid4020.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid4020.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid4021.o: cid4021.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid4021.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid4031.o: cid4031.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid4031.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid4031e.o: cid4031e.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid4031e.h \ + ../include/dcmtk/dcmsr/cmr/cid4031.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid42.o: cid42.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid42.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid5000.o: cid5000.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid5000.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid5001.o: cid5001.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid5001.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid6147.o: cid6147.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid6147.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid7021.o: cid7021.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid7021.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid7181.o: cid7181.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid7181.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid7445.o: cid7445.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid7445.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid7452.o: cid7452.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid7452.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid7453.o: cid7453.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid7453.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid7464.o: cid7464.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid7464.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +cid7469.o: cid7469.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/cid7469.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +init.o: init.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/init.h ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmsr/cmr/cid11.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/cid29.h ../include/dcmtk/dcmsr/cmr/cid42.h \ + ../include/dcmtk/dcmsr/cmr/cid100.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/cmr/cid4020.h \ + ../include/dcmtk/dcmsr/cmr/cid4021.h \ + ../include/dcmtk/dcmsr/cmr/cid4031.h \ + ../include/dcmtk/dcmsr/cmr/cid5000.h \ + ../include/dcmtk/dcmsr/cmr/cid5001.h \ + ../include/dcmtk/dcmsr/cmr/cid6147.h \ + ../include/dcmtk/dcmsr/cmr/cid7021.h \ + ../include/dcmtk/dcmsr/cmr/cid7181.h \ + ../include/dcmtk/dcmsr/cmr/cid7445.h \ + ../include/dcmtk/dcmsr/cmr/cid7452.h \ + ../include/dcmtk/dcmsr/cmr/cid7453.h \ + ../include/dcmtk/dcmsr/cmr/cid7464.h \ + ../include/dcmtk/dcmsr/cmr/cid7469.h \ + ../include/dcmtk/dcmsr/cmr/cid10013.h \ + ../include/dcmtk/dcmsr/cmr/cid10033.h +logger.o: logger.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/logger.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../include/dcmtk/dcmsr/cmr/define.h +srnumvl.o: srnumvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/cmr/cid42.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h +tid1001.o: tid1001.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid1001.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h ../include/dcmtk/dcmsr/cmr/cid7445.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/cid7452.h \ + ../include/dcmtk/dcmsr/cmr/cid7453.h ../include/dcmtk/dcmsr/codes/dcm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid1204.o: tid1204.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid1204.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h ../include/dcmtk/dcmsr/cmr/cid5000.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/cid5001.h ../include/dcmtk/dcmsr/codes/dcm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid1411.o: tid1411.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid1411.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../include/dcmtk/dcmsr/cmr/srnumvlu.h \ + ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/tid1419m.h \ + ../include/dcmtk/dcmsr/cmr/tid4019.h \ + ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/cmr/cid6147.h \ + ../include/dcmtk/dcmsr/cmr/cid7181.h \ + ../include/dcmtk/dcmsr/cmr/cid7464.h \ + ../include/dcmtk/dcmsr/cmr/cid7469.h \ + ../include/dcmtk/dcmsr/cmr/tid15def.h \ + ../include/dcmtk/dcmsr/cmr/logger.h ../include/dcmtk/dcmsr/codes/dcm.h \ + ../include/dcmtk/dcmsr/codes/ncit.h ../include/dcmtk/dcmsr/codes/sct.h \ + ../include/dcmtk/dcmsr/codes/umls.h ../include/dcmtk/dcmsr/dsrtpltn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid1419m.o: tid1419m.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid1419m.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../include/dcmtk/dcmsr/cmr/srnumvlu.h \ + ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/tid4019.h \ + ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/cmr/tid15def.h \ + ../include/dcmtk/dcmsr/cmr/cid6147.h \ + ../include/dcmtk/dcmsr/cmr/cid7181.h \ + ../include/dcmtk/dcmsr/cmr/cid7464.h \ + ../include/dcmtk/dcmsr/cmr/cid7469.h ../include/dcmtk/dcmsr/cmr/logger.h \ + ../include/dcmtk/dcmsr/codes/dcm.h ../include/dcmtk/dcmsr/codes/sct.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid1500.o: tid1500.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid1500.h ../include/dcmtk/dcmsr/dsrrtpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/cmr/define.h \ + ../include/dcmtk/dcmsr/cmr/tid1001.h \ + ../include/dcmtk/dcmsr/cmr/cid7445.h ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/cid7452.h \ + ../include/dcmtk/dcmsr/cmr/cid7453.h \ + ../include/dcmtk/dcmsr/cmr/tid1204.h \ + ../include/dcmtk/dcmsr/cmr/cid5000.h \ + ../include/dcmtk/dcmsr/cmr/cid5001.h \ + ../include/dcmtk/dcmsr/cmr/tid1411.h \ + ../include/dcmtk/dcmsr/cmr/srnumvlu.h \ + ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \ + ../include/dcmtk/dcmsr/cmr/tid1419m.h \ + ../include/dcmtk/dcmsr/cmr/tid4019.h \ + ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/cmr/cid6147.h \ + ../include/dcmtk/dcmsr/cmr/cid7181.h \ + ../include/dcmtk/dcmsr/cmr/cid7464.h \ + ../include/dcmtk/dcmsr/cmr/cid7469.h \ + ../include/dcmtk/dcmsr/cmr/tid1501.h ../include/dcmtk/dcmsr/cmr/tid300.h \ + ../include/dcmtk/dcmsr/cmr/tid1600.h \ + ../include/dcmtk/dcmsr/cmr/cid4020.h \ + ../include/dcmtk/dcmsr/cmr/cid4021.h ../include/dcmtk/dcmsr/cmr/cid100.h \ + ../include/dcmtk/dcmsr/cmr/cid7021.h \ + ../include/dcmtk/dcmsr/cmr/tid15def.h \ + ../include/dcmtk/dcmsr/cmr/logger.h ../include/dcmtk/dcmsr/codes/dcm.h \ + ../include/dcmtk/dcmsr/codes/umls.h ../include/dcmtk/dcmsr/dsrtpltn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid1501.o: tid1501.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid1501.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h ../include/dcmtk/dcmsr/cmr/tid300.h \ + ../include/dcmtk/dcmsr/cmr/srnumvlu.h \ + ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/cmr/cid6147.h \ + ../include/dcmtk/dcmsr/cmr/cid7181.h \ + ../include/dcmtk/dcmsr/cmr/cid7464.h \ + ../include/dcmtk/dcmsr/cmr/cid7469.h \ + ../include/dcmtk/dcmsr/cmr/tid15def.h \ + ../include/dcmtk/dcmsr/cmr/logger.h ../include/dcmtk/dcmsr/codes/dcm.h \ + ../include/dcmtk/dcmsr/codes/ncit.h ../include/dcmtk/dcmsr/codes/sct.h \ + ../include/dcmtk/dcmsr/codes/umls.h ../include/dcmtk/dcmsr/dsrtpltn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid15def.o: tid15def.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid15def.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h +tid1600.o: tid1600.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid1600.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h ../include/dcmtk/dcmsr/cmr/cid4020.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/cid4021.h \ + ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \ + ../include/dcmtk/dcmsr/cmr/cid29e.h ../include/dcmtk/dcmsr/cmr/cid29.h \ + ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/cmr/cid4031e.h \ + ../include/dcmtk/dcmsr/cmr/cid4031.h \ + ../include/dcmtk/dcmsr/cmr/cid10013e.h \ + ../include/dcmtk/dcmsr/cmr/cid10013.h \ + ../include/dcmtk/dcmsr/cmr/cid10033e.h \ + ../include/dcmtk/dcmsr/cmr/cid10033.h \ + ../include/dcmtk/dcmsr/cmr/logger.h ../include/dcmtk/dcmsr/codes/dcm.h \ + ../include/dcmtk/dcmsr/codes/sct.h ../include/dcmtk/dcmsr/codes/ucum.h \ + ../include/dcmtk/dcmsr/dsrdattn.h ../include/dcmtk/dcmsr/dsrstrvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid300.o: tid300.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid300.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h \ + ../include/dcmtk/dcmsr/cmr/srnumvlu.h \ + ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h \ + ../../ofstd/include/dcmtk/ofstd/ofmap.h \ + ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \ + ../include/dcmtk/dcmsr/cmr/tid15def.h \ + ../include/dcmtk/dcmsr/cmr/cid6147.h \ + ../include/dcmtk/dcmsr/cmr/cid7181.h \ + ../include/dcmtk/dcmsr/cmr/cid7464.h \ + ../include/dcmtk/dcmsr/cmr/cid7469.h ../include/dcmtk/dcmsr/cmr/logger.h \ + ../include/dcmtk/dcmsr/codes/dcm.h ../include/dcmtk/dcmsr/codes/sct.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +tid4019.o: tid4019.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/cmr/tid4019.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/cmr/define.h ../include/dcmtk/dcmsr/codes/dcm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h diff --git a/dcmsr/libcmr/Makefile.in b/dcmsr/libcmr/Makefile.in new file mode 100644 index 00000000..ce7497a1 --- /dev/null +++ b/dcmsr/libcmr/Makefile.in @@ -0,0 +1,56 @@ +# +# Makefile for dcmsr/libcmr +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmsr = $(top_srcdir)/../dcmsr + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include \ + -I$(dcmsr)/include +LOCALDEFS = + +objs = init.o logger.o srnumvl.o tid300.o tid1001.o tid1204.o tid1411.o tid1419m.o \ + tid1500.o tid1501.o tid15def.o tid1600.o tid4019.o \ + cid11.o cid29.o cid29e.o cid42.o cid100.o cid244.o cid244e.o cid4020.o \ + cid4021.o cid4031.o cid4031e.o cid5000.o cid5001.o cid6147.o cid7021.o \ + cid7181.o cid7445.o cid7452.o cid7453.o cid7464.o cid7469.o cid10013.o \ + cid10013e.o cid10033.o cid10033e.o +library = libcmr.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmsr/libcmr/cid100.cc b/dcmsr/libcmr/cid100.cc new file mode 100644 index 00000000..b9016c9f --- /dev/null +++ b/dcmsr/libcmr/cid100.cc @@ -0,0 +1,178 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID100_QuantitativeDiagnosticImagingProcedures + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:14 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid100.h" + + +// general information on CID 100 (Quantitative Diagnostic Imaging Procedures) +#define CONTEXT_GROUP_NUMBER "100" +#define CONTEXT_GROUP_VERSION "20190121" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.998" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID100_QuantitativeDiagnosticImagingProcedures::CodeList *CID100_QuantitativeDiagnosticImagingProcedures::Codes = NULL; + + +CID100_QuantitativeDiagnosticImagingProcedures::CID100_QuantitativeDiagnosticImagingProcedures(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID100_QuantitativeDiagnosticImagingProcedures::CID100_QuantitativeDiagnosticImagingProcedures(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID100_QuantitativeDiagnosticImagingProcedures::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID100_QuantitativeDiagnosticImagingProcedures::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID100_QuantitativeDiagnosticImagingProcedures::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID100_QuantitativeDiagnosticImagingProcedures::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID100_QuantitativeDiagnosticImagingProcedures::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID100_QuantitativeDiagnosticImagingProcedures::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID100_QuantitativeDiagnosticImagingProcedures::CodeList &CID100_QuantitativeDiagnosticImagingProcedures::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(ImagingProcedure, DSRBasicCodedEntry("363679005", "SCT", "Imaging procedure"))); + Codes->insert(OFMake_pair(MagneticResonanceImagingGuidance, DSRBasicCodedEntry("258177008", "SCT", "Magnetic resonance imaging guidance"))); + Codes->insert(OFMake_pair(MultiparametricMRI, DSRBasicCodedEntry("126020", "DCM", "Multiparametric MRI"))); + Codes->insert(OFMake_pair(MultiparametricMRIOfProstate, DSRBasicCodedEntry("126021", "DCM", "Multiparametric MRI of prostate"))); + Codes->insert(OFMake_pair(MultiparametricMRIOfWholeBody, DSRBasicCodedEntry("126022", "DCM", "Multiparametric MRI of whole body"))); + Codes->insert(OFMake_pair(DynamicMagneticResonanceImagingOfKnee, DSRBasicCodedEntry("433139009", "SCT", "Dynamic magnetic resonance imaging of knee"))); + Codes->insert(OFMake_pair(DynamicMagneticResonanceImagingOfPelvis, DSRBasicCodedEntry("446315002", "SCT", "Dynamic magnetic resonance imaging of pelvis"))); + Codes->insert(OFMake_pair(CTUnspecifiedBodyRegion, DSRBasicCodedEntry("25045-6", "LN", "CT unspecified body region"))); + Codes->insert(OFMake_pair(MRIUnspecifiedBodyRegion, DSRBasicCodedEntry("25056-3", "LN", "MRI unspecified body region"))); + Codes->insert(OFMake_pair(NMUnspecifiedBodyRegion, DSRBasicCodedEntry("49118-3", "LN", "NM unspecified body region"))); + Codes->insert(OFMake_pair(PETUnspecifiedBodyRegion, DSRBasicCodedEntry("44136-0", "LN", "PET unspecified body region"))); + Codes->insert(OFMake_pair(PETWholeBody, DSRBasicCodedEntry("44139-4", "LN", "PET whole body"))); + Codes->insert(OFMake_pair(PETCT_FDGImagingOfWholeBody, DSRBasicCodedEntry("443271005", "SCT", "PET/CT FDG imaging of whole body"))); + Codes->insert(OFMake_pair(PETCT_METImagingOfWholeBody, DSRBasicCodedEntry("443844003", "SCT", "PET/CT MET imaging of whole body"))); + Codes->insert(OFMake_pair(CTPerfusionHeadWithContrastIV, DSRBasicCodedEntry("39142-5", "LN", "CT perfusion head with contrast IV"))); + Codes->insert(OFMake_pair(SPECTBrain, DSRBasicCodedEntry("39632-5", "LN", "SPECT brain"))); + Codes->insert(OFMake_pair(NMHeadPerfusionBrainPET_CT_AV45, DSRBasicCodedEntry("RPID5427", "RADLEX", "NM head perfusion brain PET-CT AV-45"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID100_QuantitativeDiagnosticImagingProcedures::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid10013.cc b/dcmsr/libcmr/cid10013.cc new file mode 100644 index 00000000..30ff20cb --- /dev/null +++ b/dcmsr/libcmr/cid10013.cc @@ -0,0 +1,167 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID10013_CTAcquisitionType + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:39 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid10013.h" + + +// general information on CID 10013 (CT Acquisition Type) +#define CONTEXT_GROUP_NUMBER "10013" +#define CONTEXT_GROUP_VERSION "20160314" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.545" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID10013_CTAcquisitionType::CodeList *CID10013_CTAcquisitionType::Codes = NULL; + + +CID10013_CTAcquisitionType::CID10013_CTAcquisitionType(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID10013_CTAcquisitionType::CID10013_CTAcquisitionType(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID10013_CTAcquisitionType::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID10013_CTAcquisitionType::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID10013_CTAcquisitionType::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID10013_CTAcquisitionType::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID10013_CTAcquisitionType::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID10013_CTAcquisitionType::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID10013_CTAcquisitionType::CodeList &CID10013_CTAcquisitionType::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(SequencedAcquisition, DSRBasicCodedEntry("113804", "DCM", "Sequenced Acquisition"))); + Codes->insert(OFMake_pair(SpiralAcquisition, DSRBasicCodedEntry("116152004", "SCT", "Spiral Acquisition"))); + Codes->insert(OFMake_pair(ConstantAngleAcquisition, DSRBasicCodedEntry("113805", "DCM", "Constant Angle Acquisition"))); + Codes->insert(OFMake_pair(StationaryAcquisition, DSRBasicCodedEntry("113806", "DCM", "Stationary Acquisition"))); + Codes->insert(OFMake_pair(FreeAcquisition, DSRBasicCodedEntry("113807", "DCM", "Free Acquisition"))); + Codes->insert(OFMake_pair(ConeBeamAcquisition, DSRBasicCodedEntry("702569007", "SCT", "Cone Beam Acquisition"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID10013_CTAcquisitionType::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid10013e.cc b/dcmsr/libcmr/cid10013e.cc new file mode 100644 index 00000000..71e0c21b --- /dev/null +++ b/dcmsr/libcmr/cid10013e.cc @@ -0,0 +1,88 @@ +/* + * + * Copyright (C) 2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID10013e_CTAcquisitionType + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid10013e.h" + + +CID10013e_CTAcquisitionType::CID10013e_CTAcquisitionType(const DSRCodedEntryValue &selectedValue) + : CID10013_CTAcquisitionType(selectedValue) +{ +} + + +CID10013e_CTAcquisitionType::CID10013e_CTAcquisitionType(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : CID10013_CTAcquisitionType(selectedValue, enhancedEncodingMode) +{ +} + + +CID10013e_CTAcquisitionType::CID10013e_CTAcquisitionType(const OFString &selectedValue, + const OFBool enhancedEncodingMode) + : CID10013_CTAcquisitionType(mapAcquisitionType(selectedValue, enhancedEncodingMode)) +{ +} + + +OFCondition CID10013e_CTAcquisitionType::selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* map enumerated value to coded entry */ + OFCondition result = mapAcquisitionType(selectedValue, codedEntry, enhancedEncodingMode); + if (result.good()) + { + /* select but never check the coded entry */ + result = selectValue(codedEntry, OFFalse /*check*/, OFFalse /*definedContextGroup*/); + } + return result; +} + + +// static functions + +DSRCodedEntryValue CID10013e_CTAcquisitionType::mapAcquisitionType(const OFString &definedTerm, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* call the real function (no need to check the returned status) */ + mapAcquisitionType(definedTerm, codedEntry, enhancedEncodingMode); + /* return coded entry (by-value) */ + return codedEntry; +} + + +OFCondition CID10013e_CTAcquisitionType::mapAcquisitionType(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode) +{ + OFCondition result = EC_Normal; + /* determine acquisition type code from CID 10013 */ + if (definedTerm == "SEQUENCED") + codedEntryValue = getCodedEntry(SequencedAcquisition); + else if (definedTerm == "SPIRAL") + codedEntryValue = getCodedEntry(SpiralAcquisition); + else if (definedTerm == "CONSTANT_ANGLE") + codedEntryValue = getCodedEntry(ConstantAngleAcquisition); + else if (definedTerm == "STATIONARY") + codedEntryValue = getCodedEntry(StationaryAcquisition); + else if (definedTerm == "FREE") + codedEntryValue = getCodedEntry(FreeAcquisition); + else + result = SR_EC_UnsupportedValue; + /* set enhanced encoding mode (if enabled) */ + if (result.good() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntryValue); + return result; +} diff --git a/dcmsr/libcmr/cid10033.cc b/dcmsr/libcmr/cid10033.cc new file mode 100644 index 00000000..1839856f --- /dev/null +++ b/dcmsr/libcmr/cid10033.cc @@ -0,0 +1,163 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID10033_CTReconstructionAlgorithm + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:41 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid10033.h" + + +// general information on CID 10033 (CT Reconstruction Algorithm) +#define CONTEXT_GROUP_NUMBER "10033" +#define CONTEXT_GROUP_VERSION "20130207" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.958" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID10033_CTReconstructionAlgorithm::CodeList *CID10033_CTReconstructionAlgorithm::Codes = NULL; + + +CID10033_CTReconstructionAlgorithm::CID10033_CTReconstructionAlgorithm(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID10033_CTReconstructionAlgorithm::CID10033_CTReconstructionAlgorithm(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID10033_CTReconstructionAlgorithm::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID10033_CTReconstructionAlgorithm::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID10033_CTReconstructionAlgorithm::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID10033_CTReconstructionAlgorithm::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID10033_CTReconstructionAlgorithm::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID10033_CTReconstructionAlgorithm::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID10033_CTReconstructionAlgorithm::CodeList &CID10033_CTReconstructionAlgorithm::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(FilteredBackProjection, DSRBasicCodedEntry("113962", "DCM", "Filtered Back Projection"))); + Codes->insert(OFMake_pair(IterativeReconstruction, DSRBasicCodedEntry("113963", "DCM", "Iterative Reconstruction"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID10033_CTReconstructionAlgorithm::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid10033e.cc b/dcmsr/libcmr/cid10033e.cc new file mode 100644 index 00000000..5277d8fa --- /dev/null +++ b/dcmsr/libcmr/cid10033e.cc @@ -0,0 +1,82 @@ +/* + * + * Copyright (C) 2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID10033e_CTReconstructionAlgorithm + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid10033e.h" + + +CID10033e_CTReconstructionAlgorithm::CID10033e_CTReconstructionAlgorithm(const DSRCodedEntryValue &selectedValue) + : CID10033_CTReconstructionAlgorithm(selectedValue) +{ +} + + +CID10033e_CTReconstructionAlgorithm::CID10033e_CTReconstructionAlgorithm(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : CID10033_CTReconstructionAlgorithm(selectedValue, enhancedEncodingMode) +{ +} + + +CID10033e_CTReconstructionAlgorithm::CID10033e_CTReconstructionAlgorithm(const OFString &selectedValue, + const OFBool enhancedEncodingMode) + : CID10033_CTReconstructionAlgorithm(mapReconstructionAlgorithm(selectedValue, enhancedEncodingMode)) +{ +} + + +OFCondition CID10033e_CTReconstructionAlgorithm::selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* map enumerated value to coded entry */ + OFCondition result = mapReconstructionAlgorithm(selectedValue, codedEntry, enhancedEncodingMode); + if (result.good()) + { + /* select but never check the coded entry */ + result = selectValue(codedEntry, OFFalse /*check*/, OFFalse /*definedContextGroup*/); + } + return result; +} + + +// static functions + +DSRCodedEntryValue CID10033e_CTReconstructionAlgorithm::mapReconstructionAlgorithm(const OFString &definedTerm, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* call the real function (no need to check the returned status) */ + mapReconstructionAlgorithm(definedTerm, codedEntry, enhancedEncodingMode); + /* return coded entry (by-value) */ + return codedEntry; +} + + +OFCondition CID10033e_CTReconstructionAlgorithm::mapReconstructionAlgorithm(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode) +{ + OFCondition result = EC_Normal; + /* determine reconstruction algorithm code from CID 10033 */ + if (definedTerm == "FILTER_BACK_PROJ") + codedEntryValue = getCodedEntry(FilteredBackProjection); + else if (definedTerm == "ITERATIVE") + codedEntryValue = getCodedEntry(IterativeReconstruction); + else + result = SR_EC_UnsupportedValue; + /* set enhanced encoding mode (if enabled) */ + if (result.good() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntryValue); + return result; +} diff --git a/dcmsr/libcmr/cid11.cc b/dcmsr/libcmr/cid11.cc new file mode 100644 index 00000000..26280725 --- /dev/null +++ b/dcmsr/libcmr/cid11.cc @@ -0,0 +1,186 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID11_RouteOfAdministration + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:09 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid11.h" + + +// general information on CID 11 (Route of Administration) +#define CONTEXT_GROUP_NUMBER "11" +#define CONTEXT_GROUP_VERSION "20160314" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.9" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID11_RouteOfAdministration::CodeList *CID11_RouteOfAdministration::Codes = NULL; + + +CID11_RouteOfAdministration::CID11_RouteOfAdministration(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID11_RouteOfAdministration::CID11_RouteOfAdministration(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID11_RouteOfAdministration::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID11_RouteOfAdministration::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID11_RouteOfAdministration::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID11_RouteOfAdministration::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID11_RouteOfAdministration::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID11_RouteOfAdministration::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID11_RouteOfAdministration::CodeList &CID11_RouteOfAdministration::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(IntravenousRoute, DSRBasicCodedEntry("47625008", "SCT", "Intravenous route"))); + Codes->insert(OFMake_pair(IntraArterialRoute, DSRBasicCodedEntry("58100008", "SCT", "Intra-arterial route"))); + Codes->insert(OFMake_pair(IntramuscularRoute, DSRBasicCodedEntry("78421000", "SCT", "Intramuscular route"))); + Codes->insert(OFMake_pair(SubcutaneousRoute, DSRBasicCodedEntry("34206005", "SCT", "Subcutaneous route"))); + Codes->insert(OFMake_pair(IntracutaneousRoute, DSRBasicCodedEntry("372464004", "SCT", "Intracutaneous route"))); + Codes->insert(OFMake_pair(IntraperitonealRoute, DSRBasicCodedEntry("38239002", "SCT", "Intraperitoneal route"))); + Codes->insert(OFMake_pair(IntramedullaryRoute, DSRBasicCodedEntry("60213007", "SCT", "Intramedullary route"))); + Codes->insert(OFMake_pair(IntrathecalRoute, DSRBasicCodedEntry("72607000", "SCT", "Intrathecal route"))); + Codes->insert(OFMake_pair(IntraArticularRoute, DSRBasicCodedEntry("12130007", "SCT", "Intra-articular route"))); + Codes->insert(OFMake_pair(IntraepithelialRoute, DSRBasicCodedEntry("C38244", "NCIt", "Intraepithelial route"))); + Codes->insert(OFMake_pair(TopicalRoute, DSRBasicCodedEntry("6064005", "SCT", "Topical route"))); + Codes->insert(OFMake_pair(OralRoute, DSRBasicCodedEntry("26643006", "SCT", "Oral route"))); + Codes->insert(OFMake_pair(TransluminalRoute, DSRBasicCodedEntry("C38306", "NCIt", "Transluminal route"))); + Codes->insert(OFMake_pair(IntraluminalRoute, DSRBasicCodedEntry("37737002", "SCT", "Intraluminal route"))); + Codes->insert(OFMake_pair(ExtraluminalRoute, DSRBasicCodedEntry("C38213", "NCIt", "Extraluminal route"))); + Codes->insert(OFMake_pair(ByInhalation, DSRBasicCodedEntry("446406008", "SCT", "By inhalation"))); + Codes->insert(OFMake_pair(PerRectum, DSRBasicCodedEntry("37161004", "SCT", "Per rectum"))); + Codes->insert(OFMake_pair(VaginalRoute, DSRBasicCodedEntry("16857009", "SCT", "Vaginal route"))); + Codes->insert(OFMake_pair(IntracoronaryRoute, DSRBasicCodedEntry("372463005", "SCT", "Intracoronary route"))); + Codes->insert(OFMake_pair(IntracardiacRoute, DSRBasicCodedEntry("372460008", "SCT", "Intracardiac route"))); + Codes->insert(OFMake_pair(IntraventricularRouteCardiac, DSRBasicCodedEntry("420287000", "SCT", "Intraventricular route - cardiac"))); + Codes->insert(OFMake_pair(RetroOrbitalRoute, DSRBasicCodedEntry("127070", "DCM", "Retro-orbital route"))); + Codes->insert(OFMake_pair(NasalRoute, DSRBasicCodedEntry("46713006", "SCT", "Nasal route"))); + Codes->insert(OFMake_pair(IntradermalRoute, DSRBasicCodedEntry("372464004", "SCT", "Intradermal route"))); + Codes->insert(OFMake_pair(IntratumorRoute, DSRBasicCodedEntry("447122006", "SCT", "Intratumor route"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID11_RouteOfAdministration::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid244.cc b/dcmsr/libcmr/cid244.cc new file mode 100644 index 00000000..5c306897 --- /dev/null +++ b/dcmsr/libcmr/cid244.cc @@ -0,0 +1,165 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID244_Laterality + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:16 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid244.h" + + +// general information on CID 244 (Laterality) +#define CONTEXT_GROUP_NUMBER "244" +#define CONTEXT_GROUP_VERSION "20030108" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.37" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID244_Laterality::CodeList *CID244_Laterality::Codes = NULL; + + +CID244_Laterality::CID244_Laterality(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID244_Laterality::CID244_Laterality(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID244_Laterality::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID244_Laterality::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID244_Laterality::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID244_Laterality::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID244_Laterality::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID244_Laterality::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID244_Laterality::CodeList &CID244_Laterality::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(Right, DSRBasicCodedEntry("24028007", "SCT", "Right"))); + Codes->insert(OFMake_pair(Left, DSRBasicCodedEntry("7771000", "SCT", "Left"))); + Codes->insert(OFMake_pair(Bilateral, DSRBasicCodedEntry("51440002", "SCT", "Bilateral"))); + Codes->insert(OFMake_pair(Unilateral, DSRBasicCodedEntry("66459002", "SCT", "Unilateral"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID244_Laterality::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid244e.cc b/dcmsr/libcmr/cid244e.cc new file mode 100644 index 00000000..9518e4a7 --- /dev/null +++ b/dcmsr/libcmr/cid244e.cc @@ -0,0 +1,86 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID244e_Laterality + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid244e.h" + + +CID244e_Laterality::CID244e_Laterality(const DSRCodedEntryValue &selectedValue) + : CID244_Laterality(selectedValue) +{ +} + + +CID244e_Laterality::CID244e_Laterality(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : CID244_Laterality(selectedValue, enhancedEncodingMode) +{ +} + + +CID244e_Laterality::CID244e_Laterality(const OFString &selectedValue, + const OFBool enhancedEncodingMode) + : CID244_Laterality(mapImageLaterality(selectedValue, enhancedEncodingMode)) +{ +} + + +OFCondition CID244e_Laterality::selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* map enumerated value to coded entry */ + OFCondition result = mapImageLaterality(selectedValue, codedEntry, enhancedEncodingMode); + if (result.good()) + { + /* select but never check the coded entry */ + result = selectValue(codedEntry, OFFalse /*check*/, OFFalse /*definedContextGroup*/); + } + return result; +} + + +// static functions + +DSRCodedEntryValue CID244e_Laterality::mapImageLaterality(const OFString &enumeratedValue, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* call the real function (no need to check the returned status) */ + mapImageLaterality(enumeratedValue, codedEntry, enhancedEncodingMode); + /* return coded entry (by-value) */ + return codedEntry; +} + + +OFCondition CID244e_Laterality::mapImageLaterality(const OFString &enumeratedValue, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode) +{ + OFCondition result = EC_Normal; + /* determine image laterality code from CID 244 */ + if (enumeratedValue == "R") // right + codedEntryValue = getCodedEntry(Right); + else if (enumeratedValue == "L") // left + codedEntryValue = getCodedEntry(Left); + else if (enumeratedValue == "B") // both left and right + codedEntryValue = getCodedEntry(Bilateral); + else if (enumeratedValue == "U") // unpaired + codedEntryValue = getCodedEntry(Unilateral); + else + result = SR_EC_InvalidValue; + /* set enhanced encoding mode (if enabled) */ + if (result.good() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntryValue); + return result; +} diff --git a/dcmsr/libcmr/cid29.cc b/dcmsr/libcmr/cid29.cc new file mode 100644 index 00000000..cada2dd6 --- /dev/null +++ b/dcmsr/libcmr/cid29.cc @@ -0,0 +1,205 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID29_AcquisitionModality + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:11 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid29.h" + + +// general information on CID 29 (Acquisition Modality) +#define CONTEXT_GROUP_NUMBER "29" +#define CONTEXT_GROUP_VERSION "20190327" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.19" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID29_AcquisitionModality::CodeList *CID29_AcquisitionModality::Codes = NULL; + + +CID29_AcquisitionModality::CID29_AcquisitionModality(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID29_AcquisitionModality::CID29_AcquisitionModality(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID29_AcquisitionModality::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID29_AcquisitionModality::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID29_AcquisitionModality::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID29_AcquisitionModality::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID29_AcquisitionModality::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID29_AcquisitionModality::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID29_AcquisitionModality::CodeList &CID29_AcquisitionModality::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(Autorefraction, DSRBasicCodedEntry("AR", "DCM", "Autorefraction"))); + Codes->insert(OFMake_pair(UltrasoundBoneDensitometry, DSRBasicCodedEntry("BDUS", "DCM", "Ultrasound Bone Densitometry"))); + Codes->insert(OFMake_pair(BiomagneticImaging, DSRBasicCodedEntry("BI", "DCM", "Biomagnetic Imaging"))); + Codes->insert(OFMake_pair(BoneMineralDensitometry, DSRBasicCodedEntry("BMD", "DCM", "Bone Mineral Densitometry"))); + Codes->insert(OFMake_pair(ComputedRadiography, DSRBasicCodedEntry("CR", "DCM", "Computed Radiography"))); + Codes->insert(OFMake_pair(ComputedTomography, DSRBasicCodedEntry("CT", "DCM", "Computed Tomography"))); + Codes->insert(OFMake_pair(Diaphanography, DSRBasicCodedEntry("DG", "DCM", "Diaphanography"))); + Codes->insert(OFMake_pair(DigitalRadiography, DSRBasicCodedEntry("DX", "DCM", "Digital Radiography"))); + Codes->insert(OFMake_pair(Electrocardiography, DSRBasicCodedEntry("ECG", "DCM", "Electrocardiography"))); + Codes->insert(OFMake_pair(CardiacElectrophysiology, DSRBasicCodedEntry("EPS", "DCM", "Cardiac Electrophysiology"))); + Codes->insert(OFMake_pair(Endoscopy, DSRBasicCodedEntry("ES", "DCM", "Endoscopy"))); + Codes->insert(OFMake_pair(GeneralMicroscopy, DSRBasicCodedEntry("GM", "DCM", "General Microscopy"))); + Codes->insert(OFMake_pair(HemodynamicWaveform, DSRBasicCodedEntry("HD", "DCM", "Hemodynamic Waveform"))); + Codes->insert(OFMake_pair(IntraOralRadiography, DSRBasicCodedEntry("IO", "DCM", "Intra-oral Radiography"))); + Codes->insert(OFMake_pair(IntravascularOpticalCoherenceTomography, DSRBasicCodedEntry("IVOCT", "DCM", "Intravascular Optical Coherence Tomography"))); + Codes->insert(OFMake_pair(IntravascularUltrasound, DSRBasicCodedEntry("IVUS", "DCM", "Intravascular Ultrasound"))); + Codes->insert(OFMake_pair(Keratometry, DSRBasicCodedEntry("KER", "DCM", "Keratometry"))); + Codes->insert(OFMake_pair(Lensometry, DSRBasicCodedEntry("LEN", "DCM", "Lensometry"))); + Codes->insert(OFMake_pair(LaserScan, DSRBasicCodedEntry("LS", "DCM", "Laser Scan"))); + Codes->insert(OFMake_pair(Mammography, DSRBasicCodedEntry("MG", "DCM", "Mammography"))); + Codes->insert(OFMake_pair(MagneticResonance, DSRBasicCodedEntry("MR", "DCM", "Magnetic Resonance"))); + Codes->insert(OFMake_pair(NuclearMedicine, DSRBasicCodedEntry("NM", "DCM", "Nuclear Medicine"))); + Codes->insert(OFMake_pair(OphthalmicAxialMeasurements, DSRBasicCodedEntry("OAM", "DCM", "Ophthalmic Axial Measurements"))); + Codes->insert(OFMake_pair(OpticalCoherenceTomography, DSRBasicCodedEntry("OCT", "DCM", "Optical Coherence Tomography"))); + Codes->insert(OFMake_pair(OphthalmicPhotography, DSRBasicCodedEntry("OP", "DCM", "Ophthalmic Photography"))); + Codes->insert(OFMake_pair(OphthalmicMapping, DSRBasicCodedEntry("OPM", "DCM", "Ophthalmic Mapping"))); + Codes->insert(OFMake_pair(OphthalmicTomography, DSRBasicCodedEntry("OPT", "DCM", "Ophthalmic Tomography"))); + Codes->insert(OFMake_pair(OphthalmicTomographyBScanVolumeAnalysis, DSRBasicCodedEntry("OPTBSV", "DCM", "Ophthalmic Tomography B-scan Volume Analysis"))); + Codes->insert(OFMake_pair(OphthalmicTomographyEnFace, DSRBasicCodedEntry("OPTENF", "DCM", "Ophthalmic Tomography En Face"))); + Codes->insert(OFMake_pair(OphthalmicVisualField, DSRBasicCodedEntry("OPV", "DCM", "Ophthalmic Visual Field"))); + Codes->insert(OFMake_pair(OpticalSurfaceScanner, DSRBasicCodedEntry("OSS", "DCM", "Optical Surface Scanner"))); + Codes->insert(OFMake_pair(PositronEmissionTomography, DSRBasicCodedEntry("PT", "DCM", "Positron emission tomography"))); + Codes->insert(OFMake_pair(PanoramicXRay, DSRBasicCodedEntry("PX", "DCM", "Panoramic X-Ray"))); + Codes->insert(OFMake_pair(RespiratoryWaveform, DSRBasicCodedEntry("RESP", "DCM", "Respiratory Waveform"))); + Codes->insert(OFMake_pair(Radiofluoroscopy, DSRBasicCodedEntry("RF", "DCM", "Radiofluoroscopy"))); + Codes->insert(OFMake_pair(RadiographicImaging, DSRBasicCodedEntry("RG", "DCM", "Radiographic imaging"))); + Codes->insert(OFMake_pair(RTImage, DSRBasicCodedEntry("RTIMAGE", "DCM", "RT Image"))); + Codes->insert(OFMake_pair(SlideMicroscopy, DSRBasicCodedEntry("SM", "DCM", "Slide Microscopy"))); + Codes->insert(OFMake_pair(SubjectiveRefraction, DSRBasicCodedEntry("SRF", "DCM", "Subjective Refraction"))); + Codes->insert(OFMake_pair(Thermography, DSRBasicCodedEntry("TG", "DCM", "Thermography"))); + Codes->insert(OFMake_pair(Ultrasound, DSRBasicCodedEntry("US", "DCM", "Ultrasound"))); + Codes->insert(OFMake_pair(VisualAcuity, DSRBasicCodedEntry("VA", "DCM", "Visual Acuity"))); + Codes->insert(OFMake_pair(XRayAngiography, DSRBasicCodedEntry("XA", "DCM", "X-Ray Angiography"))); + Codes->insert(OFMake_pair(ExternalCameraPhotography, DSRBasicCodedEntry("XC", "DCM", "External-camera Photography"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID29_AcquisitionModality::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid29e.cc b/dcmsr/libcmr/cid29e.cc new file mode 100644 index 00000000..bcac2a92 --- /dev/null +++ b/dcmsr/libcmr/cid29e.cc @@ -0,0 +1,70 @@ +/* + * + * Copyright (C) 2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID29e_AcquisitionModality + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid29e.h" +#include "dcmtk/dcmsr/codes/dcm.h" + + +CID29e_AcquisitionModality::CID29e_AcquisitionModality(const DSRCodedEntryValue &selectedValue) + : CID29_AcquisitionModality(selectedValue) +{ +} + + +CID29e_AcquisitionModality::CID29e_AcquisitionModality(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : CID29_AcquisitionModality(selectedValue, enhancedEncodingMode) +{ +} + + +OFCondition CID29e_AcquisitionModality::selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* map defined term to coded entry */ + OFCondition result = mapModality(selectedValue, codedEntry, enhancedEncodingMode); + if (result.good()) + { + /* select but never check the coded entry */ + result = selectValue(codedEntry, OFFalse /*check*/, OFFalse /*definedContextGroup*/); + } + return result; +} + + +DSRCodedEntryValue CID29e_AcquisitionModality::mapModality(const OFString &definedTerm, + const OFBool enhancedEncodingMode) const +{ + DSRCodedEntryValue codedEntry; + /* call the real function (no need to check the returned status) */ + mapModality(definedTerm, codedEntry, enhancedEncodingMode); + /* return coded entry (by-value) */ + return codedEntry; +} + + +OFCondition CID29e_AcquisitionModality::mapModality(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = EC_Normal; + /* determine modality code from CID 29 */ + if (findCodedEntry(DSRCodedEntryValue(definedTerm /*codeValue*/, CODE_DCM_CodingSchemeDesignator, "-" /*codeMeaning*/), &codedEntryValue, enhancedEncodingMode).bad()) + result = SR_EC_UnsupportedValue; + /* set enhanced encoding mode (if enabled) */ + else if (enhancedEncodingMode) + setEnhancedEncodingMode(codedEntryValue); + return result; +} diff --git a/dcmsr/libcmr/cid4020.cc b/dcmsr/libcmr/cid4020.cc new file mode 100644 index 00000000..f6df7674 --- /dev/null +++ b/dcmsr/libcmr/cid4020.cc @@ -0,0 +1,197 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID4020_PETRadionuclide + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:18 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid4020.h" + + +// general information on CID 4020 (PET Radionuclide) +#define CONTEXT_GROUP_NUMBER "4020" +#define CONTEXT_GROUP_VERSION "20160119" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.304" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID4020_PETRadionuclide::CodeList *CID4020_PETRadionuclide::Codes = NULL; + + +CID4020_PETRadionuclide::CID4020_PETRadionuclide(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID4020_PETRadionuclide::CID4020_PETRadionuclide(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID4020_PETRadionuclide::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID4020_PETRadionuclide::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID4020_PETRadionuclide::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID4020_PETRadionuclide::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID4020_PETRadionuclide::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID4020_PETRadionuclide::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID4020_PETRadionuclide::CodeList &CID4020_PETRadionuclide::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(_11_Carbon, DSRBasicCodedEntry("40565003", "SCT", "^11^Carbon"))); + Codes->insert(OFMake_pair(_13_Nitrogen, DSRBasicCodedEntry("21576001", "SCT", "^13^Nitrogen"))); + Codes->insert(OFMake_pair(_14_Oxygen, DSRBasicCodedEntry("424875009", "SCT", "^14^Oxygen"))); + Codes->insert(OFMake_pair(_15_Oxygen, DSRBasicCodedEntry("129504001", "SCT", "^15^Oxygen"))); + Codes->insert(OFMake_pair(_18_Fluorine, DSRBasicCodedEntry("77004003", "SCT", "^18^Fluorine"))); + Codes->insert(OFMake_pair(_22_Sodium, DSRBasicCodedEntry("71633006", "SCT", "^22^Sodium"))); + Codes->insert(OFMake_pair(_38_Potassium, DSRBasicCodedEntry("423764008", "SCT", "^38^Potassium"))); + Codes->insert(OFMake_pair(_43_Scandium, DSRBasicCodedEntry("126605", "DCM", "^43^Scandium"))); + Codes->insert(OFMake_pair(_44_Scandium, DSRBasicCodedEntry("126600", "DCM", "^44^Scandium"))); + Codes->insert(OFMake_pair(_45_Titanium, DSRBasicCodedEntry("75696008", "SCT", "^45^Titanium"))); + Codes->insert(OFMake_pair(_51_Manganese, DSRBasicCodedEntry("126601", "DCM", "^51^Manganese"))); + Codes->insert(OFMake_pair(_52_Iron, DSRBasicCodedEntry("69089000", "SCT", "^52^Iron"))); + Codes->insert(OFMake_pair(_52_Manganese, DSRBasicCodedEntry("37225000", "SCT", "^52^Manganese"))); + Codes->insert(OFMake_pair(_52m_Manganese, DSRBasicCodedEntry("126607", "DCM", "^52m^Manganese"))); + Codes->insert(OFMake_pair(_60_Copper, DSRBasicCodedEntry("425364008", "SCT", "^60^Copper"))); + Codes->insert(OFMake_pair(_61_Copper, DSRBasicCodedEntry("71425003", "SCT", "^61^Copper"))); + Codes->insert(OFMake_pair(_62_Copper, DSRBasicCodedEntry("422934004", "SCT", "^62^Copper"))); + Codes->insert(OFMake_pair(_62_Zinc, DSRBasicCodedEntry("65054007", "SCT", "^62^Zinc"))); + Codes->insert(OFMake_pair(_64_Copper, DSRBasicCodedEntry("3932008", "SCT", "^64^Copper"))); + Codes->insert(OFMake_pair(_66_Gallium, DSRBasicCodedEntry("79477007", "SCT", "^66^Gallium"))); + Codes->insert(OFMake_pair(_68_Gallium, DSRBasicCodedEntry("35337001", "SCT", "^68^Gallium"))); + Codes->insert(OFMake_pair(_68_Germanium, DSRBasicCodedEntry("53315004", "SCT", "^68^Germanium"))); + Codes->insert(OFMake_pair(_70_Arsenic, DSRBasicCodedEntry("126602", "DCM", "^70^Arsenic"))); + Codes->insert(OFMake_pair(_72_Arsenic, DSRBasicCodedEntry("2705002", "SCT", "^72^Arsenic"))); + Codes->insert(OFMake_pair(_73_Selenium, DSRBasicCodedEntry("87437000", "SCT", "^73^Selenium"))); + Codes->insert(OFMake_pair(_75_Bromine, DSRBasicCodedEntry("17910003", "SCT", "^75^Bromine"))); + Codes->insert(OFMake_pair(_76_Bromine, DSRBasicCodedEntry("79523006", "SCT", "^76^Bromine"))); + Codes->insert(OFMake_pair(_77_Bromine, DSRBasicCodedEntry("86521004", "SCT", "^77^Bromine"))); + Codes->insert(OFMake_pair(_82_Rubidium, DSRBasicCodedEntry("79197006", "SCT", "^82^Rubidium"))); + Codes->insert(OFMake_pair(_86_Yttrium, DSRBasicCodedEntry("10738001", "SCT", "^86^Yttrium"))); + Codes->insert(OFMake_pair(_89_Zirconium, DSRBasicCodedEntry("63360001", "SCT", "^89^Zirconium"))); + Codes->insert(OFMake_pair(_90_Niobium, DSRBasicCodedEntry("126603", "DCM", "^90^Niobium"))); + Codes->insert(OFMake_pair(_90_Yttrium, DSRBasicCodedEntry("14691008", "SCT", "^90^Yttrium"))); + Codes->insert(OFMake_pair(_94m_Technetium, DSRBasicCodedEntry("424079002", "SCT", "^94m^Technetium"))); + Codes->insert(OFMake_pair(_124_Iodine, DSRBasicCodedEntry("40937006", "SCT", "^124^Iodine"))); + Codes->insert(OFMake_pair(_152_Terbium, DSRBasicCodedEntry("126606", "DCM", "^152^Terbium"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID4020_PETRadionuclide::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid4021.cc b/dcmsr/libcmr/cid4021.cc new file mode 100644 index 00000000..abb3ca13 --- /dev/null +++ b/dcmsr/libcmr/cid4021.cc @@ -0,0 +1,288 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID4021_PETRadiopharmaceutical + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:20 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid4021.h" + + +// general information on CID 4021 (PET Radiopharmaceutical) +#define CONTEXT_GROUP_NUMBER "4021" +#define CONTEXT_GROUP_VERSION "20190124" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.305" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID4021_PETRadiopharmaceutical::CodeList *CID4021_PETRadiopharmaceutical::Codes = NULL; + + +CID4021_PETRadiopharmaceutical::CID4021_PETRadiopharmaceutical(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID4021_PETRadiopharmaceutical::CID4021_PETRadiopharmaceutical(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID4021_PETRadiopharmaceutical::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID4021_PETRadiopharmaceutical::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID4021_PETRadiopharmaceutical::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID4021_PETRadiopharmaceutical::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID4021_PETRadiopharmaceutical::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID4021_PETRadiopharmaceutical::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID4021_PETRadiopharmaceutical::CodeList &CID4021_PETRadiopharmaceutical::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(_28H1_89Zr, DSRBasicCodedEntry("126752", "DCM", "28H1 ^89^Zr"))); + Codes->insert(OFMake_pair(_2FA_F18, DSRBasicCodedEntry("126713", "DCM", "2FA F^18^"))); + Codes->insert(OFMake_pair(_7D12_89Zr, DSRBasicCodedEntry("126751", "DCM", "7D12 ^89^Zr"))); + Codes->insert(OFMake_pair(_7E11_89Zr, DSRBasicCodedEntry("126750", "DCM", "7E11 ^89^Zr"))); + Codes->insert(OFMake_pair(Acetate_C11, DSRBasicCodedEntry("129513004", "SCT", "Acetate C^11^"))); + Codes->insert(OFMake_pair(AGN150998_89Zr, DSRBasicCodedEntry("126729", "DCM", "AGN-150998 ^89^Zr"))); + Codes->insert(OFMake_pair(Ammonia_N13, DSRBasicCodedEntry("129508003", "SCT", "Ammonia N^13^"))); + Codes->insert(OFMake_pair(AntiB220_89Zr, DSRBasicCodedEntry("126754", "DCM", "Anti-B220 ^89^Zr"))); + Codes->insert(OFMake_pair(ATSM_Cu60, DSRBasicCodedEntry("126700", "DCM", "ATSM Cu^60^"))); + Codes->insert(OFMake_pair(ATSM_Cu61, DSRBasicCodedEntry("126701", "DCM", "ATSM Cu^61^"))); + Codes->insert(OFMake_pair(ATSM_Cu62, DSRBasicCodedEntry("126702", "DCM", "ATSM Cu^62^"))); + Codes->insert(OFMake_pair(ATSM_Cu64, DSRBasicCodedEntry("422855001", "SCT", "ATSM Cu^64^"))); + Codes->insert(OFMake_pair(Benralizumab_89Zr, DSRBasicCodedEntry("126722", "DCM", "Benralizumab ^89^Zr"))); + Codes->insert(OFMake_pair(Bevacizumab_89Zr, DSRBasicCodedEntry("126516", "DCM", "Bevacizumab ^89^Zr"))); + Codes->insert(OFMake_pair(Blinatumomab_89Zr, DSRBasicCodedEntry("126727", "DCM", "Blinatumomab ^89^Zr"))); + Codes->insert(OFMake_pair(Brentuximab_89Zr, DSRBasicCodedEntry("126735", "DCM", "Brentuximab ^89^Zr"))); + Codes->insert(OFMake_pair(Butanol_O15, DSRBasicCodedEntry("422540000", "SCT", "Butanol O^15^"))); + Codes->insert(OFMake_pair(CarbonDioxide_O15, DSRBasicCodedEntry("129507008", "SCT", "Carbon dioxide O^15^"))); + Codes->insert(OFMake_pair(CarbonMonoxide_C11, DSRBasicCodedEntry("129515006", "SCT", "Carbon monoxide C^11^"))); + Codes->insert(OFMake_pair(CarbonMonoxide_O15, DSRBasicCodedEntry("129506004", "SCT", "Carbon monoxide O^15^"))); + Codes->insert(OFMake_pair(Carfentanil_C11, DSRBasicCodedEntry("129511002", "SCT", "Carfentanil C^11^"))); + Codes->insert(OFMake_pair(Cetuximab_89Zr, DSRBasicCodedEntry("126513", "DCM", "Cetuximab ^89^Zr"))); + Codes->insert(OFMake_pair(CG250Fab2_89Zr, DSRBasicCodedEntry("126517", "DCM", "cG250-F(ab')(2) ^89^Zr"))); + Codes->insert(OFMake_pair(Choline_C11, DSRBasicCodedEntry("126703", "DCM", "Choline C^11^"))); + Codes->insert(OFMake_pair(CLR1404_I124, DSRBasicCodedEntry("126715", "DCM", "CLR1404 I^124^"))); + Codes->insert(OFMake_pair(CLR1404_I131, DSRBasicCodedEntry("126716", "DCM", "CLR1404 I^131^"))); + Codes->insert(OFMake_pair(CMAbU36_89Zr, DSRBasicCodedEntry("126746", "DCM", "cMAb U36 ^89^Zr"))); + Codes->insert(OFMake_pair(CU36_89Zr, DSRBasicCodedEntry("126515", "DCM", "cU36 ^89^Zr"))); + Codes->insert(OFMake_pair(DCFBC_F18, DSRBasicCodedEntry("C96234", "NCIt", "DCFBC F^18^"))); + Codes->insert(OFMake_pair(DCFPyL_F18, DSRBasicCodedEntry("C116352", "NCIt", "DCFPyL F^18^"))); + Codes->insert(OFMake_pair(DfFK2_89Zr, DSRBasicCodedEntry("126762", "DCM", "Df-[FK](2) ^89^Zr"))); + Codes->insert(OFMake_pair(DfFK23PEG4_89Zr, DSRBasicCodedEntry("126763", "DCM", "Df-[FK](2)-3PEG(4) ^89^Zr"))); + Codes->insert(OFMake_pair(DfCD45_89Zr, DSRBasicCodedEntry("126520", "DCM", "Df-CD45 ^89^Zr"))); + Codes->insert(OFMake_pair(DfFK_89Zr, DSRBasicCodedEntry("126760", "DCM", "Df-FK ^89^Zr"))); + Codes->insert(OFMake_pair(DfFKPEG3_89Zr, DSRBasicCodedEntry("126761", "DCM", "Df-FK-PEG(3) ^89^Zr"))); + Codes->insert(OFMake_pair(DN30_89Zr, DSRBasicCodedEntry("126747", "DCM", "DN30 ^89^Zr"))); + Codes->insert(OFMake_pair(E4G10_89Zr, DSRBasicCodedEntry("126519", "DCM", "E4G10 ^89^Zr"))); + Codes->insert(OFMake_pair(Ecromeximab_89Zr, DSRBasicCodedEntry("126732", "DCM", "Ecromeximab ^89^Zr"))); + Codes->insert(OFMake_pair(Edotreotide_Ga68, DSRBasicCodedEntry("C2713594", "UMLS", "Edotreotide Ga^68^"))); + Codes->insert(OFMake_pair(EDTA_Ga68, DSRBasicCodedEntry("423498000", "SCT", "EDTA Ga^68^"))); + Codes->insert(OFMake_pair(Fallypride_C11, DSRBasicCodedEntry("126704", "DCM", "Fallypride C^11^"))); + Codes->insert(OFMake_pair(Fallypride_F18, DSRBasicCodedEntry("126705", "DCM", "Fallypride F^18^"))); + Codes->insert(OFMake_pair(FLB457_C11, DSRBasicCodedEntry("126706", "DCM", "FLB 457 C^11^"))); + Codes->insert(OFMake_pair(Florbetaben_F18, DSRBasicCodedEntry("712736002", "SCT", "Florbetaben F^18^"))); + Codes->insert(OFMake_pair(Florbetapir_F18, DSRBasicCodedEntry("456995000", "SCT", "Florbetapir F^18^"))); + Codes->insert(OFMake_pair(Flortaucipir_F18, DSRBasicCodedEntry("C4547429", "UMLS", "Flortaucipir F^18^"))); + Codes->insert(OFMake_pair(Flubatine_F18, DSRBasicCodedEntry("126503", "DCM", "Flubatine F^18^"))); + Codes->insert(OFMake_pair(Fluciclatide_F18, DSRBasicCodedEntry("456999006", "SCT", "Fluciclatide F^18^"))); + Codes->insert(OFMake_pair(Fluciclovine_F18, DSRBasicCodedEntry("457000009", "SCT", "Fluciclovine F^18^"))); + Codes->insert(OFMake_pair(Flumazenil_C11, DSRBasicCodedEntry("423543007", "SCT", "Flumazenil C^11^"))); + Codes->insert(OFMake_pair(Flumazenil_F18, DSRBasicCodedEntry("422975006", "SCT", "Flumazenil F^18^"))); + Codes->insert(OFMake_pair(Fluorethyltyrosin_F18, DSRBasicCodedEntry("424708001", "SCT", "Fluorethyltyrosin F^18^"))); + Codes->insert(OFMake_pair(Fluorobenzothiazole_F18, DSRBasicCodedEntry("423546004", "SCT", "Fluorobenzothiazole F^18^"))); + Codes->insert(OFMake_pair(Fluorocholine_F18, DSRBasicCodedEntry("456992002", "SCT", "Fluorocholine F^18^"))); + Codes->insert(OFMake_pair(Fluorodeoxyglucose_F18, DSRBasicCodedEntry("35321007", "SCT", "Fluorodeoxyglucose F^18^"))); + Codes->insert(OFMake_pair(FluoroestradiolFES_F18, DSRBasicCodedEntry("C1831937", "UMLS", "Fluoroestradiol (FES) F^18^"))); + Codes->insert(OFMake_pair(Fluoroetanidazole_F18, DSRBasicCodedEntry("C1541539", "UMLS", "Fluoroetanidazole F^18^"))); + Codes->insert(OFMake_pair(FluoroLDopa_F18, DSRBasicCodedEntry("129500005", "SCT", "Fluoro-L-dopa F^18^"))); + Codes->insert(OFMake_pair(Fluoromethane_F18, DSRBasicCodedEntry("422763008", "SCT", "Fluoromethane F^18^"))); + Codes->insert(OFMake_pair(Fluoromisonidazole_F18, DSRBasicCodedEntry("422598008", "SCT", "Fluoromisonidazole F^18^"))); + Codes->insert(OFMake_pair(FluoropropylDihydrotetrabenazineDTBZ_F18, DSRBasicCodedEntry("C2934038", "UMLS", "Fluoropropyl-dihydrotetrabenazine (DTBZ) F^18^"))); + Codes->insert(OFMake_pair(Fluorotriopride_F18, DSRBasicCodedEntry("126707", "DCM", "Fluorotriopride F^18^"))); + Codes->insert(OFMake_pair(Fluorouracil_F18, DSRBasicCodedEntry("425236000", "SCT", "Fluorouracil F^18^"))); + Codes->insert(OFMake_pair(Flurpiridaz_F18, DSRBasicCodedEntry("126718", "DCM", "Flurpiridaz F^18^"))); + Codes->insert(OFMake_pair(Flutemetamol_F18, DSRBasicCodedEntry("456997008", "SCT", "Flutemetamol F^18^"))); + Codes->insert(OFMake_pair(Fresolimumab_89Zr, DSRBasicCodedEntry("126748", "DCM", "Fresolimumab ^89^Zr"))); + Codes->insert(OFMake_pair(GA201_89Zr, DSRBasicCodedEntry("126731", "DCM", "GA201 ^89^Zr"))); + Codes->insert(OFMake_pair(Germanium_Ge68, DSRBasicCodedEntry("129516007", "SCT", "Germanium Ge^68^"))); + Codes->insert(OFMake_pair(GlembatumumabVedotin_89Zr, DSRBasicCodedEntry("126724", "DCM", "Glembatumumab vedotin ^89^Zr"))); + Codes->insert(OFMake_pair(Glutamate_N13, DSRBasicCodedEntry("129509006", "SCT", "Glutamate N^13^"))); + Codes->insert(OFMake_pair(Glutamine_C11, DSRBasicCodedEntry("126709", "DCM", "Glutamine C^11^"))); + Codes->insert(OFMake_pair(Glutamine_C14, DSRBasicCodedEntry("126710", "DCM", "Glutamine C^14^"))); + Codes->insert(OFMake_pair(Glutamine_F18, DSRBasicCodedEntry("126711", "DCM", "Glutamine F^18^"))); + Codes->insert(OFMake_pair(ISO1_F18, DSRBasicCodedEntry("C2981788", "UMLS", "ISO-1 F^18^"))); + Codes->insert(OFMake_pair(J591_89Zr, DSRBasicCodedEntry("126514", "DCM", "J591 ^89^Zr"))); + Codes->insert(OFMake_pair(Margetuximab_89Zr, DSRBasicCodedEntry("126740", "DCM", "Margetuximab ^89^Zr"))); + Codes->insert(OFMake_pair(MEDI551_89Zr, DSRBasicCodedEntry("126730", "DCM", "MEDI-551 ^89^Zr"))); + Codes->insert(OFMake_pair(Mespiperone_C11, DSRBasicCodedEntry("424789007", "SCT", "Mespiperone C^11^"))); + Codes->insert(OFMake_pair(Methionine_C11, DSRBasicCodedEntry("129510001", "SCT", "Methionine C^11^"))); + Codes->insert(OFMake_pair(MK6240_F18, DSRBasicCodedEntry("C4506764", "UMLS", "MK-6240 F^18^"))); + Codes->insert(OFMake_pair(Mogamulizumab_89Zr, DSRBasicCodedEntry("126738", "DCM", "Mogamulizumab ^89^Zr"))); + Codes->insert(OFMake_pair(MonoclonalAntibodymAb_64Cu, DSRBasicCodedEntry("126510", "DCM", "Monoclonal Antibody (mAb) ^64^Cu"))); + Codes->insert(OFMake_pair(MonoclonalAntibodymAb_89Zr, DSRBasicCodedEntry("126511", "DCM", "Monoclonal Antibody (mAb) ^89^Zr"))); + Codes->insert(OFMake_pair(MonoclonalAntibody_I124, DSRBasicCodedEntry("424874008", "SCT", "Monoclonal antibody I^124^"))); + Codes->insert(OFMake_pair(NanocolloidalAlbumin_89Zr, DSRBasicCodedEntry("126753", "DCM", "Nanocolloidal albumin ^89^Zr"))); + Codes->insert(OFMake_pair(Nifene_F18, DSRBasicCodedEntry("126714", "DCM", "Nifene F^18^"))); + Codes->insert(OFMake_pair(Obinituzimab_89Zr, DSRBasicCodedEntry("126721", "DCM", "Obinituzimab ^89^Zr"))); + Codes->insert(OFMake_pair(Ocaratuzumab_89Zr, DSRBasicCodedEntry("126723", "DCM", "Ocaratuzumab ^89^Zr"))); + Codes->insert(OFMake_pair(Oxygen_O15, DSRBasicCodedEntry("129504001", "SCT", "Oxygen O^15^"))); + Codes->insert(OFMake_pair(OxygenWater_O15, DSRBasicCodedEntry("129505000", "SCT", "Oxygen-water O^15^"))); + Codes->insert(OFMake_pair(Palmitate_C11, DSRBasicCodedEntry("129514005", "SCT", "Palmitate C^11^"))); + Codes->insert(OFMake_pair(Panitumumab_89Zr, DSRBasicCodedEntry("126736", "DCM", "Panitumumab ^89^Zr"))); + Codes->insert(OFMake_pair(Pegdinetanib_89Zr, DSRBasicCodedEntry("126728", "DCM", "Pegdinetanib ^89^Zr"))); + Codes->insert(OFMake_pair(PinatuzumabVedotin_89Zr, DSRBasicCodedEntry("126725", "DCM", "Pinatuzumab vedotin ^89^Zr"))); + Codes->insert(OFMake_pair(PittsburghCompoundB_C11, DSRBasicCodedEntry("126500", "DCM", "Pittsburgh compound B C^11^"))); + Codes->insert(OFMake_pair(PolatuzumabVedotin_89Zr, DSRBasicCodedEntry("126726", "DCM", "Polatuzumab vedotin ^89^Zr"))); + Codes->insert(OFMake_pair(PSMA1007_F18, DSRBasicCodedEntry("126758", "DCM", "PSMA-1007 F^18^"))); + Codes->insert(OFMake_pair(PSMA11_Ga68, DSRBasicCodedEntry("C118961", "NCIt", "PSMA-11 Ga^68^"))); + Codes->insert(OFMake_pair(PSMA617_Ga68, DSRBasicCodedEntry("126759", "DCM", "PSMA-617 Ga^68^"))); + Codes->insert(OFMake_pair(PTSM_Cu62, DSRBasicCodedEntry("422789008", "SCT", "PTSM Cu^62^"))); + Codes->insert(OFMake_pair(R1507_89Zr, DSRBasicCodedEntry("126518", "DCM", "R1507 ^89^Zr"))); + Codes->insert(OFMake_pair(Raclopride_C11, DSRBasicCodedEntry("129512009", "SCT", "Raclopride C^11^"))); + Codes->insert(OFMake_pair(Ranibizumab_89Zr, DSRBasicCodedEntry("126742", "DCM", "Ranibizumab ^89^Zr"))); + Codes->insert(OFMake_pair(Rituximab_89Zr, DSRBasicCodedEntry("126737", "DCM", "Rituximab ^89^Zr"))); + Codes->insert(OFMake_pair(RO5323441_89Zr, DSRBasicCodedEntry("126755", "DCM", "RO5323441 ^89^Zr"))); + Codes->insert(OFMake_pair(RO542908_89Zr, DSRBasicCodedEntry("126756", "DCM", "RO542908 ^89^Zr"))); + Codes->insert(OFMake_pair(RO6924963_11C, DSRBasicCodedEntry("126719", "DCM", "RO6924963 ^11^C"))); + Codes->insert(OFMake_pair(RO6931643_11C, DSRBasicCodedEntry("126720", "DCM", "RO6931643 ^11^C"))); + Codes->insert(OFMake_pair(RO6958948_18F, DSRBasicCodedEntry("126757", "DCM", "RO6958948 ^18^F"))); + Codes->insert(OFMake_pair(Roledumab_89Zr, DSRBasicCodedEntry("126733", "DCM", "Roledumab ^89^Zr"))); + Codes->insert(OFMake_pair(RubidiumChloride_Rb82, DSRBasicCodedEntry("129503007", "SCT", "Rubidium chloride Rb^82^"))); + Codes->insert(OFMake_pair(SAR3419_89Zr, DSRBasicCodedEntry("126741", "DCM", "SAR3419 ^89^Zr"))); + Codes->insert(OFMake_pair(Sarcosine_C11, DSRBasicCodedEntry("C122684", "NCIt", "Sarcosine C^11^"))); + Codes->insert(OFMake_pair(SodiumFluoride_F18, DSRBasicCodedEntry("129501009", "SCT", "Sodium fluoride F^18^"))); + Codes->insert(OFMake_pair(SodiumIodide_I124, DSRBasicCodedEntry("422980002", "SCT", "Sodium iodide I^124^"))); + Codes->insert(OFMake_pair(Sodium_Na22, DSRBasicCodedEntry("129517003", "SCT", "Sodium Na^22^"))); + Codes->insert(OFMake_pair(Spiperone_F18, DSRBasicCodedEntry("129499001", "SCT", "Spiperone F^18^"))); + Codes->insert(OFMake_pair(T807_F18, DSRBasicCodedEntry("126502", "DCM", "T807 F^18^"))); + Codes->insert(OFMake_pair(THK5317_F18, DSRBasicCodedEntry("C4550127", "UMLS", "THK5317 F^18^"))); + Codes->insert(OFMake_pair(THK5351_F18, DSRBasicCodedEntry("C4279748", "UMLS", "THK5351 F^18^"))); + Codes->insert(OFMake_pair(ThymidineFLT_F18, DSRBasicCodedEntry("129502002", "SCT", "Thymidine (FLT) F^18^"))); + Codes->insert(OFMake_pair(Trastuzumab_89Zr, DSRBasicCodedEntry("126512", "DCM", "Trastuzumab ^89^Zr"))); + Codes->insert(OFMake_pair(TRC105_89Zr, DSRBasicCodedEntry("126749", "DCM", "TRC105 ^89^Zr"))); + Codes->insert(OFMake_pair(Tyrosine3Octreotate_Ga68, DSRBasicCodedEntry("C1742831", "UMLS", "tyrosine-3-octreotate Ga^68^"))); + Codes->insert(OFMake_pair(Ublituximab_89Zr, DSRBasicCodedEntry("126739", "DCM", "Ublituximab ^89^Zr"))); + Codes->insert(OFMake_pair(UCBJ_C11, DSRBasicCodedEntry("C4506788", "UMLS", "UCB-J C^11^"))); + Codes->insert(OFMake_pair(XmAb5574_89Zr, DSRBasicCodedEntry("126734", "DCM", "XmAb5574 ^89^Zr"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID4021_PETRadiopharmaceutical::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid4031.cc b/dcmsr/libcmr/cid4031.cc new file mode 100644 index 00000000..f54c759c --- /dev/null +++ b/dcmsr/libcmr/cid4031.cc @@ -0,0 +1,268 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID4031_CommonAnatomicRegions + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:22 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid4031.h" + + +// general information on CID 4031 (Common Anatomic Regions) +#define CONTEXT_GROUP_NUMBER "4031" +#define CONTEXT_GROUP_VERSION "20170914" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.308" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID4031_CommonAnatomicRegions::CodeList *CID4031_CommonAnatomicRegions::Codes = NULL; + + +CID4031_CommonAnatomicRegions::CID4031_CommonAnatomicRegions(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID4031_CommonAnatomicRegions::CID4031_CommonAnatomicRegions(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID4031_CommonAnatomicRegions::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID4031_CommonAnatomicRegions::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID4031_CommonAnatomicRegions::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID4031_CommonAnatomicRegions::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID4031_CommonAnatomicRegions::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID4031_CommonAnatomicRegions::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID4031_CommonAnatomicRegions::CodeList &CID4031_CommonAnatomicRegions::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(Abdomen, DSRBasicCodedEntry("113345001", "SCT", "Abdomen"))); + Codes->insert(OFMake_pair(AbdomenAndPelvis, DSRBasicCodedEntry("416949008", "SCT", "Abdomen and Pelvis"))); + Codes->insert(OFMake_pair(AcromioclavicularJoint, DSRBasicCodedEntry("85856004", "SCT", "Acromioclavicular joint"))); + Codes->insert(OFMake_pair(AnkleJoint, DSRBasicCodedEntry("70258002", "SCT", "Ankle joint"))); + Codes->insert(OFMake_pair(Anus, DSRBasicCodedEntry("53505006", "SCT", "Anus"))); + Codes->insert(OFMake_pair(ApexOfLung, DSRBasicCodedEntry("86598002", "SCT", "Apex of Lung"))); + Codes->insert(OFMake_pair(BileDuct, DSRBasicCodedEntry("28273000", "SCT", "Bile duct"))); + Codes->insert(OFMake_pair(Bladder, DSRBasicCodedEntry("89837001", "SCT", "Bladder"))); + Codes->insert(OFMake_pair(BoneOfLowerLimb, DSRBasicCodedEntry("72001000", "SCT", "Bone of lower limb"))); + Codes->insert(OFMake_pair(BoneOfUpperLimb, DSRBasicCodedEntry("371195002", "SCT", "Bone of upper limb"))); + Codes->insert(OFMake_pair(Breast, DSRBasicCodedEntry("76752008", "SCT", "Breast"))); + Codes->insert(OFMake_pair(Bronchus, DSRBasicCodedEntry("955009", "SCT", "Bronchus"))); + Codes->insert(OFMake_pair(Calcaneus, DSRBasicCodedEntry("80144004", "SCT", "Calcaneus"))); + Codes->insert(OFMake_pair(CervicalSpine, DSRBasicCodedEntry("122494005", "SCT", "Cervical spine"))); + Codes->insert(OFMake_pair(CervicoThoracicSpine, DSRBasicCodedEntry("297171002", "SCT", "Cervico-thoracic spine"))); + Codes->insert(OFMake_pair(Chest, DSRBasicCodedEntry("51185008", "SCT", "Chest"))); + Codes->insert(OFMake_pair(ChestAndAbdomen, DSRBasicCodedEntry("416550000", "SCT", "Chest and Abdomen"))); + Codes->insert(OFMake_pair(ChestAbdomenAndPelvis, DSRBasicCodedEntry("416775004", "SCT", "Chest, Abdomen and Pelvis"))); + Codes->insert(OFMake_pair(Clavicle, DSRBasicCodedEntry("51299004", "SCT", "Clavicle"))); + Codes->insert(OFMake_pair(Coccyx, DSRBasicCodedEntry("64688005", "SCT", "Coccyx"))); + Codes->insert(OFMake_pair(Colon, DSRBasicCodedEntry("71854001", "SCT", "Colon"))); + Codes->insert(OFMake_pair(Duodenum, DSRBasicCodedEntry("38848004", "SCT", "Duodenum"))); + Codes->insert(OFMake_pair(ElbowJoint, DSRBasicCodedEntry("16953009", "SCT", "Elbow joint"))); + Codes->insert(OFMake_pair(EntireBody, DSRBasicCodedEntry("38266002", "SCT", "Entire body"))); + Codes->insert(OFMake_pair(Esophagus, DSRBasicCodedEntry("32849002", "SCT", "Esophagus"))); + Codes->insert(OFMake_pair(EsophagusStomachAndDuodenum, DSRBasicCodedEntry("110861005", "SCT", "Esophagus, stomach and duodenum"))); + Codes->insert(OFMake_pair(Extremity, DSRBasicCodedEntry("66019005", "SCT", "Extremity"))); + Codes->insert(OFMake_pair(Eye, DSRBasicCodedEntry("81745001", "SCT", "Eye"))); + Codes->insert(OFMake_pair(EyeRegion, DSRBasicCodedEntry("371398005", "SCT", "Eye region"))); + Codes->insert(OFMake_pair(FacialBones, DSRBasicCodedEntry("91397008", "SCT", "Facial bones"))); + Codes->insert(OFMake_pair(Femur, DSRBasicCodedEntry("71341001", "SCT", "Femur"))); + Codes->insert(OFMake_pair(Fibula, DSRBasicCodedEntry("87342007", "SCT", "Fibula"))); + Codes->insert(OFMake_pair(Finger, DSRBasicCodedEntry("7569003", "SCT", "Finger"))); + Codes->insert(OFMake_pair(Foot, DSRBasicCodedEntry("56459004", "SCT", "Foot"))); + Codes->insert(OFMake_pair(Forearm, DSRBasicCodedEntry("14975008", "SCT", "Forearm"))); + Codes->insert(OFMake_pair(Gallbladder, DSRBasicCodedEntry("28231008", "SCT", "Gallbladder"))); + Codes->insert(OFMake_pair(Hand, DSRBasicCodedEntry("85562004", "SCT", "Hand"))); + Codes->insert(OFMake_pair(Head, DSRBasicCodedEntry("69536005", "SCT", "Head"))); + Codes->insert(OFMake_pair(HeadAndNeck, DSRBasicCodedEntry("774007", "SCT", "Head and Neck"))); + Codes->insert(OFMake_pair(Heart, DSRBasicCodedEntry("80891009", "SCT", "Heart"))); + Codes->insert(OFMake_pair(HipJoint, DSRBasicCodedEntry("29836001", "SCT", "Hip joint"))); + Codes->insert(OFMake_pair(Humerus, DSRBasicCodedEntry("85050009", "SCT", "Humerus"))); + Codes->insert(OFMake_pair(Ileum, DSRBasicCodedEntry("34516001", "SCT", "Ileum"))); + Codes->insert(OFMake_pair(Ilium, DSRBasicCodedEntry("22356005", "SCT", "Ilium"))); + Codes->insert(OFMake_pair(InternalAuditoryCanal, DSRBasicCodedEntry("361078006", "SCT", "Internal Auditory Canal"))); + Codes->insert(OFMake_pair(JawRegion, DSRBasicCodedEntry("661005", "SCT", "Jaw region"))); + Codes->insert(OFMake_pair(Jejunum, DSRBasicCodedEntry("21306003", "SCT", "Jejunum"))); + Codes->insert(OFMake_pair(Knee, DSRBasicCodedEntry("72696002", "SCT", "Knee"))); + Codes->insert(OFMake_pair(LargeIntestine, DSRBasicCodedEntry("14742008", "SCT", "Large intestine"))); + Codes->insert(OFMake_pair(Larynx, DSRBasicCodedEntry("4596009", "SCT", "Larynx"))); + Codes->insert(OFMake_pair(LowerLeg, DSRBasicCodedEntry("30021000", "SCT", "Lower leg"))); + Codes->insert(OFMake_pair(LowerLimb, DSRBasicCodedEntry("61685007", "SCT", "Lower limb"))); + Codes->insert(OFMake_pair(LumbarSpine, DSRBasicCodedEntry("122496007", "SCT", "Lumbar spine"))); + Codes->insert(OFMake_pair(LumboSacralSpine, DSRBasicCodedEntry("297173004", "SCT", "Lumbo-sacral spine"))); + Codes->insert(OFMake_pair(Mandible, DSRBasicCodedEntry("91609006", "SCT", "Mandible"))); + Codes->insert(OFMake_pair(MastoidBone, DSRBasicCodedEntry("59066005", "SCT", "Mastoid bone"))); + Codes->insert(OFMake_pair(Maxilla, DSRBasicCodedEntry("70925003", "SCT", "Maxilla"))); + Codes->insert(OFMake_pair(Mediastinum, DSRBasicCodedEntry("72410000", "SCT", "Mediastinum"))); + Codes->insert(OFMake_pair(MuscleOfLowerLimb, DSRBasicCodedEntry("102292000", "SCT", "Muscle of lower limb"))); + Codes->insert(OFMake_pair(MuscleOfUpperLimb, DSRBasicCodedEntry("30608006", "SCT", "Muscle of upper limb"))); + Codes->insert(OFMake_pair(NasalBone, DSRBasicCodedEntry("74386004", "SCT", "Nasal bone"))); + Codes->insert(OFMake_pair(Neck, DSRBasicCodedEntry("45048000", "SCT", "Neck"))); + Codes->insert(OFMake_pair(NeckAndChest, DSRBasicCodedEntry("417437006", "SCT", "Neck and Chest"))); + Codes->insert(OFMake_pair(NeckChestAndAbdomen, DSRBasicCodedEntry("416152001", "SCT", "Neck, Chest and Abdomen"))); + Codes->insert(OFMake_pair(NeckChestAbdomenAndPelvis, DSRBasicCodedEntry("416319003", "SCT", "Neck, Chest, Abdomen and Pelvis"))); + Codes->insert(OFMake_pair(OpticCanal, DSRBasicCodedEntry("55024004", "SCT", "Optic canal"))); + Codes->insert(OFMake_pair(OrbitalStructure, DSRBasicCodedEntry("363654007", "SCT", "Orbital structure"))); + Codes->insert(OFMake_pair(PancreaticDuctAndBileDuctSystems, DSRBasicCodedEntry("110621006", "SCT", "Pancreatic duct and bile duct systems"))); + Codes->insert(OFMake_pair(ParanasalSinus, DSRBasicCodedEntry("2095001", "SCT", "Paranasal sinus"))); + Codes->insert(OFMake_pair(ParotidGland, DSRBasicCodedEntry("45289007", "SCT", "Parotid gland"))); + Codes->insert(OFMake_pair(Patella, DSRBasicCodedEntry("64234005", "SCT", "Patella"))); + Codes->insert(OFMake_pair(Pelvis, DSRBasicCodedEntry("12921003", "SCT", "Pelvis"))); + Codes->insert(OFMake_pair(PelvisAndLowerExtremities, DSRBasicCodedEntry("416631005", "SCT", "Pelvis and lower extremities"))); + Codes->insert(OFMake_pair(Phantom, DSRBasicCodedEntry("113681", "DCM", "Phantom"))); + Codes->insert(OFMake_pair(Prostate, DSRBasicCodedEntry("41216001", "SCT", "Prostate"))); + Codes->insert(OFMake_pair(Rectum, DSRBasicCodedEntry("34402009", "SCT", "Rectum"))); + Codes->insert(OFMake_pair(Rib, DSRBasicCodedEntry("113197003", "SCT", "Rib"))); + Codes->insert(OFMake_pair(SacroiliacJoint, DSRBasicCodedEntry("39723000", "SCT", "Sacroiliac joint"))); + Codes->insert(OFMake_pair(Sacrum, DSRBasicCodedEntry("54735007", "SCT", "Sacrum"))); + Codes->insert(OFMake_pair(Scapula, DSRBasicCodedEntry("79601000", "SCT", "Scapula"))); + Codes->insert(OFMake_pair(SellaTurcica, DSRBasicCodedEntry("42575006", "SCT", "Sella turcica"))); + Codes->insert(OFMake_pair(SesamoidBonesOfFoot, DSRBasicCodedEntry("58742003", "SCT", "Sesamoid bones of foot"))); + Codes->insert(OFMake_pair(Shoulder, DSRBasicCodedEntry("16982005", "SCT", "Shoulder"))); + Codes->insert(OFMake_pair(Skull, DSRBasicCodedEntry("89546000", "SCT", "Skull"))); + Codes->insert(OFMake_pair(SmallIntestine, DSRBasicCodedEntry("30315005", "SCT", "Small intestine"))); + Codes->insert(OFMake_pair(Spine, DSRBasicCodedEntry("421060004", "SCT", "Spine"))); + Codes->insert(OFMake_pair(SternoclavicularJoint, DSRBasicCodedEntry("7844006", "SCT", "Sternoclavicular joint"))); + Codes->insert(OFMake_pair(Sternum, DSRBasicCodedEntry("56873002", "SCT", "Sternum"))); + Codes->insert(OFMake_pair(Stomach, DSRBasicCodedEntry("69695003", "SCT", "Stomach"))); + Codes->insert(OFMake_pair(SubmandibularGland, DSRBasicCodedEntry("54019009", "SCT", "Submandibular gland"))); + Codes->insert(OFMake_pair(TarsalJoint, DSRBasicCodedEntry("27949001", "SCT", "Tarsal joint"))); + Codes->insert(OFMake_pair(TemporomandibularJoint, DSRBasicCodedEntry("53620006", "SCT", "Temporomandibular joint"))); + Codes->insert(OFMake_pair(Thigh, DSRBasicCodedEntry("68367000", "SCT", "Thigh"))); + Codes->insert(OFMake_pair(ThoracicSpine, DSRBasicCodedEntry("122495006", "SCT", "Thoracic spine"))); + Codes->insert(OFMake_pair(ThoracoLumbarSpine, DSRBasicCodedEntry("297172009", "SCT", "Thoraco-lumbar spine"))); + Codes->insert(OFMake_pair(Thumb, DSRBasicCodedEntry("76505004", "SCT", "Thumb"))); + Codes->insert(OFMake_pair(Toe, DSRBasicCodedEntry("29707007", "SCT", "Toe"))); + Codes->insert(OFMake_pair(Trachea, DSRBasicCodedEntry("44567001", "SCT", "Trachea"))); + Codes->insert(OFMake_pair(UpperArm, DSRBasicCodedEntry("40983000", "SCT", "Upper arm"))); + Codes->insert(OFMake_pair(UpperLimb, DSRBasicCodedEntry("53120007", "SCT", "Upper limb"))); + Codes->insert(OFMake_pair(UpperUrinaryTract, DSRBasicCodedEntry("431491007", "SCT", "Upper urinary tract"))); + Codes->insert(OFMake_pair(Ureter, DSRBasicCodedEntry("87953007", "SCT", "Ureter"))); + Codes->insert(OFMake_pair(Urethra, DSRBasicCodedEntry("13648007", "SCT", "Urethra"))); + Codes->insert(OFMake_pair(UterusAndFallopianTubes, DSRBasicCodedEntry("110639002", "SCT", "Uterus and fallopian tubes"))); + Codes->insert(OFMake_pair(VertebralColumnAndCranium, DSRBasicCodedEntry("110517009", "SCT", "Vertebral column and cranium"))); + Codes->insert(OFMake_pair(WristJoint, DSRBasicCodedEntry("74670003", "SCT", "Wrist joint"))); + Codes->insert(OFMake_pair(Zygoma, DSRBasicCodedEntry("13881006", "SCT", "Zygoma"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID4031_CommonAnatomicRegions::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid4031e.cc b/dcmsr/libcmr/cid4031e.cc new file mode 100644 index 00000000..6896f7f1 --- /dev/null +++ b/dcmsr/libcmr/cid4031e.cc @@ -0,0 +1,202 @@ +/* + * + * Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID4031e_CommonAnatomicRegions + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid4031e.h" + + +/*---------------------* + * type declarations * + *---------------------*/ + +struct DefinedTermTypeMapStruct +{ + const char *DefinedTerm; + CID4031_CommonAnatomicRegions::EnumType Type; +}; + + +/*------------------------* + * constant definitions * + *------------------------*/ + +// mapping extracted from DICOM PS 3.16-2018a Table L-1 + +static const DefinedTermTypeMapStruct DefinedTermTypeMap[] = +{ + {"ABDOMEN", CID4031_CommonAnatomicRegions::Abdomen}, + {"ABDOMENPELVIS", CID4031_CommonAnatomicRegions::AbdomenAndPelvis}, + {"ACJOINT", CID4031_CommonAnatomicRegions::AcromioclavicularJoint}, + {"ANKLE", CID4031_CommonAnatomicRegions::AnkleJoint}, + {"BILEDUCT", CID4031_CommonAnatomicRegions::BileDuct}, + {"BLADDER", CID4031_CommonAnatomicRegions::Bladder}, + {"BREAST", CID4031_CommonAnatomicRegions::Breast}, + {"BRONCHUS", CID4031_CommonAnatomicRegions::Bronchus}, + {"CALCANEUS", CID4031_CommonAnatomicRegions::Calcaneus}, + {"CSPINE", CID4031_CommonAnatomicRegions::CervicalSpine}, + {"CTSPINE", CID4031_CommonAnatomicRegions::CervicoThoracicSpine}, + {"CHEST", CID4031_CommonAnatomicRegions::Chest}, + {"CHESTABDOMEN", CID4031_CommonAnatomicRegions::ChestAndAbdomen}, + {"CHESTABDPELVIS", CID4031_CommonAnatomicRegions::ChestAbdomenAndPelvis}, + {"CLAVICLE", CID4031_CommonAnatomicRegions::Clavicle}, + {"COCCYX", CID4031_CommonAnatomicRegions::Coccyx}, + {"COLON", CID4031_CommonAnatomicRegions::Colon}, + {"DUODENUM", CID4031_CommonAnatomicRegions::Duodenum}, + {"ELBOW", CID4031_CommonAnatomicRegions::ElbowJoint}, + {"WHOLEBODY", CID4031_CommonAnatomicRegions::EntireBody}, + {"ESOPHAGUS", CID4031_CommonAnatomicRegions::Esophagus}, + {"EXTREMITY", CID4031_CommonAnatomicRegions::Extremity}, + {"EYE", CID4031_CommonAnatomicRegions::Eye}, + {"FEMUR", CID4031_CommonAnatomicRegions::Femur}, + {"FIBULA", CID4031_CommonAnatomicRegions::Fibula}, + {"FINGER", CID4031_CommonAnatomicRegions::Finger}, + {"FOOT", CID4031_CommonAnatomicRegions::Foot}, + {"FOREARM", CID4031_CommonAnatomicRegions::Forearm}, + {"GALLBLADDER", CID4031_CommonAnatomicRegions::Gallbladder}, + {"HAND", CID4031_CommonAnatomicRegions::Hand}, + {"HEAD", CID4031_CommonAnatomicRegions::Head}, + {"HEADNECK", CID4031_CommonAnatomicRegions::HeadAndNeck}, + {"HEART", CID4031_CommonAnatomicRegions::Heart}, + {"HIP", CID4031_CommonAnatomicRegions::HipJoint}, + {"HUMERUS", CID4031_CommonAnatomicRegions::Humerus}, + {"ILEUM", CID4031_CommonAnatomicRegions::Ileum}, + {"ILIUM", CID4031_CommonAnatomicRegions::Ilium}, + {"IAC", CID4031_CommonAnatomicRegions::InternalAuditoryCanal}, + {"JAW", CID4031_CommonAnatomicRegions::JawRegion}, + {"JEJUNUM", CID4031_CommonAnatomicRegions::Jejunum}, + {"KNEE", CID4031_CommonAnatomicRegions::Knee}, + {"LARGEINTESTINE", CID4031_CommonAnatomicRegions::LargeIntestine}, + {"LARYNX", CID4031_CommonAnatomicRegions::Larynx}, + {"LEG", CID4031_CommonAnatomicRegions::LowerLeg}, + {"LSPINE", CID4031_CommonAnatomicRegions::LumbarSpine}, + {"LSSPINE", CID4031_CommonAnatomicRegions::LumboSacralSpine}, + {"JAW", CID4031_CommonAnatomicRegions::Mandible}, // same Defined Term as for (T-D1213,SRT,"Jaw region") + {"MASTOID", CID4031_CommonAnatomicRegions::MastoidBone}, + {"MAXILLA", CID4031_CommonAnatomicRegions::Maxilla}, + {"MEDIASTINUM", CID4031_CommonAnatomicRegions::Mediastinum}, + {"NECK", CID4031_CommonAnatomicRegions::Neck}, + {"NECKCHEST", CID4031_CommonAnatomicRegions::NeckAndChest}, + {"NECKCHESTABDOMEN", CID4031_CommonAnatomicRegions::NeckChestAndAbdomen}, + {"NECKCHESTABDPELV", CID4031_CommonAnatomicRegions::NeckChestAbdomenAndPelvis}, + {"OPTICCANAL", CID4031_CommonAnatomicRegions::OpticCanal}, + {"ORBIT", CID4031_CommonAnatomicRegions::OrbitalStructure}, + {"PAROTID", CID4031_CommonAnatomicRegions::ParotidGland}, + {"PATELLA", CID4031_CommonAnatomicRegions::Patella}, + {"PELVIS", CID4031_CommonAnatomicRegions::Pelvis}, + {"PROSTATE", CID4031_CommonAnatomicRegions::Prostate}, + {"RECTUM", CID4031_CommonAnatomicRegions::Rectum}, + {"RIB", CID4031_CommonAnatomicRegions::Rib}, + {"SIJOINT", CID4031_CommonAnatomicRegions::SacroiliacJoint}, + {"SSPINE", CID4031_CommonAnatomicRegions::Sacrum}, + {"SCAPULA", CID4031_CommonAnatomicRegions::Scapula}, + {"SELLA", CID4031_CommonAnatomicRegions::SellaTurcica}, + {"SESAMOID", CID4031_CommonAnatomicRegions::SesamoidBonesOfFoot}, + {"SHOULDER", CID4031_CommonAnatomicRegions::Shoulder}, + {"SKULL", CID4031_CommonAnatomicRegions::Skull}, + {"SMALLINTESTINE", CID4031_CommonAnatomicRegions::SmallIntestine}, + {"SPINE", CID4031_CommonAnatomicRegions::Spine}, + {"SCJOINT", CID4031_CommonAnatomicRegions::SternoclavicularJoint}, + {"STERNUM", CID4031_CommonAnatomicRegions::Sternum}, + {"STOMACH", CID4031_CommonAnatomicRegions::Stomach}, + {"SUBMANDIBULAR", CID4031_CommonAnatomicRegions::SubmandibularGland}, + {"TMJ", CID4031_CommonAnatomicRegions::TemporomandibularJoint}, + {"THIGH", CID4031_CommonAnatomicRegions::Thigh}, + {"TSPINE", CID4031_CommonAnatomicRegions::ThoracicSpine}, + {"TLSPINE", CID4031_CommonAnatomicRegions::ThoracoLumbarSpine}, + {"THUMB", CID4031_CommonAnatomicRegions::Thumb}, + {"TOE", CID4031_CommonAnatomicRegions::Toe}, + {"TRACHEA", CID4031_CommonAnatomicRegions::Trachea}, + {"ARM", CID4031_CommonAnatomicRegions::UpperArm}, + {"UPRURINARYTRACT", CID4031_CommonAnatomicRegions::UpperUrinaryTract}, + {"URETER", CID4031_CommonAnatomicRegions::Ureter}, + {"URETHRA", CID4031_CommonAnatomicRegions::Urethra}, + {"WRIST", CID4031_CommonAnatomicRegions::WristJoint}, + {"ZYGOMA", CID4031_CommonAnatomicRegions::Zygoma} +}; + +static const size_t NumberOfDefinedTerms = sizeof(DefinedTermTypeMap) / sizeof(DefinedTermTypeMapStruct); + + +/*------------------* + * implementation * + *------------------*/ + +CID4031e_CommonAnatomicRegions::CID4031e_CommonAnatomicRegions(const DSRCodedEntryValue &selectedValue) + : CID4031_CommonAnatomicRegions(selectedValue) +{ +} + + +CID4031e_CommonAnatomicRegions::CID4031e_CommonAnatomicRegions(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : CID4031_CommonAnatomicRegions(selectedValue, enhancedEncodingMode) +{ +} + + +CID4031e_CommonAnatomicRegions::CID4031e_CommonAnatomicRegions(const OFString &selectedValue, + const OFBool enhancedEncodingMode) + : CID4031_CommonAnatomicRegions(mapBodyPartExamined(selectedValue, enhancedEncodingMode)) +{ +} + + +OFCondition CID4031e_CommonAnatomicRegions::selectValue(const OFString &selectedValue, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* map defined term to coded entry */ + OFCondition result = mapBodyPartExamined(selectedValue, codedEntry, enhancedEncodingMode); + if (result.good()) + { + /* select but never check the coded entry */ + result = selectValue(codedEntry, OFFalse /*check*/, OFFalse /*definedContextGroup*/); + } + return result; +} + + +// static functions + +DSRCodedEntryValue CID4031e_CommonAnatomicRegions::mapBodyPartExamined(const OFString &definedTerm, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* call the real function (no need to check the returned status) */ + mapBodyPartExamined(definedTerm, codedEntry, enhancedEncodingMode); + /* return coded entry (by-value) */ + return codedEntry; +} + + +OFCondition CID4031e_CommonAnatomicRegions::mapBodyPartExamined(const OFString &definedTerm, + DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode) +{ + OFCondition result = SR_EC_UnsupportedValue; + /* determine region code from CID 4031 (based on the mapping in PS 3.16 Annex L) */ + for (size_t i = 0; i < NumberOfDefinedTerms; ++i) + { + /* use first match */ + if (definedTerm == DefinedTermTypeMap[i].DefinedTerm) + { + codedEntryValue = getCodedEntry(DefinedTermTypeMap[i].Type); + result = EC_Normal; + break; + } + } + /* set enhanced encoding mode (if enabled) */ + if (result.good() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntryValue); + return result; +} diff --git a/dcmsr/libcmr/cid42.cc b/dcmsr/libcmr/cid42.cc new file mode 100644 index 00000000..578937ea --- /dev/null +++ b/dcmsr/libcmr/cid42.cc @@ -0,0 +1,173 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID42_NumericValueQualifier + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:12 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid42.h" + + +// general information on CID 42 (Numeric Value Qualifier) +#define CONTEXT_GROUP_NUMBER "42" +#define CONTEXT_GROUP_VERSION "20020114" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.22" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID42_NumericValueQualifier::CodeList *CID42_NumericValueQualifier::Codes = NULL; + + +CID42_NumericValueQualifier::CID42_NumericValueQualifier(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID42_NumericValueQualifier::CID42_NumericValueQualifier(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID42_NumericValueQualifier::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID42_NumericValueQualifier::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID42_NumericValueQualifier::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID42_NumericValueQualifier::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID42_NumericValueQualifier::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID42_NumericValueQualifier::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID42_NumericValueQualifier::CodeList &CID42_NumericValueQualifier::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(NotANumber, DSRBasicCodedEntry("114000", "DCM", "Not a number"))); + Codes->insert(OFMake_pair(NegativeInfinity, DSRBasicCodedEntry("114001", "DCM", "Negative Infinity"))); + Codes->insert(OFMake_pair(PositiveInfinity, DSRBasicCodedEntry("114002", "DCM", "Positive Infinity"))); + Codes->insert(OFMake_pair(DivideByZero, DSRBasicCodedEntry("114003", "DCM", "Divide by zero"))); + Codes->insert(OFMake_pair(Underflow, DSRBasicCodedEntry("114004", "DCM", "Underflow"))); + Codes->insert(OFMake_pair(Overflow, DSRBasicCodedEntry("114005", "DCM", "Overflow"))); + Codes->insert(OFMake_pair(MeasurementFailure, DSRBasicCodedEntry("114006", "DCM", "Measurement failure"))); + Codes->insert(OFMake_pair(MeasurementNotAttempted, DSRBasicCodedEntry("114007", "DCM", "Measurement not attempted"))); + Codes->insert(OFMake_pair(CalculationFailure, DSRBasicCodedEntry("114008", "DCM", "Calculation failure"))); + Codes->insert(OFMake_pair(ValueOutOfRange, DSRBasicCodedEntry("114009", "DCM", "Value out of range"))); + Codes->insert(OFMake_pair(ValueUnknown, DSRBasicCodedEntry("114010", "DCM", "Value unknown"))); + Codes->insert(OFMake_pair(ValueIndeterminate, DSRBasicCodedEntry("114011", "DCM", "Value indeterminate"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID42_NumericValueQualifier::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid5000.cc b/dcmsr/libcmr/cid5000.cc new file mode 100644 index 00000000..da64f582 --- /dev/null +++ b/dcmsr/libcmr/cid5000.cc @@ -0,0 +1,172 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID5000_Languages + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid5000.h" + + +// general information on CID 5000 (Languages) +#define CONTEXT_GROUP_NUMBER "5000" +#define CONTEXT_GROUP_VERSION "" /* unknown */ +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.328" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible? */ + +// initialize global/static variable +CID5000_Languages::CodeList *CID5000_Languages::Codes = NULL; + + +CID5000_Languages::CID5000_Languages(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID5000_Languages::CID5000_Languages(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID5000_Languages::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID5000_Languages::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID5000_Languages::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID5000_Languages::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID5000_Languages::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID5000_Languages::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID5000_Languages::CodeList &CID5000_Languages::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(English, DSRBasicCodedEntry("eng", "RFC5646", "English"))); + Codes->insert(OFMake_pair(English_CA, DSRBasicCodedEntry("en-CA", "RFC5646", "English (CA)"))); + Codes->insert(OFMake_pair(English_GB, DSRBasicCodedEntry("en-GB", "RFC5646", "English (GB)"))); + Codes->insert(OFMake_pair(English_US, DSRBasicCodedEntry("en-US", "RFC5646", "English (US)"))); + Codes->insert(OFMake_pair(French, DSRBasicCodedEntry("fra", "RFC5646", "French"))); + Codes->insert(OFMake_pair(French_CA, DSRBasicCodedEntry("fr-CA", "RFC5646", "French (CA)"))); + Codes->insert(OFMake_pair(French_CH, DSRBasicCodedEntry("fr-CH", "RFC5646", "French (CH)"))); + Codes->insert(OFMake_pair(French_FR, DSRBasicCodedEntry("fr-FR", "RFC5646", "French (FR)"))); + Codes->insert(OFMake_pair(German, DSRBasicCodedEntry("deu", "RFC5646", "German"))); + Codes->insert(OFMake_pair(German_AT, DSRBasicCodedEntry("de-AT", "RFC5646", "German (AT)"))); + Codes->insert(OFMake_pair(German_CH, DSRBasicCodedEntry("de-CH", "RFC5646", "German (CH)"))); + Codes->insert(OFMake_pair(German_DE, DSRBasicCodedEntry("de-DE", "RFC5646", "German (DE)"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID5000_Languages::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid5001.cc b/dcmsr/libcmr/cid5001.cc new file mode 100644 index 00000000..d080306c --- /dev/null +++ b/dcmsr/libcmr/cid5001.cc @@ -0,0 +1,167 @@ +/* + * + * Copyright (C) 2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID5001_Countries + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid5001.h" + + +// general information on CID 5001 (Countries) +#define CONTEXT_GROUP_NUMBER "5001" +#define CONTEXT_GROUP_VERSION "" /* unknown */ +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.329" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible? */ + +// initialize global/static variable +CID5001_Countries::CodeList *CID5001_Countries::Codes = NULL; + + +CID5001_Countries::CID5001_Countries(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID5001_Countries::CID5001_Countries(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID5001_Countries::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID5001_Countries::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID5001_Countries::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID5001_Countries::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID5001_Countries::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID5001_Countries::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID5001_Countries::CodeList &CID5001_Countries::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(Austria, DSRBasicCodedEntry("AT", "ISO3166_1", "Austria"))); + Codes->insert(OFMake_pair(Canada, DSRBasicCodedEntry("CA", "ISO3166_1", "Canada"))); + Codes->insert(OFMake_pair(France, DSRBasicCodedEntry("FR", "ISO3166_1", "France"))); + Codes->insert(OFMake_pair(Germany, DSRBasicCodedEntry("DE", "ISO3166_1", "Germany"))); + Codes->insert(OFMake_pair(Switzerland, DSRBasicCodedEntry("CH", "ISO3166_1", "Switzerland"))); + Codes->insert(OFMake_pair(UnitedKingdom, DSRBasicCodedEntry("GB", "ISO3166_1", "United Kingdom of Great Britain and Northern Ireland"))); + Codes->insert(OFMake_pair(UnitedStates, DSRBasicCodedEntry("US", "ISO3166_1", "United States of America"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID5001_Countries::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid6147.cc b/dcmsr/libcmr/cid6147.cc new file mode 100644 index 00000000..1e69fee1 --- /dev/null +++ b/dcmsr/libcmr/cid6147.cc @@ -0,0 +1,165 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID6147_ResponseCriteria + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:24 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid6147.h" + + +// general information on CID 6147 (Response Criteria) +#define CONTEXT_GROUP_NUMBER "6147" +#define CONTEXT_GROUP_VERSION "20141110" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.1004" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID6147_ResponseCriteria::CodeList *CID6147_ResponseCriteria::Codes = NULL; + + +CID6147_ResponseCriteria::CID6147_ResponseCriteria(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID6147_ResponseCriteria::CID6147_ResponseCriteria(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID6147_ResponseCriteria::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID6147_ResponseCriteria::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID6147_ResponseCriteria::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID6147_ResponseCriteria::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID6147_ResponseCriteria::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID6147_ResponseCriteria::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID6147_ResponseCriteria::CodeList &CID6147_ResponseCriteria::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(WHO, DSRBasicCodedEntry("112029", "DCM", "WHO"))); + Codes->insert(OFMake_pair(RECIST10, DSRBasicCodedEntry("126080", "DCM", "RECIST 1.0"))); + Codes->insert(OFMake_pair(RECIST11, DSRBasicCodedEntry("126081", "DCM", "RECIST 1.1"))); + Codes->insert(OFMake_pair(RANO, DSRBasicCodedEntry("C114879", "NCIt", "RANO"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID6147_ResponseCriteria::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid7021.cc b/dcmsr/libcmr/cid7021.cc new file mode 100644 index 00000000..e78cf01e --- /dev/null +++ b/dcmsr/libcmr/cid7021.cc @@ -0,0 +1,165 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID7021_MeasurementReportDocumentTitles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:26 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid7021.h" + + +// general information on CID 7021 (Measurement Report Document Titles) +#define CONTEXT_GROUP_NUMBER "7021" +#define CONTEXT_GROUP_VERSION "20141110" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.997" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID7021_MeasurementReportDocumentTitles::CodeList *CID7021_MeasurementReportDocumentTitles::Codes = NULL; + + +CID7021_MeasurementReportDocumentTitles::CID7021_MeasurementReportDocumentTitles(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID7021_MeasurementReportDocumentTitles::CID7021_MeasurementReportDocumentTitles(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID7021_MeasurementReportDocumentTitles::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID7021_MeasurementReportDocumentTitles::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID7021_MeasurementReportDocumentTitles::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID7021_MeasurementReportDocumentTitles::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID7021_MeasurementReportDocumentTitles::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID7021_MeasurementReportDocumentTitles::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID7021_MeasurementReportDocumentTitles::CodeList &CID7021_MeasurementReportDocumentTitles::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(ImagingMeasurementReport, DSRBasicCodedEntry("126000", "DCM", "Imaging Measurement Report"))); + Codes->insert(OFMake_pair(OncologyMeasurementReport, DSRBasicCodedEntry("126001", "DCM", "Oncology Measurement Report"))); + Codes->insert(OFMake_pair(DynamicContrastMRMeasurementReport, DSRBasicCodedEntry("126002", "DCM", "Dynamic Contrast MR Measurement Report"))); + Codes->insert(OFMake_pair(PETMeasurementReport, DSRBasicCodedEntry("126003", "DCM", "PET Measurement Report"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID7021_MeasurementReportDocumentTitles::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid7181.cc b/dcmsr/libcmr/cid7181.cc new file mode 100644 index 00000000..294a9e7e --- /dev/null +++ b/dcmsr/libcmr/cid7181.cc @@ -0,0 +1,226 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID7181_AbstractMultiDimensionalImageModelComponentUnits + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:28 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid7181.h" + + +// general information on CID 7181 (Abstract Multi-dimensional Image Model Component Units) +#define CONTEXT_GROUP_NUMBER "7181" +#define CONTEXT_GROUP_VERSION "20180605" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.918" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID7181_AbstractMultiDimensionalImageModelComponentUnits::CodeList *CID7181_AbstractMultiDimensionalImageModelComponentUnits::Codes = NULL; + + +CID7181_AbstractMultiDimensionalImageModelComponentUnits::CID7181_AbstractMultiDimensionalImageModelComponentUnits(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID7181_AbstractMultiDimensionalImageModelComponentUnits::CID7181_AbstractMultiDimensionalImageModelComponentUnits(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID7181_AbstractMultiDimensionalImageModelComponentUnits::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID7181_AbstractMultiDimensionalImageModelComponentUnits::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID7181_AbstractMultiDimensionalImageModelComponentUnits::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID7181_AbstractMultiDimensionalImageModelComponentUnits::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID7181_AbstractMultiDimensionalImageModelComponentUnits::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID7181_AbstractMultiDimensionalImageModelComponentUnits::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID7181_AbstractMultiDimensionalImageModelComponentUnits::CodeList &CID7181_AbstractMultiDimensionalImageModelComponentUnits::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(MmHg, DSRBasicCodedEntry("mm[Hg]", "UCUM", "mmHg"))); + Codes->insert(OFMake_pair(KPa, DSRBasicCodedEntry("kPa", "UCUM", "kPa"))); + Codes->insert(OFMake_pair(PRU, DSRBasicCodedEntry("[PRU]", "UCUM", "P.R.U."))); + Codes->insert(OFMake_pair(WoodU, DSRBasicCodedEntry("[wood'U]", "UCUM", "Wood U"))); + Codes->insert(OFMake_pair(Dynscm5, DSRBasicCodedEntry("dyn.s.cm-5", "UCUM", "dyn.s.cm-5"))); + Codes->insert(OFMake_pair(PRUPerM2, DSRBasicCodedEntry("[PRU]/m2", "UCUM", "P.R.U./m2"))); + Codes->insert(OFMake_pair(WoodUPerM2, DSRBasicCodedEntry("[wood'U]/m2", "UCUM", "Wood U/m2"))); + Codes->insert(OFMake_pair(Dynscm5PerM2, DSRBasicCodedEntry("dyn.s.cm-5/m2", "UCUM", "dyn.s.cm-5/m2"))); + Codes->insert(OFMake_pair(Centimeter, DSRBasicCodedEntry("cm", "UCUM", "centimeter"))); + Codes->insert(OFMake_pair(Millimeter, DSRBasicCodedEntry("mm", "UCUM", "millimeter"))); + Codes->insert(OFMake_pair(Micrometer, DSRBasicCodedEntry("um", "UCUM", "micrometer"))); + Codes->insert(OFMake_pair(SquareCentimeter, DSRBasicCodedEntry("cm2", "UCUM", "square centimeter"))); + Codes->insert(OFMake_pair(SquareMillimeter, DSRBasicCodedEntry("mm2", "UCUM", "square millimeter"))); + Codes->insert(OFMake_pair(SquareMicrometer, DSRBasicCodedEntry("um2", "UCUM", "square micrometer"))); + Codes->insert(OFMake_pair(CubicDecimeter, DSRBasicCodedEntry("dm3", "UCUM", "cubic decimeter"))); + Codes->insert(OFMake_pair(CubicCentimeter, DSRBasicCodedEntry("cm3", "UCUM", "cubic centimeter"))); + Codes->insert(OFMake_pair(CubicMillimeter, DSRBasicCodedEntry("mm3", "UCUM", "cubic millimeter"))); + Codes->insert(OFMake_pair(CubicMicrometer, DSRBasicCodedEntry("um3", "UCUM", "cubic micrometer"))); + Codes->insert(OFMake_pair(StandardizedUptakeValueBodyWeight, DSRBasicCodedEntry("g/ml{SUVbw}", "UCUM", "Standardized Uptake Value body weight"))); + Codes->insert(OFMake_pair(StandardizedUptakeValueLeanBodyMassJames, DSRBasicCodedEntry("g/ml{SUVlbm}", "UCUM", "Standardized Uptake Value lean body mass (James)"))); + Codes->insert(OFMake_pair(StandardizedUptakeValueLeanBodyMassJames128Multiplier, DSRBasicCodedEntry("g/ml{SUVlbm(James128)}", "UCUM", "Standardized Uptake Value lean body mass (James 128 multiplier)"))); + Codes->insert(OFMake_pair(StandardizedUptakeValueLeanBodyMassJanma, DSRBasicCodedEntry("g/ml{SUVlbm(Janma)}", "UCUM", "Standardized Uptake Value lean body mass (Janma)"))); + Codes->insert(OFMake_pair(StandardizedUptakeValueBodySurfaceArea, DSRBasicCodedEntry("cm2/ml{SUVbsa}", "UCUM", "Standardized Uptake Value body surface area"))); + Codes->insert(OFMake_pair(StandardizedUptakeValueIdealBodyWeight, DSRBasicCodedEntry("g/ml{SUVibw}", "UCUM", "Standardized Uptake Value ideal body weight"))); + Codes->insert(OFMake_pair(Counts, DSRBasicCodedEntry("{counts}", "UCUM", "Counts"))); + Codes->insert(OFMake_pair(CountsPerSecond, DSRBasicCodedEntry("{counts}/s", "UCUM", "Counts per second"))); + Codes->insert(OFMake_pair(ProportionalToCounts, DSRBasicCodedEntry("{propcounts}", "UCUM", "Proportional to counts"))); + Codes->insert(OFMake_pair(ProportionalToCountsPerSecond, DSRBasicCodedEntry("{propcounts}/s", "UCUM", "Proportional to counts per second"))); + Codes->insert(OFMake_pair(SquareCentimeterPerMilliliter, DSRBasicCodedEntry("cm2/ml", "UCUM", "Centimeter**2/milliliter"))); + Codes->insert(OFMake_pair(Percent, DSRBasicCodedEntry("%", "UCUM", "Percent"))); + Codes->insert(OFMake_pair(BecquerelsPerMilliliter, DSRBasicCodedEntry("Bq/ml", "UCUM", "Becquerels/milliliter"))); + Codes->insert(OFMake_pair(MilligramsPerMinutePerMilliliter, DSRBasicCodedEntry("mg/min/ml", "UCUM", "Milligrams/minute/milliliter"))); + Codes->insert(OFMake_pair(MicromolePerMinutePerMilliliter, DSRBasicCodedEntry("umol/min/ml", "UCUM", "Micromole/minute/milliliter"))); + Codes->insert(OFMake_pair(MilliliterPerMinutePerGram, DSRBasicCodedEntry("ml/min/g", "UCUM", "Milliliter/minute/gram"))); + Codes->insert(OFMake_pair(MilliliterPerGram, DSRBasicCodedEntry("ml/g", "UCUM", "Milliliter/gram"))); + Codes->insert(OFMake_pair(PerCentimeter, DSRBasicCodedEntry("/cm", "UCUM", "/Centimeter"))); + Codes->insert(OFMake_pair(MicromolePerMilliliter, DSRBasicCodedEntry("umol/ml", "UCUM", "Micromole/milliliter"))); + Codes->insert(OFMake_pair(Mm2PerS, DSRBasicCodedEntry("mm2/s", "UCUM", "mm2/s"))); + Codes->insert(OFMake_pair(Um2PerMs, DSRBasicCodedEntry("um2/ms", "UCUM", "um2/ms"))); + Codes->insert(OFMake_pair(Um2PerS, DSRBasicCodedEntry("um2/s", "UCUM", "um2/s"))); + Codes->insert(OFMake_pair(_106mm2PerS, DSRBasicCodedEntry("10-6.mm2/s", "UCUM", "10-6.mm2/s"))); + Codes->insert(OFMake_pair(Gy, DSRBasicCodedEntry("Gy", "UCUM", "Gy"))); + Codes->insert(OFMake_pair(Sv, DSRBasicCodedEntry("Sv", "UCUM", "Sv"))); + Codes->insert(OFMake_pair(NoUnits, DSRBasicCodedEntry("1", "UCUM", "no units"))); + Codes->insert(OFMake_pair(Ratio, DSRBasicCodedEntry("{ratio}", "UCUM", "ratio"))); + Codes->insert(OFMake_pair(HounsfieldUnit, DSRBasicCodedEntry("[hnsf'U]", "UCUM", "Hounsfield Unit"))); + Codes->insert(OFMake_pair(ArbitraryUnit, DSRBasicCodedEntry("[arb'U]", "UCUM", "arbitrary unit"))); + Codes->insert(OFMake_pair(Ppm, DSRBasicCodedEntry("ppm", "UCUM", "ppm"))); + Codes->insert(OFMake_pair(CentimeterPerSecond, DSRBasicCodedEntry("cm/s", "UCUM", "centimeter/second"))); + Codes->insert(OFMake_pair(MillimeterPerSecond, DSRBasicCodedEntry("mm/s", "UCUM", "millimeter/second"))); + Codes->insert(OFMake_pair(Decibel, DSRBasicCodedEntry("dB", "UCUM", "decibel"))); + Codes->insert(OFMake_pair(DegreesCelsius, DSRBasicCodedEntry("Cel", "UCUM", "degrees Celsius"))); + Codes->insert(OFMake_pair(MilliliterPerMinute, DSRBasicCodedEntry("ml/min", "UCUM", "milliliter per minute"))); + Codes->insert(OFMake_pair(MilliliterPerSecond, DSRBasicCodedEntry("ml/s", "UCUM", "milliliter per second"))); + Codes->insert(OFMake_pair(Millisecond, DSRBasicCodedEntry("ms", "UCUM", "millisecond"))); + Codes->insert(OFMake_pair(Second, DSRBasicCodedEntry("s", "UCUM", "second"))); + Codes->insert(OFMake_pair(Hertz, DSRBasicCodedEntry("Hz", "UCUM", "Hertz"))); + Codes->insert(OFMake_pair(MilliTesla, DSRBasicCodedEntry("mT", "UCUM", "milliTesla"))); + Codes->insert(OFMake_pair(NumberParticlesPer100GramOfTissue, DSRBasicCodedEntry("{Particles}/[100]g{Tissue}", "UCUM", "number particles per 100 gram of tissue"))); + Codes->insert(OFMake_pair(SecondPerSquareMillimeter, DSRBasicCodedEntry("s/mm2", "UCUM", "second per square millimeter"))); + Codes->insert(OFMake_pair(MilliliterPer100GramPerMinute, DSRBasicCodedEntry("ml/[100]g/min", "UCUM", "milliliter per 100 gram per minute"))); + Codes->insert(OFMake_pair(MilliliterPer100Milliliter, DSRBasicCodedEntry("ml/[100]ml", "UCUM", "milliliter per 100 milliliter"))); + Codes->insert(OFMake_pair(MillimolesPerKgWetWeight, DSRBasicCodedEntry("mmol/kg{WetWeight}", "UCUM", "millimoles per kg wet weight"))); + Codes->insert(OFMake_pair(PerMin, DSRBasicCodedEntry("/min", "UCUM", "/min"))); + Codes->insert(OFMake_pair(PerS, DSRBasicCodedEntry("/s", "UCUM", "/s"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID7181_AbstractMultiDimensionalImageModelComponentUnits::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid7445.cc b/dcmsr/libcmr/cid7445.cc new file mode 100644 index 00000000..62348b91 --- /dev/null +++ b/dcmsr/libcmr/cid7445.cc @@ -0,0 +1,164 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID7445_DeviceParticipatingRoles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:30 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid7445.h" + + +// general information on CID 7445 (Device Participating Roles) +#define CONTEXT_GROUP_NUMBER "7445" +#define CONTEXT_GROUP_VERSION "20120406" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.1042" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID7445_DeviceParticipatingRoles::CodeList *CID7445_DeviceParticipatingRoles::Codes = NULL; + + +CID7445_DeviceParticipatingRoles::CID7445_DeviceParticipatingRoles(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID7445_DeviceParticipatingRoles::CID7445_DeviceParticipatingRoles(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID7445_DeviceParticipatingRoles::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID7445_DeviceParticipatingRoles::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID7445_DeviceParticipatingRoles::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID7445_DeviceParticipatingRoles::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID7445_DeviceParticipatingRoles::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID7445_DeviceParticipatingRoles::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID7445_DeviceParticipatingRoles::CodeList &CID7445_DeviceParticipatingRoles::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(IrradiatingDevice, DSRBasicCodedEntry("113859", "DCM", "Irradiating Device"))); + Codes->insert(OFMake_pair(Recording, DSRBasicCodedEntry("121097", "DCM", "Recording"))); + Codes->insert(OFMake_pair(XRayReadingDevice, DSRBasicCodedEntry("113942", "DCM", "X-Ray Reading Device"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID7445_DeviceParticipatingRoles::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid7452.cc b/dcmsr/libcmr/cid7452.cc new file mode 100644 index 00000000..86daa4f8 --- /dev/null +++ b/dcmsr/libcmr/cid7452.cc @@ -0,0 +1,187 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID7452_OrganizationalRoles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:32 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid7452.h" + + +// general information on CID 7452 (Organizational Roles) +#define CONTEXT_GROUP_NUMBER "7452" +#define CONTEXT_GROUP_VERSION "20170626" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.516" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID7452_OrganizationalRoles::CodeList *CID7452_OrganizationalRoles::Codes = NULL; + + +CID7452_OrganizationalRoles::CID7452_OrganizationalRoles(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID7452_OrganizationalRoles::CID7452_OrganizationalRoles(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID7452_OrganizationalRoles::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID7452_OrganizationalRoles::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID7452_OrganizationalRoles::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID7452_OrganizationalRoles::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID7452_OrganizationalRoles::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID7452_OrganizationalRoles::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID7452_OrganizationalRoles::CodeList &CID7452_OrganizationalRoles::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(MedicalPractitioner, DSRBasicCodedEntry("158965000", "SCT", "Medical Practitioner"))); + Codes->insert(OFMake_pair(Physician, DSRBasicCodedEntry("309343006", "SCT", "Physician"))); + Codes->insert(OFMake_pair(HeadOfRadiology, DSRBasicCodedEntry("128670", "DCM", "Head of Radiology"))); + Codes->insert(OFMake_pair(ChairOfProtocolCommittee, DSRBasicCodedEntry("128671", "DCM", "Chair of Protocol Committee"))); + Codes->insert(OFMake_pair(RepresentativeOfProtocolCommittee, DSRBasicCodedEntry("128676", "DCM", "Representative of Protocol Committee"))); + Codes->insert(OFMake_pair(RepresentativeOfEthicsCommittee, DSRBasicCodedEntry("128677", "DCM", "Representative of Ethics Committee"))); + Codes->insert(OFMake_pair(HeadOfCardiology, DSRBasicCodedEntry("128675", "DCM", "Head of Cardiology"))); + Codes->insert(OFMake_pair(AdministratorOfRadiologyDepartment, DSRBasicCodedEntry("128673", "DCM", "Administrator of Radiology Department"))); + Codes->insert(OFMake_pair(Nurse, DSRBasicCodedEntry("106292003", "SCT", "Nurse"))); + Codes->insert(OFMake_pair(RadiologicTechnologist, DSRBasicCodedEntry("159016003", "SCT", "Radiologic Technologist"))); + Codes->insert(OFMake_pair(LeadRadiologicTechnologist, DSRBasicCodedEntry("128674", "DCM", "Lead Radiologic Technologist"))); + Codes->insert(OFMake_pair(RadiationTherapist, DSRBasicCodedEntry("3430008", "SCT", "Radiation Therapist"))); + Codes->insert(OFMake_pair(Radiographer, DSRBasicCodedEntry("159016003", "SCT", "Radiographer"))); + Codes->insert(OFMake_pair(Intern, DSRBasicCodedEntry("C1144859", "UMLS", "Intern"))); + Codes->insert(OFMake_pair(Resident, DSRBasicCodedEntry("405277009", "SCT", "Resident"))); + Codes->insert(OFMake_pair(Registrar, DSRBasicCodedEntry("158971006", "SCT", "Registrar"))); + Codes->insert(OFMake_pair(Fellow, DSRBasicCodedEntry("121088", "DCM", "Fellow"))); + Codes->insert(OFMake_pair(Attending, DSRBasicCodedEntry("405279007", "SCT", "Attending"))); + Codes->insert(OFMake_pair(Consultant, DSRBasicCodedEntry("309390008", "SCT", "Consultant"))); + Codes->insert(OFMake_pair(ConsultingPhysician, DSRBasicCodedEntry("C1441532", "UMLS", "Consulting Physician"))); + Codes->insert(OFMake_pair(ScrubNurse, DSRBasicCodedEntry("415506007", "SCT", "Scrub nurse"))); + Codes->insert(OFMake_pair(Surgeon, DSRBasicCodedEntry("304292004", "SCT", "Surgeon"))); + Codes->insert(OFMake_pair(Sonologist, DSRBasicCodedEntry("121092", "DCM", "Sonologist"))); + Codes->insert(OFMake_pair(Sonographer, DSRBasicCodedEntry("C1954848", "UMLS", "Sonographer"))); + Codes->insert(OFMake_pair(RadiationPhysicist, DSRBasicCodedEntry("C2985483", "UMLS", "Radiation Physicist"))); + Codes->insert(OFMake_pair(MedicalPhysicist, DSRBasicCodedEntry("C1708969", "UMLS", "Medical Physicist"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID7452_OrganizationalRoles::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid7453.cc b/dcmsr/libcmr/cid7453.cc new file mode 100644 index 00000000..4487988b --- /dev/null +++ b/dcmsr/libcmr/cid7453.cc @@ -0,0 +1,178 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID7453_PerformingRoles + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:33 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid7453.h" + + +// general information on CID 7453 (Performing Roles) +#define CONTEXT_GROUP_NUMBER "7453" +#define CONTEXT_GROUP_VERSION "20180326" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.517" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID7453_PerformingRoles::CodeList *CID7453_PerformingRoles::Codes = NULL; + + +CID7453_PerformingRoles::CID7453_PerformingRoles(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID7453_PerformingRoles::CID7453_PerformingRoles(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID7453_PerformingRoles::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID7453_PerformingRoles::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID7453_PerformingRoles::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID7453_PerformingRoles::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID7453_PerformingRoles::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID7453_PerformingRoles::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID7453_PerformingRoles::CodeList &CID7453_PerformingRoles::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(Performing, DSRBasicCodedEntry("121094", "DCM", "Performing"))); + Codes->insert(OFMake_pair(Referring, DSRBasicCodedEntry("C1709880", "UMLS", "Referring"))); + Codes->insert(OFMake_pair(Requesting, DSRBasicCodedEntry("121096", "DCM", "Requesting"))); + Codes->insert(OFMake_pair(Recording, DSRBasicCodedEntry("121097", "DCM", "Recording"))); + Codes->insert(OFMake_pair(Verifying, DSRBasicCodedEntry("121098", "DCM", "Verifying"))); + Codes->insert(OFMake_pair(Assisting, DSRBasicCodedEntry("121099", "DCM", "Assisting"))); + Codes->insert(OFMake_pair(CirculatingNurse, DSRBasicCodedEntry("413854007", "SCT", "Circulating Nurse"))); + Codes->insert(OFMake_pair(Standby, DSRBasicCodedEntry("121101", "DCM", "Standby"))); + Codes->insert(OFMake_pair(IrradiationAuthorizing, DSRBasicCodedEntry("113850", "DCM", "Irradiation Authorizing"))); + Codes->insert(OFMake_pair(IrradiationAdministering, DSRBasicCodedEntry("113851", "DCM", "Irradiation Administering"))); + Codes->insert(OFMake_pair(Reader, DSRBasicCodedEntry("C28747", "NCIt", "Reader"))); + Codes->insert(OFMake_pair(EligibilityReader, DSRBasicCodedEntry("129001", "DCM", "Eligibility Reader"))); + Codes->insert(OFMake_pair(Adjudicator, DSRBasicCodedEntry("C96561", "NCIt", "Adjudicator"))); + Codes->insert(OFMake_pair(Reviewer, DSRBasicCodedEntry("C54634", "NCIt", "Reviewer"))); + Codes->insert(OFMake_pair(Designator, DSRBasicCodedEntry("129002", "DCM", "Designator"))); + Codes->insert(OFMake_pair(ImageQualityController, DSRBasicCodedEntry("129003", "DCM", "Image Quality Controller"))); + Codes->insert(OFMake_pair(ResultsQualityController, DSRBasicCodedEntry("129004", "DCM", "Results Quality Controller"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID7453_PerformingRoles::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid7464.cc b/dcmsr/libcmr/cid7464.cc new file mode 100644 index 00000000..a7e1c6d1 --- /dev/null +++ b/dcmsr/libcmr/cid7464.cc @@ -0,0 +1,174 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID7464_GeneralRegionOfInterestMeasurementModifiers + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:35 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid7464.h" + + +// general information on CID 7464 (General Region of Interest Measurement Modifiers) +#define CONTEXT_GROUP_NUMBER "7464" +#define CONTEXT_GROUP_VERSION "20121101" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.951" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID7464_GeneralRegionOfInterestMeasurementModifiers::CodeList *CID7464_GeneralRegionOfInterestMeasurementModifiers::Codes = NULL; + + +CID7464_GeneralRegionOfInterestMeasurementModifiers::CID7464_GeneralRegionOfInterestMeasurementModifiers(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID7464_GeneralRegionOfInterestMeasurementModifiers::CID7464_GeneralRegionOfInterestMeasurementModifiers(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID7464_GeneralRegionOfInterestMeasurementModifiers::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID7464_GeneralRegionOfInterestMeasurementModifiers::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID7464_GeneralRegionOfInterestMeasurementModifiers::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID7464_GeneralRegionOfInterestMeasurementModifiers::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID7464_GeneralRegionOfInterestMeasurementModifiers::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID7464_GeneralRegionOfInterestMeasurementModifiers::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID7464_GeneralRegionOfInterestMeasurementModifiers::CodeList &CID7464_GeneralRegionOfInterestMeasurementModifiers::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(Maximum, DSRBasicCodedEntry("56851009", "SCT", "Maximum"))); + Codes->insert(OFMake_pair(Minimum, DSRBasicCodedEntry("255605001", "SCT", "Minimum"))); + Codes->insert(OFMake_pair(Mean, DSRBasicCodedEntry("373098007", "SCT", "Mean"))); + Codes->insert(OFMake_pair(StandardDeviation, DSRBasicCodedEntry("386136009", "SCT", "Standard Deviation"))); + Codes->insert(OFMake_pair(Total, DSRBasicCodedEntry("255619001", "SCT", "Total"))); + Codes->insert(OFMake_pair(Median, DSRBasicCodedEntry("373099004", "SCT", "Median"))); + Codes->insert(OFMake_pair(Mode, DSRBasicCodedEntry("373100007", "SCT", "Mode"))); + Codes->insert(OFMake_pair(PeakValueWithinROI, DSRBasicCodedEntry("126031", "DCM", "Peak Value Within ROI"))); + Codes->insert(OFMake_pair(CoefficientOfVariance, DSRBasicCodedEntry("C0681921", "UMLS", "Coefficient of Variance"))); + Codes->insert(OFMake_pair(Skewness, DSRBasicCodedEntry("126051", "DCM", "Skewness"))); + Codes->insert(OFMake_pair(Kurtosis, DSRBasicCodedEntry("126052", "DCM", "Kurtosis"))); + Codes->insert(OFMake_pair(Variance, DSRBasicCodedEntry("C1711260", "UMLS", "Variance"))); + Codes->insert(OFMake_pair(RootMeanSquare, DSRBasicCodedEntry("C2347976", "UMLS", "Root Mean Square"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID7464_GeneralRegionOfInterestMeasurementModifiers::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/cid7469.cc b/dcmsr/libcmr/cid7469.cc new file mode 100644 index 00000000..e47123a7 --- /dev/null +++ b/dcmsr/libcmr/cid7469.cc @@ -0,0 +1,348 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CID7469_GenericIntensityAndSizeMeasurements + * + * Generated automatically from DICOM PS 3.16-2019b + * File created on 2019-04-26 17:15:37 by J. Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/cid7469.h" + + +// general information on CID 7469 (Generic Intensity and Size Measurements) +#define CONTEXT_GROUP_NUMBER "7469" +#define CONTEXT_GROUP_VERSION "20141110" +#define CONTEXT_GROUP_UID "1.2.840.10008.6.1.1003" +#define CONTEXT_GROUP_TYPE OFTrue /* extensible */ + +// initialize global/static variable +CID7469_GenericIntensityAndSizeMeasurements::CodeList *CID7469_GenericIntensityAndSizeMeasurements::Codes = NULL; + + +CID7469_GenericIntensityAndSizeMeasurements::CID7469_GenericIntensityAndSizeMeasurements(const DSRCodedEntryValue &selectedValue) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, selectedValue) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +CID7469_GenericIntensityAndSizeMeasurements::CID7469_GenericIntensityAndSizeMeasurements(const EnumType selectedValue, + const OFBool enhancedEncodingMode) + : DSRContextGroup(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID, getCodedEntry(selectedValue, enhancedEncodingMode)) +{ + setExtensible(CONTEXT_GROUP_TYPE); +} + + +OFCondition CID7469_GenericIntensityAndSizeMeasurements::selectValue(const EnumType selectedValue, + const OFBool enhancedEncodingMode) +{ + /* never check the coded entry */ + return DSRContextGroup::selectValue(getCodedEntry(selectedValue, enhancedEncodingMode), OFFalse /*check*/, OFFalse /*definedContextGroup*/); +} + + +OFCondition CID7469_GenericIntensityAndSizeMeasurements::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool enhancedEncodingMode) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + /* first, search for standard codes */ + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (searchForCodedEntry == iter->second) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + { + *foundCodedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!foundCodedEntry->isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(*foundCodedEntry); + } + result = SR_EC_CodedEntryInStandardContextGroup; + break; + } + ++iter; + } + /* if not, continue with extended codes */ + if (result.bad()) + { + result = DSRContextGroup::findCodedEntry(searchForCodedEntry, foundCodedEntry); + /* tbd: set "enhanced encoding mode" to mark a local/extended version? */ + } + return result; +} + + +void CID7469_GenericIntensityAndSizeMeasurements::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* print standard codes */ + stream << "Standard codes:" << OFendl; + CodeList::const_iterator iter = getCodes().begin(); + CodeList::const_iterator last = getCodes().end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + DSRCodedEntryValue(iter->second).print(stream); + stream << OFendl; + ++iter; + } + /* print extended codes */ + DSRContextGroup::printCodes(stream); +} + + +// static functions + +void CID7469_GenericIntensityAndSizeMeasurements::initialize() +{ + /* create and initialize code list */ + getCodes(); +} + + +void CID7469_GenericIntensityAndSizeMeasurements::cleanup() +{ + /* delete code list, it will be recreated automatically when needed */ + delete Codes; + Codes = NULL; +} + + +DSRCodedEntryValue CID7469_GenericIntensityAndSizeMeasurements::getCodedEntry(const EnumType value, + const OFBool enhancedEncodingMode) +{ + DSRCodedEntryValue codedEntry; + /* search for given enumerated value */ + CodeList::iterator iter = getCodes().find(value); + /* if found, set the coded entry */ + if (iter != getCodes().end()) + { + codedEntry = iter->second; + /* also set enhanced encoding mode (if enabled) */ + if (!codedEntry.isEmpty() && enhancedEncodingMode) + setEnhancedEncodingMode(codedEntry); + } + return codedEntry; +} + + +CID7469_GenericIntensityAndSizeMeasurements::CodeList &CID7469_GenericIntensityAndSizeMeasurements::getCodes() +{ + /* check whether code list has already been created and initialized */ + if (Codes == NULL) + { + /* create a new code list (should never fail) */ + Codes = new CodeList(); + /* and initialize it by adding the coded entries */ + Codes->insert(OFMake_pair(NAcetylaspartate, DSRBasicCodedEntry("115391007", "SCT", "N-acetylaspartate"))); + Codes->insert(OFMake_pair(Citrate, DSRBasicCodedEntry("59351004", "SCT", "Citrate"))); + Codes->insert(OFMake_pair(Choline, DSRBasicCodedEntry("65123005", "SCT", "Choline"))); + Codes->insert(OFMake_pair(Creatine, DSRBasicCodedEntry("14804005", "SCT", "Creatine"))); + Codes->insert(OFMake_pair(CreatineAndCholine, DSRBasicCodedEntry("113094", "DCM", "Creatine and Choline"))); + Codes->insert(OFMake_pair(Lactate, DSRBasicCodedEntry("83036002", "SCT", "Lactate"))); + Codes->insert(OFMake_pair(Lipid, DSRBasicCodedEntry("70106000", "SCT", "Lipid"))); + Codes->insert(OFMake_pair(LipidAndLactate, DSRBasicCodedEntry("113095", "DCM", "Lipid and Lactate"))); + Codes->insert(OFMake_pair(GlutamateAndGlutamine, DSRBasicCodedEntry("113080", "DCM", "Glutamate and glutamine"))); + Codes->insert(OFMake_pair(Glutamine, DSRBasicCodedEntry("25761002", "SCT", "Glutamine"))); + Codes->insert(OFMake_pair(Tuarine, DSRBasicCodedEntry("10944007", "SCT", "Tuarine"))); + Codes->insert(OFMake_pair(Inositol, DSRBasicCodedEntry("72164009", "SCT", "Inositol"))); + Codes->insert(OFMake_pair(CholinePerCreatineRatio, DSRBasicCodedEntry("113081", "DCM", "Choline/Creatine Ratio"))); + Codes->insert(OFMake_pair(NAcetylaspartatePerCreatineRatio, DSRBasicCodedEntry("113082", "DCM", "N-acetylaspartate/Creatine Ratio"))); + Codes->insert(OFMake_pair(NAcetylaspartatePerCholineRatio, DSRBasicCodedEntry("113083", "DCM", "N-acetylaspartate/Choline Ratio"))); + Codes->insert(OFMake_pair(CreatinePlusCholinePerCitrateRatio, DSRBasicCodedEntry("113096", "DCM", "Creatine+Choline/Citrate Ratio"))); + Codes->insert(OFMake_pair(T1, DSRBasicCodedEntry("113063", "DCM", "T1"))); + Codes->insert(OFMake_pair(T2, DSRBasicCodedEntry("113065", "DCM", "T2"))); + Codes->insert(OFMake_pair(T2Star, DSRBasicCodedEntry("113064", "DCM", "T2*"))); + Codes->insert(OFMake_pair(ProtonDensity, DSRBasicCodedEntry("113058", "DCM", "Proton Density"))); + Codes->insert(OFMake_pair(SpinTaggingPerfusionMRSignalIntensity, DSRBasicCodedEntry("110800", "DCM", "Spin Tagging Perfusion MR Signal Intensity"))); + Codes->insert(OFMake_pair(VelocityEncoded, DSRBasicCodedEntry("113070", "DCM", "Velocity encoded"))); + Codes->insert(OFMake_pair(TemperatureEncoded, DSRBasicCodedEntry("113067", "DCM", "Temperature encoded"))); + Codes->insert(OFMake_pair(ContrastAgentAngioMRSignalIntensity, DSRBasicCodedEntry("110801", "DCM", "Contrast Agent Angio MR Signal Intensity"))); + Codes->insert(OFMake_pair(TimeOfFlightAngioMRSignalIntensity, DSRBasicCodedEntry("110802", "DCM", "Time Of Flight Angio MR Signal Intensity"))); + Codes->insert(OFMake_pair(ProtonDensityWeightedMRSignalIntensity, DSRBasicCodedEntry("110803", "DCM", "Proton Density Weighted MR Signal Intensity"))); + Codes->insert(OFMake_pair(T1WeightedMRSignalIntensity, DSRBasicCodedEntry("110804", "DCM", "T1 Weighted MR Signal Intensity"))); + Codes->insert(OFMake_pair(T2WeightedMRSignalIntensity, DSRBasicCodedEntry("110805", "DCM", "T2 Weighted MR Signal Intensity"))); + Codes->insert(OFMake_pair(T2StarWeightedMRSignalIntensity, DSRBasicCodedEntry("110806", "DCM", "T2* Weighted MR Signal Intensity"))); + Codes->insert(OFMake_pair(DiffusionWeighted, DSRBasicCodedEntry("113043", "DCM", "Diffusion weighted"))); + Codes->insert(OFMake_pair(VolumetricDiffusionDxxComponent, DSRBasicCodedEntry("110810", "DCM", "Volumetric Diffusion Dxx Component"))); + Codes->insert(OFMake_pair(VolumetricDiffusionDxyComponent, DSRBasicCodedEntry("110811", "DCM", "Volumetric Diffusion Dxy Component"))); + Codes->insert(OFMake_pair(VolumetricDiffusionDxzComponent, DSRBasicCodedEntry("110812", "DCM", "Volumetric Diffusion Dxz Component"))); + Codes->insert(OFMake_pair(VolumetricDiffusionDyyComponent, DSRBasicCodedEntry("110813", "DCM", "Volumetric Diffusion Dyy Component"))); + Codes->insert(OFMake_pair(VolumetricDiffusionDyzComponent, DSRBasicCodedEntry("110814", "DCM", "Volumetric Diffusion Dyz Component"))); + Codes->insert(OFMake_pair(VolumetricDiffusionDzzComponent, DSRBasicCodedEntry("110815", "DCM", "Volumetric Diffusion Dzz Component"))); + Codes->insert(OFMake_pair(FractionalAnisotropy, DSRBasicCodedEntry("110808", "DCM", "Fractional Anisotropy"))); + Codes->insert(OFMake_pair(RelativeAnisotropy, DSRBasicCodedEntry("110809", "DCM", "Relative Anisotropy"))); + Codes->insert(OFMake_pair(VolumeRatio, DSRBasicCodedEntry("113288", "DCM", "Volume Ratio"))); + Codes->insert(OFMake_pair(ApparentDiffusionCoefficient, DSRBasicCodedEntry("113041", "DCM", "Apparent Diffusion Coefficient"))); + Codes->insert(OFMake_pair(DiffusionCoefficient, DSRBasicCodedEntry("113289", "DCM", "Diffusion Coefficient"))); + Codes->insert(OFMake_pair(MonoExponentialApparentDiffusionCoefficient, DSRBasicCodedEntry("113290", "DCM", "Mono-exponential Apparent Diffusion Coefficient"))); + Codes->insert(OFMake_pair(SlowDiffusionCoefficient, DSRBasicCodedEntry("113291", "DCM", "Slow Diffusion Coefficient"))); + Codes->insert(OFMake_pair(FastDiffusionCoefficient, DSRBasicCodedEntry("113292", "DCM", "Fast Diffusion Coefficient"))); + Codes->insert(OFMake_pair(FastDiffusionCoefficientFraction, DSRBasicCodedEntry("113293", "DCM", "Fast Diffusion Coefficient Fraction"))); + Codes->insert(OFMake_pair(KurtosisDiffusionCoefficient, DSRBasicCodedEntry("113294", "DCM", "Kurtosis Diffusion Coefficient"))); + Codes->insert(OFMake_pair(GammaDistributionScaleParameter, DSRBasicCodedEntry("113295", "DCM", "Gamma Distribution Scale Parameter"))); + Codes->insert(OFMake_pair(GammaDistributionShapeParameter, DSRBasicCodedEntry("113296", "DCM", "Gamma Distribution Shape Parameter"))); + Codes->insert(OFMake_pair(GammaDistributionMode, DSRBasicCodedEntry("113297", "DCM", "Gamma Distribution Mode"))); + Codes->insert(OFMake_pair(DistributedDiffusionCoefficient, DSRBasicCodedEntry("113298", "DCM", "Distributed Diffusion Coefficient"))); + Codes->insert(OFMake_pair(AnomalousExponentParameter, DSRBasicCodedEntry("113299", "DCM", "Anomalous Exponent Parameter"))); + Codes->insert(OFMake_pair(FieldMapMRSignalIntensity, DSRBasicCodedEntry("110807", "DCM", "Field Map MR Signal Intensity"))); + Codes->insert(OFMake_pair(T1WeightedDynamicContrastEnhancedMRSignalIntensity, DSRBasicCodedEntry("110816", "DCM", "T1 Weighted Dynamic Contrast Enhanced MR Signal Intensity"))); + Codes->insert(OFMake_pair(T2WeightedDynamicContrastEnhancedMRSignalIntensity, DSRBasicCodedEntry("110817", "DCM", "T2 Weighted Dynamic Contrast Enhanced MR Signal Intensity"))); + Codes->insert(OFMake_pair(T2StarWeightedDynamicContrastEnhancedMRSignalIntensity, DSRBasicCodedEntry("110818", "DCM", "T2* Weighted Dynamic Contrast Enhanced MR Signal Intensity"))); + Codes->insert(OFMake_pair(BloodOxygenationLevel, DSRBasicCodedEntry("110819", "DCM", "Blood Oxygenation Level"))); + Codes->insert(OFMake_pair(NuclearMedicineProjectionActivity, DSRBasicCodedEntry("110820", "DCM", "Nuclear Medicine Projection Activity"))); + Codes->insert(OFMake_pair(NuclearMedicineTomographicActivity, DSRBasicCodedEntry("110821", "DCM", "Nuclear Medicine Tomographic Activity"))); + Codes->insert(OFMake_pair(SpatialDisplacementXComponent, DSRBasicCodedEntry("110822", "DCM", "Spatial Displacement X Component"))); + Codes->insert(OFMake_pair(SpatialDisplacementYComponent, DSRBasicCodedEntry("110823", "DCM", "Spatial Displacement Y Component"))); + Codes->insert(OFMake_pair(SpatialDisplacementZComponent, DSRBasicCodedEntry("110824", "DCM", "Spatial Displacement Z Component"))); + Codes->insert(OFMake_pair(HemodynamicResistance, DSRBasicCodedEntry("110825", "DCM", "Hemodynamic Resistance"))); + Codes->insert(OFMake_pair(IndexedHemodynamicResistance, DSRBasicCodedEntry("110826", "DCM", "Indexed Hemodynamic Resistance"))); + Codes->insert(OFMake_pair(AttenuationCoefficient, DSRBasicCodedEntry("112031", "DCM", "Attenuation Coefficient"))); + Codes->insert(OFMake_pair(TissueVelocity, DSRBasicCodedEntry("110827", "DCM", "Tissue Velocity"))); + Codes->insert(OFMake_pair(FlowVelocity, DSRBasicCodedEntry("110828", "DCM", "Flow Velocity"))); + Codes->insert(OFMake_pair(PowerDoppler, DSRBasicCodedEntry("425704008", "SCT", "Power Doppler"))); + Codes->insert(OFMake_pair(FlowVariance, DSRBasicCodedEntry("110829", "DCM", "Flow Variance"))); + Codes->insert(OFMake_pair(Elasticity, DSRBasicCodedEntry("110830", "DCM", "Elasticity"))); + Codes->insert(OFMake_pair(Perfusion, DSRBasicCodedEntry("110831", "DCM", "Perfusion"))); + Codes->insert(OFMake_pair(SpeedOfSound, DSRBasicCodedEntry("110832", "DCM", "Speed of sound"))); + Codes->insert(OFMake_pair(UltrasoundAttenuation, DSRBasicCodedEntry("110833", "DCM", "Ultrasound Attenuation"))); + Codes->insert(OFMake_pair(StudentsTTest, DSRBasicCodedEntry("113068", "DCM", "Student's T-test"))); + Codes->insert(OFMake_pair(ZScore, DSRBasicCodedEntry("113071", "DCM", "Z-score"))); + Codes->insert(OFMake_pair(RCoefficient, DSRBasicCodedEntry("113057", "DCM", "R-Coefficient"))); + Codes->insert(OFMake_pair(R2Coefficient, DSRBasicCodedEntry("126220", "DCM", "R2-Coefficient"))); + Codes->insert(OFMake_pair(ChiSquare, DSRBasicCodedEntry("126221", "DCM", "Chi-square"))); + Codes->insert(OFMake_pair(DW, DSRBasicCodedEntry("126222", "DCM", "D-W"))); + Codes->insert(OFMake_pair(AIC, DSRBasicCodedEntry("126223", "DCM", "AIC"))); + Codes->insert(OFMake_pair(BIC, DSRBasicCodedEntry("126224", "DCM", "BIC"))); + Codes->insert(OFMake_pair(RGBRComponent, DSRBasicCodedEntry("110834", "DCM", "RGB R Component"))); + Codes->insert(OFMake_pair(RGBGComponent, DSRBasicCodedEntry("110835", "DCM", "RGB G Component"))); + Codes->insert(OFMake_pair(RGBBComponent, DSRBasicCodedEntry("110836", "DCM", "RGB B Component"))); + Codes->insert(OFMake_pair(YBR_FULLYComponent, DSRBasicCodedEntry("110837", "DCM", "YBR FULL Y Component"))); + Codes->insert(OFMake_pair(YBR_FULL_CBComponent, DSRBasicCodedEntry("110838", "DCM", "YBR FULL CB Component"))); + Codes->insert(OFMake_pair(YBR_FULL_CRComponent, DSRBasicCodedEntry("110839", "DCM", "YBR FULL CR Component"))); + Codes->insert(OFMake_pair(YBR_PARTIALYComponent, DSRBasicCodedEntry("110840", "DCM", "YBR PARTIAL Y Component"))); + Codes->insert(OFMake_pair(YBR_PARTIAL_CBComponent, DSRBasicCodedEntry("110841", "DCM", "YBR PARTIAL CB Component"))); + Codes->insert(OFMake_pair(YBR_PARTIAL_CRComponent, DSRBasicCodedEntry("110842", "DCM", "YBR PARTIAL CR Component"))); + Codes->insert(OFMake_pair(YBR_ICTYComponent, DSRBasicCodedEntry("110843", "DCM", "YBR ICT Y Component"))); + Codes->insert(OFMake_pair(YBR_ICT_CBComponent, DSRBasicCodedEntry("110844", "DCM", "YBR ICT CB Component"))); + Codes->insert(OFMake_pair(YBR_ICT_CRComponent, DSRBasicCodedEntry("110845", "DCM", "YBR ICT CR Component"))); + Codes->insert(OFMake_pair(YBR_RCTYComponent, DSRBasicCodedEntry("110846", "DCM", "YBR RCT Y Component"))); + Codes->insert(OFMake_pair(YBR_RCT_CBComponent, DSRBasicCodedEntry("110847", "DCM", "YBR RCT CB Component"))); + Codes->insert(OFMake_pair(YBR_RCT_CRComponent, DSRBasicCodedEntry("110848", "DCM", "YBR RCT CR Component"))); + Codes->insert(OFMake_pair(Echogenicity, DSRBasicCodedEntry("110849", "DCM", "Echogenicity"))); + Codes->insert(OFMake_pair(XRayAttenuation, DSRBasicCodedEntry("110850", "DCM", "X-Ray Attenuation"))); + Codes->insert(OFMake_pair(MRSignalIntensity, DSRBasicCodedEntry("110852", "DCM", "MR signal intensity"))); + Codes->insert(OFMake_pair(BinarySegmentation, DSRBasicCodedEntry("110853", "DCM", "Binary Segmentation"))); + Codes->insert(OFMake_pair(FractionalProbabilisticSegmentation, DSRBasicCodedEntry("110854", "DCM", "Fractional Probabilistic Segmentation"))); + Codes->insert(OFMake_pair(FractionalOccupancySegmentation, DSRBasicCodedEntry("110855", "DCM", "Fractional Occupancy Segmentation"))); + Codes->insert(OFMake_pair(R1, DSRBasicCodedEntry("126393", "DCM", "R1"))); + Codes->insert(OFMake_pair(R2, DSRBasicCodedEntry("126394", "DCM", "R2"))); + Codes->insert(OFMake_pair(R2Star, DSRBasicCodedEntry("126395", "DCM", "R2*"))); + Codes->insert(OFMake_pair(MagnetizationTransferRatio, DSRBasicCodedEntry("113098", "DCM", "Magnetization Transfer Ratio"))); + Codes->insert(OFMake_pair(MagneticSusceptibility, DSRBasicCodedEntry("126396", "DCM", "Magnetic Susceptibility"))); + Codes->insert(OFMake_pair(Ktrans, DSRBasicCodedEntry("126312", "DCM", "Ktrans"))); + Codes->insert(OFMake_pair(Kep, DSRBasicCodedEntry("126313", "DCM", "kep"))); + Codes->insert(OFMake_pair(Ve, DSRBasicCodedEntry("126314", "DCM", "ve"))); + Codes->insert(OFMake_pair(Tau_m, DSRBasicCodedEntry("126330", "DCM", "tau_m"))); + Codes->insert(OFMake_pair(Vp, DSRBasicCodedEntry("126331", "DCM", "vp"))); + Codes->insert(OFMake_pair(AbsoluteRegionalBloodFlow, DSRBasicCodedEntry("126390", "DCM", "Absolute Regional Blood Flow"))); + Codes->insert(OFMake_pair(AbsoluteRegionalBloodVolume, DSRBasicCodedEntry("126391", "DCM", "Absolute Regional Blood Volume"))); + Codes->insert(OFMake_pair(RelativeRegionalBloodFlow, DSRBasicCodedEntry("126397", "DCM", "Relative Regional Blood Flow"))); + Codes->insert(OFMake_pair(RelativeRegionalBloodVolume, DSRBasicCodedEntry("126398", "DCM", "Relative Regional Blood Volume"))); + Codes->insert(OFMake_pair(MeanTransitTime, DSRBasicCodedEntry("113052", "DCM", "Mean Transit Time"))); + Codes->insert(OFMake_pair(TimeToPeak, DSRBasicCodedEntry("113069", "DCM", "Time To Peak"))); + Codes->insert(OFMake_pair(OxygenExtractionFraction, DSRBasicCodedEntry("126392", "DCM", "Oxygen Extraction Fraction"))); + Codes->insert(OFMake_pair(Tmax, DSRBasicCodedEntry("113084", "DCM", "Tmax"))); + Codes->insert(OFMake_pair(IAUC, DSRBasicCodedEntry("126320", "DCM", "IAUC"))); + Codes->insert(OFMake_pair(IAUC60, DSRBasicCodedEntry("126321", "DCM", "IAUC60"))); + Codes->insert(OFMake_pair(IAUC90, DSRBasicCodedEntry("126322", "DCM", "IAUC90"))); + Codes->insert(OFMake_pair(IAUC180, DSRBasicCodedEntry("126323", "DCM", "IAUC180"))); + Codes->insert(OFMake_pair(IAUCBN, DSRBasicCodedEntry("126324", "DCM", "IAUCBN"))); + Codes->insert(OFMake_pair(IAUC60BN, DSRBasicCodedEntry("126325", "DCM", "IAUC60BN"))); + Codes->insert(OFMake_pair(IAUC90BN, DSRBasicCodedEntry("126326", "DCM", "IAUC90BN"))); + Codes->insert(OFMake_pair(IAUC180BN, DSRBasicCodedEntry("126327", "DCM", "IAUC180BN"))); + Codes->insert(OFMake_pair(TimeOfPeakConcentration, DSRBasicCodedEntry("126370", "DCM", "Time of Peak Concentration"))); + Codes->insert(OFMake_pair(TimeOfLeadingHalfPeakConcentration, DSRBasicCodedEntry("126372", "DCM", "Time of Leading Half-Peak Concentration"))); + Codes->insert(OFMake_pair(BolusArrivalTime, DSRBasicCodedEntry("126371", "DCM", "Bolus Arrival Time"))); + Codes->insert(OFMake_pair(TemporalDerivativeThreshold, DSRBasicCodedEntry("126374", "DCM", "Temporal Derivative Threshold"))); + Codes->insert(OFMake_pair(MaximumSlope, DSRBasicCodedEntry("126375", "DCM", "Maximum Slope"))); + Codes->insert(OFMake_pair(MaximumDifference, DSRBasicCodedEntry("126376", "DCM", "Maximum Difference"))); + Codes->insert(OFMake_pair(TracerConcentration, DSRBasicCodedEntry("126377", "DCM", "Tracer Concentration"))); + Codes->insert(OFMake_pair(StandardizedUptakeValue, DSRBasicCodedEntry("126400", "DCM", "Standardized Uptake Value"))); + Codes->insert(OFMake_pair(SUVbw, DSRBasicCodedEntry("126401", "DCM", "SUVbw"))); + Codes->insert(OFMake_pair(SUVlbm, DSRBasicCodedEntry("126402", "DCM", "SUVlbm"))); + Codes->insert(OFMake_pair(SUVlbmJames128, DSRBasicCodedEntry("126406", "DCM", "SUVlbm(James128)"))); + Codes->insert(OFMake_pair(SUVlbmJanma, DSRBasicCodedEntry("126405", "DCM", "SUVlbm(Janma)"))); + Codes->insert(OFMake_pair(SUVbsa, DSRBasicCodedEntry("126403", "DCM", "SUVbsa"))); + Codes->insert(OFMake_pair(SUVibw, DSRBasicCodedEntry("126404", "DCM", "SUVibw"))); + Codes->insert(OFMake_pair(AbsorbedDose, DSRBasicCodedEntry("128513", "DCM", "Absorbed Dose"))); + Codes->insert(OFMake_pair(EquivalentDose, DSRBasicCodedEntry("128512", "DCM", "Equivalent Dose"))); + Codes->insert(OFMake_pair(Fat, DSRBasicCodedEntry("256674009", "SCT", "Fat"))); + Codes->insert(OFMake_pair(FatFraction, DSRBasicCodedEntry("129100", "DCM", "Fat fraction"))); + Codes->insert(OFMake_pair(WaterPerFatInPhase, DSRBasicCodedEntry("129101", "DCM", "Water/fat in phase"))); + Codes->insert(OFMake_pair(WaterPerFatOutOfPhase, DSRBasicCodedEntry("129102", "DCM", "Water/fat out of phase"))); + Codes->insert(OFMake_pair(NegativeEnhancementIntegral, DSRBasicCodedEntry("113054", "DCM", "Negative enhancement integral"))); + Codes->insert(OFMake_pair(SignalChange, DSRBasicCodedEntry("113059", "DCM", "Signal change"))); + Codes->insert(OFMake_pair(SignalToNoise, DSRBasicCodedEntry("113060", "DCM", "Signal to noise"))); + Codes->insert(OFMake_pair(TimeCourseOfSignal, DSRBasicCodedEntry("113066", "DCM", "Time course of signal"))); + Codes->insert(OFMake_pair(Water, DSRBasicCodedEntry("11713004", "SCT", "Water"))); + Codes->insert(OFMake_pair(WaterFraction, DSRBasicCodedEntry("129103", "DCM", "Water fraction"))); + Codes->insert(OFMake_pair(RelativeLinearStoppingPower, DSRBasicCodedEntry("130086", "DCM", "Relative Linear Stopping Power"))); + Codes->insert(OFMake_pair(Length, DSRBasicCodedEntry("410668003", "SCT", "Length"))); + Codes->insert(OFMake_pair(PathLength, DSRBasicCodedEntry("121211", "DCM", "Path length"))); + Codes->insert(OFMake_pair(Distance, DSRBasicCodedEntry("121206", "DCM", "Distance"))); + Codes->insert(OFMake_pair(Width, DSRBasicCodedEntry("103355008", "SCT", "Width"))); + Codes->insert(OFMake_pair(Depth, DSRBasicCodedEntry("131197000", "SCT", "Depth"))); + Codes->insert(OFMake_pair(Diameter, DSRBasicCodedEntry("81827009", "SCT", "Diameter"))); + Codes->insert(OFMake_pair(LongAxis, DSRBasicCodedEntry("103339001", "SCT", "Long Axis"))); + Codes->insert(OFMake_pair(ShortAxis, DSRBasicCodedEntry("103340004", "SCT", "Short Axis"))); + Codes->insert(OFMake_pair(MajorAxis, DSRBasicCodedEntry("131187009", "SCT", "Major Axis"))); + Codes->insert(OFMake_pair(MinorAxis, DSRBasicCodedEntry("131188004", "SCT", "Minor Axis"))); + Codes->insert(OFMake_pair(PerpendicularAxis, DSRBasicCodedEntry("131189007", "SCT", "Perpendicular Axis"))); + Codes->insert(OFMake_pair(Radius, DSRBasicCodedEntry("131190003", "SCT", "Radius"))); + Codes->insert(OFMake_pair(Perimeter, DSRBasicCodedEntry("131191004", "SCT", "Perimeter"))); + Codes->insert(OFMake_pair(Circumference, DSRBasicCodedEntry("74551000", "SCT", "Circumference"))); + Codes->insert(OFMake_pair(DiameterOfCircumscribedCircle, DSRBasicCodedEntry("131192006", "SCT", "Diameter of circumscribed circle"))); + Codes->insert(OFMake_pair(Height, DSRBasicCodedEntry("121207", "DCM", "Height"))); + Codes->insert(OFMake_pair(Maximum3DDiameterOfAMesh, DSRBasicCodedEntry("L0JK", "IBSI", "Maximum 3D Diameter of a Mesh"))); + Codes->insert(OFMake_pair(MajorAxisIn3DLength, DSRBasicCodedEntry("TDIC", "IBSI", "Major Axis in 3D Length"))); + Codes->insert(OFMake_pair(MinorAxisIn3DLength, DSRBasicCodedEntry("P9VJ", "IBSI", "Minor Axis in 3D Length"))); + Codes->insert(OFMake_pair(LeastAxisIn3DLength, DSRBasicCodedEntry("7J51", "IBSI", "Least Axis in 3D Length"))); + Codes->insert(OFMake_pair(Area, DSRBasicCodedEntry("42798000", "SCT", "Area"))); + Codes->insert(OFMake_pair(AreaOfDefinedRegion, DSRBasicCodedEntry("131184002", "SCT", "Area of defined region"))); + Codes->insert(OFMake_pair(SurfaceAreaOfMesh, DSRBasicCodedEntry("C0JK", "IBSI", "Surface Area of Mesh"))); + Codes->insert(OFMake_pair(Volume, DSRBasicCodedEntry("118565006", "SCT", "Volume"))); + Codes->insert(OFMake_pair(VolumeEstimatedFromSingle2DRegion, DSRBasicCodedEntry("121216", "DCM", "Volume estimated from single 2D region"))); + Codes->insert(OFMake_pair(VolumeEstimatedFromTwoNonCoplanar2DRegions, DSRBasicCodedEntry("121218", "DCM", "Volume estimated from two non-coplanar 2D regions"))); + Codes->insert(OFMake_pair(VolumeEstimatedFromThreeOrMoreNonCoplanar2DRegions, DSRBasicCodedEntry("121217", "DCM", "Volume estimated from three or more non-coplanar 2D regions"))); + Codes->insert(OFMake_pair(VolumeOfSphere, DSRBasicCodedEntry("121222", "DCM", "Volume of sphere"))); + Codes->insert(OFMake_pair(VolumeOfEllipsoid, DSRBasicCodedEntry("121221", "DCM", "Volume of ellipsoid"))); + Codes->insert(OFMake_pair(VolumeOfCircumscribedSphere, DSRBasicCodedEntry("121220", "DCM", "Volume of circumscribed sphere"))); + Codes->insert(OFMake_pair(VolumeOfBoundingThreeDimensionalRegion, DSRBasicCodedEntry("121219", "DCM", "Volume of bounding three dimensional region"))); + Codes->insert(OFMake_pair(VolumeOfMesh, DSRBasicCodedEntry("RNU0", "IBSI", "Volume of Mesh"))); + Codes->insert(OFMake_pair(VolumeFromVoxelSummation, DSRBasicCodedEntry("YEKZ", "IBSI", "Volume from Voxel Summation"))); + } + /* should never be NULL */ + return *Codes; +} + + +OFCondition CID7469_GenericIntensityAndSizeMeasurements::setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue) +{ + return codedEntryValue.setEnhancedEncodingMode(CONTEXT_GROUP_NUMBER, "DCMR", CONTEXT_GROUP_VERSION, CONTEXT_GROUP_UID); +} diff --git a/dcmsr/libcmr/init.cc b/dcmsr/libcmr/init.cc new file mode 100644 index 00000000..0edea681 --- /dev/null +++ b/dcmsr/libcmr/init.cc @@ -0,0 +1,92 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CMR_ContentMappingResource + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/init.h" + +#include "dcmtk/dcmsr/cmr/cid11.h" +#include "dcmtk/dcmsr/cmr/cid29.h" +#include "dcmtk/dcmsr/cmr/cid42.h" +#include "dcmtk/dcmsr/cmr/cid100.h" +#include "dcmtk/dcmsr/cmr/cid244.h" +#include "dcmtk/dcmsr/cmr/cid4020.h" +#include "dcmtk/dcmsr/cmr/cid4021.h" +#include "dcmtk/dcmsr/cmr/cid4031.h" +#include "dcmtk/dcmsr/cmr/cid5000.h" +#include "dcmtk/dcmsr/cmr/cid5001.h" +#include "dcmtk/dcmsr/cmr/cid6147.h" +#include "dcmtk/dcmsr/cmr/cid7021.h" +#include "dcmtk/dcmsr/cmr/cid7181.h" +#include "dcmtk/dcmsr/cmr/cid7445.h" +#include "dcmtk/dcmsr/cmr/cid7452.h" +#include "dcmtk/dcmsr/cmr/cid7453.h" +#include "dcmtk/dcmsr/cmr/cid7464.h" +#include "dcmtk/dcmsr/cmr/cid7469.h" +#include "dcmtk/dcmsr/cmr/cid10013.h" +#include "dcmtk/dcmsr/cmr/cid10033.h" + + +/*------------------* + * implementation * + *------------------*/ + +void CMR_ContentMappingResource::initializeAllContextGroups() +{ + /* initialize all context groups, one after the other */ + CID11_RouteOfAdministration::initialize(); + CID29_AcquisitionModality::initialize(); + CID42_NumericValueQualifier::initialize(); + CID100_QuantitativeDiagnosticImagingProcedures::initialize(); + CID244_Laterality::initialize(); + CID4020_PETRadionuclide::initialize(); + CID4021_PETRadiopharmaceutical::initialize(); + CID4031_CommonAnatomicRegions::initialize(); + CID5000_Languages::initialize(); + CID5001_Countries::initialize(); + CID6147_ResponseCriteria::initialize(); + CID7021_MeasurementReportDocumentTitles::initialize(); + CID7181_AbstractMultiDimensionalImageModelComponentUnits::initialize(); + CID7445_DeviceParticipatingRoles::initialize(); + CID7452_OrganizationalRoles::initialize(); + CID7453_PerformingRoles::initialize(); + CID7464_GeneralRegionOfInterestMeasurementModifiers::initialize(); + CID7469_GenericIntensityAndSizeMeasurements::initialize(); + CID10013_CTAcquisitionType::initialize(); + CID10033_CTReconstructionAlgorithm::initialize(); +} + + +void CMR_ContentMappingResource::cleanupAllContextGroups() +{ + /* cleanup all context groups, one after the other */ + CID11_RouteOfAdministration::cleanup(); + CID29_AcquisitionModality::cleanup(); + CID42_NumericValueQualifier::cleanup(); + CID100_QuantitativeDiagnosticImagingProcedures::cleanup(); + CID244_Laterality::cleanup(); + CID4020_PETRadionuclide::cleanup(); + CID4021_PETRadiopharmaceutical::cleanup(); + CID4031_CommonAnatomicRegions::cleanup(); + CID5000_Languages::cleanup(); + CID5001_Countries::cleanup(); + CID6147_ResponseCriteria::cleanup(); + CID7021_MeasurementReportDocumentTitles::cleanup(); + CID7181_AbstractMultiDimensionalImageModelComponentUnits::cleanup(); + CID7445_DeviceParticipatingRoles::cleanup(); + CID7452_OrganizationalRoles::cleanup(); + CID7453_PerformingRoles::cleanup(); + CID7464_GeneralRegionOfInterestMeasurementModifiers::cleanup(); + CID7469_GenericIntensityAndSizeMeasurements::cleanup(); + CID10013_CTAcquisitionType::cleanup(); + CID10033_CTReconstructionAlgorithm::cleanup(); +} diff --git a/dcmsr/libcmr/logger.cc b/dcmsr/libcmr/logger.cc new file mode 100644 index 00000000..3cc79508 --- /dev/null +++ b/dcmsr/libcmr/logger.cc @@ -0,0 +1,22 @@ +/* + * + * Copyright (C) 2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file with logger definition for submodule "dcmsr/cmr" + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/logger.h" + + +/*--------------------* + * global variables * + *--------------------*/ + +OFLogger DCM_dcmsrCmrLogger = OFLog::getLogger("dcmtk.dcmsr.cmr"); diff --git a/dcmsr/libcmr/srnumvl.cc b/dcmsr/libcmr/srnumvl.cc new file mode 100644 index 00000000..7ce6f27e --- /dev/null +++ b/dcmsr/libcmr/srnumvl.cc @@ -0,0 +1,111 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class CMR_SRNumericMeasurementValue + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/srnumvl.h" + + +CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue() + : DSRNumericMeasurementValue() +{ +} + + +CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const OFBool check) + : DSRNumericMeasurementValue(numericValue, measurementUnit, check) +{ +} + + +CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) + : DSRNumericMeasurementValue(valueQualifier, check) +{ +} + + +CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) + : DSRNumericMeasurementValue(numericValue, measurementUnit, valueQualifier, check) +{ +} + + +CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(const CMR_SRNumericMeasurementValue &numericMeasurement) + : DSRNumericMeasurementValue(numericMeasurement) +{ +} + + +CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(const DSRNumericMeasurementValue &numericMeasurement) + : DSRNumericMeasurementValue(numericMeasurement) +{ +} + + +CMR_SRNumericMeasurementValue::~CMR_SRNumericMeasurementValue() +{ +} + + +CMR_SRNumericMeasurementValue &CMR_SRNumericMeasurementValue::operator=(const CMR_SRNumericMeasurementValue &numericMeasurement) +{ + /* just call the inherited method */ + DSRNumericMeasurementValue::operator=(numericMeasurement); + return *this; +} + + +OFCondition CMR_SRNumericMeasurementValue::setValue(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) +{ + /* map type to coded entry and call the method doing the real work */ + return DSRNumericMeasurementValue::setValue(valueQualifier, check); +} + + +OFCondition CMR_SRNumericMeasurementValue::setValue(const OFString &numericValue, + const DSRCodedEntryValue &measurementUnit, + const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) +{ + /* map type to coded entry and call the method doing the real work */ + return DSRNumericMeasurementValue::setValue(numericValue, measurementUnit, valueQualifier, check); +} + + +OFCondition CMR_SRNumericMeasurementValue::setNumericValueQualifier(const CID42_NumericValueQualifier &valueQualifier, + const OFBool check) +{ + /* map type to coded entry and call the method doing the real work */ + return DSRNumericMeasurementValue::setNumericValueQualifier(valueQualifier, check); +} + + +OFCondition CMR_SRNumericMeasurementValue::checkNumericValueQualifier(const DSRCodedEntryValue &valueQualifier) const +{ + /* first, perform some basic checks (done by the base class) */ + OFCondition result = DSRNumericMeasurementValue::checkNumericValueQualifier(valueQualifier); + if (result.good() && !valueQualifier.isEmpty()) + { + /* then, also check for conformance with CID 42 */ + static const CID42_NumericValueQualifier contextGroup; + if (contextGroup.findCodedEntry(valueQualifier).bad()) + result = SR_EC_CodedEntryNotInContextGroup; + } + return result; +} diff --git a/dcmsr/libcmr/tid1001.cc b/dcmsr/libcmr/tid1001.cc new file mode 100644 index 00000000..2c460466 --- /dev/null +++ b/dcmsr/libcmr/tid1001.cc @@ -0,0 +1,223 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID1001_ObservationContext + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid1001.h" +#include "dcmtk/dcmsr/codes/dcm.h" + +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// index positions in node list (makes source code more readable) +#define LAST_PERSON_OBSERVER 0 +#define LAST_DEVICE_OBSERVER 1 +#define NUMBER_OF_LIST_ENTRIES 2 + +// general information on TID 1001 (Observation Context) +#define TEMPLATE_NUMBER "1001" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFFalse /* non-extensible, but included templates are */ +#define TEMPLATE_ORDER OFTrue /* significant */ + + +TID1001_ObservationContext::TID1001_ObservationContext() + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES); +} + + +OFCondition TID1001_ObservationContext::addPersonObserver(const OFString &personName, + const OFString &organizationName, + const CID7452_OrganizationalRoles &organizationRole, + const CID7453_PerformingRoles &procedureRole, + const OFBool check) +{ + OFCondition result = EC_MemoryExhausted; + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* TID 1002 (Observer Context) Row 1 */ + STORE_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Code, CODE_DCM_ObserverType, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(CODE_DCM_Person, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1002 - Row 1")); + /* TID 1003 (Person Observer Identifying Attributes) Row 1 */ + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_PName, CODE_DCM_PersonObserverName)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(personName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1003 - Row 1")); + /* TID 1003 (Person Observer Identifying Attributes) Row 2 */ + if (!organizationName.empty()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Text, CODE_DCM_PersonObserverOrganizationName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(organizationName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1003 - Row 2")); + } + /* TID 1003 (Person Observer Identifying Attributes) Row 3 */ + if (organizationRole.hasSelectedValue()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Code, CODE_DCM_PersonObserverRoleInTheOrganization, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(organizationRole, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1003 - Row 3")); + } + /* TID 1003 (Person Observer Identifying Attributes) Row 4 */ + if (procedureRole.hasSelectedValue()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Code, CODE_DCM_PersonObserverRoleInThisProcedure, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(procedureRole, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1003 - Row 4")); + } + /* if everything was OK, insert new subtree into the template */ + if (result.good()) + { + const size_t lastNode = subTree->getNodeID(); + /* order is significant, so go to last person observer */ + if (gotoLastEntryFromNodeList(this, LAST_PERSON_OBSERVER) > 0) + { + /* insert subtree at current position */ + STORE_RESULT(insertSubTree(subTree, AM_afterCurrent)); + } else { + /* this is the first person observer (but there might be device observers) */ + gotoRoot(); + /* insert subtree before current position (at the beginning of the tree) */ + STORE_RESULT(insertSubTree(subTree, AM_beforeCurrent)); + } + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_PERSON_OBSERVER, lastNode)); + } + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); + } + return result; +} + + +OFCondition TID1001_ObservationContext::addDeviceObserver(const OFString &deviceUID, + const OFString &deviceName, + const OFString &manufacturer, + const OFString &modelName, + const OFString &serialNumber, + const OFString &physicalLocation, + const DeviceParticipatingRolesList &procedureRoles, + const OFString &stationAEtitle, + const OFBool check) +{ + OFCondition result = EC_MemoryExhausted; + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* TID 1002 (Observer Context) Row 1 */ + STORE_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Code, CODE_DCM_ObserverType, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(CODE_DCM_Device, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1002 - Row 1")); + /* TID 1004 (Device Observer Identifying Attributes) Row 1 */ + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_UIDRef, CODE_DCM_DeviceObserverUID)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(deviceUID, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 1")); + /* TID 1004 (Device Observer Identifying Attributes) Row 2 */ + if (!deviceName.empty()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Text, CODE_DCM_DeviceObserverName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(deviceName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 2")); + } + /* TID 1004 (Device Observer Identifying Attributes) Row 3 */ + if (!manufacturer.empty()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Text, CODE_DCM_DeviceObserverManufacturer, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(manufacturer, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 3")); + } + /* TID 1004 (Device Observer Identifying Attributes) Row 4 */ + if (!modelName.empty()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Text, CODE_DCM_DeviceObserverModelName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(modelName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 4")); + } + /* TID 1004 (Device Observer Identifying Attributes) Row 5 */ + if (!serialNumber.empty()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Text, CODE_DCM_DeviceObserverSerialNumber, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(serialNumber, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 5")); + } + /* TID 1004 (Device Observer Identifying Attributes) Row 6 */ + if (!physicalLocation.empty()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Text, CODE_DCM_DeviceObserverPhysicalLocationDuringObservation, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(physicalLocation, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 6")); + } + /* TID 1004 (Device Observer Identifying Attributes) Row 7 */ + if (!procedureRoles.empty()) + { + OFListConstIterator(CID7445_DeviceParticipatingRoles) iter = procedureRoles.begin(); + const OFListConstIterator(CID7445_DeviceParticipatingRoles) last = procedureRoles.end(); + /* iterate over all list entries */ + while ((iter != last) && result.good()) + { + STORE_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Code, CODE_DCM_DeviceRoleInProcedure, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(iter->getSelectedValue(), check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 7")); + ++iter; + } + } + /* TID 1004 (Device Observer Identifying Attributes) Row 8 */ + if (!stationAEtitle.empty()) + { + CHECK_RESULT(subTree->addContentItem(RT_hasObsContext, VT_Text, CODE_DCM_StationAETitle, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setStringValue(stationAEtitle, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1004 - Row 8")); + } + /* if everything was OK, insert new subtree into the template */ + if (result.good()) + { + const size_t lastNode = subTree->getNodeID(); + /* order is significant, so go to last device (or person) observer */ + gotoLastEntryFromNodeList(this, LAST_DEVICE_OBSERVER); + /* insert subtree at current position */ + STORE_RESULT(insertSubTree(subTree, AM_afterCurrent)); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_DEVICE_OBSERVER, lastNode)); + } + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); +} + return result; +} + + +OFCondition TID1001_ObservationContext::addProcedureContext() +{ + /* tbd: not yet implemented */ + return EC_NotYetImplemented; +} + + +OFCondition TID1001_ObservationContext::addSubjectContext() +{ + /* tbd: not yet implemented */ + return EC_NotYetImplemented; +} diff --git a/dcmsr/libcmr/tid1204.cc b/dcmsr/libcmr/tid1204.cc new file mode 100644 index 00000000..9b3736ca --- /dev/null +++ b/dcmsr/libcmr/tid1204.cc @@ -0,0 +1,64 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID1204_LanguageOfContentItemAndDescendants + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid1204.h" +#include "dcmtk/dcmsr/codes/dcm.h" + +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// general information on TID 1204 (Language of Content Item and Descendants) +#define TEMPLATE_NUMBER "1204" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFFalse /* non-extensible */ +#define TEMPLATE_ORDER OFTrue /* significant */ + + +TID1204_LanguageOfContentItemAndDescendants::TID1204_LanguageOfContentItemAndDescendants() + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); +} + + +OFCondition TID1204_LanguageOfContentItemAndDescendants::setLanguage(const CID5000_Languages &language, + const CID5001_Countries &country, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree subTree; + /* TID 1204 (Language of Content Item and Descendants) Row 1 */ + STORE_RESULT(subTree.addContentItem(RT_hasConceptMod, VT_Code, CODE_DCM_LanguageOfContentItemAndDescendants, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setCodeValue(language, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setAnnotationText("TID 1204 - Row 1")); + /* TID 1204 (Language of Content Item and Descendants) Row 2 */ + if (country.hasSelectedValue()) + { + CHECK_RESULT(subTree.addChildContentItem(RT_hasConceptMod, VT_Code, CODE_DCM_CountryOfLanguage, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setCodeValue(country, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setAnnotationText("TID 1204 - Row 2")); + } + /* if everything was OK, replace current subtree of the template */ + GOOD_RESULT(swap(subTree)); + return result; +} diff --git a/dcmsr/libcmr/tid1411.cc b/dcmsr/libcmr/tid1411.cc new file mode 100644 index 00000000..c85b13a5 --- /dev/null +++ b/dcmsr/libcmr/tid1411.cc @@ -0,0 +1,742 @@ +/* + * + * Copyright (C) 2016-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID1411_VolumetricROIMeasurements + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid1411.h" +#include "dcmtk/dcmsr/cmr/tid15def.h" +#include "dcmtk/dcmsr/cmr/logger.h" +#include "dcmtk/dcmsr/codes/dcm.h" +#include "dcmtk/dcmsr/codes/ncit.h" +#include "dcmtk/dcmsr/codes/sct.h" +#include "dcmtk/dcmsr/codes/umls.h" +#include "dcmtk/dcmsr/dsrtpltn.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// index positions in node list (makes source code more readable) +#define MEASUREMENT_GROUP 0 +#define ACTIVITY_SESSION 1 +#define TRACKING_IDENTIFIER 2 +#define TRACKING_UNIQUE_IDENTIFIER 3 +#define FINDING 4 +#define TIME_POINT 5 +#define REFERENCED_SEGMENT 6 +#define SOURCE_SERIES_FOR_SEGMENTATION 7 +#define REAL_WORLD_VALUE_MAP 8 +#define MEASUREMENT_METHOD 9 +#define LAST_FINDING_SITE 10 +#define LAST_MEASUREMENT 11 +#define LAST_QUALITATIVE_EVALUATION 12 +#define NUMBER_OF_LIST_ENTRIES 13 + +// general information on TID 1411 (Volumetric ROI Measurements) +#define TEMPLATE_NUMBER "1411" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFTrue /* extensible */ +#define TEMPLATE_ORDER OFFalse /* non-significant */ + + +template +TID1411_VolumetricROIMeasurements::TID1411_VolumetricROIMeasurements(const OFBool createGroup) + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID), + Measurement(new TID1419_Measurement()) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES, OFTrue /*initialize*/); + /* TID 1411 (Volumetric ROI Measurements) Row 1 */ + if (createGroup) + createMeasurementGroup(); +} + + +template +void TID1411_VolumetricROIMeasurements::clear() +{ + DSRSubTemplate::clear(); + Measurement->clear(); +} + + +template +OFBool TID1411_VolumetricROIMeasurements::isValid() const +{ + /* check whether base class is valid and all required content items are present */ + return DSRSubTemplate::isValid() && + hasMeasurementGroup() && hasTrackingIdentifier() && hasTrackingUniqueIdentifier() && + hasReferencedSegment() && hasSourceSeriesForSegmentation() && hasMeasurements(OFTrue /*checkChildren*/); +} + + +template +OFBool TID1411_VolumetricROIMeasurements::hasMeasurementGroup(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1411 (Volumetric ROI Measurements) Row 1 */ + if (gotoEntryFromNodeList(cursor, MEASUREMENT_GROUP) > 0) + result = cursor.hasChildNodes(); + } else { + /* check for content item at TID 1411 (Volumetric ROI Measurements) Row 1 */ + result = (getEntryFromNodeList(MEASUREMENT_GROUP) > 0); + } + return result; +} + + +template +OFBool TID1411_VolumetricROIMeasurements::hasTrackingIdentifier() const +{ + /* check for content item at TID 1411 (Volumetric ROI Measurements) Row 2 */ + return (getEntryFromNodeList(TRACKING_IDENTIFIER) > 0); +} + + +template +OFBool TID1411_VolumetricROIMeasurements::hasTrackingUniqueIdentifier() const +{ + /* check for content item at TID 1411 (Volumetric ROI Measurements) Row 3 */ + return (getEntryFromNodeList(TRACKING_UNIQUE_IDENTIFIER) > 0); +} + + +template +OFBool TID1411_VolumetricROIMeasurements::hasReferencedSegment() const +{ + /* check for content item at TID 1411 (Volumetric ROI Measurements) Row 7 */ + return (getEntryFromNodeList(REFERENCED_SEGMENT) > 0); +} + + +template +OFBool TID1411_VolumetricROIMeasurements::hasSourceSeriesForSegmentation() const +{ + /* check for content item at TID 1411 (Volumetric ROI Measurements) Row 12 */ + return (getEntryFromNodeList(SOURCE_SERIES_FOR_SEGMENTATION) > 0); +} + + +template +OFBool TID1411_VolumetricROIMeasurements::hasMeasurements(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1411 (Volumetric ROI Measurements) Row 13 */ + if (gotoEntryFromNodeList(cursor, LAST_MEASUREMENT) > 0) + { + /* check whether any of the "included TID 1419 templates" is non-empty */ + while (cursor.isValid() && (cursor.getNode()->getValueType() == VT_includedTemplate)) + { + const DSRSubTemplate *subTempl = OFstatic_cast(const DSRIncludedTemplateTreeNode *, cursor.getNode())->getValue().get(); + if (subTempl != NULL) + { + if (subTempl->compareTemplateIdentication("1419", "DCMR")) + { + result = !subTempl->isEmpty(); + if (result) break; + } else { + /* exit loop */ + break; + } + } + if (cursor.gotoPrevious() == 0) + { + /* invalidate cursor */ + cursor.clear(); + } + } + } + } else { + /* check for content item at TID 1411 (Volumetric ROI Measurements) Row 13 */ + result = (getEntryFromNodeList(LAST_MEASUREMENT) > 0); + } + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setActivitySession(const OFString &session, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!session.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1411 (Volumetric ROI Measurements) Row 1b */ + CHECK_RESULT(addOrReplaceContentItem(ACTIVITY_SESSION, RT_hasObsContext, VT_Text, CODE_NCIt_ActivitySession, "TID 1411 - Row 1b", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(session, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setTrackingIdentifier(const OFString &trackingID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!trackingID.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1411 (Volumetric ROI Measurements) Row 2 */ + CHECK_RESULT(addOrReplaceContentItem(TRACKING_IDENTIFIER, RT_hasObsContext, VT_Text, CODE_DCM_TrackingIdentifier, "TID 1411 - Row 2", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(trackingID, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setTrackingUniqueIdentifier(const OFString &trackingUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!trackingUID.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1411 (Volumetric ROI Measurements) Row 3 */ + CHECK_RESULT(addOrReplaceContentItem(TRACKING_UNIQUE_IDENTIFIER, RT_hasObsContext, VT_UIDRef, CODE_DCM_TrackingUniqueIdentifier, "TID 1411 - Row 3", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(trackingUID, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setFinding(const DSRCodedEntryValue &finding, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (finding.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1411 (Volumetric ROI Measurements) Row 3b */ + CHECK_RESULT(addOrReplaceContentItem(FINDING, RT_contains, VT_Code, CODE_DCM_Finding, "TID 1411 - Row 3b", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(finding, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setTimePoint(const OFString &timePoint, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!timePoint.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1502 (Time Point Context) Row 3 */ + CHECK_RESULT(addOrReplaceContentItem(TIME_POINT, RT_hasObsContext, VT_Text, CODE_UMLS_TimePoint, "TID 1502 - Row 3", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(timePoint, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setReferencedSegment(const DSRImageReferenceValue &segment, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (segment.isComplete()) + { + const char *annotationText = "TID 1411 - Row 7"; + const DSRBasicCodedEntry conceptName(CODE_DCM_ReferencedSegment); + /* check for supported segmentation SOP classes */ + if ((segment.getSOPClassUID() != UID_SegmentationStorage) && (segment.getSOPClassUID() != UID_SurfaceSegmentationStorage)) + { + DCMSR_CMR_WARN("Cannot set value of '" << conceptName.CodeMeaning << "' content item (" << annotationText << ") ... wrong SOP Class"); + DCMSR_CMR_DEBUG("SOP Class UID \"" << segment.getSOPClassUID() << "\" does not match one of the known Segmentation objects"); + result = CMR_EC_InvalidSegmentationObject; + } + /* ... and number of referenced segments */ + else if ((segment.getSegmentList().getNumberOfItems() != 1)) + { + DCMSR_CMR_WARN("Cannot set value of '" << conceptName.CodeMeaning << "' content item (" << annotationText << ") ... wrong number of segments"); + result = CMR_EC_InvalidSegmentationObject; + } else { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1411 (Volumetric ROI Measurements) Row 7 */ + CHECK_RESULT(addOrReplaceContentItem(REFERENCED_SEGMENT, RT_contains, VT_Image, conceptName, annotationText, check)); + CHECK_RESULT(getCurrentContentItem().setImageReference(segment, check)); + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setReferencedSegment(DcmItem &dataset, + const Uint16 segmentNumber, + const OFBool copyTracking, + const OFBool check) +{ + DSRImageReferenceValue segment; + /* first, create the referenced image/segment object */ + OFCondition result = segment.setReference(dataset, check); + segment.getSegmentList().addItem(segmentNumber); + /* then, add/set the corresponding content item */ + CHECK_RESULT(setReferencedSegment(segment, check)); + /* need to copy tracking information? (introduced with CP-1496) */ + if (copyTracking && result.good()) + { + DcmSequenceOfItems *dseq = NULL; + /* get SegmentSequence (should always be present) */ + result = dataset.findAndGetSequence(DCM_SegmentSequence, dseq); + checkElementValue(dseq, DCM_SegmentSequence, "1-n", "1", result, "SegmentDescriptionMacro"); + if (result.good()) + { + DcmObject *dobj = NULL; + OFBool segmentFound = OFFalse; + /* iterate over all items in this sequence */ + while (((dobj = dseq->nextInContainer(dobj)) != NULL) && !segmentFound) + { + Uint16 number = 0; + DcmItem *ditem = OFstatic_cast(DcmItem *, dobj); + /* search for given segment number */ + if (ditem->findAndGetUint16(DCM_SegmentNumber, number).good()) + { + if (segmentNumber == number) + { + OFString trackingID, trackingUID; + /* get tracking ID and UID from current item (if present) and add/set content item */ + getAndCheckStringValueFromDataset(*ditem, DCM_TrackingID, trackingID, "1", "1C", "SegmentSequence"); + getAndCheckStringValueFromDataset(*ditem, DCM_TrackingUID, trackingUID, "1", "1C", "SegmentSequence"); + if (!trackingID.empty() && !trackingUID.empty()) + { + CHECK_RESULT(setTrackingIdentifier(trackingID, check)); + CHECK_RESULT(setTrackingUniqueIdentifier(trackingUID, check)); + } + else if (trackingID.empty() != trackingUID.empty()) + { + /* report a violation of the type 1C conditions */ + DCMSR_CMR_WARN("Either Tracking ID or Tracking UID is absent/empty in referenced segmentation object"); + } + /* given segment number found */ + segmentFound = OFTrue; + } + } + } + /* report a warning if referenced segment could not be found */ + if (!segmentFound) + { + DCMSR_CMR_WARN("Cannot copy tracking information for '" << CODE_DCM_ReferencedSegment.CodeMeaning << "' content item (TID 1411 - Row 7) ... segment not found"); + DCMSR_CMR_DEBUG("Cannot find given Segment Number (" << segmentNumber << ") in Segment Sequence of referenced segmentation object"); + } + } else { + /* report a warning if referenced segment could not be found */ + DCMSR_CMR_WARN("Cannot copy tracking information for '" << CODE_DCM_ReferencedSegment.CodeMeaning << "' content item (TID 1411 - Row 7) ... segment not found"); + } + /* tbc: return with an error in case the tracking information could not be copied? */ + } + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setSourceSeriesForSegmentation(const OFString &seriesUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!seriesUID.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1411 (Volumetric ROI Measurements) Row 12 */ + CHECK_RESULT(addOrReplaceContentItem(SOURCE_SERIES_FOR_SEGMENTATION, RT_contains, VT_UIDRef, CODE_DCM_SourceSeriesForSegmentation, "TID 1411 - Row 12", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(seriesUID, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (valueMap.isComplete()) + { + const char *annotationText = "TID 1411 - Row 14"; + const DSRBasicCodedEntry conceptName(CODE_DCM_RealWorldValueMapUsedForMeasurement); + /* check for real world value mapping SOP classes */ + if (valueMap.getSOPClassUID() != UID_RealWorldValueMappingStorage) + { + DCMSR_CMR_WARN("Cannot set value of '" << conceptName.CodeMeaning << "' content item (" << annotationText << ") ... wrong SOP Class"); + DCMSR_CMR_DEBUG("SOP Class UID \"" << valueMap.getSOPClassUID() << "\" does not match the one of the Real World Value Mapping object"); + result = CMR_EC_InvalidRealWorldValueMappingObject; + } else { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1411 (Volumetric ROI Measurements) Row 14 */ + CHECK_RESULT(addOrReplaceContentItem(REAL_WORLD_VALUE_MAP, RT_contains, VT_Composite, conceptName, annotationText, check)); + CHECK_RESULT(getCurrentContentItem().setCompositeReference(valueMap, check)); + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setRealWorldValueMap(DcmItem &dataset, + const OFBool check) +{ + DSRCompositeReferenceValue valueMap; + /* first, create the referenced composite object */ + OFCondition result = valueMap.setReference(dataset, check); + /* then, add/set the corresponding content item */ + CHECK_RESULT(setRealWorldValueMap(valueMap, check)); + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::setMeasurementMethod(const T_Method &method, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (method.hasSelectedValue()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1419 (ROI Measurements) Row 1 */ + CHECK_RESULT(addOrReplaceContentItem(MEASUREMENT_METHOD, RT_hasConceptMod, VT_Code, CODE_SCT_MeasurementMethod, "TID 1419 - Row 1", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(method, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality, + const DSRCodedEntryValue &siteModifier, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of mandatory parameter */ + if (site.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* TID 1419 (ROI Measurements) Row 2 */ + CHECK_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_FindingSite, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(site, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1419 - Row 2")); + const size_t lastNode = subTree->getNodeID(); + /* TID 1419 (ROI Measurements) Row 3 - optional */ + if (laterality.hasSelectedValue()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_Laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1419 - Row 3")); + GOOD_RESULT(subTree->gotoParent()); + } + /* TID 1419 (ROI Measurements) Row 4 - optional */ + if (siteModifier.isComplete()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_TopographicalModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(siteModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1419 - Row 4")); + GOOD_RESULT(subTree->gotoParent()); + } + /* if everything was OK, insert new subtree into the template */ + if (result.good() && !subTree->isEmpty()) + { + /* go to last measurement (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_FINDING_SITE) == getEntryFromNodeList(MEASUREMENT_GROUP)) + { + /* insert subtree below root */ + STORE_RESULT(insertSubTree(subTree, AM_belowCurrent)); + } else { + /* insert subtree after current position */ + STORE_RESULT(insertSubTree(subTree, AM_afterCurrent)); + } + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_FINDING_SITE, lastNode)); + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); + } else { + /* delete the new subtree since it has not been inserted */ + delete subTree; + } + } else + result = EC_MemoryExhausted; + } else + result = CMR_EC_NoMeasurement; + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::addMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool checkEmpty, + const OFBool checkValue) +{ + OFCondition result = EC_Normal; + /* basic check of mandatory parameters */ + if (conceptName.hasSelectedValue() && numericValue.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* go to content item at TID 1411 (Volumetric ROI Measurements) Row 15 */ + if (gotoEntryFromNodeList(this, LAST_MEASUREMENT) > 0) + { + /* check whether the current instance of TID 1419 is non-empty (if needed) */ + if (checkEmpty && Measurement->isEmpty()) + result = getMeasurement().createNewMeasurement(conceptName, numericValue, checkValue); + else { + /* create new instance of TID 1419 (ROI Measurements) */ + TID1419_Measurement *subTempl = new TID1419_Measurement(conceptName, numericValue, checkValue); + if (subTempl != NULL) + { + /* store (shared) reference to new instance */ + Measurement.reset(subTempl); + /* and add it to the current template (TID 1411 - Row 15) */ + STORE_RESULT(includeTemplate(Measurement, AM_afterCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1411 - Row 15")); + GOOD_RESULT(storeEntryInNodeList(LAST_MEASUREMENT, getNodeID())); + /* tbc: what if the call of includeTemplate() fails? */ + } else + result = EC_MemoryExhausted; + } + } else + result = CMR_EC_NoMeasurementGroup; + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* make sure that the parameters are non-empty */ + if (conceptName.isComplete() && codeValue.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* go to last qualitative evaluation (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_QUALITATIVE_EVALUATION) == getEntryFromNodeList(MEASUREMENT_GROUP)) + { + /* insert TID 1411 (Volumetric ROI Measurements) Row 16 below root */ + STORE_RESULT(addChildContentItem(RT_contains, VT_Code, conceptName, check)); + } else { + /* insert TID 1411 (Volumetric ROI Measurements) Row 16 after current position */ + STORE_RESULT(addContentItem(RT_contains, VT_Code, conceptName, check)); + } + CHECK_RESULT(getCurrentContentItem().setCodeValue(codeValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1411 - Row 16")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_QUALITATIVE_EVALUATION, getNodeID())); + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* make sure that the parameters are non-empty */ + if (conceptName.isComplete() && !stringValue.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* go to last qualitative evaluation (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_QUALITATIVE_EVALUATION) == getEntryFromNodeList(MEASUREMENT_GROUP)) + { + /* insert TID 1411 (Volumetric ROI Measurements) Row 17 below root */ + STORE_RESULT(addChildContentItem(RT_contains, VT_Text, conceptName, check)); + } else { + /* insert TID 1411 (Volumetric ROI Measurements) Row 17 after current position */ + STORE_RESULT(addContentItem(RT_contains, VT_Text, conceptName, check)); + } + CHECK_RESULT(getCurrentContentItem().setStringValue(stringValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1411 - Row 17")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_QUALITATIVE_EVALUATION, getNodeID())); + } + } else + result = EC_IllegalParameter; + return result; +} + + +// protected methods + +template +OFCondition TID1411_VolumetricROIMeasurements::createMeasurementGroup() +{ + OFCondition result = SR_EC_InvalidTemplateStructure; + if (isEmpty()) + { + /* TID 1411 (Volumetric ROI Measurements) Row 1 */ + STORE_RESULT(addContentItem(RT_unknown, VT_Container, CODE_DCM_MeasurementGroup)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1411 - Row 1")); + GOOD_RESULT(storeEntryInNodeList(MEASUREMENT_GROUP, getNodeID())); + /* TID 1411 (Volumetric ROI Measurements) Row 15 */ + CHECK_RESULT(includeTemplate(Measurement, AM_belowCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1411 - Row 15")); + GOOD_RESULT(storeEntryInNodeList(LAST_MEASUREMENT, getNodeID())); + /* if anything went wrong, clear the report */ + BAD_RESULT(clear()); + } + return result; +} + + +template +OFCondition TID1411_VolumetricROIMeasurements::addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* check concept name and coded entry value */ + if (conceptName.isComplete()) + { + /* check whether content item already exists */ + if (getEntryFromNodeList(nodePos) == 0) + { + /* if not, create the content item (at correct position) */ + if (gotoLastEntryFromNodeList(this, nodePos) == getEntryFromNodeList(MEASUREMENT_GROUP)) + { + /* need to add the new content item as the first child */ + if (addContentItem(relationshipType, valueType, AM_belowCurrentBeforeFirstChild) > 0) + { + if (getCurrentContentItem().setConceptName(conceptName, check).bad()) + result = SR_EC_InvalidConceptName; + } else + result = SR_EC_CannotAddContentItem; + + } else { + /* add new content item as a sibling (after the current one) */ + STORE_RESULT(addContentItem(relationshipType, valueType, conceptName)); + } + /* store ID of added node for later use */ + GOOD_RESULT(storeEntryInNodeList(nodePos, getNodeID())); + } + else if (gotoEntryFromNodeList(this, nodePos) > 0) + { + /* make sure that the value type of the existing content item is correct */ + if (getCurrentContentItem().getValueType() != valueType) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong value type"); + result = SR_EC_InvalidContentItem; + } + else if (getCurrentContentItem().getConceptName() != conceptName) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong concept name"); + result = SR_EC_InvalidConceptName; + } else { + DCMSR_CMR_DEBUG("Replacing value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ")"); + /* the actual replacing of the value is done by the caller of this method */ + } + } else + result = SR_EC_InvalidTemplateStructure; + /* finally, set annotation */ + CHECK_RESULT(getCurrentContentItem().setAnnotationText(annotationText)); + } else + result = SR_EC_InvalidConceptName; + return result; +} + + +// explicit template instantiation (needed for use in TID 1500) +template class TID1411_VolumetricROIMeasurements; diff --git a/dcmsr/libcmr/tid1419m.cc b/dcmsr/libcmr/tid1419m.cc new file mode 100644 index 00000000..fdfb5512 --- /dev/null +++ b/dcmsr/libcmr/tid1419m.cc @@ -0,0 +1,482 @@ +/* + * + * Copyright (C) 2017-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID1419_ROIMeasurements_Measurement + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid1419m.h" +#include "dcmtk/dcmsr/cmr/tid15def.h" +#include "dcmtk/dcmsr/cmr/cid6147.h" +#include "dcmtk/dcmsr/cmr/cid7181.h" +#include "dcmtk/dcmsr/cmr/cid7464.h" +#include "dcmtk/dcmsr/cmr/cid7469.h" +#include "dcmtk/dcmsr/cmr/logger.h" +#include "dcmtk/dcmsr/codes/dcm.h" +#include "dcmtk/dcmsr/codes/sct.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// index positions in node list (makes source code more readable) +#define MEASUREMENT 0 +#define LAST_MODIFIER 1 +#define MEASUREMENT_METHOD 2 +#define DERIVATION 3 +#define LAST_FINDING_SITE 4 +#define LAST_DERIVATION_PARAMETER 5 +#define EQUIVALENT_MEANING 6 +#define REAL_WORLD_VALUE_MAP 7 +#define ALGORITHM_IDENTIFICATION 8 +#define NUMBER_OF_LIST_ENTRIES 9 + +// general information on TID 1419 (ROI Measurements) +#define TEMPLATE_NUMBER "1419" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFTrue /* extensible */ +#define TEMPLATE_ORDER OFFalse /* non-significant */ + + +template +TID1419_ROIMeasurements_Measurement::TID1419_ROIMeasurements_Measurement() + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID), + AlgorithmIdentification(new TID4019_AlgorithmIdentification()) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES, OFTrue /*initialize*/); +} + + +template +TID1419_ROIMeasurements_Measurement::TID1419_ROIMeasurements_Measurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check) + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID), + AlgorithmIdentification(new TID4019_AlgorithmIdentification()) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES, OFTrue /*initialize*/); + /* create the mandatory "root" content item */ + createMeasurement(conceptName, numericValue, check); +} + + +template +void TID1419_ROIMeasurements_Measurement::clear() +{ + DSRSubTemplate::clear(); + AlgorithmIdentification->clear(); +} + + +template +OFBool TID1419_ROIMeasurements_Measurement::isValid() const +{ + /* check whether base class is valid and all required content items are present */ + return DSRSubTemplate::isValid() && hasMeasurement(); +} + + +template +OFBool TID1419_ROIMeasurements_Measurement::hasMeasurement() const +{ + /* check for content item at TID 1419 (Measurement) Row 5 */ + return (getEntryFromNodeList(MEASUREMENT) > 0); +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::createNewMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check) +{ + clear(); + /* TID 1419 (Measurement) Row 5 */ + return createMeasurement(conceptName, numericValue, check); +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::addModifier(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &modifier, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.isComplete() && modifier.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* go to last instance of TID 1419 (ROI Measurements) Row 6 (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_MODIFIER) == getEntryFromNodeList(MEASUREMENT)) + { + /* need to add the new content item as the first child */ + if (addContentItem(RT_hasConceptMod, VT_Code, AM_belowCurrentBeforeFirstChild) > 0) + { + if (getCurrentContentItem().setConceptName(conceptName, check).good()) + result = EC_Normal; + else + result = SR_EC_InvalidConceptName; + } else + result = SR_EC_CannotAddContentItem; + } else + STORE_RESULT(addContentItem(RT_hasConceptMod, VT_Code, conceptName, check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(modifier, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1419 - Row 6")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_MODIFIER, getNodeID())); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::setMeasurementMethod(const T_Method &method, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameter */ + if (method.hasSelectedValue()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 1419 (ROI Measurements) Row 7 */ + STORE_RESULT(addOrReplaceContentItem(MEASUREMENT_METHOD, RT_hasConceptMod, VT_Code, CODE_SCT_MeasurementMethod, "TID 1419 - Row 7", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(method, check)); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::setDerivation(const T_Derivation &derivation, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameter */ + if (derivation.hasSelectedValue()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 1419 (ROI Measurements) Row 8 */ + STORE_RESULT(addOrReplaceContentItem(DERIVATION, RT_hasConceptMod, VT_Code, CODE_DCM_Derivation, "TID 1419 - Row 8", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(derivation, check)); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality, + const DSRCodedEntryValue &siteModifier, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of mandatory parameter */ + if (site.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* TID 1419 (ROI Measurements) Row 9 */ + STORE_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_FindingSite, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(site, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1419 - Row 9")); + const size_t lastNode = subTree->getNodeID(); + /* TID 1419 (ROI Measurements) Row 10 - optional */ + if (laterality.hasSelectedValue()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_Laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1419 - Row 10")); + GOOD_RESULT(subTree->gotoParent()); + } + /* TID 1419 (ROI Measurements) Row 11 - optional */ + if (siteModifier.isComplete()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_TopographicalModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(siteModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1419 - Row 11")); + GOOD_RESULT(subTree->gotoParent()); + } + /* if everything was OK, insert new subtree into the template */ + if (result.good() && !subTree->isEmpty()) + { + /* go to last measurement (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_FINDING_SITE) == getEntryFromNodeList(MEASUREMENT)) + { + /* insert subtree below root */ + STORE_RESULT(insertSubTree(subTree, AM_belowCurrent)); + } else { + /* insert subtree after current position */ + STORE_RESULT(insertSubTree(subTree, AM_afterCurrent)); + } + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_FINDING_SITE, lastNode)); + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); + } else { + /* delete the new subtree since it has not been inserted */ + delete subTree; + } + } else + result = EC_MemoryExhausted; + } else + result = CMR_EC_NoMeasurement; + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::addDerivationParameter(const DSRCodedEntryValue &conceptName, + const CMR_SRNumericMeasurementValue &numericValue, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.isComplete() && numericValue.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* go to last derivation parameter (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_DERIVATION_PARAMETER) == getEntryFromNodeList(MEASUREMENT)) + { + /* insert TID 1419 (ROI Measurements) Row 13 below root */ + STORE_RESULT(addChildContentItem(RT_inferredFrom, VT_Num, conceptName, check)); + } else { + /* insert TID 1419 (ROI Measurements) Row 13 after current position */ + STORE_RESULT(addContentItem(RT_inferredFrom, VT_Num, conceptName, check)); + } + CHECK_RESULT(getCurrentContentItem().setNumericValue(numericValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1419 - Row 13")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_DERIVATION_PARAMETER, getNodeID())); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::setEquivalentMeaningOfConceptName(const OFString &meaning, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!meaning.empty()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 1419 (ROI Measurements) Row 18 */ + CHECK_RESULT(addOrReplaceContentItem(EQUIVALENT_MEANING, RT_hasConceptMod, VT_Text, CODE_DCM_EquivalentMeaningOfConceptName, "TID 1419 - Row 18", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(meaning, check)); + } else + result = CMR_EC_NoMeasurement; + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (valueMap.isComplete()) + { + const char *annotationText = "TID 1419 - Row 19"; + const DSRBasicCodedEntry conceptName(CODE_DCM_RealWorldValueMapUsedForMeasurement); + /* check for real world value mapping SOP classes */ + if (valueMap.getSOPClassUID() != UID_RealWorldValueMappingStorage) + { + DCMSR_CMR_WARN("Cannot set value of '" << conceptName.CodeMeaning << "' content item (" << annotationText << ") ... wrong SOP Class"); + DCMSR_CMR_DEBUG("SOP Class UID \"" << valueMap.getSOPClassUID() << "\" does not match the one of the Real World Value Mapping object"); + result = CMR_EC_InvalidRealWorldValueMappingObject; + } else { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 1419 (ROI Measurements) Row 19 */ + CHECK_RESULT(addOrReplaceContentItem(REAL_WORLD_VALUE_MAP, RT_inferredFrom, VT_Composite, conceptName, annotationText, check)); + CHECK_RESULT(getCurrentContentItem().setCompositeReference(valueMap, check)); + } else + result = CMR_EC_NoMeasurement; + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::setRealWorldValueMap(DcmItem &dataset, + const OFBool check) +{ + DSRCompositeReferenceValue valueMap; + /* first, create the referenced composite object */ + OFCondition result = valueMap.setReference(dataset, check); + /* then, add/set the corresponding content item */ + CHECK_RESULT(setRealWorldValueMap(valueMap, check)); + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::setAlgorithmIdentification(const OFString &algorithmName, + const OFString &algorithmVersion, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameters */ + if (!algorithmName.empty() && !algorithmVersion.empty()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 1419 (ROI Measurements) Row 20 */ + result = getAlgorithmIdentification().setIdentification(algorithmName, algorithmVersion, check); + } else + result = CMR_EC_NoMeasurement; + } else + result = EC_IllegalParameter; + return result; +} + + +// protected methods + +template +OFCondition TID1419_ROIMeasurements_Measurement::createMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.hasSelectedValue() && numericValue.isComplete()) + { + /* reassure that the tree is definitely empty */ + if (isEmpty()) + { + /* TID 1419 (ROI Measurements) Row 5 */ + STORE_RESULT(addContentItem(RT_unknown, VT_Num, conceptName, check)); + CHECK_RESULT(getCurrentContentItem().setNumericValue(numericValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1419 - Row 5")); + GOOD_RESULT(storeEntryInNodeList(MEASUREMENT, getNodeID())); + /* TID 1419 (ROI Measurements) Row 20 */ + CHECK_RESULT(includeTemplate(AlgorithmIdentification, AM_belowCurrent, RT_hasConceptMod)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1419 - Row 20")); + GOOD_RESULT(storeEntryInNodeList(ALGORITHM_IDENTIFICATION, getNodeID())); + } else + result = SR_EC_InvalidTemplateStructure; + } + return result; +} + + +template +OFCondition TID1419_ROIMeasurements_Measurement::addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* check concept name and coded entry value */ + if (conceptName.isComplete()) + { + /* check whether content item already exists */ + if (getEntryFromNodeList(nodePos) == 0) + { + /* if not, create the content item (at correct position) */ + if (gotoLastEntryFromNodeList(this, nodePos) == getEntryFromNodeList(MEASUREMENT)) + { + /* need to add the new content item as the first child */ + if (addContentItem(relationshipType, valueType, AM_belowCurrentBeforeFirstChild) > 0) + { + if (getCurrentContentItem().setConceptName(conceptName, check).bad()) + result = SR_EC_InvalidConceptName; + } else + result = SR_EC_CannotAddContentItem; + + } else { + /* add new content item as a sibling (after the current one) */ + STORE_RESULT(addContentItem(relationshipType, valueType, conceptName)); + } + /* store ID of added node for later use */ + GOOD_RESULT(storeEntryInNodeList(nodePos, getNodeID())); + } + else if (gotoEntryFromNodeList(this, nodePos) > 0) + { + /* make sure that the value type of the existing content item is correct */ + if (getCurrentContentItem().getValueType() != valueType) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong value type"); + result = SR_EC_InvalidContentItem; + } + else if (getCurrentContentItem().getConceptName() != conceptName) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong concept name"); + result = SR_EC_InvalidConceptName; + } else { + DCMSR_CMR_DEBUG("Replacing value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ")"); + /* the actual replacing of the value is done by the caller of this method */ + } + } else + result = SR_EC_InvalidTemplateStructure; + /* finally, set annotation */ + CHECK_RESULT(getCurrentContentItem().setAnnotationText(annotationText)); + } else + result = SR_EC_InvalidConceptName; + return result; +} + + +// explicit template instantiation (needed for use in TID 1411) +template class TID1419_ROIMeasurements_Measurement; diff --git a/dcmsr/libcmr/tid1500.cc b/dcmsr/libcmr/tid1500.cc new file mode 100644 index 00000000..c3e7bc76 --- /dev/null +++ b/dcmsr/libcmr/tid1500.cc @@ -0,0 +1,460 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID1500_MeasurementReport + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid1500.h" +#include "dcmtk/dcmsr/cmr/tid15def.h" +#include "dcmtk/dcmsr/cmr/logger.h" +#include "dcmtk/dcmsr/codes/dcm.h" +#include "dcmtk/dcmsr/codes/umls.h" +#include "dcmtk/dcmsr/dsrtpltn.h" + +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// index positions in node list (makes source code more readable) +#define MEASUREMENT_REPORT 0 +#define OBSERVATION_CONTEXT 1 +#define LAST_PROCEDURE_REPORTED 2 +#define IMAGING_MEASUREMENTS 3 +#define LAST_VOLUMETRIC_ROI_MEASUREMENTS 4 +#define LAST_MEASUREMENT_GROUP 5 +#define QUALITATIVE_EVALUATIONS 6 +#define NUMBER_OF_LIST_ENTRIES 7 + +// general information on TID 1500 (Measurement Report) +#define TEMPLATE_NUMBER "1500" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFTrue /* extensible */ +#define TEMPLATE_ORDER OFFalse /* non-significant */ + + +TID1500_MeasurementReport::TID1500_MeasurementReport(const CID7021_MeasurementReportDocumentTitles &title, + const OFBool check) + : DSRRootTemplate(DT_EnhancedSR, TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID), + Language(new TID1204_LanguageOfContentItemAndDescendants()), + ObservationContext(new TID1001_ObservationContext()), + ImageLibrary(new TID1600_ImageLibrary()), + VolumetricROIMeasurements(new TID1411_Measurements()), + MeasurementGroup(new TID1501_Measurements()) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES, OFTrue /*initialize*/); + /* if specified, create an initial report */ + if (title.hasSelectedValue()) + createMeasurementReport(title, check); +} + + +void TID1500_MeasurementReport::clear() +{ + DSRRootTemplate::clear(); + Language->clear(); + ObservationContext->clear(); + ImageLibrary->clear(); + VolumetricROIMeasurements->clear(); + MeasurementGroup->clear(); +} + + +OFBool TID1500_MeasurementReport::isValid() const +{ + /* check whether base class is valid and all required content items are present */ + return DSRRootTemplate::isValid() && + Language->isValid() && ObservationContext->isValid() && ImageLibrary->isValid() && + hasProcedureReported() && (hasImagingMeasurements() || hasQualitativeEvaluations()) && + (VolumetricROIMeasurements->isEmpty() || VolumetricROIMeasurements->isValid()) && + (MeasurementGroup->isEmpty() || MeasurementGroup->isValid()); +} + + +OFBool TID1500_MeasurementReport::hasProcedureReported() const +{ + /* check for content item at TID 1500 (Measurement Report) Row 4 */ + return (getEntryFromNodeList(LAST_PROCEDURE_REPORTED) > 0); +} + + +OFBool TID1500_MeasurementReport::hasImagingMeasurements(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1500 (Measurement Report) Row 6 */ + if (gotoEntryFromNodeList(cursor, IMAGING_MEASUREMENTS) > 0) + { + /* check whether any of the "included templates" is non-empty */ + if (cursor.gotoChild()) + { + while (cursor.isValid() && (cursor.getNode()->getValueType() == VT_includedTemplate)) + { + const DSRSubTemplate *subTempl = OFstatic_cast(const DSRIncludedTemplateTreeNode *, cursor.getNode())->getValue().get(); + if (subTempl != NULL) + { + result = !subTempl->isEmpty(); + if (result) break; + } + if (cursor.gotoNext() == 0) + { + /* invalidate cursor */ + cursor.clear(); + } + } + } + } + } else { + /* check for content item at TID 1500 (Measurement Report) Row 6 */ + result = (getEntryFromNodeList(IMAGING_MEASUREMENTS) > 0); + } + return result; +} + + +OFBool TID1500_MeasurementReport::hasVolumetricROIMeasurements(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1500 (Measurement Report) Row 8 */ + if (gotoEntryFromNodeList(cursor, LAST_VOLUMETRIC_ROI_MEASUREMENTS) > 0) + { + /* check whether any of the "included TID 1411 templates" is non-empty */ + while (cursor.isValid() && (cursor.getNode()->getValueType() == VT_includedTemplate)) + { + const DSRSubTemplate *subTempl = OFstatic_cast(const DSRIncludedTemplateTreeNode *, cursor.getNode())->getValue().get(); + if (subTempl != NULL) + { + if (subTempl->compareTemplateIdentication("1411", "DCMR")) + { + result = !subTempl->isEmpty(); + if (result) break; + } else { + /* exit loop */ + break; + } + } + if (cursor.gotoPrevious() == 0) + { + /* invalidate cursor */ + cursor.clear(); + } + } + } + } else { + /* check for content item at TID 1500 (Measurement Report) Row 8 */ + result = (getEntryFromNodeList(LAST_VOLUMETRIC_ROI_MEASUREMENTS) > 0); + } + return result; +} + + +OFBool TID1500_MeasurementReport::hasIndividualMeasurements(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1500 (Measurement Report) Row 9 */ + if (gotoEntryFromNodeList(cursor, LAST_MEASUREMENT_GROUP) > 0) + { + /* check whether any of the "included TID 1501 templates" is non-empty */ + while (cursor.isValid() && (cursor.getNode()->getValueType() == VT_includedTemplate)) + { + const DSRSubTemplate *subTempl = OFstatic_cast(const DSRIncludedTemplateTreeNode *, cursor.getNode())->getValue().get(); + if (subTempl != NULL) + { + if (subTempl->compareTemplateIdentication("1501", "DCMR")) + { + result = !subTempl->isEmpty(); + if (result) break; + } else { + /* exit loop */ + break; + } + } + if (cursor.gotoPrevious() == 0) + { + /* invalidate cursor */ + cursor.clear(); + } + } + } + } else { + /* check for content item at TID 1500 (Measurement Report) Row 9 */ + result = (getEntryFromNodeList(LAST_MEASUREMENT_GROUP) > 0); + } + return result; +} + + +OFBool TID1500_MeasurementReport::hasQualitativeEvaluations(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1500 (Measurement Report) Row 12 */ + if (gotoEntryFromNodeList(cursor, QUALITATIVE_EVALUATIONS) > 0) + result = cursor.hasChildNodes(); + } else { + /* check for content item at TID 1500 (Measurement Report) Row 12 */ + result = (getEntryFromNodeList(QUALITATIVE_EVALUATIONS) > 0); + } + return result; +} + + +OFCondition TID1500_MeasurementReport::getDocumentTitle(DSRCodedEntryValue &titleCode) +{ + OFCondition result = EC_Normal; + /* go to content item at TID 1500 (Measurement Report) Row 1 */ + if (gotoEntryFromNodeList(this, MEASUREMENT_REPORT) > 0) + { + titleCode = getCurrentContentItem().getConceptName(); + } else { + /* in case of error, clear the result variable */ + titleCode.clear(); + result = SR_EC_ContentItemNotFound; + } + return result; +} + + +OFCondition TID1500_MeasurementReport::createNewMeasurementReport(const CID7021_MeasurementReportDocumentTitles &title, + const OFBool check) +{ + clear(); + /* TID 1500 (Measurement Report) Row 1 */ + return createMeasurementReport(title, check); +} + + +OFCondition TID1500_MeasurementReport::setLanguage(const CID5000_Languages &language, + const CID5001_Countries &country, + const OFBool check) +{ + /* TID 1500 (Measurement Report) Row 2 */ + return getLanguage().setLanguage(language, country, check); +} + + +OFCondition TID1500_MeasurementReport::addProcedureReported(const CID100_QuantitativeDiagnosticImagingProcedures &procedure, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* make sure that there is a coded entry */ + if (procedure.hasSelectedValue()) + { + /* go to last content item at TID 1500 (Measurement Report) Row 3 or 4 */ + if (gotoLastEntryFromNodeList(this, LAST_PROCEDURE_REPORTED, OBSERVATION_CONTEXT) > 0) + { + /* TID 1500 (Measurement Report) Row 4 */ + STORE_RESULT(addContentItem(RT_hasConceptMod, VT_Code, CODE_DCM_ProcedureReported, check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(procedure, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 4")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_PROCEDURE_REPORTED, getNodeID())); + } else + result = CMR_EC_NoMeasurementReport; + } + return result; +} + + +OFCondition TID1500_MeasurementReport::addVolumetricROIMeasurements(const OFBool checkEmpty) +{ + OFCondition result = EC_Normal; + /* go to content item at TID 1500 (Measurement Report) Row 8 */ + if (gotoEntryFromNodeList(this, LAST_VOLUMETRIC_ROI_MEASUREMENTS) > 0) + { + /* check whether the current instance of TID 1411 is non-empty (if needed) */ + if (!checkEmpty || !VolumetricROIMeasurements->isEmpty()) + { + /* create new instance of TID 1411 (Volumetric ROI Measurements) */ + TID1411_Measurements *subTempl = new TID1411_Measurements(); + if (subTempl != NULL) + { + /* store (shared) reference to new instance */ + VolumetricROIMeasurements.reset(subTempl); + /* and add it to the current template (TID 1500 - Row 8) */ + STORE_RESULT(includeTemplate(VolumetricROIMeasurements, AM_afterCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 8")); + GOOD_RESULT(storeEntryInNodeList(LAST_VOLUMETRIC_ROI_MEASUREMENTS, getNodeID())); + /* tbc: what if the call of includeTemplate() fails? */ + } else + result = EC_MemoryExhausted; + } + } else + result = CMR_EC_NoMeasurementReport; + return result; +} + + +OFCondition TID1500_MeasurementReport::addIndividualMeasurements(const OFBool checkEmpty) +{ + OFCondition result = EC_Normal; + /* go to content item at TID 1500 (Measurement Report) Row 9 */ + if (gotoEntryFromNodeList(this, LAST_MEASUREMENT_GROUP) > 0) + { + /* check whether the current instance of TID 1501 is non-empty (if needed) */ + if (!checkEmpty || !MeasurementGroup->isEmpty()) + { + /* create new instance of TID 1501 (Measurement Group) */ + TID1501_Measurements *subTempl = new TID1501_Measurements(); + if (subTempl != NULL) + { + /* store (shared) reference to new instance */ + MeasurementGroup.reset(subTempl); + /* and add it to the current template (TID 1500 - Row 9) */ + STORE_RESULT(includeTemplate(MeasurementGroup, AM_afterCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 9")); + GOOD_RESULT(storeEntryInNodeList(LAST_MEASUREMENT_GROUP, getNodeID())); + /* tbc: what if the call of includeTemplate() fails? */ + } else + result = EC_MemoryExhausted; + } + } else + result = CMR_EC_NoMeasurementReport; + return result; +} + + +OFCondition TID1500_MeasurementReport::addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* make sure that the parameters are non-empty */ + if (conceptName.isComplete() && codeValue.isComplete()) + { + /* create content item at TID 1500 (Measurement Report) Row 12 if not existing */ + result = createQualitativeEvaluations(); + /* go to content item at TID 1500 (Measurement Report) Row 12 */ + if (gotoEntryFromNodeList(this, QUALITATIVE_EVALUATIONS) > 0) + { + /* TID 1500 (Measurement Report) Row 13 */ + CHECK_RESULT(addChildContentItem(RT_contains, VT_Code, conceptName, check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(codeValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 13")); + } else + result = CMR_EC_NoMeasurementReport; + } + return result; +} + + +OFCondition TID1500_MeasurementReport::addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* make sure that the parameters are non-empty */ + if (conceptName.isComplete() && !stringValue.empty()) + { + /* create content item at TID 1500 (Measurement Report) Row 12 if not existing */ + result = createQualitativeEvaluations(); + /* go to content item at TID 1500 (Measurement Report) Row 12 */ + if (gotoEntryFromNodeList(this, QUALITATIVE_EVALUATIONS) > 0) + { + /* TID 1500 (Measurement Report) Row 14 */ + CHECK_RESULT(addChildContentItem(RT_contains, VT_Text, conceptName, check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(stringValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 14")); + } else + result = CMR_EC_NoMeasurementReport; + } + return result; +} + + +// protected methods + +OFCondition TID1500_MeasurementReport::createMeasurementReport(const CID7021_MeasurementReportDocumentTitles &title, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* make sure that there is a coded entry */ + if (title.hasSelectedValue()) + { + /* reassure that the report is definitely empty */ + if (isEmpty()) + { + /* TID 1500 (Measurement Report) Row 1 */ + STORE_RESULT(addContentItem(RT_isRoot, VT_Container, title, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 1")); + /* store ID of root node for later use */ + GOOD_RESULT(storeEntryInNodeList(MEASUREMENT_REPORT, getNodeID())); + /* TID 1500 (Measurement Report) Row 2 */ + CHECK_RESULT(includeTemplate(Language, AM_belowCurrent, RT_hasConceptMod)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 2")); + /* TID 1500 (Measurement Report) Row 3 */ + CHECK_RESULT(includeTemplate(ObservationContext, AM_afterCurrent, RT_hasObsContext)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 3")); + GOOD_RESULT(storeEntryInNodeList(OBSERVATION_CONTEXT, getNodeID())); + /* TID 1500 (Measurement Report) Row 5 */ + CHECK_RESULT(includeTemplate(ImageLibrary, AM_afterCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 5")); + /* TID 1500 (Measurement Report) Row 6 */ + CHECK_RESULT(addContentItem(RT_contains, VT_Container, CODE_DCM_ImagingMeasurements)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 6")); + GOOD_RESULT(storeEntryInNodeList(IMAGING_MEASUREMENTS, getNodeID())); + /* TID 1500 (Measurement Report) Row 8 */ + CHECK_RESULT(includeTemplate(VolumetricROIMeasurements, AM_belowCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 8")); + GOOD_RESULT(storeEntryInNodeList(LAST_VOLUMETRIC_ROI_MEASUREMENTS, getNodeID())); + /* TID 1500 (Measurement Report) Row 9 */ + CHECK_RESULT(includeTemplate(MeasurementGroup, AM_afterCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 9")); + GOOD_RESULT(storeEntryInNodeList(LAST_MEASUREMENT_GROUP, getNodeID())); + /* if anything went wrong, clear the report */ + BAD_RESULT(clear()); + } else + result = SR_EC_InvalidTemplateStructure; + } + return result; +} + + +OFCondition TID1500_MeasurementReport::createQualitativeEvaluations() +{ + OFCondition result = EC_Normal; + /* check whether content item at TID 1500 (Measurement Report) Row 12 already exists */ + if (!hasQualitativeEvaluations()) + { + /* if not, go to the preceding content item, which always exists */ + if (gotoEntryFromNodeList(this, IMAGING_MEASUREMENTS) > 0) + { + /* ... and add TID 1500 (Measurement Report) Row 12 */ + STORE_RESULT(addContentItem(RT_contains, VT_Container, CODE_UMLS_QualitativeEvaluations)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1500 - Row 12")); + GOOD_RESULT(storeEntryInNodeList(QUALITATIVE_EVALUATIONS, getNodeID())); + } else + result = CMR_EC_NoMeasurementReport; + } + return result; +} diff --git a/dcmsr/libcmr/tid1501.cc b/dcmsr/libcmr/tid1501.cc new file mode 100644 index 00000000..e419ca6e --- /dev/null +++ b/dcmsr/libcmr/tid1501.cc @@ -0,0 +1,599 @@ +/* + * + * Copyright (C) 2017-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID1501_MeasurementGroup + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid1501.h" +#include "dcmtk/dcmsr/cmr/tid15def.h" +#include "dcmtk/dcmsr/cmr/logger.h" +#include "dcmtk/dcmsr/codes/dcm.h" +#include "dcmtk/dcmsr/codes/ncit.h" +#include "dcmtk/dcmsr/codes/sct.h" +#include "dcmtk/dcmsr/codes/umls.h" +#include "dcmtk/dcmsr/dsrtpltn.h" + +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// index positions in node list (makes source code more readable) +#define MEASUREMENT_GROUP 0 +#define ACTIVITY_SESSION 1 +#define TRACKING_IDENTIFIER 2 +#define TRACKING_UNIQUE_IDENTIFIER 3 +#define FINDING 4 +#define TIME_POINT 5 +#define MEASUREMENT_METHOD 6 +#define LAST_FINDING_SITE 7 +#define REAL_WORLD_VALUE_MAP 8 +#define LAST_MEASUREMENT 9 +#define LAST_QUALITATIVE_EVALUATION 10 +#define NUMBER_OF_LIST_ENTRIES 11 + +// general information on TID 1501 (Measurement Group) +#define TEMPLATE_NUMBER "1501" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFTrue /* extensible */ +#define TEMPLATE_ORDER OFFalse /* non-significant */ + + +template +TID1501_MeasurementGroup::TID1501_MeasurementGroup(const OFBool createGroup) + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID), + Measurement(new TID300_Measurement()) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES, OFTrue /*initialize*/); + /* TID 1501 (Measurement Group) Row 1 */ + if (createGroup) + createMeasurementGroup(); +} + + +template +void TID1501_MeasurementGroup::clear() +{ + DSRSubTemplate::clear(); + Measurement->clear(); +} + + +template +OFBool TID1501_MeasurementGroup::isValid() const +{ + /* check whether base class is valid and all required content items are present */ + return DSRSubTemplate::isValid() && + hasMeasurementGroup() && hasTrackingIdentifier() && hasTrackingUniqueIdentifier() && + hasMeasurements(OFTrue /*checkChildren*/); +} + + +template +OFBool TID1501_MeasurementGroup::hasMeasurementGroup(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1501 (Measurement Group) Row 1 */ + if (gotoEntryFromNodeList(cursor, MEASUREMENT_GROUP) > 0) + result = cursor.hasChildNodes(); + } else { + /* check for content item at TID 1501 (Measurement Group) Row 1 */ + result = (getEntryFromNodeList(MEASUREMENT_GROUP) > 0); + } + return result; +} + + +template +OFBool TID1501_MeasurementGroup::hasTrackingIdentifier() const +{ + /* check for content item at TID 1501 (Measurement Group) Row 2 */ + return (getEntryFromNodeList(TRACKING_IDENTIFIER) > 0); +} + + +template +OFBool TID1501_MeasurementGroup::hasTrackingUniqueIdentifier() const +{ + /* check for content item at TID 1501 (Measurement Group) Row 3 */ + return (getEntryFromNodeList(TRACKING_UNIQUE_IDENTIFIER) > 0); +} + + +template +OFBool TID1501_MeasurementGroup::hasMeasurements(const OFBool checkChildren) const +{ + OFBool result = OFFalse; + /* need to check for child nodes? */ + if (checkChildren) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* go to content item at TID 1501 (Measurement Group) Row 10 */ + if (gotoEntryFromNodeList(cursor, LAST_MEASUREMENT) > 0) + { + /* check whether any of the "included TID 300 templates" is non-empty */ + while (cursor.isValid() && (cursor.getNode()->getValueType() == VT_includedTemplate)) + { + const DSRSubTemplate *subTempl = OFstatic_cast(const DSRIncludedTemplateTreeNode *, cursor.getNode())->getValue().get(); + if (subTempl != NULL) + { + if (subTempl->compareTemplateIdentication("300", "DCMR")) + { + result = !subTempl->isEmpty(); + if (result) break; + } else { + /* exit loop */ + break; + } + } + if (cursor.gotoPrevious() == 0) + { + /* invalidate cursor */ + cursor.clear(); + } + } + } + } else { + /* check for content item at TID 1501 (Measurement Group) Row 10 */ + result = (getEntryFromNodeList(LAST_MEASUREMENT) > 0); + } + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setActivitySession(const OFString &session, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!session.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1501 (Measurement Group) Row 1b */ + CHECK_RESULT(addOrReplaceContentItem(ACTIVITY_SESSION, RT_hasObsContext, VT_Text, CODE_NCIt_ActivitySession, "TID 1501 - Row 1b", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(session, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setTrackingIdentifier(const OFString &trackingID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!trackingID.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1501 (Measurement Group) Row 2 */ + CHECK_RESULT(addOrReplaceContentItem(TRACKING_IDENTIFIER, RT_hasObsContext, VT_Text, CODE_DCM_TrackingIdentifier, "TID 1501 - Row 2", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(trackingID, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setTrackingUniqueIdentifier(const OFString &trackingUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!trackingUID.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1501 (Measurement Group) Row 3 */ + CHECK_RESULT(addOrReplaceContentItem(TRACKING_UNIQUE_IDENTIFIER, RT_hasObsContext, VT_UIDRef, CODE_DCM_TrackingUniqueIdentifier, "TID 1501 - Row 3", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(trackingUID, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setFinding(const DSRCodedEntryValue &finding, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (finding.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1501 (Measurement Group) Row 3b */ + CHECK_RESULT(addOrReplaceContentItem(FINDING, RT_contains, VT_Code, CODE_DCM_Finding, "TID 1501 - Row 3b", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(finding, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setTimePoint(const OFString &timePoint, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!timePoint.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1502 (Time Point Context) Row 3 */ + CHECK_RESULT(addOrReplaceContentItem(TIME_POINT, RT_hasObsContext, VT_Text, CODE_UMLS_TimePoint, "TID 1502 - Row 3", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(timePoint, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setMeasurementMethod(const T_Method &method, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (method.hasSelectedValue()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 1501 (Measurement Group) Row 5 */ + CHECK_RESULT(addOrReplaceContentItem(MEASUREMENT_METHOD, RT_hasConceptMod, VT_Code, CODE_SCT_MeasurementMethod, "TID 1501 - Row 5", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(method, check)); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality, + const DSRCodedEntryValue &siteModifier, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of mandatory parameter */ + if (site.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* 1501 (Measurement Group) Row 6 */ + CHECK_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_FindingSite, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(site, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1501 - Row 6")); + const size_t lastNode = subTree->getNodeID(); + /* 1501 (Measurement Group) Row 7 - optional */ + if (laterality.hasSelectedValue()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_Laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1501 - Row 7")); + GOOD_RESULT(subTree->gotoParent()); + } + /* 1501 (Measurement Group) Row 8 - optional */ + if (siteModifier.isComplete()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_TopographicalModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(siteModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1501 - Row 8")); + GOOD_RESULT(subTree->gotoParent()); + } + /* if everything was OK, insert new subtree into the template */ + if (result.good() && !subTree->isEmpty()) + { + /* go to last measurement (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_FINDING_SITE) > 0) + { + /* insert subtree at current position */ + STORE_RESULT(insertSubTree(subTree, AM_afterCurrent)); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_FINDING_SITE, lastNode)); + } else { + /* should never happen but ... */ + result = CMR_EC_NoMeasurementGroup; + } + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); + } else { + /* delete the new subtree since it has not been inserted */ + delete subTree; + } + } else + result = EC_MemoryExhausted; + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (valueMap.isComplete()) + { + const char *annotationText = "TID 1501 - Row 9"; + const DSRBasicCodedEntry conceptName(CODE_DCM_RealWorldValueMapUsedForMeasurement); + /* check for real world value mapping SOP classes */ + if (valueMap.getSOPClassUID() != UID_RealWorldValueMappingStorage) + { + DCMSR_CMR_WARN("Cannot set value of '" << conceptName.CodeMeaning << "' content item (" << annotationText << ") ... wrong SOP Class"); + DCMSR_CMR_DEBUG("SOP Class UID \"" << valueMap.getSOPClassUID() << "\" does not match the one of the Real World Value Mapping object"); + result = CMR_EC_InvalidRealWorldValueMappingObject; + } else { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + /* TID 15011 (Measurement Group) Row 9 */ + CHECK_RESULT(addOrReplaceContentItem(REAL_WORLD_VALUE_MAP, RT_contains, VT_Composite, conceptName, annotationText, check)); + CHECK_RESULT(getCurrentContentItem().setCompositeReference(valueMap, check)); + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::setRealWorldValueMap(DcmItem &dataset, + const OFBool check) +{ + DSRCompositeReferenceValue valueMap; + /* first, create the referenced composite object */ + OFCondition result = valueMap.setReference(dataset, check); + /* then, add/set the corresponding content item */ + CHECK_RESULT(setRealWorldValueMap(valueMap, check)); + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::addMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool checkEmpty, + const OFBool checkValue) +{ + OFCondition result = EC_Normal; + /* basic check of mandatory parameters */ + if (conceptName.hasSelectedValue() && numericValue.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* go to content item at TID 1501 (Measurement Report) Row 10 */ + if (gotoEntryFromNodeList(this, LAST_MEASUREMENT) > 0) + { + /* check whether the current instance of TID 300 is non-empty (if needed) */ + if (checkEmpty && Measurement->isEmpty()) + result = getMeasurement().createNewMeasurement(conceptName, numericValue, checkValue); + else { + /* create new instance of TID 300 (Measurement) */ + TID300_Measurement *subTempl = new TID300_Measurement(conceptName, numericValue, checkValue); + if (subTempl != NULL) + { + /* store (shared) reference to new instance */ + Measurement.reset(subTempl); + /* and add it to the current template (TID 1501 - Row 10) */ + STORE_RESULT(includeTemplate(Measurement, AM_afterCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1501 - Row 10")); + GOOD_RESULT(storeEntryInNodeList(LAST_MEASUREMENT, getNodeID())); + /* tbc: what if the call of includeTemplate() fails? */ + } else + result = EC_MemoryExhausted; + } + } else + result = CMR_EC_NoMeasurementGroup; + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* make sure that the parameters are non-empty */ + if (conceptName.isComplete() && codeValue.isComplete()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* go to last qualitative evaluation (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_QUALITATIVE_EVALUATION) == getEntryFromNodeList(MEASUREMENT_GROUP)) + { + /* insert TID 1501 (Measurement Group) Row 11 below root */ + STORE_RESULT(addChildContentItem(RT_contains, VT_Code, conceptName, check)); + } else { + /* insert TID 1501 (Measurement Group) Row 11 after current position */ + STORE_RESULT(addContentItem(RT_contains, VT_Code, conceptName, check)); + } + CHECK_RESULT(getCurrentContentItem().setCodeValue(codeValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1501 - Row 11")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_QUALITATIVE_EVALUATION, getNodeID())); + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::addQualitativeEvaluation(const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* make sure that the parameters are non-empty */ + if (conceptName.isComplete() && !stringValue.empty()) + { + /* check whether measurement group already exists */ + if (!hasMeasurementGroup()) + result = createMeasurementGroup(); + if (result.good()) + { + /* go to last qualitative evaluation (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_QUALITATIVE_EVALUATION) == getEntryFromNodeList(MEASUREMENT_GROUP)) + { + /* insert TID 1501 (Measurement Group) Row 12 below root */ + STORE_RESULT(addChildContentItem(RT_contains, VT_Text, conceptName, check)); + } else { + /* insert TID 1501 (Measurement Group) Row 12 after current position */ + STORE_RESULT(addContentItem(RT_contains, VT_Text, conceptName, check)); + } + CHECK_RESULT(getCurrentContentItem().setStringValue(stringValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1501 - Row 12")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_QUALITATIVE_EVALUATION, getNodeID())); + } + } else + result = EC_IllegalParameter; + return result; +} + + +// protected methods + +template +OFCondition TID1501_MeasurementGroup::createMeasurementGroup() +{ + OFCondition result = SR_EC_InvalidTemplateStructure; + /* reassure that the tree is definitely empty */ + if (isEmpty()) + { + /* TID 1501 (Measurement Group) Row 1 */ + STORE_RESULT(addContentItem(RT_unknown, VT_Container, CODE_DCM_MeasurementGroup)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1501 - Row 1")); + GOOD_RESULT(storeEntryInNodeList(MEASUREMENT_GROUP, getNodeID())); + /* TID 1501 (Measurement) Row 10 */ + CHECK_RESULT(includeTemplate(Measurement, AM_belowCurrent, RT_contains)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1501 - Row 10")); + GOOD_RESULT(storeEntryInNodeList(LAST_MEASUREMENT, getNodeID())); + /* if anything went wrong, clear the report */ + BAD_RESULT(clear()); + } + return result; +} + + +template +OFCondition TID1501_MeasurementGroup::addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* check concept name and coded entry value */ + if (conceptName.isComplete()) + { + /* check whether content item already exists */ + if (getEntryFromNodeList(nodePos) == 0) + { + /* if not, create the content item (at correct position) */ + if (gotoLastEntryFromNodeList(this, nodePos) == getEntryFromNodeList(MEASUREMENT_GROUP)) + { + /* need to add the new content item as the first child */ + if (addContentItem(relationshipType, valueType, AM_belowCurrentBeforeFirstChild) > 0) + { + if (getCurrentContentItem().setConceptName(conceptName, check).bad()) + result = SR_EC_InvalidConceptName; + } else + result = SR_EC_CannotAddContentItem; + + } else { + /* add new content item as a sibling (after the current one) */ + STORE_RESULT(addContentItem(relationshipType, valueType, conceptName)); + } + /* store ID of added node for later use */ + GOOD_RESULT(storeEntryInNodeList(nodePos, getNodeID())); + } + else if (gotoEntryFromNodeList(this, nodePos) > 0) + { + /* make sure that the value type of the existing content item is correct */ + if (getCurrentContentItem().getValueType() != valueType) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong value type"); + result = SR_EC_InvalidContentItem; + } + else if (getCurrentContentItem().getConceptName() != conceptName) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong concept name"); + result = SR_EC_InvalidConceptName; + } else { + DCMSR_CMR_DEBUG("Replacing value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ")"); + /* the actual replacing of the value is done by the caller of this method */ + } + } else + result = SR_EC_InvalidTemplateStructure; + /* finally, set annotation */ + CHECK_RESULT(getCurrentContentItem().setAnnotationText(annotationText)); + } else + result = SR_EC_InvalidConceptName; + return result; +} + + +// explicit template instantiation (needed for use in TID 1500) +template class TID1501_MeasurementGroup; diff --git a/dcmsr/libcmr/tid15def.cc b/dcmsr/libcmr/tid15def.cc new file mode 100644 index 00000000..7a4fe511 --- /dev/null +++ b/dcmsr/libcmr/tid15def.cc @@ -0,0 +1,24 @@ +/* + * + * Copyright (C) 2016-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for common error constants used in TID 14xx/15xx + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid15def.h" +#include "dcmtk/dcmdata/dcerror.h" + + +// conditions constants +makeOFConditionConst(CMR_EC_NoMeasurementReport, OFM_dcmsr, 1500, OF_error, "No Measurement Report"); +makeOFConditionConst(CMR_EC_NoMeasurementGroup, OFM_dcmsr, 1501, OF_error, "No Measurement Group"); +makeOFConditionConst(CMR_EC_NoMeasurement, OFM_dcmsr, 1502, OF_error, "No Measurement"); +makeOFConditionConst(CMR_EC_InvalidSegmentationObject, OFM_dcmsr, 1503, OF_error, "Invalid Segmentation Object"); +makeOFConditionConst(CMR_EC_InvalidRealWorldValueMappingObject, OFM_dcmsr, 1504, OF_error, "Invalid Real World Value Mapping Object"); diff --git a/dcmsr/libcmr/tid1600.cc b/dcmsr/libcmr/tid1600.cc new file mode 100644 index 00000000..8436a7c9 --- /dev/null +++ b/dcmsr/libcmr/tid1600.cc @@ -0,0 +1,1180 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID1600_ImageLibrary + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid1600.h" +#include "dcmtk/dcmsr/cmr/cid29e.h" +#include "dcmtk/dcmsr/cmr/cid244e.h" +#include "dcmtk/dcmsr/cmr/cid4031e.h" +#include "dcmtk/dcmsr/cmr/cid10013e.h" +#include "dcmtk/dcmsr/cmr/cid10033e.h" +#include "dcmtk/dcmsr/cmr/logger.h" +#include "dcmtk/dcmsr/codes/dcm.h" +#include "dcmtk/dcmsr/codes/sct.h" +#include "dcmtk/dcmsr/codes/ucum.h" +#include "dcmtk/dcmsr/dsrdattn.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// index positions in node list (makes source code more readable) +#define IMAGE_LIBRARY 0 +#define LAST_IMAGE_LIBRARY_GROUP 1 +#define LAST_IMAGE_LIBRARY_ENTRY 2 +#define NUMBER_OF_LIST_ENTRIES 3 + +// general information on TID 1600 (Image Library) +#define TEMPLATE_NUMBER "1600" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFTrue /* extensible */ +#define TEMPLATE_ORDER OFFalse /* non-significant */ + + +// conditions constants +makeOFConditionConst(CMR_EC_NoImageLibrary, OFM_dcmsr, 1600, OF_error, "No Image Library"); +makeOFConditionConst(CMR_EC_NoImageLibraryGroup, OFM_dcmsr, 1601, OF_error, "No Image Library Group"); +makeOFConditionConst(CMR_EC_NoImageLibraryEntry, OFM_dcmsr, 1602, OF_error, "No Image Library Entry"); +makeOFConditionConst(CMR_EC_CannotAddMultipleImageLibraryGroupDescriptors, OFM_dcmsr, 1603, OF_error, "Cannot add multiple Image Library Group Descriptors"); +makeOFConditionConst(CMR_EC_MissingImageLibraryEntryDescriptorModality, OFM_dcmsr, 1604, OF_error, "Missing Image Library Entry Descriptor 'Modality'"); +makeOFConditionConst(CMR_EC_WrongImageLibraryEntryDescriptorModality, OFM_dcmsr, 1605, OF_error, "Wrong Image Library Entry Descriptor 'Modality'"); +makeOFConditionConst(CMR_EC_NoImageLibraryEntryDescriptorsToBeAdded, OFM_dcmsr, 1606, OF_ok, "No Image Library Entry Descriptors to be added"); +makeOFConditionConst(CMR_EC_NoImageLibraryEntryDescriptorsToBeMoved, OFM_dcmsr, 1607, OF_ok, "No Image Library Entry Descriptors to be moved"); + + +TID1600_ImageLibrary::TID1600_ImageLibrary(const OFBool createLibrary) + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES); + /* TID 1600 (Image Library) Row 1 */ + if (createLibrary) + createImageLibrary(); +} + + +OFBool TID1600_ImageLibrary::isValid() const +{ + /* check whether base class is valid and image library exists */ + return DSRSubTemplate::isValid() && hasImageLibrary(); +} + + +OFBool TID1600_ImageLibrary::hasImageLibrary() const +{ + /* check for image library (TID 1600 - Row 1) */ + return (getEntryFromNodeList(IMAGE_LIBRARY) > 0); +} + + +OFBool TID1600_ImageLibrary::hasImageLibraryGroup() const +{ + /* check for image library group (TID 1600 - Row 2) */ + return (getEntryFromNodeList(LAST_IMAGE_LIBRARY_GROUP) > 0); +} + + +OFCondition TID1600_ImageLibrary::createNewImageLibrary() +{ + clear(); + /* TID 1600 (Image Library) Row 1 */ + return createImageLibrary(); +} + + +OFCondition TID1600_ImageLibrary::addImageGroup() +{ + OFCondition result = CMR_EC_NoImageLibrary; + /* check whether image library exists */ + if (hasImageLibrary()) + { + /* go to last image library group (if any) */ + if (gotoEntryFromNodeList(this, LAST_IMAGE_LIBRARY_GROUP) > 0) + { + /* TID 1600 (Image Library) Row 2, append to last group */ + STORE_RESULT(addContentItem(RT_contains, VT_Container, CODE_DCM_ImageLibraryGroup)); + } + /* go to image library (root node) */ + else if (gotoEntryFromNodeList(this, IMAGE_LIBRARY) > 0) + { + /* TID 1600 (Image Library) Row 2, create first group (child) */ + STORE_RESULT(addChildContentItem(RT_contains, VT_Container, CODE_DCM_ImageLibraryGroup)); + } else { + /* should never happen but ... */ + result = SR_EC_InvalidTemplateStructure; + } + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1600 - Row 2")); + /* store ID of recently added node for later use */ + if (result.good()) + { + storeEntryInNodeList(LAST_IMAGE_LIBRARY_GROUP, getNodeID()); + storeEntryInNodeList(LAST_IMAGE_LIBRARY_ENTRY, 0 /* forget last entry */); + } + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addImageEntry(DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = CMR_EC_NoImageLibraryGroup; + /* check whether image library group exists */ + if (hasImageLibraryGroup()) + { + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *tid1601 = new DSRDocumentSubTree; + if (tid1601 != NULL) + { + DSRImageReferenceValue imageRef; + /* TID 1601 (Image Library Entry) Row 1 */ + STORE_RESULT(tid1601->addContentItem(RT_contains, VT_Image, DSRCodedEntryValue(), check)); + CHECK_RESULT(imageRef.setReference(dataset, check)); + CHECK_RESULT(tid1601->getCurrentContentItem().setImageReference(imageRef, check)); + CHECK_RESULT(tid1601->getCurrentContentItem().setAnnotationText("TID 1601 - Row 1")); + const size_t lastNode = tid1601->getNodeID(); + /* TID 1601 (Image Library Entry) Row 2 */ + if (anyDescriptorsToBeAdded(mode, descriptors)) + { + /* create a new subtree for TID 1602 (Image Library Entry Descriptors) */ + DSRDocumentSubTree *tid1602 = new DSRDocumentSubTree; + if (tid1602 != NULL) + { + /* call the function doing the real work */ + STORE_RESULT(addImageEntryDescriptors(*tid1602, dataset, mode, descriptors, check)); + /* if everything was OK, insert new subtree into the template */ + if (result.good() && !tid1602->isEmpty()) + { + /* insert subtree below current node */ + STORE_RESULT(tid1601->insertSubTree(tid1602)); + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete tid1602); + } else { + CHECK_RESULT(CMR_EC_NoImageLibraryEntryDescriptorsToBeAdded); + /* delete the new subtree since it has not been inserted */ + delete tid1602; + } + } else + result = EC_MemoryExhausted; + } + /* if everything was OK, insert new subtree into the template */ + if (result.good()) + { + E_AddMode addMode = AM_afterCurrent; + /* go to last image library entry (if any) */ + if (gotoEntryFromNodeList(this, LAST_IMAGE_LIBRARY_ENTRY) > 0) + addMode = AM_afterCurrent; + /* go to last image library group */ + else if (gotoEntryFromNodeList(this, LAST_IMAGE_LIBRARY_GROUP) > 0) + addMode = AM_belowCurrent; + else { + /* should never happen but ... */ + result = CMR_EC_NoImageLibraryGroup; + } + /* there is at least an image library group */ + if (result.good()) + { + /* insert subtree at current position */ + STORE_RESULT(insertSubTree(tid1601, addMode)); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_IMAGE_LIBRARY_ENTRY, lastNode)); + } + } + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete tid1601); + } else + result = EC_MemoryExhausted; + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addImageGroupDescriptors(DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = CMR_EC_NoImageLibraryGroup; + /* check whether image library group exists */ + if (hasImageLibraryGroup()) + { + /* check whether there are any descriptors to be added (at all) */ + if (anyDescriptorsToBeAdded(mode, descriptors)) + { + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* call the function doing the real work */ + STORE_RESULT(addImageEntryDescriptors(*subTree, dataset, mode, descriptors, check)); + /* if everything was OK, insert new subtree into the template */ + if (result.good() && !subTree->isEmpty()) + { + /* go to last image library group (if any) */ + if (gotoEntryFromNodeList(this, LAST_IMAGE_LIBRARY_GROUP) > 0) + { + /* check whether TID 1600 (Image Library) Row 3 is already there */ + const DSRDocumentTreeNode *childNode = getChildNode(); + if ((childNode != NULL) && (childNode->getRelationshipType() == RT_hasAcqContext)) + { + /* only a single invocation of the included template allowed */ + result = CMR_EC_CannotAddMultipleImageLibraryGroupDescriptors; + } else { + /* insert subtree at current position */ + STORE_RESULT(insertSubTree(subTree, AM_belowCurrentBeforeFirstChild)); + } + } else { + /* should never happen but ... */ + result = CMR_EC_NoImageLibraryGroup; + } + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); + } else { + CHECK_RESULT(CMR_EC_NoImageLibraryEntryDescriptorsToBeAdded); + /* delete the new subtree since it has not been inserted */ + delete subTree; + } + } else + result = EC_MemoryExhausted; + } else { + /* the combination of 'mode' and 'descriptors' parameter makes no sense */ + result = EC_IllegalParameter; + } + } + return result; +} + + +OFCondition TID1600_ImageLibrary::getImageEntryModality(DSRCodedEntryValue &modalityCode) +{ + OFCondition result = CMR_EC_NoImageLibraryEntry; + /* go to last image library entry (if any) */ + if (gotoEntryFromNodeList(this, LAST_IMAGE_LIBRARY_ENTRY) > 0) + { + /* get value of TID 1602 (Image Library Entry Descriptors) Row 1 */ + if ((gotoNamedChildNode(CODE_DCM_Modality) > 0)) + { + modalityCode = getCurrentContentItem().getCodeValue(); + result = EC_Normal; + } else + result = CMR_EC_MissingImageLibraryEntryDescriptorModality; + } + /* in case of error, clear the result variable */ + BAD_RESULT(modalityCode.clear()); + return result; +} + + +OFCondition TID1600_ImageLibrary::moveCommonImageDescriptorsToImageGroups() +{ + OFCondition result = CMR_EC_NoImageLibrary; + /* go to image library (root node) */ + DSRDocumentTreeNodeCursor groupCursor(getRoot()); + if (groupCursor.isValid()) + { + DCMSR_CMR_DEBUG("Moving common image descriptors to image library groups (TID 1600)"); + /* counter for moved image descriptors and image groups */ + size_t movedDescriptors = 0; + size_t groupCounter = 0; + const DSRDocumentTreeNodeConceptNameFilter groupFilter(CODE_DCM_ImageLibraryGroup); + /* go to the first child (if any) and check for image library group */ + if (groupCursor.gotoChild() && groupCursor.gotoMatchingNode(groupFilter, OFFalse /*searchIntoSub*/)) + { + result = EC_Normal; + /* iterate over all image library groups */ + do { + ++groupCounter; + DSRDocumentTreeNodeCursor imageCursor(groupCursor); + const DSRDocumentTreeNodeValueTypeFilter imageFilter(VT_Image); + /* go to the first child (if any) and check for image library entry */ + if (imageCursor.gotoChild() && imageCursor.gotoMatchingNode(imageFilter, OFFalse /*searchIntoSub*/)) + { + DSRDocumentSubTree *subTree = NULL; + /* iterate over all image library entries */ + do { + DSRDocumentTreeNodeCursor childCursor(imageCursor); + if (childCursor.gotoChild()) + { + if (subTree != NULL) + { + size_t nodeID = subTree->gotoRoot(); + /* check whether there are any common descriptors */ + if (nodeID > 0) + { + while (nodeID > 0) + { + DSRDocumentTreeNodeCursor cursor(childCursor); + /* if not found, remove it from the list */ + if (!cursor.gotoNode(*subTree->getCurrentNode())) + nodeID = subTree->removeCurrentContentItem(); + else + nodeID = subTree->gotoNext(); + } + } else { + /* nothing to compare, so exit the loop */ + break; + } + } else { + /* create a copy of the subtree (starting from the first child) */ + subTree = DSRDocumentSubTree::cloneSubTree(childCursor, imageCursor.getNodeID()); + } + } else { + /* no image descriptors for this entry, so clear the list and exit the loop */ + if (subTree != NULL) + subTree->clear(); + break; + } + } while (imageCursor.gotoNextMatchingNode(imageFilter, OFFalse /*searchIntoSub*/)); + /* if there are any common descriptors ... */ + if (subTree != NULL) + { + DCMSR_CMR_DEBUG(" Found " << subTree->countNodes() << " common image descriptors in image library group #" << groupCounter); + if (!subTree->isEmpty()) + { + const DSRDocumentTreeNodeCursor oldCursor(getCursor()); + /* remove them from the respective image library entries */ + imageCursor = groupCursor; + if (imageCursor.gotoChild() && imageCursor.gotoMatchingNode(imageFilter, OFFalse /*searchIntoSub*/)) + { + /* iterate over all image library entries */ + do { + if (subTree->gotoRoot()) + { + do { + /* go to the matching node (if any) */ + setCursor(imageCursor); + if (gotoChild()) + { + if (gotoNode(*subTree->getCurrentNode(), OFFalse /*startFromRoot*/)) + { + /* and remove it from the tree */ + removeCurrentContentItem(); + ++movedDescriptors; + } + } else { + /* nothing to compare, so exit the loop */ + break; + } + } while (subTree->gotoNext()); + } + } while (imageCursor.gotoNextMatchingNode(imageFilter, OFFalse /*searchIntoSub*/)); + } + /* and, finally, insert common descriptors to image library group */ + setCursor(groupCursor); + STORE_RESULT(insertSubTree(subTree, AM_belowCurrentBeforeFirstChild, RT_unknown /*defaultRelType*/, OFTrue /*deleteIfFail*/)); + /* reset cursor (to old position) */ + setCursor(oldCursor); + } else { + /* free memory */ + delete subTree; + } + } else + DCMSR_CMR_DEBUG(" No descriptors on image level, skipping image library group #" << groupCounter); + } + } while (result.good() && groupCursor.gotoNextMatchingNode(groupFilter, OFFalse /*searchIntoSub*/)); + /* check whether any descriptors have been moved */ + if (movedDescriptors > 0) + DCMSR_CMR_DEBUG("Moved a total of " << movedDescriptors << " image descriptors to image group level"); + else + result = CMR_EC_NoImageLibraryEntryDescriptorsToBeMoved; + } else + result = CMR_EC_NoImageLibraryGroup; + } + return result; +} + + +// set methods + +OFCondition TID1600_ImageLibrary::setPETImageRadionuclide(const CID4020_PETRadionuclide &radionuclide, + const OFBool check) +{ + /* remember current node */ + const DSRDocumentTreeNodeCursor cursor(getCursor()); + /* go to image library entry and check for expected modality */ + OFCondition result = goAndCheckImageLibraryEntry(CODE_DCM_PositronEmissionTomography); + /* set content item value (and add a new content item if needed) */ + CHECK_RESULT(setCodeContentItemFromValue(CODE_SCT_Radionuclide, radionuclide, "TID 1607 - Row 1", check)); + /* in case of error, reset cursor to stored node */ + BAD_RESULT(setCursor(cursor)); + return result; +} + + +OFCondition TID1600_ImageLibrary::setPETImageRadiopharmaceuticalAgent(const CID4021_PETRadiopharmaceutical &agent, + const OFBool check) +{ + /* remember current node */ + const DSRDocumentTreeNodeCursor cursor(getCursor()); + /* go to image library entry and check for expected modality */ + OFCondition result = goAndCheckImageLibraryEntry(CODE_DCM_PositronEmissionTomography); + /* set content item value (and add a new content item if needed) */ + CHECK_RESULT(setCodeContentItemFromValue(CODE_SCT_RadiopharmaceuticalAgent, agent, "TID 1607 - Row 2", check)); + /* in case of error, reset cursor to stored node */ + BAD_RESULT(setCursor(cursor)); + return result; +} + + +OFCondition TID1600_ImageLibrary::setPETImageRadiopharmaceuticalStartDateTime(const OFString &dateTime, + const OFBool check) +{ + /* remember current node */ + const DSRDocumentTreeNodeCursor cursor(getCursor()); + /* go to image library entry and check for expected modality */ + OFCondition result = goAndCheckImageLibraryEntry(CODE_DCM_PositronEmissionTomography); + /* set content item value (and add a new content item if needed) */ + CHECK_RESULT(setStringContentItemFromValue(VT_DateTime, CODE_DCM_RadiopharmaceuticalStartDateTime, dateTime, "TID 1607 - Row 4", check)); + /* in case of error, reset cursor to stored node */ + BAD_RESULT(setCursor(cursor)); + return result; +} + + +OFCondition TID1600_ImageLibrary::setPETImageRadiopharmaceuticalStopDateTime(const OFString &dateTime, + const OFBool check) +{ + /* remember current node */ + const DSRDocumentTreeNodeCursor cursor(getCursor()); + /* go to image library entry and check for expected modality */ + OFCondition result = goAndCheckImageLibraryEntry(CODE_DCM_PositronEmissionTomography); + /* set content item value (and add a new content item if needed) */ + CHECK_RESULT(setStringContentItemFromValue(VT_DateTime, CODE_DCM_RadiopharmaceuticalStopDateTime, dateTime, "TID 1607 - Row 5", check)); + /* in case of error, reset cursor to stored node */ + BAD_RESULT(setCursor(cursor)); + return result; +} + + +OFCondition TID1600_ImageLibrary::setPETImageRadiopharmaceuticalVolume(const CMR_SRNumericMeasurementValue &volume, + const OFBool check) +{ + /* remember current node */ + const DSRDocumentTreeNodeCursor cursor(getCursor()); + /* go to image library entry and check for expected modality */ + OFCondition result = goAndCheckImageLibraryEntry(CODE_DCM_PositronEmissionTomography); + /* set content item value (and add a new content item if needed) */ + CHECK_RESULT(setNumericContentItemFromValue(CODE_DCM_RadiopharmaceuticalVolume, volume, CODE_UCUM_cm3 /*might change with a CP*/, "TID 1607 - Row 6", check)); + /* in case of error, reset cursor to stored node */ + BAD_RESULT(setCursor(cursor)); + return result; +} + + +OFCondition TID1600_ImageLibrary::setPETImageRadionuclideTotalDose(const CMR_SRNumericMeasurementValue &totalDose, + const OFBool check) +{ + /* remember current node */ + const DSRDocumentTreeNodeCursor cursor(getCursor()); + /* go to image library entry and check for expected modality */ + OFCondition result = goAndCheckImageLibraryEntry(CODE_DCM_PositronEmissionTomography); + /* set content item value (and add a new content item if needed) */ + CHECK_RESULT(setNumericContentItemFromValue(CODE_DCM_RadionuclideTotalDose, totalDose, CODE_UCUM_Bq, "TID 1607 - Row 7", check)); + /* in case of error, reset cursor to stored node */ + BAD_RESULT(setCursor(cursor)); + return result; +} + + +// protected methods + +OFCondition TID1600_ImageLibrary::createImageLibrary() +{ + OFCondition result = SR_EC_InvalidTemplateStructure; + if (isEmpty()) + { + /* TID 1600 (Image Library) Row 1 */ + STORE_RESULT(addContentItem(RT_unknown, VT_Container, CODE_DCM_ImageLibrary)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1600 - Row 1")); + /* store ID of root node for later use */ + GOOD_RESULT(storeEntryInNodeList(IMAGE_LIBRARY, getNodeID())); + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addImageEntryDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* TID 1602 (Image Library Entry Descriptors) Row 1 */ + OFString modality; + if (getStringValueFromDataset(dataset, DCM_Modality, modality).good() && !modality.empty()) + { + /* check whether descriptor should be added */ + if (checkDescriptorToBeAdded(CODE_DCM_Modality, mode, descriptors)) + { + /* determine modality code from CID 29 */ + DSRCodedEntryValue modalityCode; + const CID29e_AcquisitionModality contextGroup; + if (contextGroup.mapModality(modality, modalityCode).good()) + { + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Code, CODE_DCM_Modality, check)); + CHECK_RESULT(tree.getCurrentContentItem().setCodeValue(modalityCode, check)); + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText("TID 1602 - Row 1")); + } else { + /* do not treat this as an error, just report a warning */ + DCMSR_CMR_WARN("Cannot map Modality '" << modality << "' to a coded entry (not in CID 29)"); + } + } + } + /* TID 1602 (Image Library Entry Descriptors) Row 2 */ + if (checkDescriptorToBeAdded(CODE_DCM_TargetRegion, mode, descriptors)) + { + DSRCodedEntryValue regionCode; + /* try to get coded entry from code sequence */ + if (regionCode.readSequence(dataset, DCM_AnatomicRegionSequence, "3" /*type*/).bad()) + { + OFString bodyPartExamined; + if (getStringValueFromDataset(dataset, DCM_BodyPartExamined, bodyPartExamined).good() && !bodyPartExamined.empty()) + { + /* alternatively, determine target region code from CID 4031 (using PS 3.16 Annex L) */ + if (CID4031e_CommonAnatomicRegions::mapBodyPartExamined(bodyPartExamined, regionCode).bad()) + { + /* report this as a debug message (avoid too many warnings) */ + DCMSR_CMR_DEBUG("Cannot map Body Part Examined '" << bodyPartExamined << "' to a coded entry (no mapping to CID 4031 defined)"); + } + } + } + if (regionCode.isComplete()) + { + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Code, CODE_DCM_TargetRegion, check)); + CHECK_RESULT(tree.getCurrentContentItem().setCodeValue(regionCode, check)); + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText("TID 1602 - Row 2")); + } + } + /* TID 1602 (Image Library Entry Descriptors) Row 3 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageLaterality, mode, descriptors)) + { + OFString imageLaterality; + if (getStringValueFromDataset(dataset, DCM_ImageLaterality, imageLaterality).good() && !imageLaterality.empty()) + { + /* determine image laterality code from CID 244 */ + DSRCodedEntryValue lateralityCode; + if (CID244e_Laterality::mapImageLaterality(imageLaterality, lateralityCode).good()) + { + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Code, CODE_DCM_ImageLaterality, check)); + CHECK_RESULT(tree.getCurrentContentItem().setCodeValue(lateralityCode, check)); + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText("TID 1602 - Row 3")); + } else { + /* do not treat this as an error, just report a warning */ + DCMSR_CMR_WARN("Cannot map Image Laterality '" << imageLaterality << "' to a coded entry (not in CID 244)"); + } + } + } + /* TID 1602 (Image Library Entry Descriptors) Row 4 */ + if (checkDescriptorToBeAdded(CODE_DCM_StudyDate, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_StudyDate, 0 /*pos*/, VT_Date, CODE_DCM_StudyDate, "TID 1602 - Row 4", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 5 */ + if (checkDescriptorToBeAdded(CODE_DCM_StudyTime, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_StudyTime, 0 /*pos*/, VT_Time, CODE_DCM_StudyTime, "TID 1602 - Row 5", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 6 */ + if (checkDescriptorToBeAdded(CODE_DCM_ContentDate, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_ContentDate, 0 /*pos*/, VT_Date, CODE_DCM_ContentDate, "TID 1602 - Row 6", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 7 */ + if (checkDescriptorToBeAdded(CODE_DCM_ContentTime, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_ContentTime, 0 /*pos*/, VT_Time, CODE_DCM_ContentTime, "TID 1602 - Row 7", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 8 */ + if (checkDescriptorToBeAdded(CODE_DCM_AcquisitionDate, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_AcquisitionDate, 0 /*pos*/, VT_Date, CODE_DCM_AcquisitionDate, "TID 1602 - Row 8", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 9 */ + if (checkDescriptorToBeAdded(CODE_DCM_AcquisitionTime, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_AcquisitionTime, 0 /*pos*/, VT_Time, CODE_DCM_AcquisitionTime, "TID 1602 - Row 9", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 10 */ + if (checkDescriptorToBeAdded(CODE_DCM_FrameOfReferenceUID, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_FrameOfReferenceUID, 0 /*pos*/, VT_UIDRef, CODE_DCM_FrameOfReferenceUID, "TID 1602 - Row 10", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 11 */ + /* - tbc: what about DCM_TotalPixelMatrixRows (e.g. used for WSI images)? */ + if (checkDescriptorToBeAdded(CODE_DCM_PixelDataRows, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_Rows, 0 /*pos*/, CODE_DCM_PixelDataRows, CODE_UCUM_Pixels, "TID 1602 - Row 11", check)); + /* TID 1602 (Image Library Entry Descriptors) Row 12 */ + /* - tbc: what about DCM_TotalPixelMatrixColumns (e.g. used for WSI images)? */ + if (checkDescriptorToBeAdded(CODE_DCM_PixelDataColumns, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_Columns, 0 /*pos*/, CODE_DCM_PixelDataColumns, CODE_UCUM_Pixels, "TID 1602 - Row 12", check)); + /* continue with modality-specific descriptors (TID 1603 to 1607) */ + CHECK_RESULT(addModalitySpecificDescriptors(tree, dataset, modality, mode, descriptors, check)); + return result; +} + + +OFCondition TID1600_ImageLibrary::addModalitySpecificDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const OFString &modality, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) */ + if ((modality == "CR") || (modality == "RG") || (modality == "DX") || (modality == "MG") || (modality == "XA") || (modality == "RF") || (modality == "PX") || (modality == "IO")) + CHECK_RESULT(addProjectionRadiographyDescriptors(tree, dataset, mode, descriptors, check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) */ + if ((modality == "CT") || (modality == "MR") || (modality == "US") /* correct? */ || (modality == "PT") || (modality == "OCT") || (modality == "OPT") || (modality == "IVOCT")) + CHECK_RESULT(addCrossSectionalModalitiesDescriptors(tree, dataset, mode, descriptors, check)); + /* TID 1605 (Image Library Entry Descriptors for CT) */ + if (modality == "CT") + CHECK_RESULT(addComputedTomographyDescriptors(tree, dataset, mode, descriptors, check)); + /* TID 1606 (Image Library Entry Descriptors for MR) */ + if (modality == "MR") + CHECK_RESULT(addMagneticResonanceDescriptors(tree, dataset, mode, descriptors, check)); + /* TID 1607 (Image Library Entry Descriptors for PET) */ + if (modality == "PT") + CHECK_RESULT(addPositronEmissionTomographyDescriptors(tree, dataset, mode, descriptors, check)); + return result; +} + + +OFCondition TID1600_ImageLibrary::addProjectionRadiographyDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 1 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageView, mode, descriptors)) + CHECK_RESULT(addCodeContentItemFromDataset(tree, dataset, DCM_ViewCodeSequence, CODE_DCM_ImageView, "TID 1603 - Row 1", check)); + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 2 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageViewModifier, mode, descriptors)) + { + if (result.good() && (tree.getCurrentContentItem().getConceptName() == CODE_DCM_ImageView)) + { + DcmItem *item = NULL; + /* get view modifiers (if any) */ + if (dataset.findAndGetSequenceItem(DCM_ViewCodeSequence, item, 0 /*itemNum*/).good()) + { + DcmSequenceOfItems *sequence = NULL; + if (item->findAndGetSequence(DCM_ViewModifierCodeSequence, sequence).good() +#ifdef __SUNPRO_CC + /* unfortunately required to keep SunPro Studio 12.x quiet */ + && (sequence != NULL) +#endif + ) + { + /* iterate over all sequence items */ + DcmObject *object = NULL; + while (((object = sequence->nextInContainer(object)) != NULL) && result.good()) + { + DSRCodedEntryValue modifierCode; + if (modifierCode.readSequenceItem(*OFstatic_cast(DcmItem *, object), DCM_ViewModifierCodeSequence).good()) + { + CHECK_RESULT(tree.addChildContentItem(RT_hasAcqContext, VT_Code, CODE_DCM_ImageViewModifier, check)); + CHECK_RESULT(tree.getCurrentContentItem().setCodeValue(modifierCode, check)); + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText("TID 1603 - Row 2")); + tree.goUp(); + } + } + } + } + } + } + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 3 */ + if (checkDescriptorToBeAdded(CODE_DCM_PatientOrientationRow, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_PatientOrientation, 0 /*pos*/, VT_Text, CODE_DCM_PatientOrientationRow, "TID 1603 - Row 3", check)); + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 4 */ + if (checkDescriptorToBeAdded(CODE_DCM_PatientOrientationColumn, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, dataset, DCM_PatientOrientation, 1 /*pos*/, VT_Text, CODE_DCM_PatientOrientationColumn, "TID 1603 - Row 4", check)); + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 5 */ + if (checkDescriptorToBeAdded(CODE_DCM_HorizontalPixelSpacing, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImagerPixelSpacing, 1 /*pos*/, CODE_DCM_HorizontalPixelSpacing, CODE_UCUM_Millimeter, "TID 1603 - Row 5", check)); + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 6 */ + if (checkDescriptorToBeAdded(CODE_DCM_VerticalPixelSpacing, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImagerPixelSpacing, 0 /*pos*/, CODE_DCM_VerticalPixelSpacing, CODE_UCUM_Millimeter, "TID 1603 - Row 6", check)); + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 7 */ + if (checkDescriptorToBeAdded(CODE_DCM_PositionerPrimaryAngle, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_PositionerPrimaryAngle, 0 /*pos*/, CODE_DCM_PositionerPrimaryAngle, CODE_UCUM_Degrees, "TID 1603 - Row 7", check)); + /* TID 1603 (Image Library Entry Descriptors for Projection Radiography) Row 8 */ + if (checkDescriptorToBeAdded(CODE_DCM_PositionerSecondaryAngle, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_PositionerSecondaryAngle, 0 /*pos*/, CODE_DCM_PositionerSecondaryAngle, CODE_UCUM_Degrees, "TID 1603 - Row 8", check)); + return result; +} + + +OFCondition TID1600_ImageLibrary::addCrossSectionalModalitiesDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 1 */ + if (checkDescriptorToBeAdded(CODE_DCM_HorizontalPixelSpacing, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_PixelSpacing, 1 /*pos*/, CODE_DCM_HorizontalPixelSpacing, CODE_UCUM_Millimeter, "TID 1604 - Row 1", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 2 */ + if (checkDescriptorToBeAdded(CODE_DCM_VerticalPixelSpacing, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_PixelSpacing, 0 /*pos*/, CODE_DCM_VerticalPixelSpacing, CODE_UCUM_Millimeter, "TID 1604 - Row 2", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 3 */ + if (checkDescriptorToBeAdded(CODE_DCM_SpacingBetweenSlices, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_SpacingBetweenSlices, 0 /*pos*/, CODE_DCM_SpacingBetweenSlices, CODE_UCUM_Millimeter, "TID 1604 - Row 3", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 4 */ + if (checkDescriptorToBeAdded(CODE_DCM_SliceThickness, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_SliceThickness, 0 /*pos*/, CODE_DCM_SliceThickness, CODE_UCUM_Millimeter, "TID 1604 - Row 4", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 5 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImagePosition_Patient_X, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImagePositionPatient, 0 /*pos*/, CODE_DCM_ImagePosition_Patient_X, CODE_UCUM_Millimeter, "TID 1604 - Row 5", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 6 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImagePosition_Patient_Y, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImagePositionPatient, 1 /*pos*/, CODE_DCM_ImagePosition_Patient_Y, CODE_UCUM_Millimeter, "TID 1604 - Row 6", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 7 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImagePosition_Patient_Z, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImagePositionPatient, 2 /*pos*/, CODE_DCM_ImagePosition_Patient_Z, CODE_UCUM_Millimeter, "TID 1604 - Row 7", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 8 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageOrientation_Patient_RowX, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImageOrientationPatient, 0 /*pos*/, CODE_DCM_ImageOrientation_Patient_RowX, CODE_UCUM_Minus1To1, "TID 1604 - Row 8", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 9 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageOrientation_Patient_RowY, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImageOrientationPatient, 1 /*pos*/, CODE_DCM_ImageOrientation_Patient_RowY, CODE_UCUM_Minus1To1, "TID 1604 - Row 9", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 10 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageOrientation_Patient_RowZ, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImageOrientationPatient, 2 /*pos*/, CODE_DCM_ImageOrientation_Patient_RowZ, CODE_UCUM_Minus1To1, "TID 1604 - Row 10", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 11 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageOrientation_Patient_ColumnX, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImageOrientationPatient, 3 /*pos*/, CODE_DCM_ImageOrientation_Patient_ColumnX, CODE_UCUM_Minus1To1, "TID 1604 - Row 11", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 12 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageOrientation_Patient_ColumnY, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImageOrientationPatient, 4 /*pos*/, CODE_DCM_ImageOrientation_Patient_ColumnY, CODE_UCUM_Minus1To1, "TID 1604 - Row 12", check)); + /* TID 1604 (Image Library Entry Descriptors for Cross-Sectional Modalities) Row 13 */ + if (checkDescriptorToBeAdded(CODE_DCM_ImageOrientation_Patient_ColumnZ, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, dataset, DCM_ImageOrientationPatient, 5 /*pos*/, CODE_DCM_ImageOrientation_Patient_ColumnZ, CODE_UCUM_Minus1To1, "TID 1604 - Row 13", check)); + return result; +} + + +OFCondition TID1600_ImageLibrary::addComputedTomographyDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* TID 1605 (Image Library Entry Descriptors for CT) Row 1 */ + if (checkDescriptorToBeAdded(CODE_DCM_CTAcquisitionType, mode, descriptors)) + { + DcmSequenceOfItems *ctAcquisitionTypeSequence = NULL; + /* - tbd: only check in functional groups sequences? might use "dcmfg" for this purpose */ + if (dataset.findAndGetSequence(DCM_CTAcquisitionTypeSequence, ctAcquisitionTypeSequence, OFTrue /*searchIntoSub*/).good()) + { + DcmItem *item = ctAcquisitionTypeSequence->getItem(0); + if (item != NULL) + { + OFString acquisitionType; + if (getStringValueFromDataset(*item, DCM_AcquisitionType, acquisitionType).good() && !acquisitionType.empty()) + { + /* determine CT acquisition type code from CID 10013 */ + DSRCodedEntryValue acquisitionTypeCode; + if (CID10013e_CTAcquisitionType::mapAcquisitionType(acquisitionType, acquisitionTypeCode).good()) + { + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Code, CODE_DCM_CTAcquisitionType, check)); + CHECK_RESULT(tree.getCurrentContentItem().setCodeValue(acquisitionTypeCode, check)); + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText("TID 1605 - Row 1")); + } else { + /* do not treat this as an error, just report a warning */ + DCMSR_CMR_WARN("Cannot map Acquisition Type '" << acquisitionType << "' to a coded entry (not in CID 10013)"); + } + } + } + } + } + /* TID 1605 (Image Library Entry Descriptors for CT) Row 2 */ + if (checkDescriptorToBeAdded(CODE_DCM_ReconstructionAlgorithm, mode, descriptors)) + { + DcmSequenceOfItems *ctReconstructionSequence = NULL; + /* - tbd: only check in functional groups sequences? might use "dcmfg" for this purpose */ + if (dataset.findAndGetSequence(DCM_CTReconstructionSequence, ctReconstructionSequence, OFTrue /*searchIntoSub*/).good()) + { + DcmItem *item = ctReconstructionSequence->getItem(0); + if (item != NULL) + { + OFString reconstructionAlgorithm; + if (getStringValueFromDataset(*item, DCM_ReconstructionAlgorithm, reconstructionAlgorithm).good() && !reconstructionAlgorithm.empty()) + { + /* determine CT reconstruction algorithm code from CID 10033 */ + DSRCodedEntryValue reconstructionAlgorithmCode; + if (CID10033e_CTReconstructionAlgorithm::mapReconstructionAlgorithm(reconstructionAlgorithm, reconstructionAlgorithmCode).good()) + { + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Code, CODE_DCM_ReconstructionAlgorithm, check)); + CHECK_RESULT(tree.getCurrentContentItem().setCodeValue(reconstructionAlgorithmCode, check)); + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText("TID 1605 - Row 2")); + } else { + /* do not treat this as an error, just report a warning */ + DCMSR_CMR_WARN("Cannot map Reconstruction Algorithm '" << reconstructionAlgorithm << "' to a coded entry (not in CID 10033)"); + } + } + } + } + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addMagneticResonanceDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* TID 1606 (Image Library Entry Descriptors for MR) Row 1 */ + if (checkDescriptorToBeAdded(CODE_DCM_PulseSequenceName, mode, descriptors)) + { + OFString sequenceName; + /* get one of two alternative elements values */ + if ((getStringValueFromDataset(dataset, DCM_PulseSequenceName, sequenceName).good() && !sequenceName.empty()) || + (getStringValueFromDataset(dataset, DCM_SequenceName, sequenceName).good() && !sequenceName.empty())) + { + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Text, CODE_DCM_PulseSequenceName, check)); + CHECK_RESULT(tree.getCurrentContentItem().setStringValue(sequenceName, check)); + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText("TID 1606 - Row 1")); + } + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addPositronEmissionTomographyDescriptors(DSRDocumentSubTree &tree, + DcmItem &dataset, + const AddImageMode mode, + const ConceptNameList &descriptors, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* get main sequence from (Enhanced) PET Isotope Module */ + DcmSequenceOfItems *radiopharmaceuticalInformationSequence = NULL; + if (dataset.findAndGetSequence(DCM_RadiopharmaceuticalInformationSequence, radiopharmaceuticalInformationSequence, OFTrue /*searchIntoSub*/).good()) + { + /* tbd: sequence may contain multiple items! */ + DcmItem *item = radiopharmaceuticalInformationSequence->getItem(0); + if (item != NULL) + { + /* TID 1607 (Image Library Entry Descriptors for PET) Row 1 */ + if (checkDescriptorToBeAdded(CODE_SCT_Radionuclide, mode, descriptors)) + CHECK_RESULT(addCodeContentItemFromDataset(tree, *item, DCM_RadionuclideCodeSequence, CODE_SCT_Radionuclide, "TID 1607 - Row 1", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 2 */ + if (checkDescriptorToBeAdded(CODE_SCT_RadiopharmaceuticalAgent, mode, descriptors)) + CHECK_RESULT(addCodeContentItemFromDataset(tree, *item, DCM_RadiopharmaceuticalCodeSequence, CODE_SCT_RadiopharmaceuticalAgent, "TID 1607 - Row 2", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 3 */ + if (checkDescriptorToBeAdded(CODE_SCT_HalfLifeOfRadiopharmaceutical, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, *item, DCM_RadionuclideHalfLife, 0 /*pos*/, CODE_SCT_HalfLifeOfRadiopharmaceutical, CODE_UCUM_s, "TID 1607 - Row 3", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 4 */ + if (checkDescriptorToBeAdded(CODE_DCM_RadiopharmaceuticalStartDateTime, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, *item, DCM_RadiopharmaceuticalStartDateTime, 0 /*pos*/, VT_DateTime, CODE_DCM_RadiopharmaceuticalStartDateTime, "TID 1607 - Row 4", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 5 */ + if (checkDescriptorToBeAdded(CODE_DCM_RadiopharmaceuticalStopDateTime, mode, descriptors)) + CHECK_RESULT(addStringContentItemFromDataset(tree, *item, DCM_RadiopharmaceuticalStopDateTime, 0 /*pos*/, VT_DateTime, CODE_DCM_RadiopharmaceuticalStopDateTime, "TID 1607 - Row 5", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 6 */ + if (checkDescriptorToBeAdded(CODE_DCM_RadiopharmaceuticalVolume, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, *item, DCM_RadiopharmaceuticalVolume, 0 /*pos*/, CODE_DCM_RadiopharmaceuticalVolume, CODE_UCUM_cm3 /*might change with a CP*/, "TID 1607 - Row 6", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 7 */ + if (checkDescriptorToBeAdded(CODE_DCM_RadionuclideTotalDose, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, *item, DCM_RadionuclideTotalDose, 0 /*pos*/, CODE_DCM_RadionuclideTotalDose, CODE_UCUM_Bq, "TID 1607 - Row 7", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 8 */ + if (checkDescriptorToBeAdded(CODE_DCM_RadiopharmaceuticalSpecificActivity, mode, descriptors)) + CHECK_RESULT(addNumericContentItemFromDataset(tree, *item, DCM_RadiopharmaceuticalSpecificActivity, 0 /*pos*/, CODE_DCM_RadiopharmaceuticalSpecificActivity, CODE_UCUM_BqPerMol, "TID 1607 - Row 8", check)); + /* TID 1607 (Image Library Entry Descriptors for PET) Row 9 */ + if (checkDescriptorToBeAdded(CODE_SCT_RouteOfAdministration, mode, descriptors)) + CHECK_RESULT(addCodeContentItemFromDataset(tree, *item, DCM_AdministrationRouteCodeSequence, CODE_SCT_RouteOfAdministration, "TID 1607 - Row 9", check)); + } + } + /* TID 1607 (Image Library Entry Descriptors for PET) Row 10 to 11 + * - contained in TID 15101 (NM/PET Protocol Context), i.e. not available in the image + */ + /* TID 1607 (Image Library Entry Descriptors for PET) Row 12 + * - "Radionuclide Incubation Time" calculated from time of injection and time of starting the scan + */ + /* TID 1607 (Image Library Entry Descriptors for PET) Row 13 to 15 + * - contained in TID 15101 (NM/PET Protocol Context), i.e. available from Modality Worklist, or + * - tbd: in TID 3470 (NM/PET Acquisition Context), i.e. from the Acquisition Context Module + */ + return result; +} + + +OFCondition TID1600_ImageLibrary::goAndCheckImageLibraryEntry(const DSRCodedEntryValue &modalityCode) +{ + OFCondition result = CMR_EC_NoImageLibraryEntry; + /* go to last image library entry (if any) */ + if (gotoEntryFromNodeList(this, LAST_IMAGE_LIBRARY_ENTRY) > 0) + { + /* check whether TID 1602 (Image Library Entry Descriptors) Row 1 is present */ + if (gotoNamedChildNode(CODE_DCM_Modality) > 0) + { + /* ... and has the expected value */ + if (getCurrentContentItem().getCodeValue() == modalityCode) + result = EC_Normal; + else + result = CMR_EC_WrongImageLibraryEntryDescriptorModality; + } else { + /* tbd: could also check whether the Modality is available one level higher */ + result = CMR_EC_MissingImageLibraryEntryDescriptorModality; + } + } + return result; +} + + +OFCondition TID1600_ImageLibrary::setStringContentItemFromValue(const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &stringValue, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* check concept name and coded entry value */ + if (conceptName.isComplete()) + { + if (!stringValue.empty()) + { + /* check whether content item is already present. + * (we assume that the content item we are searching for is a successor of the current one) + */ + if (gotoNextNamedNode(conceptName, OFFalse /*searchIntoSub*/) == 0) + { + CHECK_RESULT(addContentItem(RT_hasAcqContext, valueType, conceptName, check)); + } else { + /* make sure that the value type of the existing content item is correct */ + if (getCurrentContentItem().getValueType() == valueType) + { + DCMSR_CMR_DEBUG("Replacing value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") with \"" << stringValue << "\""); + } else { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong value type"); + result = SR_EC_InvalidContentItem; + } + } + CHECK_RESULT(getCurrentContentItem().setStringValue(stringValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText(annotationText)); + } else + result = SR_EC_InvalidValue; + } else + result = SR_EC_InvalidConceptName; + return result; +} + + +OFCondition TID1600_ImageLibrary::setCodeContentItemFromValue(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &codeValue, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* check concept name and coded entry value */ + if (conceptName.isComplete()) + { + if (codeValue.isComplete()) + { + /* check whether content item is already present. + * (we assume that the content item we are searching for is a successor of the current one) + */ + if (gotoNextNamedNode(conceptName, OFFalse /*searchIntoSub*/) == 0) + { + CHECK_RESULT(addContentItem(RT_hasAcqContext, VT_Code, conceptName, check)); + } else { + /* make sure that the value type of the existing content item is correct */ + if (getCurrentContentItem().getValueType() == VT_Code) + { + DCMSR_CMR_DEBUG("Replacing value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") with " << codeValue); + } else { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong value type"); + result = SR_EC_InvalidContentItem; + } + } + CHECK_RESULT(getCurrentContentItem().setCodeValue(codeValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText(annotationText)); + } else + result = SR_EC_InvalidValue; + } else + result = SR_EC_InvalidConceptName; + return result; +} + + +OFCondition TID1600_ImageLibrary::setNumericContentItemFromValue(const DSRCodedEntryValue &conceptName, + const DSRNumericMeasurementValue &numericValue, + const DSRCodedEntryValue &measurementUnit, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* check concept name and coded entry value */ + if (conceptName.isComplete()) + { + if (numericValue.isComplete()) + { + /* check whether content item is already present. + * (we assume that the content item we are searching for is a successor of the current one) + */ + if (gotoNextNamedNode(conceptName, OFFalse /*searchIntoSub*/) == 0) + { + CHECK_RESULT(addContentItem(RT_hasAcqContext, VT_Num, conceptName, check)); + } else { + /* make sure that the value type of the existing content item is correct */ + if (getCurrentContentItem().getValueType() == VT_Num) + { + DCMSR_CMR_DEBUG("Replacing value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") with " << numericValue); + } else { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong value type"); + result = SR_EC_InvalidContentItem; + } + } + /* check whether measurement unit meets the template constraint */ + if (result.good() && !measurementUnit.isEmpty() && (numericValue.getMeasurementUnit() != measurementUnit)) + { + DCMSR_CMR_WARN("Wrong measurement unit for '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ")"); + result = SR_EC_ValueSetConstraintViolated; + } + CHECK_RESULT(getCurrentContentItem().setNumericValue(numericValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText(annotationText)); + } else + result = SR_EC_InvalidValue; + } else + result = SR_EC_InvalidConceptName; + return result; +} + + +// static helper functions + +OFBool TID1600_ImageLibrary::anyDescriptorsToBeAdded(const AddImageMode mode, + const ConceptNameList &descriptors) +{ + /* check whether there are any descriptors to be added (at all) */ + return (mode == withAllDescriptors) || ((mode == withSelectedDescriptors) && !descriptors.empty()) || (mode == withoutSelectedDescriptors); +} + + +OFBool TID1600_ImageLibrary::checkDescriptorToBeAdded(const DSRBasicCodedEntry &conceptName, + const AddImageMode mode, + const ConceptNameList &descriptors) +{ + OFBool result = OFFalse; + /* check which "add mode" to use */ + switch (mode) + { + case withoutDescriptors: + result = OFFalse; + break; + case withAllDescriptors: + result = OFTrue; + break; + case withSelectedDescriptors: + { + OFListConstIterator(DSRBasicCodedEntry) iter = descriptors.begin(); + const OFListConstIterator(DSRBasicCodedEntry) last = descriptors.end(); + const DSRCodedEntryValue codedEntry(conceptName); + while ((iter != last) && (codedEntry != *iter)) + ++iter; + result = (iter != last); + break; + } + case withoutSelectedDescriptors: + { + OFListConstIterator(DSRBasicCodedEntry) iter = descriptors.begin(); + const OFListConstIterator(DSRBasicCodedEntry) last = descriptors.end(); + const DSRCodedEntryValue codedEntry(conceptName); + while ((iter != last) && (codedEntry != *iter)) + ++iter; + result = (iter == last); + break; + } + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addStringContentItemFromDataset(DSRDocumentSubTree &tree, + DcmItem &dataset, + const DcmTagKey &tagKey, + const signed long pos, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + OFString stringValue; + /* get element value from dataset (textual content only) */ + if (getStringValueFromDataset(dataset, tagKey, stringValue, pos).good() && !stringValue.empty()) + { + /* create new content item, set concept name and value */ + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, valueType, conceptName, check)); + CHECK_RESULT(tree.getCurrentContentItem().setStringValue(stringValue, check)); + if (!annotationText.empty()) + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText(annotationText)); + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addCodeContentItemFromDataset(DSRDocumentSubTree &tree, + DcmItem &dataset, + const DcmTagKey &tagKey, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + DSRCodedEntryValue codedEntry; + /* get coded entry from code sequence in dataset */ + if (codedEntry.readSequence(dataset, tagKey, "3" /*type*/).good() && codedEntry.isComplete()) + { + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Code, conceptName, check)); + CHECK_RESULT(tree.getCurrentContentItem().setCodeValue(codedEntry, check)); + if (!annotationText.empty()) + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText(annotationText)); + } + return result; +} + + +OFCondition TID1600_ImageLibrary::addNumericContentItemFromDataset(DSRDocumentSubTree &tree, + DcmItem &dataset, + const DcmTagKey &tagKey, + const signed long pos, + const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &measurementUnit, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + OFString numericValue; + /* get element value from dataset (in text format) */ + if (getStringValueFromDataset(dataset, tagKey, numericValue, pos).good() && !numericValue.empty()) + { + /* create new content item, set concept name and value */ + CHECK_RESULT(tree.addContentItem(RT_hasAcqContext, VT_Num, conceptName, check)); + CHECK_RESULT(tree.getCurrentContentItem().setNumericValue(DSRNumericMeasurementValue(numericValue, measurementUnit), check)); + if (!annotationText.empty()) + CHECK_RESULT(tree.getCurrentContentItem().setAnnotationText(annotationText)); + } + return result; +} diff --git a/dcmsr/libcmr/tid300.cc b/dcmsr/libcmr/tid300.cc new file mode 100644 index 00000000..3c4c06b5 --- /dev/null +++ b/dcmsr/libcmr/tid300.cc @@ -0,0 +1,554 @@ +/* + * + * Copyright (C) 2017-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID300_Measurement + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid300.h" +#include "dcmtk/dcmsr/cmr/tid15def.h" +#include "dcmtk/dcmsr/cmr/cid6147.h" +#include "dcmtk/dcmsr/cmr/cid7181.h" +#include "dcmtk/dcmsr/cmr/cid7464.h" +#include "dcmtk/dcmsr/cmr/cid7469.h" +#include "dcmtk/dcmsr/cmr/logger.h" +#include "dcmtk/dcmsr/codes/dcm.h" +#include "dcmtk/dcmsr/codes/sct.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// index positions in node list (makes source code more readable) +#define MEASUREMENT 0 +#define LAST_MODIFIER 1 +#define MEASUREMENT_METHOD 2 +#define DERIVATION 3 +#define LAST_FINDING_SITE 4 +#define LAST_DERIVATION_PARAMETER 5 +#define LAST_IMAGE_OR_SCOORD 6 +#define EQUIVALENT_MEANING 7 +#define REAL_WORLD_VALUE_MAP 8 +#define NUMBER_OF_LIST_ENTRIES 9 + +// general information on TID 300 (Measurement) +#define TEMPLATE_NUMBER "300" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFTrue /* extensible */ +#define TEMPLATE_ORDER OFTrue /* significant */ + + +template +TID300_Measurement::TID300_Measurement() + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES, OFTrue /*initialize*/); +} + + +template +TID300_Measurement::TID300_Measurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check) + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); + /* need to store position of various content items */ + reserveEntriesInNodeList(NUMBER_OF_LIST_ENTRIES, OFTrue /*initialize*/); + /* create the mandatory "root" content item */ + createMeasurement(conceptName, numericValue, check); +} + + +template +void TID300_Measurement::clear() +{ + DSRSubTemplate::clear(); +} + + +template +OFBool TID300_Measurement::isValid() const +{ + /* check whether base class is valid and all required content items are present */ + return DSRSubTemplate::isValid() && hasMeasurement(); +} + + +template +OFBool TID300_Measurement::hasMeasurement() const +{ + /* check for content item at TID 300 (Measurement) Row 1 */ + return (getEntryFromNodeList(MEASUREMENT) > 0); +} + + +template +OFCondition TID300_Measurement::createNewMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check) +{ + clear(); + /* TID 300 (Measurement) Row 1 */ + return createMeasurement(conceptName, numericValue, check); +} + + +template +OFCondition TID300_Measurement::addModifier(const DSRCodedEntryValue &conceptName, + const DSRCodedEntryValue &modifier, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.isComplete() && modifier.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* go to last instance of TID 300 (Measurement) Row 2 (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_MODIFIER) == getEntryFromNodeList(MEASUREMENT)) + { + /* need to add the new content item as the first child */ + if (addContentItem(RT_hasConceptMod, VT_Code, AM_belowCurrentBeforeFirstChild) > 0) + { + if (getCurrentContentItem().setConceptName(conceptName, check).good()) + result = EC_Normal; + else + result = SR_EC_InvalidConceptName; + } else + result = SR_EC_CannotAddContentItem; + } else + STORE_RESULT(addContentItem(RT_hasConceptMod, VT_Code, conceptName, check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(modifier, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 300 - Row 2")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_MODIFIER, getNodeID())); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID300_Measurement::setMeasurementMethod(const T_Method &method, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameter */ + if (method.hasSelectedValue()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 300 (Measurement) Row 3 */ + STORE_RESULT(addOrReplaceContentItem(MEASUREMENT_METHOD, RT_hasConceptMod, VT_Code, CODE_SCT_MeasurementMethod, "TID 300 - Row 3", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(method, check)); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID300_Measurement::setDerivation(const T_Derivation &derivation, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameter */ + if (derivation.hasSelectedValue()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 300 (Measurement) Row 4 */ + STORE_RESULT(addOrReplaceContentItem(DERIVATION, RT_hasConceptMod, VT_Code, CODE_DCM_Derivation, "TID 300 - Row 4", check)); + CHECK_RESULT(getCurrentContentItem().setCodeValue(derivation, check)); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID300_Measurement::addFindingSite(const DSRCodedEntryValue &site, + const CID244e_Laterality &laterality, + const DSRCodedEntryValue &siteModifier, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of mandatory parameter */ + if (site.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* TID 300 (Measurement) Row 5 */ + STORE_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_FindingSite, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(site, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 300 - Row 5")); + const size_t lastNode = subTree->getNodeID(); + /* TID 300 (Measurement) Row 6 - optional */ + if (laterality.hasSelectedValue()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_Laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(laterality, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 300 - Row 6")); + GOOD_RESULT(subTree->gotoParent()); + } + /* TID 300 (Measurement) Row 7 - optional */ + if (siteModifier.isComplete()) + { + CHECK_RESULT(subTree->addChildContentItem(RT_hasConceptMod, VT_Code, CODE_SCT_TopographicalModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(siteModifier, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 300 - Row 7")); + GOOD_RESULT(subTree->gotoParent()); + } + /* if everything was OK, insert new subtree into the template */ + if (result.good() && !subTree->isEmpty()) + { + /* go to last measurement (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_FINDING_SITE) == getEntryFromNodeList(MEASUREMENT)) + { + /* insert subtree below root */ + STORE_RESULT(insertSubTree(subTree, AM_belowCurrent)); + } else { + /* insert subtree after current position */ + STORE_RESULT(insertSubTree(subTree, AM_afterCurrent)); + } + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_FINDING_SITE, lastNode)); + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); + } else { + /* delete the new subtree since it has not been inserted */ + delete subTree; + } + } else + result = EC_MemoryExhausted; + } else + result = CMR_EC_NoMeasurement; + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID300_Measurement::addDerivationParameter(const DSRCodedEntryValue &conceptName, + const CMR_SRNumericMeasurementValue &numericValue, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.isComplete() && numericValue.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* go to last derivation parameter (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_DERIVATION_PARAMETER) == getEntryFromNodeList(MEASUREMENT)) + { + /* insert TID 300 (Measurement) Row 9 below root */ + STORE_RESULT(addChildContentItem(RT_inferredFrom, VT_Num, conceptName, check)); + } else { + /* insert TID 300 (Measurement) Row 9 after current position */ + STORE_RESULT(addContentItem(RT_inferredFrom, VT_Num, conceptName, check)); + } + CHECK_RESULT(getCurrentContentItem().setNumericValue(numericValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 300 - Row 9")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_DERIVATION_PARAMETER, getNodeID())); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID300_Measurement::addImage(const DSRCodedEntryValue &conceptName, + const DSRImageReferenceValue &imageReference, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.isComplete() && imageReference.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* go to last image or spatial coordinates (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_IMAGE_OR_SCOORD) == getEntryFromNodeList(MEASUREMENT)) + { + /* insert TID 320 (Image or Spatial Coordinates) Row 1 below root */ + STORE_RESULT(addChildContentItem(RT_inferredFrom, VT_Image, conceptName, check)); + } else { + /* insert TID 320 (Image or Spatial Coordinates) Row 1 after current position */ + STORE_RESULT(addContentItem(RT_inferredFrom, VT_Image, conceptName, check)); + } + CHECK_RESULT(getCurrentContentItem().setImageReference(imageReference, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 320 - Row 1")); + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_IMAGE_OR_SCOORD, getNodeID())); + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID300_Measurement::addImage(const DSRCodedEntryValue &conceptName, + DcmItem &dataset, + const OFBool check) +{ + DSRImageReferenceValue imageReference; + /* first, create the referenced image object */ + OFCondition result = imageReference.setReference(dataset, check); + /* then, add/set the corresponding content item */ + CHECK_RESULT(addImage(conceptName, imageReference, check)); + return result; +} + + +template +OFCondition TID300_Measurement::addSpatialCoordinates(const DSRCodedEntryValue &conceptName, + const DSRSpatialCoordinatesValue &coordinatesValue, + const DSRImageReferenceValue &imageReference, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.isComplete() && imageReference.isComplete()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree *subTree = new DSRDocumentSubTree; + if (subTree != NULL) + { + /* TID 320 (Image or Spatial Coordinates) Row 3 */ + STORE_RESULT(subTree->addContentItem(RT_inferredFrom, VT_SCoord, conceptName, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setSpatialCoordinates(coordinatesValue, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 320 - Row 3")); + const size_t lastNode = subTree->getNodeID(); + /* TID 320 (Image or Spatial Coordinates) Row 4 */ + CHECK_RESULT(subTree->addChildContentItem(RT_selectedFrom, VT_Image, DSRCodedEntryValue() /* no concept name */)); + CHECK_RESULT(subTree->getCurrentContentItem().setImageReference(imageReference, check)); + CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 300 - Row 4")); + /* if everything was OK, insert new subtree into the template */ + if (result.good() && !subTree->isEmpty()) + { + /* go to last measurement (if any) */ + if (gotoLastEntryFromNodeList(this, LAST_IMAGE_OR_SCOORD) == getEntryFromNodeList(MEASUREMENT)) + { + /* insert subtree below root */ + STORE_RESULT(insertSubTree(subTree, AM_belowCurrent)); + } else { + /* insert subtree after current position */ + STORE_RESULT(insertSubTree(subTree, AM_afterCurrent)); + } + /* store ID of recently added node for later use */ + GOOD_RESULT(storeEntryInNodeList(LAST_IMAGE_OR_SCOORD, lastNode)); + /* in case of error, make sure that memory is freed */ + BAD_RESULT(delete subTree); + } else { + /* delete the new subtree since it has not been inserted */ + delete subTree; + } + } else + result = EC_MemoryExhausted; + } else + result = CMR_EC_NoMeasurement; + } + return result; +} + + +template +OFCondition TID300_Measurement::setEquivalentMeaningOfConceptName(const OFString &meaning, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (!meaning.empty()) + { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 300 (Measurement) Row 16 */ + CHECK_RESULT(addOrReplaceContentItem(EQUIVALENT_MEANING, RT_hasConceptMod, VT_Text, CODE_DCM_EquivalentMeaningOfConceptName, "TID 300 - Row 16", check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(meaning, check)); + } else + result = CMR_EC_NoMeasurement; + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID300_Measurement::setRealWorldValueMap(const DSRCompositeReferenceValue &valueMap, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* basic check of parameter */ + if (valueMap.isComplete()) + { + const char *annotationText = "TID 300 - Row 18"; + const DSRBasicCodedEntry conceptName(CODE_DCM_RealWorldValueMapUsedForMeasurement); + /* check for real world value mapping SOP classes */ + if (valueMap.getSOPClassUID() != UID_RealWorldValueMappingStorage) + { + DCMSR_CMR_WARN("Cannot set value of '" << conceptName.CodeMeaning << "' content item (" << annotationText << ") ... wrong SOP Class"); + DCMSR_CMR_DEBUG("SOP Class UID \"" << valueMap.getSOPClassUID() << "\" does not match the one of the Real World Value Mapping object"); + result = CMR_EC_InvalidRealWorldValueMappingObject; + } else { + /* check whether measurement exists */ + if (hasMeasurement()) + { + /* TID 300 (Measurement) Row 18 */ + CHECK_RESULT(addOrReplaceContentItem(REAL_WORLD_VALUE_MAP, RT_inferredFrom, VT_Composite, conceptName, annotationText, check)); + CHECK_RESULT(getCurrentContentItem().setCompositeReference(valueMap, check)); + } else + result = CMR_EC_NoMeasurement; + } + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition TID300_Measurement::setRealWorldValueMap(DcmItem &dataset, + const OFBool check) +{ + DSRCompositeReferenceValue valueMap; + /* first, create the referenced composite object */ + OFCondition result = valueMap.setReference(dataset, check); + /* then, add/set the corresponding content item */ + CHECK_RESULT(setRealWorldValueMap(valueMap, check)); + return result; +} + + +// protected methods + +template +OFCondition TID300_Measurement::createMeasurement(const T_Measurement &conceptName, + const MeasurementValue &numericValue, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameters */ + if (conceptName.hasSelectedValue() && numericValue.isComplete()) + { + /* reassure that the tree is definitely empty */ + if (isEmpty()) + { + /* TID 300 (Measurement) Row 1 */ + STORE_RESULT(addContentItem(RT_unknown, VT_Num, conceptName, check)); + CHECK_RESULT(getCurrentContentItem().setNumericValue(numericValue, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 300 - Row 1")); + GOOD_RESULT(storeEntryInNodeList(MEASUREMENT, getNodeID())); + } else + result = SR_EC_InvalidTemplateStructure; + } + return result; +} + + +template +OFCondition TID300_Measurement::addOrReplaceContentItem(const size_t nodePos, + const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFString &annotationText, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* check concept name and coded entry value */ + if (conceptName.isComplete()) + { + /* check whether content item already exists */ + if (getEntryFromNodeList(nodePos) == 0) + { + /* if not, create the content item (at correct position) */ + if (gotoLastEntryFromNodeList(this, nodePos) == getEntryFromNodeList(MEASUREMENT)) + { + /* need to add the new content item as the first child */ + if (addContentItem(relationshipType, valueType, AM_belowCurrentBeforeFirstChild) > 0) + { + if (getCurrentContentItem().setConceptName(conceptName, check).bad()) + result = SR_EC_InvalidConceptName; + } else + result = SR_EC_CannotAddContentItem; + + } else { + /* add new content item as a sibling (after the current one) */ + STORE_RESULT(addContentItem(relationshipType, valueType, conceptName)); + } + /* store ID of added node for later use */ + GOOD_RESULT(storeEntryInNodeList(nodePos, getNodeID())); + } + else if (gotoEntryFromNodeList(this, nodePos) > 0) + { + /* make sure that the value type of the existing content item is correct */ + if (getCurrentContentItem().getValueType() != valueType) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong value type"); + result = SR_EC_InvalidContentItem; + } + else if (getCurrentContentItem().getConceptName() != conceptName) + { + DCMSR_CMR_WARN("Cannot replace value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ") ... wrong concept name"); + result = SR_EC_InvalidConceptName; + } else { + DCMSR_CMR_DEBUG("Replacing value of '" << conceptName.getCodeMeaning() + << "' content item (" << annotationText << ")"); + /* the actual replacing of the value is done by the caller of this method */ + } + } else + result = SR_EC_InvalidTemplateStructure; + /* finally, set annotation */ + CHECK_RESULT(getCurrentContentItem().setAnnotationText(annotationText)); + } else + result = SR_EC_InvalidConceptName; + return result; +} + + +// explicit template instantiation (needed for use in TID 1501) +template class TID300_Measurement; diff --git a/dcmsr/libcmr/tid4019.cc b/dcmsr/libcmr/tid4019.cc new file mode 100644 index 00000000..1bbc0f0c --- /dev/null +++ b/dcmsr/libcmr/tid4019.cc @@ -0,0 +1,77 @@ +/* + * + * Copyright (C) 2018, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * Source file for class TID4019_AlgorithmIdentification + * + * Author: Joerg Riesmeier + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/cmr/tid4019.h" +#include "dcmtk/dcmsr/codes/dcm.h" + +#include "dcmtk/dcmdata/dcuid.h" + + +// helper macros for checking the return value of API calls +#define CHECK_RESULT(call) if (result.good()) result = call +#define STORE_RESULT(call) result = call +#define GOOD_RESULT(call) if (result.good()) call +#define BAD_RESULT(call) if (result.bad()) call + +// general information on TID 4019 (Algorithm Identification) +#define TEMPLATE_NUMBER "4019" +#define MAPPING_RESOURCE "DCMR" +#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource +#define TEMPLATE_TYPE OFFalse /* non-extensible */ +#define TEMPLATE_ORDER OFTrue /* significant */ + + +TID4019_AlgorithmIdentification::TID4019_AlgorithmIdentification() + : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID) +{ + setExtensible(TEMPLATE_TYPE); + setOrderSignificant(TEMPLATE_ORDER); +} + + +OFCondition TID4019_AlgorithmIdentification::setIdentification(const OFString &algorithmName, + const OFString &algorithmVersion, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* create a new subtree in order to "rollback" in case of error */ + DSRDocumentSubTree subTree; + /* TID 4019 (Algorithm Identification) Row 1 */ + STORE_RESULT(subTree.addContentItem(RT_unknown, VT_Text, CODE_DCM_AlgorithmName, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setStringValue(algorithmName, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setAnnotationText("TID 4019 - Row 1")); + /* TID 4019 (Algorithm Identification) Row 2 */ + CHECK_RESULT(subTree.addContentItem(RT_unknown, VT_Text, CODE_DCM_AlgorithmVersion, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setStringValue(algorithmVersion, check)); + CHECK_RESULT(subTree.getCurrentContentItem().setAnnotationText("TID 4019 - Row 2")); + /* if everything was OK, replace current subtree of the template */ + GOOD_RESULT(swap(subTree)); + return result; +} + + +OFCondition TID4019_AlgorithmIdentification::addParameter(const OFString &algorithmParameter, + const OFBool check) +{ + OFCondition result = SR_EC_InvalidTemplateStructure; + /* check whether mandatory content items exist, i.e. the tree is not empty */ + if (!isEmpty()) + { + /* TID 4019 (Algorithm Identification) Row 3 */ + STORE_RESULT(addContentItem(RT_unknown, VT_Text, CODE_DCM_AlgorithmParameters, check)); + CHECK_RESULT(getCurrentContentItem().setStringValue(algorithmParameter, check)); + CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 4019 - Row 3")); + } + return result; +} diff --git a/dcmsr/libsrc/CMakeLists.txt b/dcmsr/libsrc/CMakeLists.txt new file mode 100644 index 00000000..73154406 --- /dev/null +++ b/dcmsr/libsrc/CMakeLists.txt @@ -0,0 +1,5 @@ +# create library from source files +DCMTK_ADD_LIBRARY(dcmsr dsrcitem dsrcodtn dsrcodvl dsrcomtn dsrcomvl dsrcontn dsrcsidl dsrdattn dsrdncsr dsrdnflt dsrdoc dsrdocst dsrdoctn dsrdoctr dsrdtitn dsrimgfr dsrimgse dsrimgtn dsrimgvl dsritcsr dsrnumtn dsrnumvl dsrpnmtn dsrposcn dsrrefin dsrreftn dsrscogr dsrsc3gr dsrscotn dsrsc3tn dsrscovl dsrsc3vl dsrsoprf dsrstrvl dsrtcodt dsrtcosp dsrtcotn dsrtcoto dsrtcovl dsrtextn dsrtimtn dsrtpltn dsrtree dsrtypes dsruidtn dsrwavch dsrwavtn dsrwavvl dsrxmlc dsrxmld dsriodcc dsrbascc dsrenhcc dsrcomcc dsrkeycc dsrmamcc dsrchecc dsrcolcc dsrprocc dsrxrdcc dsrspecc dsrmaccc dsrimpcc dsrc3dcc dsrrrdcc dsracqcc dsrsaecc dsrprdcc dsrpficc dsrplicc dsrctpl dsrrtpl dsrstpl dsrctxgr) + +DCMTK_TARGET_LINK_MODULES(dcmsr ofstd oflog dcmdata dcmimgle dcmimage) +DCMTK_TARGET_LINK_LIBRARIES(dcmsr ${LIBXML_LIBS}) diff --git a/dcmsr/libsrc/Makefile.dep b/dcmsr/libsrc/Makefile.dep new file mode 100644 index 00000000..a97cade6 --- /dev/null +++ b/dcmsr/libsrc/Makefile.dep @@ -0,0 +1,4858 @@ +dsracqcc.o: dsracqcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsracqcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrbascc.o: dsrbascc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrbascc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrc3dcc.o: dsrc3dcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrc3dcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrchecc.o: dsrchecc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrchecc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrcitem.o: dsrcitem.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrcitem.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrtextn.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrcodtn.h \ + ../include/dcmtk/dcmsr/dsrnumtn.h ../include/dcmtk/dcmsr/dsrdtitn.h \ + ../include/dcmtk/dcmsr/dsrdattn.h ../include/dcmtk/dcmsr/dsrtimtn.h \ + ../include/dcmtk/dcmsr/dsruidtn.h ../include/dcmtk/dcmsr/dsrpnmtn.h \ + ../include/dcmtk/dcmsr/dsrscotn.h ../include/dcmtk/dcmsr/dsrsc3tn.h \ + ../include/dcmtk/dcmsr/dsrtcotn.h ../include/dcmtk/dcmsr/dsrcomtn.h \ + ../include/dcmtk/dcmsr/dsrimgtn.h ../include/dcmtk/dcmsr/dsrwavtn.h \ + ../include/dcmtk/dcmsr/dsrcontn.h ../include/dcmtk/dcmsr/dsrreftn.h +dsrcodtn.o: dsrcodtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcodtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +dsrcodvl.o: dsrcodvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h +dsrcolcc.o: dsrcolcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrcolcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrcomcc.o: dsrcomcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrcomcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrcomtn.o: dsrcomtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcomtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +dsrcomvl.o: dsrcomvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrcontn.o: dsrcontn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcontn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +dsrcsidl.o: dsrcsidl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrcsidl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h +dsrctpl.o: dsrctpl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrctpl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsritcsr.h \ + ../include/dcmtk/dcmsr/dsrcitem.h ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h +dsrctxgr.o: dsrctxgr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrctxgr.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h +dsrdattn.o: dsrdattn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrdattn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h +dsrdncsr.o: dsrdncsr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdnflt.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h +dsrdnflt.o: dsrdnflt.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrdnflt.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrdoc.o: dsrdoc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrdoc.h ../include/dcmtk/dcmsr/dsrdoctr.h \ + ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrrtpl.h \ + ../include/dcmtk/dcmsr/dsrctpl.h ../include/dcmtk/dcmsr/dsrsoprf.h \ + ../include/dcmtk/dcmsr/dsrrefin.h ../include/dcmtk/dcmsr/dsrcsidl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../include/dcmtk/dcmsr/dsrpnmtn.h ../include/dcmtk/dcmsr/dsrstrvl.h \ + ../include/dcmtk/dcmsr/dsrdattn.h ../include/dcmtk/dcmsr/dsrdtitn.h \ + ../include/dcmtk/dcmsr/dsrtimtn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h +dsrdocst.o: dsrdocst.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrcontn.h \ + ../include/dcmtk/dcmsr/dsrreftn.h ../include/dcmtk/dcmsr/dsrtpltn.h \ + ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/dsrdoctr.h \ + ../include/dcmtk/dcmsr/dsrctpl.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrdoctn.o: dsrdoctn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsrdtitn.h ../include/dcmtk/dcmsr/dsrstrvl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../include/dcmtk/dcmsr/dsriodcc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h +dsrdoctr.o: dsrdoctr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrcontn.h \ + ../include/dcmtk/dcmsr/dsrreftn.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +dsrdtitn.o: dsrdtitn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrdtitn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +dsrenhcc.o: dsrenhcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrenhcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrimgfr.o: dsrimgfr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrimgfr.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrimgse.o: dsrimgse.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h +dsrimgtn.o: dsrimgtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrimgtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgfr.h ../include/dcmtk/dcmsr/dsrtlist.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +dsrimgvl.o: dsrimgvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrimgse.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \ + ../../dcmimage/include/dcmtk/dcmimage/diregist.h \ + ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h \ + ../../dcmimage/include/dcmtk/dcmimage/dicdefin.h \ + ../../dcmimage/include/dcmtk/dcmimage/diquant.h \ + ../../dcmimage/include/dcmtk/dcmimage/diqttype.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +dsrimpcc.o: dsrimpcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrimpcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsriodcc.o: dsriodcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsriodcc.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsritcsr.o: dsritcsr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrtpltn.h ../include/dcmtk/dcmsr/dsrstpl.h \ + ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsrcitem.h ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h +dsrkeycc.o: dsrkeycc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrkeycc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrmaccc.o: dsrmaccc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrmaccc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrmamcc.o: dsrmamcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrmamcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrnumtn.o: dsrnumtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrnumtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h +dsrnumvl.o: dsrnumvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrpficc.o: dsrpficc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrpficc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrplicc.o: dsrplicc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrplicc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrpnmtn.o: dsrpnmtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrpnmtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrposcn.o: dsrposcn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../include/dcmtk/dcmsr/dsrtypes.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrprdcc.o: dsrprdcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrprdcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrprocc.o: dsrprocc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrprocc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrrefin.o: dsrrefin.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrrefin.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrreftn.o: dsrreftn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrreftn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h +dsrrrdcc.o: dsrrrdcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrrrdcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrrtpl.o: dsrrtpl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrrtpl.h ../include/dcmtk/dcmsr/dsrdoctr.h \ + ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h +dsrsaecc.o: dsrsaecc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrsaecc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrsc3gr.o: dsrsc3gr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h +dsrsc3tn.o: dsrsc3tn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrsc3tn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrsc3vl.h ../include/dcmtk/dcmsr/dsrsc3gr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h +dsrsc3vl.o: dsrsc3vl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrsc3vl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtlist.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrscogr.o: dsrscogr.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrscogr.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h +dsrscotn.o: dsrscotn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrscotn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h +dsrscovl.o: dsrscovl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrscogr.h ../include/dcmtk/dcmsr/dsrtlist.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrsoprf.o: dsrsoprf.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrsoprf.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h +dsrspecc.o: dsrspecc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrspecc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h +dsrstpl.o: dsrstpl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/dsrdoctr.h \ + ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsrtree.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h +dsrstrvl.o: dsrstrvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h +dsrtcodt.o: dsrtcodt.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +dsrtcosp.o: dsrtcosp.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtcosp.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h +dsrtcotn.o: dsrtcotn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtcotn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrtcovl.h ../include/dcmtk/dcmsr/dsrtcodt.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h +dsrtcoto.o: dsrtcoto.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrtcovl.o: dsrtcovl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtcovl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtlist.h \ + ../include/dcmtk/dcmsr/dsrtcosp.h ../include/dcmtk/dcmsr/dsrtcoto.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +dsrtextn.o: dsrtextn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtextn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrtimtn.o: dsrtimtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtimtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h +dsrtpltn.o: dsrtpltn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtpltn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/dsrdoctr.h \ + ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsrdncsr.h \ + ../include/dcmtk/dcmsr/dsrdnflt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \ + ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \ + ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h +dsrtree.o: dsrtree.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \ + ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h +dsrtypes.o: dsrtypes.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtextn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrcodtn.h \ + ../include/dcmtk/dcmsr/dsrnumtn.h ../include/dcmtk/dcmsr/dsrnumvl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \ + ../include/dcmtk/dcmsr/dsrdtitn.h ../include/dcmtk/dcmsr/dsrdattn.h \ + ../include/dcmtk/dcmsr/dsrtimtn.h ../include/dcmtk/dcmsr/dsruidtn.h \ + ../include/dcmtk/dcmsr/dsrpnmtn.h ../include/dcmtk/dcmsr/dsrscotn.h \ + ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3tn.h \ + ../include/dcmtk/dcmsr/dsrsc3vl.h ../include/dcmtk/dcmsr/dsrsc3gr.h \ + ../include/dcmtk/dcmsr/dsrtcotn.h ../include/dcmtk/dcmsr/dsrtcovl.h \ + ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \ + ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomtn.h \ + ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrimgtn.h \ + ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \ + ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavtn.h \ + ../include/dcmtk/dcmsr/dsrwavvl.h ../include/dcmtk/dcmsr/dsrwavch.h \ + ../include/dcmtk/dcmsr/dsrcontn.h ../include/dcmtk/dcmsr/dsrreftn.h \ + ../include/dcmtk/dcmsr/dsrbascc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrenhcc.h ../include/dcmtk/dcmsr/dsrcomcc.h \ + ../include/dcmtk/dcmsr/dsrkeycc.h ../include/dcmtk/dcmsr/dsrmamcc.h \ + ../include/dcmtk/dcmsr/dsrchecc.h ../include/dcmtk/dcmsr/dsrcolcc.h \ + ../include/dcmtk/dcmsr/dsrprocc.h ../include/dcmtk/dcmsr/dsrxrdcc.h \ + ../include/dcmtk/dcmsr/dsrspecc.h ../include/dcmtk/dcmsr/dsrmaccc.h \ + ../include/dcmtk/dcmsr/dsrimpcc.h ../include/dcmtk/dcmsr/dsrc3dcc.h \ + ../include/dcmtk/dcmsr/dsrrrdcc.h ../include/dcmtk/dcmsr/dsracqcc.h \ + ../include/dcmtk/dcmsr/dsrsaecc.h ../include/dcmtk/dcmsr/dsrprdcc.h \ + ../include/dcmtk/dcmsr/dsrpficc.h ../include/dcmtk/dcmsr/dsrplicc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \ + ../../ofstd/include/dcmtk/ofstd/ofdate.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \ + ../../ofstd/include/dcmtk/ofstd/ofdatime.h \ + ../../ofstd/include/dcmtk/ofstd/oftime.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h +dsruidtn.o: dsruidtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsruidtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h +dsrwavch.o: dsrwavch.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h +dsrwavtn.o: dsrwavtn.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrwavtn.h ../include/dcmtk/dcmsr/dsrdoctn.h \ + ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \ + ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \ + ../../ofstd/include/dcmtk/ofstd/ofstack.h \ + ../include/dcmtk/dcmsr/dsrcodvl.h \ + ../../ofstd/include/dcmtk/ofstd/ofexbl.h \ + ../include/dcmtk/dcmsr/dsrwavvl.h ../include/dcmtk/dcmsr/dsrcomvl.h \ + ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrtlist.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h +dsrwavvl.o: dsrwavvl.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrwavvl.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrwavch.h \ + ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrxmld.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcuid.h +dsrxmlc.o: dsrxmlc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h +dsrxmld.o: dsrxmld.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrtypes.h \ + ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \ + ../include/dcmtk/dcmsr/dsrxmlc.h +dsrxrdcc.o: dsrxrdcc.cc ../../config/include/dcmtk/config/osconfig.h \ + ../include/dcmtk/dcmsr/dsrxrdcc.h ../include/dcmtk/dcmsr/dsriodcc.h \ + ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofdefine.h \ + ../../ofstd/include/dcmtk/ofstd/ofcast.h \ + ../../ofstd/include/dcmtk/ofstd/ofexport.h \ + ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \ + ../../ofstd/include/dcmtk/ofstd/ofglobal.h \ + ../../ofstd/include/dcmtk/ofstd/ofthread.h \ + ../../ofstd/include/dcmtk/ofstd/oftypes.h \ + ../../ofstd/include/dcmtk/ofstd/ofstream.h \ + ../../ofstd/include/dcmtk/ofstd/ofstring.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \ + ../../ofstd/include/dcmtk/ofstd/ofcond.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \ + ../../oflog/include/dcmtk/oflog/oflog.h \ + ../../oflog/include/dcmtk/oflog/logger.h \ + ../../oflog/include/dcmtk/oflog/config.h \ + ../../oflog/include/dcmtk/oflog/config/defines.h \ + ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \ + ../../oflog/include/dcmtk/oflog/loglevel.h \ + ../../ofstd/include/dcmtk/ofstd/ofvector.h \ + ../../oflog/include/dcmtk/oflog/tstring.h \ + ../../oflog/include/dcmtk/oflog/tchar.h \ + ../../oflog/include/dcmtk/oflog/spi/apndatch.h \ + ../../oflog/include/dcmtk/oflog/appender.h \ + ../../ofstd/include/dcmtk/ofstd/ofmem.h \ + ../../ofstd/include/dcmtk/ofstd/ofutil.h \ + ../../ofstd/include/dcmtk/ofstd/oftraits.h \ + ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \ + ../../oflog/include/dcmtk/oflog/layout.h \ + ../../oflog/include/dcmtk/oflog/streams.h \ + ../../oflog/include/dcmtk/oflog/helpers/pointer.h \ + ../../oflog/include/dcmtk/oflog/thread/syncprim.h \ + ../../oflog/include/dcmtk/oflog/spi/filter.h \ + ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \ + ../../oflog/include/dcmtk/oflog/spi/logfact.h \ + ../../oflog/include/dcmtk/oflog/logmacro.h \ + ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \ + ../../oflog/include/dcmtk/oflog/tracelog.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctag.h \ + ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \ + ../../ofstd/include/dcmtk/ofstd/offile.h \ + ../../ofstd/include/dcmtk/ofstd/ofstd.h \ + ../../ofstd/include/dcmtk/ofstd/oflist.h \ + ../../ofstd/include/dcmtk/ofstd/oflimits.h \ + ../../config/include/dcmtk/config/arith.h \ + ../../ofstd/include/dcmtk/ofstd/oferror.h \ + ../../dcmdata/include/dcmtk/dcmdata/dclist.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \ + ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h diff --git a/dcmsr/libsrc/Makefile.in b/dcmsr/libsrc/Makefile.in new file mode 100644 index 00000000..bc1c80a9 --- /dev/null +++ b/dcmsr/libsrc/Makefile.in @@ -0,0 +1,64 @@ +# +# Makefile for dcmsr/libsrc +# + +@SET_MAKE@ + +SHELL = /bin/sh +VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +configdir = @top_srcdir@/@configdir@ + +include $(configdir)/@common_makefile@ + +ofstddir = $(top_srcdir)/../ofstd +oflogdir = $(top_srcdir)/../oflog +dcmdatadir = $(top_srcdir)/../dcmdata +dcmimgledir = $(top_srcdir)/../dcmimgle +dcmimagedir = $(top_srcdir)/../dcmimage + +LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include \ + -I$(dcmimgledir)/include -I$(dcmimagedir)/include +LOCALDEFS = + +objs = dsrdoc.o dsrposcn.o dsrdncsr.o dsritcsr.o dsrdnflt.o dsrtree.o \ + dsrdoctn.o dsrdoctr.o dsrdocst.o dsrctpl.o dsrrtpl.o dsrstpl.o \ + dsrctxgr.o dsrcitem.o dsrtypes.o dsrimgfr.o dsrimgse.o dsrscogr.o \ + dsrsc3gr.o dsrtcodt.o dsrtcosp.o dsrtcoto.o dsrwavch.o dsrstrvl.o \ + dsrcodvl.o dsrnumvl.o dsrscovl.o dsrsc3vl.o dsrtcovl.o dsrcomvl.o \ + dsrimgvl.o dsrwavvl.o dsrtextn.o dsrcodtn.o dsrnumtn.o dsrdtitn.o \ + dsrdattn.o dsrtimtn.o dsruidtn.o dsrpnmtn.o dsrscotn.o dsrsc3tn.o \ + dsrtcotn.o dsrcomtn.o dsrimgtn.o dsrwavtn.o dsrcontn.o dsrreftn.o \ + dsrtpltn.o dsrsoprf.o dsrrefin.o dsrcsidl.o dsrxmlc.o dsrxmld.o \ + dsriodcc.o dsrbascc.o dsrenhcc.o dsrcomcc.o dsrkeycc.o dsrmamcc.o \ + dsrchecc.o dsrcolcc.o dsrprocc.o dsrxrdcc.o dsrspecc.o dsrmaccc.o \ + dsrimpcc.o dsrc3dcc.o dsrrrdcc.o dsracqcc.o dsrsaecc.o dsrprdcc.o \ + dsrpficc.o dsrplicc.o +library = libdcmsr.$(LIBEXT) + + +all: $(library) + +install: $(library) + $(configdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(library) $(DESTDIR)$(libdir)/$(library) + $(RANLIB) $(DESTDIR)$(libdir)/$(library) + + +$(library): $(objs) + $(AR) $(ARFLAGS) $@ $(objs) + $(RANLIB) $@ + + +clean: + rm -f $(objs) $(library) $(TRASH) + +distclean: + rm -f $(objs) $(library) $(DISTTRASH) + + +dependencies: + $(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc > $(DEP) + +include $(DEP) diff --git a/dcmsr/libsrc/dsracqcc.cc b/dcmsr/libsrc/dsracqcc.cc new file mode 100644 index 00000000..09fa9014 --- /dev/null +++ b/dcmsr/libsrc/dsracqcc.cc @@ -0,0 +1,109 @@ +/* + * + * Copyright (C) 2015-2019, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRAcquisitionContextSRConstraintChecker + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsracqcc.h" + + +DSRAcquisitionContextSRConstraintChecker::DSRAcquisitionContextSRConstraintChecker() + : DSRIODConstraintChecker() +{ +} + + +DSRAcquisitionContextSRConstraintChecker::~DSRAcquisitionContextSRConstraintChecker() +{ +} + + +OFBool DSRAcquisitionContextSRConstraintChecker::isByReferenceAllowed() const +{ + return OFFalse; +} + + +OFBool DSRAcquisitionContextSRConstraintChecker::isTemplateSupportRequired() const +{ + return OFFalse; +} + + +OFCondition DSRAcquisitionContextSRConstraintChecker::getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + templateIdentifier.clear(); + mappingResource.clear(); + return EC_Normal; +} + + +DSRTypes::E_DocumentType DSRAcquisitionContextSRConstraintChecker::getDocumentType() const +{ + return DT_AcquisitionContextSR; +} + + +OFBool DSRAcquisitionContextSRConstraintChecker::checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference) const +{ + /* the following code implements the constraints of table A.35.16-2 in DICOM PS3.3 */ + OFBool result = OFFalse; + /* by-reference relationships not allowed at all */ + if (!byReference) + { + /* row 1 of the table */ + if ((relationshipType == RT_contains) && (sourceValueType == VT_Container)) + { + result = (targetValueType == VT_Code) || (targetValueType == VT_Container) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Num) || (targetValueType == VT_PName) || (targetValueType == VT_Text) || + (targetValueType == VT_Time) || (targetValueType == VT_UIDRef); + } + /* row 2 of the table */ + else if ((relationshipType == RT_hasObsContext) && ((sourceValueType == VT_Container))) + { + result = (targetValueType == VT_Code) || (targetValueType == VT_Date) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Num) || (targetValueType == VT_PName) || (targetValueType == VT_Text) || + (targetValueType == VT_Time) || (targetValueType == VT_UIDRef); + } + /* row 3 of the table */ + else if ((relationshipType == RT_hasObsContext) && (sourceValueType == VT_Code)) + { + result = (targetValueType == VT_Code); + } + /* row 4 of the table */ + else if (relationshipType == RT_hasConceptMod) + { + result = (targetValueType == VT_Code) || (targetValueType == VT_Text); + } + /* row 5 of the table */ + else if ((relationshipType == RT_hasProperties) && (sourceValueType == VT_Code)) + { + result = (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || (targetValueType == VT_Num) || + (targetValueType == VT_SCoord3D) || (targetValueType == VT_Text); + } + } + return result; +} diff --git a/dcmsr/libsrc/dsrbascc.cc b/dcmsr/libsrc/dsrbascc.cc new file mode 100644 index 00000000..cc2db99c --- /dev/null +++ b/dcmsr/libsrc/dsrbascc.cc @@ -0,0 +1,130 @@ +/* + * + * Copyright (C) 2003-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRBasicTextSRConstraintChecker + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrbascc.h" + + +DSRBasicTextSRConstraintChecker::DSRBasicTextSRConstraintChecker() + : DSRIODConstraintChecker() +{ +} + + +DSRBasicTextSRConstraintChecker::~DSRBasicTextSRConstraintChecker() +{ +} + + +OFBool DSRBasicTextSRConstraintChecker::isByReferenceAllowed() const +{ + return OFFalse; +} + + +OFBool DSRBasicTextSRConstraintChecker::isTemplateSupportRequired() const +{ + return OFFalse; +} + + +OFCondition DSRBasicTextSRConstraintChecker::getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + templateIdentifier.clear(); + mappingResource.clear(); + return EC_Normal; +} + + +DSRTypes::E_DocumentType DSRBasicTextSRConstraintChecker::getDocumentType() const +{ + return DT_BasicTextSR; +} + + +OFBool DSRBasicTextSRConstraintChecker::checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference) const +{ + /* the following code implements the constraints of table A.35.1-2 in DICOM PS3.3 */ + OFBool result = OFFalse; + /* by-reference relationships not allowed at all */ + if (!byReference) + { + /* row 1 of the table */ + if ((relationshipType == RT_contains) && (sourceValueType == VT_Container)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName) || (targetValueType == VT_Composite) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || (targetValueType == VT_Container); + } + /* row 2 of the table */ + else if ((relationshipType == RT_hasObsContext) && (sourceValueType == VT_Container)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName) || (targetValueType == VT_Composite); + } + /* row 3 of the table */ + else if ((relationshipType == RT_hasAcqContext) && ((sourceValueType == VT_Container) || + (sourceValueType == VT_Image) || (sourceValueType == VT_Waveform) || (sourceValueType == VT_Composite))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName); + } + /* row 4 of the table */ + else if (relationshipType == RT_hasConceptMod) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code); + } + /* row 5 of the table */ + else if ((relationshipType == RT_hasProperties) && (sourceValueType == VT_Text)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName) || (targetValueType == VT_Image) || (targetValueType == VT_Waveform) || + (targetValueType == VT_Composite); + } + /* row 6 of the table - introduced with CP-1076 */ + else if ((relationshipType == RT_hasProperties) && (sourceValueType == VT_PName)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName); + } + /* row 7 of the table */ + else if ((relationshipType == RT_inferredFrom) && (sourceValueType == VT_Text)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName) || (targetValueType == VT_Image) || (targetValueType == VT_Waveform) || + (targetValueType == VT_Composite); + } + } + return result; +} diff --git a/dcmsr/libsrc/dsrc3dcc.cc b/dcmsr/libsrc/dsrc3dcc.cc new file mode 100644 index 00000000..a48709e9 --- /dev/null +++ b/dcmsr/libsrc/dsrc3dcc.cc @@ -0,0 +1,144 @@ +/* + * + * Copyright (C) 2013-2015, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRComprehensive3DSRConstraintChecker + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrc3dcc.h" + + +DSRComprehensive3DSRConstraintChecker::DSRComprehensive3DSRConstraintChecker() + : DSRIODConstraintChecker() +{ +} + + +DSRComprehensive3DSRConstraintChecker::~DSRComprehensive3DSRConstraintChecker() +{ +} + + +OFBool DSRComprehensive3DSRConstraintChecker::isByReferenceAllowed() const +{ + return OFTrue; +} + + +OFBool DSRComprehensive3DSRConstraintChecker::isTemplateSupportRequired() const +{ + return OFFalse; +} + + +OFCondition DSRComprehensive3DSRConstraintChecker::getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + templateIdentifier.clear(); + mappingResource.clear(); + return EC_Normal; +} + + +DSRTypes::E_DocumentType DSRComprehensive3DSRConstraintChecker::getDocumentType() const +{ + return DT_Comprehensive3DSR; +} + + +OFBool DSRComprehensive3DSRConstraintChecker::checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference) const +{ + /* the following code implements the constraints of table A.35.13-2 in DICOM PS3.3 */ + OFBool result = OFFalse; + /* row 1 of the table */ + if ((relationshipType == RT_contains) && (sourceValueType == VT_Container)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_SCoord) || + (targetValueType == VT_SCoord3D) || (targetValueType == VT_TCoord) || (targetValueType == VT_Composite) || + (targetValueType == VT_Image) || (targetValueType == VT_Waveform) || + ((targetValueType == VT_Container) && !byReference /* only by-value */); + } + /* row 2 of the table */ + else if ((relationshipType == RT_hasObsContext) && ((sourceValueType == VT_Container) || + (sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Composite); + } + /* row 3 of the table */ + else if ((relationshipType == RT_hasAcqContext) && ((sourceValueType == VT_Container) || (sourceValueType == VT_Image) || + (sourceValueType == VT_Waveform) || (sourceValueType == VT_Composite) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Container); + } + /* row 4 of the table */ + else if ((relationshipType == RT_hasConceptMod) && !byReference /* only by-value */) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code); + } + /* row 5 of the table */ + else if ((relationshipType == RT_hasProperties) && + ((sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || (targetValueType == VT_Composite) || (targetValueType == VT_SCoord) || + (targetValueType == VT_SCoord3D) || (targetValueType == VT_TCoord) || (targetValueType == VT_Container); + } + /* row 6 of the table */ + else if ((relationshipType == RT_hasProperties) && (sourceValueType == VT_PName)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName); + } + /* row 7 of the table */ + else if ((relationshipType == RT_inferredFrom) && + ((sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || (targetValueType == VT_Composite) || (targetValueType == VT_SCoord) || + (targetValueType == VT_SCoord3D) || (targetValueType == VT_TCoord) || (targetValueType == VT_Container); + } + /* row 8 of the table */ + else if ((relationshipType == RT_selectedFrom) && (sourceValueType == VT_SCoord)) + { + result = (targetValueType == VT_Image); + } + /* row 9 of the table */ + else if ((relationshipType == RT_selectedFrom) && (sourceValueType == VT_TCoord)) + { + result = (targetValueType == VT_SCoord) || (targetValueType == VT_SCoord3D) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform); + } + return result; +} diff --git a/dcmsr/libsrc/dsrchecc.cc b/dcmsr/libsrc/dsrchecc.cc new file mode 100644 index 00000000..5a095cb3 --- /dev/null +++ b/dcmsr/libsrc/dsrchecc.cc @@ -0,0 +1,132 @@ +/* + * + * Copyright (C) 2003-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRChestCadSRConstraintChecker + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrchecc.h" + + +DSRChestCadSRConstraintChecker::DSRChestCadSRConstraintChecker() + : DSRIODConstraintChecker() +{ +} + + +DSRChestCadSRConstraintChecker::~DSRChestCadSRConstraintChecker() +{ +} + + +OFBool DSRChestCadSRConstraintChecker::isByReferenceAllowed() const +{ + return OFTrue; +} + + +OFBool DSRChestCadSRConstraintChecker::isTemplateSupportRequired() const +{ + return OFTrue; +} + + +OFCondition DSRChestCadSRConstraintChecker::getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + templateIdentifier = "4100"; + mappingResource = "DCMR"; + return EC_Normal; +} + + +DSRTypes::E_DocumentType DSRChestCadSRConstraintChecker::getDocumentType() const +{ + return DT_ChestCadSR; +} + + +OFBool DSRChestCadSRConstraintChecker::checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference) const +{ + /* the following code implements the constraints of table A.35.6-2 in DICOM PS3.3 */ + OFBool result = OFFalse; + /* row 1 of the table */ + if ((relationshipType == RT_contains) && !byReference && (sourceValueType == VT_Container)) + { + result = (targetValueType == VT_Code) || (targetValueType == VT_Num) || (targetValueType == VT_Image) || + (targetValueType == VT_Container); + } + /* row 2 of the table */ + else if ((relationshipType == RT_hasObsContext) && !byReference && ((sourceValueType == VT_Container) || + (sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_PName) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_Composite); + } + /* row 3 of the table */ + else if ((relationshipType == RT_hasAcqContext) && !byReference && + ((sourceValueType == VT_Image) || (sourceValueType == VT_Waveform))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_Date) || (targetValueType == VT_Time); + } + /* row 4 of the table */ + else if ((relationshipType == RT_hasConceptMod) && !byReference && ((sourceValueType == VT_Container) || + (sourceValueType == VT_Code) || (sourceValueType == VT_Composite) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code); + } + /* row 5 the table */ + else if ((relationshipType == RT_hasProperties) && + ((sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + /* by-reference allowed */ + result = (targetValueType == VT_Container) || (targetValueType == VT_Text) || (targetValueType == VT_Code) || + (targetValueType == VT_Num) || (targetValueType == VT_Date) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || (targetValueType == VT_SCoord) || (targetValueType == VT_TCoord) || + (targetValueType == VT_UIDRef); + } + /* row 6 of the table */ + else if ((relationshipType == RT_inferredFrom) && ((sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + /* by-reference allowed */ + result = (targetValueType == VT_Code) || (targetValueType == VT_Num) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || (targetValueType == VT_SCoord) || (targetValueType == VT_TCoord) || + (targetValueType == VT_Container) || (targetValueType == VT_Text); + } + /* row 7 of the table */ + else if ((relationshipType == RT_selectedFrom) && (sourceValueType == VT_SCoord)) + { + /* by-reference allowed */ + result = (targetValueType == VT_Image); + } + /* row 8 of the table */ + else if ((relationshipType == RT_selectedFrom) && (sourceValueType == VT_TCoord)) + { + /* by-reference allowed */ + result = (targetValueType == VT_SCoord) || (targetValueType == VT_Image) || (targetValueType == VT_Waveform); + } + return result; +} diff --git a/dcmsr/libsrc/dsrcitem.cc b/dcmsr/libsrc/dsrcitem.cc new file mode 100644 index 00000000..196cfb32 --- /dev/null +++ b/dcmsr/libsrc/dsrcitem.cc @@ -0,0 +1,792 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRContentItem + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcitem.h" +#include "dcmtk/dcmsr/dsrtextn.h" +#include "dcmtk/dcmsr/dsrcodtn.h" +#include "dcmtk/dcmsr/dsrnumtn.h" +#include "dcmtk/dcmsr/dsrdtitn.h" +#include "dcmtk/dcmsr/dsrdattn.h" +#include "dcmtk/dcmsr/dsrtimtn.h" +#include "dcmtk/dcmsr/dsruidtn.h" +#include "dcmtk/dcmsr/dsrpnmtn.h" +#include "dcmtk/dcmsr/dsrscotn.h" +#include "dcmtk/dcmsr/dsrsc3tn.h" +#include "dcmtk/dcmsr/dsrtcotn.h" +#include "dcmtk/dcmsr/dsrcomtn.h" +#include "dcmtk/dcmsr/dsrimgtn.h" +#include "dcmtk/dcmsr/dsrwavtn.h" +#include "dcmtk/dcmsr/dsrcontn.h" +#include "dcmtk/dcmsr/dsrreftn.h" + + +// definition of empty default objects +const OFString DSRContentItem::EmptyString; +const DSRCodedEntryValue DSRContentItem::EmptyCodedEntry; +const DSRSpatialCoordinatesValue DSRContentItem::EmptySpatialCoordinates; +const DSRSpatialCoordinates3DValue DSRContentItem::EmptySpatialCoordinates3D; +const DSRTemporalCoordinatesValue DSRContentItem::EmptyTemporalCoordinates; +const DSRCompositeReferenceValue DSRContentItem::EmptyCompositeReference; +const DSRImageReferenceValue DSRContentItem::EmptyImageReference; +const DSRWaveformReferenceValue DSRContentItem::EmptyWaveformReference; + + +DSRContentItem::DSRContentItem() + : TreeNode(NULL), + DeleteTreeNode(OFFalse), + EmptyNumericMeasurement() +{ +} + + +DSRContentItem::DSRContentItem(const DSRContentItem &item) + : TreeNode(NULL), + DeleteTreeNode(OFTrue), + EmptyNumericMeasurement() +{ + if (item.TreeNode != NULL) + TreeNode = item.TreeNode->clone(); +} + + +DSRContentItem::~DSRContentItem() +{ + if (DeleteTreeNode) + delete TreeNode; +} + + +OFBool DSRContentItem::operator==(const DSRContentItem &item) const +{ + OFBool result = (TreeNode == item.TreeNode); + /* call comparison operator (if referenced tree nodes are not the same) */ + if (!result && (TreeNode != NULL) && (item.TreeNode != NULL)) + result = TreeNode->operator==(*item.TreeNode); + return result; +} + + +OFBool DSRContentItem::operator!=(const DSRContentItem &item) const +{ + OFBool result = (TreeNode != item.TreeNode); + /* call comparison operator (if referenced tree nodes are not the same) */ + if (result && (TreeNode != NULL) && (item.TreeNode != NULL)) + result = TreeNode->operator!=(*item.TreeNode); + return result; +} + + +OFBool DSRContentItem::isValid() const +{ + OFBool result = OFFalse; + if (TreeNode != NULL) + result = TreeNode->isValid(); + return result; +} + + +OFBool DSRContentItem::isMarked() const +{ + OFBool result = OFFalse; + if (TreeNode != NULL) + result = TreeNode->isMarked(); + return result; +} + + +void DSRContentItem::setMark(const OFBool flag) +{ + if (TreeNode != NULL) + TreeNode->setMark(flag); +} + + +DSRTypes::E_ValueType DSRContentItem::getValueType() const +{ + E_ValueType valueType = VT_invalid; + if (TreeNode != NULL) + valueType = TreeNode->getValueType(); + return valueType; +} + + +DSRTypes::E_RelationshipType DSRContentItem::getRelationshipType() const +{ + E_RelationshipType relationshipType = RT_invalid; + if (TreeNode != NULL) + relationshipType = TreeNode->getRelationshipType(); + return relationshipType; +} + + +size_t DSRContentItem::getReferencedNodeID() const +{ + size_t nodeID = 0; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_byReference) + nodeID = OFstatic_cast(DSRByReferenceTreeNode *, TreeNode)->getReferencedNodeID(); + } + return nodeID; +} + + +const OFString &DSRContentItem::getStringValue() const +{ + if (TreeNode != NULL) + { + switch (TreeNode->getValueType()) + { + case VT_Text: + return OFstatic_cast(DSRTextTreeNode *, TreeNode)->getValue(); + case VT_DateTime: + return OFstatic_cast(DSRDateTimeTreeNode *, TreeNode)->getValue(); + case VT_Date: + return OFstatic_cast(DSRDateTreeNode *, TreeNode)->getValue(); + case VT_Time: + return OFstatic_cast(DSRTimeTreeNode *, TreeNode)->getValue(); + case VT_UIDRef: + return OFstatic_cast(DSRUIDRefTreeNode *, TreeNode)->getValue(); + case VT_PName: + return OFstatic_cast(DSRPNameTreeNode *, TreeNode)->getValue(); + default: + break; + } + } + return EmptyString; +} + + +OFCondition DSRContentItem::setStringValue(const OFString &stringValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + switch (TreeNode->getValueType()) + { + case VT_Text: + result = OFstatic_cast(DSRTextTreeNode *, TreeNode)->setValue(stringValue, check); + break; + case VT_DateTime: + result = OFstatic_cast(DSRDateTimeTreeNode *, TreeNode)->setValue(stringValue, check); + break; + case VT_Date: + result = OFstatic_cast(DSRDateTreeNode *, TreeNode)->setValue(stringValue, check); + break; + case VT_Time: + result = OFstatic_cast(DSRTimeTreeNode *, TreeNode)->setValue(stringValue, check); + break; + case VT_UIDRef: + result = OFstatic_cast(DSRUIDRefTreeNode *, TreeNode)->setValue(stringValue, check); + break; + case VT_PName: + result = OFstatic_cast(DSRPNameTreeNode *, TreeNode)->setValue(stringValue, check); + break; + default: + break; + } + } + return result; +} + + +DSRCodedEntryValue *DSRContentItem::getCodeValuePtr() +{ + DSRCodedEntryValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Code) + pointer = OFstatic_cast(DSRCodeTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRCodedEntryValue &DSRContentItem::getCodeValue() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Code) + return OFstatic_cast(DSRCodeTreeNode *, TreeNode)->getValue(); + } + return EmptyCodedEntry; +} + + +OFCondition DSRContentItem::getCodeValue(DSRCodedEntryValue &codeValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Code) + result= OFstatic_cast(DSRCodeTreeNode *, TreeNode)->getValue(codeValue); + else + codeValue.clear(); + } else + codeValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setCodeValue(const DSRCodedEntryValue &codeValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Code) + result = OFstatic_cast(DSRCodeTreeNode *, TreeNode)->setValue(codeValue, check); + } + return result; +} + + +DSRNumericMeasurementValue *DSRContentItem::getNumericValuePtr() +{ + DSRNumericMeasurementValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Num) + pointer = OFstatic_cast(DSRNumTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRNumericMeasurementValue &DSRContentItem::getNumericValue() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Num) + return OFstatic_cast(DSRNumTreeNode *, TreeNode)->getValue(); + } + return EmptyNumericMeasurement; +} + + +OFCondition DSRContentItem::getNumericValue(DSRNumericMeasurementValue &numericValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Num) + result= OFstatic_cast(DSRNumTreeNode *, TreeNode)->getValue(numericValue); + else + numericValue.clear(); + } else + numericValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setNumericValue(const DSRNumericMeasurementValue &numericValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Num) + result = OFstatic_cast(DSRNumTreeNode *, TreeNode)->setValue(numericValue, check); + } + return result; +} + + +DSRSpatialCoordinatesValue *DSRContentItem::getSpatialCoordinatesPtr() +{ + DSRSpatialCoordinatesValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord) + pointer = OFstatic_cast(DSRSCoordTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRSpatialCoordinatesValue &DSRContentItem::getSpatialCoordinates() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord) + return OFstatic_cast(DSRSCoordTreeNode *, TreeNode)->getValue(); + } + return EmptySpatialCoordinates; +} + + +OFCondition DSRContentItem::getSpatialCoordinates(DSRSpatialCoordinatesValue &coordinatesValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord) + result= OFstatic_cast(DSRSCoordTreeNode *, TreeNode)->getValue(coordinatesValue); + else + coordinatesValue.clear(); + } else + coordinatesValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setSpatialCoordinates(const DSRSpatialCoordinatesValue &coordinatesValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord) + result = OFstatic_cast(DSRSCoordTreeNode *, TreeNode)->setValue(coordinatesValue, check); + } + return result; +} + + +DSRSpatialCoordinates3DValue *DSRContentItem::getSpatialCoordinates3DPtr() +{ + DSRSpatialCoordinates3DValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord3D) + pointer = OFstatic_cast(DSRSCoord3DTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRSpatialCoordinates3DValue &DSRContentItem::getSpatialCoordinates3D() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord3D) + return OFstatic_cast(DSRSCoord3DTreeNode *, TreeNode)->getValue(); + } + return EmptySpatialCoordinates3D; +} + + +OFCondition DSRContentItem::getSpatialCoordinates3D(DSRSpatialCoordinates3DValue &coordinatesValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord3D) + result= OFstatic_cast(DSRSCoord3DTreeNode *, TreeNode)->getValue(coordinatesValue); + else + coordinatesValue.clear(); + } else + coordinatesValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setSpatialCoordinates3D(const DSRSpatialCoordinates3DValue &coordinatesValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_SCoord3D) + result = OFstatic_cast(DSRSCoord3DTreeNode *, TreeNode)->setValue(coordinatesValue, check); + } + return result; +} + + +DSRTemporalCoordinatesValue *DSRContentItem::getTemporalCoordinatesPtr() +{ + DSRTemporalCoordinatesValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_TCoord) + pointer = OFstatic_cast(DSRTCoordTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRTemporalCoordinatesValue &DSRContentItem::getTemporalCoordinates() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_TCoord) + return OFstatic_cast(DSRTCoordTreeNode *, TreeNode)->getValue(); + } + return EmptyTemporalCoordinates; +} + + +OFCondition DSRContentItem::getTemporalCoordinates(DSRTemporalCoordinatesValue &coordinatesValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_TCoord) + result= OFstatic_cast(DSRTCoordTreeNode *, TreeNode)->getValue(coordinatesValue); + else + coordinatesValue.clear(); + } else + coordinatesValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setTemporalCoordinates(const DSRTemporalCoordinatesValue &coordinatesValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_TCoord) + result = OFstatic_cast(DSRTCoordTreeNode *, TreeNode)->setValue(coordinatesValue, check); + } + return result; +} + + +DSRCompositeReferenceValue *DSRContentItem::getCompositeReferencePtr() +{ + DSRCompositeReferenceValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Composite) + pointer = OFstatic_cast(DSRCompositeTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRCompositeReferenceValue &DSRContentItem::getCompositeReference() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Composite) + return OFstatic_cast(DSRCompositeTreeNode *, TreeNode)->getValue(); + } + return EmptyCompositeReference; +} + + +OFCondition DSRContentItem::getCompositeReference(DSRCompositeReferenceValue &referenceValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Composite) + result = OFstatic_cast(DSRCompositeTreeNode *, TreeNode)->getValue(referenceValue); + else + referenceValue.clear(); + } else + referenceValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setCompositeReference(const DSRCompositeReferenceValue &referenceValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Composite) + result = OFstatic_cast(DSRCompositeTreeNode *, TreeNode)->setValue(referenceValue, check); + } + return result; +} + + +DSRImageReferenceValue *DSRContentItem::getImageReferencePtr() +{ + DSRImageReferenceValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Image) + pointer = OFstatic_cast(DSRImageTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRImageReferenceValue &DSRContentItem::getImageReference() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Image) + return OFstatic_cast(DSRImageTreeNode *, TreeNode)->getValue(); + } + return EmptyImageReference; +} + + +OFCondition DSRContentItem::getImageReference(DSRImageReferenceValue &referenceValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Image) + result = OFstatic_cast(DSRImageTreeNode *, TreeNode)->getValue(referenceValue); + else + referenceValue.clear(); + } else + referenceValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setImageReference(const DSRImageReferenceValue &referenceValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Image) + result = OFstatic_cast(DSRImageTreeNode *, TreeNode)->setValue(referenceValue, check); + } + return result; +} + + +DSRWaveformReferenceValue *DSRContentItem::getWaveformReferencePtr() +{ + DSRWaveformReferenceValue *pointer = NULL; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Waveform) + pointer = OFstatic_cast(DSRWaveformTreeNode *, TreeNode)->getValuePtr(); + } + return pointer; +} + + +const DSRWaveformReferenceValue &DSRContentItem::getWaveformReference() const +{ + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Waveform) + return OFstatic_cast(DSRWaveformTreeNode *, TreeNode)->getValue(); + } + return EmptyWaveformReference; +} + + +OFCondition DSRContentItem::getWaveformReference(DSRWaveformReferenceValue &referenceValue) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Waveform) + result = OFstatic_cast(DSRWaveformTreeNode *, TreeNode)->getValue(referenceValue); + else + referenceValue.clear(); + } else + referenceValue.clear(); + return result; +} + + +OFCondition DSRContentItem::setWaveformReference(const DSRWaveformReferenceValue &referenceValue, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Waveform) + result = OFstatic_cast(DSRWaveformTreeNode *, TreeNode)->setValue(referenceValue, check); + } + return result; +} + + +DSRTypes::E_ContinuityOfContent DSRContentItem::getContinuityOfContent() const +{ + E_ContinuityOfContent result = COC_invalid; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Container) + result = OFstatic_cast(DSRContainerTreeNode *, TreeNode)->getContinuityOfContent(); + } + return result; +} + + +OFCondition DSRContentItem::setContinuityOfContent(const E_ContinuityOfContent continuityOfContent, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Container) + result = OFstatic_cast(DSRContainerTreeNode *, TreeNode)->setContinuityOfContent(continuityOfContent, check); + } + return result; +} + + +OFCondition DSRContentItem::getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Container) + result = TreeNode->getTemplateIdentification(templateIdentifier, mappingResource); + } + return result; +} + + +OFCondition DSRContentItem::getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource, + OFString &mappingResourceUID) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Container) + result = TreeNode->getTemplateIdentification(templateIdentifier, mappingResource, mappingResourceUID); + } + return result; +} + + +OFCondition DSRContentItem::setTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + if (TreeNode->getValueType() == VT_Container) + result = TreeNode->setTemplateIdentification(templateIdentifier, mappingResource, mappingResourceUID, check); + } + return result; +} + + +DSRCodedEntryValue *DSRContentItem::getConceptNamePtr() +{ + DSRCodedEntryValue *pointer = NULL; + if (TreeNode != NULL) + pointer = TreeNode->getConceptNamePtr(); + return pointer; +} + + +const DSRCodedEntryValue &DSRContentItem::getConceptName() const +{ + if (TreeNode != NULL) + return TreeNode->getConceptName(); + return EmptyCodedEntry; +} + + +OFCondition DSRContentItem::getConceptName(DSRCodedEntryValue &conceptName) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + result = TreeNode->getConceptName(conceptName); + else + conceptName.clear(); + return result; +} + + +OFCondition DSRContentItem::setConceptName(const DSRCodedEntryValue &conceptName, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + result = TreeNode->setConceptName(conceptName, check); + return result; +} + + +const OFString &DSRContentItem::getObservationDateTime() const +{ + if (TreeNode != NULL) + return TreeNode->getObservationDateTime(); + return EmptyString; +} + + +OFCondition DSRContentItem::setObservationDateTime(const OFString &observationDateTime, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + result = TreeNode->setObservationDateTime(observationDateTime, check); + return result; +} + + +const OFString &DSRContentItem::getObservationUID() const +{ + if (TreeNode != NULL) + return TreeNode->getObservationUID(); + return EmptyString; +} + + +OFCondition DSRContentItem::setObservationUID(const OFString &observationUID, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + result = TreeNode->setObservationUID(observationUID, check); + return result; +} + + +const OFString &DSRContentItem::getAnnotationText() const +{ + if (TreeNode != NULL) + return TreeNode->getAnnotation(); + return EmptyString; +} + + +OFCondition DSRContentItem::setAnnotationText(const OFString &annotationText) const +{ + OFCondition result = EC_IllegalCall; + if (TreeNode != NULL) + { + TreeNode->setAnnotation(annotationText); + result = EC_Normal; + } + return result; +} + + +// protected methods + +void DSRContentItem::swap(DSRContentItem &item) +{ + /* swap members */ + OFswap(TreeNode, item.TreeNode); + OFswap(DeleteTreeNode, item.DeleteTreeNode); +} diff --git a/dcmsr/libsrc/dsrcodtn.cc b/dcmsr/libsrc/dsrcodtn.cc new file mode 100644 index 00000000..93e7b9b7 --- /dev/null +++ b/dcmsr/libsrc/dsrcodtn.cc @@ -0,0 +1,206 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCodeTreeNode + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcodtn.h" +#include "dcmtk/dcmsr/dsrxmld.h" + +#include "dcmtk/dcmdata/dcdeftag.h" + + +DSRCodeTreeNode::DSRCodeTreeNode(const E_RelationshipType relationshipType) + : DSRDocumentTreeNode(relationshipType, VT_Code), + DSRCodedEntryValue() +{ +} + + +DSRCodeTreeNode::DSRCodeTreeNode(const DSRCodeTreeNode &node) + : DSRDocumentTreeNode(node), + DSRCodedEntryValue(node) +{ +} + + +DSRCodeTreeNode::~DSRCodeTreeNode() +{ +} + + +OFBool DSRCodeTreeNode::operator==(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator==(node); + if (result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = DSRCodedEntryValue::operator==(OFstatic_cast(const DSRCodeTreeNode &, node).getValue()); + } + return result; +} + + +OFBool DSRCodeTreeNode::operator!=(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator!=(node); + if (!result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = DSRCodedEntryValue::operator!=(OFstatic_cast(const DSRCodeTreeNode &, node).getValue()); + } + return result; +} + + +DSRCodeTreeNode *DSRCodeTreeNode::clone() const +{ + return new DSRCodeTreeNode(*this); +} + + +void DSRCodeTreeNode::clear() +{ + DSRDocumentTreeNode::clear(); + DSRCodedEntryValue::clear(); +} + + +OFBool DSRCodeTreeNode::isValid() const +{ + /* ConceptNameCodeSequence required */ + return DSRDocumentTreeNode::isValid() && getConceptName().isValid() && hasValidValue(); +} + + +OFBool DSRCodeTreeNode::hasValidValue() const +{ + return DSRCodedEntryValue::isValid(); +} + + +OFCondition DSRCodeTreeNode::print(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = DSRDocumentTreeNode::print(stream, flags); + if (result.good()) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << "="; + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_ITEM_VALUE) + DSRCodedEntryValue::print(stream, OFTrue /*printCodeValue*/, flags); + } + return result; +} + + +OFCondition DSRCodeTreeNode::readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + OFCondition result = SR_EC_CorruptedXMLStructure; + if (cursor.valid()) + { + /* goto "value" element */ + const DSRXMLCursor childCursor = doc.getNamedChildNode(cursor, "value"); + if (childCursor.valid()) + { + /* check whether code is stored as XML elements or attributes */ + if (doc.hasAttribute(childCursor, "codValue")) + result = DSRCodedEntryValue::readXML(doc, childCursor, flags); + else + result = DSRCodedEntryValue::readXML(doc, cursor, flags); + } + } + return result; +} + + +OFCondition DSRCodeTreeNode::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = EC_Normal; + writeXMLItemStart(stream, flags); + result = DSRDocumentTreeNode::writeXML(stream, flags); + if (flags & DSRTypes::XF_codeComponentsAsAttribute) + { + stream << "" is closed in next the writeXML() routine + DSRCodedEntryValue::writeXML(stream, flags); + stream << "" << OFendl; + } else + DSRCodedEntryValue::writeXML(stream, flags); + writeXMLItemEnd(stream, flags); + return result; +} + + +OFCondition DSRCodeTreeNode::readContentItem(DcmItem &dataset, + const size_t flags) +{ + /* read ConceptCodeSequence */ + return DSRCodedEntryValue::readSequence(dataset, DCM_ConceptCodeSequence, "1" /*type*/, flags); +} + + +OFCondition DSRCodeTreeNode::writeContentItem(DcmItem &dataset) const +{ + /* write ConceptCodeSequence */ + return DSRCodedEntryValue::writeSequence(dataset, DCM_ConceptCodeSequence); +} + + +OFCondition DSRCodeTreeNode::renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream & /*annexStream*/, + const size_t /*nestingLevel*/, + size_t & /*annexNumber*/, + const size_t flags) const +{ + /* render ConceptName */ + OFCondition result = renderHTMLConceptName(docStream, flags); + /* render Code */ + if (result.good()) + { + const OFBool fullCode = (flags & DSRTypes::HF_renderInlineCodes) || (flags & DSRTypes::HF_renderItemsSeparately); + if (!fullCode || (flags & DSRTypes::HF_useCodeDetailsTooltip)) + { + if (flags & DSRTypes::HF_XHTML11Compatibility) + docStream << ""; + else if (flags & DSRTypes::HF_HTML32Compatibility) + docStream << ""; + else /* HTML 4.01 */ + docStream << ""; + } + result = DSRCodedEntryValue::renderHTML(docStream, flags, fullCode); + if (!fullCode || (flags & DSRTypes::HF_useCodeDetailsTooltip)) + { + if (flags & DSRTypes::HF_HTML32Compatibility) + docStream << ""; + else + docStream << ""; + } + docStream << OFendl; + } + return result; +} diff --git a/dcmsr/libsrc/dsrcodvl.cc b/dcmsr/libsrc/dsrcodvl.cc new file mode 100644 index 00000000..f3604e71 --- /dev/null +++ b/dcmsr/libsrc/dsrcodvl.cc @@ -0,0 +1,822 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRBasicCodedEntry, DSRCodedEntryValue + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcodvl.h" +#include "dcmtk/dcmsr/dsrxmld.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcvruc.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrur.h" + + +// implementation of class DSRBasicCodedEntry + +DSRBasicCodedEntry::DSRBasicCodedEntry(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType) + : CodeValueType(codeValueType), + CodeValue(codeValue), + CodingSchemeDesignator(codingSchemeDesignator), + CodingSchemeVersion(), + CodeMeaning(codeMeaning) +{ +} + + +DSRBasicCodedEntry::DSRBasicCodedEntry(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType) + : CodeValueType(codeValueType), + CodeValue(codeValue), + CodingSchemeDesignator(codingSchemeDesignator), + CodingSchemeVersion(codingSchemeVersion), + CodeMeaning(codeMeaning) +{ +} + + +// implementation of class DSRCodedEntryValue + +DSRCodedEntryValue::DSRCodedEntryValue() + : CodeValueType(DSRTypes::CVT_auto), + CodeValue(), + CodingSchemeDesignator(), + CodingSchemeVersion(), + CodeMeaning(), + ContextIdentifier(), + ContextUID(), + MappingResource(), + ContextGroupVersion(), + ContextGroupLocalVersion(), + ContextGroupExtensionCreatorUID() +{ +} + + +DSRCodedEntryValue::DSRCodedEntryValue(const DSRBasicCodedEntry &basicCodedEntry, + const OFBool check) + : CodeValueType(DSRTypes::CVT_auto), + CodeValue(), + CodingSchemeDesignator(), + CodingSchemeVersion(), + CodeMeaning(), + ContextIdentifier(), + ContextUID(), + MappingResource(), + ContextGroupVersion(), + ContextGroupLocalVersion(), + ContextGroupExtensionCreatorUID() +{ + /* check code (if not disabled) */ + setCode(basicCodedEntry, check); +} + + +DSRCodedEntryValue::DSRCodedEntryValue(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType, + const OFExplicitBool check) + : CodeValueType(DSRTypes::CVT_auto), + CodeValue(), + CodingSchemeDesignator(), + CodingSchemeVersion(), + CodeMeaning(), + ContextIdentifier(), + ContextUID(), + MappingResource(), + ContextGroupVersion(), + ContextGroupLocalVersion(), + ContextGroupExtensionCreatorUID() +{ + /* check code (if not disabled) */ + setCode(codeValue, codingSchemeDesignator, codeMeaning, codeValueType, check); +} + + +DSRCodedEntryValue::DSRCodedEntryValue(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType, + const OFBool check) + : CodeValueType(DSRTypes::CVT_auto), + CodeValue(), + CodingSchemeDesignator(), + CodingSchemeVersion(), + CodeMeaning(), + ContextIdentifier(), + ContextUID(), + MappingResource(), + ContextGroupVersion(), + ContextGroupLocalVersion(), + ContextGroupExtensionCreatorUID() +{ + /* check code (if not disabled) */ + setCode(codeValue, codingSchemeDesignator, codingSchemeVersion, codeMeaning, codeValueType, check); +} + + +DSRCodedEntryValue::DSRCodedEntryValue(const DSRCodedEntryValue &codedEntryValue) + : CodeValueType(codedEntryValue.CodeValueType), + CodeValue(codedEntryValue.CodeValue), + CodingSchemeDesignator(codedEntryValue.CodingSchemeDesignator), + CodingSchemeVersion(codedEntryValue.CodingSchemeVersion), + CodeMeaning(codedEntryValue.CodeMeaning), + ContextIdentifier(codedEntryValue.ContextIdentifier), + ContextUID(codedEntryValue.ContextUID), + MappingResource(codedEntryValue.MappingResource), + ContextGroupVersion(codedEntryValue.ContextGroupVersion), + ContextGroupLocalVersion(codedEntryValue.ContextGroupLocalVersion), + ContextGroupExtensionCreatorUID(codedEntryValue.ContextGroupExtensionCreatorUID) +{ + /* do not check since this would be unexpected to the user */ +} + + +DSRCodedEntryValue::~DSRCodedEntryValue() +{ +} + + +DSRCodedEntryValue &DSRCodedEntryValue::operator=(const DSRCodedEntryValue &codedEntryValue) +{ + /* do not check since this would be unexpected to the user */ + CodeValueType = codedEntryValue.CodeValueType; + CodeValue = codedEntryValue.CodeValue; + CodingSchemeDesignator = codedEntryValue.CodingSchemeDesignator; + CodingSchemeVersion = codedEntryValue.CodingSchemeVersion; + CodeMeaning = codedEntryValue.CodeMeaning; + ContextIdentifier = codedEntryValue.ContextIdentifier; + ContextUID = codedEntryValue.ContextUID; + MappingResource = codedEntryValue.MappingResource; + ContextGroupVersion = codedEntryValue.ContextGroupVersion; + ContextGroupLocalVersion = codedEntryValue.ContextGroupLocalVersion; + ContextGroupExtensionCreatorUID = codedEntryValue.ContextGroupExtensionCreatorUID; + return *this; +} + + +OFBool DSRCodedEntryValue::operator==(const DSRCodedEntryValue &codedEntryValue) const +{ + /* Code Meaning is not used for comparing the two codes, also the "Enhanced Encoding Mode" is not taken into account */ + return (CodeValue == codedEntryValue.CodeValue) && + (CodingSchemeDesignator == codedEntryValue.CodingSchemeDesignator) && + (CodingSchemeVersion == codedEntryValue.CodingSchemeVersion); +} + + +OFBool DSRCodedEntryValue::operator!=(const DSRCodedEntryValue &codedEntryValue) const +{ + /* Code Meaning is not used for comparing the two codes, also the "Enhanced Encoding Mode" is not taken into account */ + return (CodeValue != codedEntryValue.CodeValue) || + (CodingSchemeDesignator != codedEntryValue.CodingSchemeDesignator) || + (CodingSchemeVersion != codedEntryValue.CodingSchemeVersion); +} + + +OFBool DSRCodedEntryValue::operator==(const DSRBasicCodedEntry &basicCodedEntry) const +{ + /* Code Meaning is not used for comparing the two codes */ + return (CodeValue == basicCodedEntry.CodeValue) && + (CodingSchemeDesignator == basicCodedEntry.CodingSchemeDesignator) && + (CodingSchemeVersion == basicCodedEntry.CodingSchemeVersion); +} + + +OFBool DSRCodedEntryValue::operator!=(const DSRBasicCodedEntry &basicCodedEntry) const +{ + /* Code Meaning is not used for comparing the two codes */ + return (CodeValue != basicCodedEntry.CodeValue) || + (CodingSchemeDesignator != basicCodedEntry.CodingSchemeDesignator) || + (CodingSchemeVersion != basicCodedEntry.CodingSchemeVersion); +} + + +void DSRCodedEntryValue::clear() +{ + CodeValueType = DSRTypes::CVT_auto; + CodeValue.clear(); + CodingSchemeDesignator.clear(); + CodingSchemeVersion.clear(); + CodeMeaning.clear(); + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + ContextGroupVersion.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); +} + + +OFBool DSRCodedEntryValue::isValid() const +{ + return checkCurrentValue().good(); +} + + +OFBool DSRCodedEntryValue::isEmpty() const +{ + return CodeValue.empty() && CodingSchemeDesignator.empty() && CodingSchemeVersion.empty() && CodeMeaning.empty(); +} + + +OFBool DSRCodedEntryValue::isComplete() const +{ + return !CodeValue.empty() && (!CodingSchemeDesignator.empty() || (CodeValueType == DSRTypes::CVT_URN)) && !CodeMeaning.empty(); +} + + +void DSRCodedEntryValue::print(STD_NAMESPACE ostream &stream, + const OFBool printCodeValue, + const size_t flags) const +{ + if ((flags & DSRTypes::PF_printInvalidCodes) || isValid()) + { + OFString printString; + stream << "("; + if (printCodeValue) + { + stream << DSRTypes::convertToPrintString(CodeValue, printString) << ","; + stream << DSRTypes::convertToPrintString(CodingSchemeDesignator, printString); + if (!CodingSchemeVersion.empty()) + stream << "[" << DSRTypes::convertToPrintString(CodingSchemeVersion, printString) << "]"; + } else + stream << ","; + stream << ",\"" << DSRTypes::convertToPrintString(CodeMeaning, printString) << "\")"; + if ((flags & DSRTypes::PF_indicateEnhancedEncodingMode) && usesEnhancedEncodingMode()) + stream << "*"; + } + else if ((flags & DSRTypes::PF_printEmptyCodes) && isEmpty()) + stream << "empty code"; + else + stream << "invalid code"; +} + + +OFCondition DSRCodedEntryValue::readItem(DcmItem &dataset, + const char *moduleName, + const size_t flags) +{ + const OFBool acceptViolation = (flags & DSRTypes::RF_acceptInvalidContentItemValue) > 0; + /* read "Basic Coded Entry Attributes" */ + OFCondition result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_LongCodeValue, CodeValue, "1", "1C", moduleName, acceptViolation); + /* tbc: should we distinguish "tag not found" from other errors? */ + if (result.bad()) /* different types of code value */ + { + result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_URNCodeValue, CodeValue, "1", "1C", moduleName, acceptViolation); + if (result.bad()) + { + result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_CodeValue, CodeValue, "1", "1", moduleName, acceptViolation); + CodeValueType = DSRTypes::CVT_Short; + } else + CodeValueType = DSRTypes::CVT_URN; + } else + CodeValueType = DSRTypes::CVT_Long; + if (result.good()) + { + if (CodeValueType == DSRTypes::CVT_URN) /* conditional or mandatory */ + result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_CodingSchemeDesignator, CodingSchemeDesignator, "1", "1C", moduleName, acceptViolation); + else + result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_CodingSchemeDesignator, CodingSchemeDesignator, "1", "1", moduleName, acceptViolation); + } + if (result.good()) /* conditional (type 1C) */ + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_CodingSchemeVersion, CodingSchemeVersion, "1", "1C", moduleName); + if (result.good()) + result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_CodeMeaning, CodeMeaning, "1", "1", moduleName, acceptViolation); + /* read "Enhanced Encoding Mode" */ + if (result.good()) /* optional or conditional */ + { + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ContextIdentifier, ContextIdentifier, "1", "3", moduleName); + if (!ContextIdentifier.empty()) + { + OFString extensionFlag; + /* check for a common error: Context Group Identifier includes "CID" prefix */ + if ((ContextIdentifier.find_first_not_of("0123456789") != OFString_npos) || (ContextIdentifier.at(0) == '0')) + { + DCMSR_DEBUG("Reading invalid Context Identifier (" << ContextIdentifier << ")"); + DCMSR_WARN("Context Identifier shall be a string of digits without leading zeros"); + } + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_MappingResource, MappingResource, "1", "1" /* was 1C */, moduleName); + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ContextGroupVersion, ContextGroupVersion, "1", "1" /* was 1C */, moduleName); + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ContextGroupExtensionFlag, extensionFlag, "1", "3", moduleName); + if (extensionFlag == "Y") + { + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ContextGroupLocalVersion, ContextGroupLocalVersion, "1", "1" /* was 1C */, moduleName); + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ContextGroupExtensionCreatorUID, ContextGroupExtensionCreatorUID, "1", "1" /* was 1C */, moduleName); + } else { + /* ignore Context Group Local Version and/or Context Group Extension Creator UID */ + } + } + DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ContextUID, ContextUID, "1", "3", moduleName); + } + /* tbd: might add check for correct code */ + return result; +} + + +OFCondition DSRCodedEntryValue::writeItem(DcmItem &dataset) const +{ + /* write "Basic Coded Entry Attributes" */ + OFCondition result = EC_Normal; + if (CodeValueType == DSRTypes::CVT_Long) /* different types of code value */ + result = DSRTypes::putStringValueToDataset(dataset, DCM_LongCodeValue, CodeValue); + else if (CodeValueType == DSRTypes::CVT_URN) + result = DSRTypes::putStringValueToDataset(dataset, DCM_URNCodeValue, CodeValue); + else /* short or auto */ + result = DSRTypes::putStringValueToDataset(dataset, DCM_CodeValue, CodeValue); + if (result.good()) + result = DSRTypes::putStringValueToDataset(dataset, DCM_CodingSchemeDesignator, CodingSchemeDesignator); + if (result.good()) /* conditional (type 1C) */ + result = DSRTypes::putStringValueToDataset(dataset, DCM_CodingSchemeVersion, CodingSchemeVersion, OFFalse /*allowEmpty*/); + if (result.good()) + result = DSRTypes::putStringValueToDataset(dataset, DCM_CodeMeaning, CodeMeaning); + /* write "Enhanced Encoding Mode" */ + if (result.good()) /* optional or conditional */ + { + if (!ContextIdentifier.empty()) + { + DSRTypes::putStringValueToDataset(dataset, DCM_ContextIdentifier, ContextIdentifier); + DSRTypes::putStringValueToDataset(dataset, DCM_ContextUID, ContextUID, OFFalse /*allowEmpty*/); + DSRTypes::putStringValueToDataset(dataset, DCM_MappingResource, MappingResource, OFFalse /*allowEmpty*/); + DSRTypes::putStringValueToDataset(dataset, DCM_ContextGroupVersion, ContextGroupVersion, OFFalse /*allowEmpty*/); + if (!ContextGroupLocalVersion.empty() && !ContextGroupExtensionCreatorUID.empty()) + { + DSRTypes::putStringValueToDataset(dataset, DCM_ContextGroupExtensionFlag, "Y"); + DSRTypes::putStringValueToDataset(dataset, DCM_ContextGroupLocalVersion, ContextGroupLocalVersion); + DSRTypes::putStringValueToDataset(dataset, DCM_ContextGroupExtensionCreatorUID, ContextGroupExtensionCreatorUID); + } + } + DSRTypes::putStringValueToDataset(dataset, DCM_ContextUID, ContextUID, OFFalse /*allowEmpty*/); + } + return result; +} + + +OFCondition DSRCodedEntryValue::readSequence(DcmItem &dataset, + const DcmTagKey &tagKey, + const OFString &type, + const size_t flags, + const OFString &vm) +{ + /* read CodeSequence */ + DcmSequenceOfItems *dseq = NULL; + OFCondition result = dataset.findAndGetSequence(tagKey, dseq); + DSRTypes::checkElementValue(dseq, tagKey, vm, type, result); + if (result.good()) + { + DcmItem *ditem = dseq->getItem(0); + if (ditem != NULL) + { + /* read Code */ + result = readItem(*ditem, DcmTag(tagKey).getTagName(), flags); + } else + result = SR_EC_InvalidDocumentTree; + } + return result; +} + + +OFCondition DSRCodedEntryValue::readSequenceItem(DcmItem &item, + const DcmTagKey &tagKey, + const size_t flags) +{ + /* call the real function, which is "protected" */ + return readItem(item, DcmTag(tagKey).getTagName(), flags); +} + + +OFCondition DSRCodedEntryValue::writeSequence(DcmItem &dataset, + const DcmTagKey &tagKey) const +{ + OFCondition result = EC_MemoryExhausted; + /* write CodeSequence */ + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(tagKey); + if (dseq != NULL) + { + /* check for empty value */ + if (isEmpty()) + result = EC_Normal; + else + { + DcmItem *ditem = new DcmItem(); + if (ditem != NULL) + { + /* write Code */ + if (isValid()) + result = writeItem(*ditem); + if (result.good()) + dseq->insert(ditem); + else + delete ditem; + } else + result = EC_MemoryExhausted; + } + if (result.good()) + result= dataset.insert(dseq, OFTrue /*replaceOld*/); + if (result.bad()) + delete dseq; + } + return result; +} + + +OFCondition DSRCodedEntryValue::writeSequenceItem(DcmItem &item, + const DcmTagKey & /*tagKey*/) const +{ + /* call the real function, which is "protected" */ + return writeItem(item); +} + + +OFCondition DSRCodedEntryValue::readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t /*flags*/) +{ + OFCondition result = SR_EC_CorruptedXMLStructure; + if (cursor.valid()) + { + /* check whether code is stored as XML attributes */ + if (doc.hasAttribute(cursor, "codValue")) + { + doc.getStringFromAttribute(cursor, CodeValue, "codValue", OFTrue /*encoding*/); + doc.getStringFromAttribute(cursor, CodingSchemeDesignator, "codScheme", OFTrue /*encoding*/); + doc.getStringFromAttribute(cursor, CodingSchemeVersion, "codVersion", OFTrue /*encoding*/, OFFalse /*required*/); + doc.getStringFromNodeContent(cursor, CodeMeaning, NULL /*name*/, OFTrue /*encoding*/); + } else { + /* goto first child node */ + cursor.gotoChild(); + /* iterate over all content items */ + while (cursor.valid()) + { + /* check for known element tags */ + if (doc.matchNode(cursor, "scheme")) + { + doc.getStringFromNodeContent(doc.getNamedChildNode(cursor, "designator"), CodingSchemeDesignator, NULL /*name*/, OFTrue /*encoding*/, OFFalse /*clearString*/); + doc.getStringFromNodeContent(doc.getNamedChildNode(cursor, "version", OFFalse /*required*/), CodingSchemeVersion, NULL /*name*/, OFTrue /*encoding*/, OFFalse /*clearString*/); + } else { + doc.getStringFromNodeContent(cursor, CodeValue, "value", OFTrue /*encoding*/, OFFalse /*clearString*/); + doc.getStringFromNodeContent(cursor, CodeMeaning, "meaning", OFTrue /*encoding*/, OFFalse /*clearString*/); + } + /* proceed with next node */ + cursor.gotoNext(); + } + } + CodeValueType = determineCodeValueType(CodeValue); + /* check whether code is valid */ + result = isValid() ? EC_Normal : SR_EC_InvalidValue; + } + return result; +} + + +OFCondition DSRCodedEntryValue::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFString tmpString; + if (flags & DSRTypes::XF_codeComponentsAsAttribute) + { + stream << " codValue=\"" << DSRTypes::convertToXMLString(CodeValue, tmpString) << "\""; + stream << " codScheme=\"" << DSRTypes::convertToXMLString(CodingSchemeDesignator, tmpString) << "\""; + if (!CodingSchemeVersion.empty() || (flags & DSRTypes::XF_writeEmptyTags)) + stream << " codVersion=\"" << DSRTypes::convertToXMLString(CodingSchemeVersion, tmpString) << "\""; + stream << ">"; // close open bracket from calling routine + stream << DSRTypes::convertToXMLString(CodeMeaning, tmpString); + } else { + DSRTypes::writeStringValueToXML(stream, CodeValue, "value", (flags & DSRTypes::XF_writeEmptyTags) > 0); + stream << "" << OFendl; + DSRTypes::writeStringValueToXML(stream, CodingSchemeDesignator, "designator", (flags & DSRTypes::XF_writeEmptyTags) > 0); + DSRTypes::writeStringValueToXML(stream, CodingSchemeVersion, "version", (flags & DSRTypes::XF_writeEmptyTags) > 0); + stream << "" << OFendl; + DSRTypes::writeStringValueToXML(stream, CodeMeaning, "meaning", (flags & DSRTypes::XF_writeEmptyTags) > 0); + } + return EC_Normal; +} + + +OFCondition DSRCodedEntryValue::renderHTML(STD_NAMESPACE ostream &stream, + const size_t flags, + const OFBool fullCode, + const OFBool valueFirst) const +{ + OFString htmlString; + if (flags & DSRTypes::HF_useCodeDetailsTooltip) + { + /* render code details as a tooltip */ + stream << ""; + /* render value */ + if (valueFirst) + stream << DSRTypes::convertToHTMLString(CodeValue, htmlString, flags); + else + stream << DSRTypes::convertToHTMLString(CodeMeaning, htmlString, flags); + stream << ""; + } else { + /* render code in a conventional manner */ + if (valueFirst) + stream << DSRTypes::convertToHTMLString(CodeValue, htmlString, flags); + else + stream << DSRTypes::convertToHTMLString(CodeMeaning, htmlString, flags); + if (fullCode) + { + stream << " ("; + if (!valueFirst) + stream << DSRTypes::convertToHTMLString(CodeValue, htmlString, flags) << ", "; + stream << DSRTypes::convertToHTMLString(CodingSchemeDesignator, htmlString, flags); + if (!CodingSchemeVersion.empty()) + stream << " [" << DSRTypes::convertToHTMLString(CodingSchemeVersion, htmlString, flags) << "]"; + if (valueFirst) + stream << ", "" << DSRTypes::convertToHTMLString(CodeMeaning, htmlString, flags) << """; + stream << ")"; + } + } + return EC_Normal; +} + + +OFCondition DSRCodedEntryValue::getValue(DSRCodedEntryValue &codedEntryValue) const +{ + codedEntryValue = *this; + return EC_Normal; +} + + +OFCondition DSRCodedEntryValue::setValue(const DSRCodedEntryValue &codedEntryValue, + const OFBool check) +{ + /* first set "Basic Coded Entry Attributes" */ + OFCondition result = setCode(codedEntryValue.CodeValue, + codedEntryValue.CodingSchemeDesignator, + codedEntryValue.CodingSchemeVersion, + codedEntryValue.CodeMeaning, + codedEntryValue.CodeValueType, + check); + /* then handle "Enhanced Encoding Mode" (if present) */ + if (result.good()) + { + if (!codedEntryValue.ContextIdentifier.empty()) + { + /* specify details for a non-private context group */ + result = setEnhancedEncodingMode(codedEntryValue.ContextIdentifier, + codedEntryValue.MappingResource, + codedEntryValue.ContextGroupVersion, + codedEntryValue.ContextUID, + codedEntryValue.ContextGroupLocalVersion, + codedEntryValue.ContextGroupExtensionCreatorUID, + check); + } + else if (!codedEntryValue.ContextUID.empty()) + { + /* specify details for a private context group */ + result = setEnhancedEncodingMode(codedEntryValue.ContextUID, + check); + } + } + return result; +} + + +OFCondition DSRCodedEntryValue::setCode(const DSRBasicCodedEntry &basicCodedEntry, + const OFBool check) +{ + /* set "Basic Coded Entry Attributes" */ + return setCode(basicCodedEntry.CodeValue, basicCodedEntry.CodingSchemeDesignator, basicCodedEntry.CodingSchemeVersion, + basicCodedEntry.CodeMeaning, basicCodedEntry.CodeValueType, check); +} + + +OFCondition DSRCodedEntryValue::setCode(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType, + const OFExplicitBool check) +{ + /* call the real function */ + return setCode(codeValue, codingSchemeDesignator, "" /*codingSchemeVersion*/, codeMeaning, codeValueType, check); +} + + +OFCondition DSRCodedEntryValue::setCode(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType, + const OFBool check) +{ + OFCondition result = EC_Normal; + const DSRTypes::E_CodeValueType actualCodeValueType = (codeValueType == DSRTypes::CVT_auto) ? determineCodeValueType(codeValue) : codeValueType; + if (check) + { + /* check whether the passed values are valid */ + result = checkCode(codeValue, codingSchemeDesignator, codingSchemeVersion, codeMeaning, actualCodeValueType); + } else { + /* make sure that the mandatory values are non-empty */ + if (codeValue.empty() || (codingSchemeDesignator.empty() && (actualCodeValueType != DSRTypes::CVT_URN)) || codeMeaning.empty()) + result = EC_IllegalParameter; + } + if (result.good()) + { + /* copy "Basic Coded Entry Attributes" */ + CodeValueType = actualCodeValueType; + CodeValue = codeValue; + CodingSchemeDesignator = codingSchemeDesignator; + CodingSchemeVersion = codingSchemeVersion; + CodeMeaning = codeMeaning; + /* clear attributes from "Enhanced Encoding Mode" */ + removeEnhancedEncodingMode(); + } + return result; +} + + +OFBool DSRCodedEntryValue::usesEnhancedEncodingMode() const +{ + /* this is currently a very simple check */ + return !ContextIdentifier.empty() || !ContextUID.empty(); +} + + +void DSRCodedEntryValue::removeEnhancedEncodingMode() +{ + ContextIdentifier.clear(); + ContextUID.clear(); + MappingResource.clear(); + ContextGroupVersion.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); +} + + +OFCondition DSRCodedEntryValue::setEnhancedEncodingMode(const OFString &contextUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* first, make sure that the mandatory value is non-empty */ + if (contextUID.empty()) + result = EC_IllegalParameter; + else if (check) + { + /* check whether the passed value is valid */ + result = DcmUniqueIdentifier::checkStringValue(contextUID, "1"); + } + if (result.good()) + { + ContextUID = contextUID; + /* clear all other attributes */ + ContextIdentifier.clear(); + MappingResource.clear(); + ContextGroupVersion.clear(); + ContextGroupLocalVersion.clear(); + ContextGroupExtensionCreatorUID.clear(); + } + return result; +} + + +OFCondition DSRCodedEntryValue::setEnhancedEncodingMode(const OFString &contextIdentifier, + const OFString &mappingResource, + const OFString &contextGroupVersion, + const OFString &contextUID, + const OFString &localVersion, + const OFString &extensionCreatorUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* first, make sure that the mandatory values are non-empty */ + if (contextIdentifier.empty() || mappingResource.empty() || contextGroupVersion.empty()) + result = EC_IllegalParameter; + /* both values need to be empty or non-empty */ + else if (localVersion.empty() != extensionCreatorUID.empty()) + result = SR_EC_InvalidValue; + else if (check) + { + /* check whether the passed values are valid */ + result = DcmCodeString::checkStringValue(contextIdentifier, "1"); + if (result.good()) + result = DcmCodeString::checkStringValue(mappingResource, "1"); + if (result.good()) + result = DcmDateTime::checkStringValue(contextGroupVersion, "1"); + if (result.good()) + result = DcmUniqueIdentifier::checkStringValue(contextUID, "1"); + if (result.good()) + result = DcmDateTime::checkStringValue(localVersion, "1"); + if (result.good()) + result = DcmUniqueIdentifier::checkStringValue(extensionCreatorUID, "1"); + } + if (result.good()) + { + ContextIdentifier = contextIdentifier; + MappingResource = mappingResource; + ContextGroupVersion = contextGroupVersion; + ContextUID = contextUID; + ContextGroupLocalVersion = localVersion; + ContextGroupExtensionCreatorUID = extensionCreatorUID; + } + return result; +} + + +OFCondition DSRCodedEntryValue::checkCurrentValue() const +{ + /* call the real function */ + return checkCode(CodeValue, CodingSchemeDesignator, CodingSchemeVersion, CodeMeaning, CodeValueType); +} + + +// static functions + +OFCondition DSRCodedEntryValue::checkCode(const OFString &codeValue, + const OFString &codingSchemeDesignator, + const OFString &codingSchemeVersion, + const OFString &codeMeaning, + const DSRTypes::E_CodeValueType codeValueType) +{ + OFCondition result = EC_Normal; + /* first, make sure that the mandatory values are non-empty and the type is valid */ + if (codeValue.empty() || (codingSchemeDesignator.empty() && (codeValueType != DSRTypes::CVT_URN)) || codeMeaning.empty()) + result = SR_EC_InvalidValue; + else if (codeValueType == DSRTypes::CVT_auto) + { + DCMSR_DEBUG("INTERNAL ERROR: DSRCodedEntryValue::checkCode() called with DSRTypes::CVT_auto"); + result = EC_IllegalCall; + } + /* then, check whether the passed values are valid with regards to VR and VM. + * tbd: unfortunately, we do not know the character set, so "UNKNOWN" is used. */ + if (result.good()) + { + if (codeValueType == DSRTypes::CVT_Long) + result = DcmUnlimitedCharacters::checkStringValue(codeValue, "1", "UNKNOWN"); + else if (codeValueType == DSRTypes::CVT_URN) + result = DcmUniversalResourceIdentifierOrLocator::checkStringValue(codeValue); + else /* short or auto */ + result = DcmShortString::checkStringValue(codeValue, "1", "UNKNOWN"); + } + if (result.good()) + result = DcmShortString::checkStringValue(codingSchemeDesignator, "1", "UNKNOWN"); + if (result.good()) + result = DcmShortString::checkStringValue(codingSchemeVersion, "1", "UNKNOWN"); + if (result.good()) + result = DcmLongString::checkStringValue(codeMeaning, "1", "UNKNOWN"); + /* tbd: also need to check correctness of the code (requires code dictionary) */ + return result; +} + + +DSRTypes::E_CodeValueType DSRCodedEntryValue::determineCodeValueType(const OFString &codeValue) +{ + DSRTypes::E_CodeValueType codeValueType = DSRTypes::CVT_auto; + /* first, check for URN or URL scheme (not perfect but should do in most cases) */ + if ((codeValue.compare(0, 4, "urn:") == 0) || (codeValue.find("://") != OFString_npos)) + codeValueType = DSRTypes::CVT_URN; + /* then, check maximum value length (tbd: should be characters not bytes!) */ + else if (codeValue.length() > 16) + codeValueType = DSRTypes::CVT_Long; + else + codeValueType = DSRTypes::CVT_Short; + return codeValueType; +} + + +// output operators + +STD_NAMESPACE ostream &operator<<(STD_NAMESPACE ostream &stream, + const DSRCodedEntryValue& codedEntryValue) +{ + codedEntryValue.print(stream, OFTrue /*printCodeValue*/, DSRTypes::PF_printEmptyCodes /*flags*/); + return stream; +} diff --git a/dcmsr/libsrc/dsrcolcc.cc b/dcmsr/libsrc/dsrcolcc.cc new file mode 100644 index 00000000..c45fbe67 --- /dev/null +++ b/dcmsr/libsrc/dsrcolcc.cc @@ -0,0 +1,130 @@ +/* + * + * Copyright (C) 2010-2015, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRColonCadSRConstraintChecker + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcolcc.h" + + +DSRColonCadSRConstraintChecker::DSRColonCadSRConstraintChecker() + : DSRIODConstraintChecker() +{ +} + + +DSRColonCadSRConstraintChecker::~DSRColonCadSRConstraintChecker() +{ +} + + +OFBool DSRColonCadSRConstraintChecker::isByReferenceAllowed() const +{ + return OFTrue; +} + + +OFBool DSRColonCadSRConstraintChecker::isTemplateSupportRequired() const +{ + return OFTrue; +} + + +OFCondition DSRColonCadSRConstraintChecker::getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + templateIdentifier = "4120"; + mappingResource = "DCMR"; + return EC_Normal; +} + + +DSRTypes::E_DocumentType DSRColonCadSRConstraintChecker::getDocumentType() const +{ + return DT_ColonCadSR; +} + + +OFBool DSRColonCadSRConstraintChecker::checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference) const +{ + /* the following code implements the constraints of table A.35.10-2 in DICOM PS3.3 */ + OFBool result = OFFalse; + /* row 1 of the table */ + if ((relationshipType == RT_contains) && !byReference && (sourceValueType == VT_Container)) + { + result = (targetValueType == VT_Code) || (targetValueType == VT_Num) || (targetValueType == VT_Image) || + (targetValueType == VT_Container) || (targetValueType == VT_UIDRef) || (targetValueType == VT_Date) || + (targetValueType == VT_Time); + } + /* row 2 of the table */ + else if ((relationshipType == RT_hasObsContext) && !byReference && ((sourceValueType == VT_Container) || + (sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_PName) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_Composite); + } + /* row 3 of the table */ + else if ((relationshipType == RT_hasAcqContext) && (sourceValueType == VT_Image)) + { + /* by-reference allowed */ + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Date) || + (targetValueType == VT_Time) || (targetValueType == VT_Num) || (targetValueType == VT_Container); + } + /* row 4 of the table */ + else if ((relationshipType == RT_hasConceptMod) && !byReference && ((sourceValueType == VT_Container) || + (sourceValueType == VT_Code) || (sourceValueType == VT_Composite) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code); + } + /* row 5 the table */ + else if ((relationshipType == RT_hasProperties) && !byReference && + ((sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Container) || (targetValueType == VT_Text) || (targetValueType == VT_Code) || + (targetValueType == VT_Num) || (targetValueType == VT_Date) || (targetValueType == VT_Image) || + (targetValueType == VT_SCoord) || (targetValueType == VT_SCoord3D) || (targetValueType == VT_UIDRef); + } + /* row 6 of the table */ + else if ((relationshipType == RT_inferredFrom) && ((sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + /* by-reference allowed */ + result = (targetValueType == VT_Code) || (targetValueType == VT_Num) || (targetValueType == VT_Image) || + (targetValueType == VT_SCoord) || (targetValueType == VT_SCoord3D) || (targetValueType == VT_Container) || + (targetValueType == VT_Text); + } + /* row 7 of the table */ + else if ((relationshipType == RT_selectedFrom) && !byReference && (sourceValueType == VT_SCoord)) + { + result = (targetValueType == VT_Image); + } + /* row 8 of the table (introduced with CP-1335) */ + else if ((relationshipType == RT_selectedFrom) && !byReference && (sourceValueType == VT_TCoord)) + { + result = (targetValueType == VT_SCoord) || (targetValueType == VT_SCoord3D) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform); + } + return result; +} diff --git a/dcmsr/libsrc/dsrcomcc.cc b/dcmsr/libsrc/dsrcomcc.cc new file mode 100644 index 00000000..cd04e1d9 --- /dev/null +++ b/dcmsr/libsrc/dsrcomcc.cc @@ -0,0 +1,142 @@ +/* + * + * Copyright (C) 2003-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRComprehensiveSRConstraintChecker + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcomcc.h" + + +DSRComprehensiveSRConstraintChecker::DSRComprehensiveSRConstraintChecker() + : DSRIODConstraintChecker() +{ +} + + +DSRComprehensiveSRConstraintChecker::~DSRComprehensiveSRConstraintChecker() +{ +} + + +OFBool DSRComprehensiveSRConstraintChecker::isByReferenceAllowed() const +{ + return OFTrue; +} + + +OFBool DSRComprehensiveSRConstraintChecker::isTemplateSupportRequired() const +{ + return OFFalse; +} + + +OFCondition DSRComprehensiveSRConstraintChecker::getRootTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + templateIdentifier.clear(); + mappingResource.clear(); + return EC_Normal; +} + + +DSRTypes::E_DocumentType DSRComprehensiveSRConstraintChecker::getDocumentType() const +{ + return DT_ComprehensiveSR; +} + + +OFBool DSRComprehensiveSRConstraintChecker::checkContentRelationship(const E_ValueType sourceValueType, + const E_RelationshipType relationshipType, + const E_ValueType targetValueType, + const OFBool byReference) const +{ + /* the following code implements the constraints of table A.35.3-2 in DICOM PS3.3 */ + OFBool result = OFFalse; + /* row 1 of the table */ + if ((relationshipType == RT_contains) && (sourceValueType == VT_Container)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_SCoord) || + (targetValueType == VT_TCoord) || (targetValueType == VT_Composite) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || ((targetValueType == VT_Container) && !byReference /* only by-value */); + } + /* row 2 of the table */ + else if ((relationshipType == RT_hasObsContext) && ((sourceValueType == VT_Container) || + (sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Composite); + } + /* row 3 of the table */ + else if ((relationshipType == RT_hasAcqContext) && ((sourceValueType == VT_Container) || (sourceValueType == VT_Image) || + (sourceValueType == VT_Waveform) || (sourceValueType == VT_Composite) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Container); + } + /* row 4 of the table */ + else if ((relationshipType == RT_hasConceptMod) && !byReference /* only by-value */) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code); + } + /* row 5 of the table */ + else if ((relationshipType == RT_hasProperties) && + ((sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || (targetValueType == VT_Composite) || (targetValueType == VT_SCoord) || + (targetValueType == VT_TCoord) || (targetValueType == VT_Container); + } + /* row 6 of the table - introduced with CP-1076 */ + else if ((relationshipType == RT_hasProperties) && (sourceValueType == VT_PName)) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_DateTime) || + (targetValueType == VT_Date) || (targetValueType == VT_Time) || (targetValueType == VT_UIDRef) || + (targetValueType == VT_PName); + } + /* row 7 of the table */ + else if ((relationshipType == RT_inferredFrom) && + ((sourceValueType == VT_Text) || (sourceValueType == VT_Code) || (sourceValueType == VT_Num))) + { + result = (targetValueType == VT_Text) || (targetValueType == VT_Code) || (targetValueType == VT_Num) || + (targetValueType == VT_DateTime) || (targetValueType == VT_Date) || (targetValueType == VT_Time) || + (targetValueType == VT_UIDRef) || (targetValueType == VT_PName) || (targetValueType == VT_Image) || + (targetValueType == VT_Waveform) || (targetValueType == VT_Composite) || (targetValueType == VT_SCoord) || + (targetValueType == VT_TCoord) || (targetValueType == VT_Container); + } + /* row 8 of the table */ + else if ((relationshipType == RT_selectedFrom) && (sourceValueType == VT_SCoord)) + { + result = (targetValueType == VT_Image); + } + /* row 9 of the table */ + else if ((relationshipType == RT_selectedFrom) && (sourceValueType == VT_TCoord)) + { + result = (targetValueType == VT_SCoord) || (targetValueType == VT_Image) || (targetValueType == VT_Waveform); + } + return result; +} diff --git a/dcmsr/libsrc/dsrcomtn.cc b/dcmsr/libsrc/dsrcomtn.cc new file mode 100644 index 00000000..9d3c5645 --- /dev/null +++ b/dcmsr/libsrc/dsrcomtn.cc @@ -0,0 +1,172 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCompositeTreeNode + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcomtn.h" +#include "dcmtk/dcmsr/dsrxmld.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" + + +DSRCompositeTreeNode::DSRCompositeTreeNode(const E_RelationshipType relationshipType) + : DSRDocumentTreeNode(relationshipType, VT_Composite), + DSRCompositeReferenceValue() +{ +} + + +DSRCompositeTreeNode::DSRCompositeTreeNode(const DSRCompositeTreeNode &node) + : DSRDocumentTreeNode(node), + DSRCompositeReferenceValue(node) +{ +} + + +DSRCompositeTreeNode::~DSRCompositeTreeNode() +{ +} + + +OFBool DSRCompositeTreeNode::operator==(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator==(node); + if (result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = DSRCompositeReferenceValue::operator==(OFstatic_cast(const DSRCompositeTreeNode &, node).getValue()); + } + return result; +} + + +OFBool DSRCompositeTreeNode::operator!=(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator!=(node); + if (!result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = DSRCompositeReferenceValue::operator!=(OFstatic_cast(const DSRCompositeTreeNode &, node).getValue()); + } + return result; +} + + +DSRCompositeTreeNode *DSRCompositeTreeNode::clone() const +{ + return new DSRCompositeTreeNode(*this); +} + + +void DSRCompositeTreeNode::clear() +{ + DSRDocumentTreeNode::clear(); + DSRCompositeReferenceValue::clear(); +} + + +OFBool DSRCompositeTreeNode::isValid() const +{ + return DSRDocumentTreeNode::isValid() && hasValidValue(); +} + + +OFBool DSRCompositeTreeNode::hasValidValue() const +{ + return DSRCompositeReferenceValue::isValid(); +} + + +OFCondition DSRCompositeTreeNode::print(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = DSRDocumentTreeNode::print(stream, flags); + if (result.good()) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << "="; + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_ITEM_VALUE) + result = DSRCompositeReferenceValue::print(stream, flags); + } + return result; +} + + +OFCondition DSRCompositeTreeNode::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = EC_Normal; + writeXMLItemStart(stream, flags); + result = DSRDocumentTreeNode::writeXML(stream, flags); + stream << "" << OFendl; + DSRCompositeReferenceValue::writeXML(stream, flags); + stream << "" << OFendl; + writeXMLItemEnd(stream, flags); + return result; +} + + +OFCondition DSRCompositeTreeNode::readContentItem(DcmItem &dataset, + const size_t flags) +{ + /* read ReferencedSOPSequence */ + return DSRCompositeReferenceValue::readSequence(dataset, DCM_ReferencedSOPSequence, "1" /* type */, flags); +} + + +OFCondition DSRCompositeTreeNode::writeContentItem(DcmItem &dataset) const +{ + /* write ReferencedSOPSequence */ + return DSRCompositeReferenceValue::writeSequence(dataset, DCM_ReferencedSOPSequence); +} + + +OFCondition DSRCompositeTreeNode::readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + /* retrieve value from XML element "value" */ + return DSRCompositeReferenceValue::readXML(doc, doc.getNamedChildNode(cursor, "value"), flags); +} + + +OFCondition DSRCompositeTreeNode::renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t /* nestingLevel */, + size_t &annexNumber, + const size_t flags) const +{ + /* render ConceptName */ + OFCondition result = renderHTMLConceptName(docStream, flags); + /* render Reference */ + if (result.good()) + { + result = DSRCompositeReferenceValue::renderHTML(docStream, annexStream, annexNumber, flags); + docStream << OFendl; + } + return result; +} diff --git a/dcmsr/libsrc/dsrcomvl.cc b/dcmsr/libsrc/dsrcomvl.cc new file mode 100644 index 00000000..3037082e --- /dev/null +++ b/dcmsr/libsrc/dsrcomvl.cc @@ -0,0 +1,440 @@ +/* + * + * Copyright (C) 2000-2017, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCompositeReferenceValue + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcomvl.h" +#include "dcmtk/dcmsr/dsrxmld.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcvrui.h" + + +DSRCompositeReferenceValue::DSRCompositeReferenceValue() + : SOPClassUID(), + SOPInstanceUID() +{ +} + + +DSRCompositeReferenceValue::DSRCompositeReferenceValue(const OFString &sopClassUID, + const OFString &sopInstanceUID, + const OFBool check) + : SOPClassUID(), + SOPInstanceUID() +{ + /* use the set method for checking purposes */ + setReference(sopClassUID, sopInstanceUID, check); +} + + +DSRCompositeReferenceValue::DSRCompositeReferenceValue(const DSRCompositeReferenceValue &referenceValue) + : SOPClassUID(referenceValue.SOPClassUID), + SOPInstanceUID(referenceValue.SOPInstanceUID) +{ + /* do not check since this would be unexpected to the user */ +} + + +DSRCompositeReferenceValue::~DSRCompositeReferenceValue() +{ +} + + +DSRCompositeReferenceValue &DSRCompositeReferenceValue::operator=(const DSRCompositeReferenceValue &referenceValue) +{ + /* do not check since this would be unexpected to the user */ + SOPClassUID = referenceValue.SOPClassUID; + SOPInstanceUID = referenceValue.SOPInstanceUID; + return *this; +} + + +OFBool DSRCompositeReferenceValue::operator==(const DSRCompositeReferenceValue &referenceValue) const +{ + return (SOPClassUID == referenceValue.SOPClassUID) && + (SOPInstanceUID == referenceValue.SOPInstanceUID); +} + + +OFBool DSRCompositeReferenceValue::operator!=(const DSRCompositeReferenceValue &referenceValue) const +{ + return (SOPClassUID != referenceValue.SOPClassUID) || + (SOPInstanceUID != referenceValue.SOPInstanceUID); +} + + +void DSRCompositeReferenceValue::clear() +{ + SOPClassUID.clear(); + SOPInstanceUID.clear(); +} + + +OFBool DSRCompositeReferenceValue::isValid() const +{ + return checkSOPClassUID(SOPClassUID).good() && checkSOPInstanceUID(SOPInstanceUID).good(); +} + + +OFBool DSRCompositeReferenceValue::isEmpty() const +{ + return SOPClassUID.empty() && SOPInstanceUID.empty(); +} + + +OFBool DSRCompositeReferenceValue::isComplete() const +{ + return !SOPClassUID.empty() && !SOPInstanceUID.empty(); +} + + +OFCondition DSRCompositeReferenceValue::print(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + /* first, determine SOP class component */ + OFString sopClassString = "\"" + SOPClassUID + "\""; + if (!(flags & DSRTypes::PF_printSOPClassUID)) + { + /* look up name of known SOP classes */ + const char *className = dcmFindNameOfUID(SOPClassUID.c_str()); + if (className != NULL) + sopClassString = className; + } + /* and then, print it */ + stream << "(" << sopClassString << ","; + /* print SOP instance component (if desired) */ + if (flags & DSRTypes::PF_printSOPInstanceUID) + stream << "\"" << SOPInstanceUID << "\""; + stream << ")"; + return EC_Normal; +} + + +OFCondition DSRCompositeReferenceValue::readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t /*flags*/) +{ + OFCondition result = SR_EC_CorruptedXMLStructure; + /* go one node level down */ + if (cursor.gotoChild().valid()) + { + /* retrieve SOP Class UID and SOP Instance UID from XML tag (required) */ + doc.getStringFromAttribute(doc.getNamedNode(cursor, "sopclass"), SOPClassUID, "uid"); + doc.getStringFromAttribute(doc.getNamedNode(cursor, "instance"), SOPInstanceUID, "uid"); + /* check whether value is valid */ + result = isValid() ? EC_Normal : SR_EC_InvalidValue; + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + if ((flags & DSRTypes::XF_writeEmptyTags) || !isEmpty()) + { + stream << ""; + /* retrieve name of SOP class (if known) */ + stream << dcmFindNameOfUID(SOPClassUID.c_str(), "" /* empty value as default */); + stream << "" << OFendl; + stream << "" << OFendl; + } + return EC_Normal; +} + + +OFCondition DSRCompositeReferenceValue::readItem(DcmItem &dataset, + const size_t flags) +{ + const OFBool acceptViolation = (flags & DSRTypes::RF_acceptInvalidContentItemValue) > 0; + /* read ReferencedSOPClassUID */ + OFCondition result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ReferencedSOPClassUID, SOPClassUID, "1", "1", "ReferencedSOPSequence", acceptViolation); + /* read ReferencedSOPInstanceUID */ + if (result.good()) + result = DSRTypes::getAndCheckStringValueFromDataset(dataset, DCM_ReferencedSOPInstanceUID, SOPInstanceUID, "1", "1", "ReferencedSOPSequence", acceptViolation); + return result; +} + + +OFCondition DSRCompositeReferenceValue::writeItem(DcmItem &dataset) const +{ + /* write ReferencedSOPClassUID */ + OFCondition result = DSRTypes::putStringValueToDataset(dataset, DCM_ReferencedSOPClassUID, SOPClassUID); + /* write ReferencedSOPInstanceUID */ + if (result.good()) + result = DSRTypes::putStringValueToDataset(dataset, DCM_ReferencedSOPInstanceUID, SOPInstanceUID); + return result; +} + + +OFCondition DSRCompositeReferenceValue::readSequence(DcmItem &dataset, + const DcmTagKey &tagKey, + const OFString &type, + const size_t flags) +{ + /* read specified sequence with its item */ + DcmSequenceOfItems *dseq = NULL; + OFCondition result = dataset.findAndGetSequence(tagKey, dseq); + DSRTypes::checkElementValue(dseq, tagKey, "1", type, result, "content item"); + if (result.good()) + { + /* read first item */ + DcmItem *ditem = dseq->getItem(0); + if (ditem != NULL) + result = readItem(*ditem, flags); + else + result = SR_EC_InvalidDocumentTree; + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::writeSequence(DcmItem &dataset, + const DcmTagKey &tagKey) const +{ + OFCondition result = EC_MemoryExhausted; + /* write specified sequence with its item */ + DcmSequenceOfItems *dseq = new DcmSequenceOfItems(tagKey); + if (dseq != NULL) + { + DcmItem *ditem = new DcmItem(); + if (ditem != NULL) + { + /* write item */ + result = writeItem(*ditem); + if (result.good()) + dseq->insert(ditem); + else + delete ditem; + } else + result = EC_MemoryExhausted; + /* write sequence */ + if (result.good()) + result = dataset.insert(dseq, OFTrue /*replaceOld*/); + if (result.bad()) + delete dseq; + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream & /*annexStream*/, + size_t & /*annexNumber*/, + const size_t /*flags*/) const +{ + /* render reference */ + docStream << ""; + /* retrieve name of SOP class (if known) */ + docStream << dcmFindNameOfUID(SOPClassUID.c_str(), "unknown composite object"); + docStream << ""; + return EC_Normal; +} + + +const OFString DSRCompositeReferenceValue::getSOPClassName(const OFString &defaultName) const +{ + /* lookup name associated with the SOP class UID */ + return SOPClassUID.empty() ? "" : dcmFindNameOfUID(SOPClassUID.c_str(), defaultName.c_str()); +} + + +OFCondition DSRCompositeReferenceValue::getValue(DSRCompositeReferenceValue &referenceValue) const +{ + referenceValue = *this; + return EC_Normal; +} + + +OFCondition DSRCompositeReferenceValue::setValue(const DSRCompositeReferenceValue &referenceValue, + const OFBool check) +{ + return setReference(referenceValue.SOPClassUID, referenceValue.SOPInstanceUID, check); +} + + +OFCondition DSRCompositeReferenceValue::setReference(const OFString &sopClassUID, + const OFString &sopInstanceUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* first, make sure that the mandatory values are non-empty */ + if (sopClassUID.empty() || sopInstanceUID.empty()) + result = EC_IllegalParameter; + else if (check) + { + /* then, check whether the passed values are valid */ + result = checkSOPClassUID(sopClassUID); + if (result.good()) + result = checkSOPInstanceUID(sopInstanceUID); + } + if (result.good()) + { + SOPClassUID = sopClassUID; + SOPInstanceUID = sopInstanceUID; + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::setReference(DcmItem &dataset, + const OFBool check) +{ + OFCondition result = setSOPClassUID(dataset, DCM_SOPClassUID, 0 /*pos*/, check); + if (result.good()) + result = setSOPInstanceUID(dataset, DCM_SOPInstanceUID, 0 /*pos*/, check); + return result; +} + + +OFCondition DSRCompositeReferenceValue::setSOPClassUID(const OFString &sopClassUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* first, make sure that the mandatory value is non-empty */ + if (sopClassUID.empty()) + result = EC_IllegalParameter; + else if (check) + { + /* then, check whether the passed value is valid */ + result = checkSOPClassUID(sopClassUID); + } + if (result.good()) + SOPClassUID = sopClassUID; + return result; +} + + +OFCondition DSRCompositeReferenceValue::setSOPClassUID(const DcmElement &delem, + const unsigned long pos, + const OFBool check) +{ + OFString sopClassUID; + /* first, get the value from the element (need to cast away "const") */ + OFCondition result = OFconst_cast(DcmElement &, delem).getOFString(sopClassUID, pos); + if (result.good()) + { + /* then, check and set the value */ + result = setSOPClassUID(sopClassUID, check); + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::setSOPClassUID(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos, + const OFBool check) +{ + OFString sopClassUID; + /* first, get the element value from the dataset */ + OFCondition result = DSRTypes::getStringValueFromDataset(dataset, tagKey, sopClassUID, pos); + if (result.good()) + { + /* then, check and set the value */ + result = setSOPClassUID(sopClassUID, check); + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::setSOPInstanceUID(const OFString &sopInstanceUID, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* first, make sure that the mandatory value is non-empty */ + if (sopInstanceUID.empty()) + result = EC_IllegalParameter; + else if (check) + { + /* then, check whether the passed value is valid */ + result = checkSOPInstanceUID(sopInstanceUID); + } + if (result.good()) + SOPInstanceUID = sopInstanceUID; + return result; +} + + +OFCondition DSRCompositeReferenceValue::setSOPInstanceUID(const DcmElement &delem, + const unsigned long pos, + const OFBool check) +{ + OFString sopInstanceUID; + /* first, get the value from the element (need to cast away "const") */ + OFCondition result = OFconst_cast(DcmElement &, delem).getOFString(sopInstanceUID, pos); + if (result.good()) + { + /* then, check and set the value */ + result = setSOPInstanceUID(sopInstanceUID, check); + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::setSOPInstanceUID(DcmItem &dataset, + const DcmTagKey &tagKey, + const unsigned long pos, + const OFBool check) +{ + OFString sopInstanceUID; + /* first, get the element value from the dataset */ + OFCondition result = DSRTypes::getStringValueFromDataset(dataset, tagKey, sopInstanceUID, pos); + if (result.good()) + { + /* then, check and set the value */ + result = setSOPInstanceUID(sopInstanceUID, check); + } + return result; +} + + +OFCondition DSRCompositeReferenceValue::checkSOPClassUID(const OFString &sopClassUID) const +{ + OFCondition result = sopClassUID.empty() ? SR_EC_InvalidValue : EC_Normal; + if (result.good()) + result = DcmUniqueIdentifier::checkStringValue(sopClassUID, "1"); + return result; +} + + +OFCondition DSRCompositeReferenceValue::checkSOPInstanceUID(const OFString &sopInstanceUID) const +{ + OFCondition result = sopInstanceUID.empty() ? SR_EC_InvalidValue : EC_Normal; + if (result.good()) + result = DcmUniqueIdentifier::checkStringValue(sopInstanceUID, "1"); + return result; +} + + +OFCondition DSRCompositeReferenceValue::checkCurrentValue() const +{ + OFCondition result = checkSOPClassUID(SOPClassUID); + if (result.good()) + result = checkSOPInstanceUID(SOPInstanceUID); + return result; +} diff --git a/dcmsr/libsrc/dsrcontn.cc b/dcmsr/libsrc/dsrcontn.cc new file mode 100644 index 00000000..5e343b3e --- /dev/null +++ b/dcmsr/libsrc/dsrcontn.cc @@ -0,0 +1,260 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRContainerTreeNode + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrcontn.h" +#include "dcmtk/dcmsr/dsrxmld.h" + +#include "dcmtk/dcmdata/dcdeftag.h" + + +DSRContainerTreeNode::DSRContainerTreeNode(const E_RelationshipType relationshipType, + const E_ContinuityOfContent continuityOfContent) + : DSRDocumentTreeNode(relationshipType, VT_Container), + ContinuityOfContent(continuityOfContent) +{ +} + + +DSRContainerTreeNode::DSRContainerTreeNode(const DSRContainerTreeNode &node) + : DSRDocumentTreeNode(node), + ContinuityOfContent(node.ContinuityOfContent) +{ +} + + +DSRContainerTreeNode::~DSRContainerTreeNode() +{ +} + + +OFBool DSRContainerTreeNode::operator==(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator==(node); + if (result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = (ContinuityOfContent == OFstatic_cast(const DSRContainerTreeNode &, node).ContinuityOfContent); + } + return result; +} + + +OFBool DSRContainerTreeNode::operator!=(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator!=(node); + if (!result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = (ContinuityOfContent != OFstatic_cast(const DSRContainerTreeNode &, node).ContinuityOfContent); + } + return result; +} + + +DSRContainerTreeNode *DSRContainerTreeNode::clone() const +{ + return new DSRContainerTreeNode(*this); +} + + +void DSRContainerTreeNode::clear() +{ + ContinuityOfContent = COC_Separate; // this is more useful that COC_invalid +} + + +OFBool DSRContainerTreeNode::isValid() const +{ + /* ConceptNameCodeSequence required for root node container */ + return DSRDocumentTreeNode::isValid() && hasValidValue() && + ((getRelationshipType() != RT_isRoot) || getConceptName().isValid()); +} + + +OFBool DSRContainerTreeNode::hasValidValue() const +{ + return (ContinuityOfContent != COC_invalid); +} + + +OFBool DSRContainerTreeNode::isShort(const size_t /*flags*/) const +{ + return OFFalse; +} + + +OFCondition DSRContainerTreeNode::print(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = DSRDocumentTreeNode::print(stream, flags); + if (result.good()) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << "="; + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_ITEM_VALUE) + stream << continuityOfContentToEnumeratedValue(ContinuityOfContent); + } + return result; +} + + +OFCondition DSRContainerTreeNode::readContentItem(DcmItem &dataset, + const size_t /*flags*/) +{ + OFString tmpString; + /* read ContinuityOfContent */ + OFCondition result = getAndCheckStringValueFromDataset(dataset, DCM_ContinuityOfContent, tmpString, "1", "1", "CONTAINER content item"); + if (result.good()) + { + ContinuityOfContent = enumeratedValueToContinuityOfContent(tmpString); + /* check ContinuityOfContent value */ + if (ContinuityOfContent == COC_invalid) + { + printUnknownValueWarningMessage("ContinuityOfContent value", tmpString.c_str()); + result = SR_EC_InvalidValue; + } + } + return result; +} + + +OFCondition DSRContainerTreeNode::writeContentItem(DcmItem &dataset) const +{ + /* write ContinuityOfContent */ + return putStringValueToDataset(dataset, DCM_ContinuityOfContent, continuityOfContentToEnumeratedValue(ContinuityOfContent)); +} + + +OFCondition DSRContainerTreeNode::readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t /*flags*/) +{ + OFCondition result = SR_EC_CorruptedXMLStructure; + if (cursor.valid()) + { + OFString tmpString; + /* read 'flag' and check validity */ + ContinuityOfContent = enumeratedValueToContinuityOfContent(doc.getStringFromAttribute(cursor, tmpString, "flag")); + if (ContinuityOfContent == COC_invalid) + { + printUnknownValueWarningMessage("CONTAINER flag", tmpString.c_str()); + result = SR_EC_InvalidValue; + } else + result = EC_Normal; + } + return result; +} + + +OFCondition DSRContainerTreeNode::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = EC_Normal; + writeXMLItemStart(stream, flags, OFFalse /*closingBracket*/); + stream << " flag=\"" << continuityOfContentToEnumeratedValue(ContinuityOfContent) << "\""; + stream << ">" << OFendl; + result = DSRDocumentTreeNode::writeXML(stream, flags); + writeXMLItemEnd(stream, flags); + return result; +} + + +OFCondition DSRContainerTreeNode::renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream & /*annexStream*/, + const size_t nestingLevel, + size_t & /*annexNumber*/, + const size_t flags) const +{ + /* section heading (optional) */ + if (nestingLevel > 0) + { + /* render ConceptName & Code (if valid) */ + if (!getConceptName().getCodeMeaning().empty()) + { + const size_t section = (nestingLevel > 6) ? 6 : nestingLevel; + docStream << ""; + getConceptName().renderHTML(docStream, flags, (flags & HF_renderConceptNameCodes) && getConceptName().isValid() /*fullCode*/); + docStream << "" << OFendl; + } + /* render optional observation date/time */ + if (!getObservationDateTime().empty()) + { + OFString tmpString; + docStream << "

" << OFendl; + if (flags & HF_XHTML11Compatibility) + docStream << ""; + else + docStream << ""; + docStream << "(observed: " << dicomToReadableDateTime(getObservationDateTime(), tmpString) << ")"; + if (flags & HF_XHTML11Compatibility) + docStream << "" << OFendl; + else + docStream << "" << OFendl; + docStream << "

" << OFendl; + } + } + return EC_Normal; +} + + +OFCondition DSRContainerTreeNode::renderHTML(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream &annexStream, + const size_t nestingLevel, + size_t &annexNumber, + const size_t flags) const +{ + /* check for validity */ + if (!isValid()) + printInvalidContentItemMessage("Rendering", this); + /* render content item */ + OFCondition result = renderHTMLContentItem(docStream, annexStream, nestingLevel, annexNumber, flags); + if (result.good()) + { + /* section body: render child nodes */ + if (ContinuityOfContent == COC_Continuous) + result = renderHTMLChildNodes(docStream, annexStream, nestingLevel, annexNumber, flags & ~HF_renderItemsSeparately); + else // might be invalid + result = renderHTMLChildNodes(docStream, annexStream, nestingLevel, annexNumber, flags | HF_renderItemsSeparately); + } else + printContentItemErrorMessage("Rendering", result, this); + return result; +} + + +OFCondition DSRContainerTreeNode::setContinuityOfContent(const E_ContinuityOfContent continuityOfContent, + const OFBool /*check*/) +{ + OFCondition result = EC_IllegalParameter; + /* check whether the passed value is valid */ + if (continuityOfContent != COC_invalid) + { + ContinuityOfContent = continuityOfContent; + result = EC_Normal; + } + return result; +} diff --git a/dcmsr/libsrc/dsrcsidl.cc b/dcmsr/libsrc/dsrcsidl.cc new file mode 100644 index 00000000..7d50c228 --- /dev/null +++ b/dcmsr/libsrc/dsrcsidl.cc @@ -0,0 +1,630 @@ +/* + * + * Copyright (C) 2003-2016, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRCodingSchemeIdentificationList + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrcsidl.h" +#include "dcmtk/dcmsr/dsrxmld.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrlo.h" +#include "dcmtk/dcmdata/dcvrsh.h" +#include "dcmtk/dcmdata/dcvrst.h" +#include "dcmtk/dcmdata/dcvrui.h" + + +DSRCodingSchemeIdentificationList::DSRCodingSchemeIdentificationList() + : ItemList(), + Iterator(), + SpecificCharacterSet() +{ + /* initialize list cursor */ + Iterator = ItemList.end(); +} + + +DSRCodingSchemeIdentificationList::~DSRCodingSchemeIdentificationList() +{ + /* clear list and delete allocated memory */ + clear(); +} + + +void DSRCodingSchemeIdentificationList::clear() +{ + Iterator = ItemList.begin(); + const OFListIterator(ItemStruct *) last = ItemList.end(); + /* delete all items and free memory */ + while (Iterator != last) + { + delete (*Iterator); + Iterator = ItemList.erase(Iterator); + } + /* make sure that the list is empty */ + ItemList.clear(); + Iterator = ItemList.end(); + /* also clear other members */ + SpecificCharacterSet.clear(); +} + + +OFBool DSRCodingSchemeIdentificationList::isEmpty() const +{ + return ItemList.empty(); +} + + +size_t DSRCodingSchemeIdentificationList::getNumberOfItems() const +{ + return ItemList.size(); +} + + +OFCondition DSRCodingSchemeIdentificationList::read(DcmItem &dataset, + const size_t /*flags*/) +{ + /* first, check whether sequence is present and non-empty */ + DcmSequenceOfItems *sequence = NULL; + OFCondition result = dataset.findAndGetSequence(DCM_CodingSchemeIdentificationSequence, sequence); + checkElementValue(sequence, DCM_CodingSchemeIdentificationSequence, "1-n", "3", result, "SOPCommonModule"); + if (result.good()) + { + ItemStruct *item = NULL; + OFString codingSchemeDesignator; + /* iterate over all sequence items */ + DcmObject *dobj = NULL; + while ((dobj = sequence->nextInContainer(dobj)) != NULL) + { + DcmItem *ditem = OFstatic_cast(DcmItem *, dobj); + /* get the coding scheme designator */ + if (getAndCheckStringValueFromDataset(*ditem, DCM_CodingSchemeDesignator, codingSchemeDesignator, "1", "1", "CodingSchemeIdentificationSequence").good()) + { + /* add new item to the list */ + if (addItem(codingSchemeDesignator, item).good()) + { + /* read additional information */ + getAndCheckStringValueFromDataset(*ditem, DCM_CodingSchemeRegistry, item->CodingSchemeRegistry, "1", "1C", "CodingSchemeIdentificationSequence"); + getAndCheckStringValueFromDataset(*ditem, DCM_CodingSchemeUID, item->CodingSchemeUID, "1", "1C", "CodingSchemeIdentificationSequence"); + getAndCheckStringValueFromDataset(*ditem, DCM_CodingSchemeExternalID, item->CodingSchemeExternalID, "1", "2C", "CodingSchemeIdentificationSequence"); + getAndCheckStringValueFromDataset(*ditem, DCM_CodingSchemeName, item->CodingSchemeName, "1", "3", "CodingSchemeIdentificationSequence"); + getAndCheckStringValueFromDataset(*ditem, DCM_CodingSchemeVersion, item->CodingSchemeVersion, "1", "3", "CodingSchemeIdentificationSequence"); + getAndCheckStringValueFromDataset(*ditem, DCM_CodingSchemeResponsibleOrganization, item->CodingSchemeResponsibleOrganization, "1", "3", "CodingSchemeIdentificationSequence"); + } + } + } + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::write(DcmItem &dataset) const +{ + OFCondition result = EC_Normal; + /* iterate over all list items */ + OFListConstIterator(ItemStruct *) iter = ItemList.begin(); + const OFListConstIterator(ItemStruct *) last = ItemList.end(); + while ((iter != last) && result.good()) + { + ItemStruct *item = *iter; + /* check whether list item really exists and is valid */ + if ((item != NULL) && !item->CodingSchemeDesignator.empty()) + { + DcmItem *ditem = NULL; + /* create a new item (and a sequence if required) */ + result = dataset.findOrCreateSequenceItem(DCM_CodingSchemeIdentificationSequence, ditem, -2 /*append new*/); + /* write item data */ + if (result.good()) + { + putStringValueToDataset(*ditem, DCM_CodingSchemeDesignator, item->CodingSchemeDesignator); + putStringValueToDataset(*ditem, DCM_CodingSchemeRegistry, item->CodingSchemeRegistry, OFFalse /*allowEmpty*/); + putStringValueToDataset(*ditem, DCM_CodingSchemeUID, item->CodingSchemeUID, OFFalse /*allowEmpty*/); + if (item->CodingSchemeUID.empty()) + putStringValueToDataset(*ditem, DCM_CodingSchemeExternalID, item->CodingSchemeExternalID, OFFalse /*allowEmpty*/); + else if (!item->CodingSchemeExternalID.empty()) + { + DCMSR_WARN("Both Coding Scheme UID and Coding Scheme External ID present for \"" + << item->CodingSchemeDesignator << "\", the latter will be ignored"); + } + putStringValueToDataset(*ditem, DCM_CodingSchemeName, item->CodingSchemeName, OFFalse /*allowEmpty*/); + putStringValueToDataset(*ditem, DCM_CodingSchemeVersion, item->CodingSchemeVersion, OFFalse /*allowEmpty*/); + putStringValueToDataset(*ditem, DCM_CodingSchemeResponsibleOrganization, item->CodingSchemeResponsibleOrganization, OFFalse /*allowEmpty*/); + } + } + ++iter; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t /*flags*/) +{ + OFCondition result = SR_EC_InvalidDocument; + ItemStruct *item = NULL; + OFString codingSchemeDesignator; + /* iterate over all nodes */ + while (cursor.valid()) + { + /* check for known element tags */ + if (doc.checkNode(cursor, "scheme").good()) + { + /* retrieve coding scheme designator */ + if (!doc.getStringFromAttribute(cursor, codingSchemeDesignator, "designator", OFTrue /*encoding*/).empty()) + { + result = addItem(codingSchemeDesignator, item); + if (result.good()) + { + DSRXMLCursor childCursor = cursor.getChild(); + /* clear any previously stored information */ + item->clear(); + while (childCursor.valid()) + { + /* check for known element tags */ + doc.getStringFromNodeContent(childCursor, item->CodingSchemeRegistry, "registry", OFTrue /*encoding*/, OFFalse /*clearString*/); + doc.getStringFromNodeContent(childCursor, item->CodingSchemeUID, "uid", OFFalse /*encoding*/, OFFalse /*clearString*/); + doc.getStringFromNodeContent(childCursor, item->CodingSchemeExternalID, "id", OFTrue /*encoding*/, OFFalse /*clearString*/); + doc.getStringFromNodeContent(childCursor, item->CodingSchemeName, "name", OFTrue /*encoding*/, OFFalse /*clearString*/); + doc.getStringFromNodeContent(childCursor, item->CodingSchemeVersion, "version", OFTrue /*encoding*/, OFFalse /*clearString*/); + doc.getStringFromNodeContent(childCursor, item->CodingSchemeResponsibleOrganization, "organization", OFTrue /*encoding*/, OFFalse /*clearString*/); + /* proceed with next node */ + childCursor.gotoNext(); + } + } + } + } + /* proceed with next node */ + cursor.gotoNext(); + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFString tmpString; + /* iterate over all list items */ + OFListConstIterator(ItemStruct *) iter = ItemList.begin(); + const OFListConstIterator(ItemStruct *) last = ItemList.end(); + while (iter != last) + { + ItemStruct *item = *iter; + /* check whether list item really exists */ + if (item != NULL) + { + stream << "CodingSchemeDesignator, tmpString) << "\">" << OFendl; + writeStringValueToXML(stream, convertToXMLString(item->CodingSchemeRegistry, tmpString), "registry", (flags & DSRTypes::XF_writeEmptyTags) > 0); + writeStringValueToXML(stream, item->CodingSchemeUID, "uid", (flags & DSRTypes::XF_writeEmptyTags) > 0); + writeStringValueToXML(stream, convertToXMLString(item->CodingSchemeExternalID, tmpString), "identifier", (flags & DSRTypes::XF_writeEmptyTags) > 0); + writeStringValueToXML(stream, convertToXMLString(item->CodingSchemeName, tmpString), "name", (flags & DSRTypes::XF_writeEmptyTags) > 0); + writeStringValueToXML(stream, convertToXMLString(item->CodingSchemeVersion, tmpString), "version", (flags & DSRTypes::XF_writeEmptyTags) > 0); + writeStringValueToXML(stream, convertToXMLString(item->CodingSchemeResponsibleOrganization, tmpString), "organization", (flags & DSRTypes::XF_writeEmptyTags) > 0); + stream << "" << OFendl; + } + ++iter; + } + return EC_Normal; +} + + +OFCondition DSRCodingSchemeIdentificationList::setSpecificCharacterSet(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + SpecificCharacterSet = value; + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::addPrivateDcmtkCodingScheme() +{ + /* add private coding scheme (if not already existent) */ + return addItem(OFFIS_CODING_SCHEME_DESIGNATOR, OFFIS_CODING_SCHEME_UID, OFFIS_CODING_SCHEME_NAME, OFFIS_CODING_SCHEME_RESPONSIBLE_ORGANIZATION); +} + + +OFCondition DSRCodingSchemeIdentificationList::addItem(const OFString &codingSchemeDesignator, + ItemStruct *&item) +{ + OFCondition result = EC_IllegalParameter; + /* check parameter first */ + if (!codingSchemeDesignator.empty()) + { + result = EC_Normal; + OFListIterator(ItemStruct *) oldCursor = Iterator; + /* check whether item already exists */ + if (gotoItem(codingSchemeDesignator).bad()) + { + /* if not create new item and add it to the list */ + item = new ItemStruct(codingSchemeDesignator); + if (item != NULL) + { + ItemList.push_back(item); + /* set cursor to new position */ + Iterator = --ItemList.end(); + } else { + /* restore old cursor */ + Iterator = oldCursor; + result = EC_MemoryExhausted; + } + } else { + DCMSR_WARN("Coding Scheme Designator \"" << codingSchemeDesignator + << "\" already exists in Coding Scheme Identification Sequence ... overwriting"); + /* gotoItem() was successful, set item pointer */ + item = *Iterator; + } + } else + item = NULL; + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::addItem(const OFString &codingSchemeDesignator, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* make sure that the mandatory value is non-empty */ + if (codingSchemeDesignator.empty()) + result = EC_IllegalParameter; + else if (check) + { + /* check whether the passed value is valid */ + result = DcmShortString::checkStringValue(codingSchemeDesignator, "1", SpecificCharacterSet); + } + if (result.good()) + { + ItemStruct *item = NULL; + /* call the "real" function */ + result = addItem(codingSchemeDesignator, item); + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::addItem(const OFString &codingSchemeDesignator, + const OFString &codingSchemeUID, + const OFString &codingSchemeName, + const OFString &responsibleOrganization, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* make sure that the mandatory designator value is non-empty */ + if (codingSchemeDesignator.empty()) + result = EC_IllegalParameter; + else if (check) + { + /* check whether the passed values are valid */ + result = DcmShortString::checkStringValue(codingSchemeDesignator, "1", SpecificCharacterSet); + if (result.good()) + result = DcmUniqueIdentifier::checkStringValue(codingSchemeUID, "1"); + if (result.good()) + result = DcmShortText::checkStringValue(codingSchemeName, SpecificCharacterSet); + if (result.good()) + result = DcmShortText::checkStringValue(responsibleOrganization, SpecificCharacterSet); + } + if (result.good()) + { + ItemStruct *item = NULL; + /* add coding scheme (if not already existent) */ + result = addItem(codingSchemeDesignator, item); + if (result.good()) + { + /* set additional information */ + item->CodingSchemeRegistry.clear(); + item->CodingSchemeUID = codingSchemeUID; + item->CodingSchemeExternalID.clear(); + item->CodingSchemeName = codingSchemeName; + item->CodingSchemeVersion.clear(); + item->CodingSchemeResponsibleOrganization = responsibleOrganization; + } + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::removeItem() +{ + OFCondition result = EC_IllegalCall; + /* check whether list is empty or iterator is invalid */ + if (!ItemList.empty() && (Iterator != ItemList.end())) + { + /* free memory */ + delete (*Iterator); + /* remove item from list */ + Iterator = ItemList.erase(Iterator); + result = EC_Normal; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::removeItem(const OFString &codingSchemeDesignator) +{ + /* goto specified item ... */ + OFCondition result = gotoItem(codingSchemeDesignator); + /* ... and remove it */ + if (result.good()) + result = removeItem(); + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::gotoItem(const OFString &codingSchemeDesignator) +{ + OFCondition result = EC_IllegalParameter; + /* check parameter first */ + if (!codingSchemeDesignator.empty()) + { + result = SR_EC_CodingSchemeNotFound; + /* start with first item */ + Iterator = ItemList.begin(); + const OFListIterator(ItemStruct *) last = ItemList.end(); + /* search for given item */ + while ((Iterator != last) && result.bad()) + { + if ((*Iterator != NULL) && ((*Iterator)->CodingSchemeDesignator == codingSchemeDesignator)) + result = EC_Normal; + else + ++Iterator; + } + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::gotoFirstItem() +{ + OFCondition result = EC_IllegalCall; + /* check for empty item list */ + if (!ItemList.empty()) + { + /* set cursor to first list item */ + Iterator = ItemList.begin(); + result = EC_Normal; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::gotoNextItem() +{ + OFCondition result = EC_IllegalCall; + /* goto next list item */ + if (++Iterator != ItemList.end()) + { + /* check whether list item is valid */ + if (*Iterator != NULL) + result = EC_Normal; + else + result = EC_CorruptedData; + } + return result; +} + + +DSRCodingSchemeIdentificationList::ItemStruct *DSRCodingSchemeIdentificationList::getCurrentItem() const +{ + ItemStruct *item = NULL; + /* check whether current item is valid */ + OFListConstIterator(ItemStruct *) it = Iterator; + if (it != ItemList.end()) + item = *Iterator; + return item; +} + + +const OFString &DSRCodingSchemeIdentificationList::getCodingSchemeDesignator(OFString &stringValue) const +{ + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + /* get requested value or clear string if invalid */ + if (item != NULL) + stringValue = item->CodingSchemeDesignator; + else + stringValue.clear(); + return stringValue; +} + + +const OFString &DSRCodingSchemeIdentificationList::getCodingSchemeRegistry(OFString &stringValue) const +{ + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + /* get requested value or clear string if invalid */ + if (item != NULL) + stringValue = item->CodingSchemeRegistry; + else + stringValue.clear(); + return stringValue; +} + + +const OFString &DSRCodingSchemeIdentificationList::getCodingSchemeUID(OFString &stringValue) const +{ + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + /* get requested value or clear string if invalid */ + if (item != NULL) + stringValue = item->CodingSchemeUID; + else + stringValue.clear(); + return stringValue; +} + + +const OFString &DSRCodingSchemeIdentificationList::getCodingSchemeExternalID(OFString &stringValue) const +{ + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + /* get requested value or clear string if invalid */ + if (item != NULL) + stringValue = item->CodingSchemeExternalID; + else + stringValue.clear(); + return stringValue; +} + + +const OFString &DSRCodingSchemeIdentificationList::getCodingSchemeName(OFString &stringValue) const +{ + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + /* get requested value or clear string if invalid */ + if (item != NULL) + stringValue = item->CodingSchemeName; + else + stringValue.clear(); + return stringValue; +} + + +const OFString &DSRCodingSchemeIdentificationList::getCodingSchemeVersion(OFString &stringValue) const +{ + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + /* get requested value or clear string if invalid */ + if (item != NULL) + stringValue = item->CodingSchemeVersion; + else + stringValue.clear(); + return stringValue; +} + + +const OFString &DSRCodingSchemeIdentificationList::getCodingSchemeResponsibleOrganization(OFString &stringValue) const +{ + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + /* get requested value or clear string if invalid */ + if (item != NULL) + stringValue = item->CodingSchemeResponsibleOrganization; + else + stringValue.clear(); + return stringValue; +} + + +OFCondition DSRCodingSchemeIdentificationList::setCodingSchemeRegistry(const OFString &value, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + if (item != NULL) + { + /* set the value (if valid) */ + result = (check) ? DcmLongString::checkStringValue(value, "1", SpecificCharacterSet) : EC_Normal; + if (result.good()) + item->CodingSchemeRegistry = value; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::setCodingSchemeUID(const OFString &value, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + if (item != NULL) + { + /* set the value (if valid) */ + result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + item->CodingSchemeUID = value; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::setCodingSchemeExternalID(const OFString &value, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + if (item != NULL) + { + /* set the value (if valid) */ + result = (check) ? DcmShortText::checkStringValue(value, SpecificCharacterSet) : EC_Normal; + if (result.good()) + item->CodingSchemeExternalID = value; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::setCodingSchemeName(const OFString &value, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + if (item != NULL) + { + /* set the value (if valid) */ + result = (check) ? DcmShortText::checkStringValue(value, SpecificCharacterSet) : EC_Normal; + if (result.good()) + item->CodingSchemeName = value; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::setCodingSchemeVersion(const OFString &value, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + if (item != NULL) + { + /* set the value (if valid) */ + result = (check) ? DcmShortString::checkStringValue(value, "1", SpecificCharacterSet) : EC_Normal; + if (result.good()) + item->CodingSchemeVersion = value; + } + return result; +} + + +OFCondition DSRCodingSchemeIdentificationList::setCodingSchemeResponsibleOrganization(const OFString &value, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* check whether current item is valid */ + ItemStruct *item = getCurrentItem(); + if (item != NULL) + { + /* set the value (if valid) */ + result = (check) ? DcmShortText::checkStringValue(value, SpecificCharacterSet) : EC_Normal; + if (result.good()) + item->CodingSchemeResponsibleOrganization = value; + } + return result; +} diff --git a/dcmsr/libsrc/dsrctpl.cc b/dcmsr/libsrc/dsrctpl.cc new file mode 100644 index 00000000..6e482f9b --- /dev/null +++ b/dcmsr/libsrc/dsrctpl.cc @@ -0,0 +1,195 @@ +/* + * + * Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRTemplateCommon + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctpl.h" +#include "dcmtk/dcmsr/dsrdocst.h" + +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrui.h" + + +DSRTemplateCommon::DSRTemplateCommon(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID) + : TemplateIdentifier(templateIdentifier), + MappingResource(mappingResource), + MappingResourceUID(mappingResourceUID), + ExtensibleMode(OFFalse), + OrderSignificantMode(OFFalse), + NodeList() +{ + /* by default, a template is non-extensible */ +} + + +DSRTemplateCommon::~DSRTemplateCommon() +{ +} + + +void DSRTemplateCommon::clear() +{ + clearEntriesInNodeList(); +} + + +OFBool DSRTemplateCommon::hasTemplateIdentification() const +{ + /* mapping resource UID is optional, so do not check it */ + return !TemplateIdentifier.empty() && !MappingResource.empty(); +} + + +OFBool DSRTemplateCommon::isTemplateIdentificationValid(const OFBool check) const +{ + OFBool result = OFFalse; + /* either all three values are empty ... */ + if (TemplateIdentifier.empty() && MappingResource.empty() && MappingResourceUID.empty()) + result = OFTrue; + /* ... or the first two are both non-empty */ + else if (!TemplateIdentifier.empty() && !MappingResource.empty()) + { + /* check more thoroughly whether the stored values are valid */ + if (check) + { + if (DcmCodeString::checkStringValue(TemplateIdentifier, "1").good() && + DcmCodeString::checkStringValue(MappingResource, "1").good() && + DcmUniqueIdentifier::checkStringValue(MappingResourceUID, "1").good()) + { + result = OFTrue; + } + } else + result = OFTrue; + } + return result; +} + + +OFBool DSRTemplateCommon::compareTemplateIdentication(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID) const +{ + OFBool result = (TemplateIdentifier == templateIdentifier) && (MappingResource == mappingResource); + /* mapping resource UID is optional, so only check it if present */ + if (result && !MappingResourceUID.empty() && !mappingResourceUID.empty()) + result = (MappingResourceUID == mappingResourceUID); + return result; +} + + +// protected methods + +void DSRTemplateCommon::clearEntriesInNodeList() +{ + /* set all entries to 0 */ + for (size_t i = 0; i < NodeList.size(); ++i) + NodeList[i] = 0; +} + + +void DSRTemplateCommon::reserveEntriesInNodeList(const size_t count, + const OFBool initialize) +{ + /* check whether the entries should be initialized... */ + if (initialize) + { + NodeList.resize(count); + clearEntriesInNodeList(); + } else { + /* ... or only reserved (not created and initialized) */ + NodeList.reserve(count); + } +} + + +void DSRTemplateCommon::storeEntryInNodeList(const size_t pos, + const size_t nodeID) +{ + /* make sure that entry can be stored */ + if (pos >= NodeList.size()) + NodeList.resize(pos + 1, 0); + NodeList[pos] = nodeID; +} + + +size_t DSRTemplateCommon::getEntryFromNodeList(const size_t pos) const +{ + size_t nodeID = 0; + /* make sure that entry exists */ + if (pos < NodeList.size()) + nodeID = NodeList[pos]; + return nodeID; +} + + +size_t DSRTemplateCommon::gotoEntryFromNodeList(DSRDocumentTreeNodeCursor &cursor, + const size_t pos) const +{ + size_t nodeID = 0; + /* make sure that cursor is valid and list entry exists */ + if ((cursor.isValid()) && (pos < NodeList.size())) + { + nodeID = NodeList[pos]; + /* check whether current node is already the right one */ + if (cursor.getNodeID() != nodeID) + nodeID = cursor.gotoNode(nodeID); + } + return nodeID; +} + + +size_t DSRTemplateCommon::gotoEntryFromNodeList(DSRDocumentSubTree *tree, + const size_t pos) +{ + size_t nodeID = 0; + /* make sure that tree is valid and list entry exists */ + if ((tree != NULL) && (pos < NodeList.size())) + { + nodeID = NodeList[pos]; + /* check whether current node is already the right one */ + if (tree->getNodeID() != nodeID) + nodeID = tree->gotoNode(nodeID, OFTrue /*startFromRoot*/); + } + return nodeID; +} + + +size_t DSRTemplateCommon::gotoLastEntryFromNodeList(DSRDocumentSubTree *tree, + const size_t lastPos, + const size_t firstPos) +{ + size_t nodeID = 0; + /* make sure that tree is valid and list entry exists */ + if ((tree != NULL) && (firstPos <= lastPos) && (lastPos < NodeList.size())) + { + size_t pos = lastPos + 1; + while ((pos > firstPos) && (nodeID == 0)) + nodeID = NodeList[--pos]; + /* check whether current node is already the right one */ + if (tree->getNodeID() != nodeID) + nodeID = tree->gotoNode(nodeID, OFTrue /*startFromRoot*/); + } + return nodeID; +} diff --git a/dcmsr/libsrc/dsrctxgr.cc b/dcmsr/libsrc/dsrctxgr.cc new file mode 100644 index 00000000..f9585b1d --- /dev/null +++ b/dcmsr/libsrc/dsrctxgr.cc @@ -0,0 +1,215 @@ +/* + * + * Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRContextGroup + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrctxgr.h" + + +DSRContextGroup::DSRContextGroup(const OFString &contextIdentifier, + const OFString &mappingResource, + const OFString &contextGroupVersion, + const OFString &contextGroupUID, + const DSRCodedEntryValue &selectedValue) + : Identifier(contextIdentifier), + MappingResource(mappingResource), + Version(contextGroupVersion), + UID(contextGroupUID), + SelectedValue(selectedValue), + ExtensibleMode(OFFalse), + ExtendedCodes() +{ + /* by default, a context group is non-extensible */ +} + + +DSRContextGroup::~DSRContextGroup() +{ +} + + +void DSRContextGroup::clear() +{ + SelectedValue.clear(); + ExtendedCodes.clear(); +} + + +OFBool DSRContextGroup::hasSelectedValue() const +{ + return !SelectedValue.isEmpty(); +} + + +OFCondition DSRContextGroup::selectValue(const DSRCodedEntryValue &codedEntryValue, + const OFBool check, + const OFBool definedContextGroup) +{ + OFCondition result = (check) ? checkCodedEntry(codedEntryValue, definedContextGroup) : EC_Normal; + /* if coded entry is valid, select it as the current value */ + if (result.good()) + SelectedValue = codedEntryValue; + return result; +} + + +OFBool DSRContextGroup::hasCodedEntry(const DSRCodedEntryValue &codedEntryValue) const +{ + /* check whether given coded entry is contained in one of the lists */ + return findCodedEntry(codedEntryValue).good(); +} + + +OFCondition DSRContextGroup::findCodedEntry(const DSRCodedEntryValue &codedEntryValue) const +{ + /* not interested in the coded entry that was found */ + return findCodedEntry(codedEntryValue, NULL /*foundCodedEntry*/); +} + + +OFBool DSRContextGroup::hasExtendedCodedEntries() const +{ + return !ExtendedCodes.empty(); +} + + +OFCondition DSRContextGroup::addCodedEntry(const DSRCodedEntryValue &codedEntryValue) +{ + OFCondition result = EC_Normal; + /* first, check whether context group is extensible */ + if (ExtensibleMode) + { + /* if so, add coded entry to the list */ + ExtendedCodes.push_back(codedEntryValue); + } else { + /* if not, return an error code */ + result = SR_EC_NonExtensibleContextGroup; + } + return result; +} + + +OFCondition DSRContextGroup::lookupCodedEntry(DSRCodedEntryValue &codedEntryValue, + const OFBool enhancedEncodingMode) const +{ + /* store coded entry that was found in given parameter */ + return findCodedEntry(codedEntryValue, &codedEntryValue, enhancedEncodingMode); +} + + +void DSRContextGroup::print(STD_NAMESPACE ostream &stream) const +{ + printHeader(stream); + /* output currently selected coded entry (if there is one) */ + if (hasSelectedValue()) + { + stream << "Selected value:" << OFendl; + stream << " "; + SelectedValue.print(stream); + stream << OFendl; + } + printCodes(stream); +} + + +OFCondition DSRContextGroup::checkSelectedValue(const OFBool definedContextGroup) const +{ + OFCondition result = EC_Normal; + /* check whether a coded entry is selected as the current value */ + if (hasSelectedValue()) + result = checkCodedEntry(SelectedValue, definedContextGroup); + return result; +} + + +// protected methods + +void DSRContextGroup::printHeader(STD_NAMESPACE ostream &stream) const +{ + /* output some general information on the context group */ + stream << "CID " << getIdentifier() << OFendl; + stream << " Resource : " << getMappingResource() << OFendl; + stream << " Version : " << getVersion() << OFendl; + stream << " UID : " << getUID() << OFendl; + stream << " Type : " << (isExtensible() ? "extensible" : "non-extensible") << OFendl; +} + + +void DSRContextGroup::printCodes(STD_NAMESPACE ostream &stream) const +{ + /* are there any extended codes at all? */ + if (!ExtendedCodes.empty()) + { + stream << "Extended codes:" << OFendl; + OFListConstIterator(DSRCodedEntryValue) iter = ExtendedCodes.begin(); + OFListConstIterator(DSRCodedEntryValue) last = ExtendedCodes.end(); + /* iterate over coded entry list */ + while (iter != last) + { + stream << " "; + /* print coded entry */ + iter->print(stream); + stream << OFendl; + ++iter; + } + } +} + + +OFCondition DSRContextGroup::findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, + DSRCodedEntryValue *foundCodedEntry, + const OFBool /* enhancedEncodingMode */) const +{ + OFCondition result = SR_EC_CodedEntryNotInContextGroup; + OFListConstIterator(DSRCodedEntryValue) iter = ExtendedCodes.begin(); + OFListConstIterator(DSRCodedEntryValue) last = ExtendedCodes.end(); + /* iterate over coded entry list */ + while (iter != last) + { + /* if found, exit loop */ + if (*iter == searchForCodedEntry) + { + /* return coded entry (if requested) */ + if (foundCodedEntry != NULL) + *foundCodedEntry = *iter; + result = SR_EC_CodedEntryIsExtensionOfContextGroup; + break; + } + ++iter; + } + return result; +} + + +OFCondition DSRContextGroup::checkCodedEntry(const DSRCodedEntryValue &codedEntryValue, + const OFBool definedContextGroup) const +{ + OFCondition result = EC_Normal; + /* check whether currently selected coded entry is valid */ + if (!codedEntryValue.isValid()) + result = SR_EC_InvalidValue; + /* if so, also check whether the coded entry is allowed for this context group */ + else if (definedContextGroup && !hasCodedEntry(codedEntryValue)) + result = SR_EC_CodedEntryNotInContextGroup; + return result; +} diff --git a/dcmsr/libsrc/dsrdattn.cc b/dcmsr/libsrc/dsrdattn.cc new file mode 100644 index 00000000..89cde2c8 --- /dev/null +++ b/dcmsr/libsrc/dsrdattn.cc @@ -0,0 +1,240 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDateTreeNode + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrtypes.h" +#include "dcmtk/dcmsr/dsrdattn.h" +#include "dcmtk/dcmsr/dsrxmld.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcvrda.h" + + +DSRDateTreeNode::DSRDateTreeNode(const E_RelationshipType relationshipType) + : DSRDocumentTreeNode(relationshipType, VT_Date), + DSRStringValue() +{ +} + + +DSRDateTreeNode::DSRDateTreeNode(const E_RelationshipType relationshipType, + const OFString &dateValue, + const OFBool check) + : DSRDocumentTreeNode(relationshipType, VT_Date), + DSRStringValue(dateValue, check) +{ + +} + + +DSRDateTreeNode::DSRDateTreeNode(const DSRDateTreeNode &node) + : DSRDocumentTreeNode(node), + DSRStringValue(node) +{ +} + + +DSRDateTreeNode::~DSRDateTreeNode() +{ +} + + +OFBool DSRDateTreeNode::operator==(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator==(node); + if (result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = DSRStringValue::operator==(OFstatic_cast(const DSRDateTreeNode &, node).getValue()); + } + return result; +} + + +OFBool DSRDateTreeNode::operator!=(const DSRDocumentTreeNode &node) const +{ + /* call comparison operator of base class (includes check of value type) */ + OFBool result = DSRDocumentTreeNode::operator!=(node); + if (!result) + { + /* it's safe to cast the type since the value type has already been checked */ + result = DSRStringValue::operator!=(OFstatic_cast(const DSRDateTreeNode &, node).getValue()); + } + return result; +} + + +DSRDateTreeNode *DSRDateTreeNode::clone() const +{ + return new DSRDateTreeNode(*this); +} + + +void DSRDateTreeNode::clear() +{ + DSRDocumentTreeNode::clear(); + DSRStringValue::clear(); +} + + +OFBool DSRDateTreeNode::isValid() const +{ + /* ConceptNameCodeSequence required */ + return DSRDocumentTreeNode::isValid() && getConceptName().isValid() && hasValidValue(); +} + + +OFBool DSRDateTreeNode::hasValidValue() const +{ + return checkCurrentValue().good(); +} + + +OFCondition DSRDateTreeNode::print(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = DSRDocumentTreeNode::print(stream, flags); + if (result.good()) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << "="; + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_ITEM_VALUE) + DSRStringValue::print(stream); + } + return result; +} + + +OFCondition DSRDateTreeNode::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFString tmpString; + OFCondition result = EC_Normal; + writeXMLItemStart(stream, flags); + result = DSRDocumentTreeNode::writeXML(stream, flags); + /* output date in ISO 8601 format */ + DcmDate::getISOFormattedDateFromString(getValue(), tmpString); + writeStringValueToXML(stream, tmpString, "value", (flags & XF_writeEmptyTags) > 0); + writeXMLItemEnd(stream, flags); + return result; +} + + +OFCondition DSRDateTreeNode::readContentItem(DcmItem &dataset, + const size_t flags) +{ + /* read Date */ + return DSRStringValue::read(dataset, DCM_Date, flags); +} + + +OFCondition DSRDateTreeNode::writeContentItem(DcmItem &dataset) const +{ + /* write Date */ + return DSRStringValue::write(dataset, DCM_Date); +} + + +OFCondition DSRDateTreeNode::readXMLContentItem(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t /*flags*/) +{ + OFString tmpString; + /* retrieve value from XML element "value" */ + OFCondition result = setValue(getValueFromXMLNodeContent(doc, doc.getNamedChildNode(cursor, "value"), tmpString)); + if (result == EC_IllegalParameter) + result = SR_EC_InvalidValue; + return result; +} + + +OFString &DSRDateTreeNode::getValueFromXMLNodeContent(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + OFString &dateValue, + const OFBool clearString) +{ + if (clearString) + dateValue.clear(); + /* check whether node is valid */ + if (cursor.valid()) + { + OFString tmpString; + /* retrieve value from XML element */ + if (!doc.getStringFromNodeContent(cursor, tmpString).empty()) + { + OFDate tmpDate; + /* convert ISO to DICOM format */ + if (tmpDate.setISOFormattedDate(tmpString)) + DcmDate::getDicomDateFromOFDate(tmpDate, dateValue); + } + } + return dateValue; +} + + +OFCondition DSRDateTreeNode::renderHTMLContentItem(STD_NAMESPACE ostream &docStream, + STD_NAMESPACE ostream & /*annexStream*/, + const size_t /*nestingLevel*/, + size_t & /*annexNumber*/, + const size_t flags) const +{ + /* render ConceptName */ + OFCondition result = renderHTMLConceptName(docStream, flags); + /* render Date */ + if (result.good()) + { + OFString htmlString; + if (!(flags & DSRTypes::HF_renderItemsSeparately)) + { + if (flags & DSRTypes::HF_XHTML11Compatibility) + docStream << ""; + else if (flags & DSRTypes::HF_HTML32Compatibility) + docStream << ""; + else /* HTML 4.01 */ + docStream << ""; + } + docStream << dicomToReadableDate(getValue(), htmlString); + if (!(flags & DSRTypes::HF_renderItemsSeparately)) + { + if (flags & DSRTypes::HF_HTML32Compatibility) + docStream << ""; + else + docStream << ""; + } + docStream << OFendl; + } + return result; +} + + +OFCondition DSRDateTreeNode::checkValue(const OFString &dateValue) const +{ + /* first, make sure that the mandatory value is non-empty */ + OFCondition result = DSRStringValue::checkValue(dateValue); + /* then, check whether the passed value is valid */ + if (result.good()) + result = DcmDate::checkStringValue(dateValue, "1"); + return result; +} diff --git a/dcmsr/libsrc/dsrdncsr.cc b/dcmsr/libsrc/dsrdncsr.cc new file mode 100644 index 00000000..dcaa8e4a --- /dev/null +++ b/dcmsr/libsrc/dsrdncsr.cc @@ -0,0 +1,98 @@ +/* + * + * Copyright (C) 2016-2017, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentTreeNodeCursor + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdncsr.h" +#include "dcmtk/dcmsr/dsrdoctn.h" + + +DSRDocumentTreeNodeCursor::DSRDocumentTreeNodeCursor() + : DSRTreeNodeCursor() +{ +} + + +DSRDocumentTreeNodeCursor::DSRDocumentTreeNodeCursor(const DSRDocumentTreeNodeCursor &cursor) + : DSRTreeNodeCursor(cursor) +{ +} + + +DSRDocumentTreeNodeCursor::DSRDocumentTreeNodeCursor(const DSRTreeNodeCursor &cursor) + : DSRTreeNodeCursor(cursor) +{ +} + + +DSRDocumentTreeNodeCursor::DSRDocumentTreeNodeCursor(DSRDocumentTreeNode *node, + const DSRPositionCounter *position) + : DSRTreeNodeCursor(node, position) +{ +} + + +DSRDocumentTreeNodeCursor::~DSRDocumentTreeNodeCursor() +{ +} + + +DSRDocumentTreeNodeCursor &DSRDocumentTreeNodeCursor::operator=(const DSRDocumentTreeNodeCursor &cursor) +{ + DSRTreeNodeCursor::operator=(cursor); + return *this; +} + + +DSRDocumentTreeNodeCursor &DSRDocumentTreeNodeCursor::operator=(DSRDocumentTreeNode *node) +{ + DSRTreeNodeCursor::operator=(node); + return *this; +} + + +size_t DSRDocumentTreeNodeCursor::gotoMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool searchIntoSub) +{ + size_t nodeID = 0; + const DSRDocumentTreeNode *node; + /* iterate over all nodes */ + do { + node = getNode(); + /* and check whether it matches */ + if (filter.matches(node)) + nodeID = node->getNodeID(); + } while ((nodeID == 0) && iterate(searchIntoSub)); + return nodeID; +} + + +size_t DSRDocumentTreeNodeCursor::gotoNextMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool searchIntoSub) +{ + /* first, goto "next" node */ + size_t nodeID = iterate(searchIntoSub); + if (nodeID > 0) + nodeID = gotoMatchingNode(filter, searchIntoSub); + return nodeID; +} diff --git a/dcmsr/libsrc/dsrdnflt.cc b/dcmsr/libsrc/dsrdnflt.cc new file mode 100644 index 00000000..0119870d --- /dev/null +++ b/dcmsr/libsrc/dsrdnflt.cc @@ -0,0 +1,358 @@ +/* + * + * Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation are maintained by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentTreeNodeFilter and derived implementations + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdnflt.h" +#include "dcmtk/dcmsr/dsrdoctn.h" + +#include "dcmtk/dcmdata/dcvrdt.h" + + +// implementation of base filter + +DSRDocumentTreeNodeFilter::~DSRDocumentTreeNodeFilter() +{ +} + + +// implementation of filter list + +DSRDocumentTreeNodeFilterList::DSRDocumentTreeNodeFilterList() + : FilterList() +{ +} + + +DSRDocumentTreeNodeFilterList::~DSRDocumentTreeNodeFilterList() +{ + OFListIterator(DSRDocumentTreeNodeFilter *) iter = FilterList.begin(); + const OFListConstIterator(DSRDocumentTreeNodeFilter *) last = FilterList.end(); + /* delete all filters and free memory */ + while (iter != last) + { + delete (*iter); + iter = FilterList.erase(iter); + } +} + + +OFCondition DSRDocumentTreeNodeFilterList::addFilter(DSRDocumentTreeNodeFilter *filter) +{ + OFCondition result = EC_IllegalParameter; + /* basic check of parameter */ + if (filter != NULL) + { + FilterList.push_back(filter); + result = EC_Normal; + } + return result; +} + + +// implementation of AND filter + +DSRDocumentTreeNodeAndFilter::~DSRDocumentTreeNodeAndFilter() +{ +} + + +OFBool DSRDocumentTreeNodeAndFilter::matches(const DSRDocumentTreeNode *node) const +{ + OFBool result = OFFalse; + if (node != NULL) + { + result = OFTrue; + /* check whether all filters match */ + OFListConstIterator(DSRDocumentTreeNodeFilter *) iter = FilterList.begin(); + const OFListConstIterator(DSRDocumentTreeNodeFilter *) last = FilterList.end(); + while ((iter != last) && result) + { + result = (*iter)->matches(node); + ++iter; + } + } + return result; +} + + +// implementation of OR filter + +DSRDocumentTreeNodeOrFilter::~DSRDocumentTreeNodeOrFilter() +{ +} + + +OFBool DSRDocumentTreeNodeOrFilter::matches(const DSRDocumentTreeNode *node) const +{ + OFBool result = OFFalse; + if (node != NULL) + { + /* check whether one of the filters matches */ + OFListConstIterator(DSRDocumentTreeNodeFilter *) iter = FilterList.begin(); + const OFListConstIterator(DSRDocumentTreeNodeFilter *) last = FilterList.end(); + while ((iter != last) && !result) + { + result = (*iter)->matches(node); + ++iter; + } + } + return result; +} + + +// implementation of "has Children" filter + +DSRDocumentTreeNodeHasChildrenFilter::DSRDocumentTreeNodeHasChildrenFilter(const OFBool hasChildren) + : HasChildren(hasChildren) +{ +} + + +DSRDocumentTreeNodeHasChildrenFilter::~DSRDocumentTreeNodeHasChildrenFilter() +{ +} + + +OFBool DSRDocumentTreeNodeHasChildrenFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the expected value matches */ + return (node != NULL) && (node->hasChildNodes() == HasChildren); +} + + +// implementation of "has Siblings" filter + +DSRDocumentTreeNodeHasSiblingsFilter::DSRDocumentTreeNodeHasSiblingsFilter(const OFBool hasSiblings) + : HasSiblings(hasSiblings) +{ +} + + +DSRDocumentTreeNodeHasSiblingsFilter::~DSRDocumentTreeNodeHasSiblingsFilter() +{ +} + + +OFBool DSRDocumentTreeNodeHasSiblingsFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the expected value matches */ + return (node != NULL) && (node->hasSiblingNodes() == HasSiblings); +} + + +// implementation of "has Concept Name" filter + +DSRDocumentTreeNodeHasConceptNameFilter::DSRDocumentTreeNodeHasConceptNameFilter(const OFBool hasConceptName) + : HasConceptName(hasConceptName) +{ +} + + +DSRDocumentTreeNodeHasConceptNameFilter::~DSRDocumentTreeNodeHasConceptNameFilter() +{ +} + + +OFBool DSRDocumentTreeNodeHasConceptNameFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the expected value matches */ + return (node != NULL) && (node->getConceptName().isEmpty() != HasConceptName); +} + + +// implementation of Concept Name filter + +DSRDocumentTreeNodeConceptNameFilter::DSRDocumentTreeNodeConceptNameFilter(const DSRCodedEntryValue &conceptName) + : ConceptName(conceptName) +{ +} + + +DSRDocumentTreeNodeConceptNameFilter::~DSRDocumentTreeNodeConceptNameFilter() +{ +} + + +OFBool DSRDocumentTreeNodeConceptNameFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the concept name matches */ + return (node != NULL) && (node->getConceptName() == ConceptName); +} + + +// implementation of Value Type filter + +DSRDocumentTreeNodeValueTypeFilter::DSRDocumentTreeNodeValueTypeFilter(const DSRTypes::E_ValueType &valueType) + : ValueType(valueType) +{ +} + + +DSRDocumentTreeNodeValueTypeFilter::~DSRDocumentTreeNodeValueTypeFilter() +{ +} + + +OFBool DSRDocumentTreeNodeValueTypeFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the value type matches */ + return (node != NULL) && (node->getValueType() == ValueType); +} + + +// implementation of Relationship Type filter + +DSRDocumentTreeNodeRelationshipTypeFilter::DSRDocumentTreeNodeRelationshipTypeFilter(const DSRTypes::E_RelationshipType &relationshipType) + : RelationshipType(relationshipType) +{ +} + + +DSRDocumentTreeNodeRelationshipTypeFilter::~DSRDocumentTreeNodeRelationshipTypeFilter() +{ +} + + +OFBool DSRDocumentTreeNodeRelationshipTypeFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the relationship type matches */ + return (node != NULL) && (node->getRelationshipType() == RelationshipType); +} + + +// implementation of Annotation filter + +DSRDocumentTreeNodeAnnotationFilter::DSRDocumentTreeNodeAnnotationFilter(const DSRTreeNodeAnnotation &annotation) + : Annotation(annotation) +{ +} + + +DSRDocumentTreeNodeAnnotationFilter::~DSRDocumentTreeNodeAnnotationFilter() +{ +} + + +OFBool DSRDocumentTreeNodeAnnotationFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the annotation matches */ + return (node != NULL) && (node->getAnnotation() == Annotation); +} + + +// implementation of Observation Date/Time filter + +DSRDocumentTreeNodeObservationDateTimeFilter::DSRDocumentTreeNodeObservationDateTimeFilter(const OFString &fromDateTime, + const OFString &toDateTime) + : FromDateTime(fromDateTime), + ToDateTime(toDateTime), + FromDateTimeValue(), + ToDateTimeValue() +{ + /* convert to internal format only once */ + DcmDateTime::getOFDateTimeFromString(fromDateTime, FromDateTimeValue); + DcmDateTime::getOFDateTimeFromString(toDateTime, ToDateTimeValue); +} + + +DSRDocumentTreeNodeObservationDateTimeFilter::~DSRDocumentTreeNodeObservationDateTimeFilter() +{ +} + + +OFBool DSRDocumentTreeNodeObservationDateTimeFilter::matches(const DSRDocumentTreeNode *node) const +{ + OFBool result = OFFalse; + /* check whether the observation date/time matches */ + if (node != NULL) + { + /* special case: empty value */ + if (node->getObservationDateTime().empty()) + result = FromDateTime.empty() && ToDateTime.empty(); + else { + const OFBool fromDateTimeValid = FromDateTimeValue.isValid(); + const OFBool toDateTimeValid = ToDateTimeValue.isValid(); + /* check for valid date/time range */ + if (fromDateTimeValid || toDateTimeValid) + { + OFDateTime dateTimeValue; + if (DcmDateTime::getOFDateTimeFromString(node->getObservationDateTime(), dateTimeValue).good()) + { + /* NB: see limitations of OFDateTime class regarding "<=" comparison */ + if (fromDateTimeValid && toDateTimeValid) + result = (FromDateTimeValue <= dateTimeValue) && (dateTimeValue <= ToDateTimeValue); + else if (fromDateTimeValid) + result = (FromDateTimeValue <= dateTimeValue); + else /* toDateTimeValid */ + result = (dateTimeValue <= ToDateTimeValue); + } + } + } + } + return result; +} + + +// implementation of Observation UID filter + +DSRDocumentTreeNodeObservationUIDFilter::DSRDocumentTreeNodeObservationUIDFilter(const OFString &observationUID) + : ObservationUID(observationUID) +{ +} + + +DSRDocumentTreeNodeObservationUIDFilter::~DSRDocumentTreeNodeObservationUIDFilter() +{ +} + + +OFBool DSRDocumentTreeNodeObservationUIDFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the observation UID matches */ + return (node != NULL) && (node->getObservationUID() == ObservationUID); +} + + +// implementation of Template Identification filter + +DSRDocumentTreeNodeTemplateIdentificationFilter::DSRDocumentTreeNodeTemplateIdentificationFilter(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID) + : TemplateIdentifier(templateIdentifier), + MappingResource(mappingResource), + MappingResourceUID(mappingResourceUID) +{ +} + + +DSRDocumentTreeNodeTemplateIdentificationFilter::~DSRDocumentTreeNodeTemplateIdentificationFilter() +{ +} + + +OFBool DSRDocumentTreeNodeTemplateIdentificationFilter::matches(const DSRDocumentTreeNode *node) const +{ + /* check whether the template identification matches */ + return (node != NULL) && (node->compareTemplateIdentification(TemplateIdentifier, MappingResource, MappingResourceUID)); +} diff --git a/dcmsr/libsrc/dsrdoc.cc b/dcmsr/libsrc/dsrdoc.cc new file mode 100644 index 00000000..6ba96ed5 --- /dev/null +++ b/dcmsr/libsrc/dsrdoc.cc @@ -0,0 +1,3113 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocument + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoc.h" +#include "dcmtk/dcmsr/dsrxmld.h" +#include "dcmtk/dcmsr/dsrpnmtn.h" +#include "dcmtk/dcmsr/dsrdattn.h" +#include "dcmtk/dcmsr/dsrdtitn.h" +#include "dcmtk/dcmsr/dsrtimtn.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcvrdt.h" + + +/*---------------------* + * macro definitions * + *---------------------*/ + +#define DCMSR_PRINT_HEADER_FIELD_START(header_name, delimiter) \ + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_HEADER_NAME) \ + stream << header_name; \ + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) \ + stream << delimiter; \ + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_HEADER_VALUE) + +#define DCMSR_PRINT_HEADER_FIELD_END \ + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_RESET) \ + stream << OFendl; + + +/*------------------* + * implementation * + *------------------*/ + +DSRDocument::DSRDocument(const E_DocumentType documentType) + : DocumentTree(documentType), + FinalizedFlag(OFFalse), + PreliminaryFlagEnum(PF_invalid), + CompletionFlagEnum(CF_invalid), + VerificationFlagEnum(VF_invalid), + SpecificCharacterSetEnum(CS_default), + SOPClassUID(DCM_SOPClassUID), + SOPInstanceUID(DCM_SOPInstanceUID), + SpecificCharacterSet(DCM_SpecificCharacterSet), + InstanceCreationDate(DCM_InstanceCreationDate), + InstanceCreationTime(DCM_InstanceCreationTime), + InstanceCreatorUID(DCM_InstanceCreatorUID), + CodingSchemeIdentification(), + TimezoneOffsetFromUTC(DCM_TimezoneOffsetFromUTC), + StudyInstanceUID(DCM_StudyInstanceUID), + StudyDate(DCM_StudyDate), + StudyTime(DCM_StudyTime), + ReferringPhysicianName(DCM_ReferringPhysicianName), + StudyID(DCM_StudyID), + AccessionNumber(DCM_AccessionNumber), + StudyDescription(DCM_StudyDescription), + PatientName(DCM_PatientName), + PatientID(DCM_PatientID), + IssuerOfPatientID(DCM_IssuerOfPatientID), + PatientBirthDate(DCM_PatientBirthDate), + PatientSex(DCM_PatientSex), + Manufacturer(DCM_Manufacturer), + ManufacturerModelName(DCM_ManufacturerModelName), + DeviceSerialNumber(DCM_DeviceSerialNumber), + SoftwareVersions(DCM_SoftwareVersions), + SynchronizationFrameOfReferenceUID(DCM_SynchronizationFrameOfReferenceUID), + SynchronizationTrigger(DCM_SynchronizationTrigger), + AcquisitionTimeSynchronized(DCM_AcquisitionTimeSynchronized), + Modality(DCM_Modality), + SeriesInstanceUID(DCM_SeriesInstanceUID), + SeriesNumber(DCM_SeriesNumber), + SeriesDate(DCM_SeriesDate), + SeriesTime(DCM_SeriesTime), + ProtocolName(DCM_ProtocolName), + SeriesDescription(DCM_SeriesDescription), + ReferencedPerformedProcedureStep(DCM_ReferencedPerformedProcedureStepSequence), + InstanceNumber(DCM_InstanceNumber), + PreliminaryFlag(DCM_PreliminaryFlag), + CompletionFlag(DCM_CompletionFlag), + CompletionFlagDescription(DCM_CompletionFlagDescription), + VerificationFlag(DCM_VerificationFlag), + ContentDate(DCM_ContentDate), + ContentTime(DCM_ContentTime), + VerifyingObserver(DCM_VerifyingObserverSequence), + PredecessorDocuments(DCM_PredecessorDocumentsSequence), + IdenticalDocuments(DCM_IdenticalDocumentsSequence), + PerformedProcedureCode(DCM_PerformedProcedureCodeSequence), + CurrentRequestedProcedureEvidence(DCM_CurrentRequestedProcedureEvidenceSequence), + PertinentOtherEvidence(DCM_PertinentOtherEvidenceSequence), + ReferencedInstances() +{ + DCMSR_DEBUG("Initializing all DICOM header attributes"); + /* set initial values for a new SOP instance */ + updateAttributes(OFTrue /*updateAll*/, OFFalse /*verboseMode*/); +} + + +DSRDocument::~DSRDocument() +{ +} + + +void DSRDocument::clear() +{ + /* clear SR document tree */ + DocumentTree.clear(); + FinalizedFlag = OFFalse; + /* clear enumerated values */ + PreliminaryFlagEnum = PF_invalid; + CompletionFlagEnum = CF_invalid; + VerificationFlagEnum = VF_invalid; + SpecificCharacterSetEnum = CS_default; + /* clear all DICOM attributes */ + SOPClassUID.clear(); + SOPInstanceUID.clear(); + SpecificCharacterSet.clear(); + InstanceCreationDate.clear(); + InstanceCreationTime.clear(); + InstanceCreatorUID.clear(); + CodingSchemeIdentification.clear(); + TimezoneOffsetFromUTC.clear(); + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + StudyID.clear(); + AccessionNumber.clear(); + StudyDescription.clear(); + PatientName.clear(); + PatientID.clear(); + IssuerOfPatientID.clear(); + PatientBirthDate.clear(); + PatientSex.clear(); + Manufacturer.clear(); + ManufacturerModelName.clear(); + DeviceSerialNumber.clear(); + SoftwareVersions.clear(); + SynchronizationFrameOfReferenceUID.clear(); + SynchronizationTrigger.clear(); + AcquisitionTimeSynchronized.clear(); + Modality.clear(); + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + ProtocolName.clear(); + SeriesDescription.clear(); + ReferencedPerformedProcedureStep.clear(); + InstanceNumber.clear(); + PreliminaryFlag.clear(); + CompletionFlag.clear(); + CompletionFlagDescription.clear(); + VerificationFlag.clear(); + ContentDate.clear(); + ContentTime.clear(); + VerifyingObserver.clear(); + PerformedProcedureCode.clear(); + /* clear list structures */ + PredecessorDocuments.clear(); + IdenticalDocuments.clear(); + CurrentRequestedProcedureEvidence.clear(); + PertinentOtherEvidence.clear(); + ReferencedInstances.clear(); +} + + +OFBool DSRDocument::isValid() +{ + /* document is valid if the document tree is valid and ... */ + return DocumentTree.isValid() && !SOPClassUID.isEmpty() && !SOPInstanceUID.isEmpty(); +} + + +OFBool DSRDocument::isFinalized() const +{ + return FinalizedFlag; +} + + +OFCondition DSRDocument::print(STD_NAMESPACE ostream &stream, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (isValid()) + { + OFString tmpString, string2; + /* update only some DICOM attributes */ + updateAttributes(OFFalse /*updateAll*/); + + // --- print some general document information --- + + if (!(flags & PF_printNoDocumentHeader)) + { + /* document type/title */ + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DOCUMENT_TYPE) + stream << documentTypeToDocumentTitle(getDocumentType(), tmpString); + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_RESET) + stream << OFendl << OFendl; + /* patient related information */ + if (!PatientName.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Patient ", " : ") + stream << getPrintStringFromElement(PatientName, tmpString); + OFString patientStr; + if (!PatientSex.isEmpty()) + patientStr += getPrintStringFromElement(PatientSex, tmpString); + if (!PatientBirthDate.isEmpty()) + { + if (!patientStr.empty()) + patientStr += ", "; + patientStr += dicomToReadableDate(getStringValueFromElement(PatientBirthDate, tmpString), string2); + } + if (!PatientID.isEmpty()) + { + if (!patientStr.empty()) + patientStr += ", "; + patientStr += '#'; + patientStr += getPrintStringFromElement(PatientID, tmpString); + if (!IssuerOfPatientID.isEmpty()) + { + patientStr += ":"; + patientStr += getPrintStringFromElement(IssuerOfPatientID, tmpString); + } + } + if (!patientStr.empty()) + stream << " (" << patientStr << ")"; + DCMSR_PRINT_HEADER_FIELD_END + } + /* referring physician */ + if (!ReferringPhysicianName.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Referring Physician", " : ") + stream << getPrintStringFromElement(ReferringPhysicianName, tmpString); + DCMSR_PRINT_HEADER_FIELD_END + } + /* study-related information */ + if (!StudyDescription.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Study ", " : ") + stream << getPrintStringFromElement(StudyDescription, tmpString); + if (!StudyID.isEmpty()) + stream << " (#" << getPrintStringFromElement(StudyID, tmpString) << ")"; + DCMSR_PRINT_HEADER_FIELD_END + } + /* series-related information */ + if (!SeriesDescription.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Series ", " : ") + stream << getPrintStringFromElement(SeriesDescription, tmpString); + if (!SeriesNumber.isEmpty()) + stream << " (#" << getPrintStringFromElement(SeriesNumber, tmpString) << ")"; + DCMSR_PRINT_HEADER_FIELD_END + } + /* protocol name */ + if (!ProtocolName.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Protocol ", " : ") + stream << getPrintStringFromElement(ProtocolName, tmpString); + DCMSR_PRINT_HEADER_FIELD_END + } + /* manufacturer and device */ + if (!Manufacturer.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Manufacturer ", " : ") + stream << getPrintStringFromElement(Manufacturer, tmpString); + OFString deviceStr; + if (!ManufacturerModelName.isEmpty()) + deviceStr += getPrintStringFromElement(ManufacturerModelName, tmpString); + if (!DeviceSerialNumber.isEmpty()) + { + if (!deviceStr.empty()) + deviceStr += ", "; + deviceStr += '#'; + deviceStr += getPrintStringFromElement(DeviceSerialNumber, tmpString); + } + if (!deviceStr.empty()) + stream << " (" << deviceStr << ")"; + DCMSR_PRINT_HEADER_FIELD_END + } + /* Key Object Selection Documents do not contain the SR Document General Module */ + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + /* preliminary flag */ + if (!PreliminaryFlag.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Preliminary Flag ", " : ") + stream << getStringValueFromElement(PreliminaryFlag, tmpString); + DCMSR_PRINT_HEADER_FIELD_END + } + /* completion flag */ + DCMSR_PRINT_HEADER_FIELD_START("Completion Flag ", " : ") + stream << getStringValueFromElement(CompletionFlag, tmpString); + DCMSR_PRINT_HEADER_FIELD_END + if (!CompletionFlagDescription.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START(" ", " ") + stream << getPrintStringFromElement(CompletionFlagDescription, tmpString); + DCMSR_PRINT_HEADER_FIELD_END + } + /* predecessor documents */ + if (!PredecessorDocuments.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Predecessor Docs ", " : ") + stream << PredecessorDocuments.getNumberOfInstances(); + DCMSR_PRINT_HEADER_FIELD_END + } + } + /* identical documents */ + if (!IdenticalDocuments.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Identical Docs ", " : ") + stream << IdenticalDocuments.getNumberOfInstances(); + DCMSR_PRINT_HEADER_FIELD_END + } + /* referenced instances */ + if (!ReferencedInstances.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("References Objects ", " : ") + stream << ReferencedInstances.getNumberOfItems(); + DCMSR_PRINT_HEADER_FIELD_END + } + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + /* verification flag */ + DCMSR_PRINT_HEADER_FIELD_START("Verification Flag ", " : ") + stream << getStringValueFromElement(VerificationFlag, tmpString); + DCMSR_PRINT_HEADER_FIELD_END + /* verifying observer */ + const size_t obsCount = getNumberOfVerifyingObservers(); + for (size_t i = 1; i <= obsCount; i++) + { + OFString dateTime, obsName, organization; + DSRCodedEntryValue obsCode; + if (getVerifyingObserver(i, dateTime, obsName, obsCode, organization).good()) + { + if (i == 1) + { + DCMSR_PRINT_HEADER_FIELD_START("Verifying Observers", " : ") + } else { + DCMSR_PRINT_HEADER_FIELD_START(" ", " ") + } + stream << dicomToReadableDateTime(dateTime, tmpString) << ", " << obsName; + if (obsCode.isValid() || (flags & PF_printInvalidCodes)) + { + stream << " "; + obsCode.print(stream, (flags & PF_printAllCodes) > 0 /*printCodeValue*/, flags); + } + stream << ", " << organization; + DCMSR_PRINT_HEADER_FIELD_END + } + } + } + /* content date and time */ + if (!ContentDate.isEmpty() && !ContentTime.isEmpty()) + { + DCMSR_PRINT_HEADER_FIELD_START("Content Date/Time ", " : ") + stream << dicomToReadableDate(getStringValueFromElement(ContentDate, tmpString), string2) << " "; + stream << dicomToReadableTime(getStringValueFromElement(ContentTime, tmpString), string2); + DCMSR_PRINT_HEADER_FIELD_END + } + stream << OFendl; + } + + // --- dump document tree to stream --- + result = DocumentTree.print(stream, flags); + } + return result; +} + + +OFCondition DSRDocument::checkDatasetForReading(DcmItem &dataset, + E_DocumentType &documentType) +{ + OFCondition result = EC_Normal; + OFString tmpString; + DcmUniqueIdentifier sopClassUID(DCM_SOPClassUID); + DcmCodeString modality(DCM_Modality); + /* check SOP class UID */ + result = getAndCheckElementFromDataset(dataset, sopClassUID, "1", "1", "SOPCommonModule"); + if (result.good()) + { + documentType = sopClassUIDToDocumentType(getStringValueFromElement(sopClassUID, tmpString)); + DCMSR_DEBUG("Value of SOP Class UID: " << tmpString); + if (documentType == DT_invalid) + { + DCMSR_ERROR("SOP Class UID does not match one of the known SR document classes"); + result = SR_EC_UnknownDocumentType; + } + else if (!isDocumentTypeSupported(documentType)) + { + DCMSR_ERROR("Unsupported SOP Class UID (not yet implemented)"); + result = SR_EC_UnsupportedValue; + } + } else { + /* no SOP Class UID means no document type */ + documentType = DT_invalid; + } + /* check modality */ + if (result.good()) + { + if (documentType == DT_KeyObjectSelectionDocument) + result = getAndCheckElementFromDataset(dataset, modality, "1", "1", "KeyObjectDocumentSeriesModule"); + else + result = getAndCheckElementFromDataset(dataset, modality, "1", "1", "SRDocumentSeriesModule"); + if (result.good()) + { + if (getStringValueFromElement(modality, tmpString) != documentTypeToModality(documentType)) + { + DCMSR_ERROR("Modality does not match '" << documentTypeToModality(documentType) << "' for " + << documentTypeToReadableName(documentType)); + } + } + } + return result; +} + + +OFCondition DSRDocument::read(DcmItem &dataset, + const size_t flags) +{ + OFCondition result = EC_Normal; + E_DocumentType documentType = DT_invalid; + DCMSR_DEBUG("Reading SR document from DICOM dataset"); + /* re-initialize SR document */ + clear(); + /* check SOP class UID and modality first */ + result = checkDatasetForReading(dataset, documentType); + /* dataset is OK */ + if (result.good()) + { + OFString tmpString; + OFCondition searchCond = EC_Normal; + OFCondition obsSearchCond = EC_Normal; + + /* type 3 element and attributes which have already been checked are not checked */ + + // --- SOP Common Module --- + getElementFromDataset(dataset, SOPClassUID); /* already checked */ + getAndCheckElementFromDataset(dataset, SOPInstanceUID, "1", "1", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, SpecificCharacterSet, "1-n", "1C", "SOPCommonModule"); + getStringValueFromElement(SpecificCharacterSet, tmpString, -1 /* all components */); + /* currently, the VR checker in 'dcmdata' only supports ASCII and Latin-1 */ + if (!tmpString.empty() && (tmpString != "ISO_IR 6") && (tmpString != "ISO_IR 100")) + DCMSR_WARN("The VR checker does not support this Specific Character Set: " << tmpString); + getAndCheckElementFromDataset(dataset, InstanceCreationDate, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreationTime, "1", "3", "SOPCommonModule"); + getAndCheckElementFromDataset(dataset, InstanceCreatorUID, "1", "3", "SOPCommonModule"); + CodingSchemeIdentification.read(dataset, flags); + if (requiresTimezoneModule(documentType)) + { + // --- Timezone Module --- + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "1", "TimezoneModule"); + } else { + // --- SOP Common Module --- + getAndCheckElementFromDataset(dataset, TimezoneOffsetFromUTC, "1", "3", "SOPCommonModule"); + } + + // --- General Study and Patient Module --- + readStudyData(dataset, flags); + + if (requiresEnhancedEquipmentModule(documentType)) + { + // --- Enhanced General Equipment Module --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "1", "EnhancedGeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "1", "EnhancedGeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "1", "EnhancedGeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "1", "EnhancedGeneralEquipmentModule"); + } else { + // --- General Equipment Module --- + getAndCheckElementFromDataset(dataset, Manufacturer, "1", "2", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, ManufacturerModelName, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, DeviceSerialNumber, "1", "3", "GeneralEquipmentModule"); + getAndCheckElementFromDataset(dataset, SoftwareVersions, "1-n", "3", "GeneralEquipmentModule"); + } + + // --- Synchronization Module --- + if (requiresSynchronizationModule(documentType) /* either the IOD requires this module */ || + dataset.tagExistsWithValue(DCM_SynchronizationFrameOfReferenceUID) || dataset.tagExistsWithValue(DCM_SynchronizationTrigger) || + dataset.tagExistsWithValue(DCM_AcquisitionTimeSynchronized) /* or all attributes should be absent */ ) + { + getAndCheckElementFromDataset(dataset, SynchronizationFrameOfReferenceUID, "1", "1", "SynchronizationModule"); + getAndCheckElementFromDataset(dataset, SynchronizationTrigger, "1", "1", "SynchronizationModule"); + getAndCheckElementFromDataset(dataset, AcquisitionTimeSynchronized, "1", "1", "SynchronizationModule"); + } + + // --- SR Document Series Module / Key Object Document Series Module --- + getElementFromDataset(dataset, Modality); /* already checked */ + if (documentType == DT_KeyObjectSelectionDocument) + { + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "KeyObjectDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "1", "KeyObjectDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "KeyObjectDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "KeyObjectDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, ProtocolName, "1", "3", "KeyObjectDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "KeyObjectDocumentSeriesModule"); + /* need to check sequence in two steps (avoids additional getAndCheck... method) */ + searchCond = getElementFromDataset(dataset, ReferencedPerformedProcedureStep); + checkElementValue(ReferencedPerformedProcedureStep, "1", "2", searchCond, "KeyObjectDocumentSeriesModule"); + } else { + getAndCheckElementFromDataset(dataset, SeriesInstanceUID, "1", "1", "SRDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesNumber, "1", "1", "SRDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDate, "1", "3", "SRDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesTime, "1", "3", "SRDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, ProtocolName, "1", "3", "SRDocumentSeriesModule"); + getAndCheckElementFromDataset(dataset, SeriesDescription, "1", "3", "SRDocumentSeriesModule"); + /* need to check sequence in two steps (avoids additional getAndCheck... method) */ + searchCond = getElementFromDataset(dataset, ReferencedPerformedProcedureStep); + checkElementValue(ReferencedPerformedProcedureStep, "1", "2", searchCond, "SRDocumentSeriesModule"); + } + /* remove possible signature sequences */ + removeAttributeFromSequence(ReferencedPerformedProcedureStep, DCM_MACParametersSequence); + removeAttributeFromSequence(ReferencedPerformedProcedureStep, DCM_DigitalSignaturesSequence); + + // --- SR Document General Module / Key Object Document Module --- + if (documentType == DT_KeyObjectSelectionDocument) + { + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "1", "KeyObjectDocumentModule"); + getAndCheckElementFromDataset(dataset, ContentDate, "1", "1", "KeyObjectDocumentModule"); + getAndCheckElementFromDataset(dataset, ContentTime, "1", "1", "KeyObjectDocumentModule"); + } else { + getAndCheckElementFromDataset(dataset, InstanceNumber, "1", "1", "SRDocumentGeneralModule"); + getAndCheckElementFromDataset(dataset, ContentDate, "1", "1", "SRDocumentGeneralModule"); + getAndCheckElementFromDataset(dataset, ContentTime, "1", "1", "SRDocumentGeneralModule"); + getAndCheckElementFromDataset(dataset, PreliminaryFlag, "1", "3", "SRDocumentGeneralModule"); + getAndCheckElementFromDataset(dataset, CompletionFlag, "1", "1", "SRDocumentGeneralModule"); + getAndCheckElementFromDataset(dataset, CompletionFlagDescription, "1", "3", "SRDocumentGeneralModule"); + getAndCheckElementFromDataset(dataset, VerificationFlag, "1", "1", "SRDocumentGeneralModule"); + obsSearchCond = getElementFromDataset(dataset, VerifyingObserver); + PredecessorDocuments.read(dataset, flags); + /* need to check sequence in two steps (avoids additional getAndCheck... method) */ + searchCond = getElementFromDataset(dataset, PerformedProcedureCode); + checkElementValue(PerformedProcedureCode, "1-n", "2", searchCond, "SRDocumentGeneralModule"); + PertinentOtherEvidence.read(dataset, flags); + ReferencedInstances.read(dataset, flags); + } + IdenticalDocuments.read(dataset, flags); + CurrentRequestedProcedureEvidence.read(dataset, flags); + /* remove possible signature sequences */ + removeAttributeFromSequence(VerifyingObserver, DCM_MACParametersSequence); + removeAttributeFromSequence(VerifyingObserver, DCM_DigitalSignaturesSequence); + removeAttributeFromSequence(PerformedProcedureCode, DCM_MACParametersSequence); + removeAttributeFromSequence(PerformedProcedureCode, DCM_DigitalSignaturesSequence); + + /* update internal enumerated values and perform additional checks */ + + /* Key Object Selection Documents do not contain the SR Document General Module */ + if (documentType != DT_KeyObjectSelectionDocument) + { + /* get and check PreliminaryFlag (if present) */ + if (!PreliminaryFlag.isEmpty()) + { + PreliminaryFlagEnum = enumeratedValueToPreliminaryFlag(getStringValueFromElement(PreliminaryFlag, tmpString)); + if (PreliminaryFlagEnum == PF_invalid) + printUnknownValueWarningMessage("PreliminaryFlag", tmpString.c_str()); + } + /* get and check CompletionFlag */ + CompletionFlagEnum = enumeratedValueToCompletionFlag(getStringValueFromElement(CompletionFlag, tmpString)); + if (CompletionFlagEnum == CF_invalid) + printUnknownValueWarningMessage("CompletionFlag", tmpString.c_str()); + else if ((CompletionFlagEnum == CF_Partial) && (documentType == DT_XRayRadiationDoseSR)) + DCMSR_WARN("Invalid value for Completion Flag, should be 'COMPLETE' for X-Ray Radiation Dose SR"); + /* get and check VerificationFlag / VerifyingObserverSequence */ + VerificationFlagEnum = enumeratedValueToVerificationFlag(getStringValueFromElement(VerificationFlag, tmpString)); + if (VerificationFlagEnum == VF_invalid) + printUnknownValueWarningMessage("VerificationFlag", tmpString.c_str()); + else if (VerificationFlagEnum == VF_Verified) + checkElementValue(VerifyingObserver, "1-n", "1", obsSearchCond, "SRDocumentGeneralModule"); + } + getStringValueFromElement(SpecificCharacterSet, tmpString, -1 /* all components */); + SpecificCharacterSetEnum = definedTermToCharacterSet(tmpString); + /* check SpecificCharacterSet */ + if ((SpecificCharacterSetEnum == CS_invalid) && !tmpString.empty()) + printUnknownValueWarningMessage("SpecificCharacterSet", tmpString.c_str()); + + /* read SR document tree */ + if (result.good()) + result = DocumentTree.read(dataset, documentType, flags); + } + return result; +} + + +OFCondition DSRDocument::readPatientData(DcmItem &dataset, + const size_t /*flags*/) +{ + // --- Patient Module --- + getAndCheckElementFromDataset(dataset, PatientName, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientID, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, IssuerOfPatientID, "1", "3", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientBirthDate, "1", "2", "PatientModule"); + getAndCheckElementFromDataset(dataset, PatientSex, "1", "2", "PatientModule"); + /* always return success */ + return EC_Normal; +} + + +OFCondition DSRDocument::readStudyData(DcmItem &dataset, + const size_t flags) +{ + // --- General Study Module --- + getAndCheckElementFromDataset(dataset, StudyInstanceUID, "1", "1", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDate, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyTime, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, ReferringPhysicianName, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyID, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, AccessionNumber, "1", "2", "GeneralStudyModule"); + getAndCheckElementFromDataset(dataset, StudyDescription, "1", "3", "GeneralStudyModule"); + /* also read data from Patient Module */ + return readPatientData(dataset, flags); +} + + +OFCondition DSRDocument::write(DcmItem &dataset, + DcmStack *markedItems) +{ + OFCondition result = EC_Normal; + /* only write valid documents */ + if (isValid()) + { + DCMSR_DEBUG("Writing SR document to DICOM dataset"); + /* update all DICOM attributes */ + updateAttributes(); + + /* checking particular values */ + if ((CompletionFlagEnum == CF_Partial) && (getDocumentType() == DT_XRayRadiationDoseSR)) + DCMSR_WARN("Invalid value for Completion Flag, should be 'COMPLETE' for X-Ray Radiation Dose SR"); + + /* write general document attributes */ + + // --- SOP Common Module --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPClassUID), "1", "1", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SOPInstanceUID), "1", "1", "SOPCommonModule"); + /* never write specific character set for ASCII (default character repertoire) */ + if (SpecificCharacterSetEnum != CS_ASCII) + addElementToDataset(result, dataset, new DcmCodeString(SpecificCharacterSet), "1-n", "1C", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmDate(InstanceCreationDate), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmTime(InstanceCreationTime), "1", "3", "SOPCommonModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(InstanceCreatorUID), "1", "3", "SOPCommonModule"); + CodingSchemeIdentification.write(dataset); + if (requiresTimezoneModule(getDocumentType())) + { + // --- Timezone Module --- + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "1", "TimezoneModule"); + } else { + // --- SOP Common Module --- + addElementToDataset(result, dataset, new DcmShortString(TimezoneOffsetFromUTC), "1", "3", "SOPCommonModule"); + } + + // --- General Study Module --- + addElementToDataset(result, dataset, new DcmUniqueIdentifier(StudyInstanceUID), "1", "1", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmDate(StudyDate), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmTime(StudyTime), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmPersonName(ReferringPhysicianName), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(StudyID), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmShortString(AccessionNumber), "1", "2", "GeneralStudyModule"); + addElementToDataset(result, dataset, new DcmLongString(StudyDescription), "1", "3", "GeneralStudyModule"); + + // --- Patient Module --- + addElementToDataset(result, dataset, new DcmPersonName(PatientName), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(PatientID), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmLongString(IssuerOfPatientID), "1", "3", "PatientModule"); + addElementToDataset(result, dataset, new DcmDate(PatientBirthDate), "1", "2", "PatientModule"); + addElementToDataset(result, dataset, new DcmCodeString(PatientSex), "1", "2", "PatientModule"); + + if (requiresEnhancedEquipmentModule(getDocumentType())) + { + // --- Enhanced General Equipment Module --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "1", "EnhancedGeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "1", "EnhancedGeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "1", "EnhancedGeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "1", "EnhancedGeneralEquipmentModule"); + } else { + // --- General Equipment Module --- + addElementToDataset(result, dataset, new DcmLongString(Manufacturer), "1", "2", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(ManufacturerModelName), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(DeviceSerialNumber), "1", "3", "GeneralEquipmentModule"); + addElementToDataset(result, dataset, new DcmLongString(SoftwareVersions), "1-n", "3", "GeneralEquipmentModule"); + } + + // --- Synchronization Module --- + if (requiresSynchronizationModule(getDocumentType()) /* module required for some IODs */ || + !SynchronizationFrameOfReferenceUID.isEmpty() || !SynchronizationTrigger.isEmpty() || !AcquisitionTimeSynchronized.isEmpty()) + { + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SynchronizationFrameOfReferenceUID), "1", "1", "SynchronizationModule"); + addElementToDataset(result, dataset, new DcmCodeString(SynchronizationTrigger), "1", "1", "SynchronizationModule"); + addElementToDataset(result, dataset, new DcmCodeString(AcquisitionTimeSynchronized), "1", "1", "SynchronizationModule"); + } + + // --- SR Document Series Module / Key Object Document Series Module --- + if (getDocumentType() == DT_KeyObjectSelectionDocument) + { + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "KeyObjectDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "KeyObjectDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "1", "KeyObjectDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "KeyObjectDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "KeyObjectDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ProtocolName), "1", "3", "KeyObjectDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "KeyObjectDocumentSeriesModule"); + /* always write empty sequence since not yet fully supported */ + ReferencedPerformedProcedureStep.clear(); + addElementToDataset(result, dataset, new DcmSequenceOfItems(ReferencedPerformedProcedureStep), "1", "2", "KeyObjectDocumentSeriesModule"); + } else { + addElementToDataset(result, dataset, new DcmCodeString(Modality), "1", "1", "SRDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmUniqueIdentifier(SeriesInstanceUID), "1", "1", "SRDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmIntegerString(SeriesNumber), "1", "1", "SRDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmDate(SeriesDate), "1", "3", "SRDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmTime(SeriesTime), "1", "3", "SRDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(ProtocolName), "1", "3", "SRDocumentSeriesModule"); + addElementToDataset(result, dataset, new DcmLongString(SeriesDescription), "1", "3", "SRDocumentSeriesModule"); + /* always write empty sequence since not yet fully supported */ + ReferencedPerformedProcedureStep.clear(); + addElementToDataset(result, dataset, new DcmSequenceOfItems(ReferencedPerformedProcedureStep), "1", "2", "SRDocumentSeriesModule"); + } + + // --- SR Document General Module / Key Object Document Module --- + if (getDocumentType() == DT_KeyObjectSelectionDocument) + { + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "1", "KeyObjectDocumentModule"); + addElementToDataset(result, dataset, new DcmDate(ContentDate), "1", "1", "KeyObjectDocumentModule"); + addElementToDataset(result, dataset, new DcmTime(ContentTime), "1", "1", "KeyObjectDocumentModule"); + } else { + addElementToDataset(result, dataset, new DcmIntegerString(InstanceNumber), "1", "1", "SRDocumentGeneralModule"); + addElementToDataset(result, dataset, new DcmDate(ContentDate), "1", "1", "SRDocumentGeneralModule"); + addElementToDataset(result, dataset, new DcmTime(ContentTime), "1", "1", "SRDocumentGeneralModule"); + addElementToDataset(result, dataset, new DcmCodeString(PreliminaryFlag), "1", "3", "SRDocumentGeneralModule"); + addElementToDataset(result, dataset, new DcmCodeString(CompletionFlag), "1", "1", "SRDocumentGeneralModule"); + addElementToDataset(result, dataset, new DcmLongString(CompletionFlagDescription), "1", "3", "SRDocumentGeneralModule"); + addElementToDataset(result, dataset, new DcmCodeString(VerificationFlag), "1", "1", "SRDocumentGeneralModule"); + if (VerificationFlagEnum == VF_Verified) + addElementToDataset(result, dataset, new DcmSequenceOfItems(VerifyingObserver), "1-n", "1", "SRDocumentGeneralModule"); + if (result.good()) + PredecessorDocuments.write(dataset); /* optional */ + /* always write empty sequence since not yet fully supported */ + PerformedProcedureCode.clear(); + addElementToDataset(result, dataset, new DcmSequenceOfItems(PerformedProcedureCode), "1-n", "2", "SRDocumentGeneralModule"); + if (result.good()) + result = PertinentOtherEvidence.write(dataset); + if (result.good()) + result = ReferencedInstances.write(dataset); + } + + if (result.good()) + IdenticalDocuments.write(dataset); /* optional */ + if (result.good()) + result = CurrentRequestedProcedureEvidence.write(dataset); + + /* write SR document tree */ + if (result.good()) + result = DocumentTree.write(dataset, markedItems); + } else + result = SR_EC_InvalidDocument; + return result; +} + + +OFCondition DSRDocument::readXML(const OFString &filename, + const size_t flags) +{ + DSRXMLDocument doc; + DCMSR_DEBUG("Reading SR document from XML format"); + /* read, parse and validate XML document */ + OFCondition result = doc.read(filename, flags); + if (result.good()) + { + /* re-initialize SR document */ + clear(); + /* start with document root node */ + DSRXMLCursor cursor(doc.getRootNode()); + /* check whether we really parse a "report" document */ + result = doc.checkNode(cursor, "report"); + if (result.good()) + { + /* goto sub-element "sopclass" (first child node!) */ + result = doc.checkNode(cursor.gotoChild(), "sopclass"); + if (result.good()) + { + /* determine document type (SOP class) */ + result = doc.getElementFromAttribute(cursor, SOPClassUID, "uid"); + if (result.good()) + { + OFString sopClassUID; + getSOPClassUID(sopClassUID); + /* create new document of specified type (also checks for support) */ + result = createNewDocument(sopClassUIDToDocumentType(sopClassUID)); + if (result.good()) + { + /* proceed with document header */ + result = readXMLDocumentHeader(doc, cursor.gotoNext(), flags); + } else + DCMSR_ERROR("Unknown/Unsupported SOP Class UID"); + } + } + } + } + return result; +} + + +OFCondition DSRDocument::readXMLDocumentHeader(DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (doc.valid() && cursor.valid()) + { + result = EC_Normal; + /* iterate over all nodes */ + while (cursor.valid() && result.good()) + { + /* check for known element tags */ + if (doc.matchNode(cursor, "charset")) + { + /* use "charset" to decode special characters (has to be at the beginning) */ + if (!doc.encodingHandlerValid()) + { + OFString tmpString; + /* check for known character set */ + setSpecificCharacterSet(doc.getStringFromNodeContent(cursor, tmpString)); + if (tmpString.empty()) + DCMSR_WARN("Empty value for 'charset' ... ignoring"); + else { + const char *encString = characterSetToXMLName(SpecificCharacterSetEnum); + if ((strcmp(encString, "?") == 0) || doc.setEncodingHandler(encString).bad()) + DCMSR_WARN("Character set '" << tmpString << "' not supported"); + } + } else { + /* only one "charset" node allowed */ + doc.printUnexpectedNodeWarning(cursor); + } + } + else if (doc.matchNode(cursor, "timezone")) + { + doc.getElementFromNodeContent(cursor, TimezoneOffsetFromUTC, NULL, OFTrue /*encoding*/); + } + else if (doc.matchNode(cursor, "modality")) + { + OFString tmpString; + /* compare the XML node content */ + if (doc.getStringFromNodeContent(cursor, tmpString) != documentTypeToModality(getDocumentType())) + DCMSR_WARN("Invalid value for 'modality' ... ignoring"); + } + else if (doc.matchNode(cursor, "device")) + { + doc.getElementFromNodeContent(doc.getNamedChildNode(cursor, "manufacturer", OFFalse /*required*/), Manufacturer, NULL, OFTrue /*encoding*/); + doc.getElementFromNodeContent(doc.getNamedChildNode(cursor, "model"), ManufacturerModelName, NULL, OFTrue /*encoding*/); + doc.getElementFromNodeContent(doc.getNamedChildNode(cursor, "serial", OFFalse /*required*/), DeviceSerialNumber, NULL, OFTrue /*encoding*/); + doc.getElementFromNodeContent(doc.getNamedChildNode(cursor, "version", OFFalse /*required*/), SoftwareVersions, NULL, OFTrue /*encoding*/); + } + else if (doc.matchNode(cursor, "manufacturer")) + doc.getElementFromNodeContent(cursor, Manufacturer, "manufacturer", OFTrue /*encoding*/); + else if (doc.matchNode(cursor, "synchronization")) + { + doc.getElementFromAttribute(cursor, SynchronizationFrameOfReferenceUID, "uid"); + doc.getElementFromNodeContent(doc.getNamedChildNode(cursor, "trigger"), SynchronizationTrigger); + doc.getElementFromNodeContent(doc.getNamedChildNode(cursor, "acquisitiontime"), AcquisitionTimeSynchronized); + } + else if (doc.matchNode(cursor, "referringphysician")) + { + /* goto sub-element "name" */ + const DSRXMLCursor childNode = doc.getNamedChildNode(cursor, "name"); + if (childNode.valid()) + { + /* Referring Physician's Name */ + OFString tmpString; + DSRPNameTreeNode::getValueFromXMLNodeContent(doc, childNode.getChild(), tmpString); + ReferringPhysicianName.putOFStringArray(tmpString); + } + } + else if (doc.matchNode(cursor, "patient")) + result = readXMLPatientData(doc, cursor.getChild(), flags); + else if (doc.matchNode(cursor, "study")) + result = readXMLStudyData(doc, cursor, flags); + else if (doc.matchNode(cursor, "series")) + result = readXMLSeriesData(doc, cursor, flags); + else if (doc.matchNode(cursor, "instance")) + result = readXMLInstanceData(doc, cursor, flags); + else if (doc.matchNode(cursor, "coding")) + { + const DSRXMLCursor childNode = cursor.getChild(); + if (childNode.valid()) + result = CodingSchemeIdentification.readXML(doc, childNode, flags); + } + else if (doc.matchNode(cursor, "evidence")) + { + OFString typeString; + /* check "type" attribute for corresponding sequence */ + if (doc.getStringFromAttribute(cursor, typeString, "type") == "Current Requested Procedure") + result = CurrentRequestedProcedureEvidence.readXML(doc, cursor.getChild(), flags); + else if (typeString == "Pertinent Other") + { + if (getDocumentType() != DT_KeyObjectSelectionDocument) + result = PertinentOtherEvidence.readXML(doc, cursor.getChild(), flags); + else + doc.printUnexpectedNodeWarning(cursor); + } else // none of the standard defined evidence types + printUnknownValueWarningMessage("Evidence type", typeString.c_str()); + } + else if (doc.matchNode(cursor, "reference")) + { + const DSRXMLCursor childNode = cursor.getChild(); + if (childNode.valid()) + result = ReferencedInstances.readXML(doc, childNode, flags); + } + else if (doc.matchNode(cursor, "document")) + result = readXMLDocumentData(doc, cursor.getChild(), flags); + else + doc.printUnexpectedNodeWarning(cursor); + /* print node error message (if any) */ + doc.printGeneralNodeError(cursor, result); + /* proceed with next node */ + cursor.gotoNext(); + } + } + return result; +} + + +OFCondition DSRDocument::readXMLPatientData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t /*flags*/) +{ + OFCondition result = SR_EC_InvalidDocument; + if (cursor.valid()) + { + OFString tmpString; + result = EC_Normal; + /* iterate over all nodes */ + while (cursor.valid()) + { + /* check for known element tags (all type 2) */ + if (doc.matchNode(cursor, "name")) + { + /* Patient's Name */ + DSRPNameTreeNode::getValueFromXMLNodeContent(doc, cursor.getChild(), tmpString); + PatientName.putOFStringArray(tmpString); + } + else if (doc.matchNode(cursor, "birthday")) + { + /* Patient's Birth Date */ + DSRDateTreeNode::getValueFromXMLNodeContent(doc, doc.getNamedChildNode(cursor, "date"), tmpString); + PatientBirthDate.putOFStringArray(tmpString); + } + else if (doc.getElementFromNodeContent(cursor, PatientID, "id").bad() && + doc.getElementFromNodeContent(cursor, IssuerOfPatientID, "issuer").bad() && + doc.getElementFromNodeContent(cursor, PatientSex, "sex").bad()) + { + doc.printUnexpectedNodeWarning(cursor); + } + /* proceed with next node */ + cursor.gotoNext(); + } + } + return result; +} + + +OFCondition DSRDocument::readXMLStudyData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (cursor.valid()) + { + OFString tmpString; + /* get Study Instance UID from XML attribute */ + if (flags & XF_acceptEmptyStudySeriesInstanceUID) + { + if (doc.getElementFromAttribute(cursor, StudyInstanceUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/).bad()) + doc.printMissingAttributeWarning(cursor, "uid"); + result = EC_Normal; + } else + result = doc.getElementFromAttribute(cursor, StudyInstanceUID, "uid"); + /* goto first sub-element */ + cursor.gotoChild(); + /* iterate over all nodes */ + while (cursor.valid()) + { + /* check for known element tags */ + if (doc.matchNode(cursor, "accession")) + { + /* goto sub-element "number" */ + doc.getElementFromNodeContent(doc.getNamedChildNode(cursor, "number"), AccessionNumber); + } + else if (doc.matchNode(cursor, "date")) + { + DSRDateTreeNode::getValueFromXMLNodeContent(doc, cursor, tmpString); + StudyDate.putOFStringArray(tmpString); + } + else if (doc.matchNode(cursor, "time")) + { + DSRTimeTreeNode::getValueFromXMLNodeContent(doc, cursor, tmpString); + StudyTime.putOFStringArray(tmpString); + } + else if (doc.getElementFromNodeContent(cursor, StudyID, "id").bad() && + doc.getElementFromNodeContent(cursor, StudyDescription, "description", OFTrue /*encoding*/).bad()) + { + doc.printUnexpectedNodeWarning(cursor); + } + /* proceed with next node */ + cursor.gotoNext(); + } + /* check required element values */ + checkElementValue(StudyInstanceUID, "1", "1"); + } + return result; +} + + +OFCondition DSRDocument::readXMLSeriesData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (cursor.valid()) + { + OFString tmpString; + /* get Series Instance UID from XML attribute */ + if (flags & XF_acceptEmptyStudySeriesInstanceUID) + { + if (doc.getElementFromAttribute(cursor, SeriesInstanceUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/).bad()) + doc.printMissingAttributeWarning(cursor, "uid"); + result = EC_Normal; + } else + result = doc.getElementFromAttribute(cursor, SeriesInstanceUID, "uid"); + /* goto first sub-element */ + cursor.gotoChild(); + /* iterate over all nodes */ + while (cursor.valid()) + { + /* check for known element tags */ + if (doc.matchNode(cursor, "date")) + { + DSRDateTreeNode::getValueFromXMLNodeContent(doc, cursor, tmpString); + SeriesDate.putOFStringArray(tmpString); + } + else if (doc.matchNode(cursor, "time")) + { + DSRTimeTreeNode::getValueFromXMLNodeContent(doc, cursor, tmpString); + SeriesTime.putOFStringArray(tmpString); + } + else if (doc.getElementFromNodeContent(cursor, SeriesNumber, "number").bad() && + doc.getElementFromNodeContent(cursor, ProtocolName, "protocol", OFTrue /*encoding*/).bad() && + doc.getElementFromNodeContent(cursor, SeriesDescription, "description", OFTrue /*encoding*/).bad()) + { + doc.printUnexpectedNodeWarning(cursor); + } + /* proceed with next node */ + cursor.gotoNext(); + } + /* check required element values */ + checkElementValue(SeriesInstanceUID, "1", "1"); + checkElementValue(SeriesNumber, "1", "1"); + } + return result; +} + + +OFCondition DSRDocument::readXMLInstanceData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (cursor.valid()) + { + OFString tmpString; + /* get SOP Instance UID from XML attribute */ + if (flags & XF_acceptEmptyStudySeriesInstanceUID) + { + if (doc.getElementFromAttribute(cursor, SOPInstanceUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/).bad()) + doc.printMissingAttributeWarning(cursor, "uid"); + result = EC_Normal; + } else + result = doc.getElementFromAttribute(cursor, SOPInstanceUID, "uid"); + /* goto first sub-element */ + cursor.gotoChild(); + /* iterate over all nodes */ + while (cursor.valid()) + { + /* check for known element tags */ + if (doc.matchNode(cursor, "creation")) + { + /* Instance Creator UID */ + doc.getElementFromAttribute(cursor, InstanceCreatorUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/); + /* Instance Creation Date */ + DSRDateTreeNode::getValueFromXMLNodeContent(doc, doc.getNamedChildNode(cursor, "date"), tmpString); + InstanceCreationDate.putOFStringArray(tmpString); + /* Instance Creation Time */ + DSRTimeTreeNode::getValueFromXMLNodeContent(doc, doc.getNamedChildNode(cursor, "time"), tmpString); + InstanceCreationTime.putOFStringArray(tmpString); + } + else if (doc.getElementFromNodeContent(cursor, InstanceNumber, "number").bad()) + doc.printUnexpectedNodeWarning(cursor); + /* proceed with next node */ + cursor.gotoNext(); + } + /* check required element values */ + checkElementValue(SOPInstanceUID, "1", "1"); + } + return result; +} + + +OFCondition DSRDocument::readXMLDocumentData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (cursor.valid()) + { + OFString tmpString; + const E_DocumentType documentType = getDocumentType(); + result = EC_Normal; + /* iterate over all nodes */ + while (cursor.valid() && result.good()) + { + /* check for known element tags + (Key Object Selection Documents do not contain the SR Document General Module) */ + if ((documentType != DT_KeyObjectSelectionDocument) && doc.matchNode(cursor, "preliminary")) + { + /* Preliminary Flag */ + PreliminaryFlagEnum = enumeratedValueToPreliminaryFlag(doc.getStringFromAttribute(cursor, tmpString, "flag")); + if (PreliminaryFlagEnum == PF_invalid) + printUnknownValueWarningMessage("PreliminaryFlag", tmpString.c_str()); + } + else if ((documentType != DT_KeyObjectSelectionDocument) && doc.matchNode(cursor, "completion")) + { + /* Completion Flag */ + CompletionFlagEnum = enumeratedValueToCompletionFlag(doc.getStringFromAttribute(cursor, tmpString, "flag")); + if (CompletionFlagEnum != CF_invalid) + { + /* Completion Flag Description (optional) */ + const DSRXMLCursor childCursor = doc.getNamedChildNode(cursor, "description", OFFalse /*required*/); + if (childCursor.valid()) + doc.getElementFromNodeContent(childCursor, CompletionFlagDescription, NULL /*name*/, OFTrue /*encoding*/); + } else + printUnknownValueWarningMessage("CompletionFlag", tmpString.c_str()); + } + else if ((documentType != DT_KeyObjectSelectionDocument) && doc.matchNode(cursor, "verification")) + { + /* Verification Flag */ + VerificationFlagEnum = enumeratedValueToVerificationFlag(doc.getStringFromAttribute(cursor, tmpString, "flag")); + if (VerificationFlagEnum != VF_invalid) + { + /* Verifying Observers (required if VERIFIED) */ + result = readXMLVerifyingObserverData(doc, cursor.getChild(), flags); + /* allow absence in case of UNVERIFIED */ + if (VerificationFlagEnum == VF_Unverified) + result = EC_Normal; + } else + printUnknownValueWarningMessage("VerificationFlag", tmpString.c_str()); + } + else if ((documentType != DT_KeyObjectSelectionDocument) && doc.matchNode(cursor, "predecessor")) + { + /* Predecessor Documents Sequence (optional) */ + result = PredecessorDocuments.readXML(doc, cursor.getChild(), flags); + } + else if (doc.matchNode(cursor, "identical")) + { + /* Identical Documents Sequence (optional) */ + result = IdenticalDocuments.readXML(doc, cursor.getChild(), flags); + } + else if (doc.matchNode(cursor, "content")) + { + /* Content Date */ + DSRDateTreeNode::getValueFromXMLNodeContent(doc, doc.getNamedChildNode(cursor, "date"), tmpString); + ContentDate.putOFStringArray(tmpString); + /* Content Time */ + DSRTimeTreeNode::getValueFromXMLNodeContent(doc, doc.getNamedChildNode(cursor, "time"), tmpString); + ContentTime.putOFStringArray(tmpString); + /* proceed with document tree */ + result = DocumentTree.readXML(doc, cursor.getChild(), flags); + } else + doc.printUnexpectedNodeWarning(cursor); + /* print node error message (if any) */ + doc.printGeneralNodeError(cursor, result); + /* proceed with next node */ + cursor.gotoNext(); + } + } + return result; +} + + +OFCondition DSRDocument::readXMLVerifyingObserverData(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (cursor.valid()) + { + result = EC_Normal; + /* iterate over all nodes */ + while (cursor.valid()) + { + /* check for known element tags */ + if (doc.matchNode(cursor, "observer")) + { + DcmItem *ditem = new DcmItem(); + if (ditem != NULL) + { + OFString dateTimeString, nameString, orgaString; + DSRCodedEntryValue codeValue; + DSRXMLCursor childCursor = cursor.getChild(); + /* iterate over all child nodes */ + while (childCursor.valid()) + { + /* check for known element tags */ + if (doc.matchNode(childCursor, "code")) + { + /* Verifying Observer Code */ + codeValue.readXML(doc, childCursor, flags); + } + else if (doc.matchNode(childCursor, "name")) + { + /* Verifying Observer Name */ + DSRPNameTreeNode::getValueFromXMLNodeContent(doc, childCursor.getChild(), nameString); + } + else if (doc.matchNode(childCursor, "datetime")) + { + /* Verification DateTime */ + DSRDateTimeTreeNode::getValueFromXMLNodeContent(doc, childCursor, dateTimeString); + } else { + /* Verifying Observer Organization */ + doc.getStringFromNodeContent(childCursor, orgaString, "organization", OFTrue /*encoding*/, OFFalse /*clearString*/); + } + /* proceed with next node */ + childCursor.gotoNext(); + } + /* put string values into the sequence item */ + putStringValueToDataset(*ditem, DCM_VerificationDateTime, dateTimeString); + putStringValueToDataset(*ditem, DCM_VerifyingObserverName, nameString); + putStringValueToDataset(*ditem, DCM_VerifyingOrganization, orgaString); + /* write code value to sequence item (might be empty, type 2) */ + codeValue.writeSequence(*ditem, DCM_VerifyingObserverIdentificationCodeSequence); + /* insert items into sequence */ + VerifyingObserver.insert(ditem); + } + } else + doc.printUnexpectedNodeWarning(cursor); + /* proceed with next node */ + cursor.gotoNext(); + } + } + return result; +} + + +OFCondition DSRDocument::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + /* only write valid documents */ + if (isValid()) + { + DCMSR_DEBUG("Writing SR document to XML format"); + /* used for multiple purposes */ + OFString tmpString; + /* update all DICOM attributes */ + updateAttributes(); + + // --- XML document structure (start) --- + + stream << "" << OFendl; + + stream << "" << OFendl; + + // --- write some general document information --- + + stream << ""; + /* retrieve name of SOP class (if known) */ + stream << dcmFindNameOfUID(tmpString.c_str(), "" /* empty value as default */); + stream << "" << OFendl; + writeStringFromElementToXML(stream, SpecificCharacterSet, "charset", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, TimezoneOffsetFromUTC, "timezone", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, Modality, "modality", (flags & XF_writeEmptyTags) > 0); + /* check for additional device information */ + if (!ManufacturerModelName.isEmpty()) + { + stream << "" << OFendl; + writeStringFromElementToXML(stream, Manufacturer, "manufacturer", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, ManufacturerModelName, "model", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, DeviceSerialNumber, "serial", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, SoftwareVersions, "version", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + } else + writeStringFromElementToXML(stream, Manufacturer, "manufacturer", (flags & XF_writeEmptyTags) > 0); + + if ((flags & XF_writeEmptyTags) || !SynchronizationFrameOfReferenceUID.isEmpty() || + !SynchronizationTrigger.isEmpty() || !AcquisitionTimeSynchronized.isEmpty()) + { + stream << "" << OFendl; + writeStringFromElementToXML(stream, SynchronizationTrigger, "trigger", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, AcquisitionTimeSynchronized, "acquisitiontime", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + } + + if ((flags & XF_writeEmptyTags) || !ReferringPhysicianName.isEmpty()) + { + stream << "" << OFendl; + writeStringFromElementToXML(stream, ReferringPhysicianName, "name", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + } + + stream << "" << OFendl; + writeStringFromElementToXML(stream, PatientID, "id", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, IssuerOfPatientID, "issuer", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, PatientName, "name", (flags & XF_writeEmptyTags) > 0); + if ((flags & XF_writeEmptyTags) || !PatientBirthDate.isEmpty()) + { + stream << "" << OFendl; + PatientBirthDate.getISOFormattedDate(tmpString); + writeStringValueToXML(stream, tmpString, "date", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + } + writeStringFromElementToXML(stream, PatientSex, "sex", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + + stream << "" << OFendl; + writeStringFromElementToXML(stream, StudyID, "id", (flags & XF_writeEmptyTags) > 0); + StudyDate.getISOFormattedDate(tmpString); + writeStringValueToXML(stream, tmpString, "date", (flags & XF_writeEmptyTags) > 0); + StudyTime.getISOFormattedTime(tmpString); + writeStringValueToXML(stream, tmpString, "time", (flags & XF_writeEmptyTags) > 0); + if ((flags & XF_writeEmptyTags) || !AccessionNumber.isEmpty()) + { + stream << "" << OFendl; + writeStringFromElementToXML(stream, AccessionNumber, "number", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + } + writeStringFromElementToXML(stream, StudyDescription, "description", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + + stream << "" << OFendl; + writeStringFromElementToXML(stream, SeriesNumber, "number", (flags & XF_writeEmptyTags) > 0); + SeriesDate.getISOFormattedDate(tmpString); + writeStringValueToXML(stream, tmpString, "date", (flags & XF_writeEmptyTags) > 0); + SeriesTime.getISOFormattedTime(tmpString); + writeStringValueToXML(stream, tmpString, "time", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, ProtocolName, "protocol", (flags & XF_writeEmptyTags) > 0); + writeStringFromElementToXML(stream, SeriesDescription, "description", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + + stream << "" << OFendl; + writeStringFromElementToXML(stream, InstanceNumber, "number", (flags & XF_writeEmptyTags) > 0); + if ((flags & XF_writeEmptyTags) || !InstanceCreatorUID.isEmpty() || + !InstanceCreationDate.isEmpty() || !InstanceCreationTime.isEmpty()) + { + stream << "" << OFendl; + InstanceCreationDate.getISOFormattedDate(tmpString); + writeStringValueToXML(stream, tmpString, "date", (flags & XF_writeEmptyTags) > 0); + InstanceCreationTime.getISOFormattedTime(tmpString); + writeStringValueToXML(stream, tmpString, "time", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + } + stream << "" << OFendl; + + if ((flags & XF_writeEmptyTags) || !CodingSchemeIdentification.isEmpty()) + { + stream << "" << OFendl; + CodingSchemeIdentification.writeXML(stream, flags); + stream << "" << OFendl; + } + if ((flags & XF_writeEmptyTags) || !CurrentRequestedProcedureEvidence.isEmpty()) + { + stream << "" << OFendl; + CurrentRequestedProcedureEvidence.writeXML(stream, flags); + stream << "" << OFendl; + } + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + if ((flags & XF_writeEmptyTags) || !PertinentOtherEvidence.isEmpty()) + { + stream << "" << OFendl; + PertinentOtherEvidence.writeXML(stream, flags); + stream << "" << OFendl; + } + if ((flags & XF_writeEmptyTags) || !ReferencedInstances.isEmpty()) + { + stream << "" << OFendl; + ReferencedInstances.writeXML(stream, flags); + stream << "" << OFendl; + } + } + + stream << "" << OFendl; + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + if (!PreliminaryFlag.isEmpty()) + stream << "" << OFendl; + stream << "" << OFendl; + writeStringFromElementToXML(stream, CompletionFlagDescription, "description", (flags & XF_writeEmptyTags) > 0); + stream << "" << OFendl; + + stream << "" << OFendl; + const size_t obsCount = getNumberOfVerifyingObservers(); + for (size_t i = 1; i <= obsCount; i++) + { + stream << "" << OFendl; + DSRCodedEntryValue obsCode; + OFString dateTime, obsName, organization; + if (getVerifyingObserver(i, dateTime, obsName, obsCode, organization).good()) + { + /* output time in ISO 8601 format */ + DcmDateTime::getISOFormattedDateTimeFromString(dateTime, tmpString, OFTrue /*seconds*/, OFFalse /*fraction*/, + OFTrue /*timeZone*/, OFFalse /*createMissingPart*/, "T" /*dateTimeSeparator*/, "" /*timeZoneSeparator*/); + writeStringValueToXML(stream, tmpString, "datetime", (flags & XF_writeEmptyTags) > 0); + if (!obsName.empty() || (flags & XF_writeEmptyTags)) + stream << "" << OFendl << dicomToXMLPersonName(obsName, tmpString) << OFendl << "" << OFendl; + if (obsCode.isValid()) + { + if (flags & DSRTypes::XF_codeComponentsAsAttribute) + stream << "" is closed in next writeXML() call + else + stream << "" << OFendl; + obsCode.writeXML(stream, flags); + stream << "" << OFendl; + } + writeStringValueToXML(stream, organization, "organization", (flags & XF_writeEmptyTags) > 0); + } + stream << "" << OFendl; + } + stream << "" << OFendl; + + if ((flags & XF_writeEmptyTags) || !PredecessorDocuments.isEmpty()) + { + stream << "" << OFendl; + PredecessorDocuments.writeXML(stream, flags); + stream << "" << OFendl; + } + } + if ((flags & XF_writeEmptyTags) || !IdenticalDocuments.isEmpty()) + { + stream << "" << OFendl; + IdenticalDocuments.writeXML(stream, flags); + stream << "" << OFendl; + } + + // --- write document content/tree to stream --- + + stream << "" << OFendl; + ContentDate.getISOFormattedDate(tmpString); + writeStringValueToXML(stream, tmpString, "date", (flags & XF_writeEmptyTags) > 0); + ContentTime.getISOFormattedTime(tmpString); + writeStringValueToXML(stream, tmpString, "time", (flags & XF_writeEmptyTags) > 0); + result = DocumentTree.writeXML(stream, flags); + stream << "" << OFendl; + stream << "" << OFendl; + + // --- XML document structure (end) --- + + stream << "" << OFendl; + } + return result; +} + + +void DSRDocument::renderHTMLPatientData(STD_NAMESPACE ostream &stream, + const size_t flags) +{ + OFString tmpString, string2; + OFString htmlString; + stream << convertToHTMLString(dicomToReadablePersonName(getStringValueFromElement(PatientName, tmpString), string2), htmlString, flags); + OFString patientStr; + if (!PatientSex.isEmpty()) + { + getPrintStringFromElement(PatientSex, tmpString); + if (tmpString == "M") + patientStr += "male"; + else if (tmpString == "F") + patientStr += "female"; + else if (tmpString == "O") + patientStr += "other"; + else + patientStr += convertToHTMLString(tmpString, htmlString, flags); + } + if (!PatientBirthDate.isEmpty()) + { + if (!patientStr.empty()) + patientStr += ", "; + patientStr += '*'; + patientStr += dicomToReadableDate(getStringValueFromElement(PatientBirthDate, tmpString), string2); + } + if (!PatientID.isEmpty()) + { + if (!patientStr.empty()) + patientStr += ", "; + patientStr += '#'; + patientStr += convertToHTMLString(getStringValueFromElement(PatientID, tmpString), htmlString, flags); + if (!IssuerOfPatientID.isEmpty()) + { + patientStr += ":"; + patientStr += convertToHTMLString(getStringValueFromElement(IssuerOfPatientID, tmpString), htmlString, flags); + } + } + if (!patientStr.empty()) + stream << " (" << patientStr << ")"; +} + + +void DSRDocument::renderHTMLReferenceList(STD_NAMESPACE ostream &stream, + DSRSOPInstanceReferenceList &refList, + const size_t flags) +{ + /* goto first list item (if not empty) */ + if (refList.gotoFirstItem().good()) + { + OFString tmpString; + DSRCodedEntryValue codeValue; + unsigned int i = 0; + /* iterate over all list items */ + do { + if (i > 0) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* hyperlink to composite object */ + OFString sopClass, sopInstance; + if (!refList.getSOPClassUID(sopClass).empty() && !refList.getSOPInstanceUID(sopInstance).empty()) + { + stream << ""; + /* check whether referenced object has a well-known SOP class */ + stream << dcmFindNameOfUID(sopClass.c_str(), "unknown composite object"); + stream << ""; + /* try to get the purpose of reference code, which is optional */ + if (refList.getPurposeOfReference(codeValue).good() && !codeValue.getCodeMeaning().empty()) + stream << " (" << DSRTypes::convertToHTMLString(codeValue.getCodeMeaning(), tmpString, flags) << ")"; + stream << "" << OFendl; + } else + stream << "invalid object reference" << OFendl; + i++; + } while (refList.gotoNextItem().good()); + } +} + + +void DSRDocument::renderHTMLReferenceList(STD_NAMESPACE ostream &stream, + DSRReferencedInstanceList &refList, + const size_t flags) +{ + /* goto first list item (if not empty) */ + if (refList.gotoFirstItem().good()) + { + OFString tmpString; + DSRCodedEntryValue codeValue; + unsigned int i = 0; + /* iterate over all list items */ + do { + if (i > 0) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* hyperlink to composite object */ + OFString sopClass, sopInstance; + if (!refList.getSOPClassUID(sopClass).empty() && !refList.getSOPInstanceUID(sopInstance).empty()) + { + stream << ""; + /* retrieve name of SOP class (if known) */ + stream << dcmFindNameOfUID(sopClass.c_str(), "unknown composite object"); + stream << ""; + /* try to get the purpose of reference code (at least the code meaning) */ + if (refList.getPurposeOfReference(codeValue).good() && !codeValue.getCodeMeaning().empty()) + stream << " (" << DSRTypes::convertToHTMLString(codeValue.getCodeMeaning(), tmpString, flags) << ")"; + stream << "" << OFendl; + } else + stream << "invalid reference" << OFendl; + i++; + } while (refList.gotoNextItem().good()); + } +} + + +OFCondition DSRDocument::renderHTML(STD_NAMESPACE ostream &stream, + const size_t flags, + const char *styleSheet) +{ + OFCondition result = SR_EC_InvalidDocument; + /* only render valid documents */ + if (isValid()) + { + size_t newFlags = flags; + if (flags & HF_XHTML11Compatibility) + newFlags = (flags & ~DSRTypes::HF_HTML32Compatibility); + else if (flags & HF_HTML32Compatibility) + { + /* fixes for HTML 3.2 */ + newFlags = (flags & ~HF_useCodeDetailsTooltip) | HF_convertNonASCIICharacters; + /* ignore CSS (if any) */ + styleSheet = NULL; + } + + /* used for multiple purposes */ + OFString tmpString, string2; + /* used for HTML tmpString conversion */ + OFString htmlString; + /* update only some DICOM attributes */ + updateAttributes(OFFalse /*updateAll*/); + + // --- HTML/XHTML document structure (start) --- + + if (newFlags & HF_XHTML11Compatibility) + { + stream << "" << OFendl; + } + + /* optional document type definition */ + if (newFlags & HF_addDocumentTypeReference) + { + if (newFlags & HF_XHTML11Compatibility) + stream << "" << OFendl; + else { + if (newFlags & HF_HTML32Compatibility) + stream << "" << OFendl; + else + stream << "" << OFendl; + } + } + stream << "" << OFendl; + stream << "" << OFendl; + /* document title */ + stream << ""; + if (newFlags & HF_renderPatientTitle) + renderHTMLPatientData(stream, newFlags); + else + stream << documentTypeToDocumentTitle(getDocumentType(), tmpString); + stream << "" << OFendl; + /* for HTML 4.01 and XHTML 1.1 only */ + if (!(newFlags & HF_HTML32Compatibility)) + { + /* optional cascading style sheet */ + if (styleSheet != NULL) + { + if (newFlags & HF_copyStyleSheetContent) + { + /* copy content from CSS file */ + STD_NAMESPACE ifstream cssFile(styleSheet, OFopenmode_in_nocreate); + if (cssFile) + { + char c; + stream << "" << OFendl; + } else + DCMSR_WARN("Could not open CSS file \"" << styleSheet << "\" ... ignoring"); + } else { + /* just add a reference to the CSS file (might be an URL) */ + stream << "" << OFendl; + } + } + /* optional character set */ + tmpString = characterSetToHTMLName(SpecificCharacterSetEnum); + if (!tmpString.empty()) + { + if (tmpString != "?") + { + stream << "" << OFendl; + } else + DCMSR_WARN("Cannot map Specific Character Set to equivalent HTML charset"); + } + } + /* generator meta element referring to the DCMTK */ + if (!(newFlags & HF_omitGeneratorMetaElement)) + { + stream << "" << OFendl; + } + stream << "" << OFendl; + stream << "" << OFendl; + + // --- render some general document information --- + + if (!(newFlags & HF_renderNoDocumentHeader)) + { + /* create a table for this purpose */ + stream << "" << OFendl; + /* patient related information */ + if (!PatientName.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* referring physician */ + if (!ReferringPhysicianName.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* study-related information */ + if (!StudyDescription.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* series-related information */ + if (!SeriesDescription.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* protocol name */ + if (!ProtocolName.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* manufacturer */ + if (!Manufacturer.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + /* preliminary flag */ + if (!PreliminaryFlag.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* completion flag */ + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + /* completion flag description */ + if (!CompletionFlagDescription.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* predecessor documents */ + if (!PredecessorDocuments.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + renderHTMLReferenceList(stream, PredecessorDocuments, flags); + stream << "" << OFendl; + } + } + /* identical documents */ + if (!IdenticalDocuments.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + renderHTMLReferenceList(stream, IdenticalDocuments, flags); + stream << "" << OFendl; + } + /* referenced instances */ + if (!ReferencedInstances.isEmpty()) + { + stream << "" << OFendl; + stream << "" << OFendl; + renderHTMLReferenceList(stream, ReferencedInstances, flags); + stream << "" << OFendl; + } + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + /* verification flag */ + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + /* verifying observer */ + const size_t obsCount = getNumberOfVerifyingObservers(); + for (size_t i = 1; i <= obsCount; i++) + { + OFString dateTime, obsName, organization; + DSRCodedEntryValue obsCode; + if (getVerifyingObserver(i, dateTime, obsName, obsCode, organization).good()) + { + stream << "" << OFendl; + if (i == 1) + stream << "" << OFendl; + else + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + } + } + if (!ContentDate.isEmpty() && !ContentTime.isEmpty()) + { + /* content date and time */ + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + stream << "" << OFendl; + } + /* end of table */ + stream << "
Patient:"; + renderHTMLPatientData(stream, newFlags); + stream << "
Referring Physician:" << convertToHTMLString(dicomToReadablePersonName(getStringValueFromElement(ReferringPhysicianName, tmpString), string2), htmlString, newFlags); + stream << "
Study:" << convertToHTMLString(getStringValueFromElement(StudyDescription, tmpString), htmlString, newFlags); + if (!StudyID.isEmpty()) + stream << " (#" << convertToHTMLString(getStringValueFromElement(StudyID, tmpString), htmlString, newFlags) << ")"; + stream << "
Series:" << convertToHTMLString(getStringValueFromElement(SeriesDescription, tmpString), htmlString, newFlags); + if (!SeriesNumber.isEmpty()) + stream << " (#" << convertToHTMLString(getStringValueFromElement(SeriesNumber, tmpString), htmlString, newFlags) << ")"; + stream << "
Protocol:" << convertToHTMLString(getStringValueFromElement(ProtocolName, tmpString), htmlString, newFlags) << "
Manufacturer:" << convertToHTMLString(getStringValueFromElement(Manufacturer, tmpString), htmlString, newFlags); + OFString deviceStr; + if (!ManufacturerModelName.isEmpty()) + deviceStr += convertToHTMLString(getStringValueFromElement(ManufacturerModelName, tmpString), htmlString, newFlags); + if (!DeviceSerialNumber.isEmpty()) + { + if (!deviceStr.empty()) + deviceStr += ", "; + deviceStr += '#'; + deviceStr += convertToHTMLString(getStringValueFromElement(DeviceSerialNumber, tmpString), htmlString, newFlags); + } + if (!deviceStr.empty()) + stream << " (" << deviceStr << ")"; + stream << "
Preliminary Flag:" << getStringValueFromElement(PreliminaryFlag, tmpString) << "
Completion Flag:" << getStringValueFromElement(CompletionFlag, tmpString) << "
" << convertToHTMLString(getStringValueFromElement(CompletionFlagDescription, tmpString), htmlString, newFlags); + stream << "
Predecessor Docs:
Identical Docs:
Referenced Objects:
Verification Flag:" << getStringValueFromElement(VerificationFlag, tmpString) << "
Verifying Observers:"; + stream << dicomToReadableDateTime(dateTime, string2) << " - "; + /* render code details as a tooltip (HTML 4.01 or above) */ + if (obsCode.isValid() && (newFlags & DSRTypes::HF_useCodeDetailsTooltip)) + { + if (newFlags & HF_XHTML11Compatibility) + stream << ""; + } + stream << convertToHTMLString(dicomToReadablePersonName(obsName, string2), htmlString, newFlags); + if (obsCode.isValid() && (newFlags & DSRTypes::HF_useCodeDetailsTooltip)) + stream << ""; + else { + /* render code in a conventional manner */ + if (obsCode.isValid() && ((newFlags & HF_renderAllCodes) == HF_renderAllCodes)) + { + stream << " (" << convertToHTMLString(obsCode.getCodeValue(), htmlString, newFlags); + stream << ", " << convertToHTMLString(obsCode.getCodingSchemeDesignator(), htmlString, newFlags); + if (!obsCode.getCodingSchemeVersion().empty()) + stream << " [" << convertToHTMLString(obsCode.getCodingSchemeVersion(), htmlString, newFlags) << "]"; + stream << ", "" << convertToHTMLString(obsCode.getCodeMeaning(), htmlString, newFlags) << "")"; + } + } + stream << ", " << convertToHTMLString(organization, htmlString, newFlags); + stream << "
Content Date/Time:" << dicomToReadableDate(getStringValueFromElement(ContentDate, tmpString), string2) << " "; + stream << dicomToReadableTime(getStringValueFromElement(ContentTime, tmpString), string2) << "
" << OFendl; + + if (newFlags & HF_XHTML11Compatibility) + stream << "
" << OFendl; + else + stream << "
" << OFendl; + } + + // --- render document tree to stream --- + + /* create memory output stream for the annex */ + OFOStringStream annexStream; + /* render document tree two the streams */ + result = DocumentTree.renderHTML(stream, annexStream, newFlags); + /* append annex (with heading) to main document */ + if (result.good()) + result = appendStream(stream, annexStream, "

Annex

"); + + // --- footnote --- + + if (newFlags & HF_renderDcmtkFootnote) + { + if (newFlags & HF_XHTML11Compatibility) + { + stream << "
" << OFendl; + stream << "
" << OFendl; + } else { + stream << "
" << OFendl; + if (newFlags & HF_HTML32Compatibility) + stream << "
" << OFendl; + else /* HTML 4.01 */ + stream << "
" << OFendl; + stream << "" << OFendl; + } + stream << "This page was generated from a DICOM Structured Reporting document by "; + stream << "OFFIS DCMTK " << OFFIS_DCMTK_VERSION << "." << OFendl; + if (!(newFlags & HF_XHTML11Compatibility)) + stream << "" << OFendl; + stream << "
" << OFendl; + } + + // --- HTML document structure (end) --- + + stream << "" << OFendl; + stream << "" << OFendl; + } + return result; +} + + +DSRTypes::E_DocumentType DSRDocument::getDocumentType() const +{ + return DocumentTree.getDocumentType(); +} + + +OFCondition DSRDocument::setTree(const DSRDocumentTree &tree) +{ + OFCondition result = SR_EC_InvalidDocumentTree; + /* make sure that the new tree is valid */ + if (tree.isValid()) + { + /* replace current tree with given one */ + DocumentTree = tree; + /* update IOD-specific DICOM attributes */ + updateAttributes(OFFalse /*updateAll*/); + result = EC_Normal; + } + return result; +} + + +OFCondition DSRDocument::setTreeFromRootTemplate(DSRRootTemplate &rootTemplate, + const OFBool expandTree) +{ + OFCondition result = EC_Normal; + /* check whether to expand the included templates (if any) */ + if (expandTree) + { + DSRDocumentSubTree *tree = NULL; + /* expand tree managed by the template and replace the currently stored tree */ + result = rootTemplate.getTree().createExpandedSubTree(tree); + if (result.good()) + result = DocumentTree.changeDocumentType(rootTemplate.getDocumentType(), OFTrue /*deleteTree*/); + if (result.good()) + result = DocumentTree.insertSubTree(tree, AM_belowCurrent, RT_unknown, OFFalse /*deleteIfFail*/); + /* update IOD-specific DICOM attributes */ + updateAttributes(OFFalse /*updateAll*/); + /* in case of error, free memory */ + if (result.bad()) + delete tree; + } else { + /* call the functions doing the real work */ + result = setTree(rootTemplate.getTree()); + } + return result; +} + + +const char *DSRDocument::getSpecificCharacterSet() const +{ + /* never return NULL */ + return OFSTRING_GUARD(getStringValueFromElement(SpecificCharacterSet)); +} + + +DSRTypes::E_CharacterSet DSRDocument::getSpecificCharacterSetType() const +{ + return SpecificCharacterSetEnum; +} + + +OFCondition DSRDocument::setSpecificCharacterSetType(const E_CharacterSet characterSet) +{ + SpecificCharacterSetEnum = characterSet; + return SpecificCharacterSet.putString(characterSetToDefinedTerm(SpecificCharacterSetEnum)); +} + + +DSRTypes::E_PreliminaryFlag DSRDocument::getPreliminaryFlag() const +{ + return PreliminaryFlagEnum; +} + + +OFCondition DSRDocument::setPreliminaryFlag(const E_PreliminaryFlag flag) +{ + OFCondition result = EC_IllegalCall; + /* not applicable to Key Object Selection Documents */ + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + PreliminaryFlagEnum = flag; + result = EC_Normal; + } + return result; +} + + +DSRTypes::E_CompletionFlag DSRDocument::getCompletionFlag() const +{ + return CompletionFlagEnum; +} + + +DSRTypes::E_VerificationFlag DSRDocument::getVerificationFlag() const +{ + return VerificationFlagEnum; +} + + +OFBool DSRDocument::hasVerifyingObservers() const +{ + return (VerifyingObserver.card() > 0); +} + + +size_t DSRDocument::getNumberOfVerifyingObservers() const +{ + return OFstatic_cast(size_t, VerifyingObserver.card()); +} + + +OFCondition DSRDocument::getVerifyingObserver(const size_t idx, + OFString &dateTime, + OFString &observerName, + OFString &organization) +{ + DSRCodedEntryValue dummyCode; + return getVerifyingObserver(idx, dateTime, observerName, dummyCode, organization); +} + + +OFCondition DSRDocument::getVerifyingObserver(const size_t idx, + OFString &dateTime, + OFString &observerName, + DSRCodedEntryValue &observerCode, + OFString &organization) +{ + OFCondition result = EC_IllegalParameter; + /* clear all reference variables */ + dateTime.clear(); + observerName.clear(); + observerCode.clear(); + organization.clear(); + /* get specified entry */ + if ((idx > 0) && (idx <= getNumberOfVerifyingObservers())) + { + /* access by index is currently not very efficient */ + DcmItem *ditem = VerifyingObserver.getItem(OFstatic_cast(unsigned long, idx - 1)); + if (ditem != NULL) + { + result = getStringValueFromDataset(*ditem, DCM_VerificationDateTime, dateTime); + if (result.good()) + result = getStringValueFromDataset(*ditem, DCM_VerifyingObserverName, observerName); + if (result.good()) + { + /* code is optional (type 2) */ + observerCode.readSequence(*ditem, DCM_VerifyingObserverIdentificationCodeSequence, "2" /*type*/); + result = getStringValueFromDataset(*ditem, DCM_VerifyingOrganization, organization); + } + if (result.good()) + { + if (dateTime.empty() || observerName.empty() || organization.empty()) + result = SR_EC_InvalidValue; + } + } + } + return result; +} + + +DSRSOPInstanceReferenceList &DSRDocument::getPredecessorDocuments() +{ + /* pass current value of specific character set */ + PredecessorDocuments.setSpecificCharacterSet(getSpecificCharacterSet()); + return PredecessorDocuments; +} + + +DSRSOPInstanceReferenceList &DSRDocument::getIdenticalDocuments() +{ + /* pass current value of specific character set */ + IdenticalDocuments.setSpecificCharacterSet(getSpecificCharacterSet()); + return IdenticalDocuments; +} + + +DSRSOPInstanceReferenceList &DSRDocument::getCurrentRequestedProcedureEvidence() +{ + /* pass current value of specific character set */ + CurrentRequestedProcedureEvidence.setSpecificCharacterSet(getSpecificCharacterSet()); + return CurrentRequestedProcedureEvidence; +} + + +DSRSOPInstanceReferenceList &DSRDocument::getPertinentOtherEvidence() +{ + /* pass current value of specific character set */ + PredecessorDocuments.setSpecificCharacterSet(getSpecificCharacterSet()); + return PertinentOtherEvidence; +} + + +DSRReferencedInstanceList &DSRDocument::getReferencedInstances() +{ + return ReferencedInstances; +} + + +DSRCodingSchemeIdentificationList &DSRDocument::getCodingSchemeIdentification() +{ + /* pass current value of specific character set */ + CodingSchemeIdentification.setSpecificCharacterSet(getSpecificCharacterSet()); + return CodingSchemeIdentification; +} + + +// --- get attributes (C++ string) --- + +OFCondition DSRDocument::getSpecificCharacterSet(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SpecificCharacterSet, value, pos); +} + + +OFCondition DSRDocument::getCompletionFlagDescription(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(CompletionFlagDescription, value, pos); +} + + +OFCondition DSRDocument::getModality(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(Modality, value, pos); +} + + +OFCondition DSRDocument::getSOPClassUID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SOPClassUID, value, pos); +} + + +OFCondition DSRDocument::getStudyInstanceUID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(StudyInstanceUID, value, pos); +} + + +OFCondition DSRDocument::getSeriesInstanceUID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SeriesInstanceUID, value, pos); +} + + +OFCondition DSRDocument::getSOPInstanceUID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SOPInstanceUID, value, pos); +} + + +OFCondition DSRDocument::getInstanceCreatorUID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(InstanceCreatorUID, value, pos); +} + + +OFCondition DSRDocument::getTimezoneOffsetFromUTC(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(TimezoneOffsetFromUTC, value, pos); +} + + +OFCondition DSRDocument::getPatientName(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(PatientName, value, pos); +} + + +OFCondition DSRDocument::getPatientBirthDate(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(PatientBirthDate, value, pos); +} + + +OFCondition DSRDocument::getPatientSex(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(PatientSex, value, pos); +} + + +OFCondition DSRDocument::getReferringPhysicianName(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(ReferringPhysicianName, value, pos); +} + + +OFCondition DSRDocument::getStudyDescription(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(StudyDescription, value, pos); +} + + +OFCondition DSRDocument::getSeriesDescription(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SeriesDescription, value, pos); +} + + +OFCondition DSRDocument::getProtocolName(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(ProtocolName, value, pos); +} + + +OFCondition DSRDocument::getManufacturer(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(Manufacturer, value, pos); +} + + +OFCondition DSRDocument::getManufacturerModelName(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(ManufacturerModelName, value, pos); +} + + +OFCondition DSRDocument::getDeviceSerialNumber(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(DeviceSerialNumber, value, pos); +} + + +OFCondition DSRDocument::getSoftwareVersions(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SoftwareVersions, value, pos); +} + + +OFCondition DSRDocument::getSynchronizationFrameOfReferenceUID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SynchronizationFrameOfReferenceUID, value, pos); +} + + +OFCondition DSRDocument::getSynchronizationTrigger(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SynchronizationTrigger, value, pos); +} + + +OFCondition DSRDocument::getAcquisitionTimeSynchronized(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(AcquisitionTimeSynchronized, value, pos); +} + + +OFCondition DSRDocument::getStudyDate(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(StudyDate, value, pos); +} + + +OFCondition DSRDocument::getStudyTime(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(StudyTime, value, pos); +} + + +OFCondition DSRDocument::getSeriesDate(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SeriesDate, value, pos); +} + + +OFCondition DSRDocument::getSeriesTime(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SeriesTime, value, pos); +} + + +OFCondition DSRDocument::getInstanceCreationDate(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationDate, value, pos); +} + + +OFCondition DSRDocument::getInstanceCreationTime(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(InstanceCreationTime, value, pos); +} + + +OFCondition DSRDocument::getContentDate(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(ContentDate, value, pos); +} + + +OFCondition DSRDocument::getContentTime(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(ContentTime, value, pos); +} + + +OFCondition DSRDocument::getStudyID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(StudyID, value, pos); +} + + +OFCondition DSRDocument::getPatientID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(PatientID, value, pos); +} + + +OFCondition DSRDocument::getIssuerOfPatientID(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(IssuerOfPatientID, value, pos); +} + + +OFCondition DSRDocument::getSeriesNumber(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(SeriesNumber, value, pos); +} + + +OFCondition DSRDocument::getInstanceNumber(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(InstanceNumber, value, pos); +} + + +OFCondition DSRDocument::getAccessionNumber(OFString &value, + const signed long pos) const +{ + return getStringValueFromElement(AccessionNumber, value, pos); +} + + +// --- set attributes --- + +OFCondition DSRDocument::setSpecificCharacterSet(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1-n") : EC_Normal; + if (result.good()) + { + /* try to map the given string to an enum value */ + SpecificCharacterSetEnum = definedTermToCharacterSet(value); + if (SpecificCharacterSetEnum == CS_unknown) + DCMSR_WARN("Setting unknown/unsupported value for Specific Character Set: " << value); + /* in any case, store the passed string value */ + result = SpecificCharacterSet.putOFStringArray(value); + } + return result; +} + + +OFCondition DSRDocument::setCompletionFlagDescription(const OFString &value, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* not applicable to Key Object Selection Documents */ + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + if (check) + result = DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()); + if (result.good()) + result = CompletionFlagDescription.putOFStringArray(value); + } + return result; +} + + +OFCondition DSRDocument::setTimezoneOffsetFromUTC(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = TimezoneOffsetFromUTC.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setPatientName(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = PatientName.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setPatientBirthDate(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientBirthDate.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setPatientSex(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = PatientSex.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setReferringPhysicianName(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmPersonName::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = ReferringPhysicianName.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setStudyDescription(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = StudyDescription.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setSeriesDescription(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = SeriesDescription.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setProtocolName(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = ProtocolName.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setManufacturer(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = Manufacturer.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setManufacturerModelName(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = ManufacturerModelName.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setDeviceSerialNumber(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = DeviceSerialNumber.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setSoftwareVersions(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1-n", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = SoftwareVersions.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setSynchronizationFrameOfReferenceUID(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmUniqueIdentifier::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SynchronizationFrameOfReferenceUID.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setSynchronizationTrigger(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SynchronizationTrigger.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setAcquisitionTimeSynchronized(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmCodeString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = AcquisitionTimeSynchronized.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setContentDate(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentDate.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setContentTime(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = ContentTime.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setStudyDate(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyDate.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setStudyTime(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = StudyTime.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setSeriesDate(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmDate::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesDate.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setSeriesTime(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmTime::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesTime.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setStudyID(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = StudyID.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setPatientID(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = PatientID.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setIssuerOfPatientID(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmLongString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = IssuerOfPatientID.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setSeriesNumber(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = SeriesNumber.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setInstanceNumber(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmIntegerString::checkStringValue(value, "1") : EC_Normal; + if (result.good()) + result = InstanceNumber.putOFStringArray(value); + return result; +} + + +OFCondition DSRDocument::setAccessionNumber(const OFString &value, + const OFBool check) +{ + OFCondition result = (check) ? DcmShortString::checkStringValue(value, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + result = AccessionNumber.putOFStringArray(value); + return result; +} + + +// --- document management functions + +void DSRDocument::createNewStudy() +{ + /* clear all study-related attributes */ + StudyInstanceUID.clear(); + StudyDate.clear(); + StudyTime.clear(); + ReferringPhysicianName.clear(); + StudyID.clear(); + AccessionNumber.clear(); + StudyDescription.clear(); + /* also creates new study (since UID is empty) and SOP instance */ + createNewSeries(); +} + + +void DSRDocument::createNewSeries() +{ + /* clear all series-related attributes */ + SeriesInstanceUID.clear(); + SeriesNumber.clear(); + SeriesDate.clear(); + SeriesTime.clear(); + SeriesDescription.clear(); + /* also creates new series (since UID is empty) */ + createNewSOPInstance(); +} + + +OFCondition DSRDocument::createNewSeriesInStudy(const OFString &studyUID, + const OFBool check) +{ + OFCondition result = EC_IllegalParameter; + if (!studyUID.empty()) + { + /* check parameter for conformance with VR and VM (if needed) */ + result = (check) ? DcmUniqueIdentifier::checkStringValue(studyUID, "1") : EC_Normal; + if (result.good()) + { + StudyInstanceUID.putOFStringArray(studyUID); + /* also creates new SOP instance */ + createNewSeries(); + } + } + return result; +} + + +void DSRDocument::createNewSOPInstance() +{ + SOPInstanceUID.clear(); + /* reset FinalizedFlag */ + FinalizedFlag = OFFalse; + /* update all DICOM attributes (incl. empty UIDs) */ + updateAttributes(); +} + + +OFCondition DSRDocument::createNewDocument() +{ + /* create new document with the same type as the current one */ + return createNewDocument(getDocumentType()); +} + + +OFCondition DSRDocument::createNewDocument(const E_DocumentType documentType) +{ + /* document type is stored only once (namely in the document tree) */ + OFCondition result = DocumentTree.changeDocumentType(documentType, OFTrue /*deleteTree*/); + if (result.good()) + { + /* clear object (all member variables) */ + clear(); + /* set initial values for a new SOP instance */ + createNewSOPInstance(); + } + return result; +} + + +OFCondition DSRDocument::changeDocumentType(const E_DocumentType documentType) +{ + /* document type is stored only once (namely in the document tree) */ + OFCondition result = DocumentTree.changeDocumentType(documentType, OFFalse /*deleteTree*/); + if (result.good()) + { + /* update IOD-specific DICOM attributes */ + updateAttributes(OFFalse /*updateAll*/); + } + return result; +} + + +OFCondition DSRDocument::createRevisedVersion(const OFBool clearList) +{ + OFCondition result = EC_IllegalCall; + /* not applicable to Key Object Selection Documents */ + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + /* check whether document is already completed */ + if (CompletionFlagEnum == CF_Complete) + { + if (clearList) + PredecessorDocuments.clear(); + /* add current document */ + OFString studyUID, seriesUID, classUID, instanceUID; + result = PredecessorDocuments.addItem(getStringValueFromElement(StudyInstanceUID, studyUID), + getStringValueFromElement(SeriesInstanceUID, seriesUID), + getStringValueFromElement(SOPClassUID, classUID), + getStringValueFromElement(SOPInstanceUID, instanceUID)); + if (result.good()) + { + IdenticalDocuments.clear(); + /* reset completion flag, delete description */ + CompletionFlagEnum = CF_invalid; + CompletionFlagDescription.clear(); + /* clear content date/time, will be set automatically in updateAttributes() */ + ContentDate.clear(); + ContentTime.clear(); + /* clear list of verifying observers and set flag to UNVERIFIED */ + removeVerification(); + /* remove digital signatures from document tree */ + DocumentTree.removeSignatures(); + /* create new instance UID, update creation date/time and reset finalized flag */ + createNewSOPInstance(); + } + } + } + return result; +} + + +OFCondition DSRDocument::completeDocument() +{ + /* complete document with empty/absent completion description */ + return completeDocument(""); +} + + +OFCondition DSRDocument::completeDocument(const OFString &description, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* not applicable to Key Object Selection Documents */ + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + /* if document is not already completed */ + if (CompletionFlagEnum != CF_Complete) + { + /* check parameter for conformance with VR and VM (if needed) */ + result = (check) ? DcmLongString::checkStringValue(description, "1", getSpecificCharacterSet()) : EC_Normal; + if (result.good()) + { + /* completed for now and ever */ + CompletionFlagEnum = CF_Complete; + /* completion flag description */ + setCompletionFlagDescription(description); + } + } + } + return result; +} + + +OFCondition DSRDocument::verifyDocument(const OFString &observerName, + const OFString &organization, + const OFString &dateTime, + const OFBool check) +{ + /* empty CodedEntryValue */ + return verifyDocument(observerName, DSRCodedEntryValue() /*dummy*/, organization, dateTime, check); +} + + +OFCondition DSRDocument::verifyDocument(const OFString &observerName, + const DSRCodedEntryValue &observerCode, + const OFString &organization, + const OFString &dateTime, + const OFBool check) +{ + OFCondition result = EC_IllegalCall; + /* not applicable to Key Object Selection Documents */ + if (getDocumentType() != DT_KeyObjectSelectionDocument) + { + /* verify completed documents only */ + if (CompletionFlagEnum == CF_Complete) + { + /* empty strings are not allowed (type 1 attributes) */ + if (!observerName.empty() && !organization.empty()) + { + /* check parameters for conformance with VR and VM (if needed) */ + if (check) + { + if (observerCode.isEmpty() || observerCode.isValid()) + result = EC_Normal; + if (result.good()) + result = DcmPersonName::checkStringValue(observerName, "1", getSpecificCharacterSet()); + if (result.good()) + result = DcmLongString::checkStringValue(organization, "1", getSpecificCharacterSet()); + if (result.good()) + result = DcmDateTime::checkStringValue(dateTime, "1"); + } else { + /* no checks, so everything is fine */ + result = EC_Normal; + } + if (result.good()) + { + DcmItem *ditem = new DcmItem(); + if (ditem != NULL) + { + /* write VerifyingObserverName */ + putStringValueToDataset(*ditem, DCM_VerifyingObserverName, observerName); + /* write VerifyingObserverIdentificationCodeSequence (might be empty, type 2) */ + observerCode.writeSequence(*ditem, DCM_VerifyingObserverIdentificationCodeSequence); + /* write VerifyingOrganization */ + putStringValueToDataset(*ditem, DCM_VerifyingOrganization, organization); + /* write VerificationDateTime */ + if (dateTime.empty()) + { + OFString tmpString; + currentDateTime(tmpString); + putStringValueToDataset(*ditem, DCM_VerificationDateTime, tmpString); + } else + putStringValueToDataset(*ditem, DCM_VerificationDateTime, dateTime); + /* insert items into sequence */ + VerifyingObserver.insert(ditem); + /* set VerificationFlag to VERIFIED */ + VerificationFlagEnum = VF_Verified; + /* reset FinalizedFlag */ + FinalizedFlag = OFFalse; + } else + result = EC_MemoryExhausted; + } + } else + result = EC_IllegalParameter; + } + } + return result; +} + + +void DSRDocument::removeVerification() +{ + /* clear list of verifying observers and set flag to UNVERIFIED */ + VerifyingObserver.clear(); + VerificationFlagEnum = VF_Unverified; + /* reset FinalizedFlag */ + FinalizedFlag = OFFalse; +} + + +OFCondition DSRDocument::finalizeDocument() +{ + OFCondition result = EC_IllegalCall; + /* document can only be finalized if it is already completed */ + if (CompletionFlagEnum == CF_Complete) + { + /* set FinalizedFlag */ + FinalizedFlag = OFTrue; + result = EC_Normal; + } + return result; +} + + +void DSRDocument::updateAttributes(const OFBool updateAll, + const OFBool verboseMode) +{ + if (verboseMode) + DCMSR_DEBUG("Updating " << (updateAll ? "all " : "") << "DICOM header attributes"); + const E_DocumentType documentType = getDocumentType(); + /* retrieve SOP class UID from internal document type */ + SOPClassUID.putString(documentTypeToSOPClassUID(documentType)); + /* put modality string depending on document type */ + Modality.putString(documentTypeToModality(documentType)); + if (updateAll) + { + OFString tmpString; + /* determine local timezone (if required) */ + if (requiresTimezoneModule(documentType) && TimezoneOffsetFromUTC.isEmpty()) + { + DCMSR_DEBUG(" Determining local timezone for Timezone Offset From UTC"); + TimezoneOffsetFromUTC.putOFStringArray(localTimezone(tmpString)); + } + + /* create new instance number if required (type 1) */ + if (InstanceNumber.isEmpty()) + InstanceNumber.putString("1"); + /* create new series number if required (type 1) */ + if (SeriesNumber.isEmpty()) + SeriesNumber.putString("1"); + + char uid[100]; + /* create new SOP instance UID if required */ + if (SOPInstanceUID.isEmpty()) + { + if (verboseMode) + DCMSR_DEBUG(" Generating new value for SOP Instance UID"); + SOPInstanceUID.putString(dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT)); + /* set instance creation date to current date (YYYYMMDD) */ + InstanceCreationDate.putOFStringArray(currentDate(tmpString)); + /* set instance creation time to current time (HHMMSS) */ + InstanceCreationTime.putOFStringArray(currentTime(tmpString)); + /* set instance creator UID to identify instances that have been created by this toolkit */ + InstanceCreatorUID.putString(OFFIS_INSTANCE_CREATOR_UID); + } + /* create new study instance UID if required */ + if (StudyInstanceUID.isEmpty()) + { + if (verboseMode) + DCMSR_DEBUG(" Generating new value for Study Instance UID"); + StudyInstanceUID.putString(dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT)); + } + /* create new series instance UID if required */ + if (SeriesInstanceUID.isEmpty()) + { + if (verboseMode) + DCMSR_DEBUG(" Generating new value for Series Instance UID"); + SeriesInstanceUID.putString(dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT)); + } + + /* check and set content date if required */ + if (ContentDate.isEmpty()) + ContentDate.putString(getStringValueFromElement(InstanceCreationDate)); + /* check and set content time if required */ + if (ContentTime.isEmpty()) + ContentTime.putString(getStringValueFromElement(InstanceCreationTime)); + } + if (documentType == DT_KeyObjectSelectionDocument) + { + /* these flags are not used for Key Object Selection Documents */ + PreliminaryFlagEnum = PF_invalid; + CompletionFlagEnum = CF_invalid; + VerificationFlagEnum = VF_invalid; + PreliminaryFlag.clear(); + CompletionFlag.clear(); + CompletionFlagDescription.clear(); + VerificationFlag.clear(); + VerifyingObserver.clear(); + } else { + /* set preliminary flag */ + PreliminaryFlag.putString(preliminaryFlagToEnumeratedValue(PreliminaryFlagEnum)); + /* check and adjust completion flag if required */ + if (CompletionFlagEnum == CF_invalid) + CompletionFlagEnum = CF_Partial; + CompletionFlag.putString(completionFlagToEnumeratedValue(CompletionFlagEnum)); + /* check and adjust verification flag if required */ + if (VerificationFlagEnum == VF_invalid) + VerificationFlagEnum = VF_Unverified; + VerificationFlag.putString(verificationFlagToEnumeratedValue(VerificationFlagEnum)); + } +} diff --git a/dcmsr/libsrc/dsrdocst.cc b/dcmsr/libsrc/dsrdocst.cc new file mode 100644 index 00000000..3a848129 --- /dev/null +++ b/dcmsr/libsrc/dsrdocst.cc @@ -0,0 +1,1309 @@ +/* + * + * Copyright (C) 2000-2018, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentSubTree + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdocst.h" +#include "dcmtk/dcmsr/dsrcontn.h" +#include "dcmtk/dcmsr/dsrreftn.h" +#include "dcmtk/dcmsr/dsrtpltn.h" +#include "dcmtk/dcmsr/dsrstpl.h" +#include "dcmtk/dcmsr/dsriodcc.h" + +#include "dcmtk/dcmdata/dcvrdt.h" + + +DSRDocumentSubTree::DSRDocumentSubTree() + : DSRTree(), + ConstraintChecker(NULL), + CurrentContentItem() +{ + /* by default, there is no IOD constraint checker */ +} + + +DSRDocumentSubTree::DSRDocumentSubTree(const DSRDocumentSubTree &tree) + : DSRTree(tree), + ConstraintChecker(NULL), + CurrentContentItem() +{ + /* the real work is done in the base class DSRTree, + * so just update the by-reference relationships (if any) */ + checkByReferenceRelationships(CM_updateNodeID); +} + + +DSRDocumentSubTree::DSRDocumentSubTree(DSRDocumentTreeNode *rootNode) + : DSRTree(rootNode), + ConstraintChecker(NULL), + CurrentContentItem() +{ + /* the real work is done in the base class DSRTree */ +} + + +DSRDocumentSubTree::DSRDocumentSubTree(const DSRDocumentTreeNodeCursor &startCursor, + size_t stopAfterNodeID) + : DSRTree(startCursor, stopAfterNodeID), + ConstraintChecker(NULL), + CurrentContentItem() +{ + /* the real work is done in the base class DSRTree */ +} + + +DSRDocumentSubTree::~DSRDocumentSubTree() +{ + delete ConstraintChecker; +} + + +DSRDocumentSubTree &DSRDocumentSubTree::operator=(DSRDocumentSubTree tree) +{ + /* by-value parameter serves as a temporary */ + swap(tree); + return *this; +} + + +DSRDocumentSubTree *DSRDocumentSubTree::clone() const +{ + return new DSRDocumentSubTree(*this); +} + + +void DSRDocumentSubTree::clear() +{ + DSRTree::clear(); +} + + +OFBool DSRDocumentSubTree::isValid() const +{ + /* an empty subtree is not valid */ + return !DSRTree::isEmpty(); +} + + +OFBool DSRDocumentSubTree::isCursorValid() const +{ + /* check whether cursor points to an existing node */ + return DSRTreeNodeCursor::isValid(); +} + + +OFBool DSRDocumentSubTree::isValidDocumentTree(const E_RelationshipType defaultRelType) const +{ + OFBool result = OFFalse; + /* check root node */ + const DSRDocumentTreeNode *node = getRoot(); + if (node != NULL) + { + E_RelationshipType relationshipType; + /* use default relationship type if "unknown" */ + relationshipType = node->getRelationshipType(); + if (relationshipType == RT_unknown) + relationshipType = defaultRelType; + /* make sure that there is a single root node only, with type "CONTAINER" */ + if ((relationshipType == RT_isRoot) && (node->getValueType() == VT_Container)) + result = !node->hasSiblingNodes(); + } + return result; +} + + +OFBool DSRDocumentSubTree::isExpandedDocumentTree() const +{ + OFBool result = OFTrue; + DSRDocumentTreeNodeCursor cursor(getRoot()); + if (cursor.isValid()) + { + /* search for a single INCLUDE template node */ + do { + result = (cursor.getNode()->getValueType() != VT_includedTemplate); + } while (result && cursor.iterate()); + } + return result; +} + + +OFBool DSRDocumentSubTree::hasTemplateIdentification() const +{ + OFBool result = OFFalse; + /* check whether template identification is possible */ + if (canUseTemplateIdentification()) + { + /* check whether template identification is set */ + result = getRoot()->hasTemplateIdentification(); + } + return result; +} + + +OFBool DSRDocumentSubTree::canUseTemplateIdentification() const +{ + OFBool result = OFFalse; + /* check root node */ + const DSRDocumentTreeNode *node = getRoot(); + if (node != NULL) + { + /* make sure that there is a single root node only, with type "CONTAINER" */ + result = (node->getValueType() == VT_Container) && !node->hasSiblingNodes(); + } + return result; +} + + +OFCondition DSRDocumentSubTree::print(STD_NAMESPACE ostream &stream, + const size_t flags, + const DSRPositionCounter *posCounter) +{ + OFCondition result = EC_Normal; + /* initialize cursor with root node (and optional position counter) */ + DSRIncludedTemplateNodeCursor cursor(getRoot(), posCounter); + if (cursor.isValid()) + { + /* check and update by-reference relationships */ + checkByReferenceRelationships(CM_updatePositionString, flags & CB_maskPrintFlags); + /* update the document tree for output (if needed) */ + updateTreeForOutput(); + OFString tmpString; + DSRDocumentTreeNode *node; + /* iterate over all nodes */ + do { + node = cursor.getNode(); + /* check whether to print node ID, position, indentation at all */ + if ((node->getValueType() != VT_includedTemplate) || !(flags & PF_hideIncludedTemplateNodes)) + { + /* print node ID (might be useful for debugging purposes) */ + if (flags & PF_printNodeID) + stream << "id:" << node->getNodeID() << " "; + /* print node position */ + if (flags & PF_printItemPosition) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_ITEM_POSITION) + stream << cursor.getPosition(tmpString) << " "; + } else { + /* use line indentation */ + const size_t level = cursor.getPositionCounter().getLevel(); + if (level > 0) // valid ? + stream << OFString((level - 1) * 2, ' '); + } + } + /* special handling for included templates */ + if (node->getValueType() == VT_includedTemplate) + { + /* print separate line for internal template node (if requested) */ + if (!(flags & PF_hideIncludedTemplateNodes)) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + /* print content of template node */ + node->print(stream, flags); + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_RESET) + stream << OFendl; + } + else if ((flags & PF_dontCountIncludedTemplateNodes) && !(cursor.getPositionCounter().getFlags() & PF_dontCountIncludedTemplateNodes)) + { + /* do not count internal "included template" nodes */ + --cursor.getPositionCounter(); + } + } else { + /* print node content */ + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << "<"; + result = node->print(stream, flags); + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << ">"; + /* print extended information on the node */ + if (result.good()) + result = node->printExtended(stream, flags); + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_RESET) + stream << OFendl; + } + } while (result.good() && cursor.iterate()); + } + return result; +} + + +OFCondition DSRDocumentSubTree::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocumentTree; + /* check whether document tree is valid */ + if (isValid()) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + /* start writing from root node */ + if (cursor.isValid()) + { + /* check by-reference relationships (if applicable) */ + checkByReferenceRelationships(CM_resetReferenceTargetFlag); + /* update the document tree for output (if needed) */ + updateTreeForOutput(); + /* write current node (and its siblings) */ + do { + result = cursor.getNode()->writeXML(stream, flags); + } while (result.good() && cursor.gotoNext()); + } + } + return result; +} + + +DSRContentItem &DSRDocumentSubTree::getCurrentContentItem() +{ + CurrentContentItem.setTreeNode(getNode()); + return CurrentContentItem; +} + + +const DSRDocumentTreeNode *DSRDocumentSubTree::getCurrentNode() const +{ + return getNode(); +} + + +OFBool DSRDocumentSubTree::getCursorToRootNode(DSRDocumentTreeNodeCursor &cursor) const +{ + cursor = DSRDocumentTreeNodeCursor(getRoot()); + return cursor.isValid(); +} + + +OFBool DSRDocumentSubTree::getCursorToRootNode(DSRIncludedTemplateNodeCursor &cursor) const +{ + cursor = DSRIncludedTemplateNodeCursor(getRoot()); + return cursor.isValid(); +} + + +OFBool DSRDocumentSubTree::getCursorToCurrentNode(DSRDocumentTreeNodeCursor &cursor) const +{ + cursor = DSRDocumentTreeNodeCursor(getNode()); + return cursor.isValid(); +} + + +OFBool DSRDocumentSubTree::getCursorToSubTree(DSRDocumentTreeNodeCursor &cursor) const +{ + cursor = DSRDocumentTreeNodeCursor(getChild()); + return cursor.isValid(); +} + + +size_t DSRDocumentSubTree::countNodes(const OFBool searchIntoSubTemplates, + const OFBool countIncludedTemplateNodes) const +{ + size_t count = 0; + /* check whether special handling of included templates is needed */ + if (searchIntoSubTemplates || !countIncludedTemplateNodes) + { + DSRDocumentTreeNodeCursor cursor(getRoot()); + if (cursor.isValid()) + { + /* iterate over all nodes */ + do { + if (cursor.getNode()->getValueType() == VT_includedTemplate) + { + /* special handling: count nodes of included subtree */ + if (searchIntoSubTemplates) + { + const DSRSubTemplate *subTempl = OFstatic_cast(const DSRIncludedTemplateTreeNode *, cursor.getNode())->getValue().get(); + if (subTempl != NULL) + count += subTempl->countNodes(searchIntoSubTemplates, countIncludedTemplateNodes); + } + /* also need to count "included template" node */ + if (countIncludedTemplateNodes) + ++count; + } else { + /* standard case */ + ++count; + } + } while (cursor.iterate()); + } + } else { + /* call the inherited function */ + count = DSRTree::countNodes(); + } + return count; +} + + +size_t DSRDocumentSubTree::gotoMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool startFromRoot, + const OFBool searchIntoSub) +{ + size_t nodeID = 0; + if (startFromRoot) + gotoRoot(); + const DSRDocumentTreeNode *node; + /* iterate over all nodes */ + do { + node = getNode(); + /* and check whether it matches */ + if (filter.matches(node)) + nodeID = node->getNodeID(); + } while ((nodeID == 0) && iterate(searchIntoSub)); + return nodeID; +} + + +size_t DSRDocumentSubTree::gotoNextMatchingNode(const DSRDocumentTreeNodeFilter &filter, + const OFBool searchIntoSub) +{ + /* first, goto "next" node */ + size_t nodeID = iterate(searchIntoSub); + if (nodeID > 0) + nodeID = gotoMatchingNode(filter, OFFalse /*startFromRoot*/, searchIntoSub); + return nodeID; +} + + +size_t DSRDocumentSubTree::gotoNamedNode(const DSRCodedEntryValue &conceptName, + const OFBool startFromRoot, + const OFBool searchIntoSub) +{ + size_t nodeID = 0; + if (conceptName.isValid()) + { + if (startFromRoot) + gotoRoot(); + const DSRDocumentTreeNode *node; + /* iterate over all nodes */ + do { + node = getNode(); + /* and check for the desired concept name */ + if ((node != NULL) && (node->getConceptName() == conceptName)) + nodeID = node->getNodeID(); + } while ((nodeID == 0) && iterate(searchIntoSub)); + } + return nodeID; +} + + +size_t DSRDocumentSubTree::gotoNamedChildNode(const DSRCodedEntryValue &conceptName) +{ + /* first, goto child node */ + size_t nodeID = gotoChild(); + if (nodeID > 0) + nodeID = gotoNamedNode(conceptName, OFFalse /*startFromRoot*/, OFFalse /*searchIntoSub*/); + return nodeID; +} + + +size_t DSRDocumentSubTree::gotoNamedNodeInSubTree(const DSRCodedEntryValue &conceptName, + const OFBool searchIntoSub) +{ + size_t nodeID = 0; + if (hasChildNodes()) + { + /* start from first child node */ + DSRDocumentTreeNodeCursor cursor(getChild()); + if (cursor.isValid()) + { + const DSRDocumentTreeNode *node; + /* iterate over all nodes in the subtree */ + do { + node = cursor.getNode(); + /* and check for the desired concept name */ + if ((node != NULL) && (node->getConceptName() == conceptName)) + nodeID = node->getNodeID(); + } while ((nodeID == 0) && cursor.iterate(searchIntoSub)); + /* if found, set internal cursor to this node */ + if (nodeID > 0) + nodeID = gotoNode(nodeID, OFFalse /*startFromRoot*/); + } + } + return nodeID; +} + + +size_t DSRDocumentSubTree::gotoNextNamedNode(const DSRCodedEntryValue &conceptName, + const OFBool searchIntoSub) +{ + /* first, goto "next" node */ + size_t nodeID = iterate(searchIntoSub); + if (nodeID > 0) + nodeID = gotoNamedNode(conceptName, OFFalse /*startFromRoot*/, searchIntoSub); + return nodeID; +} + + +size_t DSRDocumentSubTree::gotoAnnotatedNode(const OFString &annotationText, + const OFBool startFromRoot) +{ + /* call the inherited function */ + return gotoNode(DSRTreeNodeAnnotation(annotationText), startFromRoot); +} + + +size_t DSRDocumentSubTree::gotoNextAnnotatedNode(const OFString &annotationText) +{ + /* first, goto "next" node */ + size_t nodeID = iterate(); + if (nodeID > 0) + nodeID = gotoAnnotatedNode(annotationText, OFFalse /*startFromRoot*/); + return nodeID; +} + + +OFBool DSRDocumentSubTree::canAddContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const E_AddMode addMode) const +{ + OFBool result = OFFalse; + /* never accept invalid types */ + if ((relationshipType != RT_invalid) && (valueType != VT_invalid)) + { + /* also do not accept internal types */ + if ((valueType != VT_byReference) && (valueType != VT_includedTemplate)) + { + const DSRDocumentTreeNode *node = getNode(); + if (node != NULL) + { + /* do we have an IOD constraint checker? */ + if (ConstraintChecker != NULL) + { + if ((addMode == AM_beforeCurrent) || (addMode == AM_afterCurrent)) + { + /* check parent node */ + node = getParentNode(); + if (node != NULL) + result = ConstraintChecker->checkContentRelationship(node->getValueType(), relationshipType, valueType); + } else + result = ConstraintChecker->checkContentRelationship(node->getValueType(), relationshipType, valueType); + } + /* a root node can only be added to an empty tree */ + else if (relationshipType != RT_isRoot) + { + /* "unknown" relationships are only allowed on top-level */ + result = (!hasParentNode() && (addMode != AM_belowCurrent)) || (relationshipType != RT_unknown); + } + } else { + /* no special rules for root node (at least in a subtree) */ + result = OFTrue; + } + } + } + return result; +} + + +OFBool DSRDocumentSubTree::canAddByReferenceRelationship(const E_RelationshipType relationshipType, + const E_ValueType targetValueType) const +{ + OFBool result = OFFalse; + /* never accept invalid types */ + if ((relationshipType != RT_invalid) && (targetValueType != VT_invalid)) + { + /* do we have an IOD constraint checker? */ + if (ConstraintChecker != NULL) + { + const DSRDocumentTreeNode *node = getNode(); + if (node != NULL) + result = ConstraintChecker->checkContentRelationship(node->getValueType(), relationshipType, targetValueType, OFTrue /*byReference*/); + } else { + /* certain relationships are never allowed */ + result = (relationshipType != RT_isRoot) && (relationshipType != RT_unknown) && (targetValueType != VT_includedTemplate); + } + } + return result; +} + + +size_t DSRDocumentSubTree::addContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const E_AddMode addMode) +{ + size_t nodeID = 0; + if (canAddContentItem(relationshipType, valueType, addMode)) + { + /* create a new node ... */ + DSRDocumentTreeNode *node = createDocumentTreeNode(relationshipType, valueType); + if (node != NULL) + { + /* ... and add it to the current node */ + nodeID = addNode(node, addMode); + /* in case of error, free allocated memory */ + if (nodeID == 0) + { + delete node; + node = NULL; + } + } + } + return nodeID; +} + + +OFCondition DSRDocumentSubTree::addContentItem(DSRDocumentTreeNode *node, + const E_AddMode addMode, + const OFBool deleteIfFail) +{ + OFCondition result = EC_Normal; + if (node != NULL) + { + /* check whether new node can be added */ + if (canAddContentItem(node->getRelationshipType(), node->getValueType(), addMode)) + { + /* check whether adding the node actually works */ + if (addNode(node, addMode) == 0) + result = SR_EC_CannotAddContentItem; + } else + result = SR_EC_CannotAddContentItem; + /* if not, delete node (if needed) */ + if (deleteIfFail && result.bad()) + { + delete node; + node = NULL; + } + } else + result = EC_IllegalParameter; + return result; +} + + +OFCondition DSRDocumentSubTree::addContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* call the functions doing the real work */ + if (addContentItem(relationshipType, valueType, AM_afterCurrent) > 0) + { + if (!conceptName.isEmpty()) + { + /* use a more appropriate error code than the one returned */ + if (getCurrentContentItem().setConceptName(conceptName, check).bad()) + result = SR_EC_InvalidConceptName; + } + } else + result = SR_EC_CannotAddContentItem; + return result; +} + + +OFCondition DSRDocumentSubTree::addChildContentItem(const E_RelationshipType relationshipType, + const E_ValueType valueType, + const DSRCodedEntryValue &conceptName, + const OFBool check) +{ + OFCondition result = EC_Normal; + /* call the functions doing the real work */ + if (addContentItem(relationshipType, valueType, AM_belowCurrent) > 0) + { + if (!conceptName.isEmpty()) + { + /* use a more appropriate error code than the one returned */ + if (getCurrentContentItem().setConceptName(conceptName, check).bad()) + result = SR_EC_InvalidConceptName; + } + } else + result = SR_EC_CannotAddContentItem; + return result; +} + + +size_t DSRDocumentSubTree::addByReferenceRelationship(const E_RelationshipType relationshipType, + const size_t referencedNodeID) +{ + size_t nodeID = 0; + if (referencedNodeID > 0) + { + /* always start from root node */ + DSRDocumentTreeNodeCursor cursor(getRoot()); + if (cursor.isValid()) + { + /* goto specified target node (might be improved later on) */ + if (cursor.gotoNode(referencedNodeID) > 0) + { + OFString sourceString; + OFString targetString; + getPosition(sourceString); + cursor.getPosition(targetString); + /* check whether target node is an ancestor of source node (prevent loops) */ + if (validByReferenceRelationship(sourceString, targetString)) + { + const DSRDocumentTreeNode *targetNode = cursor.getNode(); + const E_ValueType targetValueType = targetNode->getValueType(); + /* check whether relationship is valid/allowed */ + if (canAddByReferenceRelationship(relationshipType, targetValueType)) + { + DSRDocumentTreeNode *node = new DSRByReferenceTreeNode(relationshipType, referencedNodeID, targetValueType); + if (node != NULL) + { + nodeID = addNode(node, AM_belowCurrent); + /* in case of error, free allocated memory */ + if (nodeID == 0) + { + delete node; + node = NULL; + } else { + /* otherwise, go back to current node */ + goUp(); + } + } + } + } else { + /* report a warning with some details to the debug logger */ + DCMSR_DEBUG("Invalid by-reference relationship from content item \"" + << sourceString << "\" to \"" << targetString << "\" (loop check)"); + } + } else { + /* report a warning with some details to the debug logger */ + DCMSR_DEBUG("Target content item of by-reference relationship does not exist"); + } + } + } + return nodeID; +} + + +OFCondition DSRDocumentSubTree::updateByReferenceRelationships(const OFBool updateIncludedTemplates) +{ + OFCondition result = EC_Normal; + /* update the position strings of by-reference relationships */ + if (updateIncludedTemplates) + result = checkByReferenceRelationships(CM_updatePositionString); + else + result = checkByReferenceRelationships(CM_updatePositionString); + return result; +} + + +OFBool DSRDocumentSubTree::canInsertSubTree(const DSRDocumentSubTree *tree, + const E_AddMode addMode, + const E_RelationshipType defaultRelType) const +{ + OFBool result = OFFalse; + if (tree != NULL) + { + if (getNode() != NULL) + { + /* check whether the top-level nodes of the subtree can be added */ + DSRDocumentTreeNodeCursor cursor(tree->getRoot()); + if (cursor.isValid()) + { + DSRDocumentTreeNode *node; + E_RelationshipType relationshipType; + do { + node = cursor.getNode(); + /* use default relationship type if "unknown" */ + relationshipType = node->getRelationshipType(); + if (relationshipType == RT_unknown) + relationshipType = defaultRelType; + result = canAddContentItem(relationshipType, node->getValueType(), addMode); + /* exit loop on first node that cannot be added */ + } while (cursor.gotoNext() && result); + } + } else { + /* no special rules for root node (at least in a subtree) */ + result = OFTrue; + } + /* we also need to check all other nodes in the subtree */ + if (result && checkSubTreeConstraints(tree, ConstraintChecker).bad()) + result = OFFalse; + } + return result; +} + + +OFCondition DSRDocumentSubTree::insertSubTree(DSRDocumentSubTree *tree, + const E_AddMode addMode, + const E_RelationshipType defaultRelType, + const OFBool deleteIfFail) +{ + OFCondition result = EC_Normal; + if (tree != NULL) + { + /* check whether subtree can be inserted */ + if (canInsertSubTree(tree, addMode, defaultRelType)) + { + /* replace "unknown" relationship type on top-level */ + if (defaultRelType != RT_unknown) + { + DSRDocumentTreeNodeCursor cursor(tree->getRoot()); + if (cursor.isValid()) + { + DSRDocumentTreeNode *node; + do { + node = cursor.getNode(); + /* use default relationship type if "unknown" */ + if (node->getRelationshipType() == RT_unknown) + result = node->setRelationshipType(defaultRelType); + } while (cursor.gotoNext() && result.good()); + /* use a more appropriate error code than the one returned */ + if (result == EC_IllegalParameter) + result = SR_EC_CannotChangeRelationshipType; + } + } + /* finally, if everything worked as expected... */ + if (result.good()) + { + /* try to add the root node of the given subtree */ + if (addNode(tree->getRoot(), addMode) > 0) + { + /* "forget" reference to root node */ + tree->getAndRemoveRootNode(); + } else + result = SR_EC_CannotInsertSubTree; + } + } else + result = SR_EC_CannotInsertSubTree; + /* delete given subtree (if needed) */ + if (result.good() || (deleteIfFail && result.bad())) + { + delete tree; + tree = NULL; + } + } else + result = EC_IllegalParameter; + return result; +} + + +DSRDocumentSubTree *DSRDocumentSubTree::extractSubTree() +{ + DSRDocumentSubTree *tree = NULL; + /* extract current node from tree and create a new subtree object (with this root) */ + DSRDocumentTreeNode *node = extractNode(); + if (node != NULL) + tree = new DSRDocumentSubTree(node); + return tree; +} + + +size_t DSRDocumentSubTree::removeCurrentContentItem() +{ + /* remove the current node from the tree (including all child nodes) */ + return removeNode(); +} + + +OFCondition DSRDocumentSubTree::removeSubTree(const size_t searchID) +{ + OFCondition result = EC_Normal; + /* we cannot remove anything from an empty tree */ + if (!isEmpty()) + { + /* goto the given content item (if specified) */ + if (searchID > 0) + { + if (gotoNode(searchID, OFTrue /*startFromRoot*/) == 0) + result = SR_EC_ContentItemNotFound; + } + /* and, remove it, i.e. the current node, from the tree */ + if (result.good()) + { + /* removing the root node deletes the complete subtree */ + if ((removeNode() == 0) && !isEmpty()) + result = SR_EC_CannotRemoveSubTree; + } + } else + result = SR_EC_EmptyDocumentTree; + return result; +} + + +DSRDocumentTreeNode *DSRDocumentSubTree::cloneCurrentTreeNode() const +{ + const DSRDocumentTreeNode *node = getNode(); + /* create a copy if the current node is valid */ + return (node != NULL) ? node->clone() : NULL; +} + + +DSRDocumentSubTree *DSRDocumentSubTree::cloneSubTree(const size_t stopAfterNodeID) const +{ + /* create a copy of the specified subtree */ + return new DSRDocumentSubTree(NodeCursor, stopAfterNodeID); +} + + +OFCondition DSRDocumentSubTree::createExpandedSubTree(DSRDocumentSubTree *&tree) const +{ + OFCondition result = EC_Normal; + if (!isEmpty()) + { + /* first, create a clone of this tree */ + tree = clone(); + if (tree != NULL) + { + /* expand all "included template" nodes in the new tree */ + result = expandIncludedTemplates(tree); + /* in case of error, free memory */ + if (result.bad()) + { + delete tree; + tree = NULL; + } + } else + result = EC_MemoryExhausted; + } else { + tree = NULL; + result = SR_EC_EmptyDocumentTree; + } + return result; +} + + +OFCondition DSRDocumentSubTree::setObservationDateTime(const OFString &observationDateTime, + const OFBool check) +{ + /* check parameter only once */ + OFCondition result = (check) ? DcmDateTime::checkStringValue(observationDateTime, "1") : EC_Normal; + if (result.good()) + { + DSRIncludedTemplateNodeCursor cursor(getRoot()); + if (cursor.isValid()) + { + /* iterate over all nodes */ + do { + /* and set the observation data/time */ + cursor.getNode()->setObservationDateTime(observationDateTime, OFFalse /*check*/); + } while (cursor.iterate()); + } + } + return result; +} + + +OFBool DSRDocumentSubTree::compareTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID) const +{ + OFBool result = OFFalse; + /* check whether template identification is possible */ + if (canUseTemplateIdentification()) + { + /* compare with template identification of root CONTAINER */ + result = getRoot()->compareTemplateIdentification(templateIdentifier, mappingResource, mappingResourceUID); + } + return result; +} + + +OFCondition DSRDocumentSubTree::getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource) const +{ + OFCondition result = SR_EC_CannotUseTemplateIdentification; + /* check whether template identification is possible */ + if (canUseTemplateIdentification()) + { + /* get template identification from root CONTAINER */ + result = getRoot()->getTemplateIdentification(templateIdentifier, mappingResource); + } + return result; +} + + +OFCondition DSRDocumentSubTree::getTemplateIdentification(OFString &templateIdentifier, + OFString &mappingResource, + OFString &mappingResourceUID) const +{ + OFCondition result = SR_EC_CannotUseTemplateIdentification; + /* check whether template identification is possible */ + if (canUseTemplateIdentification()) + { + /* get template identification from root CONTAINER */ + result = getRoot()->getTemplateIdentification(templateIdentifier, mappingResource, mappingResourceUID); + } + return result; +} + + +OFCondition DSRDocumentSubTree::setTemplateIdentification(const OFString &templateIdentifier, + const OFString &mappingResource, + const OFString &mappingResourceUID, + const OFBool check) +{ + OFCondition result = SR_EC_CannotUseTemplateIdentification; + /* check whether template identification is possible */ + if (canUseTemplateIdentification()) + { + /* mark root CONTAINER with given template identification */ + result = getRoot()->setTemplateIdentification(templateIdentifier, mappingResource, mappingResourceUID, check); + } + return result; +} + + +// protected methods + +void DSRDocumentSubTree::swap(DSRDocumentSubTree &tree) +{ + /* call inherited method */ + DSRTree::swap(tree); + /* swap other members */ + CurrentContentItem.swap(tree.CurrentContentItem); + OFswap(ConstraintChecker, tree.ConstraintChecker); +} + + +DSRDocumentTreeNode *DSRDocumentSubTree::getNode() const +{ + /* just call the inherited method */ + return DSRTree::getNode(); +} + + +size_t DSRDocumentSubTree::addNode(DSRDocumentTreeNode *node, + const E_AddMode addMode) +{ + /* might add further checks later on */ + return DSRTree::addNode(node, addMode); +} + + +size_t DSRDocumentSubTree::replaceNode(DSRDocumentTreeNode *node) +{ + /* might add further checks later on */ + return DSRTree::replaceNode(node); +} + + +DSRDocumentTreeNode *DSRDocumentSubTree::extractNode() +{ + /* might add further checks later on */ + return DSRTree::extractNode(); +} + + +DSRDocumentTreeNode *DSRDocumentSubTree::getAndRemoveRootNode() +{ + /* might add further checks later on */ + return DSRTree::getAndRemoveRootNode(); +} + + +size_t DSRDocumentSubTree::removeNode() +{ + /* might add further checks later on */ + return DSRTree::removeNode(); +} + + +DSRDocumentSubTree *DSRDocumentSubTree::cloneSubTree(const DSRDocumentTreeNodeCursor &startCursor, + const size_t stopAfterNodeID) +{ + /* create a copy of the specified subtree */ + return new DSRDocumentSubTree(startCursor, stopAfterNodeID); +} + + +OFCondition DSRDocumentSubTree::includeTemplate(const DSRSharedSubTemplate &subTemplate, + const E_AddMode addMode, + const E_RelationshipType defaultRelType) +{ + OFCondition result = EC_Normal; + /* make sure that managed object exists */ + if (subTemplate) + { + /* create node that stores the reference to the included template */ + DSRDocumentTreeNode *node = new DSRIncludedTemplateTreeNode(subTemplate, defaultRelType); + if (node != NULL) + { + /* check whether adding the node actually works */ + if (addNode(node, addMode) == 0) + { + result = SR_EC_CannotAddContentItem; + /* if not, delete node */ + delete node; + } + } else + result = EC_MemoryExhausted; + } else + result = EC_IllegalParameter; + return result; +} + + +OFCondition DSRDocumentSubTree::expandIncludedTemplates(DSRDocumentSubTree *tree) const +{ + OFCondition result = EC_Normal; + /* make sure that the passed tree pointer is valid and the tree is not empty */ + if ((tree != NULL) && (tree->gotoRoot() > 0)) + { + OFBool nodeDeleted; + DSRDocumentTreeNode *node; + /* iterate over all nodes */ + do { + node = tree->getNode(); + nodeDeleted = OFFalse; + if (node != NULL) + { + /* and expand the included templates (if any) */ + if (node->getValueType() == VT_includedTemplate) + { + DSRSubTemplate *subTempl = OFstatic_cast(DSRIncludedTemplateTreeNode *, node)->getValue().get(); + if (subTempl != NULL) + { + /* template has no content items */ + if (subTempl->isEmpty()) + { + /* just remove current node (included template) */ + nodeDeleted = (tree->removeNode() > 0); + } else { + /* make sure that by-reference relationships are "up to date" */ + subTempl->updateByReferenceRelationships(OFTrue /*updateIncludedTemplates*/); + /* clone the subtree managed by the template */ + DSRDocumentSubTree *subTree = subTempl->cloneTree(); + if (subTree != NULL) + { + /* check whether there are any "unknown" relationships on top level */ + const E_RelationshipType defaultRelType = node->getRelationshipType(); + DSRDocumentTreeNodeCursor cursor(subTree->getRoot()); + do { + DSRDocumentTreeNode *curNode = cursor.getNode(); + /* if so, replace them with the "default" relationship type */ + if ((curNode != NULL) && (curNode->getRelationshipType() == RT_unknown)) + curNode->setRelationshipType(defaultRelType); + } while (cursor.gotoNext()); + /* replace the current node (and its children) with the cloned subtree */ + if (tree->replaceNode(subTree->getRoot()) > 0) + { + /* "forget" reference to root node */ + subTree->getAndRemoveRootNode(); + } else + result = SR_EC_CannotInsertSubTree; + /* free memory */ + delete subTree; + } else + result = EC_MemoryExhausted; + } + } + } + } else + result = SR_EC_InvalidDocumentTree; + } while (result.good() && (nodeDeleted || tree->iterate())); + /* finally, set cursor back to root node */ + if (result.good()) + tree->gotoRoot(); + } else + result = EC_IllegalParameter; + return result; +} + + +template +OFCondition DSRDocumentSubTree::checkByReferenceRelationships(const size_t mode, + const size_t flags) +{ + OFCondition result = EC_Normal; + /* the update flags are mutually exclusive */ + if (!((mode & CM_updatePositionString) && (mode & CM_updateNodeID))) + { + /* by-reference relationships are only allowed for particular IODs */ + if ((ConstraintChecker == NULL) || ConstraintChecker->isByReferenceAllowed()) + { + /* specify for all content items not to be the target of a by-reference relationship */ + if (mode & CM_resetReferenceTargetFlag) + resetReferenceTargetFlag(); + /* pass flags to reference cursor (see below) */ + const DSRPositionCounter posCounter(flags); + /* start at the root of the document tree */ + T_Cursor cursor(getRoot()); + if (cursor.isValid()) + { + /* for all content items */ + do { + /* only check/update by-reference relationships */ + if (cursor.getNode()->getValueType() == VT_byReference) + { + size_t refNodeID = 0; + OFString nodePosString; + cursor.getPosition(nodePosString); + /* type cast to access members of by-reference class */ + DSRByReferenceTreeNode *byRefNode = OFstatic_cast(DSRByReferenceTreeNode *, cursor.getNode()); + if (flags & RF_showCurrentlyProcessedItem) + DCMSR_INFO("Updating by-reference relationship in content item " << nodePosString); + /* start searching from root node, be careful with large trees! (tbd: might be improved later on) */ + T_Cursor refCursor(getRoot(), &posCounter); + if (mode & CM_updateNodeID) + { + /* update node ID (based on position string) */ + refNodeID = refCursor.gotoNode(byRefNode->getReferencedContentItem()); + const DSRDocumentTreeNode *targetNode = (refNodeID > 0) ? refCursor.getNode() : NULL; + const E_ValueType targetValueType = (targetNode != NULL) ? targetNode->getValueType() : VT_invalid; + byRefNode->updateReference(refNodeID, targetValueType); + } else { + /* node ID is expected to be valid */ + refNodeID = refCursor.gotoNode(byRefNode->getReferencedNodeID()); + if (mode & CM_updatePositionString) + { + OFString refPosString; + /* update position string */ + if (refNodeID > 0) + refCursor.getPosition(refPosString); + byRefNode->updateReference(refPosString); + } else if (refNodeID == 0) + byRefNode->invalidateReference(); + } + const OFString refContentItem(byRefNode->getReferencedContentItem()); + if (refNodeID > 0) + { + /* source and target content items should not be identical */ + if (refNodeID != cursor.getNodeID()) + { + /* check whether target node is an ancestor of source node (prevent loops) */ + if (refContentItem.empty() || validByReferenceRelationship(nodePosString, refContentItem)) + { + /* refCursor should now point to the reference target (refNodeID > 0) */ + const DSRDocumentTreeNode *parentNode = cursor.getParentNode(); + DSRDocumentTreeNode *targetNode = refCursor.getNode(); + if ((parentNode != NULL) && (targetNode != NULL)) + { + /* specify that this content item is target of an by-reference relationship */ + targetNode->setReferenceTarget(); + /* do we really need to check the constraints? */ + E_RelationshipType relationshipType = byRefNode->getRelationshipType(); + if (!(flags & RF_ignoreRelationshipConstraints) && + (!(flags & RF_acceptUnknownRelationshipType) || (relationshipType != RT_unknown))) + { + /* check whether relationship is valid */ + if ((ConstraintChecker != NULL) && + !ConstraintChecker->checkContentRelationship(parentNode->getValueType(), relationshipType, + targetNode->getValueType(), OFTrue /*byReference*/)) + { + if (refContentItem.empty()) + DCMSR_WARN("Invalid by-reference relationship at content item \"" << nodePosString << "\""); + else { + DCMSR_WARN("Invalid by-reference relationship between content item \"" + << nodePosString << "\" and \"" << refContentItem << "\""); + } + } + } + } else + DCMSR_WARN("Corrupted data structures while checking by-reference relationships"); + } else { + DCMSR_WARN("By-reference relationship from \"" << nodePosString << "\" to ancestor content item \"" + << refContentItem << "\" (loop check)"); + } + } else + DCMSR_WARN("Source and target content item of by-reference relationship are identical"); + } else { + if (refContentItem.empty()) + DCMSR_WARN("Target content item of by-reference relationship does not exist"); + else + DCMSR_WARN("Target content item \"" << refContentItem << "\" of by-reference relationship does not exist"); + } + } + } while (result.good() && cursor.iterate()); + } + } + } else + result = EC_IllegalParameter; + return result; +} + + +void DSRDocumentSubTree::resetReferenceTargetFlag() +{ + DSRIncludedTemplateNodeCursor cursor(getRoot()); + if (cursor.isValid()) + { + /* iterate over all nodes */ + do { + /* and reset the flag */ + cursor.getNode()->setReferenceTarget(OFFalse); + } while (cursor.iterate()); + } +} + + +void DSRDocumentSubTree::updateTreeForOutput() +{ + /* nothing to do for this class, might be overwritten in derived classes */ +} + + +OFCondition DSRDocumentSubTree::checkSubTreeConstraints(const DSRDocumentSubTree *tree, + const DSRIODConstraintChecker *checker) const +{ + OFCondition result = EC_Normal; + /* make sure that the passed tree pointer is valid */ + if (tree != NULL) + { + /* do we have an IOD constraint checker? */ + if (checker != NULL) + { + /* check whether the nodes of the subtree can be added to this tree */ + DSRDocumentTreeNodeCursor cursor(tree->getRoot()); + if (cursor.isValid()) + { + OFBool check = OFTrue; + do { + const DSRDocumentTreeNode *node = cursor.getNode(); + const DSRDocumentTreeNode *parent = cursor.getParentNode(); + if (parent != NULL) + { + /* is it a by-reference relationship? */ + if (node->getValueType() == VT_byReference) + { + /* type cast to access members of by-reference class */ + const E_ValueType targetValueType = OFstatic_cast(const DSRByReferenceTreeNode *, node)->getTargetValueType(); + /* use 'target value type' that is stored within the node instance */ + check = checker->checkContentRelationship(parent->getValueType(), + node->getRelationshipType(), targetValueType, + OFTrue /*byReference*/); + } + /* is it an included template? */ + else if (node->getValueType() == VT_includedTemplate) + { + // tbd: need to implement a proper check for this case + DCMSR_TRACE("DSRDocumentSubTree::checkSubTreeConstraints() Need to check subtree of included template " + << "at node id:" << node->getNodeID() << " ... not yet implemented"); + } else { + /* check whether the relationship with parent is allowed */ + check = checker->checkContentRelationship(parent->getValueType(), + node->getRelationshipType(), node->getValueType()); + } + } + /* exit loop on first node that has a disallowed relationship */ + } while (cursor.iterate() && check); + /* there has been at least one disallowed relationship */ + if (!check) + result = SR_EC_IncompatibleDocumentTree; + } + } else { + /* if not, there is nothing we can do but it's no error */ + } + } else + result = EC_IllegalParameter; + return result; +} + + +// static functions + +OFBool DSRDocumentSubTree::validByReferenceRelationship(const OFString &sourcePosition, + const OFString &targetPosition) +{ + /* check whether target node is an ancestor of source node (prevent loops) */ + OFBool result = (sourcePosition != targetPosition); + if (result && (sourcePosition.length() > targetPosition.length()) && (sourcePosition.compare(0, targetPosition.length() + 1, targetPosition + ".") == 0)) + result = OFFalse; + return result; +} diff --git a/dcmsr/libsrc/dsrdoctn.cc b/dcmsr/libsrc/dsrdoctn.cc new file mode 100644 index 00000000..a0025a4b --- /dev/null +++ b/dcmsr/libsrc/dsrdoctn.cc @@ -0,0 +1,1392 @@ +/* + * + * Copyright (C) 2000-2019, OFFIS e.V. + * All rights reserved. See COPYRIGHT file for details. + * + * This software and supporting documentation were developed by + * + * OFFIS e.V. + * R&D Division Health + * Escherweg 2 + * D-26121 Oldenburg, Germany + * + * + * Module: dcmsr + * + * Author: Joerg Riesmeier + * + * Purpose: + * classes: DSRDocumentTreeNode + * + */ + + +#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ + +#include "dcmtk/dcmsr/dsrdoctn.h" +#include "dcmtk/dcmsr/dsrdncsr.h" +#include "dcmtk/dcmsr/dsrdtitn.h" +#include "dcmtk/dcmsr/dsrxmld.h" +#include "dcmtk/dcmsr/dsriodcc.h" + +#include "dcmtk/dcmdata/dcdeftag.h" +#include "dcmtk/dcmdata/dcuid.h" +#include "dcmtk/dcmdata/dcvrcs.h" +#include "dcmtk/dcmdata/dcvrdt.h" +#include "dcmtk/dcmdata/dcvrui.h" +#include "dcmtk/dcmdata/dcvrul.h" + + +DSRDocumentTreeNode::DSRDocumentTreeNode(const E_RelationshipType relationshipType, + const E_ValueType valueType) + : DSRTreeNode(), + MarkFlag(OFFalse), + ReferenceTarget(OFFalse), + RelationshipType(relationshipType), + ValueType(valueType), + ConceptName(), + ObservationDateTime(), + ObservationUID(), + TemplateIdentifier(), + MappingResource(), + MappingResourceUID(), + MACParameters(DCM_MACParametersSequence), + DigitalSignatures(DCM_DigitalSignaturesSequence) +{ +} + + +DSRDocumentTreeNode::DSRDocumentTreeNode(const DSRDocumentTreeNode &node) + : DSRTreeNode(node.Annotation), + MarkFlag(node.MarkFlag), + ReferenceTarget(OFFalse), + RelationshipType(node.RelationshipType), + ValueType(node.ValueType), + ConceptName(node.ConceptName), + ObservationDateTime(node.ObservationDateTime), + ObservationUID(node.ObservationUID), + TemplateIdentifier(node.TemplateIdentifier), + MappingResource(node.MappingResource), + MappingResourceUID(node.MappingResourceUID), + MACParameters(DCM_MACParametersSequence), + DigitalSignatures(DCM_DigitalSignaturesSequence) +{ +} + + +DSRDocumentTreeNode::~DSRDocumentTreeNode() +{ +} + + +OFBool DSRDocumentTreeNode::operator==(const DSRDocumentTreeNode &node) const +{ + /* only very basic information is used for comparing the two nodes */ + return (RelationshipType == node.RelationshipType) && + (ValueType == node.ValueType) && + (ConceptName == node.ConceptName); +} + + +OFBool DSRDocumentTreeNode::operator!=(const DSRDocumentTreeNode &node) const +{ + /* only very basic information is used for comparing the two nodes */ + return (RelationshipType != node.RelationshipType) || + (ValueType != node.ValueType) || + (ConceptName != node.ConceptName); +} + + +void DSRDocumentTreeNode::clear() +{ + MarkFlag = OFFalse; + ReferenceTarget = OFFalse; + ConceptName.clear(); + ObservationDateTime.clear(); + ObservationUID.clear(); + TemplateIdentifier.clear(); + MappingResource.clear(); + MappingResourceUID.clear(); + MACParameters.clear(); + DigitalSignatures.clear(); +} + + +OFBool DSRDocumentTreeNode::isValid() const +{ + return (RelationshipType != RT_invalid) && (ValueType != VT_invalid); +} + + +OFBool DSRDocumentTreeNode::hasValidValue() const +{ + return OFTrue; +} + + +OFBool DSRDocumentTreeNode::isShort(const size_t /*flags*/) const +{ + return OFTrue; +} + + +OFBool DSRDocumentTreeNode::hasTemplateIdentification() const +{ + /* mapping resource UID is optional, so do not check it */ + return !TemplateIdentifier.empty() && !MappingResource.empty(); +} + + +OFCondition DSRDocumentTreeNode::print(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + if (RelationshipType != RT_isRoot) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_RELATIONSHIP_TYPE) + stream << relationshipTypeToReadableName(RelationshipType) << " "; + } + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_VALUE_TYPE) + stream << valueTypeToDefinedTerm(ValueType); + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << ":"; + /* only print valid concept name codes */ + if (ConceptName.isValid() || (flags & PF_printInvalidCodes)) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_CONCEPT_NAME) + ConceptName.print(stream, (flags & PF_printConceptNameCodes) > 0 /*printCodeValue*/, flags); + } + return EC_Normal; +} + + +OFCondition DSRDocumentTreeNode::printExtended(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + /* print observation date/time (optional) */ + if (!ObservationDateTime.empty()) + { + OFString tmpString; + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << " {" << dicomToReadableDateTime(ObservationDateTime, tmpString) << "}"; + } + /* print annotation (optional) */ + if (hasAnnotation() && (flags & PF_printAnnotation)) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_ANNOTATION) + stream << " \"" << getAnnotation().getText() << "\""; + } + /* print template identification (conditional) */ + if (hasTemplateIdentification() && (flags & PF_printTemplateIdentification)) + { + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_DELIMITER) + stream << " # "; + DCMSR_PRINT_ANSI_ESCAPE_CODE(DCMSR_ANSI_ESCAPE_CODE_TEMPLATE_ID) + stream << "TID " << TemplateIdentifier; + stream << " (" << MappingResource; + if (!MappingResourceUID.empty()) + stream << ", " << MappingResourceUID; + stream << ")"; + } + return EC_Normal; +} + + +OFCondition DSRDocumentTreeNode::read(DcmItem &dataset, + const DSRIODConstraintChecker *constraintChecker, + const size_t flags) +{ + return readSRDocumentContentModule(dataset, constraintChecker, flags); +} + + +OFCondition DSRDocumentTreeNode::write(DcmItem &dataset, + DcmStack *markedItems) +{ + return writeSRDocumentContentModule(dataset, markedItems); +} + + +OFCondition DSRDocumentTreeNode::readXML(const DSRXMLDocument &doc, + DSRXMLCursor cursor, + const E_DocumentType documentType, + const size_t flags) +{ + OFCondition result = SR_EC_InvalidDocument; + if (cursor.valid()) + { + OFString idAttr; + OFString mappingResource; + OFString mappingResourceUID; + OFString templateIdentifier; + /* important: NULL indicates first child node */ + DSRDocumentTreeNode *node = NULL; + /* read "id" attribute (optional) and compare with expected value */ + if (!doc.getStringFromAttribute(cursor, idAttr, "id", OFFalse /*encoding*/, OFFalse /*required*/).empty() && + (stringToNumber(idAttr.c_str()) != getNodeID())) + { + /* create warning message */ + DCMSR_WARN("XML attribute 'id' (" << idAttr << ") deviates from current node number (" << getNodeID() << ")"); + } + /* template identification information expected "inside" content item */ + if (!(flags & XF_templateElementEnclosesItems)) + { + /* check for optional template identification */ + const DSRXMLCursor childCursor = doc.getNamedChildNode(cursor, "template", OFFalse /*required*/); + if (childCursor.valid()) + { + /* check whether information is stored as XML attributes */ + if (doc.hasAttribute(childCursor, "tid")) + { + doc.getStringFromAttribute(childCursor, mappingResource, "resource"); + doc.getStringFromAttribute(childCursor, mappingResourceUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/); + doc.getStringFromAttribute(childCursor, templateIdentifier, "tid"); + } else { + const DSRXMLCursor resourceCursor = doc.getNamedChildNode(childCursor, "resource"); + if (resourceCursor.valid()) + { + doc.getStringFromAttribute(resourceCursor, mappingResourceUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/); + doc.getStringFromNodeContent(resourceCursor, mappingResource); + } + doc.getStringFromNodeContent(doc.getNamedChildNode(childCursor, "id"), templateIdentifier); + } + if (setTemplateIdentification(templateIdentifier, mappingResource, mappingResourceUID).bad()) + DCMSR_WARN("Content item has invalid/incomplete template identification"); + } + } + /* read concept name (not required in some cases) */ + ConceptName.readXML(doc, doc.getNamedChildNode(cursor, "concept", OFFalse /*required*/), flags); + /* read observation UID and date/time (optional) */ + const DSRXMLCursor childCursor = doc.getNamedChildNode(cursor, "observation", OFFalse /*required*/); + if (childCursor.valid()) + { + doc.getStringFromAttribute(childCursor, ObservationUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/); + DSRDateTimeTreeNode::getValueFromXMLNodeContent(doc, doc.getNamedChildNode(childCursor, "datetime", OFFalse /*required*/), ObservationDateTime); + } + /* read node content (depends on value type) */ + result = readXMLContentItem(doc, cursor, flags); + /* goto first child node */ + cursor.gotoChild(); + /* iterate over all child content items */ + while (cursor.valid() && result.good()) + { + /* template identification information expected "outside" content item */ + if (flags & XF_templateElementEnclosesItems) + { + /* check for optional template identification */ + if (doc.matchNode(cursor, "template")) + { + doc.getStringFromAttribute(cursor, mappingResource, "resource"); + doc.getStringFromAttribute(cursor, mappingResourceUID, "uid", OFFalse /*encoding*/, OFFalse /*required*/); + doc.getStringFromAttribute(cursor, templateIdentifier, "tid"); + /* goto first child of the "template" element */ + cursor.gotoChild(); + } + } + /* get SR value type from current XML node, also supports "by-reference" detection */ + E_ValueType valueType = doc.getValueTypeFromNode(cursor); + /* invalid types are silently ignored */ + if (valueType != VT_invalid) + { + /* get SR relationship type */ + E_RelationshipType relationshipType = doc.getRelationshipTypeFromNode(cursor); + /* create new node (by-value or by-reference), do not check constraints */ + result = createAndAppendNewNode(node, relationshipType, valueType); + if (result.good()) + { + if ((flags & XF_templateElementEnclosesItems) && (valueType != VT_byReference)) + { + /* set template identification (if any) */ + if (node->setTemplateIdentification(templateIdentifier, mappingResource, mappingResourceUID).bad()) + DCMSR_WARN("Content item has invalid/incomplete template identification"); + } + /* proceed with reading child nodes */ + result = node->readXML(doc, cursor, documentType, flags); + /* print node error message (if any) */ + doc.printGeneralNodeError(cursor, result); + } else { + /* create new node failed */ + DCMSR_ERROR("Cannot add \"" << relationshipTypeToReadableName(relationshipType) << " " + << valueTypeToDefinedTerm(valueType /*target item*/) << "\" to " + << valueTypeToDefinedTerm(ValueType /*source item*/) << " in " + << documentTypeToReadableName(documentType)); + } + } + /* proceed with next node */ + cursor.gotoNext(); + } + } + return result; +} + + +OFCondition DSRDocumentTreeNode::readXMLContentItem(const DSRXMLDocument & /*doc*/, + DSRXMLCursor /*cursor*/, + const size_t /*flags*/) +{ + return EC_IllegalCall; +} + + +OFCondition DSRDocumentTreeNode::writeXML(STD_NAMESPACE ostream &stream, + const size_t flags) const +{ + OFCondition result = EC_Normal; + /* check for validity */ + if (!isValid()) + printInvalidContentItemMessage("Writing to XML", this); + /* write optional template identification */ + if ((flags & XF_writeTemplateIdentification) && !(flags & XF_templateElementEnclosesItems)) + { + if (hasTemplateIdentification()) + { + if (flags & XF_templateIdentifierAsAttribute) + { + stream << "